From fa8c5b0f2d547efe72274b3e9b88269a9113169a Mon Sep 17 00:00:00 2001 From: Ivan Maslov Date: Sun, 13 Oct 2019 18:10:10 +0300 Subject: [PATCH] #Import GREQUESTS (async requests) to python x32 and x64 #Get/Set GlobalDict value #IntegrationOrchestrator tool --- v1.0.1/Orchestrator/Web/Index.xhtml | 24 + .../orchestratorConfiguration.json | 10 + .../Orchestrator/orchestratorConfiguration.py | 56 +- v1.0.1/Orchestrator/orchestratorProcessor.py | 39 +- v1.0.1/Orchestrator/orchestratorServer.py | 7 + .../_cffi_backend.cp37-win32.pyd | Bin 0 -> 139264 bytes .../cffi-1.12.3.dist-info/INSTALLER | 1 + .../cffi-1.12.3.dist-info/LICENSE | 26 + .../cffi-1.12.3.dist-info/METADATA | 36 + .../cffi-1.12.3.dist-info/RECORD | 44 + .../site-packages/cffi-1.12.3.dist-info/WHEEL | 5 + .../cffi-1.12.3.dist-info/entry_points.txt | 3 + .../cffi-1.12.3.dist-info/top_level.txt | 2 + .../Lib/site-packages/cffi/__init__.py | 14 + .../Lib/site-packages/cffi/_cffi_errors.h | 147 + .../Lib/site-packages/cffi/_cffi_include.h | 308 + .../Lib/site-packages/cffi/_embedding.h | 518 + .../Lib/site-packages/cffi/api.py | 961 + .../Lib/site-packages/cffi/backend_ctypes.py | 1121 + .../Lib/site-packages/cffi/cffi_opcode.py | 187 + .../Lib/site-packages/cffi/commontypes.py | 80 + .../Lib/site-packages/cffi/cparser.py | 931 + .../Lib/site-packages/cffi/error.py | 31 + .../Lib/site-packages/cffi/ffiplatform.py | 127 + .../Lib/site-packages/cffi/lock.py | 30 + .../Lib/site-packages/cffi/model.py | 614 + .../Lib/site-packages/cffi/parse_c_type.h | 181 + .../Lib/site-packages/cffi/pkgconfig.py | 121 + .../Lib/site-packages/cffi/recompiler.py | 1542 + .../Lib/site-packages/cffi/setuptools_ext.py | 217 + .../Lib/site-packages/cffi/vengine_cpy.py | 1015 + .../Lib/site-packages/cffi/vengine_gen.py | 675 + .../Lib/site-packages/cffi/verifier.py | 306 + .../gevent-1.4.0.dist-info/AUTHORS | 62 + .../gevent-1.4.0.dist-info/INSTALLER | 1 + .../gevent-1.4.0.dist-info/LICENSE | 25 + .../gevent-1.4.0.dist-info/METADATA | 367 + .../gevent-1.4.0.dist-info/NOTICE | 94 + .../gevent-1.4.0.dist-info/RECORD | 563 + .../gevent-1.4.0.dist-info/WHEEL | 5 + .../gevent-1.4.0.dist-info/entry_points.txt | 3 + .../gevent-1.4.0.dist-info/top_level.txt | 1 + .../gevent/__abstract_linkable.cp37-win32.pyd | Bin 0 -> 59904 bytes .../gevent/__abstract_linkable.pxd | 53 + .../__greenlet_primitives.cp37-win32.pyd | Bin 0 -> 47104 bytes .../gevent/__greenlet_primitives.pxd | 47 + .../gevent/__hub_local.cp37-win32.pyd | Bin 0 -> 43520 bytes .../Lib/site-packages/gevent/__hub_local.pxd | 17 + .../gevent/__hub_primitives.cp37-win32.pyd | Bin 0 -> 103424 bytes .../site-packages/gevent/__hub_primitives.pxd | 73 + .../gevent/__ident.cp37-win32.pyd | Bin 0 -> 39424 bytes .../Lib/site-packages/gevent/__ident.pxd | 26 + .../gevent/__imap.cp37-win32.pyd | Bin 0 -> 72192 bytes .../Lib/site-packages/gevent/__imap.pxd | 45 + .../Lib/site-packages/gevent/__init__.py | 180 + .../gevent/__semaphore.cp37-win32.pyd | Bin 0 -> 66048 bytes .../Lib/site-packages/gevent/__semaphore.pxd | 23 + .../gevent/__tracer.cp37-win32.pyd | Bin 0 -> 73728 bytes .../Lib/site-packages/gevent/__tracer.pxd | 43 + .../gevent/__waiter.cp37-win32.pyd | Bin 0 -> 64000 bytes .../Lib/site-packages/gevent/__waiter.pxd | 48 + .../site-packages/gevent/_abstract_linkable.c | 8464 ++++++ .../gevent/_abstract_linkable.html | 2189 ++ .../gevent/_abstract_linkable.py | 202 + .../Lib/site-packages/gevent/_compat.py | 160 + .../Lib/site-packages/gevent/_config.py | 701 + .../gevent/_event.cp37-win32.pyd | Bin 0 -> 88064 bytes .../Lib/site-packages/gevent/_event.pxd | 30 + .../Lib/site-packages/gevent/_ffi/__init__.py | 27 + .../Lib/site-packages/gevent/_ffi/callback.py | 58 + .../Lib/site-packages/gevent/_ffi/loop.py | 713 + .../Lib/site-packages/gevent/_ffi/watcher.py | 641 + .../site-packages/gevent/_fileobjectcommon.py | 281 + .../site-packages/gevent/_fileobjectposix.py | 357 + .../gevent/_greenlet.cp37-win32.pyd | Bin 0 -> 191488 bytes .../Lib/site-packages/gevent/_greenlet.pxd | 177 + .../gevent/_greenlet_primitives.c | 6562 +++++ .../gevent/_greenlet_primitives.html | 1246 + .../gevent/_greenlet_primitives.py | 90 + .../Lib/site-packages/gevent/_hub_local.c | 5841 ++++ .../Lib/site-packages/gevent/_hub_local.html | 1141 + .../Lib/site-packages/gevent/_hub_local.py | 101 + .../site-packages/gevent/_hub_primitives.c | 12492 ++++++++ .../site-packages/gevent/_hub_primitives.html | 4991 ++++ .../site-packages/gevent/_hub_primitives.py | 394 + .../Lib/site-packages/gevent/_ident.c | 5548 ++++ .../Lib/site-packages/gevent/_ident.html | 884 + .../Lib/site-packages/gevent/_ident.py | 82 + .../Lib/site-packages/gevent/_imap.c | 10616 +++++++ .../Lib/site-packages/gevent/_imap.html | 2184 ++ .../Lib/site-packages/gevent/_imap.py | 227 + .../Lib/site-packages/gevent/_interfaces.py | 230 + .../gevent/_local.cp37-win32.pyd | Bin 0 -> 107008 bytes .../Lib/site-packages/gevent/_local.pxd | 113 + .../Lib/site-packages/gevent/_monitor.py | 325 + .../Lib/site-packages/gevent/_patcher.py | 127 + .../gevent/_queue.cp37-win32.pyd | Bin 0 -> 173056 bytes .../Lib/site-packages/gevent/_queue.pxd | 74 + .../Lib/site-packages/gevent/_semaphore.c | 8412 ++++++ .../Lib/site-packages/gevent/_semaphore.html | 2285 ++ .../Lib/site-packages/gevent/_semaphore.py | 188 + .../Lib/site-packages/gevent/_socket2.py | 473 + .../Lib/site-packages/gevent/_socket3.py | 756 + .../Lib/site-packages/gevent/_socketcommon.py | 401 + .../Lib/site-packages/gevent/_ssl2.py | 441 + .../Lib/site-packages/gevent/_ssl3.py | 712 + .../Lib/site-packages/gevent/_sslgte279.py | 714 + .../Lib/site-packages/gevent/_tblib.py | 432 + .../Lib/site-packages/gevent/_threading.py | 168 + .../Lib/site-packages/gevent/_tracer.c | 9661 ++++++ .../Lib/site-packages/gevent/_tracer.html | 3096 ++ .../Lib/site-packages/gevent/_tracer.py | 179 + .../Lib/site-packages/gevent/_util.py | 178 + .../Lib/site-packages/gevent/_util_py2.py | 23 + .../Lib/site-packages/gevent/_waiter.c | 8893 ++++++ .../Lib/site-packages/gevent/_waiter.html | 2281 ++ .../Lib/site-packages/gevent/_waiter.py | 204 + .../Lib/site-packages/gevent/ares.py | 10 + .../Lib/site-packages/gevent/backdoor.py | 210 + .../Lib/site-packages/gevent/baseserver.py | 409 + .../Lib/site-packages/gevent/builtins.py | 135 + .../Lib/site-packages/gevent/core.py | 20 + .../Lib/site-packages/gevent/event.c | 10734 +++++++ .../Lib/site-packages/gevent/event.html | 3680 +++ .../Lib/site-packages/gevent/event.py | 363 + .../Lib/site-packages/gevent/events.py | 480 + .../Lib/site-packages/gevent/exceptions.py | 79 + .../Lib/site-packages/gevent/fileobject.py | 61 + .../Lib/site-packages/gevent/greenlet.c | 24316 ++++++++++++++++ .../Lib/site-packages/gevent/greenlet.html | 10062 +++++++ .../Lib/site-packages/gevent/greenlet.py | 1003 + .../Lib/site-packages/gevent/hub.py | 750 + .../site-packages/gevent/libev/__init__.py | 7 + .../gevent/libev/_corecffi_build.py | 75 + .../gevent/libev/_corecffi_cdef.c | 243 + .../gevent/libev/_corecffi_source.c | 69 + .../site-packages/gevent/libev/callbacks.c | 216 + .../site-packages/gevent/libev/callbacks.h | 38 + .../Lib/site-packages/gevent/libev/corecext.c | 23545 +++++++++++++++ .../gevent/libev/corecext.cp37-win32.pyd | Bin 0 -> 217600 bytes .../Lib/site-packages/gevent/libev/corecext.h | 148 + .../site-packages/gevent/libev/corecext.html | 15651 ++++++++++ .../site-packages/gevent/libev/corecext.pyx | 1352 + .../site-packages/gevent/libev/corecffi.py | 427 + .../Lib/site-packages/gevent/libev/libev.h | 100 + .../Lib/site-packages/gevent/libev/libev.pxd | 235 + .../site-packages/gevent/libev/libev_vfd.h | 225 + .../site-packages/gevent/libev/stathelper.c | 187 + .../Lib/site-packages/gevent/libev/watcher.py | 286 + .../site-packages/gevent/libuv/__init__.py | 7 + .../gevent/libuv/_corecffi.cp37-win32.pyd | Bin 0 -> 128000 bytes .../gevent/libuv/_corecffi_build.py | 256 + .../gevent/libuv/_corecffi_cdef.c | 393 + .../gevent/libuv/_corecffi_source.c | 181 + .../Lib/site-packages/gevent/libuv/loop.py | 602 + .../Lib/site-packages/gevent/libuv/watcher.py | 735 + .../Lib/site-packages/gevent/local.c | 13993 +++++++++ .../Lib/site-packages/gevent/local.html | 4282 +++ .../Lib/site-packages/gevent/local.py | 605 + .../Lib/site-packages/gevent/lock.py | 260 + .../Lib/site-packages/gevent/monkey.py | 1079 + .../Lib/site-packages/gevent/os.py | 510 + .../Lib/site-packages/gevent/pool.py | 675 + .../Lib/site-packages/gevent/pywsgi.py | 1549 + .../Lib/site-packages/gevent/queue.c | 21853 ++++++++++++++ .../Lib/site-packages/gevent/queue.html | 9489 ++++++ .../Lib/site-packages/gevent/queue.py | 685 + .../site-packages/gevent/resolver/__init__.py | 105 + .../Lib/site-packages/gevent/resolver/ares.py | 357 + .../site-packages/gevent/resolver/blocking.py | 45 + .../Lib/site-packages/gevent/resolver/cares.c | 15082 ++++++++++ .../gevent/resolver/cares.cp37-win32.pyd | Bin 0 -> 154624 bytes .../site-packages/gevent/resolver/cares.html | 6049 ++++ .../site-packages/gevent/resolver/cares.pyx | 464 + .../gevent/resolver/cares_ntop.h | 7 + .../gevent/resolver/cares_pton.h | 8 + .../site-packages/gevent/resolver/dnshelper.c | 159 + .../gevent/resolver/dnspython.py | 662 + .../gevent/resolver/libcares.pxd | 109 + .../site-packages/gevent/resolver/thread.py | 71 + .../Lib/site-packages/gevent/resolver_ares.py | 17 + .../site-packages/gevent/resolver_thread.py | 17 + .../Lib/site-packages/gevent/select.py | 286 + .../Lib/site-packages/gevent/server.py | 282 + .../Lib/site-packages/gevent/signal.py | 137 + .../Lib/site-packages/gevent/socket.py | 129 + .../Lib/site-packages/gevent/ssl.py | 35 + .../Lib/site-packages/gevent/subprocess.py | 1688 ++ .../site-packages/gevent/testing/__init__.py | 137 + .../testing/coveragesite/sitecustomize.py | 17 + .../gevent/testing/errorhandler.py | 53 + .../site-packages/gevent/testing/exception.py | 23 + .../Lib/site-packages/gevent/testing/flaky.py | 114 + .../Lib/site-packages/gevent/testing/hub.py | 35 + .../site-packages/gevent/testing/leakcheck.py | 206 + .../site-packages/gevent/testing/modules.py | 85 + .../gevent/testing/monkey_test.py | 75 + .../site-packages/gevent/testing/openfiles.py | 125 + .../site-packages/gevent/testing/params.py | 83 + .../gevent/testing/patched_tests_setup.py | 1139 + .../Lib/site-packages/gevent/testing/six.py | 42 + .../site-packages/gevent/testing/skipping.py | 116 + .../site-packages/gevent/testing/sockets.py | 41 + .../site-packages/gevent/testing/switching.py | 64 + .../site-packages/gevent/testing/sysinfo.py | 137 + .../site-packages/gevent/testing/testcase.py | 340 + .../gevent/testing/testrunner.py | 481 + .../site-packages/gevent/testing/timing.py | 139 + .../Lib/site-packages/gevent/testing/util.py | 453 + .../gevent/tests/2_7_keycert.pem | 31 + .../site-packages/gevent/tests/__init__.py | 0 .../site-packages/gevent/tests/__main__.py | 6 + .../gevent/tests/_blocks_at_top_level.py | 3 + .../gevent/tests/_import_import_patch.py | 1 + .../gevent/tests/_import_patch.py | 2 + .../gevent/tests/_import_wait.py | 26 + .../gevent/tests/_imports_at_top_level.py | 2 + .../tests/_imports_imports_at_top_level.py | 13 + .../site-packages/gevent/tests/badcert.pem | 36 + .../Lib/site-packages/gevent/tests/badkey.pem | 40 + .../gevent/tests/getaddrinfo_module.py | 4 + .../site-packages/gevent/tests/hosts_file.txt | 10351 +++++++ .../tests/https_svn_python_org_root.pem | 41 + .../site-packages/gevent/tests/keycert.pem | 32 + .../gevent/tests/known_failures.py | 398 + .../site-packages/gevent/tests/lock_tests.py | 767 + .../gevent/tests/monkey_package/__main__.py | 5 + .../tests/monkey_package/issue302monkey.py | 28 + .../gevent/tests/monkey_package/script.py | 19 + .../site-packages/gevent/tests/nullcert.pem | 0 .../Lib/site-packages/gevent/tests/server.crt | 15 + .../Lib/site-packages/gevent/tests/server.key | 15 + .../Lib/site-packages/gevent/tests/sha256.pem | 33 + .../gevent/tests/test__GreenletExit.py | 4 + .../gevent/tests/test___config.py | 154 + .../gevent/tests/test___example_servers.py | 141 + .../gevent/tests/test___ident.py | 80 + .../gevent/tests/test___monitor.py | 386 + .../gevent/tests/test___monkey_patching.py | 113 + .../site-packages/gevent/tests/test__all__.py | 241 + .../site-packages/gevent/tests/test__api.py | 132 + .../gevent/tests/test__api_timeout.py | 210 + .../gevent/tests/test__ares_host_result.py | 31 + .../gevent/tests/test__ares_timeout.py | 52 + .../gevent/tests/test__backdoor.py | 135 + .../gevent/tests/test__close_backend_fd.py | 63 + .../gevent/tests/test__compat.py | 56 + .../site-packages/gevent/tests/test__core.py | 170 + .../gevent/tests/test__core_async.py | 24 + .../gevent/tests/test__core_callback.py | 31 + .../gevent/tests/test__core_fork.py | 58 + .../gevent/tests/test__core_loop_run.py | 25 + .../tests/test__core_loop_run_sig_mod.py | 16 + .../gevent/tests/test__core_stat.py | 118 + .../gevent/tests/test__core_timer.py | 157 + .../gevent/tests/test__core_watcher.py | 124 + .../gevent/tests/test__destroy.py | 51 + .../tests/test__destroy_default_loop.py | 56 + .../gevent/tests/test__doctests.py | 133 + .../gevent/tests/test__environ.py | 17 + .../site-packages/gevent/tests/test__event.py | 254 + .../gevent/tests/test__events.py | 39 + .../gevent/tests/test__example_echoserver.py | 40 + .../tests/test__example_portforwarder.py | 66 + .../gevent/tests/test__example_udp_client.py | 31 + .../gevent/tests/test__example_udp_server.py | 22 + .../gevent/tests/test__examples.py | 87 + .../gevent/tests/test__exc_info.py | 58 + .../gevent/tests/test__execmodules.py | 39 + .../gevent/tests/test__fileobject.py | 278 + .../gevent/tests/test__getaddrinfo_import.py | 7 + .../gevent/tests/test__greenio.py | 128 + .../gevent/tests/test__greenlet.py | 831 + .../gevent/tests/test__greenletset.py | 164 + .../gevent/tests/test__greenness.py | 73 + .../site-packages/gevent/tests/test__hub.py | 332 + .../gevent/tests/test__hub_join.py | 23 + .../gevent/tests/test__hub_join_timeout.py | 99 + .../test__import_blocking_in_greenlet.py | 22 + .../gevent/tests/test__import_wait.py | 7 + .../gevent/tests/test__issue112.py | 19 + .../gevent/tests/test__issue230.py | 23 + .../gevent/tests/test__issue330.py | 81 + .../gevent/tests/test__issue467.py | 35 + .../gevent/tests/test__issue6.py | 34 + .../gevent/tests/test__issue600.py | 48 + .../gevent/tests/test__issue607.py | 42 + .../gevent/tests/test__issue639.py | 4 + .../gevent/tests/test__issue_728.py | 9 + .../gevent/tests/test__issues461_471.py | 91 + .../site-packages/gevent/tests/test__iwait.py | 42 + .../gevent/tests/test__joinall.py | 10 + .../site-packages/gevent/tests/test__local.py | 428 + .../gevent/tests/test__loop_callback.py | 13 + .../gevent/tests/test__makefile_ref.py | 516 + .../gevent/tests/test__memleak.py | 56 + .../gevent/tests/test__monkey.py | 151 + .../tests/test__monkey_builtins_future.py | 16 + .../tests/test__monkey_hub_in_thread.py | 28 + .../gevent/tests/test__monkey_logging.py | 41 + .../tests/test__monkey_multiple_imports.py | 6 + .../gevent/tests/test__monkey_queue.py | 331 + .../gevent/tests/test__monkey_scope.py | 61 + .../gevent/tests/test__monkey_selectors.py | 22 + .../gevent/tests/test__monkey_sigchld.py | 69 + .../gevent/tests/test__monkey_sigchld_2.py | 51 + .../gevent/tests/test__monkey_sigchld_3.py | 52 + .../gevent/tests/test__monkey_ssl_warning.py | 34 + .../gevent/tests/test__monkey_ssl_warning2.py | 44 + .../gevent/tests/test__monkey_ssl_warning3.py | 47 + .../gevent/tests/test__nondefaultloop.py | 12 + .../site-packages/gevent/tests/test__order.py | 61 + .../site-packages/gevent/tests/test__os.py | 178 + .../site-packages/gevent/tests/test__pool.py | 603 + .../gevent/tests/test__pywsgi.py | 1811 ++ .../site-packages/gevent/tests/test__queue.py | 465 + .../gevent/tests/test__real_greenlet.py | 29 + .../gevent/tests/test__refcount.py | 162 + .../gevent/tests/test__refcount_core.py | 24 + .../gevent/tests/test__select.py | 114 + .../gevent/tests/test__semaphore.py | 91 + .../gevent/tests/test__server.py | 515 + .../gevent/tests/test__server_pywsgi.py | 106 + .../gevent/tests/test__signal.py | 122 + .../gevent/tests/test__sleep0.py | 10 + .../gevent/tests/test__socket.py | 452 + .../gevent/tests/test__socket_close.py | 58 + .../gevent/tests/test__socket_dns.py | 718 + .../gevent/tests/test__socket_dns6.py | 81 + .../gevent/tests/test__socket_errors.py | 46 + .../gevent/tests/test__socket_ex.py | 43 + .../tests/test__socket_send_memoryview.py | 39 + .../gevent/tests/test__socket_ssl.py | 39 + .../gevent/tests/test__socket_timeout.py | 54 + .../gevent/tests/test__socketpair.py | 35 + .../site-packages/gevent/tests/test__ssl.py | 104 + .../gevent/tests/test__subprocess.py | 491 + .../tests/test__subprocess_interrupted.py | 20 + .../gevent/tests/test__subprocess_poll.py | 9 + .../gevent/tests/test__systemerror.py | 108 + .../gevent/tests/test__threading.py | 50 + .../gevent/tests/test__threading_2.py | 610 + .../tests/test__threading_before_monkey.py | 23 + ...st__threading_holding_lock_while_monkey.py | 8 + .../tests/test__threading_monkey_in_thread.py | 65 + .../test__threading_native_before_monkey.py | 57 + .../tests/test__threading_patched_local.py | 24 + .../tests/test__threading_vs_settrace.py | 163 + .../gevent/tests/test__threadpool.py | 653 + .../test__threadpool_executor_patched.py | 18 + .../gevent/tests/test__timeout.py | 159 + .../site-packages/gevent/tests/test__util.py | 292 + .../gevent/tests/test_server.crt | 15 + .../gevent/tests/test_server.key | 15 + .../tests/tests_that_dont_do_leakchecks.txt | 9 + .../tests/tests_that_dont_monkeypatch.txt | 26 + .../tests/tests_that_dont_use_resolver.txt | 136 + .../site-packages/gevent/tests/wrongcert.pem | 32 + .../Lib/site-packages/gevent/thread.py | 114 + .../Lib/site-packages/gevent/threading.py | 235 + .../Lib/site-packages/gevent/threadpool.py | 580 + .../Lib/site-packages/gevent/time.py | 27 + .../Lib/site-packages/gevent/timeout.py | 373 + .../Lib/site-packages/gevent/util.py | 603 + .../Lib/site-packages/gevent/win32util.py | 98 + .../greenlet-0.4.15.dist-info/INSTALLER | 1 + .../greenlet-0.4.15.dist-info/METADATA | 90 + .../greenlet-0.4.15.dist-info/RECORD | 7 + .../greenlet-0.4.15.dist-info/WHEEL | 5 + .../greenlet-0.4.15.dist-info/top_level.txt | 1 + .../Lib/site-packages/greenlet.cp37-win32.pyd | Bin 0 -> 22528 bytes .../grequests-0.4.0.dist-info/AUTHORS.rst | 12 + .../grequests-0.4.0.dist-info/INSTALLER | 1 + .../grequests-0.4.0.dist-info/LICENSE | 8 + .../grequests-0.4.0.dist-info/METADATA | 51 + .../grequests-0.4.0.dist-info/RECORD | 9 + .../grequests-0.4.0.dist-info/WHEEL | 5 + .../grequests-0.4.0.dist-info/top_level.txt | 1 + .../Lib/site-packages/grequests.py | 155 + .../pycparser-2.19.dist-info/INSTALLER | 1 + .../pycparser-2.19.dist-info/LICENSE | 27 + .../pycparser-2.19.dist-info/METADATA | 27 + .../pycparser-2.19.dist-info/RECORD | 41 + .../pycparser-2.19.dist-info/WHEEL | 6 + .../pycparser-2.19.dist-info/top_level.txt | 1 + .../Lib/site-packages/pycparser/__init__.py | 90 + .../Lib/site-packages/pycparser/_ast_gen.py | 338 + .../site-packages/pycparser/_build_tables.py | 33 + .../Lib/site-packages/pycparser/_c_ast.cfg | 191 + .../site-packages/pycparser/ast_transforms.py | 105 + .../Lib/site-packages/pycparser/c_ast.py | 1084 + .../site-packages/pycparser/c_generator.py | 428 + .../Lib/site-packages/pycparser/c_lexer.py | 484 + .../Lib/site-packages/pycparser/c_parser.py | 1850 ++ .../Lib/site-packages/pycparser/lextab.py | 10 + .../site-packages/pycparser/ply/__init__.py | 5 + .../Lib/site-packages/pycparser/ply/cpp.py | 905 + .../site-packages/pycparser/ply/ctokens.py | 133 + .../Lib/site-packages/pycparser/ply/lex.py | 1099 + .../Lib/site-packages/pycparser/ply/yacc.py | 3494 +++ .../Lib/site-packages/pycparser/ply/ygen.py | 74 + .../Lib/site-packages/pycparser/plyparser.py | 133 + .../Lib/site-packages/pycparser/yacctab.py | 338 + .../python-3.7.2/include/greenlet/greenlet.h | 157 + .../_cffi_backend.cp37-win_amd64.pyd | Bin 0 -> 174592 bytes .../cffi-1.12.3.dist-info/INSTALLER | 1 + .../cffi-1.12.3.dist-info/LICENSE | 26 + .../cffi-1.12.3.dist-info/METADATA | 36 + .../cffi-1.12.3.dist-info/RECORD | 44 + .../site-packages/cffi-1.12.3.dist-info/WHEEL | 5 + .../cffi-1.12.3.dist-info/entry_points.txt | 3 + .../cffi-1.12.3.dist-info/top_level.txt | 2 + .../Lib/site-packages/cffi/__init__.py | 14 + .../Lib/site-packages/cffi/_cffi_errors.h | 147 + .../Lib/site-packages/cffi/_cffi_include.h | 308 + .../Lib/site-packages/cffi/_embedding.h | 518 + .../Lib/site-packages/cffi/api.py | 961 + .../Lib/site-packages/cffi/backend_ctypes.py | 1121 + .../Lib/site-packages/cffi/cffi_opcode.py | 187 + .../Lib/site-packages/cffi/commontypes.py | 80 + .../Lib/site-packages/cffi/cparser.py | 931 + .../Lib/site-packages/cffi/error.py | 31 + .../Lib/site-packages/cffi/ffiplatform.py | 127 + .../Lib/site-packages/cffi/lock.py | 30 + .../Lib/site-packages/cffi/model.py | 614 + .../Lib/site-packages/cffi/parse_c_type.h | 181 + .../Lib/site-packages/cffi/pkgconfig.py | 121 + .../Lib/site-packages/cffi/recompiler.py | 1542 + .../Lib/site-packages/cffi/setuptools_ext.py | 217 + .../Lib/site-packages/cffi/vengine_cpy.py | 1015 + .../Lib/site-packages/cffi/vengine_gen.py | 675 + .../Lib/site-packages/cffi/verifier.py | 306 + .../gevent-1.4.0.dist-info/AUTHORS | 62 + .../gevent-1.4.0.dist-info/INSTALLER | 1 + .../gevent-1.4.0.dist-info/LICENSE | 25 + .../gevent-1.4.0.dist-info/METADATA | 367 + .../gevent-1.4.0.dist-info/NOTICE | 94 + .../gevent-1.4.0.dist-info/RECORD | 563 + .../gevent-1.4.0.dist-info/WHEEL | 5 + .../gevent-1.4.0.dist-info/entry_points.txt | 3 + .../gevent-1.4.0.dist-info/top_level.txt | 1 + .../__abstract_linkable.cp37-win_amd64.pyd | Bin 0 -> 71168 bytes .../gevent/__abstract_linkable.pxd | 53 + .../__greenlet_primitives.cp37-win_amd64.pyd | Bin 0 -> 57856 bytes .../gevent/__greenlet_primitives.pxd | 47 + .../gevent/__hub_local.cp37-win_amd64.pyd | Bin 0 -> 54272 bytes .../Lib/site-packages/gevent/__hub_local.pxd | 17 + .../__hub_primitives.cp37-win_amd64.pyd | Bin 0 -> 120832 bytes .../site-packages/gevent/__hub_primitives.pxd | 73 + .../gevent/__ident.cp37-win_amd64.pyd | Bin 0 -> 49664 bytes .../Lib/site-packages/gevent/__ident.pxd | 26 + .../gevent/__imap.cp37-win_amd64.pyd | Bin 0 -> 86528 bytes .../Lib/site-packages/gevent/__imap.pxd | 45 + .../Lib/site-packages/gevent/__init__.py | 180 + .../gevent/__semaphore.cp37-win_amd64.pyd | Bin 0 -> 78336 bytes .../Lib/site-packages/gevent/__semaphore.pxd | 23 + .../gevent/__tracer.cp37-win_amd64.pyd | Bin 0 -> 86528 bytes .../Lib/site-packages/gevent/__tracer.pxd | 43 + .../gevent/__waiter.cp37-win_amd64.pyd | Bin 0 -> 76800 bytes .../Lib/site-packages/gevent/__waiter.pxd | 48 + .../site-packages/gevent/_abstract_linkable.c | 8464 ++++++ .../gevent/_abstract_linkable.html | 2189 ++ .../gevent/_abstract_linkable.py | 202 + .../Lib/site-packages/gevent/_compat.py | 160 + .../Lib/site-packages/gevent/_config.py | 701 + .../gevent/_event.cp37-win_amd64.pyd | Bin 0 -> 104960 bytes .../Lib/site-packages/gevent/_event.pxd | 30 + .../Lib/site-packages/gevent/_ffi/__init__.py | 27 + .../Lib/site-packages/gevent/_ffi/callback.py | 58 + .../Lib/site-packages/gevent/_ffi/loop.py | 713 + .../Lib/site-packages/gevent/_ffi/watcher.py | 641 + .../site-packages/gevent/_fileobjectcommon.py | 281 + .../site-packages/gevent/_fileobjectposix.py | 357 + .../gevent/_greenlet.cp37-win_amd64.pyd | Bin 0 -> 225280 bytes .../Lib/site-packages/gevent/_greenlet.pxd | 177 + .../gevent/_greenlet_primitives.c | 6562 +++++ .../gevent/_greenlet_primitives.html | 1246 + .../gevent/_greenlet_primitives.py | 90 + .../Lib/site-packages/gevent/_hub_local.c | 5841 ++++ .../Lib/site-packages/gevent/_hub_local.html | 1141 + .../Lib/site-packages/gevent/_hub_local.py | 101 + .../site-packages/gevent/_hub_primitives.c | 12492 ++++++++ .../site-packages/gevent/_hub_primitives.html | 4991 ++++ .../site-packages/gevent/_hub_primitives.py | 394 + .../Lib/site-packages/gevent/_ident.c | 5548 ++++ .../Lib/site-packages/gevent/_ident.html | 884 + .../Lib/site-packages/gevent/_ident.py | 82 + .../Lib/site-packages/gevent/_imap.c | 10616 +++++++ .../Lib/site-packages/gevent/_imap.html | 2184 ++ .../Lib/site-packages/gevent/_imap.py | 227 + .../Lib/site-packages/gevent/_interfaces.py | 230 + .../gevent/_local.cp37-win_amd64.pyd | Bin 0 -> 127488 bytes .../Lib/site-packages/gevent/_local.pxd | 113 + .../Lib/site-packages/gevent/_monitor.py | 325 + .../Lib/site-packages/gevent/_patcher.py | 127 + .../gevent/_queue.cp37-win_amd64.pyd | Bin 0 -> 200704 bytes .../Lib/site-packages/gevent/_queue.pxd | 74 + .../Lib/site-packages/gevent/_semaphore.c | 8412 ++++++ .../Lib/site-packages/gevent/_semaphore.html | 2285 ++ .../Lib/site-packages/gevent/_semaphore.py | 188 + .../Lib/site-packages/gevent/_socket2.py | 473 + .../Lib/site-packages/gevent/_socket3.py | 756 + .../Lib/site-packages/gevent/_socketcommon.py | 401 + .../Lib/site-packages/gevent/_ssl2.py | 441 + .../Lib/site-packages/gevent/_ssl3.py | 712 + .../Lib/site-packages/gevent/_sslgte279.py | 714 + .../Lib/site-packages/gevent/_tblib.py | 432 + .../Lib/site-packages/gevent/_threading.py | 168 + .../Lib/site-packages/gevent/_tracer.c | 9661 ++++++ .../Lib/site-packages/gevent/_tracer.html | 3096 ++ .../Lib/site-packages/gevent/_tracer.py | 179 + .../Lib/site-packages/gevent/_util.py | 178 + .../Lib/site-packages/gevent/_util_py2.py | 23 + .../Lib/site-packages/gevent/_waiter.c | 8893 ++++++ .../Lib/site-packages/gevent/_waiter.html | 2281 ++ .../Lib/site-packages/gevent/_waiter.py | 204 + .../Lib/site-packages/gevent/ares.py | 10 + .../Lib/site-packages/gevent/backdoor.py | 210 + .../Lib/site-packages/gevent/baseserver.py | 409 + .../Lib/site-packages/gevent/builtins.py | 135 + .../Lib/site-packages/gevent/core.py | 20 + .../Lib/site-packages/gevent/event.c | 10734 +++++++ .../Lib/site-packages/gevent/event.html | 3680 +++ .../Lib/site-packages/gevent/event.py | 363 + .../Lib/site-packages/gevent/events.py | 480 + .../Lib/site-packages/gevent/exceptions.py | 79 + .../Lib/site-packages/gevent/fileobject.py | 61 + .../Lib/site-packages/gevent/greenlet.c | 24316 ++++++++++++++++ .../Lib/site-packages/gevent/greenlet.html | 10062 +++++++ .../Lib/site-packages/gevent/greenlet.py | 1003 + .../Lib/site-packages/gevent/hub.py | 750 + .../site-packages/gevent/libev/__init__.py | 7 + .../gevent/libev/_corecffi_build.py | 75 + .../gevent/libev/_corecffi_cdef.c | 243 + .../gevent/libev/_corecffi_source.c | 69 + .../site-packages/gevent/libev/callbacks.c | 216 + .../site-packages/gevent/libev/callbacks.h | 38 + .../Lib/site-packages/gevent/libev/corecext.c | 23545 +++++++++++++++ .../gevent/libev/corecext.cp37-win_amd64.pyd | Bin 0 -> 262144 bytes .../Lib/site-packages/gevent/libev/corecext.h | 148 + .../site-packages/gevent/libev/corecext.html | 15651 ++++++++++ .../site-packages/gevent/libev/corecext.pyx | 1352 + .../site-packages/gevent/libev/corecffi.py | 427 + .../Lib/site-packages/gevent/libev/libev.h | 100 + .../Lib/site-packages/gevent/libev/libev.pxd | 235 + .../site-packages/gevent/libev/libev_vfd.h | 225 + .../site-packages/gevent/libev/stathelper.c | 187 + .../Lib/site-packages/gevent/libev/watcher.py | 286 + .../site-packages/gevent/libuv/__init__.py | 7 + .../gevent/libuv/_corecffi.cp37-win_amd64.pyd | Bin 0 -> 159232 bytes .../gevent/libuv/_corecffi_build.py | 256 + .../gevent/libuv/_corecffi_cdef.c | 393 + .../gevent/libuv/_corecffi_source.c | 181 + .../Lib/site-packages/gevent/libuv/loop.py | 602 + .../Lib/site-packages/gevent/libuv/watcher.py | 735 + .../Lib/site-packages/gevent/local.c | 13993 +++++++++ .../Lib/site-packages/gevent/local.html | 4282 +++ .../Lib/site-packages/gevent/local.py | 605 + .../Lib/site-packages/gevent/lock.py | 260 + .../Lib/site-packages/gevent/monkey.py | 1079 + .../Lib/site-packages/gevent/os.py | 510 + .../Lib/site-packages/gevent/pool.py | 675 + .../Lib/site-packages/gevent/pywsgi.py | 1549 + .../Lib/site-packages/gevent/queue.c | 21853 ++++++++++++++ .../Lib/site-packages/gevent/queue.html | 9489 ++++++ .../Lib/site-packages/gevent/queue.py | 685 + .../site-packages/gevent/resolver/__init__.py | 105 + .../Lib/site-packages/gevent/resolver/ares.py | 357 + .../site-packages/gevent/resolver/blocking.py | 45 + .../Lib/site-packages/gevent/resolver/cares.c | 15082 ++++++++++ .../gevent/resolver/cares.cp37-win_amd64.pyd | Bin 0 -> 189952 bytes .../site-packages/gevent/resolver/cares.html | 6049 ++++ .../site-packages/gevent/resolver/cares.pyx | 464 + .../gevent/resolver/cares_ntop.h | 7 + .../gevent/resolver/cares_pton.h | 8 + .../site-packages/gevent/resolver/dnshelper.c | 159 + .../gevent/resolver/dnspython.py | 662 + .../gevent/resolver/libcares.pxd | 109 + .../site-packages/gevent/resolver/thread.py | 71 + .../Lib/site-packages/gevent/resolver_ares.py | 17 + .../site-packages/gevent/resolver_thread.py | 17 + .../Lib/site-packages/gevent/select.py | 286 + .../Lib/site-packages/gevent/server.py | 282 + .../Lib/site-packages/gevent/signal.py | 137 + .../Lib/site-packages/gevent/socket.py | 129 + .../Lib/site-packages/gevent/ssl.py | 35 + .../Lib/site-packages/gevent/subprocess.py | 1688 ++ .../site-packages/gevent/testing/__init__.py | 137 + .../testing/coveragesite/sitecustomize.py | 17 + .../gevent/testing/errorhandler.py | 53 + .../site-packages/gevent/testing/exception.py | 23 + .../Lib/site-packages/gevent/testing/flaky.py | 114 + .../Lib/site-packages/gevent/testing/hub.py | 35 + .../site-packages/gevent/testing/leakcheck.py | 206 + .../site-packages/gevent/testing/modules.py | 85 + .../gevent/testing/monkey_test.py | 75 + .../site-packages/gevent/testing/openfiles.py | 125 + .../site-packages/gevent/testing/params.py | 83 + .../gevent/testing/patched_tests_setup.py | 1139 + .../Lib/site-packages/gevent/testing/six.py | 42 + .../site-packages/gevent/testing/skipping.py | 116 + .../site-packages/gevent/testing/sockets.py | 41 + .../site-packages/gevent/testing/switching.py | 64 + .../site-packages/gevent/testing/sysinfo.py | 137 + .../site-packages/gevent/testing/testcase.py | 340 + .../gevent/testing/testrunner.py | 481 + .../site-packages/gevent/testing/timing.py | 139 + .../Lib/site-packages/gevent/testing/util.py | 453 + .../gevent/tests/2_7_keycert.pem | 31 + .../site-packages/gevent/tests/__init__.py | 0 .../site-packages/gevent/tests/__main__.py | 6 + .../gevent/tests/_blocks_at_top_level.py | 3 + .../gevent/tests/_import_import_patch.py | 1 + .../gevent/tests/_import_patch.py | 2 + .../gevent/tests/_import_wait.py | 26 + .../gevent/tests/_imports_at_top_level.py | 2 + .../tests/_imports_imports_at_top_level.py | 13 + .../site-packages/gevent/tests/badcert.pem | 36 + .../Lib/site-packages/gevent/tests/badkey.pem | 40 + .../gevent/tests/getaddrinfo_module.py | 4 + .../site-packages/gevent/tests/hosts_file.txt | 10351 +++++++ .../tests/https_svn_python_org_root.pem | 41 + .../site-packages/gevent/tests/keycert.pem | 32 + .../gevent/tests/known_failures.py | 398 + .../site-packages/gevent/tests/lock_tests.py | 767 + .../gevent/tests/monkey_package/__main__.py | 5 + .../tests/monkey_package/issue302monkey.py | 28 + .../gevent/tests/monkey_package/script.py | 19 + .../site-packages/gevent/tests/nullcert.pem | 0 .../Lib/site-packages/gevent/tests/server.crt | 15 + .../Lib/site-packages/gevent/tests/server.key | 15 + .../Lib/site-packages/gevent/tests/sha256.pem | 33 + .../gevent/tests/test__GreenletExit.py | 4 + .../gevent/tests/test___config.py | 154 + .../gevent/tests/test___example_servers.py | 141 + .../gevent/tests/test___ident.py | 80 + .../gevent/tests/test___monitor.py | 386 + .../gevent/tests/test___monkey_patching.py | 113 + .../site-packages/gevent/tests/test__all__.py | 241 + .../site-packages/gevent/tests/test__api.py | 132 + .../gevent/tests/test__api_timeout.py | 210 + .../gevent/tests/test__ares_host_result.py | 31 + .../gevent/tests/test__ares_timeout.py | 52 + .../gevent/tests/test__backdoor.py | 135 + .../gevent/tests/test__close_backend_fd.py | 63 + .../gevent/tests/test__compat.py | 56 + .../site-packages/gevent/tests/test__core.py | 170 + .../gevent/tests/test__core_async.py | 24 + .../gevent/tests/test__core_callback.py | 31 + .../gevent/tests/test__core_fork.py | 58 + .../gevent/tests/test__core_loop_run.py | 25 + .../tests/test__core_loop_run_sig_mod.py | 16 + .../gevent/tests/test__core_stat.py | 118 + .../gevent/tests/test__core_timer.py | 157 + .../gevent/tests/test__core_watcher.py | 124 + .../gevent/tests/test__destroy.py | 51 + .../tests/test__destroy_default_loop.py | 56 + .../gevent/tests/test__doctests.py | 133 + .../gevent/tests/test__environ.py | 17 + .../site-packages/gevent/tests/test__event.py | 254 + .../gevent/tests/test__events.py | 39 + .../gevent/tests/test__example_echoserver.py | 40 + .../tests/test__example_portforwarder.py | 66 + .../gevent/tests/test__example_udp_client.py | 31 + .../gevent/tests/test__example_udp_server.py | 22 + .../gevent/tests/test__examples.py | 87 + .../gevent/tests/test__exc_info.py | 58 + .../gevent/tests/test__execmodules.py | 39 + .../gevent/tests/test__fileobject.py | 278 + .../gevent/tests/test__getaddrinfo_import.py | 7 + .../gevent/tests/test__greenio.py | 128 + .../gevent/tests/test__greenlet.py | 831 + .../gevent/tests/test__greenletset.py | 164 + .../gevent/tests/test__greenness.py | 73 + .../site-packages/gevent/tests/test__hub.py | 332 + .../gevent/tests/test__hub_join.py | 23 + .../gevent/tests/test__hub_join_timeout.py | 99 + .../test__import_blocking_in_greenlet.py | 22 + .../gevent/tests/test__import_wait.py | 7 + .../gevent/tests/test__issue112.py | 19 + .../gevent/tests/test__issue230.py | 23 + .../gevent/tests/test__issue330.py | 81 + .../gevent/tests/test__issue467.py | 35 + .../gevent/tests/test__issue6.py | 34 + .../gevent/tests/test__issue600.py | 48 + .../gevent/tests/test__issue607.py | 42 + .../gevent/tests/test__issue639.py | 4 + .../gevent/tests/test__issue_728.py | 9 + .../gevent/tests/test__issues461_471.py | 91 + .../site-packages/gevent/tests/test__iwait.py | 42 + .../gevent/tests/test__joinall.py | 10 + .../site-packages/gevent/tests/test__local.py | 428 + .../gevent/tests/test__loop_callback.py | 13 + .../gevent/tests/test__makefile_ref.py | 516 + .../gevent/tests/test__memleak.py | 56 + .../gevent/tests/test__monkey.py | 151 + .../tests/test__monkey_builtins_future.py | 16 + .../tests/test__monkey_hub_in_thread.py | 28 + .../gevent/tests/test__monkey_logging.py | 41 + .../tests/test__monkey_multiple_imports.py | 6 + .../gevent/tests/test__monkey_queue.py | 331 + .../gevent/tests/test__monkey_scope.py | 61 + .../gevent/tests/test__monkey_selectors.py | 22 + .../gevent/tests/test__monkey_sigchld.py | 69 + .../gevent/tests/test__monkey_sigchld_2.py | 51 + .../gevent/tests/test__monkey_sigchld_3.py | 52 + .../gevent/tests/test__monkey_ssl_warning.py | 34 + .../gevent/tests/test__monkey_ssl_warning2.py | 44 + .../gevent/tests/test__monkey_ssl_warning3.py | 47 + .../gevent/tests/test__nondefaultloop.py | 12 + .../site-packages/gevent/tests/test__order.py | 61 + .../site-packages/gevent/tests/test__os.py | 178 + .../site-packages/gevent/tests/test__pool.py | 603 + .../gevent/tests/test__pywsgi.py | 1811 ++ .../site-packages/gevent/tests/test__queue.py | 465 + .../gevent/tests/test__real_greenlet.py | 29 + .../gevent/tests/test__refcount.py | 162 + .../gevent/tests/test__refcount_core.py | 24 + .../gevent/tests/test__select.py | 114 + .../gevent/tests/test__semaphore.py | 91 + .../gevent/tests/test__server.py | 515 + .../gevent/tests/test__server_pywsgi.py | 106 + .../gevent/tests/test__signal.py | 122 + .../gevent/tests/test__sleep0.py | 10 + .../gevent/tests/test__socket.py | 452 + .../gevent/tests/test__socket_close.py | 58 + .../gevent/tests/test__socket_dns.py | 718 + .../gevent/tests/test__socket_dns6.py | 81 + .../gevent/tests/test__socket_errors.py | 46 + .../gevent/tests/test__socket_ex.py | 43 + .../tests/test__socket_send_memoryview.py | 39 + .../gevent/tests/test__socket_ssl.py | 39 + .../gevent/tests/test__socket_timeout.py | 54 + .../gevent/tests/test__socketpair.py | 35 + .../site-packages/gevent/tests/test__ssl.py | 104 + .../gevent/tests/test__subprocess.py | 491 + .../tests/test__subprocess_interrupted.py | 20 + .../gevent/tests/test__subprocess_poll.py | 9 + .../gevent/tests/test__systemerror.py | 108 + .../gevent/tests/test__threading.py | 50 + .../gevent/tests/test__threading_2.py | 610 + .../tests/test__threading_before_monkey.py | 23 + ...st__threading_holding_lock_while_monkey.py | 8 + .../tests/test__threading_monkey_in_thread.py | 65 + .../test__threading_native_before_monkey.py | 57 + .../tests/test__threading_patched_local.py | 24 + .../tests/test__threading_vs_settrace.py | 163 + .../gevent/tests/test__threadpool.py | 653 + .../test__threadpool_executor_patched.py | 18 + .../gevent/tests/test__timeout.py | 159 + .../site-packages/gevent/tests/test__util.py | 292 + .../gevent/tests/test_server.crt | 15 + .../gevent/tests/test_server.key | 15 + .../tests/tests_that_dont_do_leakchecks.txt | 9 + .../tests/tests_that_dont_monkeypatch.txt | 26 + .../tests/tests_that_dont_use_resolver.txt | 136 + .../site-packages/gevent/tests/wrongcert.pem | 32 + .../Lib/site-packages/gevent/thread.py | 114 + .../Lib/site-packages/gevent/threading.py | 235 + .../Lib/site-packages/gevent/threadpool.py | 580 + .../Lib/site-packages/gevent/time.py | 27 + .../Lib/site-packages/gevent/timeout.py | 373 + .../Lib/site-packages/gevent/util.py | 603 + .../Lib/site-packages/gevent/win32util.py | 98 + .../greenlet-0.4.15.dist-info/INSTALLER | 1 + .../greenlet-0.4.15.dist-info/METADATA | 90 + .../greenlet-0.4.15.dist-info/RECORD | 7 + .../greenlet-0.4.15.dist-info/WHEEL | 5 + .../greenlet-0.4.15.dist-info/top_level.txt | 1 + .../site-packages/greenlet.cp37-win_amd64.pyd | Bin 0 -> 28672 bytes .../grequests-0.4.0.dist-info/AUTHORS.rst | 12 + .../grequests-0.4.0.dist-info/INSTALLER | 1 + .../grequests-0.4.0.dist-info/LICENSE | 8 + .../grequests-0.4.0.dist-info/METADATA | 51 + .../grequests-0.4.0.dist-info/RECORD | 9 + .../grequests-0.4.0.dist-info/WHEEL | 5 + .../grequests-0.4.0.dist-info/top_level.txt | 1 + .../Lib/site-packages/grequests.py | 155 + .../pycparser-2.19.dist-info/INSTALLER | 1 + .../pycparser-2.19.dist-info/LICENSE | 27 + .../pycparser-2.19.dist-info/METADATA | 27 + .../pycparser-2.19.dist-info/RECORD | 41 + .../pycparser-2.19.dist-info/WHEEL | 6 + .../pycparser-2.19.dist-info/top_level.txt | 1 + .../Lib/site-packages/pycparser/__init__.py | 90 + .../Lib/site-packages/pycparser/_ast_gen.py | 338 + .../site-packages/pycparser/_build_tables.py | 33 + .../Lib/site-packages/pycparser/_c_ast.cfg | 191 + .../site-packages/pycparser/ast_transforms.py | 105 + .../Lib/site-packages/pycparser/c_ast.py | 1084 + .../site-packages/pycparser/c_generator.py | 428 + .../Lib/site-packages/pycparser/c_lexer.py | 484 + .../Lib/site-packages/pycparser/c_parser.py | 1850 ++ .../Lib/site-packages/pycparser/lextab.py | 10 + .../site-packages/pycparser/ply/__init__.py | 5 + .../Lib/site-packages/pycparser/ply/cpp.py | 905 + .../site-packages/pycparser/ply/ctokens.py | 133 + .../Lib/site-packages/pycparser/ply/lex.py | 1099 + .../Lib/site-packages/pycparser/ply/yacc.py | 3494 +++ .../Lib/site-packages/pycparser/ply/ygen.py | 74 + .../Lib/site-packages/pycparser/plyparser.py | 133 + .../Lib/site-packages/pycparser/yacctab.py | 338 + .../python-3.7.2.amd64/Robot_R01.exe | Bin 0 -> 99856 bytes .../include/greenlet/greenlet.h | 157 + v1.0.1/Robot/IntegrationOrchestrator.py | 46 + 805 files changed, 683378 insertions(+), 10 deletions(-) create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/_cffi_backend.cp37-win32.pyd create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/cffi-1.12.3.dist-info/INSTALLER create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/cffi-1.12.3.dist-info/LICENSE create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/cffi-1.12.3.dist-info/METADATA create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/cffi-1.12.3.dist-info/RECORD create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/cffi-1.12.3.dist-info/WHEEL create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/cffi-1.12.3.dist-info/entry_points.txt create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/cffi-1.12.3.dist-info/top_level.txt create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/cffi/__init__.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/cffi/_cffi_errors.h create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/cffi/_cffi_include.h create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/cffi/_embedding.h create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/cffi/api.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/cffi/backend_ctypes.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/cffi/cffi_opcode.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/cffi/commontypes.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/cffi/cparser.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/cffi/error.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/cffi/ffiplatform.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/cffi/lock.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/cffi/model.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/cffi/parse_c_type.h create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/cffi/pkgconfig.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/cffi/recompiler.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/cffi/setuptools_ext.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/cffi/vengine_cpy.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/cffi/vengine_gen.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/cffi/verifier.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent-1.4.0.dist-info/AUTHORS create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent-1.4.0.dist-info/INSTALLER create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent-1.4.0.dist-info/LICENSE create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent-1.4.0.dist-info/METADATA create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent-1.4.0.dist-info/NOTICE create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent-1.4.0.dist-info/RECORD create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent-1.4.0.dist-info/WHEEL create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent-1.4.0.dist-info/entry_points.txt create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent-1.4.0.dist-info/top_level.txt create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/__abstract_linkable.cp37-win32.pyd create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/__abstract_linkable.pxd create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/__greenlet_primitives.cp37-win32.pyd create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/__greenlet_primitives.pxd create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/__hub_local.cp37-win32.pyd create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/__hub_local.pxd create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/__hub_primitives.cp37-win32.pyd create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/__hub_primitives.pxd create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/__ident.cp37-win32.pyd create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/__ident.pxd create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/__imap.cp37-win32.pyd create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/__imap.pxd create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/__init__.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/__semaphore.cp37-win32.pyd create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/__semaphore.pxd create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/__tracer.cp37-win32.pyd create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/__tracer.pxd create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/__waiter.cp37-win32.pyd create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/__waiter.pxd create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_abstract_linkable.c create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_abstract_linkable.html create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_abstract_linkable.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_compat.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_config.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_event.cp37-win32.pyd create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_event.pxd create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_ffi/__init__.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_ffi/callback.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_ffi/loop.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_ffi/watcher.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_fileobjectcommon.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_fileobjectposix.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_greenlet.cp37-win32.pyd create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_greenlet.pxd create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_greenlet_primitives.c create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_greenlet_primitives.html create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_greenlet_primitives.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_hub_local.c create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_hub_local.html create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_hub_local.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_hub_primitives.c create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_hub_primitives.html create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_hub_primitives.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_ident.c create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_ident.html create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_ident.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_imap.c create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_imap.html create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_imap.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_interfaces.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_local.cp37-win32.pyd create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_local.pxd create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_monitor.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_patcher.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_queue.cp37-win32.pyd create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_queue.pxd create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_semaphore.c create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_semaphore.html create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_semaphore.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_socket2.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_socket3.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_socketcommon.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_ssl2.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_ssl3.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_sslgte279.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_tblib.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_threading.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_tracer.c create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_tracer.html create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_tracer.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_util.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_util_py2.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_waiter.c create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_waiter.html create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_waiter.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/ares.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/backdoor.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/baseserver.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/builtins.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/core.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/event.c create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/event.html create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/event.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/events.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/exceptions.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/fileobject.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/greenlet.c create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/greenlet.html create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/greenlet.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/hub.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/libev/__init__.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/libev/_corecffi_build.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/libev/_corecffi_cdef.c create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/libev/_corecffi_source.c create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/libev/callbacks.c create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/libev/callbacks.h create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/libev/corecext.c create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/libev/corecext.cp37-win32.pyd create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/libev/corecext.h create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/libev/corecext.html create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/libev/corecext.pyx create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/libev/corecffi.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/libev/libev.h create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/libev/libev.pxd create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/libev/libev_vfd.h create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/libev/stathelper.c create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/libev/watcher.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/libuv/__init__.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/libuv/_corecffi.cp37-win32.pyd create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/libuv/_corecffi_build.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/libuv/_corecffi_cdef.c create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/libuv/_corecffi_source.c create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/libuv/loop.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/libuv/watcher.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/local.c create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/local.html create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/local.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/lock.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/monkey.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/os.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/pool.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/pywsgi.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/queue.c create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/queue.html create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/queue.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/resolver/__init__.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/resolver/ares.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/resolver/blocking.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/resolver/cares.c create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/resolver/cares.cp37-win32.pyd create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/resolver/cares.html create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/resolver/cares.pyx create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/resolver/cares_ntop.h create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/resolver/cares_pton.h create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/resolver/dnshelper.c create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/resolver/dnspython.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/resolver/libcares.pxd create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/resolver/thread.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/resolver_ares.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/resolver_thread.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/select.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/server.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/signal.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/socket.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/ssl.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/subprocess.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/testing/__init__.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/testing/coveragesite/sitecustomize.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/testing/errorhandler.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/testing/exception.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/testing/flaky.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/testing/hub.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/testing/leakcheck.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/testing/modules.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/testing/monkey_test.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/testing/openfiles.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/testing/params.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/testing/patched_tests_setup.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/testing/six.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/testing/skipping.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/testing/sockets.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/testing/switching.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/testing/sysinfo.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/testing/testcase.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/testing/testrunner.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/testing/timing.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/testing/util.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/2_7_keycert.pem create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/__init__.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/__main__.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/_blocks_at_top_level.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/_import_import_patch.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/_import_patch.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/_import_wait.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/_imports_at_top_level.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/_imports_imports_at_top_level.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/badcert.pem create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/badkey.pem create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/getaddrinfo_module.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/hosts_file.txt create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/https_svn_python_org_root.pem create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/keycert.pem create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/known_failures.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/lock_tests.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/monkey_package/__main__.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/monkey_package/issue302monkey.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/monkey_package/script.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/nullcert.pem create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/server.crt create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/server.key create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/sha256.pem create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__GreenletExit.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test___config.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test___example_servers.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test___ident.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test___monitor.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test___monkey_patching.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__all__.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__api.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__api_timeout.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__ares_host_result.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__ares_timeout.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__backdoor.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__close_backend_fd.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__compat.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__core.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__core_async.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__core_callback.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__core_fork.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__core_loop_run.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__core_loop_run_sig_mod.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__core_stat.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__core_timer.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__core_watcher.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__destroy.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__destroy_default_loop.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__doctests.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__environ.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__event.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__events.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__example_echoserver.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__example_portforwarder.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__example_udp_client.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__example_udp_server.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__examples.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__exc_info.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__execmodules.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__fileobject.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__getaddrinfo_import.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__greenio.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__greenlet.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__greenletset.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__greenness.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__hub.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__hub_join.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__hub_join_timeout.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__import_blocking_in_greenlet.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__import_wait.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__issue112.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__issue230.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__issue330.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__issue467.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__issue6.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__issue600.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__issue607.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__issue639.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__issue_728.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__issues461_471.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__iwait.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__joinall.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__local.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__loop_callback.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__makefile_ref.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__memleak.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__monkey.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__monkey_builtins_future.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__monkey_hub_in_thread.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__monkey_logging.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__monkey_multiple_imports.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__monkey_queue.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__monkey_scope.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__monkey_selectors.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__monkey_sigchld.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__monkey_sigchld_2.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__monkey_sigchld_3.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__monkey_ssl_warning.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__monkey_ssl_warning2.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__monkey_ssl_warning3.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__nondefaultloop.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__order.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__os.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__pool.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__pywsgi.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__queue.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__real_greenlet.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__refcount.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__refcount_core.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__select.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__semaphore.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__server.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__server_pywsgi.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__signal.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__sleep0.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__socket.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__socket_close.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__socket_dns.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__socket_dns6.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__socket_errors.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__socket_ex.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__socket_send_memoryview.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__socket_ssl.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__socket_timeout.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__socketpair.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__ssl.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__subprocess.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__subprocess_interrupted.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__subprocess_poll.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__systemerror.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__threading.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__threading_2.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__threading_before_monkey.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__threading_holding_lock_while_monkey.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__threading_monkey_in_thread.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__threading_native_before_monkey.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__threading_patched_local.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__threading_vs_settrace.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__threadpool.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__threadpool_executor_patched.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__timeout.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__util.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test_server.crt create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test_server.key create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/tests_that_dont_do_leakchecks.txt create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/tests_that_dont_monkeypatch.txt create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/tests_that_dont_use_resolver.txt create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/wrongcert.pem create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/thread.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/threading.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/threadpool.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/time.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/timeout.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/util.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/win32util.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/greenlet-0.4.15.dist-info/INSTALLER create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/greenlet-0.4.15.dist-info/METADATA create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/greenlet-0.4.15.dist-info/RECORD create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/greenlet-0.4.15.dist-info/WHEEL create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/greenlet-0.4.15.dist-info/top_level.txt create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/greenlet.cp37-win32.pyd create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/grequests-0.4.0.dist-info/AUTHORS.rst create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/grequests-0.4.0.dist-info/INSTALLER create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/grequests-0.4.0.dist-info/LICENSE create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/grequests-0.4.0.dist-info/METADATA create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/grequests-0.4.0.dist-info/RECORD create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/grequests-0.4.0.dist-info/WHEEL create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/grequests-0.4.0.dist-info/top_level.txt create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/grequests.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pycparser-2.19.dist-info/INSTALLER create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pycparser-2.19.dist-info/LICENSE create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pycparser-2.19.dist-info/METADATA create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pycparser-2.19.dist-info/RECORD create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pycparser-2.19.dist-info/WHEEL create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pycparser-2.19.dist-info/top_level.txt create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pycparser/__init__.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pycparser/_ast_gen.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pycparser/_build_tables.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pycparser/_c_ast.cfg create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pycparser/ast_transforms.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pycparser/c_ast.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pycparser/c_generator.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pycparser/c_lexer.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pycparser/c_parser.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pycparser/lextab.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pycparser/ply/__init__.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pycparser/ply/cpp.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pycparser/ply/ctokens.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pycparser/ply/lex.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pycparser/ply/yacc.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pycparser/ply/ygen.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pycparser/plyparser.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pycparser/yacctab.py create mode 100644 v1.0.1/Resources/WPy32-3720/python-3.7.2/include/greenlet/greenlet.h create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/_cffi_backend.cp37-win_amd64.pyd create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/cffi-1.12.3.dist-info/INSTALLER create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/cffi-1.12.3.dist-info/LICENSE create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/cffi-1.12.3.dist-info/METADATA create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/cffi-1.12.3.dist-info/RECORD create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/cffi-1.12.3.dist-info/WHEEL create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/cffi-1.12.3.dist-info/entry_points.txt create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/cffi-1.12.3.dist-info/top_level.txt create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/cffi/__init__.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/cffi/_cffi_errors.h create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/cffi/_cffi_include.h create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/cffi/_embedding.h create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/cffi/api.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/cffi/backend_ctypes.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/cffi/cffi_opcode.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/cffi/commontypes.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/cffi/cparser.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/cffi/error.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/cffi/ffiplatform.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/cffi/lock.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/cffi/model.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/cffi/parse_c_type.h create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/cffi/pkgconfig.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/cffi/recompiler.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/cffi/setuptools_ext.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/cffi/vengine_cpy.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/cffi/vengine_gen.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/cffi/verifier.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent-1.4.0.dist-info/AUTHORS create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent-1.4.0.dist-info/INSTALLER create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent-1.4.0.dist-info/LICENSE create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent-1.4.0.dist-info/METADATA create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent-1.4.0.dist-info/NOTICE create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent-1.4.0.dist-info/RECORD create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent-1.4.0.dist-info/WHEEL create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent-1.4.0.dist-info/entry_points.txt create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent-1.4.0.dist-info/top_level.txt create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/__abstract_linkable.cp37-win_amd64.pyd create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/__abstract_linkable.pxd create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/__greenlet_primitives.cp37-win_amd64.pyd create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/__greenlet_primitives.pxd create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/__hub_local.cp37-win_amd64.pyd create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/__hub_local.pxd create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/__hub_primitives.cp37-win_amd64.pyd create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/__hub_primitives.pxd create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/__ident.cp37-win_amd64.pyd create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/__ident.pxd create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/__imap.cp37-win_amd64.pyd create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/__imap.pxd create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/__init__.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/__semaphore.cp37-win_amd64.pyd create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/__semaphore.pxd create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/__tracer.cp37-win_amd64.pyd create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/__tracer.pxd create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/__waiter.cp37-win_amd64.pyd create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/__waiter.pxd create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_abstract_linkable.c create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_abstract_linkable.html create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_abstract_linkable.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_compat.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_config.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_event.cp37-win_amd64.pyd create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_event.pxd create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_ffi/__init__.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_ffi/callback.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_ffi/loop.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_ffi/watcher.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_fileobjectcommon.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_fileobjectposix.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_greenlet.cp37-win_amd64.pyd create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_greenlet.pxd create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_greenlet_primitives.c create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_greenlet_primitives.html create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_greenlet_primitives.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_hub_local.c create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_hub_local.html create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_hub_local.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_hub_primitives.c create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_hub_primitives.html create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_hub_primitives.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_ident.c create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_ident.html create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_ident.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_imap.c create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_imap.html create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_imap.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_interfaces.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_local.cp37-win_amd64.pyd create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_local.pxd create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_monitor.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_patcher.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_queue.cp37-win_amd64.pyd create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_queue.pxd create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_semaphore.c create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_semaphore.html create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_semaphore.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_socket2.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_socket3.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_socketcommon.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_ssl2.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_ssl3.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_sslgte279.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_tblib.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_threading.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_tracer.c create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_tracer.html create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_tracer.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_util.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_util_py2.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_waiter.c create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_waiter.html create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_waiter.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/ares.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/backdoor.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/baseserver.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/builtins.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/core.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/event.c create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/event.html create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/event.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/events.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/exceptions.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/fileobject.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/greenlet.c create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/greenlet.html create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/greenlet.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/hub.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/libev/__init__.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/libev/_corecffi_build.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/libev/_corecffi_cdef.c create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/libev/_corecffi_source.c create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/libev/callbacks.c create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/libev/callbacks.h create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/libev/corecext.c create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/libev/corecext.cp37-win_amd64.pyd create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/libev/corecext.h create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/libev/corecext.html create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/libev/corecext.pyx create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/libev/corecffi.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/libev/libev.h create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/libev/libev.pxd create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/libev/libev_vfd.h create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/libev/stathelper.c create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/libev/watcher.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/libuv/__init__.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/libuv/_corecffi.cp37-win_amd64.pyd create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/libuv/_corecffi_build.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/libuv/_corecffi_cdef.c create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/libuv/_corecffi_source.c create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/libuv/loop.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/libuv/watcher.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/local.c create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/local.html create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/local.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/lock.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/monkey.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/os.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/pool.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/pywsgi.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/queue.c create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/queue.html create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/queue.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/resolver/__init__.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/resolver/ares.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/resolver/blocking.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/resolver/cares.c create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/resolver/cares.cp37-win_amd64.pyd create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/resolver/cares.html create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/resolver/cares.pyx create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/resolver/cares_ntop.h create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/resolver/cares_pton.h create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/resolver/dnshelper.c create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/resolver/dnspython.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/resolver/libcares.pxd create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/resolver/thread.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/resolver_ares.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/resolver_thread.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/select.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/server.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/signal.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/socket.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/ssl.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/subprocess.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/testing/__init__.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/testing/coveragesite/sitecustomize.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/testing/errorhandler.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/testing/exception.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/testing/flaky.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/testing/hub.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/testing/leakcheck.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/testing/modules.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/testing/monkey_test.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/testing/openfiles.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/testing/params.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/testing/patched_tests_setup.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/testing/six.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/testing/skipping.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/testing/sockets.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/testing/switching.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/testing/sysinfo.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/testing/testcase.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/testing/testrunner.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/testing/timing.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/testing/util.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/2_7_keycert.pem create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/__init__.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/__main__.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/_blocks_at_top_level.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/_import_import_patch.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/_import_patch.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/_import_wait.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/_imports_at_top_level.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/_imports_imports_at_top_level.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/badcert.pem create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/badkey.pem create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/getaddrinfo_module.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/hosts_file.txt create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/https_svn_python_org_root.pem create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/keycert.pem create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/known_failures.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/lock_tests.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/monkey_package/__main__.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/monkey_package/issue302monkey.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/monkey_package/script.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/nullcert.pem create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/server.crt create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/server.key create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/sha256.pem create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__GreenletExit.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test___config.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test___example_servers.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test___ident.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test___monitor.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test___monkey_patching.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__all__.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__api.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__api_timeout.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__ares_host_result.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__ares_timeout.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__backdoor.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__close_backend_fd.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__compat.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__core.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__core_async.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__core_callback.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__core_fork.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__core_loop_run.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__core_loop_run_sig_mod.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__core_stat.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__core_timer.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__core_watcher.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__destroy.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__destroy_default_loop.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__doctests.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__environ.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__event.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__events.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__example_echoserver.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__example_portforwarder.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__example_udp_client.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__example_udp_server.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__examples.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__exc_info.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__execmodules.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__fileobject.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__getaddrinfo_import.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__greenio.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__greenlet.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__greenletset.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__greenness.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__hub.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__hub_join.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__hub_join_timeout.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__import_blocking_in_greenlet.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__import_wait.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__issue112.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__issue230.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__issue330.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__issue467.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__issue6.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__issue600.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__issue607.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__issue639.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__issue_728.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__issues461_471.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__iwait.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__joinall.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__local.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__loop_callback.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__makefile_ref.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__memleak.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__monkey.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__monkey_builtins_future.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__monkey_hub_in_thread.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__monkey_logging.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__monkey_multiple_imports.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__monkey_queue.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__monkey_scope.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__monkey_selectors.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__monkey_sigchld.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__monkey_sigchld_2.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__monkey_sigchld_3.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__monkey_ssl_warning.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__monkey_ssl_warning2.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__monkey_ssl_warning3.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__nondefaultloop.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__order.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__os.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__pool.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__pywsgi.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__queue.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__real_greenlet.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__refcount.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__refcount_core.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__select.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__semaphore.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__server.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__server_pywsgi.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__signal.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__sleep0.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__socket.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__socket_close.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__socket_dns.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__socket_dns6.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__socket_errors.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__socket_ex.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__socket_send_memoryview.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__socket_ssl.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__socket_timeout.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__socketpair.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__ssl.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__subprocess.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__subprocess_interrupted.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__subprocess_poll.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__systemerror.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__threading.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__threading_2.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__threading_before_monkey.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__threading_holding_lock_while_monkey.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__threading_monkey_in_thread.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__threading_native_before_monkey.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__threading_patched_local.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__threading_vs_settrace.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__threadpool.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__threadpool_executor_patched.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__timeout.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__util.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test_server.crt create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test_server.key create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/tests_that_dont_do_leakchecks.txt create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/tests_that_dont_monkeypatch.txt create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/tests_that_dont_use_resolver.txt create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/wrongcert.pem create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/thread.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/threading.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/threadpool.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/time.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/timeout.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/util.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/win32util.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/greenlet-0.4.15.dist-info/INSTALLER create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/greenlet-0.4.15.dist-info/METADATA create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/greenlet-0.4.15.dist-info/RECORD create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/greenlet-0.4.15.dist-info/WHEEL create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/greenlet-0.4.15.dist-info/top_level.txt create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/greenlet.cp37-win_amd64.pyd create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/grequests-0.4.0.dist-info/AUTHORS.rst create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/grequests-0.4.0.dist-info/INSTALLER create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/grequests-0.4.0.dist-info/LICENSE create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/grequests-0.4.0.dist-info/METADATA create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/grequests-0.4.0.dist-info/RECORD create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/grequests-0.4.0.dist-info/WHEEL create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/grequests-0.4.0.dist-info/top_level.txt create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/grequests.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pycparser-2.19.dist-info/INSTALLER create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pycparser-2.19.dist-info/LICENSE create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pycparser-2.19.dist-info/METADATA create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pycparser-2.19.dist-info/RECORD create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pycparser-2.19.dist-info/WHEEL create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pycparser-2.19.dist-info/top_level.txt create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pycparser/__init__.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pycparser/_ast_gen.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pycparser/_build_tables.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pycparser/_c_ast.cfg create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pycparser/ast_transforms.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pycparser/c_ast.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pycparser/c_generator.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pycparser/c_lexer.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pycparser/c_parser.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pycparser/lextab.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pycparser/ply/__init__.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pycparser/ply/cpp.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pycparser/ply/ctokens.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pycparser/ply/lex.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pycparser/ply/yacc.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pycparser/ply/ygen.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pycparser/plyparser.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pycparser/yacctab.py create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Robot_R01.exe create mode 100644 v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/include/greenlet/greenlet.h create mode 100644 v1.0.1/Robot/IntegrationOrchestrator.py diff --git a/v1.0.1/Orchestrator/Web/Index.xhtml b/v1.0.1/Orchestrator/Web/Index.xhtml index 58e2e3b9..a3779fda 100644 --- a/v1.0.1/Orchestrator/Web/Index.xhtml +++ b/v1.0.1/Orchestrator/Web/Index.xhtml @@ -255,7 +255,25 @@ } mGlobal.Monitor.mControlPanelAutoUpdateTimerId=setInterval(lControlPanelUpdate,1000) } + mGlobal.Monitor.fControlPanelRefresh() mGlobal.Monitor.fControlPanelAutoUpdateRun(5); + + mGlobal.Test=function() { + ///Обнулить таблицу + + $.ajax({ + type: "POST", + url: 'ProcessingRun', + data: '{"actionList":[{"type":"AdministrationGlobalDictSetKeyListValue","key_list":["Storage","Robot_R01"],"value":{"RunDateTimeString":"Test1","StepCurrentName":"Test2","StepCurrentDuration":"Test3"}}]}', + success: + function(lData,l2,l3) + { + console.log(lData) + }, + dataType: "text" + }); + } + ///////////////////////////////////// ///Инициализация страницы //////////////////////////////////// @@ -443,6 +461,12 @@
{{{Text}}}
{{/FooterButtonX2List}} +
Доп. управление
+
+ {{#FooterButtonX1List}} +
{{{Text}}}
+ {{/FooterButtonX1List}} +
{{/RenderRobotList}} diff --git a/v1.0.1/Orchestrator/orchestratorConfiguration.json b/v1.0.1/Orchestrator/orchestratorConfiguration.json index 9157e4bd..92de0a6d 100644 --- a/v1.0.1/Orchestrator/orchestratorConfiguration.json +++ b/v1.0.1/Orchestrator/orchestratorConfiguration.json @@ -75,5 +75,15 @@ "RenderFunctionModuleName":"orchestratorConfiguration" } ] + }, + "FileManager": { + "FileURLFilePathDict_help":"https://localhost:8081/filemanager/. All FileURL s must be set in lowercase", + "FileURLFilePathDict":{ + "r01/report.xlsx":"C:\\RPA\\\\v001\\Data\\Report.xlsx" + } + }, + "Storage":{ + "Robot_R01_help":"Robot data storage in orchestrator env", + "Robot_R01":{} } } \ No newline at end of file diff --git a/v1.0.1/Orchestrator/orchestratorConfiguration.py b/v1.0.1/Orchestrator/orchestratorConfiguration.py index 115e584e..1320a79a 100644 --- a/v1.0.1/Orchestrator/orchestratorConfiguration.py +++ b/v1.0.1/Orchestrator/orchestratorConfiguration.py @@ -1,18 +1,58 @@ +import psutil +import datetime def RenderRobotR01(inGlobalConfiguration): + #Subheader Variants + lSubheaderRunTrueText="Состояние: Работает" + lSubheaderRunFalseText="Состояние: Не работает" + #Result template lResultDict={ - "HeaderLeftText":"Robot name", + "HeaderLeftText":"Автозагрузка заявок на расход", "HeaderRightText":"R01", - "SubheaderText":"Состояние: Работает", + "SubheaderText":lSubheaderRunFalseText, "BodyKeyValueList":[ - {"Key":"Дата запуска","Value":"10:00:09 01.09.2019"}, - {"Key":"Текущий шаг","Value":"Проведение заказа"}, - {"Key":"Время выполнения шага","Value":"20с."}, - {"Key":"Отчет робота","Value":"скачать"} + #Дата запуска: 10:00:09 01.09.2019 + {"Key":"Дата запуска","Value":"Не запущен"}, + {"Key":"Текущий шаг","Value":"Не запущен"}, + {"Key":"Время выполнения шага","Value":"--с."}, + {"Key":"Отчет робота","Value":"Скачать"} ], "FooterText":"Дата изменения: 9:38:00 09.10.2019", "FooterButtonX2List":[ - {"Text":"Вкл.", "Color":"green", "Link":""}, - {"Text":"Выкл.", "Color":"red", "Link":""} + {"Text":"Ручной запуск", "Color":"green", "Link":""}, + {"Text":"Безопасная остановка", "Color":"orange", "Link":""} + ], + "FooterButtonX1List":[ + {"Text":"Принудительная остановка", "Color":"red", "Link":""} ] } + #Check if process running + if CheckIfProcessRunning("Robot_R01"): + lResultDict["SubheaderText"]=lSubheaderRunTrueText + #Fill robot info from Storage - R01 + if "Robot_R01" in inGlobalConfiguration.get("Storage",{}): + lItemDict=inGlobalConfiguration["Storage"]["Robot_R01"] + #lResultDict["HeaderLeftText"]=lItemDict["Name"] + #lResultDict["HeaderRightText"]=lItemDict["Code"] + lResultDict["BodyKeyValueList"][0]["Value"]=lItemDict.get("RunDateTimeString","Не запущен") + lResultDict["BodyKeyValueList"][1]["Value"]=lItemDict.get("StepCurrentName","Не запущен") + lResultDict["BodyKeyValueList"][2]["Value"]=lItemDict.get("StepCurrentDuration","--с.") + else: + #Process not running + lResultDict["FooterText"]=f'Дата изменения: {datetime.datetime.now().strftime("%H:%M:%S %d.%m.%Y")}' + else: + #Process not running + lResultDict["FooterText"]=f'Дата изменения: {datetime.datetime.now().strftime("%H:%M:%S %d.%m.%Y")}' return lResultDict +def CheckIfProcessRunning(processName): + ''' + Check if there is any running process that contains the given name processName. + ''' + #Iterate over the all the running process + for proc in psutil.process_iter(): + try: + # Check if process name contains the given name string. + if processName.lower() in proc.name().lower(): + return True + except (psutil.NoSuchProcess, psutil.AccessDenied, psutil.ZombieProcess): + pass + return False; \ No newline at end of file diff --git a/v1.0.1/Orchestrator/orchestratorProcessor.py b/v1.0.1/Orchestrator/orchestratorProcessor.py index baf84345..b2d29991 100644 --- a/v1.0.1/Orchestrator/orchestratorProcessor.py +++ b/v1.0.1/Orchestrator/orchestratorProcessor.py @@ -32,7 +32,16 @@ mWTSServer = lWTSServer = win32ts.WTSOpenServer("localhost") # }, # { # type: -# } +# }, +# { +# type: +# key_list: ["key1","key2",...] +# value: +# }, +# { +# type: +# key_list: ["key1","key2",...] +# }, # ] # #} @@ -94,6 +103,32 @@ def ProcessingRun(inConfigurationDict): subprocess.Popen(lCMDCode) lResult["actionListResult"][-1] = {**lResult["actionListResult"][-1], **{"result":{"IsActivated":True}}} #Выключить соединение - + #Обработка команды AdministrationGlobalDictSetKeyListValue + if lItem["type"]=="AdministrationGlobalDictSetKeyListValue": + lGlobalDict=mGlobalDict["JSONConfigurationDict"] + for lItem2 in lItem["key_list"][:-1]: + #Check if key - value exists + if lItem2 in lGlobalDict: + pass + else: + lGlobalDict[lItem2]={} + lGlobalDict=lGlobalDict[lItem2] + #Set value + #pdb.set_trace() + lGlobalDict[lItem["key_list"][-1]]=lItem["value"] + #Обработка команды AdministrationGlobalDictGetKeyListValue + if lItem["type"]=="AdministrationGlobalDictGetKeyListValue": + lGlobalDict=mGlobalDict["JSONConfigurationDict"] + for lItem2 in lItem["key_list"][:-1]: + #Check if key - value exists + if lItem2 in lGlobalDict: + pass + else: + lGlobalDict[lItem2]={} + lGlobalDict=lGlobalDict[lItem2] + #Set value + #pdb.set_trace() + lResult["actionListResult"][-1]["key_list"]=lItem["key_list"] + lResult["actionListResult"][-1]["value"]=lGlobalDict.get(lItem["key_list"][-1],None) #Вернуть результат return lResult diff --git a/v1.0.1/Orchestrator/orchestratorServer.py b/v1.0.1/Orchestrator/orchestratorServer.py index af655214..f8ba8530 100644 --- a/v1.0.1/Orchestrator/orchestratorServer.py +++ b/v1.0.1/Orchestrator/orchestratorServer.py @@ -120,9 +120,16 @@ class testHTTPServer_RequestHandler(BaseHTTPRequestHandler): #RunFunction lResultJSON["RenderRobotList"].append(lItemResultDict) # Send message back to client + #print(mJSONConfigurationDict) message = json.dumps(lResultJSON) # Write content as utf-8 data self.wfile.write(bytes(message, "utf8")) + #Filemanager function + if self.path.lower().startswith('/filemanager/'): + lFileURL=self.path[13:] + # check if file in FileURL - File Path Mapping Dict + if lFileURL.lower() in mJSONConfigurationDict["FileManager"]["FileURLFilePathDict"]: + self.SendResponseContentTypeFile('application/octet-stream',mJSONConfigurationDict["FileManager"]["FileURLFilePathDict"][lFileURL]) # POST def do_POST(self): #Централизованная функция получения запросов/отправки diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/_cffi_backend.cp37-win32.pyd b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/_cffi_backend.cp37-win32.pyd new file mode 100644 index 0000000000000000000000000000000000000000..e66187dd27ccf77fe2785fd1145a9b8bb1b89b10 GIT binary patch literal 139264 zcmeFa4|r6?)jxhWdz0Ldg}dMe0tSh?XppGUg$g8S67o+4+z{A+m;_s(+mtH8T?sYB zq&Hhx#%*b9Tie?Al~;XVY;DErs{t!)SR_Fa5EZe|w`gg5)5JC^hJeWZea_6?%_hM= z{XW0%@Ao|4=Nq_t@0~d_bLPyMGiT16nLF?H&5~V`BpH`!N>Ur{^jFA#KmRAwCP||v z?HDCJm-gDFZMM0uUAoZ!jkVdU*WCT}HFth1`)haJb=Tcm_E%SAuL<0h{f)b_OKz*m z{?^^gS6nl43JNm@8jlA0IWq^zNF3Ga_0 zzA)jP@Z3)g{uzJQXe$~t#FgBL`Vd}JR}1f0l59y@cFmgQcWQS^QYJMd)%^4qzJ@4XSJW9q!XN*k2mV(``K?*8>TUp1-K9dr zUxItmFt}o#;Q#)7AqCntPfc=0_s9RjC2oheUNSYelP=@9iNDpdnP+C4^V*#Hp3DSb zq*}y!^ppK&z=<>grQWPGeuV@~K^lFZt}qE@uCztjxMpb`Z-y_G1- z#pb$Q##2bG?{O@N?l&iAR@t29WC#DvuB7Jz{N|68n{Cby14$o7KkUju1%Uzz&sdIv zfP$H^5D)$|S&En$%kbzmGw#5xCJMNg9yfTuew^`ox+Dc7T5^5TlGmm@=FCWPhDJK* zH$$P{i8B38m*{u)IaiW%<%1bHcv<=2$Si)F*v|u#Px0I2UVgi}2e(JQpPUU4Rw_N_ z;&=J6Ox(kz%42SN4<0{fnjOi@0BVzL(iVz*EDLWP$xi$d-W|y<9xF*5$=TLZy}bCF z5vilujd$X9@y<9cLUWV*@!ozyVk6PVob>MR1=);u&!a6saa5g^I&?$QJi1}ivgv0u z{Um!Lh243^VNj(z*?0;!_4!EmB(x_;X=I|HCEZSagHuv}96^lN7>BOAq-M86s(1Pe zm!gQJ3XqWuk`YTH_8Q8oWjs^6>;D0N9N z5}0DV0;(XBZ2y}Sdx&Dk@>o$2(d_zTz@?+~9Ef5XB?xFerUvKIOFA-Uz50!kc8SkO z7FE$MG6RnKB+!9JfSY;5OwI+?Ae!+c-lLmp{$>XLY%HS`(Rzn}8ByeB#B3q3 zVB~(;6Y0LK;xT$NK0;+TmYy6SMiM8+kEv!q0Dk&pPN5ir7Xv}wsf?ki-m}H2w_g@xq&_@cpO>mB2PQbknAd(9I+*nbj!W*P%_T@la*_0U5L2 zP~c>+Pi@_a7mBGej(!SWi3R@`f{{LuT4g+i23{gSZoAedQc~2^U|--8gnO%u8xW2s zUzPDAWFnqu5Fs!**r&-sGmu_o_$jBLsU_>CJy0RC{OUld+H?^#i{sbrX7hR&BuJkB zucIZfBmO&xDLo(~i6OSa@bsY;7QNVBV=U@UtnOpe`_cZukF)m}q-6)J)DMH&=8;@>cPT-dlRFMLydy~CLU^8Aqw#Ht> z07v=y2y)ymUPd6@Zz)}O*ESm$PkN8T#{vqNC0Rdj3p5&+AsQ0;DzxGiqWn5afFR`5 zUF|O+l;$Gn^wA{~BIhIBC0l4*2nSA8>nA4dB8=;^mrU){JIyybJ;@XoDm@h{?GKfn zd*X>Fc2Rl}fFuapW!1{q>6fQR-6-U=Qk3ZS!uIq?I$#Ad)k%Y)b)d zEp7Bd%3|QQ?djmml`}V@iJgHW@XdCLo7(QJG@b*Olbq77I$h{SXmj9Fi*2{rx+k&H z9wvGAwah@y5%nQ-abj)@;QEMhBg*IPHwpmAL~Y&xDyMlO+lh}J5Cm+VO*EIZl;#Z% zDS*aRjJW`(dkOAKmRN-5RAQhAQAmFmqF#BUQ^yFNYB&Mcoi2#oPcjFjy*P6E(B-8H zZzIZU2l}@NK3ZWloJ(JE3iRohc-Fq^UGx81_#)(rY36rmBZGUjw9|(kqj9NwWw`Vd zhT{qh$E>v9L(Or{%$SSU>*&EN9>S$P0Fnr3UT?VcoM&E-XWltaXa2!J>h{}^cegWm zAmCu_BS)7@Qu_&KdS{4_gQs5)@$pZzqJJ?eXl9fkpD2Ge{=p?>+cJbl4f|<`y9!xX zXQ(l|m=?n95+`k`u;`4^4`;n*d z5b?<#M=1CpnmZKUNWVXBrQcsR)9-&b((g+R_+9znk00l^@WcG}OO4-xtNHDTRs8lF zKW>kFKlli4tW*vKAHqYJ9v;O*2giVP2v&Hm-Wv*T=CNCSULzfdAOUdcDBYR?J-MUw zDe$HgDt*q(CZ3y>ZKX)#iLK6?7-#gR*s zsgkuzsfSegcIKgHyhuO!AFa)-W;a5vr?G>^3>0I&t?!ldKU(wmy4s}#I)gyzXE5l< zp`hmE{Se!6Rg^#YKY=>1+?)O$&1M7HR_J&p%W}u&yp0m0Q zRjjmk`D2vs!zdVOId}tqOX`3Ws!;hMwXYd~%(Dg-|L-t)^OKw~UI(!-#0dVLyb9Hp z^q$-*&#^ga6P*C4A7N|;2o%~@jX+oQNS=s3lA@A4`+U`*iIgV1;ms=bKiEf0L#d&4 za_BZCRPA7;Z?btOAa`0m_{Lo;Zf2#&r{ATmSe4$%N{>!2UvXC;z4P=t^|r+m_SH+x z?Y1SuGSKEAi^;t=nd(4Nz$@ruclkZY;THP(ncW=w^Rh$rNC%5do|F} z586Wfp*zJ2*l;S9l>(WQK!XcLqw)Is)Wx2CqSSEBn<0B>tsJ^l2~`2}qfe4l3_)0x z_G@YS!6cDgUG0+)bCUKgK>)cUnJN!R3E`5WEux!KoA24D+75+Edqay(vC>{P@05Nb z#j{WEPYHN}`vTW)A?oR!ibxIymikJ2vLB;RZH(TTEy5w8Bp&98a7Oe*W+uA;LZe~S zoV*w;Yff(FzpeatBmaGn|8C~LPx0S9{I`?;p5VW~=fB7K?@|8yCjULefA`}Tqo^k` zX!bIgS1@fwvic<0)-HhUFFQ5E=_{~;obKtgT(DY_AxxD8QW|Kk)fz2HOqz5x*i0&HwR zw0~P-f|UsI`rC$s&O^lBWGc(Hs9y5#0faw~aLafEgb?|)UPHxQJq-a~|9(LD%(twP zTvXDVi6tfRl8z68`UjehO`Ha4Rd4efJSv9j8;Gh;^7ju4BrO||@;g*i43hdqeYW2@ zDDWW!dd!)#oheC9Ee}IHJ($~E^m|<_ZNoj~Vfj-)N_rc`OW}=l3%qS66X7}a{h2&p zQLlzV<7<~=pqT9f%I4ePj%$qtlcBWJqZ_lEA7i)=MjFN&k6?o5*%yq|ELAH$sAGF; zqf2@7)rgzAGkF1O=EZ%9bzesJEpyRyem@?`Qm`7O=zCn$Sx6`Bacv>7>UkMM45T(` z;u$@>F?fgQq{dh+vkC{xWL_owUGp6blk@s#p9kBk59o;QE6TIAjYoaAPr#2_+P19#>_D4ryoSuOh2J5BS z4>60G;`3($@oF=J7{cNMnq|~W>b z^tJz^C)g|cyY`PBXB&D^N$O<0k_`)3pvPBb1wj<^zE<%8+Z$eSf<{RwU9TD8e?a-b zkZ)!X?|@yhL|d(pn(NL~N0+#>5RhvDZE4; zO6Cn_MmCTpX^yF~+WK<@`g4i6W`+g~SvqnIk>(>$K{aL1vF_3Syn%Qs?= zrsyf?U93#@vBFIA5M_BxD<{2)70R=T`L&Dubn}9Aypw_}wJTcgld~O|kpl0)M7=}S zUzQ2kU>&sL+L|~85N+PTTOa1SO#ifmrbo^5^gTc}xDSRU8zE67SH_U&py6C%qb?kY zIUI=7NhNVgCveOD{gogyjbPR63`acF=ysS#sA7@zsdbcUNz_lsTY(MT&9lEt15MQ; zH8`I76AJ?IvBu| zkDh+V@W@vwl7>&eYk1^uDUu84tl^PAK&0o`%!yp+FY}lySFThiwIUGw@d6k98K=N% z7LRBveC7*$SQtQ#^^2CDkCwkV(|nx>WHuDc2^aj4a?yA3VIuGhYjivJCKG{dW->7X zn@&QHlh*GBX4OPTjJfO6An^rx&19l4C$c{$4nl*3`m=UGg^Q>WtX8X9!n3T%g1C($`W-;sDJLz`d>S^{vBmp zA_^Lq_ktJ>*ZNyF zX;^i@4dC9or8S~bbu!wOw>t1f?^jzNL~5`C1|{@0PErSDrl(SIx5?G9;)dm{H@dT> z#yeS+vgP;S_|P12H>KcVG%$1u2fIaH5KC^BO6=tr8Ys=_-%2exon&fE7j#^ZUPxp$ zNnGX&oCkikh=J!63N@c|Z$t=U=2DFHiXP4zxB^X{ijjy^H6ngV z^M)ysHgQWUV*Sc1NDhhd5C>HNRzq;m$lQBNr`Yr}W?&4s8S7WUC9oZMB0M_WLQ@QD zeo=&Q(vYgyMA9aG)xk)U|7ZGp_HaQ`yO|VryhKPzhctI#``?nQtx`jGKn6gH9D*WMT`yG`Q~n99{5+%w_(QnZ6`Iq(sXdflFiDdO(gS6bu-?Wr z!`U(C-0JJG0yBLfhzvoyk^0zNx7Qbv$HNrCDer`ht6GlD5!B#xh&v40g{6AbsdqT@ z|Dis(27Cjtn~f&)hHCOcff8z^;6AnWLjqo+U^V9scR}!2)5UtbgS}z(FU)u3`5=wG zSO2>$&}%6)?SGZ0e$xK8B>QO~WK9B4LSf_Z5(z*${19TFYH0fFs~(!4mLv3*G7nebX6y zU;Q3+8IZVyVfriUdmSK9htvKVs*uf6)twb+ZZB`{*VX4M#rU+`!`d~{l%1kU!d|ETzAf-0;4lM~ zo2Eyz^mbYQhmD9x#8iW{l19yqW-kC)3jtOVDxDFUH!W0Cfq)!pt|L^B#R~ffZR!ID z6ec!k2|@e;5WGP>J$z-3T94dFsP?<4>GZuyOkbv4nG5y*Ty_u5|DtBocV~u1u~$OA z{&10vILn%^#pLH)cOjRcAVjE))1uoJ_>NUkRI(scGZ(nz68@y#Grtm^_C6jYi(yH- zpmouUW1S|DVh!lEOJiaTm992!?BS{x!t1%jd=B?rqmCp*vi=)s#%@WDN2n3U^5XsgEPpTZdMPWsm zSS|(Q+KXgNTt~nl8oEVBH;*fd7QDLCraoV3qx$W}Lz4RZ&367mKkd=|Uld;%mfc=4 zciBus4JNKJ{gR9sNlT(kcKg`sOehK0bQIF^ELB@JS7U-=2uY`aFzg7s*=aN(76U7m zl`-St!*Z=PJjW(LAe4eJ?;Pw1VVB$I_4FA}LNF6)Bicp0_H*IzVmt>SMcMXJf(t6s zP(Pr@45f#UeE=nF!2$?gObAeeaxuq3?wMY{(tNQeQ3?p{)yV;HPle-ZLjeP=?hRX zWmI9j(51_vOI!99(i|z5VG*oJW(Qi#LMQCB>BjU?l2pq9tBfuzOwsI3o2}o6b(F86 zAPj%TcPN;2*L&HmPIkn257GlVBkPCuouD-?tz{iNqZX5F4_ao6Nk)6k*vx4_sA%(kEGfbntjrp#I6 z0~1=0X=64mw#`~%3yjhuNqT!y>#@K|_#P!+9ML-=vjZ@IkO^QZJGcWmLVkBGfCSp! zgG|`&FPjM_T~;PYe?9Wq?nO<%eEQKM{gwg@H%sdvI-}d~_?I%cTx4Lb6XrhTfuWfu zFS4IVKKTw*arCGDYvdRJ&O3zfv1(enn6~^xMhoHb+Q)vXsa$ z2U=+U(MGJ6dlzADFN?_thUklj31GAjpZ+P)rI47S^qBvu-jh|u-eJ3a)n0ZVS=%$A zh-O(fC6e{jL}Z=sLC<6d5|?SXy{HoA6v&%QqnA2@ht-f9O~J|wkR1#-YU`iS z@AM7Ia#lS9G;udwvgI7u#_vEEOqjxA{184CFbFSJ)bBk(sUl>!$>Q_58L)SLg~q|S zc#GLP#>3@^9VDSv=r!D=#EDS~esw8bC(+xhpfzNo4LHZBt=UwUc?vsHRLMGxXR)GY zB~XJq03Fjy)!=EofxWWlfZ|z@uTGi|;4y!RvLOxSxw}?UX?M8cSf)to_sJaTGuNWU zV+w;1i;JzATAE?JrtCwg{`PgU`uuz)T=cQte~J3Qw~&YWe6#l^Og!De9Ng+{l@Q>s z8iX5az5l!JoGH6UayGI@5Mt;Qd=A}uFj=eb{(O&GNRTvZmRQ5#e2+b zrXUe3N0Z$@Ib5FS)>WOpMh=XCJ6>l$iBc;99FSy<%1q z3s!}$AI}4$N)=zPsjljRVH(Ie2su#M4LmuHzq={{N4}m}o{d&<=XYvTptVg#7rL~P zu+8-M55pFw)~-X~B$R`}U_t`27Xw+|uhdqR3WgIldz)s@#qb;K`YBH{K&Yz|ksyYK zof}CqDT(1kif(^G-n(G^j$2Kh8IsjkvlHq=%ic8Oe%1KoBr>@ov2nIfi34hPSBJ|S zUgIb4T0AhUmqUEzf=x4hLRAW)ZfVOCNE@rJY#6 zDLrcZc>^VeN~dmo3$@$cvln*7gyn6v=p-i4a65{vUN3_8R;T?HJ(6W_kM$NvQaQA! zA1V(Fvt;e=g3TO=oI;`M=%jiHWfeO+ip8|8NDdXt@N*9pE6f(YB{P%+Bty42szdYk z6Rw4bf#YFssMv)FUlns2vtw8`c;HLTO7~az2~n@H{2*Aj^aLcixf-jbSWwT%0fXQ@ zR0>a6)EHG4+?QZU$9O$~&3*RV{9#L=!M^+d%1Vv!injR5x`&DYYk4Axp%bl8Yg`2{ zV=iimQm_9Iki&ikF2o%)_R>lQJZCMXHxqILnr(Wum%L0!>qSo@wK^fh#mX=VN(@Qj zVn~eSl$8R#wg;7EWtm(u#FcV3-!ZIWY`*gXVXk3e$dh(&AVZ-DS@pwwwi-eyKe-L9 zs|LSA&D*5(l`GjAtp440R0uja%_suj0Hf!ZIRkfM1gsH?7sNzgAqU+D(D@E_GrEh5 zjW&{LG>fSko<8o#0%M98|EvKMc8ru^Eyy9c$BRG^Ir_{sl;!W>kZ%o;fh2fV)srQM zhEpm>0ZvI~>M#w9G>t(j5__E$Tea1=eZDxc2Ddm`){DxXgt@`z>C1;1s}xQ+7Pa>8 zhhlXG`j1h9HAy~;rnx{BMmBO-;j_re!i6g%i&{{SKpSnQV9hSHPU$EYcE%)+30#*B zo=Ofwmh;y;i>le**?msfs^+7{3fhVF8uED*H^*fjV*SQqJR`Qj~)EvY%#<>@3Zid7F?7hwVUyAc&fFGnMq% zP?-}qSE$JmDuXqn4(s2-qQUzko39M(PZ#QopbPDjO6+6M$DwS>e9i&GQ5N)T$MU9& zh3e_2rpb%1p1_9{8aZFVH)np^(mliV4u&ZntC7O1ZI~a4^(}VmjH!FQSTC*EL7rH~ zTX4{|^xg(i6P@8{B=seN`w&B#e!}J{c}Cfqrjgp7#j2K*F&J|8jsZP20K>Nn+y$vM zmWYAbiJae{Y`Bc_>skju>YQS31pOT=tu$fjdSxO_XK87Su*W_EviQOLnvDbRtchD)L*Cs=L1BY&h9I0r_6 zLoGb~B?93*o*~VC$VfJP0tI+ZWCzTABn9eiz$ugUni-EGN2^aFC<|oL_s|$K20ndO zd8rJ8SW36wAEZ@b0KpL*d06DsV4|E(c*Tgp3?kh7+T=x4@5E{B`pJ4Jb~V5s87=|V zY;;&yj<3L8kq^!&tQ&Jdw=sxw^me%T!ci@zKUVj)<(Gc;7@I8t!^`;RWL=2GZQ__ z%!ccLi%XO_2YMTol8+J_e-7%qp_stRQE!iNH`*F{6BYnHeMsikc_UWH-k2K!*%+KG z!N$;?_t2^lZ!|I5#!-@GYWI!kb$ z5Cp{Ov_&5uS%K{33JFXn{a8N==I`$75a`NTHF! z$=z~5HdlSR@s~6{RX}!_Uuq|4_T|9kqPy3>jq=IxTK(OH+L2!mG5~mWell6lw2?&o z|5?sQ=ztu-r?FAw8d?Xd z@?dDPS2+YdkdCkiU99mVMhQ6bIQ^>yC2~=p+!!UWp;-(fR9l&9ii>KT?QghXg&kaJ z^glJ4{9>%xM66>aSoB4`xOUI+qgKH-SZY(gtO0>StAP9k#4UIa_~m{Ee!Qg|QN6$| z!B8W^*8Mo-FY5%BTrV(wKaV#Yi9#BX>+Qw_g@>RSqXb3CU>^4`>(a$y$5V|F=lo2%Mrfzpju;{fsvQ!r?(Rl;+~vA35K_CkJT zH0p_B<84?8Lv$B3M8y{lJOS}=ca(@a#=;ukiK zOG*g9^EUP0BVOazw~Hca5%*>LDz~!?E&=&#mBzOqgj~iW&4{K|yeCIH4g2~iFzV+K>R1P#0thIOln(Y_#1eEpSB z;>z9(-qJLba*>2);X^KA_9X1kqC5S?5;i~Oo{@ZQAwfQK*$i127lKp;OGIoP0}*k2 z_izybA+1g35`HGo3S`fe-P*;1UcCgK$Z8}6#mJSh92F#6YD}cN>*3r)S~>|g_zLg= z%#!CvQTD$e&z&rT20T9Tz!DGoUKVUL`McSCms-*RQGuoO{8!YHPMBZVy$*;Yr)OV& z@MS_; zImq_^x6Ql-E-;+ZdQMDVh>wedN_L}E=!rs|qEch+OXG%MJ=)+S8u%o&dZ%An2tUO& zqEPChG2wuFtUMnL#*n}GwVF7wy4hIC7$^~EPHr3=rx~!U}L$F-a^qIO1`Q$cWBFrt>z0hLFav=G_^IYMD?rdZCSRyBEmg}8$Skifo z&-CT4e6$K%lo_6v>ou;0YGP>@YAbE-;NHzB;`40$>c)Sfn3g7)c0Hm`a2vuB5JbU- zJvJ_T8(%ez47Bq0io7G<*z_?D6cw z0>xfw1k6A%cIL*`*X8jA*^NrU{Tt+sDc#P3G%c-QgqFNF<)&`?-jwX3viyT z9^!+gLi1CxXSr|YTBYfC;R^DUbcXM9K&C(pt41D7To5RvEkcg|C_ee5lab`XeeNDbhEL;%qHCK9cm&2q_qL1ql`~A zEY-cEEb}P1qoXWq8?=d)9c2(1iOM?=8MYp=jFjqu^@tg)Z2902tWfv|hhT*QVjwZq zzzW5n^$D0oN!7c+jx!j#J|o1}@h7t+h}6+nJK((|emkeZCzMs-qOn zzUU9eXie3PBsIvF#j*E@&L23{eg-T2omjwo1UM5Dz)VJ`%E1o zKAwGBlXf+uf@+d47?3QmlA8?wi1xkAE?_XD>NqKNWL-oJ6QdOmJ?t7j?#iTV!FaE>hm81a57L-Y z*R!ZNfY}jRwo6$5P+PYEAf~9Kp+nZKfiFZdloXRZKhcj8n-`<=9+?GBb+5#VB6>wU z%MfWvn6dMHXY-LIP{=?|FtBnHTH;1CaAYn)Eb0L+(rN&uTIIxCGtn2QoDIEHgCxM_ z-=GH1V#>zm9iIsi^G`gQQplD_uO-_Ay$Gd)aAmy`$+~y3RJ^zUS+>_XLp4XS-;K!| z(T*~l7an7`()N$Qso=hbi}W+oHjH9&m?#K|g`v=CJb`xQ&uVKUm3^y&)TEqEqxn1* z30n_q6UaXb+;g+7`E2f{(dt7HdvELE!25{B;>2@g$DpcMCj!u!U$J1a7=-4XfYD$A z>W_WHR78vbi0e`);69wDW1#J@_pfOKt2q@ef-eA^7J8<(hf0sf^o>+cUqP-m5+F&x$8;< zbd-{loP=#IrQ|I}-U7rl#2cjsn&f3V5TNNg9nN@gk%6z>qEm%vHha`-j3xAi-AQYN z+sK>{HrXKAiTpn`zD1<3G1w6^a1=dpX?2WlLw9`+6OlAtkj1bXD{a;iA%;Khb)v@E z)9RmrQ(cSU%fsdwSZPp$V`!WwrjuQRvA72*fSkgx*~yn}n6V%!WNp>H^aDbw~hfg~KccI?MpEqR@F z`iyUqN){ki-+mmSZ0{!LtkLi|J`9gzuWeT4fCu;CK_15ehyIEQ{yBy{Rox>`6h zeFJ&HxG0Ws#Oj?ha2YhQP+2xBhf4um2XiKqP7w<9j|9Rt=$WCi960~mS+yLRwi&!b zQvDNTso(E7uLeJ$4O^YYf5C4L5ux|!l@kmi$hDDLet=LK4tnL2p{g0|AOyk>|AcqZ zg>krJOg`n9H_)o$_EV^9TMs7#OjqadFnDssCwl{#kBeoF27p`8&EVeCm~DXUYHI;r zw%WEAK%Z$V!4H|rQn6jtV%Nok^qkCLy=rhRe*2`TMT`ZZ986b8QT;=8eX9Q{;914a zSZ5*x#)fZAoqEPPf<@&=uz=s9^(p@62rveg6}~lP>KU=#IvhCJ|NBH>20}zQ%yLze+0i3c5vz|vHf(LlEMpc-ppuT zSxm6MT={g&fGA(g&oKbv?7-FJ7fVAhCQucYaYeg{rVbT(tS~oxkImletMvQh%(1uZ zQ>;J;lZF#7Il~t6X;Mv07;C=$tjOW}(%D&ip5lq|fb;{I;a%Xb_uL^w(jI7;i=jW# z%pFe4Fi$G>duV5`%Zu>@N;eGx7=hH*|3HV+yKLGjy+0{Hj=B!0u1Y0stHu^Ze=nNX zYn=a262zI^n`2>5(wZm-s5p(^Ud_)lnEtHl{iI!KJs0RHE#p3yf0eCU=Gxn zcK;2tfkX4!Ja`3XJTBCaSb`UZBna+Xclnys+2~pKubTjH%YGRH-)MnTPDe?Rn(JPU z!M_$of6I!ph)Da>`U0bjX)Bh=F;hzOd<_8I`KdCT-cbZG1 zVA4xeXR10nMRk@t)zM`*La00&cL>+KP+4C0$ogqmrZ)Z!lLO3&;j%T&gDLzB&|K;$ zD-gFraVw!4?~{6uHMkKcxzI7;+gi+0Y4U<09XEvpcnP?roOYz|fhZzCjM8Kg&m!N6 z=g7q~g?o6)W%~K#H9eRJ-ZtZcb`5r0!Doa|`;73y&j>H6yKn?nUBLxkf1ERNbpIA= zajI4%aFKEC*DyR=6QN`f6=y1R8k@iws6g*yv~0ZPQ87*Ou#uU9IUL56l}JV5-Q#&1 z;xx5kjff1MMqW3HydI~avC}9-aftW{%b=`r5aVOC*lj%dyci_|Db%oaQJ=r!Med;$ zJBner*A*?f2{Et$NB*)jV=~$gJv+L;asiChGK|-l(!lSHhE;Tg0g(}t7g&i z?KZFkZf5;=da*AJTA*FY!T_zG3pOj5%?#6x-a1nkES z{soWXV4ie(O-4rgt0uCaitLd&&l(xu`&+DdLqT1E85IH6(9EjV8P-1~C8U3}`oIkc z!OVItN=4yr+*+EPyz&>b6nH{ToiD>2NdZ*<6x2R%JFh*N-AM?35%}tV4Seyx2EO@U z1K&0noE_L@!vxUy7K`{I;lKQC4Vxz*oOs~;JvkZ~(de@G;9T+|i7$+~{ zUYoqZtinbcCIY)W$Y+OFKt3>iN&OZ9iO5Jq^SoP z4(-4K`$ib|G5u`$WDJtP?%?Uvp4;)1NcqW_fr_FES%a!@2r$Mwi4X%-NP^X9fNUp4 zZof%@wXjV$IuY1)4hZe&7f=r*K%ws?pXGgP)Vek3SDNTo%W&Iq2+RkZ7AJti%fm&- zwyOwVjqvb&YS%9)>s|qyn+OX->kg+V(v=Xt3&l~_&qJ8rkp!#QwYn*%M3gs3LVc_^}V& z$-5N1fetv^7JQ*lD^Fqvg6{{$>~KIN8ckT~h=~REsqyc4g~{cBF_s<<;o+AkJqEBj z?=H!CC9V=&YpkmZck^z^xf|D`xVmtC>mJGZ2JYX-^{dsA^BLS~b=n z*Jz6>U}%QC7aOPkjs?Ay4$kE;dOMqK}a>q%TYac#r( z0xlBh`q>oqI})hW+&KDtof`ZYWWl4UsX;onUENtE>yd+)GWX9>A2>`Q&o|5WaZwui zw&c{$VmkXGf|+f{n=jzJw4}fooM$hu%rBO)Hrj@cj1?V39_Nv2@cWd71)v67@K)D$ zJqOayrmDf!BCC@Y^qmC#e33k>7&iBX95}-QM!9nYaL)zG#ULTdJ!R!Ij&h2Zo5r*9 z43tYIEns=hg6_g=yxik>scRb-D>pD1fN~qvRSiZ6FrMx2IArEPwp$PYXom&;LxPS~ zC&+=(eSs*iyC#5L7VwHh;Kdvm{Lg_=_i_Q8WdYA1;5Z&vap-FXvK}v>-4^r+f{x+w zDVV0NZK4I79>@d2xfbBNh$E3k>+a!~9)lr*at&tp0AZk~;P7Su{6cABk?`m)Y z2Zf9l&8>bXjdI#qGyD>WiG)=H}>m$s=Era++%0ffQ{ zUPvXq5eg^yYcYQX3I>0rEn7e#!$N_!i|^=-p$8>tb0L5XxFhZM(Y zV7e1U|NSR4gjt&8{5r1R;rbJM6Syu$dUy3soa7vofIl}2ocQ~CRouiy;C-Sndmz=la`Yx`waLq&BAzZOC zQsva-)GzgyB8(IGg+WMOVBV9B?SSHB%5PFrz){hHu;Sft;@UyVka6n;^T=<^Gh$hxo)vY4OOfb!umPrKjUvBT^3s!zYn zauxWfk|7mk!4}}cMAh9~kRt^g1Dm)SWOlyW9CxN7$MKy{r4IgqJy1xLY+jb-yQ^KVhsTp61Nj)ynN z)Ux=T5#Dh$XEdG%YOk8zh;_C9S3E~o~VL3kmv%S2|g$D%Le(+oIgT?(Y*fO2GK zq)=S+R%GvntFpBX7M1M3O1o$_pRPM*XHdFiy?<%o>&%x4Z_#kU50Kc!Zp^P%)_7*~ zDe_F(IDa6ay5$4aHMT)7$FW&3HDq_u$>&&G>yUpyVwP%sz}TD+k7Lv&&- zAc>};1SABD^WSKCi(0CGinek#86UJNYroS0;|v`GSPMiPdf27wUCH>K1eOO!>Rl>%Yfm88cU`r?t+;6g$4}Hy93~GA9G=UK>! z`$Yw14=xC3E>(jkh(9OtjYn5Mf}@u}aP@g{j3o|cL%Wr6cb)^(a>gCd#5kdA)YdSF zay6ffYxtHNv>Ie&z5%ZmY9NWs++I4m_$_$VKnmC~@9v*D*X>q=zd=H5P@i#`=4ioG z(Y#;%E}bRuMc5Y(#-62ci3I}&O2HQg?;#;(-1-Sx`w&T;!|FyF)!8To4yFYg+uT| zV%Cw4j4(Gt^}rjKkPa7Pyt=Y~f6IDdyB*JLK6Z~X^&YvS zNEmNdJD9CDjsI7<5OMRP?3X0%je7pL+H^7tycjEcm>i0;> z6x6A$yXfv#Tj6{!6=Z9!0*B^=3$mkNq^7_fnGUnH7k9r{wP`|l&Y^;|b>%=nMz*0! zrK5<>HIX(I+X@;0xHyoC5E|szJ&sNC*n+%9xnO3~D3mT2lr^Q~-dT{mE+<@O3l%xK zk2imEP2iFlx7z~aXWX6?a3NP3Bt)+0=F-yIC|+p%#wD^g}#%Y8lW?PLP~MI_^h)});e@x*FyEruSe3^lkCF9b>)L7;XuSVi$K zB<*|z@URJ}!D5ks3@?MFKVGvH)mNMHEgAv6TuR(hzj;5^AOf z`S)6rc5M?dqvMT1q@!=8a-iQsqd+a%2ncC@gVz`t)ZoA4jjBNw?}0)i7bui$)o3d< zxQge8X)=J+U@g7T5heTi>upwk7g_mP?e-=jd4rM;$8)*D%H=pumKn?C1beI zHhLn6`Pp|R=hL{}z}16m+yj`8;ra%y|G{+)cy}$rr4b`WV0tEx7?C_;L<(N;mpVd8 zi%BdxpT*PXIUKXE;5=A30P6j@>pn(LaE189K*G%vfkHqof!)W8yWhcC((B*EPLSw1 zlyeH#XCIhv&1cf?rTs?Se>MvEm>-9gvaCsI?z*%2O!B%E z0b*@5x9~#_ZDetu)qZiL5M{^98y7EcB$WqE$;}U_vC6TM13sIaM;sd9M`&Z3&y3Un zpGNTM7lOwyODmq_DIwR}ytIw3U(5?X3{q6KJtViE2evBtz5-`ByxCPYP=ZCIQ@9r`>Ks!{|sb23&%3kTr+tcJ`QW%dr6#jE~1@8w9~*s zKNG${SmD8*a*Ko_ze<9G?18(+Qp&Fv?ZC6bF(fWDH!Kum2&Ct~k<}Dr#gjum3^asA zvtjwA$MREJAmp%vYDktxDa#|9KP$^&`MvnCg&*YyjECm8hw}UG7vx7AGY{t=7&U}l zKidsXaB%OQ##Q&@^ULPFE7)|ZxOoIsU&4R!L1sDxg}i%&7oUbt+n_LXmH07^(-7uX7ObzDdtt zo^lWUzlNFUAmF_CK4EkEM&g&P&w^hx`mBN21WudVaQG6ofXnW!ibe-t;pBI3hjd~y z>~{#mVIc9a2*UUVWb2&up%McbJL+xte&+8_^HS*i4fMdLz}q@L5>ED02fp`Z_dj>y zg7M;fm`4PPIF&-62;rx;wnJb59j;kFfoEvcCx0k8+fMuxUwjsy+QA61B-(apXu!6i z0gnz1K+_G*W7*Jv!l40qLjn>%IhBZwGz6~g#7~Blb!ce7wxI!=hX$-38sHrokUca& z8XD01;~{uRLj!sr8Upd?(16uH8Uo=R62LzTL;ijzzjqpExR&6m$8{gB2XXxp*Kcv{!etE&{6>t6 zF>!>tQ~E~4z&tS8b_DZ)xR$5)EZoAK+xI{udsXK`_Z>6>-=R7ms&Qw_eyo`QF*1>)Tug`yH~5uN8FH7fNpwyYG-H^?(J$$dkiRIB~TFX z2L}M=Q_>g&LYn}w2a)eMc#^3&yt4^V6odTmdo(m3QBChsS|=WmHkyz-r9BGhwa1Y= zqTj>OE(uVS55DKN_84N>UYG~){?1g|@9v&D*F85hpB!Uz@aPTArxTbKhJ0D%RGQgH z?t}|LHPAB$5$>>~2#?ue2YojrOWZQW%_VM5af7!%fhgi8hvkYm?Wuu~m#pq8!gnOn z?D%{HFABR}!wZ&hOYoD^{-L^LAFkaW zs&{}Iop_AkdIhhY|NCO~E?YqVP#q2Q@(*peV(M;deQi?0N zTO`|UJccv{kYJ^HS43SJ`3QCSh(5K6kBfi~q&N1U4etU3j~y+$)#~KcpcDk-U_h%A zP<|Nnk!Ckis81gT6m(IcgaU?VCX39dn4uUVvBF-VVD;%&LQZ^*o$eKJH8GCQN9tce zc9C}sS!!R(^pN`WA*zLDn^S&1H(GPFRxpBQt)zNU%QSh{iS^6g4Fhp(H37tps* zN)FoFq4)>>5kI4d_y=FyF<>6qM-0Tvldh(o{@8wK#%=VIKyzqM+_Ijh@1--JVO|gA zCECb7qVJN*>g}k@VsPzBJPEqKgJ9%Cx8sP2Wl81XfF0U1u3WUxomdoa0V_TZkMoL< z{Z4p`a&{kl9>vw-1cNKY2?mqIc@&xAbd+Wq5+O(9?$%K(2GI&5eU4S`axD;3FgkA$ z;pEhA{fJLsX1{}xKUWN^c^HI|lg7v7Y%%&f#OG6J(xK${2i8#&g6u74#F-fUn; zUBc5~mJ!GjXw4XkR-H~qS0Odm64)(Sa8sVxQA`_`rD2DzC2A5pA)g*D^6}!>H=+O1 zrta7-76t1u915=BINTLyb>d5Ra~!@Ba%d`!5AjnZ)1nuS|A3lljH57)B284(< zXnQ7+HEj_fg=vb-P^%TlPm->=tux6vGBrURt!bjjIHl+#r4JI3DkysD8lCc55-*i zD}pZ93cBP7x?GA+%7d4&9pCF4M4PK{L`c^}S}U_^ddX+jR9MBaJrrl*bd|&_n4w9f)C^xH-*DJs#9@7-YTyRVY|||C9ZpuRJF^ za0#7OFDU<})k1N~)2^O5u@hRf2?DBrP&?8A75F%4Jl^_ zT*QfkW1!-Uqi&?t+4>?#y8*_z8gHM;G>Ef~s>Rt+v|WhZ?GC=*a3y)?mS^X8ZkXxi z)uFHaRr;q5;v`r1J=i3HE&f<%3M8|;lx`gM&{Tpoub-Vh!;HkE=#COY9n*@;)X;qj z8&!qRr*+KXj2HT*E3_6z$He+=lw-lm+>A2)j}9u5KJ`L%L3YD1ALz_@!urV&GF`|;LvLXhh8Z-G+S`!c+q+d+Y);rS`P~`;uAlpA3oz8?}iZzFwP7B zyq8X;9WPD+erR|``i)Xk8g`=dbBad!6=Ib5Q4eJ<`f`g^YmCR}e6jPsI1?|X{4O-# zBVjL}F3*vqY$=dEz^!)-MG!(4=MZCg-Qi1Y%wB5DK75{*q_Pr4n+`fx(C)+j#(@UK z`9~aVQ1k4k^O&ht;ymU=X-}t_;XG!Xyqs`WVX6(`z+au+oz>T#t*t`N zQ&@#NxDN+d-R2_a{M9%L>jO$ghn65I^$UL{sM=kDqYv+P@Q-p^T{1wpSrm@uu46u2D%fe+b!Cpboi9;$Fl8kE@7;;eQON2_W+JcJf zZZW6^e9t&g?ltxwl0EUl$v-hnx3k%cUq2htuIRk3dn@ zDp*-ICLY=~^fMmkwFJIWS)E|)k0p5>R$@%0VI}5SRKk!faj^lMn=pkO+E&2f_bkGamR^%XwHy zlBBIkS}_dbiln8tkyjn1?_NXsrMHp$1%Ll4WtQGX4j%k{fqvE&xTTGB2L4_Q3t2v# zYXL*!J`cNw^0=anlyUxk30l7ZwL0BSYlPe3fkk`Md6XT&p1zsrj_UXR1G>v*y+3_j zDlA!V{wG$((0bLzEsdm3K+{uOpCIk#R+?Mn+RxIbKJqDH_!|^V$nRdcS=~urXtTD5 zQkr{28hfKVHH^S%@FDm{Ff8>&P?NmhJ{Nz?7gI6j@(Cj*zh=ho zd1Bst+(T|iC;cCHf@2s~N4o4pfW+TS2pCx8%9Ke_HgX(c)_{fE*B0fC2Pg5}a!r|uK zhtdDBd{3TU3Fn2!1ykPR*k^-lGp-1(UR>Evz;KAG8P_&ky}0tw2bSTAjiq!aeddDW z+an)AsvP|-Frl%Ht^sjvnX@r3rtQQ_2u&i+CTdJ?PT%fSwY3S)r+1SyP=jkIe7%D- zJ&5DmDvcZJ5Fo^{+ByR)KSU&-q+$n&WHmUNdPc$#CcO4EEMc5;@&kxRu(fWy@G~I` zvuXM9R=j4j(}~CY($O>n5}4BCa2JF%dWk1d4GrHYoqBpWSl@0L&5xQu*lUaV30*7j zh7u;tOw~Mvdcgxy;EZ?3AV39R(7?dmgcEg3kQ!iGa$)}7#*Z%q3s2C#^_Q-kIZnG? z@Ne--y`WkO^kWF_M3m0ik<&B2lveQ}4MTM3prAILsFy|KR%y{qW&7UKjC|?WM_eb6`M{k6x}s9 zRyoqFE@ciZjgzgS7pI|TBX7T-z@Svc)g_u*bHgC5f5$9Oj|_!^5{MIk(UCFQIC;_H zU}rAMv8jc}<8bE&oDHyA=_usWP97L<9m3!FIre}VLn=V_0DitMKk}TMDjZ}$@j@QS z#--pA;?{`vN4(=?__>stAG;4sb#YR@b>0EAZ|f_j;`7w-A9hNCG``+%$LtUfk-!MQ z`#1RH)|-@X6QVDNgXn`#)85|uF>!W5DnrTzUq-ZlIRTQ^RBhgCbsdgMVBD4*z*Q4@ zSK$GHTu?<<>J3h*G1cFQgxvvrCj`nabPQLBAJDoKhm2?B0^T~uZ2jn1d0MLfVMP@j&5Y(G0~=0~*`#02X1fF9Ji=;l$sfzY_xZnb;dha;hR zzP!Cu8Cp&hTsAOIj^#}!=c_MkXtYqpkgp(BZ-TO(Q?yGL$0&rd?eIzLUu0~4Wr zeC|=iG4mO34}2qwNTgYo>c@xG-8fQ1>Pf>XZ(Ny-NkqLT8~qIqMv9Ps)P=lT7K7Eq z$t<~E|3kk9jWsvUFcKosEsSv4+@Yn4K2=`=oAqKv%Mw!!nc%_SaoS@T`G44Z`|zl$ zYw`a~G9)7m%m9N%Np+N9qeP7cDjKi}kPwuY2_Xq8FCruk6am8-2?~f#Xc>=by}h>8 zUT-U{w-;}{S8r!+J75z)1`)PN8z~T5oZ#*U5Yr}!WYBp%~jgD|zxEL1q zKpShbF~CJVeLc!iT9JGGXur~fkE?%0)k1+|ON-rvrF~f)aflzbk$*!r0^n?ac)w?z*^-lPLJh$;s{Qe05&W?+2P~Z^|NAA=SCDSk^Bp%db=N zvY$$6*e#&6o>kl7l3geB4~t^ zD_q_gnAyp79lWwK3!5p}0B37X2bF{E)xj0q==yO~$x@1erG4p68DHgKp`d*>9;fa@ z3L&}V_GHE0y0#b2xu=!4{jf2o1muLw7|YYEJ+cKUyoKN1cdHgj-^hp|3xp z;jo}y-j)00ewQDO{esJnz%pNAlQ)6o+vGKZ8Lvqh=2_|L`M?6oUVhjd4)1;!-vG1n z7@8VYb|eK;;a8v{M^ExL#5aJWP{8pRBd=bPD|sMqhsukqUlW<#7c~@Vno7e3rD$;E z*)E+ig_N#h3^mFx4;lh;Wm8`TNv(f|ybwopF@M<`jZoPls62*1ey-Z&tpqEK{J0uu z2ohHBFH%E~Ru*>{Uc>4(bFBQ@Nb>v@Hb$5$gzi_X0=)5VpLR$}6r1+K4UaPfrC=D~ z8_(8JU@G>a$ngC5_-WfFxGHUZLC~$viUgD5eU<(xYzrjB%7X*J;vg8GI!X1L0@RI& zbTr-?Ha3mK#woo90belEnB1ZXg0-nY&!E_J=w^`+Px~L2%YlB$)i8mj8klhM2;u2P#9AMV||r}^=zQ3 zhX~w()o$r<-YT|q)CQ{d&jsJ7$y{J3S;9{8LVME7-EpFSi|t`4P)kKD;4HH^PX^Tf2Ek6|-`$Kw)GOT?wO>tsNq)qf z%S0$JST*0|yLpCiLxt(r(p$ zv$k(j0-BE%UMVrL?6hSysPyBiygHbe52Lqfg0=A2swBh;qbOMq5Ew+rmvl+#Wel63Gu<& zo9tXWnN0Bbp@KR*GJ+#Y*T{OEC)xKfHD6}e=1=~bl|w;qyLENVM>q&xRRj+r;8ITdFw_fg^t|o`| zLbo_lL)7=L`~$6F#JI#v-Q&`LD}LD(aQC-Ow1m04s-fTg9Fm{=IpjwlSyFYF^TWhC zbu%GgfWs6n=Y{%Y1&QKv1;YAM`;Cyk1ntVM?rPN}>zVHAu(VR{`~a=_EVs)jeLHaw zfz{}5WvywnR(Y-UC0u8W6E3gkvQ$B1JHm_lS4Bvcz4(_@B9IV9m#~cgLpX%3q1_DWSV>y-8pFvvSKD zn?~!LgW`EPsX+5KP6dO__`9#np%?MprPhhhYvJ7b@QoZdyT~3SgY$PluVt1+*y)a!{Ml)44&r+7+SHFfJQ?A;~e0RBI)jT4NQ~9Jv^9 zWTNCAs$&9#sWLJCp4^x)C1AsXqTq%H@qH4aQ75%m=f~eUmZ&N~!vM7?X{+cO*v%I5 z2z?C6{T0IZ(D(4pM}CSF_9bXr@Yna>FKgEUoPIwb=fLKWMLX{tnG=LWhPpI=5a0%I zVplq`)@<0xTh4_%JpKxqBRe0FB4+H?hYPNykJhMSwpRq&UYB)F#KA)#`Wx>Nad7L~ zQmFwC!VbNF*~{{`FDWNfKtoPdqyc>9>vresM^cRQ6R;qAosoL*8cJn8}(~;$y2I0IuUX}vO;`UF3`==cVmaTq94=V)E}9`iK$-f zOy8GP1VhqqZ=@(iFKT^iL#c2g!1?$?Ek)K`zr4mivhm|8jUUe?zmA2N;KzXse#~M= zFq*@#Qy9#UwU28@CjB7y)sKEI`zIhEJ`0Mgr1jjAEU+jC12iY(pW>&%47bRr3c9^JXs&_ATw-uD>M=Wq^4844-kg|{$Kp;tYquJvwvP2< z>gtrfiIUW81~R>PfI5>int<~0jmTZVdvhHEje2txIJpFWMK0-MNtkQj zO49-UW+k=xTuCc`R%e5?#>)|1o(B`&MP2RwlhFwm%U%6FerUchk8lYYjiewi;~n*+ ziM*&4OjyrSUeG?%tmiU`nFrVT3jCO2K(*X$+BRDBh%&}-L~kX+hpl4078198WDKne z&-Q8ZQvq4e0+6}=xIpyY^+t2^AzAwYH-2mw4$0C zBr!{PFG|O*61G4XkzVUUQb23bsoF{5YAx(VjL^aBDVhR1%nRb{AwI*CIp0&46l_&) z7^xH4g<(_}rg-)U-ddwxq%BHkby}e6ShAyv)`?_&YnZ|=S;-FfEfNgIkB_3isr1g-LX?>Br>&Ygfz`88qf6QOu8c_|Mvubyqo+p%eyw71Wl;wVgP2+ zy=jK&2Zobm^tK$iMK(N>cx3eoBz{OFc|sfwgmFRCT4dak|0HA~t<>Av{aiSiPUpVR z?o|&*_qR`adrZ%qcJEsfe{}ztW92WHLoz)yas-;jhAW~;!P*QsX(`)a?pE)^B0B&JGPh9VxJ@VMJh8b+C3Wj`980tGQ2G&xtpnZtz1bq@B6}qvYy+&wVm?{Q~;41ZV5`{B;&M{J#&_)sEAYqsOtw^hmg&U-2 zb;%ihi@k_q?J@=Q$V*wWa@!|$v+fo%I1}lTaqvn;MnN;sF8&9FAVa@V-AKxiO$oP` zDDad&ANbBTiRo@%o4)7htJI&nn~KLAhB>L~1s>q1OW!FW=@Fp~F`OvwQ<((Ubv=^!h#~nx&f>Sm^%{jWi?2R$l2j_kY?oRA{ zCzrd7$Y77`_#9Oj&FTCscift=Xe{K7ON~2d$qDl$z*iz|t*ztK{`usK0yXz=%Dn1@ z`~31_tXm5LbGoakV!qHIgoibOJ2r?O&w`?v2Y1sY4L~tC7ILHM!QP*6xSS%@03Vfy z_~>C$xQRstHP^OJQ4|Kbs1&EB0|OxxMl;%*voaMN6el5eo`I-RjkKa^;8sL^^09`G z*eZ17cT*DP=m>KHMA8y}dqAC1jZtY^V>5w}&K*f+)yK^8{};1BIY@inO|RZgf2>ZuBPkSHrrQny$!Pj)HpmzKtS=4K~y&8oGe* z2X}CpPx;H{ir#|e$;Y{M(VL}=4f5|^5)OF5n-oSni@Ph-`q@vk=vZ(Id<(C>^%`}{om5Ya=yoNq*K=OJr$N11-kx_ zH=;3KGl)|u*{B@XDjp*Afhh^J{feQYW1)JkK;!&@0mC?`ncr|TdtiAe;$g(?tf*UY z7zeY!Ek*o~AoW2$foxcKUJ)`DFe$?Ju`JjShB#Zvc#g=DF89ub{Y$?{o&EOdTi##T zT4omm%mvLW%R5ccP(#?M=8@9Ch(2u5{%OY!I=wk?dZqFG*j7F^?y4Y*^~{}L^0p(h^s&3i_T_I!8bk#_ z?cDn$YRVj|$o=-6ay9H>;OlR6t1h*#^3=P9DhTLB)oWp6_jDz3>YlDNcI?y1?&&U} zO1%si2gKde!?G^l`W%dh(LG(WpozuBjv(jFO|r@c6YK1=V7V;azL?hr_`xBx)&V}h zwGAr2;V%6v zNs;_DtPpkJrvr@OisM5i+cNga#j;PgKE%2x7%SF9Gx_5_Qxs`0L;{=LWfiiyDe0=? zqI;3GZahy(QI$5fpPG8QVKq0U^NGW#&gx0D1{2Y6VogyuJQZDo6%Mhw6eQoFqol@&&#A0K3Z;$K zGxy9D_CFjQuPVEdcQ?M5lymtU@Ljh_=)V$WuLw` zxxy}0hEeN}O4+u8N%RSUn3?7Nz^r8^l@FD}-`EHU6Q#-3f1B0z(5Edw(xtWOQ3a$B z1n5}*W@gJcN^70$?>i8rgLLWns1yjc>xyAswICgNqCJU|Y%iSoi|B6W{iJ++8vj=0 zpjH)TWlBz4XhS-d3s!VjXyIRl!f@a$GedO5%zX9YG30hG)_*f!Ee2tv)5S+SB_=lH zNT(N0cT?CCQyYyWDeWjR0-80@|J| zpy8@pI;S#T@_@m7Gm(;{&d&hoZ?p~o-6sIrF2#?0vQ2*cPacq;K~LVxk2M4pAbY%S z_f)F;&7MVW?9qEq2sb#alQTKp6uKi5eX2K6 z8MdbS;7}4bghaEvvUvL-)5qS`drK%a81s!`^1RVE)CfaWDvR42J$Ksj(s3u?)Cv?H z7be!1Bx5uNQlnIegAjQoFXPB+t=GPWszxvx)<&Nti6}!M)SWY4HiC78ML=kw{VUHB zuH${hD@O1Jg1oodzs~ntc!#C%ii76%!Ywqxu->af68S+|>wwrRT1#E~oM3%zayI9( zjp+$Juzj|6^8vUFPGiUEGiTR*!|B|9oCYfwsx@8cZ`dVdG{x4R)9=iBpxnTu%gK8P z!j>Ke#IT(fZ%wu|8F>$UBgFF)p`)Q9?4`<%B%{(X`r>7EE{$&XO7jaTz~;hYC&B+j zQL9LeWRy__f$<4yjvr=>0tY@*?aTQH^-=U&xHM#}AFxFF1g3HvCBH~L(cW*nlP502 zDgTO)Z@nL;!G0n6p-A+adzHte48=9WXfWIRk3_y~a-SqW?W7N-(q>bi|2ahzMz$>z z*px<1cS-7=>Nav_mu8wYwjgzmlbZ%ib7vDuSc?sE{(NF(9z{64qE?99Bw(nX%z{YN zcPlcT=r}IRS~*cxNdHcG;j-*)?})T#E4j0fSK+xjl2&TcSn5&HFbbDpuytM(i;tzK z`pq!aT3_2M&{F>#RqcoWi7J#;g$7;5@>wbf3FKpE;OSSdeLX*Pw+D6t78V<6r$Zy% z9r~w>Rfk}yIS}zB@3;;*Oh>FblQ^sQt8`+!_f#j!%QVX$eM;I_>dapegsLiq%VsPi z$sFDveqCe}Dd9jqW+yRNeE8dn9#?@+EqXCG3Db-}W_k&+C%^&iORs%8N_9~BXAdp<_=*oX zETfgp0BM7nFW*6-a=4(A1NB(AcL(pyYMaJ`&x6K4;;)mz01tfNL1QxBBt%7y0g@AW zL^kE$wq1{QC^{*t;E=Of0u{v~Qv`RLaKMmn-57-3@b%UGH(wY)>)%%3h_45e3$gSV z5R>5rVZ+@BBRxkWFuGHKIBJ0+YmP360NgeI#86GXgP%7% z76NM+Q`_HwU8&MPIjl~h)ZW0F1D_}35@>r{NaQVHBXGxWghVO}i;$2OrpSuN3-1Qr$)`%9*8h zH)5xePkP%J#!GziM^z+)9nkj0)xC}Ajb&FsLj!HXY5$Kw{u2PGKwe)-ZU^LPVr`Ir z$|E2*H;B1h5G76wC0RBD#lRvp0?HPwW0sX@JPQO3zz{fxSfn&ASoC7f{gg+)8wBm7 z-=kGYY+9tldjrEg((8%Sgo+~Ua5_F4KR9Y+&%X7z8rjotJ+4OfWZOT^Fi}p2h(z0% zys4nPfmvGcM@*l?6Sz&gWJ##^@f9-bGwT_o(@w#8+P2L8e;!AZhXYvf3B6**_27FTWFc!Ua{PhA|M_C6%YJnapzEb-e_7{6STGrd2 z1$EYLl)I5?ME>5~DYI&PoG2**^;J%~?hzlPq7yC_oNeN;dC1W~o58PY+QDNo(3j5x zJEhA}6padM>2d)Z+=I1Fr^`el0usUGg_%mxaMmEGVd4r)xpS zEao)5?u^vyj$f}kgBsE=VMAS6(ZJ;v2osT7n=Ld{8w+`27dZVg$7XsHJ58gfVWX!l z^OE~t<-*uKh^Yop`4?q>;dXW2kw-$xBys>_mC^JOoQ^moDWn^cQ#%t!}zHy|p!bV9M?V#;M@KWQMWI`>hgMS)0kGIu z1(X*ItIAvNXqxwaZ%iT%XC0JY9WlRwyQf@fC~&jEH9;iJXja|gkDw6bPwqNLz{L#K z1}R)_g!8V70>!cP7TbHFlq_%2hiRU|LD%x8rS8&37I^_hOL zd;_|mil~tBcE5V#${Gc3Bn%lcX5LJb@h_H`?rWc3V4o78YNoASy6U5E-i-hoeR?Q_ zbXL^M@sDD=bgI&`^fEn5FV?fPR9O6X$kw;v{Z>ic6Y=zOBn;9&;3o<<2SQ68CH)zKM2^(N({3k)JgXp{Eq&?y<4<=nX%UhJe%S{D|*&MDqPPc^Paqo7dd{(!ho`k1GO*cqv zQX-W%iP1&x4QO^`k#2Ktz1r}G%9I;L1CvCd}?S%fi5UdrCj?&j56 zZkOF2Gy=Q^=yJmJBae5X2yYIG^qG-NZ+peT<>@A0?^+{3boOha|KWDhHIr_*5SC7M zMejR_ZMc?n^$6wOVH-he5P4~`^JiH9Wq`{XrJ#OZM^H*8tNR^akzcdmT%Tb;dI zKQ)HB{@KBP$GH#`Tdz4QhsaGDtQKE+3oiey%R~5!uMFotlbGU54*!}WW{c$DC<8RR zeIQW4`(swu*af{!Jp8>rO>A#^LUu>9J}G-XxoHe*qBz{D64~k{&>T6yr!EmX zXx7JXcQHe+-1#qa@=x{2(LP6)8$V8ux)Xj=xjINJL_pVihc!KDt@EMeSJe~$a}HKL ziP$TNjY;(VteOx$HXsFo^4|s8zD3g?tD(NsN#(!Wc;;g(d8}*5bj4-85<2(}9cB;j z7?)HfWwZYrk(_p(Y1Mz+UgMAN4p}*PzQw?U<*o7)<@(l&y<$}*t?Zv>_8TF22*WT)yE{T{rfQhFIe?G zk!0iZ(ni<`H53@?OF1{lL94ywdlRu^;#Njmp&Y!F&o~CF+K+(e+dBn@*xk&*9P=>d znDO1=#H@GE*$BI~H&OqwbtwSO{mcptPt?DenDou^s#i98tr@o*g63t7DAvp6 zwX9l+s(0x7*8^Lx;XU~xN4D0->DW71ttEYIlhUy_6BpMtBzK<8hZqMa1*su(>l%~M zu*xl5sGL$-Rr?wK3TxqB?1HRW@5Z~l+}BELX^pgL*1P3Z2Lg92r9gmfwHD@nhCM4i zwM}=c-mwj0zoPk5I$pfOpMKfdZd~|3Fp2GfPfB<|_%tqlW*ugu?oVEMm0D+Pqgf+S zbwJCno$5In_bSG?Z^d8zf{LxG17adk^(JaNfJ|ElTeD=HwKxaNH_xnXOkM!Ht^nu5 z>kVe!f`nu$n7@w&C(9vYtSjT+gNFOq(2|B7(7Q_KQfxXI9D9o{e%W1jn2kXnTWL zM6dXudr?wC%Q5Iq_|)D4|8qgB!I#_(7RZp_O$v2Dsl+pRu|-lOLPYZCK#}$(4^~h_ zPi3lxHM}x4MHRx;FEVbqg2a}>@koP78z3U9M`#%)4|s5qdh z$NO)m(?69cXH8M?7Jh%NZ&xvuW!4qZUO<7dz+9=;6yb~?#y(zzf3pz&nfbf6k~}rL zKHH%U29p>HK#4}yibQpP@^63@q)|th>Hr}+vu~f&b+%o*q7u(0uO2FVpHMWtH&{Q# z8mbN+E_9g&;wx>`X40?`u@4WK=%+?luoQ8Z^vb7>eVnYfK+y$uhTV=3P{? zws$d=P6yf^XTVjbi|F*PuhX3lNT)~cI!um(_mDvLS4s>kwufSzq1<8Zm%ZCd=8a&Y z)dHE~;;~>eFpG^$w{WQP**F1)(e#8hLr{MBCoLpa+n14Cww z->%2SkEkI9eLiHnQ|cZdUSxn6P?m?R^0gpVWy~5Q#U#u5lfxtHRdPUK(HWUVbc|j^ z3-uy8N)ZHe*orhm*CFF5T#j|QPchYE<5`bC0^d(!7QXJ!dbe4v{&9l-Lk#Pks*ie3>lpUN#cT? zJgW0Hcu@R%Gwjmb>=ZcL5O9e2T!Z5R-QQx}-!pZ8Pm6!%F$3GYkc>rF!@$@P0hKs`2G&?;=wlQzOiFg?> zRtJqcb?D+kC0v0`h6_Axv=RQ_D-w7^5ZtwUagkVyQ}1Jn%h1b#uXd(E5T_;rnG zsjE*qARy9 z)dT{`>*lF}&9njfx0QiX>=?(@B97Wer>&Yb@T4qe00kwWO;;-Wx`y8TVNha`|7u4_J3FMmJ8hF+v8A4%Jl`Ee=#*aP z!x+ms)DLLRrlkSmwlVY43Taej2a#9G?X_8_Z1#O~z9 z@((wSRerZ;g;Z;58=~)!tXHUIpKo=s5ff;P`)G0E2JfPUiBqrcI?@@8r83*rs4r^- z)ogMU#8lC&#~<`kd^R?|EVt`{EwZ~8v6yxfz7TA+4^m6*gVbUXmU1jjI#ul_b74k1 z{=wZ`Rc#k4XE&)70^sPq1EfH-ZZ>a8uRl#SEqd5aV$)lhg|~yH7%#&&d?21XV}fU#oK1YlpN-(|3_M91^9xn2&9fj4S-nt-qHB z9({fEp2{!aq(&lZu=^6r*Fwh}?)%|1?K1{nWFQ`v3&c6Fq8RSRj|~cZtD7%qtrmL3 z=Cu4-?SYufV@X}5yb@cTX-6%>mEd~=CUEl0y`BRVQ2wGWpZi$9`19vvx10Al*>%|r z*g$0yw?!_VPUn@qkwusPa<5K)iG z_-AmGC{!nJ85cpD*1s3dG7bP{@J zi{sy)%QoYODwuals^v46Azc+ez+NMEArm-$Os-898S6wPW1WaRH8l>&t2r`S)JJ}r z8mSWkLDElBYBdvCwUEDhd)<9Y3wxa*OJ!x=_w|wXVa3ioqWFPQOasvls zgr}^Ai^<|5`*MN`IXoDvTvc0A2HtZ@Wt0qW>{}Tx?7F{v3+#|$vkH^gNBhN!P3C2_ z$qy0s*sPO@ySh;!H}yL?!!QX!g!&0kwbN;NQl|4tCB)x%D0R{d%Bk^`D}zPOUhA`P z{iL7LB+uzn!0n>9o%1v_E5rwu z!R~DyC&$>0Y?j#!XW(V0l3#X21SH~9ST^dSDiwX=PSAzrG`f`sN3k-*_$d#iE=_oq z^8r!xG0$Ne0{wyC9MX`C6GQPRmaGXr-a{eqi|QVCiDPqlv2}ToRgLpCj^%J^Q6Za0 zj_uH-@}~yv+)svxvQUj4a5W&fsH?%b-zl?yg46y`!~seZ%)Tq-EVle=L$AE%wz%&~ z$)}a9`sb5EZ+H0-E+SP(t43Kj6k%wUYmr681|E7Qm1|Yv@Qyud^j=q6;5WcJA>{6g z&#+IDxgLANCRABj`_zXF8a{aL(VGnCxx1$E-unfu(edRXOM32Z+pW=l2jK;u> zL)MA0nhzbf9(n}y-)1YWwG}EkldxV)Dt10{{XPAquLq?E4sQTg4$YSw<|r9#!K&dTl5gk7VE{SIhjg487CQ8C}cNP#i|dzFUt%S1gGEHhG-2b)PQ3q#^FcI5B|-d90W3L2m}2t8#W`X3$5`3eZ! zTnFzt@YV!(tY|aTa2C%@f>+;T7D=xlLA|{qEtABrPT%C19~5wo(iIizTR+F!P)D3b(symq4YtmbK%&$aL(s_(&^pmWlB6@SWrXYxac`VL< zYaLYU-gxU~AL@T4*en*ON9`1xcowd{5Nq_AMMYyi5Q2qZ#-%9#OE#mN>3PiQfn96G zHhA`s{WN@R1t&5}U9s#9c4*?HI2ic((fDWKz|^1dLE}K$xD>1Q{7Xcy|+UN#+P-7_pi(aF!TV?N}x>~ znetg2!iFHI_bUn{hf-lk$W6q^!bD4m5i#Pmbxcl4WUF?XwH)we)-JZ+#SqiUnRQU~ zL&@x{g;Z3cS4Dkz`mhTX>ENXJQ=ycPJV9L8y&=Htw-^oRd3QkiEyF(`Ey7RT2-}(d zER;NLzZA$D!BtFJ!&%&)y+6iYs6gCVBfBYPmX2bN-+%+vVOx)?VCUX;0QqVJ`-&R}D`wo@yUp=gwcPa+WNc!7bU$pTMKgls z`|x93TRddH?E1n+Y$3m#qMI8ZkRR+l{T<)N68TgXLR7z~KD+%^&zKj)A@2xBkQ>;NBNfS~hOjs{ZHy#u8cB?LD`0I) zj>CHkgXu5lTD$+0xqBk8g`JWlX{==*nY^6zBoqc!TDd(Z(Dp<5J}aoWQ2vw_?Mo7cvN;_4Mv4pg!AVg?0BLmve;F*O+~ zES=Pux72_bVlN{rrcR3Gmq{oa-Hc@u8%!;U4{VY9;8Y^5{Efut7xW}hykB6u546ev z)*ER1jx>8V_h)#_Ci!m>R>~W-kU~DVwGxN}Vz!<>lZ=V8`K|=`=q4 z$`892kH1Rsbfq@~Gc9?L43<8B32c2yC)wIN-W?{YZ32!j0O6QRZt%rUM~uQ5&nfCI zD`s!{5*a5YCKsUL{G2XZuO`=11>4 zBMo9FA`8G()>lN2!X;m&0nqiJ?2=vvYNYwPCE6*=8P;^9~_%Rh`zpNb+lg1kSQ$6CjSIJ2|*ho$XKM zwj&i^geD>a1Hf3oIpGgjFNPke4uQS+YGWt=kpQtyK~XVN*JMG_bvP;gdNn=%F*;Y2 zTngn-{S9orOAJbGESO&Yw?I2K$l?yAAa##sNO|_DJy*!OlJ%p(YfW(mpqbf$N}Sia zxmbKc#7^cV*UZEBjK>_jtAbV>Y?FbxIgGADY>kYSFP6V+?;V_7t+Mb-wF#iMj>R9_ z80DlmTF95oL7J`9U~43mA2U7EIk7zo&mtyZ=1^rtx{4-HhHQUjsNVmY^huxovY|k& zDz<#ryOgRx!qn zT!vlkONn3Bv7_lYhiq0Yis7vz%Xe=Yt|dH%faMf`T)x}%RDjn($rp%_XZUHEvTAuf ztM`>s6i$e43B{dV{@$ju>XlN1Iu%2V=$bacg^m^%ngOht;83-{>&fD zx|7JJCjs^|%*8?x7S_tqP=wQ=aPq$xRIt`b;vB*bM@FEgj?AvuMY8hG_UAsQoYh7) zz@#MK{YW~CGhCTqoS4)m|8PWgU&nwf6^8j3_iJPne;(9ww|~(mCqL3BCqJ+%#S^jI zdFPMJwO+)gXfR&q?1}Vs##JWSY<*>*&=ut`C(~kOFLy!|@ysHB?gy>--Wb;@3V9TV zS~V+SdFiH{M5#JY)J*16{lMxvopa!ud%3?^2rf+B27mI{hpMltr!DmK*k4so6@5mS zal*P7p-3+w{V6b2lhZ_W>04Z}NKYO1!RygTJOnB>GUp^-wJ2T6j<-N~XnokU{wjx@ zn-kRGs8H}CwIddp>({6YwGmtW=5{xx%07?IX!Lo6X(~Bw^wDRW+Vm`6j)hdCa-@M- z`#si8dZd@mOZAAA=@Bc@BQ}=Gu}fksxMxg>_@`wxA|#FIV$ZnT*U-MM)Ox0UVX5`p zmvxgiMinXQkp)~&(XU`kEf;r{e`=nglQl%q^mk8H!FEZaJl!`$=i4x_wU?Z)_Ec0q z{p^D;+OriB4Up~Y$IJ`BO*Dlf*q8Z|@2kBO;}8=&FR%FF5(D9hAAbhU&hNTiXZ-@s zqX^Yi3@E(j=s0&?aL~j#xFw`biuvFpT};~^C?9flxe(E3L%G!j43aN{(nx>E^=muV zm+VieyFYJb`ZG$L`(-+Gon7YN@6cGMLxpsRLpAA8bEZdUd_j+PCVI!t?vY{wrBDC; zp@xJlZ?gx(XAZ&Nga=cNM=OI}UjXHkIZ9Gc9!jI|)1?o(MBPfG>>5|q8jucsR`dA- zX9mWmFgG*%Sr~7h;0m^GBDMpn$cokX>{^VAsYG zWp9+d-#$GZ_&EokNHJ1nZy_QP^2jqn4ovlvzeFuHw`=5Y%J!5U3H=+D#mYe2&tM3Za%Jyjsm>Onf^28@o{@emN9K@fn@l;IBg}-(SDIK^#m-U1 zvY$xQ`1_W;9UMAY_)ziYg0T@sCbEGM{X~1K>ERY&Zah=DRJP9o?O@*n@VP|TLM6LJY|rD;B6dk^ zFo&|c(ysO-`vS2mhdG_b(s&R^%NFx=tri#cXHC1zu5DX{kxbj&-8PTig7e}Ycv-sV zx`$mNI2oQ#8(6y8^qxV3k`DHDFcB@TyDXXQmj|nk8IjuukPPYkOINnA|wYL#f zw%43vpW2tnsr_iVB6$^}mY6T=ieyPk8?>atKyaXIQwg;bG=-&->;bhCJ(qSu&`Ze_ zNv;MT(JR6cN6^3*N5*7L7t*`ioH#J-1nb#iq7`_;dj0ct0o6$uI)Kmt<$oZ=DH>{k zwiclKaEkIUuNBW9O5eO!?O5BB_Pt72XfWW8pYX*lP$CF_Gm0f2iK2)WTUc^Fk1d~v zI2J2euo8HG5iQ3PDBp-NA4Y&4iHP>N^-v^6dbf9Pptw^;#Ub~5YXil*<0rha;D=6C zRFd%EIFwf8NzyAZTy>Y_a@I(BwGbxp=?^;;7@jAY&a-^%Ed5F`#xJIn&q$L|W8<7P zPsNHoA}`hAq*NL{gyAC9@I2nL?GHKY%dQUih`c9TXMq(g(;vP|cSJkKTjba}N&;!x zr~$L~Q`zZPo+maKkH1{Fq6^B21p+%{^cfB=&Qpa8v5+YH)yD-SIt4!=W(andn`HD} zRSBZU+=?0Q`dCW5b8C}p@jIZRMa`Jy-g6Hf$l(dS51wRa$ZDZF#k#>_(NEWduQJ{` zKg+3|pS4uwXOAZjjIo`)cM*-tk(-@e?6;N6m_^>BQ_(}_^kq^52hrzdd}^SY5YUW3 zD}7SV31AU=)Ow<4%BZN4S?B}gt4qm!QgRD36(+J70rs`l)C&0et6dH)mSxyatOV4? zJjO;yjuKL~7W@K%A4`U_IeZ}$WrsRjUm5Kz3wEo930;JVoL$UVr#neeZH&jOI&>) z%3euiM5^bf>0T7OdqKCK@(p?W?{qxq&cY%ueDjd~y59`1-KT0VYU|}${fU*(m@i;6 zGksBJyGmIoYcmBr_4)h&=jgyyA9JE!qad&UiCU=j6S@E9hnp0c#^-9hcXL z^7*EMXUDE1k;!BG6TLba#Q2gsg><6%B;;yrwpDyBE;uWQTAbja& z*oUvs7sQaG3Umd)>MYj$5{=DW%AhG)vn6XHWu3LlhyWxuA5M9mzgym-$m?T@a%Z-090FZ!Gk9C)bu z#RPecZ-w0PcfX=>c*_w}zG&g+^=rcLtMVr*o$1OKuUX7&fyvz zLl2H^*vYpJ(_-IW!6kK3_y8DoHMSI8N_Mi)@&Bp&8S2|lM@=;|qXk|{dHoC}_G=vi ztb%$y&?ROU=HwXWc-o7mYQ;E$4#J>4#>R&=al;6=mk3ZTz$;dw7w1+9ZENz zYwMXek9D*mP2b7Cz%+!lwj!9f3rn-$&b>st^QDx z3hq3V9jDYs9y939&X4($-G;pi?#d5jvlGQ zJcEF;K8gA9aSoyiIHnL^ed;cP5LXe%{d;-U;_uq}?YIxxukbYAY2RHq?)CO+Pi~j? zplUn6PSQV4-*2h!u2SPQrc17RqDLSzVtCau@NJVlJU1_;oJ)z^uq3y&q%m10F>;|!Wy!e1;D2>)XG5gjdqyOADqrGH6>I-%vi9i( z#90L!YWv?-5X(W0_3z(I$?%F+Zf5GMhxl=}+?yHI1_o>eXNtAa97ZB~p91ewGSIAr za{bUOG}iDyq}QsSzJg{Hm=Tuih*ucV@P+ox#G}SXl#QY|M=j>DAM3LyJysUq?m1ctC6!x23E{ZhhuI&u7dgT@=uG7_#Q&Jz$l=N`XxE_j^#v(k`}!i(i`N%%4f*?E3mu@a~u_=h-)&$4}5$HxVHfKGAx{ra9m0JUDo$@g^6c?J*9>wRMBJwN9?E zP31Kw_|2*2)M&fS*4V<1Qh`HhMnVJw%Xh`Va-QTgUEy1ub!E`%Dk>D)2B!;GMTl+Nv7rnNnH4Z^H+2Z(de;l+QsE!XopONE9zi zirOVleoMr&TCWUzv0c#ZU0#me=^0R zt)&{1nq#*;Rju2dx=h;Kn@qPkRUFXmO`Rdhc6d^!WDv&=c{kD23NMk)hWTD`f zvVRTi2u*Fi1fAe@r#6>Eve%6W?3gz-N1_VXio64?3}r9>ahPTqDuk&tgW8nCHfpzY_x zp%0gYtlF8^k5UfkWh&Qb8g=lSBx)qpBa#ZvRdmfy<^5x!(C<)OZ(?6+0i+RLf=_}l zYP;mpua9oNn2tO`%Sd#uw1m!J9vvIbyTLmhu<1%e^a%~0W10pd#W+XGdq*(^SuP0? zrID1rm8uf3(C=3VHw{8LFxf$wIxKIE0r)&Tzdl*n?vy`IY6@+{W>U}6#XC-@Vy zxhk9$Ty3Ji$XlP%?-tWC1iKAZq!eco^Wu-UF+_%Wg;J%!0|skHfz*S#rNS0bavGUg zgoY~d0&VRQyOdn4Kw(j^V*jO5Nda-?lkE;+J)3r={BEnUQ}SUo9`vzw9vMT(6+uN+psGWQOM(Jb(9IDPL1d%>nUk;z`@8Fi zRK8~j5I}U`f%75($ZQ87Rkm))K=84uYF;a!?GMbE?Js{ZFz3Z_&*ttH zA&;Q|Z8t*0>Je^@aKTChC0Vd~*Zyw9N|Xw+U?o7~JXu`yT!YSQ2RO^+B9HKc@dxN) zk{ZMwrsEn#^_BPaCn*IHIX>oNp*7(eGKknGsP$xJ>v5{4M9NPHA{*Odh-8udw18vM z3L~OQl;r4UZ>A7chV3oTtGX-R0_6#v6lf~fs4gg)CJif3aV1|G9jSOaH#W3v4?lss zIu8n^6P23sw*dMi>-oUU=i&#wEyJyx^1N6OmIXph#M-~akAGs0zdh&Dyx3Rc$3HdC zxqXV~(rU0Xe*81D@b)P=msaP*hN9_d25z5{dues9nLm0Dm(-!xy9bYGBg<182gUcK zQ-jM>N{AMi(-Th*S~ode^k0)EiOn*L)7@B@s)rwSq|Q`9&56QL<9!bgjV{zWltnfHCY`Gy-I9_^04N!y3_d%G+rr3N0RU-!e0o-2p;Os zOa>lge`M9@{bR-F?H_xmkG;Qk_K7YN4co$^-~KR^y+2f2)&5NHfO|J-Co{xP8+{^L z@*|vy5P_eB2Nlu4fJKNRccLl!h8j3tApBaudA(NlXx7Rei?y=Hd~Pb6hFp=EC|D`0 zNk?lFQN9(G%%OMn90G0S#un<*o+*`9$j<+CPbRIJqOK|KCiH&-H(9CLy(%);#n%2E7 z!H03RkIUebd5k0N7ln606bPuE`X!7b)rpGO<<#XZuk~-N1h{zEUgJGlEyn>^JjYwn zNEm9(@ZDY!T(s3Yn57A#r28~Kn_?&yPrFqp&1#e|e;R3|KIxvq3*E;csV|=-t_Bu=_bt^*It)S@&zbksrla#3r0~|+0_D!0etC6;XLjsN5e0t{hY|-@_4INyoUuJIBuWZc$=_3sc#&y;m#*^xUN>Y@gN)|mW9;=t5K z91CX39RfYR^|Q?k)P~pG`R}pw>-NeuO_@H>ez`y?^A7LBD0O3+&tD`u^AB*8?`&pf zVnzolX%32KSTaRY#50pRfwjEaNGW*}*hVA{oH|qrA6`Fv32#w@2r@*czcwl-*Njlq zKxH0gN&`iFLwTd`N?pp*HFeRZqV|wTaeQo927eYm5x#Ly{KWaO5jAB;_|Tjfk0|1n zw&3 z`LHmiN6ZVpzzw7Lju_>q4%@rqY;VGKSq<<9AM8(}Eg}ggn8Lmu_@Wxm{DK-2o4hc& zpo$*C{_Q`%Py3ZLOV`TTH7Bxp_61is!PLOXAOr1LVOd(ci& zNv`fel3t$Dqh6unpGqs3=%bXfW%T~On4n>*gvGBXe+5m-npxs;tu%v~?0dap5GN#bgj4=7}0#_Y~Eu?kS3;VTV3AI#b|>RfX3*Ai7^e8qzN} zq<=$ksqb@3b(VmR^Xvc7aJ%QW^e@wNyWwmjsYjnLoC4P&T4t5FyVvd22P(=TgPA8@ zg=AC(4>bNT1;Yy6dTE~c^q|XA{E3LKyHb}@sd{bGD>Q@HuQkSR3Jn$QM)A~}XWitp z=4u~oFPUFC(wS=xni1cVTM4drdy(!9W1Y+GiNEKG{V`j6S?lW^DsZj8$V1z!lIUAj z9iyt7y@^>Lw|hnH-AJyHedx`hq3yH1)+>qn!&qLb`boJ~ZcYv(-*r_ko|dV6F#8@V z{|l8{;!PO?>QFj%n01(|rvf{sVq67<^k9BZIYxWao0(;NM2}v^Mb%EezMl2<<8J3` zuKM~`*4I}vU*+=IV}9CNf6U4OOzs*Uwo}Q->ObVbcz$U>Gim6$Nr6XiGiQKiMO&8f zlc<$z|GKO^RQ+xYKQ3caz8`0FM-Rk17<4{%bytRDtRxwakWTeDj?A+O7ZI)`7|8jI zT=nNMa-5p=Z!OESx}**%rU$5AFOIDD84GIiw5G;vz zcyoUTyBmzZ?}KkHT}fjt zr-bcQhw+jdiQY+{lRFss_)`UnrPLhh^rvlP?Mb_0FSKJ_C?H3LxPG_tSfXm=yksIb zC|f;AyrOf)ADd|b6?EkCXVeVosZ0c{Jj=-K4D6WWP2|g`3U70H&y6`&Cv&ekG2JWW z#C~n%ONyEqLwd?O;+>vEU@^|j1Pp?qefC3a*F=X)84%0L2L%0zlkt_EnC(w23SDw4 zTboAJ7&C8C`&17)PTY7OZ_OJT8xo)BdrZ(SF#UD3+}SI$NO7<7;P@p*?4%^l*rf}l zR?bv$G;Y+ydvbFR2w`~3YM^W|;_|%s@uBOk2t0bLF-y(6!!td>#fwxsxt=32TV^0N z=ExK*dQ45hp2f}-tkz#;ob6di9$xHuc(wTSdXNHNCj5%<4x#T{1Rol#k1>cG_j~Ip zv~eQodLINnU0-O;@>?faCt-_@S<|dw?(fHuEEL~ZK;Ohbed=2WQeWrz5~|E)R-ROu zM9TB)r>2ndi_-we-r{+*LaLi(1SjmP(qkQm`RvNXeQi9_$J}Ig!>2&6FLa{34b7b zM*bvWA7LlqCxpR-m4x|(X@s*0e_h<}fAzQ+4yJRjiM$MeT_ z9cS@8pKuo6mi~-?Q!fwJZ2zL{{NjL-?n)yAz z?{2~`2(x*=kKa29w-HtlCJ}czzvuFMDZe2?9^p_E<3xCp@Nb0g5?Tq(gqeg%gc0N^ z<~K;6Cfq@|o3Nd*lkk*0-wQ8F zXC(-0@-Xi(aE1hl+sV7cOOW>``n*5IyRaD&a=lCZy{>mD_kP};^5y%3u6K#w$-7gweD83*%lEy!JN=jMuejdj`#Zc# zyb}()-sQXTqwM;Fu6Ow!=G|R?sq0<7SMctxKjM0q@7M6|)Gfa&UGMUJ1Mlwg?{K}# z_j_IMlK(;1yL^9wcX$1JUGMV!O;>u!pLD&;_m5ra<-76Y-ty$TpLcir3S95=-f-?zs5L};l3|8p(!@HhWJnP51al)`0 z2eRU3sB~{;$EkGhWW_~Px_7hVRJvqV+&q=;PF}7r-)7d& zyNI*<${J{F#Z~3`*REZwzL(}0^LaSGWo^sSqS6Z`?i%9m?u}DzkodlTxGqt+zTf_J z-Y*-e*J9_Ln*>xk=l!uS`2J5JBltK$>T=Q_aOH11#R&d@;I!o`d;WX~96dxjA<6q8 z!ePQSUtwDg46%@0+T6T+@wH2qexqsCvh$a&DZBW*b<046}N)8 z`-w}s;%+An#W3SuSKPl5cQ0{1SNrx7=c9d(xYGTZIMl_Qre*#9@BT-_<$w1-|GWSB ze|`V+aBgIM{i@|lS1)T?JY$vF)Uv9&W%c!SX3O$bEM;GZxJ|8&ty*d>U%hJay!C6E zAOz%?7j0=;vaHTrVm2+F-eelD=0w)ltz5peX>sMU6|uGEj8)5cS!=vV{;HOi#dS^Q zoNHG!Ej5i%#7tSedgWrNX69-txo^aV|tEyN( zA10+#zPNI2-CC+!Y#PQ$;;LGgF215kn!LKjFy6@YO85L*q?mF2n$<1lV*R5lGj`ae z&tBbf{gRawM=?!n1Z0MBOK&UdnpQT?0K&#jJN=xcOJgl9O)TS&JMB@xcUrWxH}CYO zRZT6+mjdfb(`+$5loD=SvT||Vk{g@!U>N@*Wh`H73b55!7#9d+-9uHsYH75IHEfxT z*%-UOb7QN_<<~daeZH-?PRfzW99-DpZlfBxH#6|5U$us{(J-#<%{_hU;`&wdS|oaP zZ*0wywNYaJYy|mWG=rhwmP=f*l)vyif6B0)nuG(w{TX|^{ZR#LD}VQ zMg6L^%dcD2v`ku~S~NI=n~N1n2!4VYwCp2k>-x2Vtu`iBQBw8F)k{o}VA|@~wJX8x zUpS>#uI*R$FDL<6E!Oa;Ub*DDwZ5J8xR-UB{VKywQTjewf3klCAC8Z==#*U@dhVH4t%6w2SNqCV^_U=<;oeW znpYdgWZY<#V9WArW2S>k<1#%2>KY}DU%6_Me*fI{F7-4nU)D4=x`f&Hl9Z}xhmC?0 z?Y3Xl)UtZo@*9`0WrpbvylJOxY*}tL)vsz3i`kSy8t29dwQ|)mXvw8lxrT53TSxeS_!`Rr{{<+JSMyIa6e$A2=FzjT?QB+hBrqT?Y zHJ$pU!oTVzE7v**IE#8TuIm&}+wEYcNxy)?s@2F%q#S5Gv$8IBt*NN}lXl9vO>527 zR9$F8Z_bTPEzK)euhRfLH`4+Q=If0Uq_b%;Q35Bp=-%E`w=^{w|6!M%A(yk3m=GxT z7a=K6tuc#R^sLg;cojJW2rHXfnYB~xN5iO=_$6!B3hAf1$m->?l(EzAZ3QcWJ@JjN z_8%*IfUfCnA@pln(@NtZyN%UNG|i~%{qA0pD43zA-9M*3nSL}*&B7~P=^+j+jZI6w zF}JCilsEK#k==uF9X)o8xS=L|P`R zgG@T(NH1KbvXYxk?A2n#*{d6{vX?gFQW*)siMcHJcq#oq?Y#|nRK?jheo$0g(Z>2w zRBVq5CTJ4&mbU-jeb3A}XG1{S>wT{4|6b1})jGW-gnpR!ZLxr8^AQf;<&P-PZ6a^Bm;OA${(ap%Y--?lT;+-uM zOzF<|foiT)V+Bbe?yhM%dNZT1YXM{+rWB){xJxEIf%+gOofmF}Y?r1&wDu2_bK|)H zW&-Uwayzd`?IzWS>Riu&_IU>y7?h?}5MJ>5Y2>xwCwwK)RQ2|z2U3}?p29#XFVuo# zQC8A+#)-+)8ssfvxv6TBFg5LE^ptQ>iso90>^U@pOuy*5cCt!inOY=1%TRCb?Nh8v zn;>&RdIRJ{u7fVBg306+_P4{*E(J}w$Au9{}z!P%ixn>%bH+N+7uDQ^11Q*GzsGP&E#^Q~XfNiOP zrnbb1&&>4nYNb@ho)8AS7Nc3C)y&a*kOS~Z)nxNMo#_GXpQyprAL3`30w}|uDIcvJ z$<#$2+%-4sIMsUS835((4umUP(K&7UG1D{oe7Zd|IoCg1o7FUBCahunX3=rYop}&S zmanvvj>BVpI$w};e(Q0UW_t^L=}tj-w3){>b!IX>+BZiC{v~Uj4MW&5G+$21JC3c- zrCaN>3wqPN167)qr*>p5*J#z9xqPNJ-Q5bQZwHkWGt2VnI(JFbyiXHMPmTLql)tez z*8;xRi%~%jK#7)gClk_dkDwpfuGUAbBD)yfb;r%>?%+mSZKeXWV%ejbMt;QCCsLc$ zr2cht)6{JGxaLf6SGF7cn0muK={mM9FC)3$sbJM0CynSNifI)iKiQY*9cY9kM)G8L zOQt#pWe$Rm=kVI=TD4PLsbcI%gzj!bs~LKrp#SuwU2-fD*DR~FO~e9fAp<~Csms@7 z7WB2ZXL?mnE}1fO#*})60n@auOjlQKQAVqwr+Ak_w|hxQE( z)h+02gAY(^YatZVV0A~Eg6KYEfGc>?Vaa?MBMe-O|;gU4Whl>H6fu za_434F&Z&^P3zXO`8*WqjCPg=Ljw0HqG6=j0w%Rfi#pG#j8>(k@|liQ8>3r_mL5h; zdBudKy3?>?EKX&*7iD{M-Ne7JqoXJX6x4ngt_!RxX$cLob~^wGmL%U04A_h@j^LST zfoi8-i9(-%WgPGV!lEMWV~Fts%_RWP+SdcgJk{2kgE*(1t)(b|a|uYMd$JW>d9tKe zpq7eWVTh>c^i}vO#N-Ug(UD2_xL<2S-UB(ZId_I3?^|-+P+JN|$$?&j0k|^^Z3B8+ zN74JKjN@Rb|L^aA2?Ty{)}u8u-k9`bxR=;JMcx3nr-YnErYeB1eI+aTBagVfc=tKHs`A>utHPW!gUVyN{N>#`4T^+1vCgE zf(mr@Ux`MAVxf3v*#x~U4MB)}i6md+M_ZD`2?=2z(wS}R-v04$_LXHDCeZuT`23{t zC;-Bi>!o+FsDenso~NT!reDwX74%%2-ka`jrwZk}be^nrM2LpZrggz`tczR#(E^go zshUof*>qpI-kmGx<177MZ(ak_=s+Vq88p(WvTy}hpe-GGo~+R_o%$^M(3;ES2{8G- z9moSSebf@qkBZ zsk(;AWN@5XS3iZ)+B*AST_rBY)6L0Ua!yqq_dAu=C+zzZBhuSCJ=B|4aN9EOMbX<_8`=^Q5OPwL_+XRPs0~0C>40w0tyO5%;IC6* zx6rkW){B2R1V|`cp{B)KNK(>E$LC8E1eZ*AA2d%*gV@mpF#+-!o~5Y_!U8k~+$ID= z0p$TMu;m(aM{W$w76tH}L;wJ}F0nZAKAY)m#cTjocupXqLZd>Pot@d9e3sMF3$lo_ zDlPLkk%gcfs8&qHp` z7Bn}y3pix2IAv%Nt1Vj5B1j4rYLhT154XX@>l0whLE6~x0X zV4bG=pKEJl$$3GxknhO0Vdg*s@l3|FHuiN4sjISjD%C^z(%p(K5|iuAu)6_oB(Zca zZkyNqCuIarlR}){ooR%v@Zrsk(2{TC8zZi8D)uaK#b|j=;K?< z^-O;c{Joi0-Ajv&_Xo+DOBHgd9D9RJuF%Gl@p+6F%$C@ETecuxqHRa1=@ra^kXA1x zc2a6{<_{7Wj$RLO8+TobWgW&6i=~hw_6;Q0)wA(ZUT}bTq%jR&PRcw-fkVLmANJp# zrtZvQNlhK%Now`P0$Bwo0uV(qPa&7nVR9J2a#9*+Z=Pp|*o|IBcmeT&hY^95*c**2;XIwk6pC_?zHXf5@ynA#2< z50Akf5k~j_%kkKN&FOhaF1Fm|h`7v`+8_fg?9MI5s_m4@CS+Q{l)$$7Akeg;Fvtok zr>r0^2H{ySz=@D}ghYs`Yb|t`I#^O1GCut`o@LfHSXf(!Qn3ZO_CC_?m3mt`z7-;$ zMmB%oOlK##7r6}0TYHO+cjNO^IewwKv94+>u|nw@4@=pMS@reEs_7S!EUy?akYN)d_fG=PB!Au1HgG?fwdP#`g$scXo9vqgQKoj@9QS*g>47jSujB!Ul>>VkW- zP60^>NJz9-s?-1`lsLP$1P7KvJ|GvUDpf*=?&?N@7EBs=P5U0Qd1xY{Vn`Z71|VRN zl-&&io9Tu;>og3=OG3?hJM0o-p1l}1w*`eP!~6t>0)l|9aEu4*ROHZ3wr&vpBO?bB zb<&IlHmK14}Z!S8+Xu`cCrIbxnis%TPLe`nb9vU)|46W8_h3a+iM&fZ=?V_^fUxk;dLTKbB zldD!RQj%!EV+xBiSgOoK7UvWuL#`6ibQ;J4a|r|k64EIbbzQ0z!}NhwM7w=gADyw& z;$kg;SE5O)jc|>08l_ab${lfRvKVFzu1U$XMfu@i^Pl&Nbsg0)z#Vk!L(71!aY%R) z+9lDBCF|ib z6Fv#m@B^r=%XUD%D^?~`fQK}BP+!Q{h2BenWf9148ln}FK{#lk@&dpp6#&GFl7c_m zXj%48!2v}cB{Iyh)LhEYR6ImTP{bCYf0Ruq*9C`EPeh4f+#|6cBZ5pObE@5)IV9r+ zU`}Edn1=*6VR$J4zEoF`mxbkaGH?ol0sFt$W>{n=sjRM{9V5e}H7tfPZ20tP)u?i~ zchjmHhfS{|^QjBBY~5EGr?EzRVd7x>n=}M6*8>tdt53+eBu!$3!df>puUu9Wg~f~U zF%25q%i5372jDn`4F&xtTOaT?*8;FI|B;m)ZJLjkU(zn2I}$Rx>K9dG&ZM9tmyXcW z;Kn4sg~R4SxQfXv@D(;oCSpg|;cR}KR)oHxZg~Jmiu2A=e zfg13P_fbP;?0~Ba4G_;GGX%B8<_H-PCQ>#G*s zrRMpaipaiERE^1gFB4Q*H9q^jOi=IDSnc;R0q=VX1aSP(I~BoWSGwOxR}s7?>j%G3 zHZx^BLllzBhC;BIB5##gVRb?&Yk<6zDSRfU)#%k8T;X;K`O}>~=iE8?xM6l2So&9`x zxnk!lX^|@-WlM0suJl4uIN-&Eyd}st=7u#lI@ zq^(M0P_mEUv=|fDpY1l;?nl#uG+TS9RAvJghaEC|$c`PCMf~iUJ&N8-bn4)&=2<79kpk})` z(oEQ&%Jsz^I5Gm8VT+K~AriAuOKE^4Sq(D=yB?MkO)uKxr&3bHGgNPTON*4ZXy$+y z7$w6*b_ViJZ-xvx`5bTzoh9==ujL-NF0(l4B??H`7IN6cuT)XsqS7QWZp?|G1y{AQ z!V4jn%$(dDpslnaSo+Z>loskM&zGpvHpn4e={9)OT(e$e9wEqM47&KQsgJgiup3-Z z9adi)a>SXX`Bk^YAhK!kX z@hrAFliCM*An?Ei6MD~Jr@42fm#MiJYVTu6z?fNwjXksoBwZ@TBtap>x*+uoR0Vni z4T1$|90G*dunY2hYlaSgkP(rx!K;y{Ok&Pspf}}2N~G@vtpU6PU4&DjRiWhMu_FTK zIb?qn>dGw8m9RKy!;jn2jSbVZZHdiFN^&K$Fyu2#hFzB&8yC0NA>4anv5Cx%7gJ&j z`cmfVkGl?R1;c5!3h8rW?(l(?x#naT{B=4FOrAyCH~ud~U(KF^wD3p~E#Ps(a-x?J zW+*M0je0_SWLzfX=2ayp11Q;*%NO9VQ@8}eQNUJxp|_NSOzG8Ar`8Flo~)JJZEO~i zRRYD;>VmP#+VR@{@FxDEK#g!+Ee2amM{k8iB~%aU3qK)MDW5a%RQ=2B^Xdo*ge4*O>mV% z6N)#9AJUU8(@94`zr}tgO*646skwK6mMH1DVuLNOT-g(@9IvV=r}Bx=knNVGpQJd= zQ`5)RV(Jk?3ssb&Y1(oK9)x9&H@(c=_@uR-lZUBI54YpOA2nowKQ3+5m4}*ObyAqI zid@}pTpW^*B?4EsXgNw}J;vIAKN>UOzodcGZ~ zpa?+vOh)f06ngUJ#EG<9u#%KofV4H&lCR9>CT6-Pc0yW&|G$suZ)HcJtMdXi0<1xH z6VsZIdm}q=5S^!;y>rAVgj}hL2!adkP;9&;F-KV&o#n(hho}%Zc;nR3)`zN_V4No; zmjXZSms0rcnqyl@0C%HP<1D)>^>zVy%;h=*IG|BvdQzmwgIi#89`782Ow-F7bil^p z@5+$zpCL|2N_(=1g@H~{RQ4M`bXu6XC-A4EY8v#S-ACI1A< zV&B5hYKq&C`NS;`Qf4Iagd{^&Hq?B(wg%av0;(6rNp6GZlLaqnvUJh8VunYwA6!@n z2b!xfq)W|=eRXO?O8=4q`B616H3nyM+i)Ymtg;nSz?7P`&0(NeB>O1}E$BejBqS5< zW80!u*3eCCfc2Gb6C2jxi2~)!(>v8`)F~`#ZV_i9w>#0cy-C2k%BWX1Ov#RhT_b91 zrLaAtZRqllKd28&x=n#Xnp8emjAx`G`#T(Ngj*sDt%^RJAd%a=T!w4~CmI(g<5wxw z4d->6!l_p@KGjz>Z!RhgJxmlX1tVY|6NsNu+1>pV)w=r0ra`Wmjj*Hz4u|e`9|hHt za1dSx_Z$rEqnH#|PqFV7Tgz$tfuMx6xkwZeJDUci!VM+{f3?_^V0)1PBM>n5fkK5K zzKabeuFCP=hBY?gFXYsOHG^D5+RAul8w^!9-Q)>Jm|_ z;>KE`Q1GTdn=DFnR_-KcHrms@3vhg}Qm<FezHmuF*nQF7if6WK`l3dacHa zZl{T!(Rm8lJxw-G8Q+Ge9 z&T_r75{s1p3wJcmUeaC(9D`N7N>VU;aS_MCQ7^Xr(+NB32X1*|-%vwCH*i$$yp;<^ zt#Lk$hh5`zcaF1`8bDOqTc{4mJ(yWK7zia#&@zmg)oK=Eqzh4534jX%xM0;##0V4G z;g)jG)#2+PYvPz;zCbb`V3%FOF#-DxII}aEL8;m*lWpLVbt?hYU7uTqL4D+o0<9Bs;g);Y#sOwQ@Ft!ixQqIwJ>8TF zdq5Fq(KI(7kR%_re6sQIJ9TJLBkKdxE7U>#kaR$-1wj+s>w?b0@yXBjmL5&|TB$9Z z@ng|lOCiGJ1S8>R00-wXRg&h+9^TVT%DLl{jl!AYOL^hAg>Mv=j}(+HT>62#ODaek zhm{)r^o5*A!0$YV4Ch(ox4jiyP?jr7l;w-kWIaV`$`3KKxxOYFq=m$T~XuyeM z`8=(@VRBWyNUv|G#-r`Oz_}cnlz+0+S7sD5Q@r-3LR zkMjEnahLga(U}f404lHS%!_gm`yqZ(8tP&o3yo7?G0u6CO$6shusGA$h6^g8sHk2# zf$gGByo}>YH&wf7#4i&qy)=|T9MI6Y*@bb64* zI3KQTp*X}Tz*-VO#DyY3`3{uE9VJ}B{?pHYzV@-qtB&nQU!q=u!> zMq|I3XcJXB^cdNwo19Pitn4^BmQXL%VK<`k(mUCXct^dJ^$3TQs~kSSL3L0%S}SEl zgnhCN_++c@DwP-?VQeYnJo=H@$^cM)R0O`~iYVM7q`SGqp;Q5Au$f;|67Q~O&L?Nl^Qs^=V4v#86Lil*7=G6CoY zILML|!JndocDhWUAI2o^mn`E-RJ2slSbilV${&p;{!jXwm7A5Dc zAGLBnGrUyfgZ2^-3Ms!iJu4r%V;BNdnN#pO6fS~ptP%%xNu?_T#Ue8Vq}ihUFz3m6SR)@;E&QZ7GA1$?)oG1y)y4s5k6u5Bqac_9V-<_y+1y}!Rd2JT3%YrPETygNJl$ykA3)(uFZ80s7@ReQwI4IBi7 zt^qR$oqtltdDu6sIC`GWMXCdQ7kQDU<*R&W)%gV zwa&g)^3~CZ7egzhLGkV;G%NanU(pWaHa3vudT4Ilbz`h@d#&`HlKNxUEx<{e-a*Ph zj-5R4J+Unwpp&`vGF(BpFx{I2NjLGDY!qxJa97Bkb@m7l5z;j1M z)CEdczr)#L_MIdG5ogiIaS~_S)Fig}C#7miYkQ`ph+0eKvJNzDE%b~JzVl4;?iuJ2}_I}&` z4;r9Mp2KDI*%{q)D!?Tck-#cp4^`%t50m#W+o{mN2-k3Z7Va`83P~_&SR(AEG-VW5 z`NWM_a(^$T#j;P;- zbUWrA{ll^p`nr>c(qT)$(CMbN;q%ydfVz}j!+{mb$o^AX$`;bvDXwK|?c_^_ifj=K zc4?y^3l!Nr)Ev5P683OVuY>`1#S1-~JS)mLp==wprVyM>=qN{V*_5X6p8Bb5Aj&?Y z)<5-wEHldHg1PI?A%8V&Z&1Hm;gJ5fX&%Z<10ib?VmHP+gsKslU?vKRES8+uc^$9M zE>LDvVTTk{jt+RmJRWwAS38WCX&v^-fWZCxbQwe&<@mymR@@s^=rzITi231<@P^*9 z$IK?R^5}@->*cl@Po#0^5DA^JJ4=#js#Dn$)ZjrhneXp6>!G_Ze`{(0z(^9&FE4PfM3G4=)%&9l})z^k^n^flms8aw@Hp+J1i`mv}*~r zAG)T58%goS45B>+;}n)z8k>VC74{)$UgCW<$SK$f-MFkv8jUW9qcjB2B#mEKb=k#C zJyBpJ;JIKUIU?0B?vzk?2-JWbHLvQyz9Zr0RR~1jq`^60wyV;dsg$Sm78LI*|2MXP z^PXw~rn^qDJDhCf@L`F2-Ae}V8Zv!9vPr-Ut$B^~j~lpuO3urcR|8j(PhXWRzItjM)hVAoRyhs^0Z zMPwxVB`{WkNF8xd?qoU#TGiYzU7Ou7vj+7{ZfK|{B85kOo>DbKn|xXG6pquct?UYg zxw^WxYNoUvx*oOahWdt?Gp9_|YDC52$1Y5ArFcd5pdorS=OtT^N_Xkb{I0%X#x!jf z{m)OFmTGLCDbo0fBJ$G1Niv`nsm(qO@5v zn;K?nwRLz&?bKA;Z)RKAJF~&*5tW^7M{B3dsGUBgxr$+- z%5y|aaP8EF8Abh=R)ZU#{>!etR@##lfNEY537Vis!~tLmpT15fSvlo|H( z%qdN?>YFu28me#RG}pVPnGV$PuIX}BOskzeqeeyQ05O6deqk*Yh=ONfEk&Jp2Ie{l zi#Rrsi~S(d#6)=*&8VLGsu|OOUA#!@tMMcjidJ9Ud|BfZ71Ol(X)_z0w}{gc;8i4^ zRR<`&r~~K|rP=ver4wn~2~|g9)y%5toRyR78<`T&f3($IL!4GW{U_taE1VMR8>^eJ z2$@#1Jq?LSqD01%B_0O!Sj#wW~ur z+`QdzeItXK{*!faH|!47yKsa7fxZp_g@`j@1a$CA6%7H8*2u)r>4zIMD)k5;&>D+D zAmf-}P7nCGJ$}Ya%U>sr;lZi&%ukAcC=lu{b` zi5j4EiEI2!4N#h#Gk$i;(vwqOG(>3%l8xY$1W55C+b&+3S|hJQ&0dQ`mMY#8Q0>>+ zCwVCkCnacFQ+28cYYC5$2Cj37q6r!>|vB69^E?9c{jjFk5XjXG#iRF~vBvTSh&L|Xzq>_YaKn`Sut3vJsd zgJ*#*%432!%O8qUBTgdikQ!$TK1X2VUM!%mJxB+Uyt|T27&sxIOeo^!-G-~!)B*j4 z1bCqzk#*3qAC!@djcqWnnwE;~1N!+w2tOY?E|pbTTE$5jWNQp^^EMtb>GM|xqz*-cz=|27I>Dfg`5|A8xcx_|PcTX8<9jM`u`Xs*>RMt4 zwY-#s6*U-_=~gjS2=l}08lMFr?G}bOT}}X0c0Qj@bE6JwplUYms(7g$1mc8qmC(AN$&$9z6)VXN~ya zw?un${)TU5BR*-BsDINQeD|8(&k*sFH}DN?dS5ky`?Kj!BT9B4zGJF*zi;$0CA$&d z^Isy~|JI0-w-NW&X(c1k|AX(0C^?Au(p$v)`TH<7d?Q?Mmigbuw}la3gYnRK*S(8x zej`2!?TUh+LrU+t^- zUO3{KeBbkHe219w-zMHijz9c6=9@52gD;Bq&;@N9#h-KHyAj{ZcLR|IdAjQA!)Hm`$2S2HN3F1AsI`79KuJDQ8k3(GHFU89cSNK73FTI!e zOYu13^MQ|qpY&IYxc6eGKXVb+zUs8sfq3Jf6E9GC-N`R%asFSrbwtT>gjEP@5a>-a zaBeBqa3jK4;G~ng_-W!bXHG2s;pVA?!t<-26#3HZxWW+ig3peZ@9iP<(PM z5<{Vbmd;LG4_}0r@5$jalz1ubK~6{$ccrI}Zt_Ftk3^+dy!__p{q^fBbXvUoJ`fq-3zo!#IfrEJv~*91j_`46Kn%4vqb-pUz>yte){BdO=nM<|`pCg2w7C+eDRD0|-O>fmZz=X> zV6!o{?%O@#uB&mdJEGeob|9n1Zl{EF70IppdAVn~(&NE~@edrh6gr*3riXyk(}r!~ zIc!UXeI5hhQ%k+D#O8--fDS-Gc(I3|U`fAe{jjDW8WL)HB-9R@&BI&3&5p1@JDsH- z*+@hYdM!@fH#Df<#6RRHz_Zp zoIpNg*v+y2gxm?JG-ISWKFtSTJofTk1xGV2b(ZW_rju8PJ`KyBPSjC* z_F|AATZpd~p<|usp9gy@+B+Z_%0Am)E)W7Y1|!6MkPm$LZA8f^gfWs%?pi8n+>ZM| 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 Mcl%NF|C+!54;}oJ8UO$Q literal 0 HcmV?d00001 diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/cffi-1.12.3.dist-info/INSTALLER b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/cffi-1.12.3.dist-info/INSTALLER new file mode 100644 index 00000000..a1b589e3 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/cffi-1.12.3.dist-info/INSTALLER @@ -0,0 +1 @@ +pip diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/cffi-1.12.3.dist-info/LICENSE b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/cffi-1.12.3.dist-info/LICENSE new file mode 100644 index 00000000..29225eee --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/cffi-1.12.3.dist-info/LICENSE @@ -0,0 +1,26 @@ + +Except when otherwise stated (look for LICENSE files in directories or +information at the beginning of each file) all software and +documentation is licensed as follows: + + The MIT License + + Permission is hereby granted, free of charge, to any person + obtaining a copy of this software and associated documentation + files (the "Software"), to deal in the Software without + restriction, including without limitation the rights to use, + copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the + Software is furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. + diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/cffi-1.12.3.dist-info/METADATA b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/cffi-1.12.3.dist-info/METADATA new file mode 100644 index 00000000..b2284b32 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/cffi-1.12.3.dist-info/METADATA @@ -0,0 +1,36 @@ +Metadata-Version: 2.1 +Name: cffi +Version: 1.12.3 +Summary: Foreign Function Interface for Python calling C code. +Home-page: http://cffi.readthedocs.org +Author: Armin Rigo, Maciej Fijalkowski +Author-email: python-cffi@googlegroups.com +License: MIT +Platform: UNKNOWN +Classifier: Programming Language :: Python +Classifier: Programming Language :: Python :: 2 +Classifier: Programming Language :: Python :: 2.6 +Classifier: Programming Language :: Python :: 2.7 +Classifier: Programming Language :: Python :: 3 +Classifier: Programming Language :: Python :: 3.2 +Classifier: Programming Language :: Python :: 3.3 +Classifier: Programming Language :: Python :: 3.4 +Classifier: Programming Language :: Python :: 3.5 +Classifier: Programming Language :: Python :: 3.6 +Classifier: Programming Language :: Python :: Implementation :: CPython +Classifier: Programming Language :: Python :: Implementation :: PyPy +Requires-Dist: pycparser + + +CFFI +==== + +Foreign Function Interface for Python calling C code. +Please see the `Documentation `_. + +Contact +------- + +`Mailing list `_ + + diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/cffi-1.12.3.dist-info/RECORD b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/cffi-1.12.3.dist-info/RECORD new file mode 100644 index 00000000..a2d93fd1 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/cffi-1.12.3.dist-info/RECORD @@ -0,0 +1,44 @@ +_cffi_backend.cp37-win32.pyd,sha256=LbpnOkcB1o-4UFT2SiLEwknE-4x7oLjK6Dg7vMn412I,139264 +cffi-1.12.3.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4 +cffi-1.12.3.dist-info/LICENSE,sha256=BLgPWwd7vtaICM_rreteNSPyqMmpZJXFh72W3x6sKjM,1294 +cffi-1.12.3.dist-info/METADATA,sha256=OA_DlKzbYB72gWWz0R2ds_RJzTIzvFx5cnHf5NXTRuo,1140 +cffi-1.12.3.dist-info/RECORD,, +cffi-1.12.3.dist-info/WHEEL,sha256=u4Efs1ohefs6i6rm-BSBkNuQzwmF2Y4Na3ETsbtk2VM,102 +cffi-1.12.3.dist-info/entry_points.txt,sha256=Q9f5C9IpjYxo0d2PK9eUcnkgxHc9pHWwjEMaANPKNCI,76 +cffi-1.12.3.dist-info/top_level.txt,sha256=rE7WR3rZfNKxWI9-jn6hsHCAl7MDkB-FmuQbxWjFehQ,19 +cffi/__init__.py,sha256=XPx-ySmw7OmYmr-7iXd3YoXhXj1HQLHYviMKpmAuWLc,513 +cffi/__pycache__/__init__.cpython-37.pyc,, +cffi/__pycache__/api.cpython-37.pyc,, +cffi/__pycache__/backend_ctypes.cpython-37.pyc,, +cffi/__pycache__/cffi_opcode.cpython-37.pyc,, +cffi/__pycache__/commontypes.cpython-37.pyc,, +cffi/__pycache__/cparser.cpython-37.pyc,, +cffi/__pycache__/error.cpython-37.pyc,, +cffi/__pycache__/ffiplatform.cpython-37.pyc,, +cffi/__pycache__/lock.cpython-37.pyc,, +cffi/__pycache__/model.cpython-37.pyc,, +cffi/__pycache__/pkgconfig.cpython-37.pyc,, +cffi/__pycache__/recompiler.cpython-37.pyc,, +cffi/__pycache__/setuptools_ext.cpython-37.pyc,, +cffi/__pycache__/vengine_cpy.cpython-37.pyc,, +cffi/__pycache__/vengine_gen.cpython-37.pyc,, +cffi/__pycache__/verifier.cpython-37.pyc,, +cffi/_cffi_errors.h,sha256=6nFQ-4dRQI1bXRoSeqdvyKU33TmutQJB_2fAhWSzdl8,3856 +cffi/_cffi_include.h,sha256=JuFfmwpRE65vym3Nxr9vDMOIEuv21tXdarkL1l2WNms,12149 +cffi/_embedding.h,sha256=PuNkRzXjURiRh7tXzVdIn0RD9pTJx04ZokHbcEO_3OY,17226 +cffi/api.py,sha256=Q07iwDD0FRwWa2fx2ZzQft69iJs9aNR52fvrtUy3EY4,41800 +cffi/backend_ctypes.py,sha256=_WkpD1SJel5gJovV-0u8hw-XvD3Efapqm9pIAEHTHn4,42449 +cffi/cffi_opcode.py,sha256=v9RdD_ovA8rCtqsC95Ivki5V667rAOhGgs3fb2q9xpM,5724 +cffi/commontypes.py,sha256=QS4uxCDI7JhtTyjh1hlnCA-gynmaszWxJaRRLGkJa1A,2689 +cffi/cparser.py,sha256=dcVqrRob1zqrCO--RZ6e-TtobJ7VMDpCU85W6QJ-N-4,40874 +cffi/error.py,sha256=v6xTiS4U0kvDcy4h_BDRo5v39ZQuj-IMRYLv5ETddZs,877 +cffi/ffiplatform.py,sha256=HMXqR8ks2wtdsNxGaWpQ_PyqIvtiuos_vf1qKCy-cwg,4046 +cffi/lock.py,sha256=l9TTdwMIMpi6jDkJGnQgE9cvTIR7CAntIJr8EGHt3pY,747 +cffi/model.py,sha256=AYyjS26uiFKXtkm43qmStpy9zfGh5HVJF4UETYFBt6w,21682 +cffi/parse_c_type.h,sha256=OdwQfwM9ktq6vlCB43exFQmxDBtj2MBNdK8LYl15tjw,5976 +cffi/pkgconfig.py,sha256=LP1w7vmWvmKwyqLaU1Z243FOWGNQMrgMUZrvgFuOlco,4374 +cffi/recompiler.py,sha256=LGqj7GPuq4KIG4axrN5G0Oy6YGmrLbBA0bHE-jCl6Oo,62711 +cffi/setuptools_ext.py,sha256=qc6arfrSzm4RNT5oJz6d5td7KJ-pHfI7bqYD0X4Q-08,8848 +cffi/vengine_cpy.py,sha256=hdyjjZNijLrg_uGMnnFyC-7GG_LxWtwB8BlS2vvVDQ0,41470 +cffi/vengine_gen.py,sha256=Zkq0-EdeZwn6qUvf_CI8iUEs2UxVIvDmKCH1j0-y0GI,26676 +cffi/verifier.py,sha256=J9Enz2rbJb9CHPqWlWQ5uQESoyr0uc7MNWugchjXBv4,11207 diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/cffi-1.12.3.dist-info/WHEEL b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/cffi-1.12.3.dist-info/WHEEL new file mode 100644 index 00000000..bb93ff5e --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/cffi-1.12.3.dist-info/WHEEL @@ -0,0 +1,5 @@ +Wheel-Version: 1.0 +Generator: bdist_wheel (0.33.1) +Root-Is-Purelib: false +Tag: cp37-cp37m-win32 + diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/cffi-1.12.3.dist-info/entry_points.txt b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/cffi-1.12.3.dist-info/entry_points.txt new file mode 100644 index 00000000..eee7e0fb --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/cffi-1.12.3.dist-info/entry_points.txt @@ -0,0 +1,3 @@ +[distutils.setup_keywords] +cffi_modules = cffi.setuptools_ext:cffi_modules + diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/cffi-1.12.3.dist-info/top_level.txt b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/cffi-1.12.3.dist-info/top_level.txt new file mode 100644 index 00000000..f6457795 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/cffi-1.12.3.dist-info/top_level.txt @@ -0,0 +1,2 @@ +_cffi_backend +cffi diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/cffi/__init__.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/cffi/__init__.py new file mode 100644 index 00000000..0224a15a --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/cffi/__init__.py @@ -0,0 +1,14 @@ +__all__ = ['FFI', 'VerificationError', 'VerificationMissing', 'CDefError', + 'FFIError'] + +from .api import FFI +from .error import CDefError, FFIError, VerificationError, VerificationMissing +from .error import PkgConfigError + +__version__ = "1.12.3" +__version_info__ = (1, 12, 3) + +# The verifier module file names are based on the CRC32 of a string that +# contains the following version number. It may be older than __version__ +# if nothing is clearly incompatible. +__version_verifier_modules__ = "0.8.6" diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/cffi/_cffi_errors.h b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/cffi/_cffi_errors.h new file mode 100644 index 00000000..83cdad06 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/cffi/_cffi_errors.h @@ -0,0 +1,147 @@ +#ifndef CFFI_MESSAGEBOX +# ifdef _MSC_VER +# define CFFI_MESSAGEBOX 1 +# else +# define CFFI_MESSAGEBOX 0 +# endif +#endif + + +#if CFFI_MESSAGEBOX +/* Windows only: logic to take the Python-CFFI embedding logic + initialization errors and display them in a background thread + with MessageBox. The idea is that if the whole program closes + as a result of this problem, then likely it is already a console + program and you can read the stderr output in the console too. + If it is not a console program, then it will likely show its own + dialog to complain, or generally not abruptly close, and for this + case the background thread should stay alive. +*/ +static void *volatile _cffi_bootstrap_text; + +static PyObject *_cffi_start_error_capture(void) +{ + PyObject *result = NULL; + PyObject *x, *m, *bi; + + if (InterlockedCompareExchangePointer(&_cffi_bootstrap_text, + (void *)1, NULL) != NULL) + return (PyObject *)1; + + m = PyImport_AddModule("_cffi_error_capture"); + if (m == NULL) + goto error; + + result = PyModule_GetDict(m); + if (result == NULL) + goto error; + +#if PY_MAJOR_VERSION >= 3 + bi = PyImport_ImportModule("builtins"); +#else + bi = PyImport_ImportModule("__builtin__"); +#endif + if (bi == NULL) + goto error; + PyDict_SetItemString(result, "__builtins__", bi); + Py_DECREF(bi); + + x = PyRun_String( + "import sys\n" + "class FileLike:\n" + " def write(self, x):\n" + " try:\n" + " of.write(x)\n" + " except: pass\n" + " self.buf += x\n" + "fl = FileLike()\n" + "fl.buf = ''\n" + "of = sys.stderr\n" + "sys.stderr = fl\n" + "def done():\n" + " sys.stderr = of\n" + " return fl.buf\n", /* make sure the returned value stays alive */ + Py_file_input, + result, result); + Py_XDECREF(x); + + error: + if (PyErr_Occurred()) + { + PyErr_WriteUnraisable(Py_None); + PyErr_Clear(); + } + return result; +} + +#pragma comment(lib, "user32.lib") + +static DWORD WINAPI _cffi_bootstrap_dialog(LPVOID ignored) +{ + Sleep(666); /* may be interrupted if the whole process is closing */ +#if PY_MAJOR_VERSION >= 3 + MessageBoxW(NULL, (wchar_t *)_cffi_bootstrap_text, + L"Python-CFFI error", + MB_OK | MB_ICONERROR); +#else + MessageBoxA(NULL, (char *)_cffi_bootstrap_text, + "Python-CFFI error", + MB_OK | MB_ICONERROR); +#endif + _cffi_bootstrap_text = NULL; + return 0; +} + +static void _cffi_stop_error_capture(PyObject *ecap) +{ + PyObject *s; + void *text; + + if (ecap == (PyObject *)1) + return; + + if (ecap == NULL) + goto error; + + s = PyRun_String("done()", Py_eval_input, ecap, ecap); + if (s == NULL) + goto error; + + /* Show a dialog box, but in a background thread, and + never show multiple dialog boxes at once. */ +#if PY_MAJOR_VERSION >= 3 + text = PyUnicode_AsWideCharString(s, NULL); +#else + text = PyString_AsString(s); +#endif + + _cffi_bootstrap_text = text; + + if (text != NULL) + { + HANDLE h; + h = CreateThread(NULL, 0, _cffi_bootstrap_dialog, + NULL, 0, NULL); + if (h != NULL) + CloseHandle(h); + } + /* decref the string, but it should stay alive as 'fl.buf' + in the small module above. It will really be freed only if + we later get another similar error. So it's a leak of at + most one copy of the small module. That's fine for this + situation which is usually a "fatal error" anyway. */ + Py_DECREF(s); + PyErr_Clear(); + return; + + error: + _cffi_bootstrap_text = NULL; + PyErr_Clear(); +} + +#else + +static PyObject *_cffi_start_error_capture(void) { return NULL; } +static void _cffi_stop_error_capture(PyObject *ecap) { } + +#endif diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/cffi/_cffi_include.h b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/cffi/_cffi_include.h new file mode 100644 index 00000000..37ea74fe --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/cffi/_cffi_include.h @@ -0,0 +1,308 @@ +#define _CFFI_ + +/* We try to define Py_LIMITED_API before including Python.h. + + Mess: we can only define it if Py_DEBUG, Py_TRACE_REFS and + Py_REF_DEBUG are not defined. This is a best-effort approximation: + we can learn about Py_DEBUG from pyconfig.h, but it is unclear if + the same works for the other two macros. Py_DEBUG implies them, + but not the other way around. + + Issue #350 is still open: on Windows, the code here causes it to link + with PYTHON36.DLL (for example) instead of PYTHON3.DLL. A fix was + attempted in 164e526a5515 and 14ce6985e1c3, but reverted: virtualenv + does not make PYTHON3.DLL available, and so the "correctly" compiled + version would not run inside a virtualenv. We will re-apply the fix + after virtualenv has been fixed for some time. For explanation, see + issue #355. For a workaround if you want PYTHON3.DLL and don't worry + about virtualenv, see issue #350. See also 'py_limited_api' in + setuptools_ext.py. +*/ +#if !defined(_CFFI_USE_EMBEDDING) && !defined(Py_LIMITED_API) +# include +# if !defined(Py_DEBUG) && !defined(Py_TRACE_REFS) && !defined(Py_REF_DEBUG) +# define Py_LIMITED_API +# endif +#endif + +#include +#ifdef __cplusplus +extern "C" { +#endif +#include +#include "parse_c_type.h" + +/* this block of #ifs should be kept exactly identical between + c/_cffi_backend.c, cffi/vengine_cpy.py, cffi/vengine_gen.py + and cffi/_cffi_include.h */ +#if defined(_MSC_VER) +# include /* for alloca() */ +# if _MSC_VER < 1600 /* MSVC < 2010 */ + typedef __int8 int8_t; + typedef __int16 int16_t; + typedef __int32 int32_t; + typedef __int64 int64_t; + typedef unsigned __int8 uint8_t; + typedef unsigned __int16 uint16_t; + typedef unsigned __int32 uint32_t; + typedef unsigned __int64 uint64_t; + typedef __int8 int_least8_t; + typedef __int16 int_least16_t; + typedef __int32 int_least32_t; + typedef __int64 int_least64_t; + typedef unsigned __int8 uint_least8_t; + typedef unsigned __int16 uint_least16_t; + typedef unsigned __int32 uint_least32_t; + typedef unsigned __int64 uint_least64_t; + typedef __int8 int_fast8_t; + typedef __int16 int_fast16_t; + typedef __int32 int_fast32_t; + typedef __int64 int_fast64_t; + typedef unsigned __int8 uint_fast8_t; + typedef unsigned __int16 uint_fast16_t; + typedef unsigned __int32 uint_fast32_t; + typedef unsigned __int64 uint_fast64_t; + typedef __int64 intmax_t; + typedef unsigned __int64 uintmax_t; +# else +# include +# endif +# if _MSC_VER < 1800 /* MSVC < 2013 */ +# ifndef __cplusplus + typedef unsigned char _Bool; +# endif +# endif +#else +# include +# if (defined (__SVR4) && defined (__sun)) || defined(_AIX) || defined(__hpux) +# include +# endif +#endif + +#ifdef __GNUC__ +# define _CFFI_UNUSED_FN __attribute__((unused)) +#else +# define _CFFI_UNUSED_FN /* nothing */ +#endif + +#ifdef __cplusplus +# ifndef _Bool + typedef bool _Bool; /* semi-hackish: C++ has no _Bool; bool is builtin */ +# endif +#endif + +/********** CPython-specific section **********/ +#ifndef PYPY_VERSION + + +#if PY_MAJOR_VERSION >= 3 +# define PyInt_FromLong PyLong_FromLong +#endif + +#define _cffi_from_c_double PyFloat_FromDouble +#define _cffi_from_c_float PyFloat_FromDouble +#define _cffi_from_c_long PyInt_FromLong +#define _cffi_from_c_ulong PyLong_FromUnsignedLong +#define _cffi_from_c_longlong PyLong_FromLongLong +#define _cffi_from_c_ulonglong PyLong_FromUnsignedLongLong +#define _cffi_from_c__Bool PyBool_FromLong + +#define _cffi_to_c_double PyFloat_AsDouble +#define _cffi_to_c_float PyFloat_AsDouble + +#define _cffi_from_c_int(x, type) \ + (((type)-1) > 0 ? /* unsigned */ \ + (sizeof(type) < sizeof(long) ? \ + PyInt_FromLong((long)x) : \ + sizeof(type) == sizeof(long) ? \ + PyLong_FromUnsignedLong((unsigned long)x) : \ + PyLong_FromUnsignedLongLong((unsigned long long)x)) : \ + (sizeof(type) <= sizeof(long) ? \ + PyInt_FromLong((long)x) : \ + PyLong_FromLongLong((long long)x))) + +#define _cffi_to_c_int(o, type) \ + ((type)( \ + sizeof(type) == 1 ? (((type)-1) > 0 ? (type)_cffi_to_c_u8(o) \ + : (type)_cffi_to_c_i8(o)) : \ + sizeof(type) == 2 ? (((type)-1) > 0 ? (type)_cffi_to_c_u16(o) \ + : (type)_cffi_to_c_i16(o)) : \ + sizeof(type) == 4 ? (((type)-1) > 0 ? (type)_cffi_to_c_u32(o) \ + : (type)_cffi_to_c_i32(o)) : \ + sizeof(type) == 8 ? (((type)-1) > 0 ? (type)_cffi_to_c_u64(o) \ + : (type)_cffi_to_c_i64(o)) : \ + (Py_FatalError("unsupported size for type " #type), (type)0))) + +#define _cffi_to_c_i8 \ + ((int(*)(PyObject *))_cffi_exports[1]) +#define _cffi_to_c_u8 \ + ((int(*)(PyObject *))_cffi_exports[2]) +#define _cffi_to_c_i16 \ + ((int(*)(PyObject *))_cffi_exports[3]) +#define _cffi_to_c_u16 \ + ((int(*)(PyObject *))_cffi_exports[4]) +#define _cffi_to_c_i32 \ + ((int(*)(PyObject *))_cffi_exports[5]) +#define _cffi_to_c_u32 \ + ((unsigned int(*)(PyObject *))_cffi_exports[6]) +#define _cffi_to_c_i64 \ + ((long long(*)(PyObject *))_cffi_exports[7]) +#define _cffi_to_c_u64 \ + ((unsigned long long(*)(PyObject *))_cffi_exports[8]) +#define _cffi_to_c_char \ + ((int(*)(PyObject *))_cffi_exports[9]) +#define _cffi_from_c_pointer \ + ((PyObject *(*)(char *, struct _cffi_ctypedescr *))_cffi_exports[10]) +#define _cffi_to_c_pointer \ + ((char *(*)(PyObject *, struct _cffi_ctypedescr *))_cffi_exports[11]) +#define _cffi_get_struct_layout \ + not used any more +#define _cffi_restore_errno \ + ((void(*)(void))_cffi_exports[13]) +#define _cffi_save_errno \ + ((void(*)(void))_cffi_exports[14]) +#define _cffi_from_c_char \ + ((PyObject *(*)(char))_cffi_exports[15]) +#define _cffi_from_c_deref \ + ((PyObject *(*)(char *, struct _cffi_ctypedescr *))_cffi_exports[16]) +#define _cffi_to_c \ + ((int(*)(char *, struct _cffi_ctypedescr *, PyObject *))_cffi_exports[17]) +#define _cffi_from_c_struct \ + ((PyObject *(*)(char *, struct _cffi_ctypedescr *))_cffi_exports[18]) +#define _cffi_to_c_wchar_t \ + ((_cffi_wchar_t(*)(PyObject *))_cffi_exports[19]) +#define _cffi_from_c_wchar_t \ + ((PyObject *(*)(_cffi_wchar_t))_cffi_exports[20]) +#define _cffi_to_c_long_double \ + ((long double(*)(PyObject *))_cffi_exports[21]) +#define _cffi_to_c__Bool \ + ((_Bool(*)(PyObject *))_cffi_exports[22]) +#define _cffi_prepare_pointer_call_argument \ + ((Py_ssize_t(*)(struct _cffi_ctypedescr *, \ + PyObject *, char **))_cffi_exports[23]) +#define _cffi_convert_array_from_object \ + ((int(*)(char *, struct _cffi_ctypedescr *, PyObject *))_cffi_exports[24]) +#define _CFFI_CPIDX 25 +#define _cffi_call_python \ + ((void(*)(struct _cffi_externpy_s *, char *))_cffi_exports[_CFFI_CPIDX]) +#define _cffi_to_c_wchar3216_t \ + ((int(*)(PyObject *))_cffi_exports[26]) +#define _cffi_from_c_wchar3216_t \ + ((PyObject *(*)(int))_cffi_exports[27]) +#define _CFFI_NUM_EXPORTS 28 + +struct _cffi_ctypedescr; + +static void *_cffi_exports[_CFFI_NUM_EXPORTS]; + +#define _cffi_type(index) ( \ + assert((((uintptr_t)_cffi_types[index]) & 1) == 0), \ + (struct _cffi_ctypedescr *)_cffi_types[index]) + +static PyObject *_cffi_init(const char *module_name, Py_ssize_t version, + const struct _cffi_type_context_s *ctx) +{ + PyObject *module, *o_arg, *new_module; + void *raw[] = { + (void *)module_name, + (void *)version, + (void *)_cffi_exports, + (void *)ctx, + }; + + module = PyImport_ImportModule("_cffi_backend"); + if (module == NULL) + goto failure; + + o_arg = PyLong_FromVoidPtr((void *)raw); + if (o_arg == NULL) + goto failure; + + new_module = PyObject_CallMethod( + module, (char *)"_init_cffi_1_0_external_module", (char *)"O", o_arg); + + Py_DECREF(o_arg); + Py_DECREF(module); + return new_module; + + failure: + Py_XDECREF(module); + return NULL; +} + + +#ifdef HAVE_WCHAR_H +typedef wchar_t _cffi_wchar_t; +#else +typedef uint16_t _cffi_wchar_t; /* same random pick as _cffi_backend.c */ +#endif + +_CFFI_UNUSED_FN static uint16_t _cffi_to_c_char16_t(PyObject *o) +{ + if (sizeof(_cffi_wchar_t) == 2) + return (uint16_t)_cffi_to_c_wchar_t(o); + else + return (uint16_t)_cffi_to_c_wchar3216_t(o); +} + +_CFFI_UNUSED_FN static PyObject *_cffi_from_c_char16_t(uint16_t x) +{ + if (sizeof(_cffi_wchar_t) == 2) + return _cffi_from_c_wchar_t((_cffi_wchar_t)x); + else + return _cffi_from_c_wchar3216_t((int)x); +} + +_CFFI_UNUSED_FN static int _cffi_to_c_char32_t(PyObject *o) +{ + if (sizeof(_cffi_wchar_t) == 4) + return (int)_cffi_to_c_wchar_t(o); + else + return (int)_cffi_to_c_wchar3216_t(o); +} + +_CFFI_UNUSED_FN static PyObject *_cffi_from_c_char32_t(int x) +{ + if (sizeof(_cffi_wchar_t) == 4) + return _cffi_from_c_wchar_t((_cffi_wchar_t)x); + else + return _cffi_from_c_wchar3216_t(x); +} + + +/********** end CPython-specific section **********/ +#else +_CFFI_UNUSED_FN +static void (*_cffi_call_python_org)(struct _cffi_externpy_s *, char *); +# define _cffi_call_python _cffi_call_python_org +#endif + + +#define _cffi_array_len(array) (sizeof(array) / sizeof((array)[0])) + +#define _cffi_prim_int(size, sign) \ + ((size) == 1 ? ((sign) ? _CFFI_PRIM_INT8 : _CFFI_PRIM_UINT8) : \ + (size) == 2 ? ((sign) ? _CFFI_PRIM_INT16 : _CFFI_PRIM_UINT16) : \ + (size) == 4 ? ((sign) ? _CFFI_PRIM_INT32 : _CFFI_PRIM_UINT32) : \ + (size) == 8 ? ((sign) ? _CFFI_PRIM_INT64 : _CFFI_PRIM_UINT64) : \ + _CFFI__UNKNOWN_PRIM) + +#define _cffi_prim_float(size) \ + ((size) == sizeof(float) ? _CFFI_PRIM_FLOAT : \ + (size) == sizeof(double) ? _CFFI_PRIM_DOUBLE : \ + (size) == sizeof(long double) ? _CFFI__UNKNOWN_LONG_DOUBLE : \ + _CFFI__UNKNOWN_FLOAT_PRIM) + +#define _cffi_check_int(got, got_nonpos, expected) \ + ((got_nonpos) == (expected <= 0) && \ + (got) == (unsigned long long)expected) + +#ifdef MS_WIN32 +# define _cffi_stdcall __stdcall +#else +# define _cffi_stdcall /* nothing */ +#endif + +#ifdef __cplusplus +} +#endif diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/cffi/_embedding.h b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/cffi/_embedding.h new file mode 100644 index 00000000..30842c17 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/cffi/_embedding.h @@ -0,0 +1,518 @@ + +/***** Support code for embedding *****/ + +#ifdef __cplusplus +extern "C" { +#endif + + +#if defined(_WIN32) +# define CFFI_DLLEXPORT __declspec(dllexport) +#elif defined(__GNUC__) +# define CFFI_DLLEXPORT __attribute__((visibility("default"))) +#else +# define CFFI_DLLEXPORT /* nothing */ +#endif + + +/* There are two global variables of type _cffi_call_python_fnptr: + + * _cffi_call_python, which we declare just below, is the one called + by ``extern "Python"`` implementations. + + * _cffi_call_python_org, which on CPython is actually part of the + _cffi_exports[] array, is the function pointer copied from + _cffi_backend. + + After initialization is complete, both are equal. However, the + first one remains equal to &_cffi_start_and_call_python until the + very end of initialization, when we are (or should be) sure that + concurrent threads also see a completely initialized world, and + only then is it changed. +*/ +#undef _cffi_call_python +typedef void (*_cffi_call_python_fnptr)(struct _cffi_externpy_s *, char *); +static void _cffi_start_and_call_python(struct _cffi_externpy_s *, char *); +static _cffi_call_python_fnptr _cffi_call_python = &_cffi_start_and_call_python; + + +#ifndef _MSC_VER + /* --- Assuming a GCC not infinitely old --- */ +# define cffi_compare_and_swap(l,o,n) __sync_bool_compare_and_swap(l,o,n) +# define cffi_write_barrier() __sync_synchronize() +# if !defined(__amd64__) && !defined(__x86_64__) && \ + !defined(__i386__) && !defined(__i386) +# define cffi_read_barrier() __sync_synchronize() +# else +# define cffi_read_barrier() (void)0 +# endif +#else + /* --- Windows threads version --- */ +# include +# define cffi_compare_and_swap(l,o,n) \ + (InterlockedCompareExchangePointer(l,n,o) == (o)) +# define cffi_write_barrier() InterlockedCompareExchange(&_cffi_dummy,0,0) +# define cffi_read_barrier() (void)0 +static volatile LONG _cffi_dummy; +#endif + +#ifdef WITH_THREAD +# ifndef _MSC_VER +# include + static pthread_mutex_t _cffi_embed_startup_lock; +# else + static CRITICAL_SECTION _cffi_embed_startup_lock; +# endif + static char _cffi_embed_startup_lock_ready = 0; +#endif + +static void _cffi_acquire_reentrant_mutex(void) +{ + static void *volatile lock = NULL; + + while (!cffi_compare_and_swap(&lock, NULL, (void *)1)) { + /* should ideally do a spin loop instruction here, but + hard to do it portably and doesn't really matter I + think: pthread_mutex_init() should be very fast, and + this is only run at start-up anyway. */ + } + +#ifdef WITH_THREAD + if (!_cffi_embed_startup_lock_ready) { +# ifndef _MSC_VER + pthread_mutexattr_t attr; + pthread_mutexattr_init(&attr); + pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE); + pthread_mutex_init(&_cffi_embed_startup_lock, &attr); +# else + InitializeCriticalSection(&_cffi_embed_startup_lock); +# endif + _cffi_embed_startup_lock_ready = 1; + } +#endif + + while (!cffi_compare_and_swap(&lock, (void *)1, NULL)) + ; + +#ifndef _MSC_VER + pthread_mutex_lock(&_cffi_embed_startup_lock); +#else + EnterCriticalSection(&_cffi_embed_startup_lock); +#endif +} + +static void _cffi_release_reentrant_mutex(void) +{ +#ifndef _MSC_VER + pthread_mutex_unlock(&_cffi_embed_startup_lock); +#else + LeaveCriticalSection(&_cffi_embed_startup_lock); +#endif +} + + +/********** CPython-specific section **********/ +#ifndef PYPY_VERSION + +#include "_cffi_errors.h" + + +#define _cffi_call_python_org _cffi_exports[_CFFI_CPIDX] + +PyMODINIT_FUNC _CFFI_PYTHON_STARTUP_FUNC(void); /* forward */ + +static void _cffi_py_initialize(void) +{ + /* XXX use initsigs=0, which "skips initialization registration of + signal handlers, which might be useful when Python is + embedded" according to the Python docs. But review and think + if it should be a user-controllable setting. + + XXX we should also give a way to write errors to a buffer + instead of to stderr. + + XXX if importing 'site' fails, CPython (any version) calls + exit(). Should we try to work around this behavior here? + */ + Py_InitializeEx(0); +} + +static int _cffi_initialize_python(void) +{ + /* This initializes Python, imports _cffi_backend, and then the + present .dll/.so is set up as a CPython C extension module. + */ + int result; + PyGILState_STATE state; + PyObject *pycode=NULL, *global_dict=NULL, *x; + PyObject *builtins; + + state = PyGILState_Ensure(); + + /* Call the initxxx() function from the present module. It will + create and initialize us as a CPython extension module, instead + of letting the startup Python code do it---it might reimport + the same .dll/.so and get maybe confused on some platforms. + It might also have troubles locating the .dll/.so again for all + I know. + */ + (void)_CFFI_PYTHON_STARTUP_FUNC(); + if (PyErr_Occurred()) + goto error; + + /* Now run the Python code provided to ffi.embedding_init_code(). + */ + pycode = Py_CompileString(_CFFI_PYTHON_STARTUP_CODE, + "", + Py_file_input); + if (pycode == NULL) + goto error; + global_dict = PyDict_New(); + if (global_dict == NULL) + goto error; + builtins = PyEval_GetBuiltins(); + if (builtins == NULL) + goto error; + if (PyDict_SetItemString(global_dict, "__builtins__", builtins) < 0) + goto error; + x = PyEval_EvalCode( +#if PY_MAJOR_VERSION < 3 + (PyCodeObject *) +#endif + pycode, global_dict, global_dict); + if (x == NULL) + goto error; + Py_DECREF(x); + + /* Done! Now if we've been called from + _cffi_start_and_call_python() in an ``extern "Python"``, we can + only hope that the Python code did correctly set up the + corresponding @ffi.def_extern() function. Otherwise, the + general logic of ``extern "Python"`` functions (inside the + _cffi_backend module) will find that the reference is still + missing and print an error. + */ + result = 0; + done: + Py_XDECREF(pycode); + Py_XDECREF(global_dict); + PyGILState_Release(state); + return result; + + error:; + { + /* Print as much information as potentially useful. + Debugging load-time failures with embedding is not fun + */ + PyObject *ecap; + PyObject *exception, *v, *tb, *f, *modules, *mod; + PyErr_Fetch(&exception, &v, &tb); + ecap = _cffi_start_error_capture(); + f = PySys_GetObject((char *)"stderr"); + if (f != NULL && f != Py_None) { + PyFile_WriteString( + "Failed to initialize the Python-CFFI embedding logic:\n\n", f); + } + + if (exception != NULL) { + PyErr_NormalizeException(&exception, &v, &tb); + PyErr_Display(exception, v, tb); + } + Py_XDECREF(exception); + Py_XDECREF(v); + Py_XDECREF(tb); + + if (f != NULL && f != Py_None) { + PyFile_WriteString("\nFrom: " _CFFI_MODULE_NAME + "\ncompiled with cffi version: 1.12.3" + "\n_cffi_backend module: ", f); + modules = PyImport_GetModuleDict(); + mod = PyDict_GetItemString(modules, "_cffi_backend"); + if (mod == NULL) { + PyFile_WriteString("not loaded", f); + } + else { + v = PyObject_GetAttrString(mod, "__file__"); + PyFile_WriteObject(v, f, 0); + Py_XDECREF(v); + } + PyFile_WriteString("\nsys.path: ", f); + PyFile_WriteObject(PySys_GetObject((char *)"path"), f, 0); + PyFile_WriteString("\n\n", f); + } + _cffi_stop_error_capture(ecap); + } + result = -1; + goto done; +} + +PyAPI_DATA(char *) _PyParser_TokenNames[]; /* from CPython */ + +static int _cffi_carefully_make_gil(void) +{ + /* This does the basic initialization of Python. It can be called + completely concurrently from unrelated threads. It assumes + that we don't hold the GIL before (if it exists), and we don't + hold it afterwards. + + (What it really does used to be completely different in Python 2 + and Python 3, with the Python 2 solution avoiding the spin-lock + around the Py_InitializeEx() call. However, after recent changes + to CPython 2.7 (issue #358) it no longer works. So we use the + Python 3 solution everywhere.) + + This initializes Python by calling Py_InitializeEx(). + Important: this must not be called concurrently at all. + So we use a global variable as a simple spin lock. This global + variable must be from 'libpythonX.Y.so', not from this + cffi-based extension module, because it must be shared from + different cffi-based extension modules. + + In Python < 3.8, we choose + _PyParser_TokenNames[0] as a completely arbitrary pointer value + that is never written to. The default is to point to the + string "ENDMARKER". We change it temporarily to point to the + next character in that string. (Yes, I know it's REALLY + obscure.) + + In Python >= 3.8, this string array is no longer writable, so + instead we pick PyCapsuleType.tp_version_tag. We can't change + Python < 3.8 because someone might use a mixture of cffi + embedded modules, some of which were compiled before this file + changed. + */ + +#ifdef WITH_THREAD +# if PY_VERSION_HEX < 0x03080000 + char *volatile *lock = (char *volatile *)_PyParser_TokenNames; + char *old_value, *locked_value; + + while (1) { /* spin loop */ + old_value = *lock; + locked_value = old_value + 1; + if (old_value[0] == 'E') { + assert(old_value[1] == 'N'); + if (cffi_compare_and_swap(lock, old_value, locked_value)) + break; + } + else { + assert(old_value[0] == 'N'); + /* should ideally do a spin loop instruction here, but + hard to do it portably and doesn't really matter I + think: PyEval_InitThreads() should be very fast, and + this is only run at start-up anyway. */ + } + } +# else + int volatile *lock = (int volatile *)&PyCapsule_Type.tp_version_tag; + int old_value, locked_value; + assert(!(PyCapsule_Type.tp_flags & Py_TPFLAGS_HAVE_VERSION_TAG)); + + while (1) { /* spin loop */ + old_value = *lock; + locked_value = -42; + if (old_value == 0) { + if (cffi_compare_and_swap(lock, old_value, locked_value)) + break; + } + else { + assert(old_value == locked_value); + /* should ideally do a spin loop instruction here, but + hard to do it portably and doesn't really matter I + think: PyEval_InitThreads() should be very fast, and + this is only run at start-up anyway. */ + } + } +# endif +#endif + + /* call Py_InitializeEx() */ + { + PyGILState_STATE state = PyGILState_UNLOCKED; + if (!Py_IsInitialized()) + _cffi_py_initialize(); + else + state = PyGILState_Ensure(); + + PyEval_InitThreads(); + PyGILState_Release(state); + } + +#ifdef WITH_THREAD + /* release the lock */ + while (!cffi_compare_and_swap(lock, locked_value, old_value)) + ; +#endif + + return 0; +} + +/********** end CPython-specific section **********/ + + +#else + + +/********** PyPy-specific section **********/ + +PyMODINIT_FUNC _CFFI_PYTHON_STARTUP_FUNC(const void *[]); /* forward */ + +static struct _cffi_pypy_init_s { + const char *name; + void (*func)(const void *[]); + const char *code; +} _cffi_pypy_init = { + _CFFI_MODULE_NAME, + (void(*)(const void *[]))_CFFI_PYTHON_STARTUP_FUNC, + _CFFI_PYTHON_STARTUP_CODE, +}; + +extern int pypy_carefully_make_gil(const char *); +extern int pypy_init_embedded_cffi_module(int, struct _cffi_pypy_init_s *); + +static int _cffi_carefully_make_gil(void) +{ + return pypy_carefully_make_gil(_CFFI_MODULE_NAME); +} + +static int _cffi_initialize_python(void) +{ + return pypy_init_embedded_cffi_module(0xB011, &_cffi_pypy_init); +} + +/********** end PyPy-specific section **********/ + + +#endif + + +#ifdef __GNUC__ +__attribute__((noinline)) +#endif +static _cffi_call_python_fnptr _cffi_start_python(void) +{ + /* Delicate logic to initialize Python. This function can be + called multiple times concurrently, e.g. when the process calls + its first ``extern "Python"`` functions in multiple threads at + once. It can also be called recursively, in which case we must + ignore it. We also have to consider what occurs if several + different cffi-based extensions reach this code in parallel + threads---it is a different copy of the code, then, and we + can't have any shared global variable unless it comes from + 'libpythonX.Y.so'. + + Idea: + + * _cffi_carefully_make_gil(): "carefully" call + PyEval_InitThreads() (possibly with Py_InitializeEx() first). + + * then we use a (local) custom lock to make sure that a call to this + cffi-based extension will wait if another call to the *same* + extension is running the initialization in another thread. + It is reentrant, so that a recursive call will not block, but + only one from a different thread. + + * then we grab the GIL and (Python 2) we call Py_InitializeEx(). + At this point, concurrent calls to Py_InitializeEx() are not + possible: we have the GIL. + + * do the rest of the specific initialization, which may + temporarily release the GIL but not the custom lock. + Only release the custom lock when we are done. + */ + static char called = 0; + + if (_cffi_carefully_make_gil() != 0) + return NULL; + + _cffi_acquire_reentrant_mutex(); + + /* Here the GIL exists, but we don't have it. We're only protected + from concurrency by the reentrant mutex. */ + + /* This file only initializes the embedded module once, the first + time this is called, even if there are subinterpreters. */ + if (!called) { + called = 1; /* invoke _cffi_initialize_python() only once, + but don't set '_cffi_call_python' right now, + otherwise concurrent threads won't call + this function at all (we need them to wait) */ + if (_cffi_initialize_python() == 0) { + /* now initialization is finished. Switch to the fast-path. */ + + /* We would like nobody to see the new value of + '_cffi_call_python' without also seeing the rest of the + data initialized. However, this is not possible. But + the new value of '_cffi_call_python' is the function + 'cffi_call_python()' from _cffi_backend. So: */ + cffi_write_barrier(); + /* ^^^ we put a write barrier here, and a corresponding + read barrier at the start of cffi_call_python(). This + ensures that after that read barrier, we see everything + done here before the write barrier. + */ + + assert(_cffi_call_python_org != NULL); + _cffi_call_python = (_cffi_call_python_fnptr)_cffi_call_python_org; + } + else { + /* initialization failed. Reset this to NULL, even if it was + already set to some other value. Future calls to + _cffi_start_python() are still forced to occur, and will + always return NULL from now on. */ + _cffi_call_python_org = NULL; + } + } + + _cffi_release_reentrant_mutex(); + + return (_cffi_call_python_fnptr)_cffi_call_python_org; +} + +static +void _cffi_start_and_call_python(struct _cffi_externpy_s *externpy, char *args) +{ + _cffi_call_python_fnptr fnptr; + int current_err = errno; +#ifdef _MSC_VER + int current_lasterr = GetLastError(); +#endif + fnptr = _cffi_start_python(); + if (fnptr == NULL) { + fprintf(stderr, "function %s() called, but initialization code " + "failed. Returning 0.\n", externpy->name); + memset(args, 0, externpy->size_of_result); + } +#ifdef _MSC_VER + SetLastError(current_lasterr); +#endif + errno = current_err; + + if (fnptr != NULL) + fnptr(externpy, args); +} + + +/* The cffi_start_python() function makes sure Python is initialized + and our cffi module is set up. It can be called manually from the + user C code. The same effect is obtained automatically from any + dll-exported ``extern "Python"`` function. This function returns + -1 if initialization failed, 0 if all is OK. */ +_CFFI_UNUSED_FN +static int cffi_start_python(void) +{ + if (_cffi_call_python == &_cffi_start_and_call_python) { + if (_cffi_start_python() == NULL) + return -1; + } + cffi_read_barrier(); + return 0; +} + +#undef cffi_compare_and_swap +#undef cffi_write_barrier +#undef cffi_read_barrier + +#ifdef __cplusplus +} +#endif diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/cffi/api.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/cffi/api.py new file mode 100644 index 00000000..32fe6208 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/cffi/api.py @@ -0,0 +1,961 @@ +import sys, types +from .lock import allocate_lock +from .error import CDefError +from . import model + +try: + callable +except NameError: + # Python 3.1 + from collections import Callable + callable = lambda x: isinstance(x, Callable) + +try: + basestring +except NameError: + # Python 3.x + basestring = str + +_unspecified = object() + + + +class FFI(object): + r''' + The main top-level class that you instantiate once, or once per module. + + Example usage: + + ffi = FFI() + ffi.cdef(""" + int printf(const char *, ...); + """) + + C = ffi.dlopen(None) # standard library + -or- + C = ffi.verify() # use a C compiler: verify the decl above is right + + C.printf("hello, %s!\n", ffi.new("char[]", "world")) + ''' + + def __init__(self, backend=None): + """Create an FFI instance. The 'backend' argument is used to + select a non-default backend, mostly for tests. + """ + if backend is None: + # You need PyPy (>= 2.0 beta), or a CPython (>= 2.6) with + # _cffi_backend.so compiled. + import _cffi_backend as backend + from . import __version__ + if backend.__version__ != __version__: + # bad version! Try to be as explicit as possible. + if hasattr(backend, '__file__'): + # CPython + raise Exception("Version mismatch: this is the 'cffi' package version %s, located in %r. When we import the top-level '_cffi_backend' extension module, we get version %s, located in %r. The two versions should be equal; check your installation." % ( + __version__, __file__, + backend.__version__, backend.__file__)) + else: + # PyPy + raise Exception("Version mismatch: this is the 'cffi' package version %s, located in %r. This interpreter comes with a built-in '_cffi_backend' module, which is version %s. The two versions should be equal; check your installation." % ( + __version__, __file__, backend.__version__)) + # (If you insist you can also try to pass the option + # 'backend=backend_ctypes.CTypesBackend()', but don't + # rely on it! It's probably not going to work well.) + + from . import cparser + self._backend = backend + self._lock = allocate_lock() + self._parser = cparser.Parser() + self._cached_btypes = {} + self._parsed_types = types.ModuleType('parsed_types').__dict__ + self._new_types = types.ModuleType('new_types').__dict__ + self._function_caches = [] + self._libraries = [] + self._cdefsources = [] + self._included_ffis = [] + self._windows_unicode = None + self._init_once_cache = {} + self._cdef_version = None + self._embedding = None + self._typecache = model.get_typecache(backend) + if hasattr(backend, 'set_ffi'): + backend.set_ffi(self) + for name in list(backend.__dict__): + if name.startswith('RTLD_'): + setattr(self, name, getattr(backend, name)) + # + with self._lock: + self.BVoidP = self._get_cached_btype(model.voidp_type) + self.BCharA = self._get_cached_btype(model.char_array_type) + if isinstance(backend, types.ModuleType): + # _cffi_backend: attach these constants to the class + if not hasattr(FFI, 'NULL'): + FFI.NULL = self.cast(self.BVoidP, 0) + FFI.CData, FFI.CType = backend._get_types() + else: + # ctypes backend: attach these constants to the instance + self.NULL = self.cast(self.BVoidP, 0) + self.CData, self.CType = backend._get_types() + self.buffer = backend.buffer + + def cdef(self, csource, override=False, packed=False, pack=None): + """Parse the given C source. This registers all declared functions, + types, and global variables. The functions and global variables can + then be accessed via either 'ffi.dlopen()' or 'ffi.verify()'. + The types can be used in 'ffi.new()' and other functions. + If 'packed' is specified as True, all structs declared inside this + cdef are packed, i.e. laid out without any field alignment at all. + Alternatively, 'pack' can be a small integer, and requests for + alignment greater than that are ignored (pack=1 is equivalent to + packed=True). + """ + self._cdef(csource, override=override, packed=packed, pack=pack) + + def embedding_api(self, csource, packed=False, pack=None): + self._cdef(csource, packed=packed, pack=pack, dllexport=True) + if self._embedding is None: + self._embedding = '' + + def _cdef(self, csource, override=False, **options): + if not isinstance(csource, str): # unicode, on Python 2 + if not isinstance(csource, basestring): + raise TypeError("cdef() argument must be a string") + csource = csource.encode('ascii') + with self._lock: + self._cdef_version = object() + self._parser.parse(csource, override=override, **options) + self._cdefsources.append(csource) + if override: + for cache in self._function_caches: + cache.clear() + finishlist = self._parser._recomplete + if finishlist: + self._parser._recomplete = [] + for tp in finishlist: + tp.finish_backend_type(self, finishlist) + + def dlopen(self, name, flags=0): + """Load and return a dynamic library identified by 'name'. + The standard C library can be loaded by passing None. + Note that functions and types declared by 'ffi.cdef()' are not + linked to a particular library, just like C headers; in the + library we only look for the actual (untyped) symbols. + """ + assert isinstance(name, basestring) or name is None + with self._lock: + lib, function_cache = _make_ffi_library(self, name, flags) + self._function_caches.append(function_cache) + self._libraries.append(lib) + return lib + + def dlclose(self, lib): + """Close a library obtained with ffi.dlopen(). After this call, + access to functions or variables from the library will fail + (possibly with a segmentation fault). + """ + type(lib).__cffi_close__(lib) + + def _typeof_locked(self, cdecl): + # call me with the lock! + key = cdecl + if key in self._parsed_types: + return self._parsed_types[key] + # + if not isinstance(cdecl, str): # unicode, on Python 2 + cdecl = cdecl.encode('ascii') + # + type = self._parser.parse_type(cdecl) + really_a_function_type = type.is_raw_function + if really_a_function_type: + type = type.as_function_pointer() + btype = self._get_cached_btype(type) + result = btype, really_a_function_type + self._parsed_types[key] = result + return result + + def _typeof(self, cdecl, consider_function_as_funcptr=False): + # string -> ctype object + try: + result = self._parsed_types[cdecl] + except KeyError: + with self._lock: + result = self._typeof_locked(cdecl) + # + btype, really_a_function_type = result + if really_a_function_type and not consider_function_as_funcptr: + raise CDefError("the type %r is a function type, not a " + "pointer-to-function type" % (cdecl,)) + return btype + + def typeof(self, cdecl): + """Parse the C type given as a string and return the + corresponding object. + It can also be used on 'cdata' instance to get its C type. + """ + if isinstance(cdecl, basestring): + return self._typeof(cdecl) + if isinstance(cdecl, self.CData): + return self._backend.typeof(cdecl) + if isinstance(cdecl, types.BuiltinFunctionType): + res = _builtin_function_type(cdecl) + if res is not None: + return res + if (isinstance(cdecl, types.FunctionType) + and hasattr(cdecl, '_cffi_base_type')): + with self._lock: + return self._get_cached_btype(cdecl._cffi_base_type) + raise TypeError(type(cdecl)) + + def sizeof(self, cdecl): + """Return the size in bytes of the argument. It can be a + string naming a C type, or a 'cdata' instance. + """ + if isinstance(cdecl, basestring): + BType = self._typeof(cdecl) + return self._backend.sizeof(BType) + else: + return self._backend.sizeof(cdecl) + + def alignof(self, cdecl): + """Return the natural alignment size in bytes of the C type + given as a string. + """ + if isinstance(cdecl, basestring): + cdecl = self._typeof(cdecl) + return self._backend.alignof(cdecl) + + def offsetof(self, cdecl, *fields_or_indexes): + """Return the offset of the named field inside the given + structure or array, which must be given as a C type name. + You can give several field names in case of nested structures. + You can also give numeric values which correspond to array + items, in case of an array type. + """ + if isinstance(cdecl, basestring): + cdecl = self._typeof(cdecl) + return self._typeoffsetof(cdecl, *fields_or_indexes)[1] + + def new(self, cdecl, init=None): + """Allocate an instance according to the specified C type and + return a pointer to it. The specified C type must be either a + pointer or an array: ``new('X *')`` allocates an X and returns + a pointer to it, whereas ``new('X[n]')`` allocates an array of + n X'es and returns an array referencing it (which works + mostly like a pointer, like in C). You can also use + ``new('X[]', n)`` to allocate an array of a non-constant + length n. + + The memory is initialized following the rules of declaring a + global variable in C: by default it is zero-initialized, but + an explicit initializer can be given which can be used to + fill all or part of the memory. + + When the returned object goes out of scope, the memory + is freed. In other words the returned object has + ownership of the value of type 'cdecl' that it points to. This + means that the raw data can be used as long as this object is + kept alive, but must not be used for a longer time. Be careful + about that when copying the pointer to the memory somewhere + else, e.g. into another structure. + """ + if isinstance(cdecl, basestring): + cdecl = self._typeof(cdecl) + return self._backend.newp(cdecl, init) + + def new_allocator(self, alloc=None, free=None, + should_clear_after_alloc=True): + """Return a new allocator, i.e. a function that behaves like ffi.new() + but uses the provided low-level 'alloc' and 'free' functions. + + 'alloc' is called with the size as argument. If it returns NULL, a + MemoryError is raised. 'free' is called with the result of 'alloc' + as argument. Both can be either Python function or directly C + functions. If 'free' is None, then no free function is called. + If both 'alloc' and 'free' are None, the default is used. + + If 'should_clear_after_alloc' is set to False, then the memory + returned by 'alloc' is assumed to be already cleared (or you are + fine with garbage); otherwise CFFI will clear it. + """ + compiled_ffi = self._backend.FFI() + allocator = compiled_ffi.new_allocator(alloc, free, + should_clear_after_alloc) + def allocate(cdecl, init=None): + if isinstance(cdecl, basestring): + cdecl = self._typeof(cdecl) + return allocator(cdecl, init) + return allocate + + def cast(self, cdecl, source): + """Similar to a C cast: returns an instance of the named C + type initialized with the given 'source'. The source is + casted between integers or pointers of any type. + """ + if isinstance(cdecl, basestring): + cdecl = self._typeof(cdecl) + return self._backend.cast(cdecl, source) + + def string(self, cdata, maxlen=-1): + """Return a Python string (or unicode string) from the 'cdata'. + If 'cdata' is a pointer or array of characters or bytes, returns + the null-terminated string. The returned string extends until + the first null character, or at most 'maxlen' characters. If + 'cdata' is an array then 'maxlen' defaults to its length. + + If 'cdata' is a pointer or array of wchar_t, returns a unicode + string following the same rules. + + If 'cdata' is a single character or byte or a wchar_t, returns + it as a string or unicode string. + + If 'cdata' is an enum, returns the value of the enumerator as a + string, or 'NUMBER' if the value is out of range. + """ + return self._backend.string(cdata, maxlen) + + def unpack(self, cdata, length): + """Unpack an array of C data of the given length, + returning a Python string/unicode/list. + + If 'cdata' is a pointer to 'char', returns a byte string. + It does not stop at the first null. This is equivalent to: + ffi.buffer(cdata, length)[:] + + If 'cdata' is a pointer to 'wchar_t', returns a unicode string. + 'length' is measured in wchar_t's; it is not the size in bytes. + + If 'cdata' is a pointer to anything else, returns a list of + 'length' items. This is a faster equivalent to: + [cdata[i] for i in range(length)] + """ + return self._backend.unpack(cdata, length) + + #def buffer(self, cdata, size=-1): + # """Return a read-write buffer object that references the raw C data + # pointed to by the given 'cdata'. The 'cdata' must be a pointer or + # an array. Can be passed to functions expecting a buffer, or directly + # manipulated with: + # + # buf[:] get a copy of it in a regular string, or + # buf[idx] as a single character + # buf[:] = ... + # buf[idx] = ... change the content + # """ + # note that 'buffer' is a type, set on this instance by __init__ + + def from_buffer(self, cdecl, python_buffer=_unspecified, + require_writable=False): + """Return a cdata of the given type pointing to the data of the + given Python object, which must support the buffer interface. + Note that this is not meant to be used on the built-in types + str or unicode (you can build 'char[]' arrays explicitly) + but only on objects containing large quantities of raw data + in some other format, like 'array.array' or numpy arrays. + + The first argument is optional and default to 'char[]'. + """ + if python_buffer is _unspecified: + cdecl, python_buffer = self.BCharA, cdecl + elif isinstance(cdecl, basestring): + cdecl = self._typeof(cdecl) + return self._backend.from_buffer(cdecl, python_buffer, + require_writable) + + def memmove(self, dest, src, n): + """ffi.memmove(dest, src, n) copies n bytes of memory from src to dest. + + Like the C function memmove(), the memory areas may overlap; + apart from that it behaves like the C function memcpy(). + + 'src' can be any cdata ptr or array, or any Python buffer object. + 'dest' can be any cdata ptr or array, or a writable Python buffer + object. The size to copy, 'n', is always measured in bytes. + + Unlike other methods, this one supports all Python buffer including + byte strings and bytearrays---but it still does not support + non-contiguous buffers. + """ + return self._backend.memmove(dest, src, n) + + def callback(self, cdecl, python_callable=None, error=None, onerror=None): + """Return a callback object or a decorator making such a + callback object. 'cdecl' must name a C function pointer type. + The callback invokes the specified 'python_callable' (which may + be provided either directly or via a decorator). Important: the + callback object must be manually kept alive for as long as the + callback may be invoked from the C level. + """ + def callback_decorator_wrap(python_callable): + if not callable(python_callable): + raise TypeError("the 'python_callable' argument " + "is not callable") + return self._backend.callback(cdecl, python_callable, + error, onerror) + if isinstance(cdecl, basestring): + cdecl = self._typeof(cdecl, consider_function_as_funcptr=True) + if python_callable is None: + return callback_decorator_wrap # decorator mode + else: + return callback_decorator_wrap(python_callable) # direct mode + + def getctype(self, cdecl, replace_with=''): + """Return a string giving the C type 'cdecl', which may be itself + a string or a object. If 'replace_with' is given, it gives + extra text to append (or insert for more complicated C types), like + a variable name, or '*' to get actually the C type 'pointer-to-cdecl'. + """ + if isinstance(cdecl, basestring): + cdecl = self._typeof(cdecl) + replace_with = replace_with.strip() + if (replace_with.startswith('*') + and '&[' in self._backend.getcname(cdecl, '&')): + replace_with = '(%s)' % replace_with + elif replace_with and not replace_with[0] in '[(': + replace_with = ' ' + replace_with + return self._backend.getcname(cdecl, replace_with) + + def gc(self, cdata, destructor, size=0): + """Return a new cdata object that points to the same + data. Later, when this new cdata object is garbage-collected, + 'destructor(old_cdata_object)' will be called. + + The optional 'size' gives an estimate of the size, used to + trigger the garbage collection more eagerly. So far only used + on PyPy. It tells the GC that the returned object keeps alive + roughly 'size' bytes of external memory. + """ + return self._backend.gcp(cdata, destructor, size) + + def _get_cached_btype(self, type): + assert self._lock.acquire(False) is False + # call me with the lock! + try: + BType = self._cached_btypes[type] + except KeyError: + finishlist = [] + BType = type.get_cached_btype(self, finishlist) + for type in finishlist: + type.finish_backend_type(self, finishlist) + return BType + + def verify(self, source='', tmpdir=None, **kwargs): + """Verify that the current ffi signatures compile on this + machine, and return a dynamic library object. The dynamic + library can be used to call functions and access global + variables declared in this 'ffi'. The library is compiled + by the C compiler: it gives you C-level API compatibility + (including calling macros). This is unlike 'ffi.dlopen()', + which requires binary compatibility in the signatures. + """ + from .verifier import Verifier, _caller_dir_pycache + # + # If set_unicode(True) was called, insert the UNICODE and + # _UNICODE macro declarations + if self._windows_unicode: + self._apply_windows_unicode(kwargs) + # + # Set the tmpdir here, and not in Verifier.__init__: it picks + # up the caller's directory, which we want to be the caller of + # ffi.verify(), as opposed to the caller of Veritier(). + tmpdir = tmpdir or _caller_dir_pycache() + # + # Make a Verifier() and use it to load the library. + self.verifier = Verifier(self, source, tmpdir, **kwargs) + lib = self.verifier.load_library() + # + # Save the loaded library for keep-alive purposes, even + # if the caller doesn't keep it alive itself (it should). + self._libraries.append(lib) + return lib + + def _get_errno(self): + return self._backend.get_errno() + def _set_errno(self, errno): + self._backend.set_errno(errno) + errno = property(_get_errno, _set_errno, None, + "the value of 'errno' from/to the C calls") + + def getwinerror(self, code=-1): + return self._backend.getwinerror(code) + + def _pointer_to(self, ctype): + with self._lock: + return model.pointer_cache(self, ctype) + + def addressof(self, cdata, *fields_or_indexes): + """Return the address of a . + If 'fields_or_indexes' are given, returns the address of that + field or array item in the structure or array, recursively in + case of nested structures. + """ + try: + ctype = self._backend.typeof(cdata) + except TypeError: + if '__addressof__' in type(cdata).__dict__: + return type(cdata).__addressof__(cdata, *fields_or_indexes) + raise + if fields_or_indexes: + ctype, offset = self._typeoffsetof(ctype, *fields_or_indexes) + else: + if ctype.kind == "pointer": + raise TypeError("addressof(pointer)") + offset = 0 + ctypeptr = self._pointer_to(ctype) + return self._backend.rawaddressof(ctypeptr, cdata, offset) + + def _typeoffsetof(self, ctype, field_or_index, *fields_or_indexes): + ctype, offset = self._backend.typeoffsetof(ctype, field_or_index) + for field1 in fields_or_indexes: + ctype, offset1 = self._backend.typeoffsetof(ctype, field1, 1) + offset += offset1 + return ctype, offset + + def include(self, ffi_to_include): + """Includes the typedefs, structs, unions and enums defined + in another FFI instance. Usage is similar to a #include in C, + where a part of the program might include types defined in + another part for its own usage. Note that the include() + method has no effect on functions, constants and global + variables, which must anyway be accessed directly from the + lib object returned by the original FFI instance. + """ + if not isinstance(ffi_to_include, FFI): + raise TypeError("ffi.include() expects an argument that is also of" + " type cffi.FFI, not %r" % ( + type(ffi_to_include).__name__,)) + if ffi_to_include is self: + raise ValueError("self.include(self)") + with ffi_to_include._lock: + with self._lock: + self._parser.include(ffi_to_include._parser) + self._cdefsources.append('[') + self._cdefsources.extend(ffi_to_include._cdefsources) + self._cdefsources.append(']') + self._included_ffis.append(ffi_to_include) + + def new_handle(self, x): + return self._backend.newp_handle(self.BVoidP, x) + + def from_handle(self, x): + return self._backend.from_handle(x) + + def release(self, x): + self._backend.release(x) + + def set_unicode(self, enabled_flag): + """Windows: if 'enabled_flag' is True, enable the UNICODE and + _UNICODE defines in C, and declare the types like TCHAR and LPTCSTR + to be (pointers to) wchar_t. If 'enabled_flag' is False, + declare these types to be (pointers to) plain 8-bit characters. + This is mostly for backward compatibility; you usually want True. + """ + if self._windows_unicode is not None: + raise ValueError("set_unicode() can only be called once") + enabled_flag = bool(enabled_flag) + if enabled_flag: + self.cdef("typedef wchar_t TBYTE;" + "typedef wchar_t TCHAR;" + "typedef const wchar_t *LPCTSTR;" + "typedef const wchar_t *PCTSTR;" + "typedef wchar_t *LPTSTR;" + "typedef wchar_t *PTSTR;" + "typedef TBYTE *PTBYTE;" + "typedef TCHAR *PTCHAR;") + else: + self.cdef("typedef char TBYTE;" + "typedef char TCHAR;" + "typedef const char *LPCTSTR;" + "typedef const char *PCTSTR;" + "typedef char *LPTSTR;" + "typedef char *PTSTR;" + "typedef TBYTE *PTBYTE;" + "typedef TCHAR *PTCHAR;") + self._windows_unicode = enabled_flag + + def _apply_windows_unicode(self, kwds): + defmacros = kwds.get('define_macros', ()) + if not isinstance(defmacros, (list, tuple)): + raise TypeError("'define_macros' must be a list or tuple") + defmacros = list(defmacros) + [('UNICODE', '1'), + ('_UNICODE', '1')] + kwds['define_macros'] = defmacros + + def _apply_embedding_fix(self, kwds): + # must include an argument like "-lpython2.7" for the compiler + def ensure(key, value): + lst = kwds.setdefault(key, []) + if value not in lst: + lst.append(value) + # + if '__pypy__' in sys.builtin_module_names: + import os + if sys.platform == "win32": + # we need 'libpypy-c.lib'. Current distributions of + # pypy (>= 4.1) contain it as 'libs/python27.lib'. + pythonlib = "python{0[0]}{0[1]}".format(sys.version_info) + if hasattr(sys, 'prefix'): + ensure('library_dirs', os.path.join(sys.prefix, 'libs')) + else: + # we need 'libpypy-c.{so,dylib}', which should be by + # default located in 'sys.prefix/bin' for installed + # systems. + if sys.version_info < (3,): + pythonlib = "pypy-c" + else: + pythonlib = "pypy3-c" + if hasattr(sys, 'prefix'): + ensure('library_dirs', os.path.join(sys.prefix, 'bin')) + # On uninstalled pypy's, the libpypy-c is typically found in + # .../pypy/goal/. + if hasattr(sys, 'prefix'): + ensure('library_dirs', os.path.join(sys.prefix, 'pypy', 'goal')) + else: + if sys.platform == "win32": + template = "python%d%d" + if hasattr(sys, 'gettotalrefcount'): + template += '_d' + else: + try: + import sysconfig + except ImportError: # 2.6 + from distutils import sysconfig + template = "python%d.%d" + if sysconfig.get_config_var('DEBUG_EXT'): + template += sysconfig.get_config_var('DEBUG_EXT') + pythonlib = (template % + (sys.hexversion >> 24, (sys.hexversion >> 16) & 0xff)) + if hasattr(sys, 'abiflags'): + pythonlib += sys.abiflags + ensure('libraries', pythonlib) + if sys.platform == "win32": + ensure('extra_link_args', '/MANIFEST') + + def set_source(self, module_name, source, source_extension='.c', **kwds): + import os + if hasattr(self, '_assigned_source'): + raise ValueError("set_source() cannot be called several times " + "per ffi object") + if not isinstance(module_name, basestring): + raise TypeError("'module_name' must be a string") + if os.sep in module_name or (os.altsep and os.altsep in module_name): + raise ValueError("'module_name' must not contain '/': use a dotted " + "name to make a 'package.module' location") + self._assigned_source = (str(module_name), source, + source_extension, kwds) + + def set_source_pkgconfig(self, module_name, pkgconfig_libs, source, + source_extension='.c', **kwds): + from . import pkgconfig + if not isinstance(pkgconfig_libs, list): + raise TypeError("the pkgconfig_libs argument must be a list " + "of package names") + kwds2 = pkgconfig.flags_from_pkgconfig(pkgconfig_libs) + pkgconfig.merge_flags(kwds, kwds2) + self.set_source(module_name, source, source_extension, **kwds) + + def distutils_extension(self, tmpdir='build', verbose=True): + from distutils.dir_util import mkpath + from .recompiler import recompile + # + if not hasattr(self, '_assigned_source'): + if hasattr(self, 'verifier'): # fallback, 'tmpdir' ignored + return self.verifier.get_extension() + raise ValueError("set_source() must be called before" + " distutils_extension()") + module_name, source, source_extension, kwds = self._assigned_source + if source is None: + raise TypeError("distutils_extension() is only for C extension " + "modules, not for dlopen()-style pure Python " + "modules") + mkpath(tmpdir) + ext, updated = recompile(self, module_name, + source, tmpdir=tmpdir, extradir=tmpdir, + source_extension=source_extension, + call_c_compiler=False, **kwds) + if verbose: + if updated: + sys.stderr.write("regenerated: %r\n" % (ext.sources[0],)) + else: + sys.stderr.write("not modified: %r\n" % (ext.sources[0],)) + return ext + + def emit_c_code(self, filename): + from .recompiler import recompile + # + if not hasattr(self, '_assigned_source'): + raise ValueError("set_source() must be called before emit_c_code()") + module_name, source, source_extension, kwds = self._assigned_source + if source is None: + raise TypeError("emit_c_code() is only for C extension modules, " + "not for dlopen()-style pure Python modules") + recompile(self, module_name, source, + c_file=filename, call_c_compiler=False, **kwds) + + def emit_python_code(self, filename): + from .recompiler import recompile + # + if not hasattr(self, '_assigned_source'): + raise ValueError("set_source() must be called before emit_c_code()") + module_name, source, source_extension, kwds = self._assigned_source + if source is not None: + raise TypeError("emit_python_code() is only for dlopen()-style " + "pure Python modules, not for C extension modules") + recompile(self, module_name, source, + c_file=filename, call_c_compiler=False, **kwds) + + def compile(self, tmpdir='.', verbose=0, target=None, debug=None): + """The 'target' argument gives the final file name of the + compiled DLL. Use '*' to force distutils' choice, suitable for + regular CPython C API modules. Use a file name ending in '.*' + to ask for the system's default extension for dynamic libraries + (.so/.dll/.dylib). + + The default is '*' when building a non-embedded C API extension, + and (module_name + '.*') when building an embedded library. + """ + from .recompiler import recompile + # + if not hasattr(self, '_assigned_source'): + raise ValueError("set_source() must be called before compile()") + module_name, source, source_extension, kwds = self._assigned_source + return recompile(self, module_name, source, tmpdir=tmpdir, + target=target, source_extension=source_extension, + compiler_verbose=verbose, debug=debug, **kwds) + + def init_once(self, func, tag): + # Read _init_once_cache[tag], which is either (False, lock) if + # we're calling the function now in some thread, or (True, result). + # Don't call setdefault() in most cases, to avoid allocating and + # immediately freeing a lock; but still use setdefaut() to avoid + # races. + try: + x = self._init_once_cache[tag] + except KeyError: + x = self._init_once_cache.setdefault(tag, (False, allocate_lock())) + # Common case: we got (True, result), so we return the result. + if x[0]: + return x[1] + # Else, it's a lock. Acquire it to serialize the following tests. + with x[1]: + # Read again from _init_once_cache the current status. + x = self._init_once_cache[tag] + if x[0]: + return x[1] + # Call the function and store the result back. + result = func() + self._init_once_cache[tag] = (True, result) + return result + + def embedding_init_code(self, pysource): + if self._embedding: + raise ValueError("embedding_init_code() can only be called once") + # fix 'pysource' before it gets dumped into the C file: + # - remove empty lines at the beginning, so it starts at "line 1" + # - dedent, if all non-empty lines are indented + # - check for SyntaxErrors + import re + match = re.match(r'\s*\n', pysource) + if match: + pysource = pysource[match.end():] + lines = pysource.splitlines() or [''] + prefix = re.match(r'\s*', lines[0]).group() + for i in range(1, len(lines)): + line = lines[i] + if line.rstrip(): + while not line.startswith(prefix): + prefix = prefix[:-1] + i = len(prefix) + lines = [line[i:]+'\n' for line in lines] + pysource = ''.join(lines) + # + compile(pysource, "cffi_init", "exec") + # + self._embedding = pysource + + def def_extern(self, *args, **kwds): + raise ValueError("ffi.def_extern() is only available on API-mode FFI " + "objects") + + def list_types(self): + """Returns the user type names known to this FFI instance. + This returns a tuple containing three lists of names: + (typedef_names, names_of_structs, names_of_unions) + """ + typedefs = [] + structs = [] + unions = [] + for key in self._parser._declarations: + if key.startswith('typedef '): + typedefs.append(key[8:]) + elif key.startswith('struct '): + structs.append(key[7:]) + elif key.startswith('union '): + unions.append(key[6:]) + typedefs.sort() + structs.sort() + unions.sort() + return (typedefs, structs, unions) + + +def _load_backend_lib(backend, name, flags): + import os + if name is None: + if sys.platform != "win32": + return backend.load_library(None, flags) + name = "c" # Windows: load_library(None) fails, but this works + # on Python 2 (backward compatibility hack only) + first_error = None + if '.' in name or '/' in name or os.sep in name: + try: + return backend.load_library(name, flags) + except OSError as e: + first_error = e + import ctypes.util + path = ctypes.util.find_library(name) + if path is None: + if name == "c" and sys.platform == "win32" and sys.version_info >= (3,): + raise OSError("dlopen(None) cannot work on Windows for Python 3 " + "(see http://bugs.python.org/issue23606)") + msg = ("ctypes.util.find_library() did not manage " + "to locate a library called %r" % (name,)) + if first_error is not None: + msg = "%s. Additionally, %s" % (first_error, msg) + raise OSError(msg) + return backend.load_library(path, flags) + +def _make_ffi_library(ffi, libname, flags): + backend = ffi._backend + backendlib = _load_backend_lib(backend, libname, flags) + # + def accessor_function(name): + key = 'function ' + name + tp, _ = ffi._parser._declarations[key] + BType = ffi._get_cached_btype(tp) + value = backendlib.load_function(BType, name) + library.__dict__[name] = value + # + def accessor_variable(name): + key = 'variable ' + name + tp, _ = ffi._parser._declarations[key] + BType = ffi._get_cached_btype(tp) + read_variable = backendlib.read_variable + write_variable = backendlib.write_variable + setattr(FFILibrary, name, property( + lambda self: read_variable(BType, name), + lambda self, value: write_variable(BType, name, value))) + # + def addressof_var(name): + try: + return addr_variables[name] + except KeyError: + with ffi._lock: + if name not in addr_variables: + key = 'variable ' + name + tp, _ = ffi._parser._declarations[key] + BType = ffi._get_cached_btype(tp) + if BType.kind != 'array': + BType = model.pointer_cache(ffi, BType) + p = backendlib.load_function(BType, name) + addr_variables[name] = p + return addr_variables[name] + # + def accessor_constant(name): + raise NotImplementedError("non-integer constant '%s' cannot be " + "accessed from a dlopen() library" % (name,)) + # + def accessor_int_constant(name): + library.__dict__[name] = ffi._parser._int_constants[name] + # + accessors = {} + accessors_version = [False] + addr_variables = {} + # + def update_accessors(): + if accessors_version[0] is ffi._cdef_version: + return + # + for key, (tp, _) in ffi._parser._declarations.items(): + if not isinstance(tp, model.EnumType): + tag, name = key.split(' ', 1) + if tag == 'function': + accessors[name] = accessor_function + elif tag == 'variable': + accessors[name] = accessor_variable + elif tag == 'constant': + accessors[name] = accessor_constant + else: + for i, enumname in enumerate(tp.enumerators): + def accessor_enum(name, tp=tp, i=i): + tp.check_not_partial() + library.__dict__[name] = tp.enumvalues[i] + accessors[enumname] = accessor_enum + for name in ffi._parser._int_constants: + accessors.setdefault(name, accessor_int_constant) + accessors_version[0] = ffi._cdef_version + # + def make_accessor(name): + with ffi._lock: + if name in library.__dict__ or name in FFILibrary.__dict__: + return # added by another thread while waiting for the lock + if name not in accessors: + update_accessors() + if name not in accessors: + raise AttributeError(name) + accessors[name](name) + # + class FFILibrary(object): + def __getattr__(self, name): + make_accessor(name) + return getattr(self, name) + def __setattr__(self, name, value): + try: + property = getattr(self.__class__, name) + except AttributeError: + make_accessor(name) + setattr(self, name, value) + else: + property.__set__(self, value) + def __dir__(self): + with ffi._lock: + update_accessors() + return accessors.keys() + def __addressof__(self, name): + if name in library.__dict__: + return library.__dict__[name] + if name in FFILibrary.__dict__: + return addressof_var(name) + make_accessor(name) + if name in library.__dict__: + return library.__dict__[name] + if name in FFILibrary.__dict__: + return addressof_var(name) + raise AttributeError("cffi library has no function or " + "global variable named '%s'" % (name,)) + def __cffi_close__(self): + backendlib.close_lib() + self.__dict__.clear() + # + if libname is not None: + try: + if not isinstance(libname, str): # unicode, on Python 2 + libname = libname.encode('utf-8') + FFILibrary.__name__ = 'FFILibrary_%s' % libname + except UnicodeError: + pass + library = FFILibrary() + return library, library.__dict__ + +def _builtin_function_type(func): + # a hack to make at least ffi.typeof(builtin_function) work, + # if the builtin function was obtained by 'vengine_cpy'. + import sys + try: + module = sys.modules[func.__module__] + ffi = module._cffi_original_ffi + types_of_builtin_funcs = module._cffi_types_of_builtin_funcs + tp = types_of_builtin_funcs[func] + except (KeyError, AttributeError, TypeError): + return None + else: + with ffi._lock: + return ffi._get_cached_btype(tp) diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/cffi/backend_ctypes.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/cffi/backend_ctypes.py new file mode 100644 index 00000000..679ae057 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/cffi/backend_ctypes.py @@ -0,0 +1,1121 @@ +import ctypes, ctypes.util, operator, sys +from . import model + +if sys.version_info < (3,): + bytechr = chr +else: + unicode = str + long = int + xrange = range + bytechr = lambda num: bytes([num]) + +class CTypesType(type): + pass + +class CTypesData(object): + __metaclass__ = CTypesType + __slots__ = ['__weakref__'] + __name__ = '' + + def __init__(self, *args): + raise TypeError("cannot instantiate %r" % (self.__class__,)) + + @classmethod + def _newp(cls, init): + raise TypeError("expected a pointer or array ctype, got '%s'" + % (cls._get_c_name(),)) + + @staticmethod + def _to_ctypes(value): + raise TypeError + + @classmethod + def _arg_to_ctypes(cls, *value): + try: + ctype = cls._ctype + except AttributeError: + raise TypeError("cannot create an instance of %r" % (cls,)) + if value: + res = cls._to_ctypes(*value) + if not isinstance(res, ctype): + res = cls._ctype(res) + else: + res = cls._ctype() + return res + + @classmethod + def _create_ctype_obj(cls, init): + if init is None: + return cls._arg_to_ctypes() + else: + return cls._arg_to_ctypes(init) + + @staticmethod + def _from_ctypes(ctypes_value): + raise TypeError + + @classmethod + def _get_c_name(cls, replace_with=''): + return cls._reftypename.replace(' &', replace_with) + + @classmethod + def _fix_class(cls): + cls.__name__ = 'CData<%s>' % (cls._get_c_name(),) + cls.__qualname__ = 'CData<%s>' % (cls._get_c_name(),) + cls.__module__ = 'ffi' + + def _get_own_repr(self): + raise NotImplementedError + + def _addr_repr(self, address): + if address == 0: + return 'NULL' + else: + if address < 0: + address += 1 << (8*ctypes.sizeof(ctypes.c_void_p)) + return '0x%x' % address + + def __repr__(self, c_name=None): + own = self._get_own_repr() + return '' % (c_name or self._get_c_name(), own) + + def _convert_to_address(self, BClass): + if BClass is None: + raise TypeError("cannot convert %r to an address" % ( + self._get_c_name(),)) + else: + raise TypeError("cannot convert %r to %r" % ( + self._get_c_name(), BClass._get_c_name())) + + @classmethod + def _get_size(cls): + return ctypes.sizeof(cls._ctype) + + def _get_size_of_instance(self): + return ctypes.sizeof(self._ctype) + + @classmethod + def _cast_from(cls, source): + raise TypeError("cannot cast to %r" % (cls._get_c_name(),)) + + def _cast_to_integer(self): + return self._convert_to_address(None) + + @classmethod + def _alignment(cls): + return ctypes.alignment(cls._ctype) + + def __iter__(self): + raise TypeError("cdata %r does not support iteration" % ( + self._get_c_name()),) + + def _make_cmp(name): + cmpfunc = getattr(operator, name) + def cmp(self, other): + v_is_ptr = not isinstance(self, CTypesGenericPrimitive) + w_is_ptr = (isinstance(other, CTypesData) and + not isinstance(other, CTypesGenericPrimitive)) + if v_is_ptr and w_is_ptr: + return cmpfunc(self._convert_to_address(None), + other._convert_to_address(None)) + elif v_is_ptr or w_is_ptr: + return NotImplemented + else: + if isinstance(self, CTypesGenericPrimitive): + self = self._value + if isinstance(other, CTypesGenericPrimitive): + other = other._value + return cmpfunc(self, other) + cmp.func_name = name + return cmp + + __eq__ = _make_cmp('__eq__') + __ne__ = _make_cmp('__ne__') + __lt__ = _make_cmp('__lt__') + __le__ = _make_cmp('__le__') + __gt__ = _make_cmp('__gt__') + __ge__ = _make_cmp('__ge__') + + def __hash__(self): + return hash(self._convert_to_address(None)) + + def _to_string(self, maxlen): + raise TypeError("string(): %r" % (self,)) + + +class CTypesGenericPrimitive(CTypesData): + __slots__ = [] + + def __hash__(self): + return hash(self._value) + + def _get_own_repr(self): + return repr(self._from_ctypes(self._value)) + + +class CTypesGenericArray(CTypesData): + __slots__ = [] + + @classmethod + def _newp(cls, init): + return cls(init) + + def __iter__(self): + for i in xrange(len(self)): + yield self[i] + + def _get_own_repr(self): + return self._addr_repr(ctypes.addressof(self._blob)) + + +class CTypesGenericPtr(CTypesData): + __slots__ = ['_address', '_as_ctype_ptr'] + _automatic_casts = False + kind = "pointer" + + @classmethod + def _newp(cls, init): + return cls(init) + + @classmethod + def _cast_from(cls, source): + if source is None: + address = 0 + elif isinstance(source, CTypesData): + address = source._cast_to_integer() + elif isinstance(source, (int, long)): + address = source + else: + raise TypeError("bad type for cast to %r: %r" % + (cls, type(source).__name__)) + return cls._new_pointer_at(address) + + @classmethod + def _new_pointer_at(cls, address): + self = cls.__new__(cls) + self._address = address + self._as_ctype_ptr = ctypes.cast(address, cls._ctype) + return self + + def _get_own_repr(self): + try: + return self._addr_repr(self._address) + except AttributeError: + return '???' + + def _cast_to_integer(self): + return self._address + + def __nonzero__(self): + return bool(self._address) + __bool__ = __nonzero__ + + @classmethod + def _to_ctypes(cls, value): + if not isinstance(value, CTypesData): + raise TypeError("unexpected %s object" % type(value).__name__) + address = value._convert_to_address(cls) + return ctypes.cast(address, cls._ctype) + + @classmethod + def _from_ctypes(cls, ctypes_ptr): + address = ctypes.cast(ctypes_ptr, ctypes.c_void_p).value or 0 + return cls._new_pointer_at(address) + + @classmethod + def _initialize(cls, ctypes_ptr, value): + if value: + ctypes_ptr.contents = cls._to_ctypes(value).contents + + def _convert_to_address(self, BClass): + if (BClass in (self.__class__, None) or BClass._automatic_casts + or self._automatic_casts): + return self._address + else: + return CTypesData._convert_to_address(self, BClass) + + +class CTypesBaseStructOrUnion(CTypesData): + __slots__ = ['_blob'] + + @classmethod + def _create_ctype_obj(cls, init): + # may be overridden + raise TypeError("cannot instantiate opaque type %s" % (cls,)) + + def _get_own_repr(self): + return self._addr_repr(ctypes.addressof(self._blob)) + + @classmethod + def _offsetof(cls, fieldname): + return getattr(cls._ctype, fieldname).offset + + def _convert_to_address(self, BClass): + if getattr(BClass, '_BItem', None) is self.__class__: + return ctypes.addressof(self._blob) + else: + return CTypesData._convert_to_address(self, BClass) + + @classmethod + def _from_ctypes(cls, ctypes_struct_or_union): + self = cls.__new__(cls) + self._blob = ctypes_struct_or_union + return self + + @classmethod + def _to_ctypes(cls, value): + return value._blob + + def __repr__(self, c_name=None): + return CTypesData.__repr__(self, c_name or self._get_c_name(' &')) + + +class CTypesBackend(object): + + PRIMITIVE_TYPES = { + 'char': ctypes.c_char, + 'short': ctypes.c_short, + 'int': ctypes.c_int, + 'long': ctypes.c_long, + 'long long': ctypes.c_longlong, + 'signed char': ctypes.c_byte, + 'unsigned char': ctypes.c_ubyte, + 'unsigned short': ctypes.c_ushort, + 'unsigned int': ctypes.c_uint, + 'unsigned long': ctypes.c_ulong, + 'unsigned long long': ctypes.c_ulonglong, + 'float': ctypes.c_float, + 'double': ctypes.c_double, + '_Bool': ctypes.c_bool, + } + + for _name in ['unsigned long long', 'unsigned long', + 'unsigned int', 'unsigned short', 'unsigned char']: + _size = ctypes.sizeof(PRIMITIVE_TYPES[_name]) + PRIMITIVE_TYPES['uint%d_t' % (8*_size)] = PRIMITIVE_TYPES[_name] + if _size == ctypes.sizeof(ctypes.c_void_p): + PRIMITIVE_TYPES['uintptr_t'] = PRIMITIVE_TYPES[_name] + if _size == ctypes.sizeof(ctypes.c_size_t): + PRIMITIVE_TYPES['size_t'] = PRIMITIVE_TYPES[_name] + + for _name in ['long long', 'long', 'int', 'short', 'signed char']: + _size = ctypes.sizeof(PRIMITIVE_TYPES[_name]) + PRIMITIVE_TYPES['int%d_t' % (8*_size)] = PRIMITIVE_TYPES[_name] + if _size == ctypes.sizeof(ctypes.c_void_p): + PRIMITIVE_TYPES['intptr_t'] = PRIMITIVE_TYPES[_name] + PRIMITIVE_TYPES['ptrdiff_t'] = PRIMITIVE_TYPES[_name] + if _size == ctypes.sizeof(ctypes.c_size_t): + PRIMITIVE_TYPES['ssize_t'] = PRIMITIVE_TYPES[_name] + + + def __init__(self): + self.RTLD_LAZY = 0 # not supported anyway by ctypes + self.RTLD_NOW = 0 + self.RTLD_GLOBAL = ctypes.RTLD_GLOBAL + self.RTLD_LOCAL = ctypes.RTLD_LOCAL + + def set_ffi(self, ffi): + self.ffi = ffi + + def _get_types(self): + return CTypesData, CTypesType + + def load_library(self, path, flags=0): + cdll = ctypes.CDLL(path, flags) + return CTypesLibrary(self, cdll) + + def new_void_type(self): + class CTypesVoid(CTypesData): + __slots__ = [] + _reftypename = 'void &' + @staticmethod + def _from_ctypes(novalue): + return None + @staticmethod + def _to_ctypes(novalue): + if novalue is not None: + raise TypeError("None expected, got %s object" % + (type(novalue).__name__,)) + return None + CTypesVoid._fix_class() + return CTypesVoid + + def new_primitive_type(self, name): + if name == 'wchar_t': + raise NotImplementedError(name) + ctype = self.PRIMITIVE_TYPES[name] + if name == 'char': + kind = 'char' + elif name in ('float', 'double'): + kind = 'float' + else: + if name in ('signed char', 'unsigned char'): + kind = 'byte' + elif name == '_Bool': + kind = 'bool' + else: + kind = 'int' + is_signed = (ctype(-1).value == -1) + # + def _cast_source_to_int(source): + if isinstance(source, (int, long, float)): + source = int(source) + elif isinstance(source, CTypesData): + source = source._cast_to_integer() + elif isinstance(source, bytes): + source = ord(source) + elif source is None: + source = 0 + else: + raise TypeError("bad type for cast to %r: %r" % + (CTypesPrimitive, type(source).__name__)) + return source + # + kind1 = kind + class CTypesPrimitive(CTypesGenericPrimitive): + __slots__ = ['_value'] + _ctype = ctype + _reftypename = '%s &' % name + kind = kind1 + + def __init__(self, value): + self._value = value + + @staticmethod + def _create_ctype_obj(init): + if init is None: + return ctype() + return ctype(CTypesPrimitive._to_ctypes(init)) + + if kind == 'int' or kind == 'byte': + @classmethod + def _cast_from(cls, source): + source = _cast_source_to_int(source) + source = ctype(source).value # cast within range + return cls(source) + def __int__(self): + return self._value + + if kind == 'bool': + @classmethod + def _cast_from(cls, source): + if not isinstance(source, (int, long, float)): + source = _cast_source_to_int(source) + return cls(bool(source)) + def __int__(self): + return self._value + + if kind == 'char': + @classmethod + def _cast_from(cls, source): + source = _cast_source_to_int(source) + source = bytechr(source & 0xFF) + return cls(source) + def __int__(self): + return ord(self._value) + + if kind == 'float': + @classmethod + def _cast_from(cls, source): + if isinstance(source, float): + pass + elif isinstance(source, CTypesGenericPrimitive): + if hasattr(source, '__float__'): + source = float(source) + else: + source = int(source) + else: + source = _cast_source_to_int(source) + source = ctype(source).value # fix precision + return cls(source) + def __int__(self): + return int(self._value) + def __float__(self): + return self._value + + _cast_to_integer = __int__ + + if kind == 'int' or kind == 'byte' or kind == 'bool': + @staticmethod + def _to_ctypes(x): + if not isinstance(x, (int, long)): + if isinstance(x, CTypesData): + x = int(x) + else: + raise TypeError("integer expected, got %s" % + type(x).__name__) + if ctype(x).value != x: + if not is_signed and x < 0: + raise OverflowError("%s: negative integer" % name) + else: + raise OverflowError("%s: integer out of bounds" + % name) + return x + + if kind == 'char': + @staticmethod + def _to_ctypes(x): + if isinstance(x, bytes) and len(x) == 1: + return x + if isinstance(x, CTypesPrimitive): # > + return x._value + raise TypeError("character expected, got %s" % + type(x).__name__) + def __nonzero__(self): + return ord(self._value) != 0 + else: + def __nonzero__(self): + return self._value != 0 + __bool__ = __nonzero__ + + if kind == 'float': + @staticmethod + def _to_ctypes(x): + if not isinstance(x, (int, long, float, CTypesData)): + raise TypeError("float expected, got %s" % + type(x).__name__) + return ctype(x).value + + @staticmethod + def _from_ctypes(value): + return getattr(value, 'value', value) + + @staticmethod + def _initialize(blob, init): + blob.value = CTypesPrimitive._to_ctypes(init) + + if kind == 'char': + def _to_string(self, maxlen): + return self._value + if kind == 'byte': + def _to_string(self, maxlen): + return chr(self._value & 0xff) + # + CTypesPrimitive._fix_class() + return CTypesPrimitive + + def new_pointer_type(self, BItem): + getbtype = self.ffi._get_cached_btype + if BItem is getbtype(model.PrimitiveType('char')): + kind = 'charp' + elif BItem in (getbtype(model.PrimitiveType('signed char')), + getbtype(model.PrimitiveType('unsigned char'))): + kind = 'bytep' + elif BItem is getbtype(model.void_type): + kind = 'voidp' + else: + kind = 'generic' + # + class CTypesPtr(CTypesGenericPtr): + __slots__ = ['_own'] + if kind == 'charp': + __slots__ += ['__as_strbuf'] + _BItem = BItem + if hasattr(BItem, '_ctype'): + _ctype = ctypes.POINTER(BItem._ctype) + _bitem_size = ctypes.sizeof(BItem._ctype) + else: + _ctype = ctypes.c_void_p + if issubclass(BItem, CTypesGenericArray): + _reftypename = BItem._get_c_name('(* &)') + else: + _reftypename = BItem._get_c_name(' * &') + + def __init__(self, init): + ctypeobj = BItem._create_ctype_obj(init) + if kind == 'charp': + self.__as_strbuf = ctypes.create_string_buffer( + ctypeobj.value + b'\x00') + self._as_ctype_ptr = ctypes.cast( + self.__as_strbuf, self._ctype) + else: + self._as_ctype_ptr = ctypes.pointer(ctypeobj) + self._address = ctypes.cast(self._as_ctype_ptr, + ctypes.c_void_p).value + self._own = True + + def __add__(self, other): + if isinstance(other, (int, long)): + return self._new_pointer_at(self._address + + other * self._bitem_size) + else: + return NotImplemented + + def __sub__(self, other): + if isinstance(other, (int, long)): + return self._new_pointer_at(self._address - + other * self._bitem_size) + elif type(self) is type(other): + return (self._address - other._address) // self._bitem_size + else: + return NotImplemented + + def __getitem__(self, index): + if getattr(self, '_own', False) and index != 0: + raise IndexError + return BItem._from_ctypes(self._as_ctype_ptr[index]) + + def __setitem__(self, index, value): + self._as_ctype_ptr[index] = BItem._to_ctypes(value) + + if kind == 'charp' or kind == 'voidp': + @classmethod + def _arg_to_ctypes(cls, *value): + if value and isinstance(value[0], bytes): + return ctypes.c_char_p(value[0]) + else: + return super(CTypesPtr, cls)._arg_to_ctypes(*value) + + if kind == 'charp' or kind == 'bytep': + def _to_string(self, maxlen): + if maxlen < 0: + maxlen = sys.maxsize + p = ctypes.cast(self._as_ctype_ptr, + ctypes.POINTER(ctypes.c_char)) + n = 0 + while n < maxlen and p[n] != b'\x00': + n += 1 + return b''.join([p[i] for i in range(n)]) + + def _get_own_repr(self): + if getattr(self, '_own', False): + return 'owning %d bytes' % ( + ctypes.sizeof(self._as_ctype_ptr.contents),) + return super(CTypesPtr, self)._get_own_repr() + # + if (BItem is self.ffi._get_cached_btype(model.void_type) or + BItem is self.ffi._get_cached_btype(model.PrimitiveType('char'))): + CTypesPtr._automatic_casts = True + # + CTypesPtr._fix_class() + return CTypesPtr + + def new_array_type(self, CTypesPtr, length): + if length is None: + brackets = ' &[]' + else: + brackets = ' &[%d]' % length + BItem = CTypesPtr._BItem + getbtype = self.ffi._get_cached_btype + if BItem is getbtype(model.PrimitiveType('char')): + kind = 'char' + elif BItem in (getbtype(model.PrimitiveType('signed char')), + getbtype(model.PrimitiveType('unsigned char'))): + kind = 'byte' + else: + kind = 'generic' + # + class CTypesArray(CTypesGenericArray): + __slots__ = ['_blob', '_own'] + if length is not None: + _ctype = BItem._ctype * length + else: + __slots__.append('_ctype') + _reftypename = BItem._get_c_name(brackets) + _declared_length = length + _CTPtr = CTypesPtr + + def __init__(self, init): + if length is None: + if isinstance(init, (int, long)): + len1 = init + init = None + elif kind == 'char' and isinstance(init, bytes): + len1 = len(init) + 1 # extra null + else: + init = tuple(init) + len1 = len(init) + self._ctype = BItem._ctype * len1 + self._blob = self._ctype() + self._own = True + if init is not None: + self._initialize(self._blob, init) + + @staticmethod + def _initialize(blob, init): + if isinstance(init, bytes): + init = [init[i:i+1] for i in range(len(init))] + else: + if isinstance(init, CTypesGenericArray): + if (len(init) != len(blob) or + not isinstance(init, CTypesArray)): + raise TypeError("length/type mismatch: %s" % (init,)) + init = tuple(init) + if len(init) > len(blob): + raise IndexError("too many initializers") + addr = ctypes.cast(blob, ctypes.c_void_p).value + PTR = ctypes.POINTER(BItem._ctype) + itemsize = ctypes.sizeof(BItem._ctype) + for i, value in enumerate(init): + p = ctypes.cast(addr + i * itemsize, PTR) + BItem._initialize(p.contents, value) + + def __len__(self): + return len(self._blob) + + def __getitem__(self, index): + if not (0 <= index < len(self._blob)): + raise IndexError + return BItem._from_ctypes(self._blob[index]) + + def __setitem__(self, index, value): + if not (0 <= index < len(self._blob)): + raise IndexError + self._blob[index] = BItem._to_ctypes(value) + + if kind == 'char' or kind == 'byte': + def _to_string(self, maxlen): + if maxlen < 0: + maxlen = len(self._blob) + p = ctypes.cast(self._blob, + ctypes.POINTER(ctypes.c_char)) + n = 0 + while n < maxlen and p[n] != b'\x00': + n += 1 + return b''.join([p[i] for i in range(n)]) + + def _get_own_repr(self): + if getattr(self, '_own', False): + return 'owning %d bytes' % (ctypes.sizeof(self._blob),) + return super(CTypesArray, self)._get_own_repr() + + def _convert_to_address(self, BClass): + if BClass in (CTypesPtr, None) or BClass._automatic_casts: + return ctypes.addressof(self._blob) + else: + return CTypesData._convert_to_address(self, BClass) + + @staticmethod + def _from_ctypes(ctypes_array): + self = CTypesArray.__new__(CTypesArray) + self._blob = ctypes_array + return self + + @staticmethod + def _arg_to_ctypes(value): + return CTypesPtr._arg_to_ctypes(value) + + def __add__(self, other): + if isinstance(other, (int, long)): + return CTypesPtr._new_pointer_at( + ctypes.addressof(self._blob) + + other * ctypes.sizeof(BItem._ctype)) + else: + return NotImplemented + + @classmethod + def _cast_from(cls, source): + raise NotImplementedError("casting to %r" % ( + cls._get_c_name(),)) + # + CTypesArray._fix_class() + return CTypesArray + + def _new_struct_or_union(self, kind, name, base_ctypes_class): + # + class struct_or_union(base_ctypes_class): + pass + struct_or_union.__name__ = '%s_%s' % (kind, name) + kind1 = kind + # + class CTypesStructOrUnion(CTypesBaseStructOrUnion): + __slots__ = ['_blob'] + _ctype = struct_or_union + _reftypename = '%s &' % (name,) + _kind = kind = kind1 + # + CTypesStructOrUnion._fix_class() + return CTypesStructOrUnion + + def new_struct_type(self, name): + return self._new_struct_or_union('struct', name, ctypes.Structure) + + def new_union_type(self, name): + return self._new_struct_or_union('union', name, ctypes.Union) + + def complete_struct_or_union(self, CTypesStructOrUnion, fields, tp, + totalsize=-1, totalalignment=-1, sflags=0, + pack=0): + if totalsize >= 0 or totalalignment >= 0: + raise NotImplementedError("the ctypes backend of CFFI does not support " + "structures completed by verify(); please " + "compile and install the _cffi_backend module.") + struct_or_union = CTypesStructOrUnion._ctype + fnames = [fname for (fname, BField, bitsize) in fields] + btypes = [BField for (fname, BField, bitsize) in fields] + bitfields = [bitsize for (fname, BField, bitsize) in fields] + # + bfield_types = {} + cfields = [] + for (fname, BField, bitsize) in fields: + if bitsize < 0: + cfields.append((fname, BField._ctype)) + bfield_types[fname] = BField + else: + cfields.append((fname, BField._ctype, bitsize)) + bfield_types[fname] = Ellipsis + if sflags & 8: + struct_or_union._pack_ = 1 + elif pack: + struct_or_union._pack_ = pack + struct_or_union._fields_ = cfields + CTypesStructOrUnion._bfield_types = bfield_types + # + @staticmethod + def _create_ctype_obj(init): + result = struct_or_union() + if init is not None: + initialize(result, init) + return result + CTypesStructOrUnion._create_ctype_obj = _create_ctype_obj + # + def initialize(blob, init): + if is_union: + if len(init) > 1: + raise ValueError("union initializer: %d items given, but " + "only one supported (use a dict if needed)" + % (len(init),)) + if not isinstance(init, dict): + if isinstance(init, (bytes, unicode)): + raise TypeError("union initializer: got a str") + init = tuple(init) + if len(init) > len(fnames): + raise ValueError("too many values for %s initializer" % + CTypesStructOrUnion._get_c_name()) + init = dict(zip(fnames, init)) + addr = ctypes.addressof(blob) + for fname, value in init.items(): + BField, bitsize = name2fieldtype[fname] + assert bitsize < 0, \ + "not implemented: initializer with bit fields" + offset = CTypesStructOrUnion._offsetof(fname) + PTR = ctypes.POINTER(BField._ctype) + p = ctypes.cast(addr + offset, PTR) + BField._initialize(p.contents, value) + is_union = CTypesStructOrUnion._kind == 'union' + name2fieldtype = dict(zip(fnames, zip(btypes, bitfields))) + # + for fname, BField, bitsize in fields: + if fname == '': + raise NotImplementedError("nested anonymous structs/unions") + if hasattr(CTypesStructOrUnion, fname): + raise ValueError("the field name %r conflicts in " + "the ctypes backend" % fname) + if bitsize < 0: + def getter(self, fname=fname, BField=BField, + offset=CTypesStructOrUnion._offsetof(fname), + PTR=ctypes.POINTER(BField._ctype)): + addr = ctypes.addressof(self._blob) + p = ctypes.cast(addr + offset, PTR) + return BField._from_ctypes(p.contents) + def setter(self, value, fname=fname, BField=BField): + setattr(self._blob, fname, BField._to_ctypes(value)) + # + if issubclass(BField, CTypesGenericArray): + setter = None + if BField._declared_length == 0: + def getter(self, fname=fname, BFieldPtr=BField._CTPtr, + offset=CTypesStructOrUnion._offsetof(fname), + PTR=ctypes.POINTER(BField._ctype)): + addr = ctypes.addressof(self._blob) + p = ctypes.cast(addr + offset, PTR) + return BFieldPtr._from_ctypes(p) + # + else: + def getter(self, fname=fname, BField=BField): + return BField._from_ctypes(getattr(self._blob, fname)) + def setter(self, value, fname=fname, BField=BField): + # xxx obscure workaround + value = BField._to_ctypes(value) + oldvalue = getattr(self._blob, fname) + setattr(self._blob, fname, value) + if value != getattr(self._blob, fname): + setattr(self._blob, fname, oldvalue) + raise OverflowError("value too large for bitfield") + setattr(CTypesStructOrUnion, fname, property(getter, setter)) + # + CTypesPtr = self.ffi._get_cached_btype(model.PointerType(tp)) + for fname in fnames: + if hasattr(CTypesPtr, fname): + raise ValueError("the field name %r conflicts in " + "the ctypes backend" % fname) + def getter(self, fname=fname): + return getattr(self[0], fname) + def setter(self, value, fname=fname): + setattr(self[0], fname, value) + setattr(CTypesPtr, fname, property(getter, setter)) + + def new_function_type(self, BArgs, BResult, has_varargs): + nameargs = [BArg._get_c_name() for BArg in BArgs] + if has_varargs: + nameargs.append('...') + nameargs = ', '.join(nameargs) + # + class CTypesFunctionPtr(CTypesGenericPtr): + __slots__ = ['_own_callback', '_name'] + _ctype = ctypes.CFUNCTYPE(getattr(BResult, '_ctype', None), + *[BArg._ctype for BArg in BArgs], + use_errno=True) + _reftypename = BResult._get_c_name('(* &)(%s)' % (nameargs,)) + + def __init__(self, init, error=None): + # create a callback to the Python callable init() + import traceback + assert not has_varargs, "varargs not supported for callbacks" + if getattr(BResult, '_ctype', None) is not None: + error = BResult._from_ctypes( + BResult._create_ctype_obj(error)) + else: + error = None + def callback(*args): + args2 = [] + for arg, BArg in zip(args, BArgs): + args2.append(BArg._from_ctypes(arg)) + try: + res2 = init(*args2) + res2 = BResult._to_ctypes(res2) + except: + traceback.print_exc() + res2 = error + if issubclass(BResult, CTypesGenericPtr): + if res2: + res2 = ctypes.cast(res2, ctypes.c_void_p).value + # .value: http://bugs.python.org/issue1574593 + else: + res2 = None + #print repr(res2) + return res2 + if issubclass(BResult, CTypesGenericPtr): + # The only pointers callbacks can return are void*s: + # http://bugs.python.org/issue5710 + callback_ctype = ctypes.CFUNCTYPE( + ctypes.c_void_p, + *[BArg._ctype for BArg in BArgs], + use_errno=True) + else: + callback_ctype = CTypesFunctionPtr._ctype + self._as_ctype_ptr = callback_ctype(callback) + self._address = ctypes.cast(self._as_ctype_ptr, + ctypes.c_void_p).value + self._own_callback = init + + @staticmethod + def _initialize(ctypes_ptr, value): + if value: + raise NotImplementedError("ctypes backend: not supported: " + "initializers for function pointers") + + def __repr__(self): + c_name = getattr(self, '_name', None) + if c_name: + i = self._reftypename.index('(* &)') + if self._reftypename[i-1] not in ' )*': + c_name = ' ' + c_name + c_name = self._reftypename.replace('(* &)', c_name) + return CTypesData.__repr__(self, c_name) + + def _get_own_repr(self): + if getattr(self, '_own_callback', None) is not None: + return 'calling %r' % (self._own_callback,) + return super(CTypesFunctionPtr, self)._get_own_repr() + + def __call__(self, *args): + if has_varargs: + assert len(args) >= len(BArgs) + extraargs = args[len(BArgs):] + args = args[:len(BArgs)] + else: + assert len(args) == len(BArgs) + ctypes_args = [] + for arg, BArg in zip(args, BArgs): + ctypes_args.append(BArg._arg_to_ctypes(arg)) + if has_varargs: + for i, arg in enumerate(extraargs): + if arg is None: + ctypes_args.append(ctypes.c_void_p(0)) # NULL + continue + if not isinstance(arg, CTypesData): + raise TypeError( + "argument %d passed in the variadic part " + "needs to be a cdata object (got %s)" % + (1 + len(BArgs) + i, type(arg).__name__)) + ctypes_args.append(arg._arg_to_ctypes(arg)) + result = self._as_ctype_ptr(*ctypes_args) + return BResult._from_ctypes(result) + # + CTypesFunctionPtr._fix_class() + return CTypesFunctionPtr + + def new_enum_type(self, name, enumerators, enumvalues, CTypesInt): + assert isinstance(name, str) + reverse_mapping = dict(zip(reversed(enumvalues), + reversed(enumerators))) + # + class CTypesEnum(CTypesInt): + __slots__ = [] + _reftypename = '%s &' % name + + def _get_own_repr(self): + value = self._value + try: + return '%d: %s' % (value, reverse_mapping[value]) + except KeyError: + return str(value) + + def _to_string(self, maxlen): + value = self._value + try: + return reverse_mapping[value] + except KeyError: + return str(value) + # + CTypesEnum._fix_class() + return CTypesEnum + + def get_errno(self): + return ctypes.get_errno() + + def set_errno(self, value): + ctypes.set_errno(value) + + def string(self, b, maxlen=-1): + return b._to_string(maxlen) + + def buffer(self, bptr, size=-1): + raise NotImplementedError("buffer() with ctypes backend") + + def sizeof(self, cdata_or_BType): + if isinstance(cdata_or_BType, CTypesData): + return cdata_or_BType._get_size_of_instance() + else: + assert issubclass(cdata_or_BType, CTypesData) + return cdata_or_BType._get_size() + + def alignof(self, BType): + assert issubclass(BType, CTypesData) + return BType._alignment() + + def newp(self, BType, source): + if not issubclass(BType, CTypesData): + raise TypeError + return BType._newp(source) + + def cast(self, BType, source): + return BType._cast_from(source) + + def callback(self, BType, source, error, onerror): + assert onerror is None # XXX not implemented + return BType(source, error) + + _weakref_cache_ref = None + + def gcp(self, cdata, destructor, size=0): + if self._weakref_cache_ref is None: + import weakref + class MyRef(weakref.ref): + def __eq__(self, other): + myref = self() + return self is other or ( + myref is not None and myref is other()) + def __ne__(self, other): + return not (self == other) + def __hash__(self): + try: + return self._hash + except AttributeError: + self._hash = hash(self()) + return self._hash + self._weakref_cache_ref = {}, MyRef + weak_cache, MyRef = self._weakref_cache_ref + + if destructor is None: + try: + del weak_cache[MyRef(cdata)] + except KeyError: + raise TypeError("Can remove destructor only on a object " + "previously returned by ffi.gc()") + return None + + def remove(k): + cdata, destructor = weak_cache.pop(k, (None, None)) + if destructor is not None: + destructor(cdata) + + new_cdata = self.cast(self.typeof(cdata), cdata) + assert new_cdata is not cdata + weak_cache[MyRef(new_cdata, remove)] = (cdata, destructor) + return new_cdata + + typeof = type + + def getcname(self, BType, replace_with): + return BType._get_c_name(replace_with) + + def typeoffsetof(self, BType, fieldname, num=0): + if isinstance(fieldname, str): + if num == 0 and issubclass(BType, CTypesGenericPtr): + BType = BType._BItem + if not issubclass(BType, CTypesBaseStructOrUnion): + raise TypeError("expected a struct or union ctype") + BField = BType._bfield_types[fieldname] + if BField is Ellipsis: + raise TypeError("not supported for bitfields") + return (BField, BType._offsetof(fieldname)) + elif isinstance(fieldname, (int, long)): + if issubclass(BType, CTypesGenericArray): + BType = BType._CTPtr + if not issubclass(BType, CTypesGenericPtr): + raise TypeError("expected an array or ptr ctype") + BItem = BType._BItem + offset = BItem._get_size() * fieldname + if offset > sys.maxsize: + raise OverflowError + return (BItem, offset) + else: + raise TypeError(type(fieldname)) + + def rawaddressof(self, BTypePtr, cdata, offset=None): + if isinstance(cdata, CTypesBaseStructOrUnion): + ptr = ctypes.pointer(type(cdata)._to_ctypes(cdata)) + elif isinstance(cdata, CTypesGenericPtr): + if offset is None or not issubclass(type(cdata)._BItem, + CTypesBaseStructOrUnion): + raise TypeError("unexpected cdata type") + ptr = type(cdata)._to_ctypes(cdata) + elif isinstance(cdata, CTypesGenericArray): + ptr = type(cdata)._to_ctypes(cdata) + else: + raise TypeError("expected a ") + if offset: + ptr = ctypes.cast( + ctypes.c_void_p( + ctypes.cast(ptr, ctypes.c_void_p).value + offset), + type(ptr)) + return BTypePtr._from_ctypes(ptr) + + +class CTypesLibrary(object): + + def __init__(self, backend, cdll): + self.backend = backend + self.cdll = cdll + + def load_function(self, BType, name): + c_func = getattr(self.cdll, name) + funcobj = BType._from_ctypes(c_func) + funcobj._name = name + return funcobj + + def read_variable(self, BType, name): + try: + ctypes_obj = BType._ctype.in_dll(self.cdll, name) + except AttributeError as e: + raise NotImplementedError(e) + return BType._from_ctypes(ctypes_obj) + + def write_variable(self, BType, name, value): + new_ctypes_obj = BType._to_ctypes(value) + ctypes_obj = BType._ctype.in_dll(self.cdll, name) + ctypes.memmove(ctypes.addressof(ctypes_obj), + ctypes.addressof(new_ctypes_obj), + ctypes.sizeof(BType._ctype)) diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/cffi/cffi_opcode.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/cffi/cffi_opcode.py new file mode 100644 index 00000000..a0df98d1 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/cffi/cffi_opcode.py @@ -0,0 +1,187 @@ +from .error import VerificationError + +class CffiOp(object): + def __init__(self, op, arg): + self.op = op + self.arg = arg + + def as_c_expr(self): + if self.op is None: + assert isinstance(self.arg, str) + return '(_cffi_opcode_t)(%s)' % (self.arg,) + classname = CLASS_NAME[self.op] + return '_CFFI_OP(_CFFI_OP_%s, %s)' % (classname, self.arg) + + def as_python_bytes(self): + if self.op is None and self.arg.isdigit(): + value = int(self.arg) # non-negative: '-' not in self.arg + if value >= 2**31: + raise OverflowError("cannot emit %r: limited to 2**31-1" + % (self.arg,)) + return format_four_bytes(value) + if isinstance(self.arg, str): + raise VerificationError("cannot emit to Python: %r" % (self.arg,)) + return format_four_bytes((self.arg << 8) | self.op) + + def __str__(self): + classname = CLASS_NAME.get(self.op, self.op) + return '(%s %s)' % (classname, self.arg) + +def format_four_bytes(num): + return '\\x%02X\\x%02X\\x%02X\\x%02X' % ( + (num >> 24) & 0xFF, + (num >> 16) & 0xFF, + (num >> 8) & 0xFF, + (num ) & 0xFF) + +OP_PRIMITIVE = 1 +OP_POINTER = 3 +OP_ARRAY = 5 +OP_OPEN_ARRAY = 7 +OP_STRUCT_UNION = 9 +OP_ENUM = 11 +OP_FUNCTION = 13 +OP_FUNCTION_END = 15 +OP_NOOP = 17 +OP_BITFIELD = 19 +OP_TYPENAME = 21 +OP_CPYTHON_BLTN_V = 23 # varargs +OP_CPYTHON_BLTN_N = 25 # noargs +OP_CPYTHON_BLTN_O = 27 # O (i.e. a single arg) +OP_CONSTANT = 29 +OP_CONSTANT_INT = 31 +OP_GLOBAL_VAR = 33 +OP_DLOPEN_FUNC = 35 +OP_DLOPEN_CONST = 37 +OP_GLOBAL_VAR_F = 39 +OP_EXTERN_PYTHON = 41 + +PRIM_VOID = 0 +PRIM_BOOL = 1 +PRIM_CHAR = 2 +PRIM_SCHAR = 3 +PRIM_UCHAR = 4 +PRIM_SHORT = 5 +PRIM_USHORT = 6 +PRIM_INT = 7 +PRIM_UINT = 8 +PRIM_LONG = 9 +PRIM_ULONG = 10 +PRIM_LONGLONG = 11 +PRIM_ULONGLONG = 12 +PRIM_FLOAT = 13 +PRIM_DOUBLE = 14 +PRIM_LONGDOUBLE = 15 + +PRIM_WCHAR = 16 +PRIM_INT8 = 17 +PRIM_UINT8 = 18 +PRIM_INT16 = 19 +PRIM_UINT16 = 20 +PRIM_INT32 = 21 +PRIM_UINT32 = 22 +PRIM_INT64 = 23 +PRIM_UINT64 = 24 +PRIM_INTPTR = 25 +PRIM_UINTPTR = 26 +PRIM_PTRDIFF = 27 +PRIM_SIZE = 28 +PRIM_SSIZE = 29 +PRIM_INT_LEAST8 = 30 +PRIM_UINT_LEAST8 = 31 +PRIM_INT_LEAST16 = 32 +PRIM_UINT_LEAST16 = 33 +PRIM_INT_LEAST32 = 34 +PRIM_UINT_LEAST32 = 35 +PRIM_INT_LEAST64 = 36 +PRIM_UINT_LEAST64 = 37 +PRIM_INT_FAST8 = 38 +PRIM_UINT_FAST8 = 39 +PRIM_INT_FAST16 = 40 +PRIM_UINT_FAST16 = 41 +PRIM_INT_FAST32 = 42 +PRIM_UINT_FAST32 = 43 +PRIM_INT_FAST64 = 44 +PRIM_UINT_FAST64 = 45 +PRIM_INTMAX = 46 +PRIM_UINTMAX = 47 +PRIM_FLOATCOMPLEX = 48 +PRIM_DOUBLECOMPLEX = 49 +PRIM_CHAR16 = 50 +PRIM_CHAR32 = 51 + +_NUM_PRIM = 52 +_UNKNOWN_PRIM = -1 +_UNKNOWN_FLOAT_PRIM = -2 +_UNKNOWN_LONG_DOUBLE = -3 + +_IO_FILE_STRUCT = -1 + +PRIMITIVE_TO_INDEX = { + 'char': PRIM_CHAR, + 'short': PRIM_SHORT, + 'int': PRIM_INT, + 'long': PRIM_LONG, + 'long long': PRIM_LONGLONG, + 'signed char': PRIM_SCHAR, + 'unsigned char': PRIM_UCHAR, + 'unsigned short': PRIM_USHORT, + 'unsigned int': PRIM_UINT, + 'unsigned long': PRIM_ULONG, + 'unsigned long long': PRIM_ULONGLONG, + 'float': PRIM_FLOAT, + 'double': PRIM_DOUBLE, + 'long double': PRIM_LONGDOUBLE, + 'float _Complex': PRIM_FLOATCOMPLEX, + 'double _Complex': PRIM_DOUBLECOMPLEX, + '_Bool': PRIM_BOOL, + 'wchar_t': PRIM_WCHAR, + 'char16_t': PRIM_CHAR16, + 'char32_t': PRIM_CHAR32, + 'int8_t': PRIM_INT8, + 'uint8_t': PRIM_UINT8, + 'int16_t': PRIM_INT16, + 'uint16_t': PRIM_UINT16, + 'int32_t': PRIM_INT32, + 'uint32_t': PRIM_UINT32, + 'int64_t': PRIM_INT64, + 'uint64_t': PRIM_UINT64, + 'intptr_t': PRIM_INTPTR, + 'uintptr_t': PRIM_UINTPTR, + 'ptrdiff_t': PRIM_PTRDIFF, + 'size_t': PRIM_SIZE, + 'ssize_t': PRIM_SSIZE, + 'int_least8_t': PRIM_INT_LEAST8, + 'uint_least8_t': PRIM_UINT_LEAST8, + 'int_least16_t': PRIM_INT_LEAST16, + 'uint_least16_t': PRIM_UINT_LEAST16, + 'int_least32_t': PRIM_INT_LEAST32, + 'uint_least32_t': PRIM_UINT_LEAST32, + 'int_least64_t': PRIM_INT_LEAST64, + 'uint_least64_t': PRIM_UINT_LEAST64, + 'int_fast8_t': PRIM_INT_FAST8, + 'uint_fast8_t': PRIM_UINT_FAST8, + 'int_fast16_t': PRIM_INT_FAST16, + 'uint_fast16_t': PRIM_UINT_FAST16, + 'int_fast32_t': PRIM_INT_FAST32, + 'uint_fast32_t': PRIM_UINT_FAST32, + 'int_fast64_t': PRIM_INT_FAST64, + 'uint_fast64_t': PRIM_UINT_FAST64, + 'intmax_t': PRIM_INTMAX, + 'uintmax_t': PRIM_UINTMAX, + } + +F_UNION = 0x01 +F_CHECK_FIELDS = 0x02 +F_PACKED = 0x04 +F_EXTERNAL = 0x08 +F_OPAQUE = 0x10 + +G_FLAGS = dict([('_CFFI_' + _key, globals()[_key]) + for _key in ['F_UNION', 'F_CHECK_FIELDS', 'F_PACKED', + 'F_EXTERNAL', 'F_OPAQUE']]) + +CLASS_NAME = {} +for _name, _value in list(globals().items()): + if _name.startswith('OP_') and isinstance(_value, int): + CLASS_NAME[_value] = _name[3:] diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/cffi/commontypes.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/cffi/commontypes.py new file mode 100644 index 00000000..8ec97c75 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/cffi/commontypes.py @@ -0,0 +1,80 @@ +import sys +from . import model +from .error import FFIError + + +COMMON_TYPES = {} + +try: + # fetch "bool" and all simple Windows types + from _cffi_backend import _get_common_types + _get_common_types(COMMON_TYPES) +except ImportError: + pass + +COMMON_TYPES['FILE'] = model.unknown_type('FILE', '_IO_FILE') +COMMON_TYPES['bool'] = '_Bool' # in case we got ImportError above + +for _type in model.PrimitiveType.ALL_PRIMITIVE_TYPES: + if _type.endswith('_t'): + COMMON_TYPES[_type] = _type +del _type + +_CACHE = {} + +def resolve_common_type(parser, commontype): + try: + return _CACHE[commontype] + except KeyError: + cdecl = COMMON_TYPES.get(commontype, commontype) + if not isinstance(cdecl, str): + result, quals = cdecl, 0 # cdecl is already a BaseType + elif cdecl in model.PrimitiveType.ALL_PRIMITIVE_TYPES: + result, quals = model.PrimitiveType(cdecl), 0 + elif cdecl == 'set-unicode-needed': + raise FFIError("The Windows type %r is only available after " + "you call ffi.set_unicode()" % (commontype,)) + else: + if commontype == cdecl: + raise FFIError( + "Unsupported type: %r. Please look at " + "http://cffi.readthedocs.io/en/latest/cdef.html#ffi-cdef-limitations " + "and file an issue if you think this type should really " + "be supported." % (commontype,)) + result, quals = parser.parse_type_and_quals(cdecl) # recursive + + assert isinstance(result, model.BaseTypeByIdentity) + _CACHE[commontype] = result, quals + return result, quals + + +# ____________________________________________________________ +# extra types for Windows (most of them are in commontypes.c) + + +def win_common_types(): + return { + "UNICODE_STRING": model.StructType( + "_UNICODE_STRING", + ["Length", + "MaximumLength", + "Buffer"], + [model.PrimitiveType("unsigned short"), + model.PrimitiveType("unsigned short"), + model.PointerType(model.PrimitiveType("wchar_t"))], + [-1, -1, -1]), + "PUNICODE_STRING": "UNICODE_STRING *", + "PCUNICODE_STRING": "const UNICODE_STRING *", + + "TBYTE": "set-unicode-needed", + "TCHAR": "set-unicode-needed", + "LPCTSTR": "set-unicode-needed", + "PCTSTR": "set-unicode-needed", + "LPTSTR": "set-unicode-needed", + "PTSTR": "set-unicode-needed", + "PTBYTE": "set-unicode-needed", + "PTCHAR": "set-unicode-needed", + } + +if sys.platform == 'win32': + COMMON_TYPES.update(win_common_types()) diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/cffi/cparser.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/cffi/cparser.py new file mode 100644 index 00000000..262fd765 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/cffi/cparser.py @@ -0,0 +1,931 @@ +from . import model +from .commontypes import COMMON_TYPES, resolve_common_type +from .error import FFIError, CDefError +try: + from . import _pycparser as pycparser +except ImportError: + import pycparser +import weakref, re, sys + +try: + if sys.version_info < (3,): + import thread as _thread + else: + import _thread + lock = _thread.allocate_lock() +except ImportError: + lock = None + +def _workaround_for_static_import_finders(): + # Issue #392: packaging tools like cx_Freeze can not find these + # because pycparser uses exec dynamic import. This is an obscure + # workaround. This function is never called. + import pycparser.yacctab + import pycparser.lextab + +CDEF_SOURCE_STRING = "" +_r_comment = re.compile(r"/\*.*?\*/|//([^\n\\]|\\.)*?$", + re.DOTALL | re.MULTILINE) +_r_define = re.compile(r"^\s*#\s*define\s+([A-Za-z_][A-Za-z_0-9]*)" + r"\b((?:[^\n\\]|\\.)*?)$", + re.DOTALL | re.MULTILINE) +_r_partial_enum = re.compile(r"=\s*\.\.\.\s*[,}]|\.\.\.\s*\}") +_r_enum_dotdotdot = re.compile(r"__dotdotdot\d+__$") +_r_partial_array = re.compile(r"\[\s*\.\.\.\s*\]") +_r_words = re.compile(r"\w+|\S") +_parser_cache = None +_r_int_literal = re.compile(r"-?0?x?[0-9a-f]+[lu]*$", re.IGNORECASE) +_r_stdcall1 = re.compile(r"\b(__stdcall|WINAPI)\b") +_r_stdcall2 = re.compile(r"[(]\s*(__stdcall|WINAPI)\b") +_r_cdecl = re.compile(r"\b__cdecl\b") +_r_extern_python = re.compile(r'\bextern\s*"' + r'(Python|Python\s*\+\s*C|C\s*\+\s*Python)"\s*.') +_r_star_const_space = re.compile( # matches "* const " + r"[*]\s*((const|volatile|restrict)\b\s*)+") +_r_int_dotdotdot = re.compile(r"(\b(int|long|short|signed|unsigned|char)\s*)+" + r"\.\.\.") +_r_float_dotdotdot = re.compile(r"\b(double|float)\s*\.\.\.") + +def _get_parser(): + global _parser_cache + if _parser_cache is None: + _parser_cache = pycparser.CParser() + return _parser_cache + +def _workaround_for_old_pycparser(csource): + # Workaround for a pycparser issue (fixed between pycparser 2.10 and + # 2.14): "char*const***" gives us a wrong syntax tree, the same as + # for "char***(*const)". This means we can't tell the difference + # afterwards. But "char(*const(***))" gives us the right syntax + # tree. The issue only occurs if there are several stars in + # sequence with no parenthesis inbetween, just possibly qualifiers. + # Attempt to fix it by adding some parentheses in the source: each + # time we see "* const" or "* const *", we add an opening + # parenthesis before each star---the hard part is figuring out where + # to close them. + parts = [] + while True: + match = _r_star_const_space.search(csource) + if not match: + break + #print repr(''.join(parts)+csource), '=>', + parts.append(csource[:match.start()]) + parts.append('('); closing = ')' + parts.append(match.group()) # e.g. "* const " + endpos = match.end() + if csource.startswith('*', endpos): + parts.append('('); closing += ')' + level = 0 + i = endpos + while i < len(csource): + c = csource[i] + if c == '(': + level += 1 + elif c == ')': + if level == 0: + break + level -= 1 + elif c in ',;=': + if level == 0: + break + i += 1 + csource = csource[endpos:i] + closing + csource[i:] + #print repr(''.join(parts)+csource) + parts.append(csource) + return ''.join(parts) + +def _preprocess_extern_python(csource): + # input: `extern "Python" int foo(int);` or + # `extern "Python" { int foo(int); }` + # output: + # void __cffi_extern_python_start; + # int foo(int); + # void __cffi_extern_python_stop; + # + # input: `extern "Python+C" int foo(int);` + # output: + # void __cffi_extern_python_plus_c_start; + # int foo(int); + # void __cffi_extern_python_stop; + parts = [] + while True: + match = _r_extern_python.search(csource) + if not match: + break + endpos = match.end() - 1 + #print + #print ''.join(parts)+csource + #print '=>' + parts.append(csource[:match.start()]) + if 'C' in match.group(1): + parts.append('void __cffi_extern_python_plus_c_start; ') + else: + parts.append('void __cffi_extern_python_start; ') + if csource[endpos] == '{': + # grouping variant + closing = csource.find('}', endpos) + if closing < 0: + raise CDefError("'extern \"Python\" {': no '}' found") + if csource.find('{', endpos + 1, closing) >= 0: + raise NotImplementedError("cannot use { } inside a block " + "'extern \"Python\" { ... }'") + parts.append(csource[endpos+1:closing]) + csource = csource[closing+1:] + else: + # non-grouping variant + semicolon = csource.find(';', endpos) + if semicolon < 0: + raise CDefError("'extern \"Python\": no ';' found") + parts.append(csource[endpos:semicolon+1]) + csource = csource[semicolon+1:] + parts.append(' void __cffi_extern_python_stop;') + #print ''.join(parts)+csource + #print + parts.append(csource) + return ''.join(parts) + +def _warn_for_string_literal(csource): + if '"' in csource: + import warnings + warnings.warn("String literal found in cdef() or type source. " + "String literals are ignored here, but you should " + "remove them anyway because some character sequences " + "confuse pre-parsing.") + +def _preprocess(csource): + # Remove comments. NOTE: this only work because the cdef() section + # should not contain any string literal! + csource = _r_comment.sub(' ', csource) + # Remove the "#define FOO x" lines + macros = {} + for match in _r_define.finditer(csource): + macroname, macrovalue = match.groups() + macrovalue = macrovalue.replace('\\\n', '').strip() + macros[macroname] = macrovalue + csource = _r_define.sub('', csource) + # + if pycparser.__version__ < '2.14': + csource = _workaround_for_old_pycparser(csource) + # + # BIG HACK: replace WINAPI or __stdcall with "volatile const". + # It doesn't make sense for the return type of a function to be + # "volatile volatile const", so we abuse it to detect __stdcall... + # Hack number 2 is that "int(volatile *fptr)();" is not valid C + # syntax, so we place the "volatile" before the opening parenthesis. + csource = _r_stdcall2.sub(' volatile volatile const(', csource) + csource = _r_stdcall1.sub(' volatile volatile const ', csource) + csource = _r_cdecl.sub(' ', csource) + # + # Replace `extern "Python"` with start/end markers + csource = _preprocess_extern_python(csource) + # + # Now there should not be any string literal left; warn if we get one + _warn_for_string_literal(csource) + # + # Replace "[...]" with "[__dotdotdotarray__]" + csource = _r_partial_array.sub('[__dotdotdotarray__]', csource) + # + # Replace "...}" with "__dotdotdotNUM__}". This construction should + # occur only at the end of enums; at the end of structs we have "...;}" + # and at the end of vararg functions "...);". Also replace "=...[,}]" + # with ",__dotdotdotNUM__[,}]": this occurs in the enums too, when + # giving an unknown value. + matches = list(_r_partial_enum.finditer(csource)) + for number, match in enumerate(reversed(matches)): + p = match.start() + if csource[p] == '=': + p2 = csource.find('...', p, match.end()) + assert p2 > p + csource = '%s,__dotdotdot%d__ %s' % (csource[:p], number, + csource[p2+3:]) + else: + assert csource[p:p+3] == '...' + csource = '%s __dotdotdot%d__ %s' % (csource[:p], number, + csource[p+3:]) + # Replace "int ..." or "unsigned long int..." with "__dotdotdotint__" + csource = _r_int_dotdotdot.sub(' __dotdotdotint__ ', csource) + # Replace "float ..." or "double..." with "__dotdotdotfloat__" + csource = _r_float_dotdotdot.sub(' __dotdotdotfloat__ ', csource) + # Replace all remaining "..." with the same name, "__dotdotdot__", + # which is declared with a typedef for the purpose of C parsing. + return csource.replace('...', ' __dotdotdot__ '), macros + +def _common_type_names(csource): + # Look in the source for what looks like usages of types from the + # list of common types. A "usage" is approximated here as the + # appearance of the word, minus a "definition" of the type, which + # is the last word in a "typedef" statement. Approximative only + # but should be fine for all the common types. + look_for_words = set(COMMON_TYPES) + look_for_words.add(';') + look_for_words.add(',') + look_for_words.add('(') + look_for_words.add(')') + look_for_words.add('typedef') + words_used = set() + is_typedef = False + paren = 0 + previous_word = '' + for word in _r_words.findall(csource): + if word in look_for_words: + if word == ';': + if is_typedef: + words_used.discard(previous_word) + look_for_words.discard(previous_word) + is_typedef = False + elif word == 'typedef': + is_typedef = True + paren = 0 + elif word == '(': + paren += 1 + elif word == ')': + paren -= 1 + elif word == ',': + if is_typedef and paren == 0: + words_used.discard(previous_word) + look_for_words.discard(previous_word) + else: # word in COMMON_TYPES + words_used.add(word) + previous_word = word + return words_used + + +class Parser(object): + + def __init__(self): + self._declarations = {} + self._included_declarations = set() + self._anonymous_counter = 0 + self._structnode2type = weakref.WeakKeyDictionary() + self._options = {} + self._int_constants = {} + self._recomplete = [] + self._uses_new_feature = None + + def _parse(self, csource): + csource, macros = _preprocess(csource) + # XXX: for more efficiency we would need to poke into the + # internals of CParser... the following registers the + # typedefs, because their presence or absence influences the + # parsing itself (but what they are typedef'ed to plays no role) + ctn = _common_type_names(csource) + typenames = [] + for name in sorted(self._declarations): + if name.startswith('typedef '): + name = name[8:] + typenames.append(name) + ctn.discard(name) + typenames += sorted(ctn) + # + csourcelines = [] + csourcelines.append('# 1 ""') + for typename in typenames: + csourcelines.append('typedef int %s;' % typename) + csourcelines.append('typedef int __dotdotdotint__, __dotdotdotfloat__,' + ' __dotdotdot__;') + # this forces pycparser to consider the following in the file + # called from line 1 + csourcelines.append('# 1 "%s"' % (CDEF_SOURCE_STRING,)) + csourcelines.append(csource) + fullcsource = '\n'.join(csourcelines) + if lock is not None: + lock.acquire() # pycparser is not thread-safe... + try: + ast = _get_parser().parse(fullcsource) + except pycparser.c_parser.ParseError as e: + self.convert_pycparser_error(e, csource) + finally: + if lock is not None: + lock.release() + # csource will be used to find buggy source text + return ast, macros, csource + + def _convert_pycparser_error(self, e, csource): + # xxx look for ":NUM:" at the start of str(e) + # and interpret that as a line number. This will not work if + # the user gives explicit ``# NUM "FILE"`` directives. + line = None + msg = str(e) + match = re.match(r"%s:(\d+):" % (CDEF_SOURCE_STRING,), msg) + if match: + linenum = int(match.group(1), 10) + csourcelines = csource.splitlines() + if 1 <= linenum <= len(csourcelines): + line = csourcelines[linenum-1] + return line + + def convert_pycparser_error(self, e, csource): + line = self._convert_pycparser_error(e, csource) + + msg = str(e) + if line: + msg = 'cannot parse "%s"\n%s' % (line.strip(), msg) + else: + msg = 'parse error\n%s' % (msg,) + raise CDefError(msg) + + def parse(self, csource, override=False, packed=False, pack=None, + dllexport=False): + if packed: + if packed != True: + raise ValueError("'packed' should be False or True; use " + "'pack' to give another value") + if pack: + raise ValueError("cannot give both 'pack' and 'packed'") + pack = 1 + elif pack: + if pack & (pack - 1): + raise ValueError("'pack' must be a power of two, not %r" % + (pack,)) + else: + pack = 0 + prev_options = self._options + try: + self._options = {'override': override, + 'packed': pack, + 'dllexport': dllexport} + self._internal_parse(csource) + finally: + self._options = prev_options + + def _internal_parse(self, csource): + ast, macros, csource = self._parse(csource) + # add the macros + self._process_macros(macros) + # find the first "__dotdotdot__" and use that as a separator + # between the repeated typedefs and the real csource + iterator = iter(ast.ext) + for decl in iterator: + if decl.name == '__dotdotdot__': + break + else: + assert 0 + current_decl = None + # + try: + self._inside_extern_python = '__cffi_extern_python_stop' + for decl in iterator: + current_decl = decl + if isinstance(decl, pycparser.c_ast.Decl): + self._parse_decl(decl) + elif isinstance(decl, pycparser.c_ast.Typedef): + if not decl.name: + raise CDefError("typedef does not declare any name", + decl) + quals = 0 + if (isinstance(decl.type.type, pycparser.c_ast.IdentifierType) and + decl.type.type.names[-1].startswith('__dotdotdot')): + realtype = self._get_unknown_type(decl) + elif (isinstance(decl.type, pycparser.c_ast.PtrDecl) and + isinstance(decl.type.type, pycparser.c_ast.TypeDecl) and + isinstance(decl.type.type.type, + pycparser.c_ast.IdentifierType) and + decl.type.type.type.names[-1].startswith('__dotdotdot')): + realtype = self._get_unknown_ptr_type(decl) + else: + realtype, quals = self._get_type_and_quals( + decl.type, name=decl.name, partial_length_ok=True) + self._declare('typedef ' + decl.name, realtype, quals=quals) + elif decl.__class__.__name__ == 'Pragma': + pass # skip pragma, only in pycparser 2.15 + else: + raise CDefError("unexpected <%s>: this construct is valid " + "C but not valid in cdef()" % + decl.__class__.__name__, decl) + except CDefError as e: + if len(e.args) == 1: + e.args = e.args + (current_decl,) + raise + except FFIError as e: + msg = self._convert_pycparser_error(e, csource) + if msg: + e.args = (e.args[0] + "\n *** Err: %s" % msg,) + raise + + def _add_constants(self, key, val): + if key in self._int_constants: + if self._int_constants[key] == val: + return # ignore identical double declarations + raise FFIError( + "multiple declarations of constant: %s" % (key,)) + self._int_constants[key] = val + + def _add_integer_constant(self, name, int_str): + int_str = int_str.lower().rstrip("ul") + neg = int_str.startswith('-') + if neg: + int_str = int_str[1:] + # "010" is not valid oct in py3 + if (int_str.startswith("0") and int_str != '0' + and not int_str.startswith("0x")): + int_str = "0o" + int_str[1:] + pyvalue = int(int_str, 0) + if neg: + pyvalue = -pyvalue + self._add_constants(name, pyvalue) + self._declare('macro ' + name, pyvalue) + + def _process_macros(self, macros): + for key, value in macros.items(): + value = value.strip() + if _r_int_literal.match(value): + self._add_integer_constant(key, value) + elif value == '...': + self._declare('macro ' + key, value) + else: + raise CDefError( + 'only supports one of the following syntax:\n' + ' #define %s ... (literally dot-dot-dot)\n' + ' #define %s NUMBER (with NUMBER an integer' + ' constant, decimal/hex/octal)\n' + 'got:\n' + ' #define %s %s' + % (key, key, key, value)) + + def _declare_function(self, tp, quals, decl): + tp = self._get_type_pointer(tp, quals) + if self._options.get('dllexport'): + tag = 'dllexport_python ' + elif self._inside_extern_python == '__cffi_extern_python_start': + tag = 'extern_python ' + elif self._inside_extern_python == '__cffi_extern_python_plus_c_start': + tag = 'extern_python_plus_c ' + else: + tag = 'function ' + self._declare(tag + decl.name, tp) + + def _parse_decl(self, decl): + node = decl.type + if isinstance(node, pycparser.c_ast.FuncDecl): + tp, quals = self._get_type_and_quals(node, name=decl.name) + assert isinstance(tp, model.RawFunctionType) + self._declare_function(tp, quals, decl) + else: + if isinstance(node, pycparser.c_ast.Struct): + self._get_struct_union_enum_type('struct', node) + elif isinstance(node, pycparser.c_ast.Union): + self._get_struct_union_enum_type('union', node) + elif isinstance(node, pycparser.c_ast.Enum): + self._get_struct_union_enum_type('enum', node) + elif not decl.name: + raise CDefError("construct does not declare any variable", + decl) + # + if decl.name: + tp, quals = self._get_type_and_quals(node, + partial_length_ok=True) + if tp.is_raw_function: + self._declare_function(tp, quals, decl) + elif (tp.is_integer_type() and + hasattr(decl, 'init') and + hasattr(decl.init, 'value') and + _r_int_literal.match(decl.init.value)): + self._add_integer_constant(decl.name, decl.init.value) + elif (tp.is_integer_type() and + isinstance(decl.init, pycparser.c_ast.UnaryOp) and + decl.init.op == '-' and + hasattr(decl.init.expr, 'value') and + _r_int_literal.match(decl.init.expr.value)): + self._add_integer_constant(decl.name, + '-' + decl.init.expr.value) + elif (tp is model.void_type and + decl.name.startswith('__cffi_extern_python_')): + # hack: `extern "Python"` in the C source is replaced + # with "void __cffi_extern_python_start;" and + # "void __cffi_extern_python_stop;" + self._inside_extern_python = decl.name + else: + if self._inside_extern_python !='__cffi_extern_python_stop': + raise CDefError( + "cannot declare constants or " + "variables with 'extern \"Python\"'") + if (quals & model.Q_CONST) and not tp.is_array_type: + self._declare('constant ' + decl.name, tp, quals=quals) + else: + self._declare('variable ' + decl.name, tp, quals=quals) + + def parse_type(self, cdecl): + return self.parse_type_and_quals(cdecl)[0] + + def parse_type_and_quals(self, cdecl): + ast, macros = self._parse('void __dummy(\n%s\n);' % cdecl)[:2] + assert not macros + exprnode = ast.ext[-1].type.args.params[0] + if isinstance(exprnode, pycparser.c_ast.ID): + raise CDefError("unknown identifier '%s'" % (exprnode.name,)) + return self._get_type_and_quals(exprnode.type) + + def _declare(self, name, obj, included=False, quals=0): + if name in self._declarations: + prevobj, prevquals = self._declarations[name] + if prevobj is obj and prevquals == quals: + return + if not self._options.get('override'): + raise FFIError( + "multiple declarations of %s (for interactive usage, " + "try cdef(xx, override=True))" % (name,)) + assert '__dotdotdot__' not in name.split() + self._declarations[name] = (obj, quals) + if included: + self._included_declarations.add(obj) + + def _extract_quals(self, type): + quals = 0 + if isinstance(type, (pycparser.c_ast.TypeDecl, + pycparser.c_ast.PtrDecl)): + if 'const' in type.quals: + quals |= model.Q_CONST + if 'volatile' in type.quals: + quals |= model.Q_VOLATILE + if 'restrict' in type.quals: + quals |= model.Q_RESTRICT + return quals + + def _get_type_pointer(self, type, quals, declname=None): + if isinstance(type, model.RawFunctionType): + return type.as_function_pointer() + if (isinstance(type, model.StructOrUnionOrEnum) and + type.name.startswith('$') and type.name[1:].isdigit() and + type.forcename is None and declname is not None): + return model.NamedPointerType(type, declname, quals) + return model.PointerType(type, quals) + + def _get_type_and_quals(self, typenode, name=None, partial_length_ok=False): + # first, dereference typedefs, if we have it already parsed, we're good + if (isinstance(typenode, pycparser.c_ast.TypeDecl) and + isinstance(typenode.type, pycparser.c_ast.IdentifierType) and + len(typenode.type.names) == 1 and + ('typedef ' + typenode.type.names[0]) in self._declarations): + tp, quals = self._declarations['typedef ' + typenode.type.names[0]] + quals |= self._extract_quals(typenode) + return tp, quals + # + if isinstance(typenode, pycparser.c_ast.ArrayDecl): + # array type + if typenode.dim is None: + length = None + else: + length = self._parse_constant( + typenode.dim, partial_length_ok=partial_length_ok) + tp, quals = self._get_type_and_quals(typenode.type, + partial_length_ok=partial_length_ok) + return model.ArrayType(tp, length), quals + # + if isinstance(typenode, pycparser.c_ast.PtrDecl): + # pointer type + itemtype, itemquals = self._get_type_and_quals(typenode.type) + tp = self._get_type_pointer(itemtype, itemquals, declname=name) + quals = self._extract_quals(typenode) + return tp, quals + # + if isinstance(typenode, pycparser.c_ast.TypeDecl): + quals = self._extract_quals(typenode) + type = typenode.type + if isinstance(type, pycparser.c_ast.IdentifierType): + # assume a primitive type. get it from .names, but reduce + # synonyms to a single chosen combination + names = list(type.names) + if names != ['signed', 'char']: # keep this unmodified + prefixes = {} + while names: + name = names[0] + if name in ('short', 'long', 'signed', 'unsigned'): + prefixes[name] = prefixes.get(name, 0) + 1 + del names[0] + else: + break + # ignore the 'signed' prefix below, and reorder the others + newnames = [] + for prefix in ('unsigned', 'short', 'long'): + for i in range(prefixes.get(prefix, 0)): + newnames.append(prefix) + if not names: + names = ['int'] # implicitly + if names == ['int']: # but kill it if 'short' or 'long' + if 'short' in prefixes or 'long' in prefixes: + names = [] + names = newnames + names + ident = ' '.join(names) + if ident == 'void': + return model.void_type, quals + if ident == '__dotdotdot__': + raise FFIError(':%d: bad usage of "..."' % + typenode.coord.line) + tp0, quals0 = resolve_common_type(self, ident) + return tp0, (quals | quals0) + # + if isinstance(type, pycparser.c_ast.Struct): + # 'struct foobar' + tp = self._get_struct_union_enum_type('struct', type, name) + return tp, quals + # + if isinstance(type, pycparser.c_ast.Union): + # 'union foobar' + tp = self._get_struct_union_enum_type('union', type, name) + return tp, quals + # + if isinstance(type, pycparser.c_ast.Enum): + # 'enum foobar' + tp = self._get_struct_union_enum_type('enum', type, name) + return tp, quals + # + if isinstance(typenode, pycparser.c_ast.FuncDecl): + # a function type + return self._parse_function_type(typenode, name), 0 + # + # nested anonymous structs or unions end up here + if isinstance(typenode, pycparser.c_ast.Struct): + return self._get_struct_union_enum_type('struct', typenode, name, + nested=True), 0 + if isinstance(typenode, pycparser.c_ast.Union): + return self._get_struct_union_enum_type('union', typenode, name, + nested=True), 0 + # + raise FFIError(":%d: bad or unsupported type declaration" % + typenode.coord.line) + + def _parse_function_type(self, typenode, funcname=None): + params = list(getattr(typenode.args, 'params', [])) + for i, arg in enumerate(params): + if not hasattr(arg, 'type'): + raise CDefError("%s arg %d: unknown type '%s'" + " (if you meant to use the old C syntax of giving" + " untyped arguments, it is not supported)" + % (funcname or 'in expression', i + 1, + getattr(arg, 'name', '?'))) + ellipsis = ( + len(params) > 0 and + isinstance(params[-1].type, pycparser.c_ast.TypeDecl) and + isinstance(params[-1].type.type, + pycparser.c_ast.IdentifierType) and + params[-1].type.type.names == ['__dotdotdot__']) + if ellipsis: + params.pop() + if not params: + raise CDefError( + "%s: a function with only '(...)' as argument" + " is not correct C" % (funcname or 'in expression')) + args = [self._as_func_arg(*self._get_type_and_quals(argdeclnode.type)) + for argdeclnode in params] + if not ellipsis and args == [model.void_type]: + args = [] + result, quals = self._get_type_and_quals(typenode.type) + # the 'quals' on the result type are ignored. HACK: we absure them + # to detect __stdcall functions: we textually replace "__stdcall" + # with "volatile volatile const" above. + abi = None + if hasattr(typenode.type, 'quals'): # else, probable syntax error anyway + if typenode.type.quals[-3:] == ['volatile', 'volatile', 'const']: + abi = '__stdcall' + return model.RawFunctionType(tuple(args), result, ellipsis, abi) + + def _as_func_arg(self, type, quals): + if isinstance(type, model.ArrayType): + return model.PointerType(type.item, quals) + elif isinstance(type, model.RawFunctionType): + return type.as_function_pointer() + else: + return type + + def _get_struct_union_enum_type(self, kind, type, name=None, nested=False): + # First, a level of caching on the exact 'type' node of the AST. + # This is obscure, but needed because pycparser "unrolls" declarations + # such as "typedef struct { } foo_t, *foo_p" and we end up with + # an AST that is not a tree, but a DAG, with the "type" node of the + # two branches foo_t and foo_p of the trees being the same node. + # It's a bit silly but detecting "DAG-ness" in the AST tree seems + # to be the only way to distinguish this case from two independent + # structs. See test_struct_with_two_usages. + try: + return self._structnode2type[type] + except KeyError: + pass + # + # Note that this must handle parsing "struct foo" any number of + # times and always return the same StructType object. Additionally, + # one of these times (not necessarily the first), the fields of + # the struct can be specified with "struct foo { ...fields... }". + # If no name is given, then we have to create a new anonymous struct + # with no caching; in this case, the fields are either specified + # right now or never. + # + force_name = name + name = type.name + # + # get the type or create it if needed + if name is None: + # 'force_name' is used to guess a more readable name for + # anonymous structs, for the common case "typedef struct { } foo". + if force_name is not None: + explicit_name = '$%s' % force_name + else: + self._anonymous_counter += 1 + explicit_name = '$%d' % self._anonymous_counter + tp = None + else: + explicit_name = name + key = '%s %s' % (kind, name) + tp, _ = self._declarations.get(key, (None, None)) + # + if tp is None: + if kind == 'struct': + tp = model.StructType(explicit_name, None, None, None) + elif kind == 'union': + tp = model.UnionType(explicit_name, None, None, None) + elif kind == 'enum': + if explicit_name == '__dotdotdot__': + raise CDefError("Enums cannot be declared with ...") + tp = self._build_enum_type(explicit_name, type.values) + else: + raise AssertionError("kind = %r" % (kind,)) + if name is not None: + self._declare(key, tp) + else: + if kind == 'enum' and type.values is not None: + raise NotImplementedError( + "enum %s: the '{}' declaration should appear on the first " + "time the enum is mentioned, not later" % explicit_name) + if not tp.forcename: + tp.force_the_name(force_name) + if tp.forcename and '$' in tp.name: + self._declare('anonymous %s' % tp.forcename, tp) + # + self._structnode2type[type] = tp + # + # enums: done here + if kind == 'enum': + return tp + # + # is there a 'type.decls'? If yes, then this is the place in the + # C sources that declare the fields. If no, then just return the + # existing type, possibly still incomplete. + if type.decls is None: + return tp + # + if tp.fldnames is not None: + raise CDefError("duplicate declaration of struct %s" % name) + fldnames = [] + fldtypes = [] + fldbitsize = [] + fldquals = [] + for decl in type.decls: + if (isinstance(decl.type, pycparser.c_ast.IdentifierType) and + ''.join(decl.type.names) == '__dotdotdot__'): + # XXX pycparser is inconsistent: 'names' should be a list + # of strings, but is sometimes just one string. Use + # str.join() as a way to cope with both. + self._make_partial(tp, nested) + continue + if decl.bitsize is None: + bitsize = -1 + else: + bitsize = self._parse_constant(decl.bitsize) + self._partial_length = False + type, fqual = self._get_type_and_quals(decl.type, + partial_length_ok=True) + if self._partial_length: + self._make_partial(tp, nested) + if isinstance(type, model.StructType) and type.partial: + self._make_partial(tp, nested) + fldnames.append(decl.name or '') + fldtypes.append(type) + fldbitsize.append(bitsize) + fldquals.append(fqual) + tp.fldnames = tuple(fldnames) + tp.fldtypes = tuple(fldtypes) + tp.fldbitsize = tuple(fldbitsize) + tp.fldquals = tuple(fldquals) + if fldbitsize != [-1] * len(fldbitsize): + if isinstance(tp, model.StructType) and tp.partial: + raise NotImplementedError("%s: using both bitfields and '...;'" + % (tp,)) + tp.packed = self._options.get('packed') + if tp.completed: # must be re-completed: it is not opaque any more + tp.completed = 0 + self._recomplete.append(tp) + return tp + + def _make_partial(self, tp, nested): + if not isinstance(tp, model.StructOrUnion): + raise CDefError("%s cannot be partial" % (tp,)) + if not tp.has_c_name() and not nested: + raise NotImplementedError("%s is partial but has no C name" %(tp,)) + tp.partial = True + + def _parse_constant(self, exprnode, partial_length_ok=False): + # for now, limited to expressions that are an immediate number + # or positive/negative number + if isinstance(exprnode, pycparser.c_ast.Constant): + s = exprnode.value + if '0' <= s[0] <= '9': + s = s.rstrip('uUlL') + try: + if s.startswith('0'): + return int(s, 8) + else: + return int(s, 10) + except ValueError: + if len(s) > 1: + if s.lower()[0:2] == '0x': + return int(s, 16) + elif s.lower()[0:2] == '0b': + return int(s, 2) + raise CDefError("invalid constant %r" % (s,)) + elif s[0] == "'" and s[-1] == "'" and ( + len(s) == 3 or (len(s) == 4 and s[1] == "\\")): + return ord(s[-2]) + else: + raise CDefError("invalid constant %r" % (s,)) + # + if (isinstance(exprnode, pycparser.c_ast.UnaryOp) and + exprnode.op == '+'): + return self._parse_constant(exprnode.expr) + # + if (isinstance(exprnode, pycparser.c_ast.UnaryOp) and + exprnode.op == '-'): + return -self._parse_constant(exprnode.expr) + # load previously defined int constant + if (isinstance(exprnode, pycparser.c_ast.ID) and + exprnode.name in self._int_constants): + return self._int_constants[exprnode.name] + # + if (isinstance(exprnode, pycparser.c_ast.ID) and + exprnode.name == '__dotdotdotarray__'): + if partial_length_ok: + self._partial_length = True + return '...' + raise FFIError(":%d: unsupported '[...]' here, cannot derive " + "the actual array length in this context" + % exprnode.coord.line) + # + if (isinstance(exprnode, pycparser.c_ast.BinaryOp) and + exprnode.op == '+'): + return (self._parse_constant(exprnode.left) + + self._parse_constant(exprnode.right)) + # + if (isinstance(exprnode, pycparser.c_ast.BinaryOp) and + exprnode.op == '-'): + return (self._parse_constant(exprnode.left) - + self._parse_constant(exprnode.right)) + # + raise FFIError(":%d: unsupported expression: expected a " + "simple numeric constant" % exprnode.coord.line) + + def _build_enum_type(self, explicit_name, decls): + if decls is not None: + partial = False + enumerators = [] + enumvalues = [] + nextenumvalue = 0 + for enum in decls.enumerators: + if _r_enum_dotdotdot.match(enum.name): + partial = True + continue + if enum.value is not None: + nextenumvalue = self._parse_constant(enum.value) + enumerators.append(enum.name) + enumvalues.append(nextenumvalue) + self._add_constants(enum.name, nextenumvalue) + nextenumvalue += 1 + enumerators = tuple(enumerators) + enumvalues = tuple(enumvalues) + tp = model.EnumType(explicit_name, enumerators, enumvalues) + tp.partial = partial + else: # opaque enum + tp = model.EnumType(explicit_name, (), ()) + return tp + + def include(self, other): + for name, (tp, quals) in other._declarations.items(): + if name.startswith('anonymous $enum_$'): + continue # fix for test_anonymous_enum_include + kind = name.split(' ', 1)[0] + if kind in ('struct', 'union', 'enum', 'anonymous', 'typedef'): + self._declare(name, tp, included=True, quals=quals) + for k, v in other._int_constants.items(): + self._add_constants(k, v) + + def _get_unknown_type(self, decl): + typenames = decl.type.type.names + if typenames == ['__dotdotdot__']: + return model.unknown_type(decl.name) + + if typenames == ['__dotdotdotint__']: + if self._uses_new_feature is None: + self._uses_new_feature = "'typedef int... %s'" % decl.name + return model.UnknownIntegerType(decl.name) + + if typenames == ['__dotdotdotfloat__']: + # note: not for 'long double' so far + if self._uses_new_feature is None: + self._uses_new_feature = "'typedef float... %s'" % decl.name + return model.UnknownFloatType(decl.name) + + raise FFIError(':%d: unsupported usage of "..." in typedef' + % decl.coord.line) + + def _get_unknown_ptr_type(self, decl): + if decl.type.type.type.names == ['__dotdotdot__']: + return model.unknown_ptr_type(decl.name) + raise FFIError(':%d: unsupported usage of "..." in typedef' + % decl.coord.line) diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/cffi/error.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/cffi/error.py new file mode 100644 index 00000000..0a27247c --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/cffi/error.py @@ -0,0 +1,31 @@ + +class FFIError(Exception): + __module__ = 'cffi' + +class CDefError(Exception): + __module__ = 'cffi' + def __str__(self): + try: + current_decl = self.args[1] + filename = current_decl.coord.file + linenum = current_decl.coord.line + prefix = '%s:%d: ' % (filename, linenum) + except (AttributeError, TypeError, IndexError): + prefix = '' + return '%s%s' % (prefix, self.args[0]) + +class VerificationError(Exception): + """ An error raised when verification fails + """ + __module__ = 'cffi' + +class VerificationMissing(Exception): + """ An error raised when incomplete structures are passed into + cdef, but no verification has been done + """ + __module__ = 'cffi' + +class PkgConfigError(Exception): + """ An error raised for missing modules in pkg-config + """ + __module__ = 'cffi' diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/cffi/ffiplatform.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/cffi/ffiplatform.py new file mode 100644 index 00000000..85313460 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/cffi/ffiplatform.py @@ -0,0 +1,127 @@ +import sys, os +from .error import VerificationError + + +LIST_OF_FILE_NAMES = ['sources', 'include_dirs', 'library_dirs', + 'extra_objects', 'depends'] + +def get_extension(srcfilename, modname, sources=(), **kwds): + _hack_at_distutils() + from distutils.core import Extension + allsources = [srcfilename] + for src in sources: + allsources.append(os.path.normpath(src)) + return Extension(name=modname, sources=allsources, **kwds) + +def compile(tmpdir, ext, compiler_verbose=0, debug=None): + """Compile a C extension module using distutils.""" + + _hack_at_distutils() + saved_environ = os.environ.copy() + try: + outputfilename = _build(tmpdir, ext, compiler_verbose, debug) + outputfilename = os.path.abspath(outputfilename) + finally: + # workaround for a distutils bugs where some env vars can + # become longer and longer every time it is used + for key, value in saved_environ.items(): + if os.environ.get(key) != value: + os.environ[key] = value + return outputfilename + +def _build(tmpdir, ext, compiler_verbose=0, debug=None): + # XXX compact but horrible :-( + from distutils.core import Distribution + import distutils.errors, distutils.log + # + dist = Distribution({'ext_modules': [ext]}) + dist.parse_config_files() + options = dist.get_option_dict('build_ext') + if debug is None: + debug = sys.flags.debug + options['debug'] = ('ffiplatform', debug) + options['force'] = ('ffiplatform', True) + options['build_lib'] = ('ffiplatform', tmpdir) + options['build_temp'] = ('ffiplatform', tmpdir) + # + try: + old_level = distutils.log.set_threshold(0) or 0 + try: + distutils.log.set_verbosity(compiler_verbose) + dist.run_command('build_ext') + cmd_obj = dist.get_command_obj('build_ext') + [soname] = cmd_obj.get_outputs() + finally: + distutils.log.set_threshold(old_level) + except (distutils.errors.CompileError, + distutils.errors.LinkError) as e: + raise VerificationError('%s: %s' % (e.__class__.__name__, e)) + # + return soname + +try: + from os.path import samefile +except ImportError: + def samefile(f1, f2): + return os.path.abspath(f1) == os.path.abspath(f2) + +def maybe_relative_path(path): + if not os.path.isabs(path): + return path # already relative + dir = path + names = [] + while True: + prevdir = dir + dir, name = os.path.split(prevdir) + if dir == prevdir or not dir: + return path # failed to make it relative + names.append(name) + try: + if samefile(dir, os.curdir): + names.reverse() + return os.path.join(*names) + except OSError: + pass + +# ____________________________________________________________ + +try: + int_or_long = (int, long) + import cStringIO +except NameError: + int_or_long = int # Python 3 + import io as cStringIO + +def _flatten(x, f): + if isinstance(x, str): + f.write('%ds%s' % (len(x), x)) + elif isinstance(x, dict): + keys = sorted(x.keys()) + f.write('%dd' % len(keys)) + for key in keys: + _flatten(key, f) + _flatten(x[key], f) + elif isinstance(x, (list, tuple)): + f.write('%dl' % len(x)) + for value in x: + _flatten(value, f) + elif isinstance(x, int_or_long): + f.write('%di' % (x,)) + else: + raise TypeError( + "the keywords to verify() contains unsupported object %r" % (x,)) + +def flatten(x): + f = cStringIO.StringIO() + _flatten(x, f) + return f.getvalue() + +def _hack_at_distutils(): + # Windows-only workaround for some configurations: see + # https://bugs.python.org/issue23246 (Python 2.7 with + # a specific MS compiler suite download) + if sys.platform == "win32": + try: + import setuptools # for side-effects, patches distutils + except ImportError: + pass diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/cffi/lock.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/cffi/lock.py new file mode 100644 index 00000000..db91b715 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/cffi/lock.py @@ -0,0 +1,30 @@ +import sys + +if sys.version_info < (3,): + try: + from thread import allocate_lock + except ImportError: + from dummy_thread import allocate_lock +else: + try: + from _thread import allocate_lock + except ImportError: + from _dummy_thread import allocate_lock + + +##import sys +##l1 = allocate_lock + +##class allocate_lock(object): +## def __init__(self): +## self._real = l1() +## def __enter__(self): +## for i in range(4, 0, -1): +## print sys._getframe(i).f_code +## print +## return self._real.__enter__() +## def __exit__(self, *args): +## return self._real.__exit__(*args) +## def acquire(self, f): +## assert f is False +## return self._real.acquire(f) diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/cffi/model.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/cffi/model.py new file mode 100644 index 00000000..5f1b0d2b --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/cffi/model.py @@ -0,0 +1,614 @@ +import types +import weakref + +from .lock import allocate_lock +from .error import CDefError, VerificationError, VerificationMissing + +# type qualifiers +Q_CONST = 0x01 +Q_RESTRICT = 0x02 +Q_VOLATILE = 0x04 + +def qualify(quals, replace_with): + if quals & Q_CONST: + replace_with = ' const ' + replace_with.lstrip() + if quals & Q_VOLATILE: + replace_with = ' volatile ' + replace_with.lstrip() + if quals & Q_RESTRICT: + # It seems that __restrict is supported by gcc and msvc. + # If you hit some different compiler, add a #define in + # _cffi_include.h for it (and in its copies, documented there) + replace_with = ' __restrict ' + replace_with.lstrip() + return replace_with + + +class BaseTypeByIdentity(object): + is_array_type = False + is_raw_function = False + + def get_c_name(self, replace_with='', context='a C file', quals=0): + result = self.c_name_with_marker + assert result.count('&') == 1 + # some logic duplication with ffi.getctype()... :-( + replace_with = replace_with.strip() + if replace_with: + if replace_with.startswith('*') and '&[' in result: + replace_with = '(%s)' % replace_with + elif not replace_with[0] in '[(': + replace_with = ' ' + replace_with + replace_with = qualify(quals, replace_with) + result = result.replace('&', replace_with) + if '$' in result: + raise VerificationError( + "cannot generate '%s' in %s: unknown type name" + % (self._get_c_name(), context)) + return result + + def _get_c_name(self): + return self.c_name_with_marker.replace('&', '') + + def has_c_name(self): + return '$' not in self._get_c_name() + + def is_integer_type(self): + return False + + def get_cached_btype(self, ffi, finishlist, can_delay=False): + try: + BType = ffi._cached_btypes[self] + except KeyError: + BType = self.build_backend_type(ffi, finishlist) + BType2 = ffi._cached_btypes.setdefault(self, BType) + assert BType2 is BType + return BType + + def __repr__(self): + return '<%s>' % (self._get_c_name(),) + + def _get_items(self): + return [(name, getattr(self, name)) for name in self._attrs_] + + +class BaseType(BaseTypeByIdentity): + + def __eq__(self, other): + return (self.__class__ == other.__class__ and + self._get_items() == other._get_items()) + + def __ne__(self, other): + return not self == other + + def __hash__(self): + return hash((self.__class__, tuple(self._get_items()))) + + +class VoidType(BaseType): + _attrs_ = () + + def __init__(self): + self.c_name_with_marker = 'void&' + + def build_backend_type(self, ffi, finishlist): + return global_cache(self, ffi, 'new_void_type') + +void_type = VoidType() + + +class BasePrimitiveType(BaseType): + def is_complex_type(self): + return False + + +class PrimitiveType(BasePrimitiveType): + _attrs_ = ('name',) + + ALL_PRIMITIVE_TYPES = { + 'char': 'c', + 'short': 'i', + 'int': 'i', + 'long': 'i', + 'long long': 'i', + 'signed char': 'i', + 'unsigned char': 'i', + 'unsigned short': 'i', + 'unsigned int': 'i', + 'unsigned long': 'i', + 'unsigned long long': 'i', + 'float': 'f', + 'double': 'f', + 'long double': 'f', + 'float _Complex': 'j', + 'double _Complex': 'j', + '_Bool': 'i', + # the following types are not primitive in the C sense + 'wchar_t': 'c', + 'char16_t': 'c', + 'char32_t': 'c', + 'int8_t': 'i', + 'uint8_t': 'i', + 'int16_t': 'i', + 'uint16_t': 'i', + 'int32_t': 'i', + 'uint32_t': 'i', + 'int64_t': 'i', + 'uint64_t': 'i', + 'int_least8_t': 'i', + 'uint_least8_t': 'i', + 'int_least16_t': 'i', + 'uint_least16_t': 'i', + 'int_least32_t': 'i', + 'uint_least32_t': 'i', + 'int_least64_t': 'i', + 'uint_least64_t': 'i', + 'int_fast8_t': 'i', + 'uint_fast8_t': 'i', + 'int_fast16_t': 'i', + 'uint_fast16_t': 'i', + 'int_fast32_t': 'i', + 'uint_fast32_t': 'i', + 'int_fast64_t': 'i', + 'uint_fast64_t': 'i', + 'intptr_t': 'i', + 'uintptr_t': 'i', + 'intmax_t': 'i', + 'uintmax_t': 'i', + 'ptrdiff_t': 'i', + 'size_t': 'i', + 'ssize_t': 'i', + } + + def __init__(self, name): + assert name in self.ALL_PRIMITIVE_TYPES + self.name = name + self.c_name_with_marker = name + '&' + + def is_char_type(self): + return self.ALL_PRIMITIVE_TYPES[self.name] == 'c' + def is_integer_type(self): + return self.ALL_PRIMITIVE_TYPES[self.name] == 'i' + def is_float_type(self): + return self.ALL_PRIMITIVE_TYPES[self.name] == 'f' + def is_complex_type(self): + return self.ALL_PRIMITIVE_TYPES[self.name] == 'j' + + def build_backend_type(self, ffi, finishlist): + return global_cache(self, ffi, 'new_primitive_type', self.name) + + +class UnknownIntegerType(BasePrimitiveType): + _attrs_ = ('name',) + + def __init__(self, name): + self.name = name + self.c_name_with_marker = name + '&' + + def is_integer_type(self): + return True + + def build_backend_type(self, ffi, finishlist): + raise NotImplementedError("integer type '%s' can only be used after " + "compilation" % self.name) + +class UnknownFloatType(BasePrimitiveType): + _attrs_ = ('name', ) + + def __init__(self, name): + self.name = name + self.c_name_with_marker = name + '&' + + def build_backend_type(self, ffi, finishlist): + raise NotImplementedError("float type '%s' can only be used after " + "compilation" % self.name) + + +class BaseFunctionType(BaseType): + _attrs_ = ('args', 'result', 'ellipsis', 'abi') + + def __init__(self, args, result, ellipsis, abi=None): + self.args = args + self.result = result + self.ellipsis = ellipsis + self.abi = abi + # + reprargs = [arg._get_c_name() for arg in self.args] + if self.ellipsis: + reprargs.append('...') + reprargs = reprargs or ['void'] + replace_with = self._base_pattern % (', '.join(reprargs),) + if abi is not None: + replace_with = replace_with[:1] + abi + ' ' + replace_with[1:] + self.c_name_with_marker = ( + self.result.c_name_with_marker.replace('&', replace_with)) + + +class RawFunctionType(BaseFunctionType): + # Corresponds to a C type like 'int(int)', which is the C type of + # a function, but not a pointer-to-function. The backend has no + # notion of such a type; it's used temporarily by parsing. + _base_pattern = '(&)(%s)' + is_raw_function = True + + def build_backend_type(self, ffi, finishlist): + raise CDefError("cannot render the type %r: it is a function " + "type, not a pointer-to-function type" % (self,)) + + def as_function_pointer(self): + return FunctionPtrType(self.args, self.result, self.ellipsis, self.abi) + + +class FunctionPtrType(BaseFunctionType): + _base_pattern = '(*&)(%s)' + + def build_backend_type(self, ffi, finishlist): + result = self.result.get_cached_btype(ffi, finishlist) + args = [] + for tp in self.args: + args.append(tp.get_cached_btype(ffi, finishlist)) + abi_args = () + if self.abi == "__stdcall": + if not self.ellipsis: # __stdcall ignored for variadic funcs + try: + abi_args = (ffi._backend.FFI_STDCALL,) + except AttributeError: + pass + return global_cache(self, ffi, 'new_function_type', + tuple(args), result, self.ellipsis, *abi_args) + + def as_raw_function(self): + return RawFunctionType(self.args, self.result, self.ellipsis, self.abi) + + +class PointerType(BaseType): + _attrs_ = ('totype', 'quals') + + def __init__(self, totype, quals=0): + self.totype = totype + self.quals = quals + extra = qualify(quals, " *&") + if totype.is_array_type: + extra = "(%s)" % (extra.lstrip(),) + self.c_name_with_marker = totype.c_name_with_marker.replace('&', extra) + + def build_backend_type(self, ffi, finishlist): + BItem = self.totype.get_cached_btype(ffi, finishlist, can_delay=True) + return global_cache(self, ffi, 'new_pointer_type', BItem) + +voidp_type = PointerType(void_type) + +def ConstPointerType(totype): + return PointerType(totype, Q_CONST) + +const_voidp_type = ConstPointerType(void_type) + + +class NamedPointerType(PointerType): + _attrs_ = ('totype', 'name') + + def __init__(self, totype, name, quals=0): + PointerType.__init__(self, totype, quals) + self.name = name + self.c_name_with_marker = name + '&' + + +class ArrayType(BaseType): + _attrs_ = ('item', 'length') + is_array_type = True + + def __init__(self, item, length): + self.item = item + self.length = length + # + if length is None: + brackets = '&[]' + elif length == '...': + brackets = '&[/*...*/]' + else: + brackets = '&[%s]' % length + self.c_name_with_marker = ( + self.item.c_name_with_marker.replace('&', brackets)) + + def resolve_length(self, newlength): + return ArrayType(self.item, newlength) + + def build_backend_type(self, ffi, finishlist): + if self.length == '...': + raise CDefError("cannot render the type %r: unknown length" % + (self,)) + self.item.get_cached_btype(ffi, finishlist) # force the item BType + BPtrItem = PointerType(self.item).get_cached_btype(ffi, finishlist) + return global_cache(self, ffi, 'new_array_type', BPtrItem, self.length) + +char_array_type = ArrayType(PrimitiveType('char'), None) + + +class StructOrUnionOrEnum(BaseTypeByIdentity): + _attrs_ = ('name',) + forcename = None + + def build_c_name_with_marker(self): + name = self.forcename or '%s %s' % (self.kind, self.name) + self.c_name_with_marker = name + '&' + + def force_the_name(self, forcename): + self.forcename = forcename + self.build_c_name_with_marker() + + def get_official_name(self): + assert self.c_name_with_marker.endswith('&') + return self.c_name_with_marker[:-1] + + +class StructOrUnion(StructOrUnionOrEnum): + fixedlayout = None + completed = 0 + partial = False + packed = 0 + + def __init__(self, name, fldnames, fldtypes, fldbitsize, fldquals=None): + self.name = name + self.fldnames = fldnames + self.fldtypes = fldtypes + self.fldbitsize = fldbitsize + self.fldquals = fldquals + self.build_c_name_with_marker() + + def anonymous_struct_fields(self): + if self.fldtypes is not None: + for name, type in zip(self.fldnames, self.fldtypes): + if name == '' and isinstance(type, StructOrUnion): + yield type + + def enumfields(self, expand_anonymous_struct_union=True): + fldquals = self.fldquals + if fldquals is None: + fldquals = (0,) * len(self.fldnames) + for name, type, bitsize, quals in zip(self.fldnames, self.fldtypes, + self.fldbitsize, fldquals): + if (name == '' and isinstance(type, StructOrUnion) + and expand_anonymous_struct_union): + # nested anonymous struct/union + for result in type.enumfields(): + yield result + else: + yield (name, type, bitsize, quals) + + def force_flatten(self): + # force the struct or union to have a declaration that lists + # directly all fields returned by enumfields(), flattening + # nested anonymous structs/unions. + names = [] + types = [] + bitsizes = [] + fldquals = [] + for name, type, bitsize, quals in self.enumfields(): + names.append(name) + types.append(type) + bitsizes.append(bitsize) + fldquals.append(quals) + self.fldnames = tuple(names) + self.fldtypes = tuple(types) + self.fldbitsize = tuple(bitsizes) + self.fldquals = tuple(fldquals) + + def get_cached_btype(self, ffi, finishlist, can_delay=False): + BType = StructOrUnionOrEnum.get_cached_btype(self, ffi, finishlist, + can_delay) + if not can_delay: + self.finish_backend_type(ffi, finishlist) + return BType + + def finish_backend_type(self, ffi, finishlist): + if self.completed: + if self.completed != 2: + raise NotImplementedError("recursive structure declaration " + "for '%s'" % (self.name,)) + return + BType = ffi._cached_btypes[self] + # + self.completed = 1 + # + if self.fldtypes is None: + pass # not completing it: it's an opaque struct + # + elif self.fixedlayout is None: + fldtypes = [tp.get_cached_btype(ffi, finishlist) + for tp in self.fldtypes] + lst = list(zip(self.fldnames, fldtypes, self.fldbitsize)) + extra_flags = () + if self.packed: + if self.packed == 1: + extra_flags = (8,) # SF_PACKED + else: + extra_flags = (0, self.packed) + ffi._backend.complete_struct_or_union(BType, lst, self, + -1, -1, *extra_flags) + # + else: + fldtypes = [] + fieldofs, fieldsize, totalsize, totalalignment = self.fixedlayout + for i in range(len(self.fldnames)): + fsize = fieldsize[i] + ftype = self.fldtypes[i] + # + if isinstance(ftype, ArrayType) and ftype.length == '...': + # fix the length to match the total size + BItemType = ftype.item.get_cached_btype(ffi, finishlist) + nlen, nrest = divmod(fsize, ffi.sizeof(BItemType)) + if nrest != 0: + self._verification_error( + "field '%s.%s' has a bogus size?" % ( + self.name, self.fldnames[i] or '{}')) + ftype = ftype.resolve_length(nlen) + self.fldtypes = (self.fldtypes[:i] + (ftype,) + + self.fldtypes[i+1:]) + # + BFieldType = ftype.get_cached_btype(ffi, finishlist) + if isinstance(ftype, ArrayType) and ftype.length is None: + assert fsize == 0 + else: + bitemsize = ffi.sizeof(BFieldType) + if bitemsize != fsize: + self._verification_error( + "field '%s.%s' is declared as %d bytes, but is " + "really %d bytes" % (self.name, + self.fldnames[i] or '{}', + bitemsize, fsize)) + fldtypes.append(BFieldType) + # + lst = list(zip(self.fldnames, fldtypes, self.fldbitsize, fieldofs)) + ffi._backend.complete_struct_or_union(BType, lst, self, + totalsize, totalalignment) + self.completed = 2 + + def _verification_error(self, msg): + raise VerificationError(msg) + + def check_not_partial(self): + if self.partial and self.fixedlayout is None: + raise VerificationMissing(self._get_c_name()) + + def build_backend_type(self, ffi, finishlist): + self.check_not_partial() + finishlist.append(self) + # + return global_cache(self, ffi, 'new_%s_type' % self.kind, + self.get_official_name(), key=self) + + +class StructType(StructOrUnion): + kind = 'struct' + + +class UnionType(StructOrUnion): + kind = 'union' + + +class EnumType(StructOrUnionOrEnum): + kind = 'enum' + partial = False + partial_resolved = False + + def __init__(self, name, enumerators, enumvalues, baseinttype=None): + self.name = name + self.enumerators = enumerators + self.enumvalues = enumvalues + self.baseinttype = baseinttype + self.build_c_name_with_marker() + + def force_the_name(self, forcename): + StructOrUnionOrEnum.force_the_name(self, forcename) + if self.forcename is None: + name = self.get_official_name() + self.forcename = '$' + name.replace(' ', '_') + + def check_not_partial(self): + if self.partial and not self.partial_resolved: + raise VerificationMissing(self._get_c_name()) + + def build_backend_type(self, ffi, finishlist): + self.check_not_partial() + base_btype = self.build_baseinttype(ffi, finishlist) + return global_cache(self, ffi, 'new_enum_type', + self.get_official_name(), + self.enumerators, self.enumvalues, + base_btype, key=self) + + def build_baseinttype(self, ffi, finishlist): + if self.baseinttype is not None: + return self.baseinttype.get_cached_btype(ffi, finishlist) + # + if self.enumvalues: + smallest_value = min(self.enumvalues) + largest_value = max(self.enumvalues) + else: + import warnings + try: + # XXX! The goal is to ensure that the warnings.warn() + # will not suppress the warning. We want to get it + # several times if we reach this point several times. + __warningregistry__.clear() + except NameError: + pass + warnings.warn("%r has no values explicitly defined; " + "guessing that it is equivalent to 'unsigned int'" + % self._get_c_name()) + smallest_value = largest_value = 0 + if smallest_value < 0: # needs a signed type + sign = 1 + candidate1 = PrimitiveType("int") + candidate2 = PrimitiveType("long") + else: + sign = 0 + candidate1 = PrimitiveType("unsigned int") + candidate2 = PrimitiveType("unsigned long") + btype1 = candidate1.get_cached_btype(ffi, finishlist) + btype2 = candidate2.get_cached_btype(ffi, finishlist) + size1 = ffi.sizeof(btype1) + size2 = ffi.sizeof(btype2) + if (smallest_value >= ((-1) << (8*size1-1)) and + largest_value < (1 << (8*size1-sign))): + return btype1 + if (smallest_value >= ((-1) << (8*size2-1)) and + largest_value < (1 << (8*size2-sign))): + return btype2 + raise CDefError("%s values don't all fit into either 'long' " + "or 'unsigned long'" % self._get_c_name()) + +def unknown_type(name, structname=None): + if structname is None: + structname = '$%s' % name + tp = StructType(structname, None, None, None) + tp.force_the_name(name) + tp.origin = "unknown_type" + return tp + +def unknown_ptr_type(name, structname=None): + if structname is None: + structname = '$$%s' % name + tp = StructType(structname, None, None, None) + return NamedPointerType(tp, name) + + +global_lock = allocate_lock() +_typecache_cffi_backend = weakref.WeakValueDictionary() + +def get_typecache(backend): + # returns _typecache_cffi_backend if backend is the _cffi_backend + # module, or type(backend).__typecache if backend is an instance of + # CTypesBackend (or some FakeBackend class during tests) + if isinstance(backend, types.ModuleType): + return _typecache_cffi_backend + with global_lock: + if not hasattr(type(backend), '__typecache'): + type(backend).__typecache = weakref.WeakValueDictionary() + return type(backend).__typecache + +def global_cache(srctype, ffi, funcname, *args, **kwds): + key = kwds.pop('key', (funcname, args)) + assert not kwds + try: + return ffi._typecache[key] + except KeyError: + pass + try: + res = getattr(ffi._backend, funcname)(*args) + except NotImplementedError as e: + raise NotImplementedError("%s: %r: %s" % (funcname, srctype, e)) + # note that setdefault() on WeakValueDictionary is not atomic + # and contains a rare bug (http://bugs.python.org/issue19542); + # we have to use a lock and do it ourselves + cache = ffi._typecache + with global_lock: + res1 = cache.get(key) + if res1 is None: + cache[key] = res + return res + else: + return res1 + +def pointer_cache(ffi, BType): + return global_cache('?', ffi, 'new_pointer_type', BType) + +def attach_exception_info(e, name): + if e.args and type(e.args[0]) is str: + e.args = ('%s: %s' % (name, e.args[0]),) + e.args[1:] diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/cffi/parse_c_type.h b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/cffi/parse_c_type.h new file mode 100644 index 00000000..84e4ef85 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/cffi/parse_c_type.h @@ -0,0 +1,181 @@ + +/* This part is from file 'cffi/parse_c_type.h'. It is copied at the + beginning of C sources generated by CFFI's ffi.set_source(). */ + +typedef void *_cffi_opcode_t; + +#define _CFFI_OP(opcode, arg) (_cffi_opcode_t)(opcode | (((uintptr_t)(arg)) << 8)) +#define _CFFI_GETOP(cffi_opcode) ((unsigned char)(uintptr_t)cffi_opcode) +#define _CFFI_GETARG(cffi_opcode) (((intptr_t)cffi_opcode) >> 8) + +#define _CFFI_OP_PRIMITIVE 1 +#define _CFFI_OP_POINTER 3 +#define _CFFI_OP_ARRAY 5 +#define _CFFI_OP_OPEN_ARRAY 7 +#define _CFFI_OP_STRUCT_UNION 9 +#define _CFFI_OP_ENUM 11 +#define _CFFI_OP_FUNCTION 13 +#define _CFFI_OP_FUNCTION_END 15 +#define _CFFI_OP_NOOP 17 +#define _CFFI_OP_BITFIELD 19 +#define _CFFI_OP_TYPENAME 21 +#define _CFFI_OP_CPYTHON_BLTN_V 23 // varargs +#define _CFFI_OP_CPYTHON_BLTN_N 25 // noargs +#define _CFFI_OP_CPYTHON_BLTN_O 27 // O (i.e. a single arg) +#define _CFFI_OP_CONSTANT 29 +#define _CFFI_OP_CONSTANT_INT 31 +#define _CFFI_OP_GLOBAL_VAR 33 +#define _CFFI_OP_DLOPEN_FUNC 35 +#define _CFFI_OP_DLOPEN_CONST 37 +#define _CFFI_OP_GLOBAL_VAR_F 39 +#define _CFFI_OP_EXTERN_PYTHON 41 + +#define _CFFI_PRIM_VOID 0 +#define _CFFI_PRIM_BOOL 1 +#define _CFFI_PRIM_CHAR 2 +#define _CFFI_PRIM_SCHAR 3 +#define _CFFI_PRIM_UCHAR 4 +#define _CFFI_PRIM_SHORT 5 +#define _CFFI_PRIM_USHORT 6 +#define _CFFI_PRIM_INT 7 +#define _CFFI_PRIM_UINT 8 +#define _CFFI_PRIM_LONG 9 +#define _CFFI_PRIM_ULONG 10 +#define _CFFI_PRIM_LONGLONG 11 +#define _CFFI_PRIM_ULONGLONG 12 +#define _CFFI_PRIM_FLOAT 13 +#define _CFFI_PRIM_DOUBLE 14 +#define _CFFI_PRIM_LONGDOUBLE 15 + +#define _CFFI_PRIM_WCHAR 16 +#define _CFFI_PRIM_INT8 17 +#define _CFFI_PRIM_UINT8 18 +#define _CFFI_PRIM_INT16 19 +#define _CFFI_PRIM_UINT16 20 +#define _CFFI_PRIM_INT32 21 +#define _CFFI_PRIM_UINT32 22 +#define _CFFI_PRIM_INT64 23 +#define _CFFI_PRIM_UINT64 24 +#define _CFFI_PRIM_INTPTR 25 +#define _CFFI_PRIM_UINTPTR 26 +#define _CFFI_PRIM_PTRDIFF 27 +#define _CFFI_PRIM_SIZE 28 +#define _CFFI_PRIM_SSIZE 29 +#define _CFFI_PRIM_INT_LEAST8 30 +#define _CFFI_PRIM_UINT_LEAST8 31 +#define _CFFI_PRIM_INT_LEAST16 32 +#define _CFFI_PRIM_UINT_LEAST16 33 +#define _CFFI_PRIM_INT_LEAST32 34 +#define _CFFI_PRIM_UINT_LEAST32 35 +#define _CFFI_PRIM_INT_LEAST64 36 +#define _CFFI_PRIM_UINT_LEAST64 37 +#define _CFFI_PRIM_INT_FAST8 38 +#define _CFFI_PRIM_UINT_FAST8 39 +#define _CFFI_PRIM_INT_FAST16 40 +#define _CFFI_PRIM_UINT_FAST16 41 +#define _CFFI_PRIM_INT_FAST32 42 +#define _CFFI_PRIM_UINT_FAST32 43 +#define _CFFI_PRIM_INT_FAST64 44 +#define _CFFI_PRIM_UINT_FAST64 45 +#define _CFFI_PRIM_INTMAX 46 +#define _CFFI_PRIM_UINTMAX 47 +#define _CFFI_PRIM_FLOATCOMPLEX 48 +#define _CFFI_PRIM_DOUBLECOMPLEX 49 +#define _CFFI_PRIM_CHAR16 50 +#define _CFFI_PRIM_CHAR32 51 + +#define _CFFI__NUM_PRIM 52 +#define _CFFI__UNKNOWN_PRIM (-1) +#define _CFFI__UNKNOWN_FLOAT_PRIM (-2) +#define _CFFI__UNKNOWN_LONG_DOUBLE (-3) + +#define _CFFI__IO_FILE_STRUCT (-1) + + +struct _cffi_global_s { + const char *name; + void *address; + _cffi_opcode_t type_op; + void *size_or_direct_fn; // OP_GLOBAL_VAR: size, or 0 if unknown + // OP_CPYTHON_BLTN_*: addr of direct function +}; + +struct _cffi_getconst_s { + unsigned long long value; + const struct _cffi_type_context_s *ctx; + int gindex; +}; + +struct _cffi_struct_union_s { + const char *name; + int type_index; // -> _cffi_types, on a OP_STRUCT_UNION + int flags; // _CFFI_F_* flags below + size_t size; + int alignment; + int first_field_index; // -> _cffi_fields array + int num_fields; +}; +#define _CFFI_F_UNION 0x01 // is a union, not a struct +#define _CFFI_F_CHECK_FIELDS 0x02 // complain if fields are not in the + // "standard layout" or if some are missing +#define _CFFI_F_PACKED 0x04 // for CHECK_FIELDS, assume a packed struct +#define _CFFI_F_EXTERNAL 0x08 // in some other ffi.include() +#define _CFFI_F_OPAQUE 0x10 // opaque + +struct _cffi_field_s { + const char *name; + size_t field_offset; + size_t field_size; + _cffi_opcode_t field_type_op; +}; + +struct _cffi_enum_s { + const char *name; + int type_index; // -> _cffi_types, on a OP_ENUM + int type_prim; // _CFFI_PRIM_xxx + const char *enumerators; // comma-delimited string +}; + +struct _cffi_typename_s { + const char *name; + int type_index; /* if opaque, points to a possibly artificial + OP_STRUCT which is itself opaque */ +}; + +struct _cffi_type_context_s { + _cffi_opcode_t *types; + const struct _cffi_global_s *globals; + const struct _cffi_field_s *fields; + const struct _cffi_struct_union_s *struct_unions; + const struct _cffi_enum_s *enums; + const struct _cffi_typename_s *typenames; + int num_globals; + int num_struct_unions; + int num_enums; + int num_typenames; + const char *const *includes; + int num_types; + int flags; /* future extension */ +}; + +struct _cffi_parse_info_s { + const struct _cffi_type_context_s *ctx; + _cffi_opcode_t *output; + unsigned int output_size; + size_t error_location; + const char *error_message; +}; + +struct _cffi_externpy_s { + const char *name; + size_t size_of_result; + void *reserved1, *reserved2; +}; + +#ifdef _CFFI_INTERNAL +static int parse_c_type(struct _cffi_parse_info_s *info, const char *input); +static int search_in_globals(const struct _cffi_type_context_s *ctx, + const char *search, size_t search_len); +static int search_in_struct_unions(const struct _cffi_type_context_s *ctx, + const char *search, size_t search_len); +#endif diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/cffi/pkgconfig.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/cffi/pkgconfig.py new file mode 100644 index 00000000..5c93f15a --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/cffi/pkgconfig.py @@ -0,0 +1,121 @@ +# pkg-config, https://www.freedesktop.org/wiki/Software/pkg-config/ integration for cffi +import sys, os, subprocess + +from .error import PkgConfigError + + +def merge_flags(cfg1, cfg2): + """Merge values from cffi config flags cfg2 to cf1 + + Example: + merge_flags({"libraries": ["one"]}, {"libraries": ["two"]}) + {"libraries": ["one", "two"]} + """ + for key, value in cfg2.items(): + if key not in cfg1: + cfg1[key] = value + else: + if not isinstance(cfg1[key], list): + raise TypeError("cfg1[%r] should be a list of strings" % (key,)) + if not isinstance(value, list): + raise TypeError("cfg2[%r] should be a list of strings" % (key,)) + cfg1[key].extend(value) + return cfg1 + + +def call(libname, flag, encoding=sys.getfilesystemencoding()): + """Calls pkg-config and returns the output if found + """ + a = ["pkg-config", "--print-errors"] + a.append(flag) + a.append(libname) + try: + pc = subprocess.Popen(a, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + except EnvironmentError as e: + raise PkgConfigError("cannot run pkg-config: %s" % (str(e).strip(),)) + + bout, berr = pc.communicate() + if pc.returncode != 0: + try: + berr = berr.decode(encoding) + except Exception: + pass + raise PkgConfigError(berr.strip()) + + if sys.version_info >= (3,) and not isinstance(bout, str): # Python 3.x + try: + bout = bout.decode(encoding) + except UnicodeDecodeError: + raise PkgConfigError("pkg-config %s %s returned bytes that cannot " + "be decoded with encoding %r:\n%r" % + (flag, libname, encoding, bout)) + + if os.altsep != '\\' and '\\' in bout: + raise PkgConfigError("pkg-config %s %s returned an unsupported " + "backslash-escaped output:\n%r" % + (flag, libname, bout)) + return bout + + +def flags_from_pkgconfig(libs): + r"""Return compiler line flags for FFI.set_source based on pkg-config output + + Usage + ... + ffibuilder.set_source("_foo", pkgconfig = ["libfoo", "libbar >= 1.8.3"]) + + If pkg-config is installed on build machine, then arguments include_dirs, + library_dirs, libraries, define_macros, extra_compile_args and + extra_link_args are extended with an output of pkg-config for libfoo and + libbar. + + Raises PkgConfigError in case the pkg-config call fails. + """ + + def get_include_dirs(string): + return [x[2:] for x in string.split() if x.startswith("-I")] + + def get_library_dirs(string): + return [x[2:] for x in string.split() if x.startswith("-L")] + + def get_libraries(string): + return [x[2:] for x in string.split() if x.startswith("-l")] + + # convert -Dfoo=bar to list of tuples [("foo", "bar")] expected by distutils + def get_macros(string): + def _macro(x): + x = x[2:] # drop "-D" + if '=' in x: + return tuple(x.split("=", 1)) # "-Dfoo=bar" => ("foo", "bar") + else: + return (x, None) # "-Dfoo" => ("foo", None) + return [_macro(x) for x in string.split() if x.startswith("-D")] + + def get_other_cflags(string): + return [x for x in string.split() if not x.startswith("-I") and + not x.startswith("-D")] + + def get_other_libs(string): + return [x for x in string.split() if not x.startswith("-L") and + not x.startswith("-l")] + + # return kwargs for given libname + def kwargs(libname): + fse = sys.getfilesystemencoding() + all_cflags = call(libname, "--cflags") + all_libs = call(libname, "--libs") + return { + "include_dirs": get_include_dirs(all_cflags), + "library_dirs": get_library_dirs(all_libs), + "libraries": get_libraries(all_libs), + "define_macros": get_macros(all_cflags), + "extra_compile_args": get_other_cflags(all_cflags), + "extra_link_args": get_other_libs(all_libs), + } + + # merge all arguments together + ret = {} + for libname in libs: + lib_flags = kwargs(libname) + merge_flags(ret, lib_flags) + return ret diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/cffi/recompiler.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/cffi/recompiler.py new file mode 100644 index 00000000..20e912b2 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/cffi/recompiler.py @@ -0,0 +1,1542 @@ +import os, sys, io +from . import ffiplatform, model +from .error import VerificationError +from .cffi_opcode import * + +VERSION_BASE = 0x2601 +VERSION_EMBEDDED = 0x2701 +VERSION_CHAR16CHAR32 = 0x2801 + + +class GlobalExpr: + def __init__(self, name, address, type_op, size=0, check_value=0): + self.name = name + self.address = address + self.type_op = type_op + self.size = size + self.check_value = check_value + + def as_c_expr(self): + return ' { "%s", (void *)%s, %s, (void *)%s },' % ( + self.name, self.address, self.type_op.as_c_expr(), self.size) + + def as_python_expr(self): + return "b'%s%s',%d" % (self.type_op.as_python_bytes(), self.name, + self.check_value) + +class FieldExpr: + def __init__(self, name, field_offset, field_size, fbitsize, field_type_op): + self.name = name + self.field_offset = field_offset + self.field_size = field_size + self.fbitsize = fbitsize + self.field_type_op = field_type_op + + def as_c_expr(self): + spaces = " " * len(self.name) + return (' { "%s", %s,\n' % (self.name, self.field_offset) + + ' %s %s,\n' % (spaces, self.field_size) + + ' %s %s },' % (spaces, self.field_type_op.as_c_expr())) + + def as_python_expr(self): + raise NotImplementedError + + def as_field_python_expr(self): + if self.field_type_op.op == OP_NOOP: + size_expr = '' + elif self.field_type_op.op == OP_BITFIELD: + size_expr = format_four_bytes(self.fbitsize) + else: + raise NotImplementedError + return "b'%s%s%s'" % (self.field_type_op.as_python_bytes(), + size_expr, + self.name) + +class StructUnionExpr: + def __init__(self, name, type_index, flags, size, alignment, comment, + first_field_index, c_fields): + self.name = name + self.type_index = type_index + self.flags = flags + self.size = size + self.alignment = alignment + self.comment = comment + self.first_field_index = first_field_index + self.c_fields = c_fields + + def as_c_expr(self): + return (' { "%s", %d, %s,' % (self.name, self.type_index, self.flags) + + '\n %s, %s, ' % (self.size, self.alignment) + + '%d, %d ' % (self.first_field_index, len(self.c_fields)) + + ('/* %s */ ' % self.comment if self.comment else '') + + '},') + + def as_python_expr(self): + flags = eval(self.flags, G_FLAGS) + fields_expr = [c_field.as_field_python_expr() + for c_field in self.c_fields] + return "(b'%s%s%s',%s)" % ( + format_four_bytes(self.type_index), + format_four_bytes(flags), + self.name, + ','.join(fields_expr)) + +class EnumExpr: + def __init__(self, name, type_index, size, signed, allenums): + self.name = name + self.type_index = type_index + self.size = size + self.signed = signed + self.allenums = allenums + + def as_c_expr(self): + return (' { "%s", %d, _cffi_prim_int(%s, %s),\n' + ' "%s" },' % (self.name, self.type_index, + self.size, self.signed, self.allenums)) + + def as_python_expr(self): + prim_index = { + (1, 0): PRIM_UINT8, (1, 1): PRIM_INT8, + (2, 0): PRIM_UINT16, (2, 1): PRIM_INT16, + (4, 0): PRIM_UINT32, (4, 1): PRIM_INT32, + (8, 0): PRIM_UINT64, (8, 1): PRIM_INT64, + }[self.size, self.signed] + return "b'%s%s%s\\x00%s'" % (format_four_bytes(self.type_index), + format_four_bytes(prim_index), + self.name, self.allenums) + +class TypenameExpr: + def __init__(self, name, type_index): + self.name = name + self.type_index = type_index + + def as_c_expr(self): + return ' { "%s", %d },' % (self.name, self.type_index) + + def as_python_expr(self): + return "b'%s%s'" % (format_four_bytes(self.type_index), self.name) + + +# ____________________________________________________________ + + +class Recompiler: + _num_externpy = 0 + + def __init__(self, ffi, module_name, target_is_python=False): + self.ffi = ffi + self.module_name = module_name + self.target_is_python = target_is_python + self._version = VERSION_BASE + + def needs_version(self, ver): + self._version = max(self._version, ver) + + def collect_type_table(self): + self._typesdict = {} + self._generate("collecttype") + # + all_decls = sorted(self._typesdict, key=str) + # + # prepare all FUNCTION bytecode sequences first + self.cffi_types = [] + for tp in all_decls: + if tp.is_raw_function: + assert self._typesdict[tp] is None + self._typesdict[tp] = len(self.cffi_types) + self.cffi_types.append(tp) # placeholder + for tp1 in tp.args: + assert isinstance(tp1, (model.VoidType, + model.BasePrimitiveType, + model.PointerType, + model.StructOrUnionOrEnum, + model.FunctionPtrType)) + if self._typesdict[tp1] is None: + self._typesdict[tp1] = len(self.cffi_types) + self.cffi_types.append(tp1) # placeholder + self.cffi_types.append('END') # placeholder + # + # prepare all OTHER bytecode sequences + for tp in all_decls: + if not tp.is_raw_function and self._typesdict[tp] is None: + self._typesdict[tp] = len(self.cffi_types) + self.cffi_types.append(tp) # placeholder + if tp.is_array_type and tp.length is not None: + self.cffi_types.append('LEN') # placeholder + assert None not in self._typesdict.values() + # + # collect all structs and unions and enums + self._struct_unions = {} + self._enums = {} + for tp in all_decls: + if isinstance(tp, model.StructOrUnion): + self._struct_unions[tp] = None + elif isinstance(tp, model.EnumType): + self._enums[tp] = None + for i, tp in enumerate(sorted(self._struct_unions, + key=lambda tp: tp.name)): + self._struct_unions[tp] = i + for i, tp in enumerate(sorted(self._enums, + key=lambda tp: tp.name)): + self._enums[tp] = i + # + # emit all bytecode sequences now + for tp in all_decls: + method = getattr(self, '_emit_bytecode_' + tp.__class__.__name__) + method(tp, self._typesdict[tp]) + # + # consistency check + for op in self.cffi_types: + assert isinstance(op, CffiOp) + self.cffi_types = tuple(self.cffi_types) # don't change any more + + def _do_collect_type(self, tp): + if not isinstance(tp, model.BaseTypeByIdentity): + if isinstance(tp, tuple): + for x in tp: + self._do_collect_type(x) + return + if tp not in self._typesdict: + self._typesdict[tp] = None + if isinstance(tp, model.FunctionPtrType): + self._do_collect_type(tp.as_raw_function()) + elif isinstance(tp, model.StructOrUnion): + if tp.fldtypes is not None and ( + tp not in self.ffi._parser._included_declarations): + for name1, tp1, _, _ in tp.enumfields(): + self._do_collect_type(self._field_type(tp, name1, tp1)) + else: + for _, x in tp._get_items(): + self._do_collect_type(x) + + def _generate(self, step_name): + lst = self.ffi._parser._declarations.items() + for name, (tp, quals) in sorted(lst): + kind, realname = name.split(' ', 1) + try: + method = getattr(self, '_generate_cpy_%s_%s' % (kind, + step_name)) + except AttributeError: + raise VerificationError( + "not implemented in recompile(): %r" % name) + try: + self._current_quals = quals + method(tp, realname) + except Exception as e: + model.attach_exception_info(e, name) + raise + + # ---------- + + ALL_STEPS = ["global", "field", "struct_union", "enum", "typename"] + + def collect_step_tables(self): + # collect the declarations for '_cffi_globals', '_cffi_typenames', etc. + self._lsts = {} + for step_name in self.ALL_STEPS: + self._lsts[step_name] = [] + self._seen_struct_unions = set() + self._generate("ctx") + self._add_missing_struct_unions() + # + for step_name in self.ALL_STEPS: + lst = self._lsts[step_name] + if step_name != "field": + lst.sort(key=lambda entry: entry.name) + self._lsts[step_name] = tuple(lst) # don't change any more + # + # check for a possible internal inconsistency: _cffi_struct_unions + # should have been generated with exactly self._struct_unions + lst = self._lsts["struct_union"] + for tp, i in self._struct_unions.items(): + assert i < len(lst) + assert lst[i].name == tp.name + assert len(lst) == len(self._struct_unions) + # same with enums + lst = self._lsts["enum"] + for tp, i in self._enums.items(): + assert i < len(lst) + assert lst[i].name == tp.name + assert len(lst) == len(self._enums) + + # ---------- + + def _prnt(self, what=''): + self._f.write(what + '\n') + + def write_source_to_f(self, f, preamble): + if self.target_is_python: + assert preamble is None + self.write_py_source_to_f(f) + else: + assert preamble is not None + self.write_c_source_to_f(f, preamble) + + def _rel_readlines(self, filename): + g = open(os.path.join(os.path.dirname(__file__), filename), 'r') + lines = g.readlines() + g.close() + return lines + + def write_c_source_to_f(self, f, preamble): + self._f = f + prnt = self._prnt + if self.ffi._embedding is not None: + prnt('#define _CFFI_USE_EMBEDDING') + # + # first the '#include' (actually done by inlining the file's content) + lines = self._rel_readlines('_cffi_include.h') + i = lines.index('#include "parse_c_type.h"\n') + lines[i:i+1] = self._rel_readlines('parse_c_type.h') + prnt(''.join(lines)) + # + # if we have ffi._embedding != None, we give it here as a macro + # and include an extra file + base_module_name = self.module_name.split('.')[-1] + if self.ffi._embedding is not None: + prnt('#define _CFFI_MODULE_NAME "%s"' % (self.module_name,)) + prnt('static const char _CFFI_PYTHON_STARTUP_CODE[] = {') + self._print_string_literal_in_array(self.ffi._embedding) + prnt('0 };') + prnt('#ifdef PYPY_VERSION') + prnt('# define _CFFI_PYTHON_STARTUP_FUNC _cffi_pypyinit_%s' % ( + base_module_name,)) + prnt('#elif PY_MAJOR_VERSION >= 3') + prnt('# define _CFFI_PYTHON_STARTUP_FUNC PyInit_%s' % ( + base_module_name,)) + prnt('#else') + prnt('# define _CFFI_PYTHON_STARTUP_FUNC init%s' % ( + base_module_name,)) + prnt('#endif') + lines = self._rel_readlines('_embedding.h') + i = lines.index('#include "_cffi_errors.h"\n') + lines[i:i+1] = self._rel_readlines('_cffi_errors.h') + prnt(''.join(lines)) + self.needs_version(VERSION_EMBEDDED) + # + # then paste the C source given by the user, verbatim. + prnt('/************************************************************/') + prnt() + prnt(preamble) + prnt() + prnt('/************************************************************/') + prnt() + # + # the declaration of '_cffi_types' + prnt('static void *_cffi_types[] = {') + typeindex2type = dict([(i, tp) for (tp, i) in self._typesdict.items()]) + for i, op in enumerate(self.cffi_types): + comment = '' + if i in typeindex2type: + comment = ' // ' + typeindex2type[i]._get_c_name() + prnt('/* %2d */ %s,%s' % (i, op.as_c_expr(), comment)) + if not self.cffi_types: + prnt(' 0') + prnt('};') + prnt() + # + # call generate_cpy_xxx_decl(), for every xxx found from + # ffi._parser._declarations. This generates all the functions. + self._seen_constants = set() + self._generate("decl") + # + # the declaration of '_cffi_globals' and '_cffi_typenames' + nums = {} + for step_name in self.ALL_STEPS: + lst = self._lsts[step_name] + nums[step_name] = len(lst) + if nums[step_name] > 0: + prnt('static const struct _cffi_%s_s _cffi_%ss[] = {' % ( + step_name, step_name)) + for entry in lst: + prnt(entry.as_c_expr()) + prnt('};') + prnt() + # + # the declaration of '_cffi_includes' + if self.ffi._included_ffis: + prnt('static const char * const _cffi_includes[] = {') + for ffi_to_include in self.ffi._included_ffis: + try: + included_module_name, included_source = ( + ffi_to_include._assigned_source[:2]) + except AttributeError: + raise VerificationError( + "ffi object %r includes %r, but the latter has not " + "been prepared with set_source()" % ( + self.ffi, ffi_to_include,)) + if included_source is None: + raise VerificationError( + "not implemented yet: ffi.include() of a Python-based " + "ffi inside a C-based ffi") + prnt(' "%s",' % (included_module_name,)) + prnt(' NULL') + prnt('};') + prnt() + # + # the declaration of '_cffi_type_context' + prnt('static const struct _cffi_type_context_s _cffi_type_context = {') + prnt(' _cffi_types,') + for step_name in self.ALL_STEPS: + if nums[step_name] > 0: + prnt(' _cffi_%ss,' % step_name) + else: + prnt(' NULL, /* no %ss */' % step_name) + for step_name in self.ALL_STEPS: + if step_name != "field": + prnt(' %d, /* num_%ss */' % (nums[step_name], step_name)) + if self.ffi._included_ffis: + prnt(' _cffi_includes,') + else: + prnt(' NULL, /* no includes */') + prnt(' %d, /* num_types */' % (len(self.cffi_types),)) + flags = 0 + if self._num_externpy: + flags |= 1 # set to mean that we use extern "Python" + prnt(' %d, /* flags */' % flags) + prnt('};') + prnt() + # + # the init function + prnt('#ifdef __GNUC__') + prnt('# pragma GCC visibility push(default) /* for -fvisibility= */') + prnt('#endif') + prnt() + prnt('#ifdef PYPY_VERSION') + prnt('PyMODINIT_FUNC') + prnt('_cffi_pypyinit_%s(const void *p[])' % (base_module_name,)) + prnt('{') + if self._num_externpy: + prnt(' if (((intptr_t)p[0]) >= 0x0A03) {') + prnt(' _cffi_call_python_org = ' + '(void(*)(struct _cffi_externpy_s *, char *))p[1];') + prnt(' }') + prnt(' p[0] = (const void *)0x%x;' % self._version) + prnt(' p[1] = &_cffi_type_context;') + prnt('#if PY_MAJOR_VERSION >= 3') + prnt(' return NULL;') + prnt('#endif') + prnt('}') + # on Windows, distutils insists on putting init_cffi_xyz in + # 'export_symbols', so instead of fighting it, just give up and + # give it one + prnt('# ifdef _MSC_VER') + prnt(' PyMODINIT_FUNC') + prnt('# if PY_MAJOR_VERSION >= 3') + prnt(' PyInit_%s(void) { return NULL; }' % (base_module_name,)) + prnt('# else') + prnt(' init%s(void) { }' % (base_module_name,)) + prnt('# endif') + prnt('# endif') + prnt('#elif PY_MAJOR_VERSION >= 3') + prnt('PyMODINIT_FUNC') + prnt('PyInit_%s(void)' % (base_module_name,)) + prnt('{') + prnt(' return _cffi_init("%s", 0x%x, &_cffi_type_context);' % ( + self.module_name, self._version)) + prnt('}') + prnt('#else') + prnt('PyMODINIT_FUNC') + prnt('init%s(void)' % (base_module_name,)) + prnt('{') + prnt(' _cffi_init("%s", 0x%x, &_cffi_type_context);' % ( + self.module_name, self._version)) + prnt('}') + prnt('#endif') + prnt() + prnt('#ifdef __GNUC__') + prnt('# pragma GCC visibility pop') + prnt('#endif') + self._version = None + + def _to_py(self, x): + if isinstance(x, str): + return "b'%s'" % (x,) + if isinstance(x, (list, tuple)): + rep = [self._to_py(item) for item in x] + if len(rep) == 1: + rep.append('') + return "(%s)" % (','.join(rep),) + return x.as_python_expr() # Py2: unicode unexpected; Py3: bytes unexp. + + def write_py_source_to_f(self, f): + self._f = f + prnt = self._prnt + # + # header + prnt("# auto-generated file") + prnt("import _cffi_backend") + # + # the 'import' of the included ffis + num_includes = len(self.ffi._included_ffis or ()) + for i in range(num_includes): + ffi_to_include = self.ffi._included_ffis[i] + try: + included_module_name, included_source = ( + ffi_to_include._assigned_source[:2]) + except AttributeError: + raise VerificationError( + "ffi object %r includes %r, but the latter has not " + "been prepared with set_source()" % ( + self.ffi, ffi_to_include,)) + if included_source is not None: + raise VerificationError( + "not implemented yet: ffi.include() of a C-based " + "ffi inside a Python-based ffi") + prnt('from %s import ffi as _ffi%d' % (included_module_name, i)) + prnt() + prnt("ffi = _cffi_backend.FFI('%s'," % (self.module_name,)) + prnt(" _version = 0x%x," % (self._version,)) + self._version = None + # + # the '_types' keyword argument + self.cffi_types = tuple(self.cffi_types) # don't change any more + types_lst = [op.as_python_bytes() for op in self.cffi_types] + prnt(' _types = %s,' % (self._to_py(''.join(types_lst)),)) + typeindex2type = dict([(i, tp) for (tp, i) in self._typesdict.items()]) + # + # the keyword arguments from ALL_STEPS + for step_name in self.ALL_STEPS: + lst = self._lsts[step_name] + if len(lst) > 0 and step_name != "field": + prnt(' _%ss = %s,' % (step_name, self._to_py(lst))) + # + # the '_includes' keyword argument + if num_includes > 0: + prnt(' _includes = (%s,),' % ( + ', '.join(['_ffi%d' % i for i in range(num_includes)]),)) + # + # the footer + prnt(')') + + # ---------- + + def _gettypenum(self, type): + # a KeyError here is a bug. please report it! :-) + return self._typesdict[type] + + def _convert_funcarg_to_c(self, tp, fromvar, tovar, errcode): + extraarg = '' + if isinstance(tp, model.BasePrimitiveType) and not tp.is_complex_type(): + if tp.is_integer_type() and tp.name != '_Bool': + converter = '_cffi_to_c_int' + extraarg = ', %s' % tp.name + elif isinstance(tp, model.UnknownFloatType): + # don't check with is_float_type(): it may be a 'long + # double' here, and _cffi_to_c_double would loose precision + converter = '(%s)_cffi_to_c_double' % (tp.get_c_name(''),) + else: + cname = tp.get_c_name('') + converter = '(%s)_cffi_to_c_%s' % (cname, + tp.name.replace(' ', '_')) + if cname in ('char16_t', 'char32_t'): + self.needs_version(VERSION_CHAR16CHAR32) + errvalue = '-1' + # + elif isinstance(tp, model.PointerType): + self._convert_funcarg_to_c_ptr_or_array(tp, fromvar, + tovar, errcode) + return + # + elif (isinstance(tp, model.StructOrUnionOrEnum) or + isinstance(tp, model.BasePrimitiveType)): + # a struct (not a struct pointer) as a function argument; + # or, a complex (the same code works) + self._prnt(' if (_cffi_to_c((char *)&%s, _cffi_type(%d), %s) < 0)' + % (tovar, self._gettypenum(tp), fromvar)) + self._prnt(' %s;' % errcode) + return + # + elif isinstance(tp, model.FunctionPtrType): + converter = '(%s)_cffi_to_c_pointer' % tp.get_c_name('') + extraarg = ', _cffi_type(%d)' % self._gettypenum(tp) + errvalue = 'NULL' + # + else: + raise NotImplementedError(tp) + # + self._prnt(' %s = %s(%s%s);' % (tovar, converter, fromvar, extraarg)) + self._prnt(' if (%s == (%s)%s && PyErr_Occurred())' % ( + tovar, tp.get_c_name(''), errvalue)) + self._prnt(' %s;' % errcode) + + def _extra_local_variables(self, tp, localvars): + if isinstance(tp, model.PointerType): + localvars.add('Py_ssize_t datasize') + + def _convert_funcarg_to_c_ptr_or_array(self, tp, fromvar, tovar, errcode): + self._prnt(' datasize = _cffi_prepare_pointer_call_argument(') + self._prnt(' _cffi_type(%d), %s, (char **)&%s);' % ( + self._gettypenum(tp), fromvar, tovar)) + self._prnt(' if (datasize != 0) {') + self._prnt(' if (datasize < 0)') + self._prnt(' %s;' % errcode) + self._prnt(' %s = (%s)alloca((size_t)datasize);' % ( + tovar, tp.get_c_name(''))) + self._prnt(' memset((void *)%s, 0, (size_t)datasize);' % (tovar,)) + self._prnt(' if (_cffi_convert_array_from_object(' + '(char *)%s, _cffi_type(%d), %s) < 0)' % ( + tovar, self._gettypenum(tp), fromvar)) + self._prnt(' %s;' % errcode) + self._prnt(' }') + + def _convert_expr_from_c(self, tp, var, context): + if isinstance(tp, model.BasePrimitiveType): + if tp.is_integer_type() and tp.name != '_Bool': + return '_cffi_from_c_int(%s, %s)' % (var, tp.name) + elif isinstance(tp, model.UnknownFloatType): + return '_cffi_from_c_double(%s)' % (var,) + elif tp.name != 'long double' and not tp.is_complex_type(): + cname = tp.name.replace(' ', '_') + if cname in ('char16_t', 'char32_t'): + self.needs_version(VERSION_CHAR16CHAR32) + return '_cffi_from_c_%s(%s)' % (cname, var) + else: + return '_cffi_from_c_deref((char *)&%s, _cffi_type(%d))' % ( + var, self._gettypenum(tp)) + elif isinstance(tp, (model.PointerType, model.FunctionPtrType)): + return '_cffi_from_c_pointer((char *)%s, _cffi_type(%d))' % ( + var, self._gettypenum(tp)) + elif isinstance(tp, model.ArrayType): + return '_cffi_from_c_pointer((char *)%s, _cffi_type(%d))' % ( + var, self._gettypenum(model.PointerType(tp.item))) + elif isinstance(tp, model.StructOrUnion): + if tp.fldnames is None: + raise TypeError("'%s' is used as %s, but is opaque" % ( + tp._get_c_name(), context)) + return '_cffi_from_c_struct((char *)&%s, _cffi_type(%d))' % ( + var, self._gettypenum(tp)) + elif isinstance(tp, model.EnumType): + return '_cffi_from_c_deref((char *)&%s, _cffi_type(%d))' % ( + var, self._gettypenum(tp)) + else: + raise NotImplementedError(tp) + + # ---------- + # typedefs + + def _typedef_type(self, tp, name): + return self._global_type(tp, "(*(%s *)0)" % (name,)) + + def _generate_cpy_typedef_collecttype(self, tp, name): + self._do_collect_type(self._typedef_type(tp, name)) + + def _generate_cpy_typedef_decl(self, tp, name): + pass + + def _typedef_ctx(self, tp, name): + type_index = self._typesdict[tp] + self._lsts["typename"].append(TypenameExpr(name, type_index)) + + def _generate_cpy_typedef_ctx(self, tp, name): + tp = self._typedef_type(tp, name) + self._typedef_ctx(tp, name) + if getattr(tp, "origin", None) == "unknown_type": + self._struct_ctx(tp, tp.name, approxname=None) + elif isinstance(tp, model.NamedPointerType): + self._struct_ctx(tp.totype, tp.totype.name, approxname=tp.name, + named_ptr=tp) + + # ---------- + # function declarations + + def _generate_cpy_function_collecttype(self, tp, name): + self._do_collect_type(tp.as_raw_function()) + if tp.ellipsis and not self.target_is_python: + self._do_collect_type(tp) + + def _generate_cpy_function_decl(self, tp, name): + assert not self.target_is_python + assert isinstance(tp, model.FunctionPtrType) + if tp.ellipsis: + # cannot support vararg functions better than this: check for its + # exact type (including the fixed arguments), and build it as a + # constant function pointer (no CPython wrapper) + self._generate_cpy_constant_decl(tp, name) + return + prnt = self._prnt + numargs = len(tp.args) + if numargs == 0: + argname = 'noarg' + elif numargs == 1: + argname = 'arg0' + else: + argname = 'args' + # + # ------------------------------ + # the 'd' version of the function, only for addressof(lib, 'func') + arguments = [] + call_arguments = [] + context = 'argument of %s' % name + for i, type in enumerate(tp.args): + arguments.append(type.get_c_name(' x%d' % i, context)) + call_arguments.append('x%d' % i) + repr_arguments = ', '.join(arguments) + repr_arguments = repr_arguments or 'void' + if tp.abi: + abi = tp.abi + ' ' + else: + abi = '' + name_and_arguments = '%s_cffi_d_%s(%s)' % (abi, name, repr_arguments) + prnt('static %s' % (tp.result.get_c_name(name_and_arguments),)) + prnt('{') + call_arguments = ', '.join(call_arguments) + result_code = 'return ' + if isinstance(tp.result, model.VoidType): + result_code = '' + prnt(' %s%s(%s);' % (result_code, name, call_arguments)) + prnt('}') + # + prnt('#ifndef PYPY_VERSION') # ------------------------------ + # + prnt('static PyObject *') + prnt('_cffi_f_%s(PyObject *self, PyObject *%s)' % (name, argname)) + prnt('{') + # + context = 'argument of %s' % name + for i, type in enumerate(tp.args): + arg = type.get_c_name(' x%d' % i, context) + prnt(' %s;' % arg) + # + localvars = set() + for type in tp.args: + self._extra_local_variables(type, localvars) + for decl in localvars: + prnt(' %s;' % (decl,)) + # + if not isinstance(tp.result, model.VoidType): + result_code = 'result = ' + context = 'result of %s' % name + result_decl = ' %s;' % tp.result.get_c_name(' result', context) + prnt(result_decl) + else: + result_decl = None + result_code = '' + # + if len(tp.args) > 1: + rng = range(len(tp.args)) + for i in rng: + prnt(' PyObject *arg%d;' % i) + prnt() + prnt(' if (!PyArg_UnpackTuple(args, "%s", %d, %d, %s))' % ( + name, len(rng), len(rng), + ', '.join(['&arg%d' % i for i in rng]))) + prnt(' return NULL;') + prnt() + # + for i, type in enumerate(tp.args): + self._convert_funcarg_to_c(type, 'arg%d' % i, 'x%d' % i, + 'return NULL') + prnt() + # + prnt(' Py_BEGIN_ALLOW_THREADS') + prnt(' _cffi_restore_errno();') + call_arguments = ['x%d' % i for i in range(len(tp.args))] + call_arguments = ', '.join(call_arguments) + prnt(' { %s%s(%s); }' % (result_code, name, call_arguments)) + prnt(' _cffi_save_errno();') + prnt(' Py_END_ALLOW_THREADS') + prnt() + # + prnt(' (void)self; /* unused */') + if numargs == 0: + prnt(' (void)noarg; /* unused */') + if result_code: + prnt(' return %s;' % + self._convert_expr_from_c(tp.result, 'result', 'result type')) + else: + prnt(' Py_INCREF(Py_None);') + prnt(' return Py_None;') + prnt('}') + # + prnt('#else') # ------------------------------ + # + # the PyPy version: need to replace struct/union arguments with + # pointers, and if the result is a struct/union, insert a first + # arg that is a pointer to the result. We also do that for + # complex args and return type. + def need_indirection(type): + return (isinstance(type, model.StructOrUnion) or + (isinstance(type, model.PrimitiveType) and + type.is_complex_type())) + difference = False + arguments = [] + call_arguments = [] + context = 'argument of %s' % name + for i, type in enumerate(tp.args): + indirection = '' + if need_indirection(type): + indirection = '*' + difference = True + arg = type.get_c_name(' %sx%d' % (indirection, i), context) + arguments.append(arg) + call_arguments.append('%sx%d' % (indirection, i)) + tp_result = tp.result + if need_indirection(tp_result): + context = 'result of %s' % name + arg = tp_result.get_c_name(' *result', context) + arguments.insert(0, arg) + tp_result = model.void_type + result_decl = None + result_code = '*result = ' + difference = True + if difference: + repr_arguments = ', '.join(arguments) + repr_arguments = repr_arguments or 'void' + name_and_arguments = '%s_cffi_f_%s(%s)' % (abi, name, + repr_arguments) + prnt('static %s' % (tp_result.get_c_name(name_and_arguments),)) + prnt('{') + if result_decl: + prnt(result_decl) + call_arguments = ', '.join(call_arguments) + prnt(' { %s%s(%s); }' % (result_code, name, call_arguments)) + if result_decl: + prnt(' return result;') + prnt('}') + else: + prnt('# define _cffi_f_%s _cffi_d_%s' % (name, name)) + # + prnt('#endif') # ------------------------------ + prnt() + + def _generate_cpy_function_ctx(self, tp, name): + if tp.ellipsis and not self.target_is_python: + self._generate_cpy_constant_ctx(tp, name) + return + type_index = self._typesdict[tp.as_raw_function()] + numargs = len(tp.args) + if self.target_is_python: + meth_kind = OP_DLOPEN_FUNC + elif numargs == 0: + meth_kind = OP_CPYTHON_BLTN_N # 'METH_NOARGS' + elif numargs == 1: + meth_kind = OP_CPYTHON_BLTN_O # 'METH_O' + else: + meth_kind = OP_CPYTHON_BLTN_V # 'METH_VARARGS' + self._lsts["global"].append( + GlobalExpr(name, '_cffi_f_%s' % name, + CffiOp(meth_kind, type_index), + size='_cffi_d_%s' % name)) + + # ---------- + # named structs or unions + + def _field_type(self, tp_struct, field_name, tp_field): + if isinstance(tp_field, model.ArrayType): + actual_length = tp_field.length + if actual_length == '...': + ptr_struct_name = tp_struct.get_c_name('*') + actual_length = '_cffi_array_len(((%s)0)->%s)' % ( + ptr_struct_name, field_name) + tp_item = self._field_type(tp_struct, '%s[0]' % field_name, + tp_field.item) + tp_field = model.ArrayType(tp_item, actual_length) + return tp_field + + def _struct_collecttype(self, tp): + self._do_collect_type(tp) + if self.target_is_python: + # also requires nested anon struct/unions in ABI mode, recursively + for fldtype in tp.anonymous_struct_fields(): + self._struct_collecttype(fldtype) + + def _struct_decl(self, tp, cname, approxname): + if tp.fldtypes is None: + return + prnt = self._prnt + checkfuncname = '_cffi_checkfld_%s' % (approxname,) + prnt('_CFFI_UNUSED_FN') + prnt('static void %s(%s *p)' % (checkfuncname, cname)) + prnt('{') + prnt(' /* only to generate compile-time warnings or errors */') + prnt(' (void)p;') + for fname, ftype, fbitsize, fqual in tp.enumfields(): + try: + if ftype.is_integer_type() or fbitsize >= 0: + # accept all integers, but complain on float or double + prnt(" (void)((p->%s) | 0); /* check that '%s.%s' is " + "an integer */" % (fname, cname, fname)) + continue + # only accept exactly the type declared, except that '[]' + # is interpreted as a '*' and so will match any array length. + # (It would also match '*', but that's harder to detect...) + while (isinstance(ftype, model.ArrayType) + and (ftype.length is None or ftype.length == '...')): + ftype = ftype.item + fname = fname + '[0]' + prnt(' { %s = &p->%s; (void)tmp; }' % ( + ftype.get_c_name('*tmp', 'field %r'%fname, quals=fqual), + fname)) + except VerificationError as e: + prnt(' /* %s */' % str(e)) # cannot verify it, ignore + prnt('}') + prnt('struct _cffi_align_%s { char x; %s y; };' % (approxname, cname)) + prnt() + + def _struct_ctx(self, tp, cname, approxname, named_ptr=None): + type_index = self._typesdict[tp] + reason_for_not_expanding = None + flags = [] + if isinstance(tp, model.UnionType): + flags.append("_CFFI_F_UNION") + if tp.fldtypes is None: + flags.append("_CFFI_F_OPAQUE") + reason_for_not_expanding = "opaque" + if (tp not in self.ffi._parser._included_declarations and + (named_ptr is None or + named_ptr not in self.ffi._parser._included_declarations)): + if tp.fldtypes is None: + pass # opaque + elif tp.partial or any(tp.anonymous_struct_fields()): + pass # field layout obtained silently from the C compiler + else: + flags.append("_CFFI_F_CHECK_FIELDS") + if tp.packed: + if tp.packed > 1: + raise NotImplementedError( + "%r is declared with 'pack=%r'; only 0 or 1 are " + "supported in API mode (try to use \"...;\", which " + "does not require a 'pack' declaration)" % + (tp, tp.packed)) + flags.append("_CFFI_F_PACKED") + else: + flags.append("_CFFI_F_EXTERNAL") + reason_for_not_expanding = "external" + flags = '|'.join(flags) or '0' + c_fields = [] + if reason_for_not_expanding is None: + expand_anonymous_struct_union = not self.target_is_python + enumfields = list(tp.enumfields(expand_anonymous_struct_union)) + for fldname, fldtype, fbitsize, fqual in enumfields: + fldtype = self._field_type(tp, fldname, fldtype) + self._check_not_opaque(fldtype, + "field '%s.%s'" % (tp.name, fldname)) + # cname is None for _add_missing_struct_unions() only + op = OP_NOOP + if fbitsize >= 0: + op = OP_BITFIELD + size = '%d /* bits */' % fbitsize + elif cname is None or ( + isinstance(fldtype, model.ArrayType) and + fldtype.length is None): + size = '(size_t)-1' + else: + size = 'sizeof(((%s)0)->%s)' % ( + tp.get_c_name('*') if named_ptr is None + else named_ptr.name, + fldname) + if cname is None or fbitsize >= 0: + offset = '(size_t)-1' + elif named_ptr is not None: + offset = '((char *)&((%s)0)->%s) - (char *)0' % ( + named_ptr.name, fldname) + else: + offset = 'offsetof(%s, %s)' % (tp.get_c_name(''), fldname) + c_fields.append( + FieldExpr(fldname, offset, size, fbitsize, + CffiOp(op, self._typesdict[fldtype]))) + first_field_index = len(self._lsts["field"]) + self._lsts["field"].extend(c_fields) + # + if cname is None: # unknown name, for _add_missing_struct_unions + size = '(size_t)-2' + align = -2 + comment = "unnamed" + else: + if named_ptr is not None: + size = 'sizeof(*(%s)0)' % (named_ptr.name,) + align = '-1 /* unknown alignment */' + else: + size = 'sizeof(%s)' % (cname,) + align = 'offsetof(struct _cffi_align_%s, y)' % (approxname,) + comment = None + else: + size = '(size_t)-1' + align = -1 + first_field_index = -1 + comment = reason_for_not_expanding + self._lsts["struct_union"].append( + StructUnionExpr(tp.name, type_index, flags, size, align, comment, + first_field_index, c_fields)) + self._seen_struct_unions.add(tp) + + def _check_not_opaque(self, tp, location): + while isinstance(tp, model.ArrayType): + tp = tp.item + if isinstance(tp, model.StructOrUnion) and tp.fldtypes is None: + raise TypeError( + "%s is of an opaque type (not declared in cdef())" % location) + + def _add_missing_struct_unions(self): + # not very nice, but some struct declarations might be missing + # because they don't have any known C name. Check that they are + # not partial (we can't complete or verify them!) and emit them + # anonymously. + lst = list(self._struct_unions.items()) + lst.sort(key=lambda tp_order: tp_order[1]) + for tp, order in lst: + if tp not in self._seen_struct_unions: + if tp.partial: + raise NotImplementedError("internal inconsistency: %r is " + "partial but was not seen at " + "this point" % (tp,)) + if tp.name.startswith('$') and tp.name[1:].isdigit(): + approxname = tp.name[1:] + elif tp.name == '_IO_FILE' and tp.forcename == 'FILE': + approxname = 'FILE' + self._typedef_ctx(tp, 'FILE') + else: + raise NotImplementedError("internal inconsistency: %r" % + (tp,)) + self._struct_ctx(tp, None, approxname) + + def _generate_cpy_struct_collecttype(self, tp, name): + self._struct_collecttype(tp) + _generate_cpy_union_collecttype = _generate_cpy_struct_collecttype + + def _struct_names(self, tp): + cname = tp.get_c_name('') + if ' ' in cname: + return cname, cname.replace(' ', '_') + else: + return cname, '_' + cname + + def _generate_cpy_struct_decl(self, tp, name): + self._struct_decl(tp, *self._struct_names(tp)) + _generate_cpy_union_decl = _generate_cpy_struct_decl + + def _generate_cpy_struct_ctx(self, tp, name): + self._struct_ctx(tp, *self._struct_names(tp)) + _generate_cpy_union_ctx = _generate_cpy_struct_ctx + + # ---------- + # 'anonymous' declarations. These are produced for anonymous structs + # or unions; the 'name' is obtained by a typedef. + + def _generate_cpy_anonymous_collecttype(self, tp, name): + if isinstance(tp, model.EnumType): + self._generate_cpy_enum_collecttype(tp, name) + else: + self._struct_collecttype(tp) + + def _generate_cpy_anonymous_decl(self, tp, name): + if isinstance(tp, model.EnumType): + self._generate_cpy_enum_decl(tp) + else: + self._struct_decl(tp, name, 'typedef_' + name) + + def _generate_cpy_anonymous_ctx(self, tp, name): + if isinstance(tp, model.EnumType): + self._enum_ctx(tp, name) + else: + self._struct_ctx(tp, name, 'typedef_' + name) + + # ---------- + # constants, declared with "static const ..." + + def _generate_cpy_const(self, is_int, name, tp=None, category='const', + check_value=None): + if (category, name) in self._seen_constants: + raise VerificationError( + "duplicate declaration of %s '%s'" % (category, name)) + self._seen_constants.add((category, name)) + # + prnt = self._prnt + funcname = '_cffi_%s_%s' % (category, name) + if is_int: + prnt('static int %s(unsigned long long *o)' % funcname) + prnt('{') + prnt(' int n = (%s) <= 0;' % (name,)) + prnt(' *o = (unsigned long long)((%s) | 0);' + ' /* check that %s is an integer */' % (name, name)) + if check_value is not None: + if check_value > 0: + check_value = '%dU' % (check_value,) + prnt(' if (!_cffi_check_int(*o, n, %s))' % (check_value,)) + prnt(' n |= 2;') + prnt(' return n;') + prnt('}') + else: + assert check_value is None + prnt('static void %s(char *o)' % funcname) + prnt('{') + prnt(' *(%s)o = %s;' % (tp.get_c_name('*'), name)) + prnt('}') + prnt() + + def _generate_cpy_constant_collecttype(self, tp, name): + is_int = tp.is_integer_type() + if not is_int or self.target_is_python: + self._do_collect_type(tp) + + def _generate_cpy_constant_decl(self, tp, name): + is_int = tp.is_integer_type() + self._generate_cpy_const(is_int, name, tp) + + def _generate_cpy_constant_ctx(self, tp, name): + if not self.target_is_python and tp.is_integer_type(): + type_op = CffiOp(OP_CONSTANT_INT, -1) + else: + if self.target_is_python: + const_kind = OP_DLOPEN_CONST + else: + const_kind = OP_CONSTANT + type_index = self._typesdict[tp] + type_op = CffiOp(const_kind, type_index) + self._lsts["global"].append( + GlobalExpr(name, '_cffi_const_%s' % name, type_op)) + + # ---------- + # enums + + def _generate_cpy_enum_collecttype(self, tp, name): + self._do_collect_type(tp) + + def _generate_cpy_enum_decl(self, tp, name=None): + for enumerator in tp.enumerators: + self._generate_cpy_const(True, enumerator) + + def _enum_ctx(self, tp, cname): + type_index = self._typesdict[tp] + type_op = CffiOp(OP_ENUM, -1) + if self.target_is_python: + tp.check_not_partial() + for enumerator, enumvalue in zip(tp.enumerators, tp.enumvalues): + self._lsts["global"].append( + GlobalExpr(enumerator, '_cffi_const_%s' % enumerator, type_op, + check_value=enumvalue)) + # + if cname is not None and '$' not in cname and not self.target_is_python: + size = "sizeof(%s)" % cname + signed = "((%s)-1) <= 0" % cname + else: + basetp = tp.build_baseinttype(self.ffi, []) + size = self.ffi.sizeof(basetp) + signed = int(int(self.ffi.cast(basetp, -1)) < 0) + allenums = ",".join(tp.enumerators) + self._lsts["enum"].append( + EnumExpr(tp.name, type_index, size, signed, allenums)) + + def _generate_cpy_enum_ctx(self, tp, name): + self._enum_ctx(tp, tp._get_c_name()) + + # ---------- + # macros: for now only for integers + + def _generate_cpy_macro_collecttype(self, tp, name): + pass + + def _generate_cpy_macro_decl(self, tp, name): + if tp == '...': + check_value = None + else: + check_value = tp # an integer + self._generate_cpy_const(True, name, check_value=check_value) + + def _generate_cpy_macro_ctx(self, tp, name): + if tp == '...': + if self.target_is_python: + raise VerificationError( + "cannot use the syntax '...' in '#define %s ...' when " + "using the ABI mode" % (name,)) + check_value = None + else: + check_value = tp # an integer + type_op = CffiOp(OP_CONSTANT_INT, -1) + self._lsts["global"].append( + GlobalExpr(name, '_cffi_const_%s' % name, type_op, + check_value=check_value)) + + # ---------- + # global variables + + def _global_type(self, tp, global_name): + if isinstance(tp, model.ArrayType): + actual_length = tp.length + if actual_length == '...': + actual_length = '_cffi_array_len(%s)' % (global_name,) + tp_item = self._global_type(tp.item, '%s[0]' % global_name) + tp = model.ArrayType(tp_item, actual_length) + return tp + + def _generate_cpy_variable_collecttype(self, tp, name): + self._do_collect_type(self._global_type(tp, name)) + + def _generate_cpy_variable_decl(self, tp, name): + prnt = self._prnt + tp = self._global_type(tp, name) + if isinstance(tp, model.ArrayType) and tp.length is None: + tp = tp.item + ampersand = '' + else: + ampersand = '&' + # This code assumes that casts from "tp *" to "void *" is a + # no-op, i.e. a function that returns a "tp *" can be called + # as if it returned a "void *". This should be generally true + # on any modern machine. The only exception to that rule (on + # uncommon architectures, and as far as I can tell) might be + # if 'tp' were a function type, but that is not possible here. + # (If 'tp' is a function _pointer_ type, then casts from "fn_t + # **" to "void *" are again no-ops, as far as I can tell.) + decl = '*_cffi_var_%s(void)' % (name,) + prnt('static ' + tp.get_c_name(decl, quals=self._current_quals)) + prnt('{') + prnt(' return %s(%s);' % (ampersand, name)) + prnt('}') + prnt() + + def _generate_cpy_variable_ctx(self, tp, name): + tp = self._global_type(tp, name) + type_index = self._typesdict[tp] + if self.target_is_python: + op = OP_GLOBAL_VAR + else: + op = OP_GLOBAL_VAR_F + self._lsts["global"].append( + GlobalExpr(name, '_cffi_var_%s' % name, CffiOp(op, type_index))) + + # ---------- + # extern "Python" + + def _generate_cpy_extern_python_collecttype(self, tp, name): + assert isinstance(tp, model.FunctionPtrType) + self._do_collect_type(tp) + _generate_cpy_dllexport_python_collecttype = \ + _generate_cpy_extern_python_plus_c_collecttype = \ + _generate_cpy_extern_python_collecttype + + def _extern_python_decl(self, tp, name, tag_and_space): + prnt = self._prnt + if isinstance(tp.result, model.VoidType): + size_of_result = '0' + else: + context = 'result of %s' % name + size_of_result = '(int)sizeof(%s)' % ( + tp.result.get_c_name('', context),) + prnt('static struct _cffi_externpy_s _cffi_externpy__%s =' % name) + prnt(' { "%s.%s", %s };' % (self.module_name, name, size_of_result)) + prnt() + # + arguments = [] + context = 'argument of %s' % name + for i, type in enumerate(tp.args): + arg = type.get_c_name(' a%d' % i, context) + arguments.append(arg) + # + repr_arguments = ', '.join(arguments) + repr_arguments = repr_arguments or 'void' + name_and_arguments = '%s(%s)' % (name, repr_arguments) + if tp.abi == "__stdcall": + name_and_arguments = '_cffi_stdcall ' + name_and_arguments + # + def may_need_128_bits(tp): + return (isinstance(tp, model.PrimitiveType) and + tp.name == 'long double') + # + size_of_a = max(len(tp.args)*8, 8) + if may_need_128_bits(tp.result): + size_of_a = max(size_of_a, 16) + if isinstance(tp.result, model.StructOrUnion): + size_of_a = 'sizeof(%s) > %d ? sizeof(%s) : %d' % ( + tp.result.get_c_name(''), size_of_a, + tp.result.get_c_name(''), size_of_a) + prnt('%s%s' % (tag_and_space, tp.result.get_c_name(name_and_arguments))) + prnt('{') + prnt(' char a[%s];' % size_of_a) + prnt(' char *p = a;') + for i, type in enumerate(tp.args): + arg = 'a%d' % i + if (isinstance(type, model.StructOrUnion) or + may_need_128_bits(type)): + arg = '&' + arg + type = model.PointerType(type) + prnt(' *(%s)(p + %d) = %s;' % (type.get_c_name('*'), i*8, arg)) + prnt(' _cffi_call_python(&_cffi_externpy__%s, p);' % name) + if not isinstance(tp.result, model.VoidType): + prnt(' return *(%s)p;' % (tp.result.get_c_name('*'),)) + prnt('}') + prnt() + self._num_externpy += 1 + + def _generate_cpy_extern_python_decl(self, tp, name): + self._extern_python_decl(tp, name, 'static ') + + def _generate_cpy_dllexport_python_decl(self, tp, name): + self._extern_python_decl(tp, name, 'CFFI_DLLEXPORT ') + + def _generate_cpy_extern_python_plus_c_decl(self, tp, name): + self._extern_python_decl(tp, name, '') + + def _generate_cpy_extern_python_ctx(self, tp, name): + if self.target_is_python: + raise VerificationError( + "cannot use 'extern \"Python\"' in the ABI mode") + if tp.ellipsis: + raise NotImplementedError("a vararg function is extern \"Python\"") + type_index = self._typesdict[tp] + type_op = CffiOp(OP_EXTERN_PYTHON, type_index) + self._lsts["global"].append( + GlobalExpr(name, '&_cffi_externpy__%s' % name, type_op, name)) + + _generate_cpy_dllexport_python_ctx = \ + _generate_cpy_extern_python_plus_c_ctx = \ + _generate_cpy_extern_python_ctx + + def _print_string_literal_in_array(self, s): + prnt = self._prnt + prnt('// # NB. this is not a string because of a size limit in MSVC') + for line in s.splitlines(True): + prnt(('// ' + line).rstrip()) + printed_line = '' + for c in line: + if len(printed_line) >= 76: + prnt(printed_line) + printed_line = '' + printed_line += '%d,' % (ord(c),) + prnt(printed_line) + + # ---------- + # emitting the opcodes for individual types + + def _emit_bytecode_VoidType(self, tp, index): + self.cffi_types[index] = CffiOp(OP_PRIMITIVE, PRIM_VOID) + + def _emit_bytecode_PrimitiveType(self, tp, index): + prim_index = PRIMITIVE_TO_INDEX[tp.name] + self.cffi_types[index] = CffiOp(OP_PRIMITIVE, prim_index) + + def _emit_bytecode_UnknownIntegerType(self, tp, index): + s = ('_cffi_prim_int(sizeof(%s), (\n' + ' ((%s)-1) | 0 /* check that %s is an integer type */\n' + ' ) <= 0)' % (tp.name, tp.name, tp.name)) + self.cffi_types[index] = CffiOp(OP_PRIMITIVE, s) + + def _emit_bytecode_UnknownFloatType(self, tp, index): + s = ('_cffi_prim_float(sizeof(%s) *\n' + ' (((%s)1) / 2) * 2 /* integer => 0, float => 1 */\n' + ' )' % (tp.name, tp.name)) + self.cffi_types[index] = CffiOp(OP_PRIMITIVE, s) + + def _emit_bytecode_RawFunctionType(self, tp, index): + self.cffi_types[index] = CffiOp(OP_FUNCTION, self._typesdict[tp.result]) + index += 1 + for tp1 in tp.args: + realindex = self._typesdict[tp1] + if index != realindex: + if isinstance(tp1, model.PrimitiveType): + self._emit_bytecode_PrimitiveType(tp1, index) + else: + self.cffi_types[index] = CffiOp(OP_NOOP, realindex) + index += 1 + flags = int(tp.ellipsis) + if tp.abi is not None: + if tp.abi == '__stdcall': + flags |= 2 + else: + raise NotImplementedError("abi=%r" % (tp.abi,)) + self.cffi_types[index] = CffiOp(OP_FUNCTION_END, flags) + + def _emit_bytecode_PointerType(self, tp, index): + self.cffi_types[index] = CffiOp(OP_POINTER, self._typesdict[tp.totype]) + + _emit_bytecode_ConstPointerType = _emit_bytecode_PointerType + _emit_bytecode_NamedPointerType = _emit_bytecode_PointerType + + def _emit_bytecode_FunctionPtrType(self, tp, index): + raw = tp.as_raw_function() + self.cffi_types[index] = CffiOp(OP_POINTER, self._typesdict[raw]) + + def _emit_bytecode_ArrayType(self, tp, index): + item_index = self._typesdict[tp.item] + if tp.length is None: + self.cffi_types[index] = CffiOp(OP_OPEN_ARRAY, item_index) + elif tp.length == '...': + raise VerificationError( + "type %s badly placed: the '...' array length can only be " + "used on global arrays or on fields of structures" % ( + str(tp).replace('/*...*/', '...'),)) + else: + assert self.cffi_types[index + 1] == 'LEN' + self.cffi_types[index] = CffiOp(OP_ARRAY, item_index) + self.cffi_types[index + 1] = CffiOp(None, str(tp.length)) + + def _emit_bytecode_StructType(self, tp, index): + struct_index = self._struct_unions[tp] + self.cffi_types[index] = CffiOp(OP_STRUCT_UNION, struct_index) + _emit_bytecode_UnionType = _emit_bytecode_StructType + + def _emit_bytecode_EnumType(self, tp, index): + enum_index = self._enums[tp] + self.cffi_types[index] = CffiOp(OP_ENUM, enum_index) + + +if sys.version_info >= (3,): + NativeIO = io.StringIO +else: + class NativeIO(io.BytesIO): + def write(self, s): + if isinstance(s, unicode): + s = s.encode('ascii') + super(NativeIO, self).write(s) + +def _make_c_or_py_source(ffi, module_name, preamble, target_file, verbose): + if verbose: + print("generating %s" % (target_file,)) + recompiler = Recompiler(ffi, module_name, + target_is_python=(preamble is None)) + recompiler.collect_type_table() + recompiler.collect_step_tables() + f = NativeIO() + recompiler.write_source_to_f(f, preamble) + output = f.getvalue() + try: + with open(target_file, 'r') as f1: + if f1.read(len(output) + 1) != output: + raise IOError + if verbose: + print("(already up-to-date)") + return False # already up-to-date + except IOError: + tmp_file = '%s.~%d' % (target_file, os.getpid()) + with open(tmp_file, 'w') as f1: + f1.write(output) + try: + os.rename(tmp_file, target_file) + except OSError: + os.unlink(target_file) + os.rename(tmp_file, target_file) + return True + +def make_c_source(ffi, module_name, preamble, target_c_file, verbose=False): + assert preamble is not None + return _make_c_or_py_source(ffi, module_name, preamble, target_c_file, + verbose) + +def make_py_source(ffi, module_name, target_py_file, verbose=False): + return _make_c_or_py_source(ffi, module_name, None, target_py_file, + verbose) + +def _modname_to_file(outputdir, modname, extension): + parts = modname.split('.') + try: + os.makedirs(os.path.join(outputdir, *parts[:-1])) + except OSError: + pass + parts[-1] += extension + return os.path.join(outputdir, *parts), parts + + +# Aaargh. Distutils is not tested at all for the purpose of compiling +# DLLs that are not extension modules. Here are some hacks to work +# around that, in the _patch_for_*() functions... + +def _patch_meth(patchlist, cls, name, new_meth): + old = getattr(cls, name) + patchlist.append((cls, name, old)) + setattr(cls, name, new_meth) + return old + +def _unpatch_meths(patchlist): + for cls, name, old_meth in reversed(patchlist): + setattr(cls, name, old_meth) + +def _patch_for_embedding(patchlist): + if sys.platform == 'win32': + # we must not remove the manifest when building for embedding! + from distutils.msvc9compiler import MSVCCompiler + _patch_meth(patchlist, MSVCCompiler, '_remove_visual_c_ref', + lambda self, manifest_file: manifest_file) + + if sys.platform == 'darwin': + # we must not make a '-bundle', but a '-dynamiclib' instead + from distutils.ccompiler import CCompiler + def my_link_shared_object(self, *args, **kwds): + if '-bundle' in self.linker_so: + self.linker_so = list(self.linker_so) + i = self.linker_so.index('-bundle') + self.linker_so[i] = '-dynamiclib' + return old_link_shared_object(self, *args, **kwds) + old_link_shared_object = _patch_meth(patchlist, CCompiler, + 'link_shared_object', + my_link_shared_object) + +def _patch_for_target(patchlist, target): + from distutils.command.build_ext import build_ext + # if 'target' is different from '*', we need to patch some internal + # method to just return this 'target' value, instead of having it + # built from module_name + if target.endswith('.*'): + target = target[:-2] + if sys.platform == 'win32': + target += '.dll' + elif sys.platform == 'darwin': + target += '.dylib' + else: + target += '.so' + _patch_meth(patchlist, build_ext, 'get_ext_filename', + lambda self, ext_name: target) + + +def recompile(ffi, module_name, preamble, tmpdir='.', call_c_compiler=True, + c_file=None, source_extension='.c', extradir=None, + compiler_verbose=1, target=None, debug=None, **kwds): + if not isinstance(module_name, str): + module_name = module_name.encode('ascii') + if ffi._windows_unicode: + ffi._apply_windows_unicode(kwds) + if preamble is not None: + embedding = (ffi._embedding is not None) + if embedding: + ffi._apply_embedding_fix(kwds) + if c_file is None: + c_file, parts = _modname_to_file(tmpdir, module_name, + source_extension) + if extradir: + parts = [extradir] + parts + ext_c_file = os.path.join(*parts) + else: + ext_c_file = c_file + # + if target is None: + if embedding: + target = '%s.*' % module_name + else: + target = '*' + # + ext = ffiplatform.get_extension(ext_c_file, module_name, **kwds) + updated = make_c_source(ffi, module_name, preamble, c_file, + verbose=compiler_verbose) + if call_c_compiler: + patchlist = [] + cwd = os.getcwd() + try: + if embedding: + _patch_for_embedding(patchlist) + if target != '*': + _patch_for_target(patchlist, target) + if compiler_verbose: + if tmpdir == '.': + msg = 'the current directory is' + else: + msg = 'setting the current directory to' + print('%s %r' % (msg, os.path.abspath(tmpdir))) + os.chdir(tmpdir) + outputfilename = ffiplatform.compile('.', ext, + compiler_verbose, debug) + finally: + os.chdir(cwd) + _unpatch_meths(patchlist) + return outputfilename + else: + return ext, updated + else: + if c_file is None: + c_file, _ = _modname_to_file(tmpdir, module_name, '.py') + updated = make_py_source(ffi, module_name, c_file, + verbose=compiler_verbose) + if call_c_compiler: + return c_file + else: + return None, updated + diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/cffi/setuptools_ext.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/cffi/setuptools_ext.py new file mode 100644 index 00000000..df5a5183 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/cffi/setuptools_ext.py @@ -0,0 +1,217 @@ +import os +import sys + +try: + basestring +except NameError: + # Python 3.x + basestring = str + +def error(msg): + from distutils.errors import DistutilsSetupError + raise DistutilsSetupError(msg) + + +def execfile(filename, glob): + # We use execfile() (here rewritten for Python 3) instead of + # __import__() to load the build script. The problem with + # a normal import is that in some packages, the intermediate + # __init__.py files may already try to import the file that + # we are generating. + with open(filename) as f: + src = f.read() + src += '\n' # Python 2.6 compatibility + code = compile(src, filename, 'exec') + exec(code, glob, glob) + + +def add_cffi_module(dist, mod_spec): + from cffi.api import FFI + + if not isinstance(mod_spec, basestring): + error("argument to 'cffi_modules=...' must be a str or a list of str," + " not %r" % (type(mod_spec).__name__,)) + mod_spec = str(mod_spec) + try: + build_file_name, ffi_var_name = mod_spec.split(':') + except ValueError: + error("%r must be of the form 'path/build.py:ffi_variable'" % + (mod_spec,)) + if not os.path.exists(build_file_name): + ext = '' + rewritten = build_file_name.replace('.', '/') + '.py' + if os.path.exists(rewritten): + ext = ' (rewrite cffi_modules to [%r])' % ( + rewritten + ':' + ffi_var_name,) + error("%r does not name an existing file%s" % (build_file_name, ext)) + + mod_vars = {'__name__': '__cffi__', '__file__': build_file_name} + execfile(build_file_name, mod_vars) + + try: + ffi = mod_vars[ffi_var_name] + except KeyError: + error("%r: object %r not found in module" % (mod_spec, + ffi_var_name)) + if not isinstance(ffi, FFI): + ffi = ffi() # maybe it's a function instead of directly an ffi + if not isinstance(ffi, FFI): + error("%r is not an FFI instance (got %r)" % (mod_spec, + type(ffi).__name__)) + if not hasattr(ffi, '_assigned_source'): + error("%r: the set_source() method was not called" % (mod_spec,)) + module_name, source, source_extension, kwds = ffi._assigned_source + if ffi._windows_unicode: + kwds = kwds.copy() + ffi._apply_windows_unicode(kwds) + + if source is None: + _add_py_module(dist, ffi, module_name) + else: + _add_c_module(dist, ffi, module_name, source, source_extension, kwds) + +def _set_py_limited_api(Extension, kwds): + """ + Add py_limited_api to kwds if setuptools >= 26 is in use. + Do not alter the setting if it already exists. + Setuptools takes care of ignoring the flag on Python 2 and PyPy. + + CPython itself should ignore the flag in a debugging version + (by not listing .abi3.so in the extensions it supports), but + it doesn't so far, creating troubles. That's why we check + for "not hasattr(sys, 'gettotalrefcount')" (the 2.7 compatible equivalent + of 'd' not in sys.abiflags). (http://bugs.python.org/issue28401) + + On Windows, with CPython <= 3.4, it's better not to use py_limited_api + because virtualenv *still* doesn't copy PYTHON3.DLL on these versions. + For now we'll skip py_limited_api on all Windows versions to avoid an + inconsistent mess. + """ + if ('py_limited_api' not in kwds and not hasattr(sys, 'gettotalrefcount') + and sys.platform != 'win32'): + import setuptools + try: + setuptools_major_version = int(setuptools.__version__.partition('.')[0]) + if setuptools_major_version >= 26: + kwds['py_limited_api'] = True + except ValueError: # certain development versions of setuptools + # If we don't know the version number of setuptools, we + # try to set 'py_limited_api' anyway. At worst, we get a + # warning. + kwds['py_limited_api'] = True + return kwds + +def _add_c_module(dist, ffi, module_name, source, source_extension, kwds): + from distutils.core import Extension + # We are a setuptools extension. Need this build_ext for py_limited_api. + from setuptools.command.build_ext import build_ext + from distutils.dir_util import mkpath + from distutils import log + from cffi import recompiler + + allsources = ['$PLACEHOLDER'] + allsources.extend(kwds.pop('sources', [])) + kwds = _set_py_limited_api(Extension, kwds) + ext = Extension(name=module_name, sources=allsources, **kwds) + + def make_mod(tmpdir, pre_run=None): + c_file = os.path.join(tmpdir, module_name + source_extension) + log.info("generating cffi module %r" % c_file) + mkpath(tmpdir) + # a setuptools-only, API-only hook: called with the "ext" and "ffi" + # arguments just before we turn the ffi into C code. To use it, + # subclass the 'distutils.command.build_ext.build_ext' class and + # add a method 'def pre_run(self, ext, ffi)'. + if pre_run is not None: + pre_run(ext, ffi) + updated = recompiler.make_c_source(ffi, module_name, source, c_file) + if not updated: + log.info("already up-to-date") + return c_file + + if dist.ext_modules is None: + dist.ext_modules = [] + dist.ext_modules.append(ext) + + base_class = dist.cmdclass.get('build_ext', build_ext) + class build_ext_make_mod(base_class): + def run(self): + if ext.sources[0] == '$PLACEHOLDER': + pre_run = getattr(self, 'pre_run', None) + ext.sources[0] = make_mod(self.build_temp, pre_run) + base_class.run(self) + dist.cmdclass['build_ext'] = build_ext_make_mod + # NB. multiple runs here will create multiple 'build_ext_make_mod' + # classes. Even in this case the 'build_ext' command should be + # run once; but just in case, the logic above does nothing if + # called again. + + +def _add_py_module(dist, ffi, module_name): + from distutils.dir_util import mkpath + from setuptools.command.build_py import build_py + from setuptools.command.build_ext import build_ext + from distutils import log + from cffi import recompiler + + def generate_mod(py_file): + log.info("generating cffi module %r" % py_file) + mkpath(os.path.dirname(py_file)) + updated = recompiler.make_py_source(ffi, module_name, py_file) + if not updated: + log.info("already up-to-date") + + base_class = dist.cmdclass.get('build_py', build_py) + class build_py_make_mod(base_class): + def run(self): + base_class.run(self) + module_path = module_name.split('.') + module_path[-1] += '.py' + generate_mod(os.path.join(self.build_lib, *module_path)) + def get_source_files(self): + # This is called from 'setup.py sdist' only. Exclude + # the generate .py module in this case. + saved_py_modules = self.py_modules + try: + if saved_py_modules: + self.py_modules = [m for m in saved_py_modules + if m != module_name] + return base_class.get_source_files(self) + finally: + self.py_modules = saved_py_modules + dist.cmdclass['build_py'] = build_py_make_mod + + # distutils and setuptools have no notion I could find of a + # generated python module. If we don't add module_name to + # dist.py_modules, then things mostly work but there are some + # combination of options (--root and --record) that will miss + # the module. So we add it here, which gives a few apparently + # harmless warnings about not finding the file outside the + # build directory. + # Then we need to hack more in get_source_files(); see above. + if dist.py_modules is None: + dist.py_modules = [] + dist.py_modules.append(module_name) + + # the following is only for "build_ext -i" + base_class_2 = dist.cmdclass.get('build_ext', build_ext) + class build_ext_make_mod(base_class_2): + def run(self): + base_class_2.run(self) + if self.inplace: + # from get_ext_fullpath() in distutils/command/build_ext.py + module_path = module_name.split('.') + package = '.'.join(module_path[:-1]) + build_py = self.get_finalized_command('build_py') + package_dir = build_py.get_package_dir(package) + file_name = module_path[-1] + '.py' + generate_mod(os.path.join(package_dir, file_name)) + dist.cmdclass['build_ext'] = build_ext_make_mod + +def cffi_modules(dist, attr, value): + assert attr == 'cffi_modules' + if isinstance(value, basestring): + value = [value] + + for cffi_module in value: + add_cffi_module(dist, cffi_module) diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/cffi/vengine_cpy.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/cffi/vengine_cpy.py new file mode 100644 index 00000000..536f11f8 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/cffi/vengine_cpy.py @@ -0,0 +1,1015 @@ +# +# DEPRECATED: implementation for ffi.verify() +# +import sys, imp +from . import model +from .error import VerificationError + + +class VCPythonEngine(object): + _class_key = 'x' + _gen_python_module = True + + def __init__(self, verifier): + self.verifier = verifier + self.ffi = verifier.ffi + self._struct_pending_verification = {} + self._types_of_builtin_functions = {} + + def patch_extension_kwds(self, kwds): + pass + + def find_module(self, module_name, path, so_suffixes): + try: + f, filename, descr = imp.find_module(module_name, path) + except ImportError: + return None + if f is not None: + f.close() + # Note that after a setuptools installation, there are both .py + # and .so files with the same basename. The code here relies on + # imp.find_module() locating the .so in priority. + if descr[0] not in so_suffixes: + return None + return filename + + def collect_types(self): + self._typesdict = {} + self._generate("collecttype") + + def _prnt(self, what=''): + self._f.write(what + '\n') + + def _gettypenum(self, type): + # a KeyError here is a bug. please report it! :-) + return self._typesdict[type] + + def _do_collect_type(self, tp): + if ((not isinstance(tp, model.PrimitiveType) + or tp.name == 'long double') + and tp not in self._typesdict): + num = len(self._typesdict) + self._typesdict[tp] = num + + def write_source_to_f(self): + self.collect_types() + # + # The new module will have a _cffi_setup() function that receives + # objects from the ffi world, and that calls some setup code in + # the module. This setup code is split in several independent + # functions, e.g. one per constant. The functions are "chained" + # by ending in a tail call to each other. + # + # This is further split in two chained lists, depending on if we + # can do it at import-time or if we must wait for _cffi_setup() to + # provide us with the objects. This is needed because we + # need the values of the enum constants in order to build the + # that we may have to pass to _cffi_setup(). + # + # The following two 'chained_list_constants' items contains + # the head of these two chained lists, as a string that gives the + # call to do, if any. + self._chained_list_constants = ['((void)lib,0)', '((void)lib,0)'] + # + prnt = self._prnt + # first paste some standard set of lines that are mostly '#define' + prnt(cffimod_header) + prnt() + # then paste the C source given by the user, verbatim. + prnt(self.verifier.preamble) + prnt() + # + # call generate_cpy_xxx_decl(), for every xxx found from + # ffi._parser._declarations. This generates all the functions. + self._generate("decl") + # + # implement the function _cffi_setup_custom() as calling the + # head of the chained list. + self._generate_setup_custom() + prnt() + # + # produce the method table, including the entries for the + # generated Python->C function wrappers, which are done + # by generate_cpy_function_method(). + prnt('static PyMethodDef _cffi_methods[] = {') + self._generate("method") + prnt(' {"_cffi_setup", _cffi_setup, METH_VARARGS, NULL},') + prnt(' {NULL, NULL, 0, NULL} /* Sentinel */') + prnt('};') + prnt() + # + # standard init. + modname = self.verifier.get_module_name() + constants = self._chained_list_constants[False] + prnt('#if PY_MAJOR_VERSION >= 3') + prnt() + prnt('static struct PyModuleDef _cffi_module_def = {') + prnt(' PyModuleDef_HEAD_INIT,') + prnt(' "%s",' % modname) + prnt(' NULL,') + prnt(' -1,') + prnt(' _cffi_methods,') + prnt(' NULL, NULL, NULL, NULL') + prnt('};') + prnt() + prnt('PyMODINIT_FUNC') + prnt('PyInit_%s(void)' % modname) + prnt('{') + prnt(' PyObject *lib;') + prnt(' lib = PyModule_Create(&_cffi_module_def);') + prnt(' if (lib == NULL)') + prnt(' return NULL;') + prnt(' if (%s < 0 || _cffi_init() < 0) {' % (constants,)) + prnt(' Py_DECREF(lib);') + prnt(' return NULL;') + prnt(' }') + prnt(' return lib;') + prnt('}') + prnt() + prnt('#else') + prnt() + prnt('PyMODINIT_FUNC') + prnt('init%s(void)' % modname) + prnt('{') + prnt(' PyObject *lib;') + prnt(' lib = Py_InitModule("%s", _cffi_methods);' % modname) + prnt(' if (lib == NULL)') + prnt(' return;') + prnt(' if (%s < 0 || _cffi_init() < 0)' % (constants,)) + prnt(' return;') + prnt(' return;') + prnt('}') + prnt() + prnt('#endif') + + def load_library(self, flags=None): + # XXX review all usages of 'self' here! + # import it as a new extension module + imp.acquire_lock() + try: + if hasattr(sys, "getdlopenflags"): + previous_flags = sys.getdlopenflags() + try: + if hasattr(sys, "setdlopenflags") and flags is not None: + sys.setdlopenflags(flags) + module = imp.load_dynamic(self.verifier.get_module_name(), + self.verifier.modulefilename) + except ImportError as e: + error = "importing %r: %s" % (self.verifier.modulefilename, e) + raise VerificationError(error) + finally: + if hasattr(sys, "setdlopenflags"): + sys.setdlopenflags(previous_flags) + finally: + imp.release_lock() + # + # call loading_cpy_struct() to get the struct layout inferred by + # the C compiler + self._load(module, 'loading') + # + # the C code will need the objects. Collect them in + # order in a list. + revmapping = dict([(value, key) + for (key, value) in self._typesdict.items()]) + lst = [revmapping[i] for i in range(len(revmapping))] + lst = list(map(self.ffi._get_cached_btype, lst)) + # + # build the FFILibrary class and instance and call _cffi_setup(). + # this will set up some fields like '_cffi_types', and only then + # it will invoke the chained list of functions that will really + # build (notably) the constant objects, as if they are + # pointers, and store them as attributes on the 'library' object. + class FFILibrary(object): + _cffi_python_module = module + _cffi_ffi = self.ffi + _cffi_dir = [] + def __dir__(self): + return FFILibrary._cffi_dir + list(self.__dict__) + library = FFILibrary() + if module._cffi_setup(lst, VerificationError, library): + import warnings + warnings.warn("reimporting %r might overwrite older definitions" + % (self.verifier.get_module_name())) + # + # finally, call the loaded_cpy_xxx() functions. This will perform + # the final adjustments, like copying the Python->C wrapper + # functions from the module to the 'library' object, and setting + # up the FFILibrary class with properties for the global C variables. + self._load(module, 'loaded', library=library) + module._cffi_original_ffi = self.ffi + module._cffi_types_of_builtin_funcs = self._types_of_builtin_functions + return library + + def _get_declarations(self): + lst = [(key, tp) for (key, (tp, qual)) in + self.ffi._parser._declarations.items()] + lst.sort() + return lst + + def _generate(self, step_name): + for name, tp in self._get_declarations(): + kind, realname = name.split(' ', 1) + try: + method = getattr(self, '_generate_cpy_%s_%s' % (kind, + step_name)) + except AttributeError: + raise VerificationError( + "not implemented in verify(): %r" % name) + try: + method(tp, realname) + except Exception as e: + model.attach_exception_info(e, name) + raise + + def _load(self, module, step_name, **kwds): + for name, tp in self._get_declarations(): + kind, realname = name.split(' ', 1) + method = getattr(self, '_%s_cpy_%s' % (step_name, kind)) + try: + method(tp, realname, module, **kwds) + except Exception as e: + model.attach_exception_info(e, name) + raise + + def _generate_nothing(self, tp, name): + pass + + def _loaded_noop(self, tp, name, module, **kwds): + pass + + # ---------- + + def _convert_funcarg_to_c(self, tp, fromvar, tovar, errcode): + extraarg = '' + if isinstance(tp, model.PrimitiveType): + if tp.is_integer_type() and tp.name != '_Bool': + converter = '_cffi_to_c_int' + extraarg = ', %s' % tp.name + else: + converter = '(%s)_cffi_to_c_%s' % (tp.get_c_name(''), + tp.name.replace(' ', '_')) + errvalue = '-1' + # + elif isinstance(tp, model.PointerType): + self._convert_funcarg_to_c_ptr_or_array(tp, fromvar, + tovar, errcode) + return + # + elif isinstance(tp, (model.StructOrUnion, model.EnumType)): + # a struct (not a struct pointer) as a function argument + self._prnt(' if (_cffi_to_c((char *)&%s, _cffi_type(%d), %s) < 0)' + % (tovar, self._gettypenum(tp), fromvar)) + self._prnt(' %s;' % errcode) + return + # + elif isinstance(tp, model.FunctionPtrType): + converter = '(%s)_cffi_to_c_pointer' % tp.get_c_name('') + extraarg = ', _cffi_type(%d)' % self._gettypenum(tp) + errvalue = 'NULL' + # + else: + raise NotImplementedError(tp) + # + self._prnt(' %s = %s(%s%s);' % (tovar, converter, fromvar, extraarg)) + self._prnt(' if (%s == (%s)%s && PyErr_Occurred())' % ( + tovar, tp.get_c_name(''), errvalue)) + self._prnt(' %s;' % errcode) + + def _extra_local_variables(self, tp, localvars): + if isinstance(tp, model.PointerType): + localvars.add('Py_ssize_t datasize') + + def _convert_funcarg_to_c_ptr_or_array(self, tp, fromvar, tovar, errcode): + self._prnt(' datasize = _cffi_prepare_pointer_call_argument(') + self._prnt(' _cffi_type(%d), %s, (char **)&%s);' % ( + self._gettypenum(tp), fromvar, tovar)) + self._prnt(' if (datasize != 0) {') + self._prnt(' if (datasize < 0)') + self._prnt(' %s;' % errcode) + self._prnt(' %s = alloca((size_t)datasize);' % (tovar,)) + self._prnt(' memset((void *)%s, 0, (size_t)datasize);' % (tovar,)) + self._prnt(' if (_cffi_convert_array_from_object(' + '(char *)%s, _cffi_type(%d), %s) < 0)' % ( + tovar, self._gettypenum(tp), fromvar)) + self._prnt(' %s;' % errcode) + self._prnt(' }') + + def _convert_expr_from_c(self, tp, var, context): + if isinstance(tp, model.PrimitiveType): + if tp.is_integer_type() and tp.name != '_Bool': + return '_cffi_from_c_int(%s, %s)' % (var, tp.name) + elif tp.name != 'long double': + return '_cffi_from_c_%s(%s)' % (tp.name.replace(' ', '_'), var) + else: + return '_cffi_from_c_deref((char *)&%s, _cffi_type(%d))' % ( + var, self._gettypenum(tp)) + elif isinstance(tp, (model.PointerType, model.FunctionPtrType)): + return '_cffi_from_c_pointer((char *)%s, _cffi_type(%d))' % ( + var, self._gettypenum(tp)) + elif isinstance(tp, model.ArrayType): + return '_cffi_from_c_pointer((char *)%s, _cffi_type(%d))' % ( + var, self._gettypenum(model.PointerType(tp.item))) + elif isinstance(tp, model.StructOrUnion): + if tp.fldnames is None: + raise TypeError("'%s' is used as %s, but is opaque" % ( + tp._get_c_name(), context)) + return '_cffi_from_c_struct((char *)&%s, _cffi_type(%d))' % ( + var, self._gettypenum(tp)) + elif isinstance(tp, model.EnumType): + return '_cffi_from_c_deref((char *)&%s, _cffi_type(%d))' % ( + var, self._gettypenum(tp)) + else: + raise NotImplementedError(tp) + + # ---------- + # typedefs: generates no code so far + + _generate_cpy_typedef_collecttype = _generate_nothing + _generate_cpy_typedef_decl = _generate_nothing + _generate_cpy_typedef_method = _generate_nothing + _loading_cpy_typedef = _loaded_noop + _loaded_cpy_typedef = _loaded_noop + + # ---------- + # function declarations + + def _generate_cpy_function_collecttype(self, tp, name): + assert isinstance(tp, model.FunctionPtrType) + if tp.ellipsis: + self._do_collect_type(tp) + else: + # don't call _do_collect_type(tp) in this common case, + # otherwise test_autofilled_struct_as_argument fails + for type in tp.args: + self._do_collect_type(type) + self._do_collect_type(tp.result) + + def _generate_cpy_function_decl(self, tp, name): + assert isinstance(tp, model.FunctionPtrType) + if tp.ellipsis: + # cannot support vararg functions better than this: check for its + # exact type (including the fixed arguments), and build it as a + # constant function pointer (no CPython wrapper) + self._generate_cpy_const(False, name, tp) + return + prnt = self._prnt + numargs = len(tp.args) + if numargs == 0: + argname = 'noarg' + elif numargs == 1: + argname = 'arg0' + else: + argname = 'args' + prnt('static PyObject *') + prnt('_cffi_f_%s(PyObject *self, PyObject *%s)' % (name, argname)) + prnt('{') + # + context = 'argument of %s' % name + for i, type in enumerate(tp.args): + prnt(' %s;' % type.get_c_name(' x%d' % i, context)) + # + localvars = set() + for type in tp.args: + self._extra_local_variables(type, localvars) + for decl in localvars: + prnt(' %s;' % (decl,)) + # + if not isinstance(tp.result, model.VoidType): + result_code = 'result = ' + context = 'result of %s' % name + prnt(' %s;' % tp.result.get_c_name(' result', context)) + else: + result_code = '' + # + if len(tp.args) > 1: + rng = range(len(tp.args)) + for i in rng: + prnt(' PyObject *arg%d;' % i) + prnt() + prnt(' if (!PyArg_ParseTuple(args, "%s:%s", %s))' % ( + 'O' * numargs, name, ', '.join(['&arg%d' % i for i in rng]))) + prnt(' return NULL;') + prnt() + # + for i, type in enumerate(tp.args): + self._convert_funcarg_to_c(type, 'arg%d' % i, 'x%d' % i, + 'return NULL') + prnt() + # + prnt(' Py_BEGIN_ALLOW_THREADS') + prnt(' _cffi_restore_errno();') + prnt(' { %s%s(%s); }' % ( + result_code, name, + ', '.join(['x%d' % i for i in range(len(tp.args))]))) + prnt(' _cffi_save_errno();') + prnt(' Py_END_ALLOW_THREADS') + prnt() + # + prnt(' (void)self; /* unused */') + if numargs == 0: + prnt(' (void)noarg; /* unused */') + if result_code: + prnt(' return %s;' % + self._convert_expr_from_c(tp.result, 'result', 'result type')) + else: + prnt(' Py_INCREF(Py_None);') + prnt(' return Py_None;') + prnt('}') + prnt() + + def _generate_cpy_function_method(self, tp, name): + if tp.ellipsis: + return + numargs = len(tp.args) + if numargs == 0: + meth = 'METH_NOARGS' + elif numargs == 1: + meth = 'METH_O' + else: + meth = 'METH_VARARGS' + self._prnt(' {"%s", _cffi_f_%s, %s, NULL},' % (name, name, meth)) + + _loading_cpy_function = _loaded_noop + + def _loaded_cpy_function(self, tp, name, module, library): + if tp.ellipsis: + return + func = getattr(module, name) + setattr(library, name, func) + self._types_of_builtin_functions[func] = tp + + # ---------- + # named structs + + _generate_cpy_struct_collecttype = _generate_nothing + def _generate_cpy_struct_decl(self, tp, name): + assert name == tp.name + self._generate_struct_or_union_decl(tp, 'struct', name) + def _generate_cpy_struct_method(self, tp, name): + self._generate_struct_or_union_method(tp, 'struct', name) + def _loading_cpy_struct(self, tp, name, module): + self._loading_struct_or_union(tp, 'struct', name, module) + def _loaded_cpy_struct(self, tp, name, module, **kwds): + self._loaded_struct_or_union(tp) + + _generate_cpy_union_collecttype = _generate_nothing + def _generate_cpy_union_decl(self, tp, name): + assert name == tp.name + self._generate_struct_or_union_decl(tp, 'union', name) + def _generate_cpy_union_method(self, tp, name): + self._generate_struct_or_union_method(tp, 'union', name) + def _loading_cpy_union(self, tp, name, module): + self._loading_struct_or_union(tp, 'union', name, module) + def _loaded_cpy_union(self, tp, name, module, **kwds): + self._loaded_struct_or_union(tp) + + def _generate_struct_or_union_decl(self, tp, prefix, name): + if tp.fldnames is None: + return # nothing to do with opaque structs + checkfuncname = '_cffi_check_%s_%s' % (prefix, name) + layoutfuncname = '_cffi_layout_%s_%s' % (prefix, name) + cname = ('%s %s' % (prefix, name)).strip() + # + prnt = self._prnt + prnt('static void %s(%s *p)' % (checkfuncname, cname)) + prnt('{') + prnt(' /* only to generate compile-time warnings or errors */') + prnt(' (void)p;') + for fname, ftype, fbitsize, fqual in tp.enumfields(): + if (isinstance(ftype, model.PrimitiveType) + and ftype.is_integer_type()) or fbitsize >= 0: + # accept all integers, but complain on float or double + prnt(' (void)((p->%s) << 1);' % fname) + else: + # only accept exactly the type declared. + try: + prnt(' { %s = &p->%s; (void)tmp; }' % ( + ftype.get_c_name('*tmp', 'field %r'%fname, quals=fqual), + fname)) + except VerificationError as e: + prnt(' /* %s */' % str(e)) # cannot verify it, ignore + prnt('}') + prnt('static PyObject *') + prnt('%s(PyObject *self, PyObject *noarg)' % (layoutfuncname,)) + prnt('{') + prnt(' struct _cffi_aligncheck { char x; %s y; };' % cname) + prnt(' static Py_ssize_t nums[] = {') + prnt(' sizeof(%s),' % cname) + prnt(' offsetof(struct _cffi_aligncheck, y),') + for fname, ftype, fbitsize, fqual in tp.enumfields(): + if fbitsize >= 0: + continue # xxx ignore fbitsize for now + prnt(' offsetof(%s, %s),' % (cname, fname)) + if isinstance(ftype, model.ArrayType) and ftype.length is None: + prnt(' 0, /* %s */' % ftype._get_c_name()) + else: + prnt(' sizeof(((%s *)0)->%s),' % (cname, fname)) + prnt(' -1') + prnt(' };') + prnt(' (void)self; /* unused */') + prnt(' (void)noarg; /* unused */') + prnt(' return _cffi_get_struct_layout(nums);') + prnt(' /* the next line is not executed, but compiled */') + prnt(' %s(0);' % (checkfuncname,)) + prnt('}') + prnt() + + def _generate_struct_or_union_method(self, tp, prefix, name): + if tp.fldnames is None: + return # nothing to do with opaque structs + layoutfuncname = '_cffi_layout_%s_%s' % (prefix, name) + self._prnt(' {"%s", %s, METH_NOARGS, NULL},' % (layoutfuncname, + layoutfuncname)) + + def _loading_struct_or_union(self, tp, prefix, name, module): + if tp.fldnames is None: + return # nothing to do with opaque structs + layoutfuncname = '_cffi_layout_%s_%s' % (prefix, name) + # + function = getattr(module, layoutfuncname) + layout = function() + if isinstance(tp, model.StructOrUnion) and tp.partial: + # use the function()'s sizes and offsets to guide the + # layout of the struct + totalsize = layout[0] + totalalignment = layout[1] + fieldofs = layout[2::2] + fieldsize = layout[3::2] + tp.force_flatten() + assert len(fieldofs) == len(fieldsize) == len(tp.fldnames) + tp.fixedlayout = fieldofs, fieldsize, totalsize, totalalignment + else: + cname = ('%s %s' % (prefix, name)).strip() + self._struct_pending_verification[tp] = layout, cname + + def _loaded_struct_or_union(self, tp): + if tp.fldnames is None: + return # nothing to do with opaque structs + self.ffi._get_cached_btype(tp) # force 'fixedlayout' to be considered + + if tp in self._struct_pending_verification: + # check that the layout sizes and offsets match the real ones + def check(realvalue, expectedvalue, msg): + if realvalue != expectedvalue: + raise VerificationError( + "%s (we have %d, but C compiler says %d)" + % (msg, expectedvalue, realvalue)) + ffi = self.ffi + BStruct = ffi._get_cached_btype(tp) + layout, cname = self._struct_pending_verification.pop(tp) + check(layout[0], ffi.sizeof(BStruct), "wrong total size") + check(layout[1], ffi.alignof(BStruct), "wrong total alignment") + i = 2 + for fname, ftype, fbitsize, fqual in tp.enumfields(): + if fbitsize >= 0: + continue # xxx ignore fbitsize for now + check(layout[i], ffi.offsetof(BStruct, fname), + "wrong offset for field %r" % (fname,)) + if layout[i+1] != 0: + BField = ffi._get_cached_btype(ftype) + check(layout[i+1], ffi.sizeof(BField), + "wrong size for field %r" % (fname,)) + i += 2 + assert i == len(layout) + + # ---------- + # 'anonymous' declarations. These are produced for anonymous structs + # or unions; the 'name' is obtained by a typedef. + + _generate_cpy_anonymous_collecttype = _generate_nothing + + def _generate_cpy_anonymous_decl(self, tp, name): + if isinstance(tp, model.EnumType): + self._generate_cpy_enum_decl(tp, name, '') + else: + self._generate_struct_or_union_decl(tp, '', name) + + def _generate_cpy_anonymous_method(self, tp, name): + if not isinstance(tp, model.EnumType): + self._generate_struct_or_union_method(tp, '', name) + + def _loading_cpy_anonymous(self, tp, name, module): + if isinstance(tp, model.EnumType): + self._loading_cpy_enum(tp, name, module) + else: + self._loading_struct_or_union(tp, '', name, module) + + def _loaded_cpy_anonymous(self, tp, name, module, **kwds): + if isinstance(tp, model.EnumType): + self._loaded_cpy_enum(tp, name, module, **kwds) + else: + self._loaded_struct_or_union(tp) + + # ---------- + # constants, likely declared with '#define' + + def _generate_cpy_const(self, is_int, name, tp=None, category='const', + vartp=None, delayed=True, size_too=False, + check_value=None): + prnt = self._prnt + funcname = '_cffi_%s_%s' % (category, name) + prnt('static int %s(PyObject *lib)' % funcname) + prnt('{') + prnt(' PyObject *o;') + prnt(' int res;') + if not is_int: + prnt(' %s;' % (vartp or tp).get_c_name(' i', name)) + else: + assert category == 'const' + # + if check_value is not None: + self._check_int_constant_value(name, check_value) + # + if not is_int: + if category == 'var': + realexpr = '&' + name + else: + realexpr = name + prnt(' i = (%s);' % (realexpr,)) + prnt(' o = %s;' % (self._convert_expr_from_c(tp, 'i', + 'variable type'),)) + assert delayed + else: + prnt(' o = _cffi_from_c_int_const(%s);' % name) + prnt(' if (o == NULL)') + prnt(' return -1;') + if size_too: + prnt(' {') + prnt(' PyObject *o1 = o;') + prnt(' o = Py_BuildValue("On", o1, (Py_ssize_t)sizeof(%s));' + % (name,)) + prnt(' Py_DECREF(o1);') + prnt(' if (o == NULL)') + prnt(' return -1;') + prnt(' }') + prnt(' res = PyObject_SetAttrString(lib, "%s", o);' % name) + prnt(' Py_DECREF(o);') + prnt(' if (res < 0)') + prnt(' return -1;') + prnt(' return %s;' % self._chained_list_constants[delayed]) + self._chained_list_constants[delayed] = funcname + '(lib)' + prnt('}') + prnt() + + def _generate_cpy_constant_collecttype(self, tp, name): + is_int = isinstance(tp, model.PrimitiveType) and tp.is_integer_type() + if not is_int: + self._do_collect_type(tp) + + def _generate_cpy_constant_decl(self, tp, name): + is_int = isinstance(tp, model.PrimitiveType) and tp.is_integer_type() + self._generate_cpy_const(is_int, name, tp) + + _generate_cpy_constant_method = _generate_nothing + _loading_cpy_constant = _loaded_noop + _loaded_cpy_constant = _loaded_noop + + # ---------- + # enums + + def _check_int_constant_value(self, name, value, err_prefix=''): + prnt = self._prnt + if value <= 0: + prnt(' if ((%s) > 0 || (long)(%s) != %dL) {' % ( + name, name, value)) + else: + prnt(' if ((%s) <= 0 || (unsigned long)(%s) != %dUL) {' % ( + name, name, value)) + prnt(' char buf[64];') + prnt(' if ((%s) <= 0)' % name) + prnt(' snprintf(buf, 63, "%%ld", (long)(%s));' % name) + prnt(' else') + prnt(' snprintf(buf, 63, "%%lu", (unsigned long)(%s));' % + name) + prnt(' PyErr_Format(_cffi_VerificationError,') + prnt(' "%s%s has the real value %s, not %s",') + prnt(' "%s", "%s", buf, "%d");' % ( + err_prefix, name, value)) + prnt(' return -1;') + prnt(' }') + + def _enum_funcname(self, prefix, name): + # "$enum_$1" => "___D_enum____D_1" + name = name.replace('$', '___D_') + return '_cffi_e_%s_%s' % (prefix, name) + + def _generate_cpy_enum_decl(self, tp, name, prefix='enum'): + if tp.partial: + for enumerator in tp.enumerators: + self._generate_cpy_const(True, enumerator, delayed=False) + return + # + funcname = self._enum_funcname(prefix, name) + prnt = self._prnt + prnt('static int %s(PyObject *lib)' % funcname) + prnt('{') + for enumerator, enumvalue in zip(tp.enumerators, tp.enumvalues): + self._check_int_constant_value(enumerator, enumvalue, + "enum %s: " % name) + prnt(' return %s;' % self._chained_list_constants[True]) + self._chained_list_constants[True] = funcname + '(lib)' + prnt('}') + prnt() + + _generate_cpy_enum_collecttype = _generate_nothing + _generate_cpy_enum_method = _generate_nothing + + def _loading_cpy_enum(self, tp, name, module): + if tp.partial: + enumvalues = [getattr(module, enumerator) + for enumerator in tp.enumerators] + tp.enumvalues = tuple(enumvalues) + tp.partial_resolved = True + + def _loaded_cpy_enum(self, tp, name, module, library): + for enumerator, enumvalue in zip(tp.enumerators, tp.enumvalues): + setattr(library, enumerator, enumvalue) + + # ---------- + # macros: for now only for integers + + def _generate_cpy_macro_decl(self, tp, name): + if tp == '...': + check_value = None + else: + check_value = tp # an integer + self._generate_cpy_const(True, name, check_value=check_value) + + _generate_cpy_macro_collecttype = _generate_nothing + _generate_cpy_macro_method = _generate_nothing + _loading_cpy_macro = _loaded_noop + _loaded_cpy_macro = _loaded_noop + + # ---------- + # global variables + + def _generate_cpy_variable_collecttype(self, tp, name): + if isinstance(tp, model.ArrayType): + tp_ptr = model.PointerType(tp.item) + else: + tp_ptr = model.PointerType(tp) + self._do_collect_type(tp_ptr) + + def _generate_cpy_variable_decl(self, tp, name): + if isinstance(tp, model.ArrayType): + tp_ptr = model.PointerType(tp.item) + self._generate_cpy_const(False, name, tp, vartp=tp_ptr, + size_too = (tp.length == '...')) + else: + tp_ptr = model.PointerType(tp) + self._generate_cpy_const(False, name, tp_ptr, category='var') + + _generate_cpy_variable_method = _generate_nothing + _loading_cpy_variable = _loaded_noop + + def _loaded_cpy_variable(self, tp, name, module, library): + value = getattr(library, name) + if isinstance(tp, model.ArrayType): # int a[5] is "constant" in the + # sense that "a=..." is forbidden + if tp.length == '...': + assert isinstance(value, tuple) + (value, size) = value + BItemType = self.ffi._get_cached_btype(tp.item) + length, rest = divmod(size, self.ffi.sizeof(BItemType)) + if rest != 0: + raise VerificationError( + "bad size: %r does not seem to be an array of %s" % + (name, tp.item)) + tp = tp.resolve_length(length) + # 'value' is a which we have to replace with + # a if the N is actually known + if tp.length is not None: + BArray = self.ffi._get_cached_btype(tp) + value = self.ffi.cast(BArray, value) + setattr(library, name, value) + return + # remove ptr= from the library instance, and replace + # it by a property on the class, which reads/writes into ptr[0]. + ptr = value + delattr(library, name) + def getter(library): + return ptr[0] + def setter(library, value): + ptr[0] = value + setattr(type(library), name, property(getter, setter)) + type(library)._cffi_dir.append(name) + + # ---------- + + def _generate_setup_custom(self): + prnt = self._prnt + prnt('static int _cffi_setup_custom(PyObject *lib)') + prnt('{') + prnt(' return %s;' % self._chained_list_constants[True]) + prnt('}') + +cffimod_header = r''' +#include +#include + +/* this block of #ifs should be kept exactly identical between + c/_cffi_backend.c, cffi/vengine_cpy.py, cffi/vengine_gen.py + and cffi/_cffi_include.h */ +#if defined(_MSC_VER) +# include /* for alloca() */ +# if _MSC_VER < 1600 /* MSVC < 2010 */ + typedef __int8 int8_t; + typedef __int16 int16_t; + typedef __int32 int32_t; + typedef __int64 int64_t; + typedef unsigned __int8 uint8_t; + typedef unsigned __int16 uint16_t; + typedef unsigned __int32 uint32_t; + typedef unsigned __int64 uint64_t; + typedef __int8 int_least8_t; + typedef __int16 int_least16_t; + typedef __int32 int_least32_t; + typedef __int64 int_least64_t; + typedef unsigned __int8 uint_least8_t; + typedef unsigned __int16 uint_least16_t; + typedef unsigned __int32 uint_least32_t; + typedef unsigned __int64 uint_least64_t; + typedef __int8 int_fast8_t; + typedef __int16 int_fast16_t; + typedef __int32 int_fast32_t; + typedef __int64 int_fast64_t; + typedef unsigned __int8 uint_fast8_t; + typedef unsigned __int16 uint_fast16_t; + typedef unsigned __int32 uint_fast32_t; + typedef unsigned __int64 uint_fast64_t; + typedef __int64 intmax_t; + typedef unsigned __int64 uintmax_t; +# else +# include +# endif +# if _MSC_VER < 1800 /* MSVC < 2013 */ +# ifndef __cplusplus + typedef unsigned char _Bool; +# endif +# endif +#else +# include +# if (defined (__SVR4) && defined (__sun)) || defined(_AIX) || defined(__hpux) +# include +# endif +#endif + +#if PY_MAJOR_VERSION < 3 +# undef PyCapsule_CheckExact +# undef PyCapsule_GetPointer +# define PyCapsule_CheckExact(capsule) (PyCObject_Check(capsule)) +# define PyCapsule_GetPointer(capsule, name) \ + (PyCObject_AsVoidPtr(capsule)) +#endif + +#if PY_MAJOR_VERSION >= 3 +# define PyInt_FromLong PyLong_FromLong +#endif + +#define _cffi_from_c_double PyFloat_FromDouble +#define _cffi_from_c_float PyFloat_FromDouble +#define _cffi_from_c_long PyInt_FromLong +#define _cffi_from_c_ulong PyLong_FromUnsignedLong +#define _cffi_from_c_longlong PyLong_FromLongLong +#define _cffi_from_c_ulonglong PyLong_FromUnsignedLongLong +#define _cffi_from_c__Bool PyBool_FromLong + +#define _cffi_to_c_double PyFloat_AsDouble +#define _cffi_to_c_float PyFloat_AsDouble + +#define _cffi_from_c_int_const(x) \ + (((x) > 0) ? \ + ((unsigned long long)(x) <= (unsigned long long)LONG_MAX) ? \ + PyInt_FromLong((long)(x)) : \ + PyLong_FromUnsignedLongLong((unsigned long long)(x)) : \ + ((long long)(x) >= (long long)LONG_MIN) ? \ + PyInt_FromLong((long)(x)) : \ + PyLong_FromLongLong((long long)(x))) + +#define _cffi_from_c_int(x, type) \ + (((type)-1) > 0 ? /* unsigned */ \ + (sizeof(type) < sizeof(long) ? \ + PyInt_FromLong((long)x) : \ + sizeof(type) == sizeof(long) ? \ + PyLong_FromUnsignedLong((unsigned long)x) : \ + PyLong_FromUnsignedLongLong((unsigned long long)x)) : \ + (sizeof(type) <= sizeof(long) ? \ + PyInt_FromLong((long)x) : \ + PyLong_FromLongLong((long long)x))) + +#define _cffi_to_c_int(o, type) \ + ((type)( \ + sizeof(type) == 1 ? (((type)-1) > 0 ? (type)_cffi_to_c_u8(o) \ + : (type)_cffi_to_c_i8(o)) : \ + sizeof(type) == 2 ? (((type)-1) > 0 ? (type)_cffi_to_c_u16(o) \ + : (type)_cffi_to_c_i16(o)) : \ + sizeof(type) == 4 ? (((type)-1) > 0 ? (type)_cffi_to_c_u32(o) \ + : (type)_cffi_to_c_i32(o)) : \ + sizeof(type) == 8 ? (((type)-1) > 0 ? (type)_cffi_to_c_u64(o) \ + : (type)_cffi_to_c_i64(o)) : \ + (Py_FatalError("unsupported size for type " #type), (type)0))) + +#define _cffi_to_c_i8 \ + ((int(*)(PyObject *))_cffi_exports[1]) +#define _cffi_to_c_u8 \ + ((int(*)(PyObject *))_cffi_exports[2]) +#define _cffi_to_c_i16 \ + ((int(*)(PyObject *))_cffi_exports[3]) +#define _cffi_to_c_u16 \ + ((int(*)(PyObject *))_cffi_exports[4]) +#define _cffi_to_c_i32 \ + ((int(*)(PyObject *))_cffi_exports[5]) +#define _cffi_to_c_u32 \ + ((unsigned int(*)(PyObject *))_cffi_exports[6]) +#define _cffi_to_c_i64 \ + ((long long(*)(PyObject *))_cffi_exports[7]) +#define _cffi_to_c_u64 \ + ((unsigned long long(*)(PyObject *))_cffi_exports[8]) +#define _cffi_to_c_char \ + ((int(*)(PyObject *))_cffi_exports[9]) +#define _cffi_from_c_pointer \ + ((PyObject *(*)(char *, CTypeDescrObject *))_cffi_exports[10]) +#define _cffi_to_c_pointer \ + ((char *(*)(PyObject *, CTypeDescrObject *))_cffi_exports[11]) +#define _cffi_get_struct_layout \ + ((PyObject *(*)(Py_ssize_t[]))_cffi_exports[12]) +#define _cffi_restore_errno \ + ((void(*)(void))_cffi_exports[13]) +#define _cffi_save_errno \ + ((void(*)(void))_cffi_exports[14]) +#define _cffi_from_c_char \ + ((PyObject *(*)(char))_cffi_exports[15]) +#define _cffi_from_c_deref \ + ((PyObject *(*)(char *, CTypeDescrObject *))_cffi_exports[16]) +#define _cffi_to_c \ + ((int(*)(char *, CTypeDescrObject *, PyObject *))_cffi_exports[17]) +#define _cffi_from_c_struct \ + ((PyObject *(*)(char *, CTypeDescrObject *))_cffi_exports[18]) +#define _cffi_to_c_wchar_t \ + ((wchar_t(*)(PyObject *))_cffi_exports[19]) +#define _cffi_from_c_wchar_t \ + ((PyObject *(*)(wchar_t))_cffi_exports[20]) +#define _cffi_to_c_long_double \ + ((long double(*)(PyObject *))_cffi_exports[21]) +#define _cffi_to_c__Bool \ + ((_Bool(*)(PyObject *))_cffi_exports[22]) +#define _cffi_prepare_pointer_call_argument \ + ((Py_ssize_t(*)(CTypeDescrObject *, PyObject *, char **))_cffi_exports[23]) +#define _cffi_convert_array_from_object \ + ((int(*)(char *, CTypeDescrObject *, PyObject *))_cffi_exports[24]) +#define _CFFI_NUM_EXPORTS 25 + +typedef struct _ctypedescr CTypeDescrObject; + +static void *_cffi_exports[_CFFI_NUM_EXPORTS]; +static PyObject *_cffi_types, *_cffi_VerificationError; + +static int _cffi_setup_custom(PyObject *lib); /* forward */ + +static PyObject *_cffi_setup(PyObject *self, PyObject *args) +{ + PyObject *library; + int was_alive = (_cffi_types != NULL); + (void)self; /* unused */ + if (!PyArg_ParseTuple(args, "OOO", &_cffi_types, &_cffi_VerificationError, + &library)) + return NULL; + Py_INCREF(_cffi_types); + Py_INCREF(_cffi_VerificationError); + if (_cffi_setup_custom(library) < 0) + return NULL; + return PyBool_FromLong(was_alive); +} + +static int _cffi_init(void) +{ + PyObject *module, *c_api_object = NULL; + + module = PyImport_ImportModule("_cffi_backend"); + if (module == NULL) + goto failure; + + c_api_object = PyObject_GetAttrString(module, "_C_API"); + if (c_api_object == NULL) + goto failure; + if (!PyCapsule_CheckExact(c_api_object)) { + PyErr_SetNone(PyExc_ImportError); + goto failure; + } + memcpy(_cffi_exports, PyCapsule_GetPointer(c_api_object, "cffi"), + _CFFI_NUM_EXPORTS * sizeof(void *)); + + Py_DECREF(module); + Py_DECREF(c_api_object); + return 0; + + failure: + Py_XDECREF(module); + Py_XDECREF(c_api_object); + return -1; +} + +#define _cffi_type(num) ((CTypeDescrObject *)PyList_GET_ITEM(_cffi_types, num)) + +/**********/ +''' diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/cffi/vengine_gen.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/cffi/vengine_gen.py new file mode 100644 index 00000000..a64ff644 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/cffi/vengine_gen.py @@ -0,0 +1,675 @@ +# +# DEPRECATED: implementation for ffi.verify() +# +import sys, os +import types + +from . import model +from .error import VerificationError + + +class VGenericEngine(object): + _class_key = 'g' + _gen_python_module = False + + def __init__(self, verifier): + self.verifier = verifier + self.ffi = verifier.ffi + self.export_symbols = [] + self._struct_pending_verification = {} + + def patch_extension_kwds(self, kwds): + # add 'export_symbols' to the dictionary. Note that we add the + # list before filling it. When we fill it, it will thus also show + # up in kwds['export_symbols']. + kwds.setdefault('export_symbols', self.export_symbols) + + def find_module(self, module_name, path, so_suffixes): + for so_suffix in so_suffixes: + basename = module_name + so_suffix + if path is None: + path = sys.path + for dirname in path: + filename = os.path.join(dirname, basename) + if os.path.isfile(filename): + return filename + + def collect_types(self): + pass # not needed in the generic engine + + def _prnt(self, what=''): + self._f.write(what + '\n') + + def write_source_to_f(self): + prnt = self._prnt + # first paste some standard set of lines that are mostly '#include' + prnt(cffimod_header) + # then paste the C source given by the user, verbatim. + prnt(self.verifier.preamble) + # + # call generate_gen_xxx_decl(), for every xxx found from + # ffi._parser._declarations. This generates all the functions. + self._generate('decl') + # + # on Windows, distutils insists on putting init_cffi_xyz in + # 'export_symbols', so instead of fighting it, just give up and + # give it one + if sys.platform == 'win32': + if sys.version_info >= (3,): + prefix = 'PyInit_' + else: + prefix = 'init' + modname = self.verifier.get_module_name() + prnt("void %s%s(void) { }\n" % (prefix, modname)) + + def load_library(self, flags=0): + # import it with the CFFI backend + backend = self.ffi._backend + # needs to make a path that contains '/', on Posix + filename = os.path.join(os.curdir, self.verifier.modulefilename) + module = backend.load_library(filename, flags) + # + # call loading_gen_struct() to get the struct layout inferred by + # the C compiler + self._load(module, 'loading') + + # build the FFILibrary class and instance, this is a module subclass + # because modules are expected to have usually-constant-attributes and + # in PyPy this means the JIT is able to treat attributes as constant, + # which we want. + class FFILibrary(types.ModuleType): + _cffi_generic_module = module + _cffi_ffi = self.ffi + _cffi_dir = [] + def __dir__(self): + return FFILibrary._cffi_dir + library = FFILibrary("") + # + # finally, call the loaded_gen_xxx() functions. This will set + # up the 'library' object. + self._load(module, 'loaded', library=library) + return library + + def _get_declarations(self): + lst = [(key, tp) for (key, (tp, qual)) in + self.ffi._parser._declarations.items()] + lst.sort() + return lst + + def _generate(self, step_name): + for name, tp in self._get_declarations(): + kind, realname = name.split(' ', 1) + try: + method = getattr(self, '_generate_gen_%s_%s' % (kind, + step_name)) + except AttributeError: + raise VerificationError( + "not implemented in verify(): %r" % name) + try: + method(tp, realname) + except Exception as e: + model.attach_exception_info(e, name) + raise + + def _load(self, module, step_name, **kwds): + for name, tp in self._get_declarations(): + kind, realname = name.split(' ', 1) + method = getattr(self, '_%s_gen_%s' % (step_name, kind)) + try: + method(tp, realname, module, **kwds) + except Exception as e: + model.attach_exception_info(e, name) + raise + + def _generate_nothing(self, tp, name): + pass + + def _loaded_noop(self, tp, name, module, **kwds): + pass + + # ---------- + # typedefs: generates no code so far + + _generate_gen_typedef_decl = _generate_nothing + _loading_gen_typedef = _loaded_noop + _loaded_gen_typedef = _loaded_noop + + # ---------- + # function declarations + + def _generate_gen_function_decl(self, tp, name): + assert isinstance(tp, model.FunctionPtrType) + if tp.ellipsis: + # cannot support vararg functions better than this: check for its + # exact type (including the fixed arguments), and build it as a + # constant function pointer (no _cffi_f_%s wrapper) + self._generate_gen_const(False, name, tp) + return + prnt = self._prnt + numargs = len(tp.args) + argnames = [] + for i, type in enumerate(tp.args): + indirection = '' + if isinstance(type, model.StructOrUnion): + indirection = '*' + argnames.append('%sx%d' % (indirection, i)) + context = 'argument of %s' % name + arglist = [type.get_c_name(' %s' % arg, context) + for type, arg in zip(tp.args, argnames)] + tpresult = tp.result + if isinstance(tpresult, model.StructOrUnion): + arglist.insert(0, tpresult.get_c_name(' *r', context)) + tpresult = model.void_type + arglist = ', '.join(arglist) or 'void' + wrappername = '_cffi_f_%s' % name + self.export_symbols.append(wrappername) + if tp.abi: + abi = tp.abi + ' ' + else: + abi = '' + funcdecl = ' %s%s(%s)' % (abi, wrappername, arglist) + context = 'result of %s' % name + prnt(tpresult.get_c_name(funcdecl, context)) + prnt('{') + # + if isinstance(tp.result, model.StructOrUnion): + result_code = '*r = ' + elif not isinstance(tp.result, model.VoidType): + result_code = 'return ' + else: + result_code = '' + prnt(' %s%s(%s);' % (result_code, name, ', '.join(argnames))) + prnt('}') + prnt() + + _loading_gen_function = _loaded_noop + + def _loaded_gen_function(self, tp, name, module, library): + assert isinstance(tp, model.FunctionPtrType) + if tp.ellipsis: + newfunction = self._load_constant(False, tp, name, module) + else: + indirections = [] + base_tp = tp + if (any(isinstance(typ, model.StructOrUnion) for typ in tp.args) + or isinstance(tp.result, model.StructOrUnion)): + indirect_args = [] + for i, typ in enumerate(tp.args): + if isinstance(typ, model.StructOrUnion): + typ = model.PointerType(typ) + indirections.append((i, typ)) + indirect_args.append(typ) + indirect_result = tp.result + if isinstance(indirect_result, model.StructOrUnion): + if indirect_result.fldtypes is None: + raise TypeError("'%s' is used as result type, " + "but is opaque" % ( + indirect_result._get_c_name(),)) + indirect_result = model.PointerType(indirect_result) + indirect_args.insert(0, indirect_result) + indirections.insert(0, ("result", indirect_result)) + indirect_result = model.void_type + tp = model.FunctionPtrType(tuple(indirect_args), + indirect_result, tp.ellipsis) + BFunc = self.ffi._get_cached_btype(tp) + wrappername = '_cffi_f_%s' % name + newfunction = module.load_function(BFunc, wrappername) + for i, typ in indirections: + newfunction = self._make_struct_wrapper(newfunction, i, typ, + base_tp) + setattr(library, name, newfunction) + type(library)._cffi_dir.append(name) + + def _make_struct_wrapper(self, oldfunc, i, tp, base_tp): + backend = self.ffi._backend + BType = self.ffi._get_cached_btype(tp) + if i == "result": + ffi = self.ffi + def newfunc(*args): + res = ffi.new(BType) + oldfunc(res, *args) + return res[0] + else: + def newfunc(*args): + args = args[:i] + (backend.newp(BType, args[i]),) + args[i+1:] + return oldfunc(*args) + newfunc._cffi_base_type = base_tp + return newfunc + + # ---------- + # named structs + + def _generate_gen_struct_decl(self, tp, name): + assert name == tp.name + self._generate_struct_or_union_decl(tp, 'struct', name) + + def _loading_gen_struct(self, tp, name, module): + self._loading_struct_or_union(tp, 'struct', name, module) + + def _loaded_gen_struct(self, tp, name, module, **kwds): + self._loaded_struct_or_union(tp) + + def _generate_gen_union_decl(self, tp, name): + assert name == tp.name + self._generate_struct_or_union_decl(tp, 'union', name) + + def _loading_gen_union(self, tp, name, module): + self._loading_struct_or_union(tp, 'union', name, module) + + def _loaded_gen_union(self, tp, name, module, **kwds): + self._loaded_struct_or_union(tp) + + def _generate_struct_or_union_decl(self, tp, prefix, name): + if tp.fldnames is None: + return # nothing to do with opaque structs + checkfuncname = '_cffi_check_%s_%s' % (prefix, name) + layoutfuncname = '_cffi_layout_%s_%s' % (prefix, name) + cname = ('%s %s' % (prefix, name)).strip() + # + prnt = self._prnt + prnt('static void %s(%s *p)' % (checkfuncname, cname)) + prnt('{') + prnt(' /* only to generate compile-time warnings or errors */') + prnt(' (void)p;') + for fname, ftype, fbitsize, fqual in tp.enumfields(): + if (isinstance(ftype, model.PrimitiveType) + and ftype.is_integer_type()) or fbitsize >= 0: + # accept all integers, but complain on float or double + prnt(' (void)((p->%s) << 1);' % fname) + else: + # only accept exactly the type declared. + try: + prnt(' { %s = &p->%s; (void)tmp; }' % ( + ftype.get_c_name('*tmp', 'field %r'%fname, quals=fqual), + fname)) + except VerificationError as e: + prnt(' /* %s */' % str(e)) # cannot verify it, ignore + prnt('}') + self.export_symbols.append(layoutfuncname) + prnt('intptr_t %s(intptr_t i)' % (layoutfuncname,)) + prnt('{') + prnt(' struct _cffi_aligncheck { char x; %s y; };' % cname) + prnt(' static intptr_t nums[] = {') + prnt(' sizeof(%s),' % cname) + prnt(' offsetof(struct _cffi_aligncheck, y),') + for fname, ftype, fbitsize, fqual in tp.enumfields(): + if fbitsize >= 0: + continue # xxx ignore fbitsize for now + prnt(' offsetof(%s, %s),' % (cname, fname)) + if isinstance(ftype, model.ArrayType) and ftype.length is None: + prnt(' 0, /* %s */' % ftype._get_c_name()) + else: + prnt(' sizeof(((%s *)0)->%s),' % (cname, fname)) + prnt(' -1') + prnt(' };') + prnt(' return nums[i];') + prnt(' /* the next line is not executed, but compiled */') + prnt(' %s(0);' % (checkfuncname,)) + prnt('}') + prnt() + + def _loading_struct_or_union(self, tp, prefix, name, module): + if tp.fldnames is None: + return # nothing to do with opaque structs + layoutfuncname = '_cffi_layout_%s_%s' % (prefix, name) + # + BFunc = self.ffi._typeof_locked("intptr_t(*)(intptr_t)")[0] + function = module.load_function(BFunc, layoutfuncname) + layout = [] + num = 0 + while True: + x = function(num) + if x < 0: break + layout.append(x) + num += 1 + if isinstance(tp, model.StructOrUnion) and tp.partial: + # use the function()'s sizes and offsets to guide the + # layout of the struct + totalsize = layout[0] + totalalignment = layout[1] + fieldofs = layout[2::2] + fieldsize = layout[3::2] + tp.force_flatten() + assert len(fieldofs) == len(fieldsize) == len(tp.fldnames) + tp.fixedlayout = fieldofs, fieldsize, totalsize, totalalignment + else: + cname = ('%s %s' % (prefix, name)).strip() + self._struct_pending_verification[tp] = layout, cname + + def _loaded_struct_or_union(self, tp): + if tp.fldnames is None: + return # nothing to do with opaque structs + self.ffi._get_cached_btype(tp) # force 'fixedlayout' to be considered + + if tp in self._struct_pending_verification: + # check that the layout sizes and offsets match the real ones + def check(realvalue, expectedvalue, msg): + if realvalue != expectedvalue: + raise VerificationError( + "%s (we have %d, but C compiler says %d)" + % (msg, expectedvalue, realvalue)) + ffi = self.ffi + BStruct = ffi._get_cached_btype(tp) + layout, cname = self._struct_pending_verification.pop(tp) + check(layout[0], ffi.sizeof(BStruct), "wrong total size") + check(layout[1], ffi.alignof(BStruct), "wrong total alignment") + i = 2 + for fname, ftype, fbitsize, fqual in tp.enumfields(): + if fbitsize >= 0: + continue # xxx ignore fbitsize for now + check(layout[i], ffi.offsetof(BStruct, fname), + "wrong offset for field %r" % (fname,)) + if layout[i+1] != 0: + BField = ffi._get_cached_btype(ftype) + check(layout[i+1], ffi.sizeof(BField), + "wrong size for field %r" % (fname,)) + i += 2 + assert i == len(layout) + + # ---------- + # 'anonymous' declarations. These are produced for anonymous structs + # or unions; the 'name' is obtained by a typedef. + + def _generate_gen_anonymous_decl(self, tp, name): + if isinstance(tp, model.EnumType): + self._generate_gen_enum_decl(tp, name, '') + else: + self._generate_struct_or_union_decl(tp, '', name) + + def _loading_gen_anonymous(self, tp, name, module): + if isinstance(tp, model.EnumType): + self._loading_gen_enum(tp, name, module, '') + else: + self._loading_struct_or_union(tp, '', name, module) + + def _loaded_gen_anonymous(self, tp, name, module, **kwds): + if isinstance(tp, model.EnumType): + self._loaded_gen_enum(tp, name, module, **kwds) + else: + self._loaded_struct_or_union(tp) + + # ---------- + # constants, likely declared with '#define' + + def _generate_gen_const(self, is_int, name, tp=None, category='const', + check_value=None): + prnt = self._prnt + funcname = '_cffi_%s_%s' % (category, name) + self.export_symbols.append(funcname) + if check_value is not None: + assert is_int + assert category == 'const' + prnt('int %s(char *out_error)' % funcname) + prnt('{') + self._check_int_constant_value(name, check_value) + prnt(' return 0;') + prnt('}') + elif is_int: + assert category == 'const' + prnt('int %s(long long *out_value)' % funcname) + prnt('{') + prnt(' *out_value = (long long)(%s);' % (name,)) + prnt(' return (%s) <= 0;' % (name,)) + prnt('}') + else: + assert tp is not None + assert check_value is None + if category == 'var': + ampersand = '&' + else: + ampersand = '' + extra = '' + if category == 'const' and isinstance(tp, model.StructOrUnion): + extra = 'const *' + ampersand = '&' + prnt(tp.get_c_name(' %s%s(void)' % (extra, funcname), name)) + prnt('{') + prnt(' return (%s%s);' % (ampersand, name)) + prnt('}') + prnt() + + def _generate_gen_constant_decl(self, tp, name): + is_int = isinstance(tp, model.PrimitiveType) and tp.is_integer_type() + self._generate_gen_const(is_int, name, tp) + + _loading_gen_constant = _loaded_noop + + def _load_constant(self, is_int, tp, name, module, check_value=None): + funcname = '_cffi_const_%s' % name + if check_value is not None: + assert is_int + self._load_known_int_constant(module, funcname) + value = check_value + elif is_int: + BType = self.ffi._typeof_locked("long long*")[0] + BFunc = self.ffi._typeof_locked("int(*)(long long*)")[0] + function = module.load_function(BFunc, funcname) + p = self.ffi.new(BType) + negative = function(p) + value = int(p[0]) + if value < 0 and not negative: + BLongLong = self.ffi._typeof_locked("long long")[0] + value += (1 << (8*self.ffi.sizeof(BLongLong))) + else: + assert check_value is None + fntypeextra = '(*)(void)' + if isinstance(tp, model.StructOrUnion): + fntypeextra = '*' + fntypeextra + BFunc = self.ffi._typeof_locked(tp.get_c_name(fntypeextra, name))[0] + function = module.load_function(BFunc, funcname) + value = function() + if isinstance(tp, model.StructOrUnion): + value = value[0] + return value + + def _loaded_gen_constant(self, tp, name, module, library): + is_int = isinstance(tp, model.PrimitiveType) and tp.is_integer_type() + value = self._load_constant(is_int, tp, name, module) + setattr(library, name, value) + type(library)._cffi_dir.append(name) + + # ---------- + # enums + + def _check_int_constant_value(self, name, value): + prnt = self._prnt + if value <= 0: + prnt(' if ((%s) > 0 || (long)(%s) != %dL) {' % ( + name, name, value)) + else: + prnt(' if ((%s) <= 0 || (unsigned long)(%s) != %dUL) {' % ( + name, name, value)) + prnt(' char buf[64];') + prnt(' if ((%s) <= 0)' % name) + prnt(' sprintf(buf, "%%ld", (long)(%s));' % name) + prnt(' else') + prnt(' sprintf(buf, "%%lu", (unsigned long)(%s));' % + name) + prnt(' sprintf(out_error, "%s has the real value %s, not %s",') + prnt(' "%s", buf, "%d");' % (name[:100], value)) + prnt(' return -1;') + prnt(' }') + + def _load_known_int_constant(self, module, funcname): + BType = self.ffi._typeof_locked("char[]")[0] + BFunc = self.ffi._typeof_locked("int(*)(char*)")[0] + function = module.load_function(BFunc, funcname) + p = self.ffi.new(BType, 256) + if function(p) < 0: + error = self.ffi.string(p) + if sys.version_info >= (3,): + error = str(error, 'utf-8') + raise VerificationError(error) + + def _enum_funcname(self, prefix, name): + # "$enum_$1" => "___D_enum____D_1" + name = name.replace('$', '___D_') + return '_cffi_e_%s_%s' % (prefix, name) + + def _generate_gen_enum_decl(self, tp, name, prefix='enum'): + if tp.partial: + for enumerator in tp.enumerators: + self._generate_gen_const(True, enumerator) + return + # + funcname = self._enum_funcname(prefix, name) + self.export_symbols.append(funcname) + prnt = self._prnt + prnt('int %s(char *out_error)' % funcname) + prnt('{') + for enumerator, enumvalue in zip(tp.enumerators, tp.enumvalues): + self._check_int_constant_value(enumerator, enumvalue) + prnt(' return 0;') + prnt('}') + prnt() + + def _loading_gen_enum(self, tp, name, module, prefix='enum'): + if tp.partial: + enumvalues = [self._load_constant(True, tp, enumerator, module) + for enumerator in tp.enumerators] + tp.enumvalues = tuple(enumvalues) + tp.partial_resolved = True + else: + funcname = self._enum_funcname(prefix, name) + self._load_known_int_constant(module, funcname) + + def _loaded_gen_enum(self, tp, name, module, library): + for enumerator, enumvalue in zip(tp.enumerators, tp.enumvalues): + setattr(library, enumerator, enumvalue) + type(library)._cffi_dir.append(enumerator) + + # ---------- + # macros: for now only for integers + + def _generate_gen_macro_decl(self, tp, name): + if tp == '...': + check_value = None + else: + check_value = tp # an integer + self._generate_gen_const(True, name, check_value=check_value) + + _loading_gen_macro = _loaded_noop + + def _loaded_gen_macro(self, tp, name, module, library): + if tp == '...': + check_value = None + else: + check_value = tp # an integer + value = self._load_constant(True, tp, name, module, + check_value=check_value) + setattr(library, name, value) + type(library)._cffi_dir.append(name) + + # ---------- + # global variables + + def _generate_gen_variable_decl(self, tp, name): + if isinstance(tp, model.ArrayType): + if tp.length == '...': + prnt = self._prnt + funcname = '_cffi_sizeof_%s' % (name,) + self.export_symbols.append(funcname) + prnt("size_t %s(void)" % funcname) + prnt("{") + prnt(" return sizeof(%s);" % (name,)) + prnt("}") + tp_ptr = model.PointerType(tp.item) + self._generate_gen_const(False, name, tp_ptr) + else: + tp_ptr = model.PointerType(tp) + self._generate_gen_const(False, name, tp_ptr, category='var') + + _loading_gen_variable = _loaded_noop + + def _loaded_gen_variable(self, tp, name, module, library): + if isinstance(tp, model.ArrayType): # int a[5] is "constant" in the + # sense that "a=..." is forbidden + if tp.length == '...': + funcname = '_cffi_sizeof_%s' % (name,) + BFunc = self.ffi._typeof_locked('size_t(*)(void)')[0] + function = module.load_function(BFunc, funcname) + size = function() + BItemType = self.ffi._get_cached_btype(tp.item) + length, rest = divmod(size, self.ffi.sizeof(BItemType)) + if rest != 0: + raise VerificationError( + "bad size: %r does not seem to be an array of %s" % + (name, tp.item)) + tp = tp.resolve_length(length) + tp_ptr = model.PointerType(tp.item) + value = self._load_constant(False, tp_ptr, name, module) + # 'value' is a which we have to replace with + # a if the N is actually known + if tp.length is not None: + BArray = self.ffi._get_cached_btype(tp) + value = self.ffi.cast(BArray, value) + setattr(library, name, value) + type(library)._cffi_dir.append(name) + return + # remove ptr= from the library instance, and replace + # it by a property on the class, which reads/writes into ptr[0]. + funcname = '_cffi_var_%s' % name + BFunc = self.ffi._typeof_locked(tp.get_c_name('*(*)(void)', name))[0] + function = module.load_function(BFunc, funcname) + ptr = function() + def getter(library): + return ptr[0] + def setter(library, value): + ptr[0] = value + setattr(type(library), name, property(getter, setter)) + type(library)._cffi_dir.append(name) + +cffimod_header = r''' +#include +#include +#include +#include +#include /* XXX for ssize_t on some platforms */ + +/* this block of #ifs should be kept exactly identical between + c/_cffi_backend.c, cffi/vengine_cpy.py, cffi/vengine_gen.py + and cffi/_cffi_include.h */ +#if defined(_MSC_VER) +# include /* for alloca() */ +# if _MSC_VER < 1600 /* MSVC < 2010 */ + typedef __int8 int8_t; + typedef __int16 int16_t; + typedef __int32 int32_t; + typedef __int64 int64_t; + typedef unsigned __int8 uint8_t; + typedef unsigned __int16 uint16_t; + typedef unsigned __int32 uint32_t; + typedef unsigned __int64 uint64_t; + typedef __int8 int_least8_t; + typedef __int16 int_least16_t; + typedef __int32 int_least32_t; + typedef __int64 int_least64_t; + typedef unsigned __int8 uint_least8_t; + typedef unsigned __int16 uint_least16_t; + typedef unsigned __int32 uint_least32_t; + typedef unsigned __int64 uint_least64_t; + typedef __int8 int_fast8_t; + typedef __int16 int_fast16_t; + typedef __int32 int_fast32_t; + typedef __int64 int_fast64_t; + typedef unsigned __int8 uint_fast8_t; + typedef unsigned __int16 uint_fast16_t; + typedef unsigned __int32 uint_fast32_t; + typedef unsigned __int64 uint_fast64_t; + typedef __int64 intmax_t; + typedef unsigned __int64 uintmax_t; +# else +# include +# endif +# if _MSC_VER < 1800 /* MSVC < 2013 */ +# ifndef __cplusplus + typedef unsigned char _Bool; +# endif +# endif +#else +# include +# if (defined (__SVR4) && defined (__sun)) || defined(_AIX) || defined(__hpux) +# include +# endif +#endif +''' diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/cffi/verifier.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/cffi/verifier.py new file mode 100644 index 00000000..59b78c21 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/cffi/verifier.py @@ -0,0 +1,306 @@ +# +# DEPRECATED: implementation for ffi.verify() +# +import sys, os, binascii, shutil, io +from . import __version_verifier_modules__ +from . import ffiplatform +from .error import VerificationError + +if sys.version_info >= (3, 3): + import importlib.machinery + def _extension_suffixes(): + return importlib.machinery.EXTENSION_SUFFIXES[:] +else: + import imp + def _extension_suffixes(): + return [suffix for suffix, _, type in imp.get_suffixes() + if type == imp.C_EXTENSION] + + +if sys.version_info >= (3,): + NativeIO = io.StringIO +else: + class NativeIO(io.BytesIO): + def write(self, s): + if isinstance(s, unicode): + s = s.encode('ascii') + super(NativeIO, self).write(s) + + +class Verifier(object): + + def __init__(self, ffi, preamble, tmpdir=None, modulename=None, + ext_package=None, tag='', force_generic_engine=False, + source_extension='.c', flags=None, relative_to=None, **kwds): + if ffi._parser._uses_new_feature: + raise VerificationError( + "feature not supported with ffi.verify(), but only " + "with ffi.set_source(): %s" % (ffi._parser._uses_new_feature,)) + self.ffi = ffi + self.preamble = preamble + if not modulename: + flattened_kwds = ffiplatform.flatten(kwds) + vengine_class = _locate_engine_class(ffi, force_generic_engine) + self._vengine = vengine_class(self) + self._vengine.patch_extension_kwds(kwds) + self.flags = flags + self.kwds = self.make_relative_to(kwds, relative_to) + # + if modulename: + if tag: + raise TypeError("can't specify both 'modulename' and 'tag'") + else: + key = '\x00'.join([sys.version[:3], __version_verifier_modules__, + preamble, flattened_kwds] + + ffi._cdefsources) + if sys.version_info >= (3,): + key = key.encode('utf-8') + k1 = hex(binascii.crc32(key[0::2]) & 0xffffffff) + k1 = k1.lstrip('0x').rstrip('L') + k2 = hex(binascii.crc32(key[1::2]) & 0xffffffff) + k2 = k2.lstrip('0').rstrip('L') + modulename = '_cffi_%s_%s%s%s' % (tag, self._vengine._class_key, + k1, k2) + suffix = _get_so_suffixes()[0] + self.tmpdir = tmpdir or _caller_dir_pycache() + self.sourcefilename = os.path.join(self.tmpdir, modulename + source_extension) + self.modulefilename = os.path.join(self.tmpdir, modulename + suffix) + self.ext_package = ext_package + self._has_source = False + self._has_module = False + + def write_source(self, file=None): + """Write the C source code. It is produced in 'self.sourcefilename', + which can be tweaked beforehand.""" + with self.ffi._lock: + if self._has_source and file is None: + raise VerificationError( + "source code already written") + self._write_source(file) + + def compile_module(self): + """Write the C source code (if not done already) and compile it. + This produces a dynamic link library in 'self.modulefilename'.""" + with self.ffi._lock: + if self._has_module: + raise VerificationError("module already compiled") + if not self._has_source: + self._write_source() + self._compile_module() + + def load_library(self): + """Get a C module from this Verifier instance. + Returns an instance of a FFILibrary class that behaves like the + objects returned by ffi.dlopen(), but that delegates all + operations to the C module. If necessary, the C code is written + and compiled first. + """ + with self.ffi._lock: + if not self._has_module: + self._locate_module() + if not self._has_module: + if not self._has_source: + self._write_source() + self._compile_module() + return self._load_library() + + def get_module_name(self): + basename = os.path.basename(self.modulefilename) + # kill both the .so extension and the other .'s, as introduced + # by Python 3: 'basename.cpython-33m.so' + basename = basename.split('.', 1)[0] + # and the _d added in Python 2 debug builds --- but try to be + # conservative and not kill a legitimate _d + if basename.endswith('_d') and hasattr(sys, 'gettotalrefcount'): + basename = basename[:-2] + return basename + + def get_extension(self): + ffiplatform._hack_at_distutils() # backward compatibility hack + if not self._has_source: + with self.ffi._lock: + if not self._has_source: + self._write_source() + sourcename = ffiplatform.maybe_relative_path(self.sourcefilename) + modname = self.get_module_name() + return ffiplatform.get_extension(sourcename, modname, **self.kwds) + + def generates_python_module(self): + return self._vengine._gen_python_module + + def make_relative_to(self, kwds, relative_to): + if relative_to and os.path.dirname(relative_to): + dirname = os.path.dirname(relative_to) + kwds = kwds.copy() + for key in ffiplatform.LIST_OF_FILE_NAMES: + if key in kwds: + lst = kwds[key] + if not isinstance(lst, (list, tuple)): + raise TypeError("keyword '%s' should be a list or tuple" + % (key,)) + lst = [os.path.join(dirname, fn) for fn in lst] + kwds[key] = lst + return kwds + + # ---------- + + def _locate_module(self): + if not os.path.isfile(self.modulefilename): + if self.ext_package: + try: + pkg = __import__(self.ext_package, None, None, ['__doc__']) + except ImportError: + return # cannot import the package itself, give up + # (e.g. it might be called differently before installation) + path = pkg.__path__ + else: + path = None + filename = self._vengine.find_module(self.get_module_name(), path, + _get_so_suffixes()) + if filename is None: + return + self.modulefilename = filename + self._vengine.collect_types() + self._has_module = True + + def _write_source_to(self, file): + self._vengine._f = file + try: + self._vengine.write_source_to_f() + finally: + del self._vengine._f + + def _write_source(self, file=None): + if file is not None: + self._write_source_to(file) + else: + # Write our source file to an in memory file. + f = NativeIO() + self._write_source_to(f) + source_data = f.getvalue() + + # Determine if this matches the current file + if os.path.exists(self.sourcefilename): + with open(self.sourcefilename, "r") as fp: + needs_written = not (fp.read() == source_data) + else: + needs_written = True + + # Actually write the file out if it doesn't match + if needs_written: + _ensure_dir(self.sourcefilename) + with open(self.sourcefilename, "w") as fp: + fp.write(source_data) + + # Set this flag + self._has_source = True + + def _compile_module(self): + # compile this C source + tmpdir = os.path.dirname(self.sourcefilename) + outputfilename = ffiplatform.compile(tmpdir, self.get_extension()) + try: + same = ffiplatform.samefile(outputfilename, self.modulefilename) + except OSError: + same = False + if not same: + _ensure_dir(self.modulefilename) + shutil.move(outputfilename, self.modulefilename) + self._has_module = True + + def _load_library(self): + assert self._has_module + if self.flags is not None: + return self._vengine.load_library(self.flags) + else: + return self._vengine.load_library() + +# ____________________________________________________________ + +_FORCE_GENERIC_ENGINE = False # for tests + +def _locate_engine_class(ffi, force_generic_engine): + if _FORCE_GENERIC_ENGINE: + force_generic_engine = True + if not force_generic_engine: + if '__pypy__' in sys.builtin_module_names: + force_generic_engine = True + else: + try: + import _cffi_backend + except ImportError: + _cffi_backend = '?' + if ffi._backend is not _cffi_backend: + force_generic_engine = True + if force_generic_engine: + from . import vengine_gen + return vengine_gen.VGenericEngine + else: + from . import vengine_cpy + return vengine_cpy.VCPythonEngine + +# ____________________________________________________________ + +_TMPDIR = None + +def _caller_dir_pycache(): + if _TMPDIR: + return _TMPDIR + result = os.environ.get('CFFI_TMPDIR') + if result: + return result + filename = sys._getframe(2).f_code.co_filename + return os.path.abspath(os.path.join(os.path.dirname(filename), + '__pycache__')) + +def set_tmpdir(dirname): + """Set the temporary directory to use instead of __pycache__.""" + global _TMPDIR + _TMPDIR = dirname + +def cleanup_tmpdir(tmpdir=None, keep_so=False): + """Clean up the temporary directory by removing all files in it + called `_cffi_*.{c,so}` as well as the `build` subdirectory.""" + tmpdir = tmpdir or _caller_dir_pycache() + try: + filelist = os.listdir(tmpdir) + except OSError: + return + if keep_so: + suffix = '.c' # only remove .c files + else: + suffix = _get_so_suffixes()[0].lower() + for fn in filelist: + if fn.lower().startswith('_cffi_') and ( + fn.lower().endswith(suffix) or fn.lower().endswith('.c')): + try: + os.unlink(os.path.join(tmpdir, fn)) + except OSError: + pass + clean_dir = [os.path.join(tmpdir, 'build')] + for dir in clean_dir: + try: + for fn in os.listdir(dir): + fn = os.path.join(dir, fn) + if os.path.isdir(fn): + clean_dir.append(fn) + else: + os.unlink(fn) + except OSError: + pass + +def _get_so_suffixes(): + suffixes = _extension_suffixes() + if not suffixes: + # bah, no C_EXTENSION available. Occurs on pypy without cpyext + if sys.platform == 'win32': + suffixes = [".pyd"] + else: + suffixes = [".so"] + + return suffixes + +def _ensure_dir(filename): + dirname = os.path.dirname(filename) + if dirname and not os.path.isdir(dirname): + os.makedirs(dirname) diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent-1.4.0.dist-info/AUTHORS b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent-1.4.0.dist-info/AUTHORS new file mode 100644 index 00000000..05892fb7 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent-1.4.0.dist-info/AUTHORS @@ -0,0 +1,62 @@ +Gevent is written and maintained by + + Denis Bilenko + Matt Iversen + Steffen Prince + Jason Madden + +and the contributors (ordered by the date of first contribution): + + Jason Toffaletti + Mike Barton + Ludvig Ericson + Marcus Cavanaugh + Matt Goodall + Ralf Schmitt + Daniele Varrazzo + Nicholas Piël + Örjan Persson + Uriel Katz + Ted Suzman + Randall Leeds + Erik Näslund + Alexey Borzenkov + David Hain + Dmitry Chechik + Ned Rockson + Tommie Gannert + Shaun Lindsay + Andreas Blixt + Nick Barkas + Galfy Pundee + Alexander Boudkar + Damien Churchill + Tom Lynn + Shaun Cutts + David LaBissoniere + Alexandre Kandalintsev + Geert Jansen + Vitaly Kruglikov + Saúl Ibarra Corretgé + Oliver Beattie + Bobby Powers + Anton Patrushev + Jan-Philip Gehrcke + Alex Gaynor + 陈小玉 + Philip Conrad + Heungsub Lee + Ron Rothman + + See https://github.com/gevent/gevent/graphs/contributors for more info. + +Gevent is inspired by and uses some code from eventlet which was written by + + Bob Ipollito + Donovan Preston + +The win32util module is taken from Twisted. The tblib module is taken from python-tblib by Ionel Cristian Mărieș. + +Some modules (local, ssl) contain code from the Python standard library. + +If your code is used in gevent and you are not mentioned above, please contact the maintainer. diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent-1.4.0.dist-info/INSTALLER b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent-1.4.0.dist-info/INSTALLER new file mode 100644 index 00000000..a1b589e3 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent-1.4.0.dist-info/INSTALLER @@ -0,0 +1 @@ +pip diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent-1.4.0.dist-info/LICENSE b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent-1.4.0.dist-info/LICENSE new file mode 100644 index 00000000..b767c245 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent-1.4.0.dist-info/LICENSE @@ -0,0 +1,25 @@ +MIT License + +Except when otherwise stated (look at the beginning of each file) the software +and the documentation in this project are copyrighted by: + + Denis Bilenko and the contributors, http://www.gevent.org + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent-1.4.0.dist-info/METADATA b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent-1.4.0.dist-info/METADATA new file mode 100644 index 00000000..eca8738b --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent-1.4.0.dist-info/METADATA @@ -0,0 +1,367 @@ +Metadata-Version: 2.1 +Name: gevent +Version: 1.4.0 +Summary: Coroutine-based network library +Home-page: http://www.gevent.org/ +Author: Denis Bilenko +Author-email: denis.bilenko@gmail.com +Maintainer: Jason Madden +Maintainer-email: jason@nextthought.com +License: MIT +Project-URL: Bug Tracker, https://github.com/gevent/gevent/issues +Project-URL: Source Code, https://github.com/gevent/gevent/ +Project-URL: Documentation, http://www.gevent.org +Keywords: greenlet coroutine cooperative multitasking light threads monkey +Platform: UNKNOWN +Classifier: License :: OSI Approved :: MIT License +Classifier: Programming Language :: Python :: 2.7 +Classifier: Programming Language :: Python :: 3.4 +Classifier: Programming Language :: Python :: 3.5 +Classifier: Programming Language :: Python :: 3.6 +Classifier: Programming Language :: Python :: 3.7 +Classifier: Programming Language :: Python :: Implementation :: CPython +Classifier: Programming Language :: Python :: Implementation :: PyPy +Classifier: Operating System :: MacOS :: MacOS X +Classifier: Operating System :: POSIX +Classifier: Operating System :: Microsoft :: Windows +Classifier: Topic :: Internet +Classifier: Topic :: Software Development :: Libraries :: Python Modules +Classifier: Intended Audience :: Developers +Classifier: Development Status :: 4 - Beta +Requires-Python: >=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.* +Description-Content-Type: text/x-rst +Requires-Dist: greenlet (>=0.4.14) ; platform_python_implementation == "CPython" +Requires-Dist: cffi (>=1.11.5) ; sys_platform == "win32" and platform_python_implementation == "CPython" +Provides-Extra: dnspython +Requires-Dist: dnspython ; extra == 'dnspython' +Requires-Dist: idna ; extra == 'dnspython' +Provides-Extra: doc +Requires-Dist: repoze.sphinx.autointerface ; extra == 'doc' +Provides-Extra: events +Requires-Dist: zope.event ; extra == 'events' +Requires-Dist: zope.interface ; extra == 'events' +Provides-Extra: test +Requires-Dist: zope.interface ; extra == 'test' +Requires-Dist: zope.event ; extra == 'test' +Requires-Dist: requests ; extra == 'test' +Requires-Dist: objgraph ; extra == 'test' +Requires-Dist: psutil ; (platform_python_implementation == "CPython" or sys_platform != "win32") and extra == 'test' +Requires-Dist: futures ; (python_version == "2.7") and extra == 'test' +Requires-Dist: mock ; (python_version == "2.7") and extra == 'test' +Requires-Dist: coverage (>=5.0a3) ; (sys_platform != "win32") and extra == 'test' +Requires-Dist: coveralls (>=1.0) ; (sys_platform != "win32") and extra == 'test' + +======== + gevent +======== + +.. image:: https://travis-ci.org/gevent/gevent.svg?branch=master + :target: https://travis-ci.org/gevent/gevent + +.. image:: https://ci.appveyor.com/api/projects/status/q4kl21ng2yo2ixur?svg=true + :target: https://ci.appveyor.com/project/denik/gevent + +.. image:: https://coveralls.io/repos/gevent/gevent/badge.svg?branch=master&service=github + :target: https://coveralls.io/github/gevent/gevent?branch=master + +.. + This file is included in README.rst from the top-level + so it is limited to pure ReST markup, not Sphinx. + + + +gevent is a coroutine_ -based Python_ networking library that uses +`greenlet `_ to provide a high-level synchronous API on top of the `libev`_ +or `libuv`_ event loop. + +Features include: + + +* Fast event loop based on `libev`_ or `libuv`_. +* Lightweight execution units based on greenlets. +* API that re-uses concepts from the Python standard library (for + examples there are `events`_ and + `queues`_). +* `Cooperative sockets with SSL support `_ +* `Cooperative DNS queries `_ performed through a threadpool, + dnspython, or c-ares. +* `Monkey patching utility `_ to get 3rd party modules to become cooperative +* TCP/UDP/HTTP servers +* Subprocess support (through `gevent.subprocess`_) +* Thread pools + +gevent is `inspired by eventlet`_ but features a more consistent API, +simpler implementation and better performance. Read why others `use +gevent`_ and check out the list of the `open source projects based on +gevent`_. + +gevent was written by `Denis Bilenko `_. + +Since version 1.1, gevent is maintained by Jason Madden for +`NextThought `_ with help from the +`contributors `_ +and is licensed under the MIT license. + +See `what's new`_ in the latest major release. + +Check out the detailed changelog_ for this version. + +.. _events: http://www.gevent.org/api/gevent.event.html#gevent.event.Event +.. _queues: http://www.gevent.org/api/gevent.queue.html#gevent.queue.Queue +.. _gevent.subprocess: http://www.gevent.org/api/gevent.subprocess.html#module-gevent.subprocess + +.. _coroutine: https://en.wikipedia.org/wiki/Coroutine +.. _Python: http://python.org +.. _libev: http://software.schmorp.de/pkg/libev.html +.. _libuv: http://libuv.org +.. _inspired by eventlet: http://blog.gevent.org/2010/02/27/why-gevent/ +.. _use gevent: http://groups.google.com/group/gevent/browse_thread/thread/4de9703e5dca8271 +.. _open source projects based on gevent: https://github.com/gevent/gevent/wiki/Projects +.. _what's new: http://www.gevent.org/whatsnew_1_3.html +.. _changelog: http://www.gevent.org/changelog.html + + +Read the documentation online at http://www.gevent.org. + +Post feedback and issues on the `bug tracker`_, `mailing list`_, blog_ +and `twitter (@gevent)`_. + + +=============================== + Installation and Requirements +=============================== + +.. _installation: + +.. + This file is included in README.rst so it is limited to plain + ReST markup, not Sphinx. + +Supported Platforms +=================== + +`gevent 1.3`_ runs on Python 2.7 and Python 3. Releases 3.4, 3.5 and +3.6 of Python 3 are supported. (Users of older versions of Python 2 +need to install gevent 1.0.x (2.5), 1.1.x (2.6) or 1.2.x (<=2.7.8); +gevent 1.2 can be installed on Python 3.3.) gevent requires the +`greenlet `_ library and will install +the `cffi`_ library by default on Windows. + +gevent 1.3 also runs on PyPy 5.5 and above, although 5.9 or above is +strongly recommended. On PyPy, there are no external dependencies. + +gevent is tested on Windows, OS X, and Linux, and should run on most +other Unix-like operating systems (e.g., FreeBSD, Solaris, etc.) + +.. note:: On Windows using the libev backend, gevent is + limited to a maximum of 1024 open sockets due to + `limitations in libev`_. This limitation should not exist + with the default libuv backend. + +Installation +============ + +.. note:: + + This section is about installing released versions of gevent + as distributed on the `Python Package Index`_ + +.. _Python Package Index: http://pypi.org/project/gevent + +gevent and greenlet can both be installed with `pip`_, e.g., ``pip +install gevent``. Installation using `buildout +`_ is also supported. + +On Windows, OS X, and Linux, both gevent and greenlet are +distributed as binary `wheels`_. + +.. tip:: + + You need Pip 8.0 or later, or buildout 2.10.0 to install the + binary wheels. + +.. tip:: + + On Linux, you'll need to install gevent from source if you wish to + use the libuv loop implementation. This is because the `manylinux1 + `_ specification for the + distributed wheels does not support libuv. The `cffi`_ library + *must* be installed at build time. + + +Installing From Source +---------------------- + +If you are unable to use the binary wheels (for platforms where no +pre-built wheels are available or if wheel installation is disabled, +e.g., for libuv support on Linux), here are some things you need to know. + +- You can install gevent from source with ``pip install --no-binary + gevent gevent``. + +- You'll need a working C compiler that can build Python extensions. + On some platforms, you may need to install Python development + packages. + +- Installing from source requires ``setuptools``. This is installed + automatically in virtual environments and by buildout. However, + gevent uses :pep:`496` environment markers in ``setup.py``. + Consequently, you'll need a version of setuptools newer than 25 + (mid 2016) to install gevent from source; a version that's too old + will produce a ``ValueError``. Older versions of pipenv may also + `have issues installing gevent for this reason + `_. + +- To build the libuv backend (which is required on Windows and + optional elsewhere), or the CFFI-based libev backend, you must + install `cffi`_ before attempting to install gevent on CPython (on + PyPy this step is not necessary). + + +Common Installation Issues +-------------------------- + +The following are some common installation problems and solutions for +those compiling gevent from source. + +- Some Linux distributions are now mounting their temporary + directories with the ``noexec`` option. This can cause a standard + ``pip install gevent`` to fail with an error like ``cannot run C + compiled programs``. One fix is to mount the temporary directory + without that option. Another may be to use the ``--build`` option to + ``pip install`` to specify another directory. See `issue #570 + `_ and `issue #612 + `_ for examples. + +- Also check for conflicts with environment variables like ``CFLAGS``. For + example, see `Library Updates `_. + +- Users of a recent SmartOS release may need to customize the + ``CPPFLAGS`` (the environment variable containing the default + options for the C preprocessor) if they are using the libev shipped + with gevent. See `Operating Systems + `_ + for more information. + +- If you see ``ValueError: ("Expected ',' or end-of-list in", "cffi >= + 1.11.5 ; sys_platform == 'win32' and platform_python_implementation + == 'CPython'", 'at', " ; sys_platform == 'win32' and + platform_python_implementation == 'CPython'")``, the version of + setuptools is too old. Install a more recent version of setuptools. + + +Extra Dependencies +================== + +gevent has no runtime dependencies outside the standard library, +greenlet and (on some platforms) `cffi`_. However, there are a +number of additional libraries that extend gevent's functionality and +will be used if they are available. + +The `psutil `_ library is needed to +monitor memory usage. + +`zope.event `_ is highly +recommended for configurable event support; it can be installed with +the ``events`` extra, e.g., ``pip install gevent[events]``. + +`dnspython `_ is required for the +new pure-Python resolver, and on Python 2, so is `idna +`_. They can be installed with the +``dnspython`` extra. + + +Development +=========== + +To install the latest development version:: + + pip install setuptools cffi 'cython>=0.28' git+git://github.com/gevent/gevent.git#egg=gevent + +.. note:: + + You will not be able to run gevent's test suite using that method. + +To hack on gevent (using a virtualenv):: + + $ git clone https://github.com/gevent/gevent.git + $ cd gevent + $ virtualenv env + $ source env/bin/activate + (env) $ pip install -r dev-requirements.txt + +.. note:: + + The notes above about installing from source apply here as well. + The ``dev-requirements.txt`` file takes care of the library + prerequisites (CFFI, Cython), but having a working C compiler that + can create Python extensions is up to you. + + +Running Tests +------------- + +There are a few different ways to run the tests. To simply run the +tests on one version of Python during development, begin with the +above instructions to install gevent in a virtual environment and then +run:: + + (env) $ python -mgevent.tests + +Before submitting a pull request, it's a good idea to run the tests +across all supported versions of Python, and to check the code quality +using prospector. This is what is done on Travis CI. Locally it +can be done using tox:: + + pip install tox + tox + +The testrunner accepts a ``--coverage`` argument to enable code +coverage metrics through the `coverage.py`_ package. That would go +something like this:: + + python -m gevent.tests --coverage + coverage combine + coverage html -i + + +Continuous integration +---------------------- + +A test suite is run for every push and pull request submitted. Travis +CI is used to test on Linux, and `AppVeyor`_ runs the builds on +Windows. + +.. image:: https://travis-ci.org/gevent/gevent.svg?branch=master + :target: https://travis-ci.org/gevent/gevent + +.. image:: https://ci.appveyor.com/api/projects/status/q4kl21ng2yo2ixur?svg=true + :target: https://ci.appveyor.com/project/denik/gevent + + +Builds on Travis CI automatically submit updates to `coveralls.io`_ to +monitor test coverage. + +.. image:: https://coveralls.io/repos/gevent/gevent/badge.svg?branch=master&service=github + :target: https://coveralls.io/github/gevent/gevent?branch=master + +.. note:: On Debian, you will probably need ``libpythonX.Y-testsuite`` + installed to run all the tests. + +.. _coverage.py: https://pypi.python.org/pypi/coverage/ +.. _coveralls.io: https://coveralls.io/github/gevent/gevent +.. _`pip`: https://pip.pypa.io/en/stable/installing/ +.. _`wheels`: http://pythonwheels.com +.. _`gevent 1.3`: whatsnew_1_3.html + +.. _`cffi`: https://cffi.readthedocs.io +.. _`limitations in libev`: http://pod.tst.eu/http://cvs.schmorp.de/libev/ev.pod#WIN32_PLATFORM_LIMITATIONS_AND_WORKA +.. _AppVeyor: https://ci.appveyor.com/project/denik/gevent + + +.. _bug tracker: https://github.com/gevent/gevent/wiki/Projects +.. _mailing list: http://groups.google.com/group/gevent +.. _blog: http://blog.gevent.org +.. _twitter (@gevent): http://twitter.com/gevent + + diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent-1.4.0.dist-info/NOTICE b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent-1.4.0.dist-info/NOTICE new file mode 100644 index 00000000..83573c08 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent-1.4.0.dist-info/NOTICE @@ -0,0 +1,94 @@ +gevent is licensed under the MIT license. See the LICENSE file for the +complete license. + +Portions of this software may have other licenses. + +============================================= + +greentest/2.7 +greentest/2.7.8 +greentest/2.7pypy +greentest/3.3 +greentest/3.4 +greentest/3.5 +----------------- + +Copyright (c) 2001-2016 Python Software Foundation; All Rights Reserved + +PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2 +-------------------------------------------- + +1. This LICENSE AGREEMENT is between the Python Software Foundation +("PSF"), and the Individual or Organization ("Licensee") accessing and +otherwise using this software ("Python") in source or binary form and +its associated documentation. + +2. Subject to the terms and conditions of this License Agreement, PSF hereby +grants Licensee a nonexclusive, royalty-free, world-wide license to reproduce, +analyze, test, perform and/or display publicly, prepare derivative works, +distribute, and otherwise use Python alone or in any derivative version, +provided, however, that PSF's License Agreement and PSF's notice of copyright, +i.e., "Copyright (c) 2001-2016 Python Software Foundation; All Rights +Reserved" are retained in Python alone or in any derivative version prepared +by Licensee. + +3. In the event Licensee prepares a derivative work that is based on +or incorporates Python or any part thereof, and wants to make +the derivative work available to others as provided herein, then +Licensee hereby agrees to include in any such work a brief summary of +the changes made to Python. + +4. PSF is making Python available to Licensee on an "AS IS" +basis. PSF MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR +IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, PSF MAKES NO AND +DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS +FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON WILL NOT +INFRINGE ANY THIRD PARTY RIGHTS. + +5. PSF SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON +FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS +A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON, +OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF. + +6. This License Agreement will automatically terminate upon a material +breach of its terms and conditions. + +7. Nothing in this License Agreement shall be deemed to create any +relationship of agency, partnership, or joint venture between PSF and +Licensee. This License Agreement does not grant permission to use PSF +trademarks or trade name in a trademark sense to endorse or promote +products or services of Licensee, or any third party. + +8. By copying, installing or otherwise using Python, Licensee +agrees to be bound by the terms and conditions of this License +Agreement. + +============================================ + +gevent/libuv/_corecffi_source.c +gevent/libuv/_corecffi_cdef.c + +Originally based on code from https://github.com/veegee/guv + +Copyright (c) 2014 V G + + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. + +=========================================== diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent-1.4.0.dist-info/RECORD b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent-1.4.0.dist-info/RECORD new file mode 100644 index 00000000..360da137 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent-1.4.0.dist-info/RECORD @@ -0,0 +1,563 @@ +gevent-1.4.0.dist-info/AUTHORS,sha256=IS4ttuioANx5ucZqOXHiezC9ys2nkpxl1M_8f77Rleo,1303 +gevent-1.4.0.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4 +gevent-1.4.0.dist-info/LICENSE,sha256=TUa8EdGeOFPVQyWXO44sUwkPVjinvyf6H18SMseJAfc,1235 +gevent-1.4.0.dist-info/METADATA,sha256=sWhcP3zm6JeF0jrJNoZmE_WJ1tirRm_QGd9018zsewg,14012 +gevent-1.4.0.dist-info/NOTICE,sha256=ZJOCR8qaV_7kwRZWQEuTwxMCkYfhPaeHySe2xkpoBYM,4004 +gevent-1.4.0.dist-info/RECORD,, +gevent-1.4.0.dist-info/WHEEL,sha256=5cvWootWBSRa7expZAttvqZiGBlccnXzLfZShBiXXSk,102 +gevent-1.4.0.dist-info/entry_points.txt,sha256=j3Bs4dZY03xbORf-NbA6xkzNErzi1OVktpPF8rFrRQA,96 +gevent-1.4.0.dist-info/top_level.txt,sha256=fpElGiTe2fdw27vmNxdV5MQpyndjzWZMk5TB_NMYPSI,7 +gevent/__abstract_linkable.cp37-win32.pyd,sha256=LAlnYI_INjfCwxSXTdUCVFj7e8G9xnMgKc7TEo1R9Qo,59904 +gevent/__abstract_linkable.pxd,sha256=PVN1gd3tfa_yMOYZ7d-kjc1No2sz7Wie_IIgsx3-x_Q,1469 +gevent/__greenlet_primitives.cp37-win32.pyd,sha256=I7WI_R8dOMrKW2YkUxv3O279snaHeaE9FvhCgpkmPO0,47104 +gevent/__greenlet_primitives.pxd,sha256=GW2sdrRzeRtvjqQ7D-oay0BTQ7FEVt2Tt7KUn6KVjNU,1101 +gevent/__hub_local.cp37-win32.pyd,sha256=ekXxSNi16OUlMqpxvoILJVIW8B53zDNXbuCy03Tn5kc,43520 +gevent/__hub_local.pxd,sha256=DTX_cs_K3W_QZxRZnDkER897FMrBGB8DuBumW0HFQqk,522 +gevent/__hub_primitives.cp37-win32.pyd,sha256=ZQ2a2PLzVYX02V8wUDjLELR-3d6VU1k4r_d2LoMFrgk,103424 +gevent/__hub_primitives.pxd,sha256=jMZVuU8c5LDF5ACKmGYQgbZinRaf2cRxdYbUNFeoR8o,1972 +gevent/__ident.cp37-win32.pyd,sha256=B-hCbDozJ2mfqq0MNtkk9gZC9ieEzdiBIq642la0qYs,39424 +gevent/__ident.pxd,sha256=toMQT_XCLLeNB9rbjRHp5h9vdBHNbL5tplra0BUSiDQ,496 +gevent/__imap.cp37-win32.pyd,sha256=t2QX79aVwvxoE7TPa-McGvaMYaY0AomzZQaZod-VU4w,72192 +gevent/__imap.pxd,sha256=BIgNRMvjzrChq4PwAHnEOhOr5h-9Wte0s4USf7KPqsg,1103 +gevent/__init__.py,sha256=LmqW8f68068GxkaRliZHHpDt_Ox5kp6Em-HUQf90vl8,5245 +gevent/__pycache__/__init__.cpython-37.pyc,, +gevent/__pycache__/_abstract_linkable.cpython-37.pyc,, +gevent/__pycache__/_compat.cpython-37.pyc,, +gevent/__pycache__/_config.cpython-37.pyc,, +gevent/__pycache__/_fileobjectcommon.cpython-37.pyc,, +gevent/__pycache__/_fileobjectposix.cpython-37.pyc,, +gevent/__pycache__/_greenlet_primitives.cpython-37.pyc,, +gevent/__pycache__/_hub_local.cpython-37.pyc,, +gevent/__pycache__/_hub_primitives.cpython-37.pyc,, +gevent/__pycache__/_ident.cpython-37.pyc,, +gevent/__pycache__/_imap.cpython-37.pyc,, +gevent/__pycache__/_interfaces.cpython-37.pyc,, +gevent/__pycache__/_monitor.cpython-37.pyc,, +gevent/__pycache__/_patcher.cpython-37.pyc,, +gevent/__pycache__/_semaphore.cpython-37.pyc,, +gevent/__pycache__/_socket2.cpython-37.pyc,, +gevent/__pycache__/_socket3.cpython-37.pyc,, +gevent/__pycache__/_socketcommon.cpython-37.pyc,, +gevent/__pycache__/_ssl2.cpython-37.pyc,, +gevent/__pycache__/_ssl3.cpython-37.pyc,, +gevent/__pycache__/_sslgte279.cpython-37.pyc,, +gevent/__pycache__/_tblib.cpython-37.pyc,, +gevent/__pycache__/_threading.cpython-37.pyc,, +gevent/__pycache__/_tracer.cpython-37.pyc,, +gevent/__pycache__/_util.cpython-37.pyc,, +gevent/__pycache__/_util_py2.cpython-37.pyc,, +gevent/__pycache__/_waiter.cpython-37.pyc,, +gevent/__pycache__/ares.cpython-37.pyc,, +gevent/__pycache__/backdoor.cpython-37.pyc,, +gevent/__pycache__/baseserver.cpython-37.pyc,, +gevent/__pycache__/builtins.cpython-37.pyc,, +gevent/__pycache__/core.cpython-37.pyc,, +gevent/__pycache__/event.cpython-37.pyc,, +gevent/__pycache__/events.cpython-37.pyc,, +gevent/__pycache__/exceptions.cpython-37.pyc,, +gevent/__pycache__/fileobject.cpython-37.pyc,, +gevent/__pycache__/greenlet.cpython-37.pyc,, +gevent/__pycache__/hub.cpython-37.pyc,, +gevent/__pycache__/local.cpython-37.pyc,, +gevent/__pycache__/lock.cpython-37.pyc,, +gevent/__pycache__/monkey.cpython-37.pyc,, +gevent/__pycache__/os.cpython-37.pyc,, +gevent/__pycache__/pool.cpython-37.pyc,, +gevent/__pycache__/pywsgi.cpython-37.pyc,, +gevent/__pycache__/queue.cpython-37.pyc,, +gevent/__pycache__/resolver_ares.cpython-37.pyc,, +gevent/__pycache__/resolver_thread.cpython-37.pyc,, +gevent/__pycache__/select.cpython-37.pyc,, +gevent/__pycache__/server.cpython-37.pyc,, +gevent/__pycache__/signal.cpython-37.pyc,, +gevent/__pycache__/socket.cpython-37.pyc,, +gevent/__pycache__/ssl.cpython-37.pyc,, +gevent/__pycache__/subprocess.cpython-37.pyc,, +gevent/__pycache__/thread.cpython-37.pyc,, +gevent/__pycache__/threading.cpython-37.pyc,, +gevent/__pycache__/threadpool.cpython-37.pyc,, +gevent/__pycache__/time.cpython-37.pyc,, +gevent/__pycache__/timeout.cpython-37.pyc,, +gevent/__pycache__/util.cpython-37.pyc,, +gevent/__pycache__/win32util.cpython-37.pyc,, +gevent/__semaphore.cp37-win32.pyd,sha256=4GqduzGpcRfjgAT-LgftRa1nG8q4lqRazFUtgTAJrak,66048 +gevent/__semaphore.pxd,sha256=h600zR6GZTPXMYxpMmNeL4gd01mlraW10yZf2Clt8RU,665 +gevent/__tracer.cp37-win32.pyd,sha256=84PAc8NV1zlRTFrb01y8bbaXLYPsOIbQ8gQ_TTIz2_4,73728 +gevent/__tracer.pxd,sha256=m7uZ-bUN4D8Av_NE9xUJfRkiCnu5BGZ4RjNJvHHosHo,884 +gevent/__waiter.cp37-win32.pyd,sha256=IHvAU2KBf8aGaJI66dd2EosyJeO_2lCMlqseMjDYulk,64000 +gevent/__waiter.pxd,sha256=oYVauEKGS6MFNVNjsp5H_sxHEjqBc_ha2oEbE7d9DcE,1129 +gevent/_abstract_linkable.c,sha256=uqEpUaCamxodFMprktiwhx9iEdoL3X_BVEp84OQ-NUU,345981 +gevent/_abstract_linkable.html,sha256=JR0imfGj_tZKKy8rfuWjDLtOY-oqZo8DbCxP-yIsZY8,169474 +gevent/_abstract_linkable.py,sha256=jWNoSAdXtnRlJhodxFP-wvOoV9RmMQHkrUtuSaPPbaI,8416 +gevent/_compat.py,sha256=W8P-VbE5JgGUtUc9eOAKleDFBdi_IBWIEQySgeZDVX4,5028 +gevent/_config.py,sha256=zFnJyoiW39i97TavK9U5fvxPO3O6n3B2MBP1bv0Z8dc,20240 +gevent/_event.cp37-win32.pyd,sha256=vms6MGIlBeo3KqgIBqQ4t1Gk-WqqtUk2xDXz5EYqt90,88064 +gevent/_event.pxd,sha256=-jkoHbYbLcvKC1FBwgOady2vUrSofRhHVMASlhs-oKg,628 +gevent/_ffi/__init__.py,sha256=BTBgjjvO4ecQBPbReBhem-0zvy1Mq6jXf5dMrykGIhs,493 +gevent/_ffi/__pycache__/__init__.cpython-37.pyc,, +gevent/_ffi/__pycache__/callback.cpython-37.pyc,, +gevent/_ffi/__pycache__/loop.cpython-37.pyc,, +gevent/_ffi/__pycache__/watcher.cpython-37.pyc,, +gevent/_ffi/callback.py,sha256=XR8Nll5CiX4QKDwflPLpWj1-BaUGcwka0QvO3qqpN8s,1651 +gevent/_ffi/loop.py,sha256=Yjl9FKSl1eXfFsCi5xrlxKUwIfUKIDbFuRvo_9E1ErI,28728 +gevent/_ffi/watcher.py,sha256=BUIJ-bzOgfAqvL8nVmd5x_jQ_X7t79mHe0BgEHRW3ys,20551 +gevent/_fileobjectcommon.py,sha256=KDySdmDpBDsMUmBe-LAtbep_GBhpfpWk3pSX5WC1U5s,9652 +gevent/_fileobjectposix.py,sha256=Q3HFvNsn2Snqo2QSDz1RTlEjWQBLbwGjlxSKO0k0Fk0,13796 +gevent/_greenlet.cp37-win32.pyd,sha256=fQ-1EtOJsgIKDAhwfvhzFwsnMINiTA21HjozSOFmIws,191488 +gevent/_greenlet.pxd,sha256=IWVlcZLwVDLykNwnEf6wSQFWp8PfpOld53AytbiTcrg,4375 +gevent/_greenlet_primitives.c,sha256=6h1iAjjXOQ1OtjztyfKTF3EhaSQ6R3LAc2sV7lRgTZI,263097 +gevent/_greenlet_primitives.html,sha256=7Z5Uk-xSe3yP0a8nY6_eWFyH7JHirqLEKi4IIaatPUw,92705 +gevent/_greenlet_primitives.py,sha256=DeeZeRb_FSMKcKamkUrH4TXsDHCBeoFI0ic4_LLI7Sg,3259 +gevent/_hub_local.c,sha256=tO2t0f6iQZz6fqi-whm4eOIpIVJQq63jizh9at3e1yA,227773 +gevent/_hub_local.html,sha256=VCIfCDQqrH6YkgDZ5ZT1Rlqo6ynmiYaPEFVPS6qW814,83545 +gevent/_hub_local.py,sha256=lECCOC5_CeP7Jby4zj1Lebm5SUbRhaQJMytNe_zI8_k,2739 +gevent/_hub_primitives.c,sha256=5guinh-mdlZChsI0UJrPjuV18WuYGUOvz1OJBcs4d-U,528532 +gevent/_hub_primitives.html,sha256=9GOjtOWJIpHCgztA_xupnzjCTloYUkY8grYbtc97FT0,373917 +gevent/_hub_primitives.py,sha256=1IWA3lkQNZSkot8OsqQCwSB4cNeM2ytif3FPZyyHYTE,12946 +gevent/_ident.c,sha256=F3RYBX5_aVUnJ6VJL8FQFGMMysk6HKOD18gwpTVbA6Q,213241 +gevent/_ident.html,sha256=Qg9DeQVa4yxhw3FjxtXnRiI2dfCYYmsjhvr8MLsj3EQ,61604 +gevent/_ident.py,sha256=eyA7pXNr3saDDZwJfXjn8U69wS2iWbrJcGjcAEcEbDk,2245 +gevent/_imap.c,sha256=fVCHuTGHxrO1396K62eeP_nvwOHxF0ccS_gTkHpc9AI,421402 +gevent/_imap.html,sha256=0fGaZ42tSbEGFx5jIcnbB_s_6WtKZpQ1M_8zdP4MYI4,165842 +gevent/_imap.py,sha256=RubqWMTHdK4vLPzLY4vptCnbNfsfLRi9_uNy9Fw-XLM,7710 +gevent/_interfaces.py,sha256=0MwiLJ_mI-fN6HewTmgljM93Q9GJSx02f5Pf4BUCb8w,6983 +gevent/_local.cp37-win32.pyd,sha256=06YgQSzV1rTDBPIsFmYeM1Jw1hzBXmvdXNdu0Au8SdU,107008 +gevent/_local.pxd,sha256=NImltr7cRrnk-7zRZ2lXUigD3v4xOSqZWz0kd2F2BoU,2792 +gevent/_monitor.py,sha256=ArTvznAbobIICMOuV55T5Kbs2U0LBI6tjeOPcS07xRs,11901 +gevent/_patcher.py,sha256=-KdbfhqMLEG3PDBrqIXuYYZWPWanseOgGiARIPX8-qY,4118 +gevent/_queue.cp37-win32.pyd,sha256=C8GMdDKCtywDagMBfYeckl0veiw9ZZV1z2PhfX3wA1s,173056 +gevent/_queue.pxd,sha256=qBieZQPOfYWbiu3FIWF1nqCP8tLe-y4zrxtNtwLKjY8,1391 +gevent/_semaphore.c,sha256=vzZJYV-Hh2Ec5_Qu7Ge96shpJ-QXtJD4-DDz8B0fTPE,349794 +gevent/_semaphore.html,sha256=1-PupnHnpQlJaRByqOIuhEI6W98Hp7H1wXllfwqQPks,172337 +gevent/_semaphore.py,sha256=5M9rHCYEnU-9Bi4DZyDvQCNtp_BVm15P0h-61qbes-I,6686 +gevent/_socket2.py,sha256=FXl1CyVXG0CWI1xrcfrigtwv9VYo3ReTIlWhW4cy2Jg,16534 +gevent/_socket3.py,sha256=9V2yjAIcICi0lxyfdQ6GtLEZ0I8Ne45AGBlG6_AtxwY,28893 +gevent/_socketcommon.py,sha256=tD3JqqWor88DYbceWzXrdQDX_8hz4kpGaSvQqV_UX7w,13454 +gevent/_ssl2.py,sha256=EnUQAc8ouigaMJAJVuO0FE9xmYjrtLf2NhNGB9dqX30,16951 +gevent/_ssl3.py,sha256=cZUs3JiTzPMBuRq0cMuPfWctbGharkbJL8Il2criV60,27103 +gevent/_sslgte279.py,sha256=UMNcclu1pKHcKKDwAB-B8Vctd42oxRAccrN2xcJ12V0,27490 +gevent/_tblib.py,sha256=ce8x51beuHDdXob1LvvqW7XSNS0q1rsuXtKzkuBL83Q,13246 +gevent/_threading.py,sha256=Ah9cozibYKrfdzTyh30qNGdhyKpoHywLbgFZeM6Nyo0,5291 +gevent/_tracer.c,sha256=iHHu6XRjWY_MenUsIBL5G80_eD_ibVYO59cXTCCFkKU,404267 +gevent/_tracer.html,sha256=ahBikt-K41EvjRW7dB1Y7lmQITROOWtGmAY29ew_0bw,229792 +gevent/_tracer.py,sha256=EdNhOERSRYk21We8C6LdgD02m_rvI45QOYAJXPZwMmE,6235 +gevent/_util.py,sha256=aOapAAnsrl1NqBOAkRRpwYZxu0QorXCVPGuW7L2cu1A,5035 +gevent/_util_py2.py,sha256=og4n5HlSiFY6-NWoZiOJfQ3r47wMn3PgFiONHGPLAyA,506 +gevent/_waiter.c,sha256=wavFMBpoFzalUdusiYuELaCXa-AbGk3PmWQgc9nCXVM,354890 +gevent/_waiter.html,sha256=aHjAH9jAKMcjKyGwAx2lFMVy4TOyvT68ebtXAER9Yi4,172037 +gevent/_waiter.py,sha256=2Wr2da5g49-IJtPI-TWy7Di1RhMHhmkE0QDERVPNo1g,7265 +gevent/ares.py,sha256=KJvKlPIqupEi51HaVx0Yli4HU97IhtFSN4cgIKJKLh4,336 +gevent/backdoor.py,sha256=-mXkfGChbQnC-vdPKBwzT937KcGzYPDh0rlKoe9u_B8,7123 +gevent/baseserver.py,sha256=yWX_FckWVfm3Go-O_xaDUw33ajqUXnAtfTWZ0UymEm4,15389 +gevent/builtins.py,sha256=H6T0k0yufU6qsnOZAQpXjQBwXF6L2-FdWK-c36IZocU,4718 +gevent/core.py,sha256=XgaVreHocvO9JCVby3JCo8ixbllJL08V9OrA7ETDaHs,479 +gevent/event.c,sha256=o_fa8VvtKFZzDqksDV-bhCGQcRDoCvmnw40Iy_HD6Fw,453770 +gevent/event.html,sha256=5DUg00J20K9LTGr01BWzhtZGEijY5-q82Wf5L8xe8i8,283514 +gevent/event.py,sha256=ptwIV0ogu8Yew2v-F115uSdLp-Te04yCFCulKLaoeFU,13571 +gevent/events.py,sha256=YTVY_G_ORI9VFcls-whRvr3GpsYKCpwVWxnPzt2YFVA,15611 +gevent/exceptions.py,sha256=KDmYwbSQjtMbl-wwyIsIQRGLBK20HdTdKpFrGPau2Vw,2093 +gevent/fileobject.py,sha256=gM2GT14akHsWCbIlCDonc9gi2Tq3tjffn4uVjWGccto,1892 +gevent/greenlet.c,sha256=VmpHOoDNLzzYaBNC6sxjqqzjtaift1JVSyOJNNR1Ggg,1023793 +gevent/greenlet.html,sha256=Jfuvo9GryoJcxfFfop36hBX5xDtz1fYMOqZTFBmbJn8,800938 +gevent/greenlet.py,sha256=1X2Mn6cxp62smf59S5z7RD4iMOOJn38t4SP7zxZNhDI,36559 +gevent/hub.py,sha256=OXjVswgRyrOooy83jz_y_hnYhcoCLwr_rzR61uABWYQ,27333 +gevent/libev/__init__.py,sha256=I6hpYFJCnbBBDrousKzZ7Ql--mnfAFwfM2q1BuxcMfI,169 +gevent/libev/__pycache__/__init__.cpython-37.pyc,, +gevent/libev/__pycache__/_corecffi_build.cpython-37.pyc,, +gevent/libev/__pycache__/corecffi.cpython-37.pyc,, +gevent/libev/__pycache__/watcher.cpython-37.pyc,, +gevent/libev/_corecffi_build.py,sha256=dvd3DMajYmV6vPHHfKbMV3s7rolGWOHaqf7nSDdyfL0,2374 +gevent/libev/_corecffi_cdef.c,sha256=l9-BecMsvpKaPDerD8zWtjPIhbg9LDszf2m4X0BXZS0,6679 +gevent/libev/_corecffi_source.c,sha256=xYFjS9IxF8RQKpS9HG6A1xMB7XPFO16sbcs6Fv5MPXk,2078 +gevent/libev/callbacks.c,sha256=_6gnWL5t0__7FuzMdQq2otP8Z6ammfE31MzwvlE7ZpQ,5983 +gevent/libev/callbacks.h,sha256=WTsA3IguzFiDUb9EQi3qQewg9goN4azoeQdb3m0LgVs,1029 +gevent/libev/corecext.c,sha256=fC0AI_uZXcq-gQAjgXA0x4gfb0OnyK-_hnvE1lB2lXg,951856 +gevent/libev/corecext.cp37-win32.pyd,sha256=Fx9ovIGXVGxpQUZjId8RYMkerExu2UTrF5PAkHTj7T4,217600 +gevent/libev/corecext.h,sha256=KLlGMFw9sgLonvmJdDJxnFGEock2E9Tx5M0JWxvJslw,4018 +gevent/libev/corecext.html,sha256=PSSE94dGxO-MFSILAIibbo4b39gtOu_z0HzXrYLl2vE,1037242 +gevent/libev/corecext.pyx,sha256=dUmw0dF4aLTQpz5ujw-tvgx3mytiWK5UDLlRo60CNp0,44499 +gevent/libev/corecffi.py,sha256=LqFjBgQngupsRdva06hXkUy7hf4k8GG9g3DJJHEaemg,11915 +gevent/libev/libev.h,sha256=H_4mpixGJB1kyFg2uG_e5hNkYWCbc4b5AbCKyLY-llc,2800 +gevent/libev/libev.pxd,sha256=3Nw5UjV2MQS5SrwejGzyHExqWBQ_8CkKDflVUL3D_mc,5891 +gevent/libev/libev_vfd.h,sha256=ud1OzvgVJdl_EzGPp9w2Ljs0wYKOm4a5c7IIeZ-bK0s,5825 +gevent/libev/stathelper.c,sha256=kHXlvNryG-6NnAmFRS0owynyAtWjHQ3qhyp3gcdgA2s,5017 +gevent/libev/watcher.py,sha256=7y07l7ilDyDTgyUJg-q2fhSYmImox11CTd0GCu1B7QA,7926 +gevent/libuv/__init__.py,sha256=I6hpYFJCnbBBDrousKzZ7Ql--mnfAFwfM2q1BuxcMfI,169 +gevent/libuv/__pycache__/__init__.cpython-37.pyc,, +gevent/libuv/__pycache__/_corecffi_build.cpython-37.pyc,, +gevent/libuv/__pycache__/loop.cpython-37.pyc,, +gevent/libuv/__pycache__/watcher.cpython-37.pyc,, +gevent/libuv/_corecffi.cp37-win32.pyd,sha256=CRGnxMPUmYRZCHLYCfRFboI_tpglKcsaKvW_LptnlY4,128000 +gevent/libuv/_corecffi_build.py,sha256=2Z1xENB2jMkloYR1IahcR_gee5fq-jNxPb0lKDSMSko,8787 +gevent/libuv/_corecffi_cdef.c,sha256=Cg5viD68beoK4cEmA_ZNODv03rssb42Nl0PawNBNOyM,12922 +gevent/libuv/_corecffi_source.c,sha256=oy2RQKKWqCjpI3_rha_0T-vrr77-KBm79KpJawSpGNE,5795 +gevent/libuv/loop.py,sha256=c821BlJTXO6kJgUcSTjyQpvCEV14w22x1wMvnhAaaIM,23684 +gevent/libuv/watcher.py,sha256=1W4t-wrhwifBqLGwhabOkI4yNGsl3yf48ZJckJPemuo,26791 +gevent/local.c,sha256=Bf-NUM8iptXj1UKHRG7VkKeZq6ugmO3ZBabZfNSWctY,560357 +gevent/local.html,sha256=HpcSYyrazt9WjiKwHd8Qut8Y3RA4Lh2n88_y1JweV1Y,340512 +gevent/local.py,sha256=eQbEf5OCApOGLsWA2IMfxAN5fudLxSzn-5X8kTBGy6w,20617 +gevent/lock.py,sha256=Taq0qWkFjz554UhzZEmlP5ifedan3DuLCWJxn6ZGn1s,8082 +gevent/monkey.py,sha256=Ngjo5ZvSSHW3ys5zNPDi-aZ_FV4zfW6RtzAWcObDDE4,40683 +gevent/os.py,sha256=_1YwH4wyx3omsyfI7bzlXypIHdbTiXhKbDQc8MLEi9M,19554 +gevent/pool.py,sha256=zTnB7IM4Wa-SDq5G2DkaJ5GZZXunN1sVJk2_ijOqDl8,25584 +gevent/pywsgi.py,sha256=-Aya6QNUfwcf0Y0CIoLOqwvrAALwwoRa_k-jymfHCyk,60568 +gevent/queue.c,sha256=ZLmAuM-ZgyiKNczRfHIoI4haH-RepUz3Hbj642p8BcA,915680 +gevent/queue.html,sha256=ZXfdFLRrNpYraLzNu3xVXnpXUOghcX86cxB0BUHutlE,725133 +gevent/queue.py,sha256=JbvQulA3dhdB26ciX6PrppJMi_RoxSeN8Maf6BckloI,22806 +gevent/resolver/__init__.py,sha256=opqBGkhgE-Q7ex5wq2UKUL-XTSF6kCSeHHPes-Z-8GY,3690 +gevent/resolver/__pycache__/__init__.cpython-37.pyc,, +gevent/resolver/__pycache__/ares.cpython-37.pyc,, +gevent/resolver/__pycache__/blocking.cpython-37.pyc,, +gevent/resolver/__pycache__/dnspython.cpython-37.pyc,, +gevent/resolver/__pycache__/thread.cpython-37.pyc,, +gevent/resolver/ares.py,sha256=EHMPHZmmrq3VsTWck3OLA07AidtieN1RUucEz89yg8s,13829 +gevent/resolver/blocking.py,sha256=5ubBMewB7X-JouMKIlf_s2JNw4KJ_EqmNVUg4PrrSaA,1216 +gevent/resolver/cares.c,sha256=_csBn7Mqn5QCUbLbwOems5Dr0OzHqlTG733_AS4pjJQ,618987 +gevent/resolver/cares.cp37-win32.pyd,sha256=Z9c2YfHdmQZUOdrC3oZFX2gcmRVLOC-4_yN0-bh4PKc,154624 +gevent/resolver/cares.html,sha256=ZgWXkxq8XsTaBRM_R-Of66-KyGrEt1XGKWzKEs0XlGY,461050 +gevent/resolver/cares.pyx,sha256=G581qVmtMs5fNOS25Ue2U-Y8xqpVxiMO_4SqcEZakHg,16578 +gevent/resolver/cares_ntop.h,sha256=-YEPNUD3Ibx3hv6_II1iQ-nVOVsxbcG4gBLrnjTaUyI,148 +gevent/resolver/cares_pton.h,sha256=nfvWc----WPHJSyMHtAsB6yJWStxg2YdYwQMNDQMcuw,217 +gevent/resolver/dnshelper.c,sha256=wruRYzUEK9NK3txHOVeKbjBtTeMTgDhTEGRcRzOoRmY,4033 +gevent/resolver/dnspython.py,sha256=TpXTzmAZAlc6IpXUqv8VK9HfFB98vtINtOZUc8CUqOs,25168 +gevent/resolver/libcares.pxd,sha256=rwX-IiuFFBUEq2ESZ7GIEwqWDjZx7PfXSfupwOOVcAc,2770 +gevent/resolver/thread.py,sha256=lNlqGlEZfL0SViJx6Ow_S7EL1CNcUGcvWDuYyxLAR2o,2493 +gevent/resolver_ares.py,sha256=s5Jo9Z0b-zKxSWcIvW5onaFE2OrfqLuNnTPlOoxFxEQ,486 +gevent/resolver_thread.py,sha256=jcKcEVCXwyRqcsDUZmryQ9hc-83yztgaM4kuTKHOvaw,504 +gevent/select.py,sha256=x8nHoAV_2i5Poi-MTWMJZxYMouXDNUr4iWfs47P-uKs,10187 +gevent/server.py,sha256=xOgzEEle5wJ4yTfB5U-kYkRiH9B6nx20S8DCG_Nt-f0,9591 +gevent/signal.py,sha256=7uu4a7v0kGyOqauqqdtZxAVQy8IrdjWHKM6SpqAvhko,4915 +gevent/socket.py,sha256=xz-ntpsujqpXQ14lLyAnGOlW7679Quisw-r9m8HZWqQ,4870 +gevent/ssl.py,sha256=N5qr4kd8jXmKfxYOqiPBAFRV4n9FZiZHgDFetHIbc_k,1200 +gevent/subprocess.py,sha256=Bo8CCTwRJ2d08r2mmHn0IseEHMlFScZ-pJ9zyqUp8kc,68291 +gevent/testing/__init__.py,sha256=hkVMAVkgmlsjJGUlTIuAPayGGd81kpFy5LvoQ8PdqCI,3976 +gevent/testing/__pycache__/__init__.cpython-37.pyc,, +gevent/testing/__pycache__/errorhandler.cpython-37.pyc,, +gevent/testing/__pycache__/exception.cpython-37.pyc,, +gevent/testing/__pycache__/flaky.cpython-37.pyc,, +gevent/testing/__pycache__/hub.cpython-37.pyc,, +gevent/testing/__pycache__/leakcheck.cpython-37.pyc,, +gevent/testing/__pycache__/modules.cpython-37.pyc,, +gevent/testing/__pycache__/monkey_test.cpython-37.pyc,, +gevent/testing/__pycache__/openfiles.cpython-37.pyc,, +gevent/testing/__pycache__/params.cpython-37.pyc,, +gevent/testing/__pycache__/patched_tests_setup.cpython-37.pyc,, +gevent/testing/__pycache__/six.cpython-37.pyc,, +gevent/testing/__pycache__/skipping.cpython-37.pyc,, +gevent/testing/__pycache__/sockets.cpython-37.pyc,, +gevent/testing/__pycache__/switching.cpython-37.pyc,, +gevent/testing/__pycache__/sysinfo.cpython-37.pyc,, +gevent/testing/__pycache__/testcase.cpython-37.pyc,, +gevent/testing/__pycache__/testrunner.cpython-37.pyc,, +gevent/testing/__pycache__/timing.cpython-37.pyc,, +gevent/testing/__pycache__/util.cpython-37.pyc,, +gevent/testing/coveragesite/__pycache__/sitecustomize.cpython-37.pyc,, +gevent/testing/coveragesite/sitecustomize.py,sha256=GSOkHhxLE_pjOHuUn4InKmmuLyIGSIumySFVVSmc4Vo,558 +gevent/testing/errorhandler.py,sha256=0S16ylXH_epEJBV9jZ4Ukd8-zlFdeb0FCv8eJyo0g8Q,2015 +gevent/testing/exception.py,sha256=yQHF9Ebom2JAKUq70mLsdFk9p4eorpK36O-3iH1LL1Q,1265 +gevent/testing/flaky.py,sha256=x-IujIZGK_m2FYRyi4RxKMZhLfxq25p47En4DAlYhCs,4104 +gevent/testing/hub.py,sha256=tH0vKcSW_C5vqcPr4cdf-ucKQ5YjcP4kHFG8T1VDfSc,1568 +gevent/testing/leakcheck.py,sha256=CyxY7HiZW_kxpVgztdX_hYIZhgrAwMxTm-7xlt_nwNo,7013 +gevent/testing/modules.py,sha256=YszQZAglfns-HabYDWmFjoDRX5Oxhh67DRaMU4z5gQY,3182 +gevent/testing/monkey_test.py,sha256=QFHQgmxlTE8RVzakU4QZ5yaaamYrvCLAGKO1leNM_Fw,2432 +gevent/testing/openfiles.py,sha256=TYorMzGRNQD4lznfDU0NNyxiEMsF_h6t5CqKO9DApU0,4869 +gevent/testing/params.py,sha256=NP8muVgzgVrC9wudC7gQTYTJpllKG3GQVpQI-UL-iig,3033 +gevent/testing/patched_tests_setup.py,sha256=TwxLVQBaLT8OekKkaQrY5KpIm3AFMY3eBG9vNJTu_zk,49460 +gevent/testing/six.py,sha256=uOHGN3XiRVQViBTFgaTac8nBy5azRODOFWvkcQVbtdA,1004 +gevent/testing/skipping.py,sha256=R1EzxSRTnOaKlr7jBaVxue5v0CnCTmTuHBh-NHwIVl0,3668 +gevent/testing/sockets.py,sha256=dMxbn7khWbBWqDwjEZithklFCK2yphiwgJOliYZvxRI,1914 +gevent/testing/switching.py,sha256=6idIaCiHKFZF8aibeHjxIdZi38cxXCKuhQRHUT1YWoo,2708 +gevent/testing/sysinfo.py,sha256=0LOpveTMOw2mv3cLQwLXRTpaAQ4jEXrpFA3O9s_oPWQ,4184 +gevent/testing/testcase.py,sha256=0GJFaSjK1Pr-QZn5M9q5SdFP1MXzlQ70v751N46ZNOY,12783 +gevent/testing/testrunner.py,sha256=hEG_r9VXTlxqgkB91PMHpC1u5s1ppzOmSrrIrFXl3nE,16385 +gevent/testing/timing.py,sha256=mhsdL-_Q0UMQyVjrIQGNlHphaw0Z_TBrB5hvzRUyxxk,4949 +gevent/testing/util.py,sha256=CehaaTcFyUUyJbDK5Rqs8hcn1lGfwF7C7Ep7xB8TbSg,12915 +gevent/tests/2_7_keycert.pem,sha256=xPXi5idPcQVbrhgxBqF2TNGm6sSZ2aLVVEt6DWzplL8,1783 +gevent/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +gevent/tests/__main__.py,sha256=EMw-OppCjl-heu15mLg-cf400NS1Ikuy96OisvLoKLM,179 +gevent/tests/__pycache__/__init__.cpython-37.pyc,, +gevent/tests/__pycache__/__main__.cpython-37.pyc,, +gevent/tests/__pycache__/_blocks_at_top_level.cpython-37.pyc,, +gevent/tests/__pycache__/_import_import_patch.cpython-37.pyc,, +gevent/tests/__pycache__/_import_patch.cpython-37.pyc,, +gevent/tests/__pycache__/_import_wait.cpython-37.pyc,, +gevent/tests/__pycache__/_imports_at_top_level.cpython-37.pyc,, +gevent/tests/__pycache__/_imports_imports_at_top_level.cpython-37.pyc,, +gevent/tests/__pycache__/getaddrinfo_module.cpython-37.pyc,, +gevent/tests/__pycache__/known_failures.cpython-37.pyc,, +gevent/tests/__pycache__/lock_tests.cpython-37.pyc,, +gevent/tests/__pycache__/test__GreenletExit.cpython-37.pyc,, +gevent/tests/__pycache__/test___config.cpython-37.pyc,, +gevent/tests/__pycache__/test___example_servers.cpython-37.pyc,, +gevent/tests/__pycache__/test___ident.cpython-37.pyc,, +gevent/tests/__pycache__/test___monitor.cpython-37.pyc,, +gevent/tests/__pycache__/test___monkey_patching.cpython-37.pyc,, +gevent/tests/__pycache__/test__all__.cpython-37.pyc,, +gevent/tests/__pycache__/test__api.cpython-37.pyc,, +gevent/tests/__pycache__/test__api_timeout.cpython-37.pyc,, +gevent/tests/__pycache__/test__ares_host_result.cpython-37.pyc,, +gevent/tests/__pycache__/test__ares_timeout.cpython-37.pyc,, +gevent/tests/__pycache__/test__backdoor.cpython-37.pyc,, +gevent/tests/__pycache__/test__close_backend_fd.cpython-37.pyc,, +gevent/tests/__pycache__/test__compat.cpython-37.pyc,, +gevent/tests/__pycache__/test__core.cpython-37.pyc,, +gevent/tests/__pycache__/test__core_async.cpython-37.pyc,, +gevent/tests/__pycache__/test__core_callback.cpython-37.pyc,, +gevent/tests/__pycache__/test__core_fork.cpython-37.pyc,, +gevent/tests/__pycache__/test__core_loop_run.cpython-37.pyc,, +gevent/tests/__pycache__/test__core_loop_run_sig_mod.cpython-37.pyc,, +gevent/tests/__pycache__/test__core_stat.cpython-37.pyc,, +gevent/tests/__pycache__/test__core_timer.cpython-37.pyc,, +gevent/tests/__pycache__/test__core_watcher.cpython-37.pyc,, +gevent/tests/__pycache__/test__destroy.cpython-37.pyc,, +gevent/tests/__pycache__/test__destroy_default_loop.cpython-37.pyc,, +gevent/tests/__pycache__/test__doctests.cpython-37.pyc,, +gevent/tests/__pycache__/test__environ.cpython-37.pyc,, +gevent/tests/__pycache__/test__event.cpython-37.pyc,, +gevent/tests/__pycache__/test__events.cpython-37.pyc,, +gevent/tests/__pycache__/test__example_echoserver.cpython-37.pyc,, +gevent/tests/__pycache__/test__example_portforwarder.cpython-37.pyc,, +gevent/tests/__pycache__/test__example_udp_client.cpython-37.pyc,, +gevent/tests/__pycache__/test__example_udp_server.cpython-37.pyc,, +gevent/tests/__pycache__/test__examples.cpython-37.pyc,, +gevent/tests/__pycache__/test__exc_info.cpython-37.pyc,, +gevent/tests/__pycache__/test__execmodules.cpython-37.pyc,, +gevent/tests/__pycache__/test__fileobject.cpython-37.pyc,, +gevent/tests/__pycache__/test__getaddrinfo_import.cpython-37.pyc,, +gevent/tests/__pycache__/test__greenio.cpython-37.pyc,, +gevent/tests/__pycache__/test__greenlet.cpython-37.pyc,, +gevent/tests/__pycache__/test__greenletset.cpython-37.pyc,, +gevent/tests/__pycache__/test__greenness.cpython-37.pyc,, +gevent/tests/__pycache__/test__hub.cpython-37.pyc,, +gevent/tests/__pycache__/test__hub_join.cpython-37.pyc,, +gevent/tests/__pycache__/test__hub_join_timeout.cpython-37.pyc,, +gevent/tests/__pycache__/test__import_blocking_in_greenlet.cpython-37.pyc,, +gevent/tests/__pycache__/test__import_wait.cpython-37.pyc,, +gevent/tests/__pycache__/test__issue112.cpython-37.pyc,, +gevent/tests/__pycache__/test__issue230.cpython-37.pyc,, +gevent/tests/__pycache__/test__issue330.cpython-37.pyc,, +gevent/tests/__pycache__/test__issue467.cpython-37.pyc,, +gevent/tests/__pycache__/test__issue6.cpython-37.pyc,, +gevent/tests/__pycache__/test__issue600.cpython-37.pyc,, +gevent/tests/__pycache__/test__issue607.cpython-37.pyc,, +gevent/tests/__pycache__/test__issue639.cpython-37.pyc,, +gevent/tests/__pycache__/test__issue_728.cpython-37.pyc,, +gevent/tests/__pycache__/test__issues461_471.cpython-37.pyc,, +gevent/tests/__pycache__/test__iwait.cpython-37.pyc,, +gevent/tests/__pycache__/test__joinall.cpython-37.pyc,, +gevent/tests/__pycache__/test__local.cpython-37.pyc,, +gevent/tests/__pycache__/test__loop_callback.cpython-37.pyc,, +gevent/tests/__pycache__/test__makefile_ref.cpython-37.pyc,, +gevent/tests/__pycache__/test__memleak.cpython-37.pyc,, +gevent/tests/__pycache__/test__monkey.cpython-37.pyc,, +gevent/tests/__pycache__/test__monkey_builtins_future.cpython-37.pyc,, +gevent/tests/__pycache__/test__monkey_hub_in_thread.cpython-37.pyc,, +gevent/tests/__pycache__/test__monkey_logging.cpython-37.pyc,, +gevent/tests/__pycache__/test__monkey_multiple_imports.cpython-37.pyc,, +gevent/tests/__pycache__/test__monkey_queue.cpython-37.pyc,, +gevent/tests/__pycache__/test__monkey_scope.cpython-37.pyc,, +gevent/tests/__pycache__/test__monkey_selectors.cpython-37.pyc,, +gevent/tests/__pycache__/test__monkey_sigchld.cpython-37.pyc,, +gevent/tests/__pycache__/test__monkey_sigchld_2.cpython-37.pyc,, +gevent/tests/__pycache__/test__monkey_sigchld_3.cpython-37.pyc,, +gevent/tests/__pycache__/test__monkey_ssl_warning.cpython-37.pyc,, +gevent/tests/__pycache__/test__monkey_ssl_warning2.cpython-37.pyc,, +gevent/tests/__pycache__/test__monkey_ssl_warning3.cpython-37.pyc,, +gevent/tests/__pycache__/test__nondefaultloop.cpython-37.pyc,, +gevent/tests/__pycache__/test__order.cpython-37.pyc,, +gevent/tests/__pycache__/test__os.cpython-37.pyc,, +gevent/tests/__pycache__/test__pool.cpython-37.pyc,, +gevent/tests/__pycache__/test__pywsgi.cpython-37.pyc,, +gevent/tests/__pycache__/test__queue.cpython-37.pyc,, +gevent/tests/__pycache__/test__real_greenlet.cpython-37.pyc,, +gevent/tests/__pycache__/test__refcount.cpython-37.pyc,, +gevent/tests/__pycache__/test__refcount_core.cpython-37.pyc,, +gevent/tests/__pycache__/test__select.cpython-37.pyc,, +gevent/tests/__pycache__/test__semaphore.cpython-37.pyc,, +gevent/tests/__pycache__/test__server.cpython-37.pyc,, +gevent/tests/__pycache__/test__server_pywsgi.cpython-37.pyc,, +gevent/tests/__pycache__/test__signal.cpython-37.pyc,, +gevent/tests/__pycache__/test__sleep0.cpython-37.pyc,, +gevent/tests/__pycache__/test__socket.cpython-37.pyc,, +gevent/tests/__pycache__/test__socket_close.cpython-37.pyc,, +gevent/tests/__pycache__/test__socket_dns.cpython-37.pyc,, +gevent/tests/__pycache__/test__socket_dns6.cpython-37.pyc,, +gevent/tests/__pycache__/test__socket_errors.cpython-37.pyc,, +gevent/tests/__pycache__/test__socket_ex.cpython-37.pyc,, +gevent/tests/__pycache__/test__socket_send_memoryview.cpython-37.pyc,, +gevent/tests/__pycache__/test__socket_ssl.cpython-37.pyc,, +gevent/tests/__pycache__/test__socket_timeout.cpython-37.pyc,, +gevent/tests/__pycache__/test__socketpair.cpython-37.pyc,, +gevent/tests/__pycache__/test__ssl.cpython-37.pyc,, +gevent/tests/__pycache__/test__subprocess.cpython-37.pyc,, +gevent/tests/__pycache__/test__subprocess_interrupted.cpython-37.pyc,, +gevent/tests/__pycache__/test__subprocess_poll.cpython-37.pyc,, +gevent/tests/__pycache__/test__systemerror.cpython-37.pyc,, +gevent/tests/__pycache__/test__threading.cpython-37.pyc,, +gevent/tests/__pycache__/test__threading_2.cpython-37.pyc,, +gevent/tests/__pycache__/test__threading_before_monkey.cpython-37.pyc,, +gevent/tests/__pycache__/test__threading_holding_lock_while_monkey.cpython-37.pyc,, +gevent/tests/__pycache__/test__threading_monkey_in_thread.cpython-37.pyc,, +gevent/tests/__pycache__/test__threading_native_before_monkey.cpython-37.pyc,, +gevent/tests/__pycache__/test__threading_patched_local.cpython-37.pyc,, +gevent/tests/__pycache__/test__threading_vs_settrace.cpython-37.pyc,, +gevent/tests/__pycache__/test__threadpool.cpython-37.pyc,, +gevent/tests/__pycache__/test__threadpool_executor_patched.cpython-37.pyc,, +gevent/tests/__pycache__/test__timeout.cpython-37.pyc,, +gevent/tests/__pycache__/test__util.cpython-37.pyc,, +gevent/tests/_blocks_at_top_level.py,sha256=Hp36RFiC0djMSfvUHZsu8pVttpc7Hbmv_7VGq6xW630,48 +gevent/tests/_import_import_patch.py,sha256=IbgraY7KaPggcX1JNVkUQTTBSboegF_VWSDFJp38buI,28 +gevent/tests/_import_patch.py,sha256=_PWRiLjpsFyhT2CxTDIE9ZVS9gcCFqzQGFKel00zc2s,47 +gevent/tests/_import_wait.py,sha256=8353o30STWbRg53op9CWmTXfElU6VV4klLdqiq7Jmjg,570 +gevent/tests/_imports_at_top_level.py,sha256=9SCo81uRMT8xWbDFUBhbc_EwAoii9oygwOBSSNWfWWI,55 +gevent/tests/_imports_imports_at_top_level.py,sha256=VcIaDELcdgeEMqO_Cndy0XMjx05h5eG4_F_12giOSDs,345 +gevent/tests/badcert.pem,sha256=JioQeRZkHH8hGsWJjAF3U1zQvcWqhyzG6IOEJpTY9SE,1928 +gevent/tests/badkey.pem,sha256=gaBK9px_gG7DmrLKxfD6f6i-toAmARBTVfs-YGFRQF0,2162 +gevent/tests/getaddrinfo_module.py,sha256=oFyeNRywc3QO5HlpuV5DVcpUbml8hFn86pbWm_mGQX8,116 +gevent/tests/hosts_file.txt,sha256=07jEX3FicSKuiUJbQ_14H0MP8v7r35h_usGUmScPnSM,290909 +gevent/tests/https_svn_python_org_root.pem,sha256=wOB3Onnc62Iu9kEFd8GcHhd_suucYjpJNA3jyfHeJWA,2569 +gevent/tests/keycert.pem,sha256=r0KE1WH9eV6X4mUykpCY5Dm8_robBSi4zwMcGBPtMi4,1872 +gevent/tests/known_failures.py,sha256=Z_1njrvmPuHBgQdMlkUeem6Io6-h3AwuRJM5X7sfIl8,16153 +gevent/tests/lock_tests.py,sha256=FAHkMkAQSAofnKSYo4Q1yUz5DnMmXURfhp-zMbFzQUs,21861 +gevent/tests/monkey_package/__main__.py,sha256=uXMcIdKy25HEJtowa4Xd-uwrXQK-ca15TZ9knYMtwFc,180 +gevent/tests/monkey_package/__pycache__/__main__.cpython-37.pyc,, +gevent/tests/monkey_package/__pycache__/issue302monkey.cpython-37.pyc,, +gevent/tests/monkey_package/__pycache__/script.cpython-37.pyc,, +gevent/tests/monkey_package/issue302monkey.py,sha256=DMdW7B0MVcpTMKk94hW4kxqBzbBXFs4QQBwsFN844dQ,1095 +gevent/tests/monkey_package/script.py,sha256=2bXmWybFAoMYldTLN41r9eqnsCVK1QXnaEcl1EeQstc,391 +gevent/tests/nullcert.pem,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +gevent/tests/server.crt,sha256=B4Oj77EfnNyQIPmD9UxB_0QZuUT5evuDcGhSvx9ClRk,887 +gevent/tests/server.key,sha256=ZtnbGm6-aP6CTTJPoBv1QoIEz6SgeOfgHKuWTJ4cxhQ,891 +gevent/tests/sha256.pem,sha256=trYsA7FY0hyVoV1AoGNwZ_s6T89eiiOIFexoNRv029s,2065 +gevent/tests/test__GreenletExit.py,sha256=qHtC7KnjCG039F_VGDXnsrhyWaQXvfcmgnVB2Rfa_Vk,127 +gevent/tests/test___config.py,sha256=b-Aj8uJnuqYUFkM5BNZLp_coMjBS2GZnMgKh4r-rfCs,4817 +gevent/tests/test___example_servers.py,sha256=Wi13Mlr3jFX3Lb7Wo3L4I5Z5VJ5ABU0Tma-T8mFP830,4741 +gevent/tests/test___ident.py,sha256=gZk0QW6gQy8_ZhB_mNwCSqno7P7N4ItkWs8U3DZfogU,2101 +gevent/tests/test___monitor.py,sha256=HhzValkaHYp-y0QzhzDzMYU4ZoSWiWfsCHsIqo8QeLU,12573 +gevent/tests/test___monkey_patching.py,sha256=5VD3iRMovke9RUgI16nXAtXNgnFMQO_-dDp1HKmNEco,3659 +gevent/tests/test__all__.py,sha256=HBRkZEDjChGPleSuNzUV9Zxs6aMMLphDaHJ3xTIhXx4,8964 +gevent/tests/test__api.py,sha256=zJF6cfQKnPscZio9ErpkY2Mn2NNPOzNnzX4J8ujx4ww,4550 +gevent/tests/test__api_timeout.py,sha256=j2P5BHLGkLTvYg-NzcE90-gxXGzc6wxoomF43C05Bxg,6307 +gevent/tests/test__ares_host_result.py,sha256=OXQIzDgE-rz3Bj-_s6PjbicMGaPqnAPmtSa3wWzk6iI,873 +gevent/tests/test__ares_timeout.py,sha256=7plIQnTiPeoWkF-yHxbuqAe6ohKsMJP4ZUGgW3yzfTY,1257 +gevent/tests/test__backdoor.py,sha256=_pHAgWh4w34KkEwPa46FF7sb6Xn81sUonJyuSjBXcgI,4193 +gevent/tests/test__close_backend_fd.py,sha256=K7ZbNpu9Xj1aF1jHHDmPr0iHzdIQje8yFsFWfzZyguE,1964 +gevent/tests/test__compat.py,sha256=YBE4IJwtRozcCRqeZXY9dkxqjZ6m2xS0Pk1ceApjvnE,1439 +gevent/tests/test__core.py,sha256=0-JaW0m9zRvFESvya34Saomy62-__KTKpfsvQJRBvZw,5668 +gevent/tests/test__core_async.py,sha256=vySo8IqVpKPhd_ljN_cEmxV_ng5ORxKBzJY-Gy-7tL4,547 +gevent/tests/test__core_callback.py,sha256=1zjZvKOavnYIzXiJpgtn0JjTSpwXA2Syx5U1OueEN54,471 +gevent/tests/test__core_fork.py,sha256=DNq33dpct7xiD6A_M1atR2L9wi27y-KCwcoy5hCt-ms,1830 +gevent/tests/test__core_loop_run.py,sha256=Yi1xKGcqGWaBVeu54XGDWISFklYXIc7r2d-Xgz71gsU,668 +gevent/tests/test__core_loop_run_sig_mod.py,sha256=qaD4Q7Z0UXU_pevsXMjaylPoABFc-rfNToXi36ygIEE,597 +gevent/tests/test__core_stat.py,sha256=YvqLSe-9j5tIFC6MoPQhD5_0MdBtxrbVagp4o0jzpw8,3754 +gevent/tests/test__core_timer.py,sha256=e6VG-IHLiQ3OkrTOYGiLMX4VdU6RLG3UoA69uao2xG8,4330 +gevent/tests/test__core_watcher.py,sha256=ULftUAJqrMLYgzItmSzEosgeagKbI72m0oheKn14vYo,3573 +gevent/tests/test__destroy.py,sha256=UjbbX-16T0Kjpb2Y0IHhnE7n3-6PD18eKTxdFCHlBaM,1682 +gevent/tests/test__destroy_default_loop.py,sha256=JAja9tOyflLkKonpJW4TDmHHKVOnnSMx95_OxnfEkwA,1657 +gevent/tests/test__doctests.py,sha256=aZqNLQDOpyvFYkhmqgXyDRhtV3CnN50H4OnZkp0vC0E,3613 +gevent/tests/test__environ.py,sha256=FHBRtFqtDQbDU4qBBb5XHGRDd7Myh6wj4KJFVqmB2lg,520 +gevent/tests/test__event.py,sha256=QHboAng3_0tuw_AnyCQFIHFnGs3LgaV70Gz4cEqk6ek,7511 +gevent/tests/test__events.py,sha256=8yEdTm-oZdWvODHhIACN_ZOZQCH-oqZ_yDGbuAR_wQk,1268 +gevent/tests/test__example_echoserver.py,sha256=uS8U1qV3wV_9zK40ZMP41dplVgC1RruSrgGr0gzK5vI,1197 +gevent/tests/test__example_portforwarder.py,sha256=AgA1rWRkrkt4Jz4D6hxFLR109Ca18-Q5Bl3PssKgZ3U,2030 +gevent/tests/test__example_udp_client.py,sha256=42k_6BAWaIsy876GUJJI48SJJCGPtBnBoeAStSQPX38,786 +gevent/tests/test__example_udp_server.py,sha256=HKE94iVWq-qs-K5ROcIIOkZETGVWU1erPOE_dinvz_0,512 +gevent/tests/test__examples.py,sha256=bKo_UR91wK3iGbh4z6TP3du0OfKgpDnj7ku0-RTzcOo,2246 +gevent/tests/test__exc_info.py,sha256=23iWivgGUbroxrgJ9r1Be2NDiv8E4zEVUB9tnOPI9WI,1381 +gevent/tests/test__execmodules.py,sha256=1D-P4MmCOldJf-Dc-dVKrJgDnDj2km0MGPlqV6IMZjI,871 +gevent/tests/test__fileobject.py,sha256=1UTOw0-pTgKEDmyCAbPANiQRWFtuF0KH294m9QlhGqI,8682 +gevent/tests/test__getaddrinfo_import.py,sha256=Z4rjp1EFnUQin20Qxg_w7m1Fkkn21LuKTPzvUPoPIqg,334 +gevent/tests/test__greenio.py,sha256=ar48aU9uSrfFsPslpeE6Q19SPSs8_u9Hdr-RVrM2Mr4,4559 +gevent/tests/test__greenlet.py,sha256=uesiAG-p2b5LKNbkVwBhR2ioF6MjpluMlAolC7eYTHA,25050 +gevent/tests/test__greenletset.py,sha256=6jGMzRbFGNdLmub8-eVIw9iOZfEQ0GaXdqvzbNxvpEE,4490 +gevent/tests/test__greenness.py,sha256=4iiDkwZmagF_7cxqUKBL1LnERP-h8AnPH96YVA6Lt7s,2605 +gevent/tests/test__hub.py,sha256=ktpNQLmZFs2Ncx0MFtRbXU3nIRleMyeRHKClemm7oho,11233 +gevent/tests/test__hub_join.py,sha256=hVk84a1yZ6liO2ovSlunzwC4fPJ8cZAk0wvOoxui1f8,485 +gevent/tests/test__hub_join_timeout.py,sha256=D7_mRFIRY-yPrxa8YbCLtSH75PfLjRePy069yJgZRF4,2905 +gevent/tests/test__import_blocking_in_greenlet.py,sha256=TnqXgCo-JsrpoWuIDXbdn555kuXSj4fdSGRGoXZJr3w,431 +gevent/tests/test__import_wait.py,sha256=cEy4415W-meuNeXm6s8b1meXtvrmSj7nieOV8hNvgYY,143 +gevent/tests/test__issue112.py,sha256=kqropEsaNonQ70O6nHGZCGUoueLdB6LgRB73a4SZyqU,370 +gevent/tests/test__issue230.py,sha256=wqiwH_D2Qt1A2CJ_tWZAv50p5AoMis_ZRhEE1Qz58Vk,392 +gevent/tests/test__issue330.py,sha256=KlMXB1G1rvRqN5PzsJPs3YKwAsxPps52_9MoUtoMXNc,2259 +gevent/tests/test__issue467.py,sha256=q02FmOgt9IA1zBE6dqCsKs1AxeJ2_-s62SiNIyZXev8,948 +gevent/tests/test__issue6.py,sha256=_VDF4xiqM1HJev4wAUIaD3ELVG4HlnTWowpbdbwqXWc,1350 +gevent/tests/test__issue600.py,sha256=LhkXP-F1cdczD1oFlJbeGUegOLHGWOg9IVJN9XfEgRE,1306 +gevent/tests/test__issue607.py,sha256=uGWlqsn9ySDg40WXrpoRBJXoDDSzK5yDpcl7I6frc2o,1080 +gevent/tests/test__issue639.py,sha256=ZeDfYeBgB4FxgGsm9RPSoNnjlcvf_eThUMlut-5Y5GI,55 +gevent/tests/test__issue_728.py,sha256=1u6WSToRxMYe70aLU5vMhrWSZ_OHtwN9oP6L4UXXywg,212 +gevent/tests/test__issues461_471.py,sha256=q6B4wAl5nbrrOxFNoKTzcp1hc4Z-etD042p8t0NQidQ,3576 +gevent/tests/test__iwait.py,sha256=uzef1gKSo8dDbciyjZobklIXNDdc-B0ehEKb3iIn2Bg,1205 +gevent/tests/test__joinall.py,sha256=RF92Mw-qLxdrnJHE0xfuSMLuM_LfFveDsXth35j8C_M,111 +gevent/tests/test__local.py,sha256=SrkwrrprNxQspzYqDXZ7GidI0wfO7Og-vUVE4vOGeq8,11742 +gevent/tests/test__loop_callback.py,sha256=AMDWCjzrH8fr3dvMsrEFIzRMB2AjKcRq0ZfYt9fE57E,161 +gevent/tests/test__makefile_ref.py,sha256=a4wMUCY21dRsP2bDiCsOBWi1DqAxUzu5HS_hts5NSVI,17102 +gevent/tests/test__memleak.py,sha256=ijqrQ7qUwrWxdjLUKN4rtVPoTZVLv9LJphkd1GFxp8Y,1275 +gevent/tests/test__monkey.py,sha256=eT5rgqT2j3m-iobo8pSo8a7vGflYz9_saPzF7Im0DY8,5995 +gevent/tests/test__monkey_builtins_future.py,sha256=ZUJj7wWz9jEa9vDPSdEPrjqewiUwBspmtgh7RN8LymA,521 +gevent/tests/test__monkey_hub_in_thread.py,sha256=iMWv4a8Agy_llZypYxXo62kSB7LLTdNG5u9N_eHKIg8,520 +gevent/tests/test__monkey_logging.py,sha256=6uqY5n7TfzyVaiIFSBnSkW0OluQgcuFu2u7k9PC9q-w,1121 +gevent/tests/test__monkey_multiple_imports.py,sha256=QwmJJ4r3RXOQhti_5vj3Let0zllXzq4GwDY8NqzJUuQ,296 +gevent/tests/test__monkey_queue.py,sha256=jXMUF1DYdbSvwoFvReQFH86f0GfnTMrUNkP-R_eqels,12335 +gevent/tests/test__monkey_scope.py,sha256=JhgnSgGBvNYka-dqP9m9kLMLVEA8JZ2qZ7L1w95kzHM,1770 +gevent/tests/test__monkey_selectors.py,sha256=Oca3HpplLS9r6jSfFvM0E-NVoZEO4Zxeg-eQaD848iY,599 +gevent/tests/test__monkey_sigchld.py,sha256=f9o9x5LjUie6L2Z4n8keUPB1VlzsF7lX0DJOTQnn_FI,2103 +gevent/tests/test__monkey_sigchld_2.py,sha256=scXDckYto7VYr4oTPYpvMgcfL5AOavVpOtdKA2jMxEM,1580 +gevent/tests/test__monkey_sigchld_3.py,sha256=TKc67r-c7u6jG3QVN_KDPy01PYrQQkRimnH0bcPAeU8,1471 +gevent/tests/test__monkey_ssl_warning.py,sha256=-UkFSgrOLE_jmmeIOqs_sFIJ-LSVmvuXZKjN7r1W_nY,1022 +gevent/tests/test__monkey_ssl_warning2.py,sha256=NRlZ8-s-doOC6xNkQbaiVPIaqOtFBfEmQzyrKsUukww,1255 +gevent/tests/test__monkey_ssl_warning3.py,sha256=WZEOHQoewYAuYJu0f8UMjpmRzaR0B-sf0wBhvaRKTEQ,1330 +gevent/tests/test__nondefaultloop.py,sha256=Y3IrgT8SF3SmO3A1IlvC0nF4GCqxzvKES0KqvO72crE,204 +gevent/tests/test__order.py,sha256=iI8wh316sNia20IkHx7wSnE_LKdCsse6Q89xVkQev1U,1125 +gevent/tests/test__os.py,sha256=zoRh5Z5138wSU_sWgncYbSXSfr-v7HzqJ7MBnfdXUSc,5827 +gevent/tests/test__pool.py,sha256=33weK0xDFzH_-_PWrrBj-iIwxkAbpGDoMEZFUd07D3Q,17926 +gevent/tests/test__pywsgi.py,sha256=gtMSayFtxMuiMmwzWFpMQEBReYdIXVXhbCmqxAfzKDY,64069 +gevent/tests/test__queue.py,sha256=HTQVGLSkJYYesHqOSBq20DLb1ibzykCYVK-i6-NM9S8,12918 +gevent/tests/test__real_greenlet.py,sha256=58odp7leEc7C-CBIE_8Fposz8qS3y2nZp-DrPAuVo7E,464 +gevent/tests/test__refcount.py,sha256=Di1TWn7evn9elIiLtKjvq4g0Aeat0N0QCFZPmeGHzz8,5099 +gevent/tests/test__refcount_core.py,sha256=MaDRNKzNoDoCPFTZuHMpehszx7eMxUw83uTzjKIJZJI,509 +gevent/tests/test__select.py,sha256=kefxR5a1oKULgsNKb1NDnqRwpycL5swCcUUCtw0pIHI,3843 +gevent/tests/test__semaphore.py,sha256=bjRsbb7iHO_CRUcJOf8NOkwArvepyIeY2OPWueT3gFU,2542 +gevent/tests/test__server.py,sha256=Wrqz_M1--WYRobmtKFv5Py-uppvXJJIqLHIXvf1IvAg,16756 +gevent/tests/test__server_pywsgi.py,sha256=NI0mP2XbtsmCEfPj3OwKnzIpWruf15QCukCGnY5O4n0,2919 +gevent/tests/test__signal.py,sha256=aruabTlycpxjUwORKfB4JUS029dU9Wq8GsYWNFmicjU,4923 +gevent/tests/test__sleep0.py,sha256=uoruOPjsaPk1m0thN_4UppH4kW4k9fHQXDuLXnc3u5k,139 +gevent/tests/test__socket.py,sha256=Eb34BqW7dvSjkX-9UckAFuW7vxSPQ2ly0z4Jpp5wQhE,14704 +gevent/tests/test__socket_close.py,sha256=z-ecsccygna2cczb0SDkbwwee0f6JziWRvssm_PxHJI,1807 +gevent/tests/test__socket_dns.py,sha256=U8x2L4qxzfdglLrr0qNEpalShr7koEslvRbyMR_w0S4,24226 +gevent/tests/test__socket_dns6.py,sha256=trqgbuh3uGZoFNEcU5TtakLJeXQIpA9w-OtgLmSX5TI,2453 +gevent/tests/test__socket_errors.py,sha256=AnMt04cPU4iQjIYet_CyLttK1FO7t6mMPXk8QWmjXPs,1718 +gevent/tests/test__socket_ex.py,sha256=gOL_NKAVHf4WTsdDOv8KPDYMqiyu9XOtxMtYLbBpx08,1128 +gevent/tests/test__socket_send_memoryview.py,sha256=_C_8FbQhmCUi8pCqTYh0tSeTMy5K6JHptS8NqWkYtNc,886 +gevent/tests/test__socket_ssl.py,sha256=aS6ACvSO6K30qHwhSFXBXyIkg6RZ9-YFbpd-uunDQMo,828 +gevent/tests/test__socket_timeout.py,sha256=fJh7XqjJGlol-Lkr7echpJqD7pQBGUaLd5RO6APVf-M,1407 +gevent/tests/test__socketpair.py,sha256=mhxBAxWxWSnse0_NfEfA3_Cfh07V2tOkX4ygCMfhKJQ,851 +gevent/tests/test__ssl.py,sha256=e7iSoq07_lAkz8-UOPsW_v5wHyatGCNiSJQas_t7eGs,4070 +gevent/tests/test__subprocess.py,sha256=QVLlWF4zsUfonzQf1CYWPfQrAV3HD3URXk-1dhqFe84,18984 +gevent/tests/test__subprocess_interrupted.py,sha256=Blz-qIHuXGdSpI9D__zNn0WEcjUwSbaEhN7c_ikZ9_M,790 +gevent/tests/test__subprocess_poll.py,sha256=Y7CYIeryaY-WVXN9fGUhLDLqzq1KrSQKGdfUF1Ry0SQ,179 +gevent/tests/test__systemerror.py,sha256=SFKdXD3MbGhHnp6jwAOeaOFvrhLuoXmv0o3I7NL6NCk,3184 +gevent/tests/test__threading.py,sha256=s8nR6ik-dEkzR_3Nb2nftPfEW7M9pJVArqB0xPEaTJU,1443 +gevent/tests/test__threading_2.py,sha256=lbmU3HWtTCzWMVaGJI_mzwYJ3PBvUiU9JtIxsXJgz7k,22811 +gevent/tests/test__threading_before_monkey.py,sha256=Z-bNhXH218tp6vFFwqGmdL2EnSR26ydp9MZh9tH1zY4,675 +gevent/tests/test__threading_holding_lock_while_monkey.py,sha256=OnttJRH3ukPydDLll5KThIOEiBV1MkucUGIdO4eHDMA,337 +gevent/tests/test__threading_monkey_in_thread.py,sha256=jRbwWX-SA95tIoxITU4Yq83kRGO3Z8ZfDI5YVcrN004,2393 +gevent/tests/test__threading_native_before_monkey.py,sha256=qQe7WMSc_KCWhejfq-Hfa4Yv4Gb0vRP0F0c05GD9RQ0,1661 +gevent/tests/test__threading_patched_local.py,sha256=sXtfMuPgAEF5gl646OM-MELvQX3MZACtyU54ClWAku8,523 +gevent/tests/test__threading_vs_settrace.py,sha256=2iiHS0DWnHJ0gSLvVLcaKxoF-SofUEs_7exrSecDfr0,5051 +gevent/tests/test__threadpool.py,sha256=chJVc6BDfJ24MkKDTkwd-aFE-VrSDHdm2pmsZPkk6d8,19480 +gevent/tests/test__threadpool_executor_patched.py,sha256=UMJlfgDDCykK9gc-mC8w3JjeLJsk_k7DGoBfBKhb_Co,379 +gevent/tests/test__timeout.py,sha256=uRjOchrp6NVrjkxrCW9UMd6r5iheRe8EjzpW5XDD7Bg,5243 +gevent/tests/test__util.py,sha256=lA-L0D3a0IcefEwJm0E1qRxrvJ3kkKxBjwJfnr0t8v4,10149 +gevent/tests/test_server.crt,sha256=B4Oj77EfnNyQIPmD9UxB_0QZuUT5evuDcGhSvx9ClRk,887 +gevent/tests/test_server.key,sha256=ZtnbGm6-aP6CTTJPoBv1QoIEz6SgeOfgHKuWTJ4cxhQ,891 +gevent/tests/tests_that_dont_do_leakchecks.txt,sha256=hqT3OFiGvKj8V8jugeRR42mLIZ9tS8xHRQK5sS4sYR8,204 +gevent/tests/tests_that_dont_monkeypatch.txt,sha256=DeqqzP8rEzNtssCO1OPDwLJSyb3JSkQuEI9cAkpnATI,568 +gevent/tests/tests_that_dont_use_resolver.txt,sha256=vE3Mhrrtx_N7WB1_fxT9dySMRiAO3eMH5LNhuWol84A,3171 +gevent/tests/wrongcert.pem,sha256=6n4u7wcalNKCtnMsq7J3Y7uOiez901ZLiH38oE0jGUM,1880 +gevent/thread.py,sha256=XktB9n2NaVYycKhRVoYjGwizq0kjU2ohihgSyjdQssU,3608 +gevent/threading.py,sha256=hOmCvuScgvK54WFYjbru76pg6Z1-iJkOqaDf4CgQ-AY,8634 +gevent/threadpool.py,sha256=CNnBZXQ7t67I9VMlKFzWg42d8MZkIAhXWAdMHbBsI8M,20228 +gevent/time.py,sha256=C0eRlHq0rBxy9tC_SsIywkYaBNlwO1bc04qFi2OceB4,491 +gevent/timeout.py,sha256=kURx8Rwi9__4OPbKQoB_UPHYGd_WoOsm1dz5r60h_Rc,12692 +gevent/util.py,sha256=RF24Ji8psB5ZC4r7BLUFK3cNSKSOH6NcubA4umaPxOQ,19617 +gevent/win32util.py,sha256=WBk_YNf_kk3QF3PMUdScqgM_PreF4OBhfXq2W5264n0,3637 diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent-1.4.0.dist-info/WHEEL b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent-1.4.0.dist-info/WHEEL new file mode 100644 index 00000000..51a68490 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent-1.4.0.dist-info/WHEEL @@ -0,0 +1,5 @@ +Wheel-Version: 1.0 +Generator: bdist_wheel (0.32.3) +Root-Is-Purelib: false +Tag: cp37-cp37m-win32 + diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent-1.4.0.dist-info/entry_points.txt b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent-1.4.0.dist-info/entry_points.txt new file mode 100644 index 00000000..540b271a --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent-1.4.0.dist-info/entry_points.txt @@ -0,0 +1,3 @@ +[gevent.plugins.monkey.will_patch_all] +signal_os_incompat = gevent.monkey:_subscribe_signal_os + diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent-1.4.0.dist-info/top_level.txt b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent-1.4.0.dist-info/top_level.txt new file mode 100644 index 00000000..4a63abe6 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent-1.4.0.dist-info/top_level.txt @@ -0,0 +1 @@ +gevent diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/__abstract_linkable.cp37-win32.pyd b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/__abstract_linkable.cp37-win32.pyd new file mode 100644 index 0000000000000000000000000000000000000000..c9c11087a2958ff68a3611ad8fc23b6598659e36 GIT binary patch literal 59904 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 literal 0 HcmV?d00001 diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/__abstract_linkable.pxd b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/__abstract_linkable.pxd new file mode 100644 index 00000000..60d92030 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/__abstract_linkable.pxd @@ -0,0 +1,53 @@ +cimport cython + +from gevent.__greenlet_primitives cimport SwitchOutGreenletWithLoop +from gevent.__hub_local cimport get_hub_noargs as get_hub + +cdef InvalidSwitchError +cdef Timeout +cdef bint _greenlet_imported + +cdef extern from "greenlet/greenlet.h": + + ctypedef class greenlet.greenlet [object PyGreenlet]: + pass + + # These are actually macros and so much be included + # (defined) in each .pxd, as are the two functions + # that call them. + greenlet PyGreenlet_GetCurrent() + void PyGreenlet_Import() + +cdef inline greenlet getcurrent(): + return PyGreenlet_GetCurrent() + +cdef inline void greenlet_init(): + global _greenlet_imported + if not _greenlet_imported: + PyGreenlet_Import() + _greenlet_imported = True + +cdef void _init() + +cdef class AbstractLinkable(object): + # We declare the __weakref__ here in the base (even though + # that's not really what we want) as a workaround for a Cython + # issue we see reliably on 3.7b4 and sometimes on 3.6. See + # https://github.com/cython/cython/issues/2270 + cdef object __weakref__ + + cdef readonly SwitchOutGreenletWithLoop hub + + cdef _notifier + cdef set _links + cdef bint _notify_all + + cpdef rawlink(self, callback) + cpdef bint ready(self) + cpdef unlink(self, callback) + + cdef _check_and_notify(self) + cpdef _notify_links(self) + cdef _wait_core(self, timeout, catch=*) + cdef _wait_return_value(self, waited, wait_success) + cdef _wait(self, timeout=*) diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/__greenlet_primitives.cp37-win32.pyd b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/__greenlet_primitives.cp37-win32.pyd new file mode 100644 index 0000000000000000000000000000000000000000..48d35af5e7f89c557bfcaa23b5900a139905b7cf GIT binary patch literal 47104 zcmeFa4S1Br)jxbEY{CK?vS^|~V_hXkP>8$P@2`B24}u2RkdS~vmXK`N#E`^fR}u>d z-Ndrq#8Qi`ZLuZBR_a4rv_2ITH5w#QBcP(9pi)b9F`y|@jF!6Z@63JgN3t8V{r|7` zeXr|z0&{=NoH=vm%$YN1&dl7q@Rn`d1dih*2!21u?Zut`a@h4-E-@T8_3Edma!*Wp z?V7zY#jjmc=B#T~G`BRZX{lPPsIF>kY;q}9I}|PMMnzqtB7bqIVr^56BO@VUa+-+x z%$qmf`@6?;-w%YHue|a8f8qVU(>cfKzW;OKe&6YN$9J*#{Np|BUU2*&+<*F3&hbZa z|J~y`?_ZC5%IO6RF6DGCyPHox_dexIIi1Jem(*1|sjNWFYy})w923vYT72V*K->u~ z_L?a%Q#q~~F*gaZ(=WwcjEr!nxEyU%zONA%qOTc2 zq#IA{Pr-4kGFob?Tve#wWr*5@kb*!N!~SwmbcO)NNv=l1PJ}BEwjzZ6<#1eY#+ur? znpTcWqWE3}@R0j0LfBsp;cIDasYV>*33$Wcc7*}qF^9o98kzt|JmO9upxL-b5yJj* zIBs6p>;FE6alo7)*~!Vzx?|7wojp|wO|XoVqt>Na_10 zgk&hr_ZDu6f9@T++V7V8-BKTk#quG!XM>zeyuTMIHs9qCzvU}mlyUWPXY&?L?%O$u z^Q`C^tvaidrzG}Hs6)NwWZ*%e~Q_%@)M8a0_U+xo`p=hCe}~%4Nv5_{y2Ik zVfNVo+R^KB_`Z;Gob$cu!1@Hbpzj9+CP`bKf`}f9xL=5n{(zG^CAj!*n}Sl8clNqx z`%a*mK%#JRlzL$^Qs=W&p&*jT%wwRXzu>|*e!t(BkBE+AiJistvK)x{VNVw4`d+y& zL#T@DQombP9}7P4I{u*V_n^)HwmW*zI#@F;&=bmcQ@tetCu;q5l8Mt zN;iRZ_TD8?_YN&C>Y+E^Bv81e;ADsyv5XmirJ6mBG|x=Np#Xtbg1~x?njxRiFIT_Z z(VKYx3;YYdRw~-}D6;t7Cw-Fwh3}!lry-5sAnWwI6OC3X_AY9XBf!PV^~bm-d;GDk zIDVykNQFyj1(onL()nSp`()?&#ExI#MTmasUw(fu`iH^j0hGw1J^mQ?wVmhP-z&8d zmOY3sEvKig$S6FmLat7~E6(Ge;4TudHifXdv_g~#Q2g*v8o%%~A5-F2I;TMwGa-}_ zx;nI;XMai`@9?S5gG!M_`~ja64c7yo0I5Hj!-I2@gzNPuOYvy)C(CeKNri4corX53 zzub2KOz-S<#ns0ye{FUTxGDE0oTO{=3A$c&oUYoVbhRGAwRUSV_YB<<&atRV7IyZaoh2uxDnj=0Ps+TOgt(WWHbOG7oMd>v>xbleGD-%O0=bm^VE{&9+ z?_Hqv9YG3clw|e-W54h+8Ts~6zM)flVi@N=r)A~5TiSUZed?PS_j;ch$*BDGkp1g~ z^4C%ZL;=%Kg)@anx&={R9$kJ#?>D_e`Q0=+bh*z}curjXJW*V)SboERXTbmFfI5!S zyangH1tZ>q3%~izZ=R?8LIkoPZchwi?Uf`5^>MzL5TC(%sq-)?pY5c@pzHT8yoKXx zjc6lI?q1n#!EN(idLhHiUHsG(NMo&W3tC<7&VndCMQJy@U@P%;LpP8@cg^y&rE%-8 z5qtWcn4zorg3~;wetEM2XnPa4LlKfb5CJlKeJfEo^-ACM004%>O&h@CN$TFGNUnY; zaBq{97|yxkH*Jt{ZnUh_w-VrVUyA$kE2#8yl4IL?7NBOF6rUh({*k8_@R4n_OT{jP-0 z1FlJ59`50Ga`K_tu7Yz=Gm1^r??=?s78m@LQ4Wx&h&_m{7GS-%#VkclER;w2s{DNryB z^!t<3fES}2DMV*FSl~}iM@%1k_Pq~IFYnu{M10>~16_Teqr!ZV#3Pk>izL2J0&lT+ z>)Xpc4-gb2=*!Y_XiSn6v{4+tQ2N?z_4zKQ$DD%@rgEECn**G_4J1taW!_F2OuSuN z=z4z#T_4;;*Z*Em*Js;st=)S6!|c}e0J}ZtVzW_zokpn1701wK-}DK?NLRrKT8hRIsFZ}nKlgok^vd3A;;539w^BDMEq|^C z-RBv)n7?REso=9PWKQA_`3xw=|BmN?#Qa6er}oNQ3ABMg=`tELVJxVB<_L_SLHcvv zb_FM|@oNFX@%d?TZ$p~A3*m+nrR5b&9wAxkmuy~#&+i`L3oeMgit1A^T+>7O&h|mh zY9KoJTW$v}puFTPHLKqZeTc!523sdY2)5Zyv|k^1gh5*n|C#xyE$2C%UaCHpH|Z)l z0O}|E?ga>G$h8FO80OTyo&-vYRli(b;k}CTbZt0Vn)nd^#jW0n-gOf1VyU-6#upsr z7oG%hoBv+d=vcrPoX|G991T+j_=4m0G1~c#M)#C~W%b`a53 z8P-+tv79T_+Dx}(t1W&4=bDO0+$JJ&0_UE_TZ=%4=TMB7Jq*Q*5gSG(@&%y6hw{f+O_hicY?Q7;=NhwEd|NPf5$j^993-9*T8c;u%l~@z7ixi&OV9!9x%4Q}-IfSykh~lN3|GWBSv$h!W2}Q2%HEY}0 zW3T!RvvvovByN9k%8OH8a7p+VD*MX)$p$2Q_Dd>7EYMYd0@F&DmRBTp+=EK-SDggJ zb4tYWbDenPty^)ur!Z!6yvw+0BN}(I|BiG1H-Tix#1~$G?zyarXy`vM}4&k3rl$*Pnb6uh0)f^)QC@W`BISQ?@4r-pfdn zb@sO9)N{^;hta{5wUp&FWf_59g0`4h;oOE4@T!@S3h?$ho{8v{{Cr6TpOfN03|fJH znkSwj3nk@&NINL4?2CYngoE)WR0vwbuRVgg@L%)q`nCI?BWhAv1z4?I5`X-VHmpv! z^9fY-axqt~q=e5Y1`8$r!$a}@WM6>fHa%=_S6WiV=*nGFfyqSjg#aJgXMYD`D;fX4 z3m~;uxO5H_CIoOKg}DCU+p-=G=-1 zq$*hCJ^5*KJp0p3`DqgOwRo9~r+9Y?ILL2h=+uM0@?pP!^L{F+5BVfE=QaTYaP1ME zQk?@xMH%%mfJnE|#AJZjyftkE2`Hcvc&3K%h}AH^;*Q@7oyzs`xe`xX8MonvFLTTA zp5wZfpC{pS${-yHU(RDuiJfPVLTW~m*m((VOG^C7gRDiQB40|%EBLR}=lPqY-r_WA z=gS)tyI|EDTuTc*y%O`^*Pnw{U)uR{;=Okvdsn@TU&sXtt_>8t()^X{HvWgZ0fB~3 zfh5kwwDH8eB`Lb(j5Jo;0h9Mgz zaj@yT2hfQ~q4CxvJb}+iUX0ZK^7Dno!|wGWe4pW`Yx4 z(Ew^%M2Cc?ycH^J6hBD6Knw6^pu-FYUlBZlmsV{WUHOap&%zQ{XRM4zA`yiSSN z;Gbw;*+V(|<7BwzAih72nv%LV7$@z6Vq&fR>Qeq~Uo4_Q5s8lZz=rFM4SkZXq(1jG z{A91m6XQ?p>_Rs5P3T`?M5weA`=#Ijp*R2Ct?Ifxr%Un=fN?gkR72c9N?QGxtBl!> zS^^Zx^s+jchc{l&f7X@s#SOkdf1NkdwPeIQPYPw@ohS30iE*EX3@1_kLN93YTKfDG zy^QVv0pS|Blz+DZ<*9fplW4zdmMGDON_`3tM)J&OP(V>~83FW%aRUasH|+|d8?8(w^UWI{h*)+aH)vH@~4 z6t{6|S6htvoAoEm#eI^EF*#&(4|X5M;Dt`Ql>Zc_3t6mN!DoJvrWE~D#xF8dP=DnY zS!}qc_7`f1d;Nt5;fCoiwQhsRNeScRrTk5DbHZNWbzjEMOESmpqsJ+{bvy2-I+3IM zG@ks;GTRb(o+$67Y^?V(2;}y%-26>R-UP}!RK_O|nSL$hD?uCcIYpr%c2ih8Qo9a9 znt5w6V!=$*sK82gmuCXm26>XwfOw$KrJGrj>oPL~cWE&=Q*M^eHA{VFXohIRFw;$a zMxem2Wz+=5b})-tpRY9V8!g^KdP(vY8gNVT7FwV%r$IbXc9>{_Pt&3i6h(*JTFJk( zGNeUHN|*9;$toc`h1pyMXn=iGWr#8wAhF|laG1YY>NypICX=_d@mk_gKz{RNyk$$p zQh)M##vmz%m<41#5}ZX6&?583KuqHNoV^kg*4?Nuz0x2Gr7(gV6`^X1_8Jo=VVH1V)@?zS3g_qyZP$VHsm8Ar&b~LQE2ikx`78b82`_ z_d>+VQ53i^#TLqK0}XJWU-&&nGbP$3)FN=_gdxiaN9IznTr7jLj7HT^I|g&f`68+3 zs~C3zR8pusWF&We8Zr&t+igRM&NdOjdZC#F1hw0?&*tRoz=wUf9~7VIox+s};Vebn zU|BaSoF`F_zz`p1B0y>-d~VLJ829D7VqGZ!NB43oaF_Bq;Hx{?A4Bdzyqn`_YU%nM ztRJ$$uzdh;;50uF-iDhAaO~G8QC_*Oo?Y> z66V)<9}on)+;=l-fcO1^2!s@Y*vJ?}BlBE7ex6b)5aX;8<3vh-p%Rc>#Bjkcf~8H# z@^O+=gyfWQl2e7`)Nzs(Lb76<G)}TjNVY{!t~6j6&aDsxWoBS}ls$t?ks~%q&H9i0cVHgygdhr{5hSSPU>Aom zOhXZ7JAN&V3cNKHul%R}b*lIiU5q0SpP%- zq$s1*t#wNGl3W-A~+T)PYk{e>^IK{F)^UJ*RSR`z)dZGH~D z1NscJYM08Kz?9W&SV4lNp>R(ZwDRuVf>sulDtsG#{+J>7Nm#DW*l7-8%m z6dQ%zC_xw>)2T(%#dpY8K$dDAjgY0VW)KBV@?ViaB;~dge~h;%WjwwJR55w;Y)s(- z;_fZPC`l5}7p8!!!j#cNg3y03=qBc~;d)H<0{uf7BvTFt5~D^z)F{TIMv$oezl*3! zIP-%1QV_osA%3}{l$T27rCz+e9p74>$e&cseK}vq)W%6cZFtFU5crfzd`b8)epWeU#EK>n;M~3guhJ` z%SO$Fgd)fvM6SM1$!(xMuRf;scb;)y0yZ8&9&!A0)$*SORt)wCRUx|#^kBZtp(N%2 zyu6-UO3t!W1bF23vZ^KVN27ZB$8*5JTZNVjsg&{xa(el-=V(;^O7z8}acK^A9ol>c z#%vIKL8u^n$x$X^Ov6PqCYx5mzdneuHRN9(z+1WV39MhhLJyOq#Ex#H1f=O2p*s_p zvzIPyVn-7gjfHbam}jJ@HO`nA=4dIwow2|v>Kf3DWc0g`8YUP z&mkr)=yvz)hfR*fhp`JN7#HD@r%J#Zzv(D>^{IY+h@?BD74gnc{2=5D&1l%%wrbOA zbcgAJe;a-93|!1GLc|2PgEnmf0+zt%tRhh?@gIg`oaMiCbK458dUSq__lZ{{KT8;s ze+BY?2r-es!H;n$d_KkSX*Rc|Y#M_vKo3h8gD-{ALK0m9hZ|cUSd3{|87(E`z<8WMY4GB!-@p#eJFo(T zT2%I#6HXw(mB=U4cNpxMf!;H6DgFjBPAv$uag%_Q%o_#n2EBKeubDKORv@ z%#A_5>HM@*@1CNowbe<8GGL^3RY`O0>EM;P@i|E>}TV(vD=CiIE=qa{@YW=cM z&`lbk7M4)25SLJ0(;y*_{MGLtno-GC_g40?^;GQPIp}*H}mWWK9d1_{NM z*T;zC4$K{LLQGQoE8z`Bl79mKb_svTTPgF+!Ezmv1+OyvQX#Lh2peFmc*pQqAH()a z2xFRvTS83%2L{l->fI>wy(KK(ML|2p9}VuqeuT18Km|D^6)uVT{Llpcb{TIyiu(HB z@#nx@EAKvn7qfKZbY}_;bje$pN+Hu@BD6m(m0?@OTYLh6fnoeGKWXzso$r zDE@`7V!Kio09%pVxJloFooRxjL{;;7%5NzJ@UaDNLSlkD*}iqQjj5y@i1W zyOwkXT1-|_AB(1>_3jkk>x>6dwkRwOwBItmT#C&H{0p8FUDiz?&|OG*kx9nX?-I%R z7ZhMZFPKm$JO4s#7gUPt5*V?uB{u&Xp8awWU*KIPzE@y>ztAMYtj3i~x{80tKf!C4 zl|Y&gdgsgi@jf%kqz3nWr?p?K-+-NA@{Gp9h(uNAojI`d8V%%TD|(3qxU5)64O=g(H~Hd@~}|6+jExw7*w#=2l7(}-2h zc0u4Lur^U(e^No#{k$#@ob(aLvIsbw;zl+N?zq0;JJ^9;LAiF=0`ZBC+eq<$l zfnmDIf3sZFBc9V_prz6rw9C?Y^v`U+Nh-{gq<*vp*us&`LN6(S7X@Av?4`uJKFtE( zKjQ?Zqlq22(_;8ldx-YAw0^ja*Yk&na+nG?^9O3TVLMG8bh_sS=pOgk;K(db?Dz~> zX=Xq>A^3^B)ci_f$A>7!(~c#Dxo}8&POP%5a_3+e9Ln+-IoFH8o4)xJ(Tpl2K}C5b z_ndkaSxWqG@)N0(qF`Pc%o;~op&J#RJCiu~mX8nB9x74V>2H@(?cJ+8{jBC!&}L++ zYv<*t`V!~EJ24SokKPIsM|erY%NVB)cBT@&(2DXtVdllMEfZDGb|y+t7HrQX0gV|y zS)MTTA$O4gN*YJNdlIYA^|8+5xRp44xQ0MeLsJcGM7-sB@-n+Jk^Sa!5}z=ch^C7^-gV>)rtwb3X8!QTmrG+dlM5U)wu0D@pX; z4H@d*g{}EL1E9G-ZV*=pB6b1MKCusB+Ip;no=fa_5nb0~rIi)Vl~m%_66jMkV1n!E29q-4hUl>QZzo+^RNU=OPe^x{MTst=-iPJe6Olax1E$XmklI>o$) zzcugQDDS)IFh1Ro-_JH7T%6EPD8nu~>O{S;hixB$Ghz=a&sI#l3B+N{GA>ftDcB}| zs)ledU|xF^xt$}_)G_|IiD4vw7pEhEa43MoDIqy#xoAtx#dA%iT%Y3Xf?rETIFl%^ zxbJv7V;T(l_KT2y2_g6$5cq17$n|tF*d&7809fNy+d!FX9%PQ1M|*)?8S4T@`^7O$ zCroN0J9#%TdKd%XMToqLz$E~8rlEcq`BDUV0B5h?qvDHX?3q=31tNX-Gs3CjQD_gLT1Kemg7yen_+*CskZ%YlnwU(A z{0n8il`_9I85NJ`6P}=oYv~$U@v%BPWl=ZSDktDVSJu{N#5J{7Wr19iAglaRP z>Yfy}Eg14cK07?6;cXGh+(DTaATzba7L@AM()B-R3qJWMQO_p~6YbWs7omN6kPX|Z z_@)uSCbuCQwoIS=ax|$S*q;*YucT2L!IzDJKYDiyW&b&4zZ2Q{xfh@;up~nzR?vPW zQtzUahTwlm@Ha*)F0##WN=x>1(UYXck3y1h0CnL9R1MGmlxRx%ieUYJ%j%CR`_{ib zUKK*ny9oM8xMV^6ag;Nb_z>iy1ldB)+p))4B8cac9{?)oJzRaY=SA*Es1Z6^FQ}3K zCfv^e&^Pebcr=HgpCsrB0?i{)XbwR>MUc;t&-hzuCKm*0{D6v%p!TXDwfhNc0;ugS zLUWf3I*%T`G2P2Rj}Spm@D}>D98$y$prT-01ot4}o<$Uo)l?YHf#~TSnB_n;{Mr<} z)k}Q(;}?+%a&ikCew*+v{|9Jxf-W>RwUB>L2LJ-%8bMVk_fg9IW1L%yLKWfTt;;aL zvvXKa8<@;K0qPi;5`oNZ$1XzVydar>rGg$m7b3Iw+sO>&{u|}~6blC9kSP!-p=D`p zZ-BrKB9QZa{@z6hEDRDjOhrrsfnXu!{Fa6dWjsq67e%LS4-h@Ad|c$%0|G&n7bB=F zNYDksyXgx?5as+9f4A0+s4hLOBnm2ro}lPA4V%zIuaZJi<|s2>GfARzixA{M0j~-w*l@U>zvB;tj!1 zCis|Wv`2Jw44y*29&glJ9;70fuxdd?_a2gI(TbyIHh`YMgKywNK}^D|xDbLX2*G0V zN{>}Hd@@6M(3ej6qgrtxG*=Ot89;-5d6aE*lZvBC2>faSe;1R{h*HOE*=8UWTGqv$ zsAYGfxdJUq&(yM1I6EIlElV#?Q%)x(`>uZdA}xDMkf-TH++T1s&iC1&@oFA|zMi0G zqbfm%@KG|Kj=5*@2{ifkCJdl#!FUeknnSrhLXqC@%lJ3DX%izHi`YLyPu@JaZ^EZk z^f(r12#<#F{1@;<@C}<^#vaK~AB$jjXg^4#jUMt9WK$`Ja8e(wdlKv%-MY17T?@GY z4^8JI%8a@UNGB`Sq683~*ja;z@UtYRN+|^bYN4YPY=>erH$&Lk0_~@9ZlM`$$U)7r ze0kJd@i?Vkj zjwu^~OJPUD$hY}30AY&C90-CexbCQraSqZJmK-3(iN05TKL-#q-r8pRYS?;>s{?;}x!=eU?BMK0p4RB0W8N` zcY(V8xDI;3pF6R84<60^iTV9K^u+M`wPargJV-vqk+3O72)&ii)2S-wGT0OSaVwCG z25;j#Jv0xr4eCJ?$4j{>3e z#3vlb)mI27Cn_#xE~3ooj2OR`8ONd*EK~=rP|N~A3e434dzi`_Yo3S)<>S$IWP4IQ zvBDC5lAd-*LrhA1lY7}91#+$pAsnk=uS3BkePhLIkWV1L!_(wQaOOjhe0&g{Si8%q zc6aazO7QV%^0YW@1Xn#4E`{J0!6id*TX1o%AUN|_xakCU9iPxa<(?ooC&67Bgu7PY z)fIqa6$;fQAkbmeVEadVh_fym5N^r#S-&_OoYRNUk)H>ORLU#y> z+n+`kFBHgI*CWq=bez(w-4|KhjX?=`Vsvq%Yb%^Tp}o5^{P7i7UzG8SizA$3-gU)v z&`UVrf%Qo#ITIqmSl9Lz0#;bsXM-ZP0%7B4F>>Sp*orAfL>mF6 zKrw9}%>ha}beAR|V|50_2BDIsz-HdmP#r6=n|Bi-7Sk|zZK8MNI)kGbIVl3Kg&iE- zWPH%VDg}Pi4!{XVhOlAF9n;rMqq;Y@NNAN@p>-etFR=EfykedcBoAeHC$%6fE;2jU ztz=eB*sA6X6d@?SsJv)`KzV!+kWAO2fwskClcf&V4mZ-h9CLljV#F(jF?P zKaNsi=ma;RvGTEQ=|7CBMwCl?9E5VGuyRwLN~Lnwgv$M{xu%+I6D^h5X+g#Y)kaJbLM-p^**ss`?;$2L_c!?l!QJu>*?alE4!#mV_^C>za) z646J4pI@T=A_6)iV;#}zPBGi1iCw>@0@ulS&9D6Nd4yu>(Wj@`hdJ{I`CS08=qs|}SBKlMe(@$sH115;jg<0N_D z+g>=ba;$Ad#0(V#9;1&vqVlwF;SE|-r~S=0NsTwjHzv_mcATP{v!yFH2HzVw^*GX( z;)5AJ6e4JFGi5#X3&aa!bV*QVDyWH`Vy}Zx7@>rvl&~|HKq9X`FK7q{CDGS81TO^< zo!BvgcYHquRph6c-%ITHh~95zN1!%nzsw_}B*!%;xNG>5z^>s*nD^iQBt-wp-vLB| z-NLW>e*9;)TNrcb;BMi>&L1OLpgtsES)e2&ew}CVnYW1VL7-idA_kG@j+#3)uPs2G1TtbgAaTH!NT`hR;s})>3@PCz#=i^C zHY;XF`I9TK1--QpibqLSc_xhL;-xjo)Ab}AIeI9GhB*@(DSduHLpZ8P| zarpdy2NXJ{3^2fag8zohknf7(PeByn)f=Rbe4ZSEZvo%4#m3Q!#Lms6BsS3QX@1)_ zkb|jD0(JCQ+DBAFiCa1-`ej#6cQXhjr>(Br#h#Mfb2{Hh?8pKXd|wSD_6fsK8yGdr zMRF*&gmZW^7bPWjTtS#{C}=Z7*6WgClPA9{2|GdML&=F1y|sy#V#6WSpB%kZ_}~?r zuJE}<^nHRTTe3tabclsmU0x@wE>3Nzs!nv*zYlnJaGc})s5A9Gjd#HB73=~83n^{(P!mc8G zu1iIHl#EIWc*pt^x@jh?#t$^`Y@Hf|f;sMC(vF>sZyWJlzr>D2Vqv8etLhW^FZ>fC zdJ9hD0SogX-Y=|qoH_;SY1rYvF((i{9L%nyfp`YLQR<)IpBSNJF$f>>J#v^0!UuiN z4dT11s8ZBnm?`38?vjw|5foFXK`ujsM3g`^p;mypNbLL=50JdzR|!wOC8WR}4T}|U zgzaDD@l{3k*-Ac{Rr#Rr+#!qxN24EnI_B1nr7;i12x>eVG(r!qqB3p`AB=|NCUyOso6GRar22TNfkyNVgRUe~y@+R~vvIvX?GMwHcksMEXG*Mzmd2EAl3d&$Kpl}JS9HmIn-U2z z#R|Tj%7FP8rbJlBV@hPWDX3J&DiNw4DG{n%P$y8N@fV~-qUjK-Z4Xs42v0GB4xyar z1uzHAafC9cM+k)U2mwS$sL(v2Ne;8ZI=?{qW2ac-Om)`(kx3G4x6Wr-A0d0l8tg6f zN%d1dMQcE*`1uclN`({@luD)4KM{&)taf86X$f=*Ec=7Lx&fwCQlfTNHb3_VHm8M} zWf2v86$*~%c0y_4%7H%TL?2V;6Ug5s*bw03C=(VRbcOXEuwrBV?}!UI?sQm6DZYXO zP$#rRDh@Is4$vp#Pi+T7B5H}v@Tq1iGjBUy1%Q7d^e#r#F9lT&)yw8UGcX5&>Wz;u zmxTGxtBgyS|MW8oqMgOV?qR?CCPCd~2b<={AS|SAqMLTdTvf!s72#`fLyID65=q)Z zsc#+@P}ycHjZkt^o{RbS$Mo34PL#{h~O90XejgW?>9eZ3K zpT3mxUq#!jJ2O}l+Vpbjm;{|a7w4!jafy4F2F)~_rvgK-!iIf+JO<6NpQn2Ua!JFO zc>K%(vK2VZWPvCVeK}Nl-1EEgCY0E^Bo6|bL#6U>IP7&H^^osl^bPUTiiw@SMrx=b z1!jjxG!TgfkSH8zOYGdr%BDkY!6Q-YMFNUN0&F4yWgsA|d>bpj80B9lmQTyv5nCie zW#>@Y`=A@6N|*ZlsYgHyl_8#_@4acGrVhf(^2o2&Fw6-LyEOK7%|O@}bZh6RU?w3iW)G3{xs4 zZzmrLX1o6sY(P1tlfqYi(A)~Jyo7%XX3Bj~vv?Vr#J`RfK0*rZXxNM_>|25AGtrv; zh9G(0C-Pn*-5cRifq<+1rG9NX`W^ZVoO;C}V?DII79jy4bCDbN)7ma}E)Z}vLILPXE%q^~pJpi;rGX)sx1*N{nk%#0F2Pt$A zIDzxO02u3QLO07motYalx`3a-cSO(Qqpc}W^-0lf;$(8pL+_&{$V=mE=wm0!R|d4= z$WCa*%Xfj;;p%oFGl*BD64kX|! zRZ);5K^ZlH>3;f*VWg3OJj;a7t>N=2vwuQT!d90C2WgiC3^wMorp}2TfiV@;O6-^j zrGj3O#?O;>)k~p6WiBbMH$aG}+X=+P9nI&Ysxtj!$auDcJzzq`| zQFq=&wt@U+xD4;58E;7mv_Pt@gn!L<8x%ED0)gENU&cX`ZN%ag>+Yw13vhP84f}si zVn394#Lf8t6w9b%Zi0gQf^u7tJI%9E8r#( z3L-V$F5h?wzAS)m(cPslq(Et8L;lS3PaNI700|@USe1^6M_w)9^r0;9SHR2!~Hpg55)JR`#Da5kb#hca0|kEga;6wKo~@L4}t!Ea4*N* zhwv!Ea|nkKP9lsT$bQ6e*CA*S@)61qY7y2WY(@AL!d`?ygyRV35#lj-PDRK-C_-3< z(2TGVVLQUZ2+tu5A{<8;M)(H7h4QY4v)qDk6G9`xJqSAyo1Oq}5LM_4yl)DJQLggb|h7gbNX&1^v z*pKii!Y>dy5NZ*YAQ%v?Ly#k!gGqlFVK2g?2oE4^L8wPqhLDADJ;D_T@d!SioZW1S1{)eZPv9lY3GEmhTy)m7EE zaa?P2)jEoBIPCas&Z>r1z%5wY+|=4yx4OZha5dqlVH+A0tC4tHUE>->t-G<>RoBFR zBi7|~C>(b<8eNKprlw{F$dKlf{y_+o8>E93Q`c&*ThrLo;;11S@ynqr)-WV1>_NEZ zmb$fduDUxMtr^Yjp?VPf8dRsnQC01%0(rq4t=v43z|wVfu4?CEx2vF~rKttq1hKEJ zLXGW|H<&hGWK2b!%UKN4Gg?_Ldy|{k#I-saYT2E5gGvXBL8JopDg*m&bJQ%US{FdX zadqHXi_2bZud1$gGyn&~$Z@$YS4-V$x62{YBh)p+?snAyis%D-L7v?%VgRM6W3{`b z1&qaWHRMXUIUSwbQ+Nj-sluM$zi7V+AQ{ zn_4DUH?3{1Yp7y*QE8_luifPYp4E=(D&!`7$XwT=sBLlF?sha*w^I~SGA3hPeqD=$ z@j66rfO8jVFUAKFybOCNUx;X`lfaMas^&VOzRgu4Kbfp$INGWm%|tTEdwA;;IcN)X z7$M&}N7Zcb~nPEEQwno-2S7h1ahaiTiE|F z0$XMj5*SDHho1xE=I50aQ!4#dF#Fx$w6%D`-zMQVhBNBu$A8nb6a_r&XM{79%IexR z9Csn`p0}hdZCPF}!EiqiVT3r^+|Efx#VufP($R4YPBtpe#^B_m;}~4hsJJo)mx4I> z+_?-^ZW)8aFWE6-0>5(%ehBol-#t!iZ4-ajn0QXS7vR$Fyz|bQ)uKz?i!3Fd$6GFYJqlumzv{&X$)1NH<%3f@x@6bL!DLhf;=ULS1? zscu&5=dP=3RA*v1so`wx3t0D#2Fn@lAw0t0#-G4G*(9`0Aa2igJR$A^D^G}xg}tOf zoGdKwNyOzNF52J!+HwCg?YJa}-n^<-$6_{q+soRU9o*(vTf6vP>Tr>@fZw^DU~6C6 zSXbRt8QSKi39dUD@MO!8t1v!ff4439RvuZaDNhG=EDYSEC`I1 z3#(vSIa;}Q#MFwa79_$ZiLtehCa9cZTF5wA1X{&H&9I!M?=Z=&D;Aufq8eOn|Te$tv4v;h!QYR8*tp$l$VJ-wVM!U57oU8 zvk~qOBAr3;4smh2KoEv$t0 zP|Bhv(AR^y1oRDQngFjJLP^DSm@$xmaPCn3P_Ed8ITP^#ip;(Q$_Ca(T?jYoN^%j9 z{M}*=88O^11GsaWn;nfcTw53o`3_Qj*hzpKBmzSDS;!IO4(Te^afMmz0)nh+ZiQB1 zz}B&pL_Sf59JLq)XaZjqq8e>1 zXbv@U&TGfK&K?>gavN((skgR-@iY&!G)#fGxgzC6jxZ(tfJ$<#r3Pg6c85w?&|22w zc5o?To<&gTLY}$Q>P&aom>1z)5ywIS1(zV^5V#=ZImCJzAq;4s*&$ihNSl9ad|E$uc(3ufSJs~W2vc}*CQ zpg=E;#J-@0yF4sb7}^lY{e@x$=9ghC%WXvk9Q4Fp5tConO0EO}xVUb0OH~VcSOfe+ z%O;RC*0By#O6s8qJ)d)d+I+`q_nI}1mH?GE7c5y+PzuCcbs zUITALOH;eO0Z8C=Tud?S)I$Khk!Xj;KSqKl3IgGI9lvtO3-DKMs>)Hb5OJ5|jXiL1Sj=79O0$)@NT1sxm>F{$RC85x#VSXeQv7e+{{Rj=HvRehMIYzj zfQK+&4$OxGRfjM2M!~;$W3;(#23(2X$=@38lZ}d~xeeNb;{+EX&AO@c1pJWEp96l+ zsQB1WHp-z2$6g4}|1a}?2Zvz5lX+44zXP8Cqx_;%TcAaF`M-hhqBz!!WOYA|5hvECG#=_;_W)40Z=sKKp zp&g40SaU-D8U?6pLY#vh0`p}>v!exz7|gcHzHo36E(oFsmz<}=6ZrCt1iN{|xvqJ5nT|jgPQUy9M zCNGr#+tP^~#kT-`7Z~EXV%E&1vlL>DY8jN=11@*gD6lFC8?6a*H3iHzHyLI#GgPgLbV^)9uBzGG zOv<+g99-)L&*0rqz>nYt78uHk+Z^rdnp$dtxfy|B<%#JKH+QRxWDNExd~S@U0A5I- z8`fX5AfDr3gkO4{6EeouL}}TyN?{XL#R5J1+tL>;EiP8T+D9!Ew5o=sNri)!G$H4} zCC-opkH`N_TrE{~tqv1$NTCk0p-SNjtQadm0eO+A?I4mantLb&Yn>Jk*H*PN`E^#^ z;XtKZ9q3E2afL>pJR<&3j_QW0))2#y#l2dH!XhC#OM|m3$Uf#D#LSsX6s=%LLk+qX zih+yF-2&0V(j=H8k~B8=97fj6B}7A5;j}_2mJVeE5yC2E)7miw3-XvD+ye3po?s#q z)YO5s*dWg^lcCjfREWt?0MKr~-CflntlNGY?C5e^F{KyPW6d1K=(@(5x@zL?YRnv4 z+EIC0i-jIpUDr_OYR^y<1jLj&2&-70!U;X(Xqm(MNH97eP@%QvS*;2nXT1%W1I>yq zQRBdl0-+!Oe?cGE3RM`|hcKE>#_-0b#<@g0bV0_l82eESxa3E6EVy)LMJ1=Ef* zOCgJPQK2jCnMQji*1VnY($oaj(3yx`RPM%yr(uUy?bl%ryM}RL4!UtWx{I)44=z&q zn1$C?LCdt-?UC~6A|FpcbOC$Yx{E;*(*wZR*FY6!gIZM7;lQASj3Rpt+-?F*P1P9A zSe!U`2l|(g9_mBFJMGvI#yV~FP_yq)f;!7}% zxg(K>Ey=)Q3D7ID4)5W76mW#|iqc2%1Mi|a0c>`-4{F@i%p$Q=w+HM)#muD&439IL zX_JN^1i>+}5t>CD0>_MhqsLBhSY-xMAj9bKax^^fjvdmlx2CFw4P=VihN?BKGyvJ* zq-(S1g;srNAj(iIEGR3oFD}l{T{6E^(37yzV9vFK?3rs&7g6K`^|Uv&*w?bf6RIaw zr`0sG239c}xuHax6b+zV*o@TFc!#5fX;#8aV?yIB7q+hm(T$EZkT_`ZKvq^hwMQT# zIxg6bMAx_ABB+@)88gXi{IW~x&kdH?@&_)3X!gzn=BN_WQ2j9S2 z)*K1(Fr6TmfI_MO;;JYE{bpI9%XZ>qUCTsV#- zl()&j$%#J~_6mE4hL>@2Y>nZz%@5%TukShJv583NS0lsm{aerZVygfL{Tk-jyaw={ z;!fi8!(-FJ-*f(r`mP7gCptRK#5#7Dva7oj*Xk2jj386Z{{BOk5F+ zi{VlLx4x5;lg?s)z$Zam4)Dzkiz`Ch7Q|f|7RMp(2;!t+ai>v64$2LOquu8tfSVKs zM_;)=hqwu0arEUl3FwoB#dV+z3E)z~;@S}BL)?_GxKzZ+P>-v^;!XhHe!$T_HTH+P z%>i6K;4TS^Qy^{xG>6kiUz3{yTEgo=-}+VpZfaQG5yTw_+_bPb`Vh%pz+nrM@P~5g zYhB03(7Xq6I}jJ%mUJM{3Hrimc>r;HfRA(m`vbnC$XkqZ!{G)Irvbk3xC@ArkAb6Y z{uY!mF$~`kz|BEiIIngfE){vh>06Ju8o&kh5on?B(K%6WTo^t&>r@7s!}&~yu9^WC z9@l`pM*ue?m=}At5Vsp};q>()ZW+oAZ}XFg%NbL*tti6BBf>zMo23vIlsNK})1T!bPEKEpAli0A-)zHP$~_xH?Q|T!S1s3Y^26#-dA=xd z!-(4nn4B=U3sK^v;FS_EhciR?QV_Q%?49b9hPX|LlZVACqr_Pd$A!UA-r^{6%MdrL z3YAH4&M0v%#2p?3w<${8R*F-iE@7}cqQvb+oE&h?2vjEh?L*u)$jcrCAtw6u+vFr5 zBh1g6KAYQ*wj6c{Z70K5U4bSpC!9(Z9~8ix6V>!C}%0KUmu$;8rN87EiEgYYnTOh77Y0+ zOuih}S?!M2S=m_$lPz%JIo7U*Umge=TdlL;k2AGm*WB8w*12ozs#}^`n`&Ki;dd}q zwXV&$Lp2LCfyTO8tpAI<*o4vu)r|pMco|FJ|MYigyH!wjvC1{dpDKT=d{%i-`JwWp z@?XkWRibKzs$Jz#{aDqb+N(ORl4ib``H##zb+NiaU8&xv?oi*O-lqPkdWX74{iyme z^I3T6)NiTZSN~1@clFme4jrdS)J)gR))+MlG)pv3YVOqjm-cIIf=;2EqqFE1 z>RNSMbU)JFuX{xIm@ZMDs?XEktgq4kO8=DpCH)co`}$Ay(+$@cbcT6`MTRoNErwb{ zgW*SpUc+t1dyLzSzcD^;eA4*7@gw6z(==0t>HDTlrk|L)P5Vs!rp4xE=2hlL%zrjN zYyQG~!92;5WVy9E{mdBpO#PUXU)&9$gat5%64Zznf*fc@oY|kxg_{IPkBPwqWY=o3Dt9|LDh&VHZwUhHFIUA zGxPhIuVtRd{5bP;=18VmZBQ=-N1s$5R==%2p&nLiH8*Q2H8q-g%`VL=nj@OOX-c&B zYk#MGLc33UK>ND(1MMf;VeN?a8||gK8M@gztf-bX`pfiM z{Y~I&yS_{R3%$&6i6O;cHr!-bWoR_G4C@U)H4GX)Fl;ma+W4+9#uRUwYP!y(H(5;i zrrS+zrVXY}({|GXrX8l8riV?tOuJ2cOfQ=bnG(!bnw{X?7RzqSK8q)-Cu?`s<5^E< zm1TcF`&ZddXTO&HM)rHz=wMJB7jRplyi@tG@=4`B<$h(V%A~4Mty8U6b*SD`{T&>c zp837Z>oT)4^D=MF?8@AiIY~WLeVMu)a(1`+aY$4;WGELhv`o{WY1QzWZJJ+ddcc+6 zYyMmFvF0<)KQ){-UVDi)MSHb&j#i~D*Vbqov~Ajr+Pk$+YhMMgK7!;Gfj_HsYanlb z);+5`s(WAek?s@S=ek(^B>hzVrTQ!N*XwW8YxMd0QvIX)KFHq$gUL{8=rZ&h-ZM-z zPBmU;oMB8iDvg!KyNz3oHj~tRjd`~DX7j`5{pO!pby@dk9nBifnv$KJ{mblsW^*~T zyAtP4l+%=#D{oX*D;t!zE8CUb%2$;cs^3B$UQoTFI;{Fs^}WnlnR7BVnGa?@g?=`W zd5gM6{X6wj>NnLR>I_JLTl0O*N18lsllJ%8x3sys+jPxn;|;nW=1ZAJ+d%KhYpF zTw%DukY}hc)EMdwEr#zKHW}_VY%}aM{MPUX!;^-6h8H0n#|#l|wD-RLx~HMSZzfFJi6e`f44?lwM#e))p&5aj72<0r;5#xITWrYY#7 zmz!po($P~5rp2Z*(=DbNQ!9GyX44N%U8bL#eg*mZgXvk*fax{Uo2K_oL#DGPze!@A zV!qs*YQEMy$DC&_GA}~UZZf;fcbYrQ&zoO2zimEl{@8rZ%vmO(htIOiw=B0*T52qf zmb)ySmRBr?EN@vpw4AYgWr?*WTd%Mxtk+v_vaYnQv9?(^TKia^K5G5gde-_+Yhu>) ztn#c|v#PRg%WBW+%(^$LJL|WQ>p!D!pUV0oOOib~J1_gD?3LN8vz^&3*_*SsL)Hf% z>u+YipM5&}3zBym<^&ipCnyt?^OQx(mCDshr?N%KE4M+%?o{qk_9|ad{!_35KZU$JmicG&mjg_PoX@=rzTf5>17sN^`qrou*TB4|>=yG*4@u*SxHG zQ}dzb6U{lzSDJ4$)3ldqQ?=J=bG3!qV)Qbv_Gj81+K05e(aR2K4{86ZJp=uIwJuF} zy-uUc*WILBuB+B<*Zo}Aqx-$?DcuXYgSt1-^M-W8y7M|tKVAPleVRT)pRHe{FVo)w zEwxU+S^qQr4*f%r*0Ye&Sc4QA>smv)L2t-~)>>?M)bPAv!0?*kEyMeUbC5`hF#$3; z!#K~l)VRXfY`h;M!=sSD18i*g%J_{@Y0{dkrWKI3&8CM;kD8t|yLtNZ4G90i(!# z%R);jWUbcH%*Kx`mU}JtSst+Lusme>Ep*}@%bzWMkiNGqf3XZ%{%+x{Q>@dhms_ub z{AsLK>pbgfYpwNOHoo*=Z0WZST0gLUYW>`L&KjR}N!I0AsaY9WrmXC&e8{9d%aPTX zwK?nVtgfv4vVNZRD`?v1vtG(Nl=auFPqWTv`Lp7(6SGsY)3Vjsmh5@i#o0@XQGEO;FnWW56>XlaIe5FmfLRqD( zS2io}QT{~vb7hZmw{kD6g9FMz<;Tj;mH$xsl~UEUs_Rubszs386)K0SkxB0lRX(@$jlXXe3Gc3AdU5Ty&V`7u89oq6;-3QQ+pXsJS z@@DG|`Yh=BMf!SulisbrOaH9?8jOrNhHAqP4fh!yH2mHWYfLd-Yg8G{#+!`gMu*XD ze98E>@r3b|@iXI1&|+&~Z#-{$-SoL>oB4k8FU`L(KW2W@eAN7b*$0_fWLd^6j7_jB z4p~01_$*&rCR=A(=UPqBLCdX`*4wOZ>jvvR*88lxtdCotv3_Qql2wyc2g{;8>n~Z- z?1bz~v#-ito4qc3Q+8+e*6bf=_h!G8{c84GXhXDHGybFfCMcz7zZ7MfatZXz{mS1d z|A^L#RVArrV4G*QYO$(b)uOsfb+76{)kA2Vr&KSg-e4o|dDZ01L|7wNXWo#Ri?MfA z=F^$`Gr!54pw3e-RNs!#_c%1g=g<}9npK)QO(RC4J2g*e1~s2+;W9k2Vb?w7j1>U`k&h%QUNL|>s_sb8aS)o;a!^fP_8 z{*U1L0sRdICG5N$!y4ElTQJ`K1l)fX%jZxtZ!T2x1O|~0`JdTFIcJH&B#j6nwzD~GH1=tD$ZJxRf%!nv8)fX zXl9fSwvVXNGSf46W$w=GP+!n;I;n1pVV7Y)w9-j~&j5fuIJ1d%k*SJQ#poZ)&^LNj z$5j_p66kPErX@2!vpBORvpMsL%)Oa|nMX3uWh&HZY7H#FB3Rff)T`9ZY8PzmE$Rng zVeeM&f!^M)KB7LV_Nh;+FQ_?n1q1ma~gI3y) zK6F%b9KC25eMq8Bf_;<@`^bV8vuVpvBCT%N@F%x?RxXWNr9#r=iOYur%`ZMfzgc8Y}dx^bPuEy-U9d zcE=X|cKrj;=ewZK_vrWOd-aE5+aJ}R)cf?O^&|QV|IdIeQUMDE3l$3!3kwSm3m=OZ zV9T@s*fOoKXaS~$9*Y?kbAauUH5MBzwgAg|4od-G`@_J}#WKRO#Igd|>X-oR3oNh% KhWaQVF$4ezE*881 literal 0 HcmV?d00001 diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/__greenlet_primitives.pxd b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/__greenlet_primitives.pxd new file mode 100644 index 00000000..802c756a --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/__greenlet_primitives.pxd @@ -0,0 +1,47 @@ +cimport cython + +# This file must not cimport anything from gevent. +cdef get_objects +cdef wref + +cdef BlockingSwitchOutError + + +cdef extern from "greenlet/greenlet.h": + + ctypedef class greenlet.greenlet [object PyGreenlet]: + pass + + # These are actually macros and so much be included + # (defined) in each .pxd, as are the two functions + # that call them. + greenlet PyGreenlet_GetCurrent() + object PyGreenlet_Switch(greenlet self, void* args, void* kwargs) + void PyGreenlet_Import() + +@cython.final +cdef inline greenlet getcurrent(): + return PyGreenlet_GetCurrent() + +cdef bint _greenlet_imported + +cdef inline void greenlet_init(): + global _greenlet_imported + if not _greenlet_imported: + PyGreenlet_Import() + _greenlet_imported = True + +cdef inline object _greenlet_switch(greenlet self): + return PyGreenlet_Switch(self, NULL, NULL) + +cdef class TrackedRawGreenlet(greenlet): + pass + +cdef class SwitchOutGreenletWithLoop(TrackedRawGreenlet): + cdef public loop + + cpdef switch(self) + cpdef switch_out(self) + + +cpdef list get_reachable_greenlets() diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/__hub_local.cp37-win32.pyd b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/__hub_local.cp37-win32.pyd new file mode 100644 index 0000000000000000000000000000000000000000..c7edfff95031613e52be0e28451f5f7f29f1ba36 GIT binary patch literal 43520 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⋘bY{$Fs#X%1 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 literal 0 HcmV?d00001 diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/__hub_local.pxd b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/__hub_local.pxd new file mode 100644 index 00000000..e7df56f5 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/__hub_local.pxd @@ -0,0 +1,17 @@ +from gevent.__greenlet_primitives cimport SwitchOutGreenletWithLoop + +cdef _threadlocal + +cpdef get_hub_class() +cpdef SwitchOutGreenletWithLoop get_hub_if_exists() +cpdef set_hub(SwitchOutGreenletWithLoop hub) +cpdef get_loop() +cpdef set_loop(loop) + +# We can't cdef this, it won't do varargs. +# cpdef WaitOperationsGreenlet get_hub(*args, **kwargs) + +# XXX: TODO: Move the definition of TrackedRawGreenlet +# into a file that can be cython compiled so get_hub can +# return that. +cpdef SwitchOutGreenletWithLoop get_hub_noargs() diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/__hub_primitives.cp37-win32.pyd b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/__hub_primitives.cp37-win32.pyd new file mode 100644 index 0000000000000000000000000000000000000000..b38cd40998f2280f5d3586101b253f8fa2f7b40d GIT binary patch literal 103424 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 Z^S1*Q+kWMMa!~1-Jorrw{NMTae*i*z6@UN$ literal 0 HcmV?d00001 diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/__hub_primitives.pxd b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/__hub_primitives.pxd new file mode 100644 index 00000000..35e5ad20 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/__hub_primitives.pxd @@ -0,0 +1,73 @@ +cimport cython + +from gevent.__greenlet_primitives cimport SwitchOutGreenletWithLoop +from gevent.__hub_local cimport get_hub_noargs as get_hub + +from gevent.__waiter cimport Waiter +from gevent.__waiter cimport MultipleWaiter + +cdef InvalidSwitchError +cdef _waiter +cdef _greenlet_primitives +cdef traceback +cdef _timeout_error +cdef Timeout + + +cdef extern from "greenlet/greenlet.h": + + ctypedef class greenlet.greenlet [object PyGreenlet]: + pass + + # These are actually macros and so much be included + # (defined) in each .pxd, as are the two functions + # that call them. + greenlet PyGreenlet_GetCurrent() + void PyGreenlet_Import() + +@cython.final +cdef inline greenlet getcurrent(): + return PyGreenlet_GetCurrent() + +cdef bint _greenlet_imported + +cdef inline void greenlet_init(): + global _greenlet_imported + if not _greenlet_imported: + PyGreenlet_Import() + _greenlet_imported = True + + +cdef class WaitOperationsGreenlet(SwitchOutGreenletWithLoop): + + cpdef wait(self, watcher) + cpdef cancel_wait(self, watcher, error, close_watcher=*) + cpdef _cancel_wait(self, watcher, error, close_watcher) + +cdef class _WaitIterator: + cdef SwitchOutGreenletWithLoop _hub + cdef MultipleWaiter _waiter + cdef _switch + cdef _timeout + cdef _objects + cdef _timer + cdef Py_ssize_t _count + cdef bint _begun + + + cdef _begin(self) + cdef _cleanup(self) + + cpdef __enter__(self) + cpdef __exit__(self, typ, value, tb) + + +cpdef iwait_on_objects(objects, timeout=*, count=*) +cpdef wait_on_objects(objects=*, timeout=*, count=*) + +cdef _primitive_wait(watcher, timeout, timeout_exc, WaitOperationsGreenlet hub) +cpdef wait_on_watcher(watcher, timeout=*, timeout_exc=*, WaitOperationsGreenlet hub=*) +cpdef wait_read(fileno, timeout=*, timeout_exc=*) +cpdef wait_write(fileno, timeout=*, timeout_exc=*, event=*) +cpdef wait_readwrite(fileno, timeout=*, timeout_exc=*, event=*) +cpdef wait_on_socket(socket, watcher, timeout_exc=*) diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/__ident.cp37-win32.pyd b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/__ident.cp37-win32.pyd new file mode 100644 index 0000000000000000000000000000000000000000..849886d1efef318fd563d481463065fd8a2e3847 GIT binary patch literal 39424 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
(_S~fVjeKlT=4q5II5Z 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%0A)4x;=8`ya&p$ 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 W)TUIXD;DuBA28-WfB)M!@c#jclS~T$ literal 0 HcmV?d00001 diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/__ident.pxd b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/__ident.pxd new file mode 100644 index 00000000..55e43078 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/__ident.pxd @@ -0,0 +1,26 @@ +cimport cython + +cdef extern from "Python.h": + + ctypedef class weakref.ref [object PyWeakReference]: + pass + +cdef heappop +cdef heappush +cdef object WeakKeyDictionary +cdef type ref + +@cython.internal +@cython.final +cdef class ValuedWeakRef(ref): + cdef object value + +@cython.final +cdef class IdentRegistry: + cdef object _registry + cdef list _available_idents + + @cython.final + cpdef object get_ident(self, obj) + @cython.final + cpdef _return_ident(self, ValuedWeakRef ref) diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/__imap.cp37-win32.pyd b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/__imap.cp37-win32.pyd new file mode 100644 index 0000000000000000000000000000000000000000..72fb4b7abb8bf002aec3e0f778479d022783bb09 GIT binary patch literal 72192 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 0: + global _switchinterval + _switchinterval = interval + +from gevent._config import config +from gevent._hub_local import get_hub +from gevent._hub_primitives import iwait_on_objects as iwait +from gevent._hub_primitives import wait_on_objects as wait + +from gevent.greenlet import Greenlet, joinall, killall +joinall = joinall # export for pylint +spawn = Greenlet.spawn +spawn_later = Greenlet.spawn_later +#: The singleton configuration object for gevent. +config = config + +from gevent.timeout import Timeout, with_timeout +from gevent.hub import getcurrent, GreenletExit, spawn_raw, sleep, idle, kill, reinit +try: + from gevent.os import fork +except ImportError: + __all__.remove('fork') + +# See https://github.com/gevent/gevent/issues/648 +# A temporary backwards compatibility shim to enable users to continue +# to treat 'from gevent import signal' as a callable, to matter whether +# the 'gevent.signal' module has been imported first +from gevent.hub import signal as _signal_class +signal_handler = _signal_class +from gevent import signal as _signal_module + +# The object 'gevent.signal' must: +# - be callable, returning a gevent.hub.signal; +# - answer True to isinstance(gevent.signal(...), gevent.signal); +# - answer True to isinstance(gevent.signal(...), gevent.hub.signal) +# - have all the attributes of the module 'gevent.signal'; +# - answer True to isinstance(gevent.signal, types.ModuleType) (optional) + +# The only way to do this is to use a metaclass, an instance of which (a class) +# is put in sys.modules and is substituted for gevent.hub.signal. +# This handles everything except the last one. + + +class _signal_metaclass(type): + + def __getattr__(cls, name): + return getattr(_signal_module, name) + + def __setattr__(cls, name, value): + setattr(_signal_module, name, value) + + def __instancecheck__(cls, instance): + return isinstance(instance, _signal_class) + + def __dir__(cls): + return dir(_signal_module) + + +class signal(object): + + __doc__ = _signal_module.__doc__ + + def __new__(cls, *args, **kwargs): + return _signal_class(*args, **kwargs) + + +# The metaclass is applied after the class declaration +# for Python 2/3 compatibility +signal = _signal_metaclass(str("signal"), + (), + dict(signal.__dict__)) + +sys.modules['gevent.signal'] = signal +sys.modules['gevent.hub'].signal = signal + +del sys + + +# the following makes hidden imports visible to freezing tools like +# py2exe. see https://github.com/gevent/gevent/issues/181 +# This is not well maintained or tested, though, so it likely becomes +# outdated on each major release. + +def __dependencies_for_freezing(): # pragma: no cover + # pylint:disable=unused-import + from gevent import core + from gevent import resolver_thread + from gevent import resolver_ares + from gevent import socket as _socket + from gevent import threadpool + from gevent import thread + from gevent import threading + from gevent import select + from gevent import subprocess + import pprint + import traceback + import signal as _signal + +del __dependencies_for_freezing diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/__semaphore.cp37-win32.pyd b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/__semaphore.cp37-win32.pyd new file mode 100644 index 0000000000000000000000000000000000000000..80757b2ee8d523ac29e0d4c38fc93bda3fd39682 GIT binary patch literal 66048 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 S+&Kj~TblQv`G2oc4g3%2(-YDF literal 0 HcmV?d00001 diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/__semaphore.pxd b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/__semaphore.pxd new file mode 100644 index 00000000..dc9f11c6 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/__semaphore.pxd @@ -0,0 +1,23 @@ +cimport cython + +from gevent.__abstract_linkable cimport AbstractLinkable +cdef Timeout + + +cdef class Semaphore(AbstractLinkable): + cdef public int counter + + cpdef bint locked(self) + cpdef int release(self) except -1000 + # We don't really want this to be public, but + # threadpool uses it + cpdef _start_notify(self) + cpdef int wait(self, object timeout=*) except -1000 + cpdef bint acquire(self, int blocking=*, object timeout=*) except -1000 + cpdef __enter__(self) + cpdef __exit__(self, object t, object v, object tb) + +cdef class BoundedSemaphore(Semaphore): + cdef readonly int _initial_value + + cpdef int release(self) except -1000 diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/__tracer.cp37-win32.pyd b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/__tracer.cp37-win32.pyd new file mode 100644 index 0000000000000000000000000000000000000000..d2e6f061e786ac37761f68bc88d82a18f51e2d94 GIT binary patch literal 73728 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 literal 0 HcmV?d00001 diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/__tracer.pxd b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/__tracer.pxd new file mode 100644 index 00000000..454147ef --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/__tracer.pxd @@ -0,0 +1,43 @@ +cimport cython + +cdef sys +cdef traceback + +cdef settrace +cdef getcurrent + +cdef format_run_info + +cdef perf_counter +cdef gmctime + + +cdef class GreenletTracer: + cpdef readonly object active_greenlet + cpdef readonly object previous_trace_function + cpdef readonly Py_ssize_t greenlet_switch_counter + + cdef bint _killed + + cpdef _trace(self, str event, tuple args) + + @cython.locals(did_switch=bint) + cpdef did_block_hub(self, hub) + + cpdef kill(self) + +@cython.internal +cdef class _HubTracer(GreenletTracer): + cpdef readonly object hub + cpdef readonly double max_blocking_time + + +cdef class HubSwitchTracer(_HubTracer): + cpdef readonly double last_entered_hub + +cdef class MaxSwitchTracer(_HubTracer): + cpdef readonly double max_blocking + cpdef readonly double last_switch + + @cython.locals(switched_at=double) + cpdef _trace(self, str event, tuple args) diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/__waiter.cp37-win32.pyd b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/__waiter.cp37-win32.pyd new file mode 100644 index 0000000000000000000000000000000000000000..e3d8328ceb52f04141c61b3a1783685db868a283 GIT binary patch literal 64000 zcmeEv4SbZNaD;hKw6-< zLw1=yrt5a;uG`wJDYi>n+odgQfl?a`g=nebH!9uI*0vLa7A=L?Qs@2u?|r`JBSG7~ z@B4e--zLB3>wcVj?m6e4d+xa(Gw<$)l+lW!IB+Erin1F|{*{aS$Tw$}qFiwG-V2mn z=l%4W-C1*gdd;F>bJ)`nYF`~{SmSAIXlrX%Ju3sAP^8V%+~%oRQ0rOK-V`VvKYpB7 z2mSVo_22#acc=csxE_7x8^8D_zCU+j%5gpq{7ybUcjETrJ4E=jbF;=M6Bpck zuMu}#8FkJ1Sr;hE!w6X^Lod4+PdBce;@d6WM=8n}8ErllABaPu;%}5vjt^vFKJzI* zH}6pt7I+NLCPsU*lp#J-|4Ooyofj!e$rFlFkQ!(E_94F9_DwuM>o2aoX__n#uvX7Tv)p7DVNgX4k~*T zcl^=w6s1LpPs~R6mfpzN(%ymN$QHi>u(nqI>U&vRm;E*xIIBdbS0o^d>e!aC@snc} z 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 anaD3If>pt`U?+OWLjgeb*X{qc0{;cW(d2mm literal 0 HcmV?d00001 diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/__waiter.pxd b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/__waiter.pxd new file mode 100644 index 00000000..0763bae4 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/__waiter.pxd @@ -0,0 +1,48 @@ +cimport cython + +from gevent.__greenlet_primitives cimport SwitchOutGreenletWithLoop +from gevent.__hub_local cimport get_hub_noargs as get_hub + +cdef sys +cdef ConcurrentObjectUseError + + +cdef bint _greenlet_imported +cdef _NONE + +cdef extern from "greenlet/greenlet.h": + + ctypedef class greenlet.greenlet [object PyGreenlet]: + pass + + # These are actually macros and so much be included + # (defined) in each .pxd, as are the two functions + # that call them. + greenlet PyGreenlet_GetCurrent() + void PyGreenlet_Import() + +cdef inline greenlet getcurrent(): + return PyGreenlet_GetCurrent() + +cdef inline void greenlet_init(): + global _greenlet_imported + if not _greenlet_imported: + PyGreenlet_Import() + _greenlet_imported = True + +cdef class Waiter: + cdef readonly SwitchOutGreenletWithLoop hub + cdef readonly greenlet greenlet + cdef readonly value + cdef _exception + + cpdef get(self) + cpdef clear(self) + + # cpdef of switch leads to parameter errors... + #cpdef switch(self, value) + +@cython.final +@cython.internal +cdef class MultipleWaiter(Waiter): + cdef list _values diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_abstract_linkable.c b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_abstract_linkable.c new file mode 100644 index 00000000..3e20a622 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_abstract_linkable.c @@ -0,0 +1,8464 @@ +/* Generated by Cython 0.29.2 */ + +/* BEGIN: Cython Metadata +{ + "distutils": { + "depends": [ + "src/gevent/__abstract_linkable.pxd", + "src\\gevent\\__abstract_linkable.pxd" + ], + "include_dirs": [ + "C:\\Python37\\Include", + "deps" + ], + "name": "gevent.__abstract_linkable", + "sources": [ + "src/gevent/_abstract_linkable.py" + ] + }, + "module_name": "gevent.__abstract_linkable" +} +END: Cython Metadata */ + +#define PY_SSIZE_T_CLEAN +#include "Python.h" +#ifndef Py_PYTHON_H + #error Python headers needed to compile C extensions, please install development version of Python. +#elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) + #error Cython requires Python 2.6+ or Python 3.3+. +#else +#define CYTHON_ABI "0_29_2" +#define CYTHON_HEX_VERSION 0x001D02F0 +#define CYTHON_FUTURE_DIVISION 1 +#include +#ifndef offsetof + #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) +#endif +#if !defined(WIN32) && !defined(MS_WINDOWS) + #ifndef __stdcall + #define __stdcall + #endif + #ifndef __cdecl + #define __cdecl + #endif + #ifndef __fastcall + #define __fastcall + #endif +#endif +#ifndef DL_IMPORT + #define DL_IMPORT(t) t +#endif +#ifndef DL_EXPORT + #define DL_EXPORT(t) t +#endif +#define __PYX_COMMA , +#ifndef HAVE_LONG_LONG + #if PY_VERSION_HEX >= 0x02070000 + #define HAVE_LONG_LONG + #endif +#endif +#ifndef PY_LONG_LONG + #define PY_LONG_LONG LONG_LONG +#endif +#ifndef Py_HUGE_VAL + #define Py_HUGE_VAL HUGE_VAL +#endif +#ifdef PYPY_VERSION + #define CYTHON_COMPILING_IN_PYPY 1 + #define CYTHON_COMPILING_IN_PYSTON 0 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #undef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 0 + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #if PY_VERSION_HEX < 0x03050000 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #elif !defined(CYTHON_USE_ASYNC_SLOTS) + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #undef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 0 + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #undef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 1 + #undef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 0 + #undef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 0 + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #undef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE 0 + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 +#elif defined(PYSTON_VERSION) + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_PYSTON 1 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #ifndef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 1 + #endif + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #ifndef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 1 + #endif + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #ifndef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 0 + #endif + #ifndef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 1 + #endif + #ifndef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 1 + #endif + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #undef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE 0 + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 +#else + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_PYSTON 0 + #define CYTHON_COMPILING_IN_CPYTHON 1 + #ifndef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 1 + #endif + #if PY_VERSION_HEX < 0x02070000 + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #elif !defined(CYTHON_USE_PYTYPE_LOOKUP) + #define CYTHON_USE_PYTYPE_LOOKUP 1 + #endif + #if PY_MAJOR_VERSION < 3 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #elif !defined(CYTHON_USE_ASYNC_SLOTS) + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #if PY_VERSION_HEX < 0x02070000 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #elif !defined(CYTHON_USE_PYLONG_INTERNALS) + #define CYTHON_USE_PYLONG_INTERNALS 1 + #endif + #ifndef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 1 + #endif + #ifndef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 1 + #endif + #if PY_VERSION_HEX < 0x030300F0 + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #elif !defined(CYTHON_USE_UNICODE_WRITER) + #define CYTHON_USE_UNICODE_WRITER 1 + #endif + #ifndef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 0 + #endif + #ifndef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 1 + #endif + #ifndef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 1 + #endif + #ifndef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 1 + #endif + #ifndef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 1 + #endif + #ifndef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000) + #endif + #ifndef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1) + #endif + #ifndef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1) + #endif + #ifndef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3) + #endif +#endif +#if !defined(CYTHON_FAST_PYCCALL) +#define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) +#endif +#if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #undef SHIFT + #undef BASE + #undef MASK + #ifdef SIZEOF_VOID_P + enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) }; + #endif +#endif +#ifndef __has_attribute + #define __has_attribute(x) 0 +#endif +#ifndef __has_cpp_attribute + #define __has_cpp_attribute(x) 0 +#endif +#ifndef CYTHON_RESTRICT + #if defined(__GNUC__) + #define CYTHON_RESTRICT __restrict__ + #elif defined(_MSC_VER) && _MSC_VER >= 1400 + #define CYTHON_RESTRICT __restrict + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_RESTRICT restrict + #else + #define CYTHON_RESTRICT + #endif +#endif +#ifndef CYTHON_UNUSED +# if defined(__GNUC__) +# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +#endif +#ifndef CYTHON_MAYBE_UNUSED_VAR +# if defined(__cplusplus) + template void CYTHON_MAYBE_UNUSED_VAR( const T& ) { } +# else +# define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x) +# endif +#endif +#ifndef CYTHON_NCP_UNUSED +# if CYTHON_COMPILING_IN_CPYTHON +# define CYTHON_NCP_UNUSED +# else +# define CYTHON_NCP_UNUSED CYTHON_UNUSED +# endif +#endif +#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) +#ifdef _MSC_VER + #ifndef _MSC_STDINT_H_ + #if _MSC_VER < 1300 + typedef unsigned char uint8_t; + typedef unsigned int uint32_t; + #else + typedef unsigned __int8 uint8_t; + typedef unsigned __int32 uint32_t; + #endif + #endif +#else + #include +#endif +#ifndef CYTHON_FALLTHROUGH + #if defined(__cplusplus) && __cplusplus >= 201103L + #if __has_cpp_attribute(fallthrough) + #define CYTHON_FALLTHROUGH [[fallthrough]] + #elif __has_cpp_attribute(clang::fallthrough) + #define CYTHON_FALLTHROUGH [[clang::fallthrough]] + #elif __has_cpp_attribute(gnu::fallthrough) + #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] + #endif + #endif + #ifndef CYTHON_FALLTHROUGH + #if __has_attribute(fallthrough) + #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) + #else + #define CYTHON_FALLTHROUGH + #endif + #endif + #if defined(__clang__ ) && defined(__apple_build_version__) + #if __apple_build_version__ < 7000000 + #undef CYTHON_FALLTHROUGH + #define CYTHON_FALLTHROUGH + #endif + #endif +#endif + +#ifndef CYTHON_INLINE + #if defined(__clang__) + #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) + #elif defined(__GNUC__) + #define CYTHON_INLINE __inline__ + #elif defined(_MSC_VER) + #define CYTHON_INLINE __inline + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_INLINE inline + #else + #define CYTHON_INLINE + #endif +#endif + +#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) + #define Py_OptimizeFlag 0 +#endif +#define __PYX_BUILD_PY_SSIZE_T "n" +#define CYTHON_FORMAT_SSIZE_T "z" +#if PY_MAJOR_VERSION < 3 + #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyClass_Type +#else + #define __Pyx_BUILTIN_MODULE_NAME "builtins" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyType_Type +#endif +#ifndef Py_TPFLAGS_CHECKTYPES + #define Py_TPFLAGS_CHECKTYPES 0 +#endif +#ifndef Py_TPFLAGS_HAVE_INDEX + #define Py_TPFLAGS_HAVE_INDEX 0 +#endif +#ifndef Py_TPFLAGS_HAVE_NEWBUFFER + #define Py_TPFLAGS_HAVE_NEWBUFFER 0 +#endif +#ifndef Py_TPFLAGS_HAVE_FINALIZE + #define Py_TPFLAGS_HAVE_FINALIZE 0 +#endif +#ifndef METH_STACKLESS + #define METH_STACKLESS 0 +#endif +#if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) + #ifndef METH_FASTCALL + #define METH_FASTCALL 0x80 + #endif + typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs); + typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args, + Py_ssize_t nargs, PyObject *kwnames); +#else + #define __Pyx_PyCFunctionFast _PyCFunctionFast + #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords +#endif +#if CYTHON_FAST_PYCCALL +#define __Pyx_PyFastCFunction_Check(func)\ + ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS))))) +#else +#define __Pyx_PyFastCFunction_Check(func) 0 +#endif +#if CYTHON_USE_DICT_VERSIONS +#define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) +#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ + (version_var) = __PYX_GET_DICT_VERSION(dict);\ + (cache_var) = (value); +#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ + static PY_UINT64_T __pyx_dict_version = 0;\ + static PyObject *__pyx_dict_cached_value = NULL;\ + if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ + (VAR) = __pyx_dict_cached_value;\ + } else {\ + (VAR) = __pyx_dict_cached_value = (LOOKUP);\ + __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ + }\ + } +#else +#define __PYX_GET_DICT_VERSION(dict) (0) +#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) +#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) + #define PyObject_Malloc(s) PyMem_Malloc(s) + #define PyObject_Free(p) PyMem_Free(p) + #define PyObject_Realloc(p) PyMem_Realloc(p) +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1 + #define PyMem_RawMalloc(n) PyMem_Malloc(n) + #define PyMem_RawRealloc(p, n) PyMem_Realloc(p, n) + #define PyMem_RawFree(p) PyMem_Free(p) +#endif +#if CYTHON_COMPILING_IN_PYSTON + #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co) + #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno) +#else + #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) + #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) +#endif +#if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000 + #define __Pyx_PyThreadState_Current PyThreadState_GET() +#elif PY_VERSION_HEX >= 0x03060000 + #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() +#elif PY_VERSION_HEX >= 0x03000000 + #define __Pyx_PyThreadState_Current PyThreadState_GET() +#else + #define __Pyx_PyThreadState_Current _PyThreadState_Current +#endif +#if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) +#include "pythread.h" +#define Py_tss_NEEDS_INIT 0 +typedef int Py_tss_t; +static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) { + *key = PyThread_create_key(); + return 0; // PyThread_create_key reports success always +} +static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) { + Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t)); + *key = Py_tss_NEEDS_INIT; + return key; +} +static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) { + PyObject_Free(key); +} +static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) { + return *key != Py_tss_NEEDS_INIT; +} +static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) { + PyThread_delete_key(*key); + *key = Py_tss_NEEDS_INIT; +} +static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) { + return PyThread_set_key_value(*key, value); +} +static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { + return PyThread_get_key_value(*key); +} +#endif // TSS (Thread Specific Storage) API +#if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized) +#define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) +#else +#define __Pyx_PyDict_NewPresized(n) PyDict_New() +#endif +#if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION + #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) +#else + #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS +#define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) +#else +#define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name) +#endif +#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) + #define CYTHON_PEP393_ENABLED 1 + #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ + 0 : _PyUnicode_Ready((PyObject *)(op))) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) + #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) + #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) + #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) + #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) + #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch) + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) +#else + #define CYTHON_PEP393_ENABLED 0 + #define PyUnicode_1BYTE_KIND 1 + #define PyUnicode_2BYTE_KIND 2 + #define PyUnicode_4BYTE_KIND 4 + #define __Pyx_PyUnicode_READY(op) (0) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) + #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111) + #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) + #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) + #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) + #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch) + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) +#endif +#if CYTHON_COMPILING_IN_PYPY + #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) +#else + #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ + PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains) + #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check) + #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format) + #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) +#endif +#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) +#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) +#else + #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) +#endif +#if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) + #define PyObject_ASCII(o) PyObject_Repr(o) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBaseString_Type PyUnicode_Type + #define PyStringObject PyUnicodeObject + #define PyString_Type PyUnicode_Type + #define PyString_Check PyUnicode_Check + #define PyString_CheckExact PyUnicode_CheckExact + #define PyObject_Unicode PyObject_Str +#endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) + #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) +#else + #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) + #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) +#endif +#ifndef PySet_CheckExact + #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) +#endif +#if CYTHON_ASSUME_SAFE_MACROS + #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) +#else + #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyIntObject PyLongObject + #define PyInt_Type PyLong_Type + #define PyInt_Check(op) PyLong_Check(op) + #define PyInt_CheckExact(op) PyLong_CheckExact(op) + #define PyInt_FromString PyLong_FromString + #define PyInt_FromUnicode PyLong_FromUnicode + #define PyInt_FromLong PyLong_FromLong + #define PyInt_FromSize_t PyLong_FromSize_t + #define PyInt_FromSsize_t PyLong_FromSsize_t + #define PyInt_AsLong PyLong_AsLong + #define PyInt_AS_LONG PyLong_AS_LONG + #define PyInt_AsSsize_t PyLong_AsSsize_t + #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask + #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask + #define PyNumber_Int PyNumber_Long +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBoolObject PyLongObject +#endif +#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY + #ifndef PyUnicode_InternFromString + #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) + #endif +#endif +#if PY_VERSION_HEX < 0x030200A4 + typedef long Py_hash_t; + #define __Pyx_PyInt_FromHash_t PyInt_FromLong + #define __Pyx_PyInt_AsHash_t PyInt_AsLong +#else + #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t + #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t +#endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : (Py_INCREF(func), func)) +#else + #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) +#endif +#if CYTHON_USE_ASYNC_SLOTS + #if PY_VERSION_HEX >= 0x030500B1 + #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods + #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) + #else + #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) + #endif +#else + #define __Pyx_PyType_AsAsync(obj) NULL +#endif +#ifndef __Pyx_PyAsyncMethodsStruct + typedef struct { + unaryfunc am_await; + unaryfunc am_aiter; + unaryfunc am_anext; + } __Pyx_PyAsyncMethodsStruct; +#endif + +#if defined(WIN32) || defined(MS_WINDOWS) + #define _USE_MATH_DEFINES +#endif +#include +#ifdef NAN +#define __PYX_NAN() ((float) NAN) +#else +static CYTHON_INLINE float __PYX_NAN() { + float value; + memset(&value, 0xFF, sizeof(value)); + return value; +} +#endif +#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) +#define __Pyx_truncl trunc +#else +#define __Pyx_truncl truncl +#endif + + +#define __PYX_ERR(f_index, lineno, Ln_error) \ +{ \ + __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \ +} + +#ifndef __PYX_EXTERN_C + #ifdef __cplusplus + #define __PYX_EXTERN_C extern "C" + #else + #define __PYX_EXTERN_C extern + #endif +#endif + +#define __PYX_HAVE__gevent____abstract_linkable +#define __PYX_HAVE_API__gevent____abstract_linkable +/* Early includes */ +#include "greenlet/greenlet.h" +#ifdef _OPENMP +#include +#endif /* _OPENMP */ + +#if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) +#define CYTHON_WITHOUT_ASSERTIONS +#endif + +typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; + const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; + +#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 +#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0 +#define __PYX_DEFAULT_STRING_ENCODING "" +#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString +#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#define __Pyx_uchar_cast(c) ((unsigned char)c) +#define __Pyx_long_cast(x) ((long)x) +#define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ + (sizeof(type) < sizeof(Py_ssize_t)) ||\ + (sizeof(type) > sizeof(Py_ssize_t) &&\ + likely(v < (type)PY_SSIZE_T_MAX ||\ + v == (type)PY_SSIZE_T_MAX) &&\ + (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ + v == (type)PY_SSIZE_T_MIN))) ||\ + (sizeof(type) == sizeof(Py_ssize_t) &&\ + (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ + v == (type)PY_SSIZE_T_MAX))) ) +static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) { + return (size_t) i < (size_t) limit; +} +#if defined (__cplusplus) && __cplusplus >= 201103L + #include + #define __Pyx_sst_abs(value) std::abs(value) +#elif SIZEOF_INT >= SIZEOF_SIZE_T + #define __Pyx_sst_abs(value) abs(value) +#elif SIZEOF_LONG >= SIZEOF_SIZE_T + #define __Pyx_sst_abs(value) labs(value) +#elif defined (_MSC_VER) + #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) +#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define __Pyx_sst_abs(value) llabs(value) +#elif defined (__GNUC__) + #define __Pyx_sst_abs(value) __builtin_llabs(value) +#else + #define __Pyx_sst_abs(value) ((value<0) ? -value : value) +#endif +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*); +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); +#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) +#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) +#define __Pyx_PyBytes_FromString PyBytes_FromString +#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); +#if PY_MAJOR_VERSION < 3 + #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#else + #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize +#endif +#define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) +#define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) +#define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) +#define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) +#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) +static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) { + const Py_UNICODE *u_end = u; + while (*u_end++) ; + return (size_t)(u_end - u - 1); +} +#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) +#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode +#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode +#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) +#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) +static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); +static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*); +static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); +#define __Pyx_PySequence_Tuple(obj)\ + (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); +#if CYTHON_ASSUME_SAFE_MACROS +#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) +#else +#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) +#endif +#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) +#if PY_MAJOR_VERSION >= 3 +#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) +#else +#define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) +#endif +#define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x)) +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII +static int __Pyx_sys_getdefaultencoding_not_ascii; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + PyObject* ascii_chars_u = NULL; + PyObject* ascii_chars_b = NULL; + const char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + if (strcmp(default_encoding_c, "ascii") == 0) { + __Pyx_sys_getdefaultencoding_not_ascii = 0; + } else { + char ascii_chars[128]; + int c; + for (c = 0; c < 128; c++) { + ascii_chars[c] = c; + } + __Pyx_sys_getdefaultencoding_not_ascii = 1; + ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); + if (!ascii_chars_u) goto bad; + ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); + if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { + PyErr_Format( + PyExc_ValueError, + "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", + default_encoding_c); + goto bad; + } + Py_DECREF(ascii_chars_u); + Py_DECREF(ascii_chars_b); + } + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + Py_XDECREF(ascii_chars_u); + Py_XDECREF(ascii_chars_b); + return -1; +} +#endif +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) +#else +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +static char* __PYX_DEFAULT_STRING_ENCODING; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1); + if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; + strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + return -1; +} +#endif +#endif + + +/* Test for GCC > 2.95 */ +#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) + #define likely(x) __builtin_expect(!!(x), 1) + #define unlikely(x) __builtin_expect(!!(x), 0) +#else /* !__GNUC__ or GCC < 2.95 */ + #define likely(x) (x) + #define unlikely(x) (x) +#endif /* __GNUC__ */ +static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } + +static PyObject *__pyx_m = NULL; +static PyObject *__pyx_d; +static PyObject *__pyx_b; +static PyObject *__pyx_cython_runtime = NULL; +static PyObject *__pyx_empty_tuple; +static PyObject *__pyx_empty_bytes; +static PyObject *__pyx_empty_unicode; +static int __pyx_lineno; +static int __pyx_clineno = 0; +static const char * __pyx_cfilenm= __FILE__; +static const char *__pyx_filename; + + +static const char *__pyx_f[] = { + "src\\gevent\\_abstract_linkable.py", + "src\\gevent\\__greenlet_primitives.pxd", + "src\\gevent\\__abstract_linkable.pxd", +}; + +/*--- Type declarations ---*/ +struct __pyx_obj_6gevent_21__greenlet_primitives_TrackedRawGreenlet; +struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop; +struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable; +struct __pyx_opt_args_6gevent_19__abstract_linkable_16AbstractLinkable__wait_core; +struct __pyx_opt_args_6gevent_19__abstract_linkable_16AbstractLinkable__wait; + +/* "gevent/__abstract_linkable.pxd":51 + * cdef _check_and_notify(self) + * cpdef _notify_links(self) + * cdef _wait_core(self, timeout, catch=*) # <<<<<<<<<<<<<< + * cdef _wait_return_value(self, waited, wait_success) + * cdef _wait(self, timeout=*) + */ +struct __pyx_opt_args_6gevent_19__abstract_linkable_16AbstractLinkable__wait_core { + int __pyx_n; + PyObject *catch; +}; + +/* "gevent/__abstract_linkable.pxd":53 + * cdef _wait_core(self, timeout, catch=*) + * cdef _wait_return_value(self, waited, wait_success) + * cdef _wait(self, timeout=*) # <<<<<<<<<<<<<< + */ +struct __pyx_opt_args_6gevent_19__abstract_linkable_16AbstractLinkable__wait { + int __pyx_n; + PyObject *timeout; +}; + +/* "gevent/__greenlet_primitives.pxd":37 + * return PyGreenlet_Switch(self, NULL, NULL) + * + * cdef class TrackedRawGreenlet(greenlet): # <<<<<<<<<<<<<< + * pass + * + */ +struct __pyx_obj_6gevent_21__greenlet_primitives_TrackedRawGreenlet { + PyGreenlet __pyx_base; +}; + + +/* "gevent/__greenlet_primitives.pxd":40 + * pass + * + * cdef class SwitchOutGreenletWithLoop(TrackedRawGreenlet): # <<<<<<<<<<<<<< + * cdef public loop + * + */ +struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop { + struct __pyx_obj_6gevent_21__greenlet_primitives_TrackedRawGreenlet __pyx_base; + struct __pyx_vtabstruct_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *__pyx_vtab; + PyObject *loop; +}; + + +/* "gevent/__abstract_linkable.pxd":32 + * cdef void _init() + * + * cdef class AbstractLinkable(object): # <<<<<<<<<<<<<< + * # We declare the __weakref__ here in the base (even though + * # that's not really what we want) as a workaround for a Cython + */ +struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable { + PyObject_HEAD + struct __pyx_vtabstruct_6gevent_19__abstract_linkable_AbstractLinkable *__pyx_vtab; + PyObject *__weakref__; + struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *hub; + PyObject *_notifier; + PyObject *_links; + int _notify_all; +}; + + + +/* "gevent/__greenlet_primitives.pxd":40 + * pass + * + * cdef class SwitchOutGreenletWithLoop(TrackedRawGreenlet): # <<<<<<<<<<<<<< + * cdef public loop + * + */ + +struct __pyx_vtabstruct_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop { + PyObject *(*__pyx_switch)(struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *, int __pyx_skip_dispatch); + PyObject *(*switch_out)(struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *, int __pyx_skip_dispatch); +}; +static struct __pyx_vtabstruct_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *__pyx_vtabptr_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop; + + +/* "src/gevent/_abstract_linkable.py":25 + * ] + * + * class AbstractLinkable(object): # <<<<<<<<<<<<<< + * # Encapsulates the standard parts of the linking and notifying + * # protocol common to both repeatable events (Event, Semaphore) and + */ + +struct __pyx_vtabstruct_6gevent_19__abstract_linkable_AbstractLinkable { + PyObject *(*rawlink)(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *, PyObject *, int __pyx_skip_dispatch); + int (*ready)(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *, int __pyx_skip_dispatch); + PyObject *(*unlink)(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *, PyObject *, int __pyx_skip_dispatch); + PyObject *(*_check_and_notify)(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *); + PyObject *(*_notify_links)(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *, int __pyx_skip_dispatch); + PyObject *(*_wait_core)(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *, PyObject *, struct __pyx_opt_args_6gevent_19__abstract_linkable_16AbstractLinkable__wait_core *__pyx_optional_args); + PyObject *(*_wait_return_value)(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *, PyObject *, PyObject *); + PyObject *(*_wait)(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *, struct __pyx_opt_args_6gevent_19__abstract_linkable_16AbstractLinkable__wait *__pyx_optional_args); +}; +static struct __pyx_vtabstruct_6gevent_19__abstract_linkable_AbstractLinkable *__pyx_vtabptr_6gevent_19__abstract_linkable_AbstractLinkable; + +/* --- Runtime support code (head) --- */ +/* Refnanny.proto */ +#ifndef CYTHON_REFNANNY + #define CYTHON_REFNANNY 0 +#endif +#if CYTHON_REFNANNY + typedef struct { + void (*INCREF)(void*, PyObject*, int); + void (*DECREF)(void*, PyObject*, int); + void (*GOTREF)(void*, PyObject*, int); + void (*GIVEREF)(void*, PyObject*, int); + void* (*SetupContext)(const char*, int, const char*); + void (*FinishContext)(void**); + } __Pyx_RefNannyAPIStruct; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); + #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; +#ifdef WITH_THREAD + #define __Pyx_RefNannySetupContext(name, acquire_gil)\ + if (acquire_gil) {\ + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ + PyGILState_Release(__pyx_gilstate_save);\ + } else {\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ + } +#else + #define __Pyx_RefNannySetupContext(name, acquire_gil)\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) +#endif + #define __Pyx_RefNannyFinishContext()\ + __Pyx_RefNanny->FinishContext(&__pyx_refnanny) + #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0) + #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) + #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) + #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) +#else + #define __Pyx_RefNannyDeclarations + #define __Pyx_RefNannySetupContext(name, acquire_gil) + #define __Pyx_RefNannyFinishContext() + #define __Pyx_INCREF(r) Py_INCREF(r) + #define __Pyx_DECREF(r) Py_DECREF(r) + #define __Pyx_GOTREF(r) + #define __Pyx_GIVEREF(r) + #define __Pyx_XINCREF(r) Py_XINCREF(r) + #define __Pyx_XDECREF(r) Py_XDECREF(r) + #define __Pyx_XGOTREF(r) + #define __Pyx_XGIVEREF(r) +#endif +#define __Pyx_XDECREF_SET(r, v) do {\ + PyObject *tmp = (PyObject *) r;\ + r = v; __Pyx_XDECREF(tmp);\ + } while (0) +#define __Pyx_DECREF_SET(r, v) do {\ + PyObject *tmp = (PyObject *) r;\ + r = v; __Pyx_DECREF(tmp);\ + } while (0) +#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) +#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) + +/* PyObjectGetAttrStr.proto */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); +#else +#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) +#endif + +/* GetBuiltinName.proto */ +static PyObject *__Pyx_GetBuiltinName(PyObject *name); + +/* RaiseArgTupleInvalid.proto */ +static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, + Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); + +/* KeywordStringCheck.proto */ +static int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* function_name, int kw_allowed); + +/* PyFunctionFastCall.proto */ +#if CYTHON_FAST_PYCALL +#define __Pyx_PyFunction_FastCall(func, args, nargs)\ + __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) +#if 1 || PY_VERSION_HEX < 0x030600B1 +static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs); +#else +#define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs) +#endif +#define __Pyx_BUILD_ASSERT_EXPR(cond)\ + (sizeof(char [1 - 2*!(cond)]) - 1) +#ifndef Py_MEMBER_SIZE +#define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member) +#endif + static size_t __pyx_pyframe_localsplus_offset = 0; + #include "frameobject.h" + #define __Pxy_PyFrame_Initialize_Offsets()\ + ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\ + (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus))) + #define __Pyx_PyFrame_GetLocalsplus(frame)\ + (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset)) +#endif + +/* PyObjectCall.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); +#else +#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) +#endif + +/* PyObjectCallMethO.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); +#endif + +/* PyObjectCallNoArg.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); +#else +#define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL) +#endif + +/* PyCFunctionFastCall.proto */ +#if CYTHON_FAST_PYCCALL +static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs); +#else +#define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL) +#endif + +/* PyObjectCallOneArg.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); + +/* PyThreadStateGet.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; +#define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; +#define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type +#else +#define __Pyx_PyThreadState_declare +#define __Pyx_PyThreadState_assign +#define __Pyx_PyErr_Occurred() PyErr_Occurred() +#endif + +/* PyErrFetchRestore.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) +#define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) +#define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) +#define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) +#define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); +static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) +#else +#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) +#endif +#else +#define __Pyx_PyErr_Clear() PyErr_Clear() +#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) +#define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) +#define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb) +#define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) +#endif + +/* RaiseException.proto */ +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); + +/* WriteUnraisableException.proto */ +static void __Pyx_WriteUnraisable(const char *name, int clineno, + int lineno, const char *filename, + int full_traceback, int nogil); + +/* PyObjectCall2Args.proto */ +static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2); + +/* CallableCheck.proto */ +#if CYTHON_USE_TYPE_SLOTS && PY_MAJOR_VERSION >= 3 +#define __Pyx_PyCallable_Check(obj) ((obj)->ob_type->tp_call != NULL) +#else +#define __Pyx_PyCallable_Check(obj) PyCallable_Check(obj) +#endif + +/* pyfrozenset_new.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyFrozenSet_New(PyObject* it); + +/* py_set_discard.proto */ +static CYTHON_INLINE int __Pyx_PySet_Discard(PyObject *set, PyObject *key); + +/* IterFinish.proto */ +static CYTHON_INLINE int __Pyx_IterFinish(void); + +/* set_iter.proto */ +static CYTHON_INLINE PyObject* __Pyx_set_iterator(PyObject* iterable, int is_set, + Py_ssize_t* p_orig_length, int* p_source_is_set); +static CYTHON_INLINE int __Pyx_set_iter_next( + PyObject* iter_obj, Py_ssize_t orig_length, + Py_ssize_t* ppos, PyObject **value, + int source_is_set); + +/* PySetContains.proto */ +static CYTHON_INLINE int __Pyx_PySet_ContainsTF(PyObject* key, PyObject* set, int eq); + +/* GetTopmostException.proto */ +#if CYTHON_USE_EXC_INFO_STACK +static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate); +#endif + +/* SaveResetException.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); +#else +#define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb) +#define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb) +#endif + +/* GetException.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb) +static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#else +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); +#endif + +/* GetModuleGlobalName.proto */ +#if CYTHON_USE_DICT_VERSIONS +#define __Pyx_GetModuleGlobalName(var, name) {\ + static PY_UINT64_T __pyx_dict_version = 0;\ + static PyObject *__pyx_dict_cached_value = NULL;\ + (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\ + (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\ + __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ +} +#define __Pyx_GetModuleGlobalNameUncached(var, name) {\ + PY_UINT64_T __pyx_dict_version;\ + PyObject *__pyx_dict_cached_value;\ + (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ +} +static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value); +#else +#define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name) +#define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name) +static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name); +#endif + +/* PyErrExceptionMatches.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) +static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); +#else +#define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) +#endif + +/* GetAttr.proto */ +static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *); + +/* GetAttr3.proto */ +static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *); + +/* SwapException.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#else +static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb); +#endif + +/* PyObjectLookupSpecial.proto */ +#if CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject* __Pyx_PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name) { + PyObject *res; + PyTypeObject *tp = Py_TYPE(obj); +#if PY_MAJOR_VERSION < 3 + if (unlikely(PyInstance_Check(obj))) + return __Pyx_PyObject_GetAttrStr(obj, attr_name); +#endif + res = _PyType_Lookup(tp, attr_name); + if (likely(res)) { + descrgetfunc f = Py_TYPE(res)->tp_descr_get; + if (!f) { + Py_INCREF(res); + } else { + res = f(res, obj, (PyObject *)tp); + } + } else { + PyErr_SetObject(PyExc_AttributeError, attr_name); + } + return res; +} +#else +#define __Pyx_PyObject_LookupSpecial(o,n) __Pyx_PyObject_GetAttrStr(o,n) +#endif + +/* TypeImport.proto */ +#ifndef __PYX_HAVE_RT_ImportType_proto +#define __PYX_HAVE_RT_ImportType_proto +enum __Pyx_ImportType_CheckSize { + __Pyx_ImportType_CheckSize_Error = 0, + __Pyx_ImportType_CheckSize_Warn = 1, + __Pyx_ImportType_CheckSize_Ignore = 2 +}; +static PyTypeObject *__Pyx_ImportType(PyObject* module, const char *module_name, const char *class_name, size_t size, enum __Pyx_ImportType_CheckSize check_size); +#endif + +/* PyObject_GenericGetAttrNoDict.proto */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name); +#else +#define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr +#endif + +/* PyObject_GenericGetAttr.proto */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name); +#else +#define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr +#endif + +/* SetVTable.proto */ +static int __Pyx_SetVtable(PyObject *dict, void *vtable); + +/* GetVTable.proto */ +static void* __Pyx_GetVtable(PyObject *dict); + +/* Import.proto */ +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); + +/* ImportFrom.proto */ +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); + +/* FetchCommonType.proto */ +static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); + +/* CythonFunction.proto */ +#define __Pyx_CyFunction_USED 1 +#define __Pyx_CYFUNCTION_STATICMETHOD 0x01 +#define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 +#define __Pyx_CYFUNCTION_CCLASS 0x04 +#define __Pyx_CyFunction_GetClosure(f)\ + (((__pyx_CyFunctionObject *) (f))->func_closure) +#define __Pyx_CyFunction_GetClassObj(f)\ + (((__pyx_CyFunctionObject *) (f))->func_classobj) +#define __Pyx_CyFunction_Defaults(type, f)\ + ((type *)(((__pyx_CyFunctionObject *) (f))->defaults)) +#define __Pyx_CyFunction_SetDefaultsGetter(f, g)\ + ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g) +typedef struct { + PyCFunctionObject func; +#if PY_VERSION_HEX < 0x030500A0 + PyObject *func_weakreflist; +#endif + PyObject *func_dict; + PyObject *func_name; + PyObject *func_qualname; + PyObject *func_doc; + PyObject *func_globals; + PyObject *func_code; + PyObject *func_closure; + PyObject *func_classobj; + void *defaults; + int defaults_pyobjects; + int flags; + PyObject *defaults_tuple; + PyObject *defaults_kwdict; + PyObject *(*defaults_getter)(PyObject *); + PyObject *func_annotations; +} __pyx_CyFunctionObject; +static PyTypeObject *__pyx_CyFunctionType = 0; +#define __Pyx_CyFunction_Check(obj) (__Pyx_TypeCheck(obj, __pyx_CyFunctionType)) +#define __Pyx_CyFunction_NewEx(ml, flags, qualname, self, module, globals, code)\ + __Pyx_CyFunction_New(__pyx_CyFunctionType, ml, flags, qualname, self, module, globals, code) +static PyObject *__Pyx_CyFunction_New(PyTypeObject *, PyMethodDef *ml, + int flags, PyObject* qualname, + PyObject *self, + PyObject *module, PyObject *globals, + PyObject* code); +static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, + size_t size, + int pyobjects); +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, + PyObject *tuple); +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, + PyObject *dict); +static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m, + PyObject *dict); +static int __pyx_CyFunction_init(void); + +/* Globals.proto */ +static PyObject* __Pyx_Globals(void); + +/* CLineInTraceback.proto */ +#ifdef CYTHON_CLINE_IN_TRACEBACK +#define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) +#else +static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line); +#endif + +/* CodeObjectCache.proto */ +typedef struct { + PyCodeObject* code_object; + int code_line; +} __Pyx_CodeObjectCacheEntry; +struct __Pyx_CodeObjectCache { + int count; + int max_count; + __Pyx_CodeObjectCacheEntry* entries; +}; +static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); +static PyCodeObject *__pyx_find_code_object(int code_line); +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); + +/* AddTraceback.proto */ +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename); + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); + +/* CIntFromPy.proto */ +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); + +/* CIntFromPy.proto */ +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); + +/* FastTypeChecks.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) +static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b); +static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type); +static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2); +#else +#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) +#define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) +#define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) +#endif +#define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) + +/* CheckBinaryVersion.proto */ +static int __Pyx_check_binary_version(void); + +/* PyObjectSetAttrStr.proto */ +#if CYTHON_USE_TYPE_SLOTS +#define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o, n, NULL) +static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value); +#else +#define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n) +#define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v) +#endif + +/* VoidPtrExport.proto */ +static int __Pyx_ExportVoidPtr(PyObject *name, void *p, const char *sig); + +/* FunctionExport.proto */ +static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig); + +/* VoidPtrImport.proto */ +static int __Pyx_ImportVoidPtr(PyObject *module, const char *name, void **p, const char *sig); + +/* FunctionImport.proto */ +static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig); + +/* InitStrings.proto */ +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); + +static int __pyx_f_6gevent_19__abstract_linkable_16AbstractLinkable_ready(CYTHON_UNUSED struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/ +static PyObject *__pyx_f_6gevent_19__abstract_linkable_16AbstractLinkable__check_and_notify(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *__pyx_v_self); /* proto*/ +static PyObject *__pyx_f_6gevent_19__abstract_linkable_16AbstractLinkable_rawlink(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *__pyx_v_self, PyObject *__pyx_v_callback, int __pyx_skip_dispatch); /* proto*/ +static PyObject *__pyx_f_6gevent_19__abstract_linkable_16AbstractLinkable_unlink(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *__pyx_v_self, PyObject *__pyx_v_callback, int __pyx_skip_dispatch); /* proto*/ +static PyObject *__pyx_f_6gevent_19__abstract_linkable_16AbstractLinkable__notify_links(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/ +static PyObject *__pyx_f_6gevent_19__abstract_linkable_16AbstractLinkable__wait_core(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *__pyx_v_self, PyObject *__pyx_v_timeout, struct __pyx_opt_args_6gevent_19__abstract_linkable_16AbstractLinkable__wait_core *__pyx_optional_args); /* proto*/ +static PyObject *__pyx_f_6gevent_19__abstract_linkable_16AbstractLinkable__wait_return_value(CYTHON_UNUSED struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_waited, CYTHON_UNUSED PyObject *__pyx_v_wait_success); /* proto*/ +static PyObject *__pyx_f_6gevent_19__abstract_linkable_16AbstractLinkable__wait(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *__pyx_v_self, struct __pyx_opt_args_6gevent_19__abstract_linkable_16AbstractLinkable__wait *__pyx_optional_args); /* proto*/ + +/* Module declarations from 'cython' */ + +/* Module declarations from 'greenlet' */ + +/* Module declarations from 'gevent.__greenlet_primitives' */ +static PyTypeObject *__pyx_ptype_6gevent_21__greenlet_primitives_greenlet = 0; +static PyTypeObject *__pyx_ptype_6gevent_21__greenlet_primitives_TrackedRawGreenlet = 0; +static PyTypeObject *__pyx_ptype_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop = 0; +static PyObject **__pyx_vp_6gevent_21__greenlet_primitives_get_objects = 0; +#define __pyx_v_6gevent_21__greenlet_primitives_get_objects (*__pyx_vp_6gevent_21__greenlet_primitives_get_objects) +static PyObject **__pyx_vp_6gevent_21__greenlet_primitives_wref = 0; +#define __pyx_v_6gevent_21__greenlet_primitives_wref (*__pyx_vp_6gevent_21__greenlet_primitives_wref) +static PyObject **__pyx_vp_6gevent_21__greenlet_primitives_BlockingSwitchOutError = 0; +#define __pyx_v_6gevent_21__greenlet_primitives_BlockingSwitchOutError (*__pyx_vp_6gevent_21__greenlet_primitives_BlockingSwitchOutError) +static int *__pyx_vp_6gevent_21__greenlet_primitives__greenlet_imported = 0; +#define __pyx_v_6gevent_21__greenlet_primitives__greenlet_imported (*__pyx_vp_6gevent_21__greenlet_primitives__greenlet_imported) + +/* Module declarations from 'gevent.__hub_local' */ +static PyObject **__pyx_vp_6gevent_11__hub_local__threadlocal = 0; +#define __pyx_v_6gevent_11__hub_local__threadlocal (*__pyx_vp_6gevent_11__hub_local__threadlocal) +static struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *(*__pyx_f_6gevent_11__hub_local_get_hub_noargs)(int __pyx_skip_dispatch); /*proto*/ + +/* Module declarations from 'gevent.__abstract_linkable' */ +static PyTypeObject *__pyx_ptype_6gevent_19__abstract_linkable_greenlet = 0; +static PyTypeObject *__pyx_ptype_6gevent_19__abstract_linkable_AbstractLinkable = 0; +static PyObject *__pyx_v_6gevent_19__abstract_linkable_InvalidSwitchError = 0; +static PyObject *__pyx_v_6gevent_19__abstract_linkable_Timeout = 0; +static int __pyx_v_6gevent_19__abstract_linkable__greenlet_imported; +static CYTHON_INLINE PyGreenlet *__pyx_f_6gevent_19__abstract_linkable_getcurrent(void); /*proto*/ +static CYTHON_INLINE void __pyx_f_6gevent_19__abstract_linkable_greenlet_init(void); /*proto*/ +static void __pyx_f_6gevent_19__abstract_linkable__init(void); /*proto*/ +#define __Pyx_MODULE_NAME "gevent.__abstract_linkable" +extern int __pyx_module_is_main_gevent____abstract_linkable; +int __pyx_module_is_main_gevent____abstract_linkable = 0; + +/* Implementation of 'gevent.__abstract_linkable' */ +static PyObject *__pyx_builtin___import__; +static PyObject *__pyx_builtin_NotImplementedError; +static PyObject *__pyx_builtin_TypeError; +static const char __pyx_k_all[] = "__all__"; +static const char __pyx_k_hub[] = "hub"; +static const char __pyx_k_sys[] = "sys"; +static const char __pyx_k_exit[] = "__exit__"; +static const char __pyx_k_main[] = "__main__"; +static const char __pyx_k_name[] = "__name__"; +static const char __pyx_k_self[] = "self"; +static const char __pyx_k_stop[] = "stop"; +static const char __pyx_k_test[] = "__test__"; +static const char __pyx_k_enter[] = "__enter__"; +static const char __pyx_k_links[] = "_links"; +static const char __pyx_k_ready[] = "ready"; +static const char __pyx_k_slots[] = "__slots__"; +static const char __pyx_k_import[] = "__import__"; +static const char __pyx_k_lambda[] = ""; +static const char __pyx_k_switch[] = "switch"; +static const char __pyx_k_unlink[] = "unlink"; +static const char __pyx_k_Timeout[] = "Timeout"; +static const char __pyx_k_rawlink[] = "rawlink"; +static const char __pyx_k_weakref[] = "__weakref__"; +static const char __pyx_k_callback[] = "callback"; +static const char __pyx_k_exc_info[] = "exc_info"; +static const char __pyx_k_greenlet[] = "greenlet"; +static const char __pyx_k_notifier[] = "_notifier"; +static const char __pyx_k_pyx_capi[] = "__pyx_capi__"; +static const char __pyx_k_TypeError[] = "TypeError"; +static const char __pyx_k_linkcount[] = "linkcount"; +static const char __pyx_k_getcurrent[] = "getcurrent"; +static const char __pyx_k_notify_all[] = "_notify_all"; +static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__"; +static const char __pyx_k_auto_unlink[] = "auto_unlink"; +static const char __pyx_k_gevent__util[] = "gevent._util"; +static const char __pyx_k_handle_error[] = "handle_error"; +static const char __pyx_k_notify_links[] = "_notify_links"; +static const char __pyx_k_run_callback[] = "run_callback"; +static const char __pyx_k_greenlet_init[] = "greenlet_init"; +static const char __pyx_k_get_hub_noargs[] = "get_hub_noargs"; +static const char __pyx_k_gevent_timeout[] = "gevent.timeout"; +static const char __pyx_k_import_c_accel[] = "import_c_accel"; +static const char __pyx_k_AbstractLinkable[] = "AbstractLinkable"; +static const char __pyx_k_gevent__hub_local[] = "gevent._hub_local"; +static const char __pyx_k_gevent_exceptions[] = "gevent.exceptions"; +static const char __pyx_k_greenlet_imported[] = "_greenlet_imported"; +static const char __pyx_k_InvalidSwitchError[] = "InvalidSwitchError"; +static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; +static const char __pyx_k_start_new_or_dummy[] = "_start_new_or_dummy"; +static const char __pyx_k_Expected_callable_r[] = "Expected callable: %r"; +static const char __pyx_k_NotImplementedError[] = "NotImplementedError"; +static const char __pyx_k_AbstractLinkable_ready[] = "AbstractLinkable.ready"; +static const char __pyx_k_AbstractLinkable_unlink[] = "AbstractLinkable.unlink"; +static const char __pyx_k_AbstractLinkable_rawlink[] = "AbstractLinkable.rawlink"; +static const char __pyx_k_AbstractLinkable_linkcount[] = "AbstractLinkable.linkcount"; +static const char __pyx_k_gevent___abstract_linkable[] = "gevent.__abstract_linkable"; +static const char __pyx_k_AbstractLinkable__notify_links[] = "AbstractLinkable._notify_links"; +static const char __pyx_k_Internal_module_support_for_the[] = "\nInternal module, support for the linkable protocol for \"event\" like objects.\n\n"; +static const char __pyx_k_Invalid_switch_into_Event_wait_r[] = "Invalid switch into Event.wait(): %r"; +static const char __pyx_k_src_gevent__abstract_linkable_py[] = "src\\gevent\\_abstract_linkable.py"; +static PyObject *__pyx_n_s_AbstractLinkable; +static PyObject *__pyx_n_s_AbstractLinkable__notify_links; +static PyObject *__pyx_n_s_AbstractLinkable_linkcount; +static PyObject *__pyx_n_s_AbstractLinkable_rawlink; +static PyObject *__pyx_n_s_AbstractLinkable_ready; +static PyObject *__pyx_n_s_AbstractLinkable_unlink; +static PyObject *__pyx_kp_s_Expected_callable_r; +static PyObject *__pyx_n_s_InvalidSwitchError; +static PyObject *__pyx_kp_s_Invalid_switch_into_Event_wait_r; +static PyObject *__pyx_n_s_NotImplementedError; +static PyObject *__pyx_n_s_Timeout; +static PyObject *__pyx_n_s_TypeError; +static PyObject *__pyx_n_s_all; +static PyObject *__pyx_n_s_auto_unlink; +static PyObject *__pyx_n_s_callback; +static PyObject *__pyx_n_s_cline_in_traceback; +static PyObject *__pyx_n_s_enter; +static PyObject *__pyx_n_s_exc_info; +static PyObject *__pyx_n_s_exit; +static PyObject *__pyx_n_s_get_hub_noargs; +static PyObject *__pyx_n_s_getcurrent; +static PyObject *__pyx_n_s_gevent___abstract_linkable; +static PyObject *__pyx_n_s_gevent__hub_local; +static PyObject *__pyx_n_s_gevent__util; +static PyObject *__pyx_n_s_gevent_exceptions; +static PyObject *__pyx_n_s_gevent_timeout; +static PyObject *__pyx_n_s_greenlet; +static PyObject *__pyx_n_s_greenlet_imported; +static PyObject *__pyx_n_s_greenlet_init; +static PyObject *__pyx_n_s_handle_error; +static PyObject *__pyx_n_s_hub; +static PyObject *__pyx_n_s_import; +static PyObject *__pyx_n_s_import_c_accel; +static PyObject *__pyx_n_s_lambda; +static PyObject *__pyx_n_s_linkcount; +static PyObject *__pyx_n_s_links; +static PyObject *__pyx_n_s_main; +static PyObject *__pyx_n_s_name; +static PyObject *__pyx_n_s_notifier; +static PyObject *__pyx_n_s_notify_all; +static PyObject *__pyx_n_s_notify_links; +static PyObject *__pyx_n_s_pyx_capi; +static PyObject *__pyx_n_s_pyx_vtable; +static PyObject *__pyx_n_s_rawlink; +static PyObject *__pyx_n_s_ready; +static PyObject *__pyx_n_s_run_callback; +static PyObject *__pyx_n_s_self; +static PyObject *__pyx_n_s_slots; +static PyObject *__pyx_kp_s_src_gevent__abstract_linkable_py; +static PyObject *__pyx_n_s_start_new_or_dummy; +static PyObject *__pyx_n_s_stop; +static PyObject *__pyx_n_s_switch; +static PyObject *__pyx_n_s_sys; +static PyObject *__pyx_n_s_test; +static PyObject *__pyx_n_s_unlink; +static PyObject *__pyx_n_s_weakref; +static PyObject *__pyx_lambda_funcdef_6gevent_19__abstract_linkable_lambda(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static int __pyx_pf_6gevent_19__abstract_linkable_16AbstractLinkable___init__(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_19__abstract_linkable_16AbstractLinkable_2linkcount(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_19__abstract_linkable_16AbstractLinkable_4ready(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_19__abstract_linkable_16AbstractLinkable_6rawlink(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *__pyx_v_self, PyObject *__pyx_v_callback); /* proto */ +static PyObject *__pyx_pf_6gevent_19__abstract_linkable_16AbstractLinkable_8unlink(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *__pyx_v_self, PyObject *__pyx_v_callback); /* proto */ +static PyObject *__pyx_pf_6gevent_19__abstract_linkable_16AbstractLinkable_10_notify_links(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_19__abstract_linkable_16AbstractLinkable_3hub___get__(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *__pyx_v_self); /* proto */ +static PyObject *__pyx_tp_new_6gevent_19__abstract_linkable_AbstractLinkable(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_k_; +static PyObject *__pyx_tuple__2; +static PyObject *__pyx_tuple__3; +static PyObject *__pyx_tuple__4; +static PyObject *__pyx_tuple__5; +static PyObject *__pyx_tuple__7; +static PyObject *__pyx_tuple__9; +static PyObject *__pyx_tuple__11; +static PyObject *__pyx_tuple__13; +static PyObject *__pyx_codeobj__6; +static PyObject *__pyx_codeobj__8; +static PyObject *__pyx_codeobj__10; +static PyObject *__pyx_codeobj__12; +static PyObject *__pyx_codeobj__14; +/* Late includes */ + +/* "src/gevent/_abstract_linkable.py":19 + * + * locals()['getcurrent'] = __import__('greenlet').getcurrent + * locals()['greenlet_init'] = lambda: None # <<<<<<<<<<<<<< + * + * __all__ = [ + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_19__abstract_linkable_lambda(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyMethodDef __pyx_mdef_6gevent_19__abstract_linkable_lambda = {"lambda", (PyCFunction)__pyx_pw_6gevent_19__abstract_linkable_lambda, METH_NOARGS, 0}; +static PyObject *__pyx_pw_6gevent_19__abstract_linkable_lambda(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("lambda (wrapper)", 0); + __pyx_r = __pyx_lambda_funcdef_6gevent_19__abstract_linkable_lambda(__pyx_self); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_lambda_funcdef_6gevent_19__abstract_linkable_lambda(CYTHON_UNUSED PyObject *__pyx_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("lambda", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_abstract_linkable.py":32 + * __slots__ = ('hub', '_links', '_notifier', '_notify_all', '__weakref__') + * + * def __init__(self): # <<<<<<<<<<<<<< + * # Before this implementation, AsyncResult and Semaphore + * # maintained the order of notifications, but Event did not. + */ + +/* Python wrapper */ +static int __pyx_pw_6gevent_19__abstract_linkable_16AbstractLinkable_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6gevent_19__abstract_linkable_16AbstractLinkable_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { + __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;} + if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1; + __pyx_r = __pyx_pf_6gevent_19__abstract_linkable_16AbstractLinkable___init__(((struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_19__abstract_linkable_16AbstractLinkable___init__(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "src/gevent/_abstract_linkable.py":62 + * # CPython ("No attribute...") + * # See https://github.com/gevent/gevent/issues/660 + * self._links = set() # <<<<<<<<<<<<<< + * self._notifier = None + * # This is conceptually a class attribute, defined here for ease of access in + */ + __pyx_t_1 = PySet_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 62, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_self->_links); + __Pyx_DECREF(__pyx_v_self->_links); + __pyx_v_self->_links = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "src/gevent/_abstract_linkable.py":63 + * # See https://github.com/gevent/gevent/issues/660 + * self._links = set() + * self._notifier = None # <<<<<<<<<<<<<< + * # This is conceptually a class attribute, defined here for ease of access in + * # cython. If it's true, when notifiers fire, all existing callbacks are called. + */ + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->_notifier); + __Pyx_DECREF(__pyx_v_self->_notifier); + __pyx_v_self->_notifier = Py_None; + + /* "src/gevent/_abstract_linkable.py":67 + * # cython. If it's true, when notifiers fire, all existing callbacks are called. + * # If its false, we only call callbacks as long as ready() returns true. + * self._notify_all = True # <<<<<<<<<<<<<< + * # we don't want to do get_hub() here to allow defining module-level objects + * # without initializing the hub + */ + __pyx_v_self->_notify_all = 1; + + /* "src/gevent/_abstract_linkable.py":70 + * # we don't want to do get_hub() here to allow defining module-level objects + * # without initializing the hub + * self.hub = None # <<<<<<<<<<<<<< + * + * def linkcount(self): + */ + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->hub); + __Pyx_DECREF(((PyObject *)__pyx_v_self->hub)); + __pyx_v_self->hub = ((struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *)Py_None); + + /* "src/gevent/_abstract_linkable.py":32 + * __slots__ = ('hub', '_links', '_notifier', '_notify_all', '__weakref__') + * + * def __init__(self): # <<<<<<<<<<<<<< + * # Before this implementation, AsyncResult and Semaphore + * # maintained the order of notifications, but Event did not. + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__abstract_linkable.AbstractLinkable.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_abstract_linkable.py":72 + * self.hub = None + * + * def linkcount(self): # <<<<<<<<<<<<<< + * # For testing: how many objects are linked to this one? + * return len(self._links) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_19__abstract_linkable_16AbstractLinkable_3linkcount(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6gevent_19__abstract_linkable_16AbstractLinkable_2linkcount[] = "AbstractLinkable.linkcount(self)"; +static PyMethodDef __pyx_mdef_6gevent_19__abstract_linkable_16AbstractLinkable_3linkcount = {"linkcount", (PyCFunction)__pyx_pw_6gevent_19__abstract_linkable_16AbstractLinkable_3linkcount, METH_NOARGS, __pyx_doc_6gevent_19__abstract_linkable_16AbstractLinkable_2linkcount}; +static PyObject *__pyx_pw_6gevent_19__abstract_linkable_16AbstractLinkable_3linkcount(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("linkcount (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_19__abstract_linkable_16AbstractLinkable_2linkcount(((struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_19__abstract_linkable_16AbstractLinkable_2linkcount(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + __Pyx_RefNannySetupContext("linkcount", 0); + + /* "src/gevent/_abstract_linkable.py":74 + * def linkcount(self): + * # For testing: how many objects are linked to this one? + * return len(self._links) # <<<<<<<<<<<<<< + * + * def ready(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_v_self->_links; + __Pyx_INCREF(__pyx_t_1); + if (unlikely(__pyx_t_1 == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + __PYX_ERR(0, 74, __pyx_L1_error) + } + __pyx_t_2 = PySet_GET_SIZE(__pyx_t_1); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 74, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 74, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "src/gevent/_abstract_linkable.py":72 + * self.hub = None + * + * def linkcount(self): # <<<<<<<<<<<<<< + * # For testing: how many objects are linked to this one? + * return len(self._links) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__abstract_linkable.AbstractLinkable.linkcount", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_abstract_linkable.py":76 + * return len(self._links) + * + * def ready(self): # <<<<<<<<<<<<<< + * # Instances must define this + * raise NotImplementedError + */ + +static PyObject *__pyx_pw_6gevent_19__abstract_linkable_16AbstractLinkable_5ready(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static int __pyx_f_6gevent_19__abstract_linkable_16AbstractLinkable_ready(CYTHON_UNUSED struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *__pyx_v_self, int __pyx_skip_dispatch) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + __Pyx_RefNannySetupContext("ready", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0; + if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self)))))); + else { + PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + #endif + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_ready); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 76, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_19__abstract_linkable_16AbstractLinkable_5ready)) { + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 76, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 76, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_5; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0; + if (unlikely(type_dict_guard != tp_dict_version)) { + tp_dict_version = obj_dict_version = 0; + } + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + } + #endif + } + + /* "src/gevent/_abstract_linkable.py":78 + * def ready(self): + * # Instances must define this + * raise NotImplementedError # <<<<<<<<<<<<<< + * + * def _check_and_notify(self): + */ + __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0); + __PYX_ERR(0, 78, __pyx_L1_error) + + /* "src/gevent/_abstract_linkable.py":76 + * return len(self._links) + * + * def ready(self): # <<<<<<<<<<<<<< + * # Instances must define this + * raise NotImplementedError + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_WriteUnraisable("gevent.__abstract_linkable.AbstractLinkable.ready", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_19__abstract_linkable_16AbstractLinkable_5ready(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6gevent_19__abstract_linkable_16AbstractLinkable_4ready[] = "AbstractLinkable.ready(self) -> bool"; +static PyMethodDef __pyx_mdef_6gevent_19__abstract_linkable_16AbstractLinkable_5ready = {"ready", (PyCFunction)__pyx_pw_6gevent_19__abstract_linkable_16AbstractLinkable_5ready, METH_NOARGS, __pyx_doc_6gevent_19__abstract_linkable_16AbstractLinkable_4ready}; +static PyObject *__pyx_pw_6gevent_19__abstract_linkable_16AbstractLinkable_5ready(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("ready (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_19__abstract_linkable_16AbstractLinkable_4ready(((struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_19__abstract_linkable_16AbstractLinkable_4ready(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("ready", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_f_6gevent_19__abstract_linkable_16AbstractLinkable_ready(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 76, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__abstract_linkable.AbstractLinkable.ready", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_abstract_linkable.py":80 + * raise NotImplementedError + * + * def _check_and_notify(self): # <<<<<<<<<<<<<< + * # If this object is ready to be notified, begin the process. + * if self.ready() and self._links and not self._notifier: + */ + +static PyObject *__pyx_f_6gevent_19__abstract_linkable_16AbstractLinkable__check_and_notify(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + __Pyx_RefNannySetupContext("_check_and_notify", 0); + + /* "src/gevent/_abstract_linkable.py":82 + * def _check_and_notify(self): + * # If this object is ready to be notified, begin the process. + * if self.ready() and self._links and not self._notifier: # <<<<<<<<<<<<<< + * if self.hub is None: + * self.hub = get_hub() + */ + __pyx_t_2 = (((struct __pyx_vtabstruct_6gevent_19__abstract_linkable_AbstractLinkable *)__pyx_v_self->__pyx_vtab)->ready(__pyx_v_self, 0) != 0); + if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_2 = (__pyx_v_self->_links != Py_None)&&(PySet_GET_SIZE(__pyx_v_self->_links) != 0); + if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_self->_notifier); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 82, __pyx_L1_error) + __pyx_t_3 = ((!__pyx_t_2) != 0); + __pyx_t_1 = __pyx_t_3; + __pyx_L4_bool_binop_done:; + if (__pyx_t_1) { + + /* "src/gevent/_abstract_linkable.py":83 + * # If this object is ready to be notified, begin the process. + * if self.ready() and self._links and not self._notifier: + * if self.hub is None: # <<<<<<<<<<<<<< + * self.hub = get_hub() + * + */ + __pyx_t_1 = (((PyObject *)__pyx_v_self->hub) == Py_None); + __pyx_t_3 = (__pyx_t_1 != 0); + if (__pyx_t_3) { + + /* "src/gevent/_abstract_linkable.py":84 + * if self.ready() and self._links and not self._notifier: + * if self.hub is None: + * self.hub = get_hub() # <<<<<<<<<<<<<< + * + * self._notifier = self.hub.loop.run_callback(self._notify_links) + */ + __pyx_t_4 = ((PyObject *)__pyx_f_6gevent_11__hub_local_get_hub_noargs(0)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 84, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_v_self->hub); + __Pyx_DECREF(((PyObject *)__pyx_v_self->hub)); + __pyx_v_self->hub = ((struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *)__pyx_t_4); + __pyx_t_4 = 0; + + /* "src/gevent/_abstract_linkable.py":83 + * # If this object is ready to be notified, begin the process. + * if self.ready() and self._links and not self._notifier: + * if self.hub is None: # <<<<<<<<<<<<<< + * self.hub = get_hub() + * + */ + } + + /* "src/gevent/_abstract_linkable.py":86 + * self.hub = get_hub() + * + * self._notifier = self.hub.loop.run_callback(self._notify_links) # <<<<<<<<<<<<<< + * + * def rawlink(self, callback): + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->hub->loop, __pyx_n_s_run_callback); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 86, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_notify_links); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 86, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5); + if (likely(__pyx_t_7)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_7); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_5, function); + } + } + __pyx_t_4 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_7, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 86, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GIVEREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_v_self->_notifier); + __Pyx_DECREF(__pyx_v_self->_notifier); + __pyx_v_self->_notifier = __pyx_t_4; + __pyx_t_4 = 0; + + /* "src/gevent/_abstract_linkable.py":82 + * def _check_and_notify(self): + * # If this object is ready to be notified, begin the process. + * if self.ready() and self._links and not self._notifier: # <<<<<<<<<<<<<< + * if self.hub is None: + * self.hub = get_hub() + */ + } + + /* "src/gevent/_abstract_linkable.py":80 + * raise NotImplementedError + * + * def _check_and_notify(self): # <<<<<<<<<<<<<< + * # If this object is ready to be notified, begin the process. + * if self.ready() and self._links and not self._notifier: + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("gevent.__abstract_linkable.AbstractLinkable._check_and_notify", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_abstract_linkable.py":88 + * self._notifier = self.hub.loop.run_callback(self._notify_links) + * + * def rawlink(self, callback): # <<<<<<<<<<<<<< + * """ + * Register a callback to call when this object is ready. + */ + +static PyObject *__pyx_pw_6gevent_19__abstract_linkable_16AbstractLinkable_7rawlink(PyObject *__pyx_v_self, PyObject *__pyx_v_callback); /*proto*/ +static PyObject *__pyx_f_6gevent_19__abstract_linkable_16AbstractLinkable_rawlink(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *__pyx_v_self, PyObject *__pyx_v_callback, int __pyx_skip_dispatch) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + int __pyx_t_6; + int __pyx_t_7; + __Pyx_RefNannySetupContext("rawlink", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0; + if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self)))))); + else { + PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + #endif + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_rawlink); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 88, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_19__abstract_linkable_16AbstractLinkable_7rawlink)) { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_callback) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_callback); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 88, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0; + if (unlikely(type_dict_guard != tp_dict_version)) { + tp_dict_version = obj_dict_version = 0; + } + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + } + #endif + } + + /* "src/gevent/_abstract_linkable.py":96 + * *callback* will be passed one argument: this instance. + * """ + * if not callable(callback): # <<<<<<<<<<<<<< + * raise TypeError('Expected callable: %r' % (callback, )) + * + */ + __pyx_t_5 = __Pyx_PyCallable_Check(__pyx_v_callback); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 96, __pyx_L1_error) + __pyx_t_6 = ((!(__pyx_t_5 != 0)) != 0); + if (unlikely(__pyx_t_6)) { + + /* "src/gevent/_abstract_linkable.py":97 + * """ + * if not callable(callback): + * raise TypeError('Expected callable: %r' % (callback, )) # <<<<<<<<<<<<<< + * + * self._links.add(callback) + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 97, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_callback); + __Pyx_GIVEREF(__pyx_v_callback); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_callback); + __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_Expected_callable_r, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 97, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 97, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 97, __pyx_L1_error) + + /* "src/gevent/_abstract_linkable.py":96 + * *callback* will be passed one argument: this instance. + * """ + * if not callable(callback): # <<<<<<<<<<<<<< + * raise TypeError('Expected callable: %r' % (callback, )) + * + */ + } + + /* "src/gevent/_abstract_linkable.py":99 + * raise TypeError('Expected callable: %r' % (callback, )) + * + * self._links.add(callback) # <<<<<<<<<<<<<< + * self._check_and_notify() + * + */ + if (unlikely(__pyx_v_self->_links == Py_None)) { + PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "add"); + __PYX_ERR(0, 99, __pyx_L1_error) + } + __pyx_t_7 = PySet_Add(__pyx_v_self->_links, __pyx_v_callback); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 99, __pyx_L1_error) + + /* "src/gevent/_abstract_linkable.py":100 + * + * self._links.add(callback) + * self._check_and_notify() # <<<<<<<<<<<<<< + * + * def unlink(self, callback): + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_19__abstract_linkable_AbstractLinkable *)__pyx_v_self->__pyx_vtab)->_check_and_notify(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 100, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_abstract_linkable.py":88 + * self._notifier = self.hub.loop.run_callback(self._notify_links) + * + * def rawlink(self, callback): # <<<<<<<<<<<<<< + * """ + * Register a callback to call when this object is ready. + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("gevent.__abstract_linkable.AbstractLinkable.rawlink", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_19__abstract_linkable_16AbstractLinkable_7rawlink(PyObject *__pyx_v_self, PyObject *__pyx_v_callback); /*proto*/ +static char __pyx_doc_6gevent_19__abstract_linkable_16AbstractLinkable_6rawlink[] = "AbstractLinkable.rawlink(self, callback)\n\n Register a callback to call when this object is ready.\n\n *callback* will be called in the :class:`Hub\n `, so it must not use blocking gevent API.\n *callback* will be passed one argument: this instance.\n "; +static PyMethodDef __pyx_mdef_6gevent_19__abstract_linkable_16AbstractLinkable_7rawlink = {"rawlink", (PyCFunction)__pyx_pw_6gevent_19__abstract_linkable_16AbstractLinkable_7rawlink, METH_O, __pyx_doc_6gevent_19__abstract_linkable_16AbstractLinkable_6rawlink}; +static PyObject *__pyx_pw_6gevent_19__abstract_linkable_16AbstractLinkable_7rawlink(PyObject *__pyx_v_self, PyObject *__pyx_v_callback) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("rawlink (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_19__abstract_linkable_16AbstractLinkable_6rawlink(((struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *)__pyx_v_self), ((PyObject *)__pyx_v_callback)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_19__abstract_linkable_16AbstractLinkable_6rawlink(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *__pyx_v_self, PyObject *__pyx_v_callback) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("rawlink", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6gevent_19__abstract_linkable_16AbstractLinkable_rawlink(__pyx_v_self, __pyx_v_callback, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 88, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__abstract_linkable.AbstractLinkable.rawlink", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_abstract_linkable.py":102 + * self._check_and_notify() + * + * def unlink(self, callback): # <<<<<<<<<<<<<< + * """Remove the callback set by :meth:`rawlink`""" + * self._links.discard(callback) + */ + +static PyObject *__pyx_pw_6gevent_19__abstract_linkable_16AbstractLinkable_9unlink(PyObject *__pyx_v_self, PyObject *__pyx_v_callback); /*proto*/ +static PyObject *__pyx_f_6gevent_19__abstract_linkable_16AbstractLinkable_unlink(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *__pyx_v_self, PyObject *__pyx_v_callback, int __pyx_skip_dispatch) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + int __pyx_t_6; + int __pyx_t_7; + int __pyx_t_8; + __Pyx_RefNannySetupContext("unlink", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0; + if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self)))))); + else { + PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + #endif + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_unlink); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 102, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_19__abstract_linkable_16AbstractLinkable_9unlink)) { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_callback) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_callback); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 102, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0; + if (unlikely(type_dict_guard != tp_dict_version)) { + tp_dict_version = obj_dict_version = 0; + } + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + } + #endif + } + + /* "src/gevent/_abstract_linkable.py":104 + * def unlink(self, callback): + * """Remove the callback set by :meth:`rawlink`""" + * self._links.discard(callback) # <<<<<<<<<<<<<< + * + * if not self._links and self._notifier is not None: + */ + if (unlikely(__pyx_v_self->_links == Py_None)) { + PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "discard"); + __PYX_ERR(0, 104, __pyx_L1_error) + } + __pyx_t_5 = __Pyx_PySet_Discard(__pyx_v_self->_links, __pyx_v_callback); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 104, __pyx_L1_error) + + /* "src/gevent/_abstract_linkable.py":106 + * self._links.discard(callback) + * + * if not self._links and self._notifier is not None: # <<<<<<<<<<<<<< + * # If we currently have one queued, de-queue it. + * # This will break a reference cycle. + */ + __pyx_t_7 = (__pyx_v_self->_links != Py_None)&&(PySet_GET_SIZE(__pyx_v_self->_links) != 0); + __pyx_t_8 = ((!__pyx_t_7) != 0); + if (__pyx_t_8) { + } else { + __pyx_t_6 = __pyx_t_8; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_8 = (__pyx_v_self->_notifier != Py_None); + __pyx_t_7 = (__pyx_t_8 != 0); + __pyx_t_6 = __pyx_t_7; + __pyx_L4_bool_binop_done:; + if (__pyx_t_6) { + + /* "src/gevent/_abstract_linkable.py":111 + * # (self._notifier -> self._notify_links -> self) + * # But we can't set it to None in case it was actually running. + * self._notifier.stop() # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_notifier, __pyx_n_s_stop); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 111, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 111, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_abstract_linkable.py":106 + * self._links.discard(callback) + * + * if not self._links and self._notifier is not None: # <<<<<<<<<<<<<< + * # If we currently have one queued, de-queue it. + * # This will break a reference cycle. + */ + } + + /* "src/gevent/_abstract_linkable.py":102 + * self._check_and_notify() + * + * def unlink(self, callback): # <<<<<<<<<<<<<< + * """Remove the callback set by :meth:`rawlink`""" + * self._links.discard(callback) + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("gevent.__abstract_linkable.AbstractLinkable.unlink", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_19__abstract_linkable_16AbstractLinkable_9unlink(PyObject *__pyx_v_self, PyObject *__pyx_v_callback); /*proto*/ +static char __pyx_doc_6gevent_19__abstract_linkable_16AbstractLinkable_8unlink[] = "AbstractLinkable.unlink(self, callback)\nRemove the callback set by :meth:`rawlink`"; +static PyMethodDef __pyx_mdef_6gevent_19__abstract_linkable_16AbstractLinkable_9unlink = {"unlink", (PyCFunction)__pyx_pw_6gevent_19__abstract_linkable_16AbstractLinkable_9unlink, METH_O, __pyx_doc_6gevent_19__abstract_linkable_16AbstractLinkable_8unlink}; +static PyObject *__pyx_pw_6gevent_19__abstract_linkable_16AbstractLinkable_9unlink(PyObject *__pyx_v_self, PyObject *__pyx_v_callback) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("unlink (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_19__abstract_linkable_16AbstractLinkable_8unlink(((struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *)__pyx_v_self), ((PyObject *)__pyx_v_callback)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_19__abstract_linkable_16AbstractLinkable_8unlink(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *__pyx_v_self, PyObject *__pyx_v_callback) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("unlink", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6gevent_19__abstract_linkable_16AbstractLinkable_unlink(__pyx_v_self, __pyx_v_callback, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 102, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__abstract_linkable.AbstractLinkable.unlink", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_abstract_linkable.py":114 + * + * + * def _notify_links(self): # <<<<<<<<<<<<<< + * # We release self._notifier here. We are called by it + * # at the end of the loop, and it is now false in a boolean way (as soon + */ + +static PyObject *__pyx_pw_6gevent_19__abstract_linkable_16AbstractLinkable_11_notify_links(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_f_6gevent_19__abstract_linkable_16AbstractLinkable__notify_links(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *__pyx_v_self, int __pyx_skip_dispatch) { + PyObject *__pyx_v_notifier = NULL; + PyObject *__pyx_v_todo = NULL; + PyObject *__pyx_v_link = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + Py_ssize_t __pyx_t_5; + Py_ssize_t __pyx_t_6; + int __pyx_t_7; + int __pyx_t_8; + int __pyx_t_9; + int __pyx_t_10; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + PyObject *__pyx_t_14 = NULL; + PyObject *__pyx_t_15 = NULL; + PyObject *__pyx_t_16 = NULL; + PyObject *__pyx_t_17 = NULL; + PyObject *__pyx_t_18 = NULL; + int __pyx_t_19; + char const *__pyx_t_20; + PyObject *__pyx_t_21 = NULL; + PyObject *__pyx_t_22 = NULL; + PyObject *__pyx_t_23 = NULL; + char const *__pyx_t_24; + __Pyx_RefNannySetupContext("_notify_links", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0; + if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self)))))); + else { + PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + #endif + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_notify_links); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 114, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_19__abstract_linkable_16AbstractLinkable_11_notify_links)) { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 114, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0; + if (unlikely(type_dict_guard != tp_dict_version)) { + tp_dict_version = obj_dict_version = 0; + } + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + } + #endif + } + + /* "src/gevent/_abstract_linkable.py":118 + * # at the end of the loop, and it is now false in a boolean way (as soon + * # as this method returns). + * notifier = self._notifier # <<<<<<<<<<<<<< + * # We were ready() at the time this callback was scheduled; + * # we may not be anymore, and that status may change during + */ + __pyx_t_1 = __pyx_v_self->_notifier; + __Pyx_INCREF(__pyx_t_1); + __pyx_v_notifier = __pyx_t_1; + __pyx_t_1 = 0; + + /* "src/gevent/_abstract_linkable.py":124 + * # notify everyone that the status was once true, even though not it + * # may not be anymore. + * todo = set(self._links) # <<<<<<<<<<<<<< + * try: + * for link in todo: + */ + __pyx_t_1 = PySet_New(__pyx_v_self->_links); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 124, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_todo = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "src/gevent/_abstract_linkable.py":125 + * # may not be anymore. + * todo = set(self._links) + * try: # <<<<<<<<<<<<<< + * for link in todo: + * if not self._notify_all and not self.ready(): + */ + /*try:*/ { + + /* "src/gevent/_abstract_linkable.py":126 + * todo = set(self._links) + * try: + * for link in todo: # <<<<<<<<<<<<<< + * if not self._notify_all and not self.ready(): + * break + */ + __pyx_t_5 = 0; + __pyx_t_2 = __Pyx_set_iterator(__pyx_v_todo, 1, (&__pyx_t_6), (&__pyx_t_7)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 126, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_1); + __pyx_t_1 = __pyx_t_2; + __pyx_t_2 = 0; + while (1) { + __pyx_t_8 = __Pyx_set_iter_next(__pyx_t_1, __pyx_t_6, &__pyx_t_5, &__pyx_t_2, __pyx_t_7); + if (unlikely(__pyx_t_8 == 0)) break; + if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(0, 126, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_XDECREF_SET(__pyx_v_link, __pyx_t_2); + __pyx_t_2 = 0; + + /* "src/gevent/_abstract_linkable.py":127 + * try: + * for link in todo: + * if not self._notify_all and not self.ready(): # <<<<<<<<<<<<<< + * break + * + */ + __pyx_t_10 = ((!(__pyx_v_self->_notify_all != 0)) != 0); + if (__pyx_t_10) { + } else { + __pyx_t_9 = __pyx_t_10; + goto __pyx_L9_bool_binop_done; + } + __pyx_t_10 = ((!(((struct __pyx_vtabstruct_6gevent_19__abstract_linkable_AbstractLinkable *)__pyx_v_self->__pyx_vtab)->ready(__pyx_v_self, 0) != 0)) != 0); + __pyx_t_9 = __pyx_t_10; + __pyx_L9_bool_binop_done:; + if (__pyx_t_9) { + + /* "src/gevent/_abstract_linkable.py":128 + * for link in todo: + * if not self._notify_all and not self.ready(): + * break # <<<<<<<<<<<<<< + * + * if link not in self._links: + */ + goto __pyx_L7_break; + + /* "src/gevent/_abstract_linkable.py":127 + * try: + * for link in todo: + * if not self._notify_all and not self.ready(): # <<<<<<<<<<<<<< + * break + * + */ + } + + /* "src/gevent/_abstract_linkable.py":130 + * break + * + * if link not in self._links: # <<<<<<<<<<<<<< + * # Been removed already by some previous link. OK, fine. + * continue + */ + if (unlikely(__pyx_v_self->_links == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); + __PYX_ERR(0, 130, __pyx_L4_error) + } + __pyx_t_9 = (__Pyx_PySet_ContainsTF(__pyx_v_link, __pyx_v_self->_links, Py_NE)); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 130, __pyx_L4_error) + __pyx_t_10 = (__pyx_t_9 != 0); + if (__pyx_t_10) { + + /* "src/gevent/_abstract_linkable.py":132 + * if link not in self._links: + * # Been removed already by some previous link. OK, fine. + * continue # <<<<<<<<<<<<<< + * try: + * link(self) + */ + goto __pyx_L6_continue; + + /* "src/gevent/_abstract_linkable.py":130 + * break + * + * if link not in self._links: # <<<<<<<<<<<<<< + * # Been removed already by some previous link. OK, fine. + * continue + */ + } + + /* "src/gevent/_abstract_linkable.py":133 + * # Been removed already by some previous link. OK, fine. + * continue + * try: # <<<<<<<<<<<<<< + * link(self) + * except: # pylint:disable=bare-except + */ + /*try:*/ { + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13); + __Pyx_XGOTREF(__pyx_t_11); + __Pyx_XGOTREF(__pyx_t_12); + __Pyx_XGOTREF(__pyx_t_13); + /*try:*/ { + + /* "src/gevent/_abstract_linkable.py":134 + * continue + * try: + * link(self) # <<<<<<<<<<<<<< + * except: # pylint:disable=bare-except + * # We're running in the hub, so getcurrent() returns + */ + __Pyx_INCREF(__pyx_v_link); + __pyx_t_3 = __pyx_v_link; __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, ((PyObject *)__pyx_v_self)) : __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_self)); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 134, __pyx_L17_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/_abstract_linkable.py":133 + * # Been removed already by some previous link. OK, fine. + * continue + * try: # <<<<<<<<<<<<<< + * link(self) + * except: # pylint:disable=bare-except + */ + } + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; + goto __pyx_L24_try_end; + __pyx_L17_error:; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/_abstract_linkable.py":135 + * try: + * link(self) + * except: # pylint:disable=bare-except # <<<<<<<<<<<<<< + * # We're running in the hub, so getcurrent() returns + * # a hub. + */ + /*except:*/ { + __Pyx_AddTraceback("gevent.__abstract_linkable.AbstractLinkable._notify_links", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4) < 0) __PYX_ERR(0, 135, __pyx_L19_except_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GOTREF(__pyx_t_4); + + /* "src/gevent/_abstract_linkable.py":138 + * # We're running in the hub, so getcurrent() returns + * # a hub. + * self.hub.handle_error((link, self), *sys.exc_info()) # pylint:disable=undefined-variable # <<<<<<<<<<<<<< + * finally: + * if getattr(link, 'auto_unlink', None): + */ + __pyx_t_14 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->hub), __pyx_n_s_handle_error); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 138, __pyx_L19_except_error) + __Pyx_GOTREF(__pyx_t_14); + __pyx_t_15 = PyTuple_New(2); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 138, __pyx_L19_except_error) + __Pyx_GOTREF(__pyx_t_15); + __Pyx_INCREF(__pyx_v_link); + __Pyx_GIVEREF(__pyx_v_link); + PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_v_link); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_15, 1, ((PyObject *)__pyx_v_self)); + __pyx_t_16 = PyTuple_New(1); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 138, __pyx_L19_except_error) + __Pyx_GOTREF(__pyx_t_16); + __Pyx_GIVEREF(__pyx_t_15); + PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_15); + __pyx_t_15 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_17, __pyx_n_s_sys); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 138, __pyx_L19_except_error) + __Pyx_GOTREF(__pyx_t_17); + __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_t_17, __pyx_n_s_exc_info); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 138, __pyx_L19_except_error) + __Pyx_GOTREF(__pyx_t_18); + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + __pyx_t_17 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_18))) { + __pyx_t_17 = PyMethod_GET_SELF(__pyx_t_18); + if (likely(__pyx_t_17)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_18); + __Pyx_INCREF(__pyx_t_17); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_18, function); + } + } + __pyx_t_15 = (__pyx_t_17) ? __Pyx_PyObject_CallOneArg(__pyx_t_18, __pyx_t_17) : __Pyx_PyObject_CallNoArg(__pyx_t_18); + __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0; + if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 138, __pyx_L19_except_error) + __Pyx_GOTREF(__pyx_t_15); + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + __pyx_t_18 = __Pyx_PySequence_Tuple(__pyx_t_15); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 138, __pyx_L19_except_error) + __Pyx_GOTREF(__pyx_t_18); + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + __pyx_t_15 = PyNumber_Add(__pyx_t_16, __pyx_t_18); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 138, __pyx_L19_except_error) + __Pyx_GOTREF(__pyx_t_15); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + __pyx_t_18 = __Pyx_PyObject_Call(__pyx_t_14, __pyx_t_15, NULL); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 138, __pyx_L19_except_error) + __Pyx_GOTREF(__pyx_t_18); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L18_exception_handled; + } + __pyx_L19_except_error:; + + /* "src/gevent/_abstract_linkable.py":133 + * # Been removed already by some previous link. OK, fine. + * continue + * try: # <<<<<<<<<<<<<< + * link(self) + * except: # pylint:disable=bare-except + */ + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_XGIVEREF(__pyx_t_12); + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13); + goto __pyx_L15_error; + __pyx_L18_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_XGIVEREF(__pyx_t_12); + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13); + __pyx_L24_try_end:; + } + } + + /* "src/gevent/_abstract_linkable.py":140 + * self.hub.handle_error((link, self), *sys.exc_info()) # pylint:disable=undefined-variable + * finally: + * if getattr(link, 'auto_unlink', None): # <<<<<<<<<<<<<< + * # This attribute can avoid having to keep a reference to the function + * # *in* the function, which is a cycle + */ + /*finally:*/ { + /*normal exit:*/{ + __pyx_t_4 = __Pyx_GetAttr3(__pyx_v_link, __pyx_n_s_auto_unlink, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 140, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 140, __pyx_L4_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_10) { + + /* "src/gevent/_abstract_linkable.py":143 + * # This attribute can avoid having to keep a reference to the function + * # *in* the function, which is a cycle + * self.unlink(link) # <<<<<<<<<<<<<< + * finally: + * # We should not have created a new notifier even if callbacks + */ + __pyx_t_4 = ((struct __pyx_vtabstruct_6gevent_19__abstract_linkable_AbstractLinkable *)__pyx_v_self->__pyx_vtab)->unlink(__pyx_v_self, __pyx_v_link, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 143, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "src/gevent/_abstract_linkable.py":140 + * self.hub.handle_error((link, self), *sys.exc_info()) # pylint:disable=undefined-variable + * finally: + * if getattr(link, 'auto_unlink', None): # <<<<<<<<<<<<<< + * # This attribute can avoid having to keep a reference to the function + * # *in* the function, which is a cycle + */ + } + goto __pyx_L16; + } + __pyx_L15_error:; + /*exception exit:*/{ + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __pyx_t_13 = 0; __pyx_t_12 = 0; __pyx_t_11 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_t_23 = 0; + __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0; + __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; + __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; + __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_21, &__pyx_t_22, &__pyx_t_23); + if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_13, &__pyx_t_12, &__pyx_t_11) < 0)) __Pyx_ErrFetch(&__pyx_t_13, &__pyx_t_12, &__pyx_t_11); + __Pyx_XGOTREF(__pyx_t_13); + __Pyx_XGOTREF(__pyx_t_12); + __Pyx_XGOTREF(__pyx_t_11); + __Pyx_XGOTREF(__pyx_t_21); + __Pyx_XGOTREF(__pyx_t_22); + __Pyx_XGOTREF(__pyx_t_23); + __pyx_t_8 = __pyx_lineno; __pyx_t_19 = __pyx_clineno; __pyx_t_20 = __pyx_filename; + { + __pyx_t_4 = __Pyx_GetAttr3(__pyx_v_link, __pyx_n_s_auto_unlink, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 140, __pyx_L31_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 140, __pyx_L31_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_10) { + + /* "src/gevent/_abstract_linkable.py":143 + * # This attribute can avoid having to keep a reference to the function + * # *in* the function, which is a cycle + * self.unlink(link) # <<<<<<<<<<<<<< + * finally: + * # We should not have created a new notifier even if callbacks + */ + __pyx_t_4 = ((struct __pyx_vtabstruct_6gevent_19__abstract_linkable_AbstractLinkable *)__pyx_v_self->__pyx_vtab)->unlink(__pyx_v_self, __pyx_v_link, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 143, __pyx_L31_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "src/gevent/_abstract_linkable.py":140 + * self.hub.handle_error((link, self), *sys.exc_info()) # pylint:disable=undefined-variable + * finally: + * if getattr(link, 'auto_unlink', None): # <<<<<<<<<<<<<< + * # This attribute can avoid having to keep a reference to the function + * # *in* the function, which is a cycle + */ + } + } + if (PY_MAJOR_VERSION >= 3) { + __Pyx_XGIVEREF(__pyx_t_21); + __Pyx_XGIVEREF(__pyx_t_22); + __Pyx_XGIVEREF(__pyx_t_23); + __Pyx_ExceptionReset(__pyx_t_21, __pyx_t_22, __pyx_t_23); + } + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_XGIVEREF(__pyx_t_12); + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_ErrRestore(__pyx_t_13, __pyx_t_12, __pyx_t_11); + __pyx_t_13 = 0; __pyx_t_12 = 0; __pyx_t_11 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_t_23 = 0; + __pyx_lineno = __pyx_t_8; __pyx_clineno = __pyx_t_19; __pyx_filename = __pyx_t_20; + goto __pyx_L4_error; + __pyx_L31_error:; + if (PY_MAJOR_VERSION >= 3) { + __Pyx_XGIVEREF(__pyx_t_21); + __Pyx_XGIVEREF(__pyx_t_22); + __Pyx_XGIVEREF(__pyx_t_23); + __Pyx_ExceptionReset(__pyx_t_21, __pyx_t_22, __pyx_t_23); + } + __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_t_23 = 0; + goto __pyx_L4_error; + } + __pyx_L16:; + } + __pyx_L6_continue:; + } + __pyx_L7_break:; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + + /* "src/gevent/_abstract_linkable.py":148 + * # released us because we loop through *all* of our links on the + * # same callback while self._notifier is still true. + * assert self._notifier is notifier # <<<<<<<<<<<<<< + * self._notifier = None + * + */ + /*finally:*/ { + /*normal exit:*/{ + #ifndef CYTHON_WITHOUT_ASSERTIONS + if (unlikely(!Py_OptimizeFlag)) { + __pyx_t_10 = (__pyx_v_self->_notifier == __pyx_v_notifier); + if (unlikely(!(__pyx_t_10 != 0))) { + PyErr_SetNone(PyExc_AssertionError); + __PYX_ERR(0, 148, __pyx_L1_error) + } + } + #endif + + /* "src/gevent/_abstract_linkable.py":149 + * # same callback while self._notifier is still true. + * assert self._notifier is notifier + * self._notifier = None # <<<<<<<<<<<<<< + * + * # Our set of active links changed, and we were told to stop on the first + */ + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->_notifier); + __Pyx_DECREF(__pyx_v_self->_notifier); + __pyx_v_self->_notifier = Py_None; + goto __pyx_L5; + } + __pyx_L4_error:; + /*exception exit:*/{ + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __pyx_t_23 = 0; __pyx_t_22 = 0; __pyx_t_21 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; + __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0; + __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; + __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; + __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13); + if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_23, &__pyx_t_22, &__pyx_t_21) < 0)) __Pyx_ErrFetch(&__pyx_t_23, &__pyx_t_22, &__pyx_t_21); + __Pyx_XGOTREF(__pyx_t_23); + __Pyx_XGOTREF(__pyx_t_22); + __Pyx_XGOTREF(__pyx_t_21); + __Pyx_XGOTREF(__pyx_t_11); + __Pyx_XGOTREF(__pyx_t_12); + __Pyx_XGOTREF(__pyx_t_13); + __pyx_t_7 = __pyx_lineno; __pyx_t_19 = __pyx_clineno; __pyx_t_24 = __pyx_filename; + { + + /* "src/gevent/_abstract_linkable.py":148 + * # released us because we loop through *all* of our links on the + * # same callback while self._notifier is still true. + * assert self._notifier is notifier # <<<<<<<<<<<<<< + * self._notifier = None + * + */ + #ifndef CYTHON_WITHOUT_ASSERTIONS + if (unlikely(!Py_OptimizeFlag)) { + __pyx_t_10 = (__pyx_v_self->_notifier == __pyx_v_notifier); + if (unlikely(!(__pyx_t_10 != 0))) { + PyErr_SetNone(PyExc_AssertionError); + __PYX_ERR(0, 148, __pyx_L34_error) + } + } + #endif + + /* "src/gevent/_abstract_linkable.py":149 + * # same callback while self._notifier is still true. + * assert self._notifier is notifier + * self._notifier = None # <<<<<<<<<<<<<< + * + * # Our set of active links changed, and we were told to stop on the first + */ + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->_notifier); + __Pyx_DECREF(__pyx_v_self->_notifier); + __pyx_v_self->_notifier = Py_None; + } + if (PY_MAJOR_VERSION >= 3) { + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_XGIVEREF(__pyx_t_12); + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13); + } + __Pyx_XGIVEREF(__pyx_t_23); + __Pyx_XGIVEREF(__pyx_t_22); + __Pyx_XGIVEREF(__pyx_t_21); + __Pyx_ErrRestore(__pyx_t_23, __pyx_t_22, __pyx_t_21); + __pyx_t_23 = 0; __pyx_t_22 = 0; __pyx_t_21 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; + __pyx_lineno = __pyx_t_7; __pyx_clineno = __pyx_t_19; __pyx_filename = __pyx_t_24; + goto __pyx_L1_error; + __pyx_L34_error:; + if (PY_MAJOR_VERSION >= 3) { + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_XGIVEREF(__pyx_t_12); + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13); + } + __Pyx_XDECREF(__pyx_t_23); __pyx_t_23 = 0; + __Pyx_XDECREF(__pyx_t_22); __pyx_t_22 = 0; + __Pyx_XDECREF(__pyx_t_21); __pyx_t_21 = 0; + __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; + goto __pyx_L1_error; + } + __pyx_L5:; + } + + /* "src/gevent/_abstract_linkable.py":154 + * # time we went unready. See if we're ready, and if so, go around + * # again. + * if not self._notify_all and todo != self._links: # <<<<<<<<<<<<<< + * self._check_and_notify() + * + */ + __pyx_t_9 = ((!(__pyx_v_self->_notify_all != 0)) != 0); + if (__pyx_t_9) { + } else { + __pyx_t_10 = __pyx_t_9; + goto __pyx_L36_bool_binop_done; + } + __pyx_t_1 = PyObject_RichCompare(__pyx_v_todo, __pyx_v_self->_links, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 154, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 154, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_10 = __pyx_t_9; + __pyx_L36_bool_binop_done:; + if (__pyx_t_10) { + + /* "src/gevent/_abstract_linkable.py":155 + * # again. + * if not self._notify_all and todo != self._links: + * self._check_and_notify() # <<<<<<<<<<<<<< + * + * def _wait_core(self, timeout, catch=Timeout): + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_19__abstract_linkable_AbstractLinkable *)__pyx_v_self->__pyx_vtab)->_check_and_notify(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 155, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_abstract_linkable.py":154 + * # time we went unready. See if we're ready, and if so, go around + * # again. + * if not self._notify_all and todo != self._links: # <<<<<<<<<<<<<< + * self._check_and_notify() + * + */ + } + + /* "src/gevent/_abstract_linkable.py":114 + * + * + * def _notify_links(self): # <<<<<<<<<<<<<< + * # We release self._notifier here. We are called by it + * # at the end of the loop, and it is now false in a boolean way (as soon + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_14); + __Pyx_XDECREF(__pyx_t_15); + __Pyx_XDECREF(__pyx_t_16); + __Pyx_XDECREF(__pyx_t_17); + __Pyx_XDECREF(__pyx_t_18); + __Pyx_AddTraceback("gevent.__abstract_linkable.AbstractLinkable._notify_links", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_notifier); + __Pyx_XDECREF(__pyx_v_todo); + __Pyx_XDECREF(__pyx_v_link); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_19__abstract_linkable_16AbstractLinkable_11_notify_links(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6gevent_19__abstract_linkable_16AbstractLinkable_10_notify_links[] = "AbstractLinkable._notify_links(self)"; +static PyMethodDef __pyx_mdef_6gevent_19__abstract_linkable_16AbstractLinkable_11_notify_links = {"_notify_links", (PyCFunction)__pyx_pw_6gevent_19__abstract_linkable_16AbstractLinkable_11_notify_links, METH_NOARGS, __pyx_doc_6gevent_19__abstract_linkable_16AbstractLinkable_10_notify_links}; +static PyObject *__pyx_pw_6gevent_19__abstract_linkable_16AbstractLinkable_11_notify_links(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_notify_links (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_19__abstract_linkable_16AbstractLinkable_10_notify_links(((struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_19__abstract_linkable_16AbstractLinkable_10_notify_links(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("_notify_links", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6gevent_19__abstract_linkable_16AbstractLinkable__notify_links(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 114, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__abstract_linkable.AbstractLinkable._notify_links", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_abstract_linkable.py":157 + * self._check_and_notify() + * + * def _wait_core(self, timeout, catch=Timeout): # <<<<<<<<<<<<<< + * # The core of the wait implementation, handling + * # switching and linking. If *catch* is set to (), + */ + +static PyObject *__pyx_f_6gevent_19__abstract_linkable_16AbstractLinkable__wait_core(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *__pyx_v_self, PyObject *__pyx_v_timeout, struct __pyx_opt_args_6gevent_19__abstract_linkable_16AbstractLinkable__wait_core *__pyx_optional_args) { + PyObject *__pyx_v_catch = __pyx_k_; + PyObject *__pyx_v_switch = NULL; + PyObject *__pyx_v_timer = NULL; + PyObject *__pyx_v_result = NULL; + PyObject *__pyx_v_ex = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + int __pyx_t_12; + int __pyx_t_13; + int __pyx_t_14; + int __pyx_t_15; + char const *__pyx_t_16; + PyObject *__pyx_t_17 = NULL; + PyObject *__pyx_t_18 = NULL; + PyObject *__pyx_t_19 = NULL; + PyObject *__pyx_t_20 = NULL; + PyObject *__pyx_t_21 = NULL; + PyObject *__pyx_t_22 = NULL; + char const *__pyx_t_23; + __Pyx_RefNannySetupContext("_wait_core", 0); + if (__pyx_optional_args) { + if (__pyx_optional_args->__pyx_n > 0) { + __pyx_v_catch = __pyx_optional_args->catch; + } + } + + /* "src/gevent/_abstract_linkable.py":162 + * # a timeout that elapses will be allowed to be raised. + * # Returns a true value if the wait succeeded without timing out. + * switch = getcurrent().switch # pylint:disable=undefined-variable # <<<<<<<<<<<<<< + * self.rawlink(switch) + * try: + */ + __pyx_t_1 = ((PyObject *)__pyx_f_6gevent_19__abstract_linkable_getcurrent()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 162, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_switch); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 162, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_switch = __pyx_t_2; + __pyx_t_2 = 0; + + /* "src/gevent/_abstract_linkable.py":163 + * # Returns a true value if the wait succeeded without timing out. + * switch = getcurrent().switch # pylint:disable=undefined-variable + * self.rawlink(switch) # <<<<<<<<<<<<<< + * try: + * with Timeout._start_new_or_dummy(timeout) as timer: + */ + __pyx_t_2 = ((struct __pyx_vtabstruct_6gevent_19__abstract_linkable_AbstractLinkable *)__pyx_v_self->__pyx_vtab)->rawlink(__pyx_v_self, __pyx_v_switch, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 163, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/_abstract_linkable.py":164 + * switch = getcurrent().switch # pylint:disable=undefined-variable + * self.rawlink(switch) + * try: # <<<<<<<<<<<<<< + * with Timeout._start_new_or_dummy(timeout) as timer: + * try: + */ + /*try:*/ { + + /* "src/gevent/_abstract_linkable.py":165 + * self.rawlink(switch) + * try: + * with Timeout._start_new_or_dummy(timeout) as timer: # <<<<<<<<<<<<<< + * try: + * if self.hub is None: + */ + /*with:*/ { + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_6gevent_19__abstract_linkable_Timeout, __pyx_n_s_start_new_or_dummy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 165, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_1, function); + } + } + __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_3, __pyx_v_timeout) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_timeout); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 165, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_4 = __Pyx_PyObject_LookupSpecial(__pyx_t_2, __pyx_n_s_exit); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 165, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyObject_LookupSpecial(__pyx_t_2, __pyx_n_s_enter); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 165, __pyx_L6_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 165, __pyx_L6_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __pyx_t_1; + __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + /*try:*/ { + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); + __Pyx_XGOTREF(__pyx_t_6); + __Pyx_XGOTREF(__pyx_t_7); + __Pyx_XGOTREF(__pyx_t_8); + /*try:*/ { + __pyx_v_timer = __pyx_t_3; + __pyx_t_3 = 0; + + /* "src/gevent/_abstract_linkable.py":166 + * try: + * with Timeout._start_new_or_dummy(timeout) as timer: + * try: # <<<<<<<<<<<<<< + * if self.hub is None: + * self.hub = get_hub() + */ + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); + __Pyx_XGOTREF(__pyx_t_9); + __Pyx_XGOTREF(__pyx_t_10); + __Pyx_XGOTREF(__pyx_t_11); + /*try:*/ { + + /* "src/gevent/_abstract_linkable.py":167 + * with Timeout._start_new_or_dummy(timeout) as timer: + * try: + * if self.hub is None: # <<<<<<<<<<<<<< + * self.hub = get_hub() + * result = self.hub.switch() + */ + __pyx_t_12 = (((PyObject *)__pyx_v_self->hub) == Py_None); + __pyx_t_13 = (__pyx_t_12 != 0); + if (__pyx_t_13) { + + /* "src/gevent/_abstract_linkable.py":168 + * try: + * if self.hub is None: + * self.hub = get_hub() # <<<<<<<<<<<<<< + * result = self.hub.switch() + * if result is not self: # pragma: no cover + */ + __pyx_t_3 = ((PyObject *)__pyx_f_6gevent_11__hub_local_get_hub_noargs(0)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 168, __pyx_L16_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __Pyx_GOTREF(__pyx_v_self->hub); + __Pyx_DECREF(((PyObject *)__pyx_v_self->hub)); + __pyx_v_self->hub = ((struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *)__pyx_t_3); + __pyx_t_3 = 0; + + /* "src/gevent/_abstract_linkable.py":167 + * with Timeout._start_new_or_dummy(timeout) as timer: + * try: + * if self.hub is None: # <<<<<<<<<<<<<< + * self.hub = get_hub() + * result = self.hub.switch() + */ + } + + /* "src/gevent/_abstract_linkable.py":169 + * if self.hub is None: + * self.hub = get_hub() + * result = self.hub.switch() # <<<<<<<<<<<<<< + * if result is not self: # pragma: no cover + * raise InvalidSwitchError('Invalid switch into Event.wait(): %r' % (result, )) + */ + __pyx_t_3 = ((struct __pyx_vtabstruct_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *)__pyx_v_self->hub->__pyx_vtab)->__pyx_switch(__pyx_v_self->hub, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 169, __pyx_L16_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_v_result = __pyx_t_3; + __pyx_t_3 = 0; + + /* "src/gevent/_abstract_linkable.py":170 + * self.hub = get_hub() + * result = self.hub.switch() + * if result is not self: # pragma: no cover # <<<<<<<<<<<<<< + * raise InvalidSwitchError('Invalid switch into Event.wait(): %r' % (result, )) + * return True + */ + __pyx_t_13 = (__pyx_v_result != ((PyObject *)__pyx_v_self)); + __pyx_t_12 = (__pyx_t_13 != 0); + if (unlikely(__pyx_t_12)) { + + /* "src/gevent/_abstract_linkable.py":171 + * result = self.hub.switch() + * if result is not self: # pragma: no cover + * raise InvalidSwitchError('Invalid switch into Event.wait(): %r' % (result, )) # <<<<<<<<<<<<<< + * return True + * except catch as ex: + */ + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 171, __pyx_L16_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_result); + __Pyx_GIVEREF(__pyx_v_result); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_result); + __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_switch_into_Event_wait_r, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 171, __pyx_L16_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_INCREF(__pyx_v_6gevent_19__abstract_linkable_InvalidSwitchError); + __pyx_t_2 = __pyx_v_6gevent_19__abstract_linkable_InvalidSwitchError; __pyx_t_5 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_1) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_1); + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 171, __pyx_L16_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(0, 171, __pyx_L16_error) + + /* "src/gevent/_abstract_linkable.py":170 + * self.hub = get_hub() + * result = self.hub.switch() + * if result is not self: # pragma: no cover # <<<<<<<<<<<<<< + * raise InvalidSwitchError('Invalid switch into Event.wait(): %r' % (result, )) + * return True + */ + } + + /* "src/gevent/_abstract_linkable.py":172 + * if result is not self: # pragma: no cover + * raise InvalidSwitchError('Invalid switch into Event.wait(): %r' % (result, )) + * return True # <<<<<<<<<<<<<< + * except catch as ex: + * if ex is not timer: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; + goto __pyx_L20_try_return; + + /* "src/gevent/_abstract_linkable.py":166 + * try: + * with Timeout._start_new_or_dummy(timeout) as timer: + * try: # <<<<<<<<<<<<<< + * if self.hub is None: + * self.hub = get_hub() + */ + } + __pyx_L16_error:; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "src/gevent/_abstract_linkable.py":173 + * raise InvalidSwitchError('Invalid switch into Event.wait(): %r' % (result, )) + * return True + * except catch as ex: # <<<<<<<<<<<<<< + * if ex is not timer: + * raise + */ + __pyx_t_14 = __Pyx_PyErr_ExceptionMatches(__pyx_v_catch); + if (__pyx_t_14) { + __Pyx_AddTraceback("gevent.__abstract_linkable.AbstractLinkable._wait_core", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_2, &__pyx_t_1) < 0) __PYX_ERR(0, 173, __pyx_L18_except_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_t_2); + __pyx_v_ex = __pyx_t_2; + /*try:*/ { + + /* "src/gevent/_abstract_linkable.py":174 + * return True + * except catch as ex: + * if ex is not timer: # <<<<<<<<<<<<<< + * raise + * # test_set_and_clear and test_timeout in test_threading + */ + __pyx_t_12 = (__pyx_v_ex != __pyx_v_timer); + __pyx_t_13 = (__pyx_t_12 != 0); + if (unlikely(__pyx_t_13)) { + + /* "src/gevent/_abstract_linkable.py":175 + * except catch as ex: + * if ex is not timer: + * raise # <<<<<<<<<<<<<< + * # test_set_and_clear and test_timeout in test_threading + * # rely on the exact return values, not just truthish-ness + */ + __Pyx_GIVEREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_ErrRestoreWithState(__pyx_t_3, __pyx_t_2, __pyx_t_1); + __pyx_t_3 = 0; __pyx_t_2 = 0; __pyx_t_1 = 0; + __PYX_ERR(0, 175, __pyx_L29_error) + + /* "src/gevent/_abstract_linkable.py":174 + * return True + * except catch as ex: + * if ex is not timer: # <<<<<<<<<<<<<< + * raise + * # test_set_and_clear and test_timeout in test_threading + */ + } + + /* "src/gevent/_abstract_linkable.py":178 + * # test_set_and_clear and test_timeout in test_threading + * # rely on the exact return values, not just truthish-ness + * return False # <<<<<<<<<<<<<< + * finally: + * self.unlink(switch) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L28_return; + } + + /* "src/gevent/_abstract_linkable.py":173 + * raise InvalidSwitchError('Invalid switch into Event.wait(): %r' % (result, )) + * return True + * except catch as ex: # <<<<<<<<<<<<<< + * if ex is not timer: + * raise + */ + /*finally:*/ { + __pyx_L29_error:; + /*exception exit:*/{ + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22); + if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19) < 0)) __Pyx_ErrFetch(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19); + __Pyx_XGOTREF(__pyx_t_17); + __Pyx_XGOTREF(__pyx_t_18); + __Pyx_XGOTREF(__pyx_t_19); + __Pyx_XGOTREF(__pyx_t_20); + __Pyx_XGOTREF(__pyx_t_21); + __Pyx_XGOTREF(__pyx_t_22); + __pyx_t_14 = __pyx_lineno; __pyx_t_15 = __pyx_clineno; __pyx_t_16 = __pyx_filename; + { + __Pyx_DECREF(__pyx_v_ex); + __pyx_v_ex = NULL; + } + if (PY_MAJOR_VERSION >= 3) { + __Pyx_XGIVEREF(__pyx_t_20); + __Pyx_XGIVEREF(__pyx_t_21); + __Pyx_XGIVEREF(__pyx_t_22); + __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_21, __pyx_t_22); + } + __Pyx_XGIVEREF(__pyx_t_17); + __Pyx_XGIVEREF(__pyx_t_18); + __Pyx_XGIVEREF(__pyx_t_19); + __Pyx_ErrRestore(__pyx_t_17, __pyx_t_18, __pyx_t_19); + __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; + __pyx_lineno = __pyx_t_14; __pyx_clineno = __pyx_t_15; __pyx_filename = __pyx_t_16; + goto __pyx_L18_except_error; + } + __pyx_L28_return: { + __pyx_t_22 = __pyx_r; + __pyx_r = 0; + __Pyx_DECREF(__pyx_v_ex); + __pyx_v_ex = NULL; + __pyx_r = __pyx_t_22; + __pyx_t_22 = 0; + goto __pyx_L19_except_return; + } + } + } + goto __pyx_L18_except_error; + __pyx_L18_except_error:; + + /* "src/gevent/_abstract_linkable.py":166 + * try: + * with Timeout._start_new_or_dummy(timeout) as timer: + * try: # <<<<<<<<<<<<<< + * if self.hub is None: + * self.hub = get_hub() + */ + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11); + goto __pyx_L10_error; + __pyx_L20_try_return:; + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11); + goto __pyx_L14_try_return; + __pyx_L19_except_return:; + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11); + goto __pyx_L14_try_return; + } + + /* "src/gevent/_abstract_linkable.py":165 + * self.rawlink(switch) + * try: + * with Timeout._start_new_or_dummy(timeout) as timer: # <<<<<<<<<<<<<< + * try: + * if self.hub is None: + */ + } + __pyx_L10_error:; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + /*except:*/ { + __Pyx_AddTraceback("gevent.__abstract_linkable.AbstractLinkable._wait_core", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3) < 0) __PYX_ERR(0, 165, __pyx_L12_except_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyTuple_Pack(3, __pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 165, __pyx_L12_except_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 165, __pyx_L12_except_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_11); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + if (__pyx_t_13 < 0) __PYX_ERR(0, 165, __pyx_L12_except_error) + __pyx_t_12 = ((!(__pyx_t_13 != 0)) != 0); + if (__pyx_t_12) { + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ErrRestoreWithState(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_3 = 0; + __PYX_ERR(0, 165, __pyx_L12_except_error) + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L11_exception_handled; + } + __pyx_L12_except_error:; + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); + goto __pyx_L4_error; + __pyx_L14_try_return:; + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); + goto __pyx_L7_return; + __pyx_L11_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); + } + } + /*finally:*/ { + /*normal exit:*/{ + if (__pyx_t_4) { + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__2, NULL); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 165, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + } + goto __pyx_L9; + } + __pyx_L7_return: { + __pyx_t_8 = __pyx_r; + __pyx_r = 0; + if (__pyx_t_4) { + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__2, NULL); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 165, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } + __pyx_r = __pyx_t_8; + __pyx_t_8 = 0; + goto __pyx_L3_return; + } + __pyx_L9:; + } + goto __pyx_L39; + __pyx_L6_error:; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_error; + __pyx_L39:; + } + } + + /* "src/gevent/_abstract_linkable.py":180 + * return False + * finally: + * self.unlink(switch) # <<<<<<<<<<<<<< + * + * def _wait_return_value(self, waited, wait_success): + */ + /*finally:*/ { + /*normal exit:*/{ + __pyx_t_3 = ((struct __pyx_vtabstruct_6gevent_19__abstract_linkable_AbstractLinkable *)__pyx_v_self->__pyx_vtab)->unlink(__pyx_v_self, __pyx_v_switch, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 180, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L5; + } + __pyx_L4_error:; + /*exception exit:*/{ + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __pyx_t_4 = 0; __pyx_t_8 = 0; __pyx_t_7 = 0; __pyx_t_6 = 0; __pyx_t_11 = 0; __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_6, &__pyx_t_11, &__pyx_t_10); + if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_4, &__pyx_t_8, &__pyx_t_7) < 0)) __Pyx_ErrFetch(&__pyx_t_4, &__pyx_t_8, &__pyx_t_7); + __Pyx_XGOTREF(__pyx_t_4); + __Pyx_XGOTREF(__pyx_t_8); + __Pyx_XGOTREF(__pyx_t_7); + __Pyx_XGOTREF(__pyx_t_6); + __Pyx_XGOTREF(__pyx_t_11); + __Pyx_XGOTREF(__pyx_t_10); + __pyx_t_15 = __pyx_lineno; __pyx_t_14 = __pyx_clineno; __pyx_t_23 = __pyx_filename; + { + __pyx_t_3 = ((struct __pyx_vtabstruct_6gevent_19__abstract_linkable_AbstractLinkable *)__pyx_v_self->__pyx_vtab)->unlink(__pyx_v_self, __pyx_v_switch, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 180, __pyx_L41_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + if (PY_MAJOR_VERSION >= 3) { + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_11, __pyx_t_10); + } + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_ErrRestore(__pyx_t_4, __pyx_t_8, __pyx_t_7); + __pyx_t_4 = 0; __pyx_t_8 = 0; __pyx_t_7 = 0; __pyx_t_6 = 0; __pyx_t_11 = 0; __pyx_t_10 = 0; + __pyx_lineno = __pyx_t_15; __pyx_clineno = __pyx_t_14; __pyx_filename = __pyx_t_23; + goto __pyx_L1_error; + __pyx_L41_error:; + if (PY_MAJOR_VERSION >= 3) { + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_11, __pyx_t_10); + } + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_6 = 0; __pyx_t_11 = 0; __pyx_t_10 = 0; + goto __pyx_L1_error; + } + __pyx_L3_return: { + __pyx_t_10 = __pyx_r; + __pyx_r = 0; + __pyx_t_3 = ((struct __pyx_vtabstruct_6gevent_19__abstract_linkable_AbstractLinkable *)__pyx_v_self->__pyx_vtab)->unlink(__pyx_v_self, __pyx_v_switch, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 180, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_10; + __pyx_t_10 = 0; + goto __pyx_L0; + } + __pyx_L5:; + } + + /* "src/gevent/_abstract_linkable.py":157 + * self._check_and_notify() + * + * def _wait_core(self, timeout, catch=Timeout): # <<<<<<<<<<<<<< + * # The core of the wait implementation, handling + * # switching and linking. If *catch* is set to (), + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("gevent.__abstract_linkable.AbstractLinkable._wait_core", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_switch); + __Pyx_XDECREF(__pyx_v_timer); + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XDECREF(__pyx_v_ex); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_abstract_linkable.py":182 + * self.unlink(switch) + * + * def _wait_return_value(self, waited, wait_success): # <<<<<<<<<<<<<< + * # pylint:disable=unused-argument + * # Subclasses should override this to return a value from _wait. + */ + +static PyObject *__pyx_f_6gevent_19__abstract_linkable_16AbstractLinkable__wait_return_value(CYTHON_UNUSED struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_waited, CYTHON_UNUSED PyObject *__pyx_v_wait_success) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_wait_return_value", 0); + + /* "src/gevent/_abstract_linkable.py":186 + * # Subclasses should override this to return a value from _wait. + * # By default we return None. + * return None # pragma: no cover all extent subclasses override # <<<<<<<<<<<<<< + * + * def _wait(self, timeout=None): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + + /* "src/gevent/_abstract_linkable.py":182 + * self.unlink(switch) + * + * def _wait_return_value(self, waited, wait_success): # <<<<<<<<<<<<<< + * # pylint:disable=unused-argument + * # Subclasses should override this to return a value from _wait. + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_abstract_linkable.py":188 + * return None # pragma: no cover all extent subclasses override + * + * def _wait(self, timeout=None): # <<<<<<<<<<<<<< + * if self.ready(): + * return self._wait_return_value(False, False) + */ + +static PyObject *__pyx_f_6gevent_19__abstract_linkable_16AbstractLinkable__wait(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *__pyx_v_self, struct __pyx_opt_args_6gevent_19__abstract_linkable_16AbstractLinkable__wait *__pyx_optional_args) { + PyObject *__pyx_v_timeout = ((PyObject *)Py_None); + PyObject *__pyx_v_gotit = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("_wait", 0); + if (__pyx_optional_args) { + if (__pyx_optional_args->__pyx_n > 0) { + __pyx_v_timeout = __pyx_optional_args->timeout; + } + } + + /* "src/gevent/_abstract_linkable.py":189 + * + * def _wait(self, timeout=None): + * if self.ready(): # <<<<<<<<<<<<<< + * return self._wait_return_value(False, False) + * + */ + __pyx_t_1 = (((struct __pyx_vtabstruct_6gevent_19__abstract_linkable_AbstractLinkable *)__pyx_v_self->__pyx_vtab)->ready(__pyx_v_self, 0) != 0); + if (__pyx_t_1) { + + /* "src/gevent/_abstract_linkable.py":190 + * def _wait(self, timeout=None): + * if self.ready(): + * return self._wait_return_value(False, False) # <<<<<<<<<<<<<< + * + * gotit = self._wait_core(timeout) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = ((struct __pyx_vtabstruct_6gevent_19__abstract_linkable_AbstractLinkable *)__pyx_v_self->__pyx_vtab)->_wait_return_value(__pyx_v_self, Py_False, Py_False); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 190, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "src/gevent/_abstract_linkable.py":189 + * + * def _wait(self, timeout=None): + * if self.ready(): # <<<<<<<<<<<<<< + * return self._wait_return_value(False, False) + * + */ + } + + /* "src/gevent/_abstract_linkable.py":192 + * return self._wait_return_value(False, False) + * + * gotit = self._wait_core(timeout) # <<<<<<<<<<<<<< + * return self._wait_return_value(True, gotit) + * + */ + __pyx_t_2 = ((struct __pyx_vtabstruct_6gevent_19__abstract_linkable_AbstractLinkable *)__pyx_v_self->__pyx_vtab)->_wait_core(__pyx_v_self, __pyx_v_timeout, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 192, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_gotit = __pyx_t_2; + __pyx_t_2 = 0; + + /* "src/gevent/_abstract_linkable.py":193 + * + * gotit = self._wait_core(timeout) + * return self._wait_return_value(True, gotit) # <<<<<<<<<<<<<< + * + * def _init(): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = ((struct __pyx_vtabstruct_6gevent_19__abstract_linkable_AbstractLinkable *)__pyx_v_self->__pyx_vtab)->_wait_return_value(__pyx_v_self, Py_True, __pyx_v_gotit); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 193, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "src/gevent/_abstract_linkable.py":188 + * return None # pragma: no cover all extent subclasses override + * + * def _wait(self, timeout=None): # <<<<<<<<<<<<<< + * if self.ready(): + * return self._wait_return_value(False, False) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent.__abstract_linkable.AbstractLinkable._wait", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_gotit); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/__abstract_linkable.pxd":39 + * cdef object __weakref__ + * + * cdef readonly SwitchOutGreenletWithLoop hub # <<<<<<<<<<<<<< + * + * cdef _notifier + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_19__abstract_linkable_16AbstractLinkable_3hub_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_19__abstract_linkable_16AbstractLinkable_3hub_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_19__abstract_linkable_16AbstractLinkable_3hub___get__(((struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_19__abstract_linkable_16AbstractLinkable_3hub___get__(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_self->hub)); + __pyx_r = ((PyObject *)__pyx_v_self->hub); + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_abstract_linkable.py":195 + * return self._wait_return_value(True, gotit) + * + * def _init(): # <<<<<<<<<<<<<< + * greenlet_init() # pylint:disable=undefined-variable + * + */ + +static void __pyx_f_6gevent_19__abstract_linkable__init(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_init", 0); + + /* "src/gevent/_abstract_linkable.py":196 + * + * def _init(): + * greenlet_init() # pylint:disable=undefined-variable # <<<<<<<<<<<<<< + * + * _init() + */ + __pyx_f_6gevent_19__abstract_linkable_greenlet_init(); + + /* "src/gevent/_abstract_linkable.py":195 + * return self._wait_return_value(True, gotit) + * + * def _init(): # <<<<<<<<<<<<<< + * greenlet_init() # pylint:disable=undefined-variable + * + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "gevent/__greenlet_primitives.pxd":23 + * + * @cython.final + * cdef inline greenlet getcurrent(): # <<<<<<<<<<<<<< + * return PyGreenlet_GetCurrent() + * + */ + +static CYTHON_INLINE PyGreenlet *__pyx_f_6gevent_21__greenlet_primitives_getcurrent(void) { + PyGreenlet *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("getcurrent", 0); + + /* "gevent/__greenlet_primitives.pxd":24 + * @cython.final + * cdef inline greenlet getcurrent(): + * return PyGreenlet_GetCurrent() # <<<<<<<<<<<<<< + * + * cdef bint _greenlet_imported + */ + __Pyx_XDECREF(((PyObject *)__pyx_r)); + __pyx_t_1 = ((PyObject *)PyGreenlet_GetCurrent()); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 24, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = ((PyGreenlet *)__pyx_t_1); + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "gevent/__greenlet_primitives.pxd":23 + * + * @cython.final + * cdef inline greenlet getcurrent(): # <<<<<<<<<<<<<< + * return PyGreenlet_GetCurrent() + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__greenlet_primitives.getcurrent", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF((PyObject *)__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/__greenlet_primitives.pxd":28 + * cdef bint _greenlet_imported + * + * cdef inline void greenlet_init(): # <<<<<<<<<<<<<< + * global _greenlet_imported + * if not _greenlet_imported: + */ + +static CYTHON_INLINE void __pyx_f_6gevent_21__greenlet_primitives_greenlet_init(void) { + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("greenlet_init", 0); + + /* "gevent/__greenlet_primitives.pxd":30 + * cdef inline void greenlet_init(): + * global _greenlet_imported + * if not _greenlet_imported: # <<<<<<<<<<<<<< + * PyGreenlet_Import() + * _greenlet_imported = True + */ + __pyx_t_1 = ((!(__pyx_v_6gevent_21__greenlet_primitives__greenlet_imported != 0)) != 0); + if (__pyx_t_1) { + + /* "gevent/__greenlet_primitives.pxd":31 + * global _greenlet_imported + * if not _greenlet_imported: + * PyGreenlet_Import() # <<<<<<<<<<<<<< + * _greenlet_imported = True + * + */ + PyGreenlet_Import(); + + /* "gevent/__greenlet_primitives.pxd":32 + * if not _greenlet_imported: + * PyGreenlet_Import() + * _greenlet_imported = True # <<<<<<<<<<<<<< + * + * cdef inline object _greenlet_switch(greenlet self): + */ + __pyx_v_6gevent_21__greenlet_primitives__greenlet_imported = 1; + + /* "gevent/__greenlet_primitives.pxd":30 + * cdef inline void greenlet_init(): + * global _greenlet_imported + * if not _greenlet_imported: # <<<<<<<<<<<<<< + * PyGreenlet_Import() + * _greenlet_imported = True + */ + } + + /* "gevent/__greenlet_primitives.pxd":28 + * cdef bint _greenlet_imported + * + * cdef inline void greenlet_init(): # <<<<<<<<<<<<<< + * global _greenlet_imported + * if not _greenlet_imported: + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "gevent/__greenlet_primitives.pxd":34 + * _greenlet_imported = True + * + * cdef inline object _greenlet_switch(greenlet self): # <<<<<<<<<<<<<< + * return PyGreenlet_Switch(self, NULL, NULL) + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_6gevent_21__greenlet_primitives__greenlet_switch(PyGreenlet *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("_greenlet_switch", 0); + + /* "gevent/__greenlet_primitives.pxd":35 + * + * cdef inline object _greenlet_switch(greenlet self): + * return PyGreenlet_Switch(self, NULL, NULL) # <<<<<<<<<<<<<< + * + * cdef class TrackedRawGreenlet(greenlet): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyGreenlet_Switch(__pyx_v_self, NULL, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 35, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "gevent/__greenlet_primitives.pxd":34 + * _greenlet_imported = True + * + * cdef inline object _greenlet_switch(greenlet self): # <<<<<<<<<<<<<< + * return PyGreenlet_Switch(self, NULL, NULL) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__greenlet_primitives._greenlet_switch", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/__abstract_linkable.pxd":21 + * void PyGreenlet_Import() + * + * cdef inline greenlet getcurrent(): # <<<<<<<<<<<<<< + * return PyGreenlet_GetCurrent() + * + */ + +static CYTHON_INLINE PyGreenlet *__pyx_f_6gevent_19__abstract_linkable_getcurrent(void) { + PyGreenlet *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("getcurrent", 0); + + /* "gevent/__abstract_linkable.pxd":22 + * + * cdef inline greenlet getcurrent(): + * return PyGreenlet_GetCurrent() # <<<<<<<<<<<<<< + * + * cdef inline void greenlet_init(): + */ + __Pyx_XDECREF(((PyObject *)__pyx_r)); + __pyx_t_1 = ((PyObject *)PyGreenlet_GetCurrent()); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 22, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = ((PyGreenlet *)__pyx_t_1); + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "gevent/__abstract_linkable.pxd":21 + * void PyGreenlet_Import() + * + * cdef inline greenlet getcurrent(): # <<<<<<<<<<<<<< + * return PyGreenlet_GetCurrent() + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__abstract_linkable.getcurrent", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF((PyObject *)__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/__abstract_linkable.pxd":24 + * return PyGreenlet_GetCurrent() + * + * cdef inline void greenlet_init(): # <<<<<<<<<<<<<< + * global _greenlet_imported + * if not _greenlet_imported: + */ + +static CYTHON_INLINE void __pyx_f_6gevent_19__abstract_linkable_greenlet_init(void) { + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("greenlet_init", 0); + + /* "gevent/__abstract_linkable.pxd":26 + * cdef inline void greenlet_init(): + * global _greenlet_imported + * if not _greenlet_imported: # <<<<<<<<<<<<<< + * PyGreenlet_Import() + * _greenlet_imported = True + */ + __pyx_t_1 = ((!(__pyx_v_6gevent_19__abstract_linkable__greenlet_imported != 0)) != 0); + if (__pyx_t_1) { + + /* "gevent/__abstract_linkable.pxd":27 + * global _greenlet_imported + * if not _greenlet_imported: + * PyGreenlet_Import() # <<<<<<<<<<<<<< + * _greenlet_imported = True + * + */ + PyGreenlet_Import(); + + /* "gevent/__abstract_linkable.pxd":28 + * if not _greenlet_imported: + * PyGreenlet_Import() + * _greenlet_imported = True # <<<<<<<<<<<<<< + * + * cdef void _init() + */ + __pyx_v_6gevent_19__abstract_linkable__greenlet_imported = 1; + + /* "gevent/__abstract_linkable.pxd":26 + * cdef inline void greenlet_init(): + * global _greenlet_imported + * if not _greenlet_imported: # <<<<<<<<<<<<<< + * PyGreenlet_Import() + * _greenlet_imported = True + */ + } + + /* "gevent/__abstract_linkable.pxd":24 + * return PyGreenlet_GetCurrent() + * + * cdef inline void greenlet_init(): # <<<<<<<<<<<<<< + * global _greenlet_imported + * if not _greenlet_imported: + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} +static struct __pyx_vtabstruct_6gevent_19__abstract_linkable_AbstractLinkable __pyx_vtable_6gevent_19__abstract_linkable_AbstractLinkable; + +static PyObject *__pyx_tp_new_6gevent_19__abstract_linkable_AbstractLinkable(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *p; + PyObject *o; + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *)o); + p->__pyx_vtab = __pyx_vtabptr_6gevent_19__abstract_linkable_AbstractLinkable; + p->hub = ((struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *)Py_None); Py_INCREF(Py_None); + p->_notifier = Py_None; Py_INCREF(Py_None); + p->_links = ((PyObject*)Py_None); Py_INCREF(Py_None); + return o; +} + +static void __pyx_tp_dealloc_6gevent_19__abstract_linkable_AbstractLinkable(PyObject *o) { + struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *p = (struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *)o; + #if CYTHON_USE_TP_FINALIZE + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + PyObject_GC_UnTrack(o); + if (p->__weakref__) PyObject_ClearWeakRefs(o); + Py_CLEAR(p->hub); + Py_CLEAR(p->_notifier); + Py_CLEAR(p->_links); + (*Py_TYPE(o)->tp_free)(o); +} + +static int __pyx_tp_traverse_6gevent_19__abstract_linkable_AbstractLinkable(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *p = (struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *)o; + if (p->hub) { + e = (*v)(((PyObject *)p->hub), a); if (e) return e; + } + if (p->_notifier) { + e = (*v)(p->_notifier, a); if (e) return e; + } + if (p->_links) { + e = (*v)(p->_links, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_6gevent_19__abstract_linkable_AbstractLinkable(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *p = (struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *)o; + tmp = ((PyObject*)p->hub); + p->hub = ((struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->_notifier); + p->_notifier = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->_links); + p->_links = ((PyObject*)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyObject *__pyx_getprop_6gevent_19__abstract_linkable_16AbstractLinkable_hub(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_19__abstract_linkable_16AbstractLinkable_3hub_1__get__(o); +} + +static PyMethodDef __pyx_methods_6gevent_19__abstract_linkable_AbstractLinkable[] = { + {"linkcount", (PyCFunction)__pyx_pw_6gevent_19__abstract_linkable_16AbstractLinkable_3linkcount, METH_NOARGS, __pyx_doc_6gevent_19__abstract_linkable_16AbstractLinkable_2linkcount}, + {0, 0, 0, 0} +}; + +static struct PyGetSetDef __pyx_getsets_6gevent_19__abstract_linkable_AbstractLinkable[] = { + {(char *)"hub", __pyx_getprop_6gevent_19__abstract_linkable_16AbstractLinkable_hub, 0, (char *)0, 0}, + {0, 0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_6gevent_19__abstract_linkable_AbstractLinkable = { + PyVarObject_HEAD_INIT(0, 0) + "gevent.__abstract_linkable.AbstractLinkable", /*tp_name*/ + sizeof(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6gevent_19__abstract_linkable_AbstractLinkable, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + "AbstractLinkable()", /*tp_doc*/ + __pyx_tp_traverse_6gevent_19__abstract_linkable_AbstractLinkable, /*tp_traverse*/ + __pyx_tp_clear_6gevent_19__abstract_linkable_AbstractLinkable, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6gevent_19__abstract_linkable_AbstractLinkable, /*tp_methods*/ + 0, /*tp_members*/ + __pyx_getsets_6gevent_19__abstract_linkable_AbstractLinkable, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_pw_6gevent_19__abstract_linkable_16AbstractLinkable_1__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6gevent_19__abstract_linkable_AbstractLinkable, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static PyMethodDef __pyx_methods[] = { + {0, 0, 0, 0} +}; + +#if PY_MAJOR_VERSION >= 3 +#if CYTHON_PEP489_MULTI_PHASE_INIT +static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ +static int __pyx_pymod_exec___abstract_linkable(PyObject* module); /*proto*/ +static PyModuleDef_Slot __pyx_moduledef_slots[] = { + {Py_mod_create, (void*)__pyx_pymod_create}, + {Py_mod_exec, (void*)__pyx_pymod_exec___abstract_linkable}, + {0, NULL} +}; +#endif + +static struct PyModuleDef __pyx_moduledef = { + PyModuleDef_HEAD_INIT, + "__abstract_linkable", + __pyx_k_Internal_module_support_for_the, /* m_doc */ + #if CYTHON_PEP489_MULTI_PHASE_INIT + 0, /* m_size */ + #else + -1, /* m_size */ + #endif + __pyx_methods /* m_methods */, + #if CYTHON_PEP489_MULTI_PHASE_INIT + __pyx_moduledef_slots, /* m_slots */ + #else + NULL, /* m_reload */ + #endif + NULL, /* m_traverse */ + NULL, /* m_clear */ + NULL /* m_free */ +}; +#endif +#ifndef CYTHON_SMALL_CODE +#if defined(__clang__) + #define CYTHON_SMALL_CODE +#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) + #define CYTHON_SMALL_CODE __attribute__((cold)) +#else + #define CYTHON_SMALL_CODE +#endif +#endif + +static __Pyx_StringTabEntry __pyx_string_tab[] = { + {&__pyx_n_s_AbstractLinkable, __pyx_k_AbstractLinkable, sizeof(__pyx_k_AbstractLinkable), 0, 0, 1, 1}, + {&__pyx_n_s_AbstractLinkable__notify_links, __pyx_k_AbstractLinkable__notify_links, sizeof(__pyx_k_AbstractLinkable__notify_links), 0, 0, 1, 1}, + {&__pyx_n_s_AbstractLinkable_linkcount, __pyx_k_AbstractLinkable_linkcount, sizeof(__pyx_k_AbstractLinkable_linkcount), 0, 0, 1, 1}, + {&__pyx_n_s_AbstractLinkable_rawlink, __pyx_k_AbstractLinkable_rawlink, sizeof(__pyx_k_AbstractLinkable_rawlink), 0, 0, 1, 1}, + {&__pyx_n_s_AbstractLinkable_ready, __pyx_k_AbstractLinkable_ready, sizeof(__pyx_k_AbstractLinkable_ready), 0, 0, 1, 1}, + {&__pyx_n_s_AbstractLinkable_unlink, __pyx_k_AbstractLinkable_unlink, sizeof(__pyx_k_AbstractLinkable_unlink), 0, 0, 1, 1}, + {&__pyx_kp_s_Expected_callable_r, __pyx_k_Expected_callable_r, sizeof(__pyx_k_Expected_callable_r), 0, 0, 1, 0}, + {&__pyx_n_s_InvalidSwitchError, __pyx_k_InvalidSwitchError, sizeof(__pyx_k_InvalidSwitchError), 0, 0, 1, 1}, + {&__pyx_kp_s_Invalid_switch_into_Event_wait_r, __pyx_k_Invalid_switch_into_Event_wait_r, sizeof(__pyx_k_Invalid_switch_into_Event_wait_r), 0, 0, 1, 0}, + {&__pyx_n_s_NotImplementedError, __pyx_k_NotImplementedError, sizeof(__pyx_k_NotImplementedError), 0, 0, 1, 1}, + {&__pyx_n_s_Timeout, __pyx_k_Timeout, sizeof(__pyx_k_Timeout), 0, 0, 1, 1}, + {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1}, + {&__pyx_n_s_all, __pyx_k_all, sizeof(__pyx_k_all), 0, 0, 1, 1}, + {&__pyx_n_s_auto_unlink, __pyx_k_auto_unlink, sizeof(__pyx_k_auto_unlink), 0, 0, 1, 1}, + {&__pyx_n_s_callback, __pyx_k_callback, sizeof(__pyx_k_callback), 0, 0, 1, 1}, + {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, + {&__pyx_n_s_enter, __pyx_k_enter, sizeof(__pyx_k_enter), 0, 0, 1, 1}, + {&__pyx_n_s_exc_info, __pyx_k_exc_info, sizeof(__pyx_k_exc_info), 0, 0, 1, 1}, + {&__pyx_n_s_exit, __pyx_k_exit, sizeof(__pyx_k_exit), 0, 0, 1, 1}, + {&__pyx_n_s_get_hub_noargs, __pyx_k_get_hub_noargs, sizeof(__pyx_k_get_hub_noargs), 0, 0, 1, 1}, + {&__pyx_n_s_getcurrent, __pyx_k_getcurrent, sizeof(__pyx_k_getcurrent), 0, 0, 1, 1}, + {&__pyx_n_s_gevent___abstract_linkable, __pyx_k_gevent___abstract_linkable, sizeof(__pyx_k_gevent___abstract_linkable), 0, 0, 1, 1}, + {&__pyx_n_s_gevent__hub_local, __pyx_k_gevent__hub_local, sizeof(__pyx_k_gevent__hub_local), 0, 0, 1, 1}, + {&__pyx_n_s_gevent__util, __pyx_k_gevent__util, sizeof(__pyx_k_gevent__util), 0, 0, 1, 1}, + {&__pyx_n_s_gevent_exceptions, __pyx_k_gevent_exceptions, sizeof(__pyx_k_gevent_exceptions), 0, 0, 1, 1}, + {&__pyx_n_s_gevent_timeout, __pyx_k_gevent_timeout, sizeof(__pyx_k_gevent_timeout), 0, 0, 1, 1}, + {&__pyx_n_s_greenlet, __pyx_k_greenlet, sizeof(__pyx_k_greenlet), 0, 0, 1, 1}, + {&__pyx_n_s_greenlet_imported, __pyx_k_greenlet_imported, sizeof(__pyx_k_greenlet_imported), 0, 0, 1, 1}, + {&__pyx_n_s_greenlet_init, __pyx_k_greenlet_init, sizeof(__pyx_k_greenlet_init), 0, 0, 1, 1}, + {&__pyx_n_s_handle_error, __pyx_k_handle_error, sizeof(__pyx_k_handle_error), 0, 0, 1, 1}, + {&__pyx_n_s_hub, __pyx_k_hub, sizeof(__pyx_k_hub), 0, 0, 1, 1}, + {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, + {&__pyx_n_s_import_c_accel, __pyx_k_import_c_accel, sizeof(__pyx_k_import_c_accel), 0, 0, 1, 1}, + {&__pyx_n_s_lambda, __pyx_k_lambda, sizeof(__pyx_k_lambda), 0, 0, 1, 1}, + {&__pyx_n_s_linkcount, __pyx_k_linkcount, sizeof(__pyx_k_linkcount), 0, 0, 1, 1}, + {&__pyx_n_s_links, __pyx_k_links, sizeof(__pyx_k_links), 0, 0, 1, 1}, + {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, + {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, + {&__pyx_n_s_notifier, __pyx_k_notifier, sizeof(__pyx_k_notifier), 0, 0, 1, 1}, + {&__pyx_n_s_notify_all, __pyx_k_notify_all, sizeof(__pyx_k_notify_all), 0, 0, 1, 1}, + {&__pyx_n_s_notify_links, __pyx_k_notify_links, sizeof(__pyx_k_notify_links), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_capi, __pyx_k_pyx_capi, sizeof(__pyx_k_pyx_capi), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1}, + {&__pyx_n_s_rawlink, __pyx_k_rawlink, sizeof(__pyx_k_rawlink), 0, 0, 1, 1}, + {&__pyx_n_s_ready, __pyx_k_ready, sizeof(__pyx_k_ready), 0, 0, 1, 1}, + {&__pyx_n_s_run_callback, __pyx_k_run_callback, sizeof(__pyx_k_run_callback), 0, 0, 1, 1}, + {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1}, + {&__pyx_n_s_slots, __pyx_k_slots, sizeof(__pyx_k_slots), 0, 0, 1, 1}, + {&__pyx_kp_s_src_gevent__abstract_linkable_py, __pyx_k_src_gevent__abstract_linkable_py, sizeof(__pyx_k_src_gevent__abstract_linkable_py), 0, 0, 1, 0}, + {&__pyx_n_s_start_new_or_dummy, __pyx_k_start_new_or_dummy, sizeof(__pyx_k_start_new_or_dummy), 0, 0, 1, 1}, + {&__pyx_n_s_stop, __pyx_k_stop, sizeof(__pyx_k_stop), 0, 0, 1, 1}, + {&__pyx_n_s_switch, __pyx_k_switch, sizeof(__pyx_k_switch), 0, 0, 1, 1}, + {&__pyx_n_s_sys, __pyx_k_sys, sizeof(__pyx_k_sys), 0, 0, 1, 1}, + {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, + {&__pyx_n_s_unlink, __pyx_k_unlink, sizeof(__pyx_k_unlink), 0, 0, 1, 1}, + {&__pyx_n_s_weakref, __pyx_k_weakref, sizeof(__pyx_k_weakref), 0, 0, 1, 1}, + {0, 0, 0, 0, 0, 0, 0} +}; +static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { + __pyx_builtin___import__ = __Pyx_GetBuiltinName(__pyx_n_s_import); if (!__pyx_builtin___import__) __PYX_ERR(0, 18, __pyx_L1_error) + __pyx_builtin_NotImplementedError = __Pyx_GetBuiltinName(__pyx_n_s_NotImplementedError); if (!__pyx_builtin_NotImplementedError) __PYX_ERR(0, 78, __pyx_L1_error) + __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(0, 97, __pyx_L1_error) + return 0; + __pyx_L1_error:; + return -1; +} + +static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); + + /* "src/gevent/_abstract_linkable.py":165 + * self.rawlink(switch) + * try: + * with Timeout._start_new_or_dummy(timeout) as timer: # <<<<<<<<<<<<<< + * try: + * if self.hub is None: + */ + __pyx_tuple__2 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 165, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2); + __Pyx_GIVEREF(__pyx_tuple__2); + + /* "src/gevent/_abstract_linkable.py":18 + * from gevent.timeout import Timeout + * + * locals()['getcurrent'] = __import__('greenlet').getcurrent # <<<<<<<<<<<<<< + * locals()['greenlet_init'] = lambda: None + * + */ + __pyx_tuple__3 = PyTuple_Pack(1, __pyx_n_s_greenlet); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 18, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__3); + __Pyx_GIVEREF(__pyx_tuple__3); + + /* "src/gevent/_abstract_linkable.py":30 + * # one-time events (AsyncResult). + * + * __slots__ = ('hub', '_links', '_notifier', '_notify_all', '__weakref__') # <<<<<<<<<<<<<< + * + * def __init__(self): + */ + __pyx_tuple__4 = PyTuple_Pack(5, __pyx_n_s_hub, __pyx_n_s_links, __pyx_n_s_notifier, __pyx_n_s_notify_all, __pyx_n_s_weakref); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 30, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__4); + __Pyx_GIVEREF(__pyx_tuple__4); + + /* "src/gevent/_abstract_linkable.py":72 + * self.hub = None + * + * def linkcount(self): # <<<<<<<<<<<<<< + * # For testing: how many objects are linked to this one? + * return len(self._links) + */ + __pyx_tuple__5 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 72, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__5); + __Pyx_GIVEREF(__pyx_tuple__5); + __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__5, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__abstract_linkable_py, __pyx_n_s_linkcount, 72, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__6)) __PYX_ERR(0, 72, __pyx_L1_error) + + /* "src/gevent/_abstract_linkable.py":76 + * return len(self._links) + * + * def ready(self): # <<<<<<<<<<<<<< + * # Instances must define this + * raise NotImplementedError + */ + __pyx_tuple__7 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 76, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__7); + __Pyx_GIVEREF(__pyx_tuple__7); + __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__abstract_linkable_py, __pyx_n_s_ready, 76, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) __PYX_ERR(0, 76, __pyx_L1_error) + + /* "src/gevent/_abstract_linkable.py":88 + * self._notifier = self.hub.loop.run_callback(self._notify_links) + * + * def rawlink(self, callback): # <<<<<<<<<<<<<< + * """ + * Register a callback to call when this object is ready. + */ + __pyx_tuple__9 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_callback); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 88, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__9); + __Pyx_GIVEREF(__pyx_tuple__9); + __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__9, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__abstract_linkable_py, __pyx_n_s_rawlink, 88, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__10)) __PYX_ERR(0, 88, __pyx_L1_error) + + /* "src/gevent/_abstract_linkable.py":102 + * self._check_and_notify() + * + * def unlink(self, callback): # <<<<<<<<<<<<<< + * """Remove the callback set by :meth:`rawlink`""" + * self._links.discard(callback) + */ + __pyx_tuple__11 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_callback); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 102, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__11); + __Pyx_GIVEREF(__pyx_tuple__11); + __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__11, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__abstract_linkable_py, __pyx_n_s_unlink, 102, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(0, 102, __pyx_L1_error) + + /* "src/gevent/_abstract_linkable.py":114 + * + * + * def _notify_links(self): # <<<<<<<<<<<<<< + * # We release self._notifier here. We are called by it + * # at the end of the loop, and it is now false in a boolean way (as soon + */ + __pyx_tuple__13 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 114, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__13); + __Pyx_GIVEREF(__pyx_tuple__13); + __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__13, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__abstract_linkable_py, __pyx_n_s_notify_links, 114, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__14)) __PYX_ERR(0, 114, __pyx_L1_error) + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} + +static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { + if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + return 0; + __pyx_L1_error:; + return -1; +} + +static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/ + +static int __Pyx_modinit_global_init_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); + /*--- Global init code ---*/ + __pyx_v_6gevent_19__abstract_linkable_InvalidSwitchError = Py_None; Py_INCREF(Py_None); + __pyx_v_6gevent_19__abstract_linkable_Timeout = Py_None; Py_INCREF(Py_None); + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_variable_export_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); + /*--- Variable export code ---*/ + if (__Pyx_ExportVoidPtr(__pyx_n_s_InvalidSwitchError, (void *)&__pyx_v_6gevent_19__abstract_linkable_InvalidSwitchError, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportVoidPtr(__pyx_n_s_Timeout, (void *)&__pyx_v_6gevent_19__abstract_linkable_Timeout, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportVoidPtr(__pyx_n_s_greenlet_imported, (void *)&__pyx_v_6gevent_19__abstract_linkable__greenlet_imported, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_modinit_function_export_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); + /*--- Function export code ---*/ + if (__Pyx_ExportFunction("_init", (void (*)(void))__pyx_f_6gevent_19__abstract_linkable__init, "void (void)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_modinit_type_init_code(void) { + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); + /*--- Type init code ---*/ + __pyx_t_1 = PyImport_ImportModule("greenlet"); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_ptype_6gevent_19__abstract_linkable_greenlet = __Pyx_ImportType(__pyx_t_1, "greenlet", "greenlet", sizeof(PyGreenlet), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_19__abstract_linkable_greenlet) __PYX_ERR(2, 12, __pyx_L1_error) + __pyx_vtabptr_6gevent_19__abstract_linkable_AbstractLinkable = &__pyx_vtable_6gevent_19__abstract_linkable_AbstractLinkable; + __pyx_vtable_6gevent_19__abstract_linkable_AbstractLinkable.rawlink = (PyObject *(*)(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *, PyObject *, int __pyx_skip_dispatch))__pyx_f_6gevent_19__abstract_linkable_16AbstractLinkable_rawlink; + __pyx_vtable_6gevent_19__abstract_linkable_AbstractLinkable.ready = (int (*)(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *, int __pyx_skip_dispatch))__pyx_f_6gevent_19__abstract_linkable_16AbstractLinkable_ready; + __pyx_vtable_6gevent_19__abstract_linkable_AbstractLinkable.unlink = (PyObject *(*)(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *, PyObject *, int __pyx_skip_dispatch))__pyx_f_6gevent_19__abstract_linkable_16AbstractLinkable_unlink; + __pyx_vtable_6gevent_19__abstract_linkable_AbstractLinkable._check_and_notify = (PyObject *(*)(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *))__pyx_f_6gevent_19__abstract_linkable_16AbstractLinkable__check_and_notify; + __pyx_vtable_6gevent_19__abstract_linkable_AbstractLinkable._notify_links = (PyObject *(*)(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *, int __pyx_skip_dispatch))__pyx_f_6gevent_19__abstract_linkable_16AbstractLinkable__notify_links; + __pyx_vtable_6gevent_19__abstract_linkable_AbstractLinkable._wait_core = (PyObject *(*)(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *, PyObject *, struct __pyx_opt_args_6gevent_19__abstract_linkable_16AbstractLinkable__wait_core *__pyx_optional_args))__pyx_f_6gevent_19__abstract_linkable_16AbstractLinkable__wait_core; + __pyx_vtable_6gevent_19__abstract_linkable_AbstractLinkable._wait_return_value = (PyObject *(*)(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *, PyObject *, PyObject *))__pyx_f_6gevent_19__abstract_linkable_16AbstractLinkable__wait_return_value; + __pyx_vtable_6gevent_19__abstract_linkable_AbstractLinkable._wait = (PyObject *(*)(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *, struct __pyx_opt_args_6gevent_19__abstract_linkable_16AbstractLinkable__wait *__pyx_optional_args))__pyx_f_6gevent_19__abstract_linkable_16AbstractLinkable__wait; + if (PyType_Ready(&__pyx_type_6gevent_19__abstract_linkable_AbstractLinkable) < 0) __PYX_ERR(0, 25, __pyx_L1_error) + __pyx_type_6gevent_19__abstract_linkable_AbstractLinkable.tp_print = 0; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6gevent_19__abstract_linkable_AbstractLinkable.tp_dictoffset && __pyx_type_6gevent_19__abstract_linkable_AbstractLinkable.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_type_6gevent_19__abstract_linkable_AbstractLinkable.tp_getattro = __Pyx_PyObject_GenericGetAttr; + } + if (__Pyx_SetVtable(__pyx_type_6gevent_19__abstract_linkable_AbstractLinkable.tp_dict, __pyx_vtabptr_6gevent_19__abstract_linkable_AbstractLinkable) < 0) __PYX_ERR(0, 25, __pyx_L1_error) + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_AbstractLinkable, (PyObject *)&__pyx_type_6gevent_19__abstract_linkable_AbstractLinkable) < 0) __PYX_ERR(0, 25, __pyx_L1_error) + if (__pyx_type_6gevent_19__abstract_linkable_AbstractLinkable.tp_weaklistoffset == 0) __pyx_type_6gevent_19__abstract_linkable_AbstractLinkable.tp_weaklistoffset = offsetof(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable, __weakref__); + __pyx_ptype_6gevent_19__abstract_linkable_AbstractLinkable = &__pyx_type_6gevent_19__abstract_linkable_AbstractLinkable; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_modinit_type_import_code(void) { + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); + /*--- Type import code ---*/ + __pyx_t_1 = PyImport_ImportModule("greenlet"); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_ptype_6gevent_21__greenlet_primitives_greenlet = __Pyx_ImportType(__pyx_t_1, "greenlet", "greenlet", sizeof(PyGreenlet), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_21__greenlet_primitives_greenlet) __PYX_ERR(1, 12, __pyx_L1_error) + __pyx_t_2 = PyImport_ImportModule("gevent.__greenlet_primitives"); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 37, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_ptype_6gevent_21__greenlet_primitives_TrackedRawGreenlet = __Pyx_ImportType(__pyx_t_2, "gevent.__greenlet_primitives", "TrackedRawGreenlet", sizeof(struct __pyx_obj_6gevent_21__greenlet_primitives_TrackedRawGreenlet), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_21__greenlet_primitives_TrackedRawGreenlet) __PYX_ERR(1, 37, __pyx_L1_error) + __pyx_ptype_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop = __Pyx_ImportType(__pyx_t_2, "gevent.__greenlet_primitives", "SwitchOutGreenletWithLoop", sizeof(struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop) __PYX_ERR(1, 40, __pyx_L1_error) + __pyx_vtabptr_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop = (struct __pyx_vtabstruct_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop*)__Pyx_GetVtable(__pyx_ptype_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop->tp_dict); if (unlikely(!__pyx_vtabptr_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop)) __PYX_ERR(1, 40, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_modinit_variable_import_code(void) { + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); + /*--- Variable import code ---*/ + __pyx_t_1 = PyImport_ImportModule("gevent.__greenlet_primitives"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_1, "get_objects", (void **)&__pyx_vp_6gevent_21__greenlet_primitives_get_objects, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_1, "wref", (void **)&__pyx_vp_6gevent_21__greenlet_primitives_wref, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_1, "BlockingSwitchOutError", (void **)&__pyx_vp_6gevent_21__greenlet_primitives_BlockingSwitchOutError, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_1, "_greenlet_imported", (void **)&__pyx_vp_6gevent_21__greenlet_primitives__greenlet_imported, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + Py_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_2 = PyImport_ImportModule("gevent.__hub_local"); if (!__pyx_t_2) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_2, "_threadlocal", (void **)&__pyx_vp_6gevent_11__hub_local__threadlocal, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + Py_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_modinit_function_import_code(void) { + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); + /*--- Function import code ---*/ + __pyx_t_1 = PyImport_ImportModule("gevent.__hub_local"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportFunction(__pyx_t_1, "get_hub_noargs", (void (**)(void))&__pyx_f_6gevent_11__hub_local_get_hub_noargs, "struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *(int __pyx_skip_dispatch)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + Py_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_RefNannyFinishContext(); + return -1; +} + + +#if PY_MAJOR_VERSION < 3 +#ifdef CYTHON_NO_PYINIT_EXPORT +#define __Pyx_PyMODINIT_FUNC void +#else +#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC +#endif +#else +#ifdef CYTHON_NO_PYINIT_EXPORT +#define __Pyx_PyMODINIT_FUNC PyObject * +#else +#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC +#endif +#endif + + +#if PY_MAJOR_VERSION < 3 +__Pyx_PyMODINIT_FUNC init__abstract_linkable(void) CYTHON_SMALL_CODE; /*proto*/ +__Pyx_PyMODINIT_FUNC init__abstract_linkable(void) +#else +__Pyx_PyMODINIT_FUNC PyInit___abstract_linkable(void) CYTHON_SMALL_CODE; /*proto*/ +__Pyx_PyMODINIT_FUNC PyInit___abstract_linkable(void) +#if CYTHON_PEP489_MULTI_PHASE_INIT +{ + return PyModuleDef_Init(&__pyx_moduledef); +} +static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { + #if PY_VERSION_HEX >= 0x030700A1 + static PY_INT64_T main_interpreter_id = -1; + PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); + if (main_interpreter_id == -1) { + main_interpreter_id = current_id; + return (unlikely(current_id == -1)) ? -1 : 0; + } else if (unlikely(main_interpreter_id != current_id)) + #else + static PyInterpreterState *main_interpreter = NULL; + PyInterpreterState *current_interpreter = PyThreadState_Get()->interp; + if (!main_interpreter) { + main_interpreter = current_interpreter; + } else if (unlikely(main_interpreter != current_interpreter)) + #endif + { + PyErr_SetString( + PyExc_ImportError, + "Interpreter change detected - this module can only be loaded into one interpreter per process."); + return -1; + } + return 0; +} +static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) { + PyObject *value = PyObject_GetAttrString(spec, from_name); + int result = 0; + if (likely(value)) { + if (allow_none || value != Py_None) { + result = PyDict_SetItemString(moddict, to_name, value); + } + Py_DECREF(value); + } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_Clear(); + } else { + result = -1; + } + return result; +} +static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) { + PyObject *module = NULL, *moddict, *modname; + if (__Pyx_check_single_interpreter()) + return NULL; + if (__pyx_m) + return __Pyx_NewRef(__pyx_m); + modname = PyObject_GetAttrString(spec, "name"); + if (unlikely(!modname)) goto bad; + module = PyModule_NewObject(modname); + Py_DECREF(modname); + if (unlikely(!module)) goto bad; + moddict = PyModule_GetDict(module); + if (unlikely(!moddict)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad; + return module; +bad: + Py_XDECREF(module); + return NULL; +} + + +static CYTHON_SMALL_CODE int __pyx_pymod_exec___abstract_linkable(PyObject *__pyx_pyinit_module) +#endif +#endif +{ + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannyDeclarations + #if CYTHON_PEP489_MULTI_PHASE_INIT + if (__pyx_m) { + if (__pyx_m == __pyx_pyinit_module) return 0; + PyErr_SetString(PyExc_RuntimeError, "Module '__abstract_linkable' has already been imported. Re-initialisation is not supported."); + return -1; + } + #elif PY_MAJOR_VERSION >= 3 + if (__pyx_m) return __Pyx_NewRef(__pyx_m); + #endif + #if CYTHON_REFNANNY +__Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); +if (!__Pyx_RefNanny) { + PyErr_Clear(); + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); + if (!__Pyx_RefNanny) + Py_FatalError("failed to import 'refnanny' module"); +} +#endif + __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit___abstract_linkable(void)", 0); + if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #ifdef __Pxy_PyFrame_Initialize_Offsets + __Pxy_PyFrame_Initialize_Offsets(); + #endif + __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) + #ifdef __Pyx_CyFunction_USED + if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_FusedFunction_USED + if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_Coroutine_USED + if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_Generator_USED + if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_AsyncGen_USED + if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_StopAsyncIteration_USED + if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + /*--- Library function declarations ---*/ + /*--- Threads initialization code ---*/ + #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS + #ifdef WITH_THREAD /* Python build with threading support? */ + PyEval_InitThreads(); + #endif + #endif + /*--- Module creation code ---*/ + #if CYTHON_PEP489_MULTI_PHASE_INIT + __pyx_m = __pyx_pyinit_module; + Py_INCREF(__pyx_m); + #else + #if PY_MAJOR_VERSION < 3 + __pyx_m = Py_InitModule4("__abstract_linkable", __pyx_methods, __pyx_k_Internal_module_support_for_the, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); + #else + __pyx_m = PyModule_Create(&__pyx_moduledef); + #endif + if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) + Py_INCREF(__pyx_d); + __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) + #if CYTHON_COMPILING_IN_PYPY + Py_INCREF(__pyx_b); + #endif + if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + /*--- Initialize various global constants etc. ---*/ + if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) + if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + if (__pyx_module_is_main_gevent____abstract_linkable) { + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + } + #if PY_MAJOR_VERSION >= 3 + { + PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) + if (!PyDict_GetItemString(modules, "gevent.__abstract_linkable")) { + if (unlikely(PyDict_SetItemString(modules, "gevent.__abstract_linkable", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error) + } + } + #endif + /*--- Builtin init code ---*/ + if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + /*--- Constants init code ---*/ + if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + /*--- Global type/function init code ---*/ + (void)__Pyx_modinit_global_init_code(); + if (unlikely(__Pyx_modinit_variable_export_code() != 0)) goto __pyx_L1_error; + if (unlikely(__Pyx_modinit_function_export_code() != 0)) goto __pyx_L1_error; + if (unlikely(__Pyx_modinit_type_init_code() != 0)) goto __pyx_L1_error; + if (unlikely(__Pyx_modinit_type_import_code() != 0)) goto __pyx_L1_error; + if (unlikely(__Pyx_modinit_variable_import_code() != 0)) goto __pyx_L1_error; + if (unlikely(__Pyx_modinit_function_import_code() != 0)) goto __pyx_L1_error; + /*--- Execution code ---*/ + #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) + if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + + /* "src/gevent/_abstract_linkable.py":11 + * from __future__ import print_function + * + * import sys # <<<<<<<<<<<<<< + * + * from gevent._hub_local import get_hub_noargs as get_hub + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_sys, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 11, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_sys, __pyx_t_1) < 0) __PYX_ERR(0, 11, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_abstract_linkable.py":13 + * import sys + * + * from gevent._hub_local import get_hub_noargs as get_hub # <<<<<<<<<<<<<< + * + * from gevent.exceptions import InvalidSwitchError + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_get_hub_noargs); + __Pyx_GIVEREF(__pyx_n_s_get_hub_noargs); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_get_hub_noargs); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_gevent__hub_local, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_get_hub_noargs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_hub_noargs, __pyx_t_1) < 0) __PYX_ERR(0, 13, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/_abstract_linkable.py":15 + * from gevent._hub_local import get_hub_noargs as get_hub + * + * from gevent.exceptions import InvalidSwitchError # <<<<<<<<<<<<<< + * from gevent.timeout import Timeout + * + */ + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 15, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_InvalidSwitchError); + __Pyx_GIVEREF(__pyx_n_s_InvalidSwitchError); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_InvalidSwitchError); + __pyx_t_1 = __Pyx_Import(__pyx_n_s_gevent_exceptions, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 15, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_InvalidSwitchError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 15, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_v_6gevent_19__abstract_linkable_InvalidSwitchError); + __Pyx_DECREF_SET(__pyx_v_6gevent_19__abstract_linkable_InvalidSwitchError, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_abstract_linkable.py":16 + * + * from gevent.exceptions import InvalidSwitchError + * from gevent.timeout import Timeout # <<<<<<<<<<<<<< + * + * locals()['getcurrent'] = __import__('greenlet').getcurrent + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 16, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_Timeout); + __Pyx_GIVEREF(__pyx_n_s_Timeout); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_Timeout); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_gevent_timeout, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 16, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_Timeout); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 16, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_v_6gevent_19__abstract_linkable_Timeout); + __Pyx_DECREF_SET(__pyx_v_6gevent_19__abstract_linkable_Timeout, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/_abstract_linkable.py":18 + * from gevent.timeout import Timeout + * + * locals()['getcurrent'] = __import__('greenlet').getcurrent # <<<<<<<<<<<<<< + * locals()['greenlet_init'] = lambda: None + * + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin___import__, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 18, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_getcurrent); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 18, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_Globals(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 18, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (unlikely(PyDict_SetItem(__pyx_t_2, __pyx_n_s_getcurrent, __pyx_t_1) < 0)) __PYX_ERR(0, 18, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_abstract_linkable.py":19 + * + * locals()['getcurrent'] = __import__('greenlet').getcurrent + * locals()['greenlet_init'] = lambda: None # <<<<<<<<<<<<<< + * + * __all__ = [ + */ + __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_19__abstract_linkable_lambda, 0, __pyx_n_s_lambda, NULL, __pyx_n_s_gevent___abstract_linkable, __pyx_d, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 19, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_Globals(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 19, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (unlikely(PyDict_SetItem(__pyx_t_2, __pyx_n_s_greenlet_init, __pyx_t_1) < 0)) __PYX_ERR(0, 19, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_abstract_linkable.py":21 + * locals()['greenlet_init'] = lambda: None + * + * __all__ = [ # <<<<<<<<<<<<<< + * 'AbstractLinkable', + * ] + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 21, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_AbstractLinkable); + __Pyx_GIVEREF(__pyx_n_s_AbstractLinkable); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_AbstractLinkable); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_all, __pyx_t_1) < 0) __PYX_ERR(0, 21, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_abstract_linkable.py":30 + * # one-time events (AsyncResult). + * + * __slots__ = ('hub', '_links', '_notifier', '_notify_all', '__weakref__') # <<<<<<<<<<<<<< + * + * def __init__(self): + */ + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_19__abstract_linkable_AbstractLinkable->tp_dict, __pyx_n_s_slots, __pyx_tuple__4) < 0) __PYX_ERR(0, 30, __pyx_L1_error) + PyType_Modified(__pyx_ptype_6gevent_19__abstract_linkable_AbstractLinkable); + + /* "src/gevent/_abstract_linkable.py":72 + * self.hub = None + * + * def linkcount(self): # <<<<<<<<<<<<<< + * # For testing: how many objects are linked to this one? + * return len(self._links) + */ + __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_19__abstract_linkable_16AbstractLinkable_3linkcount, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AbstractLinkable_linkcount, NULL, __pyx_n_s_gevent___abstract_linkable, __pyx_d, ((PyObject *)__pyx_codeobj__6)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 72, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_19__abstract_linkable_AbstractLinkable->tp_dict, __pyx_n_s_linkcount, __pyx_t_1) < 0) __PYX_ERR(0, 72, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + PyType_Modified(__pyx_ptype_6gevent_19__abstract_linkable_AbstractLinkable); + + /* "src/gevent/_abstract_linkable.py":76 + * return len(self._links) + * + * def ready(self): # <<<<<<<<<<<<<< + * # Instances must define this + * raise NotImplementedError + */ + __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_19__abstract_linkable_16AbstractLinkable_5ready, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AbstractLinkable_ready, NULL, __pyx_n_s_gevent___abstract_linkable, __pyx_d, ((PyObject *)__pyx_codeobj__8)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 76, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_19__abstract_linkable_AbstractLinkable->tp_dict, __pyx_n_s_ready, __pyx_t_1) < 0) __PYX_ERR(0, 76, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + PyType_Modified(__pyx_ptype_6gevent_19__abstract_linkable_AbstractLinkable); + + /* "src/gevent/_abstract_linkable.py":88 + * self._notifier = self.hub.loop.run_callback(self._notify_links) + * + * def rawlink(self, callback): # <<<<<<<<<<<<<< + * """ + * Register a callback to call when this object is ready. + */ + __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_19__abstract_linkable_16AbstractLinkable_7rawlink, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AbstractLinkable_rawlink, NULL, __pyx_n_s_gevent___abstract_linkable, __pyx_d, ((PyObject *)__pyx_codeobj__10)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 88, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_19__abstract_linkable_AbstractLinkable->tp_dict, __pyx_n_s_rawlink, __pyx_t_1) < 0) __PYX_ERR(0, 88, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + PyType_Modified(__pyx_ptype_6gevent_19__abstract_linkable_AbstractLinkable); + + /* "src/gevent/_abstract_linkable.py":102 + * self._check_and_notify() + * + * def unlink(self, callback): # <<<<<<<<<<<<<< + * """Remove the callback set by :meth:`rawlink`""" + * self._links.discard(callback) + */ + __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_19__abstract_linkable_16AbstractLinkable_9unlink, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AbstractLinkable_unlink, NULL, __pyx_n_s_gevent___abstract_linkable, __pyx_d, ((PyObject *)__pyx_codeobj__12)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 102, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_19__abstract_linkable_AbstractLinkable->tp_dict, __pyx_n_s_unlink, __pyx_t_1) < 0) __PYX_ERR(0, 102, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + PyType_Modified(__pyx_ptype_6gevent_19__abstract_linkable_AbstractLinkable); + + /* "src/gevent/_abstract_linkable.py":114 + * + * + * def _notify_links(self): # <<<<<<<<<<<<<< + * # We release self._notifier here. We are called by it + * # at the end of the loop, and it is now false in a boolean way (as soon + */ + __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_19__abstract_linkable_16AbstractLinkable_11_notify_links, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AbstractLinkable__notify_links, NULL, __pyx_n_s_gevent___abstract_linkable, __pyx_d, ((PyObject *)__pyx_codeobj__14)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 114, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_19__abstract_linkable_AbstractLinkable->tp_dict, __pyx_n_s_notify_links, __pyx_t_1) < 0) __PYX_ERR(0, 114, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + PyType_Modified(__pyx_ptype_6gevent_19__abstract_linkable_AbstractLinkable); + + /* "src/gevent/_abstract_linkable.py":157 + * self._check_and_notify() + * + * def _wait_core(self, timeout, catch=Timeout): # <<<<<<<<<<<<<< + * # The core of the wait implementation, handling + * # switching and linking. If *catch* is set to (), + */ + __Pyx_INCREF(__pyx_v_6gevent_19__abstract_linkable_Timeout); + __pyx_k_ = __pyx_v_6gevent_19__abstract_linkable_Timeout; + __Pyx_GIVEREF(__pyx_v_6gevent_19__abstract_linkable_Timeout); + + /* "src/gevent/_abstract_linkable.py":198 + * greenlet_init() # pylint:disable=undefined-variable + * + * _init() # <<<<<<<<<<<<<< + * + * + */ + __pyx_f_6gevent_19__abstract_linkable__init(); + + /* "src/gevent/_abstract_linkable.py":201 + * + * + * from gevent._util import import_c_accel # <<<<<<<<<<<<<< + * import_c_accel(globals(), 'gevent.__abstract_linkable') + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 201, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_import_c_accel); + __Pyx_GIVEREF(__pyx_n_s_import_c_accel); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_import_c_accel); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_gevent__util, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 201, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_import_c_accel); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 201, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_import_c_accel, __pyx_t_1) < 0) __PYX_ERR(0, 201, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/_abstract_linkable.py":202 + * + * from gevent._util import import_c_accel + * import_c_accel(globals(), 'gevent.__abstract_linkable') # <<<<<<<<<<<<<< + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_import_c_accel); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 202, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_Globals(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 202, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 202, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_INCREF(__pyx_n_s_gevent___abstract_linkable); + __Pyx_GIVEREF(__pyx_n_s_gevent___abstract_linkable); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_n_s_gevent___abstract_linkable); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 202, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_abstract_linkable.py":1 + * # -*- coding: utf-8 -*- # <<<<<<<<<<<<<< + * # cython: auto_pickle=False,embedsignature=True,always_allow_keywords=False + * """ + */ + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "gevent/__abstract_linkable.pxd":24 + * return PyGreenlet_GetCurrent() + * + * cdef inline void greenlet_init(): # <<<<<<<<<<<<<< + * global _greenlet_imported + * if not _greenlet_imported: + */ + + /*--- Wrapped vars code ---*/ + + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + if (__pyx_m) { + if (__pyx_d) { + __Pyx_AddTraceback("init gevent.__abstract_linkable", __pyx_clineno, __pyx_lineno, __pyx_filename); + } + Py_CLEAR(__pyx_m); + } else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_ImportError, "init gevent.__abstract_linkable"); + } + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + #if CYTHON_PEP489_MULTI_PHASE_INIT + return (__pyx_m != NULL) ? 0 : -1; + #elif PY_MAJOR_VERSION >= 3 + return __pyx_m; + #else + return; + #endif +} + +/* --- Runtime support code --- */ +/* Refnanny */ +#if CYTHON_REFNANNY +static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { + PyObject *m = NULL, *p = NULL; + void *r = NULL; + m = PyImport_ImportModule(modname); + if (!m) goto end; + p = PyObject_GetAttrString(m, "RefNannyAPI"); + if (!p) goto end; + r = PyLong_AsVoidPtr(p); +end: + Py_XDECREF(p); + Py_XDECREF(m); + return (__Pyx_RefNannyAPIStruct *)r; +} +#endif + +/* PyObjectGetAttrStr */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_getattro)) + return tp->tp_getattro(obj, attr_name); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_getattr)) + return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); +#endif + return PyObject_GetAttr(obj, attr_name); +} +#endif + +/* GetBuiltinName */ +static PyObject *__Pyx_GetBuiltinName(PyObject *name) { + PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name); + if (unlikely(!result)) { + PyErr_Format(PyExc_NameError, +#if PY_MAJOR_VERSION >= 3 + "name '%U' is not defined", name); +#else + "name '%.200s' is not defined", PyString_AS_STRING(name)); +#endif + } + return result; +} + +/* RaiseArgTupleInvalid */ +static void __Pyx_RaiseArgtupleInvalid( + const char* func_name, + int exact, + Py_ssize_t num_min, + Py_ssize_t num_max, + Py_ssize_t num_found) +{ + Py_ssize_t num_expected; + const char *more_or_less; + if (num_found < num_min) { + num_expected = num_min; + more_or_less = "at least"; + } else { + num_expected = num_max; + more_or_less = "at most"; + } + if (exact) { + more_or_less = "exactly"; + } + PyErr_Format(PyExc_TypeError, + "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", + func_name, more_or_less, num_expected, + (num_expected == 1) ? "" : "s", num_found); +} + +/* KeywordStringCheck */ +static int __Pyx_CheckKeywordStrings( + PyObject *kwdict, + const char* function_name, + int kw_allowed) +{ + PyObject* key = 0; + Py_ssize_t pos = 0; +#if CYTHON_COMPILING_IN_PYPY + if (!kw_allowed && PyDict_Next(kwdict, &pos, &key, 0)) + goto invalid_keyword; + return 1; +#else + while (PyDict_Next(kwdict, &pos, &key, 0)) { + #if PY_MAJOR_VERSION < 3 + if (unlikely(!PyString_Check(key))) + #endif + if (unlikely(!PyUnicode_Check(key))) + goto invalid_keyword_type; + } + if ((!kw_allowed) && unlikely(key)) + goto invalid_keyword; + return 1; +invalid_keyword_type: + PyErr_Format(PyExc_TypeError, + "%.200s() keywords must be strings", function_name); + return 0; +#endif +invalid_keyword: + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION < 3 + "%.200s() got an unexpected keyword argument '%.200s'", + function_name, PyString_AsString(key)); + #else + "%s() got an unexpected keyword argument '%U'", + function_name, key); + #endif + return 0; +} + +/* PyFunctionFastCall */ +#if CYTHON_FAST_PYCALL +static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, + PyObject *globals) { + PyFrameObject *f; + PyThreadState *tstate = __Pyx_PyThreadState_Current; + PyObject **fastlocals; + Py_ssize_t i; + PyObject *result; + assert(globals != NULL); + /* XXX Perhaps we should create a specialized + PyFrame_New() that doesn't take locals, but does + take builtins without sanity checking them. + */ + assert(tstate != NULL); + f = PyFrame_New(tstate, co, globals, NULL); + if (f == NULL) { + return NULL; + } + fastlocals = __Pyx_PyFrame_GetLocalsplus(f); + for (i = 0; i < na; i++) { + Py_INCREF(*args); + fastlocals[i] = *args++; + } + result = PyEval_EvalFrameEx(f,0); + ++tstate->recursion_depth; + Py_DECREF(f); + --tstate->recursion_depth; + return result; +} +#if 1 || PY_VERSION_HEX < 0x030600B1 +static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs) { + PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); + PyObject *globals = PyFunction_GET_GLOBALS(func); + PyObject *argdefs = PyFunction_GET_DEFAULTS(func); + PyObject *closure; +#if PY_MAJOR_VERSION >= 3 + PyObject *kwdefs; +#endif + PyObject *kwtuple, **k; + PyObject **d; + Py_ssize_t nd; + Py_ssize_t nk; + PyObject *result; + assert(kwargs == NULL || PyDict_Check(kwargs)); + nk = kwargs ? PyDict_Size(kwargs) : 0; + if (Py_EnterRecursiveCall((char*)" while calling a Python object")) { + return NULL; + } + if ( +#if PY_MAJOR_VERSION >= 3 + co->co_kwonlyargcount == 0 && +#endif + likely(kwargs == NULL || nk == 0) && + co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { + if (argdefs == NULL && co->co_argcount == nargs) { + result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); + goto done; + } + else if (nargs == 0 && argdefs != NULL + && co->co_argcount == Py_SIZE(argdefs)) { + /* function called with no arguments, but all parameters have + a default value: use default values as arguments .*/ + args = &PyTuple_GET_ITEM(argdefs, 0); + result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); + goto done; + } + } + if (kwargs != NULL) { + Py_ssize_t pos, i; + kwtuple = PyTuple_New(2 * nk); + if (kwtuple == NULL) { + result = NULL; + goto done; + } + k = &PyTuple_GET_ITEM(kwtuple, 0); + pos = i = 0; + while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { + Py_INCREF(k[i]); + Py_INCREF(k[i+1]); + i += 2; + } + nk = i / 2; + } + else { + kwtuple = NULL; + k = NULL; + } + closure = PyFunction_GET_CLOSURE(func); +#if PY_MAJOR_VERSION >= 3 + kwdefs = PyFunction_GET_KW_DEFAULTS(func); +#endif + if (argdefs != NULL) { + d = &PyTuple_GET_ITEM(argdefs, 0); + nd = Py_SIZE(argdefs); + } + else { + d = NULL; + nd = 0; + } +#if PY_MAJOR_VERSION >= 3 + result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, + args, nargs, + k, (int)nk, + d, (int)nd, kwdefs, closure); +#else + result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, + args, nargs, + k, (int)nk, + d, (int)nd, closure); +#endif + Py_XDECREF(kwtuple); +done: + Py_LeaveRecursiveCall(); + return result; +} +#endif +#endif + +/* PyObjectCall */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { + PyObject *result; + ternaryfunc call = func->ob_type->tp_call; + if (unlikely(!call)) + return PyObject_Call(func, arg, kw); + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; + result = (*call)(func, arg, kw); + Py_LeaveRecursiveCall(); + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +/* PyObjectCallMethO */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { + PyObject *self, *result; + PyCFunction cfunc; + cfunc = PyCFunction_GET_FUNCTION(func); + self = PyCFunction_GET_SELF(func); + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; + result = cfunc(self, arg); + Py_LeaveRecursiveCall(); + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +/* PyObjectCallNoArg */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { +#if CYTHON_FAST_PYCALL + if (PyFunction_Check(func)) { + return __Pyx_PyFunction_FastCall(func, NULL, 0); + } +#endif +#ifdef __Pyx_CyFunction_USED + if (likely(PyCFunction_Check(func) || __Pyx_CyFunction_Check(func))) +#else + if (likely(PyCFunction_Check(func))) +#endif + { + if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) { + return __Pyx_PyObject_CallMethO(func, NULL); + } + } + return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL); +} +#endif + +/* PyCFunctionFastCall */ +#if CYTHON_FAST_PYCCALL +static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) { + PyCFunctionObject *func = (PyCFunctionObject*)func_obj; + PyCFunction meth = PyCFunction_GET_FUNCTION(func); + PyObject *self = PyCFunction_GET_SELF(func); + int flags = PyCFunction_GET_FLAGS(func); + assert(PyCFunction_Check(func)); + assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS))); + assert(nargs >= 0); + assert(nargs == 0 || args != NULL); + /* _PyCFunction_FastCallDict() must not be called with an exception set, + because it may clear it (directly or indirectly) and so the + caller loses its exception */ + assert(!PyErr_Occurred()); + if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) { + return (*((__Pyx_PyCFunctionFastWithKeywords)(void*)meth)) (self, args, nargs, NULL); + } else { + return (*((__Pyx_PyCFunctionFast)(void*)meth)) (self, args, nargs); + } +} +#endif + +/* PyObjectCallOneArg */ +#if CYTHON_COMPILING_IN_CPYTHON +static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) { + PyObject *result; + PyObject *args = PyTuple_New(1); + if (unlikely(!args)) return NULL; + Py_INCREF(arg); + PyTuple_SET_ITEM(args, 0, arg); + result = __Pyx_PyObject_Call(func, args, NULL); + Py_DECREF(args); + return result; +} +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { +#if CYTHON_FAST_PYCALL + if (PyFunction_Check(func)) { + return __Pyx_PyFunction_FastCall(func, &arg, 1); + } +#endif + if (likely(PyCFunction_Check(func))) { + if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) { + return __Pyx_PyObject_CallMethO(func, arg); +#if CYTHON_FAST_PYCCALL + } else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) { + return __Pyx_PyCFunction_FastCall(func, &arg, 1); +#endif + } + } + return __Pyx__PyObject_CallOneArg(func, arg); +} +#else +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { + PyObject *result; + PyObject *args = PyTuple_Pack(1, arg); + if (unlikely(!args)) return NULL; + result = __Pyx_PyObject_Call(func, args, NULL); + Py_DECREF(args); + return result; +} +#endif + +/* PyErrFetchRestore */ +#if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + tmp_type = tstate->curexc_type; + tmp_value = tstate->curexc_value; + tmp_tb = tstate->curexc_traceback; + tstate->curexc_type = type; + tstate->curexc_value = value; + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +} +static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { + *type = tstate->curexc_type; + *value = tstate->curexc_value; + *tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +} +#endif + +/* RaiseException */ +#if PY_MAJOR_VERSION < 3 +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, + CYTHON_UNUSED PyObject *cause) { + __Pyx_PyThreadState_declare + Py_XINCREF(type); + if (!value || value == Py_None) + value = NULL; + else + Py_INCREF(value); + if (!tb || tb == Py_None) + tb = NULL; + else { + Py_INCREF(tb); + if (!PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto raise_error; + } + } + if (PyType_Check(type)) { +#if CYTHON_COMPILING_IN_PYPY + if (!value) { + Py_INCREF(Py_None); + value = Py_None; + } +#endif + PyErr_NormalizeException(&type, &value, &tb); + } else { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto raise_error; + } + value = type; + type = (PyObject*) Py_TYPE(type); + Py_INCREF(type); + if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto raise_error; + } + } + __Pyx_PyThreadState_assign + __Pyx_ErrRestore(type, value, tb); + return; +raise_error: + Py_XDECREF(value); + Py_XDECREF(type); + Py_XDECREF(tb); + return; +} +#else +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { + PyObject* owned_instance = NULL; + if (tb == Py_None) { + tb = 0; + } else if (tb && !PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto bad; + } + if (value == Py_None) + value = 0; + if (PyExceptionInstance_Check(type)) { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto bad; + } + value = type; + type = (PyObject*) Py_TYPE(value); + } else if (PyExceptionClass_Check(type)) { + PyObject *instance_class = NULL; + if (value && PyExceptionInstance_Check(value)) { + instance_class = (PyObject*) Py_TYPE(value); + if (instance_class != type) { + int is_subclass = PyObject_IsSubclass(instance_class, type); + if (!is_subclass) { + instance_class = NULL; + } else if (unlikely(is_subclass == -1)) { + goto bad; + } else { + type = instance_class; + } + } + } + if (!instance_class) { + PyObject *args; + if (!value) + args = PyTuple_New(0); + else if (PyTuple_Check(value)) { + Py_INCREF(value); + args = value; + } else + args = PyTuple_Pack(1, value); + if (!args) + goto bad; + owned_instance = PyObject_Call(type, args, NULL); + Py_DECREF(args); + if (!owned_instance) + goto bad; + value = owned_instance; + if (!PyExceptionInstance_Check(value)) { + PyErr_Format(PyExc_TypeError, + "calling %R should have returned an instance of " + "BaseException, not %R", + type, Py_TYPE(value)); + goto bad; + } + } + } else { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto bad; + } + if (cause) { + PyObject *fixed_cause; + if (cause == Py_None) { + fixed_cause = NULL; + } else if (PyExceptionClass_Check(cause)) { + fixed_cause = PyObject_CallObject(cause, NULL); + if (fixed_cause == NULL) + goto bad; + } else if (PyExceptionInstance_Check(cause)) { + fixed_cause = cause; + Py_INCREF(fixed_cause); + } else { + PyErr_SetString(PyExc_TypeError, + "exception causes must derive from " + "BaseException"); + goto bad; + } + PyException_SetCause(value, fixed_cause); + } + PyErr_SetObject(type, value); + if (tb) { +#if CYTHON_COMPILING_IN_PYPY + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); + Py_INCREF(tb); + PyErr_Restore(tmp_type, tmp_value, tb); + Py_XDECREF(tmp_tb); +#else + PyThreadState *tstate = __Pyx_PyThreadState_Current; + PyObject* tmp_tb = tstate->curexc_traceback; + if (tb != tmp_tb) { + Py_INCREF(tb); + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_tb); + } +#endif + } +bad: + Py_XDECREF(owned_instance); + return; +} +#endif + +/* WriteUnraisableException */ +static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno, + CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename, + int full_traceback, CYTHON_UNUSED int nogil) { + PyObject *old_exc, *old_val, *old_tb; + PyObject *ctx; + __Pyx_PyThreadState_declare +#ifdef WITH_THREAD + PyGILState_STATE state; + if (nogil) + state = PyGILState_Ensure(); +#ifdef _MSC_VER + else state = (PyGILState_STATE)-1; +#endif +#endif + __Pyx_PyThreadState_assign + __Pyx_ErrFetch(&old_exc, &old_val, &old_tb); + if (full_traceback) { + Py_XINCREF(old_exc); + Py_XINCREF(old_val); + Py_XINCREF(old_tb); + __Pyx_ErrRestore(old_exc, old_val, old_tb); + PyErr_PrintEx(1); + } + #if PY_MAJOR_VERSION < 3 + ctx = PyString_FromString(name); + #else + ctx = PyUnicode_FromString(name); + #endif + __Pyx_ErrRestore(old_exc, old_val, old_tb); + if (!ctx) { + PyErr_WriteUnraisable(Py_None); + } else { + PyErr_WriteUnraisable(ctx); + Py_DECREF(ctx); + } +#ifdef WITH_THREAD + if (nogil) + PyGILState_Release(state); +#endif +} + +/* PyObjectCall2Args */ +static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) { + PyObject *args, *result = NULL; + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(function)) { + PyObject *args[2] = {arg1, arg2}; + return __Pyx_PyFunction_FastCall(function, args, 2); + } + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(function)) { + PyObject *args[2] = {arg1, arg2}; + return __Pyx_PyCFunction_FastCall(function, args, 2); + } + #endif + args = PyTuple_New(2); + if (unlikely(!args)) goto done; + Py_INCREF(arg1); + PyTuple_SET_ITEM(args, 0, arg1); + Py_INCREF(arg2); + PyTuple_SET_ITEM(args, 1, arg2); + Py_INCREF(function); + result = __Pyx_PyObject_Call(function, args, NULL); + Py_DECREF(args); + Py_DECREF(function); +done: + return result; +} + +/* pyfrozenset_new */ +static CYTHON_INLINE PyObject* __Pyx_PyFrozenSet_New(PyObject* it) { + if (it) { + PyObject* result; +#if CYTHON_COMPILING_IN_PYPY + PyObject* args; + args = PyTuple_Pack(1, it); + if (unlikely(!args)) + return NULL; + result = PyObject_Call((PyObject*)&PyFrozenSet_Type, args, NULL); + Py_DECREF(args); + return result; +#else + if (PyFrozenSet_CheckExact(it)) { + Py_INCREF(it); + return it; + } + result = PyFrozenSet_New(it); + if (unlikely(!result)) + return NULL; + if (likely(PySet_GET_SIZE(result))) + return result; + Py_DECREF(result); +#endif + } +#if CYTHON_USE_TYPE_SLOTS + return PyFrozenSet_Type.tp_new(&PyFrozenSet_Type, __pyx_empty_tuple, NULL); +#else + return PyObject_Call((PyObject*)&PyFrozenSet_Type, __pyx_empty_tuple, NULL); +#endif +} + +/* py_set_discard_unhashable */ +static int __Pyx_PySet_DiscardUnhashable(PyObject *set, PyObject *key) { + PyObject *tmpkey; + int rv; + if (likely(!PySet_Check(key) || !PyErr_ExceptionMatches(PyExc_TypeError))) + return -1; + PyErr_Clear(); + tmpkey = __Pyx_PyFrozenSet_New(key); + if (tmpkey == NULL) + return -1; + rv = PySet_Discard(set, tmpkey); + Py_DECREF(tmpkey); + return rv; +} + +/* py_set_discard */ +static CYTHON_INLINE int __Pyx_PySet_Discard(PyObject *set, PyObject *key) { + int found = PySet_Discard(set, key); + if (unlikely(found < 0)) { + found = __Pyx_PySet_DiscardUnhashable(set, key); + } + return found; +} + +/* IterFinish */ +static CYTHON_INLINE int __Pyx_IterFinish(void) { +#if CYTHON_FAST_THREAD_STATE + PyThreadState *tstate = __Pyx_PyThreadState_Current; + PyObject* exc_type = tstate->curexc_type; + if (unlikely(exc_type)) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) { + PyObject *exc_value, *exc_tb; + exc_value = tstate->curexc_value; + exc_tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; + Py_DECREF(exc_type); + Py_XDECREF(exc_value); + Py_XDECREF(exc_tb); + return 0; + } else { + return -1; + } + } + return 0; +#else + if (unlikely(PyErr_Occurred())) { + if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) { + PyErr_Clear(); + return 0; + } else { + return -1; + } + } + return 0; +#endif +} + +/* set_iter */ +static CYTHON_INLINE PyObject* __Pyx_set_iterator(PyObject* iterable, int is_set, + Py_ssize_t* p_orig_length, int* p_source_is_set) { +#if CYTHON_COMPILING_IN_CPYTHON + is_set = is_set || likely(PySet_CheckExact(iterable) || PyFrozenSet_CheckExact(iterable)); + *p_source_is_set = is_set; + if (likely(is_set)) { + *p_orig_length = PySet_Size(iterable); + Py_INCREF(iterable); + return iterable; + } +#else + (void)is_set; + *p_source_is_set = 0; +#endif + *p_orig_length = 0; + return PyObject_GetIter(iterable); +} +static CYTHON_INLINE int __Pyx_set_iter_next( + PyObject* iter_obj, Py_ssize_t orig_length, + Py_ssize_t* ppos, PyObject **value, + int source_is_set) { + if (!CYTHON_COMPILING_IN_CPYTHON || unlikely(!source_is_set)) { + *value = PyIter_Next(iter_obj); + if (unlikely(!*value)) { + return __Pyx_IterFinish(); + } + (void)orig_length; + (void)ppos; + return 1; + } +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(PySet_GET_SIZE(iter_obj) != orig_length)) { + PyErr_SetString( + PyExc_RuntimeError, + "set changed size during iteration"); + return -1; + } + { + Py_hash_t hash; + int ret = _PySet_NextEntry(iter_obj, ppos, value, &hash); + assert (ret != -1); + if (likely(ret)) { + Py_INCREF(*value); + return 1; + } + } +#endif + return 0; +} + +/* PySetContains */ +static int __Pyx_PySet_ContainsUnhashable(PyObject *set, PyObject *key) { + int result = -1; + if (PySet_Check(key) && PyErr_ExceptionMatches(PyExc_TypeError)) { + PyObject *tmpkey; + PyErr_Clear(); + tmpkey = __Pyx_PyFrozenSet_New(key); + if (tmpkey != NULL) { + result = PySet_Contains(set, tmpkey); + Py_DECREF(tmpkey); + } + } + return result; +} +static CYTHON_INLINE int __Pyx_PySet_ContainsTF(PyObject* key, PyObject* set, int eq) { + int result = PySet_Contains(set, key); + if (unlikely(result < 0)) { + result = __Pyx_PySet_ContainsUnhashable(set, key); + } + return unlikely(result < 0) ? result : (result == (eq == Py_EQ)); +} + +/* GetTopmostException */ +#if CYTHON_USE_EXC_INFO_STACK +static _PyErr_StackItem * +__Pyx_PyErr_GetTopmostException(PyThreadState *tstate) +{ + _PyErr_StackItem *exc_info = tstate->exc_info; + while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) && + exc_info->previous_item != NULL) + { + exc_info = exc_info->previous_item; + } + return exc_info; +} +#endif + +/* SaveResetException */ +#if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { + #if CYTHON_USE_EXC_INFO_STACK + _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate); + *type = exc_info->exc_type; + *value = exc_info->exc_value; + *tb = exc_info->exc_traceback; + #else + *type = tstate->exc_type; + *value = tstate->exc_value; + *tb = tstate->exc_traceback; + #endif + Py_XINCREF(*type); + Py_XINCREF(*value); + Py_XINCREF(*tb); +} +static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + #if CYTHON_USE_EXC_INFO_STACK + _PyErr_StackItem *exc_info = tstate->exc_info; + tmp_type = exc_info->exc_type; + tmp_value = exc_info->exc_value; + tmp_tb = exc_info->exc_traceback; + exc_info->exc_type = type; + exc_info->exc_value = value; + exc_info->exc_traceback = tb; + #else + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = type; + tstate->exc_value = value; + tstate->exc_traceback = tb; + #endif + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +} +#endif + +/* GetException */ +#if CYTHON_FAST_THREAD_STATE +static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) +#else +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) +#endif +{ + PyObject *local_type, *local_value, *local_tb; +#if CYTHON_FAST_THREAD_STATE + PyObject *tmp_type, *tmp_value, *tmp_tb; + local_type = tstate->curexc_type; + local_value = tstate->curexc_value; + local_tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +#else + PyErr_Fetch(&local_type, &local_value, &local_tb); +#endif + PyErr_NormalizeException(&local_type, &local_value, &local_tb); +#if CYTHON_FAST_THREAD_STATE + if (unlikely(tstate->curexc_type)) +#else + if (unlikely(PyErr_Occurred())) +#endif + goto bad; + #if PY_MAJOR_VERSION >= 3 + if (local_tb) { + if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) + goto bad; + } + #endif + Py_XINCREF(local_tb); + Py_XINCREF(local_type); + Py_XINCREF(local_value); + *type = local_type; + *value = local_value; + *tb = local_tb; +#if CYTHON_FAST_THREAD_STATE + #if CYTHON_USE_EXC_INFO_STACK + { + _PyErr_StackItem *exc_info = tstate->exc_info; + tmp_type = exc_info->exc_type; + tmp_value = exc_info->exc_value; + tmp_tb = exc_info->exc_traceback; + exc_info->exc_type = local_type; + exc_info->exc_value = local_value; + exc_info->exc_traceback = local_tb; + } + #else + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = local_type; + tstate->exc_value = local_value; + tstate->exc_traceback = local_tb; + #endif + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#else + PyErr_SetExcInfo(local_type, local_value, local_tb); +#endif + return 0; +bad: + *type = 0; + *value = 0; + *tb = 0; + Py_XDECREF(local_type); + Py_XDECREF(local_value); + Py_XDECREF(local_tb); + return -1; +} + +/* GetModuleGlobalName */ +#if CYTHON_USE_DICT_VERSIONS +static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value) +#else +static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) +#endif +{ + PyObject *result; +#if !CYTHON_AVOID_BORROWED_REFS +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 + result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } else if (unlikely(PyErr_Occurred())) { + return NULL; + } +#else + result = PyDict_GetItem(__pyx_d, name); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } +#endif +#else + result = PyObject_GetItem(__pyx_d, name); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } + PyErr_Clear(); +#endif + return __Pyx_GetBuiltinName(name); +} + +/* PyErrExceptionMatches */ +#if CYTHON_FAST_THREAD_STATE +static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { + Py_ssize_t i, n; + n = PyTuple_GET_SIZE(tuple); +#if PY_MAJOR_VERSION >= 3 + for (i=0; icurexc_type; + if (exc_type == err) return 1; + if (unlikely(!exc_type)) return 0; + if (unlikely(PyTuple_Check(err))) + return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err); + return __Pyx_PyErr_GivenExceptionMatches(exc_type, err); +} +#endif + +/* GetAttr */ +static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) { +#if CYTHON_USE_TYPE_SLOTS +#if PY_MAJOR_VERSION >= 3 + if (likely(PyUnicode_Check(n))) +#else + if (likely(PyString_Check(n))) +#endif + return __Pyx_PyObject_GetAttrStr(o, n); +#endif + return PyObject_GetAttr(o, n); +} + +/* GetAttr3 */ +static PyObject *__Pyx_GetAttr3Default(PyObject *d) { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) + return NULL; + __Pyx_PyErr_Clear(); + Py_INCREF(d); + return d; +} +static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) { + PyObject *r = __Pyx_GetAttr(o, n); + return (likely(r)) ? r : __Pyx_GetAttr3Default(d); +} + +/* SwapException */ +#if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + #if CYTHON_USE_EXC_INFO_STACK + _PyErr_StackItem *exc_info = tstate->exc_info; + tmp_type = exc_info->exc_type; + tmp_value = exc_info->exc_value; + tmp_tb = exc_info->exc_traceback; + exc_info->exc_type = *type; + exc_info->exc_value = *value; + exc_info->exc_traceback = *tb; + #else + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = *type; + tstate->exc_value = *value; + tstate->exc_traceback = *tb; + #endif + *type = tmp_type; + *value = tmp_value; + *tb = tmp_tb; +} +#else +static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb); + PyErr_SetExcInfo(*type, *value, *tb); + *type = tmp_type; + *value = tmp_value; + *tb = tmp_tb; +} +#endif + +/* TypeImport */ +#ifndef __PYX_HAVE_RT_ImportType +#define __PYX_HAVE_RT_ImportType +static PyTypeObject *__Pyx_ImportType(PyObject *module, const char *module_name, const char *class_name, + size_t size, enum __Pyx_ImportType_CheckSize check_size) +{ + PyObject *result = 0; + char warning[200]; + Py_ssize_t basicsize; +#ifdef Py_LIMITED_API + PyObject *py_basicsize; +#endif + result = PyObject_GetAttrString(module, class_name); + if (!result) + goto bad; + if (!PyType_Check(result)) { + PyErr_Format(PyExc_TypeError, + "%.200s.%.200s is not a type object", + module_name, class_name); + goto bad; + } +#ifndef Py_LIMITED_API + basicsize = ((PyTypeObject *)result)->tp_basicsize; +#else + py_basicsize = PyObject_GetAttrString(result, "__basicsize__"); + if (!py_basicsize) + goto bad; + basicsize = PyLong_AsSsize_t(py_basicsize); + Py_DECREF(py_basicsize); + py_basicsize = 0; + if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred()) + goto bad; +#endif + if ((size_t)basicsize < size) { + PyErr_Format(PyExc_ValueError, + "%.200s.%.200s size changed, may indicate binary incompatibility. " + "Expected %zd from C header, got %zd from PyObject", + module_name, class_name, size, basicsize); + goto bad; + } + if (check_size == __Pyx_ImportType_CheckSize_Error && (size_t)basicsize != size) { + PyErr_Format(PyExc_ValueError, + "%.200s.%.200s size changed, may indicate binary incompatibility. " + "Expected %zd from C header, got %zd from PyObject", + module_name, class_name, size, basicsize); + goto bad; + } + else if (check_size == __Pyx_ImportType_CheckSize_Warn && (size_t)basicsize > size) { + PyOS_snprintf(warning, sizeof(warning), + "%s.%s size changed, may indicate binary incompatibility. " + "Expected %zd from C header, got %zd from PyObject", + module_name, class_name, size, basicsize); + if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad; + } + return (PyTypeObject *)result; +bad: + Py_XDECREF(result); + return NULL; +} +#endif + +/* PyObject_GenericGetAttrNoDict */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) { + PyErr_Format(PyExc_AttributeError, +#if PY_MAJOR_VERSION >= 3 + "'%.50s' object has no attribute '%U'", + tp->tp_name, attr_name); +#else + "'%.50s' object has no attribute '%.400s'", + tp->tp_name, PyString_AS_STRING(attr_name)); +#endif + return NULL; +} +static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) { + PyObject *descr; + PyTypeObject *tp = Py_TYPE(obj); + if (unlikely(!PyString_Check(attr_name))) { + return PyObject_GenericGetAttr(obj, attr_name); + } + assert(!tp->tp_dictoffset); + descr = _PyType_Lookup(tp, attr_name); + if (unlikely(!descr)) { + return __Pyx_RaiseGenericGetAttributeError(tp, attr_name); + } + Py_INCREF(descr); + #if PY_MAJOR_VERSION < 3 + if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS))) + #endif + { + descrgetfunc f = Py_TYPE(descr)->tp_descr_get; + if (unlikely(f)) { + PyObject *res = f(descr, obj, (PyObject *)tp); + Py_DECREF(descr); + return res; + } + } + return descr; +} +#endif + +/* PyObject_GenericGetAttr */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) { + if (unlikely(Py_TYPE(obj)->tp_dictoffset)) { + return PyObject_GenericGetAttr(obj, attr_name); + } + return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name); +} +#endif + +/* SetVTable */ +static int __Pyx_SetVtable(PyObject *dict, void *vtable) { +#if PY_VERSION_HEX >= 0x02070000 + PyObject *ob = PyCapsule_New(vtable, 0, 0); +#else + PyObject *ob = PyCObject_FromVoidPtr(vtable, 0); +#endif + if (!ob) + goto bad; + if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0) + goto bad; + Py_DECREF(ob); + return 0; +bad: + Py_XDECREF(ob); + return -1; +} + +/* GetVTable */ +static void* __Pyx_GetVtable(PyObject *dict) { + void* ptr; + PyObject *ob = PyObject_GetItem(dict, __pyx_n_s_pyx_vtable); + if (!ob) + goto bad; +#if PY_VERSION_HEX >= 0x02070000 + ptr = PyCapsule_GetPointer(ob, 0); +#else + ptr = PyCObject_AsVoidPtr(ob); +#endif + if (!ptr && !PyErr_Occurred()) + PyErr_SetString(PyExc_RuntimeError, "invalid vtable found for imported type"); + Py_DECREF(ob); + return ptr; +bad: + Py_XDECREF(ob); + return NULL; +} + +/* Import */ +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { + PyObject *empty_list = 0; + PyObject *module = 0; + PyObject *global_dict = 0; + PyObject *empty_dict = 0; + PyObject *list; + #if PY_MAJOR_VERSION < 3 + PyObject *py_import; + py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); + if (!py_import) + goto bad; + #endif + if (from_list) + list = from_list; + else { + empty_list = PyList_New(0); + if (!empty_list) + goto bad; + list = empty_list; + } + global_dict = PyModule_GetDict(__pyx_m); + if (!global_dict) + goto bad; + empty_dict = PyDict_New(); + if (!empty_dict) + goto bad; + { + #if PY_MAJOR_VERSION >= 3 + if (level == -1) { + if (strchr(__Pyx_MODULE_NAME, '.')) { + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, 1); + if (!module) { + if (!PyErr_ExceptionMatches(PyExc_ImportError)) + goto bad; + PyErr_Clear(); + } + } + level = 0; + } + #endif + if (!module) { + #if PY_MAJOR_VERSION < 3 + PyObject *py_level = PyInt_FromLong(level); + if (!py_level) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, py_level, (PyObject *)NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, level); + #endif + } + } +bad: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(py_import); + #endif + Py_XDECREF(empty_list); + Py_XDECREF(empty_dict); + return module; +} + +/* ImportFrom */ +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { + PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); + if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_Format(PyExc_ImportError, + #if PY_MAJOR_VERSION < 3 + "cannot import name %.230s", PyString_AS_STRING(name)); + #else + "cannot import name %S", name); + #endif + } + return value; +} + +/* FetchCommonType */ +static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { + PyObject* fake_module; + PyTypeObject* cached_type = NULL; + fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI); + if (!fake_module) return NULL; + Py_INCREF(fake_module); + cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name); + if (cached_type) { + if (!PyType_Check((PyObject*)cached_type)) { + PyErr_Format(PyExc_TypeError, + "Shared Cython type %.200s is not a type object", + type->tp_name); + goto bad; + } + if (cached_type->tp_basicsize != type->tp_basicsize) { + PyErr_Format(PyExc_TypeError, + "Shared Cython type %.200s has the wrong size, try recompiling", + type->tp_name); + goto bad; + } + } else { + if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; + PyErr_Clear(); + if (PyType_Ready(type) < 0) goto bad; + if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0) + goto bad; + Py_INCREF(type); + cached_type = type; + } +done: + Py_DECREF(fake_module); + return cached_type; +bad: + Py_XDECREF(cached_type); + cached_type = NULL; + goto done; +} + +/* CythonFunction */ +#include +static PyObject * +__Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure) +{ + if (unlikely(op->func_doc == NULL)) { + if (op->func.m_ml->ml_doc) { +#if PY_MAJOR_VERSION >= 3 + op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc); +#else + op->func_doc = PyString_FromString(op->func.m_ml->ml_doc); +#endif + if (unlikely(op->func_doc == NULL)) + return NULL; + } else { + Py_INCREF(Py_None); + return Py_None; + } + } + Py_INCREF(op->func_doc); + return op->func_doc; +} +static int +__Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context) +{ + PyObject *tmp = op->func_doc; + if (value == NULL) { + value = Py_None; + } + Py_INCREF(value); + op->func_doc = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + if (unlikely(op->func_name == NULL)) { +#if PY_MAJOR_VERSION >= 3 + op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name); +#else + op->func_name = PyString_InternFromString(op->func.m_ml->ml_name); +#endif + if (unlikely(op->func_name == NULL)) + return NULL; + } + Py_INCREF(op->func_name); + return op->func_name; +} +static int +__Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context) +{ + PyObject *tmp; +#if PY_MAJOR_VERSION >= 3 + if (unlikely(value == NULL || !PyUnicode_Check(value))) +#else + if (unlikely(value == NULL || !PyString_Check(value))) +#endif + { + PyErr_SetString(PyExc_TypeError, + "__name__ must be set to a string object"); + return -1; + } + tmp = op->func_name; + Py_INCREF(value); + op->func_name = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + Py_INCREF(op->func_qualname); + return op->func_qualname; +} +static int +__Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context) +{ + PyObject *tmp; +#if PY_MAJOR_VERSION >= 3 + if (unlikely(value == NULL || !PyUnicode_Check(value))) +#else + if (unlikely(value == NULL || !PyString_Check(value))) +#endif + { + PyErr_SetString(PyExc_TypeError, + "__qualname__ must be set to a string object"); + return -1; + } + tmp = op->func_qualname; + Py_INCREF(value); + op->func_qualname = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED void *closure) +{ + PyObject *self; + self = m->func_closure; + if (self == NULL) + self = Py_None; + Py_INCREF(self); + return self; +} +static PyObject * +__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + if (unlikely(op->func_dict == NULL)) { + op->func_dict = PyDict_New(); + if (unlikely(op->func_dict == NULL)) + return NULL; + } + Py_INCREF(op->func_dict); + return op->func_dict; +} +static int +__Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context) +{ + PyObject *tmp; + if (unlikely(value == NULL)) { + PyErr_SetString(PyExc_TypeError, + "function's dictionary may not be deleted"); + return -1; + } + if (unlikely(!PyDict_Check(value))) { + PyErr_SetString(PyExc_TypeError, + "setting function's dictionary to a non-dict"); + return -1; + } + tmp = op->func_dict; + Py_INCREF(value); + op->func_dict = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + Py_INCREF(op->func_globals); + return op->func_globals; +} +static PyObject * +__Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + Py_INCREF(Py_None); + return Py_None; +} +static PyObject * +__Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + PyObject* result = (op->func_code) ? op->func_code : Py_None; + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { + int result = 0; + PyObject *res = op->defaults_getter((PyObject *) op); + if (unlikely(!res)) + return -1; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + op->defaults_tuple = PyTuple_GET_ITEM(res, 0); + Py_INCREF(op->defaults_tuple); + op->defaults_kwdict = PyTuple_GET_ITEM(res, 1); + Py_INCREF(op->defaults_kwdict); + #else + op->defaults_tuple = PySequence_ITEM(res, 0); + if (unlikely(!op->defaults_tuple)) result = -1; + else { + op->defaults_kwdict = PySequence_ITEM(res, 1); + if (unlikely(!op->defaults_kwdict)) result = -1; + } + #endif + Py_DECREF(res); + return result; +} +static int +__Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) { + PyObject* tmp; + if (!value) { + value = Py_None; + } else if (value != Py_None && !PyTuple_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__defaults__ must be set to a tuple object"); + return -1; + } + Py_INCREF(value); + tmp = op->defaults_tuple; + op->defaults_tuple = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) { + PyObject* result = op->defaults_tuple; + if (unlikely(!result)) { + if (op->defaults_getter) { + if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL; + result = op->defaults_tuple; + } else { + result = Py_None; + } + } + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) { + PyObject* tmp; + if (!value) { + value = Py_None; + } else if (value != Py_None && !PyDict_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__kwdefaults__ must be set to a dict object"); + return -1; + } + Py_INCREF(value); + tmp = op->defaults_kwdict; + op->defaults_kwdict = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) { + PyObject* result = op->defaults_kwdict; + if (unlikely(!result)) { + if (op->defaults_getter) { + if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL; + result = op->defaults_kwdict; + } else { + result = Py_None; + } + } + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) { + PyObject* tmp; + if (!value || value == Py_None) { + value = NULL; + } else if (!PyDict_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__annotations__ must be set to a dict object"); + return -1; + } + Py_XINCREF(value); + tmp = op->func_annotations; + op->func_annotations = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) { + PyObject* result = op->func_annotations; + if (unlikely(!result)) { + result = PyDict_New(); + if (unlikely(!result)) return NULL; + op->func_annotations = result; + } + Py_INCREF(result); + return result; +} +static PyGetSetDef __pyx_CyFunction_getsets[] = { + {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, + {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, + {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, + {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, + {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, + {(char *) "__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0}, + {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, + {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, + {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, + {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, + {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, + {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, + {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, + {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, + {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, + {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, + {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, + {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, + {0, 0, 0, 0, 0} +}; +static PyMemberDef __pyx_CyFunction_members[] = { + {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), PY_WRITE_RESTRICTED, 0}, + {0, 0, 0, 0, 0} +}; +static PyObject * +__Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args) +{ +#if PY_MAJOR_VERSION >= 3 + return PyUnicode_FromString(m->func.m_ml->ml_name); +#else + return PyString_FromString(m->func.m_ml->ml_name); +#endif +} +static PyMethodDef __pyx_CyFunction_methods[] = { + {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, + {0, 0, 0, 0} +}; +#if PY_VERSION_HEX < 0x030500A0 +#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist) +#else +#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func.m_weakreflist) +#endif +static PyObject *__Pyx_CyFunction_New(PyTypeObject *type, PyMethodDef *ml, int flags, PyObject* qualname, + PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { + __pyx_CyFunctionObject *op = PyObject_GC_New(__pyx_CyFunctionObject, type); + if (op == NULL) + return NULL; + op->flags = flags; + __Pyx_CyFunction_weakreflist(op) = NULL; + op->func.m_ml = ml; + op->func.m_self = (PyObject *) op; + Py_XINCREF(closure); + op->func_closure = closure; + Py_XINCREF(module); + op->func.m_module = module; + op->func_dict = NULL; + op->func_name = NULL; + Py_INCREF(qualname); + op->func_qualname = qualname; + op->func_doc = NULL; + op->func_classobj = NULL; + op->func_globals = globals; + Py_INCREF(op->func_globals); + Py_XINCREF(code); + op->func_code = code; + op->defaults_pyobjects = 0; + op->defaults = NULL; + op->defaults_tuple = NULL; + op->defaults_kwdict = NULL; + op->defaults_getter = NULL; + op->func_annotations = NULL; + PyObject_GC_Track(op); + return (PyObject *) op; +} +static int +__Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) +{ + Py_CLEAR(m->func_closure); + Py_CLEAR(m->func.m_module); + Py_CLEAR(m->func_dict); + Py_CLEAR(m->func_name); + Py_CLEAR(m->func_qualname); + Py_CLEAR(m->func_doc); + Py_CLEAR(m->func_globals); + Py_CLEAR(m->func_code); + Py_CLEAR(m->func_classobj); + Py_CLEAR(m->defaults_tuple); + Py_CLEAR(m->defaults_kwdict); + Py_CLEAR(m->func_annotations); + if (m->defaults) { + PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); + int i; + for (i = 0; i < m->defaults_pyobjects; i++) + Py_XDECREF(pydefaults[i]); + PyObject_Free(m->defaults); + m->defaults = NULL; + } + return 0; +} +static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m) +{ + if (__Pyx_CyFunction_weakreflist(m) != NULL) + PyObject_ClearWeakRefs((PyObject *) m); + __Pyx_CyFunction_clear(m); + PyObject_GC_Del(m); +} +static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) +{ + PyObject_GC_UnTrack(m); + __Pyx__CyFunction_dealloc(m); +} +static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) +{ + Py_VISIT(m->func_closure); + Py_VISIT(m->func.m_module); + Py_VISIT(m->func_dict); + Py_VISIT(m->func_name); + Py_VISIT(m->func_qualname); + Py_VISIT(m->func_doc); + Py_VISIT(m->func_globals); + Py_VISIT(m->func_code); + Py_VISIT(m->func_classobj); + Py_VISIT(m->defaults_tuple); + Py_VISIT(m->defaults_kwdict); + if (m->defaults) { + PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); + int i; + for (i = 0; i < m->defaults_pyobjects; i++) + Py_VISIT(pydefaults[i]); + } + return 0; +} +static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type) +{ + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) { + Py_INCREF(func); + return func; + } + if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) { + if (type == NULL) + type = (PyObject *)(Py_TYPE(obj)); + return __Pyx_PyMethod_New(func, type, (PyObject *)(Py_TYPE(type))); + } + if (obj == Py_None) + obj = NULL; + return __Pyx_PyMethod_New(func, obj, type); +} +static PyObject* +__Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) +{ +#if PY_MAJOR_VERSION >= 3 + return PyUnicode_FromFormat("", + op->func_qualname, (void *)op); +#else + return PyString_FromFormat("", + PyString_AsString(op->func_qualname), (void *)op); +#endif +} +static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) { + PyCFunctionObject* f = (PyCFunctionObject*)func; + PyCFunction meth = f->m_ml->ml_meth; + Py_ssize_t size; + switch (f->m_ml->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) { + case METH_VARARGS: + if (likely(kw == NULL || PyDict_Size(kw) == 0)) + return (*meth)(self, arg); + break; + case METH_VARARGS | METH_KEYWORDS: + return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw); + case METH_NOARGS: + if (likely(kw == NULL || PyDict_Size(kw) == 0)) { + size = PyTuple_GET_SIZE(arg); + if (likely(size == 0)) + return (*meth)(self, NULL); + PyErr_Format(PyExc_TypeError, + "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", + f->m_ml->ml_name, size); + return NULL; + } + break; + case METH_O: + if (likely(kw == NULL || PyDict_Size(kw) == 0)) { + size = PyTuple_GET_SIZE(arg); + if (likely(size == 1)) { + PyObject *result, *arg0; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + arg0 = PyTuple_GET_ITEM(arg, 0); + #else + arg0 = PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL; + #endif + result = (*meth)(self, arg0); + #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) + Py_DECREF(arg0); + #endif + return result; + } + PyErr_Format(PyExc_TypeError, + "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", + f->m_ml->ml_name, size); + return NULL; + } + break; + default: + PyErr_SetString(PyExc_SystemError, "Bad call flags in " + "__Pyx_CyFunction_Call. METH_OLDARGS is no " + "longer supported!"); + return NULL; + } + PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", + f->m_ml->ml_name); + return NULL; +} +static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { + return __Pyx_CyFunction_CallMethod(func, ((PyCFunctionObject*)func)->m_self, arg, kw); +} +static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) { + PyObject *result; + __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func; + if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { + Py_ssize_t argc; + PyObject *new_args; + PyObject *self; + argc = PyTuple_GET_SIZE(args); + new_args = PyTuple_GetSlice(args, 1, argc); + if (unlikely(!new_args)) + return NULL; + self = PyTuple_GetItem(args, 0); + if (unlikely(!self)) { + Py_DECREF(new_args); + return NULL; + } + result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw); + Py_DECREF(new_args); + } else { + result = __Pyx_CyFunction_Call(func, args, kw); + } + return result; +} +static PyTypeObject __pyx_CyFunctionType_type = { + PyVarObject_HEAD_INIT(0, 0) + "cython_function_or_method", + sizeof(__pyx_CyFunctionObject), + 0, + (destructor) __Pyx_CyFunction_dealloc, + 0, + 0, + 0, +#if PY_MAJOR_VERSION < 3 + 0, +#else + 0, +#endif + (reprfunc) __Pyx_CyFunction_repr, + 0, + 0, + 0, + 0, + __Pyx_CyFunction_CallAsMethod, + 0, + 0, + 0, + 0, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, + 0, + (traverseproc) __Pyx_CyFunction_traverse, + (inquiry) __Pyx_CyFunction_clear, + 0, +#if PY_VERSION_HEX < 0x030500A0 + offsetof(__pyx_CyFunctionObject, func_weakreflist), +#else + offsetof(PyCFunctionObject, m_weakreflist), +#endif + 0, + 0, + __pyx_CyFunction_methods, + __pyx_CyFunction_members, + __pyx_CyFunction_getsets, + 0, + 0, + __Pyx_CyFunction_descr_get, + 0, + offsetof(__pyx_CyFunctionObject, func_dict), + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, +#if PY_VERSION_HEX >= 0x030400a1 + 0, +#endif +}; +static int __pyx_CyFunction_init(void) { + __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); + if (unlikely(__pyx_CyFunctionType == NULL)) { + return -1; + } + return 0; +} +static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults = PyObject_Malloc(size); + if (unlikely(!m->defaults)) + return PyErr_NoMemory(); + memset(m->defaults, 0, size); + m->defaults_pyobjects = pyobjects; + return m->defaults; +} +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults_tuple = tuple; + Py_INCREF(tuple); +} +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults_kwdict = dict; + Py_INCREF(dict); +} +static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->func_annotations = dict; + Py_INCREF(dict); +} + +/* Globals */ +static PyObject* __Pyx_Globals(void) { + Py_ssize_t i; + PyObject *names; + PyObject *globals = __pyx_d; + Py_INCREF(globals); + names = PyObject_Dir(__pyx_m); + if (!names) + goto bad; + for (i = PyList_GET_SIZE(names)-1; i >= 0; i--) { +#if CYTHON_COMPILING_IN_PYPY + PyObject* name = PySequence_ITEM(names, i); + if (!name) + goto bad; +#else + PyObject* name = PyList_GET_ITEM(names, i); +#endif + if (!PyDict_Contains(globals, name)) { + PyObject* value = __Pyx_GetAttr(__pyx_m, name); + if (!value) { +#if CYTHON_COMPILING_IN_PYPY + Py_DECREF(name); +#endif + goto bad; + } + if (PyDict_SetItem(globals, name, value) < 0) { +#if CYTHON_COMPILING_IN_PYPY + Py_DECREF(name); +#endif + Py_DECREF(value); + goto bad; + } + } +#if CYTHON_COMPILING_IN_PYPY + Py_DECREF(name); +#endif + } + Py_DECREF(names); + return globals; +bad: + Py_XDECREF(names); + Py_XDECREF(globals); + return NULL; +} + +/* CLineInTraceback */ +#ifndef CYTHON_CLINE_IN_TRACEBACK +static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { + PyObject *use_cline; + PyObject *ptype, *pvalue, *ptraceback; +#if CYTHON_COMPILING_IN_CPYTHON + PyObject **cython_runtime_dict; +#endif + if (unlikely(!__pyx_cython_runtime)) { + return c_line; + } + __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); +#if CYTHON_COMPILING_IN_CPYTHON + cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); + if (likely(cython_runtime_dict)) { + __PYX_PY_DICT_LOOKUP_IF_MODIFIED( + use_cline, *cython_runtime_dict, + __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback)) + } else +#endif + { + PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback); + if (use_cline_obj) { + use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; + Py_DECREF(use_cline_obj); + } else { + PyErr_Clear(); + use_cline = NULL; + } + } + if (!use_cline) { + c_line = 0; + PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); + } + else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { + c_line = 0; + } + __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); + return c_line; +} +#endif + +/* CodeObjectCache */ +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { + int start = 0, mid = 0, end = count - 1; + if (end >= 0 && code_line > entries[end].code_line) { + return count; + } + while (start < end) { + mid = start + (end - start) / 2; + if (code_line < entries[mid].code_line) { + end = mid; + } else if (code_line > entries[mid].code_line) { + start = mid + 1; + } else { + return mid; + } + } + if (code_line <= entries[mid].code_line) { + return mid; + } else { + return mid + 1; + } +} +static PyCodeObject *__pyx_find_code_object(int code_line) { + PyCodeObject* code_object; + int pos; + if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { + return NULL; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { + return NULL; + } + code_object = __pyx_code_cache.entries[pos].code_object; + Py_INCREF(code_object); + return code_object; +} +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { + int pos, i; + __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; + if (unlikely(!code_line)) { + return; + } + if (unlikely(!entries)) { + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); + if (likely(entries)) { + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = 64; + __pyx_code_cache.count = 1; + entries[0].code_line = code_line; + entries[0].code_object = code_object; + Py_INCREF(code_object); + } + return; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { + PyCodeObject* tmp = entries[pos].code_object; + entries[pos].code_object = code_object; + Py_DECREF(tmp); + return; + } + if (__pyx_code_cache.count == __pyx_code_cache.max_count) { + int new_max = __pyx_code_cache.max_count + 64; + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( + __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry)); + if (unlikely(!entries)) { + return; + } + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = new_max; + } + for (i=__pyx_code_cache.count; i>pos; i--) { + entries[i] = entries[i-1]; + } + entries[pos].code_line = code_line; + entries[pos].code_object = code_object; + __pyx_code_cache.count++; + Py_INCREF(code_object); +} + +/* AddTraceback */ +#include "compile.h" +#include "frameobject.h" +#include "traceback.h" +static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( + const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyObject *py_srcfile = 0; + PyObject *py_funcname = 0; + #if PY_MAJOR_VERSION < 3 + py_srcfile = PyString_FromString(filename); + #else + py_srcfile = PyUnicode_FromString(filename); + #endif + if (!py_srcfile) goto bad; + if (c_line) { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + #else + py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + #endif + } + else { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromString(funcname); + #else + py_funcname = PyUnicode_FromString(funcname); + #endif + } + if (!py_funcname) goto bad; + py_code = __Pyx_PyCode_New( + 0, + 0, + 0, + 0, + 0, + __pyx_empty_bytes, /*PyObject *code,*/ + __pyx_empty_tuple, /*PyObject *consts,*/ + __pyx_empty_tuple, /*PyObject *names,*/ + __pyx_empty_tuple, /*PyObject *varnames,*/ + __pyx_empty_tuple, /*PyObject *freevars,*/ + __pyx_empty_tuple, /*PyObject *cellvars,*/ + py_srcfile, /*PyObject *filename,*/ + py_funcname, /*PyObject *name,*/ + py_line, + __pyx_empty_bytes /*PyObject *lnotab*/ + ); + Py_DECREF(py_srcfile); + Py_DECREF(py_funcname); + return py_code; +bad: + Py_XDECREF(py_srcfile); + Py_XDECREF(py_funcname); + return NULL; +} +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyFrameObject *py_frame = 0; + PyThreadState *tstate = __Pyx_PyThreadState_Current; + if (c_line) { + c_line = __Pyx_CLineForTraceback(tstate, c_line); + } + py_code = __pyx_find_code_object(c_line ? -c_line : py_line); + if (!py_code) { + py_code = __Pyx_CreateCodeObjectForTraceback( + funcname, c_line, py_line, filename); + if (!py_code) goto bad; + __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); + } + py_frame = PyFrame_New( + tstate, /*PyThreadState *tstate,*/ + py_code, /*PyCodeObject *code,*/ + __pyx_d, /*PyObject *globals,*/ + 0 /*PyObject *locals*/ + ); + if (!py_frame) goto bad; + __Pyx_PyFrame_SetLineNumber(py_frame, py_line); + PyTraceBack_Here(py_frame); +bad: + Py_XDECREF(py_code); + Py_XDECREF(py_frame); +} + +/* CIntToPy */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { + const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(long) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(long) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(long) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(long), + little, !is_unsigned); + } +} + +/* CIntFromPyVerify */ +#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ + __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) +#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ + __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) +#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ + {\ + func_type value = func_value;\ + if (sizeof(target_type) < sizeof(func_type)) {\ + if (unlikely(value != (func_type) (target_type) value)) {\ + func_type zero = 0;\ + if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ + return (target_type) -1;\ + if (is_unsigned && unlikely(value < zero))\ + goto raise_neg_overflow;\ + else\ + goto raise_overflow;\ + }\ + }\ + return (target_type) value;\ + } + +/* CIntFromPy */ +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { + const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(long) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (long) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (long) 0; + case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0]) + case 2: + if (8 * sizeof(long) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) { + return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + case 3: + if (8 * sizeof(long) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) { + return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + case 4: + if (8 * sizeof(long) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) { + return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (long) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if (sizeof(long) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (long) 0; + case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0])) + case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0]) + case -2: + if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 2: + if (8 * sizeof(long) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case -3: + if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 3: + if (8 * sizeof(long) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case -4: + if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 4: + if (8 * sizeof(long) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + } +#endif + if (sizeof(long) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + long val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (long) -1; + } + } else { + long val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (long) -1; + val = __Pyx_PyInt_As_long(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to long"); + return (long) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to long"); + return (long) -1; +} + +/* CIntFromPy */ +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { + const int neg_one = (int) ((int) 0 - (int) 1), const_zero = (int) 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(int) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (int) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (int) 0; + case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0]) + case 2: + if (8 * sizeof(int) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) { + return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + case 3: + if (8 * sizeof(int) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) { + return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + case 4: + if (8 * sizeof(int) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) { + return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (int) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if (sizeof(int) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (int) 0; + case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0])) + case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0]) + case -2: + if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { + return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 2: + if (8 * sizeof(int) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { + return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case -3: + if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { + return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 3: + if (8 * sizeof(int) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { + return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case -4: + if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { + return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 4: + if (8 * sizeof(int) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { + return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + } +#endif + if (sizeof(int) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + int val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (int) -1; + } + } else { + int val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (int) -1; + val = __Pyx_PyInt_As_int(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to int"); + return (int) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to int"); + return (int) -1; +} + +/* FastTypeChecks */ +#if CYTHON_COMPILING_IN_CPYTHON +static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) { + while (a) { + a = a->tp_base; + if (a == b) + return 1; + } + return b == &PyBaseObject_Type; +} +static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) { + PyObject *mro; + if (a == b) return 1; + mro = a->tp_mro; + if (likely(mro)) { + Py_ssize_t i, n; + n = PyTuple_GET_SIZE(mro); + for (i = 0; i < n; i++) { + if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b) + return 1; + } + return 0; + } + return __Pyx_InBases(a, b); +} +#if PY_MAJOR_VERSION == 2 +static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { + PyObject *exception, *value, *tb; + int res; + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ErrFetch(&exception, &value, &tb); + res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; + if (unlikely(res == -1)) { + PyErr_WriteUnraisable(err); + res = 0; + } + if (!res) { + res = PyObject_IsSubclass(err, exc_type2); + if (unlikely(res == -1)) { + PyErr_WriteUnraisable(err); + res = 0; + } + } + __Pyx_ErrRestore(exception, value, tb); + return res; +} +#else +static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { + int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0; + if (!res) { + res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); + } + return res; +} +#endif +static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { + Py_ssize_t i, n; + assert(PyExceptionClass_Check(exc_type)); + n = PyTuple_GET_SIZE(tuple); +#if PY_MAJOR_VERSION >= 3 + for (i=0; itp_setattro)) + return tp->tp_setattro(obj, attr_name, value); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_setattr)) + return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value); +#endif + return PyObject_SetAttr(obj, attr_name, value); +} +#endif + +/* VoidPtrExport */ +static int __Pyx_ExportVoidPtr(PyObject *name, void *p, const char *sig) { + PyObject *d; + PyObject *cobj = 0; + d = PyDict_GetItem(__pyx_d, __pyx_n_s_pyx_capi); + Py_XINCREF(d); + if (!d) { + d = PyDict_New(); + if (!d) + goto bad; + if (__Pyx_PyObject_SetAttrStr(__pyx_m, __pyx_n_s_pyx_capi, d) < 0) + goto bad; + } +#if PY_VERSION_HEX >= 0x02070000 + cobj = PyCapsule_New(p, sig, 0); +#else + cobj = PyCObject_FromVoidPtrAndDesc(p, (void *)sig, 0); +#endif + if (!cobj) + goto bad; + if (PyDict_SetItem(d, name, cobj) < 0) + goto bad; + Py_DECREF(cobj); + Py_DECREF(d); + return 0; +bad: + Py_XDECREF(cobj); + Py_XDECREF(d); + return -1; +} + +/* FunctionExport */ +static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig) { + PyObject *d = 0; + PyObject *cobj = 0; + union { + void (*fp)(void); + void *p; + } tmp; + d = PyObject_GetAttrString(__pyx_m, (char *)"__pyx_capi__"); + if (!d) { + PyErr_Clear(); + d = PyDict_New(); + if (!d) + goto bad; + Py_INCREF(d); + if (PyModule_AddObject(__pyx_m, (char *)"__pyx_capi__", d) < 0) + goto bad; + } + tmp.fp = f; +#if PY_VERSION_HEX >= 0x02070000 + cobj = PyCapsule_New(tmp.p, sig, 0); +#else + cobj = PyCObject_FromVoidPtrAndDesc(tmp.p, (void *)sig, 0); +#endif + if (!cobj) + goto bad; + if (PyDict_SetItemString(d, name, cobj) < 0) + goto bad; + Py_DECREF(cobj); + Py_DECREF(d); + return 0; +bad: + Py_XDECREF(cobj); + Py_XDECREF(d); + return -1; +} + +/* VoidPtrImport */ +#ifndef __PYX_HAVE_RT_ImportVoidPtr +#define __PYX_HAVE_RT_ImportVoidPtr +static int __Pyx_ImportVoidPtr(PyObject *module, const char *name, void **p, const char *sig) { + PyObject *d = 0; + PyObject *cobj = 0; + d = PyObject_GetAttrString(module, (char *)"__pyx_capi__"); + if (!d) + goto bad; + cobj = PyDict_GetItemString(d, name); + if (!cobj) { + PyErr_Format(PyExc_ImportError, + "%.200s does not export expected C variable %.200s", + PyModule_GetName(module), name); + goto bad; + } +#if PY_VERSION_HEX >= 0x02070000 + if (!PyCapsule_IsValid(cobj, sig)) { + PyErr_Format(PyExc_TypeError, + "C variable %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", + PyModule_GetName(module), name, sig, PyCapsule_GetName(cobj)); + goto bad; + } + *p = PyCapsule_GetPointer(cobj, sig); +#else + {const char *desc, *s1, *s2; + desc = (const char *)PyCObject_GetDesc(cobj); + if (!desc) + goto bad; + s1 = desc; s2 = sig; + while (*s1 != '\0' && *s1 == *s2) { s1++; s2++; } + if (*s1 != *s2) { + PyErr_Format(PyExc_TypeError, + "C variable %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", + PyModule_GetName(module), name, sig, desc); + goto bad; + } + *p = PyCObject_AsVoidPtr(cobj);} +#endif + if (!(*p)) + goto bad; + Py_DECREF(d); + return 0; +bad: + Py_XDECREF(d); + return -1; +} +#endif + +/* FunctionImport */ +#ifndef __PYX_HAVE_RT_ImportFunction +#define __PYX_HAVE_RT_ImportFunction +static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig) { + PyObject *d = 0; + PyObject *cobj = 0; + union { + void (*fp)(void); + void *p; + } tmp; + d = PyObject_GetAttrString(module, (char *)"__pyx_capi__"); + if (!d) + goto bad; + cobj = PyDict_GetItemString(d, funcname); + if (!cobj) { + PyErr_Format(PyExc_ImportError, + "%.200s does not export expected C function %.200s", + PyModule_GetName(module), funcname); + goto bad; + } +#if PY_VERSION_HEX >= 0x02070000 + if (!PyCapsule_IsValid(cobj, sig)) { + PyErr_Format(PyExc_TypeError, + "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", + PyModule_GetName(module), funcname, sig, PyCapsule_GetName(cobj)); + goto bad; + } + tmp.p = PyCapsule_GetPointer(cobj, sig); +#else + {const char *desc, *s1, *s2; + desc = (const char *)PyCObject_GetDesc(cobj); + if (!desc) + goto bad; + s1 = desc; s2 = sig; + while (*s1 != '\0' && *s1 == *s2) { s1++; s2++; } + if (*s1 != *s2) { + PyErr_Format(PyExc_TypeError, + "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", + PyModule_GetName(module), funcname, sig, desc); + goto bad; + } + tmp.p = PyCObject_AsVoidPtr(cobj);} +#endif + *f = tmp.fp; + if (!(*f)) + goto bad; + Py_DECREF(d); + return 0; +bad: + Py_XDECREF(d); + return -1; +} +#endif + +/* InitStrings */ +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { + while (t->p) { + #if PY_MAJOR_VERSION < 3 + if (t->is_unicode) { + *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); + } else if (t->intern) { + *t->p = PyString_InternFromString(t->s); + } else { + *t->p = PyString_FromStringAndSize(t->s, t->n - 1); + } + #else + if (t->is_unicode | t->is_str) { + if (t->intern) { + *t->p = PyUnicode_InternFromString(t->s); + } else if (t->encoding) { + *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); + } else { + *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); + } + } else { + *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); + } + #endif + if (!*t->p) + return -1; + if (PyObject_Hash(*t->p) == -1) + return -1; + ++t; + } + return 0; +} + +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { + return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); +} +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { + Py_ssize_t ignore; + return __Pyx_PyObject_AsStringAndSize(o, &ignore); +} +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +#if !CYTHON_PEP393_ENABLED +static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { + char* defenc_c; + PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); + if (!defenc) return NULL; + defenc_c = PyBytes_AS_STRING(defenc); +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + { + char* end = defenc_c + PyBytes_GET_SIZE(defenc); + char* c; + for (c = defenc_c; c < end; c++) { + if ((unsigned char) (*c) >= 128) { + PyUnicode_AsASCIIString(o); + return NULL; + } + } + } +#endif + *length = PyBytes_GET_SIZE(defenc); + return defenc_c; +} +#else +static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { + if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + if (likely(PyUnicode_IS_ASCII(o))) { + *length = PyUnicode_GET_LENGTH(o); + return PyUnicode_AsUTF8(o); + } else { + PyUnicode_AsASCIIString(o); + return NULL; + } +#else + return PyUnicode_AsUTF8AndSize(o, length); +#endif +} +#endif +#endif +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT + if ( +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + __Pyx_sys_getdefaultencoding_not_ascii && +#endif + PyUnicode_Check(o)) { + return __Pyx_PyUnicode_AsStringAndSize(o, length); + } else +#endif +#if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) + if (PyByteArray_Check(o)) { + *length = PyByteArray_GET_SIZE(o); + return PyByteArray_AS_STRING(o); + } else +#endif + { + char* result; + int r = PyBytes_AsStringAndSize(o, &result, length); + if (unlikely(r < 0)) { + return NULL; + } else { + return result; + } + } +} +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { + int is_true = x == Py_True; + if (is_true | (x == Py_False) | (x == Py_None)) return is_true; + else return PyObject_IsTrue(x); +} +static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) { + int retval; + if (unlikely(!x)) return -1; + retval = __Pyx_PyObject_IsTrue(x); + Py_DECREF(x); + return retval; +} +static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) { +#if PY_MAJOR_VERSION >= 3 + if (PyLong_Check(result)) { + if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, + "__int__ returned non-int (type %.200s). " + "The ability to return an instance of a strict subclass of int " + "is deprecated, and may be removed in a future version of Python.", + Py_TYPE(result)->tp_name)) { + Py_DECREF(result); + return NULL; + } + return result; + } +#endif + PyErr_Format(PyExc_TypeError, + "__%.4s__ returned non-%.4s (type %.200s)", + type_name, type_name, Py_TYPE(result)->tp_name); + Py_DECREF(result); + return NULL; +} +static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { +#if CYTHON_USE_TYPE_SLOTS + PyNumberMethods *m; +#endif + const char *name = NULL; + PyObject *res = NULL; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x) || PyLong_Check(x))) +#else + if (likely(PyLong_Check(x))) +#endif + return __Pyx_NewRef(x); +#if CYTHON_USE_TYPE_SLOTS + m = Py_TYPE(x)->tp_as_number; + #if PY_MAJOR_VERSION < 3 + if (m && m->nb_int) { + name = "int"; + res = m->nb_int(x); + } + else if (m && m->nb_long) { + name = "long"; + res = m->nb_long(x); + } + #else + if (likely(m && m->nb_int)) { + name = "int"; + res = m->nb_int(x); + } + #endif +#else + if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { + res = PyNumber_Int(x); + } +#endif + if (likely(res)) { +#if PY_MAJOR_VERSION < 3 + if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) { +#else + if (unlikely(!PyLong_CheckExact(res))) { +#endif + return __Pyx_PyNumber_IntOrLongWrongResultType(res, name); + } + } + else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_TypeError, + "an integer is required"); + } + return res; +} +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { + Py_ssize_t ival; + PyObject *x; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_CheckExact(b))) { + if (sizeof(Py_ssize_t) >= sizeof(long)) + return PyInt_AS_LONG(b); + else + return PyInt_AsSsize_t(b); + } +#endif + if (likely(PyLong_CheckExact(b))) { + #if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)b)->ob_digit; + const Py_ssize_t size = Py_SIZE(b); + if (likely(__Pyx_sst_abs(size) <= 1)) { + ival = likely(size) ? digits[0] : 0; + if (size == -1) ival = -ival; + return ival; + } else { + switch (size) { + case 2: + if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { + return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -2: + if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case 3: + if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { + return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -3: + if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case 4: + if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { + return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -4: + if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + } + } + #endif + return PyLong_AsSsize_t(b); + } + x = PyNumber_Index(b); + if (!x) return -1; + ival = PyInt_AsSsize_t(x); + Py_DECREF(x); + return ival; +} +static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) { + return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False); +} +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { + return PyInt_FromSize_t(ival); +} + + +#endif /* Py_PYTHON_H */ diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_abstract_linkable.html b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_abstract_linkable.html new file mode 100644 index 00000000..6d532c15 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_abstract_linkable.html @@ -0,0 +1,2189 @@ + + + + + + Cython: _abstract_linkable.py + + + +

Generated by Cython 0.29.2

+

+ Yellow lines hint at Python interaction.
+ Click on a line that starts with a "+" to see the C code that Cython generated for it. +

+
+
+001: # -*- coding: utf-8 -*-
+
  __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 002: # cython: auto_pickle=False,embedsignature=True,always_allow_keywords=False
+
 003: """
+
 004: Internal module, support for the linkable protocol for "event" like objects.
+
 005: 
+
 006: """
+
 007: from __future__ import absolute_import
+
 008: from __future__ import division
+
 009: from __future__ import print_function
+
 010: 
+
+011: import sys
+
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_sys, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 11, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_sys, __pyx_t_1) < 0) __PYX_ERR(0, 11, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 012: 
+
+013: from gevent._hub_local import get_hub_noargs as get_hub
+
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 13, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(__pyx_n_s_get_hub_noargs);
+  __Pyx_GIVEREF(__pyx_n_s_get_hub_noargs);
+  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_get_hub_noargs);
+  __pyx_t_2 = __Pyx_Import(__pyx_n_s_gevent__hub_local, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 13, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_get_hub_noargs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 13, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_hub_noargs, __pyx_t_1) < 0) __PYX_ERR(0, 13, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
 014: 
+
+015: from gevent.exceptions import InvalidSwitchError
+
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 15, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_InvalidSwitchError);
+  __Pyx_GIVEREF(__pyx_n_s_InvalidSwitchError);
+  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_InvalidSwitchError);
+  __pyx_t_1 = __Pyx_Import(__pyx_n_s_gevent_exceptions, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 15, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_InvalidSwitchError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 15, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(__pyx_t_2);
+  __Pyx_XGOTREF(__pyx_v_6gevent_19__abstract_linkable_InvalidSwitchError);
+  __Pyx_DECREF_SET(__pyx_v_6gevent_19__abstract_linkable_InvalidSwitchError, __pyx_t_2);
+  __Pyx_GIVEREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+016: from gevent.timeout import Timeout
+
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 16, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(__pyx_n_s_Timeout);
+  __Pyx_GIVEREF(__pyx_n_s_Timeout);
+  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_Timeout);
+  __pyx_t_2 = __Pyx_Import(__pyx_n_s_gevent_timeout, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 16, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_Timeout); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 16, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(__pyx_t_1);
+  __Pyx_XGOTREF(__pyx_v_6gevent_19__abstract_linkable_Timeout);
+  __Pyx_DECREF_SET(__pyx_v_6gevent_19__abstract_linkable_Timeout, __pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
 017: 
+
+018: locals()['getcurrent'] = __import__('greenlet').getcurrent
+
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin___import__, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 18, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_getcurrent); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 18, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_2 = __Pyx_Globals(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 18, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (unlikely(PyDict_SetItem(__pyx_t_2, __pyx_n_s_getcurrent, __pyx_t_1) < 0)) __PYX_ERR(0, 18, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+/* … */
+  __pyx_tuple__3 = PyTuple_Pack(1, __pyx_n_s_greenlet); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 18, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__3);
+  __Pyx_GIVEREF(__pyx_tuple__3);
+
+019: locals()['greenlet_init'] = lambda: None
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_19__abstract_linkable_lambda(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyMethodDef __pyx_mdef_6gevent_19__abstract_linkable_lambda = {"lambda", (PyCFunction)__pyx_pw_6gevent_19__abstract_linkable_lambda, METH_NOARGS, 0};
+static PyObject *__pyx_pw_6gevent_19__abstract_linkable_lambda(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("lambda (wrapper)", 0);
+  __pyx_r = __pyx_lambda_funcdef_6gevent_19__abstract_linkable_lambda(__pyx_self);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_lambda_funcdef_6gevent_19__abstract_linkable_lambda(CYTHON_UNUSED PyObject *__pyx_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("lambda", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_19__abstract_linkable_lambda, 0, __pyx_n_s_lambda, NULL, __pyx_n_s_gevent___abstract_linkable, __pyx_d, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 19, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = __Pyx_Globals(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 19, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (unlikely(PyDict_SetItem(__pyx_t_2, __pyx_n_s_greenlet_init, __pyx_t_1) < 0)) __PYX_ERR(0, 19, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 020: 
+
+021: __all__ = [
+
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 21, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(__pyx_n_s_AbstractLinkable);
+  __Pyx_GIVEREF(__pyx_n_s_AbstractLinkable);
+  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_AbstractLinkable);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_all, __pyx_t_1) < 0) __PYX_ERR(0, 21, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 022:     'AbstractLinkable',
+
 023: ]
+
 024: 
+
+025: class AbstractLinkable(object):
+
struct __pyx_vtabstruct_6gevent_19__abstract_linkable_AbstractLinkable {
+  PyObject *(*rawlink)(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *, PyObject *, int __pyx_skip_dispatch);
+  int (*ready)(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *, int __pyx_skip_dispatch);
+  PyObject *(*unlink)(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *, PyObject *, int __pyx_skip_dispatch);
+  PyObject *(*_check_and_notify)(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *);
+  PyObject *(*_notify_links)(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *, int __pyx_skip_dispatch);
+  PyObject *(*_wait_core)(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *, PyObject *, struct __pyx_opt_args_6gevent_19__abstract_linkable_16AbstractLinkable__wait_core *__pyx_optional_args);
+  PyObject *(*_wait_return_value)(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *, PyObject *, PyObject *);
+  PyObject *(*_wait)(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *, struct __pyx_opt_args_6gevent_19__abstract_linkable_16AbstractLinkable__wait *__pyx_optional_args);
+};
+static struct __pyx_vtabstruct_6gevent_19__abstract_linkable_AbstractLinkable *__pyx_vtabptr_6gevent_19__abstract_linkable_AbstractLinkable;
+
 026:     # Encapsulates the standard parts of the linking and notifying
+
 027:     # protocol common to both repeatable events (Event, Semaphore) and
+
 028:     # one-time events (AsyncResult).
+
 029: 
+
+030:     __slots__ = ('hub', '_links', '_notifier', '_notify_all', '__weakref__')
+
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_19__abstract_linkable_AbstractLinkable->tp_dict, __pyx_n_s_slots, __pyx_tuple__4) < 0) __PYX_ERR(0, 30, __pyx_L1_error)
+  PyType_Modified(__pyx_ptype_6gevent_19__abstract_linkable_AbstractLinkable);
+/* … */
+  __pyx_tuple__4 = PyTuple_Pack(5, __pyx_n_s_hub, __pyx_n_s_links, __pyx_n_s_notifier, __pyx_n_s_notify_all, __pyx_n_s_weakref); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 30, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__4);
+  __Pyx_GIVEREF(__pyx_tuple__4);
+
 031: 
+
+032:     def __init__(self):
+
/* Python wrapper */
+static int __pyx_pw_6gevent_19__abstract_linkable_16AbstractLinkable_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static int __pyx_pw_6gevent_19__abstract_linkable_16AbstractLinkable_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
+  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
+    __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
+  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1;
+  __pyx_r = __pyx_pf_6gevent_19__abstract_linkable_16AbstractLinkable___init__(((struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_19__abstract_linkable_16AbstractLinkable___init__(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *__pyx_v_self) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = 0;
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.__abstract_linkable.AbstractLinkable.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = -1;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
 033:         # Before this implementation, AsyncResult and Semaphore
+
 034:         # maintained the order of notifications, but Event did not.
+
 035: 
+
 036:         # In gevent 1.3, before Semaphore extended this class,
+
 037:         # that was changed to not maintain the order. It was done because
+
 038:         # Event guaranteed to only call callbacks once (a set) but
+
 039:         # AsyncResult had no such guarantees.
+
 040: 
+
 041:         # Semaphore likes to maintain order of callbacks, though,
+
 042:         # so when it was added we went back to a list implementation
+
 043:         # for storing callbacks. But we want to preserve the unique callback
+
 044:         # property, so we manually check.
+
 045: 
+
 046:         # We generally don't expect to have so many waiters (for any of those
+
 047:         # objects) that testing membership and removing is a bottleneck.
+
 048: 
+
 049:         # In PyPy 2.6.1 with Cython 0.23, `cdef public` or `cdef
+
 050:         # readonly` or simply `cdef` attributes of type `object` can appear to leak if
+
 051:         # a Python subclass is used (this is visible simply
+
 052:         # instantiating this subclass if _links=[]). Our _links and
+
 053:         # _notifier are such attributes, and gevent.thread subclasses
+
 054:         # this class. Thus, we carefully manage the lifetime of the
+
 055:         # objects we put in these attributes so that, in the normal
+
 056:         # case of a semaphore used correctly (deallocated when it's not
+
 057:         # locked and no one is waiting), the leak goes away (because
+
 058:         # these objects are back to None). This can also be solved on PyPy
+
 059:         # by simply not declaring these objects in the pxd file, but that doesn't work for
+
 060:         # CPython ("No attribute...")
+
 061:         # See https://github.com/gevent/gevent/issues/660
+
+062:         self._links = set()
+
  __pyx_t_1 = PySet_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 62, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_1);
+  __Pyx_GOTREF(__pyx_v_self->_links);
+  __Pyx_DECREF(__pyx_v_self->_links);
+  __pyx_v_self->_links = ((PyObject*)__pyx_t_1);
+  __pyx_t_1 = 0;
+
+063:         self._notifier = None
+
  __Pyx_INCREF(Py_None);
+  __Pyx_GIVEREF(Py_None);
+  __Pyx_GOTREF(__pyx_v_self->_notifier);
+  __Pyx_DECREF(__pyx_v_self->_notifier);
+  __pyx_v_self->_notifier = Py_None;
+
 064:         # This is conceptually a class attribute, defined here for ease of access in
+
 065:         # cython. If it's true, when notifiers fire, all existing callbacks are called.
+
 066:         # If its false, we only call callbacks as long as ready() returns true.
+
+067:         self._notify_all = True
+
  __pyx_v_self->_notify_all = 1;
+
 068:         # we don't want to do get_hub() here to allow defining module-level objects
+
 069:         # without initializing the hub
+
+070:         self.hub = None
+
  __Pyx_INCREF(Py_None);
+  __Pyx_GIVEREF(Py_None);
+  __Pyx_GOTREF(__pyx_v_self->hub);
+  __Pyx_DECREF(((PyObject *)__pyx_v_self->hub));
+  __pyx_v_self->hub = ((struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *)Py_None);
+
 071: 
+
+072:     def linkcount(self):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_19__abstract_linkable_16AbstractLinkable_3linkcount(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6gevent_19__abstract_linkable_16AbstractLinkable_2linkcount[] = "AbstractLinkable.linkcount(self)";
+static PyMethodDef __pyx_mdef_6gevent_19__abstract_linkable_16AbstractLinkable_3linkcount = {"linkcount", (PyCFunction)__pyx_pw_6gevent_19__abstract_linkable_16AbstractLinkable_3linkcount, METH_NOARGS, __pyx_doc_6gevent_19__abstract_linkable_16AbstractLinkable_2linkcount};
+static PyObject *__pyx_pw_6gevent_19__abstract_linkable_16AbstractLinkable_3linkcount(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("linkcount (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_19__abstract_linkable_16AbstractLinkable_2linkcount(((struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_19__abstract_linkable_16AbstractLinkable_2linkcount(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("linkcount", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.__abstract_linkable.AbstractLinkable.linkcount", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__5 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 72, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__5);
+  __Pyx_GIVEREF(__pyx_tuple__5);
+/* … */
+  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_19__abstract_linkable_16AbstractLinkable_3linkcount, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AbstractLinkable_linkcount, NULL, __pyx_n_s_gevent___abstract_linkable, __pyx_d, ((PyObject *)__pyx_codeobj__6)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 72, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_19__abstract_linkable_AbstractLinkable->tp_dict, __pyx_n_s_linkcount, __pyx_t_1) < 0) __PYX_ERR(0, 72, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_19__abstract_linkable_AbstractLinkable);
+  __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__5, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__abstract_linkable_py, __pyx_n_s_linkcount, 72, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__6)) __PYX_ERR(0, 72, __pyx_L1_error)
+
 073:         # For testing: how many objects are linked to this one?
+
+074:         return len(self._links)
+
  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __pyx_v_self->_links;
+  __Pyx_INCREF(__pyx_t_1);
+  if (unlikely(__pyx_t_1 == Py_None)) {
+    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
+    __PYX_ERR(0, 74, __pyx_L1_error)
+  }
+  __pyx_t_2 = PySet_GET_SIZE(__pyx_t_1); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 74, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 74, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
 075: 
+
+076:     def ready(self):
+
static PyObject *__pyx_pw_6gevent_19__abstract_linkable_16AbstractLinkable_5ready(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static int __pyx_f_6gevent_19__abstract_linkable_16AbstractLinkable_ready(CYTHON_UNUSED struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *__pyx_v_self, int __pyx_skip_dispatch) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("ready", 0);
+  /* Check if called by wrapper */
+  if (unlikely(__pyx_skip_dispatch)) ;
+  /* Check if overridden in Python */
+  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
+    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
+    if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
+    else {
+      PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      #endif
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_ready); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 76, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_19__abstract_linkable_16AbstractLinkable_5ready)) {
+        __Pyx_INCREF(__pyx_t_1);
+        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+          if (likely(__pyx_t_4)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+            __Pyx_INCREF(__pyx_t_4);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_3, function);
+          }
+        }
+        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
+        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 76, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 76, __pyx_L1_error)
+        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+        __pyx_r = __pyx_t_5;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        goto __pyx_L0;
+      }
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+      tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
+      if (unlikely(type_dict_guard != tp_dict_version)) {
+        tp_dict_version = obj_dict_version = 0;
+      }
+      #endif
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    }
+    #endif
+  }
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_WriteUnraisable("gevent.__abstract_linkable.AbstractLinkable.ready", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_19__abstract_linkable_16AbstractLinkable_5ready(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6gevent_19__abstract_linkable_16AbstractLinkable_4ready[] = "AbstractLinkable.ready(self) -> bool";
+static PyMethodDef __pyx_mdef_6gevent_19__abstract_linkable_16AbstractLinkable_5ready = {"ready", (PyCFunction)__pyx_pw_6gevent_19__abstract_linkable_16AbstractLinkable_5ready, METH_NOARGS, __pyx_doc_6gevent_19__abstract_linkable_16AbstractLinkable_4ready};
+static PyObject *__pyx_pw_6gevent_19__abstract_linkable_16AbstractLinkable_5ready(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("ready (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_19__abstract_linkable_16AbstractLinkable_4ready(((struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_19__abstract_linkable_16AbstractLinkable_4ready(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("ready", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_f_6gevent_19__abstract_linkable_16AbstractLinkable_ready(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 76, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.__abstract_linkable.AbstractLinkable.ready", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__7 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 76, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__7);
+  __Pyx_GIVEREF(__pyx_tuple__7);
+/* … */
+  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_19__abstract_linkable_16AbstractLinkable_5ready, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AbstractLinkable_ready, NULL, __pyx_n_s_gevent___abstract_linkable, __pyx_d, ((PyObject *)__pyx_codeobj__8)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 76, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_19__abstract_linkable_AbstractLinkable->tp_dict, __pyx_n_s_ready, __pyx_t_1) < 0) __PYX_ERR(0, 76, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_19__abstract_linkable_AbstractLinkable);
+  __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__abstract_linkable_py, __pyx_n_s_ready, 76, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) __PYX_ERR(0, 76, __pyx_L1_error)
+
 077:         # Instances must define this
+
+078:         raise NotImplementedError
+
  __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0);
+  __PYX_ERR(0, 78, __pyx_L1_error)
+
 079: 
+
+080:     def _check_and_notify(self):
+
static PyObject *__pyx_f_6gevent_19__abstract_linkable_16AbstractLinkable__check_and_notify(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_check_and_notify", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_XDECREF(__pyx_t_6);
+  __Pyx_XDECREF(__pyx_t_7);
+  __Pyx_AddTraceback("gevent.__abstract_linkable.AbstractLinkable._check_and_notify", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
 081:         # If this object is ready to be notified, begin the process.
+
+082:         if self.ready() and self._links and not self._notifier:
+
  __pyx_t_2 = (((struct __pyx_vtabstruct_6gevent_19__abstract_linkable_AbstractLinkable *)__pyx_v_self->__pyx_vtab)->ready(__pyx_v_self, 0) != 0);
+  if (__pyx_t_2) {
+  } else {
+    __pyx_t_1 = __pyx_t_2;
+    goto __pyx_L4_bool_binop_done;
+  }
+  __pyx_t_2 = (__pyx_v_self->_links != Py_None)&&(PySet_GET_SIZE(__pyx_v_self->_links) != 0);
+  if (__pyx_t_2) {
+  } else {
+    __pyx_t_1 = __pyx_t_2;
+    goto __pyx_L4_bool_binop_done;
+  }
+  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_self->_notifier); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 82, __pyx_L1_error)
+  __pyx_t_3 = ((!__pyx_t_2) != 0);
+  __pyx_t_1 = __pyx_t_3;
+  __pyx_L4_bool_binop_done:;
+  if (__pyx_t_1) {
+/* … */
+  }
+
+083:             if self.hub is None:
+
    __pyx_t_1 = (((PyObject *)__pyx_v_self->hub) == Py_None);
+    __pyx_t_3 = (__pyx_t_1 != 0);
+    if (__pyx_t_3) {
+/* … */
+    }
+
+084:                 self.hub = get_hub()
+
      __pyx_t_4 = ((PyObject *)__pyx_f_6gevent_11__hub_local_get_hub_noargs(0)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 84, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_4);
+      __Pyx_GIVEREF(__pyx_t_4);
+      __Pyx_GOTREF(__pyx_v_self->hub);
+      __Pyx_DECREF(((PyObject *)__pyx_v_self->hub));
+      __pyx_v_self->hub = ((struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *)__pyx_t_4);
+      __pyx_t_4 = 0;
+
 085: 
+
+086:             self._notifier = self.hub.loop.run_callback(self._notify_links)
+
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->hub->loop, __pyx_n_s_run_callback); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 86, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_5);
+    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_notify_links); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 86, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_6);
+    __pyx_t_7 = NULL;
+    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
+      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
+      if (likely(__pyx_t_7)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
+        __Pyx_INCREF(__pyx_t_7);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_5, function);
+      }
+    }
+    __pyx_t_4 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_7, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6);
+    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 86, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __Pyx_GIVEREF(__pyx_t_4);
+    __Pyx_GOTREF(__pyx_v_self->_notifier);
+    __Pyx_DECREF(__pyx_v_self->_notifier);
+    __pyx_v_self->_notifier = __pyx_t_4;
+    __pyx_t_4 = 0;
+
 087: 
+
+088:     def rawlink(self, callback):
+
static PyObject *__pyx_pw_6gevent_19__abstract_linkable_16AbstractLinkable_7rawlink(PyObject *__pyx_v_self, PyObject *__pyx_v_callback); /*proto*/
+static PyObject *__pyx_f_6gevent_19__abstract_linkable_16AbstractLinkable_rawlink(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *__pyx_v_self, PyObject *__pyx_v_callback, int __pyx_skip_dispatch) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("rawlink", 0);
+  /* Check if called by wrapper */
+  if (unlikely(__pyx_skip_dispatch)) ;
+  /* Check if overridden in Python */
+  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
+    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
+    if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
+    else {
+      PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      #endif
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_rawlink); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 88, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_19__abstract_linkable_16AbstractLinkable_7rawlink)) {
+        __Pyx_XDECREF(__pyx_r);
+        __Pyx_INCREF(__pyx_t_1);
+        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+          if (likely(__pyx_t_4)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+            __Pyx_INCREF(__pyx_t_4);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_3, function);
+          }
+        }
+        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_callback) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_callback);
+        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 88, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __pyx_r = __pyx_t_2;
+        __pyx_t_2 = 0;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        goto __pyx_L0;
+      }
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+      tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
+      if (unlikely(type_dict_guard != tp_dict_version)) {
+        tp_dict_version = obj_dict_version = 0;
+      }
+      #endif
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    }
+    #endif
+  }
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_AddTraceback("gevent.__abstract_linkable.AbstractLinkable.rawlink", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_19__abstract_linkable_16AbstractLinkable_7rawlink(PyObject *__pyx_v_self, PyObject *__pyx_v_callback); /*proto*/
+static char __pyx_doc_6gevent_19__abstract_linkable_16AbstractLinkable_6rawlink[] = "AbstractLinkable.rawlink(self, callback)\n\n        Register a callback to call when this object is ready.\n\n        *callback* will be called in the :class:`Hub\n        <gevent.hub.Hub>`, so it must not use blocking gevent API.\n        *callback* will be passed one argument: this instance.\n        ";
+static PyMethodDef __pyx_mdef_6gevent_19__abstract_linkable_16AbstractLinkable_7rawlink = {"rawlink", (PyCFunction)__pyx_pw_6gevent_19__abstract_linkable_16AbstractLinkable_7rawlink, METH_O, __pyx_doc_6gevent_19__abstract_linkable_16AbstractLinkable_6rawlink};
+static PyObject *__pyx_pw_6gevent_19__abstract_linkable_16AbstractLinkable_7rawlink(PyObject *__pyx_v_self, PyObject *__pyx_v_callback) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("rawlink (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_19__abstract_linkable_16AbstractLinkable_6rawlink(((struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *)__pyx_v_self), ((PyObject *)__pyx_v_callback));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_19__abstract_linkable_16AbstractLinkable_6rawlink(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *__pyx_v_self, PyObject *__pyx_v_callback) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("rawlink", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __pyx_f_6gevent_19__abstract_linkable_16AbstractLinkable_rawlink(__pyx_v_self, __pyx_v_callback, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 88, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.__abstract_linkable.AbstractLinkable.rawlink", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__9 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_callback); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 88, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__9);
+  __Pyx_GIVEREF(__pyx_tuple__9);
+/* … */
+  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_19__abstract_linkable_16AbstractLinkable_7rawlink, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AbstractLinkable_rawlink, NULL, __pyx_n_s_gevent___abstract_linkable, __pyx_d, ((PyObject *)__pyx_codeobj__10)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 88, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_19__abstract_linkable_AbstractLinkable->tp_dict, __pyx_n_s_rawlink, __pyx_t_1) < 0) __PYX_ERR(0, 88, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_19__abstract_linkable_AbstractLinkable);
+  __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__9, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__abstract_linkable_py, __pyx_n_s_rawlink, 88, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__10)) __PYX_ERR(0, 88, __pyx_L1_error)
+
 089:         """
+
 090:         Register a callback to call when this object is ready.
+
 091: 
+
 092:         *callback* will be called in the :class:`Hub
+
 093:         <gevent.hub.Hub>`, so it must not use blocking gevent API.
+
 094:         *callback* will be passed one argument: this instance.
+
 095:         """
+
+096:         if not callable(callback):
+
  __pyx_t_5 = __Pyx_PyCallable_Check(__pyx_v_callback); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 96, __pyx_L1_error)
+  __pyx_t_6 = ((!(__pyx_t_5 != 0)) != 0);
+  if (unlikely(__pyx_t_6)) {
+/* … */
+  }
+
+097:             raise TypeError('Expected callable: %r' % (callback, ))
+
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 97, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_INCREF(__pyx_v_callback);
+    __Pyx_GIVEREF(__pyx_v_callback);
+    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_callback);
+    __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_Expected_callable_r, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 97, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 97, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __PYX_ERR(0, 97, __pyx_L1_error)
+
 098: 
+
+099:         self._links.add(callback)
+
  if (unlikely(__pyx_v_self->_links == Py_None)) {
+    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "add");
+    __PYX_ERR(0, 99, __pyx_L1_error)
+  }
+  __pyx_t_7 = PySet_Add(__pyx_v_self->_links, __pyx_v_callback); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 99, __pyx_L1_error)
+
+100:         self._check_and_notify()
+
  __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_19__abstract_linkable_AbstractLinkable *)__pyx_v_self->__pyx_vtab)->_check_and_notify(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 100, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 101: 
+
+102:     def unlink(self, callback):
+
static PyObject *__pyx_pw_6gevent_19__abstract_linkable_16AbstractLinkable_9unlink(PyObject *__pyx_v_self, PyObject *__pyx_v_callback); /*proto*/
+static PyObject *__pyx_f_6gevent_19__abstract_linkable_16AbstractLinkable_unlink(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *__pyx_v_self, PyObject *__pyx_v_callback, int __pyx_skip_dispatch) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("unlink", 0);
+  /* Check if called by wrapper */
+  if (unlikely(__pyx_skip_dispatch)) ;
+  /* Check if overridden in Python */
+  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
+    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
+    if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
+    else {
+      PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      #endif
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_unlink); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 102, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_19__abstract_linkable_16AbstractLinkable_9unlink)) {
+        __Pyx_XDECREF(__pyx_r);
+        __Pyx_INCREF(__pyx_t_1);
+        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+          if (likely(__pyx_t_4)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+            __Pyx_INCREF(__pyx_t_4);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_3, function);
+          }
+        }
+        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_callback) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_callback);
+        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 102, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __pyx_r = __pyx_t_2;
+        __pyx_t_2 = 0;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        goto __pyx_L0;
+      }
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+      tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
+      if (unlikely(type_dict_guard != tp_dict_version)) {
+        tp_dict_version = obj_dict_version = 0;
+      }
+      #endif
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    }
+    #endif
+  }
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_AddTraceback("gevent.__abstract_linkable.AbstractLinkable.unlink", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_19__abstract_linkable_16AbstractLinkable_9unlink(PyObject *__pyx_v_self, PyObject *__pyx_v_callback); /*proto*/
+static char __pyx_doc_6gevent_19__abstract_linkable_16AbstractLinkable_8unlink[] = "AbstractLinkable.unlink(self, callback)\nRemove the callback set by :meth:`rawlink`";
+static PyMethodDef __pyx_mdef_6gevent_19__abstract_linkable_16AbstractLinkable_9unlink = {"unlink", (PyCFunction)__pyx_pw_6gevent_19__abstract_linkable_16AbstractLinkable_9unlink, METH_O, __pyx_doc_6gevent_19__abstract_linkable_16AbstractLinkable_8unlink};
+static PyObject *__pyx_pw_6gevent_19__abstract_linkable_16AbstractLinkable_9unlink(PyObject *__pyx_v_self, PyObject *__pyx_v_callback) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("unlink (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_19__abstract_linkable_16AbstractLinkable_8unlink(((struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *)__pyx_v_self), ((PyObject *)__pyx_v_callback));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_19__abstract_linkable_16AbstractLinkable_8unlink(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *__pyx_v_self, PyObject *__pyx_v_callback) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("unlink", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __pyx_f_6gevent_19__abstract_linkable_16AbstractLinkable_unlink(__pyx_v_self, __pyx_v_callback, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 102, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.__abstract_linkable.AbstractLinkable.unlink", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__11 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_callback); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 102, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__11);
+  __Pyx_GIVEREF(__pyx_tuple__11);
+/* … */
+  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_19__abstract_linkable_16AbstractLinkable_9unlink, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AbstractLinkable_unlink, NULL, __pyx_n_s_gevent___abstract_linkable, __pyx_d, ((PyObject *)__pyx_codeobj__12)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 102, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_19__abstract_linkable_AbstractLinkable->tp_dict, __pyx_n_s_unlink, __pyx_t_1) < 0) __PYX_ERR(0, 102, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_19__abstract_linkable_AbstractLinkable);
+  __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__11, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__abstract_linkable_py, __pyx_n_s_unlink, 102, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(0, 102, __pyx_L1_error)
+
 103:         """Remove the callback set by :meth:`rawlink`"""
+
+104:         self._links.discard(callback)
+
  if (unlikely(__pyx_v_self->_links == Py_None)) {
+    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "discard");
+    __PYX_ERR(0, 104, __pyx_L1_error)
+  }
+  __pyx_t_5 = __Pyx_PySet_Discard(__pyx_v_self->_links, __pyx_v_callback); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 104, __pyx_L1_error)
+
 105: 
+
+106:         if not self._links and self._notifier is not None:
+
  __pyx_t_7 = (__pyx_v_self->_links != Py_None)&&(PySet_GET_SIZE(__pyx_v_self->_links) != 0);
+  __pyx_t_8 = ((!__pyx_t_7) != 0);
+  if (__pyx_t_8) {
+  } else {
+    __pyx_t_6 = __pyx_t_8;
+    goto __pyx_L4_bool_binop_done;
+  }
+  __pyx_t_8 = (__pyx_v_self->_notifier != Py_None);
+  __pyx_t_7 = (__pyx_t_8 != 0);
+  __pyx_t_6 = __pyx_t_7;
+  __pyx_L4_bool_binop_done:;
+  if (__pyx_t_6) {
+/* … */
+  }
+
 107:             # If we currently have one queued, de-queue it.
+
 108:             # This will break a reference cycle.
+
 109:             # (self._notifier -> self._notify_links -> self)
+
 110:             # But we can't set it to None in case it was actually running.
+
+111:             self._notifier.stop()
+
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_notifier, __pyx_n_s_stop); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 111, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_3 = NULL;
+    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+      if (likely(__pyx_t_3)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+        __Pyx_INCREF(__pyx_t_3);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_2, function);
+      }
+    }
+    __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
+    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 111, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 112: 
+
 113: 
+
+114:     def _notify_links(self):
+
static PyObject *__pyx_pw_6gevent_19__abstract_linkable_16AbstractLinkable_11_notify_links(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyObject *__pyx_f_6gevent_19__abstract_linkable_16AbstractLinkable__notify_links(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *__pyx_v_self, int __pyx_skip_dispatch) {
+  PyObject *__pyx_v_notifier = NULL;
+  PyObject *__pyx_v_todo = NULL;
+  PyObject *__pyx_v_link = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_notify_links", 0);
+  /* Check if called by wrapper */
+  if (unlikely(__pyx_skip_dispatch)) ;
+  /* Check if overridden in Python */
+  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
+    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
+    if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
+    else {
+      PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      #endif
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_notify_links); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 114, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_19__abstract_linkable_16AbstractLinkable_11_notify_links)) {
+        __Pyx_XDECREF(__pyx_r);
+        __Pyx_INCREF(__pyx_t_1);
+        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+          if (likely(__pyx_t_4)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+            __Pyx_INCREF(__pyx_t_4);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_3, function);
+          }
+        }
+        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
+        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 114, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __pyx_r = __pyx_t_2;
+        __pyx_t_2 = 0;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        goto __pyx_L0;
+      }
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+      tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
+      if (unlikely(type_dict_guard != tp_dict_version)) {
+        tp_dict_version = obj_dict_version = 0;
+      }
+      #endif
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    }
+    #endif
+  }
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_14);
+  __Pyx_XDECREF(__pyx_t_15);
+  __Pyx_XDECREF(__pyx_t_16);
+  __Pyx_XDECREF(__pyx_t_17);
+  __Pyx_XDECREF(__pyx_t_18);
+  __Pyx_AddTraceback("gevent.__abstract_linkable.AbstractLinkable._notify_links", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_notifier);
+  __Pyx_XDECREF(__pyx_v_todo);
+  __Pyx_XDECREF(__pyx_v_link);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_19__abstract_linkable_16AbstractLinkable_11_notify_links(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6gevent_19__abstract_linkable_16AbstractLinkable_10_notify_links[] = "AbstractLinkable._notify_links(self)";
+static PyMethodDef __pyx_mdef_6gevent_19__abstract_linkable_16AbstractLinkable_11_notify_links = {"_notify_links", (PyCFunction)__pyx_pw_6gevent_19__abstract_linkable_16AbstractLinkable_11_notify_links, METH_NOARGS, __pyx_doc_6gevent_19__abstract_linkable_16AbstractLinkable_10_notify_links};
+static PyObject *__pyx_pw_6gevent_19__abstract_linkable_16AbstractLinkable_11_notify_links(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_notify_links (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_19__abstract_linkable_16AbstractLinkable_10_notify_links(((struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_19__abstract_linkable_16AbstractLinkable_10_notify_links(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_notify_links", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __pyx_f_6gevent_19__abstract_linkable_16AbstractLinkable__notify_links(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 114, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.__abstract_linkable.AbstractLinkable._notify_links", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__13 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 114, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__13);
+  __Pyx_GIVEREF(__pyx_tuple__13);
+/* … */
+  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_19__abstract_linkable_16AbstractLinkable_11_notify_links, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AbstractLinkable__notify_links, NULL, __pyx_n_s_gevent___abstract_linkable, __pyx_d, ((PyObject *)__pyx_codeobj__14)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 114, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_19__abstract_linkable_AbstractLinkable->tp_dict, __pyx_n_s_notify_links, __pyx_t_1) < 0) __PYX_ERR(0, 114, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_19__abstract_linkable_AbstractLinkable);
+
 115:         # We release self._notifier here. We are called by it
+
 116:         # at the end of the loop, and it is now false in a boolean way (as soon
+
 117:         # as this method returns).
+
+118:         notifier = self._notifier
+
  __pyx_t_1 = __pyx_v_self->_notifier;
+  __Pyx_INCREF(__pyx_t_1);
+  __pyx_v_notifier = __pyx_t_1;
+  __pyx_t_1 = 0;
+
 119:         # We were ready() at the time this callback was scheduled;
+
 120:         # we may not be anymore, and that status may change during
+
 121:         # callback processing. Some of our subclasses will want to
+
 122:         # notify everyone that the status was once true, even though not it
+
 123:         # may not be anymore.
+
+124:         todo = set(self._links)
+
  __pyx_t_1 = PySet_New(__pyx_v_self->_links); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 124, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_v_todo = ((PyObject*)__pyx_t_1);
+  __pyx_t_1 = 0;
+
+125:         try:
+
  /*try:*/ {
+
+126:             for link in todo:
+
    __pyx_t_5 = 0;
+    __pyx_t_2 = __Pyx_set_iterator(__pyx_v_todo, 1, (&__pyx_t_6), (&__pyx_t_7)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 126, __pyx_L4_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_XDECREF(__pyx_t_1);
+    __pyx_t_1 = __pyx_t_2;
+    __pyx_t_2 = 0;
+    while (1) {
+      __pyx_t_8 = __Pyx_set_iter_next(__pyx_t_1, __pyx_t_6, &__pyx_t_5, &__pyx_t_2, __pyx_t_7);
+      if (unlikely(__pyx_t_8 == 0)) break;
+      if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(0, 126, __pyx_L4_error)
+      __Pyx_GOTREF(__pyx_t_2);
+      __Pyx_XDECREF_SET(__pyx_v_link, __pyx_t_2);
+      __pyx_t_2 = 0;
+
+127:                 if not self._notify_all and not self.ready():
+
      __pyx_t_10 = ((!(__pyx_v_self->_notify_all != 0)) != 0);
+      if (__pyx_t_10) {
+      } else {
+        __pyx_t_9 = __pyx_t_10;
+        goto __pyx_L9_bool_binop_done;
+      }
+      __pyx_t_10 = ((!(((struct __pyx_vtabstruct_6gevent_19__abstract_linkable_AbstractLinkable *)__pyx_v_self->__pyx_vtab)->ready(__pyx_v_self, 0) != 0)) != 0);
+      __pyx_t_9 = __pyx_t_10;
+      __pyx_L9_bool_binop_done:;
+      if (__pyx_t_9) {
+/* … */
+      }
+
+128:                     break
+
        goto __pyx_L7_break;
+
 129: 
+
+130:                 if link not in self._links:
+
      if (unlikely(__pyx_v_self->_links == Py_None)) {
+        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
+        __PYX_ERR(0, 130, __pyx_L4_error)
+      }
+      __pyx_t_9 = (__Pyx_PySet_ContainsTF(__pyx_v_link, __pyx_v_self->_links, Py_NE)); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 130, __pyx_L4_error)
+      __pyx_t_10 = (__pyx_t_9 != 0);
+      if (__pyx_t_10) {
+/* … */
+      }
+
 131:                     # Been removed already by some previous link. OK, fine.
+
+132:                     continue
+
        goto __pyx_L6_continue;
+
+133:                 try:
+
      /*try:*/ {
+        {
+          /*try:*/ {
+/* … */
+          }
+          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
+          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
+          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
+          goto __pyx_L24_try_end;
+          __pyx_L17_error:;
+          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+/* … */
+          __Pyx_XGIVEREF(__pyx_t_11);
+          __Pyx_XGIVEREF(__pyx_t_12);
+          __Pyx_XGIVEREF(__pyx_t_13);
+          __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13);
+          goto __pyx_L15_error;
+          __pyx_L18_exception_handled:;
+          __Pyx_XGIVEREF(__pyx_t_11);
+          __Pyx_XGIVEREF(__pyx_t_12);
+          __Pyx_XGIVEREF(__pyx_t_13);
+          __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13);
+          __pyx_L24_try_end:;
+        }
+      }
+
+134:                     link(self)
+
            __Pyx_INCREF(__pyx_v_link);
+            __pyx_t_3 = __pyx_v_link; __pyx_t_4 = NULL;
+            if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+              __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+              if (likely(__pyx_t_4)) {
+                PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+                __Pyx_INCREF(__pyx_t_4);
+                __Pyx_INCREF(function);
+                __Pyx_DECREF_SET(__pyx_t_3, function);
+              }
+            }
+            __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, ((PyObject *)__pyx_v_self)) : __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_self));
+            __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+            if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 134, __pyx_L17_error)
+            __Pyx_GOTREF(__pyx_t_2);
+            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+135:                 except: # pylint:disable=bare-except
+
          /*except:*/ {
+            __Pyx_AddTraceback("gevent.__abstract_linkable.AbstractLinkable._notify_links", __pyx_clineno, __pyx_lineno, __pyx_filename);
+            if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4) < 0) __PYX_ERR(0, 135, __pyx_L19_except_error)
+            __Pyx_GOTREF(__pyx_t_2);
+            __Pyx_GOTREF(__pyx_t_3);
+            __Pyx_GOTREF(__pyx_t_4);
+
 136:                     # We're running in the hub, so getcurrent() returns
+
 137:                     # a hub.
+
+138:                     self.hub.handle_error((link, self), *sys.exc_info()) # pylint:disable=undefined-variable
+
            __pyx_t_14 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->hub), __pyx_n_s_handle_error); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 138, __pyx_L19_except_error)
+            __Pyx_GOTREF(__pyx_t_14);
+            __pyx_t_15 = PyTuple_New(2); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 138, __pyx_L19_except_error)
+            __Pyx_GOTREF(__pyx_t_15);
+            __Pyx_INCREF(__pyx_v_link);
+            __Pyx_GIVEREF(__pyx_v_link);
+            PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_v_link);
+            __Pyx_INCREF(((PyObject *)__pyx_v_self));
+            __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
+            PyTuple_SET_ITEM(__pyx_t_15, 1, ((PyObject *)__pyx_v_self));
+            __pyx_t_16 = PyTuple_New(1); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 138, __pyx_L19_except_error)
+            __Pyx_GOTREF(__pyx_t_16);
+            __Pyx_GIVEREF(__pyx_t_15);
+            PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_15);
+            __pyx_t_15 = 0;
+            __Pyx_GetModuleGlobalName(__pyx_t_17, __pyx_n_s_sys); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 138, __pyx_L19_except_error)
+            __Pyx_GOTREF(__pyx_t_17);
+            __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_t_17, __pyx_n_s_exc_info); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 138, __pyx_L19_except_error)
+            __Pyx_GOTREF(__pyx_t_18);
+            __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
+            __pyx_t_17 = NULL;
+            if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_18))) {
+              __pyx_t_17 = PyMethod_GET_SELF(__pyx_t_18);
+              if (likely(__pyx_t_17)) {
+                PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_18);
+                __Pyx_INCREF(__pyx_t_17);
+                __Pyx_INCREF(function);
+                __Pyx_DECREF_SET(__pyx_t_18, function);
+              }
+            }
+            __pyx_t_15 = (__pyx_t_17) ? __Pyx_PyObject_CallOneArg(__pyx_t_18, __pyx_t_17) : __Pyx_PyObject_CallNoArg(__pyx_t_18);
+            __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
+            if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 138, __pyx_L19_except_error)
+            __Pyx_GOTREF(__pyx_t_15);
+            __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
+            __pyx_t_18 = __Pyx_PySequence_Tuple(__pyx_t_15); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 138, __pyx_L19_except_error)
+            __Pyx_GOTREF(__pyx_t_18);
+            __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
+            __pyx_t_15 = PyNumber_Add(__pyx_t_16, __pyx_t_18); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 138, __pyx_L19_except_error)
+            __Pyx_GOTREF(__pyx_t_15);
+            __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
+            __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
+            __pyx_t_18 = __Pyx_PyObject_Call(__pyx_t_14, __pyx_t_15, NULL); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 138, __pyx_L19_except_error)
+            __Pyx_GOTREF(__pyx_t_18);
+            __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
+            __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
+            __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
+            __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+            __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+            __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+            goto __pyx_L18_exception_handled;
+          }
+          __pyx_L19_except_error:;
+
 139:                 finally:
+
+140:                     if getattr(link, 'auto_unlink', None):
+
      /*finally:*/ {
+        /*normal exit:*/{
+          __pyx_t_4 = __Pyx_GetAttr3(__pyx_v_link, __pyx_n_s_auto_unlink, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 140, __pyx_L4_error)
+          __Pyx_GOTREF(__pyx_t_4);
+          __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 140, __pyx_L4_error)
+          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+          if (__pyx_t_10) {
+/* … */
+          }
+          goto __pyx_L16;
+        }
+        __pyx_L15_error:;
+        /*exception exit:*/{
+          __Pyx_PyThreadState_declare
+          __Pyx_PyThreadState_assign
+          __pyx_t_13 = 0; __pyx_t_12 = 0; __pyx_t_11 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_t_23 = 0;
+          __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
+          __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
+          __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
+          __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
+          __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
+          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_21, &__pyx_t_22, &__pyx_t_23);
+          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_13, &__pyx_t_12, &__pyx_t_11) < 0)) __Pyx_ErrFetch(&__pyx_t_13, &__pyx_t_12, &__pyx_t_11);
+          __Pyx_XGOTREF(__pyx_t_13);
+          __Pyx_XGOTREF(__pyx_t_12);
+          __Pyx_XGOTREF(__pyx_t_11);
+          __Pyx_XGOTREF(__pyx_t_21);
+          __Pyx_XGOTREF(__pyx_t_22);
+          __Pyx_XGOTREF(__pyx_t_23);
+          __pyx_t_8 = __pyx_lineno; __pyx_t_19 = __pyx_clineno; __pyx_t_20 = __pyx_filename;
+          {
+            __pyx_t_4 = __Pyx_GetAttr3(__pyx_v_link, __pyx_n_s_auto_unlink, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 140, __pyx_L31_error)
+            __Pyx_GOTREF(__pyx_t_4);
+            __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 140, __pyx_L31_error)
+            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+            if (__pyx_t_10) {
+/* … */
+            }
+          }
+          if (PY_MAJOR_VERSION >= 3) {
+            __Pyx_XGIVEREF(__pyx_t_21);
+            __Pyx_XGIVEREF(__pyx_t_22);
+            __Pyx_XGIVEREF(__pyx_t_23);
+            __Pyx_ExceptionReset(__pyx_t_21, __pyx_t_22, __pyx_t_23);
+          }
+          __Pyx_XGIVEREF(__pyx_t_13);
+          __Pyx_XGIVEREF(__pyx_t_12);
+          __Pyx_XGIVEREF(__pyx_t_11);
+          __Pyx_ErrRestore(__pyx_t_13, __pyx_t_12, __pyx_t_11);
+          __pyx_t_13 = 0; __pyx_t_12 = 0; __pyx_t_11 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_t_23 = 0;
+          __pyx_lineno = __pyx_t_8; __pyx_clineno = __pyx_t_19; __pyx_filename = __pyx_t_20;
+          goto __pyx_L4_error;
+          __pyx_L31_error:;
+          if (PY_MAJOR_VERSION >= 3) {
+            __Pyx_XGIVEREF(__pyx_t_21);
+            __Pyx_XGIVEREF(__pyx_t_22);
+            __Pyx_XGIVEREF(__pyx_t_23);
+            __Pyx_ExceptionReset(__pyx_t_21, __pyx_t_22, __pyx_t_23);
+          }
+          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
+          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
+          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
+          __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_t_23 = 0;
+          goto __pyx_L4_error;
+        }
+        __pyx_L16:;
+      }
+      __pyx_L6_continue:;
+    }
+    __pyx_L7_break:;
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  }
+
 141:                         # This attribute can avoid having to keep a reference to the function
+
 142:                         # *in* the function, which is a cycle
+
+143:                         self.unlink(link)
+
            __pyx_t_4 = ((struct __pyx_vtabstruct_6gevent_19__abstract_linkable_AbstractLinkable *)__pyx_v_self->__pyx_vtab)->unlink(__pyx_v_self, __pyx_v_link, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 143, __pyx_L4_error)
+            __Pyx_GOTREF(__pyx_t_4);
+            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+/* … */
+              __pyx_t_4 = ((struct __pyx_vtabstruct_6gevent_19__abstract_linkable_AbstractLinkable *)__pyx_v_self->__pyx_vtab)->unlink(__pyx_v_self, __pyx_v_link, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 143, __pyx_L31_error)
+              __Pyx_GOTREF(__pyx_t_4);
+              __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+
 144:         finally:
+
 145:             # We should not have created a new notifier even if callbacks
+
 146:             # released us because we loop through *all* of our links on the
+
 147:             # same callback while self._notifier is still true.
+
+148:             assert self._notifier is notifier
+
  /*finally:*/ {
+    /*normal exit:*/{
+      #ifndef CYTHON_WITHOUT_ASSERTIONS
+      if (unlikely(!Py_OptimizeFlag)) {
+        __pyx_t_10 = (__pyx_v_self->_notifier == __pyx_v_notifier);
+        if (unlikely(!(__pyx_t_10 != 0))) {
+          PyErr_SetNone(PyExc_AssertionError);
+          __PYX_ERR(0, 148, __pyx_L1_error)
+        }
+      }
+      #endif
+/* … */
+        #ifndef CYTHON_WITHOUT_ASSERTIONS
+        if (unlikely(!Py_OptimizeFlag)) {
+          __pyx_t_10 = (__pyx_v_self->_notifier == __pyx_v_notifier);
+          if (unlikely(!(__pyx_t_10 != 0))) {
+            PyErr_SetNone(PyExc_AssertionError);
+            __PYX_ERR(0, 148, __pyx_L34_error)
+          }
+        }
+        #endif
+
+149:             self._notifier = None
+
      __Pyx_INCREF(Py_None);
+      __Pyx_GIVEREF(Py_None);
+      __Pyx_GOTREF(__pyx_v_self->_notifier);
+      __Pyx_DECREF(__pyx_v_self->_notifier);
+      __pyx_v_self->_notifier = Py_None;
+      goto __pyx_L5;
+    }
+    __pyx_L4_error:;
+    /*exception exit:*/{
+      __Pyx_PyThreadState_declare
+      __Pyx_PyThreadState_assign
+      __pyx_t_23 = 0; __pyx_t_22 = 0; __pyx_t_21 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0;
+      __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
+      __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
+      __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
+      __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
+      __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
+      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+      if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13);
+      if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_23, &__pyx_t_22, &__pyx_t_21) < 0)) __Pyx_ErrFetch(&__pyx_t_23, &__pyx_t_22, &__pyx_t_21);
+      __Pyx_XGOTREF(__pyx_t_23);
+      __Pyx_XGOTREF(__pyx_t_22);
+      __Pyx_XGOTREF(__pyx_t_21);
+      __Pyx_XGOTREF(__pyx_t_11);
+      __Pyx_XGOTREF(__pyx_t_12);
+      __Pyx_XGOTREF(__pyx_t_13);
+      __pyx_t_7 = __pyx_lineno; __pyx_t_19 = __pyx_clineno; __pyx_t_24 = __pyx_filename;
+      {
+/* … */
+        __Pyx_INCREF(Py_None);
+        __Pyx_GIVEREF(Py_None);
+        __Pyx_GOTREF(__pyx_v_self->_notifier);
+        __Pyx_DECREF(__pyx_v_self->_notifier);
+        __pyx_v_self->_notifier = Py_None;
+      }
+      if (PY_MAJOR_VERSION >= 3) {
+        __Pyx_XGIVEREF(__pyx_t_11);
+        __Pyx_XGIVEREF(__pyx_t_12);
+        __Pyx_XGIVEREF(__pyx_t_13);
+        __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13);
+      }
+      __Pyx_XGIVEREF(__pyx_t_23);
+      __Pyx_XGIVEREF(__pyx_t_22);
+      __Pyx_XGIVEREF(__pyx_t_21);
+      __Pyx_ErrRestore(__pyx_t_23, __pyx_t_22, __pyx_t_21);
+      __pyx_t_23 = 0; __pyx_t_22 = 0; __pyx_t_21 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0;
+      __pyx_lineno = __pyx_t_7; __pyx_clineno = __pyx_t_19; __pyx_filename = __pyx_t_24;
+      goto __pyx_L1_error;
+      __pyx_L34_error:;
+      if (PY_MAJOR_VERSION >= 3) {
+        __Pyx_XGIVEREF(__pyx_t_11);
+        __Pyx_XGIVEREF(__pyx_t_12);
+        __Pyx_XGIVEREF(__pyx_t_13);
+        __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13);
+      }
+      __Pyx_XDECREF(__pyx_t_23); __pyx_t_23 = 0;
+      __Pyx_XDECREF(__pyx_t_22); __pyx_t_22 = 0;
+      __Pyx_XDECREF(__pyx_t_21); __pyx_t_21 = 0;
+      __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0;
+      goto __pyx_L1_error;
+    }
+    __pyx_L5:;
+  }
+
 150: 
+
 151:         # Our set of active links changed, and we were told to stop on the first
+
 152:         # time we went unready. See if we're ready, and if so, go around
+
 153:         # again.
+
+154:         if not self._notify_all and todo != self._links:
+
  __pyx_t_9 = ((!(__pyx_v_self->_notify_all != 0)) != 0);
+  if (__pyx_t_9) {
+  } else {
+    __pyx_t_10 = __pyx_t_9;
+    goto __pyx_L36_bool_binop_done;
+  }
+  __pyx_t_1 = PyObject_RichCompare(__pyx_v_todo, __pyx_v_self->_links, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 154, __pyx_L1_error)
+  __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 154, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_10 = __pyx_t_9;
+  __pyx_L36_bool_binop_done:;
+  if (__pyx_t_10) {
+/* … */
+  }
+
+155:             self._check_and_notify()
+
    __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_19__abstract_linkable_AbstractLinkable *)__pyx_v_self->__pyx_vtab)->_check_and_notify(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 155, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 156: 
+
+157:     def _wait_core(self, timeout, catch=Timeout):
+
static PyObject *__pyx_f_6gevent_19__abstract_linkable_16AbstractLinkable__wait_core(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *__pyx_v_self, PyObject *__pyx_v_timeout, struct __pyx_opt_args_6gevent_19__abstract_linkable_16AbstractLinkable__wait_core *__pyx_optional_args) {
+  PyObject *__pyx_v_catch = __pyx_k_;
+  PyObject *__pyx_v_switch = NULL;
+  PyObject *__pyx_v_timer = NULL;
+  PyObject *__pyx_v_result = NULL;
+  PyObject *__pyx_v_ex = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_wait_core", 0);
+  if (__pyx_optional_args) {
+    if (__pyx_optional_args->__pyx_n > 0) {
+      __pyx_v_catch = __pyx_optional_args->catch;
+    }
+  }
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_AddTraceback("gevent.__abstract_linkable.AbstractLinkable._wait_core", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_switch);
+  __Pyx_XDECREF(__pyx_v_timer);
+  __Pyx_XDECREF(__pyx_v_result);
+  __Pyx_XDECREF(__pyx_v_ex);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __Pyx_INCREF(__pyx_v_6gevent_19__abstract_linkable_Timeout);
+  __pyx_k_ = __pyx_v_6gevent_19__abstract_linkable_Timeout;
+  __Pyx_GIVEREF(__pyx_v_6gevent_19__abstract_linkable_Timeout);
+
 158:         # The core of the wait implementation, handling
+
 159:         # switching and linking. If *catch* is set to (),
+
 160:         # a timeout that elapses will be allowed to be raised.
+
 161:         # Returns a true value if the wait succeeded without timing out.
+
+162:         switch = getcurrent().switch # pylint:disable=undefined-variable
+
  __pyx_t_1 = ((PyObject *)__pyx_f_6gevent_19__abstract_linkable_getcurrent()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 162, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_switch); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 162, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_v_switch = __pyx_t_2;
+  __pyx_t_2 = 0;
+
+163:         self.rawlink(switch)
+
  __pyx_t_2 = ((struct __pyx_vtabstruct_6gevent_19__abstract_linkable_AbstractLinkable *)__pyx_v_self->__pyx_vtab)->rawlink(__pyx_v_self, __pyx_v_switch, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 163, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+164:         try:
+
  /*try:*/ {
+
+165:             with Timeout._start_new_or_dummy(timeout) as timer:
+
    /*with:*/ {
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_6gevent_19__abstract_linkable_Timeout, __pyx_n_s_start_new_or_dummy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 165, __pyx_L4_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      __pyx_t_3 = NULL;
+      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
+        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
+        if (likely(__pyx_t_3)) {
+          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
+          __Pyx_INCREF(__pyx_t_3);
+          __Pyx_INCREF(function);
+          __Pyx_DECREF_SET(__pyx_t_1, function);
+        }
+      }
+      __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_3, __pyx_v_timeout) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_timeout);
+      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 165, __pyx_L4_error)
+      __Pyx_GOTREF(__pyx_t_2);
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      __pyx_t_4 = __Pyx_PyObject_LookupSpecial(__pyx_t_2, __pyx_n_s_exit); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 165, __pyx_L4_error)
+      __Pyx_GOTREF(__pyx_t_4);
+      __pyx_t_3 = __Pyx_PyObject_LookupSpecial(__pyx_t_2, __pyx_n_s_enter); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 165, __pyx_L6_error)
+      __Pyx_GOTREF(__pyx_t_3);
+      __pyx_t_5 = NULL;
+      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
+        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
+        if (likely(__pyx_t_5)) {
+          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+          __Pyx_INCREF(__pyx_t_5);
+          __Pyx_INCREF(function);
+          __Pyx_DECREF_SET(__pyx_t_3, function);
+        }
+      }
+      __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
+      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 165, __pyx_L6_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __pyx_t_3 = __pyx_t_1;
+      __pyx_t_1 = 0;
+      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+      /*try:*/ {
+        {
+          /*try:*/ {
+            __pyx_v_timer = __pyx_t_3;
+            __pyx_t_3 = 0;
+/* … */
+          }
+          __pyx_L10_error:;
+          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+          /*except:*/ {
+            __Pyx_AddTraceback("gevent.__abstract_linkable.AbstractLinkable._wait_core", __pyx_clineno, __pyx_lineno, __pyx_filename);
+            if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3) < 0) __PYX_ERR(0, 165, __pyx_L12_except_error)
+            __Pyx_GOTREF(__pyx_t_1);
+            __Pyx_GOTREF(__pyx_t_2);
+            __Pyx_GOTREF(__pyx_t_3);
+            __pyx_t_5 = PyTuple_Pack(3, __pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 165, __pyx_L12_except_error)
+            __Pyx_GOTREF(__pyx_t_5);
+            __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL);
+            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+            if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 165, __pyx_L12_except_error)
+            __Pyx_GOTREF(__pyx_t_11);
+            __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_11);
+            __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+            if (__pyx_t_13 < 0) __PYX_ERR(0, 165, __pyx_L12_except_error)
+            __pyx_t_12 = ((!(__pyx_t_13 != 0)) != 0);
+            if (__pyx_t_12) {
+              __Pyx_GIVEREF(__pyx_t_1);
+              __Pyx_GIVEREF(__pyx_t_2);
+              __Pyx_XGIVEREF(__pyx_t_3);
+              __Pyx_ErrRestoreWithState(__pyx_t_1, __pyx_t_2, __pyx_t_3);
+              __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_3 = 0; 
+              __PYX_ERR(0, 165, __pyx_L12_except_error)
+            }
+            __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+            __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+            __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+            goto __pyx_L11_exception_handled;
+          }
+          __pyx_L12_except_error:;
+          __Pyx_XGIVEREF(__pyx_t_6);
+          __Pyx_XGIVEREF(__pyx_t_7);
+          __Pyx_XGIVEREF(__pyx_t_8);
+          __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
+          goto __pyx_L4_error;
+          __pyx_L14_try_return:;
+          __Pyx_XGIVEREF(__pyx_t_6);
+          __Pyx_XGIVEREF(__pyx_t_7);
+          __Pyx_XGIVEREF(__pyx_t_8);
+          __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
+          goto __pyx_L7_return;
+          __pyx_L11_exception_handled:;
+          __Pyx_XGIVEREF(__pyx_t_6);
+          __Pyx_XGIVEREF(__pyx_t_7);
+          __Pyx_XGIVEREF(__pyx_t_8);
+          __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
+        }
+      }
+      /*finally:*/ {
+        /*normal exit:*/{
+          if (__pyx_t_4) {
+            __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__2, NULL);
+            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+            if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 165, __pyx_L4_error)
+            __Pyx_GOTREF(__pyx_t_8);
+            __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+          }
+          goto __pyx_L9;
+        }
+        __pyx_L7_return: {
+          __pyx_t_8 = __pyx_r;
+          __pyx_r = 0;
+          if (__pyx_t_4) {
+            __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__2, NULL);
+            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+            if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 165, __pyx_L4_error)
+            __Pyx_GOTREF(__pyx_t_7);
+            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+          }
+          __pyx_r = __pyx_t_8;
+          __pyx_t_8 = 0;
+          goto __pyx_L3_return;
+        }
+        __pyx_L9:;
+      }
+      goto __pyx_L39;
+      __pyx_L6_error:;
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      goto __pyx_L4_error;
+      __pyx_L39:;
+    }
+  }
+/* … */
+  __pyx_tuple__2 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 165, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__2);
+  __Pyx_GIVEREF(__pyx_tuple__2);
+
+166:                 try:
+
            {
+              /*try:*/ {
+/* … */
+              }
+              __pyx_L16_error:;
+              __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+              __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+              __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+              __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+/* … */
+              __Pyx_XGIVEREF(__pyx_t_9);
+              __Pyx_XGIVEREF(__pyx_t_10);
+              __Pyx_XGIVEREF(__pyx_t_11);
+              __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
+              goto __pyx_L10_error;
+              __pyx_L20_try_return:;
+              __Pyx_XGIVEREF(__pyx_t_9);
+              __Pyx_XGIVEREF(__pyx_t_10);
+              __Pyx_XGIVEREF(__pyx_t_11);
+              __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
+              goto __pyx_L14_try_return;
+              __pyx_L19_except_return:;
+              __Pyx_XGIVEREF(__pyx_t_9);
+              __Pyx_XGIVEREF(__pyx_t_10);
+              __Pyx_XGIVEREF(__pyx_t_11);
+              __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
+              goto __pyx_L14_try_return;
+            }
+
+167:                     if self.hub is None:
+
                __pyx_t_12 = (((PyObject *)__pyx_v_self->hub) == Py_None);
+                __pyx_t_13 = (__pyx_t_12 != 0);
+                if (__pyx_t_13) {
+/* … */
+                }
+
+168:                         self.hub = get_hub()
+
                  __pyx_t_3 = ((PyObject *)__pyx_f_6gevent_11__hub_local_get_hub_noargs(0)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 168, __pyx_L16_error)
+                  __Pyx_GOTREF(__pyx_t_3);
+                  __Pyx_GIVEREF(__pyx_t_3);
+                  __Pyx_GOTREF(__pyx_v_self->hub);
+                  __Pyx_DECREF(((PyObject *)__pyx_v_self->hub));
+                  __pyx_v_self->hub = ((struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *)__pyx_t_3);
+                  __pyx_t_3 = 0;
+
+169:                     result = self.hub.switch()
+
                __pyx_t_3 = ((struct __pyx_vtabstruct_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *)__pyx_v_self->hub->__pyx_vtab)->__pyx_switch(__pyx_v_self->hub, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 169, __pyx_L16_error)
+                __Pyx_GOTREF(__pyx_t_3);
+                __pyx_v_result = __pyx_t_3;
+                __pyx_t_3 = 0;
+
+170:                     if result is not self: # pragma: no cover
+
                __pyx_t_13 = (__pyx_v_result != ((PyObject *)__pyx_v_self));
+                __pyx_t_12 = (__pyx_t_13 != 0);
+                if (unlikely(__pyx_t_12)) {
+/* … */
+                }
+
+171:                         raise InvalidSwitchError('Invalid switch into Event.wait(): %r' % (result, ))
+
                  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 171, __pyx_L16_error)
+                  __Pyx_GOTREF(__pyx_t_2);
+                  __Pyx_INCREF(__pyx_v_result);
+                  __Pyx_GIVEREF(__pyx_v_result);
+                  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_result);
+                  __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_switch_into_Event_wait_r, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 171, __pyx_L16_error)
+                  __Pyx_GOTREF(__pyx_t_1);
+                  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+                  __Pyx_INCREF(__pyx_v_6gevent_19__abstract_linkable_InvalidSwitchError);
+                  __pyx_t_2 = __pyx_v_6gevent_19__abstract_linkable_InvalidSwitchError; __pyx_t_5 = NULL;
+                  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
+                    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
+                    if (likely(__pyx_t_5)) {
+                      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+                      __Pyx_INCREF(__pyx_t_5);
+                      __Pyx_INCREF(function);
+                      __Pyx_DECREF_SET(__pyx_t_2, function);
+                    }
+                  }
+                  __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_1) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_1);
+                  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+                  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+                  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 171, __pyx_L16_error)
+                  __Pyx_GOTREF(__pyx_t_3);
+                  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+                  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
+                  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+                  __PYX_ERR(0, 171, __pyx_L16_error)
+
+172:                     return True
+
                __Pyx_XDECREF(__pyx_r);
+                __Pyx_INCREF(Py_True);
+                __pyx_r = Py_True;
+                goto __pyx_L20_try_return;
+
+173:                 except catch as ex:
+
              __pyx_t_14 = __Pyx_PyErr_ExceptionMatches(__pyx_v_catch);
+              if (__pyx_t_14) {
+                __Pyx_AddTraceback("gevent.__abstract_linkable.AbstractLinkable._wait_core", __pyx_clineno, __pyx_lineno, __pyx_filename);
+                if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_2, &__pyx_t_1) < 0) __PYX_ERR(0, 173, __pyx_L18_except_error)
+                __Pyx_GOTREF(__pyx_t_3);
+                __Pyx_GOTREF(__pyx_t_2);
+                __Pyx_GOTREF(__pyx_t_1);
+                __Pyx_INCREF(__pyx_t_2);
+                __pyx_v_ex = __pyx_t_2;
+                /*try:*/ {
+/* … */
+                /*finally:*/ {
+                  __pyx_L29_error:;
+                  /*exception exit:*/{
+                    __Pyx_PyThreadState_declare
+                    __Pyx_PyThreadState_assign
+                    __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
+                    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+                    if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22);
+                    if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19) < 0)) __Pyx_ErrFetch(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19);
+                    __Pyx_XGOTREF(__pyx_t_17);
+                    __Pyx_XGOTREF(__pyx_t_18);
+                    __Pyx_XGOTREF(__pyx_t_19);
+                    __Pyx_XGOTREF(__pyx_t_20);
+                    __Pyx_XGOTREF(__pyx_t_21);
+                    __Pyx_XGOTREF(__pyx_t_22);
+                    __pyx_t_14 = __pyx_lineno; __pyx_t_15 = __pyx_clineno; __pyx_t_16 = __pyx_filename;
+                    {
+                      __Pyx_DECREF(__pyx_v_ex);
+                      __pyx_v_ex = NULL;
+                    }
+                    if (PY_MAJOR_VERSION >= 3) {
+                      __Pyx_XGIVEREF(__pyx_t_20);
+                      __Pyx_XGIVEREF(__pyx_t_21);
+                      __Pyx_XGIVEREF(__pyx_t_22);
+                      __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_21, __pyx_t_22);
+                    }
+                    __Pyx_XGIVEREF(__pyx_t_17);
+                    __Pyx_XGIVEREF(__pyx_t_18);
+                    __Pyx_XGIVEREF(__pyx_t_19);
+                    __Pyx_ErrRestore(__pyx_t_17, __pyx_t_18, __pyx_t_19);
+                    __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
+                    __pyx_lineno = __pyx_t_14; __pyx_clineno = __pyx_t_15; __pyx_filename = __pyx_t_16;
+                    goto __pyx_L18_except_error;
+                  }
+                  __pyx_L28_return: {
+                    __pyx_t_22 = __pyx_r;
+                    __pyx_r = 0;
+                    __Pyx_DECREF(__pyx_v_ex);
+                    __pyx_v_ex = NULL;
+                    __pyx_r = __pyx_t_22;
+                    __pyx_t_22 = 0;
+                    goto __pyx_L19_except_return;
+                  }
+                }
+              }
+              goto __pyx_L18_except_error;
+              __pyx_L18_except_error:;
+
+174:                     if ex is not timer:
+
                  __pyx_t_12 = (__pyx_v_ex != __pyx_v_timer);
+                  __pyx_t_13 = (__pyx_t_12 != 0);
+                  if (unlikely(__pyx_t_13)) {
+/* … */
+                  }
+
+175:                         raise
+
                    __Pyx_GIVEREF(__pyx_t_3);
+                    __Pyx_GIVEREF(__pyx_t_2);
+                    __Pyx_XGIVEREF(__pyx_t_1);
+                    __Pyx_ErrRestoreWithState(__pyx_t_3, __pyx_t_2, __pyx_t_1);
+                    __pyx_t_3 = 0; __pyx_t_2 = 0; __pyx_t_1 = 0; 
+                    __PYX_ERR(0, 175, __pyx_L29_error)
+
 176:                     # test_set_and_clear and test_timeout in test_threading
+
 177:                     # rely on the exact return values, not just truthish-ness
+
+178:                     return False
+
                  __Pyx_XDECREF(__pyx_r);
+                  __Pyx_INCREF(Py_False);
+                  __pyx_r = Py_False;
+                  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+                  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+                  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+                  goto __pyx_L28_return;
+                }
+
 179:         finally:
+
+180:             self.unlink(switch)
+
  /*finally:*/ {
+    /*normal exit:*/{
+      __pyx_t_3 = ((struct __pyx_vtabstruct_6gevent_19__abstract_linkable_AbstractLinkable *)__pyx_v_self->__pyx_vtab)->unlink(__pyx_v_self, __pyx_v_switch, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 180, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_3);
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+      goto __pyx_L5;
+    }
+    __pyx_L4_error:;
+    /*exception exit:*/{
+      __Pyx_PyThreadState_declare
+      __Pyx_PyThreadState_assign
+      __pyx_t_4 = 0; __pyx_t_8 = 0; __pyx_t_7 = 0; __pyx_t_6 = 0; __pyx_t_11 = 0; __pyx_t_10 = 0;
+      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+      if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_6, &__pyx_t_11, &__pyx_t_10);
+      if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_4, &__pyx_t_8, &__pyx_t_7) < 0)) __Pyx_ErrFetch(&__pyx_t_4, &__pyx_t_8, &__pyx_t_7);
+      __Pyx_XGOTREF(__pyx_t_4);
+      __Pyx_XGOTREF(__pyx_t_8);
+      __Pyx_XGOTREF(__pyx_t_7);
+      __Pyx_XGOTREF(__pyx_t_6);
+      __Pyx_XGOTREF(__pyx_t_11);
+      __Pyx_XGOTREF(__pyx_t_10);
+      __pyx_t_15 = __pyx_lineno; __pyx_t_14 = __pyx_clineno; __pyx_t_23 = __pyx_filename;
+      {
+        __pyx_t_3 = ((struct __pyx_vtabstruct_6gevent_19__abstract_linkable_AbstractLinkable *)__pyx_v_self->__pyx_vtab)->unlink(__pyx_v_self, __pyx_v_switch, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 180, __pyx_L41_error)
+        __Pyx_GOTREF(__pyx_t_3);
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+      }
+      if (PY_MAJOR_VERSION >= 3) {
+        __Pyx_XGIVEREF(__pyx_t_6);
+        __Pyx_XGIVEREF(__pyx_t_11);
+        __Pyx_XGIVEREF(__pyx_t_10);
+        __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_11, __pyx_t_10);
+      }
+      __Pyx_XGIVEREF(__pyx_t_4);
+      __Pyx_XGIVEREF(__pyx_t_8);
+      __Pyx_XGIVEREF(__pyx_t_7);
+      __Pyx_ErrRestore(__pyx_t_4, __pyx_t_8, __pyx_t_7);
+      __pyx_t_4 = 0; __pyx_t_8 = 0; __pyx_t_7 = 0; __pyx_t_6 = 0; __pyx_t_11 = 0; __pyx_t_10 = 0;
+      __pyx_lineno = __pyx_t_15; __pyx_clineno = __pyx_t_14; __pyx_filename = __pyx_t_23;
+      goto __pyx_L1_error;
+      __pyx_L41_error:;
+      if (PY_MAJOR_VERSION >= 3) {
+        __Pyx_XGIVEREF(__pyx_t_6);
+        __Pyx_XGIVEREF(__pyx_t_11);
+        __Pyx_XGIVEREF(__pyx_t_10);
+        __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_11, __pyx_t_10);
+      }
+      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
+      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+      __pyx_t_6 = 0; __pyx_t_11 = 0; __pyx_t_10 = 0;
+      goto __pyx_L1_error;
+    }
+    __pyx_L3_return: {
+      __pyx_t_10 = __pyx_r;
+      __pyx_r = 0;
+      __pyx_t_3 = ((struct __pyx_vtabstruct_6gevent_19__abstract_linkable_AbstractLinkable *)__pyx_v_self->__pyx_vtab)->unlink(__pyx_v_self, __pyx_v_switch, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 180, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_3);
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __pyx_r = __pyx_t_10;
+      __pyx_t_10 = 0;
+      goto __pyx_L0;
+    }
+    __pyx_L5:;
+  }
+
 181: 
+
+182:     def _wait_return_value(self, waited, wait_success):
+
static PyObject *__pyx_f_6gevent_19__abstract_linkable_16AbstractLinkable__wait_return_value(CYTHON_UNUSED struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_waited, CYTHON_UNUSED PyObject *__pyx_v_wait_success) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_wait_return_value", 0);
+/* … */
+  /* function exit code */
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
 183:         # pylint:disable=unused-argument
+
 184:         # Subclasses should override this to return a value from _wait.
+
 185:         # By default we return None.
+
+186:         return None # pragma: no cover all extent subclasses override
+
  __Pyx_XDECREF(__pyx_r);
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+
 187: 
+
+188:     def _wait(self, timeout=None):
+
static PyObject *__pyx_f_6gevent_19__abstract_linkable_16AbstractLinkable__wait(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *__pyx_v_self, struct __pyx_opt_args_6gevent_19__abstract_linkable_16AbstractLinkable__wait *__pyx_optional_args) {
+  PyObject *__pyx_v_timeout = ((PyObject *)Py_None);
+  PyObject *__pyx_v_gotit = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_wait", 0);
+  if (__pyx_optional_args) {
+    if (__pyx_optional_args->__pyx_n > 0) {
+      __pyx_v_timeout = __pyx_optional_args->timeout;
+    }
+  }
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_AddTraceback("gevent.__abstract_linkable.AbstractLinkable._wait", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_gotit);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+189:         if self.ready():
+
  __pyx_t_1 = (((struct __pyx_vtabstruct_6gevent_19__abstract_linkable_AbstractLinkable *)__pyx_v_self->__pyx_vtab)->ready(__pyx_v_self, 0) != 0);
+  if (__pyx_t_1) {
+/* … */
+  }
+
+190:             return self._wait_return_value(False, False)
+
    __Pyx_XDECREF(__pyx_r);
+    __pyx_t_2 = ((struct __pyx_vtabstruct_6gevent_19__abstract_linkable_AbstractLinkable *)__pyx_v_self->__pyx_vtab)->_wait_return_value(__pyx_v_self, Py_False, Py_False); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 190, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_r = __pyx_t_2;
+    __pyx_t_2 = 0;
+    goto __pyx_L0;
+
 191: 
+
+192:         gotit = self._wait_core(timeout)
+
  __pyx_t_2 = ((struct __pyx_vtabstruct_6gevent_19__abstract_linkable_AbstractLinkable *)__pyx_v_self->__pyx_vtab)->_wait_core(__pyx_v_self, __pyx_v_timeout, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 192, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_v_gotit = __pyx_t_2;
+  __pyx_t_2 = 0;
+
+193:         return self._wait_return_value(True, gotit)
+
  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_2 = ((struct __pyx_vtabstruct_6gevent_19__abstract_linkable_AbstractLinkable *)__pyx_v_self->__pyx_vtab)->_wait_return_value(__pyx_v_self, Py_True, __pyx_v_gotit); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 193, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_r = __pyx_t_2;
+  __pyx_t_2 = 0;
+  goto __pyx_L0;
+
 194: 
+
+195: def _init():
+
static void __pyx_f_6gevent_19__abstract_linkable__init(void) {
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_init", 0);
+/* … */
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+}
+
+196:     greenlet_init() # pylint:disable=undefined-variable
+
  __pyx_f_6gevent_19__abstract_linkable_greenlet_init();
+
 197: 
+
+198: _init()
+
  __pyx_f_6gevent_19__abstract_linkable__init();
+
 199: 
+
 200: 
+
+201: from gevent._util import import_c_accel
+
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 201, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(__pyx_n_s_import_c_accel);
+  __Pyx_GIVEREF(__pyx_n_s_import_c_accel);
+  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_import_c_accel);
+  __pyx_t_2 = __Pyx_Import(__pyx_n_s_gevent__util, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 201, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_import_c_accel); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 201, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_import_c_accel, __pyx_t_1) < 0) __PYX_ERR(0, 201, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+202: import_c_accel(globals(), 'gevent.__abstract_linkable')
+
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_import_c_accel); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 202, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_1 = __Pyx_Globals(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 202, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 202, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_GIVEREF(__pyx_t_1);
+  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
+  __Pyx_INCREF(__pyx_n_s_gevent___abstract_linkable);
+  __Pyx_GIVEREF(__pyx_n_s_gevent___abstract_linkable);
+  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_n_s_gevent___abstract_linkable);
+  __pyx_t_1 = 0;
+  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 202, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_abstract_linkable.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_abstract_linkable.py new file mode 100644 index 00000000..304e75d0 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_abstract_linkable.py @@ -0,0 +1,202 @@ +# -*- coding: utf-8 -*- +# cython: auto_pickle=False,embedsignature=True,always_allow_keywords=False +""" +Internal module, support for the linkable protocol for "event" like objects. + +""" +from __future__ import absolute_import +from __future__ import division +from __future__ import print_function + +import sys + +from gevent._hub_local import get_hub_noargs as get_hub + +from gevent.exceptions import InvalidSwitchError +from gevent.timeout import Timeout + +locals()['getcurrent'] = __import__('greenlet').getcurrent +locals()['greenlet_init'] = lambda: None + +__all__ = [ + 'AbstractLinkable', +] + +class AbstractLinkable(object): + # Encapsulates the standard parts of the linking and notifying + # protocol common to both repeatable events (Event, Semaphore) and + # one-time events (AsyncResult). + + __slots__ = ('hub', '_links', '_notifier', '_notify_all', '__weakref__') + + def __init__(self): + # Before this implementation, AsyncResult and Semaphore + # maintained the order of notifications, but Event did not. + + # In gevent 1.3, before Semaphore extended this class, + # that was changed to not maintain the order. It was done because + # Event guaranteed to only call callbacks once (a set) but + # AsyncResult had no such guarantees. + + # Semaphore likes to maintain order of callbacks, though, + # so when it was added we went back to a list implementation + # for storing callbacks. But we want to preserve the unique callback + # property, so we manually check. + + # We generally don't expect to have so many waiters (for any of those + # objects) that testing membership and removing is a bottleneck. + + # In PyPy 2.6.1 with Cython 0.23, `cdef public` or `cdef + # readonly` or simply `cdef` attributes of type `object` can appear to leak if + # a Python subclass is used (this is visible simply + # instantiating this subclass if _links=[]). Our _links and + # _notifier are such attributes, and gevent.thread subclasses + # this class. Thus, we carefully manage the lifetime of the + # objects we put in these attributes so that, in the normal + # case of a semaphore used correctly (deallocated when it's not + # locked and no one is waiting), the leak goes away (because + # these objects are back to None). This can also be solved on PyPy + # by simply not declaring these objects in the pxd file, but that doesn't work for + # CPython ("No attribute...") + # See https://github.com/gevent/gevent/issues/660 + self._links = set() + self._notifier = None + # This is conceptually a class attribute, defined here for ease of access in + # cython. If it's true, when notifiers fire, all existing callbacks are called. + # If its false, we only call callbacks as long as ready() returns true. + self._notify_all = True + # we don't want to do get_hub() here to allow defining module-level objects + # without initializing the hub + self.hub = None + + def linkcount(self): + # For testing: how many objects are linked to this one? + return len(self._links) + + def ready(self): + # Instances must define this + raise NotImplementedError + + def _check_and_notify(self): + # If this object is ready to be notified, begin the process. + if self.ready() and self._links and not self._notifier: + if self.hub is None: + self.hub = get_hub() + + self._notifier = self.hub.loop.run_callback(self._notify_links) + + def rawlink(self, callback): + """ + Register a callback to call when this object is ready. + + *callback* will be called in the :class:`Hub + `, so it must not use blocking gevent API. + *callback* will be passed one argument: this instance. + """ + if not callable(callback): + raise TypeError('Expected callable: %r' % (callback, )) + + self._links.add(callback) + self._check_and_notify() + + def unlink(self, callback): + """Remove the callback set by :meth:`rawlink`""" + self._links.discard(callback) + + if not self._links and self._notifier is not None: + # If we currently have one queued, de-queue it. + # This will break a reference cycle. + # (self._notifier -> self._notify_links -> self) + # But we can't set it to None in case it was actually running. + self._notifier.stop() + + + def _notify_links(self): + # We release self._notifier here. We are called by it + # at the end of the loop, and it is now false in a boolean way (as soon + # as this method returns). + notifier = self._notifier + # We were ready() at the time this callback was scheduled; + # we may not be anymore, and that status may change during + # callback processing. Some of our subclasses will want to + # notify everyone that the status was once true, even though not it + # may not be anymore. + todo = set(self._links) + try: + for link in todo: + if not self._notify_all and not self.ready(): + break + + if link not in self._links: + # Been removed already by some previous link. OK, fine. + continue + try: + link(self) + except: # pylint:disable=bare-except + # We're running in the hub, so getcurrent() returns + # a hub. + self.hub.handle_error((link, self), *sys.exc_info()) # pylint:disable=undefined-variable + finally: + if getattr(link, 'auto_unlink', None): + # This attribute can avoid having to keep a reference to the function + # *in* the function, which is a cycle + self.unlink(link) + finally: + # We should not have created a new notifier even if callbacks + # released us because we loop through *all* of our links on the + # same callback while self._notifier is still true. + assert self._notifier is notifier + self._notifier = None + + # Our set of active links changed, and we were told to stop on the first + # time we went unready. See if we're ready, and if so, go around + # again. + if not self._notify_all and todo != self._links: + self._check_and_notify() + + def _wait_core(self, timeout, catch=Timeout): + # The core of the wait implementation, handling + # switching and linking. If *catch* is set to (), + # a timeout that elapses will be allowed to be raised. + # Returns a true value if the wait succeeded without timing out. + switch = getcurrent().switch # pylint:disable=undefined-variable + self.rawlink(switch) + try: + with Timeout._start_new_or_dummy(timeout) as timer: + try: + if self.hub is None: + self.hub = get_hub() + result = self.hub.switch() + if result is not self: # pragma: no cover + raise InvalidSwitchError('Invalid switch into Event.wait(): %r' % (result, )) + return True + except catch as ex: + if ex is not timer: + raise + # test_set_and_clear and test_timeout in test_threading + # rely on the exact return values, not just truthish-ness + return False + finally: + self.unlink(switch) + + def _wait_return_value(self, waited, wait_success): + # pylint:disable=unused-argument + # Subclasses should override this to return a value from _wait. + # By default we return None. + return None # pragma: no cover all extent subclasses override + + def _wait(self, timeout=None): + if self.ready(): + return self._wait_return_value(False, False) + + gotit = self._wait_core(timeout) + return self._wait_return_value(True, gotit) + +def _init(): + greenlet_init() # pylint:disable=undefined-variable + +_init() + + +from gevent._util import import_c_accel +import_c_accel(globals(), 'gevent.__abstract_linkable') diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_compat.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_compat.py new file mode 100644 index 00000000..22bad70c --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_compat.py @@ -0,0 +1,160 @@ +# -*- coding: utf-8 -*- +""" +internal gevent python 2/python 3 bridges. Not for external use. +""" + +from __future__ import print_function, absolute_import, division + +import sys +import os + + +PY2 = sys.version_info[0] == 2 +PY3 = sys.version_info[0] >= 3 +PYPY = hasattr(sys, 'pypy_version_info') +WIN = sys.platform.startswith("win") +LINUX = sys.platform.startswith('linux') +OSX = sys.platform == 'darwin' + + +PURE_PYTHON = PYPY or os.getenv('PURE_PYTHON') + +## Types + +if PY3: + string_types = (str,) + integer_types = (int,) + text_type = str + native_path_types = (str, bytes) + thread_mod_name = '_thread' + +else: + import __builtin__ # pylint:disable=import-error + string_types = (__builtin__.basestring,) + text_type = __builtin__.unicode + integer_types = (int, __builtin__.long) + native_path_types = string_types + thread_mod_name = 'thread' + +def NativeStrIO(): + import io + return io.BytesIO() if str is bytes else io.StringIO() + +## Exceptions +if PY3: + def reraise(t, value, tb=None): # pylint:disable=unused-argument + if value.__traceback__ is not tb and tb is not None: + raise value.with_traceback(tb) + raise value + def exc_clear(): + pass + +else: + from gevent._util_py2 import reraise # pylint:disable=import-error,no-name-in-module + reraise = reraise # export + exc_clear = sys.exc_clear + +## import locks +try: + # In Python 3.4 and newer in CPython and PyPy3, + # imp.acquire_lock and imp.release_lock are delegated to + # '_imp'. (Which is also used by importlib.) 'imp' itself is + # deprecated. Avoid that warning. + import _imp as imp +except ImportError: + import imp +imp_acquire_lock = imp.acquire_lock +imp_release_lock = imp.release_lock + +## Functions +if PY3: + iteritems = dict.items + itervalues = dict.values + xrange = range + izip = zip + +else: + iteritems = dict.iteritems # python 3: pylint:disable=no-member + itervalues = dict.itervalues # python 3: pylint:disable=no-member + xrange = __builtin__.xrange + from itertools import izip # python 3: pylint:disable=no-member,no-name-in-module + izip = izip + +# fspath from 3.6 os.py, but modified to raise the same exceptions as the +# real native implementation. +# Define for testing +def _fspath(path): + """ + Return the path representation of a path-like object. + + If str or bytes is passed in, it is returned unchanged. Otherwise the + os.PathLike interface is used to get the path representation. If the + path representation is not str or bytes, TypeError is raised. If the + provided path is not str, bytes, or os.PathLike, TypeError is raised. + """ + if isinstance(path, native_path_types): + return path + + # Work from the object's type to match method resolution of other magic + # methods. + path_type = type(path) + try: + path_type_fspath = path_type.__fspath__ + except AttributeError: + raise TypeError("expected str, bytes or os.PathLike object, " + "not " + path_type.__name__) + + path_repr = path_type_fspath(path) + if isinstance(path_repr, native_path_types): + return path_repr + + raise TypeError("expected {}.__fspath__() to return str or bytes, " + "not {}".format(path_type.__name__, + type(path_repr).__name__)) +try: + from os import fspath # pylint: disable=unused-import,no-name-in-module +except ImportError: + # if not available, use the Python version as transparently as + # possible + fspath = _fspath + fspath.__name__ = 'fspath' + +try: + from os import fsencode # pylint: disable=unused-import,no-name-in-module +except ImportError: + encoding = sys.getfilesystemencoding() or ('utf-8' if not WIN else 'mbcs') + errors = 'strict' if WIN and encoding == 'mbcs' else 'surrogateescape' + + # Added in 3.2, so this is for Python 2.7. Note that it doesn't have + # sys.getfilesystemencodeerrors(), which was added in 3.6 + def fsencode(filename): + """Encode filename (an os.PathLike, bytes, or str) to the filesystem + encoding with 'surrogateescape' error handler, return bytes unchanged. + On Windows, use 'strict' error handler if the file system encoding is + 'mbcs' (which is the default encoding). + """ + filename = fspath(filename) # Does type-checking of `filename`. + if isinstance(filename, bytes): + return filename + + try: + return filename.encode(encoding, errors) + except LookupError: + # Can't encode it, and the error handler doesn't + # exist. Probably on Python 2 with an astral character. + # Not sure how to handle this. + raise UnicodeEncodeError("Can't encode path to filesystem encoding") + + +## Clocks +try: + # Python 3.3+ (PEP 418) + from time import perf_counter + perf_counter = perf_counter +except ImportError: + import time + + if sys.platform == "win32": + perf_counter = time.clock + else: + perf_counter = time.time diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_config.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_config.py new file mode 100644 index 00000000..5a9990f8 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_config.py @@ -0,0 +1,701 @@ +# Copyright (c) 2018 gevent. See LICENSE for details. +""" +gevent tunables. + +This should be used as ``from gevent import config``. That variable +is an object of :class:`Config`. + +.. versionadded:: 1.3a2 +""" + +from __future__ import print_function, absolute_import, division + +import importlib +import os +import textwrap + +from gevent._compat import string_types +from gevent._compat import WIN + +__all__ = [ + 'config', +] + +ALL_SETTINGS = [] + +class SettingType(type): + # pylint:disable=bad-mcs-classmethod-argument + + def __new__(cls, name, bases, cls_dict): + if name == 'Setting': + return type.__new__(cls, name, bases, cls_dict) + + cls_dict["order"] = len(ALL_SETTINGS) + if 'name' not in cls_dict: + cls_dict['name'] = name.lower() + + if 'environment_key' not in cls_dict: + cls_dict['environment_key'] = 'GEVENT_' + cls_dict['name'].upper() + + + new_class = type.__new__(cls, name, bases, cls_dict) + new_class.fmt_desc(cls_dict.get("desc", "")) + new_class.__doc__ = new_class.desc + ALL_SETTINGS.append(new_class) + + if new_class.document: + setting_name = cls_dict['name'] + + def getter(self): + return self.settings[setting_name].get() + + def setter(self, value): # pragma: no cover + # The setter should never be hit, Config has a + # __setattr__ that would override. But for the sake + # of consistency we provide one. + self.settings[setting_name].set(value) + + prop = property(getter, setter, doc=new_class.__doc__) + + setattr(Config, cls_dict['name'], prop) + return new_class + + def fmt_desc(cls, desc): + desc = textwrap.dedent(desc).strip() + if hasattr(cls, 'shortname_map'): + desc += ( + "\n\nThis is an importable value. It can be " + "given as a string naming an importable object, " + "or a list of strings in preference order and the first " + "successfully importable object will be used. (Separate values " + "in the environment variable with commas.) " + "It can also be given as the callable object itself (in code). " + ) + if cls.shortname_map: + desc += "Shorthand names for default objects are %r" % (list(cls.shortname_map),) + if getattr(cls.validate, '__doc__'): + desc += '\n\n' + textwrap.dedent(cls.validate.__doc__).strip() + if isinstance(cls.default, str) and hasattr(cls, 'shortname_map'): + default = "`%s`" % (cls.default,) + else: + default = "`%r`" % (cls.default,) + desc += "\n\nThe default value is %s" % (default,) + desc += ("\n\nThe environment variable ``%s`` " + "can be used to control this." % (cls.environment_key,)) + setattr(cls, "desc", desc) + return desc + +def validate_invalid(value): + raise ValueError("Not a valid value: %r" % (value,)) + +def validate_bool(value): + """ + This is a boolean value. + + In the environment variable, it may be given as ``1``, ``true``, + ``on`` or ``yes`` for `True`, or ``0``, ``false``, ``off``, or + ``no`` for `False`. + """ + if isinstance(value, string_types): + value = value.lower().strip() + if value in ('1', 'true', 'on', 'yes'): + value = True + elif value in ('0', 'false', 'off', 'no') or not value: + value = False + else: + raise ValueError("Invalid boolean string: %r" % (value,)) + return bool(value) + +def validate_anything(value): + return value + +convert_str_value_as_is = validate_anything + +class Setting(object): + name = None + value = None + validate = staticmethod(validate_invalid) + default = None + environment_key = None + document = True + + desc = """\ + + A long ReST description. + + The first line should be a single sentence. + + """ + + def _convert(self, value): + if isinstance(value, string_types): + return value.split(',') + return value + + def _default(self): + result = os.environ.get(self.environment_key, self.default) + result = self._convert(result) + return result + + def get(self): + # If we've been specifically set, return it + if 'value' in self.__dict__: + return self.value + # Otherwise, read from the environment and reify + # so we return consistent results. + self.value = self.validate(self._default()) + return self.value + + def set(self, val): + self.value = self.validate(self._convert(val)) + + +Setting = SettingType('Setting', (Setting,), dict(Setting.__dict__)) + +def make_settings(): + """ + Return fresh instances of all classes defined in `ALL_SETTINGS`. + """ + settings = {} + for setting_kind in ALL_SETTINGS: + setting = setting_kind() + assert setting.name not in settings + settings[setting.name] = setting + return settings + + +class Config(object): + """ + Global configuration for gevent. + + There is one instance of this object at ``gevent.config``. If you + are going to make changes in code, instead of using the documented + environment variables, you need to make the changes before using + any parts of gevent that might need those settings. For example:: + + >>> from gevent import config + >>> config.fileobject = 'thread' + + >>> from gevent import fileobject + >>> fileobject.FileObject.__name__ + 'FileObjectThread' + + .. versionadded:: 1.3a2 + + """ + + def __init__(self): + self.settings = make_settings() + + def __getattr__(self, name): + if name not in self.settings: + raise AttributeError("No configuration setting for: %r" % name) + return self.settings[name].get() + + def __setattr__(self, name, value): + if name != "settings" and name in self.settings: + self.set(name, value) + else: + super(Config, self).__setattr__(name, value) + + def set(self, name, value): + if name not in self.settings: + raise AttributeError("No configuration setting for: %r" % name) + self.settings[name].set(value) + + def __dir__(self): + return list(self.settings) + + +class ImportableSetting(object): + + def _import_one_of(self, candidates): + assert isinstance(candidates, list) + if not candidates: + raise ImportError('Cannot import from empty list') + + for item in candidates[:-1]: + try: + return self._import_one(item) + except ImportError: + pass + + return self._import_one(candidates[-1]) + + def _import_one(self, path, _MISSING=object()): + if not isinstance(path, string_types): + return path + + if '.' not in path or '/' in path: + raise ImportError("Cannot import %r. " + "Required format: [package.]module.class. " + "Or choose from %r" + % (path, list(self.shortname_map))) + + + module, item = path.rsplit('.', 1) + module = importlib.import_module(module) + x = getattr(module, item, _MISSING) + if x is _MISSING: + raise ImportError('Cannot import %r from %r' % (item, module)) + return x + + shortname_map = {} + + def validate(self, value): + if isinstance(value, type): + return value + return self._import_one_of([self.shortname_map.get(x, x) for x in value]) + + def get_options(self): + result = {} + for name, val in self.shortname_map.items(): + try: + result[name] = self._import_one(val) + except ImportError as e: + result[name] = e + return result + + +class BoolSettingMixin(object): + validate = staticmethod(validate_bool) + # Don't do string-to-list conversion. + _convert = staticmethod(convert_str_value_as_is) + + +class IntSettingMixin(object): + # Don't do string-to-list conversion. + def _convert(self, value): + if value: + return int(value) + + validate = staticmethod(validate_anything) + + +class _PositiveValueMixin(object): + + def validate(self, value): + if value is not None and value <= 0: + raise ValueError("Must be positive") + return value + + +class FloatSettingMixin(_PositiveValueMixin): + def _convert(self, value): + if value: + return float(value) + + +class ByteCountSettingMixin(_PositiveValueMixin): + + _MULTIPLES = { + # All keys must be the same size. + 'kb': 1024, + 'mb': 1024 * 1024, + 'gb': 1024 * 1024 * 1024, + } + + _SUFFIX_SIZE = 2 + + def _convert(self, value): + if not value or not isinstance(value, str): + return value + value = value.lower() + for s, m in self._MULTIPLES.items(): + if value[-self._SUFFIX_SIZE:] == s: + return int(value[:-self._SUFFIX_SIZE]) * m + return int(value) + + +class Resolver(ImportableSetting, Setting): + + desc = """\ + The callable that will be used to create + :attr:`gevent.hub.Hub.resolver`. + + See :doc:`dns` for more information. + """ + + default = [ + 'thread', + 'dnspython', + 'ares', + 'block', + ] + + shortname_map = { + 'ares': 'gevent.resolver.ares.Resolver', + 'thread': 'gevent.resolver.thread.Resolver', + 'block': 'gevent.resolver.blocking.Resolver', + 'dnspython': 'gevent.resolver.dnspython.Resolver', + } + + + +class Threadpool(ImportableSetting, Setting): + + desc = """\ + The kind of threadpool we use. + """ + + default = 'gevent.threadpool.ThreadPool' + + +class Loop(ImportableSetting, Setting): + + desc = """\ + The kind of the loop we use. + + On Windows, this defaults to libuv, while on + other platforms it defaults to libev. + + """ + + default = [ + 'libev-cext', + 'libev-cffi', + 'libuv-cffi', + ] if not WIN else [ + 'libuv-cffi', + 'libev-cext', + 'libev-cffi', + ] + + shortname_map = { + 'libev-cext': 'gevent.libev.corecext.loop', + 'libev-cffi': 'gevent.libev.corecffi.loop', + 'libuv-cffi': 'gevent.libuv.loop.loop', + } + + shortname_map['libuv'] = shortname_map['libuv-cffi'] + + +class FormatContext(ImportableSetting, Setting): + name = 'format_context' + + # using pprint.pformat can override custom __repr__ methods on dict/list + # subclasses, which can be a security concern + default = 'pprint.saferepr' + + +class LibevBackend(Setting): + name = 'libev_backend' + environment_key = 'GEVENT_BACKEND' + + desc = """\ + The backend for libev, such as 'select' + """ + + default = None + + validate = staticmethod(validate_anything) + + +class FileObject(ImportableSetting, Setting): + desc = """\ + The kind of ``FileObject`` we will use. + + See :mod:`gevent.fileobject` for a detailed description. + + """ + environment_key = 'GEVENT_FILE' + + default = [ + 'posix', + 'thread', + ] + + shortname_map = { + 'thread': 'gevent._fileobjectcommon.FileObjectThread', + 'posix': 'gevent._fileobjectposix.FileObjectPosix', + 'block': 'gevent._fileobjectcommon.FileObjectBlock' + } + + +class WatchChildren(BoolSettingMixin, Setting): + desc = """\ + Should we *not* watch children with the event loop watchers? + + This is an advanced setting. + + See :mod:`gevent.os` for a detailed description. + """ + name = 'disable_watch_children' + environment_key = 'GEVENT_NOWAITPID' + default = False + + +class TraceMalloc(IntSettingMixin, Setting): + name = 'trace_malloc' + environment_key = 'PYTHONTRACEMALLOC' + default = False + + desc = """\ + Should FFI objects track their allocation? + + This is only useful for low-level debugging. + + On Python 3, this environment variable is built in to the + interpreter, and it may also be set with the ``-X + tracemalloc`` command line argument. + + On Python 2, gevent interprets this argument and adds extra + tracking information for FFI objects. + """ + + +class TrackGreenletTree(BoolSettingMixin, Setting): + name = 'track_greenlet_tree' + environment_key = 'GEVENT_TRACK_GREENLET_TREE' + default = True + + desc = """\ + Should `Greenlet` objects track their spawning tree? + + Setting this to a false value will make spawning `Greenlet` + objects and using `spawn_raw` faster, but the + ``spawning_greenlet``, ``spawn_tree_locals`` and ``spawning_stack`` + will not be captured. + + .. versionadded:: 1.3b1 + """ + + +## Monitoring settings +# All env keys should begin with GEVENT_MONITOR + +class MonitorThread(BoolSettingMixin, Setting): + name = 'monitor_thread' + environment_key = 'GEVENT_MONITOR_THREAD_ENABLE' + default = False + + desc = """\ + Should each hub start a native OS thread to monitor + for problems? + + Such a thread will periodically check to see if the event loop + is blocked for longer than `max_blocking_time`, producing output on + the hub's exception stream (stderr by default) if it detects this condition. + + If this setting is true, then this thread will be created + the first time the hub is switched to, + or you can call :meth:`gevent.hub.Hub.start_periodic_monitoring_thread` at any + time to create it (from the same thread that will run the hub). That function + will return an instance of :class:`gevent.events.IPeriodicMonitorThread` + to which you can add your own monitoring functions. That function + also emits an event of :class:`gevent.events.PeriodicMonitorThreadStartedEvent`. + + .. seealso:: `max_blocking_time` + + .. versionadded:: 1.3b1 + """ + +class MaxBlockingTime(FloatSettingMixin, Setting): + name = 'max_blocking_time' + # This environment key doesn't follow the convention because it's + # meant to match a key used by existing projects + environment_key = 'GEVENT_MAX_BLOCKING_TIME' + default = 0.1 + + desc = """\ + If the `monitor_thread` is enabled, this is + approximately how long (in seconds) + the event loop will be allowed to block before a warning is issued. + + This function depends on using `greenlet.settrace`, so installing + your own trace function after starting the monitoring thread will + cause this feature to misbehave unless you call the function + returned by `greenlet.settrace`. If you install a tracing function *before* + the monitoring thread is started, it will still be called. + + .. note:: In the unlikely event of creating and using multiple different + gevent hubs in the same native thread in a short period of time, + especially without destroying the hubs, false positives may be reported. + + .. versionadded:: 1.3b1 + """ + +class MonitorMemoryPeriod(FloatSettingMixin, Setting): + name = 'memory_monitor_period' + + environment_key = 'GEVENT_MONITOR_MEMORY_PERIOD' + default = 5 + + desc = """\ + If `monitor_thread` is enabled, this is approximately how long + (in seconds) we will go between checking the processes memory usage. + + Checking the memory usage is relatively expensive on some operating + systems, so this should not be too low. gevent will place a floor + value on it. + """ + +class MonitorMemoryMaxUsage(ByteCountSettingMixin, Setting): + name = 'max_memory_usage' + + environment_key = 'GEVENT_MONITOR_MEMORY_MAX' + default = None + + desc = """\ + If `monitor_thread` is enabled, + then if memory usage exceeds this amount (in bytes), events will + be emitted. See `gevent.events`. In the environment variable, you can use + a suffix of 'kb', 'mb' or 'gb' to specify the value in kilobytes, megabytes + or gigibytes. + + There is no default value for this setting. If you wish to + cap memory usage, you must choose a value. + """ + +# The ares settings are all interpreted by +# gevent/resolver/ares.pyx, so we don't do +# any validation here. + +class AresSettingMixin(object): + + document = False + + @property + def kwarg_name(self): + return self.name[5:] + + validate = staticmethod(validate_anything) + + _convert = staticmethod(convert_str_value_as_is) + +class AresFlags(AresSettingMixin, Setting): + name = 'ares_flags' + default = None + environment_key = 'GEVENTARES_FLAGS' + +class AresTimeout(AresSettingMixin, Setting): + document = True + name = 'ares_timeout' + default = None + environment_key = 'GEVENTARES_TIMEOUT' + desc = """\ + + .. deprecated:: 1.3a2 + Prefer the :attr:`resolver_timeout` setting. If both are set, + the results are not defined. + """ + +class AresTries(AresSettingMixin, Setting): + name = 'ares_tries' + default = None + environment_key = 'GEVENTARES_TRIES' + +class AresNdots(AresSettingMixin, Setting): + name = 'ares_ndots' + default = None + environment_key = 'GEVENTARES_NDOTS' + +class AresUDPPort(AresSettingMixin, Setting): + name = 'ares_udp_port' + default = None + environment_key = 'GEVENTARES_UDP_PORT' + +class AresTCPPort(AresSettingMixin, Setting): + name = 'ares_tcp_port' + default = None + environment_key = 'GEVENTARES_TCP_PORT' + +class AresServers(AresSettingMixin, Setting): + document = True + name = 'ares_servers' + default = None + environment_key = 'GEVENTARES_SERVERS' + desc = """\ + A list of strings giving the IP addresses of nameservers for the ares resolver. + + In the environment variable, these strings are separated by commas. + + .. deprecated:: 1.3a2 + Prefer the :attr:`resolver_nameservers` setting. If both are set, + the results are not defined. + """ + +# Generic nameservers, works for dnspython and ares. +class ResolverNameservers(AresSettingMixin, Setting): + document = True + name = 'resolver_nameservers' + default = None + environment_key = 'GEVENT_RESOLVER_NAMESERVERS' + desc = """\ + A list of strings giving the IP addresses of nameservers for the (non-system) resolver. + + In the environment variable, these strings are separated by commas. + + .. rubric:: Resolver Behaviour + + * blocking + + Ignored + + * Threaded + + Ignored + + * dnspython + + If this setting is not given, the dnspython resolver will + load nameservers to use from ``/etc/resolv.conf`` + or the Windows registry. This setting replaces any nameservers read + from those means. Note that the file and registry are still read + for other settings. + + .. caution:: dnspython does not validate the members of the list. + An improper address (such as a hostname instead of IP) has + undefined results, including hanging the process. + + * ares + + Similar to dnspython, but with more platform and compile-time + options. ares validates that the members of the list are valid + addresses. + """ + + # Normal string-to-list rules. But still validate_anything. + _convert = Setting._convert + + # TODO: In the future, support reading a resolv.conf file + # *other* than /etc/resolv.conf, and do that both on Windows + # and other platforms. Also offer the option to disable the system + # configuration entirely. + + @property + def kwarg_name(self): + return 'servers' + +# Generic timeout, works for dnspython and ares +class ResolverTimeout(FloatSettingMixin, AresSettingMixin, Setting): + document = True + name = 'resolver_timeout' + environment_key = 'GEVENT_RESOLVER_TIMEOUT' + desc = """\ + The total amount of time that the DNS resolver will spend making queries. + + Only the ares and dnspython resolvers support this. + + .. versionadded:: 1.3a2 + """ + + @property + def kwarg_name(self): + return 'timeout' + +config = Config() + +# Go ahead and attempt to import the loop when this class is +# instantiated. The hub won't work if the loop can't be found. This +# can solve problems with the class being imported from multiple +# threads at once, leading to one of the imports failing. +# factories are themselves handled lazily. See #687. + +# Don't cache it though, in case the user re-configures through the +# API. + +try: + Loop().get() +except ImportError: # pragma: no cover + pass diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_event.cp37-win32.pyd b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_event.cp37-win32.pyd new file mode 100644 index 0000000000000000000000000000000000000000..acc818a90fa1ff49ad9c0ad79bebde7731f71ca6 GIT binary patch literal 88064 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 TRACE: + _dbg = _pid_dbg diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_ffi/callback.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_ffi/callback.py new file mode 100644 index 00000000..df59a9f3 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_ffi/callback.py @@ -0,0 +1,58 @@ +from __future__ import absolute_import, print_function + +__all__ = [ + 'callback', +] + + +# For times when *args is captured but often not passed (empty), +# we can avoid keeping the new tuple that was created for *args +# around by using a constant. +_NOARGS = () + + +class callback(object): + + __slots__ = ('callback', 'args') + + def __init__(self, cb, args): + self.callback = cb + self.args = args or _NOARGS + + def stop(self): + self.callback = None + self.args = None + + close = stop + + # Note that __nonzero__ and pending are different + # bool() is used in contexts where we need to know whether to schedule another callback, + # so it's true if it's pending or currently running + # 'pending' has the same meaning as libev watchers: it is cleared before actually + # running the callback + + def __nonzero__(self): + # it's nonzero if it's pending or currently executing + # NOTE: This depends on loop._run_callbacks setting the args property + # to None. + return self.args is not None + __bool__ = __nonzero__ + + @property + def pending(self): + return self.callback is not None + + def _format(self): + return '' + + def __repr__(self): + result = "<%s at 0x%x" % (self.__class__.__name__, id(self)) + if self.pending: + result += " pending" + if self.callback is not None: + result += " callback=%r" % (self.callback, ) + if self.args is not None: + result += " args=%r" % (self.args, ) + if self.callback is None and self.args is None: + result += " stopped" + return result + ">" diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_ffi/loop.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_ffi/loop.py new file mode 100644 index 00000000..f77c25ac --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_ffi/loop.py @@ -0,0 +1,713 @@ +""" +Basic loop implementation for ffi-based cores. +""" +# pylint: disable=too-many-lines, protected-access, redefined-outer-name, not-callable +from __future__ import absolute_import, print_function + +from collections import deque +import sys +import os +import traceback + +from gevent._ffi import _dbg +from gevent._ffi import GEVENT_DEBUG_LEVEL +from gevent._ffi import TRACE +from gevent._ffi.callback import callback +from gevent._compat import PYPY + +from gevent import getswitchinterval + +__all__ = [ + 'AbstractLoop', + 'assign_standard_callbacks', +] + + +class _EVENTSType(object): + def __repr__(self): + return 'gevent.core.EVENTS' + +EVENTS = GEVENT_CORE_EVENTS = _EVENTSType() + + +##### +## Note on CFFI objects, callbacks and the lifecycle of watcher objects +# +# Each subclass of `watcher` allocates a C structure of the +# appropriate type e.g., struct gevent_ev_io and holds this pointer in +# its `_gwatcher` attribute. When that watcher instance is garbage +# collected, then the C structure is also freed. The C structure is +# passed to libev from the watcher's start() method and then to the +# appropriate C callback function, e.g., _gevent_ev_io_callback, which +# passes it back to python's _python_callback where we need the +# watcher instance. Therefore, as long as that callback is active (the +# watcher is started), the watcher instance must not be allowed to get +# GC'd---any access at the C level or even the FFI level to the freed +# memory could crash the process. +# +# However, the typical idiom calls for writing something like this: +# loop.io(fd, python_cb).start() +# thus forgetting the newly created watcher subclass and allowing it to be immediately +# GC'd. To combat this, when the watcher is started, it places itself into the loop's +# `_keepaliveset`, and it only removes itself when the watcher's `stop()` method is called. +# Often, this is the *only* reference keeping the watcher object, and hence its C structure, +# alive. +# +# This is slightly complicated by the fact that the python-level +# callback, called from the C callback, could choose to manually stop +# the watcher. When we return to the C level callback, we now have an +# invalid pointer, and attempting to pass it back to Python (e.g., to +# handle an error) could crash. Hence, _python_callback, +# _gevent_io_callback, and _python_handle_error cooperate to make sure +# that the watcher instance stays in the loops `_keepaliveset` while +# the C code could be running---and if it gets removed, to not call back +# to Python again. +# See also https://github.com/gevent/gevent/issues/676 +#### +class AbstractCallbacks(object): + + + def __init__(self, ffi): + self.ffi = ffi + self.callbacks = [] + if GEVENT_DEBUG_LEVEL < TRACE: + self.from_handle = ffi.from_handle + + def from_handle(self, handle): # pylint:disable=method-hidden + x = self.ffi.from_handle(handle) + return x + + def python_callback(self, handle, revents): + """ + Returns an integer having one of three values: + + - -1 + An exception occurred during the callback and you must call + :func:`_python_handle_error` to deal with it. The Python watcher + object will have the exception tuple saved in ``_exc_info``. + - 1 + Everything went according to plan. You should check to see if the libev + watcher is still active, and call :func:`python_stop` if it is not. This will + clean up the memory. Finding the watcher still active at the event loop level, + but not having stopped itself at the gevent level is a buggy scenario and + shouldn't happen. + - 2 + Everything went according to plan, but the watcher has already + been stopped. Its memory may no longer be valid. + + This function should never return 0, as that's the default value that + Python exceptions will produce. + """ + #print("Running callback", handle) + orig_ffi_watcher = None + try: + # Even dereferencing the handle needs to be inside the try/except; + # if we don't return normally (e.g., a signal) then we wind up going + # to the 'onerror' handler (unhandled_onerror), which + # is not what we want; that can permanently wedge the loop depending + # on which callback was executing. + # XXX: See comments in that function. We may be able to restart and do better? + if not handle: + # Hmm, a NULL handle. That's not supposed to happen. + # We can easily get into a loop if we deref it and allow that + # to raise. + _dbg("python_callback got null handle") + return 1 + the_watcher = self.from_handle(handle) + orig_ffi_watcher = the_watcher._watcher + args = the_watcher.args + if args is None: + # Legacy behaviour from corecext: convert None into () + # See test__core_watcher.py + args = _NOARGS + if args and args[0] == GEVENT_CORE_EVENTS: + args = (revents, ) + args[1:] + #print("Calling function", the_watcher.callback, args) + the_watcher.callback(*args) + except: # pylint:disable=bare-except + _dbg("Got exception servicing watcher with handle", handle, sys.exc_info()) + # It's possible for ``the_watcher`` to be undefined (UnboundLocalError) + # if we threw an exception (signal) on the line that created that variable. + # This is typically the case with a signal under libuv + try: + the_watcher + except UnboundLocalError: + the_watcher = self.from_handle(handle) + the_watcher._exc_info = sys.exc_info() + # Depending on when the exception happened, the watcher + # may or may not have been stopped. We need to make sure its + # memory stays valid so we can stop it at the ev level if needed. + # If its loop is gone, it has already been stopped, + # see https://github.com/gevent/gevent/issues/1295 for a case where + # that happened + if the_watcher.loop is not None: + the_watcher.loop._keepaliveset.add(the_watcher) + return -1 + else: + if (the_watcher.loop is not None + and the_watcher in the_watcher.loop._keepaliveset + and the_watcher._watcher is orig_ffi_watcher): + # It didn't stop itself, *and* it didn't stop itself, reset + # its watcher, and start itself again. libuv's io watchers MAY + # do that. + # The normal, expected scenario when we find the watcher still + # in the keepaliveset is that it is still active at the event loop + # level, so we don't expect that python_stop gets called. + #_dbg("The watcher has not stopped itself, possibly still active", the_watcher) + return 1 + return 2 # it stopped itself + + def python_handle_error(self, handle, _revents): + _dbg("Handling error for handle", handle) + if not handle: + return + try: + watcher = self.from_handle(handle) + exc_info = watcher._exc_info + del watcher._exc_info + # In the past, we passed the ``watcher`` itself as the context, + # which typically meant that the Hub would just print + # the exception. This is a problem because sometimes we can't + # detect signals until late in ``python_callback``; specifically, + # test_selectors.py:DefaultSelectorTest.test_select_interrupt_exc + # installs a SIGALRM handler that raises an exception. That exception can happen + # before we enter ``python_callback`` or at any point within it because of the way + # libuv swallows signals. By passing None, we get the exception prapagated into + # the main greenlet (which is probably *also* not what we always want, but + # I see no way to distinguish the cases). + watcher.loop.handle_error(None, *exc_info) + finally: + # XXX Since we're here on an error condition, and we + # made sure that the watcher object was put in loop._keepaliveset, + # what about not stopping the watcher? Looks like a possible + # memory leak? + # XXX: This used to do "if revents & (libev.EV_READ | libev.EV_WRITE)" + # before stopping. Why? + try: + watcher.stop() + except: # pylint:disable=bare-except + watcher.loop.handle_error(watcher, *sys.exc_info()) + return # pylint:disable=lost-exception + + def unhandled_onerror(self, t, v, tb): + # This is supposed to be called for signals, etc. + # This is the onerror= value for CFFI. + # If we return None, C will get a value of 0/NULL; + # if we raise, CFFI will print the exception and then + # return 0/NULL; (unless error= was configured) + # If things go as planned, we return the value that asks + # C to call back and check on if the watcher needs to be closed or + # not. + + # XXX: TODO: Could this cause events to be lost? Maybe we need to return + # a value that causes the C loop to try the callback again? + # at least for signals under libuv, which are delivered at very odd times. + # Hopefully the event still shows up when we poll the next time. + watcher = None + handle = tb.tb_frame.f_locals['handle'] if tb is not None else None + if handle: # handle could be NULL + watcher = self.from_handle(handle) + if watcher is not None: + watcher.loop.handle_error(None, t, v, tb) + return 1 + + # Raising it causes a lot of noise from CFFI + print("WARNING: gevent: Unhandled error with no watcher", + file=sys.stderr) + traceback.print_exception(t, v, tb) + + def python_stop(self, handle): + if not handle: # pragma: no cover + print( + "WARNING: gevent: Unable to dereference handle; not stopping watcher. " + "Native resources may leak. This is most likely a bug in gevent.", + file=sys.stderr) + # The alternative is to crash with no helpful information + # NOTE: Raising exceptions here does nothing, they're swallowed by CFFI. + # Since the C level passed in a null pointer, even dereferencing the handle + # will just produce some exceptions. + return + watcher = self.from_handle(handle) + watcher.stop() + + if not PYPY: + def python_check_callback(self, watcher_ptr): # pylint:disable=unused-argument + # If we have the onerror callback, this is a no-op; all the real + # work to rethrow the exception is done by the onerror callback + + # NOTE: Unlike the rest of the functions, this is called with a pointer + # to the C level structure, *not* a pointer to the void* that represents a + # for the Python Watcher object. + pass + else: # PyPy + # On PyPy, we need the function to have some sort of body, otherwise + # the signal exceptions don't always get caught, *especially* with + # libuv (however, there's no reason to expect this to only be a libuv + # issue; it's just that we don't depend on the periodic signal timer + # under libev, so the issue is much more pronounced under libuv) + # test_socket's test_sendall_interrupted can hang. + # See https://github.com/gevent/gevent/issues/1112 + + def python_check_callback(self, watcher_ptr): # pylint:disable=unused-argument + # Things we've tried that *don't* work: + # greenlet.getcurrent() + # 1 + 1 + try: + raise MemoryError() + except MemoryError: + pass + + def python_prepare_callback(self, watcher_ptr): + loop = self._find_loop_from_c_watcher(watcher_ptr) + if loop is None: # pragma: no cover + print("WARNING: gevent: running prepare callbacks from a destroyed handle: ", + watcher_ptr) + return + loop._run_callbacks() + + def check_callback_onerror(self, t, v, tb): + watcher_ptr = tb.tb_frame.f_locals['watcher_ptr'] if tb is not None else None + if watcher_ptr: + loop = self._find_loop_from_c_watcher(watcher_ptr) + if loop is not None: + # None as the context argument causes the exception to be raised + # in the main greenlet. + loop.handle_error(None, t, v, tb) + return None + raise v # Let CFFI print + + def _find_loop_from_c_watcher(self, watcher_ptr): + raise NotImplementedError() + + + +def assign_standard_callbacks(ffi, lib, callbacks_class, extras=()): # pylint:disable=unused-argument + # callbacks keeps these cdata objects alive at the python level + callbacks = callbacks_class(ffi) + extras = tuple([(getattr(callbacks, name), error) for name, error in extras]) + for (func, error_func) in ((callbacks.python_callback, None), + (callbacks.python_handle_error, None), + (callbacks.python_stop, None), + (callbacks.python_check_callback, + callbacks.check_callback_onerror), + (callbacks.python_prepare_callback, + callbacks.check_callback_onerror)) + extras: + # The name of the callback function matches the 'extern Python' declaration. + error_func = error_func or callbacks.unhandled_onerror + callback = ffi.def_extern(onerror=error_func)(func) + # keep alive the cdata + # (def_extern returns the original function, and it requests that + # the function be "global", so maybe it keeps a hard reference to it somewhere now + # unlike ffi.callback(), and we don't need to do this?) + callbacks.callbacks.append(callback) + + # At this point, the library C variable (static function, actually) + # is filled in. + + return callbacks + + +if sys.version_info[0] >= 3: + basestring = (bytes, str) + integer_types = (int,) +else: + import __builtin__ # pylint:disable=import-error + basestring = (__builtin__.basestring,) + integer_types = (int, __builtin__.long) + + + + +_NOARGS = () + +CALLBACK_CHECK_COUNT = 50 + +class AbstractLoop(object): + # pylint:disable=too-many-public-methods,too-many-instance-attributes + + error_handler = None + + _CHECK_POINTER = None + + _TIMER_POINTER = None + _TIMER_CALLBACK_SIG = None + + _PREPARE_POINTER = None + + starting_timer_may_update_loop_time = False + + # Subclasses should set this in __init__ to reflect + # whether they were the default loop. + _default = None + + def __init__(self, ffi, lib, watchers, flags=None, default=None): + self._ffi = ffi + self._lib = lib + self._ptr = None + self._handle_to_self = self._ffi.new_handle(self) # XXX: Reference cycle? + self._watchers = watchers + self._in_callback = False + self._callbacks = deque() + # Stores python watcher objects while they are started + self._keepaliveset = set() + self._init_loop_and_aux_watchers(flags, default) + + + def _init_loop_and_aux_watchers(self, flags=None, default=None): + + self._ptr = self._init_loop(flags, default) + + + # self._check is a watcher that runs in each iteration of the + # mainloop, just after the blocking call. It's point is to handle + # signals. It doesn't run watchers or callbacks, it just exists to give + # CFFI a chance to raise signal exceptions so we can handle them. + self._check = self._ffi.new(self._CHECK_POINTER) + self._check.data = self._handle_to_self + self._init_and_start_check() + + # self._prepare is a watcher that runs in each iteration of the mainloop, + # just before the blocking call. It's where we run deferred callbacks + # from self.run_callback. This cooperates with _setup_for_run_callback() + # to schedule self._timer0 if needed. + self._prepare = self._ffi.new(self._PREPARE_POINTER) + self._prepare.data = self._handle_to_self + self._init_and_start_prepare() + + # A timer we start and stop on demand. If we have callbacks, + # too many to run in one iteration of _run_callbacks, we turn this + # on so as to have the next iteration of the run loop return to us + # as quickly as possible. + # TODO: There may be a more efficient way to do this using ev_timer_again; + # see the "ev_timer" section of the ev manpage (http://linux.die.net/man/3/ev) + # Alternatively, setting the ev maximum block time may also work. + self._timer0 = self._ffi.new(self._TIMER_POINTER) + self._timer0.data = self._handle_to_self + self._init_callback_timer() + + # TODO: We may be able to do something nicer and use the existing python_callback + # combined with onerror and the class check/timer/prepare to simplify things + # and unify our handling + + def _init_loop(self, flags, default): + """ + Called by __init__ to create or find the loop. The return value + is assigned to self._ptr. + """ + raise NotImplementedError() + + def _init_and_start_check(self): + raise NotImplementedError() + + def _init_and_start_prepare(self): + raise NotImplementedError() + + def _init_callback_timer(self): + raise NotImplementedError() + + def _stop_callback_timer(self): + raise NotImplementedError() + + def _start_callback_timer(self): + raise NotImplementedError() + + def _check_callback_handle_error(self, t, v, tb): + self.handle_error(None, t, v, tb) + + def _run_callbacks(self): # pylint:disable=too-many-branches + # When we're running callbacks, its safe for timers to + # update the notion of the current time (because if we're here, + # we're not running in a timer callback that may let other timers + # run; this is mostly an issue for libuv). + + # That's actually a bit of a lie: on libev, self._timer0 really is + # a timer, and so sometimes this is running in a timer callback, not + # a prepare callback. But that's OK, libev doesn't suffer from cascading + # timer expiration and its safe to update the loop time at any + # moment there. + self.starting_timer_may_update_loop_time = True + try: + count = CALLBACK_CHECK_COUNT + now = self.now() + expiration = now + getswitchinterval() + self._stop_callback_timer() + while self._callbacks: + cb = self._callbacks.popleft() # pylint:disable=assignment-from-no-return + count -= 1 + self.unref() # XXX: libuv doesn't have a global ref count! + callback = cb.callback + cb.callback = None + args = cb.args + if callback is None or args is None: + # it's been stopped + continue + + try: + callback(*args) + except: # pylint:disable=bare-except + # If we allow an exception to escape this method (while we are running the ev callback), + # then CFFI will print the error and libev will continue executing. + # There are two problems with this. The first is that the code after + # the loop won't run. The second is that any remaining callbacks scheduled + # for this loop iteration will be silently dropped; they won't run, but they'll + # also not be *stopped* (which is not a huge deal unless you're looking for + # consistency or checking the boolean/pending status; the loop doesn't keep + # a reference to them like it does to watchers...*UNLESS* the callback itself had + # a reference to a watcher; then I don't know what would happen, it depends on + # the state of the watcher---a leak or crash is not totally inconceivable). + # The Cython implementation in core.ppyx uses gevent_call from callbacks.c + # to run the callback, which uses gevent_handle_error to handle any errors the + # Python callback raises...it unconditionally simply prints any error raised + # by loop.handle_error and clears it, so callback handling continues. + # We take a similar approach (but are extra careful about printing) + try: + self.handle_error(cb, *sys.exc_info()) + except: # pylint:disable=bare-except + try: + print("Exception while handling another error", file=sys.stderr) + traceback.print_exc() + except: # pylint:disable=bare-except + pass # Nothing we can do here + finally: + # NOTE: this must be reset here, because cb.args is used as a flag in + # the callback class so that bool(cb) of a callback that has been run + # becomes False + cb.args = None + + # We've finished running one group of callbacks + # but we may have more, so before looping check our + # switch interval. + if count == 0 and self._callbacks: + count = CALLBACK_CHECK_COUNT + self.update_now() + if self.now() >= expiration: + now = 0 + break + + # Update the time before we start going again, if we didn't + # just do so. + if now != 0: + self.update_now() + + if self._callbacks: + self._start_callback_timer() + finally: + self.starting_timer_may_update_loop_time = False + + def _stop_aux_watchers(self): + raise NotImplementedError() + + def destroy(self): + if self._ptr: + try: + if not self._can_destroy_loop(self._ptr): + return False + self._stop_aux_watchers() + self._destroy_loop(self._ptr) + finally: + # not ffi.NULL, we don't want something that can be + # passed to C and crash later. This will create nice friendly + # TypeError from CFFI. + self._ptr = None + del self._handle_to_self + del self._callbacks + del self._keepaliveset + + return True + + def _can_destroy_loop(self, ptr): + raise NotImplementedError() + + def _destroy_loop(self, ptr): + raise NotImplementedError() + + @property + def ptr(self): + return self._ptr + + @property + def WatcherType(self): + return self._watchers.watcher + + @property + def MAXPRI(self): + return 1 + + @property + def MINPRI(self): + return 1 + + def _handle_syserr(self, message, errno): + try: + errno = os.strerror(errno) + except: # pylint:disable=bare-except + traceback.print_exc() + try: + message = '%s: %s' % (message, errno) + except: # pylint:disable=bare-except + traceback.print_exc() + self.handle_error(None, SystemError, SystemError(message), None) + + def handle_error(self, context, type, value, tb): + handle_error = None + error_handler = self.error_handler + if error_handler is not None: + # we do want to do getattr every time so that setting Hub.handle_error property just works + handle_error = getattr(error_handler, 'handle_error', error_handler) + handle_error(context, type, value, tb) + else: + self._default_handle_error(context, type, value, tb) + + def _default_handle_error(self, context, type, value, tb): # pylint:disable=unused-argument + # note: Hub sets its own error handler so this is not used by gevent + # this is here to make core.loop usable without the rest of gevent + # Should cause the loop to stop running. + traceback.print_exception(type, value, tb) + + + def run(self, nowait=False, once=False): + raise NotImplementedError() + + def reinit(self): + raise NotImplementedError() + + def ref(self): + # XXX: libuv doesn't do it this way + raise NotImplementedError() + + def unref(self): + raise NotImplementedError() + + def break_(self, how=None): + raise NotImplementedError() + + def verify(self): + pass + + def now(self): + raise NotImplementedError() + + def update_now(self): + raise NotImplementedError() + + def update(self): + import warnings + warnings.warn("'update' is deprecated; use 'update_now'", + DeprecationWarning, + stacklevel=2) + self.update_now() + + def __repr__(self): + return '<%s at 0x%x %s>' % (self.__class__.__name__, id(self), self._format()) + + @property + def default(self): + return self._default if self._ptr else False + + @property + def iteration(self): + return -1 + + @property + def depth(self): + return -1 + + @property + def backend_int(self): + return 0 + + @property + def backend(self): + return "default" + + @property + def pendingcnt(self): + return 0 + + def io(self, fd, events, ref=True, priority=None): + return self._watchers.io(self, fd, events, ref, priority) + + def timer(self, after, repeat=0.0, ref=True, priority=None): + return self._watchers.timer(self, after, repeat, ref, priority) + + def signal(self, signum, ref=True, priority=None): + return self._watchers.signal(self, signum, ref, priority) + + def idle(self, ref=True, priority=None): + return self._watchers.idle(self, ref, priority) + + def prepare(self, ref=True, priority=None): + return self._watchers.prepare(self, ref, priority) + + def check(self, ref=True, priority=None): + return self._watchers.check(self, ref, priority) + + def fork(self, ref=True, priority=None): + return self._watchers.fork(self, ref, priority) + + def async_(self, ref=True, priority=None): + return self._watchers.async_(self, ref, priority) + + # Provide BWC for those that can use 'async' as is + locals()['async'] = async_ + + if sys.platform != "win32": + + def child(self, pid, trace=0, ref=True): + return self._watchers.child(self, pid, trace, ref) + + def install_sigchld(self): + pass + + def stat(self, path, interval=0.0, ref=True, priority=None): + return self._watchers.stat(self, path, interval, ref, priority) + + def callback(self, priority=None): + return callback(self, priority) + + def _setup_for_run_callback(self): + raise NotImplementedError() + + def run_callback(self, func, *args): + # If we happen to already be running callbacks (inside + # _run_callbacks), this could happen almost immediately, + # without the loop cycling. + cb = callback(func, args) + self._callbacks.append(cb) + self._setup_for_run_callback() + + return cb + + def _format(self): + if not self._ptr: + return 'destroyed' + msg = self.backend + if self.default: + msg += ' default' + msg += ' pending=%s' % self.pendingcnt + msg += self._format_details() + return msg + + def _format_details(self): + msg = '' + fileno = self.fileno() # pylint:disable=assignment-from-none + try: + activecnt = self.activecnt + except AttributeError: + activecnt = None + if activecnt is not None: + msg += ' ref=' + repr(activecnt) + if fileno is not None: + msg += ' fileno=' + repr(fileno) + #if sigfd is not None and sigfd != -1: + # msg += ' sigfd=' + repr(sigfd) + return msg + + def fileno(self): + return None + + @property + def activecnt(self): + if not self._ptr: + raise ValueError('operation on destroyed loop') + return 0 diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_ffi/watcher.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_ffi/watcher.py new file mode 100644 index 00000000..3f880cef --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_ffi/watcher.py @@ -0,0 +1,641 @@ +""" +Useful base classes for watchers. The available +watchers will depend on the specific event loop. +""" +# pylint:disable=not-callable +from __future__ import absolute_import, print_function + +import signal as signalmodule +import functools +import warnings + +from gevent._config import config + +try: + from tracemalloc import get_object_traceback + + def tracemalloc(init): + # PYTHONTRACEMALLOC env var controls this on Python 3. + return init +except ImportError: # Python < 3.4 + + if config.trace_malloc: + # Use the same env var to turn this on for Python 2 + import traceback + + class _TB(object): + __slots__ = ('lines',) + + def __init__(self, lines): + # These end in newlines, which we don't want for consistency + self.lines = [x.rstrip() for x in lines] + + def format(self): + return self.lines + + def tracemalloc(init): + @functools.wraps(init) + def traces(self, *args, **kwargs): + init(self, *args, **kwargs) + self._captured_malloc = _TB(traceback.format_stack()) + return traces + + def get_object_traceback(obj): + return obj._captured_malloc + + else: + def get_object_traceback(_obj): + return None + + def tracemalloc(init): + return init + +from gevent._compat import fsencode + +from gevent._ffi import _dbg # pylint:disable=unused-import +from gevent._ffi import GEVENT_DEBUG_LEVEL +from gevent._ffi import DEBUG +from gevent._ffi.loop import GEVENT_CORE_EVENTS +from gevent._ffi.loop import _NOARGS + +ALLOW_WATCHER_DEL = GEVENT_DEBUG_LEVEL >= DEBUG + +__all__ = [ + +] + +try: + ResourceWarning +except NameError: + class ResourceWarning(Warning): + "Python 2 fallback" + +class _NoWatcherResult(int): + + def __repr__(self): + return "" + +_NoWatcherResult = _NoWatcherResult(0) + +def events_to_str(event_field, all_events): + result = [] + for (flag, string) in all_events: + c_flag = flag + if event_field & c_flag: + result.append(string) + event_field = event_field & (~c_flag) + if not event_field: + break + if event_field: + result.append(hex(event_field)) + return '|'.join(result) + + +def not_while_active(func): + @functools.wraps(func) + def nw(self, *args, **kwargs): + if self.active: + raise ValueError("not while active") + func(self, *args, **kwargs) + return nw + +def only_if_watcher(func): + @functools.wraps(func) + def if_w(self): + if self._watcher: + return func(self) + return _NoWatcherResult + return if_w + + +class LazyOnClass(object): + + @classmethod + def lazy(cls, cls_dict, func): + "Put a LazyOnClass object in *cls_dict* with the same name as *func*" + cls_dict[func.__name__] = cls(func) + + def __init__(self, func, name=None): + self.name = name or func.__name__ + self.func = func + + def __get__(self, inst, klass): + if inst is None: # pragma: no cover + return self + + val = self.func(inst) + setattr(klass, self.name, val) + return val + + +class AbstractWatcherType(type): + """ + Base metaclass for watchers. + + To use, you will: + + - subclass the watcher class defined from this type. + - optionally subclass this type + """ + # pylint:disable=bad-mcs-classmethod-argument + + _FFI = None + _LIB = None + + def __new__(cls, name, bases, cls_dict): + if name != 'watcher' and not cls_dict.get('_watcher_skip_ffi'): + cls._fill_watcher(name, bases, cls_dict) + if '__del__' in cls_dict and not ALLOW_WATCHER_DEL: # pragma: no cover + raise TypeError("CFFI watchers are not allowed to have __del__") + return type.__new__(cls, name, bases, cls_dict) + + @classmethod + def _fill_watcher(cls, name, bases, cls_dict): + # TODO: refactor smaller + # pylint:disable=too-many-locals + if name.endswith('_'): + # Strip trailing _ added to avoid keyword duplications + # e.g., async_ + name = name[:-1] + + def _mro_get(attr, bases, error=True): + for b in bases: + try: + return getattr(b, attr) + except AttributeError: + continue + if error: # pragma: no cover + raise AttributeError(attr) + _watcher_prefix = cls_dict.get('_watcher_prefix') or _mro_get('_watcher_prefix', bases) + + if '_watcher_type' not in cls_dict: + watcher_type = _watcher_prefix + '_' + name + cls_dict['_watcher_type'] = watcher_type + elif not cls_dict['_watcher_type'].startswith(_watcher_prefix): + watcher_type = _watcher_prefix + '_' + cls_dict['_watcher_type'] + cls_dict['_watcher_type'] = watcher_type + + active_name = _watcher_prefix + '_is_active' + + def _watcher_is_active(self): + return getattr(self._LIB, active_name) + + LazyOnClass.lazy(cls_dict, _watcher_is_active) + + watcher_struct_name = cls_dict.get('_watcher_struct_name') + if not watcher_struct_name: + watcher_struct_pattern = (cls_dict.get('_watcher_struct_pattern') + or _mro_get('_watcher_struct_pattern', bases, False) + or 'struct %s') + watcher_struct_name = watcher_struct_pattern % (watcher_type,) + + def _watcher_struct_pointer_type(self): + return self._FFI.typeof(watcher_struct_name + ' *') + + LazyOnClass.lazy(cls_dict, _watcher_struct_pointer_type) + + callback_name = (cls_dict.get('_watcher_callback_name') + or _mro_get('_watcher_callback_name', bases, False) + or '_gevent_generic_callback') + + def _watcher_callback(self): + return self._FFI.addressof(self._LIB, callback_name) + + LazyOnClass.lazy(cls_dict, _watcher_callback) + + def _make_meth(name, watcher_name): + def meth(self): + lib_name = self._watcher_type + '_' + name + return getattr(self._LIB, lib_name) + meth.__name__ = watcher_name + return meth + + for meth_name in 'start', 'stop', 'init': + watcher_name = '_watcher' + '_' + meth_name + if watcher_name not in cls_dict: + LazyOnClass.lazy(cls_dict, _make_meth(meth_name, watcher_name)) + + def new_handle(cls, obj): + return cls._FFI.new_handle(obj) + + def new(cls, kind): + return cls._FFI.new(kind) + +class watcher(object): + + _callback = None + _args = None + _watcher = None + # self._handle has a reference to self, keeping it alive. + # We must keep self._handle alive for ffi.from_handle() to be + # able to work. We only fill this in when we are started, + # and when we are stopped we destroy it. + # NOTE: This is a GC cycle, so we keep it around for as short + # as possible. + _handle = None + + @tracemalloc + def __init__(self, _loop, ref=True, priority=None, args=_NOARGS): + self.loop = _loop + self.__init_priority = priority + self.__init_args = args + self.__init_ref = ref + self._watcher_full_init() + + + def _watcher_full_init(self): + priority = self.__init_priority + ref = self.__init_ref + args = self.__init_args + + self._watcher_create(ref) + + if priority is not None: + self._watcher_ffi_set_priority(priority) + + try: + self._watcher_ffi_init(args) + except: + # Let these be GC'd immediately. + # If we keep them around to when *we* are gc'd, + # they're probably invalid, meaning any native calls + # we do then to close() them are likely to fail + self._watcher = None + raise + self._watcher_ffi_set_init_ref(ref) + + @classmethod + def _watcher_ffi_close(cls, ffi_watcher): + pass + + def _watcher_create(self, ref): # pylint:disable=unused-argument + self._watcher = self._watcher_new() + + def _watcher_new(self): + return type(self).new(self._watcher_struct_pointer_type) # pylint:disable=no-member + + def _watcher_ffi_set_init_ref(self, ref): + pass + + def _watcher_ffi_set_priority(self, priority): + pass + + def _watcher_ffi_init(self, args): + raise NotImplementedError() + + def _watcher_ffi_start(self): + raise NotImplementedError() + + def _watcher_ffi_stop(self): + self._watcher_stop(self.loop._ptr, self._watcher) + + def _watcher_ffi_ref(self): + raise NotImplementedError() + + def _watcher_ffi_unref(self): + raise NotImplementedError() + + def _watcher_ffi_start_unref(self): + # While a watcher is active, we don't keep it + # referenced. This allows a timer, for example, to be started, + # and still allow the loop to end if there is nothing + # else to do. see test__order.TestSleep0 for one example. + self._watcher_ffi_unref() + + def _watcher_ffi_stop_ref(self): + self._watcher_ffi_ref() + + # A string identifying the type of libev object we watch, e.g., 'ev_io' + # This should be a class attribute. + _watcher_type = None + # A class attribute that is the callback on the libev object that init's the C struct, + # e.g., libev.ev_io_init. If None, will be set by _init_subclasses. + _watcher_init = None + # A class attribute that is the callback on the libev object that starts the C watcher, + # e.g., libev.ev_io_start. If None, will be set by _init_subclasses. + _watcher_start = None + # A class attribute that is the callback on the libev object that stops the C watcher, + # e.g., libev.ev_io_stop. If None, will be set by _init_subclasses. + _watcher_stop = None + # A cffi ctype object identifying the struct pointer we create. + # This is a class attribute set based on the _watcher_type + _watcher_struct_pointer_type = None + # The attribute of the libev object identifying the custom + # callback function for this type of watcher. This is a class + # attribute set based on the _watcher_type in _init_subclasses. + _watcher_callback = None + _watcher_is_active = None + + def close(self): + if self._watcher is None: + return + + self.stop() + _watcher = self._watcher + self._watcher = None + self._watcher_set_data(_watcher, self._FFI.NULL) # pylint: disable=no-member + self._watcher_ffi_close(_watcher) + self.loop = None + + def _watcher_set_data(self, the_watcher, data): + # This abstraction exists for the sole benefit of + # libuv.watcher.stat, which "subclasses" uv_handle_t. + # Can we do something to avoid this extra function call? + the_watcher.data = data + return data + + def __enter__(self): + return self + + def __exit__(self, t, v, tb): + self.close() + + if ALLOW_WATCHER_DEL: + def __del__(self): + if self._watcher: + tb = get_object_traceback(self) + tb_msg = '' + if tb is not None: + tb_msg = '\n'.join(tb.format()) + tb_msg = '\nTraceback:\n' + tb_msg + warnings.warn("Failed to close watcher %r%s" % (self, tb_msg), + ResourceWarning) + + # may fail if __init__ did; will be harmlessly printed + self.close() + + + def __repr__(self): + formats = self._format() + result = "<%s at 0x%x%s" % (self.__class__.__name__, id(self), formats) + if self.pending: + result += " pending" + if self.callback is not None: + fself = getattr(self.callback, '__self__', None) + if fself is self: + result += " callback=" % (self.callback.__name__) + else: + result += " callback=%r" % (self.callback, ) + if self.args is not None: + result += " args=%r" % (self.args, ) + if self.callback is None and self.args is None: + result += " stopped" + result += " watcher=%s" % (self._watcher) + result += " handle=%s" % (self._watcher_handle) + result += " ref=%s" % (self.ref) + return result + ">" + + @property + def _watcher_handle(self): + if self._watcher: + return self._watcher.data + + def _format(self): + return '' + + @property + def ref(self): + raise NotImplementedError() + + def _get_callback(self): + return self._callback + + def _set_callback(self, cb): + if not callable(cb) and cb is not None: + raise TypeError("Expected callable, not %r" % (cb, )) + if cb is None: + if '_callback' in self.__dict__: + del self._callback + else: + self._callback = cb + callback = property(_get_callback, _set_callback) + + def _get_args(self): + return self._args + + def _set_args(self, args): + if not isinstance(args, tuple) and args is not None: + raise TypeError("args must be a tuple or None") + if args is None: + if '_args' in self.__dict__: + del self._args + else: + self._args = args + + args = property(_get_args, _set_args) + + def start(self, callback, *args): + if callback is None: + raise TypeError('callback must be callable, not None') + self.callback = callback + self.args = args or _NOARGS + self.loop._keepaliveset.add(self) + self._handle = self._watcher_set_data(self._watcher, type(self).new_handle(self)) # pylint:disable=no-member + self._watcher_ffi_start() + self._watcher_ffi_start_unref() + + def stop(self): + if self._callback is None: + assert self.loop is None or self not in self.loop._keepaliveset + return + self._watcher_ffi_stop_ref() + self._watcher_ffi_stop() + self.loop._keepaliveset.discard(self) + self._handle = None + self._watcher_set_data(self._watcher, self._FFI.NULL) # pylint:disable=no-member + self.callback = None + self.args = None + + def _get_priority(self): + return None + + @not_while_active + def _set_priority(self, priority): + pass + + priority = property(_get_priority, _set_priority) + + + @property + def active(self): + if self._watcher is not None and self._watcher_is_active(self._watcher): + return True + return False + + @property + def pending(self): + return False + +watcher = AbstractWatcherType('watcher', (object,), dict(watcher.__dict__)) + +class IoMixin(object): + + EVENT_MASK = 0 + + def __init__(self, loop, fd, events, ref=True, priority=None, _args=None): + # Win32 only works with sockets, and only when we use libuv, because + # we don't use _open_osfhandle. See libuv/watchers.py:io for a description. + if fd < 0: + raise ValueError('fd must be non-negative: %r' % fd) + if events & ~self.EVENT_MASK: + raise ValueError('illegal event mask: %r' % events) + self._fd = fd + super(IoMixin, self).__init__(loop, ref=ref, priority=priority, + args=_args or (fd, events)) + + def start(self, callback, *args, **kwargs): + args = args or _NOARGS + if kwargs.get('pass_events'): + args = (GEVENT_CORE_EVENTS, ) + args + super(IoMixin, self).start(callback, *args) + + def _format(self): + return ' fd=%d' % self._fd + +class TimerMixin(object): + _watcher_type = 'timer' + + def __init__(self, loop, after=0.0, repeat=0.0, ref=True, priority=None): + if repeat < 0.0: + raise ValueError("repeat must be positive or zero: %r" % repeat) + self._after = after + self._repeat = repeat + super(TimerMixin, self).__init__(loop, ref=ref, priority=priority, args=(after, repeat)) + + def start(self, callback, *args, **kw): + update = kw.get("update", self.loop.starting_timer_may_update_loop_time) + if update: + # Quoth the libev doc: "This is a costly operation and is + # usually done automatically within ev_run(). This + # function is rarely useful, but when some event callback + # runs for a very long time without entering the event + # loop, updating libev's idea of the current time is a + # good idea." + + # 1.3 changed the default for this to False *unless* the loop is + # running a callback; see libuv for details. Note that + # starting Timeout objects still sets this to true. + + self.loop.update_now() + super(TimerMixin, self).start(callback, *args) + + def again(self, callback, *args, **kw): + raise NotImplementedError() + + +class SignalMixin(object): + _watcher_type = 'signal' + + def __init__(self, loop, signalnum, ref=True, priority=None): + if signalnum < 1 or signalnum >= signalmodule.NSIG: + raise ValueError('illegal signal number: %r' % signalnum) + # still possible to crash on one of libev's asserts: + # 1) "libev: ev_signal_start called with illegal signal number" + # EV_NSIG might be different from signal.NSIG on some platforms + # 2) "libev: a signal must not be attached to two different loops" + # we probably could check that in LIBEV_EMBED mode, but not in general + self._signalnum = signalnum + super(SignalMixin, self).__init__(loop, ref=ref, priority=priority, args=(signalnum, )) + + +class IdleMixin(object): + _watcher_type = 'idle' + + +class PrepareMixin(object): + _watcher_type = 'prepare' + + +class CheckMixin(object): + _watcher_type = 'check' + + +class ForkMixin(object): + _watcher_type = 'fork' + + +class AsyncMixin(object): + _watcher_type = 'async' + + def send(self): + raise NotImplementedError() + + @property + def pending(self): + raise NotImplementedError() + + +class ChildMixin(object): + + # hack for libuv which doesn't extend watcher + _CALL_SUPER_INIT = True + + def __init__(self, loop, pid, trace=0, ref=True): + if not loop.default: + raise TypeError('child watchers are only available on the default loop') + loop.install_sigchld() + self._pid = pid + if self._CALL_SUPER_INIT: + super(ChildMixin, self).__init__(loop, ref=ref, args=(pid, trace)) + + def _format(self): + return ' pid=%r rstatus=%r' % (self.pid, self.rstatus) + + @property + def pid(self): + return self._pid + + @property + def rpid(self): + # The received pid, the result of the waitpid() call. + return self._rpid + + _rpid = None + _rstatus = 0 + + @property + def rstatus(self): + return self._rstatus + +class StatMixin(object): + + @staticmethod + def _encode_path(path): + return fsencode(path) + + def __init__(self, _loop, path, interval=0.0, ref=True, priority=None): + # Store the encoded path in the same attribute that corecext does + self._paths = self._encode_path(path) + + # Keep the original path to avoid re-encoding, especially on Python 3 + self._path = path + + # Although CFFI would automatically convert a bytes object into a char* when + # calling ev_stat_init(..., char*, ...), on PyPy the char* pointer is not + # guaranteed to live past the function call. On CPython, only with a constant/interned + # bytes object is the pointer guaranteed to last path the function call. (And since + # Python 3 is pretty much guaranteed to produce a newly-encoded bytes object above, thats + # rarely the case). Therefore, we must keep a reference to the produced cdata object + # so that the struct ev_stat_watcher's `path` pointer doesn't become invalid/deallocated + self._cpath = self._FFI.new('char[]', self._paths) + + self._interval = interval + super(StatMixin, self).__init__(_loop, ref=ref, priority=priority, + args=(self._cpath, + interval)) + + @property + def path(self): + return self._path + + @property + def attr(self): + raise NotImplementedError + + @property + def prev(self): + raise NotImplementedError + + @property + def interval(self): + return self._interval diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_fileobjectcommon.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_fileobjectcommon.py new file mode 100644 index 00000000..99404f3e --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_fileobjectcommon.py @@ -0,0 +1,281 @@ +from __future__ import absolute_import, print_function, division + +try: + from errno import EBADF +except ImportError: + EBADF = 9 + +import os +from io import TextIOWrapper +import functools +import sys + + +from gevent.hub import _get_hub_noargs as get_hub +from gevent._compat import integer_types +from gevent._compat import reraise +from gevent.lock import Semaphore, DummySemaphore + +class cancel_wait_ex(IOError): + + def __init__(self): + super(cancel_wait_ex, self).__init__( + EBADF, 'File descriptor was closed in another greenlet') + + +class FileObjectClosed(IOError): + + def __init__(self): + super(FileObjectClosed, self).__init__( + EBADF, 'Bad file descriptor (FileObject was closed)') + +class FileObjectBase(object): + """ + Internal base class to ensure a level of consistency + between FileObjectPosix and FileObjectThread + """ + + # List of methods we delegate to the wrapping IO object, if they + # implement them and we do not. + _delegate_methods = ( + # General methods + 'flush', + 'fileno', + 'writable', + 'readable', + 'seek', + 'seekable', + 'tell', + + # Read + 'read', + 'readline', + 'readlines', + 'read1', + + # Write + 'write', + 'writelines', + 'truncate', + ) + + + # Whether we are translating universal newlines or not. + _translate = False + + _translate_encoding = None + _translate_errors = None + + def __init__(self, io, closefd): + """ + :param io: An io.IOBase-like object. + """ + self._io = io + # We don't actually use this property ourself, but we save it (and + # pass it along) for compatibility. + self._close = closefd + + if self._translate: + # This automatically handles delegation by assigning to + # self.io + self.translate_newlines(None, self._translate_encoding, self._translate_errors) + else: + self._do_delegate_methods() + + + io = property(lambda s: s._io, + # Historically we either hand-wrote all the delegation methods + # to use self.io, or we simply used __getattr__ to look them up at + # runtime. This meant people could change the io attribute on the fly + # and it would mostly work (subprocess.py used to do that). We don't recommend + # that, but we still support it. + lambda s, nv: setattr(s, '_io', nv) or s._do_delegate_methods()) + + def _do_delegate_methods(self): + for meth_name in self._delegate_methods: + meth = getattr(self._io, meth_name, None) + implemented_by_class = hasattr(type(self), meth_name) + if meth and not implemented_by_class: + setattr(self, meth_name, self._wrap_method(meth)) + elif hasattr(self, meth_name) and not implemented_by_class: + delattr(self, meth_name) + + def _wrap_method(self, method): + """ + Wrap a method we're copying into our dictionary from the underlying + io object to do something special or different, if necessary. + """ + return method + + def translate_newlines(self, mode, *text_args, **text_kwargs): + wrapper = TextIOWrapper(self._io, *text_args, **text_kwargs) + if mode: + wrapper.mode = mode + self.io = wrapper + self._translate = True + + @property + def closed(self): + """True if the file is closed""" + return self._io is None + + def close(self): + if self._io is None: + return + + io = self._io + self._io = None + self._do_close(io, self._close) + + def _do_close(self, fobj, closefd): + raise NotImplementedError() + + def __getattr__(self, name): + if self._io is None: + raise FileObjectClosed() + return getattr(self._io, name) + + def __repr__(self): + return '<%s _fobj=%r%s>' % (self.__class__.__name__, self.io, self._extra_repr()) + + def _extra_repr(self): + return '' + + def __enter__(self): + return self + + def __exit__(self, *args): + self.close() + +class FileObjectBlock(FileObjectBase): + + def __init__(self, fobj, *args, **kwargs): + closefd = kwargs.pop('close', True) + if kwargs: + raise TypeError('Unexpected arguments: %r' % kwargs.keys()) + if isinstance(fobj, integer_types): + if not closefd: + # we cannot do this, since fdopen object will close the descriptor + raise TypeError('FileObjectBlock does not support close=False on an fd.') + fobj = os.fdopen(fobj, *args) + super(FileObjectBlock, self).__init__(fobj, closefd) + + def _do_close(self, fobj, closefd): + fobj.close() + +class FileObjectThread(FileObjectBase): + """ + A file-like object wrapping another file-like object, performing all blocking + operations on that object in a background thread. + + .. caution:: + Attempting to change the threadpool or lock of an existing FileObjectThread + has undefined consequences. + + .. versionchanged:: 1.1b1 + The file object is closed using the threadpool. Note that whether or + not this action is synchronous or asynchronous is not documented. + + """ + + def __init__(self, fobj, mode=None, bufsize=-1, close=True, threadpool=None, lock=True): + """ + :param fobj: The underlying file-like object to wrap, or an integer fileno + that will be pass to :func:`os.fdopen` along with *mode* and *bufsize*. + :keyword bool lock: If True (the default) then all operations will + be performed one-by-one. Note that this does not guarantee that, if using + this file object from multiple threads/greenlets, operations will be performed + in any particular order, only that no two operations will be attempted at the + same time. You can also pass your own :class:`gevent.lock.Semaphore` to synchronize + file operations with an external resource. + :keyword bool close: If True (the default) then when this object is closed, + the underlying object is closed as well. + """ + closefd = close + self.threadpool = threadpool or get_hub().threadpool + self.lock = lock + if self.lock is True: + self.lock = Semaphore() + elif not self.lock: + self.lock = DummySemaphore() + if not hasattr(self.lock, '__enter__'): + raise TypeError('Expected a Semaphore or boolean, got %r' % type(self.lock)) + if isinstance(fobj, integer_types): + if not closefd: + # we cannot do this, since fdopen object will close the descriptor + raise TypeError('FileObjectThread does not support close=False on an fd.') + if mode is None: + assert bufsize == -1, "If you use the default mode, you can't choose a bufsize" + fobj = os.fdopen(fobj) + else: + fobj = os.fdopen(fobj, mode, bufsize) + + self.__io_holder = [fobj] # signal for _wrap_method + super(FileObjectThread, self).__init__(fobj, closefd) + + def _do_close(self, fobj, closefd): + self.__io_holder[0] = None # for _wrap_method + try: + with self.lock: + self.threadpool.apply(fobj.flush) + finally: + if closefd: + # Note that we're not taking the lock; older code + # did fobj.close() without going through the threadpool at all, + # so acquiring the lock could potentially introduce deadlocks + # that weren't present before. Avoiding the lock doesn't make + # the existing race condition any worse. + # We wrap the close in an exception handler and re-raise directly + # to avoid the (common, expected) IOError from being logged by the pool + def close(_fobj=fobj): + try: + _fobj.close() + except: # pylint:disable=bare-except + return sys.exc_info() + finally: + _fobj = None + del fobj + + exc_info = self.threadpool.apply(close) + del close + + if exc_info: + reraise(*exc_info) + + def _do_delegate_methods(self): + super(FileObjectThread, self)._do_delegate_methods() + if not hasattr(self, 'read1') and 'r' in getattr(self._io, 'mode', ''): + self.read1 = self.read + self.__io_holder[0] = self._io + + def _extra_repr(self): + return ' threadpool=%r' % (self.threadpool,) + + def __iter__(self): + return self + + def next(self): + line = self.readline() + if line: + return line + raise StopIteration + __next__ = next + + def _wrap_method(self, method): + # NOTE: We are careful to avoid introducing a refcycle + # within self. Our wrapper cannot refer to self. + io_holder = self.__io_holder + lock = self.lock + threadpool = self.threadpool + + @functools.wraps(method) + def thread_method(*args, **kwargs): + if io_holder[0] is None: + # This is different than FileObjectPosix, etc, + # because we want to save the expensive trip through + # the threadpool. + raise FileObjectClosed() + with lock: + return threadpool.apply(method, args, kwargs) + + return thread_method diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_fileobjectposix.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_fileobjectposix.py new file mode 100644 index 00000000..699743c8 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_fileobjectposix.py @@ -0,0 +1,357 @@ +from __future__ import absolute_import +import os +import sys +import io +from io import BufferedReader +from io import BufferedWriter +from io import BytesIO +from io import DEFAULT_BUFFER_SIZE +from io import RawIOBase +from io import UnsupportedOperation + +from gevent._compat import reraise +from gevent._fileobjectcommon import cancel_wait_ex +from gevent._fileobjectcommon import FileObjectBase +from gevent.hub import get_hub +from gevent.os import _read +from gevent.os import _write +from gevent.os import ignored_errors +from gevent.os import make_nonblocking + + +class GreenFileDescriptorIO(RawIOBase): + + # Note that RawIOBase has a __del__ method that calls + # self.close(). (In C implementations like CPython, this is + # the type's tp_dealloc slot; prior to Python 3, the object doesn't + # appear to have a __del__ method, even though it functionally does) + + _read_event = None + _write_event = None + _closed = False + _seekable = None + + def __init__(self, fileno, mode='r', closefd=True): + RawIOBase.__init__(self) # Python 2: pylint:disable=no-member,non-parent-init-called + + self._closefd = closefd + self._fileno = fileno + make_nonblocking(fileno) + readable = 'r' in mode + writable = 'w' in mode + + self.hub = get_hub() + io_watcher = self.hub.loop.io + try: + if readable: + self._read_event = io_watcher(fileno, 1) + + if writable: + self._write_event = io_watcher(fileno, 2) + except: + # If anything goes wrong, it's important to go ahead and + # close these watchers *now*, especially under libuv, so + # that they don't get eventually reclaimed by the garbage + # collector at some random time, thanks to the C level + # slot (even though we don't seem to have any actual references + # at the Python level). Previously, if we didn't close now, + # that random close in the future would cause issues if we had duplicated + # the fileno (if a wrapping with statement had closed an open fileobject, + # for example) + + # test__fileobject can show a failure if this doesn't happen + # TRAVIS=true GEVENT_LOOP=libuv python -m gevent.tests.test__fileobject \ + # TestFileObjectPosix.test_seek TestFileObjectThread.test_bufsize_0 + self.close() + raise + + def readable(self): + return self._read_event is not None + + def writable(self): + return self._write_event is not None + + def seekable(self): + if self._seekable is None: + try: + os.lseek(self._fileno, 0, os.SEEK_CUR) + except OSError: + self._seekable = False + else: + self._seekable = True + return self._seekable + + def fileno(self): + return self._fileno + + @property + def closed(self): + return self._closed + + def __destroy_events(self): + read_event = self._read_event + write_event = self._write_event + hub = self.hub + self.hub = self._read_event = self._write_event = None + + if read_event is not None: + hub.cancel_wait(read_event, cancel_wait_ex, True) + if write_event is not None: + hub.cancel_wait(write_event, cancel_wait_ex, True) + + def close(self): + if self._closed: + return + self.flush() + # TODO: Can we use 'read_event is not None and write_event is + # not None' to mean _closed? + self._closed = True + self.__destroy_events() + fileno = self._fileno + if self._closefd: + self._fileno = None + os.close(fileno) + + # RawIOBase provides a 'read' method that will call readall() if + # the `size` was missing or -1 and otherwise call readinto(). We + # want to take advantage of this to avoid single byte reads when + # possible. This is highlighted by a bug in BufferedIOReader that + # calls read() in a loop when its readall() method is invoked; + # this was fixed in Python 3.3, but we still need our workaround for 2.7. See + # https://github.com/gevent/gevent/issues/675) + def __read(self, n): + if self._read_event is None: + raise UnsupportedOperation('read') + while True: + try: + return _read(self._fileno, n) + except (IOError, OSError) as ex: + if ex.args[0] not in ignored_errors: + raise + self.hub.wait(self._read_event) + + def readall(self): + ret = BytesIO() + while True: + data = self.__read(DEFAULT_BUFFER_SIZE) + if not data: + break + ret.write(data) + return ret.getvalue() + + def readinto(self, b): + data = self.__read(len(b)) + n = len(data) + try: + b[:n] = data + except TypeError as err: + import array + if not isinstance(b, array.array): + raise err + b[:n] = array.array(b'b', data) + return n + + def write(self, b): + if self._write_event is None: + raise UnsupportedOperation('write') + while True: + try: + return _write(self._fileno, b) + except (IOError, OSError) as ex: + if ex.args[0] not in ignored_errors: + raise + self.hub.wait(self._write_event) + + def seek(self, offset, whence=0): + try: + return os.lseek(self._fileno, offset, whence) + except IOError: # pylint:disable=try-except-raise + raise + except OSError as ex: # pylint:disable=duplicate-except + # Python 2.x + # make sure on Python 2.x we raise an IOError + # as documented for RawIOBase. + # See https://github.com/gevent/gevent/issues/1323 + reraise(IOError, IOError(*ex.args), sys.exc_info()[2]) + + +class FlushingBufferedWriter(BufferedWriter): + + def write(self, b): + ret = BufferedWriter.write(self, b) + self.flush() + return ret + + +class FileObjectPosix(FileObjectBase): + """ + A file-like object that operates on non-blocking files but + provides a synchronous, cooperative interface. + + .. caution:: + This object is only effective wrapping files that can be used meaningfully + with :func:`select.select` such as sockets and pipes. + + In general, on most platforms, operations on regular files + (e.g., ``open('a_file.txt')``) are considered non-blocking + already, even though they can take some time to complete as + data is copied to the kernel and flushed to disk: this time + is relatively bounded compared to sockets or pipes, though. + A :func:`~os.read` or :func:`~os.write` call on such a file + will still effectively block for some small period of time. + Therefore, wrapping this class around a regular file is + unlikely to make IO gevent-friendly: reading or writing large + amounts of data could still block the event loop. + + If you'll be working with regular files and doing IO in large + chunks, you may consider using + :class:`~gevent.fileobject.FileObjectThread` or + :func:`~gevent.os.tp_read` and :func:`~gevent.os.tp_write` to bypass this + concern. + + .. note:: + Random read/write (e.g., ``mode='rwb'``) is not supported. + For that, use :class:`io.BufferedRWPair` around two instance of this + class. + + .. tip:: + Although this object provides a :meth:`fileno` method and so + can itself be passed to :func:`fcntl.fcntl`, setting the + :data:`os.O_NONBLOCK` flag will have no effect (reads will + still block the greenlet, although other greenlets can run). + However, removing that flag *will cause this object to no + longer be cooperative* (other greenlets will no longer run). + + You can use the internal ``fileio`` attribute of this object + (a :class:`io.RawIOBase`) to perform non-blocking byte reads. + Note, however, that once you begin directly using this + attribute, the results from using methods of *this* object + are undefined, especially in text mode. (See :issue:`222`.) + + .. versionchanged:: 1.1 + Now uses the :mod:`io` package internally. Under Python 2, previously + used the undocumented class :class:`socket._fileobject`. This provides + better file-like semantics (and portability to Python 3). + .. versionchanged:: 1.2a1 + Document the ``fileio`` attribute for non-blocking reads. + """ + + #: platform specific default for the *bufsize* parameter + default_bufsize = io.DEFAULT_BUFFER_SIZE + + def __init__(self, fobj, mode='rb', bufsize=-1, close=True): + """ + :param fobj: Either an integer fileno, or an object supporting the + usual :meth:`socket.fileno` method. The file *will* be + put in non-blocking mode using :func:`gevent.os.make_nonblocking`. + :keyword str mode: The manner of access to the file, one of "rb", "rU" or "wb" + (where the "b" or "U" can be omitted). + If "U" is part of the mode, universal newlines will be used. On Python 2, + if 't' is not in the mode, this will result in returning byte (native) strings; + putting 't' in the mode will return text strings. This may cause + :exc:`UnicodeDecodeError` to be raised. + :keyword int bufsize: If given, the size of the buffer to use. The default + value means to use a platform-specific default + Other values are interpreted as for the :mod:`io` package. + Buffering is ignored in text mode. + + .. versionchanged:: 1.3a1 + + On Python 2, enabling universal newlines no longer forces unicode + IO. + + .. versionchanged:: 1.2a1 + + A bufsize of 0 in write mode is no longer forced to be 1. + Instead, the underlying buffer is flushed after every write + operation to simulate a bufsize of 0. In gevent 1.0, a + bufsize of 0 was flushed when a newline was written, while + in gevent 1.1 it was flushed when more than one byte was + written. Note that this may have performance impacts. + """ + + if isinstance(fobj, int): + fileno = fobj + fobj = None + else: + fileno = fobj.fileno() + if not isinstance(fileno, int): + raise TypeError('fileno must be int: %r' % fileno) + + orig_mode = mode + mode = (mode or 'rb').replace('b', '') + if 'U' in mode: + self._translate = True + if bytes is str and 't' not in mode: + # We're going to be producing unicode objects, but + # universal newlines doesn't do that in the stdlib, + # so fix that to return str objects. The fix is two parts: + # first, set an encoding on the stream that can round-trip + # all bytes, and second, decode all bytes once they've been read. + self._translate_encoding = 'latin-1' + import functools + + def wrap_method(m): + if m.__name__.startswith("read"): + @functools.wraps(m) + def wrapped(*args, **kwargs): + result = m(*args, **kwargs) + assert isinstance(result, unicode) # pylint:disable=undefined-variable + return result.encode('latin-1') + return wrapped + return m + self._wrap_method = wrap_method + mode = mode.replace('U', '') + else: + self._translate = False + + mode = mode.replace('t', '') + + if len(mode) != 1 and mode not in 'rw': # pragma: no cover + # Python 3 builtin `open` raises a ValueError for invalid modes; + # Python 2 ignores it. In the past, we raised an AssertionError, if __debug__ was + # enabled (which it usually was). Match Python 3 because it makes more sense + # and because __debug__ may not be enabled. + # NOTE: This is preventing a mode like 'rwb' for binary random access; + # that code was never tested and was explicitly marked as "not used" + raise ValueError('mode can only be [rb, rU, wb], not %r' % (orig_mode,)) + + + self._orig_bufsize = bufsize + if bufsize < 0 or bufsize == 1: + bufsize = self.default_bufsize + elif bufsize == 0: + bufsize = 1 + + if mode == 'r': + IOFamily = BufferedReader + else: + assert mode == 'w' + IOFamily = BufferedWriter + if self._orig_bufsize == 0: + # We could also simply pass self.fileio as *io*, but this way + # we at least consistently expose a BufferedWriter in our *io* + # attribute. + IOFamily = FlushingBufferedWriter + + + self._fobj = fobj + # This attribute is documented as available for non-blocking reads. + self.fileio = GreenFileDescriptorIO(fileno, mode, closefd=close) + + buffered_fobj = IOFamily(self.fileio, bufsize) + + super(FileObjectPosix, self).__init__(buffered_fobj, close) + + def _do_close(self, fobj, closefd): + try: + fobj.close() + # self.fileio already knows whether or not to close the + # file descriptor + self.fileio.close() + finally: + self._fobj = None + self.fileio = None + + def __iter__(self): + return self._io diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_greenlet.cp37-win32.pyd b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_greenlet.cp37-win32.pyd new file mode 100644 index 0000000000000000000000000000000000000000..82bc89028913e1c33d323796bdad04a4e97ccb86 GIT binary patch literal 191488 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%0DrLC$B66r?{THMg1YOA#d}AI( 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 +#ifndef offsetof + #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) +#endif +#if !defined(WIN32) && !defined(MS_WINDOWS) + #ifndef __stdcall + #define __stdcall + #endif + #ifndef __cdecl + #define __cdecl + #endif + #ifndef __fastcall + #define __fastcall + #endif +#endif +#ifndef DL_IMPORT + #define DL_IMPORT(t) t +#endif +#ifndef DL_EXPORT + #define DL_EXPORT(t) t +#endif +#define __PYX_COMMA , +#ifndef HAVE_LONG_LONG + #if PY_VERSION_HEX >= 0x02070000 + #define HAVE_LONG_LONG + #endif +#endif +#ifndef PY_LONG_LONG + #define PY_LONG_LONG LONG_LONG +#endif +#ifndef Py_HUGE_VAL + #define Py_HUGE_VAL HUGE_VAL +#endif +#ifdef PYPY_VERSION + #define CYTHON_COMPILING_IN_PYPY 1 + #define CYTHON_COMPILING_IN_PYSTON 0 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #undef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 0 + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #if PY_VERSION_HEX < 0x03050000 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #elif !defined(CYTHON_USE_ASYNC_SLOTS) + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #undef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 0 + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #undef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 1 + #undef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 0 + #undef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 0 + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #undef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE 0 + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 +#elif defined(PYSTON_VERSION) + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_PYSTON 1 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #ifndef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 1 + #endif + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #ifndef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 1 + #endif + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #ifndef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 0 + #endif + #ifndef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 1 + #endif + #ifndef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 1 + #endif + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #undef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE 0 + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 +#else + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_PYSTON 0 + #define CYTHON_COMPILING_IN_CPYTHON 1 + #ifndef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 1 + #endif + #if PY_VERSION_HEX < 0x02070000 + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #elif !defined(CYTHON_USE_PYTYPE_LOOKUP) + #define CYTHON_USE_PYTYPE_LOOKUP 1 + #endif + #if PY_MAJOR_VERSION < 3 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #elif !defined(CYTHON_USE_ASYNC_SLOTS) + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #if PY_VERSION_HEX < 0x02070000 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #elif !defined(CYTHON_USE_PYLONG_INTERNALS) + #define CYTHON_USE_PYLONG_INTERNALS 1 + #endif + #ifndef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 1 + #endif + #ifndef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 1 + #endif + #if PY_VERSION_HEX < 0x030300F0 + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #elif !defined(CYTHON_USE_UNICODE_WRITER) + #define CYTHON_USE_UNICODE_WRITER 1 + #endif + #ifndef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 0 + #endif + #ifndef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 1 + #endif + #ifndef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 1 + #endif + #ifndef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 1 + #endif + #ifndef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 1 + #endif + #ifndef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000) + #endif + #ifndef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1) + #endif + #ifndef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1) + #endif + #ifndef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3) + #endif +#endif +#if !defined(CYTHON_FAST_PYCCALL) +#define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) +#endif +#if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #undef SHIFT + #undef BASE + #undef MASK + #ifdef SIZEOF_VOID_P + enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) }; + #endif +#endif +#ifndef __has_attribute + #define __has_attribute(x) 0 +#endif +#ifndef __has_cpp_attribute + #define __has_cpp_attribute(x) 0 +#endif +#ifndef CYTHON_RESTRICT + #if defined(__GNUC__) + #define CYTHON_RESTRICT __restrict__ + #elif defined(_MSC_VER) && _MSC_VER >= 1400 + #define CYTHON_RESTRICT __restrict + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_RESTRICT restrict + #else + #define CYTHON_RESTRICT + #endif +#endif +#ifndef CYTHON_UNUSED +# if defined(__GNUC__) +# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +#endif +#ifndef CYTHON_MAYBE_UNUSED_VAR +# if defined(__cplusplus) + template void CYTHON_MAYBE_UNUSED_VAR( const T& ) { } +# else +# define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x) +# endif +#endif +#ifndef CYTHON_NCP_UNUSED +# if CYTHON_COMPILING_IN_CPYTHON +# define CYTHON_NCP_UNUSED +# else +# define CYTHON_NCP_UNUSED CYTHON_UNUSED +# endif +#endif +#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) +#ifdef _MSC_VER + #ifndef _MSC_STDINT_H_ + #if _MSC_VER < 1300 + typedef unsigned char uint8_t; + typedef unsigned int uint32_t; + #else + typedef unsigned __int8 uint8_t; + typedef unsigned __int32 uint32_t; + #endif + #endif +#else + #include +#endif +#ifndef CYTHON_FALLTHROUGH + #if defined(__cplusplus) && __cplusplus >= 201103L + #if __has_cpp_attribute(fallthrough) + #define CYTHON_FALLTHROUGH [[fallthrough]] + #elif __has_cpp_attribute(clang::fallthrough) + #define CYTHON_FALLTHROUGH [[clang::fallthrough]] + #elif __has_cpp_attribute(gnu::fallthrough) + #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] + #endif + #endif + #ifndef CYTHON_FALLTHROUGH + #if __has_attribute(fallthrough) + #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) + #else + #define CYTHON_FALLTHROUGH + #endif + #endif + #if defined(__clang__ ) && defined(__apple_build_version__) + #if __apple_build_version__ < 7000000 + #undef CYTHON_FALLTHROUGH + #define CYTHON_FALLTHROUGH + #endif + #endif +#endif + +#ifndef CYTHON_INLINE + #if defined(__clang__) + #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) + #elif defined(__GNUC__) + #define CYTHON_INLINE __inline__ + #elif defined(_MSC_VER) + #define CYTHON_INLINE __inline + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_INLINE inline + #else + #define CYTHON_INLINE + #endif +#endif + +#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) + #define Py_OptimizeFlag 0 +#endif +#define __PYX_BUILD_PY_SSIZE_T "n" +#define CYTHON_FORMAT_SSIZE_T "z" +#if PY_MAJOR_VERSION < 3 + #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyClass_Type +#else + #define __Pyx_BUILTIN_MODULE_NAME "builtins" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyType_Type +#endif +#ifndef Py_TPFLAGS_CHECKTYPES + #define Py_TPFLAGS_CHECKTYPES 0 +#endif +#ifndef Py_TPFLAGS_HAVE_INDEX + #define Py_TPFLAGS_HAVE_INDEX 0 +#endif +#ifndef Py_TPFLAGS_HAVE_NEWBUFFER + #define Py_TPFLAGS_HAVE_NEWBUFFER 0 +#endif +#ifndef Py_TPFLAGS_HAVE_FINALIZE + #define Py_TPFLAGS_HAVE_FINALIZE 0 +#endif +#ifndef METH_STACKLESS + #define METH_STACKLESS 0 +#endif +#if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) + #ifndef METH_FASTCALL + #define METH_FASTCALL 0x80 + #endif + typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs); + typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args, + Py_ssize_t nargs, PyObject *kwnames); +#else + #define __Pyx_PyCFunctionFast _PyCFunctionFast + #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords +#endif +#if CYTHON_FAST_PYCCALL +#define __Pyx_PyFastCFunction_Check(func)\ + ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS))))) +#else +#define __Pyx_PyFastCFunction_Check(func) 0 +#endif +#if CYTHON_USE_DICT_VERSIONS +#define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) +#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ + (version_var) = __PYX_GET_DICT_VERSION(dict);\ + (cache_var) = (value); +#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ + static PY_UINT64_T __pyx_dict_version = 0;\ + static PyObject *__pyx_dict_cached_value = NULL;\ + if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ + (VAR) = __pyx_dict_cached_value;\ + } else {\ + (VAR) = __pyx_dict_cached_value = (LOOKUP);\ + __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ + }\ + } +#else +#define __PYX_GET_DICT_VERSION(dict) (0) +#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) +#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) + #define PyObject_Malloc(s) PyMem_Malloc(s) + #define PyObject_Free(p) PyMem_Free(p) + #define PyObject_Realloc(p) PyMem_Realloc(p) +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1 + #define PyMem_RawMalloc(n) PyMem_Malloc(n) + #define PyMem_RawRealloc(p, n) PyMem_Realloc(p, n) + #define PyMem_RawFree(p) PyMem_Free(p) +#endif +#if CYTHON_COMPILING_IN_PYSTON + #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co) + #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno) +#else + #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) + #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) +#endif +#if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000 + #define __Pyx_PyThreadState_Current PyThreadState_GET() +#elif PY_VERSION_HEX >= 0x03060000 + #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() +#elif PY_VERSION_HEX >= 0x03000000 + #define __Pyx_PyThreadState_Current PyThreadState_GET() +#else + #define __Pyx_PyThreadState_Current _PyThreadState_Current +#endif +#if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) +#include "pythread.h" +#define Py_tss_NEEDS_INIT 0 +typedef int Py_tss_t; +static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) { + *key = PyThread_create_key(); + return 0; // PyThread_create_key reports success always +} +static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) { + Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t)); + *key = Py_tss_NEEDS_INIT; + return key; +} +static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) { + PyObject_Free(key); +} +static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) { + return *key != Py_tss_NEEDS_INIT; +} +static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) { + PyThread_delete_key(*key); + *key = Py_tss_NEEDS_INIT; +} +static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) { + return PyThread_set_key_value(*key, value); +} +static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { + return PyThread_get_key_value(*key); +} +#endif // TSS (Thread Specific Storage) API +#if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized) +#define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) +#else +#define __Pyx_PyDict_NewPresized(n) PyDict_New() +#endif +#if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION + #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) +#else + #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS +#define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) +#else +#define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name) +#endif +#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) + #define CYTHON_PEP393_ENABLED 1 + #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ + 0 : _PyUnicode_Ready((PyObject *)(op))) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) + #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) + #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) + #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) + #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) + #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch) + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) +#else + #define CYTHON_PEP393_ENABLED 0 + #define PyUnicode_1BYTE_KIND 1 + #define PyUnicode_2BYTE_KIND 2 + #define PyUnicode_4BYTE_KIND 4 + #define __Pyx_PyUnicode_READY(op) (0) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) + #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111) + #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) + #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) + #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) + #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch) + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) +#endif +#if CYTHON_COMPILING_IN_PYPY + #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) +#else + #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ + PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains) + #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check) + #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format) + #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) +#endif +#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) +#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) +#else + #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) +#endif +#if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) + #define PyObject_ASCII(o) PyObject_Repr(o) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBaseString_Type PyUnicode_Type + #define PyStringObject PyUnicodeObject + #define PyString_Type PyUnicode_Type + #define PyString_Check PyUnicode_Check + #define PyString_CheckExact PyUnicode_CheckExact + #define PyObject_Unicode PyObject_Str +#endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) + #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) +#else + #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) + #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) +#endif +#ifndef PySet_CheckExact + #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) +#endif +#if CYTHON_ASSUME_SAFE_MACROS + #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) +#else + #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyIntObject PyLongObject + #define PyInt_Type PyLong_Type + #define PyInt_Check(op) PyLong_Check(op) + #define PyInt_CheckExact(op) PyLong_CheckExact(op) + #define PyInt_FromString PyLong_FromString + #define PyInt_FromUnicode PyLong_FromUnicode + #define PyInt_FromLong PyLong_FromLong + #define PyInt_FromSize_t PyLong_FromSize_t + #define PyInt_FromSsize_t PyLong_FromSsize_t + #define PyInt_AsLong PyLong_AsLong + #define PyInt_AS_LONG PyLong_AS_LONG + #define PyInt_AsSsize_t PyLong_AsSsize_t + #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask + #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask + #define PyNumber_Int PyNumber_Long +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBoolObject PyLongObject +#endif +#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY + #ifndef PyUnicode_InternFromString + #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) + #endif +#endif +#if PY_VERSION_HEX < 0x030200A4 + typedef long Py_hash_t; + #define __Pyx_PyInt_FromHash_t PyInt_FromLong + #define __Pyx_PyInt_AsHash_t PyInt_AsLong +#else + #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t + #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t +#endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : (Py_INCREF(func), func)) +#else + #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) +#endif +#if CYTHON_USE_ASYNC_SLOTS + #if PY_VERSION_HEX >= 0x030500B1 + #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods + #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) + #else + #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) + #endif +#else + #define __Pyx_PyType_AsAsync(obj) NULL +#endif +#ifndef __Pyx_PyAsyncMethodsStruct + typedef struct { + unaryfunc am_await; + unaryfunc am_aiter; + unaryfunc am_anext; + } __Pyx_PyAsyncMethodsStruct; +#endif + +#if defined(WIN32) || defined(MS_WINDOWS) + #define _USE_MATH_DEFINES +#endif +#include +#ifdef NAN +#define __PYX_NAN() ((float) NAN) +#else +static CYTHON_INLINE float __PYX_NAN() { + float value; + memset(&value, 0xFF, sizeof(value)); + return value; +} +#endif +#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) +#define __Pyx_truncl trunc +#else +#define __Pyx_truncl truncl +#endif + + +#define __PYX_ERR(f_index, lineno, Ln_error) \ +{ \ + __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \ +} + +#ifndef __PYX_EXTERN_C + #ifdef __cplusplus + #define __PYX_EXTERN_C extern "C" + #else + #define __PYX_EXTERN_C extern + #endif +#endif + +#define __PYX_HAVE__gevent____greenlet_primitives +#define __PYX_HAVE_API__gevent____greenlet_primitives +/* Early includes */ +#include "greenlet/greenlet.h" +#ifdef _OPENMP +#include +#endif /* _OPENMP */ + +#if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) +#define CYTHON_WITHOUT_ASSERTIONS +#endif + +typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; + const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; + +#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 +#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0 +#define __PYX_DEFAULT_STRING_ENCODING "" +#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString +#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#define __Pyx_uchar_cast(c) ((unsigned char)c) +#define __Pyx_long_cast(x) ((long)x) +#define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ + (sizeof(type) < sizeof(Py_ssize_t)) ||\ + (sizeof(type) > sizeof(Py_ssize_t) &&\ + likely(v < (type)PY_SSIZE_T_MAX ||\ + v == (type)PY_SSIZE_T_MAX) &&\ + (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ + v == (type)PY_SSIZE_T_MIN))) ||\ + (sizeof(type) == sizeof(Py_ssize_t) &&\ + (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ + v == (type)PY_SSIZE_T_MAX))) ) +static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) { + return (size_t) i < (size_t) limit; +} +#if defined (__cplusplus) && __cplusplus >= 201103L + #include + #define __Pyx_sst_abs(value) std::abs(value) +#elif SIZEOF_INT >= SIZEOF_SIZE_T + #define __Pyx_sst_abs(value) abs(value) +#elif SIZEOF_LONG >= SIZEOF_SIZE_T + #define __Pyx_sst_abs(value) labs(value) +#elif defined (_MSC_VER) + #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) +#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define __Pyx_sst_abs(value) llabs(value) +#elif defined (__GNUC__) + #define __Pyx_sst_abs(value) __builtin_llabs(value) +#else + #define __Pyx_sst_abs(value) ((value<0) ? -value : value) +#endif +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*); +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); +#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) +#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) +#define __Pyx_PyBytes_FromString PyBytes_FromString +#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); +#if PY_MAJOR_VERSION < 3 + #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#else + #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize +#endif +#define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) +#define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) +#define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) +#define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) +#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) +static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) { + const Py_UNICODE *u_end = u; + while (*u_end++) ; + return (size_t)(u_end - u - 1); +} +#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) +#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode +#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode +#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) +#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) +static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); +static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*); +static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); +#define __Pyx_PySequence_Tuple(obj)\ + (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); +#if CYTHON_ASSUME_SAFE_MACROS +#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) +#else +#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) +#endif +#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) +#if PY_MAJOR_VERSION >= 3 +#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) +#else +#define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) +#endif +#define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x)) +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII +static int __Pyx_sys_getdefaultencoding_not_ascii; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + PyObject* ascii_chars_u = NULL; + PyObject* ascii_chars_b = NULL; + const char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + if (strcmp(default_encoding_c, "ascii") == 0) { + __Pyx_sys_getdefaultencoding_not_ascii = 0; + } else { + char ascii_chars[128]; + int c; + for (c = 0; c < 128; c++) { + ascii_chars[c] = c; + } + __Pyx_sys_getdefaultencoding_not_ascii = 1; + ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); + if (!ascii_chars_u) goto bad; + ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); + if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { + PyErr_Format( + PyExc_ValueError, + "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", + default_encoding_c); + goto bad; + } + Py_DECREF(ascii_chars_u); + Py_DECREF(ascii_chars_b); + } + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + Py_XDECREF(ascii_chars_u); + Py_XDECREF(ascii_chars_b); + return -1; +} +#endif +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) +#else +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +static char* __PYX_DEFAULT_STRING_ENCODING; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1); + if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; + strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + return -1; +} +#endif +#endif + + +/* Test for GCC > 2.95 */ +#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) + #define likely(x) __builtin_expect(!!(x), 1) + #define unlikely(x) __builtin_expect(!!(x), 0) +#else /* !__GNUC__ or GCC < 2.95 */ + #define likely(x) (x) + #define unlikely(x) (x) +#endif /* __GNUC__ */ +static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } + +static PyObject *__pyx_m = NULL; +static PyObject *__pyx_d; +static PyObject *__pyx_b; +static PyObject *__pyx_cython_runtime = NULL; +static PyObject *__pyx_empty_tuple; +static PyObject *__pyx_empty_bytes; +static PyObject *__pyx_empty_unicode; +static int __pyx_lineno; +static int __pyx_clineno = 0; +static const char * __pyx_cfilenm= __FILE__; +static const char *__pyx_filename; + + +static const char *__pyx_f[] = { + "src\\gevent\\_greenlet_primitives.py", + "src\\gevent\\__greenlet_primitives.pxd", +}; + +/*--- Type declarations ---*/ +struct __pyx_obj_6gevent_21__greenlet_primitives_TrackedRawGreenlet; +struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop; + +/* "gevent/__greenlet_primitives.pxd":37 + * return PyGreenlet_Switch(self, NULL, NULL) + * + * cdef class TrackedRawGreenlet(greenlet): # <<<<<<<<<<<<<< + * pass + * + */ +struct __pyx_obj_6gevent_21__greenlet_primitives_TrackedRawGreenlet { + PyGreenlet __pyx_base; +}; + + +/* "gevent/__greenlet_primitives.pxd":40 + * pass + * + * cdef class SwitchOutGreenletWithLoop(TrackedRawGreenlet): # <<<<<<<<<<<<<< + * cdef public loop + * + */ +struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop { + struct __pyx_obj_6gevent_21__greenlet_primitives_TrackedRawGreenlet __pyx_base; + struct __pyx_vtabstruct_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *__pyx_vtab; + PyObject *loop; +}; + + + +/* "src/gevent/_greenlet_primitives.py":53 + * + * + * class SwitchOutGreenletWithLoop(TrackedRawGreenlet): # <<<<<<<<<<<<<< + * # Subclasses must define: + * # - self.loop + */ + +struct __pyx_vtabstruct_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop { + PyObject *(*__pyx_switch)(struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *, int __pyx_skip_dispatch); + PyObject *(*switch_out)(struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *, int __pyx_skip_dispatch); +}; +static struct __pyx_vtabstruct_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *__pyx_vtabptr_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop; + +/* --- Runtime support code (head) --- */ +/* Refnanny.proto */ +#ifndef CYTHON_REFNANNY + #define CYTHON_REFNANNY 0 +#endif +#if CYTHON_REFNANNY + typedef struct { + void (*INCREF)(void*, PyObject*, int); + void (*DECREF)(void*, PyObject*, int); + void (*GOTREF)(void*, PyObject*, int); + void (*GIVEREF)(void*, PyObject*, int); + void* (*SetupContext)(const char*, int, const char*); + void (*FinishContext)(void**); + } __Pyx_RefNannyAPIStruct; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); + #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; +#ifdef WITH_THREAD + #define __Pyx_RefNannySetupContext(name, acquire_gil)\ + if (acquire_gil) {\ + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ + PyGILState_Release(__pyx_gilstate_save);\ + } else {\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ + } +#else + #define __Pyx_RefNannySetupContext(name, acquire_gil)\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) +#endif + #define __Pyx_RefNannyFinishContext()\ + __Pyx_RefNanny->FinishContext(&__pyx_refnanny) + #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0) + #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) + #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) + #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) +#else + #define __Pyx_RefNannyDeclarations + #define __Pyx_RefNannySetupContext(name, acquire_gil) + #define __Pyx_RefNannyFinishContext() + #define __Pyx_INCREF(r) Py_INCREF(r) + #define __Pyx_DECREF(r) Py_DECREF(r) + #define __Pyx_GOTREF(r) + #define __Pyx_GIVEREF(r) + #define __Pyx_XINCREF(r) Py_XINCREF(r) + #define __Pyx_XDECREF(r) Py_XDECREF(r) + #define __Pyx_XGOTREF(r) + #define __Pyx_XGIVEREF(r) +#endif +#define __Pyx_XDECREF_SET(r, v) do {\ + PyObject *tmp = (PyObject *) r;\ + r = v; __Pyx_XDECREF(tmp);\ + } while (0) +#define __Pyx_DECREF_SET(r, v) do {\ + PyObject *tmp = (PyObject *) r;\ + r = v; __Pyx_DECREF(tmp);\ + } while (0) +#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) +#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) + +/* PyObjectGetAttrStr.proto */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); +#else +#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) +#endif + +/* GetBuiltinName.proto */ +static PyObject *__Pyx_GetBuiltinName(PyObject *name); + +/* RaiseArgTupleInvalid.proto */ +static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, + Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); + +/* RaiseDoubleKeywords.proto */ +static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); + +/* ParseKeywords.proto */ +static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\ + PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\ + const char* function_name); + +/* PyFunctionFastCall.proto */ +#if CYTHON_FAST_PYCALL +#define __Pyx_PyFunction_FastCall(func, args, nargs)\ + __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) +#if 1 || PY_VERSION_HEX < 0x030600B1 +static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs); +#else +#define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs) +#endif +#define __Pyx_BUILD_ASSERT_EXPR(cond)\ + (sizeof(char [1 - 2*!(cond)]) - 1) +#ifndef Py_MEMBER_SIZE +#define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member) +#endif + static size_t __pyx_pyframe_localsplus_offset = 0; + #include "frameobject.h" + #define __Pxy_PyFrame_Initialize_Offsets()\ + ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\ + (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus))) + #define __Pyx_PyFrame_GetLocalsplus(frame)\ + (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset)) +#endif + +/* PyCFunctionFastCall.proto */ +#if CYTHON_FAST_PYCCALL +static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs); +#else +#define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL) +#endif + +/* PyObjectCall.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); +#else +#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) +#endif + +/* PyObjectCall2Args.proto */ +static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2); + +/* PyObjectCallMethO.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); +#endif + +/* PyObjectCallOneArg.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); + +/* PyObjectSetAttrStr.proto */ +#if CYTHON_USE_TYPE_SLOTS +#define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o, n, NULL) +static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value); +#else +#define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n) +#define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v) +#endif + +/* GetTopmostException.proto */ +#if CYTHON_USE_EXC_INFO_STACK +static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate); +#endif + +/* PyThreadStateGet.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; +#define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; +#define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type +#else +#define __Pyx_PyThreadState_declare +#define __Pyx_PyThreadState_assign +#define __Pyx_PyErr_Occurred() PyErr_Occurred() +#endif + +/* SaveResetException.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); +#else +#define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb) +#define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb) +#endif + +/* PyErrExceptionMatches.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) +static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); +#else +#define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) +#endif + +/* GetException.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb) +static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#else +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); +#endif + +/* PyObjectCallNoArg.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); +#else +#define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL) +#endif + +/* PyErrFetchRestore.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) +#define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) +#define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) +#define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) +#define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); +static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) +#else +#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) +#endif +#else +#define __Pyx_PyErr_Clear() PyErr_Clear() +#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) +#define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) +#define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb) +#define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) +#endif + +/* GetAttr.proto */ +static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *); + +/* GetAttr3.proto */ +static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *); + +/* RaiseException.proto */ +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); + +/* ListCompAppend.proto */ +#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS +static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) { + PyListObject* L = (PyListObject*) list; + Py_ssize_t len = Py_SIZE(list); + if (likely(L->allocated > len)) { + Py_INCREF(x); + PyList_SET_ITEM(list, len, x); + Py_SIZE(list) = len+1; + return 0; + } + return PyList_Append(list, x); +} +#else +#define __Pyx_ListComp_Append(L,x) PyList_Append(L,x) +#endif + +/* CallNextTpDealloc.proto */ +static void __Pyx_call_next_tp_dealloc(PyObject* obj, destructor current_tp_dealloc); + +/* CallNextTpTraverse.proto */ +static int __Pyx_call_next_tp_traverse(PyObject* obj, visitproc v, void *a, traverseproc current_tp_traverse); + +/* CallNextTpClear.proto */ +static void __Pyx_call_next_tp_clear(PyObject* obj, inquiry current_tp_dealloc); + +/* TypeImport.proto */ +#ifndef __PYX_HAVE_RT_ImportType_proto +#define __PYX_HAVE_RT_ImportType_proto +enum __Pyx_ImportType_CheckSize { + __Pyx_ImportType_CheckSize_Error = 0, + __Pyx_ImportType_CheckSize_Warn = 1, + __Pyx_ImportType_CheckSize_Ignore = 2 +}; +static PyTypeObject *__Pyx_ImportType(PyObject* module, const char *module_name, const char *class_name, size_t size, enum __Pyx_ImportType_CheckSize check_size); +#endif + +/* PyObject_GenericGetAttrNoDict.proto */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name); +#else +#define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr +#endif + +/* PyObject_GenericGetAttr.proto */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name); +#else +#define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr +#endif + +/* SetVTable.proto */ +static int __Pyx_SetVtable(PyObject *dict, void *vtable); + +/* Import.proto */ +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); + +/* ImportFrom.proto */ +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); + +/* FetchCommonType.proto */ +static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); + +/* CythonFunction.proto */ +#define __Pyx_CyFunction_USED 1 +#define __Pyx_CYFUNCTION_STATICMETHOD 0x01 +#define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 +#define __Pyx_CYFUNCTION_CCLASS 0x04 +#define __Pyx_CyFunction_GetClosure(f)\ + (((__pyx_CyFunctionObject *) (f))->func_closure) +#define __Pyx_CyFunction_GetClassObj(f)\ + (((__pyx_CyFunctionObject *) (f))->func_classobj) +#define __Pyx_CyFunction_Defaults(type, f)\ + ((type *)(((__pyx_CyFunctionObject *) (f))->defaults)) +#define __Pyx_CyFunction_SetDefaultsGetter(f, g)\ + ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g) +typedef struct { + PyCFunctionObject func; +#if PY_VERSION_HEX < 0x030500A0 + PyObject *func_weakreflist; +#endif + PyObject *func_dict; + PyObject *func_name; + PyObject *func_qualname; + PyObject *func_doc; + PyObject *func_globals; + PyObject *func_code; + PyObject *func_closure; + PyObject *func_classobj; + void *defaults; + int defaults_pyobjects; + int flags; + PyObject *defaults_tuple; + PyObject *defaults_kwdict; + PyObject *(*defaults_getter)(PyObject *); + PyObject *func_annotations; +} __pyx_CyFunctionObject; +static PyTypeObject *__pyx_CyFunctionType = 0; +#define __Pyx_CyFunction_Check(obj) (__Pyx_TypeCheck(obj, __pyx_CyFunctionType)) +#define __Pyx_CyFunction_NewEx(ml, flags, qualname, self, module, globals, code)\ + __Pyx_CyFunction_New(__pyx_CyFunctionType, ml, flags, qualname, self, module, globals, code) +static PyObject *__Pyx_CyFunction_New(PyTypeObject *, PyMethodDef *ml, + int flags, PyObject* qualname, + PyObject *self, + PyObject *module, PyObject *globals, + PyObject* code); +static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, + size_t size, + int pyobjects); +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, + PyObject *tuple); +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, + PyObject *dict); +static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m, + PyObject *dict); +static int __pyx_CyFunction_init(void); + +/* GetModuleGlobalName.proto */ +#if CYTHON_USE_DICT_VERSIONS +#define __Pyx_GetModuleGlobalName(var, name) {\ + static PY_UINT64_T __pyx_dict_version = 0;\ + static PyObject *__pyx_dict_cached_value = NULL;\ + (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\ + (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\ + __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ +} +#define __Pyx_GetModuleGlobalNameUncached(var, name) {\ + PY_UINT64_T __pyx_dict_version;\ + PyObject *__pyx_dict_cached_value;\ + (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ +} +static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value); +#else +#define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name) +#define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name) +static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name); +#endif + +/* Globals.proto */ +static PyObject* __Pyx_Globals(void); + +/* CLineInTraceback.proto */ +#ifdef CYTHON_CLINE_IN_TRACEBACK +#define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) +#else +static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line); +#endif + +/* CodeObjectCache.proto */ +typedef struct { + PyCodeObject* code_object; + int code_line; +} __Pyx_CodeObjectCacheEntry; +struct __Pyx_CodeObjectCache { + int count; + int max_count; + __Pyx_CodeObjectCacheEntry* entries; +}; +static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); +static PyCodeObject *__pyx_find_code_object(int code_line); +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); + +/* AddTraceback.proto */ +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename); + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); + +/* CIntFromPy.proto */ +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); + +/* CIntFromPy.proto */ +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); + +/* FastTypeChecks.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) +static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b); +static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type); +static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2); +#else +#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) +#define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) +#define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) +#endif +#define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) + +/* CheckBinaryVersion.proto */ +static int __Pyx_check_binary_version(void); + +/* VoidPtrExport.proto */ +static int __Pyx_ExportVoidPtr(PyObject *name, void *p, const char *sig); + +/* FunctionExport.proto */ +static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig); + +/* InitStrings.proto */ +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); + +static PyObject *__pyx_f_6gevent_21__greenlet_primitives_25SwitchOutGreenletWithLoop_switch(struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/ +static PyObject *__pyx_f_6gevent_21__greenlet_primitives_25SwitchOutGreenletWithLoop_switch_out(CYTHON_UNUSED struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/ + +/* Module declarations from 'cython' */ + +/* Module declarations from 'greenlet' */ + +/* Module declarations from 'gevent.__greenlet_primitives' */ +static PyTypeObject *__pyx_ptype_6gevent_21__greenlet_primitives_greenlet = 0; +static PyTypeObject *__pyx_ptype_6gevent_21__greenlet_primitives_TrackedRawGreenlet = 0; +static PyTypeObject *__pyx_ptype_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop = 0; +static PyObject *__pyx_v_6gevent_21__greenlet_primitives_get_objects = 0; +static PyObject *__pyx_v_6gevent_21__greenlet_primitives_wref = 0; +static PyObject *__pyx_v_6gevent_21__greenlet_primitives_BlockingSwitchOutError = 0; +static int __pyx_v_6gevent_21__greenlet_primitives__greenlet_imported; +static CYTHON_INLINE PyGreenlet *__pyx_f_6gevent_21__greenlet_primitives_getcurrent(void); /*proto*/ +static CYTHON_INLINE void __pyx_f_6gevent_21__greenlet_primitives_greenlet_init(void); /*proto*/ +static CYTHON_INLINE PyObject *__pyx_f_6gevent_21__greenlet_primitives__greenlet_switch(PyGreenlet *); /*proto*/ +static PyObject *__pyx_f_6gevent_21__greenlet_primitives_get_reachable_greenlets(int __pyx_skip_dispatch); /*proto*/ +#define __Pyx_MODULE_NAME "gevent.__greenlet_primitives" +extern int __pyx_module_is_main_gevent____greenlet_primitives; +int __pyx_module_is_main_gevent____greenlet_primitives = 0; + +/* Implementation of 'gevent.__greenlet_primitives' */ +static PyObject *__pyx_builtin___import__; +static PyObject *__pyx_builtin_AttributeError; +static const char __pyx_k_gc[] = "gc"; +static const char __pyx_k_all[] = "__all__"; +static const char __pyx_k_ref[] = "ref"; +static const char __pyx_k_init[] = "__init__"; +static const char __pyx_k_main[] = "__main__"; +static const char __pyx_k_name[] = "__name__"; +static const char __pyx_k_self[] = "self"; +static const char __pyx_k_test[] = "__test__"; +static const char __pyx_k_wref[] = "wref"; +static const char __pyx_k_import[] = "__import__"; +static const char __pyx_k_init_2[] = "_init"; +static const char __pyx_k_lambda[] = ""; +static const char __pyx_k_parent[] = "parent"; +static const char __pyx_k_switch[] = "switch"; +static const char __pyx_k_weakref[] = "weakref"; +static const char __pyx_k_function[] = "function"; +static const char __pyx_k_greenlet[] = "greenlet"; +static const char __pyx_k_pyx_capi[] = "__pyx_capi__"; +static const char __pyx_k_getcurrent[] = "getcurrent"; +static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__"; +static const char __pyx_k_switch_out[] = "switch_out"; +static const char __pyx_k_get_objects[] = "get_objects"; +static const char __pyx_k_gevent__util[] = "gevent._util"; +static const char __pyx_k_greenlet_init[] = "greenlet_init"; +static const char __pyx_k_AttributeError[] = "AttributeError"; +static const char __pyx_k_import_c_accel[] = "import_c_accel"; +static const char __pyx_k_greenlet_switch[] = "_greenlet_switch"; +static const char __pyx_k_gevent_exceptions[] = "gevent.exceptions"; +static const char __pyx_k_greenlet_imported[] = "_greenlet_imported"; +static const char __pyx_k_spawn_tree_locals[] = "spawn_tree_locals"; +static const char __pyx_k_spawning_greenlet[] = "spawning_greenlet"; +static const char __pyx_k_TrackedRawGreenlet[] = "TrackedRawGreenlet"; +static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; +static const char __pyx_k_BlockingSwitchOutError[] = "BlockingSwitchOutError"; +static const char __pyx_k_get_reachable_greenlets[] = "get_reachable_greenlets"; +static const char __pyx_k_greenlet_tree_is_ignored[] = "greenlet_tree_is_ignored"; +static const char __pyx_k_SwitchOutGreenletWithLoop[] = "SwitchOutGreenletWithLoop"; +static const char __pyx_k_gevent___greenlet_primitives[] = "gevent.__greenlet_primitives"; +static const char __pyx_k_A_collection_of_primitives_used[] = "\nA collection of primitives used by the hub, and suitable for\ncompilation with Cython because of their frequency of use.\n\n"; +static const char __pyx_k_src_gevent__greenlet_primitives[] = "src\\gevent\\_greenlet_primitives.py"; +static const char __pyx_k_Impossible_to_call_blocking_func[] = "Impossible to call blocking function in the event loop callback"; +static const char __pyx_k_SwitchOutGreenletWithLoop_switch[] = "SwitchOutGreenletWithLoop.switch"; +static const char __pyx_k_SwitchOutGreenletWithLoop_switch_2[] = "SwitchOutGreenletWithLoop.switch_out"; +static PyObject *__pyx_n_s_AttributeError; +static PyObject *__pyx_n_s_BlockingSwitchOutError; +static PyObject *__pyx_kp_s_Impossible_to_call_blocking_func; +static PyObject *__pyx_n_s_SwitchOutGreenletWithLoop; +static PyObject *__pyx_n_s_SwitchOutGreenletWithLoop_switch; +static PyObject *__pyx_n_s_SwitchOutGreenletWithLoop_switch_2; +static PyObject *__pyx_n_s_TrackedRawGreenlet; +static PyObject *__pyx_n_s_all; +static PyObject *__pyx_n_s_cline_in_traceback; +static PyObject *__pyx_n_s_function; +static PyObject *__pyx_n_s_gc; +static PyObject *__pyx_n_s_get_objects; +static PyObject *__pyx_n_s_get_reachable_greenlets; +static PyObject *__pyx_n_s_getcurrent; +static PyObject *__pyx_n_s_gevent___greenlet_primitives; +static PyObject *__pyx_n_s_gevent__util; +static PyObject *__pyx_n_s_gevent_exceptions; +static PyObject *__pyx_n_s_greenlet; +static PyObject *__pyx_n_s_greenlet_imported; +static PyObject *__pyx_n_s_greenlet_init; +static PyObject *__pyx_n_s_greenlet_switch; +static PyObject *__pyx_n_s_greenlet_tree_is_ignored; +static PyObject *__pyx_n_s_import; +static PyObject *__pyx_n_s_import_c_accel; +static PyObject *__pyx_n_s_init; +static PyObject *__pyx_n_s_init_2; +static PyObject *__pyx_n_s_lambda; +static PyObject *__pyx_n_s_main; +static PyObject *__pyx_n_s_name; +static PyObject *__pyx_n_s_parent; +static PyObject *__pyx_n_s_pyx_capi; +static PyObject *__pyx_n_s_pyx_vtable; +static PyObject *__pyx_n_s_ref; +static PyObject *__pyx_n_s_self; +static PyObject *__pyx_n_s_spawn_tree_locals; +static PyObject *__pyx_n_s_spawning_greenlet; +static PyObject *__pyx_kp_s_src_gevent__greenlet_primitives; +static PyObject *__pyx_n_s_switch; +static PyObject *__pyx_n_s_switch_out; +static PyObject *__pyx_n_s_test; +static PyObject *__pyx_n_s_weakref; +static PyObject *__pyx_n_s_wref; +static PyObject *__pyx_lambda_funcdef_6gevent_21__greenlet_primitives_lambda(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static int __pyx_pf_6gevent_21__greenlet_primitives_18TrackedRawGreenlet___init__(struct __pyx_obj_6gevent_21__greenlet_primitives_TrackedRawGreenlet *__pyx_v_self, PyObject *__pyx_v_function, PyObject *__pyx_v_parent); /* proto */ +static PyObject *__pyx_pf_6gevent_21__greenlet_primitives_25SwitchOutGreenletWithLoop_switch(struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_21__greenlet_primitives_25SwitchOutGreenletWithLoop_2switch_out(struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_21__greenlet_primitives_25SwitchOutGreenletWithLoop_4loop___get__(struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_21__greenlet_primitives_25SwitchOutGreenletWithLoop_4loop_2__set__(struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6gevent_21__greenlet_primitives_25SwitchOutGreenletWithLoop_4loop_4__del__(struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_21__greenlet_primitives_get_reachable_greenlets(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_6gevent_21__greenlet_primitives_2_init(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_tp_new_6gevent_21__greenlet_primitives_TrackedRawGreenlet(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tuple_; +static PyObject *__pyx_tuple__2; +static PyObject *__pyx_tuple__4; +static PyObject *__pyx_codeobj__3; +static PyObject *__pyx_codeobj__5; +static PyObject *__pyx_codeobj__6; +static PyObject *__pyx_codeobj__7; +/* Late includes */ + +/* "src/gevent/_greenlet_primitives.py":26 + * # error. + * locals()['getcurrent'] = __import__('greenlet').getcurrent + * locals()['greenlet_init'] = lambda: None # <<<<<<<<<<<<<< + * locals()['_greenlet_switch'] = greenlet.switch + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_21__greenlet_primitives_4lambda(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyMethodDef __pyx_mdef_6gevent_21__greenlet_primitives_4lambda = {"lambda", (PyCFunction)__pyx_pw_6gevent_21__greenlet_primitives_4lambda, METH_NOARGS, 0}; +static PyObject *__pyx_pw_6gevent_21__greenlet_primitives_4lambda(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("lambda (wrapper)", 0); + __pyx_r = __pyx_lambda_funcdef_6gevent_21__greenlet_primitives_lambda(__pyx_self); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_lambda_funcdef_6gevent_21__greenlet_primitives_lambda(CYTHON_UNUSED PyObject *__pyx_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("lambda", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_greenlet_primitives.py":36 + * class TrackedRawGreenlet(greenlet): + * + * def __init__(self, function, parent): # <<<<<<<<<<<<<< + * greenlet.__init__(self, function, parent) + * # See greenlet.py's Greenlet class. We capture the cheap + */ + +/* Python wrapper */ +static int __pyx_pw_6gevent_21__greenlet_primitives_18TrackedRawGreenlet_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6gevent_21__greenlet_primitives_18TrackedRawGreenlet_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_function = 0; + PyObject *__pyx_v_parent = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_function,&__pyx_n_s_parent,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_function)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_parent)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(0, 36, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 36, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_function = values[0]; + __pyx_v_parent = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 36, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.__greenlet_primitives.TrackedRawGreenlet.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_21__greenlet_primitives_18TrackedRawGreenlet___init__(((struct __pyx_obj_6gevent_21__greenlet_primitives_TrackedRawGreenlet *)__pyx_v_self), __pyx_v_function, __pyx_v_parent); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_21__greenlet_primitives_18TrackedRawGreenlet___init__(struct __pyx_obj_6gevent_21__greenlet_primitives_TrackedRawGreenlet *__pyx_v_self, PyObject *__pyx_v_function, PyObject *__pyx_v_parent) { + PyGreenlet *__pyx_v_current = NULL; + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + int __pyx_t_9; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "src/gevent/_greenlet_primitives.py":37 + * + * def __init__(self, function, parent): + * greenlet.__init__(self, function, parent) # <<<<<<<<<<<<<< + * # See greenlet.py's Greenlet class. We capture the cheap + * # parts to maintain the tree structure, but we do not capture + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_6gevent_21__greenlet_primitives_greenlet), __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 37, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + __pyx_t_4 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_4 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[4] = {__pyx_t_3, ((PyObject *)__pyx_v_self), __pyx_v_function, __pyx_v_parent}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 37, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[4] = {__pyx_t_3, ((PyObject *)__pyx_v_self), __pyx_v_function, __pyx_v_parent}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 37, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else + #endif + { + __pyx_t_5 = PyTuple_New(3+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 37, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (__pyx_t_3) { + __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL; + } + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, ((PyObject *)__pyx_v_self)); + __Pyx_INCREF(__pyx_v_function); + __Pyx_GIVEREF(__pyx_v_function); + PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_function); + __Pyx_INCREF(__pyx_v_parent); + __Pyx_GIVEREF(__pyx_v_parent); + PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_4, __pyx_v_parent); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 37, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_greenlet_primitives.py":42 + * # the stack because that's too expensive for 'spawn_raw'. + * + * current = getcurrent() # pylint:disable=undefined-variable # <<<<<<<<<<<<<< + * self.spawning_greenlet = wref(current) + * # See Greenlet for how trees are maintained. + */ + __pyx_t_1 = ((PyObject *)__pyx_f_6gevent_21__greenlet_primitives_getcurrent()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 42, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_current = ((PyGreenlet *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "src/gevent/_greenlet_primitives.py":43 + * + * current = getcurrent() # pylint:disable=undefined-variable + * self.spawning_greenlet = wref(current) # <<<<<<<<<<<<<< + * # See Greenlet for how trees are maintained. + * try: + */ + __Pyx_INCREF(__pyx_v_6gevent_21__greenlet_primitives_wref); + __pyx_t_2 = __pyx_v_6gevent_21__greenlet_primitives_wref; __pyx_t_5 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, ((PyObject *)__pyx_v_current)) : __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_v_current)); + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 43, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_spawning_greenlet, __pyx_t_1) < 0) __PYX_ERR(0, 43, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_greenlet_primitives.py":45 + * self.spawning_greenlet = wref(current) + * # See Greenlet for how trees are maintained. + * try: # <<<<<<<<<<<<<< + * self.spawn_tree_locals = current.spawn_tree_locals + * except AttributeError: + */ + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); + __Pyx_XGOTREF(__pyx_t_6); + __Pyx_XGOTREF(__pyx_t_7); + __Pyx_XGOTREF(__pyx_t_8); + /*try:*/ { + + /* "src/gevent/_greenlet_primitives.py":46 + * # See Greenlet for how trees are maintained. + * try: + * self.spawn_tree_locals = current.spawn_tree_locals # <<<<<<<<<<<<<< + * except AttributeError: + * self.spawn_tree_locals = {} + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_current), __pyx_n_s_spawn_tree_locals); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 46, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_1); + if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_spawn_tree_locals, __pyx_t_1) < 0) __PYX_ERR(0, 46, __pyx_L3_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_greenlet_primitives.py":45 + * self.spawning_greenlet = wref(current) + * # See Greenlet for how trees are maintained. + * try: # <<<<<<<<<<<<<< + * self.spawn_tree_locals = current.spawn_tree_locals + * except AttributeError: + */ + } + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + goto __pyx_L8_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_greenlet_primitives.py":47 + * try: + * self.spawn_tree_locals = current.spawn_tree_locals + * except AttributeError: # <<<<<<<<<<<<<< + * self.spawn_tree_locals = {} + * if current.parent: + */ + __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_AttributeError); + if (__pyx_t_4) { + __Pyx_AddTraceback("gevent.__greenlet_primitives.TrackedRawGreenlet.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_2, &__pyx_t_5) < 0) __PYX_ERR(0, 47, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_t_5); + + /* "src/gevent/_greenlet_primitives.py":48 + * self.spawn_tree_locals = current.spawn_tree_locals + * except AttributeError: + * self.spawn_tree_locals = {} # <<<<<<<<<<<<<< + * if current.parent: + * current.spawn_tree_locals = self.spawn_tree_locals + */ + __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 48, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_3); + if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_spawn_tree_locals, __pyx_t_3) < 0) __PYX_ERR(0, 48, __pyx_L5_except_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "src/gevent/_greenlet_primitives.py":49 + * except AttributeError: + * self.spawn_tree_locals = {} + * if current.parent: # <<<<<<<<<<<<<< + * current.spawn_tree_locals = self.spawn_tree_locals + * + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_current), __pyx_n_s_parent); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 49, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 49, __pyx_L5_except_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_9) { + + /* "src/gevent/_greenlet_primitives.py":50 + * self.spawn_tree_locals = {} + * if current.parent: + * current.spawn_tree_locals = self.spawn_tree_locals # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_spawn_tree_locals); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 50, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_3); + if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_current), __pyx_n_s_spawn_tree_locals, __pyx_t_3) < 0) __PYX_ERR(0, 50, __pyx_L5_except_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "src/gevent/_greenlet_primitives.py":49 + * except AttributeError: + * self.spawn_tree_locals = {} + * if current.parent: # <<<<<<<<<<<<<< + * current.spawn_tree_locals = self.spawn_tree_locals + * + */ + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + + /* "src/gevent/_greenlet_primitives.py":45 + * self.spawning_greenlet = wref(current) + * # See Greenlet for how trees are maintained. + * try: # <<<<<<<<<<<<<< + * self.spawn_tree_locals = current.spawn_tree_locals + * except AttributeError: + */ + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); + goto __pyx_L1_error; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); + __pyx_L8_try_end:; + } + + /* "src/gevent/_greenlet_primitives.py":36 + * class TrackedRawGreenlet(greenlet): + * + * def __init__(self, function, parent): # <<<<<<<<<<<<<< + * greenlet.__init__(self, function, parent) + * # See greenlet.py's Greenlet class. We capture the cheap + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("gevent.__greenlet_primitives.TrackedRawGreenlet.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_current); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_greenlet_primitives.py":60 + * # circular dependencies with the hub. + * + * def switch(self): # <<<<<<<<<<<<<< + * switch_out = getattr(getcurrent(), 'switch_out', None) # pylint:disable=undefined-variable + * if switch_out is not None: + */ + +static PyObject *__pyx_pw_6gevent_21__greenlet_primitives_25SwitchOutGreenletWithLoop_1switch(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_f_6gevent_21__greenlet_primitives_25SwitchOutGreenletWithLoop_switch(struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *__pyx_v_self, int __pyx_skip_dispatch) { + PyObject *__pyx_v_switch_out = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + int __pyx_t_6; + __Pyx_RefNannySetupContext("switch", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0; + if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self)))))); + else { + PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + #endif + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_switch); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 60, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_21__greenlet_primitives_25SwitchOutGreenletWithLoop_1switch)) { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 60, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0; + if (unlikely(type_dict_guard != tp_dict_version)) { + tp_dict_version = obj_dict_version = 0; + } + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + } + #endif + } + + /* "src/gevent/_greenlet_primitives.py":61 + * + * def switch(self): + * switch_out = getattr(getcurrent(), 'switch_out', None) # pylint:disable=undefined-variable # <<<<<<<<<<<<<< + * if switch_out is not None: + * switch_out() + */ + __pyx_t_1 = ((PyObject *)__pyx_f_6gevent_21__greenlet_primitives_getcurrent()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 61, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_GetAttr3(__pyx_t_1, __pyx_n_s_switch_out, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 61, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_switch_out = __pyx_t_2; + __pyx_t_2 = 0; + + /* "src/gevent/_greenlet_primitives.py":62 + * def switch(self): + * switch_out = getattr(getcurrent(), 'switch_out', None) # pylint:disable=undefined-variable + * if switch_out is not None: # <<<<<<<<<<<<<< + * switch_out() + * return _greenlet_switch(self) # pylint:disable=undefined-variable + */ + __pyx_t_5 = (__pyx_v_switch_out != Py_None); + __pyx_t_6 = (__pyx_t_5 != 0); + if (__pyx_t_6) { + + /* "src/gevent/_greenlet_primitives.py":63 + * switch_out = getattr(getcurrent(), 'switch_out', None) # pylint:disable=undefined-variable + * if switch_out is not None: + * switch_out() # <<<<<<<<<<<<<< + * return _greenlet_switch(self) # pylint:disable=undefined-variable + * + */ + __Pyx_INCREF(__pyx_v_switch_out); + __pyx_t_1 = __pyx_v_switch_out; __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_1, function); + } + } + __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 63, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/_greenlet_primitives.py":62 + * def switch(self): + * switch_out = getattr(getcurrent(), 'switch_out', None) # pylint:disable=undefined-variable + * if switch_out is not None: # <<<<<<<<<<<<<< + * switch_out() + * return _greenlet_switch(self) # pylint:disable=undefined-variable + */ + } + + /* "src/gevent/_greenlet_primitives.py":64 + * if switch_out is not None: + * switch_out() + * return _greenlet_switch(self) # pylint:disable=undefined-variable # <<<<<<<<<<<<<< + * + * def switch_out(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __pyx_f_6gevent_21__greenlet_primitives__greenlet_switch(((PyGreenlet *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 64, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "src/gevent/_greenlet_primitives.py":60 + * # circular dependencies with the hub. + * + * def switch(self): # <<<<<<<<<<<<<< + * switch_out = getattr(getcurrent(), 'switch_out', None) # pylint:disable=undefined-variable + * if switch_out is not None: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("gevent.__greenlet_primitives.SwitchOutGreenletWithLoop.switch", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_switch_out); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_21__greenlet_primitives_25SwitchOutGreenletWithLoop_1switch(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6gevent_21__greenlet_primitives_25SwitchOutGreenletWithLoop_switch[] = "SwitchOutGreenletWithLoop.switch(self)"; +static PyMethodDef __pyx_mdef_6gevent_21__greenlet_primitives_25SwitchOutGreenletWithLoop_1switch = {"switch", (PyCFunction)__pyx_pw_6gevent_21__greenlet_primitives_25SwitchOutGreenletWithLoop_1switch, METH_NOARGS, __pyx_doc_6gevent_21__greenlet_primitives_25SwitchOutGreenletWithLoop_switch}; +static PyObject *__pyx_pw_6gevent_21__greenlet_primitives_25SwitchOutGreenletWithLoop_1switch(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("switch (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_21__greenlet_primitives_25SwitchOutGreenletWithLoop_switch(((struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_21__greenlet_primitives_25SwitchOutGreenletWithLoop_switch(struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("switch", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6gevent_21__greenlet_primitives_25SwitchOutGreenletWithLoop_switch(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 60, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__greenlet_primitives.SwitchOutGreenletWithLoop.switch", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_greenlet_primitives.py":66 + * return _greenlet_switch(self) # pylint:disable=undefined-variable + * + * def switch_out(self): # <<<<<<<<<<<<<< + * raise BlockingSwitchOutError('Impossible to call blocking function in the event loop callback') + * + */ + +static PyObject *__pyx_pw_6gevent_21__greenlet_primitives_25SwitchOutGreenletWithLoop_3switch_out(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_f_6gevent_21__greenlet_primitives_25SwitchOutGreenletWithLoop_switch_out(CYTHON_UNUSED struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *__pyx_v_self, int __pyx_skip_dispatch) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + __Pyx_RefNannySetupContext("switch_out", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0; + if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self)))))); + else { + PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + #endif + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_switch_out); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 66, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_21__greenlet_primitives_25SwitchOutGreenletWithLoop_3switch_out)) { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 66, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0; + if (unlikely(type_dict_guard != tp_dict_version)) { + tp_dict_version = obj_dict_version = 0; + } + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + } + #endif + } + + /* "src/gevent/_greenlet_primitives.py":67 + * + * def switch_out(self): + * raise BlockingSwitchOutError('Impossible to call blocking function in the event loop callback') # <<<<<<<<<<<<<< + * + * + */ + __Pyx_INCREF(__pyx_v_6gevent_21__greenlet_primitives_BlockingSwitchOutError); + __pyx_t_2 = __pyx_v_6gevent_21__greenlet_primitives_BlockingSwitchOutError; __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_kp_s_Impossible_to_call_blocking_func) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_kp_s_Impossible_to_call_blocking_func); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 67, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 67, __pyx_L1_error) + + /* "src/gevent/_greenlet_primitives.py":66 + * return _greenlet_switch(self) # pylint:disable=undefined-variable + * + * def switch_out(self): # <<<<<<<<<<<<<< + * raise BlockingSwitchOutError('Impossible to call blocking function in the event loop callback') + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("gevent.__greenlet_primitives.SwitchOutGreenletWithLoop.switch_out", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_21__greenlet_primitives_25SwitchOutGreenletWithLoop_3switch_out(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6gevent_21__greenlet_primitives_25SwitchOutGreenletWithLoop_2switch_out[] = "SwitchOutGreenletWithLoop.switch_out(self)"; +static PyMethodDef __pyx_mdef_6gevent_21__greenlet_primitives_25SwitchOutGreenletWithLoop_3switch_out = {"switch_out", (PyCFunction)__pyx_pw_6gevent_21__greenlet_primitives_25SwitchOutGreenletWithLoop_3switch_out, METH_NOARGS, __pyx_doc_6gevent_21__greenlet_primitives_25SwitchOutGreenletWithLoop_2switch_out}; +static PyObject *__pyx_pw_6gevent_21__greenlet_primitives_25SwitchOutGreenletWithLoop_3switch_out(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("switch_out (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_21__greenlet_primitives_25SwitchOutGreenletWithLoop_2switch_out(((struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_21__greenlet_primitives_25SwitchOutGreenletWithLoop_2switch_out(struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("switch_out", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6gevent_21__greenlet_primitives_25SwitchOutGreenletWithLoop_switch_out(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 66, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__greenlet_primitives.SwitchOutGreenletWithLoop.switch_out", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/__greenlet_primitives.pxd":41 + * + * cdef class SwitchOutGreenletWithLoop(TrackedRawGreenlet): + * cdef public loop # <<<<<<<<<<<<<< + * + * cpdef switch(self) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_21__greenlet_primitives_25SwitchOutGreenletWithLoop_4loop_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_21__greenlet_primitives_25SwitchOutGreenletWithLoop_4loop_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_21__greenlet_primitives_25SwitchOutGreenletWithLoop_4loop___get__(((struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_21__greenlet_primitives_25SwitchOutGreenletWithLoop_4loop___get__(struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->loop); + __pyx_r = __pyx_v_self->loop; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6gevent_21__greenlet_primitives_25SwitchOutGreenletWithLoop_4loop_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6gevent_21__greenlet_primitives_25SwitchOutGreenletWithLoop_4loop_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_21__greenlet_primitives_25SwitchOutGreenletWithLoop_4loop_2__set__(((struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_21__greenlet_primitives_25SwitchOutGreenletWithLoop_4loop_2__set__(struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__", 0); + __Pyx_INCREF(__pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + __Pyx_GOTREF(__pyx_v_self->loop); + __Pyx_DECREF(__pyx_v_self->loop); + __pyx_v_self->loop = __pyx_v_value; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6gevent_21__greenlet_primitives_25SwitchOutGreenletWithLoop_4loop_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6gevent_21__greenlet_primitives_25SwitchOutGreenletWithLoop_4loop_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_21__greenlet_primitives_25SwitchOutGreenletWithLoop_4loop_4__del__(((struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_21__greenlet_primitives_25SwitchOutGreenletWithLoop_4loop_4__del__(struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->loop); + __Pyx_DECREF(__pyx_v_self->loop); + __pyx_v_self->loop = Py_None; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_greenlet_primitives.py":70 + * + * + * def get_reachable_greenlets(): # <<<<<<<<<<<<<< + * # We compile this loop with Cython so that it's faster, and so that + * # the GIL isn't dropped at unpredictable times during the loop. + */ + +static PyObject *__pyx_pw_6gevent_21__greenlet_primitives_1get_reachable_greenlets(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_f_6gevent_21__greenlet_primitives_get_reachable_greenlets(CYTHON_UNUSED int __pyx_skip_dispatch) { + PyObject *__pyx_7genexpr__pyx_v_x = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + Py_ssize_t __pyx_t_5; + PyObject *(*__pyx_t_6)(PyObject *); + int __pyx_t_7; + int __pyx_t_8; + int __pyx_t_9; + __Pyx_RefNannySetupContext("get_reachable_greenlets", 0); + + /* "src/gevent/_greenlet_primitives.py":79 + * # if other threads have dropped the GIL, but hopefully the speed makes that + * # more rare.) See https://github.com/gevent/gevent/issues/1302 + * return [ # <<<<<<<<<<<<<< + * x for x in get_objects() + * if isinstance(x, greenlet) and not getattr(x, 'greenlet_tree_is_ignored', False) + */ + __Pyx_XDECREF(__pyx_r); + { /* enter inner scope */ + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 79, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_1); + + /* "src/gevent/_greenlet_primitives.py":80 + * # more rare.) See https://github.com/gevent/gevent/issues/1302 + * return [ + * x for x in get_objects() # <<<<<<<<<<<<<< + * if isinstance(x, greenlet) and not getattr(x, 'greenlet_tree_is_ignored', False) + * ] + */ + __Pyx_INCREF(__pyx_v_6gevent_21__greenlet_primitives_get_objects); + __pyx_t_3 = __pyx_v_6gevent_21__greenlet_primitives_get_objects; __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 80, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) { + __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3); __pyx_t_5 = 0; + __pyx_t_6 = NULL; + } else { + __pyx_t_5 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 80, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_6 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 80, __pyx_L5_error) + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + for (;;) { + if (likely(!__pyx_t_6)) { + if (likely(PyList_CheckExact(__pyx_t_3))) { + if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 80, __pyx_L5_error) + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 80, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_2); + #endif + } else { + if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 80, __pyx_L5_error) + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 80, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_2); + #endif + } + } else { + __pyx_t_2 = __pyx_t_6(__pyx_t_3); + if (unlikely(!__pyx_t_2)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(0, 80, __pyx_L5_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_2); + } + __Pyx_XDECREF_SET(__pyx_7genexpr__pyx_v_x, __pyx_t_2); + __pyx_t_2 = 0; + + /* "src/gevent/_greenlet_primitives.py":81 + * return [ + * x for x in get_objects() + * if isinstance(x, greenlet) and not getattr(x, 'greenlet_tree_is_ignored', False) # <<<<<<<<<<<<<< + * ] + * + */ + __pyx_t_8 = __Pyx_TypeCheck(__pyx_7genexpr__pyx_v_x, __pyx_ptype_6gevent_21__greenlet_primitives_greenlet); + __pyx_t_9 = (__pyx_t_8 != 0); + if (__pyx_t_9) { + } else { + __pyx_t_7 = __pyx_t_9; + goto __pyx_L9_bool_binop_done; + } + __pyx_t_2 = __Pyx_GetAttr3(__pyx_7genexpr__pyx_v_x, __pyx_n_s_greenlet_tree_is_ignored, Py_False); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 81, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 81, __pyx_L5_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_8 = ((!__pyx_t_9) != 0); + __pyx_t_7 = __pyx_t_8; + __pyx_L9_bool_binop_done:; + if (__pyx_t_7) { + + /* "src/gevent/_greenlet_primitives.py":80 + * # more rare.) See https://github.com/gevent/gevent/issues/1302 + * return [ + * x for x in get_objects() # <<<<<<<<<<<<<< + * if isinstance(x, greenlet) and not getattr(x, 'greenlet_tree_is_ignored', False) + * ] + */ + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_7genexpr__pyx_v_x))) __PYX_ERR(0, 79, __pyx_L5_error) + + /* "src/gevent/_greenlet_primitives.py":81 + * return [ + * x for x in get_objects() + * if isinstance(x, greenlet) and not getattr(x, 'greenlet_tree_is_ignored', False) # <<<<<<<<<<<<<< + * ] + * + */ + } + + /* "src/gevent/_greenlet_primitives.py":80 + * # more rare.) See https://github.com/gevent/gevent/issues/1302 + * return [ + * x for x in get_objects() # <<<<<<<<<<<<<< + * if isinstance(x, greenlet) and not getattr(x, 'greenlet_tree_is_ignored', False) + * ] + */ + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_7genexpr__pyx_v_x); __pyx_7genexpr__pyx_v_x = 0; + goto __pyx_L11_exit_scope; + __pyx_L5_error:; + __Pyx_XDECREF(__pyx_7genexpr__pyx_v_x); __pyx_7genexpr__pyx_v_x = 0; + goto __pyx_L1_error; + __pyx_L11_exit_scope:; + } /* exit inner scope */ + __pyx_r = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "src/gevent/_greenlet_primitives.py":70 + * + * + * def get_reachable_greenlets(): # <<<<<<<<<<<<<< + * # We compile this loop with Cython so that it's faster, and so that + * # the GIL isn't dropped at unpredictable times during the loop. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("gevent.__greenlet_primitives.get_reachable_greenlets", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_7genexpr__pyx_v_x); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_21__greenlet_primitives_1get_reachable_greenlets(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6gevent_21__greenlet_primitives_get_reachable_greenlets[] = "get_reachable_greenlets() -> list"; +static PyMethodDef __pyx_mdef_6gevent_21__greenlet_primitives_1get_reachable_greenlets = {"get_reachable_greenlets", (PyCFunction)__pyx_pw_6gevent_21__greenlet_primitives_1get_reachable_greenlets, METH_NOARGS, __pyx_doc_6gevent_21__greenlet_primitives_get_reachable_greenlets}; +static PyObject *__pyx_pw_6gevent_21__greenlet_primitives_1get_reachable_greenlets(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get_reachable_greenlets (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_21__greenlet_primitives_get_reachable_greenlets(__pyx_self); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_21__greenlet_primitives_get_reachable_greenlets(CYTHON_UNUSED PyObject *__pyx_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("get_reachable_greenlets", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6gevent_21__greenlet_primitives_get_reachable_greenlets(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 70, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__greenlet_primitives.get_reachable_greenlets", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_greenlet_primitives.py":84 + * ] + * + * def _init(): # <<<<<<<<<<<<<< + * greenlet_init() # pylint:disable=undefined-variable + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_21__greenlet_primitives_3_init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6gevent_21__greenlet_primitives_2_init[] = "_init()"; +static PyMethodDef __pyx_mdef_6gevent_21__greenlet_primitives_3_init = {"_init", (PyCFunction)__pyx_pw_6gevent_21__greenlet_primitives_3_init, METH_NOARGS, __pyx_doc_6gevent_21__greenlet_primitives_2_init}; +static PyObject *__pyx_pw_6gevent_21__greenlet_primitives_3_init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_init (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_21__greenlet_primitives_2_init(__pyx_self); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_21__greenlet_primitives_2_init(CYTHON_UNUSED PyObject *__pyx_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_init", 0); + + /* "src/gevent/_greenlet_primitives.py":85 + * + * def _init(): + * greenlet_init() # pylint:disable=undefined-variable # <<<<<<<<<<<<<< + * + * _init() + */ + __pyx_f_6gevent_21__greenlet_primitives_greenlet_init(); + + /* "src/gevent/_greenlet_primitives.py":84 + * ] + * + * def _init(): # <<<<<<<<<<<<<< + * greenlet_init() # pylint:disable=undefined-variable + * + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/__greenlet_primitives.pxd":23 + * + * @cython.final + * cdef inline greenlet getcurrent(): # <<<<<<<<<<<<<< + * return PyGreenlet_GetCurrent() + * + */ + +static CYTHON_INLINE PyGreenlet *__pyx_f_6gevent_21__greenlet_primitives_getcurrent(void) { + PyGreenlet *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("getcurrent", 0); + + /* "gevent/__greenlet_primitives.pxd":24 + * @cython.final + * cdef inline greenlet getcurrent(): + * return PyGreenlet_GetCurrent() # <<<<<<<<<<<<<< + * + * cdef bint _greenlet_imported + */ + __Pyx_XDECREF(((PyObject *)__pyx_r)); + __pyx_t_1 = ((PyObject *)PyGreenlet_GetCurrent()); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 24, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = ((PyGreenlet *)__pyx_t_1); + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "gevent/__greenlet_primitives.pxd":23 + * + * @cython.final + * cdef inline greenlet getcurrent(): # <<<<<<<<<<<<<< + * return PyGreenlet_GetCurrent() + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__greenlet_primitives.getcurrent", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF((PyObject *)__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/__greenlet_primitives.pxd":28 + * cdef bint _greenlet_imported + * + * cdef inline void greenlet_init(): # <<<<<<<<<<<<<< + * global _greenlet_imported + * if not _greenlet_imported: + */ + +static CYTHON_INLINE void __pyx_f_6gevent_21__greenlet_primitives_greenlet_init(void) { + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("greenlet_init", 0); + + /* "gevent/__greenlet_primitives.pxd":30 + * cdef inline void greenlet_init(): + * global _greenlet_imported + * if not _greenlet_imported: # <<<<<<<<<<<<<< + * PyGreenlet_Import() + * _greenlet_imported = True + */ + __pyx_t_1 = ((!(__pyx_v_6gevent_21__greenlet_primitives__greenlet_imported != 0)) != 0); + if (__pyx_t_1) { + + /* "gevent/__greenlet_primitives.pxd":31 + * global _greenlet_imported + * if not _greenlet_imported: + * PyGreenlet_Import() # <<<<<<<<<<<<<< + * _greenlet_imported = True + * + */ + PyGreenlet_Import(); + + /* "gevent/__greenlet_primitives.pxd":32 + * if not _greenlet_imported: + * PyGreenlet_Import() + * _greenlet_imported = True # <<<<<<<<<<<<<< + * + * cdef inline object _greenlet_switch(greenlet self): + */ + __pyx_v_6gevent_21__greenlet_primitives__greenlet_imported = 1; + + /* "gevent/__greenlet_primitives.pxd":30 + * cdef inline void greenlet_init(): + * global _greenlet_imported + * if not _greenlet_imported: # <<<<<<<<<<<<<< + * PyGreenlet_Import() + * _greenlet_imported = True + */ + } + + /* "gevent/__greenlet_primitives.pxd":28 + * cdef bint _greenlet_imported + * + * cdef inline void greenlet_init(): # <<<<<<<<<<<<<< + * global _greenlet_imported + * if not _greenlet_imported: + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "gevent/__greenlet_primitives.pxd":34 + * _greenlet_imported = True + * + * cdef inline object _greenlet_switch(greenlet self): # <<<<<<<<<<<<<< + * return PyGreenlet_Switch(self, NULL, NULL) + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_6gevent_21__greenlet_primitives__greenlet_switch(PyGreenlet *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("_greenlet_switch", 0); + + /* "gevent/__greenlet_primitives.pxd":35 + * + * cdef inline object _greenlet_switch(greenlet self): + * return PyGreenlet_Switch(self, NULL, NULL) # <<<<<<<<<<<<<< + * + * cdef class TrackedRawGreenlet(greenlet): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyGreenlet_Switch(__pyx_v_self, NULL, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 35, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "gevent/__greenlet_primitives.pxd":34 + * _greenlet_imported = True + * + * cdef inline object _greenlet_switch(greenlet self): # <<<<<<<<<<<<<< + * return PyGreenlet_Switch(self, NULL, NULL) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__greenlet_primitives._greenlet_switch", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_tp_new_6gevent_21__greenlet_primitives_TrackedRawGreenlet(PyTypeObject *t, PyObject *a, PyObject *k) { + PyObject *o = __pyx_ptype_6gevent_21__greenlet_primitives_greenlet->tp_new(t, a, k); + if (unlikely(!o)) return 0; + return o; +} + +static PyMethodDef __pyx_methods_6gevent_21__greenlet_primitives_TrackedRawGreenlet[] = { + {0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_6gevent_21__greenlet_primitives_TrackedRawGreenlet = { + PyVarObject_HEAD_INIT(0, 0) + "gevent.__greenlet_primitives.TrackedRawGreenlet", /*tp_name*/ + sizeof(struct __pyx_obj_6gevent_21__greenlet_primitives_TrackedRawGreenlet), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + 0, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ + "TrackedRawGreenlet(function, parent)", /*tp_doc*/ + 0, /*tp_traverse*/ + 0, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6gevent_21__greenlet_primitives_TrackedRawGreenlet, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_pw_6gevent_21__greenlet_primitives_18TrackedRawGreenlet_1__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6gevent_21__greenlet_primitives_TrackedRawGreenlet, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; +static struct __pyx_vtabstruct_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop __pyx_vtable_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop; + +static PyObject *__pyx_tp_new_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *p; + PyObject *o = __pyx_tp_new_6gevent_21__greenlet_primitives_TrackedRawGreenlet(t, a, k); + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *)o); + p->__pyx_vtab = __pyx_vtabptr_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop; + p->loop = Py_None; Py_INCREF(Py_None); + return o; +} + +static void __pyx_tp_dealloc_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop(PyObject *o) { + struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *p = (struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *)o; + #if CYTHON_USE_TP_FINALIZE + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + PyObject_GC_UnTrack(o); + Py_CLEAR(p->loop); + #if CYTHON_USE_TYPE_SLOTS + if (PyType_IS_GC(Py_TYPE(o)->tp_base)) + #endif + PyObject_GC_Track(o); + if (likely(__pyx_ptype_6gevent_21__greenlet_primitives_TrackedRawGreenlet)) __pyx_ptype_6gevent_21__greenlet_primitives_TrackedRawGreenlet->tp_dealloc(o); else __Pyx_call_next_tp_dealloc(o, __pyx_tp_dealloc_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop); +} + +static int __pyx_tp_traverse_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *p = (struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *)o; + e = ((likely(__pyx_ptype_6gevent_21__greenlet_primitives_TrackedRawGreenlet)) ? ((__pyx_ptype_6gevent_21__greenlet_primitives_TrackedRawGreenlet->tp_traverse) ? __pyx_ptype_6gevent_21__greenlet_primitives_TrackedRawGreenlet->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop)); if (e) return e; + if (p->loop) { + e = (*v)(p->loop, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *p = (struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *)o; + if (likely(__pyx_ptype_6gevent_21__greenlet_primitives_TrackedRawGreenlet)) { if (__pyx_ptype_6gevent_21__greenlet_primitives_TrackedRawGreenlet->tp_clear) __pyx_ptype_6gevent_21__greenlet_primitives_TrackedRawGreenlet->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop); + tmp = ((PyObject*)p->loop); + p->loop = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyObject *__pyx_getprop_6gevent_21__greenlet_primitives_25SwitchOutGreenletWithLoop_loop(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_21__greenlet_primitives_25SwitchOutGreenletWithLoop_4loop_1__get__(o); +} + +static int __pyx_setprop_6gevent_21__greenlet_primitives_25SwitchOutGreenletWithLoop_loop(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6gevent_21__greenlet_primitives_25SwitchOutGreenletWithLoop_4loop_3__set__(o, v); + } + else { + return __pyx_pw_6gevent_21__greenlet_primitives_25SwitchOutGreenletWithLoop_4loop_5__del__(o); + } +} + +static PyMethodDef __pyx_methods_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop[] = { + {0, 0, 0, 0} +}; + +static struct PyGetSetDef __pyx_getsets_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop[] = { + {(char *)"loop", __pyx_getprop_6gevent_21__greenlet_primitives_25SwitchOutGreenletWithLoop_loop, __pyx_setprop_6gevent_21__greenlet_primitives_25SwitchOutGreenletWithLoop_loop, (char *)"loop: object", 0}, + {0, 0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop = { + PyVarObject_HEAD_INIT(0, 0) + "gevent.__greenlet_primitives.SwitchOutGreenletWithLoop", /*tp_name*/ + sizeof(struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop, /*tp_traverse*/ + __pyx_tp_clear_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop, /*tp_methods*/ + 0, /*tp_members*/ + __pyx_getsets_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_6gevent_21__greenlet_primitives_18TrackedRawGreenlet_1__init__, /*tp_init*/ + #else + 0, /*tp_init*/ + #endif + 0, /*tp_alloc*/ + __pyx_tp_new_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static PyMethodDef __pyx_methods[] = { + {0, 0, 0, 0} +}; + +#if PY_MAJOR_VERSION >= 3 +#if CYTHON_PEP489_MULTI_PHASE_INIT +static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ +static int __pyx_pymod_exec___greenlet_primitives(PyObject* module); /*proto*/ +static PyModuleDef_Slot __pyx_moduledef_slots[] = { + {Py_mod_create, (void*)__pyx_pymod_create}, + {Py_mod_exec, (void*)__pyx_pymod_exec___greenlet_primitives}, + {0, NULL} +}; +#endif + +static struct PyModuleDef __pyx_moduledef = { + PyModuleDef_HEAD_INIT, + "__greenlet_primitives", + __pyx_k_A_collection_of_primitives_used, /* m_doc */ + #if CYTHON_PEP489_MULTI_PHASE_INIT + 0, /* m_size */ + #else + -1, /* m_size */ + #endif + __pyx_methods /* m_methods */, + #if CYTHON_PEP489_MULTI_PHASE_INIT + __pyx_moduledef_slots, /* m_slots */ + #else + NULL, /* m_reload */ + #endif + NULL, /* m_traverse */ + NULL, /* m_clear */ + NULL /* m_free */ +}; +#endif +#ifndef CYTHON_SMALL_CODE +#if defined(__clang__) + #define CYTHON_SMALL_CODE +#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) + #define CYTHON_SMALL_CODE __attribute__((cold)) +#else + #define CYTHON_SMALL_CODE +#endif +#endif + +static __Pyx_StringTabEntry __pyx_string_tab[] = { + {&__pyx_n_s_AttributeError, __pyx_k_AttributeError, sizeof(__pyx_k_AttributeError), 0, 0, 1, 1}, + {&__pyx_n_s_BlockingSwitchOutError, __pyx_k_BlockingSwitchOutError, sizeof(__pyx_k_BlockingSwitchOutError), 0, 0, 1, 1}, + {&__pyx_kp_s_Impossible_to_call_blocking_func, __pyx_k_Impossible_to_call_blocking_func, sizeof(__pyx_k_Impossible_to_call_blocking_func), 0, 0, 1, 0}, + {&__pyx_n_s_SwitchOutGreenletWithLoop, __pyx_k_SwitchOutGreenletWithLoop, sizeof(__pyx_k_SwitchOutGreenletWithLoop), 0, 0, 1, 1}, + {&__pyx_n_s_SwitchOutGreenletWithLoop_switch, __pyx_k_SwitchOutGreenletWithLoop_switch, sizeof(__pyx_k_SwitchOutGreenletWithLoop_switch), 0, 0, 1, 1}, + {&__pyx_n_s_SwitchOutGreenletWithLoop_switch_2, __pyx_k_SwitchOutGreenletWithLoop_switch_2, sizeof(__pyx_k_SwitchOutGreenletWithLoop_switch_2), 0, 0, 1, 1}, + {&__pyx_n_s_TrackedRawGreenlet, __pyx_k_TrackedRawGreenlet, sizeof(__pyx_k_TrackedRawGreenlet), 0, 0, 1, 1}, + {&__pyx_n_s_all, __pyx_k_all, sizeof(__pyx_k_all), 0, 0, 1, 1}, + {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, + {&__pyx_n_s_function, __pyx_k_function, sizeof(__pyx_k_function), 0, 0, 1, 1}, + {&__pyx_n_s_gc, __pyx_k_gc, sizeof(__pyx_k_gc), 0, 0, 1, 1}, + {&__pyx_n_s_get_objects, __pyx_k_get_objects, sizeof(__pyx_k_get_objects), 0, 0, 1, 1}, + {&__pyx_n_s_get_reachable_greenlets, __pyx_k_get_reachable_greenlets, sizeof(__pyx_k_get_reachable_greenlets), 0, 0, 1, 1}, + {&__pyx_n_s_getcurrent, __pyx_k_getcurrent, sizeof(__pyx_k_getcurrent), 0, 0, 1, 1}, + {&__pyx_n_s_gevent___greenlet_primitives, __pyx_k_gevent___greenlet_primitives, sizeof(__pyx_k_gevent___greenlet_primitives), 0, 0, 1, 1}, + {&__pyx_n_s_gevent__util, __pyx_k_gevent__util, sizeof(__pyx_k_gevent__util), 0, 0, 1, 1}, + {&__pyx_n_s_gevent_exceptions, __pyx_k_gevent_exceptions, sizeof(__pyx_k_gevent_exceptions), 0, 0, 1, 1}, + {&__pyx_n_s_greenlet, __pyx_k_greenlet, sizeof(__pyx_k_greenlet), 0, 0, 1, 1}, + {&__pyx_n_s_greenlet_imported, __pyx_k_greenlet_imported, sizeof(__pyx_k_greenlet_imported), 0, 0, 1, 1}, + {&__pyx_n_s_greenlet_init, __pyx_k_greenlet_init, sizeof(__pyx_k_greenlet_init), 0, 0, 1, 1}, + {&__pyx_n_s_greenlet_switch, __pyx_k_greenlet_switch, sizeof(__pyx_k_greenlet_switch), 0, 0, 1, 1}, + {&__pyx_n_s_greenlet_tree_is_ignored, __pyx_k_greenlet_tree_is_ignored, sizeof(__pyx_k_greenlet_tree_is_ignored), 0, 0, 1, 1}, + {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, + {&__pyx_n_s_import_c_accel, __pyx_k_import_c_accel, sizeof(__pyx_k_import_c_accel), 0, 0, 1, 1}, + {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1}, + {&__pyx_n_s_init_2, __pyx_k_init_2, sizeof(__pyx_k_init_2), 0, 0, 1, 1}, + {&__pyx_n_s_lambda, __pyx_k_lambda, sizeof(__pyx_k_lambda), 0, 0, 1, 1}, + {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, + {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, + {&__pyx_n_s_parent, __pyx_k_parent, sizeof(__pyx_k_parent), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_capi, __pyx_k_pyx_capi, sizeof(__pyx_k_pyx_capi), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1}, + {&__pyx_n_s_ref, __pyx_k_ref, sizeof(__pyx_k_ref), 0, 0, 1, 1}, + {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1}, + {&__pyx_n_s_spawn_tree_locals, __pyx_k_spawn_tree_locals, sizeof(__pyx_k_spawn_tree_locals), 0, 0, 1, 1}, + {&__pyx_n_s_spawning_greenlet, __pyx_k_spawning_greenlet, sizeof(__pyx_k_spawning_greenlet), 0, 0, 1, 1}, + {&__pyx_kp_s_src_gevent__greenlet_primitives, __pyx_k_src_gevent__greenlet_primitives, sizeof(__pyx_k_src_gevent__greenlet_primitives), 0, 0, 1, 0}, + {&__pyx_n_s_switch, __pyx_k_switch, sizeof(__pyx_k_switch), 0, 0, 1, 1}, + {&__pyx_n_s_switch_out, __pyx_k_switch_out, sizeof(__pyx_k_switch_out), 0, 0, 1, 1}, + {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, + {&__pyx_n_s_weakref, __pyx_k_weakref, sizeof(__pyx_k_weakref), 0, 0, 1, 1}, + {&__pyx_n_s_wref, __pyx_k_wref, sizeof(__pyx_k_wref), 0, 0, 1, 1}, + {0, 0, 0, 0, 0, 0, 0} +}; +static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { + __pyx_builtin___import__ = __Pyx_GetBuiltinName(__pyx_n_s_import); if (!__pyx_builtin___import__) __PYX_ERR(0, 25, __pyx_L1_error) + __pyx_builtin_AttributeError = __Pyx_GetBuiltinName(__pyx_n_s_AttributeError); if (!__pyx_builtin_AttributeError) __PYX_ERR(0, 47, __pyx_L1_error) + return 0; + __pyx_L1_error:; + return -1; +} + +static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); + + /* "src/gevent/_greenlet_primitives.py":25 + * # is assignment) without generating a 'lvalue is not valid target' + * # error. + * locals()['getcurrent'] = __import__('greenlet').getcurrent # <<<<<<<<<<<<<< + * locals()['greenlet_init'] = lambda: None + * locals()['_greenlet_switch'] = greenlet.switch + */ + __pyx_tuple_ = PyTuple_Pack(1, __pyx_n_s_greenlet); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 25, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple_); + __Pyx_GIVEREF(__pyx_tuple_); + + /* "src/gevent/_greenlet_primitives.py":60 + * # circular dependencies with the hub. + * + * def switch(self): # <<<<<<<<<<<<<< + * switch_out = getattr(getcurrent(), 'switch_out', None) # pylint:disable=undefined-variable + * if switch_out is not None: + */ + __pyx_tuple__2 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 60, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2); + __Pyx_GIVEREF(__pyx_tuple__2); + __pyx_codeobj__3 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__greenlet_primitives, __pyx_n_s_switch, 60, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__3)) __PYX_ERR(0, 60, __pyx_L1_error) + + /* "src/gevent/_greenlet_primitives.py":66 + * return _greenlet_switch(self) # pylint:disable=undefined-variable + * + * def switch_out(self): # <<<<<<<<<<<<<< + * raise BlockingSwitchOutError('Impossible to call blocking function in the event loop callback') + * + */ + __pyx_tuple__4 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 66, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__4); + __Pyx_GIVEREF(__pyx_tuple__4); + __pyx_codeobj__5 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__4, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__greenlet_primitives, __pyx_n_s_switch_out, 66, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__5)) __PYX_ERR(0, 66, __pyx_L1_error) + + /* "src/gevent/_greenlet_primitives.py":70 + * + * + * def get_reachable_greenlets(): # <<<<<<<<<<<<<< + * # We compile this loop with Cython so that it's faster, and so that + * # the GIL isn't dropped at unpredictable times during the loop. + */ + __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__greenlet_primitives, __pyx_n_s_get_reachable_greenlets, 70, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__6)) __PYX_ERR(0, 70, __pyx_L1_error) + + /* "src/gevent/_greenlet_primitives.py":84 + * ] + * + * def _init(): # <<<<<<<<<<<<<< + * greenlet_init() # pylint:disable=undefined-variable + * + */ + __pyx_codeobj__7 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__greenlet_primitives, __pyx_n_s_init_2, 84, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__7)) __PYX_ERR(0, 84, __pyx_L1_error) + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} + +static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { + if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + return 0; + __pyx_L1_error:; + return -1; +} + +static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/ + +static int __Pyx_modinit_global_init_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); + /*--- Global init code ---*/ + __pyx_v_6gevent_21__greenlet_primitives_get_objects = Py_None; Py_INCREF(Py_None); + __pyx_v_6gevent_21__greenlet_primitives_wref = Py_None; Py_INCREF(Py_None); + __pyx_v_6gevent_21__greenlet_primitives_BlockingSwitchOutError = Py_None; Py_INCREF(Py_None); + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_variable_export_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); + /*--- Variable export code ---*/ + if (__Pyx_ExportVoidPtr(__pyx_n_s_get_objects, (void *)&__pyx_v_6gevent_21__greenlet_primitives_get_objects, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportVoidPtr(__pyx_n_s_wref, (void *)&__pyx_v_6gevent_21__greenlet_primitives_wref, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportVoidPtr(__pyx_n_s_BlockingSwitchOutError, (void *)&__pyx_v_6gevent_21__greenlet_primitives_BlockingSwitchOutError, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportVoidPtr(__pyx_n_s_greenlet_imported, (void *)&__pyx_v_6gevent_21__greenlet_primitives__greenlet_imported, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_modinit_function_export_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); + /*--- Function export code ---*/ + if (__Pyx_ExportFunction("get_reachable_greenlets", (void (*)(void))__pyx_f_6gevent_21__greenlet_primitives_get_reachable_greenlets, "PyObject *(int __pyx_skip_dispatch)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_modinit_type_init_code(void) { + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); + /*--- Type init code ---*/ + __pyx_t_1 = PyImport_ImportModule("greenlet"); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_ptype_6gevent_21__greenlet_primitives_greenlet = __Pyx_ImportType(__pyx_t_1, "greenlet", "greenlet", sizeof(PyGreenlet), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_21__greenlet_primitives_greenlet) __PYX_ERR(1, 12, __pyx_L1_error) + __pyx_type_6gevent_21__greenlet_primitives_TrackedRawGreenlet.tp_base = __pyx_ptype_6gevent_21__greenlet_primitives_greenlet; + if (PyType_Ready(&__pyx_type_6gevent_21__greenlet_primitives_TrackedRawGreenlet) < 0) __PYX_ERR(0, 34, __pyx_L1_error) + __pyx_type_6gevent_21__greenlet_primitives_TrackedRawGreenlet.tp_print = 0; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6gevent_21__greenlet_primitives_TrackedRawGreenlet.tp_dictoffset && __pyx_type_6gevent_21__greenlet_primitives_TrackedRawGreenlet.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_type_6gevent_21__greenlet_primitives_TrackedRawGreenlet.tp_getattro = __Pyx_PyObject_GenericGetAttr; + } + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_TrackedRawGreenlet, (PyObject *)&__pyx_type_6gevent_21__greenlet_primitives_TrackedRawGreenlet) < 0) __PYX_ERR(0, 34, __pyx_L1_error) + __pyx_ptype_6gevent_21__greenlet_primitives_TrackedRawGreenlet = &__pyx_type_6gevent_21__greenlet_primitives_TrackedRawGreenlet; + __pyx_vtabptr_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop = &__pyx_vtable_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop; + __pyx_vtable_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop.__pyx_switch = (PyObject *(*)(struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *, int __pyx_skip_dispatch))__pyx_f_6gevent_21__greenlet_primitives_25SwitchOutGreenletWithLoop_switch; + __pyx_vtable_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop.switch_out = (PyObject *(*)(struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *, int __pyx_skip_dispatch))__pyx_f_6gevent_21__greenlet_primitives_25SwitchOutGreenletWithLoop_switch_out; + __pyx_type_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop.tp_base = __pyx_ptype_6gevent_21__greenlet_primitives_TrackedRawGreenlet; + if (PyType_Ready(&__pyx_type_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop) < 0) __PYX_ERR(0, 53, __pyx_L1_error) + __pyx_type_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop.tp_print = 0; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop.tp_dictoffset && __pyx_type_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_type_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop.tp_getattro = __Pyx_PyObject_GenericGetAttr; + } + if (__Pyx_SetVtable(__pyx_type_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop.tp_dict, __pyx_vtabptr_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop) < 0) __PYX_ERR(0, 53, __pyx_L1_error) + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_SwitchOutGreenletWithLoop, (PyObject *)&__pyx_type_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop) < 0) __PYX_ERR(0, 53, __pyx_L1_error) + __pyx_ptype_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop = &__pyx_type_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_modinit_type_import_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); + /*--- Type import code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_variable_import_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); + /*--- Variable import code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_function_import_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); + /*--- Function import code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + + +#if PY_MAJOR_VERSION < 3 +#ifdef CYTHON_NO_PYINIT_EXPORT +#define __Pyx_PyMODINIT_FUNC void +#else +#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC +#endif +#else +#ifdef CYTHON_NO_PYINIT_EXPORT +#define __Pyx_PyMODINIT_FUNC PyObject * +#else +#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC +#endif +#endif + + +#if PY_MAJOR_VERSION < 3 +__Pyx_PyMODINIT_FUNC init__greenlet_primitives(void) CYTHON_SMALL_CODE; /*proto*/ +__Pyx_PyMODINIT_FUNC init__greenlet_primitives(void) +#else +__Pyx_PyMODINIT_FUNC PyInit___greenlet_primitives(void) CYTHON_SMALL_CODE; /*proto*/ +__Pyx_PyMODINIT_FUNC PyInit___greenlet_primitives(void) +#if CYTHON_PEP489_MULTI_PHASE_INIT +{ + return PyModuleDef_Init(&__pyx_moduledef); +} +static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { + #if PY_VERSION_HEX >= 0x030700A1 + static PY_INT64_T main_interpreter_id = -1; + PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); + if (main_interpreter_id == -1) { + main_interpreter_id = current_id; + return (unlikely(current_id == -1)) ? -1 : 0; + } else if (unlikely(main_interpreter_id != current_id)) + #else + static PyInterpreterState *main_interpreter = NULL; + PyInterpreterState *current_interpreter = PyThreadState_Get()->interp; + if (!main_interpreter) { + main_interpreter = current_interpreter; + } else if (unlikely(main_interpreter != current_interpreter)) + #endif + { + PyErr_SetString( + PyExc_ImportError, + "Interpreter change detected - this module can only be loaded into one interpreter per process."); + return -1; + } + return 0; +} +static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) { + PyObject *value = PyObject_GetAttrString(spec, from_name); + int result = 0; + if (likely(value)) { + if (allow_none || value != Py_None) { + result = PyDict_SetItemString(moddict, to_name, value); + } + Py_DECREF(value); + } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_Clear(); + } else { + result = -1; + } + return result; +} +static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) { + PyObject *module = NULL, *moddict, *modname; + if (__Pyx_check_single_interpreter()) + return NULL; + if (__pyx_m) + return __Pyx_NewRef(__pyx_m); + modname = PyObject_GetAttrString(spec, "name"); + if (unlikely(!modname)) goto bad; + module = PyModule_NewObject(modname); + Py_DECREF(modname); + if (unlikely(!module)) goto bad; + moddict = PyModule_GetDict(module); + if (unlikely(!moddict)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad; + return module; +bad: + Py_XDECREF(module); + return NULL; +} + + +static CYTHON_SMALL_CODE int __pyx_pymod_exec___greenlet_primitives(PyObject *__pyx_pyinit_module) +#endif +#endif +{ + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannyDeclarations + #if CYTHON_PEP489_MULTI_PHASE_INIT + if (__pyx_m) { + if (__pyx_m == __pyx_pyinit_module) return 0; + PyErr_SetString(PyExc_RuntimeError, "Module '__greenlet_primitives' has already been imported. Re-initialisation is not supported."); + return -1; + } + #elif PY_MAJOR_VERSION >= 3 + if (__pyx_m) return __Pyx_NewRef(__pyx_m); + #endif + #if CYTHON_REFNANNY +__Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); +if (!__Pyx_RefNanny) { + PyErr_Clear(); + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); + if (!__Pyx_RefNanny) + Py_FatalError("failed to import 'refnanny' module"); +} +#endif + __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit___greenlet_primitives(void)", 0); + if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #ifdef __Pxy_PyFrame_Initialize_Offsets + __Pxy_PyFrame_Initialize_Offsets(); + #endif + __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) + #ifdef __Pyx_CyFunction_USED + if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_FusedFunction_USED + if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_Coroutine_USED + if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_Generator_USED + if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_AsyncGen_USED + if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_StopAsyncIteration_USED + if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + /*--- Library function declarations ---*/ + /*--- Threads initialization code ---*/ + #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS + #ifdef WITH_THREAD /* Python build with threading support? */ + PyEval_InitThreads(); + #endif + #endif + /*--- Module creation code ---*/ + #if CYTHON_PEP489_MULTI_PHASE_INIT + __pyx_m = __pyx_pyinit_module; + Py_INCREF(__pyx_m); + #else + #if PY_MAJOR_VERSION < 3 + __pyx_m = Py_InitModule4("__greenlet_primitives", __pyx_methods, __pyx_k_A_collection_of_primitives_used, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); + #else + __pyx_m = PyModule_Create(&__pyx_moduledef); + #endif + if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) + Py_INCREF(__pyx_d); + __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) + #if CYTHON_COMPILING_IN_PYPY + Py_INCREF(__pyx_b); + #endif + if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + /*--- Initialize various global constants etc. ---*/ + if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) + if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + if (__pyx_module_is_main_gevent____greenlet_primitives) { + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + } + #if PY_MAJOR_VERSION >= 3 + { + PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) + if (!PyDict_GetItemString(modules, "gevent.__greenlet_primitives")) { + if (unlikely(PyDict_SetItemString(modules, "gevent.__greenlet_primitives", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error) + } + } + #endif + /*--- Builtin init code ---*/ + if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + /*--- Constants init code ---*/ + if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + /*--- Global type/function init code ---*/ + (void)__Pyx_modinit_global_init_code(); + if (unlikely(__Pyx_modinit_variable_export_code() != 0)) goto __pyx_L1_error; + if (unlikely(__Pyx_modinit_function_export_code() != 0)) goto __pyx_L1_error; + if (unlikely(__Pyx_modinit_type_init_code() != 0)) goto __pyx_L1_error; + (void)__Pyx_modinit_type_import_code(); + (void)__Pyx_modinit_variable_import_code(); + (void)__Pyx_modinit_function_import_code(); + /*--- Execution code ---*/ + #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) + if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + + /* "src/gevent/_greenlet_primitives.py":13 + * from __future__ import print_function + * + * from weakref import ref as wref # <<<<<<<<<<<<<< + * from gc import get_objects + * + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_ref); + __Pyx_GIVEREF(__pyx_n_s_ref); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_ref); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_weakref, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_ref); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_v_6gevent_21__greenlet_primitives_wref); + __Pyx_DECREF_SET(__pyx_v_6gevent_21__greenlet_primitives_wref, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/_greenlet_primitives.py":14 + * + * from weakref import ref as wref + * from gc import get_objects # <<<<<<<<<<<<<< + * + * from greenlet import greenlet + */ + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 14, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_get_objects); + __Pyx_GIVEREF(__pyx_n_s_get_objects); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_get_objects); + __pyx_t_1 = __Pyx_Import(__pyx_n_s_gc, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 14, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_get_objects); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 14, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_v_6gevent_21__greenlet_primitives_get_objects); + __Pyx_DECREF_SET(__pyx_v_6gevent_21__greenlet_primitives_get_objects, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_greenlet_primitives.py":16 + * from gc import get_objects + * + * from greenlet import greenlet # <<<<<<<<<<<<<< + * + * from gevent.exceptions import BlockingSwitchOutError + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 16, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_greenlet); + __Pyx_GIVEREF(__pyx_n_s_greenlet); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_greenlet); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_greenlet, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 16, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/_greenlet_primitives.py":18 + * from greenlet import greenlet + * + * from gevent.exceptions import BlockingSwitchOutError # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 18, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_BlockingSwitchOutError); + __Pyx_GIVEREF(__pyx_n_s_BlockingSwitchOutError); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_BlockingSwitchOutError); + __pyx_t_1 = __Pyx_Import(__pyx_n_s_gevent_exceptions, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 18, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_BlockingSwitchOutError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 18, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_v_6gevent_21__greenlet_primitives_BlockingSwitchOutError); + __Pyx_DECREF_SET(__pyx_v_6gevent_21__greenlet_primitives_BlockingSwitchOutError, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_greenlet_primitives.py":25 + * # is assignment) without generating a 'lvalue is not valid target' + * # error. + * locals()['getcurrent'] = __import__('greenlet').getcurrent # <<<<<<<<<<<<<< + * locals()['greenlet_init'] = lambda: None + * locals()['_greenlet_switch'] = greenlet.switch + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin___import__, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 25, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_getcurrent); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 25, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_Globals(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 25, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (unlikely(PyDict_SetItem(__pyx_t_1, __pyx_n_s_getcurrent, __pyx_t_2) < 0)) __PYX_ERR(0, 25, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/_greenlet_primitives.py":26 + * # error. + * locals()['getcurrent'] = __import__('greenlet').getcurrent + * locals()['greenlet_init'] = lambda: None # <<<<<<<<<<<<<< + * locals()['_greenlet_switch'] = greenlet.switch + * + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_21__greenlet_primitives_4lambda, 0, __pyx_n_s_lambda, NULL, __pyx_n_s_gevent___greenlet_primitives, __pyx_d, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 26, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_Globals(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 26, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (unlikely(PyDict_SetItem(__pyx_t_1, __pyx_n_s_greenlet_init, __pyx_t_2) < 0)) __PYX_ERR(0, 26, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/_greenlet_primitives.py":27 + * locals()['getcurrent'] = __import__('greenlet').getcurrent + * locals()['greenlet_init'] = lambda: None + * locals()['_greenlet_switch'] = greenlet.switch # <<<<<<<<<<<<<< + * + * __all__ = [ + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_6gevent_21__greenlet_primitives_greenlet), __pyx_n_s_switch); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 27, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_Globals(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 27, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (unlikely(PyDict_SetItem(__pyx_t_1, __pyx_n_s_greenlet_switch, __pyx_t_2) < 0)) __PYX_ERR(0, 27, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/_greenlet_primitives.py":29 + * locals()['_greenlet_switch'] = greenlet.switch + * + * __all__ = [ # <<<<<<<<<<<<<< + * 'TrackedRawGreenlet', + * 'SwitchOutGreenletWithLoop', + */ + __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 29, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_TrackedRawGreenlet); + __Pyx_GIVEREF(__pyx_n_s_TrackedRawGreenlet); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_TrackedRawGreenlet); + __Pyx_INCREF(__pyx_n_s_SwitchOutGreenletWithLoop); + __Pyx_GIVEREF(__pyx_n_s_SwitchOutGreenletWithLoop); + PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_SwitchOutGreenletWithLoop); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_all, __pyx_t_2) < 0) __PYX_ERR(0, 29, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/_greenlet_primitives.py":60 + * # circular dependencies with the hub. + * + * def switch(self): # <<<<<<<<<<<<<< + * switch_out = getattr(getcurrent(), 'switch_out', None) # pylint:disable=undefined-variable + * if switch_out is not None: + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_21__greenlet_primitives_25SwitchOutGreenletWithLoop_1switch, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_SwitchOutGreenletWithLoop_switch, NULL, __pyx_n_s_gevent___greenlet_primitives, __pyx_d, ((PyObject *)__pyx_codeobj__3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 60, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop->tp_dict, __pyx_n_s_switch, __pyx_t_2) < 0) __PYX_ERR(0, 60, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop); + + /* "src/gevent/_greenlet_primitives.py":66 + * return _greenlet_switch(self) # pylint:disable=undefined-variable + * + * def switch_out(self): # <<<<<<<<<<<<<< + * raise BlockingSwitchOutError('Impossible to call blocking function in the event loop callback') + * + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_21__greenlet_primitives_25SwitchOutGreenletWithLoop_3switch_out, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_SwitchOutGreenletWithLoop_switch_2, NULL, __pyx_n_s_gevent___greenlet_primitives, __pyx_d, ((PyObject *)__pyx_codeobj__5)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 66, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop->tp_dict, __pyx_n_s_switch_out, __pyx_t_2) < 0) __PYX_ERR(0, 66, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop); + + /* "src/gevent/_greenlet_primitives.py":70 + * + * + * def get_reachable_greenlets(): # <<<<<<<<<<<<<< + * # We compile this loop with Cython so that it's faster, and so that + * # the GIL isn't dropped at unpredictable times during the loop. + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_21__greenlet_primitives_1get_reachable_greenlets, 0, __pyx_n_s_get_reachable_greenlets, NULL, __pyx_n_s_gevent___greenlet_primitives, __pyx_d, ((PyObject *)__pyx_codeobj__6)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 70, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_reachable_greenlets, __pyx_t_2) < 0) __PYX_ERR(0, 70, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/_greenlet_primitives.py":84 + * ] + * + * def _init(): # <<<<<<<<<<<<<< + * greenlet_init() # pylint:disable=undefined-variable + * + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_21__greenlet_primitives_3_init, 0, __pyx_n_s_init_2, NULL, __pyx_n_s_gevent___greenlet_primitives, __pyx_d, ((PyObject *)__pyx_codeobj__7)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 84, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_init_2, __pyx_t_2) < 0) __PYX_ERR(0, 84, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/_greenlet_primitives.py":87 + * greenlet_init() # pylint:disable=undefined-variable + * + * _init() # <<<<<<<<<<<<<< + * + * from gevent._util import import_c_accel + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_init_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 87, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 87, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_greenlet_primitives.py":89 + * _init() + * + * from gevent._util import import_c_accel # <<<<<<<<<<<<<< + * import_c_accel(globals(), 'gevent.__greenlet_primitives') + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 89, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_import_c_accel); + __Pyx_GIVEREF(__pyx_n_s_import_c_accel); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_import_c_accel); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_gevent__util, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 89, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_import_c_accel); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 89, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_import_c_accel, __pyx_t_1) < 0) __PYX_ERR(0, 89, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/_greenlet_primitives.py":90 + * + * from gevent._util import import_c_accel + * import_c_accel(globals(), 'gevent.__greenlet_primitives') # <<<<<<<<<<<<<< + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_import_c_accel); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 90, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_Globals(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 90, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 90, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_INCREF(__pyx_n_s_gevent___greenlet_primitives); + __Pyx_GIVEREF(__pyx_n_s_gevent___greenlet_primitives); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_n_s_gevent___greenlet_primitives); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 90, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_greenlet_primitives.py":1 + * # -*- coding: utf-8 -*- # <<<<<<<<<<<<<< + * # copyright (c) 2018 gevent. See LICENSE. + * # cython: auto_pickle=False,embedsignature=True,always_allow_keywords=False + */ + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "gevent/__greenlet_primitives.pxd":34 + * _greenlet_imported = True + * + * cdef inline object _greenlet_switch(greenlet self): # <<<<<<<<<<<<<< + * return PyGreenlet_Switch(self, NULL, NULL) + * + */ + + /*--- Wrapped vars code ---*/ + + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + if (__pyx_m) { + if (__pyx_d) { + __Pyx_AddTraceback("init gevent.__greenlet_primitives", __pyx_clineno, __pyx_lineno, __pyx_filename); + } + Py_CLEAR(__pyx_m); + } else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_ImportError, "init gevent.__greenlet_primitives"); + } + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + #if CYTHON_PEP489_MULTI_PHASE_INIT + return (__pyx_m != NULL) ? 0 : -1; + #elif PY_MAJOR_VERSION >= 3 + return __pyx_m; + #else + return; + #endif +} + +/* --- Runtime support code --- */ +/* Refnanny */ +#if CYTHON_REFNANNY +static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { + PyObject *m = NULL, *p = NULL; + void *r = NULL; + m = PyImport_ImportModule(modname); + if (!m) goto end; + p = PyObject_GetAttrString(m, "RefNannyAPI"); + if (!p) goto end; + r = PyLong_AsVoidPtr(p); +end: + Py_XDECREF(p); + Py_XDECREF(m); + return (__Pyx_RefNannyAPIStruct *)r; +} +#endif + +/* PyObjectGetAttrStr */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_getattro)) + return tp->tp_getattro(obj, attr_name); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_getattr)) + return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); +#endif + return PyObject_GetAttr(obj, attr_name); +} +#endif + +/* GetBuiltinName */ +static PyObject *__Pyx_GetBuiltinName(PyObject *name) { + PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name); + if (unlikely(!result)) { + PyErr_Format(PyExc_NameError, +#if PY_MAJOR_VERSION >= 3 + "name '%U' is not defined", name); +#else + "name '%.200s' is not defined", PyString_AS_STRING(name)); +#endif + } + return result; +} + +/* RaiseArgTupleInvalid */ +static void __Pyx_RaiseArgtupleInvalid( + const char* func_name, + int exact, + Py_ssize_t num_min, + Py_ssize_t num_max, + Py_ssize_t num_found) +{ + Py_ssize_t num_expected; + const char *more_or_less; + if (num_found < num_min) { + num_expected = num_min; + more_or_less = "at least"; + } else { + num_expected = num_max; + more_or_less = "at most"; + } + if (exact) { + more_or_less = "exactly"; + } + PyErr_Format(PyExc_TypeError, + "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", + func_name, more_or_less, num_expected, + (num_expected == 1) ? "" : "s", num_found); +} + +/* RaiseDoubleKeywords */ +static void __Pyx_RaiseDoubleKeywordsError( + const char* func_name, + PyObject* kw_name) +{ + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION >= 3 + "%s() got multiple values for keyword argument '%U'", func_name, kw_name); + #else + "%s() got multiple values for keyword argument '%s'", func_name, + PyString_AsString(kw_name)); + #endif +} + +/* ParseKeywords */ +static int __Pyx_ParseOptionalKeywords( + PyObject *kwds, + PyObject **argnames[], + PyObject *kwds2, + PyObject *values[], + Py_ssize_t num_pos_args, + const char* function_name) +{ + PyObject *key = 0, *value = 0; + Py_ssize_t pos = 0; + PyObject*** name; + PyObject*** first_kw_arg = argnames + num_pos_args; + while (PyDict_Next(kwds, &pos, &key, &value)) { + name = first_kw_arg; + while (*name && (**name != key)) name++; + if (*name) { + values[name-argnames] = value; + continue; + } + name = first_kw_arg; + #if PY_MAJOR_VERSION < 3 + if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) { + while (*name) { + if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) + && _PyString_Eq(**name, key)) { + values[name-argnames] = value; + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + if ((**argname == key) || ( + (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) + && _PyString_Eq(**argname, key))) { + goto arg_passed_twice; + } + argname++; + } + } + } else + #endif + if (likely(PyUnicode_Check(key))) { + while (*name) { + int cmp = (**name == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 : + #endif + PyUnicode_Compare(**name, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) { + values[name-argnames] = value; + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + int cmp = (**argname == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 : + #endif + PyUnicode_Compare(**argname, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) goto arg_passed_twice; + argname++; + } + } + } else + goto invalid_keyword_type; + if (kwds2) { + if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; + } else { + goto invalid_keyword; + } + } + return 0; +arg_passed_twice: + __Pyx_RaiseDoubleKeywordsError(function_name, key); + goto bad; +invalid_keyword_type: + PyErr_Format(PyExc_TypeError, + "%.200s() keywords must be strings", function_name); + goto bad; +invalid_keyword: + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION < 3 + "%.200s() got an unexpected keyword argument '%.200s'", + function_name, PyString_AsString(key)); + #else + "%s() got an unexpected keyword argument '%U'", + function_name, key); + #endif +bad: + return -1; +} + +/* PyFunctionFastCall */ +#if CYTHON_FAST_PYCALL +static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, + PyObject *globals) { + PyFrameObject *f; + PyThreadState *tstate = __Pyx_PyThreadState_Current; + PyObject **fastlocals; + Py_ssize_t i; + PyObject *result; + assert(globals != NULL); + /* XXX Perhaps we should create a specialized + PyFrame_New() that doesn't take locals, but does + take builtins without sanity checking them. + */ + assert(tstate != NULL); + f = PyFrame_New(tstate, co, globals, NULL); + if (f == NULL) { + return NULL; + } + fastlocals = __Pyx_PyFrame_GetLocalsplus(f); + for (i = 0; i < na; i++) { + Py_INCREF(*args); + fastlocals[i] = *args++; + } + result = PyEval_EvalFrameEx(f,0); + ++tstate->recursion_depth; + Py_DECREF(f); + --tstate->recursion_depth; + return result; +} +#if 1 || PY_VERSION_HEX < 0x030600B1 +static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs) { + PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); + PyObject *globals = PyFunction_GET_GLOBALS(func); + PyObject *argdefs = PyFunction_GET_DEFAULTS(func); + PyObject *closure; +#if PY_MAJOR_VERSION >= 3 + PyObject *kwdefs; +#endif + PyObject *kwtuple, **k; + PyObject **d; + Py_ssize_t nd; + Py_ssize_t nk; + PyObject *result; + assert(kwargs == NULL || PyDict_Check(kwargs)); + nk = kwargs ? PyDict_Size(kwargs) : 0; + if (Py_EnterRecursiveCall((char*)" while calling a Python object")) { + return NULL; + } + if ( +#if PY_MAJOR_VERSION >= 3 + co->co_kwonlyargcount == 0 && +#endif + likely(kwargs == NULL || nk == 0) && + co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { + if (argdefs == NULL && co->co_argcount == nargs) { + result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); + goto done; + } + else if (nargs == 0 && argdefs != NULL + && co->co_argcount == Py_SIZE(argdefs)) { + /* function called with no arguments, but all parameters have + a default value: use default values as arguments .*/ + args = &PyTuple_GET_ITEM(argdefs, 0); + result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); + goto done; + } + } + if (kwargs != NULL) { + Py_ssize_t pos, i; + kwtuple = PyTuple_New(2 * nk); + if (kwtuple == NULL) { + result = NULL; + goto done; + } + k = &PyTuple_GET_ITEM(kwtuple, 0); + pos = i = 0; + while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { + Py_INCREF(k[i]); + Py_INCREF(k[i+1]); + i += 2; + } + nk = i / 2; + } + else { + kwtuple = NULL; + k = NULL; + } + closure = PyFunction_GET_CLOSURE(func); +#if PY_MAJOR_VERSION >= 3 + kwdefs = PyFunction_GET_KW_DEFAULTS(func); +#endif + if (argdefs != NULL) { + d = &PyTuple_GET_ITEM(argdefs, 0); + nd = Py_SIZE(argdefs); + } + else { + d = NULL; + nd = 0; + } +#if PY_MAJOR_VERSION >= 3 + result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, + args, nargs, + k, (int)nk, + d, (int)nd, kwdefs, closure); +#else + result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, + args, nargs, + k, (int)nk, + d, (int)nd, closure); +#endif + Py_XDECREF(kwtuple); +done: + Py_LeaveRecursiveCall(); + return result; +} +#endif +#endif + +/* PyCFunctionFastCall */ +#if CYTHON_FAST_PYCCALL +static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) { + PyCFunctionObject *func = (PyCFunctionObject*)func_obj; + PyCFunction meth = PyCFunction_GET_FUNCTION(func); + PyObject *self = PyCFunction_GET_SELF(func); + int flags = PyCFunction_GET_FLAGS(func); + assert(PyCFunction_Check(func)); + assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS))); + assert(nargs >= 0); + assert(nargs == 0 || args != NULL); + /* _PyCFunction_FastCallDict() must not be called with an exception set, + because it may clear it (directly or indirectly) and so the + caller loses its exception */ + assert(!PyErr_Occurred()); + if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) { + return (*((__Pyx_PyCFunctionFastWithKeywords)(void*)meth)) (self, args, nargs, NULL); + } else { + return (*((__Pyx_PyCFunctionFast)(void*)meth)) (self, args, nargs); + } +} +#endif + +/* PyObjectCall */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { + PyObject *result; + ternaryfunc call = func->ob_type->tp_call; + if (unlikely(!call)) + return PyObject_Call(func, arg, kw); + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; + result = (*call)(func, arg, kw); + Py_LeaveRecursiveCall(); + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +/* PyObjectCall2Args */ +static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) { + PyObject *args, *result = NULL; + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(function)) { + PyObject *args[2] = {arg1, arg2}; + return __Pyx_PyFunction_FastCall(function, args, 2); + } + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(function)) { + PyObject *args[2] = {arg1, arg2}; + return __Pyx_PyCFunction_FastCall(function, args, 2); + } + #endif + args = PyTuple_New(2); + if (unlikely(!args)) goto done; + Py_INCREF(arg1); + PyTuple_SET_ITEM(args, 0, arg1); + Py_INCREF(arg2); + PyTuple_SET_ITEM(args, 1, arg2); + Py_INCREF(function); + result = __Pyx_PyObject_Call(function, args, NULL); + Py_DECREF(args); + Py_DECREF(function); +done: + return result; +} + +/* PyObjectCallMethO */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { + PyObject *self, *result; + PyCFunction cfunc; + cfunc = PyCFunction_GET_FUNCTION(func); + self = PyCFunction_GET_SELF(func); + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; + result = cfunc(self, arg); + Py_LeaveRecursiveCall(); + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +/* PyObjectCallOneArg */ +#if CYTHON_COMPILING_IN_CPYTHON +static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) { + PyObject *result; + PyObject *args = PyTuple_New(1); + if (unlikely(!args)) return NULL; + Py_INCREF(arg); + PyTuple_SET_ITEM(args, 0, arg); + result = __Pyx_PyObject_Call(func, args, NULL); + Py_DECREF(args); + return result; +} +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { +#if CYTHON_FAST_PYCALL + if (PyFunction_Check(func)) { + return __Pyx_PyFunction_FastCall(func, &arg, 1); + } +#endif + if (likely(PyCFunction_Check(func))) { + if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) { + return __Pyx_PyObject_CallMethO(func, arg); +#if CYTHON_FAST_PYCCALL + } else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) { + return __Pyx_PyCFunction_FastCall(func, &arg, 1); +#endif + } + } + return __Pyx__PyObject_CallOneArg(func, arg); +} +#else +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { + PyObject *result; + PyObject *args = PyTuple_Pack(1, arg); + if (unlikely(!args)) return NULL; + result = __Pyx_PyObject_Call(func, args, NULL); + Py_DECREF(args); + return result; +} +#endif + +/* PyObjectSetAttrStr */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) { + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_setattro)) + return tp->tp_setattro(obj, attr_name, value); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_setattr)) + return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value); +#endif + return PyObject_SetAttr(obj, attr_name, value); +} +#endif + +/* GetTopmostException */ +#if CYTHON_USE_EXC_INFO_STACK +static _PyErr_StackItem * +__Pyx_PyErr_GetTopmostException(PyThreadState *tstate) +{ + _PyErr_StackItem *exc_info = tstate->exc_info; + while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) && + exc_info->previous_item != NULL) + { + exc_info = exc_info->previous_item; + } + return exc_info; +} +#endif + +/* SaveResetException */ +#if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { + #if CYTHON_USE_EXC_INFO_STACK + _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate); + *type = exc_info->exc_type; + *value = exc_info->exc_value; + *tb = exc_info->exc_traceback; + #else + *type = tstate->exc_type; + *value = tstate->exc_value; + *tb = tstate->exc_traceback; + #endif + Py_XINCREF(*type); + Py_XINCREF(*value); + Py_XINCREF(*tb); +} +static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + #if CYTHON_USE_EXC_INFO_STACK + _PyErr_StackItem *exc_info = tstate->exc_info; + tmp_type = exc_info->exc_type; + tmp_value = exc_info->exc_value; + tmp_tb = exc_info->exc_traceback; + exc_info->exc_type = type; + exc_info->exc_value = value; + exc_info->exc_traceback = tb; + #else + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = type; + tstate->exc_value = value; + tstate->exc_traceback = tb; + #endif + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +} +#endif + +/* PyErrExceptionMatches */ +#if CYTHON_FAST_THREAD_STATE +static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { + Py_ssize_t i, n; + n = PyTuple_GET_SIZE(tuple); +#if PY_MAJOR_VERSION >= 3 + for (i=0; icurexc_type; + if (exc_type == err) return 1; + if (unlikely(!exc_type)) return 0; + if (unlikely(PyTuple_Check(err))) + return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err); + return __Pyx_PyErr_GivenExceptionMatches(exc_type, err); +} +#endif + +/* GetException */ +#if CYTHON_FAST_THREAD_STATE +static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) +#else +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) +#endif +{ + PyObject *local_type, *local_value, *local_tb; +#if CYTHON_FAST_THREAD_STATE + PyObject *tmp_type, *tmp_value, *tmp_tb; + local_type = tstate->curexc_type; + local_value = tstate->curexc_value; + local_tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +#else + PyErr_Fetch(&local_type, &local_value, &local_tb); +#endif + PyErr_NormalizeException(&local_type, &local_value, &local_tb); +#if CYTHON_FAST_THREAD_STATE + if (unlikely(tstate->curexc_type)) +#else + if (unlikely(PyErr_Occurred())) +#endif + goto bad; + #if PY_MAJOR_VERSION >= 3 + if (local_tb) { + if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) + goto bad; + } + #endif + Py_XINCREF(local_tb); + Py_XINCREF(local_type); + Py_XINCREF(local_value); + *type = local_type; + *value = local_value; + *tb = local_tb; +#if CYTHON_FAST_THREAD_STATE + #if CYTHON_USE_EXC_INFO_STACK + { + _PyErr_StackItem *exc_info = tstate->exc_info; + tmp_type = exc_info->exc_type; + tmp_value = exc_info->exc_value; + tmp_tb = exc_info->exc_traceback; + exc_info->exc_type = local_type; + exc_info->exc_value = local_value; + exc_info->exc_traceback = local_tb; + } + #else + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = local_type; + tstate->exc_value = local_value; + tstate->exc_traceback = local_tb; + #endif + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#else + PyErr_SetExcInfo(local_type, local_value, local_tb); +#endif + return 0; +bad: + *type = 0; + *value = 0; + *tb = 0; + Py_XDECREF(local_type); + Py_XDECREF(local_value); + Py_XDECREF(local_tb); + return -1; +} + +/* PyObjectCallNoArg */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { +#if CYTHON_FAST_PYCALL + if (PyFunction_Check(func)) { + return __Pyx_PyFunction_FastCall(func, NULL, 0); + } +#endif +#ifdef __Pyx_CyFunction_USED + if (likely(PyCFunction_Check(func) || __Pyx_CyFunction_Check(func))) +#else + if (likely(PyCFunction_Check(func))) +#endif + { + if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) { + return __Pyx_PyObject_CallMethO(func, NULL); + } + } + return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL); +} +#endif + +/* PyErrFetchRestore */ +#if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + tmp_type = tstate->curexc_type; + tmp_value = tstate->curexc_value; + tmp_tb = tstate->curexc_traceback; + tstate->curexc_type = type; + tstate->curexc_value = value; + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +} +static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { + *type = tstate->curexc_type; + *value = tstate->curexc_value; + *tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +} +#endif + +/* GetAttr */ +static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) { +#if CYTHON_USE_TYPE_SLOTS +#if PY_MAJOR_VERSION >= 3 + if (likely(PyUnicode_Check(n))) +#else + if (likely(PyString_Check(n))) +#endif + return __Pyx_PyObject_GetAttrStr(o, n); +#endif + return PyObject_GetAttr(o, n); +} + +/* GetAttr3 */ +static PyObject *__Pyx_GetAttr3Default(PyObject *d) { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) + return NULL; + __Pyx_PyErr_Clear(); + Py_INCREF(d); + return d; +} +static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) { + PyObject *r = __Pyx_GetAttr(o, n); + return (likely(r)) ? r : __Pyx_GetAttr3Default(d); +} + +/* RaiseException */ +#if PY_MAJOR_VERSION < 3 +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, + CYTHON_UNUSED PyObject *cause) { + __Pyx_PyThreadState_declare + Py_XINCREF(type); + if (!value || value == Py_None) + value = NULL; + else + Py_INCREF(value); + if (!tb || tb == Py_None) + tb = NULL; + else { + Py_INCREF(tb); + if (!PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto raise_error; + } + } + if (PyType_Check(type)) { +#if CYTHON_COMPILING_IN_PYPY + if (!value) { + Py_INCREF(Py_None); + value = Py_None; + } +#endif + PyErr_NormalizeException(&type, &value, &tb); + } else { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto raise_error; + } + value = type; + type = (PyObject*) Py_TYPE(type); + Py_INCREF(type); + if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto raise_error; + } + } + __Pyx_PyThreadState_assign + __Pyx_ErrRestore(type, value, tb); + return; +raise_error: + Py_XDECREF(value); + Py_XDECREF(type); + Py_XDECREF(tb); + return; +} +#else +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { + PyObject* owned_instance = NULL; + if (tb == Py_None) { + tb = 0; + } else if (tb && !PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto bad; + } + if (value == Py_None) + value = 0; + if (PyExceptionInstance_Check(type)) { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto bad; + } + value = type; + type = (PyObject*) Py_TYPE(value); + } else if (PyExceptionClass_Check(type)) { + PyObject *instance_class = NULL; + if (value && PyExceptionInstance_Check(value)) { + instance_class = (PyObject*) Py_TYPE(value); + if (instance_class != type) { + int is_subclass = PyObject_IsSubclass(instance_class, type); + if (!is_subclass) { + instance_class = NULL; + } else if (unlikely(is_subclass == -1)) { + goto bad; + } else { + type = instance_class; + } + } + } + if (!instance_class) { + PyObject *args; + if (!value) + args = PyTuple_New(0); + else if (PyTuple_Check(value)) { + Py_INCREF(value); + args = value; + } else + args = PyTuple_Pack(1, value); + if (!args) + goto bad; + owned_instance = PyObject_Call(type, args, NULL); + Py_DECREF(args); + if (!owned_instance) + goto bad; + value = owned_instance; + if (!PyExceptionInstance_Check(value)) { + PyErr_Format(PyExc_TypeError, + "calling %R should have returned an instance of " + "BaseException, not %R", + type, Py_TYPE(value)); + goto bad; + } + } + } else { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto bad; + } + if (cause) { + PyObject *fixed_cause; + if (cause == Py_None) { + fixed_cause = NULL; + } else if (PyExceptionClass_Check(cause)) { + fixed_cause = PyObject_CallObject(cause, NULL); + if (fixed_cause == NULL) + goto bad; + } else if (PyExceptionInstance_Check(cause)) { + fixed_cause = cause; + Py_INCREF(fixed_cause); + } else { + PyErr_SetString(PyExc_TypeError, + "exception causes must derive from " + "BaseException"); + goto bad; + } + PyException_SetCause(value, fixed_cause); + } + PyErr_SetObject(type, value); + if (tb) { +#if CYTHON_COMPILING_IN_PYPY + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); + Py_INCREF(tb); + PyErr_Restore(tmp_type, tmp_value, tb); + Py_XDECREF(tmp_tb); +#else + PyThreadState *tstate = __Pyx_PyThreadState_Current; + PyObject* tmp_tb = tstate->curexc_traceback; + if (tb != tmp_tb) { + Py_INCREF(tb); + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_tb); + } +#endif + } +bad: + Py_XDECREF(owned_instance); + return; +} +#endif + +/* CallNextTpDealloc */ +static void __Pyx_call_next_tp_dealloc(PyObject* obj, destructor current_tp_dealloc) { + PyTypeObject* type = Py_TYPE(obj); + while (type && type->tp_dealloc != current_tp_dealloc) + type = type->tp_base; + while (type && type->tp_dealloc == current_tp_dealloc) + type = type->tp_base; + if (type) + type->tp_dealloc(obj); +} + +/* CallNextTpTraverse */ +static int __Pyx_call_next_tp_traverse(PyObject* obj, visitproc v, void *a, traverseproc current_tp_traverse) { + PyTypeObject* type = Py_TYPE(obj); + while (type && type->tp_traverse != current_tp_traverse) + type = type->tp_base; + while (type && type->tp_traverse == current_tp_traverse) + type = type->tp_base; + if (type && type->tp_traverse) + return type->tp_traverse(obj, v, a); + return 0; +} + +/* CallNextTpClear */ +static void __Pyx_call_next_tp_clear(PyObject* obj, inquiry current_tp_clear) { + PyTypeObject* type = Py_TYPE(obj); + while (type && type->tp_clear != current_tp_clear) + type = type->tp_base; + while (type && type->tp_clear == current_tp_clear) + type = type->tp_base; + if (type && type->tp_clear) + type->tp_clear(obj); +} + +/* TypeImport */ +#ifndef __PYX_HAVE_RT_ImportType +#define __PYX_HAVE_RT_ImportType +static PyTypeObject *__Pyx_ImportType(PyObject *module, const char *module_name, const char *class_name, + size_t size, enum __Pyx_ImportType_CheckSize check_size) +{ + PyObject *result = 0; + char warning[200]; + Py_ssize_t basicsize; +#ifdef Py_LIMITED_API + PyObject *py_basicsize; +#endif + result = PyObject_GetAttrString(module, class_name); + if (!result) + goto bad; + if (!PyType_Check(result)) { + PyErr_Format(PyExc_TypeError, + "%.200s.%.200s is not a type object", + module_name, class_name); + goto bad; + } +#ifndef Py_LIMITED_API + basicsize = ((PyTypeObject *)result)->tp_basicsize; +#else + py_basicsize = PyObject_GetAttrString(result, "__basicsize__"); + if (!py_basicsize) + goto bad; + basicsize = PyLong_AsSsize_t(py_basicsize); + Py_DECREF(py_basicsize); + py_basicsize = 0; + if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred()) + goto bad; +#endif + if ((size_t)basicsize < size) { + PyErr_Format(PyExc_ValueError, + "%.200s.%.200s size changed, may indicate binary incompatibility. " + "Expected %zd from C header, got %zd from PyObject", + module_name, class_name, size, basicsize); + goto bad; + } + if (check_size == __Pyx_ImportType_CheckSize_Error && (size_t)basicsize != size) { + PyErr_Format(PyExc_ValueError, + "%.200s.%.200s size changed, may indicate binary incompatibility. " + "Expected %zd from C header, got %zd from PyObject", + module_name, class_name, size, basicsize); + goto bad; + } + else if (check_size == __Pyx_ImportType_CheckSize_Warn && (size_t)basicsize > size) { + PyOS_snprintf(warning, sizeof(warning), + "%s.%s size changed, may indicate binary incompatibility. " + "Expected %zd from C header, got %zd from PyObject", + module_name, class_name, size, basicsize); + if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad; + } + return (PyTypeObject *)result; +bad: + Py_XDECREF(result); + return NULL; +} +#endif + +/* PyObject_GenericGetAttrNoDict */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) { + PyErr_Format(PyExc_AttributeError, +#if PY_MAJOR_VERSION >= 3 + "'%.50s' object has no attribute '%U'", + tp->tp_name, attr_name); +#else + "'%.50s' object has no attribute '%.400s'", + tp->tp_name, PyString_AS_STRING(attr_name)); +#endif + return NULL; +} +static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) { + PyObject *descr; + PyTypeObject *tp = Py_TYPE(obj); + if (unlikely(!PyString_Check(attr_name))) { + return PyObject_GenericGetAttr(obj, attr_name); + } + assert(!tp->tp_dictoffset); + descr = _PyType_Lookup(tp, attr_name); + if (unlikely(!descr)) { + return __Pyx_RaiseGenericGetAttributeError(tp, attr_name); + } + Py_INCREF(descr); + #if PY_MAJOR_VERSION < 3 + if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS))) + #endif + { + descrgetfunc f = Py_TYPE(descr)->tp_descr_get; + if (unlikely(f)) { + PyObject *res = f(descr, obj, (PyObject *)tp); + Py_DECREF(descr); + return res; + } + } + return descr; +} +#endif + +/* PyObject_GenericGetAttr */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) { + if (unlikely(Py_TYPE(obj)->tp_dictoffset)) { + return PyObject_GenericGetAttr(obj, attr_name); + } + return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name); +} +#endif + +/* SetVTable */ +static int __Pyx_SetVtable(PyObject *dict, void *vtable) { +#if PY_VERSION_HEX >= 0x02070000 + PyObject *ob = PyCapsule_New(vtable, 0, 0); +#else + PyObject *ob = PyCObject_FromVoidPtr(vtable, 0); +#endif + if (!ob) + goto bad; + if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0) + goto bad; + Py_DECREF(ob); + return 0; +bad: + Py_XDECREF(ob); + return -1; +} + +/* Import */ +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { + PyObject *empty_list = 0; + PyObject *module = 0; + PyObject *global_dict = 0; + PyObject *empty_dict = 0; + PyObject *list; + #if PY_MAJOR_VERSION < 3 + PyObject *py_import; + py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); + if (!py_import) + goto bad; + #endif + if (from_list) + list = from_list; + else { + empty_list = PyList_New(0); + if (!empty_list) + goto bad; + list = empty_list; + } + global_dict = PyModule_GetDict(__pyx_m); + if (!global_dict) + goto bad; + empty_dict = PyDict_New(); + if (!empty_dict) + goto bad; + { + #if PY_MAJOR_VERSION >= 3 + if (level == -1) { + if (strchr(__Pyx_MODULE_NAME, '.')) { + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, 1); + if (!module) { + if (!PyErr_ExceptionMatches(PyExc_ImportError)) + goto bad; + PyErr_Clear(); + } + } + level = 0; + } + #endif + if (!module) { + #if PY_MAJOR_VERSION < 3 + PyObject *py_level = PyInt_FromLong(level); + if (!py_level) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, py_level, (PyObject *)NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, level); + #endif + } + } +bad: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(py_import); + #endif + Py_XDECREF(empty_list); + Py_XDECREF(empty_dict); + return module; +} + +/* ImportFrom */ +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { + PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); + if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_Format(PyExc_ImportError, + #if PY_MAJOR_VERSION < 3 + "cannot import name %.230s", PyString_AS_STRING(name)); + #else + "cannot import name %S", name); + #endif + } + return value; +} + +/* FetchCommonType */ +static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { + PyObject* fake_module; + PyTypeObject* cached_type = NULL; + fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI); + if (!fake_module) return NULL; + Py_INCREF(fake_module); + cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name); + if (cached_type) { + if (!PyType_Check((PyObject*)cached_type)) { + PyErr_Format(PyExc_TypeError, + "Shared Cython type %.200s is not a type object", + type->tp_name); + goto bad; + } + if (cached_type->tp_basicsize != type->tp_basicsize) { + PyErr_Format(PyExc_TypeError, + "Shared Cython type %.200s has the wrong size, try recompiling", + type->tp_name); + goto bad; + } + } else { + if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; + PyErr_Clear(); + if (PyType_Ready(type) < 0) goto bad; + if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0) + goto bad; + Py_INCREF(type); + cached_type = type; + } +done: + Py_DECREF(fake_module); + return cached_type; +bad: + Py_XDECREF(cached_type); + cached_type = NULL; + goto done; +} + +/* CythonFunction */ +#include +static PyObject * +__Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure) +{ + if (unlikely(op->func_doc == NULL)) { + if (op->func.m_ml->ml_doc) { +#if PY_MAJOR_VERSION >= 3 + op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc); +#else + op->func_doc = PyString_FromString(op->func.m_ml->ml_doc); +#endif + if (unlikely(op->func_doc == NULL)) + return NULL; + } else { + Py_INCREF(Py_None); + return Py_None; + } + } + Py_INCREF(op->func_doc); + return op->func_doc; +} +static int +__Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context) +{ + PyObject *tmp = op->func_doc; + if (value == NULL) { + value = Py_None; + } + Py_INCREF(value); + op->func_doc = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + if (unlikely(op->func_name == NULL)) { +#if PY_MAJOR_VERSION >= 3 + op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name); +#else + op->func_name = PyString_InternFromString(op->func.m_ml->ml_name); +#endif + if (unlikely(op->func_name == NULL)) + return NULL; + } + Py_INCREF(op->func_name); + return op->func_name; +} +static int +__Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context) +{ + PyObject *tmp; +#if PY_MAJOR_VERSION >= 3 + if (unlikely(value == NULL || !PyUnicode_Check(value))) +#else + if (unlikely(value == NULL || !PyString_Check(value))) +#endif + { + PyErr_SetString(PyExc_TypeError, + "__name__ must be set to a string object"); + return -1; + } + tmp = op->func_name; + Py_INCREF(value); + op->func_name = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + Py_INCREF(op->func_qualname); + return op->func_qualname; +} +static int +__Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context) +{ + PyObject *tmp; +#if PY_MAJOR_VERSION >= 3 + if (unlikely(value == NULL || !PyUnicode_Check(value))) +#else + if (unlikely(value == NULL || !PyString_Check(value))) +#endif + { + PyErr_SetString(PyExc_TypeError, + "__qualname__ must be set to a string object"); + return -1; + } + tmp = op->func_qualname; + Py_INCREF(value); + op->func_qualname = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED void *closure) +{ + PyObject *self; + self = m->func_closure; + if (self == NULL) + self = Py_None; + Py_INCREF(self); + return self; +} +static PyObject * +__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + if (unlikely(op->func_dict == NULL)) { + op->func_dict = PyDict_New(); + if (unlikely(op->func_dict == NULL)) + return NULL; + } + Py_INCREF(op->func_dict); + return op->func_dict; +} +static int +__Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context) +{ + PyObject *tmp; + if (unlikely(value == NULL)) { + PyErr_SetString(PyExc_TypeError, + "function's dictionary may not be deleted"); + return -1; + } + if (unlikely(!PyDict_Check(value))) { + PyErr_SetString(PyExc_TypeError, + "setting function's dictionary to a non-dict"); + return -1; + } + tmp = op->func_dict; + Py_INCREF(value); + op->func_dict = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + Py_INCREF(op->func_globals); + return op->func_globals; +} +static PyObject * +__Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + Py_INCREF(Py_None); + return Py_None; +} +static PyObject * +__Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + PyObject* result = (op->func_code) ? op->func_code : Py_None; + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { + int result = 0; + PyObject *res = op->defaults_getter((PyObject *) op); + if (unlikely(!res)) + return -1; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + op->defaults_tuple = PyTuple_GET_ITEM(res, 0); + Py_INCREF(op->defaults_tuple); + op->defaults_kwdict = PyTuple_GET_ITEM(res, 1); + Py_INCREF(op->defaults_kwdict); + #else + op->defaults_tuple = PySequence_ITEM(res, 0); + if (unlikely(!op->defaults_tuple)) result = -1; + else { + op->defaults_kwdict = PySequence_ITEM(res, 1); + if (unlikely(!op->defaults_kwdict)) result = -1; + } + #endif + Py_DECREF(res); + return result; +} +static int +__Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) { + PyObject* tmp; + if (!value) { + value = Py_None; + } else if (value != Py_None && !PyTuple_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__defaults__ must be set to a tuple object"); + return -1; + } + Py_INCREF(value); + tmp = op->defaults_tuple; + op->defaults_tuple = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) { + PyObject* result = op->defaults_tuple; + if (unlikely(!result)) { + if (op->defaults_getter) { + if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL; + result = op->defaults_tuple; + } else { + result = Py_None; + } + } + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) { + PyObject* tmp; + if (!value) { + value = Py_None; + } else if (value != Py_None && !PyDict_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__kwdefaults__ must be set to a dict object"); + return -1; + } + Py_INCREF(value); + tmp = op->defaults_kwdict; + op->defaults_kwdict = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) { + PyObject* result = op->defaults_kwdict; + if (unlikely(!result)) { + if (op->defaults_getter) { + if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL; + result = op->defaults_kwdict; + } else { + result = Py_None; + } + } + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) { + PyObject* tmp; + if (!value || value == Py_None) { + value = NULL; + } else if (!PyDict_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__annotations__ must be set to a dict object"); + return -1; + } + Py_XINCREF(value); + tmp = op->func_annotations; + op->func_annotations = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) { + PyObject* result = op->func_annotations; + if (unlikely(!result)) { + result = PyDict_New(); + if (unlikely(!result)) return NULL; + op->func_annotations = result; + } + Py_INCREF(result); + return result; +} +static PyGetSetDef __pyx_CyFunction_getsets[] = { + {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, + {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, + {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, + {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, + {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, + {(char *) "__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0}, + {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, + {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, + {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, + {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, + {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, + {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, + {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, + {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, + {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, + {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, + {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, + {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, + {0, 0, 0, 0, 0} +}; +static PyMemberDef __pyx_CyFunction_members[] = { + {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), PY_WRITE_RESTRICTED, 0}, + {0, 0, 0, 0, 0} +}; +static PyObject * +__Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args) +{ +#if PY_MAJOR_VERSION >= 3 + return PyUnicode_FromString(m->func.m_ml->ml_name); +#else + return PyString_FromString(m->func.m_ml->ml_name); +#endif +} +static PyMethodDef __pyx_CyFunction_methods[] = { + {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, + {0, 0, 0, 0} +}; +#if PY_VERSION_HEX < 0x030500A0 +#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist) +#else +#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func.m_weakreflist) +#endif +static PyObject *__Pyx_CyFunction_New(PyTypeObject *type, PyMethodDef *ml, int flags, PyObject* qualname, + PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { + __pyx_CyFunctionObject *op = PyObject_GC_New(__pyx_CyFunctionObject, type); + if (op == NULL) + return NULL; + op->flags = flags; + __Pyx_CyFunction_weakreflist(op) = NULL; + op->func.m_ml = ml; + op->func.m_self = (PyObject *) op; + Py_XINCREF(closure); + op->func_closure = closure; + Py_XINCREF(module); + op->func.m_module = module; + op->func_dict = NULL; + op->func_name = NULL; + Py_INCREF(qualname); + op->func_qualname = qualname; + op->func_doc = NULL; + op->func_classobj = NULL; + op->func_globals = globals; + Py_INCREF(op->func_globals); + Py_XINCREF(code); + op->func_code = code; + op->defaults_pyobjects = 0; + op->defaults = NULL; + op->defaults_tuple = NULL; + op->defaults_kwdict = NULL; + op->defaults_getter = NULL; + op->func_annotations = NULL; + PyObject_GC_Track(op); + return (PyObject *) op; +} +static int +__Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) +{ + Py_CLEAR(m->func_closure); + Py_CLEAR(m->func.m_module); + Py_CLEAR(m->func_dict); + Py_CLEAR(m->func_name); + Py_CLEAR(m->func_qualname); + Py_CLEAR(m->func_doc); + Py_CLEAR(m->func_globals); + Py_CLEAR(m->func_code); + Py_CLEAR(m->func_classobj); + Py_CLEAR(m->defaults_tuple); + Py_CLEAR(m->defaults_kwdict); + Py_CLEAR(m->func_annotations); + if (m->defaults) { + PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); + int i; + for (i = 0; i < m->defaults_pyobjects; i++) + Py_XDECREF(pydefaults[i]); + PyObject_Free(m->defaults); + m->defaults = NULL; + } + return 0; +} +static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m) +{ + if (__Pyx_CyFunction_weakreflist(m) != NULL) + PyObject_ClearWeakRefs((PyObject *) m); + __Pyx_CyFunction_clear(m); + PyObject_GC_Del(m); +} +static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) +{ + PyObject_GC_UnTrack(m); + __Pyx__CyFunction_dealloc(m); +} +static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) +{ + Py_VISIT(m->func_closure); + Py_VISIT(m->func.m_module); + Py_VISIT(m->func_dict); + Py_VISIT(m->func_name); + Py_VISIT(m->func_qualname); + Py_VISIT(m->func_doc); + Py_VISIT(m->func_globals); + Py_VISIT(m->func_code); + Py_VISIT(m->func_classobj); + Py_VISIT(m->defaults_tuple); + Py_VISIT(m->defaults_kwdict); + if (m->defaults) { + PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); + int i; + for (i = 0; i < m->defaults_pyobjects; i++) + Py_VISIT(pydefaults[i]); + } + return 0; +} +static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type) +{ + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) { + Py_INCREF(func); + return func; + } + if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) { + if (type == NULL) + type = (PyObject *)(Py_TYPE(obj)); + return __Pyx_PyMethod_New(func, type, (PyObject *)(Py_TYPE(type))); + } + if (obj == Py_None) + obj = NULL; + return __Pyx_PyMethod_New(func, obj, type); +} +static PyObject* +__Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) +{ +#if PY_MAJOR_VERSION >= 3 + return PyUnicode_FromFormat("", + op->func_qualname, (void *)op); +#else + return PyString_FromFormat("", + PyString_AsString(op->func_qualname), (void *)op); +#endif +} +static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) { + PyCFunctionObject* f = (PyCFunctionObject*)func; + PyCFunction meth = f->m_ml->ml_meth; + Py_ssize_t size; + switch (f->m_ml->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) { + case METH_VARARGS: + if (likely(kw == NULL || PyDict_Size(kw) == 0)) + return (*meth)(self, arg); + break; + case METH_VARARGS | METH_KEYWORDS: + return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw); + case METH_NOARGS: + if (likely(kw == NULL || PyDict_Size(kw) == 0)) { + size = PyTuple_GET_SIZE(arg); + if (likely(size == 0)) + return (*meth)(self, NULL); + PyErr_Format(PyExc_TypeError, + "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", + f->m_ml->ml_name, size); + return NULL; + } + break; + case METH_O: + if (likely(kw == NULL || PyDict_Size(kw) == 0)) { + size = PyTuple_GET_SIZE(arg); + if (likely(size == 1)) { + PyObject *result, *arg0; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + arg0 = PyTuple_GET_ITEM(arg, 0); + #else + arg0 = PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL; + #endif + result = (*meth)(self, arg0); + #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) + Py_DECREF(arg0); + #endif + return result; + } + PyErr_Format(PyExc_TypeError, + "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", + f->m_ml->ml_name, size); + return NULL; + } + break; + default: + PyErr_SetString(PyExc_SystemError, "Bad call flags in " + "__Pyx_CyFunction_Call. METH_OLDARGS is no " + "longer supported!"); + return NULL; + } + PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", + f->m_ml->ml_name); + return NULL; +} +static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { + return __Pyx_CyFunction_CallMethod(func, ((PyCFunctionObject*)func)->m_self, arg, kw); +} +static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) { + PyObject *result; + __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func; + if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { + Py_ssize_t argc; + PyObject *new_args; + PyObject *self; + argc = PyTuple_GET_SIZE(args); + new_args = PyTuple_GetSlice(args, 1, argc); + if (unlikely(!new_args)) + return NULL; + self = PyTuple_GetItem(args, 0); + if (unlikely(!self)) { + Py_DECREF(new_args); + return NULL; + } + result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw); + Py_DECREF(new_args); + } else { + result = __Pyx_CyFunction_Call(func, args, kw); + } + return result; +} +static PyTypeObject __pyx_CyFunctionType_type = { + PyVarObject_HEAD_INIT(0, 0) + "cython_function_or_method", + sizeof(__pyx_CyFunctionObject), + 0, + (destructor) __Pyx_CyFunction_dealloc, + 0, + 0, + 0, +#if PY_MAJOR_VERSION < 3 + 0, +#else + 0, +#endif + (reprfunc) __Pyx_CyFunction_repr, + 0, + 0, + 0, + 0, + __Pyx_CyFunction_CallAsMethod, + 0, + 0, + 0, + 0, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, + 0, + (traverseproc) __Pyx_CyFunction_traverse, + (inquiry) __Pyx_CyFunction_clear, + 0, +#if PY_VERSION_HEX < 0x030500A0 + offsetof(__pyx_CyFunctionObject, func_weakreflist), +#else + offsetof(PyCFunctionObject, m_weakreflist), +#endif + 0, + 0, + __pyx_CyFunction_methods, + __pyx_CyFunction_members, + __pyx_CyFunction_getsets, + 0, + 0, + __Pyx_CyFunction_descr_get, + 0, + offsetof(__pyx_CyFunctionObject, func_dict), + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, +#if PY_VERSION_HEX >= 0x030400a1 + 0, +#endif +}; +static int __pyx_CyFunction_init(void) { + __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); + if (unlikely(__pyx_CyFunctionType == NULL)) { + return -1; + } + return 0; +} +static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults = PyObject_Malloc(size); + if (unlikely(!m->defaults)) + return PyErr_NoMemory(); + memset(m->defaults, 0, size); + m->defaults_pyobjects = pyobjects; + return m->defaults; +} +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults_tuple = tuple; + Py_INCREF(tuple); +} +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults_kwdict = dict; + Py_INCREF(dict); +} +static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->func_annotations = dict; + Py_INCREF(dict); +} + +/* GetModuleGlobalName */ +#if CYTHON_USE_DICT_VERSIONS +static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value) +#else +static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) +#endif +{ + PyObject *result; +#if !CYTHON_AVOID_BORROWED_REFS +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 + result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } else if (unlikely(PyErr_Occurred())) { + return NULL; + } +#else + result = PyDict_GetItem(__pyx_d, name); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } +#endif +#else + result = PyObject_GetItem(__pyx_d, name); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } + PyErr_Clear(); +#endif + return __Pyx_GetBuiltinName(name); +} + +/* Globals */ +static PyObject* __Pyx_Globals(void) { + Py_ssize_t i; + PyObject *names; + PyObject *globals = __pyx_d; + Py_INCREF(globals); + names = PyObject_Dir(__pyx_m); + if (!names) + goto bad; + for (i = PyList_GET_SIZE(names)-1; i >= 0; i--) { +#if CYTHON_COMPILING_IN_PYPY + PyObject* name = PySequence_ITEM(names, i); + if (!name) + goto bad; +#else + PyObject* name = PyList_GET_ITEM(names, i); +#endif + if (!PyDict_Contains(globals, name)) { + PyObject* value = __Pyx_GetAttr(__pyx_m, name); + if (!value) { +#if CYTHON_COMPILING_IN_PYPY + Py_DECREF(name); +#endif + goto bad; + } + if (PyDict_SetItem(globals, name, value) < 0) { +#if CYTHON_COMPILING_IN_PYPY + Py_DECREF(name); +#endif + Py_DECREF(value); + goto bad; + } + } +#if CYTHON_COMPILING_IN_PYPY + Py_DECREF(name); +#endif + } + Py_DECREF(names); + return globals; +bad: + Py_XDECREF(names); + Py_XDECREF(globals); + return NULL; +} + +/* CLineInTraceback */ +#ifndef CYTHON_CLINE_IN_TRACEBACK +static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { + PyObject *use_cline; + PyObject *ptype, *pvalue, *ptraceback; +#if CYTHON_COMPILING_IN_CPYTHON + PyObject **cython_runtime_dict; +#endif + if (unlikely(!__pyx_cython_runtime)) { + return c_line; + } + __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); +#if CYTHON_COMPILING_IN_CPYTHON + cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); + if (likely(cython_runtime_dict)) { + __PYX_PY_DICT_LOOKUP_IF_MODIFIED( + use_cline, *cython_runtime_dict, + __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback)) + } else +#endif + { + PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback); + if (use_cline_obj) { + use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; + Py_DECREF(use_cline_obj); + } else { + PyErr_Clear(); + use_cline = NULL; + } + } + if (!use_cline) { + c_line = 0; + PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); + } + else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { + c_line = 0; + } + __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); + return c_line; +} +#endif + +/* CodeObjectCache */ +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { + int start = 0, mid = 0, end = count - 1; + if (end >= 0 && code_line > entries[end].code_line) { + return count; + } + while (start < end) { + mid = start + (end - start) / 2; + if (code_line < entries[mid].code_line) { + end = mid; + } else if (code_line > entries[mid].code_line) { + start = mid + 1; + } else { + return mid; + } + } + if (code_line <= entries[mid].code_line) { + return mid; + } else { + return mid + 1; + } +} +static PyCodeObject *__pyx_find_code_object(int code_line) { + PyCodeObject* code_object; + int pos; + if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { + return NULL; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { + return NULL; + } + code_object = __pyx_code_cache.entries[pos].code_object; + Py_INCREF(code_object); + return code_object; +} +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { + int pos, i; + __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; + if (unlikely(!code_line)) { + return; + } + if (unlikely(!entries)) { + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); + if (likely(entries)) { + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = 64; + __pyx_code_cache.count = 1; + entries[0].code_line = code_line; + entries[0].code_object = code_object; + Py_INCREF(code_object); + } + return; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { + PyCodeObject* tmp = entries[pos].code_object; + entries[pos].code_object = code_object; + Py_DECREF(tmp); + return; + } + if (__pyx_code_cache.count == __pyx_code_cache.max_count) { + int new_max = __pyx_code_cache.max_count + 64; + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( + __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry)); + if (unlikely(!entries)) { + return; + } + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = new_max; + } + for (i=__pyx_code_cache.count; i>pos; i--) { + entries[i] = entries[i-1]; + } + entries[pos].code_line = code_line; + entries[pos].code_object = code_object; + __pyx_code_cache.count++; + Py_INCREF(code_object); +} + +/* AddTraceback */ +#include "compile.h" +#include "frameobject.h" +#include "traceback.h" +static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( + const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyObject *py_srcfile = 0; + PyObject *py_funcname = 0; + #if PY_MAJOR_VERSION < 3 + py_srcfile = PyString_FromString(filename); + #else + py_srcfile = PyUnicode_FromString(filename); + #endif + if (!py_srcfile) goto bad; + if (c_line) { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + #else + py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + #endif + } + else { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromString(funcname); + #else + py_funcname = PyUnicode_FromString(funcname); + #endif + } + if (!py_funcname) goto bad; + py_code = __Pyx_PyCode_New( + 0, + 0, + 0, + 0, + 0, + __pyx_empty_bytes, /*PyObject *code,*/ + __pyx_empty_tuple, /*PyObject *consts,*/ + __pyx_empty_tuple, /*PyObject *names,*/ + __pyx_empty_tuple, /*PyObject *varnames,*/ + __pyx_empty_tuple, /*PyObject *freevars,*/ + __pyx_empty_tuple, /*PyObject *cellvars,*/ + py_srcfile, /*PyObject *filename,*/ + py_funcname, /*PyObject *name,*/ + py_line, + __pyx_empty_bytes /*PyObject *lnotab*/ + ); + Py_DECREF(py_srcfile); + Py_DECREF(py_funcname); + return py_code; +bad: + Py_XDECREF(py_srcfile); + Py_XDECREF(py_funcname); + return NULL; +} +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyFrameObject *py_frame = 0; + PyThreadState *tstate = __Pyx_PyThreadState_Current; + if (c_line) { + c_line = __Pyx_CLineForTraceback(tstate, c_line); + } + py_code = __pyx_find_code_object(c_line ? -c_line : py_line); + if (!py_code) { + py_code = __Pyx_CreateCodeObjectForTraceback( + funcname, c_line, py_line, filename); + if (!py_code) goto bad; + __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); + } + py_frame = PyFrame_New( + tstate, /*PyThreadState *tstate,*/ + py_code, /*PyCodeObject *code,*/ + __pyx_d, /*PyObject *globals,*/ + 0 /*PyObject *locals*/ + ); + if (!py_frame) goto bad; + __Pyx_PyFrame_SetLineNumber(py_frame, py_line); + PyTraceBack_Here(py_frame); +bad: + Py_XDECREF(py_code); + Py_XDECREF(py_frame); +} + +/* CIntToPy */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { + const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(long) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(long) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(long) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(long), + little, !is_unsigned); + } +} + +/* CIntFromPyVerify */ +#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ + __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) +#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ + __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) +#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ + {\ + func_type value = func_value;\ + if (sizeof(target_type) < sizeof(func_type)) {\ + if (unlikely(value != (func_type) (target_type) value)) {\ + func_type zero = 0;\ + if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ + return (target_type) -1;\ + if (is_unsigned && unlikely(value < zero))\ + goto raise_neg_overflow;\ + else\ + goto raise_overflow;\ + }\ + }\ + return (target_type) value;\ + } + +/* CIntFromPy */ +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { + const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(long) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (long) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (long) 0; + case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0]) + case 2: + if (8 * sizeof(long) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) { + return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + case 3: + if (8 * sizeof(long) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) { + return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + case 4: + if (8 * sizeof(long) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) { + return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (long) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if (sizeof(long) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (long) 0; + case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0])) + case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0]) + case -2: + if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 2: + if (8 * sizeof(long) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case -3: + if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 3: + if (8 * sizeof(long) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case -4: + if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 4: + if (8 * sizeof(long) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + } +#endif + if (sizeof(long) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + long val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (long) -1; + } + } else { + long val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (long) -1; + val = __Pyx_PyInt_As_long(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to long"); + return (long) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to long"); + return (long) -1; +} + +/* CIntFromPy */ +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { + const int neg_one = (int) ((int) 0 - (int) 1), const_zero = (int) 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(int) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (int) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (int) 0; + case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0]) + case 2: + if (8 * sizeof(int) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) { + return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + case 3: + if (8 * sizeof(int) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) { + return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + case 4: + if (8 * sizeof(int) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) { + return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (int) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if (sizeof(int) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (int) 0; + case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0])) + case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0]) + case -2: + if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { + return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 2: + if (8 * sizeof(int) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { + return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case -3: + if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { + return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 3: + if (8 * sizeof(int) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { + return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case -4: + if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { + return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 4: + if (8 * sizeof(int) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { + return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + } +#endif + if (sizeof(int) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + int val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (int) -1; + } + } else { + int val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (int) -1; + val = __Pyx_PyInt_As_int(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to int"); + return (int) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to int"); + return (int) -1; +} + +/* FastTypeChecks */ +#if CYTHON_COMPILING_IN_CPYTHON +static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) { + while (a) { + a = a->tp_base; + if (a == b) + return 1; + } + return b == &PyBaseObject_Type; +} +static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) { + PyObject *mro; + if (a == b) return 1; + mro = a->tp_mro; + if (likely(mro)) { + Py_ssize_t i, n; + n = PyTuple_GET_SIZE(mro); + for (i = 0; i < n; i++) { + if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b) + return 1; + } + return 0; + } + return __Pyx_InBases(a, b); +} +#if PY_MAJOR_VERSION == 2 +static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { + PyObject *exception, *value, *tb; + int res; + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ErrFetch(&exception, &value, &tb); + res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; + if (unlikely(res == -1)) { + PyErr_WriteUnraisable(err); + res = 0; + } + if (!res) { + res = PyObject_IsSubclass(err, exc_type2); + if (unlikely(res == -1)) { + PyErr_WriteUnraisable(err); + res = 0; + } + } + __Pyx_ErrRestore(exception, value, tb); + return res; +} +#else +static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { + int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0; + if (!res) { + res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); + } + return res; +} +#endif +static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { + Py_ssize_t i, n; + assert(PyExceptionClass_Check(exc_type)); + n = PyTuple_GET_SIZE(tuple); +#if PY_MAJOR_VERSION >= 3 + for (i=0; i= 0x02070000 + cobj = PyCapsule_New(p, sig, 0); +#else + cobj = PyCObject_FromVoidPtrAndDesc(p, (void *)sig, 0); +#endif + if (!cobj) + goto bad; + if (PyDict_SetItem(d, name, cobj) < 0) + goto bad; + Py_DECREF(cobj); + Py_DECREF(d); + return 0; +bad: + Py_XDECREF(cobj); + Py_XDECREF(d); + return -1; +} + +/* FunctionExport */ +static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig) { + PyObject *d = 0; + PyObject *cobj = 0; + union { + void (*fp)(void); + void *p; + } tmp; + d = PyObject_GetAttrString(__pyx_m, (char *)"__pyx_capi__"); + if (!d) { + PyErr_Clear(); + d = PyDict_New(); + if (!d) + goto bad; + Py_INCREF(d); + if (PyModule_AddObject(__pyx_m, (char *)"__pyx_capi__", d) < 0) + goto bad; + } + tmp.fp = f; +#if PY_VERSION_HEX >= 0x02070000 + cobj = PyCapsule_New(tmp.p, sig, 0); +#else + cobj = PyCObject_FromVoidPtrAndDesc(tmp.p, (void *)sig, 0); +#endif + if (!cobj) + goto bad; + if (PyDict_SetItemString(d, name, cobj) < 0) + goto bad; + Py_DECREF(cobj); + Py_DECREF(d); + return 0; +bad: + Py_XDECREF(cobj); + Py_XDECREF(d); + return -1; +} + +/* InitStrings */ +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { + while (t->p) { + #if PY_MAJOR_VERSION < 3 + if (t->is_unicode) { + *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); + } else if (t->intern) { + *t->p = PyString_InternFromString(t->s); + } else { + *t->p = PyString_FromStringAndSize(t->s, t->n - 1); + } + #else + if (t->is_unicode | t->is_str) { + if (t->intern) { + *t->p = PyUnicode_InternFromString(t->s); + } else if (t->encoding) { + *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); + } else { + *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); + } + } else { + *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); + } + #endif + if (!*t->p) + return -1; + if (PyObject_Hash(*t->p) == -1) + return -1; + ++t; + } + return 0; +} + +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { + return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); +} +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { + Py_ssize_t ignore; + return __Pyx_PyObject_AsStringAndSize(o, &ignore); +} +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +#if !CYTHON_PEP393_ENABLED +static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { + char* defenc_c; + PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); + if (!defenc) return NULL; + defenc_c = PyBytes_AS_STRING(defenc); +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + { + char* end = defenc_c + PyBytes_GET_SIZE(defenc); + char* c; + for (c = defenc_c; c < end; c++) { + if ((unsigned char) (*c) >= 128) { + PyUnicode_AsASCIIString(o); + return NULL; + } + } + } +#endif + *length = PyBytes_GET_SIZE(defenc); + return defenc_c; +} +#else +static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { + if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + if (likely(PyUnicode_IS_ASCII(o))) { + *length = PyUnicode_GET_LENGTH(o); + return PyUnicode_AsUTF8(o); + } else { + PyUnicode_AsASCIIString(o); + return NULL; + } +#else + return PyUnicode_AsUTF8AndSize(o, length); +#endif +} +#endif +#endif +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT + if ( +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + __Pyx_sys_getdefaultencoding_not_ascii && +#endif + PyUnicode_Check(o)) { + return __Pyx_PyUnicode_AsStringAndSize(o, length); + } else +#endif +#if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) + if (PyByteArray_Check(o)) { + *length = PyByteArray_GET_SIZE(o); + return PyByteArray_AS_STRING(o); + } else +#endif + { + char* result; + int r = PyBytes_AsStringAndSize(o, &result, length); + if (unlikely(r < 0)) { + return NULL; + } else { + return result; + } + } +} +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { + int is_true = x == Py_True; + if (is_true | (x == Py_False) | (x == Py_None)) return is_true; + else return PyObject_IsTrue(x); +} +static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) { + int retval; + if (unlikely(!x)) return -1; + retval = __Pyx_PyObject_IsTrue(x); + Py_DECREF(x); + return retval; +} +static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) { +#if PY_MAJOR_VERSION >= 3 + if (PyLong_Check(result)) { + if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, + "__int__ returned non-int (type %.200s). " + "The ability to return an instance of a strict subclass of int " + "is deprecated, and may be removed in a future version of Python.", + Py_TYPE(result)->tp_name)) { + Py_DECREF(result); + return NULL; + } + return result; + } +#endif + PyErr_Format(PyExc_TypeError, + "__%.4s__ returned non-%.4s (type %.200s)", + type_name, type_name, Py_TYPE(result)->tp_name); + Py_DECREF(result); + return NULL; +} +static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { +#if CYTHON_USE_TYPE_SLOTS + PyNumberMethods *m; +#endif + const char *name = NULL; + PyObject *res = NULL; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x) || PyLong_Check(x))) +#else + if (likely(PyLong_Check(x))) +#endif + return __Pyx_NewRef(x); +#if CYTHON_USE_TYPE_SLOTS + m = Py_TYPE(x)->tp_as_number; + #if PY_MAJOR_VERSION < 3 + if (m && m->nb_int) { + name = "int"; + res = m->nb_int(x); + } + else if (m && m->nb_long) { + name = "long"; + res = m->nb_long(x); + } + #else + if (likely(m && m->nb_int)) { + name = "int"; + res = m->nb_int(x); + } + #endif +#else + if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { + res = PyNumber_Int(x); + } +#endif + if (likely(res)) { +#if PY_MAJOR_VERSION < 3 + if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) { +#else + if (unlikely(!PyLong_CheckExact(res))) { +#endif + return __Pyx_PyNumber_IntOrLongWrongResultType(res, name); + } + } + else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_TypeError, + "an integer is required"); + } + return res; +} +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { + Py_ssize_t ival; + PyObject *x; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_CheckExact(b))) { + if (sizeof(Py_ssize_t) >= sizeof(long)) + return PyInt_AS_LONG(b); + else + return PyInt_AsSsize_t(b); + } +#endif + if (likely(PyLong_CheckExact(b))) { + #if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)b)->ob_digit; + const Py_ssize_t size = Py_SIZE(b); + if (likely(__Pyx_sst_abs(size) <= 1)) { + ival = likely(size) ? digits[0] : 0; + if (size == -1) ival = -ival; + return ival; + } else { + switch (size) { + case 2: + if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { + return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -2: + if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case 3: + if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { + return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -3: + if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case 4: + if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { + return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -4: + if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + } + } + #endif + return PyLong_AsSsize_t(b); + } + x = PyNumber_Index(b); + if (!x) return -1; + ival = PyInt_AsSsize_t(x); + Py_DECREF(x); + return ival; +} +static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) { + return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False); +} +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { + return PyInt_FromSize_t(ival); +} + + +#endif /* Py_PYTHON_H */ diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_greenlet_primitives.html b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_greenlet_primitives.html new file mode 100644 index 00000000..42ec9258 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_greenlet_primitives.html @@ -0,0 +1,1246 @@ + + + + + + Cython: _greenlet_primitives.py + + + +

Generated by Cython 0.29.2

+

+ Yellow lines hint at Python interaction.
+ Click on a line that starts with a "+" to see the C code that Cython generated for it. +

+

Raw output: _greenlet_primitives.c

+
+01: # -*- coding: utf-8 -*-
+
  __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 02: # copyright (c) 2018 gevent. See  LICENSE.
+
 03: # cython: auto_pickle=False,embedsignature=True,always_allow_keywords=False
+
 04: """
+
 05: A collection of primitives used by the hub, and suitable for
+
 06: compilation with Cython because of their frequency of use.
+
 07: 
+
 08: """
+
 09: from __future__ import absolute_import
+
 10: from __future__ import division
+
 11: from __future__ import print_function
+
 12: 
+
+13: from weakref import ref as wref
+
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 13, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(__pyx_n_s_ref);
+  __Pyx_GIVEREF(__pyx_n_s_ref);
+  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_ref);
+  __pyx_t_2 = __Pyx_Import(__pyx_n_s_weakref, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 13, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_ref); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 13, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(__pyx_t_1);
+  __Pyx_XGOTREF(__pyx_v_6gevent_21__greenlet_primitives_wref);
+  __Pyx_DECREF_SET(__pyx_v_6gevent_21__greenlet_primitives_wref, __pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+14: from gc import get_objects
+
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 14, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_get_objects);
+  __Pyx_GIVEREF(__pyx_n_s_get_objects);
+  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_get_objects);
+  __pyx_t_1 = __Pyx_Import(__pyx_n_s_gc, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 14, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_get_objects); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 14, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(__pyx_t_2);
+  __Pyx_XGOTREF(__pyx_v_6gevent_21__greenlet_primitives_get_objects);
+  __Pyx_DECREF_SET(__pyx_v_6gevent_21__greenlet_primitives_get_objects, __pyx_t_2);
+  __Pyx_GIVEREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 15: 
+
+16: from greenlet import greenlet
+
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 16, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(__pyx_n_s_greenlet);
+  __Pyx_GIVEREF(__pyx_n_s_greenlet);
+  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_greenlet);
+  __pyx_t_2 = __Pyx_Import(__pyx_n_s_greenlet, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 16, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
 17: 
+
+18: from gevent.exceptions import BlockingSwitchOutError
+
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 18, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_BlockingSwitchOutError);
+  __Pyx_GIVEREF(__pyx_n_s_BlockingSwitchOutError);
+  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_BlockingSwitchOutError);
+  __pyx_t_1 = __Pyx_Import(__pyx_n_s_gevent_exceptions, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 18, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_BlockingSwitchOutError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 18, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(__pyx_t_2);
+  __Pyx_XGOTREF(__pyx_v_6gevent_21__greenlet_primitives_BlockingSwitchOutError);
+  __Pyx_DECREF_SET(__pyx_v_6gevent_21__greenlet_primitives_BlockingSwitchOutError, __pyx_t_2);
+  __Pyx_GIVEREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 19: 
+
 20: 
+
 21: # In Cython, we define these as 'cdef inline' functions. The
+
 22: # compilation unit cannot have a direct assignment to them (import
+
 23: # is assignment) without generating a 'lvalue is not valid target'
+
 24: # error.
+
+25: locals()['getcurrent'] = __import__('greenlet').getcurrent
+
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin___import__, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 25, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_getcurrent); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 25, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_1 = __Pyx_Globals(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 25, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (unlikely(PyDict_SetItem(__pyx_t_1, __pyx_n_s_getcurrent, __pyx_t_2) < 0)) __PYX_ERR(0, 25, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+/* … */
+  __pyx_tuple_ = PyTuple_Pack(1, __pyx_n_s_greenlet); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 25, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple_);
+  __Pyx_GIVEREF(__pyx_tuple_);
+
+26: locals()['greenlet_init'] = lambda: None
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_21__greenlet_primitives_4lambda(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyMethodDef __pyx_mdef_6gevent_21__greenlet_primitives_4lambda = {"lambda", (PyCFunction)__pyx_pw_6gevent_21__greenlet_primitives_4lambda, METH_NOARGS, 0};
+static PyObject *__pyx_pw_6gevent_21__greenlet_primitives_4lambda(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("lambda (wrapper)", 0);
+  __pyx_r = __pyx_lambda_funcdef_6gevent_21__greenlet_primitives_lambda(__pyx_self);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_lambda_funcdef_6gevent_21__greenlet_primitives_lambda(CYTHON_UNUSED PyObject *__pyx_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("lambda", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_21__greenlet_primitives_4lambda, 0, __pyx_n_s_lambda, NULL, __pyx_n_s_gevent___greenlet_primitives, __pyx_d, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 26, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_1 = __Pyx_Globals(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 26, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (unlikely(PyDict_SetItem(__pyx_t_1, __pyx_n_s_greenlet_init, __pyx_t_2) < 0)) __PYX_ERR(0, 26, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+27: locals()['_greenlet_switch'] = greenlet.switch
+
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_6gevent_21__greenlet_primitives_greenlet), __pyx_n_s_switch); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 27, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_1 = __Pyx_Globals(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 27, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (unlikely(PyDict_SetItem(__pyx_t_1, __pyx_n_s_greenlet_switch, __pyx_t_2) < 0)) __PYX_ERR(0, 27, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
 28: 
+
+29: __all__ = [
+
  __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 29, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_TrackedRawGreenlet);
+  __Pyx_GIVEREF(__pyx_n_s_TrackedRawGreenlet);
+  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_TrackedRawGreenlet);
+  __Pyx_INCREF(__pyx_n_s_SwitchOutGreenletWithLoop);
+  __Pyx_GIVEREF(__pyx_n_s_SwitchOutGreenletWithLoop);
+  PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_SwitchOutGreenletWithLoop);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_all, __pyx_t_2) < 0) __PYX_ERR(0, 29, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
 30:     'TrackedRawGreenlet',
+
 31:     'SwitchOutGreenletWithLoop',
+
 32: ]
+
 33: 
+
 34: class TrackedRawGreenlet(greenlet):
+
 35: 
+
+36:     def __init__(self, function, parent):
+
/* Python wrapper */
+static int __pyx_pw_6gevent_21__greenlet_primitives_18TrackedRawGreenlet_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static int __pyx_pw_6gevent_21__greenlet_primitives_18TrackedRawGreenlet_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_function = 0;
+  PyObject *__pyx_v_parent = 0;
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_function,&__pyx_n_s_parent,0};
+    PyObject* values[2] = {0,0};
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_function)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_parent)) != 0)) kw_args--;
+        else {
+          __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(0, 36, __pyx_L3_error)
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 36, __pyx_L3_error)
+      }
+    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
+      goto __pyx_L5_argtuple_error;
+    } else {
+      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+    }
+    __pyx_v_function = values[0];
+    __pyx_v_parent = values[1];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 36, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.__greenlet_primitives.TrackedRawGreenlet.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return -1;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_21__greenlet_primitives_18TrackedRawGreenlet___init__(((struct __pyx_obj_6gevent_21__greenlet_primitives_TrackedRawGreenlet *)__pyx_v_self), __pyx_v_function, __pyx_v_parent);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_21__greenlet_primitives_18TrackedRawGreenlet___init__(struct __pyx_obj_6gevent_21__greenlet_primitives_TrackedRawGreenlet *__pyx_v_self, PyObject *__pyx_v_function, PyObject *__pyx_v_parent) {
+  PyGreenlet *__pyx_v_current = NULL;
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = 0;
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_AddTraceback("gevent.__greenlet_primitives.TrackedRawGreenlet.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = -1;
+  __pyx_L0:;
+  __Pyx_XDECREF((PyObject *)__pyx_v_current);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+37:         greenlet.__init__(self, function, parent)
+
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_6gevent_21__greenlet_primitives_greenlet), __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 37, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = NULL;
+  __pyx_t_4 = 0;
+  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+    if (likely(__pyx_t_3)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+      __Pyx_INCREF(__pyx_t_3);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_2, function);
+      __pyx_t_4 = 1;
+    }
+  }
+  #if CYTHON_FAST_PYCALL
+  if (PyFunction_Check(__pyx_t_2)) {
+    PyObject *__pyx_temp[4] = {__pyx_t_3, ((PyObject *)__pyx_v_self), __pyx_v_function, __pyx_v_parent};
+    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 37, __pyx_L1_error)
+    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __Pyx_GOTREF(__pyx_t_1);
+  } else
+  #endif
+  #if CYTHON_FAST_PYCCALL
+  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
+    PyObject *__pyx_temp[4] = {__pyx_t_3, ((PyObject *)__pyx_v_self), __pyx_v_function, __pyx_v_parent};
+    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 37, __pyx_L1_error)
+    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __Pyx_GOTREF(__pyx_t_1);
+  } else
+  #endif
+  {
+    __pyx_t_5 = PyTuple_New(3+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 37, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_5);
+    if (__pyx_t_3) {
+      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
+    }
+    __Pyx_INCREF(((PyObject *)__pyx_v_self));
+    __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
+    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, ((PyObject *)__pyx_v_self));
+    __Pyx_INCREF(__pyx_v_function);
+    __Pyx_GIVEREF(__pyx_v_function);
+    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_function);
+    __Pyx_INCREF(__pyx_v_parent);
+    __Pyx_GIVEREF(__pyx_v_parent);
+    PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_4, __pyx_v_parent);
+    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 37, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+  }
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 38:         # See greenlet.py's Greenlet class. We capture the cheap
+
 39:         # parts to maintain the tree structure, but we do not capture
+
 40:         # the stack because that's too expensive for 'spawn_raw'.
+
 41: 
+
+42:         current = getcurrent() # pylint:disable=undefined-variable
+
  __pyx_t_1 = ((PyObject *)__pyx_f_6gevent_21__greenlet_primitives_getcurrent()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 42, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_v_current = ((PyGreenlet *)__pyx_t_1);
+  __pyx_t_1 = 0;
+
+43:         self.spawning_greenlet = wref(current)
+
  __Pyx_INCREF(__pyx_v_6gevent_21__greenlet_primitives_wref);
+  __pyx_t_2 = __pyx_v_6gevent_21__greenlet_primitives_wref; __pyx_t_5 = NULL;
+  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
+    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
+    if (likely(__pyx_t_5)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+      __Pyx_INCREF(__pyx_t_5);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_2, function);
+    }
+  }
+  __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, ((PyObject *)__pyx_v_current)) : __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_v_current));
+  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 43, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_spawning_greenlet, __pyx_t_1) < 0) __PYX_ERR(0, 43, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 44:         # See Greenlet for how trees are maintained.
+
+45:         try:
+
  {
+    /*try:*/ {
+/* … */
+    }
+    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
+    goto __pyx_L8_try_end;
+    __pyx_L3_error:;
+    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+/* … */
+    __Pyx_XGIVEREF(__pyx_t_6);
+    __Pyx_XGIVEREF(__pyx_t_7);
+    __Pyx_XGIVEREF(__pyx_t_8);
+    __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
+    goto __pyx_L1_error;
+    __pyx_L4_exception_handled:;
+    __Pyx_XGIVEREF(__pyx_t_6);
+    __Pyx_XGIVEREF(__pyx_t_7);
+    __Pyx_XGIVEREF(__pyx_t_8);
+    __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
+    __pyx_L8_try_end:;
+  }
+
+46:             self.spawn_tree_locals = current.spawn_tree_locals
+
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_current), __pyx_n_s_spawn_tree_locals); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 46, __pyx_L3_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_spawn_tree_locals, __pyx_t_1) < 0) __PYX_ERR(0, 46, __pyx_L3_error)
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+47:         except AttributeError:
+
    __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_AttributeError);
+    if (__pyx_t_4) {
+      __Pyx_AddTraceback("gevent.__greenlet_primitives.TrackedRawGreenlet.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+      if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_2, &__pyx_t_5) < 0) __PYX_ERR(0, 47, __pyx_L5_except_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      __Pyx_GOTREF(__pyx_t_2);
+      __Pyx_GOTREF(__pyx_t_5);
+
+48:             self.spawn_tree_locals = {}
+
      __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 48, __pyx_L5_except_error)
+      __Pyx_GOTREF(__pyx_t_3);
+      if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_spawn_tree_locals, __pyx_t_3) < 0) __PYX_ERR(0, 48, __pyx_L5_except_error)
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+
+49:             if current.parent:
+
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_current), __pyx_n_s_parent); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 49, __pyx_L5_except_error)
+      __Pyx_GOTREF(__pyx_t_3);
+      __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 49, __pyx_L5_except_error)
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+      if (__pyx_t_9) {
+/* … */
+      }
+      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+      goto __pyx_L4_exception_handled;
+    }
+    goto __pyx_L5_except_error;
+    __pyx_L5_except_error:;
+
+50:                 current.spawn_tree_locals = self.spawn_tree_locals
+
        __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_spawn_tree_locals); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 50, __pyx_L5_except_error)
+        __Pyx_GOTREF(__pyx_t_3);
+        if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_current), __pyx_n_s_spawn_tree_locals, __pyx_t_3) < 0) __PYX_ERR(0, 50, __pyx_L5_except_error)
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+
 51: 
+
 52: 
+
+53: class SwitchOutGreenletWithLoop(TrackedRawGreenlet):
+
struct __pyx_vtabstruct_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop {
+  PyObject *(*__pyx_switch)(struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *, int __pyx_skip_dispatch);
+  PyObject *(*switch_out)(struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *, int __pyx_skip_dispatch);
+};
+static struct __pyx_vtabstruct_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *__pyx_vtabptr_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop;
+
 54:     # Subclasses must define:
+
 55:     # - self.loop
+
 56: 
+
 57:     # This class defines loop in its .pxd for Cython. This lets us avoid
+
 58:     # circular dependencies with the hub.
+
 59: 
+
+60:     def switch(self):
+
static PyObject *__pyx_pw_6gevent_21__greenlet_primitives_25SwitchOutGreenletWithLoop_1switch(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyObject *__pyx_f_6gevent_21__greenlet_primitives_25SwitchOutGreenletWithLoop_switch(struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *__pyx_v_self, int __pyx_skip_dispatch) {
+  PyObject *__pyx_v_switch_out = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("switch", 0);
+  /* Check if called by wrapper */
+  if (unlikely(__pyx_skip_dispatch)) ;
+  /* Check if overridden in Python */
+  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
+    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
+    if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
+    else {
+      PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      #endif
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_switch); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 60, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_21__greenlet_primitives_25SwitchOutGreenletWithLoop_1switch)) {
+        __Pyx_XDECREF(__pyx_r);
+        __Pyx_INCREF(__pyx_t_1);
+        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+          if (likely(__pyx_t_4)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+            __Pyx_INCREF(__pyx_t_4);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_3, function);
+          }
+        }
+        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
+        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 60, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __pyx_r = __pyx_t_2;
+        __pyx_t_2 = 0;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        goto __pyx_L0;
+      }
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+      tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
+      if (unlikely(type_dict_guard != tp_dict_version)) {
+        tp_dict_version = obj_dict_version = 0;
+      }
+      #endif
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    }
+    #endif
+  }
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_AddTraceback("gevent.__greenlet_primitives.SwitchOutGreenletWithLoop.switch", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_switch_out);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_21__greenlet_primitives_25SwitchOutGreenletWithLoop_1switch(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6gevent_21__greenlet_primitives_25SwitchOutGreenletWithLoop_switch[] = "SwitchOutGreenletWithLoop.switch(self)";
+static PyMethodDef __pyx_mdef_6gevent_21__greenlet_primitives_25SwitchOutGreenletWithLoop_1switch = {"switch", (PyCFunction)__pyx_pw_6gevent_21__greenlet_primitives_25SwitchOutGreenletWithLoop_1switch, METH_NOARGS, __pyx_doc_6gevent_21__greenlet_primitives_25SwitchOutGreenletWithLoop_switch};
+static PyObject *__pyx_pw_6gevent_21__greenlet_primitives_25SwitchOutGreenletWithLoop_1switch(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("switch (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_21__greenlet_primitives_25SwitchOutGreenletWithLoop_switch(((struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_21__greenlet_primitives_25SwitchOutGreenletWithLoop_switch(struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("switch", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __pyx_f_6gevent_21__greenlet_primitives_25SwitchOutGreenletWithLoop_switch(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 60, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.__greenlet_primitives.SwitchOutGreenletWithLoop.switch", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__2 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 60, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__2);
+  __Pyx_GIVEREF(__pyx_tuple__2);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_21__greenlet_primitives_25SwitchOutGreenletWithLoop_1switch, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_SwitchOutGreenletWithLoop_switch, NULL, __pyx_n_s_gevent___greenlet_primitives, __pyx_d, ((PyObject *)__pyx_codeobj__3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 60, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop->tp_dict, __pyx_n_s_switch, __pyx_t_2) < 0) __PYX_ERR(0, 60, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop);
+  __pyx_codeobj__3 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__greenlet_primitives, __pyx_n_s_switch, 60, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__3)) __PYX_ERR(0, 60, __pyx_L1_error)
+
+61:         switch_out = getattr(getcurrent(), 'switch_out', None) # pylint:disable=undefined-variable
+
  __pyx_t_1 = ((PyObject *)__pyx_f_6gevent_21__greenlet_primitives_getcurrent()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 61, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = __Pyx_GetAttr3(__pyx_t_1, __pyx_n_s_switch_out, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 61, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_v_switch_out = __pyx_t_2;
+  __pyx_t_2 = 0;
+
+62:         if switch_out is not None:
+
  __pyx_t_5 = (__pyx_v_switch_out != Py_None);
+  __pyx_t_6 = (__pyx_t_5 != 0);
+  if (__pyx_t_6) {
+/* … */
+  }
+
+63:             switch_out()
+
    __Pyx_INCREF(__pyx_v_switch_out);
+    __pyx_t_1 = __pyx_v_switch_out; __pyx_t_3 = NULL;
+    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
+      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
+      if (likely(__pyx_t_3)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
+        __Pyx_INCREF(__pyx_t_3);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_1, function);
+      }
+    }
+    __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_1);
+    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 63, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+64:         return _greenlet_switch(self) # pylint:disable=undefined-variable
+
  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_2 = __pyx_f_6gevent_21__greenlet_primitives__greenlet_switch(((PyGreenlet *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 64, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_r = __pyx_t_2;
+  __pyx_t_2 = 0;
+  goto __pyx_L0;
+
 65: 
+
+66:     def switch_out(self):
+
static PyObject *__pyx_pw_6gevent_21__greenlet_primitives_25SwitchOutGreenletWithLoop_3switch_out(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyObject *__pyx_f_6gevent_21__greenlet_primitives_25SwitchOutGreenletWithLoop_switch_out(CYTHON_UNUSED struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *__pyx_v_self, int __pyx_skip_dispatch) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("switch_out", 0);
+  /* Check if called by wrapper */
+  if (unlikely(__pyx_skip_dispatch)) ;
+  /* Check if overridden in Python */
+  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
+    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
+    if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
+    else {
+      PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      #endif
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_switch_out); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 66, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_21__greenlet_primitives_25SwitchOutGreenletWithLoop_3switch_out)) {
+        __Pyx_XDECREF(__pyx_r);
+        __Pyx_INCREF(__pyx_t_1);
+        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+          if (likely(__pyx_t_4)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+            __Pyx_INCREF(__pyx_t_4);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_3, function);
+          }
+        }
+        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
+        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 66, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __pyx_r = __pyx_t_2;
+        __pyx_t_2 = 0;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        goto __pyx_L0;
+      }
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+      tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
+      if (unlikely(type_dict_guard != tp_dict_version)) {
+        tp_dict_version = obj_dict_version = 0;
+      }
+      #endif
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    }
+    #endif
+  }
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_AddTraceback("gevent.__greenlet_primitives.SwitchOutGreenletWithLoop.switch_out", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_21__greenlet_primitives_25SwitchOutGreenletWithLoop_3switch_out(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6gevent_21__greenlet_primitives_25SwitchOutGreenletWithLoop_2switch_out[] = "SwitchOutGreenletWithLoop.switch_out(self)";
+static PyMethodDef __pyx_mdef_6gevent_21__greenlet_primitives_25SwitchOutGreenletWithLoop_3switch_out = {"switch_out", (PyCFunction)__pyx_pw_6gevent_21__greenlet_primitives_25SwitchOutGreenletWithLoop_3switch_out, METH_NOARGS, __pyx_doc_6gevent_21__greenlet_primitives_25SwitchOutGreenletWithLoop_2switch_out};
+static PyObject *__pyx_pw_6gevent_21__greenlet_primitives_25SwitchOutGreenletWithLoop_3switch_out(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("switch_out (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_21__greenlet_primitives_25SwitchOutGreenletWithLoop_2switch_out(((struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_21__greenlet_primitives_25SwitchOutGreenletWithLoop_2switch_out(struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("switch_out", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __pyx_f_6gevent_21__greenlet_primitives_25SwitchOutGreenletWithLoop_switch_out(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 66, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.__greenlet_primitives.SwitchOutGreenletWithLoop.switch_out", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__4 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 66, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__4);
+  __Pyx_GIVEREF(__pyx_tuple__4);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_21__greenlet_primitives_25SwitchOutGreenletWithLoop_3switch_out, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_SwitchOutGreenletWithLoop_switch_2, NULL, __pyx_n_s_gevent___greenlet_primitives, __pyx_d, ((PyObject *)__pyx_codeobj__5)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 66, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop->tp_dict, __pyx_n_s_switch_out, __pyx_t_2) < 0) __PYX_ERR(0, 66, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop);
+  __pyx_codeobj__5 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__4, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__greenlet_primitives, __pyx_n_s_switch_out, 66, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__5)) __PYX_ERR(0, 66, __pyx_L1_error)
+
+67:         raise BlockingSwitchOutError('Impossible to call blocking function in the event loop callback')
+
  __Pyx_INCREF(__pyx_v_6gevent_21__greenlet_primitives_BlockingSwitchOutError);
+  __pyx_t_2 = __pyx_v_6gevent_21__greenlet_primitives_BlockingSwitchOutError; __pyx_t_3 = NULL;
+  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
+    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+    if (likely(__pyx_t_3)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+      __Pyx_INCREF(__pyx_t_3);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_2, function);
+    }
+  }
+  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_kp_s_Impossible_to_call_blocking_func) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_kp_s_Impossible_to_call_blocking_func);
+  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 67, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __PYX_ERR(0, 67, __pyx_L1_error)
+
 68: 
+
 69: 
+
+70: def get_reachable_greenlets():
+
static PyObject *__pyx_pw_6gevent_21__greenlet_primitives_1get_reachable_greenlets(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyObject *__pyx_f_6gevent_21__greenlet_primitives_get_reachable_greenlets(CYTHON_UNUSED int __pyx_skip_dispatch) {
+  PyObject *__pyx_7genexpr__pyx_v_x = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("get_reachable_greenlets", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_AddTraceback("gevent.__greenlet_primitives.get_reachable_greenlets", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_7genexpr__pyx_v_x);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_21__greenlet_primitives_1get_reachable_greenlets(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6gevent_21__greenlet_primitives_get_reachable_greenlets[] = "get_reachable_greenlets() -> list";
+static PyMethodDef __pyx_mdef_6gevent_21__greenlet_primitives_1get_reachable_greenlets = {"get_reachable_greenlets", (PyCFunction)__pyx_pw_6gevent_21__greenlet_primitives_1get_reachable_greenlets, METH_NOARGS, __pyx_doc_6gevent_21__greenlet_primitives_get_reachable_greenlets};
+static PyObject *__pyx_pw_6gevent_21__greenlet_primitives_1get_reachable_greenlets(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("get_reachable_greenlets (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_21__greenlet_primitives_get_reachable_greenlets(__pyx_self);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_21__greenlet_primitives_get_reachable_greenlets(CYTHON_UNUSED PyObject *__pyx_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("get_reachable_greenlets", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __pyx_f_6gevent_21__greenlet_primitives_get_reachable_greenlets(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 70, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.__greenlet_primitives.get_reachable_greenlets", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_21__greenlet_primitives_1get_reachable_greenlets, 0, __pyx_n_s_get_reachable_greenlets, NULL, __pyx_n_s_gevent___greenlet_primitives, __pyx_d, ((PyObject *)__pyx_codeobj__6)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 70, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_reachable_greenlets, __pyx_t_2) < 0) __PYX_ERR(0, 70, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+/* … */
+  __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__greenlet_primitives, __pyx_n_s_get_reachable_greenlets, 70, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__6)) __PYX_ERR(0, 70, __pyx_L1_error)
+
 71:     # We compile this loop with Cython so that it's faster, and so that
+
 72:     # the GIL isn't dropped at unpredictable times during the loop.
+
 73:     # Dropping the GIL could lead to accessing partly constructed objects
+
 74:     # in undefined states (particularly, tuples). This helps close a hole
+
 75:     # where a `SystemError: Objects/tupleobject.c bad argument to internal function`
+
 76:     # could get raised. (Note that this probably doesn't completely close the hole,
+
 77:     # if other threads have dropped the GIL, but hopefully the speed makes that
+
 78:     # more rare.) See https://github.com/gevent/gevent/issues/1302
+
+79:     return [
+
  __Pyx_XDECREF(__pyx_r);
+  { /* enter inner scope */
+    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 79, __pyx_L5_error)
+    __Pyx_GOTREF(__pyx_t_1);
+
+80:         x for x in get_objects()
+
    __Pyx_INCREF(__pyx_v_6gevent_21__greenlet_primitives_get_objects);
+    __pyx_t_3 = __pyx_v_6gevent_21__greenlet_primitives_get_objects; __pyx_t_4 = NULL;
+    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+      if (likely(__pyx_t_4)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+        __Pyx_INCREF(__pyx_t_4);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_3, function);
+      }
+    }
+    __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
+    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 80, __pyx_L5_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
+      __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3); __pyx_t_5 = 0;
+      __pyx_t_6 = NULL;
+    } else {
+      __pyx_t_5 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 80, __pyx_L5_error)
+      __Pyx_GOTREF(__pyx_t_3);
+      __pyx_t_6 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 80, __pyx_L5_error)
+    }
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    for (;;) {
+      if (likely(!__pyx_t_6)) {
+        if (likely(PyList_CheckExact(__pyx_t_3))) {
+          if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_3)) break;
+          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+          __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 80, __pyx_L5_error)
+          #else
+          __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 80, __pyx_L5_error)
+          __Pyx_GOTREF(__pyx_t_2);
+          #endif
+        } else {
+          if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
+          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+          __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 80, __pyx_L5_error)
+          #else
+          __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 80, __pyx_L5_error)
+          __Pyx_GOTREF(__pyx_t_2);
+          #endif
+        }
+      } else {
+        __pyx_t_2 = __pyx_t_6(__pyx_t_3);
+        if (unlikely(!__pyx_t_2)) {
+          PyObject* exc_type = PyErr_Occurred();
+          if (exc_type) {
+            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+            else __PYX_ERR(0, 80, __pyx_L5_error)
+          }
+          break;
+        }
+        __Pyx_GOTREF(__pyx_t_2);
+      }
+      __Pyx_XDECREF_SET(__pyx_7genexpr__pyx_v_x, __pyx_t_2);
+      __pyx_t_2 = 0;
+/* … */
+        if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_7genexpr__pyx_v_x))) __PYX_ERR(0, 79, __pyx_L5_error)
+/* … */
+    }
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __Pyx_XDECREF(__pyx_7genexpr__pyx_v_x); __pyx_7genexpr__pyx_v_x = 0;
+    goto __pyx_L11_exit_scope;
+    __pyx_L5_error:;
+    __Pyx_XDECREF(__pyx_7genexpr__pyx_v_x); __pyx_7genexpr__pyx_v_x = 0;
+    goto __pyx_L1_error;
+    __pyx_L11_exit_scope:;
+  } /* exit inner scope */
+  __pyx_r = ((PyObject*)__pyx_t_1);
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+81:         if isinstance(x, greenlet) and not getattr(x, 'greenlet_tree_is_ignored', False)
+
      __pyx_t_8 = __Pyx_TypeCheck(__pyx_7genexpr__pyx_v_x, __pyx_ptype_6gevent_21__greenlet_primitives_greenlet); 
+      __pyx_t_9 = (__pyx_t_8 != 0);
+      if (__pyx_t_9) {
+      } else {
+        __pyx_t_7 = __pyx_t_9;
+        goto __pyx_L9_bool_binop_done;
+      }
+      __pyx_t_2 = __Pyx_GetAttr3(__pyx_7genexpr__pyx_v_x, __pyx_n_s_greenlet_tree_is_ignored, Py_False); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 81, __pyx_L5_error)
+      __Pyx_GOTREF(__pyx_t_2);
+      __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 81, __pyx_L5_error)
+      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+      __pyx_t_8 = ((!__pyx_t_9) != 0);
+      __pyx_t_7 = __pyx_t_8;
+      __pyx_L9_bool_binop_done:;
+      if (__pyx_t_7) {
+/* … */
+      }
+
 82:     ]
+
 83: 
+
+84: def _init():
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_21__greenlet_primitives_3_init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6gevent_21__greenlet_primitives_2_init[] = "_init()";
+static PyMethodDef __pyx_mdef_6gevent_21__greenlet_primitives_3_init = {"_init", (PyCFunction)__pyx_pw_6gevent_21__greenlet_primitives_3_init, METH_NOARGS, __pyx_doc_6gevent_21__greenlet_primitives_2_init};
+static PyObject *__pyx_pw_6gevent_21__greenlet_primitives_3_init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_init (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_21__greenlet_primitives_2_init(__pyx_self);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_21__greenlet_primitives_2_init(CYTHON_UNUSED PyObject *__pyx_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_init", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_21__greenlet_primitives_3_init, 0, __pyx_n_s_init_2, NULL, __pyx_n_s_gevent___greenlet_primitives, __pyx_d, ((PyObject *)__pyx_codeobj__7)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 84, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_init_2, __pyx_t_2) < 0) __PYX_ERR(0, 84, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+85:     greenlet_init() # pylint:disable=undefined-variable
+
  __pyx_f_6gevent_21__greenlet_primitives_greenlet_init();
+
 86: 
+
+87: _init()
+
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_init_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 87, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 87, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 88: 
+
+89: from gevent._util import import_c_accel
+
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 89, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(__pyx_n_s_import_c_accel);
+  __Pyx_GIVEREF(__pyx_n_s_import_c_accel);
+  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_import_c_accel);
+  __pyx_t_2 = __Pyx_Import(__pyx_n_s_gevent__util, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 89, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_import_c_accel); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 89, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_import_c_accel, __pyx_t_1) < 0) __PYX_ERR(0, 89, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+90: import_c_accel(globals(), 'gevent.__greenlet_primitives')
+
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_import_c_accel); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 90, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_1 = __Pyx_Globals(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 90, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 90, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_GIVEREF(__pyx_t_1);
+  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
+  __Pyx_INCREF(__pyx_n_s_gevent___greenlet_primitives);
+  __Pyx_GIVEREF(__pyx_n_s_gevent___greenlet_primitives);
+  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_n_s_gevent___greenlet_primitives);
+  __pyx_t_1 = 0;
+  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 90, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_greenlet_primitives.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_greenlet_primitives.py new file mode 100644 index 00000000..b982bc14 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_greenlet_primitives.py @@ -0,0 +1,90 @@ +# -*- coding: utf-8 -*- +# copyright (c) 2018 gevent. See LICENSE. +# cython: auto_pickle=False,embedsignature=True,always_allow_keywords=False +""" +A collection of primitives used by the hub, and suitable for +compilation with Cython because of their frequency of use. + +""" +from __future__ import absolute_import +from __future__ import division +from __future__ import print_function + +from weakref import ref as wref +from gc import get_objects + +from greenlet import greenlet + +from gevent.exceptions import BlockingSwitchOutError + + +# In Cython, we define these as 'cdef inline' functions. The +# compilation unit cannot have a direct assignment to them (import +# is assignment) without generating a 'lvalue is not valid target' +# error. +locals()['getcurrent'] = __import__('greenlet').getcurrent +locals()['greenlet_init'] = lambda: None +locals()['_greenlet_switch'] = greenlet.switch + +__all__ = [ + 'TrackedRawGreenlet', + 'SwitchOutGreenletWithLoop', +] + +class TrackedRawGreenlet(greenlet): + + def __init__(self, function, parent): + greenlet.__init__(self, function, parent) + # See greenlet.py's Greenlet class. We capture the cheap + # parts to maintain the tree structure, but we do not capture + # the stack because that's too expensive for 'spawn_raw'. + + current = getcurrent() # pylint:disable=undefined-variable + self.spawning_greenlet = wref(current) + # See Greenlet for how trees are maintained. + try: + self.spawn_tree_locals = current.spawn_tree_locals + except AttributeError: + self.spawn_tree_locals = {} + if current.parent: + current.spawn_tree_locals = self.spawn_tree_locals + + +class SwitchOutGreenletWithLoop(TrackedRawGreenlet): + # Subclasses must define: + # - self.loop + + # This class defines loop in its .pxd for Cython. This lets us avoid + # circular dependencies with the hub. + + def switch(self): + switch_out = getattr(getcurrent(), 'switch_out', None) # pylint:disable=undefined-variable + if switch_out is not None: + switch_out() + return _greenlet_switch(self) # pylint:disable=undefined-variable + + def switch_out(self): + raise BlockingSwitchOutError('Impossible to call blocking function in the event loop callback') + + +def get_reachable_greenlets(): + # We compile this loop with Cython so that it's faster, and so that + # the GIL isn't dropped at unpredictable times during the loop. + # Dropping the GIL could lead to accessing partly constructed objects + # in undefined states (particularly, tuples). This helps close a hole + # where a `SystemError: Objects/tupleobject.c bad argument to internal function` + # could get raised. (Note that this probably doesn't completely close the hole, + # if other threads have dropped the GIL, but hopefully the speed makes that + # more rare.) See https://github.com/gevent/gevent/issues/1302 + return [ + x for x in get_objects() + if isinstance(x, greenlet) and not getattr(x, 'greenlet_tree_is_ignored', False) + ] + +def _init(): + greenlet_init() # pylint:disable=undefined-variable + +_init() + +from gevent._util import import_c_accel +import_c_accel(globals(), 'gevent.__greenlet_primitives') diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_hub_local.c b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_hub_local.c new file mode 100644 index 00000000..aee74de1 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_hub_local.c @@ -0,0 +1,5841 @@ +/* Generated by Cython 0.29.2 */ + +/* BEGIN: Cython Metadata +{ + "distutils": { + "depends": [ + "src/gevent/__hub_local.pxd", + "src\\gevent\\__hub_local.pxd" + ], + "include_dirs": [ + "C:\\Python37\\Include", + "deps" + ], + "name": "gevent.__hub_local", + "sources": [ + "src/gevent/_hub_local.py" + ] + }, + "module_name": "gevent.__hub_local" +} +END: Cython Metadata */ + +#define PY_SSIZE_T_CLEAN +#include "Python.h" +#ifndef Py_PYTHON_H + #error Python headers needed to compile C extensions, please install development version of Python. +#elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) + #error Cython requires Python 2.6+ or Python 3.3+. +#else +#define CYTHON_ABI "0_29_2" +#define CYTHON_HEX_VERSION 0x001D02F0 +#define CYTHON_FUTURE_DIVISION 1 +#include +#ifndef offsetof + #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) +#endif +#if !defined(WIN32) && !defined(MS_WINDOWS) + #ifndef __stdcall + #define __stdcall + #endif + #ifndef __cdecl + #define __cdecl + #endif + #ifndef __fastcall + #define __fastcall + #endif +#endif +#ifndef DL_IMPORT + #define DL_IMPORT(t) t +#endif +#ifndef DL_EXPORT + #define DL_EXPORT(t) t +#endif +#define __PYX_COMMA , +#ifndef HAVE_LONG_LONG + #if PY_VERSION_HEX >= 0x02070000 + #define HAVE_LONG_LONG + #endif +#endif +#ifndef PY_LONG_LONG + #define PY_LONG_LONG LONG_LONG +#endif +#ifndef Py_HUGE_VAL + #define Py_HUGE_VAL HUGE_VAL +#endif +#ifdef PYPY_VERSION + #define CYTHON_COMPILING_IN_PYPY 1 + #define CYTHON_COMPILING_IN_PYSTON 0 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #undef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 0 + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #if PY_VERSION_HEX < 0x03050000 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #elif !defined(CYTHON_USE_ASYNC_SLOTS) + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #undef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 0 + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #undef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 1 + #undef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 0 + #undef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 0 + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #undef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE 0 + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 +#elif defined(PYSTON_VERSION) + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_PYSTON 1 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #ifndef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 1 + #endif + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #ifndef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 1 + #endif + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #ifndef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 0 + #endif + #ifndef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 1 + #endif + #ifndef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 1 + #endif + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #undef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE 0 + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 +#else + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_PYSTON 0 + #define CYTHON_COMPILING_IN_CPYTHON 1 + #ifndef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 1 + #endif + #if PY_VERSION_HEX < 0x02070000 + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #elif !defined(CYTHON_USE_PYTYPE_LOOKUP) + #define CYTHON_USE_PYTYPE_LOOKUP 1 + #endif + #if PY_MAJOR_VERSION < 3 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #elif !defined(CYTHON_USE_ASYNC_SLOTS) + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #if PY_VERSION_HEX < 0x02070000 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #elif !defined(CYTHON_USE_PYLONG_INTERNALS) + #define CYTHON_USE_PYLONG_INTERNALS 1 + #endif + #ifndef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 1 + #endif + #ifndef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 1 + #endif + #if PY_VERSION_HEX < 0x030300F0 + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #elif !defined(CYTHON_USE_UNICODE_WRITER) + #define CYTHON_USE_UNICODE_WRITER 1 + #endif + #ifndef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 0 + #endif + #ifndef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 1 + #endif + #ifndef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 1 + #endif + #ifndef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 1 + #endif + #ifndef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 1 + #endif + #ifndef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000) + #endif + #ifndef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1) + #endif + #ifndef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1) + #endif + #ifndef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3) + #endif +#endif +#if !defined(CYTHON_FAST_PYCCALL) +#define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) +#endif +#if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #undef SHIFT + #undef BASE + #undef MASK + #ifdef SIZEOF_VOID_P + enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) }; + #endif +#endif +#ifndef __has_attribute + #define __has_attribute(x) 0 +#endif +#ifndef __has_cpp_attribute + #define __has_cpp_attribute(x) 0 +#endif +#ifndef CYTHON_RESTRICT + #if defined(__GNUC__) + #define CYTHON_RESTRICT __restrict__ + #elif defined(_MSC_VER) && _MSC_VER >= 1400 + #define CYTHON_RESTRICT __restrict + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_RESTRICT restrict + #else + #define CYTHON_RESTRICT + #endif +#endif +#ifndef CYTHON_UNUSED +# if defined(__GNUC__) +# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +#endif +#ifndef CYTHON_MAYBE_UNUSED_VAR +# if defined(__cplusplus) + template void CYTHON_MAYBE_UNUSED_VAR( const T& ) { } +# else +# define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x) +# endif +#endif +#ifndef CYTHON_NCP_UNUSED +# if CYTHON_COMPILING_IN_CPYTHON +# define CYTHON_NCP_UNUSED +# else +# define CYTHON_NCP_UNUSED CYTHON_UNUSED +# endif +#endif +#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) +#ifdef _MSC_VER + #ifndef _MSC_STDINT_H_ + #if _MSC_VER < 1300 + typedef unsigned char uint8_t; + typedef unsigned int uint32_t; + #else + typedef unsigned __int8 uint8_t; + typedef unsigned __int32 uint32_t; + #endif + #endif +#else + #include +#endif +#ifndef CYTHON_FALLTHROUGH + #if defined(__cplusplus) && __cplusplus >= 201103L + #if __has_cpp_attribute(fallthrough) + #define CYTHON_FALLTHROUGH [[fallthrough]] + #elif __has_cpp_attribute(clang::fallthrough) + #define CYTHON_FALLTHROUGH [[clang::fallthrough]] + #elif __has_cpp_attribute(gnu::fallthrough) + #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] + #endif + #endif + #ifndef CYTHON_FALLTHROUGH + #if __has_attribute(fallthrough) + #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) + #else + #define CYTHON_FALLTHROUGH + #endif + #endif + #if defined(__clang__ ) && defined(__apple_build_version__) + #if __apple_build_version__ < 7000000 + #undef CYTHON_FALLTHROUGH + #define CYTHON_FALLTHROUGH + #endif + #endif +#endif + +#ifndef CYTHON_INLINE + #if defined(__clang__) + #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) + #elif defined(__GNUC__) + #define CYTHON_INLINE __inline__ + #elif defined(_MSC_VER) + #define CYTHON_INLINE __inline + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_INLINE inline + #else + #define CYTHON_INLINE + #endif +#endif + +#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) + #define Py_OptimizeFlag 0 +#endif +#define __PYX_BUILD_PY_SSIZE_T "n" +#define CYTHON_FORMAT_SSIZE_T "z" +#if PY_MAJOR_VERSION < 3 + #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyClass_Type +#else + #define __Pyx_BUILTIN_MODULE_NAME "builtins" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyType_Type +#endif +#ifndef Py_TPFLAGS_CHECKTYPES + #define Py_TPFLAGS_CHECKTYPES 0 +#endif +#ifndef Py_TPFLAGS_HAVE_INDEX + #define Py_TPFLAGS_HAVE_INDEX 0 +#endif +#ifndef Py_TPFLAGS_HAVE_NEWBUFFER + #define Py_TPFLAGS_HAVE_NEWBUFFER 0 +#endif +#ifndef Py_TPFLAGS_HAVE_FINALIZE + #define Py_TPFLAGS_HAVE_FINALIZE 0 +#endif +#ifndef METH_STACKLESS + #define METH_STACKLESS 0 +#endif +#if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) + #ifndef METH_FASTCALL + #define METH_FASTCALL 0x80 + #endif + typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs); + typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args, + Py_ssize_t nargs, PyObject *kwnames); +#else + #define __Pyx_PyCFunctionFast _PyCFunctionFast + #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords +#endif +#if CYTHON_FAST_PYCCALL +#define __Pyx_PyFastCFunction_Check(func)\ + ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS))))) +#else +#define __Pyx_PyFastCFunction_Check(func) 0 +#endif +#if CYTHON_USE_DICT_VERSIONS +#define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) +#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ + (version_var) = __PYX_GET_DICT_VERSION(dict);\ + (cache_var) = (value); +#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ + static PY_UINT64_T __pyx_dict_version = 0;\ + static PyObject *__pyx_dict_cached_value = NULL;\ + if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ + (VAR) = __pyx_dict_cached_value;\ + } else {\ + (VAR) = __pyx_dict_cached_value = (LOOKUP);\ + __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ + }\ + } +#else +#define __PYX_GET_DICT_VERSION(dict) (0) +#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) +#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) + #define PyObject_Malloc(s) PyMem_Malloc(s) + #define PyObject_Free(p) PyMem_Free(p) + #define PyObject_Realloc(p) PyMem_Realloc(p) +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1 + #define PyMem_RawMalloc(n) PyMem_Malloc(n) + #define PyMem_RawRealloc(p, n) PyMem_Realloc(p, n) + #define PyMem_RawFree(p) PyMem_Free(p) +#endif +#if CYTHON_COMPILING_IN_PYSTON + #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co) + #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno) +#else + #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) + #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) +#endif +#if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000 + #define __Pyx_PyThreadState_Current PyThreadState_GET() +#elif PY_VERSION_HEX >= 0x03060000 + #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() +#elif PY_VERSION_HEX >= 0x03000000 + #define __Pyx_PyThreadState_Current PyThreadState_GET() +#else + #define __Pyx_PyThreadState_Current _PyThreadState_Current +#endif +#if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) +#include "pythread.h" +#define Py_tss_NEEDS_INIT 0 +typedef int Py_tss_t; +static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) { + *key = PyThread_create_key(); + return 0; // PyThread_create_key reports success always +} +static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) { + Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t)); + *key = Py_tss_NEEDS_INIT; + return key; +} +static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) { + PyObject_Free(key); +} +static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) { + return *key != Py_tss_NEEDS_INIT; +} +static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) { + PyThread_delete_key(*key); + *key = Py_tss_NEEDS_INIT; +} +static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) { + return PyThread_set_key_value(*key, value); +} +static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { + return PyThread_get_key_value(*key); +} +#endif // TSS (Thread Specific Storage) API +#if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized) +#define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) +#else +#define __Pyx_PyDict_NewPresized(n) PyDict_New() +#endif +#if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION + #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) +#else + #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS +#define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) +#else +#define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name) +#endif +#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) + #define CYTHON_PEP393_ENABLED 1 + #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ + 0 : _PyUnicode_Ready((PyObject *)(op))) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) + #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) + #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) + #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) + #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) + #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch) + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) +#else + #define CYTHON_PEP393_ENABLED 0 + #define PyUnicode_1BYTE_KIND 1 + #define PyUnicode_2BYTE_KIND 2 + #define PyUnicode_4BYTE_KIND 4 + #define __Pyx_PyUnicode_READY(op) (0) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) + #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111) + #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) + #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) + #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) + #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch) + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) +#endif +#if CYTHON_COMPILING_IN_PYPY + #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) +#else + #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ + PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains) + #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check) + #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format) + #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) +#endif +#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) +#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) +#else + #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) +#endif +#if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) + #define PyObject_ASCII(o) PyObject_Repr(o) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBaseString_Type PyUnicode_Type + #define PyStringObject PyUnicodeObject + #define PyString_Type PyUnicode_Type + #define PyString_Check PyUnicode_Check + #define PyString_CheckExact PyUnicode_CheckExact + #define PyObject_Unicode PyObject_Str +#endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) + #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) +#else + #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) + #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) +#endif +#ifndef PySet_CheckExact + #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) +#endif +#if CYTHON_ASSUME_SAFE_MACROS + #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) +#else + #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyIntObject PyLongObject + #define PyInt_Type PyLong_Type + #define PyInt_Check(op) PyLong_Check(op) + #define PyInt_CheckExact(op) PyLong_CheckExact(op) + #define PyInt_FromString PyLong_FromString + #define PyInt_FromUnicode PyLong_FromUnicode + #define PyInt_FromLong PyLong_FromLong + #define PyInt_FromSize_t PyLong_FromSize_t + #define PyInt_FromSsize_t PyLong_FromSsize_t + #define PyInt_AsLong PyLong_AsLong + #define PyInt_AS_LONG PyLong_AS_LONG + #define PyInt_AsSsize_t PyLong_AsSsize_t + #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask + #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask + #define PyNumber_Int PyNumber_Long +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBoolObject PyLongObject +#endif +#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY + #ifndef PyUnicode_InternFromString + #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) + #endif +#endif +#if PY_VERSION_HEX < 0x030200A4 + typedef long Py_hash_t; + #define __Pyx_PyInt_FromHash_t PyInt_FromLong + #define __Pyx_PyInt_AsHash_t PyInt_AsLong +#else + #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t + #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t +#endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : (Py_INCREF(func), func)) +#else + #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) +#endif +#if CYTHON_USE_ASYNC_SLOTS + #if PY_VERSION_HEX >= 0x030500B1 + #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods + #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) + #else + #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) + #endif +#else + #define __Pyx_PyType_AsAsync(obj) NULL +#endif +#ifndef __Pyx_PyAsyncMethodsStruct + typedef struct { + unaryfunc am_await; + unaryfunc am_aiter; + unaryfunc am_anext; + } __Pyx_PyAsyncMethodsStruct; +#endif + +#if defined(WIN32) || defined(MS_WINDOWS) + #define _USE_MATH_DEFINES +#endif +#include +#ifdef NAN +#define __PYX_NAN() ((float) NAN) +#else +static CYTHON_INLINE float __PYX_NAN() { + float value; + memset(&value, 0xFF, sizeof(value)); + return value; +} +#endif +#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) +#define __Pyx_truncl trunc +#else +#define __Pyx_truncl truncl +#endif + + +#define __PYX_ERR(f_index, lineno, Ln_error) \ +{ \ + __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \ +} + +#ifndef __PYX_EXTERN_C + #ifdef __cplusplus + #define __PYX_EXTERN_C extern "C" + #else + #define __PYX_EXTERN_C extern + #endif +#endif + +#define __PYX_HAVE__gevent____hub_local +#define __PYX_HAVE_API__gevent____hub_local +/* Early includes */ +#include "greenlet/greenlet.h" +#ifdef _OPENMP +#include +#endif /* _OPENMP */ + +#if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) +#define CYTHON_WITHOUT_ASSERTIONS +#endif + +typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; + const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; + +#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 +#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0 +#define __PYX_DEFAULT_STRING_ENCODING "" +#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString +#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#define __Pyx_uchar_cast(c) ((unsigned char)c) +#define __Pyx_long_cast(x) ((long)x) +#define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ + (sizeof(type) < sizeof(Py_ssize_t)) ||\ + (sizeof(type) > sizeof(Py_ssize_t) &&\ + likely(v < (type)PY_SSIZE_T_MAX ||\ + v == (type)PY_SSIZE_T_MAX) &&\ + (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ + v == (type)PY_SSIZE_T_MIN))) ||\ + (sizeof(type) == sizeof(Py_ssize_t) &&\ + (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ + v == (type)PY_SSIZE_T_MAX))) ) +static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) { + return (size_t) i < (size_t) limit; +} +#if defined (__cplusplus) && __cplusplus >= 201103L + #include + #define __Pyx_sst_abs(value) std::abs(value) +#elif SIZEOF_INT >= SIZEOF_SIZE_T + #define __Pyx_sst_abs(value) abs(value) +#elif SIZEOF_LONG >= SIZEOF_SIZE_T + #define __Pyx_sst_abs(value) labs(value) +#elif defined (_MSC_VER) + #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) +#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define __Pyx_sst_abs(value) llabs(value) +#elif defined (__GNUC__) + #define __Pyx_sst_abs(value) __builtin_llabs(value) +#else + #define __Pyx_sst_abs(value) ((value<0) ? -value : value) +#endif +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*); +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); +#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) +#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) +#define __Pyx_PyBytes_FromString PyBytes_FromString +#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); +#if PY_MAJOR_VERSION < 3 + #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#else + #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize +#endif +#define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) +#define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) +#define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) +#define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) +#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) +static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) { + const Py_UNICODE *u_end = u; + while (*u_end++) ; + return (size_t)(u_end - u - 1); +} +#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) +#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode +#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode +#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) +#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) +static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); +static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*); +static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); +#define __Pyx_PySequence_Tuple(obj)\ + (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); +#if CYTHON_ASSUME_SAFE_MACROS +#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) +#else +#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) +#endif +#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) +#if PY_MAJOR_VERSION >= 3 +#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) +#else +#define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) +#endif +#define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x)) +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII +static int __Pyx_sys_getdefaultencoding_not_ascii; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + PyObject* ascii_chars_u = NULL; + PyObject* ascii_chars_b = NULL; + const char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + if (strcmp(default_encoding_c, "ascii") == 0) { + __Pyx_sys_getdefaultencoding_not_ascii = 0; + } else { + char ascii_chars[128]; + int c; + for (c = 0; c < 128; c++) { + ascii_chars[c] = c; + } + __Pyx_sys_getdefaultencoding_not_ascii = 1; + ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); + if (!ascii_chars_u) goto bad; + ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); + if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { + PyErr_Format( + PyExc_ValueError, + "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", + default_encoding_c); + goto bad; + } + Py_DECREF(ascii_chars_u); + Py_DECREF(ascii_chars_b); + } + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + Py_XDECREF(ascii_chars_u); + Py_XDECREF(ascii_chars_b); + return -1; +} +#endif +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) +#else +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +static char* __PYX_DEFAULT_STRING_ENCODING; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1); + if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; + strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + return -1; +} +#endif +#endif + + +/* Test for GCC > 2.95 */ +#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) + #define likely(x) __builtin_expect(!!(x), 1) + #define unlikely(x) __builtin_expect(!!(x), 0) +#else /* !__GNUC__ or GCC < 2.95 */ + #define likely(x) (x) + #define unlikely(x) (x) +#endif /* __GNUC__ */ +static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } + +static PyObject *__pyx_m = NULL; +static PyObject *__pyx_d; +static PyObject *__pyx_b; +static PyObject *__pyx_cython_runtime = NULL; +static PyObject *__pyx_empty_tuple; +static PyObject *__pyx_empty_bytes; +static PyObject *__pyx_empty_unicode; +static int __pyx_lineno; +static int __pyx_clineno = 0; +static const char * __pyx_cfilenm= __FILE__; +static const char *__pyx_filename; + + +static const char *__pyx_f[] = { + "src\\gevent\\_hub_local.py", + "src\\gevent\\__greenlet_primitives.pxd", +}; + +/*--- Type declarations ---*/ +struct __pyx_obj_6gevent_21__greenlet_primitives_TrackedRawGreenlet; +struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop; + +/* "gevent/__greenlet_primitives.pxd":37 + * return PyGreenlet_Switch(self, NULL, NULL) + * + * cdef class TrackedRawGreenlet(greenlet): # <<<<<<<<<<<<<< + * pass + * + */ +struct __pyx_obj_6gevent_21__greenlet_primitives_TrackedRawGreenlet { + PyGreenlet __pyx_base; +}; + + +/* "gevent/__greenlet_primitives.pxd":40 + * pass + * + * cdef class SwitchOutGreenletWithLoop(TrackedRawGreenlet): # <<<<<<<<<<<<<< + * cdef public loop + * + */ +struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop { + struct __pyx_obj_6gevent_21__greenlet_primitives_TrackedRawGreenlet __pyx_base; + struct __pyx_vtabstruct_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *__pyx_vtab; + PyObject *loop; +}; + + + +struct __pyx_vtabstruct_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop { + PyObject *(*__pyx_switch)(struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *, int __pyx_skip_dispatch); + PyObject *(*switch_out)(struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *, int __pyx_skip_dispatch); +}; +static struct __pyx_vtabstruct_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *__pyx_vtabptr_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop; + +/* --- Runtime support code (head) --- */ +/* Refnanny.proto */ +#ifndef CYTHON_REFNANNY + #define CYTHON_REFNANNY 0 +#endif +#if CYTHON_REFNANNY + typedef struct { + void (*INCREF)(void*, PyObject*, int); + void (*DECREF)(void*, PyObject*, int); + void (*GOTREF)(void*, PyObject*, int); + void (*GIVEREF)(void*, PyObject*, int); + void* (*SetupContext)(const char*, int, const char*); + void (*FinishContext)(void**); + } __Pyx_RefNannyAPIStruct; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); + #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; +#ifdef WITH_THREAD + #define __Pyx_RefNannySetupContext(name, acquire_gil)\ + if (acquire_gil) {\ + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ + PyGILState_Release(__pyx_gilstate_save);\ + } else {\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ + } +#else + #define __Pyx_RefNannySetupContext(name, acquire_gil)\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) +#endif + #define __Pyx_RefNannyFinishContext()\ + __Pyx_RefNanny->FinishContext(&__pyx_refnanny) + #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0) + #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) + #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) + #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) +#else + #define __Pyx_RefNannyDeclarations + #define __Pyx_RefNannySetupContext(name, acquire_gil) + #define __Pyx_RefNannyFinishContext() + #define __Pyx_INCREF(r) Py_INCREF(r) + #define __Pyx_DECREF(r) Py_DECREF(r) + #define __Pyx_GOTREF(r) + #define __Pyx_GIVEREF(r) + #define __Pyx_XINCREF(r) Py_XINCREF(r) + #define __Pyx_XDECREF(r) Py_XDECREF(r) + #define __Pyx_XGOTREF(r) + #define __Pyx_XGIVEREF(r) +#endif +#define __Pyx_XDECREF_SET(r, v) do {\ + PyObject *tmp = (PyObject *) r;\ + r = v; __Pyx_XDECREF(tmp);\ + } while (0) +#define __Pyx_DECREF_SET(r, v) do {\ + PyObject *tmp = (PyObject *) r;\ + r = v; __Pyx_DECREF(tmp);\ + } while (0) +#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) +#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) + +/* PyObjectGetAttrStr.proto */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); +#else +#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) +#endif + +/* GetBuiltinName.proto */ +static PyObject *__Pyx_GetBuiltinName(PyObject *name); + +/* GetModuleGlobalName.proto */ +#if CYTHON_USE_DICT_VERSIONS +#define __Pyx_GetModuleGlobalName(var, name) {\ + static PY_UINT64_T __pyx_dict_version = 0;\ + static PyObject *__pyx_dict_cached_value = NULL;\ + (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\ + (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\ + __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ +} +#define __Pyx_GetModuleGlobalNameUncached(var, name) {\ + PY_UINT64_T __pyx_dict_version;\ + PyObject *__pyx_dict_cached_value;\ + (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ +} +static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value); +#else +#define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name) +#define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name) +static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name); +#endif + +/* PyObjectCall.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); +#else +#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) +#endif + +/* PyFunctionFastCall.proto */ +#if CYTHON_FAST_PYCALL +#define __Pyx_PyFunction_FastCall(func, args, nargs)\ + __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) +#if 1 || PY_VERSION_HEX < 0x030600B1 +static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs); +#else +#define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs) +#endif +#define __Pyx_BUILD_ASSERT_EXPR(cond)\ + (sizeof(char [1 - 2*!(cond)]) - 1) +#ifndef Py_MEMBER_SIZE +#define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member) +#endif + static size_t __pyx_pyframe_localsplus_offset = 0; + #include "frameobject.h" + #define __Pxy_PyFrame_Initialize_Offsets()\ + ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\ + (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus))) + #define __Pyx_PyFrame_GetLocalsplus(frame)\ + (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset)) +#endif + +/* PyObjectCallMethO.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); +#endif + +/* PyObjectCallNoArg.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); +#else +#define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL) +#endif + +/* PyCFunctionFastCall.proto */ +#if CYTHON_FAST_PYCCALL +static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs); +#else +#define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL) +#endif + +/* PyObjectCallOneArg.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); + +/* PyObjectSetAttrStr.proto */ +#if CYTHON_USE_TYPE_SLOTS +#define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o, n, NULL) +static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value); +#else +#define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n) +#define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v) +#endif + +/* KeywordStringCheck.proto */ +static int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* function_name, int kw_allowed); + +/* ExtTypeTest.proto */ +static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); + +/* ArgTypeTest.proto */ +#define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\ + ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\ + __Pyx__ArgTypeTest(obj, type, name, exact)) +static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact); + +/* TypeImport.proto */ +#ifndef __PYX_HAVE_RT_ImportType_proto +#define __PYX_HAVE_RT_ImportType_proto +enum __Pyx_ImportType_CheckSize { + __Pyx_ImportType_CheckSize_Error = 0, + __Pyx_ImportType_CheckSize_Warn = 1, + __Pyx_ImportType_CheckSize_Ignore = 2 +}; +static PyTypeObject *__Pyx_ImportType(PyObject* module, const char *module_name, const char *class_name, size_t size, enum __Pyx_ImportType_CheckSize check_size); +#endif + +/* GetVTable.proto */ +static void* __Pyx_GetVtable(PyObject *dict); + +/* Import.proto */ +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); + +/* ImportFrom.proto */ +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); + +/* CalculateMetaclass.proto */ +static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases); + +/* FetchCommonType.proto */ +static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); + +/* CythonFunction.proto */ +#define __Pyx_CyFunction_USED 1 +#define __Pyx_CYFUNCTION_STATICMETHOD 0x01 +#define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 +#define __Pyx_CYFUNCTION_CCLASS 0x04 +#define __Pyx_CyFunction_GetClosure(f)\ + (((__pyx_CyFunctionObject *) (f))->func_closure) +#define __Pyx_CyFunction_GetClassObj(f)\ + (((__pyx_CyFunctionObject *) (f))->func_classobj) +#define __Pyx_CyFunction_Defaults(type, f)\ + ((type *)(((__pyx_CyFunctionObject *) (f))->defaults)) +#define __Pyx_CyFunction_SetDefaultsGetter(f, g)\ + ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g) +typedef struct { + PyCFunctionObject func; +#if PY_VERSION_HEX < 0x030500A0 + PyObject *func_weakreflist; +#endif + PyObject *func_dict; + PyObject *func_name; + PyObject *func_qualname; + PyObject *func_doc; + PyObject *func_globals; + PyObject *func_code; + PyObject *func_closure; + PyObject *func_classobj; + void *defaults; + int defaults_pyobjects; + int flags; + PyObject *defaults_tuple; + PyObject *defaults_kwdict; + PyObject *(*defaults_getter)(PyObject *); + PyObject *func_annotations; +} __pyx_CyFunctionObject; +static PyTypeObject *__pyx_CyFunctionType = 0; +#define __Pyx_CyFunction_Check(obj) (__Pyx_TypeCheck(obj, __pyx_CyFunctionType)) +#define __Pyx_CyFunction_NewEx(ml, flags, qualname, self, module, globals, code)\ + __Pyx_CyFunction_New(__pyx_CyFunctionType, ml, flags, qualname, self, module, globals, code) +static PyObject *__Pyx_CyFunction_New(PyTypeObject *, PyMethodDef *ml, + int flags, PyObject* qualname, + PyObject *self, + PyObject *module, PyObject *globals, + PyObject* code); +static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, + size_t size, + int pyobjects); +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, + PyObject *tuple); +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, + PyObject *dict); +static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m, + PyObject *dict); +static int __pyx_CyFunction_init(void); + +/* SetNameInClass.proto */ +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 +#define __Pyx_SetNameInClass(ns, name, value)\ + (likely(PyDict_CheckExact(ns)) ? _PyDict_SetItem_KnownHash(ns, name, value, ((PyASCIIObject *) name)->hash) : PyObject_SetItem(ns, name, value)) +#elif CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_SetNameInClass(ns, name, value)\ + (likely(PyDict_CheckExact(ns)) ? PyDict_SetItem(ns, name, value) : PyObject_SetItem(ns, name, value)) +#else +#define __Pyx_SetNameInClass(ns, name, value) PyObject_SetItem(ns, name, value) +#endif + +/* Py3ClassCreate.proto */ +static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname, + PyObject *mkw, PyObject *modname, PyObject *doc); +static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict, + PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass); + +/* GetAttr.proto */ +static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *); + +/* Globals.proto */ +static PyObject* __Pyx_Globals(void); + +/* PyThreadStateGet.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; +#define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; +#define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type +#else +#define __Pyx_PyThreadState_declare +#define __Pyx_PyThreadState_assign +#define __Pyx_PyErr_Occurred() PyErr_Occurred() +#endif + +/* PyErrFetchRestore.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) +#define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) +#define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) +#define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) +#define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); +static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) +#else +#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) +#endif +#else +#define __Pyx_PyErr_Clear() PyErr_Clear() +#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) +#define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) +#define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb) +#define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) +#endif + +/* CLineInTraceback.proto */ +#ifdef CYTHON_CLINE_IN_TRACEBACK +#define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) +#else +static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line); +#endif + +/* CodeObjectCache.proto */ +typedef struct { + PyCodeObject* code_object; + int code_line; +} __Pyx_CodeObjectCacheEntry; +struct __Pyx_CodeObjectCache { + int count; + int max_count; + __Pyx_CodeObjectCacheEntry* entries; +}; +static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); +static PyCodeObject *__pyx_find_code_object(int code_line); +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); + +/* AddTraceback.proto */ +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename); + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); + +/* CIntFromPy.proto */ +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); + +/* CIntFromPy.proto */ +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); + +/* FastTypeChecks.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) +static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b); +static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type); +static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2); +#else +#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) +#define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) +#define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) +#endif +#define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) + +/* CheckBinaryVersion.proto */ +static int __Pyx_check_binary_version(void); + +/* VoidPtrExport.proto */ +static int __Pyx_ExportVoidPtr(PyObject *name, void *p, const char *sig); + +/* FunctionExport.proto */ +static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig); + +/* VoidPtrImport.proto */ +static int __Pyx_ImportVoidPtr(PyObject *module, const char *name, void **p, const char *sig); + +/* InitStrings.proto */ +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); + + +/* Module declarations from 'cython' */ + +/* Module declarations from 'greenlet' */ + +/* Module declarations from 'gevent.__greenlet_primitives' */ +static PyTypeObject *__pyx_ptype_6gevent_21__greenlet_primitives_greenlet = 0; +static PyTypeObject *__pyx_ptype_6gevent_21__greenlet_primitives_TrackedRawGreenlet = 0; +static PyTypeObject *__pyx_ptype_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop = 0; +static PyObject **__pyx_vp_6gevent_21__greenlet_primitives_get_objects = 0; +#define __pyx_v_6gevent_21__greenlet_primitives_get_objects (*__pyx_vp_6gevent_21__greenlet_primitives_get_objects) +static PyObject **__pyx_vp_6gevent_21__greenlet_primitives_wref = 0; +#define __pyx_v_6gevent_21__greenlet_primitives_wref (*__pyx_vp_6gevent_21__greenlet_primitives_wref) +static PyObject **__pyx_vp_6gevent_21__greenlet_primitives_BlockingSwitchOutError = 0; +#define __pyx_v_6gevent_21__greenlet_primitives_BlockingSwitchOutError (*__pyx_vp_6gevent_21__greenlet_primitives_BlockingSwitchOutError) +static int *__pyx_vp_6gevent_21__greenlet_primitives__greenlet_imported = 0; +#define __pyx_v_6gevent_21__greenlet_primitives__greenlet_imported (*__pyx_vp_6gevent_21__greenlet_primitives__greenlet_imported) + +/* Module declarations from 'gevent.__hub_local' */ +static PyObject *__pyx_v_6gevent_11__hub_local__threadlocal = 0; +static PyObject *__pyx_f_6gevent_11__hub_local_get_hub_class(int __pyx_skip_dispatch); /*proto*/ +static struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *__pyx_f_6gevent_11__hub_local_get_hub_if_exists(int __pyx_skip_dispatch); /*proto*/ +static PyObject *__pyx_f_6gevent_11__hub_local_set_hub(struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *, int __pyx_skip_dispatch); /*proto*/ +static PyObject *__pyx_f_6gevent_11__hub_local_get_loop(int __pyx_skip_dispatch); /*proto*/ +static PyObject *__pyx_f_6gevent_11__hub_local_set_loop(PyObject *, int __pyx_skip_dispatch); /*proto*/ +static struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *__pyx_f_6gevent_11__hub_local_get_hub_noargs(int __pyx_skip_dispatch); /*proto*/ +#define __Pyx_MODULE_NAME "gevent.__hub_local" +extern int __pyx_module_is_main_gevent____hub_local; +int __pyx_module_is_main_gevent____hub_local = 0; + +/* Implementation of 'gevent.__hub_local' */ +static PyObject *__pyx_builtin___import__; +static PyObject *__pyx_builtin_super; +static const char __pyx_k_Hub[] = "Hub"; +static const char __pyx_k_all[] = "__all__"; +static const char __pyx_k_doc[] = "__doc__"; +static const char __pyx_k_hub[] = "hub"; +static const char __pyx_k_args[] = "args"; +static const char __pyx_k_init[] = "__init__"; +static const char __pyx_k_loop[] = "loop"; +static const char __pyx_k_main[] = "__main__"; +static const char __pyx_k_name[] = "__name__"; +static const char __pyx_k_self[] = "self"; +static const char __pyx_k_test[] = "__test__"; +static const char __pyx_k_local[] = "_local"; +static const char __pyx_k_super[] = "super"; +static const char __pyx_k_import[] = "__import__"; +static const char __pyx_k_kwargs[] = "kwargs"; +static const char __pyx_k_module[] = "__module__"; +static const char __pyx_k_get_hub[] = "get_hub"; +static const char __pyx_k_hubtype[] = "hubtype"; +static const char __pyx_k_prepare[] = "__prepare__"; +static const char __pyx_k_set_hub[] = "set_hub"; +static const char __pyx_k_get_loop[] = "get_loop"; +static const char __pyx_k_pyx_capi[] = "__pyx_capi__"; +static const char __pyx_k_qualname[] = "__qualname__"; +static const char __pyx_k_set_loop[] = "set_loop"; +static const char __pyx_k_metaclass[] = "__metaclass__"; +static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__"; +static const char __pyx_k_Threadlocal[] = "_Threadlocal"; +static const char __pyx_k_threadlocal[] = "_threadlocal"; +static const char __pyx_k_gevent__util[] = "gevent._util"; +static const char __pyx_k_get_hub_class[] = "get_hub_class"; +static const char __pyx_k_get_hub_noargs[] = "get_hub_noargs"; +static const char __pyx_k_gevent__compat[] = "gevent._compat"; +static const char __pyx_k_import_c_accel[] = "import_c_accel"; +static const char __pyx_k_thread_mod_name[] = "thread_mod_name"; +static const char __pyx_k_get_hub_if_exists[] = "get_hub_if_exists"; +static const char __pyx_k_Threadlocal___init[] = "_Threadlocal.__init__"; +static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; +static const char __pyx_k_gevent___hub_local[] = "gevent.__hub_local"; +static const char __pyx_k_set_default_hub_class[] = "set_default_hub_class"; +static const char __pyx_k_src_gevent__hub_local_py[] = "src\\gevent\\_hub_local.py"; +static const char __pyx_k_Maintains_the_thread_local_hub[] = "\nMaintains the thread local hub.\n\n"; +static PyObject *__pyx_n_s_Hub; +static PyObject *__pyx_n_s_Threadlocal; +static PyObject *__pyx_n_s_Threadlocal___init; +static PyObject *__pyx_n_s_all; +static PyObject *__pyx_n_s_args; +static PyObject *__pyx_n_s_cline_in_traceback; +static PyObject *__pyx_n_s_doc; +static PyObject *__pyx_n_s_get_hub; +static PyObject *__pyx_n_s_get_hub_class; +static PyObject *__pyx_n_s_get_hub_if_exists; +static PyObject *__pyx_n_s_get_hub_noargs; +static PyObject *__pyx_n_s_get_loop; +static PyObject *__pyx_n_s_gevent___hub_local; +static PyObject *__pyx_n_s_gevent__compat; +static PyObject *__pyx_n_s_gevent__util; +static PyObject *__pyx_n_s_hub; +static PyObject *__pyx_n_s_hubtype; +static PyObject *__pyx_n_s_import; +static PyObject *__pyx_n_s_import_c_accel; +static PyObject *__pyx_n_s_init; +static PyObject *__pyx_n_s_kwargs; +static PyObject *__pyx_n_s_local; +static PyObject *__pyx_n_s_loop; +static PyObject *__pyx_n_s_main; +static PyObject *__pyx_n_s_metaclass; +static PyObject *__pyx_n_s_module; +static PyObject *__pyx_n_s_name; +static PyObject *__pyx_n_s_prepare; +static PyObject *__pyx_n_s_pyx_capi; +static PyObject *__pyx_n_s_pyx_vtable; +static PyObject *__pyx_n_s_qualname; +static PyObject *__pyx_n_s_self; +static PyObject *__pyx_n_s_set_default_hub_class; +static PyObject *__pyx_n_s_set_hub; +static PyObject *__pyx_n_s_set_loop; +static PyObject *__pyx_kp_s_src_gevent__hub_local_py; +static PyObject *__pyx_n_s_super; +static PyObject *__pyx_n_s_test; +static PyObject *__pyx_n_s_thread_mod_name; +static PyObject *__pyx_n_s_threadlocal; +static PyObject *__pyx_pf_6gevent_11__hub_local_12_Threadlocal___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_11__hub_local_get_hub_class(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_6gevent_11__hub_local_2set_default_hub_class(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_hubtype); /* proto */ +static PyObject *__pyx_pf_6gevent_11__hub_local_4get_hub(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */ +static PyObject *__pyx_pf_6gevent_11__hub_local_6get_hub_noargs(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_6gevent_11__hub_local_8get_hub_if_exists(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_6gevent_11__hub_local_10set_hub(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *__pyx_v_hub); /* proto */ +static PyObject *__pyx_pf_6gevent_11__hub_local_12get_loop(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_6gevent_11__hub_local_14set_loop(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_loop); /* proto */ +static PyObject *__pyx_tuple_; +static PyObject *__pyx_tuple__4; +static PyObject *__pyx_tuple__6; +static PyObject *__pyx_tuple__10; +static PyObject *__pyx_tuple__13; +static PyObject *__pyx_codeobj__2; +static PyObject *__pyx_codeobj__3; +static PyObject *__pyx_codeobj__5; +static PyObject *__pyx_codeobj__7; +static PyObject *__pyx_codeobj__8; +static PyObject *__pyx_codeobj__9; +static PyObject *__pyx_codeobj__11; +static PyObject *__pyx_codeobj__12; +static PyObject *__pyx_codeobj__14; +/* Late includes */ + +/* "src/gevent/_hub_local.py":26 + * class _Threadlocal(__import__(thread_mod_name)._local): + * + * def __init__(self): # <<<<<<<<<<<<<< + * # Use a class with an initializer so that we can test + * # for 'is None' instead of catching AttributeError, making + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_11__hub_local_12_Threadlocal_1__init__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_6gevent_11__hub_local_12_Threadlocal_1__init__ = {"__init__", (PyCFunction)__pyx_pw_6gevent_11__hub_local_12_Threadlocal_1__init__, METH_O, 0}; +static PyObject *__pyx_pw_6gevent_11__hub_local_12_Threadlocal_1__init__(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_11__hub_local_12_Threadlocal___init__(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_11__hub_local_12_Threadlocal___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "src/gevent/_hub_local.py":31 + * # the code cleaner and possibly solving some corner cases + * # (like #687) + * super(_Threadlocal, self).__init__() # <<<<<<<<<<<<<< + * self.Hub = None + * self.loop = None + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Threadlocal); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 31, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 31, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __Pyx_INCREF(__pyx_v_self); + __Pyx_GIVEREF(__pyx_v_self); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_self); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 31, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_init); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 31, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_2)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 31, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_hub_local.py":32 + * # (like #687) + * super(_Threadlocal, self).__init__() + * self.Hub = None # <<<<<<<<<<<<<< + * self.loop = None + * self.hub = None + */ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_Hub, Py_None) < 0) __PYX_ERR(0, 32, __pyx_L1_error) + + /* "src/gevent/_hub_local.py":33 + * super(_Threadlocal, self).__init__() + * self.Hub = None + * self.loop = None # <<<<<<<<<<<<<< + * self.hub = None + * + */ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_loop, Py_None) < 0) __PYX_ERR(0, 33, __pyx_L1_error) + + /* "src/gevent/_hub_local.py":34 + * self.Hub = None + * self.loop = None + * self.hub = None # <<<<<<<<<<<<<< + * + * _threadlocal = _Threadlocal() + */ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_hub, Py_None) < 0) __PYX_ERR(0, 34, __pyx_L1_error) + + /* "src/gevent/_hub_local.py":26 + * class _Threadlocal(__import__(thread_mod_name)._local): + * + * def __init__(self): # <<<<<<<<<<<<<< + * # Use a class with an initializer so that we can test + * # for 'is None' instead of catching AttributeError, making + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("gevent.__hub_local._Threadlocal.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_hub_local.py":40 + * Hub = None # Set when gevent.hub is imported + * + * def get_hub_class(): # <<<<<<<<<<<<<< + * """Return the type of hub to use for the current thread. + * + */ + +static PyObject *__pyx_pw_6gevent_11__hub_local_1get_hub_class(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_f_6gevent_11__hub_local_get_hub_class(CYTHON_UNUSED int __pyx_skip_dispatch) { + PyObject *__pyx_v_hubtype = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + __Pyx_RefNannySetupContext("get_hub_class", 0); + + /* "src/gevent/_hub_local.py":45 + * If there's no type of hub for the current thread yet, 'gevent.hub.Hub' is used. + * """ + * hubtype = _threadlocal.Hub # <<<<<<<<<<<<<< + * if hubtype is None: + * hubtype = _threadlocal.Hub = Hub + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_6gevent_11__hub_local__threadlocal, __pyx_n_s_Hub); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 45, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_hubtype = __pyx_t_1; + __pyx_t_1 = 0; + + /* "src/gevent/_hub_local.py":46 + * """ + * hubtype = _threadlocal.Hub + * if hubtype is None: # <<<<<<<<<<<<<< + * hubtype = _threadlocal.Hub = Hub + * return hubtype + */ + __pyx_t_2 = (__pyx_v_hubtype == Py_None); + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "src/gevent/_hub_local.py":47 + * hubtype = _threadlocal.Hub + * if hubtype is None: + * hubtype = _threadlocal.Hub = Hub # <<<<<<<<<<<<<< + * return hubtype + * + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Hub); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 47, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_t_1); + __Pyx_DECREF_SET(__pyx_v_hubtype, __pyx_t_1); + if (__Pyx_PyObject_SetAttrStr(__pyx_v_6gevent_11__hub_local__threadlocal, __pyx_n_s_Hub, __pyx_t_1) < 0) __PYX_ERR(0, 47, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_hub_local.py":46 + * """ + * hubtype = _threadlocal.Hub + * if hubtype is None: # <<<<<<<<<<<<<< + * hubtype = _threadlocal.Hub = Hub + * return hubtype + */ + } + + /* "src/gevent/_hub_local.py":48 + * if hubtype is None: + * hubtype = _threadlocal.Hub = Hub + * return hubtype # <<<<<<<<<<<<<< + * + * def set_default_hub_class(hubtype): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_hubtype); + __pyx_r = __pyx_v_hubtype; + goto __pyx_L0; + + /* "src/gevent/_hub_local.py":40 + * Hub = None # Set when gevent.hub is imported + * + * def get_hub_class(): # <<<<<<<<<<<<<< + * """Return the type of hub to use for the current thread. + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__hub_local.get_hub_class", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_hubtype); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_11__hub_local_1get_hub_class(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6gevent_11__hub_local_get_hub_class[] = "Return the type of hub to use for the current thread.\n\n If there's no type of hub for the current thread yet, 'gevent.hub.Hub' is used.\n "; +static PyMethodDef __pyx_mdef_6gevent_11__hub_local_1get_hub_class = {"get_hub_class", (PyCFunction)__pyx_pw_6gevent_11__hub_local_1get_hub_class, METH_NOARGS, __pyx_doc_6gevent_11__hub_local_get_hub_class}; +static PyObject *__pyx_pw_6gevent_11__hub_local_1get_hub_class(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get_hub_class (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_11__hub_local_get_hub_class(__pyx_self); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_11__hub_local_get_hub_class(CYTHON_UNUSED PyObject *__pyx_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("get_hub_class", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6gevent_11__hub_local_get_hub_class(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 40, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__hub_local.get_hub_class", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_hub_local.py":50 + * return hubtype + * + * def set_default_hub_class(hubtype): # <<<<<<<<<<<<<< + * global Hub + * Hub = hubtype + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_11__hub_local_3set_default_hub_class(PyObject *__pyx_self, PyObject *__pyx_v_hubtype); /*proto*/ +static PyMethodDef __pyx_mdef_6gevent_11__hub_local_3set_default_hub_class = {"set_default_hub_class", (PyCFunction)__pyx_pw_6gevent_11__hub_local_3set_default_hub_class, METH_O, 0}; +static PyObject *__pyx_pw_6gevent_11__hub_local_3set_default_hub_class(PyObject *__pyx_self, PyObject *__pyx_v_hubtype) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("set_default_hub_class (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_11__hub_local_2set_default_hub_class(__pyx_self, ((PyObject *)__pyx_v_hubtype)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_11__hub_local_2set_default_hub_class(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_hubtype) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("set_default_hub_class", 0); + + /* "src/gevent/_hub_local.py":52 + * def set_default_hub_class(hubtype): + * global Hub + * Hub = hubtype # <<<<<<<<<<<<<< + * + * def get_hub(*args, **kwargs): + */ + if (PyDict_SetItem(__pyx_d, __pyx_n_s_Hub, __pyx_v_hubtype) < 0) __PYX_ERR(0, 52, __pyx_L1_error) + + /* "src/gevent/_hub_local.py":50 + * return hubtype + * + * def set_default_hub_class(hubtype): # <<<<<<<<<<<<<< + * global Hub + * Hub = hubtype + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("gevent.__hub_local.set_default_hub_class", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_hub_local.py":54 + * Hub = hubtype + * + * def get_hub(*args, **kwargs): # <<<<<<<<<<<<<< + * """ + * Return the hub for the current thread. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_11__hub_local_5get_hub(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6gevent_11__hub_local_4get_hub[] = "\n Return the hub for the current thread.\n\n If a hub does not exist in the current thread, a new one is\n created of the type returned by :func:`get_hub_class`.\n\n .. deprecated:: 1.3b1\n The ``*args`` and ``**kwargs`` arguments are deprecated. They were\n only used when the hub was created, and so were non-deterministic---to be\n sure they were used, *all* callers had to pass them, or they were order-dependent.\n Use ``set_hub`` instead.\n "; +static PyMethodDef __pyx_mdef_6gevent_11__hub_local_5get_hub = {"get_hub", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_11__hub_local_5get_hub, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_11__hub_local_4get_hub}; +static PyObject *__pyx_pw_6gevent_11__hub_local_5get_hub(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_args = 0; + PyObject *__pyx_v_kwargs = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get_hub (wrapper)", 0); + if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "get_hub", 1))) return NULL; + if (unlikely(__pyx_kwds)) { + __pyx_v_kwargs = PyDict_Copy(__pyx_kwds); if (unlikely(!__pyx_v_kwargs)) return NULL; + __Pyx_GOTREF(__pyx_v_kwargs); + } else { + __pyx_v_kwargs = NULL; + } + __Pyx_INCREF(__pyx_args); + __pyx_v_args = __pyx_args; + __pyx_r = __pyx_pf_6gevent_11__hub_local_4get_hub(__pyx_self, __pyx_v_args, __pyx_v_kwargs); + + /* function exit code */ + __Pyx_XDECREF(__pyx_v_args); + __Pyx_XDECREF(__pyx_v_kwargs); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_11__hub_local_4get_hub(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) { + PyObject *__pyx_v_hub = NULL; + PyObject *__pyx_v_hubtype = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + __Pyx_RefNannySetupContext("get_hub", 0); + + /* "src/gevent/_hub_local.py":67 + * Use ``set_hub`` instead. + * """ + * hub = _threadlocal.hub # <<<<<<<<<<<<<< + * if hub is None: + * hubtype = get_hub_class() + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_6gevent_11__hub_local__threadlocal, __pyx_n_s_hub); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 67, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_hub = __pyx_t_1; + __pyx_t_1 = 0; + + /* "src/gevent/_hub_local.py":68 + * """ + * hub = _threadlocal.hub + * if hub is None: # <<<<<<<<<<<<<< + * hubtype = get_hub_class() + * hub = _threadlocal.hub = hubtype(*args, **kwargs) + */ + __pyx_t_2 = (__pyx_v_hub == Py_None); + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "src/gevent/_hub_local.py":69 + * hub = _threadlocal.hub + * if hub is None: + * hubtype = get_hub_class() # <<<<<<<<<<<<<< + * hub = _threadlocal.hub = hubtype(*args, **kwargs) + * return hub + */ + __pyx_t_1 = __pyx_f_6gevent_11__hub_local_get_hub_class(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 69, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_hubtype = __pyx_t_1; + __pyx_t_1 = 0; + + /* "src/gevent/_hub_local.py":70 + * if hub is None: + * hubtype = get_hub_class() + * hub = _threadlocal.hub = hubtype(*args, **kwargs) # <<<<<<<<<<<<<< + * return hub + * + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_hubtype, __pyx_v_args, __pyx_v_kwargs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 70, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_t_1); + __Pyx_DECREF_SET(__pyx_v_hub, __pyx_t_1); + if (__Pyx_PyObject_SetAttrStr(__pyx_v_6gevent_11__hub_local__threadlocal, __pyx_n_s_hub, __pyx_t_1) < 0) __PYX_ERR(0, 70, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_hub_local.py":68 + * """ + * hub = _threadlocal.hub + * if hub is None: # <<<<<<<<<<<<<< + * hubtype = get_hub_class() + * hub = _threadlocal.hub = hubtype(*args, **kwargs) + */ + } + + /* "src/gevent/_hub_local.py":71 + * hubtype = get_hub_class() + * hub = _threadlocal.hub = hubtype(*args, **kwargs) + * return hub # <<<<<<<<<<<<<< + * + * def get_hub_noargs(): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_hub); + __pyx_r = __pyx_v_hub; + goto __pyx_L0; + + /* "src/gevent/_hub_local.py":54 + * Hub = hubtype + * + * def get_hub(*args, **kwargs): # <<<<<<<<<<<<<< + * """ + * Return the hub for the current thread. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__hub_local.get_hub", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_hub); + __Pyx_XDECREF(__pyx_v_hubtype); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_hub_local.py":73 + * return hub + * + * def get_hub_noargs(): # <<<<<<<<<<<<<< + * # Just like get_hub, but cheaper to call because it + * # takes no arguments or kwargs. See also a copy in + */ + +static PyObject *__pyx_pw_6gevent_11__hub_local_7get_hub_noargs(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *__pyx_f_6gevent_11__hub_local_get_hub_noargs(CYTHON_UNUSED int __pyx_skip_dispatch) { + PyObject *__pyx_v_hub = NULL; + PyObject *__pyx_v_hubtype = NULL; + struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + __Pyx_RefNannySetupContext("get_hub_noargs", 0); + + /* "src/gevent/_hub_local.py":77 + * # takes no arguments or kwargs. See also a copy in + * # gevent/greenlet.py + * hub = _threadlocal.hub # <<<<<<<<<<<<<< + * if hub is None: + * hubtype = get_hub_class() + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_6gevent_11__hub_local__threadlocal, __pyx_n_s_hub); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 77, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_hub = __pyx_t_1; + __pyx_t_1 = 0; + + /* "src/gevent/_hub_local.py":78 + * # gevent/greenlet.py + * hub = _threadlocal.hub + * if hub is None: # <<<<<<<<<<<<<< + * hubtype = get_hub_class() + * hub = _threadlocal.hub = hubtype() + */ + __pyx_t_2 = (__pyx_v_hub == Py_None); + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "src/gevent/_hub_local.py":79 + * hub = _threadlocal.hub + * if hub is None: + * hubtype = get_hub_class() # <<<<<<<<<<<<<< + * hub = _threadlocal.hub = hubtype() + * return hub + */ + __pyx_t_1 = __pyx_f_6gevent_11__hub_local_get_hub_class(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 79, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_hubtype = __pyx_t_1; + __pyx_t_1 = 0; + + /* "src/gevent/_hub_local.py":80 + * if hub is None: + * hubtype = get_hub_class() + * hub = _threadlocal.hub = hubtype() # <<<<<<<<<<<<<< + * return hub + * + */ + __Pyx_INCREF(__pyx_v_hubtype); + __pyx_t_4 = __pyx_v_hubtype; __pyx_t_5 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + } + } + __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 80, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_INCREF(__pyx_t_1); + __Pyx_DECREF_SET(__pyx_v_hub, __pyx_t_1); + if (__Pyx_PyObject_SetAttrStr(__pyx_v_6gevent_11__hub_local__threadlocal, __pyx_n_s_hub, __pyx_t_1) < 0) __PYX_ERR(0, 80, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_hub_local.py":78 + * # gevent/greenlet.py + * hub = _threadlocal.hub + * if hub is None: # <<<<<<<<<<<<<< + * hubtype = get_hub_class() + * hub = _threadlocal.hub = hubtype() + */ + } + + /* "src/gevent/_hub_local.py":81 + * hubtype = get_hub_class() + * hub = _threadlocal.hub = hubtype() + * return hub # <<<<<<<<<<<<<< + * + * def get_hub_if_exists(): + */ + __Pyx_XDECREF(((PyObject *)__pyx_r)); + if (!(likely(((__pyx_v_hub) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_hub, __pyx_ptype_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop))))) __PYX_ERR(0, 81, __pyx_L1_error) + __Pyx_INCREF(__pyx_v_hub); + __pyx_r = ((struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *)__pyx_v_hub); + goto __pyx_L0; + + /* "src/gevent/_hub_local.py":73 + * return hub + * + * def get_hub_noargs(): # <<<<<<<<<<<<<< + * # Just like get_hub, but cheaper to call because it + * # takes no arguments or kwargs. See also a copy in + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("gevent.__hub_local.get_hub_noargs", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_hub); + __Pyx_XDECREF(__pyx_v_hubtype); + __Pyx_XGIVEREF((PyObject *)__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_11__hub_local_7get_hub_noargs(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyMethodDef __pyx_mdef_6gevent_11__hub_local_7get_hub_noargs = {"get_hub_noargs", (PyCFunction)__pyx_pw_6gevent_11__hub_local_7get_hub_noargs, METH_NOARGS, 0}; +static PyObject *__pyx_pw_6gevent_11__hub_local_7get_hub_noargs(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get_hub_noargs (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_11__hub_local_6get_hub_noargs(__pyx_self); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_11__hub_local_6get_hub_noargs(CYTHON_UNUSED PyObject *__pyx_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("get_hub_noargs", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = ((PyObject *)__pyx_f_6gevent_11__hub_local_get_hub_noargs(0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 73, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__hub_local.get_hub_noargs", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_hub_local.py":83 + * return hub + * + * def get_hub_if_exists(): # <<<<<<<<<<<<<< + * """Return the hub for the current thread. + * + */ + +static PyObject *__pyx_pw_6gevent_11__hub_local_9get_hub_if_exists(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *__pyx_f_6gevent_11__hub_local_get_hub_if_exists(CYTHON_UNUSED int __pyx_skip_dispatch) { + struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("get_hub_if_exists", 0); + + /* "src/gevent/_hub_local.py":88 + * Return ``None`` if no hub has been created yet. + * """ + * return _threadlocal.hub # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(((PyObject *)__pyx_r)); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_6gevent_11__hub_local__threadlocal, __pyx_n_s_hub); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 88, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop))))) __PYX_ERR(0, 88, __pyx_L1_error) + __pyx_r = ((struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *)__pyx_t_1); + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "src/gevent/_hub_local.py":83 + * return hub + * + * def get_hub_if_exists(): # <<<<<<<<<<<<<< + * """Return the hub for the current thread. + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__hub_local.get_hub_if_exists", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF((PyObject *)__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_11__hub_local_9get_hub_if_exists(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6gevent_11__hub_local_8get_hub_if_exists[] = "Return the hub for the current thread.\n\n Return ``None`` if no hub has been created yet.\n "; +static PyMethodDef __pyx_mdef_6gevent_11__hub_local_9get_hub_if_exists = {"get_hub_if_exists", (PyCFunction)__pyx_pw_6gevent_11__hub_local_9get_hub_if_exists, METH_NOARGS, __pyx_doc_6gevent_11__hub_local_8get_hub_if_exists}; +static PyObject *__pyx_pw_6gevent_11__hub_local_9get_hub_if_exists(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get_hub_if_exists (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_11__hub_local_8get_hub_if_exists(__pyx_self); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_11__hub_local_8get_hub_if_exists(CYTHON_UNUSED PyObject *__pyx_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("get_hub_if_exists", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = ((PyObject *)__pyx_f_6gevent_11__hub_local_get_hub_if_exists(0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 83, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__hub_local.get_hub_if_exists", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_hub_local.py":91 + * + * + * def set_hub(hub): # <<<<<<<<<<<<<< + * _threadlocal.hub = hub + * + */ + +static PyObject *__pyx_pw_6gevent_11__hub_local_11set_hub(PyObject *__pyx_self, PyObject *__pyx_v_hub); /*proto*/ +static PyObject *__pyx_f_6gevent_11__hub_local_set_hub(struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *__pyx_v_hub, CYTHON_UNUSED int __pyx_skip_dispatch) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("set_hub", 0); + + /* "src/gevent/_hub_local.py":92 + * + * def set_hub(hub): + * _threadlocal.hub = hub # <<<<<<<<<<<<<< + * + * def get_loop(): + */ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_6gevent_11__hub_local__threadlocal, __pyx_n_s_hub, ((PyObject *)__pyx_v_hub)) < 0) __PYX_ERR(0, 92, __pyx_L1_error) + + /* "src/gevent/_hub_local.py":91 + * + * + * def set_hub(hub): # <<<<<<<<<<<<<< + * _threadlocal.hub = hub + * + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("gevent.__hub_local.set_hub", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_11__hub_local_11set_hub(PyObject *__pyx_self, PyObject *__pyx_v_hub); /*proto*/ +static PyMethodDef __pyx_mdef_6gevent_11__hub_local_11set_hub = {"set_hub", (PyCFunction)__pyx_pw_6gevent_11__hub_local_11set_hub, METH_O, 0}; +static PyObject *__pyx_pw_6gevent_11__hub_local_11set_hub(PyObject *__pyx_self, PyObject *__pyx_v_hub) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("set_hub (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_hub), __pyx_ptype_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop, 1, "hub", 0))) __PYX_ERR(0, 91, __pyx_L1_error) + __pyx_r = __pyx_pf_6gevent_11__hub_local_10set_hub(__pyx_self, ((struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *)__pyx_v_hub)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_11__hub_local_10set_hub(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *__pyx_v_hub) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("set_hub", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6gevent_11__hub_local_set_hub(__pyx_v_hub, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 91, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__hub_local.set_hub", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_hub_local.py":94 + * _threadlocal.hub = hub + * + * def get_loop(): # <<<<<<<<<<<<<< + * return _threadlocal.loop + * + */ + +static PyObject *__pyx_pw_6gevent_11__hub_local_13get_loop(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_f_6gevent_11__hub_local_get_loop(CYTHON_UNUSED int __pyx_skip_dispatch) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("get_loop", 0); + + /* "src/gevent/_hub_local.py":95 + * + * def get_loop(): + * return _threadlocal.loop # <<<<<<<<<<<<<< + * + * def set_loop(loop): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_6gevent_11__hub_local__threadlocal, __pyx_n_s_loop); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 95, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "src/gevent/_hub_local.py":94 + * _threadlocal.hub = hub + * + * def get_loop(): # <<<<<<<<<<<<<< + * return _threadlocal.loop + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__hub_local.get_loop", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_11__hub_local_13get_loop(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyMethodDef __pyx_mdef_6gevent_11__hub_local_13get_loop = {"get_loop", (PyCFunction)__pyx_pw_6gevent_11__hub_local_13get_loop, METH_NOARGS, 0}; +static PyObject *__pyx_pw_6gevent_11__hub_local_13get_loop(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get_loop (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_11__hub_local_12get_loop(__pyx_self); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_11__hub_local_12get_loop(CYTHON_UNUSED PyObject *__pyx_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("get_loop", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6gevent_11__hub_local_get_loop(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 94, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__hub_local.get_loop", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_hub_local.py":97 + * return _threadlocal.loop + * + * def set_loop(loop): # <<<<<<<<<<<<<< + * _threadlocal.loop = loop + * + */ + +static PyObject *__pyx_pw_6gevent_11__hub_local_15set_loop(PyObject *__pyx_self, PyObject *__pyx_v_loop); /*proto*/ +static PyObject *__pyx_f_6gevent_11__hub_local_set_loop(PyObject *__pyx_v_loop, CYTHON_UNUSED int __pyx_skip_dispatch) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("set_loop", 0); + + /* "src/gevent/_hub_local.py":98 + * + * def set_loop(loop): + * _threadlocal.loop = loop # <<<<<<<<<<<<<< + * + * from gevent._util import import_c_accel + */ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_6gevent_11__hub_local__threadlocal, __pyx_n_s_loop, __pyx_v_loop) < 0) __PYX_ERR(0, 98, __pyx_L1_error) + + /* "src/gevent/_hub_local.py":97 + * return _threadlocal.loop + * + * def set_loop(loop): # <<<<<<<<<<<<<< + * _threadlocal.loop = loop + * + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("gevent.__hub_local.set_loop", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_11__hub_local_15set_loop(PyObject *__pyx_self, PyObject *__pyx_v_loop); /*proto*/ +static PyMethodDef __pyx_mdef_6gevent_11__hub_local_15set_loop = {"set_loop", (PyCFunction)__pyx_pw_6gevent_11__hub_local_15set_loop, METH_O, 0}; +static PyObject *__pyx_pw_6gevent_11__hub_local_15set_loop(PyObject *__pyx_self, PyObject *__pyx_v_loop) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("set_loop (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_11__hub_local_14set_loop(__pyx_self, ((PyObject *)__pyx_v_loop)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_11__hub_local_14set_loop(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_loop) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("set_loop", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6gevent_11__hub_local_set_loop(__pyx_v_loop, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 97, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__hub_local.set_loop", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/__greenlet_primitives.pxd":23 + * + * @cython.final + * cdef inline greenlet getcurrent(): # <<<<<<<<<<<<<< + * return PyGreenlet_GetCurrent() + * + */ + +static CYTHON_INLINE PyGreenlet *__pyx_f_6gevent_21__greenlet_primitives_getcurrent(void) { + PyGreenlet *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("getcurrent", 0); + + /* "gevent/__greenlet_primitives.pxd":24 + * @cython.final + * cdef inline greenlet getcurrent(): + * return PyGreenlet_GetCurrent() # <<<<<<<<<<<<<< + * + * cdef bint _greenlet_imported + */ + __Pyx_XDECREF(((PyObject *)__pyx_r)); + __pyx_t_1 = ((PyObject *)PyGreenlet_GetCurrent()); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 24, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = ((PyGreenlet *)__pyx_t_1); + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "gevent/__greenlet_primitives.pxd":23 + * + * @cython.final + * cdef inline greenlet getcurrent(): # <<<<<<<<<<<<<< + * return PyGreenlet_GetCurrent() + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__greenlet_primitives.getcurrent", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF((PyObject *)__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/__greenlet_primitives.pxd":28 + * cdef bint _greenlet_imported + * + * cdef inline void greenlet_init(): # <<<<<<<<<<<<<< + * global _greenlet_imported + * if not _greenlet_imported: + */ + +static CYTHON_INLINE void __pyx_f_6gevent_21__greenlet_primitives_greenlet_init(void) { + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("greenlet_init", 0); + + /* "gevent/__greenlet_primitives.pxd":30 + * cdef inline void greenlet_init(): + * global _greenlet_imported + * if not _greenlet_imported: # <<<<<<<<<<<<<< + * PyGreenlet_Import() + * _greenlet_imported = True + */ + __pyx_t_1 = ((!(__pyx_v_6gevent_21__greenlet_primitives__greenlet_imported != 0)) != 0); + if (__pyx_t_1) { + + /* "gevent/__greenlet_primitives.pxd":31 + * global _greenlet_imported + * if not _greenlet_imported: + * PyGreenlet_Import() # <<<<<<<<<<<<<< + * _greenlet_imported = True + * + */ + PyGreenlet_Import(); + + /* "gevent/__greenlet_primitives.pxd":32 + * if not _greenlet_imported: + * PyGreenlet_Import() + * _greenlet_imported = True # <<<<<<<<<<<<<< + * + * cdef inline object _greenlet_switch(greenlet self): + */ + __pyx_v_6gevent_21__greenlet_primitives__greenlet_imported = 1; + + /* "gevent/__greenlet_primitives.pxd":30 + * cdef inline void greenlet_init(): + * global _greenlet_imported + * if not _greenlet_imported: # <<<<<<<<<<<<<< + * PyGreenlet_Import() + * _greenlet_imported = True + */ + } + + /* "gevent/__greenlet_primitives.pxd":28 + * cdef bint _greenlet_imported + * + * cdef inline void greenlet_init(): # <<<<<<<<<<<<<< + * global _greenlet_imported + * if not _greenlet_imported: + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "gevent/__greenlet_primitives.pxd":34 + * _greenlet_imported = True + * + * cdef inline object _greenlet_switch(greenlet self): # <<<<<<<<<<<<<< + * return PyGreenlet_Switch(self, NULL, NULL) + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_6gevent_21__greenlet_primitives__greenlet_switch(PyGreenlet *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("_greenlet_switch", 0); + + /* "gevent/__greenlet_primitives.pxd":35 + * + * cdef inline object _greenlet_switch(greenlet self): + * return PyGreenlet_Switch(self, NULL, NULL) # <<<<<<<<<<<<<< + * + * cdef class TrackedRawGreenlet(greenlet): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyGreenlet_Switch(__pyx_v_self, NULL, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 35, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "gevent/__greenlet_primitives.pxd":34 + * _greenlet_imported = True + * + * cdef inline object _greenlet_switch(greenlet self): # <<<<<<<<<<<<<< + * return PyGreenlet_Switch(self, NULL, NULL) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__greenlet_primitives._greenlet_switch", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyMethodDef __pyx_methods[] = { + {0, 0, 0, 0} +}; + +#if PY_MAJOR_VERSION >= 3 +#if CYTHON_PEP489_MULTI_PHASE_INIT +static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ +static int __pyx_pymod_exec___hub_local(PyObject* module); /*proto*/ +static PyModuleDef_Slot __pyx_moduledef_slots[] = { + {Py_mod_create, (void*)__pyx_pymod_create}, + {Py_mod_exec, (void*)__pyx_pymod_exec___hub_local}, + {0, NULL} +}; +#endif + +static struct PyModuleDef __pyx_moduledef = { + PyModuleDef_HEAD_INIT, + "__hub_local", + __pyx_k_Maintains_the_thread_local_hub, /* m_doc */ + #if CYTHON_PEP489_MULTI_PHASE_INIT + 0, /* m_size */ + #else + -1, /* m_size */ + #endif + __pyx_methods /* m_methods */, + #if CYTHON_PEP489_MULTI_PHASE_INIT + __pyx_moduledef_slots, /* m_slots */ + #else + NULL, /* m_reload */ + #endif + NULL, /* m_traverse */ + NULL, /* m_clear */ + NULL /* m_free */ +}; +#endif +#ifndef CYTHON_SMALL_CODE +#if defined(__clang__) + #define CYTHON_SMALL_CODE +#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) + #define CYTHON_SMALL_CODE __attribute__((cold)) +#else + #define CYTHON_SMALL_CODE +#endif +#endif + +static __Pyx_StringTabEntry __pyx_string_tab[] = { + {&__pyx_n_s_Hub, __pyx_k_Hub, sizeof(__pyx_k_Hub), 0, 0, 1, 1}, + {&__pyx_n_s_Threadlocal, __pyx_k_Threadlocal, sizeof(__pyx_k_Threadlocal), 0, 0, 1, 1}, + {&__pyx_n_s_Threadlocal___init, __pyx_k_Threadlocal___init, sizeof(__pyx_k_Threadlocal___init), 0, 0, 1, 1}, + {&__pyx_n_s_all, __pyx_k_all, sizeof(__pyx_k_all), 0, 0, 1, 1}, + {&__pyx_n_s_args, __pyx_k_args, sizeof(__pyx_k_args), 0, 0, 1, 1}, + {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, + {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1}, + {&__pyx_n_s_get_hub, __pyx_k_get_hub, sizeof(__pyx_k_get_hub), 0, 0, 1, 1}, + {&__pyx_n_s_get_hub_class, __pyx_k_get_hub_class, sizeof(__pyx_k_get_hub_class), 0, 0, 1, 1}, + {&__pyx_n_s_get_hub_if_exists, __pyx_k_get_hub_if_exists, sizeof(__pyx_k_get_hub_if_exists), 0, 0, 1, 1}, + {&__pyx_n_s_get_hub_noargs, __pyx_k_get_hub_noargs, sizeof(__pyx_k_get_hub_noargs), 0, 0, 1, 1}, + {&__pyx_n_s_get_loop, __pyx_k_get_loop, sizeof(__pyx_k_get_loop), 0, 0, 1, 1}, + {&__pyx_n_s_gevent___hub_local, __pyx_k_gevent___hub_local, sizeof(__pyx_k_gevent___hub_local), 0, 0, 1, 1}, + {&__pyx_n_s_gevent__compat, __pyx_k_gevent__compat, sizeof(__pyx_k_gevent__compat), 0, 0, 1, 1}, + {&__pyx_n_s_gevent__util, __pyx_k_gevent__util, sizeof(__pyx_k_gevent__util), 0, 0, 1, 1}, + {&__pyx_n_s_hub, __pyx_k_hub, sizeof(__pyx_k_hub), 0, 0, 1, 1}, + {&__pyx_n_s_hubtype, __pyx_k_hubtype, sizeof(__pyx_k_hubtype), 0, 0, 1, 1}, + {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, + {&__pyx_n_s_import_c_accel, __pyx_k_import_c_accel, sizeof(__pyx_k_import_c_accel), 0, 0, 1, 1}, + {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1}, + {&__pyx_n_s_kwargs, __pyx_k_kwargs, sizeof(__pyx_k_kwargs), 0, 0, 1, 1}, + {&__pyx_n_s_local, __pyx_k_local, sizeof(__pyx_k_local), 0, 0, 1, 1}, + {&__pyx_n_s_loop, __pyx_k_loop, sizeof(__pyx_k_loop), 0, 0, 1, 1}, + {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, + {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1}, + {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1}, + {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, + {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_capi, __pyx_k_pyx_capi, sizeof(__pyx_k_pyx_capi), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1}, + {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1}, + {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1}, + {&__pyx_n_s_set_default_hub_class, __pyx_k_set_default_hub_class, sizeof(__pyx_k_set_default_hub_class), 0, 0, 1, 1}, + {&__pyx_n_s_set_hub, __pyx_k_set_hub, sizeof(__pyx_k_set_hub), 0, 0, 1, 1}, + {&__pyx_n_s_set_loop, __pyx_k_set_loop, sizeof(__pyx_k_set_loop), 0, 0, 1, 1}, + {&__pyx_kp_s_src_gevent__hub_local_py, __pyx_k_src_gevent__hub_local_py, sizeof(__pyx_k_src_gevent__hub_local_py), 0, 0, 1, 0}, + {&__pyx_n_s_super, __pyx_k_super, sizeof(__pyx_k_super), 0, 0, 1, 1}, + {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, + {&__pyx_n_s_thread_mod_name, __pyx_k_thread_mod_name, sizeof(__pyx_k_thread_mod_name), 0, 0, 1, 1}, + {&__pyx_n_s_threadlocal, __pyx_k_threadlocal, sizeof(__pyx_k_threadlocal), 0, 0, 1, 1}, + {0, 0, 0, 0, 0, 0, 0} +}; +static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { + __pyx_builtin___import__ = __Pyx_GetBuiltinName(__pyx_n_s_import); if (!__pyx_builtin___import__) __PYX_ERR(0, 24, __pyx_L1_error) + __pyx_builtin_super = __Pyx_GetBuiltinName(__pyx_n_s_super); if (!__pyx_builtin_super) __PYX_ERR(0, 31, __pyx_L1_error) + return 0; + __pyx_L1_error:; + return -1; +} + +static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); + + /* "src/gevent/_hub_local.py":26 + * class _Threadlocal(__import__(thread_mod_name)._local): + * + * def __init__(self): # <<<<<<<<<<<<<< + * # Use a class with an initializer so that we can test + * # for 'is None' instead of catching AttributeError, making + */ + __pyx_tuple_ = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 26, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple_); + __Pyx_GIVEREF(__pyx_tuple_); + __pyx_codeobj__2 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple_, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__hub_local_py, __pyx_n_s_init, 26, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2)) __PYX_ERR(0, 26, __pyx_L1_error) + + /* "src/gevent/_hub_local.py":40 + * Hub = None # Set when gevent.hub is imported + * + * def get_hub_class(): # <<<<<<<<<<<<<< + * """Return the type of hub to use for the current thread. + * + */ + __pyx_codeobj__3 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__hub_local_py, __pyx_n_s_get_hub_class, 40, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__3)) __PYX_ERR(0, 40, __pyx_L1_error) + + /* "src/gevent/_hub_local.py":50 + * return hubtype + * + * def set_default_hub_class(hubtype): # <<<<<<<<<<<<<< + * global Hub + * Hub = hubtype + */ + __pyx_tuple__4 = PyTuple_Pack(1, __pyx_n_s_hubtype); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 50, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__4); + __Pyx_GIVEREF(__pyx_tuple__4); + __pyx_codeobj__5 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__4, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__hub_local_py, __pyx_n_s_set_default_hub_class, 50, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__5)) __PYX_ERR(0, 50, __pyx_L1_error) + + /* "src/gevent/_hub_local.py":54 + * Hub = hubtype + * + * def get_hub(*args, **kwargs): # <<<<<<<<<<<<<< + * """ + * Return the hub for the current thread. + */ + __pyx_tuple__6 = PyTuple_Pack(4, __pyx_n_s_args, __pyx_n_s_kwargs, __pyx_n_s_hub, __pyx_n_s_hubtype); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 54, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__6); + __Pyx_GIVEREF(__pyx_tuple__6); + __pyx_codeobj__7 = (PyObject*)__Pyx_PyCode_New(0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__6, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__hub_local_py, __pyx_n_s_get_hub, 54, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__7)) __PYX_ERR(0, 54, __pyx_L1_error) + + /* "src/gevent/_hub_local.py":73 + * return hub + * + * def get_hub_noargs(): # <<<<<<<<<<<<<< + * # Just like get_hub, but cheaper to call because it + * # takes no arguments or kwargs. See also a copy in + */ + __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__hub_local_py, __pyx_n_s_get_hub_noargs, 73, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) __PYX_ERR(0, 73, __pyx_L1_error) + + /* "src/gevent/_hub_local.py":83 + * return hub + * + * def get_hub_if_exists(): # <<<<<<<<<<<<<< + * """Return the hub for the current thread. + * + */ + __pyx_codeobj__9 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__hub_local_py, __pyx_n_s_get_hub_if_exists, 83, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__9)) __PYX_ERR(0, 83, __pyx_L1_error) + + /* "src/gevent/_hub_local.py":91 + * + * + * def set_hub(hub): # <<<<<<<<<<<<<< + * _threadlocal.hub = hub + * + */ + __pyx_tuple__10 = PyTuple_Pack(1, __pyx_n_s_hub); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 91, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__10); + __Pyx_GIVEREF(__pyx_tuple__10); + __pyx_codeobj__11 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__10, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__hub_local_py, __pyx_n_s_set_hub, 91, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__11)) __PYX_ERR(0, 91, __pyx_L1_error) + + /* "src/gevent/_hub_local.py":94 + * _threadlocal.hub = hub + * + * def get_loop(): # <<<<<<<<<<<<<< + * return _threadlocal.loop + * + */ + __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__hub_local_py, __pyx_n_s_get_loop, 94, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(0, 94, __pyx_L1_error) + + /* "src/gevent/_hub_local.py":97 + * return _threadlocal.loop + * + * def set_loop(loop): # <<<<<<<<<<<<<< + * _threadlocal.loop = loop + * + */ + __pyx_tuple__13 = PyTuple_Pack(1, __pyx_n_s_loop); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 97, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__13); + __Pyx_GIVEREF(__pyx_tuple__13); + __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__13, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__hub_local_py, __pyx_n_s_set_loop, 97, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__14)) __PYX_ERR(0, 97, __pyx_L1_error) + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} + +static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { + if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + return 0; + __pyx_L1_error:; + return -1; +} + +static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/ + +static int __Pyx_modinit_global_init_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); + /*--- Global init code ---*/ + __pyx_v_6gevent_11__hub_local__threadlocal = Py_None; Py_INCREF(Py_None); + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_variable_export_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); + /*--- Variable export code ---*/ + if (__Pyx_ExportVoidPtr(__pyx_n_s_threadlocal, (void *)&__pyx_v_6gevent_11__hub_local__threadlocal, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_modinit_function_export_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); + /*--- Function export code ---*/ + if (__Pyx_ExportFunction("get_hub_class", (void (*)(void))__pyx_f_6gevent_11__hub_local_get_hub_class, "PyObject *(int __pyx_skip_dispatch)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportFunction("get_hub_if_exists", (void (*)(void))__pyx_f_6gevent_11__hub_local_get_hub_if_exists, "struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *(int __pyx_skip_dispatch)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportFunction("set_hub", (void (*)(void))__pyx_f_6gevent_11__hub_local_set_hub, "PyObject *(struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *, int __pyx_skip_dispatch)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportFunction("get_loop", (void (*)(void))__pyx_f_6gevent_11__hub_local_get_loop, "PyObject *(int __pyx_skip_dispatch)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportFunction("set_loop", (void (*)(void))__pyx_f_6gevent_11__hub_local_set_loop, "PyObject *(PyObject *, int __pyx_skip_dispatch)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportFunction("get_hub_noargs", (void (*)(void))__pyx_f_6gevent_11__hub_local_get_hub_noargs, "struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *(int __pyx_skip_dispatch)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_modinit_type_init_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); + /*--- Type init code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_type_import_code(void) { + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); + /*--- Type import code ---*/ + __pyx_t_1 = PyImport_ImportModule("greenlet"); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_ptype_6gevent_21__greenlet_primitives_greenlet = __Pyx_ImportType(__pyx_t_1, "greenlet", "greenlet", sizeof(PyGreenlet), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_21__greenlet_primitives_greenlet) __PYX_ERR(1, 12, __pyx_L1_error) + __pyx_t_2 = PyImport_ImportModule("gevent.__greenlet_primitives"); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 37, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_ptype_6gevent_21__greenlet_primitives_TrackedRawGreenlet = __Pyx_ImportType(__pyx_t_2, "gevent.__greenlet_primitives", "TrackedRawGreenlet", sizeof(struct __pyx_obj_6gevent_21__greenlet_primitives_TrackedRawGreenlet), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_21__greenlet_primitives_TrackedRawGreenlet) __PYX_ERR(1, 37, __pyx_L1_error) + __pyx_ptype_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop = __Pyx_ImportType(__pyx_t_2, "gevent.__greenlet_primitives", "SwitchOutGreenletWithLoop", sizeof(struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop) __PYX_ERR(1, 40, __pyx_L1_error) + __pyx_vtabptr_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop = (struct __pyx_vtabstruct_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop*)__Pyx_GetVtable(__pyx_ptype_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop->tp_dict); if (unlikely(!__pyx_vtabptr_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop)) __PYX_ERR(1, 40, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_modinit_variable_import_code(void) { + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); + /*--- Variable import code ---*/ + __pyx_t_1 = PyImport_ImportModule("gevent.__greenlet_primitives"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_1, "get_objects", (void **)&__pyx_vp_6gevent_21__greenlet_primitives_get_objects, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_1, "wref", (void **)&__pyx_vp_6gevent_21__greenlet_primitives_wref, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_1, "BlockingSwitchOutError", (void **)&__pyx_vp_6gevent_21__greenlet_primitives_BlockingSwitchOutError, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_1, "_greenlet_imported", (void **)&__pyx_vp_6gevent_21__greenlet_primitives__greenlet_imported, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + Py_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_modinit_function_import_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); + /*--- Function import code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + + +#if PY_MAJOR_VERSION < 3 +#ifdef CYTHON_NO_PYINIT_EXPORT +#define __Pyx_PyMODINIT_FUNC void +#else +#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC +#endif +#else +#ifdef CYTHON_NO_PYINIT_EXPORT +#define __Pyx_PyMODINIT_FUNC PyObject * +#else +#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC +#endif +#endif + + +#if PY_MAJOR_VERSION < 3 +__Pyx_PyMODINIT_FUNC init__hub_local(void) CYTHON_SMALL_CODE; /*proto*/ +__Pyx_PyMODINIT_FUNC init__hub_local(void) +#else +__Pyx_PyMODINIT_FUNC PyInit___hub_local(void) CYTHON_SMALL_CODE; /*proto*/ +__Pyx_PyMODINIT_FUNC PyInit___hub_local(void) +#if CYTHON_PEP489_MULTI_PHASE_INIT +{ + return PyModuleDef_Init(&__pyx_moduledef); +} +static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { + #if PY_VERSION_HEX >= 0x030700A1 + static PY_INT64_T main_interpreter_id = -1; + PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); + if (main_interpreter_id == -1) { + main_interpreter_id = current_id; + return (unlikely(current_id == -1)) ? -1 : 0; + } else if (unlikely(main_interpreter_id != current_id)) + #else + static PyInterpreterState *main_interpreter = NULL; + PyInterpreterState *current_interpreter = PyThreadState_Get()->interp; + if (!main_interpreter) { + main_interpreter = current_interpreter; + } else if (unlikely(main_interpreter != current_interpreter)) + #endif + { + PyErr_SetString( + PyExc_ImportError, + "Interpreter change detected - this module can only be loaded into one interpreter per process."); + return -1; + } + return 0; +} +static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) { + PyObject *value = PyObject_GetAttrString(spec, from_name); + int result = 0; + if (likely(value)) { + if (allow_none || value != Py_None) { + result = PyDict_SetItemString(moddict, to_name, value); + } + Py_DECREF(value); + } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_Clear(); + } else { + result = -1; + } + return result; +} +static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) { + PyObject *module = NULL, *moddict, *modname; + if (__Pyx_check_single_interpreter()) + return NULL; + if (__pyx_m) + return __Pyx_NewRef(__pyx_m); + modname = PyObject_GetAttrString(spec, "name"); + if (unlikely(!modname)) goto bad; + module = PyModule_NewObject(modname); + Py_DECREF(modname); + if (unlikely(!module)) goto bad; + moddict = PyModule_GetDict(module); + if (unlikely(!moddict)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad; + return module; +bad: + Py_XDECREF(module); + return NULL; +} + + +static CYTHON_SMALL_CODE int __pyx_pymod_exec___hub_local(PyObject *__pyx_pyinit_module) +#endif +#endif +{ + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + __Pyx_RefNannyDeclarations + #if CYTHON_PEP489_MULTI_PHASE_INIT + if (__pyx_m) { + if (__pyx_m == __pyx_pyinit_module) return 0; + PyErr_SetString(PyExc_RuntimeError, "Module '__hub_local' has already been imported. Re-initialisation is not supported."); + return -1; + } + #elif PY_MAJOR_VERSION >= 3 + if (__pyx_m) return __Pyx_NewRef(__pyx_m); + #endif + #if CYTHON_REFNANNY +__Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); +if (!__Pyx_RefNanny) { + PyErr_Clear(); + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); + if (!__Pyx_RefNanny) + Py_FatalError("failed to import 'refnanny' module"); +} +#endif + __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit___hub_local(void)", 0); + if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #ifdef __Pxy_PyFrame_Initialize_Offsets + __Pxy_PyFrame_Initialize_Offsets(); + #endif + __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) + #ifdef __Pyx_CyFunction_USED + if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_FusedFunction_USED + if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_Coroutine_USED + if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_Generator_USED + if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_AsyncGen_USED + if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_StopAsyncIteration_USED + if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + /*--- Library function declarations ---*/ + /*--- Threads initialization code ---*/ + #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS + #ifdef WITH_THREAD /* Python build with threading support? */ + PyEval_InitThreads(); + #endif + #endif + /*--- Module creation code ---*/ + #if CYTHON_PEP489_MULTI_PHASE_INIT + __pyx_m = __pyx_pyinit_module; + Py_INCREF(__pyx_m); + #else + #if PY_MAJOR_VERSION < 3 + __pyx_m = Py_InitModule4("__hub_local", __pyx_methods, __pyx_k_Maintains_the_thread_local_hub, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); + #else + __pyx_m = PyModule_Create(&__pyx_moduledef); + #endif + if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) + Py_INCREF(__pyx_d); + __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) + #if CYTHON_COMPILING_IN_PYPY + Py_INCREF(__pyx_b); + #endif + if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + /*--- Initialize various global constants etc. ---*/ + if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) + if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + if (__pyx_module_is_main_gevent____hub_local) { + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + } + #if PY_MAJOR_VERSION >= 3 + { + PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) + if (!PyDict_GetItemString(modules, "gevent.__hub_local")) { + if (unlikely(PyDict_SetItemString(modules, "gevent.__hub_local", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error) + } + } + #endif + /*--- Builtin init code ---*/ + if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + /*--- Constants init code ---*/ + if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + /*--- Global type/function init code ---*/ + (void)__Pyx_modinit_global_init_code(); + if (unlikely(__Pyx_modinit_variable_export_code() != 0)) goto __pyx_L1_error; + if (unlikely(__Pyx_modinit_function_export_code() != 0)) goto __pyx_L1_error; + (void)__Pyx_modinit_type_init_code(); + if (unlikely(__Pyx_modinit_type_import_code() != 0)) goto __pyx_L1_error; + if (unlikely(__Pyx_modinit_variable_import_code() != 0)) goto __pyx_L1_error; + (void)__Pyx_modinit_function_import_code(); + /*--- Execution code ---*/ + #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) + if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + + /* "src/gevent/_hub_local.py":12 + * + * + * from gevent._compat import thread_mod_name # <<<<<<<<<<<<<< + * + * __all__ = [ + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_thread_mod_name); + __Pyx_GIVEREF(__pyx_n_s_thread_mod_name); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_thread_mod_name); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_gevent__compat, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_thread_mod_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_thread_mod_name, __pyx_t_1) < 0) __PYX_ERR(0, 12, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/_hub_local.py":14 + * from gevent._compat import thread_mod_name + * + * __all__ = [ # <<<<<<<<<<<<<< + * 'get_hub', + * 'get_hub_noargs', + */ + __pyx_t_2 = PyList_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 14, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_get_hub); + __Pyx_GIVEREF(__pyx_n_s_get_hub); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_get_hub); + __Pyx_INCREF(__pyx_n_s_get_hub_noargs); + __Pyx_GIVEREF(__pyx_n_s_get_hub_noargs); + PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_get_hub_noargs); + __Pyx_INCREF(__pyx_n_s_get_hub_if_exists); + __Pyx_GIVEREF(__pyx_n_s_get_hub_if_exists); + PyList_SET_ITEM(__pyx_t_2, 2, __pyx_n_s_get_hub_if_exists); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_all, __pyx_t_2) < 0) __PYX_ERR(0, 14, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/_hub_local.py":24 + * # We are imported early enough (by gevent/__init__) that + * # we can rely on not being monkey-patched in any way yet. + * class _Threadlocal(__import__(thread_mod_name)._local): # <<<<<<<<<<<<<< + * + * def __init__(self): + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_thread_mod_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 24, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin___import__, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 24, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_local); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 24, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 24, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 24, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_Threadlocal, __pyx_n_s_Threadlocal, (PyObject *) NULL, __pyx_n_s_gevent___hub_local, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 24, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + + /* "src/gevent/_hub_local.py":26 + * class _Threadlocal(__import__(thread_mod_name)._local): + * + * def __init__(self): # <<<<<<<<<<<<<< + * # Use a class with an initializer so that we can test + * # for 'is None' instead of catching AttributeError, making + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_11__hub_local_12_Threadlocal_1__init__, 0, __pyx_n_s_Threadlocal___init, NULL, __pyx_n_s_gevent___hub_local, __pyx_d, ((PyObject *)__pyx_codeobj__2)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 26, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_init, __pyx_t_4) < 0) __PYX_ERR(0, 26, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "src/gevent/_hub_local.py":24 + * # We are imported early enough (by gevent/__init__) that + * # we can rely on not being monkey-patched in any way yet. + * class _Threadlocal(__import__(thread_mod_name)._local): # <<<<<<<<<<<<<< + * + * def __init__(self): + */ + __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_Threadlocal, __pyx_t_1, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 24, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_Threadlocal, __pyx_t_4) < 0) __PYX_ERR(0, 24, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_hub_local.py":36 + * self.hub = None + * + * _threadlocal = _Threadlocal() # <<<<<<<<<<<<<< + * + * Hub = None # Set when gevent.hub is imported + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Threadlocal); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 36, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 36, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XGOTREF(__pyx_v_6gevent_11__hub_local__threadlocal); + __Pyx_DECREF_SET(__pyx_v_6gevent_11__hub_local__threadlocal, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + + /* "src/gevent/_hub_local.py":38 + * _threadlocal = _Threadlocal() + * + * Hub = None # Set when gevent.hub is imported # <<<<<<<<<<<<<< + * + * def get_hub_class(): + */ + if (PyDict_SetItem(__pyx_d, __pyx_n_s_Hub, Py_None) < 0) __PYX_ERR(0, 38, __pyx_L1_error) + + /* "src/gevent/_hub_local.py":40 + * Hub = None # Set when gevent.hub is imported + * + * def get_hub_class(): # <<<<<<<<<<<<<< + * """Return the type of hub to use for the current thread. + * + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_11__hub_local_1get_hub_class, 0, __pyx_n_s_get_hub_class, NULL, __pyx_n_s_gevent___hub_local, __pyx_d, ((PyObject *)__pyx_codeobj__3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 40, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_hub_class, __pyx_t_2) < 0) __PYX_ERR(0, 40, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/_hub_local.py":50 + * return hubtype + * + * def set_default_hub_class(hubtype): # <<<<<<<<<<<<<< + * global Hub + * Hub = hubtype + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_11__hub_local_3set_default_hub_class, 0, __pyx_n_s_set_default_hub_class, NULL, __pyx_n_s_gevent___hub_local, __pyx_d, ((PyObject *)__pyx_codeobj__5)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 50, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_default_hub_class, __pyx_t_2) < 0) __PYX_ERR(0, 50, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/_hub_local.py":54 + * Hub = hubtype + * + * def get_hub(*args, **kwargs): # <<<<<<<<<<<<<< + * """ + * Return the hub for the current thread. + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_11__hub_local_5get_hub, 0, __pyx_n_s_get_hub, NULL, __pyx_n_s_gevent___hub_local, __pyx_d, ((PyObject *)__pyx_codeobj__7)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 54, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_hub, __pyx_t_2) < 0) __PYX_ERR(0, 54, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/_hub_local.py":73 + * return hub + * + * def get_hub_noargs(): # <<<<<<<<<<<<<< + * # Just like get_hub, but cheaper to call because it + * # takes no arguments or kwargs. See also a copy in + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_11__hub_local_7get_hub_noargs, 0, __pyx_n_s_get_hub_noargs, NULL, __pyx_n_s_gevent___hub_local, __pyx_d, ((PyObject *)__pyx_codeobj__8)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 73, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_hub_noargs, __pyx_t_2) < 0) __PYX_ERR(0, 73, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/_hub_local.py":83 + * return hub + * + * def get_hub_if_exists(): # <<<<<<<<<<<<<< + * """Return the hub for the current thread. + * + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_11__hub_local_9get_hub_if_exists, 0, __pyx_n_s_get_hub_if_exists, NULL, __pyx_n_s_gevent___hub_local, __pyx_d, ((PyObject *)__pyx_codeobj__9)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 83, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_hub_if_exists, __pyx_t_2) < 0) __PYX_ERR(0, 83, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/_hub_local.py":91 + * + * + * def set_hub(hub): # <<<<<<<<<<<<<< + * _threadlocal.hub = hub + * + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_11__hub_local_11set_hub, 0, __pyx_n_s_set_hub, NULL, __pyx_n_s_gevent___hub_local, __pyx_d, ((PyObject *)__pyx_codeobj__11)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 91, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_hub, __pyx_t_2) < 0) __PYX_ERR(0, 91, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/_hub_local.py":94 + * _threadlocal.hub = hub + * + * def get_loop(): # <<<<<<<<<<<<<< + * return _threadlocal.loop + * + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_11__hub_local_13get_loop, 0, __pyx_n_s_get_loop, NULL, __pyx_n_s_gevent___hub_local, __pyx_d, ((PyObject *)__pyx_codeobj__12)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 94, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_loop, __pyx_t_2) < 0) __PYX_ERR(0, 94, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/_hub_local.py":97 + * return _threadlocal.loop + * + * def set_loop(loop): # <<<<<<<<<<<<<< + * _threadlocal.loop = loop + * + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_11__hub_local_15set_loop, 0, __pyx_n_s_set_loop, NULL, __pyx_n_s_gevent___hub_local, __pyx_d, ((PyObject *)__pyx_codeobj__14)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 97, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_loop, __pyx_t_2) < 0) __PYX_ERR(0, 97, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/_hub_local.py":100 + * _threadlocal.loop = loop + * + * from gevent._util import import_c_accel # <<<<<<<<<<<<<< + * import_c_accel(globals(), 'gevent.__hub_local') + */ + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 100, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_import_c_accel); + __Pyx_GIVEREF(__pyx_n_s_import_c_accel); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_import_c_accel); + __pyx_t_1 = __Pyx_Import(__pyx_n_s_gevent__util, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 100, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_import_c_accel); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 100, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_import_c_accel, __pyx_t_2) < 0) __PYX_ERR(0, 100, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_hub_local.py":101 + * + * from gevent._util import import_c_accel + * import_c_accel(globals(), 'gevent.__hub_local') # <<<<<<<<<<<<<< + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_import_c_accel); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 101, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_Globals(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 101, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 101, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __Pyx_INCREF(__pyx_n_s_gevent___hub_local); + __Pyx_GIVEREF(__pyx_n_s_gevent___hub_local); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_n_s_gevent___hub_local); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 101, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/_hub_local.py":1 + * # -*- coding: utf-8 -*- # <<<<<<<<<<<<<< + * # copyright 2018 gevent. See LICENSE + * """ + */ + __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "gevent/__greenlet_primitives.pxd":34 + * _greenlet_imported = True + * + * cdef inline object _greenlet_switch(greenlet self): # <<<<<<<<<<<<<< + * return PyGreenlet_Switch(self, NULL, NULL) + * + */ + + /*--- Wrapped vars code ---*/ + + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + if (__pyx_m) { + if (__pyx_d) { + __Pyx_AddTraceback("init gevent.__hub_local", __pyx_clineno, __pyx_lineno, __pyx_filename); + } + Py_CLEAR(__pyx_m); + } else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_ImportError, "init gevent.__hub_local"); + } + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + #if CYTHON_PEP489_MULTI_PHASE_INIT + return (__pyx_m != NULL) ? 0 : -1; + #elif PY_MAJOR_VERSION >= 3 + return __pyx_m; + #else + return; + #endif +} + +/* --- Runtime support code --- */ +/* Refnanny */ +#if CYTHON_REFNANNY +static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { + PyObject *m = NULL, *p = NULL; + void *r = NULL; + m = PyImport_ImportModule(modname); + if (!m) goto end; + p = PyObject_GetAttrString(m, "RefNannyAPI"); + if (!p) goto end; + r = PyLong_AsVoidPtr(p); +end: + Py_XDECREF(p); + Py_XDECREF(m); + return (__Pyx_RefNannyAPIStruct *)r; +} +#endif + +/* PyObjectGetAttrStr */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_getattro)) + return tp->tp_getattro(obj, attr_name); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_getattr)) + return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); +#endif + return PyObject_GetAttr(obj, attr_name); +} +#endif + +/* GetBuiltinName */ +static PyObject *__Pyx_GetBuiltinName(PyObject *name) { + PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name); + if (unlikely(!result)) { + PyErr_Format(PyExc_NameError, +#if PY_MAJOR_VERSION >= 3 + "name '%U' is not defined", name); +#else + "name '%.200s' is not defined", PyString_AS_STRING(name)); +#endif + } + return result; +} + +/* GetModuleGlobalName */ +#if CYTHON_USE_DICT_VERSIONS +static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value) +#else +static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) +#endif +{ + PyObject *result; +#if !CYTHON_AVOID_BORROWED_REFS +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 + result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } else if (unlikely(PyErr_Occurred())) { + return NULL; + } +#else + result = PyDict_GetItem(__pyx_d, name); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } +#endif +#else + result = PyObject_GetItem(__pyx_d, name); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } + PyErr_Clear(); +#endif + return __Pyx_GetBuiltinName(name); +} + +/* PyObjectCall */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { + PyObject *result; + ternaryfunc call = func->ob_type->tp_call; + if (unlikely(!call)) + return PyObject_Call(func, arg, kw); + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; + result = (*call)(func, arg, kw); + Py_LeaveRecursiveCall(); + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +/* PyFunctionFastCall */ +#if CYTHON_FAST_PYCALL +static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, + PyObject *globals) { + PyFrameObject *f; + PyThreadState *tstate = __Pyx_PyThreadState_Current; + PyObject **fastlocals; + Py_ssize_t i; + PyObject *result; + assert(globals != NULL); + /* XXX Perhaps we should create a specialized + PyFrame_New() that doesn't take locals, but does + take builtins without sanity checking them. + */ + assert(tstate != NULL); + f = PyFrame_New(tstate, co, globals, NULL); + if (f == NULL) { + return NULL; + } + fastlocals = __Pyx_PyFrame_GetLocalsplus(f); + for (i = 0; i < na; i++) { + Py_INCREF(*args); + fastlocals[i] = *args++; + } + result = PyEval_EvalFrameEx(f,0); + ++tstate->recursion_depth; + Py_DECREF(f); + --tstate->recursion_depth; + return result; +} +#if 1 || PY_VERSION_HEX < 0x030600B1 +static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs) { + PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); + PyObject *globals = PyFunction_GET_GLOBALS(func); + PyObject *argdefs = PyFunction_GET_DEFAULTS(func); + PyObject *closure; +#if PY_MAJOR_VERSION >= 3 + PyObject *kwdefs; +#endif + PyObject *kwtuple, **k; + PyObject **d; + Py_ssize_t nd; + Py_ssize_t nk; + PyObject *result; + assert(kwargs == NULL || PyDict_Check(kwargs)); + nk = kwargs ? PyDict_Size(kwargs) : 0; + if (Py_EnterRecursiveCall((char*)" while calling a Python object")) { + return NULL; + } + if ( +#if PY_MAJOR_VERSION >= 3 + co->co_kwonlyargcount == 0 && +#endif + likely(kwargs == NULL || nk == 0) && + co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { + if (argdefs == NULL && co->co_argcount == nargs) { + result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); + goto done; + } + else if (nargs == 0 && argdefs != NULL + && co->co_argcount == Py_SIZE(argdefs)) { + /* function called with no arguments, but all parameters have + a default value: use default values as arguments .*/ + args = &PyTuple_GET_ITEM(argdefs, 0); + result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); + goto done; + } + } + if (kwargs != NULL) { + Py_ssize_t pos, i; + kwtuple = PyTuple_New(2 * nk); + if (kwtuple == NULL) { + result = NULL; + goto done; + } + k = &PyTuple_GET_ITEM(kwtuple, 0); + pos = i = 0; + while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { + Py_INCREF(k[i]); + Py_INCREF(k[i+1]); + i += 2; + } + nk = i / 2; + } + else { + kwtuple = NULL; + k = NULL; + } + closure = PyFunction_GET_CLOSURE(func); +#if PY_MAJOR_VERSION >= 3 + kwdefs = PyFunction_GET_KW_DEFAULTS(func); +#endif + if (argdefs != NULL) { + d = &PyTuple_GET_ITEM(argdefs, 0); + nd = Py_SIZE(argdefs); + } + else { + d = NULL; + nd = 0; + } +#if PY_MAJOR_VERSION >= 3 + result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, + args, nargs, + k, (int)nk, + d, (int)nd, kwdefs, closure); +#else + result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, + args, nargs, + k, (int)nk, + d, (int)nd, closure); +#endif + Py_XDECREF(kwtuple); +done: + Py_LeaveRecursiveCall(); + return result; +} +#endif +#endif + +/* PyObjectCallMethO */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { + PyObject *self, *result; + PyCFunction cfunc; + cfunc = PyCFunction_GET_FUNCTION(func); + self = PyCFunction_GET_SELF(func); + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; + result = cfunc(self, arg); + Py_LeaveRecursiveCall(); + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +/* PyObjectCallNoArg */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { +#if CYTHON_FAST_PYCALL + if (PyFunction_Check(func)) { + return __Pyx_PyFunction_FastCall(func, NULL, 0); + } +#endif +#ifdef __Pyx_CyFunction_USED + if (likely(PyCFunction_Check(func) || __Pyx_CyFunction_Check(func))) +#else + if (likely(PyCFunction_Check(func))) +#endif + { + if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) { + return __Pyx_PyObject_CallMethO(func, NULL); + } + } + return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL); +} +#endif + +/* PyCFunctionFastCall */ +#if CYTHON_FAST_PYCCALL +static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) { + PyCFunctionObject *func = (PyCFunctionObject*)func_obj; + PyCFunction meth = PyCFunction_GET_FUNCTION(func); + PyObject *self = PyCFunction_GET_SELF(func); + int flags = PyCFunction_GET_FLAGS(func); + assert(PyCFunction_Check(func)); + assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS))); + assert(nargs >= 0); + assert(nargs == 0 || args != NULL); + /* _PyCFunction_FastCallDict() must not be called with an exception set, + because it may clear it (directly or indirectly) and so the + caller loses its exception */ + assert(!PyErr_Occurred()); + if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) { + return (*((__Pyx_PyCFunctionFastWithKeywords)(void*)meth)) (self, args, nargs, NULL); + } else { + return (*((__Pyx_PyCFunctionFast)(void*)meth)) (self, args, nargs); + } +} +#endif + +/* PyObjectCallOneArg */ +#if CYTHON_COMPILING_IN_CPYTHON +static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) { + PyObject *result; + PyObject *args = PyTuple_New(1); + if (unlikely(!args)) return NULL; + Py_INCREF(arg); + PyTuple_SET_ITEM(args, 0, arg); + result = __Pyx_PyObject_Call(func, args, NULL); + Py_DECREF(args); + return result; +} +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { +#if CYTHON_FAST_PYCALL + if (PyFunction_Check(func)) { + return __Pyx_PyFunction_FastCall(func, &arg, 1); + } +#endif + if (likely(PyCFunction_Check(func))) { + if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) { + return __Pyx_PyObject_CallMethO(func, arg); +#if CYTHON_FAST_PYCCALL + } else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) { + return __Pyx_PyCFunction_FastCall(func, &arg, 1); +#endif + } + } + return __Pyx__PyObject_CallOneArg(func, arg); +} +#else +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { + PyObject *result; + PyObject *args = PyTuple_Pack(1, arg); + if (unlikely(!args)) return NULL; + result = __Pyx_PyObject_Call(func, args, NULL); + Py_DECREF(args); + return result; +} +#endif + +/* PyObjectSetAttrStr */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) { + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_setattro)) + return tp->tp_setattro(obj, attr_name, value); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_setattr)) + return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value); +#endif + return PyObject_SetAttr(obj, attr_name, value); +} +#endif + +/* KeywordStringCheck */ +static int __Pyx_CheckKeywordStrings( + PyObject *kwdict, + const char* function_name, + int kw_allowed) +{ + PyObject* key = 0; + Py_ssize_t pos = 0; +#if CYTHON_COMPILING_IN_PYPY + if (!kw_allowed && PyDict_Next(kwdict, &pos, &key, 0)) + goto invalid_keyword; + return 1; +#else + while (PyDict_Next(kwdict, &pos, &key, 0)) { + #if PY_MAJOR_VERSION < 3 + if (unlikely(!PyString_Check(key))) + #endif + if (unlikely(!PyUnicode_Check(key))) + goto invalid_keyword_type; + } + if ((!kw_allowed) && unlikely(key)) + goto invalid_keyword; + return 1; +invalid_keyword_type: + PyErr_Format(PyExc_TypeError, + "%.200s() keywords must be strings", function_name); + return 0; +#endif +invalid_keyword: + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION < 3 + "%.200s() got an unexpected keyword argument '%.200s'", + function_name, PyString_AsString(key)); + #else + "%s() got an unexpected keyword argument '%U'", + function_name, key); + #endif + return 0; +} + +/* ExtTypeTest */ +static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { + if (unlikely(!type)) { + PyErr_SetString(PyExc_SystemError, "Missing type object"); + return 0; + } + if (likely(__Pyx_TypeCheck(obj, type))) + return 1; + PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s", + Py_TYPE(obj)->tp_name, type->tp_name); + return 0; +} + +/* ArgTypeTest */ +static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact) +{ + if (unlikely(!type)) { + PyErr_SetString(PyExc_SystemError, "Missing type object"); + return 0; + } + else if (exact) { + #if PY_MAJOR_VERSION == 2 + if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1; + #endif + } + else { + if (likely(__Pyx_TypeCheck(obj, type))) return 1; + } + PyErr_Format(PyExc_TypeError, + "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)", + name, type->tp_name, Py_TYPE(obj)->tp_name); + return 0; +} + +/* TypeImport */ +#ifndef __PYX_HAVE_RT_ImportType +#define __PYX_HAVE_RT_ImportType +static PyTypeObject *__Pyx_ImportType(PyObject *module, const char *module_name, const char *class_name, + size_t size, enum __Pyx_ImportType_CheckSize check_size) +{ + PyObject *result = 0; + char warning[200]; + Py_ssize_t basicsize; +#ifdef Py_LIMITED_API + PyObject *py_basicsize; +#endif + result = PyObject_GetAttrString(module, class_name); + if (!result) + goto bad; + if (!PyType_Check(result)) { + PyErr_Format(PyExc_TypeError, + "%.200s.%.200s is not a type object", + module_name, class_name); + goto bad; + } +#ifndef Py_LIMITED_API + basicsize = ((PyTypeObject *)result)->tp_basicsize; +#else + py_basicsize = PyObject_GetAttrString(result, "__basicsize__"); + if (!py_basicsize) + goto bad; + basicsize = PyLong_AsSsize_t(py_basicsize); + Py_DECREF(py_basicsize); + py_basicsize = 0; + if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred()) + goto bad; +#endif + if ((size_t)basicsize < size) { + PyErr_Format(PyExc_ValueError, + "%.200s.%.200s size changed, may indicate binary incompatibility. " + "Expected %zd from C header, got %zd from PyObject", + module_name, class_name, size, basicsize); + goto bad; + } + if (check_size == __Pyx_ImportType_CheckSize_Error && (size_t)basicsize != size) { + PyErr_Format(PyExc_ValueError, + "%.200s.%.200s size changed, may indicate binary incompatibility. " + "Expected %zd from C header, got %zd from PyObject", + module_name, class_name, size, basicsize); + goto bad; + } + else if (check_size == __Pyx_ImportType_CheckSize_Warn && (size_t)basicsize > size) { + PyOS_snprintf(warning, sizeof(warning), + "%s.%s size changed, may indicate binary incompatibility. " + "Expected %zd from C header, got %zd from PyObject", + module_name, class_name, size, basicsize); + if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad; + } + return (PyTypeObject *)result; +bad: + Py_XDECREF(result); + return NULL; +} +#endif + +/* GetVTable */ +static void* __Pyx_GetVtable(PyObject *dict) { + void* ptr; + PyObject *ob = PyObject_GetItem(dict, __pyx_n_s_pyx_vtable); + if (!ob) + goto bad; +#if PY_VERSION_HEX >= 0x02070000 + ptr = PyCapsule_GetPointer(ob, 0); +#else + ptr = PyCObject_AsVoidPtr(ob); +#endif + if (!ptr && !PyErr_Occurred()) + PyErr_SetString(PyExc_RuntimeError, "invalid vtable found for imported type"); + Py_DECREF(ob); + return ptr; +bad: + Py_XDECREF(ob); + return NULL; +} + +/* Import */ +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { + PyObject *empty_list = 0; + PyObject *module = 0; + PyObject *global_dict = 0; + PyObject *empty_dict = 0; + PyObject *list; + #if PY_MAJOR_VERSION < 3 + PyObject *py_import; + py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); + if (!py_import) + goto bad; + #endif + if (from_list) + list = from_list; + else { + empty_list = PyList_New(0); + if (!empty_list) + goto bad; + list = empty_list; + } + global_dict = PyModule_GetDict(__pyx_m); + if (!global_dict) + goto bad; + empty_dict = PyDict_New(); + if (!empty_dict) + goto bad; + { + #if PY_MAJOR_VERSION >= 3 + if (level == -1) { + if (strchr(__Pyx_MODULE_NAME, '.')) { + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, 1); + if (!module) { + if (!PyErr_ExceptionMatches(PyExc_ImportError)) + goto bad; + PyErr_Clear(); + } + } + level = 0; + } + #endif + if (!module) { + #if PY_MAJOR_VERSION < 3 + PyObject *py_level = PyInt_FromLong(level); + if (!py_level) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, py_level, (PyObject *)NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, level); + #endif + } + } +bad: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(py_import); + #endif + Py_XDECREF(empty_list); + Py_XDECREF(empty_dict); + return module; +} + +/* ImportFrom */ +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { + PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); + if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_Format(PyExc_ImportError, + #if PY_MAJOR_VERSION < 3 + "cannot import name %.230s", PyString_AS_STRING(name)); + #else + "cannot import name %S", name); + #endif + } + return value; +} + +/* CalculateMetaclass */ +static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) { + Py_ssize_t i, nbases = PyTuple_GET_SIZE(bases); + for (i=0; i < nbases; i++) { + PyTypeObject *tmptype; + PyObject *tmp = PyTuple_GET_ITEM(bases, i); + tmptype = Py_TYPE(tmp); +#if PY_MAJOR_VERSION < 3 + if (tmptype == &PyClass_Type) + continue; +#endif + if (!metaclass) { + metaclass = tmptype; + continue; + } + if (PyType_IsSubtype(metaclass, tmptype)) + continue; + if (PyType_IsSubtype(tmptype, metaclass)) { + metaclass = tmptype; + continue; + } + PyErr_SetString(PyExc_TypeError, + "metaclass conflict: " + "the metaclass of a derived class " + "must be a (non-strict) subclass " + "of the metaclasses of all its bases"); + return NULL; + } + if (!metaclass) { +#if PY_MAJOR_VERSION < 3 + metaclass = &PyClass_Type; +#else + metaclass = &PyType_Type; +#endif + } + Py_INCREF((PyObject*) metaclass); + return (PyObject*) metaclass; +} + +/* FetchCommonType */ +static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { + PyObject* fake_module; + PyTypeObject* cached_type = NULL; + fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI); + if (!fake_module) return NULL; + Py_INCREF(fake_module); + cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name); + if (cached_type) { + if (!PyType_Check((PyObject*)cached_type)) { + PyErr_Format(PyExc_TypeError, + "Shared Cython type %.200s is not a type object", + type->tp_name); + goto bad; + } + if (cached_type->tp_basicsize != type->tp_basicsize) { + PyErr_Format(PyExc_TypeError, + "Shared Cython type %.200s has the wrong size, try recompiling", + type->tp_name); + goto bad; + } + } else { + if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; + PyErr_Clear(); + if (PyType_Ready(type) < 0) goto bad; + if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0) + goto bad; + Py_INCREF(type); + cached_type = type; + } +done: + Py_DECREF(fake_module); + return cached_type; +bad: + Py_XDECREF(cached_type); + cached_type = NULL; + goto done; +} + +/* CythonFunction */ +#include +static PyObject * +__Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure) +{ + if (unlikely(op->func_doc == NULL)) { + if (op->func.m_ml->ml_doc) { +#if PY_MAJOR_VERSION >= 3 + op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc); +#else + op->func_doc = PyString_FromString(op->func.m_ml->ml_doc); +#endif + if (unlikely(op->func_doc == NULL)) + return NULL; + } else { + Py_INCREF(Py_None); + return Py_None; + } + } + Py_INCREF(op->func_doc); + return op->func_doc; +} +static int +__Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context) +{ + PyObject *tmp = op->func_doc; + if (value == NULL) { + value = Py_None; + } + Py_INCREF(value); + op->func_doc = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + if (unlikely(op->func_name == NULL)) { +#if PY_MAJOR_VERSION >= 3 + op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name); +#else + op->func_name = PyString_InternFromString(op->func.m_ml->ml_name); +#endif + if (unlikely(op->func_name == NULL)) + return NULL; + } + Py_INCREF(op->func_name); + return op->func_name; +} +static int +__Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context) +{ + PyObject *tmp; +#if PY_MAJOR_VERSION >= 3 + if (unlikely(value == NULL || !PyUnicode_Check(value))) +#else + if (unlikely(value == NULL || !PyString_Check(value))) +#endif + { + PyErr_SetString(PyExc_TypeError, + "__name__ must be set to a string object"); + return -1; + } + tmp = op->func_name; + Py_INCREF(value); + op->func_name = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + Py_INCREF(op->func_qualname); + return op->func_qualname; +} +static int +__Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context) +{ + PyObject *tmp; +#if PY_MAJOR_VERSION >= 3 + if (unlikely(value == NULL || !PyUnicode_Check(value))) +#else + if (unlikely(value == NULL || !PyString_Check(value))) +#endif + { + PyErr_SetString(PyExc_TypeError, + "__qualname__ must be set to a string object"); + return -1; + } + tmp = op->func_qualname; + Py_INCREF(value); + op->func_qualname = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED void *closure) +{ + PyObject *self; + self = m->func_closure; + if (self == NULL) + self = Py_None; + Py_INCREF(self); + return self; +} +static PyObject * +__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + if (unlikely(op->func_dict == NULL)) { + op->func_dict = PyDict_New(); + if (unlikely(op->func_dict == NULL)) + return NULL; + } + Py_INCREF(op->func_dict); + return op->func_dict; +} +static int +__Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context) +{ + PyObject *tmp; + if (unlikely(value == NULL)) { + PyErr_SetString(PyExc_TypeError, + "function's dictionary may not be deleted"); + return -1; + } + if (unlikely(!PyDict_Check(value))) { + PyErr_SetString(PyExc_TypeError, + "setting function's dictionary to a non-dict"); + return -1; + } + tmp = op->func_dict; + Py_INCREF(value); + op->func_dict = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + Py_INCREF(op->func_globals); + return op->func_globals; +} +static PyObject * +__Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + Py_INCREF(Py_None); + return Py_None; +} +static PyObject * +__Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + PyObject* result = (op->func_code) ? op->func_code : Py_None; + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { + int result = 0; + PyObject *res = op->defaults_getter((PyObject *) op); + if (unlikely(!res)) + return -1; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + op->defaults_tuple = PyTuple_GET_ITEM(res, 0); + Py_INCREF(op->defaults_tuple); + op->defaults_kwdict = PyTuple_GET_ITEM(res, 1); + Py_INCREF(op->defaults_kwdict); + #else + op->defaults_tuple = PySequence_ITEM(res, 0); + if (unlikely(!op->defaults_tuple)) result = -1; + else { + op->defaults_kwdict = PySequence_ITEM(res, 1); + if (unlikely(!op->defaults_kwdict)) result = -1; + } + #endif + Py_DECREF(res); + return result; +} +static int +__Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) { + PyObject* tmp; + if (!value) { + value = Py_None; + } else if (value != Py_None && !PyTuple_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__defaults__ must be set to a tuple object"); + return -1; + } + Py_INCREF(value); + tmp = op->defaults_tuple; + op->defaults_tuple = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) { + PyObject* result = op->defaults_tuple; + if (unlikely(!result)) { + if (op->defaults_getter) { + if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL; + result = op->defaults_tuple; + } else { + result = Py_None; + } + } + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) { + PyObject* tmp; + if (!value) { + value = Py_None; + } else if (value != Py_None && !PyDict_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__kwdefaults__ must be set to a dict object"); + return -1; + } + Py_INCREF(value); + tmp = op->defaults_kwdict; + op->defaults_kwdict = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) { + PyObject* result = op->defaults_kwdict; + if (unlikely(!result)) { + if (op->defaults_getter) { + if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL; + result = op->defaults_kwdict; + } else { + result = Py_None; + } + } + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) { + PyObject* tmp; + if (!value || value == Py_None) { + value = NULL; + } else if (!PyDict_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__annotations__ must be set to a dict object"); + return -1; + } + Py_XINCREF(value); + tmp = op->func_annotations; + op->func_annotations = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) { + PyObject* result = op->func_annotations; + if (unlikely(!result)) { + result = PyDict_New(); + if (unlikely(!result)) return NULL; + op->func_annotations = result; + } + Py_INCREF(result); + return result; +} +static PyGetSetDef __pyx_CyFunction_getsets[] = { + {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, + {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, + {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, + {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, + {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, + {(char *) "__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0}, + {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, + {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, + {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, + {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, + {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, + {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, + {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, + {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, + {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, + {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, + {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, + {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, + {0, 0, 0, 0, 0} +}; +static PyMemberDef __pyx_CyFunction_members[] = { + {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), PY_WRITE_RESTRICTED, 0}, + {0, 0, 0, 0, 0} +}; +static PyObject * +__Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args) +{ +#if PY_MAJOR_VERSION >= 3 + return PyUnicode_FromString(m->func.m_ml->ml_name); +#else + return PyString_FromString(m->func.m_ml->ml_name); +#endif +} +static PyMethodDef __pyx_CyFunction_methods[] = { + {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, + {0, 0, 0, 0} +}; +#if PY_VERSION_HEX < 0x030500A0 +#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist) +#else +#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func.m_weakreflist) +#endif +static PyObject *__Pyx_CyFunction_New(PyTypeObject *type, PyMethodDef *ml, int flags, PyObject* qualname, + PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { + __pyx_CyFunctionObject *op = PyObject_GC_New(__pyx_CyFunctionObject, type); + if (op == NULL) + return NULL; + op->flags = flags; + __Pyx_CyFunction_weakreflist(op) = NULL; + op->func.m_ml = ml; + op->func.m_self = (PyObject *) op; + Py_XINCREF(closure); + op->func_closure = closure; + Py_XINCREF(module); + op->func.m_module = module; + op->func_dict = NULL; + op->func_name = NULL; + Py_INCREF(qualname); + op->func_qualname = qualname; + op->func_doc = NULL; + op->func_classobj = NULL; + op->func_globals = globals; + Py_INCREF(op->func_globals); + Py_XINCREF(code); + op->func_code = code; + op->defaults_pyobjects = 0; + op->defaults = NULL; + op->defaults_tuple = NULL; + op->defaults_kwdict = NULL; + op->defaults_getter = NULL; + op->func_annotations = NULL; + PyObject_GC_Track(op); + return (PyObject *) op; +} +static int +__Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) +{ + Py_CLEAR(m->func_closure); + Py_CLEAR(m->func.m_module); + Py_CLEAR(m->func_dict); + Py_CLEAR(m->func_name); + Py_CLEAR(m->func_qualname); + Py_CLEAR(m->func_doc); + Py_CLEAR(m->func_globals); + Py_CLEAR(m->func_code); + Py_CLEAR(m->func_classobj); + Py_CLEAR(m->defaults_tuple); + Py_CLEAR(m->defaults_kwdict); + Py_CLEAR(m->func_annotations); + if (m->defaults) { + PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); + int i; + for (i = 0; i < m->defaults_pyobjects; i++) + Py_XDECREF(pydefaults[i]); + PyObject_Free(m->defaults); + m->defaults = NULL; + } + return 0; +} +static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m) +{ + if (__Pyx_CyFunction_weakreflist(m) != NULL) + PyObject_ClearWeakRefs((PyObject *) m); + __Pyx_CyFunction_clear(m); + PyObject_GC_Del(m); +} +static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) +{ + PyObject_GC_UnTrack(m); + __Pyx__CyFunction_dealloc(m); +} +static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) +{ + Py_VISIT(m->func_closure); + Py_VISIT(m->func.m_module); + Py_VISIT(m->func_dict); + Py_VISIT(m->func_name); + Py_VISIT(m->func_qualname); + Py_VISIT(m->func_doc); + Py_VISIT(m->func_globals); + Py_VISIT(m->func_code); + Py_VISIT(m->func_classobj); + Py_VISIT(m->defaults_tuple); + Py_VISIT(m->defaults_kwdict); + if (m->defaults) { + PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); + int i; + for (i = 0; i < m->defaults_pyobjects; i++) + Py_VISIT(pydefaults[i]); + } + return 0; +} +static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type) +{ + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) { + Py_INCREF(func); + return func; + } + if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) { + if (type == NULL) + type = (PyObject *)(Py_TYPE(obj)); + return __Pyx_PyMethod_New(func, type, (PyObject *)(Py_TYPE(type))); + } + if (obj == Py_None) + obj = NULL; + return __Pyx_PyMethod_New(func, obj, type); +} +static PyObject* +__Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) +{ +#if PY_MAJOR_VERSION >= 3 + return PyUnicode_FromFormat("", + op->func_qualname, (void *)op); +#else + return PyString_FromFormat("", + PyString_AsString(op->func_qualname), (void *)op); +#endif +} +static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) { + PyCFunctionObject* f = (PyCFunctionObject*)func; + PyCFunction meth = f->m_ml->ml_meth; + Py_ssize_t size; + switch (f->m_ml->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) { + case METH_VARARGS: + if (likely(kw == NULL || PyDict_Size(kw) == 0)) + return (*meth)(self, arg); + break; + case METH_VARARGS | METH_KEYWORDS: + return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw); + case METH_NOARGS: + if (likely(kw == NULL || PyDict_Size(kw) == 0)) { + size = PyTuple_GET_SIZE(arg); + if (likely(size == 0)) + return (*meth)(self, NULL); + PyErr_Format(PyExc_TypeError, + "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", + f->m_ml->ml_name, size); + return NULL; + } + break; + case METH_O: + if (likely(kw == NULL || PyDict_Size(kw) == 0)) { + size = PyTuple_GET_SIZE(arg); + if (likely(size == 1)) { + PyObject *result, *arg0; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + arg0 = PyTuple_GET_ITEM(arg, 0); + #else + arg0 = PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL; + #endif + result = (*meth)(self, arg0); + #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) + Py_DECREF(arg0); + #endif + return result; + } + PyErr_Format(PyExc_TypeError, + "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", + f->m_ml->ml_name, size); + return NULL; + } + break; + default: + PyErr_SetString(PyExc_SystemError, "Bad call flags in " + "__Pyx_CyFunction_Call. METH_OLDARGS is no " + "longer supported!"); + return NULL; + } + PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", + f->m_ml->ml_name); + return NULL; +} +static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { + return __Pyx_CyFunction_CallMethod(func, ((PyCFunctionObject*)func)->m_self, arg, kw); +} +static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) { + PyObject *result; + __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func; + if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { + Py_ssize_t argc; + PyObject *new_args; + PyObject *self; + argc = PyTuple_GET_SIZE(args); + new_args = PyTuple_GetSlice(args, 1, argc); + if (unlikely(!new_args)) + return NULL; + self = PyTuple_GetItem(args, 0); + if (unlikely(!self)) { + Py_DECREF(new_args); + return NULL; + } + result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw); + Py_DECREF(new_args); + } else { + result = __Pyx_CyFunction_Call(func, args, kw); + } + return result; +} +static PyTypeObject __pyx_CyFunctionType_type = { + PyVarObject_HEAD_INIT(0, 0) + "cython_function_or_method", + sizeof(__pyx_CyFunctionObject), + 0, + (destructor) __Pyx_CyFunction_dealloc, + 0, + 0, + 0, +#if PY_MAJOR_VERSION < 3 + 0, +#else + 0, +#endif + (reprfunc) __Pyx_CyFunction_repr, + 0, + 0, + 0, + 0, + __Pyx_CyFunction_CallAsMethod, + 0, + 0, + 0, + 0, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, + 0, + (traverseproc) __Pyx_CyFunction_traverse, + (inquiry) __Pyx_CyFunction_clear, + 0, +#if PY_VERSION_HEX < 0x030500A0 + offsetof(__pyx_CyFunctionObject, func_weakreflist), +#else + offsetof(PyCFunctionObject, m_weakreflist), +#endif + 0, + 0, + __pyx_CyFunction_methods, + __pyx_CyFunction_members, + __pyx_CyFunction_getsets, + 0, + 0, + __Pyx_CyFunction_descr_get, + 0, + offsetof(__pyx_CyFunctionObject, func_dict), + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, +#if PY_VERSION_HEX >= 0x030400a1 + 0, +#endif +}; +static int __pyx_CyFunction_init(void) { + __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); + if (unlikely(__pyx_CyFunctionType == NULL)) { + return -1; + } + return 0; +} +static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults = PyObject_Malloc(size); + if (unlikely(!m->defaults)) + return PyErr_NoMemory(); + memset(m->defaults, 0, size); + m->defaults_pyobjects = pyobjects; + return m->defaults; +} +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults_tuple = tuple; + Py_INCREF(tuple); +} +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults_kwdict = dict; + Py_INCREF(dict); +} +static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->func_annotations = dict; + Py_INCREF(dict); +} + +/* Py3ClassCreate */ +static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, + PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) { + PyObject *ns; + if (metaclass) { + PyObject *prep = __Pyx_PyObject_GetAttrStr(metaclass, __pyx_n_s_prepare); + if (prep) { + PyObject *pargs = PyTuple_Pack(2, name, bases); + if (unlikely(!pargs)) { + Py_DECREF(prep); + return NULL; + } + ns = PyObject_Call(prep, pargs, mkw); + Py_DECREF(prep); + Py_DECREF(pargs); + } else { + if (unlikely(!PyErr_ExceptionMatches(PyExc_AttributeError))) + return NULL; + PyErr_Clear(); + ns = PyDict_New(); + } + } else { + ns = PyDict_New(); + } + if (unlikely(!ns)) + return NULL; + if (unlikely(PyObject_SetItem(ns, __pyx_n_s_module, modname) < 0)) goto bad; + if (unlikely(PyObject_SetItem(ns, __pyx_n_s_qualname, qualname) < 0)) goto bad; + if (unlikely(doc && PyObject_SetItem(ns, __pyx_n_s_doc, doc) < 0)) goto bad; + return ns; +bad: + Py_DECREF(ns); + return NULL; +} +static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, + PyObject *dict, PyObject *mkw, + int calculate_metaclass, int allow_py2_metaclass) { + PyObject *result, *margs; + PyObject *owned_metaclass = NULL; + if (allow_py2_metaclass) { + owned_metaclass = PyObject_GetItem(dict, __pyx_n_s_metaclass); + if (owned_metaclass) { + metaclass = owned_metaclass; + } else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) { + PyErr_Clear(); + } else { + return NULL; + } + } + if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) { + metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases); + Py_XDECREF(owned_metaclass); + if (unlikely(!metaclass)) + return NULL; + owned_metaclass = metaclass; + } + margs = PyTuple_Pack(3, name, bases, dict); + if (unlikely(!margs)) { + result = NULL; + } else { + result = PyObject_Call(metaclass, margs, mkw); + Py_DECREF(margs); + } + Py_XDECREF(owned_metaclass); + return result; +} + +/* GetAttr */ +static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) { +#if CYTHON_USE_TYPE_SLOTS +#if PY_MAJOR_VERSION >= 3 + if (likely(PyUnicode_Check(n))) +#else + if (likely(PyString_Check(n))) +#endif + return __Pyx_PyObject_GetAttrStr(o, n); +#endif + return PyObject_GetAttr(o, n); +} + +/* Globals */ +static PyObject* __Pyx_Globals(void) { + Py_ssize_t i; + PyObject *names; + PyObject *globals = __pyx_d; + Py_INCREF(globals); + names = PyObject_Dir(__pyx_m); + if (!names) + goto bad; + for (i = PyList_GET_SIZE(names)-1; i >= 0; i--) { +#if CYTHON_COMPILING_IN_PYPY + PyObject* name = PySequence_ITEM(names, i); + if (!name) + goto bad; +#else + PyObject* name = PyList_GET_ITEM(names, i); +#endif + if (!PyDict_Contains(globals, name)) { + PyObject* value = __Pyx_GetAttr(__pyx_m, name); + if (!value) { +#if CYTHON_COMPILING_IN_PYPY + Py_DECREF(name); +#endif + goto bad; + } + if (PyDict_SetItem(globals, name, value) < 0) { +#if CYTHON_COMPILING_IN_PYPY + Py_DECREF(name); +#endif + Py_DECREF(value); + goto bad; + } + } +#if CYTHON_COMPILING_IN_PYPY + Py_DECREF(name); +#endif + } + Py_DECREF(names); + return globals; +bad: + Py_XDECREF(names); + Py_XDECREF(globals); + return NULL; +} + +/* PyErrFetchRestore */ +#if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + tmp_type = tstate->curexc_type; + tmp_value = tstate->curexc_value; + tmp_tb = tstate->curexc_traceback; + tstate->curexc_type = type; + tstate->curexc_value = value; + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +} +static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { + *type = tstate->curexc_type; + *value = tstate->curexc_value; + *tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +} +#endif + +/* CLineInTraceback */ +#ifndef CYTHON_CLINE_IN_TRACEBACK +static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { + PyObject *use_cline; + PyObject *ptype, *pvalue, *ptraceback; +#if CYTHON_COMPILING_IN_CPYTHON + PyObject **cython_runtime_dict; +#endif + if (unlikely(!__pyx_cython_runtime)) { + return c_line; + } + __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); +#if CYTHON_COMPILING_IN_CPYTHON + cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); + if (likely(cython_runtime_dict)) { + __PYX_PY_DICT_LOOKUP_IF_MODIFIED( + use_cline, *cython_runtime_dict, + __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback)) + } else +#endif + { + PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback); + if (use_cline_obj) { + use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; + Py_DECREF(use_cline_obj); + } else { + PyErr_Clear(); + use_cline = NULL; + } + } + if (!use_cline) { + c_line = 0; + PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); + } + else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { + c_line = 0; + } + __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); + return c_line; +} +#endif + +/* CodeObjectCache */ +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { + int start = 0, mid = 0, end = count - 1; + if (end >= 0 && code_line > entries[end].code_line) { + return count; + } + while (start < end) { + mid = start + (end - start) / 2; + if (code_line < entries[mid].code_line) { + end = mid; + } else if (code_line > entries[mid].code_line) { + start = mid + 1; + } else { + return mid; + } + } + if (code_line <= entries[mid].code_line) { + return mid; + } else { + return mid + 1; + } +} +static PyCodeObject *__pyx_find_code_object(int code_line) { + PyCodeObject* code_object; + int pos; + if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { + return NULL; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { + return NULL; + } + code_object = __pyx_code_cache.entries[pos].code_object; + Py_INCREF(code_object); + return code_object; +} +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { + int pos, i; + __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; + if (unlikely(!code_line)) { + return; + } + if (unlikely(!entries)) { + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); + if (likely(entries)) { + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = 64; + __pyx_code_cache.count = 1; + entries[0].code_line = code_line; + entries[0].code_object = code_object; + Py_INCREF(code_object); + } + return; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { + PyCodeObject* tmp = entries[pos].code_object; + entries[pos].code_object = code_object; + Py_DECREF(tmp); + return; + } + if (__pyx_code_cache.count == __pyx_code_cache.max_count) { + int new_max = __pyx_code_cache.max_count + 64; + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( + __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry)); + if (unlikely(!entries)) { + return; + } + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = new_max; + } + for (i=__pyx_code_cache.count; i>pos; i--) { + entries[i] = entries[i-1]; + } + entries[pos].code_line = code_line; + entries[pos].code_object = code_object; + __pyx_code_cache.count++; + Py_INCREF(code_object); +} + +/* AddTraceback */ +#include "compile.h" +#include "frameobject.h" +#include "traceback.h" +static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( + const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyObject *py_srcfile = 0; + PyObject *py_funcname = 0; + #if PY_MAJOR_VERSION < 3 + py_srcfile = PyString_FromString(filename); + #else + py_srcfile = PyUnicode_FromString(filename); + #endif + if (!py_srcfile) goto bad; + if (c_line) { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + #else + py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + #endif + } + else { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromString(funcname); + #else + py_funcname = PyUnicode_FromString(funcname); + #endif + } + if (!py_funcname) goto bad; + py_code = __Pyx_PyCode_New( + 0, + 0, + 0, + 0, + 0, + __pyx_empty_bytes, /*PyObject *code,*/ + __pyx_empty_tuple, /*PyObject *consts,*/ + __pyx_empty_tuple, /*PyObject *names,*/ + __pyx_empty_tuple, /*PyObject *varnames,*/ + __pyx_empty_tuple, /*PyObject *freevars,*/ + __pyx_empty_tuple, /*PyObject *cellvars,*/ + py_srcfile, /*PyObject *filename,*/ + py_funcname, /*PyObject *name,*/ + py_line, + __pyx_empty_bytes /*PyObject *lnotab*/ + ); + Py_DECREF(py_srcfile); + Py_DECREF(py_funcname); + return py_code; +bad: + Py_XDECREF(py_srcfile); + Py_XDECREF(py_funcname); + return NULL; +} +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyFrameObject *py_frame = 0; + PyThreadState *tstate = __Pyx_PyThreadState_Current; + if (c_line) { + c_line = __Pyx_CLineForTraceback(tstate, c_line); + } + py_code = __pyx_find_code_object(c_line ? -c_line : py_line); + if (!py_code) { + py_code = __Pyx_CreateCodeObjectForTraceback( + funcname, c_line, py_line, filename); + if (!py_code) goto bad; + __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); + } + py_frame = PyFrame_New( + tstate, /*PyThreadState *tstate,*/ + py_code, /*PyCodeObject *code,*/ + __pyx_d, /*PyObject *globals,*/ + 0 /*PyObject *locals*/ + ); + if (!py_frame) goto bad; + __Pyx_PyFrame_SetLineNumber(py_frame, py_line); + PyTraceBack_Here(py_frame); +bad: + Py_XDECREF(py_code); + Py_XDECREF(py_frame); +} + +/* CIntToPy */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { + const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(long) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(long) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(long) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(long), + little, !is_unsigned); + } +} + +/* CIntFromPyVerify */ +#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ + __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) +#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ + __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) +#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ + {\ + func_type value = func_value;\ + if (sizeof(target_type) < sizeof(func_type)) {\ + if (unlikely(value != (func_type) (target_type) value)) {\ + func_type zero = 0;\ + if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ + return (target_type) -1;\ + if (is_unsigned && unlikely(value < zero))\ + goto raise_neg_overflow;\ + else\ + goto raise_overflow;\ + }\ + }\ + return (target_type) value;\ + } + +/* CIntFromPy */ +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { + const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(long) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (long) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (long) 0; + case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0]) + case 2: + if (8 * sizeof(long) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) { + return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + case 3: + if (8 * sizeof(long) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) { + return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + case 4: + if (8 * sizeof(long) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) { + return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (long) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if (sizeof(long) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (long) 0; + case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0])) + case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0]) + case -2: + if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 2: + if (8 * sizeof(long) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case -3: + if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 3: + if (8 * sizeof(long) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case -4: + if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 4: + if (8 * sizeof(long) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + } +#endif + if (sizeof(long) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + long val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (long) -1; + } + } else { + long val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (long) -1; + val = __Pyx_PyInt_As_long(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to long"); + return (long) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to long"); + return (long) -1; +} + +/* CIntFromPy */ +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { + const int neg_one = (int) ((int) 0 - (int) 1), const_zero = (int) 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(int) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (int) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (int) 0; + case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0]) + case 2: + if (8 * sizeof(int) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) { + return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + case 3: + if (8 * sizeof(int) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) { + return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + case 4: + if (8 * sizeof(int) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) { + return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (int) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if (sizeof(int) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (int) 0; + case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0])) + case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0]) + case -2: + if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { + return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 2: + if (8 * sizeof(int) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { + return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case -3: + if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { + return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 3: + if (8 * sizeof(int) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { + return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case -4: + if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { + return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 4: + if (8 * sizeof(int) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { + return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + } +#endif + if (sizeof(int) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + int val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (int) -1; + } + } else { + int val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (int) -1; + val = __Pyx_PyInt_As_int(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to int"); + return (int) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to int"); + return (int) -1; +} + +/* FastTypeChecks */ +#if CYTHON_COMPILING_IN_CPYTHON +static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) { + while (a) { + a = a->tp_base; + if (a == b) + return 1; + } + return b == &PyBaseObject_Type; +} +static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) { + PyObject *mro; + if (a == b) return 1; + mro = a->tp_mro; + if (likely(mro)) { + Py_ssize_t i, n; + n = PyTuple_GET_SIZE(mro); + for (i = 0; i < n; i++) { + if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b) + return 1; + } + return 0; + } + return __Pyx_InBases(a, b); +} +#if PY_MAJOR_VERSION == 2 +static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { + PyObject *exception, *value, *tb; + int res; + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ErrFetch(&exception, &value, &tb); + res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; + if (unlikely(res == -1)) { + PyErr_WriteUnraisable(err); + res = 0; + } + if (!res) { + res = PyObject_IsSubclass(err, exc_type2); + if (unlikely(res == -1)) { + PyErr_WriteUnraisable(err); + res = 0; + } + } + __Pyx_ErrRestore(exception, value, tb); + return res; +} +#else +static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { + int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0; + if (!res) { + res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); + } + return res; +} +#endif +static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { + Py_ssize_t i, n; + assert(PyExceptionClass_Check(exc_type)); + n = PyTuple_GET_SIZE(tuple); +#if PY_MAJOR_VERSION >= 3 + for (i=0; i= 0x02070000 + cobj = PyCapsule_New(p, sig, 0); +#else + cobj = PyCObject_FromVoidPtrAndDesc(p, (void *)sig, 0); +#endif + if (!cobj) + goto bad; + if (PyDict_SetItem(d, name, cobj) < 0) + goto bad; + Py_DECREF(cobj); + Py_DECREF(d); + return 0; +bad: + Py_XDECREF(cobj); + Py_XDECREF(d); + return -1; +} + +/* FunctionExport */ +static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig) { + PyObject *d = 0; + PyObject *cobj = 0; + union { + void (*fp)(void); + void *p; + } tmp; + d = PyObject_GetAttrString(__pyx_m, (char *)"__pyx_capi__"); + if (!d) { + PyErr_Clear(); + d = PyDict_New(); + if (!d) + goto bad; + Py_INCREF(d); + if (PyModule_AddObject(__pyx_m, (char *)"__pyx_capi__", d) < 0) + goto bad; + } + tmp.fp = f; +#if PY_VERSION_HEX >= 0x02070000 + cobj = PyCapsule_New(tmp.p, sig, 0); +#else + cobj = PyCObject_FromVoidPtrAndDesc(tmp.p, (void *)sig, 0); +#endif + if (!cobj) + goto bad; + if (PyDict_SetItemString(d, name, cobj) < 0) + goto bad; + Py_DECREF(cobj); + Py_DECREF(d); + return 0; +bad: + Py_XDECREF(cobj); + Py_XDECREF(d); + return -1; +} + +/* VoidPtrImport */ +#ifndef __PYX_HAVE_RT_ImportVoidPtr +#define __PYX_HAVE_RT_ImportVoidPtr +static int __Pyx_ImportVoidPtr(PyObject *module, const char *name, void **p, const char *sig) { + PyObject *d = 0; + PyObject *cobj = 0; + d = PyObject_GetAttrString(module, (char *)"__pyx_capi__"); + if (!d) + goto bad; + cobj = PyDict_GetItemString(d, name); + if (!cobj) { + PyErr_Format(PyExc_ImportError, + "%.200s does not export expected C variable %.200s", + PyModule_GetName(module), name); + goto bad; + } +#if PY_VERSION_HEX >= 0x02070000 + if (!PyCapsule_IsValid(cobj, sig)) { + PyErr_Format(PyExc_TypeError, + "C variable %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", + PyModule_GetName(module), name, sig, PyCapsule_GetName(cobj)); + goto bad; + } + *p = PyCapsule_GetPointer(cobj, sig); +#else + {const char *desc, *s1, *s2; + desc = (const char *)PyCObject_GetDesc(cobj); + if (!desc) + goto bad; + s1 = desc; s2 = sig; + while (*s1 != '\0' && *s1 == *s2) { s1++; s2++; } + if (*s1 != *s2) { + PyErr_Format(PyExc_TypeError, + "C variable %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", + PyModule_GetName(module), name, sig, desc); + goto bad; + } + *p = PyCObject_AsVoidPtr(cobj);} +#endif + if (!(*p)) + goto bad; + Py_DECREF(d); + return 0; +bad: + Py_XDECREF(d); + return -1; +} +#endif + +/* InitStrings */ +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { + while (t->p) { + #if PY_MAJOR_VERSION < 3 + if (t->is_unicode) { + *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); + } else if (t->intern) { + *t->p = PyString_InternFromString(t->s); + } else { + *t->p = PyString_FromStringAndSize(t->s, t->n - 1); + } + #else + if (t->is_unicode | t->is_str) { + if (t->intern) { + *t->p = PyUnicode_InternFromString(t->s); + } else if (t->encoding) { + *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); + } else { + *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); + } + } else { + *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); + } + #endif + if (!*t->p) + return -1; + if (PyObject_Hash(*t->p) == -1) + return -1; + ++t; + } + return 0; +} + +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { + return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); +} +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { + Py_ssize_t ignore; + return __Pyx_PyObject_AsStringAndSize(o, &ignore); +} +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +#if !CYTHON_PEP393_ENABLED +static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { + char* defenc_c; + PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); + if (!defenc) return NULL; + defenc_c = PyBytes_AS_STRING(defenc); +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + { + char* end = defenc_c + PyBytes_GET_SIZE(defenc); + char* c; + for (c = defenc_c; c < end; c++) { + if ((unsigned char) (*c) >= 128) { + PyUnicode_AsASCIIString(o); + return NULL; + } + } + } +#endif + *length = PyBytes_GET_SIZE(defenc); + return defenc_c; +} +#else +static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { + if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + if (likely(PyUnicode_IS_ASCII(o))) { + *length = PyUnicode_GET_LENGTH(o); + return PyUnicode_AsUTF8(o); + } else { + PyUnicode_AsASCIIString(o); + return NULL; + } +#else + return PyUnicode_AsUTF8AndSize(o, length); +#endif +} +#endif +#endif +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT + if ( +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + __Pyx_sys_getdefaultencoding_not_ascii && +#endif + PyUnicode_Check(o)) { + return __Pyx_PyUnicode_AsStringAndSize(o, length); + } else +#endif +#if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) + if (PyByteArray_Check(o)) { + *length = PyByteArray_GET_SIZE(o); + return PyByteArray_AS_STRING(o); + } else +#endif + { + char* result; + int r = PyBytes_AsStringAndSize(o, &result, length); + if (unlikely(r < 0)) { + return NULL; + } else { + return result; + } + } +} +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { + int is_true = x == Py_True; + if (is_true | (x == Py_False) | (x == Py_None)) return is_true; + else return PyObject_IsTrue(x); +} +static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) { + int retval; + if (unlikely(!x)) return -1; + retval = __Pyx_PyObject_IsTrue(x); + Py_DECREF(x); + return retval; +} +static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) { +#if PY_MAJOR_VERSION >= 3 + if (PyLong_Check(result)) { + if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, + "__int__ returned non-int (type %.200s). " + "The ability to return an instance of a strict subclass of int " + "is deprecated, and may be removed in a future version of Python.", + Py_TYPE(result)->tp_name)) { + Py_DECREF(result); + return NULL; + } + return result; + } +#endif + PyErr_Format(PyExc_TypeError, + "__%.4s__ returned non-%.4s (type %.200s)", + type_name, type_name, Py_TYPE(result)->tp_name); + Py_DECREF(result); + return NULL; +} +static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { +#if CYTHON_USE_TYPE_SLOTS + PyNumberMethods *m; +#endif + const char *name = NULL; + PyObject *res = NULL; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x) || PyLong_Check(x))) +#else + if (likely(PyLong_Check(x))) +#endif + return __Pyx_NewRef(x); +#if CYTHON_USE_TYPE_SLOTS + m = Py_TYPE(x)->tp_as_number; + #if PY_MAJOR_VERSION < 3 + if (m && m->nb_int) { + name = "int"; + res = m->nb_int(x); + } + else if (m && m->nb_long) { + name = "long"; + res = m->nb_long(x); + } + #else + if (likely(m && m->nb_int)) { + name = "int"; + res = m->nb_int(x); + } + #endif +#else + if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { + res = PyNumber_Int(x); + } +#endif + if (likely(res)) { +#if PY_MAJOR_VERSION < 3 + if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) { +#else + if (unlikely(!PyLong_CheckExact(res))) { +#endif + return __Pyx_PyNumber_IntOrLongWrongResultType(res, name); + } + } + else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_TypeError, + "an integer is required"); + } + return res; +} +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { + Py_ssize_t ival; + PyObject *x; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_CheckExact(b))) { + if (sizeof(Py_ssize_t) >= sizeof(long)) + return PyInt_AS_LONG(b); + else + return PyInt_AsSsize_t(b); + } +#endif + if (likely(PyLong_CheckExact(b))) { + #if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)b)->ob_digit; + const Py_ssize_t size = Py_SIZE(b); + if (likely(__Pyx_sst_abs(size) <= 1)) { + ival = likely(size) ? digits[0] : 0; + if (size == -1) ival = -ival; + return ival; + } else { + switch (size) { + case 2: + if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { + return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -2: + if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case 3: + if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { + return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -3: + if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case 4: + if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { + return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -4: + if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + } + } + #endif + return PyLong_AsSsize_t(b); + } + x = PyNumber_Index(b); + if (!x) return -1; + ival = PyInt_AsSsize_t(x); + Py_DECREF(x); + return ival; +} +static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) { + return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False); +} +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { + return PyInt_FromSize_t(ival); +} + + +#endif /* Py_PYTHON_H */ diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_hub_local.html b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_hub_local.html new file mode 100644 index 00000000..9f1315cb --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_hub_local.html @@ -0,0 +1,1141 @@ + + + + + + Cython: _hub_local.py + + + +

Generated by Cython 0.29.2

+

+ Yellow lines hint at Python interaction.
+ Click on a line that starts with a "+" to see the C code that Cython generated for it. +

+

Raw output: _hub_local.c

+
+001: # -*- coding: utf-8 -*-
+
  __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
 002: # copyright 2018 gevent. See LICENSE
+
 003: """
+
 004: Maintains the thread local hub.
+
 005: 
+
 006: """
+
 007: from __future__ import absolute_import
+
 008: from __future__ import division
+
 009: from __future__ import print_function
+
 010: 
+
 011: 
+
+012: from gevent._compat import thread_mod_name
+
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 12, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(__pyx_n_s_thread_mod_name);
+  __Pyx_GIVEREF(__pyx_n_s_thread_mod_name);
+  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_thread_mod_name);
+  __pyx_t_2 = __Pyx_Import(__pyx_n_s_gevent__compat, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 12, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_thread_mod_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 12, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_thread_mod_name, __pyx_t_1) < 0) __PYX_ERR(0, 12, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
 013: 
+
+014: __all__ = [
+
  __pyx_t_2 = PyList_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 14, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_get_hub);
+  __Pyx_GIVEREF(__pyx_n_s_get_hub);
+  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_get_hub);
+  __Pyx_INCREF(__pyx_n_s_get_hub_noargs);
+  __Pyx_GIVEREF(__pyx_n_s_get_hub_noargs);
+  PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_get_hub_noargs);
+  __Pyx_INCREF(__pyx_n_s_get_hub_if_exists);
+  __Pyx_GIVEREF(__pyx_n_s_get_hub_if_exists);
+  PyList_SET_ITEM(__pyx_t_2, 2, __pyx_n_s_get_hub_if_exists);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_all, __pyx_t_2) < 0) __PYX_ERR(0, 14, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
 015:     'get_hub',
+
 016:     'get_hub_noargs',
+
 017:     'get_hub_if_exists',
+
 018: ]
+
 019: 
+
 020: # These must be the "real" native thread versions,
+
 021: # not monkey-patched.
+
 022: # We are imported early enough (by gevent/__init__) that
+
 023: # we can rely on not being monkey-patched in any way yet.
+
+024: class _Threadlocal(__import__(thread_mod_name)._local):
+
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_thread_mod_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 24, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin___import__, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 24, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_local); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 24, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 24, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_2);
+  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
+  __pyx_t_2 = 0;
+  __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 24, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_Threadlocal, __pyx_n_s_Threadlocal, (PyObject *) NULL, __pyx_n_s_gevent___hub_local, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 24, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+/* … */
+  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_Threadlocal, __pyx_t_1, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 24, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_4);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Threadlocal, __pyx_t_4) < 0) __PYX_ERR(0, 24, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 025: 
+
+026:     def __init__(self):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_11__hub_local_12_Threadlocal_1__init__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
+static PyMethodDef __pyx_mdef_6gevent_11__hub_local_12_Threadlocal_1__init__ = {"__init__", (PyCFunction)__pyx_pw_6gevent_11__hub_local_12_Threadlocal_1__init__, METH_O, 0};
+static PyObject *__pyx_pw_6gevent_11__hub_local_12_Threadlocal_1__init__(PyObject *__pyx_self, PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_11__hub_local_12_Threadlocal___init__(__pyx_self, ((PyObject *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_11__hub_local_12_Threadlocal___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_AddTraceback("gevent.__hub_local._Threadlocal.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple_ = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 26, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple_);
+  __Pyx_GIVEREF(__pyx_tuple_);
+/* … */
+  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_11__hub_local_12_Threadlocal_1__init__, 0, __pyx_n_s_Threadlocal___init, NULL, __pyx_n_s_gevent___hub_local, __pyx_d, ((PyObject *)__pyx_codeobj__2)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 26, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_4);
+  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_init, __pyx_t_4) < 0) __PYX_ERR(0, 26, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __pyx_codeobj__2 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple_, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__hub_local_py, __pyx_n_s_init, 26, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2)) __PYX_ERR(0, 26, __pyx_L1_error)
+
 027:         # Use a class with an initializer so that we can test
+
 028:         # for 'is None' instead of catching AttributeError, making
+
 029:         # the code cleaner and possibly solving some corner cases
+
 030:         # (like #687)
+
+031:         super(_Threadlocal, self).__init__()
+
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Threadlocal); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 31, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 31, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_GIVEREF(__pyx_t_2);
+  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
+  __Pyx_INCREF(__pyx_v_self);
+  __Pyx_GIVEREF(__pyx_v_self);
+  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_self);
+  __pyx_t_2 = 0;
+  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 31, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_init); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 31, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_2 = NULL;
+  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
+    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
+    if (likely(__pyx_t_2)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+      __Pyx_INCREF(__pyx_t_2);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_3, function);
+    }
+  }
+  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 31, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+032:         self.Hub = None
+
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_Hub, Py_None) < 0) __PYX_ERR(0, 32, __pyx_L1_error)
+
+033:         self.loop = None
+
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_loop, Py_None) < 0) __PYX_ERR(0, 33, __pyx_L1_error)
+
+034:         self.hub = None
+
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_hub, Py_None) < 0) __PYX_ERR(0, 34, __pyx_L1_error)
+
 035: 
+
+036: _threadlocal = _Threadlocal()
+
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Threadlocal); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 36, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 36, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_XGOTREF(__pyx_v_6gevent_11__hub_local__threadlocal);
+  __Pyx_DECREF_SET(__pyx_v_6gevent_11__hub_local__threadlocal, __pyx_t_2);
+  __Pyx_GIVEREF(__pyx_t_2);
+  __pyx_t_2 = 0;
+
 037: 
+
+038: Hub = None # Set when gevent.hub is imported
+
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Hub, Py_None) < 0) __PYX_ERR(0, 38, __pyx_L1_error)
+
 039: 
+
+040: def get_hub_class():
+
static PyObject *__pyx_pw_6gevent_11__hub_local_1get_hub_class(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyObject *__pyx_f_6gevent_11__hub_local_get_hub_class(CYTHON_UNUSED int __pyx_skip_dispatch) {
+  PyObject *__pyx_v_hubtype = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("get_hub_class", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.__hub_local.get_hub_class", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_hubtype);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_11__hub_local_1get_hub_class(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6gevent_11__hub_local_get_hub_class[] = "Return the type of hub to use for the current thread.\n\n    If there's no type of hub for the current thread yet, 'gevent.hub.Hub' is used.\n    ";
+static PyMethodDef __pyx_mdef_6gevent_11__hub_local_1get_hub_class = {"get_hub_class", (PyCFunction)__pyx_pw_6gevent_11__hub_local_1get_hub_class, METH_NOARGS, __pyx_doc_6gevent_11__hub_local_get_hub_class};
+static PyObject *__pyx_pw_6gevent_11__hub_local_1get_hub_class(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("get_hub_class (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_11__hub_local_get_hub_class(__pyx_self);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_11__hub_local_get_hub_class(CYTHON_UNUSED PyObject *__pyx_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("get_hub_class", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __pyx_f_6gevent_11__hub_local_get_hub_class(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 40, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.__hub_local.get_hub_class", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_11__hub_local_1get_hub_class, 0, __pyx_n_s_get_hub_class, NULL, __pyx_n_s_gevent___hub_local, __pyx_d, ((PyObject *)__pyx_codeobj__3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 40, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_hub_class, __pyx_t_2) < 0) __PYX_ERR(0, 40, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+/* … */
+  __pyx_codeobj__3 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__hub_local_py, __pyx_n_s_get_hub_class, 40, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__3)) __PYX_ERR(0, 40, __pyx_L1_error)
+
 041:     """Return the type of hub to use for the current thread.
+
 042: 
+
 043:     If there's no type of hub for the current thread yet, 'gevent.hub.Hub' is used.
+
 044:     """
+
+045:     hubtype = _threadlocal.Hub
+
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_6gevent_11__hub_local__threadlocal, __pyx_n_s_Hub); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 45, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_v_hubtype = __pyx_t_1;
+  __pyx_t_1 = 0;
+
+046:     if hubtype is None:
+
  __pyx_t_2 = (__pyx_v_hubtype == Py_None);
+  __pyx_t_3 = (__pyx_t_2 != 0);
+  if (__pyx_t_3) {
+/* … */
+  }
+
+047:         hubtype = _threadlocal.Hub = Hub
+
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Hub); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 47, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_INCREF(__pyx_t_1);
+    __Pyx_DECREF_SET(__pyx_v_hubtype, __pyx_t_1);
+    if (__Pyx_PyObject_SetAttrStr(__pyx_v_6gevent_11__hub_local__threadlocal, __pyx_n_s_Hub, __pyx_t_1) < 0) __PYX_ERR(0, 47, __pyx_L1_error)
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+048:     return hubtype
+
  __Pyx_XDECREF(__pyx_r);
+  __Pyx_INCREF(__pyx_v_hubtype);
+  __pyx_r = __pyx_v_hubtype;
+  goto __pyx_L0;
+
 049: 
+
+050: def set_default_hub_class(hubtype):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_11__hub_local_3set_default_hub_class(PyObject *__pyx_self, PyObject *__pyx_v_hubtype); /*proto*/
+static PyMethodDef __pyx_mdef_6gevent_11__hub_local_3set_default_hub_class = {"set_default_hub_class", (PyCFunction)__pyx_pw_6gevent_11__hub_local_3set_default_hub_class, METH_O, 0};
+static PyObject *__pyx_pw_6gevent_11__hub_local_3set_default_hub_class(PyObject *__pyx_self, PyObject *__pyx_v_hubtype) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("set_default_hub_class (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_11__hub_local_2set_default_hub_class(__pyx_self, ((PyObject *)__pyx_v_hubtype));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_11__hub_local_2set_default_hub_class(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_hubtype) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("set_default_hub_class", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_AddTraceback("gevent.__hub_local.set_default_hub_class", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__4 = PyTuple_Pack(1, __pyx_n_s_hubtype); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 50, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__4);
+  __Pyx_GIVEREF(__pyx_tuple__4);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_11__hub_local_3set_default_hub_class, 0, __pyx_n_s_set_default_hub_class, NULL, __pyx_n_s_gevent___hub_local, __pyx_d, ((PyObject *)__pyx_codeobj__5)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 50, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_default_hub_class, __pyx_t_2) < 0) __PYX_ERR(0, 50, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_codeobj__5 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__4, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__hub_local_py, __pyx_n_s_set_default_hub_class, 50, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__5)) __PYX_ERR(0, 50, __pyx_L1_error)
+
 051:     global Hub
+
+052:     Hub = hubtype
+
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Hub, __pyx_v_hubtype) < 0) __PYX_ERR(0, 52, __pyx_L1_error)
+
 053: 
+
+054: def get_hub(*args, **kwargs):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_11__hub_local_5get_hub(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_6gevent_11__hub_local_4get_hub[] = "\n    Return the hub for the current thread.\n\n    If a hub does not exist in the current thread, a new one is\n    created of the type returned by :func:`get_hub_class`.\n\n    .. deprecated:: 1.3b1\n       The ``*args`` and ``**kwargs`` arguments are deprecated. They were\n       only used when the hub was created, and so were non-deterministic---to be\n       sure they were used, *all* callers had to pass them, or they were order-dependent.\n       Use ``set_hub`` instead.\n    ";
+static PyMethodDef __pyx_mdef_6gevent_11__hub_local_5get_hub = {"get_hub", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_11__hub_local_5get_hub, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_11__hub_local_4get_hub};
+static PyObject *__pyx_pw_6gevent_11__hub_local_5get_hub(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_args = 0;
+  PyObject *__pyx_v_kwargs = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("get_hub (wrapper)", 0);
+  if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "get_hub", 1))) return NULL;
+  if (unlikely(__pyx_kwds)) {
+    __pyx_v_kwargs = PyDict_Copy(__pyx_kwds); if (unlikely(!__pyx_v_kwargs)) return NULL;
+    __Pyx_GOTREF(__pyx_v_kwargs);
+  } else {
+    __pyx_v_kwargs = NULL;
+  }
+  __Pyx_INCREF(__pyx_args);
+  __pyx_v_args = __pyx_args;
+  __pyx_r = __pyx_pf_6gevent_11__hub_local_4get_hub(__pyx_self, __pyx_v_args, __pyx_v_kwargs);
+
+  /* function exit code */
+  __Pyx_XDECREF(__pyx_v_args);
+  __Pyx_XDECREF(__pyx_v_kwargs);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_11__hub_local_4get_hub(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) {
+  PyObject *__pyx_v_hub = NULL;
+  PyObject *__pyx_v_hubtype = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("get_hub", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.__hub_local.get_hub", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_hub);
+  __Pyx_XDECREF(__pyx_v_hubtype);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__6 = PyTuple_Pack(4, __pyx_n_s_args, __pyx_n_s_kwargs, __pyx_n_s_hub, __pyx_n_s_hubtype); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 54, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__6);
+  __Pyx_GIVEREF(__pyx_tuple__6);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_11__hub_local_5get_hub, 0, __pyx_n_s_get_hub, NULL, __pyx_n_s_gevent___hub_local, __pyx_d, ((PyObject *)__pyx_codeobj__7)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 54, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_hub, __pyx_t_2) < 0) __PYX_ERR(0, 54, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_codeobj__7 = (PyObject*)__Pyx_PyCode_New(0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__6, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__hub_local_py, __pyx_n_s_get_hub, 54, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__7)) __PYX_ERR(0, 54, __pyx_L1_error)
+
 055:     """
+
 056:     Return the hub for the current thread.
+
 057: 
+
 058:     If a hub does not exist in the current thread, a new one is
+
 059:     created of the type returned by :func:`get_hub_class`.
+
 060: 
+
 061:     .. deprecated:: 1.3b1
+
 062:        The ``*args`` and ``**kwargs`` arguments are deprecated. They were
+
 063:        only used when the hub was created, and so were non-deterministic---to be
+
 064:        sure they were used, *all* callers had to pass them, or they were order-dependent.
+
 065:        Use ``set_hub`` instead.
+
 066:     """
+
+067:     hub = _threadlocal.hub
+
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_6gevent_11__hub_local__threadlocal, __pyx_n_s_hub); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 67, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_v_hub = __pyx_t_1;
+  __pyx_t_1 = 0;
+
+068:     if hub is None:
+
  __pyx_t_2 = (__pyx_v_hub == Py_None);
+  __pyx_t_3 = (__pyx_t_2 != 0);
+  if (__pyx_t_3) {
+/* … */
+  }
+
+069:         hubtype = get_hub_class()
+
    __pyx_t_1 = __pyx_f_6gevent_11__hub_local_get_hub_class(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 69, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __pyx_v_hubtype = __pyx_t_1;
+    __pyx_t_1 = 0;
+
+070:         hub = _threadlocal.hub = hubtype(*args, **kwargs)
+
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_hubtype, __pyx_v_args, __pyx_v_kwargs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 70, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_INCREF(__pyx_t_1);
+    __Pyx_DECREF_SET(__pyx_v_hub, __pyx_t_1);
+    if (__Pyx_PyObject_SetAttrStr(__pyx_v_6gevent_11__hub_local__threadlocal, __pyx_n_s_hub, __pyx_t_1) < 0) __PYX_ERR(0, 70, __pyx_L1_error)
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+071:     return hub
+
  __Pyx_XDECREF(__pyx_r);
+  __Pyx_INCREF(__pyx_v_hub);
+  __pyx_r = __pyx_v_hub;
+  goto __pyx_L0;
+
 072: 
+
+073: def get_hub_noargs():
+
static PyObject *__pyx_pw_6gevent_11__hub_local_7get_hub_noargs(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *__pyx_f_6gevent_11__hub_local_get_hub_noargs(CYTHON_UNUSED int __pyx_skip_dispatch) {
+  PyObject *__pyx_v_hub = NULL;
+  PyObject *__pyx_v_hubtype = NULL;
+  struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("get_hub_noargs", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_AddTraceback("gevent.__hub_local.get_hub_noargs", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_hub);
+  __Pyx_XDECREF(__pyx_v_hubtype);
+  __Pyx_XGIVEREF((PyObject *)__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_11__hub_local_7get_hub_noargs(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyMethodDef __pyx_mdef_6gevent_11__hub_local_7get_hub_noargs = {"get_hub_noargs", (PyCFunction)__pyx_pw_6gevent_11__hub_local_7get_hub_noargs, METH_NOARGS, 0};
+static PyObject *__pyx_pw_6gevent_11__hub_local_7get_hub_noargs(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("get_hub_noargs (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_11__hub_local_6get_hub_noargs(__pyx_self);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_11__hub_local_6get_hub_noargs(CYTHON_UNUSED PyObject *__pyx_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("get_hub_noargs", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = ((PyObject *)__pyx_f_6gevent_11__hub_local_get_hub_noargs(0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 73, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.__hub_local.get_hub_noargs", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_11__hub_local_7get_hub_noargs, 0, __pyx_n_s_get_hub_noargs, NULL, __pyx_n_s_gevent___hub_local, __pyx_d, ((PyObject *)__pyx_codeobj__8)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 73, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_hub_noargs, __pyx_t_2) < 0) __PYX_ERR(0, 73, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+/* … */
+  __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__hub_local_py, __pyx_n_s_get_hub_noargs, 73, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) __PYX_ERR(0, 73, __pyx_L1_error)
+
 074:     # Just like get_hub, but cheaper to call because it
+
 075:     # takes no arguments or kwargs. See also a copy in
+
 076:     # gevent/greenlet.py
+
+077:     hub = _threadlocal.hub
+
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_6gevent_11__hub_local__threadlocal, __pyx_n_s_hub); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 77, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_v_hub = __pyx_t_1;
+  __pyx_t_1 = 0;
+
+078:     if hub is None:
+
  __pyx_t_2 = (__pyx_v_hub == Py_None);
+  __pyx_t_3 = (__pyx_t_2 != 0);
+  if (__pyx_t_3) {
+/* … */
+  }
+
+079:         hubtype = get_hub_class()
+
    __pyx_t_1 = __pyx_f_6gevent_11__hub_local_get_hub_class(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 79, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __pyx_v_hubtype = __pyx_t_1;
+    __pyx_t_1 = 0;
+
+080:         hub = _threadlocal.hub = hubtype()
+
    __Pyx_INCREF(__pyx_v_hubtype);
+    __pyx_t_4 = __pyx_v_hubtype; __pyx_t_5 = NULL;
+    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
+      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
+      if (likely(__pyx_t_5)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
+        __Pyx_INCREF(__pyx_t_5);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_4, function);
+      }
+    }
+    __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
+    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 80, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __Pyx_INCREF(__pyx_t_1);
+    __Pyx_DECREF_SET(__pyx_v_hub, __pyx_t_1);
+    if (__Pyx_PyObject_SetAttrStr(__pyx_v_6gevent_11__hub_local__threadlocal, __pyx_n_s_hub, __pyx_t_1) < 0) __PYX_ERR(0, 80, __pyx_L1_error)
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+081:     return hub
+
  __Pyx_XDECREF(((PyObject *)__pyx_r));
+  if (!(likely(((__pyx_v_hub) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_hub, __pyx_ptype_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop))))) __PYX_ERR(0, 81, __pyx_L1_error)
+  __Pyx_INCREF(__pyx_v_hub);
+  __pyx_r = ((struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *)__pyx_v_hub);
+  goto __pyx_L0;
+
 082: 
+
+083: def get_hub_if_exists():
+
static PyObject *__pyx_pw_6gevent_11__hub_local_9get_hub_if_exists(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *__pyx_f_6gevent_11__hub_local_get_hub_if_exists(CYTHON_UNUSED int __pyx_skip_dispatch) {
+  struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("get_hub_if_exists", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.__hub_local.get_hub_if_exists", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XGIVEREF((PyObject *)__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_11__hub_local_9get_hub_if_exists(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6gevent_11__hub_local_8get_hub_if_exists[] = "Return the hub for the current thread.\n\n    Return ``None`` if no hub has been created yet.\n    ";
+static PyMethodDef __pyx_mdef_6gevent_11__hub_local_9get_hub_if_exists = {"get_hub_if_exists", (PyCFunction)__pyx_pw_6gevent_11__hub_local_9get_hub_if_exists, METH_NOARGS, __pyx_doc_6gevent_11__hub_local_8get_hub_if_exists};
+static PyObject *__pyx_pw_6gevent_11__hub_local_9get_hub_if_exists(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("get_hub_if_exists (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_11__hub_local_8get_hub_if_exists(__pyx_self);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_11__hub_local_8get_hub_if_exists(CYTHON_UNUSED PyObject *__pyx_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("get_hub_if_exists", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = ((PyObject *)__pyx_f_6gevent_11__hub_local_get_hub_if_exists(0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 83, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.__hub_local.get_hub_if_exists", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_11__hub_local_9get_hub_if_exists, 0, __pyx_n_s_get_hub_if_exists, NULL, __pyx_n_s_gevent___hub_local, __pyx_d, ((PyObject *)__pyx_codeobj__9)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 83, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_hub_if_exists, __pyx_t_2) < 0) __PYX_ERR(0, 83, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+/* … */
+  __pyx_codeobj__9 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__hub_local_py, __pyx_n_s_get_hub_if_exists, 83, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__9)) __PYX_ERR(0, 83, __pyx_L1_error)
+
 084:     """Return the hub for the current thread.
+
 085: 
+
 086:     Return ``None`` if no hub has been created yet.
+
 087:     """
+
+088:     return _threadlocal.hub
+
  __Pyx_XDECREF(((PyObject *)__pyx_r));
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_6gevent_11__hub_local__threadlocal, __pyx_n_s_hub); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 88, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop))))) __PYX_ERR(0, 88, __pyx_L1_error)
+  __pyx_r = ((struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *)__pyx_t_1);
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
 089: 
+
 090: 
+
+091: def set_hub(hub):
+
static PyObject *__pyx_pw_6gevent_11__hub_local_11set_hub(PyObject *__pyx_self, PyObject *__pyx_v_hub); /*proto*/
+static PyObject *__pyx_f_6gevent_11__hub_local_set_hub(struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *__pyx_v_hub, CYTHON_UNUSED int __pyx_skip_dispatch) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("set_hub", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_AddTraceback("gevent.__hub_local.set_hub", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_11__hub_local_11set_hub(PyObject *__pyx_self, PyObject *__pyx_v_hub); /*proto*/
+static PyMethodDef __pyx_mdef_6gevent_11__hub_local_11set_hub = {"set_hub", (PyCFunction)__pyx_pw_6gevent_11__hub_local_11set_hub, METH_O, 0};
+static PyObject *__pyx_pw_6gevent_11__hub_local_11set_hub(PyObject *__pyx_self, PyObject *__pyx_v_hub) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("set_hub (wrapper)", 0);
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_hub), __pyx_ptype_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop, 1, "hub", 0))) __PYX_ERR(0, 91, __pyx_L1_error)
+  __pyx_r = __pyx_pf_6gevent_11__hub_local_10set_hub(__pyx_self, ((struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *)__pyx_v_hub));
+
+  /* function exit code */
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_11__hub_local_10set_hub(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *__pyx_v_hub) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("set_hub", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __pyx_f_6gevent_11__hub_local_set_hub(__pyx_v_hub, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 91, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.__hub_local.set_hub", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__10 = PyTuple_Pack(1, __pyx_n_s_hub); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 91, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__10);
+  __Pyx_GIVEREF(__pyx_tuple__10);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_11__hub_local_11set_hub, 0, __pyx_n_s_set_hub, NULL, __pyx_n_s_gevent___hub_local, __pyx_d, ((PyObject *)__pyx_codeobj__11)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 91, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_hub, __pyx_t_2) < 0) __PYX_ERR(0, 91, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_codeobj__11 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__10, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__hub_local_py, __pyx_n_s_set_hub, 91, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__11)) __PYX_ERR(0, 91, __pyx_L1_error)
+
+092:     _threadlocal.hub = hub
+
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_6gevent_11__hub_local__threadlocal, __pyx_n_s_hub, ((PyObject *)__pyx_v_hub)) < 0) __PYX_ERR(0, 92, __pyx_L1_error)
+
 093: 
+
+094: def get_loop():
+
static PyObject *__pyx_pw_6gevent_11__hub_local_13get_loop(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyObject *__pyx_f_6gevent_11__hub_local_get_loop(CYTHON_UNUSED int __pyx_skip_dispatch) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("get_loop", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.__hub_local.get_loop", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_11__hub_local_13get_loop(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyMethodDef __pyx_mdef_6gevent_11__hub_local_13get_loop = {"get_loop", (PyCFunction)__pyx_pw_6gevent_11__hub_local_13get_loop, METH_NOARGS, 0};
+static PyObject *__pyx_pw_6gevent_11__hub_local_13get_loop(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("get_loop (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_11__hub_local_12get_loop(__pyx_self);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_11__hub_local_12get_loop(CYTHON_UNUSED PyObject *__pyx_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("get_loop", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __pyx_f_6gevent_11__hub_local_get_loop(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 94, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.__hub_local.get_loop", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_11__hub_local_13get_loop, 0, __pyx_n_s_get_loop, NULL, __pyx_n_s_gevent___hub_local, __pyx_d, ((PyObject *)__pyx_codeobj__12)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 94, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_loop, __pyx_t_2) < 0) __PYX_ERR(0, 94, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+/* … */
+  __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__hub_local_py, __pyx_n_s_get_loop, 94, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(0, 94, __pyx_L1_error)
+
+095:     return _threadlocal.loop
+
  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_6gevent_11__hub_local__threadlocal, __pyx_n_s_loop); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 95, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
 096: 
+
+097: def set_loop(loop):
+
static PyObject *__pyx_pw_6gevent_11__hub_local_15set_loop(PyObject *__pyx_self, PyObject *__pyx_v_loop); /*proto*/
+static PyObject *__pyx_f_6gevent_11__hub_local_set_loop(PyObject *__pyx_v_loop, CYTHON_UNUSED int __pyx_skip_dispatch) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("set_loop", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_AddTraceback("gevent.__hub_local.set_loop", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_11__hub_local_15set_loop(PyObject *__pyx_self, PyObject *__pyx_v_loop); /*proto*/
+static PyMethodDef __pyx_mdef_6gevent_11__hub_local_15set_loop = {"set_loop", (PyCFunction)__pyx_pw_6gevent_11__hub_local_15set_loop, METH_O, 0};
+static PyObject *__pyx_pw_6gevent_11__hub_local_15set_loop(PyObject *__pyx_self, PyObject *__pyx_v_loop) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("set_loop (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_11__hub_local_14set_loop(__pyx_self, ((PyObject *)__pyx_v_loop));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_11__hub_local_14set_loop(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_loop) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("set_loop", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __pyx_f_6gevent_11__hub_local_set_loop(__pyx_v_loop, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 97, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.__hub_local.set_loop", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__13 = PyTuple_Pack(1, __pyx_n_s_loop); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 97, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__13);
+  __Pyx_GIVEREF(__pyx_tuple__13);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_11__hub_local_15set_loop, 0, __pyx_n_s_set_loop, NULL, __pyx_n_s_gevent___hub_local, __pyx_d, ((PyObject *)__pyx_codeobj__14)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 97, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_loop, __pyx_t_2) < 0) __PYX_ERR(0, 97, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+098:     _threadlocal.loop = loop
+
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_6gevent_11__hub_local__threadlocal, __pyx_n_s_loop, __pyx_v_loop) < 0) __PYX_ERR(0, 98, __pyx_L1_error)
+
 099: 
+
+100: from gevent._util import import_c_accel
+
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 100, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_import_c_accel);
+  __Pyx_GIVEREF(__pyx_n_s_import_c_accel);
+  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_import_c_accel);
+  __pyx_t_1 = __Pyx_Import(__pyx_n_s_gevent__util, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 100, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_import_c_accel); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 100, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_import_c_accel, __pyx_t_2) < 0) __PYX_ERR(0, 100, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+101: import_c_accel(globals(), 'gevent.__hub_local')
+
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_import_c_accel); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 101, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = __Pyx_Globals(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 101, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 101, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_GIVEREF(__pyx_t_2);
+  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_gevent___hub_local);
+  __Pyx_GIVEREF(__pyx_n_s_gevent___hub_local);
+  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_n_s_gevent___hub_local);
+  __pyx_t_2 = 0;
+  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 101, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_hub_local.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_hub_local.py new file mode 100644 index 00000000..622062a7 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_hub_local.py @@ -0,0 +1,101 @@ +# -*- coding: utf-8 -*- +# copyright 2018 gevent. See LICENSE +""" +Maintains the thread local hub. + +""" +from __future__ import absolute_import +from __future__ import division +from __future__ import print_function + + +from gevent._compat import thread_mod_name + +__all__ = [ + 'get_hub', + 'get_hub_noargs', + 'get_hub_if_exists', +] + +# These must be the "real" native thread versions, +# not monkey-patched. +# We are imported early enough (by gevent/__init__) that +# we can rely on not being monkey-patched in any way yet. +class _Threadlocal(__import__(thread_mod_name)._local): + + def __init__(self): + # Use a class with an initializer so that we can test + # for 'is None' instead of catching AttributeError, making + # the code cleaner and possibly solving some corner cases + # (like #687) + super(_Threadlocal, self).__init__() + self.Hub = None + self.loop = None + self.hub = None + +_threadlocal = _Threadlocal() + +Hub = None # Set when gevent.hub is imported + +def get_hub_class(): + """Return the type of hub to use for the current thread. + + If there's no type of hub for the current thread yet, 'gevent.hub.Hub' is used. + """ + hubtype = _threadlocal.Hub + if hubtype is None: + hubtype = _threadlocal.Hub = Hub + return hubtype + +def set_default_hub_class(hubtype): + global Hub + Hub = hubtype + +def get_hub(*args, **kwargs): + """ + Return the hub for the current thread. + + If a hub does not exist in the current thread, a new one is + created of the type returned by :func:`get_hub_class`. + + .. deprecated:: 1.3b1 + The ``*args`` and ``**kwargs`` arguments are deprecated. They were + only used when the hub was created, and so were non-deterministic---to be + sure they were used, *all* callers had to pass them, or they were order-dependent. + Use ``set_hub`` instead. + """ + hub = _threadlocal.hub + if hub is None: + hubtype = get_hub_class() + hub = _threadlocal.hub = hubtype(*args, **kwargs) + return hub + +def get_hub_noargs(): + # Just like get_hub, but cheaper to call because it + # takes no arguments or kwargs. See also a copy in + # gevent/greenlet.py + hub = _threadlocal.hub + if hub is None: + hubtype = get_hub_class() + hub = _threadlocal.hub = hubtype() + return hub + +def get_hub_if_exists(): + """Return the hub for the current thread. + + Return ``None`` if no hub has been created yet. + """ + return _threadlocal.hub + + +def set_hub(hub): + _threadlocal.hub = hub + +def get_loop(): + return _threadlocal.loop + +def set_loop(loop): + _threadlocal.loop = loop + +from gevent._util import import_c_accel +import_c_accel(globals(), 'gevent.__hub_local') diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_hub_primitives.c b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_hub_primitives.c new file mode 100644 index 00000000..920cd425 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_hub_primitives.c @@ -0,0 +1,12492 @@ +/* Generated by Cython 0.29.2 */ + +/* BEGIN: Cython Metadata +{ + "distutils": { + "depends": [ + "src/gevent/__hub_primitives.pxd", + "src\\gevent\\__hub_primitives.pxd" + ], + "include_dirs": [ + "C:\\Python37\\Include", + "deps" + ], + "name": "gevent.__hub_primitives", + "sources": [ + "src/gevent/_hub_primitives.py" + ] + }, + "module_name": "gevent.__hub_primitives" +} +END: Cython Metadata */ + +#define PY_SSIZE_T_CLEAN +#include "Python.h" +#ifndef Py_PYTHON_H + #error Python headers needed to compile C extensions, please install development version of Python. +#elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) + #error Cython requires Python 2.6+ or Python 3.3+. +#else +#define CYTHON_ABI "0_29_2" +#define CYTHON_HEX_VERSION 0x001D02F0 +#define CYTHON_FUTURE_DIVISION 1 +#include +#ifndef offsetof + #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) +#endif +#if !defined(WIN32) && !defined(MS_WINDOWS) + #ifndef __stdcall + #define __stdcall + #endif + #ifndef __cdecl + #define __cdecl + #endif + #ifndef __fastcall + #define __fastcall + #endif +#endif +#ifndef DL_IMPORT + #define DL_IMPORT(t) t +#endif +#ifndef DL_EXPORT + #define DL_EXPORT(t) t +#endif +#define __PYX_COMMA , +#ifndef HAVE_LONG_LONG + #if PY_VERSION_HEX >= 0x02070000 + #define HAVE_LONG_LONG + #endif +#endif +#ifndef PY_LONG_LONG + #define PY_LONG_LONG LONG_LONG +#endif +#ifndef Py_HUGE_VAL + #define Py_HUGE_VAL HUGE_VAL +#endif +#ifdef PYPY_VERSION + #define CYTHON_COMPILING_IN_PYPY 1 + #define CYTHON_COMPILING_IN_PYSTON 0 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #undef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 0 + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #if PY_VERSION_HEX < 0x03050000 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #elif !defined(CYTHON_USE_ASYNC_SLOTS) + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #undef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 0 + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #undef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 1 + #undef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 0 + #undef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 0 + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #undef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE 0 + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 +#elif defined(PYSTON_VERSION) + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_PYSTON 1 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #ifndef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 1 + #endif + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #ifndef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 1 + #endif + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #ifndef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 0 + #endif + #ifndef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 1 + #endif + #ifndef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 1 + #endif + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #undef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE 0 + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 +#else + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_PYSTON 0 + #define CYTHON_COMPILING_IN_CPYTHON 1 + #ifndef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 1 + #endif + #if PY_VERSION_HEX < 0x02070000 + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #elif !defined(CYTHON_USE_PYTYPE_LOOKUP) + #define CYTHON_USE_PYTYPE_LOOKUP 1 + #endif + #if PY_MAJOR_VERSION < 3 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #elif !defined(CYTHON_USE_ASYNC_SLOTS) + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #if PY_VERSION_HEX < 0x02070000 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #elif !defined(CYTHON_USE_PYLONG_INTERNALS) + #define CYTHON_USE_PYLONG_INTERNALS 1 + #endif + #ifndef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 1 + #endif + #ifndef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 1 + #endif + #if PY_VERSION_HEX < 0x030300F0 + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #elif !defined(CYTHON_USE_UNICODE_WRITER) + #define CYTHON_USE_UNICODE_WRITER 1 + #endif + #ifndef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 0 + #endif + #ifndef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 1 + #endif + #ifndef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 1 + #endif + #ifndef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 1 + #endif + #ifndef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 1 + #endif + #ifndef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000) + #endif + #ifndef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1) + #endif + #ifndef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1) + #endif + #ifndef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3) + #endif +#endif +#if !defined(CYTHON_FAST_PYCCALL) +#define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) +#endif +#if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #undef SHIFT + #undef BASE + #undef MASK + #ifdef SIZEOF_VOID_P + enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) }; + #endif +#endif +#ifndef __has_attribute + #define __has_attribute(x) 0 +#endif +#ifndef __has_cpp_attribute + #define __has_cpp_attribute(x) 0 +#endif +#ifndef CYTHON_RESTRICT + #if defined(__GNUC__) + #define CYTHON_RESTRICT __restrict__ + #elif defined(_MSC_VER) && _MSC_VER >= 1400 + #define CYTHON_RESTRICT __restrict + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_RESTRICT restrict + #else + #define CYTHON_RESTRICT + #endif +#endif +#ifndef CYTHON_UNUSED +# if defined(__GNUC__) +# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +#endif +#ifndef CYTHON_MAYBE_UNUSED_VAR +# if defined(__cplusplus) + template void CYTHON_MAYBE_UNUSED_VAR( const T& ) { } +# else +# define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x) +# endif +#endif +#ifndef CYTHON_NCP_UNUSED +# if CYTHON_COMPILING_IN_CPYTHON +# define CYTHON_NCP_UNUSED +# else +# define CYTHON_NCP_UNUSED CYTHON_UNUSED +# endif +#endif +#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) +#ifdef _MSC_VER + #ifndef _MSC_STDINT_H_ + #if _MSC_VER < 1300 + typedef unsigned char uint8_t; + typedef unsigned int uint32_t; + #else + typedef unsigned __int8 uint8_t; + typedef unsigned __int32 uint32_t; + #endif + #endif +#else + #include +#endif +#ifndef CYTHON_FALLTHROUGH + #if defined(__cplusplus) && __cplusplus >= 201103L + #if __has_cpp_attribute(fallthrough) + #define CYTHON_FALLTHROUGH [[fallthrough]] + #elif __has_cpp_attribute(clang::fallthrough) + #define CYTHON_FALLTHROUGH [[clang::fallthrough]] + #elif __has_cpp_attribute(gnu::fallthrough) + #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] + #endif + #endif + #ifndef CYTHON_FALLTHROUGH + #if __has_attribute(fallthrough) + #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) + #else + #define CYTHON_FALLTHROUGH + #endif + #endif + #if defined(__clang__ ) && defined(__apple_build_version__) + #if __apple_build_version__ < 7000000 + #undef CYTHON_FALLTHROUGH + #define CYTHON_FALLTHROUGH + #endif + #endif +#endif + +#ifndef CYTHON_INLINE + #if defined(__clang__) + #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) + #elif defined(__GNUC__) + #define CYTHON_INLINE __inline__ + #elif defined(_MSC_VER) + #define CYTHON_INLINE __inline + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_INLINE inline + #else + #define CYTHON_INLINE + #endif +#endif + +#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) + #define Py_OptimizeFlag 0 +#endif +#define __PYX_BUILD_PY_SSIZE_T "n" +#define CYTHON_FORMAT_SSIZE_T "z" +#if PY_MAJOR_VERSION < 3 + #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyClass_Type +#else + #define __Pyx_BUILTIN_MODULE_NAME "builtins" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyType_Type +#endif +#ifndef Py_TPFLAGS_CHECKTYPES + #define Py_TPFLAGS_CHECKTYPES 0 +#endif +#ifndef Py_TPFLAGS_HAVE_INDEX + #define Py_TPFLAGS_HAVE_INDEX 0 +#endif +#ifndef Py_TPFLAGS_HAVE_NEWBUFFER + #define Py_TPFLAGS_HAVE_NEWBUFFER 0 +#endif +#ifndef Py_TPFLAGS_HAVE_FINALIZE + #define Py_TPFLAGS_HAVE_FINALIZE 0 +#endif +#ifndef METH_STACKLESS + #define METH_STACKLESS 0 +#endif +#if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) + #ifndef METH_FASTCALL + #define METH_FASTCALL 0x80 + #endif + typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs); + typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args, + Py_ssize_t nargs, PyObject *kwnames); +#else + #define __Pyx_PyCFunctionFast _PyCFunctionFast + #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords +#endif +#if CYTHON_FAST_PYCCALL +#define __Pyx_PyFastCFunction_Check(func)\ + ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS))))) +#else +#define __Pyx_PyFastCFunction_Check(func) 0 +#endif +#if CYTHON_USE_DICT_VERSIONS +#define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) +#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ + (version_var) = __PYX_GET_DICT_VERSION(dict);\ + (cache_var) = (value); +#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ + static PY_UINT64_T __pyx_dict_version = 0;\ + static PyObject *__pyx_dict_cached_value = NULL;\ + if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ + (VAR) = __pyx_dict_cached_value;\ + } else {\ + (VAR) = __pyx_dict_cached_value = (LOOKUP);\ + __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ + }\ + } +#else +#define __PYX_GET_DICT_VERSION(dict) (0) +#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) +#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) + #define PyObject_Malloc(s) PyMem_Malloc(s) + #define PyObject_Free(p) PyMem_Free(p) + #define PyObject_Realloc(p) PyMem_Realloc(p) +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1 + #define PyMem_RawMalloc(n) PyMem_Malloc(n) + #define PyMem_RawRealloc(p, n) PyMem_Realloc(p, n) + #define PyMem_RawFree(p) PyMem_Free(p) +#endif +#if CYTHON_COMPILING_IN_PYSTON + #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co) + #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno) +#else + #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) + #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) +#endif +#if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000 + #define __Pyx_PyThreadState_Current PyThreadState_GET() +#elif PY_VERSION_HEX >= 0x03060000 + #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() +#elif PY_VERSION_HEX >= 0x03000000 + #define __Pyx_PyThreadState_Current PyThreadState_GET() +#else + #define __Pyx_PyThreadState_Current _PyThreadState_Current +#endif +#if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) +#include "pythread.h" +#define Py_tss_NEEDS_INIT 0 +typedef int Py_tss_t; +static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) { + *key = PyThread_create_key(); + return 0; // PyThread_create_key reports success always +} +static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) { + Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t)); + *key = Py_tss_NEEDS_INIT; + return key; +} +static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) { + PyObject_Free(key); +} +static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) { + return *key != Py_tss_NEEDS_INIT; +} +static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) { + PyThread_delete_key(*key); + *key = Py_tss_NEEDS_INIT; +} +static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) { + return PyThread_set_key_value(*key, value); +} +static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { + return PyThread_get_key_value(*key); +} +#endif // TSS (Thread Specific Storage) API +#if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized) +#define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) +#else +#define __Pyx_PyDict_NewPresized(n) PyDict_New() +#endif +#if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION + #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) +#else + #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS +#define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) +#else +#define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name) +#endif +#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) + #define CYTHON_PEP393_ENABLED 1 + #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ + 0 : _PyUnicode_Ready((PyObject *)(op))) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) + #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) + #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) + #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) + #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) + #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch) + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) +#else + #define CYTHON_PEP393_ENABLED 0 + #define PyUnicode_1BYTE_KIND 1 + #define PyUnicode_2BYTE_KIND 2 + #define PyUnicode_4BYTE_KIND 4 + #define __Pyx_PyUnicode_READY(op) (0) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) + #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111) + #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) + #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) + #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) + #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch) + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) +#endif +#if CYTHON_COMPILING_IN_PYPY + #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) +#else + #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ + PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains) + #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check) + #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format) + #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) +#endif +#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) +#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) +#else + #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) +#endif +#if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) + #define PyObject_ASCII(o) PyObject_Repr(o) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBaseString_Type PyUnicode_Type + #define PyStringObject PyUnicodeObject + #define PyString_Type PyUnicode_Type + #define PyString_Check PyUnicode_Check + #define PyString_CheckExact PyUnicode_CheckExact + #define PyObject_Unicode PyObject_Str +#endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) + #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) +#else + #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) + #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) +#endif +#ifndef PySet_CheckExact + #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) +#endif +#if CYTHON_ASSUME_SAFE_MACROS + #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) +#else + #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyIntObject PyLongObject + #define PyInt_Type PyLong_Type + #define PyInt_Check(op) PyLong_Check(op) + #define PyInt_CheckExact(op) PyLong_CheckExact(op) + #define PyInt_FromString PyLong_FromString + #define PyInt_FromUnicode PyLong_FromUnicode + #define PyInt_FromLong PyLong_FromLong + #define PyInt_FromSize_t PyLong_FromSize_t + #define PyInt_FromSsize_t PyLong_FromSsize_t + #define PyInt_AsLong PyLong_AsLong + #define PyInt_AS_LONG PyLong_AS_LONG + #define PyInt_AsSsize_t PyLong_AsSsize_t + #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask + #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask + #define PyNumber_Int PyNumber_Long +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBoolObject PyLongObject +#endif +#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY + #ifndef PyUnicode_InternFromString + #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) + #endif +#endif +#if PY_VERSION_HEX < 0x030200A4 + typedef long Py_hash_t; + #define __Pyx_PyInt_FromHash_t PyInt_FromLong + #define __Pyx_PyInt_AsHash_t PyInt_AsLong +#else + #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t + #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t +#endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : (Py_INCREF(func), func)) +#else + #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) +#endif +#if CYTHON_USE_ASYNC_SLOTS + #if PY_VERSION_HEX >= 0x030500B1 + #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods + #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) + #else + #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) + #endif +#else + #define __Pyx_PyType_AsAsync(obj) NULL +#endif +#ifndef __Pyx_PyAsyncMethodsStruct + typedef struct { + unaryfunc am_await; + unaryfunc am_aiter; + unaryfunc am_anext; + } __Pyx_PyAsyncMethodsStruct; +#endif + +#if defined(WIN32) || defined(MS_WINDOWS) + #define _USE_MATH_DEFINES +#endif +#include +#ifdef NAN +#define __PYX_NAN() ((float) NAN) +#else +static CYTHON_INLINE float __PYX_NAN() { + float value; + memset(&value, 0xFF, sizeof(value)); + return value; +} +#endif +#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) +#define __Pyx_truncl trunc +#else +#define __Pyx_truncl truncl +#endif + + +#define __PYX_ERR(f_index, lineno, Ln_error) \ +{ \ + __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \ +} + +#ifndef __PYX_EXTERN_C + #ifdef __cplusplus + #define __PYX_EXTERN_C extern "C" + #else + #define __PYX_EXTERN_C extern + #endif +#endif + +#define __PYX_HAVE__gevent____hub_primitives +#define __PYX_HAVE_API__gevent____hub_primitives +/* Early includes */ +#include "greenlet/greenlet.h" +#ifdef _OPENMP +#include +#endif /* _OPENMP */ + +#if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) +#define CYTHON_WITHOUT_ASSERTIONS +#endif + +typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; + const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; + +#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 +#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0 +#define __PYX_DEFAULT_STRING_ENCODING "" +#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString +#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#define __Pyx_uchar_cast(c) ((unsigned char)c) +#define __Pyx_long_cast(x) ((long)x) +#define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ + (sizeof(type) < sizeof(Py_ssize_t)) ||\ + (sizeof(type) > sizeof(Py_ssize_t) &&\ + likely(v < (type)PY_SSIZE_T_MAX ||\ + v == (type)PY_SSIZE_T_MAX) &&\ + (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ + v == (type)PY_SSIZE_T_MIN))) ||\ + (sizeof(type) == sizeof(Py_ssize_t) &&\ + (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ + v == (type)PY_SSIZE_T_MAX))) ) +static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) { + return (size_t) i < (size_t) limit; +} +#if defined (__cplusplus) && __cplusplus >= 201103L + #include + #define __Pyx_sst_abs(value) std::abs(value) +#elif SIZEOF_INT >= SIZEOF_SIZE_T + #define __Pyx_sst_abs(value) abs(value) +#elif SIZEOF_LONG >= SIZEOF_SIZE_T + #define __Pyx_sst_abs(value) labs(value) +#elif defined (_MSC_VER) + #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) +#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define __Pyx_sst_abs(value) llabs(value) +#elif defined (__GNUC__) + #define __Pyx_sst_abs(value) __builtin_llabs(value) +#else + #define __Pyx_sst_abs(value) ((value<0) ? -value : value) +#endif +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*); +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); +#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) +#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) +#define __Pyx_PyBytes_FromString PyBytes_FromString +#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); +#if PY_MAJOR_VERSION < 3 + #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#else + #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize +#endif +#define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) +#define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) +#define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) +#define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) +#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) +static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) { + const Py_UNICODE *u_end = u; + while (*u_end++) ; + return (size_t)(u_end - u - 1); +} +#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) +#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode +#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode +#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) +#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) +static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); +static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*); +static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); +#define __Pyx_PySequence_Tuple(obj)\ + (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); +#if CYTHON_ASSUME_SAFE_MACROS +#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) +#else +#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) +#endif +#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) +#if PY_MAJOR_VERSION >= 3 +#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) +#else +#define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) +#endif +#define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x)) +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII +static int __Pyx_sys_getdefaultencoding_not_ascii; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + PyObject* ascii_chars_u = NULL; + PyObject* ascii_chars_b = NULL; + const char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + if (strcmp(default_encoding_c, "ascii") == 0) { + __Pyx_sys_getdefaultencoding_not_ascii = 0; + } else { + char ascii_chars[128]; + int c; + for (c = 0; c < 128; c++) { + ascii_chars[c] = c; + } + __Pyx_sys_getdefaultencoding_not_ascii = 1; + ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); + if (!ascii_chars_u) goto bad; + ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); + if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { + PyErr_Format( + PyExc_ValueError, + "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", + default_encoding_c); + goto bad; + } + Py_DECREF(ascii_chars_u); + Py_DECREF(ascii_chars_b); + } + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + Py_XDECREF(ascii_chars_u); + Py_XDECREF(ascii_chars_b); + return -1; +} +#endif +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) +#else +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +static char* __PYX_DEFAULT_STRING_ENCODING; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1); + if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; + strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + return -1; +} +#endif +#endif + + +/* Test for GCC > 2.95 */ +#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) + #define likely(x) __builtin_expect(!!(x), 1) + #define unlikely(x) __builtin_expect(!!(x), 0) +#else /* !__GNUC__ or GCC < 2.95 */ + #define likely(x) (x) + #define unlikely(x) (x) +#endif /* __GNUC__ */ +static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } + +static PyObject *__pyx_m = NULL; +static PyObject *__pyx_d; +static PyObject *__pyx_b; +static PyObject *__pyx_cython_runtime = NULL; +static PyObject *__pyx_empty_tuple; +static PyObject *__pyx_empty_bytes; +static PyObject *__pyx_empty_unicode; +static int __pyx_lineno; +static int __pyx_clineno = 0; +static const char * __pyx_cfilenm= __FILE__; +static const char *__pyx_filename; + + +static const char *__pyx_f[] = { + "src\\gevent\\_hub_primitives.py", + "src\\gevent\\__greenlet_primitives.pxd", + "src\\gevent\\__waiter.pxd", + "src\\gevent\\__hub_primitives.pxd", +}; + +/*--- Type declarations ---*/ +struct __pyx_obj_6gevent_21__greenlet_primitives_TrackedRawGreenlet; +struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop; +struct __pyx_obj_6gevent_8__waiter_Waiter; +struct __pyx_obj_6gevent_8__waiter_MultipleWaiter; +struct __pyx_obj_6gevent_16__hub_primitives_WaitOperationsGreenlet; +struct __pyx_obj_6gevent_16__hub_primitives__WaitIterator; +struct __pyx_opt_args_6gevent_16__hub_primitives_22WaitOperationsGreenlet_cancel_wait; +struct __pyx_opt_args_6gevent_16__hub_primitives_iwait_on_objects; +struct __pyx_opt_args_6gevent_16__hub_primitives_wait_on_objects; +struct __pyx_opt_args_6gevent_16__hub_primitives_wait_on_watcher; +struct __pyx_opt_args_6gevent_16__hub_primitives_wait_read; +struct __pyx_opt_args_6gevent_16__hub_primitives_wait_write; +struct __pyx_opt_args_6gevent_16__hub_primitives_wait_readwrite; +struct __pyx_opt_args_6gevent_16__hub_primitives_wait_on_socket; + +/* "gevent/__hub_primitives.pxd":44 + * + * cpdef wait(self, watcher) + * cpdef cancel_wait(self, watcher, error, close_watcher=*) # <<<<<<<<<<<<<< + * cpdef _cancel_wait(self, watcher, error, close_watcher) + * + */ +struct __pyx_opt_args_6gevent_16__hub_primitives_22WaitOperationsGreenlet_cancel_wait { + int __pyx_n; + PyObject *close_watcher; +}; + +/* "gevent/__hub_primitives.pxd":65 + * + * + * cpdef iwait_on_objects(objects, timeout=*, count=*) # <<<<<<<<<<<<<< + * cpdef wait_on_objects(objects=*, timeout=*, count=*) + * + */ +struct __pyx_opt_args_6gevent_16__hub_primitives_iwait_on_objects { + int __pyx_n; + PyObject *timeout; + PyObject *count; +}; + +/* "gevent/__hub_primitives.pxd":66 + * + * cpdef iwait_on_objects(objects, timeout=*, count=*) + * cpdef wait_on_objects(objects=*, timeout=*, count=*) # <<<<<<<<<<<<<< + * + * cdef _primitive_wait(watcher, timeout, timeout_exc, WaitOperationsGreenlet hub) + */ +struct __pyx_opt_args_6gevent_16__hub_primitives_wait_on_objects { + int __pyx_n; + PyObject *objects; + PyObject *timeout; + PyObject *count; +}; + +/* "gevent/__hub_primitives.pxd":69 + * + * cdef _primitive_wait(watcher, timeout, timeout_exc, WaitOperationsGreenlet hub) + * cpdef wait_on_watcher(watcher, timeout=*, timeout_exc=*, WaitOperationsGreenlet hub=*) # <<<<<<<<<<<<<< + * cpdef wait_read(fileno, timeout=*, timeout_exc=*) + * cpdef wait_write(fileno, timeout=*, timeout_exc=*, event=*) + */ +struct __pyx_opt_args_6gevent_16__hub_primitives_wait_on_watcher { + int __pyx_n; + PyObject *timeout; + PyObject *timeout_exc; + struct __pyx_obj_6gevent_16__hub_primitives_WaitOperationsGreenlet *hub; +}; + +/* "gevent/__hub_primitives.pxd":70 + * cdef _primitive_wait(watcher, timeout, timeout_exc, WaitOperationsGreenlet hub) + * cpdef wait_on_watcher(watcher, timeout=*, timeout_exc=*, WaitOperationsGreenlet hub=*) + * cpdef wait_read(fileno, timeout=*, timeout_exc=*) # <<<<<<<<<<<<<< + * cpdef wait_write(fileno, timeout=*, timeout_exc=*, event=*) + * cpdef wait_readwrite(fileno, timeout=*, timeout_exc=*, event=*) + */ +struct __pyx_opt_args_6gevent_16__hub_primitives_wait_read { + int __pyx_n; + PyObject *timeout; + PyObject *timeout_exc; +}; + +/* "gevent/__hub_primitives.pxd":71 + * cpdef wait_on_watcher(watcher, timeout=*, timeout_exc=*, WaitOperationsGreenlet hub=*) + * cpdef wait_read(fileno, timeout=*, timeout_exc=*) + * cpdef wait_write(fileno, timeout=*, timeout_exc=*, event=*) # <<<<<<<<<<<<<< + * cpdef wait_readwrite(fileno, timeout=*, timeout_exc=*, event=*) + * cpdef wait_on_socket(socket, watcher, timeout_exc=*) + */ +struct __pyx_opt_args_6gevent_16__hub_primitives_wait_write { + int __pyx_n; + PyObject *timeout; + PyObject *timeout_exc; + PyObject *event; +}; + +/* "gevent/__hub_primitives.pxd":72 + * cpdef wait_read(fileno, timeout=*, timeout_exc=*) + * cpdef wait_write(fileno, timeout=*, timeout_exc=*, event=*) + * cpdef wait_readwrite(fileno, timeout=*, timeout_exc=*, event=*) # <<<<<<<<<<<<<< + * cpdef wait_on_socket(socket, watcher, timeout_exc=*) + */ +struct __pyx_opt_args_6gevent_16__hub_primitives_wait_readwrite { + int __pyx_n; + PyObject *timeout; + PyObject *timeout_exc; + PyObject *event; +}; + +/* "gevent/__hub_primitives.pxd":73 + * cpdef wait_write(fileno, timeout=*, timeout_exc=*, event=*) + * cpdef wait_readwrite(fileno, timeout=*, timeout_exc=*, event=*) + * cpdef wait_on_socket(socket, watcher, timeout_exc=*) # <<<<<<<<<<<<<< + */ +struct __pyx_opt_args_6gevent_16__hub_primitives_wait_on_socket { + int __pyx_n; + PyObject *timeout_exc; +}; + +/* "gevent/__greenlet_primitives.pxd":37 + * return PyGreenlet_Switch(self, NULL, NULL) + * + * cdef class TrackedRawGreenlet(greenlet): # <<<<<<<<<<<<<< + * pass + * + */ +struct __pyx_obj_6gevent_21__greenlet_primitives_TrackedRawGreenlet { + PyGreenlet __pyx_base; +}; + + +/* "gevent/__greenlet_primitives.pxd":40 + * pass + * + * cdef class SwitchOutGreenletWithLoop(TrackedRawGreenlet): # <<<<<<<<<<<<<< + * cdef public loop + * + */ +struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop { + struct __pyx_obj_6gevent_21__greenlet_primitives_TrackedRawGreenlet __pyx_base; + struct __pyx_vtabstruct_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *__pyx_vtab; + PyObject *loop; +}; + + +/* "gevent/__waiter.pxd":33 + * _greenlet_imported = True + * + * cdef class Waiter: # <<<<<<<<<<<<<< + * cdef readonly SwitchOutGreenletWithLoop hub + * cdef readonly greenlet greenlet + */ +struct __pyx_obj_6gevent_8__waiter_Waiter { + PyObject_HEAD + struct __pyx_vtabstruct_6gevent_8__waiter_Waiter *__pyx_vtab; + struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *hub; + PyGreenlet *greenlet; + PyObject *value; + PyObject *_exception; +}; + + +/* "gevent/__waiter.pxd":47 + * @cython.final + * @cython.internal + * cdef class MultipleWaiter(Waiter): # <<<<<<<<<<<<<< + * cdef list _values + */ +struct __pyx_obj_6gevent_8__waiter_MultipleWaiter { + struct __pyx_obj_6gevent_8__waiter_Waiter __pyx_base; + PyObject *_values; +}; + + +/* "gevent/__hub_primitives.pxd":41 + * + * + * cdef class WaitOperationsGreenlet(SwitchOutGreenletWithLoop): # <<<<<<<<<<<<<< + * + * cpdef wait(self, watcher) + */ +struct __pyx_obj_6gevent_16__hub_primitives_WaitOperationsGreenlet { + struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop __pyx_base; +}; + + +/* "gevent/__hub_primitives.pxd":47 + * cpdef _cancel_wait(self, watcher, error, close_watcher) + * + * cdef class _WaitIterator: # <<<<<<<<<<<<<< + * cdef SwitchOutGreenletWithLoop _hub + * cdef MultipleWaiter _waiter + */ +struct __pyx_obj_6gevent_16__hub_primitives__WaitIterator { + PyObject_HEAD + struct __pyx_vtabstruct_6gevent_16__hub_primitives__WaitIterator *__pyx_vtab; + struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *_hub; + struct __pyx_obj_6gevent_8__waiter_MultipleWaiter *_waiter; + PyObject *_switch; + PyObject *_timeout; + PyObject *_objects; + PyObject *_timer; + Py_ssize_t _count; + int _begun; +}; + + + +/* "gevent/__greenlet_primitives.pxd":40 + * pass + * + * cdef class SwitchOutGreenletWithLoop(TrackedRawGreenlet): # <<<<<<<<<<<<<< + * cdef public loop + * + */ + +struct __pyx_vtabstruct_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop { + PyObject *(*__pyx_switch)(struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *, int __pyx_skip_dispatch); + PyObject *(*switch_out)(struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *, int __pyx_skip_dispatch); +}; +static struct __pyx_vtabstruct_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *__pyx_vtabptr_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop; + + +/* "gevent/__waiter.pxd":33 + * _greenlet_imported = True + * + * cdef class Waiter: # <<<<<<<<<<<<<< + * cdef readonly SwitchOutGreenletWithLoop hub + * cdef readonly greenlet greenlet + */ + +struct __pyx_vtabstruct_6gevent_8__waiter_Waiter { + PyObject *(*get)(struct __pyx_obj_6gevent_8__waiter_Waiter *, int __pyx_skip_dispatch); + PyObject *(*clear)(struct __pyx_obj_6gevent_8__waiter_Waiter *, int __pyx_skip_dispatch); +}; +static struct __pyx_vtabstruct_6gevent_8__waiter_Waiter *__pyx_vtabptr_6gevent_8__waiter_Waiter; + + +/* "gevent/__waiter.pxd":47 + * @cython.final + * @cython.internal + * cdef class MultipleWaiter(Waiter): # <<<<<<<<<<<<<< + * cdef list _values + */ + +struct __pyx_vtabstruct_6gevent_8__waiter_MultipleWaiter { + struct __pyx_vtabstruct_6gevent_8__waiter_Waiter __pyx_base; +}; +static struct __pyx_vtabstruct_6gevent_8__waiter_MultipleWaiter *__pyx_vtabptr_6gevent_8__waiter_MultipleWaiter; + + +/* "src/gevent/_hub_primitives.py":44 + * ] + * + * class WaitOperationsGreenlet(SwitchOutGreenletWithLoop): # pylint:disable=undefined-variable # <<<<<<<<<<<<<< + * + * def wait(self, watcher): + */ + +struct __pyx_vtabstruct_6gevent_16__hub_primitives_WaitOperationsGreenlet { + struct __pyx_vtabstruct_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop __pyx_base; + PyObject *(*wait)(struct __pyx_obj_6gevent_16__hub_primitives_WaitOperationsGreenlet *, PyObject *, int __pyx_skip_dispatch); + PyObject *(*cancel_wait)(struct __pyx_obj_6gevent_16__hub_primitives_WaitOperationsGreenlet *, PyObject *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_16__hub_primitives_22WaitOperationsGreenlet_cancel_wait *__pyx_optional_args); + PyObject *(*_cancel_wait)(struct __pyx_obj_6gevent_16__hub_primitives_WaitOperationsGreenlet *, PyObject *, PyObject *, PyObject *, int __pyx_skip_dispatch); +}; +static struct __pyx_vtabstruct_6gevent_16__hub_primitives_WaitOperationsGreenlet *__pyx_vtabptr_6gevent_16__hub_primitives_WaitOperationsGreenlet; + + +/* "src/gevent/_hub_primitives.py":98 + * + * + * class _WaitIterator(object): # <<<<<<<<<<<<<< + * + * def __init__(self, objects, hub, timeout, count): + */ + +struct __pyx_vtabstruct_6gevent_16__hub_primitives__WaitIterator { + PyObject *(*_begin)(struct __pyx_obj_6gevent_16__hub_primitives__WaitIterator *); + PyObject *(*_cleanup)(struct __pyx_obj_6gevent_16__hub_primitives__WaitIterator *); + PyObject *(*__pyx___enter__)(struct __pyx_obj_6gevent_16__hub_primitives__WaitIterator *, int __pyx_skip_dispatch); + PyObject *(*__pyx___exit__)(struct __pyx_obj_6gevent_16__hub_primitives__WaitIterator *, PyObject *, PyObject *, PyObject *, int __pyx_skip_dispatch); +}; +static struct __pyx_vtabstruct_6gevent_16__hub_primitives__WaitIterator *__pyx_vtabptr_6gevent_16__hub_primitives__WaitIterator; + +/* --- Runtime support code (head) --- */ +/* Refnanny.proto */ +#ifndef CYTHON_REFNANNY + #define CYTHON_REFNANNY 0 +#endif +#if CYTHON_REFNANNY + typedef struct { + void (*INCREF)(void*, PyObject*, int); + void (*DECREF)(void*, PyObject*, int); + void (*GOTREF)(void*, PyObject*, int); + void (*GIVEREF)(void*, PyObject*, int); + void* (*SetupContext)(const char*, int, const char*); + void (*FinishContext)(void**); + } __Pyx_RefNannyAPIStruct; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); + #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; +#ifdef WITH_THREAD + #define __Pyx_RefNannySetupContext(name, acquire_gil)\ + if (acquire_gil) {\ + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ + PyGILState_Release(__pyx_gilstate_save);\ + } else {\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ + } +#else + #define __Pyx_RefNannySetupContext(name, acquire_gil)\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) +#endif + #define __Pyx_RefNannyFinishContext()\ + __Pyx_RefNanny->FinishContext(&__pyx_refnanny) + #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0) + #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) + #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) + #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) +#else + #define __Pyx_RefNannyDeclarations + #define __Pyx_RefNannySetupContext(name, acquire_gil) + #define __Pyx_RefNannyFinishContext() + #define __Pyx_INCREF(r) Py_INCREF(r) + #define __Pyx_DECREF(r) Py_DECREF(r) + #define __Pyx_GOTREF(r) + #define __Pyx_GIVEREF(r) + #define __Pyx_XINCREF(r) Py_XINCREF(r) + #define __Pyx_XDECREF(r) Py_XDECREF(r) + #define __Pyx_XGOTREF(r) + #define __Pyx_XGIVEREF(r) +#endif +#define __Pyx_XDECREF_SET(r, v) do {\ + PyObject *tmp = (PyObject *) r;\ + r = v; __Pyx_XDECREF(tmp);\ + } while (0) +#define __Pyx_DECREF_SET(r, v) do {\ + PyObject *tmp = (PyObject *) r;\ + r = v; __Pyx_DECREF(tmp);\ + } while (0) +#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) +#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) + +/* PyObjectGetAttrStr.proto */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); +#else +#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) +#endif + +/* GetBuiltinName.proto */ +static PyObject *__Pyx_GetBuiltinName(PyObject *name); + +/* PyCFunctionFastCall.proto */ +#if CYTHON_FAST_PYCCALL +static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs); +#else +#define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL) +#endif + +/* PyFunctionFastCall.proto */ +#if CYTHON_FAST_PYCALL +#define __Pyx_PyFunction_FastCall(func, args, nargs)\ + __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) +#if 1 || PY_VERSION_HEX < 0x030600B1 +static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs); +#else +#define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs) +#endif +#define __Pyx_BUILD_ASSERT_EXPR(cond)\ + (sizeof(char [1 - 2*!(cond)]) - 1) +#ifndef Py_MEMBER_SIZE +#define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member) +#endif + static size_t __pyx_pyframe_localsplus_offset = 0; + #include "frameobject.h" + #define __Pxy_PyFrame_Initialize_Offsets()\ + ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\ + (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus))) + #define __Pyx_PyFrame_GetLocalsplus(frame)\ + (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset)) +#endif + +/* PyObjectCall.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); +#else +#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) +#endif + +/* PyObjectCall2Args.proto */ +static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2); + +/* PyObjectCallMethO.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); +#endif + +/* PyObjectCallOneArg.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); + +/* PyThreadStateGet.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; +#define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; +#define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type +#else +#define __Pyx_PyThreadState_declare +#define __Pyx_PyThreadState_assign +#define __Pyx_PyErr_Occurred() PyErr_Occurred() +#endif + +/* PyErrFetchRestore.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) +#define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) +#define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) +#define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) +#define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); +static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) +#else +#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) +#endif +#else +#define __Pyx_PyErr_Clear() PyErr_Clear() +#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) +#define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) +#define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb) +#define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) +#endif + +/* RaiseException.proto */ +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); + +/* PyObjectCallNoArg.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); +#else +#define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL) +#endif + +/* GetException.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb) +static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#else +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); +#endif + +/* SwapException.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#else +static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb); +#endif + +/* GetTopmostException.proto */ +#if CYTHON_USE_EXC_INFO_STACK +static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate); +#endif + +/* SaveResetException.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); +#else +#define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb) +#define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb) +#endif + +/* RaiseArgTupleInvalid.proto */ +static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, + Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); + +/* RaiseDoubleKeywords.proto */ +static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); + +/* ParseKeywords.proto */ +static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\ + PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\ + const char* function_name); + +/* PyErrExceptionMatches.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) +static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); +#else +#define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) +#endif + +/* GetAttr.proto */ +static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *); + +/* GetAttr3.proto */ +static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *); + +/* ExtTypeTest.proto */ +static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); + +/* GetModuleGlobalName.proto */ +#if CYTHON_USE_DICT_VERSIONS +#define __Pyx_GetModuleGlobalName(var, name) {\ + static PY_UINT64_T __pyx_dict_version = 0;\ + static PyObject *__pyx_dict_cached_value = NULL;\ + (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\ + (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\ + __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ +} +#define __Pyx_GetModuleGlobalNameUncached(var, name) {\ + PY_UINT64_T __pyx_dict_version;\ + PyObject *__pyx_dict_cached_value;\ + (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ +} +static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value); +#else +#define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name) +#define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name) +static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name); +#endif + +/* PyObjectLookupSpecial.proto */ +#if CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject* __Pyx_PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name) { + PyObject *res; + PyTypeObject *tp = Py_TYPE(obj); +#if PY_MAJOR_VERSION < 3 + if (unlikely(PyInstance_Check(obj))) + return __Pyx_PyObject_GetAttrStr(obj, attr_name); +#endif + res = _PyType_Lookup(tp, attr_name); + if (likely(res)) { + descrgetfunc f = Py_TYPE(res)->tp_descr_get; + if (!f) { + Py_INCREF(res); + } else { + res = f(res, obj, (PyObject *)tp); + } + } else { + PyErr_SetObject(PyExc_AttributeError, attr_name); + } + return res; +} +#else +#define __Pyx_PyObject_LookupSpecial(o,n) __Pyx_PyObject_GetAttrStr(o,n) +#endif + +/* ArgTypeTest.proto */ +#define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\ + ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\ + __Pyx__ArgTypeTest(obj, type, name, exact)) +static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact); + +/* CallNextTpDealloc.proto */ +static void __Pyx_call_next_tp_dealloc(PyObject* obj, destructor current_tp_dealloc); + +/* CallNextTpTraverse.proto */ +static int __Pyx_call_next_tp_traverse(PyObject* obj, visitproc v, void *a, traverseproc current_tp_traverse); + +/* CallNextTpClear.proto */ +static void __Pyx_call_next_tp_clear(PyObject* obj, inquiry current_tp_dealloc); + +/* TypeImport.proto */ +#ifndef __PYX_HAVE_RT_ImportType_proto +#define __PYX_HAVE_RT_ImportType_proto +enum __Pyx_ImportType_CheckSize { + __Pyx_ImportType_CheckSize_Error = 0, + __Pyx_ImportType_CheckSize_Warn = 1, + __Pyx_ImportType_CheckSize_Ignore = 2 +}; +static PyTypeObject *__Pyx_ImportType(PyObject* module, const char *module_name, const char *class_name, size_t size, enum __Pyx_ImportType_CheckSize check_size); +#endif + +/* GetVTable.proto */ +static void* __Pyx_GetVtable(PyObject *dict); + +/* PyObject_GenericGetAttrNoDict.proto */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name); +#else +#define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr +#endif + +/* PyObject_GenericGetAttr.proto */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name); +#else +#define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr +#endif + +/* SetVTable.proto */ +static int __Pyx_SetVtable(PyObject *dict, void *vtable); + +/* Import.proto */ +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); + +/* ImportFrom.proto */ +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); + +/* FetchCommonType.proto */ +static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); + +/* CythonFunction.proto */ +#define __Pyx_CyFunction_USED 1 +#define __Pyx_CYFUNCTION_STATICMETHOD 0x01 +#define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 +#define __Pyx_CYFUNCTION_CCLASS 0x04 +#define __Pyx_CyFunction_GetClosure(f)\ + (((__pyx_CyFunctionObject *) (f))->func_closure) +#define __Pyx_CyFunction_GetClassObj(f)\ + (((__pyx_CyFunctionObject *) (f))->func_classobj) +#define __Pyx_CyFunction_Defaults(type, f)\ + ((type *)(((__pyx_CyFunctionObject *) (f))->defaults)) +#define __Pyx_CyFunction_SetDefaultsGetter(f, g)\ + ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g) +typedef struct { + PyCFunctionObject func; +#if PY_VERSION_HEX < 0x030500A0 + PyObject *func_weakreflist; +#endif + PyObject *func_dict; + PyObject *func_name; + PyObject *func_qualname; + PyObject *func_doc; + PyObject *func_globals; + PyObject *func_code; + PyObject *func_closure; + PyObject *func_classobj; + void *defaults; + int defaults_pyobjects; + int flags; + PyObject *defaults_tuple; + PyObject *defaults_kwdict; + PyObject *(*defaults_getter)(PyObject *); + PyObject *func_annotations; +} __pyx_CyFunctionObject; +static PyTypeObject *__pyx_CyFunctionType = 0; +#define __Pyx_CyFunction_Check(obj) (__Pyx_TypeCheck(obj, __pyx_CyFunctionType)) +#define __Pyx_CyFunction_NewEx(ml, flags, qualname, self, module, globals, code)\ + __Pyx_CyFunction_New(__pyx_CyFunctionType, ml, flags, qualname, self, module, globals, code) +static PyObject *__Pyx_CyFunction_New(PyTypeObject *, PyMethodDef *ml, + int flags, PyObject* qualname, + PyObject *self, + PyObject *module, PyObject *globals, + PyObject* code); +static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, + size_t size, + int pyobjects); +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, + PyObject *tuple); +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, + PyObject *dict); +static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m, + PyObject *dict); +static int __pyx_CyFunction_init(void); + +/* GetNameInClass.proto */ +#define __Pyx_GetNameInClass(var, nmspace, name) (var) = __Pyx__GetNameInClass(nmspace, name) +static PyObject *__Pyx__GetNameInClass(PyObject *nmspace, PyObject *name); + +/* Globals.proto */ +static PyObject* __Pyx_Globals(void); + +/* CLineInTraceback.proto */ +#ifdef CYTHON_CLINE_IN_TRACEBACK +#define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) +#else +static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line); +#endif + +/* CodeObjectCache.proto */ +typedef struct { + PyCodeObject* code_object; + int code_line; +} __Pyx_CodeObjectCacheEntry; +struct __Pyx_CodeObjectCache { + int count; + int max_count; + __Pyx_CodeObjectCacheEntry* entries; +}; +static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); +static PyCodeObject *__pyx_find_code_object(int code_line); +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); + +/* AddTraceback.proto */ +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename); + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); + +/* CIntFromPy.proto */ +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); + +/* CIntFromPy.proto */ +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); + +/* FastTypeChecks.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) +static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b); +static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type); +static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2); +#else +#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) +#define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) +#define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) +#endif +#define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) + +/* CheckBinaryVersion.proto */ +static int __Pyx_check_binary_version(void); + +/* PyObjectSetAttrStr.proto */ +#if CYTHON_USE_TYPE_SLOTS +#define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o, n, NULL) +static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value); +#else +#define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n) +#define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v) +#endif + +/* VoidPtrExport.proto */ +static int __Pyx_ExportVoidPtr(PyObject *name, void *p, const char *sig); + +/* FunctionExport.proto */ +static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig); + +/* VoidPtrImport.proto */ +static int __Pyx_ImportVoidPtr(PyObject *module, const char *name, void **p, const char *sig); + +/* FunctionImport.proto */ +static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig); + +/* InitStrings.proto */ +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); + +static PyObject *__pyx_f_6gevent_16__hub_primitives_22WaitOperationsGreenlet_wait(struct __pyx_obj_6gevent_16__hub_primitives_WaitOperationsGreenlet *__pyx_v_self, PyObject *__pyx_v_watcher, int __pyx_skip_dispatch); /* proto*/ +static PyObject *__pyx_f_6gevent_16__hub_primitives_22WaitOperationsGreenlet_cancel_wait(struct __pyx_obj_6gevent_16__hub_primitives_WaitOperationsGreenlet *__pyx_v_self, PyObject *__pyx_v_watcher, PyObject *__pyx_v_error, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_16__hub_primitives_22WaitOperationsGreenlet_cancel_wait *__pyx_optional_args); /* proto*/ +static PyObject *__pyx_f_6gevent_16__hub_primitives_22WaitOperationsGreenlet__cancel_wait(CYTHON_UNUSED struct __pyx_obj_6gevent_16__hub_primitives_WaitOperationsGreenlet *__pyx_v_self, PyObject *__pyx_v_watcher, PyObject *__pyx_v_error, PyObject *__pyx_v_close_watcher, int __pyx_skip_dispatch); /* proto*/ +static PyObject *__pyx_f_6gevent_16__hub_primitives_13_WaitIterator__begin(struct __pyx_obj_6gevent_16__hub_primitives__WaitIterator *__pyx_v_self); /* proto*/ +static PyObject *__pyx_f_6gevent_16__hub_primitives_13_WaitIterator__cleanup(struct __pyx_obj_6gevent_16__hub_primitives__WaitIterator *__pyx_v_self); /* proto*/ +static PyObject *__pyx_f_6gevent_16__hub_primitives_13_WaitIterator___enter__(struct __pyx_obj_6gevent_16__hub_primitives__WaitIterator *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/ +static PyObject *__pyx_f_6gevent_16__hub_primitives_13_WaitIterator___exit__(struct __pyx_obj_6gevent_16__hub_primitives__WaitIterator *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_typ, CYTHON_UNUSED PyObject *__pyx_v_value, CYTHON_UNUSED PyObject *__pyx_v_tb, int __pyx_skip_dispatch); /* proto*/ + +/* Module declarations from 'cython' */ + +/* Module declarations from 'greenlet' */ + +/* Module declarations from 'gevent.__greenlet_primitives' */ +static PyTypeObject *__pyx_ptype_6gevent_21__greenlet_primitives_greenlet = 0; +static PyTypeObject *__pyx_ptype_6gevent_21__greenlet_primitives_TrackedRawGreenlet = 0; +static PyTypeObject *__pyx_ptype_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop = 0; +static PyObject **__pyx_vp_6gevent_21__greenlet_primitives_get_objects = 0; +#define __pyx_v_6gevent_21__greenlet_primitives_get_objects (*__pyx_vp_6gevent_21__greenlet_primitives_get_objects) +static PyObject **__pyx_vp_6gevent_21__greenlet_primitives_wref = 0; +#define __pyx_v_6gevent_21__greenlet_primitives_wref (*__pyx_vp_6gevent_21__greenlet_primitives_wref) +static PyObject **__pyx_vp_6gevent_21__greenlet_primitives_BlockingSwitchOutError = 0; +#define __pyx_v_6gevent_21__greenlet_primitives_BlockingSwitchOutError (*__pyx_vp_6gevent_21__greenlet_primitives_BlockingSwitchOutError) +static int *__pyx_vp_6gevent_21__greenlet_primitives__greenlet_imported = 0; +#define __pyx_v_6gevent_21__greenlet_primitives__greenlet_imported (*__pyx_vp_6gevent_21__greenlet_primitives__greenlet_imported) + +/* Module declarations from 'gevent.__hub_local' */ +static PyObject **__pyx_vp_6gevent_11__hub_local__threadlocal = 0; +#define __pyx_v_6gevent_11__hub_local__threadlocal (*__pyx_vp_6gevent_11__hub_local__threadlocal) +static struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *(*__pyx_f_6gevent_11__hub_local_get_hub_noargs)(int __pyx_skip_dispatch); /*proto*/ + +/* Module declarations from 'gevent.__waiter' */ +static PyTypeObject *__pyx_ptype_6gevent_8__waiter_greenlet = 0; +static PyTypeObject *__pyx_ptype_6gevent_8__waiter_Waiter = 0; +static PyTypeObject *__pyx_ptype_6gevent_8__waiter_MultipleWaiter = 0; +static PyObject **__pyx_vp_6gevent_8__waiter_sys = 0; +#define __pyx_v_6gevent_8__waiter_sys (*__pyx_vp_6gevent_8__waiter_sys) +static PyObject **__pyx_vp_6gevent_8__waiter_ConcurrentObjectUseError = 0; +#define __pyx_v_6gevent_8__waiter_ConcurrentObjectUseError (*__pyx_vp_6gevent_8__waiter_ConcurrentObjectUseError) +static int *__pyx_vp_6gevent_8__waiter__greenlet_imported = 0; +#define __pyx_v_6gevent_8__waiter__greenlet_imported (*__pyx_vp_6gevent_8__waiter__greenlet_imported) +static PyObject **__pyx_vp_6gevent_8__waiter__NONE = 0; +#define __pyx_v_6gevent_8__waiter__NONE (*__pyx_vp_6gevent_8__waiter__NONE) + +/* Module declarations from 'gevent.__hub_primitives' */ +static PyTypeObject *__pyx_ptype_6gevent_16__hub_primitives_greenlet = 0; +static PyTypeObject *__pyx_ptype_6gevent_16__hub_primitives_WaitOperationsGreenlet = 0; +static PyTypeObject *__pyx_ptype_6gevent_16__hub_primitives__WaitIterator = 0; +static PyObject *__pyx_v_6gevent_16__hub_primitives_InvalidSwitchError = 0; +static PyObject *__pyx_v_6gevent_16__hub_primitives__waiter = 0; +static PyObject *__pyx_v_6gevent_16__hub_primitives__greenlet_primitives = 0; +static PyObject *__pyx_v_6gevent_16__hub_primitives_traceback = 0; +static PyObject *__pyx_v_6gevent_16__hub_primitives__timeout_error = 0; +static PyObject *__pyx_v_6gevent_16__hub_primitives_Timeout = 0; +static int __pyx_v_6gevent_16__hub_primitives__greenlet_imported; +static CYTHON_INLINE PyGreenlet *__pyx_f_6gevent_16__hub_primitives_getcurrent(void); /*proto*/ +static CYTHON_INLINE void __pyx_f_6gevent_16__hub_primitives_greenlet_init(void); /*proto*/ +static PyObject *__pyx_f_6gevent_16__hub_primitives_iwait_on_objects(PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_16__hub_primitives_iwait_on_objects *__pyx_optional_args); /*proto*/ +static PyObject *__pyx_f_6gevent_16__hub_primitives_wait_on_objects(int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_16__hub_primitives_wait_on_objects *__pyx_optional_args); /*proto*/ +static PyObject *__pyx_f_6gevent_16__hub_primitives__primitive_wait(PyObject *, PyObject *, PyObject *, struct __pyx_obj_6gevent_16__hub_primitives_WaitOperationsGreenlet *); /*proto*/ +static PyObject *__pyx_f_6gevent_16__hub_primitives_wait_on_watcher(PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_16__hub_primitives_wait_on_watcher *__pyx_optional_args); /*proto*/ +static PyObject *__pyx_f_6gevent_16__hub_primitives_wait_read(PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_16__hub_primitives_wait_read *__pyx_optional_args); /*proto*/ +static PyObject *__pyx_f_6gevent_16__hub_primitives_wait_write(PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_16__hub_primitives_wait_write *__pyx_optional_args); /*proto*/ +static PyObject *__pyx_f_6gevent_16__hub_primitives_wait_readwrite(PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_16__hub_primitives_wait_readwrite *__pyx_optional_args); /*proto*/ +static PyObject *__pyx_f_6gevent_16__hub_primitives_wait_on_socket(PyObject *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_16__hub_primitives_wait_on_socket *__pyx_optional_args); /*proto*/ +#define __Pyx_MODULE_NAME "gevent.__hub_primitives" +extern int __pyx_module_is_main_gevent____hub_primitives; +int __pyx_module_is_main_gevent____hub_primitives = 0; + +/* Implementation of 'gevent.__hub_primitives' */ +static PyObject *__pyx_builtin___import__; +static PyObject *__pyx_builtin_StopIteration; +static const char __pyx_k_e[] = "e"; +static const char __pyx_k_io[] = "io"; +static const char __pyx_k_tb[] = "tb"; +static const char __pyx_k_all[] = "__all__"; +static const char __pyx_k_hub[] = "hub"; +static const char __pyx_k_typ[] = "typ"; +static const char __pyx_k_NONE[] = "_NONE"; +static const char __pyx_k_exit[] = "__exit__"; +static const char __pyx_k_init[] = "_init"; +static const char __pyx_k_join[] = "join"; +static const char __pyx_k_main[] = "__main__"; +static const char __pyx_k_name[] = "__name__"; +static const char __pyx_k_next[] = "__next__"; +static const char __pyx_k_self[] = "__self__"; +static const char __pyx_k_stop[] = "stop"; +static const char __pyx_k_test[] = "__test__"; +static const char __pyx_k_wait[] = "wait"; +static const char __pyx_k_close[] = "close"; +static const char __pyx_k_count[] = "count"; +static const char __pyx_k_enter[] = "__enter__"; +static const char __pyx_k_error[] = "error"; +static const char __pyx_k_event[] = "event"; +static const char __pyx_k_start[] = "start"; +static const char __pyx_k_throw[] = "throw"; +static const char __pyx_k_timer[] = "timer"; +static const char __pyx_k_value[] = "value"; +static const char __pyx_k_Waiter[] = "Waiter"; +static const char __pyx_k_active[] = "active"; +static const char __pyx_k_fileno[] = "fileno"; +static const char __pyx_k_gevent[] = "gevent"; +static const char __pyx_k_import[] = "__import__"; +static const char __pyx_k_lambda[] = ""; +static const char __pyx_k_next_2[] = "next"; +static const char __pyx_k_self_2[] = "self"; +static const char __pyx_k_socket[] = "socket"; +static const char __pyx_k_switch[] = "switch"; +static const char __pyx_k_unlink[] = "unlink"; +static const char __pyx_k_waiter[] = "_waiter"; +static const char __pyx_k_Timeout[] = "Timeout"; +static const char __pyx_k_objects[] = "objects"; +static const char __pyx_k_rawlink[] = "rawlink"; +static const char __pyx_k_timeout[] = "timeout"; +static const char __pyx_k_watcher[] = "watcher"; +static const char __pyx_k_callback[] = "callback"; +static const char __pyx_k_greenlet[] = "greenlet"; +static const char __pyx_k_priority[] = "priority"; +static const char __pyx_k_pyx_capi[] = "__pyx_capi__"; +static const char __pyx_k_print_exc[] = "print_exc"; +static const char __pyx_k_timed_out[] = "timed out"; +static const char __pyx_k_traceback[] = "traceback"; +static const char __pyx_k_wait_read[] = "wait_read"; +static const char __pyx_k_getcurrent[] = "getcurrent"; +static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__"; +static const char __pyx_k_wait_write[] = "wait_write"; +static const char __pyx_k_cancel_wait[] = "cancel_wait"; +static const char __pyx_k_timeout_exc[] = "timeout_exc"; +static const char __pyx_k_WaitIterator[] = "_WaitIterator"; +static const char __pyx_k_gevent__util[] = "gevent._util"; +static const char __pyx_k_run_callback[] = "run_callback"; +static const char __pyx_k_StopIteration[] = "StopIteration"; +static const char __pyx_k_cancel_wait_2[] = "_cancel_wait"; +static const char __pyx_k_close_watcher[] = "close_watcher"; +static const char __pyx_k_greenlet_init[] = "greenlet_init"; +static const char __pyx_k_timeout_error[] = "_timeout_error"; +static const char __pyx_k_MultipleWaiter[] = "MultipleWaiter"; +static const char __pyx_k_get_hub_noargs[] = "get_hub_noargs"; +static const char __pyx_k_gevent_timeout[] = "gevent.timeout"; +static const char __pyx_k_import_c_accel[] = "import_c_accel"; +static const char __pyx_k_wait_on_socket[] = "wait_on_socket"; +static const char __pyx_k_wait_readwrite[] = "wait_readwrite"; +static const char __pyx_k_wait_on_objects[] = "wait_on_objects"; +static const char __pyx_k_wait_on_watcher[] = "wait_on_watcher"; +static const char __pyx_k_iwait_on_objects[] = "iwait_on_objects"; +static const char __pyx_k_gevent__hub_local[] = "gevent._hub_local"; +static const char __pyx_k_gevent_exceptions[] = "gevent.exceptions"; +static const char __pyx_k_greenlet_imported[] = "_greenlet_imported"; +static const char __pyx_k_InvalidSwitchError[] = "InvalidSwitchError"; +static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; +static const char __pyx_k_start_new_or_dummy[] = "_start_new_or_dummy"; +static const char __pyx_k_WaitIterator___exit[] = "_WaitIterator.__exit__"; +static const char __pyx_k_greenlet_primitives[] = "_greenlet_primitives"; +static const char __pyx_k_WaitIterator___enter[] = "_WaitIterator.__enter__"; +static const char __pyx_k_WaitOperationsGreenlet[] = "WaitOperationsGreenlet"; +static const char __pyx_k_gevent___hub_primitives[] = "gevent.__hub_primitives"; +static const char __pyx_k_ConcurrentObjectUseError[] = "ConcurrentObjectUseError"; +static const char __pyx_k_SwitchOutGreenletWithLoop[] = "SwitchOutGreenletWithLoop"; +static const char __pyx_k_set_default_timeout_error[] = "set_default_timeout_error"; +static const char __pyx_k_WaitOperationsGreenlet_wait[] = "WaitOperationsGreenlet.wait"; +static const char __pyx_k_src_gevent__hub_primitives_py[] = "src\\gevent\\_hub_primitives.py"; +static const char __pyx_k_A_collection_of_primitives_used[] = "\nA collection of primitives used by the hub, and suitable for\ncompilation with Cython because of their frequency of use.\n\n\n"; +static const char __pyx_k_Invalid_switch_into_s_r_expected[] = "Invalid switch into %s: %r (expected %r)"; +static const char __pyx_k_The_socket_has_already_been_clos[] = "The socket has already been closed by another greenlet"; +static const char __pyx_k_This_socket_is_already_used_by_a[] = "This socket is already used by another greenlet: %r"; +static const char __pyx_k_WaitOperationsGreenlet__cancel_w[] = "WaitOperationsGreenlet._cancel_wait"; +static const char __pyx_k_WaitOperationsGreenlet_cancel_wa[] = "WaitOperationsGreenlet.cancel_wait"; +static PyObject *__pyx_n_s_ConcurrentObjectUseError; +static PyObject *__pyx_n_s_InvalidSwitchError; +static PyObject *__pyx_kp_s_Invalid_switch_into_s_r_expected; +static PyObject *__pyx_n_s_MultipleWaiter; +static PyObject *__pyx_n_s_NONE; +static PyObject *__pyx_n_s_StopIteration; +static PyObject *__pyx_n_s_SwitchOutGreenletWithLoop; +static PyObject *__pyx_kp_s_The_socket_has_already_been_clos; +static PyObject *__pyx_kp_s_This_socket_is_already_used_by_a; +static PyObject *__pyx_n_s_Timeout; +static PyObject *__pyx_n_s_WaitIterator; +static PyObject *__pyx_n_s_WaitIterator___enter; +static PyObject *__pyx_n_s_WaitIterator___exit; +static PyObject *__pyx_n_s_WaitOperationsGreenlet; +static PyObject *__pyx_n_s_WaitOperationsGreenlet__cancel_w; +static PyObject *__pyx_n_s_WaitOperationsGreenlet_cancel_wa; +static PyObject *__pyx_n_s_WaitOperationsGreenlet_wait; +static PyObject *__pyx_n_s_Waiter; +static PyObject *__pyx_n_s_active; +static PyObject *__pyx_n_s_all; +static PyObject *__pyx_n_s_callback; +static PyObject *__pyx_n_s_cancel_wait; +static PyObject *__pyx_n_s_cancel_wait_2; +static PyObject *__pyx_n_s_cline_in_traceback; +static PyObject *__pyx_n_s_close; +static PyObject *__pyx_n_s_close_watcher; +static PyObject *__pyx_n_s_count; +static PyObject *__pyx_n_s_e; +static PyObject *__pyx_n_s_enter; +static PyObject *__pyx_n_s_error; +static PyObject *__pyx_n_s_event; +static PyObject *__pyx_n_s_exit; +static PyObject *__pyx_n_s_fileno; +static PyObject *__pyx_n_s_get_hub_noargs; +static PyObject *__pyx_n_s_getcurrent; +static PyObject *__pyx_n_s_gevent; +static PyObject *__pyx_n_s_gevent___hub_primitives; +static PyObject *__pyx_n_s_gevent__hub_local; +static PyObject *__pyx_n_s_gevent__util; +static PyObject *__pyx_n_s_gevent_exceptions; +static PyObject *__pyx_n_s_gevent_timeout; +static PyObject *__pyx_n_s_greenlet; +static PyObject *__pyx_n_s_greenlet_imported; +static PyObject *__pyx_n_s_greenlet_init; +static PyObject *__pyx_n_s_greenlet_primitives; +static PyObject *__pyx_n_s_hub; +static PyObject *__pyx_n_s_import; +static PyObject *__pyx_n_s_import_c_accel; +static PyObject *__pyx_n_s_init; +static PyObject *__pyx_n_s_io; +static PyObject *__pyx_n_s_iwait_on_objects; +static PyObject *__pyx_n_s_join; +static PyObject *__pyx_n_s_lambda; +static PyObject *__pyx_n_s_main; +static PyObject *__pyx_n_s_name; +static PyObject *__pyx_n_s_next; +static PyObject *__pyx_n_s_next_2; +static PyObject *__pyx_n_s_objects; +static PyObject *__pyx_n_s_print_exc; +static PyObject *__pyx_n_s_priority; +static PyObject *__pyx_n_s_pyx_capi; +static PyObject *__pyx_n_s_pyx_vtable; +static PyObject *__pyx_n_s_rawlink; +static PyObject *__pyx_n_s_run_callback; +static PyObject *__pyx_n_s_self; +static PyObject *__pyx_n_s_self_2; +static PyObject *__pyx_n_s_set_default_timeout_error; +static PyObject *__pyx_n_s_socket; +static PyObject *__pyx_kp_s_src_gevent__hub_primitives_py; +static PyObject *__pyx_n_s_start; +static PyObject *__pyx_n_s_start_new_or_dummy; +static PyObject *__pyx_n_s_stop; +static PyObject *__pyx_n_s_switch; +static PyObject *__pyx_n_s_tb; +static PyObject *__pyx_n_s_test; +static PyObject *__pyx_n_s_throw; +static PyObject *__pyx_kp_s_timed_out; +static PyObject *__pyx_n_s_timeout; +static PyObject *__pyx_n_s_timeout_error; +static PyObject *__pyx_n_s_timeout_exc; +static PyObject *__pyx_n_s_timer; +static PyObject *__pyx_n_s_traceback; +static PyObject *__pyx_n_s_typ; +static PyObject *__pyx_n_s_unlink; +static PyObject *__pyx_n_s_value; +static PyObject *__pyx_n_s_wait; +static PyObject *__pyx_n_s_wait_on_objects; +static PyObject *__pyx_n_s_wait_on_socket; +static PyObject *__pyx_n_s_wait_on_watcher; +static PyObject *__pyx_n_s_wait_read; +static PyObject *__pyx_n_s_wait_readwrite; +static PyObject *__pyx_n_s_wait_write; +static PyObject *__pyx_n_s_waiter; +static PyObject *__pyx_n_s_watcher; +static PyObject *__pyx_lambda_funcdef_6gevent_16__hub_primitives_lambda(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_6gevent_16__hub_primitives_22WaitOperationsGreenlet_wait(struct __pyx_obj_6gevent_16__hub_primitives_WaitOperationsGreenlet *__pyx_v_self, PyObject *__pyx_v_watcher); /* proto */ +static PyObject *__pyx_pf_6gevent_16__hub_primitives_22WaitOperationsGreenlet_2cancel_wait(struct __pyx_obj_6gevent_16__hub_primitives_WaitOperationsGreenlet *__pyx_v_self, PyObject *__pyx_v_watcher, PyObject *__pyx_v_error, PyObject *__pyx_v_close_watcher); /* proto */ +static PyObject *__pyx_pf_6gevent_16__hub_primitives_22WaitOperationsGreenlet_4_cancel_wait(struct __pyx_obj_6gevent_16__hub_primitives_WaitOperationsGreenlet *__pyx_v_self, PyObject *__pyx_v_watcher, PyObject *__pyx_v_error, PyObject *__pyx_v_close_watcher); /* proto */ +static int __pyx_pf_6gevent_16__hub_primitives_13_WaitIterator___init__(struct __pyx_obj_6gevent_16__hub_primitives__WaitIterator *__pyx_v_self, PyObject *__pyx_v_objects, PyObject *__pyx_v_hub, PyObject *__pyx_v_timeout, PyObject *__pyx_v_count); /* proto */ +static PyObject *__pyx_pf_6gevent_16__hub_primitives_13_WaitIterator_2__iter__(struct __pyx_obj_6gevent_16__hub_primitives__WaitIterator *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_16__hub_primitives_13_WaitIterator_4__next__(struct __pyx_obj_6gevent_16__hub_primitives__WaitIterator *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_16__hub_primitives_13_WaitIterator_6__enter__(struct __pyx_obj_6gevent_16__hub_primitives__WaitIterator *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_16__hub_primitives_13_WaitIterator_8__exit__(struct __pyx_obj_6gevent_16__hub_primitives__WaitIterator *__pyx_v_self, PyObject *__pyx_v_typ, PyObject *__pyx_v_value, PyObject *__pyx_v_tb); /* proto */ +static PyObject *__pyx_pf_6gevent_16__hub_primitives_iwait_on_objects(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_objects, PyObject *__pyx_v_timeout, PyObject *__pyx_v_count); /* proto */ +static PyObject *__pyx_pf_6gevent_16__hub_primitives_2wait_on_objects(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_objects, PyObject *__pyx_v_timeout, PyObject *__pyx_v_count); /* proto */ +static PyObject *__pyx_pf_6gevent_16__hub_primitives_4set_default_timeout_error(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_e); /* proto */ +static PyObject *__pyx_pf_6gevent_16__hub_primitives_6wait_on_socket(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_socket, PyObject *__pyx_v_watcher, PyObject *__pyx_v_timeout_exc); /* proto */ +static PyObject *__pyx_pf_6gevent_16__hub_primitives_8wait_on_watcher(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_watcher, PyObject *__pyx_v_timeout, PyObject *__pyx_v_timeout_exc, struct __pyx_obj_6gevent_16__hub_primitives_WaitOperationsGreenlet *__pyx_v_hub); /* proto */ +static PyObject *__pyx_pf_6gevent_16__hub_primitives_10wait_read(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_fileno, PyObject *__pyx_v_timeout, PyObject *__pyx_v_timeout_exc); /* proto */ +static PyObject *__pyx_pf_6gevent_16__hub_primitives_12wait_write(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_fileno, PyObject *__pyx_v_timeout, PyObject *__pyx_v_timeout_exc, PyObject *__pyx_v_event); /* proto */ +static PyObject *__pyx_pf_6gevent_16__hub_primitives_14wait_readwrite(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_fileno, PyObject *__pyx_v_timeout, PyObject *__pyx_v_timeout_exc, PyObject *__pyx_v_event); /* proto */ +static PyObject *__pyx_pf_6gevent_16__hub_primitives_16_init(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_tp_new_6gevent_16__hub_primitives_WaitOperationsGreenlet(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6gevent_16__hub_primitives__WaitIterator(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_int_1; +static PyObject *__pyx_int_2; +static PyObject *__pyx_int_3; +static PyObject *__pyx_int_neg_1; +static PyObject *__pyx_k__2; +static PyObject *__pyx_k__3; +static PyObject *__pyx_k__4; +static PyObject *__pyx_k__5; +static PyObject *__pyx_k__6; +static PyObject *__pyx_k__7; +static PyObject *__pyx_tuple_; +static PyObject *__pyx_tuple__8; +static PyObject *__pyx_tuple__9; +static PyObject *__pyx_tuple__11; +static PyObject *__pyx_tuple__13; +static PyObject *__pyx_tuple__15; +static PyObject *__pyx_tuple__17; +static PyObject *__pyx_tuple__19; +static PyObject *__pyx_tuple__21; +static PyObject *__pyx_tuple__23; +static PyObject *__pyx_tuple__25; +static PyObject *__pyx_tuple__27; +static PyObject *__pyx_tuple__29; +static PyObject *__pyx_tuple__31; +static PyObject *__pyx_tuple__33; +static PyObject *__pyx_codeobj__10; +static PyObject *__pyx_codeobj__12; +static PyObject *__pyx_codeobj__14; +static PyObject *__pyx_codeobj__16; +static PyObject *__pyx_codeobj__18; +static PyObject *__pyx_codeobj__20; +static PyObject *__pyx_codeobj__22; +static PyObject *__pyx_codeobj__24; +static PyObject *__pyx_codeobj__26; +static PyObject *__pyx_codeobj__28; +static PyObject *__pyx_codeobj__30; +static PyObject *__pyx_codeobj__32; +static PyObject *__pyx_codeobj__34; +static PyObject *__pyx_codeobj__35; +/* Late includes */ + +/* "src/gevent/_hub_primitives.py":30 + * # error. + * locals()['getcurrent'] = __import__('greenlet').getcurrent + * locals()['greenlet_init'] = lambda: None # <<<<<<<<<<<<<< + * locals()['Waiter'] = _waiter.Waiter + * locals()['MultipleWaiter'] = _waiter.MultipleWaiter + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_16__hub_primitives_18lambda(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyMethodDef __pyx_mdef_6gevent_16__hub_primitives_18lambda = {"lambda", (PyCFunction)__pyx_pw_6gevent_16__hub_primitives_18lambda, METH_NOARGS, 0}; +static PyObject *__pyx_pw_6gevent_16__hub_primitives_18lambda(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("lambda (wrapper)", 0); + __pyx_r = __pyx_lambda_funcdef_6gevent_16__hub_primitives_lambda(__pyx_self); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_lambda_funcdef_6gevent_16__hub_primitives_lambda(CYTHON_UNUSED PyObject *__pyx_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("lambda", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_hub_primitives.py":46 + * class WaitOperationsGreenlet(SwitchOutGreenletWithLoop): # pylint:disable=undefined-variable + * + * def wait(self, watcher): # <<<<<<<<<<<<<< + * """ + * Wait until the *watcher* (which must not be started) is ready. + */ + +static PyObject *__pyx_pw_6gevent_16__hub_primitives_22WaitOperationsGreenlet_1wait(PyObject *__pyx_v_self, PyObject *__pyx_v_watcher); /*proto*/ +static PyObject *__pyx_f_6gevent_16__hub_primitives_22WaitOperationsGreenlet_wait(struct __pyx_obj_6gevent_16__hub_primitives_WaitOperationsGreenlet *__pyx_v_self, PyObject *__pyx_v_watcher, int __pyx_skip_dispatch) { + struct __pyx_obj_6gevent_8__waiter_Waiter *__pyx_v_waiter = NULL; + PyObject *__pyx_v_result = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + int __pyx_t_8; + int __pyx_t_9; + char const *__pyx_t_10; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + PyObject *__pyx_t_14 = NULL; + PyObject *__pyx_t_15 = NULL; + PyObject *__pyx_t_16 = NULL; + __Pyx_RefNannySetupContext("wait", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0; + if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self)))))); + else { + PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + #endif + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_wait); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 46, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_16__hub_primitives_22WaitOperationsGreenlet_1wait)) { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_watcher) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_watcher); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 46, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0; + if (unlikely(type_dict_guard != tp_dict_version)) { + tp_dict_version = obj_dict_version = 0; + } + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + } + #endif + } + + /* "src/gevent/_hub_primitives.py":52 + * The current greenlet will be unscheduled during this time. + * """ + * waiter = Waiter(self) # pylint:disable=undefined-variable # <<<<<<<<<<<<<< + * watcher.start(waiter.switch, waiter) + * try: + */ + __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_6gevent_8__waiter_Waiter), ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 52, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_waiter = ((struct __pyx_obj_6gevent_8__waiter_Waiter *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "src/gevent/_hub_primitives.py":53 + * """ + * waiter = Waiter(self) # pylint:disable=undefined-variable + * watcher.start(waiter.switch, waiter) # <<<<<<<<<<<<<< + * try: + * result = waiter.get() + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_watcher, __pyx_n_s_start); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 53, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_waiter), __pyx_n_s_switch); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 53, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = NULL; + __pyx_t_5 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_5 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_3, ((PyObject *)__pyx_v_waiter)}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 53, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_3, ((PyObject *)__pyx_v_waiter)}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 53, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } else + #endif + { + __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 53, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (__pyx_t_4) { + __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL; + } + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_t_3); + __Pyx_INCREF(((PyObject *)__pyx_v_waiter)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_waiter)); + PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, ((PyObject *)__pyx_v_waiter)); + __pyx_t_3 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 53, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_hub_primitives.py":54 + * waiter = Waiter(self) # pylint:disable=undefined-variable + * watcher.start(waiter.switch, waiter) + * try: # <<<<<<<<<<<<<< + * result = waiter.get() + * if result is not waiter: + */ + /*try:*/ { + + /* "src/gevent/_hub_primitives.py":55 + * watcher.start(waiter.switch, waiter) + * try: + * result = waiter.get() # <<<<<<<<<<<<<< + * if result is not waiter: + * raise InvalidSwitchError('Invalid switch into %s: %r (expected %r)' % ( + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_8__waiter_Waiter *)__pyx_v_waiter->__pyx_vtab)->get(__pyx_v_waiter, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 55, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_result = __pyx_t_1; + __pyx_t_1 = 0; + + /* "src/gevent/_hub_primitives.py":56 + * try: + * result = waiter.get() + * if result is not waiter: # <<<<<<<<<<<<<< + * raise InvalidSwitchError('Invalid switch into %s: %r (expected %r)' % ( + * getcurrent(), # pylint:disable=undefined-variable + */ + __pyx_t_7 = (__pyx_v_result != ((PyObject *)__pyx_v_waiter)); + __pyx_t_8 = (__pyx_t_7 != 0); + if (unlikely(__pyx_t_8)) { + + /* "src/gevent/_hub_primitives.py":58 + * if result is not waiter: + * raise InvalidSwitchError('Invalid switch into %s: %r (expected %r)' % ( + * getcurrent(), # pylint:disable=undefined-variable # <<<<<<<<<<<<<< + * result, waiter)) + * finally: + */ + __pyx_t_2 = ((PyObject *)__pyx_f_6gevent_16__hub_primitives_getcurrent()); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 58, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_2); + + /* "src/gevent/_hub_primitives.py":59 + * raise InvalidSwitchError('Invalid switch into %s: %r (expected %r)' % ( + * getcurrent(), # pylint:disable=undefined-variable + * result, waiter)) # <<<<<<<<<<<<<< + * finally: + * watcher.stop() + */ + __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 58, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); + __Pyx_INCREF(__pyx_v_result); + __Pyx_GIVEREF(__pyx_v_result); + PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_result); + __Pyx_INCREF(((PyObject *)__pyx_v_waiter)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_waiter)); + PyTuple_SET_ITEM(__pyx_t_6, 2, ((PyObject *)__pyx_v_waiter)); + __pyx_t_2 = 0; + + /* "src/gevent/_hub_primitives.py":57 + * result = waiter.get() + * if result is not waiter: + * raise InvalidSwitchError('Invalid switch into %s: %r (expected %r)' % ( # <<<<<<<<<<<<<< + * getcurrent(), # pylint:disable=undefined-variable + * result, waiter)) + */ + __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_switch_into_s_r_expected, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 57, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_INCREF(__pyx_v_6gevent_16__hub_primitives_InvalidSwitchError); + __pyx_t_6 = __pyx_v_6gevent_16__hub_primitives_InvalidSwitchError; __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_6); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_6, function); + } + } + __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 57, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 57, __pyx_L4_error) + + /* "src/gevent/_hub_primitives.py":56 + * try: + * result = waiter.get() + * if result is not waiter: # <<<<<<<<<<<<<< + * raise InvalidSwitchError('Invalid switch into %s: %r (expected %r)' % ( + * getcurrent(), # pylint:disable=undefined-variable + */ + } + } + + /* "src/gevent/_hub_primitives.py":61 + * result, waiter)) + * finally: + * watcher.stop() # <<<<<<<<<<<<<< + * + * def cancel_wait(self, watcher, error, close_watcher=False): + */ + /*finally:*/ { + /*normal exit:*/{ + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_watcher, __pyx_n_s_stop); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 61, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_2 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { + __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_6); + if (likely(__pyx_t_2)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_6, function); + } + } + __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 61, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L5; + } + __pyx_L4_error:; + /*exception exit:*/{ + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_14, &__pyx_t_15, &__pyx_t_16); + if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13) < 0)) __Pyx_ErrFetch(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13); + __Pyx_XGOTREF(__pyx_t_11); + __Pyx_XGOTREF(__pyx_t_12); + __Pyx_XGOTREF(__pyx_t_13); + __Pyx_XGOTREF(__pyx_t_14); + __Pyx_XGOTREF(__pyx_t_15); + __Pyx_XGOTREF(__pyx_t_16); + __pyx_t_5 = __pyx_lineno; __pyx_t_9 = __pyx_clineno; __pyx_t_10 = __pyx_filename; + { + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_watcher, __pyx_n_s_stop); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 61, __pyx_L8_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_2 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { + __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_6); + if (likely(__pyx_t_2)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_6, function); + } + } + __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 61, __pyx_L8_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + if (PY_MAJOR_VERSION >= 3) { + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_XGIVEREF(__pyx_t_15); + __Pyx_XGIVEREF(__pyx_t_16); + __Pyx_ExceptionReset(__pyx_t_14, __pyx_t_15, __pyx_t_16); + } + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_XGIVEREF(__pyx_t_12); + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_ErrRestore(__pyx_t_11, __pyx_t_12, __pyx_t_13); + __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; + __pyx_lineno = __pyx_t_5; __pyx_clineno = __pyx_t_9; __pyx_filename = __pyx_t_10; + goto __pyx_L1_error; + __pyx_L8_error:; + if (PY_MAJOR_VERSION >= 3) { + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_XGIVEREF(__pyx_t_15); + __Pyx_XGIVEREF(__pyx_t_16); + __Pyx_ExceptionReset(__pyx_t_14, __pyx_t_15, __pyx_t_16); + } + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; + goto __pyx_L1_error; + } + __pyx_L5:; + } + + /* "src/gevent/_hub_primitives.py":46 + * class WaitOperationsGreenlet(SwitchOutGreenletWithLoop): # pylint:disable=undefined-variable + * + * def wait(self, watcher): # <<<<<<<<<<<<<< + * """ + * Wait until the *watcher* (which must not be started) is ready. + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("gevent.__hub_primitives.WaitOperationsGreenlet.wait", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_waiter); + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_16__hub_primitives_22WaitOperationsGreenlet_1wait(PyObject *__pyx_v_self, PyObject *__pyx_v_watcher); /*proto*/ +static char __pyx_doc_6gevent_16__hub_primitives_22WaitOperationsGreenlet_wait[] = "WaitOperationsGreenlet.wait(self, watcher)\n\n Wait until the *watcher* (which must not be started) is ready.\n\n The current greenlet will be unscheduled during this time.\n "; +static PyMethodDef __pyx_mdef_6gevent_16__hub_primitives_22WaitOperationsGreenlet_1wait = {"wait", (PyCFunction)__pyx_pw_6gevent_16__hub_primitives_22WaitOperationsGreenlet_1wait, METH_O, __pyx_doc_6gevent_16__hub_primitives_22WaitOperationsGreenlet_wait}; +static PyObject *__pyx_pw_6gevent_16__hub_primitives_22WaitOperationsGreenlet_1wait(PyObject *__pyx_v_self, PyObject *__pyx_v_watcher) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("wait (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_16__hub_primitives_22WaitOperationsGreenlet_wait(((struct __pyx_obj_6gevent_16__hub_primitives_WaitOperationsGreenlet *)__pyx_v_self), ((PyObject *)__pyx_v_watcher)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_16__hub_primitives_22WaitOperationsGreenlet_wait(struct __pyx_obj_6gevent_16__hub_primitives_WaitOperationsGreenlet *__pyx_v_self, PyObject *__pyx_v_watcher) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("wait", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6gevent_16__hub_primitives_22WaitOperationsGreenlet_wait(__pyx_v_self, __pyx_v_watcher, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 46, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__hub_primitives.WaitOperationsGreenlet.wait", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_hub_primitives.py":63 + * watcher.stop() + * + * def cancel_wait(self, watcher, error, close_watcher=False): # <<<<<<<<<<<<<< + * """ + * Cancel an in-progress call to :meth:`wait` by throwing the given *error* + */ + +static PyObject *__pyx_pw_6gevent_16__hub_primitives_22WaitOperationsGreenlet_3cancel_wait(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_6gevent_16__hub_primitives_22WaitOperationsGreenlet_cancel_wait(struct __pyx_obj_6gevent_16__hub_primitives_WaitOperationsGreenlet *__pyx_v_self, PyObject *__pyx_v_watcher, PyObject *__pyx_v_error, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_16__hub_primitives_22WaitOperationsGreenlet_cancel_wait *__pyx_optional_args) { + PyObject *__pyx_v_close_watcher = ((PyObject *)Py_False); + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + int __pyx_t_8; + __Pyx_RefNannySetupContext("cancel_wait", 0); + if (__pyx_optional_args) { + if (__pyx_optional_args->__pyx_n > 0) { + __pyx_v_close_watcher = __pyx_optional_args->close_watcher; + } + } + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0; + if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self)))))); + else { + PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + #endif + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_cancel_wait); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 63, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_16__hub_primitives_22WaitOperationsGreenlet_3cancel_wait)) { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; + __pyx_t_5 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_5 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_3)) { + PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_watcher, __pyx_v_error, __pyx_v_close_watcher}; + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 63, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GOTREF(__pyx_t_2); + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { + PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_watcher, __pyx_v_error, __pyx_v_close_watcher}; + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 63, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GOTREF(__pyx_t_2); + } else + #endif + { + __pyx_t_6 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 63, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (__pyx_t_4) { + __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL; + } + __Pyx_INCREF(__pyx_v_watcher); + __Pyx_GIVEREF(__pyx_v_watcher); + PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_watcher); + __Pyx_INCREF(__pyx_v_error); + __Pyx_GIVEREF(__pyx_v_error); + PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_error); + __Pyx_INCREF(__pyx_v_close_watcher); + __Pyx_GIVEREF(__pyx_v_close_watcher); + PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_v_close_watcher); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 63, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0; + if (unlikely(type_dict_guard != tp_dict_version)) { + tp_dict_version = obj_dict_version = 0; + } + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + } + #endif + } + + /* "src/gevent/_hub_primitives.py":75 + * Allow the *watcher* to be ``None``. No action is taken in that case. + * """ + * if watcher is None: # <<<<<<<<<<<<<< + * # Presumably already closed. + * # See https://github.com/gevent/gevent/issues/1089 + */ + __pyx_t_7 = (__pyx_v_watcher == Py_None); + __pyx_t_8 = (__pyx_t_7 != 0); + if (__pyx_t_8) { + + /* "src/gevent/_hub_primitives.py":78 + * # Presumably already closed. + * # See https://github.com/gevent/gevent/issues/1089 + * return # <<<<<<<<<<<<<< + * if watcher.callback is not None: + * self.loop.run_callback(self._cancel_wait, watcher, error, close_watcher) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + + /* "src/gevent/_hub_primitives.py":75 + * Allow the *watcher* to be ``None``. No action is taken in that case. + * """ + * if watcher is None: # <<<<<<<<<<<<<< + * # Presumably already closed. + * # See https://github.com/gevent/gevent/issues/1089 + */ + } + + /* "src/gevent/_hub_primitives.py":79 + * # See https://github.com/gevent/gevent/issues/1089 + * return + * if watcher.callback is not None: # <<<<<<<<<<<<<< + * self.loop.run_callback(self._cancel_wait, watcher, error, close_watcher) + * elif close_watcher: + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_watcher, __pyx_n_s_callback); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 79, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_8 = (__pyx_t_1 != Py_None); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_7 = (__pyx_t_8 != 0); + if (__pyx_t_7) { + + /* "src/gevent/_hub_primitives.py":80 + * return + * if watcher.callback is not None: + * self.loop.run_callback(self._cancel_wait, watcher, error, close_watcher) # <<<<<<<<<<<<<< + * elif close_watcher: + * watcher.close() + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->__pyx_base.loop, __pyx_n_s_run_callback); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 80, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_cancel_wait_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 80, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_6 = NULL; + __pyx_t_5 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_6)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_5 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[5] = {__pyx_t_6, __pyx_t_3, __pyx_v_watcher, __pyx_v_error, __pyx_v_close_watcher}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 4+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 80, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[5] = {__pyx_t_6, __pyx_t_3, __pyx_v_watcher, __pyx_v_error, __pyx_v_close_watcher}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 4+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 80, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } else + #endif + { + __pyx_t_4 = PyTuple_New(4+__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 80, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (__pyx_t_6) { + __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6); __pyx_t_6 = NULL; + } + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_5, __pyx_t_3); + __Pyx_INCREF(__pyx_v_watcher); + __Pyx_GIVEREF(__pyx_v_watcher); + PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_5, __pyx_v_watcher); + __Pyx_INCREF(__pyx_v_error); + __Pyx_GIVEREF(__pyx_v_error); + PyTuple_SET_ITEM(__pyx_t_4, 2+__pyx_t_5, __pyx_v_error); + __Pyx_INCREF(__pyx_v_close_watcher); + __Pyx_GIVEREF(__pyx_v_close_watcher); + PyTuple_SET_ITEM(__pyx_t_4, 3+__pyx_t_5, __pyx_v_close_watcher); + __pyx_t_3 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 80, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_hub_primitives.py":79 + * # See https://github.com/gevent/gevent/issues/1089 + * return + * if watcher.callback is not None: # <<<<<<<<<<<<<< + * self.loop.run_callback(self._cancel_wait, watcher, error, close_watcher) + * elif close_watcher: + */ + goto __pyx_L4; + } + + /* "src/gevent/_hub_primitives.py":81 + * if watcher.callback is not None: + * self.loop.run_callback(self._cancel_wait, watcher, error, close_watcher) + * elif close_watcher: # <<<<<<<<<<<<<< + * watcher.close() + * + */ + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_close_watcher); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 81, __pyx_L1_error) + if (__pyx_t_7) { + + /* "src/gevent/_hub_primitives.py":82 + * self.loop.run_callback(self._cancel_wait, watcher, error, close_watcher) + * elif close_watcher: + * watcher.close() # <<<<<<<<<<<<<< + * + * def _cancel_wait(self, watcher, error, close_watcher): + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_watcher, __pyx_n_s_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 82, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 82, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_hub_primitives.py":81 + * if watcher.callback is not None: + * self.loop.run_callback(self._cancel_wait, watcher, error, close_watcher) + * elif close_watcher: # <<<<<<<<<<<<<< + * watcher.close() + * + */ + } + __pyx_L4:; + + /* "src/gevent/_hub_primitives.py":63 + * watcher.stop() + * + * def cancel_wait(self, watcher, error, close_watcher=False): # <<<<<<<<<<<<<< + * """ + * Cancel an in-progress call to :meth:`wait` by throwing the given *error* + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("gevent.__hub_primitives.WaitOperationsGreenlet.cancel_wait", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_16__hub_primitives_22WaitOperationsGreenlet_3cancel_wait(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6gevent_16__hub_primitives_22WaitOperationsGreenlet_2cancel_wait[] = "WaitOperationsGreenlet.cancel_wait(self, watcher, error, close_watcher=False)\n\n Cancel an in-progress call to :meth:`wait` by throwing the given *error*\n in the waiting greenlet.\n\n .. versionchanged:: 1.3a1\n Added the *close_watcher* parameter. If true, the watcher\n will be closed after the exception is thrown. The watcher should then\n be discarded. Closing the watcher is important to release native resources.\n .. versionchanged:: 1.3a2\n Allow the *watcher* to be ``None``. No action is taken in that case.\n "; +static PyMethodDef __pyx_mdef_6gevent_16__hub_primitives_22WaitOperationsGreenlet_3cancel_wait = {"cancel_wait", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_16__hub_primitives_22WaitOperationsGreenlet_3cancel_wait, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_16__hub_primitives_22WaitOperationsGreenlet_2cancel_wait}; +static PyObject *__pyx_pw_6gevent_16__hub_primitives_22WaitOperationsGreenlet_3cancel_wait(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_watcher = 0; + PyObject *__pyx_v_error = 0; + PyObject *__pyx_v_close_watcher = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("cancel_wait (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_watcher,&__pyx_n_s_error,&__pyx_n_s_close_watcher,0}; + PyObject* values[3] = {0,0,0}; + values[2] = ((PyObject *)Py_False); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_watcher)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_error)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("cancel_wait", 0, 2, 3, 1); __PYX_ERR(0, 63, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_close_watcher); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "cancel_wait") < 0)) __PYX_ERR(0, 63, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_watcher = values[0]; + __pyx_v_error = values[1]; + __pyx_v_close_watcher = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("cancel_wait", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 63, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.__hub_primitives.WaitOperationsGreenlet.cancel_wait", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_16__hub_primitives_22WaitOperationsGreenlet_2cancel_wait(((struct __pyx_obj_6gevent_16__hub_primitives_WaitOperationsGreenlet *)__pyx_v_self), __pyx_v_watcher, __pyx_v_error, __pyx_v_close_watcher); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_16__hub_primitives_22WaitOperationsGreenlet_2cancel_wait(struct __pyx_obj_6gevent_16__hub_primitives_WaitOperationsGreenlet *__pyx_v_self, PyObject *__pyx_v_watcher, PyObject *__pyx_v_error, PyObject *__pyx_v_close_watcher) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + struct __pyx_opt_args_6gevent_16__hub_primitives_22WaitOperationsGreenlet_cancel_wait __pyx_t_2; + __Pyx_RefNannySetupContext("cancel_wait", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_2.__pyx_n = 1; + __pyx_t_2.close_watcher = __pyx_v_close_watcher; + __pyx_t_1 = __pyx_vtabptr_6gevent_16__hub_primitives_WaitOperationsGreenlet->cancel_wait(__pyx_v_self, __pyx_v_watcher, __pyx_v_error, 1, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 63, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__hub_primitives.WaitOperationsGreenlet.cancel_wait", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_hub_primitives.py":84 + * watcher.close() + * + * def _cancel_wait(self, watcher, error, close_watcher): # <<<<<<<<<<<<<< + * # We have to check again to see if it was still active by the time + * # our callback actually runs. + */ + +static PyObject *__pyx_pw_6gevent_16__hub_primitives_22WaitOperationsGreenlet_5_cancel_wait(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_6gevent_16__hub_primitives_22WaitOperationsGreenlet__cancel_wait(CYTHON_UNUSED struct __pyx_obj_6gevent_16__hub_primitives_WaitOperationsGreenlet *__pyx_v_self, PyObject *__pyx_v_watcher, PyObject *__pyx_v_error, PyObject *__pyx_v_close_watcher, int __pyx_skip_dispatch) { + PyObject *__pyx_v_active = NULL; + PyObject *__pyx_v_cb = NULL; + PyObject *__pyx_v_glet = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + int __pyx_t_8; + __Pyx_RefNannySetupContext("_cancel_wait", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0; + if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self)))))); + else { + PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + #endif + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_cancel_wait_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 84, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_16__hub_primitives_22WaitOperationsGreenlet_5_cancel_wait)) { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; + __pyx_t_5 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_5 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_3)) { + PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_watcher, __pyx_v_error, __pyx_v_close_watcher}; + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 84, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GOTREF(__pyx_t_2); + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { + PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_watcher, __pyx_v_error, __pyx_v_close_watcher}; + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 84, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GOTREF(__pyx_t_2); + } else + #endif + { + __pyx_t_6 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 84, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (__pyx_t_4) { + __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL; + } + __Pyx_INCREF(__pyx_v_watcher); + __Pyx_GIVEREF(__pyx_v_watcher); + PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_watcher); + __Pyx_INCREF(__pyx_v_error); + __Pyx_GIVEREF(__pyx_v_error); + PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_error); + __Pyx_INCREF(__pyx_v_close_watcher); + __Pyx_GIVEREF(__pyx_v_close_watcher); + PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_v_close_watcher); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 84, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0; + if (unlikely(type_dict_guard != tp_dict_version)) { + tp_dict_version = obj_dict_version = 0; + } + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + } + #endif + } + + /* "src/gevent/_hub_primitives.py":87 + * # We have to check again to see if it was still active by the time + * # our callback actually runs. + * active = watcher.active # <<<<<<<<<<<<<< + * cb = watcher.callback + * if close_watcher: + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_watcher, __pyx_n_s_active); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 87, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_active = __pyx_t_1; + __pyx_t_1 = 0; + + /* "src/gevent/_hub_primitives.py":88 + * # our callback actually runs. + * active = watcher.active + * cb = watcher.callback # <<<<<<<<<<<<<< + * if close_watcher: + * watcher.close() + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_watcher, __pyx_n_s_callback); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 88, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_cb = __pyx_t_1; + __pyx_t_1 = 0; + + /* "src/gevent/_hub_primitives.py":89 + * active = watcher.active + * cb = watcher.callback + * if close_watcher: # <<<<<<<<<<<<<< + * watcher.close() + * if active: + */ + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_close_watcher); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 89, __pyx_L1_error) + if (__pyx_t_7) { + + /* "src/gevent/_hub_primitives.py":90 + * cb = watcher.callback + * if close_watcher: + * watcher.close() # <<<<<<<<<<<<<< + * if active: + * # The callback should be greenlet.switch(). It may or may not be None. + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_watcher, __pyx_n_s_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 90, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 90, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_hub_primitives.py":89 + * active = watcher.active + * cb = watcher.callback + * if close_watcher: # <<<<<<<<<<<<<< + * watcher.close() + * if active: + */ + } + + /* "src/gevent/_hub_primitives.py":91 + * if close_watcher: + * watcher.close() + * if active: # <<<<<<<<<<<<<< + * # The callback should be greenlet.switch(). It may or may not be None. + * glet = getattr(cb, '__self__', None) + */ + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_active); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 91, __pyx_L1_error) + if (__pyx_t_7) { + + /* "src/gevent/_hub_primitives.py":93 + * if active: + * # The callback should be greenlet.switch(). It may or may not be None. + * glet = getattr(cb, '__self__', None) # <<<<<<<<<<<<<< + * if glet is not None: + * glet.throw(error) + */ + __pyx_t_1 = __Pyx_GetAttr3(__pyx_v_cb, __pyx_n_s_self, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 93, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_glet = __pyx_t_1; + __pyx_t_1 = 0; + + /* "src/gevent/_hub_primitives.py":94 + * # The callback should be greenlet.switch(). It may or may not be None. + * glet = getattr(cb, '__self__', None) + * if glet is not None: # <<<<<<<<<<<<<< + * glet.throw(error) + * + */ + __pyx_t_7 = (__pyx_v_glet != Py_None); + __pyx_t_8 = (__pyx_t_7 != 0); + if (__pyx_t_8) { + + /* "src/gevent/_hub_primitives.py":95 + * glet = getattr(cb, '__self__', None) + * if glet is not None: + * glet.throw(error) # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_glet, __pyx_n_s_throw); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 95, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_error) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_error); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 95, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_hub_primitives.py":94 + * # The callback should be greenlet.switch(). It may or may not be None. + * glet = getattr(cb, '__self__', None) + * if glet is not None: # <<<<<<<<<<<<<< + * glet.throw(error) + * + */ + } + + /* "src/gevent/_hub_primitives.py":91 + * if close_watcher: + * watcher.close() + * if active: # <<<<<<<<<<<<<< + * # The callback should be greenlet.switch(). It may or may not be None. + * glet = getattr(cb, '__self__', None) + */ + } + + /* "src/gevent/_hub_primitives.py":84 + * watcher.close() + * + * def _cancel_wait(self, watcher, error, close_watcher): # <<<<<<<<<<<<<< + * # We have to check again to see if it was still active by the time + * # our callback actually runs. + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("gevent.__hub_primitives.WaitOperationsGreenlet._cancel_wait", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_active); + __Pyx_XDECREF(__pyx_v_cb); + __Pyx_XDECREF(__pyx_v_glet); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_16__hub_primitives_22WaitOperationsGreenlet_5_cancel_wait(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6gevent_16__hub_primitives_22WaitOperationsGreenlet_4_cancel_wait[] = "WaitOperationsGreenlet._cancel_wait(self, watcher, error, close_watcher)"; +static PyMethodDef __pyx_mdef_6gevent_16__hub_primitives_22WaitOperationsGreenlet_5_cancel_wait = {"_cancel_wait", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_16__hub_primitives_22WaitOperationsGreenlet_5_cancel_wait, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_16__hub_primitives_22WaitOperationsGreenlet_4_cancel_wait}; +static PyObject *__pyx_pw_6gevent_16__hub_primitives_22WaitOperationsGreenlet_5_cancel_wait(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_watcher = 0; + PyObject *__pyx_v_error = 0; + PyObject *__pyx_v_close_watcher = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_cancel_wait (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_watcher,&__pyx_n_s_error,&__pyx_n_s_close_watcher,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_watcher)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_error)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("_cancel_wait", 1, 3, 3, 1); __PYX_ERR(0, 84, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_close_watcher)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("_cancel_wait", 1, 3, 3, 2); __PYX_ERR(0, 84, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_cancel_wait") < 0)) __PYX_ERR(0, 84, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + } + __pyx_v_watcher = values[0]; + __pyx_v_error = values[1]; + __pyx_v_close_watcher = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("_cancel_wait", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 84, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.__hub_primitives.WaitOperationsGreenlet._cancel_wait", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_16__hub_primitives_22WaitOperationsGreenlet_4_cancel_wait(((struct __pyx_obj_6gevent_16__hub_primitives_WaitOperationsGreenlet *)__pyx_v_self), __pyx_v_watcher, __pyx_v_error, __pyx_v_close_watcher); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_16__hub_primitives_22WaitOperationsGreenlet_4_cancel_wait(struct __pyx_obj_6gevent_16__hub_primitives_WaitOperationsGreenlet *__pyx_v_self, PyObject *__pyx_v_watcher, PyObject *__pyx_v_error, PyObject *__pyx_v_close_watcher) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("_cancel_wait", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6gevent_16__hub_primitives_22WaitOperationsGreenlet__cancel_wait(__pyx_v_self, __pyx_v_watcher, __pyx_v_error, __pyx_v_close_watcher, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 84, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__hub_primitives.WaitOperationsGreenlet._cancel_wait", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_hub_primitives.py":100 + * class _WaitIterator(object): + * + * def __init__(self, objects, hub, timeout, count): # <<<<<<<<<<<<<< + * self._hub = hub + * self._waiter = MultipleWaiter(hub) # pylint:disable=undefined-variable + */ + +/* Python wrapper */ +static int __pyx_pw_6gevent_16__hub_primitives_13_WaitIterator_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6gevent_16__hub_primitives_13_WaitIterator_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_objects = 0; + PyObject *__pyx_v_hub = 0; + PyObject *__pyx_v_timeout = 0; + PyObject *__pyx_v_count = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_objects,&__pyx_n_s_hub,&__pyx_n_s_timeout,&__pyx_n_s_count,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_objects)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_hub)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, 1); __PYX_ERR(0, 100, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_timeout)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, 2); __PYX_ERR(0, 100, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 3: + if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_count)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, 3); __PYX_ERR(0, 100, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 100, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_objects = values[0]; + __pyx_v_hub = values[1]; + __pyx_v_timeout = values[2]; + __pyx_v_count = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 100, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.__hub_primitives._WaitIterator.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_16__hub_primitives_13_WaitIterator___init__(((struct __pyx_obj_6gevent_16__hub_primitives__WaitIterator *)__pyx_v_self), __pyx_v_objects, __pyx_v_hub, __pyx_v_timeout, __pyx_v_count); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_16__hub_primitives_13_WaitIterator___init__(struct __pyx_obj_6gevent_16__hub_primitives__WaitIterator *__pyx_v_self, PyObject *__pyx_v_objects, PyObject *__pyx_v_hub, PyObject *__pyx_v_timeout, PyObject *__pyx_v_count) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + int __pyx_t_3; + Py_ssize_t __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + int __pyx_t_8; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "src/gevent/_hub_primitives.py":101 + * + * def __init__(self, objects, hub, timeout, count): + * self._hub = hub # <<<<<<<<<<<<<< + * self._waiter = MultipleWaiter(hub) # pylint:disable=undefined-variable + * self._switch = self._waiter.switch + */ + if (!(likely(((__pyx_v_hub) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_hub, __pyx_ptype_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop))))) __PYX_ERR(0, 101, __pyx_L1_error) + __pyx_t_1 = __pyx_v_hub; + __Pyx_INCREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_self->_hub); + __Pyx_DECREF(((PyObject *)__pyx_v_self->_hub)); + __pyx_v_self->_hub = ((struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "src/gevent/_hub_primitives.py":102 + * def __init__(self, objects, hub, timeout, count): + * self._hub = hub + * self._waiter = MultipleWaiter(hub) # pylint:disable=undefined-variable # <<<<<<<<<<<<<< + * self._switch = self._waiter.switch + * self._timeout = timeout + */ + __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_6gevent_8__waiter_MultipleWaiter), __pyx_v_hub); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 102, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_self->_waiter); + __Pyx_DECREF(((PyObject *)__pyx_v_self->_waiter)); + __pyx_v_self->_waiter = ((struct __pyx_obj_6gevent_8__waiter_MultipleWaiter *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "src/gevent/_hub_primitives.py":103 + * self._hub = hub + * self._waiter = MultipleWaiter(hub) # pylint:disable=undefined-variable + * self._switch = self._waiter.switch # <<<<<<<<<<<<<< + * self._timeout = timeout + * self._objects = objects + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->_waiter), __pyx_n_s_switch); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 103, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_self->_switch); + __Pyx_DECREF(__pyx_v_self->_switch); + __pyx_v_self->_switch = __pyx_t_1; + __pyx_t_1 = 0; + + /* "src/gevent/_hub_primitives.py":104 + * self._waiter = MultipleWaiter(hub) # pylint:disable=undefined-variable + * self._switch = self._waiter.switch + * self._timeout = timeout # <<<<<<<<<<<<<< + * self._objects = objects + * + */ + __Pyx_INCREF(__pyx_v_timeout); + __Pyx_GIVEREF(__pyx_v_timeout); + __Pyx_GOTREF(__pyx_v_self->_timeout); + __Pyx_DECREF(__pyx_v_self->_timeout); + __pyx_v_self->_timeout = __pyx_v_timeout; + + /* "src/gevent/_hub_primitives.py":105 + * self._switch = self._waiter.switch + * self._timeout = timeout + * self._objects = objects # <<<<<<<<<<<<<< + * + * self._timer = None + */ + __Pyx_INCREF(__pyx_v_objects); + __Pyx_GIVEREF(__pyx_v_objects); + __Pyx_GOTREF(__pyx_v_self->_objects); + __Pyx_DECREF(__pyx_v_self->_objects); + __pyx_v_self->_objects = __pyx_v_objects; + + /* "src/gevent/_hub_primitives.py":107 + * self._objects = objects + * + * self._timer = None # <<<<<<<<<<<<<< + * self._begun = False + * + */ + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->_timer); + __Pyx_DECREF(__pyx_v_self->_timer); + __pyx_v_self->_timer = Py_None; + + /* "src/gevent/_hub_primitives.py":108 + * + * self._timer = None + * self._begun = False # <<<<<<<<<<<<<< + * + * # Even if we're only going to return 1 object, + */ + __pyx_v_self->_begun = 0; + + /* "src/gevent/_hub_primitives.py":113 + * # we must still rawlink() *all* of them, so that no + * # matter which one finishes first we find it. + * self._count = len(objects) if count is None else min(count, len(objects)) # <<<<<<<<<<<<<< + * + * def _begin(self): + */ + __pyx_t_3 = (__pyx_v_count == Py_None); + if ((__pyx_t_3 != 0)) { + __pyx_t_4 = PyObject_Length(__pyx_v_objects); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 113, __pyx_L1_error) + __pyx_t_2 = __pyx_t_4; + } else { + __pyx_t_4 = PyObject_Length(__pyx_v_objects); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 113, __pyx_L1_error) + __Pyx_INCREF(__pyx_v_count); + __pyx_t_1 = __pyx_v_count; + __pyx_t_6 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 113, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = PyObject_RichCompare(__pyx_t_6, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 113, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 113, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (__pyx_t_8) { + __pyx_t_7 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 113, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_5 = __pyx_t_7; + __pyx_t_7 = 0; + } else { + __Pyx_INCREF(__pyx_t_1); + __pyx_t_5 = __pyx_t_1; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_4 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_4 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 113, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_2 = __pyx_t_4; + } + __pyx_v_self->_count = __pyx_t_2; + + /* "src/gevent/_hub_primitives.py":100 + * class _WaitIterator(object): + * + * def __init__(self, objects, hub, timeout, count): # <<<<<<<<<<<<<< + * self._hub = hub + * self._waiter = MultipleWaiter(hub) # pylint:disable=undefined-variable + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("gevent.__hub_primitives._WaitIterator.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_hub_primitives.py":115 + * self._count = len(objects) if count is None else min(count, len(objects)) + * + * def _begin(self): # <<<<<<<<<<<<<< + * if self._begun: + * return + */ + +static PyObject *__pyx_f_6gevent_16__hub_primitives_13_WaitIterator__begin(struct __pyx_obj_6gevent_16__hub_primitives__WaitIterator *__pyx_v_self) { + PyObject *__pyx_v_obj = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + PyObject *(*__pyx_t_4)(PyObject *); + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + int __pyx_t_8; + int __pyx_t_9; + __Pyx_RefNannySetupContext("_begin", 0); + + /* "src/gevent/_hub_primitives.py":116 + * + * def _begin(self): + * if self._begun: # <<<<<<<<<<<<<< + * return + * + */ + __pyx_t_1 = (__pyx_v_self->_begun != 0); + if (__pyx_t_1) { + + /* "src/gevent/_hub_primitives.py":117 + * def _begin(self): + * if self._begun: + * return # <<<<<<<<<<<<<< + * + * self._begun = True + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + + /* "src/gevent/_hub_primitives.py":116 + * + * def _begin(self): + * if self._begun: # <<<<<<<<<<<<<< + * return + * + */ + } + + /* "src/gevent/_hub_primitives.py":119 + * return + * + * self._begun = True # <<<<<<<<<<<<<< + * + * # XXX: If iteration doesn't actually happen, we + */ + __pyx_v_self->_begun = 1; + + /* "src/gevent/_hub_primitives.py":123 + * # XXX: If iteration doesn't actually happen, we + * # could leave these links around! + * for obj in self._objects: # <<<<<<<<<<<<<< + * obj.rawlink(self._switch) + * + */ + if (likely(PyList_CheckExact(__pyx_v_self->_objects)) || PyTuple_CheckExact(__pyx_v_self->_objects)) { + __pyx_t_2 = __pyx_v_self->_objects; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; + __pyx_t_4 = NULL; + } else { + __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_self->_objects); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 123, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 123, __pyx_L1_error) + } + for (;;) { + if (likely(!__pyx_t_4)) { + if (likely(PyList_CheckExact(__pyx_t_2))) { + if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 123, __pyx_L1_error) + #else + __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 123, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + #endif + } else { + if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 123, __pyx_L1_error) + #else + __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 123, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + #endif + } + } else { + __pyx_t_5 = __pyx_t_4(__pyx_t_2); + if (unlikely(!__pyx_t_5)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(0, 123, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_5); + } + __Pyx_XDECREF_SET(__pyx_v_obj, __pyx_t_5); + __pyx_t_5 = 0; + + /* "src/gevent/_hub_primitives.py":124 + * # could leave these links around! + * for obj in self._objects: + * obj.rawlink(self._switch) # <<<<<<<<<<<<<< + * + * if self._timeout is not None: + */ + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_rawlink); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 124, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { + __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); + if (likely(__pyx_t_7)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); + __Pyx_INCREF(__pyx_t_7); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_6, function); + } + } + __pyx_t_5 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_v_self->_switch) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_self->_switch); + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 124, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "src/gevent/_hub_primitives.py":123 + * # XXX: If iteration doesn't actually happen, we + * # could leave these links around! + * for obj in self._objects: # <<<<<<<<<<<<<< + * obj.rawlink(self._switch) + * + */ + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/_hub_primitives.py":126 + * obj.rawlink(self._switch) + * + * if self._timeout is not None: # <<<<<<<<<<<<<< + * self._timer = self._hub.loop.timer(self._timeout, priority=-1) + * self._timer.start(self._switch, self) + */ + __pyx_t_1 = (__pyx_v_self->_timeout != Py_None); + __pyx_t_8 = (__pyx_t_1 != 0); + if (__pyx_t_8) { + + /* "src/gevent/_hub_primitives.py":127 + * + * if self._timeout is not None: + * self._timer = self._hub.loop.timer(self._timeout, priority=-1) # <<<<<<<<<<<<<< + * self._timer.start(self._switch, self) + * + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_hub->loop, __pyx_n_s_timer); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 127, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 127, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_self->_timeout); + __Pyx_GIVEREF(__pyx_v_self->_timeout); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_self->_timeout); + __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 127, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_priority, __pyx_int_neg_1) < 0) __PYX_ERR(0, 127, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 127, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_GIVEREF(__pyx_t_7); + __Pyx_GOTREF(__pyx_v_self->_timer); + __Pyx_DECREF(__pyx_v_self->_timer); + __pyx_v_self->_timer = __pyx_t_7; + __pyx_t_7 = 0; + + /* "src/gevent/_hub_primitives.py":128 + * if self._timeout is not None: + * self._timer = self._hub.loop.timer(self._timeout, priority=-1) + * self._timer.start(self._switch, self) # <<<<<<<<<<<<<< + * + * def __iter__(self): + */ + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_timer, __pyx_n_s_start); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 128, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_5 = NULL; + __pyx_t_9 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_6, function); + __pyx_t_9 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_6)) { + PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_self->_switch, ((PyObject *)__pyx_v_self)}; + __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 128, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_t_7); + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) { + PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_self->_switch, ((PyObject *)__pyx_v_self)}; + __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 128, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_t_7); + } else + #endif + { + __pyx_t_2 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 128, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (__pyx_t_5) { + __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5); __pyx_t_5 = NULL; + } + __Pyx_INCREF(__pyx_v_self->_switch); + __Pyx_GIVEREF(__pyx_v_self->_switch); + PyTuple_SET_ITEM(__pyx_t_2, 0+__pyx_t_9, __pyx_v_self->_switch); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_2, 1+__pyx_t_9, ((PyObject *)__pyx_v_self)); + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_2, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 128, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "src/gevent/_hub_primitives.py":126 + * obj.rawlink(self._switch) + * + * if self._timeout is not None: # <<<<<<<<<<<<<< + * self._timer = self._hub.loop.timer(self._timeout, priority=-1) + * self._timer.start(self._switch, self) + */ + } + + /* "src/gevent/_hub_primitives.py":115 + * self._count = len(objects) if count is None else min(count, len(objects)) + * + * def _begin(self): # <<<<<<<<<<<<<< + * if self._begun: + * return + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("gevent.__hub_primitives._WaitIterator._begin", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_obj); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_hub_primitives.py":130 + * self._timer.start(self._switch, self) + * + * def __iter__(self): # <<<<<<<<<<<<<< + * return self + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_16__hub_primitives_13_WaitIterator_3__iter__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_16__hub_primitives_13_WaitIterator_3__iter__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_16__hub_primitives_13_WaitIterator_2__iter__(((struct __pyx_obj_6gevent_16__hub_primitives__WaitIterator *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_16__hub_primitives_13_WaitIterator_2__iter__(struct __pyx_obj_6gevent_16__hub_primitives__WaitIterator *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__iter__", 0); + + /* "src/gevent/_hub_primitives.py":131 + * + * def __iter__(self): + * return self # <<<<<<<<<<<<<< + * + * def __next__(self): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __pyx_r = ((PyObject *)__pyx_v_self); + goto __pyx_L0; + + /* "src/gevent/_hub_primitives.py":130 + * self._timer.start(self._switch, self) + * + * def __iter__(self): # <<<<<<<<<<<<<< + * return self + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_hub_primitives.py":133 + * return self + * + * def __next__(self): # <<<<<<<<<<<<<< + * self._begin() + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_16__hub_primitives_13_WaitIterator_5__next__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_16__hub_primitives_13_WaitIterator_5__next__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__next__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_16__hub_primitives_13_WaitIterator_4__next__(((struct __pyx_obj_6gevent_16__hub_primitives__WaitIterator *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_16__hub_primitives_13_WaitIterator_4__next__(struct __pyx_obj_6gevent_16__hub_primitives__WaitIterator *__pyx_v_self) { + PyObject *__pyx_v_item = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + __Pyx_RefNannySetupContext("__next__", 0); + + /* "src/gevent/_hub_primitives.py":134 + * + * def __next__(self): + * self._begin() # <<<<<<<<<<<<<< + * + * if self._count == 0: + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_16__hub_primitives__WaitIterator *)__pyx_v_self->__pyx_vtab)->_begin(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 134, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_hub_primitives.py":136 + * self._begin() + * + * if self._count == 0: # <<<<<<<<<<<<<< + * # Exhausted + * self._cleanup() + */ + __pyx_t_2 = ((__pyx_v_self->_count == 0) != 0); + if (unlikely(__pyx_t_2)) { + + /* "src/gevent/_hub_primitives.py":138 + * if self._count == 0: + * # Exhausted + * self._cleanup() # <<<<<<<<<<<<<< + * raise StopIteration() + * + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_16__hub_primitives__WaitIterator *)__pyx_v_self->__pyx_vtab)->_cleanup(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 138, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_hub_primitives.py":139 + * # Exhausted + * self._cleanup() + * raise StopIteration() # <<<<<<<<<<<<<< + * + * self._count -= 1 + */ + __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_builtin_StopIteration); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 139, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 139, __pyx_L1_error) + + /* "src/gevent/_hub_primitives.py":136 + * self._begin() + * + * if self._count == 0: # <<<<<<<<<<<<<< + * # Exhausted + * self._cleanup() + */ + } + + /* "src/gevent/_hub_primitives.py":141 + * raise StopIteration() + * + * self._count -= 1 # <<<<<<<<<<<<<< + * try: + * item = self._waiter.get() + */ + __pyx_v_self->_count = (__pyx_v_self->_count - 1); + + /* "src/gevent/_hub_primitives.py":142 + * + * self._count -= 1 + * try: # <<<<<<<<<<<<<< + * item = self._waiter.get() + * self._waiter.clear() + */ + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5); + __Pyx_XGOTREF(__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_4); + __Pyx_XGOTREF(__pyx_t_5); + /*try:*/ { + + /* "src/gevent/_hub_primitives.py":143 + * self._count -= 1 + * try: + * item = self._waiter.get() # <<<<<<<<<<<<<< + * self._waiter.clear() + * if item is self: + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_8__waiter_MultipleWaiter *)__pyx_v_self->_waiter->__pyx_base.__pyx_vtab)->__pyx_base.get(((struct __pyx_obj_6gevent_8__waiter_Waiter *)__pyx_v_self->_waiter), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 143, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_item = __pyx_t_1; + __pyx_t_1 = 0; + + /* "src/gevent/_hub_primitives.py":144 + * try: + * item = self._waiter.get() + * self._waiter.clear() # <<<<<<<<<<<<<< + * if item is self: + * # Timer expired, no more + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_8__waiter_MultipleWaiter *)__pyx_v_self->_waiter->__pyx_base.__pyx_vtab)->__pyx_base.clear(((struct __pyx_obj_6gevent_8__waiter_Waiter *)__pyx_v_self->_waiter), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 144, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_hub_primitives.py":145 + * item = self._waiter.get() + * self._waiter.clear() + * if item is self: # <<<<<<<<<<<<<< + * # Timer expired, no more + * self._cleanup() + */ + __pyx_t_2 = (__pyx_v_item == ((PyObject *)__pyx_v_self)); + __pyx_t_6 = (__pyx_t_2 != 0); + if (unlikely(__pyx_t_6)) { + + /* "src/gevent/_hub_primitives.py":147 + * if item is self: + * # Timer expired, no more + * self._cleanup() # <<<<<<<<<<<<<< + * raise StopIteration() + * return item + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_16__hub_primitives__WaitIterator *)__pyx_v_self->__pyx_vtab)->_cleanup(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 147, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_hub_primitives.py":148 + * # Timer expired, no more + * self._cleanup() + * raise StopIteration() # <<<<<<<<<<<<<< + * return item + * except: + */ + __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_builtin_StopIteration); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 148, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 148, __pyx_L4_error) + + /* "src/gevent/_hub_primitives.py":145 + * item = self._waiter.get() + * self._waiter.clear() + * if item is self: # <<<<<<<<<<<<<< + * # Timer expired, no more + * self._cleanup() + */ + } + + /* "src/gevent/_hub_primitives.py":149 + * self._cleanup() + * raise StopIteration() + * return item # <<<<<<<<<<<<<< + * except: + * self._cleanup() + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_item); + __pyx_r = __pyx_v_item; + goto __pyx_L8_try_return; + + /* "src/gevent/_hub_primitives.py":142 + * + * self._count -= 1 + * try: # <<<<<<<<<<<<<< + * item = self._waiter.get() + * self._waiter.clear() + */ + } + __pyx_L4_error:; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_hub_primitives.py":150 + * raise StopIteration() + * return item + * except: # <<<<<<<<<<<<<< + * self._cleanup() + * raise + */ + /*except:*/ { + __Pyx_AddTraceback("gevent.__hub_primitives._WaitIterator.__next__", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(0, 150, __pyx_L6_except_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GOTREF(__pyx_t_8); + + /* "src/gevent/_hub_primitives.py":151 + * return item + * except: + * self._cleanup() # <<<<<<<<<<<<<< + * raise + * + */ + __pyx_t_9 = ((struct __pyx_vtabstruct_6gevent_16__hub_primitives__WaitIterator *)__pyx_v_self->__pyx_vtab)->_cleanup(__pyx_v_self); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 151, __pyx_L6_except_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "src/gevent/_hub_primitives.py":152 + * except: + * self._cleanup() + * raise # <<<<<<<<<<<<<< + * + * next = __next__ + */ + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_7); + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_ErrRestoreWithState(__pyx_t_1, __pyx_t_7, __pyx_t_8); + __pyx_t_1 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; + __PYX_ERR(0, 152, __pyx_L6_except_error) + } + __pyx_L6_except_error:; + + /* "src/gevent/_hub_primitives.py":142 + * + * self._count -= 1 + * try: # <<<<<<<<<<<<<< + * item = self._waiter.get() + * self._waiter.clear() + */ + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); + goto __pyx_L1_error; + __pyx_L8_try_return:; + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); + goto __pyx_L0; + } + + /* "src/gevent/_hub_primitives.py":133 + * return self + * + * def __next__(self): # <<<<<<<<<<<<<< + * self._begin() + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_AddTraceback("gevent.__hub_primitives._WaitIterator.__next__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_item); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_hub_primitives.py":156 + * next = __next__ + * + * def _cleanup(self): # <<<<<<<<<<<<<< + * if self._timer is not None: + * self._timer.close() + */ + +static PyObject *__pyx_f_6gevent_16__hub_primitives_13_WaitIterator__cleanup(struct __pyx_obj_6gevent_16__hub_primitives__WaitIterator *__pyx_v_self) { + PyObject *__pyx_v_objs = NULL; + PyObject *__pyx_v_aobj = NULL; + PyObject *__pyx_v_unlink = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + Py_ssize_t __pyx_t_6; + PyObject *(*__pyx_t_7)(PyObject *); + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + PyObject *__pyx_t_14 = NULL; + __Pyx_RefNannySetupContext("_cleanup", 0); + + /* "src/gevent/_hub_primitives.py":157 + * + * def _cleanup(self): + * if self._timer is not None: # <<<<<<<<<<<<<< + * self._timer.close() + * self._timer = None + */ + __pyx_t_1 = (__pyx_v_self->_timer != Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "src/gevent/_hub_primitives.py":158 + * def _cleanup(self): + * if self._timer is not None: + * self._timer.close() # <<<<<<<<<<<<<< + * self._timer = None + * + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_timer, __pyx_n_s_close); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 158, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + } + } + __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 158, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "src/gevent/_hub_primitives.py":159 + * if self._timer is not None: + * self._timer.close() + * self._timer = None # <<<<<<<<<<<<<< + * + * objs = self._objects + */ + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->_timer); + __Pyx_DECREF(__pyx_v_self->_timer); + __pyx_v_self->_timer = Py_None; + + /* "src/gevent/_hub_primitives.py":157 + * + * def _cleanup(self): + * if self._timer is not None: # <<<<<<<<<<<<<< + * self._timer.close() + * self._timer = None + */ + } + + /* "src/gevent/_hub_primitives.py":161 + * self._timer = None + * + * objs = self._objects # <<<<<<<<<<<<<< + * self._objects = () + * for aobj in objs: + */ + __pyx_t_3 = __pyx_v_self->_objects; + __Pyx_INCREF(__pyx_t_3); + __pyx_v_objs = __pyx_t_3; + __pyx_t_3 = 0; + + /* "src/gevent/_hub_primitives.py":162 + * + * objs = self._objects + * self._objects = () # <<<<<<<<<<<<<< + * for aobj in objs: + * unlink = getattr(aobj, 'unlink', None) + */ + __Pyx_INCREF(__pyx_empty_tuple); + __Pyx_GIVEREF(__pyx_empty_tuple); + __Pyx_GOTREF(__pyx_v_self->_objects); + __Pyx_DECREF(__pyx_v_self->_objects); + __pyx_v_self->_objects = __pyx_empty_tuple; + + /* "src/gevent/_hub_primitives.py":163 + * objs = self._objects + * self._objects = () + * for aobj in objs: # <<<<<<<<<<<<<< + * unlink = getattr(aobj, 'unlink', None) + * if unlink is not None: + */ + if (likely(PyList_CheckExact(__pyx_v_objs)) || PyTuple_CheckExact(__pyx_v_objs)) { + __pyx_t_3 = __pyx_v_objs; __Pyx_INCREF(__pyx_t_3); __pyx_t_6 = 0; + __pyx_t_7 = NULL; + } else { + __pyx_t_6 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_objs); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 163, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_7 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 163, __pyx_L1_error) + } + for (;;) { + if (likely(!__pyx_t_7)) { + if (likely(PyList_CheckExact(__pyx_t_3))) { + if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_4); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 163, __pyx_L1_error) + #else + __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 163, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + } else { + if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_4); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 163, __pyx_L1_error) + #else + __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 163, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + } + } else { + __pyx_t_4 = __pyx_t_7(__pyx_t_3); + if (unlikely(!__pyx_t_4)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(0, 163, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_4); + } + __Pyx_XDECREF_SET(__pyx_v_aobj, __pyx_t_4); + __pyx_t_4 = 0; + + /* "src/gevent/_hub_primitives.py":164 + * self._objects = () + * for aobj in objs: + * unlink = getattr(aobj, 'unlink', None) # <<<<<<<<<<<<<< + * if unlink is not None: + * try: + */ + __pyx_t_4 = __Pyx_GetAttr3(__pyx_v_aobj, __pyx_n_s_unlink, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 164, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_XDECREF_SET(__pyx_v_unlink, __pyx_t_4); + __pyx_t_4 = 0; + + /* "src/gevent/_hub_primitives.py":165 + * for aobj in objs: + * unlink = getattr(aobj, 'unlink', None) + * if unlink is not None: # <<<<<<<<<<<<<< + * try: + * unlink(self._switch) + */ + __pyx_t_2 = (__pyx_v_unlink != Py_None); + __pyx_t_1 = (__pyx_t_2 != 0); + if (__pyx_t_1) { + + /* "src/gevent/_hub_primitives.py":166 + * unlink = getattr(aobj, 'unlink', None) + * if unlink is not None: + * try: # <<<<<<<<<<<<<< + * unlink(self._switch) + * except: # pylint:disable=bare-except + */ + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); + __Pyx_XGOTREF(__pyx_t_8); + __Pyx_XGOTREF(__pyx_t_9); + __Pyx_XGOTREF(__pyx_t_10); + /*try:*/ { + + /* "src/gevent/_hub_primitives.py":167 + * if unlink is not None: + * try: + * unlink(self._switch) # <<<<<<<<<<<<<< + * except: # pylint:disable=bare-except + * traceback.print_exc() + */ + __Pyx_INCREF(__pyx_v_unlink); + __pyx_t_5 = __pyx_v_unlink; __pyx_t_11 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_5); + if (likely(__pyx_t_11)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_11); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_5, function); + } + } + __pyx_t_4 = (__pyx_t_11) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_11, __pyx_v_self->_switch) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_self->_switch); + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 167, __pyx_L7_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "src/gevent/_hub_primitives.py":166 + * unlink = getattr(aobj, 'unlink', None) + * if unlink is not None: + * try: # <<<<<<<<<<<<<< + * unlink(self._switch) + * except: # pylint:disable=bare-except + */ + } + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + goto __pyx_L14_try_end; + __pyx_L7_error:; + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "src/gevent/_hub_primitives.py":168 + * try: + * unlink(self._switch) + * except: # pylint:disable=bare-except # <<<<<<<<<<<<<< + * traceback.print_exc() + * + */ + /*except:*/ { + __Pyx_AddTraceback("gevent.__hub_primitives._WaitIterator._cleanup", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_5, &__pyx_t_11) < 0) __PYX_ERR(0, 168, __pyx_L9_except_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_11); + + /* "src/gevent/_hub_primitives.py":169 + * unlink(self._switch) + * except: # pylint:disable=bare-except + * traceback.print_exc() # <<<<<<<<<<<<<< + * + * def __enter__(self): + */ + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_6gevent_16__hub_primitives_traceback, __pyx_n_s_print_exc); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 169, __pyx_L9_except_error) + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_14 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_13))) { + __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_13); + if (likely(__pyx_t_14)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13); + __Pyx_INCREF(__pyx_t_14); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_13, function); + } + } + __pyx_t_12 = (__pyx_t_14) ? __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_t_14) : __Pyx_PyObject_CallNoArg(__pyx_t_13); + __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; + if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 169, __pyx_L9_except_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + goto __pyx_L8_exception_handled; + } + __pyx_L9_except_error:; + + /* "src/gevent/_hub_primitives.py":166 + * unlink = getattr(aobj, 'unlink', None) + * if unlink is not None: + * try: # <<<<<<<<<<<<<< + * unlink(self._switch) + * except: # pylint:disable=bare-except + */ + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10); + goto __pyx_L1_error; + __pyx_L8_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10); + __pyx_L14_try_end:; + } + + /* "src/gevent/_hub_primitives.py":165 + * for aobj in objs: + * unlink = getattr(aobj, 'unlink', None) + * if unlink is not None: # <<<<<<<<<<<<<< + * try: + * unlink(self._switch) + */ + } + + /* "src/gevent/_hub_primitives.py":163 + * objs = self._objects + * self._objects = () + * for aobj in objs: # <<<<<<<<<<<<<< + * unlink = getattr(aobj, 'unlink', None) + * if unlink is not None: + */ + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "src/gevent/_hub_primitives.py":156 + * next = __next__ + * + * def _cleanup(self): # <<<<<<<<<<<<<< + * if self._timer is not None: + * self._timer.close() + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_XDECREF(__pyx_t_13); + __Pyx_XDECREF(__pyx_t_14); + __Pyx_AddTraceback("gevent.__hub_primitives._WaitIterator._cleanup", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_objs); + __Pyx_XDECREF(__pyx_v_aobj); + __Pyx_XDECREF(__pyx_v_unlink); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_hub_primitives.py":171 + * traceback.print_exc() + * + * def __enter__(self): # <<<<<<<<<<<<<< + * return self + * + */ + +static PyObject *__pyx_pw_6gevent_16__hub_primitives_13_WaitIterator_7__enter__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_f_6gevent_16__hub_primitives_13_WaitIterator___enter__(struct __pyx_obj_6gevent_16__hub_primitives__WaitIterator *__pyx_v_self, int __pyx_skip_dispatch) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + __Pyx_RefNannySetupContext("__enter__", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0; + if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self)))))); + else { + PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + #endif + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_enter); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 171, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_16__hub_primitives_13_WaitIterator_7__enter__)) { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 171, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0; + if (unlikely(type_dict_guard != tp_dict_version)) { + tp_dict_version = obj_dict_version = 0; + } + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + } + #endif + } + + /* "src/gevent/_hub_primitives.py":172 + * + * def __enter__(self): + * return self # <<<<<<<<<<<<<< + * + * def __exit__(self, typ, value, tb): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __pyx_r = ((PyObject *)__pyx_v_self); + goto __pyx_L0; + + /* "src/gevent/_hub_primitives.py":171 + * traceback.print_exc() + * + * def __enter__(self): # <<<<<<<<<<<<<< + * return self + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("gevent.__hub_primitives._WaitIterator.__enter__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_16__hub_primitives_13_WaitIterator_7__enter__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6gevent_16__hub_primitives_13_WaitIterator_6__enter__[] = "_WaitIterator.__enter__(self)"; +static PyMethodDef __pyx_mdef_6gevent_16__hub_primitives_13_WaitIterator_7__enter__ = {"__enter__", (PyCFunction)__pyx_pw_6gevent_16__hub_primitives_13_WaitIterator_7__enter__, METH_NOARGS, __pyx_doc_6gevent_16__hub_primitives_13_WaitIterator_6__enter__}; +static PyObject *__pyx_pw_6gevent_16__hub_primitives_13_WaitIterator_7__enter__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__enter__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_16__hub_primitives_13_WaitIterator_6__enter__(((struct __pyx_obj_6gevent_16__hub_primitives__WaitIterator *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_16__hub_primitives_13_WaitIterator_6__enter__(struct __pyx_obj_6gevent_16__hub_primitives__WaitIterator *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__enter__", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6gevent_16__hub_primitives_13_WaitIterator___enter__(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 171, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__hub_primitives._WaitIterator.__enter__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_hub_primitives.py":174 + * return self + * + * def __exit__(self, typ, value, tb): # <<<<<<<<<<<<<< + * self._cleanup() + * + */ + +static PyObject *__pyx_pw_6gevent_16__hub_primitives_13_WaitIterator_9__exit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_6gevent_16__hub_primitives_13_WaitIterator___exit__(struct __pyx_obj_6gevent_16__hub_primitives__WaitIterator *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_typ, CYTHON_UNUSED PyObject *__pyx_v_value, CYTHON_UNUSED PyObject *__pyx_v_tb, int __pyx_skip_dispatch) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + __Pyx_RefNannySetupContext("__exit__", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0; + if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self)))))); + else { + PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + #endif + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_exit); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 174, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_16__hub_primitives_13_WaitIterator_9__exit__)) { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; + __pyx_t_5 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_5 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_3)) { + PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_typ, __pyx_v_value, __pyx_v_tb}; + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 174, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GOTREF(__pyx_t_2); + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { + PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_typ, __pyx_v_value, __pyx_v_tb}; + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 174, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GOTREF(__pyx_t_2); + } else + #endif + { + __pyx_t_6 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 174, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (__pyx_t_4) { + __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL; + } + __Pyx_INCREF(__pyx_v_typ); + __Pyx_GIVEREF(__pyx_v_typ); + PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_typ); + __Pyx_INCREF(__pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_value); + __Pyx_INCREF(__pyx_v_tb); + __Pyx_GIVEREF(__pyx_v_tb); + PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_v_tb); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 174, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0; + if (unlikely(type_dict_guard != tp_dict_version)) { + tp_dict_version = obj_dict_version = 0; + } + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + } + #endif + } + + /* "src/gevent/_hub_primitives.py":175 + * + * def __exit__(self, typ, value, tb): + * self._cleanup() # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_16__hub_primitives__WaitIterator *)__pyx_v_self->__pyx_vtab)->_cleanup(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 175, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_hub_primitives.py":174 + * return self + * + * def __exit__(self, typ, value, tb): # <<<<<<<<<<<<<< + * self._cleanup() + * + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("gevent.__hub_primitives._WaitIterator.__exit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_16__hub_primitives_13_WaitIterator_9__exit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6gevent_16__hub_primitives_13_WaitIterator_8__exit__[] = "_WaitIterator.__exit__(self, typ, value, tb)"; +static PyMethodDef __pyx_mdef_6gevent_16__hub_primitives_13_WaitIterator_9__exit__ = {"__exit__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_16__hub_primitives_13_WaitIterator_9__exit__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_16__hub_primitives_13_WaitIterator_8__exit__}; +static PyObject *__pyx_pw_6gevent_16__hub_primitives_13_WaitIterator_9__exit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_typ = 0; + PyObject *__pyx_v_value = 0; + PyObject *__pyx_v_tb = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__exit__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_typ,&__pyx_n_s_value,&__pyx_n_s_tb,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_typ)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, 1); __PYX_ERR(0, 174, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tb)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, 2); __PYX_ERR(0, 174, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__exit__") < 0)) __PYX_ERR(0, 174, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + } + __pyx_v_typ = values[0]; + __pyx_v_value = values[1]; + __pyx_v_tb = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 174, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.__hub_primitives._WaitIterator.__exit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_16__hub_primitives_13_WaitIterator_8__exit__(((struct __pyx_obj_6gevent_16__hub_primitives__WaitIterator *)__pyx_v_self), __pyx_v_typ, __pyx_v_value, __pyx_v_tb); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_16__hub_primitives_13_WaitIterator_8__exit__(struct __pyx_obj_6gevent_16__hub_primitives__WaitIterator *__pyx_v_self, PyObject *__pyx_v_typ, PyObject *__pyx_v_value, PyObject *__pyx_v_tb) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__exit__", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6gevent_16__hub_primitives_13_WaitIterator___exit__(__pyx_v_self, __pyx_v_typ, __pyx_v_value, __pyx_v_tb, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 174, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__hub_primitives._WaitIterator.__exit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_hub_primitives.py":178 + * + * + * def iwait_on_objects(objects, timeout=None, count=None): # <<<<<<<<<<<<<< + * """ + * Iteratively yield *objects* as they are ready, until all (or *count*) are ready + */ + +static PyObject *__pyx_pw_6gevent_16__hub_primitives_1iwait_on_objects(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_6gevent_16__hub_primitives_iwait_on_objects(PyObject *__pyx_v_objects, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_16__hub_primitives_iwait_on_objects *__pyx_optional_args) { + PyObject *__pyx_v_timeout = ((PyObject *)Py_None); + PyObject *__pyx_v_count = ((PyObject *)Py_None); + struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *__pyx_v_hub = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + __Pyx_RefNannySetupContext("iwait_on_objects", 0); + if (__pyx_optional_args) { + if (__pyx_optional_args->__pyx_n > 0) { + __pyx_v_timeout = __pyx_optional_args->timeout; + if (__pyx_optional_args->__pyx_n > 1) { + __pyx_v_count = __pyx_optional_args->count; + } + } + } + + /* "src/gevent/_hub_primitives.py":211 + * """ + * # QQQ would be nice to support iterable here that can be generated slowly (why?) + * hub = get_hub() # <<<<<<<<<<<<<< + * if objects is None: + * return [hub.join(timeout=timeout)] + */ + __pyx_t_1 = ((PyObject *)__pyx_f_6gevent_11__hub_local_get_hub_noargs(0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 211, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_hub = ((struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "src/gevent/_hub_primitives.py":212 + * # QQQ would be nice to support iterable here that can be generated slowly (why?) + * hub = get_hub() + * if objects is None: # <<<<<<<<<<<<<< + * return [hub.join(timeout=timeout)] + * return _WaitIterator(objects, hub, timeout, count) + */ + __pyx_t_2 = (__pyx_v_objects == Py_None); + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "src/gevent/_hub_primitives.py":213 + * hub = get_hub() + * if objects is None: + * return [hub.join(timeout=timeout)] # <<<<<<<<<<<<<< + * return _WaitIterator(objects, hub, timeout, count) + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_hub), __pyx_n_s_join); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 213, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 213, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_timeout, __pyx_v_timeout) < 0) __PYX_ERR(0, 213, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 213, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 213, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_5); + PyList_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); + __pyx_t_5 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + + /* "src/gevent/_hub_primitives.py":212 + * # QQQ would be nice to support iterable here that can be generated slowly (why?) + * hub = get_hub() + * if objects is None: # <<<<<<<<<<<<<< + * return [hub.join(timeout=timeout)] + * return _WaitIterator(objects, hub, timeout, count) + */ + } + + /* "src/gevent/_hub_primitives.py":214 + * if objects is None: + * return [hub.join(timeout=timeout)] + * return _WaitIterator(objects, hub, timeout, count) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = PyTuple_New(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 214, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_objects); + __Pyx_GIVEREF(__pyx_v_objects); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_objects); + __Pyx_INCREF(((PyObject *)__pyx_v_hub)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_hub)); + PyTuple_SET_ITEM(__pyx_t_4, 1, ((PyObject *)__pyx_v_hub)); + __Pyx_INCREF(__pyx_v_timeout); + __Pyx_GIVEREF(__pyx_v_timeout); + PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_timeout); + __Pyx_INCREF(__pyx_v_count); + __Pyx_GIVEREF(__pyx_v_count); + PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_v_count); + __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6gevent_16__hub_primitives__WaitIterator), __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 214, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L0; + + /* "src/gevent/_hub_primitives.py":178 + * + * + * def iwait_on_objects(objects, timeout=None, count=None): # <<<<<<<<<<<<<< + * """ + * Iteratively yield *objects* as they are ready, until all (or *count*) are ready + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("gevent.__hub_primitives.iwait_on_objects", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_hub); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_16__hub_primitives_1iwait_on_objects(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6gevent_16__hub_primitives_iwait_on_objects[] = "iwait_on_objects(objects, timeout=None, count=None)\n\n Iteratively yield *objects* as they are ready, until all (or *count*) are ready\n or *timeout* expired.\n\n If you will only be consuming a portion of the *objects*, you should\n do so inside a ``with`` block on this object to avoid leaking resources::\n\n with gevent.iwait((a, b, c)) as it:\n for i in it:\n if i is a:\n break\n\n :param objects: A sequence (supporting :func:`len`) containing objects\n implementing the wait protocol (rawlink() and unlink()).\n :keyword int count: If not `None`, then a number specifying the maximum number\n of objects to wait for. If ``None`` (the default), all objects\n are waited for.\n :keyword float timeout: If given, specifies a maximum number of seconds\n to wait. If the timeout expires before the desired waited-for objects\n are available, then this method returns immediately.\n\n .. seealso:: :func:`wait`\n\n .. versionchanged:: 1.1a1\n Add the *count* parameter.\n .. versionchanged:: 1.1a2\n No longer raise :exc:`LoopExit` if our caller switches greenlets\n in between items yielded by this function.\n .. versionchanged:: 1.4\n Add support to use the returned object as a context manager.\n "; +static PyMethodDef __pyx_mdef_6gevent_16__hub_primitives_1iwait_on_objects = {"iwait_on_objects", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_16__hub_primitives_1iwait_on_objects, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_16__hub_primitives_iwait_on_objects}; +static PyObject *__pyx_pw_6gevent_16__hub_primitives_1iwait_on_objects(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_objects = 0; + PyObject *__pyx_v_timeout = 0; + PyObject *__pyx_v_count = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("iwait_on_objects (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_objects,&__pyx_n_s_timeout,&__pyx_n_s_count,0}; + PyObject* values[3] = {0,0,0}; + values[1] = ((PyObject *)Py_None); + values[2] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_objects)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_timeout); + if (value) { values[1] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 2: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_count); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "iwait_on_objects") < 0)) __PYX_ERR(0, 178, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_objects = values[0]; + __pyx_v_timeout = values[1]; + __pyx_v_count = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("iwait_on_objects", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 178, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.__hub_primitives.iwait_on_objects", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_16__hub_primitives_iwait_on_objects(__pyx_self, __pyx_v_objects, __pyx_v_timeout, __pyx_v_count); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_16__hub_primitives_iwait_on_objects(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_objects, PyObject *__pyx_v_timeout, PyObject *__pyx_v_count) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + struct __pyx_opt_args_6gevent_16__hub_primitives_iwait_on_objects __pyx_t_2; + __Pyx_RefNannySetupContext("iwait_on_objects", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_2.__pyx_n = 2; + __pyx_t_2.timeout = __pyx_v_timeout; + __pyx_t_2.count = __pyx_v_count; + __pyx_t_1 = __pyx_f_6gevent_16__hub_primitives_iwait_on_objects(__pyx_v_objects, 0, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 178, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__hub_primitives.iwait_on_objects", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_hub_primitives.py":217 + * + * + * def wait_on_objects(objects=None, timeout=None, count=None): # <<<<<<<<<<<<<< + * """ + * Wait for ``objects`` to become ready or for event loop to finish. + */ + +static PyObject *__pyx_pw_6gevent_16__hub_primitives_3wait_on_objects(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_6gevent_16__hub_primitives_wait_on_objects(CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_16__hub_primitives_wait_on_objects *__pyx_optional_args) { + PyObject *__pyx_v_objects = ((PyObject *)Py_None); + PyObject *__pyx_v_timeout = ((PyObject *)Py_None); + PyObject *__pyx_v_count = ((PyObject *)Py_None); + struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *__pyx_v_hub = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + struct __pyx_opt_args_6gevent_16__hub_primitives_iwait_on_objects __pyx_t_6; + __Pyx_RefNannySetupContext("wait_on_objects", 0); + if (__pyx_optional_args) { + if (__pyx_optional_args->__pyx_n > 0) { + __pyx_v_objects = __pyx_optional_args->objects; + if (__pyx_optional_args->__pyx_n > 1) { + __pyx_v_timeout = __pyx_optional_args->timeout; + if (__pyx_optional_args->__pyx_n > 2) { + __pyx_v_count = __pyx_optional_args->count; + } + } + } + } + + /* "src/gevent/_hub_primitives.py":251 + * .. seealso:: :func:`iwait` + * """ + * if objects is None: # <<<<<<<<<<<<<< + * hub = get_hub() + * return hub.join(timeout=timeout) # pylint:disable= + */ + __pyx_t_1 = (__pyx_v_objects == Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "src/gevent/_hub_primitives.py":252 + * """ + * if objects is None: + * hub = get_hub() # <<<<<<<<<<<<<< + * return hub.join(timeout=timeout) # pylint:disable= + * return list(iwait_on_objects(objects, timeout, count)) + */ + __pyx_t_3 = ((PyObject *)__pyx_f_6gevent_11__hub_local_get_hub_noargs(0)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 252, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_v_hub = ((struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *)__pyx_t_3); + __pyx_t_3 = 0; + + /* "src/gevent/_hub_primitives.py":253 + * if objects is None: + * hub = get_hub() + * return hub.join(timeout=timeout) # pylint:disable= # <<<<<<<<<<<<<< + * return list(iwait_on_objects(objects, timeout, count)) + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_hub), __pyx_n_s_join); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 253, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 253, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_timeout, __pyx_v_timeout) < 0) __PYX_ERR(0, 253, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 253, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L0; + + /* "src/gevent/_hub_primitives.py":251 + * .. seealso:: :func:`iwait` + * """ + * if objects is None: # <<<<<<<<<<<<<< + * hub = get_hub() + * return hub.join(timeout=timeout) # pylint:disable= + */ + } + + /* "src/gevent/_hub_primitives.py":254 + * hub = get_hub() + * return hub.join(timeout=timeout) # pylint:disable= + * return list(iwait_on_objects(objects, timeout, count)) # <<<<<<<<<<<<<< + * + * _timeout_error = Exception + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_6.__pyx_n = 2; + __pyx_t_6.timeout = __pyx_v_timeout; + __pyx_t_6.count = __pyx_v_count; + __pyx_t_5 = __pyx_f_6gevent_16__hub_primitives_iwait_on_objects(__pyx_v_objects, 0, &__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 254, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = PySequence_List(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 254, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + + /* "src/gevent/_hub_primitives.py":217 + * + * + * def wait_on_objects(objects=None, timeout=None, count=None): # <<<<<<<<<<<<<< + * """ + * Wait for ``objects`` to become ready or for event loop to finish. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("gevent.__hub_primitives.wait_on_objects", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_hub); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_16__hub_primitives_3wait_on_objects(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6gevent_16__hub_primitives_2wait_on_objects[] = "wait_on_objects(objects=None, timeout=None, count=None)\n\n Wait for ``objects`` to become ready or for event loop to finish.\n\n If ``objects`` is provided, it must be a list containing objects\n implementing the wait protocol (rawlink() and unlink() methods):\n\n - :class:`gevent.Greenlet` instance\n - :class:`gevent.event.Event` instance\n - :class:`gevent.lock.Semaphore` instance\n - :class:`gevent.subprocess.Popen` instance\n\n If ``objects`` is ``None`` (the default), ``wait()`` blocks until\n the current event loop has nothing to do (or until ``timeout`` passes):\n\n - all greenlets have finished\n - all servers were stopped\n - all event loop watchers were stopped.\n\n If ``count`` is ``None`` (the default), wait for all ``objects``\n to become ready.\n\n If ``count`` is a number, wait for (up to) ``count`` objects to become\n ready. (For example, if count is ``1`` then the function exits\n when any object in the list is ready).\n\n If ``timeout`` is provided, it specifies the maximum number of\n seconds ``wait()`` will block.\n\n Returns the list of ready objects, in the order in which they were\n ready.\n\n .. seealso:: :func:`iwait`\n "; +static PyMethodDef __pyx_mdef_6gevent_16__hub_primitives_3wait_on_objects = {"wait_on_objects", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_16__hub_primitives_3wait_on_objects, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_16__hub_primitives_2wait_on_objects}; +static PyObject *__pyx_pw_6gevent_16__hub_primitives_3wait_on_objects(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_objects = 0; + PyObject *__pyx_v_timeout = 0; + PyObject *__pyx_v_count = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("wait_on_objects (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_objects,&__pyx_n_s_timeout,&__pyx_n_s_count,0}; + PyObject* values[3] = {0,0,0}; + values[0] = ((PyObject *)Py_None); + values[1] = ((PyObject *)Py_None); + values[2] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_objects); + if (value) { values[0] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 1: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_timeout); + if (value) { values[1] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 2: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_count); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "wait_on_objects") < 0)) __PYX_ERR(0, 217, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_objects = values[0]; + __pyx_v_timeout = values[1]; + __pyx_v_count = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("wait_on_objects", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 217, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.__hub_primitives.wait_on_objects", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_16__hub_primitives_2wait_on_objects(__pyx_self, __pyx_v_objects, __pyx_v_timeout, __pyx_v_count); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_16__hub_primitives_2wait_on_objects(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_objects, PyObject *__pyx_v_timeout, PyObject *__pyx_v_count) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + struct __pyx_opt_args_6gevent_16__hub_primitives_wait_on_objects __pyx_t_2; + __Pyx_RefNannySetupContext("wait_on_objects", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_2.__pyx_n = 3; + __pyx_t_2.objects = __pyx_v_objects; + __pyx_t_2.timeout = __pyx_v_timeout; + __pyx_t_2.count = __pyx_v_count; + __pyx_t_1 = __pyx_f_6gevent_16__hub_primitives_wait_on_objects(0, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 217, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__hub_primitives.wait_on_objects", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_hub_primitives.py":258 + * _timeout_error = Exception + * + * def set_default_timeout_error(e): # <<<<<<<<<<<<<< + * global _timeout_error + * _timeout_error = e + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_16__hub_primitives_5set_default_timeout_error(PyObject *__pyx_self, PyObject *__pyx_v_e); /*proto*/ +static char __pyx_doc_6gevent_16__hub_primitives_4set_default_timeout_error[] = "set_default_timeout_error(e)"; +static PyMethodDef __pyx_mdef_6gevent_16__hub_primitives_5set_default_timeout_error = {"set_default_timeout_error", (PyCFunction)__pyx_pw_6gevent_16__hub_primitives_5set_default_timeout_error, METH_O, __pyx_doc_6gevent_16__hub_primitives_4set_default_timeout_error}; +static PyObject *__pyx_pw_6gevent_16__hub_primitives_5set_default_timeout_error(PyObject *__pyx_self, PyObject *__pyx_v_e) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("set_default_timeout_error (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_16__hub_primitives_4set_default_timeout_error(__pyx_self, ((PyObject *)__pyx_v_e)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_16__hub_primitives_4set_default_timeout_error(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_e) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("set_default_timeout_error", 0); + + /* "src/gevent/_hub_primitives.py":260 + * def set_default_timeout_error(e): + * global _timeout_error + * _timeout_error = e # <<<<<<<<<<<<<< + * + * def _primitive_wait(watcher, timeout, timeout_exc, hub): + */ + __Pyx_INCREF(__pyx_v_e); + __Pyx_XGOTREF(__pyx_v_6gevent_16__hub_primitives__timeout_error); + __Pyx_DECREF_SET(__pyx_v_6gevent_16__hub_primitives__timeout_error, __pyx_v_e); + __Pyx_GIVEREF(__pyx_v_e); + + /* "src/gevent/_hub_primitives.py":258 + * _timeout_error = Exception + * + * def set_default_timeout_error(e): # <<<<<<<<<<<<<< + * global _timeout_error + * _timeout_error = e + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_hub_primitives.py":262 + * _timeout_error = e + * + * def _primitive_wait(watcher, timeout, timeout_exc, hub): # <<<<<<<<<<<<<< + * if watcher.callback is not None: + * raise ConcurrentObjectUseError('This socket is already used by another greenlet: %r' + */ + +static PyObject *__pyx_f_6gevent_16__hub_primitives__primitive_wait(PyObject *__pyx_v_watcher, PyObject *__pyx_v_timeout, PyObject *__pyx_v_timeout_exc, struct __pyx_obj_6gevent_16__hub_primitives_WaitOperationsGreenlet *__pyx_v_hub) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + int __pyx_t_10; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + PyObject *__pyx_t_14 = NULL; + PyObject *__pyx_t_15 = NULL; + __Pyx_RefNannySetupContext("_primitive_wait", 0); + __Pyx_INCREF(__pyx_v_timeout); + __Pyx_INCREF((PyObject *)__pyx_v_hub); + + /* "src/gevent/_hub_primitives.py":263 + * + * def _primitive_wait(watcher, timeout, timeout_exc, hub): + * if watcher.callback is not None: # <<<<<<<<<<<<<< + * raise ConcurrentObjectUseError('This socket is already used by another greenlet: %r' + * % (watcher.callback, )) + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_watcher, __pyx_n_s_callback); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 263, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = (__pyx_t_1 != Py_None); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = (__pyx_t_2 != 0); + if (unlikely(__pyx_t_3)) { + + /* "src/gevent/_hub_primitives.py":264 + * def _primitive_wait(watcher, timeout, timeout_exc, hub): + * if watcher.callback is not None: + * raise ConcurrentObjectUseError('This socket is already used by another greenlet: %r' # <<<<<<<<<<<<<< + * % (watcher.callback, )) + * + */ + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ConcurrentObjectUseError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 264, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + + /* "src/gevent/_hub_primitives.py":265 + * if watcher.callback is not None: + * raise ConcurrentObjectUseError('This socket is already used by another greenlet: %r' + * % (watcher.callback, )) # <<<<<<<<<<<<<< + * + * if hub is None: + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_watcher, __pyx_n_s_callback); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 265, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 265, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_This_socket_is_already_used_by_a, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 265, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_6)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + } + } + __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_6, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 264, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 264, __pyx_L1_error) + + /* "src/gevent/_hub_primitives.py":263 + * + * def _primitive_wait(watcher, timeout, timeout_exc, hub): + * if watcher.callback is not None: # <<<<<<<<<<<<<< + * raise ConcurrentObjectUseError('This socket is already used by another greenlet: %r' + * % (watcher.callback, )) + */ + } + + /* "src/gevent/_hub_primitives.py":267 + * % (watcher.callback, )) + * + * if hub is None: # <<<<<<<<<<<<<< + * hub = get_hub() + * + */ + __pyx_t_3 = (((PyObject *)__pyx_v_hub) == Py_None); + __pyx_t_2 = (__pyx_t_3 != 0); + if (__pyx_t_2) { + + /* "src/gevent/_hub_primitives.py":268 + * + * if hub is None: + * hub = get_hub() # <<<<<<<<<<<<<< + * + * if timeout is None: + */ + __pyx_t_1 = ((PyObject *)__pyx_f_6gevent_11__hub_local_get_hub_noargs(0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 268, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_6gevent_16__hub_primitives_WaitOperationsGreenlet))))) __PYX_ERR(0, 268, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_hub, ((struct __pyx_obj_6gevent_16__hub_primitives_WaitOperationsGreenlet *)__pyx_t_1)); + __pyx_t_1 = 0; + + /* "src/gevent/_hub_primitives.py":267 + * % (watcher.callback, )) + * + * if hub is None: # <<<<<<<<<<<<<< + * hub = get_hub() + * + */ + } + + /* "src/gevent/_hub_primitives.py":270 + * hub = get_hub() + * + * if timeout is None: # <<<<<<<<<<<<<< + * hub.wait(watcher) + * return + */ + __pyx_t_2 = (__pyx_v_timeout == Py_None); + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "src/gevent/_hub_primitives.py":271 + * + * if timeout is None: + * hub.wait(watcher) # <<<<<<<<<<<<<< + * return + * + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_16__hub_primitives_WaitOperationsGreenlet *)__pyx_v_hub->__pyx_base.__pyx_vtab)->wait(__pyx_v_hub, __pyx_v_watcher, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 271, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_hub_primitives.py":272 + * if timeout is None: + * hub.wait(watcher) + * return # <<<<<<<<<<<<<< + * + * timeout = Timeout._start_new_or_dummy( + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + + /* "src/gevent/_hub_primitives.py":270 + * hub = get_hub() + * + * if timeout is None: # <<<<<<<<<<<<<< + * hub.wait(watcher) + * return + */ + } + + /* "src/gevent/_hub_primitives.py":274 + * return + * + * timeout = Timeout._start_new_or_dummy( # <<<<<<<<<<<<<< + * timeout, + * (timeout_exc + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_6gevent_16__hub_primitives_Timeout, __pyx_n_s_start_new_or_dummy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 274, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + + /* "src/gevent/_hub_primitives.py":277 + * timeout, + * (timeout_exc + * if timeout_exc is not _NONE or timeout is None # <<<<<<<<<<<<<< + * else _timeout_error('timed out'))) + * + */ + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_NONE); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 277, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_2 = (__pyx_v_timeout_exc != __pyx_t_6); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_7 = (__pyx_t_2 != 0); + if (!__pyx_t_7) { + } else { + __pyx_t_3 = __pyx_t_7; + goto __pyx_L6_bool_binop_done; + } + __pyx_t_7 = (__pyx_v_timeout == Py_None); + __pyx_t_2 = (__pyx_t_7 != 0); + __pyx_t_3 = __pyx_t_2; + __pyx_L6_bool_binop_done:; + if (__pyx_t_3) { + + /* "src/gevent/_hub_primitives.py":276 + * timeout = Timeout._start_new_or_dummy( + * timeout, + * (timeout_exc # <<<<<<<<<<<<<< + * if timeout_exc is not _NONE or timeout is None + * else _timeout_error('timed out'))) + */ + __Pyx_INCREF(__pyx_v_timeout_exc); + __pyx_t_5 = __pyx_v_timeout_exc; + } else { + + /* "src/gevent/_hub_primitives.py":278 + * (timeout_exc + * if timeout_exc is not _NONE or timeout is None + * else _timeout_error('timed out'))) # <<<<<<<<<<<<<< + * + * with timeout: + */ + __Pyx_INCREF(__pyx_v_6gevent_16__hub_primitives__timeout_error); + __pyx_t_8 = __pyx_v_6gevent_16__hub_primitives__timeout_error; __pyx_t_9 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) { + __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8); + if (likely(__pyx_t_9)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); + __Pyx_INCREF(__pyx_t_9); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_8, function); + } + } + __pyx_t_6 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_9, __pyx_kp_s_timed_out) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_kp_s_timed_out); + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 278, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_5 = __pyx_t_6; + __pyx_t_6 = 0; + } + __pyx_t_6 = NULL; + __pyx_t_10 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_6)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + __pyx_t_10 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_4)) { + PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_timeout, __pyx_t_5}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 274, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { + PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_timeout, __pyx_t_5}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 274, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } else + #endif + { + __pyx_t_8 = PyTuple_New(2+__pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 274, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + if (__pyx_t_6) { + __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL; + } + __Pyx_INCREF(__pyx_v_timeout); + __Pyx_GIVEREF(__pyx_v_timeout); + PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_10, __pyx_v_timeout); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_10, __pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 274, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF_SET(__pyx_v_timeout, __pyx_t_1); + __pyx_t_1 = 0; + + /* "src/gevent/_hub_primitives.py":280 + * else _timeout_error('timed out'))) + * + * with timeout: # <<<<<<<<<<<<<< + * hub.wait(watcher) + * + */ + /*with:*/ { + __pyx_t_11 = __Pyx_PyObject_LookupSpecial(__pyx_v_timeout, __pyx_n_s_exit); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 280, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_4 = __Pyx_PyObject_LookupSpecial(__pyx_v_timeout, __pyx_n_s_enter); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 280, __pyx_L8_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_8 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_8)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_8); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + } + } + __pyx_t_1 = (__pyx_t_8) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_8) : __Pyx_PyObject_CallNoArg(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 280, __pyx_L8_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + /*try:*/ { + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14); + __Pyx_XGOTREF(__pyx_t_12); + __Pyx_XGOTREF(__pyx_t_13); + __Pyx_XGOTREF(__pyx_t_14); + /*try:*/ { + + /* "src/gevent/_hub_primitives.py":281 + * + * with timeout: + * hub.wait(watcher) # <<<<<<<<<<<<<< + * + * # Suitable to be bound as an instance method + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_16__hub_primitives_WaitOperationsGreenlet *)__pyx_v_hub->__pyx_base.__pyx_vtab)->wait(__pyx_v_hub, __pyx_v_watcher, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 281, __pyx_L12_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_hub_primitives.py":280 + * else _timeout_error('timed out'))) + * + * with timeout: # <<<<<<<<<<<<<< + * hub.wait(watcher) + * + */ + } + __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; + goto __pyx_L17_try_end; + __pyx_L12_error:; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + /*except:*/ { + __Pyx_AddTraceback("gevent.__hub_primitives._primitive_wait", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_4, &__pyx_t_8) < 0) __PYX_ERR(0, 280, __pyx_L14_except_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_5 = PyTuple_Pack(3, __pyx_t_1, __pyx_t_4, __pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 280, __pyx_L14_except_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_15 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_5, NULL); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 280, __pyx_L14_except_error) + __Pyx_GOTREF(__pyx_t_15); + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_15); + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + if (__pyx_t_3 < 0) __PYX_ERR(0, 280, __pyx_L14_except_error) + __pyx_t_2 = ((!(__pyx_t_3 != 0)) != 0); + if (__pyx_t_2) { + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_ErrRestoreWithState(__pyx_t_1, __pyx_t_4, __pyx_t_8); + __pyx_t_1 = 0; __pyx_t_4 = 0; __pyx_t_8 = 0; + __PYX_ERR(0, 280, __pyx_L14_except_error) + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + goto __pyx_L13_exception_handled; + } + __pyx_L14_except_error:; + __Pyx_XGIVEREF(__pyx_t_12); + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14); + goto __pyx_L1_error; + __pyx_L13_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_12); + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14); + __pyx_L17_try_end:; + } + } + /*finally:*/ { + /*normal exit:*/{ + if (__pyx_t_11) { + __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_tuple_, NULL); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 280, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_14); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + } + goto __pyx_L11; + } + __pyx_L11:; + } + goto __pyx_L21; + __pyx_L8_error:; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + goto __pyx_L1_error; + __pyx_L21:; + } + + /* "src/gevent/_hub_primitives.py":262 + * _timeout_error = e + * + * def _primitive_wait(watcher, timeout, timeout_exc, hub): # <<<<<<<<<<<<<< + * if watcher.callback is not None: + * raise ConcurrentObjectUseError('This socket is already used by another greenlet: %r' + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_AddTraceback("gevent.__hub_primitives._primitive_wait", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_timeout); + __Pyx_XDECREF((PyObject *)__pyx_v_hub); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_hub_primitives.py":284 + * + * # Suitable to be bound as an instance method + * def wait_on_socket(socket, watcher, timeout_exc=None): # <<<<<<<<<<<<<< + * if socket is None or watcher is None: + * # test__hub TestCloseSocketWhilePolling, on Python 2; Python 3 + */ + +static PyObject *__pyx_pw_6gevent_16__hub_primitives_7wait_on_socket(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_6gevent_16__hub_primitives_wait_on_socket(PyObject *__pyx_v_socket, PyObject *__pyx_v_watcher, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_16__hub_primitives_wait_on_socket *__pyx_optional_args) { + PyObject *__pyx_v_timeout_exc = ((PyObject *)Py_None); + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + __Pyx_RefNannySetupContext("wait_on_socket", 0); + if (__pyx_optional_args) { + if (__pyx_optional_args->__pyx_n > 0) { + __pyx_v_timeout_exc = __pyx_optional_args->timeout_exc; + } + } + + /* "src/gevent/_hub_primitives.py":285 + * # Suitable to be bound as an instance method + * def wait_on_socket(socket, watcher, timeout_exc=None): + * if socket is None or watcher is None: # <<<<<<<<<<<<<< + * # test__hub TestCloseSocketWhilePolling, on Python 2; Python 3 + * # catches the EBADF differently. + */ + __pyx_t_2 = (__pyx_v_socket == Py_None); + __pyx_t_3 = (__pyx_t_2 != 0); + if (!__pyx_t_3) { + } else { + __pyx_t_1 = __pyx_t_3; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_3 = (__pyx_v_watcher == Py_None); + __pyx_t_2 = (__pyx_t_3 != 0); + __pyx_t_1 = __pyx_t_2; + __pyx_L4_bool_binop_done:; + if (unlikely(__pyx_t_1)) { + + /* "src/gevent/_hub_primitives.py":288 + * # test__hub TestCloseSocketWhilePolling, on Python 2; Python 3 + * # catches the EBADF differently. + * raise ConcurrentObjectUseError("The socket has already been closed by another greenlet") # <<<<<<<<<<<<<< + * _primitive_wait(watcher, socket.timeout, + * timeout_exc if timeout_exc is not None else _NONE, + */ + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_ConcurrentObjectUseError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 288, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); + if (likely(__pyx_t_6)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_5, function); + } + } + __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_kp_s_The_socket_has_already_been_clos) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_kp_s_The_socket_has_already_been_clos); + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 288, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __PYX_ERR(0, 288, __pyx_L1_error) + + /* "src/gevent/_hub_primitives.py":285 + * # Suitable to be bound as an instance method + * def wait_on_socket(socket, watcher, timeout_exc=None): + * if socket is None or watcher is None: # <<<<<<<<<<<<<< + * # test__hub TestCloseSocketWhilePolling, on Python 2; Python 3 + * # catches the EBADF differently. + */ + } + + /* "src/gevent/_hub_primitives.py":289 + * # catches the EBADF differently. + * raise ConcurrentObjectUseError("The socket has already been closed by another greenlet") + * _primitive_wait(watcher, socket.timeout, # <<<<<<<<<<<<<< + * timeout_exc if timeout_exc is not None else _NONE, + * socket.hub) + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_socket, __pyx_n_s_timeout); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 289, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + + /* "src/gevent/_hub_primitives.py":290 + * raise ConcurrentObjectUseError("The socket has already been closed by another greenlet") + * _primitive_wait(watcher, socket.timeout, + * timeout_exc if timeout_exc is not None else _NONE, # <<<<<<<<<<<<<< + * socket.hub) + * + */ + __pyx_t_1 = (__pyx_v_timeout_exc != Py_None); + if ((__pyx_t_1 != 0)) { + __Pyx_INCREF(__pyx_v_timeout_exc); + __pyx_t_5 = __pyx_v_timeout_exc; + } else { + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_NONE); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 290, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_5 = __pyx_t_6; + __pyx_t_6 = 0; + } + + /* "src/gevent/_hub_primitives.py":291 + * _primitive_wait(watcher, socket.timeout, + * timeout_exc if timeout_exc is not None else _NONE, + * socket.hub) # <<<<<<<<<<<<<< + * + * def wait_on_watcher(watcher, timeout=None, timeout_exc=_NONE, hub=None): + */ + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_socket, __pyx_n_s_hub); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 291, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_6gevent_16__hub_primitives_WaitOperationsGreenlet))))) __PYX_ERR(0, 291, __pyx_L1_error) + + /* "src/gevent/_hub_primitives.py":289 + * # catches the EBADF differently. + * raise ConcurrentObjectUseError("The socket has already been closed by another greenlet") + * _primitive_wait(watcher, socket.timeout, # <<<<<<<<<<<<<< + * timeout_exc if timeout_exc is not None else _NONE, + * socket.hub) + */ + __pyx_t_7 = __pyx_f_6gevent_16__hub_primitives__primitive_wait(__pyx_v_watcher, __pyx_t_4, __pyx_t_5, ((struct __pyx_obj_6gevent_16__hub_primitives_WaitOperationsGreenlet *)__pyx_t_6)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 289, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "src/gevent/_hub_primitives.py":284 + * + * # Suitable to be bound as an instance method + * def wait_on_socket(socket, watcher, timeout_exc=None): # <<<<<<<<<<<<<< + * if socket is None or watcher is None: + * # test__hub TestCloseSocketWhilePolling, on Python 2; Python 3 + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("gevent.__hub_primitives.wait_on_socket", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_16__hub_primitives_7wait_on_socket(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6gevent_16__hub_primitives_6wait_on_socket[] = "wait_on_socket(socket, watcher, timeout_exc=None)"; +static PyMethodDef __pyx_mdef_6gevent_16__hub_primitives_7wait_on_socket = {"wait_on_socket", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_16__hub_primitives_7wait_on_socket, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_16__hub_primitives_6wait_on_socket}; +static PyObject *__pyx_pw_6gevent_16__hub_primitives_7wait_on_socket(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_socket = 0; + PyObject *__pyx_v_watcher = 0; + PyObject *__pyx_v_timeout_exc = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("wait_on_socket (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_socket,&__pyx_n_s_watcher,&__pyx_n_s_timeout_exc,0}; + PyObject* values[3] = {0,0,0}; + values[2] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_socket)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_watcher)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("wait_on_socket", 0, 2, 3, 1); __PYX_ERR(0, 284, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_timeout_exc); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "wait_on_socket") < 0)) __PYX_ERR(0, 284, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_socket = values[0]; + __pyx_v_watcher = values[1]; + __pyx_v_timeout_exc = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("wait_on_socket", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 284, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.__hub_primitives.wait_on_socket", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_16__hub_primitives_6wait_on_socket(__pyx_self, __pyx_v_socket, __pyx_v_watcher, __pyx_v_timeout_exc); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_16__hub_primitives_6wait_on_socket(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_socket, PyObject *__pyx_v_watcher, PyObject *__pyx_v_timeout_exc) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + struct __pyx_opt_args_6gevent_16__hub_primitives_wait_on_socket __pyx_t_2; + __Pyx_RefNannySetupContext("wait_on_socket", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_2.__pyx_n = 1; + __pyx_t_2.timeout_exc = __pyx_v_timeout_exc; + __pyx_t_1 = __pyx_f_6gevent_16__hub_primitives_wait_on_socket(__pyx_v_socket, __pyx_v_watcher, 0, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 284, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__hub_primitives.wait_on_socket", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_hub_primitives.py":293 + * socket.hub) + * + * def wait_on_watcher(watcher, timeout=None, timeout_exc=_NONE, hub=None): # <<<<<<<<<<<<<< + * """ + * wait(watcher, timeout=None, [timeout_exc=None]) -> None + */ + +static PyObject *__pyx_pw_6gevent_16__hub_primitives_9wait_on_watcher(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_6gevent_16__hub_primitives_wait_on_watcher(PyObject *__pyx_v_watcher, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_16__hub_primitives_wait_on_watcher *__pyx_optional_args) { + PyObject *__pyx_v_timeout = ((PyObject *)Py_None); + PyObject *__pyx_v_timeout_exc = __pyx_k__2; + struct __pyx_obj_6gevent_16__hub_primitives_WaitOperationsGreenlet *__pyx_v_hub = ((struct __pyx_obj_6gevent_16__hub_primitives_WaitOperationsGreenlet *)Py_None); + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("wait_on_watcher", 0); + if (__pyx_optional_args) { + if (__pyx_optional_args->__pyx_n > 0) { + __pyx_v_timeout = __pyx_optional_args->timeout; + if (__pyx_optional_args->__pyx_n > 1) { + __pyx_v_timeout_exc = __pyx_optional_args->timeout_exc; + if (__pyx_optional_args->__pyx_n > 2) { + __pyx_v_hub = __pyx_optional_args->hub; + } + } + } + } + + /* "src/gevent/_hub_primitives.py":317 + * already started. + * """ + * _primitive_wait(watcher, timeout, timeout_exc, hub) # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_1 = __pyx_f_6gevent_16__hub_primitives__primitive_wait(__pyx_v_watcher, __pyx_v_timeout, __pyx_v_timeout_exc, __pyx_v_hub); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 317, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_hub_primitives.py":293 + * socket.hub) + * + * def wait_on_watcher(watcher, timeout=None, timeout_exc=_NONE, hub=None): # <<<<<<<<<<<<<< + * """ + * wait(watcher, timeout=None, [timeout_exc=None]) -> None + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__hub_primitives.wait_on_watcher", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_16__hub_primitives_9wait_on_watcher(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6gevent_16__hub_primitives_8wait_on_watcher[] = "wait_on_watcher(watcher, timeout=None, timeout_exc=_NONE, WaitOperationsGreenlet hub=None)\n\n wait(watcher, timeout=None, [timeout_exc=None]) -> None\n\n Block the current greenlet until *watcher* is ready.\n\n If *timeout* is non-negative, then *timeout_exc* is raised after\n *timeout* second has passed.\n\n If :func:`cancel_wait` is called on *io* by another greenlet,\n raise an exception in this blocking greenlet\n (``socket.error(EBADF, 'File descriptor was closed in another\n greenlet')`` by default).\n\n :param io: An event loop watcher, most commonly an IO watcher obtained from\n :meth:`gevent.core.loop.io`\n :keyword timeout_exc: The exception to raise if the timeout expires.\n By default, a :class:`socket.timeout` exception is raised.\n If you pass a value for this keyword, it is interpreted as for\n :class:`gevent.timeout.Timeout`.\n\n :raises ~gevent.hub.ConcurrentObjectUseError: If the *watcher* is\n already started.\n "; +static PyMethodDef __pyx_mdef_6gevent_16__hub_primitives_9wait_on_watcher = {"wait_on_watcher", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_16__hub_primitives_9wait_on_watcher, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_16__hub_primitives_8wait_on_watcher}; +static PyObject *__pyx_pw_6gevent_16__hub_primitives_9wait_on_watcher(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_watcher = 0; + PyObject *__pyx_v_timeout = 0; + PyObject *__pyx_v_timeout_exc = 0; + struct __pyx_obj_6gevent_16__hub_primitives_WaitOperationsGreenlet *__pyx_v_hub = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("wait_on_watcher (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_watcher,&__pyx_n_s_timeout,&__pyx_n_s_timeout_exc,&__pyx_n_s_hub,0}; + PyObject* values[4] = {0,0,0,0}; + values[1] = ((PyObject *)Py_None); + values[2] = __pyx_k__2; + values[3] = (PyObject *)((struct __pyx_obj_6gevent_16__hub_primitives_WaitOperationsGreenlet *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_watcher)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_timeout); + if (value) { values[1] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 2: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_timeout_exc); + if (value) { values[2] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 3: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_hub); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "wait_on_watcher") < 0)) __PYX_ERR(0, 293, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_watcher = values[0]; + __pyx_v_timeout = values[1]; + __pyx_v_timeout_exc = values[2]; + __pyx_v_hub = ((struct __pyx_obj_6gevent_16__hub_primitives_WaitOperationsGreenlet *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("wait_on_watcher", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 293, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.__hub_primitives.wait_on_watcher", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_hub), __pyx_ptype_6gevent_16__hub_primitives_WaitOperationsGreenlet, 1, "hub", 0))) __PYX_ERR(0, 293, __pyx_L1_error) + __pyx_r = __pyx_pf_6gevent_16__hub_primitives_8wait_on_watcher(__pyx_self, __pyx_v_watcher, __pyx_v_timeout, __pyx_v_timeout_exc, __pyx_v_hub); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_16__hub_primitives_8wait_on_watcher(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_watcher, PyObject *__pyx_v_timeout, PyObject *__pyx_v_timeout_exc, struct __pyx_obj_6gevent_16__hub_primitives_WaitOperationsGreenlet *__pyx_v_hub) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + struct __pyx_opt_args_6gevent_16__hub_primitives_wait_on_watcher __pyx_t_2; + __Pyx_RefNannySetupContext("wait_on_watcher", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_2.__pyx_n = 3; + __pyx_t_2.timeout = __pyx_v_timeout; + __pyx_t_2.timeout_exc = __pyx_v_timeout_exc; + __pyx_t_2.hub = __pyx_v_hub; + __pyx_t_1 = __pyx_f_6gevent_16__hub_primitives_wait_on_watcher(__pyx_v_watcher, 0, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 293, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__hub_primitives.wait_on_watcher", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_hub_primitives.py":320 + * + * + * def wait_read(fileno, timeout=None, timeout_exc=_NONE): # <<<<<<<<<<<<<< + * """ + * wait_read(fileno, timeout=None, [timeout_exc=None]) -> None + */ + +static PyObject *__pyx_pw_6gevent_16__hub_primitives_11wait_read(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_6gevent_16__hub_primitives_wait_read(PyObject *__pyx_v_fileno, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_16__hub_primitives_wait_read *__pyx_optional_args) { + PyObject *__pyx_v_timeout = ((PyObject *)Py_None); + PyObject *__pyx_v_timeout_exc = __pyx_k__3; + struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *__pyx_v_hub = NULL; + PyObject *__pyx_v_io = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + struct __pyx_opt_args_6gevent_16__hub_primitives_wait_on_watcher __pyx_t_6; + int __pyx_t_7; + char const *__pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + PyObject *__pyx_t_14 = NULL; + __Pyx_RefNannySetupContext("wait_read", 0); + if (__pyx_optional_args) { + if (__pyx_optional_args->__pyx_n > 0) { + __pyx_v_timeout = __pyx_optional_args->timeout; + if (__pyx_optional_args->__pyx_n > 1) { + __pyx_v_timeout_exc = __pyx_optional_args->timeout_exc; + } + } + } + + /* "src/gevent/_hub_primitives.py":331 + * .. seealso:: :func:`cancel_wait` + * """ + * hub = get_hub() # <<<<<<<<<<<<<< + * io = hub.loop.io(fileno, 1) + * try: + */ + __pyx_t_1 = ((PyObject *)__pyx_f_6gevent_11__hub_local_get_hub_noargs(0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 331, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_hub = ((struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "src/gevent/_hub_primitives.py":332 + * """ + * hub = get_hub() + * io = hub.loop.io(fileno, 1) # <<<<<<<<<<<<<< + * try: + * return wait_on_watcher(io, timeout, timeout_exc, hub) + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_hub->loop, __pyx_n_s_io); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 332, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + __pyx_t_4 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_4 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_fileno, __pyx_int_1}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 332, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_fileno, __pyx_int_1}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 332, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else + #endif + { + __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 332, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (__pyx_t_3) { + __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL; + } + __Pyx_INCREF(__pyx_v_fileno); + __Pyx_GIVEREF(__pyx_v_fileno); + PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_fileno); + __Pyx_INCREF(__pyx_int_1); + __Pyx_GIVEREF(__pyx_int_1); + PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_int_1); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 332, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_io = __pyx_t_1; + __pyx_t_1 = 0; + + /* "src/gevent/_hub_primitives.py":333 + * hub = get_hub() + * io = hub.loop.io(fileno, 1) + * try: # <<<<<<<<<<<<<< + * return wait_on_watcher(io, timeout, timeout_exc, hub) + * finally: + */ + /*try:*/ { + + /* "src/gevent/_hub_primitives.py":334 + * io = hub.loop.io(fileno, 1) + * try: + * return wait_on_watcher(io, timeout, timeout_exc, hub) # <<<<<<<<<<<<<< + * finally: + * io.close() + */ + __Pyx_XDECREF(__pyx_r); + if (!(likely(((((PyObject *)__pyx_v_hub)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_hub), __pyx_ptype_6gevent_16__hub_primitives_WaitOperationsGreenlet))))) __PYX_ERR(0, 334, __pyx_L4_error) + __pyx_t_6.__pyx_n = 3; + __pyx_t_6.timeout = __pyx_v_timeout; + __pyx_t_6.timeout_exc = __pyx_v_timeout_exc; + __pyx_t_6.hub = ((struct __pyx_obj_6gevent_16__hub_primitives_WaitOperationsGreenlet *)__pyx_v_hub); + __pyx_t_1 = __pyx_f_6gevent_16__hub_primitives_wait_on_watcher(__pyx_v_io, 0, &__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 334, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L3_return; + } + + /* "src/gevent/_hub_primitives.py":336 + * return wait_on_watcher(io, timeout, timeout_exc, hub) + * finally: + * io.close() # <<<<<<<<<<<<<< + * + * + */ + /*finally:*/ { + __pyx_L4_error:; + /*exception exit:*/{ + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14); + if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11) < 0)) __Pyx_ErrFetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); + __Pyx_XGOTREF(__pyx_t_9); + __Pyx_XGOTREF(__pyx_t_10); + __Pyx_XGOTREF(__pyx_t_11); + __Pyx_XGOTREF(__pyx_t_12); + __Pyx_XGOTREF(__pyx_t_13); + __Pyx_XGOTREF(__pyx_t_14); + __pyx_t_4 = __pyx_lineno; __pyx_t_7 = __pyx_clineno; __pyx_t_8 = __pyx_filename; + { + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_io, __pyx_n_s_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 336, __pyx_L7_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 336, __pyx_L7_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + if (PY_MAJOR_VERSION >= 3) { + __Pyx_XGIVEREF(__pyx_t_12); + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14); + } + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_ErrRestore(__pyx_t_9, __pyx_t_10, __pyx_t_11); + __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; + __pyx_lineno = __pyx_t_4; __pyx_clineno = __pyx_t_7; __pyx_filename = __pyx_t_8; + goto __pyx_L1_error; + __pyx_L7_error:; + if (PY_MAJOR_VERSION >= 3) { + __Pyx_XGIVEREF(__pyx_t_12); + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14); + } + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; + goto __pyx_L1_error; + } + __pyx_L3_return: { + __pyx_t_14 = __pyx_r; + __pyx_r = 0; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_io, __pyx_n_s_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 336, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 336, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_14; + __pyx_t_14 = 0; + goto __pyx_L0; + } + } + + /* "src/gevent/_hub_primitives.py":320 + * + * + * def wait_read(fileno, timeout=None, timeout_exc=_NONE): # <<<<<<<<<<<<<< + * """ + * wait_read(fileno, timeout=None, [timeout_exc=None]) -> None + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("gevent.__hub_primitives.wait_read", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_hub); + __Pyx_XDECREF(__pyx_v_io); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_16__hub_primitives_11wait_read(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6gevent_16__hub_primitives_10wait_read[] = "wait_read(fileno, timeout=None, timeout_exc=_NONE)\n\n wait_read(fileno, timeout=None, [timeout_exc=None]) -> None\n\n Block the current greenlet until *fileno* is ready to read.\n\n For the meaning of the other parameters and possible exceptions,\n see :func:`wait`.\n\n .. seealso:: :func:`cancel_wait`\n "; +static PyMethodDef __pyx_mdef_6gevent_16__hub_primitives_11wait_read = {"wait_read", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_16__hub_primitives_11wait_read, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_16__hub_primitives_10wait_read}; +static PyObject *__pyx_pw_6gevent_16__hub_primitives_11wait_read(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_fileno = 0; + PyObject *__pyx_v_timeout = 0; + PyObject *__pyx_v_timeout_exc = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("wait_read (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_fileno,&__pyx_n_s_timeout,&__pyx_n_s_timeout_exc,0}; + PyObject* values[3] = {0,0,0}; + values[1] = ((PyObject *)Py_None); + values[2] = __pyx_k__3; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_fileno)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_timeout); + if (value) { values[1] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 2: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_timeout_exc); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "wait_read") < 0)) __PYX_ERR(0, 320, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_fileno = values[0]; + __pyx_v_timeout = values[1]; + __pyx_v_timeout_exc = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("wait_read", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 320, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.__hub_primitives.wait_read", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_16__hub_primitives_10wait_read(__pyx_self, __pyx_v_fileno, __pyx_v_timeout, __pyx_v_timeout_exc); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_16__hub_primitives_10wait_read(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_fileno, PyObject *__pyx_v_timeout, PyObject *__pyx_v_timeout_exc) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + struct __pyx_opt_args_6gevent_16__hub_primitives_wait_read __pyx_t_2; + __Pyx_RefNannySetupContext("wait_read", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_2.__pyx_n = 2; + __pyx_t_2.timeout = __pyx_v_timeout; + __pyx_t_2.timeout_exc = __pyx_v_timeout_exc; + __pyx_t_1 = __pyx_f_6gevent_16__hub_primitives_wait_read(__pyx_v_fileno, 0, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 320, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__hub_primitives.wait_read", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_hub_primitives.py":339 + * + * + * def wait_write(fileno, timeout=None, timeout_exc=_NONE, event=_NONE): # <<<<<<<<<<<<<< + * """ + * wait_write(fileno, timeout=None, [timeout_exc=None]) -> None + */ + +static PyObject *__pyx_pw_6gevent_16__hub_primitives_13wait_write(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_6gevent_16__hub_primitives_wait_write(PyObject *__pyx_v_fileno, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_16__hub_primitives_wait_write *__pyx_optional_args) { + PyObject *__pyx_v_timeout = ((PyObject *)Py_None); + PyObject *__pyx_v_timeout_exc = __pyx_k__4; + struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *__pyx_v_hub = NULL; + PyObject *__pyx_v_io = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + struct __pyx_opt_args_6gevent_16__hub_primitives_wait_on_watcher __pyx_t_6; + int __pyx_t_7; + char const *__pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + PyObject *__pyx_t_14 = NULL; + __Pyx_RefNannySetupContext("wait_write", 0); + if (__pyx_optional_args) { + if (__pyx_optional_args->__pyx_n > 0) { + __pyx_v_timeout = __pyx_optional_args->timeout; + if (__pyx_optional_args->__pyx_n > 1) { + __pyx_v_timeout_exc = __pyx_optional_args->timeout_exc; + } + } + } + + /* "src/gevent/_hub_primitives.py":355 + * """ + * # pylint:disable=unused-argument + * hub = get_hub() # <<<<<<<<<<<<<< + * io = hub.loop.io(fileno, 2) + * try: + */ + __pyx_t_1 = ((PyObject *)__pyx_f_6gevent_11__hub_local_get_hub_noargs(0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 355, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_hub = ((struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "src/gevent/_hub_primitives.py":356 + * # pylint:disable=unused-argument + * hub = get_hub() + * io = hub.loop.io(fileno, 2) # <<<<<<<<<<<<<< + * try: + * return wait_on_watcher(io, timeout, timeout_exc, hub) + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_hub->loop, __pyx_n_s_io); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 356, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + __pyx_t_4 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_4 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_fileno, __pyx_int_2}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 356, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_fileno, __pyx_int_2}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 356, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else + #endif + { + __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 356, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (__pyx_t_3) { + __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL; + } + __Pyx_INCREF(__pyx_v_fileno); + __Pyx_GIVEREF(__pyx_v_fileno); + PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_fileno); + __Pyx_INCREF(__pyx_int_2); + __Pyx_GIVEREF(__pyx_int_2); + PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_int_2); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 356, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_io = __pyx_t_1; + __pyx_t_1 = 0; + + /* "src/gevent/_hub_primitives.py":357 + * hub = get_hub() + * io = hub.loop.io(fileno, 2) + * try: # <<<<<<<<<<<<<< + * return wait_on_watcher(io, timeout, timeout_exc, hub) + * finally: + */ + /*try:*/ { + + /* "src/gevent/_hub_primitives.py":358 + * io = hub.loop.io(fileno, 2) + * try: + * return wait_on_watcher(io, timeout, timeout_exc, hub) # <<<<<<<<<<<<<< + * finally: + * io.close() + */ + __Pyx_XDECREF(__pyx_r); + if (!(likely(((((PyObject *)__pyx_v_hub)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_hub), __pyx_ptype_6gevent_16__hub_primitives_WaitOperationsGreenlet))))) __PYX_ERR(0, 358, __pyx_L4_error) + __pyx_t_6.__pyx_n = 3; + __pyx_t_6.timeout = __pyx_v_timeout; + __pyx_t_6.timeout_exc = __pyx_v_timeout_exc; + __pyx_t_6.hub = ((struct __pyx_obj_6gevent_16__hub_primitives_WaitOperationsGreenlet *)__pyx_v_hub); + __pyx_t_1 = __pyx_f_6gevent_16__hub_primitives_wait_on_watcher(__pyx_v_io, 0, &__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 358, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L3_return; + } + + /* "src/gevent/_hub_primitives.py":360 + * return wait_on_watcher(io, timeout, timeout_exc, hub) + * finally: + * io.close() # <<<<<<<<<<<<<< + * + * + */ + /*finally:*/ { + __pyx_L4_error:; + /*exception exit:*/{ + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14); + if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11) < 0)) __Pyx_ErrFetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); + __Pyx_XGOTREF(__pyx_t_9); + __Pyx_XGOTREF(__pyx_t_10); + __Pyx_XGOTREF(__pyx_t_11); + __Pyx_XGOTREF(__pyx_t_12); + __Pyx_XGOTREF(__pyx_t_13); + __Pyx_XGOTREF(__pyx_t_14); + __pyx_t_4 = __pyx_lineno; __pyx_t_7 = __pyx_clineno; __pyx_t_8 = __pyx_filename; + { + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_io, __pyx_n_s_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 360, __pyx_L7_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 360, __pyx_L7_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + if (PY_MAJOR_VERSION >= 3) { + __Pyx_XGIVEREF(__pyx_t_12); + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14); + } + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_ErrRestore(__pyx_t_9, __pyx_t_10, __pyx_t_11); + __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; + __pyx_lineno = __pyx_t_4; __pyx_clineno = __pyx_t_7; __pyx_filename = __pyx_t_8; + goto __pyx_L1_error; + __pyx_L7_error:; + if (PY_MAJOR_VERSION >= 3) { + __Pyx_XGIVEREF(__pyx_t_12); + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14); + } + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; + goto __pyx_L1_error; + } + __pyx_L3_return: { + __pyx_t_14 = __pyx_r; + __pyx_r = 0; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_io, __pyx_n_s_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 360, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 360, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_14; + __pyx_t_14 = 0; + goto __pyx_L0; + } + } + + /* "src/gevent/_hub_primitives.py":339 + * + * + * def wait_write(fileno, timeout=None, timeout_exc=_NONE, event=_NONE): # <<<<<<<<<<<<<< + * """ + * wait_write(fileno, timeout=None, [timeout_exc=None]) -> None + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("gevent.__hub_primitives.wait_write", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_hub); + __Pyx_XDECREF(__pyx_v_io); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_16__hub_primitives_13wait_write(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6gevent_16__hub_primitives_12wait_write[] = "wait_write(fileno, timeout=None, timeout_exc=_NONE, event=_NONE)\n\n wait_write(fileno, timeout=None, [timeout_exc=None]) -> None\n\n Block the current greenlet until *fileno* is ready to write.\n\n For the meaning of the other parameters and possible exceptions,\n see :func:`wait`.\n\n .. deprecated:: 1.1\n The keyword argument *event* is ignored. Applications should not pass this parameter.\n In the future, doing so will become an error.\n\n .. seealso:: :func:`cancel_wait`\n "; +static PyMethodDef __pyx_mdef_6gevent_16__hub_primitives_13wait_write = {"wait_write", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_16__hub_primitives_13wait_write, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_16__hub_primitives_12wait_write}; +static PyObject *__pyx_pw_6gevent_16__hub_primitives_13wait_write(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_fileno = 0; + PyObject *__pyx_v_timeout = 0; + PyObject *__pyx_v_timeout_exc = 0; + PyObject *__pyx_v_event = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("wait_write (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_fileno,&__pyx_n_s_timeout,&__pyx_n_s_timeout_exc,&__pyx_n_s_event,0}; + PyObject* values[4] = {0,0,0,0}; + values[1] = ((PyObject *)Py_None); + values[2] = __pyx_k__4; + values[3] = __pyx_k__5; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_fileno)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_timeout); + if (value) { values[1] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 2: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_timeout_exc); + if (value) { values[2] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 3: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_event); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "wait_write") < 0)) __PYX_ERR(0, 339, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_fileno = values[0]; + __pyx_v_timeout = values[1]; + __pyx_v_timeout_exc = values[2]; + __pyx_v_event = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("wait_write", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 339, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.__hub_primitives.wait_write", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_16__hub_primitives_12wait_write(__pyx_self, __pyx_v_fileno, __pyx_v_timeout, __pyx_v_timeout_exc, __pyx_v_event); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_16__hub_primitives_12wait_write(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_fileno, PyObject *__pyx_v_timeout, PyObject *__pyx_v_timeout_exc, PyObject *__pyx_v_event) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + struct __pyx_opt_args_6gevent_16__hub_primitives_wait_write __pyx_t_2; + __Pyx_RefNannySetupContext("wait_write", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_2.__pyx_n = 3; + __pyx_t_2.timeout = __pyx_v_timeout; + __pyx_t_2.timeout_exc = __pyx_v_timeout_exc; + __pyx_t_2.event = __pyx_v_event; + __pyx_t_1 = __pyx_f_6gevent_16__hub_primitives_wait_write(__pyx_v_fileno, 0, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 339, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__hub_primitives.wait_write", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_hub_primitives.py":363 + * + * + * def wait_readwrite(fileno, timeout=None, timeout_exc=_NONE, event=_NONE): # <<<<<<<<<<<<<< + * """ + * wait_readwrite(fileno, timeout=None, [timeout_exc=None]) -> None + */ + +static PyObject *__pyx_pw_6gevent_16__hub_primitives_15wait_readwrite(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_6gevent_16__hub_primitives_wait_readwrite(PyObject *__pyx_v_fileno, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_16__hub_primitives_wait_readwrite *__pyx_optional_args) { + PyObject *__pyx_v_timeout = ((PyObject *)Py_None); + PyObject *__pyx_v_timeout_exc = __pyx_k__6; + struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *__pyx_v_hub = NULL; + PyObject *__pyx_v_io = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + struct __pyx_opt_args_6gevent_16__hub_primitives_wait_on_watcher __pyx_t_6; + int __pyx_t_7; + char const *__pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + PyObject *__pyx_t_14 = NULL; + __Pyx_RefNannySetupContext("wait_readwrite", 0); + if (__pyx_optional_args) { + if (__pyx_optional_args->__pyx_n > 0) { + __pyx_v_timeout = __pyx_optional_args->timeout; + if (__pyx_optional_args->__pyx_n > 1) { + __pyx_v_timeout_exc = __pyx_optional_args->timeout_exc; + } + } + } + + /* "src/gevent/_hub_primitives.py":380 + * """ + * # pylint:disable=unused-argument + * hub = get_hub() # <<<<<<<<<<<<<< + * io = hub.loop.io(fileno, 3) + * try: + */ + __pyx_t_1 = ((PyObject *)__pyx_f_6gevent_11__hub_local_get_hub_noargs(0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 380, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_hub = ((struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "src/gevent/_hub_primitives.py":381 + * # pylint:disable=unused-argument + * hub = get_hub() + * io = hub.loop.io(fileno, 3) # <<<<<<<<<<<<<< + * try: + * return wait_on_watcher(io, timeout, timeout_exc, hub) + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_hub->loop, __pyx_n_s_io); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 381, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + __pyx_t_4 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_4 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_fileno, __pyx_int_3}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 381, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_fileno, __pyx_int_3}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 381, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else + #endif + { + __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 381, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (__pyx_t_3) { + __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL; + } + __Pyx_INCREF(__pyx_v_fileno); + __Pyx_GIVEREF(__pyx_v_fileno); + PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_fileno); + __Pyx_INCREF(__pyx_int_3); + __Pyx_GIVEREF(__pyx_int_3); + PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_int_3); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 381, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_io = __pyx_t_1; + __pyx_t_1 = 0; + + /* "src/gevent/_hub_primitives.py":382 + * hub = get_hub() + * io = hub.loop.io(fileno, 3) + * try: # <<<<<<<<<<<<<< + * return wait_on_watcher(io, timeout, timeout_exc, hub) + * finally: + */ + /*try:*/ { + + /* "src/gevent/_hub_primitives.py":383 + * io = hub.loop.io(fileno, 3) + * try: + * return wait_on_watcher(io, timeout, timeout_exc, hub) # <<<<<<<<<<<<<< + * finally: + * io.close() + */ + __Pyx_XDECREF(__pyx_r); + if (!(likely(((((PyObject *)__pyx_v_hub)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_hub), __pyx_ptype_6gevent_16__hub_primitives_WaitOperationsGreenlet))))) __PYX_ERR(0, 383, __pyx_L4_error) + __pyx_t_6.__pyx_n = 3; + __pyx_t_6.timeout = __pyx_v_timeout; + __pyx_t_6.timeout_exc = __pyx_v_timeout_exc; + __pyx_t_6.hub = ((struct __pyx_obj_6gevent_16__hub_primitives_WaitOperationsGreenlet *)__pyx_v_hub); + __pyx_t_1 = __pyx_f_6gevent_16__hub_primitives_wait_on_watcher(__pyx_v_io, 0, &__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 383, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L3_return; + } + + /* "src/gevent/_hub_primitives.py":385 + * return wait_on_watcher(io, timeout, timeout_exc, hub) + * finally: + * io.close() # <<<<<<<<<<<<<< + * + * + */ + /*finally:*/ { + __pyx_L4_error:; + /*exception exit:*/{ + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14); + if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11) < 0)) __Pyx_ErrFetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); + __Pyx_XGOTREF(__pyx_t_9); + __Pyx_XGOTREF(__pyx_t_10); + __Pyx_XGOTREF(__pyx_t_11); + __Pyx_XGOTREF(__pyx_t_12); + __Pyx_XGOTREF(__pyx_t_13); + __Pyx_XGOTREF(__pyx_t_14); + __pyx_t_4 = __pyx_lineno; __pyx_t_7 = __pyx_clineno; __pyx_t_8 = __pyx_filename; + { + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_io, __pyx_n_s_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 385, __pyx_L7_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 385, __pyx_L7_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + if (PY_MAJOR_VERSION >= 3) { + __Pyx_XGIVEREF(__pyx_t_12); + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14); + } + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_ErrRestore(__pyx_t_9, __pyx_t_10, __pyx_t_11); + __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; + __pyx_lineno = __pyx_t_4; __pyx_clineno = __pyx_t_7; __pyx_filename = __pyx_t_8; + goto __pyx_L1_error; + __pyx_L7_error:; + if (PY_MAJOR_VERSION >= 3) { + __Pyx_XGIVEREF(__pyx_t_12); + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14); + } + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; + goto __pyx_L1_error; + } + __pyx_L3_return: { + __pyx_t_14 = __pyx_r; + __pyx_r = 0; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_io, __pyx_n_s_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 385, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 385, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_14; + __pyx_t_14 = 0; + goto __pyx_L0; + } + } + + /* "src/gevent/_hub_primitives.py":363 + * + * + * def wait_readwrite(fileno, timeout=None, timeout_exc=_NONE, event=_NONE): # <<<<<<<<<<<<<< + * """ + * wait_readwrite(fileno, timeout=None, [timeout_exc=None]) -> None + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("gevent.__hub_primitives.wait_readwrite", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_hub); + __Pyx_XDECREF(__pyx_v_io); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_16__hub_primitives_15wait_readwrite(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6gevent_16__hub_primitives_14wait_readwrite[] = "wait_readwrite(fileno, timeout=None, timeout_exc=_NONE, event=_NONE)\n\n wait_readwrite(fileno, timeout=None, [timeout_exc=None]) -> None\n\n Block the current greenlet until *fileno* is ready to read or\n write.\n\n For the meaning of the other parameters and possible exceptions,\n see :func:`wait`.\n\n .. deprecated:: 1.1\n The keyword argument *event* is ignored. Applications should not pass this parameter.\n In the future, doing so will become an error.\n\n .. seealso:: :func:`cancel_wait`\n "; +static PyMethodDef __pyx_mdef_6gevent_16__hub_primitives_15wait_readwrite = {"wait_readwrite", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_16__hub_primitives_15wait_readwrite, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_16__hub_primitives_14wait_readwrite}; +static PyObject *__pyx_pw_6gevent_16__hub_primitives_15wait_readwrite(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_fileno = 0; + PyObject *__pyx_v_timeout = 0; + PyObject *__pyx_v_timeout_exc = 0; + PyObject *__pyx_v_event = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("wait_readwrite (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_fileno,&__pyx_n_s_timeout,&__pyx_n_s_timeout_exc,&__pyx_n_s_event,0}; + PyObject* values[4] = {0,0,0,0}; + values[1] = ((PyObject *)Py_None); + values[2] = __pyx_k__6; + values[3] = __pyx_k__7; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_fileno)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_timeout); + if (value) { values[1] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 2: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_timeout_exc); + if (value) { values[2] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 3: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_event); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "wait_readwrite") < 0)) __PYX_ERR(0, 363, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_fileno = values[0]; + __pyx_v_timeout = values[1]; + __pyx_v_timeout_exc = values[2]; + __pyx_v_event = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("wait_readwrite", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 363, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.__hub_primitives.wait_readwrite", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_16__hub_primitives_14wait_readwrite(__pyx_self, __pyx_v_fileno, __pyx_v_timeout, __pyx_v_timeout_exc, __pyx_v_event); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_16__hub_primitives_14wait_readwrite(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_fileno, PyObject *__pyx_v_timeout, PyObject *__pyx_v_timeout_exc, PyObject *__pyx_v_event) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + struct __pyx_opt_args_6gevent_16__hub_primitives_wait_readwrite __pyx_t_2; + __Pyx_RefNannySetupContext("wait_readwrite", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_2.__pyx_n = 3; + __pyx_t_2.timeout = __pyx_v_timeout; + __pyx_t_2.timeout_exc = __pyx_v_timeout_exc; + __pyx_t_2.event = __pyx_v_event; + __pyx_t_1 = __pyx_f_6gevent_16__hub_primitives_wait_readwrite(__pyx_v_fileno, 0, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 363, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__hub_primitives.wait_readwrite", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_hub_primitives.py":388 + * + * + * def _init(): # <<<<<<<<<<<<<< + * greenlet_init() # pylint:disable=undefined-variable + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_16__hub_primitives_17_init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6gevent_16__hub_primitives_16_init[] = "_init()"; +static PyMethodDef __pyx_mdef_6gevent_16__hub_primitives_17_init = {"_init", (PyCFunction)__pyx_pw_6gevent_16__hub_primitives_17_init, METH_NOARGS, __pyx_doc_6gevent_16__hub_primitives_16_init}; +static PyObject *__pyx_pw_6gevent_16__hub_primitives_17_init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_init (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_16__hub_primitives_16_init(__pyx_self); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_16__hub_primitives_16_init(CYTHON_UNUSED PyObject *__pyx_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_init", 0); + + /* "src/gevent/_hub_primitives.py":389 + * + * def _init(): + * greenlet_init() # pylint:disable=undefined-variable # <<<<<<<<<<<<<< + * + * _init() + */ + __pyx_f_6gevent_16__hub_primitives_greenlet_init(); + + /* "src/gevent/_hub_primitives.py":388 + * + * + * def _init(): # <<<<<<<<<<<<<< + * greenlet_init() # pylint:disable=undefined-variable + * + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/__greenlet_primitives.pxd":23 + * + * @cython.final + * cdef inline greenlet getcurrent(): # <<<<<<<<<<<<<< + * return PyGreenlet_GetCurrent() + * + */ + +static CYTHON_INLINE PyGreenlet *__pyx_f_6gevent_21__greenlet_primitives_getcurrent(void) { + PyGreenlet *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("getcurrent", 0); + + /* "gevent/__greenlet_primitives.pxd":24 + * @cython.final + * cdef inline greenlet getcurrent(): + * return PyGreenlet_GetCurrent() # <<<<<<<<<<<<<< + * + * cdef bint _greenlet_imported + */ + __Pyx_XDECREF(((PyObject *)__pyx_r)); + __pyx_t_1 = ((PyObject *)PyGreenlet_GetCurrent()); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 24, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = ((PyGreenlet *)__pyx_t_1); + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "gevent/__greenlet_primitives.pxd":23 + * + * @cython.final + * cdef inline greenlet getcurrent(): # <<<<<<<<<<<<<< + * return PyGreenlet_GetCurrent() + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__greenlet_primitives.getcurrent", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF((PyObject *)__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/__greenlet_primitives.pxd":28 + * cdef bint _greenlet_imported + * + * cdef inline void greenlet_init(): # <<<<<<<<<<<<<< + * global _greenlet_imported + * if not _greenlet_imported: + */ + +static CYTHON_INLINE void __pyx_f_6gevent_21__greenlet_primitives_greenlet_init(void) { + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("greenlet_init", 0); + + /* "gevent/__greenlet_primitives.pxd":30 + * cdef inline void greenlet_init(): + * global _greenlet_imported + * if not _greenlet_imported: # <<<<<<<<<<<<<< + * PyGreenlet_Import() + * _greenlet_imported = True + */ + __pyx_t_1 = ((!(__pyx_v_6gevent_21__greenlet_primitives__greenlet_imported != 0)) != 0); + if (__pyx_t_1) { + + /* "gevent/__greenlet_primitives.pxd":31 + * global _greenlet_imported + * if not _greenlet_imported: + * PyGreenlet_Import() # <<<<<<<<<<<<<< + * _greenlet_imported = True + * + */ + PyGreenlet_Import(); + + /* "gevent/__greenlet_primitives.pxd":32 + * if not _greenlet_imported: + * PyGreenlet_Import() + * _greenlet_imported = True # <<<<<<<<<<<<<< + * + * cdef inline object _greenlet_switch(greenlet self): + */ + __pyx_v_6gevent_21__greenlet_primitives__greenlet_imported = 1; + + /* "gevent/__greenlet_primitives.pxd":30 + * cdef inline void greenlet_init(): + * global _greenlet_imported + * if not _greenlet_imported: # <<<<<<<<<<<<<< + * PyGreenlet_Import() + * _greenlet_imported = True + */ + } + + /* "gevent/__greenlet_primitives.pxd":28 + * cdef bint _greenlet_imported + * + * cdef inline void greenlet_init(): # <<<<<<<<<<<<<< + * global _greenlet_imported + * if not _greenlet_imported: + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "gevent/__greenlet_primitives.pxd":34 + * _greenlet_imported = True + * + * cdef inline object _greenlet_switch(greenlet self): # <<<<<<<<<<<<<< + * return PyGreenlet_Switch(self, NULL, NULL) + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_6gevent_21__greenlet_primitives__greenlet_switch(PyGreenlet *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("_greenlet_switch", 0); + + /* "gevent/__greenlet_primitives.pxd":35 + * + * cdef inline object _greenlet_switch(greenlet self): + * return PyGreenlet_Switch(self, NULL, NULL) # <<<<<<<<<<<<<< + * + * cdef class TrackedRawGreenlet(greenlet): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyGreenlet_Switch(__pyx_v_self, NULL, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 35, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "gevent/__greenlet_primitives.pxd":34 + * _greenlet_imported = True + * + * cdef inline object _greenlet_switch(greenlet self): # <<<<<<<<<<<<<< + * return PyGreenlet_Switch(self, NULL, NULL) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__greenlet_primitives._greenlet_switch", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/__waiter.pxd":24 + * void PyGreenlet_Import() + * + * cdef inline greenlet getcurrent(): # <<<<<<<<<<<<<< + * return PyGreenlet_GetCurrent() + * + */ + +static CYTHON_INLINE PyGreenlet *__pyx_f_6gevent_8__waiter_getcurrent(void) { + PyGreenlet *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("getcurrent", 0); + + /* "gevent/__waiter.pxd":25 + * + * cdef inline greenlet getcurrent(): + * return PyGreenlet_GetCurrent() # <<<<<<<<<<<<<< + * + * cdef inline void greenlet_init(): + */ + __Pyx_XDECREF(((PyObject *)__pyx_r)); + __pyx_t_1 = ((PyObject *)PyGreenlet_GetCurrent()); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 25, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = ((PyGreenlet *)__pyx_t_1); + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "gevent/__waiter.pxd":24 + * void PyGreenlet_Import() + * + * cdef inline greenlet getcurrent(): # <<<<<<<<<<<<<< + * return PyGreenlet_GetCurrent() + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__waiter.getcurrent", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF((PyObject *)__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/__waiter.pxd":27 + * return PyGreenlet_GetCurrent() + * + * cdef inline void greenlet_init(): # <<<<<<<<<<<<<< + * global _greenlet_imported + * if not _greenlet_imported: + */ + +static CYTHON_INLINE void __pyx_f_6gevent_8__waiter_greenlet_init(void) { + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("greenlet_init", 0); + + /* "gevent/__waiter.pxd":29 + * cdef inline void greenlet_init(): + * global _greenlet_imported + * if not _greenlet_imported: # <<<<<<<<<<<<<< + * PyGreenlet_Import() + * _greenlet_imported = True + */ + __pyx_t_1 = ((!(__pyx_v_6gevent_8__waiter__greenlet_imported != 0)) != 0); + if (__pyx_t_1) { + + /* "gevent/__waiter.pxd":30 + * global _greenlet_imported + * if not _greenlet_imported: + * PyGreenlet_Import() # <<<<<<<<<<<<<< + * _greenlet_imported = True + * + */ + PyGreenlet_Import(); + + /* "gevent/__waiter.pxd":31 + * if not _greenlet_imported: + * PyGreenlet_Import() + * _greenlet_imported = True # <<<<<<<<<<<<<< + * + * cdef class Waiter: + */ + __pyx_v_6gevent_8__waiter__greenlet_imported = 1; + + /* "gevent/__waiter.pxd":29 + * cdef inline void greenlet_init(): + * global _greenlet_imported + * if not _greenlet_imported: # <<<<<<<<<<<<<< + * PyGreenlet_Import() + * _greenlet_imported = True + */ + } + + /* "gevent/__waiter.pxd":27 + * return PyGreenlet_GetCurrent() + * + * cdef inline void greenlet_init(): # <<<<<<<<<<<<<< + * global _greenlet_imported + * if not _greenlet_imported: + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "gevent/__hub_primitives.pxd":29 + * + * @cython.final + * cdef inline greenlet getcurrent(): # <<<<<<<<<<<<<< + * return PyGreenlet_GetCurrent() + * + */ + +static CYTHON_INLINE PyGreenlet *__pyx_f_6gevent_16__hub_primitives_getcurrent(void) { + PyGreenlet *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("getcurrent", 0); + + /* "gevent/__hub_primitives.pxd":30 + * @cython.final + * cdef inline greenlet getcurrent(): + * return PyGreenlet_GetCurrent() # <<<<<<<<<<<<<< + * + * cdef bint _greenlet_imported + */ + __Pyx_XDECREF(((PyObject *)__pyx_r)); + __pyx_t_1 = ((PyObject *)PyGreenlet_GetCurrent()); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 30, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = ((PyGreenlet *)__pyx_t_1); + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "gevent/__hub_primitives.pxd":29 + * + * @cython.final + * cdef inline greenlet getcurrent(): # <<<<<<<<<<<<<< + * return PyGreenlet_GetCurrent() + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__hub_primitives.getcurrent", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF((PyObject *)__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/__hub_primitives.pxd":34 + * cdef bint _greenlet_imported + * + * cdef inline void greenlet_init(): # <<<<<<<<<<<<<< + * global _greenlet_imported + * if not _greenlet_imported: + */ + +static CYTHON_INLINE void __pyx_f_6gevent_16__hub_primitives_greenlet_init(void) { + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("greenlet_init", 0); + + /* "gevent/__hub_primitives.pxd":36 + * cdef inline void greenlet_init(): + * global _greenlet_imported + * if not _greenlet_imported: # <<<<<<<<<<<<<< + * PyGreenlet_Import() + * _greenlet_imported = True + */ + __pyx_t_1 = ((!(__pyx_v_6gevent_16__hub_primitives__greenlet_imported != 0)) != 0); + if (__pyx_t_1) { + + /* "gevent/__hub_primitives.pxd":37 + * global _greenlet_imported + * if not _greenlet_imported: + * PyGreenlet_Import() # <<<<<<<<<<<<<< + * _greenlet_imported = True + * + */ + PyGreenlet_Import(); + + /* "gevent/__hub_primitives.pxd":38 + * if not _greenlet_imported: + * PyGreenlet_Import() + * _greenlet_imported = True # <<<<<<<<<<<<<< + * + * + */ + __pyx_v_6gevent_16__hub_primitives__greenlet_imported = 1; + + /* "gevent/__hub_primitives.pxd":36 + * cdef inline void greenlet_init(): + * global _greenlet_imported + * if not _greenlet_imported: # <<<<<<<<<<<<<< + * PyGreenlet_Import() + * _greenlet_imported = True + */ + } + + /* "gevent/__hub_primitives.pxd":34 + * cdef bint _greenlet_imported + * + * cdef inline void greenlet_init(): # <<<<<<<<<<<<<< + * global _greenlet_imported + * if not _greenlet_imported: + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} +static struct __pyx_vtabstruct_6gevent_16__hub_primitives_WaitOperationsGreenlet __pyx_vtable_6gevent_16__hub_primitives_WaitOperationsGreenlet; + +static PyObject *__pyx_tp_new_6gevent_16__hub_primitives_WaitOperationsGreenlet(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_6gevent_16__hub_primitives_WaitOperationsGreenlet *p; + PyObject *o = __pyx_ptype_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop->tp_new(t, a, k); + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_6gevent_16__hub_primitives_WaitOperationsGreenlet *)o); + p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop*)__pyx_vtabptr_6gevent_16__hub_primitives_WaitOperationsGreenlet; + return o; +} + +static void __pyx_tp_dealloc_6gevent_16__hub_primitives_WaitOperationsGreenlet(PyObject *o) { + #if CYTHON_USE_TP_FINALIZE + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + PyObject_GC_UnTrack(o); + PyObject_GC_Track(o); + if (likely(__pyx_ptype_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop)) __pyx_ptype_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop->tp_dealloc(o); else __Pyx_call_next_tp_dealloc(o, __pyx_tp_dealloc_6gevent_16__hub_primitives_WaitOperationsGreenlet); +} + +static int __pyx_tp_traverse_6gevent_16__hub_primitives_WaitOperationsGreenlet(PyObject *o, visitproc v, void *a) { + int e; + e = ((likely(__pyx_ptype_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop)) ? ((__pyx_ptype_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop->tp_traverse) ? __pyx_ptype_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_6gevent_16__hub_primitives_WaitOperationsGreenlet)); if (e) return e; + return 0; +} + +static int __pyx_tp_clear_6gevent_16__hub_primitives_WaitOperationsGreenlet(PyObject *o) { + if (likely(__pyx_ptype_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop)) { if (__pyx_ptype_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop->tp_clear) __pyx_ptype_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_6gevent_16__hub_primitives_WaitOperationsGreenlet); + return 0; +} + +static PyMethodDef __pyx_methods_6gevent_16__hub_primitives_WaitOperationsGreenlet[] = { + {0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_6gevent_16__hub_primitives_WaitOperationsGreenlet = { + PyVarObject_HEAD_INIT(0, 0) + "gevent.__hub_primitives.WaitOperationsGreenlet", /*tp_name*/ + sizeof(struct __pyx_obj_6gevent_16__hub_primitives_WaitOperationsGreenlet), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6gevent_16__hub_primitives_WaitOperationsGreenlet, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_6gevent_16__hub_primitives_WaitOperationsGreenlet, /*tp_traverse*/ + __pyx_tp_clear_6gevent_16__hub_primitives_WaitOperationsGreenlet, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6gevent_16__hub_primitives_WaitOperationsGreenlet, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6gevent_16__hub_primitives_WaitOperationsGreenlet, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; +static struct __pyx_vtabstruct_6gevent_16__hub_primitives__WaitIterator __pyx_vtable_6gevent_16__hub_primitives__WaitIterator; + +static PyObject *__pyx_tp_new_6gevent_16__hub_primitives__WaitIterator(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + struct __pyx_obj_6gevent_16__hub_primitives__WaitIterator *p; + PyObject *o; + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_6gevent_16__hub_primitives__WaitIterator *)o); + p->__pyx_vtab = __pyx_vtabptr_6gevent_16__hub_primitives__WaitIterator; + p->_hub = ((struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *)Py_None); Py_INCREF(Py_None); + p->_waiter = ((struct __pyx_obj_6gevent_8__waiter_MultipleWaiter *)Py_None); Py_INCREF(Py_None); + p->_switch = Py_None; Py_INCREF(Py_None); + p->_timeout = Py_None; Py_INCREF(Py_None); + p->_objects = Py_None; Py_INCREF(Py_None); + p->_timer = Py_None; Py_INCREF(Py_None); + return o; +} + +static void __pyx_tp_dealloc_6gevent_16__hub_primitives__WaitIterator(PyObject *o) { + struct __pyx_obj_6gevent_16__hub_primitives__WaitIterator *p = (struct __pyx_obj_6gevent_16__hub_primitives__WaitIterator *)o; + #if CYTHON_USE_TP_FINALIZE + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + PyObject_GC_UnTrack(o); + Py_CLEAR(p->_hub); + Py_CLEAR(p->_waiter); + Py_CLEAR(p->_switch); + Py_CLEAR(p->_timeout); + Py_CLEAR(p->_objects); + Py_CLEAR(p->_timer); + (*Py_TYPE(o)->tp_free)(o); +} + +static int __pyx_tp_traverse_6gevent_16__hub_primitives__WaitIterator(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_6gevent_16__hub_primitives__WaitIterator *p = (struct __pyx_obj_6gevent_16__hub_primitives__WaitIterator *)o; + if (p->_hub) { + e = (*v)(((PyObject *)p->_hub), a); if (e) return e; + } + if (p->_waiter) { + e = (*v)(((PyObject *)p->_waiter), a); if (e) return e; + } + if (p->_switch) { + e = (*v)(p->_switch, a); if (e) return e; + } + if (p->_timeout) { + e = (*v)(p->_timeout, a); if (e) return e; + } + if (p->_objects) { + e = (*v)(p->_objects, a); if (e) return e; + } + if (p->_timer) { + e = (*v)(p->_timer, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_6gevent_16__hub_primitives__WaitIterator(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_6gevent_16__hub_primitives__WaitIterator *p = (struct __pyx_obj_6gevent_16__hub_primitives__WaitIterator *)o; + tmp = ((PyObject*)p->_hub); + p->_hub = ((struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->_waiter); + p->_waiter = ((struct __pyx_obj_6gevent_8__waiter_MultipleWaiter *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->_switch); + p->_switch = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->_timeout); + p->_timeout = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->_objects); + p->_objects = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->_timer); + p->_timer = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyObject *__pyx_specialmethod___pyx_pw_6gevent_16__hub_primitives_13_WaitIterator_5__next__(PyObject *self, CYTHON_UNUSED PyObject *arg) {return __pyx_pw_6gevent_16__hub_primitives_13_WaitIterator_5__next__(self);} + +static PyMethodDef __pyx_methods_6gevent_16__hub_primitives__WaitIterator[] = { + {"__next__", (PyCFunction)__pyx_specialmethod___pyx_pw_6gevent_16__hub_primitives_13_WaitIterator_5__next__, METH_NOARGS|METH_COEXIST, 0}, + {0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_6gevent_16__hub_primitives__WaitIterator = { + PyVarObject_HEAD_INIT(0, 0) + "gevent.__hub_primitives._WaitIterator", /*tp_name*/ + sizeof(struct __pyx_obj_6gevent_16__hub_primitives__WaitIterator), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6gevent_16__hub_primitives__WaitIterator, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + "_WaitIterator(objects, hub, timeout, count)", /*tp_doc*/ + __pyx_tp_traverse_6gevent_16__hub_primitives__WaitIterator, /*tp_traverse*/ + __pyx_tp_clear_6gevent_16__hub_primitives__WaitIterator, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + __pyx_pw_6gevent_16__hub_primitives_13_WaitIterator_3__iter__, /*tp_iter*/ + __pyx_pw_6gevent_16__hub_primitives_13_WaitIterator_5__next__, /*tp_iternext*/ + __pyx_methods_6gevent_16__hub_primitives__WaitIterator, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_pw_6gevent_16__hub_primitives_13_WaitIterator_1__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6gevent_16__hub_primitives__WaitIterator, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static PyMethodDef __pyx_methods[] = { + {0, 0, 0, 0} +}; + +#if PY_MAJOR_VERSION >= 3 +#if CYTHON_PEP489_MULTI_PHASE_INIT +static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ +static int __pyx_pymod_exec___hub_primitives(PyObject* module); /*proto*/ +static PyModuleDef_Slot __pyx_moduledef_slots[] = { + {Py_mod_create, (void*)__pyx_pymod_create}, + {Py_mod_exec, (void*)__pyx_pymod_exec___hub_primitives}, + {0, NULL} +}; +#endif + +static struct PyModuleDef __pyx_moduledef = { + PyModuleDef_HEAD_INIT, + "__hub_primitives", + __pyx_k_A_collection_of_primitives_used, /* m_doc */ + #if CYTHON_PEP489_MULTI_PHASE_INIT + 0, /* m_size */ + #else + -1, /* m_size */ + #endif + __pyx_methods /* m_methods */, + #if CYTHON_PEP489_MULTI_PHASE_INIT + __pyx_moduledef_slots, /* m_slots */ + #else + NULL, /* m_reload */ + #endif + NULL, /* m_traverse */ + NULL, /* m_clear */ + NULL /* m_free */ +}; +#endif +#ifndef CYTHON_SMALL_CODE +#if defined(__clang__) + #define CYTHON_SMALL_CODE +#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) + #define CYTHON_SMALL_CODE __attribute__((cold)) +#else + #define CYTHON_SMALL_CODE +#endif +#endif + +static __Pyx_StringTabEntry __pyx_string_tab[] = { + {&__pyx_n_s_ConcurrentObjectUseError, __pyx_k_ConcurrentObjectUseError, sizeof(__pyx_k_ConcurrentObjectUseError), 0, 0, 1, 1}, + {&__pyx_n_s_InvalidSwitchError, __pyx_k_InvalidSwitchError, sizeof(__pyx_k_InvalidSwitchError), 0, 0, 1, 1}, + {&__pyx_kp_s_Invalid_switch_into_s_r_expected, __pyx_k_Invalid_switch_into_s_r_expected, sizeof(__pyx_k_Invalid_switch_into_s_r_expected), 0, 0, 1, 0}, + {&__pyx_n_s_MultipleWaiter, __pyx_k_MultipleWaiter, sizeof(__pyx_k_MultipleWaiter), 0, 0, 1, 1}, + {&__pyx_n_s_NONE, __pyx_k_NONE, sizeof(__pyx_k_NONE), 0, 0, 1, 1}, + {&__pyx_n_s_StopIteration, __pyx_k_StopIteration, sizeof(__pyx_k_StopIteration), 0, 0, 1, 1}, + {&__pyx_n_s_SwitchOutGreenletWithLoop, __pyx_k_SwitchOutGreenletWithLoop, sizeof(__pyx_k_SwitchOutGreenletWithLoop), 0, 0, 1, 1}, + {&__pyx_kp_s_The_socket_has_already_been_clos, __pyx_k_The_socket_has_already_been_clos, sizeof(__pyx_k_The_socket_has_already_been_clos), 0, 0, 1, 0}, + {&__pyx_kp_s_This_socket_is_already_used_by_a, __pyx_k_This_socket_is_already_used_by_a, sizeof(__pyx_k_This_socket_is_already_used_by_a), 0, 0, 1, 0}, + {&__pyx_n_s_Timeout, __pyx_k_Timeout, sizeof(__pyx_k_Timeout), 0, 0, 1, 1}, + {&__pyx_n_s_WaitIterator, __pyx_k_WaitIterator, sizeof(__pyx_k_WaitIterator), 0, 0, 1, 1}, + {&__pyx_n_s_WaitIterator___enter, __pyx_k_WaitIterator___enter, sizeof(__pyx_k_WaitIterator___enter), 0, 0, 1, 1}, + {&__pyx_n_s_WaitIterator___exit, __pyx_k_WaitIterator___exit, sizeof(__pyx_k_WaitIterator___exit), 0, 0, 1, 1}, + {&__pyx_n_s_WaitOperationsGreenlet, __pyx_k_WaitOperationsGreenlet, sizeof(__pyx_k_WaitOperationsGreenlet), 0, 0, 1, 1}, + {&__pyx_n_s_WaitOperationsGreenlet__cancel_w, __pyx_k_WaitOperationsGreenlet__cancel_w, sizeof(__pyx_k_WaitOperationsGreenlet__cancel_w), 0, 0, 1, 1}, + {&__pyx_n_s_WaitOperationsGreenlet_cancel_wa, __pyx_k_WaitOperationsGreenlet_cancel_wa, sizeof(__pyx_k_WaitOperationsGreenlet_cancel_wa), 0, 0, 1, 1}, + {&__pyx_n_s_WaitOperationsGreenlet_wait, __pyx_k_WaitOperationsGreenlet_wait, sizeof(__pyx_k_WaitOperationsGreenlet_wait), 0, 0, 1, 1}, + {&__pyx_n_s_Waiter, __pyx_k_Waiter, sizeof(__pyx_k_Waiter), 0, 0, 1, 1}, + {&__pyx_n_s_active, __pyx_k_active, sizeof(__pyx_k_active), 0, 0, 1, 1}, + {&__pyx_n_s_all, __pyx_k_all, sizeof(__pyx_k_all), 0, 0, 1, 1}, + {&__pyx_n_s_callback, __pyx_k_callback, sizeof(__pyx_k_callback), 0, 0, 1, 1}, + {&__pyx_n_s_cancel_wait, __pyx_k_cancel_wait, sizeof(__pyx_k_cancel_wait), 0, 0, 1, 1}, + {&__pyx_n_s_cancel_wait_2, __pyx_k_cancel_wait_2, sizeof(__pyx_k_cancel_wait_2), 0, 0, 1, 1}, + {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, + {&__pyx_n_s_close, __pyx_k_close, sizeof(__pyx_k_close), 0, 0, 1, 1}, + {&__pyx_n_s_close_watcher, __pyx_k_close_watcher, sizeof(__pyx_k_close_watcher), 0, 0, 1, 1}, + {&__pyx_n_s_count, __pyx_k_count, sizeof(__pyx_k_count), 0, 0, 1, 1}, + {&__pyx_n_s_e, __pyx_k_e, sizeof(__pyx_k_e), 0, 0, 1, 1}, + {&__pyx_n_s_enter, __pyx_k_enter, sizeof(__pyx_k_enter), 0, 0, 1, 1}, + {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1}, + {&__pyx_n_s_event, __pyx_k_event, sizeof(__pyx_k_event), 0, 0, 1, 1}, + {&__pyx_n_s_exit, __pyx_k_exit, sizeof(__pyx_k_exit), 0, 0, 1, 1}, + {&__pyx_n_s_fileno, __pyx_k_fileno, sizeof(__pyx_k_fileno), 0, 0, 1, 1}, + {&__pyx_n_s_get_hub_noargs, __pyx_k_get_hub_noargs, sizeof(__pyx_k_get_hub_noargs), 0, 0, 1, 1}, + {&__pyx_n_s_getcurrent, __pyx_k_getcurrent, sizeof(__pyx_k_getcurrent), 0, 0, 1, 1}, + {&__pyx_n_s_gevent, __pyx_k_gevent, sizeof(__pyx_k_gevent), 0, 0, 1, 1}, + {&__pyx_n_s_gevent___hub_primitives, __pyx_k_gevent___hub_primitives, sizeof(__pyx_k_gevent___hub_primitives), 0, 0, 1, 1}, + {&__pyx_n_s_gevent__hub_local, __pyx_k_gevent__hub_local, sizeof(__pyx_k_gevent__hub_local), 0, 0, 1, 1}, + {&__pyx_n_s_gevent__util, __pyx_k_gevent__util, sizeof(__pyx_k_gevent__util), 0, 0, 1, 1}, + {&__pyx_n_s_gevent_exceptions, __pyx_k_gevent_exceptions, sizeof(__pyx_k_gevent_exceptions), 0, 0, 1, 1}, + {&__pyx_n_s_gevent_timeout, __pyx_k_gevent_timeout, sizeof(__pyx_k_gevent_timeout), 0, 0, 1, 1}, + {&__pyx_n_s_greenlet, __pyx_k_greenlet, sizeof(__pyx_k_greenlet), 0, 0, 1, 1}, + {&__pyx_n_s_greenlet_imported, __pyx_k_greenlet_imported, sizeof(__pyx_k_greenlet_imported), 0, 0, 1, 1}, + {&__pyx_n_s_greenlet_init, __pyx_k_greenlet_init, sizeof(__pyx_k_greenlet_init), 0, 0, 1, 1}, + {&__pyx_n_s_greenlet_primitives, __pyx_k_greenlet_primitives, sizeof(__pyx_k_greenlet_primitives), 0, 0, 1, 1}, + {&__pyx_n_s_hub, __pyx_k_hub, sizeof(__pyx_k_hub), 0, 0, 1, 1}, + {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, + {&__pyx_n_s_import_c_accel, __pyx_k_import_c_accel, sizeof(__pyx_k_import_c_accel), 0, 0, 1, 1}, + {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1}, + {&__pyx_n_s_io, __pyx_k_io, sizeof(__pyx_k_io), 0, 0, 1, 1}, + {&__pyx_n_s_iwait_on_objects, __pyx_k_iwait_on_objects, sizeof(__pyx_k_iwait_on_objects), 0, 0, 1, 1}, + {&__pyx_n_s_join, __pyx_k_join, sizeof(__pyx_k_join), 0, 0, 1, 1}, + {&__pyx_n_s_lambda, __pyx_k_lambda, sizeof(__pyx_k_lambda), 0, 0, 1, 1}, + {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, + {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, + {&__pyx_n_s_next, __pyx_k_next, sizeof(__pyx_k_next), 0, 0, 1, 1}, + {&__pyx_n_s_next_2, __pyx_k_next_2, sizeof(__pyx_k_next_2), 0, 0, 1, 1}, + {&__pyx_n_s_objects, __pyx_k_objects, sizeof(__pyx_k_objects), 0, 0, 1, 1}, + {&__pyx_n_s_print_exc, __pyx_k_print_exc, sizeof(__pyx_k_print_exc), 0, 0, 1, 1}, + {&__pyx_n_s_priority, __pyx_k_priority, sizeof(__pyx_k_priority), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_capi, __pyx_k_pyx_capi, sizeof(__pyx_k_pyx_capi), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1}, + {&__pyx_n_s_rawlink, __pyx_k_rawlink, sizeof(__pyx_k_rawlink), 0, 0, 1, 1}, + {&__pyx_n_s_run_callback, __pyx_k_run_callback, sizeof(__pyx_k_run_callback), 0, 0, 1, 1}, + {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1}, + {&__pyx_n_s_self_2, __pyx_k_self_2, sizeof(__pyx_k_self_2), 0, 0, 1, 1}, + {&__pyx_n_s_set_default_timeout_error, __pyx_k_set_default_timeout_error, sizeof(__pyx_k_set_default_timeout_error), 0, 0, 1, 1}, + {&__pyx_n_s_socket, __pyx_k_socket, sizeof(__pyx_k_socket), 0, 0, 1, 1}, + {&__pyx_kp_s_src_gevent__hub_primitives_py, __pyx_k_src_gevent__hub_primitives_py, sizeof(__pyx_k_src_gevent__hub_primitives_py), 0, 0, 1, 0}, + {&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1}, + {&__pyx_n_s_start_new_or_dummy, __pyx_k_start_new_or_dummy, sizeof(__pyx_k_start_new_or_dummy), 0, 0, 1, 1}, + {&__pyx_n_s_stop, __pyx_k_stop, sizeof(__pyx_k_stop), 0, 0, 1, 1}, + {&__pyx_n_s_switch, __pyx_k_switch, sizeof(__pyx_k_switch), 0, 0, 1, 1}, + {&__pyx_n_s_tb, __pyx_k_tb, sizeof(__pyx_k_tb), 0, 0, 1, 1}, + {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, + {&__pyx_n_s_throw, __pyx_k_throw, sizeof(__pyx_k_throw), 0, 0, 1, 1}, + {&__pyx_kp_s_timed_out, __pyx_k_timed_out, sizeof(__pyx_k_timed_out), 0, 0, 1, 0}, + {&__pyx_n_s_timeout, __pyx_k_timeout, sizeof(__pyx_k_timeout), 0, 0, 1, 1}, + {&__pyx_n_s_timeout_error, __pyx_k_timeout_error, sizeof(__pyx_k_timeout_error), 0, 0, 1, 1}, + {&__pyx_n_s_timeout_exc, __pyx_k_timeout_exc, sizeof(__pyx_k_timeout_exc), 0, 0, 1, 1}, + {&__pyx_n_s_timer, __pyx_k_timer, sizeof(__pyx_k_timer), 0, 0, 1, 1}, + {&__pyx_n_s_traceback, __pyx_k_traceback, sizeof(__pyx_k_traceback), 0, 0, 1, 1}, + {&__pyx_n_s_typ, __pyx_k_typ, sizeof(__pyx_k_typ), 0, 0, 1, 1}, + {&__pyx_n_s_unlink, __pyx_k_unlink, sizeof(__pyx_k_unlink), 0, 0, 1, 1}, + {&__pyx_n_s_value, __pyx_k_value, sizeof(__pyx_k_value), 0, 0, 1, 1}, + {&__pyx_n_s_wait, __pyx_k_wait, sizeof(__pyx_k_wait), 0, 0, 1, 1}, + {&__pyx_n_s_wait_on_objects, __pyx_k_wait_on_objects, sizeof(__pyx_k_wait_on_objects), 0, 0, 1, 1}, + {&__pyx_n_s_wait_on_socket, __pyx_k_wait_on_socket, sizeof(__pyx_k_wait_on_socket), 0, 0, 1, 1}, + {&__pyx_n_s_wait_on_watcher, __pyx_k_wait_on_watcher, sizeof(__pyx_k_wait_on_watcher), 0, 0, 1, 1}, + {&__pyx_n_s_wait_read, __pyx_k_wait_read, sizeof(__pyx_k_wait_read), 0, 0, 1, 1}, + {&__pyx_n_s_wait_readwrite, __pyx_k_wait_readwrite, sizeof(__pyx_k_wait_readwrite), 0, 0, 1, 1}, + {&__pyx_n_s_wait_write, __pyx_k_wait_write, sizeof(__pyx_k_wait_write), 0, 0, 1, 1}, + {&__pyx_n_s_waiter, __pyx_k_waiter, sizeof(__pyx_k_waiter), 0, 0, 1, 1}, + {&__pyx_n_s_watcher, __pyx_k_watcher, sizeof(__pyx_k_watcher), 0, 0, 1, 1}, + {0, 0, 0, 0, 0, 0, 0} +}; +static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { + __pyx_builtin___import__ = __Pyx_GetBuiltinName(__pyx_n_s_import); if (!__pyx_builtin___import__) __PYX_ERR(0, 29, __pyx_L1_error) + __pyx_builtin_StopIteration = __Pyx_GetBuiltinName(__pyx_n_s_StopIteration); if (!__pyx_builtin_StopIteration) __PYX_ERR(0, 139, __pyx_L1_error) + return 0; + __pyx_L1_error:; + return -1; +} + +static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); + + /* "src/gevent/_hub_primitives.py":280 + * else _timeout_error('timed out'))) + * + * with timeout: # <<<<<<<<<<<<<< + * hub.wait(watcher) + * + */ + __pyx_tuple_ = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 280, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple_); + __Pyx_GIVEREF(__pyx_tuple_); + + /* "src/gevent/_hub_primitives.py":29 + * # is assignment) without generating a 'lvalue is not valid target' + * # error. + * locals()['getcurrent'] = __import__('greenlet').getcurrent # <<<<<<<<<<<<<< + * locals()['greenlet_init'] = lambda: None + * locals()['Waiter'] = _waiter.Waiter + */ + __pyx_tuple__8 = PyTuple_Pack(1, __pyx_n_s_greenlet); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 29, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__8); + __Pyx_GIVEREF(__pyx_tuple__8); + + /* "src/gevent/_hub_primitives.py":46 + * class WaitOperationsGreenlet(SwitchOutGreenletWithLoop): # pylint:disable=undefined-variable + * + * def wait(self, watcher): # <<<<<<<<<<<<<< + * """ + * Wait until the *watcher* (which must not be started) is ready. + */ + __pyx_tuple__9 = PyTuple_Pack(2, __pyx_n_s_self_2, __pyx_n_s_watcher); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 46, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__9); + __Pyx_GIVEREF(__pyx_tuple__9); + __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__9, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__hub_primitives_py, __pyx_n_s_wait, 46, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__10)) __PYX_ERR(0, 46, __pyx_L1_error) + + /* "src/gevent/_hub_primitives.py":63 + * watcher.stop() + * + * def cancel_wait(self, watcher, error, close_watcher=False): # <<<<<<<<<<<<<< + * """ + * Cancel an in-progress call to :meth:`wait` by throwing the given *error* + */ + __pyx_tuple__11 = PyTuple_Pack(4, __pyx_n_s_self_2, __pyx_n_s_watcher, __pyx_n_s_error, __pyx_n_s_close_watcher); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 63, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__11); + __Pyx_GIVEREF(__pyx_tuple__11); + __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__11, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__hub_primitives_py, __pyx_n_s_cancel_wait, 63, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(0, 63, __pyx_L1_error) + + /* "src/gevent/_hub_primitives.py":84 + * watcher.close() + * + * def _cancel_wait(self, watcher, error, close_watcher): # <<<<<<<<<<<<<< + * # We have to check again to see if it was still active by the time + * # our callback actually runs. + */ + __pyx_tuple__13 = PyTuple_Pack(4, __pyx_n_s_self_2, __pyx_n_s_watcher, __pyx_n_s_error, __pyx_n_s_close_watcher); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 84, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__13); + __Pyx_GIVEREF(__pyx_tuple__13); + __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__13, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__hub_primitives_py, __pyx_n_s_cancel_wait_2, 84, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__14)) __PYX_ERR(0, 84, __pyx_L1_error) + + /* "src/gevent/_hub_primitives.py":171 + * traceback.print_exc() + * + * def __enter__(self): # <<<<<<<<<<<<<< + * return self + * + */ + __pyx_tuple__15 = PyTuple_Pack(1, __pyx_n_s_self_2); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(0, 171, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__15); + __Pyx_GIVEREF(__pyx_tuple__15); + __pyx_codeobj__16 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__15, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__hub_primitives_py, __pyx_n_s_enter, 171, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__16)) __PYX_ERR(0, 171, __pyx_L1_error) + + /* "src/gevent/_hub_primitives.py":174 + * return self + * + * def __exit__(self, typ, value, tb): # <<<<<<<<<<<<<< + * self._cleanup() + * + */ + __pyx_tuple__17 = PyTuple_Pack(4, __pyx_n_s_self_2, __pyx_n_s_typ, __pyx_n_s_value, __pyx_n_s_tb); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(0, 174, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__17); + __Pyx_GIVEREF(__pyx_tuple__17); + __pyx_codeobj__18 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__17, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__hub_primitives_py, __pyx_n_s_exit, 174, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__18)) __PYX_ERR(0, 174, __pyx_L1_error) + + /* "src/gevent/_hub_primitives.py":178 + * + * + * def iwait_on_objects(objects, timeout=None, count=None): # <<<<<<<<<<<<<< + * """ + * Iteratively yield *objects* as they are ready, until all (or *count*) are ready + */ + __pyx_tuple__19 = PyTuple_Pack(3, __pyx_n_s_objects, __pyx_n_s_timeout, __pyx_n_s_count); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(0, 178, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__19); + __Pyx_GIVEREF(__pyx_tuple__19); + __pyx_codeobj__20 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__19, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__hub_primitives_py, __pyx_n_s_iwait_on_objects, 178, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__20)) __PYX_ERR(0, 178, __pyx_L1_error) + + /* "src/gevent/_hub_primitives.py":217 + * + * + * def wait_on_objects(objects=None, timeout=None, count=None): # <<<<<<<<<<<<<< + * """ + * Wait for ``objects`` to become ready or for event loop to finish. + */ + __pyx_tuple__21 = PyTuple_Pack(3, __pyx_n_s_objects, __pyx_n_s_timeout, __pyx_n_s_count); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(0, 217, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__21); + __Pyx_GIVEREF(__pyx_tuple__21); + __pyx_codeobj__22 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__21, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__hub_primitives_py, __pyx_n_s_wait_on_objects, 217, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__22)) __PYX_ERR(0, 217, __pyx_L1_error) + + /* "src/gevent/_hub_primitives.py":258 + * _timeout_error = Exception + * + * def set_default_timeout_error(e): # <<<<<<<<<<<<<< + * global _timeout_error + * _timeout_error = e + */ + __pyx_tuple__23 = PyTuple_Pack(1, __pyx_n_s_e); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(0, 258, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__23); + __Pyx_GIVEREF(__pyx_tuple__23); + __pyx_codeobj__24 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__23, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__hub_primitives_py, __pyx_n_s_set_default_timeout_error, 258, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__24)) __PYX_ERR(0, 258, __pyx_L1_error) + + /* "src/gevent/_hub_primitives.py":284 + * + * # Suitable to be bound as an instance method + * def wait_on_socket(socket, watcher, timeout_exc=None): # <<<<<<<<<<<<<< + * if socket is None or watcher is None: + * # test__hub TestCloseSocketWhilePolling, on Python 2; Python 3 + */ + __pyx_tuple__25 = PyTuple_Pack(3, __pyx_n_s_socket, __pyx_n_s_watcher, __pyx_n_s_timeout_exc); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(0, 284, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__25); + __Pyx_GIVEREF(__pyx_tuple__25); + __pyx_codeobj__26 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__25, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__hub_primitives_py, __pyx_n_s_wait_on_socket, 284, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__26)) __PYX_ERR(0, 284, __pyx_L1_error) + + /* "src/gevent/_hub_primitives.py":293 + * socket.hub) + * + * def wait_on_watcher(watcher, timeout=None, timeout_exc=_NONE, hub=None): # <<<<<<<<<<<<<< + * """ + * wait(watcher, timeout=None, [timeout_exc=None]) -> None + */ + __pyx_tuple__27 = PyTuple_Pack(4, __pyx_n_s_watcher, __pyx_n_s_timeout, __pyx_n_s_timeout_exc, __pyx_n_s_hub); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(0, 293, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__27); + __Pyx_GIVEREF(__pyx_tuple__27); + __pyx_codeobj__28 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__27, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__hub_primitives_py, __pyx_n_s_wait_on_watcher, 293, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__28)) __PYX_ERR(0, 293, __pyx_L1_error) + + /* "src/gevent/_hub_primitives.py":320 + * + * + * def wait_read(fileno, timeout=None, timeout_exc=_NONE): # <<<<<<<<<<<<<< + * """ + * wait_read(fileno, timeout=None, [timeout_exc=None]) -> None + */ + __pyx_tuple__29 = PyTuple_Pack(3, __pyx_n_s_fileno, __pyx_n_s_timeout, __pyx_n_s_timeout_exc); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(0, 320, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__29); + __Pyx_GIVEREF(__pyx_tuple__29); + __pyx_codeobj__30 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__29, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__hub_primitives_py, __pyx_n_s_wait_read, 320, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__30)) __PYX_ERR(0, 320, __pyx_L1_error) + + /* "src/gevent/_hub_primitives.py":339 + * + * + * def wait_write(fileno, timeout=None, timeout_exc=_NONE, event=_NONE): # <<<<<<<<<<<<<< + * """ + * wait_write(fileno, timeout=None, [timeout_exc=None]) -> None + */ + __pyx_tuple__31 = PyTuple_Pack(4, __pyx_n_s_fileno, __pyx_n_s_timeout, __pyx_n_s_timeout_exc, __pyx_n_s_event); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(0, 339, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__31); + __Pyx_GIVEREF(__pyx_tuple__31); + __pyx_codeobj__32 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__31, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__hub_primitives_py, __pyx_n_s_wait_write, 339, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__32)) __PYX_ERR(0, 339, __pyx_L1_error) + + /* "src/gevent/_hub_primitives.py":363 + * + * + * def wait_readwrite(fileno, timeout=None, timeout_exc=_NONE, event=_NONE): # <<<<<<<<<<<<<< + * """ + * wait_readwrite(fileno, timeout=None, [timeout_exc=None]) -> None + */ + __pyx_tuple__33 = PyTuple_Pack(4, __pyx_n_s_fileno, __pyx_n_s_timeout, __pyx_n_s_timeout_exc, __pyx_n_s_event); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(0, 363, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__33); + __Pyx_GIVEREF(__pyx_tuple__33); + __pyx_codeobj__34 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__33, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__hub_primitives_py, __pyx_n_s_wait_readwrite, 363, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__34)) __PYX_ERR(0, 363, __pyx_L1_error) + + /* "src/gevent/_hub_primitives.py":388 + * + * + * def _init(): # <<<<<<<<<<<<<< + * greenlet_init() # pylint:disable=undefined-variable + * + */ + __pyx_codeobj__35 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__hub_primitives_py, __pyx_n_s_init, 388, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__35)) __PYX_ERR(0, 388, __pyx_L1_error) + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} + +static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { + if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error) + return 0; + __pyx_L1_error:; + return -1; +} + +static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/ + +static int __Pyx_modinit_global_init_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); + /*--- Global init code ---*/ + __pyx_v_6gevent_16__hub_primitives_InvalidSwitchError = Py_None; Py_INCREF(Py_None); + __pyx_v_6gevent_16__hub_primitives__waiter = Py_None; Py_INCREF(Py_None); + __pyx_v_6gevent_16__hub_primitives__greenlet_primitives = Py_None; Py_INCREF(Py_None); + __pyx_v_6gevent_16__hub_primitives_traceback = Py_None; Py_INCREF(Py_None); + __pyx_v_6gevent_16__hub_primitives__timeout_error = Py_None; Py_INCREF(Py_None); + __pyx_v_6gevent_16__hub_primitives_Timeout = Py_None; Py_INCREF(Py_None); + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_variable_export_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); + /*--- Variable export code ---*/ + if (__Pyx_ExportVoidPtr(__pyx_n_s_InvalidSwitchError, (void *)&__pyx_v_6gevent_16__hub_primitives_InvalidSwitchError, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportVoidPtr(__pyx_n_s_waiter, (void *)&__pyx_v_6gevent_16__hub_primitives__waiter, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportVoidPtr(__pyx_n_s_greenlet_primitives, (void *)&__pyx_v_6gevent_16__hub_primitives__greenlet_primitives, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportVoidPtr(__pyx_n_s_traceback, (void *)&__pyx_v_6gevent_16__hub_primitives_traceback, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportVoidPtr(__pyx_n_s_timeout_error, (void *)&__pyx_v_6gevent_16__hub_primitives__timeout_error, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportVoidPtr(__pyx_n_s_Timeout, (void *)&__pyx_v_6gevent_16__hub_primitives_Timeout, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportVoidPtr(__pyx_n_s_greenlet_imported, (void *)&__pyx_v_6gevent_16__hub_primitives__greenlet_imported, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_modinit_function_export_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); + /*--- Function export code ---*/ + if (__Pyx_ExportFunction("iwait_on_objects", (void (*)(void))__pyx_f_6gevent_16__hub_primitives_iwait_on_objects, "PyObject *(PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_16__hub_primitives_iwait_on_objects *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportFunction("wait_on_objects", (void (*)(void))__pyx_f_6gevent_16__hub_primitives_wait_on_objects, "PyObject *(int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_16__hub_primitives_wait_on_objects *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportFunction("_primitive_wait", (void (*)(void))__pyx_f_6gevent_16__hub_primitives__primitive_wait, "PyObject *(PyObject *, PyObject *, PyObject *, struct __pyx_obj_6gevent_16__hub_primitives_WaitOperationsGreenlet *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportFunction("wait_on_watcher", (void (*)(void))__pyx_f_6gevent_16__hub_primitives_wait_on_watcher, "PyObject *(PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_16__hub_primitives_wait_on_watcher *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportFunction("wait_read", (void (*)(void))__pyx_f_6gevent_16__hub_primitives_wait_read, "PyObject *(PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_16__hub_primitives_wait_read *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportFunction("wait_write", (void (*)(void))__pyx_f_6gevent_16__hub_primitives_wait_write, "PyObject *(PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_16__hub_primitives_wait_write *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportFunction("wait_readwrite", (void (*)(void))__pyx_f_6gevent_16__hub_primitives_wait_readwrite, "PyObject *(PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_16__hub_primitives_wait_readwrite *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportFunction("wait_on_socket", (void (*)(void))__pyx_f_6gevent_16__hub_primitives_wait_on_socket, "PyObject *(PyObject *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_16__hub_primitives_wait_on_socket *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_modinit_type_init_code(void) { + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); + /*--- Type init code ---*/ + __pyx_t_1 = PyImport_ImportModule("greenlet"); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 19, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_ptype_6gevent_16__hub_primitives_greenlet = __Pyx_ImportType(__pyx_t_1, "greenlet", "greenlet", sizeof(PyGreenlet), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_16__hub_primitives_greenlet) __PYX_ERR(3, 19, __pyx_L1_error) + __pyx_t_2 = PyImport_ImportModule("gevent.__greenlet_primitives"); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_ptype_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop = __Pyx_ImportType(__pyx_t_2, "gevent.__greenlet_primitives", "SwitchOutGreenletWithLoop", sizeof(struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_vtabptr_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop = (struct __pyx_vtabstruct_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop*)__Pyx_GetVtable(__pyx_ptype_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop->tp_dict); if (unlikely(!__pyx_vtabptr_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_vtabptr_6gevent_16__hub_primitives_WaitOperationsGreenlet = &__pyx_vtable_6gevent_16__hub_primitives_WaitOperationsGreenlet; + __pyx_vtable_6gevent_16__hub_primitives_WaitOperationsGreenlet.__pyx_base = *__pyx_vtabptr_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop; + __pyx_vtable_6gevent_16__hub_primitives_WaitOperationsGreenlet.wait = (PyObject *(*)(struct __pyx_obj_6gevent_16__hub_primitives_WaitOperationsGreenlet *, PyObject *, int __pyx_skip_dispatch))__pyx_f_6gevent_16__hub_primitives_22WaitOperationsGreenlet_wait; + __pyx_vtable_6gevent_16__hub_primitives_WaitOperationsGreenlet.cancel_wait = (PyObject *(*)(struct __pyx_obj_6gevent_16__hub_primitives_WaitOperationsGreenlet *, PyObject *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_16__hub_primitives_22WaitOperationsGreenlet_cancel_wait *__pyx_optional_args))__pyx_f_6gevent_16__hub_primitives_22WaitOperationsGreenlet_cancel_wait; + __pyx_vtable_6gevent_16__hub_primitives_WaitOperationsGreenlet._cancel_wait = (PyObject *(*)(struct __pyx_obj_6gevent_16__hub_primitives_WaitOperationsGreenlet *, PyObject *, PyObject *, PyObject *, int __pyx_skip_dispatch))__pyx_f_6gevent_16__hub_primitives_22WaitOperationsGreenlet__cancel_wait; + __pyx_type_6gevent_16__hub_primitives_WaitOperationsGreenlet.tp_base = __pyx_ptype_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop; + if (PyType_Ready(&__pyx_type_6gevent_16__hub_primitives_WaitOperationsGreenlet) < 0) __PYX_ERR(0, 44, __pyx_L1_error) + __pyx_type_6gevent_16__hub_primitives_WaitOperationsGreenlet.tp_print = 0; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6gevent_16__hub_primitives_WaitOperationsGreenlet.tp_dictoffset && __pyx_type_6gevent_16__hub_primitives_WaitOperationsGreenlet.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_type_6gevent_16__hub_primitives_WaitOperationsGreenlet.tp_getattro = __Pyx_PyObject_GenericGetAttr; + } + if (__Pyx_SetVtable(__pyx_type_6gevent_16__hub_primitives_WaitOperationsGreenlet.tp_dict, __pyx_vtabptr_6gevent_16__hub_primitives_WaitOperationsGreenlet) < 0) __PYX_ERR(0, 44, __pyx_L1_error) + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_WaitOperationsGreenlet, (PyObject *)&__pyx_type_6gevent_16__hub_primitives_WaitOperationsGreenlet) < 0) __PYX_ERR(0, 44, __pyx_L1_error) + __pyx_ptype_6gevent_16__hub_primitives_WaitOperationsGreenlet = &__pyx_type_6gevent_16__hub_primitives_WaitOperationsGreenlet; + __pyx_vtabptr_6gevent_16__hub_primitives__WaitIterator = &__pyx_vtable_6gevent_16__hub_primitives__WaitIterator; + __pyx_vtable_6gevent_16__hub_primitives__WaitIterator._begin = (PyObject *(*)(struct __pyx_obj_6gevent_16__hub_primitives__WaitIterator *))__pyx_f_6gevent_16__hub_primitives_13_WaitIterator__begin; + __pyx_vtable_6gevent_16__hub_primitives__WaitIterator._cleanup = (PyObject *(*)(struct __pyx_obj_6gevent_16__hub_primitives__WaitIterator *))__pyx_f_6gevent_16__hub_primitives_13_WaitIterator__cleanup; + __pyx_vtable_6gevent_16__hub_primitives__WaitIterator.__pyx___enter__ = (PyObject *(*)(struct __pyx_obj_6gevent_16__hub_primitives__WaitIterator *, int __pyx_skip_dispatch))__pyx_f_6gevent_16__hub_primitives_13_WaitIterator___enter__; + __pyx_vtable_6gevent_16__hub_primitives__WaitIterator.__pyx___exit__ = (PyObject *(*)(struct __pyx_obj_6gevent_16__hub_primitives__WaitIterator *, PyObject *, PyObject *, PyObject *, int __pyx_skip_dispatch))__pyx_f_6gevent_16__hub_primitives_13_WaitIterator___exit__; + if (PyType_Ready(&__pyx_type_6gevent_16__hub_primitives__WaitIterator) < 0) __PYX_ERR(0, 98, __pyx_L1_error) + __pyx_type_6gevent_16__hub_primitives__WaitIterator.tp_print = 0; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6gevent_16__hub_primitives__WaitIterator.tp_dictoffset && __pyx_type_6gevent_16__hub_primitives__WaitIterator.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_type_6gevent_16__hub_primitives__WaitIterator.tp_getattro = __Pyx_PyObject_GenericGetAttr; + } + if (__Pyx_SetVtable(__pyx_type_6gevent_16__hub_primitives__WaitIterator.tp_dict, __pyx_vtabptr_6gevent_16__hub_primitives__WaitIterator) < 0) __PYX_ERR(0, 98, __pyx_L1_error) + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_WaitIterator, (PyObject *)&__pyx_type_6gevent_16__hub_primitives__WaitIterator) < 0) __PYX_ERR(0, 98, __pyx_L1_error) + __pyx_ptype_6gevent_16__hub_primitives__WaitIterator = &__pyx_type_6gevent_16__hub_primitives__WaitIterator; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_modinit_type_import_code(void) { + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); + /*--- Type import code ---*/ + __pyx_t_1 = PyImport_ImportModule("greenlet"); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_ptype_6gevent_21__greenlet_primitives_greenlet = __Pyx_ImportType(__pyx_t_1, "greenlet", "greenlet", sizeof(PyGreenlet), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_21__greenlet_primitives_greenlet) __PYX_ERR(1, 12, __pyx_L1_error) + __pyx_t_2 = PyImport_ImportModule("gevent.__greenlet_primitives"); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 37, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_ptype_6gevent_21__greenlet_primitives_TrackedRawGreenlet = __Pyx_ImportType(__pyx_t_2, "gevent.__greenlet_primitives", "TrackedRawGreenlet", sizeof(struct __pyx_obj_6gevent_21__greenlet_primitives_TrackedRawGreenlet), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_21__greenlet_primitives_TrackedRawGreenlet) __PYX_ERR(1, 37, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyImport_ImportModule("greenlet"); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 15, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_ptype_6gevent_8__waiter_greenlet = __Pyx_ImportType(__pyx_t_2, "greenlet", "greenlet", sizeof(PyGreenlet), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_8__waiter_greenlet) __PYX_ERR(2, 15, __pyx_L1_error) + __pyx_t_1 = PyImport_ImportModule("gevent.__waiter"); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 33, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_ptype_6gevent_8__waiter_Waiter = __Pyx_ImportType(__pyx_t_1, "gevent.__waiter", "Waiter", sizeof(struct __pyx_obj_6gevent_8__waiter_Waiter), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_8__waiter_Waiter) __PYX_ERR(2, 33, __pyx_L1_error) + __pyx_vtabptr_6gevent_8__waiter_Waiter = (struct __pyx_vtabstruct_6gevent_8__waiter_Waiter*)__Pyx_GetVtable(__pyx_ptype_6gevent_8__waiter_Waiter->tp_dict); if (unlikely(!__pyx_vtabptr_6gevent_8__waiter_Waiter)) __PYX_ERR(2, 33, __pyx_L1_error) + __pyx_ptype_6gevent_8__waiter_MultipleWaiter = __Pyx_ImportType(__pyx_t_1, "gevent.__waiter", "MultipleWaiter", sizeof(struct __pyx_obj_6gevent_8__waiter_MultipleWaiter), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_8__waiter_MultipleWaiter) __PYX_ERR(2, 47, __pyx_L1_error) + __pyx_vtabptr_6gevent_8__waiter_MultipleWaiter = (struct __pyx_vtabstruct_6gevent_8__waiter_MultipleWaiter*)__Pyx_GetVtable(__pyx_ptype_6gevent_8__waiter_MultipleWaiter->tp_dict); if (unlikely(!__pyx_vtabptr_6gevent_8__waiter_MultipleWaiter)) __PYX_ERR(2, 47, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_modinit_variable_import_code(void) { + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); + /*--- Variable import code ---*/ + __pyx_t_1 = PyImport_ImportModule("gevent.__greenlet_primitives"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_1, "get_objects", (void **)&__pyx_vp_6gevent_21__greenlet_primitives_get_objects, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_1, "wref", (void **)&__pyx_vp_6gevent_21__greenlet_primitives_wref, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_1, "BlockingSwitchOutError", (void **)&__pyx_vp_6gevent_21__greenlet_primitives_BlockingSwitchOutError, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_1, "_greenlet_imported", (void **)&__pyx_vp_6gevent_21__greenlet_primitives__greenlet_imported, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + Py_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_2 = PyImport_ImportModule("gevent.__hub_local"); if (!__pyx_t_2) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_2, "_threadlocal", (void **)&__pyx_vp_6gevent_11__hub_local__threadlocal, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + Py_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_3 = PyImport_ImportModule("gevent.__waiter"); if (!__pyx_t_3) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_3, "sys", (void **)&__pyx_vp_6gevent_8__waiter_sys, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_3, "ConcurrentObjectUseError", (void **)&__pyx_vp_6gevent_8__waiter_ConcurrentObjectUseError, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_3, "_greenlet_imported", (void **)&__pyx_vp_6gevent_8__waiter__greenlet_imported, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_3, "_NONE", (void **)&__pyx_vp_6gevent_8__waiter__NONE, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + Py_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_modinit_function_import_code(void) { + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); + /*--- Function import code ---*/ + __pyx_t_1 = PyImport_ImportModule("gevent.__hub_local"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportFunction(__pyx_t_1, "get_hub_noargs", (void (**)(void))&__pyx_f_6gevent_11__hub_local_get_hub_noargs, "struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *(int __pyx_skip_dispatch)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + Py_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_RefNannyFinishContext(); + return -1; +} + + +#if PY_MAJOR_VERSION < 3 +#ifdef CYTHON_NO_PYINIT_EXPORT +#define __Pyx_PyMODINIT_FUNC void +#else +#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC +#endif +#else +#ifdef CYTHON_NO_PYINIT_EXPORT +#define __Pyx_PyMODINIT_FUNC PyObject * +#else +#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC +#endif +#endif + + +#if PY_MAJOR_VERSION < 3 +__Pyx_PyMODINIT_FUNC init__hub_primitives(void) CYTHON_SMALL_CODE; /*proto*/ +__Pyx_PyMODINIT_FUNC init__hub_primitives(void) +#else +__Pyx_PyMODINIT_FUNC PyInit___hub_primitives(void) CYTHON_SMALL_CODE; /*proto*/ +__Pyx_PyMODINIT_FUNC PyInit___hub_primitives(void) +#if CYTHON_PEP489_MULTI_PHASE_INIT +{ + return PyModuleDef_Init(&__pyx_moduledef); +} +static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { + #if PY_VERSION_HEX >= 0x030700A1 + static PY_INT64_T main_interpreter_id = -1; + PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); + if (main_interpreter_id == -1) { + main_interpreter_id = current_id; + return (unlikely(current_id == -1)) ? -1 : 0; + } else if (unlikely(main_interpreter_id != current_id)) + #else + static PyInterpreterState *main_interpreter = NULL; + PyInterpreterState *current_interpreter = PyThreadState_Get()->interp; + if (!main_interpreter) { + main_interpreter = current_interpreter; + } else if (unlikely(main_interpreter != current_interpreter)) + #endif + { + PyErr_SetString( + PyExc_ImportError, + "Interpreter change detected - this module can only be loaded into one interpreter per process."); + return -1; + } + return 0; +} +static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) { + PyObject *value = PyObject_GetAttrString(spec, from_name); + int result = 0; + if (likely(value)) { + if (allow_none || value != Py_None) { + result = PyDict_SetItemString(moddict, to_name, value); + } + Py_DECREF(value); + } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_Clear(); + } else { + result = -1; + } + return result; +} +static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) { + PyObject *module = NULL, *moddict, *modname; + if (__Pyx_check_single_interpreter()) + return NULL; + if (__pyx_m) + return __Pyx_NewRef(__pyx_m); + modname = PyObject_GetAttrString(spec, "name"); + if (unlikely(!modname)) goto bad; + module = PyModule_NewObject(modname); + Py_DECREF(modname); + if (unlikely(!module)) goto bad; + moddict = PyModule_GetDict(module); + if (unlikely(!moddict)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad; + return module; +bad: + Py_XDECREF(module); + return NULL; +} + + +static CYTHON_SMALL_CODE int __pyx_pymod_exec___hub_primitives(PyObject *__pyx_pyinit_module) +#endif +#endif +{ + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannyDeclarations + #if CYTHON_PEP489_MULTI_PHASE_INIT + if (__pyx_m) { + if (__pyx_m == __pyx_pyinit_module) return 0; + PyErr_SetString(PyExc_RuntimeError, "Module '__hub_primitives' has already been imported. Re-initialisation is not supported."); + return -1; + } + #elif PY_MAJOR_VERSION >= 3 + if (__pyx_m) return __Pyx_NewRef(__pyx_m); + #endif + #if CYTHON_REFNANNY +__Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); +if (!__Pyx_RefNanny) { + PyErr_Clear(); + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); + if (!__Pyx_RefNanny) + Py_FatalError("failed to import 'refnanny' module"); +} +#endif + __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit___hub_primitives(void)", 0); + if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #ifdef __Pxy_PyFrame_Initialize_Offsets + __Pxy_PyFrame_Initialize_Offsets(); + #endif + __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) + #ifdef __Pyx_CyFunction_USED + if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_FusedFunction_USED + if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_Coroutine_USED + if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_Generator_USED + if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_AsyncGen_USED + if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_StopAsyncIteration_USED + if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + /*--- Library function declarations ---*/ + /*--- Threads initialization code ---*/ + #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS + #ifdef WITH_THREAD /* Python build with threading support? */ + PyEval_InitThreads(); + #endif + #endif + /*--- Module creation code ---*/ + #if CYTHON_PEP489_MULTI_PHASE_INIT + __pyx_m = __pyx_pyinit_module; + Py_INCREF(__pyx_m); + #else + #if PY_MAJOR_VERSION < 3 + __pyx_m = Py_InitModule4("__hub_primitives", __pyx_methods, __pyx_k_A_collection_of_primitives_used, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); + #else + __pyx_m = PyModule_Create(&__pyx_moduledef); + #endif + if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) + Py_INCREF(__pyx_d); + __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) + #if CYTHON_COMPILING_IN_PYPY + Py_INCREF(__pyx_b); + #endif + if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + /*--- Initialize various global constants etc. ---*/ + if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) + if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + if (__pyx_module_is_main_gevent____hub_primitives) { + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + } + #if PY_MAJOR_VERSION >= 3 + { + PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) + if (!PyDict_GetItemString(modules, "gevent.__hub_primitives")) { + if (unlikely(PyDict_SetItemString(modules, "gevent.__hub_primitives", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error) + } + } + #endif + /*--- Builtin init code ---*/ + if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + /*--- Constants init code ---*/ + if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + /*--- Global type/function init code ---*/ + (void)__Pyx_modinit_global_init_code(); + if (unlikely(__Pyx_modinit_variable_export_code() != 0)) goto __pyx_L1_error; + if (unlikely(__Pyx_modinit_function_export_code() != 0)) goto __pyx_L1_error; + if (unlikely(__Pyx_modinit_type_init_code() != 0)) goto __pyx_L1_error; + if (unlikely(__Pyx_modinit_type_import_code() != 0)) goto __pyx_L1_error; + if (unlikely(__Pyx_modinit_variable_import_code() != 0)) goto __pyx_L1_error; + if (unlikely(__Pyx_modinit_function_import_code() != 0)) goto __pyx_L1_error; + /*--- Execution code ---*/ + #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) + if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + + /* "src/gevent/_hub_primitives.py":14 + * from __future__ import print_function + * + * import traceback # <<<<<<<<<<<<<< + * + * from gevent.exceptions import InvalidSwitchError + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_traceback, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 14, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_v_6gevent_16__hub_primitives_traceback); + __Pyx_DECREF_SET(__pyx_v_6gevent_16__hub_primitives_traceback, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + + /* "src/gevent/_hub_primitives.py":16 + * import traceback + * + * from gevent.exceptions import InvalidSwitchError # <<<<<<<<<<<<<< + * from gevent.exceptions import ConcurrentObjectUseError + * + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 16, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_InvalidSwitchError); + __Pyx_GIVEREF(__pyx_n_s_InvalidSwitchError); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_InvalidSwitchError); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_gevent_exceptions, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 16, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_InvalidSwitchError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 16, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_v_6gevent_16__hub_primitives_InvalidSwitchError); + __Pyx_DECREF_SET(__pyx_v_6gevent_16__hub_primitives_InvalidSwitchError, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/_hub_primitives.py":17 + * + * from gevent.exceptions import InvalidSwitchError + * from gevent.exceptions import ConcurrentObjectUseError # <<<<<<<<<<<<<< + * + * from gevent import _greenlet_primitives + */ + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 17, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_ConcurrentObjectUseError); + __Pyx_GIVEREF(__pyx_n_s_ConcurrentObjectUseError); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_ConcurrentObjectUseError); + __pyx_t_1 = __Pyx_Import(__pyx_n_s_gevent_exceptions, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 17, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_ConcurrentObjectUseError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 17, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ConcurrentObjectUseError, __pyx_t_2) < 0) __PYX_ERR(0, 17, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_hub_primitives.py":19 + * from gevent.exceptions import ConcurrentObjectUseError + * + * from gevent import _greenlet_primitives # <<<<<<<<<<<<<< + * from gevent import _waiter + * from gevent._util import _NONE + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 19, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_greenlet_primitives); + __Pyx_GIVEREF(__pyx_n_s_greenlet_primitives); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_greenlet_primitives); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_gevent, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 19, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_greenlet_primitives); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 19, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_v_6gevent_16__hub_primitives__greenlet_primitives); + __Pyx_DECREF_SET(__pyx_v_6gevent_16__hub_primitives__greenlet_primitives, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/_hub_primitives.py":20 + * + * from gevent import _greenlet_primitives + * from gevent import _waiter # <<<<<<<<<<<<<< + * from gevent._util import _NONE + * from gevent._hub_local import get_hub_noargs as get_hub + */ + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 20, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_waiter); + __Pyx_GIVEREF(__pyx_n_s_waiter); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_waiter); + __pyx_t_1 = __Pyx_Import(__pyx_n_s_gevent, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 20, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_waiter); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 20, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_v_6gevent_16__hub_primitives__waiter); + __Pyx_DECREF_SET(__pyx_v_6gevent_16__hub_primitives__waiter, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_hub_primitives.py":21 + * from gevent import _greenlet_primitives + * from gevent import _waiter + * from gevent._util import _NONE # <<<<<<<<<<<<<< + * from gevent._hub_local import get_hub_noargs as get_hub + * from gevent.timeout import Timeout + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 21, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_NONE); + __Pyx_GIVEREF(__pyx_n_s_NONE); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_NONE); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_gevent__util, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 21, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_NONE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 21, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_NONE, __pyx_t_1) < 0) __PYX_ERR(0, 21, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/_hub_primitives.py":22 + * from gevent import _waiter + * from gevent._util import _NONE + * from gevent._hub_local import get_hub_noargs as get_hub # <<<<<<<<<<<<<< + * from gevent.timeout import Timeout + * + */ + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 22, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_get_hub_noargs); + __Pyx_GIVEREF(__pyx_n_s_get_hub_noargs); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_get_hub_noargs); + __pyx_t_1 = __Pyx_Import(__pyx_n_s_gevent__hub_local, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 22, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_get_hub_noargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 22, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_hub_noargs, __pyx_t_2) < 0) __PYX_ERR(0, 22, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_hub_primitives.py":23 + * from gevent._util import _NONE + * from gevent._hub_local import get_hub_noargs as get_hub + * from gevent.timeout import Timeout # <<<<<<<<<<<<<< + * + * # In Cython, we define these as 'cdef inline' functions. The + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 23, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_Timeout); + __Pyx_GIVEREF(__pyx_n_s_Timeout); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_Timeout); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_gevent_timeout, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 23, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_Timeout); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 23, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_v_6gevent_16__hub_primitives_Timeout); + __Pyx_DECREF_SET(__pyx_v_6gevent_16__hub_primitives_Timeout, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/_hub_primitives.py":29 + * # is assignment) without generating a 'lvalue is not valid target' + * # error. + * locals()['getcurrent'] = __import__('greenlet').getcurrent # <<<<<<<<<<<<<< + * locals()['greenlet_init'] = lambda: None + * locals()['Waiter'] = _waiter.Waiter + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin___import__, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 29, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_getcurrent); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 29, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_Globals(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 29, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (unlikely(PyDict_SetItem(__pyx_t_2, __pyx_n_s_getcurrent, __pyx_t_1) < 0)) __PYX_ERR(0, 29, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_hub_primitives.py":30 + * # error. + * locals()['getcurrent'] = __import__('greenlet').getcurrent + * locals()['greenlet_init'] = lambda: None # <<<<<<<<<<<<<< + * locals()['Waiter'] = _waiter.Waiter + * locals()['MultipleWaiter'] = _waiter.MultipleWaiter + */ + __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_16__hub_primitives_18lambda, 0, __pyx_n_s_lambda, NULL, __pyx_n_s_gevent___hub_primitives, __pyx_d, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 30, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_Globals(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 30, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (unlikely(PyDict_SetItem(__pyx_t_2, __pyx_n_s_greenlet_init, __pyx_t_1) < 0)) __PYX_ERR(0, 30, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_hub_primitives.py":31 + * locals()['getcurrent'] = __import__('greenlet').getcurrent + * locals()['greenlet_init'] = lambda: None + * locals()['Waiter'] = _waiter.Waiter # <<<<<<<<<<<<<< + * locals()['MultipleWaiter'] = _waiter.MultipleWaiter + * locals()['SwitchOutGreenletWithLoop'] = _greenlet_primitives.SwitchOutGreenletWithLoop + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_6gevent_16__hub_primitives__waiter, __pyx_n_s_Waiter); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 31, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_Globals(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 31, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (unlikely(PyDict_SetItem(__pyx_t_2, __pyx_n_s_Waiter, __pyx_t_1) < 0)) __PYX_ERR(0, 31, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_hub_primitives.py":32 + * locals()['greenlet_init'] = lambda: None + * locals()['Waiter'] = _waiter.Waiter + * locals()['MultipleWaiter'] = _waiter.MultipleWaiter # <<<<<<<<<<<<<< + * locals()['SwitchOutGreenletWithLoop'] = _greenlet_primitives.SwitchOutGreenletWithLoop + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_6gevent_16__hub_primitives__waiter, __pyx_n_s_MultipleWaiter); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 32, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_Globals(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 32, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (unlikely(PyDict_SetItem(__pyx_t_2, __pyx_n_s_MultipleWaiter, __pyx_t_1) < 0)) __PYX_ERR(0, 32, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_hub_primitives.py":33 + * locals()['Waiter'] = _waiter.Waiter + * locals()['MultipleWaiter'] = _waiter.MultipleWaiter + * locals()['SwitchOutGreenletWithLoop'] = _greenlet_primitives.SwitchOutGreenletWithLoop # <<<<<<<<<<<<<< + * + * __all__ = [ + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_6gevent_16__hub_primitives__greenlet_primitives, __pyx_n_s_SwitchOutGreenletWithLoop); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 33, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_Globals(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 33, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (unlikely(PyDict_SetItem(__pyx_t_2, __pyx_n_s_SwitchOutGreenletWithLoop, __pyx_t_1) < 0)) __PYX_ERR(0, 33, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_hub_primitives.py":35 + * locals()['SwitchOutGreenletWithLoop'] = _greenlet_primitives.SwitchOutGreenletWithLoop + * + * __all__ = [ # <<<<<<<<<<<<<< + * 'WaitOperationsGreenlet', + * 'iwait_on_objects', + */ + __pyx_t_1 = PyList_New(6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 35, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_WaitOperationsGreenlet); + __Pyx_GIVEREF(__pyx_n_s_WaitOperationsGreenlet); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_WaitOperationsGreenlet); + __Pyx_INCREF(__pyx_n_s_iwait_on_objects); + __Pyx_GIVEREF(__pyx_n_s_iwait_on_objects); + PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_iwait_on_objects); + __Pyx_INCREF(__pyx_n_s_wait_on_objects); + __Pyx_GIVEREF(__pyx_n_s_wait_on_objects); + PyList_SET_ITEM(__pyx_t_1, 2, __pyx_n_s_wait_on_objects); + __Pyx_INCREF(__pyx_n_s_wait_read); + __Pyx_GIVEREF(__pyx_n_s_wait_read); + PyList_SET_ITEM(__pyx_t_1, 3, __pyx_n_s_wait_read); + __Pyx_INCREF(__pyx_n_s_wait_write); + __Pyx_GIVEREF(__pyx_n_s_wait_write); + PyList_SET_ITEM(__pyx_t_1, 4, __pyx_n_s_wait_write); + __Pyx_INCREF(__pyx_n_s_wait_readwrite); + __Pyx_GIVEREF(__pyx_n_s_wait_readwrite); + PyList_SET_ITEM(__pyx_t_1, 5, __pyx_n_s_wait_readwrite); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_all, __pyx_t_1) < 0) __PYX_ERR(0, 35, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_hub_primitives.py":46 + * class WaitOperationsGreenlet(SwitchOutGreenletWithLoop): # pylint:disable=undefined-variable + * + * def wait(self, watcher): # <<<<<<<<<<<<<< + * """ + * Wait until the *watcher* (which must not be started) is ready. + */ + __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_16__hub_primitives_22WaitOperationsGreenlet_1wait, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_WaitOperationsGreenlet_wait, NULL, __pyx_n_s_gevent___hub_primitives, __pyx_d, ((PyObject *)__pyx_codeobj__10)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 46, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_16__hub_primitives_WaitOperationsGreenlet->tp_dict, __pyx_n_s_wait, __pyx_t_1) < 0) __PYX_ERR(0, 46, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + PyType_Modified(__pyx_ptype_6gevent_16__hub_primitives_WaitOperationsGreenlet); + + /* "src/gevent/_hub_primitives.py":63 + * watcher.stop() + * + * def cancel_wait(self, watcher, error, close_watcher=False): # <<<<<<<<<<<<<< + * """ + * Cancel an in-progress call to :meth:`wait` by throwing the given *error* + */ + __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_16__hub_primitives_22WaitOperationsGreenlet_3cancel_wait, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_WaitOperationsGreenlet_cancel_wa, NULL, __pyx_n_s_gevent___hub_primitives, __pyx_d, ((PyObject *)__pyx_codeobj__12)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 63, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_16__hub_primitives_WaitOperationsGreenlet->tp_dict, __pyx_n_s_cancel_wait, __pyx_t_1) < 0) __PYX_ERR(0, 63, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + PyType_Modified(__pyx_ptype_6gevent_16__hub_primitives_WaitOperationsGreenlet); + + /* "src/gevent/_hub_primitives.py":84 + * watcher.close() + * + * def _cancel_wait(self, watcher, error, close_watcher): # <<<<<<<<<<<<<< + * # We have to check again to see if it was still active by the time + * # our callback actually runs. + */ + __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_16__hub_primitives_22WaitOperationsGreenlet_5_cancel_wait, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_WaitOperationsGreenlet__cancel_w, NULL, __pyx_n_s_gevent___hub_primitives, __pyx_d, ((PyObject *)__pyx_codeobj__14)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 84, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_16__hub_primitives_WaitOperationsGreenlet->tp_dict, __pyx_n_s_cancel_wait_2, __pyx_t_1) < 0) __PYX_ERR(0, 84, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + PyType_Modified(__pyx_ptype_6gevent_16__hub_primitives_WaitOperationsGreenlet); + + /* "src/gevent/_hub_primitives.py":154 + * raise + * + * next = __next__ # <<<<<<<<<<<<<< + * + * def _cleanup(self): + */ + __Pyx_GetNameInClass(__pyx_t_1, (PyObject *)__pyx_ptype_6gevent_16__hub_primitives__WaitIterator, __pyx_n_s_next); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 154, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_16__hub_primitives__WaitIterator->tp_dict, __pyx_n_s_next_2, __pyx_t_1) < 0) __PYX_ERR(0, 154, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + PyType_Modified(__pyx_ptype_6gevent_16__hub_primitives__WaitIterator); + + /* "src/gevent/_hub_primitives.py":171 + * traceback.print_exc() + * + * def __enter__(self): # <<<<<<<<<<<<<< + * return self + * + */ + __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_16__hub_primitives_13_WaitIterator_7__enter__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_WaitIterator___enter, NULL, __pyx_n_s_gevent___hub_primitives, __pyx_d, ((PyObject *)__pyx_codeobj__16)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 171, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_16__hub_primitives__WaitIterator->tp_dict, __pyx_n_s_enter, __pyx_t_1) < 0) __PYX_ERR(0, 171, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + PyType_Modified(__pyx_ptype_6gevent_16__hub_primitives__WaitIterator); + + /* "src/gevent/_hub_primitives.py":174 + * return self + * + * def __exit__(self, typ, value, tb): # <<<<<<<<<<<<<< + * self._cleanup() + * + */ + __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_16__hub_primitives_13_WaitIterator_9__exit__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_WaitIterator___exit, NULL, __pyx_n_s_gevent___hub_primitives, __pyx_d, ((PyObject *)__pyx_codeobj__18)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 174, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_16__hub_primitives__WaitIterator->tp_dict, __pyx_n_s_exit, __pyx_t_1) < 0) __PYX_ERR(0, 174, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + PyType_Modified(__pyx_ptype_6gevent_16__hub_primitives__WaitIterator); + + /* "src/gevent/_hub_primitives.py":178 + * + * + * def iwait_on_objects(objects, timeout=None, count=None): # <<<<<<<<<<<<<< + * """ + * Iteratively yield *objects* as they are ready, until all (or *count*) are ready + */ + __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_16__hub_primitives_1iwait_on_objects, 0, __pyx_n_s_iwait_on_objects, NULL, __pyx_n_s_gevent___hub_primitives, __pyx_d, ((PyObject *)__pyx_codeobj__20)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 178, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_iwait_on_objects, __pyx_t_1) < 0) __PYX_ERR(0, 178, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_hub_primitives.py":217 + * + * + * def wait_on_objects(objects=None, timeout=None, count=None): # <<<<<<<<<<<<<< + * """ + * Wait for ``objects`` to become ready or for event loop to finish. + */ + __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_16__hub_primitives_3wait_on_objects, 0, __pyx_n_s_wait_on_objects, NULL, __pyx_n_s_gevent___hub_primitives, __pyx_d, ((PyObject *)__pyx_codeobj__22)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 217, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_wait_on_objects, __pyx_t_1) < 0) __PYX_ERR(0, 217, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_hub_primitives.py":256 + * return list(iwait_on_objects(objects, timeout, count)) + * + * _timeout_error = Exception # <<<<<<<<<<<<<< + * + * def set_default_timeout_error(e): + */ + __Pyx_INCREF(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); + __Pyx_XGOTREF(__pyx_v_6gevent_16__hub_primitives__timeout_error); + __Pyx_DECREF_SET(__pyx_v_6gevent_16__hub_primitives__timeout_error, ((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); + __Pyx_GIVEREF(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); + + /* "src/gevent/_hub_primitives.py":258 + * _timeout_error = Exception + * + * def set_default_timeout_error(e): # <<<<<<<<<<<<<< + * global _timeout_error + * _timeout_error = e + */ + __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_16__hub_primitives_5set_default_timeout_error, 0, __pyx_n_s_set_default_timeout_error, NULL, __pyx_n_s_gevent___hub_primitives, __pyx_d, ((PyObject *)__pyx_codeobj__24)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 258, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_default_timeout_error, __pyx_t_1) < 0) __PYX_ERR(0, 258, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_hub_primitives.py":284 + * + * # Suitable to be bound as an instance method + * def wait_on_socket(socket, watcher, timeout_exc=None): # <<<<<<<<<<<<<< + * if socket is None or watcher is None: + * # test__hub TestCloseSocketWhilePolling, on Python 2; Python 3 + */ + __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_16__hub_primitives_7wait_on_socket, 0, __pyx_n_s_wait_on_socket, NULL, __pyx_n_s_gevent___hub_primitives, __pyx_d, ((PyObject *)__pyx_codeobj__26)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 284, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_wait_on_socket, __pyx_t_1) < 0) __PYX_ERR(0, 284, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_hub_primitives.py":293 + * socket.hub) + * + * def wait_on_watcher(watcher, timeout=None, timeout_exc=_NONE, hub=None): # <<<<<<<<<<<<<< + * """ + * wait(watcher, timeout=None, [timeout_exc=None]) -> None + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_NONE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 293, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_k__2 = __pyx_t_1; + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_NONE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 293, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_k__2 = __pyx_t_1; + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_16__hub_primitives_9wait_on_watcher, 0, __pyx_n_s_wait_on_watcher, NULL, __pyx_n_s_gevent___hub_primitives, __pyx_d, ((PyObject *)__pyx_codeobj__28)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 293, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_wait_on_watcher, __pyx_t_1) < 0) __PYX_ERR(0, 293, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_hub_primitives.py":320 + * + * + * def wait_read(fileno, timeout=None, timeout_exc=_NONE): # <<<<<<<<<<<<<< + * """ + * wait_read(fileno, timeout=None, [timeout_exc=None]) -> None + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_NONE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 320, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_k__3 = __pyx_t_1; + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_NONE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 320, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_k__3 = __pyx_t_1; + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_16__hub_primitives_11wait_read, 0, __pyx_n_s_wait_read, NULL, __pyx_n_s_gevent___hub_primitives, __pyx_d, ((PyObject *)__pyx_codeobj__30)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 320, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_wait_read, __pyx_t_1) < 0) __PYX_ERR(0, 320, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_hub_primitives.py":339 + * + * + * def wait_write(fileno, timeout=None, timeout_exc=_NONE, event=_NONE): # <<<<<<<<<<<<<< + * """ + * wait_write(fileno, timeout=None, [timeout_exc=None]) -> None + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_NONE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 339, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_k__4 = __pyx_t_1; + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_NONE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 339, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_k__5 = __pyx_t_1; + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_NONE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 339, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_k__4 = __pyx_t_1; + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_NONE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 339, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_k__5 = __pyx_t_1; + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_16__hub_primitives_13wait_write, 0, __pyx_n_s_wait_write, NULL, __pyx_n_s_gevent___hub_primitives, __pyx_d, ((PyObject *)__pyx_codeobj__32)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 339, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_wait_write, __pyx_t_1) < 0) __PYX_ERR(0, 339, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_hub_primitives.py":363 + * + * + * def wait_readwrite(fileno, timeout=None, timeout_exc=_NONE, event=_NONE): # <<<<<<<<<<<<<< + * """ + * wait_readwrite(fileno, timeout=None, [timeout_exc=None]) -> None + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_NONE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 363, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_k__6 = __pyx_t_1; + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_NONE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 363, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_k__7 = __pyx_t_1; + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_NONE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 363, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_k__6 = __pyx_t_1; + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_NONE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 363, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_k__7 = __pyx_t_1; + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_16__hub_primitives_15wait_readwrite, 0, __pyx_n_s_wait_readwrite, NULL, __pyx_n_s_gevent___hub_primitives, __pyx_d, ((PyObject *)__pyx_codeobj__34)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 363, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_wait_readwrite, __pyx_t_1) < 0) __PYX_ERR(0, 363, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_hub_primitives.py":388 + * + * + * def _init(): # <<<<<<<<<<<<<< + * greenlet_init() # pylint:disable=undefined-variable + * + */ + __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_16__hub_primitives_17_init, 0, __pyx_n_s_init, NULL, __pyx_n_s_gevent___hub_primitives, __pyx_d, ((PyObject *)__pyx_codeobj__35)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 388, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_init, __pyx_t_1) < 0) __PYX_ERR(0, 388, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_hub_primitives.py":391 + * greenlet_init() # pylint:disable=undefined-variable + * + * _init() # <<<<<<<<<<<<<< + * + * from gevent._util import import_c_accel + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_init); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 391, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 391, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/_hub_primitives.py":393 + * _init() + * + * from gevent._util import import_c_accel # <<<<<<<<<<<<<< + * import_c_accel(globals(), 'gevent.__hub_primitives') + */ + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 393, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_import_c_accel); + __Pyx_GIVEREF(__pyx_n_s_import_c_accel); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_import_c_accel); + __pyx_t_1 = __Pyx_Import(__pyx_n_s_gevent__util, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 393, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_import_c_accel); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 393, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_import_c_accel, __pyx_t_2) < 0) __PYX_ERR(0, 393, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_hub_primitives.py":394 + * + * from gevent._util import import_c_accel + * import_c_accel(globals(), 'gevent.__hub_primitives') # <<<<<<<<<<<<<< + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_import_c_accel); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 394, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_Globals(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 394, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 394, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __Pyx_INCREF(__pyx_n_s_gevent___hub_primitives); + __Pyx_GIVEREF(__pyx_n_s_gevent___hub_primitives); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_n_s_gevent___hub_primitives); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 394, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/_hub_primitives.py":1 + * # -*- coding: utf-8 -*- # <<<<<<<<<<<<<< + * # copyright (c) 2018 gevent. See LICENSE. + * # cython: auto_pickle=False,embedsignature=True,always_allow_keywords=False,binding=True + */ + __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "gevent/__hub_primitives.pxd":34 + * cdef bint _greenlet_imported + * + * cdef inline void greenlet_init(): # <<<<<<<<<<<<<< + * global _greenlet_imported + * if not _greenlet_imported: + */ + + /*--- Wrapped vars code ---*/ + + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + if (__pyx_m) { + if (__pyx_d) { + __Pyx_AddTraceback("init gevent.__hub_primitives", __pyx_clineno, __pyx_lineno, __pyx_filename); + } + Py_CLEAR(__pyx_m); + } else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_ImportError, "init gevent.__hub_primitives"); + } + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + #if CYTHON_PEP489_MULTI_PHASE_INIT + return (__pyx_m != NULL) ? 0 : -1; + #elif PY_MAJOR_VERSION >= 3 + return __pyx_m; + #else + return; + #endif +} + +/* --- Runtime support code --- */ +/* Refnanny */ +#if CYTHON_REFNANNY +static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { + PyObject *m = NULL, *p = NULL; + void *r = NULL; + m = PyImport_ImportModule(modname); + if (!m) goto end; + p = PyObject_GetAttrString(m, "RefNannyAPI"); + if (!p) goto end; + r = PyLong_AsVoidPtr(p); +end: + Py_XDECREF(p); + Py_XDECREF(m); + return (__Pyx_RefNannyAPIStruct *)r; +} +#endif + +/* PyObjectGetAttrStr */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_getattro)) + return tp->tp_getattro(obj, attr_name); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_getattr)) + return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); +#endif + return PyObject_GetAttr(obj, attr_name); +} +#endif + +/* GetBuiltinName */ +static PyObject *__Pyx_GetBuiltinName(PyObject *name) { + PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name); + if (unlikely(!result)) { + PyErr_Format(PyExc_NameError, +#if PY_MAJOR_VERSION >= 3 + "name '%U' is not defined", name); +#else + "name '%.200s' is not defined", PyString_AS_STRING(name)); +#endif + } + return result; +} + +/* PyCFunctionFastCall */ +#if CYTHON_FAST_PYCCALL +static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) { + PyCFunctionObject *func = (PyCFunctionObject*)func_obj; + PyCFunction meth = PyCFunction_GET_FUNCTION(func); + PyObject *self = PyCFunction_GET_SELF(func); + int flags = PyCFunction_GET_FLAGS(func); + assert(PyCFunction_Check(func)); + assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS))); + assert(nargs >= 0); + assert(nargs == 0 || args != NULL); + /* _PyCFunction_FastCallDict() must not be called with an exception set, + because it may clear it (directly or indirectly) and so the + caller loses its exception */ + assert(!PyErr_Occurred()); + if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) { + return (*((__Pyx_PyCFunctionFastWithKeywords)(void*)meth)) (self, args, nargs, NULL); + } else { + return (*((__Pyx_PyCFunctionFast)(void*)meth)) (self, args, nargs); + } +} +#endif + +/* PyFunctionFastCall */ +#if CYTHON_FAST_PYCALL +static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, + PyObject *globals) { + PyFrameObject *f; + PyThreadState *tstate = __Pyx_PyThreadState_Current; + PyObject **fastlocals; + Py_ssize_t i; + PyObject *result; + assert(globals != NULL); + /* XXX Perhaps we should create a specialized + PyFrame_New() that doesn't take locals, but does + take builtins without sanity checking them. + */ + assert(tstate != NULL); + f = PyFrame_New(tstate, co, globals, NULL); + if (f == NULL) { + return NULL; + } + fastlocals = __Pyx_PyFrame_GetLocalsplus(f); + for (i = 0; i < na; i++) { + Py_INCREF(*args); + fastlocals[i] = *args++; + } + result = PyEval_EvalFrameEx(f,0); + ++tstate->recursion_depth; + Py_DECREF(f); + --tstate->recursion_depth; + return result; +} +#if 1 || PY_VERSION_HEX < 0x030600B1 +static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs) { + PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); + PyObject *globals = PyFunction_GET_GLOBALS(func); + PyObject *argdefs = PyFunction_GET_DEFAULTS(func); + PyObject *closure; +#if PY_MAJOR_VERSION >= 3 + PyObject *kwdefs; +#endif + PyObject *kwtuple, **k; + PyObject **d; + Py_ssize_t nd; + Py_ssize_t nk; + PyObject *result; + assert(kwargs == NULL || PyDict_Check(kwargs)); + nk = kwargs ? PyDict_Size(kwargs) : 0; + if (Py_EnterRecursiveCall((char*)" while calling a Python object")) { + return NULL; + } + if ( +#if PY_MAJOR_VERSION >= 3 + co->co_kwonlyargcount == 0 && +#endif + likely(kwargs == NULL || nk == 0) && + co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { + if (argdefs == NULL && co->co_argcount == nargs) { + result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); + goto done; + } + else if (nargs == 0 && argdefs != NULL + && co->co_argcount == Py_SIZE(argdefs)) { + /* function called with no arguments, but all parameters have + a default value: use default values as arguments .*/ + args = &PyTuple_GET_ITEM(argdefs, 0); + result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); + goto done; + } + } + if (kwargs != NULL) { + Py_ssize_t pos, i; + kwtuple = PyTuple_New(2 * nk); + if (kwtuple == NULL) { + result = NULL; + goto done; + } + k = &PyTuple_GET_ITEM(kwtuple, 0); + pos = i = 0; + while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { + Py_INCREF(k[i]); + Py_INCREF(k[i+1]); + i += 2; + } + nk = i / 2; + } + else { + kwtuple = NULL; + k = NULL; + } + closure = PyFunction_GET_CLOSURE(func); +#if PY_MAJOR_VERSION >= 3 + kwdefs = PyFunction_GET_KW_DEFAULTS(func); +#endif + if (argdefs != NULL) { + d = &PyTuple_GET_ITEM(argdefs, 0); + nd = Py_SIZE(argdefs); + } + else { + d = NULL; + nd = 0; + } +#if PY_MAJOR_VERSION >= 3 + result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, + args, nargs, + k, (int)nk, + d, (int)nd, kwdefs, closure); +#else + result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, + args, nargs, + k, (int)nk, + d, (int)nd, closure); +#endif + Py_XDECREF(kwtuple); +done: + Py_LeaveRecursiveCall(); + return result; +} +#endif +#endif + +/* PyObjectCall */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { + PyObject *result; + ternaryfunc call = func->ob_type->tp_call; + if (unlikely(!call)) + return PyObject_Call(func, arg, kw); + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; + result = (*call)(func, arg, kw); + Py_LeaveRecursiveCall(); + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +/* PyObjectCall2Args */ +static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) { + PyObject *args, *result = NULL; + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(function)) { + PyObject *args[2] = {arg1, arg2}; + return __Pyx_PyFunction_FastCall(function, args, 2); + } + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(function)) { + PyObject *args[2] = {arg1, arg2}; + return __Pyx_PyCFunction_FastCall(function, args, 2); + } + #endif + args = PyTuple_New(2); + if (unlikely(!args)) goto done; + Py_INCREF(arg1); + PyTuple_SET_ITEM(args, 0, arg1); + Py_INCREF(arg2); + PyTuple_SET_ITEM(args, 1, arg2); + Py_INCREF(function); + result = __Pyx_PyObject_Call(function, args, NULL); + Py_DECREF(args); + Py_DECREF(function); +done: + return result; +} + +/* PyObjectCallMethO */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { + PyObject *self, *result; + PyCFunction cfunc; + cfunc = PyCFunction_GET_FUNCTION(func); + self = PyCFunction_GET_SELF(func); + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; + result = cfunc(self, arg); + Py_LeaveRecursiveCall(); + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +/* PyObjectCallOneArg */ +#if CYTHON_COMPILING_IN_CPYTHON +static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) { + PyObject *result; + PyObject *args = PyTuple_New(1); + if (unlikely(!args)) return NULL; + Py_INCREF(arg); + PyTuple_SET_ITEM(args, 0, arg); + result = __Pyx_PyObject_Call(func, args, NULL); + Py_DECREF(args); + return result; +} +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { +#if CYTHON_FAST_PYCALL + if (PyFunction_Check(func)) { + return __Pyx_PyFunction_FastCall(func, &arg, 1); + } +#endif + if (likely(PyCFunction_Check(func))) { + if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) { + return __Pyx_PyObject_CallMethO(func, arg); +#if CYTHON_FAST_PYCCALL + } else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) { + return __Pyx_PyCFunction_FastCall(func, &arg, 1); +#endif + } + } + return __Pyx__PyObject_CallOneArg(func, arg); +} +#else +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { + PyObject *result; + PyObject *args = PyTuple_Pack(1, arg); + if (unlikely(!args)) return NULL; + result = __Pyx_PyObject_Call(func, args, NULL); + Py_DECREF(args); + return result; +} +#endif + +/* PyErrFetchRestore */ +#if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + tmp_type = tstate->curexc_type; + tmp_value = tstate->curexc_value; + tmp_tb = tstate->curexc_traceback; + tstate->curexc_type = type; + tstate->curexc_value = value; + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +} +static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { + *type = tstate->curexc_type; + *value = tstate->curexc_value; + *tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +} +#endif + +/* RaiseException */ +#if PY_MAJOR_VERSION < 3 +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, + CYTHON_UNUSED PyObject *cause) { + __Pyx_PyThreadState_declare + Py_XINCREF(type); + if (!value || value == Py_None) + value = NULL; + else + Py_INCREF(value); + if (!tb || tb == Py_None) + tb = NULL; + else { + Py_INCREF(tb); + if (!PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto raise_error; + } + } + if (PyType_Check(type)) { +#if CYTHON_COMPILING_IN_PYPY + if (!value) { + Py_INCREF(Py_None); + value = Py_None; + } +#endif + PyErr_NormalizeException(&type, &value, &tb); + } else { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto raise_error; + } + value = type; + type = (PyObject*) Py_TYPE(type); + Py_INCREF(type); + if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto raise_error; + } + } + __Pyx_PyThreadState_assign + __Pyx_ErrRestore(type, value, tb); + return; +raise_error: + Py_XDECREF(value); + Py_XDECREF(type); + Py_XDECREF(tb); + return; +} +#else +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { + PyObject* owned_instance = NULL; + if (tb == Py_None) { + tb = 0; + } else if (tb && !PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto bad; + } + if (value == Py_None) + value = 0; + if (PyExceptionInstance_Check(type)) { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto bad; + } + value = type; + type = (PyObject*) Py_TYPE(value); + } else if (PyExceptionClass_Check(type)) { + PyObject *instance_class = NULL; + if (value && PyExceptionInstance_Check(value)) { + instance_class = (PyObject*) Py_TYPE(value); + if (instance_class != type) { + int is_subclass = PyObject_IsSubclass(instance_class, type); + if (!is_subclass) { + instance_class = NULL; + } else if (unlikely(is_subclass == -1)) { + goto bad; + } else { + type = instance_class; + } + } + } + if (!instance_class) { + PyObject *args; + if (!value) + args = PyTuple_New(0); + else if (PyTuple_Check(value)) { + Py_INCREF(value); + args = value; + } else + args = PyTuple_Pack(1, value); + if (!args) + goto bad; + owned_instance = PyObject_Call(type, args, NULL); + Py_DECREF(args); + if (!owned_instance) + goto bad; + value = owned_instance; + if (!PyExceptionInstance_Check(value)) { + PyErr_Format(PyExc_TypeError, + "calling %R should have returned an instance of " + "BaseException, not %R", + type, Py_TYPE(value)); + goto bad; + } + } + } else { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto bad; + } + if (cause) { + PyObject *fixed_cause; + if (cause == Py_None) { + fixed_cause = NULL; + } else if (PyExceptionClass_Check(cause)) { + fixed_cause = PyObject_CallObject(cause, NULL); + if (fixed_cause == NULL) + goto bad; + } else if (PyExceptionInstance_Check(cause)) { + fixed_cause = cause; + Py_INCREF(fixed_cause); + } else { + PyErr_SetString(PyExc_TypeError, + "exception causes must derive from " + "BaseException"); + goto bad; + } + PyException_SetCause(value, fixed_cause); + } + PyErr_SetObject(type, value); + if (tb) { +#if CYTHON_COMPILING_IN_PYPY + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); + Py_INCREF(tb); + PyErr_Restore(tmp_type, tmp_value, tb); + Py_XDECREF(tmp_tb); +#else + PyThreadState *tstate = __Pyx_PyThreadState_Current; + PyObject* tmp_tb = tstate->curexc_traceback; + if (tb != tmp_tb) { + Py_INCREF(tb); + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_tb); + } +#endif + } +bad: + Py_XDECREF(owned_instance); + return; +} +#endif + +/* PyObjectCallNoArg */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { +#if CYTHON_FAST_PYCALL + if (PyFunction_Check(func)) { + return __Pyx_PyFunction_FastCall(func, NULL, 0); + } +#endif +#ifdef __Pyx_CyFunction_USED + if (likely(PyCFunction_Check(func) || __Pyx_CyFunction_Check(func))) +#else + if (likely(PyCFunction_Check(func))) +#endif + { + if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) { + return __Pyx_PyObject_CallMethO(func, NULL); + } + } + return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL); +} +#endif + +/* GetException */ +#if CYTHON_FAST_THREAD_STATE +static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) +#else +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) +#endif +{ + PyObject *local_type, *local_value, *local_tb; +#if CYTHON_FAST_THREAD_STATE + PyObject *tmp_type, *tmp_value, *tmp_tb; + local_type = tstate->curexc_type; + local_value = tstate->curexc_value; + local_tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +#else + PyErr_Fetch(&local_type, &local_value, &local_tb); +#endif + PyErr_NormalizeException(&local_type, &local_value, &local_tb); +#if CYTHON_FAST_THREAD_STATE + if (unlikely(tstate->curexc_type)) +#else + if (unlikely(PyErr_Occurred())) +#endif + goto bad; + #if PY_MAJOR_VERSION >= 3 + if (local_tb) { + if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) + goto bad; + } + #endif + Py_XINCREF(local_tb); + Py_XINCREF(local_type); + Py_XINCREF(local_value); + *type = local_type; + *value = local_value; + *tb = local_tb; +#if CYTHON_FAST_THREAD_STATE + #if CYTHON_USE_EXC_INFO_STACK + { + _PyErr_StackItem *exc_info = tstate->exc_info; + tmp_type = exc_info->exc_type; + tmp_value = exc_info->exc_value; + tmp_tb = exc_info->exc_traceback; + exc_info->exc_type = local_type; + exc_info->exc_value = local_value; + exc_info->exc_traceback = local_tb; + } + #else + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = local_type; + tstate->exc_value = local_value; + tstate->exc_traceback = local_tb; + #endif + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#else + PyErr_SetExcInfo(local_type, local_value, local_tb); +#endif + return 0; +bad: + *type = 0; + *value = 0; + *tb = 0; + Py_XDECREF(local_type); + Py_XDECREF(local_value); + Py_XDECREF(local_tb); + return -1; +} + +/* SwapException */ +#if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + #if CYTHON_USE_EXC_INFO_STACK + _PyErr_StackItem *exc_info = tstate->exc_info; + tmp_type = exc_info->exc_type; + tmp_value = exc_info->exc_value; + tmp_tb = exc_info->exc_traceback; + exc_info->exc_type = *type; + exc_info->exc_value = *value; + exc_info->exc_traceback = *tb; + #else + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = *type; + tstate->exc_value = *value; + tstate->exc_traceback = *tb; + #endif + *type = tmp_type; + *value = tmp_value; + *tb = tmp_tb; +} +#else +static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb); + PyErr_SetExcInfo(*type, *value, *tb); + *type = tmp_type; + *value = tmp_value; + *tb = tmp_tb; +} +#endif + +/* GetTopmostException */ +#if CYTHON_USE_EXC_INFO_STACK +static _PyErr_StackItem * +__Pyx_PyErr_GetTopmostException(PyThreadState *tstate) +{ + _PyErr_StackItem *exc_info = tstate->exc_info; + while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) && + exc_info->previous_item != NULL) + { + exc_info = exc_info->previous_item; + } + return exc_info; +} +#endif + +/* SaveResetException */ +#if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { + #if CYTHON_USE_EXC_INFO_STACK + _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate); + *type = exc_info->exc_type; + *value = exc_info->exc_value; + *tb = exc_info->exc_traceback; + #else + *type = tstate->exc_type; + *value = tstate->exc_value; + *tb = tstate->exc_traceback; + #endif + Py_XINCREF(*type); + Py_XINCREF(*value); + Py_XINCREF(*tb); +} +static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + #if CYTHON_USE_EXC_INFO_STACK + _PyErr_StackItem *exc_info = tstate->exc_info; + tmp_type = exc_info->exc_type; + tmp_value = exc_info->exc_value; + tmp_tb = exc_info->exc_traceback; + exc_info->exc_type = type; + exc_info->exc_value = value; + exc_info->exc_traceback = tb; + #else + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = type; + tstate->exc_value = value; + tstate->exc_traceback = tb; + #endif + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +} +#endif + +/* RaiseArgTupleInvalid */ +static void __Pyx_RaiseArgtupleInvalid( + const char* func_name, + int exact, + Py_ssize_t num_min, + Py_ssize_t num_max, + Py_ssize_t num_found) +{ + Py_ssize_t num_expected; + const char *more_or_less; + if (num_found < num_min) { + num_expected = num_min; + more_or_less = "at least"; + } else { + num_expected = num_max; + more_or_less = "at most"; + } + if (exact) { + more_or_less = "exactly"; + } + PyErr_Format(PyExc_TypeError, + "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", + func_name, more_or_less, num_expected, + (num_expected == 1) ? "" : "s", num_found); +} + +/* RaiseDoubleKeywords */ +static void __Pyx_RaiseDoubleKeywordsError( + const char* func_name, + PyObject* kw_name) +{ + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION >= 3 + "%s() got multiple values for keyword argument '%U'", func_name, kw_name); + #else + "%s() got multiple values for keyword argument '%s'", func_name, + PyString_AsString(kw_name)); + #endif +} + +/* ParseKeywords */ +static int __Pyx_ParseOptionalKeywords( + PyObject *kwds, + PyObject **argnames[], + PyObject *kwds2, + PyObject *values[], + Py_ssize_t num_pos_args, + const char* function_name) +{ + PyObject *key = 0, *value = 0; + Py_ssize_t pos = 0; + PyObject*** name; + PyObject*** first_kw_arg = argnames + num_pos_args; + while (PyDict_Next(kwds, &pos, &key, &value)) { + name = first_kw_arg; + while (*name && (**name != key)) name++; + if (*name) { + values[name-argnames] = value; + continue; + } + name = first_kw_arg; + #if PY_MAJOR_VERSION < 3 + if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) { + while (*name) { + if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) + && _PyString_Eq(**name, key)) { + values[name-argnames] = value; + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + if ((**argname == key) || ( + (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) + && _PyString_Eq(**argname, key))) { + goto arg_passed_twice; + } + argname++; + } + } + } else + #endif + if (likely(PyUnicode_Check(key))) { + while (*name) { + int cmp = (**name == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 : + #endif + PyUnicode_Compare(**name, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) { + values[name-argnames] = value; + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + int cmp = (**argname == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 : + #endif + PyUnicode_Compare(**argname, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) goto arg_passed_twice; + argname++; + } + } + } else + goto invalid_keyword_type; + if (kwds2) { + if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; + } else { + goto invalid_keyword; + } + } + return 0; +arg_passed_twice: + __Pyx_RaiseDoubleKeywordsError(function_name, key); + goto bad; +invalid_keyword_type: + PyErr_Format(PyExc_TypeError, + "%.200s() keywords must be strings", function_name); + goto bad; +invalid_keyword: + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION < 3 + "%.200s() got an unexpected keyword argument '%.200s'", + function_name, PyString_AsString(key)); + #else + "%s() got an unexpected keyword argument '%U'", + function_name, key); + #endif +bad: + return -1; +} + +/* PyErrExceptionMatches */ +#if CYTHON_FAST_THREAD_STATE +static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { + Py_ssize_t i, n; + n = PyTuple_GET_SIZE(tuple); +#if PY_MAJOR_VERSION >= 3 + for (i=0; icurexc_type; + if (exc_type == err) return 1; + if (unlikely(!exc_type)) return 0; + if (unlikely(PyTuple_Check(err))) + return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err); + return __Pyx_PyErr_GivenExceptionMatches(exc_type, err); +} +#endif + +/* GetAttr */ +static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) { +#if CYTHON_USE_TYPE_SLOTS +#if PY_MAJOR_VERSION >= 3 + if (likely(PyUnicode_Check(n))) +#else + if (likely(PyString_Check(n))) +#endif + return __Pyx_PyObject_GetAttrStr(o, n); +#endif + return PyObject_GetAttr(o, n); +} + +/* GetAttr3 */ +static PyObject *__Pyx_GetAttr3Default(PyObject *d) { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) + return NULL; + __Pyx_PyErr_Clear(); + Py_INCREF(d); + return d; +} +static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) { + PyObject *r = __Pyx_GetAttr(o, n); + return (likely(r)) ? r : __Pyx_GetAttr3Default(d); +} + +/* ExtTypeTest */ +static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { + if (unlikely(!type)) { + PyErr_SetString(PyExc_SystemError, "Missing type object"); + return 0; + } + if (likely(__Pyx_TypeCheck(obj, type))) + return 1; + PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s", + Py_TYPE(obj)->tp_name, type->tp_name); + return 0; +} + +/* GetModuleGlobalName */ +#if CYTHON_USE_DICT_VERSIONS +static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value) +#else +static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) +#endif +{ + PyObject *result; +#if !CYTHON_AVOID_BORROWED_REFS +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 + result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } else if (unlikely(PyErr_Occurred())) { + return NULL; + } +#else + result = PyDict_GetItem(__pyx_d, name); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } +#endif +#else + result = PyObject_GetItem(__pyx_d, name); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } + PyErr_Clear(); +#endif + return __Pyx_GetBuiltinName(name); +} + +/* ArgTypeTest */ +static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact) +{ + if (unlikely(!type)) { + PyErr_SetString(PyExc_SystemError, "Missing type object"); + return 0; + } + else if (exact) { + #if PY_MAJOR_VERSION == 2 + if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1; + #endif + } + else { + if (likely(__Pyx_TypeCheck(obj, type))) return 1; + } + PyErr_Format(PyExc_TypeError, + "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)", + name, type->tp_name, Py_TYPE(obj)->tp_name); + return 0; +} + +/* CallNextTpDealloc */ +static void __Pyx_call_next_tp_dealloc(PyObject* obj, destructor current_tp_dealloc) { + PyTypeObject* type = Py_TYPE(obj); + while (type && type->tp_dealloc != current_tp_dealloc) + type = type->tp_base; + while (type && type->tp_dealloc == current_tp_dealloc) + type = type->tp_base; + if (type) + type->tp_dealloc(obj); +} + +/* CallNextTpTraverse */ +static int __Pyx_call_next_tp_traverse(PyObject* obj, visitproc v, void *a, traverseproc current_tp_traverse) { + PyTypeObject* type = Py_TYPE(obj); + while (type && type->tp_traverse != current_tp_traverse) + type = type->tp_base; + while (type && type->tp_traverse == current_tp_traverse) + type = type->tp_base; + if (type && type->tp_traverse) + return type->tp_traverse(obj, v, a); + return 0; +} + +/* CallNextTpClear */ +static void __Pyx_call_next_tp_clear(PyObject* obj, inquiry current_tp_clear) { + PyTypeObject* type = Py_TYPE(obj); + while (type && type->tp_clear != current_tp_clear) + type = type->tp_base; + while (type && type->tp_clear == current_tp_clear) + type = type->tp_base; + if (type && type->tp_clear) + type->tp_clear(obj); +} + +/* TypeImport */ +#ifndef __PYX_HAVE_RT_ImportType +#define __PYX_HAVE_RT_ImportType +static PyTypeObject *__Pyx_ImportType(PyObject *module, const char *module_name, const char *class_name, + size_t size, enum __Pyx_ImportType_CheckSize check_size) +{ + PyObject *result = 0; + char warning[200]; + Py_ssize_t basicsize; +#ifdef Py_LIMITED_API + PyObject *py_basicsize; +#endif + result = PyObject_GetAttrString(module, class_name); + if (!result) + goto bad; + if (!PyType_Check(result)) { + PyErr_Format(PyExc_TypeError, + "%.200s.%.200s is not a type object", + module_name, class_name); + goto bad; + } +#ifndef Py_LIMITED_API + basicsize = ((PyTypeObject *)result)->tp_basicsize; +#else + py_basicsize = PyObject_GetAttrString(result, "__basicsize__"); + if (!py_basicsize) + goto bad; + basicsize = PyLong_AsSsize_t(py_basicsize); + Py_DECREF(py_basicsize); + py_basicsize = 0; + if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred()) + goto bad; +#endif + if ((size_t)basicsize < size) { + PyErr_Format(PyExc_ValueError, + "%.200s.%.200s size changed, may indicate binary incompatibility. " + "Expected %zd from C header, got %zd from PyObject", + module_name, class_name, size, basicsize); + goto bad; + } + if (check_size == __Pyx_ImportType_CheckSize_Error && (size_t)basicsize != size) { + PyErr_Format(PyExc_ValueError, + "%.200s.%.200s size changed, may indicate binary incompatibility. " + "Expected %zd from C header, got %zd from PyObject", + module_name, class_name, size, basicsize); + goto bad; + } + else if (check_size == __Pyx_ImportType_CheckSize_Warn && (size_t)basicsize > size) { + PyOS_snprintf(warning, sizeof(warning), + "%s.%s size changed, may indicate binary incompatibility. " + "Expected %zd from C header, got %zd from PyObject", + module_name, class_name, size, basicsize); + if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad; + } + return (PyTypeObject *)result; +bad: + Py_XDECREF(result); + return NULL; +} +#endif + +/* GetVTable */ +static void* __Pyx_GetVtable(PyObject *dict) { + void* ptr; + PyObject *ob = PyObject_GetItem(dict, __pyx_n_s_pyx_vtable); + if (!ob) + goto bad; +#if PY_VERSION_HEX >= 0x02070000 + ptr = PyCapsule_GetPointer(ob, 0); +#else + ptr = PyCObject_AsVoidPtr(ob); +#endif + if (!ptr && !PyErr_Occurred()) + PyErr_SetString(PyExc_RuntimeError, "invalid vtable found for imported type"); + Py_DECREF(ob); + return ptr; +bad: + Py_XDECREF(ob); + return NULL; +} + +/* PyObject_GenericGetAttrNoDict */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) { + PyErr_Format(PyExc_AttributeError, +#if PY_MAJOR_VERSION >= 3 + "'%.50s' object has no attribute '%U'", + tp->tp_name, attr_name); +#else + "'%.50s' object has no attribute '%.400s'", + tp->tp_name, PyString_AS_STRING(attr_name)); +#endif + return NULL; +} +static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) { + PyObject *descr; + PyTypeObject *tp = Py_TYPE(obj); + if (unlikely(!PyString_Check(attr_name))) { + return PyObject_GenericGetAttr(obj, attr_name); + } + assert(!tp->tp_dictoffset); + descr = _PyType_Lookup(tp, attr_name); + if (unlikely(!descr)) { + return __Pyx_RaiseGenericGetAttributeError(tp, attr_name); + } + Py_INCREF(descr); + #if PY_MAJOR_VERSION < 3 + if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS))) + #endif + { + descrgetfunc f = Py_TYPE(descr)->tp_descr_get; + if (unlikely(f)) { + PyObject *res = f(descr, obj, (PyObject *)tp); + Py_DECREF(descr); + return res; + } + } + return descr; +} +#endif + +/* PyObject_GenericGetAttr */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) { + if (unlikely(Py_TYPE(obj)->tp_dictoffset)) { + return PyObject_GenericGetAttr(obj, attr_name); + } + return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name); +} +#endif + +/* SetVTable */ +static int __Pyx_SetVtable(PyObject *dict, void *vtable) { +#if PY_VERSION_HEX >= 0x02070000 + PyObject *ob = PyCapsule_New(vtable, 0, 0); +#else + PyObject *ob = PyCObject_FromVoidPtr(vtable, 0); +#endif + if (!ob) + goto bad; + if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0) + goto bad; + Py_DECREF(ob); + return 0; +bad: + Py_XDECREF(ob); + return -1; +} + +/* Import */ +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { + PyObject *empty_list = 0; + PyObject *module = 0; + PyObject *global_dict = 0; + PyObject *empty_dict = 0; + PyObject *list; + #if PY_MAJOR_VERSION < 3 + PyObject *py_import; + py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); + if (!py_import) + goto bad; + #endif + if (from_list) + list = from_list; + else { + empty_list = PyList_New(0); + if (!empty_list) + goto bad; + list = empty_list; + } + global_dict = PyModule_GetDict(__pyx_m); + if (!global_dict) + goto bad; + empty_dict = PyDict_New(); + if (!empty_dict) + goto bad; + { + #if PY_MAJOR_VERSION >= 3 + if (level == -1) { + if (strchr(__Pyx_MODULE_NAME, '.')) { + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, 1); + if (!module) { + if (!PyErr_ExceptionMatches(PyExc_ImportError)) + goto bad; + PyErr_Clear(); + } + } + level = 0; + } + #endif + if (!module) { + #if PY_MAJOR_VERSION < 3 + PyObject *py_level = PyInt_FromLong(level); + if (!py_level) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, py_level, (PyObject *)NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, level); + #endif + } + } +bad: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(py_import); + #endif + Py_XDECREF(empty_list); + Py_XDECREF(empty_dict); + return module; +} + +/* ImportFrom */ +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { + PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); + if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_Format(PyExc_ImportError, + #if PY_MAJOR_VERSION < 3 + "cannot import name %.230s", PyString_AS_STRING(name)); + #else + "cannot import name %S", name); + #endif + } + return value; +} + +/* FetchCommonType */ +static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { + PyObject* fake_module; + PyTypeObject* cached_type = NULL; + fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI); + if (!fake_module) return NULL; + Py_INCREF(fake_module); + cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name); + if (cached_type) { + if (!PyType_Check((PyObject*)cached_type)) { + PyErr_Format(PyExc_TypeError, + "Shared Cython type %.200s is not a type object", + type->tp_name); + goto bad; + } + if (cached_type->tp_basicsize != type->tp_basicsize) { + PyErr_Format(PyExc_TypeError, + "Shared Cython type %.200s has the wrong size, try recompiling", + type->tp_name); + goto bad; + } + } else { + if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; + PyErr_Clear(); + if (PyType_Ready(type) < 0) goto bad; + if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0) + goto bad; + Py_INCREF(type); + cached_type = type; + } +done: + Py_DECREF(fake_module); + return cached_type; +bad: + Py_XDECREF(cached_type); + cached_type = NULL; + goto done; +} + +/* CythonFunction */ +#include +static PyObject * +__Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure) +{ + if (unlikely(op->func_doc == NULL)) { + if (op->func.m_ml->ml_doc) { +#if PY_MAJOR_VERSION >= 3 + op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc); +#else + op->func_doc = PyString_FromString(op->func.m_ml->ml_doc); +#endif + if (unlikely(op->func_doc == NULL)) + return NULL; + } else { + Py_INCREF(Py_None); + return Py_None; + } + } + Py_INCREF(op->func_doc); + return op->func_doc; +} +static int +__Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context) +{ + PyObject *tmp = op->func_doc; + if (value == NULL) { + value = Py_None; + } + Py_INCREF(value); + op->func_doc = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + if (unlikely(op->func_name == NULL)) { +#if PY_MAJOR_VERSION >= 3 + op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name); +#else + op->func_name = PyString_InternFromString(op->func.m_ml->ml_name); +#endif + if (unlikely(op->func_name == NULL)) + return NULL; + } + Py_INCREF(op->func_name); + return op->func_name; +} +static int +__Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context) +{ + PyObject *tmp; +#if PY_MAJOR_VERSION >= 3 + if (unlikely(value == NULL || !PyUnicode_Check(value))) +#else + if (unlikely(value == NULL || !PyString_Check(value))) +#endif + { + PyErr_SetString(PyExc_TypeError, + "__name__ must be set to a string object"); + return -1; + } + tmp = op->func_name; + Py_INCREF(value); + op->func_name = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + Py_INCREF(op->func_qualname); + return op->func_qualname; +} +static int +__Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context) +{ + PyObject *tmp; +#if PY_MAJOR_VERSION >= 3 + if (unlikely(value == NULL || !PyUnicode_Check(value))) +#else + if (unlikely(value == NULL || !PyString_Check(value))) +#endif + { + PyErr_SetString(PyExc_TypeError, + "__qualname__ must be set to a string object"); + return -1; + } + tmp = op->func_qualname; + Py_INCREF(value); + op->func_qualname = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED void *closure) +{ + PyObject *self; + self = m->func_closure; + if (self == NULL) + self = Py_None; + Py_INCREF(self); + return self; +} +static PyObject * +__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + if (unlikely(op->func_dict == NULL)) { + op->func_dict = PyDict_New(); + if (unlikely(op->func_dict == NULL)) + return NULL; + } + Py_INCREF(op->func_dict); + return op->func_dict; +} +static int +__Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context) +{ + PyObject *tmp; + if (unlikely(value == NULL)) { + PyErr_SetString(PyExc_TypeError, + "function's dictionary may not be deleted"); + return -1; + } + if (unlikely(!PyDict_Check(value))) { + PyErr_SetString(PyExc_TypeError, + "setting function's dictionary to a non-dict"); + return -1; + } + tmp = op->func_dict; + Py_INCREF(value); + op->func_dict = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + Py_INCREF(op->func_globals); + return op->func_globals; +} +static PyObject * +__Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + Py_INCREF(Py_None); + return Py_None; +} +static PyObject * +__Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + PyObject* result = (op->func_code) ? op->func_code : Py_None; + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { + int result = 0; + PyObject *res = op->defaults_getter((PyObject *) op); + if (unlikely(!res)) + return -1; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + op->defaults_tuple = PyTuple_GET_ITEM(res, 0); + Py_INCREF(op->defaults_tuple); + op->defaults_kwdict = PyTuple_GET_ITEM(res, 1); + Py_INCREF(op->defaults_kwdict); + #else + op->defaults_tuple = PySequence_ITEM(res, 0); + if (unlikely(!op->defaults_tuple)) result = -1; + else { + op->defaults_kwdict = PySequence_ITEM(res, 1); + if (unlikely(!op->defaults_kwdict)) result = -1; + } + #endif + Py_DECREF(res); + return result; +} +static int +__Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) { + PyObject* tmp; + if (!value) { + value = Py_None; + } else if (value != Py_None && !PyTuple_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__defaults__ must be set to a tuple object"); + return -1; + } + Py_INCREF(value); + tmp = op->defaults_tuple; + op->defaults_tuple = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) { + PyObject* result = op->defaults_tuple; + if (unlikely(!result)) { + if (op->defaults_getter) { + if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL; + result = op->defaults_tuple; + } else { + result = Py_None; + } + } + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) { + PyObject* tmp; + if (!value) { + value = Py_None; + } else if (value != Py_None && !PyDict_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__kwdefaults__ must be set to a dict object"); + return -1; + } + Py_INCREF(value); + tmp = op->defaults_kwdict; + op->defaults_kwdict = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) { + PyObject* result = op->defaults_kwdict; + if (unlikely(!result)) { + if (op->defaults_getter) { + if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL; + result = op->defaults_kwdict; + } else { + result = Py_None; + } + } + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) { + PyObject* tmp; + if (!value || value == Py_None) { + value = NULL; + } else if (!PyDict_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__annotations__ must be set to a dict object"); + return -1; + } + Py_XINCREF(value); + tmp = op->func_annotations; + op->func_annotations = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) { + PyObject* result = op->func_annotations; + if (unlikely(!result)) { + result = PyDict_New(); + if (unlikely(!result)) return NULL; + op->func_annotations = result; + } + Py_INCREF(result); + return result; +} +static PyGetSetDef __pyx_CyFunction_getsets[] = { + {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, + {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, + {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, + {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, + {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, + {(char *) "__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0}, + {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, + {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, + {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, + {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, + {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, + {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, + {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, + {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, + {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, + {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, + {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, + {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, + {0, 0, 0, 0, 0} +}; +static PyMemberDef __pyx_CyFunction_members[] = { + {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), PY_WRITE_RESTRICTED, 0}, + {0, 0, 0, 0, 0} +}; +static PyObject * +__Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args) +{ +#if PY_MAJOR_VERSION >= 3 + return PyUnicode_FromString(m->func.m_ml->ml_name); +#else + return PyString_FromString(m->func.m_ml->ml_name); +#endif +} +static PyMethodDef __pyx_CyFunction_methods[] = { + {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, + {0, 0, 0, 0} +}; +#if PY_VERSION_HEX < 0x030500A0 +#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist) +#else +#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func.m_weakreflist) +#endif +static PyObject *__Pyx_CyFunction_New(PyTypeObject *type, PyMethodDef *ml, int flags, PyObject* qualname, + PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { + __pyx_CyFunctionObject *op = PyObject_GC_New(__pyx_CyFunctionObject, type); + if (op == NULL) + return NULL; + op->flags = flags; + __Pyx_CyFunction_weakreflist(op) = NULL; + op->func.m_ml = ml; + op->func.m_self = (PyObject *) op; + Py_XINCREF(closure); + op->func_closure = closure; + Py_XINCREF(module); + op->func.m_module = module; + op->func_dict = NULL; + op->func_name = NULL; + Py_INCREF(qualname); + op->func_qualname = qualname; + op->func_doc = NULL; + op->func_classobj = NULL; + op->func_globals = globals; + Py_INCREF(op->func_globals); + Py_XINCREF(code); + op->func_code = code; + op->defaults_pyobjects = 0; + op->defaults = NULL; + op->defaults_tuple = NULL; + op->defaults_kwdict = NULL; + op->defaults_getter = NULL; + op->func_annotations = NULL; + PyObject_GC_Track(op); + return (PyObject *) op; +} +static int +__Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) +{ + Py_CLEAR(m->func_closure); + Py_CLEAR(m->func.m_module); + Py_CLEAR(m->func_dict); + Py_CLEAR(m->func_name); + Py_CLEAR(m->func_qualname); + Py_CLEAR(m->func_doc); + Py_CLEAR(m->func_globals); + Py_CLEAR(m->func_code); + Py_CLEAR(m->func_classobj); + Py_CLEAR(m->defaults_tuple); + Py_CLEAR(m->defaults_kwdict); + Py_CLEAR(m->func_annotations); + if (m->defaults) { + PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); + int i; + for (i = 0; i < m->defaults_pyobjects; i++) + Py_XDECREF(pydefaults[i]); + PyObject_Free(m->defaults); + m->defaults = NULL; + } + return 0; +} +static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m) +{ + if (__Pyx_CyFunction_weakreflist(m) != NULL) + PyObject_ClearWeakRefs((PyObject *) m); + __Pyx_CyFunction_clear(m); + PyObject_GC_Del(m); +} +static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) +{ + PyObject_GC_UnTrack(m); + __Pyx__CyFunction_dealloc(m); +} +static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) +{ + Py_VISIT(m->func_closure); + Py_VISIT(m->func.m_module); + Py_VISIT(m->func_dict); + Py_VISIT(m->func_name); + Py_VISIT(m->func_qualname); + Py_VISIT(m->func_doc); + Py_VISIT(m->func_globals); + Py_VISIT(m->func_code); + Py_VISIT(m->func_classobj); + Py_VISIT(m->defaults_tuple); + Py_VISIT(m->defaults_kwdict); + if (m->defaults) { + PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); + int i; + for (i = 0; i < m->defaults_pyobjects; i++) + Py_VISIT(pydefaults[i]); + } + return 0; +} +static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type) +{ + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) { + Py_INCREF(func); + return func; + } + if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) { + if (type == NULL) + type = (PyObject *)(Py_TYPE(obj)); + return __Pyx_PyMethod_New(func, type, (PyObject *)(Py_TYPE(type))); + } + if (obj == Py_None) + obj = NULL; + return __Pyx_PyMethod_New(func, obj, type); +} +static PyObject* +__Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) +{ +#if PY_MAJOR_VERSION >= 3 + return PyUnicode_FromFormat("", + op->func_qualname, (void *)op); +#else + return PyString_FromFormat("", + PyString_AsString(op->func_qualname), (void *)op); +#endif +} +static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) { + PyCFunctionObject* f = (PyCFunctionObject*)func; + PyCFunction meth = f->m_ml->ml_meth; + Py_ssize_t size; + switch (f->m_ml->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) { + case METH_VARARGS: + if (likely(kw == NULL || PyDict_Size(kw) == 0)) + return (*meth)(self, arg); + break; + case METH_VARARGS | METH_KEYWORDS: + return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw); + case METH_NOARGS: + if (likely(kw == NULL || PyDict_Size(kw) == 0)) { + size = PyTuple_GET_SIZE(arg); + if (likely(size == 0)) + return (*meth)(self, NULL); + PyErr_Format(PyExc_TypeError, + "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", + f->m_ml->ml_name, size); + return NULL; + } + break; + case METH_O: + if (likely(kw == NULL || PyDict_Size(kw) == 0)) { + size = PyTuple_GET_SIZE(arg); + if (likely(size == 1)) { + PyObject *result, *arg0; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + arg0 = PyTuple_GET_ITEM(arg, 0); + #else + arg0 = PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL; + #endif + result = (*meth)(self, arg0); + #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) + Py_DECREF(arg0); + #endif + return result; + } + PyErr_Format(PyExc_TypeError, + "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", + f->m_ml->ml_name, size); + return NULL; + } + break; + default: + PyErr_SetString(PyExc_SystemError, "Bad call flags in " + "__Pyx_CyFunction_Call. METH_OLDARGS is no " + "longer supported!"); + return NULL; + } + PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", + f->m_ml->ml_name); + return NULL; +} +static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { + return __Pyx_CyFunction_CallMethod(func, ((PyCFunctionObject*)func)->m_self, arg, kw); +} +static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) { + PyObject *result; + __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func; + if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { + Py_ssize_t argc; + PyObject *new_args; + PyObject *self; + argc = PyTuple_GET_SIZE(args); + new_args = PyTuple_GetSlice(args, 1, argc); + if (unlikely(!new_args)) + return NULL; + self = PyTuple_GetItem(args, 0); + if (unlikely(!self)) { + Py_DECREF(new_args); + return NULL; + } + result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw); + Py_DECREF(new_args); + } else { + result = __Pyx_CyFunction_Call(func, args, kw); + } + return result; +} +static PyTypeObject __pyx_CyFunctionType_type = { + PyVarObject_HEAD_INIT(0, 0) + "cython_function_or_method", + sizeof(__pyx_CyFunctionObject), + 0, + (destructor) __Pyx_CyFunction_dealloc, + 0, + 0, + 0, +#if PY_MAJOR_VERSION < 3 + 0, +#else + 0, +#endif + (reprfunc) __Pyx_CyFunction_repr, + 0, + 0, + 0, + 0, + __Pyx_CyFunction_CallAsMethod, + 0, + 0, + 0, + 0, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, + 0, + (traverseproc) __Pyx_CyFunction_traverse, + (inquiry) __Pyx_CyFunction_clear, + 0, +#if PY_VERSION_HEX < 0x030500A0 + offsetof(__pyx_CyFunctionObject, func_weakreflist), +#else + offsetof(PyCFunctionObject, m_weakreflist), +#endif + 0, + 0, + __pyx_CyFunction_methods, + __pyx_CyFunction_members, + __pyx_CyFunction_getsets, + 0, + 0, + __Pyx_CyFunction_descr_get, + 0, + offsetof(__pyx_CyFunctionObject, func_dict), + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, +#if PY_VERSION_HEX >= 0x030400a1 + 0, +#endif +}; +static int __pyx_CyFunction_init(void) { + __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); + if (unlikely(__pyx_CyFunctionType == NULL)) { + return -1; + } + return 0; +} +static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults = PyObject_Malloc(size); + if (unlikely(!m->defaults)) + return PyErr_NoMemory(); + memset(m->defaults, 0, size); + m->defaults_pyobjects = pyobjects; + return m->defaults; +} +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults_tuple = tuple; + Py_INCREF(tuple); +} +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults_kwdict = dict; + Py_INCREF(dict); +} +static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->func_annotations = dict; + Py_INCREF(dict); +} + +/* GetNameInClass */ +static PyObject *__Pyx_GetGlobalNameAfterAttributeLookup(PyObject *name) { + PyObject *result; + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) + return NULL; + __Pyx_PyErr_Clear(); + __Pyx_GetModuleGlobalNameUncached(result, name); + return result; +} +static PyObject *__Pyx__GetNameInClass(PyObject *nmspace, PyObject *name) { + PyObject *result; + result = __Pyx_PyObject_GetAttrStr(nmspace, name); + if (!result) { + result = __Pyx_GetGlobalNameAfterAttributeLookup(name); + } + return result; +} + +/* Globals */ +static PyObject* __Pyx_Globals(void) { + Py_ssize_t i; + PyObject *names; + PyObject *globals = __pyx_d; + Py_INCREF(globals); + names = PyObject_Dir(__pyx_m); + if (!names) + goto bad; + for (i = PyList_GET_SIZE(names)-1; i >= 0; i--) { +#if CYTHON_COMPILING_IN_PYPY + PyObject* name = PySequence_ITEM(names, i); + if (!name) + goto bad; +#else + PyObject* name = PyList_GET_ITEM(names, i); +#endif + if (!PyDict_Contains(globals, name)) { + PyObject* value = __Pyx_GetAttr(__pyx_m, name); + if (!value) { +#if CYTHON_COMPILING_IN_PYPY + Py_DECREF(name); +#endif + goto bad; + } + if (PyDict_SetItem(globals, name, value) < 0) { +#if CYTHON_COMPILING_IN_PYPY + Py_DECREF(name); +#endif + Py_DECREF(value); + goto bad; + } + } +#if CYTHON_COMPILING_IN_PYPY + Py_DECREF(name); +#endif + } + Py_DECREF(names); + return globals; +bad: + Py_XDECREF(names); + Py_XDECREF(globals); + return NULL; +} + +/* CLineInTraceback */ +#ifndef CYTHON_CLINE_IN_TRACEBACK +static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { + PyObject *use_cline; + PyObject *ptype, *pvalue, *ptraceback; +#if CYTHON_COMPILING_IN_CPYTHON + PyObject **cython_runtime_dict; +#endif + if (unlikely(!__pyx_cython_runtime)) { + return c_line; + } + __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); +#if CYTHON_COMPILING_IN_CPYTHON + cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); + if (likely(cython_runtime_dict)) { + __PYX_PY_DICT_LOOKUP_IF_MODIFIED( + use_cline, *cython_runtime_dict, + __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback)) + } else +#endif + { + PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback); + if (use_cline_obj) { + use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; + Py_DECREF(use_cline_obj); + } else { + PyErr_Clear(); + use_cline = NULL; + } + } + if (!use_cline) { + c_line = 0; + PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); + } + else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { + c_line = 0; + } + __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); + return c_line; +} +#endif + +/* CodeObjectCache */ +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { + int start = 0, mid = 0, end = count - 1; + if (end >= 0 && code_line > entries[end].code_line) { + return count; + } + while (start < end) { + mid = start + (end - start) / 2; + if (code_line < entries[mid].code_line) { + end = mid; + } else if (code_line > entries[mid].code_line) { + start = mid + 1; + } else { + return mid; + } + } + if (code_line <= entries[mid].code_line) { + return mid; + } else { + return mid + 1; + } +} +static PyCodeObject *__pyx_find_code_object(int code_line) { + PyCodeObject* code_object; + int pos; + if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { + return NULL; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { + return NULL; + } + code_object = __pyx_code_cache.entries[pos].code_object; + Py_INCREF(code_object); + return code_object; +} +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { + int pos, i; + __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; + if (unlikely(!code_line)) { + return; + } + if (unlikely(!entries)) { + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); + if (likely(entries)) { + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = 64; + __pyx_code_cache.count = 1; + entries[0].code_line = code_line; + entries[0].code_object = code_object; + Py_INCREF(code_object); + } + return; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { + PyCodeObject* tmp = entries[pos].code_object; + entries[pos].code_object = code_object; + Py_DECREF(tmp); + return; + } + if (__pyx_code_cache.count == __pyx_code_cache.max_count) { + int new_max = __pyx_code_cache.max_count + 64; + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( + __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry)); + if (unlikely(!entries)) { + return; + } + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = new_max; + } + for (i=__pyx_code_cache.count; i>pos; i--) { + entries[i] = entries[i-1]; + } + entries[pos].code_line = code_line; + entries[pos].code_object = code_object; + __pyx_code_cache.count++; + Py_INCREF(code_object); +} + +/* AddTraceback */ +#include "compile.h" +#include "frameobject.h" +#include "traceback.h" +static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( + const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyObject *py_srcfile = 0; + PyObject *py_funcname = 0; + #if PY_MAJOR_VERSION < 3 + py_srcfile = PyString_FromString(filename); + #else + py_srcfile = PyUnicode_FromString(filename); + #endif + if (!py_srcfile) goto bad; + if (c_line) { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + #else + py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + #endif + } + else { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromString(funcname); + #else + py_funcname = PyUnicode_FromString(funcname); + #endif + } + if (!py_funcname) goto bad; + py_code = __Pyx_PyCode_New( + 0, + 0, + 0, + 0, + 0, + __pyx_empty_bytes, /*PyObject *code,*/ + __pyx_empty_tuple, /*PyObject *consts,*/ + __pyx_empty_tuple, /*PyObject *names,*/ + __pyx_empty_tuple, /*PyObject *varnames,*/ + __pyx_empty_tuple, /*PyObject *freevars,*/ + __pyx_empty_tuple, /*PyObject *cellvars,*/ + py_srcfile, /*PyObject *filename,*/ + py_funcname, /*PyObject *name,*/ + py_line, + __pyx_empty_bytes /*PyObject *lnotab*/ + ); + Py_DECREF(py_srcfile); + Py_DECREF(py_funcname); + return py_code; +bad: + Py_XDECREF(py_srcfile); + Py_XDECREF(py_funcname); + return NULL; +} +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyFrameObject *py_frame = 0; + PyThreadState *tstate = __Pyx_PyThreadState_Current; + if (c_line) { + c_line = __Pyx_CLineForTraceback(tstate, c_line); + } + py_code = __pyx_find_code_object(c_line ? -c_line : py_line); + if (!py_code) { + py_code = __Pyx_CreateCodeObjectForTraceback( + funcname, c_line, py_line, filename); + if (!py_code) goto bad; + __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); + } + py_frame = PyFrame_New( + tstate, /*PyThreadState *tstate,*/ + py_code, /*PyCodeObject *code,*/ + __pyx_d, /*PyObject *globals,*/ + 0 /*PyObject *locals*/ + ); + if (!py_frame) goto bad; + __Pyx_PyFrame_SetLineNumber(py_frame, py_line); + PyTraceBack_Here(py_frame); +bad: + Py_XDECREF(py_code); + Py_XDECREF(py_frame); +} + +/* CIntToPy */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { + const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(long) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(long) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(long) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(long), + little, !is_unsigned); + } +} + +/* CIntFromPyVerify */ +#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ + __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) +#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ + __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) +#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ + {\ + func_type value = func_value;\ + if (sizeof(target_type) < sizeof(func_type)) {\ + if (unlikely(value != (func_type) (target_type) value)) {\ + func_type zero = 0;\ + if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ + return (target_type) -1;\ + if (is_unsigned && unlikely(value < zero))\ + goto raise_neg_overflow;\ + else\ + goto raise_overflow;\ + }\ + }\ + return (target_type) value;\ + } + +/* CIntFromPy */ +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { + const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(long) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (long) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (long) 0; + case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0]) + case 2: + if (8 * sizeof(long) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) { + return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + case 3: + if (8 * sizeof(long) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) { + return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + case 4: + if (8 * sizeof(long) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) { + return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (long) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if (sizeof(long) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (long) 0; + case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0])) + case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0]) + case -2: + if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 2: + if (8 * sizeof(long) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case -3: + if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 3: + if (8 * sizeof(long) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case -4: + if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 4: + if (8 * sizeof(long) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + } +#endif + if (sizeof(long) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + long val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (long) -1; + } + } else { + long val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (long) -1; + val = __Pyx_PyInt_As_long(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to long"); + return (long) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to long"); + return (long) -1; +} + +/* CIntFromPy */ +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { + const int neg_one = (int) ((int) 0 - (int) 1), const_zero = (int) 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(int) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (int) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (int) 0; + case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0]) + case 2: + if (8 * sizeof(int) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) { + return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + case 3: + if (8 * sizeof(int) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) { + return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + case 4: + if (8 * sizeof(int) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) { + return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (int) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if (sizeof(int) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (int) 0; + case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0])) + case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0]) + case -2: + if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { + return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 2: + if (8 * sizeof(int) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { + return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case -3: + if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { + return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 3: + if (8 * sizeof(int) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { + return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case -4: + if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { + return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 4: + if (8 * sizeof(int) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { + return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + } +#endif + if (sizeof(int) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + int val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (int) -1; + } + } else { + int val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (int) -1; + val = __Pyx_PyInt_As_int(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to int"); + return (int) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to int"); + return (int) -1; +} + +/* FastTypeChecks */ +#if CYTHON_COMPILING_IN_CPYTHON +static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) { + while (a) { + a = a->tp_base; + if (a == b) + return 1; + } + return b == &PyBaseObject_Type; +} +static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) { + PyObject *mro; + if (a == b) return 1; + mro = a->tp_mro; + if (likely(mro)) { + Py_ssize_t i, n; + n = PyTuple_GET_SIZE(mro); + for (i = 0; i < n; i++) { + if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b) + return 1; + } + return 0; + } + return __Pyx_InBases(a, b); +} +#if PY_MAJOR_VERSION == 2 +static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { + PyObject *exception, *value, *tb; + int res; + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ErrFetch(&exception, &value, &tb); + res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; + if (unlikely(res == -1)) { + PyErr_WriteUnraisable(err); + res = 0; + } + if (!res) { + res = PyObject_IsSubclass(err, exc_type2); + if (unlikely(res == -1)) { + PyErr_WriteUnraisable(err); + res = 0; + } + } + __Pyx_ErrRestore(exception, value, tb); + return res; +} +#else +static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { + int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0; + if (!res) { + res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); + } + return res; +} +#endif +static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { + Py_ssize_t i, n; + assert(PyExceptionClass_Check(exc_type)); + n = PyTuple_GET_SIZE(tuple); +#if PY_MAJOR_VERSION >= 3 + for (i=0; itp_setattro)) + return tp->tp_setattro(obj, attr_name, value); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_setattr)) + return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value); +#endif + return PyObject_SetAttr(obj, attr_name, value); +} +#endif + +/* VoidPtrExport */ +static int __Pyx_ExportVoidPtr(PyObject *name, void *p, const char *sig) { + PyObject *d; + PyObject *cobj = 0; + d = PyDict_GetItem(__pyx_d, __pyx_n_s_pyx_capi); + Py_XINCREF(d); + if (!d) { + d = PyDict_New(); + if (!d) + goto bad; + if (__Pyx_PyObject_SetAttrStr(__pyx_m, __pyx_n_s_pyx_capi, d) < 0) + goto bad; + } +#if PY_VERSION_HEX >= 0x02070000 + cobj = PyCapsule_New(p, sig, 0); +#else + cobj = PyCObject_FromVoidPtrAndDesc(p, (void *)sig, 0); +#endif + if (!cobj) + goto bad; + if (PyDict_SetItem(d, name, cobj) < 0) + goto bad; + Py_DECREF(cobj); + Py_DECREF(d); + return 0; +bad: + Py_XDECREF(cobj); + Py_XDECREF(d); + return -1; +} + +/* FunctionExport */ +static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig) { + PyObject *d = 0; + PyObject *cobj = 0; + union { + void (*fp)(void); + void *p; + } tmp; + d = PyObject_GetAttrString(__pyx_m, (char *)"__pyx_capi__"); + if (!d) { + PyErr_Clear(); + d = PyDict_New(); + if (!d) + goto bad; + Py_INCREF(d); + if (PyModule_AddObject(__pyx_m, (char *)"__pyx_capi__", d) < 0) + goto bad; + } + tmp.fp = f; +#if PY_VERSION_HEX >= 0x02070000 + cobj = PyCapsule_New(tmp.p, sig, 0); +#else + cobj = PyCObject_FromVoidPtrAndDesc(tmp.p, (void *)sig, 0); +#endif + if (!cobj) + goto bad; + if (PyDict_SetItemString(d, name, cobj) < 0) + goto bad; + Py_DECREF(cobj); + Py_DECREF(d); + return 0; +bad: + Py_XDECREF(cobj); + Py_XDECREF(d); + return -1; +} + +/* VoidPtrImport */ +#ifndef __PYX_HAVE_RT_ImportVoidPtr +#define __PYX_HAVE_RT_ImportVoidPtr +static int __Pyx_ImportVoidPtr(PyObject *module, const char *name, void **p, const char *sig) { + PyObject *d = 0; + PyObject *cobj = 0; + d = PyObject_GetAttrString(module, (char *)"__pyx_capi__"); + if (!d) + goto bad; + cobj = PyDict_GetItemString(d, name); + if (!cobj) { + PyErr_Format(PyExc_ImportError, + "%.200s does not export expected C variable %.200s", + PyModule_GetName(module), name); + goto bad; + } +#if PY_VERSION_HEX >= 0x02070000 + if (!PyCapsule_IsValid(cobj, sig)) { + PyErr_Format(PyExc_TypeError, + "C variable %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", + PyModule_GetName(module), name, sig, PyCapsule_GetName(cobj)); + goto bad; + } + *p = PyCapsule_GetPointer(cobj, sig); +#else + {const char *desc, *s1, *s2; + desc = (const char *)PyCObject_GetDesc(cobj); + if (!desc) + goto bad; + s1 = desc; s2 = sig; + while (*s1 != '\0' && *s1 == *s2) { s1++; s2++; } + if (*s1 != *s2) { + PyErr_Format(PyExc_TypeError, + "C variable %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", + PyModule_GetName(module), name, sig, desc); + goto bad; + } + *p = PyCObject_AsVoidPtr(cobj);} +#endif + if (!(*p)) + goto bad; + Py_DECREF(d); + return 0; +bad: + Py_XDECREF(d); + return -1; +} +#endif + +/* FunctionImport */ +#ifndef __PYX_HAVE_RT_ImportFunction +#define __PYX_HAVE_RT_ImportFunction +static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig) { + PyObject *d = 0; + PyObject *cobj = 0; + union { + void (*fp)(void); + void *p; + } tmp; + d = PyObject_GetAttrString(module, (char *)"__pyx_capi__"); + if (!d) + goto bad; + cobj = PyDict_GetItemString(d, funcname); + if (!cobj) { + PyErr_Format(PyExc_ImportError, + "%.200s does not export expected C function %.200s", + PyModule_GetName(module), funcname); + goto bad; + } +#if PY_VERSION_HEX >= 0x02070000 + if (!PyCapsule_IsValid(cobj, sig)) { + PyErr_Format(PyExc_TypeError, + "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", + PyModule_GetName(module), funcname, sig, PyCapsule_GetName(cobj)); + goto bad; + } + tmp.p = PyCapsule_GetPointer(cobj, sig); +#else + {const char *desc, *s1, *s2; + desc = (const char *)PyCObject_GetDesc(cobj); + if (!desc) + goto bad; + s1 = desc; s2 = sig; + while (*s1 != '\0' && *s1 == *s2) { s1++; s2++; } + if (*s1 != *s2) { + PyErr_Format(PyExc_TypeError, + "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", + PyModule_GetName(module), funcname, sig, desc); + goto bad; + } + tmp.p = PyCObject_AsVoidPtr(cobj);} +#endif + *f = tmp.fp; + if (!(*f)) + goto bad; + Py_DECREF(d); + return 0; +bad: + Py_XDECREF(d); + return -1; +} +#endif + +/* InitStrings */ +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { + while (t->p) { + #if PY_MAJOR_VERSION < 3 + if (t->is_unicode) { + *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); + } else if (t->intern) { + *t->p = PyString_InternFromString(t->s); + } else { + *t->p = PyString_FromStringAndSize(t->s, t->n - 1); + } + #else + if (t->is_unicode | t->is_str) { + if (t->intern) { + *t->p = PyUnicode_InternFromString(t->s); + } else if (t->encoding) { + *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); + } else { + *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); + } + } else { + *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); + } + #endif + if (!*t->p) + return -1; + if (PyObject_Hash(*t->p) == -1) + return -1; + ++t; + } + return 0; +} + +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { + return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); +} +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { + Py_ssize_t ignore; + return __Pyx_PyObject_AsStringAndSize(o, &ignore); +} +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +#if !CYTHON_PEP393_ENABLED +static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { + char* defenc_c; + PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); + if (!defenc) return NULL; + defenc_c = PyBytes_AS_STRING(defenc); +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + { + char* end = defenc_c + PyBytes_GET_SIZE(defenc); + char* c; + for (c = defenc_c; c < end; c++) { + if ((unsigned char) (*c) >= 128) { + PyUnicode_AsASCIIString(o); + return NULL; + } + } + } +#endif + *length = PyBytes_GET_SIZE(defenc); + return defenc_c; +} +#else +static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { + if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + if (likely(PyUnicode_IS_ASCII(o))) { + *length = PyUnicode_GET_LENGTH(o); + return PyUnicode_AsUTF8(o); + } else { + PyUnicode_AsASCIIString(o); + return NULL; + } +#else + return PyUnicode_AsUTF8AndSize(o, length); +#endif +} +#endif +#endif +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT + if ( +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + __Pyx_sys_getdefaultencoding_not_ascii && +#endif + PyUnicode_Check(o)) { + return __Pyx_PyUnicode_AsStringAndSize(o, length); + } else +#endif +#if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) + if (PyByteArray_Check(o)) { + *length = PyByteArray_GET_SIZE(o); + return PyByteArray_AS_STRING(o); + } else +#endif + { + char* result; + int r = PyBytes_AsStringAndSize(o, &result, length); + if (unlikely(r < 0)) { + return NULL; + } else { + return result; + } + } +} +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { + int is_true = x == Py_True; + if (is_true | (x == Py_False) | (x == Py_None)) return is_true; + else return PyObject_IsTrue(x); +} +static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) { + int retval; + if (unlikely(!x)) return -1; + retval = __Pyx_PyObject_IsTrue(x); + Py_DECREF(x); + return retval; +} +static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) { +#if PY_MAJOR_VERSION >= 3 + if (PyLong_Check(result)) { + if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, + "__int__ returned non-int (type %.200s). " + "The ability to return an instance of a strict subclass of int " + "is deprecated, and may be removed in a future version of Python.", + Py_TYPE(result)->tp_name)) { + Py_DECREF(result); + return NULL; + } + return result; + } +#endif + PyErr_Format(PyExc_TypeError, + "__%.4s__ returned non-%.4s (type %.200s)", + type_name, type_name, Py_TYPE(result)->tp_name); + Py_DECREF(result); + return NULL; +} +static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { +#if CYTHON_USE_TYPE_SLOTS + PyNumberMethods *m; +#endif + const char *name = NULL; + PyObject *res = NULL; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x) || PyLong_Check(x))) +#else + if (likely(PyLong_Check(x))) +#endif + return __Pyx_NewRef(x); +#if CYTHON_USE_TYPE_SLOTS + m = Py_TYPE(x)->tp_as_number; + #if PY_MAJOR_VERSION < 3 + if (m && m->nb_int) { + name = "int"; + res = m->nb_int(x); + } + else if (m && m->nb_long) { + name = "long"; + res = m->nb_long(x); + } + #else + if (likely(m && m->nb_int)) { + name = "int"; + res = m->nb_int(x); + } + #endif +#else + if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { + res = PyNumber_Int(x); + } +#endif + if (likely(res)) { +#if PY_MAJOR_VERSION < 3 + if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) { +#else + if (unlikely(!PyLong_CheckExact(res))) { +#endif + return __Pyx_PyNumber_IntOrLongWrongResultType(res, name); + } + } + else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_TypeError, + "an integer is required"); + } + return res; +} +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { + Py_ssize_t ival; + PyObject *x; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_CheckExact(b))) { + if (sizeof(Py_ssize_t) >= sizeof(long)) + return PyInt_AS_LONG(b); + else + return PyInt_AsSsize_t(b); + } +#endif + if (likely(PyLong_CheckExact(b))) { + #if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)b)->ob_digit; + const Py_ssize_t size = Py_SIZE(b); + if (likely(__Pyx_sst_abs(size) <= 1)) { + ival = likely(size) ? digits[0] : 0; + if (size == -1) ival = -ival; + return ival; + } else { + switch (size) { + case 2: + if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { + return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -2: + if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case 3: + if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { + return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -3: + if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case 4: + if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { + return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -4: + if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + } + } + #endif + return PyLong_AsSsize_t(b); + } + x = PyNumber_Index(b); + if (!x) return -1; + ival = PyInt_AsSsize_t(x); + Py_DECREF(x); + return ival; +} +static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) { + return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False); +} +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { + return PyInt_FromSize_t(ival); +} + + +#endif /* Py_PYTHON_H */ diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_hub_primitives.html b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_hub_primitives.html new file mode 100644 index 00000000..6bf97d50 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_hub_primitives.html @@ -0,0 +1,4991 @@ + + + + + + Cython: _hub_primitives.py + + + +

Generated by Cython 0.29.2

+

+ Yellow lines hint at Python interaction.
+ Click on a line that starts with a "+" to see the C code that Cython generated for it. +

+

Raw output: _hub_primitives.c

+
+001: # -*- coding: utf-8 -*-
+
  __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
 002: # copyright (c) 2018 gevent. See  LICENSE.
+
 003: # cython: auto_pickle=False,embedsignature=True,always_allow_keywords=False,binding=True
+
 004: """
+
 005: A collection of primitives used by the hub, and suitable for
+
 006: compilation with Cython because of their frequency of use.
+
 007: 
+
 008: 
+
 009: """
+
 010: from __future__ import absolute_import
+
 011: from __future__ import division
+
 012: from __future__ import print_function
+
 013: 
+
+014: import traceback
+
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_traceback, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 14, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_XGOTREF(__pyx_v_6gevent_16__hub_primitives_traceback);
+  __Pyx_DECREF_SET(__pyx_v_6gevent_16__hub_primitives_traceback, __pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_1);
+  __pyx_t_1 = 0;
+
 015: 
+
+016: from gevent.exceptions import InvalidSwitchError
+
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 16, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(__pyx_n_s_InvalidSwitchError);
+  __Pyx_GIVEREF(__pyx_n_s_InvalidSwitchError);
+  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_InvalidSwitchError);
+  __pyx_t_2 = __Pyx_Import(__pyx_n_s_gevent_exceptions, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 16, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_InvalidSwitchError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 16, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(__pyx_t_1);
+  __Pyx_XGOTREF(__pyx_v_6gevent_16__hub_primitives_InvalidSwitchError);
+  __Pyx_DECREF_SET(__pyx_v_6gevent_16__hub_primitives_InvalidSwitchError, __pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+017: from gevent.exceptions import ConcurrentObjectUseError
+
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 17, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_ConcurrentObjectUseError);
+  __Pyx_GIVEREF(__pyx_n_s_ConcurrentObjectUseError);
+  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_ConcurrentObjectUseError);
+  __pyx_t_1 = __Pyx_Import(__pyx_n_s_gevent_exceptions, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 17, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_ConcurrentObjectUseError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 17, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ConcurrentObjectUseError, __pyx_t_2) < 0) __PYX_ERR(0, 17, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 018: 
+
+019: from gevent import _greenlet_primitives
+
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 19, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(__pyx_n_s_greenlet_primitives);
+  __Pyx_GIVEREF(__pyx_n_s_greenlet_primitives);
+  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_greenlet_primitives);
+  __pyx_t_2 = __Pyx_Import(__pyx_n_s_gevent, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 19, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_greenlet_primitives); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 19, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(__pyx_t_1);
+  __Pyx_XGOTREF(__pyx_v_6gevent_16__hub_primitives__greenlet_primitives);
+  __Pyx_DECREF_SET(__pyx_v_6gevent_16__hub_primitives__greenlet_primitives, __pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+020: from gevent import _waiter
+
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 20, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_waiter);
+  __Pyx_GIVEREF(__pyx_n_s_waiter);
+  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_waiter);
+  __pyx_t_1 = __Pyx_Import(__pyx_n_s_gevent, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 20, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_waiter); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 20, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(__pyx_t_2);
+  __Pyx_XGOTREF(__pyx_v_6gevent_16__hub_primitives__waiter);
+  __Pyx_DECREF_SET(__pyx_v_6gevent_16__hub_primitives__waiter, __pyx_t_2);
+  __Pyx_GIVEREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+021: from gevent._util import _NONE
+
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 21, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(__pyx_n_s_NONE);
+  __Pyx_GIVEREF(__pyx_n_s_NONE);
+  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_NONE);
+  __pyx_t_2 = __Pyx_Import(__pyx_n_s_gevent__util, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 21, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_NONE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 21, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_NONE, __pyx_t_1) < 0) __PYX_ERR(0, 21, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+022: from gevent._hub_local import get_hub_noargs as get_hub
+
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 22, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_get_hub_noargs);
+  __Pyx_GIVEREF(__pyx_n_s_get_hub_noargs);
+  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_get_hub_noargs);
+  __pyx_t_1 = __Pyx_Import(__pyx_n_s_gevent__hub_local, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 22, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_get_hub_noargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 22, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_hub_noargs, __pyx_t_2) < 0) __PYX_ERR(0, 22, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+023: from gevent.timeout import Timeout
+
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 23, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(__pyx_n_s_Timeout);
+  __Pyx_GIVEREF(__pyx_n_s_Timeout);
+  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_Timeout);
+  __pyx_t_2 = __Pyx_Import(__pyx_n_s_gevent_timeout, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 23, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_Timeout); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 23, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(__pyx_t_1);
+  __Pyx_XGOTREF(__pyx_v_6gevent_16__hub_primitives_Timeout);
+  __Pyx_DECREF_SET(__pyx_v_6gevent_16__hub_primitives_Timeout, __pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
 024: 
+
 025: # In Cython, we define these as 'cdef inline' functions. The
+
 026: # compilation unit cannot have a direct assignment to them (import
+
 027: # is assignment) without generating a 'lvalue is not valid target'
+
 028: # error.
+
+029: locals()['getcurrent'] = __import__('greenlet').getcurrent
+
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin___import__, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 29, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_getcurrent); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 29, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_2 = __Pyx_Globals(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 29, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (unlikely(PyDict_SetItem(__pyx_t_2, __pyx_n_s_getcurrent, __pyx_t_1) < 0)) __PYX_ERR(0, 29, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+/* … */
+  __pyx_tuple__8 = PyTuple_Pack(1, __pyx_n_s_greenlet); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 29, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__8);
+  __Pyx_GIVEREF(__pyx_tuple__8);
+
+030: locals()['greenlet_init'] = lambda: None
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_16__hub_primitives_18lambda(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyMethodDef __pyx_mdef_6gevent_16__hub_primitives_18lambda = {"lambda", (PyCFunction)__pyx_pw_6gevent_16__hub_primitives_18lambda, METH_NOARGS, 0};
+static PyObject *__pyx_pw_6gevent_16__hub_primitives_18lambda(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("lambda (wrapper)", 0);
+  __pyx_r = __pyx_lambda_funcdef_6gevent_16__hub_primitives_lambda(__pyx_self);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_lambda_funcdef_6gevent_16__hub_primitives_lambda(CYTHON_UNUSED PyObject *__pyx_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("lambda", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_16__hub_primitives_18lambda, 0, __pyx_n_s_lambda, NULL, __pyx_n_s_gevent___hub_primitives, __pyx_d, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 30, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = __Pyx_Globals(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 30, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (unlikely(PyDict_SetItem(__pyx_t_2, __pyx_n_s_greenlet_init, __pyx_t_1) < 0)) __PYX_ERR(0, 30, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+031: locals()['Waiter'] = _waiter.Waiter
+
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_6gevent_16__hub_primitives__waiter, __pyx_n_s_Waiter); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 31, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = __Pyx_Globals(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 31, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (unlikely(PyDict_SetItem(__pyx_t_2, __pyx_n_s_Waiter, __pyx_t_1) < 0)) __PYX_ERR(0, 31, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+032: locals()['MultipleWaiter'] = _waiter.MultipleWaiter
+
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_6gevent_16__hub_primitives__waiter, __pyx_n_s_MultipleWaiter); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 32, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = __Pyx_Globals(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 32, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (unlikely(PyDict_SetItem(__pyx_t_2, __pyx_n_s_MultipleWaiter, __pyx_t_1) < 0)) __PYX_ERR(0, 32, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+033: locals()['SwitchOutGreenletWithLoop'] = _greenlet_primitives.SwitchOutGreenletWithLoop
+
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_6gevent_16__hub_primitives__greenlet_primitives, __pyx_n_s_SwitchOutGreenletWithLoop); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 33, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = __Pyx_Globals(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 33, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (unlikely(PyDict_SetItem(__pyx_t_2, __pyx_n_s_SwitchOutGreenletWithLoop, __pyx_t_1) < 0)) __PYX_ERR(0, 33, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 034: 
+
+035: __all__ = [
+
  __pyx_t_1 = PyList_New(6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 35, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(__pyx_n_s_WaitOperationsGreenlet);
+  __Pyx_GIVEREF(__pyx_n_s_WaitOperationsGreenlet);
+  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_WaitOperationsGreenlet);
+  __Pyx_INCREF(__pyx_n_s_iwait_on_objects);
+  __Pyx_GIVEREF(__pyx_n_s_iwait_on_objects);
+  PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_iwait_on_objects);
+  __Pyx_INCREF(__pyx_n_s_wait_on_objects);
+  __Pyx_GIVEREF(__pyx_n_s_wait_on_objects);
+  PyList_SET_ITEM(__pyx_t_1, 2, __pyx_n_s_wait_on_objects);
+  __Pyx_INCREF(__pyx_n_s_wait_read);
+  __Pyx_GIVEREF(__pyx_n_s_wait_read);
+  PyList_SET_ITEM(__pyx_t_1, 3, __pyx_n_s_wait_read);
+  __Pyx_INCREF(__pyx_n_s_wait_write);
+  __Pyx_GIVEREF(__pyx_n_s_wait_write);
+  PyList_SET_ITEM(__pyx_t_1, 4, __pyx_n_s_wait_write);
+  __Pyx_INCREF(__pyx_n_s_wait_readwrite);
+  __Pyx_GIVEREF(__pyx_n_s_wait_readwrite);
+  PyList_SET_ITEM(__pyx_t_1, 5, __pyx_n_s_wait_readwrite);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_all, __pyx_t_1) < 0) __PYX_ERR(0, 35, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 036:     'WaitOperationsGreenlet',
+
 037:     'iwait_on_objects',
+
 038:     'wait_on_objects',
+
 039:     'wait_read',
+
 040:     'wait_write',
+
 041:     'wait_readwrite',
+
 042: ]
+
 043: 
+
+044: class WaitOperationsGreenlet(SwitchOutGreenletWithLoop): # pylint:disable=undefined-variable
+
struct __pyx_vtabstruct_6gevent_16__hub_primitives_WaitOperationsGreenlet {
+  struct __pyx_vtabstruct_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop __pyx_base;
+  PyObject *(*wait)(struct __pyx_obj_6gevent_16__hub_primitives_WaitOperationsGreenlet *, PyObject *, int __pyx_skip_dispatch);
+  PyObject *(*cancel_wait)(struct __pyx_obj_6gevent_16__hub_primitives_WaitOperationsGreenlet *, PyObject *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_16__hub_primitives_22WaitOperationsGreenlet_cancel_wait *__pyx_optional_args);
+  PyObject *(*_cancel_wait)(struct __pyx_obj_6gevent_16__hub_primitives_WaitOperationsGreenlet *, PyObject *, PyObject *, PyObject *, int __pyx_skip_dispatch);
+};
+static struct __pyx_vtabstruct_6gevent_16__hub_primitives_WaitOperationsGreenlet *__pyx_vtabptr_6gevent_16__hub_primitives_WaitOperationsGreenlet;
+
+
 045: 
+
+046:     def wait(self, watcher):
+
static PyObject *__pyx_pw_6gevent_16__hub_primitives_22WaitOperationsGreenlet_1wait(PyObject *__pyx_v_self, PyObject *__pyx_v_watcher); /*proto*/
+static PyObject *__pyx_f_6gevent_16__hub_primitives_22WaitOperationsGreenlet_wait(struct __pyx_obj_6gevent_16__hub_primitives_WaitOperationsGreenlet *__pyx_v_self, PyObject *__pyx_v_watcher, int __pyx_skip_dispatch) {
+  struct __pyx_obj_6gevent_8__waiter_Waiter *__pyx_v_waiter = NULL;
+  PyObject *__pyx_v_result = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("wait", 0);
+  /* Check if called by wrapper */
+  if (unlikely(__pyx_skip_dispatch)) ;
+  /* Check if overridden in Python */
+  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
+    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
+    if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
+    else {
+      PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      #endif
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_wait); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 46, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_16__hub_primitives_22WaitOperationsGreenlet_1wait)) {
+        __Pyx_XDECREF(__pyx_r);
+        __Pyx_INCREF(__pyx_t_1);
+        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+          if (likely(__pyx_t_4)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+            __Pyx_INCREF(__pyx_t_4);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_3, function);
+          }
+        }
+        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_watcher) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_watcher);
+        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 46, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __pyx_r = __pyx_t_2;
+        __pyx_t_2 = 0;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        goto __pyx_L0;
+      }
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+      tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
+      if (unlikely(type_dict_guard != tp_dict_version)) {
+        tp_dict_version = obj_dict_version = 0;
+      }
+      #endif
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    }
+    #endif
+  }
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_6);
+  __Pyx_AddTraceback("gevent.__hub_primitives.WaitOperationsGreenlet.wait", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XDECREF((PyObject *)__pyx_v_waiter);
+  __Pyx_XDECREF(__pyx_v_result);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_16__hub_primitives_22WaitOperationsGreenlet_1wait(PyObject *__pyx_v_self, PyObject *__pyx_v_watcher); /*proto*/
+static char __pyx_doc_6gevent_16__hub_primitives_22WaitOperationsGreenlet_wait[] = "WaitOperationsGreenlet.wait(self, watcher)\n\n        Wait until the *watcher* (which must not be started) is ready.\n\n        The current greenlet will be unscheduled during this time.\n        ";
+static PyMethodDef __pyx_mdef_6gevent_16__hub_primitives_22WaitOperationsGreenlet_1wait = {"wait", (PyCFunction)__pyx_pw_6gevent_16__hub_primitives_22WaitOperationsGreenlet_1wait, METH_O, __pyx_doc_6gevent_16__hub_primitives_22WaitOperationsGreenlet_wait};
+static PyObject *__pyx_pw_6gevent_16__hub_primitives_22WaitOperationsGreenlet_1wait(PyObject *__pyx_v_self, PyObject *__pyx_v_watcher) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("wait (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_16__hub_primitives_22WaitOperationsGreenlet_wait(((struct __pyx_obj_6gevent_16__hub_primitives_WaitOperationsGreenlet *)__pyx_v_self), ((PyObject *)__pyx_v_watcher));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_16__hub_primitives_22WaitOperationsGreenlet_wait(struct __pyx_obj_6gevent_16__hub_primitives_WaitOperationsGreenlet *__pyx_v_self, PyObject *__pyx_v_watcher) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("wait", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __pyx_f_6gevent_16__hub_primitives_22WaitOperationsGreenlet_wait(__pyx_v_self, __pyx_v_watcher, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 46, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.__hub_primitives.WaitOperationsGreenlet.wait", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__9 = PyTuple_Pack(2, __pyx_n_s_self_2, __pyx_n_s_watcher); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 46, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__9);
+  __Pyx_GIVEREF(__pyx_tuple__9);
+/* … */
+  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_16__hub_primitives_22WaitOperationsGreenlet_1wait, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_WaitOperationsGreenlet_wait, NULL, __pyx_n_s_gevent___hub_primitives, __pyx_d, ((PyObject *)__pyx_codeobj__10)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 46, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_16__hub_primitives_WaitOperationsGreenlet->tp_dict, __pyx_n_s_wait, __pyx_t_1) < 0) __PYX_ERR(0, 46, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_16__hub_primitives_WaitOperationsGreenlet);
+  __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__9, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__hub_primitives_py, __pyx_n_s_wait, 46, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__10)) __PYX_ERR(0, 46, __pyx_L1_error)
+
 047:         """
+
 048:         Wait until the *watcher* (which must not be started) is ready.
+
 049: 
+
 050:         The current greenlet will be unscheduled during this time.
+
 051:         """
+
+052:         waiter = Waiter(self) # pylint:disable=undefined-variable
+
  __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_6gevent_8__waiter_Waiter), ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 52, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_v_waiter = ((struct __pyx_obj_6gevent_8__waiter_Waiter *)__pyx_t_1);
+  __pyx_t_1 = 0;
+
+053:         watcher.start(waiter.switch, waiter)
+
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_watcher, __pyx_n_s_start); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 53, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_waiter), __pyx_n_s_switch); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 53, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __pyx_t_4 = NULL;
+  __pyx_t_5 = 0;
+  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
+    if (likely(__pyx_t_4)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+      __Pyx_INCREF(__pyx_t_4);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_2, function);
+      __pyx_t_5 = 1;
+    }
+  }
+  #if CYTHON_FAST_PYCALL
+  if (PyFunction_Check(__pyx_t_2)) {
+    PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_3, ((PyObject *)__pyx_v_waiter)};
+    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 53, __pyx_L1_error)
+    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  } else
+  #endif
+  #if CYTHON_FAST_PYCCALL
+  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
+    PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_3, ((PyObject *)__pyx_v_waiter)};
+    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 53, __pyx_L1_error)
+    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  } else
+  #endif
+  {
+    __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 53, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_6);
+    if (__pyx_t_4) {
+      __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
+    }
+    __Pyx_GIVEREF(__pyx_t_3);
+    PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_t_3);
+    __Pyx_INCREF(((PyObject *)__pyx_v_waiter));
+    __Pyx_GIVEREF(((PyObject *)__pyx_v_waiter));
+    PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, ((PyObject *)__pyx_v_waiter));
+    __pyx_t_3 = 0;
+    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 53, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  }
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+054:         try:
+
  /*try:*/ {
+
+055:             result = waiter.get()
+
    __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_8__waiter_Waiter *)__pyx_v_waiter->__pyx_vtab)->get(__pyx_v_waiter, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 55, __pyx_L4_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __pyx_v_result = __pyx_t_1;
+    __pyx_t_1 = 0;
+
+056:             if result is not waiter:
+
    __pyx_t_7 = (__pyx_v_result != ((PyObject *)__pyx_v_waiter));
+    __pyx_t_8 = (__pyx_t_7 != 0);
+    if (unlikely(__pyx_t_8)) {
+/* … */
+    }
+  }
+
+057:                 raise InvalidSwitchError('Invalid switch into %s: %r (expected %r)' % (
+
      __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_switch_into_s_r_expected, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 57, __pyx_L4_error)
+      __Pyx_GOTREF(__pyx_t_2);
+      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+      __Pyx_INCREF(__pyx_v_6gevent_16__hub_primitives_InvalidSwitchError);
+      __pyx_t_6 = __pyx_v_6gevent_16__hub_primitives_InvalidSwitchError; __pyx_t_3 = NULL;
+      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
+        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_6);
+        if (likely(__pyx_t_3)) {
+          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
+          __Pyx_INCREF(__pyx_t_3);
+          __Pyx_INCREF(function);
+          __Pyx_DECREF_SET(__pyx_t_6, function);
+        }
+      }
+      __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_2);
+      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 57, __pyx_L4_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+      __Pyx_Raise(__pyx_t_1, 0, 0, 0);
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      __PYX_ERR(0, 57, __pyx_L4_error)
+
+058:                     getcurrent(), # pylint:disable=undefined-variable
+
      __pyx_t_2 = ((PyObject *)__pyx_f_6gevent_16__hub_primitives_getcurrent()); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 58, __pyx_L4_error)
+      __Pyx_GOTREF(__pyx_t_2);
+/* … */
+      __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 58, __pyx_L4_error)
+      __Pyx_GOTREF(__pyx_t_6);
+      __Pyx_GIVEREF(__pyx_t_2);
+      PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2);
+      __Pyx_INCREF(__pyx_v_result);
+      __Pyx_GIVEREF(__pyx_v_result);
+      PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_result);
+      __Pyx_INCREF(((PyObject *)__pyx_v_waiter));
+      __Pyx_GIVEREF(((PyObject *)__pyx_v_waiter));
+      PyTuple_SET_ITEM(__pyx_t_6, 2, ((PyObject *)__pyx_v_waiter));
+      __pyx_t_2 = 0;
+
 059:                     result, waiter))
+
 060:         finally:
+
+061:             watcher.stop()
+
  /*finally:*/ {
+    /*normal exit:*/{
+      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_watcher, __pyx_n_s_stop); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 61, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_6);
+      __pyx_t_2 = NULL;
+      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
+        __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_6);
+        if (likely(__pyx_t_2)) {
+          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
+          __Pyx_INCREF(__pyx_t_2);
+          __Pyx_INCREF(function);
+          __Pyx_DECREF_SET(__pyx_t_6, function);
+        }
+      }
+      __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_6);
+      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 61, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      goto __pyx_L5;
+    }
+    __pyx_L4_error:;
+    /*exception exit:*/{
+      __Pyx_PyThreadState_declare
+      __Pyx_PyThreadState_assign
+      __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0;
+      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+      if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_14, &__pyx_t_15, &__pyx_t_16);
+      if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13) < 0)) __Pyx_ErrFetch(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13);
+      __Pyx_XGOTREF(__pyx_t_11);
+      __Pyx_XGOTREF(__pyx_t_12);
+      __Pyx_XGOTREF(__pyx_t_13);
+      __Pyx_XGOTREF(__pyx_t_14);
+      __Pyx_XGOTREF(__pyx_t_15);
+      __Pyx_XGOTREF(__pyx_t_16);
+      __pyx_t_5 = __pyx_lineno; __pyx_t_9 = __pyx_clineno; __pyx_t_10 = __pyx_filename;
+      {
+        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_watcher, __pyx_n_s_stop); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 61, __pyx_L8_error)
+        __Pyx_GOTREF(__pyx_t_6);
+        __pyx_t_2 = NULL;
+        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
+          __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_6);
+          if (likely(__pyx_t_2)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
+            __Pyx_INCREF(__pyx_t_2);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_6, function);
+          }
+        }
+        __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_6);
+        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+        if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 61, __pyx_L8_error)
+        __Pyx_GOTREF(__pyx_t_1);
+        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      }
+      if (PY_MAJOR_VERSION >= 3) {
+        __Pyx_XGIVEREF(__pyx_t_14);
+        __Pyx_XGIVEREF(__pyx_t_15);
+        __Pyx_XGIVEREF(__pyx_t_16);
+        __Pyx_ExceptionReset(__pyx_t_14, __pyx_t_15, __pyx_t_16);
+      }
+      __Pyx_XGIVEREF(__pyx_t_11);
+      __Pyx_XGIVEREF(__pyx_t_12);
+      __Pyx_XGIVEREF(__pyx_t_13);
+      __Pyx_ErrRestore(__pyx_t_11, __pyx_t_12, __pyx_t_13);
+      __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0;
+      __pyx_lineno = __pyx_t_5; __pyx_clineno = __pyx_t_9; __pyx_filename = __pyx_t_10;
+      goto __pyx_L1_error;
+      __pyx_L8_error:;
+      if (PY_MAJOR_VERSION >= 3) {
+        __Pyx_XGIVEREF(__pyx_t_14);
+        __Pyx_XGIVEREF(__pyx_t_15);
+        __Pyx_XGIVEREF(__pyx_t_16);
+        __Pyx_ExceptionReset(__pyx_t_14, __pyx_t_15, __pyx_t_16);
+      }
+      __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
+      __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
+      __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
+      __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0;
+      goto __pyx_L1_error;
+    }
+    __pyx_L5:;
+  }
+
 062: 
+
+063:     def cancel_wait(self, watcher, error, close_watcher=False):
+
+/* "src/gevent/_hub_primitives.py":63
+ *             watcher.stop()
+ * 
+ *     def cancel_wait(self, watcher, error, close_watcher=False):             # <<<<<<<<<<<<<<
+ *         """
+ *         Cancel an in-progress call to :meth:`wait` by throwing the given *error*
+ */
+
+static PyObject *__pyx_pw_6gevent_16__hub_primitives_22WaitOperationsGreenlet_3cancel_wait(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_f_6gevent_16__hub_primitives_22WaitOperationsGreenlet_cancel_wait(struct __pyx_obj_6gevent_16__hub_primitives_WaitOperationsGreenlet *__pyx_v_self, PyObject *__pyx_v_watcher, PyObject *__pyx_v_error, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_16__hub_primitives_22WaitOperationsGreenlet_cancel_wait *__pyx_optional_args) {
+  PyObject *__pyx_v_close_watcher = ((PyObject *)Py_False);
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("cancel_wait", 0);
+  if (__pyx_optional_args) {
+    if (__pyx_optional_args->__pyx_n > 0) {
+      __pyx_v_close_watcher = __pyx_optional_args->close_watcher;
+    }
+  }
+  /* Check if called by wrapper */
+  if (unlikely(__pyx_skip_dispatch)) ;
+  /* Check if overridden in Python */
+  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
+    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
+    if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
+    else {
+      PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      #endif
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_cancel_wait); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 63, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_16__hub_primitives_22WaitOperationsGreenlet_3cancel_wait)) {
+        __Pyx_XDECREF(__pyx_r);
+        __Pyx_INCREF(__pyx_t_1);
+        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
+        __pyx_t_5 = 0;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+          if (likely(__pyx_t_4)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+            __Pyx_INCREF(__pyx_t_4);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_3, function);
+            __pyx_t_5 = 1;
+          }
+        }
+        #if CYTHON_FAST_PYCALL
+        if (PyFunction_Check(__pyx_t_3)) {
+          PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_watcher, __pyx_v_error, __pyx_v_close_watcher};
+          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 63, __pyx_L1_error)
+          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+          __Pyx_GOTREF(__pyx_t_2);
+        } else
+        #endif
+        #if CYTHON_FAST_PYCCALL
+        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
+          PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_watcher, __pyx_v_error, __pyx_v_close_watcher};
+          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 63, __pyx_L1_error)
+          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+          __Pyx_GOTREF(__pyx_t_2);
+        } else
+        #endif
+        {
+          __pyx_t_6 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 63, __pyx_L1_error)
+          __Pyx_GOTREF(__pyx_t_6);
+          if (__pyx_t_4) {
+            __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
+          }
+          __Pyx_INCREF(__pyx_v_watcher);
+          __Pyx_GIVEREF(__pyx_v_watcher);
+          PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_watcher);
+          __Pyx_INCREF(__pyx_v_error);
+          __Pyx_GIVEREF(__pyx_v_error);
+          PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_error);
+          __Pyx_INCREF(__pyx_v_close_watcher);
+          __Pyx_GIVEREF(__pyx_v_close_watcher);
+          PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_v_close_watcher);
+          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 63, __pyx_L1_error)
+          __Pyx_GOTREF(__pyx_t_2);
+          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+        }
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __pyx_r = __pyx_t_2;
+        __pyx_t_2 = 0;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        goto __pyx_L0;
+      }
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+      tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
+      if (unlikely(type_dict_guard != tp_dict_version)) {
+        tp_dict_version = obj_dict_version = 0;
+      }
+      #endif
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    }
+    #endif
+  }
+
+  /* "src/gevent/_hub_primitives.py":63
+ *             watcher.stop()
+ * 
+ *     def cancel_wait(self, watcher, error, close_watcher=False):             # <<<<<<<<<<<<<<
+ *         """
+ *         Cancel an in-progress call to :meth:`wait` by throwing the given *error*
+ */
+
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_6);
+  __Pyx_AddTraceback("gevent.__hub_primitives.WaitOperationsGreenlet.cancel_wait", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_16__hub_primitives_22WaitOperationsGreenlet_3cancel_wait(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_6gevent_16__hub_primitives_22WaitOperationsGreenlet_2cancel_wait[] = "WaitOperationsGreenlet.cancel_wait(self, watcher, error, close_watcher=False)\n\n        Cancel an in-progress call to :meth:`wait` by throwing the given *error*\n        in the waiting greenlet.\n\n        .. versionchanged:: 1.3a1\n           Added the *close_watcher* parameter. If true, the watcher\n           will be closed after the exception is thrown. The watcher should then\n           be discarded. Closing the watcher is important to release native resources.\n        .. versionchanged:: 1.3a2\n           Allow the *watcher* to be ``None``. No action is taken in that case.\n        ";
+static PyMethodDef __pyx_mdef_6gevent_16__hub_primitives_22WaitOperationsGreenlet_3cancel_wait = {"cancel_wait", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_16__hub_primitives_22WaitOperationsGreenlet_3cancel_wait, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_16__hub_primitives_22WaitOperationsGreenlet_2cancel_wait};
+static PyObject *__pyx_pw_6gevent_16__hub_primitives_22WaitOperationsGreenlet_3cancel_wait(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_watcher = 0;
+  PyObject *__pyx_v_error = 0;
+  PyObject *__pyx_v_close_watcher = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("cancel_wait (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_watcher,&__pyx_n_s_error,&__pyx_n_s_close_watcher,0};
+    PyObject* values[3] = {0,0,0};
+    values[2] = ((PyObject *)Py_False);
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_watcher)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_error)) != 0)) kw_args--;
+        else {
+          __Pyx_RaiseArgtupleInvalid("cancel_wait", 0, 2, 3, 1); __PYX_ERR(0, 63, __pyx_L3_error)
+        }
+        CYTHON_FALLTHROUGH;
+        case  2:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_close_watcher);
+          if (value) { values[2] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "cancel_wait") < 0)) __PYX_ERR(0, 63, __pyx_L3_error)
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    __pyx_v_watcher = values[0];
+    __pyx_v_error = values[1];
+    __pyx_v_close_watcher = values[2];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("cancel_wait", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 63, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.__hub_primitives.WaitOperationsGreenlet.cancel_wait", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_16__hub_primitives_22WaitOperationsGreenlet_2cancel_wait(((struct __pyx_obj_6gevent_16__hub_primitives_WaitOperationsGreenlet *)__pyx_v_self), __pyx_v_watcher, __pyx_v_error, __pyx_v_close_watcher);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_16__hub_primitives_22WaitOperationsGreenlet_2cancel_wait(struct __pyx_obj_6gevent_16__hub_primitives_WaitOperationsGreenlet *__pyx_v_self, PyObject *__pyx_v_watcher, PyObject *__pyx_v_error, PyObject *__pyx_v_close_watcher) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("cancel_wait", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_2.__pyx_n = 1;
+  __pyx_t_2.close_watcher = __pyx_v_close_watcher;
+  __pyx_t_1 = __pyx_vtabptr_6gevent_16__hub_primitives_WaitOperationsGreenlet->cancel_wait(__pyx_v_self, __pyx_v_watcher, __pyx_v_error, 1, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 63, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.__hub_primitives.WaitOperationsGreenlet.cancel_wait", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+  /* "src/gevent/_hub_primitives.py":63
+ *             watcher.stop()
+ * 
+ *     def cancel_wait(self, watcher, error, close_watcher=False):             # <<<<<<<<<<<<<<
+ *         """
+ *         Cancel an in-progress call to :meth:`wait` by throwing the given *error*
+ */
+  __pyx_tuple__11 = PyTuple_Pack(4, __pyx_n_s_self_2, __pyx_n_s_watcher, __pyx_n_s_error, __pyx_n_s_close_watcher); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 63, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__11);
+  __Pyx_GIVEREF(__pyx_tuple__11);
+
+  /* "src/gevent/_hub_primitives.py":63
+ *             watcher.stop()
+ * 
+ *     def cancel_wait(self, watcher, error, close_watcher=False):             # <<<<<<<<<<<<<<
+ *         """
+ *         Cancel an in-progress call to :meth:`wait` by throwing the given *error*
+ */
+  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_16__hub_primitives_22WaitOperationsGreenlet_3cancel_wait, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_WaitOperationsGreenlet_cancel_wa, NULL, __pyx_n_s_gevent___hub_primitives, __pyx_d, ((PyObject *)__pyx_codeobj__12)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 63, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_16__hub_primitives_WaitOperationsGreenlet->tp_dict, __pyx_n_s_cancel_wait, __pyx_t_1) < 0) __PYX_ERR(0, 63, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_16__hub_primitives_WaitOperationsGreenlet);
+  __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__11, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__hub_primitives_py, __pyx_n_s_cancel_wait, 63, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(0, 63, __pyx_L1_error)
+
 064:         """
+
 065:         Cancel an in-progress call to :meth:`wait` by throwing the given *error*
+
 066:         in the waiting greenlet.
+
 067: 
+
 068:         .. versionchanged:: 1.3a1
+
 069:            Added the *close_watcher* parameter. If true, the watcher
+
 070:            will be closed after the exception is thrown. The watcher should then
+
 071:            be discarded. Closing the watcher is important to release native resources.
+
 072:         .. versionchanged:: 1.3a2
+
 073:            Allow the *watcher* to be ``None``. No action is taken in that case.
+
 074:         """
+
+075:         if watcher is None:
+
  __pyx_t_7 = (__pyx_v_watcher == Py_None);
+  __pyx_t_8 = (__pyx_t_7 != 0);
+  if (__pyx_t_8) {
+/* … */
+  }
+
 076:             # Presumably already closed.
+
 077:             # See https://github.com/gevent/gevent/issues/1089
+
+078:             return
+
    __Pyx_XDECREF(__pyx_r);
+    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+    goto __pyx_L0;
+
+079:         if watcher.callback is not None:
+
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_watcher, __pyx_n_s_callback); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 79, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_8 = (__pyx_t_1 != Py_None);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_7 = (__pyx_t_8 != 0);
+  if (__pyx_t_7) {
+/* … */
+    goto __pyx_L4;
+  }
+
+080:             self.loop.run_callback(self._cancel_wait, watcher, error, close_watcher)
+
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->__pyx_base.loop, __pyx_n_s_run_callback); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 80, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_cancel_wait_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 80, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __pyx_t_6 = NULL;
+    __pyx_t_5 = 0;
+    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
+      if (likely(__pyx_t_6)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+        __Pyx_INCREF(__pyx_t_6);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_2, function);
+        __pyx_t_5 = 1;
+      }
+    }
+    #if CYTHON_FAST_PYCALL
+    if (PyFunction_Check(__pyx_t_2)) {
+      PyObject *__pyx_temp[5] = {__pyx_t_6, __pyx_t_3, __pyx_v_watcher, __pyx_v_error, __pyx_v_close_watcher};
+      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 4+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 80, __pyx_L1_error)
+      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+      __Pyx_GOTREF(__pyx_t_1);
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    } else
+    #endif
+    #if CYTHON_FAST_PYCCALL
+    if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
+      PyObject *__pyx_temp[5] = {__pyx_t_6, __pyx_t_3, __pyx_v_watcher, __pyx_v_error, __pyx_v_close_watcher};
+      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 4+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 80, __pyx_L1_error)
+      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+      __Pyx_GOTREF(__pyx_t_1);
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    } else
+    #endif
+    {
+      __pyx_t_4 = PyTuple_New(4+__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 80, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_4);
+      if (__pyx_t_6) {
+        __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6); __pyx_t_6 = NULL;
+      }
+      __Pyx_GIVEREF(__pyx_t_3);
+      PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_5, __pyx_t_3);
+      __Pyx_INCREF(__pyx_v_watcher);
+      __Pyx_GIVEREF(__pyx_v_watcher);
+      PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_5, __pyx_v_watcher);
+      __Pyx_INCREF(__pyx_v_error);
+      __Pyx_GIVEREF(__pyx_v_error);
+      PyTuple_SET_ITEM(__pyx_t_4, 2+__pyx_t_5, __pyx_v_error);
+      __Pyx_INCREF(__pyx_v_close_watcher);
+      __Pyx_GIVEREF(__pyx_v_close_watcher);
+      PyTuple_SET_ITEM(__pyx_t_4, 3+__pyx_t_5, __pyx_v_close_watcher);
+      __pyx_t_3 = 0;
+      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 80, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    }
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+081:         elif close_watcher:
+
  __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_close_watcher); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 81, __pyx_L1_error)
+  if (__pyx_t_7) {
+/* … */
+  }
+  __pyx_L4:;
+
+082:             watcher.close()
+
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_watcher, __pyx_n_s_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 82, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_4 = NULL;
+    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
+      if (likely(__pyx_t_4)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+        __Pyx_INCREF(__pyx_t_4);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_2, function);
+      }
+    }
+    __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
+    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 82, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 083: 
+
+084:     def _cancel_wait(self, watcher, error, close_watcher):
+
static PyObject *__pyx_pw_6gevent_16__hub_primitives_22WaitOperationsGreenlet_5_cancel_wait(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_f_6gevent_16__hub_primitives_22WaitOperationsGreenlet__cancel_wait(CYTHON_UNUSED struct __pyx_obj_6gevent_16__hub_primitives_WaitOperationsGreenlet *__pyx_v_self, PyObject *__pyx_v_watcher, PyObject *__pyx_v_error, PyObject *__pyx_v_close_watcher, int __pyx_skip_dispatch) {
+  PyObject *__pyx_v_active = NULL;
+  PyObject *__pyx_v_cb = NULL;
+  PyObject *__pyx_v_glet = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_cancel_wait", 0);
+  /* Check if called by wrapper */
+  if (unlikely(__pyx_skip_dispatch)) ;
+  /* Check if overridden in Python */
+  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
+    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
+    if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
+    else {
+      PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      #endif
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_cancel_wait_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 84, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_16__hub_primitives_22WaitOperationsGreenlet_5_cancel_wait)) {
+        __Pyx_XDECREF(__pyx_r);
+        __Pyx_INCREF(__pyx_t_1);
+        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
+        __pyx_t_5 = 0;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+          if (likely(__pyx_t_4)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+            __Pyx_INCREF(__pyx_t_4);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_3, function);
+            __pyx_t_5 = 1;
+          }
+        }
+        #if CYTHON_FAST_PYCALL
+        if (PyFunction_Check(__pyx_t_3)) {
+          PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_watcher, __pyx_v_error, __pyx_v_close_watcher};
+          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 84, __pyx_L1_error)
+          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+          __Pyx_GOTREF(__pyx_t_2);
+        } else
+        #endif
+        #if CYTHON_FAST_PYCCALL
+        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
+          PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_watcher, __pyx_v_error, __pyx_v_close_watcher};
+          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 84, __pyx_L1_error)
+          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+          __Pyx_GOTREF(__pyx_t_2);
+        } else
+        #endif
+        {
+          __pyx_t_6 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 84, __pyx_L1_error)
+          __Pyx_GOTREF(__pyx_t_6);
+          if (__pyx_t_4) {
+            __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
+          }
+          __Pyx_INCREF(__pyx_v_watcher);
+          __Pyx_GIVEREF(__pyx_v_watcher);
+          PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_watcher);
+          __Pyx_INCREF(__pyx_v_error);
+          __Pyx_GIVEREF(__pyx_v_error);
+          PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_error);
+          __Pyx_INCREF(__pyx_v_close_watcher);
+          __Pyx_GIVEREF(__pyx_v_close_watcher);
+          PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_v_close_watcher);
+          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 84, __pyx_L1_error)
+          __Pyx_GOTREF(__pyx_t_2);
+          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+        }
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __pyx_r = __pyx_t_2;
+        __pyx_t_2 = 0;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        goto __pyx_L0;
+      }
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+      tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
+      if (unlikely(type_dict_guard != tp_dict_version)) {
+        tp_dict_version = obj_dict_version = 0;
+      }
+      #endif
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    }
+    #endif
+  }
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_6);
+  __Pyx_AddTraceback("gevent.__hub_primitives.WaitOperationsGreenlet._cancel_wait", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_active);
+  __Pyx_XDECREF(__pyx_v_cb);
+  __Pyx_XDECREF(__pyx_v_glet);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_16__hub_primitives_22WaitOperationsGreenlet_5_cancel_wait(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_6gevent_16__hub_primitives_22WaitOperationsGreenlet_4_cancel_wait[] = "WaitOperationsGreenlet._cancel_wait(self, watcher, error, close_watcher)";
+static PyMethodDef __pyx_mdef_6gevent_16__hub_primitives_22WaitOperationsGreenlet_5_cancel_wait = {"_cancel_wait", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_16__hub_primitives_22WaitOperationsGreenlet_5_cancel_wait, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_16__hub_primitives_22WaitOperationsGreenlet_4_cancel_wait};
+static PyObject *__pyx_pw_6gevent_16__hub_primitives_22WaitOperationsGreenlet_5_cancel_wait(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_watcher = 0;
+  PyObject *__pyx_v_error = 0;
+  PyObject *__pyx_v_close_watcher = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_cancel_wait (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_watcher,&__pyx_n_s_error,&__pyx_n_s_close_watcher,0};
+    PyObject* values[3] = {0,0,0};
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_watcher)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_error)) != 0)) kw_args--;
+        else {
+          __Pyx_RaiseArgtupleInvalid("_cancel_wait", 1, 3, 3, 1); __PYX_ERR(0, 84, __pyx_L3_error)
+        }
+        CYTHON_FALLTHROUGH;
+        case  2:
+        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_close_watcher)) != 0)) kw_args--;
+        else {
+          __Pyx_RaiseArgtupleInvalid("_cancel_wait", 1, 3, 3, 2); __PYX_ERR(0, 84, __pyx_L3_error)
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_cancel_wait") < 0)) __PYX_ERR(0, 84, __pyx_L3_error)
+      }
+    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
+      goto __pyx_L5_argtuple_error;
+    } else {
+      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+    }
+    __pyx_v_watcher = values[0];
+    __pyx_v_error = values[1];
+    __pyx_v_close_watcher = values[2];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("_cancel_wait", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 84, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.__hub_primitives.WaitOperationsGreenlet._cancel_wait", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_16__hub_primitives_22WaitOperationsGreenlet_4_cancel_wait(((struct __pyx_obj_6gevent_16__hub_primitives_WaitOperationsGreenlet *)__pyx_v_self), __pyx_v_watcher, __pyx_v_error, __pyx_v_close_watcher);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_16__hub_primitives_22WaitOperationsGreenlet_4_cancel_wait(struct __pyx_obj_6gevent_16__hub_primitives_WaitOperationsGreenlet *__pyx_v_self, PyObject *__pyx_v_watcher, PyObject *__pyx_v_error, PyObject *__pyx_v_close_watcher) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_cancel_wait", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __pyx_f_6gevent_16__hub_primitives_22WaitOperationsGreenlet__cancel_wait(__pyx_v_self, __pyx_v_watcher, __pyx_v_error, __pyx_v_close_watcher, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 84, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.__hub_primitives.WaitOperationsGreenlet._cancel_wait", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__13 = PyTuple_Pack(4, __pyx_n_s_self_2, __pyx_n_s_watcher, __pyx_n_s_error, __pyx_n_s_close_watcher); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 84, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__13);
+  __Pyx_GIVEREF(__pyx_tuple__13);
+/* … */
+  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_16__hub_primitives_22WaitOperationsGreenlet_5_cancel_wait, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_WaitOperationsGreenlet__cancel_w, NULL, __pyx_n_s_gevent___hub_primitives, __pyx_d, ((PyObject *)__pyx_codeobj__14)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 84, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_16__hub_primitives_WaitOperationsGreenlet->tp_dict, __pyx_n_s_cancel_wait_2, __pyx_t_1) < 0) __PYX_ERR(0, 84, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_16__hub_primitives_WaitOperationsGreenlet);
+  __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__13, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__hub_primitives_py, __pyx_n_s_cancel_wait_2, 84, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__14)) __PYX_ERR(0, 84, __pyx_L1_error)
+
 085:         # We have to check again to see if it was still active by the time
+
 086:         # our callback actually runs.
+
+087:         active = watcher.active
+
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_watcher, __pyx_n_s_active); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 87, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_v_active = __pyx_t_1;
+  __pyx_t_1 = 0;
+
+088:         cb = watcher.callback
+
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_watcher, __pyx_n_s_callback); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 88, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_v_cb = __pyx_t_1;
+  __pyx_t_1 = 0;
+
+089:         if close_watcher:
+
  __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_close_watcher); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 89, __pyx_L1_error)
+  if (__pyx_t_7) {
+/* … */
+  }
+
+090:             watcher.close()
+
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_watcher, __pyx_n_s_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 90, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_3 = NULL;
+    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+      if (likely(__pyx_t_3)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+        __Pyx_INCREF(__pyx_t_3);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_2, function);
+      }
+    }
+    __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
+    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 90, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+091:         if active:
+
  __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_active); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 91, __pyx_L1_error)
+  if (__pyx_t_7) {
+/* … */
+  }
+
 092:             # The callback should be greenlet.switch(). It may or may not be None.
+
+093:             glet = getattr(cb, '__self__', None)
+
    __pyx_t_1 = __Pyx_GetAttr3(__pyx_v_cb, __pyx_n_s_self, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 93, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __pyx_v_glet = __pyx_t_1;
+    __pyx_t_1 = 0;
+
+094:             if glet is not None:
+
    __pyx_t_7 = (__pyx_v_glet != Py_None);
+    __pyx_t_8 = (__pyx_t_7 != 0);
+    if (__pyx_t_8) {
+/* … */
+    }
+
+095:                 glet.throw(error)
+
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_glet, __pyx_n_s_throw); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 95, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_2);
+      __pyx_t_3 = NULL;
+      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+        if (likely(__pyx_t_3)) {
+          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+          __Pyx_INCREF(__pyx_t_3);
+          __Pyx_INCREF(function);
+          __Pyx_DECREF_SET(__pyx_t_2, function);
+        }
+      }
+      __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_error) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_error);
+      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 95, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 096: 
+
 097: 
+
+098: class _WaitIterator(object):
+
struct __pyx_vtabstruct_6gevent_16__hub_primitives__WaitIterator {
+  PyObject *(*_begin)(struct __pyx_obj_6gevent_16__hub_primitives__WaitIterator *);
+  PyObject *(*_cleanup)(struct __pyx_obj_6gevent_16__hub_primitives__WaitIterator *);
+  PyObject *(*__pyx___enter__)(struct __pyx_obj_6gevent_16__hub_primitives__WaitIterator *, int __pyx_skip_dispatch);
+  PyObject *(*__pyx___exit__)(struct __pyx_obj_6gevent_16__hub_primitives__WaitIterator *, PyObject *, PyObject *, PyObject *, int __pyx_skip_dispatch);
+};
+static struct __pyx_vtabstruct_6gevent_16__hub_primitives__WaitIterator *__pyx_vtabptr_6gevent_16__hub_primitives__WaitIterator;
+
 099: 
+
+100:     def __init__(self, objects, hub, timeout, count):
+
/* Python wrapper */
+static int __pyx_pw_6gevent_16__hub_primitives_13_WaitIterator_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static int __pyx_pw_6gevent_16__hub_primitives_13_WaitIterator_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_objects = 0;
+  PyObject *__pyx_v_hub = 0;
+  PyObject *__pyx_v_timeout = 0;
+  PyObject *__pyx_v_count = 0;
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_objects,&__pyx_n_s_hub,&__pyx_n_s_timeout,&__pyx_n_s_count,0};
+    PyObject* values[4] = {0,0,0,0};
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
+        CYTHON_FALLTHROUGH;
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_objects)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_hub)) != 0)) kw_args--;
+        else {
+          __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, 1); __PYX_ERR(0, 100, __pyx_L3_error)
+        }
+        CYTHON_FALLTHROUGH;
+        case  2:
+        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_timeout)) != 0)) kw_args--;
+        else {
+          __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, 2); __PYX_ERR(0, 100, __pyx_L3_error)
+        }
+        CYTHON_FALLTHROUGH;
+        case  3:
+        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_count)) != 0)) kw_args--;
+        else {
+          __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, 3); __PYX_ERR(0, 100, __pyx_L3_error)
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 100, __pyx_L3_error)
+      }
+    } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
+      goto __pyx_L5_argtuple_error;
+    } else {
+      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
+    }
+    __pyx_v_objects = values[0];
+    __pyx_v_hub = values[1];
+    __pyx_v_timeout = values[2];
+    __pyx_v_count = values[3];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 100, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.__hub_primitives._WaitIterator.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return -1;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_16__hub_primitives_13_WaitIterator___init__(((struct __pyx_obj_6gevent_16__hub_primitives__WaitIterator *)__pyx_v_self), __pyx_v_objects, __pyx_v_hub, __pyx_v_timeout, __pyx_v_count);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_16__hub_primitives_13_WaitIterator___init__(struct __pyx_obj_6gevent_16__hub_primitives__WaitIterator *__pyx_v_self, PyObject *__pyx_v_objects, PyObject *__pyx_v_hub, PyObject *__pyx_v_timeout, PyObject *__pyx_v_count) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = 0;
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_XDECREF(__pyx_t_6);
+  __Pyx_XDECREF(__pyx_t_7);
+  __Pyx_AddTraceback("gevent.__hub_primitives._WaitIterator.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = -1;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+101:         self._hub = hub
+
  if (!(likely(((__pyx_v_hub) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_hub, __pyx_ptype_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop))))) __PYX_ERR(0, 101, __pyx_L1_error)
+  __pyx_t_1 = __pyx_v_hub;
+  __Pyx_INCREF(__pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_1);
+  __Pyx_GOTREF(__pyx_v_self->_hub);
+  __Pyx_DECREF(((PyObject *)__pyx_v_self->_hub));
+  __pyx_v_self->_hub = ((struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *)__pyx_t_1);
+  __pyx_t_1 = 0;
+
+102:         self._waiter = MultipleWaiter(hub) # pylint:disable=undefined-variable
+
  __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_6gevent_8__waiter_MultipleWaiter), __pyx_v_hub); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 102, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_1);
+  __Pyx_GOTREF(__pyx_v_self->_waiter);
+  __Pyx_DECREF(((PyObject *)__pyx_v_self->_waiter));
+  __pyx_v_self->_waiter = ((struct __pyx_obj_6gevent_8__waiter_MultipleWaiter *)__pyx_t_1);
+  __pyx_t_1 = 0;
+
+103:         self._switch = self._waiter.switch
+
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->_waiter), __pyx_n_s_switch); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 103, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_1);
+  __Pyx_GOTREF(__pyx_v_self->_switch);
+  __Pyx_DECREF(__pyx_v_self->_switch);
+  __pyx_v_self->_switch = __pyx_t_1;
+  __pyx_t_1 = 0;
+
+104:         self._timeout = timeout
+
  __Pyx_INCREF(__pyx_v_timeout);
+  __Pyx_GIVEREF(__pyx_v_timeout);
+  __Pyx_GOTREF(__pyx_v_self->_timeout);
+  __Pyx_DECREF(__pyx_v_self->_timeout);
+  __pyx_v_self->_timeout = __pyx_v_timeout;
+
+105:         self._objects = objects
+
  __Pyx_INCREF(__pyx_v_objects);
+  __Pyx_GIVEREF(__pyx_v_objects);
+  __Pyx_GOTREF(__pyx_v_self->_objects);
+  __Pyx_DECREF(__pyx_v_self->_objects);
+  __pyx_v_self->_objects = __pyx_v_objects;
+
 106: 
+
+107:         self._timer = None
+
  __Pyx_INCREF(Py_None);
+  __Pyx_GIVEREF(Py_None);
+  __Pyx_GOTREF(__pyx_v_self->_timer);
+  __Pyx_DECREF(__pyx_v_self->_timer);
+  __pyx_v_self->_timer = Py_None;
+
+108:         self._begun = False
+
  __pyx_v_self->_begun = 0;
+
 109: 
+
 110:         # Even if we're only going to return 1 object,
+
 111:         # we must still rawlink() *all* of them, so that no
+
 112:         # matter which one finishes first we find it.
+
+113:         self._count = len(objects) if count is None else min(count, len(objects))
+
  __pyx_t_3 = (__pyx_v_count == Py_None);
+  if ((__pyx_t_3 != 0)) {
+    __pyx_t_4 = PyObject_Length(__pyx_v_objects); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 113, __pyx_L1_error)
+    __pyx_t_2 = __pyx_t_4;
+  } else {
+    __pyx_t_4 = PyObject_Length(__pyx_v_objects); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 113, __pyx_L1_error)
+    __Pyx_INCREF(__pyx_v_count);
+    __pyx_t_1 = __pyx_v_count;
+    __pyx_t_6 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 113, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_6);
+    __pyx_t_7 = PyObject_RichCompare(__pyx_t_6, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 113, __pyx_L1_error)
+    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+    __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 113, __pyx_L1_error)
+    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+    if (__pyx_t_8) {
+      __pyx_t_7 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 113, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_7);
+      __pyx_t_5 = __pyx_t_7;
+      __pyx_t_7 = 0;
+    } else {
+      __Pyx_INCREF(__pyx_t_1);
+      __pyx_t_5 = __pyx_t_1;
+    }
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __pyx_t_4 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_4 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 113, __pyx_L1_error)
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __pyx_t_2 = __pyx_t_4;
+  }
+  __pyx_v_self->_count = __pyx_t_2;
+
 114: 
+
+115:     def _begin(self):
+
static PyObject *__pyx_f_6gevent_16__hub_primitives_13_WaitIterator__begin(struct __pyx_obj_6gevent_16__hub_primitives__WaitIterator *__pyx_v_self) {
+  PyObject *__pyx_v_obj = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_begin", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_XDECREF(__pyx_t_6);
+  __Pyx_XDECREF(__pyx_t_7);
+  __Pyx_AddTraceback("gevent.__hub_primitives._WaitIterator._begin", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_obj);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+116:         if self._begun:
+
  __pyx_t_1 = (__pyx_v_self->_begun != 0);
+  if (__pyx_t_1) {
+/* … */
+  }
+
+117:             return
+
    __Pyx_XDECREF(__pyx_r);
+    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+    goto __pyx_L0;
+
 118: 
+
+119:         self._begun = True
+
  __pyx_v_self->_begun = 1;
+
 120: 
+
 121:         # XXX: If iteration doesn't actually happen, we
+
 122:         # could leave these links around!
+
+123:         for obj in self._objects:
+
  if (likely(PyList_CheckExact(__pyx_v_self->_objects)) || PyTuple_CheckExact(__pyx_v_self->_objects)) {
+    __pyx_t_2 = __pyx_v_self->_objects; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
+    __pyx_t_4 = NULL;
+  } else {
+    __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_self->_objects); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 123, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 123, __pyx_L1_error)
+  }
+  for (;;) {
+    if (likely(!__pyx_t_4)) {
+      if (likely(PyList_CheckExact(__pyx_t_2))) {
+        if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
+        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+        __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 123, __pyx_L1_error)
+        #else
+        __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 123, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_5);
+        #endif
+      } else {
+        if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
+        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+        __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 123, __pyx_L1_error)
+        #else
+        __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 123, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_5);
+        #endif
+      }
+    } else {
+      __pyx_t_5 = __pyx_t_4(__pyx_t_2);
+      if (unlikely(!__pyx_t_5)) {
+        PyObject* exc_type = PyErr_Occurred();
+        if (exc_type) {
+          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+          else __PYX_ERR(0, 123, __pyx_L1_error)
+        }
+        break;
+      }
+      __Pyx_GOTREF(__pyx_t_5);
+    }
+    __Pyx_XDECREF_SET(__pyx_v_obj, __pyx_t_5);
+    __pyx_t_5 = 0;
+/* … */
+  }
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+124:             obj.rawlink(self._switch)
+
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_rawlink); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 124, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_6);
+    __pyx_t_7 = NULL;
+    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
+      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
+      if (likely(__pyx_t_7)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
+        __Pyx_INCREF(__pyx_t_7);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_6, function);
+      }
+    }
+    __pyx_t_5 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_v_self->_switch) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_self->_switch);
+    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+    if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 124, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_5);
+    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+
 125: 
+
+126:         if self._timeout is not None:
+
  __pyx_t_1 = (__pyx_v_self->_timeout != Py_None);
+  __pyx_t_8 = (__pyx_t_1 != 0);
+  if (__pyx_t_8) {
+/* … */
+  }
+
+127:             self._timer = self._hub.loop.timer(self._timeout, priority=-1)
+
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_hub->loop, __pyx_n_s_timer); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 127, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 127, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_5);
+    __Pyx_INCREF(__pyx_v_self->_timeout);
+    __Pyx_GIVEREF(__pyx_v_self->_timeout);
+    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_self->_timeout);
+    __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 127, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_6);
+    if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_priority, __pyx_int_neg_1) < 0) __PYX_ERR(0, 127, __pyx_L1_error)
+    __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 127, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_7);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+    __Pyx_GIVEREF(__pyx_t_7);
+    __Pyx_GOTREF(__pyx_v_self->_timer);
+    __Pyx_DECREF(__pyx_v_self->_timer);
+    __pyx_v_self->_timer = __pyx_t_7;
+    __pyx_t_7 = 0;
+
+128:             self._timer.start(self._switch, self)
+
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_timer, __pyx_n_s_start); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 128, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_6);
+    __pyx_t_5 = NULL;
+    __pyx_t_9 = 0;
+    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
+      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
+      if (likely(__pyx_t_5)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
+        __Pyx_INCREF(__pyx_t_5);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_6, function);
+        __pyx_t_9 = 1;
+      }
+    }
+    #if CYTHON_FAST_PYCALL
+    if (PyFunction_Check(__pyx_t_6)) {
+      PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_self->_switch, ((PyObject *)__pyx_v_self)};
+      __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 128, __pyx_L1_error)
+      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+      __Pyx_GOTREF(__pyx_t_7);
+    } else
+    #endif
+    #if CYTHON_FAST_PYCCALL
+    if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
+      PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_self->_switch, ((PyObject *)__pyx_v_self)};
+      __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 128, __pyx_L1_error)
+      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+      __Pyx_GOTREF(__pyx_t_7);
+    } else
+    #endif
+    {
+      __pyx_t_2 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 128, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_2);
+      if (__pyx_t_5) {
+        __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5); __pyx_t_5 = NULL;
+      }
+      __Pyx_INCREF(__pyx_v_self->_switch);
+      __Pyx_GIVEREF(__pyx_v_self->_switch);
+      PyTuple_SET_ITEM(__pyx_t_2, 0+__pyx_t_9, __pyx_v_self->_switch);
+      __Pyx_INCREF(((PyObject *)__pyx_v_self));
+      __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
+      PyTuple_SET_ITEM(__pyx_t_2, 1+__pyx_t_9, ((PyObject *)__pyx_v_self));
+      __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_2, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 128, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_7);
+      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    }
+    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+
 129: 
+
+130:     def __iter__(self):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_16__hub_primitives_13_WaitIterator_3__iter__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_16__hub_primitives_13_WaitIterator_3__iter__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_16__hub_primitives_13_WaitIterator_2__iter__(((struct __pyx_obj_6gevent_16__hub_primitives__WaitIterator *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_16__hub_primitives_13_WaitIterator_2__iter__(struct __pyx_obj_6gevent_16__hub_primitives__WaitIterator *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__iter__", 0);
+/* … */
+  /* function exit code */
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+131:         return self
+
  __Pyx_XDECREF(__pyx_r);
+  __Pyx_INCREF(((PyObject *)__pyx_v_self));
+  __pyx_r = ((PyObject *)__pyx_v_self);
+  goto __pyx_L0;
+
 132: 
+
+133:     def __next__(self):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_16__hub_primitives_13_WaitIterator_5__next__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_16__hub_primitives_13_WaitIterator_5__next__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__next__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_16__hub_primitives_13_WaitIterator_4__next__(((struct __pyx_obj_6gevent_16__hub_primitives__WaitIterator *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_16__hub_primitives_13_WaitIterator_4__next__(struct __pyx_obj_6gevent_16__hub_primitives__WaitIterator *__pyx_v_self) {
+  PyObject *__pyx_v_item = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__next__", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_7);
+  __Pyx_XDECREF(__pyx_t_8);
+  __Pyx_XDECREF(__pyx_t_9);
+  __Pyx_AddTraceback("gevent.__hub_primitives._WaitIterator.__next__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_item);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+134:         self._begin()
+
  __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_16__hub_primitives__WaitIterator *)__pyx_v_self->__pyx_vtab)->_begin(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 134, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 135: 
+
+136:         if self._count == 0:
+
  __pyx_t_2 = ((__pyx_v_self->_count == 0) != 0);
+  if (unlikely(__pyx_t_2)) {
+/* … */
+  }
+
 137:             # Exhausted
+
+138:             self._cleanup()
+
    __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_16__hub_primitives__WaitIterator *)__pyx_v_self->__pyx_vtab)->_cleanup(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 138, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+139:             raise StopIteration()
+
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_builtin_StopIteration); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 139, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __PYX_ERR(0, 139, __pyx_L1_error)
+
 140: 
+
+141:         self._count -= 1
+
  __pyx_v_self->_count = (__pyx_v_self->_count - 1);
+
+142:         try:
+
  {
+    /*try:*/ {
+/* … */
+    }
+    __pyx_L4_error:;
+    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+/* … */
+    __Pyx_XGIVEREF(__pyx_t_3);
+    __Pyx_XGIVEREF(__pyx_t_4);
+    __Pyx_XGIVEREF(__pyx_t_5);
+    __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
+    goto __pyx_L1_error;
+    __pyx_L8_try_return:;
+    __Pyx_XGIVEREF(__pyx_t_3);
+    __Pyx_XGIVEREF(__pyx_t_4);
+    __Pyx_XGIVEREF(__pyx_t_5);
+    __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
+    goto __pyx_L0;
+  }
+
+143:             item = self._waiter.get()
+
      __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_8__waiter_MultipleWaiter *)__pyx_v_self->_waiter->__pyx_base.__pyx_vtab)->__pyx_base.get(((struct __pyx_obj_6gevent_8__waiter_Waiter *)__pyx_v_self->_waiter), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 143, __pyx_L4_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      __pyx_v_item = __pyx_t_1;
+      __pyx_t_1 = 0;
+
+144:             self._waiter.clear()
+
      __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_8__waiter_MultipleWaiter *)__pyx_v_self->_waiter->__pyx_base.__pyx_vtab)->__pyx_base.clear(((struct __pyx_obj_6gevent_8__waiter_Waiter *)__pyx_v_self->_waiter), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 144, __pyx_L4_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+145:             if item is self:
+
      __pyx_t_2 = (__pyx_v_item == ((PyObject *)__pyx_v_self));
+      __pyx_t_6 = (__pyx_t_2 != 0);
+      if (unlikely(__pyx_t_6)) {
+/* … */
+      }
+
 146:                 # Timer expired, no more
+
+147:                 self._cleanup()
+
        __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_16__hub_primitives__WaitIterator *)__pyx_v_self->__pyx_vtab)->_cleanup(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 147, __pyx_L4_error)
+        __Pyx_GOTREF(__pyx_t_1);
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+148:                 raise StopIteration()
+
        __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_builtin_StopIteration); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 148, __pyx_L4_error)
+        __Pyx_GOTREF(__pyx_t_1);
+        __Pyx_Raise(__pyx_t_1, 0, 0, 0);
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        __PYX_ERR(0, 148, __pyx_L4_error)
+
+149:             return item
+
      __Pyx_XDECREF(__pyx_r);
+      __Pyx_INCREF(__pyx_v_item);
+      __pyx_r = __pyx_v_item;
+      goto __pyx_L8_try_return;
+
+150:         except:
+
    /*except:*/ {
+      __Pyx_AddTraceback("gevent.__hub_primitives._WaitIterator.__next__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+      if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(0, 150, __pyx_L6_except_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      __Pyx_GOTREF(__pyx_t_7);
+      __Pyx_GOTREF(__pyx_t_8);
+
+151:             self._cleanup()
+
      __pyx_t_9 = ((struct __pyx_vtabstruct_6gevent_16__hub_primitives__WaitIterator *)__pyx_v_self->__pyx_vtab)->_cleanup(__pyx_v_self); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 151, __pyx_L6_except_error)
+      __Pyx_GOTREF(__pyx_t_9);
+      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+
+152:             raise
+
      __Pyx_GIVEREF(__pyx_t_1);
+      __Pyx_GIVEREF(__pyx_t_7);
+      __Pyx_XGIVEREF(__pyx_t_8);
+      __Pyx_ErrRestoreWithState(__pyx_t_1, __pyx_t_7, __pyx_t_8);
+      __pyx_t_1 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; 
+      __PYX_ERR(0, 152, __pyx_L6_except_error)
+    }
+    __pyx_L6_except_error:;
+
 153: 
+
+154:     next = __next__
+
  __Pyx_GetNameInClass(__pyx_t_1, (PyObject *)__pyx_ptype_6gevent_16__hub_primitives__WaitIterator, __pyx_n_s_next); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 154, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_16__hub_primitives__WaitIterator->tp_dict, __pyx_n_s_next_2, __pyx_t_1) < 0) __PYX_ERR(0, 154, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_16__hub_primitives__WaitIterator);
+
 155: 
+
+156:     def _cleanup(self):
+
static PyObject *__pyx_f_6gevent_16__hub_primitives_13_WaitIterator__cleanup(struct __pyx_obj_6gevent_16__hub_primitives__WaitIterator *__pyx_v_self) {
+  PyObject *__pyx_v_objs = NULL;
+  PyObject *__pyx_v_aobj = NULL;
+  PyObject *__pyx_v_unlink = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_cleanup", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_XDECREF(__pyx_t_11);
+  __Pyx_XDECREF(__pyx_t_12);
+  __Pyx_XDECREF(__pyx_t_13);
+  __Pyx_XDECREF(__pyx_t_14);
+  __Pyx_AddTraceback("gevent.__hub_primitives._WaitIterator._cleanup", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_objs);
+  __Pyx_XDECREF(__pyx_v_aobj);
+  __Pyx_XDECREF(__pyx_v_unlink);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+157:         if self._timer is not None:
+
  __pyx_t_1 = (__pyx_v_self->_timer != Py_None);
+  __pyx_t_2 = (__pyx_t_1 != 0);
+  if (__pyx_t_2) {
+/* … */
+  }
+
+158:             self._timer.close()
+
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_timer, __pyx_n_s_close); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 158, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    __pyx_t_5 = NULL;
+    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
+      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
+      if (likely(__pyx_t_5)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
+        __Pyx_INCREF(__pyx_t_5);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_4, function);
+      }
+    }
+    __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
+    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 158, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+
+159:             self._timer = None
+
    __Pyx_INCREF(Py_None);
+    __Pyx_GIVEREF(Py_None);
+    __Pyx_GOTREF(__pyx_v_self->_timer);
+    __Pyx_DECREF(__pyx_v_self->_timer);
+    __pyx_v_self->_timer = Py_None;
+
 160: 
+
+161:         objs = self._objects
+
  __pyx_t_3 = __pyx_v_self->_objects;
+  __Pyx_INCREF(__pyx_t_3);
+  __pyx_v_objs = __pyx_t_3;
+  __pyx_t_3 = 0;
+
+162:         self._objects = ()
+
  __Pyx_INCREF(__pyx_empty_tuple);
+  __Pyx_GIVEREF(__pyx_empty_tuple);
+  __Pyx_GOTREF(__pyx_v_self->_objects);
+  __Pyx_DECREF(__pyx_v_self->_objects);
+  __pyx_v_self->_objects = __pyx_empty_tuple;
+
+163:         for aobj in objs:
+
  if (likely(PyList_CheckExact(__pyx_v_objs)) || PyTuple_CheckExact(__pyx_v_objs)) {
+    __pyx_t_3 = __pyx_v_objs; __Pyx_INCREF(__pyx_t_3); __pyx_t_6 = 0;
+    __pyx_t_7 = NULL;
+  } else {
+    __pyx_t_6 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_objs); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 163, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __pyx_t_7 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 163, __pyx_L1_error)
+  }
+  for (;;) {
+    if (likely(!__pyx_t_7)) {
+      if (likely(PyList_CheckExact(__pyx_t_3))) {
+        if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_3)) break;
+        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_4); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 163, __pyx_L1_error)
+        #else
+        __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 163, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_4);
+        #endif
+      } else {
+        if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
+        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_4); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 163, __pyx_L1_error)
+        #else
+        __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 163, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_4);
+        #endif
+      }
+    } else {
+      __pyx_t_4 = __pyx_t_7(__pyx_t_3);
+      if (unlikely(!__pyx_t_4)) {
+        PyObject* exc_type = PyErr_Occurred();
+        if (exc_type) {
+          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+          else __PYX_ERR(0, 163, __pyx_L1_error)
+        }
+        break;
+      }
+      __Pyx_GOTREF(__pyx_t_4);
+    }
+    __Pyx_XDECREF_SET(__pyx_v_aobj, __pyx_t_4);
+    __pyx_t_4 = 0;
+/* … */
+  }
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+
+164:             unlink = getattr(aobj, 'unlink', None)
+
    __pyx_t_4 = __Pyx_GetAttr3(__pyx_v_aobj, __pyx_n_s_unlink, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 164, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_XDECREF_SET(__pyx_v_unlink, __pyx_t_4);
+    __pyx_t_4 = 0;
+
+165:             if unlink is not None:
+
    __pyx_t_2 = (__pyx_v_unlink != Py_None);
+    __pyx_t_1 = (__pyx_t_2 != 0);
+    if (__pyx_t_1) {
+/* … */
+    }
+
+166:                 try:
+
      {
+        /*try:*/ {
+/* … */
+        }
+        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
+        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
+        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
+        goto __pyx_L14_try_end;
+        __pyx_L7_error:;
+        __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
+        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+/* … */
+        __Pyx_XGIVEREF(__pyx_t_8);
+        __Pyx_XGIVEREF(__pyx_t_9);
+        __Pyx_XGIVEREF(__pyx_t_10);
+        __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
+        goto __pyx_L1_error;
+        __pyx_L8_exception_handled:;
+        __Pyx_XGIVEREF(__pyx_t_8);
+        __Pyx_XGIVEREF(__pyx_t_9);
+        __Pyx_XGIVEREF(__pyx_t_10);
+        __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
+        __pyx_L14_try_end:;
+      }
+
+167:                     unlink(self._switch)
+
          __Pyx_INCREF(__pyx_v_unlink);
+          __pyx_t_5 = __pyx_v_unlink; __pyx_t_11 = NULL;
+          if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
+            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_5);
+            if (likely(__pyx_t_11)) {
+              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
+              __Pyx_INCREF(__pyx_t_11);
+              __Pyx_INCREF(function);
+              __Pyx_DECREF_SET(__pyx_t_5, function);
+            }
+          }
+          __pyx_t_4 = (__pyx_t_11) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_11, __pyx_v_self->_switch) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_self->_switch);
+          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
+          if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 167, __pyx_L7_error)
+          __Pyx_GOTREF(__pyx_t_4);
+          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+
+168:                 except: # pylint:disable=bare-except
+
        /*except:*/ {
+          __Pyx_AddTraceback("gevent.__hub_primitives._WaitIterator._cleanup", __pyx_clineno, __pyx_lineno, __pyx_filename);
+          if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_5, &__pyx_t_11) < 0) __PYX_ERR(0, 168, __pyx_L9_except_error)
+          __Pyx_GOTREF(__pyx_t_4);
+          __Pyx_GOTREF(__pyx_t_5);
+          __Pyx_GOTREF(__pyx_t_11);
+
+169:                     traceback.print_exc()
+
          __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_6gevent_16__hub_primitives_traceback, __pyx_n_s_print_exc); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 169, __pyx_L9_except_error)
+          __Pyx_GOTREF(__pyx_t_13);
+          __pyx_t_14 = NULL;
+          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_13))) {
+            __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_13);
+            if (likely(__pyx_t_14)) {
+              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13);
+              __Pyx_INCREF(__pyx_t_14);
+              __Pyx_INCREF(function);
+              __Pyx_DECREF_SET(__pyx_t_13, function);
+            }
+          }
+          __pyx_t_12 = (__pyx_t_14) ? __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_t_14) : __Pyx_PyObject_CallNoArg(__pyx_t_13);
+          __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
+          if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 169, __pyx_L9_except_error)
+          __Pyx_GOTREF(__pyx_t_12);
+          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
+          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
+          goto __pyx_L8_exception_handled;
+        }
+        __pyx_L9_except_error:;
+
 170: 
+
+171:     def __enter__(self):
+
static PyObject *__pyx_pw_6gevent_16__hub_primitives_13_WaitIterator_7__enter__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyObject *__pyx_f_6gevent_16__hub_primitives_13_WaitIterator___enter__(struct __pyx_obj_6gevent_16__hub_primitives__WaitIterator *__pyx_v_self, int __pyx_skip_dispatch) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__enter__", 0);
+  /* Check if called by wrapper */
+  if (unlikely(__pyx_skip_dispatch)) ;
+  /* Check if overridden in Python */
+  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
+    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
+    if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
+    else {
+      PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      #endif
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_enter); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 171, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_16__hub_primitives_13_WaitIterator_7__enter__)) {
+        __Pyx_XDECREF(__pyx_r);
+        __Pyx_INCREF(__pyx_t_1);
+        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+          if (likely(__pyx_t_4)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+            __Pyx_INCREF(__pyx_t_4);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_3, function);
+          }
+        }
+        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
+        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 171, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __pyx_r = __pyx_t_2;
+        __pyx_t_2 = 0;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        goto __pyx_L0;
+      }
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+      tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
+      if (unlikely(type_dict_guard != tp_dict_version)) {
+        tp_dict_version = obj_dict_version = 0;
+      }
+      #endif
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    }
+    #endif
+  }
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_AddTraceback("gevent.__hub_primitives._WaitIterator.__enter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_16__hub_primitives_13_WaitIterator_7__enter__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6gevent_16__hub_primitives_13_WaitIterator_6__enter__[] = "_WaitIterator.__enter__(self)";
+static PyMethodDef __pyx_mdef_6gevent_16__hub_primitives_13_WaitIterator_7__enter__ = {"__enter__", (PyCFunction)__pyx_pw_6gevent_16__hub_primitives_13_WaitIterator_7__enter__, METH_NOARGS, __pyx_doc_6gevent_16__hub_primitives_13_WaitIterator_6__enter__};
+static PyObject *__pyx_pw_6gevent_16__hub_primitives_13_WaitIterator_7__enter__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__enter__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_16__hub_primitives_13_WaitIterator_6__enter__(((struct __pyx_obj_6gevent_16__hub_primitives__WaitIterator *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_16__hub_primitives_13_WaitIterator_6__enter__(struct __pyx_obj_6gevent_16__hub_primitives__WaitIterator *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__enter__", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __pyx_f_6gevent_16__hub_primitives_13_WaitIterator___enter__(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 171, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.__hub_primitives._WaitIterator.__enter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__15 = PyTuple_Pack(1, __pyx_n_s_self_2); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(0, 171, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__15);
+  __Pyx_GIVEREF(__pyx_tuple__15);
+/* … */
+  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_16__hub_primitives_13_WaitIterator_7__enter__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_WaitIterator___enter, NULL, __pyx_n_s_gevent___hub_primitives, __pyx_d, ((PyObject *)__pyx_codeobj__16)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 171, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_16__hub_primitives__WaitIterator->tp_dict, __pyx_n_s_enter, __pyx_t_1) < 0) __PYX_ERR(0, 171, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_16__hub_primitives__WaitIterator);
+  __pyx_codeobj__16 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__15, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__hub_primitives_py, __pyx_n_s_enter, 171, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__16)) __PYX_ERR(0, 171, __pyx_L1_error)
+
+172:         return self
+
  __Pyx_XDECREF(__pyx_r);
+  __Pyx_INCREF(((PyObject *)__pyx_v_self));
+  __pyx_r = ((PyObject *)__pyx_v_self);
+  goto __pyx_L0;
+
 173: 
+
+174:     def __exit__(self, typ, value, tb):
+
static PyObject *__pyx_pw_6gevent_16__hub_primitives_13_WaitIterator_9__exit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_f_6gevent_16__hub_primitives_13_WaitIterator___exit__(struct __pyx_obj_6gevent_16__hub_primitives__WaitIterator *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_typ, CYTHON_UNUSED PyObject *__pyx_v_value, CYTHON_UNUSED PyObject *__pyx_v_tb, int __pyx_skip_dispatch) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__exit__", 0);
+  /* Check if called by wrapper */
+  if (unlikely(__pyx_skip_dispatch)) ;
+  /* Check if overridden in Python */
+  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
+    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
+    if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
+    else {
+      PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      #endif
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_exit); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 174, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_16__hub_primitives_13_WaitIterator_9__exit__)) {
+        __Pyx_XDECREF(__pyx_r);
+        __Pyx_INCREF(__pyx_t_1);
+        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
+        __pyx_t_5 = 0;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+          if (likely(__pyx_t_4)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+            __Pyx_INCREF(__pyx_t_4);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_3, function);
+            __pyx_t_5 = 1;
+          }
+        }
+        #if CYTHON_FAST_PYCALL
+        if (PyFunction_Check(__pyx_t_3)) {
+          PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_typ, __pyx_v_value, __pyx_v_tb};
+          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 174, __pyx_L1_error)
+          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+          __Pyx_GOTREF(__pyx_t_2);
+        } else
+        #endif
+        #if CYTHON_FAST_PYCCALL
+        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
+          PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_typ, __pyx_v_value, __pyx_v_tb};
+          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 174, __pyx_L1_error)
+          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+          __Pyx_GOTREF(__pyx_t_2);
+        } else
+        #endif
+        {
+          __pyx_t_6 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 174, __pyx_L1_error)
+          __Pyx_GOTREF(__pyx_t_6);
+          if (__pyx_t_4) {
+            __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
+          }
+          __Pyx_INCREF(__pyx_v_typ);
+          __Pyx_GIVEREF(__pyx_v_typ);
+          PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_typ);
+          __Pyx_INCREF(__pyx_v_value);
+          __Pyx_GIVEREF(__pyx_v_value);
+          PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_value);
+          __Pyx_INCREF(__pyx_v_tb);
+          __Pyx_GIVEREF(__pyx_v_tb);
+          PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_v_tb);
+          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 174, __pyx_L1_error)
+          __Pyx_GOTREF(__pyx_t_2);
+          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+        }
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __pyx_r = __pyx_t_2;
+        __pyx_t_2 = 0;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        goto __pyx_L0;
+      }
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+      tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
+      if (unlikely(type_dict_guard != tp_dict_version)) {
+        tp_dict_version = obj_dict_version = 0;
+      }
+      #endif
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    }
+    #endif
+  }
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_6);
+  __Pyx_AddTraceback("gevent.__hub_primitives._WaitIterator.__exit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_16__hub_primitives_13_WaitIterator_9__exit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_6gevent_16__hub_primitives_13_WaitIterator_8__exit__[] = "_WaitIterator.__exit__(self, typ, value, tb)";
+static PyMethodDef __pyx_mdef_6gevent_16__hub_primitives_13_WaitIterator_9__exit__ = {"__exit__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_16__hub_primitives_13_WaitIterator_9__exit__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_16__hub_primitives_13_WaitIterator_8__exit__};
+static PyObject *__pyx_pw_6gevent_16__hub_primitives_13_WaitIterator_9__exit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_typ = 0;
+  PyObject *__pyx_v_value = 0;
+  PyObject *__pyx_v_tb = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__exit__ (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_typ,&__pyx_n_s_value,&__pyx_n_s_tb,0};
+    PyObject* values[3] = {0,0,0};
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_typ)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
+        else {
+          __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, 1); __PYX_ERR(0, 174, __pyx_L3_error)
+        }
+        CYTHON_FALLTHROUGH;
+        case  2:
+        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tb)) != 0)) kw_args--;
+        else {
+          __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, 2); __PYX_ERR(0, 174, __pyx_L3_error)
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__exit__") < 0)) __PYX_ERR(0, 174, __pyx_L3_error)
+      }
+    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
+      goto __pyx_L5_argtuple_error;
+    } else {
+      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+    }
+    __pyx_v_typ = values[0];
+    __pyx_v_value = values[1];
+    __pyx_v_tb = values[2];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 174, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.__hub_primitives._WaitIterator.__exit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_16__hub_primitives_13_WaitIterator_8__exit__(((struct __pyx_obj_6gevent_16__hub_primitives__WaitIterator *)__pyx_v_self), __pyx_v_typ, __pyx_v_value, __pyx_v_tb);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_16__hub_primitives_13_WaitIterator_8__exit__(struct __pyx_obj_6gevent_16__hub_primitives__WaitIterator *__pyx_v_self, PyObject *__pyx_v_typ, PyObject *__pyx_v_value, PyObject *__pyx_v_tb) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__exit__", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __pyx_f_6gevent_16__hub_primitives_13_WaitIterator___exit__(__pyx_v_self, __pyx_v_typ, __pyx_v_value, __pyx_v_tb, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 174, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.__hub_primitives._WaitIterator.__exit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__17 = PyTuple_Pack(4, __pyx_n_s_self_2, __pyx_n_s_typ, __pyx_n_s_value, __pyx_n_s_tb); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(0, 174, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__17);
+  __Pyx_GIVEREF(__pyx_tuple__17);
+/* … */
+  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_16__hub_primitives_13_WaitIterator_9__exit__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_WaitIterator___exit, NULL, __pyx_n_s_gevent___hub_primitives, __pyx_d, ((PyObject *)__pyx_codeobj__18)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 174, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_16__hub_primitives__WaitIterator->tp_dict, __pyx_n_s_exit, __pyx_t_1) < 0) __PYX_ERR(0, 174, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_16__hub_primitives__WaitIterator);
+  __pyx_codeobj__18 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__17, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__hub_primitives_py, __pyx_n_s_exit, 174, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__18)) __PYX_ERR(0, 174, __pyx_L1_error)
+
+175:         self._cleanup()
+
  __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_16__hub_primitives__WaitIterator *)__pyx_v_self->__pyx_vtab)->_cleanup(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 175, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 176: 
+
 177: 
+
+178: def iwait_on_objects(objects, timeout=None, count=None):
+
static PyObject *__pyx_pw_6gevent_16__hub_primitives_1iwait_on_objects(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_f_6gevent_16__hub_primitives_iwait_on_objects(PyObject *__pyx_v_objects, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_16__hub_primitives_iwait_on_objects *__pyx_optional_args) {
+  PyObject *__pyx_v_timeout = ((PyObject *)Py_None);
+  PyObject *__pyx_v_count = ((PyObject *)Py_None);
+  struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *__pyx_v_hub = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("iwait_on_objects", 0);
+  if (__pyx_optional_args) {
+    if (__pyx_optional_args->__pyx_n > 0) {
+      __pyx_v_timeout = __pyx_optional_args->timeout;
+      if (__pyx_optional_args->__pyx_n > 1) {
+        __pyx_v_count = __pyx_optional_args->count;
+      }
+    }
+  }
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_AddTraceback("gevent.__hub_primitives.iwait_on_objects", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XDECREF((PyObject *)__pyx_v_hub);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_16__hub_primitives_1iwait_on_objects(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_6gevent_16__hub_primitives_iwait_on_objects[] = "iwait_on_objects(objects, timeout=None, count=None)\n\n    Iteratively yield *objects* as they are ready, until all (or *count*) are ready\n    or *timeout* expired.\n\n    If you will only be consuming a portion of the *objects*, you should\n    do so inside a ``with`` block on this object to avoid leaking resources::\n\n        with gevent.iwait((a, b, c)) as it:\n            for i in it:\n                if i is a:\n                    break\n\n    :param objects: A sequence (supporting :func:`len`) containing objects\n        implementing the wait protocol (rawlink() and unlink()).\n    :keyword int count: If not `None`, then a number specifying the maximum number\n        of objects to wait for. If ``None`` (the default), all objects\n        are waited for.\n    :keyword float timeout: If given, specifies a maximum number of seconds\n        to wait. If the timeout expires before the desired waited-for objects\n        are available, then this method returns immediately.\n\n    .. seealso:: :func:`wait`\n\n    .. versionchanged:: 1.1a1\n       Add the *count* parameter.\n    .. versionchanged:: 1.1a2\n       No longer raise :exc:`LoopExit` if our caller switches greenlets\n       in between items yielded by this function.\n    .. versionchanged:: 1.4\n       Add support to use the returned object as a context manager.\n    ";
+static PyMethodDef __pyx_mdef_6gevent_16__hub_primitives_1iwait_on_objects = {"iwait_on_objects", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_16__hub_primitives_1iwait_on_objects, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_16__hub_primitives_iwait_on_objects};
+static PyObject *__pyx_pw_6gevent_16__hub_primitives_1iwait_on_objects(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_objects = 0;
+  PyObject *__pyx_v_timeout = 0;
+  PyObject *__pyx_v_count = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("iwait_on_objects (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_objects,&__pyx_n_s_timeout,&__pyx_n_s_count,0};
+    PyObject* values[3] = {0,0,0};
+    values[1] = ((PyObject *)Py_None);
+    values[2] = ((PyObject *)Py_None);
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_objects)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_timeout);
+          if (value) { values[1] = value; kw_args--; }
+        }
+        CYTHON_FALLTHROUGH;
+        case  2:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_count);
+          if (value) { values[2] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "iwait_on_objects") < 0)) __PYX_ERR(0, 178, __pyx_L3_error)
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    __pyx_v_objects = values[0];
+    __pyx_v_timeout = values[1];
+    __pyx_v_count = values[2];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("iwait_on_objects", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 178, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.__hub_primitives.iwait_on_objects", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_16__hub_primitives_iwait_on_objects(__pyx_self, __pyx_v_objects, __pyx_v_timeout, __pyx_v_count);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_16__hub_primitives_iwait_on_objects(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_objects, PyObject *__pyx_v_timeout, PyObject *__pyx_v_count) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("iwait_on_objects", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_2.__pyx_n = 2;
+  __pyx_t_2.timeout = __pyx_v_timeout;
+  __pyx_t_2.count = __pyx_v_count;
+  __pyx_t_1 = __pyx_f_6gevent_16__hub_primitives_iwait_on_objects(__pyx_v_objects, 0, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 178, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.__hub_primitives.iwait_on_objects", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__19 = PyTuple_Pack(3, __pyx_n_s_objects, __pyx_n_s_timeout, __pyx_n_s_count); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(0, 178, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__19);
+  __Pyx_GIVEREF(__pyx_tuple__19);
+/* … */
+  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_16__hub_primitives_1iwait_on_objects, 0, __pyx_n_s_iwait_on_objects, NULL, __pyx_n_s_gevent___hub_primitives, __pyx_d, ((PyObject *)__pyx_codeobj__20)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 178, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_iwait_on_objects, __pyx_t_1) < 0) __PYX_ERR(0, 178, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_codeobj__20 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__19, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__hub_primitives_py, __pyx_n_s_iwait_on_objects, 178, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__20)) __PYX_ERR(0, 178, __pyx_L1_error)
+
 179:     """
+
 180:     Iteratively yield *objects* as they are ready, until all (or *count*) are ready
+
 181:     or *timeout* expired.
+
 182: 
+
 183:     If you will only be consuming a portion of the *objects*, you should
+
 184:     do so inside a ``with`` block on this object to avoid leaking resources::
+
 185: 
+
 186:         with gevent.iwait((a, b, c)) as it:
+
 187:             for i in it:
+
 188:                 if i is a:
+
 189:                     break
+
 190: 
+
 191:     :param objects: A sequence (supporting :func:`len`) containing objects
+
 192:         implementing the wait protocol (rawlink() and unlink()).
+
 193:     :keyword int count: If not `None`, then a number specifying the maximum number
+
 194:         of objects to wait for. If ``None`` (the default), all objects
+
 195:         are waited for.
+
 196:     :keyword float timeout: If given, specifies a maximum number of seconds
+
 197:         to wait. If the timeout expires before the desired waited-for objects
+
 198:         are available, then this method returns immediately.
+
 199: 
+
 200:     .. seealso:: :func:`wait`
+
 201: 
+
 202:     .. versionchanged:: 1.1a1
+
 203:        Add the *count* parameter.
+
 204:     .. versionchanged:: 1.1a2
+
 205:        No longer raise :exc:`LoopExit` if our caller switches greenlets
+
 206:        in between items yielded by this function.
+
 207:     .. versionchanged:: 1.4
+
 208:        Add support to use the returned object as a context manager.
+
 209:     """
+
 210:     # QQQ would be nice to support iterable here that can be generated slowly (why?)
+
+211:     hub = get_hub()
+
  __pyx_t_1 = ((PyObject *)__pyx_f_6gevent_11__hub_local_get_hub_noargs(0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 211, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_v_hub = ((struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *)__pyx_t_1);
+  __pyx_t_1 = 0;
+
+212:     if objects is None:
+
  __pyx_t_2 = (__pyx_v_objects == Py_None);
+  __pyx_t_3 = (__pyx_t_2 != 0);
+  if (__pyx_t_3) {
+/* … */
+  }
+
+213:         return [hub.join(timeout=timeout)]
+
    __Pyx_XDECREF(__pyx_r);
+    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_hub), __pyx_n_s_join); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 213, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 213, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_timeout, __pyx_v_timeout) < 0) __PYX_ERR(0, 213, __pyx_L1_error)
+    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 213, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_5);
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 213, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_GIVEREF(__pyx_t_5);
+    PyList_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
+    __pyx_t_5 = 0;
+    __pyx_r = __pyx_t_4;
+    __pyx_t_4 = 0;
+    goto __pyx_L0;
+
+214:     return _WaitIterator(objects, hub, timeout, count)
+
  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_4 = PyTuple_New(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 214, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_4);
+  __Pyx_INCREF(__pyx_v_objects);
+  __Pyx_GIVEREF(__pyx_v_objects);
+  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_objects);
+  __Pyx_INCREF(((PyObject *)__pyx_v_hub));
+  __Pyx_GIVEREF(((PyObject *)__pyx_v_hub));
+  PyTuple_SET_ITEM(__pyx_t_4, 1, ((PyObject *)__pyx_v_hub));
+  __Pyx_INCREF(__pyx_v_timeout);
+  __Pyx_GIVEREF(__pyx_v_timeout);
+  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_timeout);
+  __Pyx_INCREF(__pyx_v_count);
+  __Pyx_GIVEREF(__pyx_v_count);
+  PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_v_count);
+  __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6gevent_16__hub_primitives__WaitIterator), __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 214, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_5);
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __pyx_r = __pyx_t_5;
+  __pyx_t_5 = 0;
+  goto __pyx_L0;
+
 215: 
+
 216: 
+
+217: def wait_on_objects(objects=None, timeout=None, count=None):
+
static PyObject *__pyx_pw_6gevent_16__hub_primitives_3wait_on_objects(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_f_6gevent_16__hub_primitives_wait_on_objects(CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_16__hub_primitives_wait_on_objects *__pyx_optional_args) {
+  PyObject *__pyx_v_objects = ((PyObject *)Py_None);
+  PyObject *__pyx_v_timeout = ((PyObject *)Py_None);
+  PyObject *__pyx_v_count = ((PyObject *)Py_None);
+  struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *__pyx_v_hub = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("wait_on_objects", 0);
+  if (__pyx_optional_args) {
+    if (__pyx_optional_args->__pyx_n > 0) {
+      __pyx_v_objects = __pyx_optional_args->objects;
+      if (__pyx_optional_args->__pyx_n > 1) {
+        __pyx_v_timeout = __pyx_optional_args->timeout;
+        if (__pyx_optional_args->__pyx_n > 2) {
+          __pyx_v_count = __pyx_optional_args->count;
+        }
+      }
+    }
+  }
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_AddTraceback("gevent.__hub_primitives.wait_on_objects", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XDECREF((PyObject *)__pyx_v_hub);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_16__hub_primitives_3wait_on_objects(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_6gevent_16__hub_primitives_2wait_on_objects[] = "wait_on_objects(objects=None, timeout=None, count=None)\n\n    Wait for ``objects`` to become ready or for event loop to finish.\n\n    If ``objects`` is provided, it must be a list containing objects\n    implementing the wait protocol (rawlink() and unlink() methods):\n\n    - :class:`gevent.Greenlet` instance\n    - :class:`gevent.event.Event` instance\n    - :class:`gevent.lock.Semaphore` instance\n    - :class:`gevent.subprocess.Popen` instance\n\n    If ``objects`` is ``None`` (the default), ``wait()`` blocks until\n    the current event loop has nothing to do (or until ``timeout`` passes):\n\n    - all greenlets have finished\n    - all servers were stopped\n    - all event loop watchers were stopped.\n\n    If ``count`` is ``None`` (the default), wait for all ``objects``\n    to become ready.\n\n    If ``count`` is a number, wait for (up to) ``count`` objects to become\n    ready. (For example, if count is ``1`` then the function exits\n    when any object in the list is ready).\n\n    If ``timeout`` is provided, it specifies the maximum number of\n    seconds ``wait()`` will block.\n\n    Returns the list of ready objects, in the order in which they were\n    ready.\n\n    .. seealso:: :func:`iwait`\n    ";
+static PyMethodDef __pyx_mdef_6gevent_16__hub_primitives_3wait_on_objects = {"wait_on_objects", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_16__hub_primitives_3wait_on_objects, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_16__hub_primitives_2wait_on_objects};
+static PyObject *__pyx_pw_6gevent_16__hub_primitives_3wait_on_objects(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_objects = 0;
+  PyObject *__pyx_v_timeout = 0;
+  PyObject *__pyx_v_count = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("wait_on_objects (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_objects,&__pyx_n_s_timeout,&__pyx_n_s_count,0};
+    PyObject* values[3] = {0,0,0};
+    values[0] = ((PyObject *)Py_None);
+    values[1] = ((PyObject *)Py_None);
+    values[2] = ((PyObject *)Py_None);
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_objects);
+          if (value) { values[0] = value; kw_args--; }
+        }
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_timeout);
+          if (value) { values[1] = value; kw_args--; }
+        }
+        CYTHON_FALLTHROUGH;
+        case  2:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_count);
+          if (value) { values[2] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "wait_on_objects") < 0)) __PYX_ERR(0, 217, __pyx_L3_error)
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    __pyx_v_objects = values[0];
+    __pyx_v_timeout = values[1];
+    __pyx_v_count = values[2];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("wait_on_objects", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 217, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.__hub_primitives.wait_on_objects", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_16__hub_primitives_2wait_on_objects(__pyx_self, __pyx_v_objects, __pyx_v_timeout, __pyx_v_count);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_16__hub_primitives_2wait_on_objects(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_objects, PyObject *__pyx_v_timeout, PyObject *__pyx_v_count) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("wait_on_objects", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_2.__pyx_n = 3;
+  __pyx_t_2.objects = __pyx_v_objects;
+  __pyx_t_2.timeout = __pyx_v_timeout;
+  __pyx_t_2.count = __pyx_v_count;
+  __pyx_t_1 = __pyx_f_6gevent_16__hub_primitives_wait_on_objects(0, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 217, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.__hub_primitives.wait_on_objects", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__21 = PyTuple_Pack(3, __pyx_n_s_objects, __pyx_n_s_timeout, __pyx_n_s_count); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(0, 217, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__21);
+  __Pyx_GIVEREF(__pyx_tuple__21);
+/* … */
+  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_16__hub_primitives_3wait_on_objects, 0, __pyx_n_s_wait_on_objects, NULL, __pyx_n_s_gevent___hub_primitives, __pyx_d, ((PyObject *)__pyx_codeobj__22)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 217, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_wait_on_objects, __pyx_t_1) < 0) __PYX_ERR(0, 217, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_codeobj__22 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__21, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__hub_primitives_py, __pyx_n_s_wait_on_objects, 217, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__22)) __PYX_ERR(0, 217, __pyx_L1_error)
+
 218:     """
+
 219:     Wait for ``objects`` to become ready or for event loop to finish.
+
 220: 
+
 221:     If ``objects`` is provided, it must be a list containing objects
+
 222:     implementing the wait protocol (rawlink() and unlink() methods):
+
 223: 
+
 224:     - :class:`gevent.Greenlet` instance
+
 225:     - :class:`gevent.event.Event` instance
+
 226:     - :class:`gevent.lock.Semaphore` instance
+
 227:     - :class:`gevent.subprocess.Popen` instance
+
 228: 
+
 229:     If ``objects`` is ``None`` (the default), ``wait()`` blocks until
+
 230:     the current event loop has nothing to do (or until ``timeout`` passes):
+
 231: 
+
 232:     - all greenlets have finished
+
 233:     - all servers were stopped
+
 234:     - all event loop watchers were stopped.
+
 235: 
+
 236:     If ``count`` is ``None`` (the default), wait for all ``objects``
+
 237:     to become ready.
+
 238: 
+
 239:     If ``count`` is a number, wait for (up to) ``count`` objects to become
+
 240:     ready. (For example, if count is ``1`` then the function exits
+
 241:     when any object in the list is ready).
+
 242: 
+
 243:     If ``timeout`` is provided, it specifies the maximum number of
+
 244:     seconds ``wait()`` will block.
+
 245: 
+
 246:     Returns the list of ready objects, in the order in which they were
+
 247:     ready.
+
 248: 
+
 249:     .. seealso:: :func:`iwait`
+
 250:     """
+
+251:     if objects is None:
+
  __pyx_t_1 = (__pyx_v_objects == Py_None);
+  __pyx_t_2 = (__pyx_t_1 != 0);
+  if (__pyx_t_2) {
+/* … */
+  }
+
+252:         hub = get_hub()
+
    __pyx_t_3 = ((PyObject *)__pyx_f_6gevent_11__hub_local_get_hub_noargs(0)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 252, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __pyx_v_hub = ((struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *)__pyx_t_3);
+    __pyx_t_3 = 0;
+
+253:         return hub.join(timeout=timeout) # pylint:disable=
+
    __Pyx_XDECREF(__pyx_r);
+    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_hub), __pyx_n_s_join); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 253, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 253, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_timeout, __pyx_v_timeout) < 0) __PYX_ERR(0, 253, __pyx_L1_error)
+    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 253, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_5);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __pyx_r = __pyx_t_5;
+    __pyx_t_5 = 0;
+    goto __pyx_L0;
+
+254:     return list(iwait_on_objects(objects, timeout, count))
+
  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_6.__pyx_n = 2;
+  __pyx_t_6.timeout = __pyx_v_timeout;
+  __pyx_t_6.count = __pyx_v_count;
+  __pyx_t_5 = __pyx_f_6gevent_16__hub_primitives_iwait_on_objects(__pyx_v_objects, 0, &__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 254, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_5);
+  __pyx_t_4 = PySequence_List(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 254, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_4);
+  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+  __pyx_r = __pyx_t_4;
+  __pyx_t_4 = 0;
+  goto __pyx_L0;
+
 255: 
+
+256: _timeout_error = Exception
+
  __Pyx_INCREF(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
+  __Pyx_XGOTREF(__pyx_v_6gevent_16__hub_primitives__timeout_error);
+  __Pyx_DECREF_SET(__pyx_v_6gevent_16__hub_primitives__timeout_error, ((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
+  __Pyx_GIVEREF(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
+
 257: 
+
+258: def set_default_timeout_error(e):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_16__hub_primitives_5set_default_timeout_error(PyObject *__pyx_self, PyObject *__pyx_v_e); /*proto*/
+static char __pyx_doc_6gevent_16__hub_primitives_4set_default_timeout_error[] = "set_default_timeout_error(e)";
+static PyMethodDef __pyx_mdef_6gevent_16__hub_primitives_5set_default_timeout_error = {"set_default_timeout_error", (PyCFunction)__pyx_pw_6gevent_16__hub_primitives_5set_default_timeout_error, METH_O, __pyx_doc_6gevent_16__hub_primitives_4set_default_timeout_error};
+static PyObject *__pyx_pw_6gevent_16__hub_primitives_5set_default_timeout_error(PyObject *__pyx_self, PyObject *__pyx_v_e) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("set_default_timeout_error (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_16__hub_primitives_4set_default_timeout_error(__pyx_self, ((PyObject *)__pyx_v_e));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_16__hub_primitives_4set_default_timeout_error(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_e) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("set_default_timeout_error", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__23 = PyTuple_Pack(1, __pyx_n_s_e); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(0, 258, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__23);
+  __Pyx_GIVEREF(__pyx_tuple__23);
+/* … */
+  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_16__hub_primitives_5set_default_timeout_error, 0, __pyx_n_s_set_default_timeout_error, NULL, __pyx_n_s_gevent___hub_primitives, __pyx_d, ((PyObject *)__pyx_codeobj__24)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 258, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_default_timeout_error, __pyx_t_1) < 0) __PYX_ERR(0, 258, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_codeobj__24 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__23, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__hub_primitives_py, __pyx_n_s_set_default_timeout_error, 258, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__24)) __PYX_ERR(0, 258, __pyx_L1_error)
+
 259:     global _timeout_error
+
+260:     _timeout_error = e
+
  __Pyx_INCREF(__pyx_v_e);
+  __Pyx_XGOTREF(__pyx_v_6gevent_16__hub_primitives__timeout_error);
+  __Pyx_DECREF_SET(__pyx_v_6gevent_16__hub_primitives__timeout_error, __pyx_v_e);
+  __Pyx_GIVEREF(__pyx_v_e);
+
 261: 
+
+262: def _primitive_wait(watcher, timeout, timeout_exc, hub):
+
static PyObject *__pyx_f_6gevent_16__hub_primitives__primitive_wait(PyObject *__pyx_v_watcher, PyObject *__pyx_v_timeout, PyObject *__pyx_v_timeout_exc, struct __pyx_obj_6gevent_16__hub_primitives_WaitOperationsGreenlet *__pyx_v_hub) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_primitive_wait", 0);
+  __Pyx_INCREF(__pyx_v_timeout);
+  __Pyx_INCREF((PyObject *)__pyx_v_hub);
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_XDECREF(__pyx_t_6);
+  __Pyx_XDECREF(__pyx_t_8);
+  __Pyx_XDECREF(__pyx_t_9);
+  __Pyx_AddTraceback("gevent.__hub_primitives._primitive_wait", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_timeout);
+  __Pyx_XDECREF((PyObject *)__pyx_v_hub);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+263:     if watcher.callback is not None:
+
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_watcher, __pyx_n_s_callback); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 263, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = (__pyx_t_1 != Py_None);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_3 = (__pyx_t_2 != 0);
+  if (unlikely(__pyx_t_3)) {
+/* … */
+  }
+
+264:         raise ConcurrentObjectUseError('This socket is already used by another greenlet: %r'
+
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ConcurrentObjectUseError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 264, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+
+265:                                        % (watcher.callback, ))
+
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_watcher, __pyx_n_s_callback); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 265, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_5);
+    __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 265, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_6);
+    __Pyx_GIVEREF(__pyx_t_5);
+    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5);
+    __pyx_t_5 = 0;
+    __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_This_socket_is_already_used_by_a, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 265, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_5);
+    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+    __pyx_t_6 = NULL;
+    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
+      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
+      if (likely(__pyx_t_6)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
+        __Pyx_INCREF(__pyx_t_6);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_4, function);
+      }
+    }
+    __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_6, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5);
+    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 264, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __PYX_ERR(0, 264, __pyx_L1_error)
+
 266: 
+
+267:     if hub is None:
+
  __pyx_t_3 = (((PyObject *)__pyx_v_hub) == Py_None);
+  __pyx_t_2 = (__pyx_t_3 != 0);
+  if (__pyx_t_2) {
+/* … */
+  }
+
+268:         hub = get_hub()
+
    __pyx_t_1 = ((PyObject *)__pyx_f_6gevent_11__hub_local_get_hub_noargs(0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 268, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_6gevent_16__hub_primitives_WaitOperationsGreenlet))))) __PYX_ERR(0, 268, __pyx_L1_error)
+    __Pyx_DECREF_SET(__pyx_v_hub, ((struct __pyx_obj_6gevent_16__hub_primitives_WaitOperationsGreenlet *)__pyx_t_1));
+    __pyx_t_1 = 0;
+
 269: 
+
+270:     if timeout is None:
+
  __pyx_t_2 = (__pyx_v_timeout == Py_None);
+  __pyx_t_3 = (__pyx_t_2 != 0);
+  if (__pyx_t_3) {
+/* … */
+  }
+
+271:         hub.wait(watcher)
+
    __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_16__hub_primitives_WaitOperationsGreenlet *)__pyx_v_hub->__pyx_base.__pyx_vtab)->wait(__pyx_v_hub, __pyx_v_watcher, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 271, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+272:         return
+
    __Pyx_XDECREF(__pyx_r);
+    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+    goto __pyx_L0;
+
 273: 
+
+274:     timeout = Timeout._start_new_or_dummy(
+
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_6gevent_16__hub_primitives_Timeout, __pyx_n_s_start_new_or_dummy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 274, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_4);
+
 275:         timeout,
+
+276:         (timeout_exc
+
    __Pyx_INCREF(__pyx_v_timeout_exc);
+    __pyx_t_5 = __pyx_v_timeout_exc;
+  } else {
+
+277:          if timeout_exc is not _NONE or timeout is None
+
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_NONE); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 277, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  __pyx_t_2 = (__pyx_v_timeout_exc != __pyx_t_6);
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  __pyx_t_7 = (__pyx_t_2 != 0);
+  if (!__pyx_t_7) {
+  } else {
+    __pyx_t_3 = __pyx_t_7;
+    goto __pyx_L6_bool_binop_done;
+  }
+  __pyx_t_7 = (__pyx_v_timeout == Py_None);
+  __pyx_t_2 = (__pyx_t_7 != 0);
+  __pyx_t_3 = __pyx_t_2;
+  __pyx_L6_bool_binop_done:;
+  if (__pyx_t_3) {
+
+278:          else _timeout_error('timed out')))
+
    __Pyx_INCREF(__pyx_v_6gevent_16__hub_primitives__timeout_error);
+    __pyx_t_8 = __pyx_v_6gevent_16__hub_primitives__timeout_error; __pyx_t_9 = NULL;
+    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
+      __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8);
+      if (likely(__pyx_t_9)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
+        __Pyx_INCREF(__pyx_t_9);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_8, function);
+      }
+    }
+    __pyx_t_6 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_9, __pyx_kp_s_timed_out) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_kp_s_timed_out);
+    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
+    if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 278, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_6);
+    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+    __pyx_t_5 = __pyx_t_6;
+    __pyx_t_6 = 0;
+  }
+  __pyx_t_6 = NULL;
+  __pyx_t_10 = 0;
+  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
+    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
+    if (likely(__pyx_t_6)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
+      __Pyx_INCREF(__pyx_t_6);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_4, function);
+      __pyx_t_10 = 1;
+    }
+  }
+  #if CYTHON_FAST_PYCALL
+  if (PyFunction_Check(__pyx_t_4)) {
+    PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_timeout, __pyx_t_5};
+    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 274, __pyx_L1_error)
+    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+  } else
+  #endif
+  #if CYTHON_FAST_PYCCALL
+  if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
+    PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_timeout, __pyx_t_5};
+    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 274, __pyx_L1_error)
+    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+  } else
+  #endif
+  {
+    __pyx_t_8 = PyTuple_New(2+__pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 274, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_8);
+    if (__pyx_t_6) {
+      __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL;
+    }
+    __Pyx_INCREF(__pyx_v_timeout);
+    __Pyx_GIVEREF(__pyx_v_timeout);
+    PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_10, __pyx_v_timeout);
+    __Pyx_GIVEREF(__pyx_t_5);
+    PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_10, __pyx_t_5);
+    __pyx_t_5 = 0;
+    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 274, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+  }
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __Pyx_DECREF_SET(__pyx_v_timeout, __pyx_t_1);
+  __pyx_t_1 = 0;
+
 279: 
+
+280:     with timeout:
+
  /*with:*/ {
+    __pyx_t_11 = __Pyx_PyObject_LookupSpecial(__pyx_v_timeout, __pyx_n_s_exit); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 280, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_11);
+    __pyx_t_4 = __Pyx_PyObject_LookupSpecial(__pyx_v_timeout, __pyx_n_s_enter); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 280, __pyx_L8_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    __pyx_t_8 = NULL;
+    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
+      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_4);
+      if (likely(__pyx_t_8)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
+        __Pyx_INCREF(__pyx_t_8);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_4, function);
+      }
+    }
+    __pyx_t_1 = (__pyx_t_8) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_8) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
+    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
+    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 280, __pyx_L8_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    /*try:*/ {
+      {
+        /*try:*/ {
+/* … */
+        }
+        __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
+        __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
+        __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
+        goto __pyx_L17_try_end;
+        __pyx_L12_error:;
+        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
+        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
+        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+        /*except:*/ {
+          __Pyx_AddTraceback("gevent.__hub_primitives._primitive_wait", __pyx_clineno, __pyx_lineno, __pyx_filename);
+          if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_4, &__pyx_t_8) < 0) __PYX_ERR(0, 280, __pyx_L14_except_error)
+          __Pyx_GOTREF(__pyx_t_1);
+          __Pyx_GOTREF(__pyx_t_4);
+          __Pyx_GOTREF(__pyx_t_8);
+          __pyx_t_5 = PyTuple_Pack(3, __pyx_t_1, __pyx_t_4, __pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 280, __pyx_L14_except_error)
+          __Pyx_GOTREF(__pyx_t_5);
+          __pyx_t_15 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_5, NULL);
+          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+          if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 280, __pyx_L14_except_error)
+          __Pyx_GOTREF(__pyx_t_15);
+          __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_15);
+          __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
+          if (__pyx_t_3 < 0) __PYX_ERR(0, 280, __pyx_L14_except_error)
+          __pyx_t_2 = ((!(__pyx_t_3 != 0)) != 0);
+          if (__pyx_t_2) {
+            __Pyx_GIVEREF(__pyx_t_1);
+            __Pyx_GIVEREF(__pyx_t_4);
+            __Pyx_XGIVEREF(__pyx_t_8);
+            __Pyx_ErrRestoreWithState(__pyx_t_1, __pyx_t_4, __pyx_t_8);
+            __pyx_t_1 = 0; __pyx_t_4 = 0; __pyx_t_8 = 0; 
+            __PYX_ERR(0, 280, __pyx_L14_except_error)
+          }
+          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
+          goto __pyx_L13_exception_handled;
+        }
+        __pyx_L14_except_error:;
+        __Pyx_XGIVEREF(__pyx_t_12);
+        __Pyx_XGIVEREF(__pyx_t_13);
+        __Pyx_XGIVEREF(__pyx_t_14);
+        __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14);
+        goto __pyx_L1_error;
+        __pyx_L13_exception_handled:;
+        __Pyx_XGIVEREF(__pyx_t_12);
+        __Pyx_XGIVEREF(__pyx_t_13);
+        __Pyx_XGIVEREF(__pyx_t_14);
+        __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14);
+        __pyx_L17_try_end:;
+      }
+    }
+    /*finally:*/ {
+      /*normal exit:*/{
+        if (__pyx_t_11) {
+          __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_tuple_, NULL);
+          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+          if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 280, __pyx_L1_error)
+          __Pyx_GOTREF(__pyx_t_14);
+          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
+        }
+        goto __pyx_L11;
+      }
+      __pyx_L11:;
+    }
+    goto __pyx_L21;
+    __pyx_L8_error:;
+    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+    goto __pyx_L1_error;
+    __pyx_L21:;
+  }
+/* … */
+  __pyx_tuple_ = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 280, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple_);
+  __Pyx_GIVEREF(__pyx_tuple_);
+
+281:         hub.wait(watcher)
+
          __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_16__hub_primitives_WaitOperationsGreenlet *)__pyx_v_hub->__pyx_base.__pyx_vtab)->wait(__pyx_v_hub, __pyx_v_watcher, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 281, __pyx_L12_error)
+          __Pyx_GOTREF(__pyx_t_1);
+          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 282: 
+
 283: # Suitable to be bound as an instance method
+
+284: def wait_on_socket(socket, watcher, timeout_exc=None):
+
static PyObject *__pyx_pw_6gevent_16__hub_primitives_7wait_on_socket(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_f_6gevent_16__hub_primitives_wait_on_socket(PyObject *__pyx_v_socket, PyObject *__pyx_v_watcher, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_16__hub_primitives_wait_on_socket *__pyx_optional_args) {
+  PyObject *__pyx_v_timeout_exc = ((PyObject *)Py_None);
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("wait_on_socket", 0);
+  if (__pyx_optional_args) {
+    if (__pyx_optional_args->__pyx_n > 0) {
+      __pyx_v_timeout_exc = __pyx_optional_args->timeout_exc;
+    }
+  }
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_XDECREF(__pyx_t_6);
+  __Pyx_XDECREF(__pyx_t_7);
+  __Pyx_AddTraceback("gevent.__hub_primitives.wait_on_socket", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_16__hub_primitives_7wait_on_socket(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_6gevent_16__hub_primitives_6wait_on_socket[] = "wait_on_socket(socket, watcher, timeout_exc=None)";
+static PyMethodDef __pyx_mdef_6gevent_16__hub_primitives_7wait_on_socket = {"wait_on_socket", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_16__hub_primitives_7wait_on_socket, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_16__hub_primitives_6wait_on_socket};
+static PyObject *__pyx_pw_6gevent_16__hub_primitives_7wait_on_socket(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_socket = 0;
+  PyObject *__pyx_v_watcher = 0;
+  PyObject *__pyx_v_timeout_exc = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("wait_on_socket (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_socket,&__pyx_n_s_watcher,&__pyx_n_s_timeout_exc,0};
+    PyObject* values[3] = {0,0,0};
+    values[2] = ((PyObject *)Py_None);
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_socket)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_watcher)) != 0)) kw_args--;
+        else {
+          __Pyx_RaiseArgtupleInvalid("wait_on_socket", 0, 2, 3, 1); __PYX_ERR(0, 284, __pyx_L3_error)
+        }
+        CYTHON_FALLTHROUGH;
+        case  2:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_timeout_exc);
+          if (value) { values[2] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "wait_on_socket") < 0)) __PYX_ERR(0, 284, __pyx_L3_error)
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    __pyx_v_socket = values[0];
+    __pyx_v_watcher = values[1];
+    __pyx_v_timeout_exc = values[2];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("wait_on_socket", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 284, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.__hub_primitives.wait_on_socket", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_16__hub_primitives_6wait_on_socket(__pyx_self, __pyx_v_socket, __pyx_v_watcher, __pyx_v_timeout_exc);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_16__hub_primitives_6wait_on_socket(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_socket, PyObject *__pyx_v_watcher, PyObject *__pyx_v_timeout_exc) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("wait_on_socket", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_2.__pyx_n = 1;
+  __pyx_t_2.timeout_exc = __pyx_v_timeout_exc;
+  __pyx_t_1 = __pyx_f_6gevent_16__hub_primitives_wait_on_socket(__pyx_v_socket, __pyx_v_watcher, 0, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 284, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.__hub_primitives.wait_on_socket", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__25 = PyTuple_Pack(3, __pyx_n_s_socket, __pyx_n_s_watcher, __pyx_n_s_timeout_exc); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(0, 284, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__25);
+  __Pyx_GIVEREF(__pyx_tuple__25);
+/* … */
+  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_16__hub_primitives_7wait_on_socket, 0, __pyx_n_s_wait_on_socket, NULL, __pyx_n_s_gevent___hub_primitives, __pyx_d, ((PyObject *)__pyx_codeobj__26)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 284, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_wait_on_socket, __pyx_t_1) < 0) __PYX_ERR(0, 284, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_codeobj__26 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__25, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__hub_primitives_py, __pyx_n_s_wait_on_socket, 284, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__26)) __PYX_ERR(0, 284, __pyx_L1_error)
+
+285:     if socket is None or watcher is None:
+
  __pyx_t_2 = (__pyx_v_socket == Py_None);
+  __pyx_t_3 = (__pyx_t_2 != 0);
+  if (!__pyx_t_3) {
+  } else {
+    __pyx_t_1 = __pyx_t_3;
+    goto __pyx_L4_bool_binop_done;
+  }
+  __pyx_t_3 = (__pyx_v_watcher == Py_None);
+  __pyx_t_2 = (__pyx_t_3 != 0);
+  __pyx_t_1 = __pyx_t_2;
+  __pyx_L4_bool_binop_done:;
+  if (unlikely(__pyx_t_1)) {
+/* … */
+  }
+
 286:         # test__hub TestCloseSocketWhilePolling, on Python 2; Python 3
+
 287:         # catches the EBADF differently.
+
+288:         raise ConcurrentObjectUseError("The socket has already been closed by another greenlet")
+
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_ConcurrentObjectUseError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 288, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_5);
+    __pyx_t_6 = NULL;
+    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
+      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
+      if (likely(__pyx_t_6)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
+        __Pyx_INCREF(__pyx_t_6);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_5, function);
+      }
+    }
+    __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_kp_s_The_socket_has_already_been_clos) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_kp_s_The_socket_has_already_been_clos);
+    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 288, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __PYX_ERR(0, 288, __pyx_L1_error)
+
+289:     _primitive_wait(watcher, socket.timeout,
+
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_socket, __pyx_n_s_timeout); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 289, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_4);
+/* … */
+  __pyx_t_7 = __pyx_f_6gevent_16__hub_primitives__primitive_wait(__pyx_v_watcher, __pyx_t_4, __pyx_t_5, ((struct __pyx_obj_6gevent_16__hub_primitives_WaitOperationsGreenlet *)__pyx_t_6)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 289, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_7);
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+
+290:                     timeout_exc if timeout_exc is not None else _NONE,
+
  __pyx_t_1 = (__pyx_v_timeout_exc != Py_None);
+  if ((__pyx_t_1 != 0)) {
+    __Pyx_INCREF(__pyx_v_timeout_exc);
+    __pyx_t_5 = __pyx_v_timeout_exc;
+  } else {
+    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_NONE); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 290, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_6);
+    __pyx_t_5 = __pyx_t_6;
+    __pyx_t_6 = 0;
+  }
+
+291:                     socket.hub)
+
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_socket, __pyx_n_s_hub); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 291, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_6gevent_16__hub_primitives_WaitOperationsGreenlet))))) __PYX_ERR(0, 291, __pyx_L1_error)
+
 292: 
+
+293: def wait_on_watcher(watcher, timeout=None, timeout_exc=_NONE, hub=None):
+
static PyObject *__pyx_pw_6gevent_16__hub_primitives_9wait_on_watcher(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_f_6gevent_16__hub_primitives_wait_on_watcher(PyObject *__pyx_v_watcher, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_16__hub_primitives_wait_on_watcher *__pyx_optional_args) {
+  PyObject *__pyx_v_timeout = ((PyObject *)Py_None);
+  PyObject *__pyx_v_timeout_exc = __pyx_k__2;
+  struct __pyx_obj_6gevent_16__hub_primitives_WaitOperationsGreenlet *__pyx_v_hub = ((struct __pyx_obj_6gevent_16__hub_primitives_WaitOperationsGreenlet *)Py_None);
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("wait_on_watcher", 0);
+  if (__pyx_optional_args) {
+    if (__pyx_optional_args->__pyx_n > 0) {
+      __pyx_v_timeout = __pyx_optional_args->timeout;
+      if (__pyx_optional_args->__pyx_n > 1) {
+        __pyx_v_timeout_exc = __pyx_optional_args->timeout_exc;
+        if (__pyx_optional_args->__pyx_n > 2) {
+          __pyx_v_hub = __pyx_optional_args->hub;
+        }
+      }
+    }
+  }
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.__hub_primitives.wait_on_watcher", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_16__hub_primitives_9wait_on_watcher(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_6gevent_16__hub_primitives_8wait_on_watcher[] = "wait_on_watcher(watcher, timeout=None, timeout_exc=_NONE, WaitOperationsGreenlet hub=None)\n\n    wait(watcher, timeout=None, [timeout_exc=None]) -> None\n\n    Block the current greenlet until *watcher* is ready.\n\n    If *timeout* is non-negative, then *timeout_exc* is raised after\n    *timeout* second has passed.\n\n    If :func:`cancel_wait` is called on *io* by another greenlet,\n    raise an exception in this blocking greenlet\n    (``socket.error(EBADF, 'File descriptor was closed in another\n    greenlet')`` by default).\n\n    :param io: An event loop watcher, most commonly an IO watcher obtained from\n        :meth:`gevent.core.loop.io`\n    :keyword timeout_exc: The exception to raise if the timeout expires.\n        By default, a :class:`socket.timeout` exception is raised.\n        If you pass a value for this keyword, it is interpreted as for\n        :class:`gevent.timeout.Timeout`.\n\n    :raises ~gevent.hub.ConcurrentObjectUseError: If the *watcher* is\n        already started.\n    ";
+static PyMethodDef __pyx_mdef_6gevent_16__hub_primitives_9wait_on_watcher = {"wait_on_watcher", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_16__hub_primitives_9wait_on_watcher, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_16__hub_primitives_8wait_on_watcher};
+static PyObject *__pyx_pw_6gevent_16__hub_primitives_9wait_on_watcher(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_watcher = 0;
+  PyObject *__pyx_v_timeout = 0;
+  PyObject *__pyx_v_timeout_exc = 0;
+  struct __pyx_obj_6gevent_16__hub_primitives_WaitOperationsGreenlet *__pyx_v_hub = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("wait_on_watcher (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_watcher,&__pyx_n_s_timeout,&__pyx_n_s_timeout_exc,&__pyx_n_s_hub,0};
+    PyObject* values[4] = {0,0,0,0};
+    values[1] = ((PyObject *)Py_None);
+    values[2] = __pyx_k__2;
+    values[3] = (PyObject *)((struct __pyx_obj_6gevent_16__hub_primitives_WaitOperationsGreenlet *)Py_None);
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
+        CYTHON_FALLTHROUGH;
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_watcher)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_timeout);
+          if (value) { values[1] = value; kw_args--; }
+        }
+        CYTHON_FALLTHROUGH;
+        case  2:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_timeout_exc);
+          if (value) { values[2] = value; kw_args--; }
+        }
+        CYTHON_FALLTHROUGH;
+        case  3:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_hub);
+          if (value) { values[3] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "wait_on_watcher") < 0)) __PYX_ERR(0, 293, __pyx_L3_error)
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
+        CYTHON_FALLTHROUGH;
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    __pyx_v_watcher = values[0];
+    __pyx_v_timeout = values[1];
+    __pyx_v_timeout_exc = values[2];
+    __pyx_v_hub = ((struct __pyx_obj_6gevent_16__hub_primitives_WaitOperationsGreenlet *)values[3]);
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("wait_on_watcher", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 293, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.__hub_primitives.wait_on_watcher", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_hub), __pyx_ptype_6gevent_16__hub_primitives_WaitOperationsGreenlet, 1, "hub", 0))) __PYX_ERR(0, 293, __pyx_L1_error)
+  __pyx_r = __pyx_pf_6gevent_16__hub_primitives_8wait_on_watcher(__pyx_self, __pyx_v_watcher, __pyx_v_timeout, __pyx_v_timeout_exc, __pyx_v_hub);
+
+  /* function exit code */
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_16__hub_primitives_8wait_on_watcher(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_watcher, PyObject *__pyx_v_timeout, PyObject *__pyx_v_timeout_exc, struct __pyx_obj_6gevent_16__hub_primitives_WaitOperationsGreenlet *__pyx_v_hub) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("wait_on_watcher", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_2.__pyx_n = 3;
+  __pyx_t_2.timeout = __pyx_v_timeout;
+  __pyx_t_2.timeout_exc = __pyx_v_timeout_exc;
+  __pyx_t_2.hub = __pyx_v_hub;
+  __pyx_t_1 = __pyx_f_6gevent_16__hub_primitives_wait_on_watcher(__pyx_v_watcher, 0, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 293, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.__hub_primitives.wait_on_watcher", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_NONE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 293, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_k__2 = __pyx_t_1;
+  __Pyx_GIVEREF(__pyx_t_1);
+  __pyx_t_1 = 0;
+  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_NONE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 293, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_k__2 = __pyx_t_1;
+  __Pyx_GIVEREF(__pyx_t_1);
+  __pyx_t_1 = 0;
+/* … */
+  __pyx_tuple__27 = PyTuple_Pack(4, __pyx_n_s_watcher, __pyx_n_s_timeout, __pyx_n_s_timeout_exc, __pyx_n_s_hub); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(0, 293, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__27);
+  __Pyx_GIVEREF(__pyx_tuple__27);
+  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_16__hub_primitives_9wait_on_watcher, 0, __pyx_n_s_wait_on_watcher, NULL, __pyx_n_s_gevent___hub_primitives, __pyx_d, ((PyObject *)__pyx_codeobj__28)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 293, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_wait_on_watcher, __pyx_t_1) < 0) __PYX_ERR(0, 293, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_codeobj__28 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__27, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__hub_primitives_py, __pyx_n_s_wait_on_watcher, 293, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__28)) __PYX_ERR(0, 293, __pyx_L1_error)
+
 294:     """
+
 295:     wait(watcher, timeout=None, [timeout_exc=None]) -> None
+
 296: 
+
 297:     Block the current greenlet until *watcher* is ready.
+
 298: 
+
 299:     If *timeout* is non-negative, then *timeout_exc* is raised after
+
 300:     *timeout* second has passed.
+
 301: 
+
 302:     If :func:`cancel_wait` is called on *io* by another greenlet,
+
 303:     raise an exception in this blocking greenlet
+
 304:     (``socket.error(EBADF, 'File descriptor was closed in another
+
 305:     greenlet')`` by default).
+
 306: 
+
 307:     :param io: An event loop watcher, most commonly an IO watcher obtained from
+
 308:         :meth:`gevent.core.loop.io`
+
 309:     :keyword timeout_exc: The exception to raise if the timeout expires.
+
 310:         By default, a :class:`socket.timeout` exception is raised.
+
 311:         If you pass a value for this keyword, it is interpreted as for
+
 312:         :class:`gevent.timeout.Timeout`.
+
 313: 
+
 314:     :raises ~gevent.hub.ConcurrentObjectUseError: If the *watcher* is
+
 315:         already started.
+
 316:     """
+
+317:     _primitive_wait(watcher, timeout, timeout_exc, hub)
+
  __pyx_t_1 = __pyx_f_6gevent_16__hub_primitives__primitive_wait(__pyx_v_watcher, __pyx_v_timeout, __pyx_v_timeout_exc, __pyx_v_hub); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 317, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 318: 
+
 319: 
+
+320: def wait_read(fileno, timeout=None, timeout_exc=_NONE):
+
static PyObject *__pyx_pw_6gevent_16__hub_primitives_11wait_read(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_f_6gevent_16__hub_primitives_wait_read(PyObject *__pyx_v_fileno, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_16__hub_primitives_wait_read *__pyx_optional_args) {
+  PyObject *__pyx_v_timeout = ((PyObject *)Py_None);
+  PyObject *__pyx_v_timeout_exc = __pyx_k__3;
+  struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *__pyx_v_hub = NULL;
+  PyObject *__pyx_v_io = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("wait_read", 0);
+  if (__pyx_optional_args) {
+    if (__pyx_optional_args->__pyx_n > 0) {
+      __pyx_v_timeout = __pyx_optional_args->timeout;
+      if (__pyx_optional_args->__pyx_n > 1) {
+        __pyx_v_timeout_exc = __pyx_optional_args->timeout_exc;
+      }
+    }
+  }
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_AddTraceback("gevent.__hub_primitives.wait_read", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XDECREF((PyObject *)__pyx_v_hub);
+  __Pyx_XDECREF(__pyx_v_io);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_16__hub_primitives_11wait_read(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_6gevent_16__hub_primitives_10wait_read[] = "wait_read(fileno, timeout=None, timeout_exc=_NONE)\n\n    wait_read(fileno, timeout=None, [timeout_exc=None]) -> None\n\n    Block the current greenlet until *fileno* is ready to read.\n\n    For the meaning of the other parameters and possible exceptions,\n    see :func:`wait`.\n\n    .. seealso:: :func:`cancel_wait`\n    ";
+static PyMethodDef __pyx_mdef_6gevent_16__hub_primitives_11wait_read = {"wait_read", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_16__hub_primitives_11wait_read, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_16__hub_primitives_10wait_read};
+static PyObject *__pyx_pw_6gevent_16__hub_primitives_11wait_read(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_fileno = 0;
+  PyObject *__pyx_v_timeout = 0;
+  PyObject *__pyx_v_timeout_exc = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("wait_read (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_fileno,&__pyx_n_s_timeout,&__pyx_n_s_timeout_exc,0};
+    PyObject* values[3] = {0,0,0};
+    values[1] = ((PyObject *)Py_None);
+    values[2] = __pyx_k__3;
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_fileno)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_timeout);
+          if (value) { values[1] = value; kw_args--; }
+        }
+        CYTHON_FALLTHROUGH;
+        case  2:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_timeout_exc);
+          if (value) { values[2] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "wait_read") < 0)) __PYX_ERR(0, 320, __pyx_L3_error)
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    __pyx_v_fileno = values[0];
+    __pyx_v_timeout = values[1];
+    __pyx_v_timeout_exc = values[2];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("wait_read", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 320, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.__hub_primitives.wait_read", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_16__hub_primitives_10wait_read(__pyx_self, __pyx_v_fileno, __pyx_v_timeout, __pyx_v_timeout_exc);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_16__hub_primitives_10wait_read(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_fileno, PyObject *__pyx_v_timeout, PyObject *__pyx_v_timeout_exc) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("wait_read", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_2.__pyx_n = 2;
+  __pyx_t_2.timeout = __pyx_v_timeout;
+  __pyx_t_2.timeout_exc = __pyx_v_timeout_exc;
+  __pyx_t_1 = __pyx_f_6gevent_16__hub_primitives_wait_read(__pyx_v_fileno, 0, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 320, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.__hub_primitives.wait_read", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_NONE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 320, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_k__3 = __pyx_t_1;
+  __Pyx_GIVEREF(__pyx_t_1);
+  __pyx_t_1 = 0;
+  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_NONE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 320, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_k__3 = __pyx_t_1;
+  __Pyx_GIVEREF(__pyx_t_1);
+  __pyx_t_1 = 0;
+/* … */
+  __pyx_tuple__29 = PyTuple_Pack(3, __pyx_n_s_fileno, __pyx_n_s_timeout, __pyx_n_s_timeout_exc); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(0, 320, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__29);
+  __Pyx_GIVEREF(__pyx_tuple__29);
+  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_16__hub_primitives_11wait_read, 0, __pyx_n_s_wait_read, NULL, __pyx_n_s_gevent___hub_primitives, __pyx_d, ((PyObject *)__pyx_codeobj__30)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 320, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_wait_read, __pyx_t_1) < 0) __PYX_ERR(0, 320, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_codeobj__30 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__29, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__hub_primitives_py, __pyx_n_s_wait_read, 320, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__30)) __PYX_ERR(0, 320, __pyx_L1_error)
+
 321:     """
+
 322:     wait_read(fileno, timeout=None, [timeout_exc=None]) -> None
+
 323: 
+
 324:     Block the current greenlet until *fileno* is ready to read.
+
 325: 
+
 326:     For the meaning of the other parameters and possible exceptions,
+
 327:     see :func:`wait`.
+
 328: 
+
 329:     .. seealso:: :func:`cancel_wait`
+
 330:     """
+
+331:     hub = get_hub()
+
  __pyx_t_1 = ((PyObject *)__pyx_f_6gevent_11__hub_local_get_hub_noargs(0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 331, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_v_hub = ((struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *)__pyx_t_1);
+  __pyx_t_1 = 0;
+
+332:     io = hub.loop.io(fileno, 1)
+
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_hub->loop, __pyx_n_s_io); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 332, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = NULL;
+  __pyx_t_4 = 0;
+  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+    if (likely(__pyx_t_3)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+      __Pyx_INCREF(__pyx_t_3);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_2, function);
+      __pyx_t_4 = 1;
+    }
+  }
+  #if CYTHON_FAST_PYCALL
+  if (PyFunction_Check(__pyx_t_2)) {
+    PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_fileno, __pyx_int_1};
+    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 332, __pyx_L1_error)
+    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __Pyx_GOTREF(__pyx_t_1);
+  } else
+  #endif
+  #if CYTHON_FAST_PYCCALL
+  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
+    PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_fileno, __pyx_int_1};
+    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 332, __pyx_L1_error)
+    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __Pyx_GOTREF(__pyx_t_1);
+  } else
+  #endif
+  {
+    __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 332, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_5);
+    if (__pyx_t_3) {
+      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
+    }
+    __Pyx_INCREF(__pyx_v_fileno);
+    __Pyx_GIVEREF(__pyx_v_fileno);
+    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_fileno);
+    __Pyx_INCREF(__pyx_int_1);
+    __Pyx_GIVEREF(__pyx_int_1);
+    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_int_1);
+    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 332, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+  }
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_v_io = __pyx_t_1;
+  __pyx_t_1 = 0;
+
+333:     try:
+
  /*try:*/ {
+
+334:         return wait_on_watcher(io, timeout, timeout_exc, hub)
+
    __Pyx_XDECREF(__pyx_r);
+    if (!(likely(((((PyObject *)__pyx_v_hub)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_hub), __pyx_ptype_6gevent_16__hub_primitives_WaitOperationsGreenlet))))) __PYX_ERR(0, 334, __pyx_L4_error)
+    __pyx_t_6.__pyx_n = 3;
+    __pyx_t_6.timeout = __pyx_v_timeout;
+    __pyx_t_6.timeout_exc = __pyx_v_timeout_exc;
+    __pyx_t_6.hub = ((struct __pyx_obj_6gevent_16__hub_primitives_WaitOperationsGreenlet *)__pyx_v_hub);
+    __pyx_t_1 = __pyx_f_6gevent_16__hub_primitives_wait_on_watcher(__pyx_v_io, 0, &__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 334, __pyx_L4_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __pyx_r = __pyx_t_1;
+    __pyx_t_1 = 0;
+    goto __pyx_L3_return;
+  }
+
 335:     finally:
+
+336:         io.close()
+
  /*finally:*/ {
+    __pyx_L4_error:;
+    /*exception exit:*/{
+      __Pyx_PyThreadState_declare
+      __Pyx_PyThreadState_assign
+      __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0;
+      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+      if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14);
+      if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11) < 0)) __Pyx_ErrFetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
+      __Pyx_XGOTREF(__pyx_t_9);
+      __Pyx_XGOTREF(__pyx_t_10);
+      __Pyx_XGOTREF(__pyx_t_11);
+      __Pyx_XGOTREF(__pyx_t_12);
+      __Pyx_XGOTREF(__pyx_t_13);
+      __Pyx_XGOTREF(__pyx_t_14);
+      __pyx_t_4 = __pyx_lineno; __pyx_t_7 = __pyx_clineno; __pyx_t_8 = __pyx_filename;
+      {
+        __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_io, __pyx_n_s_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 336, __pyx_L7_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        __pyx_t_5 = NULL;
+        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+          __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
+          if (likely(__pyx_t_5)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+            __Pyx_INCREF(__pyx_t_5);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_2, function);
+          }
+        }
+        __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
+        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+        if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 336, __pyx_L7_error)
+        __Pyx_GOTREF(__pyx_t_1);
+        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      }
+      if (PY_MAJOR_VERSION >= 3) {
+        __Pyx_XGIVEREF(__pyx_t_12);
+        __Pyx_XGIVEREF(__pyx_t_13);
+        __Pyx_XGIVEREF(__pyx_t_14);
+        __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14);
+      }
+      __Pyx_XGIVEREF(__pyx_t_9);
+      __Pyx_XGIVEREF(__pyx_t_10);
+      __Pyx_XGIVEREF(__pyx_t_11);
+      __Pyx_ErrRestore(__pyx_t_9, __pyx_t_10, __pyx_t_11);
+      __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0;
+      __pyx_lineno = __pyx_t_4; __pyx_clineno = __pyx_t_7; __pyx_filename = __pyx_t_8;
+      goto __pyx_L1_error;
+      __pyx_L7_error:;
+      if (PY_MAJOR_VERSION >= 3) {
+        __Pyx_XGIVEREF(__pyx_t_12);
+        __Pyx_XGIVEREF(__pyx_t_13);
+        __Pyx_XGIVEREF(__pyx_t_14);
+        __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14);
+      }
+      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
+      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
+      __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
+      __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0;
+      goto __pyx_L1_error;
+    }
+    __pyx_L3_return: {
+      __pyx_t_14 = __pyx_r;
+      __pyx_r = 0;
+      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_io, __pyx_n_s_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 336, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_2);
+      __pyx_t_5 = NULL;
+      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
+        if (likely(__pyx_t_5)) {
+          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+          __Pyx_INCREF(__pyx_t_5);
+          __Pyx_INCREF(function);
+          __Pyx_DECREF_SET(__pyx_t_2, function);
+        }
+      }
+      __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
+      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 336, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      __pyx_r = __pyx_t_14;
+      __pyx_t_14 = 0;
+      goto __pyx_L0;
+    }
+  }
+
 337: 
+
 338: 
+
+339: def wait_write(fileno, timeout=None, timeout_exc=_NONE, event=_NONE):
+
static PyObject *__pyx_pw_6gevent_16__hub_primitives_13wait_write(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_f_6gevent_16__hub_primitives_wait_write(PyObject *__pyx_v_fileno, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_16__hub_primitives_wait_write *__pyx_optional_args) {
+  PyObject *__pyx_v_timeout = ((PyObject *)Py_None);
+  PyObject *__pyx_v_timeout_exc = __pyx_k__4;
+  struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *__pyx_v_hub = NULL;
+  PyObject *__pyx_v_io = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("wait_write", 0);
+  if (__pyx_optional_args) {
+    if (__pyx_optional_args->__pyx_n > 0) {
+      __pyx_v_timeout = __pyx_optional_args->timeout;
+      if (__pyx_optional_args->__pyx_n > 1) {
+        __pyx_v_timeout_exc = __pyx_optional_args->timeout_exc;
+      }
+    }
+  }
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_AddTraceback("gevent.__hub_primitives.wait_write", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XDECREF((PyObject *)__pyx_v_hub);
+  __Pyx_XDECREF(__pyx_v_io);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_16__hub_primitives_13wait_write(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_6gevent_16__hub_primitives_12wait_write[] = "wait_write(fileno, timeout=None, timeout_exc=_NONE, event=_NONE)\n\n    wait_write(fileno, timeout=None, [timeout_exc=None]) -> None\n\n    Block the current greenlet until *fileno* is ready to write.\n\n    For the meaning of the other parameters and possible exceptions,\n    see :func:`wait`.\n\n    .. deprecated:: 1.1\n       The keyword argument *event* is ignored. Applications should not pass this parameter.\n       In the future, doing so will become an error.\n\n    .. seealso:: :func:`cancel_wait`\n    ";
+static PyMethodDef __pyx_mdef_6gevent_16__hub_primitives_13wait_write = {"wait_write", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_16__hub_primitives_13wait_write, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_16__hub_primitives_12wait_write};
+static PyObject *__pyx_pw_6gevent_16__hub_primitives_13wait_write(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_fileno = 0;
+  PyObject *__pyx_v_timeout = 0;
+  PyObject *__pyx_v_timeout_exc = 0;
+  PyObject *__pyx_v_event = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("wait_write (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_fileno,&__pyx_n_s_timeout,&__pyx_n_s_timeout_exc,&__pyx_n_s_event,0};
+    PyObject* values[4] = {0,0,0,0};
+    values[1] = ((PyObject *)Py_None);
+    values[2] = __pyx_k__4;
+    values[3] = __pyx_k__5;
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
+        CYTHON_FALLTHROUGH;
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_fileno)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_timeout);
+          if (value) { values[1] = value; kw_args--; }
+        }
+        CYTHON_FALLTHROUGH;
+        case  2:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_timeout_exc);
+          if (value) { values[2] = value; kw_args--; }
+        }
+        CYTHON_FALLTHROUGH;
+        case  3:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_event);
+          if (value) { values[3] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "wait_write") < 0)) __PYX_ERR(0, 339, __pyx_L3_error)
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
+        CYTHON_FALLTHROUGH;
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    __pyx_v_fileno = values[0];
+    __pyx_v_timeout = values[1];
+    __pyx_v_timeout_exc = values[2];
+    __pyx_v_event = values[3];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("wait_write", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 339, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.__hub_primitives.wait_write", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_16__hub_primitives_12wait_write(__pyx_self, __pyx_v_fileno, __pyx_v_timeout, __pyx_v_timeout_exc, __pyx_v_event);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_16__hub_primitives_12wait_write(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_fileno, PyObject *__pyx_v_timeout, PyObject *__pyx_v_timeout_exc, PyObject *__pyx_v_event) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("wait_write", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_2.__pyx_n = 3;
+  __pyx_t_2.timeout = __pyx_v_timeout;
+  __pyx_t_2.timeout_exc = __pyx_v_timeout_exc;
+  __pyx_t_2.event = __pyx_v_event;
+  __pyx_t_1 = __pyx_f_6gevent_16__hub_primitives_wait_write(__pyx_v_fileno, 0, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 339, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.__hub_primitives.wait_write", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_NONE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 339, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_k__4 = __pyx_t_1;
+  __Pyx_GIVEREF(__pyx_t_1);
+  __pyx_t_1 = 0;
+  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_NONE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 339, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_k__5 = __pyx_t_1;
+  __Pyx_GIVEREF(__pyx_t_1);
+  __pyx_t_1 = 0;
+  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_NONE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 339, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_k__4 = __pyx_t_1;
+  __Pyx_GIVEREF(__pyx_t_1);
+  __pyx_t_1 = 0;
+  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_NONE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 339, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_k__5 = __pyx_t_1;
+  __Pyx_GIVEREF(__pyx_t_1);
+  __pyx_t_1 = 0;
+/* … */
+  __pyx_tuple__31 = PyTuple_Pack(4, __pyx_n_s_fileno, __pyx_n_s_timeout, __pyx_n_s_timeout_exc, __pyx_n_s_event); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(0, 339, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__31);
+  __Pyx_GIVEREF(__pyx_tuple__31);
+  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_16__hub_primitives_13wait_write, 0, __pyx_n_s_wait_write, NULL, __pyx_n_s_gevent___hub_primitives, __pyx_d, ((PyObject *)__pyx_codeobj__32)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 339, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_wait_write, __pyx_t_1) < 0) __PYX_ERR(0, 339, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_codeobj__32 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__31, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__hub_primitives_py, __pyx_n_s_wait_write, 339, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__32)) __PYX_ERR(0, 339, __pyx_L1_error)
+
 340:     """
+
 341:     wait_write(fileno, timeout=None, [timeout_exc=None]) -> None
+
 342: 
+
 343:     Block the current greenlet until *fileno* is ready to write.
+
 344: 
+
 345:     For the meaning of the other parameters and possible exceptions,
+
 346:     see :func:`wait`.
+
 347: 
+
 348:     .. deprecated:: 1.1
+
 349:        The keyword argument *event* is ignored. Applications should not pass this parameter.
+
 350:        In the future, doing so will become an error.
+
 351: 
+
 352:     .. seealso:: :func:`cancel_wait`
+
 353:     """
+
 354:     # pylint:disable=unused-argument
+
+355:     hub = get_hub()
+
  __pyx_t_1 = ((PyObject *)__pyx_f_6gevent_11__hub_local_get_hub_noargs(0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 355, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_v_hub = ((struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *)__pyx_t_1);
+  __pyx_t_1 = 0;
+
+356:     io = hub.loop.io(fileno, 2)
+
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_hub->loop, __pyx_n_s_io); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 356, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = NULL;
+  __pyx_t_4 = 0;
+  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+    if (likely(__pyx_t_3)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+      __Pyx_INCREF(__pyx_t_3);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_2, function);
+      __pyx_t_4 = 1;
+    }
+  }
+  #if CYTHON_FAST_PYCALL
+  if (PyFunction_Check(__pyx_t_2)) {
+    PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_fileno, __pyx_int_2};
+    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 356, __pyx_L1_error)
+    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __Pyx_GOTREF(__pyx_t_1);
+  } else
+  #endif
+  #if CYTHON_FAST_PYCCALL
+  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
+    PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_fileno, __pyx_int_2};
+    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 356, __pyx_L1_error)
+    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __Pyx_GOTREF(__pyx_t_1);
+  } else
+  #endif
+  {
+    __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 356, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_5);
+    if (__pyx_t_3) {
+      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
+    }
+    __Pyx_INCREF(__pyx_v_fileno);
+    __Pyx_GIVEREF(__pyx_v_fileno);
+    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_fileno);
+    __Pyx_INCREF(__pyx_int_2);
+    __Pyx_GIVEREF(__pyx_int_2);
+    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_int_2);
+    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 356, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+  }
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_v_io = __pyx_t_1;
+  __pyx_t_1 = 0;
+
+357:     try:
+
  /*try:*/ {
+
+358:         return wait_on_watcher(io, timeout, timeout_exc, hub)
+
    __Pyx_XDECREF(__pyx_r);
+    if (!(likely(((((PyObject *)__pyx_v_hub)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_hub), __pyx_ptype_6gevent_16__hub_primitives_WaitOperationsGreenlet))))) __PYX_ERR(0, 358, __pyx_L4_error)
+    __pyx_t_6.__pyx_n = 3;
+    __pyx_t_6.timeout = __pyx_v_timeout;
+    __pyx_t_6.timeout_exc = __pyx_v_timeout_exc;
+    __pyx_t_6.hub = ((struct __pyx_obj_6gevent_16__hub_primitives_WaitOperationsGreenlet *)__pyx_v_hub);
+    __pyx_t_1 = __pyx_f_6gevent_16__hub_primitives_wait_on_watcher(__pyx_v_io, 0, &__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 358, __pyx_L4_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __pyx_r = __pyx_t_1;
+    __pyx_t_1 = 0;
+    goto __pyx_L3_return;
+  }
+
 359:     finally:
+
+360:         io.close()
+
  /*finally:*/ {
+    __pyx_L4_error:;
+    /*exception exit:*/{
+      __Pyx_PyThreadState_declare
+      __Pyx_PyThreadState_assign
+      __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0;
+      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+      if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14);
+      if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11) < 0)) __Pyx_ErrFetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
+      __Pyx_XGOTREF(__pyx_t_9);
+      __Pyx_XGOTREF(__pyx_t_10);
+      __Pyx_XGOTREF(__pyx_t_11);
+      __Pyx_XGOTREF(__pyx_t_12);
+      __Pyx_XGOTREF(__pyx_t_13);
+      __Pyx_XGOTREF(__pyx_t_14);
+      __pyx_t_4 = __pyx_lineno; __pyx_t_7 = __pyx_clineno; __pyx_t_8 = __pyx_filename;
+      {
+        __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_io, __pyx_n_s_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 360, __pyx_L7_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        __pyx_t_5 = NULL;
+        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+          __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
+          if (likely(__pyx_t_5)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+            __Pyx_INCREF(__pyx_t_5);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_2, function);
+          }
+        }
+        __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
+        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+        if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 360, __pyx_L7_error)
+        __Pyx_GOTREF(__pyx_t_1);
+        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      }
+      if (PY_MAJOR_VERSION >= 3) {
+        __Pyx_XGIVEREF(__pyx_t_12);
+        __Pyx_XGIVEREF(__pyx_t_13);
+        __Pyx_XGIVEREF(__pyx_t_14);
+        __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14);
+      }
+      __Pyx_XGIVEREF(__pyx_t_9);
+      __Pyx_XGIVEREF(__pyx_t_10);
+      __Pyx_XGIVEREF(__pyx_t_11);
+      __Pyx_ErrRestore(__pyx_t_9, __pyx_t_10, __pyx_t_11);
+      __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0;
+      __pyx_lineno = __pyx_t_4; __pyx_clineno = __pyx_t_7; __pyx_filename = __pyx_t_8;
+      goto __pyx_L1_error;
+      __pyx_L7_error:;
+      if (PY_MAJOR_VERSION >= 3) {
+        __Pyx_XGIVEREF(__pyx_t_12);
+        __Pyx_XGIVEREF(__pyx_t_13);
+        __Pyx_XGIVEREF(__pyx_t_14);
+        __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14);
+      }
+      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
+      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
+      __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
+      __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0;
+      goto __pyx_L1_error;
+    }
+    __pyx_L3_return: {
+      __pyx_t_14 = __pyx_r;
+      __pyx_r = 0;
+      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_io, __pyx_n_s_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 360, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_2);
+      __pyx_t_5 = NULL;
+      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
+        if (likely(__pyx_t_5)) {
+          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+          __Pyx_INCREF(__pyx_t_5);
+          __Pyx_INCREF(function);
+          __Pyx_DECREF_SET(__pyx_t_2, function);
+        }
+      }
+      __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
+      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 360, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      __pyx_r = __pyx_t_14;
+      __pyx_t_14 = 0;
+      goto __pyx_L0;
+    }
+  }
+
 361: 
+
 362: 
+
+363: def wait_readwrite(fileno, timeout=None, timeout_exc=_NONE, event=_NONE):
+
static PyObject *__pyx_pw_6gevent_16__hub_primitives_15wait_readwrite(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_f_6gevent_16__hub_primitives_wait_readwrite(PyObject *__pyx_v_fileno, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_16__hub_primitives_wait_readwrite *__pyx_optional_args) {
+  PyObject *__pyx_v_timeout = ((PyObject *)Py_None);
+  PyObject *__pyx_v_timeout_exc = __pyx_k__6;
+  struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *__pyx_v_hub = NULL;
+  PyObject *__pyx_v_io = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("wait_readwrite", 0);
+  if (__pyx_optional_args) {
+    if (__pyx_optional_args->__pyx_n > 0) {
+      __pyx_v_timeout = __pyx_optional_args->timeout;
+      if (__pyx_optional_args->__pyx_n > 1) {
+        __pyx_v_timeout_exc = __pyx_optional_args->timeout_exc;
+      }
+    }
+  }
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_AddTraceback("gevent.__hub_primitives.wait_readwrite", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XDECREF((PyObject *)__pyx_v_hub);
+  __Pyx_XDECREF(__pyx_v_io);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_16__hub_primitives_15wait_readwrite(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_6gevent_16__hub_primitives_14wait_readwrite[] = "wait_readwrite(fileno, timeout=None, timeout_exc=_NONE, event=_NONE)\n\n    wait_readwrite(fileno, timeout=None, [timeout_exc=None]) -> None\n\n    Block the current greenlet until *fileno* is ready to read or\n    write.\n\n    For the meaning of the other parameters and possible exceptions,\n    see :func:`wait`.\n\n    .. deprecated:: 1.1\n       The keyword argument *event* is ignored. Applications should not pass this parameter.\n       In the future, doing so will become an error.\n\n    .. seealso:: :func:`cancel_wait`\n    ";
+static PyMethodDef __pyx_mdef_6gevent_16__hub_primitives_15wait_readwrite = {"wait_readwrite", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_16__hub_primitives_15wait_readwrite, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_16__hub_primitives_14wait_readwrite};
+static PyObject *__pyx_pw_6gevent_16__hub_primitives_15wait_readwrite(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_fileno = 0;
+  PyObject *__pyx_v_timeout = 0;
+  PyObject *__pyx_v_timeout_exc = 0;
+  PyObject *__pyx_v_event = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("wait_readwrite (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_fileno,&__pyx_n_s_timeout,&__pyx_n_s_timeout_exc,&__pyx_n_s_event,0};
+    PyObject* values[4] = {0,0,0,0};
+    values[1] = ((PyObject *)Py_None);
+    values[2] = __pyx_k__6;
+    values[3] = __pyx_k__7;
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
+        CYTHON_FALLTHROUGH;
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_fileno)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_timeout);
+          if (value) { values[1] = value; kw_args--; }
+        }
+        CYTHON_FALLTHROUGH;
+        case  2:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_timeout_exc);
+          if (value) { values[2] = value; kw_args--; }
+        }
+        CYTHON_FALLTHROUGH;
+        case  3:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_event);
+          if (value) { values[3] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "wait_readwrite") < 0)) __PYX_ERR(0, 363, __pyx_L3_error)
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
+        CYTHON_FALLTHROUGH;
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    __pyx_v_fileno = values[0];
+    __pyx_v_timeout = values[1];
+    __pyx_v_timeout_exc = values[2];
+    __pyx_v_event = values[3];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("wait_readwrite", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 363, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.__hub_primitives.wait_readwrite", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_16__hub_primitives_14wait_readwrite(__pyx_self, __pyx_v_fileno, __pyx_v_timeout, __pyx_v_timeout_exc, __pyx_v_event);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_16__hub_primitives_14wait_readwrite(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_fileno, PyObject *__pyx_v_timeout, PyObject *__pyx_v_timeout_exc, PyObject *__pyx_v_event) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("wait_readwrite", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_2.__pyx_n = 3;
+  __pyx_t_2.timeout = __pyx_v_timeout;
+  __pyx_t_2.timeout_exc = __pyx_v_timeout_exc;
+  __pyx_t_2.event = __pyx_v_event;
+  __pyx_t_1 = __pyx_f_6gevent_16__hub_primitives_wait_readwrite(__pyx_v_fileno, 0, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 363, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.__hub_primitives.wait_readwrite", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_NONE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 363, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_k__6 = __pyx_t_1;
+  __Pyx_GIVEREF(__pyx_t_1);
+  __pyx_t_1 = 0;
+  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_NONE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 363, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_k__7 = __pyx_t_1;
+  __Pyx_GIVEREF(__pyx_t_1);
+  __pyx_t_1 = 0;
+  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_NONE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 363, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_k__6 = __pyx_t_1;
+  __Pyx_GIVEREF(__pyx_t_1);
+  __pyx_t_1 = 0;
+  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_NONE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 363, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_k__7 = __pyx_t_1;
+  __Pyx_GIVEREF(__pyx_t_1);
+  __pyx_t_1 = 0;
+/* … */
+  __pyx_tuple__33 = PyTuple_Pack(4, __pyx_n_s_fileno, __pyx_n_s_timeout, __pyx_n_s_timeout_exc, __pyx_n_s_event); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(0, 363, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__33);
+  __Pyx_GIVEREF(__pyx_tuple__33);
+  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_16__hub_primitives_15wait_readwrite, 0, __pyx_n_s_wait_readwrite, NULL, __pyx_n_s_gevent___hub_primitives, __pyx_d, ((PyObject *)__pyx_codeobj__34)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 363, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_wait_readwrite, __pyx_t_1) < 0) __PYX_ERR(0, 363, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_codeobj__34 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__33, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__hub_primitives_py, __pyx_n_s_wait_readwrite, 363, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__34)) __PYX_ERR(0, 363, __pyx_L1_error)
+
 364:     """
+
 365:     wait_readwrite(fileno, timeout=None, [timeout_exc=None]) -> None
+
 366: 
+
 367:     Block the current greenlet until *fileno* is ready to read or
+
 368:     write.
+
 369: 
+
 370:     For the meaning of the other parameters and possible exceptions,
+
 371:     see :func:`wait`.
+
 372: 
+
 373:     .. deprecated:: 1.1
+
 374:        The keyword argument *event* is ignored. Applications should not pass this parameter.
+
 375:        In the future, doing so will become an error.
+
 376: 
+
 377:     .. seealso:: :func:`cancel_wait`
+
 378:     """
+
 379:     # pylint:disable=unused-argument
+
+380:     hub = get_hub()
+
  __pyx_t_1 = ((PyObject *)__pyx_f_6gevent_11__hub_local_get_hub_noargs(0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 380, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_v_hub = ((struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *)__pyx_t_1);
+  __pyx_t_1 = 0;
+
+381:     io = hub.loop.io(fileno, 3)
+
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_hub->loop, __pyx_n_s_io); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 381, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = NULL;
+  __pyx_t_4 = 0;
+  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+    if (likely(__pyx_t_3)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+      __Pyx_INCREF(__pyx_t_3);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_2, function);
+      __pyx_t_4 = 1;
+    }
+  }
+  #if CYTHON_FAST_PYCALL
+  if (PyFunction_Check(__pyx_t_2)) {
+    PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_fileno, __pyx_int_3};
+    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 381, __pyx_L1_error)
+    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __Pyx_GOTREF(__pyx_t_1);
+  } else
+  #endif
+  #if CYTHON_FAST_PYCCALL
+  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
+    PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_fileno, __pyx_int_3};
+    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 381, __pyx_L1_error)
+    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __Pyx_GOTREF(__pyx_t_1);
+  } else
+  #endif
+  {
+    __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 381, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_5);
+    if (__pyx_t_3) {
+      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
+    }
+    __Pyx_INCREF(__pyx_v_fileno);
+    __Pyx_GIVEREF(__pyx_v_fileno);
+    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_fileno);
+    __Pyx_INCREF(__pyx_int_3);
+    __Pyx_GIVEREF(__pyx_int_3);
+    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_int_3);
+    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 381, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+  }
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_v_io = __pyx_t_1;
+  __pyx_t_1 = 0;
+
+382:     try:
+
  /*try:*/ {
+
+383:         return wait_on_watcher(io, timeout, timeout_exc, hub)
+
    __Pyx_XDECREF(__pyx_r);
+    if (!(likely(((((PyObject *)__pyx_v_hub)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_hub), __pyx_ptype_6gevent_16__hub_primitives_WaitOperationsGreenlet))))) __PYX_ERR(0, 383, __pyx_L4_error)
+    __pyx_t_6.__pyx_n = 3;
+    __pyx_t_6.timeout = __pyx_v_timeout;
+    __pyx_t_6.timeout_exc = __pyx_v_timeout_exc;
+    __pyx_t_6.hub = ((struct __pyx_obj_6gevent_16__hub_primitives_WaitOperationsGreenlet *)__pyx_v_hub);
+    __pyx_t_1 = __pyx_f_6gevent_16__hub_primitives_wait_on_watcher(__pyx_v_io, 0, &__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 383, __pyx_L4_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __pyx_r = __pyx_t_1;
+    __pyx_t_1 = 0;
+    goto __pyx_L3_return;
+  }
+
 384:     finally:
+
+385:         io.close()
+
  /*finally:*/ {
+    __pyx_L4_error:;
+    /*exception exit:*/{
+      __Pyx_PyThreadState_declare
+      __Pyx_PyThreadState_assign
+      __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0;
+      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+      if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14);
+      if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11) < 0)) __Pyx_ErrFetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
+      __Pyx_XGOTREF(__pyx_t_9);
+      __Pyx_XGOTREF(__pyx_t_10);
+      __Pyx_XGOTREF(__pyx_t_11);
+      __Pyx_XGOTREF(__pyx_t_12);
+      __Pyx_XGOTREF(__pyx_t_13);
+      __Pyx_XGOTREF(__pyx_t_14);
+      __pyx_t_4 = __pyx_lineno; __pyx_t_7 = __pyx_clineno; __pyx_t_8 = __pyx_filename;
+      {
+        __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_io, __pyx_n_s_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 385, __pyx_L7_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        __pyx_t_5 = NULL;
+        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+          __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
+          if (likely(__pyx_t_5)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+            __Pyx_INCREF(__pyx_t_5);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_2, function);
+          }
+        }
+        __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
+        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+        if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 385, __pyx_L7_error)
+        __Pyx_GOTREF(__pyx_t_1);
+        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      }
+      if (PY_MAJOR_VERSION >= 3) {
+        __Pyx_XGIVEREF(__pyx_t_12);
+        __Pyx_XGIVEREF(__pyx_t_13);
+        __Pyx_XGIVEREF(__pyx_t_14);
+        __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14);
+      }
+      __Pyx_XGIVEREF(__pyx_t_9);
+      __Pyx_XGIVEREF(__pyx_t_10);
+      __Pyx_XGIVEREF(__pyx_t_11);
+      __Pyx_ErrRestore(__pyx_t_9, __pyx_t_10, __pyx_t_11);
+      __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0;
+      __pyx_lineno = __pyx_t_4; __pyx_clineno = __pyx_t_7; __pyx_filename = __pyx_t_8;
+      goto __pyx_L1_error;
+      __pyx_L7_error:;
+      if (PY_MAJOR_VERSION >= 3) {
+        __Pyx_XGIVEREF(__pyx_t_12);
+        __Pyx_XGIVEREF(__pyx_t_13);
+        __Pyx_XGIVEREF(__pyx_t_14);
+        __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14);
+      }
+      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
+      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
+      __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
+      __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0;
+      goto __pyx_L1_error;
+    }
+    __pyx_L3_return: {
+      __pyx_t_14 = __pyx_r;
+      __pyx_r = 0;
+      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_io, __pyx_n_s_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 385, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_2);
+      __pyx_t_5 = NULL;
+      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
+        if (likely(__pyx_t_5)) {
+          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+          __Pyx_INCREF(__pyx_t_5);
+          __Pyx_INCREF(function);
+          __Pyx_DECREF_SET(__pyx_t_2, function);
+        }
+      }
+      __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
+      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 385, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      __pyx_r = __pyx_t_14;
+      __pyx_t_14 = 0;
+      goto __pyx_L0;
+    }
+  }
+
 386: 
+
 387: 
+
+388: def _init():
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_16__hub_primitives_17_init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6gevent_16__hub_primitives_16_init[] = "_init()";
+static PyMethodDef __pyx_mdef_6gevent_16__hub_primitives_17_init = {"_init", (PyCFunction)__pyx_pw_6gevent_16__hub_primitives_17_init, METH_NOARGS, __pyx_doc_6gevent_16__hub_primitives_16_init};
+static PyObject *__pyx_pw_6gevent_16__hub_primitives_17_init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_init (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_16__hub_primitives_16_init(__pyx_self);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_16__hub_primitives_16_init(CYTHON_UNUSED PyObject *__pyx_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_init", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_16__hub_primitives_17_init, 0, __pyx_n_s_init, NULL, __pyx_n_s_gevent___hub_primitives, __pyx_d, ((PyObject *)__pyx_codeobj__35)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 388, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_init, __pyx_t_1) < 0) __PYX_ERR(0, 388, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+389:     greenlet_init() # pylint:disable=undefined-variable
+
  __pyx_f_6gevent_16__hub_primitives_greenlet_init();
+
 390: 
+
+391: _init()
+
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_init); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 391, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 391, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
 392: 
+
+393: from gevent._util import import_c_accel
+
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 393, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_import_c_accel);
+  __Pyx_GIVEREF(__pyx_n_s_import_c_accel);
+  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_import_c_accel);
+  __pyx_t_1 = __Pyx_Import(__pyx_n_s_gevent__util, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 393, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_import_c_accel); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 393, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_import_c_accel, __pyx_t_2) < 0) __PYX_ERR(0, 393, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+394: import_c_accel(globals(), 'gevent.__hub_primitives')
+
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_import_c_accel); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 394, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = __Pyx_Globals(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 394, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 394, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_GIVEREF(__pyx_t_2);
+  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_gevent___hub_primitives);
+  __Pyx_GIVEREF(__pyx_n_s_gevent___hub_primitives);
+  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_n_s_gevent___hub_primitives);
+  __pyx_t_2 = 0;
+  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 394, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_hub_primitives.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_hub_primitives.py new file mode 100644 index 00000000..490c7a6b --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_hub_primitives.py @@ -0,0 +1,394 @@ +# -*- coding: utf-8 -*- +# copyright (c) 2018 gevent. See LICENSE. +# cython: auto_pickle=False,embedsignature=True,always_allow_keywords=False,binding=True +""" +A collection of primitives used by the hub, and suitable for +compilation with Cython because of their frequency of use. + + +""" +from __future__ import absolute_import +from __future__ import division +from __future__ import print_function + +import traceback + +from gevent.exceptions import InvalidSwitchError +from gevent.exceptions import ConcurrentObjectUseError + +from gevent import _greenlet_primitives +from gevent import _waiter +from gevent._util import _NONE +from gevent._hub_local import get_hub_noargs as get_hub +from gevent.timeout import Timeout + +# In Cython, we define these as 'cdef inline' functions. The +# compilation unit cannot have a direct assignment to them (import +# is assignment) without generating a 'lvalue is not valid target' +# error. +locals()['getcurrent'] = __import__('greenlet').getcurrent +locals()['greenlet_init'] = lambda: None +locals()['Waiter'] = _waiter.Waiter +locals()['MultipleWaiter'] = _waiter.MultipleWaiter +locals()['SwitchOutGreenletWithLoop'] = _greenlet_primitives.SwitchOutGreenletWithLoop + +__all__ = [ + 'WaitOperationsGreenlet', + 'iwait_on_objects', + 'wait_on_objects', + 'wait_read', + 'wait_write', + 'wait_readwrite', +] + +class WaitOperationsGreenlet(SwitchOutGreenletWithLoop): # pylint:disable=undefined-variable + + def wait(self, watcher): + """ + Wait until the *watcher* (which must not be started) is ready. + + The current greenlet will be unscheduled during this time. + """ + waiter = Waiter(self) # pylint:disable=undefined-variable + watcher.start(waiter.switch, waiter) + try: + result = waiter.get() + if result is not waiter: + raise InvalidSwitchError('Invalid switch into %s: %r (expected %r)' % ( + getcurrent(), # pylint:disable=undefined-variable + result, waiter)) + finally: + watcher.stop() + + def cancel_wait(self, watcher, error, close_watcher=False): + """ + Cancel an in-progress call to :meth:`wait` by throwing the given *error* + in the waiting greenlet. + + .. versionchanged:: 1.3a1 + Added the *close_watcher* parameter. If true, the watcher + will be closed after the exception is thrown. The watcher should then + be discarded. Closing the watcher is important to release native resources. + .. versionchanged:: 1.3a2 + Allow the *watcher* to be ``None``. No action is taken in that case. + """ + if watcher is None: + # Presumably already closed. + # See https://github.com/gevent/gevent/issues/1089 + return + if watcher.callback is not None: + self.loop.run_callback(self._cancel_wait, watcher, error, close_watcher) + elif close_watcher: + watcher.close() + + def _cancel_wait(self, watcher, error, close_watcher): + # We have to check again to see if it was still active by the time + # our callback actually runs. + active = watcher.active + cb = watcher.callback + if close_watcher: + watcher.close() + if active: + # The callback should be greenlet.switch(). It may or may not be None. + glet = getattr(cb, '__self__', None) + if glet is not None: + glet.throw(error) + + +class _WaitIterator(object): + + def __init__(self, objects, hub, timeout, count): + self._hub = hub + self._waiter = MultipleWaiter(hub) # pylint:disable=undefined-variable + self._switch = self._waiter.switch + self._timeout = timeout + self._objects = objects + + self._timer = None + self._begun = False + + # Even if we're only going to return 1 object, + # we must still rawlink() *all* of them, so that no + # matter which one finishes first we find it. + self._count = len(objects) if count is None else min(count, len(objects)) + + def _begin(self): + if self._begun: + return + + self._begun = True + + # XXX: If iteration doesn't actually happen, we + # could leave these links around! + for obj in self._objects: + obj.rawlink(self._switch) + + if self._timeout is not None: + self._timer = self._hub.loop.timer(self._timeout, priority=-1) + self._timer.start(self._switch, self) + + def __iter__(self): + return self + + def __next__(self): + self._begin() + + if self._count == 0: + # Exhausted + self._cleanup() + raise StopIteration() + + self._count -= 1 + try: + item = self._waiter.get() + self._waiter.clear() + if item is self: + # Timer expired, no more + self._cleanup() + raise StopIteration() + return item + except: + self._cleanup() + raise + + next = __next__ + + def _cleanup(self): + if self._timer is not None: + self._timer.close() + self._timer = None + + objs = self._objects + self._objects = () + for aobj in objs: + unlink = getattr(aobj, 'unlink', None) + if unlink is not None: + try: + unlink(self._switch) + except: # pylint:disable=bare-except + traceback.print_exc() + + def __enter__(self): + return self + + def __exit__(self, typ, value, tb): + self._cleanup() + + +def iwait_on_objects(objects, timeout=None, count=None): + """ + Iteratively yield *objects* as they are ready, until all (or *count*) are ready + or *timeout* expired. + + If you will only be consuming a portion of the *objects*, you should + do so inside a ``with`` block on this object to avoid leaking resources:: + + with gevent.iwait((a, b, c)) as it: + for i in it: + if i is a: + break + + :param objects: A sequence (supporting :func:`len`) containing objects + implementing the wait protocol (rawlink() and unlink()). + :keyword int count: If not `None`, then a number specifying the maximum number + of objects to wait for. If ``None`` (the default), all objects + are waited for. + :keyword float timeout: If given, specifies a maximum number of seconds + to wait. If the timeout expires before the desired waited-for objects + are available, then this method returns immediately. + + .. seealso:: :func:`wait` + + .. versionchanged:: 1.1a1 + Add the *count* parameter. + .. versionchanged:: 1.1a2 + No longer raise :exc:`LoopExit` if our caller switches greenlets + in between items yielded by this function. + .. versionchanged:: 1.4 + Add support to use the returned object as a context manager. + """ + # QQQ would be nice to support iterable here that can be generated slowly (why?) + hub = get_hub() + if objects is None: + return [hub.join(timeout=timeout)] + return _WaitIterator(objects, hub, timeout, count) + + +def wait_on_objects(objects=None, timeout=None, count=None): + """ + Wait for ``objects`` to become ready or for event loop to finish. + + If ``objects`` is provided, it must be a list containing objects + implementing the wait protocol (rawlink() and unlink() methods): + + - :class:`gevent.Greenlet` instance + - :class:`gevent.event.Event` instance + - :class:`gevent.lock.Semaphore` instance + - :class:`gevent.subprocess.Popen` instance + + If ``objects`` is ``None`` (the default), ``wait()`` blocks until + the current event loop has nothing to do (or until ``timeout`` passes): + + - all greenlets have finished + - all servers were stopped + - all event loop watchers were stopped. + + If ``count`` is ``None`` (the default), wait for all ``objects`` + to become ready. + + If ``count`` is a number, wait for (up to) ``count`` objects to become + ready. (For example, if count is ``1`` then the function exits + when any object in the list is ready). + + If ``timeout`` is provided, it specifies the maximum number of + seconds ``wait()`` will block. + + Returns the list of ready objects, in the order in which they were + ready. + + .. seealso:: :func:`iwait` + """ + if objects is None: + hub = get_hub() + return hub.join(timeout=timeout) # pylint:disable= + return list(iwait_on_objects(objects, timeout, count)) + +_timeout_error = Exception + +def set_default_timeout_error(e): + global _timeout_error + _timeout_error = e + +def _primitive_wait(watcher, timeout, timeout_exc, hub): + if watcher.callback is not None: + raise ConcurrentObjectUseError('This socket is already used by another greenlet: %r' + % (watcher.callback, )) + + if hub is None: + hub = get_hub() + + if timeout is None: + hub.wait(watcher) + return + + timeout = Timeout._start_new_or_dummy( + timeout, + (timeout_exc + if timeout_exc is not _NONE or timeout is None + else _timeout_error('timed out'))) + + with timeout: + hub.wait(watcher) + +# Suitable to be bound as an instance method +def wait_on_socket(socket, watcher, timeout_exc=None): + if socket is None or watcher is None: + # test__hub TestCloseSocketWhilePolling, on Python 2; Python 3 + # catches the EBADF differently. + raise ConcurrentObjectUseError("The socket has already been closed by another greenlet") + _primitive_wait(watcher, socket.timeout, + timeout_exc if timeout_exc is not None else _NONE, + socket.hub) + +def wait_on_watcher(watcher, timeout=None, timeout_exc=_NONE, hub=None): + """ + wait(watcher, timeout=None, [timeout_exc=None]) -> None + + Block the current greenlet until *watcher* is ready. + + If *timeout* is non-negative, then *timeout_exc* is raised after + *timeout* second has passed. + + If :func:`cancel_wait` is called on *io* by another greenlet, + raise an exception in this blocking greenlet + (``socket.error(EBADF, 'File descriptor was closed in another + greenlet')`` by default). + + :param io: An event loop watcher, most commonly an IO watcher obtained from + :meth:`gevent.core.loop.io` + :keyword timeout_exc: The exception to raise if the timeout expires. + By default, a :class:`socket.timeout` exception is raised. + If you pass a value for this keyword, it is interpreted as for + :class:`gevent.timeout.Timeout`. + + :raises ~gevent.hub.ConcurrentObjectUseError: If the *watcher* is + already started. + """ + _primitive_wait(watcher, timeout, timeout_exc, hub) + + +def wait_read(fileno, timeout=None, timeout_exc=_NONE): + """ + wait_read(fileno, timeout=None, [timeout_exc=None]) -> None + + Block the current greenlet until *fileno* is ready to read. + + For the meaning of the other parameters and possible exceptions, + see :func:`wait`. + + .. seealso:: :func:`cancel_wait` + """ + hub = get_hub() + io = hub.loop.io(fileno, 1) + try: + return wait_on_watcher(io, timeout, timeout_exc, hub) + finally: + io.close() + + +def wait_write(fileno, timeout=None, timeout_exc=_NONE, event=_NONE): + """ + wait_write(fileno, timeout=None, [timeout_exc=None]) -> None + + Block the current greenlet until *fileno* is ready to write. + + For the meaning of the other parameters and possible exceptions, + see :func:`wait`. + + .. deprecated:: 1.1 + The keyword argument *event* is ignored. Applications should not pass this parameter. + In the future, doing so will become an error. + + .. seealso:: :func:`cancel_wait` + """ + # pylint:disable=unused-argument + hub = get_hub() + io = hub.loop.io(fileno, 2) + try: + return wait_on_watcher(io, timeout, timeout_exc, hub) + finally: + io.close() + + +def wait_readwrite(fileno, timeout=None, timeout_exc=_NONE, event=_NONE): + """ + wait_readwrite(fileno, timeout=None, [timeout_exc=None]) -> None + + Block the current greenlet until *fileno* is ready to read or + write. + + For the meaning of the other parameters and possible exceptions, + see :func:`wait`. + + .. deprecated:: 1.1 + The keyword argument *event* is ignored. Applications should not pass this parameter. + In the future, doing so will become an error. + + .. seealso:: :func:`cancel_wait` + """ + # pylint:disable=unused-argument + hub = get_hub() + io = hub.loop.io(fileno, 3) + try: + return wait_on_watcher(io, timeout, timeout_exc, hub) + finally: + io.close() + + +def _init(): + greenlet_init() # pylint:disable=undefined-variable + +_init() + +from gevent._util import import_c_accel +import_c_accel(globals(), 'gevent.__hub_primitives') diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_ident.c b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_ident.c new file mode 100644 index 00000000..1c50a306 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_ident.c @@ -0,0 +1,5548 @@ +/* Generated by Cython 0.29.2 */ + +/* BEGIN: Cython Metadata +{ + "distutils": { + "depends": [ + "src/gevent/__ident.pxd", + "src\\gevent\\__ident.pxd" + ], + "include_dirs": [ + "C:\\Python37\\Include", + "deps" + ], + "name": "gevent.__ident", + "sources": [ + "src/gevent/_ident.py" + ] + }, + "module_name": "gevent.__ident" +} +END: Cython Metadata */ + +#define PY_SSIZE_T_CLEAN +#include "Python.h" +#ifndef Py_PYTHON_H + #error Python headers needed to compile C extensions, please install development version of Python. +#elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) + #error Cython requires Python 2.6+ or Python 3.3+. +#else +#define CYTHON_ABI "0_29_2" +#define CYTHON_HEX_VERSION 0x001D02F0 +#define CYTHON_FUTURE_DIVISION 1 +#include +#ifndef offsetof + #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) +#endif +#if !defined(WIN32) && !defined(MS_WINDOWS) + #ifndef __stdcall + #define __stdcall + #endif + #ifndef __cdecl + #define __cdecl + #endif + #ifndef __fastcall + #define __fastcall + #endif +#endif +#ifndef DL_IMPORT + #define DL_IMPORT(t) t +#endif +#ifndef DL_EXPORT + #define DL_EXPORT(t) t +#endif +#define __PYX_COMMA , +#ifndef HAVE_LONG_LONG + #if PY_VERSION_HEX >= 0x02070000 + #define HAVE_LONG_LONG + #endif +#endif +#ifndef PY_LONG_LONG + #define PY_LONG_LONG LONG_LONG +#endif +#ifndef Py_HUGE_VAL + #define Py_HUGE_VAL HUGE_VAL +#endif +#ifdef PYPY_VERSION + #define CYTHON_COMPILING_IN_PYPY 1 + #define CYTHON_COMPILING_IN_PYSTON 0 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #undef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 0 + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #if PY_VERSION_HEX < 0x03050000 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #elif !defined(CYTHON_USE_ASYNC_SLOTS) + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #undef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 0 + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #undef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 1 + #undef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 0 + #undef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 0 + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #undef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE 0 + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 +#elif defined(PYSTON_VERSION) + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_PYSTON 1 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #ifndef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 1 + #endif + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #ifndef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 1 + #endif + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #ifndef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 0 + #endif + #ifndef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 1 + #endif + #ifndef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 1 + #endif + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #undef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE 0 + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 +#else + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_PYSTON 0 + #define CYTHON_COMPILING_IN_CPYTHON 1 + #ifndef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 1 + #endif + #if PY_VERSION_HEX < 0x02070000 + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #elif !defined(CYTHON_USE_PYTYPE_LOOKUP) + #define CYTHON_USE_PYTYPE_LOOKUP 1 + #endif + #if PY_MAJOR_VERSION < 3 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #elif !defined(CYTHON_USE_ASYNC_SLOTS) + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #if PY_VERSION_HEX < 0x02070000 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #elif !defined(CYTHON_USE_PYLONG_INTERNALS) + #define CYTHON_USE_PYLONG_INTERNALS 1 + #endif + #ifndef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 1 + #endif + #ifndef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 1 + #endif + #if PY_VERSION_HEX < 0x030300F0 + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #elif !defined(CYTHON_USE_UNICODE_WRITER) + #define CYTHON_USE_UNICODE_WRITER 1 + #endif + #ifndef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 0 + #endif + #ifndef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 1 + #endif + #ifndef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 1 + #endif + #ifndef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 1 + #endif + #ifndef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 1 + #endif + #ifndef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000) + #endif + #ifndef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1) + #endif + #ifndef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1) + #endif + #ifndef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3) + #endif +#endif +#if !defined(CYTHON_FAST_PYCCALL) +#define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) +#endif +#if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #undef SHIFT + #undef BASE + #undef MASK + #ifdef SIZEOF_VOID_P + enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) }; + #endif +#endif +#ifndef __has_attribute + #define __has_attribute(x) 0 +#endif +#ifndef __has_cpp_attribute + #define __has_cpp_attribute(x) 0 +#endif +#ifndef CYTHON_RESTRICT + #if defined(__GNUC__) + #define CYTHON_RESTRICT __restrict__ + #elif defined(_MSC_VER) && _MSC_VER >= 1400 + #define CYTHON_RESTRICT __restrict + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_RESTRICT restrict + #else + #define CYTHON_RESTRICT + #endif +#endif +#ifndef CYTHON_UNUSED +# if defined(__GNUC__) +# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +#endif +#ifndef CYTHON_MAYBE_UNUSED_VAR +# if defined(__cplusplus) + template void CYTHON_MAYBE_UNUSED_VAR( const T& ) { } +# else +# define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x) +# endif +#endif +#ifndef CYTHON_NCP_UNUSED +# if CYTHON_COMPILING_IN_CPYTHON +# define CYTHON_NCP_UNUSED +# else +# define CYTHON_NCP_UNUSED CYTHON_UNUSED +# endif +#endif +#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) +#ifdef _MSC_VER + #ifndef _MSC_STDINT_H_ + #if _MSC_VER < 1300 + typedef unsigned char uint8_t; + typedef unsigned int uint32_t; + #else + typedef unsigned __int8 uint8_t; + typedef unsigned __int32 uint32_t; + #endif + #endif +#else + #include +#endif +#ifndef CYTHON_FALLTHROUGH + #if defined(__cplusplus) && __cplusplus >= 201103L + #if __has_cpp_attribute(fallthrough) + #define CYTHON_FALLTHROUGH [[fallthrough]] + #elif __has_cpp_attribute(clang::fallthrough) + #define CYTHON_FALLTHROUGH [[clang::fallthrough]] + #elif __has_cpp_attribute(gnu::fallthrough) + #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] + #endif + #endif + #ifndef CYTHON_FALLTHROUGH + #if __has_attribute(fallthrough) + #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) + #else + #define CYTHON_FALLTHROUGH + #endif + #endif + #if defined(__clang__ ) && defined(__apple_build_version__) + #if __apple_build_version__ < 7000000 + #undef CYTHON_FALLTHROUGH + #define CYTHON_FALLTHROUGH + #endif + #endif +#endif + +#ifndef CYTHON_INLINE + #if defined(__clang__) + #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) + #elif defined(__GNUC__) + #define CYTHON_INLINE __inline__ + #elif defined(_MSC_VER) + #define CYTHON_INLINE __inline + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_INLINE inline + #else + #define CYTHON_INLINE + #endif +#endif + +#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) + #define Py_OptimizeFlag 0 +#endif +#define __PYX_BUILD_PY_SSIZE_T "n" +#define CYTHON_FORMAT_SSIZE_T "z" +#if PY_MAJOR_VERSION < 3 + #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyClass_Type +#else + #define __Pyx_BUILTIN_MODULE_NAME "builtins" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyType_Type +#endif +#ifndef Py_TPFLAGS_CHECKTYPES + #define Py_TPFLAGS_CHECKTYPES 0 +#endif +#ifndef Py_TPFLAGS_HAVE_INDEX + #define Py_TPFLAGS_HAVE_INDEX 0 +#endif +#ifndef Py_TPFLAGS_HAVE_NEWBUFFER + #define Py_TPFLAGS_HAVE_NEWBUFFER 0 +#endif +#ifndef Py_TPFLAGS_HAVE_FINALIZE + #define Py_TPFLAGS_HAVE_FINALIZE 0 +#endif +#ifndef METH_STACKLESS + #define METH_STACKLESS 0 +#endif +#if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) + #ifndef METH_FASTCALL + #define METH_FASTCALL 0x80 + #endif + typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs); + typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args, + Py_ssize_t nargs, PyObject *kwnames); +#else + #define __Pyx_PyCFunctionFast _PyCFunctionFast + #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords +#endif +#if CYTHON_FAST_PYCCALL +#define __Pyx_PyFastCFunction_Check(func)\ + ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS))))) +#else +#define __Pyx_PyFastCFunction_Check(func) 0 +#endif +#if CYTHON_USE_DICT_VERSIONS +#define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) +#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ + (version_var) = __PYX_GET_DICT_VERSION(dict);\ + (cache_var) = (value); +#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ + static PY_UINT64_T __pyx_dict_version = 0;\ + static PyObject *__pyx_dict_cached_value = NULL;\ + if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ + (VAR) = __pyx_dict_cached_value;\ + } else {\ + (VAR) = __pyx_dict_cached_value = (LOOKUP);\ + __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ + }\ + } +#else +#define __PYX_GET_DICT_VERSION(dict) (0) +#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) +#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) + #define PyObject_Malloc(s) PyMem_Malloc(s) + #define PyObject_Free(p) PyMem_Free(p) + #define PyObject_Realloc(p) PyMem_Realloc(p) +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1 + #define PyMem_RawMalloc(n) PyMem_Malloc(n) + #define PyMem_RawRealloc(p, n) PyMem_Realloc(p, n) + #define PyMem_RawFree(p) PyMem_Free(p) +#endif +#if CYTHON_COMPILING_IN_PYSTON + #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co) + #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno) +#else + #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) + #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) +#endif +#if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000 + #define __Pyx_PyThreadState_Current PyThreadState_GET() +#elif PY_VERSION_HEX >= 0x03060000 + #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() +#elif PY_VERSION_HEX >= 0x03000000 + #define __Pyx_PyThreadState_Current PyThreadState_GET() +#else + #define __Pyx_PyThreadState_Current _PyThreadState_Current +#endif +#if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) +#include "pythread.h" +#define Py_tss_NEEDS_INIT 0 +typedef int Py_tss_t; +static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) { + *key = PyThread_create_key(); + return 0; // PyThread_create_key reports success always +} +static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) { + Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t)); + *key = Py_tss_NEEDS_INIT; + return key; +} +static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) { + PyObject_Free(key); +} +static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) { + return *key != Py_tss_NEEDS_INIT; +} +static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) { + PyThread_delete_key(*key); + *key = Py_tss_NEEDS_INIT; +} +static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) { + return PyThread_set_key_value(*key, value); +} +static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { + return PyThread_get_key_value(*key); +} +#endif // TSS (Thread Specific Storage) API +#if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized) +#define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) +#else +#define __Pyx_PyDict_NewPresized(n) PyDict_New() +#endif +#if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION + #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) +#else + #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS +#define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) +#else +#define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name) +#endif +#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) + #define CYTHON_PEP393_ENABLED 1 + #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ + 0 : _PyUnicode_Ready((PyObject *)(op))) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) + #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) + #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) + #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) + #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) + #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch) + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) +#else + #define CYTHON_PEP393_ENABLED 0 + #define PyUnicode_1BYTE_KIND 1 + #define PyUnicode_2BYTE_KIND 2 + #define PyUnicode_4BYTE_KIND 4 + #define __Pyx_PyUnicode_READY(op) (0) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) + #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111) + #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) + #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) + #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) + #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch) + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) +#endif +#if CYTHON_COMPILING_IN_PYPY + #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) +#else + #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ + PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains) + #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check) + #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format) + #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) +#endif +#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) +#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) +#else + #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) +#endif +#if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) + #define PyObject_ASCII(o) PyObject_Repr(o) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBaseString_Type PyUnicode_Type + #define PyStringObject PyUnicodeObject + #define PyString_Type PyUnicode_Type + #define PyString_Check PyUnicode_Check + #define PyString_CheckExact PyUnicode_CheckExact + #define PyObject_Unicode PyObject_Str +#endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) + #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) +#else + #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) + #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) +#endif +#ifndef PySet_CheckExact + #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) +#endif +#if CYTHON_ASSUME_SAFE_MACROS + #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) +#else + #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyIntObject PyLongObject + #define PyInt_Type PyLong_Type + #define PyInt_Check(op) PyLong_Check(op) + #define PyInt_CheckExact(op) PyLong_CheckExact(op) + #define PyInt_FromString PyLong_FromString + #define PyInt_FromUnicode PyLong_FromUnicode + #define PyInt_FromLong PyLong_FromLong + #define PyInt_FromSize_t PyLong_FromSize_t + #define PyInt_FromSsize_t PyLong_FromSsize_t + #define PyInt_AsLong PyLong_AsLong + #define PyInt_AS_LONG PyLong_AS_LONG + #define PyInt_AsSsize_t PyLong_AsSsize_t + #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask + #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask + #define PyNumber_Int PyNumber_Long +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBoolObject PyLongObject +#endif +#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY + #ifndef PyUnicode_InternFromString + #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) + #endif +#endif +#if PY_VERSION_HEX < 0x030200A4 + typedef long Py_hash_t; + #define __Pyx_PyInt_FromHash_t PyInt_FromLong + #define __Pyx_PyInt_AsHash_t PyInt_AsLong +#else + #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t + #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t +#endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : (Py_INCREF(func), func)) +#else + #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) +#endif +#if CYTHON_USE_ASYNC_SLOTS + #if PY_VERSION_HEX >= 0x030500B1 + #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods + #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) + #else + #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) + #endif +#else + #define __Pyx_PyType_AsAsync(obj) NULL +#endif +#ifndef __Pyx_PyAsyncMethodsStruct + typedef struct { + unaryfunc am_await; + unaryfunc am_aiter; + unaryfunc am_anext; + } __Pyx_PyAsyncMethodsStruct; +#endif + +#if defined(WIN32) || defined(MS_WINDOWS) + #define _USE_MATH_DEFINES +#endif +#include +#ifdef NAN +#define __PYX_NAN() ((float) NAN) +#else +static CYTHON_INLINE float __PYX_NAN() { + float value; + memset(&value, 0xFF, sizeof(value)); + return value; +} +#endif +#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) +#define __Pyx_truncl trunc +#else +#define __Pyx_truncl truncl +#endif + + +#define __PYX_ERR(f_index, lineno, Ln_error) \ +{ \ + __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \ +} + +#ifndef __PYX_EXTERN_C + #ifdef __cplusplus + #define __PYX_EXTERN_C extern "C" + #else + #define __PYX_EXTERN_C extern + #endif +#endif + +#define __PYX_HAVE__gevent____ident +#define __PYX_HAVE_API__gevent____ident +/* Early includes */ +#ifdef _OPENMP +#include +#endif /* _OPENMP */ + +#if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) +#define CYTHON_WITHOUT_ASSERTIONS +#endif + +typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; + const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; + +#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 +#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0 +#define __PYX_DEFAULT_STRING_ENCODING "" +#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString +#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#define __Pyx_uchar_cast(c) ((unsigned char)c) +#define __Pyx_long_cast(x) ((long)x) +#define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ + (sizeof(type) < sizeof(Py_ssize_t)) ||\ + (sizeof(type) > sizeof(Py_ssize_t) &&\ + likely(v < (type)PY_SSIZE_T_MAX ||\ + v == (type)PY_SSIZE_T_MAX) &&\ + (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ + v == (type)PY_SSIZE_T_MIN))) ||\ + (sizeof(type) == sizeof(Py_ssize_t) &&\ + (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ + v == (type)PY_SSIZE_T_MAX))) ) +static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) { + return (size_t) i < (size_t) limit; +} +#if defined (__cplusplus) && __cplusplus >= 201103L + #include + #define __Pyx_sst_abs(value) std::abs(value) +#elif SIZEOF_INT >= SIZEOF_SIZE_T + #define __Pyx_sst_abs(value) abs(value) +#elif SIZEOF_LONG >= SIZEOF_SIZE_T + #define __Pyx_sst_abs(value) labs(value) +#elif defined (_MSC_VER) + #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) +#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define __Pyx_sst_abs(value) llabs(value) +#elif defined (__GNUC__) + #define __Pyx_sst_abs(value) __builtin_llabs(value) +#else + #define __Pyx_sst_abs(value) ((value<0) ? -value : value) +#endif +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*); +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); +#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) +#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) +#define __Pyx_PyBytes_FromString PyBytes_FromString +#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); +#if PY_MAJOR_VERSION < 3 + #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#else + #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize +#endif +#define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) +#define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) +#define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) +#define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) +#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) +static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) { + const Py_UNICODE *u_end = u; + while (*u_end++) ; + return (size_t)(u_end - u - 1); +} +#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) +#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode +#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode +#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) +#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) +static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); +static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*); +static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); +#define __Pyx_PySequence_Tuple(obj)\ + (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); +#if CYTHON_ASSUME_SAFE_MACROS +#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) +#else +#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) +#endif +#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) +#if PY_MAJOR_VERSION >= 3 +#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) +#else +#define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) +#endif +#define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x)) +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII +static int __Pyx_sys_getdefaultencoding_not_ascii; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + PyObject* ascii_chars_u = NULL; + PyObject* ascii_chars_b = NULL; + const char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + if (strcmp(default_encoding_c, "ascii") == 0) { + __Pyx_sys_getdefaultencoding_not_ascii = 0; + } else { + char ascii_chars[128]; + int c; + for (c = 0; c < 128; c++) { + ascii_chars[c] = c; + } + __Pyx_sys_getdefaultencoding_not_ascii = 1; + ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); + if (!ascii_chars_u) goto bad; + ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); + if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { + PyErr_Format( + PyExc_ValueError, + "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", + default_encoding_c); + goto bad; + } + Py_DECREF(ascii_chars_u); + Py_DECREF(ascii_chars_b); + } + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + Py_XDECREF(ascii_chars_u); + Py_XDECREF(ascii_chars_b); + return -1; +} +#endif +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) +#else +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +static char* __PYX_DEFAULT_STRING_ENCODING; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1); + if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; + strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + return -1; +} +#endif +#endif + + +/* Test for GCC > 2.95 */ +#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) + #define likely(x) __builtin_expect(!!(x), 1) + #define unlikely(x) __builtin_expect(!!(x), 0) +#else /* !__GNUC__ or GCC < 2.95 */ + #define likely(x) (x) + #define unlikely(x) (x) +#endif /* __GNUC__ */ +static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } + +static PyObject *__pyx_m = NULL; +static PyObject *__pyx_d; +static PyObject *__pyx_b; +static PyObject *__pyx_cython_runtime = NULL; +static PyObject *__pyx_empty_tuple; +static PyObject *__pyx_empty_bytes; +static PyObject *__pyx_empty_unicode; +static int __pyx_lineno; +static int __pyx_clineno = 0; +static const char * __pyx_cfilenm= __FILE__; +static const char *__pyx_filename; + + +static const char *__pyx_f[] = { + "src\\gevent\\_ident.py", + "src\\gevent\\__ident.pxd", +}; + +/*--- Type declarations ---*/ +struct __pyx_obj_6gevent_7__ident_ValuedWeakRef; +struct __pyx_obj_6gevent_7__ident_IdentRegistry; + +/* "gevent/__ident.pxd":15 + * @cython.internal + * @cython.final + * cdef class ValuedWeakRef(ref): # <<<<<<<<<<<<<< + * cdef object value + * + */ +struct __pyx_obj_6gevent_7__ident_ValuedWeakRef { + PyWeakReference __pyx_base; + PyObject *value; +}; + + +/* "gevent/__ident.pxd":19 + * + * @cython.final + * cdef class IdentRegistry: # <<<<<<<<<<<<<< + * cdef object _registry + * cdef list _available_idents + */ +struct __pyx_obj_6gevent_7__ident_IdentRegistry { + PyObject_HEAD + struct __pyx_vtabstruct_6gevent_7__ident_IdentRegistry *__pyx_vtab; + PyObject *_registry; + PyObject *_available_idents; +}; + + + +/* "src/gevent/_ident.py":28 + * + * + * class IdentRegistry(object): # <<<<<<<<<<<<<< + * """ + * Maintains a unique mapping of (small) positive integer identifiers + */ + +struct __pyx_vtabstruct_6gevent_7__ident_IdentRegistry { + PyObject *(*get_ident)(struct __pyx_obj_6gevent_7__ident_IdentRegistry *, PyObject *, int __pyx_skip_dispatch); + PyObject *(*_return_ident)(struct __pyx_obj_6gevent_7__ident_IdentRegistry *, struct __pyx_obj_6gevent_7__ident_ValuedWeakRef *, int __pyx_skip_dispatch); +}; +static struct __pyx_vtabstruct_6gevent_7__ident_IdentRegistry *__pyx_vtabptr_6gevent_7__ident_IdentRegistry; +static PyObject *__pyx_f_6gevent_7__ident_13IdentRegistry_get_ident(struct __pyx_obj_6gevent_7__ident_IdentRegistry *, PyObject *, int __pyx_skip_dispatch); +static PyObject *__pyx_f_6gevent_7__ident_13IdentRegistry__return_ident(struct __pyx_obj_6gevent_7__ident_IdentRegistry *, struct __pyx_obj_6gevent_7__ident_ValuedWeakRef *, int __pyx_skip_dispatch); + +/* --- Runtime support code (head) --- */ +/* Refnanny.proto */ +#ifndef CYTHON_REFNANNY + #define CYTHON_REFNANNY 0 +#endif +#if CYTHON_REFNANNY + typedef struct { + void (*INCREF)(void*, PyObject*, int); + void (*DECREF)(void*, PyObject*, int); + void (*GOTREF)(void*, PyObject*, int); + void (*GIVEREF)(void*, PyObject*, int); + void* (*SetupContext)(const char*, int, const char*); + void (*FinishContext)(void**); + } __Pyx_RefNannyAPIStruct; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); + #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; +#ifdef WITH_THREAD + #define __Pyx_RefNannySetupContext(name, acquire_gil)\ + if (acquire_gil) {\ + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ + PyGILState_Release(__pyx_gilstate_save);\ + } else {\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ + } +#else + #define __Pyx_RefNannySetupContext(name, acquire_gil)\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) +#endif + #define __Pyx_RefNannyFinishContext()\ + __Pyx_RefNanny->FinishContext(&__pyx_refnanny) + #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0) + #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) + #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) + #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) +#else + #define __Pyx_RefNannyDeclarations + #define __Pyx_RefNannySetupContext(name, acquire_gil) + #define __Pyx_RefNannyFinishContext() + #define __Pyx_INCREF(r) Py_INCREF(r) + #define __Pyx_DECREF(r) Py_DECREF(r) + #define __Pyx_GOTREF(r) + #define __Pyx_GIVEREF(r) + #define __Pyx_XINCREF(r) Py_XINCREF(r) + #define __Pyx_XDECREF(r) Py_XDECREF(r) + #define __Pyx_XGOTREF(r) + #define __Pyx_XGIVEREF(r) +#endif +#define __Pyx_XDECREF_SET(r, v) do {\ + PyObject *tmp = (PyObject *) r;\ + r = v; __Pyx_XDECREF(tmp);\ + } while (0) +#define __Pyx_DECREF_SET(r, v) do {\ + PyObject *tmp = (PyObject *) r;\ + r = v; __Pyx_DECREF(tmp);\ + } while (0) +#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) +#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) + +/* PyObjectGetAttrStr.proto */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); +#else +#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) +#endif + +/* GetBuiltinName.proto */ +static PyObject *__Pyx_GetBuiltinName(PyObject *name); + +/* RaiseArgTupleInvalid.proto */ +static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, + Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); + +/* KeywordStringCheck.proto */ +static int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* function_name, int kw_allowed); + +/* PyFunctionFastCall.proto */ +#if CYTHON_FAST_PYCALL +#define __Pyx_PyFunction_FastCall(func, args, nargs)\ + __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) +#if 1 || PY_VERSION_HEX < 0x030600B1 +static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs); +#else +#define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs) +#endif +#define __Pyx_BUILD_ASSERT_EXPR(cond)\ + (sizeof(char [1 - 2*!(cond)]) - 1) +#ifndef Py_MEMBER_SIZE +#define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member) +#endif + static size_t __pyx_pyframe_localsplus_offset = 0; + #include "frameobject.h" + #define __Pxy_PyFrame_Initialize_Offsets()\ + ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\ + (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus))) + #define __Pyx_PyFrame_GetLocalsplus(frame)\ + (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset)) +#endif + +/* PyObjectCall.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); +#else +#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) +#endif + +/* PyObjectCallMethO.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); +#endif + +/* PyObjectCallNoArg.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); +#else +#define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL) +#endif + +/* PyCFunctionFastCall.proto */ +#if CYTHON_FAST_PYCCALL +static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs); +#else +#define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL) +#endif + +/* PyObjectCallOneArg.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); + +/* GetItemInt.proto */ +#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ + __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\ + (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\ + __Pyx_GetItemInt_Generic(o, to_py_func(i)))) +#define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ + __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ + (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL)) +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, + int wraparound, int boundscheck); +#define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ + __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ + (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL)) +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, + int wraparound, int boundscheck); +static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j); +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, + int is_list, int wraparound, int boundscheck); + +/* ObjectGetItem.proto */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key); +#else +#define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key) +#endif + +/* GetTopmostException.proto */ +#if CYTHON_USE_EXC_INFO_STACK +static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate); +#endif + +/* PyThreadStateGet.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; +#define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; +#define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type +#else +#define __Pyx_PyThreadState_declare +#define __Pyx_PyThreadState_assign +#define __Pyx_PyErr_Occurred() PyErr_Occurred() +#endif + +/* SaveResetException.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); +#else +#define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb) +#define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb) +#endif + +/* PyErrExceptionMatches.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) +static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); +#else +#define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) +#endif + +/* PyErrFetchRestore.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) +#define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) +#define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) +#define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) +#define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); +static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) +#else +#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) +#endif +#else +#define __Pyx_PyErr_Clear() PyErr_Clear() +#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) +#define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) +#define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb) +#define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) +#endif + +/* PyObjectCall2Args.proto */ +static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2); + +/* ArgTypeTest.proto */ +#define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\ + ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\ + __Pyx__ArgTypeTest(obj, type, name, exact)) +static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact); + +/* CallNextTpDealloc.proto */ +static void __Pyx_call_next_tp_dealloc(PyObject* obj, destructor current_tp_dealloc); + +/* CallNextTpTraverse.proto */ +static int __Pyx_call_next_tp_traverse(PyObject* obj, visitproc v, void *a, traverseproc current_tp_traverse); + +/* CallNextTpClear.proto */ +static void __Pyx_call_next_tp_clear(PyObject* obj, inquiry current_tp_dealloc); + +/* TypeImport.proto */ +#ifndef __PYX_HAVE_RT_ImportType_proto +#define __PYX_HAVE_RT_ImportType_proto +enum __Pyx_ImportType_CheckSize { + __Pyx_ImportType_CheckSize_Error = 0, + __Pyx_ImportType_CheckSize_Warn = 1, + __Pyx_ImportType_CheckSize_Ignore = 2 +}; +static PyTypeObject *__Pyx_ImportType(PyObject* module, const char *module_name, const char *class_name, size_t size, enum __Pyx_ImportType_CheckSize check_size); +#endif + +/* PyObject_GenericGetAttrNoDict.proto */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name); +#else +#define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr +#endif + +/* SetVTable.proto */ +static int __Pyx_SetVtable(PyObject *dict, void *vtable); + +/* Import.proto */ +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); + +/* ImportFrom.proto */ +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); + +/* FetchCommonType.proto */ +static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); + +/* CythonFunction.proto */ +#define __Pyx_CyFunction_USED 1 +#define __Pyx_CYFUNCTION_STATICMETHOD 0x01 +#define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 +#define __Pyx_CYFUNCTION_CCLASS 0x04 +#define __Pyx_CyFunction_GetClosure(f)\ + (((__pyx_CyFunctionObject *) (f))->func_closure) +#define __Pyx_CyFunction_GetClassObj(f)\ + (((__pyx_CyFunctionObject *) (f))->func_classobj) +#define __Pyx_CyFunction_Defaults(type, f)\ + ((type *)(((__pyx_CyFunctionObject *) (f))->defaults)) +#define __Pyx_CyFunction_SetDefaultsGetter(f, g)\ + ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g) +typedef struct { + PyCFunctionObject func; +#if PY_VERSION_HEX < 0x030500A0 + PyObject *func_weakreflist; +#endif + PyObject *func_dict; + PyObject *func_name; + PyObject *func_qualname; + PyObject *func_doc; + PyObject *func_globals; + PyObject *func_code; + PyObject *func_closure; + PyObject *func_classobj; + void *defaults; + int defaults_pyobjects; + int flags; + PyObject *defaults_tuple; + PyObject *defaults_kwdict; + PyObject *(*defaults_getter)(PyObject *); + PyObject *func_annotations; +} __pyx_CyFunctionObject; +static PyTypeObject *__pyx_CyFunctionType = 0; +#define __Pyx_CyFunction_Check(obj) (__Pyx_TypeCheck(obj, __pyx_CyFunctionType)) +#define __Pyx_CyFunction_NewEx(ml, flags, qualname, self, module, globals, code)\ + __Pyx_CyFunction_New(__pyx_CyFunctionType, ml, flags, qualname, self, module, globals, code) +static PyObject *__Pyx_CyFunction_New(PyTypeObject *, PyMethodDef *ml, + int flags, PyObject* qualname, + PyObject *self, + PyObject *module, PyObject *globals, + PyObject* code); +static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, + size_t size, + int pyobjects); +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, + PyObject *tuple); +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, + PyObject *dict); +static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m, + PyObject *dict); +static int __pyx_CyFunction_init(void); + +/* GetModuleGlobalName.proto */ +#if CYTHON_USE_DICT_VERSIONS +#define __Pyx_GetModuleGlobalName(var, name) {\ + static PY_UINT64_T __pyx_dict_version = 0;\ + static PyObject *__pyx_dict_cached_value = NULL;\ + (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\ + (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\ + __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ +} +#define __Pyx_GetModuleGlobalNameUncached(var, name) {\ + PY_UINT64_T __pyx_dict_version;\ + PyObject *__pyx_dict_cached_value;\ + (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ +} +static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value); +#else +#define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name) +#define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name) +static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name); +#endif + +/* GetAttr.proto */ +static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *); + +/* Globals.proto */ +static PyObject* __Pyx_Globals(void); + +/* CLineInTraceback.proto */ +#ifdef CYTHON_CLINE_IN_TRACEBACK +#define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) +#else +static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line); +#endif + +/* CodeObjectCache.proto */ +typedef struct { + PyCodeObject* code_object; + int code_line; +} __Pyx_CodeObjectCacheEntry; +struct __Pyx_CodeObjectCache { + int count; + int max_count; + __Pyx_CodeObjectCacheEntry* entries; +}; +static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); +static PyCodeObject *__pyx_find_code_object(int code_line); +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); + +/* AddTraceback.proto */ +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename); + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); + +/* CIntFromPy.proto */ +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); + +/* CIntFromPy.proto */ +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); + +/* FastTypeChecks.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) +static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b); +static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type); +static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2); +#else +#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) +#define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) +#define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) +#endif +#define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) + +/* CheckBinaryVersion.proto */ +static int __Pyx_check_binary_version(void); + +/* PyObjectSetAttrStr.proto */ +#if CYTHON_USE_TYPE_SLOTS +#define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o, n, NULL) +static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value); +#else +#define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n) +#define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v) +#endif + +/* VoidPtrExport.proto */ +static int __Pyx_ExportVoidPtr(PyObject *name, void *p, const char *sig); + +/* InitStrings.proto */ +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); + +static PyObject *__pyx_f_6gevent_7__ident_13IdentRegistry_get_ident(struct __pyx_obj_6gevent_7__ident_IdentRegistry *__pyx_v_self, PyObject *__pyx_v_obj, CYTHON_UNUSED int __pyx_skip_dispatch); /* proto*/ +static PyObject *__pyx_f_6gevent_7__ident_13IdentRegistry__return_ident(struct __pyx_obj_6gevent_7__ident_IdentRegistry *__pyx_v_self, struct __pyx_obj_6gevent_7__ident_ValuedWeakRef *__pyx_v_vref, CYTHON_UNUSED int __pyx_skip_dispatch); /* proto*/ + +/* Module declarations from 'cython' */ + +/* Module declarations from 'weakref' */ + +/* Module declarations from 'gevent.__ident' */ +static PyTypeObject *__pyx_ptype_6gevent_7__ident_ref = 0; +static PyTypeObject *__pyx_ptype_6gevent_7__ident_ValuedWeakRef = 0; +static PyTypeObject *__pyx_ptype_6gevent_7__ident_IdentRegistry = 0; +static PyObject *__pyx_v_6gevent_7__ident_heappop = 0; +static PyObject *__pyx_v_6gevent_7__ident_heappush = 0; +static PyObject *__pyx_v_6gevent_7__ident_WeakKeyDictionary = 0; +#define __Pyx_MODULE_NAME "gevent.__ident" +extern int __pyx_module_is_main_gevent____ident; +int __pyx_module_is_main_gevent____ident = 0; + +/* Implementation of 'gevent.__ident' */ +static PyObject *__pyx_builtin_KeyError; +static const char __pyx_k_all[] = "__all__"; +static const char __pyx_k_obj[] = "obj"; +static const char __pyx_k_ref[] = "ref"; +static const char __pyx_k_main[] = "__main__"; +static const char __pyx_k_name[] = "__name__"; +static const char __pyx_k_self[] = "self"; +static const char __pyx_k_test[] = "__test__"; +static const char __pyx_k_vref[] = "vref"; +static const char __pyx_k_heapq[] = "heapq"; +static const char __pyx_k_slots[] = "__slots__"; +static const char __pyx_k_value[] = "value"; +static const char __pyx_k_import[] = "__import__"; +static const char __pyx_k_heappop[] = "heappop"; +static const char __pyx_k_weakref[] = "weakref"; +static const char __pyx_k_KeyError[] = "KeyError"; +static const char __pyx_k_heappush[] = "heappush"; +static const char __pyx_k_pyx_capi[] = "__pyx_capi__"; +static const char __pyx_k_get_ident[] = "get_ident"; +static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__"; +static const char __pyx_k_gevent__util[] = "gevent._util"; +static const char __pyx_k_return_ident[] = "_return_ident"; +static const char __pyx_k_IdentRegistry[] = "IdentRegistry"; +static const char __pyx_k_ValuedWeakRef[] = "ValuedWeakRef"; +static const char __pyx_k_gevent___ident[] = "gevent.__ident"; +static const char __pyx_k_import_c_accel[] = "import_c_accel"; +static const char __pyx_k_WeakKeyDictionary[] = "WeakKeyDictionary"; +static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; +static const char __pyx_k_src_gevent__ident_py[] = "src\\gevent\\_ident.py"; +static const char __pyx_k_IdentRegistry_get_ident[] = "IdentRegistry.get_ident"; +static const char __pyx_k_IdentRegistry__return_ident[] = "IdentRegistry._return_ident"; +static PyObject *__pyx_n_s_IdentRegistry; +static PyObject *__pyx_n_s_IdentRegistry__return_ident; +static PyObject *__pyx_n_s_IdentRegistry_get_ident; +static PyObject *__pyx_n_s_KeyError; +static PyObject *__pyx_n_s_ValuedWeakRef; +static PyObject *__pyx_n_s_WeakKeyDictionary; +static PyObject *__pyx_n_s_all; +static PyObject *__pyx_n_s_cline_in_traceback; +static PyObject *__pyx_n_s_get_ident; +static PyObject *__pyx_n_s_gevent___ident; +static PyObject *__pyx_n_s_gevent__util; +static PyObject *__pyx_n_s_heappop; +static PyObject *__pyx_n_s_heappush; +static PyObject *__pyx_n_s_heapq; +static PyObject *__pyx_n_s_import; +static PyObject *__pyx_n_s_import_c_accel; +static PyObject *__pyx_n_s_main; +static PyObject *__pyx_n_s_name; +static PyObject *__pyx_n_s_obj; +static PyObject *__pyx_n_s_pyx_capi; +static PyObject *__pyx_n_s_pyx_vtable; +static PyObject *__pyx_n_s_ref; +static PyObject *__pyx_n_s_return_ident; +static PyObject *__pyx_n_s_self; +static PyObject *__pyx_n_s_slots; +static PyObject *__pyx_kp_s_src_gevent__ident_py; +static PyObject *__pyx_n_s_test; +static PyObject *__pyx_n_s_value; +static PyObject *__pyx_n_s_vref; +static PyObject *__pyx_n_s_weakref; +static int __pyx_pf_6gevent_7__ident_13IdentRegistry___init__(struct __pyx_obj_6gevent_7__ident_IdentRegistry *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_7__ident_13IdentRegistry_2get_ident(struct __pyx_obj_6gevent_7__ident_IdentRegistry *__pyx_v_self, PyObject *__pyx_v_obj); /* proto */ +static PyObject *__pyx_pf_6gevent_7__ident_13IdentRegistry_4_return_ident(struct __pyx_obj_6gevent_7__ident_IdentRegistry *__pyx_v_self, struct __pyx_obj_6gevent_7__ident_ValuedWeakRef *__pyx_v_vref); /* proto */ +static Py_ssize_t __pyx_pf_6gevent_7__ident_13IdentRegistry_6__len__(struct __pyx_obj_6gevent_7__ident_IdentRegistry *__pyx_v_self); /* proto */ +static PyObject *__pyx_tp_new_6gevent_7__ident_ValuedWeakRef(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6gevent_7__ident_IdentRegistry(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tuple_; +static PyObject *__pyx_tuple__2; +static PyObject *__pyx_tuple__4; +static PyObject *__pyx_codeobj__3; +static PyObject *__pyx_codeobj__5; +/* Late includes */ + +/* "src/gevent/_ident.py":38 + * """ + * + * def __init__(self): # <<<<<<<<<<<<<< + * # {obj -> (ident, wref(obj))} + * self._registry = WeakKeyDictionary() + */ + +/* Python wrapper */ +static int __pyx_pw_6gevent_7__ident_13IdentRegistry_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6gevent_7__ident_13IdentRegistry_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { + __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;} + if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1; + __pyx_r = __pyx_pf_6gevent_7__ident_13IdentRegistry___init__(((struct __pyx_obj_6gevent_7__ident_IdentRegistry *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_7__ident_13IdentRegistry___init__(struct __pyx_obj_6gevent_7__ident_IdentRegistry *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "src/gevent/_ident.py":40 + * def __init__(self): + * # {obj -> (ident, wref(obj))} + * self._registry = WeakKeyDictionary() # <<<<<<<<<<<<<< + * + * # A heap of numbers that have been used and returned + */ + __Pyx_INCREF(__pyx_v_6gevent_7__ident_WeakKeyDictionary); + __pyx_t_2 = __pyx_v_6gevent_7__ident_WeakKeyDictionary; __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 40, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_self->_registry); + __Pyx_DECREF(__pyx_v_self->_registry); + __pyx_v_self->_registry = __pyx_t_1; + __pyx_t_1 = 0; + + /* "src/gevent/_ident.py":43 + * + * # A heap of numbers that have been used and returned + * self._available_idents = [] # <<<<<<<<<<<<<< + * + * def get_ident(self, obj): + */ + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 43, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_self->_available_idents); + __Pyx_DECREF(__pyx_v_self->_available_idents); + __pyx_v_self->_available_idents = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "src/gevent/_ident.py":38 + * """ + * + * def __init__(self): # <<<<<<<<<<<<<< + * # {obj -> (ident, wref(obj))} + * self._registry = WeakKeyDictionary() + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("gevent.__ident.IdentRegistry.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_ident.py":45 + * self._available_idents = [] + * + * def get_ident(self, obj): # <<<<<<<<<<<<<< + * """ + * Retrieve the identifier for *obj*, creating one + */ + +static PyObject *__pyx_pw_6gevent_7__ident_13IdentRegistry_3get_ident(PyObject *__pyx_v_self, PyObject *__pyx_v_obj); /*proto*/ +static PyObject *__pyx_f_6gevent_7__ident_13IdentRegistry_get_ident(struct __pyx_obj_6gevent_7__ident_IdentRegistry *__pyx_v_self, PyObject *__pyx_v_obj, CYTHON_UNUSED int __pyx_skip_dispatch) { + PyObject *__pyx_v_ident = NULL; + struct __pyx_obj_6gevent_7__ident_ValuedWeakRef *__pyx_v_vref = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + Py_ssize_t __pyx_t_9; + __Pyx_RefNannySetupContext("get_ident", 0); + + /* "src/gevent/_ident.py":51 + * """ + * + * try: # <<<<<<<<<<<<<< + * return self._registry[obj][0] + * except KeyError: + */ + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "src/gevent/_ident.py":52 + * + * try: + * return self._registry[obj][0] # <<<<<<<<<<<<<< + * except KeyError: + * pass + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_v_self->_registry, __pyx_v_obj); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 52, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_4, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 52, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L7_try_return; + + /* "src/gevent/_ident.py":51 + * """ + * + * try: # <<<<<<<<<<<<<< + * return self._registry[obj][0] + * except KeyError: + */ + } + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "src/gevent/_ident.py":53 + * try: + * return self._registry[obj][0] + * except KeyError: # <<<<<<<<<<<<<< + * pass + * + */ + __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError); + if (__pyx_t_6) { + __Pyx_ErrRestore(0,0,0); + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + + /* "src/gevent/_ident.py":51 + * """ + * + * try: # <<<<<<<<<<<<<< + * return self._registry[obj][0] + * except KeyError: + */ + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + } + + /* "src/gevent/_ident.py":56 + * pass + * + * if self._available_idents: # <<<<<<<<<<<<<< + * # Take the smallest free number + * ident = heappop(self._available_idents) + */ + __pyx_t_7 = (__pyx_v_self->_available_idents != Py_None)&&(PyList_GET_SIZE(__pyx_v_self->_available_idents) != 0); + if (__pyx_t_7) { + + /* "src/gevent/_ident.py":58 + * if self._available_idents: + * # Take the smallest free number + * ident = heappop(self._available_idents) # <<<<<<<<<<<<<< + * else: + * # Allocate a bigger one + */ + __Pyx_INCREF(__pyx_v_6gevent_7__ident_heappop); + __pyx_t_4 = __pyx_v_6gevent_7__ident_heappop; __pyx_t_8 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_8)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_8); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + } + } + __pyx_t_5 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_8, __pyx_v_self->_available_idents) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_self->_available_idents); + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 58, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_ident = __pyx_t_5; + __pyx_t_5 = 0; + + /* "src/gevent/_ident.py":56 + * pass + * + * if self._available_idents: # <<<<<<<<<<<<<< + * # Take the smallest free number + * ident = heappop(self._available_idents) + */ + goto __pyx_L9; + } + + /* "src/gevent/_ident.py":61 + * else: + * # Allocate a bigger one + * ident = len(self._registry) # <<<<<<<<<<<<<< + * + * vref = ValuedWeakRef(obj, self._return_ident) + */ + /*else*/ { + __pyx_t_5 = __pyx_v_self->_registry; + __Pyx_INCREF(__pyx_t_5); + __pyx_t_9 = PyObject_Length(__pyx_t_5); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 61, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyInt_FromSsize_t(__pyx_t_9); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 61, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_v_ident = __pyx_t_5; + __pyx_t_5 = 0; + } + __pyx_L9:; + + /* "src/gevent/_ident.py":63 + * ident = len(self._registry) + * + * vref = ValuedWeakRef(obj, self._return_ident) # <<<<<<<<<<<<<< + * vref.value = ident # pylint:disable=assigning-non-slot,attribute-defined-outside-init + * self._registry[obj] = (ident, vref) + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_return_ident); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 63, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 63, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_obj); + __Pyx_GIVEREF(__pyx_v_obj); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_obj); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6gevent_7__ident_ValuedWeakRef), __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 63, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_vref = ((struct __pyx_obj_6gevent_7__ident_ValuedWeakRef *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "src/gevent/_ident.py":64 + * + * vref = ValuedWeakRef(obj, self._return_ident) + * vref.value = ident # pylint:disable=assigning-non-slot,attribute-defined-outside-init # <<<<<<<<<<<<<< + * self._registry[obj] = (ident, vref) + * return ident + */ + __Pyx_INCREF(__pyx_v_ident); + __Pyx_GIVEREF(__pyx_v_ident); + __Pyx_GOTREF(__pyx_v_vref->value); + __Pyx_DECREF(__pyx_v_vref->value); + __pyx_v_vref->value = __pyx_v_ident; + + /* "src/gevent/_ident.py":65 + * vref = ValuedWeakRef(obj, self._return_ident) + * vref.value = ident # pylint:disable=assigning-non-slot,attribute-defined-outside-init + * self._registry[obj] = (ident, vref) # <<<<<<<<<<<<<< + * return ident + * + */ + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 65, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_ident); + __Pyx_GIVEREF(__pyx_v_ident); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_ident); + __Pyx_INCREF(((PyObject *)__pyx_v_vref)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_vref)); + PyTuple_SET_ITEM(__pyx_t_5, 1, ((PyObject *)__pyx_v_vref)); + if (unlikely(PyObject_SetItem(__pyx_v_self->_registry, __pyx_v_obj, __pyx_t_5) < 0)) __PYX_ERR(0, 65, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "src/gevent/_ident.py":66 + * vref.value = ident # pylint:disable=assigning-non-slot,attribute-defined-outside-init + * self._registry[obj] = (ident, vref) + * return ident # <<<<<<<<<<<<<< + * + * def _return_ident(self, vref): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_ident); + __pyx_r = __pyx_v_ident; + goto __pyx_L0; + + /* "src/gevent/_ident.py":45 + * self._available_idents = [] + * + * def get_ident(self, obj): # <<<<<<<<<<<<<< + * """ + * Retrieve the identifier for *obj*, creating one + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("gevent.__ident.IdentRegistry.get_ident", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_ident); + __Pyx_XDECREF((PyObject *)__pyx_v_vref); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_7__ident_13IdentRegistry_3get_ident(PyObject *__pyx_v_self, PyObject *__pyx_v_obj); /*proto*/ +static char __pyx_doc_6gevent_7__ident_13IdentRegistry_2get_ident[] = "IdentRegistry.get_ident(self, obj)\n\n Retrieve the identifier for *obj*, creating one\n if necessary.\n "; +static PyMethodDef __pyx_mdef_6gevent_7__ident_13IdentRegistry_3get_ident = {"get_ident", (PyCFunction)__pyx_pw_6gevent_7__ident_13IdentRegistry_3get_ident, METH_O, __pyx_doc_6gevent_7__ident_13IdentRegistry_2get_ident}; +static PyObject *__pyx_pw_6gevent_7__ident_13IdentRegistry_3get_ident(PyObject *__pyx_v_self, PyObject *__pyx_v_obj) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get_ident (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_7__ident_13IdentRegistry_2get_ident(((struct __pyx_obj_6gevent_7__ident_IdentRegistry *)__pyx_v_self), ((PyObject *)__pyx_v_obj)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_7__ident_13IdentRegistry_2get_ident(struct __pyx_obj_6gevent_7__ident_IdentRegistry *__pyx_v_self, PyObject *__pyx_v_obj) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("get_ident", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6gevent_7__ident_13IdentRegistry_get_ident(__pyx_v_self, __pyx_v_obj, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 45, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__ident.IdentRegistry.get_ident", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_ident.py":68 + * return ident + * + * def _return_ident(self, vref): # <<<<<<<<<<<<<< + * # By the time this is called, self._registry has been + * # updated + */ + +static PyObject *__pyx_pw_6gevent_7__ident_13IdentRegistry_5_return_ident(PyObject *__pyx_v_self, PyObject *__pyx_v_vref); /*proto*/ +static PyObject *__pyx_f_6gevent_7__ident_13IdentRegistry__return_ident(struct __pyx_obj_6gevent_7__ident_IdentRegistry *__pyx_v_self, struct __pyx_obj_6gevent_7__ident_ValuedWeakRef *__pyx_v_vref, CYTHON_UNUSED int __pyx_skip_dispatch) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + __Pyx_RefNannySetupContext("_return_ident", 0); + + /* "src/gevent/_ident.py":71 + * # By the time this is called, self._registry has been + * # updated + * if heappush is not None: # <<<<<<<<<<<<<< + * # Under some circumstances we can get called + * # when the interpreter is shutting down, and globals + */ + __pyx_t_1 = (__pyx_v_6gevent_7__ident_heappush != Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "src/gevent/_ident.py":75 + * # when the interpreter is shutting down, and globals + * # aren't available any more. + * heappush(self._available_idents, vref.value) # <<<<<<<<<<<<<< + * + * def __len__(self): + */ + __Pyx_INCREF(__pyx_v_6gevent_7__ident_heappush); + __pyx_t_4 = __pyx_v_6gevent_7__ident_heappush; __pyx_t_5 = NULL; + __pyx_t_6 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + __pyx_t_6 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_4)) { + PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_self->_available_idents, __pyx_v_vref->value}; + __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 75, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_t_3); + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { + PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_self->_available_idents, __pyx_v_vref->value}; + __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 75, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_t_3); + } else + #endif + { + __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 75, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + if (__pyx_t_5) { + __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL; + } + __Pyx_INCREF(__pyx_v_self->_available_idents); + __Pyx_GIVEREF(__pyx_v_self->_available_idents); + PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_v_self->_available_idents); + __Pyx_INCREF(__pyx_v_vref->value); + __Pyx_GIVEREF(__pyx_v_vref->value); + PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_vref->value); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 75, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "src/gevent/_ident.py":71 + * # By the time this is called, self._registry has been + * # updated + * if heappush is not None: # <<<<<<<<<<<<<< + * # Under some circumstances we can get called + * # when the interpreter is shutting down, and globals + */ + } + + /* "src/gevent/_ident.py":68 + * return ident + * + * def _return_ident(self, vref): # <<<<<<<<<<<<<< + * # By the time this is called, self._registry has been + * # updated + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("gevent.__ident.IdentRegistry._return_ident", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_7__ident_13IdentRegistry_5_return_ident(PyObject *__pyx_v_self, PyObject *__pyx_v_vref); /*proto*/ +static char __pyx_doc_6gevent_7__ident_13IdentRegistry_4_return_ident[] = "IdentRegistry._return_ident(self, ValuedWeakRef vref)"; +static PyMethodDef __pyx_mdef_6gevent_7__ident_13IdentRegistry_5_return_ident = {"_return_ident", (PyCFunction)__pyx_pw_6gevent_7__ident_13IdentRegistry_5_return_ident, METH_O, __pyx_doc_6gevent_7__ident_13IdentRegistry_4_return_ident}; +static PyObject *__pyx_pw_6gevent_7__ident_13IdentRegistry_5_return_ident(PyObject *__pyx_v_self, PyObject *__pyx_v_vref) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_return_ident (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vref), __pyx_ptype_6gevent_7__ident_ValuedWeakRef, 1, "vref", 0))) __PYX_ERR(0, 68, __pyx_L1_error) + __pyx_r = __pyx_pf_6gevent_7__ident_13IdentRegistry_4_return_ident(((struct __pyx_obj_6gevent_7__ident_IdentRegistry *)__pyx_v_self), ((struct __pyx_obj_6gevent_7__ident_ValuedWeakRef *)__pyx_v_vref)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_7__ident_13IdentRegistry_4_return_ident(struct __pyx_obj_6gevent_7__ident_IdentRegistry *__pyx_v_self, struct __pyx_obj_6gevent_7__ident_ValuedWeakRef *__pyx_v_vref) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("_return_ident", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6gevent_7__ident_13IdentRegistry__return_ident(__pyx_v_self, __pyx_v_vref, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 68, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__ident.IdentRegistry._return_ident", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_ident.py":77 + * heappush(self._available_idents, vref.value) + * + * def __len__(self): # <<<<<<<<<<<<<< + * return len(self._registry) + * + */ + +/* Python wrapper */ +static Py_ssize_t __pyx_pw_6gevent_7__ident_13IdentRegistry_7__len__(PyObject *__pyx_v_self); /*proto*/ +static Py_ssize_t __pyx_pw_6gevent_7__ident_13IdentRegistry_7__len__(PyObject *__pyx_v_self) { + Py_ssize_t __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__len__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_7__ident_13IdentRegistry_6__len__(((struct __pyx_obj_6gevent_7__ident_IdentRegistry *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static Py_ssize_t __pyx_pf_6gevent_7__ident_13IdentRegistry_6__len__(struct __pyx_obj_6gevent_7__ident_IdentRegistry *__pyx_v_self) { + Py_ssize_t __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + __Pyx_RefNannySetupContext("__len__", 0); + + /* "src/gevent/_ident.py":78 + * + * def __len__(self): + * return len(self._registry) # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_1 = __pyx_v_self->_registry; + __Pyx_INCREF(__pyx_t_1); + __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 78, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + goto __pyx_L0; + + /* "src/gevent/_ident.py":77 + * heappush(self._available_idents, vref.value) + * + * def __len__(self): # <<<<<<<<<<<<<< + * return len(self._registry) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__ident.IdentRegistry.__len__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_tp_new_6gevent_7__ident_ValuedWeakRef(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_6gevent_7__ident_ValuedWeakRef *p; + PyObject *o = __pyx_ptype_6gevent_7__ident_ref->tp_new(t, a, k); + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_6gevent_7__ident_ValuedWeakRef *)o); + p->value = Py_None; Py_INCREF(Py_None); + return o; +} + +static void __pyx_tp_dealloc_6gevent_7__ident_ValuedWeakRef(PyObject *o) { + struct __pyx_obj_6gevent_7__ident_ValuedWeakRef *p = (struct __pyx_obj_6gevent_7__ident_ValuedWeakRef *)o; + PyObject_GC_UnTrack(o); + Py_CLEAR(p->value); + #if CYTHON_USE_TYPE_SLOTS + if (PyType_IS_GC(Py_TYPE(o)->tp_base)) + #endif + PyObject_GC_Track(o); + if (likely(__pyx_ptype_6gevent_7__ident_ref)) __pyx_ptype_6gevent_7__ident_ref->tp_dealloc(o); else __Pyx_call_next_tp_dealloc(o, __pyx_tp_dealloc_6gevent_7__ident_ValuedWeakRef); +} + +static int __pyx_tp_traverse_6gevent_7__ident_ValuedWeakRef(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_6gevent_7__ident_ValuedWeakRef *p = (struct __pyx_obj_6gevent_7__ident_ValuedWeakRef *)o; + e = ((likely(__pyx_ptype_6gevent_7__ident_ref)) ? ((__pyx_ptype_6gevent_7__ident_ref->tp_traverse) ? __pyx_ptype_6gevent_7__ident_ref->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_6gevent_7__ident_ValuedWeakRef)); if (e) return e; + if (p->value) { + e = (*v)(p->value, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_6gevent_7__ident_ValuedWeakRef(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_6gevent_7__ident_ValuedWeakRef *p = (struct __pyx_obj_6gevent_7__ident_ValuedWeakRef *)o; + if (likely(__pyx_ptype_6gevent_7__ident_ref)) { if (__pyx_ptype_6gevent_7__ident_ref->tp_clear) __pyx_ptype_6gevent_7__ident_ref->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_6gevent_7__ident_ValuedWeakRef); + tmp = ((PyObject*)p->value); + p->value = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyTypeObject __pyx_type_6gevent_7__ident_ValuedWeakRef = { + PyVarObject_HEAD_INIT(0, 0) + "gevent.__ident.ValuedWeakRef", /*tp_name*/ + sizeof(struct __pyx_obj_6gevent_7__ident_ValuedWeakRef), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6gevent_7__ident_ValuedWeakRef, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + "\n A weak ref with an associated value.\n ", /*tp_doc*/ + __pyx_tp_traverse_6gevent_7__ident_ValuedWeakRef, /*tp_traverse*/ + __pyx_tp_clear_6gevent_7__ident_ValuedWeakRef, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + 0, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6gevent_7__ident_ValuedWeakRef, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; +static struct __pyx_vtabstruct_6gevent_7__ident_IdentRegistry __pyx_vtable_6gevent_7__ident_IdentRegistry; + +static PyObject *__pyx_tp_new_6gevent_7__ident_IdentRegistry(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + struct __pyx_obj_6gevent_7__ident_IdentRegistry *p; + PyObject *o; + o = (*t->tp_alloc)(t, 0); + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_6gevent_7__ident_IdentRegistry *)o); + p->__pyx_vtab = __pyx_vtabptr_6gevent_7__ident_IdentRegistry; + p->_registry = Py_None; Py_INCREF(Py_None); + p->_available_idents = ((PyObject*)Py_None); Py_INCREF(Py_None); + return o; +} + +static void __pyx_tp_dealloc_6gevent_7__ident_IdentRegistry(PyObject *o) { + struct __pyx_obj_6gevent_7__ident_IdentRegistry *p = (struct __pyx_obj_6gevent_7__ident_IdentRegistry *)o; + PyObject_GC_UnTrack(o); + Py_CLEAR(p->_registry); + Py_CLEAR(p->_available_idents); + (*Py_TYPE(o)->tp_free)(o); +} + +static int __pyx_tp_traverse_6gevent_7__ident_IdentRegistry(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_6gevent_7__ident_IdentRegistry *p = (struct __pyx_obj_6gevent_7__ident_IdentRegistry *)o; + if (p->_registry) { + e = (*v)(p->_registry, a); if (e) return e; + } + if (p->_available_idents) { + e = (*v)(p->_available_idents, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_6gevent_7__ident_IdentRegistry(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_6gevent_7__ident_IdentRegistry *p = (struct __pyx_obj_6gevent_7__ident_IdentRegistry *)o; + tmp = ((PyObject*)p->_registry); + p->_registry = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->_available_idents); + p->_available_idents = ((PyObject*)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyMethodDef __pyx_methods_6gevent_7__ident_IdentRegistry[] = { + {0, 0, 0, 0} +}; + +static PySequenceMethods __pyx_tp_as_sequence_IdentRegistry = { + __pyx_pw_6gevent_7__ident_13IdentRegistry_7__len__, /*sq_length*/ + 0, /*sq_concat*/ + 0, /*sq_repeat*/ + 0, /*sq_item*/ + 0, /*sq_slice*/ + 0, /*sq_ass_item*/ + 0, /*sq_ass_slice*/ + 0, /*sq_contains*/ + 0, /*sq_inplace_concat*/ + 0, /*sq_inplace_repeat*/ +}; + +static PyMappingMethods __pyx_tp_as_mapping_IdentRegistry = { + __pyx_pw_6gevent_7__ident_13IdentRegistry_7__len__, /*mp_length*/ + 0, /*mp_subscript*/ + 0, /*mp_ass_subscript*/ +}; + +static PyTypeObject __pyx_type_6gevent_7__ident_IdentRegistry = { + PyVarObject_HEAD_INIT(0, 0) + "gevent.__ident.IdentRegistry", /*tp_name*/ + sizeof(struct __pyx_obj_6gevent_7__ident_IdentRegistry), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6gevent_7__ident_IdentRegistry, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + &__pyx_tp_as_sequence_IdentRegistry, /*tp_as_sequence*/ + &__pyx_tp_as_mapping_IdentRegistry, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + "IdentRegistry()\n\n Maintains a unique mapping of (small) positive integer identifiers\n to objects that can be weakly referenced.\n\n It is guaranteed that no two objects will have the the same\n identifier at the same time, as long as those objects are\n also uniquely hashable.\n ", /*tp_doc*/ + __pyx_tp_traverse_6gevent_7__ident_IdentRegistry, /*tp_traverse*/ + __pyx_tp_clear_6gevent_7__ident_IdentRegistry, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6gevent_7__ident_IdentRegistry, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_pw_6gevent_7__ident_13IdentRegistry_1__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6gevent_7__ident_IdentRegistry, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static PyMethodDef __pyx_methods[] = { + {0, 0, 0, 0} +}; + +#if PY_MAJOR_VERSION >= 3 +#if CYTHON_PEP489_MULTI_PHASE_INIT +static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ +static int __pyx_pymod_exec___ident(PyObject* module); /*proto*/ +static PyModuleDef_Slot __pyx_moduledef_slots[] = { + {Py_mod_create, (void*)__pyx_pymod_create}, + {Py_mod_exec, (void*)__pyx_pymod_exec___ident}, + {0, NULL} +}; +#endif + +static struct PyModuleDef __pyx_moduledef = { + PyModuleDef_HEAD_INIT, + "__ident", + 0, /* m_doc */ + #if CYTHON_PEP489_MULTI_PHASE_INIT + 0, /* m_size */ + #else + -1, /* m_size */ + #endif + __pyx_methods /* m_methods */, + #if CYTHON_PEP489_MULTI_PHASE_INIT + __pyx_moduledef_slots, /* m_slots */ + #else + NULL, /* m_reload */ + #endif + NULL, /* m_traverse */ + NULL, /* m_clear */ + NULL /* m_free */ +}; +#endif +#ifndef CYTHON_SMALL_CODE +#if defined(__clang__) + #define CYTHON_SMALL_CODE +#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) + #define CYTHON_SMALL_CODE __attribute__((cold)) +#else + #define CYTHON_SMALL_CODE +#endif +#endif + +static __Pyx_StringTabEntry __pyx_string_tab[] = { + {&__pyx_n_s_IdentRegistry, __pyx_k_IdentRegistry, sizeof(__pyx_k_IdentRegistry), 0, 0, 1, 1}, + {&__pyx_n_s_IdentRegistry__return_ident, __pyx_k_IdentRegistry__return_ident, sizeof(__pyx_k_IdentRegistry__return_ident), 0, 0, 1, 1}, + {&__pyx_n_s_IdentRegistry_get_ident, __pyx_k_IdentRegistry_get_ident, sizeof(__pyx_k_IdentRegistry_get_ident), 0, 0, 1, 1}, + {&__pyx_n_s_KeyError, __pyx_k_KeyError, sizeof(__pyx_k_KeyError), 0, 0, 1, 1}, + {&__pyx_n_s_ValuedWeakRef, __pyx_k_ValuedWeakRef, sizeof(__pyx_k_ValuedWeakRef), 0, 0, 1, 1}, + {&__pyx_n_s_WeakKeyDictionary, __pyx_k_WeakKeyDictionary, sizeof(__pyx_k_WeakKeyDictionary), 0, 0, 1, 1}, + {&__pyx_n_s_all, __pyx_k_all, sizeof(__pyx_k_all), 0, 0, 1, 1}, + {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, + {&__pyx_n_s_get_ident, __pyx_k_get_ident, sizeof(__pyx_k_get_ident), 0, 0, 1, 1}, + {&__pyx_n_s_gevent___ident, __pyx_k_gevent___ident, sizeof(__pyx_k_gevent___ident), 0, 0, 1, 1}, + {&__pyx_n_s_gevent__util, __pyx_k_gevent__util, sizeof(__pyx_k_gevent__util), 0, 0, 1, 1}, + {&__pyx_n_s_heappop, __pyx_k_heappop, sizeof(__pyx_k_heappop), 0, 0, 1, 1}, + {&__pyx_n_s_heappush, __pyx_k_heappush, sizeof(__pyx_k_heappush), 0, 0, 1, 1}, + {&__pyx_n_s_heapq, __pyx_k_heapq, sizeof(__pyx_k_heapq), 0, 0, 1, 1}, + {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, + {&__pyx_n_s_import_c_accel, __pyx_k_import_c_accel, sizeof(__pyx_k_import_c_accel), 0, 0, 1, 1}, + {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, + {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, + {&__pyx_n_s_obj, __pyx_k_obj, sizeof(__pyx_k_obj), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_capi, __pyx_k_pyx_capi, sizeof(__pyx_k_pyx_capi), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1}, + {&__pyx_n_s_ref, __pyx_k_ref, sizeof(__pyx_k_ref), 0, 0, 1, 1}, + {&__pyx_n_s_return_ident, __pyx_k_return_ident, sizeof(__pyx_k_return_ident), 0, 0, 1, 1}, + {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1}, + {&__pyx_n_s_slots, __pyx_k_slots, sizeof(__pyx_k_slots), 0, 0, 1, 1}, + {&__pyx_kp_s_src_gevent__ident_py, __pyx_k_src_gevent__ident_py, sizeof(__pyx_k_src_gevent__ident_py), 0, 0, 1, 0}, + {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, + {&__pyx_n_s_value, __pyx_k_value, sizeof(__pyx_k_value), 0, 0, 1, 1}, + {&__pyx_n_s_vref, __pyx_k_vref, sizeof(__pyx_k_vref), 0, 0, 1, 1}, + {&__pyx_n_s_weakref, __pyx_k_weakref, sizeof(__pyx_k_weakref), 0, 0, 1, 1}, + {0, 0, 0, 0, 0, 0, 0} +}; +static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { + __pyx_builtin_KeyError = __Pyx_GetBuiltinName(__pyx_n_s_KeyError); if (!__pyx_builtin_KeyError) __PYX_ERR(0, 53, __pyx_L1_error) + return 0; + __pyx_L1_error:; + return -1; +} + +static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); + + /* "src/gevent/_ident.py":25 + * """ + * + * __slots__ = ('value',) # <<<<<<<<<<<<<< + * + * + */ + __pyx_tuple_ = PyTuple_Pack(1, __pyx_n_s_value); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 25, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple_); + __Pyx_GIVEREF(__pyx_tuple_); + + /* "src/gevent/_ident.py":45 + * self._available_idents = [] + * + * def get_ident(self, obj): # <<<<<<<<<<<<<< + * """ + * Retrieve the identifier for *obj*, creating one + */ + __pyx_tuple__2 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_obj); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 45, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2); + __Pyx_GIVEREF(__pyx_tuple__2); + __pyx_codeobj__3 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__ident_py, __pyx_n_s_get_ident, 45, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__3)) __PYX_ERR(0, 45, __pyx_L1_error) + + /* "src/gevent/_ident.py":68 + * return ident + * + * def _return_ident(self, vref): # <<<<<<<<<<<<<< + * # By the time this is called, self._registry has been + * # updated + */ + __pyx_tuple__4 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_vref); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 68, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__4); + __Pyx_GIVEREF(__pyx_tuple__4); + __pyx_codeobj__5 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__4, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__ident_py, __pyx_n_s_return_ident, 68, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__5)) __PYX_ERR(0, 68, __pyx_L1_error) + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} + +static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { + if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + return 0; + __pyx_L1_error:; + return -1; +} + +static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/ + +static int __Pyx_modinit_global_init_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); + /*--- Global init code ---*/ + __pyx_v_6gevent_7__ident_heappop = Py_None; Py_INCREF(Py_None); + __pyx_v_6gevent_7__ident_heappush = Py_None; Py_INCREF(Py_None); + __pyx_v_6gevent_7__ident_WeakKeyDictionary = Py_None; Py_INCREF(Py_None); + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_variable_export_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); + /*--- Variable export code ---*/ + if (__Pyx_ExportVoidPtr(__pyx_n_s_heappop, (void *)&__pyx_v_6gevent_7__ident_heappop, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportVoidPtr(__pyx_n_s_heappush, (void *)&__pyx_v_6gevent_7__ident_heappush, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportVoidPtr(__pyx_n_s_WeakKeyDictionary, (void *)&__pyx_v_6gevent_7__ident_WeakKeyDictionary, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_modinit_function_export_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); + /*--- Function export code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_type_init_code(void) { + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); + /*--- Type init code ---*/ + __pyx_t_1 = PyImport_ImportModule("weakref"); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_ptype_6gevent_7__ident_ref = __Pyx_ImportType(__pyx_t_1, "weakref", "ref", sizeof(PyWeakReference), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_7__ident_ref) __PYX_ERR(1, 5, __pyx_L1_error) + __pyx_type_6gevent_7__ident_ValuedWeakRef.tp_base = __pyx_ptype_6gevent_7__ident_ref; + if (PyType_Ready(&__pyx_type_6gevent_7__ident_ValuedWeakRef) < 0) __PYX_ERR(0, 20, __pyx_L1_error) + __pyx_type_6gevent_7__ident_ValuedWeakRef.tp_print = 0; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6gevent_7__ident_ValuedWeakRef.tp_dictoffset && __pyx_type_6gevent_7__ident_ValuedWeakRef.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_type_6gevent_7__ident_ValuedWeakRef.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + } + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_ValuedWeakRef, (PyObject *)&__pyx_type_6gevent_7__ident_ValuedWeakRef) < 0) __PYX_ERR(0, 20, __pyx_L1_error) + __pyx_ptype_6gevent_7__ident_ValuedWeakRef = &__pyx_type_6gevent_7__ident_ValuedWeakRef; + __pyx_vtabptr_6gevent_7__ident_IdentRegistry = &__pyx_vtable_6gevent_7__ident_IdentRegistry; + __pyx_vtable_6gevent_7__ident_IdentRegistry.get_ident = (PyObject *(*)(struct __pyx_obj_6gevent_7__ident_IdentRegistry *, PyObject *, int __pyx_skip_dispatch))__pyx_f_6gevent_7__ident_13IdentRegistry_get_ident; + __pyx_vtable_6gevent_7__ident_IdentRegistry._return_ident = (PyObject *(*)(struct __pyx_obj_6gevent_7__ident_IdentRegistry *, struct __pyx_obj_6gevent_7__ident_ValuedWeakRef *, int __pyx_skip_dispatch))__pyx_f_6gevent_7__ident_13IdentRegistry__return_ident; + if (PyType_Ready(&__pyx_type_6gevent_7__ident_IdentRegistry) < 0) __PYX_ERR(0, 28, __pyx_L1_error) + __pyx_type_6gevent_7__ident_IdentRegistry.tp_print = 0; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6gevent_7__ident_IdentRegistry.tp_dictoffset && __pyx_type_6gevent_7__ident_IdentRegistry.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_type_6gevent_7__ident_IdentRegistry.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + } + if (__Pyx_SetVtable(__pyx_type_6gevent_7__ident_IdentRegistry.tp_dict, __pyx_vtabptr_6gevent_7__ident_IdentRegistry) < 0) __PYX_ERR(0, 28, __pyx_L1_error) + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_IdentRegistry, (PyObject *)&__pyx_type_6gevent_7__ident_IdentRegistry) < 0) __PYX_ERR(0, 28, __pyx_L1_error) + __pyx_ptype_6gevent_7__ident_IdentRegistry = &__pyx_type_6gevent_7__ident_IdentRegistry; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_modinit_type_import_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); + /*--- Type import code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_variable_import_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); + /*--- Variable import code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_function_import_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); + /*--- Function import code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + + +#if PY_MAJOR_VERSION < 3 +#ifdef CYTHON_NO_PYINIT_EXPORT +#define __Pyx_PyMODINIT_FUNC void +#else +#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC +#endif +#else +#ifdef CYTHON_NO_PYINIT_EXPORT +#define __Pyx_PyMODINIT_FUNC PyObject * +#else +#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC +#endif +#endif + + +#if PY_MAJOR_VERSION < 3 +__Pyx_PyMODINIT_FUNC init__ident(void) CYTHON_SMALL_CODE; /*proto*/ +__Pyx_PyMODINIT_FUNC init__ident(void) +#else +__Pyx_PyMODINIT_FUNC PyInit___ident(void) CYTHON_SMALL_CODE; /*proto*/ +__Pyx_PyMODINIT_FUNC PyInit___ident(void) +#if CYTHON_PEP489_MULTI_PHASE_INIT +{ + return PyModuleDef_Init(&__pyx_moduledef); +} +static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { + #if PY_VERSION_HEX >= 0x030700A1 + static PY_INT64_T main_interpreter_id = -1; + PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); + if (main_interpreter_id == -1) { + main_interpreter_id = current_id; + return (unlikely(current_id == -1)) ? -1 : 0; + } else if (unlikely(main_interpreter_id != current_id)) + #else + static PyInterpreterState *main_interpreter = NULL; + PyInterpreterState *current_interpreter = PyThreadState_Get()->interp; + if (!main_interpreter) { + main_interpreter = current_interpreter; + } else if (unlikely(main_interpreter != current_interpreter)) + #endif + { + PyErr_SetString( + PyExc_ImportError, + "Interpreter change detected - this module can only be loaded into one interpreter per process."); + return -1; + } + return 0; +} +static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) { + PyObject *value = PyObject_GetAttrString(spec, from_name); + int result = 0; + if (likely(value)) { + if (allow_none || value != Py_None) { + result = PyDict_SetItemString(moddict, to_name, value); + } + Py_DECREF(value); + } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_Clear(); + } else { + result = -1; + } + return result; +} +static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) { + PyObject *module = NULL, *moddict, *modname; + if (__Pyx_check_single_interpreter()) + return NULL; + if (__pyx_m) + return __Pyx_NewRef(__pyx_m); + modname = PyObject_GetAttrString(spec, "name"); + if (unlikely(!modname)) goto bad; + module = PyModule_NewObject(modname); + Py_DECREF(modname); + if (unlikely(!module)) goto bad; + moddict = PyModule_GetDict(module); + if (unlikely(!moddict)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad; + return module; +bad: + Py_XDECREF(module); + return NULL; +} + + +static CYTHON_SMALL_CODE int __pyx_pymod_exec___ident(PyObject *__pyx_pyinit_module) +#endif +#endif +{ + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannyDeclarations + #if CYTHON_PEP489_MULTI_PHASE_INIT + if (__pyx_m) { + if (__pyx_m == __pyx_pyinit_module) return 0; + PyErr_SetString(PyExc_RuntimeError, "Module '__ident' has already been imported. Re-initialisation is not supported."); + return -1; + } + #elif PY_MAJOR_VERSION >= 3 + if (__pyx_m) return __Pyx_NewRef(__pyx_m); + #endif + #if CYTHON_REFNANNY +__Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); +if (!__Pyx_RefNanny) { + PyErr_Clear(); + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); + if (!__Pyx_RefNanny) + Py_FatalError("failed to import 'refnanny' module"); +} +#endif + __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit___ident(void)", 0); + if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #ifdef __Pxy_PyFrame_Initialize_Offsets + __Pxy_PyFrame_Initialize_Offsets(); + #endif + __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) + #ifdef __Pyx_CyFunction_USED + if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_FusedFunction_USED + if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_Coroutine_USED + if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_Generator_USED + if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_AsyncGen_USED + if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_StopAsyncIteration_USED + if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + /*--- Library function declarations ---*/ + /*--- Threads initialization code ---*/ + #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS + #ifdef WITH_THREAD /* Python build with threading support? */ + PyEval_InitThreads(); + #endif + #endif + /*--- Module creation code ---*/ + #if CYTHON_PEP489_MULTI_PHASE_INIT + __pyx_m = __pyx_pyinit_module; + Py_INCREF(__pyx_m); + #else + #if PY_MAJOR_VERSION < 3 + __pyx_m = Py_InitModule4("__ident", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); + #else + __pyx_m = PyModule_Create(&__pyx_moduledef); + #endif + if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) + Py_INCREF(__pyx_d); + __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) + #if CYTHON_COMPILING_IN_PYPY + Py_INCREF(__pyx_b); + #endif + if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + /*--- Initialize various global constants etc. ---*/ + if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) + if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + if (__pyx_module_is_main_gevent____ident) { + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + } + #if PY_MAJOR_VERSION >= 3 + { + PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) + if (!PyDict_GetItemString(modules, "gevent.__ident")) { + if (unlikely(PyDict_SetItemString(modules, "gevent.__ident", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error) + } + } + #endif + /*--- Builtin init code ---*/ + if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + /*--- Constants init code ---*/ + if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + /*--- Global type/function init code ---*/ + (void)__Pyx_modinit_global_init_code(); + if (unlikely(__Pyx_modinit_variable_export_code() != 0)) goto __pyx_L1_error; + (void)__Pyx_modinit_function_export_code(); + if (unlikely(__Pyx_modinit_type_init_code() != 0)) goto __pyx_L1_error; + (void)__Pyx_modinit_type_import_code(); + (void)__Pyx_modinit_variable_import_code(); + (void)__Pyx_modinit_function_import_code(); + /*--- Execution code ---*/ + #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) + if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + + /* "src/gevent/_ident.py":10 + * + * + * from weakref import WeakKeyDictionary # <<<<<<<<<<<<<< + * from weakref import ref + * + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_WeakKeyDictionary); + __Pyx_GIVEREF(__pyx_n_s_WeakKeyDictionary); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_WeakKeyDictionary); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_weakref, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_WeakKeyDictionary); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_v_6gevent_7__ident_WeakKeyDictionary); + __Pyx_DECREF_SET(__pyx_v_6gevent_7__ident_WeakKeyDictionary, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/_ident.py":11 + * + * from weakref import WeakKeyDictionary + * from weakref import ref # <<<<<<<<<<<<<< + * + * from heapq import heappop + */ + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 11, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_ref); + __Pyx_GIVEREF(__pyx_n_s_ref); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_ref); + __pyx_t_1 = __Pyx_Import(__pyx_n_s_weakref, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 11, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_ident.py":13 + * from weakref import ref + * + * from heapq import heappop # <<<<<<<<<<<<<< + * from heapq import heappush + * + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_heappop); + __Pyx_GIVEREF(__pyx_n_s_heappop); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_heappop); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_heapq, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_heappop); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_v_6gevent_7__ident_heappop); + __Pyx_DECREF_SET(__pyx_v_6gevent_7__ident_heappop, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/_ident.py":14 + * + * from heapq import heappop + * from heapq import heappush # <<<<<<<<<<<<<< + * + * __all__ = [ + */ + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 14, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_heappush); + __Pyx_GIVEREF(__pyx_n_s_heappush); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_heappush); + __pyx_t_1 = __Pyx_Import(__pyx_n_s_heapq, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 14, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_heappush); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 14, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_v_6gevent_7__ident_heappush); + __Pyx_DECREF_SET(__pyx_v_6gevent_7__ident_heappush, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_ident.py":16 + * from heapq import heappush + * + * __all__ = [ # <<<<<<<<<<<<<< + * 'IdentRegistry', + * ] + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 16, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_IdentRegistry); + __Pyx_GIVEREF(__pyx_n_s_IdentRegistry); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_IdentRegistry); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_all, __pyx_t_1) < 0) __PYX_ERR(0, 16, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_ident.py":25 + * """ + * + * __slots__ = ('value',) # <<<<<<<<<<<<<< + * + * + */ + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_7__ident_ValuedWeakRef->tp_dict, __pyx_n_s_slots, __pyx_tuple_) < 0) __PYX_ERR(0, 25, __pyx_L1_error) + PyType_Modified(__pyx_ptype_6gevent_7__ident_ValuedWeakRef); + + /* "src/gevent/_ident.py":45 + * self._available_idents = [] + * + * def get_ident(self, obj): # <<<<<<<<<<<<<< + * """ + * Retrieve the identifier for *obj*, creating one + */ + __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_7__ident_13IdentRegistry_3get_ident, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_IdentRegistry_get_ident, NULL, __pyx_n_s_gevent___ident, __pyx_d, ((PyObject *)__pyx_codeobj__3)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 45, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_7__ident_IdentRegistry->tp_dict, __pyx_n_s_get_ident, __pyx_t_1) < 0) __PYX_ERR(0, 45, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + PyType_Modified(__pyx_ptype_6gevent_7__ident_IdentRegistry); + + /* "src/gevent/_ident.py":68 + * return ident + * + * def _return_ident(self, vref): # <<<<<<<<<<<<<< + * # By the time this is called, self._registry has been + * # updated + */ + __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_7__ident_13IdentRegistry_5_return_ident, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_IdentRegistry__return_ident, NULL, __pyx_n_s_gevent___ident, __pyx_d, ((PyObject *)__pyx_codeobj__5)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 68, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_7__ident_IdentRegistry->tp_dict, __pyx_n_s_return_ident, __pyx_t_1) < 0) __PYX_ERR(0, 68, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + PyType_Modified(__pyx_ptype_6gevent_7__ident_IdentRegistry); + + /* "src/gevent/_ident.py":81 + * + * + * from gevent._util import import_c_accel # <<<<<<<<<<<<<< + * import_c_accel(globals(), 'gevent.__ident') + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 81, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_import_c_accel); + __Pyx_GIVEREF(__pyx_n_s_import_c_accel); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_import_c_accel); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_gevent__util, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 81, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_import_c_accel); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 81, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_import_c_accel, __pyx_t_1) < 0) __PYX_ERR(0, 81, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/_ident.py":82 + * + * from gevent._util import import_c_accel + * import_c_accel(globals(), 'gevent.__ident') # <<<<<<<<<<<<<< + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_import_c_accel); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 82, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_Globals(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 82, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 82, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_INCREF(__pyx_n_s_gevent___ident); + __Pyx_GIVEREF(__pyx_n_s_gevent___ident); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_n_s_gevent___ident); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 82, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_ident.py":1 + * # -*- coding: utf-8 -*- # <<<<<<<<<<<<<< + * # Copyright 2018 gevent contributors. See LICENSE for details. + * # cython: auto_pickle=False,embedsignature=True,always_allow_keywords=False + */ + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /*--- Wrapped vars code ---*/ + + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + if (__pyx_m) { + if (__pyx_d) { + __Pyx_AddTraceback("init gevent.__ident", __pyx_clineno, __pyx_lineno, __pyx_filename); + } + Py_CLEAR(__pyx_m); + } else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_ImportError, "init gevent.__ident"); + } + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + #if CYTHON_PEP489_MULTI_PHASE_INIT + return (__pyx_m != NULL) ? 0 : -1; + #elif PY_MAJOR_VERSION >= 3 + return __pyx_m; + #else + return; + #endif +} + +/* --- Runtime support code --- */ +/* Refnanny */ +#if CYTHON_REFNANNY +static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { + PyObject *m = NULL, *p = NULL; + void *r = NULL; + m = PyImport_ImportModule(modname); + if (!m) goto end; + p = PyObject_GetAttrString(m, "RefNannyAPI"); + if (!p) goto end; + r = PyLong_AsVoidPtr(p); +end: + Py_XDECREF(p); + Py_XDECREF(m); + return (__Pyx_RefNannyAPIStruct *)r; +} +#endif + +/* PyObjectGetAttrStr */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_getattro)) + return tp->tp_getattro(obj, attr_name); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_getattr)) + return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); +#endif + return PyObject_GetAttr(obj, attr_name); +} +#endif + +/* GetBuiltinName */ +static PyObject *__Pyx_GetBuiltinName(PyObject *name) { + PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name); + if (unlikely(!result)) { + PyErr_Format(PyExc_NameError, +#if PY_MAJOR_VERSION >= 3 + "name '%U' is not defined", name); +#else + "name '%.200s' is not defined", PyString_AS_STRING(name)); +#endif + } + return result; +} + +/* RaiseArgTupleInvalid */ +static void __Pyx_RaiseArgtupleInvalid( + const char* func_name, + int exact, + Py_ssize_t num_min, + Py_ssize_t num_max, + Py_ssize_t num_found) +{ + Py_ssize_t num_expected; + const char *more_or_less; + if (num_found < num_min) { + num_expected = num_min; + more_or_less = "at least"; + } else { + num_expected = num_max; + more_or_less = "at most"; + } + if (exact) { + more_or_less = "exactly"; + } + PyErr_Format(PyExc_TypeError, + "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", + func_name, more_or_less, num_expected, + (num_expected == 1) ? "" : "s", num_found); +} + +/* KeywordStringCheck */ +static int __Pyx_CheckKeywordStrings( + PyObject *kwdict, + const char* function_name, + int kw_allowed) +{ + PyObject* key = 0; + Py_ssize_t pos = 0; +#if CYTHON_COMPILING_IN_PYPY + if (!kw_allowed && PyDict_Next(kwdict, &pos, &key, 0)) + goto invalid_keyword; + return 1; +#else + while (PyDict_Next(kwdict, &pos, &key, 0)) { + #if PY_MAJOR_VERSION < 3 + if (unlikely(!PyString_Check(key))) + #endif + if (unlikely(!PyUnicode_Check(key))) + goto invalid_keyword_type; + } + if ((!kw_allowed) && unlikely(key)) + goto invalid_keyword; + return 1; +invalid_keyword_type: + PyErr_Format(PyExc_TypeError, + "%.200s() keywords must be strings", function_name); + return 0; +#endif +invalid_keyword: + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION < 3 + "%.200s() got an unexpected keyword argument '%.200s'", + function_name, PyString_AsString(key)); + #else + "%s() got an unexpected keyword argument '%U'", + function_name, key); + #endif + return 0; +} + +/* PyFunctionFastCall */ +#if CYTHON_FAST_PYCALL +static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, + PyObject *globals) { + PyFrameObject *f; + PyThreadState *tstate = __Pyx_PyThreadState_Current; + PyObject **fastlocals; + Py_ssize_t i; + PyObject *result; + assert(globals != NULL); + /* XXX Perhaps we should create a specialized + PyFrame_New() that doesn't take locals, but does + take builtins without sanity checking them. + */ + assert(tstate != NULL); + f = PyFrame_New(tstate, co, globals, NULL); + if (f == NULL) { + return NULL; + } + fastlocals = __Pyx_PyFrame_GetLocalsplus(f); + for (i = 0; i < na; i++) { + Py_INCREF(*args); + fastlocals[i] = *args++; + } + result = PyEval_EvalFrameEx(f,0); + ++tstate->recursion_depth; + Py_DECREF(f); + --tstate->recursion_depth; + return result; +} +#if 1 || PY_VERSION_HEX < 0x030600B1 +static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs) { + PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); + PyObject *globals = PyFunction_GET_GLOBALS(func); + PyObject *argdefs = PyFunction_GET_DEFAULTS(func); + PyObject *closure; +#if PY_MAJOR_VERSION >= 3 + PyObject *kwdefs; +#endif + PyObject *kwtuple, **k; + PyObject **d; + Py_ssize_t nd; + Py_ssize_t nk; + PyObject *result; + assert(kwargs == NULL || PyDict_Check(kwargs)); + nk = kwargs ? PyDict_Size(kwargs) : 0; + if (Py_EnterRecursiveCall((char*)" while calling a Python object")) { + return NULL; + } + if ( +#if PY_MAJOR_VERSION >= 3 + co->co_kwonlyargcount == 0 && +#endif + likely(kwargs == NULL || nk == 0) && + co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { + if (argdefs == NULL && co->co_argcount == nargs) { + result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); + goto done; + } + else if (nargs == 0 && argdefs != NULL + && co->co_argcount == Py_SIZE(argdefs)) { + /* function called with no arguments, but all parameters have + a default value: use default values as arguments .*/ + args = &PyTuple_GET_ITEM(argdefs, 0); + result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); + goto done; + } + } + if (kwargs != NULL) { + Py_ssize_t pos, i; + kwtuple = PyTuple_New(2 * nk); + if (kwtuple == NULL) { + result = NULL; + goto done; + } + k = &PyTuple_GET_ITEM(kwtuple, 0); + pos = i = 0; + while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { + Py_INCREF(k[i]); + Py_INCREF(k[i+1]); + i += 2; + } + nk = i / 2; + } + else { + kwtuple = NULL; + k = NULL; + } + closure = PyFunction_GET_CLOSURE(func); +#if PY_MAJOR_VERSION >= 3 + kwdefs = PyFunction_GET_KW_DEFAULTS(func); +#endif + if (argdefs != NULL) { + d = &PyTuple_GET_ITEM(argdefs, 0); + nd = Py_SIZE(argdefs); + } + else { + d = NULL; + nd = 0; + } +#if PY_MAJOR_VERSION >= 3 + result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, + args, nargs, + k, (int)nk, + d, (int)nd, kwdefs, closure); +#else + result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, + args, nargs, + k, (int)nk, + d, (int)nd, closure); +#endif + Py_XDECREF(kwtuple); +done: + Py_LeaveRecursiveCall(); + return result; +} +#endif +#endif + +/* PyObjectCall */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { + PyObject *result; + ternaryfunc call = func->ob_type->tp_call; + if (unlikely(!call)) + return PyObject_Call(func, arg, kw); + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; + result = (*call)(func, arg, kw); + Py_LeaveRecursiveCall(); + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +/* PyObjectCallMethO */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { + PyObject *self, *result; + PyCFunction cfunc; + cfunc = PyCFunction_GET_FUNCTION(func); + self = PyCFunction_GET_SELF(func); + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; + result = cfunc(self, arg); + Py_LeaveRecursiveCall(); + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +/* PyObjectCallNoArg */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { +#if CYTHON_FAST_PYCALL + if (PyFunction_Check(func)) { + return __Pyx_PyFunction_FastCall(func, NULL, 0); + } +#endif +#ifdef __Pyx_CyFunction_USED + if (likely(PyCFunction_Check(func) || __Pyx_CyFunction_Check(func))) +#else + if (likely(PyCFunction_Check(func))) +#endif + { + if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) { + return __Pyx_PyObject_CallMethO(func, NULL); + } + } + return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL); +} +#endif + +/* PyCFunctionFastCall */ +#if CYTHON_FAST_PYCCALL +static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) { + PyCFunctionObject *func = (PyCFunctionObject*)func_obj; + PyCFunction meth = PyCFunction_GET_FUNCTION(func); + PyObject *self = PyCFunction_GET_SELF(func); + int flags = PyCFunction_GET_FLAGS(func); + assert(PyCFunction_Check(func)); + assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS))); + assert(nargs >= 0); + assert(nargs == 0 || args != NULL); + /* _PyCFunction_FastCallDict() must not be called with an exception set, + because it may clear it (directly or indirectly) and so the + caller loses its exception */ + assert(!PyErr_Occurred()); + if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) { + return (*((__Pyx_PyCFunctionFastWithKeywords)(void*)meth)) (self, args, nargs, NULL); + } else { + return (*((__Pyx_PyCFunctionFast)(void*)meth)) (self, args, nargs); + } +} +#endif + +/* PyObjectCallOneArg */ +#if CYTHON_COMPILING_IN_CPYTHON +static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) { + PyObject *result; + PyObject *args = PyTuple_New(1); + if (unlikely(!args)) return NULL; + Py_INCREF(arg); + PyTuple_SET_ITEM(args, 0, arg); + result = __Pyx_PyObject_Call(func, args, NULL); + Py_DECREF(args); + return result; +} +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { +#if CYTHON_FAST_PYCALL + if (PyFunction_Check(func)) { + return __Pyx_PyFunction_FastCall(func, &arg, 1); + } +#endif + if (likely(PyCFunction_Check(func))) { + if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) { + return __Pyx_PyObject_CallMethO(func, arg); +#if CYTHON_FAST_PYCCALL + } else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) { + return __Pyx_PyCFunction_FastCall(func, &arg, 1); +#endif + } + } + return __Pyx__PyObject_CallOneArg(func, arg); +} +#else +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { + PyObject *result; + PyObject *args = PyTuple_Pack(1, arg); + if (unlikely(!args)) return NULL; + result = __Pyx_PyObject_Call(func, args, NULL); + Py_DECREF(args); + return result; +} +#endif + +/* GetItemInt */ +static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { + PyObject *r; + if (!j) return NULL; + r = PyObject_GetItem(o, j); + Py_DECREF(j); + return r; +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, + CYTHON_NCP_UNUSED int wraparound, + CYTHON_NCP_UNUSED int boundscheck) { +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + Py_ssize_t wrapped_i = i; + if (wraparound & unlikely(i < 0)) { + wrapped_i += PyList_GET_SIZE(o); + } + if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) { + PyObject *r = PyList_GET_ITEM(o, wrapped_i); + Py_INCREF(r); + return r; + } + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +#else + return PySequence_GetItem(o, i); +#endif +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, + CYTHON_NCP_UNUSED int wraparound, + CYTHON_NCP_UNUSED int boundscheck) { +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + Py_ssize_t wrapped_i = i; + if (wraparound & unlikely(i < 0)) { + wrapped_i += PyTuple_GET_SIZE(o); + } + if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) { + PyObject *r = PyTuple_GET_ITEM(o, wrapped_i); + Py_INCREF(r); + return r; + } + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +#else + return PySequence_GetItem(o, i); +#endif +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, + CYTHON_NCP_UNUSED int wraparound, + CYTHON_NCP_UNUSED int boundscheck) { +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS + if (is_list || PyList_CheckExact(o)) { + Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); + if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) { + PyObject *r = PyList_GET_ITEM(o, n); + Py_INCREF(r); + return r; + } + } + else if (PyTuple_CheckExact(o)) { + Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o); + if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) { + PyObject *r = PyTuple_GET_ITEM(o, n); + Py_INCREF(r); + return r; + } + } else { + PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence; + if (likely(m && m->sq_item)) { + if (wraparound && unlikely(i < 0) && likely(m->sq_length)) { + Py_ssize_t l = m->sq_length(o); + if (likely(l >= 0)) { + i += l; + } else { + if (!PyErr_ExceptionMatches(PyExc_OverflowError)) + return NULL; + PyErr_Clear(); + } + } + return m->sq_item(o, i); + } + } +#else + if (is_list || PySequence_Check(o)) { + return PySequence_GetItem(o, i); + } +#endif + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +} + +/* ObjectGetItem */ +#if CYTHON_USE_TYPE_SLOTS +static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject* index) { + PyObject *runerr; + Py_ssize_t key_value; + PySequenceMethods *m = Py_TYPE(obj)->tp_as_sequence; + if (unlikely(!(m && m->sq_item))) { + PyErr_Format(PyExc_TypeError, "'%.200s' object is not subscriptable", Py_TYPE(obj)->tp_name); + return NULL; + } + key_value = __Pyx_PyIndex_AsSsize_t(index); + if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) { + return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1); + } + if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) { + PyErr_Clear(); + PyErr_Format(PyExc_IndexError, "cannot fit '%.200s' into an index-sized integer", Py_TYPE(index)->tp_name); + } + return NULL; +} +static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key) { + PyMappingMethods *m = Py_TYPE(obj)->tp_as_mapping; + if (likely(m && m->mp_subscript)) { + return m->mp_subscript(obj, key); + } + return __Pyx_PyObject_GetIndex(obj, key); +} +#endif + +/* GetTopmostException */ +#if CYTHON_USE_EXC_INFO_STACK +static _PyErr_StackItem * +__Pyx_PyErr_GetTopmostException(PyThreadState *tstate) +{ + _PyErr_StackItem *exc_info = tstate->exc_info; + while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) && + exc_info->previous_item != NULL) + { + exc_info = exc_info->previous_item; + } + return exc_info; +} +#endif + +/* SaveResetException */ +#if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { + #if CYTHON_USE_EXC_INFO_STACK + _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate); + *type = exc_info->exc_type; + *value = exc_info->exc_value; + *tb = exc_info->exc_traceback; + #else + *type = tstate->exc_type; + *value = tstate->exc_value; + *tb = tstate->exc_traceback; + #endif + Py_XINCREF(*type); + Py_XINCREF(*value); + Py_XINCREF(*tb); +} +static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + #if CYTHON_USE_EXC_INFO_STACK + _PyErr_StackItem *exc_info = tstate->exc_info; + tmp_type = exc_info->exc_type; + tmp_value = exc_info->exc_value; + tmp_tb = exc_info->exc_traceback; + exc_info->exc_type = type; + exc_info->exc_value = value; + exc_info->exc_traceback = tb; + #else + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = type; + tstate->exc_value = value; + tstate->exc_traceback = tb; + #endif + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +} +#endif + +/* PyErrExceptionMatches */ +#if CYTHON_FAST_THREAD_STATE +static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { + Py_ssize_t i, n; + n = PyTuple_GET_SIZE(tuple); +#if PY_MAJOR_VERSION >= 3 + for (i=0; icurexc_type; + if (exc_type == err) return 1; + if (unlikely(!exc_type)) return 0; + if (unlikely(PyTuple_Check(err))) + return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err); + return __Pyx_PyErr_GivenExceptionMatches(exc_type, err); +} +#endif + +/* PyErrFetchRestore */ +#if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + tmp_type = tstate->curexc_type; + tmp_value = tstate->curexc_value; + tmp_tb = tstate->curexc_traceback; + tstate->curexc_type = type; + tstate->curexc_value = value; + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +} +static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { + *type = tstate->curexc_type; + *value = tstate->curexc_value; + *tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +} +#endif + +/* PyObjectCall2Args */ +static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) { + PyObject *args, *result = NULL; + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(function)) { + PyObject *args[2] = {arg1, arg2}; + return __Pyx_PyFunction_FastCall(function, args, 2); + } + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(function)) { + PyObject *args[2] = {arg1, arg2}; + return __Pyx_PyCFunction_FastCall(function, args, 2); + } + #endif + args = PyTuple_New(2); + if (unlikely(!args)) goto done; + Py_INCREF(arg1); + PyTuple_SET_ITEM(args, 0, arg1); + Py_INCREF(arg2); + PyTuple_SET_ITEM(args, 1, arg2); + Py_INCREF(function); + result = __Pyx_PyObject_Call(function, args, NULL); + Py_DECREF(args); + Py_DECREF(function); +done: + return result; +} + +/* ArgTypeTest */ +static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact) +{ + if (unlikely(!type)) { + PyErr_SetString(PyExc_SystemError, "Missing type object"); + return 0; + } + else if (exact) { + #if PY_MAJOR_VERSION == 2 + if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1; + #endif + } + else { + if (likely(__Pyx_TypeCheck(obj, type))) return 1; + } + PyErr_Format(PyExc_TypeError, + "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)", + name, type->tp_name, Py_TYPE(obj)->tp_name); + return 0; +} + +/* CallNextTpDealloc */ +static void __Pyx_call_next_tp_dealloc(PyObject* obj, destructor current_tp_dealloc) { + PyTypeObject* type = Py_TYPE(obj); + while (type && type->tp_dealloc != current_tp_dealloc) + type = type->tp_base; + while (type && type->tp_dealloc == current_tp_dealloc) + type = type->tp_base; + if (type) + type->tp_dealloc(obj); +} + +/* CallNextTpTraverse */ +static int __Pyx_call_next_tp_traverse(PyObject* obj, visitproc v, void *a, traverseproc current_tp_traverse) { + PyTypeObject* type = Py_TYPE(obj); + while (type && type->tp_traverse != current_tp_traverse) + type = type->tp_base; + while (type && type->tp_traverse == current_tp_traverse) + type = type->tp_base; + if (type && type->tp_traverse) + return type->tp_traverse(obj, v, a); + return 0; +} + +/* CallNextTpClear */ +static void __Pyx_call_next_tp_clear(PyObject* obj, inquiry current_tp_clear) { + PyTypeObject* type = Py_TYPE(obj); + while (type && type->tp_clear != current_tp_clear) + type = type->tp_base; + while (type && type->tp_clear == current_tp_clear) + type = type->tp_base; + if (type && type->tp_clear) + type->tp_clear(obj); +} + +/* TypeImport */ +#ifndef __PYX_HAVE_RT_ImportType +#define __PYX_HAVE_RT_ImportType +static PyTypeObject *__Pyx_ImportType(PyObject *module, const char *module_name, const char *class_name, + size_t size, enum __Pyx_ImportType_CheckSize check_size) +{ + PyObject *result = 0; + char warning[200]; + Py_ssize_t basicsize; +#ifdef Py_LIMITED_API + PyObject *py_basicsize; +#endif + result = PyObject_GetAttrString(module, class_name); + if (!result) + goto bad; + if (!PyType_Check(result)) { + PyErr_Format(PyExc_TypeError, + "%.200s.%.200s is not a type object", + module_name, class_name); + goto bad; + } +#ifndef Py_LIMITED_API + basicsize = ((PyTypeObject *)result)->tp_basicsize; +#else + py_basicsize = PyObject_GetAttrString(result, "__basicsize__"); + if (!py_basicsize) + goto bad; + basicsize = PyLong_AsSsize_t(py_basicsize); + Py_DECREF(py_basicsize); + py_basicsize = 0; + if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred()) + goto bad; +#endif + if ((size_t)basicsize < size) { + PyErr_Format(PyExc_ValueError, + "%.200s.%.200s size changed, may indicate binary incompatibility. " + "Expected %zd from C header, got %zd from PyObject", + module_name, class_name, size, basicsize); + goto bad; + } + if (check_size == __Pyx_ImportType_CheckSize_Error && (size_t)basicsize != size) { + PyErr_Format(PyExc_ValueError, + "%.200s.%.200s size changed, may indicate binary incompatibility. " + "Expected %zd from C header, got %zd from PyObject", + module_name, class_name, size, basicsize); + goto bad; + } + else if (check_size == __Pyx_ImportType_CheckSize_Warn && (size_t)basicsize > size) { + PyOS_snprintf(warning, sizeof(warning), + "%s.%s size changed, may indicate binary incompatibility. " + "Expected %zd from C header, got %zd from PyObject", + module_name, class_name, size, basicsize); + if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad; + } + return (PyTypeObject *)result; +bad: + Py_XDECREF(result); + return NULL; +} +#endif + +/* PyObject_GenericGetAttrNoDict */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) { + PyErr_Format(PyExc_AttributeError, +#if PY_MAJOR_VERSION >= 3 + "'%.50s' object has no attribute '%U'", + tp->tp_name, attr_name); +#else + "'%.50s' object has no attribute '%.400s'", + tp->tp_name, PyString_AS_STRING(attr_name)); +#endif + return NULL; +} +static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) { + PyObject *descr; + PyTypeObject *tp = Py_TYPE(obj); + if (unlikely(!PyString_Check(attr_name))) { + return PyObject_GenericGetAttr(obj, attr_name); + } + assert(!tp->tp_dictoffset); + descr = _PyType_Lookup(tp, attr_name); + if (unlikely(!descr)) { + return __Pyx_RaiseGenericGetAttributeError(tp, attr_name); + } + Py_INCREF(descr); + #if PY_MAJOR_VERSION < 3 + if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS))) + #endif + { + descrgetfunc f = Py_TYPE(descr)->tp_descr_get; + if (unlikely(f)) { + PyObject *res = f(descr, obj, (PyObject *)tp); + Py_DECREF(descr); + return res; + } + } + return descr; +} +#endif + +/* SetVTable */ +static int __Pyx_SetVtable(PyObject *dict, void *vtable) { +#if PY_VERSION_HEX >= 0x02070000 + PyObject *ob = PyCapsule_New(vtable, 0, 0); +#else + PyObject *ob = PyCObject_FromVoidPtr(vtable, 0); +#endif + if (!ob) + goto bad; + if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0) + goto bad; + Py_DECREF(ob); + return 0; +bad: + Py_XDECREF(ob); + return -1; +} + +/* Import */ +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { + PyObject *empty_list = 0; + PyObject *module = 0; + PyObject *global_dict = 0; + PyObject *empty_dict = 0; + PyObject *list; + #if PY_MAJOR_VERSION < 3 + PyObject *py_import; + py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); + if (!py_import) + goto bad; + #endif + if (from_list) + list = from_list; + else { + empty_list = PyList_New(0); + if (!empty_list) + goto bad; + list = empty_list; + } + global_dict = PyModule_GetDict(__pyx_m); + if (!global_dict) + goto bad; + empty_dict = PyDict_New(); + if (!empty_dict) + goto bad; + { + #if PY_MAJOR_VERSION >= 3 + if (level == -1) { + if (strchr(__Pyx_MODULE_NAME, '.')) { + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, 1); + if (!module) { + if (!PyErr_ExceptionMatches(PyExc_ImportError)) + goto bad; + PyErr_Clear(); + } + } + level = 0; + } + #endif + if (!module) { + #if PY_MAJOR_VERSION < 3 + PyObject *py_level = PyInt_FromLong(level); + if (!py_level) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, py_level, (PyObject *)NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, level); + #endif + } + } +bad: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(py_import); + #endif + Py_XDECREF(empty_list); + Py_XDECREF(empty_dict); + return module; +} + +/* ImportFrom */ +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { + PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); + if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_Format(PyExc_ImportError, + #if PY_MAJOR_VERSION < 3 + "cannot import name %.230s", PyString_AS_STRING(name)); + #else + "cannot import name %S", name); + #endif + } + return value; +} + +/* FetchCommonType */ +static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { + PyObject* fake_module; + PyTypeObject* cached_type = NULL; + fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI); + if (!fake_module) return NULL; + Py_INCREF(fake_module); + cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name); + if (cached_type) { + if (!PyType_Check((PyObject*)cached_type)) { + PyErr_Format(PyExc_TypeError, + "Shared Cython type %.200s is not a type object", + type->tp_name); + goto bad; + } + if (cached_type->tp_basicsize != type->tp_basicsize) { + PyErr_Format(PyExc_TypeError, + "Shared Cython type %.200s has the wrong size, try recompiling", + type->tp_name); + goto bad; + } + } else { + if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; + PyErr_Clear(); + if (PyType_Ready(type) < 0) goto bad; + if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0) + goto bad; + Py_INCREF(type); + cached_type = type; + } +done: + Py_DECREF(fake_module); + return cached_type; +bad: + Py_XDECREF(cached_type); + cached_type = NULL; + goto done; +} + +/* CythonFunction */ +#include +static PyObject * +__Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure) +{ + if (unlikely(op->func_doc == NULL)) { + if (op->func.m_ml->ml_doc) { +#if PY_MAJOR_VERSION >= 3 + op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc); +#else + op->func_doc = PyString_FromString(op->func.m_ml->ml_doc); +#endif + if (unlikely(op->func_doc == NULL)) + return NULL; + } else { + Py_INCREF(Py_None); + return Py_None; + } + } + Py_INCREF(op->func_doc); + return op->func_doc; +} +static int +__Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context) +{ + PyObject *tmp = op->func_doc; + if (value == NULL) { + value = Py_None; + } + Py_INCREF(value); + op->func_doc = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + if (unlikely(op->func_name == NULL)) { +#if PY_MAJOR_VERSION >= 3 + op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name); +#else + op->func_name = PyString_InternFromString(op->func.m_ml->ml_name); +#endif + if (unlikely(op->func_name == NULL)) + return NULL; + } + Py_INCREF(op->func_name); + return op->func_name; +} +static int +__Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context) +{ + PyObject *tmp; +#if PY_MAJOR_VERSION >= 3 + if (unlikely(value == NULL || !PyUnicode_Check(value))) +#else + if (unlikely(value == NULL || !PyString_Check(value))) +#endif + { + PyErr_SetString(PyExc_TypeError, + "__name__ must be set to a string object"); + return -1; + } + tmp = op->func_name; + Py_INCREF(value); + op->func_name = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + Py_INCREF(op->func_qualname); + return op->func_qualname; +} +static int +__Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context) +{ + PyObject *tmp; +#if PY_MAJOR_VERSION >= 3 + if (unlikely(value == NULL || !PyUnicode_Check(value))) +#else + if (unlikely(value == NULL || !PyString_Check(value))) +#endif + { + PyErr_SetString(PyExc_TypeError, + "__qualname__ must be set to a string object"); + return -1; + } + tmp = op->func_qualname; + Py_INCREF(value); + op->func_qualname = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED void *closure) +{ + PyObject *self; + self = m->func_closure; + if (self == NULL) + self = Py_None; + Py_INCREF(self); + return self; +} +static PyObject * +__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + if (unlikely(op->func_dict == NULL)) { + op->func_dict = PyDict_New(); + if (unlikely(op->func_dict == NULL)) + return NULL; + } + Py_INCREF(op->func_dict); + return op->func_dict; +} +static int +__Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context) +{ + PyObject *tmp; + if (unlikely(value == NULL)) { + PyErr_SetString(PyExc_TypeError, + "function's dictionary may not be deleted"); + return -1; + } + if (unlikely(!PyDict_Check(value))) { + PyErr_SetString(PyExc_TypeError, + "setting function's dictionary to a non-dict"); + return -1; + } + tmp = op->func_dict; + Py_INCREF(value); + op->func_dict = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + Py_INCREF(op->func_globals); + return op->func_globals; +} +static PyObject * +__Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + Py_INCREF(Py_None); + return Py_None; +} +static PyObject * +__Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + PyObject* result = (op->func_code) ? op->func_code : Py_None; + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { + int result = 0; + PyObject *res = op->defaults_getter((PyObject *) op); + if (unlikely(!res)) + return -1; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + op->defaults_tuple = PyTuple_GET_ITEM(res, 0); + Py_INCREF(op->defaults_tuple); + op->defaults_kwdict = PyTuple_GET_ITEM(res, 1); + Py_INCREF(op->defaults_kwdict); + #else + op->defaults_tuple = PySequence_ITEM(res, 0); + if (unlikely(!op->defaults_tuple)) result = -1; + else { + op->defaults_kwdict = PySequence_ITEM(res, 1); + if (unlikely(!op->defaults_kwdict)) result = -1; + } + #endif + Py_DECREF(res); + return result; +} +static int +__Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) { + PyObject* tmp; + if (!value) { + value = Py_None; + } else if (value != Py_None && !PyTuple_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__defaults__ must be set to a tuple object"); + return -1; + } + Py_INCREF(value); + tmp = op->defaults_tuple; + op->defaults_tuple = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) { + PyObject* result = op->defaults_tuple; + if (unlikely(!result)) { + if (op->defaults_getter) { + if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL; + result = op->defaults_tuple; + } else { + result = Py_None; + } + } + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) { + PyObject* tmp; + if (!value) { + value = Py_None; + } else if (value != Py_None && !PyDict_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__kwdefaults__ must be set to a dict object"); + return -1; + } + Py_INCREF(value); + tmp = op->defaults_kwdict; + op->defaults_kwdict = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) { + PyObject* result = op->defaults_kwdict; + if (unlikely(!result)) { + if (op->defaults_getter) { + if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL; + result = op->defaults_kwdict; + } else { + result = Py_None; + } + } + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) { + PyObject* tmp; + if (!value || value == Py_None) { + value = NULL; + } else if (!PyDict_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__annotations__ must be set to a dict object"); + return -1; + } + Py_XINCREF(value); + tmp = op->func_annotations; + op->func_annotations = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) { + PyObject* result = op->func_annotations; + if (unlikely(!result)) { + result = PyDict_New(); + if (unlikely(!result)) return NULL; + op->func_annotations = result; + } + Py_INCREF(result); + return result; +} +static PyGetSetDef __pyx_CyFunction_getsets[] = { + {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, + {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, + {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, + {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, + {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, + {(char *) "__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0}, + {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, + {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, + {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, + {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, + {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, + {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, + {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, + {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, + {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, + {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, + {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, + {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, + {0, 0, 0, 0, 0} +}; +static PyMemberDef __pyx_CyFunction_members[] = { + {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), PY_WRITE_RESTRICTED, 0}, + {0, 0, 0, 0, 0} +}; +static PyObject * +__Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args) +{ +#if PY_MAJOR_VERSION >= 3 + return PyUnicode_FromString(m->func.m_ml->ml_name); +#else + return PyString_FromString(m->func.m_ml->ml_name); +#endif +} +static PyMethodDef __pyx_CyFunction_methods[] = { + {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, + {0, 0, 0, 0} +}; +#if PY_VERSION_HEX < 0x030500A0 +#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist) +#else +#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func.m_weakreflist) +#endif +static PyObject *__Pyx_CyFunction_New(PyTypeObject *type, PyMethodDef *ml, int flags, PyObject* qualname, + PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { + __pyx_CyFunctionObject *op = PyObject_GC_New(__pyx_CyFunctionObject, type); + if (op == NULL) + return NULL; + op->flags = flags; + __Pyx_CyFunction_weakreflist(op) = NULL; + op->func.m_ml = ml; + op->func.m_self = (PyObject *) op; + Py_XINCREF(closure); + op->func_closure = closure; + Py_XINCREF(module); + op->func.m_module = module; + op->func_dict = NULL; + op->func_name = NULL; + Py_INCREF(qualname); + op->func_qualname = qualname; + op->func_doc = NULL; + op->func_classobj = NULL; + op->func_globals = globals; + Py_INCREF(op->func_globals); + Py_XINCREF(code); + op->func_code = code; + op->defaults_pyobjects = 0; + op->defaults = NULL; + op->defaults_tuple = NULL; + op->defaults_kwdict = NULL; + op->defaults_getter = NULL; + op->func_annotations = NULL; + PyObject_GC_Track(op); + return (PyObject *) op; +} +static int +__Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) +{ + Py_CLEAR(m->func_closure); + Py_CLEAR(m->func.m_module); + Py_CLEAR(m->func_dict); + Py_CLEAR(m->func_name); + Py_CLEAR(m->func_qualname); + Py_CLEAR(m->func_doc); + Py_CLEAR(m->func_globals); + Py_CLEAR(m->func_code); + Py_CLEAR(m->func_classobj); + Py_CLEAR(m->defaults_tuple); + Py_CLEAR(m->defaults_kwdict); + Py_CLEAR(m->func_annotations); + if (m->defaults) { + PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); + int i; + for (i = 0; i < m->defaults_pyobjects; i++) + Py_XDECREF(pydefaults[i]); + PyObject_Free(m->defaults); + m->defaults = NULL; + } + return 0; +} +static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m) +{ + if (__Pyx_CyFunction_weakreflist(m) != NULL) + PyObject_ClearWeakRefs((PyObject *) m); + __Pyx_CyFunction_clear(m); + PyObject_GC_Del(m); +} +static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) +{ + PyObject_GC_UnTrack(m); + __Pyx__CyFunction_dealloc(m); +} +static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) +{ + Py_VISIT(m->func_closure); + Py_VISIT(m->func.m_module); + Py_VISIT(m->func_dict); + Py_VISIT(m->func_name); + Py_VISIT(m->func_qualname); + Py_VISIT(m->func_doc); + Py_VISIT(m->func_globals); + Py_VISIT(m->func_code); + Py_VISIT(m->func_classobj); + Py_VISIT(m->defaults_tuple); + Py_VISIT(m->defaults_kwdict); + if (m->defaults) { + PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); + int i; + for (i = 0; i < m->defaults_pyobjects; i++) + Py_VISIT(pydefaults[i]); + } + return 0; +} +static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type) +{ + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) { + Py_INCREF(func); + return func; + } + if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) { + if (type == NULL) + type = (PyObject *)(Py_TYPE(obj)); + return __Pyx_PyMethod_New(func, type, (PyObject *)(Py_TYPE(type))); + } + if (obj == Py_None) + obj = NULL; + return __Pyx_PyMethod_New(func, obj, type); +} +static PyObject* +__Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) +{ +#if PY_MAJOR_VERSION >= 3 + return PyUnicode_FromFormat("", + op->func_qualname, (void *)op); +#else + return PyString_FromFormat("", + PyString_AsString(op->func_qualname), (void *)op); +#endif +} +static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) { + PyCFunctionObject* f = (PyCFunctionObject*)func; + PyCFunction meth = f->m_ml->ml_meth; + Py_ssize_t size; + switch (f->m_ml->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) { + case METH_VARARGS: + if (likely(kw == NULL || PyDict_Size(kw) == 0)) + return (*meth)(self, arg); + break; + case METH_VARARGS | METH_KEYWORDS: + return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw); + case METH_NOARGS: + if (likely(kw == NULL || PyDict_Size(kw) == 0)) { + size = PyTuple_GET_SIZE(arg); + if (likely(size == 0)) + return (*meth)(self, NULL); + PyErr_Format(PyExc_TypeError, + "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", + f->m_ml->ml_name, size); + return NULL; + } + break; + case METH_O: + if (likely(kw == NULL || PyDict_Size(kw) == 0)) { + size = PyTuple_GET_SIZE(arg); + if (likely(size == 1)) { + PyObject *result, *arg0; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + arg0 = PyTuple_GET_ITEM(arg, 0); + #else + arg0 = PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL; + #endif + result = (*meth)(self, arg0); + #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) + Py_DECREF(arg0); + #endif + return result; + } + PyErr_Format(PyExc_TypeError, + "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", + f->m_ml->ml_name, size); + return NULL; + } + break; + default: + PyErr_SetString(PyExc_SystemError, "Bad call flags in " + "__Pyx_CyFunction_Call. METH_OLDARGS is no " + "longer supported!"); + return NULL; + } + PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", + f->m_ml->ml_name); + return NULL; +} +static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { + return __Pyx_CyFunction_CallMethod(func, ((PyCFunctionObject*)func)->m_self, arg, kw); +} +static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) { + PyObject *result; + __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func; + if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { + Py_ssize_t argc; + PyObject *new_args; + PyObject *self; + argc = PyTuple_GET_SIZE(args); + new_args = PyTuple_GetSlice(args, 1, argc); + if (unlikely(!new_args)) + return NULL; + self = PyTuple_GetItem(args, 0); + if (unlikely(!self)) { + Py_DECREF(new_args); + return NULL; + } + result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw); + Py_DECREF(new_args); + } else { + result = __Pyx_CyFunction_Call(func, args, kw); + } + return result; +} +static PyTypeObject __pyx_CyFunctionType_type = { + PyVarObject_HEAD_INIT(0, 0) + "cython_function_or_method", + sizeof(__pyx_CyFunctionObject), + 0, + (destructor) __Pyx_CyFunction_dealloc, + 0, + 0, + 0, +#if PY_MAJOR_VERSION < 3 + 0, +#else + 0, +#endif + (reprfunc) __Pyx_CyFunction_repr, + 0, + 0, + 0, + 0, + __Pyx_CyFunction_CallAsMethod, + 0, + 0, + 0, + 0, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, + 0, + (traverseproc) __Pyx_CyFunction_traverse, + (inquiry) __Pyx_CyFunction_clear, + 0, +#if PY_VERSION_HEX < 0x030500A0 + offsetof(__pyx_CyFunctionObject, func_weakreflist), +#else + offsetof(PyCFunctionObject, m_weakreflist), +#endif + 0, + 0, + __pyx_CyFunction_methods, + __pyx_CyFunction_members, + __pyx_CyFunction_getsets, + 0, + 0, + __Pyx_CyFunction_descr_get, + 0, + offsetof(__pyx_CyFunctionObject, func_dict), + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, +#if PY_VERSION_HEX >= 0x030400a1 + 0, +#endif +}; +static int __pyx_CyFunction_init(void) { + __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); + if (unlikely(__pyx_CyFunctionType == NULL)) { + return -1; + } + return 0; +} +static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults = PyObject_Malloc(size); + if (unlikely(!m->defaults)) + return PyErr_NoMemory(); + memset(m->defaults, 0, size); + m->defaults_pyobjects = pyobjects; + return m->defaults; +} +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults_tuple = tuple; + Py_INCREF(tuple); +} +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults_kwdict = dict; + Py_INCREF(dict); +} +static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->func_annotations = dict; + Py_INCREF(dict); +} + +/* GetModuleGlobalName */ +#if CYTHON_USE_DICT_VERSIONS +static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value) +#else +static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) +#endif +{ + PyObject *result; +#if !CYTHON_AVOID_BORROWED_REFS +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 + result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } else if (unlikely(PyErr_Occurred())) { + return NULL; + } +#else + result = PyDict_GetItem(__pyx_d, name); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } +#endif +#else + result = PyObject_GetItem(__pyx_d, name); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } + PyErr_Clear(); +#endif + return __Pyx_GetBuiltinName(name); +} + +/* GetAttr */ +static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) { +#if CYTHON_USE_TYPE_SLOTS +#if PY_MAJOR_VERSION >= 3 + if (likely(PyUnicode_Check(n))) +#else + if (likely(PyString_Check(n))) +#endif + return __Pyx_PyObject_GetAttrStr(o, n); +#endif + return PyObject_GetAttr(o, n); +} + +/* Globals */ +static PyObject* __Pyx_Globals(void) { + Py_ssize_t i; + PyObject *names; + PyObject *globals = __pyx_d; + Py_INCREF(globals); + names = PyObject_Dir(__pyx_m); + if (!names) + goto bad; + for (i = PyList_GET_SIZE(names)-1; i >= 0; i--) { +#if CYTHON_COMPILING_IN_PYPY + PyObject* name = PySequence_ITEM(names, i); + if (!name) + goto bad; +#else + PyObject* name = PyList_GET_ITEM(names, i); +#endif + if (!PyDict_Contains(globals, name)) { + PyObject* value = __Pyx_GetAttr(__pyx_m, name); + if (!value) { +#if CYTHON_COMPILING_IN_PYPY + Py_DECREF(name); +#endif + goto bad; + } + if (PyDict_SetItem(globals, name, value) < 0) { +#if CYTHON_COMPILING_IN_PYPY + Py_DECREF(name); +#endif + Py_DECREF(value); + goto bad; + } + } +#if CYTHON_COMPILING_IN_PYPY + Py_DECREF(name); +#endif + } + Py_DECREF(names); + return globals; +bad: + Py_XDECREF(names); + Py_XDECREF(globals); + return NULL; +} + +/* CLineInTraceback */ +#ifndef CYTHON_CLINE_IN_TRACEBACK +static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { + PyObject *use_cline; + PyObject *ptype, *pvalue, *ptraceback; +#if CYTHON_COMPILING_IN_CPYTHON + PyObject **cython_runtime_dict; +#endif + if (unlikely(!__pyx_cython_runtime)) { + return c_line; + } + __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); +#if CYTHON_COMPILING_IN_CPYTHON + cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); + if (likely(cython_runtime_dict)) { + __PYX_PY_DICT_LOOKUP_IF_MODIFIED( + use_cline, *cython_runtime_dict, + __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback)) + } else +#endif + { + PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback); + if (use_cline_obj) { + use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; + Py_DECREF(use_cline_obj); + } else { + PyErr_Clear(); + use_cline = NULL; + } + } + if (!use_cline) { + c_line = 0; + PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); + } + else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { + c_line = 0; + } + __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); + return c_line; +} +#endif + +/* CodeObjectCache */ +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { + int start = 0, mid = 0, end = count - 1; + if (end >= 0 && code_line > entries[end].code_line) { + return count; + } + while (start < end) { + mid = start + (end - start) / 2; + if (code_line < entries[mid].code_line) { + end = mid; + } else if (code_line > entries[mid].code_line) { + start = mid + 1; + } else { + return mid; + } + } + if (code_line <= entries[mid].code_line) { + return mid; + } else { + return mid + 1; + } +} +static PyCodeObject *__pyx_find_code_object(int code_line) { + PyCodeObject* code_object; + int pos; + if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { + return NULL; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { + return NULL; + } + code_object = __pyx_code_cache.entries[pos].code_object; + Py_INCREF(code_object); + return code_object; +} +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { + int pos, i; + __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; + if (unlikely(!code_line)) { + return; + } + if (unlikely(!entries)) { + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); + if (likely(entries)) { + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = 64; + __pyx_code_cache.count = 1; + entries[0].code_line = code_line; + entries[0].code_object = code_object; + Py_INCREF(code_object); + } + return; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { + PyCodeObject* tmp = entries[pos].code_object; + entries[pos].code_object = code_object; + Py_DECREF(tmp); + return; + } + if (__pyx_code_cache.count == __pyx_code_cache.max_count) { + int new_max = __pyx_code_cache.max_count + 64; + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( + __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry)); + if (unlikely(!entries)) { + return; + } + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = new_max; + } + for (i=__pyx_code_cache.count; i>pos; i--) { + entries[i] = entries[i-1]; + } + entries[pos].code_line = code_line; + entries[pos].code_object = code_object; + __pyx_code_cache.count++; + Py_INCREF(code_object); +} + +/* AddTraceback */ +#include "compile.h" +#include "frameobject.h" +#include "traceback.h" +static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( + const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyObject *py_srcfile = 0; + PyObject *py_funcname = 0; + #if PY_MAJOR_VERSION < 3 + py_srcfile = PyString_FromString(filename); + #else + py_srcfile = PyUnicode_FromString(filename); + #endif + if (!py_srcfile) goto bad; + if (c_line) { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + #else + py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + #endif + } + else { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromString(funcname); + #else + py_funcname = PyUnicode_FromString(funcname); + #endif + } + if (!py_funcname) goto bad; + py_code = __Pyx_PyCode_New( + 0, + 0, + 0, + 0, + 0, + __pyx_empty_bytes, /*PyObject *code,*/ + __pyx_empty_tuple, /*PyObject *consts,*/ + __pyx_empty_tuple, /*PyObject *names,*/ + __pyx_empty_tuple, /*PyObject *varnames,*/ + __pyx_empty_tuple, /*PyObject *freevars,*/ + __pyx_empty_tuple, /*PyObject *cellvars,*/ + py_srcfile, /*PyObject *filename,*/ + py_funcname, /*PyObject *name,*/ + py_line, + __pyx_empty_bytes /*PyObject *lnotab*/ + ); + Py_DECREF(py_srcfile); + Py_DECREF(py_funcname); + return py_code; +bad: + Py_XDECREF(py_srcfile); + Py_XDECREF(py_funcname); + return NULL; +} +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyFrameObject *py_frame = 0; + PyThreadState *tstate = __Pyx_PyThreadState_Current; + if (c_line) { + c_line = __Pyx_CLineForTraceback(tstate, c_line); + } + py_code = __pyx_find_code_object(c_line ? -c_line : py_line); + if (!py_code) { + py_code = __Pyx_CreateCodeObjectForTraceback( + funcname, c_line, py_line, filename); + if (!py_code) goto bad; + __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); + } + py_frame = PyFrame_New( + tstate, /*PyThreadState *tstate,*/ + py_code, /*PyCodeObject *code,*/ + __pyx_d, /*PyObject *globals,*/ + 0 /*PyObject *locals*/ + ); + if (!py_frame) goto bad; + __Pyx_PyFrame_SetLineNumber(py_frame, py_line); + PyTraceBack_Here(py_frame); +bad: + Py_XDECREF(py_code); + Py_XDECREF(py_frame); +} + +/* CIntToPy */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { + const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(long) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(long) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(long) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(long), + little, !is_unsigned); + } +} + +/* CIntFromPyVerify */ +#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ + __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) +#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ + __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) +#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ + {\ + func_type value = func_value;\ + if (sizeof(target_type) < sizeof(func_type)) {\ + if (unlikely(value != (func_type) (target_type) value)) {\ + func_type zero = 0;\ + if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ + return (target_type) -1;\ + if (is_unsigned && unlikely(value < zero))\ + goto raise_neg_overflow;\ + else\ + goto raise_overflow;\ + }\ + }\ + return (target_type) value;\ + } + +/* CIntFromPy */ +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { + const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(long) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (long) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (long) 0; + case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0]) + case 2: + if (8 * sizeof(long) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) { + return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + case 3: + if (8 * sizeof(long) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) { + return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + case 4: + if (8 * sizeof(long) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) { + return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (long) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if (sizeof(long) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (long) 0; + case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0])) + case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0]) + case -2: + if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 2: + if (8 * sizeof(long) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case -3: + if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 3: + if (8 * sizeof(long) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case -4: + if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 4: + if (8 * sizeof(long) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + } +#endif + if (sizeof(long) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + long val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (long) -1; + } + } else { + long val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (long) -1; + val = __Pyx_PyInt_As_long(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to long"); + return (long) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to long"); + return (long) -1; +} + +/* CIntFromPy */ +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { + const int neg_one = (int) ((int) 0 - (int) 1), const_zero = (int) 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(int) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (int) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (int) 0; + case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0]) + case 2: + if (8 * sizeof(int) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) { + return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + case 3: + if (8 * sizeof(int) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) { + return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + case 4: + if (8 * sizeof(int) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) { + return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (int) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if (sizeof(int) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (int) 0; + case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0])) + case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0]) + case -2: + if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { + return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 2: + if (8 * sizeof(int) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { + return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case -3: + if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { + return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 3: + if (8 * sizeof(int) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { + return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case -4: + if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { + return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 4: + if (8 * sizeof(int) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { + return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + } +#endif + if (sizeof(int) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + int val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (int) -1; + } + } else { + int val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (int) -1; + val = __Pyx_PyInt_As_int(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to int"); + return (int) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to int"); + return (int) -1; +} + +/* FastTypeChecks */ +#if CYTHON_COMPILING_IN_CPYTHON +static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) { + while (a) { + a = a->tp_base; + if (a == b) + return 1; + } + return b == &PyBaseObject_Type; +} +static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) { + PyObject *mro; + if (a == b) return 1; + mro = a->tp_mro; + if (likely(mro)) { + Py_ssize_t i, n; + n = PyTuple_GET_SIZE(mro); + for (i = 0; i < n; i++) { + if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b) + return 1; + } + return 0; + } + return __Pyx_InBases(a, b); +} +#if PY_MAJOR_VERSION == 2 +static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { + PyObject *exception, *value, *tb; + int res; + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ErrFetch(&exception, &value, &tb); + res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; + if (unlikely(res == -1)) { + PyErr_WriteUnraisable(err); + res = 0; + } + if (!res) { + res = PyObject_IsSubclass(err, exc_type2); + if (unlikely(res == -1)) { + PyErr_WriteUnraisable(err); + res = 0; + } + } + __Pyx_ErrRestore(exception, value, tb); + return res; +} +#else +static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { + int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0; + if (!res) { + res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); + } + return res; +} +#endif +static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { + Py_ssize_t i, n; + assert(PyExceptionClass_Check(exc_type)); + n = PyTuple_GET_SIZE(tuple); +#if PY_MAJOR_VERSION >= 3 + for (i=0; itp_setattro)) + return tp->tp_setattro(obj, attr_name, value); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_setattr)) + return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value); +#endif + return PyObject_SetAttr(obj, attr_name, value); +} +#endif + +/* VoidPtrExport */ +static int __Pyx_ExportVoidPtr(PyObject *name, void *p, const char *sig) { + PyObject *d; + PyObject *cobj = 0; + d = PyDict_GetItem(__pyx_d, __pyx_n_s_pyx_capi); + Py_XINCREF(d); + if (!d) { + d = PyDict_New(); + if (!d) + goto bad; + if (__Pyx_PyObject_SetAttrStr(__pyx_m, __pyx_n_s_pyx_capi, d) < 0) + goto bad; + } +#if PY_VERSION_HEX >= 0x02070000 + cobj = PyCapsule_New(p, sig, 0); +#else + cobj = PyCObject_FromVoidPtrAndDesc(p, (void *)sig, 0); +#endif + if (!cobj) + goto bad; + if (PyDict_SetItem(d, name, cobj) < 0) + goto bad; + Py_DECREF(cobj); + Py_DECREF(d); + return 0; +bad: + Py_XDECREF(cobj); + Py_XDECREF(d); + return -1; +} + +/* InitStrings */ +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { + while (t->p) { + #if PY_MAJOR_VERSION < 3 + if (t->is_unicode) { + *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); + } else if (t->intern) { + *t->p = PyString_InternFromString(t->s); + } else { + *t->p = PyString_FromStringAndSize(t->s, t->n - 1); + } + #else + if (t->is_unicode | t->is_str) { + if (t->intern) { + *t->p = PyUnicode_InternFromString(t->s); + } else if (t->encoding) { + *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); + } else { + *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); + } + } else { + *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); + } + #endif + if (!*t->p) + return -1; + if (PyObject_Hash(*t->p) == -1) + return -1; + ++t; + } + return 0; +} + +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { + return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); +} +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { + Py_ssize_t ignore; + return __Pyx_PyObject_AsStringAndSize(o, &ignore); +} +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +#if !CYTHON_PEP393_ENABLED +static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { + char* defenc_c; + PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); + if (!defenc) return NULL; + defenc_c = PyBytes_AS_STRING(defenc); +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + { + char* end = defenc_c + PyBytes_GET_SIZE(defenc); + char* c; + for (c = defenc_c; c < end; c++) { + if ((unsigned char) (*c) >= 128) { + PyUnicode_AsASCIIString(o); + return NULL; + } + } + } +#endif + *length = PyBytes_GET_SIZE(defenc); + return defenc_c; +} +#else +static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { + if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + if (likely(PyUnicode_IS_ASCII(o))) { + *length = PyUnicode_GET_LENGTH(o); + return PyUnicode_AsUTF8(o); + } else { + PyUnicode_AsASCIIString(o); + return NULL; + } +#else + return PyUnicode_AsUTF8AndSize(o, length); +#endif +} +#endif +#endif +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT + if ( +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + __Pyx_sys_getdefaultencoding_not_ascii && +#endif + PyUnicode_Check(o)) { + return __Pyx_PyUnicode_AsStringAndSize(o, length); + } else +#endif +#if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) + if (PyByteArray_Check(o)) { + *length = PyByteArray_GET_SIZE(o); + return PyByteArray_AS_STRING(o); + } else +#endif + { + char* result; + int r = PyBytes_AsStringAndSize(o, &result, length); + if (unlikely(r < 0)) { + return NULL; + } else { + return result; + } + } +} +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { + int is_true = x == Py_True; + if (is_true | (x == Py_False) | (x == Py_None)) return is_true; + else return PyObject_IsTrue(x); +} +static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) { + int retval; + if (unlikely(!x)) return -1; + retval = __Pyx_PyObject_IsTrue(x); + Py_DECREF(x); + return retval; +} +static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) { +#if PY_MAJOR_VERSION >= 3 + if (PyLong_Check(result)) { + if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, + "__int__ returned non-int (type %.200s). " + "The ability to return an instance of a strict subclass of int " + "is deprecated, and may be removed in a future version of Python.", + Py_TYPE(result)->tp_name)) { + Py_DECREF(result); + return NULL; + } + return result; + } +#endif + PyErr_Format(PyExc_TypeError, + "__%.4s__ returned non-%.4s (type %.200s)", + type_name, type_name, Py_TYPE(result)->tp_name); + Py_DECREF(result); + return NULL; +} +static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { +#if CYTHON_USE_TYPE_SLOTS + PyNumberMethods *m; +#endif + const char *name = NULL; + PyObject *res = NULL; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x) || PyLong_Check(x))) +#else + if (likely(PyLong_Check(x))) +#endif + return __Pyx_NewRef(x); +#if CYTHON_USE_TYPE_SLOTS + m = Py_TYPE(x)->tp_as_number; + #if PY_MAJOR_VERSION < 3 + if (m && m->nb_int) { + name = "int"; + res = m->nb_int(x); + } + else if (m && m->nb_long) { + name = "long"; + res = m->nb_long(x); + } + #else + if (likely(m && m->nb_int)) { + name = "int"; + res = m->nb_int(x); + } + #endif +#else + if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { + res = PyNumber_Int(x); + } +#endif + if (likely(res)) { +#if PY_MAJOR_VERSION < 3 + if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) { +#else + if (unlikely(!PyLong_CheckExact(res))) { +#endif + return __Pyx_PyNumber_IntOrLongWrongResultType(res, name); + } + } + else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_TypeError, + "an integer is required"); + } + return res; +} +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { + Py_ssize_t ival; + PyObject *x; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_CheckExact(b))) { + if (sizeof(Py_ssize_t) >= sizeof(long)) + return PyInt_AS_LONG(b); + else + return PyInt_AsSsize_t(b); + } +#endif + if (likely(PyLong_CheckExact(b))) { + #if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)b)->ob_digit; + const Py_ssize_t size = Py_SIZE(b); + if (likely(__Pyx_sst_abs(size) <= 1)) { + ival = likely(size) ? digits[0] : 0; + if (size == -1) ival = -ival; + return ival; + } else { + switch (size) { + case 2: + if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { + return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -2: + if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case 3: + if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { + return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -3: + if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case 4: + if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { + return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -4: + if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + } + } + #endif + return PyLong_AsSsize_t(b); + } + x = PyNumber_Index(b); + if (!x) return -1; + ival = PyInt_AsSsize_t(x); + Py_DECREF(x); + return ival; +} +static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) { + return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False); +} +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { + return PyInt_FromSize_t(ival); +} + + +#endif /* Py_PYTHON_H */ diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_ident.html b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_ident.html new file mode 100644 index 00000000..eed42247 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_ident.html @@ -0,0 +1,884 @@ + + + + + + Cython: _ident.py + + + +

Generated by Cython 0.29.2

+

+ Yellow lines hint at Python interaction.
+ Click on a line that starts with a "+" to see the C code that Cython generated for it. +

+

Raw output: _ident.c

+
 01: # -*- coding: utf-8 -*-
+
 02: # Copyright 2018 gevent contributors. See LICENSE for details.
+
 03: # cython: auto_pickle=False,embedsignature=True,always_allow_keywords=False
+
 04: 
+
 05: from __future__ import absolute_import
+
 06: from __future__ import division
+
 07: from __future__ import print_function
+
 08: 
+
 09: 
+
+10: from weakref import WeakKeyDictionary
+
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 10, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(__pyx_n_s_WeakKeyDictionary);
+  __Pyx_GIVEREF(__pyx_n_s_WeakKeyDictionary);
+  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_WeakKeyDictionary);
+  __pyx_t_2 = __Pyx_Import(__pyx_n_s_weakref, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_WeakKeyDictionary); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 10, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(__pyx_t_1);
+  __Pyx_XGOTREF(__pyx_v_6gevent_7__ident_WeakKeyDictionary);
+  __Pyx_DECREF_SET(__pyx_v_6gevent_7__ident_WeakKeyDictionary, __pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+11: from weakref import ref
+
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 11, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_ref);
+  __Pyx_GIVEREF(__pyx_n_s_ref);
+  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_ref);
+  __pyx_t_1 = __Pyx_Import(__pyx_n_s_weakref, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 11, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 12: 
+
+13: from heapq import heappop
+
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 13, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(__pyx_n_s_heappop);
+  __Pyx_GIVEREF(__pyx_n_s_heappop);
+  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_heappop);
+  __pyx_t_2 = __Pyx_Import(__pyx_n_s_heapq, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 13, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_heappop); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 13, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(__pyx_t_1);
+  __Pyx_XGOTREF(__pyx_v_6gevent_7__ident_heappop);
+  __Pyx_DECREF_SET(__pyx_v_6gevent_7__ident_heappop, __pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+14: from heapq import heappush
+
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 14, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_heappush);
+  __Pyx_GIVEREF(__pyx_n_s_heappush);
+  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_heappush);
+  __pyx_t_1 = __Pyx_Import(__pyx_n_s_heapq, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 14, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_heappush); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 14, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(__pyx_t_2);
+  __Pyx_XGOTREF(__pyx_v_6gevent_7__ident_heappush);
+  __Pyx_DECREF_SET(__pyx_v_6gevent_7__ident_heappush, __pyx_t_2);
+  __Pyx_GIVEREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 15: 
+
+16: __all__ = [
+
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 16, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(__pyx_n_s_IdentRegistry);
+  __Pyx_GIVEREF(__pyx_n_s_IdentRegistry);
+  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_IdentRegistry);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_all, __pyx_t_1) < 0) __PYX_ERR(0, 16, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 17:     'IdentRegistry',
+
 18: ]
+
 19: 
+
 20: class ValuedWeakRef(ref):
+
 21:     """
+
 22:     A weak ref with an associated value.
+
 23:     """
+
 24: 
+
+25:     __slots__ = ('value',)
+
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_7__ident_ValuedWeakRef->tp_dict, __pyx_n_s_slots, __pyx_tuple_) < 0) __PYX_ERR(0, 25, __pyx_L1_error)
+  PyType_Modified(__pyx_ptype_6gevent_7__ident_ValuedWeakRef);
+/* … */
+  __pyx_tuple_ = PyTuple_Pack(1, __pyx_n_s_value); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 25, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple_);
+  __Pyx_GIVEREF(__pyx_tuple_);
+
 26: 
+
 27: 
+
+28: class IdentRegistry(object):
+
struct __pyx_vtabstruct_6gevent_7__ident_IdentRegistry {
+  PyObject *(*get_ident)(struct __pyx_obj_6gevent_7__ident_IdentRegistry *, PyObject *, int __pyx_skip_dispatch);
+  PyObject *(*_return_ident)(struct __pyx_obj_6gevent_7__ident_IdentRegistry *, struct __pyx_obj_6gevent_7__ident_ValuedWeakRef *, int __pyx_skip_dispatch);
+};
+static struct __pyx_vtabstruct_6gevent_7__ident_IdentRegistry *__pyx_vtabptr_6gevent_7__ident_IdentRegistry;
+
 29:     """
+
 30:     Maintains a unique mapping of (small) positive integer identifiers
+
 31:     to objects that can be weakly referenced.
+
 32: 
+
 33:     It is guaranteed that no two objects will have the the same
+
 34:     identifier at the same time, as long as those objects are
+
 35:     also uniquely hashable.
+
 36:     """
+
 37: 
+
+38:     def __init__(self):
+
/* Python wrapper */
+static int __pyx_pw_6gevent_7__ident_13IdentRegistry_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static int __pyx_pw_6gevent_7__ident_13IdentRegistry_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
+  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
+    __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
+  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1;
+  __pyx_r = __pyx_pf_6gevent_7__ident_13IdentRegistry___init__(((struct __pyx_obj_6gevent_7__ident_IdentRegistry *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_7__ident_13IdentRegistry___init__(struct __pyx_obj_6gevent_7__ident_IdentRegistry *__pyx_v_self) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = 0;
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_AddTraceback("gevent.__ident.IdentRegistry.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = -1;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
 39:         # {obj -> (ident, wref(obj))}
+
+40:         self._registry = WeakKeyDictionary()
+
  __Pyx_INCREF(__pyx_v_6gevent_7__ident_WeakKeyDictionary);
+  __pyx_t_2 = __pyx_v_6gevent_7__ident_WeakKeyDictionary; __pyx_t_3 = NULL;
+  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
+    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+    if (likely(__pyx_t_3)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+      __Pyx_INCREF(__pyx_t_3);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_2, function);
+    }
+  }
+  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 40, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_GIVEREF(__pyx_t_1);
+  __Pyx_GOTREF(__pyx_v_self->_registry);
+  __Pyx_DECREF(__pyx_v_self->_registry);
+  __pyx_v_self->_registry = __pyx_t_1;
+  __pyx_t_1 = 0;
+
 41: 
+
 42:         # A heap of numbers that have been used and returned
+
+43:         self._available_idents = []
+
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 43, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_1);
+  __Pyx_GOTREF(__pyx_v_self->_available_idents);
+  __Pyx_DECREF(__pyx_v_self->_available_idents);
+  __pyx_v_self->_available_idents = ((PyObject*)__pyx_t_1);
+  __pyx_t_1 = 0;
+
 44: 
+
+45:     def get_ident(self, obj):
+
static PyObject *__pyx_pw_6gevent_7__ident_13IdentRegistry_3get_ident(PyObject *__pyx_v_self, PyObject *__pyx_v_obj); /*proto*/
+static PyObject *__pyx_f_6gevent_7__ident_13IdentRegistry_get_ident(struct __pyx_obj_6gevent_7__ident_IdentRegistry *__pyx_v_self, PyObject *__pyx_v_obj, CYTHON_UNUSED int __pyx_skip_dispatch) {
+  PyObject *__pyx_v_ident = NULL;
+  struct __pyx_obj_6gevent_7__ident_ValuedWeakRef *__pyx_v_vref = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("get_ident", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_XDECREF(__pyx_t_8);
+  __Pyx_AddTraceback("gevent.__ident.IdentRegistry.get_ident", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_ident);
+  __Pyx_XDECREF((PyObject *)__pyx_v_vref);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_7__ident_13IdentRegistry_3get_ident(PyObject *__pyx_v_self, PyObject *__pyx_v_obj); /*proto*/
+static char __pyx_doc_6gevent_7__ident_13IdentRegistry_2get_ident[] = "IdentRegistry.get_ident(self, obj)\n\n        Retrieve the identifier for *obj*, creating one\n        if necessary.\n        ";
+static PyMethodDef __pyx_mdef_6gevent_7__ident_13IdentRegistry_3get_ident = {"get_ident", (PyCFunction)__pyx_pw_6gevent_7__ident_13IdentRegistry_3get_ident, METH_O, __pyx_doc_6gevent_7__ident_13IdentRegistry_2get_ident};
+static PyObject *__pyx_pw_6gevent_7__ident_13IdentRegistry_3get_ident(PyObject *__pyx_v_self, PyObject *__pyx_v_obj) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("get_ident (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_7__ident_13IdentRegistry_2get_ident(((struct __pyx_obj_6gevent_7__ident_IdentRegistry *)__pyx_v_self), ((PyObject *)__pyx_v_obj));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_7__ident_13IdentRegistry_2get_ident(struct __pyx_obj_6gevent_7__ident_IdentRegistry *__pyx_v_self, PyObject *__pyx_v_obj) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("get_ident", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __pyx_f_6gevent_7__ident_13IdentRegistry_get_ident(__pyx_v_self, __pyx_v_obj, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 45, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.__ident.IdentRegistry.get_ident", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__2 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_obj); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 45, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__2);
+  __Pyx_GIVEREF(__pyx_tuple__2);
+/* … */
+  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_7__ident_13IdentRegistry_3get_ident, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_IdentRegistry_get_ident, NULL, __pyx_n_s_gevent___ident, __pyx_d, ((PyObject *)__pyx_codeobj__3)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 45, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_7__ident_IdentRegistry->tp_dict, __pyx_n_s_get_ident, __pyx_t_1) < 0) __PYX_ERR(0, 45, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_7__ident_IdentRegistry);
+  __pyx_codeobj__3 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__ident_py, __pyx_n_s_get_ident, 45, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__3)) __PYX_ERR(0, 45, __pyx_L1_error)
+
 46:         """
+
 47:         Retrieve the identifier for *obj*, creating one
+
 48:         if necessary.
+
 49:         """
+
 50: 
+
+51:         try:
+
  {
+    /*try:*/ {
+/* … */
+    }
+    __pyx_L3_error:;
+    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+/* … */
+    __Pyx_XGIVEREF(__pyx_t_1);
+    __Pyx_XGIVEREF(__pyx_t_2);
+    __Pyx_XGIVEREF(__pyx_t_3);
+    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
+    goto __pyx_L1_error;
+    __pyx_L7_try_return:;
+    __Pyx_XGIVEREF(__pyx_t_1);
+    __Pyx_XGIVEREF(__pyx_t_2);
+    __Pyx_XGIVEREF(__pyx_t_3);
+    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
+    goto __pyx_L0;
+    __pyx_L4_exception_handled:;
+    __Pyx_XGIVEREF(__pyx_t_1);
+    __Pyx_XGIVEREF(__pyx_t_2);
+    __Pyx_XGIVEREF(__pyx_t_3);
+    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
+  }
+
+52:             return self._registry[obj][0]
+
      __Pyx_XDECREF(__pyx_r);
+      __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_v_self->_registry, __pyx_v_obj); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 52, __pyx_L3_error)
+      __Pyx_GOTREF(__pyx_t_4);
+      __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_4, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 52, __pyx_L3_error)
+      __Pyx_GOTREF(__pyx_t_5);
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __pyx_r = __pyx_t_5;
+      __pyx_t_5 = 0;
+      goto __pyx_L7_try_return;
+
+53:         except KeyError:
+
    __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
+    if (__pyx_t_6) {
+      __Pyx_ErrRestore(0,0,0);
+      goto __pyx_L4_exception_handled;
+    }
+    goto __pyx_L5_except_error;
+    __pyx_L5_except_error:;
+
 54:             pass
+
 55: 
+
+56:         if self._available_idents:
+
  __pyx_t_7 = (__pyx_v_self->_available_idents != Py_None)&&(PyList_GET_SIZE(__pyx_v_self->_available_idents) != 0);
+  if (__pyx_t_7) {
+/* … */
+    goto __pyx_L9;
+  }
+
 57:             # Take the smallest free number
+
+58:             ident = heappop(self._available_idents)
+
    __Pyx_INCREF(__pyx_v_6gevent_7__ident_heappop);
+    __pyx_t_4 = __pyx_v_6gevent_7__ident_heappop; __pyx_t_8 = NULL;
+    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
+      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_4);
+      if (likely(__pyx_t_8)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
+        __Pyx_INCREF(__pyx_t_8);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_4, function);
+      }
+    }
+    __pyx_t_5 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_8, __pyx_v_self->_available_idents) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_self->_available_idents);
+    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
+    if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 58, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_5);
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __pyx_v_ident = __pyx_t_5;
+    __pyx_t_5 = 0;
+
 59:         else:
+
 60:             # Allocate a bigger one
+
+61:             ident = len(self._registry)
+
  /*else*/ {
+    __pyx_t_5 = __pyx_v_self->_registry;
+    __Pyx_INCREF(__pyx_t_5);
+    __pyx_t_9 = PyObject_Length(__pyx_t_5); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 61, __pyx_L1_error)
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __pyx_t_5 = PyInt_FromSsize_t(__pyx_t_9); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 61, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_5);
+    __pyx_v_ident = __pyx_t_5;
+    __pyx_t_5 = 0;
+  }
+  __pyx_L9:;
+
 62: 
+
+63:         vref = ValuedWeakRef(obj, self._return_ident)
+
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_return_ident); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 63, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_5);
+  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 63, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_4);
+  __Pyx_INCREF(__pyx_v_obj);
+  __Pyx_GIVEREF(__pyx_v_obj);
+  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_obj);
+  __Pyx_GIVEREF(__pyx_t_5);
+  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_5);
+  __pyx_t_5 = 0;
+  __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6gevent_7__ident_ValuedWeakRef), __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 63, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_5);
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __pyx_v_vref = ((struct __pyx_obj_6gevent_7__ident_ValuedWeakRef *)__pyx_t_5);
+  __pyx_t_5 = 0;
+
+64:         vref.value = ident # pylint:disable=assigning-non-slot,attribute-defined-outside-init
+
  __Pyx_INCREF(__pyx_v_ident);
+  __Pyx_GIVEREF(__pyx_v_ident);
+  __Pyx_GOTREF(__pyx_v_vref->value);
+  __Pyx_DECREF(__pyx_v_vref->value);
+  __pyx_v_vref->value = __pyx_v_ident;
+
+65:         self._registry[obj] = (ident, vref)
+
  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 65, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_5);
+  __Pyx_INCREF(__pyx_v_ident);
+  __Pyx_GIVEREF(__pyx_v_ident);
+  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_ident);
+  __Pyx_INCREF(((PyObject *)__pyx_v_vref));
+  __Pyx_GIVEREF(((PyObject *)__pyx_v_vref));
+  PyTuple_SET_ITEM(__pyx_t_5, 1, ((PyObject *)__pyx_v_vref));
+  if (unlikely(PyObject_SetItem(__pyx_v_self->_registry, __pyx_v_obj, __pyx_t_5) < 0)) __PYX_ERR(0, 65, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+
+66:         return ident
+
  __Pyx_XDECREF(__pyx_r);
+  __Pyx_INCREF(__pyx_v_ident);
+  __pyx_r = __pyx_v_ident;
+  goto __pyx_L0;
+
 67: 
+
+68:     def _return_ident(self, vref):
+
static PyObject *__pyx_pw_6gevent_7__ident_13IdentRegistry_5_return_ident(PyObject *__pyx_v_self, PyObject *__pyx_v_vref); /*proto*/
+static PyObject *__pyx_f_6gevent_7__ident_13IdentRegistry__return_ident(struct __pyx_obj_6gevent_7__ident_IdentRegistry *__pyx_v_self, struct __pyx_obj_6gevent_7__ident_ValuedWeakRef *__pyx_v_vref, CYTHON_UNUSED int __pyx_skip_dispatch) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_return_ident", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_XDECREF(__pyx_t_7);
+  __Pyx_AddTraceback("gevent.__ident.IdentRegistry._return_ident", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_7__ident_13IdentRegistry_5_return_ident(PyObject *__pyx_v_self, PyObject *__pyx_v_vref); /*proto*/
+static char __pyx_doc_6gevent_7__ident_13IdentRegistry_4_return_ident[] = "IdentRegistry._return_ident(self, ValuedWeakRef vref)";
+static PyMethodDef __pyx_mdef_6gevent_7__ident_13IdentRegistry_5_return_ident = {"_return_ident", (PyCFunction)__pyx_pw_6gevent_7__ident_13IdentRegistry_5_return_ident, METH_O, __pyx_doc_6gevent_7__ident_13IdentRegistry_4_return_ident};
+static PyObject *__pyx_pw_6gevent_7__ident_13IdentRegistry_5_return_ident(PyObject *__pyx_v_self, PyObject *__pyx_v_vref) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_return_ident (wrapper)", 0);
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vref), __pyx_ptype_6gevent_7__ident_ValuedWeakRef, 1, "vref", 0))) __PYX_ERR(0, 68, __pyx_L1_error)
+  __pyx_r = __pyx_pf_6gevent_7__ident_13IdentRegistry_4_return_ident(((struct __pyx_obj_6gevent_7__ident_IdentRegistry *)__pyx_v_self), ((struct __pyx_obj_6gevent_7__ident_ValuedWeakRef *)__pyx_v_vref));
+
+  /* function exit code */
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_7__ident_13IdentRegistry_4_return_ident(struct __pyx_obj_6gevent_7__ident_IdentRegistry *__pyx_v_self, struct __pyx_obj_6gevent_7__ident_ValuedWeakRef *__pyx_v_vref) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_return_ident", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __pyx_f_6gevent_7__ident_13IdentRegistry__return_ident(__pyx_v_self, __pyx_v_vref, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 68, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.__ident.IdentRegistry._return_ident", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__4 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_vref); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 68, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__4);
+  __Pyx_GIVEREF(__pyx_tuple__4);
+/* … */
+  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_7__ident_13IdentRegistry_5_return_ident, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_IdentRegistry__return_ident, NULL, __pyx_n_s_gevent___ident, __pyx_d, ((PyObject *)__pyx_codeobj__5)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 68, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_7__ident_IdentRegistry->tp_dict, __pyx_n_s_return_ident, __pyx_t_1) < 0) __PYX_ERR(0, 68, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_7__ident_IdentRegistry);
+
 69:         # By the time this is called, self._registry has been
+
 70:         # updated
+
+71:         if heappush is not None:
+
  __pyx_t_1 = (__pyx_v_6gevent_7__ident_heappush != Py_None);
+  __pyx_t_2 = (__pyx_t_1 != 0);
+  if (__pyx_t_2) {
+/* … */
+  }
+
 72:             # Under some circumstances we can get called
+
 73:             # when the interpreter is shutting down, and globals
+
 74:             # aren't available any more.
+
+75:             heappush(self._available_idents, vref.value)
+
    __Pyx_INCREF(__pyx_v_6gevent_7__ident_heappush);
+    __pyx_t_4 = __pyx_v_6gevent_7__ident_heappush; __pyx_t_5 = NULL;
+    __pyx_t_6 = 0;
+    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
+      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
+      if (likely(__pyx_t_5)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
+        __Pyx_INCREF(__pyx_t_5);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_4, function);
+        __pyx_t_6 = 1;
+      }
+    }
+    #if CYTHON_FAST_PYCALL
+    if (PyFunction_Check(__pyx_t_4)) {
+      PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_self->_available_idents, __pyx_v_vref->value};
+      __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 75, __pyx_L1_error)
+      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+      __Pyx_GOTREF(__pyx_t_3);
+    } else
+    #endif
+    #if CYTHON_FAST_PYCCALL
+    if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
+      PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_self->_available_idents, __pyx_v_vref->value};
+      __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 75, __pyx_L1_error)
+      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+      __Pyx_GOTREF(__pyx_t_3);
+    } else
+    #endif
+    {
+      __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 75, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_7);
+      if (__pyx_t_5) {
+        __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
+      }
+      __Pyx_INCREF(__pyx_v_self->_available_idents);
+      __Pyx_GIVEREF(__pyx_v_self->_available_idents);
+      PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_v_self->_available_idents);
+      __Pyx_INCREF(__pyx_v_vref->value);
+      __Pyx_GIVEREF(__pyx_v_vref->value);
+      PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_vref->value);
+      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 75, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_3);
+      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+    }
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+
 76: 
+
+77:     def __len__(self):
+
/* Python wrapper */
+static Py_ssize_t __pyx_pw_6gevent_7__ident_13IdentRegistry_7__len__(PyObject *__pyx_v_self); /*proto*/
+static Py_ssize_t __pyx_pw_6gevent_7__ident_13IdentRegistry_7__len__(PyObject *__pyx_v_self) {
+  Py_ssize_t __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_7__ident_13IdentRegistry_6__len__(((struct __pyx_obj_6gevent_7__ident_IdentRegistry *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static Py_ssize_t __pyx_pf_6gevent_7__ident_13IdentRegistry_6__len__(struct __pyx_obj_6gevent_7__ident_IdentRegistry *__pyx_v_self) {
+  Py_ssize_t __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__len__", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.__ident.IdentRegistry.__len__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = -1;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+78:         return len(self._registry)
+
  __pyx_t_1 = __pyx_v_self->_registry;
+  __Pyx_INCREF(__pyx_t_1);
+  __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 78, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_r = __pyx_t_2;
+  goto __pyx_L0;
+
 79: 
+
 80: 
+
+81: from gevent._util import import_c_accel
+
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 81, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(__pyx_n_s_import_c_accel);
+  __Pyx_GIVEREF(__pyx_n_s_import_c_accel);
+  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_import_c_accel);
+  __pyx_t_2 = __Pyx_Import(__pyx_n_s_gevent__util, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 81, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_import_c_accel); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 81, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_import_c_accel, __pyx_t_1) < 0) __PYX_ERR(0, 81, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+82: import_c_accel(globals(), 'gevent.__ident')
+
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_import_c_accel); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 82, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_1 = __Pyx_Globals(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 82, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 82, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_GIVEREF(__pyx_t_1);
+  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
+  __Pyx_INCREF(__pyx_n_s_gevent___ident);
+  __Pyx_GIVEREF(__pyx_n_s_gevent___ident);
+  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_n_s_gevent___ident);
+  __pyx_t_1 = 0;
+  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 82, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_ident.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_ident.py new file mode 100644 index 00000000..97c60553 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_ident.py @@ -0,0 +1,82 @@ +# -*- coding: utf-8 -*- +# Copyright 2018 gevent contributors. See LICENSE for details. +# cython: auto_pickle=False,embedsignature=True,always_allow_keywords=False + +from __future__ import absolute_import +from __future__ import division +from __future__ import print_function + + +from weakref import WeakKeyDictionary +from weakref import ref + +from heapq import heappop +from heapq import heappush + +__all__ = [ + 'IdentRegistry', +] + +class ValuedWeakRef(ref): + """ + A weak ref with an associated value. + """ + + __slots__ = ('value',) + + +class IdentRegistry(object): + """ + Maintains a unique mapping of (small) positive integer identifiers + to objects that can be weakly referenced. + + It is guaranteed that no two objects will have the the same + identifier at the same time, as long as those objects are + also uniquely hashable. + """ + + def __init__(self): + # {obj -> (ident, wref(obj))} + self._registry = WeakKeyDictionary() + + # A heap of numbers that have been used and returned + self._available_idents = [] + + def get_ident(self, obj): + """ + Retrieve the identifier for *obj*, creating one + if necessary. + """ + + try: + return self._registry[obj][0] + except KeyError: + pass + + if self._available_idents: + # Take the smallest free number + ident = heappop(self._available_idents) + else: + # Allocate a bigger one + ident = len(self._registry) + + vref = ValuedWeakRef(obj, self._return_ident) + vref.value = ident # pylint:disable=assigning-non-slot,attribute-defined-outside-init + self._registry[obj] = (ident, vref) + return ident + + def _return_ident(self, vref): + # By the time this is called, self._registry has been + # updated + if heappush is not None: + # Under some circumstances we can get called + # when the interpreter is shutting down, and globals + # aren't available any more. + heappush(self._available_idents, vref.value) + + def __len__(self): + return len(self._registry) + + +from gevent._util import import_c_accel +import_c_accel(globals(), 'gevent.__ident') diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_imap.c b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_imap.c new file mode 100644 index 00000000..575fb372 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_imap.c @@ -0,0 +1,10616 @@ +/* Generated by Cython 0.29.2 */ + +/* BEGIN: Cython Metadata +{ + "distutils": { + "depends": [ + "src/gevent/__imap.pxd", + "src\\gevent\\__imap.pxd" + ], + "include_dirs": [ + "C:\\Python37\\Include", + "deps" + ], + "name": "gevent.__imap", + "sources": [ + "src/gevent/_imap.py" + ] + }, + "module_name": "gevent.__imap" +} +END: Cython Metadata */ + +#define PY_SSIZE_T_CLEAN +#include "Python.h" +#ifndef Py_PYTHON_H + #error Python headers needed to compile C extensions, please install development version of Python. +#elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) + #error Cython requires Python 2.6+ or Python 3.3+. +#else +#define CYTHON_ABI "0_29_2" +#define CYTHON_HEX_VERSION 0x001D02F0 +#define CYTHON_FUTURE_DIVISION 1 +#include +#ifndef offsetof + #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) +#endif +#if !defined(WIN32) && !defined(MS_WINDOWS) + #ifndef __stdcall + #define __stdcall + #endif + #ifndef __cdecl + #define __cdecl + #endif + #ifndef __fastcall + #define __fastcall + #endif +#endif +#ifndef DL_IMPORT + #define DL_IMPORT(t) t +#endif +#ifndef DL_EXPORT + #define DL_EXPORT(t) t +#endif +#define __PYX_COMMA , +#ifndef HAVE_LONG_LONG + #if PY_VERSION_HEX >= 0x02070000 + #define HAVE_LONG_LONG + #endif +#endif +#ifndef PY_LONG_LONG + #define PY_LONG_LONG LONG_LONG +#endif +#ifndef Py_HUGE_VAL + #define Py_HUGE_VAL HUGE_VAL +#endif +#ifdef PYPY_VERSION + #define CYTHON_COMPILING_IN_PYPY 1 + #define CYTHON_COMPILING_IN_PYSTON 0 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #undef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 0 + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #if PY_VERSION_HEX < 0x03050000 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #elif !defined(CYTHON_USE_ASYNC_SLOTS) + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #undef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 0 + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #undef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 1 + #undef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 0 + #undef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 0 + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #undef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE 0 + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 +#elif defined(PYSTON_VERSION) + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_PYSTON 1 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #ifndef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 1 + #endif + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #ifndef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 1 + #endif + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #ifndef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 0 + #endif + #ifndef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 1 + #endif + #ifndef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 1 + #endif + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #undef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE 0 + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 +#else + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_PYSTON 0 + #define CYTHON_COMPILING_IN_CPYTHON 1 + #ifndef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 1 + #endif + #if PY_VERSION_HEX < 0x02070000 + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #elif !defined(CYTHON_USE_PYTYPE_LOOKUP) + #define CYTHON_USE_PYTYPE_LOOKUP 1 + #endif + #if PY_MAJOR_VERSION < 3 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #elif !defined(CYTHON_USE_ASYNC_SLOTS) + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #if PY_VERSION_HEX < 0x02070000 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #elif !defined(CYTHON_USE_PYLONG_INTERNALS) + #define CYTHON_USE_PYLONG_INTERNALS 1 + #endif + #ifndef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 1 + #endif + #ifndef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 1 + #endif + #if PY_VERSION_HEX < 0x030300F0 + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #elif !defined(CYTHON_USE_UNICODE_WRITER) + #define CYTHON_USE_UNICODE_WRITER 1 + #endif + #ifndef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 0 + #endif + #ifndef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 1 + #endif + #ifndef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 1 + #endif + #ifndef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 1 + #endif + #ifndef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 1 + #endif + #ifndef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000) + #endif + #ifndef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1) + #endif + #ifndef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1) + #endif + #ifndef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3) + #endif +#endif +#if !defined(CYTHON_FAST_PYCCALL) +#define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) +#endif +#if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #undef SHIFT + #undef BASE + #undef MASK + #ifdef SIZEOF_VOID_P + enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) }; + #endif +#endif +#ifndef __has_attribute + #define __has_attribute(x) 0 +#endif +#ifndef __has_cpp_attribute + #define __has_cpp_attribute(x) 0 +#endif +#ifndef CYTHON_RESTRICT + #if defined(__GNUC__) + #define CYTHON_RESTRICT __restrict__ + #elif defined(_MSC_VER) && _MSC_VER >= 1400 + #define CYTHON_RESTRICT __restrict + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_RESTRICT restrict + #else + #define CYTHON_RESTRICT + #endif +#endif +#ifndef CYTHON_UNUSED +# if defined(__GNUC__) +# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +#endif +#ifndef CYTHON_MAYBE_UNUSED_VAR +# if defined(__cplusplus) + template void CYTHON_MAYBE_UNUSED_VAR( const T& ) { } +# else +# define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x) +# endif +#endif +#ifndef CYTHON_NCP_UNUSED +# if CYTHON_COMPILING_IN_CPYTHON +# define CYTHON_NCP_UNUSED +# else +# define CYTHON_NCP_UNUSED CYTHON_UNUSED +# endif +#endif +#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) +#ifdef _MSC_VER + #ifndef _MSC_STDINT_H_ + #if _MSC_VER < 1300 + typedef unsigned char uint8_t; + typedef unsigned int uint32_t; + #else + typedef unsigned __int8 uint8_t; + typedef unsigned __int32 uint32_t; + #endif + #endif +#else + #include +#endif +#ifndef CYTHON_FALLTHROUGH + #if defined(__cplusplus) && __cplusplus >= 201103L + #if __has_cpp_attribute(fallthrough) + #define CYTHON_FALLTHROUGH [[fallthrough]] + #elif __has_cpp_attribute(clang::fallthrough) + #define CYTHON_FALLTHROUGH [[clang::fallthrough]] + #elif __has_cpp_attribute(gnu::fallthrough) + #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] + #endif + #endif + #ifndef CYTHON_FALLTHROUGH + #if __has_attribute(fallthrough) + #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) + #else + #define CYTHON_FALLTHROUGH + #endif + #endif + #if defined(__clang__ ) && defined(__apple_build_version__) + #if __apple_build_version__ < 7000000 + #undef CYTHON_FALLTHROUGH + #define CYTHON_FALLTHROUGH + #endif + #endif +#endif + +#ifndef CYTHON_INLINE + #if defined(__clang__) + #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) + #elif defined(__GNUC__) + #define CYTHON_INLINE __inline__ + #elif defined(_MSC_VER) + #define CYTHON_INLINE __inline + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_INLINE inline + #else + #define CYTHON_INLINE + #endif +#endif + +#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) + #define Py_OptimizeFlag 0 +#endif +#define __PYX_BUILD_PY_SSIZE_T "n" +#define CYTHON_FORMAT_SSIZE_T "z" +#if PY_MAJOR_VERSION < 3 + #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyClass_Type +#else + #define __Pyx_BUILTIN_MODULE_NAME "builtins" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyType_Type +#endif +#ifndef Py_TPFLAGS_CHECKTYPES + #define Py_TPFLAGS_CHECKTYPES 0 +#endif +#ifndef Py_TPFLAGS_HAVE_INDEX + #define Py_TPFLAGS_HAVE_INDEX 0 +#endif +#ifndef Py_TPFLAGS_HAVE_NEWBUFFER + #define Py_TPFLAGS_HAVE_NEWBUFFER 0 +#endif +#ifndef Py_TPFLAGS_HAVE_FINALIZE + #define Py_TPFLAGS_HAVE_FINALIZE 0 +#endif +#ifndef METH_STACKLESS + #define METH_STACKLESS 0 +#endif +#if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) + #ifndef METH_FASTCALL + #define METH_FASTCALL 0x80 + #endif + typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs); + typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args, + Py_ssize_t nargs, PyObject *kwnames); +#else + #define __Pyx_PyCFunctionFast _PyCFunctionFast + #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords +#endif +#if CYTHON_FAST_PYCCALL +#define __Pyx_PyFastCFunction_Check(func)\ + ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS))))) +#else +#define __Pyx_PyFastCFunction_Check(func) 0 +#endif +#if CYTHON_USE_DICT_VERSIONS +#define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) +#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ + (version_var) = __PYX_GET_DICT_VERSION(dict);\ + (cache_var) = (value); +#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ + static PY_UINT64_T __pyx_dict_version = 0;\ + static PyObject *__pyx_dict_cached_value = NULL;\ + if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ + (VAR) = __pyx_dict_cached_value;\ + } else {\ + (VAR) = __pyx_dict_cached_value = (LOOKUP);\ + __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ + }\ + } +#else +#define __PYX_GET_DICT_VERSION(dict) (0) +#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) +#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) + #define PyObject_Malloc(s) PyMem_Malloc(s) + #define PyObject_Free(p) PyMem_Free(p) + #define PyObject_Realloc(p) PyMem_Realloc(p) +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1 + #define PyMem_RawMalloc(n) PyMem_Malloc(n) + #define PyMem_RawRealloc(p, n) PyMem_Realloc(p, n) + #define PyMem_RawFree(p) PyMem_Free(p) +#endif +#if CYTHON_COMPILING_IN_PYSTON + #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co) + #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno) +#else + #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) + #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) +#endif +#if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000 + #define __Pyx_PyThreadState_Current PyThreadState_GET() +#elif PY_VERSION_HEX >= 0x03060000 + #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() +#elif PY_VERSION_HEX >= 0x03000000 + #define __Pyx_PyThreadState_Current PyThreadState_GET() +#else + #define __Pyx_PyThreadState_Current _PyThreadState_Current +#endif +#if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) +#include "pythread.h" +#define Py_tss_NEEDS_INIT 0 +typedef int Py_tss_t; +static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) { + *key = PyThread_create_key(); + return 0; // PyThread_create_key reports success always +} +static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) { + Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t)); + *key = Py_tss_NEEDS_INIT; + return key; +} +static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) { + PyObject_Free(key); +} +static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) { + return *key != Py_tss_NEEDS_INIT; +} +static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) { + PyThread_delete_key(*key); + *key = Py_tss_NEEDS_INIT; +} +static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) { + return PyThread_set_key_value(*key, value); +} +static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { + return PyThread_get_key_value(*key); +} +#endif // TSS (Thread Specific Storage) API +#if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized) +#define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) +#else +#define __Pyx_PyDict_NewPresized(n) PyDict_New() +#endif +#if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION + #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) +#else + #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS +#define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) +#else +#define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name) +#endif +#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) + #define CYTHON_PEP393_ENABLED 1 + #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ + 0 : _PyUnicode_Ready((PyObject *)(op))) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) + #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) + #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) + #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) + #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) + #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch) + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) +#else + #define CYTHON_PEP393_ENABLED 0 + #define PyUnicode_1BYTE_KIND 1 + #define PyUnicode_2BYTE_KIND 2 + #define PyUnicode_4BYTE_KIND 4 + #define __Pyx_PyUnicode_READY(op) (0) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) + #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111) + #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) + #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) + #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) + #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch) + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) +#endif +#if CYTHON_COMPILING_IN_PYPY + #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) +#else + #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ + PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains) + #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check) + #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format) + #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) +#endif +#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) +#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) +#else + #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) +#endif +#if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) + #define PyObject_ASCII(o) PyObject_Repr(o) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBaseString_Type PyUnicode_Type + #define PyStringObject PyUnicodeObject + #define PyString_Type PyUnicode_Type + #define PyString_Check PyUnicode_Check + #define PyString_CheckExact PyUnicode_CheckExact + #define PyObject_Unicode PyObject_Str +#endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) + #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) +#else + #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) + #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) +#endif +#ifndef PySet_CheckExact + #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) +#endif +#if CYTHON_ASSUME_SAFE_MACROS + #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) +#else + #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyIntObject PyLongObject + #define PyInt_Type PyLong_Type + #define PyInt_Check(op) PyLong_Check(op) + #define PyInt_CheckExact(op) PyLong_CheckExact(op) + #define PyInt_FromString PyLong_FromString + #define PyInt_FromUnicode PyLong_FromUnicode + #define PyInt_FromLong PyLong_FromLong + #define PyInt_FromSize_t PyLong_FromSize_t + #define PyInt_FromSsize_t PyLong_FromSsize_t + #define PyInt_AsLong PyLong_AsLong + #define PyInt_AS_LONG PyLong_AS_LONG + #define PyInt_AsSsize_t PyLong_AsSsize_t + #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask + #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask + #define PyNumber_Int PyNumber_Long +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBoolObject PyLongObject +#endif +#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY + #ifndef PyUnicode_InternFromString + #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) + #endif +#endif +#if PY_VERSION_HEX < 0x030200A4 + typedef long Py_hash_t; + #define __Pyx_PyInt_FromHash_t PyInt_FromLong + #define __Pyx_PyInt_AsHash_t PyInt_AsLong +#else + #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t + #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t +#endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : (Py_INCREF(func), func)) +#else + #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) +#endif +#if CYTHON_USE_ASYNC_SLOTS + #if PY_VERSION_HEX >= 0x030500B1 + #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods + #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) + #else + #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) + #endif +#else + #define __Pyx_PyType_AsAsync(obj) NULL +#endif +#ifndef __Pyx_PyAsyncMethodsStruct + typedef struct { + unaryfunc am_await; + unaryfunc am_aiter; + unaryfunc am_anext; + } __Pyx_PyAsyncMethodsStruct; +#endif + +#if defined(WIN32) || defined(MS_WINDOWS) + #define _USE_MATH_DEFINES +#endif +#include +#ifdef NAN +#define __PYX_NAN() ((float) NAN) +#else +static CYTHON_INLINE float __PYX_NAN() { + float value; + memset(&value, 0xFF, sizeof(value)); + return value; +} +#endif +#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) +#define __Pyx_truncl trunc +#else +#define __Pyx_truncl truncl +#endif + + +#define __PYX_ERR(f_index, lineno, Ln_error) \ +{ \ + __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \ +} + +#ifndef __PYX_EXTERN_C + #ifdef __cplusplus + #define __PYX_EXTERN_C extern "C" + #else + #define __PYX_EXTERN_C extern + #endif +#endif + +#define __PYX_HAVE__gevent____imap +#define __PYX_HAVE_API__gevent____imap +/* Early includes */ +#include "greenlet/greenlet.h" +#include "frameobject.h" +#ifdef _OPENMP +#include +#endif /* _OPENMP */ + +#if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) +#define CYTHON_WITHOUT_ASSERTIONS +#endif + +typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; + const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; + +#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 +#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0 +#define __PYX_DEFAULT_STRING_ENCODING "" +#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString +#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#define __Pyx_uchar_cast(c) ((unsigned char)c) +#define __Pyx_long_cast(x) ((long)x) +#define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ + (sizeof(type) < sizeof(Py_ssize_t)) ||\ + (sizeof(type) > sizeof(Py_ssize_t) &&\ + likely(v < (type)PY_SSIZE_T_MAX ||\ + v == (type)PY_SSIZE_T_MAX) &&\ + (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ + v == (type)PY_SSIZE_T_MIN))) ||\ + (sizeof(type) == sizeof(Py_ssize_t) &&\ + (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ + v == (type)PY_SSIZE_T_MAX))) ) +static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) { + return (size_t) i < (size_t) limit; +} +#if defined (__cplusplus) && __cplusplus >= 201103L + #include + #define __Pyx_sst_abs(value) std::abs(value) +#elif SIZEOF_INT >= SIZEOF_SIZE_T + #define __Pyx_sst_abs(value) abs(value) +#elif SIZEOF_LONG >= SIZEOF_SIZE_T + #define __Pyx_sst_abs(value) labs(value) +#elif defined (_MSC_VER) + #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) +#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define __Pyx_sst_abs(value) llabs(value) +#elif defined (__GNUC__) + #define __Pyx_sst_abs(value) __builtin_llabs(value) +#else + #define __Pyx_sst_abs(value) ((value<0) ? -value : value) +#endif +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*); +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); +#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) +#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) +#define __Pyx_PyBytes_FromString PyBytes_FromString +#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); +#if PY_MAJOR_VERSION < 3 + #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#else + #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize +#endif +#define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) +#define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) +#define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) +#define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) +#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) +static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) { + const Py_UNICODE *u_end = u; + while (*u_end++) ; + return (size_t)(u_end - u - 1); +} +#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) +#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode +#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode +#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) +#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) +static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); +static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*); +static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); +#define __Pyx_PySequence_Tuple(obj)\ + (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); +#if CYTHON_ASSUME_SAFE_MACROS +#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) +#else +#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) +#endif +#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) +#if PY_MAJOR_VERSION >= 3 +#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) +#else +#define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) +#endif +#define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x)) +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII +static int __Pyx_sys_getdefaultencoding_not_ascii; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + PyObject* ascii_chars_u = NULL; + PyObject* ascii_chars_b = NULL; + const char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + if (strcmp(default_encoding_c, "ascii") == 0) { + __Pyx_sys_getdefaultencoding_not_ascii = 0; + } else { + char ascii_chars[128]; + int c; + for (c = 0; c < 128; c++) { + ascii_chars[c] = c; + } + __Pyx_sys_getdefaultencoding_not_ascii = 1; + ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); + if (!ascii_chars_u) goto bad; + ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); + if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { + PyErr_Format( + PyExc_ValueError, + "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", + default_encoding_c); + goto bad; + } + Py_DECREF(ascii_chars_u); + Py_DECREF(ascii_chars_b); + } + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + Py_XDECREF(ascii_chars_u); + Py_XDECREF(ascii_chars_b); + return -1; +} +#endif +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) +#else +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +static char* __PYX_DEFAULT_STRING_ENCODING; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1); + if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; + strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + return -1; +} +#endif +#endif + + +/* Test for GCC > 2.95 */ +#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) + #define likely(x) __builtin_expect(!!(x), 1) + #define unlikely(x) __builtin_expect(!!(x), 0) +#else /* !__GNUC__ or GCC < 2.95 */ + #define likely(x) (x) + #define unlikely(x) (x) +#endif /* __GNUC__ */ +static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } + +static PyObject *__pyx_m = NULL; +static PyObject *__pyx_d; +static PyObject *__pyx_b; +static PyObject *__pyx_cython_runtime = NULL; +static PyObject *__pyx_empty_tuple; +static PyObject *__pyx_empty_bytes; +static PyObject *__pyx_empty_unicode; +static int __pyx_lineno; +static int __pyx_clineno = 0; +static const char * __pyx_cfilenm= __FILE__; +static const char *__pyx_filename; + + +static const char *__pyx_f[] = { + "src\\gevent\\_imap.py", + "src\\gevent\\__imap.pxd", + "src\\gevent\\__greenlet_primitives.pxd", + "src\\gevent\\__waiter.pxd", + "src\\gevent\\_greenlet.pxd", + "src\\gevent\\__abstract_linkable.pxd", + "src\\gevent\\__ident.pxd", + "src\\gevent\\__semaphore.pxd", + "src\\gevent\\_event.pxd", + "src\\gevent\\_queue.pxd", +}; + +/*--- Type declarations ---*/ +struct __pyx_obj_6gevent_7__ident_ValuedWeakRef; +struct __pyx_obj_6gevent_7__ident_IdentRegistry; +struct __pyx_obj_6gevent_21__greenlet_primitives_TrackedRawGreenlet; +struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop; +struct __pyx_obj_6gevent_8__waiter_Waiter; +struct __pyx_obj_6gevent_8__waiter_MultipleWaiter; +struct __pyx_obj_6gevent_9_greenlet_SpawnedLink; +struct __pyx_obj_6gevent_9_greenlet_SuccessSpawnedLink; +struct __pyx_obj_6gevent_9_greenlet_FailureSpawnedLink; +struct __pyx_obj_6gevent_9_greenlet__Frame; +struct __pyx_obj_6gevent_9_greenlet_Greenlet; +struct __pyx_obj_6gevent_9_greenlet__dummy_event; +struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable; +struct __pyx_obj_6gevent_11__semaphore_Semaphore; +struct __pyx_obj_6gevent_11__semaphore_BoundedSemaphore; +struct __pyx_obj_6gevent_6_event_Event; +struct __pyx_obj_6gevent_6_event_AsyncResult; +struct __pyx_obj_6gevent_6_queue_ItemWaiter; +struct __pyx_obj_6gevent_6_queue_Queue; +struct __pyx_obj_6gevent_6_queue_UnboundQueue; +struct __pyx_obj_6gevent_6_queue_PriorityQueue; +struct __pyx_obj_6gevent_6_queue_LifoQueue; +struct __pyx_obj_6gevent_6_queue_JoinableQueue; +struct __pyx_obj_6gevent_6_queue_Channel; +struct __pyx_obj_6gevent_6__imap_Failure; +struct __pyx_obj_6gevent_6__imap_IMapUnordered; +struct __pyx_obj_6gevent_6__imap_IMap; +struct __pyx_opt_args_6gevent_9_greenlet_8Greenlet_join; +struct __pyx_opt_args_6gevent_9_greenlet_joinall; + +/* "gevent/_greenlet.pxd":105 + * + * cpdef bint has_links(self) + * cpdef join(self, timeout=*) # <<<<<<<<<<<<<< + * cpdef bint ready(self) + * cpdef bint successful(self) + */ +struct __pyx_opt_args_6gevent_9_greenlet_8Greenlet_join { + int __pyx_n; + PyObject *timeout; +}; + +/* "gevent/_greenlet.pxd":174 + * + * @cython.locals(done=list) + * cpdef joinall(greenlets, timeout=*, raise_error=*, count=*) # <<<<<<<<<<<<<< + * + * cdef set _spawn_callbacks + */ +struct __pyx_opt_args_6gevent_9_greenlet_joinall { + int __pyx_n; + PyObject *timeout; + PyObject *raise_error; + PyObject *count; +}; +struct __pyx_opt_args_6gevent_19__abstract_linkable_16AbstractLinkable__wait_core; +struct __pyx_opt_args_6gevent_19__abstract_linkable_16AbstractLinkable__wait; + +/* "gevent/__abstract_linkable.pxd":51 + * cdef _check_and_notify(self) + * cpdef _notify_links(self) + * cdef _wait_core(self, timeout, catch=*) # <<<<<<<<<<<<<< + * cdef _wait_return_value(self, waited, wait_success) + * cdef _wait(self, timeout=*) + */ +struct __pyx_opt_args_6gevent_19__abstract_linkable_16AbstractLinkable__wait_core { + int __pyx_n; + PyObject *catch; +}; + +/* "gevent/__abstract_linkable.pxd":53 + * cdef _wait_core(self, timeout, catch=*) + * cdef _wait_return_value(self, waited, wait_success) + * cdef _wait(self, timeout=*) # <<<<<<<<<<<<<< + */ +struct __pyx_opt_args_6gevent_19__abstract_linkable_16AbstractLinkable__wait { + int __pyx_n; + PyObject *timeout; +}; +struct __pyx_opt_args_6gevent_11__semaphore_9Semaphore_wait; +struct __pyx_opt_args_6gevent_11__semaphore_9Semaphore_acquire; + +/* "gevent/__semaphore.pxd":15 + * # threadpool uses it + * cpdef _start_notify(self) + * cpdef int wait(self, object timeout=*) except -1000 # <<<<<<<<<<<<<< + * cpdef bint acquire(self, int blocking=*, object timeout=*) except -1000 + * cpdef __enter__(self) + */ +struct __pyx_opt_args_6gevent_11__semaphore_9Semaphore_wait { + int __pyx_n; + PyObject *timeout; +}; + +/* "gevent/__semaphore.pxd":16 + * cpdef _start_notify(self) + * cpdef int wait(self, object timeout=*) except -1000 + * cpdef bint acquire(self, int blocking=*, object timeout=*) except -1000 # <<<<<<<<<<<<<< + * cpdef __enter__(self) + * cpdef __exit__(self, object t, object v, object tb) + */ +struct __pyx_opt_args_6gevent_11__semaphore_9Semaphore_acquire { + int __pyx_n; + int blocking; + PyObject *timeout; +}; +struct __pyx_opt_args_6gevent_6_event_11AsyncResult_get; +struct __pyx_opt_args_6gevent_6_event_11AsyncResult_wait; + +/* "gevent/_event.pxd":23 + * cdef public int _imap_task_index + * + * cpdef get(self, block=*, timeout=*) # <<<<<<<<<<<<<< + * cpdef bint successful(self) + * + */ +struct __pyx_opt_args_6gevent_6_event_11AsyncResult_get { + int __pyx_n; + PyObject *block; + PyObject *timeout; +}; + +/* "gevent/_event.pxd":26 + * cpdef bint successful(self) + * + * cpdef wait(self, timeout=*) # <<<<<<<<<<<<<< + * cpdef bint done(self) + * + */ +struct __pyx_opt_args_6gevent_6_event_11AsyncResult_wait { + int __pyx_n; + PyObject *timeout; +}; +struct __pyx_opt_args_6gevent_6_queue_5Queue_put; +struct __pyx_opt_args_6gevent_6_queue_5Queue_get; +struct __pyx_opt_args_6gevent_6_queue_5Queue_peek; +struct __pyx_opt_args_6gevent_6_queue_7Channel_get; + +/* "gevent/_queue.pxd":37 + * cpdef bint full(self) + * + * cpdef put(self, item, block=*, timeout=*) # <<<<<<<<<<<<<< + * cpdef put_nowait(self, item) + * + */ +struct __pyx_opt_args_6gevent_6_queue_5Queue_put { + int __pyx_n; + PyObject *block; + PyObject *timeout; +}; + +/* "gevent/_queue.pxd":42 + * cdef __get_or_peek(self, method, block, timeout) + * + * cpdef get(self, block=*, timeout=*) # <<<<<<<<<<<<<< + * cpdef get_nowait(self) + * cpdef peek(self, block=*, timeout=*) + */ +struct __pyx_opt_args_6gevent_6_queue_5Queue_get { + int __pyx_n; + PyObject *block; + PyObject *timeout; +}; + +/* "gevent/_queue.pxd":44 + * cpdef get(self, block=*, timeout=*) + * cpdef get_nowait(self) + * cpdef peek(self, block=*, timeout=*) # <<<<<<<<<<<<<< + * cpdef peek_nowait(self) + * + */ +struct __pyx_opt_args_6gevent_6_queue_5Queue_peek { + int __pyx_n; + PyObject *block; + PyObject *timeout; +}; + +/* "gevent/_queue.pxd":71 + * cdef _event_unlock + * + * cpdef get(self, block=*, timeout=*) # <<<<<<<<<<<<<< + * cpdef get_nowait(self) + * + */ +struct __pyx_opt_args_6gevent_6_queue_7Channel_get { + int __pyx_n; + PyObject *block; + PyObject *timeout; +}; + +/* "gevent/__ident.pxd":15 + * @cython.internal + * @cython.final + * cdef class ValuedWeakRef(ref): # <<<<<<<<<<<<<< + * cdef object value + * + */ +struct __pyx_obj_6gevent_7__ident_ValuedWeakRef { + PyWeakReference __pyx_base; + PyObject *value; +}; + + +/* "gevent/__ident.pxd":19 + * + * @cython.final + * cdef class IdentRegistry: # <<<<<<<<<<<<<< + * cdef object _registry + * cdef list _available_idents + */ +struct __pyx_obj_6gevent_7__ident_IdentRegistry { + PyObject_HEAD + struct __pyx_vtabstruct_6gevent_7__ident_IdentRegistry *__pyx_vtab; + PyObject *_registry; + PyObject *_available_idents; +}; + + +/* "gevent/__greenlet_primitives.pxd":37 + * return PyGreenlet_Switch(self, NULL, NULL) + * + * cdef class TrackedRawGreenlet(greenlet): # <<<<<<<<<<<<<< + * pass + * + */ +struct __pyx_obj_6gevent_21__greenlet_primitives_TrackedRawGreenlet { + PyGreenlet __pyx_base; +}; + + +/* "gevent/__greenlet_primitives.pxd":40 + * pass + * + * cdef class SwitchOutGreenletWithLoop(TrackedRawGreenlet): # <<<<<<<<<<<<<< + * cdef public loop + * + */ +struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop { + struct __pyx_obj_6gevent_21__greenlet_primitives_TrackedRawGreenlet __pyx_base; + struct __pyx_vtabstruct_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *__pyx_vtab; + PyObject *loop; +}; + + +/* "gevent/__waiter.pxd":33 + * _greenlet_imported = True + * + * cdef class Waiter: # <<<<<<<<<<<<<< + * cdef readonly SwitchOutGreenletWithLoop hub + * cdef readonly greenlet greenlet + */ +struct __pyx_obj_6gevent_8__waiter_Waiter { + PyObject_HEAD + struct __pyx_vtabstruct_6gevent_8__waiter_Waiter *__pyx_vtab; + struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *hub; + PyGreenlet *greenlet; + PyObject *value; + PyObject *_exception; +}; + + +/* "gevent/__waiter.pxd":47 + * @cython.final + * @cython.internal + * cdef class MultipleWaiter(Waiter): # <<<<<<<<<<<<<< + * cdef list _values + */ +struct __pyx_obj_6gevent_8__waiter_MultipleWaiter { + struct __pyx_obj_6gevent_8__waiter_Waiter __pyx_base; + PyObject *_values; +}; + + +/* "gevent/_greenlet.pxd":56 + * cdef void _init() + * + * cdef class SpawnedLink: # <<<<<<<<<<<<<< + * cdef public object callback + * + */ +struct __pyx_obj_6gevent_9_greenlet_SpawnedLink { + PyObject_HEAD + PyObject *callback; +}; + + +/* "gevent/_greenlet.pxd":61 + * + * @cython.final + * cdef class SuccessSpawnedLink(SpawnedLink): # <<<<<<<<<<<<<< + * pass + * + */ +struct __pyx_obj_6gevent_9_greenlet_SuccessSpawnedLink { + struct __pyx_obj_6gevent_9_greenlet_SpawnedLink __pyx_base; +}; + + +/* "gevent/_greenlet.pxd":65 + * + * @cython.final + * cdef class FailureSpawnedLink(SpawnedLink): # <<<<<<<<<<<<<< + * pass + * + */ +struct __pyx_obj_6gevent_9_greenlet_FailureSpawnedLink { + struct __pyx_obj_6gevent_9_greenlet_SpawnedLink __pyx_base; +}; + + +/* "gevent/_greenlet.pxd":71 + * @cython.internal + * @cython.freelist(1000) + * cdef class _Frame: # <<<<<<<<<<<<<< + * cdef readonly CodeType f_code + * cdef readonly int f_lineno + */ +struct __pyx_obj_6gevent_9_greenlet__Frame { + PyObject_HEAD + PyCodeObject *f_code; + int f_lineno; + struct __pyx_obj_6gevent_9_greenlet__Frame *f_back; +}; + + +/* "gevent/_greenlet.pxd":86 + * + * + * cdef class Greenlet(greenlet): # <<<<<<<<<<<<<< + * cdef readonly object value + * cdef readonly tuple args + */ +struct __pyx_obj_6gevent_9_greenlet_Greenlet { + PyGreenlet __pyx_base; + struct __pyx_vtabstruct_6gevent_9_greenlet_Greenlet *__pyx_vtab; + PyObject *value; + PyObject *args; + PyObject *kwargs; + PyObject *spawning_greenlet; + PyObject *spawn_tree_locals; + PyObject *_spawning_stack_frames; + PyObject *_links; + PyObject *_exc_info; + PyObject *_notifier; + PyObject *_start_event; + PyObject *_formatted_info; + PyObject *_ident; +}; + + +/* "gevent/_greenlet.pxd":157 + * @cython.final + * @cython.internal + * cdef class _dummy_event: # <<<<<<<<<<<<<< + * cdef readonly bint pending + * cdef readonly bint active + */ +struct __pyx_obj_6gevent_9_greenlet__dummy_event { + PyObject_HEAD + struct __pyx_vtabstruct_6gevent_9_greenlet__dummy_event *__pyx_vtab; + int pending; + int active; +}; + + +/* "gevent/__abstract_linkable.pxd":32 + * cdef void _init() + * + * cdef class AbstractLinkable(object): # <<<<<<<<<<<<<< + * # We declare the __weakref__ here in the base (even though + * # that's not really what we want) as a workaround for a Cython + */ +struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable { + PyObject_HEAD + struct __pyx_vtabstruct_6gevent_19__abstract_linkable_AbstractLinkable *__pyx_vtab; + PyObject *__weakref__; + struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *hub; + PyObject *_notifier; + PyObject *_links; + int _notify_all; +}; + + +/* "gevent/__semaphore.pxd":7 + * + * + * cdef class Semaphore(AbstractLinkable): # <<<<<<<<<<<<<< + * cdef public int counter + * + */ +struct __pyx_obj_6gevent_11__semaphore_Semaphore { + struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable __pyx_base; + int counter; +}; + + +/* "gevent/__semaphore.pxd":20 + * cpdef __exit__(self, object t, object v, object tb) + * + * cdef class BoundedSemaphore(Semaphore): # <<<<<<<<<<<<<< + * cdef readonly int _initial_value + * + */ +struct __pyx_obj_6gevent_11__semaphore_BoundedSemaphore { + struct __pyx_obj_6gevent_11__semaphore_Semaphore __pyx_base; + int _initial_value; +}; + + +/* "gevent/_event.pxd":13 + * cdef Timeout + * + * cdef class Event(AbstractLinkable): # <<<<<<<<<<<<<< + * cdef bint _flag + * + */ +struct __pyx_obj_6gevent_6_event_Event { + struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable __pyx_base; + int _flag; +}; + + +/* "gevent/_event.pxd":16 + * cdef bint _flag + * + * cdef class AsyncResult(AbstractLinkable): # <<<<<<<<<<<<<< + * cdef readonly _value + * cdef readonly tuple _exc_info + */ +struct __pyx_obj_6gevent_6_event_AsyncResult { + struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable __pyx_base; + PyObject *_value; + PyObject *_exc_info; + int _imap_task_index; +}; + + +/* "gevent/_queue.pxd":14 + * @cython.final + * @cython.internal + * cdef class ItemWaiter(Waiter): # <<<<<<<<<<<<<< + * cdef readonly item + * cdef readonly queue + */ +struct __pyx_obj_6gevent_6_queue_ItemWaiter { + struct __pyx_obj_6gevent_8__waiter_Waiter __pyx_base; + PyObject *item; + PyObject *queue; +}; + + +/* "gevent/_queue.pxd":18 + * cdef readonly queue + * + * cdef class Queue: # <<<<<<<<<<<<<< + * cdef __weakref__ + * cdef readonly hub + */ +struct __pyx_obj_6gevent_6_queue_Queue { + PyObject_HEAD + struct __pyx_vtabstruct_6gevent_6_queue_Queue *__pyx_vtab; + PyObject *__weakref__; + PyObject *hub; + PyObject *queue; + PyObject *getters; + PyObject *putters; + PyObject *_event_unlock; + Py_ssize_t _maxsize; +}; + + +/* "gevent/_queue.pxd":50 + * + * @cython.final + * cdef class UnboundQueue(Queue): # <<<<<<<<<<<<<< + * pass + * + */ +struct __pyx_obj_6gevent_6_queue_UnboundQueue { + struct __pyx_obj_6gevent_6_queue_Queue __pyx_base; +}; + + +/* "gevent/_queue.pxd":53 + * pass + * + * cdef class PriorityQueue(Queue): # <<<<<<<<<<<<<< + * pass + * + */ +struct __pyx_obj_6gevent_6_queue_PriorityQueue { + struct __pyx_obj_6gevent_6_queue_Queue __pyx_base; +}; + + +/* "gevent/_queue.pxd":56 + * pass + * + * cdef class LifoQueue(Queue): # <<<<<<<<<<<<<< + * pass + * + */ +struct __pyx_obj_6gevent_6_queue_LifoQueue { + struct __pyx_obj_6gevent_6_queue_Queue __pyx_base; +}; + + +/* "gevent/_queue.pxd":59 + * pass + * + * cdef class JoinableQueue(Queue): # <<<<<<<<<<<<<< + * cdef Event _cond + * cdef readonly int unfinished_tasks + */ +struct __pyx_obj_6gevent_6_queue_JoinableQueue { + struct __pyx_obj_6gevent_6_queue_Queue __pyx_base; + struct __pyx_obj_6gevent_6_event_Event *_cond; + int unfinished_tasks; +}; + + +/* "gevent/_queue.pxd":64 + * + * + * cdef class Channel: # <<<<<<<<<<<<<< + * cdef __weakref__ + * cdef readonly getters + */ +struct __pyx_obj_6gevent_6_queue_Channel { + PyObject_HEAD + struct __pyx_vtabstruct_6gevent_6_queue_Channel *__pyx_vtab; + PyObject *__weakref__; + PyObject *getters; + PyObject *putters; + PyObject *hub; + PyObject *_event_unlock; +}; + + +/* "gevent/__imap.pxd":9 + * @cython.internal + * @cython.final + * cdef class Failure: # <<<<<<<<<<<<<< + * cdef readonly exc + * cdef raise_exception + */ +struct __pyx_obj_6gevent_6__imap_Failure { + PyObject_HEAD + PyObject *exc; + PyObject *raise_exception; +}; + + +/* "gevent/__imap.pxd":15 + * cdef inline _raise_exc(Failure failure) + * + * cdef class IMapUnordered(Greenlet): # <<<<<<<<<<<<<< + * cdef bint _zipped + * cdef func + */ +struct __pyx_obj_6gevent_6__imap_IMapUnordered { + struct __pyx_obj_6gevent_9_greenlet_Greenlet __pyx_base; + int _zipped; + PyObject *func; + PyObject *iterable; + PyObject *spawn; + struct __pyx_obj_6gevent_11__semaphore_Semaphore *_result_semaphore; + int _outstanding_tasks; + int _max_index; + struct __pyx_obj_6gevent_6_queue_UnboundQueue *queue; + int finished; +}; + + +/* "gevent/__imap.pxd":40 + * cdef _iqueue_value_for_self_failure(self, exception) + * + * cdef class IMap(IMapUnordered): # <<<<<<<<<<<<<< + * cdef int index + * cdef dict _results + */ +struct __pyx_obj_6gevent_6__imap_IMap { + struct __pyx_obj_6gevent_6__imap_IMapUnordered __pyx_base; + int index; + PyObject *_results; +}; + + + +/* "gevent/__ident.pxd":19 + * + * @cython.final + * cdef class IdentRegistry: # <<<<<<<<<<<<<< + * cdef object _registry + * cdef list _available_idents + */ + +struct __pyx_vtabstruct_6gevent_7__ident_IdentRegistry { + PyObject *(*get_ident)(struct __pyx_obj_6gevent_7__ident_IdentRegistry *, PyObject *, int __pyx_skip_dispatch); + PyObject *(*_return_ident)(struct __pyx_obj_6gevent_7__ident_IdentRegistry *, struct __pyx_obj_6gevent_7__ident_ValuedWeakRef *, int __pyx_skip_dispatch); +}; +static struct __pyx_vtabstruct_6gevent_7__ident_IdentRegistry *__pyx_vtabptr_6gevent_7__ident_IdentRegistry; + + +/* "gevent/__greenlet_primitives.pxd":40 + * pass + * + * cdef class SwitchOutGreenletWithLoop(TrackedRawGreenlet): # <<<<<<<<<<<<<< + * cdef public loop + * + */ + +struct __pyx_vtabstruct_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop { + PyObject *(*__pyx_switch)(struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *, int __pyx_skip_dispatch); + PyObject *(*switch_out)(struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *, int __pyx_skip_dispatch); +}; +static struct __pyx_vtabstruct_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *__pyx_vtabptr_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop; + + +/* "gevent/__waiter.pxd":33 + * _greenlet_imported = True + * + * cdef class Waiter: # <<<<<<<<<<<<<< + * cdef readonly SwitchOutGreenletWithLoop hub + * cdef readonly greenlet greenlet + */ + +struct __pyx_vtabstruct_6gevent_8__waiter_Waiter { + PyObject *(*get)(struct __pyx_obj_6gevent_8__waiter_Waiter *, int __pyx_skip_dispatch); + PyObject *(*clear)(struct __pyx_obj_6gevent_8__waiter_Waiter *, int __pyx_skip_dispatch); +}; +static struct __pyx_vtabstruct_6gevent_8__waiter_Waiter *__pyx_vtabptr_6gevent_8__waiter_Waiter; + + +/* "gevent/__waiter.pxd":47 + * @cython.final + * @cython.internal + * cdef class MultipleWaiter(Waiter): # <<<<<<<<<<<<<< + * cdef list _values + */ + +struct __pyx_vtabstruct_6gevent_8__waiter_MultipleWaiter { + struct __pyx_vtabstruct_6gevent_8__waiter_Waiter __pyx_base; +}; +static struct __pyx_vtabstruct_6gevent_8__waiter_MultipleWaiter *__pyx_vtabptr_6gevent_8__waiter_MultipleWaiter; + + +/* "gevent/_greenlet.pxd":86 + * + * + * cdef class Greenlet(greenlet): # <<<<<<<<<<<<<< + * cdef readonly object value + * cdef readonly tuple args + */ + +struct __pyx_vtabstruct_6gevent_9_greenlet_Greenlet { + int (*has_links)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *, int __pyx_skip_dispatch); + PyObject *(*join)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_9_greenlet_8Greenlet_join *__pyx_optional_args); + int (*ready)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *, int __pyx_skip_dispatch); + int (*successful)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *, int __pyx_skip_dispatch); + PyObject *(*rawlink)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *, PyObject *, int __pyx_skip_dispatch); + PyObject *(*_formatinfo)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *, int __pyx_skip_dispatch); + PyObject *(*_get_minimal_ident)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *); + int (*__pyx___started_but_aborted)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *); + int (*__pyx___start_cancelled_by_kill)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *); + int (*__pyx___start_pending)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *); + int (*__pyx___never_started_or_killed)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *); + int (*__pyx___start_completed)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *); + PyObject *(*__pyx___handle_death_before_start)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *, PyObject *); + PyObject *(*__pyx___cancel_start)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *); + PyObject *(*_report_result)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *, PyObject *); + PyObject *(*_report_error)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *, PyObject *); + PyObject *(*_notify_links)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *, int __pyx_skip_dispatch); +}; +static struct __pyx_vtabstruct_6gevent_9_greenlet_Greenlet *__pyx_vtabptr_6gevent_9_greenlet_Greenlet; + + +/* "gevent/_greenlet.pxd":157 + * @cython.final + * @cython.internal + * cdef class _dummy_event: # <<<<<<<<<<<<<< + * cdef readonly bint pending + * cdef readonly bint active + */ + +struct __pyx_vtabstruct_6gevent_9_greenlet__dummy_event { + PyObject *(*stop)(struct __pyx_obj_6gevent_9_greenlet__dummy_event *, int __pyx_skip_dispatch); + PyObject *(*start)(struct __pyx_obj_6gevent_9_greenlet__dummy_event *, PyObject *, int __pyx_skip_dispatch); + PyObject *(*close)(struct __pyx_obj_6gevent_9_greenlet__dummy_event *, int __pyx_skip_dispatch); +}; +static struct __pyx_vtabstruct_6gevent_9_greenlet__dummy_event *__pyx_vtabptr_6gevent_9_greenlet__dummy_event; + + +/* "gevent/__abstract_linkable.pxd":32 + * cdef void _init() + * + * cdef class AbstractLinkable(object): # <<<<<<<<<<<<<< + * # We declare the __weakref__ here in the base (even though + * # that's not really what we want) as a workaround for a Cython + */ + +struct __pyx_vtabstruct_6gevent_19__abstract_linkable_AbstractLinkable { + PyObject *(*rawlink)(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *, PyObject *, int __pyx_skip_dispatch); + int (*ready)(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *, int __pyx_skip_dispatch); + PyObject *(*unlink)(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *, PyObject *, int __pyx_skip_dispatch); + PyObject *(*_check_and_notify)(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *); + PyObject *(*_notify_links)(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *, int __pyx_skip_dispatch); + PyObject *(*_wait_core)(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *, PyObject *, struct __pyx_opt_args_6gevent_19__abstract_linkable_16AbstractLinkable__wait_core *__pyx_optional_args); + PyObject *(*_wait_return_value)(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *, PyObject *, PyObject *); + PyObject *(*_wait)(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *, struct __pyx_opt_args_6gevent_19__abstract_linkable_16AbstractLinkable__wait *__pyx_optional_args); +}; +static struct __pyx_vtabstruct_6gevent_19__abstract_linkable_AbstractLinkable *__pyx_vtabptr_6gevent_19__abstract_linkable_AbstractLinkable; + + +/* "gevent/__semaphore.pxd":7 + * + * + * cdef class Semaphore(AbstractLinkable): # <<<<<<<<<<<<<< + * cdef public int counter + * + */ + +struct __pyx_vtabstruct_6gevent_11__semaphore_Semaphore { + struct __pyx_vtabstruct_6gevent_19__abstract_linkable_AbstractLinkable __pyx_base; + int (*locked)(struct __pyx_obj_6gevent_11__semaphore_Semaphore *, int __pyx_skip_dispatch); + int (*release)(struct __pyx_obj_6gevent_11__semaphore_Semaphore *, int __pyx_skip_dispatch); + PyObject *(*_start_notify)(struct __pyx_obj_6gevent_11__semaphore_Semaphore *, int __pyx_skip_dispatch); + int (*wait)(struct __pyx_obj_6gevent_11__semaphore_Semaphore *, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_11__semaphore_9Semaphore_wait *__pyx_optional_args); + int (*acquire)(struct __pyx_obj_6gevent_11__semaphore_Semaphore *, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_11__semaphore_9Semaphore_acquire *__pyx_optional_args); + PyObject *(*__pyx___enter__)(struct __pyx_obj_6gevent_11__semaphore_Semaphore *, int __pyx_skip_dispatch); + PyObject *(*__pyx___exit__)(struct __pyx_obj_6gevent_11__semaphore_Semaphore *, PyObject *, PyObject *, PyObject *, int __pyx_skip_dispatch); +}; +static struct __pyx_vtabstruct_6gevent_11__semaphore_Semaphore *__pyx_vtabptr_6gevent_11__semaphore_Semaphore; + + +/* "gevent/__semaphore.pxd":20 + * cpdef __exit__(self, object t, object v, object tb) + * + * cdef class BoundedSemaphore(Semaphore): # <<<<<<<<<<<<<< + * cdef readonly int _initial_value + * + */ + +struct __pyx_vtabstruct_6gevent_11__semaphore_BoundedSemaphore { + struct __pyx_vtabstruct_6gevent_11__semaphore_Semaphore __pyx_base; +}; +static struct __pyx_vtabstruct_6gevent_11__semaphore_BoundedSemaphore *__pyx_vtabptr_6gevent_11__semaphore_BoundedSemaphore; + + +/* "gevent/_event.pxd":13 + * cdef Timeout + * + * cdef class Event(AbstractLinkable): # <<<<<<<<<<<<<< + * cdef bint _flag + * + */ + +struct __pyx_vtabstruct_6gevent_6_event_Event { + struct __pyx_vtabstruct_6gevent_19__abstract_linkable_AbstractLinkable __pyx_base; +}; +static struct __pyx_vtabstruct_6gevent_6_event_Event *__pyx_vtabptr_6gevent_6_event_Event; + + +/* "gevent/_event.pxd":16 + * cdef bint _flag + * + * cdef class AsyncResult(AbstractLinkable): # <<<<<<<<<<<<<< + * cdef readonly _value + * cdef readonly tuple _exc_info + */ + +struct __pyx_vtabstruct_6gevent_6_event_AsyncResult { + struct __pyx_vtabstruct_6gevent_19__abstract_linkable_AbstractLinkable __pyx_base; + PyObject *(*get)(struct __pyx_obj_6gevent_6_event_AsyncResult *, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_6_event_11AsyncResult_get *__pyx_optional_args); + int (*successful)(struct __pyx_obj_6gevent_6_event_AsyncResult *, int __pyx_skip_dispatch); + PyObject *(*wait)(struct __pyx_obj_6gevent_6_event_AsyncResult *, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_6_event_11AsyncResult_wait *__pyx_optional_args); + int (*done)(struct __pyx_obj_6gevent_6_event_AsyncResult *, int __pyx_skip_dispatch); + int (*cancel)(struct __pyx_obj_6gevent_6_event_AsyncResult *, int __pyx_skip_dispatch); + int (*cancelled)(struct __pyx_obj_6gevent_6_event_AsyncResult *, int __pyx_skip_dispatch); +}; +static struct __pyx_vtabstruct_6gevent_6_event_AsyncResult *__pyx_vtabptr_6gevent_6_event_AsyncResult; + + +/* "gevent/_queue.pxd":14 + * @cython.final + * @cython.internal + * cdef class ItemWaiter(Waiter): # <<<<<<<<<<<<<< + * cdef readonly item + * cdef readonly queue + */ + +struct __pyx_vtabstruct_6gevent_6_queue_ItemWaiter { + struct __pyx_vtabstruct_6gevent_8__waiter_Waiter __pyx_base; +}; +static struct __pyx_vtabstruct_6gevent_6_queue_ItemWaiter *__pyx_vtabptr_6gevent_6_queue_ItemWaiter; + + +/* "gevent/_queue.pxd":18 + * cdef readonly queue + * + * cdef class Queue: # <<<<<<<<<<<<<< + * cdef __weakref__ + * cdef readonly hub + */ + +struct __pyx_vtabstruct_6gevent_6_queue_Queue { + PyObject *(*_get)(struct __pyx_obj_6gevent_6_queue_Queue *, int __pyx_skip_dispatch); + PyObject *(*_put)(struct __pyx_obj_6gevent_6_queue_Queue *, PyObject *, int __pyx_skip_dispatch); + PyObject *(*_peek)(struct __pyx_obj_6gevent_6_queue_Queue *, int __pyx_skip_dispatch); + Py_ssize_t (*qsize)(struct __pyx_obj_6gevent_6_queue_Queue *, int __pyx_skip_dispatch); + int (*empty)(struct __pyx_obj_6gevent_6_queue_Queue *, int __pyx_skip_dispatch); + int (*full)(struct __pyx_obj_6gevent_6_queue_Queue *, int __pyx_skip_dispatch); + PyObject *(*put)(struct __pyx_obj_6gevent_6_queue_Queue *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_6_queue_5Queue_put *__pyx_optional_args); + PyObject *(*put_nowait)(struct __pyx_obj_6gevent_6_queue_Queue *, PyObject *, int __pyx_skip_dispatch); + PyObject *(*__pyx___get_or_peek)(struct __pyx_obj_6gevent_6_queue_Queue *, PyObject *, PyObject *, PyObject *); + PyObject *(*get)(struct __pyx_obj_6gevent_6_queue_Queue *, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_6_queue_5Queue_get *__pyx_optional_args); + PyObject *(*get_nowait)(struct __pyx_obj_6gevent_6_queue_Queue *, int __pyx_skip_dispatch); + PyObject *(*peek)(struct __pyx_obj_6gevent_6_queue_Queue *, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_6_queue_5Queue_peek *__pyx_optional_args); + PyObject *(*peek_nowait)(struct __pyx_obj_6gevent_6_queue_Queue *, int __pyx_skip_dispatch); + PyObject *(*_schedule_unlock)(struct __pyx_obj_6gevent_6_queue_Queue *); +}; +static struct __pyx_vtabstruct_6gevent_6_queue_Queue *__pyx_vtabptr_6gevent_6_queue_Queue; + + +/* "gevent/_queue.pxd":50 + * + * @cython.final + * cdef class UnboundQueue(Queue): # <<<<<<<<<<<<<< + * pass + * + */ + +struct __pyx_vtabstruct_6gevent_6_queue_UnboundQueue { + struct __pyx_vtabstruct_6gevent_6_queue_Queue __pyx_base; +}; +static struct __pyx_vtabstruct_6gevent_6_queue_UnboundQueue *__pyx_vtabptr_6gevent_6_queue_UnboundQueue; + + +/* "gevent/_queue.pxd":53 + * pass + * + * cdef class PriorityQueue(Queue): # <<<<<<<<<<<<<< + * pass + * + */ + +struct __pyx_vtabstruct_6gevent_6_queue_PriorityQueue { + struct __pyx_vtabstruct_6gevent_6_queue_Queue __pyx_base; +}; +static struct __pyx_vtabstruct_6gevent_6_queue_PriorityQueue *__pyx_vtabptr_6gevent_6_queue_PriorityQueue; + + +/* "gevent/_queue.pxd":56 + * pass + * + * cdef class LifoQueue(Queue): # <<<<<<<<<<<<<< + * pass + * + */ + +struct __pyx_vtabstruct_6gevent_6_queue_LifoQueue { + struct __pyx_vtabstruct_6gevent_6_queue_Queue __pyx_base; +}; +static struct __pyx_vtabstruct_6gevent_6_queue_LifoQueue *__pyx_vtabptr_6gevent_6_queue_LifoQueue; + + +/* "gevent/_queue.pxd":59 + * pass + * + * cdef class JoinableQueue(Queue): # <<<<<<<<<<<<<< + * cdef Event _cond + * cdef readonly int unfinished_tasks + */ + +struct __pyx_vtabstruct_6gevent_6_queue_JoinableQueue { + struct __pyx_vtabstruct_6gevent_6_queue_Queue __pyx_base; +}; +static struct __pyx_vtabstruct_6gevent_6_queue_JoinableQueue *__pyx_vtabptr_6gevent_6_queue_JoinableQueue; + + +/* "gevent/_queue.pxd":64 + * + * + * cdef class Channel: # <<<<<<<<<<<<<< + * cdef __weakref__ + * cdef readonly getters + */ + +struct __pyx_vtabstruct_6gevent_6_queue_Channel { + PyObject *(*get)(struct __pyx_obj_6gevent_6_queue_Channel *, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_6_queue_7Channel_get *__pyx_optional_args); + PyObject *(*get_nowait)(struct __pyx_obj_6gevent_6_queue_Channel *, int __pyx_skip_dispatch); + PyObject *(*_schedule_unlock)(struct __pyx_obj_6gevent_6_queue_Channel *); +}; +static struct __pyx_vtabstruct_6gevent_6_queue_Channel *__pyx_vtabptr_6gevent_6_queue_Channel; + + +/* "src/gevent/_imap.py":43 + * raise failure.exc + * + * class IMapUnordered(Greenlet): # pylint:disable=undefined-variable # <<<<<<<<<<<<<< + * """ + * At iterator of map results. + */ + +struct __pyx_vtabstruct_6gevent_6__imap_IMapUnordered { + struct __pyx_vtabstruct_6gevent_9_greenlet_Greenlet __pyx_base; + PyObject *(*_inext)(struct __pyx_obj_6gevent_6__imap_IMapUnordered *); + PyObject *(*_ispawn)(struct __pyx_obj_6gevent_6__imap_IMapUnordered *, PyObject *, PyObject *, int); + PyObject *(*_on_result)(struct __pyx_obj_6gevent_6__imap_IMapUnordered *, PyObject *, int __pyx_skip_dispatch); + PyObject *(*_on_finish)(struct __pyx_obj_6gevent_6__imap_IMapUnordered *, PyObject *); + PyObject *(*_iqueue_value_for_success)(struct __pyx_obj_6gevent_6__imap_IMapUnordered *, PyObject *); + PyObject *(*_iqueue_value_for_failure)(struct __pyx_obj_6gevent_6__imap_IMapUnordered *, PyObject *); + PyObject *(*_iqueue_value_for_self_finished)(struct __pyx_obj_6gevent_6__imap_IMapUnordered *); + PyObject *(*_iqueue_value_for_self_failure)(struct __pyx_obj_6gevent_6__imap_IMapUnordered *, PyObject *); +}; +static struct __pyx_vtabstruct_6gevent_6__imap_IMapUnordered *__pyx_vtabptr_6gevent_6__imap_IMapUnordered; + + +/* "src/gevent/_imap.py":187 + * + * + * class IMap(IMapUnordered): # <<<<<<<<<<<<<< + * # A specialization of IMapUnordered that returns items + * # in the order in which they were generated, not + */ + +struct __pyx_vtabstruct_6gevent_6__imap_IMap { + struct __pyx_vtabstruct_6gevent_6__imap_IMapUnordered __pyx_base; +}; +static struct __pyx_vtabstruct_6gevent_6__imap_IMap *__pyx_vtabptr_6gevent_6__imap_IMap; + +/* --- Runtime support code (head) --- */ +/* Refnanny.proto */ +#ifndef CYTHON_REFNANNY + #define CYTHON_REFNANNY 0 +#endif +#if CYTHON_REFNANNY + typedef struct { + void (*INCREF)(void*, PyObject*, int); + void (*DECREF)(void*, PyObject*, int); + void (*GOTREF)(void*, PyObject*, int); + void (*GIVEREF)(void*, PyObject*, int); + void* (*SetupContext)(const char*, int, const char*); + void (*FinishContext)(void**); + } __Pyx_RefNannyAPIStruct; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); + #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; +#ifdef WITH_THREAD + #define __Pyx_RefNannySetupContext(name, acquire_gil)\ + if (acquire_gil) {\ + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ + PyGILState_Release(__pyx_gilstate_save);\ + } else {\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ + } +#else + #define __Pyx_RefNannySetupContext(name, acquire_gil)\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) +#endif + #define __Pyx_RefNannyFinishContext()\ + __Pyx_RefNanny->FinishContext(&__pyx_refnanny) + #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0) + #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) + #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) + #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) +#else + #define __Pyx_RefNannyDeclarations + #define __Pyx_RefNannySetupContext(name, acquire_gil) + #define __Pyx_RefNannyFinishContext() + #define __Pyx_INCREF(r) Py_INCREF(r) + #define __Pyx_DECREF(r) Py_DECREF(r) + #define __Pyx_GOTREF(r) + #define __Pyx_GIVEREF(r) + #define __Pyx_XINCREF(r) Py_XINCREF(r) + #define __Pyx_XDECREF(r) Py_XDECREF(r) + #define __Pyx_XGOTREF(r) + #define __Pyx_XGIVEREF(r) +#endif +#define __Pyx_XDECREF_SET(r, v) do {\ + PyObject *tmp = (PyObject *) r;\ + r = v; __Pyx_XDECREF(tmp);\ + } while (0) +#define __Pyx_DECREF_SET(r, v) do {\ + PyObject *tmp = (PyObject *) r;\ + r = v; __Pyx_DECREF(tmp);\ + } while (0) +#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) +#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) + +/* PyObjectGetAttrStr.proto */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); +#else +#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) +#endif + +/* GetBuiltinName.proto */ +static PyObject *__Pyx_GetBuiltinName(PyObject *name); + +/* RaiseDoubleKeywords.proto */ +static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); + +/* ParseKeywords.proto */ +static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\ + PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\ + const char* function_name); + +/* RaiseArgTupleInvalid.proto */ +static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, + Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); + +/* PyFunctionFastCall.proto */ +#if CYTHON_FAST_PYCALL +#define __Pyx_PyFunction_FastCall(func, args, nargs)\ + __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) +#if 1 || PY_VERSION_HEX < 0x030600B1 +static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs); +#else +#define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs) +#endif +#define __Pyx_BUILD_ASSERT_EXPR(cond)\ + (sizeof(char [1 - 2*!(cond)]) - 1) +#ifndef Py_MEMBER_SIZE +#define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member) +#endif + static size_t __pyx_pyframe_localsplus_offset = 0; + #include "frameobject.h" + #define __Pxy_PyFrame_Initialize_Offsets()\ + ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\ + (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus))) + #define __Pyx_PyFrame_GetLocalsplus(frame)\ + (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset)) +#endif + +/* PyObjectCall.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); +#else +#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) +#endif + +/* PyObjectCallMethO.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); +#endif + +/* PyObjectCallNoArg.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); +#else +#define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL) +#endif + +/* PyCFunctionFastCall.proto */ +#if CYTHON_FAST_PYCCALL +static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs); +#else +#define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL) +#endif + +/* PyObjectCallOneArg.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); + +/* PyThreadStateGet.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; +#define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; +#define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type +#else +#define __Pyx_PyThreadState_declare +#define __Pyx_PyThreadState_assign +#define __Pyx_PyErr_Occurred() PyErr_Occurred() +#endif + +/* PyErrFetchRestore.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) +#define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) +#define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) +#define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) +#define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); +static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) +#else +#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) +#endif +#else +#define __Pyx_PyErr_Clear() PyErr_Clear() +#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) +#define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) +#define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb) +#define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) +#endif + +/* RaiseException.proto */ +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); + +/* PyObjectCall2Args.proto */ +static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2); + +/* ExtTypeTest.proto */ +static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); + +/* PyObjectSetAttrStr.proto */ +#if CYTHON_USE_TYPE_SLOTS +#define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o, n, NULL) +static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value); +#else +#define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n) +#define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v) +#endif + +/* GetTopmostException.proto */ +#if CYTHON_USE_EXC_INFO_STACK +static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate); +#endif + +/* SaveResetException.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); +#else +#define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb) +#define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb) +#endif + +/* PyErrExceptionMatches.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) +static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); +#else +#define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) +#endif + +/* GetException.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb) +static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#else +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); +#endif + +/* SwapException.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#else +static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb); +#endif + +/* GetAttr.proto */ +static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *); + +/* KeywordStringCheck.proto */ +static int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* function_name, int kw_allowed); + +/* py_dict_pop.proto */ +static CYTHON_INLINE PyObject *__Pyx_PyDict_Pop(PyObject *d, PyObject *key, PyObject *default_value); + +/* UnpackUnboundCMethod.proto */ +typedef struct { + PyObject *type; + PyObject **method_name; + PyCFunction func; + PyObject *method; + int flag; +} __Pyx_CachedCFunction; + +/* CallUnboundCMethod2.proto */ +static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2); +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030600B1 +static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2); +#else +#define __Pyx_CallUnboundCMethod2(cfunc, self, arg1, arg2) __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2) +#endif + +/* CallUnboundCMethod1.proto */ +static PyObject* __Pyx__CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg); +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg); +#else +#define __Pyx_CallUnboundCMethod1(cfunc, self, arg) __Pyx__CallUnboundCMethod1(cfunc, self, arg) +#endif + +/* RaiseTooManyValuesToUnpack.proto */ +static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); + +/* RaiseNeedMoreValuesToUnpack.proto */ +static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); + +/* IterFinish.proto */ +static CYTHON_INLINE int __Pyx_IterFinish(void); + +/* UnpackItemEndCheck.proto */ +static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); + +/* None.proto */ +static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname); + +/* CallNextTpDealloc.proto */ +static void __Pyx_call_next_tp_dealloc(PyObject* obj, destructor current_tp_dealloc); + +/* CallNextTpTraverse.proto */ +static int __Pyx_call_next_tp_traverse(PyObject* obj, visitproc v, void *a, traverseproc current_tp_traverse); + +/* CallNextTpClear.proto */ +static void __Pyx_call_next_tp_clear(PyObject* obj, inquiry current_tp_dealloc); + +/* PyObject_GenericGetAttrNoDict.proto */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name); +#else +#define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr +#endif + +/* TypeImport.proto */ +#ifndef __PYX_HAVE_RT_ImportType_proto +#define __PYX_HAVE_RT_ImportType_proto +enum __Pyx_ImportType_CheckSize { + __Pyx_ImportType_CheckSize_Error = 0, + __Pyx_ImportType_CheckSize_Warn = 1, + __Pyx_ImportType_CheckSize_Ignore = 2 +}; +static PyTypeObject *__Pyx_ImportType(PyObject* module, const char *module_name, const char *class_name, size_t size, enum __Pyx_ImportType_CheckSize check_size); +#endif + +/* GetVTable.proto */ +static void* __Pyx_GetVtable(PyObject *dict); + +/* PyObject_GenericGetAttr.proto */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name); +#else +#define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr +#endif + +/* SetVTable.proto */ +static int __Pyx_SetVtable(PyObject *dict, void *vtable); + +/* Import.proto */ +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); + +/* ImportFrom.proto */ +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); + +/* GetModuleGlobalName.proto */ +#if CYTHON_USE_DICT_VERSIONS +#define __Pyx_GetModuleGlobalName(var, name) {\ + static PY_UINT64_T __pyx_dict_version = 0;\ + static PyObject *__pyx_dict_cached_value = NULL;\ + (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\ + (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\ + __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ +} +#define __Pyx_GetModuleGlobalNameUncached(var, name) {\ + PY_UINT64_T __pyx_dict_version;\ + PyObject *__pyx_dict_cached_value;\ + (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ +} +static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value); +#else +#define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name) +#define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name) +static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name); +#endif + +/* GetNameInClass.proto */ +#define __Pyx_GetNameInClass(var, nmspace, name) (var) = __Pyx__GetNameInClass(nmspace, name) +static PyObject *__Pyx__GetNameInClass(PyObject *nmspace, PyObject *name); + +/* FetchCommonType.proto */ +static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); + +/* CythonFunction.proto */ +#define __Pyx_CyFunction_USED 1 +#define __Pyx_CYFUNCTION_STATICMETHOD 0x01 +#define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 +#define __Pyx_CYFUNCTION_CCLASS 0x04 +#define __Pyx_CyFunction_GetClosure(f)\ + (((__pyx_CyFunctionObject *) (f))->func_closure) +#define __Pyx_CyFunction_GetClassObj(f)\ + (((__pyx_CyFunctionObject *) (f))->func_classobj) +#define __Pyx_CyFunction_Defaults(type, f)\ + ((type *)(((__pyx_CyFunctionObject *) (f))->defaults)) +#define __Pyx_CyFunction_SetDefaultsGetter(f, g)\ + ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g) +typedef struct { + PyCFunctionObject func; +#if PY_VERSION_HEX < 0x030500A0 + PyObject *func_weakreflist; +#endif + PyObject *func_dict; + PyObject *func_name; + PyObject *func_qualname; + PyObject *func_doc; + PyObject *func_globals; + PyObject *func_code; + PyObject *func_closure; + PyObject *func_classobj; + void *defaults; + int defaults_pyobjects; + int flags; + PyObject *defaults_tuple; + PyObject *defaults_kwdict; + PyObject *(*defaults_getter)(PyObject *); + PyObject *func_annotations; +} __pyx_CyFunctionObject; +static PyTypeObject *__pyx_CyFunctionType = 0; +#define __Pyx_CyFunction_Check(obj) (__Pyx_TypeCheck(obj, __pyx_CyFunctionType)) +#define __Pyx_CyFunction_NewEx(ml, flags, qualname, self, module, globals, code)\ + __Pyx_CyFunction_New(__pyx_CyFunctionType, ml, flags, qualname, self, module, globals, code) +static PyObject *__Pyx_CyFunction_New(PyTypeObject *, PyMethodDef *ml, + int flags, PyObject* qualname, + PyObject *self, + PyObject *module, PyObject *globals, + PyObject* code); +static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, + size_t size, + int pyobjects); +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, + PyObject *tuple); +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, + PyObject *dict); +static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m, + PyObject *dict); +static int __pyx_CyFunction_init(void); + +/* Globals.proto */ +static PyObject* __Pyx_Globals(void); + +/* CLineInTraceback.proto */ +#ifdef CYTHON_CLINE_IN_TRACEBACK +#define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) +#else +static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line); +#endif + +/* CodeObjectCache.proto */ +typedef struct { + PyCodeObject* code_object; + int code_line; +} __Pyx_CodeObjectCacheEntry; +struct __Pyx_CodeObjectCache { + int count; + int max_count; + __Pyx_CodeObjectCacheEntry* entries; +}; +static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); +static PyCodeObject *__pyx_find_code_object(int code_line); +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); + +/* AddTraceback.proto */ +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename); + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); + +/* CIntFromPy.proto */ +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); + +/* CIntFromPy.proto */ +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); + +/* FastTypeChecks.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) +static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b); +static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type); +static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2); +#else +#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) +#define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) +#define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) +#endif +#define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) + +/* CheckBinaryVersion.proto */ +static int __Pyx_check_binary_version(void); + +/* FunctionExport.proto */ +static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig); + +/* VoidPtrImport.proto */ +static int __Pyx_ImportVoidPtr(PyObject *module, const char *name, void **p, const char *sig); + +/* FunctionImport.proto */ +static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig); + +/* InitStrings.proto */ +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); + +static PyObject *__pyx_f_6gevent_6__imap_13IMapUnordered__inext(struct __pyx_obj_6gevent_6__imap_IMapUnordered *__pyx_v_self); /* proto*/ +static PyObject *__pyx_f_6gevent_6__imap_13IMapUnordered__ispawn(struct __pyx_obj_6gevent_6__imap_IMapUnordered *__pyx_v_self, PyObject *__pyx_v_func, PyObject *__pyx_v_item, int __pyx_v_item_index); /* proto*/ +static PyObject *__pyx_f_6gevent_6__imap_13IMapUnordered__on_result(struct __pyx_obj_6gevent_6__imap_IMapUnordered *__pyx_v_self, PyObject *__pyx_v_greenlet, int __pyx_skip_dispatch); /* proto*/ +static PyObject *__pyx_f_6gevent_6__imap_13IMapUnordered__on_finish(struct __pyx_obj_6gevent_6__imap_IMapUnordered *__pyx_v_self, PyObject *__pyx_v_exception); /* proto*/ +static PyObject *__pyx_f_6gevent_6__imap_13IMapUnordered__iqueue_value_for_success(CYTHON_UNUSED struct __pyx_obj_6gevent_6__imap_IMapUnordered *__pyx_v_self, PyObject *__pyx_v_greenlet); /* proto*/ +static PyObject *__pyx_f_6gevent_6__imap_13IMapUnordered__iqueue_value_for_failure(CYTHON_UNUSED struct __pyx_obj_6gevent_6__imap_IMapUnordered *__pyx_v_self, PyObject *__pyx_v_greenlet); /* proto*/ +static PyObject *__pyx_f_6gevent_6__imap_13IMapUnordered__iqueue_value_for_self_finished(CYTHON_UNUSED struct __pyx_obj_6gevent_6__imap_IMapUnordered *__pyx_v_self); /* proto*/ +static PyObject *__pyx_f_6gevent_6__imap_13IMapUnordered__iqueue_value_for_self_failure(struct __pyx_obj_6gevent_6__imap_IMapUnordered *__pyx_v_self, PyObject *__pyx_v_exception); /* proto*/ +static PyObject *__pyx_f_6gevent_6__imap_4IMap__inext(struct __pyx_obj_6gevent_6__imap_IMap *__pyx_v_self); /* proto*/ +static PyObject *__pyx_f_6gevent_6__imap_4IMap__iqueue_value_for_success(struct __pyx_obj_6gevent_6__imap_IMap *__pyx_v_self, PyObject *__pyx_v_greenlet); /* proto*/ +static PyObject *__pyx_f_6gevent_6__imap_4IMap__iqueue_value_for_failure(struct __pyx_obj_6gevent_6__imap_IMap *__pyx_v_self, PyObject *__pyx_v_greenlet); /* proto*/ +static PyObject *__pyx_f_6gevent_6__imap_4IMap__iqueue_value_for_self_finished(struct __pyx_obj_6gevent_6__imap_IMap *__pyx_v_self); /* proto*/ +static PyObject *__pyx_f_6gevent_6__imap_4IMap__iqueue_value_for_self_failure(struct __pyx_obj_6gevent_6__imap_IMap *__pyx_v_self, PyObject *__pyx_v_exception); /* proto*/ + +/* Module declarations from 'cython' */ + +/* Module declarations from 'weakref' */ + +/* Module declarations from 'gevent.__ident' */ +static PyTypeObject *__pyx_ptype_6gevent_7__ident_ref = 0; +static PyTypeObject *__pyx_ptype_6gevent_7__ident_ValuedWeakRef = 0; +static PyTypeObject *__pyx_ptype_6gevent_7__ident_IdentRegistry = 0; +static PyObject **__pyx_vp_6gevent_7__ident_heappop = 0; +#define __pyx_v_6gevent_7__ident_heappop (*__pyx_vp_6gevent_7__ident_heappop) +static PyObject **__pyx_vp_6gevent_7__ident_heappush = 0; +#define __pyx_v_6gevent_7__ident_heappush (*__pyx_vp_6gevent_7__ident_heappush) +static PyObject **__pyx_vp_6gevent_7__ident_WeakKeyDictionary = 0; +#define __pyx_v_6gevent_7__ident_WeakKeyDictionary (*__pyx_vp_6gevent_7__ident_WeakKeyDictionary) + +/* Module declarations from 'greenlet' */ + +/* Module declarations from 'gevent.__greenlet_primitives' */ +static PyTypeObject *__pyx_ptype_6gevent_21__greenlet_primitives_greenlet = 0; +static PyTypeObject *__pyx_ptype_6gevent_21__greenlet_primitives_TrackedRawGreenlet = 0; +static PyTypeObject *__pyx_ptype_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop = 0; +static PyObject **__pyx_vp_6gevent_21__greenlet_primitives_get_objects = 0; +#define __pyx_v_6gevent_21__greenlet_primitives_get_objects (*__pyx_vp_6gevent_21__greenlet_primitives_get_objects) +static PyObject **__pyx_vp_6gevent_21__greenlet_primitives_wref = 0; +#define __pyx_v_6gevent_21__greenlet_primitives_wref (*__pyx_vp_6gevent_21__greenlet_primitives_wref) +static PyObject **__pyx_vp_6gevent_21__greenlet_primitives_BlockingSwitchOutError = 0; +#define __pyx_v_6gevent_21__greenlet_primitives_BlockingSwitchOutError (*__pyx_vp_6gevent_21__greenlet_primitives_BlockingSwitchOutError) +static int *__pyx_vp_6gevent_21__greenlet_primitives__greenlet_imported = 0; +#define __pyx_v_6gevent_21__greenlet_primitives__greenlet_imported (*__pyx_vp_6gevent_21__greenlet_primitives__greenlet_imported) + +/* Module declarations from 'gevent.__hub_local' */ +static PyObject **__pyx_vp_6gevent_11__hub_local__threadlocal = 0; +#define __pyx_v_6gevent_11__hub_local__threadlocal (*__pyx_vp_6gevent_11__hub_local__threadlocal) +static struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *(*__pyx_f_6gevent_11__hub_local_get_hub_noargs)(int __pyx_skip_dispatch); /*proto*/ + +/* Module declarations from 'gevent.__waiter' */ +static PyTypeObject *__pyx_ptype_6gevent_8__waiter_greenlet = 0; +static PyTypeObject *__pyx_ptype_6gevent_8__waiter_Waiter = 0; +static PyTypeObject *__pyx_ptype_6gevent_8__waiter_MultipleWaiter = 0; +static PyObject **__pyx_vp_6gevent_8__waiter_sys = 0; +#define __pyx_v_6gevent_8__waiter_sys (*__pyx_vp_6gevent_8__waiter_sys) +static PyObject **__pyx_vp_6gevent_8__waiter_ConcurrentObjectUseError = 0; +#define __pyx_v_6gevent_8__waiter_ConcurrentObjectUseError (*__pyx_vp_6gevent_8__waiter_ConcurrentObjectUseError) +static int *__pyx_vp_6gevent_8__waiter__greenlet_imported = 0; +#define __pyx_v_6gevent_8__waiter__greenlet_imported (*__pyx_vp_6gevent_8__waiter__greenlet_imported) +static PyObject **__pyx_vp_6gevent_8__waiter__NONE = 0; +#define __pyx_v_6gevent_8__waiter__NONE (*__pyx_vp_6gevent_8__waiter__NONE) + +/* Module declarations from 'types' */ + +/* Module declarations from 'gevent._greenlet' */ +static PyTypeObject *__pyx_ptype_6gevent_9_greenlet_greenlet = 0; +static PyTypeObject *__pyx_ptype_6gevent_9_greenlet_CodeType = 0; +static PyTypeObject *__pyx_ptype_6gevent_9_greenlet_FrameType = 0; +static PyTypeObject *__pyx_ptype_6gevent_9_greenlet_SpawnedLink = 0; +static PyTypeObject *__pyx_ptype_6gevent_9_greenlet_SuccessSpawnedLink = 0; +static PyTypeObject *__pyx_ptype_6gevent_9_greenlet_FailureSpawnedLink = 0; +static PyTypeObject *__pyx_ptype_6gevent_9_greenlet__Frame = 0; +static PyTypeObject *__pyx_ptype_6gevent_9_greenlet_Greenlet = 0; +static PyTypeObject *__pyx_ptype_6gevent_9_greenlet__dummy_event = 0; +static int *__pyx_vp_6gevent_9_greenlet__PYPY = 0; +#define __pyx_v_6gevent_9_greenlet__PYPY (*__pyx_vp_6gevent_9_greenlet__PYPY) +static PyObject **__pyx_vp_6gevent_9_greenlet_sys_getframe = 0; +#define __pyx_v_6gevent_9_greenlet_sys_getframe (*__pyx_vp_6gevent_9_greenlet_sys_getframe) +static PyObject **__pyx_vp_6gevent_9_greenlet_sys_exc_info = 0; +#define __pyx_v_6gevent_9_greenlet_sys_exc_info (*__pyx_vp_6gevent_9_greenlet_sys_exc_info) +static PyObject **__pyx_vp_6gevent_9_greenlet_Timeout = 0; +#define __pyx_v_6gevent_9_greenlet_Timeout (*__pyx_vp_6gevent_9_greenlet_Timeout) +static PyObject **__pyx_vp_6gevent_9_greenlet_GreenletExit = 0; +#define __pyx_v_6gevent_9_greenlet_GreenletExit (*__pyx_vp_6gevent_9_greenlet_GreenletExit) +static PyObject **__pyx_vp_6gevent_9_greenlet_InvalidSwitchError = 0; +#define __pyx_v_6gevent_9_greenlet_InvalidSwitchError (*__pyx_vp_6gevent_9_greenlet_InvalidSwitchError) +static int *__pyx_vp_6gevent_9_greenlet__greenlet_imported = 0; +#define __pyx_v_6gevent_9_greenlet__greenlet_imported (*__pyx_vp_6gevent_9_greenlet__greenlet_imported) +static PyObject **__pyx_vp_6gevent_9_greenlet__greenlet__init__ = 0; +#define __pyx_v_6gevent_9_greenlet__greenlet__init__ (*__pyx_vp_6gevent_9_greenlet__greenlet__init__) +static PyObject **__pyx_vp_6gevent_9_greenlet__threadlocal = 0; +#define __pyx_v_6gevent_9_greenlet__threadlocal (*__pyx_vp_6gevent_9_greenlet__threadlocal) +static PyObject **__pyx_vp_6gevent_9_greenlet_get_hub_class = 0; +#define __pyx_v_6gevent_9_greenlet_get_hub_class (*__pyx_vp_6gevent_9_greenlet_get_hub_class) +static PyObject **__pyx_vp_6gevent_9_greenlet_wref = 0; +#define __pyx_v_6gevent_9_greenlet_wref (*__pyx_vp_6gevent_9_greenlet_wref) +static PyObject **__pyx_vp_6gevent_9_greenlet_dump_traceback = 0; +#define __pyx_v_6gevent_9_greenlet_dump_traceback (*__pyx_vp_6gevent_9_greenlet_dump_traceback) +static PyObject **__pyx_vp_6gevent_9_greenlet_load_traceback = 0; +#define __pyx_v_6gevent_9_greenlet_load_traceback (*__pyx_vp_6gevent_9_greenlet_load_traceback) +static PyObject **__pyx_vp_6gevent_9_greenlet_wait = 0; +#define __pyx_v_6gevent_9_greenlet_wait (*__pyx_vp_6gevent_9_greenlet_wait) +static PyObject **__pyx_vp_6gevent_9_greenlet_iwait = 0; +#define __pyx_v_6gevent_9_greenlet_iwait (*__pyx_vp_6gevent_9_greenlet_iwait) +static PyObject **__pyx_vp_6gevent_9_greenlet_reraise = 0; +#define __pyx_v_6gevent_9_greenlet_reraise (*__pyx_vp_6gevent_9_greenlet_reraise) +static PyObject **__pyx_vp_6gevent_9_greenlet_GEVENT_CONFIG = 0; +#define __pyx_v_6gevent_9_greenlet_GEVENT_CONFIG (*__pyx_vp_6gevent_9_greenlet_GEVENT_CONFIG) +static struct __pyx_obj_6gevent_9_greenlet__dummy_event **__pyx_vp_6gevent_9_greenlet__cancelled_start_event = 0; +#define __pyx_v_6gevent_9_greenlet__cancelled_start_event (*__pyx_vp_6gevent_9_greenlet__cancelled_start_event) +static struct __pyx_obj_6gevent_9_greenlet__dummy_event **__pyx_vp_6gevent_9_greenlet__start_completed_event = 0; +#define __pyx_v_6gevent_9_greenlet__start_completed_event (*__pyx_vp_6gevent_9_greenlet__start_completed_event) +static PyObject **__pyx_vp_6gevent_9_greenlet__spawn_callbacks = 0; +#define __pyx_v_6gevent_9_greenlet__spawn_callbacks (*__pyx_vp_6gevent_9_greenlet__spawn_callbacks) + +/* Module declarations from 'gevent.__abstract_linkable' */ +static PyTypeObject *__pyx_ptype_6gevent_19__abstract_linkable_greenlet = 0; +static PyTypeObject *__pyx_ptype_6gevent_19__abstract_linkable_AbstractLinkable = 0; +static PyObject **__pyx_vp_6gevent_19__abstract_linkable_InvalidSwitchError = 0; +#define __pyx_v_6gevent_19__abstract_linkable_InvalidSwitchError (*__pyx_vp_6gevent_19__abstract_linkable_InvalidSwitchError) +static PyObject **__pyx_vp_6gevent_19__abstract_linkable_Timeout = 0; +#define __pyx_v_6gevent_19__abstract_linkable_Timeout (*__pyx_vp_6gevent_19__abstract_linkable_Timeout) +static int *__pyx_vp_6gevent_19__abstract_linkable__greenlet_imported = 0; +#define __pyx_v_6gevent_19__abstract_linkable__greenlet_imported (*__pyx_vp_6gevent_19__abstract_linkable__greenlet_imported) + +/* Module declarations from 'gevent.__semaphore' */ +static PyTypeObject *__pyx_ptype_6gevent_11__semaphore_Semaphore = 0; +static PyTypeObject *__pyx_ptype_6gevent_11__semaphore_BoundedSemaphore = 0; +static PyObject **__pyx_vp_6gevent_11__semaphore_Timeout = 0; +#define __pyx_v_6gevent_11__semaphore_Timeout (*__pyx_vp_6gevent_11__semaphore_Timeout) + +/* Module declarations from 'gevent._event' */ +static PyTypeObject *__pyx_ptype_6gevent_6_event_Event = 0; +static PyTypeObject *__pyx_ptype_6gevent_6_event_AsyncResult = 0; +static PyObject **__pyx_vp_6gevent_6_event__None = 0; +#define __pyx_v_6gevent_6_event__None (*__pyx_vp_6gevent_6_event__None) +static PyObject **__pyx_vp_6gevent_6_event_reraise = 0; +#define __pyx_v_6gevent_6_event_reraise (*__pyx_vp_6gevent_6_event_reraise) +static PyObject **__pyx_vp_6gevent_6_event_dump_traceback = 0; +#define __pyx_v_6gevent_6_event_dump_traceback (*__pyx_vp_6gevent_6_event_dump_traceback) +static PyObject **__pyx_vp_6gevent_6_event_load_traceback = 0; +#define __pyx_v_6gevent_6_event_load_traceback (*__pyx_vp_6gevent_6_event_load_traceback) +static PyObject **__pyx_vp_6gevent_6_event_Timeout = 0; +#define __pyx_v_6gevent_6_event_Timeout (*__pyx_vp_6gevent_6_event_Timeout) + +/* Module declarations from 'gevent._queue' */ +static PyTypeObject *__pyx_ptype_6gevent_6_queue_ItemWaiter = 0; +static PyTypeObject *__pyx_ptype_6gevent_6_queue_Queue = 0; +static PyTypeObject *__pyx_ptype_6gevent_6_queue_UnboundQueue = 0; +static PyTypeObject *__pyx_ptype_6gevent_6_queue_PriorityQueue = 0; +static PyTypeObject *__pyx_ptype_6gevent_6_queue_LifoQueue = 0; +static PyTypeObject *__pyx_ptype_6gevent_6_queue_JoinableQueue = 0; +static PyTypeObject *__pyx_ptype_6gevent_6_queue_Channel = 0; +static PyObject **__pyx_vp_6gevent_6_queue__heappush = 0; +#define __pyx_v_6gevent_6_queue__heappush (*__pyx_vp_6gevent_6_queue__heappush) +static PyObject **__pyx_vp_6gevent_6_queue__heappop = 0; +#define __pyx_v_6gevent_6_queue__heappop (*__pyx_vp_6gevent_6_queue__heappop) +static PyObject **__pyx_vp_6gevent_6_queue__heapify = 0; +#define __pyx_v_6gevent_6_queue__heapify (*__pyx_vp_6gevent_6_queue__heapify) + +/* Module declarations from 'gevent.__imap' */ +static PyTypeObject *__pyx_ptype_6gevent_6__imap_Failure = 0; +static PyTypeObject *__pyx_ptype_6gevent_6__imap_IMapUnordered = 0; +static PyTypeObject *__pyx_ptype_6gevent_6__imap_IMap = 0; +static CYTHON_INLINE PyObject *__pyx_f_6gevent_6__imap__raise_exc(struct __pyx_obj_6gevent_6__imap_Failure *); /*proto*/ +#define __Pyx_MODULE_NAME "gevent.__imap" +extern int __pyx_module_is_main_gevent____imap; +int __pyx_module_is_main_gevent____imap = 0; + +/* Implementation of 'gevent.__imap' */ +static PyObject *__pyx_builtin___import__; +static PyObject *__pyx_builtin_BaseException; +static PyObject *__pyx_builtin_StopIteration; +static PyObject *__pyx_builtin_KeyError; +static const char __pyx_k_e[] = "e"; +static const char __pyx_k_all[] = "__all__"; +static const char __pyx_k_exc[] = "exc"; +static const char __pyx_k_pop[] = "pop"; +static const char __pyx_k_run[] = "_run"; +static const char __pyx_k_IMap[] = "IMap"; +static const char __pyx_k_func[] = "func"; +static const char __pyx_k_init[] = "__init__"; +static const char __pyx_k_item[] = "item"; +static const char __pyx_k_main[] = "__main__"; +static const char __pyx_k_name[] = "__name__"; +static const char __pyx_k_next[] = "__next__"; +static const char __pyx_k_self[] = "self"; +static const char __pyx_k_test[] = "__test__"; +static const char __pyx_k_queue[] = "queue"; +static const char __pyx_k_slots[] = "__slots__"; +static const char __pyx_k_spawn[] = "spawn"; +static const char __pyx_k_value[] = "value"; +static const char __pyx_k_gevent[] = "gevent"; +static const char __pyx_k_import[] = "__import__"; +static const char __pyx_k_next_2[] = "next"; +static const char __pyx_k_zipped[] = "_zipped"; +static const char __pyx_k_Failure[] = "Failure"; +static const char __pyx_k_maxsize[] = "maxsize"; +static const char __pyx_k_rawlink[] = "rawlink"; +static const char __pyx_k_Greenlet[] = "Greenlet"; +static const char __pyx_k_KeyError[] = "KeyError"; +static const char __pyx_k_greenlet[] = "greenlet"; +static const char __pyx_k_iterable[] = "iterable"; +static const char __pyx_k_Semaphore[] = "Semaphore"; +static const char __pyx_k_exception[] = "exception"; +static const char __pyx_k_on_result[] = "_on_result"; +static const char __pyx_k_semaphore[] = "_semaphore"; +static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__"; +static const char __pyx_k_successful[] = "successful"; +static const char __pyx_k_UnboundQueue[] = "UnboundQueue"; +static const char __pyx_k_gevent__util[] = "gevent._util"; +static const char __pyx_k_BaseException[] = "BaseException"; +static const char __pyx_k_IMapUnordered[] = "IMapUnordered"; +static const char __pyx_k_StopIteration[] = "StopIteration"; +static const char __pyx_k_gevent___imap[] = "gevent.__imap"; +static const char __pyx_k_import_c_accel[] = "import_c_accel"; +static const char __pyx_k_imap_task_index[] = "_imap_task_index"; +static const char __pyx_k_raise_exception[] = "raise_exception"; +static const char __pyx_k_raise_exception_2[] = "_raise_exception"; +static const char __pyx_k_IMapUnordered__run[] = "IMapUnordered._run"; +static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; +static const char __pyx_k_src_gevent__imap_py[] = "src\\gevent\\_imap.py"; +static const char __pyx_k_IMapUnordered__on_result[] = "IMapUnordered._on_result"; +static const char __pyx_k_Iterators_across_greenlets_or_A[] = "\nIterators across greenlets or AsyncResult objects.\n\n"; +static PyObject *__pyx_n_s_BaseException; +static PyObject *__pyx_n_s_Failure; +static PyObject *__pyx_n_s_Greenlet; +static PyObject *__pyx_n_s_IMap; +static PyObject *__pyx_n_s_IMapUnordered; +static PyObject *__pyx_n_s_IMapUnordered__on_result; +static PyObject *__pyx_n_s_IMapUnordered__run; +static PyObject *__pyx_n_s_KeyError; +static PyObject *__pyx_n_s_Semaphore; +static PyObject *__pyx_n_s_StopIteration; +static PyObject *__pyx_n_s_UnboundQueue; +static PyObject *__pyx_n_s_all; +static PyObject *__pyx_n_s_cline_in_traceback; +static PyObject *__pyx_n_s_e; +static PyObject *__pyx_n_s_exc; +static PyObject *__pyx_n_s_exception; +static PyObject *__pyx_n_s_func; +static PyObject *__pyx_n_s_gevent; +static PyObject *__pyx_n_s_gevent___imap; +static PyObject *__pyx_n_s_gevent__util; +static PyObject *__pyx_n_s_greenlet; +static PyObject *__pyx_n_s_imap_task_index; +static PyObject *__pyx_n_s_import; +static PyObject *__pyx_n_s_import_c_accel; +static PyObject *__pyx_n_s_init; +static PyObject *__pyx_n_s_item; +static PyObject *__pyx_n_s_iterable; +static PyObject *__pyx_n_s_main; +static PyObject *__pyx_n_s_maxsize; +static PyObject *__pyx_n_s_name; +static PyObject *__pyx_n_s_next; +static PyObject *__pyx_n_s_next_2; +static PyObject *__pyx_n_s_on_result; +static PyObject *__pyx_n_s_pop; +static PyObject *__pyx_n_s_pyx_vtable; +static PyObject *__pyx_n_s_queue; +static PyObject *__pyx_n_s_raise_exception; +static PyObject *__pyx_n_s_raise_exception_2; +static PyObject *__pyx_n_s_rawlink; +static PyObject *__pyx_n_s_run; +static PyObject *__pyx_n_s_self; +static PyObject *__pyx_n_s_semaphore; +static PyObject *__pyx_n_s_slots; +static PyObject *__pyx_n_s_spawn; +static PyObject *__pyx_kp_s_src_gevent__imap_py; +static PyObject *__pyx_n_s_successful; +static PyObject *__pyx_n_s_test; +static PyObject *__pyx_n_s_value; +static PyObject *__pyx_n_s_zipped; +static int __pyx_pf_6gevent_6__imap_7Failure___init__(struct __pyx_obj_6gevent_6__imap_Failure *__pyx_v_self, PyObject *__pyx_v_exc, PyObject *__pyx_v_raise_exception); /* proto */ +static PyObject *__pyx_pf_6gevent_6__imap_7Failure_3exc___get__(struct __pyx_obj_6gevent_6__imap_Failure *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_6__imap_13IMapUnordered___init__(struct __pyx_obj_6gevent_6__imap_IMapUnordered *__pyx_v_self, PyObject *__pyx_v_func, PyObject *__pyx_v_iterable, PyObject *__pyx_v_spawn, PyObject *__pyx_v_maxsize, PyObject *__pyx_v__zipped); /* proto */ +static PyObject *__pyx_pf_6gevent_6__imap_13IMapUnordered_2__iter__(struct __pyx_obj_6gevent_6__imap_IMapUnordered *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_6__imap_13IMapUnordered_4__next__(struct __pyx_obj_6gevent_6__imap_IMapUnordered *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_6__imap_13IMapUnordered_6_run(struct __pyx_obj_6gevent_6__imap_IMapUnordered *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_6__imap_13IMapUnordered_8_on_result(struct __pyx_obj_6gevent_6__imap_IMapUnordered *__pyx_v_self, PyObject *__pyx_v_greenlet); /* proto */ +static PyObject *__pyx_pf_6gevent_6__imap_13IMapUnordered_5queue___get__(struct __pyx_obj_6gevent_6__imap_IMapUnordered *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_6__imap_13IMapUnordered_8finished___get__(struct __pyx_obj_6gevent_6__imap_IMapUnordered *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_6__imap_4IMap___init__(struct __pyx_obj_6gevent_6__imap_IMap *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */ +static PyObject *__pyx_tp_new_6gevent_6__imap_Failure(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6gevent_6__imap_IMapUnordered(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6gevent_6__imap_IMap(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_pop = {0, &__pyx_n_s_pop, 0, 0, 0}; +static PyObject *__pyx_tuple_; +static PyObject *__pyx_tuple__2; +static PyObject *__pyx_tuple__3; +static PyObject *__pyx_tuple__5; +static PyObject *__pyx_codeobj__4; +static PyObject *__pyx_codeobj__6; +/* Late includes */ + +/* "src/gevent/_imap.py":31 + * __slots__ = ('exc', 'raise_exception') + * + * def __init__(self, exc, raise_exception=None): # <<<<<<<<<<<<<< + * self.exc = exc + * self.raise_exception = raise_exception + */ + +/* Python wrapper */ +static int __pyx_pw_6gevent_6__imap_7Failure_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6gevent_6__imap_7Failure_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_exc = 0; + PyObject *__pyx_v_raise_exception = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_exc,&__pyx_n_s_raise_exception,0}; + PyObject* values[2] = {0,0}; + values[1] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_exc)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_raise_exception); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 31, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_exc = values[0]; + __pyx_v_raise_exception = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 31, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.__imap.Failure.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_6__imap_7Failure___init__(((struct __pyx_obj_6gevent_6__imap_Failure *)__pyx_v_self), __pyx_v_exc, __pyx_v_raise_exception); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_6__imap_7Failure___init__(struct __pyx_obj_6gevent_6__imap_Failure *__pyx_v_self, PyObject *__pyx_v_exc, PyObject *__pyx_v_raise_exception) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__", 0); + + /* "src/gevent/_imap.py":32 + * + * def __init__(self, exc, raise_exception=None): + * self.exc = exc # <<<<<<<<<<<<<< + * self.raise_exception = raise_exception + * + */ + __Pyx_INCREF(__pyx_v_exc); + __Pyx_GIVEREF(__pyx_v_exc); + __Pyx_GOTREF(__pyx_v_self->exc); + __Pyx_DECREF(__pyx_v_self->exc); + __pyx_v_self->exc = __pyx_v_exc; + + /* "src/gevent/_imap.py":33 + * def __init__(self, exc, raise_exception=None): + * self.exc = exc + * self.raise_exception = raise_exception # <<<<<<<<<<<<<< + * + * + */ + __Pyx_INCREF(__pyx_v_raise_exception); + __Pyx_GIVEREF(__pyx_v_raise_exception); + __Pyx_GOTREF(__pyx_v_self->raise_exception); + __Pyx_DECREF(__pyx_v_self->raise_exception); + __pyx_v_self->raise_exception = __pyx_v_raise_exception; + + /* "src/gevent/_imap.py":31 + * __slots__ = ('exc', 'raise_exception') + * + * def __init__(self, exc, raise_exception=None): # <<<<<<<<<<<<<< + * self.exc = exc + * self.raise_exception = raise_exception + */ + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/__imap.pxd":10 + * @cython.final + * cdef class Failure: + * cdef readonly exc # <<<<<<<<<<<<<< + * cdef raise_exception + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6__imap_7Failure_3exc_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_6__imap_7Failure_3exc_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6__imap_7Failure_3exc___get__(((struct __pyx_obj_6gevent_6__imap_Failure *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6__imap_7Failure_3exc___get__(struct __pyx_obj_6gevent_6__imap_Failure *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->exc); + __pyx_r = __pyx_v_self->exc; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_imap.py":36 + * + * + * def _raise_exc(failure): # <<<<<<<<<<<<<< + * # For cython. + * if failure.raise_exception: + */ + +static CYTHON_INLINE PyObject *__pyx_f_6gevent_6__imap__raise_exc(struct __pyx_obj_6gevent_6__imap_Failure *__pyx_v_failure) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + __Pyx_RefNannySetupContext("_raise_exc", 0); + + /* "src/gevent/_imap.py":38 + * def _raise_exc(failure): + * # For cython. + * if failure.raise_exception: # <<<<<<<<<<<<<< + * failure.raise_exception() + * else: + */ + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_failure->raise_exception); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 38, __pyx_L1_error) + if (likely(__pyx_t_1)) { + + /* "src/gevent/_imap.py":39 + * # For cython. + * if failure.raise_exception: + * failure.raise_exception() # <<<<<<<<<<<<<< + * else: + * raise failure.exc + */ + __Pyx_INCREF(__pyx_v_failure->raise_exception); + __pyx_t_3 = __pyx_v_failure->raise_exception; __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 39, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/_imap.py":38 + * def _raise_exc(failure): + * # For cython. + * if failure.raise_exception: # <<<<<<<<<<<<<< + * failure.raise_exception() + * else: + */ + goto __pyx_L3; + } + + /* "src/gevent/_imap.py":41 + * failure.raise_exception() + * else: + * raise failure.exc # <<<<<<<<<<<<<< + * + * class IMapUnordered(Greenlet): # pylint:disable=undefined-variable + */ + /*else*/ { + __Pyx_Raise(__pyx_v_failure->exc, 0, 0, 0); + __PYX_ERR(0, 41, __pyx_L1_error) + } + __pyx_L3:; + + /* "src/gevent/_imap.py":36 + * + * + * def _raise_exc(failure): # <<<<<<<<<<<<<< + * # For cython. + * if failure.raise_exception: + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("gevent.__imap._raise_exc", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_imap.py":48 + * """ + * + * def __init__(self, func, iterable, spawn, maxsize=None, _zipped=False): # <<<<<<<<<<<<<< + * """ + * An iterator that. + */ + +/* Python wrapper */ +static int __pyx_pw_6gevent_6__imap_13IMapUnordered_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6gevent_6__imap_13IMapUnordered___init__[] = "\n An iterator that.\n\n :param callable spawn: The function we use to create new greenlets.\n :keyword int maxsize: If given and not-None, specifies the maximum number of\n finished results that will be allowed to accumulated awaiting the reader;\n more than that number of results will cause map function greenlets to begin\n to block. This is most useful is there is a great disparity in the speed of\n the mapping code and the consumer and the results consume a great deal of resources.\n Using a bound is more computationally expensive than not using a bound.\n\n .. versionchanged:: 1.1b3\n Added the *maxsize* parameter.\n "; +#if CYTHON_COMPILING_IN_CPYTHON +struct wrapperbase __pyx_wrapperbase_6gevent_6__imap_13IMapUnordered___init__; +#endif +static int __pyx_pw_6gevent_6__imap_13IMapUnordered_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_func = 0; + PyObject *__pyx_v_iterable = 0; + PyObject *__pyx_v_spawn = 0; + PyObject *__pyx_v_maxsize = 0; + PyObject *__pyx_v__zipped = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_func,&__pyx_n_s_iterable,&__pyx_n_s_spawn,&__pyx_n_s_maxsize,&__pyx_n_s_zipped,0}; + PyObject* values[5] = {0,0,0,0,0}; + values[3] = ((PyObject *)Py_None); + values[4] = ((PyObject *)Py_False); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + CYTHON_FALLTHROUGH; + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_func)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_iterable)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 5, 1); __PYX_ERR(0, 48, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_spawn)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 5, 2); __PYX_ERR(0, 48, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 3: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_maxsize); + if (value) { values[3] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 4: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_zipped); + if (value) { values[4] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 48, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + CYTHON_FALLTHROUGH; + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_func = values[0]; + __pyx_v_iterable = values[1]; + __pyx_v_spawn = values[2]; + __pyx_v_maxsize = values[3]; + __pyx_v__zipped = values[4]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 48, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.__imap.IMapUnordered.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_6__imap_13IMapUnordered___init__(((struct __pyx_obj_6gevent_6__imap_IMapUnordered *)__pyx_v_self), __pyx_v_func, __pyx_v_iterable, __pyx_v_spawn, __pyx_v_maxsize, __pyx_v__zipped); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_6__imap_13IMapUnordered___init__(struct __pyx_obj_6gevent_6__imap_IMapUnordered *__pyx_v_self, PyObject *__pyx_v_func, PyObject *__pyx_v_iterable, PyObject *__pyx_v_spawn, PyObject *__pyx_v_maxsize, PyObject *__pyx_v__zipped) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "src/gevent/_imap.py":63 + * Added the *maxsize* parameter. + * """ + * Greenlet.__init__(self) # pylint:disable=undefined-variable # <<<<<<<<<<<<<< + * self.spawn = spawn + * self._zipped = _zipped + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet), __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 63, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, ((PyObject *)__pyx_v_self)) : __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_v_self)); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 63, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_imap.py":64 + * """ + * Greenlet.__init__(self) # pylint:disable=undefined-variable + * self.spawn = spawn # <<<<<<<<<<<<<< + * self._zipped = _zipped + * self.func = func + */ + __Pyx_INCREF(__pyx_v_spawn); + __Pyx_GIVEREF(__pyx_v_spawn); + __Pyx_GOTREF(__pyx_v_self->spawn); + __Pyx_DECREF(__pyx_v_self->spawn); + __pyx_v_self->spawn = __pyx_v_spawn; + + /* "src/gevent/_imap.py":65 + * Greenlet.__init__(self) # pylint:disable=undefined-variable + * self.spawn = spawn + * self._zipped = _zipped # <<<<<<<<<<<<<< + * self.func = func + * self.iterable = iterable + */ + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v__zipped); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 65, __pyx_L1_error) + __pyx_v_self->_zipped = __pyx_t_4; + + /* "src/gevent/_imap.py":66 + * self.spawn = spawn + * self._zipped = _zipped + * self.func = func # <<<<<<<<<<<<<< + * self.iterable = iterable + * self.queue = UnboundQueue() # pylint:disable=undefined-variable + */ + __Pyx_INCREF(__pyx_v_func); + __Pyx_GIVEREF(__pyx_v_func); + __Pyx_GOTREF(__pyx_v_self->func); + __Pyx_DECREF(__pyx_v_self->func); + __pyx_v_self->func = __pyx_v_func; + + /* "src/gevent/_imap.py":67 + * self._zipped = _zipped + * self.func = func + * self.iterable = iterable # <<<<<<<<<<<<<< + * self.queue = UnboundQueue() # pylint:disable=undefined-variable + * + */ + __Pyx_INCREF(__pyx_v_iterable); + __Pyx_GIVEREF(__pyx_v_iterable); + __Pyx_GOTREF(__pyx_v_self->iterable); + __Pyx_DECREF(__pyx_v_self->iterable); + __pyx_v_self->iterable = __pyx_v_iterable; + + /* "src/gevent/_imap.py":68 + * self.func = func + * self.iterable = iterable + * self.queue = UnboundQueue() # pylint:disable=undefined-variable # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_6gevent_6_queue_UnboundQueue)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 68, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_self->queue); + __Pyx_DECREF(((PyObject *)__pyx_v_self->queue)); + __pyx_v_self->queue = ((struct __pyx_obj_6gevent_6_queue_UnboundQueue *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "src/gevent/_imap.py":71 + * + * + * if maxsize: # <<<<<<<<<<<<<< + * # Bounding the queue is not enough if we want to keep from + * # accumulating objects; the result value will be around as + */ + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_maxsize); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 71, __pyx_L1_error) + if (__pyx_t_4) { + + /* "src/gevent/_imap.py":87 + * # of self.rawlink() to avoid having blocking methods called in the + * # hub greenlet. + * self._result_semaphore = Semaphore(maxsize) # pylint:disable=undefined-variable # <<<<<<<<<<<<<< + * else: + * self._result_semaphore = None + */ + __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_6gevent_11__semaphore_Semaphore), __pyx_v_maxsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 87, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_self->_result_semaphore); + __Pyx_DECREF(((PyObject *)__pyx_v_self->_result_semaphore)); + __pyx_v_self->_result_semaphore = ((struct __pyx_obj_6gevent_11__semaphore_Semaphore *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "src/gevent/_imap.py":71 + * + * + * if maxsize: # <<<<<<<<<<<<<< + * # Bounding the queue is not enough if we want to keep from + * # accumulating objects; the result value will be around as + */ + goto __pyx_L3; + } + + /* "src/gevent/_imap.py":89 + * self._result_semaphore = Semaphore(maxsize) # pylint:disable=undefined-variable + * else: + * self._result_semaphore = None # <<<<<<<<<<<<<< + * + * self._outstanding_tasks = 0 + */ + /*else*/ { + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->_result_semaphore); + __Pyx_DECREF(((PyObject *)__pyx_v_self->_result_semaphore)); + __pyx_v_self->_result_semaphore = ((struct __pyx_obj_6gevent_11__semaphore_Semaphore *)Py_None); + } + __pyx_L3:; + + /* "src/gevent/_imap.py":91 + * self._result_semaphore = None + * + * self._outstanding_tasks = 0 # <<<<<<<<<<<<<< + * # The index (zero based) of the maximum number of + * # results we will have. + */ + __pyx_v_self->_outstanding_tasks = 0; + + /* "src/gevent/_imap.py":94 + * # The index (zero based) of the maximum number of + * # results we will have. + * self._max_index = -1 # <<<<<<<<<<<<<< + * self.finished = False + * + */ + __pyx_v_self->_max_index = -1; + + /* "src/gevent/_imap.py":95 + * # results we will have. + * self._max_index = -1 + * self.finished = False # <<<<<<<<<<<<<< + * + * + */ + __pyx_v_self->finished = 0; + + /* "src/gevent/_imap.py":48 + * """ + * + * def __init__(self, func, iterable, spawn, maxsize=None, _zipped=False): # <<<<<<<<<<<<<< + * """ + * An iterator that. + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("gevent.__imap.IMapUnordered.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_imap.py":99 + * + * # We're iterating in a different greenlet than we're running. + * def __iter__(self): # <<<<<<<<<<<<<< + * return self + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6__imap_13IMapUnordered_3__iter__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_6__imap_13IMapUnordered_3__iter__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6__imap_13IMapUnordered_2__iter__(((struct __pyx_obj_6gevent_6__imap_IMapUnordered *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6__imap_13IMapUnordered_2__iter__(struct __pyx_obj_6gevent_6__imap_IMapUnordered *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__iter__", 0); + + /* "src/gevent/_imap.py":100 + * # We're iterating in a different greenlet than we're running. + * def __iter__(self): + * return self # <<<<<<<<<<<<<< + * + * def __next__(self): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __pyx_r = ((PyObject *)__pyx_v_self); + goto __pyx_L0; + + /* "src/gevent/_imap.py":99 + * + * # We're iterating in a different greenlet than we're running. + * def __iter__(self): # <<<<<<<<<<<<<< + * return self + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_imap.py":102 + * return self + * + * def __next__(self): # <<<<<<<<<<<<<< + * if self._result_semaphore is not None: + * self._result_semaphore.release() + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6__imap_13IMapUnordered_5__next__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_6__imap_13IMapUnordered_5__next__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__next__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6__imap_13IMapUnordered_4__next__(((struct __pyx_obj_6gevent_6__imap_IMapUnordered *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6__imap_13IMapUnordered_4__next__(struct __pyx_obj_6gevent_6__imap_IMapUnordered *__pyx_v_self) { + PyObject *__pyx_v_value = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + __Pyx_RefNannySetupContext("__next__", 0); + + /* "src/gevent/_imap.py":103 + * + * def __next__(self): + * if self._result_semaphore is not None: # <<<<<<<<<<<<<< + * self._result_semaphore.release() + * value = self._inext() + */ + __pyx_t_1 = (((PyObject *)__pyx_v_self->_result_semaphore) != Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "src/gevent/_imap.py":104 + * def __next__(self): + * if self._result_semaphore is not None: + * self._result_semaphore.release() # <<<<<<<<<<<<<< + * value = self._inext() + * if isinstance(value, Failure): + */ + __pyx_t_3 = ((struct __pyx_vtabstruct_6gevent_11__semaphore_Semaphore *)__pyx_v_self->_result_semaphore->__pyx_base.__pyx_vtab)->release(__pyx_v_self->_result_semaphore, 0); if (unlikely(__pyx_t_3 == ((int)-1000))) __PYX_ERR(0, 104, __pyx_L1_error) + + /* "src/gevent/_imap.py":103 + * + * def __next__(self): + * if self._result_semaphore is not None: # <<<<<<<<<<<<<< + * self._result_semaphore.release() + * value = self._inext() + */ + } + + /* "src/gevent/_imap.py":105 + * if self._result_semaphore is not None: + * self._result_semaphore.release() + * value = self._inext() # <<<<<<<<<<<<<< + * if isinstance(value, Failure): + * _raise_exc(value) + */ + __pyx_t_4 = ((struct __pyx_vtabstruct_6gevent_6__imap_IMapUnordered *)__pyx_v_self->__pyx_base.__pyx_vtab)->_inext(__pyx_v_self); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 105, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_v_value = __pyx_t_4; + __pyx_t_4 = 0; + + /* "src/gevent/_imap.py":106 + * self._result_semaphore.release() + * value = self._inext() + * if isinstance(value, Failure): # <<<<<<<<<<<<<< + * _raise_exc(value) + * return value + */ + __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_value, __pyx_ptype_6gevent_6__imap_Failure); + __pyx_t_1 = (__pyx_t_2 != 0); + if (__pyx_t_1) { + + /* "src/gevent/_imap.py":107 + * value = self._inext() + * if isinstance(value, Failure): + * _raise_exc(value) # <<<<<<<<<<<<<< + * return value + * + */ + if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_6gevent_6__imap_Failure))))) __PYX_ERR(0, 107, __pyx_L1_error) + __pyx_t_4 = __pyx_f_6gevent_6__imap__raise_exc(((struct __pyx_obj_6gevent_6__imap_Failure *)__pyx_v_value)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 107, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "src/gevent/_imap.py":106 + * self._result_semaphore.release() + * value = self._inext() + * if isinstance(value, Failure): # <<<<<<<<<<<<<< + * _raise_exc(value) + * return value + */ + } + + /* "src/gevent/_imap.py":108 + * if isinstance(value, Failure): + * _raise_exc(value) + * return value # <<<<<<<<<<<<<< + * + * next = __next__ # Py2 + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_value); + __pyx_r = __pyx_v_value; + goto __pyx_L0; + + /* "src/gevent/_imap.py":102 + * return self + * + * def __next__(self): # <<<<<<<<<<<<<< + * if self._result_semaphore is not None: + * self._result_semaphore.release() + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("gevent.__imap.IMapUnordered.__next__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_value); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_imap.py":112 + * next = __next__ # Py2 + * + * def _inext(self): # <<<<<<<<<<<<<< + * return self.queue.get() + * + */ + +static PyObject *__pyx_f_6gevent_6__imap_13IMapUnordered__inext(struct __pyx_obj_6gevent_6__imap_IMapUnordered *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("_inext", 0); + + /* "src/gevent/_imap.py":113 + * + * def _inext(self): + * return self.queue.get() # <<<<<<<<<<<<<< + * + * def _ispawn(self, func, item, item_index): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_6_queue_UnboundQueue *)__pyx_v_self->queue->__pyx_base.__pyx_vtab)->__pyx_base.get(((struct __pyx_obj_6gevent_6_queue_Queue *)__pyx_v_self->queue), 0, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 113, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "src/gevent/_imap.py":112 + * next = __next__ # Py2 + * + * def _inext(self): # <<<<<<<<<<<<<< + * return self.queue.get() + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__imap.IMapUnordered._inext", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_imap.py":115 + * return self.queue.get() + * + * def _ispawn(self, func, item, item_index): # <<<<<<<<<<<<<< + * if self._result_semaphore is not None: + * self._result_semaphore.acquire() + */ + +static PyObject *__pyx_f_6gevent_6__imap_13IMapUnordered__ispawn(struct __pyx_obj_6gevent_6__imap_IMapUnordered *__pyx_v_self, PyObject *__pyx_v_func, PyObject *__pyx_v_item, int __pyx_v_item_index) { + PyObject *__pyx_v_g = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + __Pyx_RefNannySetupContext("_ispawn", 0); + + /* "src/gevent/_imap.py":116 + * + * def _ispawn(self, func, item, item_index): + * if self._result_semaphore is not None: # <<<<<<<<<<<<<< + * self._result_semaphore.acquire() + * self._outstanding_tasks += 1 + */ + __pyx_t_1 = (((PyObject *)__pyx_v_self->_result_semaphore) != Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "src/gevent/_imap.py":117 + * def _ispawn(self, func, item, item_index): + * if self._result_semaphore is not None: + * self._result_semaphore.acquire() # <<<<<<<<<<<<<< + * self._outstanding_tasks += 1 + * g = self.spawn(func, item) if not self._zipped else self.spawn(func, *item) + */ + __pyx_t_2 = ((struct __pyx_vtabstruct_6gevent_11__semaphore_Semaphore *)__pyx_v_self->_result_semaphore->__pyx_base.__pyx_vtab)->acquire(__pyx_v_self->_result_semaphore, 0, NULL); if (unlikely(__pyx_t_2 == ((int)-1000))) __PYX_ERR(0, 117, __pyx_L1_error) + + /* "src/gevent/_imap.py":116 + * + * def _ispawn(self, func, item, item_index): + * if self._result_semaphore is not None: # <<<<<<<<<<<<<< + * self._result_semaphore.acquire() + * self._outstanding_tasks += 1 + */ + } + + /* "src/gevent/_imap.py":118 + * if self._result_semaphore is not None: + * self._result_semaphore.acquire() + * self._outstanding_tasks += 1 # <<<<<<<<<<<<<< + * g = self.spawn(func, item) if not self._zipped else self.spawn(func, *item) + * g._imap_task_index = item_index + */ + __pyx_v_self->_outstanding_tasks = (__pyx_v_self->_outstanding_tasks + 1); + + /* "src/gevent/_imap.py":119 + * self._result_semaphore.acquire() + * self._outstanding_tasks += 1 + * g = self.spawn(func, item) if not self._zipped else self.spawn(func, *item) # <<<<<<<<<<<<<< + * g._imap_task_index = item_index + * g.rawlink(self._on_result) + */ + if (((!(__pyx_v_self->_zipped != 0)) != 0)) { + __Pyx_INCREF(__pyx_v_self->spawn); + __pyx_t_5 = __pyx_v_self->spawn; __pyx_t_6 = NULL; + __pyx_t_7 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); + if (likely(__pyx_t_6)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_5, function); + __pyx_t_7 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_5)) { + PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_func, __pyx_v_item}; + __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 119, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_GOTREF(__pyx_t_4); + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { + PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_func, __pyx_v_item}; + __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 119, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_GOTREF(__pyx_t_4); + } else + #endif + { + __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 119, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + if (__pyx_t_6) { + __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL; + } + __Pyx_INCREF(__pyx_v_func); + __Pyx_GIVEREF(__pyx_v_func); + PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_v_func); + __Pyx_INCREF(__pyx_v_item); + __Pyx_GIVEREF(__pyx_v_item); + PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_item); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 119, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + } + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_3 = __pyx_t_4; + __pyx_t_4 = 0; + } else { + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 119, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_func); + __Pyx_GIVEREF(__pyx_v_func); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_func); + __pyx_t_5 = __Pyx_PySequence_Tuple(__pyx_v_item); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 119, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_8 = PyNumber_Add(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 119, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_v_self->spawn, __pyx_t_8, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 119, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_3 = __pyx_t_5; + __pyx_t_5 = 0; + } + __pyx_v_g = __pyx_t_3; + __pyx_t_3 = 0; + + /* "src/gevent/_imap.py":120 + * self._outstanding_tasks += 1 + * g = self.spawn(func, item) if not self._zipped else self.spawn(func, *item) + * g._imap_task_index = item_index # <<<<<<<<<<<<<< + * g.rawlink(self._on_result) + * return g + */ + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_item_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 120, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (__Pyx_PyObject_SetAttrStr(__pyx_v_g, __pyx_n_s_imap_task_index, __pyx_t_3) < 0) __PYX_ERR(0, 120, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "src/gevent/_imap.py":121 + * g = self.spawn(func, item) if not self._zipped else self.spawn(func, *item) + * g._imap_task_index = item_index + * g.rawlink(self._on_result) # <<<<<<<<<<<<<< + * return g + * + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_g, __pyx_n_s_rawlink); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 121, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_on_result); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 121, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_5, function); + } + } + __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_4, __pyx_t_8) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_8); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 121, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "src/gevent/_imap.py":122 + * g._imap_task_index = item_index + * g.rawlink(self._on_result) + * return g # <<<<<<<<<<<<<< + * + * def _run(self): # pylint:disable=method-hidden + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_g); + __pyx_r = __pyx_v_g; + goto __pyx_L0; + + /* "src/gevent/_imap.py":115 + * return self.queue.get() + * + * def _ispawn(self, func, item, item_index): # <<<<<<<<<<<<<< + * if self._result_semaphore is not None: + * self._result_semaphore.acquire() + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("gevent.__imap.IMapUnordered._ispawn", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_g); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_imap.py":124 + * return g + * + * def _run(self): # pylint:disable=method-hidden # <<<<<<<<<<<<<< + * try: + * func = self.func + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6__imap_13IMapUnordered_7_run(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6gevent_6__imap_13IMapUnordered_6_run[] = "IMapUnordered._run(self)"; +static PyMethodDef __pyx_mdef_6gevent_6__imap_13IMapUnordered_7_run = {"_run", (PyCFunction)__pyx_pw_6gevent_6__imap_13IMapUnordered_7_run, METH_NOARGS, __pyx_doc_6gevent_6__imap_13IMapUnordered_6_run}; +static PyObject *__pyx_pw_6gevent_6__imap_13IMapUnordered_7_run(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_run (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6__imap_13IMapUnordered_6_run(((struct __pyx_obj_6gevent_6__imap_IMapUnordered *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6__imap_13IMapUnordered_6_run(struct __pyx_obj_6gevent_6__imap_IMapUnordered *__pyx_v_self) { + PyObject *__pyx_v_func = NULL; + PyObject *__pyx_v_item = NULL; + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + Py_ssize_t __pyx_t_5; + PyObject *(*__pyx_t_6)(PyObject *); + PyObject *__pyx_t_7 = NULL; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + int __pyx_t_11; + char const *__pyx_t_12; + PyObject *__pyx_t_13 = NULL; + PyObject *__pyx_t_14 = NULL; + PyObject *__pyx_t_15 = NULL; + PyObject *__pyx_t_16 = NULL; + PyObject *__pyx_t_17 = NULL; + PyObject *__pyx_t_18 = NULL; + char const *__pyx_t_19; + __Pyx_RefNannySetupContext("_run", 0); + + /* "src/gevent/_imap.py":125 + * + * def _run(self): # pylint:disable=method-hidden + * try: # <<<<<<<<<<<<<< + * func = self.func + * for item in self.iterable: + */ + /*try:*/ { + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "src/gevent/_imap.py":126 + * def _run(self): # pylint:disable=method-hidden + * try: + * func = self.func # <<<<<<<<<<<<<< + * for item in self.iterable: + * self._max_index += 1 + */ + __pyx_t_4 = __pyx_v_self->func; + __Pyx_INCREF(__pyx_t_4); + __pyx_v_func = __pyx_t_4; + __pyx_t_4 = 0; + + /* "src/gevent/_imap.py":127 + * try: + * func = self.func + * for item in self.iterable: # <<<<<<<<<<<<<< + * self._max_index += 1 + * self._ispawn(func, item, self._max_index) + */ + if (likely(PyList_CheckExact(__pyx_v_self->iterable)) || PyTuple_CheckExact(__pyx_v_self->iterable)) { + __pyx_t_4 = __pyx_v_self->iterable; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0; + __pyx_t_6 = NULL; + } else { + __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_self->iterable); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 127, __pyx_L6_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 127, __pyx_L6_error) + } + for (;;) { + if (likely(!__pyx_t_6)) { + if (likely(PyList_CheckExact(__pyx_t_4))) { + if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 127, __pyx_L6_error) + #else + __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 127, __pyx_L6_error) + __Pyx_GOTREF(__pyx_t_7); + #endif + } else { + if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 127, __pyx_L6_error) + #else + __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 127, __pyx_L6_error) + __Pyx_GOTREF(__pyx_t_7); + #endif + } + } else { + __pyx_t_7 = __pyx_t_6(__pyx_t_4); + if (unlikely(!__pyx_t_7)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(0, 127, __pyx_L6_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_7); + } + __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_7); + __pyx_t_7 = 0; + + /* "src/gevent/_imap.py":128 + * func = self.func + * for item in self.iterable: + * self._max_index += 1 # <<<<<<<<<<<<<< + * self._ispawn(func, item, self._max_index) + * self._on_finish(None) + */ + __pyx_v_self->_max_index = (__pyx_v_self->_max_index + 1); + + /* "src/gevent/_imap.py":129 + * for item in self.iterable: + * self._max_index += 1 + * self._ispawn(func, item, self._max_index) # <<<<<<<<<<<<<< + * self._on_finish(None) + * except BaseException as e: + */ + __pyx_t_7 = ((struct __pyx_vtabstruct_6gevent_6__imap_IMapUnordered *)__pyx_v_self->__pyx_base.__pyx_vtab)->_ispawn(__pyx_v_self, __pyx_v_func, __pyx_v_item, __pyx_v_self->_max_index); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 129, __pyx_L6_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "src/gevent/_imap.py":127 + * try: + * func = self.func + * for item in self.iterable: # <<<<<<<<<<<<<< + * self._max_index += 1 + * self._ispawn(func, item, self._max_index) + */ + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "src/gevent/_imap.py":130 + * self._max_index += 1 + * self._ispawn(func, item, self._max_index) + * self._on_finish(None) # <<<<<<<<<<<<<< + * except BaseException as e: + * self._on_finish(e) + */ + __pyx_t_4 = ((struct __pyx_vtabstruct_6gevent_6__imap_IMapUnordered *)__pyx_v_self->__pyx_base.__pyx_vtab)->_on_finish(__pyx_v_self, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 130, __pyx_L6_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "src/gevent/_imap.py":125 + * + * def _run(self): # pylint:disable=method-hidden + * try: # <<<<<<<<<<<<<< + * func = self.func + * for item in self.iterable: + */ + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L11_try_end; + __pyx_L6_error:; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "src/gevent/_imap.py":131 + * self._ispawn(func, item, self._max_index) + * self._on_finish(None) + * except BaseException as e: # <<<<<<<<<<<<<< + * self._on_finish(e) + * raise + */ + __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_BaseException); + if (__pyx_t_8) { + __Pyx_AddTraceback("gevent.__imap.IMapUnordered._run", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_7, &__pyx_t_9) < 0) __PYX_ERR(0, 131, __pyx_L8_except_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GOTREF(__pyx_t_9); + __Pyx_INCREF(__pyx_t_7); + __pyx_v_e = __pyx_t_7; + /*try:*/ { + + /* "src/gevent/_imap.py":132 + * self._on_finish(None) + * except BaseException as e: + * self._on_finish(e) # <<<<<<<<<<<<<< + * raise + * finally: + */ + __pyx_t_10 = ((struct __pyx_vtabstruct_6gevent_6__imap_IMapUnordered *)__pyx_v_self->__pyx_base.__pyx_vtab)->_on_finish(__pyx_v_self, __pyx_v_e); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 132, __pyx_L19_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + + /* "src/gevent/_imap.py":133 + * except BaseException as e: + * self._on_finish(e) + * raise # <<<<<<<<<<<<<< + * finally: + * self.spawn = None + */ + __Pyx_GIVEREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_7); + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_ErrRestoreWithState(__pyx_t_4, __pyx_t_7, __pyx_t_9); + __pyx_t_4 = 0; __pyx_t_7 = 0; __pyx_t_9 = 0; + __PYX_ERR(0, 133, __pyx_L19_error) + } + + /* "src/gevent/_imap.py":131 + * self._ispawn(func, item, self._max_index) + * self._on_finish(None) + * except BaseException as e: # <<<<<<<<<<<<<< + * self._on_finish(e) + * raise + */ + /*finally:*/ { + __pyx_L19_error:; + /*exception exit:*/{ + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18); + if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15) < 0)) __Pyx_ErrFetch(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15); + __Pyx_XGOTREF(__pyx_t_13); + __Pyx_XGOTREF(__pyx_t_14); + __Pyx_XGOTREF(__pyx_t_15); + __Pyx_XGOTREF(__pyx_t_16); + __Pyx_XGOTREF(__pyx_t_17); + __Pyx_XGOTREF(__pyx_t_18); + __pyx_t_8 = __pyx_lineno; __pyx_t_11 = __pyx_clineno; __pyx_t_12 = __pyx_filename; + { + __Pyx_DECREF(__pyx_v_e); + __pyx_v_e = NULL; + } + if (PY_MAJOR_VERSION >= 3) { + __Pyx_XGIVEREF(__pyx_t_16); + __Pyx_XGIVEREF(__pyx_t_17); + __Pyx_XGIVEREF(__pyx_t_18); + __Pyx_ExceptionReset(__pyx_t_16, __pyx_t_17, __pyx_t_18); + } + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_XGIVEREF(__pyx_t_15); + __Pyx_ErrRestore(__pyx_t_13, __pyx_t_14, __pyx_t_15); + __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; + __pyx_lineno = __pyx_t_8; __pyx_clineno = __pyx_t_11; __pyx_filename = __pyx_t_12; + goto __pyx_L8_except_error; + } + } + } + goto __pyx_L8_except_error; + __pyx_L8_except_error:; + + /* "src/gevent/_imap.py":125 + * + * def _run(self): # pylint:disable=method-hidden + * try: # <<<<<<<<<<<<<< + * func = self.func + * for item in self.iterable: + */ + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L4_error; + __pyx_L11_try_end:; + } + } + + /* "src/gevent/_imap.py":135 + * raise + * finally: + * self.spawn = None # <<<<<<<<<<<<<< + * self.func = None + * self.iterable = None + */ + /*finally:*/ { + /*normal exit:*/{ + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->spawn); + __Pyx_DECREF(__pyx_v_self->spawn); + __pyx_v_self->spawn = Py_None; + + /* "src/gevent/_imap.py":136 + * finally: + * self.spawn = None + * self.func = None # <<<<<<<<<<<<<< + * self.iterable = None + * self._result_semaphore = None + */ + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->func); + __Pyx_DECREF(__pyx_v_self->func); + __pyx_v_self->func = Py_None; + + /* "src/gevent/_imap.py":137 + * self.spawn = None + * self.func = None + * self.iterable = None # <<<<<<<<<<<<<< + * self._result_semaphore = None + * + */ + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->iterable); + __Pyx_DECREF(__pyx_v_self->iterable); + __pyx_v_self->iterable = Py_None; + + /* "src/gevent/_imap.py":138 + * self.func = None + * self.iterable = None + * self._result_semaphore = None # <<<<<<<<<<<<<< + * + * def _on_result(self, greenlet): + */ + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->_result_semaphore); + __Pyx_DECREF(((PyObject *)__pyx_v_self->_result_semaphore)); + __pyx_v_self->_result_semaphore = ((struct __pyx_obj_6gevent_11__semaphore_Semaphore *)Py_None); + goto __pyx_L5; + } + __pyx_L4_error:; + /*exception exit:*/{ + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __pyx_t_3 = 0; __pyx_t_2 = 0; __pyx_t_1 = 0; __pyx_t_18 = 0; __pyx_t_17 = 0; __pyx_t_16 = 0; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_18, &__pyx_t_17, &__pyx_t_16); + if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_3, &__pyx_t_2, &__pyx_t_1) < 0)) __Pyx_ErrFetch(&__pyx_t_3, &__pyx_t_2, &__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_18); + __Pyx_XGOTREF(__pyx_t_17); + __Pyx_XGOTREF(__pyx_t_16); + __pyx_t_11 = __pyx_lineno; __pyx_t_8 = __pyx_clineno; __pyx_t_19 = __pyx_filename; + { + + /* "src/gevent/_imap.py":135 + * raise + * finally: + * self.spawn = None # <<<<<<<<<<<<<< + * self.func = None + * self.iterable = None + */ + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->spawn); + __Pyx_DECREF(__pyx_v_self->spawn); + __pyx_v_self->spawn = Py_None; + + /* "src/gevent/_imap.py":136 + * finally: + * self.spawn = None + * self.func = None # <<<<<<<<<<<<<< + * self.iterable = None + * self._result_semaphore = None + */ + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->func); + __Pyx_DECREF(__pyx_v_self->func); + __pyx_v_self->func = Py_None; + + /* "src/gevent/_imap.py":137 + * self.spawn = None + * self.func = None + * self.iterable = None # <<<<<<<<<<<<<< + * self._result_semaphore = None + * + */ + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->iterable); + __Pyx_DECREF(__pyx_v_self->iterable); + __pyx_v_self->iterable = Py_None; + + /* "src/gevent/_imap.py":138 + * self.func = None + * self.iterable = None + * self._result_semaphore = None # <<<<<<<<<<<<<< + * + * def _on_result(self, greenlet): + */ + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->_result_semaphore); + __Pyx_DECREF(((PyObject *)__pyx_v_self->_result_semaphore)); + __pyx_v_self->_result_semaphore = ((struct __pyx_obj_6gevent_11__semaphore_Semaphore *)Py_None); + } + if (PY_MAJOR_VERSION >= 3) { + __Pyx_XGIVEREF(__pyx_t_18); + __Pyx_XGIVEREF(__pyx_t_17); + __Pyx_XGIVEREF(__pyx_t_16); + __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_17, __pyx_t_16); + } + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_ErrRestore(__pyx_t_3, __pyx_t_2, __pyx_t_1); + __pyx_t_3 = 0; __pyx_t_2 = 0; __pyx_t_1 = 0; __pyx_t_18 = 0; __pyx_t_17 = 0; __pyx_t_16 = 0; + __pyx_lineno = __pyx_t_11; __pyx_clineno = __pyx_t_8; __pyx_filename = __pyx_t_19; + goto __pyx_L1_error; + } + __pyx_L5:; + } + + /* "src/gevent/_imap.py":124 + * return g + * + * def _run(self): # pylint:disable=method-hidden # <<<<<<<<<<<<<< + * try: + * func = self.func + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_AddTraceback("gevent.__imap.IMapUnordered._run", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_func); + __Pyx_XDECREF(__pyx_v_item); + __Pyx_XDECREF(__pyx_v_e); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_imap.py":140 + * self._result_semaphore = None + * + * def _on_result(self, greenlet): # <<<<<<<<<<<<<< + * # This method will be called in the hub greenlet (we rawlink) + * self._outstanding_tasks -= 1 + */ + +static PyObject *__pyx_pw_6gevent_6__imap_13IMapUnordered_9_on_result(PyObject *__pyx_v_self, PyObject *__pyx_v_greenlet); /*proto*/ +static PyObject *__pyx_f_6gevent_6__imap_13IMapUnordered__on_result(struct __pyx_obj_6gevent_6__imap_IMapUnordered *__pyx_v_self, PyObject *__pyx_v_greenlet, int __pyx_skip_dispatch) { + int __pyx_v_count; + int __pyx_v_finished; + int __pyx_v_ready; + int __pyx_v_put_finished; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + int __pyx_t_6; + int __pyx_t_7; + __Pyx_RefNannySetupContext("_on_result", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0; + if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self)))))); + else { + PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + #endif + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_on_result); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 140, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_6__imap_13IMapUnordered_9_on_result)) { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_greenlet) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_greenlet); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 140, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0; + if (unlikely(type_dict_guard != tp_dict_version)) { + tp_dict_version = obj_dict_version = 0; + } + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + } + #endif + } + + /* "src/gevent/_imap.py":142 + * def _on_result(self, greenlet): + * # This method will be called in the hub greenlet (we rawlink) + * self._outstanding_tasks -= 1 # <<<<<<<<<<<<<< + * count = self._outstanding_tasks + * finished = self.finished + */ + __pyx_v_self->_outstanding_tasks = (__pyx_v_self->_outstanding_tasks - 1); + + /* "src/gevent/_imap.py":143 + * # This method will be called in the hub greenlet (we rawlink) + * self._outstanding_tasks -= 1 + * count = self._outstanding_tasks # <<<<<<<<<<<<<< + * finished = self.finished + * ready = self.ready() + */ + __pyx_t_5 = __pyx_v_self->_outstanding_tasks; + __pyx_v_count = __pyx_t_5; + + /* "src/gevent/_imap.py":144 + * self._outstanding_tasks -= 1 + * count = self._outstanding_tasks + * finished = self.finished # <<<<<<<<<<<<<< + * ready = self.ready() + * put_finished = False + */ + __pyx_t_6 = __pyx_v_self->finished; + __pyx_v_finished = __pyx_t_6; + + /* "src/gevent/_imap.py":145 + * count = self._outstanding_tasks + * finished = self.finished + * ready = self.ready() # <<<<<<<<<<<<<< + * put_finished = False + * + */ + __pyx_v_ready = ((struct __pyx_vtabstruct_6gevent_6__imap_IMapUnordered *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.ready(((struct __pyx_obj_6gevent_9_greenlet_Greenlet *)__pyx_v_self), 0); + + /* "src/gevent/_imap.py":146 + * finished = self.finished + * ready = self.ready() + * put_finished = False # <<<<<<<<<<<<<< + * + * if ready and count <= 0 and not finished: + */ + __pyx_v_put_finished = 0; + + /* "src/gevent/_imap.py":148 + * put_finished = False + * + * if ready and count <= 0 and not finished: # <<<<<<<<<<<<<< + * finished = self.finished = True + * put_finished = True + */ + __pyx_t_7 = (__pyx_v_ready != 0); + if (__pyx_t_7) { + } else { + __pyx_t_6 = __pyx_t_7; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_7 = ((__pyx_v_count <= 0) != 0); + if (__pyx_t_7) { + } else { + __pyx_t_6 = __pyx_t_7; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_7 = ((!(__pyx_v_finished != 0)) != 0); + __pyx_t_6 = __pyx_t_7; + __pyx_L4_bool_binop_done:; + if (__pyx_t_6) { + + /* "src/gevent/_imap.py":149 + * + * if ready and count <= 0 and not finished: + * finished = self.finished = True # <<<<<<<<<<<<<< + * put_finished = True + * + */ + __pyx_v_finished = 1; + __pyx_v_self->finished = 1; + + /* "src/gevent/_imap.py":150 + * if ready and count <= 0 and not finished: + * finished = self.finished = True + * put_finished = True # <<<<<<<<<<<<<< + * + * if greenlet.successful(): + */ + __pyx_v_put_finished = 1; + + /* "src/gevent/_imap.py":148 + * put_finished = False + * + * if ready and count <= 0 and not finished: # <<<<<<<<<<<<<< + * finished = self.finished = True + * put_finished = True + */ + } + + /* "src/gevent/_imap.py":152 + * put_finished = True + * + * if greenlet.successful(): # <<<<<<<<<<<<<< + * self.queue.put(self._iqueue_value_for_success(greenlet)) + * else: + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_greenlet, __pyx_n_s_successful); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 152, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 152, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 152, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_6) { + + /* "src/gevent/_imap.py":153 + * + * if greenlet.successful(): + * self.queue.put(self._iqueue_value_for_success(greenlet)) # <<<<<<<<<<<<<< + * else: + * self.queue.put(self._iqueue_value_for_failure(greenlet)) + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_6__imap_IMapUnordered *)__pyx_v_self->__pyx_base.__pyx_vtab)->_iqueue_value_for_success(__pyx_v_self, __pyx_v_greenlet); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 153, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = ((struct __pyx_vtabstruct_6gevent_6_queue_UnboundQueue *)__pyx_v_self->queue->__pyx_base.__pyx_vtab)->__pyx_base.put(((struct __pyx_obj_6gevent_6_queue_Queue *)__pyx_v_self->queue), __pyx_t_1, 0, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 153, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/_imap.py":152 + * put_finished = True + * + * if greenlet.successful(): # <<<<<<<<<<<<<< + * self.queue.put(self._iqueue_value_for_success(greenlet)) + * else: + */ + goto __pyx_L7; + } + + /* "src/gevent/_imap.py":155 + * self.queue.put(self._iqueue_value_for_success(greenlet)) + * else: + * self.queue.put(self._iqueue_value_for_failure(greenlet)) # <<<<<<<<<<<<<< + * + * if put_finished: + */ + /*else*/ { + __pyx_t_2 = ((struct __pyx_vtabstruct_6gevent_6__imap_IMapUnordered *)__pyx_v_self->__pyx_base.__pyx_vtab)->_iqueue_value_for_failure(__pyx_v_self, __pyx_v_greenlet); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 155, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_6_queue_UnboundQueue *)__pyx_v_self->queue->__pyx_base.__pyx_vtab)->__pyx_base.put(((struct __pyx_obj_6gevent_6_queue_Queue *)__pyx_v_self->queue), __pyx_t_2, 0, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 155, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + __pyx_L7:; + + /* "src/gevent/_imap.py":157 + * self.queue.put(self._iqueue_value_for_failure(greenlet)) + * + * if put_finished: # <<<<<<<<<<<<<< + * self.queue.put(self._iqueue_value_for_self_finished()) + * + */ + __pyx_t_6 = (__pyx_v_put_finished != 0); + if (__pyx_t_6) { + + /* "src/gevent/_imap.py":158 + * + * if put_finished: + * self.queue.put(self._iqueue_value_for_self_finished()) # <<<<<<<<<<<<<< + * + * def _on_finish(self, exception): + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_6__imap_IMapUnordered *)__pyx_v_self->__pyx_base.__pyx_vtab)->_iqueue_value_for_self_finished(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 158, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = ((struct __pyx_vtabstruct_6gevent_6_queue_UnboundQueue *)__pyx_v_self->queue->__pyx_base.__pyx_vtab)->__pyx_base.put(((struct __pyx_obj_6gevent_6_queue_Queue *)__pyx_v_self->queue), __pyx_t_1, 0, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 158, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/_imap.py":157 + * self.queue.put(self._iqueue_value_for_failure(greenlet)) + * + * if put_finished: # <<<<<<<<<<<<<< + * self.queue.put(self._iqueue_value_for_self_finished()) + * + */ + } + + /* "src/gevent/_imap.py":140 + * self._result_semaphore = None + * + * def _on_result(self, greenlet): # <<<<<<<<<<<<<< + * # This method will be called in the hub greenlet (we rawlink) + * self._outstanding_tasks -= 1 + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("gevent.__imap.IMapUnordered._on_result", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6__imap_13IMapUnordered_9_on_result(PyObject *__pyx_v_self, PyObject *__pyx_v_greenlet); /*proto*/ +static char __pyx_doc_6gevent_6__imap_13IMapUnordered_8_on_result[] = "IMapUnordered._on_result(self, greenlet)"; +static PyMethodDef __pyx_mdef_6gevent_6__imap_13IMapUnordered_9_on_result = {"_on_result", (PyCFunction)__pyx_pw_6gevent_6__imap_13IMapUnordered_9_on_result, METH_O, __pyx_doc_6gevent_6__imap_13IMapUnordered_8_on_result}; +static PyObject *__pyx_pw_6gevent_6__imap_13IMapUnordered_9_on_result(PyObject *__pyx_v_self, PyObject *__pyx_v_greenlet) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_on_result (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6__imap_13IMapUnordered_8_on_result(((struct __pyx_obj_6gevent_6__imap_IMapUnordered *)__pyx_v_self), ((PyObject *)__pyx_v_greenlet)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6__imap_13IMapUnordered_8_on_result(struct __pyx_obj_6gevent_6__imap_IMapUnordered *__pyx_v_self, PyObject *__pyx_v_greenlet) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("_on_result", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6gevent_6__imap_13IMapUnordered__on_result(__pyx_v_self, __pyx_v_greenlet, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 140, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__imap.IMapUnordered._on_result", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_imap.py":160 + * self.queue.put(self._iqueue_value_for_self_finished()) + * + * def _on_finish(self, exception): # <<<<<<<<<<<<<< + * # Called in this greenlet. + * if self.finished: + */ + +static PyObject *__pyx_f_6gevent_6__imap_13IMapUnordered__on_finish(struct __pyx_obj_6gevent_6__imap_IMapUnordered *__pyx_v_self, PyObject *__pyx_v_exception) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + __Pyx_RefNannySetupContext("_on_finish", 0); + + /* "src/gevent/_imap.py":162 + * def _on_finish(self, exception): + * # Called in this greenlet. + * if self.finished: # <<<<<<<<<<<<<< + * return + * + */ + __pyx_t_1 = (__pyx_v_self->finished != 0); + if (__pyx_t_1) { + + /* "src/gevent/_imap.py":163 + * # Called in this greenlet. + * if self.finished: + * return # <<<<<<<<<<<<<< + * + * if exception is not None: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + + /* "src/gevent/_imap.py":162 + * def _on_finish(self, exception): + * # Called in this greenlet. + * if self.finished: # <<<<<<<<<<<<<< + * return + * + */ + } + + /* "src/gevent/_imap.py":165 + * return + * + * if exception is not None: # <<<<<<<<<<<<<< + * self.finished = True + * self.queue.put(self._iqueue_value_for_self_failure(exception)) + */ + __pyx_t_1 = (__pyx_v_exception != Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "src/gevent/_imap.py":166 + * + * if exception is not None: + * self.finished = True # <<<<<<<<<<<<<< + * self.queue.put(self._iqueue_value_for_self_failure(exception)) + * return + */ + __pyx_v_self->finished = 1; + + /* "src/gevent/_imap.py":167 + * if exception is not None: + * self.finished = True + * self.queue.put(self._iqueue_value_for_self_failure(exception)) # <<<<<<<<<<<<<< + * return + * + */ + __pyx_t_3 = ((struct __pyx_vtabstruct_6gevent_6__imap_IMapUnordered *)__pyx_v_self->__pyx_base.__pyx_vtab)->_iqueue_value_for_self_failure(__pyx_v_self, __pyx_v_exception); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 167, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = ((struct __pyx_vtabstruct_6gevent_6_queue_UnboundQueue *)__pyx_v_self->queue->__pyx_base.__pyx_vtab)->__pyx_base.put(((struct __pyx_obj_6gevent_6_queue_Queue *)__pyx_v_self->queue), __pyx_t_3, 0, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 167, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "src/gevent/_imap.py":168 + * self.finished = True + * self.queue.put(self._iqueue_value_for_self_failure(exception)) + * return # <<<<<<<<<<<<<< + * + * if self._outstanding_tasks <= 0: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + + /* "src/gevent/_imap.py":165 + * return + * + * if exception is not None: # <<<<<<<<<<<<<< + * self.finished = True + * self.queue.put(self._iqueue_value_for_self_failure(exception)) + */ + } + + /* "src/gevent/_imap.py":170 + * return + * + * if self._outstanding_tasks <= 0: # <<<<<<<<<<<<<< + * self.finished = True + * self.queue.put(self._iqueue_value_for_self_finished()) + */ + __pyx_t_2 = ((__pyx_v_self->_outstanding_tasks <= 0) != 0); + if (__pyx_t_2) { + + /* "src/gevent/_imap.py":171 + * + * if self._outstanding_tasks <= 0: + * self.finished = True # <<<<<<<<<<<<<< + * self.queue.put(self._iqueue_value_for_self_finished()) + * + */ + __pyx_v_self->finished = 1; + + /* "src/gevent/_imap.py":172 + * if self._outstanding_tasks <= 0: + * self.finished = True + * self.queue.put(self._iqueue_value_for_self_finished()) # <<<<<<<<<<<<<< + * + * def _iqueue_value_for_success(self, greenlet): + */ + __pyx_t_4 = ((struct __pyx_vtabstruct_6gevent_6__imap_IMapUnordered *)__pyx_v_self->__pyx_base.__pyx_vtab)->_iqueue_value_for_self_finished(__pyx_v_self); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 172, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = ((struct __pyx_vtabstruct_6gevent_6_queue_UnboundQueue *)__pyx_v_self->queue->__pyx_base.__pyx_vtab)->__pyx_base.put(((struct __pyx_obj_6gevent_6_queue_Queue *)__pyx_v_self->queue), __pyx_t_4, 0, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 172, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "src/gevent/_imap.py":170 + * return + * + * if self._outstanding_tasks <= 0: # <<<<<<<<<<<<<< + * self.finished = True + * self.queue.put(self._iqueue_value_for_self_finished()) + */ + } + + /* "src/gevent/_imap.py":160 + * self.queue.put(self._iqueue_value_for_self_finished()) + * + * def _on_finish(self, exception): # <<<<<<<<<<<<<< + * # Called in this greenlet. + * if self.finished: + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("gevent.__imap.IMapUnordered._on_finish", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_imap.py":174 + * self.queue.put(self._iqueue_value_for_self_finished()) + * + * def _iqueue_value_for_success(self, greenlet): # <<<<<<<<<<<<<< + * return greenlet.value + * + */ + +static PyObject *__pyx_f_6gevent_6__imap_13IMapUnordered__iqueue_value_for_success(CYTHON_UNUSED struct __pyx_obj_6gevent_6__imap_IMapUnordered *__pyx_v_self, PyObject *__pyx_v_greenlet) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("_iqueue_value_for_success", 0); + + /* "src/gevent/_imap.py":175 + * + * def _iqueue_value_for_success(self, greenlet): + * return greenlet.value # <<<<<<<<<<<<<< + * + * def _iqueue_value_for_failure(self, greenlet): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_greenlet, __pyx_n_s_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 175, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "src/gevent/_imap.py":174 + * self.queue.put(self._iqueue_value_for_self_finished()) + * + * def _iqueue_value_for_success(self, greenlet): # <<<<<<<<<<<<<< + * return greenlet.value + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__imap.IMapUnordered._iqueue_value_for_success", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_imap.py":177 + * return greenlet.value + * + * def _iqueue_value_for_failure(self, greenlet): # <<<<<<<<<<<<<< + * return Failure(greenlet.exception, getattr(greenlet, '_raise_exception')) + * + */ + +static PyObject *__pyx_f_6gevent_6__imap_13IMapUnordered__iqueue_value_for_failure(CYTHON_UNUSED struct __pyx_obj_6gevent_6__imap_IMapUnordered *__pyx_v_self, PyObject *__pyx_v_greenlet) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("_iqueue_value_for_failure", 0); + + /* "src/gevent/_imap.py":178 + * + * def _iqueue_value_for_failure(self, greenlet): + * return Failure(greenlet.exception, getattr(greenlet, '_raise_exception')) # <<<<<<<<<<<<<< + * + * def _iqueue_value_for_self_finished(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_greenlet, __pyx_n_s_exception); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 178, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_GetAttr(__pyx_v_greenlet, __pyx_n_s_raise_exception_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 178, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 178, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); + __pyx_t_1 = 0; + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6gevent_6__imap_Failure), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 178, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "src/gevent/_imap.py":177 + * return greenlet.value + * + * def _iqueue_value_for_failure(self, greenlet): # <<<<<<<<<<<<<< + * return Failure(greenlet.exception, getattr(greenlet, '_raise_exception')) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("gevent.__imap.IMapUnordered._iqueue_value_for_failure", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_imap.py":180 + * return Failure(greenlet.exception, getattr(greenlet, '_raise_exception')) + * + * def _iqueue_value_for_self_finished(self): # <<<<<<<<<<<<<< + * return Failure(StopIteration()) + * + */ + +static PyObject *__pyx_f_6gevent_6__imap_13IMapUnordered__iqueue_value_for_self_finished(CYTHON_UNUSED struct __pyx_obj_6gevent_6__imap_IMapUnordered *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("_iqueue_value_for_self_finished", 0); + + /* "src/gevent/_imap.py":181 + * + * def _iqueue_value_for_self_finished(self): + * return Failure(StopIteration()) # <<<<<<<<<<<<<< + * + * def _iqueue_value_for_self_failure(self, exception): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_builtin_StopIteration); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 181, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_6gevent_6__imap_Failure), __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 181, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "src/gevent/_imap.py":180 + * return Failure(greenlet.exception, getattr(greenlet, '_raise_exception')) + * + * def _iqueue_value_for_self_finished(self): # <<<<<<<<<<<<<< + * return Failure(StopIteration()) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent.__imap.IMapUnordered._iqueue_value_for_self_finished", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_imap.py":183 + * return Failure(StopIteration()) + * + * def _iqueue_value_for_self_failure(self, exception): # <<<<<<<<<<<<<< + * return Failure(exception, self._raise_exception) + * + */ + +static PyObject *__pyx_f_6gevent_6__imap_13IMapUnordered__iqueue_value_for_self_failure(struct __pyx_obj_6gevent_6__imap_IMapUnordered *__pyx_v_self, PyObject *__pyx_v_exception) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("_iqueue_value_for_self_failure", 0); + + /* "src/gevent/_imap.py":184 + * + * def _iqueue_value_for_self_failure(self, exception): + * return Failure(exception, self._raise_exception) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_raise_exception_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 184, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 184, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_exception); + __Pyx_GIVEREF(__pyx_v_exception); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_exception); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6gevent_6__imap_Failure), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 184, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "src/gevent/_imap.py":183 + * return Failure(StopIteration()) + * + * def _iqueue_value_for_self_failure(self, exception): # <<<<<<<<<<<<<< + * return Failure(exception, self._raise_exception) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent.__imap.IMapUnordered._iqueue_value_for_self_failure", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/__imap.pxd":24 + * cdef int _max_index + * + * cdef readonly UnboundQueue queue # <<<<<<<<<<<<<< + * cdef readonly bint finished + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6__imap_13IMapUnordered_5queue_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_6__imap_13IMapUnordered_5queue_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6__imap_13IMapUnordered_5queue___get__(((struct __pyx_obj_6gevent_6__imap_IMapUnordered *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6__imap_13IMapUnordered_5queue___get__(struct __pyx_obj_6gevent_6__imap_IMapUnordered *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_self->queue)); + __pyx_r = ((PyObject *)__pyx_v_self->queue); + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/__imap.pxd":25 + * + * cdef readonly UnboundQueue queue + * cdef readonly bint finished # <<<<<<<<<<<<<< + * + * cdef _inext(self) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6__imap_13IMapUnordered_8finished_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_6__imap_13IMapUnordered_8finished_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6__imap_13IMapUnordered_8finished___get__(((struct __pyx_obj_6gevent_6__imap_IMapUnordered *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6__imap_13IMapUnordered_8finished___get__(struct __pyx_obj_6gevent_6__imap_IMapUnordered *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->finished); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 25, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__imap.IMapUnordered.finished.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_imap.py":192 + * # the order in which they finish. + * + * def __init__(self, *args, **kwargs): # <<<<<<<<<<<<<< + * # The result dictionary: {index: value} + * self._results = {} + */ + +/* Python wrapper */ +static int __pyx_pw_6gevent_6__imap_4IMap_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6gevent_6__imap_4IMap_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_args = 0; + PyObject *__pyx_v_kwargs = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 1))) return -1; + if (unlikely(__pyx_kwds)) { + __pyx_v_kwargs = PyDict_Copy(__pyx_kwds); if (unlikely(!__pyx_v_kwargs)) return -1; + __Pyx_GOTREF(__pyx_v_kwargs); + } else { + __pyx_v_kwargs = NULL; + } + __Pyx_INCREF(__pyx_args); + __pyx_v_args = __pyx_args; + __pyx_r = __pyx_pf_6gevent_6__imap_4IMap___init__(((struct __pyx_obj_6gevent_6__imap_IMap *)__pyx_v_self), __pyx_v_args, __pyx_v_kwargs); + + /* function exit code */ + __Pyx_XDECREF(__pyx_v_args); + __Pyx_XDECREF(__pyx_v_kwargs); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_6__imap_4IMap___init__(struct __pyx_obj_6gevent_6__imap_IMap *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "src/gevent/_imap.py":194 + * def __init__(self, *args, **kwargs): + * # The result dictionary: {index: value} + * self._results = {} # <<<<<<<<<<<<<< + * + * # The index of the result to return next. + */ + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 194, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_self->_results); + __Pyx_DECREF(__pyx_v_self->_results); + __pyx_v_self->_results = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "src/gevent/_imap.py":197 + * + * # The index of the result to return next. + * self.index = 0 # <<<<<<<<<<<<<< + * IMapUnordered.__init__(self, *args, **kwargs) + * + */ + __pyx_v_self->index = 0; + + /* "src/gevent/_imap.py":198 + * # The index of the result to return next. + * self.index = 0 + * IMapUnordered.__init__(self, *args, **kwargs) # <<<<<<<<<<<<<< + * + * def _inext(self): + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_6gevent_6__imap_IMapUnordered), __pyx_n_s_init); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 198, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 198, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self)); + __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_v_args); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 198, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 198, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/_imap.py":192 + * # the order in which they finish. + * + * def __init__(self, *args, **kwargs): # <<<<<<<<<<<<<< + * # The result dictionary: {index: value} + * self._results = {} + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("gevent.__imap.IMap.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_imap.py":200 + * IMapUnordered.__init__(self, *args, **kwargs) + * + * def _inext(self): # <<<<<<<<<<<<<< + * try: + * value = self._results.pop(self.index) + */ + +static PyObject *__pyx_f_6gevent_6__imap_4IMap__inext(struct __pyx_obj_6gevent_6__imap_IMap *__pyx_v_self) { + int __pyx_v_index; + PyObject *__pyx_v_value = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *(*__pyx_t_12)(PyObject *); + int __pyx_t_13; + __Pyx_RefNannySetupContext("_inext", 0); + + /* "src/gevent/_imap.py":201 + * + * def _inext(self): + * try: # <<<<<<<<<<<<<< + * value = self._results.pop(self.index) + * except KeyError: + */ + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "src/gevent/_imap.py":202 + * def _inext(self): + * try: + * value = self._results.pop(self.index) # <<<<<<<<<<<<<< + * except KeyError: + * # Wait for our index to finish. + */ + if (unlikely(__pyx_v_self->_results == Py_None)) { + PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "pop"); + __PYX_ERR(0, 202, __pyx_L3_error) + } + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_self->index); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 202, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyDict_Pop(__pyx_v_self->_results, __pyx_t_4, ((PyObject *)NULL)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 202, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_value = __pyx_t_5; + __pyx_t_5 = 0; + + /* "src/gevent/_imap.py":201 + * + * def _inext(self): + * try: # <<<<<<<<<<<<<< + * value = self._results.pop(self.index) + * except KeyError: + */ + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L8_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "src/gevent/_imap.py":203 + * try: + * value = self._results.pop(self.index) + * except KeyError: # <<<<<<<<<<<<<< + * # Wait for our index to finish. + * while 1: + */ + __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError); + if (__pyx_t_6) { + __Pyx_AddTraceback("gevent.__imap.IMap._inext", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_4, &__pyx_t_7) < 0) __PYX_ERR(0, 203, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_7); + + /* "src/gevent/_imap.py":205 + * except KeyError: + * # Wait for our index to finish. + * while 1: # <<<<<<<<<<<<<< + * index, value = self.queue.get() + * if index == self.index: + */ + while (1) { + + /* "src/gevent/_imap.py":206 + * # Wait for our index to finish. + * while 1: + * index, value = self.queue.get() # <<<<<<<<<<<<<< + * if index == self.index: + * break + */ + __pyx_t_8 = ((struct __pyx_vtabstruct_6gevent_6_queue_UnboundQueue *)__pyx_v_self->__pyx_base.queue->__pyx_base.__pyx_vtab)->__pyx_base.get(((struct __pyx_obj_6gevent_6_queue_Queue *)__pyx_v_self->__pyx_base.queue), 0, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 206, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_8); + if ((likely(PyTuple_CheckExact(__pyx_t_8))) || (PyList_CheckExact(__pyx_t_8))) { + PyObject* sequence = __pyx_t_8; + Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + __PYX_ERR(0, 206, __pyx_L5_except_error) + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_9 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_10 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_9 = PyList_GET_ITEM(sequence, 0); + __pyx_t_10 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_9); + __Pyx_INCREF(__pyx_t_10); + #else + __pyx_t_9 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 206, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 206, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_10); + #endif + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_11 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 206, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_12 = Py_TYPE(__pyx_t_11)->tp_iternext; + index = 0; __pyx_t_9 = __pyx_t_12(__pyx_t_11); if (unlikely(!__pyx_t_9)) goto __pyx_L13_unpacking_failed; + __Pyx_GOTREF(__pyx_t_9); + index = 1; __pyx_t_10 = __pyx_t_12(__pyx_t_11); if (unlikely(!__pyx_t_10)) goto __pyx_L13_unpacking_failed; + __Pyx_GOTREF(__pyx_t_10); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_11), 2) < 0) __PYX_ERR(0, 206, __pyx_L5_except_error) + __pyx_t_12 = NULL; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + goto __pyx_L14_unpacking_done; + __pyx_L13_unpacking_failed:; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_12 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + __PYX_ERR(0, 206, __pyx_L5_except_error) + __pyx_L14_unpacking_done:; + } + __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_t_9); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 206, __pyx_L5_except_error) + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_v_index = __pyx_t_6; + __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_10); + __pyx_t_10 = 0; + + /* "src/gevent/_imap.py":207 + * while 1: + * index, value = self.queue.get() + * if index == self.index: # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_t_13 = ((__pyx_v_index == __pyx_v_self->index) != 0); + if (__pyx_t_13) { + + /* "src/gevent/_imap.py":208 + * index, value = self.queue.get() + * if index == self.index: + * break # <<<<<<<<<<<<<< + * else: + * self._results[index] = value + */ + goto __pyx_L12_break; + + /* "src/gevent/_imap.py":207 + * while 1: + * index, value = self.queue.get() + * if index == self.index: # <<<<<<<<<<<<<< + * break + * else: + */ + } + + /* "src/gevent/_imap.py":210 + * break + * else: + * self._results[index] = value # <<<<<<<<<<<<<< + * self.index += 1 + * return value + */ + /*else*/ { + if (unlikely(__pyx_v_self->_results == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 210, __pyx_L5_except_error) + } + __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_index); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 210, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_8); + if (unlikely(PyDict_SetItem(__pyx_v_self->_results, __pyx_t_8, __pyx_v_value) < 0)) __PYX_ERR(0, 210, __pyx_L5_except_error) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + } + } + __pyx_L12_break:; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + + /* "src/gevent/_imap.py":201 + * + * def _inext(self): + * try: # <<<<<<<<<<<<<< + * value = self._results.pop(self.index) + * except KeyError: + */ + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L8_try_end:; + } + + /* "src/gevent/_imap.py":211 + * else: + * self._results[index] = value + * self.index += 1 # <<<<<<<<<<<<<< + * return value + * + */ + __pyx_v_self->index = (__pyx_v_self->index + 1); + + /* "src/gevent/_imap.py":212 + * self._results[index] = value + * self.index += 1 + * return value # <<<<<<<<<<<<<< + * + * def _iqueue_value_for_success(self, greenlet): + */ + __Pyx_XDECREF(__pyx_r); + if (unlikely(!__pyx_v_value)) { __Pyx_RaiseUnboundLocalError("value"); __PYX_ERR(0, 212, __pyx_L1_error) } + __Pyx_INCREF(__pyx_v_value); + __pyx_r = __pyx_v_value; + goto __pyx_L0; + + /* "src/gevent/_imap.py":200 + * IMapUnordered.__init__(self, *args, **kwargs) + * + * def _inext(self): # <<<<<<<<<<<<<< + * try: + * value = self._results.pop(self.index) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_AddTraceback("gevent.__imap.IMap._inext", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_value); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_imap.py":214 + * return value + * + * def _iqueue_value_for_success(self, greenlet): # <<<<<<<<<<<<<< + * return (greenlet._imap_task_index, IMapUnordered._iqueue_value_for_success(self, greenlet)) + * + */ + +static PyObject *__pyx_f_6gevent_6__imap_4IMap__iqueue_value_for_success(struct __pyx_obj_6gevent_6__imap_IMap *__pyx_v_self, PyObject *__pyx_v_greenlet) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("_iqueue_value_for_success", 0); + + /* "src/gevent/_imap.py":215 + * + * def _iqueue_value_for_success(self, greenlet): + * return (greenlet._imap_task_index, IMapUnordered._iqueue_value_for_success(self, greenlet)) # <<<<<<<<<<<<<< + * + * def _iqueue_value_for_failure(self, greenlet): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_greenlet, __pyx_n_s_imap_task_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 215, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __pyx_f_6gevent_6__imap_13IMapUnordered__iqueue_value_for_success(((struct __pyx_obj_6gevent_6__imap_IMapUnordered *)__pyx_v_self), __pyx_v_greenlet); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 215, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 215, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); + __pyx_t_1 = 0; + __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "src/gevent/_imap.py":214 + * return value + * + * def _iqueue_value_for_success(self, greenlet): # <<<<<<<<<<<<<< + * return (greenlet._imap_task_index, IMapUnordered._iqueue_value_for_success(self, greenlet)) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("gevent.__imap.IMap._iqueue_value_for_success", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_imap.py":217 + * return (greenlet._imap_task_index, IMapUnordered._iqueue_value_for_success(self, greenlet)) + * + * def _iqueue_value_for_failure(self, greenlet): # <<<<<<<<<<<<<< + * return (greenlet._imap_task_index, IMapUnordered._iqueue_value_for_failure(self, greenlet)) + * + */ + +static PyObject *__pyx_f_6gevent_6__imap_4IMap__iqueue_value_for_failure(struct __pyx_obj_6gevent_6__imap_IMap *__pyx_v_self, PyObject *__pyx_v_greenlet) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("_iqueue_value_for_failure", 0); + + /* "src/gevent/_imap.py":218 + * + * def _iqueue_value_for_failure(self, greenlet): + * return (greenlet._imap_task_index, IMapUnordered._iqueue_value_for_failure(self, greenlet)) # <<<<<<<<<<<<<< + * + * def _iqueue_value_for_self_finished(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_greenlet, __pyx_n_s_imap_task_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 218, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __pyx_f_6gevent_6__imap_13IMapUnordered__iqueue_value_for_failure(((struct __pyx_obj_6gevent_6__imap_IMapUnordered *)__pyx_v_self), __pyx_v_greenlet); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 218, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 218, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); + __pyx_t_1 = 0; + __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "src/gevent/_imap.py":217 + * return (greenlet._imap_task_index, IMapUnordered._iqueue_value_for_success(self, greenlet)) + * + * def _iqueue_value_for_failure(self, greenlet): # <<<<<<<<<<<<<< + * return (greenlet._imap_task_index, IMapUnordered._iqueue_value_for_failure(self, greenlet)) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("gevent.__imap.IMap._iqueue_value_for_failure", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_imap.py":220 + * return (greenlet._imap_task_index, IMapUnordered._iqueue_value_for_failure(self, greenlet)) + * + * def _iqueue_value_for_self_finished(self): # <<<<<<<<<<<<<< + * return (self._max_index + 1, IMapUnordered._iqueue_value_for_self_finished(self)) + * + */ + +static PyObject *__pyx_f_6gevent_6__imap_4IMap__iqueue_value_for_self_finished(struct __pyx_obj_6gevent_6__imap_IMap *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("_iqueue_value_for_self_finished", 0); + + /* "src/gevent/_imap.py":221 + * + * def _iqueue_value_for_self_finished(self): + * return (self._max_index + 1, IMapUnordered._iqueue_value_for_self_finished(self)) # <<<<<<<<<<<<<< + * + * def _iqueue_value_for_self_failure(self, exception): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_long((__pyx_v_self->__pyx_base._max_index + 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 221, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __pyx_f_6gevent_6__imap_13IMapUnordered__iqueue_value_for_self_finished(((struct __pyx_obj_6gevent_6__imap_IMapUnordered *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 221, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 221, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); + __pyx_t_1 = 0; + __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "src/gevent/_imap.py":220 + * return (greenlet._imap_task_index, IMapUnordered._iqueue_value_for_failure(self, greenlet)) + * + * def _iqueue_value_for_self_finished(self): # <<<<<<<<<<<<<< + * return (self._max_index + 1, IMapUnordered._iqueue_value_for_self_finished(self)) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("gevent.__imap.IMap._iqueue_value_for_self_finished", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_imap.py":223 + * return (self._max_index + 1, IMapUnordered._iqueue_value_for_self_finished(self)) + * + * def _iqueue_value_for_self_failure(self, exception): # <<<<<<<<<<<<<< + * return (self._max_index + 1, IMapUnordered._iqueue_value_for_self_failure(self, exception)) + * + */ + +static PyObject *__pyx_f_6gevent_6__imap_4IMap__iqueue_value_for_self_failure(struct __pyx_obj_6gevent_6__imap_IMap *__pyx_v_self, PyObject *__pyx_v_exception) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("_iqueue_value_for_self_failure", 0); + + /* "src/gevent/_imap.py":224 + * + * def _iqueue_value_for_self_failure(self, exception): + * return (self._max_index + 1, IMapUnordered._iqueue_value_for_self_failure(self, exception)) # <<<<<<<<<<<<<< + * + * from gevent._util import import_c_accel + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_long((__pyx_v_self->__pyx_base._max_index + 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 224, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __pyx_f_6gevent_6__imap_13IMapUnordered__iqueue_value_for_self_failure(((struct __pyx_obj_6gevent_6__imap_IMapUnordered *)__pyx_v_self), __pyx_v_exception); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 224, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 224, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); + __pyx_t_1 = 0; + __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "src/gevent/_imap.py":223 + * return (self._max_index + 1, IMapUnordered._iqueue_value_for_self_finished(self)) + * + * def _iqueue_value_for_self_failure(self, exception): # <<<<<<<<<<<<<< + * return (self._max_index + 1, IMapUnordered._iqueue_value_for_self_failure(self, exception)) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("gevent.__imap.IMap._iqueue_value_for_self_failure", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/__greenlet_primitives.pxd":23 + * + * @cython.final + * cdef inline greenlet getcurrent(): # <<<<<<<<<<<<<< + * return PyGreenlet_GetCurrent() + * + */ + +static CYTHON_INLINE PyGreenlet *__pyx_f_6gevent_21__greenlet_primitives_getcurrent(void) { + PyGreenlet *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("getcurrent", 0); + + /* "gevent/__greenlet_primitives.pxd":24 + * @cython.final + * cdef inline greenlet getcurrent(): + * return PyGreenlet_GetCurrent() # <<<<<<<<<<<<<< + * + * cdef bint _greenlet_imported + */ + __Pyx_XDECREF(((PyObject *)__pyx_r)); + __pyx_t_1 = ((PyObject *)PyGreenlet_GetCurrent()); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 24, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = ((PyGreenlet *)__pyx_t_1); + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "gevent/__greenlet_primitives.pxd":23 + * + * @cython.final + * cdef inline greenlet getcurrent(): # <<<<<<<<<<<<<< + * return PyGreenlet_GetCurrent() + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__greenlet_primitives.getcurrent", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF((PyObject *)__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/__greenlet_primitives.pxd":28 + * cdef bint _greenlet_imported + * + * cdef inline void greenlet_init(): # <<<<<<<<<<<<<< + * global _greenlet_imported + * if not _greenlet_imported: + */ + +static CYTHON_INLINE void __pyx_f_6gevent_21__greenlet_primitives_greenlet_init(void) { + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("greenlet_init", 0); + + /* "gevent/__greenlet_primitives.pxd":30 + * cdef inline void greenlet_init(): + * global _greenlet_imported + * if not _greenlet_imported: # <<<<<<<<<<<<<< + * PyGreenlet_Import() + * _greenlet_imported = True + */ + __pyx_t_1 = ((!(__pyx_v_6gevent_21__greenlet_primitives__greenlet_imported != 0)) != 0); + if (__pyx_t_1) { + + /* "gevent/__greenlet_primitives.pxd":31 + * global _greenlet_imported + * if not _greenlet_imported: + * PyGreenlet_Import() # <<<<<<<<<<<<<< + * _greenlet_imported = True + * + */ + PyGreenlet_Import(); + + /* "gevent/__greenlet_primitives.pxd":32 + * if not _greenlet_imported: + * PyGreenlet_Import() + * _greenlet_imported = True # <<<<<<<<<<<<<< + * + * cdef inline object _greenlet_switch(greenlet self): + */ + __pyx_v_6gevent_21__greenlet_primitives__greenlet_imported = 1; + + /* "gevent/__greenlet_primitives.pxd":30 + * cdef inline void greenlet_init(): + * global _greenlet_imported + * if not _greenlet_imported: # <<<<<<<<<<<<<< + * PyGreenlet_Import() + * _greenlet_imported = True + */ + } + + /* "gevent/__greenlet_primitives.pxd":28 + * cdef bint _greenlet_imported + * + * cdef inline void greenlet_init(): # <<<<<<<<<<<<<< + * global _greenlet_imported + * if not _greenlet_imported: + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "gevent/__greenlet_primitives.pxd":34 + * _greenlet_imported = True + * + * cdef inline object _greenlet_switch(greenlet self): # <<<<<<<<<<<<<< + * return PyGreenlet_Switch(self, NULL, NULL) + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_6gevent_21__greenlet_primitives__greenlet_switch(PyGreenlet *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("_greenlet_switch", 0); + + /* "gevent/__greenlet_primitives.pxd":35 + * + * cdef inline object _greenlet_switch(greenlet self): + * return PyGreenlet_Switch(self, NULL, NULL) # <<<<<<<<<<<<<< + * + * cdef class TrackedRawGreenlet(greenlet): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyGreenlet_Switch(__pyx_v_self, NULL, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 35, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "gevent/__greenlet_primitives.pxd":34 + * _greenlet_imported = True + * + * cdef inline object _greenlet_switch(greenlet self): # <<<<<<<<<<<<<< + * return PyGreenlet_Switch(self, NULL, NULL) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__greenlet_primitives._greenlet_switch", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/__waiter.pxd":24 + * void PyGreenlet_Import() + * + * cdef inline greenlet getcurrent(): # <<<<<<<<<<<<<< + * return PyGreenlet_GetCurrent() + * + */ + +static CYTHON_INLINE PyGreenlet *__pyx_f_6gevent_8__waiter_getcurrent(void) { + PyGreenlet *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("getcurrent", 0); + + /* "gevent/__waiter.pxd":25 + * + * cdef inline greenlet getcurrent(): + * return PyGreenlet_GetCurrent() # <<<<<<<<<<<<<< + * + * cdef inline void greenlet_init(): + */ + __Pyx_XDECREF(((PyObject *)__pyx_r)); + __pyx_t_1 = ((PyObject *)PyGreenlet_GetCurrent()); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 25, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = ((PyGreenlet *)__pyx_t_1); + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "gevent/__waiter.pxd":24 + * void PyGreenlet_Import() + * + * cdef inline greenlet getcurrent(): # <<<<<<<<<<<<<< + * return PyGreenlet_GetCurrent() + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__waiter.getcurrent", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF((PyObject *)__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/__waiter.pxd":27 + * return PyGreenlet_GetCurrent() + * + * cdef inline void greenlet_init(): # <<<<<<<<<<<<<< + * global _greenlet_imported + * if not _greenlet_imported: + */ + +static CYTHON_INLINE void __pyx_f_6gevent_8__waiter_greenlet_init(void) { + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("greenlet_init", 0); + + /* "gevent/__waiter.pxd":29 + * cdef inline void greenlet_init(): + * global _greenlet_imported + * if not _greenlet_imported: # <<<<<<<<<<<<<< + * PyGreenlet_Import() + * _greenlet_imported = True + */ + __pyx_t_1 = ((!(__pyx_v_6gevent_8__waiter__greenlet_imported != 0)) != 0); + if (__pyx_t_1) { + + /* "gevent/__waiter.pxd":30 + * global _greenlet_imported + * if not _greenlet_imported: + * PyGreenlet_Import() # <<<<<<<<<<<<<< + * _greenlet_imported = True + * + */ + PyGreenlet_Import(); + + /* "gevent/__waiter.pxd":31 + * if not _greenlet_imported: + * PyGreenlet_Import() + * _greenlet_imported = True # <<<<<<<<<<<<<< + * + * cdef class Waiter: + */ + __pyx_v_6gevent_8__waiter__greenlet_imported = 1; + + /* "gevent/__waiter.pxd":29 + * cdef inline void greenlet_init(): + * global _greenlet_imported + * if not _greenlet_imported: # <<<<<<<<<<<<<< + * PyGreenlet_Import() + * _greenlet_imported = True + */ + } + + /* "gevent/__waiter.pxd":27 + * return PyGreenlet_GetCurrent() + * + * cdef inline void greenlet_init(): # <<<<<<<<<<<<<< + * global _greenlet_imported + * if not _greenlet_imported: + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "gevent/_greenlet.pxd":27 + * + * @cython.final + * cdef inline greenlet getcurrent(): # <<<<<<<<<<<<<< + * return PyGreenlet_GetCurrent() + * + */ + +static CYTHON_INLINE PyGreenlet *__pyx_f_6gevent_9_greenlet_getcurrent(void) { + PyGreenlet *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("getcurrent", 0); + + /* "gevent/_greenlet.pxd":28 + * @cython.final + * cdef inline greenlet getcurrent(): + * return PyGreenlet_GetCurrent() # <<<<<<<<<<<<<< + * + * cdef bint _greenlet_imported + */ + __Pyx_XDECREF(((PyObject *)__pyx_r)); + __pyx_t_1 = ((PyObject *)PyGreenlet_GetCurrent()); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 28, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = ((PyGreenlet *)__pyx_t_1); + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "gevent/_greenlet.pxd":27 + * + * @cython.final + * cdef inline greenlet getcurrent(): # <<<<<<<<<<<<<< + * return PyGreenlet_GetCurrent() + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent._greenlet.getcurrent", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF((PyObject *)__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/_greenlet.pxd":32 + * cdef bint _greenlet_imported + * + * cdef inline void greenlet_init(): # <<<<<<<<<<<<<< + * global _greenlet_imported + * if not _greenlet_imported: + */ + +static CYTHON_INLINE void __pyx_f_6gevent_9_greenlet_greenlet_init(void) { + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("greenlet_init", 0); + + /* "gevent/_greenlet.pxd":34 + * cdef inline void greenlet_init(): + * global _greenlet_imported + * if not _greenlet_imported: # <<<<<<<<<<<<<< + * PyGreenlet_Import() + * _greenlet_imported = True + */ + __pyx_t_1 = ((!(__pyx_v_6gevent_9_greenlet__greenlet_imported != 0)) != 0); + if (__pyx_t_1) { + + /* "gevent/_greenlet.pxd":35 + * global _greenlet_imported + * if not _greenlet_imported: + * PyGreenlet_Import() # <<<<<<<<<<<<<< + * _greenlet_imported = True + * + */ + PyGreenlet_Import(); + + /* "gevent/_greenlet.pxd":36 + * if not _greenlet_imported: + * PyGreenlet_Import() + * _greenlet_imported = True # <<<<<<<<<<<<<< + * + * cdef extern from "Python.h": + */ + __pyx_v_6gevent_9_greenlet__greenlet_imported = 1; + + /* "gevent/_greenlet.pxd":34 + * cdef inline void greenlet_init(): + * global _greenlet_imported + * if not _greenlet_imported: # <<<<<<<<<<<<<< + * PyGreenlet_Import() + * _greenlet_imported = True + */ + } + + /* "gevent/_greenlet.pxd":32 + * cdef bint _greenlet_imported + * + * cdef inline void greenlet_init(): # <<<<<<<<<<<<<< + * global _greenlet_imported + * if not _greenlet_imported: + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "gevent/__abstract_linkable.pxd":21 + * void PyGreenlet_Import() + * + * cdef inline greenlet getcurrent(): # <<<<<<<<<<<<<< + * return PyGreenlet_GetCurrent() + * + */ + +static CYTHON_INLINE PyGreenlet *__pyx_f_6gevent_19__abstract_linkable_getcurrent(void) { + PyGreenlet *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("getcurrent", 0); + + /* "gevent/__abstract_linkable.pxd":22 + * + * cdef inline greenlet getcurrent(): + * return PyGreenlet_GetCurrent() # <<<<<<<<<<<<<< + * + * cdef inline void greenlet_init(): + */ + __Pyx_XDECREF(((PyObject *)__pyx_r)); + __pyx_t_1 = ((PyObject *)PyGreenlet_GetCurrent()); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 22, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = ((PyGreenlet *)__pyx_t_1); + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "gevent/__abstract_linkable.pxd":21 + * void PyGreenlet_Import() + * + * cdef inline greenlet getcurrent(): # <<<<<<<<<<<<<< + * return PyGreenlet_GetCurrent() + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__abstract_linkable.getcurrent", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF((PyObject *)__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/__abstract_linkable.pxd":24 + * return PyGreenlet_GetCurrent() + * + * cdef inline void greenlet_init(): # <<<<<<<<<<<<<< + * global _greenlet_imported + * if not _greenlet_imported: + */ + +static CYTHON_INLINE void __pyx_f_6gevent_19__abstract_linkable_greenlet_init(void) { + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("greenlet_init", 0); + + /* "gevent/__abstract_linkable.pxd":26 + * cdef inline void greenlet_init(): + * global _greenlet_imported + * if not _greenlet_imported: # <<<<<<<<<<<<<< + * PyGreenlet_Import() + * _greenlet_imported = True + */ + __pyx_t_1 = ((!(__pyx_v_6gevent_19__abstract_linkable__greenlet_imported != 0)) != 0); + if (__pyx_t_1) { + + /* "gevent/__abstract_linkable.pxd":27 + * global _greenlet_imported + * if not _greenlet_imported: + * PyGreenlet_Import() # <<<<<<<<<<<<<< + * _greenlet_imported = True + * + */ + PyGreenlet_Import(); + + /* "gevent/__abstract_linkable.pxd":28 + * if not _greenlet_imported: + * PyGreenlet_Import() + * _greenlet_imported = True # <<<<<<<<<<<<<< + * + * cdef void _init() + */ + __pyx_v_6gevent_19__abstract_linkable__greenlet_imported = 1; + + /* "gevent/__abstract_linkable.pxd":26 + * cdef inline void greenlet_init(): + * global _greenlet_imported + * if not _greenlet_imported: # <<<<<<<<<<<<<< + * PyGreenlet_Import() + * _greenlet_imported = True + */ + } + + /* "gevent/__abstract_linkable.pxd":24 + * return PyGreenlet_GetCurrent() + * + * cdef inline void greenlet_init(): # <<<<<<<<<<<<<< + * global _greenlet_imported + * if not _greenlet_imported: + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +static PyObject *__pyx_tp_new_6gevent_6__imap_Failure(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + struct __pyx_obj_6gevent_6__imap_Failure *p; + PyObject *o; + o = (*t->tp_alloc)(t, 0); + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_6gevent_6__imap_Failure *)o); + p->exc = Py_None; Py_INCREF(Py_None); + p->raise_exception = Py_None; Py_INCREF(Py_None); + return o; +} + +static void __pyx_tp_dealloc_6gevent_6__imap_Failure(PyObject *o) { + struct __pyx_obj_6gevent_6__imap_Failure *p = (struct __pyx_obj_6gevent_6__imap_Failure *)o; + PyObject_GC_UnTrack(o); + Py_CLEAR(p->exc); + Py_CLEAR(p->raise_exception); + (*Py_TYPE(o)->tp_free)(o); +} + +static int __pyx_tp_traverse_6gevent_6__imap_Failure(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_6gevent_6__imap_Failure *p = (struct __pyx_obj_6gevent_6__imap_Failure *)o; + if (p->exc) { + e = (*v)(p->exc, a); if (e) return e; + } + if (p->raise_exception) { + e = (*v)(p->raise_exception, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_6gevent_6__imap_Failure(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_6gevent_6__imap_Failure *p = (struct __pyx_obj_6gevent_6__imap_Failure *)o; + tmp = ((PyObject*)p->exc); + p->exc = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->raise_exception); + p->raise_exception = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyObject *__pyx_getprop_6gevent_6__imap_7Failure_exc(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_6__imap_7Failure_3exc_1__get__(o); +} + +static PyMethodDef __pyx_methods_6gevent_6__imap_Failure[] = { + {0, 0, 0, 0} +}; + +static struct PyGetSetDef __pyx_getsets_6gevent_6__imap_Failure[] = { + {(char *)"exc", __pyx_getprop_6gevent_6__imap_7Failure_exc, 0, (char *)0, 0}, + {0, 0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_6gevent_6__imap_Failure = { + PyVarObject_HEAD_INIT(0, 0) + "gevent.__imap.Failure", /*tp_name*/ + sizeof(struct __pyx_obj_6gevent_6__imap_Failure), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6gevent_6__imap_Failure, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + "Failure(exc, raise_exception=None)", /*tp_doc*/ + __pyx_tp_traverse_6gevent_6__imap_Failure, /*tp_traverse*/ + __pyx_tp_clear_6gevent_6__imap_Failure, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6gevent_6__imap_Failure, /*tp_methods*/ + 0, /*tp_members*/ + __pyx_getsets_6gevent_6__imap_Failure, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_pw_6gevent_6__imap_7Failure_1__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6gevent_6__imap_Failure, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; +static struct __pyx_vtabstruct_6gevent_6__imap_IMapUnordered __pyx_vtable_6gevent_6__imap_IMapUnordered; + +static PyObject *__pyx_tp_new_6gevent_6__imap_IMapUnordered(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_6gevent_6__imap_IMapUnordered *p; + PyObject *o = __pyx_ptype_6gevent_9_greenlet_Greenlet->tp_new(t, a, k); + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_6gevent_6__imap_IMapUnordered *)o); + p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_6gevent_9_greenlet_Greenlet*)__pyx_vtabptr_6gevent_6__imap_IMapUnordered; + p->func = Py_None; Py_INCREF(Py_None); + p->iterable = Py_None; Py_INCREF(Py_None); + p->spawn = Py_None; Py_INCREF(Py_None); + p->_result_semaphore = ((struct __pyx_obj_6gevent_11__semaphore_Semaphore *)Py_None); Py_INCREF(Py_None); + p->queue = ((struct __pyx_obj_6gevent_6_queue_UnboundQueue *)Py_None); Py_INCREF(Py_None); + return o; +} + +static void __pyx_tp_dealloc_6gevent_6__imap_IMapUnordered(PyObject *o) { + struct __pyx_obj_6gevent_6__imap_IMapUnordered *p = (struct __pyx_obj_6gevent_6__imap_IMapUnordered *)o; + #if CYTHON_USE_TP_FINALIZE + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + PyObject_GC_UnTrack(o); + Py_CLEAR(p->func); + Py_CLEAR(p->iterable); + Py_CLEAR(p->spawn); + Py_CLEAR(p->_result_semaphore); + Py_CLEAR(p->queue); + PyObject_GC_Track(o); + if (likely(__pyx_ptype_6gevent_9_greenlet_Greenlet)) __pyx_ptype_6gevent_9_greenlet_Greenlet->tp_dealloc(o); else __Pyx_call_next_tp_dealloc(o, __pyx_tp_dealloc_6gevent_6__imap_IMapUnordered); +} + +static int __pyx_tp_traverse_6gevent_6__imap_IMapUnordered(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_6gevent_6__imap_IMapUnordered *p = (struct __pyx_obj_6gevent_6__imap_IMapUnordered *)o; + e = ((likely(__pyx_ptype_6gevent_9_greenlet_Greenlet)) ? ((__pyx_ptype_6gevent_9_greenlet_Greenlet->tp_traverse) ? __pyx_ptype_6gevent_9_greenlet_Greenlet->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_6gevent_6__imap_IMapUnordered)); if (e) return e; + if (p->func) { + e = (*v)(p->func, a); if (e) return e; + } + if (p->iterable) { + e = (*v)(p->iterable, a); if (e) return e; + } + if (p->spawn) { + e = (*v)(p->spawn, a); if (e) return e; + } + if (p->_result_semaphore) { + e = (*v)(((PyObject *)p->_result_semaphore), a); if (e) return e; + } + if (p->queue) { + e = (*v)(((PyObject *)p->queue), a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_6gevent_6__imap_IMapUnordered(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_6gevent_6__imap_IMapUnordered *p = (struct __pyx_obj_6gevent_6__imap_IMapUnordered *)o; + if (likely(__pyx_ptype_6gevent_9_greenlet_Greenlet)) { if (__pyx_ptype_6gevent_9_greenlet_Greenlet->tp_clear) __pyx_ptype_6gevent_9_greenlet_Greenlet->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_6gevent_6__imap_IMapUnordered); + tmp = ((PyObject*)p->func); + p->func = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->iterable); + p->iterable = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->spawn); + p->spawn = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->_result_semaphore); + p->_result_semaphore = ((struct __pyx_obj_6gevent_11__semaphore_Semaphore *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->queue); + p->queue = ((struct __pyx_obj_6gevent_6_queue_UnboundQueue *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyObject *__pyx_getprop_6gevent_6__imap_13IMapUnordered_queue(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_6__imap_13IMapUnordered_5queue_1__get__(o); +} + +static PyObject *__pyx_getprop_6gevent_6__imap_13IMapUnordered_finished(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_6__imap_13IMapUnordered_8finished_1__get__(o); +} + +static PyObject *__pyx_specialmethod___pyx_pw_6gevent_6__imap_13IMapUnordered_5__next__(PyObject *self, CYTHON_UNUSED PyObject *arg) {return __pyx_pw_6gevent_6__imap_13IMapUnordered_5__next__(self);} + +static PyMethodDef __pyx_methods_6gevent_6__imap_IMapUnordered[] = { + {"__next__", (PyCFunction)__pyx_specialmethod___pyx_pw_6gevent_6__imap_13IMapUnordered_5__next__, METH_NOARGS|METH_COEXIST, 0}, + {"_run", (PyCFunction)__pyx_pw_6gevent_6__imap_13IMapUnordered_7_run, METH_NOARGS, __pyx_doc_6gevent_6__imap_13IMapUnordered_6_run}, + {0, 0, 0, 0} +}; + +static struct PyGetSetDef __pyx_getsets_6gevent_6__imap_IMapUnordered[] = { + {(char *)"queue", __pyx_getprop_6gevent_6__imap_13IMapUnordered_queue, 0, (char *)0, 0}, + {(char *)"finished", __pyx_getprop_6gevent_6__imap_13IMapUnordered_finished, 0, (char *)0, 0}, + {0, 0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_6gevent_6__imap_IMapUnordered = { + PyVarObject_HEAD_INIT(0, 0) + "gevent.__imap.IMapUnordered", /*tp_name*/ + sizeof(struct __pyx_obj_6gevent_6__imap_IMapUnordered), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6gevent_6__imap_IMapUnordered, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + "IMapUnordered(func, iterable, spawn, maxsize=None, _zipped=False)\n\n At iterator of map results.\n ", /*tp_doc*/ + __pyx_tp_traverse_6gevent_6__imap_IMapUnordered, /*tp_traverse*/ + __pyx_tp_clear_6gevent_6__imap_IMapUnordered, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + __pyx_pw_6gevent_6__imap_13IMapUnordered_3__iter__, /*tp_iter*/ + __pyx_pw_6gevent_6__imap_13IMapUnordered_5__next__, /*tp_iternext*/ + __pyx_methods_6gevent_6__imap_IMapUnordered, /*tp_methods*/ + 0, /*tp_members*/ + __pyx_getsets_6gevent_6__imap_IMapUnordered, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_pw_6gevent_6__imap_13IMapUnordered_1__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6gevent_6__imap_IMapUnordered, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; +static struct __pyx_vtabstruct_6gevent_6__imap_IMap __pyx_vtable_6gevent_6__imap_IMap; + +static PyObject *__pyx_tp_new_6gevent_6__imap_IMap(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_6gevent_6__imap_IMap *p; + PyObject *o = __pyx_tp_new_6gevent_6__imap_IMapUnordered(t, a, k); + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_6gevent_6__imap_IMap *)o); + p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_6gevent_9_greenlet_Greenlet*)__pyx_vtabptr_6gevent_6__imap_IMap; + p->_results = ((PyObject*)Py_None); Py_INCREF(Py_None); + return o; +} + +static void __pyx_tp_dealloc_6gevent_6__imap_IMap(PyObject *o) { + struct __pyx_obj_6gevent_6__imap_IMap *p = (struct __pyx_obj_6gevent_6__imap_IMap *)o; + #if CYTHON_USE_TP_FINALIZE + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + PyObject_GC_UnTrack(o); + Py_CLEAR(p->_results); + PyObject_GC_Track(o); + __pyx_tp_dealloc_6gevent_6__imap_IMapUnordered(o); +} + +static int __pyx_tp_traverse_6gevent_6__imap_IMap(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_6gevent_6__imap_IMap *p = (struct __pyx_obj_6gevent_6__imap_IMap *)o; + e = __pyx_tp_traverse_6gevent_6__imap_IMapUnordered(o, v, a); if (e) return e; + if (p->_results) { + e = (*v)(p->_results, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_6gevent_6__imap_IMap(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_6gevent_6__imap_IMap *p = (struct __pyx_obj_6gevent_6__imap_IMap *)o; + __pyx_tp_clear_6gevent_6__imap_IMapUnordered(o); + tmp = ((PyObject*)p->_results); + p->_results = ((PyObject*)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyMethodDef __pyx_methods_6gevent_6__imap_IMap[] = { + {0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_6gevent_6__imap_IMap = { + PyVarObject_HEAD_INIT(0, 0) + "gevent.__imap.IMap", /*tp_name*/ + sizeof(struct __pyx_obj_6gevent_6__imap_IMap), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6gevent_6__imap_IMap, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + "IMap(*args, **kwargs)", /*tp_doc*/ + __pyx_tp_traverse_6gevent_6__imap_IMap, /*tp_traverse*/ + __pyx_tp_clear_6gevent_6__imap_IMap, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_6gevent_6__imap_13IMapUnordered_3__iter__, /*tp_iter*/ + #else + 0, /*tp_iter*/ + #endif + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_6gevent_6__imap_13IMapUnordered_5__next__, /*tp_iternext*/ + #else + 0, /*tp_iternext*/ + #endif + __pyx_methods_6gevent_6__imap_IMap, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_pw_6gevent_6__imap_4IMap_1__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6gevent_6__imap_IMap, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static PyMethodDef __pyx_methods[] = { + {0, 0, 0, 0} +}; + +#if PY_MAJOR_VERSION >= 3 +#if CYTHON_PEP489_MULTI_PHASE_INIT +static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ +static int __pyx_pymod_exec___imap(PyObject* module); /*proto*/ +static PyModuleDef_Slot __pyx_moduledef_slots[] = { + {Py_mod_create, (void*)__pyx_pymod_create}, + {Py_mod_exec, (void*)__pyx_pymod_exec___imap}, + {0, NULL} +}; +#endif + +static struct PyModuleDef __pyx_moduledef = { + PyModuleDef_HEAD_INIT, + "__imap", + __pyx_k_Iterators_across_greenlets_or_A, /* m_doc */ + #if CYTHON_PEP489_MULTI_PHASE_INIT + 0, /* m_size */ + #else + -1, /* m_size */ + #endif + __pyx_methods /* m_methods */, + #if CYTHON_PEP489_MULTI_PHASE_INIT + __pyx_moduledef_slots, /* m_slots */ + #else + NULL, /* m_reload */ + #endif + NULL, /* m_traverse */ + NULL, /* m_clear */ + NULL /* m_free */ +}; +#endif +#ifndef CYTHON_SMALL_CODE +#if defined(__clang__) + #define CYTHON_SMALL_CODE +#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) + #define CYTHON_SMALL_CODE __attribute__((cold)) +#else + #define CYTHON_SMALL_CODE +#endif +#endif + +static __Pyx_StringTabEntry __pyx_string_tab[] = { + {&__pyx_n_s_BaseException, __pyx_k_BaseException, sizeof(__pyx_k_BaseException), 0, 0, 1, 1}, + {&__pyx_n_s_Failure, __pyx_k_Failure, sizeof(__pyx_k_Failure), 0, 0, 1, 1}, + {&__pyx_n_s_Greenlet, __pyx_k_Greenlet, sizeof(__pyx_k_Greenlet), 0, 0, 1, 1}, + {&__pyx_n_s_IMap, __pyx_k_IMap, sizeof(__pyx_k_IMap), 0, 0, 1, 1}, + {&__pyx_n_s_IMapUnordered, __pyx_k_IMapUnordered, sizeof(__pyx_k_IMapUnordered), 0, 0, 1, 1}, + {&__pyx_n_s_IMapUnordered__on_result, __pyx_k_IMapUnordered__on_result, sizeof(__pyx_k_IMapUnordered__on_result), 0, 0, 1, 1}, + {&__pyx_n_s_IMapUnordered__run, __pyx_k_IMapUnordered__run, sizeof(__pyx_k_IMapUnordered__run), 0, 0, 1, 1}, + {&__pyx_n_s_KeyError, __pyx_k_KeyError, sizeof(__pyx_k_KeyError), 0, 0, 1, 1}, + {&__pyx_n_s_Semaphore, __pyx_k_Semaphore, sizeof(__pyx_k_Semaphore), 0, 0, 1, 1}, + {&__pyx_n_s_StopIteration, __pyx_k_StopIteration, sizeof(__pyx_k_StopIteration), 0, 0, 1, 1}, + {&__pyx_n_s_UnboundQueue, __pyx_k_UnboundQueue, sizeof(__pyx_k_UnboundQueue), 0, 0, 1, 1}, + {&__pyx_n_s_all, __pyx_k_all, sizeof(__pyx_k_all), 0, 0, 1, 1}, + {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, + {&__pyx_n_s_e, __pyx_k_e, sizeof(__pyx_k_e), 0, 0, 1, 1}, + {&__pyx_n_s_exc, __pyx_k_exc, sizeof(__pyx_k_exc), 0, 0, 1, 1}, + {&__pyx_n_s_exception, __pyx_k_exception, sizeof(__pyx_k_exception), 0, 0, 1, 1}, + {&__pyx_n_s_func, __pyx_k_func, sizeof(__pyx_k_func), 0, 0, 1, 1}, + {&__pyx_n_s_gevent, __pyx_k_gevent, sizeof(__pyx_k_gevent), 0, 0, 1, 1}, + {&__pyx_n_s_gevent___imap, __pyx_k_gevent___imap, sizeof(__pyx_k_gevent___imap), 0, 0, 1, 1}, + {&__pyx_n_s_gevent__util, __pyx_k_gevent__util, sizeof(__pyx_k_gevent__util), 0, 0, 1, 1}, + {&__pyx_n_s_greenlet, __pyx_k_greenlet, sizeof(__pyx_k_greenlet), 0, 0, 1, 1}, + {&__pyx_n_s_imap_task_index, __pyx_k_imap_task_index, sizeof(__pyx_k_imap_task_index), 0, 0, 1, 1}, + {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, + {&__pyx_n_s_import_c_accel, __pyx_k_import_c_accel, sizeof(__pyx_k_import_c_accel), 0, 0, 1, 1}, + {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1}, + {&__pyx_n_s_item, __pyx_k_item, sizeof(__pyx_k_item), 0, 0, 1, 1}, + {&__pyx_n_s_iterable, __pyx_k_iterable, sizeof(__pyx_k_iterable), 0, 0, 1, 1}, + {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, + {&__pyx_n_s_maxsize, __pyx_k_maxsize, sizeof(__pyx_k_maxsize), 0, 0, 1, 1}, + {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, + {&__pyx_n_s_next, __pyx_k_next, sizeof(__pyx_k_next), 0, 0, 1, 1}, + {&__pyx_n_s_next_2, __pyx_k_next_2, sizeof(__pyx_k_next_2), 0, 0, 1, 1}, + {&__pyx_n_s_on_result, __pyx_k_on_result, sizeof(__pyx_k_on_result), 0, 0, 1, 1}, + {&__pyx_n_s_pop, __pyx_k_pop, sizeof(__pyx_k_pop), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1}, + {&__pyx_n_s_queue, __pyx_k_queue, sizeof(__pyx_k_queue), 0, 0, 1, 1}, + {&__pyx_n_s_raise_exception, __pyx_k_raise_exception, sizeof(__pyx_k_raise_exception), 0, 0, 1, 1}, + {&__pyx_n_s_raise_exception_2, __pyx_k_raise_exception_2, sizeof(__pyx_k_raise_exception_2), 0, 0, 1, 1}, + {&__pyx_n_s_rawlink, __pyx_k_rawlink, sizeof(__pyx_k_rawlink), 0, 0, 1, 1}, + {&__pyx_n_s_run, __pyx_k_run, sizeof(__pyx_k_run), 0, 0, 1, 1}, + {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1}, + {&__pyx_n_s_semaphore, __pyx_k_semaphore, sizeof(__pyx_k_semaphore), 0, 0, 1, 1}, + {&__pyx_n_s_slots, __pyx_k_slots, sizeof(__pyx_k_slots), 0, 0, 1, 1}, + {&__pyx_n_s_spawn, __pyx_k_spawn, sizeof(__pyx_k_spawn), 0, 0, 1, 1}, + {&__pyx_kp_s_src_gevent__imap_py, __pyx_k_src_gevent__imap_py, sizeof(__pyx_k_src_gevent__imap_py), 0, 0, 1, 0}, + {&__pyx_n_s_successful, __pyx_k_successful, sizeof(__pyx_k_successful), 0, 0, 1, 1}, + {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, + {&__pyx_n_s_value, __pyx_k_value, sizeof(__pyx_k_value), 0, 0, 1, 1}, + {&__pyx_n_s_zipped, __pyx_k_zipped, sizeof(__pyx_k_zipped), 0, 0, 1, 1}, + {0, 0, 0, 0, 0, 0, 0} +}; +static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { + __pyx_builtin___import__ = __Pyx_GetBuiltinName(__pyx_n_s_import); if (!__pyx_builtin___import__) __PYX_ERR(0, 23, __pyx_L1_error) + __pyx_builtin_BaseException = __Pyx_GetBuiltinName(__pyx_n_s_BaseException); if (!__pyx_builtin_BaseException) __PYX_ERR(0, 131, __pyx_L1_error) + __pyx_builtin_StopIteration = __Pyx_GetBuiltinName(__pyx_n_s_StopIteration); if (!__pyx_builtin_StopIteration) __PYX_ERR(0, 181, __pyx_L1_error) + __pyx_builtin_KeyError = __Pyx_GetBuiltinName(__pyx_n_s_KeyError); if (!__pyx_builtin_KeyError) __PYX_ERR(0, 203, __pyx_L1_error) + return 0; + __pyx_L1_error:; + return -1; +} + +static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); + + /* "src/gevent/_imap.py":23 + * ] + * + * locals()['Greenlet'] = __import__('gevent').Greenlet # <<<<<<<<<<<<<< + * locals()['Semaphore'] = _semaphore.Semaphore + * locals()['UnboundQueue'] = queue.UnboundQueue + */ + __pyx_tuple_ = PyTuple_Pack(1, __pyx_n_s_gevent); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 23, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple_); + __Pyx_GIVEREF(__pyx_tuple_); + + /* "src/gevent/_imap.py":29 + * + * class Failure(object): + * __slots__ = ('exc', 'raise_exception') # <<<<<<<<<<<<<< + * + * def __init__(self, exc, raise_exception=None): + */ + __pyx_tuple__2 = PyTuple_Pack(2, __pyx_n_s_exc, __pyx_n_s_raise_exception); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 29, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2); + __Pyx_GIVEREF(__pyx_tuple__2); + + /* "src/gevent/_imap.py":124 + * return g + * + * def _run(self): # pylint:disable=method-hidden # <<<<<<<<<<<<<< + * try: + * func = self.func + */ + __pyx_tuple__3 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_func, __pyx_n_s_item, __pyx_n_s_e); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 124, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__3); + __Pyx_GIVEREF(__pyx_tuple__3); + __pyx_codeobj__4 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__3, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__imap_py, __pyx_n_s_run, 124, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__4)) __PYX_ERR(0, 124, __pyx_L1_error) + + /* "src/gevent/_imap.py":140 + * self._result_semaphore = None + * + * def _on_result(self, greenlet): # <<<<<<<<<<<<<< + * # This method will be called in the hub greenlet (we rawlink) + * self._outstanding_tasks -= 1 + */ + __pyx_tuple__5 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_greenlet); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 140, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__5); + __Pyx_GIVEREF(__pyx_tuple__5); + __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__5, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__imap_py, __pyx_n_s_on_result, 140, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__6)) __PYX_ERR(0, 140, __pyx_L1_error) + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} + +static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { + __pyx_umethod_PyDict_Type_pop.type = (PyObject*)&PyDict_Type; + if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + return 0; + __pyx_L1_error:; + return -1; +} + +static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/ + +static int __Pyx_modinit_global_init_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); + /*--- Global init code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_variable_export_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); + /*--- Variable export code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_function_export_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); + /*--- Function export code ---*/ + if (__Pyx_ExportFunction("_raise_exc", (void (*)(void))__pyx_f_6gevent_6__imap__raise_exc, "PyObject *(struct __pyx_obj_6gevent_6__imap_Failure *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_modinit_type_init_code(void) { + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); + /*--- Type init code ---*/ + if (PyType_Ready(&__pyx_type_6gevent_6__imap_Failure) < 0) __PYX_ERR(0, 28, __pyx_L1_error) + __pyx_type_6gevent_6__imap_Failure.tp_print = 0; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6gevent_6__imap_Failure.tp_dictoffset && __pyx_type_6gevent_6__imap_Failure.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_type_6gevent_6__imap_Failure.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + } + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Failure, (PyObject *)&__pyx_type_6gevent_6__imap_Failure) < 0) __PYX_ERR(0, 28, __pyx_L1_error) + __pyx_ptype_6gevent_6__imap_Failure = &__pyx_type_6gevent_6__imap_Failure; + __pyx_t_1 = PyImport_ImportModule("gevent._greenlet"); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_ptype_6gevent_9_greenlet_Greenlet = __Pyx_ImportType(__pyx_t_1, "gevent._greenlet", "Greenlet", sizeof(struct __pyx_obj_6gevent_9_greenlet_Greenlet), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_9_greenlet_Greenlet) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_vtabptr_6gevent_9_greenlet_Greenlet = (struct __pyx_vtabstruct_6gevent_9_greenlet_Greenlet*)__Pyx_GetVtable(__pyx_ptype_6gevent_9_greenlet_Greenlet->tp_dict); if (unlikely(!__pyx_vtabptr_6gevent_9_greenlet_Greenlet)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_vtabptr_6gevent_6__imap_IMapUnordered = &__pyx_vtable_6gevent_6__imap_IMapUnordered; + __pyx_vtable_6gevent_6__imap_IMapUnordered.__pyx_base = *__pyx_vtabptr_6gevent_9_greenlet_Greenlet; + __pyx_vtable_6gevent_6__imap_IMapUnordered._inext = (PyObject *(*)(struct __pyx_obj_6gevent_6__imap_IMapUnordered *))__pyx_f_6gevent_6__imap_13IMapUnordered__inext; + __pyx_vtable_6gevent_6__imap_IMapUnordered._ispawn = (PyObject *(*)(struct __pyx_obj_6gevent_6__imap_IMapUnordered *, PyObject *, PyObject *, int))__pyx_f_6gevent_6__imap_13IMapUnordered__ispawn; + __pyx_vtable_6gevent_6__imap_IMapUnordered._on_result = (PyObject *(*)(struct __pyx_obj_6gevent_6__imap_IMapUnordered *, PyObject *, int __pyx_skip_dispatch))__pyx_f_6gevent_6__imap_13IMapUnordered__on_result; + __pyx_vtable_6gevent_6__imap_IMapUnordered._on_finish = (PyObject *(*)(struct __pyx_obj_6gevent_6__imap_IMapUnordered *, PyObject *))__pyx_f_6gevent_6__imap_13IMapUnordered__on_finish; + __pyx_vtable_6gevent_6__imap_IMapUnordered._iqueue_value_for_success = (PyObject *(*)(struct __pyx_obj_6gevent_6__imap_IMapUnordered *, PyObject *))__pyx_f_6gevent_6__imap_13IMapUnordered__iqueue_value_for_success; + __pyx_vtable_6gevent_6__imap_IMapUnordered._iqueue_value_for_failure = (PyObject *(*)(struct __pyx_obj_6gevent_6__imap_IMapUnordered *, PyObject *))__pyx_f_6gevent_6__imap_13IMapUnordered__iqueue_value_for_failure; + __pyx_vtable_6gevent_6__imap_IMapUnordered._iqueue_value_for_self_finished = (PyObject *(*)(struct __pyx_obj_6gevent_6__imap_IMapUnordered *))__pyx_f_6gevent_6__imap_13IMapUnordered__iqueue_value_for_self_finished; + __pyx_vtable_6gevent_6__imap_IMapUnordered._iqueue_value_for_self_failure = (PyObject *(*)(struct __pyx_obj_6gevent_6__imap_IMapUnordered *, PyObject *))__pyx_f_6gevent_6__imap_13IMapUnordered__iqueue_value_for_self_failure; + __pyx_type_6gevent_6__imap_IMapUnordered.tp_base = __pyx_ptype_6gevent_9_greenlet_Greenlet; + if (PyType_Ready(&__pyx_type_6gevent_6__imap_IMapUnordered) < 0) __PYX_ERR(0, 43, __pyx_L1_error) + __pyx_type_6gevent_6__imap_IMapUnordered.tp_print = 0; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6gevent_6__imap_IMapUnordered.tp_dictoffset && __pyx_type_6gevent_6__imap_IMapUnordered.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_type_6gevent_6__imap_IMapUnordered.tp_getattro = __Pyx_PyObject_GenericGetAttr; + } + #if CYTHON_COMPILING_IN_CPYTHON + { + PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_6gevent_6__imap_IMapUnordered, "__init__"); if (unlikely(!wrapper)) __PYX_ERR(0, 43, __pyx_L1_error) + if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) { + __pyx_wrapperbase_6gevent_6__imap_13IMapUnordered___init__ = *((PyWrapperDescrObject *)wrapper)->d_base; + __pyx_wrapperbase_6gevent_6__imap_13IMapUnordered___init__.doc = __pyx_doc_6gevent_6__imap_13IMapUnordered___init__; + ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_6gevent_6__imap_13IMapUnordered___init__; + } + } + #endif + if (__Pyx_SetVtable(__pyx_type_6gevent_6__imap_IMapUnordered.tp_dict, __pyx_vtabptr_6gevent_6__imap_IMapUnordered) < 0) __PYX_ERR(0, 43, __pyx_L1_error) + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_IMapUnordered, (PyObject *)&__pyx_type_6gevent_6__imap_IMapUnordered) < 0) __PYX_ERR(0, 43, __pyx_L1_error) + __pyx_ptype_6gevent_6__imap_IMapUnordered = &__pyx_type_6gevent_6__imap_IMapUnordered; + __pyx_vtabptr_6gevent_6__imap_IMap = &__pyx_vtable_6gevent_6__imap_IMap; + __pyx_vtable_6gevent_6__imap_IMap.__pyx_base = *__pyx_vtabptr_6gevent_6__imap_IMapUnordered; + __pyx_vtable_6gevent_6__imap_IMap.__pyx_base._inext = (PyObject *(*)(struct __pyx_obj_6gevent_6__imap_IMapUnordered *))__pyx_f_6gevent_6__imap_4IMap__inext; + __pyx_vtable_6gevent_6__imap_IMap.__pyx_base._iqueue_value_for_success = (PyObject *(*)(struct __pyx_obj_6gevent_6__imap_IMapUnordered *, PyObject *))__pyx_f_6gevent_6__imap_4IMap__iqueue_value_for_success; + __pyx_vtable_6gevent_6__imap_IMap.__pyx_base._iqueue_value_for_failure = (PyObject *(*)(struct __pyx_obj_6gevent_6__imap_IMapUnordered *, PyObject *))__pyx_f_6gevent_6__imap_4IMap__iqueue_value_for_failure; + __pyx_vtable_6gevent_6__imap_IMap.__pyx_base._iqueue_value_for_self_finished = (PyObject *(*)(struct __pyx_obj_6gevent_6__imap_IMapUnordered *))__pyx_f_6gevent_6__imap_4IMap__iqueue_value_for_self_finished; + __pyx_vtable_6gevent_6__imap_IMap.__pyx_base._iqueue_value_for_self_failure = (PyObject *(*)(struct __pyx_obj_6gevent_6__imap_IMapUnordered *, PyObject *))__pyx_f_6gevent_6__imap_4IMap__iqueue_value_for_self_failure; + __pyx_type_6gevent_6__imap_IMap.tp_base = __pyx_ptype_6gevent_6__imap_IMapUnordered; + if (PyType_Ready(&__pyx_type_6gevent_6__imap_IMap) < 0) __PYX_ERR(0, 187, __pyx_L1_error) + __pyx_type_6gevent_6__imap_IMap.tp_print = 0; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6gevent_6__imap_IMap.tp_dictoffset && __pyx_type_6gevent_6__imap_IMap.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_type_6gevent_6__imap_IMap.tp_getattro = __Pyx_PyObject_GenericGetAttr; + } + if (__Pyx_SetVtable(__pyx_type_6gevent_6__imap_IMap.tp_dict, __pyx_vtabptr_6gevent_6__imap_IMap) < 0) __PYX_ERR(0, 187, __pyx_L1_error) + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_IMap, (PyObject *)&__pyx_type_6gevent_6__imap_IMap) < 0) __PYX_ERR(0, 187, __pyx_L1_error) + __pyx_ptype_6gevent_6__imap_IMap = &__pyx_type_6gevent_6__imap_IMap; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_modinit_type_import_code(void) { + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); + /*--- Type import code ---*/ + __pyx_t_1 = PyImport_ImportModule("weakref"); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 5, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_ptype_6gevent_7__ident_ref = __Pyx_ImportType(__pyx_t_1, "weakref", "ref", sizeof(PyWeakReference), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_7__ident_ref) __PYX_ERR(6, 5, __pyx_L1_error) + __pyx_t_2 = PyImport_ImportModule("gevent.__ident"); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 15, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_ptype_6gevent_7__ident_ValuedWeakRef = __Pyx_ImportType(__pyx_t_2, "gevent.__ident", "ValuedWeakRef", sizeof(struct __pyx_obj_6gevent_7__ident_ValuedWeakRef), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_7__ident_ValuedWeakRef) __PYX_ERR(6, 15, __pyx_L1_error) + __pyx_ptype_6gevent_7__ident_IdentRegistry = __Pyx_ImportType(__pyx_t_2, "gevent.__ident", "IdentRegistry", sizeof(struct __pyx_obj_6gevent_7__ident_IdentRegistry), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_7__ident_IdentRegistry) __PYX_ERR(6, 19, __pyx_L1_error) + __pyx_vtabptr_6gevent_7__ident_IdentRegistry = (struct __pyx_vtabstruct_6gevent_7__ident_IdentRegistry*)__Pyx_GetVtable(__pyx_ptype_6gevent_7__ident_IdentRegistry->tp_dict); if (unlikely(!__pyx_vtabptr_6gevent_7__ident_IdentRegistry)) __PYX_ERR(6, 19, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyImport_ImportModule("greenlet"); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_ptype_6gevent_21__greenlet_primitives_greenlet = __Pyx_ImportType(__pyx_t_2, "greenlet", "greenlet", sizeof(PyGreenlet), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_21__greenlet_primitives_greenlet) __PYX_ERR(2, 12, __pyx_L1_error) + __pyx_t_1 = PyImport_ImportModule("gevent.__greenlet_primitives"); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 37, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_ptype_6gevent_21__greenlet_primitives_TrackedRawGreenlet = __Pyx_ImportType(__pyx_t_1, "gevent.__greenlet_primitives", "TrackedRawGreenlet", sizeof(struct __pyx_obj_6gevent_21__greenlet_primitives_TrackedRawGreenlet), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_21__greenlet_primitives_TrackedRawGreenlet) __PYX_ERR(2, 37, __pyx_L1_error) + __pyx_ptype_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop = __Pyx_ImportType(__pyx_t_1, "gevent.__greenlet_primitives", "SwitchOutGreenletWithLoop", sizeof(struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop) __PYX_ERR(2, 40, __pyx_L1_error) + __pyx_vtabptr_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop = (struct __pyx_vtabstruct_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop*)__Pyx_GetVtable(__pyx_ptype_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop->tp_dict); if (unlikely(!__pyx_vtabptr_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop)) __PYX_ERR(2, 40, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyImport_ImportModule("greenlet"); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 15, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_ptype_6gevent_8__waiter_greenlet = __Pyx_ImportType(__pyx_t_1, "greenlet", "greenlet", sizeof(PyGreenlet), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_8__waiter_greenlet) __PYX_ERR(3, 15, __pyx_L1_error) + __pyx_t_2 = PyImport_ImportModule("gevent.__waiter"); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 33, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_ptype_6gevent_8__waiter_Waiter = __Pyx_ImportType(__pyx_t_2, "gevent.__waiter", "Waiter", sizeof(struct __pyx_obj_6gevent_8__waiter_Waiter), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_8__waiter_Waiter) __PYX_ERR(3, 33, __pyx_L1_error) + __pyx_vtabptr_6gevent_8__waiter_Waiter = (struct __pyx_vtabstruct_6gevent_8__waiter_Waiter*)__Pyx_GetVtable(__pyx_ptype_6gevent_8__waiter_Waiter->tp_dict); if (unlikely(!__pyx_vtabptr_6gevent_8__waiter_Waiter)) __PYX_ERR(3, 33, __pyx_L1_error) + __pyx_ptype_6gevent_8__waiter_MultipleWaiter = __Pyx_ImportType(__pyx_t_2, "gevent.__waiter", "MultipleWaiter", sizeof(struct __pyx_obj_6gevent_8__waiter_MultipleWaiter), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_8__waiter_MultipleWaiter) __PYX_ERR(3, 47, __pyx_L1_error) + __pyx_vtabptr_6gevent_8__waiter_MultipleWaiter = (struct __pyx_vtabstruct_6gevent_8__waiter_MultipleWaiter*)__Pyx_GetVtable(__pyx_ptype_6gevent_8__waiter_MultipleWaiter->tp_dict); if (unlikely(!__pyx_vtabptr_6gevent_8__waiter_MultipleWaiter)) __PYX_ERR(3, 47, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyImport_ImportModule("greenlet"); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 17, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_ptype_6gevent_9_greenlet_greenlet = __Pyx_ImportType(__pyx_t_2, "greenlet", "greenlet", sizeof(PyGreenlet), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_9_greenlet_greenlet) __PYX_ERR(4, 17, __pyx_L1_error) + __pyx_t_1 = PyImport_ImportModule("types"); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 40, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_ptype_6gevent_9_greenlet_CodeType = __Pyx_ImportType(__pyx_t_1, "types", "CodeType", sizeof(PyCodeObject), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_9_greenlet_CodeType) __PYX_ERR(4, 40, __pyx_L1_error) + __pyx_ptype_6gevent_9_greenlet_FrameType = __Pyx_ImportType(__pyx_t_1, "types", "FrameType", sizeof(PyFrameObject), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_9_greenlet_FrameType) __PYX_ERR(4, 45, __pyx_L1_error) + __pyx_t_3 = PyImport_ImportModule("gevent._greenlet"); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 56, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_ptype_6gevent_9_greenlet_SpawnedLink = __Pyx_ImportType(__pyx_t_3, "gevent._greenlet", "SpawnedLink", sizeof(struct __pyx_obj_6gevent_9_greenlet_SpawnedLink), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_9_greenlet_SpawnedLink) __PYX_ERR(4, 56, __pyx_L1_error) + __pyx_ptype_6gevent_9_greenlet_SuccessSpawnedLink = __Pyx_ImportType(__pyx_t_3, "gevent._greenlet", "SuccessSpawnedLink", sizeof(struct __pyx_obj_6gevent_9_greenlet_SuccessSpawnedLink), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_9_greenlet_SuccessSpawnedLink) __PYX_ERR(4, 61, __pyx_L1_error) + __pyx_ptype_6gevent_9_greenlet_FailureSpawnedLink = __Pyx_ImportType(__pyx_t_3, "gevent._greenlet", "FailureSpawnedLink", sizeof(struct __pyx_obj_6gevent_9_greenlet_FailureSpawnedLink), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_9_greenlet_FailureSpawnedLink) __PYX_ERR(4, 65, __pyx_L1_error) + __pyx_ptype_6gevent_9_greenlet__Frame = __Pyx_ImportType(__pyx_t_3, "gevent._greenlet", "_Frame", sizeof(struct __pyx_obj_6gevent_9_greenlet__Frame), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_9_greenlet__Frame) __PYX_ERR(4, 71, __pyx_L1_error) + __pyx_ptype_6gevent_9_greenlet__dummy_event = __Pyx_ImportType(__pyx_t_3, "gevent._greenlet", "_dummy_event", sizeof(struct __pyx_obj_6gevent_9_greenlet__dummy_event), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_9_greenlet__dummy_event) __PYX_ERR(4, 157, __pyx_L1_error) + __pyx_vtabptr_6gevent_9_greenlet__dummy_event = (struct __pyx_vtabstruct_6gevent_9_greenlet__dummy_event*)__Pyx_GetVtable(__pyx_ptype_6gevent_9_greenlet__dummy_event->tp_dict); if (unlikely(!__pyx_vtabptr_6gevent_9_greenlet__dummy_event)) __PYX_ERR(4, 157, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyImport_ImportModule("greenlet"); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_ptype_6gevent_19__abstract_linkable_greenlet = __Pyx_ImportType(__pyx_t_3, "greenlet", "greenlet", sizeof(PyGreenlet), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_19__abstract_linkable_greenlet) __PYX_ERR(5, 12, __pyx_L1_error) + __pyx_t_1 = PyImport_ImportModule("gevent.__abstract_linkable"); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 32, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_ptype_6gevent_19__abstract_linkable_AbstractLinkable = __Pyx_ImportType(__pyx_t_1, "gevent.__abstract_linkable", "AbstractLinkable", sizeof(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_19__abstract_linkable_AbstractLinkable) __PYX_ERR(5, 32, __pyx_L1_error) + __pyx_vtabptr_6gevent_19__abstract_linkable_AbstractLinkable = (struct __pyx_vtabstruct_6gevent_19__abstract_linkable_AbstractLinkable*)__Pyx_GetVtable(__pyx_ptype_6gevent_19__abstract_linkable_AbstractLinkable->tp_dict); if (unlikely(!__pyx_vtabptr_6gevent_19__abstract_linkable_AbstractLinkable)) __PYX_ERR(5, 32, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyImport_ImportModule("gevent.__semaphore"); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 7, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_ptype_6gevent_11__semaphore_Semaphore = __Pyx_ImportType(__pyx_t_1, "gevent.__semaphore", "Semaphore", sizeof(struct __pyx_obj_6gevent_11__semaphore_Semaphore), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_11__semaphore_Semaphore) __PYX_ERR(7, 7, __pyx_L1_error) + __pyx_vtabptr_6gevent_11__semaphore_Semaphore = (struct __pyx_vtabstruct_6gevent_11__semaphore_Semaphore*)__Pyx_GetVtable(__pyx_ptype_6gevent_11__semaphore_Semaphore->tp_dict); if (unlikely(!__pyx_vtabptr_6gevent_11__semaphore_Semaphore)) __PYX_ERR(7, 7, __pyx_L1_error) + __pyx_ptype_6gevent_11__semaphore_BoundedSemaphore = __Pyx_ImportType(__pyx_t_1, "gevent.__semaphore", "BoundedSemaphore", sizeof(struct __pyx_obj_6gevent_11__semaphore_BoundedSemaphore), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_11__semaphore_BoundedSemaphore) __PYX_ERR(7, 20, __pyx_L1_error) + __pyx_vtabptr_6gevent_11__semaphore_BoundedSemaphore = (struct __pyx_vtabstruct_6gevent_11__semaphore_BoundedSemaphore*)__Pyx_GetVtable(__pyx_ptype_6gevent_11__semaphore_BoundedSemaphore->tp_dict); if (unlikely(!__pyx_vtabptr_6gevent_11__semaphore_BoundedSemaphore)) __PYX_ERR(7, 20, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyImport_ImportModule("gevent._event"); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_ptype_6gevent_6_event_Event = __Pyx_ImportType(__pyx_t_1, "gevent._event", "Event", sizeof(struct __pyx_obj_6gevent_6_event_Event), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_6_event_Event) __PYX_ERR(8, 13, __pyx_L1_error) + __pyx_vtabptr_6gevent_6_event_Event = (struct __pyx_vtabstruct_6gevent_6_event_Event*)__Pyx_GetVtable(__pyx_ptype_6gevent_6_event_Event->tp_dict); if (unlikely(!__pyx_vtabptr_6gevent_6_event_Event)) __PYX_ERR(8, 13, __pyx_L1_error) + __pyx_ptype_6gevent_6_event_AsyncResult = __Pyx_ImportType(__pyx_t_1, "gevent._event", "AsyncResult", sizeof(struct __pyx_obj_6gevent_6_event_AsyncResult), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_6_event_AsyncResult) __PYX_ERR(8, 16, __pyx_L1_error) + __pyx_vtabptr_6gevent_6_event_AsyncResult = (struct __pyx_vtabstruct_6gevent_6_event_AsyncResult*)__Pyx_GetVtable(__pyx_ptype_6gevent_6_event_AsyncResult->tp_dict); if (unlikely(!__pyx_vtabptr_6gevent_6_event_AsyncResult)) __PYX_ERR(8, 16, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyImport_ImportModule("gevent._queue"); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 14, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_ptype_6gevent_6_queue_ItemWaiter = __Pyx_ImportType(__pyx_t_1, "gevent._queue", "ItemWaiter", sizeof(struct __pyx_obj_6gevent_6_queue_ItemWaiter), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_6_queue_ItemWaiter) __PYX_ERR(9, 14, __pyx_L1_error) + __pyx_vtabptr_6gevent_6_queue_ItemWaiter = (struct __pyx_vtabstruct_6gevent_6_queue_ItemWaiter*)__Pyx_GetVtable(__pyx_ptype_6gevent_6_queue_ItemWaiter->tp_dict); if (unlikely(!__pyx_vtabptr_6gevent_6_queue_ItemWaiter)) __PYX_ERR(9, 14, __pyx_L1_error) + __pyx_ptype_6gevent_6_queue_Queue = __Pyx_ImportType(__pyx_t_1, "gevent._queue", "Queue", sizeof(struct __pyx_obj_6gevent_6_queue_Queue), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_6_queue_Queue) __PYX_ERR(9, 18, __pyx_L1_error) + __pyx_vtabptr_6gevent_6_queue_Queue = (struct __pyx_vtabstruct_6gevent_6_queue_Queue*)__Pyx_GetVtable(__pyx_ptype_6gevent_6_queue_Queue->tp_dict); if (unlikely(!__pyx_vtabptr_6gevent_6_queue_Queue)) __PYX_ERR(9, 18, __pyx_L1_error) + __pyx_ptype_6gevent_6_queue_UnboundQueue = __Pyx_ImportType(__pyx_t_1, "gevent._queue", "UnboundQueue", sizeof(struct __pyx_obj_6gevent_6_queue_UnboundQueue), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_6_queue_UnboundQueue) __PYX_ERR(9, 50, __pyx_L1_error) + __pyx_vtabptr_6gevent_6_queue_UnboundQueue = (struct __pyx_vtabstruct_6gevent_6_queue_UnboundQueue*)__Pyx_GetVtable(__pyx_ptype_6gevent_6_queue_UnboundQueue->tp_dict); if (unlikely(!__pyx_vtabptr_6gevent_6_queue_UnboundQueue)) __PYX_ERR(9, 50, __pyx_L1_error) + __pyx_ptype_6gevent_6_queue_PriorityQueue = __Pyx_ImportType(__pyx_t_1, "gevent._queue", "PriorityQueue", sizeof(struct __pyx_obj_6gevent_6_queue_PriorityQueue), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_6_queue_PriorityQueue) __PYX_ERR(9, 53, __pyx_L1_error) + __pyx_vtabptr_6gevent_6_queue_PriorityQueue = (struct __pyx_vtabstruct_6gevent_6_queue_PriorityQueue*)__Pyx_GetVtable(__pyx_ptype_6gevent_6_queue_PriorityQueue->tp_dict); if (unlikely(!__pyx_vtabptr_6gevent_6_queue_PriorityQueue)) __PYX_ERR(9, 53, __pyx_L1_error) + __pyx_ptype_6gevent_6_queue_LifoQueue = __Pyx_ImportType(__pyx_t_1, "gevent._queue", "LifoQueue", sizeof(struct __pyx_obj_6gevent_6_queue_LifoQueue), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_6_queue_LifoQueue) __PYX_ERR(9, 56, __pyx_L1_error) + __pyx_vtabptr_6gevent_6_queue_LifoQueue = (struct __pyx_vtabstruct_6gevent_6_queue_LifoQueue*)__Pyx_GetVtable(__pyx_ptype_6gevent_6_queue_LifoQueue->tp_dict); if (unlikely(!__pyx_vtabptr_6gevent_6_queue_LifoQueue)) __PYX_ERR(9, 56, __pyx_L1_error) + __pyx_ptype_6gevent_6_queue_JoinableQueue = __Pyx_ImportType(__pyx_t_1, "gevent._queue", "JoinableQueue", sizeof(struct __pyx_obj_6gevent_6_queue_JoinableQueue), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_6_queue_JoinableQueue) __PYX_ERR(9, 59, __pyx_L1_error) + __pyx_vtabptr_6gevent_6_queue_JoinableQueue = (struct __pyx_vtabstruct_6gevent_6_queue_JoinableQueue*)__Pyx_GetVtable(__pyx_ptype_6gevent_6_queue_JoinableQueue->tp_dict); if (unlikely(!__pyx_vtabptr_6gevent_6_queue_JoinableQueue)) __PYX_ERR(9, 59, __pyx_L1_error) + __pyx_ptype_6gevent_6_queue_Channel = __Pyx_ImportType(__pyx_t_1, "gevent._queue", "Channel", sizeof(struct __pyx_obj_6gevent_6_queue_Channel), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_6_queue_Channel) __PYX_ERR(9, 64, __pyx_L1_error) + __pyx_vtabptr_6gevent_6_queue_Channel = (struct __pyx_vtabstruct_6gevent_6_queue_Channel*)__Pyx_GetVtable(__pyx_ptype_6gevent_6_queue_Channel->tp_dict); if (unlikely(!__pyx_vtabptr_6gevent_6_queue_Channel)) __PYX_ERR(9, 64, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_modinit_variable_import_code(void) { + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); + /*--- Variable import code ---*/ + __pyx_t_1 = PyImport_ImportModule("gevent.__ident"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_1, "heappop", (void **)&__pyx_vp_6gevent_7__ident_heappop, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_1, "heappush", (void **)&__pyx_vp_6gevent_7__ident_heappush, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_1, "WeakKeyDictionary", (void **)&__pyx_vp_6gevent_7__ident_WeakKeyDictionary, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + Py_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_2 = PyImport_ImportModule("gevent.__greenlet_primitives"); if (!__pyx_t_2) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_2, "get_objects", (void **)&__pyx_vp_6gevent_21__greenlet_primitives_get_objects, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_2, "wref", (void **)&__pyx_vp_6gevent_21__greenlet_primitives_wref, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_2, "BlockingSwitchOutError", (void **)&__pyx_vp_6gevent_21__greenlet_primitives_BlockingSwitchOutError, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_2, "_greenlet_imported", (void **)&__pyx_vp_6gevent_21__greenlet_primitives__greenlet_imported, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + Py_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_3 = PyImport_ImportModule("gevent.__hub_local"); if (!__pyx_t_3) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_3, "_threadlocal", (void **)&__pyx_vp_6gevent_11__hub_local__threadlocal, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + Py_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_4 = PyImport_ImportModule("gevent.__waiter"); if (!__pyx_t_4) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_4, "sys", (void **)&__pyx_vp_6gevent_8__waiter_sys, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_4, "ConcurrentObjectUseError", (void **)&__pyx_vp_6gevent_8__waiter_ConcurrentObjectUseError, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_4, "_greenlet_imported", (void **)&__pyx_vp_6gevent_8__waiter__greenlet_imported, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_4, "_NONE", (void **)&__pyx_vp_6gevent_8__waiter__NONE, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + Py_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = PyImport_ImportModule("gevent._greenlet"); if (!__pyx_t_5) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_5, "_PYPY", (void **)&__pyx_vp_6gevent_9_greenlet__PYPY, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_5, "sys_getframe", (void **)&__pyx_vp_6gevent_9_greenlet_sys_getframe, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_5, "sys_exc_info", (void **)&__pyx_vp_6gevent_9_greenlet_sys_exc_info, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_5, "Timeout", (void **)&__pyx_vp_6gevent_9_greenlet_Timeout, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_5, "GreenletExit", (void **)&__pyx_vp_6gevent_9_greenlet_GreenletExit, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_5, "InvalidSwitchError", (void **)&__pyx_vp_6gevent_9_greenlet_InvalidSwitchError, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_5, "_greenlet_imported", (void **)&__pyx_vp_6gevent_9_greenlet__greenlet_imported, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_5, "_greenlet__init__", (void **)&__pyx_vp_6gevent_9_greenlet__greenlet__init__, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_5, "_threadlocal", (void **)&__pyx_vp_6gevent_9_greenlet__threadlocal, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_5, "get_hub_class", (void **)&__pyx_vp_6gevent_9_greenlet_get_hub_class, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_5, "wref", (void **)&__pyx_vp_6gevent_9_greenlet_wref, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_5, "dump_traceback", (void **)&__pyx_vp_6gevent_9_greenlet_dump_traceback, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_5, "load_traceback", (void **)&__pyx_vp_6gevent_9_greenlet_load_traceback, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_5, "wait", (void **)&__pyx_vp_6gevent_9_greenlet_wait, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_5, "iwait", (void **)&__pyx_vp_6gevent_9_greenlet_iwait, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_5, "reraise", (void **)&__pyx_vp_6gevent_9_greenlet_reraise, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_5, "GEVENT_CONFIG", (void **)&__pyx_vp_6gevent_9_greenlet_GEVENT_CONFIG, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_5, "_cancelled_start_event", (void **)&__pyx_vp_6gevent_9_greenlet__cancelled_start_event, "struct __pyx_obj_6gevent_9_greenlet__dummy_event *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_5, "_start_completed_event", (void **)&__pyx_vp_6gevent_9_greenlet__start_completed_event, "struct __pyx_obj_6gevent_9_greenlet__dummy_event *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_5, "_spawn_callbacks", (void **)&__pyx_vp_6gevent_9_greenlet__spawn_callbacks, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + Py_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = PyImport_ImportModule("gevent.__abstract_linkable"); if (!__pyx_t_6) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_6, "InvalidSwitchError", (void **)&__pyx_vp_6gevent_19__abstract_linkable_InvalidSwitchError, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_6, "Timeout", (void **)&__pyx_vp_6gevent_19__abstract_linkable_Timeout, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_6, "_greenlet_imported", (void **)&__pyx_vp_6gevent_19__abstract_linkable__greenlet_imported, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + Py_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_7 = PyImport_ImportModule("gevent.__semaphore"); if (!__pyx_t_7) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_7, "Timeout", (void **)&__pyx_vp_6gevent_11__semaphore_Timeout, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + Py_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_8 = PyImport_ImportModule("gevent._event"); if (!__pyx_t_8) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_8, "_None", (void **)&__pyx_vp_6gevent_6_event__None, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_8, "reraise", (void **)&__pyx_vp_6gevent_6_event_reraise, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_8, "dump_traceback", (void **)&__pyx_vp_6gevent_6_event_dump_traceback, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_8, "load_traceback", (void **)&__pyx_vp_6gevent_6_event_load_traceback, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_8, "Timeout", (void **)&__pyx_vp_6gevent_6_event_Timeout, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + Py_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_9 = PyImport_ImportModule("gevent._queue"); if (!__pyx_t_9) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_9, "_heappush", (void **)&__pyx_vp_6gevent_6_queue__heappush, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_9, "_heappop", (void **)&__pyx_vp_6gevent_6_queue__heappop, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_9, "_heapify", (void **)&__pyx_vp_6gevent_6_queue__heapify, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + Py_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_modinit_function_import_code(void) { + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); + /*--- Function import code ---*/ + __pyx_t_1 = PyImport_ImportModule("gevent.__hub_local"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportFunction(__pyx_t_1, "get_hub_noargs", (void (**)(void))&__pyx_f_6gevent_11__hub_local_get_hub_noargs, "struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *(int __pyx_skip_dispatch)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + Py_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_RefNannyFinishContext(); + return -1; +} + + +#if PY_MAJOR_VERSION < 3 +#ifdef CYTHON_NO_PYINIT_EXPORT +#define __Pyx_PyMODINIT_FUNC void +#else +#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC +#endif +#else +#ifdef CYTHON_NO_PYINIT_EXPORT +#define __Pyx_PyMODINIT_FUNC PyObject * +#else +#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC +#endif +#endif + + +#if PY_MAJOR_VERSION < 3 +__Pyx_PyMODINIT_FUNC init__imap(void) CYTHON_SMALL_CODE; /*proto*/ +__Pyx_PyMODINIT_FUNC init__imap(void) +#else +__Pyx_PyMODINIT_FUNC PyInit___imap(void) CYTHON_SMALL_CODE; /*proto*/ +__Pyx_PyMODINIT_FUNC PyInit___imap(void) +#if CYTHON_PEP489_MULTI_PHASE_INIT +{ + return PyModuleDef_Init(&__pyx_moduledef); +} +static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { + #if PY_VERSION_HEX >= 0x030700A1 + static PY_INT64_T main_interpreter_id = -1; + PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); + if (main_interpreter_id == -1) { + main_interpreter_id = current_id; + return (unlikely(current_id == -1)) ? -1 : 0; + } else if (unlikely(main_interpreter_id != current_id)) + #else + static PyInterpreterState *main_interpreter = NULL; + PyInterpreterState *current_interpreter = PyThreadState_Get()->interp; + if (!main_interpreter) { + main_interpreter = current_interpreter; + } else if (unlikely(main_interpreter != current_interpreter)) + #endif + { + PyErr_SetString( + PyExc_ImportError, + "Interpreter change detected - this module can only be loaded into one interpreter per process."); + return -1; + } + return 0; +} +static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) { + PyObject *value = PyObject_GetAttrString(spec, from_name); + int result = 0; + if (likely(value)) { + if (allow_none || value != Py_None) { + result = PyDict_SetItemString(moddict, to_name, value); + } + Py_DECREF(value); + } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_Clear(); + } else { + result = -1; + } + return result; +} +static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) { + PyObject *module = NULL, *moddict, *modname; + if (__Pyx_check_single_interpreter()) + return NULL; + if (__pyx_m) + return __Pyx_NewRef(__pyx_m); + modname = PyObject_GetAttrString(spec, "name"); + if (unlikely(!modname)) goto bad; + module = PyModule_NewObject(modname); + Py_DECREF(modname); + if (unlikely(!module)) goto bad; + moddict = PyModule_GetDict(module); + if (unlikely(!moddict)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad; + return module; +bad: + Py_XDECREF(module); + return NULL; +} + + +static CYTHON_SMALL_CODE int __pyx_pymod_exec___imap(PyObject *__pyx_pyinit_module) +#endif +#endif +{ + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannyDeclarations + #if CYTHON_PEP489_MULTI_PHASE_INIT + if (__pyx_m) { + if (__pyx_m == __pyx_pyinit_module) return 0; + PyErr_SetString(PyExc_RuntimeError, "Module '__imap' has already been imported. Re-initialisation is not supported."); + return -1; + } + #elif PY_MAJOR_VERSION >= 3 + if (__pyx_m) return __Pyx_NewRef(__pyx_m); + #endif + #if CYTHON_REFNANNY +__Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); +if (!__Pyx_RefNanny) { + PyErr_Clear(); + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); + if (!__Pyx_RefNanny) + Py_FatalError("failed to import 'refnanny' module"); +} +#endif + __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit___imap(void)", 0); + if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #ifdef __Pxy_PyFrame_Initialize_Offsets + __Pxy_PyFrame_Initialize_Offsets(); + #endif + __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) + #ifdef __Pyx_CyFunction_USED + if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_FusedFunction_USED + if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_Coroutine_USED + if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_Generator_USED + if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_AsyncGen_USED + if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_StopAsyncIteration_USED + if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + /*--- Library function declarations ---*/ + /*--- Threads initialization code ---*/ + #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS + #ifdef WITH_THREAD /* Python build with threading support? */ + PyEval_InitThreads(); + #endif + #endif + /*--- Module creation code ---*/ + #if CYTHON_PEP489_MULTI_PHASE_INIT + __pyx_m = __pyx_pyinit_module; + Py_INCREF(__pyx_m); + #else + #if PY_MAJOR_VERSION < 3 + __pyx_m = Py_InitModule4("__imap", __pyx_methods, __pyx_k_Iterators_across_greenlets_or_A, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); + #else + __pyx_m = PyModule_Create(&__pyx_moduledef); + #endif + if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) + Py_INCREF(__pyx_d); + __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) + #if CYTHON_COMPILING_IN_PYPY + Py_INCREF(__pyx_b); + #endif + if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + /*--- Initialize various global constants etc. ---*/ + if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) + if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + if (__pyx_module_is_main_gevent____imap) { + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + } + #if PY_MAJOR_VERSION >= 3 + { + PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) + if (!PyDict_GetItemString(modules, "gevent.__imap")) { + if (unlikely(PyDict_SetItemString(modules, "gevent.__imap", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error) + } + } + #endif + /*--- Builtin init code ---*/ + if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + /*--- Constants init code ---*/ + if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + /*--- Global type/function init code ---*/ + (void)__Pyx_modinit_global_init_code(); + (void)__Pyx_modinit_variable_export_code(); + if (unlikely(__Pyx_modinit_function_export_code() != 0)) goto __pyx_L1_error; + if (unlikely(__Pyx_modinit_type_init_code() != 0)) goto __pyx_L1_error; + if (unlikely(__Pyx_modinit_type_import_code() != 0)) goto __pyx_L1_error; + if (unlikely(__Pyx_modinit_variable_import_code() != 0)) goto __pyx_L1_error; + if (unlikely(__Pyx_modinit_function_import_code() != 0)) goto __pyx_L1_error; + /*--- Execution code ---*/ + #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) + if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + + /* "src/gevent/_imap.py":14 + * + * + * from gevent import _semaphore # <<<<<<<<<<<<<< + * from gevent import queue + * + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 14, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_semaphore); + __Pyx_GIVEREF(__pyx_n_s_semaphore); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_semaphore); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_gevent, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 14, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_semaphore); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 14, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_semaphore, __pyx_t_1) < 0) __PYX_ERR(0, 14, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/_imap.py":15 + * + * from gevent import _semaphore + * from gevent import queue # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 15, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_queue); + __Pyx_GIVEREF(__pyx_n_s_queue); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_queue); + __pyx_t_1 = __Pyx_Import(__pyx_n_s_gevent, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 15, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_queue); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 15, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_queue, __pyx_t_2) < 0) __PYX_ERR(0, 15, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_imap.py":18 + * + * + * __all__ = [ # <<<<<<<<<<<<<< + * 'IMapUnordered', + * 'IMap', + */ + __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 18, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_IMapUnordered); + __Pyx_GIVEREF(__pyx_n_s_IMapUnordered); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_IMapUnordered); + __Pyx_INCREF(__pyx_n_s_IMap); + __Pyx_GIVEREF(__pyx_n_s_IMap); + PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_IMap); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_all, __pyx_t_1) < 0) __PYX_ERR(0, 18, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_imap.py":23 + * ] + * + * locals()['Greenlet'] = __import__('gevent').Greenlet # <<<<<<<<<<<<<< + * locals()['Semaphore'] = _semaphore.Semaphore + * locals()['UnboundQueue'] = queue.UnboundQueue + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin___import__, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 23, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_Greenlet); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 23, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_Globals(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 23, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (unlikely(PyDict_SetItem(__pyx_t_1, __pyx_n_s_Greenlet, __pyx_t_2) < 0)) __PYX_ERR(0, 23, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/_imap.py":24 + * + * locals()['Greenlet'] = __import__('gevent').Greenlet + * locals()['Semaphore'] = _semaphore.Semaphore # <<<<<<<<<<<<<< + * locals()['UnboundQueue'] = queue.UnboundQueue + * + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_semaphore); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 24, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_Semaphore); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 24, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_Globals(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 24, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (unlikely(PyDict_SetItem(__pyx_t_2, __pyx_n_s_Semaphore, __pyx_t_1) < 0)) __PYX_ERR(0, 24, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_imap.py":25 + * locals()['Greenlet'] = __import__('gevent').Greenlet + * locals()['Semaphore'] = _semaphore.Semaphore + * locals()['UnboundQueue'] = queue.UnboundQueue # <<<<<<<<<<<<<< + * + * + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_queue); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 25, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_UnboundQueue); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 25, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_Globals(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 25, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (unlikely(PyDict_SetItem(__pyx_t_1, __pyx_n_s_UnboundQueue, __pyx_t_2) < 0)) __PYX_ERR(0, 25, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/_imap.py":29 + * + * class Failure(object): + * __slots__ = ('exc', 'raise_exception') # <<<<<<<<<<<<<< + * + * def __init__(self, exc, raise_exception=None): + */ + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6__imap_Failure->tp_dict, __pyx_n_s_slots, __pyx_tuple__2) < 0) __PYX_ERR(0, 29, __pyx_L1_error) + PyType_Modified(__pyx_ptype_6gevent_6__imap_Failure); + + /* "src/gevent/_imap.py":110 + * return value + * + * next = __next__ # Py2 # <<<<<<<<<<<<<< + * + * def _inext(self): + */ + __Pyx_GetNameInClass(__pyx_t_2, (PyObject *)__pyx_ptype_6gevent_6__imap_IMapUnordered, __pyx_n_s_next); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 110, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6__imap_IMapUnordered->tp_dict, __pyx_n_s_next_2, __pyx_t_2) < 0) __PYX_ERR(0, 110, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_6__imap_IMapUnordered); + + /* "src/gevent/_imap.py":124 + * return g + * + * def _run(self): # pylint:disable=method-hidden # <<<<<<<<<<<<<< + * try: + * func = self.func + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6__imap_13IMapUnordered_7_run, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_IMapUnordered__run, NULL, __pyx_n_s_gevent___imap, __pyx_d, ((PyObject *)__pyx_codeobj__4)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 124, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6__imap_IMapUnordered->tp_dict, __pyx_n_s_run, __pyx_t_2) < 0) __PYX_ERR(0, 124, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_6__imap_IMapUnordered); + + /* "src/gevent/_imap.py":140 + * self._result_semaphore = None + * + * def _on_result(self, greenlet): # <<<<<<<<<<<<<< + * # This method will be called in the hub greenlet (we rawlink) + * self._outstanding_tasks -= 1 + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6__imap_13IMapUnordered_9_on_result, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_IMapUnordered__on_result, NULL, __pyx_n_s_gevent___imap, __pyx_d, ((PyObject *)__pyx_codeobj__6)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 140, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6__imap_IMapUnordered->tp_dict, __pyx_n_s_on_result, __pyx_t_2) < 0) __PYX_ERR(0, 140, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_6__imap_IMapUnordered); + + /* "src/gevent/_imap.py":226 + * return (self._max_index + 1, IMapUnordered._iqueue_value_for_self_failure(self, exception)) + * + * from gevent._util import import_c_accel # <<<<<<<<<<<<<< + * import_c_accel(globals(), 'gevent.__imap') + */ + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 226, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_import_c_accel); + __Pyx_GIVEREF(__pyx_n_s_import_c_accel); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_import_c_accel); + __pyx_t_1 = __Pyx_Import(__pyx_n_s_gevent__util, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 226, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_import_c_accel); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 226, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_import_c_accel, __pyx_t_2) < 0) __PYX_ERR(0, 226, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_imap.py":227 + * + * from gevent._util import import_c_accel + * import_c_accel(globals(), 'gevent.__imap') # <<<<<<<<<<<<<< + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_import_c_accel); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 227, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_Globals(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 227, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 227, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __Pyx_INCREF(__pyx_n_s_gevent___imap); + __Pyx_GIVEREF(__pyx_n_s_gevent___imap); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_n_s_gevent___imap); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 227, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/_imap.py":1 + * # -*- coding: utf-8 -*- # <<<<<<<<<<<<<< + * # Copyright (c) 2018 gevent + * # cython: auto_pickle=False,embedsignature=True,always_allow_keywords=False,infer_types=True + */ + __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "gevent/__abstract_linkable.pxd":24 + * return PyGreenlet_GetCurrent() + * + * cdef inline void greenlet_init(): # <<<<<<<<<<<<<< + * global _greenlet_imported + * if not _greenlet_imported: + */ + + /*--- Wrapped vars code ---*/ + + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + if (__pyx_m) { + if (__pyx_d) { + __Pyx_AddTraceback("init gevent.__imap", __pyx_clineno, __pyx_lineno, __pyx_filename); + } + Py_CLEAR(__pyx_m); + } else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_ImportError, "init gevent.__imap"); + } + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + #if CYTHON_PEP489_MULTI_PHASE_INIT + return (__pyx_m != NULL) ? 0 : -1; + #elif PY_MAJOR_VERSION >= 3 + return __pyx_m; + #else + return; + #endif +} + +/* --- Runtime support code --- */ +/* Refnanny */ +#if CYTHON_REFNANNY +static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { + PyObject *m = NULL, *p = NULL; + void *r = NULL; + m = PyImport_ImportModule(modname); + if (!m) goto end; + p = PyObject_GetAttrString(m, "RefNannyAPI"); + if (!p) goto end; + r = PyLong_AsVoidPtr(p); +end: + Py_XDECREF(p); + Py_XDECREF(m); + return (__Pyx_RefNannyAPIStruct *)r; +} +#endif + +/* PyObjectGetAttrStr */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_getattro)) + return tp->tp_getattro(obj, attr_name); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_getattr)) + return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); +#endif + return PyObject_GetAttr(obj, attr_name); +} +#endif + +/* GetBuiltinName */ +static PyObject *__Pyx_GetBuiltinName(PyObject *name) { + PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name); + if (unlikely(!result)) { + PyErr_Format(PyExc_NameError, +#if PY_MAJOR_VERSION >= 3 + "name '%U' is not defined", name); +#else + "name '%.200s' is not defined", PyString_AS_STRING(name)); +#endif + } + return result; +} + +/* RaiseDoubleKeywords */ +static void __Pyx_RaiseDoubleKeywordsError( + const char* func_name, + PyObject* kw_name) +{ + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION >= 3 + "%s() got multiple values for keyword argument '%U'", func_name, kw_name); + #else + "%s() got multiple values for keyword argument '%s'", func_name, + PyString_AsString(kw_name)); + #endif +} + +/* ParseKeywords */ +static int __Pyx_ParseOptionalKeywords( + PyObject *kwds, + PyObject **argnames[], + PyObject *kwds2, + PyObject *values[], + Py_ssize_t num_pos_args, + const char* function_name) +{ + PyObject *key = 0, *value = 0; + Py_ssize_t pos = 0; + PyObject*** name; + PyObject*** first_kw_arg = argnames + num_pos_args; + while (PyDict_Next(kwds, &pos, &key, &value)) { + name = first_kw_arg; + while (*name && (**name != key)) name++; + if (*name) { + values[name-argnames] = value; + continue; + } + name = first_kw_arg; + #if PY_MAJOR_VERSION < 3 + if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) { + while (*name) { + if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) + && _PyString_Eq(**name, key)) { + values[name-argnames] = value; + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + if ((**argname == key) || ( + (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) + && _PyString_Eq(**argname, key))) { + goto arg_passed_twice; + } + argname++; + } + } + } else + #endif + if (likely(PyUnicode_Check(key))) { + while (*name) { + int cmp = (**name == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 : + #endif + PyUnicode_Compare(**name, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) { + values[name-argnames] = value; + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + int cmp = (**argname == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 : + #endif + PyUnicode_Compare(**argname, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) goto arg_passed_twice; + argname++; + } + } + } else + goto invalid_keyword_type; + if (kwds2) { + if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; + } else { + goto invalid_keyword; + } + } + return 0; +arg_passed_twice: + __Pyx_RaiseDoubleKeywordsError(function_name, key); + goto bad; +invalid_keyword_type: + PyErr_Format(PyExc_TypeError, + "%.200s() keywords must be strings", function_name); + goto bad; +invalid_keyword: + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION < 3 + "%.200s() got an unexpected keyword argument '%.200s'", + function_name, PyString_AsString(key)); + #else + "%s() got an unexpected keyword argument '%U'", + function_name, key); + #endif +bad: + return -1; +} + +/* RaiseArgTupleInvalid */ +static void __Pyx_RaiseArgtupleInvalid( + const char* func_name, + int exact, + Py_ssize_t num_min, + Py_ssize_t num_max, + Py_ssize_t num_found) +{ + Py_ssize_t num_expected; + const char *more_or_less; + if (num_found < num_min) { + num_expected = num_min; + more_or_less = "at least"; + } else { + num_expected = num_max; + more_or_less = "at most"; + } + if (exact) { + more_or_less = "exactly"; + } + PyErr_Format(PyExc_TypeError, + "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", + func_name, more_or_less, num_expected, + (num_expected == 1) ? "" : "s", num_found); +} + +/* PyFunctionFastCall */ +#if CYTHON_FAST_PYCALL +static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, + PyObject *globals) { + PyFrameObject *f; + PyThreadState *tstate = __Pyx_PyThreadState_Current; + PyObject **fastlocals; + Py_ssize_t i; + PyObject *result; + assert(globals != NULL); + /* XXX Perhaps we should create a specialized + PyFrame_New() that doesn't take locals, but does + take builtins without sanity checking them. + */ + assert(tstate != NULL); + f = PyFrame_New(tstate, co, globals, NULL); + if (f == NULL) { + return NULL; + } + fastlocals = __Pyx_PyFrame_GetLocalsplus(f); + for (i = 0; i < na; i++) { + Py_INCREF(*args); + fastlocals[i] = *args++; + } + result = PyEval_EvalFrameEx(f,0); + ++tstate->recursion_depth; + Py_DECREF(f); + --tstate->recursion_depth; + return result; +} +#if 1 || PY_VERSION_HEX < 0x030600B1 +static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs) { + PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); + PyObject *globals = PyFunction_GET_GLOBALS(func); + PyObject *argdefs = PyFunction_GET_DEFAULTS(func); + PyObject *closure; +#if PY_MAJOR_VERSION >= 3 + PyObject *kwdefs; +#endif + PyObject *kwtuple, **k; + PyObject **d; + Py_ssize_t nd; + Py_ssize_t nk; + PyObject *result; + assert(kwargs == NULL || PyDict_Check(kwargs)); + nk = kwargs ? PyDict_Size(kwargs) : 0; + if (Py_EnterRecursiveCall((char*)" while calling a Python object")) { + return NULL; + } + if ( +#if PY_MAJOR_VERSION >= 3 + co->co_kwonlyargcount == 0 && +#endif + likely(kwargs == NULL || nk == 0) && + co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { + if (argdefs == NULL && co->co_argcount == nargs) { + result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); + goto done; + } + else if (nargs == 0 && argdefs != NULL + && co->co_argcount == Py_SIZE(argdefs)) { + /* function called with no arguments, but all parameters have + a default value: use default values as arguments .*/ + args = &PyTuple_GET_ITEM(argdefs, 0); + result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); + goto done; + } + } + if (kwargs != NULL) { + Py_ssize_t pos, i; + kwtuple = PyTuple_New(2 * nk); + if (kwtuple == NULL) { + result = NULL; + goto done; + } + k = &PyTuple_GET_ITEM(kwtuple, 0); + pos = i = 0; + while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { + Py_INCREF(k[i]); + Py_INCREF(k[i+1]); + i += 2; + } + nk = i / 2; + } + else { + kwtuple = NULL; + k = NULL; + } + closure = PyFunction_GET_CLOSURE(func); +#if PY_MAJOR_VERSION >= 3 + kwdefs = PyFunction_GET_KW_DEFAULTS(func); +#endif + if (argdefs != NULL) { + d = &PyTuple_GET_ITEM(argdefs, 0); + nd = Py_SIZE(argdefs); + } + else { + d = NULL; + nd = 0; + } +#if PY_MAJOR_VERSION >= 3 + result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, + args, nargs, + k, (int)nk, + d, (int)nd, kwdefs, closure); +#else + result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, + args, nargs, + k, (int)nk, + d, (int)nd, closure); +#endif + Py_XDECREF(kwtuple); +done: + Py_LeaveRecursiveCall(); + return result; +} +#endif +#endif + +/* PyObjectCall */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { + PyObject *result; + ternaryfunc call = func->ob_type->tp_call; + if (unlikely(!call)) + return PyObject_Call(func, arg, kw); + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; + result = (*call)(func, arg, kw); + Py_LeaveRecursiveCall(); + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +/* PyObjectCallMethO */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { + PyObject *self, *result; + PyCFunction cfunc; + cfunc = PyCFunction_GET_FUNCTION(func); + self = PyCFunction_GET_SELF(func); + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; + result = cfunc(self, arg); + Py_LeaveRecursiveCall(); + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +/* PyObjectCallNoArg */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { +#if CYTHON_FAST_PYCALL + if (PyFunction_Check(func)) { + return __Pyx_PyFunction_FastCall(func, NULL, 0); + } +#endif +#ifdef __Pyx_CyFunction_USED + if (likely(PyCFunction_Check(func) || __Pyx_CyFunction_Check(func))) +#else + if (likely(PyCFunction_Check(func))) +#endif + { + if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) { + return __Pyx_PyObject_CallMethO(func, NULL); + } + } + return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL); +} +#endif + +/* PyCFunctionFastCall */ +#if CYTHON_FAST_PYCCALL +static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) { + PyCFunctionObject *func = (PyCFunctionObject*)func_obj; + PyCFunction meth = PyCFunction_GET_FUNCTION(func); + PyObject *self = PyCFunction_GET_SELF(func); + int flags = PyCFunction_GET_FLAGS(func); + assert(PyCFunction_Check(func)); + assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS))); + assert(nargs >= 0); + assert(nargs == 0 || args != NULL); + /* _PyCFunction_FastCallDict() must not be called with an exception set, + because it may clear it (directly or indirectly) and so the + caller loses its exception */ + assert(!PyErr_Occurred()); + if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) { + return (*((__Pyx_PyCFunctionFastWithKeywords)(void*)meth)) (self, args, nargs, NULL); + } else { + return (*((__Pyx_PyCFunctionFast)(void*)meth)) (self, args, nargs); + } +} +#endif + +/* PyObjectCallOneArg */ +#if CYTHON_COMPILING_IN_CPYTHON +static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) { + PyObject *result; + PyObject *args = PyTuple_New(1); + if (unlikely(!args)) return NULL; + Py_INCREF(arg); + PyTuple_SET_ITEM(args, 0, arg); + result = __Pyx_PyObject_Call(func, args, NULL); + Py_DECREF(args); + return result; +} +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { +#if CYTHON_FAST_PYCALL + if (PyFunction_Check(func)) { + return __Pyx_PyFunction_FastCall(func, &arg, 1); + } +#endif + if (likely(PyCFunction_Check(func))) { + if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) { + return __Pyx_PyObject_CallMethO(func, arg); +#if CYTHON_FAST_PYCCALL + } else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) { + return __Pyx_PyCFunction_FastCall(func, &arg, 1); +#endif + } + } + return __Pyx__PyObject_CallOneArg(func, arg); +} +#else +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { + PyObject *result; + PyObject *args = PyTuple_Pack(1, arg); + if (unlikely(!args)) return NULL; + result = __Pyx_PyObject_Call(func, args, NULL); + Py_DECREF(args); + return result; +} +#endif + +/* PyErrFetchRestore */ +#if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + tmp_type = tstate->curexc_type; + tmp_value = tstate->curexc_value; + tmp_tb = tstate->curexc_traceback; + tstate->curexc_type = type; + tstate->curexc_value = value; + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +} +static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { + *type = tstate->curexc_type; + *value = tstate->curexc_value; + *tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +} +#endif + +/* RaiseException */ +#if PY_MAJOR_VERSION < 3 +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, + CYTHON_UNUSED PyObject *cause) { + __Pyx_PyThreadState_declare + Py_XINCREF(type); + if (!value || value == Py_None) + value = NULL; + else + Py_INCREF(value); + if (!tb || tb == Py_None) + tb = NULL; + else { + Py_INCREF(tb); + if (!PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto raise_error; + } + } + if (PyType_Check(type)) { +#if CYTHON_COMPILING_IN_PYPY + if (!value) { + Py_INCREF(Py_None); + value = Py_None; + } +#endif + PyErr_NormalizeException(&type, &value, &tb); + } else { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto raise_error; + } + value = type; + type = (PyObject*) Py_TYPE(type); + Py_INCREF(type); + if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto raise_error; + } + } + __Pyx_PyThreadState_assign + __Pyx_ErrRestore(type, value, tb); + return; +raise_error: + Py_XDECREF(value); + Py_XDECREF(type); + Py_XDECREF(tb); + return; +} +#else +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { + PyObject* owned_instance = NULL; + if (tb == Py_None) { + tb = 0; + } else if (tb && !PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto bad; + } + if (value == Py_None) + value = 0; + if (PyExceptionInstance_Check(type)) { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto bad; + } + value = type; + type = (PyObject*) Py_TYPE(value); + } else if (PyExceptionClass_Check(type)) { + PyObject *instance_class = NULL; + if (value && PyExceptionInstance_Check(value)) { + instance_class = (PyObject*) Py_TYPE(value); + if (instance_class != type) { + int is_subclass = PyObject_IsSubclass(instance_class, type); + if (!is_subclass) { + instance_class = NULL; + } else if (unlikely(is_subclass == -1)) { + goto bad; + } else { + type = instance_class; + } + } + } + if (!instance_class) { + PyObject *args; + if (!value) + args = PyTuple_New(0); + else if (PyTuple_Check(value)) { + Py_INCREF(value); + args = value; + } else + args = PyTuple_Pack(1, value); + if (!args) + goto bad; + owned_instance = PyObject_Call(type, args, NULL); + Py_DECREF(args); + if (!owned_instance) + goto bad; + value = owned_instance; + if (!PyExceptionInstance_Check(value)) { + PyErr_Format(PyExc_TypeError, + "calling %R should have returned an instance of " + "BaseException, not %R", + type, Py_TYPE(value)); + goto bad; + } + } + } else { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto bad; + } + if (cause) { + PyObject *fixed_cause; + if (cause == Py_None) { + fixed_cause = NULL; + } else if (PyExceptionClass_Check(cause)) { + fixed_cause = PyObject_CallObject(cause, NULL); + if (fixed_cause == NULL) + goto bad; + } else if (PyExceptionInstance_Check(cause)) { + fixed_cause = cause; + Py_INCREF(fixed_cause); + } else { + PyErr_SetString(PyExc_TypeError, + "exception causes must derive from " + "BaseException"); + goto bad; + } + PyException_SetCause(value, fixed_cause); + } + PyErr_SetObject(type, value); + if (tb) { +#if CYTHON_COMPILING_IN_PYPY + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); + Py_INCREF(tb); + PyErr_Restore(tmp_type, tmp_value, tb); + Py_XDECREF(tmp_tb); +#else + PyThreadState *tstate = __Pyx_PyThreadState_Current; + PyObject* tmp_tb = tstate->curexc_traceback; + if (tb != tmp_tb) { + Py_INCREF(tb); + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_tb); + } +#endif + } +bad: + Py_XDECREF(owned_instance); + return; +} +#endif + +/* PyObjectCall2Args */ +static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) { + PyObject *args, *result = NULL; + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(function)) { + PyObject *args[2] = {arg1, arg2}; + return __Pyx_PyFunction_FastCall(function, args, 2); + } + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(function)) { + PyObject *args[2] = {arg1, arg2}; + return __Pyx_PyCFunction_FastCall(function, args, 2); + } + #endif + args = PyTuple_New(2); + if (unlikely(!args)) goto done; + Py_INCREF(arg1); + PyTuple_SET_ITEM(args, 0, arg1); + Py_INCREF(arg2); + PyTuple_SET_ITEM(args, 1, arg2); + Py_INCREF(function); + result = __Pyx_PyObject_Call(function, args, NULL); + Py_DECREF(args); + Py_DECREF(function); +done: + return result; +} + +/* ExtTypeTest */ +static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { + if (unlikely(!type)) { + PyErr_SetString(PyExc_SystemError, "Missing type object"); + return 0; + } + if (likely(__Pyx_TypeCheck(obj, type))) + return 1; + PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s", + Py_TYPE(obj)->tp_name, type->tp_name); + return 0; +} + +/* PyObjectSetAttrStr */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) { + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_setattro)) + return tp->tp_setattro(obj, attr_name, value); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_setattr)) + return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value); +#endif + return PyObject_SetAttr(obj, attr_name, value); +} +#endif + +/* GetTopmostException */ +#if CYTHON_USE_EXC_INFO_STACK +static _PyErr_StackItem * +__Pyx_PyErr_GetTopmostException(PyThreadState *tstate) +{ + _PyErr_StackItem *exc_info = tstate->exc_info; + while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) && + exc_info->previous_item != NULL) + { + exc_info = exc_info->previous_item; + } + return exc_info; +} +#endif + +/* SaveResetException */ +#if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { + #if CYTHON_USE_EXC_INFO_STACK + _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate); + *type = exc_info->exc_type; + *value = exc_info->exc_value; + *tb = exc_info->exc_traceback; + #else + *type = tstate->exc_type; + *value = tstate->exc_value; + *tb = tstate->exc_traceback; + #endif + Py_XINCREF(*type); + Py_XINCREF(*value); + Py_XINCREF(*tb); +} +static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + #if CYTHON_USE_EXC_INFO_STACK + _PyErr_StackItem *exc_info = tstate->exc_info; + tmp_type = exc_info->exc_type; + tmp_value = exc_info->exc_value; + tmp_tb = exc_info->exc_traceback; + exc_info->exc_type = type; + exc_info->exc_value = value; + exc_info->exc_traceback = tb; + #else + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = type; + tstate->exc_value = value; + tstate->exc_traceback = tb; + #endif + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +} +#endif + +/* PyErrExceptionMatches */ +#if CYTHON_FAST_THREAD_STATE +static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { + Py_ssize_t i, n; + n = PyTuple_GET_SIZE(tuple); +#if PY_MAJOR_VERSION >= 3 + for (i=0; icurexc_type; + if (exc_type == err) return 1; + if (unlikely(!exc_type)) return 0; + if (unlikely(PyTuple_Check(err))) + return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err); + return __Pyx_PyErr_GivenExceptionMatches(exc_type, err); +} +#endif + +/* GetException */ +#if CYTHON_FAST_THREAD_STATE +static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) +#else +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) +#endif +{ + PyObject *local_type, *local_value, *local_tb; +#if CYTHON_FAST_THREAD_STATE + PyObject *tmp_type, *tmp_value, *tmp_tb; + local_type = tstate->curexc_type; + local_value = tstate->curexc_value; + local_tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +#else + PyErr_Fetch(&local_type, &local_value, &local_tb); +#endif + PyErr_NormalizeException(&local_type, &local_value, &local_tb); +#if CYTHON_FAST_THREAD_STATE + if (unlikely(tstate->curexc_type)) +#else + if (unlikely(PyErr_Occurred())) +#endif + goto bad; + #if PY_MAJOR_VERSION >= 3 + if (local_tb) { + if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) + goto bad; + } + #endif + Py_XINCREF(local_tb); + Py_XINCREF(local_type); + Py_XINCREF(local_value); + *type = local_type; + *value = local_value; + *tb = local_tb; +#if CYTHON_FAST_THREAD_STATE + #if CYTHON_USE_EXC_INFO_STACK + { + _PyErr_StackItem *exc_info = tstate->exc_info; + tmp_type = exc_info->exc_type; + tmp_value = exc_info->exc_value; + tmp_tb = exc_info->exc_traceback; + exc_info->exc_type = local_type; + exc_info->exc_value = local_value; + exc_info->exc_traceback = local_tb; + } + #else + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = local_type; + tstate->exc_value = local_value; + tstate->exc_traceback = local_tb; + #endif + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#else + PyErr_SetExcInfo(local_type, local_value, local_tb); +#endif + return 0; +bad: + *type = 0; + *value = 0; + *tb = 0; + Py_XDECREF(local_type); + Py_XDECREF(local_value); + Py_XDECREF(local_tb); + return -1; +} + +/* SwapException */ +#if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + #if CYTHON_USE_EXC_INFO_STACK + _PyErr_StackItem *exc_info = tstate->exc_info; + tmp_type = exc_info->exc_type; + tmp_value = exc_info->exc_value; + tmp_tb = exc_info->exc_traceback; + exc_info->exc_type = *type; + exc_info->exc_value = *value; + exc_info->exc_traceback = *tb; + #else + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = *type; + tstate->exc_value = *value; + tstate->exc_traceback = *tb; + #endif + *type = tmp_type; + *value = tmp_value; + *tb = tmp_tb; +} +#else +static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb); + PyErr_SetExcInfo(*type, *value, *tb); + *type = tmp_type; + *value = tmp_value; + *tb = tmp_tb; +} +#endif + +/* GetAttr */ +static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) { +#if CYTHON_USE_TYPE_SLOTS +#if PY_MAJOR_VERSION >= 3 + if (likely(PyUnicode_Check(n))) +#else + if (likely(PyString_Check(n))) +#endif + return __Pyx_PyObject_GetAttrStr(o, n); +#endif + return PyObject_GetAttr(o, n); +} + +/* KeywordStringCheck */ +static int __Pyx_CheckKeywordStrings( + PyObject *kwdict, + const char* function_name, + int kw_allowed) +{ + PyObject* key = 0; + Py_ssize_t pos = 0; +#if CYTHON_COMPILING_IN_PYPY + if (!kw_allowed && PyDict_Next(kwdict, &pos, &key, 0)) + goto invalid_keyword; + return 1; +#else + while (PyDict_Next(kwdict, &pos, &key, 0)) { + #if PY_MAJOR_VERSION < 3 + if (unlikely(!PyString_Check(key))) + #endif + if (unlikely(!PyUnicode_Check(key))) + goto invalid_keyword_type; + } + if ((!kw_allowed) && unlikely(key)) + goto invalid_keyword; + return 1; +invalid_keyword_type: + PyErr_Format(PyExc_TypeError, + "%.200s() keywords must be strings", function_name); + return 0; +#endif +invalid_keyword: + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION < 3 + "%.200s() got an unexpected keyword argument '%.200s'", + function_name, PyString_AsString(key)); + #else + "%s() got an unexpected keyword argument '%U'", + function_name, key); + #endif + return 0; +} + +/* UnpackUnboundCMethod */ +static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target) { + PyObject *method; + method = __Pyx_PyObject_GetAttrStr(target->type, *target->method_name); + if (unlikely(!method)) + return -1; + target->method = method; +#if CYTHON_COMPILING_IN_CPYTHON + #if PY_MAJOR_VERSION >= 3 + if (likely(__Pyx_TypeCheck(method, &PyMethodDescr_Type))) + #endif + { + PyMethodDescrObject *descr = (PyMethodDescrObject*) method; + target->func = descr->d_method->ml_meth; + target->flag = descr->d_method->ml_flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_STACKLESS); + } +#endif + return 0; +} + +/* CallUnboundCMethod2 */ +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030600B1 +static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2) { + if (likely(cfunc->func)) { + PyObject *args[2] = {arg1, arg2}; + if (cfunc->flag == METH_FASTCALL) { + #if PY_VERSION_HEX >= 0x030700A0 + return (*(__Pyx_PyCFunctionFast)(void*)(PyCFunction)cfunc->func)(self, args, 2); + #else + return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, 2, NULL); + #endif + } + #if PY_VERSION_HEX >= 0x030700A0 + if (cfunc->flag == (METH_FASTCALL | METH_KEYWORDS)) + return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, 2, NULL); + #endif + } + return __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2); +} +#endif +static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2){ + PyObject *args, *result = NULL; + if (unlikely(!cfunc->func && !cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL; +#if CYTHON_COMPILING_IN_CPYTHON + if (cfunc->func && (cfunc->flag & METH_VARARGS)) { + args = PyTuple_New(2); + if (unlikely(!args)) goto bad; + Py_INCREF(arg1); + PyTuple_SET_ITEM(args, 0, arg1); + Py_INCREF(arg2); + PyTuple_SET_ITEM(args, 1, arg2); + if (cfunc->flag & METH_KEYWORDS) + result = (*(PyCFunctionWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, NULL); + else + result = (*cfunc->func)(self, args); + } else { + args = PyTuple_New(3); + if (unlikely(!args)) goto bad; + Py_INCREF(self); + PyTuple_SET_ITEM(args, 0, self); + Py_INCREF(arg1); + PyTuple_SET_ITEM(args, 1, arg1); + Py_INCREF(arg2); + PyTuple_SET_ITEM(args, 2, arg2); + result = __Pyx_PyObject_Call(cfunc->method, args, NULL); + } +#else + args = PyTuple_Pack(3, self, arg1, arg2); + if (unlikely(!args)) goto bad; + result = __Pyx_PyObject_Call(cfunc->method, args, NULL); +#endif +bad: + Py_XDECREF(args); + return result; +} + +/* CallUnboundCMethod1 */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg) { + if (likely(cfunc->func)) { + int flag = cfunc->flag; + if (flag == METH_O) { + return (*(cfunc->func))(self, arg); + } else if (PY_VERSION_HEX >= 0x030600B1 && flag == METH_FASTCALL) { + if (PY_VERSION_HEX >= 0x030700A0) { + return (*(__Pyx_PyCFunctionFast)(void*)(PyCFunction)cfunc->func)(self, &arg, 1); + } else { + return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, &arg, 1, NULL); + } + } else if (PY_VERSION_HEX >= 0x030700A0 && flag == (METH_FASTCALL | METH_KEYWORDS)) { + return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, &arg, 1, NULL); + } + } + return __Pyx__CallUnboundCMethod1(cfunc, self, arg); +} +#endif +static PyObject* __Pyx__CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg){ + PyObject *args, *result = NULL; + if (unlikely(!cfunc->func && !cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL; +#if CYTHON_COMPILING_IN_CPYTHON + if (cfunc->func && (cfunc->flag & METH_VARARGS)) { + args = PyTuple_New(1); + if (unlikely(!args)) goto bad; + Py_INCREF(arg); + PyTuple_SET_ITEM(args, 0, arg); + if (cfunc->flag & METH_KEYWORDS) + result = (*(PyCFunctionWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, NULL); + else + result = (*cfunc->func)(self, args); + } else { + args = PyTuple_New(2); + if (unlikely(!args)) goto bad; + Py_INCREF(self); + PyTuple_SET_ITEM(args, 0, self); + Py_INCREF(arg); + PyTuple_SET_ITEM(args, 1, arg); + result = __Pyx_PyObject_Call(cfunc->method, args, NULL); + } +#else + args = PyTuple_Pack(2, self, arg); + if (unlikely(!args)) goto bad; + result = __Pyx_PyObject_Call(cfunc->method, args, NULL); +#endif +bad: + Py_XDECREF(args); + return result; +} + +/* py_dict_pop */ +static CYTHON_INLINE PyObject *__Pyx_PyDict_Pop(PyObject *d, PyObject *key, PyObject *default_value) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX > 0x030600B3 + if ((1)) { + return _PyDict_Pop(d, key, default_value); + } else +#endif + if (default_value) { + return __Pyx_CallUnboundCMethod2(&__pyx_umethod_PyDict_Type_pop, d, key, default_value); + } else { + return __Pyx_CallUnboundCMethod1(&__pyx_umethod_PyDict_Type_pop, d, key); + } +} + +/* RaiseTooManyValuesToUnpack */ +static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { + PyErr_Format(PyExc_ValueError, + "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected); +} + +/* RaiseNeedMoreValuesToUnpack */ +static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { + PyErr_Format(PyExc_ValueError, + "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack", + index, (index == 1) ? "" : "s"); +} + +/* IterFinish */ +static CYTHON_INLINE int __Pyx_IterFinish(void) { +#if CYTHON_FAST_THREAD_STATE + PyThreadState *tstate = __Pyx_PyThreadState_Current; + PyObject* exc_type = tstate->curexc_type; + if (unlikely(exc_type)) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) { + PyObject *exc_value, *exc_tb; + exc_value = tstate->curexc_value; + exc_tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; + Py_DECREF(exc_type); + Py_XDECREF(exc_value); + Py_XDECREF(exc_tb); + return 0; + } else { + return -1; + } + } + return 0; +#else + if (unlikely(PyErr_Occurred())) { + if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) { + PyErr_Clear(); + return 0; + } else { + return -1; + } + } + return 0; +#endif +} + +/* UnpackItemEndCheck */ +static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { + if (unlikely(retval)) { + Py_DECREF(retval); + __Pyx_RaiseTooManyValuesError(expected); + return -1; + } else { + return __Pyx_IterFinish(); + } + return 0; +} + +/* None */ +static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) { + PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname); +} + +/* CallNextTpDealloc */ +static void __Pyx_call_next_tp_dealloc(PyObject* obj, destructor current_tp_dealloc) { + PyTypeObject* type = Py_TYPE(obj); + while (type && type->tp_dealloc != current_tp_dealloc) + type = type->tp_base; + while (type && type->tp_dealloc == current_tp_dealloc) + type = type->tp_base; + if (type) + type->tp_dealloc(obj); +} + +/* CallNextTpTraverse */ +static int __Pyx_call_next_tp_traverse(PyObject* obj, visitproc v, void *a, traverseproc current_tp_traverse) { + PyTypeObject* type = Py_TYPE(obj); + while (type && type->tp_traverse != current_tp_traverse) + type = type->tp_base; + while (type && type->tp_traverse == current_tp_traverse) + type = type->tp_base; + if (type && type->tp_traverse) + return type->tp_traverse(obj, v, a); + return 0; +} + +/* CallNextTpClear */ +static void __Pyx_call_next_tp_clear(PyObject* obj, inquiry current_tp_clear) { + PyTypeObject* type = Py_TYPE(obj); + while (type && type->tp_clear != current_tp_clear) + type = type->tp_base; + while (type && type->tp_clear == current_tp_clear) + type = type->tp_base; + if (type && type->tp_clear) + type->tp_clear(obj); +} + +/* PyObject_GenericGetAttrNoDict */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) { + PyErr_Format(PyExc_AttributeError, +#if PY_MAJOR_VERSION >= 3 + "'%.50s' object has no attribute '%U'", + tp->tp_name, attr_name); +#else + "'%.50s' object has no attribute '%.400s'", + tp->tp_name, PyString_AS_STRING(attr_name)); +#endif + return NULL; +} +static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) { + PyObject *descr; + PyTypeObject *tp = Py_TYPE(obj); + if (unlikely(!PyString_Check(attr_name))) { + return PyObject_GenericGetAttr(obj, attr_name); + } + assert(!tp->tp_dictoffset); + descr = _PyType_Lookup(tp, attr_name); + if (unlikely(!descr)) { + return __Pyx_RaiseGenericGetAttributeError(tp, attr_name); + } + Py_INCREF(descr); + #if PY_MAJOR_VERSION < 3 + if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS))) + #endif + { + descrgetfunc f = Py_TYPE(descr)->tp_descr_get; + if (unlikely(f)) { + PyObject *res = f(descr, obj, (PyObject *)tp); + Py_DECREF(descr); + return res; + } + } + return descr; +} +#endif + +/* TypeImport */ +#ifndef __PYX_HAVE_RT_ImportType +#define __PYX_HAVE_RT_ImportType +static PyTypeObject *__Pyx_ImportType(PyObject *module, const char *module_name, const char *class_name, + size_t size, enum __Pyx_ImportType_CheckSize check_size) +{ + PyObject *result = 0; + char warning[200]; + Py_ssize_t basicsize; +#ifdef Py_LIMITED_API + PyObject *py_basicsize; +#endif + result = PyObject_GetAttrString(module, class_name); + if (!result) + goto bad; + if (!PyType_Check(result)) { + PyErr_Format(PyExc_TypeError, + "%.200s.%.200s is not a type object", + module_name, class_name); + goto bad; + } +#ifndef Py_LIMITED_API + basicsize = ((PyTypeObject *)result)->tp_basicsize; +#else + py_basicsize = PyObject_GetAttrString(result, "__basicsize__"); + if (!py_basicsize) + goto bad; + basicsize = PyLong_AsSsize_t(py_basicsize); + Py_DECREF(py_basicsize); + py_basicsize = 0; + if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred()) + goto bad; +#endif + if ((size_t)basicsize < size) { + PyErr_Format(PyExc_ValueError, + "%.200s.%.200s size changed, may indicate binary incompatibility. " + "Expected %zd from C header, got %zd from PyObject", + module_name, class_name, size, basicsize); + goto bad; + } + if (check_size == __Pyx_ImportType_CheckSize_Error && (size_t)basicsize != size) { + PyErr_Format(PyExc_ValueError, + "%.200s.%.200s size changed, may indicate binary incompatibility. " + "Expected %zd from C header, got %zd from PyObject", + module_name, class_name, size, basicsize); + goto bad; + } + else if (check_size == __Pyx_ImportType_CheckSize_Warn && (size_t)basicsize > size) { + PyOS_snprintf(warning, sizeof(warning), + "%s.%s size changed, may indicate binary incompatibility. " + "Expected %zd from C header, got %zd from PyObject", + module_name, class_name, size, basicsize); + if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad; + } + return (PyTypeObject *)result; +bad: + Py_XDECREF(result); + return NULL; +} +#endif + +/* GetVTable */ +static void* __Pyx_GetVtable(PyObject *dict) { + void* ptr; + PyObject *ob = PyObject_GetItem(dict, __pyx_n_s_pyx_vtable); + if (!ob) + goto bad; +#if PY_VERSION_HEX >= 0x02070000 + ptr = PyCapsule_GetPointer(ob, 0); +#else + ptr = PyCObject_AsVoidPtr(ob); +#endif + if (!ptr && !PyErr_Occurred()) + PyErr_SetString(PyExc_RuntimeError, "invalid vtable found for imported type"); + Py_DECREF(ob); + return ptr; +bad: + Py_XDECREF(ob); + return NULL; +} + +/* PyObject_GenericGetAttr */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) { + if (unlikely(Py_TYPE(obj)->tp_dictoffset)) { + return PyObject_GenericGetAttr(obj, attr_name); + } + return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name); +} +#endif + +/* SetVTable */ +static int __Pyx_SetVtable(PyObject *dict, void *vtable) { +#if PY_VERSION_HEX >= 0x02070000 + PyObject *ob = PyCapsule_New(vtable, 0, 0); +#else + PyObject *ob = PyCObject_FromVoidPtr(vtable, 0); +#endif + if (!ob) + goto bad; + if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0) + goto bad; + Py_DECREF(ob); + return 0; +bad: + Py_XDECREF(ob); + return -1; +} + +/* Import */ +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { + PyObject *empty_list = 0; + PyObject *module = 0; + PyObject *global_dict = 0; + PyObject *empty_dict = 0; + PyObject *list; + #if PY_MAJOR_VERSION < 3 + PyObject *py_import; + py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); + if (!py_import) + goto bad; + #endif + if (from_list) + list = from_list; + else { + empty_list = PyList_New(0); + if (!empty_list) + goto bad; + list = empty_list; + } + global_dict = PyModule_GetDict(__pyx_m); + if (!global_dict) + goto bad; + empty_dict = PyDict_New(); + if (!empty_dict) + goto bad; + { + #if PY_MAJOR_VERSION >= 3 + if (level == -1) { + if (strchr(__Pyx_MODULE_NAME, '.')) { + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, 1); + if (!module) { + if (!PyErr_ExceptionMatches(PyExc_ImportError)) + goto bad; + PyErr_Clear(); + } + } + level = 0; + } + #endif + if (!module) { + #if PY_MAJOR_VERSION < 3 + PyObject *py_level = PyInt_FromLong(level); + if (!py_level) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, py_level, (PyObject *)NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, level); + #endif + } + } +bad: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(py_import); + #endif + Py_XDECREF(empty_list); + Py_XDECREF(empty_dict); + return module; +} + +/* ImportFrom */ +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { + PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); + if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_Format(PyExc_ImportError, + #if PY_MAJOR_VERSION < 3 + "cannot import name %.230s", PyString_AS_STRING(name)); + #else + "cannot import name %S", name); + #endif + } + return value; +} + +/* GetModuleGlobalName */ +#if CYTHON_USE_DICT_VERSIONS +static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value) +#else +static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) +#endif +{ + PyObject *result; +#if !CYTHON_AVOID_BORROWED_REFS +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 + result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } else if (unlikely(PyErr_Occurred())) { + return NULL; + } +#else + result = PyDict_GetItem(__pyx_d, name); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } +#endif +#else + result = PyObject_GetItem(__pyx_d, name); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } + PyErr_Clear(); +#endif + return __Pyx_GetBuiltinName(name); +} + +/* GetNameInClass */ +static PyObject *__Pyx_GetGlobalNameAfterAttributeLookup(PyObject *name) { + PyObject *result; + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) + return NULL; + __Pyx_PyErr_Clear(); + __Pyx_GetModuleGlobalNameUncached(result, name); + return result; +} +static PyObject *__Pyx__GetNameInClass(PyObject *nmspace, PyObject *name) { + PyObject *result; + result = __Pyx_PyObject_GetAttrStr(nmspace, name); + if (!result) { + result = __Pyx_GetGlobalNameAfterAttributeLookup(name); + } + return result; +} + +/* FetchCommonType */ +static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { + PyObject* fake_module; + PyTypeObject* cached_type = NULL; + fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI); + if (!fake_module) return NULL; + Py_INCREF(fake_module); + cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name); + if (cached_type) { + if (!PyType_Check((PyObject*)cached_type)) { + PyErr_Format(PyExc_TypeError, + "Shared Cython type %.200s is not a type object", + type->tp_name); + goto bad; + } + if (cached_type->tp_basicsize != type->tp_basicsize) { + PyErr_Format(PyExc_TypeError, + "Shared Cython type %.200s has the wrong size, try recompiling", + type->tp_name); + goto bad; + } + } else { + if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; + PyErr_Clear(); + if (PyType_Ready(type) < 0) goto bad; + if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0) + goto bad; + Py_INCREF(type); + cached_type = type; + } +done: + Py_DECREF(fake_module); + return cached_type; +bad: + Py_XDECREF(cached_type); + cached_type = NULL; + goto done; +} + +/* CythonFunction */ +#include +static PyObject * +__Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure) +{ + if (unlikely(op->func_doc == NULL)) { + if (op->func.m_ml->ml_doc) { +#if PY_MAJOR_VERSION >= 3 + op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc); +#else + op->func_doc = PyString_FromString(op->func.m_ml->ml_doc); +#endif + if (unlikely(op->func_doc == NULL)) + return NULL; + } else { + Py_INCREF(Py_None); + return Py_None; + } + } + Py_INCREF(op->func_doc); + return op->func_doc; +} +static int +__Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context) +{ + PyObject *tmp = op->func_doc; + if (value == NULL) { + value = Py_None; + } + Py_INCREF(value); + op->func_doc = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + if (unlikely(op->func_name == NULL)) { +#if PY_MAJOR_VERSION >= 3 + op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name); +#else + op->func_name = PyString_InternFromString(op->func.m_ml->ml_name); +#endif + if (unlikely(op->func_name == NULL)) + return NULL; + } + Py_INCREF(op->func_name); + return op->func_name; +} +static int +__Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context) +{ + PyObject *tmp; +#if PY_MAJOR_VERSION >= 3 + if (unlikely(value == NULL || !PyUnicode_Check(value))) +#else + if (unlikely(value == NULL || !PyString_Check(value))) +#endif + { + PyErr_SetString(PyExc_TypeError, + "__name__ must be set to a string object"); + return -1; + } + tmp = op->func_name; + Py_INCREF(value); + op->func_name = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + Py_INCREF(op->func_qualname); + return op->func_qualname; +} +static int +__Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context) +{ + PyObject *tmp; +#if PY_MAJOR_VERSION >= 3 + if (unlikely(value == NULL || !PyUnicode_Check(value))) +#else + if (unlikely(value == NULL || !PyString_Check(value))) +#endif + { + PyErr_SetString(PyExc_TypeError, + "__qualname__ must be set to a string object"); + return -1; + } + tmp = op->func_qualname; + Py_INCREF(value); + op->func_qualname = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED void *closure) +{ + PyObject *self; + self = m->func_closure; + if (self == NULL) + self = Py_None; + Py_INCREF(self); + return self; +} +static PyObject * +__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + if (unlikely(op->func_dict == NULL)) { + op->func_dict = PyDict_New(); + if (unlikely(op->func_dict == NULL)) + return NULL; + } + Py_INCREF(op->func_dict); + return op->func_dict; +} +static int +__Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context) +{ + PyObject *tmp; + if (unlikely(value == NULL)) { + PyErr_SetString(PyExc_TypeError, + "function's dictionary may not be deleted"); + return -1; + } + if (unlikely(!PyDict_Check(value))) { + PyErr_SetString(PyExc_TypeError, + "setting function's dictionary to a non-dict"); + return -1; + } + tmp = op->func_dict; + Py_INCREF(value); + op->func_dict = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + Py_INCREF(op->func_globals); + return op->func_globals; +} +static PyObject * +__Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + Py_INCREF(Py_None); + return Py_None; +} +static PyObject * +__Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + PyObject* result = (op->func_code) ? op->func_code : Py_None; + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { + int result = 0; + PyObject *res = op->defaults_getter((PyObject *) op); + if (unlikely(!res)) + return -1; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + op->defaults_tuple = PyTuple_GET_ITEM(res, 0); + Py_INCREF(op->defaults_tuple); + op->defaults_kwdict = PyTuple_GET_ITEM(res, 1); + Py_INCREF(op->defaults_kwdict); + #else + op->defaults_tuple = PySequence_ITEM(res, 0); + if (unlikely(!op->defaults_tuple)) result = -1; + else { + op->defaults_kwdict = PySequence_ITEM(res, 1); + if (unlikely(!op->defaults_kwdict)) result = -1; + } + #endif + Py_DECREF(res); + return result; +} +static int +__Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) { + PyObject* tmp; + if (!value) { + value = Py_None; + } else if (value != Py_None && !PyTuple_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__defaults__ must be set to a tuple object"); + return -1; + } + Py_INCREF(value); + tmp = op->defaults_tuple; + op->defaults_tuple = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) { + PyObject* result = op->defaults_tuple; + if (unlikely(!result)) { + if (op->defaults_getter) { + if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL; + result = op->defaults_tuple; + } else { + result = Py_None; + } + } + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) { + PyObject* tmp; + if (!value) { + value = Py_None; + } else if (value != Py_None && !PyDict_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__kwdefaults__ must be set to a dict object"); + return -1; + } + Py_INCREF(value); + tmp = op->defaults_kwdict; + op->defaults_kwdict = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) { + PyObject* result = op->defaults_kwdict; + if (unlikely(!result)) { + if (op->defaults_getter) { + if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL; + result = op->defaults_kwdict; + } else { + result = Py_None; + } + } + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) { + PyObject* tmp; + if (!value || value == Py_None) { + value = NULL; + } else if (!PyDict_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__annotations__ must be set to a dict object"); + return -1; + } + Py_XINCREF(value); + tmp = op->func_annotations; + op->func_annotations = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) { + PyObject* result = op->func_annotations; + if (unlikely(!result)) { + result = PyDict_New(); + if (unlikely(!result)) return NULL; + op->func_annotations = result; + } + Py_INCREF(result); + return result; +} +static PyGetSetDef __pyx_CyFunction_getsets[] = { + {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, + {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, + {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, + {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, + {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, + {(char *) "__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0}, + {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, + {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, + {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, + {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, + {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, + {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, + {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, + {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, + {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, + {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, + {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, + {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, + {0, 0, 0, 0, 0} +}; +static PyMemberDef __pyx_CyFunction_members[] = { + {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), PY_WRITE_RESTRICTED, 0}, + {0, 0, 0, 0, 0} +}; +static PyObject * +__Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args) +{ +#if PY_MAJOR_VERSION >= 3 + return PyUnicode_FromString(m->func.m_ml->ml_name); +#else + return PyString_FromString(m->func.m_ml->ml_name); +#endif +} +static PyMethodDef __pyx_CyFunction_methods[] = { + {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, + {0, 0, 0, 0} +}; +#if PY_VERSION_HEX < 0x030500A0 +#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist) +#else +#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func.m_weakreflist) +#endif +static PyObject *__Pyx_CyFunction_New(PyTypeObject *type, PyMethodDef *ml, int flags, PyObject* qualname, + PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { + __pyx_CyFunctionObject *op = PyObject_GC_New(__pyx_CyFunctionObject, type); + if (op == NULL) + return NULL; + op->flags = flags; + __Pyx_CyFunction_weakreflist(op) = NULL; + op->func.m_ml = ml; + op->func.m_self = (PyObject *) op; + Py_XINCREF(closure); + op->func_closure = closure; + Py_XINCREF(module); + op->func.m_module = module; + op->func_dict = NULL; + op->func_name = NULL; + Py_INCREF(qualname); + op->func_qualname = qualname; + op->func_doc = NULL; + op->func_classobj = NULL; + op->func_globals = globals; + Py_INCREF(op->func_globals); + Py_XINCREF(code); + op->func_code = code; + op->defaults_pyobjects = 0; + op->defaults = NULL; + op->defaults_tuple = NULL; + op->defaults_kwdict = NULL; + op->defaults_getter = NULL; + op->func_annotations = NULL; + PyObject_GC_Track(op); + return (PyObject *) op; +} +static int +__Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) +{ + Py_CLEAR(m->func_closure); + Py_CLEAR(m->func.m_module); + Py_CLEAR(m->func_dict); + Py_CLEAR(m->func_name); + Py_CLEAR(m->func_qualname); + Py_CLEAR(m->func_doc); + Py_CLEAR(m->func_globals); + Py_CLEAR(m->func_code); + Py_CLEAR(m->func_classobj); + Py_CLEAR(m->defaults_tuple); + Py_CLEAR(m->defaults_kwdict); + Py_CLEAR(m->func_annotations); + if (m->defaults) { + PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); + int i; + for (i = 0; i < m->defaults_pyobjects; i++) + Py_XDECREF(pydefaults[i]); + PyObject_Free(m->defaults); + m->defaults = NULL; + } + return 0; +} +static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m) +{ + if (__Pyx_CyFunction_weakreflist(m) != NULL) + PyObject_ClearWeakRefs((PyObject *) m); + __Pyx_CyFunction_clear(m); + PyObject_GC_Del(m); +} +static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) +{ + PyObject_GC_UnTrack(m); + __Pyx__CyFunction_dealloc(m); +} +static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) +{ + Py_VISIT(m->func_closure); + Py_VISIT(m->func.m_module); + Py_VISIT(m->func_dict); + Py_VISIT(m->func_name); + Py_VISIT(m->func_qualname); + Py_VISIT(m->func_doc); + Py_VISIT(m->func_globals); + Py_VISIT(m->func_code); + Py_VISIT(m->func_classobj); + Py_VISIT(m->defaults_tuple); + Py_VISIT(m->defaults_kwdict); + if (m->defaults) { + PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); + int i; + for (i = 0; i < m->defaults_pyobjects; i++) + Py_VISIT(pydefaults[i]); + } + return 0; +} +static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type) +{ + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) { + Py_INCREF(func); + return func; + } + if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) { + if (type == NULL) + type = (PyObject *)(Py_TYPE(obj)); + return __Pyx_PyMethod_New(func, type, (PyObject *)(Py_TYPE(type))); + } + if (obj == Py_None) + obj = NULL; + return __Pyx_PyMethod_New(func, obj, type); +} +static PyObject* +__Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) +{ +#if PY_MAJOR_VERSION >= 3 + return PyUnicode_FromFormat("", + op->func_qualname, (void *)op); +#else + return PyString_FromFormat("", + PyString_AsString(op->func_qualname), (void *)op); +#endif +} +static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) { + PyCFunctionObject* f = (PyCFunctionObject*)func; + PyCFunction meth = f->m_ml->ml_meth; + Py_ssize_t size; + switch (f->m_ml->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) { + case METH_VARARGS: + if (likely(kw == NULL || PyDict_Size(kw) == 0)) + return (*meth)(self, arg); + break; + case METH_VARARGS | METH_KEYWORDS: + return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw); + case METH_NOARGS: + if (likely(kw == NULL || PyDict_Size(kw) == 0)) { + size = PyTuple_GET_SIZE(arg); + if (likely(size == 0)) + return (*meth)(self, NULL); + PyErr_Format(PyExc_TypeError, + "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", + f->m_ml->ml_name, size); + return NULL; + } + break; + case METH_O: + if (likely(kw == NULL || PyDict_Size(kw) == 0)) { + size = PyTuple_GET_SIZE(arg); + if (likely(size == 1)) { + PyObject *result, *arg0; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + arg0 = PyTuple_GET_ITEM(arg, 0); + #else + arg0 = PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL; + #endif + result = (*meth)(self, arg0); + #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) + Py_DECREF(arg0); + #endif + return result; + } + PyErr_Format(PyExc_TypeError, + "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", + f->m_ml->ml_name, size); + return NULL; + } + break; + default: + PyErr_SetString(PyExc_SystemError, "Bad call flags in " + "__Pyx_CyFunction_Call. METH_OLDARGS is no " + "longer supported!"); + return NULL; + } + PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", + f->m_ml->ml_name); + return NULL; +} +static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { + return __Pyx_CyFunction_CallMethod(func, ((PyCFunctionObject*)func)->m_self, arg, kw); +} +static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) { + PyObject *result; + __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func; + if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { + Py_ssize_t argc; + PyObject *new_args; + PyObject *self; + argc = PyTuple_GET_SIZE(args); + new_args = PyTuple_GetSlice(args, 1, argc); + if (unlikely(!new_args)) + return NULL; + self = PyTuple_GetItem(args, 0); + if (unlikely(!self)) { + Py_DECREF(new_args); + return NULL; + } + result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw); + Py_DECREF(new_args); + } else { + result = __Pyx_CyFunction_Call(func, args, kw); + } + return result; +} +static PyTypeObject __pyx_CyFunctionType_type = { + PyVarObject_HEAD_INIT(0, 0) + "cython_function_or_method", + sizeof(__pyx_CyFunctionObject), + 0, + (destructor) __Pyx_CyFunction_dealloc, + 0, + 0, + 0, +#if PY_MAJOR_VERSION < 3 + 0, +#else + 0, +#endif + (reprfunc) __Pyx_CyFunction_repr, + 0, + 0, + 0, + 0, + __Pyx_CyFunction_CallAsMethod, + 0, + 0, + 0, + 0, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, + 0, + (traverseproc) __Pyx_CyFunction_traverse, + (inquiry) __Pyx_CyFunction_clear, + 0, +#if PY_VERSION_HEX < 0x030500A0 + offsetof(__pyx_CyFunctionObject, func_weakreflist), +#else + offsetof(PyCFunctionObject, m_weakreflist), +#endif + 0, + 0, + __pyx_CyFunction_methods, + __pyx_CyFunction_members, + __pyx_CyFunction_getsets, + 0, + 0, + __Pyx_CyFunction_descr_get, + 0, + offsetof(__pyx_CyFunctionObject, func_dict), + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, +#if PY_VERSION_HEX >= 0x030400a1 + 0, +#endif +}; +static int __pyx_CyFunction_init(void) { + __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); + if (unlikely(__pyx_CyFunctionType == NULL)) { + return -1; + } + return 0; +} +static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults = PyObject_Malloc(size); + if (unlikely(!m->defaults)) + return PyErr_NoMemory(); + memset(m->defaults, 0, size); + m->defaults_pyobjects = pyobjects; + return m->defaults; +} +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults_tuple = tuple; + Py_INCREF(tuple); +} +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults_kwdict = dict; + Py_INCREF(dict); +} +static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->func_annotations = dict; + Py_INCREF(dict); +} + +/* Globals */ +static PyObject* __Pyx_Globals(void) { + Py_ssize_t i; + PyObject *names; + PyObject *globals = __pyx_d; + Py_INCREF(globals); + names = PyObject_Dir(__pyx_m); + if (!names) + goto bad; + for (i = PyList_GET_SIZE(names)-1; i >= 0; i--) { +#if CYTHON_COMPILING_IN_PYPY + PyObject* name = PySequence_ITEM(names, i); + if (!name) + goto bad; +#else + PyObject* name = PyList_GET_ITEM(names, i); +#endif + if (!PyDict_Contains(globals, name)) { + PyObject* value = __Pyx_GetAttr(__pyx_m, name); + if (!value) { +#if CYTHON_COMPILING_IN_PYPY + Py_DECREF(name); +#endif + goto bad; + } + if (PyDict_SetItem(globals, name, value) < 0) { +#if CYTHON_COMPILING_IN_PYPY + Py_DECREF(name); +#endif + Py_DECREF(value); + goto bad; + } + } +#if CYTHON_COMPILING_IN_PYPY + Py_DECREF(name); +#endif + } + Py_DECREF(names); + return globals; +bad: + Py_XDECREF(names); + Py_XDECREF(globals); + return NULL; +} + +/* CLineInTraceback */ +#ifndef CYTHON_CLINE_IN_TRACEBACK +static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { + PyObject *use_cline; + PyObject *ptype, *pvalue, *ptraceback; +#if CYTHON_COMPILING_IN_CPYTHON + PyObject **cython_runtime_dict; +#endif + if (unlikely(!__pyx_cython_runtime)) { + return c_line; + } + __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); +#if CYTHON_COMPILING_IN_CPYTHON + cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); + if (likely(cython_runtime_dict)) { + __PYX_PY_DICT_LOOKUP_IF_MODIFIED( + use_cline, *cython_runtime_dict, + __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback)) + } else +#endif + { + PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback); + if (use_cline_obj) { + use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; + Py_DECREF(use_cline_obj); + } else { + PyErr_Clear(); + use_cline = NULL; + } + } + if (!use_cline) { + c_line = 0; + PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); + } + else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { + c_line = 0; + } + __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); + return c_line; +} +#endif + +/* CodeObjectCache */ +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { + int start = 0, mid = 0, end = count - 1; + if (end >= 0 && code_line > entries[end].code_line) { + return count; + } + while (start < end) { + mid = start + (end - start) / 2; + if (code_line < entries[mid].code_line) { + end = mid; + } else if (code_line > entries[mid].code_line) { + start = mid + 1; + } else { + return mid; + } + } + if (code_line <= entries[mid].code_line) { + return mid; + } else { + return mid + 1; + } +} +static PyCodeObject *__pyx_find_code_object(int code_line) { + PyCodeObject* code_object; + int pos; + if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { + return NULL; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { + return NULL; + } + code_object = __pyx_code_cache.entries[pos].code_object; + Py_INCREF(code_object); + return code_object; +} +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { + int pos, i; + __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; + if (unlikely(!code_line)) { + return; + } + if (unlikely(!entries)) { + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); + if (likely(entries)) { + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = 64; + __pyx_code_cache.count = 1; + entries[0].code_line = code_line; + entries[0].code_object = code_object; + Py_INCREF(code_object); + } + return; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { + PyCodeObject* tmp = entries[pos].code_object; + entries[pos].code_object = code_object; + Py_DECREF(tmp); + return; + } + if (__pyx_code_cache.count == __pyx_code_cache.max_count) { + int new_max = __pyx_code_cache.max_count + 64; + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( + __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry)); + if (unlikely(!entries)) { + return; + } + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = new_max; + } + for (i=__pyx_code_cache.count; i>pos; i--) { + entries[i] = entries[i-1]; + } + entries[pos].code_line = code_line; + entries[pos].code_object = code_object; + __pyx_code_cache.count++; + Py_INCREF(code_object); +} + +/* AddTraceback */ +#include "compile.h" +#include "frameobject.h" +#include "traceback.h" +static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( + const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyObject *py_srcfile = 0; + PyObject *py_funcname = 0; + #if PY_MAJOR_VERSION < 3 + py_srcfile = PyString_FromString(filename); + #else + py_srcfile = PyUnicode_FromString(filename); + #endif + if (!py_srcfile) goto bad; + if (c_line) { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + #else + py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + #endif + } + else { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromString(funcname); + #else + py_funcname = PyUnicode_FromString(funcname); + #endif + } + if (!py_funcname) goto bad; + py_code = __Pyx_PyCode_New( + 0, + 0, + 0, + 0, + 0, + __pyx_empty_bytes, /*PyObject *code,*/ + __pyx_empty_tuple, /*PyObject *consts,*/ + __pyx_empty_tuple, /*PyObject *names,*/ + __pyx_empty_tuple, /*PyObject *varnames,*/ + __pyx_empty_tuple, /*PyObject *freevars,*/ + __pyx_empty_tuple, /*PyObject *cellvars,*/ + py_srcfile, /*PyObject *filename,*/ + py_funcname, /*PyObject *name,*/ + py_line, + __pyx_empty_bytes /*PyObject *lnotab*/ + ); + Py_DECREF(py_srcfile); + Py_DECREF(py_funcname); + return py_code; +bad: + Py_XDECREF(py_srcfile); + Py_XDECREF(py_funcname); + return NULL; +} +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyFrameObject *py_frame = 0; + PyThreadState *tstate = __Pyx_PyThreadState_Current; + if (c_line) { + c_line = __Pyx_CLineForTraceback(tstate, c_line); + } + py_code = __pyx_find_code_object(c_line ? -c_line : py_line); + if (!py_code) { + py_code = __Pyx_CreateCodeObjectForTraceback( + funcname, c_line, py_line, filename); + if (!py_code) goto bad; + __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); + } + py_frame = PyFrame_New( + tstate, /*PyThreadState *tstate,*/ + py_code, /*PyCodeObject *code,*/ + __pyx_d, /*PyObject *globals,*/ + 0 /*PyObject *locals*/ + ); + if (!py_frame) goto bad; + __Pyx_PyFrame_SetLineNumber(py_frame, py_line); + PyTraceBack_Here(py_frame); +bad: + Py_XDECREF(py_code); + Py_XDECREF(py_frame); +} + +/* CIntToPy */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { + const int neg_one = (int) ((int) 0 - (int) 1), const_zero = (int) 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(int) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(int) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(int) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(int), + little, !is_unsigned); + } +} + +/* CIntFromPyVerify */ +#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ + __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) +#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ + __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) +#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ + {\ + func_type value = func_value;\ + if (sizeof(target_type) < sizeof(func_type)) {\ + if (unlikely(value != (func_type) (target_type) value)) {\ + func_type zero = 0;\ + if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ + return (target_type) -1;\ + if (is_unsigned && unlikely(value < zero))\ + goto raise_neg_overflow;\ + else\ + goto raise_overflow;\ + }\ + }\ + return (target_type) value;\ + } + +/* CIntToPy */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { + const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(long) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(long) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(long) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(long), + little, !is_unsigned); + } +} + +/* CIntFromPy */ +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { + const int neg_one = (int) ((int) 0 - (int) 1), const_zero = (int) 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(int) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (int) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (int) 0; + case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0]) + case 2: + if (8 * sizeof(int) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) { + return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + case 3: + if (8 * sizeof(int) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) { + return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + case 4: + if (8 * sizeof(int) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) { + return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (int) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if (sizeof(int) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (int) 0; + case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0])) + case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0]) + case -2: + if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { + return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 2: + if (8 * sizeof(int) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { + return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case -3: + if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { + return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 3: + if (8 * sizeof(int) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { + return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case -4: + if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { + return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 4: + if (8 * sizeof(int) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { + return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + } +#endif + if (sizeof(int) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + int val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (int) -1; + } + } else { + int val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (int) -1; + val = __Pyx_PyInt_As_int(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to int"); + return (int) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to int"); + return (int) -1; +} + +/* CIntFromPy */ +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { + const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(long) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (long) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (long) 0; + case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0]) + case 2: + if (8 * sizeof(long) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) { + return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + case 3: + if (8 * sizeof(long) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) { + return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + case 4: + if (8 * sizeof(long) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) { + return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (long) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if (sizeof(long) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (long) 0; + case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0])) + case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0]) + case -2: + if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 2: + if (8 * sizeof(long) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case -3: + if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 3: + if (8 * sizeof(long) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case -4: + if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 4: + if (8 * sizeof(long) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + } +#endif + if (sizeof(long) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + long val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (long) -1; + } + } else { + long val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (long) -1; + val = __Pyx_PyInt_As_long(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to long"); + return (long) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to long"); + return (long) -1; +} + +/* FastTypeChecks */ +#if CYTHON_COMPILING_IN_CPYTHON +static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) { + while (a) { + a = a->tp_base; + if (a == b) + return 1; + } + return b == &PyBaseObject_Type; +} +static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) { + PyObject *mro; + if (a == b) return 1; + mro = a->tp_mro; + if (likely(mro)) { + Py_ssize_t i, n; + n = PyTuple_GET_SIZE(mro); + for (i = 0; i < n; i++) { + if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b) + return 1; + } + return 0; + } + return __Pyx_InBases(a, b); +} +#if PY_MAJOR_VERSION == 2 +static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { + PyObject *exception, *value, *tb; + int res; + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ErrFetch(&exception, &value, &tb); + res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; + if (unlikely(res == -1)) { + PyErr_WriteUnraisable(err); + res = 0; + } + if (!res) { + res = PyObject_IsSubclass(err, exc_type2); + if (unlikely(res == -1)) { + PyErr_WriteUnraisable(err); + res = 0; + } + } + __Pyx_ErrRestore(exception, value, tb); + return res; +} +#else +static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { + int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0; + if (!res) { + res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); + } + return res; +} +#endif +static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { + Py_ssize_t i, n; + assert(PyExceptionClass_Check(exc_type)); + n = PyTuple_GET_SIZE(tuple); +#if PY_MAJOR_VERSION >= 3 + for (i=0; i= 0x02070000 + cobj = PyCapsule_New(tmp.p, sig, 0); +#else + cobj = PyCObject_FromVoidPtrAndDesc(tmp.p, (void *)sig, 0); +#endif + if (!cobj) + goto bad; + if (PyDict_SetItemString(d, name, cobj) < 0) + goto bad; + Py_DECREF(cobj); + Py_DECREF(d); + return 0; +bad: + Py_XDECREF(cobj); + Py_XDECREF(d); + return -1; +} + +/* VoidPtrImport */ +#ifndef __PYX_HAVE_RT_ImportVoidPtr +#define __PYX_HAVE_RT_ImportVoidPtr +static int __Pyx_ImportVoidPtr(PyObject *module, const char *name, void **p, const char *sig) { + PyObject *d = 0; + PyObject *cobj = 0; + d = PyObject_GetAttrString(module, (char *)"__pyx_capi__"); + if (!d) + goto bad; + cobj = PyDict_GetItemString(d, name); + if (!cobj) { + PyErr_Format(PyExc_ImportError, + "%.200s does not export expected C variable %.200s", + PyModule_GetName(module), name); + goto bad; + } +#if PY_VERSION_HEX >= 0x02070000 + if (!PyCapsule_IsValid(cobj, sig)) { + PyErr_Format(PyExc_TypeError, + "C variable %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", + PyModule_GetName(module), name, sig, PyCapsule_GetName(cobj)); + goto bad; + } + *p = PyCapsule_GetPointer(cobj, sig); +#else + {const char *desc, *s1, *s2; + desc = (const char *)PyCObject_GetDesc(cobj); + if (!desc) + goto bad; + s1 = desc; s2 = sig; + while (*s1 != '\0' && *s1 == *s2) { s1++; s2++; } + if (*s1 != *s2) { + PyErr_Format(PyExc_TypeError, + "C variable %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", + PyModule_GetName(module), name, sig, desc); + goto bad; + } + *p = PyCObject_AsVoidPtr(cobj);} +#endif + if (!(*p)) + goto bad; + Py_DECREF(d); + return 0; +bad: + Py_XDECREF(d); + return -1; +} +#endif + +/* FunctionImport */ +#ifndef __PYX_HAVE_RT_ImportFunction +#define __PYX_HAVE_RT_ImportFunction +static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig) { + PyObject *d = 0; + PyObject *cobj = 0; + union { + void (*fp)(void); + void *p; + } tmp; + d = PyObject_GetAttrString(module, (char *)"__pyx_capi__"); + if (!d) + goto bad; + cobj = PyDict_GetItemString(d, funcname); + if (!cobj) { + PyErr_Format(PyExc_ImportError, + "%.200s does not export expected C function %.200s", + PyModule_GetName(module), funcname); + goto bad; + } +#if PY_VERSION_HEX >= 0x02070000 + if (!PyCapsule_IsValid(cobj, sig)) { + PyErr_Format(PyExc_TypeError, + "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", + PyModule_GetName(module), funcname, sig, PyCapsule_GetName(cobj)); + goto bad; + } + tmp.p = PyCapsule_GetPointer(cobj, sig); +#else + {const char *desc, *s1, *s2; + desc = (const char *)PyCObject_GetDesc(cobj); + if (!desc) + goto bad; + s1 = desc; s2 = sig; + while (*s1 != '\0' && *s1 == *s2) { s1++; s2++; } + if (*s1 != *s2) { + PyErr_Format(PyExc_TypeError, + "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", + PyModule_GetName(module), funcname, sig, desc); + goto bad; + } + tmp.p = PyCObject_AsVoidPtr(cobj);} +#endif + *f = tmp.fp; + if (!(*f)) + goto bad; + Py_DECREF(d); + return 0; +bad: + Py_XDECREF(d); + return -1; +} +#endif + +/* InitStrings */ +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { + while (t->p) { + #if PY_MAJOR_VERSION < 3 + if (t->is_unicode) { + *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); + } else if (t->intern) { + *t->p = PyString_InternFromString(t->s); + } else { + *t->p = PyString_FromStringAndSize(t->s, t->n - 1); + } + #else + if (t->is_unicode | t->is_str) { + if (t->intern) { + *t->p = PyUnicode_InternFromString(t->s); + } else if (t->encoding) { + *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); + } else { + *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); + } + } else { + *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); + } + #endif + if (!*t->p) + return -1; + if (PyObject_Hash(*t->p) == -1) + return -1; + ++t; + } + return 0; +} + +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { + return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); +} +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { + Py_ssize_t ignore; + return __Pyx_PyObject_AsStringAndSize(o, &ignore); +} +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +#if !CYTHON_PEP393_ENABLED +static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { + char* defenc_c; + PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); + if (!defenc) return NULL; + defenc_c = PyBytes_AS_STRING(defenc); +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + { + char* end = defenc_c + PyBytes_GET_SIZE(defenc); + char* c; + for (c = defenc_c; c < end; c++) { + if ((unsigned char) (*c) >= 128) { + PyUnicode_AsASCIIString(o); + return NULL; + } + } + } +#endif + *length = PyBytes_GET_SIZE(defenc); + return defenc_c; +} +#else +static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { + if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + if (likely(PyUnicode_IS_ASCII(o))) { + *length = PyUnicode_GET_LENGTH(o); + return PyUnicode_AsUTF8(o); + } else { + PyUnicode_AsASCIIString(o); + return NULL; + } +#else + return PyUnicode_AsUTF8AndSize(o, length); +#endif +} +#endif +#endif +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT + if ( +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + __Pyx_sys_getdefaultencoding_not_ascii && +#endif + PyUnicode_Check(o)) { + return __Pyx_PyUnicode_AsStringAndSize(o, length); + } else +#endif +#if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) + if (PyByteArray_Check(o)) { + *length = PyByteArray_GET_SIZE(o); + return PyByteArray_AS_STRING(o); + } else +#endif + { + char* result; + int r = PyBytes_AsStringAndSize(o, &result, length); + if (unlikely(r < 0)) { + return NULL; + } else { + return result; + } + } +} +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { + int is_true = x == Py_True; + if (is_true | (x == Py_False) | (x == Py_None)) return is_true; + else return PyObject_IsTrue(x); +} +static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) { + int retval; + if (unlikely(!x)) return -1; + retval = __Pyx_PyObject_IsTrue(x); + Py_DECREF(x); + return retval; +} +static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) { +#if PY_MAJOR_VERSION >= 3 + if (PyLong_Check(result)) { + if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, + "__int__ returned non-int (type %.200s). " + "The ability to return an instance of a strict subclass of int " + "is deprecated, and may be removed in a future version of Python.", + Py_TYPE(result)->tp_name)) { + Py_DECREF(result); + return NULL; + } + return result; + } +#endif + PyErr_Format(PyExc_TypeError, + "__%.4s__ returned non-%.4s (type %.200s)", + type_name, type_name, Py_TYPE(result)->tp_name); + Py_DECREF(result); + return NULL; +} +static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { +#if CYTHON_USE_TYPE_SLOTS + PyNumberMethods *m; +#endif + const char *name = NULL; + PyObject *res = NULL; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x) || PyLong_Check(x))) +#else + if (likely(PyLong_Check(x))) +#endif + return __Pyx_NewRef(x); +#if CYTHON_USE_TYPE_SLOTS + m = Py_TYPE(x)->tp_as_number; + #if PY_MAJOR_VERSION < 3 + if (m && m->nb_int) { + name = "int"; + res = m->nb_int(x); + } + else if (m && m->nb_long) { + name = "long"; + res = m->nb_long(x); + } + #else + if (likely(m && m->nb_int)) { + name = "int"; + res = m->nb_int(x); + } + #endif +#else + if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { + res = PyNumber_Int(x); + } +#endif + if (likely(res)) { +#if PY_MAJOR_VERSION < 3 + if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) { +#else + if (unlikely(!PyLong_CheckExact(res))) { +#endif + return __Pyx_PyNumber_IntOrLongWrongResultType(res, name); + } + } + else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_TypeError, + "an integer is required"); + } + return res; +} +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { + Py_ssize_t ival; + PyObject *x; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_CheckExact(b))) { + if (sizeof(Py_ssize_t) >= sizeof(long)) + return PyInt_AS_LONG(b); + else + return PyInt_AsSsize_t(b); + } +#endif + if (likely(PyLong_CheckExact(b))) { + #if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)b)->ob_digit; + const Py_ssize_t size = Py_SIZE(b); + if (likely(__Pyx_sst_abs(size) <= 1)) { + ival = likely(size) ? digits[0] : 0; + if (size == -1) ival = -ival; + return ival; + } else { + switch (size) { + case 2: + if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { + return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -2: + if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case 3: + if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { + return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -3: + if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case 4: + if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { + return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -4: + if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + } + } + #endif + return PyLong_AsSsize_t(b); + } + x = PyNumber_Index(b); + if (!x) return -1; + ival = PyInt_AsSsize_t(x); + Py_DECREF(x); + return ival; +} +static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) { + return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False); +} +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { + return PyInt_FromSize_t(ival); +} + + +#endif /* Py_PYTHON_H */ diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_imap.html b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_imap.html new file mode 100644 index 00000000..cbce96e9 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_imap.html @@ -0,0 +1,2184 @@ + + + + + + Cython: _imap.py + + + +

Generated by Cython 0.29.2

+

+ Yellow lines hint at Python interaction.
+ Click on a line that starts with a "+" to see the C code that Cython generated for it. +

+

Raw output: _imap.c

+
+001: # -*- coding: utf-8 -*-
+
  __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
 002: # Copyright (c) 2018 gevent
+
 003: # cython: auto_pickle=False,embedsignature=True,always_allow_keywords=False,infer_types=True
+
 004: 
+
 005: """
+
 006: Iterators across greenlets or AsyncResult objects.
+
 007: 
+
 008: """
+
 009: from __future__ import absolute_import
+
 010: from __future__ import division
+
 011: from __future__ import print_function
+
 012: 
+
 013: 
+
+014: from gevent import _semaphore
+
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 14, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(__pyx_n_s_semaphore);
+  __Pyx_GIVEREF(__pyx_n_s_semaphore);
+  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_semaphore);
+  __pyx_t_2 = __Pyx_Import(__pyx_n_s_gevent, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 14, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_semaphore); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 14, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_semaphore, __pyx_t_1) < 0) __PYX_ERR(0, 14, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+015: from gevent import queue
+
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 15, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_queue);
+  __Pyx_GIVEREF(__pyx_n_s_queue);
+  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_queue);
+  __pyx_t_1 = __Pyx_Import(__pyx_n_s_gevent, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 15, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_queue); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 15, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_queue, __pyx_t_2) < 0) __PYX_ERR(0, 15, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 016: 
+
 017: 
+
+018: __all__ = [
+
  __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 18, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(__pyx_n_s_IMapUnordered);
+  __Pyx_GIVEREF(__pyx_n_s_IMapUnordered);
+  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_IMapUnordered);
+  __Pyx_INCREF(__pyx_n_s_IMap);
+  __Pyx_GIVEREF(__pyx_n_s_IMap);
+  PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_IMap);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_all, __pyx_t_1) < 0) __PYX_ERR(0, 18, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 019:     'IMapUnordered',
+
 020:     'IMap',
+
 021: ]
+
 022: 
+
+023: locals()['Greenlet'] = __import__('gevent').Greenlet
+
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin___import__, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 23, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_Greenlet); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 23, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_1 = __Pyx_Globals(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 23, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (unlikely(PyDict_SetItem(__pyx_t_1, __pyx_n_s_Greenlet, __pyx_t_2) < 0)) __PYX_ERR(0, 23, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+/* … */
+  __pyx_tuple_ = PyTuple_Pack(1, __pyx_n_s_gevent); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 23, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple_);
+  __Pyx_GIVEREF(__pyx_tuple_);
+
+024: locals()['Semaphore'] = _semaphore.Semaphore
+
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_semaphore); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 24, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_Semaphore); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 24, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_2 = __Pyx_Globals(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 24, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (unlikely(PyDict_SetItem(__pyx_t_2, __pyx_n_s_Semaphore, __pyx_t_1) < 0)) __PYX_ERR(0, 24, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+025: locals()['UnboundQueue'] = queue.UnboundQueue
+
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_queue); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 25, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_UnboundQueue); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 25, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_1 = __Pyx_Globals(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 25, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (unlikely(PyDict_SetItem(__pyx_t_1, __pyx_n_s_UnboundQueue, __pyx_t_2) < 0)) __PYX_ERR(0, 25, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
 026: 
+
 027: 
+
 028: class Failure(object):
+
+029:     __slots__ = ('exc', 'raise_exception')
+
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6__imap_Failure->tp_dict, __pyx_n_s_slots, __pyx_tuple__2) < 0) __PYX_ERR(0, 29, __pyx_L1_error)
+  PyType_Modified(__pyx_ptype_6gevent_6__imap_Failure);
+/* … */
+  __pyx_tuple__2 = PyTuple_Pack(2, __pyx_n_s_exc, __pyx_n_s_raise_exception); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 29, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__2);
+  __Pyx_GIVEREF(__pyx_tuple__2);
+
 030: 
+
+031:     def __init__(self, exc, raise_exception=None):
+
/* Python wrapper */
+static int __pyx_pw_6gevent_6__imap_7Failure_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static int __pyx_pw_6gevent_6__imap_7Failure_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_exc = 0;
+  PyObject *__pyx_v_raise_exception = 0;
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_exc,&__pyx_n_s_raise_exception,0};
+    PyObject* values[2] = {0,0};
+    values[1] = ((PyObject *)Py_None);
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_exc)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_raise_exception);
+          if (value) { values[1] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 31, __pyx_L3_error)
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    __pyx_v_exc = values[0];
+    __pyx_v_raise_exception = values[1];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 31, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.__imap.Failure.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return -1;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_6__imap_7Failure___init__(((struct __pyx_obj_6gevent_6__imap_Failure *)__pyx_v_self), __pyx_v_exc, __pyx_v_raise_exception);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_6__imap_7Failure___init__(struct __pyx_obj_6gevent_6__imap_Failure *__pyx_v_self, PyObject *__pyx_v_exc, PyObject *__pyx_v_raise_exception) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = 0;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+032:         self.exc = exc
+
  __Pyx_INCREF(__pyx_v_exc);
+  __Pyx_GIVEREF(__pyx_v_exc);
+  __Pyx_GOTREF(__pyx_v_self->exc);
+  __Pyx_DECREF(__pyx_v_self->exc);
+  __pyx_v_self->exc = __pyx_v_exc;
+
+033:         self.raise_exception = raise_exception
+
  __Pyx_INCREF(__pyx_v_raise_exception);
+  __Pyx_GIVEREF(__pyx_v_raise_exception);
+  __Pyx_GOTREF(__pyx_v_self->raise_exception);
+  __Pyx_DECREF(__pyx_v_self->raise_exception);
+  __pyx_v_self->raise_exception = __pyx_v_raise_exception;
+
 034: 
+
 035: 
+
+036: def _raise_exc(failure):
+
static CYTHON_INLINE PyObject *__pyx_f_6gevent_6__imap__raise_exc(struct __pyx_obj_6gevent_6__imap_Failure *__pyx_v_failure) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_raise_exc", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_AddTraceback("gevent.__imap._raise_exc", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
 037:     # For cython.
+
+038:     if failure.raise_exception:
+
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_failure->raise_exception); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 38, __pyx_L1_error)
+  if (likely(__pyx_t_1)) {
+/* … */
+    goto __pyx_L3;
+  }
+
+039:         failure.raise_exception()
+
    __Pyx_INCREF(__pyx_v_failure->raise_exception);
+    __pyx_t_3 = __pyx_v_failure->raise_exception; __pyx_t_4 = NULL;
+    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
+      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+      if (likely(__pyx_t_4)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+        __Pyx_INCREF(__pyx_t_4);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_3, function);
+      }
+    }
+    __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
+    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 39, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
 040:     else:
+
+041:         raise failure.exc
+
  /*else*/ {
+    __Pyx_Raise(__pyx_v_failure->exc, 0, 0, 0);
+    __PYX_ERR(0, 41, __pyx_L1_error)
+  }
+  __pyx_L3:;
+
 042: 
+
+043: class IMapUnordered(Greenlet): # pylint:disable=undefined-variable
+
struct __pyx_vtabstruct_6gevent_6__imap_IMapUnordered {
+  struct __pyx_vtabstruct_6gevent_9_greenlet_Greenlet __pyx_base;
+  PyObject *(*_inext)(struct __pyx_obj_6gevent_6__imap_IMapUnordered *);
+  PyObject *(*_ispawn)(struct __pyx_obj_6gevent_6__imap_IMapUnordered *, PyObject *, PyObject *, int);
+  PyObject *(*_on_result)(struct __pyx_obj_6gevent_6__imap_IMapUnordered *, PyObject *, int __pyx_skip_dispatch);
+  PyObject *(*_on_finish)(struct __pyx_obj_6gevent_6__imap_IMapUnordered *, PyObject *);
+  PyObject *(*_iqueue_value_for_success)(struct __pyx_obj_6gevent_6__imap_IMapUnordered *, PyObject *);
+  PyObject *(*_iqueue_value_for_failure)(struct __pyx_obj_6gevent_6__imap_IMapUnordered *, PyObject *);
+  PyObject *(*_iqueue_value_for_self_finished)(struct __pyx_obj_6gevent_6__imap_IMapUnordered *);
+  PyObject *(*_iqueue_value_for_self_failure)(struct __pyx_obj_6gevent_6__imap_IMapUnordered *, PyObject *);
+};
+static struct __pyx_vtabstruct_6gevent_6__imap_IMapUnordered *__pyx_vtabptr_6gevent_6__imap_IMapUnordered;
+
+
 044:     """
+
 045:     At iterator of map results.
+
 046:     """
+
 047: 
+
+048:     def __init__(self, func, iterable, spawn, maxsize=None, _zipped=False):
+
/* Python wrapper */
+static int __pyx_pw_6gevent_6__imap_13IMapUnordered_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_6gevent_6__imap_13IMapUnordered___init__[] = "\n        An iterator that.\n\n        :param callable spawn: The function we use to create new greenlets.\n        :keyword int maxsize: If given and not-None, specifies the maximum number of\n            finished results that will be allowed to accumulated awaiting the reader;\n            more than that number of results will cause map function greenlets to begin\n            to block. This is most useful is there is a great disparity in the speed of\n            the mapping code and the consumer and the results consume a great deal of resources.\n            Using a bound is more computationally expensive than not using a bound.\n\n        .. versionchanged:: 1.1b3\n            Added the *maxsize* parameter.\n        ";
+#if CYTHON_COMPILING_IN_CPYTHON
+struct wrapperbase __pyx_wrapperbase_6gevent_6__imap_13IMapUnordered___init__;
+#endif
+static int __pyx_pw_6gevent_6__imap_13IMapUnordered_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_func = 0;
+  PyObject *__pyx_v_iterable = 0;
+  PyObject *__pyx_v_spawn = 0;
+  PyObject *__pyx_v_maxsize = 0;
+  PyObject *__pyx_v__zipped = 0;
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_func,&__pyx_n_s_iterable,&__pyx_n_s_spawn,&__pyx_n_s_maxsize,&__pyx_n_s_zipped,0};
+    PyObject* values[5] = {0,0,0,0,0};
+    values[3] = ((PyObject *)Py_None);
+    values[4] = ((PyObject *)Py_False);
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
+        CYTHON_FALLTHROUGH;
+        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
+        CYTHON_FALLTHROUGH;
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_func)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_iterable)) != 0)) kw_args--;
+        else {
+          __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 5, 1); __PYX_ERR(0, 48, __pyx_L3_error)
+        }
+        CYTHON_FALLTHROUGH;
+        case  2:
+        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_spawn)) != 0)) kw_args--;
+        else {
+          __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 5, 2); __PYX_ERR(0, 48, __pyx_L3_error)
+        }
+        CYTHON_FALLTHROUGH;
+        case  3:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_maxsize);
+          if (value) { values[3] = value; kw_args--; }
+        }
+        CYTHON_FALLTHROUGH;
+        case  4:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_zipped);
+          if (value) { values[4] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 48, __pyx_L3_error)
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
+        CYTHON_FALLTHROUGH;
+        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
+        CYTHON_FALLTHROUGH;
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    __pyx_v_func = values[0];
+    __pyx_v_iterable = values[1];
+    __pyx_v_spawn = values[2];
+    __pyx_v_maxsize = values[3];
+    __pyx_v__zipped = values[4];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 48, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.__imap.IMapUnordered.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return -1;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_6__imap_13IMapUnordered___init__(((struct __pyx_obj_6gevent_6__imap_IMapUnordered *)__pyx_v_self), __pyx_v_func, __pyx_v_iterable, __pyx_v_spawn, __pyx_v_maxsize, __pyx_v__zipped);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_6__imap_13IMapUnordered___init__(struct __pyx_obj_6gevent_6__imap_IMapUnordered *__pyx_v_self, PyObject *__pyx_v_func, PyObject *__pyx_v_iterable, PyObject *__pyx_v_spawn, PyObject *__pyx_v_maxsize, PyObject *__pyx_v__zipped) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = 0;
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_AddTraceback("gevent.__imap.IMapUnordered.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = -1;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
 049:         """
+
 050:         An iterator that.
+
 051: 
+
 052:         :param callable spawn: The function we use to create new greenlets.
+
 053:         :keyword int maxsize: If given and not-None, specifies the maximum number of
+
 054:             finished results that will be allowed to accumulated awaiting the reader;
+
 055:             more than that number of results will cause map function greenlets to begin
+
 056:             to block. This is most useful is there is a great disparity in the speed of
+
 057:             the mapping code and the consumer and the results consume a great deal of resources.
+
 058:             Using a bound is more computationally expensive than not using a bound.
+
 059: 
+
 060:         .. versionchanged:: 1.1b3
+
 061:             Added the *maxsize* parameter.
+
 062:         """
+
+063:         Greenlet.__init__(self) # pylint:disable=undefined-variable
+
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet), __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 63, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = NULL;
+  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+    if (likely(__pyx_t_3)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+      __Pyx_INCREF(__pyx_t_3);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_2, function);
+    }
+  }
+  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, ((PyObject *)__pyx_v_self)) : __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_v_self));
+  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 63, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+064:         self.spawn = spawn
+
  __Pyx_INCREF(__pyx_v_spawn);
+  __Pyx_GIVEREF(__pyx_v_spawn);
+  __Pyx_GOTREF(__pyx_v_self->spawn);
+  __Pyx_DECREF(__pyx_v_self->spawn);
+  __pyx_v_self->spawn = __pyx_v_spawn;
+
+065:         self._zipped = _zipped
+
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v__zipped); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 65, __pyx_L1_error)
+  __pyx_v_self->_zipped = __pyx_t_4;
+
+066:         self.func = func
+
  __Pyx_INCREF(__pyx_v_func);
+  __Pyx_GIVEREF(__pyx_v_func);
+  __Pyx_GOTREF(__pyx_v_self->func);
+  __Pyx_DECREF(__pyx_v_self->func);
+  __pyx_v_self->func = __pyx_v_func;
+
+067:         self.iterable = iterable
+
  __Pyx_INCREF(__pyx_v_iterable);
+  __Pyx_GIVEREF(__pyx_v_iterable);
+  __Pyx_GOTREF(__pyx_v_self->iterable);
+  __Pyx_DECREF(__pyx_v_self->iterable);
+  __pyx_v_self->iterable = __pyx_v_iterable;
+
+068:         self.queue = UnboundQueue() # pylint:disable=undefined-variable
+
  __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_6gevent_6_queue_UnboundQueue)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 68, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_1);
+  __Pyx_GOTREF(__pyx_v_self->queue);
+  __Pyx_DECREF(((PyObject *)__pyx_v_self->queue));
+  __pyx_v_self->queue = ((struct __pyx_obj_6gevent_6_queue_UnboundQueue *)__pyx_t_1);
+  __pyx_t_1 = 0;
+
 069: 
+
 070: 
+
+071:         if maxsize:
+
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_maxsize); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 71, __pyx_L1_error)
+  if (__pyx_t_4) {
+/* … */
+    goto __pyx_L3;
+  }
+
 072:             # Bounding the queue is not enough if we want to keep from
+
 073:             # accumulating objects; the result value will be around as
+
 074:             # the greenlet's result, blocked on self.queue.put(), and
+
 075:             # we'll go on to spawn another greenlet, which in turn can
+
 076:             # create the result. So we need a semaphore to prevent a
+
 077:             # greenlet from exiting while the queue is full so that we
+
 078:             # don't spawn the next greenlet (assuming that self.spawn
+
 079:             # is of course bounded). (Alternatively we could have the
+
 080:             # greenlet itself do the insert into the pool, but that
+
 081:             # takes some rework).
+
 082:             #
+
 083:             # Given the use of a semaphore at this level, sizing the queue becomes
+
 084:             # redundant, and that lets us avoid having to use self.link() instead
+
 085:             # of self.rawlink() to avoid having blocking methods called in the
+
 086:             # hub greenlet.
+
+087:             self._result_semaphore = Semaphore(maxsize) # pylint:disable=undefined-variable
+
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_6gevent_11__semaphore_Semaphore), __pyx_v_maxsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 87, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_GIVEREF(__pyx_t_1);
+    __Pyx_GOTREF(__pyx_v_self->_result_semaphore);
+    __Pyx_DECREF(((PyObject *)__pyx_v_self->_result_semaphore));
+    __pyx_v_self->_result_semaphore = ((struct __pyx_obj_6gevent_11__semaphore_Semaphore *)__pyx_t_1);
+    __pyx_t_1 = 0;
+
 088:         else:
+
+089:             self._result_semaphore = None
+
  /*else*/ {
+    __Pyx_INCREF(Py_None);
+    __Pyx_GIVEREF(Py_None);
+    __Pyx_GOTREF(__pyx_v_self->_result_semaphore);
+    __Pyx_DECREF(((PyObject *)__pyx_v_self->_result_semaphore));
+    __pyx_v_self->_result_semaphore = ((struct __pyx_obj_6gevent_11__semaphore_Semaphore *)Py_None);
+  }
+  __pyx_L3:;
+
 090: 
+
+091:         self._outstanding_tasks = 0
+
  __pyx_v_self->_outstanding_tasks = 0;
+
 092:         # The index (zero based) of the maximum number of
+
 093:         # results we will have.
+
+094:         self._max_index = -1
+
  __pyx_v_self->_max_index = -1;
+
+095:         self.finished = False
+
  __pyx_v_self->finished = 0;
+
 096: 
+
 097: 
+
 098:     # We're iterating in a different greenlet than we're running.
+
+099:     def __iter__(self):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6__imap_13IMapUnordered_3__iter__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_6__imap_13IMapUnordered_3__iter__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_6__imap_13IMapUnordered_2__iter__(((struct __pyx_obj_6gevent_6__imap_IMapUnordered *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6__imap_13IMapUnordered_2__iter__(struct __pyx_obj_6gevent_6__imap_IMapUnordered *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__iter__", 0);
+/* … */
+  /* function exit code */
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+100:         return self
+
  __Pyx_XDECREF(__pyx_r);
+  __Pyx_INCREF(((PyObject *)__pyx_v_self));
+  __pyx_r = ((PyObject *)__pyx_v_self);
+  goto __pyx_L0;
+
 101: 
+
+102:     def __next__(self):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6__imap_13IMapUnordered_5__next__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_6__imap_13IMapUnordered_5__next__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__next__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_6__imap_13IMapUnordered_4__next__(((struct __pyx_obj_6gevent_6__imap_IMapUnordered *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6__imap_13IMapUnordered_4__next__(struct __pyx_obj_6gevent_6__imap_IMapUnordered *__pyx_v_self) {
+  PyObject *__pyx_v_value = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__next__", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_AddTraceback("gevent.__imap.IMapUnordered.__next__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_value);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+103:         if self._result_semaphore is not None:
+
  __pyx_t_1 = (((PyObject *)__pyx_v_self->_result_semaphore) != Py_None);
+  __pyx_t_2 = (__pyx_t_1 != 0);
+  if (__pyx_t_2) {
+/* … */
+  }
+
+104:             self._result_semaphore.release()
+
    __pyx_t_3 = ((struct __pyx_vtabstruct_6gevent_11__semaphore_Semaphore *)__pyx_v_self->_result_semaphore->__pyx_base.__pyx_vtab)->release(__pyx_v_self->_result_semaphore, 0); if (unlikely(__pyx_t_3 == ((int)-1000))) __PYX_ERR(0, 104, __pyx_L1_error)
+
+105:         value = self._inext()
+
  __pyx_t_4 = ((struct __pyx_vtabstruct_6gevent_6__imap_IMapUnordered *)__pyx_v_self->__pyx_base.__pyx_vtab)->_inext(__pyx_v_self); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 105, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_4);
+  __pyx_v_value = __pyx_t_4;
+  __pyx_t_4 = 0;
+
+106:         if isinstance(value, Failure):
+
  __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_value, __pyx_ptype_6gevent_6__imap_Failure); 
+  __pyx_t_1 = (__pyx_t_2 != 0);
+  if (__pyx_t_1) {
+/* … */
+  }
+
+107:             _raise_exc(value)
+
    if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_6gevent_6__imap_Failure))))) __PYX_ERR(0, 107, __pyx_L1_error)
+    __pyx_t_4 = __pyx_f_6gevent_6__imap__raise_exc(((struct __pyx_obj_6gevent_6__imap_Failure *)__pyx_v_value)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 107, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+
+108:         return value
+
  __Pyx_XDECREF(__pyx_r);
+  __Pyx_INCREF(__pyx_v_value);
+  __pyx_r = __pyx_v_value;
+  goto __pyx_L0;
+
 109: 
+
+110:     next = __next__ # Py2
+
  __Pyx_GetNameInClass(__pyx_t_2, (PyObject *)__pyx_ptype_6gevent_6__imap_IMapUnordered, __pyx_n_s_next); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 110, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6__imap_IMapUnordered->tp_dict, __pyx_n_s_next_2, __pyx_t_2) < 0) __PYX_ERR(0, 110, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_6__imap_IMapUnordered);
+
 111: 
+
+112:     def _inext(self):
+
static PyObject *__pyx_f_6gevent_6__imap_13IMapUnordered__inext(struct __pyx_obj_6gevent_6__imap_IMapUnordered *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_inext", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.__imap.IMapUnordered._inext", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+113:         return self.queue.get()
+
  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_6_queue_UnboundQueue *)__pyx_v_self->queue->__pyx_base.__pyx_vtab)->__pyx_base.get(((struct __pyx_obj_6gevent_6_queue_Queue *)__pyx_v_self->queue), 0, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 113, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
 114: 
+
+115:     def _ispawn(self, func, item, item_index):
+
static PyObject *__pyx_f_6gevent_6__imap_13IMapUnordered__ispawn(struct __pyx_obj_6gevent_6__imap_IMapUnordered *__pyx_v_self, PyObject *__pyx_v_func, PyObject *__pyx_v_item, int __pyx_v_item_index) {
+  PyObject *__pyx_v_g = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_ispawn", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_XDECREF(__pyx_t_6);
+  __Pyx_XDECREF(__pyx_t_8);
+  __Pyx_AddTraceback("gevent.__imap.IMapUnordered._ispawn", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_g);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+116:         if self._result_semaphore is not None:
+
  __pyx_t_1 = (((PyObject *)__pyx_v_self->_result_semaphore) != Py_None);
+  __pyx_t_2 = (__pyx_t_1 != 0);
+  if (__pyx_t_2) {
+/* … */
+  }
+
+117:             self._result_semaphore.acquire()
+
    __pyx_t_2 = ((struct __pyx_vtabstruct_6gevent_11__semaphore_Semaphore *)__pyx_v_self->_result_semaphore->__pyx_base.__pyx_vtab)->acquire(__pyx_v_self->_result_semaphore, 0, NULL); if (unlikely(__pyx_t_2 == ((int)-1000))) __PYX_ERR(0, 117, __pyx_L1_error)
+
+118:         self._outstanding_tasks += 1
+
  __pyx_v_self->_outstanding_tasks = (__pyx_v_self->_outstanding_tasks + 1);
+
+119:         g = self.spawn(func, item) if not self._zipped else self.spawn(func, *item)
+
  if (((!(__pyx_v_self->_zipped != 0)) != 0)) {
+    __Pyx_INCREF(__pyx_v_self->spawn);
+    __pyx_t_5 = __pyx_v_self->spawn; __pyx_t_6 = NULL;
+    __pyx_t_7 = 0;
+    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
+      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
+      if (likely(__pyx_t_6)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
+        __Pyx_INCREF(__pyx_t_6);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_5, function);
+        __pyx_t_7 = 1;
+      }
+    }
+    #if CYTHON_FAST_PYCALL
+    if (PyFunction_Check(__pyx_t_5)) {
+      PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_func, __pyx_v_item};
+      __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 119, __pyx_L1_error)
+      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+      __Pyx_GOTREF(__pyx_t_4);
+    } else
+    #endif
+    #if CYTHON_FAST_PYCCALL
+    if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
+      PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_func, __pyx_v_item};
+      __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 119, __pyx_L1_error)
+      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+      __Pyx_GOTREF(__pyx_t_4);
+    } else
+    #endif
+    {
+      __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 119, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_8);
+      if (__pyx_t_6) {
+        __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL;
+      }
+      __Pyx_INCREF(__pyx_v_func);
+      __Pyx_GIVEREF(__pyx_v_func);
+      PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_v_func);
+      __Pyx_INCREF(__pyx_v_item);
+      __Pyx_GIVEREF(__pyx_v_item);
+      PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_item);
+      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 119, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_4);
+      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+    }
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __pyx_t_3 = __pyx_t_4;
+    __pyx_t_4 = 0;
+  } else {
+    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 119, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_INCREF(__pyx_v_func);
+    __Pyx_GIVEREF(__pyx_v_func);
+    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_func);
+    __pyx_t_5 = __Pyx_PySequence_Tuple(__pyx_v_item); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 119, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_5);
+    __pyx_t_8 = PyNumber_Add(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 119, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_8);
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_v_self->spawn, __pyx_t_8, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 119, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_5);
+    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+    __pyx_t_3 = __pyx_t_5;
+    __pyx_t_5 = 0;
+  }
+  __pyx_v_g = __pyx_t_3;
+  __pyx_t_3 = 0;
+
+120:         g._imap_task_index = item_index
+
  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_item_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 120, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  if (__Pyx_PyObject_SetAttrStr(__pyx_v_g, __pyx_n_s_imap_task_index, __pyx_t_3) < 0) __PYX_ERR(0, 120, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+
+121:         g.rawlink(self._on_result)
+
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_g, __pyx_n_s_rawlink); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 121, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_5);
+  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_on_result); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 121, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_8);
+  __pyx_t_4 = NULL;
+  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
+    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
+    if (likely(__pyx_t_4)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
+      __Pyx_INCREF(__pyx_t_4);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_5, function);
+    }
+  }
+  __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_4, __pyx_t_8) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_8);
+  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 121, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+
+122:         return g
+
  __Pyx_XDECREF(__pyx_r);
+  __Pyx_INCREF(__pyx_v_g);
+  __pyx_r = __pyx_v_g;
+  goto __pyx_L0;
+
 123: 
+
+124:     def _run(self): # pylint:disable=method-hidden
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6__imap_13IMapUnordered_7_run(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6gevent_6__imap_13IMapUnordered_6_run[] = "IMapUnordered._run(self)";
+static PyMethodDef __pyx_mdef_6gevent_6__imap_13IMapUnordered_7_run = {"_run", (PyCFunction)__pyx_pw_6gevent_6__imap_13IMapUnordered_7_run, METH_NOARGS, __pyx_doc_6gevent_6__imap_13IMapUnordered_6_run};
+static PyObject *__pyx_pw_6gevent_6__imap_13IMapUnordered_7_run(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_run (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_6__imap_13IMapUnordered_6_run(((struct __pyx_obj_6gevent_6__imap_IMapUnordered *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6__imap_13IMapUnordered_6_run(struct __pyx_obj_6gevent_6__imap_IMapUnordered *__pyx_v_self) {
+  PyObject *__pyx_v_func = NULL;
+  PyObject *__pyx_v_item = NULL;
+  PyObject *__pyx_v_e = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_run", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_7);
+  __Pyx_XDECREF(__pyx_t_9);
+  __Pyx_XDECREF(__pyx_t_10);
+  __Pyx_AddTraceback("gevent.__imap.IMapUnordered._run", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_func);
+  __Pyx_XDECREF(__pyx_v_item);
+  __Pyx_XDECREF(__pyx_v_e);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__3 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_func, __pyx_n_s_item, __pyx_n_s_e); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 124, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__3);
+  __Pyx_GIVEREF(__pyx_tuple__3);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6__imap_13IMapUnordered_7_run, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_IMapUnordered__run, NULL, __pyx_n_s_gevent___imap, __pyx_d, ((PyObject *)__pyx_codeobj__4)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 124, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6__imap_IMapUnordered->tp_dict, __pyx_n_s_run, __pyx_t_2) < 0) __PYX_ERR(0, 124, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_6__imap_IMapUnordered);
+  __pyx_codeobj__4 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__3, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__imap_py, __pyx_n_s_run, 124, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__4)) __PYX_ERR(0, 124, __pyx_L1_error)
+
+125:         try:
+
  /*try:*/ {
+    {
+      /*try:*/ {
+/* … */
+      }
+      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+      goto __pyx_L11_try_end;
+      __pyx_L6_error:;
+      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+/* … */
+      __Pyx_XGIVEREF(__pyx_t_1);
+      __Pyx_XGIVEREF(__pyx_t_2);
+      __Pyx_XGIVEREF(__pyx_t_3);
+      __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
+      goto __pyx_L4_error;
+      __pyx_L11_try_end:;
+    }
+  }
+
+126:             func = self.func
+
        __pyx_t_4 = __pyx_v_self->func;
+        __Pyx_INCREF(__pyx_t_4);
+        __pyx_v_func = __pyx_t_4;
+        __pyx_t_4 = 0;
+
+127:             for item in self.iterable:
+
        if (likely(PyList_CheckExact(__pyx_v_self->iterable)) || PyTuple_CheckExact(__pyx_v_self->iterable)) {
+          __pyx_t_4 = __pyx_v_self->iterable; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0;
+          __pyx_t_6 = NULL;
+        } else {
+          __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_self->iterable); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 127, __pyx_L6_error)
+          __Pyx_GOTREF(__pyx_t_4);
+          __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 127, __pyx_L6_error)
+        }
+        for (;;) {
+          if (likely(!__pyx_t_6)) {
+            if (likely(PyList_CheckExact(__pyx_t_4))) {
+              if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break;
+              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+              __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 127, __pyx_L6_error)
+              #else
+              __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 127, __pyx_L6_error)
+              __Pyx_GOTREF(__pyx_t_7);
+              #endif
+            } else {
+              if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
+              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+              __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 127, __pyx_L6_error)
+              #else
+              __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 127, __pyx_L6_error)
+              __Pyx_GOTREF(__pyx_t_7);
+              #endif
+            }
+          } else {
+            __pyx_t_7 = __pyx_t_6(__pyx_t_4);
+            if (unlikely(!__pyx_t_7)) {
+              PyObject* exc_type = PyErr_Occurred();
+              if (exc_type) {
+                if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+                else __PYX_ERR(0, 127, __pyx_L6_error)
+              }
+              break;
+            }
+            __Pyx_GOTREF(__pyx_t_7);
+          }
+          __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_7);
+          __pyx_t_7 = 0;
+/* … */
+        }
+        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+
+128:                 self._max_index += 1
+
          __pyx_v_self->_max_index = (__pyx_v_self->_max_index + 1);
+
+129:                 self._ispawn(func, item, self._max_index)
+
          __pyx_t_7 = ((struct __pyx_vtabstruct_6gevent_6__imap_IMapUnordered *)__pyx_v_self->__pyx_base.__pyx_vtab)->_ispawn(__pyx_v_self, __pyx_v_func, __pyx_v_item, __pyx_v_self->_max_index); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 129, __pyx_L6_error)
+          __Pyx_GOTREF(__pyx_t_7);
+          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+
+130:             self._on_finish(None)
+
        __pyx_t_4 = ((struct __pyx_vtabstruct_6gevent_6__imap_IMapUnordered *)__pyx_v_self->__pyx_base.__pyx_vtab)->_on_finish(__pyx_v_self, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 130, __pyx_L6_error)
+        __Pyx_GOTREF(__pyx_t_4);
+        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+
+131:         except BaseException as e:
+
      __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_BaseException);
+      if (__pyx_t_8) {
+        __Pyx_AddTraceback("gevent.__imap.IMapUnordered._run", __pyx_clineno, __pyx_lineno, __pyx_filename);
+        if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_7, &__pyx_t_9) < 0) __PYX_ERR(0, 131, __pyx_L8_except_error)
+        __Pyx_GOTREF(__pyx_t_4);
+        __Pyx_GOTREF(__pyx_t_7);
+        __Pyx_GOTREF(__pyx_t_9);
+        __Pyx_INCREF(__pyx_t_7);
+        __pyx_v_e = __pyx_t_7;
+        /*try:*/ {
+/* … */
+        /*finally:*/ {
+          __pyx_L19_error:;
+          /*exception exit:*/{
+            __Pyx_PyThreadState_declare
+            __Pyx_PyThreadState_assign
+            __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0;
+            __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
+            if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18);
+            if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15) < 0)) __Pyx_ErrFetch(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15);
+            __Pyx_XGOTREF(__pyx_t_13);
+            __Pyx_XGOTREF(__pyx_t_14);
+            __Pyx_XGOTREF(__pyx_t_15);
+            __Pyx_XGOTREF(__pyx_t_16);
+            __Pyx_XGOTREF(__pyx_t_17);
+            __Pyx_XGOTREF(__pyx_t_18);
+            __pyx_t_8 = __pyx_lineno; __pyx_t_11 = __pyx_clineno; __pyx_t_12 = __pyx_filename;
+            {
+              __Pyx_DECREF(__pyx_v_e);
+              __pyx_v_e = NULL;
+            }
+            if (PY_MAJOR_VERSION >= 3) {
+              __Pyx_XGIVEREF(__pyx_t_16);
+              __Pyx_XGIVEREF(__pyx_t_17);
+              __Pyx_XGIVEREF(__pyx_t_18);
+              __Pyx_ExceptionReset(__pyx_t_16, __pyx_t_17, __pyx_t_18);
+            }
+            __Pyx_XGIVEREF(__pyx_t_13);
+            __Pyx_XGIVEREF(__pyx_t_14);
+            __Pyx_XGIVEREF(__pyx_t_15);
+            __Pyx_ErrRestore(__pyx_t_13, __pyx_t_14, __pyx_t_15);
+            __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0;
+            __pyx_lineno = __pyx_t_8; __pyx_clineno = __pyx_t_11; __pyx_filename = __pyx_t_12;
+            goto __pyx_L8_except_error;
+          }
+        }
+      }
+      goto __pyx_L8_except_error;
+      __pyx_L8_except_error:;
+
+132:             self._on_finish(e)
+
          __pyx_t_10 = ((struct __pyx_vtabstruct_6gevent_6__imap_IMapUnordered *)__pyx_v_self->__pyx_base.__pyx_vtab)->_on_finish(__pyx_v_self, __pyx_v_e); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 132, __pyx_L19_error)
+          __Pyx_GOTREF(__pyx_t_10);
+          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+
+133:             raise
+
          __Pyx_GIVEREF(__pyx_t_4);
+          __Pyx_GIVEREF(__pyx_t_7);
+          __Pyx_XGIVEREF(__pyx_t_9);
+          __Pyx_ErrRestoreWithState(__pyx_t_4, __pyx_t_7, __pyx_t_9);
+          __pyx_t_4 = 0; __pyx_t_7 = 0; __pyx_t_9 = 0; 
+          __PYX_ERR(0, 133, __pyx_L19_error)
+        }
+
 134:         finally:
+
+135:             self.spawn = None
+
  /*finally:*/ {
+    /*normal exit:*/{
+      __Pyx_INCREF(Py_None);
+      __Pyx_GIVEREF(Py_None);
+      __Pyx_GOTREF(__pyx_v_self->spawn);
+      __Pyx_DECREF(__pyx_v_self->spawn);
+      __pyx_v_self->spawn = Py_None;
+/* … */
+        __Pyx_INCREF(Py_None);
+        __Pyx_GIVEREF(Py_None);
+        __Pyx_GOTREF(__pyx_v_self->spawn);
+        __Pyx_DECREF(__pyx_v_self->spawn);
+        __pyx_v_self->spawn = Py_None;
+
+136:             self.func = None
+
      __Pyx_INCREF(Py_None);
+      __Pyx_GIVEREF(Py_None);
+      __Pyx_GOTREF(__pyx_v_self->func);
+      __Pyx_DECREF(__pyx_v_self->func);
+      __pyx_v_self->func = Py_None;
+/* … */
+        __Pyx_INCREF(Py_None);
+        __Pyx_GIVEREF(Py_None);
+        __Pyx_GOTREF(__pyx_v_self->func);
+        __Pyx_DECREF(__pyx_v_self->func);
+        __pyx_v_self->func = Py_None;
+
+137:             self.iterable = None
+
      __Pyx_INCREF(Py_None);
+      __Pyx_GIVEREF(Py_None);
+      __Pyx_GOTREF(__pyx_v_self->iterable);
+      __Pyx_DECREF(__pyx_v_self->iterable);
+      __pyx_v_self->iterable = Py_None;
+/* … */
+        __Pyx_INCREF(Py_None);
+        __Pyx_GIVEREF(Py_None);
+        __Pyx_GOTREF(__pyx_v_self->iterable);
+        __Pyx_DECREF(__pyx_v_self->iterable);
+        __pyx_v_self->iterable = Py_None;
+
+138:             self._result_semaphore = None
+
      __Pyx_INCREF(Py_None);
+      __Pyx_GIVEREF(Py_None);
+      __Pyx_GOTREF(__pyx_v_self->_result_semaphore);
+      __Pyx_DECREF(((PyObject *)__pyx_v_self->_result_semaphore));
+      __pyx_v_self->_result_semaphore = ((struct __pyx_obj_6gevent_11__semaphore_Semaphore *)Py_None);
+      goto __pyx_L5;
+    }
+    __pyx_L4_error:;
+    /*exception exit:*/{
+      __Pyx_PyThreadState_declare
+      __Pyx_PyThreadState_assign
+      __pyx_t_3 = 0; __pyx_t_2 = 0; __pyx_t_1 = 0; __pyx_t_18 = 0; __pyx_t_17 = 0; __pyx_t_16 = 0;
+      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
+      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
+      if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_18, &__pyx_t_17, &__pyx_t_16);
+      if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_3, &__pyx_t_2, &__pyx_t_1) < 0)) __Pyx_ErrFetch(&__pyx_t_3, &__pyx_t_2, &__pyx_t_1);
+      __Pyx_XGOTREF(__pyx_t_3);
+      __Pyx_XGOTREF(__pyx_t_2);
+      __Pyx_XGOTREF(__pyx_t_1);
+      __Pyx_XGOTREF(__pyx_t_18);
+      __Pyx_XGOTREF(__pyx_t_17);
+      __Pyx_XGOTREF(__pyx_t_16);
+      __pyx_t_11 = __pyx_lineno; __pyx_t_8 = __pyx_clineno; __pyx_t_19 = __pyx_filename;
+      {
+/* … */
+        __Pyx_INCREF(Py_None);
+        __Pyx_GIVEREF(Py_None);
+        __Pyx_GOTREF(__pyx_v_self->_result_semaphore);
+        __Pyx_DECREF(((PyObject *)__pyx_v_self->_result_semaphore));
+        __pyx_v_self->_result_semaphore = ((struct __pyx_obj_6gevent_11__semaphore_Semaphore *)Py_None);
+      }
+      if (PY_MAJOR_VERSION >= 3) {
+        __Pyx_XGIVEREF(__pyx_t_18);
+        __Pyx_XGIVEREF(__pyx_t_17);
+        __Pyx_XGIVEREF(__pyx_t_16);
+        __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_17, __pyx_t_16);
+      }
+      __Pyx_XGIVEREF(__pyx_t_3);
+      __Pyx_XGIVEREF(__pyx_t_2);
+      __Pyx_XGIVEREF(__pyx_t_1);
+      __Pyx_ErrRestore(__pyx_t_3, __pyx_t_2, __pyx_t_1);
+      __pyx_t_3 = 0; __pyx_t_2 = 0; __pyx_t_1 = 0; __pyx_t_18 = 0; __pyx_t_17 = 0; __pyx_t_16 = 0;
+      __pyx_lineno = __pyx_t_11; __pyx_clineno = __pyx_t_8; __pyx_filename = __pyx_t_19;
+      goto __pyx_L1_error;
+    }
+    __pyx_L5:;
+  }
+
 139: 
+
+140:     def _on_result(self, greenlet):
+
static PyObject *__pyx_pw_6gevent_6__imap_13IMapUnordered_9_on_result(PyObject *__pyx_v_self, PyObject *__pyx_v_greenlet); /*proto*/
+static PyObject *__pyx_f_6gevent_6__imap_13IMapUnordered__on_result(struct __pyx_obj_6gevent_6__imap_IMapUnordered *__pyx_v_self, PyObject *__pyx_v_greenlet, int __pyx_skip_dispatch) {
+  int __pyx_v_count;
+  int __pyx_v_finished;
+  int __pyx_v_ready;
+  int __pyx_v_put_finished;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_on_result", 0);
+  /* Check if called by wrapper */
+  if (unlikely(__pyx_skip_dispatch)) ;
+  /* Check if overridden in Python */
+  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
+    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
+    if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
+    else {
+      PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      #endif
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_on_result); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 140, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_6__imap_13IMapUnordered_9_on_result)) {
+        __Pyx_XDECREF(__pyx_r);
+        __Pyx_INCREF(__pyx_t_1);
+        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+          if (likely(__pyx_t_4)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+            __Pyx_INCREF(__pyx_t_4);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_3, function);
+          }
+        }
+        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_greenlet) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_greenlet);
+        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 140, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __pyx_r = __pyx_t_2;
+        __pyx_t_2 = 0;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        goto __pyx_L0;
+      }
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+      tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
+      if (unlikely(type_dict_guard != tp_dict_version)) {
+        tp_dict_version = obj_dict_version = 0;
+      }
+      #endif
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    }
+    #endif
+  }
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_AddTraceback("gevent.__imap.IMapUnordered._on_result", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6__imap_13IMapUnordered_9_on_result(PyObject *__pyx_v_self, PyObject *__pyx_v_greenlet); /*proto*/
+static char __pyx_doc_6gevent_6__imap_13IMapUnordered_8_on_result[] = "IMapUnordered._on_result(self, greenlet)";
+static PyMethodDef __pyx_mdef_6gevent_6__imap_13IMapUnordered_9_on_result = {"_on_result", (PyCFunction)__pyx_pw_6gevent_6__imap_13IMapUnordered_9_on_result, METH_O, __pyx_doc_6gevent_6__imap_13IMapUnordered_8_on_result};
+static PyObject *__pyx_pw_6gevent_6__imap_13IMapUnordered_9_on_result(PyObject *__pyx_v_self, PyObject *__pyx_v_greenlet) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_on_result (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_6__imap_13IMapUnordered_8_on_result(((struct __pyx_obj_6gevent_6__imap_IMapUnordered *)__pyx_v_self), ((PyObject *)__pyx_v_greenlet));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6__imap_13IMapUnordered_8_on_result(struct __pyx_obj_6gevent_6__imap_IMapUnordered *__pyx_v_self, PyObject *__pyx_v_greenlet) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_on_result", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __pyx_f_6gevent_6__imap_13IMapUnordered__on_result(__pyx_v_self, __pyx_v_greenlet, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 140, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.__imap.IMapUnordered._on_result", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__5 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_greenlet); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 140, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__5);
+  __Pyx_GIVEREF(__pyx_tuple__5);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6__imap_13IMapUnordered_9_on_result, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_IMapUnordered__on_result, NULL, __pyx_n_s_gevent___imap, __pyx_d, ((PyObject *)__pyx_codeobj__6)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 140, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6__imap_IMapUnordered->tp_dict, __pyx_n_s_on_result, __pyx_t_2) < 0) __PYX_ERR(0, 140, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_6__imap_IMapUnordered);
+
 141:         # This method will be called in the hub greenlet (we rawlink)
+
+142:         self._outstanding_tasks -= 1
+
  __pyx_v_self->_outstanding_tasks = (__pyx_v_self->_outstanding_tasks - 1);
+
+143:         count = self._outstanding_tasks
+
  __pyx_t_5 = __pyx_v_self->_outstanding_tasks;
+  __pyx_v_count = __pyx_t_5;
+
+144:         finished = self.finished
+
  __pyx_t_6 = __pyx_v_self->finished;
+  __pyx_v_finished = __pyx_t_6;
+
+145:         ready = self.ready()
+
  __pyx_v_ready = ((struct __pyx_vtabstruct_6gevent_6__imap_IMapUnordered *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.ready(((struct __pyx_obj_6gevent_9_greenlet_Greenlet *)__pyx_v_self), 0);
+
+146:         put_finished = False
+
  __pyx_v_put_finished = 0;
+
 147: 
+
+148:         if ready and count <= 0 and not finished:
+
  __pyx_t_7 = (__pyx_v_ready != 0);
+  if (__pyx_t_7) {
+  } else {
+    __pyx_t_6 = __pyx_t_7;
+    goto __pyx_L4_bool_binop_done;
+  }
+  __pyx_t_7 = ((__pyx_v_count <= 0) != 0);
+  if (__pyx_t_7) {
+  } else {
+    __pyx_t_6 = __pyx_t_7;
+    goto __pyx_L4_bool_binop_done;
+  }
+  __pyx_t_7 = ((!(__pyx_v_finished != 0)) != 0);
+  __pyx_t_6 = __pyx_t_7;
+  __pyx_L4_bool_binop_done:;
+  if (__pyx_t_6) {
+/* … */
+  }
+
+149:             finished = self.finished = True
+
    __pyx_v_finished = 1;
+    __pyx_v_self->finished = 1;
+
+150:             put_finished = True
+
    __pyx_v_put_finished = 1;
+
 151: 
+
+152:         if greenlet.successful():
+
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_greenlet, __pyx_n_s_successful); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 152, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = NULL;
+  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+    if (likely(__pyx_t_3)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+      __Pyx_INCREF(__pyx_t_3);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_2, function);
+    }
+  }
+  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 152, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 152, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  if (__pyx_t_6) {
+/* … */
+    goto __pyx_L7;
+  }
+
+153:             self.queue.put(self._iqueue_value_for_success(greenlet))
+
    __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_6__imap_IMapUnordered *)__pyx_v_self->__pyx_base.__pyx_vtab)->_iqueue_value_for_success(__pyx_v_self, __pyx_v_greenlet); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 153, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __pyx_t_2 = ((struct __pyx_vtabstruct_6gevent_6_queue_UnboundQueue *)__pyx_v_self->queue->__pyx_base.__pyx_vtab)->__pyx_base.put(((struct __pyx_obj_6gevent_6_queue_Queue *)__pyx_v_self->queue), __pyx_t_1, 0, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 153, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
 154:         else:
+
+155:             self.queue.put(self._iqueue_value_for_failure(greenlet))
+
  /*else*/ {
+    __pyx_t_2 = ((struct __pyx_vtabstruct_6gevent_6__imap_IMapUnordered *)__pyx_v_self->__pyx_base.__pyx_vtab)->_iqueue_value_for_failure(__pyx_v_self, __pyx_v_greenlet); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 155, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_6_queue_UnboundQueue *)__pyx_v_self->queue->__pyx_base.__pyx_vtab)->__pyx_base.put(((struct __pyx_obj_6gevent_6_queue_Queue *)__pyx_v_self->queue), __pyx_t_2, 0, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 155, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  }
+  __pyx_L7:;
+
 156: 
+
+157:         if put_finished:
+
  __pyx_t_6 = (__pyx_v_put_finished != 0);
+  if (__pyx_t_6) {
+/* … */
+  }
+
+158:             self.queue.put(self._iqueue_value_for_self_finished())
+
    __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_6__imap_IMapUnordered *)__pyx_v_self->__pyx_base.__pyx_vtab)->_iqueue_value_for_self_finished(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 158, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __pyx_t_2 = ((struct __pyx_vtabstruct_6gevent_6_queue_UnboundQueue *)__pyx_v_self->queue->__pyx_base.__pyx_vtab)->__pyx_base.put(((struct __pyx_obj_6gevent_6_queue_Queue *)__pyx_v_self->queue), __pyx_t_1, 0, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 158, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
 159: 
+
+160:     def _on_finish(self, exception):
+
static PyObject *__pyx_f_6gevent_6__imap_13IMapUnordered__on_finish(struct __pyx_obj_6gevent_6__imap_IMapUnordered *__pyx_v_self, PyObject *__pyx_v_exception) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_on_finish", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_AddTraceback("gevent.__imap.IMapUnordered._on_finish", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
 161:         # Called in this greenlet.
+
+162:         if self.finished:
+
  __pyx_t_1 = (__pyx_v_self->finished != 0);
+  if (__pyx_t_1) {
+/* … */
+  }
+
+163:             return
+
    __Pyx_XDECREF(__pyx_r);
+    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+    goto __pyx_L0;
+
 164: 
+
+165:         if exception is not None:
+
  __pyx_t_1 = (__pyx_v_exception != Py_None);
+  __pyx_t_2 = (__pyx_t_1 != 0);
+  if (__pyx_t_2) {
+/* … */
+  }
+
+166:             self.finished = True
+
    __pyx_v_self->finished = 1;
+
+167:             self.queue.put(self._iqueue_value_for_self_failure(exception))
+
    __pyx_t_3 = ((struct __pyx_vtabstruct_6gevent_6__imap_IMapUnordered *)__pyx_v_self->__pyx_base.__pyx_vtab)->_iqueue_value_for_self_failure(__pyx_v_self, __pyx_v_exception); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 167, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __pyx_t_4 = ((struct __pyx_vtabstruct_6gevent_6_queue_UnboundQueue *)__pyx_v_self->queue->__pyx_base.__pyx_vtab)->__pyx_base.put(((struct __pyx_obj_6gevent_6_queue_Queue *)__pyx_v_self->queue), __pyx_t_3, 0, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 167, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+
+168:             return
+
    __Pyx_XDECREF(__pyx_r);
+    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+    goto __pyx_L0;
+
 169: 
+
+170:         if self._outstanding_tasks <= 0:
+
  __pyx_t_2 = ((__pyx_v_self->_outstanding_tasks <= 0) != 0);
+  if (__pyx_t_2) {
+/* … */
+  }
+
+171:             self.finished = True
+
    __pyx_v_self->finished = 1;
+
+172:             self.queue.put(self._iqueue_value_for_self_finished())
+
    __pyx_t_4 = ((struct __pyx_vtabstruct_6gevent_6__imap_IMapUnordered *)__pyx_v_self->__pyx_base.__pyx_vtab)->_iqueue_value_for_self_finished(__pyx_v_self); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 172, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    __pyx_t_3 = ((struct __pyx_vtabstruct_6gevent_6_queue_UnboundQueue *)__pyx_v_self->queue->__pyx_base.__pyx_vtab)->__pyx_base.put(((struct __pyx_obj_6gevent_6_queue_Queue *)__pyx_v_self->queue), __pyx_t_4, 0, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 172, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+
 173: 
+
+174:     def _iqueue_value_for_success(self, greenlet):
+
static PyObject *__pyx_f_6gevent_6__imap_13IMapUnordered__iqueue_value_for_success(CYTHON_UNUSED struct __pyx_obj_6gevent_6__imap_IMapUnordered *__pyx_v_self, PyObject *__pyx_v_greenlet) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_iqueue_value_for_success", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.__imap.IMapUnordered._iqueue_value_for_success", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+175:         return greenlet.value
+
  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_greenlet, __pyx_n_s_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 175, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
 176: 
+
+177:     def _iqueue_value_for_failure(self, greenlet):
+
static PyObject *__pyx_f_6gevent_6__imap_13IMapUnordered__iqueue_value_for_failure(CYTHON_UNUSED struct __pyx_obj_6gevent_6__imap_IMapUnordered *__pyx_v_self, PyObject *__pyx_v_greenlet) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_iqueue_value_for_failure", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_AddTraceback("gevent.__imap.IMapUnordered._iqueue_value_for_failure", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+178:         return Failure(greenlet.exception, getattr(greenlet, '_raise_exception'))
+
  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_greenlet, __pyx_n_s_exception); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 178, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = __Pyx_GetAttr(__pyx_v_greenlet, __pyx_n_s_raise_exception_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 178, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 178, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_GIVEREF(__pyx_t_1);
+  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_2);
+  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
+  __pyx_t_1 = 0;
+  __pyx_t_2 = 0;
+  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6gevent_6__imap_Failure), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 178, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __pyx_r = __pyx_t_2;
+  __pyx_t_2 = 0;
+  goto __pyx_L0;
+
 179: 
+
+180:     def _iqueue_value_for_self_finished(self):
+
static PyObject *__pyx_f_6gevent_6__imap_13IMapUnordered__iqueue_value_for_self_finished(CYTHON_UNUSED struct __pyx_obj_6gevent_6__imap_IMapUnordered *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_iqueue_value_for_self_finished", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_AddTraceback("gevent.__imap.IMapUnordered._iqueue_value_for_self_finished", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+181:         return Failure(StopIteration())
+
  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_builtin_StopIteration); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 181, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_6gevent_6__imap_Failure), __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 181, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_r = __pyx_t_2;
+  __pyx_t_2 = 0;
+  goto __pyx_L0;
+
 182: 
+
+183:     def _iqueue_value_for_self_failure(self, exception):
+
static PyObject *__pyx_f_6gevent_6__imap_13IMapUnordered__iqueue_value_for_self_failure(struct __pyx_obj_6gevent_6__imap_IMapUnordered *__pyx_v_self, PyObject *__pyx_v_exception) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_iqueue_value_for_self_failure", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_AddTraceback("gevent.__imap.IMapUnordered._iqueue_value_for_self_failure", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+184:         return Failure(exception, self._raise_exception)
+
  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_raise_exception_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 184, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 184, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(__pyx_v_exception);
+  __Pyx_GIVEREF(__pyx_v_exception);
+  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_exception);
+  __Pyx_GIVEREF(__pyx_t_1);
+  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1);
+  __pyx_t_1 = 0;
+  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6gevent_6__imap_Failure), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 184, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
 185: 
+
 186: 
+
+187: class IMap(IMapUnordered):
+
struct __pyx_vtabstruct_6gevent_6__imap_IMap {
+  struct __pyx_vtabstruct_6gevent_6__imap_IMapUnordered __pyx_base;
+};
+static struct __pyx_vtabstruct_6gevent_6__imap_IMap *__pyx_vtabptr_6gevent_6__imap_IMap;
+
 188:     # A specialization of IMapUnordered that returns items
+
 189:     # in the order in which they were generated, not
+
 190:     # the order in which they finish.
+
 191: 
+
+192:     def __init__(self, *args, **kwargs):
+
/* Python wrapper */
+static int __pyx_pw_6gevent_6__imap_4IMap_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static int __pyx_pw_6gevent_6__imap_4IMap_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_args = 0;
+  PyObject *__pyx_v_kwargs = 0;
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
+  if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 1))) return -1;
+  if (unlikely(__pyx_kwds)) {
+    __pyx_v_kwargs = PyDict_Copy(__pyx_kwds); if (unlikely(!__pyx_v_kwargs)) return -1;
+    __Pyx_GOTREF(__pyx_v_kwargs);
+  } else {
+    __pyx_v_kwargs = NULL;
+  }
+  __Pyx_INCREF(__pyx_args);
+  __pyx_v_args = __pyx_args;
+  __pyx_r = __pyx_pf_6gevent_6__imap_4IMap___init__(((struct __pyx_obj_6gevent_6__imap_IMap *)__pyx_v_self), __pyx_v_args, __pyx_v_kwargs);
+
+  /* function exit code */
+  __Pyx_XDECREF(__pyx_v_args);
+  __Pyx_XDECREF(__pyx_v_kwargs);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_6__imap_4IMap___init__(struct __pyx_obj_6gevent_6__imap_IMap *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = 0;
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_AddTraceback("gevent.__imap.IMap.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = -1;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
 193:         # The result dictionary: {index: value}
+
+194:         self._results = {}
+
  __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 194, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_1);
+  __Pyx_GOTREF(__pyx_v_self->_results);
+  __Pyx_DECREF(__pyx_v_self->_results);
+  __pyx_v_self->_results = ((PyObject*)__pyx_t_1);
+  __pyx_t_1 = 0;
+
 195: 
+
 196:         # The index of the result to return next.
+
+197:         self.index = 0
+
  __pyx_v_self->index = 0;
+
+198:         IMapUnordered.__init__(self, *args, **kwargs)
+
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_6gevent_6__imap_IMapUnordered), __pyx_n_s_init); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 198, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 198, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(((PyObject *)__pyx_v_self));
+  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
+  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self));
+  __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_v_args); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 198, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 198, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
 199: 
+
+200:     def _inext(self):
+
static PyObject *__pyx_f_6gevent_6__imap_4IMap__inext(struct __pyx_obj_6gevent_6__imap_IMap *__pyx_v_self) {
+  int __pyx_v_index;
+  PyObject *__pyx_v_value = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_inext", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_XDECREF(__pyx_t_7);
+  __Pyx_XDECREF(__pyx_t_8);
+  __Pyx_XDECREF(__pyx_t_9);
+  __Pyx_XDECREF(__pyx_t_10);
+  __Pyx_XDECREF(__pyx_t_11);
+  __Pyx_AddTraceback("gevent.__imap.IMap._inext", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_value);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+201:         try:
+
  {
+    /*try:*/ {
+/* … */
+    }
+    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+    goto __pyx_L8_try_end;
+    __pyx_L3_error:;
+    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+/* … */
+    __Pyx_XGIVEREF(__pyx_t_1);
+    __Pyx_XGIVEREF(__pyx_t_2);
+    __Pyx_XGIVEREF(__pyx_t_3);
+    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
+    goto __pyx_L1_error;
+    __pyx_L4_exception_handled:;
+    __Pyx_XGIVEREF(__pyx_t_1);
+    __Pyx_XGIVEREF(__pyx_t_2);
+    __Pyx_XGIVEREF(__pyx_t_3);
+    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
+    __pyx_L8_try_end:;
+  }
+
+202:             value = self._results.pop(self.index)
+
      if (unlikely(__pyx_v_self->_results == Py_None)) {
+        PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "pop");
+        __PYX_ERR(0, 202, __pyx_L3_error)
+      }
+      __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_self->index); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 202, __pyx_L3_error)
+      __Pyx_GOTREF(__pyx_t_4);
+      __pyx_t_5 = __Pyx_PyDict_Pop(__pyx_v_self->_results, __pyx_t_4, ((PyObject *)NULL)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 202, __pyx_L3_error)
+      __Pyx_GOTREF(__pyx_t_5);
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __pyx_v_value = __pyx_t_5;
+      __pyx_t_5 = 0;
+
+203:         except KeyError:
+
    __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
+    if (__pyx_t_6) {
+      __Pyx_AddTraceback("gevent.__imap.IMap._inext", __pyx_clineno, __pyx_lineno, __pyx_filename);
+      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_4, &__pyx_t_7) < 0) __PYX_ERR(0, 203, __pyx_L5_except_error)
+      __Pyx_GOTREF(__pyx_t_5);
+      __Pyx_GOTREF(__pyx_t_4);
+      __Pyx_GOTREF(__pyx_t_7);
+
 204:             # Wait for our index to finish.
+
+205:             while 1:
+
      while (1) {
+
+206:                 index, value = self.queue.get()
+
        __pyx_t_8 = ((struct __pyx_vtabstruct_6gevent_6_queue_UnboundQueue *)__pyx_v_self->__pyx_base.queue->__pyx_base.__pyx_vtab)->__pyx_base.get(((struct __pyx_obj_6gevent_6_queue_Queue *)__pyx_v_self->__pyx_base.queue), 0, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 206, __pyx_L5_except_error)
+        __Pyx_GOTREF(__pyx_t_8);
+        if ((likely(PyTuple_CheckExact(__pyx_t_8))) || (PyList_CheckExact(__pyx_t_8))) {
+          PyObject* sequence = __pyx_t_8;
+          Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
+          if (unlikely(size != 2)) {
+            if (size > 2) __Pyx_RaiseTooManyValuesError(2);
+            else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
+            __PYX_ERR(0, 206, __pyx_L5_except_error)
+          }
+          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+          if (likely(PyTuple_CheckExact(sequence))) {
+            __pyx_t_9 = PyTuple_GET_ITEM(sequence, 0); 
+            __pyx_t_10 = PyTuple_GET_ITEM(sequence, 1); 
+          } else {
+            __pyx_t_9 = PyList_GET_ITEM(sequence, 0); 
+            __pyx_t_10 = PyList_GET_ITEM(sequence, 1); 
+          }
+          __Pyx_INCREF(__pyx_t_9);
+          __Pyx_INCREF(__pyx_t_10);
+          #else
+          __pyx_t_9 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 206, __pyx_L5_except_error)
+          __Pyx_GOTREF(__pyx_t_9);
+          __pyx_t_10 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 206, __pyx_L5_except_error)
+          __Pyx_GOTREF(__pyx_t_10);
+          #endif
+          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+        } else {
+          Py_ssize_t index = -1;
+          __pyx_t_11 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 206, __pyx_L5_except_error)
+          __Pyx_GOTREF(__pyx_t_11);
+          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+          __pyx_t_12 = Py_TYPE(__pyx_t_11)->tp_iternext;
+          index = 0; __pyx_t_9 = __pyx_t_12(__pyx_t_11); if (unlikely(!__pyx_t_9)) goto __pyx_L13_unpacking_failed;
+          __Pyx_GOTREF(__pyx_t_9);
+          index = 1; __pyx_t_10 = __pyx_t_12(__pyx_t_11); if (unlikely(!__pyx_t_10)) goto __pyx_L13_unpacking_failed;
+          __Pyx_GOTREF(__pyx_t_10);
+          if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_11), 2) < 0) __PYX_ERR(0, 206, __pyx_L5_except_error)
+          __pyx_t_12 = NULL;
+          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+          goto __pyx_L14_unpacking_done;
+          __pyx_L13_unpacking_failed:;
+          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+          __pyx_t_12 = NULL;
+          if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
+          __PYX_ERR(0, 206, __pyx_L5_except_error)
+          __pyx_L14_unpacking_done:;
+        }
+        __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_t_9); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 206, __pyx_L5_except_error)
+        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+        __pyx_v_index = __pyx_t_6;
+        __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_10);
+        __pyx_t_10 = 0;
+
+207:                 if index == self.index:
+
        __pyx_t_13 = ((__pyx_v_index == __pyx_v_self->index) != 0);
+        if (__pyx_t_13) {
+/* … */
+        }
+
+208:                     break
+
          goto __pyx_L12_break;
+
 209:                 else:
+
+210:                     self._results[index] = value
+
        /*else*/ {
+          if (unlikely(__pyx_v_self->_results == Py_None)) {
+            PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
+            __PYX_ERR(0, 210, __pyx_L5_except_error)
+          }
+          __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_index); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 210, __pyx_L5_except_error)
+          __Pyx_GOTREF(__pyx_t_8);
+          if (unlikely(PyDict_SetItem(__pyx_v_self->_results, __pyx_t_8, __pyx_v_value) < 0)) __PYX_ERR(0, 210, __pyx_L5_except_error)
+          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+        }
+      }
+      __pyx_L12_break:;
+      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+      goto __pyx_L4_exception_handled;
+    }
+    goto __pyx_L5_except_error;
+    __pyx_L5_except_error:;
+
+211:         self.index += 1
+
  __pyx_v_self->index = (__pyx_v_self->index + 1);
+
+212:         return value
+
  __Pyx_XDECREF(__pyx_r);
+  if (unlikely(!__pyx_v_value)) { __Pyx_RaiseUnboundLocalError("value"); __PYX_ERR(0, 212, __pyx_L1_error) }
+  __Pyx_INCREF(__pyx_v_value);
+  __pyx_r = __pyx_v_value;
+  goto __pyx_L0;
+
 213: 
+
+214:     def _iqueue_value_for_success(self, greenlet):
+
static PyObject *__pyx_f_6gevent_6__imap_4IMap__iqueue_value_for_success(struct __pyx_obj_6gevent_6__imap_IMap *__pyx_v_self, PyObject *__pyx_v_greenlet) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_iqueue_value_for_success", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_AddTraceback("gevent.__imap.IMap._iqueue_value_for_success", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+215:         return (greenlet._imap_task_index, IMapUnordered._iqueue_value_for_success(self, greenlet))
+
  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_greenlet, __pyx_n_s_imap_task_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 215, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = __pyx_f_6gevent_6__imap_13IMapUnordered__iqueue_value_for_success(((struct __pyx_obj_6gevent_6__imap_IMapUnordered *)__pyx_v_self), __pyx_v_greenlet); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 215, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 215, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_GIVEREF(__pyx_t_1);
+  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_2);
+  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
+  __pyx_t_1 = 0;
+  __pyx_t_2 = 0;
+  __pyx_r = __pyx_t_3;
+  __pyx_t_3 = 0;
+  goto __pyx_L0;
+
 216: 
+
+217:     def _iqueue_value_for_failure(self, greenlet):
+
static PyObject *__pyx_f_6gevent_6__imap_4IMap__iqueue_value_for_failure(struct __pyx_obj_6gevent_6__imap_IMap *__pyx_v_self, PyObject *__pyx_v_greenlet) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_iqueue_value_for_failure", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_AddTraceback("gevent.__imap.IMap._iqueue_value_for_failure", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+218:         return (greenlet._imap_task_index, IMapUnordered._iqueue_value_for_failure(self, greenlet))
+
  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_greenlet, __pyx_n_s_imap_task_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 218, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = __pyx_f_6gevent_6__imap_13IMapUnordered__iqueue_value_for_failure(((struct __pyx_obj_6gevent_6__imap_IMapUnordered *)__pyx_v_self), __pyx_v_greenlet); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 218, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 218, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_GIVEREF(__pyx_t_1);
+  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_2);
+  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
+  __pyx_t_1 = 0;
+  __pyx_t_2 = 0;
+  __pyx_r = __pyx_t_3;
+  __pyx_t_3 = 0;
+  goto __pyx_L0;
+
 219: 
+
+220:     def _iqueue_value_for_self_finished(self):
+
static PyObject *__pyx_f_6gevent_6__imap_4IMap__iqueue_value_for_self_finished(struct __pyx_obj_6gevent_6__imap_IMap *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_iqueue_value_for_self_finished", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_AddTraceback("gevent.__imap.IMap._iqueue_value_for_self_finished", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+221:         return (self._max_index + 1, IMapUnordered._iqueue_value_for_self_finished(self))
+
  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __Pyx_PyInt_From_long((__pyx_v_self->__pyx_base._max_index + 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 221, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = __pyx_f_6gevent_6__imap_13IMapUnordered__iqueue_value_for_self_finished(((struct __pyx_obj_6gevent_6__imap_IMapUnordered *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 221, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 221, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_GIVEREF(__pyx_t_1);
+  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_2);
+  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
+  __pyx_t_1 = 0;
+  __pyx_t_2 = 0;
+  __pyx_r = __pyx_t_3;
+  __pyx_t_3 = 0;
+  goto __pyx_L0;
+
 222: 
+
+223:     def _iqueue_value_for_self_failure(self, exception):
+
static PyObject *__pyx_f_6gevent_6__imap_4IMap__iqueue_value_for_self_failure(struct __pyx_obj_6gevent_6__imap_IMap *__pyx_v_self, PyObject *__pyx_v_exception) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_iqueue_value_for_self_failure", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_AddTraceback("gevent.__imap.IMap._iqueue_value_for_self_failure", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+224:         return (self._max_index + 1, IMapUnordered._iqueue_value_for_self_failure(self, exception))
+
  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __Pyx_PyInt_From_long((__pyx_v_self->__pyx_base._max_index + 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 224, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = __pyx_f_6gevent_6__imap_13IMapUnordered__iqueue_value_for_self_failure(((struct __pyx_obj_6gevent_6__imap_IMapUnordered *)__pyx_v_self), __pyx_v_exception); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 224, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 224, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_GIVEREF(__pyx_t_1);
+  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_2);
+  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
+  __pyx_t_1 = 0;
+  __pyx_t_2 = 0;
+  __pyx_r = __pyx_t_3;
+  __pyx_t_3 = 0;
+  goto __pyx_L0;
+
 225: 
+
+226: from gevent._util import import_c_accel
+
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 226, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_import_c_accel);
+  __Pyx_GIVEREF(__pyx_n_s_import_c_accel);
+  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_import_c_accel);
+  __pyx_t_1 = __Pyx_Import(__pyx_n_s_gevent__util, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 226, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_import_c_accel); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 226, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_import_c_accel, __pyx_t_2) < 0) __PYX_ERR(0, 226, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+227: import_c_accel(globals(), 'gevent.__imap')
+
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_import_c_accel); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 227, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = __Pyx_Globals(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 227, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 227, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_GIVEREF(__pyx_t_2);
+  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_gevent___imap);
+  __Pyx_GIVEREF(__pyx_n_s_gevent___imap);
+  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_n_s_gevent___imap);
+  __pyx_t_2 = 0;
+  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 227, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_imap.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_imap.py new file mode 100644 index 00000000..e976b679 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_imap.py @@ -0,0 +1,227 @@ +# -*- coding: utf-8 -*- +# Copyright (c) 2018 gevent +# cython: auto_pickle=False,embedsignature=True,always_allow_keywords=False,infer_types=True + +""" +Iterators across greenlets or AsyncResult objects. + +""" +from __future__ import absolute_import +from __future__ import division +from __future__ import print_function + + +from gevent import _semaphore +from gevent import queue + + +__all__ = [ + 'IMapUnordered', + 'IMap', +] + +locals()['Greenlet'] = __import__('gevent').Greenlet +locals()['Semaphore'] = _semaphore.Semaphore +locals()['UnboundQueue'] = queue.UnboundQueue + + +class Failure(object): + __slots__ = ('exc', 'raise_exception') + + def __init__(self, exc, raise_exception=None): + self.exc = exc + self.raise_exception = raise_exception + + +def _raise_exc(failure): + # For cython. + if failure.raise_exception: + failure.raise_exception() + else: + raise failure.exc + +class IMapUnordered(Greenlet): # pylint:disable=undefined-variable + """ + At iterator of map results. + """ + + def __init__(self, func, iterable, spawn, maxsize=None, _zipped=False): + """ + An iterator that. + + :param callable spawn: The function we use to create new greenlets. + :keyword int maxsize: If given and not-None, specifies the maximum number of + finished results that will be allowed to accumulated awaiting the reader; + more than that number of results will cause map function greenlets to begin + to block. This is most useful is there is a great disparity in the speed of + the mapping code and the consumer and the results consume a great deal of resources. + Using a bound is more computationally expensive than not using a bound. + + .. versionchanged:: 1.1b3 + Added the *maxsize* parameter. + """ + Greenlet.__init__(self) # pylint:disable=undefined-variable + self.spawn = spawn + self._zipped = _zipped + self.func = func + self.iterable = iterable + self.queue = UnboundQueue() # pylint:disable=undefined-variable + + + if maxsize: + # Bounding the queue is not enough if we want to keep from + # accumulating objects; the result value will be around as + # the greenlet's result, blocked on self.queue.put(), and + # we'll go on to spawn another greenlet, which in turn can + # create the result. So we need a semaphore to prevent a + # greenlet from exiting while the queue is full so that we + # don't spawn the next greenlet (assuming that self.spawn + # is of course bounded). (Alternatively we could have the + # greenlet itself do the insert into the pool, but that + # takes some rework). + # + # Given the use of a semaphore at this level, sizing the queue becomes + # redundant, and that lets us avoid having to use self.link() instead + # of self.rawlink() to avoid having blocking methods called in the + # hub greenlet. + self._result_semaphore = Semaphore(maxsize) # pylint:disable=undefined-variable + else: + self._result_semaphore = None + + self._outstanding_tasks = 0 + # The index (zero based) of the maximum number of + # results we will have. + self._max_index = -1 + self.finished = False + + + # We're iterating in a different greenlet than we're running. + def __iter__(self): + return self + + def __next__(self): + if self._result_semaphore is not None: + self._result_semaphore.release() + value = self._inext() + if isinstance(value, Failure): + _raise_exc(value) + return value + + next = __next__ # Py2 + + def _inext(self): + return self.queue.get() + + def _ispawn(self, func, item, item_index): + if self._result_semaphore is not None: + self._result_semaphore.acquire() + self._outstanding_tasks += 1 + g = self.spawn(func, item) if not self._zipped else self.spawn(func, *item) + g._imap_task_index = item_index + g.rawlink(self._on_result) + return g + + def _run(self): # pylint:disable=method-hidden + try: + func = self.func + for item in self.iterable: + self._max_index += 1 + self._ispawn(func, item, self._max_index) + self._on_finish(None) + except BaseException as e: + self._on_finish(e) + raise + finally: + self.spawn = None + self.func = None + self.iterable = None + self._result_semaphore = None + + def _on_result(self, greenlet): + # This method will be called in the hub greenlet (we rawlink) + self._outstanding_tasks -= 1 + count = self._outstanding_tasks + finished = self.finished + ready = self.ready() + put_finished = False + + if ready and count <= 0 and not finished: + finished = self.finished = True + put_finished = True + + if greenlet.successful(): + self.queue.put(self._iqueue_value_for_success(greenlet)) + else: + self.queue.put(self._iqueue_value_for_failure(greenlet)) + + if put_finished: + self.queue.put(self._iqueue_value_for_self_finished()) + + def _on_finish(self, exception): + # Called in this greenlet. + if self.finished: + return + + if exception is not None: + self.finished = True + self.queue.put(self._iqueue_value_for_self_failure(exception)) + return + + if self._outstanding_tasks <= 0: + self.finished = True + self.queue.put(self._iqueue_value_for_self_finished()) + + def _iqueue_value_for_success(self, greenlet): + return greenlet.value + + def _iqueue_value_for_failure(self, greenlet): + return Failure(greenlet.exception, getattr(greenlet, '_raise_exception')) + + def _iqueue_value_for_self_finished(self): + return Failure(StopIteration()) + + def _iqueue_value_for_self_failure(self, exception): + return Failure(exception, self._raise_exception) + + +class IMap(IMapUnordered): + # A specialization of IMapUnordered that returns items + # in the order in which they were generated, not + # the order in which they finish. + + def __init__(self, *args, **kwargs): + # The result dictionary: {index: value} + self._results = {} + + # The index of the result to return next. + self.index = 0 + IMapUnordered.__init__(self, *args, **kwargs) + + def _inext(self): + try: + value = self._results.pop(self.index) + except KeyError: + # Wait for our index to finish. + while 1: + index, value = self.queue.get() + if index == self.index: + break + else: + self._results[index] = value + self.index += 1 + return value + + def _iqueue_value_for_success(self, greenlet): + return (greenlet._imap_task_index, IMapUnordered._iqueue_value_for_success(self, greenlet)) + + def _iqueue_value_for_failure(self, greenlet): + return (greenlet._imap_task_index, IMapUnordered._iqueue_value_for_failure(self, greenlet)) + + def _iqueue_value_for_self_finished(self): + return (self._max_index + 1, IMapUnordered._iqueue_value_for_self_finished(self)) + + def _iqueue_value_for_self_failure(self, exception): + return (self._max_index + 1, IMapUnordered._iqueue_value_for_self_failure(self, exception)) + +from gevent._util import import_c_accel +import_c_accel(globals(), 'gevent.__imap') diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_interfaces.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_interfaces.py new file mode 100644 index 00000000..8ee20209 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_interfaces.py @@ -0,0 +1,230 @@ +# -*- coding: utf-8 -*- +# Copyright (c) 2018 gevent contributors. See LICENSE for details. +""" +Interfaces gevent uses that don't belong any one place. + +This is not a public module, these interfaces are not +currently exposed to the public, they mostly exist for +documentation and testing purposes. + +.. versionadded:: 1.3b2 + +""" +from __future__ import absolute_import +from __future__ import division +from __future__ import print_function + +import sys + +from gevent._util import Interface +from gevent._util import Attribute + +# pylint:disable=no-method-argument, unused-argument, no-self-argument + +__all__ = [ + 'ILoop', + 'IWatcher', +] + +class ILoop(Interface): + """ + The common interface expected for all event loops. + + .. caution:: + This is an internal, low-level interface. It may change + between minor versions of gevent. + + .. rubric:: Watchers + + The methods that create event loop watchers are `io`, `timer`, + `signal`, `idle`, `prepare`, `check`, `fork`, `async_`, `child`, + `stat`. These all return various types of :class:`IWatcher`. + + All of those methods have one or two common arguments. *ref* is a + boolean saying whether the event loop is allowed to exit even if + this watcher is still started. *priority* is event loop specific. + """ + + default = Attribute("Boolean indicating whether this is the default loop") + + approx_timer_resolution = Attribute( + "Floating point number of seconds giving (approximately) the minimum " + "resolution of a timer (and hence the minimun value the sleep can sleep for). " + "On libuv, this is fixed by the library, but on libev it is just a guess " + "and the actual value is system dependent." + ) + + def run(nowait=False, once=False): + """ + Run the event loop. + + This is usually called automatically by the hub greenlet, but + in special cases (when the hub is *not* running) you can use + this to control how the event loop runs (for example, to integrate + it with another event loop). + """ + + def now(): + """ + now() -> float + + Return the loop's notion of the current time. + + This may not necessarily be related to :func:`time.time` (it + may have a different starting point), but it must be expressed + in fractional seconds (the same *units* used by :func:`time.time`). + """ + + def update_now(): + """ + Update the loop's notion of the current time. + + .. versionadded:: 1.3 + In the past, this available as ``update``. This is still available as + an alias but will be removed in the future. + """ + + def destroy(): + """ + Clean up resources used by this loop. + + If you create loops + (especially loops that are not the default) you *should* call + this method when you are done with the loop. + + .. caution:: + + As an implementation note, the libev C loop implementation has a + finalizer (``__del__``) that destroys the object, but the libuv + and libev CFFI implementations do not. The C implementation may change. + + """ + + def io(fd, events, ref=True, priority=None): + """ + Create and return a new IO watcher for the given *fd*. + + *events* is a bitmask specifying which events to watch + for. 1 means read, and 2 means write. + """ + + def timer(after, repeat=0.0, ref=True, priority=None): + """ + Create and return a timer watcher that will fire after *after* seconds. + + If *repeat* is given, the timer will continue to fire every *repeat* seconds. + """ + + def signal(signum, ref=True, priority=None): + """ + Create and return a signal watcher for the signal *signum*, + one of the constants defined in :mod:`signal`. + + This is platform and event loop specific. + """ + + def idle(ref=True, priority=None): + """ + Create and return a watcher that fires when the event loop is idle. + """ + + def prepare(ref=True, priority=None): + """ + Create and return a watcher that fires before the event loop + polls for IO. + + .. caution:: This method is not supported by libuv. + """ + + def check(ref=True, priority=None): + """ + Create and return a watcher that fires after the event loop + polls for IO. + """ + + def fork(ref=True, priority=None): + """ + Create a watcher that fires when the process forks. + + Availability: POSIX + """ + + def async_(ref=True, priority=None): + """ + Create a watcher that fires when triggered, possibly + from another thread. + + .. versionchanged:: 1.3 + This was previously just named ``async``; for compatibility + with Python 3.7 where ``async`` is a keyword it was renamed. + On older versions of Python the old name is still around, but + it will be removed in the future. + """ + + if sys.platform != "win32": + + def child(pid, trace=0, ref=True): + """ + Create a watcher that fires for events on the child with process ID *pid*. + + This is platform specific and not available on Windows. + """ + + def stat(path, interval=0.0, ref=True, priority=None): + """ + Create a watcher that monitors the filesystem item at *path*. + + If the operating system doesn't support event notifications + from the filesystem, poll for changes every *interval* seconds. + """ + + def run_callback(func, *args): + """ + Run the *func* passing it *args* at the next opportune moment. + + This is a way of handing control to the event loop and deferring + an action. + """ + +class IWatcher(Interface): + """ + An event loop watcher. + + These objects call their *callback* function when the event + loop detects the event has happened. + + .. important:: You *must* call :meth:`close` when you are + done with this object to avoid leaking native resources. + """ + + def start(callback, *args, **kwargs): + """ + Have the event loop begin watching for this event. + + When the event is detected, *callback* will be called with + *args*. + + .. caution:: + + Not all watchers accept ``**kwargs``, + and some watchers define special meanings for certain keyword args. + """ + + def stop(): + """ + Have the event loop stop watching this event. + + In the future you may call :meth:`start` to begin watching + again. + """ + + def close(): + """ + Dispose of any native resources associated with the watcher. + + If we were active, stop. + + Attempting to operate on this object after calling close is + undefined. You should dispose of any references you have to it + after calling this method. + """ diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_local.cp37-win32.pyd b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_local.cp37-win32.pyd new file mode 100644 index 0000000000000000000000000000000000000000..b4b5a6e7154b5e71f8c21d24bff52fc3e5fe34cf GIT binary patch literal 107008 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

oDtB>lACV^=jDo z52#2)46={L*t`#&u+LuLI2N*NCVa#v9M3pjcDxBM z@moic^F&ze3Z&Qo=NZg9ywZ6iX2g@uXCc4da(?9e&Uu`x)HTvI(KVO(e`{SO?$g}E z++z?kX>reXU*}%w{={8{QFst@;6qs4zj^H5%e+frRiEf9^SOLy_^N#qe6^teI->t} zyi)-DpO08!Pq81yV5m45(Vr_2FI+7?D1L_c!S7;;G+DYHT)$O1!Q9L2G!KI%aEtj) z$fRG*UF0L6F-`}ckA#Qch=>bC%^sJZhh~3Q4#9hxqx=mr>2l>x%UW>ttB^q3;kECE zw^V5DXH~3DNTG4i5bf55)@9a}@RinByVwr1S)e6`+D0LQ#&rbQpkLW`!3N!jD9j1= zQ|x7Sv%M0rm?_};+wAwkM}HEOEn=K5JI28yf7J05Jn+{*-}m7cB|zgnj?qJDvAAAA+vf2pjV?=Qd|o*I}-sT*tXia`keRyA*g!Rjw=GbFX&2 z#X#??0p?x&PU$Q5Z(PAIwc=Ij?*_7HefyGN6fd>_nPlbZujlRd3B7@!Lava<|mIu zjIK?bD=rWhVZPi6d+%X!Bm9}27_EPbv!wH-9O&*dF&_1DSnhzQyIk(B90Qw*IDZo2 zEN$TXmCDoL`cIXw5M%jO>0vq9@;6I|<#EgNu$UayN^o@>{MU!9-$Q5T*(O3)FR|TX z`@8LKL@+60;;;{4k@IuxFE>AT-O4`)1L!%Uk81^VX=(vu;Iz?T!u(4_aZld zuV3(Nh8^^&rv=o!7O{sXykCKaxjqvt=?b6hv-|pkk^xBjW?z)qM+w0CB4Gn9XIQEc z3!93_Lm07#^Du5VLu1@!xgRrZ1AM>NEN@!gwInRn)*9<1$fsIF#TuojaW0JNII~9E!-o35d_vyTYy*v^I_C<*sF}Ph2}(Ke&E% z?ROoA*i;|*V>Yam3`b01srxhdT=^c^bG9c8D|a#C1RFi?L3jU#)sREIJurhxyuG{? zUW?a>c{Bw2JOJH7zEzv|Lhk}Z4X*R9fOoYIDc-2naaoNu%5LqtsX`e+9e z>G)i+yLhB{f@l$kh~p9Gt`(LSCXQR~}K`Q9e>~El0o(9)Q)7 z(Uuy^nU(-N^ouN)AZmFv;+88cx5FBH6tZx$B^k9`h&a(&>v~vUFIm5^ehm*~uk}#G zoVDoC#kOVYNIe5P>_^*PtRLjrkH-pDKNhnbU_S$^SUhHV5k~R~`!(=E?nj(5&oLD% z2+QGF9}T~HtaGMwf%688-!|uGu&=Ij?RNj{-isK{VV)B`W$-tKd!~AtU`Ji#x!Q9R z#^Xt>P`&T@7AsT-dr77hBXZM^S;pg`=cjuk-Zx8xfg*5c9E{FV83W2KZ`x zao-DAljdtkNXV@<^5DfKAu^@qY6n1bkM3!@DmR<*WwHaKz9c!yU!Pm=`@}&~Vgjm0V zNdHi25-g}DsYRMA%?EcclU74!ZGiu=6*ko8Sk2iZ?UVA&g=Q1{e8p@x4@I1R3hdez zM78F_2U%ub4j*KVd87F`Hi8Mnwf30>c#1{PFD>#i*j8(?Lc3Ys1q;ihlq&yUduF7E zFc8P_AQ%Mq06`E8!rR?{_Zbcb!5|2OJwOnIK@bdrpa%$oK@bjtAPmC6AQ*%}FzEXP zJwf*fcfY&){=R=-N3{2i&h=Iw^c9oe4HR!z%59k9s&YKlgh;O|@MguPHf3j?^=4>fiwg2|SotRQD4v$h95%6B7(EOx2O V+>$=IcZEB-GnBw7{nw8j_yQMnOfUcd literal 0 HcmV?d00001 diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_local.pxd b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_local.pxd new file mode 100644 index 00000000..331ce283 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_local.pxd @@ -0,0 +1,113 @@ +# cython: auto_pickle=False + +cimport cython +from gevent._greenlet cimport Greenlet + +cdef bint _PYPY +cdef ref +cdef copy + +cdef object _marker +cdef str key_prefix +cdef bint _greenlet_imported + + +cdef extern from "greenlet/greenlet.h": + + ctypedef class greenlet.greenlet [object PyGreenlet]: + pass + + # These are actually macros and so much be included + # (defined) in each .pxd, as are the two functions + # that call them. + greenlet PyGreenlet_GetCurrent() + void PyGreenlet_Import() + +cdef inline greenlet getcurrent(): + return PyGreenlet_GetCurrent() + +cdef inline void greenlet_init(): + global _greenlet_imported + if not _greenlet_imported: + PyGreenlet_Import() + _greenlet_imported = True + + +cdef void _init() + +@cython.final +@cython.internal +cdef class _wrefdict(dict): + cdef object __weakref__ + +@cython.final +@cython.internal +cdef class _greenlet_deleted: + cdef object idt + cdef object wrdicts + + +@cython.final +@cython.internal +cdef class _local_deleted: + cdef str key + cdef object wrthread + cdef _greenlet_deleted greenlet_deleted + +@cython.final +@cython.internal +cdef class _localimpl: + cdef str key + cdef dict dicts + cdef tuple localargs + cdef dict localkwargs + cdef tuple localtypeid + cdef object __weakref__ + + +@cython.final +@cython.internal +cdef class _localimpl_dict_entry: + cdef object wrgreenlet + cdef dict localdict + +@cython.locals(localdict=dict, key=str, + greenlet_deleted=_greenlet_deleted, + local_deleted=_local_deleted) +cdef dict _localimpl_create_dict(_localimpl self, + greenlet greenlet, + object idt) + +cdef set _local_attrs + +cdef class local: + cdef _localimpl _local__impl + cdef set _local_type_get_descriptors + cdef set _local_type_set_or_del_descriptors + cdef set _local_type_del_descriptors + cdef set _local_type_set_descriptors + cdef set _local_type_vars + cdef type _local_type + + @cython.locals(entry=_localimpl_dict_entry, + dct=dict, duplicate=dict, + instance=local) + cpdef local __copy__(local self) + + +@cython.locals(impl=_localimpl,dct=dict, + dct=dict, entry=_localimpl_dict_entry) +cdef inline dict _local_get_dict(local self) + +@cython.locals(entry=_localimpl_dict_entry) +cdef _local__copy_dict_from(local self, _localimpl impl, dict duplicate) + +@cython.locals(mro=list, gets=set, dels=set, set_or_del=set, + type_self=type, type_attr=type, + sets=set) +cdef tuple _local_find_descriptors(local self) + +@cython.locals(result=list, local_impl=_localimpl, + entry=_localimpl_dict_entry, k=str, + greenlet_dict=dict) +cpdef all_local_dicts_for_greenlet(greenlet greenlet) diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_monitor.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_monitor.py new file mode 100644 index 00000000..2c4ef030 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_monitor.py @@ -0,0 +1,325 @@ +# Copyright (c) 2018 gevent. See LICENSE for details. +from __future__ import print_function, absolute_import, division + +import os +import sys + +from weakref import ref as wref + +from greenlet import getcurrent + +from gevent import config as GEVENT_CONFIG +from gevent.monkey import get_original +from gevent.events import notify +from gevent.events import EventLoopBlocked +from gevent.events import MemoryUsageThresholdExceeded +from gevent.events import MemoryUsageUnderThreshold +from gevent.events import IPeriodicMonitorThread +from gevent.events import implementer + +from gevent._tracer import GreenletTracer +from gevent._compat import thread_mod_name +from gevent._compat import perf_counter + + + +__all__ = [ + 'PeriodicMonitoringThread', +] + +get_thread_ident = get_original(thread_mod_name, 'get_ident') +start_new_thread = get_original(thread_mod_name, 'start_new_thread') +thread_sleep = get_original('time', 'sleep') + + + +class MonitorWarning(RuntimeWarning): + """The type of warnings we emit.""" + + +class _MonitorEntry(object): + + __slots__ = ('function', 'period', 'last_run_time') + + def __init__(self, function, period): + self.function = function + self.period = period + self.last_run_time = 0 + + def __eq__(self, other): + return self.function == other.function and self.period == other.period + + def __repr__(self): + return repr((self.function, self.period, self.last_run_time)) + + +@implementer(IPeriodicMonitorThread) +class PeriodicMonitoringThread(object): + # This doesn't extend threading.Thread because that gets monkey-patched. + # We use the low-level 'start_new_thread' primitive instead. + + # The amount of seconds we will sleep when we think we have nothing + # to do. + inactive_sleep_time = 2.0 + + # The absolute minimum we will sleep, regardless of + # what particular monitoring functions want to say. + min_sleep_time = 0.005 + + # The minimum period in seconds at which we will check memory usage. + # Getting memory usage is fairly expensive. + min_memory_monitor_period = 2 + + # A list of _MonitorEntry objects: [(function(hub), period, last_run_time))] + # The first entry is always our entry for self.monitor_blocking + _monitoring_functions = None + + # The calculated min sleep time for the monitoring functions list. + _calculated_sleep_time = None + + # A boolean value that also happens to capture the + # memory usage at the time we exceeded the threshold. Reset + # to 0 when we go back below. + _memory_exceeded = 0 + + # The instance of GreenletTracer we're using + _greenlet_tracer = None + + def __init__(self, hub): + self._hub_wref = wref(hub, self._on_hub_gc) + self.should_run = True + + # Must be installed in the thread that the hub is running in; + # the trace function is threadlocal + assert get_thread_ident() == hub.thread_ident + self._greenlet_tracer = GreenletTracer() + + self._monitoring_functions = [_MonitorEntry(self.monitor_blocking, + GEVENT_CONFIG.max_blocking_time)] + self._calculated_sleep_time = GEVENT_CONFIG.max_blocking_time + # Create the actual monitoring thread. This is effectively a "daemon" + # thread. + self.monitor_thread_ident = start_new_thread(self, ()) + + # We must track the PID to know if your thread has died after a fork + self.pid = os.getpid() + + def _on_fork(self): + # Pseudo-standard method that resolver_ares and threadpool + # also have, called by hub.reinit() + pid = os.getpid() + if pid != self.pid: + self.pid = pid + self.monitor_thread_ident = start_new_thread(self, ()) + + @property + def hub(self): + return self._hub_wref() + + + def monitoring_functions(self): + # Return a list of _MonitorEntry objects + + # Update max_blocking_time each time. + mbt = GEVENT_CONFIG.max_blocking_time # XXX: Events so we know when this changes. + if mbt != self._monitoring_functions[0].period: + self._monitoring_functions[0].period = mbt + self._calculated_sleep_time = min(x.period for x in self._monitoring_functions) + return self._monitoring_functions + + def add_monitoring_function(self, function, period): + if not callable(function): + raise ValueError("function must be callable") + + if period is None: + # Remove. + self._monitoring_functions = [ + x for x in self._monitoring_functions + if x.function != function + ] + elif period <= 0: + raise ValueError("Period must be positive.") + else: + # Add or update period + entry = _MonitorEntry(function, period) + self._monitoring_functions = [ + x if x.function != function else entry + for x in self._monitoring_functions + ] + if entry not in self._monitoring_functions: + self._monitoring_functions.append(entry) + self._calculated_sleep_time = min(x.period for x in self._monitoring_functions) + + def calculate_sleep_time(self): + min_sleep = self._calculated_sleep_time + if min_sleep <= 0: + # Everyone wants to be disabled. Sleep for a longer period of + # time than usual so we don't spin unnecessarily. We might be + # enabled again in the future. + return self.inactive_sleep_time + return max((min_sleep, self.min_sleep_time)) + + def kill(self): + if not self.should_run: + # Prevent overwriting trace functions. + return + # Stop this monitoring thread from running. + self.should_run = False + # Uninstall our tracing hook + self._greenlet_tracer.kill() + + def _on_hub_gc(self, _): + self.kill() + + def __call__(self): + # The function that runs in the monitoring thread. + # We cannot use threading.current_thread because it would + # create an immortal DummyThread object. + getcurrent().gevent_monitoring_thread = wref(self) + + try: + while self.should_run: + functions = self.monitoring_functions() + assert functions + sleep_time = self.calculate_sleep_time() + + thread_sleep(sleep_time) + + # Make sure the hub is still around, and still active, + # and keep it around while we are here. + hub = self.hub + if not hub: + self.kill() + + if self.should_run: + this_run = perf_counter() + for entry in functions: + f = entry.function + period = entry.period + last_run = entry.last_run_time + if period and last_run + period <= this_run: + entry.last_run_time = this_run + f(hub) + del hub # break our reference to hub while we sleep + + except SystemExit: + pass + except: # pylint:disable=bare-except + # We're a daemon thread, so swallow any exceptions that get here + # during interpreter shutdown. + if not sys or not sys.stderr: # pragma: no cover + # Interpreter is shutting down + pass + else: + hub = self.hub + if hub is not None: + # XXX: This tends to do bad things like end the process, because we + # try to switch *threads*, which can't happen. Need something better. + hub.handle_error(self, *sys.exc_info()) + + def monitor_blocking(self, hub): + # Called periodically to see if the trace function has + # fired to switch greenlets. If not, we will print + # the greenlet tree. + + # For tests, we return a true value when we think we found something + # blocking + + did_block = self._greenlet_tracer.did_block_hub(hub) + if not did_block: + return + + active_greenlet = did_block[1] + report = self._greenlet_tracer.did_block_hub_report( + hub, active_greenlet, + dict(greenlet_stacks=False, current_thread_ident=self.monitor_thread_ident)) + + stream = hub.exception_stream + for line in report: + # Printing line by line may interleave with other things, + # but it should also prevent a "reentrant call to print" + # when the report is large. + print(line, file=stream) + + notify(EventLoopBlocked(active_greenlet, GEVENT_CONFIG.max_blocking_time, report)) + return (active_greenlet, report) + + def ignore_current_greenlet_blocking(self): + self._greenlet_tracer.ignore_current_greenlet_blocking() + + def monitor_current_greenlet_blocking(self): + self._greenlet_tracer.monitor_current_greenlet_blocking() + + def _get_process(self): # pylint:disable=method-hidden + try: + # The standard library 'resource' module doesn't provide + # a standard way to get the RSS measure, only the maximum. + # You might be tempted to try to compute something by adding + # together text and data sizes, but on many systems those come back + # zero. So our only option is psutil. + from psutil import Process, AccessDenied + # Make sure it works (why would we be denied access to our own process?) + try: + proc = Process() + proc.memory_full_info() + except AccessDenied: # pragma: no cover + proc = None + except ImportError: + proc = None + + self._get_process = lambda: proc + return proc + + def can_monitor_memory_usage(self): + return self._get_process() is not None + + def install_monitor_memory_usage(self): + # Start monitoring memory usage, if possible. + # If not possible, emit a warning. + if not self.can_monitor_memory_usage(): + import warnings + warnings.warn("Unable to monitor memory usage. Install psutil.", + MonitorWarning) + return + + self.add_monitoring_function(self.monitor_memory_usage, + max(GEVENT_CONFIG.memory_monitor_period, + self.min_memory_monitor_period)) + + def monitor_memory_usage(self, _hub): + max_allowed = GEVENT_CONFIG.max_memory_usage + if not max_allowed: + # They disabled it. + return -1 # value for tests + + rusage = self._get_process().memory_full_info() + # uss only documented available on Windows, Linux, and OS X. + # If not available, fall back to rss as an aproximation. + mem_usage = getattr(rusage, 'uss', 0) or rusage.rss + + event = None # Return value for tests + + if mem_usage > max_allowed: + if mem_usage > self._memory_exceeded: + # We're still growing + event = MemoryUsageThresholdExceeded( + mem_usage, max_allowed, rusage) + notify(event) + self._memory_exceeded = mem_usage + else: + # we're below. Were we above it last time? + if self._memory_exceeded: + event = MemoryUsageUnderThreshold( + mem_usage, max_allowed, rusage, self._memory_exceeded) + notify(event) + self._memory_exceeded = 0 + + return event + + def __repr__(self): + return '<%s at %s in thread %s greenlet %r for %r>' % ( + self.__class__.__name__, + hex(id(self)), + hex(self.monitor_thread_ident), + getcurrent(), + self._hub_wref()) diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_patcher.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_patcher.py new file mode 100644 index 00000000..2ced50cc --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_patcher.py @@ -0,0 +1,127 @@ +# Copyright 2018 gevent. See LICENSE for details. + +# Portions of the following are inspired by code from eventlet. I +# believe they are distinct enough that no eventlet copyright would +# apply (they are not a copy or substantial portion of the eventlot +# code). + +# Added in gevent 1.3a2. Not public in that release. + +from __future__ import absolute_import, print_function + +import importlib +import sys + +from gevent._compat import PY3 +from gevent._compat import iteritems +from gevent._compat import imp_acquire_lock +from gevent._compat import imp_release_lock + + +from gevent.builtins import __import__ as _import + + +MAPPING = { + 'gevent.local': '_threading_local', + 'gevent.socket': 'socket', + 'gevent.select': 'select', + 'gevent.ssl': 'ssl', + 'gevent.thread': '_thread' if PY3 else 'thread', + 'gevent.subprocess': 'subprocess', + 'gevent.os': 'os', + 'gevent.threading': 'threading', + 'gevent.builtins': 'builtins' if PY3 else '__builtin__', + 'gevent.signal': 'signal', + 'gevent.time': 'time', + 'gevent.queue': 'queue' if PY3 else 'Queue', +} + +_PATCH_PREFIX = '__g_patched_module_' + +class _SysModulesPatcher(object): + + def __init__(self, importing): + self._saved = {} + self.importing = importing + self.green_modules = { + stdlib_name: importlib.import_module(gevent_name) + for gevent_name, stdlib_name + in iteritems(MAPPING) + } + self.orig_imported = frozenset(sys.modules) + + def _save(self): + for modname in self.green_modules: + self._saved[modname] = sys.modules.get(modname, None) + + self._saved[self.importing] = sys.modules.get(self.importing, None) + # Anything we've already patched regains its original name during this + # process + for mod_name, mod in iteritems(sys.modules): + if mod_name.startswith(_PATCH_PREFIX): + orig_mod_name = mod_name[len(_PATCH_PREFIX):] + self._saved[mod_name] = sys.modules.get(orig_mod_name, None) + self.green_modules[orig_mod_name] = mod + + def _replace(self): + # Cover the target modules so that when you import the module it + # sees only the patched versions + for name, mod in iteritems(self.green_modules): + sys.modules[name] = mod + + def _restore(self): + for modname, mod in iteritems(self._saved): + if mod is not None: + sys.modules[modname] = mod + else: + try: + del sys.modules[modname] + except KeyError: + pass + # Anything from the same package tree we imported this time + # needs to be saved so we can restore it later, and so it doesn't + # leak into the namespace. + pkg_prefix = self.importing.split('.', 1)[0] + for modname, mod in list(iteritems(sys.modules)): + if (modname not in self.orig_imported + and modname != self.importing + and not modname.startswith(_PATCH_PREFIX) + and modname.startswith(pkg_prefix)): + sys.modules[_PATCH_PREFIX + modname] = mod + del sys.modules[modname] + + def __exit__(self, t, v, tb): + try: + self._restore() + finally: + imp_release_lock() + + def __enter__(self): + imp_acquire_lock() + self._save() + self._replace() + + +def import_patched(module_name): + """ + Import *module_name* with gevent monkey-patches active, + and return the greened module. + + Any sub-modules that were imported by the package are also + saved. + + """ + patched_name = _PATCH_PREFIX + module_name + if patched_name in sys.modules: + return sys.modules[patched_name] + + + # Save the current module state, and restore on exit, + # capturing desirable changes in the modules package. + with _SysModulesPatcher(module_name): + sys.modules.pop(module_name, None) + + module = _import(module_name, {}, {}, module_name.split('.')[:-1]) + sys.modules[patched_name] = module + + return module diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_queue.cp37-win32.pyd b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_queue.cp37-win32.pyd new file mode 100644 index 0000000000000000000000000000000000000000..ede5853a21429204b64c7c020dcb476dcc89151d GIT binary patch literal 173056 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 G5-|4fA|DrsT<3?19Af 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 +#ifndef offsetof + #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) +#endif +#if !defined(WIN32) && !defined(MS_WINDOWS) + #ifndef __stdcall + #define __stdcall + #endif + #ifndef __cdecl + #define __cdecl + #endif + #ifndef __fastcall + #define __fastcall + #endif +#endif +#ifndef DL_IMPORT + #define DL_IMPORT(t) t +#endif +#ifndef DL_EXPORT + #define DL_EXPORT(t) t +#endif +#define __PYX_COMMA , +#ifndef HAVE_LONG_LONG + #if PY_VERSION_HEX >= 0x02070000 + #define HAVE_LONG_LONG + #endif +#endif +#ifndef PY_LONG_LONG + #define PY_LONG_LONG LONG_LONG +#endif +#ifndef Py_HUGE_VAL + #define Py_HUGE_VAL HUGE_VAL +#endif +#ifdef PYPY_VERSION + #define CYTHON_COMPILING_IN_PYPY 1 + #define CYTHON_COMPILING_IN_PYSTON 0 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #undef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 0 + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #if PY_VERSION_HEX < 0x03050000 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #elif !defined(CYTHON_USE_ASYNC_SLOTS) + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #undef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 0 + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #undef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 1 + #undef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 0 + #undef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 0 + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #undef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE 0 + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 +#elif defined(PYSTON_VERSION) + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_PYSTON 1 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #ifndef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 1 + #endif + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #ifndef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 1 + #endif + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #ifndef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 0 + #endif + #ifndef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 1 + #endif + #ifndef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 1 + #endif + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #undef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE 0 + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 +#else + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_PYSTON 0 + #define CYTHON_COMPILING_IN_CPYTHON 1 + #ifndef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 1 + #endif + #if PY_VERSION_HEX < 0x02070000 + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #elif !defined(CYTHON_USE_PYTYPE_LOOKUP) + #define CYTHON_USE_PYTYPE_LOOKUP 1 + #endif + #if PY_MAJOR_VERSION < 3 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #elif !defined(CYTHON_USE_ASYNC_SLOTS) + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #if PY_VERSION_HEX < 0x02070000 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #elif !defined(CYTHON_USE_PYLONG_INTERNALS) + #define CYTHON_USE_PYLONG_INTERNALS 1 + #endif + #ifndef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 1 + #endif + #ifndef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 1 + #endif + #if PY_VERSION_HEX < 0x030300F0 + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #elif !defined(CYTHON_USE_UNICODE_WRITER) + #define CYTHON_USE_UNICODE_WRITER 1 + #endif + #ifndef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 0 + #endif + #ifndef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 1 + #endif + #ifndef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 1 + #endif + #ifndef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 1 + #endif + #ifndef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 1 + #endif + #ifndef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000) + #endif + #ifndef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1) + #endif + #ifndef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1) + #endif + #ifndef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3) + #endif +#endif +#if !defined(CYTHON_FAST_PYCCALL) +#define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) +#endif +#if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #undef SHIFT + #undef BASE + #undef MASK + #ifdef SIZEOF_VOID_P + enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) }; + #endif +#endif +#ifndef __has_attribute + #define __has_attribute(x) 0 +#endif +#ifndef __has_cpp_attribute + #define __has_cpp_attribute(x) 0 +#endif +#ifndef CYTHON_RESTRICT + #if defined(__GNUC__) + #define CYTHON_RESTRICT __restrict__ + #elif defined(_MSC_VER) && _MSC_VER >= 1400 + #define CYTHON_RESTRICT __restrict + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_RESTRICT restrict + #else + #define CYTHON_RESTRICT + #endif +#endif +#ifndef CYTHON_UNUSED +# if defined(__GNUC__) +# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +#endif +#ifndef CYTHON_MAYBE_UNUSED_VAR +# if defined(__cplusplus) + template void CYTHON_MAYBE_UNUSED_VAR( const T& ) { } +# else +# define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x) +# endif +#endif +#ifndef CYTHON_NCP_UNUSED +# if CYTHON_COMPILING_IN_CPYTHON +# define CYTHON_NCP_UNUSED +# else +# define CYTHON_NCP_UNUSED CYTHON_UNUSED +# endif +#endif +#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) +#ifdef _MSC_VER + #ifndef _MSC_STDINT_H_ + #if _MSC_VER < 1300 + typedef unsigned char uint8_t; + typedef unsigned int uint32_t; + #else + typedef unsigned __int8 uint8_t; + typedef unsigned __int32 uint32_t; + #endif + #endif +#else + #include +#endif +#ifndef CYTHON_FALLTHROUGH + #if defined(__cplusplus) && __cplusplus >= 201103L + #if __has_cpp_attribute(fallthrough) + #define CYTHON_FALLTHROUGH [[fallthrough]] + #elif __has_cpp_attribute(clang::fallthrough) + #define CYTHON_FALLTHROUGH [[clang::fallthrough]] + #elif __has_cpp_attribute(gnu::fallthrough) + #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] + #endif + #endif + #ifndef CYTHON_FALLTHROUGH + #if __has_attribute(fallthrough) + #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) + #else + #define CYTHON_FALLTHROUGH + #endif + #endif + #if defined(__clang__ ) && defined(__apple_build_version__) + #if __apple_build_version__ < 7000000 + #undef CYTHON_FALLTHROUGH + #define CYTHON_FALLTHROUGH + #endif + #endif +#endif + +#ifndef CYTHON_INLINE + #if defined(__clang__) + #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) + #elif defined(__GNUC__) + #define CYTHON_INLINE __inline__ + #elif defined(_MSC_VER) + #define CYTHON_INLINE __inline + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_INLINE inline + #else + #define CYTHON_INLINE + #endif +#endif + +#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) + #define Py_OptimizeFlag 0 +#endif +#define __PYX_BUILD_PY_SSIZE_T "n" +#define CYTHON_FORMAT_SSIZE_T "z" +#if PY_MAJOR_VERSION < 3 + #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyClass_Type +#else + #define __Pyx_BUILTIN_MODULE_NAME "builtins" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyType_Type +#endif +#ifndef Py_TPFLAGS_CHECKTYPES + #define Py_TPFLAGS_CHECKTYPES 0 +#endif +#ifndef Py_TPFLAGS_HAVE_INDEX + #define Py_TPFLAGS_HAVE_INDEX 0 +#endif +#ifndef Py_TPFLAGS_HAVE_NEWBUFFER + #define Py_TPFLAGS_HAVE_NEWBUFFER 0 +#endif +#ifndef Py_TPFLAGS_HAVE_FINALIZE + #define Py_TPFLAGS_HAVE_FINALIZE 0 +#endif +#ifndef METH_STACKLESS + #define METH_STACKLESS 0 +#endif +#if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) + #ifndef METH_FASTCALL + #define METH_FASTCALL 0x80 + #endif + typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs); + typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args, + Py_ssize_t nargs, PyObject *kwnames); +#else + #define __Pyx_PyCFunctionFast _PyCFunctionFast + #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords +#endif +#if CYTHON_FAST_PYCCALL +#define __Pyx_PyFastCFunction_Check(func)\ + ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS))))) +#else +#define __Pyx_PyFastCFunction_Check(func) 0 +#endif +#if CYTHON_USE_DICT_VERSIONS +#define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) +#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ + (version_var) = __PYX_GET_DICT_VERSION(dict);\ + (cache_var) = (value); +#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ + static PY_UINT64_T __pyx_dict_version = 0;\ + static PyObject *__pyx_dict_cached_value = NULL;\ + if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ + (VAR) = __pyx_dict_cached_value;\ + } else {\ + (VAR) = __pyx_dict_cached_value = (LOOKUP);\ + __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ + }\ + } +#else +#define __PYX_GET_DICT_VERSION(dict) (0) +#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) +#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) + #define PyObject_Malloc(s) PyMem_Malloc(s) + #define PyObject_Free(p) PyMem_Free(p) + #define PyObject_Realloc(p) PyMem_Realloc(p) +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1 + #define PyMem_RawMalloc(n) PyMem_Malloc(n) + #define PyMem_RawRealloc(p, n) PyMem_Realloc(p, n) + #define PyMem_RawFree(p) PyMem_Free(p) +#endif +#if CYTHON_COMPILING_IN_PYSTON + #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co) + #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno) +#else + #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) + #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) +#endif +#if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000 + #define __Pyx_PyThreadState_Current PyThreadState_GET() +#elif PY_VERSION_HEX >= 0x03060000 + #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() +#elif PY_VERSION_HEX >= 0x03000000 + #define __Pyx_PyThreadState_Current PyThreadState_GET() +#else + #define __Pyx_PyThreadState_Current _PyThreadState_Current +#endif +#if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) +#include "pythread.h" +#define Py_tss_NEEDS_INIT 0 +typedef int Py_tss_t; +static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) { + *key = PyThread_create_key(); + return 0; // PyThread_create_key reports success always +} +static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) { + Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t)); + *key = Py_tss_NEEDS_INIT; + return key; +} +static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) { + PyObject_Free(key); +} +static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) { + return *key != Py_tss_NEEDS_INIT; +} +static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) { + PyThread_delete_key(*key); + *key = Py_tss_NEEDS_INIT; +} +static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) { + return PyThread_set_key_value(*key, value); +} +static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { + return PyThread_get_key_value(*key); +} +#endif // TSS (Thread Specific Storage) API +#if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized) +#define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) +#else +#define __Pyx_PyDict_NewPresized(n) PyDict_New() +#endif +#if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION + #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) +#else + #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS +#define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) +#else +#define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name) +#endif +#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) + #define CYTHON_PEP393_ENABLED 1 + #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ + 0 : _PyUnicode_Ready((PyObject *)(op))) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) + #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) + #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) + #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) + #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) + #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch) + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) +#else + #define CYTHON_PEP393_ENABLED 0 + #define PyUnicode_1BYTE_KIND 1 + #define PyUnicode_2BYTE_KIND 2 + #define PyUnicode_4BYTE_KIND 4 + #define __Pyx_PyUnicode_READY(op) (0) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) + #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111) + #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) + #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) + #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) + #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch) + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) +#endif +#if CYTHON_COMPILING_IN_PYPY + #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) +#else + #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ + PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains) + #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check) + #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format) + #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) +#endif +#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) +#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) +#else + #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) +#endif +#if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) + #define PyObject_ASCII(o) PyObject_Repr(o) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBaseString_Type PyUnicode_Type + #define PyStringObject PyUnicodeObject + #define PyString_Type PyUnicode_Type + #define PyString_Check PyUnicode_Check + #define PyString_CheckExact PyUnicode_CheckExact + #define PyObject_Unicode PyObject_Str +#endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) + #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) +#else + #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) + #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) +#endif +#ifndef PySet_CheckExact + #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) +#endif +#if CYTHON_ASSUME_SAFE_MACROS + #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) +#else + #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyIntObject PyLongObject + #define PyInt_Type PyLong_Type + #define PyInt_Check(op) PyLong_Check(op) + #define PyInt_CheckExact(op) PyLong_CheckExact(op) + #define PyInt_FromString PyLong_FromString + #define PyInt_FromUnicode PyLong_FromUnicode + #define PyInt_FromLong PyLong_FromLong + #define PyInt_FromSize_t PyLong_FromSize_t + #define PyInt_FromSsize_t PyLong_FromSsize_t + #define PyInt_AsLong PyLong_AsLong + #define PyInt_AS_LONG PyLong_AS_LONG + #define PyInt_AsSsize_t PyLong_AsSsize_t + #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask + #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask + #define PyNumber_Int PyNumber_Long +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBoolObject PyLongObject +#endif +#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY + #ifndef PyUnicode_InternFromString + #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) + #endif +#endif +#if PY_VERSION_HEX < 0x030200A4 + typedef long Py_hash_t; + #define __Pyx_PyInt_FromHash_t PyInt_FromLong + #define __Pyx_PyInt_AsHash_t PyInt_AsLong +#else + #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t + #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t +#endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : (Py_INCREF(func), func)) +#else + #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) +#endif +#if CYTHON_USE_ASYNC_SLOTS + #if PY_VERSION_HEX >= 0x030500B1 + #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods + #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) + #else + #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) + #endif +#else + #define __Pyx_PyType_AsAsync(obj) NULL +#endif +#ifndef __Pyx_PyAsyncMethodsStruct + typedef struct { + unaryfunc am_await; + unaryfunc am_aiter; + unaryfunc am_anext; + } __Pyx_PyAsyncMethodsStruct; +#endif + +#if defined(WIN32) || defined(MS_WINDOWS) + #define _USE_MATH_DEFINES +#endif +#include +#ifdef NAN +#define __PYX_NAN() ((float) NAN) +#else +static CYTHON_INLINE float __PYX_NAN() { + float value; + memset(&value, 0xFF, sizeof(value)); + return value; +} +#endif +#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) +#define __Pyx_truncl trunc +#else +#define __Pyx_truncl truncl +#endif + + +#define __PYX_ERR(f_index, lineno, Ln_error) \ +{ \ + __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \ +} + +#ifndef __PYX_EXTERN_C + #ifdef __cplusplus + #define __PYX_EXTERN_C extern "C" + #else + #define __PYX_EXTERN_C extern + #endif +#endif + +#define __PYX_HAVE__gevent____semaphore +#define __PYX_HAVE_API__gevent____semaphore +/* Early includes */ +#include "greenlet/greenlet.h" +#ifdef _OPENMP +#include +#endif /* _OPENMP */ + +#if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) +#define CYTHON_WITHOUT_ASSERTIONS +#endif + +typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; + const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; + +#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 +#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0 +#define __PYX_DEFAULT_STRING_ENCODING "" +#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString +#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#define __Pyx_uchar_cast(c) ((unsigned char)c) +#define __Pyx_long_cast(x) ((long)x) +#define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ + (sizeof(type) < sizeof(Py_ssize_t)) ||\ + (sizeof(type) > sizeof(Py_ssize_t) &&\ + likely(v < (type)PY_SSIZE_T_MAX ||\ + v == (type)PY_SSIZE_T_MAX) &&\ + (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ + v == (type)PY_SSIZE_T_MIN))) ||\ + (sizeof(type) == sizeof(Py_ssize_t) &&\ + (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ + v == (type)PY_SSIZE_T_MAX))) ) +static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) { + return (size_t) i < (size_t) limit; +} +#if defined (__cplusplus) && __cplusplus >= 201103L + #include + #define __Pyx_sst_abs(value) std::abs(value) +#elif SIZEOF_INT >= SIZEOF_SIZE_T + #define __Pyx_sst_abs(value) abs(value) +#elif SIZEOF_LONG >= SIZEOF_SIZE_T + #define __Pyx_sst_abs(value) labs(value) +#elif defined (_MSC_VER) + #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) +#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define __Pyx_sst_abs(value) llabs(value) +#elif defined (__GNUC__) + #define __Pyx_sst_abs(value) __builtin_llabs(value) +#else + #define __Pyx_sst_abs(value) ((value<0) ? -value : value) +#endif +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*); +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); +#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) +#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) +#define __Pyx_PyBytes_FromString PyBytes_FromString +#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); +#if PY_MAJOR_VERSION < 3 + #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#else + #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize +#endif +#define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) +#define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) +#define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) +#define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) +#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) +static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) { + const Py_UNICODE *u_end = u; + while (*u_end++) ; + return (size_t)(u_end - u - 1); +} +#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) +#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode +#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode +#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) +#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) +static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); +static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*); +static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); +#define __Pyx_PySequence_Tuple(obj)\ + (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); +#if CYTHON_ASSUME_SAFE_MACROS +#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) +#else +#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) +#endif +#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) +#if PY_MAJOR_VERSION >= 3 +#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) +#else +#define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) +#endif +#define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x)) +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII +static int __Pyx_sys_getdefaultencoding_not_ascii; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + PyObject* ascii_chars_u = NULL; + PyObject* ascii_chars_b = NULL; + const char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + if (strcmp(default_encoding_c, "ascii") == 0) { + __Pyx_sys_getdefaultencoding_not_ascii = 0; + } else { + char ascii_chars[128]; + int c; + for (c = 0; c < 128; c++) { + ascii_chars[c] = c; + } + __Pyx_sys_getdefaultencoding_not_ascii = 1; + ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); + if (!ascii_chars_u) goto bad; + ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); + if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { + PyErr_Format( + PyExc_ValueError, + "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", + default_encoding_c); + goto bad; + } + Py_DECREF(ascii_chars_u); + Py_DECREF(ascii_chars_b); + } + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + Py_XDECREF(ascii_chars_u); + Py_XDECREF(ascii_chars_b); + return -1; +} +#endif +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) +#else +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +static char* __PYX_DEFAULT_STRING_ENCODING; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1); + if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; + strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + return -1; +} +#endif +#endif + + +/* Test for GCC > 2.95 */ +#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) + #define likely(x) __builtin_expect(!!(x), 1) + #define unlikely(x) __builtin_expect(!!(x), 0) +#else /* !__GNUC__ or GCC < 2.95 */ + #define likely(x) (x) + #define unlikely(x) (x) +#endif /* __GNUC__ */ +static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } + +static PyObject *__pyx_m = NULL; +static PyObject *__pyx_d; +static PyObject *__pyx_b; +static PyObject *__pyx_cython_runtime = NULL; +static PyObject *__pyx_empty_tuple; +static PyObject *__pyx_empty_bytes; +static PyObject *__pyx_empty_unicode; +static int __pyx_lineno; +static int __pyx_clineno = 0; +static const char * __pyx_cfilenm= __FILE__; +static const char *__pyx_filename; + + +static const char *__pyx_f[] = { + "src\\gevent\\_semaphore.py", + "src\\gevent\\__semaphore.pxd", + "src\\gevent\\__greenlet_primitives.pxd", + "src\\gevent\\__abstract_linkable.pxd", +}; + +/*--- Type declarations ---*/ +struct __pyx_obj_6gevent_21__greenlet_primitives_TrackedRawGreenlet; +struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop; +struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable; +struct __pyx_obj_6gevent_11__semaphore_Semaphore; +struct __pyx_obj_6gevent_11__semaphore_BoundedSemaphore; +struct __pyx_opt_args_6gevent_19__abstract_linkable_16AbstractLinkable__wait_core; +struct __pyx_opt_args_6gevent_19__abstract_linkable_16AbstractLinkable__wait; + +/* "gevent/__abstract_linkable.pxd":51 + * cdef _check_and_notify(self) + * cpdef _notify_links(self) + * cdef _wait_core(self, timeout, catch=*) # <<<<<<<<<<<<<< + * cdef _wait_return_value(self, waited, wait_success) + * cdef _wait(self, timeout=*) + */ +struct __pyx_opt_args_6gevent_19__abstract_linkable_16AbstractLinkable__wait_core { + int __pyx_n; + PyObject *catch; +}; + +/* "gevent/__abstract_linkable.pxd":53 + * cdef _wait_core(self, timeout, catch=*) + * cdef _wait_return_value(self, waited, wait_success) + * cdef _wait(self, timeout=*) # <<<<<<<<<<<<<< + */ +struct __pyx_opt_args_6gevent_19__abstract_linkable_16AbstractLinkable__wait { + int __pyx_n; + PyObject *timeout; +}; +struct __pyx_opt_args_6gevent_11__semaphore_9Semaphore_wait; +struct __pyx_opt_args_6gevent_11__semaphore_9Semaphore_acquire; + +/* "gevent/__semaphore.pxd":15 + * # threadpool uses it + * cpdef _start_notify(self) + * cpdef int wait(self, object timeout=*) except -1000 # <<<<<<<<<<<<<< + * cpdef bint acquire(self, int blocking=*, object timeout=*) except -1000 + * cpdef __enter__(self) + */ +struct __pyx_opt_args_6gevent_11__semaphore_9Semaphore_wait { + int __pyx_n; + PyObject *timeout; +}; + +/* "gevent/__semaphore.pxd":16 + * cpdef _start_notify(self) + * cpdef int wait(self, object timeout=*) except -1000 + * cpdef bint acquire(self, int blocking=*, object timeout=*) except -1000 # <<<<<<<<<<<<<< + * cpdef __enter__(self) + * cpdef __exit__(self, object t, object v, object tb) + */ +struct __pyx_opt_args_6gevent_11__semaphore_9Semaphore_acquire { + int __pyx_n; + int blocking; + PyObject *timeout; +}; + +/* "gevent/__greenlet_primitives.pxd":37 + * return PyGreenlet_Switch(self, NULL, NULL) + * + * cdef class TrackedRawGreenlet(greenlet): # <<<<<<<<<<<<<< + * pass + * + */ +struct __pyx_obj_6gevent_21__greenlet_primitives_TrackedRawGreenlet { + PyGreenlet __pyx_base; +}; + + +/* "gevent/__greenlet_primitives.pxd":40 + * pass + * + * cdef class SwitchOutGreenletWithLoop(TrackedRawGreenlet): # <<<<<<<<<<<<<< + * cdef public loop + * + */ +struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop { + struct __pyx_obj_6gevent_21__greenlet_primitives_TrackedRawGreenlet __pyx_base; + struct __pyx_vtabstruct_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *__pyx_vtab; + PyObject *loop; +}; + + +/* "gevent/__abstract_linkable.pxd":32 + * cdef void _init() + * + * cdef class AbstractLinkable(object): # <<<<<<<<<<<<<< + * # We declare the __weakref__ here in the base (even though + * # that's not really what we want) as a workaround for a Cython + */ +struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable { + PyObject_HEAD + struct __pyx_vtabstruct_6gevent_19__abstract_linkable_AbstractLinkable *__pyx_vtab; + PyObject *__weakref__; + struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *hub; + PyObject *_notifier; + PyObject *_links; + int _notify_all; +}; + + +/* "gevent/__semaphore.pxd":7 + * + * + * cdef class Semaphore(AbstractLinkable): # <<<<<<<<<<<<<< + * cdef public int counter + * + */ +struct __pyx_obj_6gevent_11__semaphore_Semaphore { + struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable __pyx_base; + int counter; +}; + + +/* "gevent/__semaphore.pxd":20 + * cpdef __exit__(self, object t, object v, object tb) + * + * cdef class BoundedSemaphore(Semaphore): # <<<<<<<<<<<<<< + * cdef readonly int _initial_value + * + */ +struct __pyx_obj_6gevent_11__semaphore_BoundedSemaphore { + struct __pyx_obj_6gevent_11__semaphore_Semaphore __pyx_base; + int _initial_value; +}; + + + +/* "gevent/__greenlet_primitives.pxd":40 + * pass + * + * cdef class SwitchOutGreenletWithLoop(TrackedRawGreenlet): # <<<<<<<<<<<<<< + * cdef public loop + * + */ + +struct __pyx_vtabstruct_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop { + PyObject *(*__pyx_switch)(struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *, int __pyx_skip_dispatch); + PyObject *(*switch_out)(struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *, int __pyx_skip_dispatch); +}; +static struct __pyx_vtabstruct_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *__pyx_vtabptr_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop; + + +/* "gevent/__abstract_linkable.pxd":32 + * cdef void _init() + * + * cdef class AbstractLinkable(object): # <<<<<<<<<<<<<< + * # We declare the __weakref__ here in the base (even though + * # that's not really what we want) as a workaround for a Cython + */ + +struct __pyx_vtabstruct_6gevent_19__abstract_linkable_AbstractLinkable { + PyObject *(*rawlink)(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *, PyObject *, int __pyx_skip_dispatch); + int (*ready)(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *, int __pyx_skip_dispatch); + PyObject *(*unlink)(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *, PyObject *, int __pyx_skip_dispatch); + PyObject *(*_check_and_notify)(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *); + PyObject *(*_notify_links)(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *, int __pyx_skip_dispatch); + PyObject *(*_wait_core)(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *, PyObject *, struct __pyx_opt_args_6gevent_19__abstract_linkable_16AbstractLinkable__wait_core *__pyx_optional_args); + PyObject *(*_wait_return_value)(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *, PyObject *, PyObject *); + PyObject *(*_wait)(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *, struct __pyx_opt_args_6gevent_19__abstract_linkable_16AbstractLinkable__wait *__pyx_optional_args); +}; +static struct __pyx_vtabstruct_6gevent_19__abstract_linkable_AbstractLinkable *__pyx_vtabptr_6gevent_19__abstract_linkable_AbstractLinkable; + + +/* "src/gevent/_semaphore.py":16 + * + * + * class Semaphore(AbstractLinkable): # pylint:disable=undefined-variable # <<<<<<<<<<<<<< + * """ + * Semaphore(value=1) -> Semaphore + */ + +struct __pyx_vtabstruct_6gevent_11__semaphore_Semaphore { + struct __pyx_vtabstruct_6gevent_19__abstract_linkable_AbstractLinkable __pyx_base; + int (*locked)(struct __pyx_obj_6gevent_11__semaphore_Semaphore *, int __pyx_skip_dispatch); + int (*release)(struct __pyx_obj_6gevent_11__semaphore_Semaphore *, int __pyx_skip_dispatch); + PyObject *(*_start_notify)(struct __pyx_obj_6gevent_11__semaphore_Semaphore *, int __pyx_skip_dispatch); + int (*wait)(struct __pyx_obj_6gevent_11__semaphore_Semaphore *, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_11__semaphore_9Semaphore_wait *__pyx_optional_args); + int (*acquire)(struct __pyx_obj_6gevent_11__semaphore_Semaphore *, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_11__semaphore_9Semaphore_acquire *__pyx_optional_args); + PyObject *(*__pyx___enter__)(struct __pyx_obj_6gevent_11__semaphore_Semaphore *, int __pyx_skip_dispatch); + PyObject *(*__pyx___exit__)(struct __pyx_obj_6gevent_11__semaphore_Semaphore *, PyObject *, PyObject *, PyObject *, int __pyx_skip_dispatch); +}; +static struct __pyx_vtabstruct_6gevent_11__semaphore_Semaphore *__pyx_vtabptr_6gevent_11__semaphore_Semaphore; + + +/* "src/gevent/_semaphore.py":148 + * + * + * class BoundedSemaphore(Semaphore): # <<<<<<<<<<<<<< + * """ + * BoundedSemaphore(value=1) -> BoundedSemaphore + */ + +struct __pyx_vtabstruct_6gevent_11__semaphore_BoundedSemaphore { + struct __pyx_vtabstruct_6gevent_11__semaphore_Semaphore __pyx_base; +}; +static struct __pyx_vtabstruct_6gevent_11__semaphore_BoundedSemaphore *__pyx_vtabptr_6gevent_11__semaphore_BoundedSemaphore; + +/* --- Runtime support code (head) --- */ +/* Refnanny.proto */ +#ifndef CYTHON_REFNANNY + #define CYTHON_REFNANNY 0 +#endif +#if CYTHON_REFNANNY + typedef struct { + void (*INCREF)(void*, PyObject*, int); + void (*DECREF)(void*, PyObject*, int); + void (*GOTREF)(void*, PyObject*, int); + void (*GIVEREF)(void*, PyObject*, int); + void* (*SetupContext)(const char*, int, const char*); + void (*FinishContext)(void**); + } __Pyx_RefNannyAPIStruct; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); + #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; +#ifdef WITH_THREAD + #define __Pyx_RefNannySetupContext(name, acquire_gil)\ + if (acquire_gil) {\ + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ + PyGILState_Release(__pyx_gilstate_save);\ + } else {\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ + } +#else + #define __Pyx_RefNannySetupContext(name, acquire_gil)\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) +#endif + #define __Pyx_RefNannyFinishContext()\ + __Pyx_RefNanny->FinishContext(&__pyx_refnanny) + #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0) + #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) + #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) + #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) +#else + #define __Pyx_RefNannyDeclarations + #define __Pyx_RefNannySetupContext(name, acquire_gil) + #define __Pyx_RefNannyFinishContext() + #define __Pyx_INCREF(r) Py_INCREF(r) + #define __Pyx_DECREF(r) Py_DECREF(r) + #define __Pyx_GOTREF(r) + #define __Pyx_GIVEREF(r) + #define __Pyx_XINCREF(r) Py_XINCREF(r) + #define __Pyx_XDECREF(r) Py_XDECREF(r) + #define __Pyx_XGOTREF(r) + #define __Pyx_XGIVEREF(r) +#endif +#define __Pyx_XDECREF_SET(r, v) do {\ + PyObject *tmp = (PyObject *) r;\ + r = v; __Pyx_XDECREF(tmp);\ + } while (0) +#define __Pyx_DECREF_SET(r, v) do {\ + PyObject *tmp = (PyObject *) r;\ + r = v; __Pyx_DECREF(tmp);\ + } while (0) +#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) +#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) + +/* PyObjectGetAttrStr.proto */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); +#else +#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) +#endif + +/* GetBuiltinName.proto */ +static PyObject *__Pyx_GetBuiltinName(PyObject *name); + +/* PyObjectCall.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); +#else +#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) +#endif + +/* RaiseDoubleKeywords.proto */ +static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); + +/* ParseKeywords.proto */ +static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\ + PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\ + const char* function_name); + +/* RaiseArgTupleInvalid.proto */ +static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, + Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); + +/* PyThreadStateGet.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; +#define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; +#define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type +#else +#define __Pyx_PyThreadState_declare +#define __Pyx_PyThreadState_assign +#define __Pyx_PyErr_Occurred() PyErr_Occurred() +#endif + +/* PyErrFetchRestore.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) +#define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) +#define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) +#define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) +#define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); +static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) +#else +#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) +#endif +#else +#define __Pyx_PyErr_Clear() PyErr_Clear() +#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) +#define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) +#define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb) +#define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) +#endif + +/* RaiseException.proto */ +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); + +/* PyFunctionFastCall.proto */ +#if CYTHON_FAST_PYCALL +#define __Pyx_PyFunction_FastCall(func, args, nargs)\ + __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) +#if 1 || PY_VERSION_HEX < 0x030600B1 +static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs); +#else +#define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs) +#endif +#define __Pyx_BUILD_ASSERT_EXPR(cond)\ + (sizeof(char [1 - 2*!(cond)]) - 1) +#ifndef Py_MEMBER_SIZE +#define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member) +#endif + static size_t __pyx_pyframe_localsplus_offset = 0; + #include "frameobject.h" + #define __Pxy_PyFrame_Initialize_Offsets()\ + ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\ + (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus))) + #define __Pyx_PyFrame_GetLocalsplus(frame)\ + (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset)) +#endif + +/* PyObjectCallMethO.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); +#endif + +/* PyObjectCallNoArg.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); +#else +#define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL) +#endif + +/* PyCFunctionFastCall.proto */ +#if CYTHON_FAST_PYCCALL +static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs); +#else +#define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL) +#endif + +/* PyObjectCallOneArg.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); + +/* WriteUnraisableException.proto */ +static void __Pyx_WriteUnraisable(const char *name, int clineno, + int lineno, const char *filename, + int full_traceback, int nogil); + +/* PyObjectCall2Args.proto */ +static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2); + +/* KeywordStringCheck.proto */ +static int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* function_name, int kw_allowed); + +/* CallNextTpDealloc.proto */ +static void __Pyx_call_next_tp_dealloc(PyObject* obj, destructor current_tp_dealloc); + +/* CallNextTpTraverse.proto */ +static int __Pyx_call_next_tp_traverse(PyObject* obj, visitproc v, void *a, traverseproc current_tp_traverse); + +/* CallNextTpClear.proto */ +static void __Pyx_call_next_tp_clear(PyObject* obj, inquiry current_tp_dealloc); + +/* TypeImport.proto */ +#ifndef __PYX_HAVE_RT_ImportType_proto +#define __PYX_HAVE_RT_ImportType_proto +enum __Pyx_ImportType_CheckSize { + __Pyx_ImportType_CheckSize_Error = 0, + __Pyx_ImportType_CheckSize_Warn = 1, + __Pyx_ImportType_CheckSize_Ignore = 2 +}; +static PyTypeObject *__Pyx_ImportType(PyObject* module, const char *module_name, const char *class_name, size_t size, enum __Pyx_ImportType_CheckSize check_size); +#endif + +/* GetVTable.proto */ +static void* __Pyx_GetVtable(PyObject *dict); + +/* PyObject_GenericGetAttrNoDict.proto */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name); +#else +#define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr +#endif + +/* PyObject_GenericGetAttr.proto */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name); +#else +#define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr +#endif + +/* SetVTable.proto */ +static int __Pyx_SetVtable(PyObject *dict, void *vtable); + +/* FetchCommonType.proto */ +static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); + +/* CythonFunction.proto */ +#define __Pyx_CyFunction_USED 1 +#define __Pyx_CYFUNCTION_STATICMETHOD 0x01 +#define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 +#define __Pyx_CYFUNCTION_CCLASS 0x04 +#define __Pyx_CyFunction_GetClosure(f)\ + (((__pyx_CyFunctionObject *) (f))->func_closure) +#define __Pyx_CyFunction_GetClassObj(f)\ + (((__pyx_CyFunctionObject *) (f))->func_classobj) +#define __Pyx_CyFunction_Defaults(type, f)\ + ((type *)(((__pyx_CyFunctionObject *) (f))->defaults)) +#define __Pyx_CyFunction_SetDefaultsGetter(f, g)\ + ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g) +typedef struct { + PyCFunctionObject func; +#if PY_VERSION_HEX < 0x030500A0 + PyObject *func_weakreflist; +#endif + PyObject *func_dict; + PyObject *func_name; + PyObject *func_qualname; + PyObject *func_doc; + PyObject *func_globals; + PyObject *func_code; + PyObject *func_closure; + PyObject *func_classobj; + void *defaults; + int defaults_pyobjects; + int flags; + PyObject *defaults_tuple; + PyObject *defaults_kwdict; + PyObject *(*defaults_getter)(PyObject *); + PyObject *func_annotations; +} __pyx_CyFunctionObject; +static PyTypeObject *__pyx_CyFunctionType = 0; +#define __Pyx_CyFunction_Check(obj) (__Pyx_TypeCheck(obj, __pyx_CyFunctionType)) +#define __Pyx_CyFunction_NewEx(ml, flags, qualname, self, module, globals, code)\ + __Pyx_CyFunction_New(__pyx_CyFunctionType, ml, flags, qualname, self, module, globals, code) +static PyObject *__Pyx_CyFunction_New(PyTypeObject *, PyMethodDef *ml, + int flags, PyObject* qualname, + PyObject *self, + PyObject *module, PyObject *globals, + PyObject* code); +static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, + size_t size, + int pyobjects); +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, + PyObject *tuple); +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, + PyObject *dict); +static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m, + PyObject *dict); +static int __pyx_CyFunction_init(void); + +/* GetModuleGlobalName.proto */ +#if CYTHON_USE_DICT_VERSIONS +#define __Pyx_GetModuleGlobalName(var, name) {\ + static PY_UINT64_T __pyx_dict_version = 0;\ + static PyObject *__pyx_dict_cached_value = NULL;\ + (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\ + (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\ + __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ +} +#define __Pyx_GetModuleGlobalNameUncached(var, name) {\ + PY_UINT64_T __pyx_dict_version;\ + PyObject *__pyx_dict_cached_value;\ + (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ +} +static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value); +#else +#define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name) +#define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name) +static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name); +#endif + +/* PyObjectSetAttrStr.proto */ +#if CYTHON_USE_TYPE_SLOTS +#define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o, n, NULL) +static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value); +#else +#define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n) +#define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v) +#endif + +/* PyErrExceptionMatches.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) +static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); +#else +#define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) +#endif + +/* GetNameInClass.proto */ +#define __Pyx_GetNameInClass(var, nmspace, name) (var) = __Pyx__GetNameInClass(nmspace, name) +static PyObject *__Pyx__GetNameInClass(PyObject *nmspace, PyObject *name); + +/* Import.proto */ +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); + +/* ImportFrom.proto */ +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); + +/* GetAttr.proto */ +static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *); + +/* Globals.proto */ +static PyObject* __Pyx_Globals(void); + +/* CLineInTraceback.proto */ +#ifdef CYTHON_CLINE_IN_TRACEBACK +#define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) +#else +static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line); +#endif + +/* CodeObjectCache.proto */ +typedef struct { + PyCodeObject* code_object; + int code_line; +} __Pyx_CodeObjectCacheEntry; +struct __Pyx_CodeObjectCache { + int count; + int max_count; + __Pyx_CodeObjectCacheEntry* entries; +}; +static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); +static PyCodeObject *__pyx_find_code_object(int code_line); +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); + +/* AddTraceback.proto */ +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename); + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); + +/* CIntFromPy.proto */ +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); + +/* CIntFromPy.proto */ +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); + +/* FastTypeChecks.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) +static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b); +static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type); +static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2); +#else +#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) +#define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) +#define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) +#endif +#define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) + +/* CheckBinaryVersion.proto */ +static int __Pyx_check_binary_version(void); + +/* VoidPtrExport.proto */ +static int __Pyx_ExportVoidPtr(PyObject *name, void *p, const char *sig); + +/* VoidPtrImport.proto */ +static int __Pyx_ImportVoidPtr(PyObject *module, const char *name, void **p, const char *sig); + +/* FunctionImport.proto */ +static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig); + +/* InitStrings.proto */ +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); + +static int __pyx_f_6gevent_11__semaphore_9Semaphore_locked(struct __pyx_obj_6gevent_11__semaphore_Semaphore *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/ +static int __pyx_f_6gevent_11__semaphore_9Semaphore_release(struct __pyx_obj_6gevent_11__semaphore_Semaphore *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/ +static int __pyx_f_6gevent_11__semaphore_9Semaphore_ready(struct __pyx_obj_6gevent_11__semaphore_Semaphore *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/ +static PyObject *__pyx_f_6gevent_11__semaphore_9Semaphore__start_notify(struct __pyx_obj_6gevent_11__semaphore_Semaphore *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/ +static PyObject *__pyx_f_6gevent_11__semaphore_9Semaphore__wait_return_value(CYTHON_UNUSED struct __pyx_obj_6gevent_11__semaphore_Semaphore *__pyx_v_self, PyObject *__pyx_v_waited, PyObject *__pyx_v_wait_success); /* proto*/ +static int __pyx_f_6gevent_11__semaphore_9Semaphore_wait(struct __pyx_obj_6gevent_11__semaphore_Semaphore *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_11__semaphore_9Semaphore_wait *__pyx_optional_args); /* proto*/ +static int __pyx_f_6gevent_11__semaphore_9Semaphore_acquire(struct __pyx_obj_6gevent_11__semaphore_Semaphore *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_11__semaphore_9Semaphore_acquire *__pyx_optional_args); /* proto*/ +static PyObject *__pyx_f_6gevent_11__semaphore_9Semaphore___enter__(struct __pyx_obj_6gevent_11__semaphore_Semaphore *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/ +static PyObject *__pyx_f_6gevent_11__semaphore_9Semaphore___exit__(struct __pyx_obj_6gevent_11__semaphore_Semaphore *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_t, CYTHON_UNUSED PyObject *__pyx_v_v, CYTHON_UNUSED PyObject *__pyx_v_tb, int __pyx_skip_dispatch); /* proto*/ +static int __pyx_f_6gevent_11__semaphore_16BoundedSemaphore_release(struct __pyx_obj_6gevent_11__semaphore_BoundedSemaphore *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/ + +/* Module declarations from 'cython' */ + +/* Module declarations from 'greenlet' */ + +/* Module declarations from 'gevent.__greenlet_primitives' */ +static PyTypeObject *__pyx_ptype_6gevent_21__greenlet_primitives_greenlet = 0; +static PyTypeObject *__pyx_ptype_6gevent_21__greenlet_primitives_TrackedRawGreenlet = 0; +static PyTypeObject *__pyx_ptype_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop = 0; +static PyObject **__pyx_vp_6gevent_21__greenlet_primitives_get_objects = 0; +#define __pyx_v_6gevent_21__greenlet_primitives_get_objects (*__pyx_vp_6gevent_21__greenlet_primitives_get_objects) +static PyObject **__pyx_vp_6gevent_21__greenlet_primitives_wref = 0; +#define __pyx_v_6gevent_21__greenlet_primitives_wref (*__pyx_vp_6gevent_21__greenlet_primitives_wref) +static PyObject **__pyx_vp_6gevent_21__greenlet_primitives_BlockingSwitchOutError = 0; +#define __pyx_v_6gevent_21__greenlet_primitives_BlockingSwitchOutError (*__pyx_vp_6gevent_21__greenlet_primitives_BlockingSwitchOutError) +static int *__pyx_vp_6gevent_21__greenlet_primitives__greenlet_imported = 0; +#define __pyx_v_6gevent_21__greenlet_primitives__greenlet_imported (*__pyx_vp_6gevent_21__greenlet_primitives__greenlet_imported) + +/* Module declarations from 'gevent.__hub_local' */ +static PyObject **__pyx_vp_6gevent_11__hub_local__threadlocal = 0; +#define __pyx_v_6gevent_11__hub_local__threadlocal (*__pyx_vp_6gevent_11__hub_local__threadlocal) +static struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *(*__pyx_f_6gevent_11__hub_local_get_hub_noargs)(int __pyx_skip_dispatch); /*proto*/ + +/* Module declarations from 'gevent.__abstract_linkable' */ +static PyTypeObject *__pyx_ptype_6gevent_19__abstract_linkable_greenlet = 0; +static PyTypeObject *__pyx_ptype_6gevent_19__abstract_linkable_AbstractLinkable = 0; +static PyObject **__pyx_vp_6gevent_19__abstract_linkable_InvalidSwitchError = 0; +#define __pyx_v_6gevent_19__abstract_linkable_InvalidSwitchError (*__pyx_vp_6gevent_19__abstract_linkable_InvalidSwitchError) +static PyObject **__pyx_vp_6gevent_19__abstract_linkable_Timeout = 0; +#define __pyx_v_6gevent_19__abstract_linkable_Timeout (*__pyx_vp_6gevent_19__abstract_linkable_Timeout) +static int *__pyx_vp_6gevent_19__abstract_linkable__greenlet_imported = 0; +#define __pyx_v_6gevent_19__abstract_linkable__greenlet_imported (*__pyx_vp_6gevent_19__abstract_linkable__greenlet_imported) + +/* Module declarations from 'gevent.__semaphore' */ +static PyTypeObject *__pyx_ptype_6gevent_11__semaphore_Semaphore = 0; +static PyTypeObject *__pyx_ptype_6gevent_11__semaphore_BoundedSemaphore = 0; +static PyObject *__pyx_v_6gevent_11__semaphore_Timeout = 0; +#define __Pyx_MODULE_NAME "gevent.__semaphore" +extern int __pyx_module_is_main_gevent____semaphore; +int __pyx_module_is_main_gevent____semaphore = 0; + +/* Implementation of 'gevent.__semaphore' */ +static PyObject *__pyx_builtin_ValueError; +static PyObject *__pyx_builtin___import__; +static PyObject *__pyx_builtin_super; +static const char __pyx_k_t[] = "t"; +static const char __pyx_k_v[] = "v"; +static const char __pyx_k_x[] = "x"; +static const char __pyx_k_tb[] = "tb"; +static const char __pyx_k_all[] = "__all__"; +static const char __pyx_k_exit[] = "__exit__"; +static const char __pyx_k_init[] = "__init__"; +static const char __pyx_k_main[] = "__main__"; +static const char __pyx_k_name[] = "__name__"; +static const char __pyx_k_self[] = "self"; +static const char __pyx_k_test[] = "__test__"; +static const char __pyx_k_wait[] = "wait"; +static const char __pyx_k_class[] = "__class__"; +static const char __pyx_k_enter[] = "__enter__"; +static const char __pyx_k_ready[] = "ready"; +static const char __pyx_k_super[] = "super"; +static const char __pyx_k_value[] = "value"; +static const char __pyx_k_import[] = "__import__"; +static const char __pyx_k_locked[] = "locked"; +static const char __pyx_k_Timeout[] = "Timeout"; +static const char __pyx_k_acquire[] = "acquire"; +static const char __pyx_k_release[] = "release"; +static const char __pyx_k_timeout[] = "timeout"; +static const char __pyx_k_blocking[] = "blocking"; +static const char __pyx_k_pyx_capi[] = "__pyx_capi__"; +static const char __pyx_k_Semaphore[] = "Semaphore"; +static const char __pyx_k_linkcount[] = "linkcount"; +static const char __pyx_k_ValueError[] = "ValueError"; +static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__"; +static const char __pyx_k_get_linkable[] = "_get_linkable"; +static const char __pyx_k_gevent__util[] = "gevent._util"; +static const char __pyx_k_py3k_acquire[] = "_py3k_acquire"; +static const char __pyx_k_start_notify[] = "_start_notify"; +static const char __pyx_k_Semaphore_wait[] = "Semaphore.wait"; +static const char __pyx_k_import_c_accel[] = "import_c_accel"; +static const char __pyx_k_Semaphore_ready[] = "Semaphore.ready"; +static const char __pyx_k_AbstractLinkable[] = "AbstractLinkable"; +static const char __pyx_k_BoundedSemaphore[] = "BoundedSemaphore"; +static const char __pyx_k_Semaphore___exit[] = "Semaphore.__exit__"; +static const char __pyx_k_Semaphore_locked[] = "Semaphore.locked"; +static const char __pyx_k_Semaphore___enter[] = "Semaphore.__enter__"; +static const char __pyx_k_Semaphore_acquire[] = "Semaphore.acquire"; +static const char __pyx_k_Semaphore_release[] = "Semaphore.release"; +static const char __pyx_k_abstract_linkable[] = "_abstract_linkable"; +static const char __pyx_k_OVER_RELEASE_ERROR[] = "_OVER_RELEASE_ERROR"; +static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; +static const char __pyx_k_gevent___semaphore[] = "gevent.__semaphore"; +static const char __pyx_k_s_counter_s__links_s[] = "<%s counter=%s _links[%s]>"; +static const char __pyx_k_Semaphore__start_notify[] = "Semaphore._start_notify"; +static const char __pyx_k_BoundedSemaphore_release[] = "BoundedSemaphore.release"; +static const char __pyx_k_src_gevent__semaphore_py[] = "src\\gevent\\_semaphore.py"; +static const char __pyx_k_gevent__abstract_linkable[] = "gevent._abstract_linkable"; +static const char __pyx_k_semaphore_initial_value_must_be[] = "semaphore initial value must be >= 0"; +static const char __pyx_k_Semaphore_released_too_many_time[] = "Semaphore released too many times"; +static PyObject *__pyx_n_s_AbstractLinkable; +static PyObject *__pyx_n_s_BoundedSemaphore; +static PyObject *__pyx_n_s_BoundedSemaphore_release; +static PyObject *__pyx_n_s_OVER_RELEASE_ERROR; +static PyObject *__pyx_n_s_Semaphore; +static PyObject *__pyx_n_s_Semaphore___enter; +static PyObject *__pyx_n_s_Semaphore___exit; +static PyObject *__pyx_n_s_Semaphore__start_notify; +static PyObject *__pyx_n_s_Semaphore_acquire; +static PyObject *__pyx_n_s_Semaphore_locked; +static PyObject *__pyx_n_s_Semaphore_ready; +static PyObject *__pyx_n_s_Semaphore_release; +static PyObject *__pyx_kp_s_Semaphore_released_too_many_time; +static PyObject *__pyx_n_s_Semaphore_wait; +static PyObject *__pyx_n_s_Timeout; +static PyObject *__pyx_n_s_ValueError; +static PyObject *__pyx_n_s_abstract_linkable; +static PyObject *__pyx_n_s_acquire; +static PyObject *__pyx_n_s_all; +static PyObject *__pyx_n_s_blocking; +static PyObject *__pyx_n_s_class; +static PyObject *__pyx_n_s_cline_in_traceback; +static PyObject *__pyx_n_s_enter; +static PyObject *__pyx_n_s_exit; +static PyObject *__pyx_n_s_get_linkable; +static PyObject *__pyx_n_s_gevent___semaphore; +static PyObject *__pyx_kp_s_gevent__abstract_linkable; +static PyObject *__pyx_n_s_gevent__util; +static PyObject *__pyx_n_s_import; +static PyObject *__pyx_n_s_import_c_accel; +static PyObject *__pyx_n_s_init; +static PyObject *__pyx_n_s_linkcount; +static PyObject *__pyx_n_s_locked; +static PyObject *__pyx_n_s_main; +static PyObject *__pyx_n_s_name; +static PyObject *__pyx_n_s_py3k_acquire; +static PyObject *__pyx_n_s_pyx_capi; +static PyObject *__pyx_n_s_pyx_vtable; +static PyObject *__pyx_n_s_ready; +static PyObject *__pyx_n_s_release; +static PyObject *__pyx_kp_s_s_counter_s__links_s; +static PyObject *__pyx_n_s_self; +static PyObject *__pyx_kp_s_semaphore_initial_value_must_be; +static PyObject *__pyx_kp_s_src_gevent__semaphore_py; +static PyObject *__pyx_n_s_start_notify; +static PyObject *__pyx_n_s_super; +static PyObject *__pyx_n_s_t; +static PyObject *__pyx_n_s_tb; +static PyObject *__pyx_n_s_test; +static PyObject *__pyx_n_s_timeout; +static PyObject *__pyx_n_s_v; +static PyObject *__pyx_n_s_value; +static PyObject *__pyx_n_s_wait; +static PyObject *__pyx_n_s_x; +static PyObject *__pyx_pf_6gevent_11__semaphore__get_linkable(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static int __pyx_pf_6gevent_11__semaphore_9Semaphore___init__(struct __pyx_obj_6gevent_11__semaphore_Semaphore *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_6gevent_11__semaphore_9Semaphore_2__str__(struct __pyx_obj_6gevent_11__semaphore_Semaphore *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_11__semaphore_9Semaphore_4locked(struct __pyx_obj_6gevent_11__semaphore_Semaphore *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_11__semaphore_9Semaphore_6release(struct __pyx_obj_6gevent_11__semaphore_Semaphore *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_11__semaphore_9Semaphore_8ready(struct __pyx_obj_6gevent_11__semaphore_Semaphore *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_11__semaphore_9Semaphore_10_start_notify(struct __pyx_obj_6gevent_11__semaphore_Semaphore *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_11__semaphore_9Semaphore_12wait(struct __pyx_obj_6gevent_11__semaphore_Semaphore *__pyx_v_self, PyObject *__pyx_v_timeout); /* proto */ +static PyObject *__pyx_pf_6gevent_11__semaphore_9Semaphore_14acquire(struct __pyx_obj_6gevent_11__semaphore_Semaphore *__pyx_v_self, int __pyx_v_blocking, PyObject *__pyx_v_timeout); /* proto */ +static PyObject *__pyx_pf_6gevent_11__semaphore_9Semaphore_16__enter__(struct __pyx_obj_6gevent_11__semaphore_Semaphore *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_11__semaphore_9Semaphore_18__exit__(struct __pyx_obj_6gevent_11__semaphore_Semaphore *__pyx_v_self, PyObject *__pyx_v_t, PyObject *__pyx_v_v, PyObject *__pyx_v_tb); /* proto */ +static PyObject *__pyx_pf_6gevent_11__semaphore_9Semaphore_7counter___get__(struct __pyx_obj_6gevent_11__semaphore_Semaphore *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_11__semaphore_9Semaphore_7counter_2__set__(struct __pyx_obj_6gevent_11__semaphore_Semaphore *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6gevent_11__semaphore_16BoundedSemaphore___init__(struct __pyx_obj_6gevent_11__semaphore_BoundedSemaphore *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */ +static PyObject *__pyx_pf_6gevent_11__semaphore_16BoundedSemaphore_2release(struct __pyx_obj_6gevent_11__semaphore_BoundedSemaphore *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_11__semaphore_16BoundedSemaphore_14_initial_value___get__(struct __pyx_obj_6gevent_11__semaphore_BoundedSemaphore *__pyx_v_self); /* proto */ +static PyObject *__pyx_tp_new_6gevent_11__semaphore_Semaphore(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6gevent_11__semaphore_BoundedSemaphore(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_int_0; +static PyObject *__pyx_int_1; +static PyObject *__pyx_tuple_; +static PyObject *__pyx_tuple__2; +static PyObject *__pyx_tuple__3; +static PyObject *__pyx_tuple__5; +static PyObject *__pyx_tuple__7; +static PyObject *__pyx_tuple__9; +static PyObject *__pyx_tuple__11; +static PyObject *__pyx_tuple__13; +static PyObject *__pyx_tuple__15; +static PyObject *__pyx_tuple__17; +static PyObject *__pyx_tuple__19; +static PyObject *__pyx_tuple__21; +static PyObject *__pyx_codeobj__4; +static PyObject *__pyx_codeobj__6; +static PyObject *__pyx_codeobj__8; +static PyObject *__pyx_codeobj__10; +static PyObject *__pyx_codeobj__12; +static PyObject *__pyx_codeobj__14; +static PyObject *__pyx_codeobj__16; +static PyObject *__pyx_codeobj__18; +static PyObject *__pyx_codeobj__20; +static PyObject *__pyx_codeobj__22; +/* Late includes */ + +/* "src/gevent/_semaphore.py":9 + * ] + * + * def _get_linkable(): # <<<<<<<<<<<<<< + * x = __import__('gevent._abstract_linkable') + * return x._abstract_linkable.AbstractLinkable + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_11__semaphore_1_get_linkable(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6gevent_11__semaphore__get_linkable[] = "_get_linkable()"; +static PyMethodDef __pyx_mdef_6gevent_11__semaphore_1_get_linkable = {"_get_linkable", (PyCFunction)__pyx_pw_6gevent_11__semaphore_1_get_linkable, METH_NOARGS, __pyx_doc_6gevent_11__semaphore__get_linkable}; +static PyObject *__pyx_pw_6gevent_11__semaphore_1_get_linkable(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_get_linkable (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_11__semaphore__get_linkable(__pyx_self); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_11__semaphore__get_linkable(CYTHON_UNUSED PyObject *__pyx_self) { + PyObject *__pyx_v_x = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("_get_linkable", 0); + + /* "src/gevent/_semaphore.py":10 + * + * def _get_linkable(): + * x = __import__('gevent._abstract_linkable') # <<<<<<<<<<<<<< + * return x._abstract_linkable.AbstractLinkable + * locals()['AbstractLinkable'] = _get_linkable() + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin___import__, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_x = __pyx_t_1; + __pyx_t_1 = 0; + + /* "src/gevent/_semaphore.py":11 + * def _get_linkable(): + * x = __import__('gevent._abstract_linkable') + * return x._abstract_linkable.AbstractLinkable # <<<<<<<<<<<<<< + * locals()['AbstractLinkable'] = _get_linkable() + * del _get_linkable + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_abstract_linkable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 11, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_AbstractLinkable); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 11, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "src/gevent/_semaphore.py":9 + * ] + * + * def _get_linkable(): # <<<<<<<<<<<<<< + * x = __import__('gevent._abstract_linkable') + * return x._abstract_linkable.AbstractLinkable + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent.__semaphore._get_linkable", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_x); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_semaphore.py":41 + * """ + * + * def __init__(self, value=1): # <<<<<<<<<<<<<< + * if value < 0: + * raise ValueError("semaphore initial value must be >= 0") + */ + +/* Python wrapper */ +static int __pyx_pw_6gevent_11__semaphore_9Semaphore_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6gevent_11__semaphore_9Semaphore_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_value = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_value,0}; + PyObject* values[1] = {0}; + values[0] = ((PyObject *)__pyx_int_1); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value); + if (value) { values[0] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 41, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_value = values[0]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 41, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.__semaphore.Semaphore.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_11__semaphore_9Semaphore___init__(((struct __pyx_obj_6gevent_11__semaphore_Semaphore *)__pyx_v_self), __pyx_v_value); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_11__semaphore_9Semaphore___init__(struct __pyx_obj_6gevent_11__semaphore_Semaphore *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "src/gevent/_semaphore.py":42 + * + * def __init__(self, value=1): + * if value < 0: # <<<<<<<<<<<<<< + * raise ValueError("semaphore initial value must be >= 0") + * super(Semaphore, self).__init__() + */ + __pyx_t_1 = PyObject_RichCompare(__pyx_v_value, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 42, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 42, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(__pyx_t_2)) { + + /* "src/gevent/_semaphore.py":43 + * def __init__(self, value=1): + * if value < 0: + * raise ValueError("semaphore initial value must be >= 0") # <<<<<<<<<<<<<< + * super(Semaphore, self).__init__() + * self.counter = value + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 43, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 43, __pyx_L1_error) + + /* "src/gevent/_semaphore.py":42 + * + * def __init__(self, value=1): + * if value < 0: # <<<<<<<<<<<<<< + * raise ValueError("semaphore initial value must be >= 0") + * super(Semaphore, self).__init__() + */ + } + + /* "src/gevent/_semaphore.py":44 + * if value < 0: + * raise ValueError("semaphore initial value must be >= 0") + * super(Semaphore, self).__init__() # <<<<<<<<<<<<<< + * self.counter = value + * self._notify_all = False + */ + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 44, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)__pyx_ptype_6gevent_11__semaphore_Semaphore)); + __Pyx_GIVEREF(((PyObject *)__pyx_ptype_6gevent_11__semaphore_Semaphore)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_ptype_6gevent_11__semaphore_Semaphore)); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_v_self)); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 44, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_init); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 44, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 44, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_semaphore.py":45 + * raise ValueError("semaphore initial value must be >= 0") + * super(Semaphore, self).__init__() + * self.counter = value # <<<<<<<<<<<<<< + * self._notify_all = False + * + */ + __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 45, __pyx_L1_error) + __pyx_v_self->counter = __pyx_t_5; + + /* "src/gevent/_semaphore.py":46 + * super(Semaphore, self).__init__() + * self.counter = value + * self._notify_all = False # <<<<<<<<<<<<<< + * + * def __str__(self): + */ + __pyx_v_self->__pyx_base._notify_all = 0; + + /* "src/gevent/_semaphore.py":41 + * """ + * + * def __init__(self, value=1): # <<<<<<<<<<<<<< + * if value < 0: + * raise ValueError("semaphore initial value must be >= 0") + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("gevent.__semaphore.Semaphore.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_semaphore.py":48 + * self._notify_all = False + * + * def __str__(self): # <<<<<<<<<<<<<< + * params = (self.__class__.__name__, self.counter, self.linkcount()) + * return '<%s counter=%s _links[%s]>' % params + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_11__semaphore_9Semaphore_3__str__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_11__semaphore_9Semaphore_3__str__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__str__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_11__semaphore_9Semaphore_2__str__(((struct __pyx_obj_6gevent_11__semaphore_Semaphore *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_11__semaphore_9Semaphore_2__str__(struct __pyx_obj_6gevent_11__semaphore_Semaphore *__pyx_v_self) { + PyObject *__pyx_v_params = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + __Pyx_RefNannySetupContext("__str__", 0); + + /* "src/gevent/_semaphore.py":49 + * + * def __str__(self): + * params = (self.__class__.__name__, self.counter, self.linkcount()) # <<<<<<<<<<<<<< + * return '<%s counter=%s _links[%s]>' % params + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 49, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 49, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->counter); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 49, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_linkcount); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 49, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + } + } + __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 49, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 49, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3); + __pyx_t_2 = 0; + __pyx_t_1 = 0; + __pyx_t_3 = 0; + __pyx_v_params = ((PyObject*)__pyx_t_4); + __pyx_t_4 = 0; + + /* "src/gevent/_semaphore.py":50 + * def __str__(self): + * params = (self.__class__.__name__, self.counter, self.linkcount()) + * return '<%s counter=%s _links[%s]>' % params # <<<<<<<<<<<<<< + * + * def locked(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_s_counter_s__links_s, __pyx_v_params); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 50, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + + /* "src/gevent/_semaphore.py":48 + * self._notify_all = False + * + * def __str__(self): # <<<<<<<<<<<<<< + * params = (self.__class__.__name__, self.counter, self.linkcount()) + * return '<%s counter=%s _links[%s]>' % params + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("gevent.__semaphore.Semaphore.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_params); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_semaphore.py":52 + * return '<%s counter=%s _links[%s]>' % params + * + * def locked(self): # <<<<<<<<<<<<<< + * """Return a boolean indicating whether the semaphore can be acquired. + * Most useful with binary semaphores.""" + */ + +static PyObject *__pyx_pw_6gevent_11__semaphore_9Semaphore_5locked(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static int __pyx_f_6gevent_11__semaphore_9Semaphore_locked(struct __pyx_obj_6gevent_11__semaphore_Semaphore *__pyx_v_self, int __pyx_skip_dispatch) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + __Pyx_RefNannySetupContext("locked", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0; + if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self)))))); + else { + PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + #endif + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_locked); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 52, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_11__semaphore_9Semaphore_5locked)) { + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 52, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 52, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_5; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0; + if (unlikely(type_dict_guard != tp_dict_version)) { + tp_dict_version = obj_dict_version = 0; + } + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + } + #endif + } + + /* "src/gevent/_semaphore.py":55 + * """Return a boolean indicating whether the semaphore can be acquired. + * Most useful with binary semaphores.""" + * return self.counter <= 0 # <<<<<<<<<<<<<< + * + * def release(self): + */ + __pyx_r = (__pyx_v_self->counter <= 0); + goto __pyx_L0; + + /* "src/gevent/_semaphore.py":52 + * return '<%s counter=%s _links[%s]>' % params + * + * def locked(self): # <<<<<<<<<<<<<< + * """Return a boolean indicating whether the semaphore can be acquired. + * Most useful with binary semaphores.""" + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_WriteUnraisable("gevent.__semaphore.Semaphore.locked", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_11__semaphore_9Semaphore_5locked(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6gevent_11__semaphore_9Semaphore_4locked[] = "Semaphore.locked(self) -> bool\nReturn a boolean indicating whether the semaphore can be acquired.\n Most useful with binary semaphores."; +static PyMethodDef __pyx_mdef_6gevent_11__semaphore_9Semaphore_5locked = {"locked", (PyCFunction)__pyx_pw_6gevent_11__semaphore_9Semaphore_5locked, METH_NOARGS, __pyx_doc_6gevent_11__semaphore_9Semaphore_4locked}; +static PyObject *__pyx_pw_6gevent_11__semaphore_9Semaphore_5locked(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("locked (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_11__semaphore_9Semaphore_4locked(((struct __pyx_obj_6gevent_11__semaphore_Semaphore *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_11__semaphore_9Semaphore_4locked(struct __pyx_obj_6gevent_11__semaphore_Semaphore *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("locked", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_f_6gevent_11__semaphore_9Semaphore_locked(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 52, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__semaphore.Semaphore.locked", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_semaphore.py":57 + * return self.counter <= 0 + * + * def release(self): # <<<<<<<<<<<<<< + * """ + * Release the semaphore, notifying any waiters if needed. + */ + +static PyObject *__pyx_pw_6gevent_11__semaphore_9Semaphore_7release(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static int __pyx_f_6gevent_11__semaphore_9Semaphore_release(struct __pyx_obj_6gevent_11__semaphore_Semaphore *__pyx_v_self, int __pyx_skip_dispatch) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + __Pyx_RefNannySetupContext("release", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0; + if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self)))))); + else { + PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + #endif + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_release); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 57, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_11__semaphore_9Semaphore_7release)) { + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 57, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 57, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_5; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0; + if (unlikely(type_dict_guard != tp_dict_version)) { + tp_dict_version = obj_dict_version = 0; + } + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + } + #endif + } + + /* "src/gevent/_semaphore.py":61 + * Release the semaphore, notifying any waiters if needed. + * """ + * self.counter += 1 # <<<<<<<<<<<<<< + * self._check_and_notify() + * return self.counter + */ + __pyx_v_self->counter = (__pyx_v_self->counter + 1); + + /* "src/gevent/_semaphore.py":62 + * """ + * self.counter += 1 + * self._check_and_notify() # <<<<<<<<<<<<<< + * return self.counter + * + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_11__semaphore_Semaphore *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._check_and_notify(((struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 62, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_semaphore.py":63 + * self.counter += 1 + * self._check_and_notify() + * return self.counter # <<<<<<<<<<<<<< + * + * def ready(self): + */ + __pyx_r = __pyx_v_self->counter; + goto __pyx_L0; + + /* "src/gevent/_semaphore.py":57 + * return self.counter <= 0 + * + * def release(self): # <<<<<<<<<<<<<< + * """ + * Release the semaphore, notifying any waiters if needed. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("gevent.__semaphore.Semaphore.release", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1000; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_11__semaphore_9Semaphore_7release(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6gevent_11__semaphore_9Semaphore_6release[] = "Semaphore.release(self) -> int\n\n Release the semaphore, notifying any waiters if needed.\n "; +static PyMethodDef __pyx_mdef_6gevent_11__semaphore_9Semaphore_7release = {"release", (PyCFunction)__pyx_pw_6gevent_11__semaphore_9Semaphore_7release, METH_NOARGS, __pyx_doc_6gevent_11__semaphore_9Semaphore_6release}; +static PyObject *__pyx_pw_6gevent_11__semaphore_9Semaphore_7release(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("release (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_11__semaphore_9Semaphore_6release(((struct __pyx_obj_6gevent_11__semaphore_Semaphore *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_11__semaphore_9Semaphore_6release(struct __pyx_obj_6gevent_11__semaphore_Semaphore *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("release", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6gevent_11__semaphore_9Semaphore_release(__pyx_v_self, 1); if (unlikely(__pyx_t_1 == ((int)-1000))) __PYX_ERR(0, 57, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 57, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent.__semaphore.Semaphore.release", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_semaphore.py":65 + * return self.counter + * + * def ready(self): # <<<<<<<<<<<<<< + * return self.counter > 0 + * + */ + +static PyObject *__pyx_pw_6gevent_11__semaphore_9Semaphore_9ready(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static int __pyx_f_6gevent_11__semaphore_9Semaphore_ready(struct __pyx_obj_6gevent_11__semaphore_Semaphore *__pyx_v_self, int __pyx_skip_dispatch) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + __Pyx_RefNannySetupContext("ready", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0; + if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self)))))); + else { + PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + #endif + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_ready); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 65, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_11__semaphore_9Semaphore_9ready)) { + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 65, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 65, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_5; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0; + if (unlikely(type_dict_guard != tp_dict_version)) { + tp_dict_version = obj_dict_version = 0; + } + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + } + #endif + } + + /* "src/gevent/_semaphore.py":66 + * + * def ready(self): + * return self.counter > 0 # <<<<<<<<<<<<<< + * + * def _start_notify(self): + */ + __pyx_r = (__pyx_v_self->counter > 0); + goto __pyx_L0; + + /* "src/gevent/_semaphore.py":65 + * return self.counter + * + * def ready(self): # <<<<<<<<<<<<<< + * return self.counter > 0 + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_WriteUnraisable("gevent.__semaphore.Semaphore.ready", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_11__semaphore_9Semaphore_9ready(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6gevent_11__semaphore_9Semaphore_8ready[] = "Semaphore.ready(self) -> bool"; +static PyMethodDef __pyx_mdef_6gevent_11__semaphore_9Semaphore_9ready = {"ready", (PyCFunction)__pyx_pw_6gevent_11__semaphore_9Semaphore_9ready, METH_NOARGS, __pyx_doc_6gevent_11__semaphore_9Semaphore_8ready}; +static PyObject *__pyx_pw_6gevent_11__semaphore_9Semaphore_9ready(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("ready (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_11__semaphore_9Semaphore_8ready(((struct __pyx_obj_6gevent_11__semaphore_Semaphore *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_11__semaphore_9Semaphore_8ready(struct __pyx_obj_6gevent_11__semaphore_Semaphore *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("ready", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_f_6gevent_11__semaphore_9Semaphore_ready(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 65, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__semaphore.Semaphore.ready", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_semaphore.py":68 + * return self.counter > 0 + * + * def _start_notify(self): # <<<<<<<<<<<<<< + * self._check_and_notify() + * + */ + +static PyObject *__pyx_pw_6gevent_11__semaphore_9Semaphore_11_start_notify(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_f_6gevent_11__semaphore_9Semaphore__start_notify(struct __pyx_obj_6gevent_11__semaphore_Semaphore *__pyx_v_self, int __pyx_skip_dispatch) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + __Pyx_RefNannySetupContext("_start_notify", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0; + if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self)))))); + else { + PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + #endif + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_start_notify); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 68, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_11__semaphore_9Semaphore_11_start_notify)) { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 68, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0; + if (unlikely(type_dict_guard != tp_dict_version)) { + tp_dict_version = obj_dict_version = 0; + } + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + } + #endif + } + + /* "src/gevent/_semaphore.py":69 + * + * def _start_notify(self): + * self._check_and_notify() # <<<<<<<<<<<<<< + * + * def _wait_return_value(self, waited, wait_success): + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_11__semaphore_Semaphore *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._check_and_notify(((struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 69, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_semaphore.py":68 + * return self.counter > 0 + * + * def _start_notify(self): # <<<<<<<<<<<<<< + * self._check_and_notify() + * + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("gevent.__semaphore.Semaphore._start_notify", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_11__semaphore_9Semaphore_11_start_notify(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6gevent_11__semaphore_9Semaphore_10_start_notify[] = "Semaphore._start_notify(self)"; +static PyMethodDef __pyx_mdef_6gevent_11__semaphore_9Semaphore_11_start_notify = {"_start_notify", (PyCFunction)__pyx_pw_6gevent_11__semaphore_9Semaphore_11_start_notify, METH_NOARGS, __pyx_doc_6gevent_11__semaphore_9Semaphore_10_start_notify}; +static PyObject *__pyx_pw_6gevent_11__semaphore_9Semaphore_11_start_notify(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_start_notify (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_11__semaphore_9Semaphore_10_start_notify(((struct __pyx_obj_6gevent_11__semaphore_Semaphore *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_11__semaphore_9Semaphore_10_start_notify(struct __pyx_obj_6gevent_11__semaphore_Semaphore *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("_start_notify", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6gevent_11__semaphore_9Semaphore__start_notify(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 68, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__semaphore.Semaphore._start_notify", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_semaphore.py":71 + * self._check_and_notify() + * + * def _wait_return_value(self, waited, wait_success): # <<<<<<<<<<<<<< + * if waited: + * return wait_success + */ + +static PyObject *__pyx_f_6gevent_11__semaphore_9Semaphore__wait_return_value(CYTHON_UNUSED struct __pyx_obj_6gevent_11__semaphore_Semaphore *__pyx_v_self, PyObject *__pyx_v_waited, PyObject *__pyx_v_wait_success) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("_wait_return_value", 0); + + /* "src/gevent/_semaphore.py":72 + * + * def _wait_return_value(self, waited, wait_success): + * if waited: # <<<<<<<<<<<<<< + * return wait_success + * # We didn't even wait, we must be good to go. + */ + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_waited); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 72, __pyx_L1_error) + if (__pyx_t_1) { + + /* "src/gevent/_semaphore.py":73 + * def _wait_return_value(self, waited, wait_success): + * if waited: + * return wait_success # <<<<<<<<<<<<<< + * # We didn't even wait, we must be good to go. + * # XXX: This is probably dead code, we're careful not to go into the wait + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_wait_success); + __pyx_r = __pyx_v_wait_success; + goto __pyx_L0; + + /* "src/gevent/_semaphore.py":72 + * + * def _wait_return_value(self, waited, wait_success): + * if waited: # <<<<<<<<<<<<<< + * return wait_success + * # We didn't even wait, we must be good to go. + */ + } + + /* "src/gevent/_semaphore.py":77 + * # XXX: This is probably dead code, we're careful not to go into the wait + * # state if we don't expect to need to + * return True # <<<<<<<<<<<<<< + * + * def wait(self, timeout=None): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; + goto __pyx_L0; + + /* "src/gevent/_semaphore.py":71 + * self._check_and_notify() + * + * def _wait_return_value(self, waited, wait_success): # <<<<<<<<<<<<<< + * if waited: + * return wait_success + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_AddTraceback("gevent.__semaphore.Semaphore._wait_return_value", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_semaphore.py":79 + * return True + * + * def wait(self, timeout=None): # <<<<<<<<<<<<<< + * """ + * wait(timeout=None) -> int + */ + +static PyObject *__pyx_pw_6gevent_11__semaphore_9Semaphore_13wait(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_f_6gevent_11__semaphore_9Semaphore_wait(struct __pyx_obj_6gevent_11__semaphore_Semaphore *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_11__semaphore_9Semaphore_wait *__pyx_optional_args) { + PyObject *__pyx_v_timeout = ((PyObject *)Py_None); + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + int __pyx_t_6; + struct __pyx_opt_args_6gevent_19__abstract_linkable_16AbstractLinkable__wait __pyx_t_7; + __Pyx_RefNannySetupContext("wait", 0); + if (__pyx_optional_args) { + if (__pyx_optional_args->__pyx_n > 0) { + __pyx_v_timeout = __pyx_optional_args->timeout; + } + } + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0; + if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self)))))); + else { + PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + #endif + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_wait); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 79, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_11__semaphore_9Semaphore_13wait)) { + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_timeout) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_timeout); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 79, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 79, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_5; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0; + if (unlikely(type_dict_guard != tp_dict_version)) { + tp_dict_version = obj_dict_version = 0; + } + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + } + #endif + } + + /* "src/gevent/_semaphore.py":94 + * before blocking. + * """ + * if self.counter > 0: # <<<<<<<<<<<<<< + * return self.counter + * + */ + __pyx_t_6 = ((__pyx_v_self->counter > 0) != 0); + if (__pyx_t_6) { + + /* "src/gevent/_semaphore.py":95 + * """ + * if self.counter > 0: + * return self.counter # <<<<<<<<<<<<<< + * + * self._wait(timeout) # return value irrelevant, whether we got it or got a timeout + */ + __pyx_r = __pyx_v_self->counter; + goto __pyx_L0; + + /* "src/gevent/_semaphore.py":94 + * before blocking. + * """ + * if self.counter > 0: # <<<<<<<<<<<<<< + * return self.counter + * + */ + } + + /* "src/gevent/_semaphore.py":97 + * return self.counter + * + * self._wait(timeout) # return value irrelevant, whether we got it or got a timeout # <<<<<<<<<<<<<< + * return self.counter + * + */ + __pyx_t_7.__pyx_n = 1; + __pyx_t_7.timeout = __pyx_v_timeout; + __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_11__semaphore_Semaphore *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._wait(((struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *)__pyx_v_self), &__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 97, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_semaphore.py":98 + * + * self._wait(timeout) # return value irrelevant, whether we got it or got a timeout + * return self.counter # <<<<<<<<<<<<<< + * + * def acquire(self, blocking=True, timeout=None): + */ + __pyx_r = __pyx_v_self->counter; + goto __pyx_L0; + + /* "src/gevent/_semaphore.py":79 + * return True + * + * def wait(self, timeout=None): # <<<<<<<<<<<<<< + * """ + * wait(timeout=None) -> int + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("gevent.__semaphore.Semaphore.wait", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1000; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_11__semaphore_9Semaphore_13wait(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6gevent_11__semaphore_9Semaphore_12wait[] = "Semaphore.wait(self, timeout=None) -> int\n\n wait(timeout=None) -> int\n\n Wait until it is possible to acquire this semaphore, or until the optional\n *timeout* elapses.\n\n .. caution:: If this semaphore was initialized with a size of 0,\n this method will block forever if no timeout is given.\n\n :keyword float timeout: If given, specifies the maximum amount of seconds\n this method will block.\n :return: A number indicating how many times the semaphore can be acquired\n before blocking.\n "; +static PyMethodDef __pyx_mdef_6gevent_11__semaphore_9Semaphore_13wait = {"wait", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_11__semaphore_9Semaphore_13wait, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_11__semaphore_9Semaphore_12wait}; +static PyObject *__pyx_pw_6gevent_11__semaphore_9Semaphore_13wait(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_timeout = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("wait (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_timeout,0}; + PyObject* values[1] = {0}; + values[0] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_timeout); + if (value) { values[0] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "wait") < 0)) __PYX_ERR(0, 79, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_timeout = values[0]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("wait", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 79, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.__semaphore.Semaphore.wait", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_11__semaphore_9Semaphore_12wait(((struct __pyx_obj_6gevent_11__semaphore_Semaphore *)__pyx_v_self), __pyx_v_timeout); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_11__semaphore_9Semaphore_12wait(struct __pyx_obj_6gevent_11__semaphore_Semaphore *__pyx_v_self, PyObject *__pyx_v_timeout) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + struct __pyx_opt_args_6gevent_11__semaphore_9Semaphore_wait __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("wait", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_2.__pyx_n = 1; + __pyx_t_2.timeout = __pyx_v_timeout; + __pyx_t_1 = __pyx_vtabptr_6gevent_11__semaphore_Semaphore->wait(__pyx_v_self, 1, &__pyx_t_2); if (unlikely(__pyx_t_1 == ((int)-1000))) __PYX_ERR(0, 79, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 79, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("gevent.__semaphore.Semaphore.wait", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_semaphore.py":100 + * return self.counter + * + * def acquire(self, blocking=True, timeout=None): # <<<<<<<<<<<<<< + * """ + * acquire(blocking=True, timeout=None) -> bool + */ + +static PyObject *__pyx_pw_6gevent_11__semaphore_9Semaphore_15acquire(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_f_6gevent_11__semaphore_9Semaphore_acquire(struct __pyx_obj_6gevent_11__semaphore_Semaphore *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_11__semaphore_9Semaphore_acquire *__pyx_optional_args) { + int __pyx_v_blocking = ((int)1); + PyObject *__pyx_v_timeout = ((PyObject *)Py_None); + PyObject *__pyx_v_success = NULL; + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + int __pyx_t_8; + struct __pyx_opt_args_6gevent_19__abstract_linkable_16AbstractLinkable__wait __pyx_t_9; + int __pyx_t_10; + __Pyx_RefNannySetupContext("acquire", 0); + if (__pyx_optional_args) { + if (__pyx_optional_args->__pyx_n > 0) { + __pyx_v_blocking = __pyx_optional_args->blocking; + if (__pyx_optional_args->__pyx_n > 1) { + __pyx_v_timeout = __pyx_optional_args->timeout; + } + } + } + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0; + if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self)))))); + else { + PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + #endif + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_acquire); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 100, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_11__semaphore_9Semaphore_15acquire)) { + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_blocking); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 100, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_t_1); + __pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL; + __pyx_t_6 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + __pyx_t_6 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_4)) { + PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_3, __pyx_v_timeout}; + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 100, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { + PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_3, __pyx_v_timeout}; + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 100, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } else + #endif + { + __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 100, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + if (__pyx_t_5) { + __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL; + } + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_t_3); + __Pyx_INCREF(__pyx_v_timeout); + __Pyx_GIVEREF(__pyx_v_timeout); + PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_timeout); + __pyx_t_3 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 100, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 100, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_8; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0; + if (unlikely(type_dict_guard != tp_dict_version)) { + tp_dict_version = obj_dict_version = 0; + } + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + } + #endif + } + + /* "src/gevent/_semaphore.py":121 + * raise a ``Timeout`` exception, if some other caller had already started a timer.) + * """ + * if self.counter > 0: # <<<<<<<<<<<<<< + * self.counter -= 1 + * return True + */ + __pyx_t_8 = ((__pyx_v_self->counter > 0) != 0); + if (__pyx_t_8) { + + /* "src/gevent/_semaphore.py":122 + * """ + * if self.counter > 0: + * self.counter -= 1 # <<<<<<<<<<<<<< + * return True + * + */ + __pyx_v_self->counter = (__pyx_v_self->counter - 1); + + /* "src/gevent/_semaphore.py":123 + * if self.counter > 0: + * self.counter -= 1 + * return True # <<<<<<<<<<<<<< + * + * if not blocking: + */ + __pyx_r = 1; + goto __pyx_L0; + + /* "src/gevent/_semaphore.py":121 + * raise a ``Timeout`` exception, if some other caller had already started a timer.) + * """ + * if self.counter > 0: # <<<<<<<<<<<<<< + * self.counter -= 1 + * return True + */ + } + + /* "src/gevent/_semaphore.py":125 + * return True + * + * if not blocking: # <<<<<<<<<<<<<< + * return False + * + */ + __pyx_t_8 = ((!(__pyx_v_blocking != 0)) != 0); + if (__pyx_t_8) { + + /* "src/gevent/_semaphore.py":126 + * + * if not blocking: + * return False # <<<<<<<<<<<<<< + * + * success = self._wait(timeout) + */ + __pyx_r = 0; + goto __pyx_L0; + + /* "src/gevent/_semaphore.py":125 + * return True + * + * if not blocking: # <<<<<<<<<<<<<< + * return False + * + */ + } + + /* "src/gevent/_semaphore.py":128 + * return False + * + * success = self._wait(timeout) # <<<<<<<<<<<<<< + * if not success: + * # Our timer expired. + */ + __pyx_t_9.__pyx_n = 1; + __pyx_t_9.timeout = __pyx_v_timeout; + __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_11__semaphore_Semaphore *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._wait(((struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *)__pyx_v_self), &__pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 128, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_success = __pyx_t_1; + __pyx_t_1 = 0; + + /* "src/gevent/_semaphore.py":129 + * + * success = self._wait(timeout) + * if not success: # <<<<<<<<<<<<<< + * # Our timer expired. + * return False + */ + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_success); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 129, __pyx_L1_error) + __pyx_t_10 = ((!__pyx_t_8) != 0); + if (__pyx_t_10) { + + /* "src/gevent/_semaphore.py":131 + * if not success: + * # Our timer expired. + * return False # <<<<<<<<<<<<<< + * + * # Neither our timer no another one expired, so we blocked until + */ + __pyx_r = 0; + goto __pyx_L0; + + /* "src/gevent/_semaphore.py":129 + * + * success = self._wait(timeout) + * if not success: # <<<<<<<<<<<<<< + * # Our timer expired. + * return False + */ + } + + /* "src/gevent/_semaphore.py":135 + * # Neither our timer no another one expired, so we blocked until + * # awoke. Therefore, the counter is ours + * self.counter -= 1 # <<<<<<<<<<<<<< + * assert self.counter >= 0 + * return True + */ + __pyx_v_self->counter = (__pyx_v_self->counter - 1); + + /* "src/gevent/_semaphore.py":136 + * # awoke. Therefore, the counter is ours + * self.counter -= 1 + * assert self.counter >= 0 # <<<<<<<<<<<<<< + * return True + * + */ + #ifndef CYTHON_WITHOUT_ASSERTIONS + if (unlikely(!Py_OptimizeFlag)) { + if (unlikely(!((__pyx_v_self->counter >= 0) != 0))) { + PyErr_SetNone(PyExc_AssertionError); + __PYX_ERR(0, 136, __pyx_L1_error) + } + } + #endif + + /* "src/gevent/_semaphore.py":137 + * self.counter -= 1 + * assert self.counter >= 0 + * return True # <<<<<<<<<<<<<< + * + * _py3k_acquire = acquire # PyPy needs this; it must be static for Cython + */ + __pyx_r = 1; + goto __pyx_L0; + + /* "src/gevent/_semaphore.py":100 + * return self.counter + * + * def acquire(self, blocking=True, timeout=None): # <<<<<<<<<<<<<< + * """ + * acquire(blocking=True, timeout=None) -> bool + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("gevent.__semaphore.Semaphore.acquire", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1000; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_success); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_11__semaphore_9Semaphore_15acquire(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6gevent_11__semaphore_9Semaphore_14acquire[] = "Semaphore.acquire(self, int blocking=True, timeout=None) -> bool\n\n acquire(blocking=True, timeout=None) -> bool\n\n Acquire the semaphore.\n\n .. caution:: If this semaphore was initialized with a size of 0,\n this method will block forever (unless a timeout is given or blocking is\n set to false).\n\n :keyword bool blocking: If True (the default), this function will block\n until the semaphore is acquired.\n :keyword float timeout: If given, specifies the maximum amount of seconds\n this method will block.\n :return: A boolean indicating whether the semaphore was acquired.\n If ``blocking`` is True and ``timeout`` is None (the default), then\n (so long as this semaphore was initialized with a size greater than 0)\n this will always return True. If a timeout was given, and it expired before\n the semaphore was acquired, False will be returned. (Note that this can still\n raise a ``Timeout`` exception, if some other caller had already started a timer.)\n "; +static PyMethodDef __pyx_mdef_6gevent_11__semaphore_9Semaphore_15acquire = {"acquire", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_11__semaphore_9Semaphore_15acquire, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_11__semaphore_9Semaphore_14acquire}; +static PyObject *__pyx_pw_6gevent_11__semaphore_9Semaphore_15acquire(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + int __pyx_v_blocking; + PyObject *__pyx_v_timeout = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("acquire (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_blocking,&__pyx_n_s_timeout,0}; + PyObject* values[2] = {0,0}; + values[1] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_blocking); + if (value) { values[0] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 1: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_timeout); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "acquire") < 0)) __PYX_ERR(0, 100, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + } + if (values[0]) { + __pyx_v_blocking = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_blocking == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 100, __pyx_L3_error) + } else { + __pyx_v_blocking = ((int)1); + } + __pyx_v_timeout = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("acquire", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 100, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.__semaphore.Semaphore.acquire", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_11__semaphore_9Semaphore_14acquire(((struct __pyx_obj_6gevent_11__semaphore_Semaphore *)__pyx_v_self), __pyx_v_blocking, __pyx_v_timeout); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_11__semaphore_9Semaphore_14acquire(struct __pyx_obj_6gevent_11__semaphore_Semaphore *__pyx_v_self, int __pyx_v_blocking, PyObject *__pyx_v_timeout) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + struct __pyx_opt_args_6gevent_11__semaphore_9Semaphore_acquire __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("acquire", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_2.__pyx_n = 2; + __pyx_t_2.blocking = __pyx_v_blocking; + __pyx_t_2.timeout = __pyx_v_timeout; + __pyx_t_1 = __pyx_vtabptr_6gevent_11__semaphore_Semaphore->acquire(__pyx_v_self, 1, &__pyx_t_2); if (unlikely(__pyx_t_1 == ((int)-1000))) __PYX_ERR(0, 100, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 100, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("gevent.__semaphore.Semaphore.acquire", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_semaphore.py":141 + * _py3k_acquire = acquire # PyPy needs this; it must be static for Cython + * + * def __enter__(self): # <<<<<<<<<<<<<< + * self.acquire() + * + */ + +static PyObject *__pyx_pw_6gevent_11__semaphore_9Semaphore_17__enter__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_f_6gevent_11__semaphore_9Semaphore___enter__(struct __pyx_obj_6gevent_11__semaphore_Semaphore *__pyx_v_self, int __pyx_skip_dispatch) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + __Pyx_RefNannySetupContext("__enter__", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0; + if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self)))))); + else { + PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + #endif + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_enter); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 141, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_11__semaphore_9Semaphore_17__enter__)) { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 141, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0; + if (unlikely(type_dict_guard != tp_dict_version)) { + tp_dict_version = obj_dict_version = 0; + } + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + } + #endif + } + + /* "src/gevent/_semaphore.py":142 + * + * def __enter__(self): + * self.acquire() # <<<<<<<<<<<<<< + * + * def __exit__(self, t, v, tb): + */ + __pyx_t_5 = ((struct __pyx_vtabstruct_6gevent_11__semaphore_Semaphore *)__pyx_v_self->__pyx_base.__pyx_vtab)->acquire(__pyx_v_self, 0, NULL); if (unlikely(__pyx_t_5 == ((int)-1000))) __PYX_ERR(0, 142, __pyx_L1_error) + + /* "src/gevent/_semaphore.py":141 + * _py3k_acquire = acquire # PyPy needs this; it must be static for Cython + * + * def __enter__(self): # <<<<<<<<<<<<<< + * self.acquire() + * + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("gevent.__semaphore.Semaphore.__enter__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_11__semaphore_9Semaphore_17__enter__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6gevent_11__semaphore_9Semaphore_16__enter__[] = "Semaphore.__enter__(self)"; +static PyMethodDef __pyx_mdef_6gevent_11__semaphore_9Semaphore_17__enter__ = {"__enter__", (PyCFunction)__pyx_pw_6gevent_11__semaphore_9Semaphore_17__enter__, METH_NOARGS, __pyx_doc_6gevent_11__semaphore_9Semaphore_16__enter__}; +static PyObject *__pyx_pw_6gevent_11__semaphore_9Semaphore_17__enter__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__enter__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_11__semaphore_9Semaphore_16__enter__(((struct __pyx_obj_6gevent_11__semaphore_Semaphore *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_11__semaphore_9Semaphore_16__enter__(struct __pyx_obj_6gevent_11__semaphore_Semaphore *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__enter__", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6gevent_11__semaphore_9Semaphore___enter__(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 141, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__semaphore.Semaphore.__enter__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_semaphore.py":144 + * self.acquire() + * + * def __exit__(self, t, v, tb): # <<<<<<<<<<<<<< + * self.release() + * + */ + +static PyObject *__pyx_pw_6gevent_11__semaphore_9Semaphore_19__exit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_6gevent_11__semaphore_9Semaphore___exit__(struct __pyx_obj_6gevent_11__semaphore_Semaphore *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_t, CYTHON_UNUSED PyObject *__pyx_v_v, CYTHON_UNUSED PyObject *__pyx_v_tb, int __pyx_skip_dispatch) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + __Pyx_RefNannySetupContext("__exit__", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0; + if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self)))))); + else { + PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + #endif + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_exit); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 144, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_11__semaphore_9Semaphore_19__exit__)) { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; + __pyx_t_5 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_5 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_3)) { + PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_t, __pyx_v_v, __pyx_v_tb}; + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 144, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GOTREF(__pyx_t_2); + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { + PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_t, __pyx_v_v, __pyx_v_tb}; + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 144, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GOTREF(__pyx_t_2); + } else + #endif + { + __pyx_t_6 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 144, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (__pyx_t_4) { + __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL; + } + __Pyx_INCREF(__pyx_v_t); + __Pyx_GIVEREF(__pyx_v_t); + PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_t); + __Pyx_INCREF(__pyx_v_v); + __Pyx_GIVEREF(__pyx_v_v); + PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_v); + __Pyx_INCREF(__pyx_v_tb); + __Pyx_GIVEREF(__pyx_v_tb); + PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_v_tb); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 144, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0; + if (unlikely(type_dict_guard != tp_dict_version)) { + tp_dict_version = obj_dict_version = 0; + } + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + } + #endif + } + + /* "src/gevent/_semaphore.py":145 + * + * def __exit__(self, t, v, tb): + * self.release() # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_5 = ((struct __pyx_vtabstruct_6gevent_11__semaphore_Semaphore *)__pyx_v_self->__pyx_base.__pyx_vtab)->release(__pyx_v_self, 0); if (unlikely(__pyx_t_5 == ((int)-1000))) __PYX_ERR(0, 145, __pyx_L1_error) + + /* "src/gevent/_semaphore.py":144 + * self.acquire() + * + * def __exit__(self, t, v, tb): # <<<<<<<<<<<<<< + * self.release() + * + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("gevent.__semaphore.Semaphore.__exit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_11__semaphore_9Semaphore_19__exit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6gevent_11__semaphore_9Semaphore_18__exit__[] = "Semaphore.__exit__(self, t, v, tb)"; +static PyMethodDef __pyx_mdef_6gevent_11__semaphore_9Semaphore_19__exit__ = {"__exit__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_11__semaphore_9Semaphore_19__exit__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_11__semaphore_9Semaphore_18__exit__}; +static PyObject *__pyx_pw_6gevent_11__semaphore_9Semaphore_19__exit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_t = 0; + PyObject *__pyx_v_v = 0; + PyObject *__pyx_v_tb = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__exit__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_t,&__pyx_n_s_v,&__pyx_n_s_tb,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_v)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, 1); __PYX_ERR(0, 144, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tb)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, 2); __PYX_ERR(0, 144, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__exit__") < 0)) __PYX_ERR(0, 144, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + } + __pyx_v_t = values[0]; + __pyx_v_v = values[1]; + __pyx_v_tb = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 144, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.__semaphore.Semaphore.__exit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_11__semaphore_9Semaphore_18__exit__(((struct __pyx_obj_6gevent_11__semaphore_Semaphore *)__pyx_v_self), __pyx_v_t, __pyx_v_v, __pyx_v_tb); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_11__semaphore_9Semaphore_18__exit__(struct __pyx_obj_6gevent_11__semaphore_Semaphore *__pyx_v_self, PyObject *__pyx_v_t, PyObject *__pyx_v_v, PyObject *__pyx_v_tb) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__exit__", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6gevent_11__semaphore_9Semaphore___exit__(__pyx_v_self, __pyx_v_t, __pyx_v_v, __pyx_v_tb, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 144, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__semaphore.Semaphore.__exit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/__semaphore.pxd":8 + * + * cdef class Semaphore(AbstractLinkable): + * cdef public int counter # <<<<<<<<<<<<<< + * + * cpdef bint locked(self) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_11__semaphore_9Semaphore_7counter_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_11__semaphore_9Semaphore_7counter_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_11__semaphore_9Semaphore_7counter___get__(((struct __pyx_obj_6gevent_11__semaphore_Semaphore *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_11__semaphore_9Semaphore_7counter___get__(struct __pyx_obj_6gevent_11__semaphore_Semaphore *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->counter); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 8, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__semaphore.Semaphore.counter.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6gevent_11__semaphore_9Semaphore_7counter_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6gevent_11__semaphore_9Semaphore_7counter_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_11__semaphore_9Semaphore_7counter_2__set__(((struct __pyx_obj_6gevent_11__semaphore_Semaphore *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_11__semaphore_9Semaphore_7counter_2__set__(struct __pyx_obj_6gevent_11__semaphore_Semaphore *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("__set__", 0); + __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 8, __pyx_L1_error) + __pyx_v_self->counter = __pyx_t_1; + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("gevent.__semaphore.Semaphore.counter.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_semaphore.py":164 + * _OVER_RELEASE_ERROR = ValueError + * + * def __init__(self, *args, **kwargs): # <<<<<<<<<<<<<< + * Semaphore.__init__(self, *args, **kwargs) + * self._initial_value = self.counter + */ + +/* Python wrapper */ +static int __pyx_pw_6gevent_11__semaphore_16BoundedSemaphore_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6gevent_11__semaphore_16BoundedSemaphore_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_args = 0; + PyObject *__pyx_v_kwargs = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 1))) return -1; + if (unlikely(__pyx_kwds)) { + __pyx_v_kwargs = PyDict_Copy(__pyx_kwds); if (unlikely(!__pyx_v_kwargs)) return -1; + __Pyx_GOTREF(__pyx_v_kwargs); + } else { + __pyx_v_kwargs = NULL; + } + __Pyx_INCREF(__pyx_args); + __pyx_v_args = __pyx_args; + __pyx_r = __pyx_pf_6gevent_11__semaphore_16BoundedSemaphore___init__(((struct __pyx_obj_6gevent_11__semaphore_BoundedSemaphore *)__pyx_v_self), __pyx_v_args, __pyx_v_kwargs); + + /* function exit code */ + __Pyx_XDECREF(__pyx_v_args); + __Pyx_XDECREF(__pyx_v_kwargs); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_11__semaphore_16BoundedSemaphore___init__(struct __pyx_obj_6gevent_11__semaphore_BoundedSemaphore *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "src/gevent/_semaphore.py":165 + * + * def __init__(self, *args, **kwargs): + * Semaphore.__init__(self, *args, **kwargs) # <<<<<<<<<<<<<< + * self._initial_value = self.counter + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_6gevent_11__semaphore_Semaphore), __pyx_n_s_init); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 165, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 165, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self)); + __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_v_args); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 165, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 165, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/_semaphore.py":166 + * def __init__(self, *args, **kwargs): + * Semaphore.__init__(self, *args, **kwargs) + * self._initial_value = self.counter # <<<<<<<<<<<<<< + * + * def release(self): + */ + __pyx_t_4 = __pyx_v_self->__pyx_base.counter; + __pyx_v_self->_initial_value = __pyx_t_4; + + /* "src/gevent/_semaphore.py":164 + * _OVER_RELEASE_ERROR = ValueError + * + * def __init__(self, *args, **kwargs): # <<<<<<<<<<<<<< + * Semaphore.__init__(self, *args, **kwargs) + * self._initial_value = self.counter + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("gevent.__semaphore.BoundedSemaphore.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_semaphore.py":168 + * self._initial_value = self.counter + * + * def release(self): # <<<<<<<<<<<<<< + * if self.counter >= self._initial_value: + * raise self._OVER_RELEASE_ERROR("Semaphore released too many times") + */ + +static PyObject *__pyx_pw_6gevent_11__semaphore_16BoundedSemaphore_3release(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static int __pyx_f_6gevent_11__semaphore_16BoundedSemaphore_release(struct __pyx_obj_6gevent_11__semaphore_BoundedSemaphore *__pyx_v_self, int __pyx_skip_dispatch) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + int __pyx_t_6; + __Pyx_RefNannySetupContext("release", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0; + if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self)))))); + else { + PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + #endif + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_release); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 168, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_11__semaphore_16BoundedSemaphore_3release)) { + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 168, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 168, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_5; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0; + if (unlikely(type_dict_guard != tp_dict_version)) { + tp_dict_version = obj_dict_version = 0; + } + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + } + #endif + } + + /* "src/gevent/_semaphore.py":169 + * + * def release(self): + * if self.counter >= self._initial_value: # <<<<<<<<<<<<<< + * raise self._OVER_RELEASE_ERROR("Semaphore released too many times") + * Semaphore.release(self) + */ + __pyx_t_6 = ((__pyx_v_self->__pyx_base.counter >= __pyx_v_self->_initial_value) != 0); + if (unlikely(__pyx_t_6)) { + + /* "src/gevent/_semaphore.py":170 + * def release(self): + * if self.counter >= self._initial_value: + * raise self._OVER_RELEASE_ERROR("Semaphore released too many times") # <<<<<<<<<<<<<< + * Semaphore.release(self) + * + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_OVER_RELEASE_ERROR); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 170, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_kp_s_Semaphore_released_too_many_time) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_kp_s_Semaphore_released_too_many_time); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 170, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 170, __pyx_L1_error) + + /* "src/gevent/_semaphore.py":169 + * + * def release(self): + * if self.counter >= self._initial_value: # <<<<<<<<<<<<<< + * raise self._OVER_RELEASE_ERROR("Semaphore released too many times") + * Semaphore.release(self) + */ + } + + /* "src/gevent/_semaphore.py":171 + * if self.counter >= self._initial_value: + * raise self._OVER_RELEASE_ERROR("Semaphore released too many times") + * Semaphore.release(self) # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_5 = __pyx_f_6gevent_11__semaphore_9Semaphore_release(((struct __pyx_obj_6gevent_11__semaphore_Semaphore *)__pyx_v_self), 1); if (unlikely(__pyx_t_5 == ((int)-1000))) __PYX_ERR(0, 171, __pyx_L1_error) + + /* "src/gevent/_semaphore.py":168 + * self._initial_value = self.counter + * + * def release(self): # <<<<<<<<<<<<<< + * if self.counter >= self._initial_value: + * raise self._OVER_RELEASE_ERROR("Semaphore released too many times") + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("gevent.__semaphore.BoundedSemaphore.release", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1000; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_11__semaphore_16BoundedSemaphore_3release(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6gevent_11__semaphore_16BoundedSemaphore_2release[] = "BoundedSemaphore.release(self) -> int"; +static PyMethodDef __pyx_mdef_6gevent_11__semaphore_16BoundedSemaphore_3release = {"release", (PyCFunction)__pyx_pw_6gevent_11__semaphore_16BoundedSemaphore_3release, METH_NOARGS, __pyx_doc_6gevent_11__semaphore_16BoundedSemaphore_2release}; +static PyObject *__pyx_pw_6gevent_11__semaphore_16BoundedSemaphore_3release(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("release (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_11__semaphore_16BoundedSemaphore_2release(((struct __pyx_obj_6gevent_11__semaphore_BoundedSemaphore *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_11__semaphore_16BoundedSemaphore_2release(struct __pyx_obj_6gevent_11__semaphore_BoundedSemaphore *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("release", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6gevent_11__semaphore_16BoundedSemaphore_release(__pyx_v_self, 1); if (unlikely(__pyx_t_1 == ((int)-1000))) __PYX_ERR(0, 168, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 168, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent.__semaphore.BoundedSemaphore.release", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/__semaphore.pxd":21 + * + * cdef class BoundedSemaphore(Semaphore): + * cdef readonly int _initial_value # <<<<<<<<<<<<<< + * + * cpdef int release(self) except -1000 + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_11__semaphore_16BoundedSemaphore_14_initial_value_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_11__semaphore_16BoundedSemaphore_14_initial_value_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_11__semaphore_16BoundedSemaphore_14_initial_value___get__(((struct __pyx_obj_6gevent_11__semaphore_BoundedSemaphore *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_11__semaphore_16BoundedSemaphore_14_initial_value___get__(struct __pyx_obj_6gevent_11__semaphore_BoundedSemaphore *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->_initial_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 21, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__semaphore.BoundedSemaphore._initial_value.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/__greenlet_primitives.pxd":23 + * + * @cython.final + * cdef inline greenlet getcurrent(): # <<<<<<<<<<<<<< + * return PyGreenlet_GetCurrent() + * + */ + +static CYTHON_INLINE PyGreenlet *__pyx_f_6gevent_21__greenlet_primitives_getcurrent(void) { + PyGreenlet *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("getcurrent", 0); + + /* "gevent/__greenlet_primitives.pxd":24 + * @cython.final + * cdef inline greenlet getcurrent(): + * return PyGreenlet_GetCurrent() # <<<<<<<<<<<<<< + * + * cdef bint _greenlet_imported + */ + __Pyx_XDECREF(((PyObject *)__pyx_r)); + __pyx_t_1 = ((PyObject *)PyGreenlet_GetCurrent()); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 24, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = ((PyGreenlet *)__pyx_t_1); + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "gevent/__greenlet_primitives.pxd":23 + * + * @cython.final + * cdef inline greenlet getcurrent(): # <<<<<<<<<<<<<< + * return PyGreenlet_GetCurrent() + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__greenlet_primitives.getcurrent", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF((PyObject *)__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/__greenlet_primitives.pxd":28 + * cdef bint _greenlet_imported + * + * cdef inline void greenlet_init(): # <<<<<<<<<<<<<< + * global _greenlet_imported + * if not _greenlet_imported: + */ + +static CYTHON_INLINE void __pyx_f_6gevent_21__greenlet_primitives_greenlet_init(void) { + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("greenlet_init", 0); + + /* "gevent/__greenlet_primitives.pxd":30 + * cdef inline void greenlet_init(): + * global _greenlet_imported + * if not _greenlet_imported: # <<<<<<<<<<<<<< + * PyGreenlet_Import() + * _greenlet_imported = True + */ + __pyx_t_1 = ((!(__pyx_v_6gevent_21__greenlet_primitives__greenlet_imported != 0)) != 0); + if (__pyx_t_1) { + + /* "gevent/__greenlet_primitives.pxd":31 + * global _greenlet_imported + * if not _greenlet_imported: + * PyGreenlet_Import() # <<<<<<<<<<<<<< + * _greenlet_imported = True + * + */ + PyGreenlet_Import(); + + /* "gevent/__greenlet_primitives.pxd":32 + * if not _greenlet_imported: + * PyGreenlet_Import() + * _greenlet_imported = True # <<<<<<<<<<<<<< + * + * cdef inline object _greenlet_switch(greenlet self): + */ + __pyx_v_6gevent_21__greenlet_primitives__greenlet_imported = 1; + + /* "gevent/__greenlet_primitives.pxd":30 + * cdef inline void greenlet_init(): + * global _greenlet_imported + * if not _greenlet_imported: # <<<<<<<<<<<<<< + * PyGreenlet_Import() + * _greenlet_imported = True + */ + } + + /* "gevent/__greenlet_primitives.pxd":28 + * cdef bint _greenlet_imported + * + * cdef inline void greenlet_init(): # <<<<<<<<<<<<<< + * global _greenlet_imported + * if not _greenlet_imported: + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "gevent/__greenlet_primitives.pxd":34 + * _greenlet_imported = True + * + * cdef inline object _greenlet_switch(greenlet self): # <<<<<<<<<<<<<< + * return PyGreenlet_Switch(self, NULL, NULL) + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_6gevent_21__greenlet_primitives__greenlet_switch(PyGreenlet *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("_greenlet_switch", 0); + + /* "gevent/__greenlet_primitives.pxd":35 + * + * cdef inline object _greenlet_switch(greenlet self): + * return PyGreenlet_Switch(self, NULL, NULL) # <<<<<<<<<<<<<< + * + * cdef class TrackedRawGreenlet(greenlet): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyGreenlet_Switch(__pyx_v_self, NULL, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 35, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "gevent/__greenlet_primitives.pxd":34 + * _greenlet_imported = True + * + * cdef inline object _greenlet_switch(greenlet self): # <<<<<<<<<<<<<< + * return PyGreenlet_Switch(self, NULL, NULL) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__greenlet_primitives._greenlet_switch", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/__abstract_linkable.pxd":21 + * void PyGreenlet_Import() + * + * cdef inline greenlet getcurrent(): # <<<<<<<<<<<<<< + * return PyGreenlet_GetCurrent() + * + */ + +static CYTHON_INLINE PyGreenlet *__pyx_f_6gevent_19__abstract_linkable_getcurrent(void) { + PyGreenlet *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("getcurrent", 0); + + /* "gevent/__abstract_linkable.pxd":22 + * + * cdef inline greenlet getcurrent(): + * return PyGreenlet_GetCurrent() # <<<<<<<<<<<<<< + * + * cdef inline void greenlet_init(): + */ + __Pyx_XDECREF(((PyObject *)__pyx_r)); + __pyx_t_1 = ((PyObject *)PyGreenlet_GetCurrent()); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 22, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = ((PyGreenlet *)__pyx_t_1); + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "gevent/__abstract_linkable.pxd":21 + * void PyGreenlet_Import() + * + * cdef inline greenlet getcurrent(): # <<<<<<<<<<<<<< + * return PyGreenlet_GetCurrent() + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__abstract_linkable.getcurrent", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF((PyObject *)__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/__abstract_linkable.pxd":24 + * return PyGreenlet_GetCurrent() + * + * cdef inline void greenlet_init(): # <<<<<<<<<<<<<< + * global _greenlet_imported + * if not _greenlet_imported: + */ + +static CYTHON_INLINE void __pyx_f_6gevent_19__abstract_linkable_greenlet_init(void) { + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("greenlet_init", 0); + + /* "gevent/__abstract_linkable.pxd":26 + * cdef inline void greenlet_init(): + * global _greenlet_imported + * if not _greenlet_imported: # <<<<<<<<<<<<<< + * PyGreenlet_Import() + * _greenlet_imported = True + */ + __pyx_t_1 = ((!(__pyx_v_6gevent_19__abstract_linkable__greenlet_imported != 0)) != 0); + if (__pyx_t_1) { + + /* "gevent/__abstract_linkable.pxd":27 + * global _greenlet_imported + * if not _greenlet_imported: + * PyGreenlet_Import() # <<<<<<<<<<<<<< + * _greenlet_imported = True + * + */ + PyGreenlet_Import(); + + /* "gevent/__abstract_linkable.pxd":28 + * if not _greenlet_imported: + * PyGreenlet_Import() + * _greenlet_imported = True # <<<<<<<<<<<<<< + * + * cdef void _init() + */ + __pyx_v_6gevent_19__abstract_linkable__greenlet_imported = 1; + + /* "gevent/__abstract_linkable.pxd":26 + * cdef inline void greenlet_init(): + * global _greenlet_imported + * if not _greenlet_imported: # <<<<<<<<<<<<<< + * PyGreenlet_Import() + * _greenlet_imported = True + */ + } + + /* "gevent/__abstract_linkable.pxd":24 + * return PyGreenlet_GetCurrent() + * + * cdef inline void greenlet_init(): # <<<<<<<<<<<<<< + * global _greenlet_imported + * if not _greenlet_imported: + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} +static struct __pyx_vtabstruct_6gevent_11__semaphore_Semaphore __pyx_vtable_6gevent_11__semaphore_Semaphore; + +static PyObject *__pyx_tp_new_6gevent_11__semaphore_Semaphore(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_6gevent_11__semaphore_Semaphore *p; + PyObject *o = __pyx_ptype_6gevent_19__abstract_linkable_AbstractLinkable->tp_new(t, a, k); + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_6gevent_11__semaphore_Semaphore *)o); + p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_6gevent_19__abstract_linkable_AbstractLinkable*)__pyx_vtabptr_6gevent_11__semaphore_Semaphore; + return o; +} + +static void __pyx_tp_dealloc_6gevent_11__semaphore_Semaphore(PyObject *o) { + #if CYTHON_USE_TP_FINALIZE + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + PyObject_GC_UnTrack(o); + PyObject_GC_Track(o); + if (likely(__pyx_ptype_6gevent_19__abstract_linkable_AbstractLinkable)) __pyx_ptype_6gevent_19__abstract_linkable_AbstractLinkable->tp_dealloc(o); else __Pyx_call_next_tp_dealloc(o, __pyx_tp_dealloc_6gevent_11__semaphore_Semaphore); +} + +static int __pyx_tp_traverse_6gevent_11__semaphore_Semaphore(PyObject *o, visitproc v, void *a) { + int e; + e = ((likely(__pyx_ptype_6gevent_19__abstract_linkable_AbstractLinkable)) ? ((__pyx_ptype_6gevent_19__abstract_linkable_AbstractLinkable->tp_traverse) ? __pyx_ptype_6gevent_19__abstract_linkable_AbstractLinkable->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_6gevent_11__semaphore_Semaphore)); if (e) return e; + return 0; +} + +static int __pyx_tp_clear_6gevent_11__semaphore_Semaphore(PyObject *o) { + if (likely(__pyx_ptype_6gevent_19__abstract_linkable_AbstractLinkable)) { if (__pyx_ptype_6gevent_19__abstract_linkable_AbstractLinkable->tp_clear) __pyx_ptype_6gevent_19__abstract_linkable_AbstractLinkable->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_6gevent_11__semaphore_Semaphore); + return 0; +} + +static PyObject *__pyx_getprop_6gevent_11__semaphore_9Semaphore_counter(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_11__semaphore_9Semaphore_7counter_1__get__(o); +} + +static int __pyx_setprop_6gevent_11__semaphore_9Semaphore_counter(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6gevent_11__semaphore_9Semaphore_7counter_3__set__(o, v); + } + else { + PyErr_SetString(PyExc_NotImplementedError, "__del__"); + return -1; + } +} + +static PyMethodDef __pyx_methods_6gevent_11__semaphore_Semaphore[] = { + {0, 0, 0, 0} +}; + +static struct PyGetSetDef __pyx_getsets_6gevent_11__semaphore_Semaphore[] = { + {(char *)"counter", __pyx_getprop_6gevent_11__semaphore_9Semaphore_counter, __pyx_setprop_6gevent_11__semaphore_9Semaphore_counter, (char *)"counter: 'int'", 0}, + {0, 0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_6gevent_11__semaphore_Semaphore = { + PyVarObject_HEAD_INIT(0, 0) + "gevent.__semaphore.Semaphore", /*tp_name*/ + sizeof(struct __pyx_obj_6gevent_11__semaphore_Semaphore), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6gevent_11__semaphore_Semaphore, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + __pyx_pw_6gevent_11__semaphore_9Semaphore_3__str__, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + "Semaphore(value=1)\n\n Semaphore(value=1) -> Semaphore\n\n A semaphore manages a counter representing the number of release()\n calls minus the number of acquire() calls, plus an initial value.\n The acquire() method blocks if necessary until it can return\n without making the counter negative.\n\n If not given, ``value`` defaults to 1.\n\n The semaphore is a context manager and can be used in ``with`` statements.\n\n This Semaphore's ``__exit__`` method does not call the trace function\n on CPython, but does under PyPy.\n\n .. seealso:: :class:`BoundedSemaphore` for a safer version that prevents\n some classes of bugs.\n\n .. versionchanged:: 1.4.0\n\n The order in which waiters are awakened is not specified. It was not\n specified previously, but usually went in FIFO order.\n ", /*tp_doc*/ + __pyx_tp_traverse_6gevent_11__semaphore_Semaphore, /*tp_traverse*/ + __pyx_tp_clear_6gevent_11__semaphore_Semaphore, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6gevent_11__semaphore_Semaphore, /*tp_methods*/ + 0, /*tp_members*/ + __pyx_getsets_6gevent_11__semaphore_Semaphore, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_pw_6gevent_11__semaphore_9Semaphore_1__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6gevent_11__semaphore_Semaphore, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; +static struct __pyx_vtabstruct_6gevent_11__semaphore_BoundedSemaphore __pyx_vtable_6gevent_11__semaphore_BoundedSemaphore; + +static PyObject *__pyx_tp_new_6gevent_11__semaphore_BoundedSemaphore(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_6gevent_11__semaphore_BoundedSemaphore *p; + PyObject *o = __pyx_tp_new_6gevent_11__semaphore_Semaphore(t, a, k); + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_6gevent_11__semaphore_BoundedSemaphore *)o); + p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_6gevent_19__abstract_linkable_AbstractLinkable*)__pyx_vtabptr_6gevent_11__semaphore_BoundedSemaphore; + return o; +} + +static PyObject *__pyx_getprop_6gevent_11__semaphore_16BoundedSemaphore__initial_value(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_11__semaphore_16BoundedSemaphore_14_initial_value_1__get__(o); +} + +static PyMethodDef __pyx_methods_6gevent_11__semaphore_BoundedSemaphore[] = { + {0, 0, 0, 0} +}; + +static struct PyGetSetDef __pyx_getsets_6gevent_11__semaphore_BoundedSemaphore[] = { + {(char *)"_initial_value", __pyx_getprop_6gevent_11__semaphore_16BoundedSemaphore__initial_value, 0, (char *)0, 0}, + {0, 0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_6gevent_11__semaphore_BoundedSemaphore = { + PyVarObject_HEAD_INIT(0, 0) + "gevent.__semaphore.BoundedSemaphore", /*tp_name*/ + sizeof(struct __pyx_obj_6gevent_11__semaphore_BoundedSemaphore), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6gevent_11__semaphore_Semaphore, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_6gevent_11__semaphore_9Semaphore_3__str__, /*tp_str*/ + #else + 0, /*tp_str*/ + #endif + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + "BoundedSemaphore(*args, **kwargs)\n\n BoundedSemaphore(value=1) -> BoundedSemaphore\n\n A bounded semaphore checks to make sure its current value doesn't\n exceed its initial value. If it does, :class:`ValueError` is\n raised. In most situations semaphores are used to guard resources\n with limited capacity. If the semaphore is released too many times\n it's a sign of a bug.\n\n If not given, *value* defaults to 1.\n ", /*tp_doc*/ + __pyx_tp_traverse_6gevent_11__semaphore_Semaphore, /*tp_traverse*/ + __pyx_tp_clear_6gevent_11__semaphore_Semaphore, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6gevent_11__semaphore_BoundedSemaphore, /*tp_methods*/ + 0, /*tp_members*/ + __pyx_getsets_6gevent_11__semaphore_BoundedSemaphore, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_pw_6gevent_11__semaphore_16BoundedSemaphore_1__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6gevent_11__semaphore_BoundedSemaphore, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static PyMethodDef __pyx_methods[] = { + {0, 0, 0, 0} +}; + +#if PY_MAJOR_VERSION >= 3 +#if CYTHON_PEP489_MULTI_PHASE_INIT +static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ +static int __pyx_pymod_exec___semaphore(PyObject* module); /*proto*/ +static PyModuleDef_Slot __pyx_moduledef_slots[] = { + {Py_mod_create, (void*)__pyx_pymod_create}, + {Py_mod_exec, (void*)__pyx_pymod_exec___semaphore}, + {0, NULL} +}; +#endif + +static struct PyModuleDef __pyx_moduledef = { + PyModuleDef_HEAD_INIT, + "__semaphore", + 0, /* m_doc */ + #if CYTHON_PEP489_MULTI_PHASE_INIT + 0, /* m_size */ + #else + -1, /* m_size */ + #endif + __pyx_methods /* m_methods */, + #if CYTHON_PEP489_MULTI_PHASE_INIT + __pyx_moduledef_slots, /* m_slots */ + #else + NULL, /* m_reload */ + #endif + NULL, /* m_traverse */ + NULL, /* m_clear */ + NULL /* m_free */ +}; +#endif +#ifndef CYTHON_SMALL_CODE +#if defined(__clang__) + #define CYTHON_SMALL_CODE +#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) + #define CYTHON_SMALL_CODE __attribute__((cold)) +#else + #define CYTHON_SMALL_CODE +#endif +#endif + +static __Pyx_StringTabEntry __pyx_string_tab[] = { + {&__pyx_n_s_AbstractLinkable, __pyx_k_AbstractLinkable, sizeof(__pyx_k_AbstractLinkable), 0, 0, 1, 1}, + {&__pyx_n_s_BoundedSemaphore, __pyx_k_BoundedSemaphore, sizeof(__pyx_k_BoundedSemaphore), 0, 0, 1, 1}, + {&__pyx_n_s_BoundedSemaphore_release, __pyx_k_BoundedSemaphore_release, sizeof(__pyx_k_BoundedSemaphore_release), 0, 0, 1, 1}, + {&__pyx_n_s_OVER_RELEASE_ERROR, __pyx_k_OVER_RELEASE_ERROR, sizeof(__pyx_k_OVER_RELEASE_ERROR), 0, 0, 1, 1}, + {&__pyx_n_s_Semaphore, __pyx_k_Semaphore, sizeof(__pyx_k_Semaphore), 0, 0, 1, 1}, + {&__pyx_n_s_Semaphore___enter, __pyx_k_Semaphore___enter, sizeof(__pyx_k_Semaphore___enter), 0, 0, 1, 1}, + {&__pyx_n_s_Semaphore___exit, __pyx_k_Semaphore___exit, sizeof(__pyx_k_Semaphore___exit), 0, 0, 1, 1}, + {&__pyx_n_s_Semaphore__start_notify, __pyx_k_Semaphore__start_notify, sizeof(__pyx_k_Semaphore__start_notify), 0, 0, 1, 1}, + {&__pyx_n_s_Semaphore_acquire, __pyx_k_Semaphore_acquire, sizeof(__pyx_k_Semaphore_acquire), 0, 0, 1, 1}, + {&__pyx_n_s_Semaphore_locked, __pyx_k_Semaphore_locked, sizeof(__pyx_k_Semaphore_locked), 0, 0, 1, 1}, + {&__pyx_n_s_Semaphore_ready, __pyx_k_Semaphore_ready, sizeof(__pyx_k_Semaphore_ready), 0, 0, 1, 1}, + {&__pyx_n_s_Semaphore_release, __pyx_k_Semaphore_release, sizeof(__pyx_k_Semaphore_release), 0, 0, 1, 1}, + {&__pyx_kp_s_Semaphore_released_too_many_time, __pyx_k_Semaphore_released_too_many_time, sizeof(__pyx_k_Semaphore_released_too_many_time), 0, 0, 1, 0}, + {&__pyx_n_s_Semaphore_wait, __pyx_k_Semaphore_wait, sizeof(__pyx_k_Semaphore_wait), 0, 0, 1, 1}, + {&__pyx_n_s_Timeout, __pyx_k_Timeout, sizeof(__pyx_k_Timeout), 0, 0, 1, 1}, + {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1}, + {&__pyx_n_s_abstract_linkable, __pyx_k_abstract_linkable, sizeof(__pyx_k_abstract_linkable), 0, 0, 1, 1}, + {&__pyx_n_s_acquire, __pyx_k_acquire, sizeof(__pyx_k_acquire), 0, 0, 1, 1}, + {&__pyx_n_s_all, __pyx_k_all, sizeof(__pyx_k_all), 0, 0, 1, 1}, + {&__pyx_n_s_blocking, __pyx_k_blocking, sizeof(__pyx_k_blocking), 0, 0, 1, 1}, + {&__pyx_n_s_class, __pyx_k_class, sizeof(__pyx_k_class), 0, 0, 1, 1}, + {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, + {&__pyx_n_s_enter, __pyx_k_enter, sizeof(__pyx_k_enter), 0, 0, 1, 1}, + {&__pyx_n_s_exit, __pyx_k_exit, sizeof(__pyx_k_exit), 0, 0, 1, 1}, + {&__pyx_n_s_get_linkable, __pyx_k_get_linkable, sizeof(__pyx_k_get_linkable), 0, 0, 1, 1}, + {&__pyx_n_s_gevent___semaphore, __pyx_k_gevent___semaphore, sizeof(__pyx_k_gevent___semaphore), 0, 0, 1, 1}, + {&__pyx_kp_s_gevent__abstract_linkable, __pyx_k_gevent__abstract_linkable, sizeof(__pyx_k_gevent__abstract_linkable), 0, 0, 1, 0}, + {&__pyx_n_s_gevent__util, __pyx_k_gevent__util, sizeof(__pyx_k_gevent__util), 0, 0, 1, 1}, + {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, + {&__pyx_n_s_import_c_accel, __pyx_k_import_c_accel, sizeof(__pyx_k_import_c_accel), 0, 0, 1, 1}, + {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1}, + {&__pyx_n_s_linkcount, __pyx_k_linkcount, sizeof(__pyx_k_linkcount), 0, 0, 1, 1}, + {&__pyx_n_s_locked, __pyx_k_locked, sizeof(__pyx_k_locked), 0, 0, 1, 1}, + {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, + {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, + {&__pyx_n_s_py3k_acquire, __pyx_k_py3k_acquire, sizeof(__pyx_k_py3k_acquire), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_capi, __pyx_k_pyx_capi, sizeof(__pyx_k_pyx_capi), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1}, + {&__pyx_n_s_ready, __pyx_k_ready, sizeof(__pyx_k_ready), 0, 0, 1, 1}, + {&__pyx_n_s_release, __pyx_k_release, sizeof(__pyx_k_release), 0, 0, 1, 1}, + {&__pyx_kp_s_s_counter_s__links_s, __pyx_k_s_counter_s__links_s, sizeof(__pyx_k_s_counter_s__links_s), 0, 0, 1, 0}, + {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1}, + {&__pyx_kp_s_semaphore_initial_value_must_be, __pyx_k_semaphore_initial_value_must_be, sizeof(__pyx_k_semaphore_initial_value_must_be), 0, 0, 1, 0}, + {&__pyx_kp_s_src_gevent__semaphore_py, __pyx_k_src_gevent__semaphore_py, sizeof(__pyx_k_src_gevent__semaphore_py), 0, 0, 1, 0}, + {&__pyx_n_s_start_notify, __pyx_k_start_notify, sizeof(__pyx_k_start_notify), 0, 0, 1, 1}, + {&__pyx_n_s_super, __pyx_k_super, sizeof(__pyx_k_super), 0, 0, 1, 1}, + {&__pyx_n_s_t, __pyx_k_t, sizeof(__pyx_k_t), 0, 0, 1, 1}, + {&__pyx_n_s_tb, __pyx_k_tb, sizeof(__pyx_k_tb), 0, 0, 1, 1}, + {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, + {&__pyx_n_s_timeout, __pyx_k_timeout, sizeof(__pyx_k_timeout), 0, 0, 1, 1}, + {&__pyx_n_s_v, __pyx_k_v, sizeof(__pyx_k_v), 0, 0, 1, 1}, + {&__pyx_n_s_value, __pyx_k_value, sizeof(__pyx_k_value), 0, 0, 1, 1}, + {&__pyx_n_s_wait, __pyx_k_wait, sizeof(__pyx_k_wait), 0, 0, 1, 1}, + {&__pyx_n_s_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 0, 1, 1}, + {0, 0, 0, 0, 0, 0, 0} +}; +static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { + __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 162, __pyx_L1_error) + __pyx_builtin___import__ = __Pyx_GetBuiltinName(__pyx_n_s_import); if (!__pyx_builtin___import__) __PYX_ERR(0, 10, __pyx_L1_error) + __pyx_builtin_super = __Pyx_GetBuiltinName(__pyx_n_s_super); if (!__pyx_builtin_super) __PYX_ERR(0, 44, __pyx_L1_error) + return 0; + __pyx_L1_error:; + return -1; +} + +static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); + + /* "src/gevent/_semaphore.py":10 + * + * def _get_linkable(): + * x = __import__('gevent._abstract_linkable') # <<<<<<<<<<<<<< + * return x._abstract_linkable.AbstractLinkable + * locals()['AbstractLinkable'] = _get_linkable() + */ + __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_gevent__abstract_linkable); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple_); + __Pyx_GIVEREF(__pyx_tuple_); + + /* "src/gevent/_semaphore.py":43 + * def __init__(self, value=1): + * if value < 0: + * raise ValueError("semaphore initial value must be >= 0") # <<<<<<<<<<<<<< + * super(Semaphore, self).__init__() + * self.counter = value + */ + __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_semaphore_initial_value_must_be); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 43, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2); + __Pyx_GIVEREF(__pyx_tuple__2); + + /* "src/gevent/_semaphore.py":9 + * ] + * + * def _get_linkable(): # <<<<<<<<<<<<<< + * x = __import__('gevent._abstract_linkable') + * return x._abstract_linkable.AbstractLinkable + */ + __pyx_tuple__3 = PyTuple_Pack(1, __pyx_n_s_x); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 9, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__3); + __Pyx_GIVEREF(__pyx_tuple__3); + __pyx_codeobj__4 = (PyObject*)__Pyx_PyCode_New(0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__3, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__semaphore_py, __pyx_n_s_get_linkable, 9, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__4)) __PYX_ERR(0, 9, __pyx_L1_error) + + /* "src/gevent/_semaphore.py":52 + * return '<%s counter=%s _links[%s]>' % params + * + * def locked(self): # <<<<<<<<<<<<<< + * """Return a boolean indicating whether the semaphore can be acquired. + * Most useful with binary semaphores.""" + */ + __pyx_tuple__5 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 52, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__5); + __Pyx_GIVEREF(__pyx_tuple__5); + __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__5, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__semaphore_py, __pyx_n_s_locked, 52, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__6)) __PYX_ERR(0, 52, __pyx_L1_error) + + /* "src/gevent/_semaphore.py":57 + * return self.counter <= 0 + * + * def release(self): # <<<<<<<<<<<<<< + * """ + * Release the semaphore, notifying any waiters if needed. + */ + __pyx_tuple__7 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 57, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__7); + __Pyx_GIVEREF(__pyx_tuple__7); + __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__semaphore_py, __pyx_n_s_release, 57, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) __PYX_ERR(0, 57, __pyx_L1_error) + + /* "src/gevent/_semaphore.py":65 + * return self.counter + * + * def ready(self): # <<<<<<<<<<<<<< + * return self.counter > 0 + * + */ + __pyx_tuple__9 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 65, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__9); + __Pyx_GIVEREF(__pyx_tuple__9); + __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__9, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__semaphore_py, __pyx_n_s_ready, 65, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__10)) __PYX_ERR(0, 65, __pyx_L1_error) + + /* "src/gevent/_semaphore.py":68 + * return self.counter > 0 + * + * def _start_notify(self): # <<<<<<<<<<<<<< + * self._check_and_notify() + * + */ + __pyx_tuple__11 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 68, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__11); + __Pyx_GIVEREF(__pyx_tuple__11); + __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__11, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__semaphore_py, __pyx_n_s_start_notify, 68, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(0, 68, __pyx_L1_error) + + /* "src/gevent/_semaphore.py":79 + * return True + * + * def wait(self, timeout=None): # <<<<<<<<<<<<<< + * """ + * wait(timeout=None) -> int + */ + __pyx_tuple__13 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_timeout); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 79, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__13); + __Pyx_GIVEREF(__pyx_tuple__13); + __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__13, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__semaphore_py, __pyx_n_s_wait, 79, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__14)) __PYX_ERR(0, 79, __pyx_L1_error) + + /* "src/gevent/_semaphore.py":100 + * return self.counter + * + * def acquire(self, blocking=True, timeout=None): # <<<<<<<<<<<<<< + * """ + * acquire(blocking=True, timeout=None) -> bool + */ + __pyx_tuple__15 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_blocking, __pyx_n_s_timeout); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(0, 100, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__15); + __Pyx_GIVEREF(__pyx_tuple__15); + __pyx_codeobj__16 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__15, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__semaphore_py, __pyx_n_s_acquire, 100, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__16)) __PYX_ERR(0, 100, __pyx_L1_error) + + /* "src/gevent/_semaphore.py":141 + * _py3k_acquire = acquire # PyPy needs this; it must be static for Cython + * + * def __enter__(self): # <<<<<<<<<<<<<< + * self.acquire() + * + */ + __pyx_tuple__17 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(0, 141, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__17); + __Pyx_GIVEREF(__pyx_tuple__17); + __pyx_codeobj__18 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__17, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__semaphore_py, __pyx_n_s_enter, 141, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__18)) __PYX_ERR(0, 141, __pyx_L1_error) + + /* "src/gevent/_semaphore.py":144 + * self.acquire() + * + * def __exit__(self, t, v, tb): # <<<<<<<<<<<<<< + * self.release() + * + */ + __pyx_tuple__19 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_t, __pyx_n_s_v, __pyx_n_s_tb); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(0, 144, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__19); + __Pyx_GIVEREF(__pyx_tuple__19); + __pyx_codeobj__20 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__19, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__semaphore_py, __pyx_n_s_exit, 144, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__20)) __PYX_ERR(0, 144, __pyx_L1_error) + + /* "src/gevent/_semaphore.py":168 + * self._initial_value = self.counter + * + * def release(self): # <<<<<<<<<<<<<< + * if self.counter >= self._initial_value: + * raise self._OVER_RELEASE_ERROR("Semaphore released too many times") + */ + __pyx_tuple__21 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(0, 168, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__21); + __Pyx_GIVEREF(__pyx_tuple__21); + __pyx_codeobj__22 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__21, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__semaphore_py, __pyx_n_s_release, 168, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__22)) __PYX_ERR(0, 168, __pyx_L1_error) + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} + +static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { + if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error) + return 0; + __pyx_L1_error:; + return -1; +} + +static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/ + +static int __Pyx_modinit_global_init_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); + /*--- Global init code ---*/ + __pyx_v_6gevent_11__semaphore_Timeout = Py_None; Py_INCREF(Py_None); + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_variable_export_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); + /*--- Variable export code ---*/ + if (__Pyx_ExportVoidPtr(__pyx_n_s_Timeout, (void *)&__pyx_v_6gevent_11__semaphore_Timeout, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_modinit_function_export_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); + /*--- Function export code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_type_init_code(void) { + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); + /*--- Type init code ---*/ + __pyx_t_1 = PyImport_ImportModule("gevent.__abstract_linkable"); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_ptype_6gevent_19__abstract_linkable_AbstractLinkable = __Pyx_ImportType(__pyx_t_1, "gevent.__abstract_linkable", "AbstractLinkable", sizeof(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_19__abstract_linkable_AbstractLinkable) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_vtabptr_6gevent_19__abstract_linkable_AbstractLinkable = (struct __pyx_vtabstruct_6gevent_19__abstract_linkable_AbstractLinkable*)__Pyx_GetVtable(__pyx_ptype_6gevent_19__abstract_linkable_AbstractLinkable->tp_dict); if (unlikely(!__pyx_vtabptr_6gevent_19__abstract_linkable_AbstractLinkable)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_vtabptr_6gevent_11__semaphore_Semaphore = &__pyx_vtable_6gevent_11__semaphore_Semaphore; + __pyx_vtable_6gevent_11__semaphore_Semaphore.__pyx_base = *__pyx_vtabptr_6gevent_19__abstract_linkable_AbstractLinkable; + __pyx_vtable_6gevent_11__semaphore_Semaphore.__pyx_base.ready = (int (*)(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *, int __pyx_skip_dispatch))__pyx_f_6gevent_11__semaphore_9Semaphore_ready; + __pyx_vtable_6gevent_11__semaphore_Semaphore.__pyx_base._wait_return_value = (PyObject *(*)(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *, PyObject *, PyObject *))__pyx_f_6gevent_11__semaphore_9Semaphore__wait_return_value; + __pyx_vtable_6gevent_11__semaphore_Semaphore.locked = (int (*)(struct __pyx_obj_6gevent_11__semaphore_Semaphore *, int __pyx_skip_dispatch))__pyx_f_6gevent_11__semaphore_9Semaphore_locked; + __pyx_vtable_6gevent_11__semaphore_Semaphore.release = (int (*)(struct __pyx_obj_6gevent_11__semaphore_Semaphore *, int __pyx_skip_dispatch))__pyx_f_6gevent_11__semaphore_9Semaphore_release; + __pyx_vtable_6gevent_11__semaphore_Semaphore._start_notify = (PyObject *(*)(struct __pyx_obj_6gevent_11__semaphore_Semaphore *, int __pyx_skip_dispatch))__pyx_f_6gevent_11__semaphore_9Semaphore__start_notify; + __pyx_vtable_6gevent_11__semaphore_Semaphore.wait = (int (*)(struct __pyx_obj_6gevent_11__semaphore_Semaphore *, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_11__semaphore_9Semaphore_wait *__pyx_optional_args))__pyx_f_6gevent_11__semaphore_9Semaphore_wait; + __pyx_vtable_6gevent_11__semaphore_Semaphore.acquire = (int (*)(struct __pyx_obj_6gevent_11__semaphore_Semaphore *, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_11__semaphore_9Semaphore_acquire *__pyx_optional_args))__pyx_f_6gevent_11__semaphore_9Semaphore_acquire; + __pyx_vtable_6gevent_11__semaphore_Semaphore.__pyx___enter__ = (PyObject *(*)(struct __pyx_obj_6gevent_11__semaphore_Semaphore *, int __pyx_skip_dispatch))__pyx_f_6gevent_11__semaphore_9Semaphore___enter__; + __pyx_vtable_6gevent_11__semaphore_Semaphore.__pyx___exit__ = (PyObject *(*)(struct __pyx_obj_6gevent_11__semaphore_Semaphore *, PyObject *, PyObject *, PyObject *, int __pyx_skip_dispatch))__pyx_f_6gevent_11__semaphore_9Semaphore___exit__; + __pyx_type_6gevent_11__semaphore_Semaphore.tp_base = __pyx_ptype_6gevent_19__abstract_linkable_AbstractLinkable; + if (PyType_Ready(&__pyx_type_6gevent_11__semaphore_Semaphore) < 0) __PYX_ERR(0, 16, __pyx_L1_error) + __pyx_type_6gevent_11__semaphore_Semaphore.tp_print = 0; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6gevent_11__semaphore_Semaphore.tp_dictoffset && __pyx_type_6gevent_11__semaphore_Semaphore.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_type_6gevent_11__semaphore_Semaphore.tp_getattro = __Pyx_PyObject_GenericGetAttr; + } + if (__Pyx_SetVtable(__pyx_type_6gevent_11__semaphore_Semaphore.tp_dict, __pyx_vtabptr_6gevent_11__semaphore_Semaphore) < 0) __PYX_ERR(0, 16, __pyx_L1_error) + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Semaphore, (PyObject *)&__pyx_type_6gevent_11__semaphore_Semaphore) < 0) __PYX_ERR(0, 16, __pyx_L1_error) + if (__pyx_type_6gevent_11__semaphore_Semaphore.tp_weaklistoffset == 0) __pyx_type_6gevent_11__semaphore_Semaphore.tp_weaklistoffset = offsetof(struct __pyx_obj_6gevent_11__semaphore_Semaphore, __pyx_base.__weakref__); + __pyx_ptype_6gevent_11__semaphore_Semaphore = &__pyx_type_6gevent_11__semaphore_Semaphore; + __pyx_vtabptr_6gevent_11__semaphore_BoundedSemaphore = &__pyx_vtable_6gevent_11__semaphore_BoundedSemaphore; + __pyx_vtable_6gevent_11__semaphore_BoundedSemaphore.__pyx_base = *__pyx_vtabptr_6gevent_11__semaphore_Semaphore; + __pyx_vtable_6gevent_11__semaphore_BoundedSemaphore.__pyx_base.release = (int (*)(struct __pyx_obj_6gevent_11__semaphore_Semaphore *, int __pyx_skip_dispatch))__pyx_f_6gevent_11__semaphore_16BoundedSemaphore_release; + __pyx_type_6gevent_11__semaphore_BoundedSemaphore.tp_base = __pyx_ptype_6gevent_11__semaphore_Semaphore; + if (PyType_Ready(&__pyx_type_6gevent_11__semaphore_BoundedSemaphore) < 0) __PYX_ERR(0, 148, __pyx_L1_error) + __pyx_type_6gevent_11__semaphore_BoundedSemaphore.tp_print = 0; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6gevent_11__semaphore_BoundedSemaphore.tp_dictoffset && __pyx_type_6gevent_11__semaphore_BoundedSemaphore.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_type_6gevent_11__semaphore_BoundedSemaphore.tp_getattro = __Pyx_PyObject_GenericGetAttr; + } + if (__Pyx_SetVtable(__pyx_type_6gevent_11__semaphore_BoundedSemaphore.tp_dict, __pyx_vtabptr_6gevent_11__semaphore_BoundedSemaphore) < 0) __PYX_ERR(0, 148, __pyx_L1_error) + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_BoundedSemaphore, (PyObject *)&__pyx_type_6gevent_11__semaphore_BoundedSemaphore) < 0) __PYX_ERR(0, 148, __pyx_L1_error) + if (__pyx_type_6gevent_11__semaphore_BoundedSemaphore.tp_weaklistoffset == 0) __pyx_type_6gevent_11__semaphore_BoundedSemaphore.tp_weaklistoffset = offsetof(struct __pyx_obj_6gevent_11__semaphore_BoundedSemaphore, __pyx_base.__pyx_base.__weakref__); + __pyx_ptype_6gevent_11__semaphore_BoundedSemaphore = &__pyx_type_6gevent_11__semaphore_BoundedSemaphore; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_modinit_type_import_code(void) { + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); + /*--- Type import code ---*/ + __pyx_t_1 = PyImport_ImportModule("greenlet"); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_ptype_6gevent_21__greenlet_primitives_greenlet = __Pyx_ImportType(__pyx_t_1, "greenlet", "greenlet", sizeof(PyGreenlet), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_21__greenlet_primitives_greenlet) __PYX_ERR(2, 12, __pyx_L1_error) + __pyx_t_2 = PyImport_ImportModule("gevent.__greenlet_primitives"); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 37, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_ptype_6gevent_21__greenlet_primitives_TrackedRawGreenlet = __Pyx_ImportType(__pyx_t_2, "gevent.__greenlet_primitives", "TrackedRawGreenlet", sizeof(struct __pyx_obj_6gevent_21__greenlet_primitives_TrackedRawGreenlet), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_21__greenlet_primitives_TrackedRawGreenlet) __PYX_ERR(2, 37, __pyx_L1_error) + __pyx_ptype_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop = __Pyx_ImportType(__pyx_t_2, "gevent.__greenlet_primitives", "SwitchOutGreenletWithLoop", sizeof(struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop) __PYX_ERR(2, 40, __pyx_L1_error) + __pyx_vtabptr_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop = (struct __pyx_vtabstruct_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop*)__Pyx_GetVtable(__pyx_ptype_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop->tp_dict); if (unlikely(!__pyx_vtabptr_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop)) __PYX_ERR(2, 40, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyImport_ImportModule("greenlet"); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_ptype_6gevent_19__abstract_linkable_greenlet = __Pyx_ImportType(__pyx_t_2, "greenlet", "greenlet", sizeof(PyGreenlet), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_19__abstract_linkable_greenlet) __PYX_ERR(3, 12, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_modinit_variable_import_code(void) { + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); + /*--- Variable import code ---*/ + __pyx_t_1 = PyImport_ImportModule("gevent.__greenlet_primitives"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_1, "get_objects", (void **)&__pyx_vp_6gevent_21__greenlet_primitives_get_objects, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_1, "wref", (void **)&__pyx_vp_6gevent_21__greenlet_primitives_wref, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_1, "BlockingSwitchOutError", (void **)&__pyx_vp_6gevent_21__greenlet_primitives_BlockingSwitchOutError, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_1, "_greenlet_imported", (void **)&__pyx_vp_6gevent_21__greenlet_primitives__greenlet_imported, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + Py_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_2 = PyImport_ImportModule("gevent.__hub_local"); if (!__pyx_t_2) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_2, "_threadlocal", (void **)&__pyx_vp_6gevent_11__hub_local__threadlocal, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + Py_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_3 = PyImport_ImportModule("gevent.__abstract_linkable"); if (!__pyx_t_3) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_3, "InvalidSwitchError", (void **)&__pyx_vp_6gevent_19__abstract_linkable_InvalidSwitchError, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_3, "Timeout", (void **)&__pyx_vp_6gevent_19__abstract_linkable_Timeout, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_3, "_greenlet_imported", (void **)&__pyx_vp_6gevent_19__abstract_linkable__greenlet_imported, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + Py_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_modinit_function_import_code(void) { + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); + /*--- Function import code ---*/ + __pyx_t_1 = PyImport_ImportModule("gevent.__hub_local"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportFunction(__pyx_t_1, "get_hub_noargs", (void (**)(void))&__pyx_f_6gevent_11__hub_local_get_hub_noargs, "struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *(int __pyx_skip_dispatch)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + Py_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_RefNannyFinishContext(); + return -1; +} + + +#if PY_MAJOR_VERSION < 3 +#ifdef CYTHON_NO_PYINIT_EXPORT +#define __Pyx_PyMODINIT_FUNC void +#else +#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC +#endif +#else +#ifdef CYTHON_NO_PYINIT_EXPORT +#define __Pyx_PyMODINIT_FUNC PyObject * +#else +#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC +#endif +#endif + + +#if PY_MAJOR_VERSION < 3 +__Pyx_PyMODINIT_FUNC init__semaphore(void) CYTHON_SMALL_CODE; /*proto*/ +__Pyx_PyMODINIT_FUNC init__semaphore(void) +#else +__Pyx_PyMODINIT_FUNC PyInit___semaphore(void) CYTHON_SMALL_CODE; /*proto*/ +__Pyx_PyMODINIT_FUNC PyInit___semaphore(void) +#if CYTHON_PEP489_MULTI_PHASE_INIT +{ + return PyModuleDef_Init(&__pyx_moduledef); +} +static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { + #if PY_VERSION_HEX >= 0x030700A1 + static PY_INT64_T main_interpreter_id = -1; + PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); + if (main_interpreter_id == -1) { + main_interpreter_id = current_id; + return (unlikely(current_id == -1)) ? -1 : 0; + } else if (unlikely(main_interpreter_id != current_id)) + #else + static PyInterpreterState *main_interpreter = NULL; + PyInterpreterState *current_interpreter = PyThreadState_Get()->interp; + if (!main_interpreter) { + main_interpreter = current_interpreter; + } else if (unlikely(main_interpreter != current_interpreter)) + #endif + { + PyErr_SetString( + PyExc_ImportError, + "Interpreter change detected - this module can only be loaded into one interpreter per process."); + return -1; + } + return 0; +} +static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) { + PyObject *value = PyObject_GetAttrString(spec, from_name); + int result = 0; + if (likely(value)) { + if (allow_none || value != Py_None) { + result = PyDict_SetItemString(moddict, to_name, value); + } + Py_DECREF(value); + } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_Clear(); + } else { + result = -1; + } + return result; +} +static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) { + PyObject *module = NULL, *moddict, *modname; + if (__Pyx_check_single_interpreter()) + return NULL; + if (__pyx_m) + return __Pyx_NewRef(__pyx_m); + modname = PyObject_GetAttrString(spec, "name"); + if (unlikely(!modname)) goto bad; + module = PyModule_NewObject(modname); + Py_DECREF(modname); + if (unlikely(!module)) goto bad; + moddict = PyModule_GetDict(module); + if (unlikely(!moddict)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad; + return module; +bad: + Py_XDECREF(module); + return NULL; +} + + +static CYTHON_SMALL_CODE int __pyx_pymod_exec___semaphore(PyObject *__pyx_pyinit_module) +#endif +#endif +{ + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannyDeclarations + #if CYTHON_PEP489_MULTI_PHASE_INIT + if (__pyx_m) { + if (__pyx_m == __pyx_pyinit_module) return 0; + PyErr_SetString(PyExc_RuntimeError, "Module '__semaphore' has already been imported. Re-initialisation is not supported."); + return -1; + } + #elif PY_MAJOR_VERSION >= 3 + if (__pyx_m) return __Pyx_NewRef(__pyx_m); + #endif + #if CYTHON_REFNANNY +__Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); +if (!__Pyx_RefNanny) { + PyErr_Clear(); + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); + if (!__Pyx_RefNanny) + Py_FatalError("failed to import 'refnanny' module"); +} +#endif + __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit___semaphore(void)", 0); + if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #ifdef __Pxy_PyFrame_Initialize_Offsets + __Pxy_PyFrame_Initialize_Offsets(); + #endif + __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) + #ifdef __Pyx_CyFunction_USED + if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_FusedFunction_USED + if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_Coroutine_USED + if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_Generator_USED + if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_AsyncGen_USED + if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_StopAsyncIteration_USED + if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + /*--- Library function declarations ---*/ + /*--- Threads initialization code ---*/ + #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS + #ifdef WITH_THREAD /* Python build with threading support? */ + PyEval_InitThreads(); + #endif + #endif + /*--- Module creation code ---*/ + #if CYTHON_PEP489_MULTI_PHASE_INIT + __pyx_m = __pyx_pyinit_module; + Py_INCREF(__pyx_m); + #else + #if PY_MAJOR_VERSION < 3 + __pyx_m = Py_InitModule4("__semaphore", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); + #else + __pyx_m = PyModule_Create(&__pyx_moduledef); + #endif + if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) + Py_INCREF(__pyx_d); + __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) + #if CYTHON_COMPILING_IN_PYPY + Py_INCREF(__pyx_b); + #endif + if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + /*--- Initialize various global constants etc. ---*/ + if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) + if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + if (__pyx_module_is_main_gevent____semaphore) { + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + } + #if PY_MAJOR_VERSION >= 3 + { + PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) + if (!PyDict_GetItemString(modules, "gevent.__semaphore")) { + if (unlikely(PyDict_SetItemString(modules, "gevent.__semaphore", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error) + } + } + #endif + /*--- Builtin init code ---*/ + if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + /*--- Constants init code ---*/ + if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + /*--- Global type/function init code ---*/ + (void)__Pyx_modinit_global_init_code(); + if (unlikely(__Pyx_modinit_variable_export_code() != 0)) goto __pyx_L1_error; + (void)__Pyx_modinit_function_export_code(); + if (unlikely(__Pyx_modinit_type_init_code() != 0)) goto __pyx_L1_error; + if (unlikely(__Pyx_modinit_type_import_code() != 0)) goto __pyx_L1_error; + if (unlikely(__Pyx_modinit_variable_import_code() != 0)) goto __pyx_L1_error; + if (unlikely(__Pyx_modinit_function_import_code() != 0)) goto __pyx_L1_error; + /*--- Execution code ---*/ + #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) + if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + + /* "src/gevent/_semaphore.py":4 + * from __future__ import print_function, absolute_import, division + * + * __all__ = [ # <<<<<<<<<<<<<< + * 'Semaphore', + * 'BoundedSemaphore', + */ + __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_Semaphore); + __Pyx_GIVEREF(__pyx_n_s_Semaphore); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_Semaphore); + __Pyx_INCREF(__pyx_n_s_BoundedSemaphore); + __Pyx_GIVEREF(__pyx_n_s_BoundedSemaphore); + PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_BoundedSemaphore); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_all, __pyx_t_1) < 0) __PYX_ERR(0, 4, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_semaphore.py":9 + * ] + * + * def _get_linkable(): # <<<<<<<<<<<<<< + * x = __import__('gevent._abstract_linkable') + * return x._abstract_linkable.AbstractLinkable + */ + __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_11__semaphore_1_get_linkable, 0, __pyx_n_s_get_linkable, NULL, __pyx_n_s_gevent___semaphore, __pyx_d, ((PyObject *)__pyx_codeobj__4)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 9, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_linkable, __pyx_t_1) < 0) __PYX_ERR(0, 9, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_semaphore.py":12 + * x = __import__('gevent._abstract_linkable') + * return x._abstract_linkable.AbstractLinkable + * locals()['AbstractLinkable'] = _get_linkable() # <<<<<<<<<<<<<< + * del _get_linkable + * + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_get_linkable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_Globals(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (unlikely(PyDict_SetItem(__pyx_t_1, __pyx_n_s_AbstractLinkable, __pyx_t_2) < 0)) __PYX_ERR(0, 12, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/_semaphore.py":13 + * return x._abstract_linkable.AbstractLinkable + * locals()['AbstractLinkable'] = _get_linkable() + * del _get_linkable # <<<<<<<<<<<<<< + * + * + */ + if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_get_linkable) < 0) __PYX_ERR(0, 13, __pyx_L1_error) + + /* "src/gevent/_semaphore.py":52 + * return '<%s counter=%s _links[%s]>' % params + * + * def locked(self): # <<<<<<<<<<<<<< + * """Return a boolean indicating whether the semaphore can be acquired. + * Most useful with binary semaphores.""" + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_11__semaphore_9Semaphore_5locked, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Semaphore_locked, NULL, __pyx_n_s_gevent___semaphore, __pyx_d, ((PyObject *)__pyx_codeobj__6)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 52, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_11__semaphore_Semaphore->tp_dict, __pyx_n_s_locked, __pyx_t_2) < 0) __PYX_ERR(0, 52, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_11__semaphore_Semaphore); + + /* "src/gevent/_semaphore.py":57 + * return self.counter <= 0 + * + * def release(self): # <<<<<<<<<<<<<< + * """ + * Release the semaphore, notifying any waiters if needed. + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_11__semaphore_9Semaphore_7release, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Semaphore_release, NULL, __pyx_n_s_gevent___semaphore, __pyx_d, ((PyObject *)__pyx_codeobj__8)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 57, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_11__semaphore_Semaphore->tp_dict, __pyx_n_s_release, __pyx_t_2) < 0) __PYX_ERR(0, 57, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_11__semaphore_Semaphore); + + /* "src/gevent/_semaphore.py":65 + * return self.counter + * + * def ready(self): # <<<<<<<<<<<<<< + * return self.counter > 0 + * + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_11__semaphore_9Semaphore_9ready, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Semaphore_ready, NULL, __pyx_n_s_gevent___semaphore, __pyx_d, ((PyObject *)__pyx_codeobj__10)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 65, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_11__semaphore_Semaphore->tp_dict, __pyx_n_s_ready, __pyx_t_2) < 0) __PYX_ERR(0, 65, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_11__semaphore_Semaphore); + + /* "src/gevent/_semaphore.py":68 + * return self.counter > 0 + * + * def _start_notify(self): # <<<<<<<<<<<<<< + * self._check_and_notify() + * + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_11__semaphore_9Semaphore_11_start_notify, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Semaphore__start_notify, NULL, __pyx_n_s_gevent___semaphore, __pyx_d, ((PyObject *)__pyx_codeobj__12)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 68, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_11__semaphore_Semaphore->tp_dict, __pyx_n_s_start_notify, __pyx_t_2) < 0) __PYX_ERR(0, 68, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_11__semaphore_Semaphore); + + /* "src/gevent/_semaphore.py":79 + * return True + * + * def wait(self, timeout=None): # <<<<<<<<<<<<<< + * """ + * wait(timeout=None) -> int + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_11__semaphore_9Semaphore_13wait, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Semaphore_wait, NULL, __pyx_n_s_gevent___semaphore, __pyx_d, ((PyObject *)__pyx_codeobj__14)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 79, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_11__semaphore_Semaphore->tp_dict, __pyx_n_s_wait, __pyx_t_2) < 0) __PYX_ERR(0, 79, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_11__semaphore_Semaphore); + + /* "src/gevent/_semaphore.py":100 + * return self.counter + * + * def acquire(self, blocking=True, timeout=None): # <<<<<<<<<<<<<< + * """ + * acquire(blocking=True, timeout=None) -> bool + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_11__semaphore_9Semaphore_15acquire, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Semaphore_acquire, NULL, __pyx_n_s_gevent___semaphore, __pyx_d, ((PyObject *)__pyx_codeobj__16)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 100, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_11__semaphore_Semaphore->tp_dict, __pyx_n_s_acquire, __pyx_t_2) < 0) __PYX_ERR(0, 100, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_11__semaphore_Semaphore); + + /* "src/gevent/_semaphore.py":139 + * return True + * + * _py3k_acquire = acquire # PyPy needs this; it must be static for Cython # <<<<<<<<<<<<<< + * + * def __enter__(self): + */ + __Pyx_GetNameInClass(__pyx_t_2, (PyObject *)__pyx_ptype_6gevent_11__semaphore_Semaphore, __pyx_n_s_acquire); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 139, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_11__semaphore_Semaphore->tp_dict, __pyx_n_s_py3k_acquire, __pyx_t_2) < 0) __PYX_ERR(0, 139, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_11__semaphore_Semaphore); + + /* "src/gevent/_semaphore.py":141 + * _py3k_acquire = acquire # PyPy needs this; it must be static for Cython + * + * def __enter__(self): # <<<<<<<<<<<<<< + * self.acquire() + * + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_11__semaphore_9Semaphore_17__enter__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Semaphore___enter, NULL, __pyx_n_s_gevent___semaphore, __pyx_d, ((PyObject *)__pyx_codeobj__18)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 141, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_11__semaphore_Semaphore->tp_dict, __pyx_n_s_enter, __pyx_t_2) < 0) __PYX_ERR(0, 141, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_11__semaphore_Semaphore); + + /* "src/gevent/_semaphore.py":144 + * self.acquire() + * + * def __exit__(self, t, v, tb): # <<<<<<<<<<<<<< + * self.release() + * + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_11__semaphore_9Semaphore_19__exit__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Semaphore___exit, NULL, __pyx_n_s_gevent___semaphore, __pyx_d, ((PyObject *)__pyx_codeobj__20)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 144, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_11__semaphore_Semaphore->tp_dict, __pyx_n_s_exit, __pyx_t_2) < 0) __PYX_ERR(0, 144, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_11__semaphore_Semaphore); + + /* "src/gevent/_semaphore.py":162 + * + * #: For monkey-patching, allow changing the class of error we raise + * _OVER_RELEASE_ERROR = ValueError # <<<<<<<<<<<<<< + * + * def __init__(self, *args, **kwargs): + */ + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_11__semaphore_BoundedSemaphore->tp_dict, __pyx_n_s_OVER_RELEASE_ERROR, __pyx_builtin_ValueError) < 0) __PYX_ERR(0, 162, __pyx_L1_error) + PyType_Modified(__pyx_ptype_6gevent_11__semaphore_BoundedSemaphore); + + /* "src/gevent/_semaphore.py":168 + * self._initial_value = self.counter + * + * def release(self): # <<<<<<<<<<<<<< + * if self.counter >= self._initial_value: + * raise self._OVER_RELEASE_ERROR("Semaphore released too many times") + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_11__semaphore_16BoundedSemaphore_3release, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BoundedSemaphore_release, NULL, __pyx_n_s_gevent___semaphore, __pyx_d, ((PyObject *)__pyx_codeobj__22)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 168, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_11__semaphore_BoundedSemaphore->tp_dict, __pyx_n_s_release, __pyx_t_2) < 0) __PYX_ERR(0, 168, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_11__semaphore_BoundedSemaphore); + + /* "src/gevent/_semaphore.py":187 + * # for PyPy in all cases anyway, so this does nothing. + * + * from gevent._util import import_c_accel # <<<<<<<<<<<<<< + * import_c_accel(globals(), 'gevent.__semaphore') + */ + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 187, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_import_c_accel); + __Pyx_GIVEREF(__pyx_n_s_import_c_accel); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_import_c_accel); + __pyx_t_1 = __Pyx_Import(__pyx_n_s_gevent__util, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 187, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_import_c_accel); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 187, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_import_c_accel, __pyx_t_2) < 0) __PYX_ERR(0, 187, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_semaphore.py":188 + * + * from gevent._util import import_c_accel + * import_c_accel(globals(), 'gevent.__semaphore') # <<<<<<<<<<<<<< + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_import_c_accel); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 188, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_Globals(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 188, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 188, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __Pyx_INCREF(__pyx_n_s_gevent___semaphore); + __Pyx_GIVEREF(__pyx_n_s_gevent___semaphore); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_n_s_gevent___semaphore); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 188, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/_semaphore.py":1 + * # cython: auto_pickle=False,embedsignature=True,always_allow_keywords=False # <<<<<<<<<<<<<< + * from __future__ import print_function, absolute_import, division + * + */ + __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "gevent/__abstract_linkable.pxd":24 + * return PyGreenlet_GetCurrent() + * + * cdef inline void greenlet_init(): # <<<<<<<<<<<<<< + * global _greenlet_imported + * if not _greenlet_imported: + */ + + /*--- Wrapped vars code ---*/ + + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + if (__pyx_m) { + if (__pyx_d) { + __Pyx_AddTraceback("init gevent.__semaphore", __pyx_clineno, __pyx_lineno, __pyx_filename); + } + Py_CLEAR(__pyx_m); + } else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_ImportError, "init gevent.__semaphore"); + } + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + #if CYTHON_PEP489_MULTI_PHASE_INIT + return (__pyx_m != NULL) ? 0 : -1; + #elif PY_MAJOR_VERSION >= 3 + return __pyx_m; + #else + return; + #endif +} + +/* --- Runtime support code --- */ +/* Refnanny */ +#if CYTHON_REFNANNY +static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { + PyObject *m = NULL, *p = NULL; + void *r = NULL; + m = PyImport_ImportModule(modname); + if (!m) goto end; + p = PyObject_GetAttrString(m, "RefNannyAPI"); + if (!p) goto end; + r = PyLong_AsVoidPtr(p); +end: + Py_XDECREF(p); + Py_XDECREF(m); + return (__Pyx_RefNannyAPIStruct *)r; +} +#endif + +/* PyObjectGetAttrStr */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_getattro)) + return tp->tp_getattro(obj, attr_name); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_getattr)) + return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); +#endif + return PyObject_GetAttr(obj, attr_name); +} +#endif + +/* GetBuiltinName */ +static PyObject *__Pyx_GetBuiltinName(PyObject *name) { + PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name); + if (unlikely(!result)) { + PyErr_Format(PyExc_NameError, +#if PY_MAJOR_VERSION >= 3 + "name '%U' is not defined", name); +#else + "name '%.200s' is not defined", PyString_AS_STRING(name)); +#endif + } + return result; +} + +/* PyObjectCall */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { + PyObject *result; + ternaryfunc call = func->ob_type->tp_call; + if (unlikely(!call)) + return PyObject_Call(func, arg, kw); + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; + result = (*call)(func, arg, kw); + Py_LeaveRecursiveCall(); + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +/* RaiseDoubleKeywords */ +static void __Pyx_RaiseDoubleKeywordsError( + const char* func_name, + PyObject* kw_name) +{ + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION >= 3 + "%s() got multiple values for keyword argument '%U'", func_name, kw_name); + #else + "%s() got multiple values for keyword argument '%s'", func_name, + PyString_AsString(kw_name)); + #endif +} + +/* ParseKeywords */ +static int __Pyx_ParseOptionalKeywords( + PyObject *kwds, + PyObject **argnames[], + PyObject *kwds2, + PyObject *values[], + Py_ssize_t num_pos_args, + const char* function_name) +{ + PyObject *key = 0, *value = 0; + Py_ssize_t pos = 0; + PyObject*** name; + PyObject*** first_kw_arg = argnames + num_pos_args; + while (PyDict_Next(kwds, &pos, &key, &value)) { + name = first_kw_arg; + while (*name && (**name != key)) name++; + if (*name) { + values[name-argnames] = value; + continue; + } + name = first_kw_arg; + #if PY_MAJOR_VERSION < 3 + if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) { + while (*name) { + if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) + && _PyString_Eq(**name, key)) { + values[name-argnames] = value; + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + if ((**argname == key) || ( + (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) + && _PyString_Eq(**argname, key))) { + goto arg_passed_twice; + } + argname++; + } + } + } else + #endif + if (likely(PyUnicode_Check(key))) { + while (*name) { + int cmp = (**name == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 : + #endif + PyUnicode_Compare(**name, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) { + values[name-argnames] = value; + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + int cmp = (**argname == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 : + #endif + PyUnicode_Compare(**argname, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) goto arg_passed_twice; + argname++; + } + } + } else + goto invalid_keyword_type; + if (kwds2) { + if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; + } else { + goto invalid_keyword; + } + } + return 0; +arg_passed_twice: + __Pyx_RaiseDoubleKeywordsError(function_name, key); + goto bad; +invalid_keyword_type: + PyErr_Format(PyExc_TypeError, + "%.200s() keywords must be strings", function_name); + goto bad; +invalid_keyword: + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION < 3 + "%.200s() got an unexpected keyword argument '%.200s'", + function_name, PyString_AsString(key)); + #else + "%s() got an unexpected keyword argument '%U'", + function_name, key); + #endif +bad: + return -1; +} + +/* RaiseArgTupleInvalid */ +static void __Pyx_RaiseArgtupleInvalid( + const char* func_name, + int exact, + Py_ssize_t num_min, + Py_ssize_t num_max, + Py_ssize_t num_found) +{ + Py_ssize_t num_expected; + const char *more_or_less; + if (num_found < num_min) { + num_expected = num_min; + more_or_less = "at least"; + } else { + num_expected = num_max; + more_or_less = "at most"; + } + if (exact) { + more_or_less = "exactly"; + } + PyErr_Format(PyExc_TypeError, + "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", + func_name, more_or_less, num_expected, + (num_expected == 1) ? "" : "s", num_found); +} + +/* PyErrFetchRestore */ +#if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + tmp_type = tstate->curexc_type; + tmp_value = tstate->curexc_value; + tmp_tb = tstate->curexc_traceback; + tstate->curexc_type = type; + tstate->curexc_value = value; + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +} +static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { + *type = tstate->curexc_type; + *value = tstate->curexc_value; + *tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +} +#endif + +/* RaiseException */ +#if PY_MAJOR_VERSION < 3 +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, + CYTHON_UNUSED PyObject *cause) { + __Pyx_PyThreadState_declare + Py_XINCREF(type); + if (!value || value == Py_None) + value = NULL; + else + Py_INCREF(value); + if (!tb || tb == Py_None) + tb = NULL; + else { + Py_INCREF(tb); + if (!PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto raise_error; + } + } + if (PyType_Check(type)) { +#if CYTHON_COMPILING_IN_PYPY + if (!value) { + Py_INCREF(Py_None); + value = Py_None; + } +#endif + PyErr_NormalizeException(&type, &value, &tb); + } else { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto raise_error; + } + value = type; + type = (PyObject*) Py_TYPE(type); + Py_INCREF(type); + if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto raise_error; + } + } + __Pyx_PyThreadState_assign + __Pyx_ErrRestore(type, value, tb); + return; +raise_error: + Py_XDECREF(value); + Py_XDECREF(type); + Py_XDECREF(tb); + return; +} +#else +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { + PyObject* owned_instance = NULL; + if (tb == Py_None) { + tb = 0; + } else if (tb && !PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto bad; + } + if (value == Py_None) + value = 0; + if (PyExceptionInstance_Check(type)) { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto bad; + } + value = type; + type = (PyObject*) Py_TYPE(value); + } else if (PyExceptionClass_Check(type)) { + PyObject *instance_class = NULL; + if (value && PyExceptionInstance_Check(value)) { + instance_class = (PyObject*) Py_TYPE(value); + if (instance_class != type) { + int is_subclass = PyObject_IsSubclass(instance_class, type); + if (!is_subclass) { + instance_class = NULL; + } else if (unlikely(is_subclass == -1)) { + goto bad; + } else { + type = instance_class; + } + } + } + if (!instance_class) { + PyObject *args; + if (!value) + args = PyTuple_New(0); + else if (PyTuple_Check(value)) { + Py_INCREF(value); + args = value; + } else + args = PyTuple_Pack(1, value); + if (!args) + goto bad; + owned_instance = PyObject_Call(type, args, NULL); + Py_DECREF(args); + if (!owned_instance) + goto bad; + value = owned_instance; + if (!PyExceptionInstance_Check(value)) { + PyErr_Format(PyExc_TypeError, + "calling %R should have returned an instance of " + "BaseException, not %R", + type, Py_TYPE(value)); + goto bad; + } + } + } else { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto bad; + } + if (cause) { + PyObject *fixed_cause; + if (cause == Py_None) { + fixed_cause = NULL; + } else if (PyExceptionClass_Check(cause)) { + fixed_cause = PyObject_CallObject(cause, NULL); + if (fixed_cause == NULL) + goto bad; + } else if (PyExceptionInstance_Check(cause)) { + fixed_cause = cause; + Py_INCREF(fixed_cause); + } else { + PyErr_SetString(PyExc_TypeError, + "exception causes must derive from " + "BaseException"); + goto bad; + } + PyException_SetCause(value, fixed_cause); + } + PyErr_SetObject(type, value); + if (tb) { +#if CYTHON_COMPILING_IN_PYPY + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); + Py_INCREF(tb); + PyErr_Restore(tmp_type, tmp_value, tb); + Py_XDECREF(tmp_tb); +#else + PyThreadState *tstate = __Pyx_PyThreadState_Current; + PyObject* tmp_tb = tstate->curexc_traceback; + if (tb != tmp_tb) { + Py_INCREF(tb); + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_tb); + } +#endif + } +bad: + Py_XDECREF(owned_instance); + return; +} +#endif + +/* PyFunctionFastCall */ +#if CYTHON_FAST_PYCALL +static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, + PyObject *globals) { + PyFrameObject *f; + PyThreadState *tstate = __Pyx_PyThreadState_Current; + PyObject **fastlocals; + Py_ssize_t i; + PyObject *result; + assert(globals != NULL); + /* XXX Perhaps we should create a specialized + PyFrame_New() that doesn't take locals, but does + take builtins without sanity checking them. + */ + assert(tstate != NULL); + f = PyFrame_New(tstate, co, globals, NULL); + if (f == NULL) { + return NULL; + } + fastlocals = __Pyx_PyFrame_GetLocalsplus(f); + for (i = 0; i < na; i++) { + Py_INCREF(*args); + fastlocals[i] = *args++; + } + result = PyEval_EvalFrameEx(f,0); + ++tstate->recursion_depth; + Py_DECREF(f); + --tstate->recursion_depth; + return result; +} +#if 1 || PY_VERSION_HEX < 0x030600B1 +static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs) { + PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); + PyObject *globals = PyFunction_GET_GLOBALS(func); + PyObject *argdefs = PyFunction_GET_DEFAULTS(func); + PyObject *closure; +#if PY_MAJOR_VERSION >= 3 + PyObject *kwdefs; +#endif + PyObject *kwtuple, **k; + PyObject **d; + Py_ssize_t nd; + Py_ssize_t nk; + PyObject *result; + assert(kwargs == NULL || PyDict_Check(kwargs)); + nk = kwargs ? PyDict_Size(kwargs) : 0; + if (Py_EnterRecursiveCall((char*)" while calling a Python object")) { + return NULL; + } + if ( +#if PY_MAJOR_VERSION >= 3 + co->co_kwonlyargcount == 0 && +#endif + likely(kwargs == NULL || nk == 0) && + co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { + if (argdefs == NULL && co->co_argcount == nargs) { + result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); + goto done; + } + else if (nargs == 0 && argdefs != NULL + && co->co_argcount == Py_SIZE(argdefs)) { + /* function called with no arguments, but all parameters have + a default value: use default values as arguments .*/ + args = &PyTuple_GET_ITEM(argdefs, 0); + result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); + goto done; + } + } + if (kwargs != NULL) { + Py_ssize_t pos, i; + kwtuple = PyTuple_New(2 * nk); + if (kwtuple == NULL) { + result = NULL; + goto done; + } + k = &PyTuple_GET_ITEM(kwtuple, 0); + pos = i = 0; + while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { + Py_INCREF(k[i]); + Py_INCREF(k[i+1]); + i += 2; + } + nk = i / 2; + } + else { + kwtuple = NULL; + k = NULL; + } + closure = PyFunction_GET_CLOSURE(func); +#if PY_MAJOR_VERSION >= 3 + kwdefs = PyFunction_GET_KW_DEFAULTS(func); +#endif + if (argdefs != NULL) { + d = &PyTuple_GET_ITEM(argdefs, 0); + nd = Py_SIZE(argdefs); + } + else { + d = NULL; + nd = 0; + } +#if PY_MAJOR_VERSION >= 3 + result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, + args, nargs, + k, (int)nk, + d, (int)nd, kwdefs, closure); +#else + result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, + args, nargs, + k, (int)nk, + d, (int)nd, closure); +#endif + Py_XDECREF(kwtuple); +done: + Py_LeaveRecursiveCall(); + return result; +} +#endif +#endif + +/* PyObjectCallMethO */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { + PyObject *self, *result; + PyCFunction cfunc; + cfunc = PyCFunction_GET_FUNCTION(func); + self = PyCFunction_GET_SELF(func); + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; + result = cfunc(self, arg); + Py_LeaveRecursiveCall(); + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +/* PyObjectCallNoArg */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { +#if CYTHON_FAST_PYCALL + if (PyFunction_Check(func)) { + return __Pyx_PyFunction_FastCall(func, NULL, 0); + } +#endif +#ifdef __Pyx_CyFunction_USED + if (likely(PyCFunction_Check(func) || __Pyx_CyFunction_Check(func))) +#else + if (likely(PyCFunction_Check(func))) +#endif + { + if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) { + return __Pyx_PyObject_CallMethO(func, NULL); + } + } + return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL); +} +#endif + +/* PyCFunctionFastCall */ +#if CYTHON_FAST_PYCCALL +static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) { + PyCFunctionObject *func = (PyCFunctionObject*)func_obj; + PyCFunction meth = PyCFunction_GET_FUNCTION(func); + PyObject *self = PyCFunction_GET_SELF(func); + int flags = PyCFunction_GET_FLAGS(func); + assert(PyCFunction_Check(func)); + assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS))); + assert(nargs >= 0); + assert(nargs == 0 || args != NULL); + /* _PyCFunction_FastCallDict() must not be called with an exception set, + because it may clear it (directly or indirectly) and so the + caller loses its exception */ + assert(!PyErr_Occurred()); + if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) { + return (*((__Pyx_PyCFunctionFastWithKeywords)(void*)meth)) (self, args, nargs, NULL); + } else { + return (*((__Pyx_PyCFunctionFast)(void*)meth)) (self, args, nargs); + } +} +#endif + +/* PyObjectCallOneArg */ +#if CYTHON_COMPILING_IN_CPYTHON +static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) { + PyObject *result; + PyObject *args = PyTuple_New(1); + if (unlikely(!args)) return NULL; + Py_INCREF(arg); + PyTuple_SET_ITEM(args, 0, arg); + result = __Pyx_PyObject_Call(func, args, NULL); + Py_DECREF(args); + return result; +} +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { +#if CYTHON_FAST_PYCALL + if (PyFunction_Check(func)) { + return __Pyx_PyFunction_FastCall(func, &arg, 1); + } +#endif + if (likely(PyCFunction_Check(func))) { + if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) { + return __Pyx_PyObject_CallMethO(func, arg); +#if CYTHON_FAST_PYCCALL + } else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) { + return __Pyx_PyCFunction_FastCall(func, &arg, 1); +#endif + } + } + return __Pyx__PyObject_CallOneArg(func, arg); +} +#else +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { + PyObject *result; + PyObject *args = PyTuple_Pack(1, arg); + if (unlikely(!args)) return NULL; + result = __Pyx_PyObject_Call(func, args, NULL); + Py_DECREF(args); + return result; +} +#endif + +/* WriteUnraisableException */ +static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno, + CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename, + int full_traceback, CYTHON_UNUSED int nogil) { + PyObject *old_exc, *old_val, *old_tb; + PyObject *ctx; + __Pyx_PyThreadState_declare +#ifdef WITH_THREAD + PyGILState_STATE state; + if (nogil) + state = PyGILState_Ensure(); +#ifdef _MSC_VER + else state = (PyGILState_STATE)-1; +#endif +#endif + __Pyx_PyThreadState_assign + __Pyx_ErrFetch(&old_exc, &old_val, &old_tb); + if (full_traceback) { + Py_XINCREF(old_exc); + Py_XINCREF(old_val); + Py_XINCREF(old_tb); + __Pyx_ErrRestore(old_exc, old_val, old_tb); + PyErr_PrintEx(1); + } + #if PY_MAJOR_VERSION < 3 + ctx = PyString_FromString(name); + #else + ctx = PyUnicode_FromString(name); + #endif + __Pyx_ErrRestore(old_exc, old_val, old_tb); + if (!ctx) { + PyErr_WriteUnraisable(Py_None); + } else { + PyErr_WriteUnraisable(ctx); + Py_DECREF(ctx); + } +#ifdef WITH_THREAD + if (nogil) + PyGILState_Release(state); +#endif +} + +/* PyObjectCall2Args */ +static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) { + PyObject *args, *result = NULL; + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(function)) { + PyObject *args[2] = {arg1, arg2}; + return __Pyx_PyFunction_FastCall(function, args, 2); + } + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(function)) { + PyObject *args[2] = {arg1, arg2}; + return __Pyx_PyCFunction_FastCall(function, args, 2); + } + #endif + args = PyTuple_New(2); + if (unlikely(!args)) goto done; + Py_INCREF(arg1); + PyTuple_SET_ITEM(args, 0, arg1); + Py_INCREF(arg2); + PyTuple_SET_ITEM(args, 1, arg2); + Py_INCREF(function); + result = __Pyx_PyObject_Call(function, args, NULL); + Py_DECREF(args); + Py_DECREF(function); +done: + return result; +} + +/* KeywordStringCheck */ +static int __Pyx_CheckKeywordStrings( + PyObject *kwdict, + const char* function_name, + int kw_allowed) +{ + PyObject* key = 0; + Py_ssize_t pos = 0; +#if CYTHON_COMPILING_IN_PYPY + if (!kw_allowed && PyDict_Next(kwdict, &pos, &key, 0)) + goto invalid_keyword; + return 1; +#else + while (PyDict_Next(kwdict, &pos, &key, 0)) { + #if PY_MAJOR_VERSION < 3 + if (unlikely(!PyString_Check(key))) + #endif + if (unlikely(!PyUnicode_Check(key))) + goto invalid_keyword_type; + } + if ((!kw_allowed) && unlikely(key)) + goto invalid_keyword; + return 1; +invalid_keyword_type: + PyErr_Format(PyExc_TypeError, + "%.200s() keywords must be strings", function_name); + return 0; +#endif +invalid_keyword: + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION < 3 + "%.200s() got an unexpected keyword argument '%.200s'", + function_name, PyString_AsString(key)); + #else + "%s() got an unexpected keyword argument '%U'", + function_name, key); + #endif + return 0; +} + +/* CallNextTpDealloc */ +static void __Pyx_call_next_tp_dealloc(PyObject* obj, destructor current_tp_dealloc) { + PyTypeObject* type = Py_TYPE(obj); + while (type && type->tp_dealloc != current_tp_dealloc) + type = type->tp_base; + while (type && type->tp_dealloc == current_tp_dealloc) + type = type->tp_base; + if (type) + type->tp_dealloc(obj); +} + +/* CallNextTpTraverse */ +static int __Pyx_call_next_tp_traverse(PyObject* obj, visitproc v, void *a, traverseproc current_tp_traverse) { + PyTypeObject* type = Py_TYPE(obj); + while (type && type->tp_traverse != current_tp_traverse) + type = type->tp_base; + while (type && type->tp_traverse == current_tp_traverse) + type = type->tp_base; + if (type && type->tp_traverse) + return type->tp_traverse(obj, v, a); + return 0; +} + +/* CallNextTpClear */ +static void __Pyx_call_next_tp_clear(PyObject* obj, inquiry current_tp_clear) { + PyTypeObject* type = Py_TYPE(obj); + while (type && type->tp_clear != current_tp_clear) + type = type->tp_base; + while (type && type->tp_clear == current_tp_clear) + type = type->tp_base; + if (type && type->tp_clear) + type->tp_clear(obj); +} + +/* TypeImport */ +#ifndef __PYX_HAVE_RT_ImportType +#define __PYX_HAVE_RT_ImportType +static PyTypeObject *__Pyx_ImportType(PyObject *module, const char *module_name, const char *class_name, + size_t size, enum __Pyx_ImportType_CheckSize check_size) +{ + PyObject *result = 0; + char warning[200]; + Py_ssize_t basicsize; +#ifdef Py_LIMITED_API + PyObject *py_basicsize; +#endif + result = PyObject_GetAttrString(module, class_name); + if (!result) + goto bad; + if (!PyType_Check(result)) { + PyErr_Format(PyExc_TypeError, + "%.200s.%.200s is not a type object", + module_name, class_name); + goto bad; + } +#ifndef Py_LIMITED_API + basicsize = ((PyTypeObject *)result)->tp_basicsize; +#else + py_basicsize = PyObject_GetAttrString(result, "__basicsize__"); + if (!py_basicsize) + goto bad; + basicsize = PyLong_AsSsize_t(py_basicsize); + Py_DECREF(py_basicsize); + py_basicsize = 0; + if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred()) + goto bad; +#endif + if ((size_t)basicsize < size) { + PyErr_Format(PyExc_ValueError, + "%.200s.%.200s size changed, may indicate binary incompatibility. " + "Expected %zd from C header, got %zd from PyObject", + module_name, class_name, size, basicsize); + goto bad; + } + if (check_size == __Pyx_ImportType_CheckSize_Error && (size_t)basicsize != size) { + PyErr_Format(PyExc_ValueError, + "%.200s.%.200s size changed, may indicate binary incompatibility. " + "Expected %zd from C header, got %zd from PyObject", + module_name, class_name, size, basicsize); + goto bad; + } + else if (check_size == __Pyx_ImportType_CheckSize_Warn && (size_t)basicsize > size) { + PyOS_snprintf(warning, sizeof(warning), + "%s.%s size changed, may indicate binary incompatibility. " + "Expected %zd from C header, got %zd from PyObject", + module_name, class_name, size, basicsize); + if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad; + } + return (PyTypeObject *)result; +bad: + Py_XDECREF(result); + return NULL; +} +#endif + +/* GetVTable */ +static void* __Pyx_GetVtable(PyObject *dict) { + void* ptr; + PyObject *ob = PyObject_GetItem(dict, __pyx_n_s_pyx_vtable); + if (!ob) + goto bad; +#if PY_VERSION_HEX >= 0x02070000 + ptr = PyCapsule_GetPointer(ob, 0); +#else + ptr = PyCObject_AsVoidPtr(ob); +#endif + if (!ptr && !PyErr_Occurred()) + PyErr_SetString(PyExc_RuntimeError, "invalid vtable found for imported type"); + Py_DECREF(ob); + return ptr; +bad: + Py_XDECREF(ob); + return NULL; +} + +/* PyObject_GenericGetAttrNoDict */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) { + PyErr_Format(PyExc_AttributeError, +#if PY_MAJOR_VERSION >= 3 + "'%.50s' object has no attribute '%U'", + tp->tp_name, attr_name); +#else + "'%.50s' object has no attribute '%.400s'", + tp->tp_name, PyString_AS_STRING(attr_name)); +#endif + return NULL; +} +static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) { + PyObject *descr; + PyTypeObject *tp = Py_TYPE(obj); + if (unlikely(!PyString_Check(attr_name))) { + return PyObject_GenericGetAttr(obj, attr_name); + } + assert(!tp->tp_dictoffset); + descr = _PyType_Lookup(tp, attr_name); + if (unlikely(!descr)) { + return __Pyx_RaiseGenericGetAttributeError(tp, attr_name); + } + Py_INCREF(descr); + #if PY_MAJOR_VERSION < 3 + if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS))) + #endif + { + descrgetfunc f = Py_TYPE(descr)->tp_descr_get; + if (unlikely(f)) { + PyObject *res = f(descr, obj, (PyObject *)tp); + Py_DECREF(descr); + return res; + } + } + return descr; +} +#endif + +/* PyObject_GenericGetAttr */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) { + if (unlikely(Py_TYPE(obj)->tp_dictoffset)) { + return PyObject_GenericGetAttr(obj, attr_name); + } + return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name); +} +#endif + +/* SetVTable */ +static int __Pyx_SetVtable(PyObject *dict, void *vtable) { +#if PY_VERSION_HEX >= 0x02070000 + PyObject *ob = PyCapsule_New(vtable, 0, 0); +#else + PyObject *ob = PyCObject_FromVoidPtr(vtable, 0); +#endif + if (!ob) + goto bad; + if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0) + goto bad; + Py_DECREF(ob); + return 0; +bad: + Py_XDECREF(ob); + return -1; +} + +/* FetchCommonType */ +static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { + PyObject* fake_module; + PyTypeObject* cached_type = NULL; + fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI); + if (!fake_module) return NULL; + Py_INCREF(fake_module); + cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name); + if (cached_type) { + if (!PyType_Check((PyObject*)cached_type)) { + PyErr_Format(PyExc_TypeError, + "Shared Cython type %.200s is not a type object", + type->tp_name); + goto bad; + } + if (cached_type->tp_basicsize != type->tp_basicsize) { + PyErr_Format(PyExc_TypeError, + "Shared Cython type %.200s has the wrong size, try recompiling", + type->tp_name); + goto bad; + } + } else { + if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; + PyErr_Clear(); + if (PyType_Ready(type) < 0) goto bad; + if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0) + goto bad; + Py_INCREF(type); + cached_type = type; + } +done: + Py_DECREF(fake_module); + return cached_type; +bad: + Py_XDECREF(cached_type); + cached_type = NULL; + goto done; +} + +/* CythonFunction */ +#include +static PyObject * +__Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure) +{ + if (unlikely(op->func_doc == NULL)) { + if (op->func.m_ml->ml_doc) { +#if PY_MAJOR_VERSION >= 3 + op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc); +#else + op->func_doc = PyString_FromString(op->func.m_ml->ml_doc); +#endif + if (unlikely(op->func_doc == NULL)) + return NULL; + } else { + Py_INCREF(Py_None); + return Py_None; + } + } + Py_INCREF(op->func_doc); + return op->func_doc; +} +static int +__Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context) +{ + PyObject *tmp = op->func_doc; + if (value == NULL) { + value = Py_None; + } + Py_INCREF(value); + op->func_doc = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + if (unlikely(op->func_name == NULL)) { +#if PY_MAJOR_VERSION >= 3 + op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name); +#else + op->func_name = PyString_InternFromString(op->func.m_ml->ml_name); +#endif + if (unlikely(op->func_name == NULL)) + return NULL; + } + Py_INCREF(op->func_name); + return op->func_name; +} +static int +__Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context) +{ + PyObject *tmp; +#if PY_MAJOR_VERSION >= 3 + if (unlikely(value == NULL || !PyUnicode_Check(value))) +#else + if (unlikely(value == NULL || !PyString_Check(value))) +#endif + { + PyErr_SetString(PyExc_TypeError, + "__name__ must be set to a string object"); + return -1; + } + tmp = op->func_name; + Py_INCREF(value); + op->func_name = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + Py_INCREF(op->func_qualname); + return op->func_qualname; +} +static int +__Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context) +{ + PyObject *tmp; +#if PY_MAJOR_VERSION >= 3 + if (unlikely(value == NULL || !PyUnicode_Check(value))) +#else + if (unlikely(value == NULL || !PyString_Check(value))) +#endif + { + PyErr_SetString(PyExc_TypeError, + "__qualname__ must be set to a string object"); + return -1; + } + tmp = op->func_qualname; + Py_INCREF(value); + op->func_qualname = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED void *closure) +{ + PyObject *self; + self = m->func_closure; + if (self == NULL) + self = Py_None; + Py_INCREF(self); + return self; +} +static PyObject * +__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + if (unlikely(op->func_dict == NULL)) { + op->func_dict = PyDict_New(); + if (unlikely(op->func_dict == NULL)) + return NULL; + } + Py_INCREF(op->func_dict); + return op->func_dict; +} +static int +__Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context) +{ + PyObject *tmp; + if (unlikely(value == NULL)) { + PyErr_SetString(PyExc_TypeError, + "function's dictionary may not be deleted"); + return -1; + } + if (unlikely(!PyDict_Check(value))) { + PyErr_SetString(PyExc_TypeError, + "setting function's dictionary to a non-dict"); + return -1; + } + tmp = op->func_dict; + Py_INCREF(value); + op->func_dict = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + Py_INCREF(op->func_globals); + return op->func_globals; +} +static PyObject * +__Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + Py_INCREF(Py_None); + return Py_None; +} +static PyObject * +__Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + PyObject* result = (op->func_code) ? op->func_code : Py_None; + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { + int result = 0; + PyObject *res = op->defaults_getter((PyObject *) op); + if (unlikely(!res)) + return -1; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + op->defaults_tuple = PyTuple_GET_ITEM(res, 0); + Py_INCREF(op->defaults_tuple); + op->defaults_kwdict = PyTuple_GET_ITEM(res, 1); + Py_INCREF(op->defaults_kwdict); + #else + op->defaults_tuple = PySequence_ITEM(res, 0); + if (unlikely(!op->defaults_tuple)) result = -1; + else { + op->defaults_kwdict = PySequence_ITEM(res, 1); + if (unlikely(!op->defaults_kwdict)) result = -1; + } + #endif + Py_DECREF(res); + return result; +} +static int +__Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) { + PyObject* tmp; + if (!value) { + value = Py_None; + } else if (value != Py_None && !PyTuple_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__defaults__ must be set to a tuple object"); + return -1; + } + Py_INCREF(value); + tmp = op->defaults_tuple; + op->defaults_tuple = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) { + PyObject* result = op->defaults_tuple; + if (unlikely(!result)) { + if (op->defaults_getter) { + if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL; + result = op->defaults_tuple; + } else { + result = Py_None; + } + } + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) { + PyObject* tmp; + if (!value) { + value = Py_None; + } else if (value != Py_None && !PyDict_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__kwdefaults__ must be set to a dict object"); + return -1; + } + Py_INCREF(value); + tmp = op->defaults_kwdict; + op->defaults_kwdict = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) { + PyObject* result = op->defaults_kwdict; + if (unlikely(!result)) { + if (op->defaults_getter) { + if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL; + result = op->defaults_kwdict; + } else { + result = Py_None; + } + } + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) { + PyObject* tmp; + if (!value || value == Py_None) { + value = NULL; + } else if (!PyDict_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__annotations__ must be set to a dict object"); + return -1; + } + Py_XINCREF(value); + tmp = op->func_annotations; + op->func_annotations = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) { + PyObject* result = op->func_annotations; + if (unlikely(!result)) { + result = PyDict_New(); + if (unlikely(!result)) return NULL; + op->func_annotations = result; + } + Py_INCREF(result); + return result; +} +static PyGetSetDef __pyx_CyFunction_getsets[] = { + {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, + {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, + {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, + {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, + {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, + {(char *) "__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0}, + {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, + {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, + {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, + {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, + {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, + {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, + {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, + {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, + {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, + {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, + {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, + {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, + {0, 0, 0, 0, 0} +}; +static PyMemberDef __pyx_CyFunction_members[] = { + {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), PY_WRITE_RESTRICTED, 0}, + {0, 0, 0, 0, 0} +}; +static PyObject * +__Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args) +{ +#if PY_MAJOR_VERSION >= 3 + return PyUnicode_FromString(m->func.m_ml->ml_name); +#else + return PyString_FromString(m->func.m_ml->ml_name); +#endif +} +static PyMethodDef __pyx_CyFunction_methods[] = { + {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, + {0, 0, 0, 0} +}; +#if PY_VERSION_HEX < 0x030500A0 +#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist) +#else +#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func.m_weakreflist) +#endif +static PyObject *__Pyx_CyFunction_New(PyTypeObject *type, PyMethodDef *ml, int flags, PyObject* qualname, + PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { + __pyx_CyFunctionObject *op = PyObject_GC_New(__pyx_CyFunctionObject, type); + if (op == NULL) + return NULL; + op->flags = flags; + __Pyx_CyFunction_weakreflist(op) = NULL; + op->func.m_ml = ml; + op->func.m_self = (PyObject *) op; + Py_XINCREF(closure); + op->func_closure = closure; + Py_XINCREF(module); + op->func.m_module = module; + op->func_dict = NULL; + op->func_name = NULL; + Py_INCREF(qualname); + op->func_qualname = qualname; + op->func_doc = NULL; + op->func_classobj = NULL; + op->func_globals = globals; + Py_INCREF(op->func_globals); + Py_XINCREF(code); + op->func_code = code; + op->defaults_pyobjects = 0; + op->defaults = NULL; + op->defaults_tuple = NULL; + op->defaults_kwdict = NULL; + op->defaults_getter = NULL; + op->func_annotations = NULL; + PyObject_GC_Track(op); + return (PyObject *) op; +} +static int +__Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) +{ + Py_CLEAR(m->func_closure); + Py_CLEAR(m->func.m_module); + Py_CLEAR(m->func_dict); + Py_CLEAR(m->func_name); + Py_CLEAR(m->func_qualname); + Py_CLEAR(m->func_doc); + Py_CLEAR(m->func_globals); + Py_CLEAR(m->func_code); + Py_CLEAR(m->func_classobj); + Py_CLEAR(m->defaults_tuple); + Py_CLEAR(m->defaults_kwdict); + Py_CLEAR(m->func_annotations); + if (m->defaults) { + PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); + int i; + for (i = 0; i < m->defaults_pyobjects; i++) + Py_XDECREF(pydefaults[i]); + PyObject_Free(m->defaults); + m->defaults = NULL; + } + return 0; +} +static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m) +{ + if (__Pyx_CyFunction_weakreflist(m) != NULL) + PyObject_ClearWeakRefs((PyObject *) m); + __Pyx_CyFunction_clear(m); + PyObject_GC_Del(m); +} +static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) +{ + PyObject_GC_UnTrack(m); + __Pyx__CyFunction_dealloc(m); +} +static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) +{ + Py_VISIT(m->func_closure); + Py_VISIT(m->func.m_module); + Py_VISIT(m->func_dict); + Py_VISIT(m->func_name); + Py_VISIT(m->func_qualname); + Py_VISIT(m->func_doc); + Py_VISIT(m->func_globals); + Py_VISIT(m->func_code); + Py_VISIT(m->func_classobj); + Py_VISIT(m->defaults_tuple); + Py_VISIT(m->defaults_kwdict); + if (m->defaults) { + PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); + int i; + for (i = 0; i < m->defaults_pyobjects; i++) + Py_VISIT(pydefaults[i]); + } + return 0; +} +static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type) +{ + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) { + Py_INCREF(func); + return func; + } + if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) { + if (type == NULL) + type = (PyObject *)(Py_TYPE(obj)); + return __Pyx_PyMethod_New(func, type, (PyObject *)(Py_TYPE(type))); + } + if (obj == Py_None) + obj = NULL; + return __Pyx_PyMethod_New(func, obj, type); +} +static PyObject* +__Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) +{ +#if PY_MAJOR_VERSION >= 3 + return PyUnicode_FromFormat("", + op->func_qualname, (void *)op); +#else + return PyString_FromFormat("", + PyString_AsString(op->func_qualname), (void *)op); +#endif +} +static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) { + PyCFunctionObject* f = (PyCFunctionObject*)func; + PyCFunction meth = f->m_ml->ml_meth; + Py_ssize_t size; + switch (f->m_ml->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) { + case METH_VARARGS: + if (likely(kw == NULL || PyDict_Size(kw) == 0)) + return (*meth)(self, arg); + break; + case METH_VARARGS | METH_KEYWORDS: + return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw); + case METH_NOARGS: + if (likely(kw == NULL || PyDict_Size(kw) == 0)) { + size = PyTuple_GET_SIZE(arg); + if (likely(size == 0)) + return (*meth)(self, NULL); + PyErr_Format(PyExc_TypeError, + "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", + f->m_ml->ml_name, size); + return NULL; + } + break; + case METH_O: + if (likely(kw == NULL || PyDict_Size(kw) == 0)) { + size = PyTuple_GET_SIZE(arg); + if (likely(size == 1)) { + PyObject *result, *arg0; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + arg0 = PyTuple_GET_ITEM(arg, 0); + #else + arg0 = PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL; + #endif + result = (*meth)(self, arg0); + #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) + Py_DECREF(arg0); + #endif + return result; + } + PyErr_Format(PyExc_TypeError, + "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", + f->m_ml->ml_name, size); + return NULL; + } + break; + default: + PyErr_SetString(PyExc_SystemError, "Bad call flags in " + "__Pyx_CyFunction_Call. METH_OLDARGS is no " + "longer supported!"); + return NULL; + } + PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", + f->m_ml->ml_name); + return NULL; +} +static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { + return __Pyx_CyFunction_CallMethod(func, ((PyCFunctionObject*)func)->m_self, arg, kw); +} +static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) { + PyObject *result; + __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func; + if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { + Py_ssize_t argc; + PyObject *new_args; + PyObject *self; + argc = PyTuple_GET_SIZE(args); + new_args = PyTuple_GetSlice(args, 1, argc); + if (unlikely(!new_args)) + return NULL; + self = PyTuple_GetItem(args, 0); + if (unlikely(!self)) { + Py_DECREF(new_args); + return NULL; + } + result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw); + Py_DECREF(new_args); + } else { + result = __Pyx_CyFunction_Call(func, args, kw); + } + return result; +} +static PyTypeObject __pyx_CyFunctionType_type = { + PyVarObject_HEAD_INIT(0, 0) + "cython_function_or_method", + sizeof(__pyx_CyFunctionObject), + 0, + (destructor) __Pyx_CyFunction_dealloc, + 0, + 0, + 0, +#if PY_MAJOR_VERSION < 3 + 0, +#else + 0, +#endif + (reprfunc) __Pyx_CyFunction_repr, + 0, + 0, + 0, + 0, + __Pyx_CyFunction_CallAsMethod, + 0, + 0, + 0, + 0, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, + 0, + (traverseproc) __Pyx_CyFunction_traverse, + (inquiry) __Pyx_CyFunction_clear, + 0, +#if PY_VERSION_HEX < 0x030500A0 + offsetof(__pyx_CyFunctionObject, func_weakreflist), +#else + offsetof(PyCFunctionObject, m_weakreflist), +#endif + 0, + 0, + __pyx_CyFunction_methods, + __pyx_CyFunction_members, + __pyx_CyFunction_getsets, + 0, + 0, + __Pyx_CyFunction_descr_get, + 0, + offsetof(__pyx_CyFunctionObject, func_dict), + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, +#if PY_VERSION_HEX >= 0x030400a1 + 0, +#endif +}; +static int __pyx_CyFunction_init(void) { + __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); + if (unlikely(__pyx_CyFunctionType == NULL)) { + return -1; + } + return 0; +} +static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults = PyObject_Malloc(size); + if (unlikely(!m->defaults)) + return PyErr_NoMemory(); + memset(m->defaults, 0, size); + m->defaults_pyobjects = pyobjects; + return m->defaults; +} +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults_tuple = tuple; + Py_INCREF(tuple); +} +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults_kwdict = dict; + Py_INCREF(dict); +} +static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->func_annotations = dict; + Py_INCREF(dict); +} + +/* GetModuleGlobalName */ +#if CYTHON_USE_DICT_VERSIONS +static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value) +#else +static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) +#endif +{ + PyObject *result; +#if !CYTHON_AVOID_BORROWED_REFS +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 + result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } else if (unlikely(PyErr_Occurred())) { + return NULL; + } +#else + result = PyDict_GetItem(__pyx_d, name); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } +#endif +#else + result = PyObject_GetItem(__pyx_d, name); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } + PyErr_Clear(); +#endif + return __Pyx_GetBuiltinName(name); +} + +/* PyObjectSetAttrStr */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) { + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_setattro)) + return tp->tp_setattro(obj, attr_name, value); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_setattr)) + return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value); +#endif + return PyObject_SetAttr(obj, attr_name, value); +} +#endif + +/* PyErrExceptionMatches */ +#if CYTHON_FAST_THREAD_STATE +static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { + Py_ssize_t i, n; + n = PyTuple_GET_SIZE(tuple); +#if PY_MAJOR_VERSION >= 3 + for (i=0; icurexc_type; + if (exc_type == err) return 1; + if (unlikely(!exc_type)) return 0; + if (unlikely(PyTuple_Check(err))) + return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err); + return __Pyx_PyErr_GivenExceptionMatches(exc_type, err); +} +#endif + +/* GetNameInClass */ +static PyObject *__Pyx_GetGlobalNameAfterAttributeLookup(PyObject *name) { + PyObject *result; + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) + return NULL; + __Pyx_PyErr_Clear(); + __Pyx_GetModuleGlobalNameUncached(result, name); + return result; +} +static PyObject *__Pyx__GetNameInClass(PyObject *nmspace, PyObject *name) { + PyObject *result; + result = __Pyx_PyObject_GetAttrStr(nmspace, name); + if (!result) { + result = __Pyx_GetGlobalNameAfterAttributeLookup(name); + } + return result; +} + +/* Import */ +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { + PyObject *empty_list = 0; + PyObject *module = 0; + PyObject *global_dict = 0; + PyObject *empty_dict = 0; + PyObject *list; + #if PY_MAJOR_VERSION < 3 + PyObject *py_import; + py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); + if (!py_import) + goto bad; + #endif + if (from_list) + list = from_list; + else { + empty_list = PyList_New(0); + if (!empty_list) + goto bad; + list = empty_list; + } + global_dict = PyModule_GetDict(__pyx_m); + if (!global_dict) + goto bad; + empty_dict = PyDict_New(); + if (!empty_dict) + goto bad; + { + #if PY_MAJOR_VERSION >= 3 + if (level == -1) { + if (strchr(__Pyx_MODULE_NAME, '.')) { + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, 1); + if (!module) { + if (!PyErr_ExceptionMatches(PyExc_ImportError)) + goto bad; + PyErr_Clear(); + } + } + level = 0; + } + #endif + if (!module) { + #if PY_MAJOR_VERSION < 3 + PyObject *py_level = PyInt_FromLong(level); + if (!py_level) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, py_level, (PyObject *)NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, level); + #endif + } + } +bad: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(py_import); + #endif + Py_XDECREF(empty_list); + Py_XDECREF(empty_dict); + return module; +} + +/* ImportFrom */ +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { + PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); + if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_Format(PyExc_ImportError, + #if PY_MAJOR_VERSION < 3 + "cannot import name %.230s", PyString_AS_STRING(name)); + #else + "cannot import name %S", name); + #endif + } + return value; +} + +/* GetAttr */ +static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) { +#if CYTHON_USE_TYPE_SLOTS +#if PY_MAJOR_VERSION >= 3 + if (likely(PyUnicode_Check(n))) +#else + if (likely(PyString_Check(n))) +#endif + return __Pyx_PyObject_GetAttrStr(o, n); +#endif + return PyObject_GetAttr(o, n); +} + +/* Globals */ +static PyObject* __Pyx_Globals(void) { + Py_ssize_t i; + PyObject *names; + PyObject *globals = __pyx_d; + Py_INCREF(globals); + names = PyObject_Dir(__pyx_m); + if (!names) + goto bad; + for (i = PyList_GET_SIZE(names)-1; i >= 0; i--) { +#if CYTHON_COMPILING_IN_PYPY + PyObject* name = PySequence_ITEM(names, i); + if (!name) + goto bad; +#else + PyObject* name = PyList_GET_ITEM(names, i); +#endif + if (!PyDict_Contains(globals, name)) { + PyObject* value = __Pyx_GetAttr(__pyx_m, name); + if (!value) { +#if CYTHON_COMPILING_IN_PYPY + Py_DECREF(name); +#endif + goto bad; + } + if (PyDict_SetItem(globals, name, value) < 0) { +#if CYTHON_COMPILING_IN_PYPY + Py_DECREF(name); +#endif + Py_DECREF(value); + goto bad; + } + } +#if CYTHON_COMPILING_IN_PYPY + Py_DECREF(name); +#endif + } + Py_DECREF(names); + return globals; +bad: + Py_XDECREF(names); + Py_XDECREF(globals); + return NULL; +} + +/* CLineInTraceback */ +#ifndef CYTHON_CLINE_IN_TRACEBACK +static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { + PyObject *use_cline; + PyObject *ptype, *pvalue, *ptraceback; +#if CYTHON_COMPILING_IN_CPYTHON + PyObject **cython_runtime_dict; +#endif + if (unlikely(!__pyx_cython_runtime)) { + return c_line; + } + __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); +#if CYTHON_COMPILING_IN_CPYTHON + cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); + if (likely(cython_runtime_dict)) { + __PYX_PY_DICT_LOOKUP_IF_MODIFIED( + use_cline, *cython_runtime_dict, + __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback)) + } else +#endif + { + PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback); + if (use_cline_obj) { + use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; + Py_DECREF(use_cline_obj); + } else { + PyErr_Clear(); + use_cline = NULL; + } + } + if (!use_cline) { + c_line = 0; + PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); + } + else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { + c_line = 0; + } + __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); + return c_line; +} +#endif + +/* CodeObjectCache */ +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { + int start = 0, mid = 0, end = count - 1; + if (end >= 0 && code_line > entries[end].code_line) { + return count; + } + while (start < end) { + mid = start + (end - start) / 2; + if (code_line < entries[mid].code_line) { + end = mid; + } else if (code_line > entries[mid].code_line) { + start = mid + 1; + } else { + return mid; + } + } + if (code_line <= entries[mid].code_line) { + return mid; + } else { + return mid + 1; + } +} +static PyCodeObject *__pyx_find_code_object(int code_line) { + PyCodeObject* code_object; + int pos; + if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { + return NULL; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { + return NULL; + } + code_object = __pyx_code_cache.entries[pos].code_object; + Py_INCREF(code_object); + return code_object; +} +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { + int pos, i; + __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; + if (unlikely(!code_line)) { + return; + } + if (unlikely(!entries)) { + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); + if (likely(entries)) { + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = 64; + __pyx_code_cache.count = 1; + entries[0].code_line = code_line; + entries[0].code_object = code_object; + Py_INCREF(code_object); + } + return; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { + PyCodeObject* tmp = entries[pos].code_object; + entries[pos].code_object = code_object; + Py_DECREF(tmp); + return; + } + if (__pyx_code_cache.count == __pyx_code_cache.max_count) { + int new_max = __pyx_code_cache.max_count + 64; + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( + __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry)); + if (unlikely(!entries)) { + return; + } + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = new_max; + } + for (i=__pyx_code_cache.count; i>pos; i--) { + entries[i] = entries[i-1]; + } + entries[pos].code_line = code_line; + entries[pos].code_object = code_object; + __pyx_code_cache.count++; + Py_INCREF(code_object); +} + +/* AddTraceback */ +#include "compile.h" +#include "frameobject.h" +#include "traceback.h" +static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( + const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyObject *py_srcfile = 0; + PyObject *py_funcname = 0; + #if PY_MAJOR_VERSION < 3 + py_srcfile = PyString_FromString(filename); + #else + py_srcfile = PyUnicode_FromString(filename); + #endif + if (!py_srcfile) goto bad; + if (c_line) { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + #else + py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + #endif + } + else { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromString(funcname); + #else + py_funcname = PyUnicode_FromString(funcname); + #endif + } + if (!py_funcname) goto bad; + py_code = __Pyx_PyCode_New( + 0, + 0, + 0, + 0, + 0, + __pyx_empty_bytes, /*PyObject *code,*/ + __pyx_empty_tuple, /*PyObject *consts,*/ + __pyx_empty_tuple, /*PyObject *names,*/ + __pyx_empty_tuple, /*PyObject *varnames,*/ + __pyx_empty_tuple, /*PyObject *freevars,*/ + __pyx_empty_tuple, /*PyObject *cellvars,*/ + py_srcfile, /*PyObject *filename,*/ + py_funcname, /*PyObject *name,*/ + py_line, + __pyx_empty_bytes /*PyObject *lnotab*/ + ); + Py_DECREF(py_srcfile); + Py_DECREF(py_funcname); + return py_code; +bad: + Py_XDECREF(py_srcfile); + Py_XDECREF(py_funcname); + return NULL; +} +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyFrameObject *py_frame = 0; + PyThreadState *tstate = __Pyx_PyThreadState_Current; + if (c_line) { + c_line = __Pyx_CLineForTraceback(tstate, c_line); + } + py_code = __pyx_find_code_object(c_line ? -c_line : py_line); + if (!py_code) { + py_code = __Pyx_CreateCodeObjectForTraceback( + funcname, c_line, py_line, filename); + if (!py_code) goto bad; + __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); + } + py_frame = PyFrame_New( + tstate, /*PyThreadState *tstate,*/ + py_code, /*PyCodeObject *code,*/ + __pyx_d, /*PyObject *globals,*/ + 0 /*PyObject *locals*/ + ); + if (!py_frame) goto bad; + __Pyx_PyFrame_SetLineNumber(py_frame, py_line); + PyTraceBack_Here(py_frame); +bad: + Py_XDECREF(py_code); + Py_XDECREF(py_frame); +} + +/* CIntFromPyVerify */ +#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ + __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) +#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ + __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) +#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ + {\ + func_type value = func_value;\ + if (sizeof(target_type) < sizeof(func_type)) {\ + if (unlikely(value != (func_type) (target_type) value)) {\ + func_type zero = 0;\ + if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ + return (target_type) -1;\ + if (is_unsigned && unlikely(value < zero))\ + goto raise_neg_overflow;\ + else\ + goto raise_overflow;\ + }\ + }\ + return (target_type) value;\ + } + +/* CIntToPy */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { + const int neg_one = (int) ((int) 0 - (int) 1), const_zero = (int) 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(int) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(int) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(int) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(int), + little, !is_unsigned); + } +} + +/* CIntFromPy */ +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { + const int neg_one = (int) ((int) 0 - (int) 1), const_zero = (int) 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(int) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (int) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (int) 0; + case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0]) + case 2: + if (8 * sizeof(int) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) { + return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + case 3: + if (8 * sizeof(int) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) { + return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + case 4: + if (8 * sizeof(int) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) { + return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (int) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if (sizeof(int) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (int) 0; + case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0])) + case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0]) + case -2: + if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { + return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 2: + if (8 * sizeof(int) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { + return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case -3: + if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { + return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 3: + if (8 * sizeof(int) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { + return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case -4: + if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { + return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 4: + if (8 * sizeof(int) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { + return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + } +#endif + if (sizeof(int) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + int val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (int) -1; + } + } else { + int val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (int) -1; + val = __Pyx_PyInt_As_int(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to int"); + return (int) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to int"); + return (int) -1; +} + +/* CIntToPy */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { + const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(long) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(long) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(long) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(long), + little, !is_unsigned); + } +} + +/* CIntFromPy */ +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { + const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(long) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (long) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (long) 0; + case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0]) + case 2: + if (8 * sizeof(long) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) { + return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + case 3: + if (8 * sizeof(long) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) { + return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + case 4: + if (8 * sizeof(long) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) { + return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (long) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if (sizeof(long) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (long) 0; + case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0])) + case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0]) + case -2: + if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 2: + if (8 * sizeof(long) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case -3: + if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 3: + if (8 * sizeof(long) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case -4: + if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 4: + if (8 * sizeof(long) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + } +#endif + if (sizeof(long) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + long val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (long) -1; + } + } else { + long val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (long) -1; + val = __Pyx_PyInt_As_long(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to long"); + return (long) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to long"); + return (long) -1; +} + +/* FastTypeChecks */ +#if CYTHON_COMPILING_IN_CPYTHON +static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) { + while (a) { + a = a->tp_base; + if (a == b) + return 1; + } + return b == &PyBaseObject_Type; +} +static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) { + PyObject *mro; + if (a == b) return 1; + mro = a->tp_mro; + if (likely(mro)) { + Py_ssize_t i, n; + n = PyTuple_GET_SIZE(mro); + for (i = 0; i < n; i++) { + if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b) + return 1; + } + return 0; + } + return __Pyx_InBases(a, b); +} +#if PY_MAJOR_VERSION == 2 +static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { + PyObject *exception, *value, *tb; + int res; + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ErrFetch(&exception, &value, &tb); + res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; + if (unlikely(res == -1)) { + PyErr_WriteUnraisable(err); + res = 0; + } + if (!res) { + res = PyObject_IsSubclass(err, exc_type2); + if (unlikely(res == -1)) { + PyErr_WriteUnraisable(err); + res = 0; + } + } + __Pyx_ErrRestore(exception, value, tb); + return res; +} +#else +static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { + int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0; + if (!res) { + res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); + } + return res; +} +#endif +static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { + Py_ssize_t i, n; + assert(PyExceptionClass_Check(exc_type)); + n = PyTuple_GET_SIZE(tuple); +#if PY_MAJOR_VERSION >= 3 + for (i=0; i= 0x02070000 + cobj = PyCapsule_New(p, sig, 0); +#else + cobj = PyCObject_FromVoidPtrAndDesc(p, (void *)sig, 0); +#endif + if (!cobj) + goto bad; + if (PyDict_SetItem(d, name, cobj) < 0) + goto bad; + Py_DECREF(cobj); + Py_DECREF(d); + return 0; +bad: + Py_XDECREF(cobj); + Py_XDECREF(d); + return -1; +} + +/* VoidPtrImport */ +#ifndef __PYX_HAVE_RT_ImportVoidPtr +#define __PYX_HAVE_RT_ImportVoidPtr +static int __Pyx_ImportVoidPtr(PyObject *module, const char *name, void **p, const char *sig) { + PyObject *d = 0; + PyObject *cobj = 0; + d = PyObject_GetAttrString(module, (char *)"__pyx_capi__"); + if (!d) + goto bad; + cobj = PyDict_GetItemString(d, name); + if (!cobj) { + PyErr_Format(PyExc_ImportError, + "%.200s does not export expected C variable %.200s", + PyModule_GetName(module), name); + goto bad; + } +#if PY_VERSION_HEX >= 0x02070000 + if (!PyCapsule_IsValid(cobj, sig)) { + PyErr_Format(PyExc_TypeError, + "C variable %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", + PyModule_GetName(module), name, sig, PyCapsule_GetName(cobj)); + goto bad; + } + *p = PyCapsule_GetPointer(cobj, sig); +#else + {const char *desc, *s1, *s2; + desc = (const char *)PyCObject_GetDesc(cobj); + if (!desc) + goto bad; + s1 = desc; s2 = sig; + while (*s1 != '\0' && *s1 == *s2) { s1++; s2++; } + if (*s1 != *s2) { + PyErr_Format(PyExc_TypeError, + "C variable %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", + PyModule_GetName(module), name, sig, desc); + goto bad; + } + *p = PyCObject_AsVoidPtr(cobj);} +#endif + if (!(*p)) + goto bad; + Py_DECREF(d); + return 0; +bad: + Py_XDECREF(d); + return -1; +} +#endif + +/* FunctionImport */ +#ifndef __PYX_HAVE_RT_ImportFunction +#define __PYX_HAVE_RT_ImportFunction +static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig) { + PyObject *d = 0; + PyObject *cobj = 0; + union { + void (*fp)(void); + void *p; + } tmp; + d = PyObject_GetAttrString(module, (char *)"__pyx_capi__"); + if (!d) + goto bad; + cobj = PyDict_GetItemString(d, funcname); + if (!cobj) { + PyErr_Format(PyExc_ImportError, + "%.200s does not export expected C function %.200s", + PyModule_GetName(module), funcname); + goto bad; + } +#if PY_VERSION_HEX >= 0x02070000 + if (!PyCapsule_IsValid(cobj, sig)) { + PyErr_Format(PyExc_TypeError, + "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", + PyModule_GetName(module), funcname, sig, PyCapsule_GetName(cobj)); + goto bad; + } + tmp.p = PyCapsule_GetPointer(cobj, sig); +#else + {const char *desc, *s1, *s2; + desc = (const char *)PyCObject_GetDesc(cobj); + if (!desc) + goto bad; + s1 = desc; s2 = sig; + while (*s1 != '\0' && *s1 == *s2) { s1++; s2++; } + if (*s1 != *s2) { + PyErr_Format(PyExc_TypeError, + "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", + PyModule_GetName(module), funcname, sig, desc); + goto bad; + } + tmp.p = PyCObject_AsVoidPtr(cobj);} +#endif + *f = tmp.fp; + if (!(*f)) + goto bad; + Py_DECREF(d); + return 0; +bad: + Py_XDECREF(d); + return -1; +} +#endif + +/* InitStrings */ +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { + while (t->p) { + #if PY_MAJOR_VERSION < 3 + if (t->is_unicode) { + *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); + } else if (t->intern) { + *t->p = PyString_InternFromString(t->s); + } else { + *t->p = PyString_FromStringAndSize(t->s, t->n - 1); + } + #else + if (t->is_unicode | t->is_str) { + if (t->intern) { + *t->p = PyUnicode_InternFromString(t->s); + } else if (t->encoding) { + *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); + } else { + *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); + } + } else { + *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); + } + #endif + if (!*t->p) + return -1; + if (PyObject_Hash(*t->p) == -1) + return -1; + ++t; + } + return 0; +} + +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { + return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); +} +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { + Py_ssize_t ignore; + return __Pyx_PyObject_AsStringAndSize(o, &ignore); +} +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +#if !CYTHON_PEP393_ENABLED +static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { + char* defenc_c; + PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); + if (!defenc) return NULL; + defenc_c = PyBytes_AS_STRING(defenc); +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + { + char* end = defenc_c + PyBytes_GET_SIZE(defenc); + char* c; + for (c = defenc_c; c < end; c++) { + if ((unsigned char) (*c) >= 128) { + PyUnicode_AsASCIIString(o); + return NULL; + } + } + } +#endif + *length = PyBytes_GET_SIZE(defenc); + return defenc_c; +} +#else +static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { + if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + if (likely(PyUnicode_IS_ASCII(o))) { + *length = PyUnicode_GET_LENGTH(o); + return PyUnicode_AsUTF8(o); + } else { + PyUnicode_AsASCIIString(o); + return NULL; + } +#else + return PyUnicode_AsUTF8AndSize(o, length); +#endif +} +#endif +#endif +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT + if ( +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + __Pyx_sys_getdefaultencoding_not_ascii && +#endif + PyUnicode_Check(o)) { + return __Pyx_PyUnicode_AsStringAndSize(o, length); + } else +#endif +#if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) + if (PyByteArray_Check(o)) { + *length = PyByteArray_GET_SIZE(o); + return PyByteArray_AS_STRING(o); + } else +#endif + { + char* result; + int r = PyBytes_AsStringAndSize(o, &result, length); + if (unlikely(r < 0)) { + return NULL; + } else { + return result; + } + } +} +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { + int is_true = x == Py_True; + if (is_true | (x == Py_False) | (x == Py_None)) return is_true; + else return PyObject_IsTrue(x); +} +static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) { + int retval; + if (unlikely(!x)) return -1; + retval = __Pyx_PyObject_IsTrue(x); + Py_DECREF(x); + return retval; +} +static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) { +#if PY_MAJOR_VERSION >= 3 + if (PyLong_Check(result)) { + if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, + "__int__ returned non-int (type %.200s). " + "The ability to return an instance of a strict subclass of int " + "is deprecated, and may be removed in a future version of Python.", + Py_TYPE(result)->tp_name)) { + Py_DECREF(result); + return NULL; + } + return result; + } +#endif + PyErr_Format(PyExc_TypeError, + "__%.4s__ returned non-%.4s (type %.200s)", + type_name, type_name, Py_TYPE(result)->tp_name); + Py_DECREF(result); + return NULL; +} +static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { +#if CYTHON_USE_TYPE_SLOTS + PyNumberMethods *m; +#endif + const char *name = NULL; + PyObject *res = NULL; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x) || PyLong_Check(x))) +#else + if (likely(PyLong_Check(x))) +#endif + return __Pyx_NewRef(x); +#if CYTHON_USE_TYPE_SLOTS + m = Py_TYPE(x)->tp_as_number; + #if PY_MAJOR_VERSION < 3 + if (m && m->nb_int) { + name = "int"; + res = m->nb_int(x); + } + else if (m && m->nb_long) { + name = "long"; + res = m->nb_long(x); + } + #else + if (likely(m && m->nb_int)) { + name = "int"; + res = m->nb_int(x); + } + #endif +#else + if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { + res = PyNumber_Int(x); + } +#endif + if (likely(res)) { +#if PY_MAJOR_VERSION < 3 + if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) { +#else + if (unlikely(!PyLong_CheckExact(res))) { +#endif + return __Pyx_PyNumber_IntOrLongWrongResultType(res, name); + } + } + else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_TypeError, + "an integer is required"); + } + return res; +} +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { + Py_ssize_t ival; + PyObject *x; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_CheckExact(b))) { + if (sizeof(Py_ssize_t) >= sizeof(long)) + return PyInt_AS_LONG(b); + else + return PyInt_AsSsize_t(b); + } +#endif + if (likely(PyLong_CheckExact(b))) { + #if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)b)->ob_digit; + const Py_ssize_t size = Py_SIZE(b); + if (likely(__Pyx_sst_abs(size) <= 1)) { + ival = likely(size) ? digits[0] : 0; + if (size == -1) ival = -ival; + return ival; + } else { + switch (size) { + case 2: + if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { + return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -2: + if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case 3: + if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { + return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -3: + if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case 4: + if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { + return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -4: + if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + } + } + #endif + return PyLong_AsSsize_t(b); + } + x = PyNumber_Index(b); + if (!x) return -1; + ival = PyInt_AsSsize_t(x); + Py_DECREF(x); + return ival; +} +static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) { + return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False); +} +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { + return PyInt_FromSize_t(ival); +} + + +#endif /* Py_PYTHON_H */ diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_semaphore.html b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_semaphore.html new file mode 100644 index 00000000..afbe0304 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_semaphore.html @@ -0,0 +1,2285 @@ + + + + + + Cython: _semaphore.py + + + +

Generated by Cython 0.29.2

+

+ Yellow lines hint at Python interaction.
+ Click on a line that starts with a "+" to see the C code that Cython generated for it. +

+

Raw output: _semaphore.c

+
+001: # cython: auto_pickle=False,embedsignature=True,always_allow_keywords=False
+
  __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
 002: from __future__ import print_function, absolute_import, division
+
 003: 
+
+004: __all__ = [
+
  __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(__pyx_n_s_Semaphore);
+  __Pyx_GIVEREF(__pyx_n_s_Semaphore);
+  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_Semaphore);
+  __Pyx_INCREF(__pyx_n_s_BoundedSemaphore);
+  __Pyx_GIVEREF(__pyx_n_s_BoundedSemaphore);
+  PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_BoundedSemaphore);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_all, __pyx_t_1) < 0) __PYX_ERR(0, 4, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 005:     'Semaphore',
+
 006:     'BoundedSemaphore',
+
 007: ]
+
 008: 
+
+009: def _get_linkable():
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_11__semaphore_1_get_linkable(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6gevent_11__semaphore__get_linkable[] = "_get_linkable()";
+static PyMethodDef __pyx_mdef_6gevent_11__semaphore_1_get_linkable = {"_get_linkable", (PyCFunction)__pyx_pw_6gevent_11__semaphore_1_get_linkable, METH_NOARGS, __pyx_doc_6gevent_11__semaphore__get_linkable};
+static PyObject *__pyx_pw_6gevent_11__semaphore_1_get_linkable(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_get_linkable (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_11__semaphore__get_linkable(__pyx_self);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_11__semaphore__get_linkable(CYTHON_UNUSED PyObject *__pyx_self) {
+  PyObject *__pyx_v_x = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_get_linkable", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_AddTraceback("gevent.__semaphore._get_linkable", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_x);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__3 = PyTuple_Pack(1, __pyx_n_s_x); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 9, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__3);
+  __Pyx_GIVEREF(__pyx_tuple__3);
+/* … */
+  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_11__semaphore_1_get_linkable, 0, __pyx_n_s_get_linkable, NULL, __pyx_n_s_gevent___semaphore, __pyx_d, ((PyObject *)__pyx_codeobj__4)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 9, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_linkable, __pyx_t_1) < 0) __PYX_ERR(0, 9, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_codeobj__4 = (PyObject*)__Pyx_PyCode_New(0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__3, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__semaphore_py, __pyx_n_s_get_linkable, 9, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__4)) __PYX_ERR(0, 9, __pyx_L1_error)
+
+010:     x = __import__('gevent._abstract_linkable')
+
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin___import__, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 10, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_v_x = __pyx_t_1;
+  __pyx_t_1 = 0;
+/* … */
+  __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_gevent__abstract_linkable); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 10, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple_);
+  __Pyx_GIVEREF(__pyx_tuple_);
+
+011:     return x._abstract_linkable.AbstractLinkable
+
  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_abstract_linkable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 11, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_AbstractLinkable); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 11, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_r = __pyx_t_2;
+  __pyx_t_2 = 0;
+  goto __pyx_L0;
+
+012: locals()['AbstractLinkable'] = _get_linkable()
+
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_get_linkable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 12, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 12, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_1 = __Pyx_Globals(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 12, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (unlikely(PyDict_SetItem(__pyx_t_1, __pyx_n_s_AbstractLinkable, __pyx_t_2) < 0)) __PYX_ERR(0, 12, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+013: del _get_linkable
+
  if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_get_linkable) < 0) __PYX_ERR(0, 13, __pyx_L1_error)
+
 014: 
+
 015: 
+
+016: class Semaphore(AbstractLinkable): # pylint:disable=undefined-variable
+
struct __pyx_vtabstruct_6gevent_11__semaphore_Semaphore {
+  struct __pyx_vtabstruct_6gevent_19__abstract_linkable_AbstractLinkable __pyx_base;
+  int (*locked)(struct __pyx_obj_6gevent_11__semaphore_Semaphore *, int __pyx_skip_dispatch);
+  int (*release)(struct __pyx_obj_6gevent_11__semaphore_Semaphore *, int __pyx_skip_dispatch);
+  PyObject *(*_start_notify)(struct __pyx_obj_6gevent_11__semaphore_Semaphore *, int __pyx_skip_dispatch);
+  int (*wait)(struct __pyx_obj_6gevent_11__semaphore_Semaphore *, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_11__semaphore_9Semaphore_wait *__pyx_optional_args);
+  int (*acquire)(struct __pyx_obj_6gevent_11__semaphore_Semaphore *, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_11__semaphore_9Semaphore_acquire *__pyx_optional_args);
+  PyObject *(*__pyx___enter__)(struct __pyx_obj_6gevent_11__semaphore_Semaphore *, int __pyx_skip_dispatch);
+  PyObject *(*__pyx___exit__)(struct __pyx_obj_6gevent_11__semaphore_Semaphore *, PyObject *, PyObject *, PyObject *, int __pyx_skip_dispatch);
+};
+static struct __pyx_vtabstruct_6gevent_11__semaphore_Semaphore *__pyx_vtabptr_6gevent_11__semaphore_Semaphore;
+
+
 017:     """
+
 018:     Semaphore(value=1) -> Semaphore
+
 019: 
+
 020:     A semaphore manages a counter representing the number of release()
+
 021:     calls minus the number of acquire() calls, plus an initial value.
+
 022:     The acquire() method blocks if necessary until it can return
+
 023:     without making the counter negative.
+
 024: 
+
 025:     If not given, ``value`` defaults to 1.
+
 026: 
+
 027:     The semaphore is a context manager and can be used in ``with`` statements.
+
 028: 
+
 029:     This Semaphore's ``__exit__`` method does not call the trace function
+
 030:     on CPython, but does under PyPy.
+
 031: 
+
 032:     .. seealso:: :class:`BoundedSemaphore` for a safer version that prevents
+
 033:        some classes of bugs.
+
 034: 
+
 035:     .. versionchanged:: 1.4.0
+
 036: 
+
 037:         The order in which waiters are awakened is not specified. It was not
+
 038:         specified previously, but usually went in FIFO order.
+
 039:     """
+
 040: 
+
+041:     def __init__(self, value=1):
+
/* Python wrapper */
+static int __pyx_pw_6gevent_11__semaphore_9Semaphore_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static int __pyx_pw_6gevent_11__semaphore_9Semaphore_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_value = 0;
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_value,0};
+    PyObject* values[1] = {0};
+    values[0] = ((PyObject *)__pyx_int_1);
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value);
+          if (value) { values[0] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 41, __pyx_L3_error)
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    __pyx_v_value = values[0];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 41, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.__semaphore.Semaphore.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return -1;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_11__semaphore_9Semaphore___init__(((struct __pyx_obj_6gevent_11__semaphore_Semaphore *)__pyx_v_self), __pyx_v_value);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_11__semaphore_9Semaphore___init__(struct __pyx_obj_6gevent_11__semaphore_Semaphore *__pyx_v_self, PyObject *__pyx_v_value) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = 0;
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_AddTraceback("gevent.__semaphore.Semaphore.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = -1;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+042:         if value < 0:
+
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_value, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 42, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 42, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  if (unlikely(__pyx_t_2)) {
+/* … */
+  }
+
+043:             raise ValueError("semaphore initial value must be >= 0")
+
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 43, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __PYX_ERR(0, 43, __pyx_L1_error)
+/* … */
+  __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_semaphore_initial_value_must_be); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 43, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__2);
+  __Pyx_GIVEREF(__pyx_tuple__2);
+
+044:         super(Semaphore, self).__init__()
+
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 44, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_INCREF(((PyObject *)__pyx_ptype_6gevent_11__semaphore_Semaphore));
+  __Pyx_GIVEREF(((PyObject *)__pyx_ptype_6gevent_11__semaphore_Semaphore));
+  PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_ptype_6gevent_11__semaphore_Semaphore));
+  __Pyx_INCREF(((PyObject *)__pyx_v_self));
+  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
+  PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_v_self));
+  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 44, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_4);
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_init); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 44, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __pyx_t_4 = NULL;
+  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
+    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+    if (likely(__pyx_t_4)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+      __Pyx_INCREF(__pyx_t_4);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_3, function);
+    }
+  }
+  __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 44, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+045:         self.counter = value
+
  __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 45, __pyx_L1_error)
+  __pyx_v_self->counter = __pyx_t_5;
+
+046:         self._notify_all = False
+
  __pyx_v_self->__pyx_base._notify_all = 0;
+
 047: 
+
+048:     def __str__(self):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_11__semaphore_9Semaphore_3__str__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_11__semaphore_9Semaphore_3__str__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_11__semaphore_9Semaphore_2__str__(((struct __pyx_obj_6gevent_11__semaphore_Semaphore *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_11__semaphore_9Semaphore_2__str__(struct __pyx_obj_6gevent_11__semaphore_Semaphore *__pyx_v_self) {
+  PyObject *__pyx_v_params = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__str__", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_AddTraceback("gevent.__semaphore.Semaphore.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_params);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+049:         params = (self.__class__.__name__, self.counter, self.linkcount())
+
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 49, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 49, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->counter); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 49, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_linkcount); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 49, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_4);
+  __pyx_t_5 = NULL;
+  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
+    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
+    if (likely(__pyx_t_5)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
+      __Pyx_INCREF(__pyx_t_5);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_4, function);
+    }
+  }
+  __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 49, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 49, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_4);
+  __Pyx_GIVEREF(__pyx_t_2);
+  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
+  __Pyx_GIVEREF(__pyx_t_1);
+  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_3);
+  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
+  __pyx_t_2 = 0;
+  __pyx_t_1 = 0;
+  __pyx_t_3 = 0;
+  __pyx_v_params = ((PyObject*)__pyx_t_4);
+  __pyx_t_4 = 0;
+
+050:         return '<%s counter=%s _links[%s]>' % params
+
  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_s_counter_s__links_s, __pyx_v_params); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 50, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_4);
+  __pyx_r = __pyx_t_4;
+  __pyx_t_4 = 0;
+  goto __pyx_L0;
+
 051: 
+
+052:     def locked(self):
+
static PyObject *__pyx_pw_6gevent_11__semaphore_9Semaphore_5locked(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static int __pyx_f_6gevent_11__semaphore_9Semaphore_locked(struct __pyx_obj_6gevent_11__semaphore_Semaphore *__pyx_v_self, int __pyx_skip_dispatch) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("locked", 0);
+  /* Check if called by wrapper */
+  if (unlikely(__pyx_skip_dispatch)) ;
+  /* Check if overridden in Python */
+  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
+    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
+    if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
+    else {
+      PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      #endif
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_locked); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 52, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_11__semaphore_9Semaphore_5locked)) {
+        __Pyx_INCREF(__pyx_t_1);
+        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+          if (likely(__pyx_t_4)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+            __Pyx_INCREF(__pyx_t_4);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_3, function);
+          }
+        }
+        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
+        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 52, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 52, __pyx_L1_error)
+        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+        __pyx_r = __pyx_t_5;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        goto __pyx_L0;
+      }
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+      tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
+      if (unlikely(type_dict_guard != tp_dict_version)) {
+        tp_dict_version = obj_dict_version = 0;
+      }
+      #endif
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    }
+    #endif
+  }
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_WriteUnraisable("gevent.__semaphore.Semaphore.locked", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_11__semaphore_9Semaphore_5locked(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6gevent_11__semaphore_9Semaphore_4locked[] = "Semaphore.locked(self) -> bool\nReturn a boolean indicating whether the semaphore can be acquired.\n        Most useful with binary semaphores.";
+static PyMethodDef __pyx_mdef_6gevent_11__semaphore_9Semaphore_5locked = {"locked", (PyCFunction)__pyx_pw_6gevent_11__semaphore_9Semaphore_5locked, METH_NOARGS, __pyx_doc_6gevent_11__semaphore_9Semaphore_4locked};
+static PyObject *__pyx_pw_6gevent_11__semaphore_9Semaphore_5locked(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("locked (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_11__semaphore_9Semaphore_4locked(((struct __pyx_obj_6gevent_11__semaphore_Semaphore *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_11__semaphore_9Semaphore_4locked(struct __pyx_obj_6gevent_11__semaphore_Semaphore *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("locked", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_f_6gevent_11__semaphore_9Semaphore_locked(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 52, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.__semaphore.Semaphore.locked", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__5 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 52, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__5);
+  __Pyx_GIVEREF(__pyx_tuple__5);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_11__semaphore_9Semaphore_5locked, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Semaphore_locked, NULL, __pyx_n_s_gevent___semaphore, __pyx_d, ((PyObject *)__pyx_codeobj__6)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 52, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_11__semaphore_Semaphore->tp_dict, __pyx_n_s_locked, __pyx_t_2) < 0) __PYX_ERR(0, 52, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_11__semaphore_Semaphore);
+  __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__5, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__semaphore_py, __pyx_n_s_locked, 52, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__6)) __PYX_ERR(0, 52, __pyx_L1_error)
+
 053:         """Return a boolean indicating whether the semaphore can be acquired.
+
 054:         Most useful with binary semaphores."""
+
+055:         return self.counter <= 0
+
  __pyx_r = (__pyx_v_self->counter <= 0);
+  goto __pyx_L0;
+
 056: 
+
+057:     def release(self):
+
static PyObject *__pyx_pw_6gevent_11__semaphore_9Semaphore_7release(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static int __pyx_f_6gevent_11__semaphore_9Semaphore_release(struct __pyx_obj_6gevent_11__semaphore_Semaphore *__pyx_v_self, int __pyx_skip_dispatch) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("release", 0);
+  /* Check if called by wrapper */
+  if (unlikely(__pyx_skip_dispatch)) ;
+  /* Check if overridden in Python */
+  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
+    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
+    if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
+    else {
+      PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      #endif
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_release); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 57, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_11__semaphore_9Semaphore_7release)) {
+        __Pyx_INCREF(__pyx_t_1);
+        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+          if (likely(__pyx_t_4)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+            __Pyx_INCREF(__pyx_t_4);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_3, function);
+          }
+        }
+        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
+        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 57, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 57, __pyx_L1_error)
+        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+        __pyx_r = __pyx_t_5;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        goto __pyx_L0;
+      }
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+      tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
+      if (unlikely(type_dict_guard != tp_dict_version)) {
+        tp_dict_version = obj_dict_version = 0;
+      }
+      #endif
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    }
+    #endif
+  }
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_AddTraceback("gevent.__semaphore.Semaphore.release", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = -1000;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_11__semaphore_9Semaphore_7release(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6gevent_11__semaphore_9Semaphore_6release[] = "Semaphore.release(self) -> int\n\n        Release the semaphore, notifying any waiters if needed.\n        ";
+static PyMethodDef __pyx_mdef_6gevent_11__semaphore_9Semaphore_7release = {"release", (PyCFunction)__pyx_pw_6gevent_11__semaphore_9Semaphore_7release, METH_NOARGS, __pyx_doc_6gevent_11__semaphore_9Semaphore_6release};
+static PyObject *__pyx_pw_6gevent_11__semaphore_9Semaphore_7release(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("release (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_11__semaphore_9Semaphore_6release(((struct __pyx_obj_6gevent_11__semaphore_Semaphore *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_11__semaphore_9Semaphore_6release(struct __pyx_obj_6gevent_11__semaphore_Semaphore *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("release", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __pyx_f_6gevent_11__semaphore_9Semaphore_release(__pyx_v_self, 1); if (unlikely(__pyx_t_1 == ((int)-1000))) __PYX_ERR(0, 57, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 57, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_r = __pyx_t_2;
+  __pyx_t_2 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_AddTraceback("gevent.__semaphore.Semaphore.release", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__7 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 57, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__7);
+  __Pyx_GIVEREF(__pyx_tuple__7);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_11__semaphore_9Semaphore_7release, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Semaphore_release, NULL, __pyx_n_s_gevent___semaphore, __pyx_d, ((PyObject *)__pyx_codeobj__8)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 57, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_11__semaphore_Semaphore->tp_dict, __pyx_n_s_release, __pyx_t_2) < 0) __PYX_ERR(0, 57, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_11__semaphore_Semaphore);
+  __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__semaphore_py, __pyx_n_s_release, 57, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) __PYX_ERR(0, 57, __pyx_L1_error)
+
 058:         """
+
 059:         Release the semaphore, notifying any waiters if needed.
+
 060:         """
+
+061:         self.counter += 1
+
  __pyx_v_self->counter = (__pyx_v_self->counter + 1);
+
+062:         self._check_and_notify()
+
  __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_11__semaphore_Semaphore *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._check_and_notify(((struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 62, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+063:         return self.counter
+
  __pyx_r = __pyx_v_self->counter;
+  goto __pyx_L0;
+
 064: 
+
+065:     def ready(self):
+
static PyObject *__pyx_pw_6gevent_11__semaphore_9Semaphore_9ready(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static int __pyx_f_6gevent_11__semaphore_9Semaphore_ready(struct __pyx_obj_6gevent_11__semaphore_Semaphore *__pyx_v_self, int __pyx_skip_dispatch) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("ready", 0);
+  /* Check if called by wrapper */
+  if (unlikely(__pyx_skip_dispatch)) ;
+  /* Check if overridden in Python */
+  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
+    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
+    if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
+    else {
+      PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      #endif
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_ready); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 65, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_11__semaphore_9Semaphore_9ready)) {
+        __Pyx_INCREF(__pyx_t_1);
+        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+          if (likely(__pyx_t_4)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+            __Pyx_INCREF(__pyx_t_4);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_3, function);
+          }
+        }
+        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
+        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 65, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 65, __pyx_L1_error)
+        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+        __pyx_r = __pyx_t_5;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        goto __pyx_L0;
+      }
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+      tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
+      if (unlikely(type_dict_guard != tp_dict_version)) {
+        tp_dict_version = obj_dict_version = 0;
+      }
+      #endif
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    }
+    #endif
+  }
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_WriteUnraisable("gevent.__semaphore.Semaphore.ready", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_11__semaphore_9Semaphore_9ready(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6gevent_11__semaphore_9Semaphore_8ready[] = "Semaphore.ready(self) -> bool";
+static PyMethodDef __pyx_mdef_6gevent_11__semaphore_9Semaphore_9ready = {"ready", (PyCFunction)__pyx_pw_6gevent_11__semaphore_9Semaphore_9ready, METH_NOARGS, __pyx_doc_6gevent_11__semaphore_9Semaphore_8ready};
+static PyObject *__pyx_pw_6gevent_11__semaphore_9Semaphore_9ready(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("ready (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_11__semaphore_9Semaphore_8ready(((struct __pyx_obj_6gevent_11__semaphore_Semaphore *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_11__semaphore_9Semaphore_8ready(struct __pyx_obj_6gevent_11__semaphore_Semaphore *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("ready", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_f_6gevent_11__semaphore_9Semaphore_ready(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 65, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.__semaphore.Semaphore.ready", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__9 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 65, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__9);
+  __Pyx_GIVEREF(__pyx_tuple__9);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_11__semaphore_9Semaphore_9ready, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Semaphore_ready, NULL, __pyx_n_s_gevent___semaphore, __pyx_d, ((PyObject *)__pyx_codeobj__10)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 65, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_11__semaphore_Semaphore->tp_dict, __pyx_n_s_ready, __pyx_t_2) < 0) __PYX_ERR(0, 65, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_11__semaphore_Semaphore);
+  __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__9, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__semaphore_py, __pyx_n_s_ready, 65, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__10)) __PYX_ERR(0, 65, __pyx_L1_error)
+
+066:         return self.counter > 0
+
  __pyx_r = (__pyx_v_self->counter > 0);
+  goto __pyx_L0;
+
 067: 
+
+068:     def _start_notify(self):
+
static PyObject *__pyx_pw_6gevent_11__semaphore_9Semaphore_11_start_notify(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyObject *__pyx_f_6gevent_11__semaphore_9Semaphore__start_notify(struct __pyx_obj_6gevent_11__semaphore_Semaphore *__pyx_v_self, int __pyx_skip_dispatch) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_start_notify", 0);
+  /* Check if called by wrapper */
+  if (unlikely(__pyx_skip_dispatch)) ;
+  /* Check if overridden in Python */
+  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
+    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
+    if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
+    else {
+      PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      #endif
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_start_notify); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 68, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_11__semaphore_9Semaphore_11_start_notify)) {
+        __Pyx_XDECREF(__pyx_r);
+        __Pyx_INCREF(__pyx_t_1);
+        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+          if (likely(__pyx_t_4)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+            __Pyx_INCREF(__pyx_t_4);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_3, function);
+          }
+        }
+        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
+        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 68, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __pyx_r = __pyx_t_2;
+        __pyx_t_2 = 0;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        goto __pyx_L0;
+      }
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+      tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
+      if (unlikely(type_dict_guard != tp_dict_version)) {
+        tp_dict_version = obj_dict_version = 0;
+      }
+      #endif
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    }
+    #endif
+  }
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_AddTraceback("gevent.__semaphore.Semaphore._start_notify", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_11__semaphore_9Semaphore_11_start_notify(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6gevent_11__semaphore_9Semaphore_10_start_notify[] = "Semaphore._start_notify(self)";
+static PyMethodDef __pyx_mdef_6gevent_11__semaphore_9Semaphore_11_start_notify = {"_start_notify", (PyCFunction)__pyx_pw_6gevent_11__semaphore_9Semaphore_11_start_notify, METH_NOARGS, __pyx_doc_6gevent_11__semaphore_9Semaphore_10_start_notify};
+static PyObject *__pyx_pw_6gevent_11__semaphore_9Semaphore_11_start_notify(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_start_notify (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_11__semaphore_9Semaphore_10_start_notify(((struct __pyx_obj_6gevent_11__semaphore_Semaphore *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_11__semaphore_9Semaphore_10_start_notify(struct __pyx_obj_6gevent_11__semaphore_Semaphore *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_start_notify", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __pyx_f_6gevent_11__semaphore_9Semaphore__start_notify(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 68, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.__semaphore.Semaphore._start_notify", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__11 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 68, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__11);
+  __Pyx_GIVEREF(__pyx_tuple__11);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_11__semaphore_9Semaphore_11_start_notify, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Semaphore__start_notify, NULL, __pyx_n_s_gevent___semaphore, __pyx_d, ((PyObject *)__pyx_codeobj__12)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 68, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_11__semaphore_Semaphore->tp_dict, __pyx_n_s_start_notify, __pyx_t_2) < 0) __PYX_ERR(0, 68, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_11__semaphore_Semaphore);
+  __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__11, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__semaphore_py, __pyx_n_s_start_notify, 68, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(0, 68, __pyx_L1_error)
+
+069:         self._check_and_notify()
+
  __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_11__semaphore_Semaphore *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._check_and_notify(((struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 69, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 070: 
+
+071:     def _wait_return_value(self, waited, wait_success):
+
static PyObject *__pyx_f_6gevent_11__semaphore_9Semaphore__wait_return_value(CYTHON_UNUSED struct __pyx_obj_6gevent_11__semaphore_Semaphore *__pyx_v_self, PyObject *__pyx_v_waited, PyObject *__pyx_v_wait_success) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_wait_return_value", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_AddTraceback("gevent.__semaphore.Semaphore._wait_return_value", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+072:         if waited:
+
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_waited); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 72, __pyx_L1_error)
+  if (__pyx_t_1) {
+/* … */
+  }
+
+073:             return wait_success
+
    __Pyx_XDECREF(__pyx_r);
+    __Pyx_INCREF(__pyx_v_wait_success);
+    __pyx_r = __pyx_v_wait_success;
+    goto __pyx_L0;
+
 074:         # We didn't even wait, we must be good to go.
+
 075:         # XXX: This is probably dead code, we're careful not to go into the wait
+
 076:         # state if we don't expect to need to
+
+077:         return True
+
  __Pyx_XDECREF(__pyx_r);
+  __Pyx_INCREF(Py_True);
+  __pyx_r = Py_True;
+  goto __pyx_L0;
+
 078: 
+
+079:     def wait(self, timeout=None):
+
static PyObject *__pyx_pw_6gevent_11__semaphore_9Semaphore_13wait(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static int __pyx_f_6gevent_11__semaphore_9Semaphore_wait(struct __pyx_obj_6gevent_11__semaphore_Semaphore *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_11__semaphore_9Semaphore_wait *__pyx_optional_args) {
+  PyObject *__pyx_v_timeout = ((PyObject *)Py_None);
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("wait", 0);
+  if (__pyx_optional_args) {
+    if (__pyx_optional_args->__pyx_n > 0) {
+      __pyx_v_timeout = __pyx_optional_args->timeout;
+    }
+  }
+  /* Check if called by wrapper */
+  if (unlikely(__pyx_skip_dispatch)) ;
+  /* Check if overridden in Python */
+  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
+    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
+    if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
+    else {
+      PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      #endif
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_wait); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 79, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_11__semaphore_9Semaphore_13wait)) {
+        __Pyx_INCREF(__pyx_t_1);
+        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+          if (likely(__pyx_t_4)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+            __Pyx_INCREF(__pyx_t_4);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_3, function);
+          }
+        }
+        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_timeout) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_timeout);
+        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 79, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 79, __pyx_L1_error)
+        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+        __pyx_r = __pyx_t_5;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        goto __pyx_L0;
+      }
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+      tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
+      if (unlikely(type_dict_guard != tp_dict_version)) {
+        tp_dict_version = obj_dict_version = 0;
+      }
+      #endif
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    }
+    #endif
+  }
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_AddTraceback("gevent.__semaphore.Semaphore.wait", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = -1000;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_11__semaphore_9Semaphore_13wait(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_6gevent_11__semaphore_9Semaphore_12wait[] = "Semaphore.wait(self, timeout=None) -> int\n\n        wait(timeout=None) -> int\n\n        Wait until it is possible to acquire this semaphore, or until the optional\n        *timeout* elapses.\n\n        .. caution:: If this semaphore was initialized with a size of 0,\n           this method will block forever if no timeout is given.\n\n        :keyword float timeout: If given, specifies the maximum amount of seconds\n           this method will block.\n        :return: A number indicating how many times the semaphore can be acquired\n            before blocking.\n        ";
+static PyMethodDef __pyx_mdef_6gevent_11__semaphore_9Semaphore_13wait = {"wait", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_11__semaphore_9Semaphore_13wait, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_11__semaphore_9Semaphore_12wait};
+static PyObject *__pyx_pw_6gevent_11__semaphore_9Semaphore_13wait(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_timeout = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("wait (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_timeout,0};
+    PyObject* values[1] = {0};
+    values[0] = ((PyObject *)Py_None);
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_timeout);
+          if (value) { values[0] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "wait") < 0)) __PYX_ERR(0, 79, __pyx_L3_error)
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    __pyx_v_timeout = values[0];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("wait", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 79, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.__semaphore.Semaphore.wait", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_11__semaphore_9Semaphore_12wait(((struct __pyx_obj_6gevent_11__semaphore_Semaphore *)__pyx_v_self), __pyx_v_timeout);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_11__semaphore_9Semaphore_12wait(struct __pyx_obj_6gevent_11__semaphore_Semaphore *__pyx_v_self, PyObject *__pyx_v_timeout) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("wait", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_2.__pyx_n = 1;
+  __pyx_t_2.timeout = __pyx_v_timeout;
+  __pyx_t_1 = __pyx_vtabptr_6gevent_11__semaphore_Semaphore->wait(__pyx_v_self, 1, &__pyx_t_2); if (unlikely(__pyx_t_1 == ((int)-1000))) __PYX_ERR(0, 79, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 79, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __pyx_r = __pyx_t_3;
+  __pyx_t_3 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_AddTraceback("gevent.__semaphore.Semaphore.wait", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__13 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_timeout); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 79, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__13);
+  __Pyx_GIVEREF(__pyx_tuple__13);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_11__semaphore_9Semaphore_13wait, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Semaphore_wait, NULL, __pyx_n_s_gevent___semaphore, __pyx_d, ((PyObject *)__pyx_codeobj__14)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 79, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_11__semaphore_Semaphore->tp_dict, __pyx_n_s_wait, __pyx_t_2) < 0) __PYX_ERR(0, 79, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_11__semaphore_Semaphore);
+  __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__13, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__semaphore_py, __pyx_n_s_wait, 79, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__14)) __PYX_ERR(0, 79, __pyx_L1_error)
+
 080:         """
+
 081:         wait(timeout=None) -> int
+
 082: 
+
 083:         Wait until it is possible to acquire this semaphore, or until the optional
+
 084:         *timeout* elapses.
+
 085: 
+
 086:         .. caution:: If this semaphore was initialized with a size of 0,
+
 087:            this method will block forever if no timeout is given.
+
 088: 
+
 089:         :keyword float timeout: If given, specifies the maximum amount of seconds
+
 090:            this method will block.
+
 091:         :return: A number indicating how many times the semaphore can be acquired
+
 092:             before blocking.
+
 093:         """
+
+094:         if self.counter > 0:
+
  __pyx_t_6 = ((__pyx_v_self->counter > 0) != 0);
+  if (__pyx_t_6) {
+/* … */
+  }
+
+095:             return self.counter
+
    __pyx_r = __pyx_v_self->counter;
+    goto __pyx_L0;
+
 096: 
+
+097:         self._wait(timeout) # return value irrelevant, whether we got it or got a timeout
+
  __pyx_t_7.__pyx_n = 1;
+  __pyx_t_7.timeout = __pyx_v_timeout;
+  __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_11__semaphore_Semaphore *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._wait(((struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *)__pyx_v_self), &__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 97, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+098:         return self.counter
+
  __pyx_r = __pyx_v_self->counter;
+  goto __pyx_L0;
+
 099: 
+
+100:     def acquire(self, blocking=True, timeout=None):
+
static PyObject *__pyx_pw_6gevent_11__semaphore_9Semaphore_15acquire(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static int __pyx_f_6gevent_11__semaphore_9Semaphore_acquire(struct __pyx_obj_6gevent_11__semaphore_Semaphore *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_11__semaphore_9Semaphore_acquire *__pyx_optional_args) {
+  int __pyx_v_blocking = ((int)1);
+  PyObject *__pyx_v_timeout = ((PyObject *)Py_None);
+  PyObject *__pyx_v_success = NULL;
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("acquire", 0);
+  if (__pyx_optional_args) {
+    if (__pyx_optional_args->__pyx_n > 0) {
+      __pyx_v_blocking = __pyx_optional_args->blocking;
+      if (__pyx_optional_args->__pyx_n > 1) {
+        __pyx_v_timeout = __pyx_optional_args->timeout;
+      }
+    }
+  }
+  /* Check if called by wrapper */
+  if (unlikely(__pyx_skip_dispatch)) ;
+  /* Check if overridden in Python */
+  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
+    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
+    if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
+    else {
+      PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      #endif
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_acquire); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 100, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_11__semaphore_9Semaphore_15acquire)) {
+        __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_blocking); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 100, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_3);
+        __Pyx_INCREF(__pyx_t_1);
+        __pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL;
+        __pyx_t_6 = 0;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
+          __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
+          if (likely(__pyx_t_5)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
+            __Pyx_INCREF(__pyx_t_5);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_4, function);
+            __pyx_t_6 = 1;
+          }
+        }
+        #if CYTHON_FAST_PYCALL
+        if (PyFunction_Check(__pyx_t_4)) {
+          PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_3, __pyx_v_timeout};
+          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 100, __pyx_L1_error)
+          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+          __Pyx_GOTREF(__pyx_t_2);
+          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        } else
+        #endif
+        #if CYTHON_FAST_PYCCALL
+        if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
+          PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_3, __pyx_v_timeout};
+          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 100, __pyx_L1_error)
+          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+          __Pyx_GOTREF(__pyx_t_2);
+          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        } else
+        #endif
+        {
+          __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 100, __pyx_L1_error)
+          __Pyx_GOTREF(__pyx_t_7);
+          if (__pyx_t_5) {
+            __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
+          }
+          __Pyx_GIVEREF(__pyx_t_3);
+          PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_t_3);
+          __Pyx_INCREF(__pyx_v_timeout);
+          __Pyx_GIVEREF(__pyx_v_timeout);
+          PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_timeout);
+          __pyx_t_3 = 0;
+          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 100, __pyx_L1_error)
+          __Pyx_GOTREF(__pyx_t_2);
+          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+        }
+        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+        __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 100, __pyx_L1_error)
+        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+        __pyx_r = __pyx_t_8;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        goto __pyx_L0;
+      }
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+      tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
+      if (unlikely(type_dict_guard != tp_dict_version)) {
+        tp_dict_version = obj_dict_version = 0;
+      }
+      #endif
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    }
+    #endif
+  }
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_XDECREF(__pyx_t_7);
+  __Pyx_AddTraceback("gevent.__semaphore.Semaphore.acquire", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = -1000;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_success);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_11__semaphore_9Semaphore_15acquire(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_6gevent_11__semaphore_9Semaphore_14acquire[] = "Semaphore.acquire(self, int blocking=True, timeout=None) -> bool\n\n        acquire(blocking=True, timeout=None) -> bool\n\n        Acquire the semaphore.\n\n        .. caution:: If this semaphore was initialized with a size of 0,\n           this method will block forever (unless a timeout is given or blocking is\n           set to false).\n\n        :keyword bool blocking: If True (the default), this function will block\n           until the semaphore is acquired.\n        :keyword float timeout: If given, specifies the maximum amount of seconds\n           this method will block.\n        :return: A boolean indicating whether the semaphore was acquired.\n           If ``blocking`` is True and ``timeout`` is None (the default), then\n           (so long as this semaphore was initialized with a size greater than 0)\n           this will always return True. If a timeout was given, and it expired before\n           the semaphore was acquired, False will be returned. (Note that this can still\n           raise a ``Timeout`` exception, if some other caller had already started a timer.)\n        ";
+static PyMethodDef __pyx_mdef_6gevent_11__semaphore_9Semaphore_15acquire = {"acquire", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_11__semaphore_9Semaphore_15acquire, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_11__semaphore_9Semaphore_14acquire};
+static PyObject *__pyx_pw_6gevent_11__semaphore_9Semaphore_15acquire(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  int __pyx_v_blocking;
+  PyObject *__pyx_v_timeout = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("acquire (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_blocking,&__pyx_n_s_timeout,0};
+    PyObject* values[2] = {0,0};
+    values[1] = ((PyObject *)Py_None);
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_blocking);
+          if (value) { values[0] = value; kw_args--; }
+        }
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_timeout);
+          if (value) { values[1] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "acquire") < 0)) __PYX_ERR(0, 100, __pyx_L3_error)
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    if (values[0]) {
+      __pyx_v_blocking = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_blocking == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 100, __pyx_L3_error)
+    } else {
+      __pyx_v_blocking = ((int)1);
+    }
+    __pyx_v_timeout = values[1];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("acquire", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 100, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.__semaphore.Semaphore.acquire", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_11__semaphore_9Semaphore_14acquire(((struct __pyx_obj_6gevent_11__semaphore_Semaphore *)__pyx_v_self), __pyx_v_blocking, __pyx_v_timeout);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_11__semaphore_9Semaphore_14acquire(struct __pyx_obj_6gevent_11__semaphore_Semaphore *__pyx_v_self, int __pyx_v_blocking, PyObject *__pyx_v_timeout) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("acquire", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_2.__pyx_n = 2;
+  __pyx_t_2.blocking = __pyx_v_blocking;
+  __pyx_t_2.timeout = __pyx_v_timeout;
+  __pyx_t_1 = __pyx_vtabptr_6gevent_11__semaphore_Semaphore->acquire(__pyx_v_self, 1, &__pyx_t_2); if (unlikely(__pyx_t_1 == ((int)-1000))) __PYX_ERR(0, 100, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 100, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __pyx_r = __pyx_t_3;
+  __pyx_t_3 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_AddTraceback("gevent.__semaphore.Semaphore.acquire", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__15 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_blocking, __pyx_n_s_timeout); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(0, 100, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__15);
+  __Pyx_GIVEREF(__pyx_tuple__15);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_11__semaphore_9Semaphore_15acquire, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Semaphore_acquire, NULL, __pyx_n_s_gevent___semaphore, __pyx_d, ((PyObject *)__pyx_codeobj__16)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 100, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_11__semaphore_Semaphore->tp_dict, __pyx_n_s_acquire, __pyx_t_2) < 0) __PYX_ERR(0, 100, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_11__semaphore_Semaphore);
+  __pyx_codeobj__16 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__15, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__semaphore_py, __pyx_n_s_acquire, 100, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__16)) __PYX_ERR(0, 100, __pyx_L1_error)
+
 101:         """
+
 102:         acquire(blocking=True, timeout=None) -> bool
+
 103: 
+
 104:         Acquire the semaphore.
+
 105: 
+
 106:         .. caution:: If this semaphore was initialized with a size of 0,
+
 107:            this method will block forever (unless a timeout is given or blocking is
+
 108:            set to false).
+
 109: 
+
 110:         :keyword bool blocking: If True (the default), this function will block
+
 111:            until the semaphore is acquired.
+
 112:         :keyword float timeout: If given, specifies the maximum amount of seconds
+
 113:            this method will block.
+
 114:         :return: A boolean indicating whether the semaphore was acquired.
+
 115:            If ``blocking`` is True and ``timeout`` is None (the default), then
+
 116:            (so long as this semaphore was initialized with a size greater than 0)
+
 117:            this will always return True. If a timeout was given, and it expired before
+
 118:            the semaphore was acquired, False will be returned. (Note that this can still
+
 119:            raise a ``Timeout`` exception, if some other caller had already started a timer.)
+
 120:         """
+
+121:         if self.counter > 0:
+
  __pyx_t_8 = ((__pyx_v_self->counter > 0) != 0);
+  if (__pyx_t_8) {
+/* … */
+  }
+
+122:             self.counter -= 1
+
    __pyx_v_self->counter = (__pyx_v_self->counter - 1);
+
+123:             return True
+
    __pyx_r = 1;
+    goto __pyx_L0;
+
 124: 
+
+125:         if not blocking:
+
  __pyx_t_8 = ((!(__pyx_v_blocking != 0)) != 0);
+  if (__pyx_t_8) {
+/* … */
+  }
+
+126:             return False
+
    __pyx_r = 0;
+    goto __pyx_L0;
+
 127: 
+
+128:         success = self._wait(timeout)
+
  __pyx_t_9.__pyx_n = 1;
+  __pyx_t_9.timeout = __pyx_v_timeout;
+  __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_11__semaphore_Semaphore *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._wait(((struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *)__pyx_v_self), &__pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 128, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_v_success = __pyx_t_1;
+  __pyx_t_1 = 0;
+
+129:         if not success:
+
  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_success); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 129, __pyx_L1_error)
+  __pyx_t_10 = ((!__pyx_t_8) != 0);
+  if (__pyx_t_10) {
+/* … */
+  }
+
 130:             # Our timer expired.
+
+131:             return False
+
    __pyx_r = 0;
+    goto __pyx_L0;
+
 132: 
+
 133:         # Neither our timer no another one expired, so we blocked until
+
 134:         # awoke. Therefore, the counter is ours
+
+135:         self.counter -= 1
+
  __pyx_v_self->counter = (__pyx_v_self->counter - 1);
+
+136:         assert self.counter >= 0
+
  #ifndef CYTHON_WITHOUT_ASSERTIONS
+  if (unlikely(!Py_OptimizeFlag)) {
+    if (unlikely(!((__pyx_v_self->counter >= 0) != 0))) {
+      PyErr_SetNone(PyExc_AssertionError);
+      __PYX_ERR(0, 136, __pyx_L1_error)
+    }
+  }
+  #endif
+
+137:         return True
+
  __pyx_r = 1;
+  goto __pyx_L0;
+
 138: 
+
+139:     _py3k_acquire = acquire # PyPy needs this; it must be static for Cython
+
  __Pyx_GetNameInClass(__pyx_t_2, (PyObject *)__pyx_ptype_6gevent_11__semaphore_Semaphore, __pyx_n_s_acquire); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 139, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_11__semaphore_Semaphore->tp_dict, __pyx_n_s_py3k_acquire, __pyx_t_2) < 0) __PYX_ERR(0, 139, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_11__semaphore_Semaphore);
+
 140: 
+
+141:     def __enter__(self):
+
static PyObject *__pyx_pw_6gevent_11__semaphore_9Semaphore_17__enter__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyObject *__pyx_f_6gevent_11__semaphore_9Semaphore___enter__(struct __pyx_obj_6gevent_11__semaphore_Semaphore *__pyx_v_self, int __pyx_skip_dispatch) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__enter__", 0);
+  /* Check if called by wrapper */
+  if (unlikely(__pyx_skip_dispatch)) ;
+  /* Check if overridden in Python */
+  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
+    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
+    if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
+    else {
+      PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      #endif
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_enter); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 141, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_11__semaphore_9Semaphore_17__enter__)) {
+        __Pyx_XDECREF(__pyx_r);
+        __Pyx_INCREF(__pyx_t_1);
+        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+          if (likely(__pyx_t_4)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+            __Pyx_INCREF(__pyx_t_4);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_3, function);
+          }
+        }
+        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
+        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 141, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __pyx_r = __pyx_t_2;
+        __pyx_t_2 = 0;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        goto __pyx_L0;
+      }
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+      tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
+      if (unlikely(type_dict_guard != tp_dict_version)) {
+        tp_dict_version = obj_dict_version = 0;
+      }
+      #endif
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    }
+    #endif
+  }
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_AddTraceback("gevent.__semaphore.Semaphore.__enter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_11__semaphore_9Semaphore_17__enter__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6gevent_11__semaphore_9Semaphore_16__enter__[] = "Semaphore.__enter__(self)";
+static PyMethodDef __pyx_mdef_6gevent_11__semaphore_9Semaphore_17__enter__ = {"__enter__", (PyCFunction)__pyx_pw_6gevent_11__semaphore_9Semaphore_17__enter__, METH_NOARGS, __pyx_doc_6gevent_11__semaphore_9Semaphore_16__enter__};
+static PyObject *__pyx_pw_6gevent_11__semaphore_9Semaphore_17__enter__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__enter__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_11__semaphore_9Semaphore_16__enter__(((struct __pyx_obj_6gevent_11__semaphore_Semaphore *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_11__semaphore_9Semaphore_16__enter__(struct __pyx_obj_6gevent_11__semaphore_Semaphore *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__enter__", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __pyx_f_6gevent_11__semaphore_9Semaphore___enter__(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 141, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.__semaphore.Semaphore.__enter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__17 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(0, 141, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__17);
+  __Pyx_GIVEREF(__pyx_tuple__17);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_11__semaphore_9Semaphore_17__enter__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Semaphore___enter, NULL, __pyx_n_s_gevent___semaphore, __pyx_d, ((PyObject *)__pyx_codeobj__18)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 141, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_11__semaphore_Semaphore->tp_dict, __pyx_n_s_enter, __pyx_t_2) < 0) __PYX_ERR(0, 141, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_11__semaphore_Semaphore);
+  __pyx_codeobj__18 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__17, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__semaphore_py, __pyx_n_s_enter, 141, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__18)) __PYX_ERR(0, 141, __pyx_L1_error)
+
+142:         self.acquire()
+
  __pyx_t_5 = ((struct __pyx_vtabstruct_6gevent_11__semaphore_Semaphore *)__pyx_v_self->__pyx_base.__pyx_vtab)->acquire(__pyx_v_self, 0, NULL); if (unlikely(__pyx_t_5 == ((int)-1000))) __PYX_ERR(0, 142, __pyx_L1_error)
+
 143: 
+
+144:     def __exit__(self, t, v, tb):
+
static PyObject *__pyx_pw_6gevent_11__semaphore_9Semaphore_19__exit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_f_6gevent_11__semaphore_9Semaphore___exit__(struct __pyx_obj_6gevent_11__semaphore_Semaphore *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_t, CYTHON_UNUSED PyObject *__pyx_v_v, CYTHON_UNUSED PyObject *__pyx_v_tb, int __pyx_skip_dispatch) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__exit__", 0);
+  /* Check if called by wrapper */
+  if (unlikely(__pyx_skip_dispatch)) ;
+  /* Check if overridden in Python */
+  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
+    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
+    if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
+    else {
+      PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      #endif
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_exit); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 144, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_11__semaphore_9Semaphore_19__exit__)) {
+        __Pyx_XDECREF(__pyx_r);
+        __Pyx_INCREF(__pyx_t_1);
+        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
+        __pyx_t_5 = 0;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+          if (likely(__pyx_t_4)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+            __Pyx_INCREF(__pyx_t_4);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_3, function);
+            __pyx_t_5 = 1;
+          }
+        }
+        #if CYTHON_FAST_PYCALL
+        if (PyFunction_Check(__pyx_t_3)) {
+          PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_t, __pyx_v_v, __pyx_v_tb};
+          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 144, __pyx_L1_error)
+          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+          __Pyx_GOTREF(__pyx_t_2);
+        } else
+        #endif
+        #if CYTHON_FAST_PYCCALL
+        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
+          PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_t, __pyx_v_v, __pyx_v_tb};
+          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 144, __pyx_L1_error)
+          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+          __Pyx_GOTREF(__pyx_t_2);
+        } else
+        #endif
+        {
+          __pyx_t_6 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 144, __pyx_L1_error)
+          __Pyx_GOTREF(__pyx_t_6);
+          if (__pyx_t_4) {
+            __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
+          }
+          __Pyx_INCREF(__pyx_v_t);
+          __Pyx_GIVEREF(__pyx_v_t);
+          PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_t);
+          __Pyx_INCREF(__pyx_v_v);
+          __Pyx_GIVEREF(__pyx_v_v);
+          PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_v);
+          __Pyx_INCREF(__pyx_v_tb);
+          __Pyx_GIVEREF(__pyx_v_tb);
+          PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_v_tb);
+          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 144, __pyx_L1_error)
+          __Pyx_GOTREF(__pyx_t_2);
+          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+        }
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __pyx_r = __pyx_t_2;
+        __pyx_t_2 = 0;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        goto __pyx_L0;
+      }
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+      tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
+      if (unlikely(type_dict_guard != tp_dict_version)) {
+        tp_dict_version = obj_dict_version = 0;
+      }
+      #endif
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    }
+    #endif
+  }
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_6);
+  __Pyx_AddTraceback("gevent.__semaphore.Semaphore.__exit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_11__semaphore_9Semaphore_19__exit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_6gevent_11__semaphore_9Semaphore_18__exit__[] = "Semaphore.__exit__(self, t, v, tb)";
+static PyMethodDef __pyx_mdef_6gevent_11__semaphore_9Semaphore_19__exit__ = {"__exit__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_11__semaphore_9Semaphore_19__exit__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_11__semaphore_9Semaphore_18__exit__};
+static PyObject *__pyx_pw_6gevent_11__semaphore_9Semaphore_19__exit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_t = 0;
+  PyObject *__pyx_v_v = 0;
+  PyObject *__pyx_v_tb = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__exit__ (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_t,&__pyx_n_s_v,&__pyx_n_s_tb,0};
+    PyObject* values[3] = {0,0,0};
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_v)) != 0)) kw_args--;
+        else {
+          __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, 1); __PYX_ERR(0, 144, __pyx_L3_error)
+        }
+        CYTHON_FALLTHROUGH;
+        case  2:
+        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tb)) != 0)) kw_args--;
+        else {
+          __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, 2); __PYX_ERR(0, 144, __pyx_L3_error)
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__exit__") < 0)) __PYX_ERR(0, 144, __pyx_L3_error)
+      }
+    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
+      goto __pyx_L5_argtuple_error;
+    } else {
+      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+    }
+    __pyx_v_t = values[0];
+    __pyx_v_v = values[1];
+    __pyx_v_tb = values[2];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 144, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.__semaphore.Semaphore.__exit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_11__semaphore_9Semaphore_18__exit__(((struct __pyx_obj_6gevent_11__semaphore_Semaphore *)__pyx_v_self), __pyx_v_t, __pyx_v_v, __pyx_v_tb);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_11__semaphore_9Semaphore_18__exit__(struct __pyx_obj_6gevent_11__semaphore_Semaphore *__pyx_v_self, PyObject *__pyx_v_t, PyObject *__pyx_v_v, PyObject *__pyx_v_tb) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__exit__", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __pyx_f_6gevent_11__semaphore_9Semaphore___exit__(__pyx_v_self, __pyx_v_t, __pyx_v_v, __pyx_v_tb, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 144, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.__semaphore.Semaphore.__exit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__19 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_t, __pyx_n_s_v, __pyx_n_s_tb); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(0, 144, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__19);
+  __Pyx_GIVEREF(__pyx_tuple__19);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_11__semaphore_9Semaphore_19__exit__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Semaphore___exit, NULL, __pyx_n_s_gevent___semaphore, __pyx_d, ((PyObject *)__pyx_codeobj__20)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 144, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_11__semaphore_Semaphore->tp_dict, __pyx_n_s_exit, __pyx_t_2) < 0) __PYX_ERR(0, 144, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_11__semaphore_Semaphore);
+  __pyx_codeobj__20 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__19, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__semaphore_py, __pyx_n_s_exit, 144, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__20)) __PYX_ERR(0, 144, __pyx_L1_error)
+
+145:         self.release()
+
  __pyx_t_5 = ((struct __pyx_vtabstruct_6gevent_11__semaphore_Semaphore *)__pyx_v_self->__pyx_base.__pyx_vtab)->release(__pyx_v_self, 0); if (unlikely(__pyx_t_5 == ((int)-1000))) __PYX_ERR(0, 145, __pyx_L1_error)
+
 146: 
+
 147: 
+
+148: class BoundedSemaphore(Semaphore):
+
struct __pyx_vtabstruct_6gevent_11__semaphore_BoundedSemaphore {
+  struct __pyx_vtabstruct_6gevent_11__semaphore_Semaphore __pyx_base;
+};
+static struct __pyx_vtabstruct_6gevent_11__semaphore_BoundedSemaphore *__pyx_vtabptr_6gevent_11__semaphore_BoundedSemaphore;
+
 149:     """
+
 150:     BoundedSemaphore(value=1) -> BoundedSemaphore
+
 151: 
+
 152:     A bounded semaphore checks to make sure its current value doesn't
+
 153:     exceed its initial value. If it does, :class:`ValueError` is
+
 154:     raised. In most situations semaphores are used to guard resources
+
 155:     with limited capacity. If the semaphore is released too many times
+
 156:     it's a sign of a bug.
+
 157: 
+
 158:     If not given, *value* defaults to 1.
+
 159:     """
+
 160: 
+
 161:     #: For monkey-patching, allow changing the class of error we raise
+
+162:     _OVER_RELEASE_ERROR = ValueError
+
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_11__semaphore_BoundedSemaphore->tp_dict, __pyx_n_s_OVER_RELEASE_ERROR, __pyx_builtin_ValueError) < 0) __PYX_ERR(0, 162, __pyx_L1_error)
+  PyType_Modified(__pyx_ptype_6gevent_11__semaphore_BoundedSemaphore);
+
 163: 
+
+164:     def __init__(self, *args, **kwargs):
+
/* Python wrapper */
+static int __pyx_pw_6gevent_11__semaphore_16BoundedSemaphore_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static int __pyx_pw_6gevent_11__semaphore_16BoundedSemaphore_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_args = 0;
+  PyObject *__pyx_v_kwargs = 0;
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
+  if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 1))) return -1;
+  if (unlikely(__pyx_kwds)) {
+    __pyx_v_kwargs = PyDict_Copy(__pyx_kwds); if (unlikely(!__pyx_v_kwargs)) return -1;
+    __Pyx_GOTREF(__pyx_v_kwargs);
+  } else {
+    __pyx_v_kwargs = NULL;
+  }
+  __Pyx_INCREF(__pyx_args);
+  __pyx_v_args = __pyx_args;
+  __pyx_r = __pyx_pf_6gevent_11__semaphore_16BoundedSemaphore___init__(((struct __pyx_obj_6gevent_11__semaphore_BoundedSemaphore *)__pyx_v_self), __pyx_v_args, __pyx_v_kwargs);
+
+  /* function exit code */
+  __Pyx_XDECREF(__pyx_v_args);
+  __Pyx_XDECREF(__pyx_v_kwargs);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_11__semaphore_16BoundedSemaphore___init__(struct __pyx_obj_6gevent_11__semaphore_BoundedSemaphore *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = 0;
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_AddTraceback("gevent.__semaphore.BoundedSemaphore.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = -1;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+165:         Semaphore.__init__(self, *args, **kwargs)
+
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_6gevent_11__semaphore_Semaphore), __pyx_n_s_init); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 165, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 165, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(((PyObject *)__pyx_v_self));
+  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
+  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self));
+  __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_v_args); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 165, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 165, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+166:         self._initial_value = self.counter
+
  __pyx_t_4 = __pyx_v_self->__pyx_base.counter;
+  __pyx_v_self->_initial_value = __pyx_t_4;
+
 167: 
+
+168:     def release(self):
+
static PyObject *__pyx_pw_6gevent_11__semaphore_16BoundedSemaphore_3release(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static int __pyx_f_6gevent_11__semaphore_16BoundedSemaphore_release(struct __pyx_obj_6gevent_11__semaphore_BoundedSemaphore *__pyx_v_self, int __pyx_skip_dispatch) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("release", 0);
+  /* Check if called by wrapper */
+  if (unlikely(__pyx_skip_dispatch)) ;
+  /* Check if overridden in Python */
+  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
+    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
+    if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
+    else {
+      PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      #endif
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_release); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 168, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_11__semaphore_16BoundedSemaphore_3release)) {
+        __Pyx_INCREF(__pyx_t_1);
+        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+          if (likely(__pyx_t_4)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+            __Pyx_INCREF(__pyx_t_4);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_3, function);
+          }
+        }
+        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
+        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 168, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 168, __pyx_L1_error)
+        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+        __pyx_r = __pyx_t_5;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        goto __pyx_L0;
+      }
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+      tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
+      if (unlikely(type_dict_guard != tp_dict_version)) {
+        tp_dict_version = obj_dict_version = 0;
+      }
+      #endif
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    }
+    #endif
+  }
+/* … */
+  /* function exit code */
+  __pyx_r = 0;
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_AddTraceback("gevent.__semaphore.BoundedSemaphore.release", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = -1000;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_11__semaphore_16BoundedSemaphore_3release(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6gevent_11__semaphore_16BoundedSemaphore_2release[] = "BoundedSemaphore.release(self) -> int";
+static PyMethodDef __pyx_mdef_6gevent_11__semaphore_16BoundedSemaphore_3release = {"release", (PyCFunction)__pyx_pw_6gevent_11__semaphore_16BoundedSemaphore_3release, METH_NOARGS, __pyx_doc_6gevent_11__semaphore_16BoundedSemaphore_2release};
+static PyObject *__pyx_pw_6gevent_11__semaphore_16BoundedSemaphore_3release(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("release (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_11__semaphore_16BoundedSemaphore_2release(((struct __pyx_obj_6gevent_11__semaphore_BoundedSemaphore *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_11__semaphore_16BoundedSemaphore_2release(struct __pyx_obj_6gevent_11__semaphore_BoundedSemaphore *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("release", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __pyx_f_6gevent_11__semaphore_16BoundedSemaphore_release(__pyx_v_self, 1); if (unlikely(__pyx_t_1 == ((int)-1000))) __PYX_ERR(0, 168, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 168, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_r = __pyx_t_2;
+  __pyx_t_2 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_AddTraceback("gevent.__semaphore.BoundedSemaphore.release", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__21 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(0, 168, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__21);
+  __Pyx_GIVEREF(__pyx_tuple__21);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_11__semaphore_16BoundedSemaphore_3release, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BoundedSemaphore_release, NULL, __pyx_n_s_gevent___semaphore, __pyx_d, ((PyObject *)__pyx_codeobj__22)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 168, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_11__semaphore_BoundedSemaphore->tp_dict, __pyx_n_s_release, __pyx_t_2) < 0) __PYX_ERR(0, 168, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_11__semaphore_BoundedSemaphore);
+
+169:         if self.counter >= self._initial_value:
+
  __pyx_t_6 = ((__pyx_v_self->__pyx_base.counter >= __pyx_v_self->_initial_value) != 0);
+  if (unlikely(__pyx_t_6)) {
+/* … */
+  }
+
+170:             raise self._OVER_RELEASE_ERROR("Semaphore released too many times")
+
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_OVER_RELEASE_ERROR); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 170, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_3 = NULL;
+    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+      if (likely(__pyx_t_3)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+        __Pyx_INCREF(__pyx_t_3);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_2, function);
+      }
+    }
+    __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_kp_s_Semaphore_released_too_many_time) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_kp_s_Semaphore_released_too_many_time);
+    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 170, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __PYX_ERR(0, 170, __pyx_L1_error)
+
+171:         Semaphore.release(self)
+
  __pyx_t_5 = __pyx_f_6gevent_11__semaphore_9Semaphore_release(((struct __pyx_obj_6gevent_11__semaphore_Semaphore *)__pyx_v_self), 1); if (unlikely(__pyx_t_5 == ((int)-1000))) __PYX_ERR(0, 171, __pyx_L1_error)
+
 172: 
+
 173: 
+
 174: 
+
 175: # By building the semaphore with Cython under PyPy, we get
+
 176: # atomic operations (specifically, exiting/releasing), at the
+
 177: # cost of some speed (one trivial semaphore micro-benchmark put the pure-python version
+
 178: # at around 1s and the compiled version at around 4s). Some clever subclassing
+
 179: # and having only the bare minimum be in cython might help reduce that penalty.
+
 180: # NOTE: You must use version 0.23.4 or later to avoid a memory leak.
+
 181: # https://mail.python.org/pipermail/cython-devel/2015-October/004571.html
+
 182: # However, that's all for naught on up to and including PyPy 4.0.1 which
+
 183: # have some serious crashing bugs with GC interacting with cython.
+
 184: # It hasn't been tested since then, and PURE_PYTHON is assumed to be true
+
 185: # for PyPy in all cases anyway, so this does nothing.
+
 186: 
+
+187: from gevent._util import import_c_accel
+
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 187, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_import_c_accel);
+  __Pyx_GIVEREF(__pyx_n_s_import_c_accel);
+  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_import_c_accel);
+  __pyx_t_1 = __Pyx_Import(__pyx_n_s_gevent__util, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 187, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_import_c_accel); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 187, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_import_c_accel, __pyx_t_2) < 0) __PYX_ERR(0, 187, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+188: import_c_accel(globals(), 'gevent.__semaphore')
+
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_import_c_accel); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 188, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = __Pyx_Globals(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 188, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 188, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_GIVEREF(__pyx_t_2);
+  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_gevent___semaphore);
+  __Pyx_GIVEREF(__pyx_n_s_gevent___semaphore);
+  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_n_s_gevent___semaphore);
+  __pyx_t_2 = 0;
+  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 188, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_semaphore.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_semaphore.py new file mode 100644 index 00000000..d55132e8 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_semaphore.py @@ -0,0 +1,188 @@ +# cython: auto_pickle=False,embedsignature=True,always_allow_keywords=False +from __future__ import print_function, absolute_import, division + +__all__ = [ + 'Semaphore', + 'BoundedSemaphore', +] + +def _get_linkable(): + x = __import__('gevent._abstract_linkable') + return x._abstract_linkable.AbstractLinkable +locals()['AbstractLinkable'] = _get_linkable() +del _get_linkable + + +class Semaphore(AbstractLinkable): # pylint:disable=undefined-variable + """ + Semaphore(value=1) -> Semaphore + + A semaphore manages a counter representing the number of release() + calls minus the number of acquire() calls, plus an initial value. + The acquire() method blocks if necessary until it can return + without making the counter negative. + + If not given, ``value`` defaults to 1. + + The semaphore is a context manager and can be used in ``with`` statements. + + This Semaphore's ``__exit__`` method does not call the trace function + on CPython, but does under PyPy. + + .. seealso:: :class:`BoundedSemaphore` for a safer version that prevents + some classes of bugs. + + .. versionchanged:: 1.4.0 + + The order in which waiters are awakened is not specified. It was not + specified previously, but usually went in FIFO order. + """ + + def __init__(self, value=1): + if value < 0: + raise ValueError("semaphore initial value must be >= 0") + super(Semaphore, self).__init__() + self.counter = value + self._notify_all = False + + def __str__(self): + params = (self.__class__.__name__, self.counter, self.linkcount()) + return '<%s counter=%s _links[%s]>' % params + + def locked(self): + """Return a boolean indicating whether the semaphore can be acquired. + Most useful with binary semaphores.""" + return self.counter <= 0 + + def release(self): + """ + Release the semaphore, notifying any waiters if needed. + """ + self.counter += 1 + self._check_and_notify() + return self.counter + + def ready(self): + return self.counter > 0 + + def _start_notify(self): + self._check_and_notify() + + def _wait_return_value(self, waited, wait_success): + if waited: + return wait_success + # We didn't even wait, we must be good to go. + # XXX: This is probably dead code, we're careful not to go into the wait + # state if we don't expect to need to + return True + + def wait(self, timeout=None): + """ + wait(timeout=None) -> int + + Wait until it is possible to acquire this semaphore, or until the optional + *timeout* elapses. + + .. caution:: If this semaphore was initialized with a size of 0, + this method will block forever if no timeout is given. + + :keyword float timeout: If given, specifies the maximum amount of seconds + this method will block. + :return: A number indicating how many times the semaphore can be acquired + before blocking. + """ + if self.counter > 0: + return self.counter + + self._wait(timeout) # return value irrelevant, whether we got it or got a timeout + return self.counter + + def acquire(self, blocking=True, timeout=None): + """ + acquire(blocking=True, timeout=None) -> bool + + Acquire the semaphore. + + .. caution:: If this semaphore was initialized with a size of 0, + this method will block forever (unless a timeout is given or blocking is + set to false). + + :keyword bool blocking: If True (the default), this function will block + until the semaphore is acquired. + :keyword float timeout: If given, specifies the maximum amount of seconds + this method will block. + :return: A boolean indicating whether the semaphore was acquired. + If ``blocking`` is True and ``timeout`` is None (the default), then + (so long as this semaphore was initialized with a size greater than 0) + this will always return True. If a timeout was given, and it expired before + the semaphore was acquired, False will be returned. (Note that this can still + raise a ``Timeout`` exception, if some other caller had already started a timer.) + """ + if self.counter > 0: + self.counter -= 1 + return True + + if not blocking: + return False + + success = self._wait(timeout) + if not success: + # Our timer expired. + return False + + # Neither our timer no another one expired, so we blocked until + # awoke. Therefore, the counter is ours + self.counter -= 1 + assert self.counter >= 0 + return True + + _py3k_acquire = acquire # PyPy needs this; it must be static for Cython + + def __enter__(self): + self.acquire() + + def __exit__(self, t, v, tb): + self.release() + + +class BoundedSemaphore(Semaphore): + """ + BoundedSemaphore(value=1) -> BoundedSemaphore + + A bounded semaphore checks to make sure its current value doesn't + exceed its initial value. If it does, :class:`ValueError` is + raised. In most situations semaphores are used to guard resources + with limited capacity. If the semaphore is released too many times + it's a sign of a bug. + + If not given, *value* defaults to 1. + """ + + #: For monkey-patching, allow changing the class of error we raise + _OVER_RELEASE_ERROR = ValueError + + def __init__(self, *args, **kwargs): + Semaphore.__init__(self, *args, **kwargs) + self._initial_value = self.counter + + def release(self): + if self.counter >= self._initial_value: + raise self._OVER_RELEASE_ERROR("Semaphore released too many times") + Semaphore.release(self) + + + +# By building the semaphore with Cython under PyPy, we get +# atomic operations (specifically, exiting/releasing), at the +# cost of some speed (one trivial semaphore micro-benchmark put the pure-python version +# at around 1s and the compiled version at around 4s). Some clever subclassing +# and having only the bare minimum be in cython might help reduce that penalty. +# NOTE: You must use version 0.23.4 or later to avoid a memory leak. +# https://mail.python.org/pipermail/cython-devel/2015-October/004571.html +# However, that's all for naught on up to and including PyPy 4.0.1 which +# have some serious crashing bugs with GC interacting with cython. +# It hasn't been tested since then, and PURE_PYTHON is assumed to be true +# for PyPy in all cases anyway, so this does nothing. + +from gevent._util import import_c_accel +import_c_accel(globals(), 'gevent.__semaphore') diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_socket2.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_socket2.py new file mode 100644 index 00000000..5acca41e --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_socket2.py @@ -0,0 +1,473 @@ +# Copyright (c) 2009-2014 Denis Bilenko and gevent contributors. See LICENSE for details. +""" +Python 2 socket module. +""" +from __future__ import absolute_import + +# Our import magic sadly makes this warning useless +# pylint: disable=undefined-variable + +from gevent import _socketcommon +from gevent._util import copy_globals +from gevent._compat import PYPY +from gevent.timeout import Timeout + +copy_globals(_socketcommon, globals(), + names_to_ignore=_socketcommon.__py3_imports__ + _socketcommon.__extensions__, + dunder_names_to_keep=()) + +__socket__ = _socketcommon.__socket__ +__implements__ = _socketcommon._implements +__extensions__ = _socketcommon.__extensions__ +__imports__ = [i for i in _socketcommon.__imports__ if i not in _socketcommon.__py3_imports__] +__dns__ = _socketcommon.__dns__ +try: + _fileobject = __socket__._fileobject + _socketmethods = __socket__._socketmethods +except AttributeError: + # Allow this module to be imported under Python 3 + # for building the docs + _fileobject = object + _socketmethods = ('bind', 'connect', 'connect_ex', + 'fileno', 'listen', 'getpeername', + 'getsockname', 'getsockopt', + 'setsockopt', 'sendall', + 'setblocking', 'settimeout', + 'gettimeout', 'shutdown') +else: + # Python 2 doesn't natively support with statements on _fileobject; + # but it eases our test cases if we can do the same with on both Py3 + # and Py2. Implementation copied from Python 3 + assert not hasattr(_fileobject, '__enter__') + # we could either patch in place: + #_fileobject.__enter__ = lambda self: self + #_fileobject.__exit__ = lambda self, *args: self.close() if not self.closed else None + # or we could subclass. subclassing has the benefit of not + # changing the behaviour of the stdlib if we're just imported; OTOH, + # under Python 2.6/2.7, test_urllib2net.py asserts that the class IS + # socket._fileobject (sigh), so we have to work around that. + + # We also make it call our custom socket closing method that disposes + # if IO watchers but not the actual socket itself. + + # Python 2 relies on reference counting to close sockets, so this is all + # very ugly and fragile. + + class _fileobject(_fileobject): # pylint:disable=function-redefined + + def __enter__(self): + return self + + def __exit__(self, *args): + if not self.closed: + self.close() + + def close(self): + if self._sock is not None: + self._sock._drop_events() + super(_fileobject, self).close() + + +def _get_memory(data): + try: + mv = memoryview(data) + if mv.shape: + return mv + # No shape, probably working with a ctypes object, + # or something else exotic that supports the buffer interface + return mv.tobytes() + except TypeError: + # fixes "python2.7 array.array doesn't support memoryview used in + # gevent.socket.send" issue + # (http://code.google.com/p/gevent/issues/detail?id=94) + return buffer(data) + + +class _closedsocket(object): + __slots__ = [] + + def _dummy(*args, **kwargs): # pylint:disable=no-method-argument,unused-argument + raise error(EBADF, 'Bad file descriptor') + # All _delegate_methods must also be initialized here. + send = recv = recv_into = sendto = recvfrom = recvfrom_into = _dummy + + if PYPY: + + def _drop(self): + pass + + def _reuse(self): + pass + + __getattr__ = _dummy + + +timeout_default = object() + +from gevent._hub_primitives import wait_on_socket as _wait_on_socket + +class socket(object): + """ + gevent `socket.socket `_ + for Python 2. + + This object should have the same API as the standard library socket linked to above. Not all + methods are specifically documented here; when they are they may point out a difference + to be aware of or may document a method the standard library does not. + """ + + # pylint:disable=too-many-public-methods + + def __init__(self, family=AF_INET, type=SOCK_STREAM, proto=0, _sock=None): + if _sock is None: + self._sock = _realsocket(family, type, proto) + self.timeout = _socket.getdefaulttimeout() + else: + if hasattr(_sock, '_sock'): + # passed a gevent socket + self._sock = _sock._sock + self.timeout = getattr(_sock, 'timeout', False) + if self.timeout is False: + self.timeout = _socket.getdefaulttimeout() + else: + # passed a native socket + self._sock = _sock + self.timeout = _socket.getdefaulttimeout() + if PYPY: + self._sock._reuse() + self._sock.setblocking(0) + fileno = self._sock.fileno() + self.hub = get_hub() + io = self.hub.loop.io + self._read_event = io(fileno, 1) + self._write_event = io(fileno, 2) + + def __repr__(self): + return '<%s at %s %s>' % (type(self).__name__, hex(id(self)), self._formatinfo()) + + def __str__(self): + return '<%s %s>' % (type(self).__name__, self._formatinfo()) + + def _formatinfo(self): + # pylint:disable=broad-except + try: + fileno = self.fileno() + except Exception as ex: + fileno = str(ex) + try: + sockname = self.getsockname() + sockname = '%s:%s' % sockname + except Exception: + sockname = None + try: + peername = self.getpeername() + peername = '%s:%s' % peername + except Exception: + peername = None + result = 'fileno=%s' % fileno + if sockname is not None: + result += ' sock=' + str(sockname) + if peername is not None: + result += ' peer=' + str(peername) + if getattr(self, 'timeout', None) is not None: + result += ' timeout=' + str(self.timeout) + return result + + def _get_ref(self): + return self._read_event.ref or self._write_event.ref + + def _set_ref(self, value): + self._read_event.ref = value + self._write_event.ref = value + + ref = property(_get_ref, _set_ref) + + _wait = _wait_on_socket + + def accept(self): + while 1: + try: + client_socket, address = self._sock.accept() + break + except error as ex: + if ex.args[0] != EWOULDBLOCK or self.timeout == 0.0: + raise + sys.exc_clear() + self._wait(self._read_event) + sockobj = socket(_sock=client_socket) + if PYPY: + client_socket._drop() + return sockobj, address + + def _drop_events(self, cancel_wait_ex=cancel_wait_ex): + if self._read_event is not None: + self.hub.cancel_wait(self._read_event, cancel_wait_ex, True) + self._read_event = None + if self._write_event is not None: + self.hub.cancel_wait(self._write_event, cancel_wait_ex, True) + self._write_event = None + + + def close(self, _closedsocket=_closedsocket): + # This function should not reference any globals. See Python issue #808164. + + # Also break any reference to the loop.io objects. Our fileno, + # which they were tied to, is now free to be reused, so these + # objects are no longer functional. + self._drop_events() + s = self._sock + + # Note that we change self._sock at this point. Methods *must not* + # cache `self._sock` separately from self._write_event/self._read_event, + # or they will be out of sync and we may get inappropriate errors. + # (See test__hub:TestCloseSocketWhilePolling for an example). + + self._sock = _closedsocket() + if PYPY: + s._drop() + + @property + def closed(self): + return isinstance(self._sock, _closedsocket) + + def connect(self, address): + if self.timeout == 0.0: + return self._sock.connect(address) + + address = _socketcommon._resolve_addr(self._sock, address) + + timer = Timeout._start_new_or_dummy(self.timeout, timeout('timed out')) + try: + while 1: + err = self._sock.getsockopt(SOL_SOCKET, SO_ERROR) + if err: + raise error(err, strerror(err)) + result = self._sock.connect_ex(address) + if not result or result == EISCONN: + break + elif (result in (EWOULDBLOCK, EINPROGRESS, EALREADY)) or (result == EINVAL and is_windows): + self._wait(self._write_event) + else: + raise error(result, strerror(result)) + finally: + timer.close() + + def connect_ex(self, address): + try: + return self.connect(address) or 0 + except timeout: + return EAGAIN + except error as ex: + if type(ex) is error: # pylint:disable=unidiomatic-typecheck + return ex.args[0] + raise # gaierror is not silenced by connect_ex + + def dup(self): + """dup() -> socket object + + Return a new socket object connected to the same system resource. + Note, that the new socket does not inherit the timeout.""" + return socket(_sock=self._sock) + + def makefile(self, mode='r', bufsize=-1): + # Two things to look out for: + # 1) Closing the original socket object should not close the + # fileobject (hence creating a new socket instance); + # An alternate approach is what _socket3.py does, which is to + # keep count of the times makefile objects have been opened (Py3's + # SocketIO helps with that). But the newly created socket, which + # has its own read/write watchers, does need those to be closed + # when the fileobject is; our custom subclass does that. Note that + # we can't pass the 'close=True' argument, as that causes reference counts + # to get screwed up, and Python2 sockets rely on those. + # 2) The resulting fileobject must keep the timeout in order + # to be compatible with the stdlib's socket.makefile. + # Pass self as _sock to preserve timeout. + fobj = _fileobject(type(self)(_sock=self), mode, bufsize) + if PYPY: + self._sock._drop() + return fobj + + def recv(self, *args): + while 1: + try: + return self._sock.recv(*args) + except error as ex: + if ex.args[0] != EWOULDBLOCK or self.timeout == 0.0: + raise + # QQQ without clearing exc_info test__refcount.test_clean_exit fails + sys.exc_clear() + self._wait(self._read_event) + + def recvfrom(self, *args): + while 1: + try: + return self._sock.recvfrom(*args) + except error as ex: + if ex.args[0] != EWOULDBLOCK or self.timeout == 0.0: + raise + sys.exc_clear() + self._wait(self._read_event) + + def recvfrom_into(self, *args): + while 1: + try: + return self._sock.recvfrom_into(*args) + except error as ex: + if ex.args[0] != EWOULDBLOCK or self.timeout == 0.0: + raise + sys.exc_clear() + self._wait(self._read_event) + + def recv_into(self, *args): + while 1: + try: + return self._sock.recv_into(*args) + except error as ex: + if ex.args[0] != EWOULDBLOCK or self.timeout == 0.0: + raise + sys.exc_clear() + self._wait(self._read_event) + + def send(self, data, flags=0, timeout=timeout_default): + if timeout is timeout_default: + timeout = self.timeout + try: + return self._sock.send(data, flags) + except error as ex: + if ex.args[0] not in _socketcommon.GSENDAGAIN or timeout == 0.0: + raise + sys.exc_clear() + self._wait(self._write_event) + try: + return self._sock.send(data, flags) + except error as ex2: + if ex2.args[0] == EWOULDBLOCK: + return 0 + raise + + def sendall(self, data, flags=0): + if isinstance(data, unicode): + data = data.encode() + # this sendall is also reused by gevent.ssl.SSLSocket subclass, + # so it should not call self._sock methods directly + data_memory = _get_memory(data) + return _socketcommon._sendall(self, data_memory, flags) + + def sendto(self, *args): + try: + return self._sock.sendto(*args) + except error as ex: + if ex.args[0] != EWOULDBLOCK or self.timeout == 0.0: + raise + sys.exc_clear() + self._wait(self._write_event) + try: + return self._sock.sendto(*args) + except error as ex2: + if ex2.args[0] == EWOULDBLOCK: + return 0 + raise + + def setblocking(self, flag): + if flag: + self.timeout = None + else: + self.timeout = 0.0 + + def settimeout(self, howlong): + if howlong is not None: + try: + f = howlong.__float__ + except AttributeError: + raise TypeError('a float is required') + howlong = f() + if howlong < 0.0: + raise ValueError('Timeout value out of range') + self.__dict__['timeout'] = howlong # avoid recursion with any property on self.timeout + + def gettimeout(self): + return self.__dict__['timeout'] # avoid recursion with any property on self.timeout + + def shutdown(self, how): + if how == 0: # SHUT_RD + self.hub.cancel_wait(self._read_event, cancel_wait_ex) + elif how == 1: # SHUT_WR + self.hub.cancel_wait(self._write_event, cancel_wait_ex) + else: + self.hub.cancel_wait(self._read_event, cancel_wait_ex) + self.hub.cancel_wait(self._write_event, cancel_wait_ex) + self._sock.shutdown(how) + + family = property(lambda self: self._sock.family) + type = property(lambda self: self._sock.type) + proto = property(lambda self: self._sock.proto) + + def fileno(self): + return self._sock.fileno() + + def getsockname(self): + return self._sock.getsockname() + + def getpeername(self): + return self._sock.getpeername() + + # delegate the functions that we haven't implemented to the real socket object + + _s = "def %s(self, *args): return self._sock.%s(*args)\n\n" + _m = None + for _m in set(_socketmethods) - set(locals()): + exec(_s % (_m, _m,)) + del _m, _s + + if PYPY: + + def _reuse(self): + self._sock._reuse() + + def _drop(self): + self._sock._drop() + + +SocketType = socket + +if hasattr(_socket, 'socketpair'): + + def socketpair(family=getattr(_socket, 'AF_UNIX', _socket.AF_INET), + type=_socket.SOCK_STREAM, proto=0): + one, two = _socket.socketpair(family, type, proto) + result = socket(_sock=one), socket(_sock=two) + if PYPY: + one._drop() + two._drop() + return result +elif 'socketpair' in __implements__: + __implements__.remove('socketpair') + +if hasattr(_socket, 'fromfd'): + + def fromfd(fd, family, type, proto=0): + s = _socket.fromfd(fd, family, type, proto) + result = socket(_sock=s) + if PYPY: + s._drop() + return result + +elif 'fromfd' in __implements__: + __implements__.remove('fromfd') + +if hasattr(__socket__, 'ssl'): + + def ssl(sock, keyfile=None, certfile=None): + # deprecated in 2.7.9 but still present; + # sometimes backported by distros. See ssl.py + # Note that we import gevent.ssl, not _ssl2, to get the correct + # version. + from gevent import ssl as _sslmod + # wrap_socket is 2.7.9/backport, sslwrap_simple is older. They take + # the same arguments. + wrap = getattr(_sslmod, 'wrap_socket', None) or getattr(_sslmod, 'sslwrap_simple') + return wrap(sock, keyfile, certfile) + __implements__.append('ssl') + +__all__ = __implements__ + __extensions__ + __imports__ diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_socket3.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_socket3.py new file mode 100644 index 00000000..973b5a96 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_socket3.py @@ -0,0 +1,756 @@ +# Port of Python 3.3's socket module to gevent +""" +Python 3 socket module. +""" +# Our import magic sadly makes this warning useless +# pylint: disable=undefined-variable +# pylint: disable=too-many-statements,too-many-branches +# pylint: disable=too-many-public-methods,unused-argument +from __future__ import absolute_import +import io +import os +import sys + +from gevent import _socketcommon +from gevent._util import copy_globals +from gevent._compat import PYPY +from gevent.timeout import Timeout +import _socket +from os import dup + + +copy_globals(_socketcommon, globals(), + names_to_ignore=_socketcommon.__extensions__, + dunder_names_to_keep=()) + +try: + from errno import EHOSTUNREACH + from errno import ECONNREFUSED +except ImportError: + EHOSTUNREACH = -1 + ECONNREFUSED = -1 + + +__socket__ = _socketcommon.__socket__ +__implements__ = _socketcommon._implements +__extensions__ = _socketcommon.__extensions__ +__imports__ = _socketcommon.__imports__ +__dns__ = _socketcommon.__dns__ + + +SocketIO = __socket__.SocketIO # pylint:disable=no-member + + +def _get_memory(data): + mv = memoryview(data) + if mv.shape: + return mv + # No shape, probably working with a ctypes object, + # or something else exotic that supports the buffer interface + return mv.tobytes() + +timeout_default = object() + + +class _wrefsocket(_socket.socket): + # Plain stdlib socket.socket objects subclass _socket.socket + # and add weakref ability. The ssl module, for one, counts on this. + # We don't create socket.socket objects (because they may have been + # monkey patched to be the object from this module), but we still + # need to make sure what we do create can be weakrefd. + + __slots__ = ("__weakref__", ) + + if PYPY: + # server.py unwraps the socket object to get the raw _sock; + # it depends on having a timeout property alias, which PyPy does not + # provide. + timeout = property(lambda s: s.gettimeout(), + lambda s, nv: s.settimeout(nv)) + +from gevent._hub_primitives import wait_on_socket as _wait_on_socket + +class socket(object): + """ + gevent `socket.socket `_ + for Python 3. + + This object should have the same API as the standard library socket linked to above. Not all + methods are specifically documented here; when they are they may point out a difference + to be aware of or may document a method the standard library does not. + """ + + # Subclasses can set this to customize the type of the + # native _socket.socket we create. It MUST be a subclass + # of _wrefsocket. (gevent internal usage only) + _gevent_sock_class = _wrefsocket + + _io_refs = 0 + _closed = False + _read_event = None + _write_event = None + + + # Take the same approach as socket2: wrap a real socket object, + # don't subclass it. This lets code that needs the raw _sock (not tied to the hub) + # get it. This shows up in tests like test__example_udp_server. + + if sys.version_info[:2] < (3, 7): + def __init__(self, family=AF_INET, type=SOCK_STREAM, proto=0, fileno=None): + self._sock = self._gevent_sock_class(family, type, proto, fileno) + self.timeout = None + self.__init_common() + else: + # In 3.7, socket changed to auto-detecting family, type, and proto + # when given a fileno. + def __init__(self, family=-1, type=-1, proto=-1, fileno=None): + if fileno is None: + if family == -1: + family = AF_INET + if type == -1: + type = SOCK_STREAM + if proto == -1: + proto = 0 + self._sock = self._gevent_sock_class(family, type, proto, fileno) + self.timeout = None + self.__init_common() + + def __init_common(self): + _socket.socket.setblocking(self._sock, False) + fileno = _socket.socket.fileno(self._sock) + self.hub = get_hub() + io_class = self.hub.loop.io + self._read_event = io_class(fileno, 1) + self._write_event = io_class(fileno, 2) + self.timeout = _socket.getdefaulttimeout() + + def __getattr__(self, name): + return getattr(self._sock, name) + + if hasattr(_socket, 'SOCK_NONBLOCK'): + # Only defined under Linux + @property + def type(self): + # See https://github.com/gevent/gevent/pull/399 + if self.timeout != 0.0: + return self._sock.type & ~_socket.SOCK_NONBLOCK # pylint:disable=no-member + return self._sock.type + + def getblocking(self): + """ + Returns whether the socket will approximate blocking + behaviour. + + .. versionadded:: 1.3a2 + Added in Python 3.7. + """ + return self.timeout != 0.0 + + def __enter__(self): + return self + + def __exit__(self, *args): + if not self._closed: + self.close() + + def __repr__(self): + """Wrap __repr__() to reveal the real class name.""" + try: + s = _socket.socket.__repr__(self._sock) + except Exception as ex: # pylint:disable=broad-except + # Observed on Windows Py3.3, printing the repr of a socket + # that just suffered a ConnectionResetError [WinError 10054]: + # "OverflowError: no printf formatter to display the socket descriptor in decimal" + # Not sure what the actual cause is or if there's a better way to handle this + s = '' % ex + + if s.startswith(" socket object + + Return a new socket object connected to the same system resource. + """ + fd = dup(self.fileno()) + sock = self.__class__(self.family, self.type, self.proto, fileno=fd) + sock.settimeout(self.gettimeout()) + return sock + + def accept(self): + """accept() -> (socket object, address info) + + Wait for an incoming connection. Return a new socket + representing the connection, and the address of the client. + For IP sockets, the address info is a pair (hostaddr, port). + """ + while True: + try: + fd, addr = self._accept() + break + except BlockingIOError: + if self.timeout == 0.0: + raise + self._wait(self._read_event) + sock = socket(self.family, self.type, self.proto, fileno=fd) + # Python Issue #7995: if no default timeout is set and the listening + # socket had a (non-zero) timeout, force the new socket in blocking + # mode to override platform-specific socket flags inheritance. + # XXX do we need to do this? + if getdefaulttimeout() is None and self.gettimeout(): + sock.setblocking(True) + return sock, addr + + def makefile(self, mode="r", buffering=None, *, + encoding=None, errors=None, newline=None): + """Return an I/O stream connected to the socket + + The arguments are as for io.open() after the filename, + except the only mode characters supported are 'r', 'w' and 'b'. + The semantics are similar too. + """ + # (XXX refactor to share code?) + for c in mode: + if c not in {"r", "w", "b"}: + raise ValueError("invalid mode %r (only r, w, b allowed)") + writing = "w" in mode + reading = "r" in mode or not writing + assert reading or writing + binary = "b" in mode + rawmode = "" + if reading: + rawmode += "r" + if writing: + rawmode += "w" + raw = SocketIO(self, rawmode) + self._io_refs += 1 + if buffering is None: + buffering = -1 + if buffering < 0: + buffering = io.DEFAULT_BUFFER_SIZE + if buffering == 0: + if not binary: + raise ValueError("unbuffered streams must be binary") + return raw + if reading and writing: + buffer = io.BufferedRWPair(raw, raw, buffering) + elif reading: + buffer = io.BufferedReader(raw, buffering) + else: + assert writing + buffer = io.BufferedWriter(raw, buffering) + if binary: + return buffer + text = io.TextIOWrapper(buffer, encoding, errors, newline) + text.mode = mode + return text + + def _decref_socketios(self): + # Called by SocketIO when it is closed. + if self._io_refs > 0: + self._io_refs -= 1 + if self._closed: + self.close() + + def _drop_events(self): + if self._read_event is not None: + self.hub.cancel_wait(self._read_event, cancel_wait_ex, True) + self._read_event = None + if self._write_event is not None: + self.hub.cancel_wait(self._write_event, cancel_wait_ex, True) + self._write_event = None + + def _real_close(self, _ss=_socket.socket, cancel_wait_ex=cancel_wait_ex): + # This function should not reference any globals. See Python issue #808164. + + # Break any reference to the loop.io objects. Our fileno, + # which they were tied to, is now free to be reused, so these + # objects are no longer functional. + self._drop_events() + + _ss.close(self._sock) + + # Break any references to the underlying socket object. Tested + # by test__refcount. (Why does this matter?). Be sure to + # preserve our same family/type/proto if possible (if we + # don't, we can get TypeError instead of OSError; see + # test_socket.SendmsgUDP6Test.testSendmsgAfterClose)... but + # this isn't always possible (see test_socket.test_unknown_socket_family_repr) + # TODO: Can we use a simpler proxy, like _socket2 does? + try: + self._sock = self._gevent_sock_class(self.family, self.type, self.proto) + except OSError: + pass + else: + _ss.close(self._sock) + + + def close(self): + # This function should not reference any globals. See Python issue #808164. + self._closed = True + if self._io_refs <= 0: + self._real_close() + + @property + def closed(self): + return self._closed + + def detach(self): + """detach() -> file descriptor + + Close the socket object without closing the underlying file descriptor. + The object cannot be used after this call, but the file descriptor + can be reused for other purposes. The file descriptor is returned. + """ + self._closed = True + return self._sock.detach() + + def connect(self, address): + if self.timeout == 0.0: + return _socket.socket.connect(self._sock, address) + address = _socketcommon._resolve_addr(self._sock, address) + + with Timeout._start_new_or_dummy(self.timeout, timeout("timed out")): + while True: + err = self.getsockopt(SOL_SOCKET, SO_ERROR) + if err: + raise error(err, strerror(err)) + result = _socket.socket.connect_ex(self._sock, address) + + if not result or result == EISCONN: + break + elif (result in (EWOULDBLOCK, EINPROGRESS, EALREADY)) or (result == EINVAL and is_windows): + self._wait(self._write_event) + else: + if (isinstance(address, tuple) + and address[0] == 'fe80::1' + and result == EHOSTUNREACH): + # On Python 3.7 on mac, we see EHOSTUNREACH + # returned for this link-local address, but it really is + # supposed to be ECONNREFUSED according to the standard library + # tests (test_socket.NetworkConnectionNoServer.test_create_connection) + # (On previous versions, that code passed the '127.0.0.1' IPv4 address, so + # ipv6 link locals were never a factor; 3.7 passes 'localhost'.) + # It is something of a mystery how the stdlib socket code doesn't + # produce EHOSTUNREACH---I (JAM) can't see how socketmodule.c would avoid + # that. The normal connect just calls connect_ex much like we do. + result = ECONNREFUSED + raise error(result, strerror(result)) + + def connect_ex(self, address): + try: + return self.connect(address) or 0 + except timeout: + return EAGAIN + except gaierror: # pylint:disable=try-except-raise + # gaierror/overflowerror/typerror is not silenced by connect_ex; + # gaierror extends OSError (aka error) so catch it first + raise + except error as ex: + # error is now OSError and it has various subclasses. + # Only those that apply to actually connecting are silenced by + # connect_ex. + if ex.errno: + return ex.errno + raise # pragma: no cover + + def recv(self, *args): + while True: + try: + return _socket.socket.recv(self._sock, *args) + except error as ex: + if ex.args[0] != EWOULDBLOCK or self.timeout == 0.0: + raise + self._wait(self._read_event) + + if hasattr(_socket.socket, 'recvmsg'): + # Only on Unix; PyPy 3.5 5.10.0 provides sendmsg and recvmsg, but not + # recvmsg_into (at least on os x) + + def recvmsg(self, *args): + while True: + try: + return _socket.socket.recvmsg(self._sock, *args) + except error as ex: + if ex.args[0] != EWOULDBLOCK or self.timeout == 0.0: + raise + self._wait(self._read_event) + + if hasattr(_socket.socket, 'recvmsg_into'): + + def recvmsg_into(self, *args): + while True: + try: + return _socket.socket.recvmsg_into(self._sock, *args) + except error as ex: + if ex.args[0] != EWOULDBLOCK or self.timeout == 0.0: + raise + self._wait(self._read_event) + + def recvfrom(self, *args): + while True: + try: + return _socket.socket.recvfrom(self._sock, *args) + except error as ex: + if ex.args[0] != EWOULDBLOCK or self.timeout == 0.0: + raise + self._wait(self._read_event) + + def recvfrom_into(self, *args): + while True: + try: + return _socket.socket.recvfrom_into(self._sock, *args) + except error as ex: + if ex.args[0] != EWOULDBLOCK or self.timeout == 0.0: + raise + self._wait(self._read_event) + + def recv_into(self, *args): + while True: + try: + return _socket.socket.recv_into(self._sock, *args) + except error as ex: + if ex.args[0] != EWOULDBLOCK or self.timeout == 0.0: + raise + self._wait(self._read_event) + + def send(self, data, flags=0, timeout=timeout_default): + if timeout is timeout_default: + timeout = self.timeout + try: + return _socket.socket.send(self._sock, data, flags) + except error as ex: + if ex.args[0] not in _socketcommon.GSENDAGAIN or timeout == 0.0: + raise + self._wait(self._write_event) + try: + return _socket.socket.send(self._sock, data, flags) + except error as ex2: + if ex2.args[0] == EWOULDBLOCK: + return 0 + raise + + def sendall(self, data, flags=0): + # XXX Now that we run on PyPy3, see the notes in _socket2.py's sendall() + # and implement that here if needed. + # PyPy3 is not optimized for performance yet, and is known to be slower than + # PyPy2, so it's possibly premature to do this. However, there is a 3.5 test case that + # possibly exposes this in a severe way. + data_memory = _get_memory(data) + return _socketcommon._sendall(self, data_memory, flags) + + def sendto(self, *args): + try: + return _socket.socket.sendto(self._sock, *args) + except error as ex: + if ex.args[0] != EWOULDBLOCK or self.timeout == 0.0: + raise + self._wait(self._write_event) + try: + return _socket.socket.sendto(self._sock, *args) + except error as ex2: + if ex2.args[0] == EWOULDBLOCK: + return 0 + raise + + if hasattr(_socket.socket, 'sendmsg'): + # Only on Unix + def sendmsg(self, buffers, ancdata=(), flags=0, address=None): + try: + return _socket.socket.sendmsg(self._sock, buffers, ancdata, flags, address) + except error as ex: + if flags & getattr(_socket, 'MSG_DONTWAIT', 0): + # Enable non-blocking behaviour + # XXX: Do all platforms that have sendmsg have MSG_DONTWAIT? + raise + + if ex.args[0] != EWOULDBLOCK or self.timeout == 0.0: + raise + self._wait(self._write_event) + try: + return _socket.socket.sendmsg(self._sock, buffers, ancdata, flags, address) + except error as ex2: + if ex2.args[0] == EWOULDBLOCK: + return 0 + raise + + def setblocking(self, flag): + # Beginning in 3.6.0b3 this is supposed to raise + # if the file descriptor is closed, but the test for it + # involves closing the fileno directly. Since we + # don't touch the fileno here, it doesn't make sense for + # us. + if flag: + self.timeout = None + else: + self.timeout = 0.0 + + def settimeout(self, howlong): + if howlong is not None: + try: + f = howlong.__float__ + except AttributeError: + raise TypeError('a float is required') + howlong = f() + if howlong < 0.0: + raise ValueError('Timeout value out of range') + self.__dict__['timeout'] = howlong + + def gettimeout(self): + return self.__dict__['timeout'] + + def shutdown(self, how): + if how == 0: # SHUT_RD + self.hub.cancel_wait(self._read_event, cancel_wait_ex) + elif how == 1: # SHUT_WR + self.hub.cancel_wait(self._write_event, cancel_wait_ex) + else: + self.hub.cancel_wait(self._read_event, cancel_wait_ex) + self.hub.cancel_wait(self._write_event, cancel_wait_ex) + self._sock.shutdown(how) + + # sendfile: new in 3.5. But there's no real reason to not + # support it everywhere. Note that we can't use os.sendfile() + # because it's not cooperative. + def _sendfile_use_sendfile(self, file, offset=0, count=None): + # This is called directly by tests + raise __socket__._GiveupOnSendfile() # pylint:disable=no-member + + def _sendfile_use_send(self, file, offset=0, count=None): + self._check_sendfile_params(file, offset, count) + if self.gettimeout() == 0: + raise ValueError("non-blocking sockets are not supported") + if offset: + file.seek(offset) + blocksize = min(count, 8192) if count else 8192 + total_sent = 0 + # localize variable access to minimize overhead + file_read = file.read + sock_send = self.send + try: + while True: + if count: + blocksize = min(count - total_sent, blocksize) + if blocksize <= 0: + break + data = memoryview(file_read(blocksize)) + if not data: + break # EOF + while True: + try: + sent = sock_send(data) + except BlockingIOError: + continue + else: + total_sent += sent + if sent < len(data): + data = data[sent:] + else: + break + return total_sent + finally: + if total_sent > 0 and hasattr(file, 'seek'): + file.seek(offset + total_sent) + + def _check_sendfile_params(self, file, offset, count): + if 'b' not in getattr(file, 'mode', 'b'): + raise ValueError("file should be opened in binary mode") + if not self.type & SOCK_STREAM: + raise ValueError("only SOCK_STREAM type sockets are supported") + if count is not None: + if not isinstance(count, int): + raise TypeError( + "count must be a positive integer (got {!r})".format(count)) + if count <= 0: + raise ValueError( + "count must be a positive integer (got {!r})".format(count)) + + def sendfile(self, file, offset=0, count=None): + """sendfile(file[, offset[, count]]) -> sent + + Send a file until EOF is reached by using high-performance + os.sendfile() and return the total number of bytes which + were sent. + *file* must be a regular file object opened in binary mode. + If os.sendfile() is not available (e.g. Windows) or file is + not a regular file socket.send() will be used instead. + *offset* tells from where to start reading the file. + If specified, *count* is the total number of bytes to transmit + as opposed to sending the file until EOF is reached. + File position is updated on return or also in case of error in + which case file.tell() can be used to figure out the number of + bytes which were sent. + The socket must be of SOCK_STREAM type. + Non-blocking sockets are not supported. + + .. versionadded:: 1.1rc4 + Added in Python 3.5, but available under all Python 3 versions in + gevent. + """ + return self._sendfile_use_send(file, offset, count) + + # get/set_inheritable new in 3.4 + if hasattr(os, 'get_inheritable') or hasattr(os, 'get_handle_inheritable'): + # pylint:disable=no-member + if os.name == 'nt': + def get_inheritable(self): + return os.get_handle_inheritable(self.fileno()) + + def set_inheritable(self, inheritable): + os.set_handle_inheritable(self.fileno(), inheritable) + else: + def get_inheritable(self): + return os.get_inheritable(self.fileno()) + + def set_inheritable(self, inheritable): + os.set_inheritable(self.fileno(), inheritable) + _added = "\n\n.. versionadded:: 1.1rc4 Added in Python 3.4" + get_inheritable.__doc__ = "Get the inheritable flag of the socket" + _added + set_inheritable.__doc__ = "Set the inheritable flag of the socket" + _added + del _added + + +if sys.version_info[:2] == (3, 4) and sys.version_info[:3] <= (3, 4, 2): + # Python 3.4, up to and including 3.4.2, had a bug where the + # SocketType enumeration overwrote the SocketType class imported + # from _socket. This was fixed in 3.4.3 (http://bugs.python.org/issue20386 + # and https://github.com/python/cpython/commit/0d2f85f38a9691efdfd1e7285c4262cab7f17db7). + # Prior to that, if we replace SocketType with our own class, the implementation + # of socket.type breaks with "OSError: [Errno 97] Address family not supported by protocol". + # Therefore, on these old versions, we must preserve it as an enum; while this + # seems like it could lead to non-green behaviour, code on those versions + # cannot possibly be using SocketType as a class anyway. + SocketType = __socket__.SocketType # pylint:disable=no-member + # Fixup __all__; note that we get exec'd multiple times during unit tests + if 'SocketType' in __implements__: + __implements__.remove('SocketType') + if 'SocketType' not in __imports__: + __imports__.append('SocketType') +else: + SocketType = socket + + +def fromfd(fd, family, type, proto=0): + """ fromfd(fd, family, type[, proto]) -> socket object + + Create a socket object from a duplicate of the given file + descriptor. The remaining arguments are the same as for socket(). + """ + nfd = dup(fd) + return socket(family, type, proto, nfd) + + +if hasattr(_socket.socket, "share"): + def fromshare(info): + """ fromshare(info) -> socket object + + Create a socket object from a the bytes object returned by + socket.share(pid). + """ + return socket(0, 0, 0, info) + + __implements__.append('fromshare') + +if hasattr(_socket, "socketpair"): + + def socketpair(family=None, type=SOCK_STREAM, proto=0): + """socketpair([family[, type[, proto]]]) -> (socket object, socket object) + + Create a pair of socket objects from the sockets returned by the platform + socketpair() function. + The arguments are the same as for socket() except the default family is + AF_UNIX if defined on the platform; otherwise, the default is AF_INET. + + .. versionchanged:: 1.2 + All Python 3 versions on Windows supply this function (natively + supplied by Python 3.5 and above). + """ + if family is None: + try: + family = AF_UNIX + except NameError: + family = AF_INET + a, b = _socket.socketpair(family, type, proto) + a = socket(family, type, proto, a.detach()) + b = socket(family, type, proto, b.detach()) + return a, b + +else: # pragma: no cover + # Origin: https://gist.github.com/4325783, by Geert Jansen. Public domain. + + # gevent: taken from 3.6 release. Expected to be used only on Win. Added to Win/3.5 + # gevent: for < 3.5, pass the default value of 128 to lsock.listen() + # (3.5+ uses this as a default and the original code passed no value) + + _LOCALHOST = '127.0.0.1' + _LOCALHOST_V6 = '::1' + + def socketpair(family=AF_INET, type=SOCK_STREAM, proto=0): + if family == AF_INET: + host = _LOCALHOST + elif family == AF_INET6: + host = _LOCALHOST_V6 + else: + raise ValueError("Only AF_INET and AF_INET6 socket address families " + "are supported") + if type != SOCK_STREAM: + raise ValueError("Only SOCK_STREAM socket type is supported") + if proto != 0: + raise ValueError("Only protocol zero is supported") + + # We create a connected TCP socket. Note the trick with + # setblocking(False) that prevents us from having to create a thread. + lsock = socket(family, type, proto) + try: + lsock.bind((host, 0)) + lsock.listen(128) + # On IPv6, ignore flow_info and scope_id + addr, port = lsock.getsockname()[:2] + csock = socket(family, type, proto) + try: + csock.setblocking(False) + try: + csock.connect((addr, port)) + except (BlockingIOError, InterruptedError): + pass + csock.setblocking(True) + ssock, _ = lsock.accept() + except: + csock.close() + raise + finally: + lsock.close() + return (ssock, csock) + + if sys.version_info[:2] < (3, 5): + # Not provided natively + if 'socketpair' in __implements__: + # Multiple imports can cause this to be missing if _socketcommon + # was successfully imported, leading to subsequent imports to cause + # ValueError + __implements__.remove('socketpair') + + +if hasattr(__socket__, 'close'): # Python 3.7b1+ + close = __socket__.close # pylint:disable=no-member + __imports__ += ['close'] + +__all__ = __implements__ + __extensions__ + __imports__ diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_socketcommon.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_socketcommon.py new file mode 100644 index 00000000..cd12ac1a --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_socketcommon.py @@ -0,0 +1,401 @@ +# Copyright (c) 2009-2014 Denis Bilenko and gevent contributors. See LICENSE for details. +from __future__ import absolute_import + +# standard functions and classes that this module re-implements in a gevent-aware way: +_implements = [ + 'create_connection', + 'socket', + 'SocketType', + 'fromfd', + 'socketpair', +] + +__dns__ = [ + 'getaddrinfo', + 'gethostbyname', + 'gethostbyname_ex', + 'gethostbyaddr', + 'getnameinfo', + 'getfqdn', +] + +_implements += __dns__ + +# non-standard functions that this module provides: +__extensions__ = [ + 'cancel_wait', + 'wait_read', + 'wait_write', + 'wait_readwrite', +] + +# standard functions and classes that this module re-imports +__imports__ = [ + 'error', + 'gaierror', + 'herror', + 'htonl', + 'htons', + 'ntohl', + 'ntohs', + 'inet_aton', + 'inet_ntoa', + 'inet_pton', + 'inet_ntop', + 'timeout', + 'gethostname', + 'getprotobyname', + 'getservbyname', + 'getservbyport', + 'getdefaulttimeout', + 'setdefaulttimeout', + # Windows: + 'errorTab', +] + +__py3_imports__ = [ + # Python 3 + 'AddressFamily', + 'SocketKind', + 'CMSG_LEN', + 'CMSG_SPACE', + 'dup', + 'if_indextoname', + 'if_nameindex', + 'if_nametoindex', + 'sethostname', +] + +__imports__.extend(__py3_imports__) + +import time +import sys +from gevent._hub_local import get_hub_noargs as get_hub +from gevent._compat import string_types, integer_types, PY3 +from gevent._util import copy_globals + +is_windows = sys.platform == 'win32' +is_macos = sys.platform == 'darwin' + +# pylint:disable=no-name-in-module,unused-import +if is_windows: + # no such thing as WSAEPERM or error code 10001 according to winsock.h or MSDN + from errno import WSAEINVAL as EINVAL + from errno import WSAEWOULDBLOCK as EWOULDBLOCK + from errno import WSAEINPROGRESS as EINPROGRESS + from errno import WSAEALREADY as EALREADY + from errno import WSAEISCONN as EISCONN + from gevent.win32util import formatError as strerror + EAGAIN = EWOULDBLOCK +else: + from errno import EINVAL + from errno import EWOULDBLOCK + from errno import EINPROGRESS + from errno import EALREADY + from errno import EAGAIN + from errno import EISCONN + from os import strerror + +try: + from errno import EBADF +except ImportError: + EBADF = 9 + +# macOS can return EPROTOTYPE when writing to a socket that is shutting +# Down. Retrying the write should return the expected EPIPE error. +# Downstream classes (like pywsgi) know how to handle/ignore EPIPE. +# This set is used by socket.send() to decide whether the write should +# be retried. The default is to retry only on EWOULDBLOCK. Here we add +# EPROTOTYPE on macOS to handle this platform-specific race condition. +GSENDAGAIN = (EWOULDBLOCK,) +if is_macos: + from errno import EPROTOTYPE + GSENDAGAIN += (EPROTOTYPE,) + +import _socket +_realsocket = _socket.socket +import socket as __socket__ + +_name = _value = None +__imports__ = copy_globals(__socket__, globals(), + only_names=__imports__, + ignore_missing_names=True) + +for _name in __socket__.__all__: + _value = getattr(__socket__, _name) + if isinstance(_value, (integer_types, string_types)): + globals()[_name] = _value + __imports__.append(_name) + +del _name, _value + +_timeout_error = timeout # pylint: disable=undefined-variable + +from gevent import _hub_primitives +_hub_primitives.set_default_timeout_error(_timeout_error) + +wait = _hub_primitives.wait_on_watcher +wait_read = _hub_primitives.wait_read +wait_write = _hub_primitives.wait_write +wait_readwrite = _hub_primitives.wait_readwrite + +#: The exception raised by default on a call to :func:`cancel_wait` +class cancel_wait_ex(error): # pylint: disable=undefined-variable + def __init__(self): + super(cancel_wait_ex, self).__init__( + EBADF, + 'File descriptor was closed in another greenlet') + + +def cancel_wait(watcher, error=cancel_wait_ex): + """See :meth:`gevent.hub.Hub.cancel_wait`""" + get_hub().cancel_wait(watcher, error) + + +def gethostbyname(hostname): + """ + gethostbyname(host) -> address + + Return the IP address (a string of the form '255.255.255.255') for a host. + + .. seealso:: :doc:`/dns` + """ + return get_hub().resolver.gethostbyname(hostname) + + +def gethostbyname_ex(hostname): + """ + gethostbyname_ex(host) -> (name, aliaslist, addresslist) + + Return the true host name, a list of aliases, and a list of IP addresses, + for a host. The host argument is a string giving a host name or IP number. + Resolve host and port into list of address info entries. + + .. seealso:: :doc:`/dns` + """ + return get_hub().resolver.gethostbyname_ex(hostname) + + +def getaddrinfo(host, port, family=0, socktype=0, proto=0, flags=0): + """ + Resolve host and port into list of address info entries. + + Translate the host/port argument into a sequence of 5-tuples that contain + all the necessary arguments for creating a socket connected to that service. + host is a domain name, a string representation of an IPv4/v6 address or + None. port is a string service name such as 'http', a numeric port number or + None. By passing None as the value of host and port, you can pass NULL to + the underlying C API. + + The family, type and proto arguments can be optionally specified in order to + narrow the list of addresses returned. Passing zero as a value for each of + these arguments selects the full range of results. + + .. seealso:: :doc:`/dns` + """ + return get_hub().resolver.getaddrinfo(host, port, family, socktype, proto, flags) + +if PY3: + # The name of the socktype param changed to type in Python 3. + # See https://github.com/gevent/gevent/issues/960 + # Using inspect here to directly detect the condition is painful because we have to + # wrap it with a try/except TypeError because not all Python 2 + # versions can get the args of a builtin; we also have to use a with to suppress + # the deprecation warning. + d = getaddrinfo.__doc__ + + def getaddrinfo(host, port, family=0, type=0, proto=0, flags=0): + # pylint:disable=function-redefined, undefined-variable + # Also, on Python 3, we need to translate into the special enums. + # Our lower-level resolvers, including the thread and blocking, which use _socket, + # function simply with integers. + addrlist = get_hub().resolver.getaddrinfo(host, port, family, type, proto, flags) + result = [ + (_intenum_converter(af, AddressFamily), + _intenum_converter(socktype, SocketKind), + proto, canonname, sa) + for af, socktype, proto, canonname, sa + in addrlist + ] + return result + + getaddrinfo.__doc__ = d + del d + + def _intenum_converter(value, enum_klass): + try: + return enum_klass(value) + except ValueError: # pragma: no cover + return value + + +def gethostbyaddr(ip_address): + """ + gethostbyaddr(ip_address) -> (name, aliaslist, addresslist) + + Return the true host name, a list of aliases, and a list of IP addresses, + for a host. The host argument is a string giving a host name or IP number. + + .. seealso:: :doc:`/dns` + """ + return get_hub().resolver.gethostbyaddr(ip_address) + + +def getnameinfo(sockaddr, flags): + """ + getnameinfo(sockaddr, flags) -> (host, port) + + Get host and port for a sockaddr. + + .. seealso:: :doc:`/dns` + """ + return get_hub().resolver.getnameinfo(sockaddr, flags) + + +def getfqdn(name=''): + """Get fully qualified domain name from name. + + An empty argument is interpreted as meaning the local host. + + First the hostname returned by gethostbyaddr() is checked, then + possibly existing aliases. In case no FQDN is available, hostname + from gethostname() is returned. + """ + # pylint: disable=undefined-variable + name = name.strip() + if not name or name == '0.0.0.0': + name = gethostname() + try: + hostname, aliases, _ = gethostbyaddr(name) + except error: + pass + else: + aliases.insert(0, hostname) + for name in aliases: # EWW! pylint:disable=redefined-argument-from-local + if isinstance(name, bytes): + if b'.' in name: + break + elif '.' in name: + break + else: + name = hostname + return name + +def __send_chunk(socket, data_memory, flags, timeleft, end, timeout=_timeout_error): + """ + Send the complete contents of ``data_memory`` before returning. + This is the core loop around :meth:`send`. + + :param timeleft: Either ``None`` if there is no timeout involved, + or a float indicating the timeout to use. + :param end: Either ``None`` if there is no timeout involved, or + a float giving the absolute end time. + :return: An updated value for ``timeleft`` (or None) + :raises timeout: If ``timeleft`` was given and elapsed while + sending this chunk. + """ + data_sent = 0 + len_data_memory = len(data_memory) + started_timer = 0 + while data_sent < len_data_memory: + chunk = data_memory[data_sent:] + if timeleft is None: + data_sent += socket.send(chunk, flags) + elif started_timer and timeleft <= 0: + # Check before sending to guarantee a check + # happens even if each chunk successfully sends its data + # (especially important for SSL sockets since they have large + # buffers). But only do this if we've actually tried to + # send something once to avoid spurious timeouts on non-blocking + # sockets. + raise timeout('timed out') + else: + started_timer = 1 + data_sent += socket.send(chunk, flags, timeout=timeleft) + timeleft = end - time.time() + + return timeleft + +def _sendall(socket, data_memory, flags, + SOL_SOCKET=__socket__.SOL_SOCKET, # pylint:disable=no-member + SO_SNDBUF=__socket__.SO_SNDBUF): # pylint:disable=no-member + """ + Send the *data_memory* (which should be a memoryview) + using the gevent *socket*, performing well on PyPy. + """ + + # On PyPy up through 5.10.0, both PyPy2 and PyPy3, subviews + # (slices) of a memoryview() object copy the underlying bytes the + # first time the builtin socket.send() method is called. On a + # non-blocking socket (that thus calls socket.send() many times) + # with a large input, this results in many repeated copies of an + # ever smaller string, depending on the networking buffering. For + # example, if each send() can process 1MB of a 50MB input, and we + # naively pass the entire remaining subview each time, we'd copy + # 49MB, 48MB, 47MB, etc, thus completely killing performance. To + # workaround this problem, we work in reasonable, fixed-size + # chunks. This results in a 10x improvement to bench_sendall.py, + # while having no measurable impact on CPython (since it doesn't + # copy at all the only extra overhead is a few python function + # calls, which is negligible for large inputs). + + # On one macOS machine, PyPy3 5.10.1 produced ~ 67.53 MB/s before this change, + # and ~ 616.01 MB/s after. + + # See https://bitbucket.org/pypy/pypy/issues/2091/non-blocking-socketsend-slow-gevent + + # Too small of a chunk (the socket's buf size is usually too + # small) results in reduced perf due to *too many* calls to send and too many + # small copies. With a buffer of 143K (the default on my system), for + # example, bench_sendall.py yields ~264MB/s, while using 1MB yields + # ~653MB/s (matching CPython). 1MB is arbitrary and might be better + # chosen, say, to match a page size? + + len_data_memory = len(data_memory) + if not len_data_memory: + # Don't try to send empty data at all, no point, and breaks ssl + # See issue 719 + return 0 + + + chunk_size = max(socket.getsockopt(SOL_SOCKET, SO_SNDBUF), 1024 * 1024) + + data_sent = 0 + end = None + timeleft = None + if socket.timeout is not None: + timeleft = socket.timeout + end = time.time() + timeleft + + while data_sent < len_data_memory: + chunk_end = min(data_sent + chunk_size, len_data_memory) + chunk = data_memory[data_sent:chunk_end] + + timeleft = __send_chunk(socket, chunk, flags, timeleft, end) + data_sent += len(chunk) # Guaranteed it sent the whole thing + +# pylint:disable=no-member +_RESOLVABLE_FAMILIES = (__socket__.AF_INET,) +if __socket__.has_ipv6: + _RESOLVABLE_FAMILIES += (__socket__.AF_INET6,) + +def _resolve_addr(sock, address): + # Internal method: resolve the AF_INET[6] address using + # getaddrinfo. + if sock.family not in _RESOLVABLE_FAMILIES or not isinstance(address, tuple): + return address + # address is (host, port) (ipv4) or (host, port, flowinfo, scopeid) (ipv6). + + # We don't pass the port to getaddrinfo because the C + # socket module doesn't either (on some systems its + # illegal to do that without also passing socket type and + # protocol). Instead we join the port back at the end. + # See https://github.com/gevent/gevent/issues/1252 + host, port = address[:2] + r = getaddrinfo(host, None, sock.family) + address = r[0][-1] + if len(address) == 2: + address = (address[0], port) + else: + address = (address[0], port, address[2], address[3]) + return address diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_ssl2.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_ssl2.py new file mode 100644 index 00000000..051e3645 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_ssl2.py @@ -0,0 +1,441 @@ +# Wrapper module for _ssl. Written by Bill Janssen. +# Ported to gevent by Denis Bilenko. +""" +SSL wrapper for socket objects on Python 2.7.8 and below. + +For the documentation, refer to :mod:`ssl` module manual. + +This module implements cooperative SSL socket wrappers. + +.. deprecated:: 1.3 + This module is not secure. Support for Python versions + with only this level of SSL will be dropped in gevent 1.4. +""" + +from __future__ import absolute_import +# Our import magic sadly makes this warning useless +# pylint: disable=undefined-variable,arguments-differ,no-member + +import ssl as __ssl__ + +_ssl = __ssl__._ssl + +import sys +import errno +from gevent._socket2 import socket +from gevent.socket import _fileobject, timeout_default +from gevent.socket import error as socket_error, EWOULDBLOCK +from gevent.socket import timeout as _socket_timeout +from gevent._compat import PYPY +from gevent._util import copy_globals + + +__implements__ = [ + 'SSLSocket', + 'wrap_socket', + 'get_server_certificate', + 'sslwrap_simple', +] + +# Import all symbols from Python's ssl.py, except those that we are implementing +# and "private" symbols. +__imports__ = copy_globals(__ssl__, globals(), + # SSLSocket *must* subclass gevent.socket.socket; see issue 597 + names_to_ignore=__implements__ + ['socket'], + dunder_names_to_keep=()) + + +# Py2.6 can get RAND_status added twice +__all__ = list(set(__implements__) | set(__imports__)) +if 'namedtuple' in __all__: + __all__.remove('namedtuple') + +class SSLSocket(socket): + """ + gevent `ssl.SSLSocket `_ + for Pythons < 2.7.9. + """ + + def __init__(self, sock, keyfile=None, certfile=None, + server_side=False, cert_reqs=CERT_NONE, + ssl_version=PROTOCOL_SSLv23, ca_certs=None, + do_handshake_on_connect=True, + suppress_ragged_eofs=True, + ciphers=None): + socket.__init__(self, _sock=sock) + + if PYPY: + sock._drop() + + if certfile and not keyfile: + keyfile = certfile + # see if it's connected + try: + socket.getpeername(self) + except socket_error as e: + if e.args[0] != errno.ENOTCONN: + raise + # no, no connection yet + self._sslobj = None + else: + # yes, create the SSL object + if ciphers is None: + self._sslobj = _ssl.sslwrap(self._sock, server_side, + keyfile, certfile, + cert_reqs, ssl_version, ca_certs) + else: + self._sslobj = _ssl.sslwrap(self._sock, server_side, + keyfile, certfile, + cert_reqs, ssl_version, ca_certs, + ciphers) + if do_handshake_on_connect: + self.do_handshake() + self.keyfile = keyfile + self.certfile = certfile + self.cert_reqs = cert_reqs + self.ssl_version = ssl_version + self.ca_certs = ca_certs + self.ciphers = ciphers + self.do_handshake_on_connect = do_handshake_on_connect + self.suppress_ragged_eofs = suppress_ragged_eofs + self._makefile_refs = 0 + + def read(self, len=1024): + """Read up to LEN bytes and return them. + Return zero-length string on EOF.""" + while True: + try: + return self._sslobj.read(len) + except SSLError as ex: + if ex.args[0] == SSL_ERROR_EOF and self.suppress_ragged_eofs: + return '' + if ex.args[0] == SSL_ERROR_WANT_READ: + if self.timeout == 0.0: + raise + sys.exc_clear() + self._wait(self._read_event, timeout_exc=_SSLErrorReadTimeout) + elif ex.args[0] == SSL_ERROR_WANT_WRITE: + if self.timeout == 0.0: + raise + sys.exc_clear() + # note: using _SSLErrorReadTimeout rather than _SSLErrorWriteTimeout below is intentional + self._wait(self._write_event, timeout_exc=_SSLErrorReadTimeout) + else: + raise + + def write(self, data): + """Write DATA to the underlying SSL channel. Returns + number of bytes of DATA actually transmitted.""" + while True: + try: + return self._sslobj.write(data) + except SSLError as ex: + if ex.args[0] == SSL_ERROR_WANT_READ: + if self.timeout == 0.0: + raise + sys.exc_clear() + self._wait(self._read_event, timeout_exc=_SSLErrorWriteTimeout) + elif ex.args[0] == SSL_ERROR_WANT_WRITE: + if self.timeout == 0.0: + raise + sys.exc_clear() + self._wait(self._write_event, timeout_exc=_SSLErrorWriteTimeout) + else: + raise + + def getpeercert(self, binary_form=False): + """Returns a formatted version of the data in the + certificate provided by the other end of the SSL channel. + Return None if no certificate was provided, {} if a + certificate was provided, but not validated.""" + return self._sslobj.peer_certificate(binary_form) + + def cipher(self): + if not self._sslobj: + return None + return self._sslobj.cipher() + + def send(self, data, flags=0, timeout=timeout_default): + if timeout is timeout_default: + timeout = self.timeout + if self._sslobj: + if flags != 0: + raise ValueError( + "non-zero flags not allowed in calls to send() on %s" % + self.__class__) + while True: + try: + v = self._sslobj.write(data) + except SSLError as x: + if x.args[0] == SSL_ERROR_WANT_READ: + if self.timeout == 0.0: + return 0 + sys.exc_clear() + self._wait(self._read_event) + elif x.args[0] == SSL_ERROR_WANT_WRITE: + if self.timeout == 0.0: + return 0 + sys.exc_clear() + self._wait(self._write_event) + else: + raise + else: + return v + else: + return socket.send(self, data, flags, timeout) + # is it possible for sendall() to send some data without encryption if another end shut down SSL? + + def sendall(self, data, flags=0): + try: + socket.sendall(self, data) + except _socket_timeout as ex: + if self.timeout == 0.0: + # Python 2 simply *hangs* in this case, which is bad, but + # Python 3 raises SSLWantWriteError. We do the same. + raise SSLError(SSL_ERROR_WANT_WRITE) + # Convert the socket.timeout back to the sslerror + raise SSLError(*ex.args) + + def sendto(self, *args): + if self._sslobj: + raise ValueError("sendto not allowed on instances of %s" % + self.__class__) + else: + return socket.sendto(self, *args) + + def recv(self, buflen=1024, flags=0): + if self._sslobj: + if flags != 0: + raise ValueError( + "non-zero flags not allowed in calls to recv() on %s" % + self.__class__) + # QQQ Shouldn't we wrap the SSL_WANT_READ errors as socket.timeout errors to match socket.recv's behavior? + return self.read(buflen) + return socket.recv(self, buflen, flags) + + def recv_into(self, buffer, nbytes=None, flags=0): + if buffer and (nbytes is None): + nbytes = len(buffer) + elif nbytes is None: + nbytes = 1024 + if self._sslobj: + if flags != 0: + raise ValueError( + "non-zero flags not allowed in calls to recv_into() on %s" % + self.__class__) + while True: + try: + tmp_buffer = self.read(nbytes) + v = len(tmp_buffer) + buffer[:v] = tmp_buffer + return v + except SSLError as x: + if x.args[0] == SSL_ERROR_WANT_READ: + if self.timeout == 0.0: + raise + sys.exc_clear() + self._wait(self._read_event) + continue + else: + raise + else: + return socket.recv_into(self, buffer, nbytes, flags) + + def recvfrom(self, *args): + if self._sslobj: + raise ValueError("recvfrom not allowed on instances of %s" % + self.__class__) + else: + return socket.recvfrom(self, *args) + + def recvfrom_into(self, *args): + if self._sslobj: + raise ValueError("recvfrom_into not allowed on instances of %s" % + self.__class__) + else: + return socket.recvfrom_into(self, *args) + + def pending(self): + if self._sslobj: + return self._sslobj.pending() + return 0 + + def _sslobj_shutdown(self): + while True: + try: + return self._sslobj.shutdown() + except SSLError as ex: + if ex.args[0] == SSL_ERROR_EOF and self.suppress_ragged_eofs: + return '' + if ex.args[0] == SSL_ERROR_WANT_READ: + if self.timeout == 0.0: + raise + sys.exc_clear() + self._wait(self._read_event, timeout_exc=_SSLErrorReadTimeout) + elif ex.args[0] == SSL_ERROR_WANT_WRITE: + if self.timeout == 0.0: + raise + sys.exc_clear() + self._wait(self._write_event, timeout_exc=_SSLErrorWriteTimeout) + else: + raise + + def unwrap(self): + if not self._sslobj: + raise ValueError("No SSL wrapper around " + str(self)) + s = self._sslobj_shutdown() + self._sslobj = None + return socket(_sock=s) + + def shutdown(self, how): + self._sslobj = None + socket.shutdown(self, how) + + def close(self): + if self._makefile_refs < 1: + self._sslobj = None + socket.close(self) + else: + self._makefile_refs -= 1 + + if PYPY: + + def _reuse(self): + self._makefile_refs += 1 + + def _drop(self): + if self._makefile_refs < 1: + self.close() + else: + self._makefile_refs -= 1 + + def do_handshake(self): + """Perform a TLS/SSL handshake.""" + while True: + try: + return self._sslobj.do_handshake() + except SSLError as ex: + if ex.args[0] == SSL_ERROR_WANT_READ: + if self.timeout == 0.0: + raise + sys.exc_clear() + self._wait(self._read_event, timeout_exc=_SSLErrorHandshakeTimeout) + elif ex.args[0] == SSL_ERROR_WANT_WRITE: + if self.timeout == 0.0: + raise + sys.exc_clear() + self._wait(self._write_event, timeout_exc=_SSLErrorHandshakeTimeout) + else: + raise + + def connect(self, addr): + """Connects to remote ADDR, and then wraps the connection in + an SSL channel.""" + # Here we assume that the socket is client-side, and not + # connected at the time of the call. We connect it, then wrap it. + if self._sslobj: + raise ValueError("attempt to connect already-connected SSLSocket!") + socket.connect(self, addr) + if self.ciphers is None: + self._sslobj = _ssl.sslwrap(self._sock, False, self.keyfile, self.certfile, + self.cert_reqs, self.ssl_version, + self.ca_certs) + else: + self._sslobj = _ssl.sslwrap(self._sock, False, self.keyfile, self.certfile, + self.cert_reqs, self.ssl_version, + self.ca_certs, self.ciphers) + if self.do_handshake_on_connect: + self.do_handshake() + + def accept(self): + """Accepts a new connection from a remote client, and returns + a tuple containing that new connection wrapped with a server-side + SSL channel, and the address of the remote client.""" + sock = self._sock + while True: + try: + client_socket, address = sock.accept() + break + except socket_error as ex: + if ex.args[0] != EWOULDBLOCK or self.timeout == 0.0: + raise + sys.exc_clear() + self._wait(self._read_event) + + sslobj = SSLSocket(client_socket, + keyfile=self.keyfile, + certfile=self.certfile, + server_side=True, + cert_reqs=self.cert_reqs, + ssl_version=self.ssl_version, + ca_certs=self.ca_certs, + do_handshake_on_connect=self.do_handshake_on_connect, + suppress_ragged_eofs=self.suppress_ragged_eofs, + ciphers=self.ciphers) + + return sslobj, address + + def makefile(self, mode='r', bufsize=-1): + """Make and return a file-like object that + works with the SSL connection. Just use the code + from the socket module.""" + if not PYPY: + self._makefile_refs += 1 + # close=True so as to decrement the reference count when done with + # the file-like object. + return _fileobject(self, mode, bufsize, close=True) + +if PYPY or not hasattr(SSLSocket, 'timeout'): + # PyPy (and certain versions of CPython) doesn't have a direct + # 'timeout' property on raw sockets, because that's not part of + # the documented specification. We may wind up wrapping a raw + # socket (when ssl is used with PyWSGI) or a gevent socket, which + # does have a read/write timeout property as an alias for + # get/settimeout, so make sure that's always the case because + # pywsgi can depend on that. + SSLSocket.timeout = property(lambda self: self.gettimeout(), + lambda self, value: self.settimeout(value)) + + +_SSLErrorReadTimeout = SSLError('The read operation timed out') +_SSLErrorWriteTimeout = SSLError('The write operation timed out') +_SSLErrorHandshakeTimeout = SSLError('The handshake operation timed out') + + +def wrap_socket(sock, keyfile=None, certfile=None, + server_side=False, cert_reqs=CERT_NONE, + ssl_version=PROTOCOL_SSLv23, ca_certs=None, + do_handshake_on_connect=True, + suppress_ragged_eofs=True, ciphers=None): + """Create a new :class:`SSLSocket` instance.""" + return SSLSocket(sock, keyfile=keyfile, certfile=certfile, + server_side=server_side, cert_reqs=cert_reqs, + ssl_version=ssl_version, ca_certs=ca_certs, + do_handshake_on_connect=do_handshake_on_connect, + suppress_ragged_eofs=suppress_ragged_eofs, + ciphers=ciphers) + + +def get_server_certificate(addr, ssl_version=PROTOCOL_SSLv23, ca_certs=None): + """Retrieve the certificate from the server at the specified address, + and return it as a PEM-encoded string. + If 'ca_certs' is specified, validate the server cert against it. + If 'ssl_version' is specified, use it in the connection attempt.""" + + if ca_certs is not None: + cert_reqs = CERT_REQUIRED + else: + cert_reqs = CERT_NONE + s = wrap_socket(socket(), ssl_version=ssl_version, + cert_reqs=cert_reqs, ca_certs=ca_certs) + s.connect(addr) + dercert = s.getpeercert(True) + s.close() + return DER_cert_to_PEM_cert(dercert) + + +def sslwrap_simple(sock, keyfile=None, certfile=None): + """A replacement for the old socket.ssl function. Designed + for compatibility with Python 2.5 and earlier. Will disappear in + Python 3.0.""" + return SSLSocket(sock, keyfile, certfile) diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_ssl3.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_ssl3.py new file mode 100644 index 00000000..aefc8236 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_ssl3.py @@ -0,0 +1,712 @@ +# Wrapper module for _ssl. Written by Bill Janssen. +# Ported to gevent by Denis Bilenko. +"""SSL wrapper for socket objects on Python 3. + +For the documentation, refer to :mod:`ssl` module manual. + +This module implements cooperative SSL socket wrappers. +""" +# Our import magic sadly makes this warning useless +# pylint: disable=undefined-variable +# pylint:disable=no-member + +from __future__ import absolute_import +import ssl as __ssl__ + +_ssl = __ssl__._ssl + +import errno +from gevent.socket import socket, timeout_default +from gevent.socket import error as socket_error +from gevent.socket import timeout as _socket_timeout +from gevent._util import copy_globals + +from weakref import ref as _wref + +__implements__ = [ + 'SSLContext', + 'SSLSocket', + 'wrap_socket', + 'get_server_certificate', +] + +# Import all symbols from Python's ssl.py, except those that we are implementing +# and "private" symbols. +__imports__ = copy_globals(__ssl__, globals(), + # SSLSocket *must* subclass gevent.socket.socket; see issue 597 + names_to_ignore=__implements__ + ['socket'], + dunder_names_to_keep=()) + +__all__ = __implements__ + __imports__ +if 'namedtuple' in __all__: + __all__.remove('namedtuple') + +orig_SSLContext = __ssl__.SSLContext # pylint:disable=no-member + + +class SSLContext(orig_SSLContext): + + # Added in Python 3.7 + sslsocket_class = None # SSLSocket is assigned later + + def wrap_socket(self, sock, server_side=False, + do_handshake_on_connect=True, + suppress_ragged_eofs=True, + server_hostname=None, + session=None): + # pylint:disable=arguments-differ,not-callable + # (3.6 adds session) + # Sadly, using *args and **kwargs doesn't work + return self.sslsocket_class( + sock=sock, server_side=server_side, + do_handshake_on_connect=do_handshake_on_connect, + suppress_ragged_eofs=suppress_ragged_eofs, + server_hostname=server_hostname, + _context=self, + _session=session) + + if not hasattr(orig_SSLContext, 'check_hostname'): + # Python 3.3 lacks this + check_hostname = False + + if hasattr(orig_SSLContext.options, 'setter'): + # In 3.6, these became properties. They want to access the + # property __set__ method in the superclass, and they do so by using + # super(SSLContext, SSLContext). But we rebind SSLContext when we monkey + # patch, which causes infinite recursion. + # https://github.com/python/cpython/commit/328067c468f82e4ec1b5c510a4e84509e010f296 + # pylint:disable=no-member + @orig_SSLContext.options.setter + def options(self, value): + super(orig_SSLContext, orig_SSLContext).options.__set__(self, value) + + @orig_SSLContext.verify_flags.setter + def verify_flags(self, value): + super(orig_SSLContext, orig_SSLContext).verify_flags.__set__(self, value) + + @orig_SSLContext.verify_mode.setter + def verify_mode(self, value): + super(orig_SSLContext, orig_SSLContext).verify_mode.__set__(self, value) + + if hasattr(orig_SSLContext, 'minimum_version'): + # Like the above, added in 3.7 + @orig_SSLContext.minimum_version.setter + def minimum_version(self, value): + super(orig_SSLContext, orig_SSLContext).minimum_version.__set__(self, value) + + @orig_SSLContext.maximum_version.setter + def maximum_version(self, value): + super(orig_SSLContext, orig_SSLContext).maximum_version.__set__(self, value) + + +class _contextawaresock(socket._gevent_sock_class): + # We have to pass the raw stdlib socket to SSLContext.wrap_socket. + # That method in turn can pass that object on to things like SNI callbacks. + # It wouldn't have access to any of the attributes on the SSLSocket, like + # context, that it's supposed to (see test_ssl.test_sni_callback). Our + # solution is to keep a weak reference to the SSLSocket on the raw + # socket and delegate. + + # We keep it in a slot to avoid having the ability to set any attributes + # we're not prepared for (because we don't know what to delegate.) + + __slots__ = ('_sslsock',) + + @property + def context(self): + return self._sslsock().context + + @context.setter + def context(self, ctx): + self._sslsock().context = ctx + + @property + def session(self): + """The SSLSession for client socket.""" + return self._sslsock().session + + @session.setter + def session(self, session): + self._sslsock().session = session + + def __getattr__(self, name): + try: + return getattr(self._sslsock(), name) + except RuntimeError: + # XXX: If the attribute doesn't exist, + # we infinitely recurse + pass + raise AttributeError(name) + +try: + _SSLObject_factory = SSLObject +except NameError: + # 3.4 and below do not have SSLObject, something + # we magically import through copy_globals + pass +else: + if hasattr(SSLObject, '_create'): + # 3.7 is making thing difficult and won't let you + # actually construct an object + def _SSLObject_factory(sslobj, owner=None, session=None): + s = SSLObject.__new__(SSLObject) + s._sslobj = sslobj + s._sslobj.owner = owner or s + if session is not None: + s._sslobj.session = session + return s + +class SSLSocket(socket): + """ + gevent `ssl.SSLSocket `_ + for Python 3. + """ + + # pylint:disable=too-many-instance-attributes,too-many-public-methods + + _gevent_sock_class = _contextawaresock + + def __init__(self, sock=None, keyfile=None, certfile=None, + server_side=False, cert_reqs=CERT_NONE, + ssl_version=PROTOCOL_SSLv23, ca_certs=None, + do_handshake_on_connect=True, + family=AF_INET, type=SOCK_STREAM, proto=0, fileno=None, + suppress_ragged_eofs=True, npn_protocols=None, ciphers=None, + server_hostname=None, + _session=None, # 3.6 + _context=None): + + # pylint:disable=too-many-locals,too-many-statements,too-many-branches + if _context: + self._context = _context + else: + if server_side and not certfile: + raise ValueError("certfile must be specified for server-side " + "operations") + if keyfile and not certfile: + raise ValueError("certfile must be specified") + if certfile and not keyfile: + keyfile = certfile + self._context = SSLContext(ssl_version) + self._context.verify_mode = cert_reqs + if ca_certs: + self._context.load_verify_locations(ca_certs) + if certfile: + self._context.load_cert_chain(certfile, keyfile) + if npn_protocols: + self._context.set_npn_protocols(npn_protocols) + if ciphers: + self._context.set_ciphers(ciphers) + self.keyfile = keyfile + self.certfile = certfile + self.cert_reqs = cert_reqs + self.ssl_version = ssl_version + self.ca_certs = ca_certs + self.ciphers = ciphers + # Can't use sock.type as other flags (such as SOCK_NONBLOCK) get + # mixed in. + if sock.getsockopt(SOL_SOCKET, SO_TYPE) != SOCK_STREAM: + raise NotImplementedError("only stream sockets are supported") + if server_side: + if server_hostname: + raise ValueError("server_hostname can only be specified " + "in client mode") + if _session is not None: + raise ValueError("session can only be specified " + "in client mode") + if self._context.check_hostname and not server_hostname: + raise ValueError("check_hostname requires server_hostname") + self._session = _session + self.server_side = server_side + self.server_hostname = server_hostname + self.do_handshake_on_connect = do_handshake_on_connect + self.suppress_ragged_eofs = suppress_ragged_eofs + connected = False + if sock is not None: + socket.__init__(self, + family=sock.family, + type=sock.type, + proto=sock.proto, + fileno=sock.fileno()) + self.settimeout(sock.gettimeout()) + # see if it's connected + try: + sock.getpeername() + except socket_error as e: + if e.errno != errno.ENOTCONN: + raise + else: + connected = True + sock.detach() + elif fileno is not None: + socket.__init__(self, fileno=fileno) + else: + socket.__init__(self, family=family, type=type, proto=proto) + + self._sock._sslsock = _wref(self) + self._closed = False + self._sslobj = None + self._connected = connected + if connected: + # create the SSL object + try: + self._sslobj = self._context._wrap_socket(self._sock, server_side, + server_hostname) + if _session is not None: # 3.6+ + self._sslobj = _SSLObject_factory(self._sslobj, owner=self, + session=self._session) + if do_handshake_on_connect: + timeout = self.gettimeout() + if timeout == 0.0: + # non-blocking + raise ValueError("do_handshake_on_connect should not be specified for non-blocking sockets") + self.do_handshake() + + except socket_error as x: + self.close() + raise x + + @property + def context(self): + return self._context + + @context.setter + def context(self, ctx): + self._context = ctx + self._sslobj.context = ctx + + @property + def session(self): + """The SSLSession for client socket.""" + if self._sslobj is not None: + return self._sslobj.session + + @session.setter + def session(self, session): + self._session = session + if self._sslobj is not None: + self._sslobj.session = session + + @property + def session_reused(self): + """Was the client session reused during handshake""" + if self._sslobj is not None: + return self._sslobj.session_reused + + def dup(self): + raise NotImplementedError("Can't dup() %s instances" % + self.__class__.__name__) + + def _checkClosed(self, msg=None): + # raise an exception here if you wish to check for spurious closes + pass + + def _check_connected(self): + if not self._connected: + # getpeername() will raise ENOTCONN if the socket is really + # not connected; note that we can be connected even without + # _connected being set, e.g. if connect() first returned + # EAGAIN. + self.getpeername() + + def read(self, len=1024, buffer=None): + """Read up to LEN bytes and return them. + Return zero-length string on EOF.""" + # pylint:disable=too-many-branches + self._checkClosed() + + while True: + if not self._sslobj: + raise ValueError("Read on closed or unwrapped SSL socket.") + if len == 0: + return b'' if buffer is None else 0 + # Negative lengths are handled natively when the buffer is None + # to raise a ValueError + try: + if buffer is not None: + return self._sslobj.read(len, buffer) + return self._sslobj.read(len or 1024) + except SSLWantReadError: + if self.timeout == 0.0: + raise + self._wait(self._read_event, timeout_exc=_SSLErrorReadTimeout) + except SSLWantWriteError: + if self.timeout == 0.0: + raise + # note: using _SSLErrorReadTimeout rather than _SSLErrorWriteTimeout below is intentional + self._wait(self._write_event, timeout_exc=_SSLErrorReadTimeout) + except SSLError as ex: + if ex.args[0] == SSL_ERROR_EOF and self.suppress_ragged_eofs: + if buffer is None: + return b'' + return 0 + raise + + def write(self, data): + """Write DATA to the underlying SSL channel. Returns + number of bytes of DATA actually transmitted.""" + self._checkClosed() + + while True: + if not self._sslobj: + raise ValueError("Write on closed or unwrapped SSL socket.") + + try: + return self._sslobj.write(data) + except SSLError as ex: + if ex.args[0] == SSL_ERROR_WANT_READ: + if self.timeout == 0.0: + raise + self._wait(self._read_event, timeout_exc=_SSLErrorWriteTimeout) + elif ex.args[0] == SSL_ERROR_WANT_WRITE: + if self.timeout == 0.0: + raise + self._wait(self._write_event, timeout_exc=_SSLErrorWriteTimeout) + else: + raise + + def getpeercert(self, binary_form=False): + """Returns a formatted version of the data in the + certificate provided by the other end of the SSL channel. + Return None if no certificate was provided, {} if a + certificate was provided, but not validated.""" + + self._checkClosed() + self._check_connected() + try: + c = self._sslobj.peer_certificate + except AttributeError: + # 3.6 + c = self._sslobj.getpeercert + + return c(binary_form) + + def selected_npn_protocol(self): + self._checkClosed() + if not self._sslobj or not _ssl.HAS_NPN: + return None + return self._sslobj.selected_npn_protocol() + + if hasattr(_ssl, 'HAS_ALPN'): + # 3.5+ + def selected_alpn_protocol(self): + self._checkClosed() + if not self._sslobj or not _ssl.HAS_ALPN: # pylint:disable=no-member + return None + return self._sslobj.selected_alpn_protocol() + + def shared_ciphers(self): + """Return a list of ciphers shared by the client during the handshake or + None if this is not a valid server connection. + """ + return self._sslobj.shared_ciphers() + + def version(self): + """Return a string identifying the protocol version used by the + current SSL channel. """ + if not self._sslobj: + return None + return self._sslobj.version() + + # We inherit sendfile from super(); it always uses `send` + + def cipher(self): + self._checkClosed() + if not self._sslobj: + return None + return self._sslobj.cipher() + + def compression(self): + self._checkClosed() + if not self._sslobj: + return None + return self._sslobj.compression() + + def send(self, data, flags=0, timeout=timeout_default): + self._checkClosed() + if timeout is timeout_default: + timeout = self.timeout + if self._sslobj: + if flags != 0: + raise ValueError( + "non-zero flags not allowed in calls to send() on %s" % + self.__class__) + while True: + try: + return self._sslobj.write(data) + except SSLWantReadError: + if self.timeout == 0.0: + return 0 + self._wait(self._read_event) + except SSLWantWriteError: + if self.timeout == 0.0: + return 0 + self._wait(self._write_event) + else: + return socket.send(self, data, flags, timeout) + + def sendto(self, data, flags_or_addr, addr=None): + self._checkClosed() + if self._sslobj: + raise ValueError("sendto not allowed on instances of %s" % + self.__class__) + elif addr is None: + return socket.sendto(self, data, flags_or_addr) + else: + return socket.sendto(self, data, flags_or_addr, addr) + + def sendmsg(self, *args, **kwargs): + # Ensure programs don't send data unencrypted if they try to + # use this method. + raise NotImplementedError("sendmsg not allowed on instances of %s" % + self.__class__) + + def sendall(self, data, flags=0): + self._checkClosed() + if self._sslobj: + if flags != 0: + raise ValueError( + "non-zero flags not allowed in calls to sendall() on %s" % + self.__class__) + + try: + return socket.sendall(self, data, flags) + except _socket_timeout: + if self.timeout == 0.0: + # Raised by the stdlib on non-blocking sockets + raise SSLWantWriteError("The operation did not complete (write)") + raise + + def recv(self, buflen=1024, flags=0): + self._checkClosed() + if self._sslobj: + if flags != 0: + raise ValueError( + "non-zero flags not allowed in calls to recv() on %s" % + self.__class__) + if buflen == 0: + # https://github.com/python/cpython/commit/00915577dd84ba75016400793bf547666e6b29b5 + # Python #23804 + return b'' + return self.read(buflen) + return socket.recv(self, buflen, flags) + + def recv_into(self, buffer, nbytes=None, flags=0): + self._checkClosed() + if buffer and (nbytes is None): + nbytes = len(buffer) + elif nbytes is None: + nbytes = 1024 + if self._sslobj: + if flags != 0: + raise ValueError("non-zero flags not allowed in calls to recv_into() on %s" % self.__class__) + return self.read(nbytes, buffer) + return socket.recv_into(self, buffer, nbytes, flags) + + def recvfrom(self, buflen=1024, flags=0): + self._checkClosed() + if self._sslobj: + raise ValueError("recvfrom not allowed on instances of %s" % + self.__class__) + else: + return socket.recvfrom(self, buflen, flags) + + def recvfrom_into(self, buffer, nbytes=None, flags=0): + self._checkClosed() + if self._sslobj: + raise ValueError("recvfrom_into not allowed on instances of %s" % + self.__class__) + else: + return socket.recvfrom_into(self, buffer, nbytes, flags) + + def recvmsg(self, *args, **kwargs): + raise NotImplementedError("recvmsg not allowed on instances of %s" % + self.__class__) + + def recvmsg_into(self, *args, **kwargs): + raise NotImplementedError("recvmsg_into not allowed on instances of " + "%s" % self.__class__) + + def pending(self): + self._checkClosed() + if self._sslobj: + return self._sslobj.pending() + return 0 + + def shutdown(self, how): + self._checkClosed() + self._sslobj = None + socket.shutdown(self, how) + + def unwrap(self): + if not self._sslobj: + raise ValueError("No SSL wrapper around " + str(self)) + + while True: + try: + s = self._sslobj.shutdown() + break + except SSLWantReadError: + # Callers of this method expect to get a socket + # back, so we can't simply return 0, we have + # to let these be raised + if self.timeout == 0.0: + raise + self._wait(self._read_event) + except SSLWantWriteError: + if self.timeout == 0.0: + raise + self._wait(self._write_event) + + self._sslobj = None + + # The return value of shutting down the SSLObject is the + # original wrapped socket passed to _wrap_socket, i.e., + # _contextawaresock. But that object doesn't have the + # gevent wrapper around it so it can't be used. We have to + # wrap it back up with a gevent wrapper. + assert s is self._sock + # In the stdlib, SSLSocket subclasses socket.socket and passes itself + # to _wrap_socket, so it gets itself back. We can't do that, we have to + # pass our subclass of _socket.socket, _contextawaresock. + # So ultimately we should return ourself. + + # See test_ftplib.py:TestTLS_FTPClass.test_ccc + return self + + def _real_close(self): + self._sslobj = None + # self._closed = True + socket._real_close(self) + + def do_handshake(self): + """Perform a TLS/SSL handshake.""" + self._check_connected() + while True: + try: + self._sslobj.do_handshake() + break + except SSLWantReadError: + if self.timeout == 0.0: + raise + self._wait(self._read_event, timeout_exc=_SSLErrorHandshakeTimeout) + except SSLWantWriteError: + if self.timeout == 0.0: + raise + self._wait(self._write_event, timeout_exc=_SSLErrorHandshakeTimeout) + + if sys.version_info[:2] < (3, 7) and self._context.check_hostname: + # In Python 3.7, the underlying OpenSSL name matching is used. + # The version implemented in Python doesn't understand IDNA encoding. + if not self.server_hostname: + raise ValueError("check_hostname needs server_hostname " + "argument") + match_hostname(self.getpeercert(), self.server_hostname) + + def _real_connect(self, addr, connect_ex): + if self.server_side: + raise ValueError("can't connect in server-side mode") + # Here we assume that the socket is client-side, and not + # connected at the time of the call. We connect it, then wrap it. + if self._connected: + raise ValueError("attempt to connect already-connected SSLSocket!") + self._sslobj = self._context._wrap_socket(self._sock, False, self.server_hostname) + if self._session is not None: # 3.6+ + self._sslobj = _SSLObject_factory(self._sslobj, owner=self, session=self._session) + try: + if connect_ex: + rc = socket.connect_ex(self, addr) + else: + rc = None + socket.connect(self, addr) + if not rc: + if self.do_handshake_on_connect: + self.do_handshake() + self._connected = True + return rc + except socket_error: + self._sslobj = None + raise + + def connect(self, addr): + """Connects to remote ADDR, and then wraps the connection in + an SSL channel.""" + self._real_connect(addr, False) + + def connect_ex(self, addr): + """Connects to remote ADDR, and then wraps the connection in + an SSL channel.""" + return self._real_connect(addr, True) + + def accept(self): + """Accepts a new connection from a remote client, and returns + a tuple containing that new connection wrapped with a server-side + SSL channel, and the address of the remote client.""" + + newsock, addr = socket.accept(self) + newsock._drop_events() + newsock = self._context.wrap_socket(newsock, + do_handshake_on_connect=self.do_handshake_on_connect, + suppress_ragged_eofs=self.suppress_ragged_eofs, + server_side=True) + return newsock, addr + + def get_channel_binding(self, cb_type="tls-unique"): + """Get channel binding data for current connection. Raise ValueError + if the requested `cb_type` is not supported. Return bytes of the data + or None if the data is not available (e.g. before the handshake). + """ + if hasattr(self._sslobj, 'get_channel_binding'): + # 3.7+, and sslobj is not None + return self._sslobj.get_channel_binding(cb_type) + if cb_type not in CHANNEL_BINDING_TYPES: + raise ValueError("Unsupported channel binding type") + if cb_type != "tls-unique": + raise NotImplementedError("{0} channel binding type not implemented".format(cb_type)) + if self._sslobj is None: + return None + return self._sslobj.tls_unique_cb() + + +# Python does not support forward declaration of types +SSLContext.sslsocket_class = SSLSocket + +# Python 3.2 onwards raise normal timeout errors, not SSLError. +# See https://bugs.python.org/issue10272 +_SSLErrorReadTimeout = _socket_timeout('The read operation timed out') +_SSLErrorWriteTimeout = _socket_timeout('The write operation timed out') +_SSLErrorHandshakeTimeout = _socket_timeout('The handshake operation timed out') + + +def wrap_socket(sock, keyfile=None, certfile=None, + server_side=False, cert_reqs=CERT_NONE, + ssl_version=PROTOCOL_SSLv23, ca_certs=None, + do_handshake_on_connect=True, + suppress_ragged_eofs=True, + ciphers=None): + + return SSLSocket(sock=sock, keyfile=keyfile, certfile=certfile, + server_side=server_side, cert_reqs=cert_reqs, + ssl_version=ssl_version, ca_certs=ca_certs, + do_handshake_on_connect=do_handshake_on_connect, + suppress_ragged_eofs=suppress_ragged_eofs, + ciphers=ciphers) + + +def get_server_certificate(addr, ssl_version=PROTOCOL_SSLv23, ca_certs=None): + """Retrieve the certificate from the server at the specified address, + and return it as a PEM-encoded string. + If 'ca_certs' is specified, validate the server cert against it. + If 'ssl_version' is specified, use it in the connection attempt.""" + + _, _ = addr + if ca_certs is not None: + cert_reqs = CERT_REQUIRED + else: + cert_reqs = CERT_NONE + s = create_connection(addr) + s = wrap_socket(s, ssl_version=ssl_version, + cert_reqs=cert_reqs, ca_certs=ca_certs) + dercert = s.getpeercert(True) + s.close() + return DER_cert_to_PEM_cert(dercert) diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_sslgte279.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_sslgte279.py new file mode 100644 index 00000000..5580762e --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_sslgte279.py @@ -0,0 +1,714 @@ +# Wrapper module for _ssl. Written by Bill Janssen. +# Ported to gevent by Denis Bilenko. +"""SSL wrapper for socket objects on Python 2.7.9 and above. + +For the documentation, refer to :mod:`ssl` module manual. + +This module implements cooperative SSL socket wrappers. +""" + +from __future__ import absolute_import +# Our import magic sadly makes this warning useless +# pylint: disable=undefined-variable +# pylint: disable=too-many-instance-attributes,too-many-locals,too-many-statements,too-many-branches +# pylint: disable=arguments-differ,too-many-public-methods + +import ssl as __ssl__ + +_ssl = __ssl__._ssl # pylint:disable=no-member + +import errno +from gevent._socket2 import socket +from gevent.socket import timeout_default +from gevent.socket import create_connection +from gevent.socket import error as socket_error +from gevent.socket import timeout as _socket_timeout +from gevent._compat import PYPY +from gevent._util import copy_globals + +__implements__ = [ + 'SSLContext', + 'SSLSocket', + 'wrap_socket', + 'get_server_certificate', + 'create_default_context', + '_create_unverified_context', + '_create_default_https_context', + '_create_stdlib_context', +] + +# Import all symbols from Python's ssl.py, except those that we are implementing +# and "private" symbols. +__imports__ = copy_globals(__ssl__, globals(), + # SSLSocket *must* subclass gevent.socket.socket; see issue 597 and 801 + names_to_ignore=__implements__ + ['socket', 'create_connection'], + dunder_names_to_keep=()) + +try: + _delegate_methods +except NameError: # PyPy doesn't expose this detail + _delegate_methods = ('recv', 'recvfrom', 'recv_into', 'recvfrom_into', 'send', 'sendto') + +__all__ = __implements__ + __imports__ +if 'namedtuple' in __all__: + __all__.remove('namedtuple') + +orig_SSLContext = __ssl__.SSLContext # pylint: disable=no-member + + +class SSLContext(orig_SSLContext): + def wrap_socket(self, sock, server_side=False, + do_handshake_on_connect=True, + suppress_ragged_eofs=True, + server_hostname=None): + return SSLSocket(sock=sock, server_side=server_side, + do_handshake_on_connect=do_handshake_on_connect, + suppress_ragged_eofs=suppress_ragged_eofs, + server_hostname=server_hostname, + _context=self) + + +def create_default_context(purpose=Purpose.SERVER_AUTH, cafile=None, + capath=None, cadata=None): + """Create a SSLContext object with default settings. + + NOTE: The protocol and settings may change anytime without prior + deprecation. The values represent a fair balance between maximum + compatibility and security. + """ + if not isinstance(purpose, _ASN1Object): + raise TypeError(purpose) + + context = SSLContext(PROTOCOL_SSLv23) + + # SSLv2 considered harmful. + context.options |= OP_NO_SSLv2 + + # SSLv3 has problematic security and is only required for really old + # clients such as IE6 on Windows XP + context.options |= OP_NO_SSLv3 + + # disable compression to prevent CRIME attacks (OpenSSL 1.0+) + context.options |= getattr(_ssl, "OP_NO_COMPRESSION", 0) + + if purpose == Purpose.SERVER_AUTH: + # verify certs and host name in client mode + context.verify_mode = CERT_REQUIRED + context.check_hostname = True # pylint: disable=attribute-defined-outside-init + elif purpose == Purpose.CLIENT_AUTH: + # Prefer the server's ciphers by default so that we get stronger + # encryption + context.options |= getattr(_ssl, "OP_CIPHER_SERVER_PREFERENCE", 0) + + # Use single use keys in order to improve forward secrecy + context.options |= getattr(_ssl, "OP_SINGLE_DH_USE", 0) + context.options |= getattr(_ssl, "OP_SINGLE_ECDH_USE", 0) + + # disallow ciphers with known vulnerabilities + context.set_ciphers(_RESTRICTED_SERVER_CIPHERS) + + if cafile or capath or cadata: + context.load_verify_locations(cafile, capath, cadata) + elif context.verify_mode != CERT_NONE: + # no explicit cafile, capath or cadata but the verify mode is + # CERT_OPTIONAL or CERT_REQUIRED. Let's try to load default system + # root CA certificates for the given purpose. This may fail silently. + context.load_default_certs(purpose) + return context + +def _create_unverified_context(protocol=PROTOCOL_SSLv23, cert_reqs=None, + check_hostname=False, purpose=Purpose.SERVER_AUTH, + certfile=None, keyfile=None, + cafile=None, capath=None, cadata=None): + """Create a SSLContext object for Python stdlib modules + + All Python stdlib modules shall use this function to create SSLContext + objects in order to keep common settings in one place. The configuration + is less restrict than create_default_context()'s to increase backward + compatibility. + """ + if not isinstance(purpose, _ASN1Object): + raise TypeError(purpose) + + context = SSLContext(protocol) + # SSLv2 considered harmful. + context.options |= OP_NO_SSLv2 + # SSLv3 has problematic security and is only required for really old + # clients such as IE6 on Windows XP + context.options |= OP_NO_SSLv3 + + if cert_reqs is not None: + context.verify_mode = cert_reqs + context.check_hostname = check_hostname # pylint: disable=attribute-defined-outside-init + + if keyfile and not certfile: + raise ValueError("certfile must be specified") + if certfile or keyfile: + context.load_cert_chain(certfile, keyfile) + + # load CA root certs + if cafile or capath or cadata: + context.load_verify_locations(cafile, capath, cadata) + elif context.verify_mode != CERT_NONE: + # no explicit cafile, capath or cadata but the verify mode is + # CERT_OPTIONAL or CERT_REQUIRED. Let's try to load default system + # root CA certificates for the given purpose. This may fail silently. + context.load_default_certs(purpose) + + return context + +# Used by http.client if no context is explicitly passed. +_create_default_https_context = create_default_context + + +# Backwards compatibility alias, even though it's not a public name. +_create_stdlib_context = _create_unverified_context + +class SSLSocket(socket): + """ + gevent `ssl.SSLSocket `_ + for Pythons >= 2.7.9 but less than 3. + """ + + def __init__(self, sock=None, keyfile=None, certfile=None, + server_side=False, cert_reqs=CERT_NONE, + ssl_version=PROTOCOL_SSLv23, ca_certs=None, + do_handshake_on_connect=True, + family=AF_INET, type=SOCK_STREAM, proto=0, fileno=None, + suppress_ragged_eofs=True, npn_protocols=None, ciphers=None, + server_hostname=None, + _context=None): + # fileno is ignored + # pylint: disable=unused-argument + if _context: + self._context = _context + else: + if server_side and not certfile: + raise ValueError("certfile must be specified for server-side " + "operations") + if keyfile and not certfile: + raise ValueError("certfile must be specified") + if certfile and not keyfile: + keyfile = certfile + self._context = SSLContext(ssl_version) + self._context.verify_mode = cert_reqs + if ca_certs: + self._context.load_verify_locations(ca_certs) + if certfile: + self._context.load_cert_chain(certfile, keyfile) + if npn_protocols: + self._context.set_npn_protocols(npn_protocols) + if ciphers: + self._context.set_ciphers(ciphers) + self.keyfile = keyfile + self.certfile = certfile + self.cert_reqs = cert_reqs + self.ssl_version = ssl_version + self.ca_certs = ca_certs + self.ciphers = ciphers + # Can't use sock.type as other flags (such as SOCK_NONBLOCK) get + # mixed in. + if sock.getsockopt(SOL_SOCKET, SO_TYPE) != SOCK_STREAM: + raise NotImplementedError("only stream sockets are supported") + + if PYPY: + socket.__init__(self, _sock=sock) + sock._drop() + else: + # CPython: XXX: Must pass the underlying socket, not our + # potential wrapper; test___example_servers fails the SSL test + # with a client-side EOF error. (Why?) + socket.__init__(self, _sock=sock._sock) + + # The initializer for socket overrides the methods send(), recv(), etc. + # in the instance, which we don't need -- but we want to provide the + # methods defined in SSLSocket. + for attr in _delegate_methods: + try: + delattr(self, attr) + except AttributeError: + pass + if server_side and server_hostname: + raise ValueError("server_hostname can only be specified " + "in client mode") + if self._context.check_hostname and not server_hostname: + raise ValueError("check_hostname requires server_hostname") + self.server_side = server_side + self.server_hostname = server_hostname + self.do_handshake_on_connect = do_handshake_on_connect + self.suppress_ragged_eofs = suppress_ragged_eofs + self.settimeout(sock.gettimeout()) + + # See if we are connected + try: + self.getpeername() + except socket_error as e: + if e.errno != errno.ENOTCONN: + raise + connected = False + else: + connected = True + + self._makefile_refs = 0 + self._closed = False + self._sslobj = None + self._connected = connected + if connected: + # create the SSL object + try: + self._sslobj = self._context._wrap_socket(self._sock, server_side, + server_hostname, ssl_sock=self) + if do_handshake_on_connect: + timeout = self.gettimeout() + if timeout == 0.0: + # non-blocking + raise ValueError("do_handshake_on_connect should not be specified for non-blocking sockets") + self.do_handshake() + + except socket_error as x: + self.close() + raise x + + + @property + def context(self): + return self._context + + @context.setter + def context(self, ctx): + self._context = ctx + self._sslobj.context = ctx + + def dup(self): + raise NotImplementedError("Can't dup() %s instances" % + self.__class__.__name__) + + def _checkClosed(self, msg=None): + # raise an exception here if you wish to check for spurious closes + pass + + def _check_connected(self): + if not self._connected: + # getpeername() will raise ENOTCONN if the socket is really + # not connected; note that we can be connected even without + # _connected being set, e.g. if connect() first returned + # EAGAIN. + self.getpeername() + + def read(self, len=1024, buffer=None): + """Read up to LEN bytes and return them. + Return zero-length string on EOF.""" + self._checkClosed() + + while 1: + if not self._sslobj: + raise ValueError("Read on closed or unwrapped SSL socket.") + if len == 0: + return b'' if buffer is None else 0 + if len < 0 and buffer is None: + # This is handled natively in python 2.7.12+ + raise ValueError("Negative read length") + try: + if buffer is not None: + return self._sslobj.read(len, buffer) + return self._sslobj.read(len or 1024) + except SSLWantReadError: + if self.timeout == 0.0: + raise + self._wait(self._read_event, timeout_exc=_SSLErrorReadTimeout) + except SSLWantWriteError: + if self.timeout == 0.0: + raise + # note: using _SSLErrorReadTimeout rather than _SSLErrorWriteTimeout below is intentional + self._wait(self._write_event, timeout_exc=_SSLErrorReadTimeout) + except SSLError as ex: + if ex.args[0] == SSL_ERROR_EOF and self.suppress_ragged_eofs: + if buffer is not None: + return 0 + return b'' + raise + + def write(self, data): + """Write DATA to the underlying SSL channel. Returns + number of bytes of DATA actually transmitted.""" + self._checkClosed() + + while 1: + if not self._sslobj: + raise ValueError("Write on closed or unwrapped SSL socket.") + + try: + return self._sslobj.write(data) + except SSLError as ex: + if ex.args[0] == SSL_ERROR_WANT_READ: + if self.timeout == 0.0: + raise + self._wait(self._read_event, timeout_exc=_SSLErrorWriteTimeout) + elif ex.args[0] == SSL_ERROR_WANT_WRITE: + if self.timeout == 0.0: + raise + self._wait(self._write_event, timeout_exc=_SSLErrorWriteTimeout) + else: + raise + + def getpeercert(self, binary_form=False): + """Returns a formatted version of the data in the + certificate provided by the other end of the SSL channel. + Return None if no certificate was provided, {} if a + certificate was provided, but not validated.""" + + self._checkClosed() + self._check_connected() + return self._sslobj.peer_certificate(binary_form) + + def selected_npn_protocol(self): + self._checkClosed() + if not self._sslobj or not _ssl.HAS_NPN: + return None + return self._sslobj.selected_npn_protocol() + + if hasattr(_ssl, 'HAS_ALPN'): + # 2.7.10+ + def selected_alpn_protocol(self): + self._checkClosed() + if not self._sslobj or not _ssl.HAS_ALPN: # pylint:disable=no-member + return None + return self._sslobj.selected_alpn_protocol() + + def cipher(self): + self._checkClosed() + if not self._sslobj: + return None + return self._sslobj.cipher() + + def compression(self): + self._checkClosed() + if not self._sslobj: + return None + return self._sslobj.compression() + + def __check_flags(self, meth, flags): + if flags != 0: + raise ValueError( + "non-zero flags not allowed in calls to %s on %s" % + (meth, self.__class__)) + + def send(self, data, flags=0, timeout=timeout_default): + self._checkClosed() + self.__check_flags('send', flags) + + if timeout is timeout_default: + timeout = self.timeout + + if not self._sslobj: + return socket.send(self, data, flags, timeout) + + while True: + try: + return self._sslobj.write(data) + except SSLWantReadError: + if self.timeout == 0.0: + return 0 + self._wait(self._read_event) + except SSLWantWriteError: + if self.timeout == 0.0: + return 0 + self._wait(self._write_event) + + def sendto(self, data, flags_or_addr, addr=None): + self._checkClosed() + if self._sslobj: + raise ValueError("sendto not allowed on instances of %s" % + self.__class__) + elif addr is None: + return socket.sendto(self, data, flags_or_addr) + else: + return socket.sendto(self, data, flags_or_addr, addr) + + def sendmsg(self, *args, **kwargs): + # Ensure programs don't send data unencrypted if they try to + # use this method. + raise NotImplementedError("sendmsg not allowed on instances of %s" % + self.__class__) + + def sendall(self, data, flags=0): + self._checkClosed() + self.__check_flags('sendall', flags) + + try: + socket.sendall(self, data) + except _socket_timeout as ex: + if self.timeout == 0.0: + # Python 2 simply *hangs* in this case, which is bad, but + # Python 3 raises SSLWantWriteError. We do the same. + raise SSLWantWriteError("The operation did not complete (write)") + # Convert the socket.timeout back to the sslerror + raise SSLError(*ex.args) + + def recv(self, buflen=1024, flags=0): + self._checkClosed() + if self._sslobj: + if flags != 0: + raise ValueError( + "non-zero flags not allowed in calls to recv() on %s" % + self.__class__) + if buflen == 0: + return b'' + return self.read(buflen) + return socket.recv(self, buflen, flags) + + def recv_into(self, buffer, nbytes=None, flags=0): + self._checkClosed() + if buffer is not None and (nbytes is None): + # Fix for python bug #23804: bool(bytearray()) is False, + # but we should read 0 bytes. + nbytes = len(buffer) + elif nbytes is None: + nbytes = 1024 + if self._sslobj: + if flags != 0: + raise ValueError( + "non-zero flags not allowed in calls to recv_into() on %s" % + self.__class__) + return self.read(nbytes, buffer) + return socket.recv_into(self, buffer, nbytes, flags) + + def recvfrom(self, buflen=1024, flags=0): + self._checkClosed() + if self._sslobj: + raise ValueError("recvfrom not allowed on instances of %s" % + self.__class__) + return socket.recvfrom(self, buflen, flags) + + def recvfrom_into(self, buffer, nbytes=None, flags=0): + self._checkClosed() + if self._sslobj: + raise ValueError("recvfrom_into not allowed on instances of %s" % + self.__class__) + else: + return socket.recvfrom_into(self, buffer, nbytes, flags) + + def recvmsg(self, *args, **kwargs): + raise NotImplementedError("recvmsg not allowed on instances of %s" % + self.__class__) + + def recvmsg_into(self, *args, **kwargs): + raise NotImplementedError("recvmsg_into not allowed on instances of " + "%s" % self.__class__) + + def pending(self): + self._checkClosed() + if self._sslobj: + return self._sslobj.pending() + return 0 + + def shutdown(self, how): + self._checkClosed() + self._sslobj = None + socket.shutdown(self, how) + + def close(self): + if self._makefile_refs < 1: + self._sslobj = None + socket.close(self) + else: + self._makefile_refs -= 1 + + if PYPY: + + def _reuse(self): + self._makefile_refs += 1 + + def _drop(self): + if self._makefile_refs < 1: + self.close() + else: + self._makefile_refs -= 1 + + def _sslobj_shutdown(self): + while True: + try: + return self._sslobj.shutdown() + except SSLError as ex: + if ex.args[0] == SSL_ERROR_EOF and self.suppress_ragged_eofs: + return '' + if ex.args[0] == SSL_ERROR_WANT_READ: + if self.timeout == 0.0: + raise + sys.exc_clear() + self._wait(self._read_event, timeout_exc=_SSLErrorReadTimeout) + elif ex.args[0] == SSL_ERROR_WANT_WRITE: + if self.timeout == 0.0: + raise + sys.exc_clear() + self._wait(self._write_event, timeout_exc=_SSLErrorWriteTimeout) + else: + raise + + def unwrap(self): + if not self._sslobj: + raise ValueError("No SSL wrapper around " + str(self)) + + s = self._sslobj_shutdown() + self._sslobj = None + # match _ssl2; critical to drop/reuse here on PyPy + # XXX: _ssl3 returns an SSLSocket. Is that what the standard lib does on + # Python 2? Should we do that? + return socket(_sock=s) + + def _real_close(self): + self._sslobj = None + socket._real_close(self) # pylint: disable=no-member + + def do_handshake(self): + """Perform a TLS/SSL handshake.""" + self._check_connected() + while True: + try: + self._sslobj.do_handshake() + break + except SSLWantReadError: + if self.timeout == 0.0: + raise + self._wait(self._read_event, timeout_exc=_SSLErrorHandshakeTimeout) + except SSLWantWriteError: + if self.timeout == 0.0: + raise + self._wait(self._write_event, timeout_exc=_SSLErrorHandshakeTimeout) + + if self._context.check_hostname: + if not self.server_hostname: + raise ValueError("check_hostname needs server_hostname " + "argument") + match_hostname(self.getpeercert(), self.server_hostname) + + def _real_connect(self, addr, connect_ex): + if self.server_side: + raise ValueError("can't connect in server-side mode") + # Here we assume that the socket is client-side, and not + # connected at the time of the call. We connect it, then wrap it. + if self._connected: + raise ValueError("attempt to connect already-connected SSLSocket!") + self._sslobj = self._context._wrap_socket(self._sock, False, self.server_hostname, ssl_sock=self) + try: + if connect_ex: + rc = socket.connect_ex(self, addr) + else: + rc = None + socket.connect(self, addr) + if not rc: + self._connected = True + if self.do_handshake_on_connect: + self.do_handshake() + return rc + except socket_error: + self._sslobj = None + raise + + def connect(self, addr): + """Connects to remote ADDR, and then wraps the connection in + an SSL channel.""" + self._real_connect(addr, False) + + def connect_ex(self, addr): + """Connects to remote ADDR, and then wraps the connection in + an SSL channel.""" + return self._real_connect(addr, True) + + def accept(self): + """Accepts a new connection from a remote client, and returns + a tuple containing that new connection wrapped with a server-side + SSL channel, and the address of the remote client.""" + + newsock, addr = socket.accept(self) + newsock._drop_events() + newsock = self._context.wrap_socket(newsock, + do_handshake_on_connect=self.do_handshake_on_connect, + suppress_ragged_eofs=self.suppress_ragged_eofs, + server_side=True) + return newsock, addr + + def makefile(self, mode='r', bufsize=-1): + + """Make and return a file-like object that + works with the SSL connection. Just use the code + from the socket module.""" + if not PYPY: + self._makefile_refs += 1 + # close=True so as to decrement the reference count when done with + # the file-like object. + return _fileobject(self, mode, bufsize, close=True) + + def get_channel_binding(self, cb_type="tls-unique"): + """Get channel binding data for current connection. Raise ValueError + if the requested `cb_type` is not supported. Return bytes of the data + or None if the data is not available (e.g. before the handshake). + """ + if cb_type not in CHANNEL_BINDING_TYPES: + raise ValueError("Unsupported channel binding type") + if cb_type != "tls-unique": + raise NotImplementedError( + "{0} channel binding type not implemented" + .format(cb_type)) + if self._sslobj is None: + return None + return self._sslobj.tls_unique_cb() + + def version(self): + """ + Return a string identifying the protocol version used by the + current SSL channel, or None if there is no established channel. + """ + if self._sslobj is None: + return None + return self._sslobj.version() + +if PYPY or not hasattr(SSLSocket, 'timeout'): + # PyPy (and certain versions of CPython) doesn't have a direct + # 'timeout' property on raw sockets, because that's not part of + # the documented specification. We may wind up wrapping a raw + # socket (when ssl is used with PyWSGI) or a gevent socket, which + # does have a read/write timeout property as an alias for + # get/settimeout, so make sure that's always the case because + # pywsgi can depend on that. + SSLSocket.timeout = property(lambda self: self.gettimeout(), + lambda self, value: self.settimeout(value)) + + + +_SSLErrorReadTimeout = SSLError('The read operation timed out') +_SSLErrorWriteTimeout = SSLError('The write operation timed out') +_SSLErrorHandshakeTimeout = SSLError('The handshake operation timed out') + +def wrap_socket(sock, keyfile=None, certfile=None, + server_side=False, cert_reqs=CERT_NONE, + ssl_version=PROTOCOL_SSLv23, ca_certs=None, + do_handshake_on_connect=True, + suppress_ragged_eofs=True, + ciphers=None): + + return SSLSocket(sock=sock, keyfile=keyfile, certfile=certfile, + server_side=server_side, cert_reqs=cert_reqs, + ssl_version=ssl_version, ca_certs=ca_certs, + do_handshake_on_connect=do_handshake_on_connect, + suppress_ragged_eofs=suppress_ragged_eofs, + ciphers=ciphers) + +def get_server_certificate(addr, ssl_version=PROTOCOL_SSLv23, ca_certs=None): + """Retrieve the certificate from the server at the specified address, + and return it as a PEM-encoded string. + If 'ca_certs' is specified, validate the server cert against it. + If 'ssl_version' is specified, use it in the connection attempt.""" + + _, _ = addr + if ca_certs is not None: + cert_reqs = CERT_REQUIRED + else: + cert_reqs = CERT_NONE + context = _create_stdlib_context(ssl_version, + cert_reqs=cert_reqs, + cafile=ca_certs) + with closing(create_connection(addr)) as sock: + with closing(context.wrap_socket(sock)) as sslsock: + dercert = sslsock.getpeercert(True) + return DER_cert_to_PEM_cert(dercert) diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_tblib.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_tblib.py new file mode 100644 index 00000000..13364012 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_tblib.py @@ -0,0 +1,432 @@ +# -*- coding: utf-8 -*- +# A vendored version of part of https://github.com/ionelmc/python-tblib +# pylint:disable=redefined-outer-name,reimported,function-redefined,bare-except,no-else-return,broad-except +#### +# Copyright (c) 2013-2016, Ionel Cristian Mărieș +# All rights reserved. + +# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the +# following conditions are met: + +# 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following +# disclaimer. + +# 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following +# disclaimer in the documentation and/or other materials provided with the distribution. + +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, +# INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#### + +# cpython.py + +""" +Taken verbatim from Jinja2. + +https://github.com/mitsuhiko/jinja2/blob/master/jinja2/debug.py#L267 +""" +# pylint:disable=consider-using-dict-comprehension +#import platform # XXX: gevent cannot import platform at the top level; interferes with monkey patching +import sys + + +def _init_ugly_crap(): + """This function implements a few ugly things so that we can patch the + traceback objects. The function returned allows resetting `tb_next` on + any python traceback object. Do not attempt to use this on non cpython + interpreters + """ + import ctypes + from types import TracebackType + + # figure out side of _Py_ssize_t + if hasattr(ctypes.pythonapi, 'Py_InitModule4_64'): + _Py_ssize_t = ctypes.c_int64 + else: + _Py_ssize_t = ctypes.c_int + + # regular python + class _PyObject(ctypes.Structure): + pass + + _PyObject._fields_ = [ + ('ob_refcnt', _Py_ssize_t), + ('ob_type', ctypes.POINTER(_PyObject)) + ] + + # python with trace + if hasattr(sys, 'getobjects'): + class _PyObject(ctypes.Structure): + pass + + _PyObject._fields_ = [ + ('_ob_next', ctypes.POINTER(_PyObject)), + ('_ob_prev', ctypes.POINTER(_PyObject)), + ('ob_refcnt', _Py_ssize_t), + ('ob_type', ctypes.POINTER(_PyObject)) + ] + + class _Traceback(_PyObject): + pass + + _Traceback._fields_ = [ + ('tb_next', ctypes.POINTER(_Traceback)), + ('tb_frame', ctypes.POINTER(_PyObject)), + ('tb_lasti', ctypes.c_int), + ('tb_lineno', ctypes.c_int) + ] + + def tb_set_next(tb, next): + """Set the tb_next attribute of a traceback object.""" + if not (isinstance(tb, TracebackType) and (next is None or isinstance(next, TracebackType))): + raise TypeError('tb_set_next arguments must be traceback objects') + obj = _Traceback.from_address(id(tb)) + if tb.tb_next is not None: + old = _Traceback.from_address(id(tb.tb_next)) + old.ob_refcnt -= 1 + if next is None: + obj.tb_next = ctypes.POINTER(_Traceback)() + else: + next = _Traceback.from_address(id(next)) + next.ob_refcnt += 1 + obj.tb_next = ctypes.pointer(next) + + return tb_set_next + + +tb_set_next = None +#try: +# if platform.python_implementation() == 'CPython': +# tb_set_next = _init_ugly_crap() +#except Exception as exc: +# sys.stderr.write("Failed to initialize cpython support: {!r}".format(exc)) +#del _init_ugly_crap + +# __init__.py +import re +from types import CodeType +from types import TracebackType + +try: + from __pypy__ import tproxy +except ImportError: + tproxy = None + +__version__ = '1.3.0' +__all__ = ('Traceback',) + +PY3 = sys.version_info[0] == 3 +FRAME_RE = re.compile(r'^\s*File "(?P.+)", line (?P\d+)(, in (?P.+))?$') + + +class _AttrDict(dict): + __slots__ = () + __getattr__ = dict.__getitem__ + + +# noinspection PyPep8Naming +class __traceback_maker(Exception): + pass + + +class TracebackParseError(Exception): + pass + + +class Code(object): + def __init__(self, code): + self.co_filename = code.co_filename + self.co_name = code.co_name + # gevent: copy more attributes + self.co_nlocals = code.co_nlocals + self.co_stacksize = code.co_stacksize + self.co_flags = code.co_flags + self.co_firstlineno = code.co_firstlineno + + +class Frame(object): + def __init__(self, frame): + self.f_globals = dict([ + (k, v) + for k, v in frame.f_globals.items() + if k in ("__file__", "__name__") + ]) + self.f_code = Code(frame.f_code) + + def clear(self): + # For compatibility with PyPy 3.5; + # clear was added to frame in Python 3.4 + # and is called by traceback.clear_frames(), which + # in turn is called by unittest.TestCase.assertRaises + pass + +class Traceback(object): + + tb_next = None + + def __init__(self, tb): + self.tb_frame = Frame(tb.tb_frame) + # noinspection SpellCheckingInspection + self.tb_lineno = int(tb.tb_lineno) + + # Build in place to avoid exceeding the recursion limit + tb = tb.tb_next + prev_traceback = self + cls = type(self) + while tb is not None: + traceback = object.__new__(cls) + traceback.tb_frame = Frame(tb.tb_frame) + traceback.tb_lineno = int(tb.tb_lineno) + prev_traceback.tb_next = traceback + prev_traceback = traceback + tb = tb.tb_next + + def as_traceback(self): + if tproxy: + return tproxy(TracebackType, self.__tproxy_handler) + if not tb_set_next: + raise RuntimeError("Cannot re-create traceback !") + + current = self + top_tb = None + tb = None + while current: + f_code = current.tb_frame.f_code + code = compile('\n' * (current.tb_lineno - 1) + 'raise __traceback_maker', current.tb_frame.f_code.co_filename, 'exec') + if PY3: + code = CodeType( + 0, code.co_kwonlyargcount, + code.co_nlocals, code.co_stacksize, code.co_flags, + code.co_code, code.co_consts, code.co_names, code.co_varnames, + f_code.co_filename, f_code.co_name, + code.co_firstlineno, code.co_lnotab, (), () + ) + else: + code = CodeType( + 0, + code.co_nlocals, code.co_stacksize, code.co_flags, + code.co_code, code.co_consts, code.co_names, code.co_varnames, + f_code.co_filename.encode(), f_code.co_name.encode(), + code.co_firstlineno, code.co_lnotab, (), () + ) + + # noinspection PyBroadException + try: + exec(code, current.tb_frame.f_globals, {}) + except: + next_tb = sys.exc_info()[2].tb_next + if top_tb is None: + top_tb = next_tb + if tb is not None: + tb_set_next(tb, next_tb) + tb = next_tb + del next_tb + + current = current.tb_next + try: + return top_tb + finally: + del top_tb + del tb + + + # noinspection SpellCheckingInspection + def __tproxy_handler(self, operation, *args, **kwargs): + if operation in ('__getattribute__', '__getattr__'): + if args[0] == 'tb_next': + return self.tb_next and self.tb_next.as_traceback() + else: + return getattr(self, args[0]) + else: + return getattr(self, operation)(*args, **kwargs) + + def to_dict(self): + """Convert a Traceback into a dictionary representation""" + if self.tb_next is None: + tb_next = None + else: + tb_next = self.tb_next.to_dict() + + code = { + 'co_filename': self.tb_frame.f_code.co_filename, + 'co_name': self.tb_frame.f_code.co_name, + } + frame = { + 'f_globals': self.tb_frame.f_globals, + 'f_code': code, + } + return { + 'tb_frame': frame, + 'tb_lineno': self.tb_lineno, + 'tb_next': tb_next, + } + + @classmethod + def from_dict(cls, dct): + if dct['tb_next']: + tb_next = cls.from_dict(dct['tb_next']) + else: + tb_next = None + + code = _AttrDict( + co_filename=dct['tb_frame']['f_code']['co_filename'], + co_name=dct['tb_frame']['f_code']['co_name'], + ) + frame = _AttrDict( + f_globals=dct['tb_frame']['f_globals'], + f_code=code, + ) + tb = _AttrDict( + tb_frame=frame, + tb_lineno=dct['tb_lineno'], + tb_next=tb_next, + ) + return cls(tb) + + @classmethod + def from_string(cls, string, strict=True): + frames = [] + header = strict + + for line in string.splitlines(): + line = line.rstrip() + if header: + if line == 'Traceback (most recent call last):': + header = False + continue + frame_match = FRAME_RE.match(line) + if frame_match: + frames.append(frame_match.groupdict()) + elif line.startswith(' '): + pass + elif strict: + break # traceback ended + + if frames: + previous = None + for frame in reversed(frames): + previous = _AttrDict( + frame, + tb_frame=_AttrDict( + frame, + f_globals=_AttrDict( + __file__=frame['co_filename'], + __name__='?', + ), + f_code=_AttrDict(frame), + ), + tb_next=previous, + ) + return cls(previous) + else: + raise TracebackParseError("Could not find any frames in %r." % string) + +# pickling_support.py + + +def unpickle_traceback(tb_frame, tb_lineno, tb_next): + ret = object.__new__(Traceback) + ret.tb_frame = tb_frame + ret.tb_lineno = tb_lineno + ret.tb_next = tb_next + return ret.as_traceback() + + +def pickle_traceback(tb): + return unpickle_traceback, (Frame(tb.tb_frame), tb.tb_lineno, tb.tb_next and Traceback(tb.tb_next)) + + +def install(): + try: + import copy_reg + except ImportError: + import copyreg as copy_reg + + copy_reg.pickle(TracebackType, pickle_traceback) + +# Added by gevent + +# We have to defer the initialization, and especially the import of platform, +# until runtime. If we're monkey patched, we need to be sure to use +# the original __import__ to avoid switching through the hub due to +# import locks on Python 2. See also builtins.py for details. + + +def _unlocked_imports(f): + def g(a): + if sys is None: # pragma: no cover + # interpreter shutdown on Py2 + return + + gb = None + if 'gevent.builtins' in sys.modules: + gb = sys.modules['gevent.builtins'] + gb._unlock_imports() + try: + return f(a) + finally: + if gb is not None: + gb._lock_imports() + g.__name__ = f.__name__ + g.__module__ = f.__module__ + return g + + +def _import_dump_load(): + global dumps + global loads + try: + import cPickle as pickle + except ImportError: + import pickle + dumps = pickle.dumps + loads = pickle.loads + +dumps = loads = None + +_installed = False + + +def _init(): + global _installed + global tb_set_next + if _installed: + return + + _installed = True + import platform + try: + if platform.python_implementation() == 'CPython': + tb_set_next = _init_ugly_crap() + except Exception as exc: + sys.stderr.write("Failed to initialize cpython support: {!r}".format(exc)) + + try: + from __pypy__ import tproxy + except ImportError: + tproxy = None + + if not tb_set_next and not tproxy: + raise ImportError("Cannot use tblib. Runtime not supported.") + _import_dump_load() + install() + + +@_unlocked_imports +def dump_traceback(tb): + # Both _init and dump/load have to be unlocked, because + # copy_reg and pickle can do imports to resolve class names; those + # class names are in this module and greenlet safe though + _init() + return dumps(tb) + + +@_unlocked_imports +def load_traceback(s): + _init() + return loads(s) diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_threading.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_threading.py new file mode 100644 index 00000000..9258dfbf --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_threading.py @@ -0,0 +1,168 @@ +"""A clone of threading module (version 2.7.2) that always +targets real OS threads. (Unlike 'threading' which flips between +green and OS threads based on whether the monkey patching is in effect +or not). + +This module is missing 'Thread' class, but includes 'Queue'. +""" +from __future__ import absolute_import + +from collections import deque + +from gevent import monkey +from gevent._compat import thread_mod_name + + +__all__ = [ + 'Lock', + 'Queue', +] + + +start_new_thread, Lock, get_thread_ident, = monkey.get_original(thread_mod_name, [ + 'start_new_thread', 'allocate_lock', 'get_ident', +]) + + +# pylint 2.0.dev2 things collections.dequeue.popleft() doesn't return +# pylint:disable=assignment-from-no-return + + +class _Condition(object): + # pylint:disable=method-hidden + + def __init__(self, lock): + self.__lock = lock + self.__waiters = [] + + # If the lock defines _release_save() and/or _acquire_restore(), + # these override the default implementations (which just call + # release() and acquire() on the lock). Ditto for _is_owned(). + try: + self._release_save = lock._release_save + except AttributeError: + pass + try: + self._acquire_restore = lock._acquire_restore + except AttributeError: + pass + try: + self._is_owned = lock._is_owned + except AttributeError: + pass + + def __enter__(self): + return self.__lock.__enter__() + + def __exit__(self, t, v, tb): + return self.__lock.__exit__(t, v, tb) + + def __repr__(self): + return "" % (self.__lock, len(self.__waiters)) + + def _release_save(self): + self.__lock.release() # No state to save + + def _acquire_restore(self, x): # pylint:disable=unused-argument + self.__lock.acquire() # Ignore saved state + + def _is_owned(self): + # Return True if lock is owned by current_thread. + # This method is called only if __lock doesn't have _is_owned(). + if self.__lock.acquire(0): + self.__lock.release() + return False + return True + + def wait(self): + # The condition MUST be owned, but we don't check that. + waiter = Lock() + waiter.acquire() + self.__waiters.append(waiter) + saved_state = self._release_save() + try: # restore state no matter what (e.g., KeyboardInterrupt) + waiter.acquire() # Block on the native lock + finally: + self._acquire_restore(saved_state) + + def notify_one(self): + # The condition MUST be owned, but we don't check that. + try: + waiter = self.__waiters.pop() + except IndexError: + # Nobody around + pass + else: + waiter.release() + + +class Queue(object): + """Create a queue object. + + The queue is always infinite size. + """ + + __slots__ = ('_queue', '_mutex', '_not_empty', 'unfinished_tasks') + + def __init__(self): + self._queue = deque() + # mutex must be held whenever the queue is mutating. All methods + # that acquire mutex must release it before returning. mutex + # is shared between the three conditions, so acquiring and + # releasing the conditions also acquires and releases mutex. + self._mutex = Lock() + # Notify not_empty whenever an item is added to the queue; a + # thread waiting to get is notified then. + self._not_empty = _Condition(self._mutex) + + self.unfinished_tasks = 0 + + def task_done(self): + """Indicate that a formerly enqueued task is complete. + + Used by Queue consumer threads. For each get() used to fetch a task, + a subsequent call to task_done() tells the queue that the processing + on the task is complete. + + If a join() is currently blocking, it will resume when all items + have been processed (meaning that a task_done() call was received + for every item that had been put() into the queue). + + Raises a ValueError if called more times than there were items + placed in the queue. + """ + with self._mutex: + unfinished = self.unfinished_tasks - 1 + if unfinished <= 0: + if unfinished < 0: + raise ValueError('task_done() called too many times') + self.unfinished_tasks = unfinished + + def qsize(self, len=len): + """Return the approximate size of the queue (not reliable!).""" + return len(self._queue) + + def empty(self): + """Return True if the queue is empty, False otherwise (not reliable!).""" + return not self.qsize() + + def full(self): + """Return True if the queue is full, False otherwise (not reliable!).""" + return False + + def put(self, item): + """Put an item into the queue. + """ + with self._not_empty: + self._queue.append(item) + self.unfinished_tasks += 1 + self._not_empty.notify_one() + + def get(self): + """Remove and return an item from the queue. + """ + with self._not_empty: + while not self._queue: + self._not_empty.wait() + item = self._queue.popleft() + return item diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_tracer.c b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_tracer.c new file mode 100644 index 00000000..a3086d68 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_tracer.c @@ -0,0 +1,9661 @@ +/* Generated by Cython 0.29.2 */ + +/* BEGIN: Cython Metadata +{ + "distutils": { + "depends": [ + "src/gevent/__tracer.pxd", + "src\\gevent\\__tracer.pxd" + ], + "include_dirs": [ + "C:\\Python37\\Include", + "deps" + ], + "name": "gevent.__tracer", + "sources": [ + "src/gevent/_tracer.py" + ] + }, + "module_name": "gevent.__tracer" +} +END: Cython Metadata */ + +#define PY_SSIZE_T_CLEAN +#include "Python.h" +#ifndef Py_PYTHON_H + #error Python headers needed to compile C extensions, please install development version of Python. +#elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) + #error Cython requires Python 2.6+ or Python 3.3+. +#else +#define CYTHON_ABI "0_29_2" +#define CYTHON_HEX_VERSION 0x001D02F0 +#define CYTHON_FUTURE_DIVISION 1 +#include +#ifndef offsetof + #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) +#endif +#if !defined(WIN32) && !defined(MS_WINDOWS) + #ifndef __stdcall + #define __stdcall + #endif + #ifndef __cdecl + #define __cdecl + #endif + #ifndef __fastcall + #define __fastcall + #endif +#endif +#ifndef DL_IMPORT + #define DL_IMPORT(t) t +#endif +#ifndef DL_EXPORT + #define DL_EXPORT(t) t +#endif +#define __PYX_COMMA , +#ifndef HAVE_LONG_LONG + #if PY_VERSION_HEX >= 0x02070000 + #define HAVE_LONG_LONG + #endif +#endif +#ifndef PY_LONG_LONG + #define PY_LONG_LONG LONG_LONG +#endif +#ifndef Py_HUGE_VAL + #define Py_HUGE_VAL HUGE_VAL +#endif +#ifdef PYPY_VERSION + #define CYTHON_COMPILING_IN_PYPY 1 + #define CYTHON_COMPILING_IN_PYSTON 0 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #undef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 0 + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #if PY_VERSION_HEX < 0x03050000 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #elif !defined(CYTHON_USE_ASYNC_SLOTS) + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #undef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 0 + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #undef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 1 + #undef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 0 + #undef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 0 + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #undef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE 0 + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 +#elif defined(PYSTON_VERSION) + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_PYSTON 1 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #ifndef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 1 + #endif + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #ifndef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 1 + #endif + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #ifndef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 0 + #endif + #ifndef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 1 + #endif + #ifndef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 1 + #endif + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #undef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE 0 + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 +#else + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_PYSTON 0 + #define CYTHON_COMPILING_IN_CPYTHON 1 + #ifndef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 1 + #endif + #if PY_VERSION_HEX < 0x02070000 + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #elif !defined(CYTHON_USE_PYTYPE_LOOKUP) + #define CYTHON_USE_PYTYPE_LOOKUP 1 + #endif + #if PY_MAJOR_VERSION < 3 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #elif !defined(CYTHON_USE_ASYNC_SLOTS) + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #if PY_VERSION_HEX < 0x02070000 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #elif !defined(CYTHON_USE_PYLONG_INTERNALS) + #define CYTHON_USE_PYLONG_INTERNALS 1 + #endif + #ifndef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 1 + #endif + #ifndef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 1 + #endif + #if PY_VERSION_HEX < 0x030300F0 + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #elif !defined(CYTHON_USE_UNICODE_WRITER) + #define CYTHON_USE_UNICODE_WRITER 1 + #endif + #ifndef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 0 + #endif + #ifndef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 1 + #endif + #ifndef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 1 + #endif + #ifndef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 1 + #endif + #ifndef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 1 + #endif + #ifndef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000) + #endif + #ifndef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1) + #endif + #ifndef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1) + #endif + #ifndef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3) + #endif +#endif +#if !defined(CYTHON_FAST_PYCCALL) +#define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) +#endif +#if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #undef SHIFT + #undef BASE + #undef MASK + #ifdef SIZEOF_VOID_P + enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) }; + #endif +#endif +#ifndef __has_attribute + #define __has_attribute(x) 0 +#endif +#ifndef __has_cpp_attribute + #define __has_cpp_attribute(x) 0 +#endif +#ifndef CYTHON_RESTRICT + #if defined(__GNUC__) + #define CYTHON_RESTRICT __restrict__ + #elif defined(_MSC_VER) && _MSC_VER >= 1400 + #define CYTHON_RESTRICT __restrict + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_RESTRICT restrict + #else + #define CYTHON_RESTRICT + #endif +#endif +#ifndef CYTHON_UNUSED +# if defined(__GNUC__) +# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +#endif +#ifndef CYTHON_MAYBE_UNUSED_VAR +# if defined(__cplusplus) + template void CYTHON_MAYBE_UNUSED_VAR( const T& ) { } +# else +# define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x) +# endif +#endif +#ifndef CYTHON_NCP_UNUSED +# if CYTHON_COMPILING_IN_CPYTHON +# define CYTHON_NCP_UNUSED +# else +# define CYTHON_NCP_UNUSED CYTHON_UNUSED +# endif +#endif +#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) +#ifdef _MSC_VER + #ifndef _MSC_STDINT_H_ + #if _MSC_VER < 1300 + typedef unsigned char uint8_t; + typedef unsigned int uint32_t; + #else + typedef unsigned __int8 uint8_t; + typedef unsigned __int32 uint32_t; + #endif + #endif +#else + #include +#endif +#ifndef CYTHON_FALLTHROUGH + #if defined(__cplusplus) && __cplusplus >= 201103L + #if __has_cpp_attribute(fallthrough) + #define CYTHON_FALLTHROUGH [[fallthrough]] + #elif __has_cpp_attribute(clang::fallthrough) + #define CYTHON_FALLTHROUGH [[clang::fallthrough]] + #elif __has_cpp_attribute(gnu::fallthrough) + #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] + #endif + #endif + #ifndef CYTHON_FALLTHROUGH + #if __has_attribute(fallthrough) + #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) + #else + #define CYTHON_FALLTHROUGH + #endif + #endif + #if defined(__clang__ ) && defined(__apple_build_version__) + #if __apple_build_version__ < 7000000 + #undef CYTHON_FALLTHROUGH + #define CYTHON_FALLTHROUGH + #endif + #endif +#endif + +#ifndef CYTHON_INLINE + #if defined(__clang__) + #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) + #elif defined(__GNUC__) + #define CYTHON_INLINE __inline__ + #elif defined(_MSC_VER) + #define CYTHON_INLINE __inline + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_INLINE inline + #else + #define CYTHON_INLINE + #endif +#endif + +#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) + #define Py_OptimizeFlag 0 +#endif +#define __PYX_BUILD_PY_SSIZE_T "n" +#define CYTHON_FORMAT_SSIZE_T "z" +#if PY_MAJOR_VERSION < 3 + #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyClass_Type +#else + #define __Pyx_BUILTIN_MODULE_NAME "builtins" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyType_Type +#endif +#ifndef Py_TPFLAGS_CHECKTYPES + #define Py_TPFLAGS_CHECKTYPES 0 +#endif +#ifndef Py_TPFLAGS_HAVE_INDEX + #define Py_TPFLAGS_HAVE_INDEX 0 +#endif +#ifndef Py_TPFLAGS_HAVE_NEWBUFFER + #define Py_TPFLAGS_HAVE_NEWBUFFER 0 +#endif +#ifndef Py_TPFLAGS_HAVE_FINALIZE + #define Py_TPFLAGS_HAVE_FINALIZE 0 +#endif +#ifndef METH_STACKLESS + #define METH_STACKLESS 0 +#endif +#if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) + #ifndef METH_FASTCALL + #define METH_FASTCALL 0x80 + #endif + typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs); + typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args, + Py_ssize_t nargs, PyObject *kwnames); +#else + #define __Pyx_PyCFunctionFast _PyCFunctionFast + #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords +#endif +#if CYTHON_FAST_PYCCALL +#define __Pyx_PyFastCFunction_Check(func)\ + ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS))))) +#else +#define __Pyx_PyFastCFunction_Check(func) 0 +#endif +#if CYTHON_USE_DICT_VERSIONS +#define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) +#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ + (version_var) = __PYX_GET_DICT_VERSION(dict);\ + (cache_var) = (value); +#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ + static PY_UINT64_T __pyx_dict_version = 0;\ + static PyObject *__pyx_dict_cached_value = NULL;\ + if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ + (VAR) = __pyx_dict_cached_value;\ + } else {\ + (VAR) = __pyx_dict_cached_value = (LOOKUP);\ + __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ + }\ + } +#else +#define __PYX_GET_DICT_VERSION(dict) (0) +#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) +#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) + #define PyObject_Malloc(s) PyMem_Malloc(s) + #define PyObject_Free(p) PyMem_Free(p) + #define PyObject_Realloc(p) PyMem_Realloc(p) +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1 + #define PyMem_RawMalloc(n) PyMem_Malloc(n) + #define PyMem_RawRealloc(p, n) PyMem_Realloc(p, n) + #define PyMem_RawFree(p) PyMem_Free(p) +#endif +#if CYTHON_COMPILING_IN_PYSTON + #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co) + #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno) +#else + #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) + #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) +#endif +#if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000 + #define __Pyx_PyThreadState_Current PyThreadState_GET() +#elif PY_VERSION_HEX >= 0x03060000 + #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() +#elif PY_VERSION_HEX >= 0x03000000 + #define __Pyx_PyThreadState_Current PyThreadState_GET() +#else + #define __Pyx_PyThreadState_Current _PyThreadState_Current +#endif +#if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) +#include "pythread.h" +#define Py_tss_NEEDS_INIT 0 +typedef int Py_tss_t; +static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) { + *key = PyThread_create_key(); + return 0; // PyThread_create_key reports success always +} +static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) { + Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t)); + *key = Py_tss_NEEDS_INIT; + return key; +} +static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) { + PyObject_Free(key); +} +static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) { + return *key != Py_tss_NEEDS_INIT; +} +static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) { + PyThread_delete_key(*key); + *key = Py_tss_NEEDS_INIT; +} +static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) { + return PyThread_set_key_value(*key, value); +} +static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { + return PyThread_get_key_value(*key); +} +#endif // TSS (Thread Specific Storage) API +#if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized) +#define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) +#else +#define __Pyx_PyDict_NewPresized(n) PyDict_New() +#endif +#if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION + #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) +#else + #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS +#define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) +#else +#define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name) +#endif +#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) + #define CYTHON_PEP393_ENABLED 1 + #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ + 0 : _PyUnicode_Ready((PyObject *)(op))) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) + #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) + #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) + #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) + #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) + #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch) + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) +#else + #define CYTHON_PEP393_ENABLED 0 + #define PyUnicode_1BYTE_KIND 1 + #define PyUnicode_2BYTE_KIND 2 + #define PyUnicode_4BYTE_KIND 4 + #define __Pyx_PyUnicode_READY(op) (0) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) + #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111) + #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) + #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) + #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) + #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch) + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) +#endif +#if CYTHON_COMPILING_IN_PYPY + #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) +#else + #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ + PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains) + #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check) + #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format) + #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) +#endif +#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) +#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) +#else + #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) +#endif +#if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) + #define PyObject_ASCII(o) PyObject_Repr(o) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBaseString_Type PyUnicode_Type + #define PyStringObject PyUnicodeObject + #define PyString_Type PyUnicode_Type + #define PyString_Check PyUnicode_Check + #define PyString_CheckExact PyUnicode_CheckExact + #define PyObject_Unicode PyObject_Str +#endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) + #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) +#else + #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) + #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) +#endif +#ifndef PySet_CheckExact + #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) +#endif +#if CYTHON_ASSUME_SAFE_MACROS + #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) +#else + #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyIntObject PyLongObject + #define PyInt_Type PyLong_Type + #define PyInt_Check(op) PyLong_Check(op) + #define PyInt_CheckExact(op) PyLong_CheckExact(op) + #define PyInt_FromString PyLong_FromString + #define PyInt_FromUnicode PyLong_FromUnicode + #define PyInt_FromLong PyLong_FromLong + #define PyInt_FromSize_t PyLong_FromSize_t + #define PyInt_FromSsize_t PyLong_FromSsize_t + #define PyInt_AsLong PyLong_AsLong + #define PyInt_AS_LONG PyLong_AS_LONG + #define PyInt_AsSsize_t PyLong_AsSsize_t + #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask + #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask + #define PyNumber_Int PyNumber_Long +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBoolObject PyLongObject +#endif +#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY + #ifndef PyUnicode_InternFromString + #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) + #endif +#endif +#if PY_VERSION_HEX < 0x030200A4 + typedef long Py_hash_t; + #define __Pyx_PyInt_FromHash_t PyInt_FromLong + #define __Pyx_PyInt_AsHash_t PyInt_AsLong +#else + #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t + #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t +#endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : (Py_INCREF(func), func)) +#else + #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) +#endif +#if CYTHON_USE_ASYNC_SLOTS + #if PY_VERSION_HEX >= 0x030500B1 + #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods + #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) + #else + #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) + #endif +#else + #define __Pyx_PyType_AsAsync(obj) NULL +#endif +#ifndef __Pyx_PyAsyncMethodsStruct + typedef struct { + unaryfunc am_await; + unaryfunc am_aiter; + unaryfunc am_anext; + } __Pyx_PyAsyncMethodsStruct; +#endif + +#if defined(WIN32) || defined(MS_WINDOWS) + #define _USE_MATH_DEFINES +#endif +#include +#ifdef NAN +#define __PYX_NAN() ((float) NAN) +#else +static CYTHON_INLINE float __PYX_NAN() { + float value; + memset(&value, 0xFF, sizeof(value)); + return value; +} +#endif +#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) +#define __Pyx_truncl trunc +#else +#define __Pyx_truncl truncl +#endif + + +#define __PYX_ERR(f_index, lineno, Ln_error) \ +{ \ + __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \ +} + +#ifndef __PYX_EXTERN_C + #ifdef __cplusplus + #define __PYX_EXTERN_C extern "C" + #else + #define __PYX_EXTERN_C extern + #endif +#endif + +#define __PYX_HAVE__gevent____tracer +#define __PYX_HAVE_API__gevent____tracer +/* Early includes */ +#ifdef _OPENMP +#include +#endif /* _OPENMP */ + +#if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) +#define CYTHON_WITHOUT_ASSERTIONS +#endif + +typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; + const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; + +#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 +#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0 +#define __PYX_DEFAULT_STRING_ENCODING "" +#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString +#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#define __Pyx_uchar_cast(c) ((unsigned char)c) +#define __Pyx_long_cast(x) ((long)x) +#define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ + (sizeof(type) < sizeof(Py_ssize_t)) ||\ + (sizeof(type) > sizeof(Py_ssize_t) &&\ + likely(v < (type)PY_SSIZE_T_MAX ||\ + v == (type)PY_SSIZE_T_MAX) &&\ + (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ + v == (type)PY_SSIZE_T_MIN))) ||\ + (sizeof(type) == sizeof(Py_ssize_t) &&\ + (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ + v == (type)PY_SSIZE_T_MAX))) ) +static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) { + return (size_t) i < (size_t) limit; +} +#if defined (__cplusplus) && __cplusplus >= 201103L + #include + #define __Pyx_sst_abs(value) std::abs(value) +#elif SIZEOF_INT >= SIZEOF_SIZE_T + #define __Pyx_sst_abs(value) abs(value) +#elif SIZEOF_LONG >= SIZEOF_SIZE_T + #define __Pyx_sst_abs(value) labs(value) +#elif defined (_MSC_VER) + #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) +#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define __Pyx_sst_abs(value) llabs(value) +#elif defined (__GNUC__) + #define __Pyx_sst_abs(value) __builtin_llabs(value) +#else + #define __Pyx_sst_abs(value) ((value<0) ? -value : value) +#endif +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*); +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); +#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) +#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) +#define __Pyx_PyBytes_FromString PyBytes_FromString +#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); +#if PY_MAJOR_VERSION < 3 + #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#else + #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize +#endif +#define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) +#define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) +#define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) +#define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) +#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) +static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) { + const Py_UNICODE *u_end = u; + while (*u_end++) ; + return (size_t)(u_end - u - 1); +} +#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) +#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode +#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode +#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) +#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) +static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); +static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*); +static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); +#define __Pyx_PySequence_Tuple(obj)\ + (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); +#if CYTHON_ASSUME_SAFE_MACROS +#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) +#else +#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) +#endif +#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) +#if PY_MAJOR_VERSION >= 3 +#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) +#else +#define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) +#endif +#define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x)) +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII +static int __Pyx_sys_getdefaultencoding_not_ascii; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + PyObject* ascii_chars_u = NULL; + PyObject* ascii_chars_b = NULL; + const char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + if (strcmp(default_encoding_c, "ascii") == 0) { + __Pyx_sys_getdefaultencoding_not_ascii = 0; + } else { + char ascii_chars[128]; + int c; + for (c = 0; c < 128; c++) { + ascii_chars[c] = c; + } + __Pyx_sys_getdefaultencoding_not_ascii = 1; + ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); + if (!ascii_chars_u) goto bad; + ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); + if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { + PyErr_Format( + PyExc_ValueError, + "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", + default_encoding_c); + goto bad; + } + Py_DECREF(ascii_chars_u); + Py_DECREF(ascii_chars_b); + } + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + Py_XDECREF(ascii_chars_u); + Py_XDECREF(ascii_chars_b); + return -1; +} +#endif +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) +#else +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +static char* __PYX_DEFAULT_STRING_ENCODING; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1); + if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; + strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + return -1; +} +#endif +#endif + + +/* Test for GCC > 2.95 */ +#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) + #define likely(x) __builtin_expect(!!(x), 1) + #define unlikely(x) __builtin_expect(!!(x), 0) +#else /* !__GNUC__ or GCC < 2.95 */ + #define likely(x) (x) + #define unlikely(x) (x) +#endif /* __GNUC__ */ +static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } + +static PyObject *__pyx_m = NULL; +static PyObject *__pyx_d; +static PyObject *__pyx_b; +static PyObject *__pyx_cython_runtime = NULL; +static PyObject *__pyx_empty_tuple; +static PyObject *__pyx_empty_bytes; +static PyObject *__pyx_empty_unicode; +static int __pyx_lineno; +static int __pyx_clineno = 0; +static const char * __pyx_cfilenm= __FILE__; +static const char *__pyx_filename; + + +static const char *__pyx_f[] = { + "src\\gevent\\_tracer.py", + "src\\gevent\\__tracer.pxd", +}; + +/*--- Type declarations ---*/ +struct __pyx_obj_6gevent_8__tracer_GreenletTracer; +struct __pyx_obj_6gevent_8__tracer__HubTracer; +struct __pyx_obj_6gevent_8__tracer_HubSwitchTracer; +struct __pyx_obj_6gevent_8__tracer_MaxSwitchTracer; + +/* "gevent/__tracer.pxd":15 + * + * + * cdef class GreenletTracer: # <<<<<<<<<<<<<< + * cpdef readonly object active_greenlet + * cpdef readonly object previous_trace_function + */ +struct __pyx_obj_6gevent_8__tracer_GreenletTracer { + PyObject_HEAD + struct __pyx_vtabstruct_6gevent_8__tracer_GreenletTracer *__pyx_vtab; + PyObject *active_greenlet; + PyObject *previous_trace_function; + Py_ssize_t greenlet_switch_counter; + int _killed; +}; + + +/* "gevent/__tracer.pxd":30 + * + * @cython.internal + * cdef class _HubTracer(GreenletTracer): # <<<<<<<<<<<<<< + * cpdef readonly object hub + * cpdef readonly double max_blocking_time + */ +struct __pyx_obj_6gevent_8__tracer__HubTracer { + struct __pyx_obj_6gevent_8__tracer_GreenletTracer __pyx_base; + PyObject *hub; + double max_blocking_time; +}; + + +/* "gevent/__tracer.pxd":35 + * + * + * cdef class HubSwitchTracer(_HubTracer): # <<<<<<<<<<<<<< + * cpdef readonly double last_entered_hub + * + */ +struct __pyx_obj_6gevent_8__tracer_HubSwitchTracer { + struct __pyx_obj_6gevent_8__tracer__HubTracer __pyx_base; + double last_entered_hub; +}; + + +/* "gevent/__tracer.pxd":38 + * cpdef readonly double last_entered_hub + * + * cdef class MaxSwitchTracer(_HubTracer): # <<<<<<<<<<<<<< + * cpdef readonly double max_blocking + * cpdef readonly double last_switch + */ +struct __pyx_obj_6gevent_8__tracer_MaxSwitchTracer { + struct __pyx_obj_6gevent_8__tracer__HubTracer __pyx_base; + double max_blocking; + double last_switch; +}; + + + +/* "src/gevent/_tracer.py":27 + * + * + * class GreenletTracer(object): # <<<<<<<<<<<<<< + * def __init__(self): + * # A counter, incremented by the greenlet trace function + */ + +struct __pyx_vtabstruct_6gevent_8__tracer_GreenletTracer { + PyObject *(*_trace)(struct __pyx_obj_6gevent_8__tracer_GreenletTracer *, PyObject *, PyObject *, int __pyx_skip_dispatch); + PyObject *(*did_block_hub)(struct __pyx_obj_6gevent_8__tracer_GreenletTracer *, PyObject *, int __pyx_skip_dispatch); + PyObject *(*kill)(struct __pyx_obj_6gevent_8__tracer_GreenletTracer *, int __pyx_skip_dispatch); +}; +static struct __pyx_vtabstruct_6gevent_8__tracer_GreenletTracer *__pyx_vtabptr_6gevent_8__tracer_GreenletTracer; + + +/* "src/gevent/_tracer.py":122 + * + * + * class _HubTracer(GreenletTracer): # <<<<<<<<<<<<<< + * def __init__(self, hub, max_blocking_time): + * GreenletTracer.__init__(self) + */ + +struct __pyx_vtabstruct_6gevent_8__tracer__HubTracer { + struct __pyx_vtabstruct_6gevent_8__tracer_GreenletTracer __pyx_base; +}; +static struct __pyx_vtabstruct_6gevent_8__tracer__HubTracer *__pyx_vtabptr_6gevent_8__tracer__HubTracer; + + +/* "src/gevent/_tracer.py":133 + * + * + * class HubSwitchTracer(_HubTracer): # <<<<<<<<<<<<<< + * # A greenlet tracer that records the last time we switched *into* the hub. + * + */ + +struct __pyx_vtabstruct_6gevent_8__tracer_HubSwitchTracer { + struct __pyx_vtabstruct_6gevent_8__tracer__HubTracer __pyx_base; +}; +static struct __pyx_vtabstruct_6gevent_8__tracer_HubSwitchTracer *__pyx_vtabptr_6gevent_8__tracer_HubSwitchTracer; + + +/* "src/gevent/_tracer.py":150 + * + * + * class MaxSwitchTracer(_HubTracer): # <<<<<<<<<<<<<< + * # A greenlet tracer that records the maximum time between switches, + * # not including time spent in the hub. + */ + +struct __pyx_vtabstruct_6gevent_8__tracer_MaxSwitchTracer { + struct __pyx_vtabstruct_6gevent_8__tracer__HubTracer __pyx_base; +}; +static struct __pyx_vtabstruct_6gevent_8__tracer_MaxSwitchTracer *__pyx_vtabptr_6gevent_8__tracer_MaxSwitchTracer; + +/* --- Runtime support code (head) --- */ +/* Refnanny.proto */ +#ifndef CYTHON_REFNANNY + #define CYTHON_REFNANNY 0 +#endif +#if CYTHON_REFNANNY + typedef struct { + void (*INCREF)(void*, PyObject*, int); + void (*DECREF)(void*, PyObject*, int); + void (*GOTREF)(void*, PyObject*, int); + void (*GIVEREF)(void*, PyObject*, int); + void* (*SetupContext)(const char*, int, const char*); + void (*FinishContext)(void**); + } __Pyx_RefNannyAPIStruct; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); + #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; +#ifdef WITH_THREAD + #define __Pyx_RefNannySetupContext(name, acquire_gil)\ + if (acquire_gil) {\ + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ + PyGILState_Release(__pyx_gilstate_save);\ + } else {\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ + } +#else + #define __Pyx_RefNannySetupContext(name, acquire_gil)\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) +#endif + #define __Pyx_RefNannyFinishContext()\ + __Pyx_RefNanny->FinishContext(&__pyx_refnanny) + #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0) + #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) + #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) + #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) +#else + #define __Pyx_RefNannyDeclarations + #define __Pyx_RefNannySetupContext(name, acquire_gil) + #define __Pyx_RefNannyFinishContext() + #define __Pyx_INCREF(r) Py_INCREF(r) + #define __Pyx_DECREF(r) Py_DECREF(r) + #define __Pyx_GOTREF(r) + #define __Pyx_GIVEREF(r) + #define __Pyx_XINCREF(r) Py_XINCREF(r) + #define __Pyx_XDECREF(r) Py_XDECREF(r) + #define __Pyx_XGOTREF(r) + #define __Pyx_XGIVEREF(r) +#endif +#define __Pyx_XDECREF_SET(r, v) do {\ + PyObject *tmp = (PyObject *) r;\ + r = v; __Pyx_XDECREF(tmp);\ + } while (0) +#define __Pyx_DECREF_SET(r, v) do {\ + PyObject *tmp = (PyObject *) r;\ + r = v; __Pyx_DECREF(tmp);\ + } while (0) +#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) +#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) + +/* PyObjectGetAttrStr.proto */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); +#else +#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) +#endif + +/* GetBuiltinName.proto */ +static PyObject *__Pyx_GetBuiltinName(PyObject *name); + +/* RaiseArgTupleInvalid.proto */ +static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, + Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); + +/* KeywordStringCheck.proto */ +static int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* function_name, int kw_allowed); + +/* PyCFunctionFastCall.proto */ +#if CYTHON_FAST_PYCCALL +static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs); +#else +#define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL) +#endif + +/* PyFunctionFastCall.proto */ +#if CYTHON_FAST_PYCALL +#define __Pyx_PyFunction_FastCall(func, args, nargs)\ + __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) +#if 1 || PY_VERSION_HEX < 0x030600B1 +static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs); +#else +#define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs) +#endif +#define __Pyx_BUILD_ASSERT_EXPR(cond)\ + (sizeof(char [1 - 2*!(cond)]) - 1) +#ifndef Py_MEMBER_SIZE +#define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member) +#endif + static size_t __pyx_pyframe_localsplus_offset = 0; + #include "frameobject.h" + #define __Pxy_PyFrame_Initialize_Offsets()\ + ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\ + (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus))) + #define __Pyx_PyFrame_GetLocalsplus(frame)\ + (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset)) +#endif + +/* PyObjectCall.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); +#else +#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) +#endif + +/* PyObjectCall2Args.proto */ +static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2); + +/* PyObjectCallMethO.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); +#endif + +/* PyObjectCallOneArg.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); + +/* PyObjectCallNoArg.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); +#else +#define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL) +#endif + +/* IncludeStringH.proto */ +#include + +/* BytesEquals.proto */ +static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); + +/* UnicodeEquals.proto */ +static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); + +/* StrEquals.proto */ +#if PY_MAJOR_VERSION >= 3 +#define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals +#else +#define __Pyx_PyString_Equals __Pyx_PyBytes_Equals +#endif + +/* GetItemInt.proto */ +#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ + __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\ + (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\ + __Pyx_GetItemInt_Generic(o, to_py_func(i)))) +#define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ + __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ + (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL)) +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, + int wraparound, int boundscheck); +#define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ + __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ + (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL)) +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, + int wraparound, int boundscheck); +static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j); +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, + int is_list, int wraparound, int boundscheck); + +/* RaiseDoubleKeywords.proto */ +static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); + +/* ParseKeywords.proto */ +static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\ + PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\ + const char* function_name); + +/* ArgTypeTest.proto */ +#define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\ + ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\ + __Pyx__ArgTypeTest(obj, type, name, exact)) +static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact); + +/* ListAppend.proto */ +#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS +static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) { + PyListObject* L = (PyListObject*) list; + Py_ssize_t len = Py_SIZE(list); + if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) { + Py_INCREF(x); + PyList_SET_ITEM(list, len, x); + Py_SIZE(list) = len+1; + return 0; + } + return PyList_Append(list, x); +} +#else +#define __Pyx_PyList_Append(L,x) PyList_Append(L,x) +#endif + +/* ObjectGetItem.proto */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key); +#else +#define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key) +#endif + +/* GetTopmostException.proto */ +#if CYTHON_USE_EXC_INFO_STACK +static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate); +#endif + +/* PyThreadStateGet.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; +#define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; +#define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type +#else +#define __Pyx_PyThreadState_declare +#define __Pyx_PyThreadState_assign +#define __Pyx_PyErr_Occurred() PyErr_Occurred() +#endif + +/* SaveResetException.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); +#else +#define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb) +#define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb) +#endif + +/* PyErrExceptionMatches.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) +static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); +#else +#define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) +#endif + +/* GetException.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb) +static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#else +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); +#endif + +/* StringJoin.proto */ +#if PY_MAJOR_VERSION < 3 +#define __Pyx_PyString_Join __Pyx_PyBytes_Join +#define __Pyx_PyBaseString_Join(s, v) (PyUnicode_CheckExact(s) ? PyUnicode_Join(s, v) : __Pyx_PyBytes_Join(s, v)) +#else +#define __Pyx_PyString_Join PyUnicode_Join +#define __Pyx_PyBaseString_Join PyUnicode_Join +#endif +#if CYTHON_COMPILING_IN_CPYTHON + #if PY_MAJOR_VERSION < 3 + #define __Pyx_PyBytes_Join _PyString_Join + #else + #define __Pyx_PyBytes_Join _PyBytes_Join + #endif +#else +static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values); +#endif + +/* ListExtend.proto */ +static CYTHON_INLINE int __Pyx_PyList_Extend(PyObject* L, PyObject* v) { +#if CYTHON_COMPILING_IN_CPYTHON + PyObject* none = _PyList_Extend((PyListObject*)L, v); + if (unlikely(!none)) + return -1; + Py_DECREF(none); + return 0; +#else + return PyList_SetSlice(L, PY_SSIZE_T_MAX, PY_SSIZE_T_MAX, v); +#endif +} + +/* PyObject_GenericGetAttrNoDict.proto */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name); +#else +#define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr +#endif + +/* PyObject_GenericGetAttr.proto */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name); +#else +#define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr +#endif + +/* SetVTable.proto */ +static int __Pyx_SetVtable(PyObject *dict, void *vtable); + +/* Import.proto */ +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); + +/* ImportFrom.proto */ +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); + +/* FetchCommonType.proto */ +static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); + +/* CythonFunction.proto */ +#define __Pyx_CyFunction_USED 1 +#define __Pyx_CYFUNCTION_STATICMETHOD 0x01 +#define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 +#define __Pyx_CYFUNCTION_CCLASS 0x04 +#define __Pyx_CyFunction_GetClosure(f)\ + (((__pyx_CyFunctionObject *) (f))->func_closure) +#define __Pyx_CyFunction_GetClassObj(f)\ + (((__pyx_CyFunctionObject *) (f))->func_classobj) +#define __Pyx_CyFunction_Defaults(type, f)\ + ((type *)(((__pyx_CyFunctionObject *) (f))->defaults)) +#define __Pyx_CyFunction_SetDefaultsGetter(f, g)\ + ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g) +typedef struct { + PyCFunctionObject func; +#if PY_VERSION_HEX < 0x030500A0 + PyObject *func_weakreflist; +#endif + PyObject *func_dict; + PyObject *func_name; + PyObject *func_qualname; + PyObject *func_doc; + PyObject *func_globals; + PyObject *func_code; + PyObject *func_closure; + PyObject *func_classobj; + void *defaults; + int defaults_pyobjects; + int flags; + PyObject *defaults_tuple; + PyObject *defaults_kwdict; + PyObject *(*defaults_getter)(PyObject *); + PyObject *func_annotations; +} __pyx_CyFunctionObject; +static PyTypeObject *__pyx_CyFunctionType = 0; +#define __Pyx_CyFunction_Check(obj) (__Pyx_TypeCheck(obj, __pyx_CyFunctionType)) +#define __Pyx_CyFunction_NewEx(ml, flags, qualname, self, module, globals, code)\ + __Pyx_CyFunction_New(__pyx_CyFunctionType, ml, flags, qualname, self, module, globals, code) +static PyObject *__Pyx_CyFunction_New(PyTypeObject *, PyMethodDef *ml, + int flags, PyObject* qualname, + PyObject *self, + PyObject *module, PyObject *globals, + PyObject* code); +static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, + size_t size, + int pyobjects); +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, + PyObject *tuple); +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, + PyObject *dict); +static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m, + PyObject *dict); +static int __pyx_CyFunction_init(void); + +/* GetModuleGlobalName.proto */ +#if CYTHON_USE_DICT_VERSIONS +#define __Pyx_GetModuleGlobalName(var, name) {\ + static PY_UINT64_T __pyx_dict_version = 0;\ + static PyObject *__pyx_dict_cached_value = NULL;\ + (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\ + (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\ + __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ +} +#define __Pyx_GetModuleGlobalNameUncached(var, name) {\ + PY_UINT64_T __pyx_dict_version;\ + PyObject *__pyx_dict_cached_value;\ + (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ +} +static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value); +#else +#define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name) +#define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name) +static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name); +#endif + +/* GetAttr.proto */ +static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *); + +/* Globals.proto */ +static PyObject* __Pyx_Globals(void); + +/* PyErrFetchRestore.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) +#define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) +#define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) +#define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) +#define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); +static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) +#else +#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) +#endif +#else +#define __Pyx_PyErr_Clear() PyErr_Clear() +#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) +#define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) +#define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb) +#define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) +#endif + +/* CLineInTraceback.proto */ +#ifdef CYTHON_CLINE_IN_TRACEBACK +#define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) +#else +static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line); +#endif + +/* CodeObjectCache.proto */ +typedef struct { + PyCodeObject* code_object; + int code_line; +} __Pyx_CodeObjectCacheEntry; +struct __Pyx_CodeObjectCache { + int count; + int max_count; + __Pyx_CodeObjectCacheEntry* entries; +}; +static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); +static PyCodeObject *__pyx_find_code_object(int code_line); +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); + +/* AddTraceback.proto */ +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename); + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); + +/* CIntFromPy.proto */ +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); + +/* CIntFromPy.proto */ +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); + +/* FastTypeChecks.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) +static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b); +static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type); +static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2); +#else +#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) +#define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) +#define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) +#endif +#define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) + +/* CheckBinaryVersion.proto */ +static int __Pyx_check_binary_version(void); + +/* PyObjectSetAttrStr.proto */ +#if CYTHON_USE_TYPE_SLOTS +#define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o, n, NULL) +static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value); +#else +#define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n) +#define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v) +#endif + +/* VoidPtrExport.proto */ +static int __Pyx_ExportVoidPtr(PyObject *name, void *p, const char *sig); + +/* InitStrings.proto */ +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); + +static PyObject *__pyx_f_6gevent_8__tracer_14GreenletTracer_kill(struct __pyx_obj_6gevent_8__tracer_GreenletTracer *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/ +static PyObject *__pyx_f_6gevent_8__tracer_14GreenletTracer__trace(struct __pyx_obj_6gevent_8__tracer_GreenletTracer *__pyx_v_self, PyObject *__pyx_v_event, PyObject *__pyx_v_args, int __pyx_skip_dispatch); /* proto*/ +static PyObject *__pyx_f_6gevent_8__tracer_14GreenletTracer_did_block_hub(struct __pyx_obj_6gevent_8__tracer_GreenletTracer *__pyx_v_self, PyObject *__pyx_v_hub, int __pyx_skip_dispatch); /* proto*/ +static PyObject *__pyx_f_6gevent_8__tracer_10_HubTracer_kill(struct __pyx_obj_6gevent_8__tracer__HubTracer *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/ +static PyObject *__pyx_f_6gevent_8__tracer_15HubSwitchTracer__trace(struct __pyx_obj_6gevent_8__tracer_HubSwitchTracer *__pyx_v_self, PyObject *__pyx_v_event, PyObject *__pyx_v_args, int __pyx_skip_dispatch); /* proto*/ +static PyObject *__pyx_f_6gevent_8__tracer_15HubSwitchTracer_did_block_hub(struct __pyx_obj_6gevent_8__tracer_HubSwitchTracer *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_hub, int __pyx_skip_dispatch); /* proto*/ +static PyObject *__pyx_f_6gevent_8__tracer_15MaxSwitchTracer__trace(struct __pyx_obj_6gevent_8__tracer_MaxSwitchTracer *__pyx_v_self, PyObject *__pyx_v_event, PyObject *__pyx_v_args, int __pyx_skip_dispatch); /* proto*/ +static PyObject *__pyx_f_6gevent_8__tracer_15MaxSwitchTracer_did_block_hub(struct __pyx_obj_6gevent_8__tracer_MaxSwitchTracer *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_hub, int __pyx_skip_dispatch); /* proto*/ + +/* Module declarations from 'cython' */ + +/* Module declarations from 'gevent.__tracer' */ +static PyTypeObject *__pyx_ptype_6gevent_8__tracer_GreenletTracer = 0; +static PyTypeObject *__pyx_ptype_6gevent_8__tracer__HubTracer = 0; +static PyTypeObject *__pyx_ptype_6gevent_8__tracer_HubSwitchTracer = 0; +static PyTypeObject *__pyx_ptype_6gevent_8__tracer_MaxSwitchTracer = 0; +static PyObject *__pyx_v_6gevent_8__tracer_sys = 0; +static PyObject *__pyx_v_6gevent_8__tracer_traceback = 0; +static PyObject *__pyx_v_6gevent_8__tracer_settrace = 0; +static PyObject *__pyx_v_6gevent_8__tracer_getcurrent = 0; +static PyObject *__pyx_v_6gevent_8__tracer_format_run_info = 0; +static PyObject *__pyx_v_6gevent_8__tracer_perf_counter = 0; +static PyObject *__pyx_v_6gevent_8__tracer_gmctime = 0; +#define __Pyx_MODULE_NAME "gevent.__tracer" +extern int __pyx_module_is_main_gevent____tracer; +int __pyx_module_is_main_gevent____tracer = 0; + +/* Implementation of 'gevent.__tracer' */ +static PyObject *__pyx_builtin_KeyError; +static PyObject *__pyx_builtin_hex; +#if PY_MAJOR_VERSION >= 3 +static const char __pyx_k_[] = "================================================================================"; +#endif +#if PY_MAJOR_VERSION < 3 +static const char __pyx_k_b[] = "b'================================================================================'"; +#endif +static const char __pyx_k__2[] = ""; +static const char __pyx_k_all[] = "__all__"; +static const char __pyx_k_hex[] = "hex"; +static const char __pyx_k_hub[] = "hub"; +static const char __pyx_k_sys[] = "sys"; +static const char __pyx_k_Info[] = "Info:"; +static const char __pyx_k_args[] = "args"; +static const char __pyx_k_init[] = "__init__"; +static const char __pyx_k_join[] = "join"; +static const char __pyx_k_kill[] = "kill"; +static const char __pyx_k_main[] = "__main__"; +static const char __pyx_k_name[] = "__name__"; +static const char __pyx_k_self[] = "self"; +static const char __pyx_k_test[] = "__test__"; +static const char __pyx_k_event[] = "event"; +static const char __pyx_k_frame[] = "frame"; +static const char __pyx_k_stack[] = "stack"; +static const char __pyx_k_throw[] = "throw"; +static const char __pyx_k_trace[] = "_trace"; +static const char __pyx_k_import[] = "__import__"; +static const char __pyx_k_report[] = "report"; +static const char __pyx_k_switch[] = "switch"; +static const char __pyx_k_gmctime[] = "gmctime"; +static const char __pyx_k_KeyError[] = "KeyError"; +static const char __pyx_k_greenlet[] = "greenlet"; +static const char __pyx_k_pyx_capi[] = "__pyx_capi__"; +static const char __pyx_k_settrace[] = "settrace"; +static const char __pyx_k_HubTracer[] = "_HubTracer"; +static const char __pyx_k_traceback[] = "traceback"; +static const char __pyx_k_getcurrent[] = "getcurrent"; +static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__"; +static const char __pyx_k_gevent_util[] = "gevent.util"; +static const char __pyx_k_format_stack[] = "format_stack"; +static const char __pyx_k_gevent__util[] = "gevent._util"; +static const char __pyx_k_perf_counter[] = "perf_counter"; +static const char __pyx_k_thread_ident[] = "thread_ident"; +static const char __pyx_k_Reported_by_s[] = " Reported by %s"; +static const char __pyx_k_did_block_hub[] = "did_block_hub"; +static const char __pyx_k_format_kwargs[] = "format_kwargs"; +static const char __pyx_k_GreenletTracer[] = "GreenletTracer"; +static const char __pyx_k_HubTracer_kill[] = "_HubTracer.kill"; +static const char __pyx_k_current_frames[] = "_current_frames"; +static const char __pyx_k_gevent__compat[] = "gevent._compat"; +static const char __pyx_k_import_c_accel[] = "import_c_accel"; +static const char __pyx_k_HubSwitchTracer[] = "HubSwitchTracer"; +static const char __pyx_k_MaxSwitchTracer[] = "MaxSwitchTracer"; +static const char __pyx_k_active_greenlet[] = "active_greenlet"; +static const char __pyx_k_format_run_info[] = "format_run_info"; +static const char __pyx_k_gevent___tracer[] = "gevent.__tracer"; +static const char __pyx_k_max_blocking_time[] = "max_blocking_time"; +static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; +static const char __pyx_k_GreenletTracer_kill[] = "GreenletTracer.kill"; +static const char __pyx_k_did_block_hub_report[] = "did_block_hub_report"; +static const char __pyx_k_GreenletTracer__trace[] = "GreenletTracer._trace"; +static const char __pyx_k_src_gevent__tracer_py[] = "src\\gevent\\_tracer.py"; +static const char __pyx_k_HubSwitchTracer__trace[] = "HubSwitchTracer._trace"; +static const char __pyx_k_MaxSwitchTracer__trace[] = "MaxSwitchTracer._trace"; +static const char __pyx_k_GreenletTracer_did_block_hub[] = "GreenletTracer.did_block_hub"; +static const char __pyx_k_Blocked_Stack_for_thread_id_s[] = "Blocked Stack (for thread id %s):"; +static const char __pyx_k_HubSwitchTracer_did_block_hub[] = "HubSwitchTracer.did_block_hub"; +static const char __pyx_k_MaxSwitchTracer_did_block_hub[] = "MaxSwitchTracer.did_block_hub"; +static const char __pyx_k_Unknown_No_thread_found_for_hub[] = "Unknown: No thread found for hub %r\n"; +static const char __pyx_k_s_Greenlet_s_appears_to_be_bloc[] = "\n%s : Greenlet %s appears to be blocked"; +static const char __pyx_k_GreenletTracer_did_block_hub_rep[] = "GreenletTracer.did_block_hub_report"; +static const char __pyx_k_GreenletTracer_ignore_current_gr[] = "GreenletTracer.ignore_current_greenlet_blocking"; +static const char __pyx_k_GreenletTracer_monitor_current_g[] = "GreenletTracer.monitor_current_greenlet_blocking"; +static const char __pyx_k_ignore_current_greenlet_blocking[] = "ignore_current_greenlet_blocking"; +static const char __pyx_k_monitor_current_greenlet_blockin[] = "monitor_current_greenlet_blocking"; +static PyObject *__pyx_kp_s_Blocked_Stack_for_thread_id_s; +static PyObject *__pyx_n_s_GreenletTracer; +static PyObject *__pyx_n_s_GreenletTracer__trace; +static PyObject *__pyx_n_s_GreenletTracer_did_block_hub; +static PyObject *__pyx_n_s_GreenletTracer_did_block_hub_rep; +static PyObject *__pyx_n_s_GreenletTracer_ignore_current_gr; +static PyObject *__pyx_n_s_GreenletTracer_kill; +static PyObject *__pyx_n_s_GreenletTracer_monitor_current_g; +static PyObject *__pyx_n_s_HubSwitchTracer; +static PyObject *__pyx_n_s_HubSwitchTracer__trace; +static PyObject *__pyx_n_s_HubSwitchTracer_did_block_hub; +static PyObject *__pyx_n_s_HubTracer; +static PyObject *__pyx_n_s_HubTracer_kill; +static PyObject *__pyx_kp_s_Info; +static PyObject *__pyx_n_s_KeyError; +static PyObject *__pyx_n_s_MaxSwitchTracer; +static PyObject *__pyx_n_s_MaxSwitchTracer__trace; +static PyObject *__pyx_n_s_MaxSwitchTracer_did_block_hub; +static PyObject *__pyx_kp_s_Reported_by_s; +static PyObject *__pyx_kp_s_Unknown_No_thread_found_for_hub; +static PyObject *__pyx_kp_s__2; +static PyObject *__pyx_n_s_active_greenlet; +static PyObject *__pyx_n_s_all; +static PyObject *__pyx_n_s_args; +static PyObject *__pyx_kp_s_b; +static PyObject *__pyx_n_s_cline_in_traceback; +static PyObject *__pyx_n_s_current_frames; +static PyObject *__pyx_n_s_did_block_hub; +static PyObject *__pyx_n_s_did_block_hub_report; +static PyObject *__pyx_n_s_event; +static PyObject *__pyx_n_s_format_kwargs; +static PyObject *__pyx_n_s_format_run_info; +static PyObject *__pyx_n_s_format_stack; +static PyObject *__pyx_n_s_frame; +static PyObject *__pyx_n_s_getcurrent; +static PyObject *__pyx_n_s_gevent___tracer; +static PyObject *__pyx_n_s_gevent__compat; +static PyObject *__pyx_n_s_gevent__util; +static PyObject *__pyx_n_s_gevent_util; +static PyObject *__pyx_n_s_gmctime; +static PyObject *__pyx_n_s_greenlet; +static PyObject *__pyx_n_s_hex; +static PyObject *__pyx_n_s_hub; +static PyObject *__pyx_n_s_ignore_current_greenlet_blocking; +static PyObject *__pyx_n_s_import; +static PyObject *__pyx_n_s_import_c_accel; +static PyObject *__pyx_n_s_init; +static PyObject *__pyx_n_s_join; +static PyObject *__pyx_n_s_kill; +static PyObject *__pyx_n_s_main; +static PyObject *__pyx_n_s_max_blocking_time; +static PyObject *__pyx_n_s_monitor_current_greenlet_blockin; +static PyObject *__pyx_n_s_name; +static PyObject *__pyx_n_s_perf_counter; +static PyObject *__pyx_n_s_pyx_capi; +static PyObject *__pyx_n_s_pyx_vtable; +static PyObject *__pyx_n_s_report; +static PyObject *__pyx_kp_s_s_Greenlet_s_appears_to_be_bloc; +static PyObject *__pyx_n_s_self; +static PyObject *__pyx_n_s_settrace; +static PyObject *__pyx_kp_s_src_gevent__tracer_py; +static PyObject *__pyx_n_s_stack; +static PyObject *__pyx_n_s_switch; +static PyObject *__pyx_n_s_sys; +static PyObject *__pyx_n_s_test; +static PyObject *__pyx_n_s_thread_ident; +static PyObject *__pyx_n_s_throw; +static PyObject *__pyx_n_s_trace; +static PyObject *__pyx_n_s_traceback; +static int __pyx_pf_6gevent_8__tracer_14GreenletTracer___init__(struct __pyx_obj_6gevent_8__tracer_GreenletTracer *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_8__tracer_14GreenletTracer_2kill(struct __pyx_obj_6gevent_8__tracer_GreenletTracer *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_8__tracer_14GreenletTracer_4_trace(struct __pyx_obj_6gevent_8__tracer_GreenletTracer *__pyx_v_self, PyObject *__pyx_v_event, PyObject *__pyx_v_args); /* proto */ +static PyObject *__pyx_pf_6gevent_8__tracer_14GreenletTracer_6__call__(struct __pyx_obj_6gevent_8__tracer_GreenletTracer *__pyx_v_self, PyObject *__pyx_v_event, PyObject *__pyx_v_args); /* proto */ +static PyObject *__pyx_pf_6gevent_8__tracer_14GreenletTracer_8did_block_hub(struct __pyx_obj_6gevent_8__tracer_GreenletTracer *__pyx_v_self, PyObject *__pyx_v_hub); /* proto */ +static PyObject *__pyx_pf_6gevent_8__tracer_14GreenletTracer_10ignore_current_greenlet_blocking(struct __pyx_obj_6gevent_8__tracer_GreenletTracer *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_8__tracer_14GreenletTracer_12monitor_current_greenlet_blocking(struct __pyx_obj_6gevent_8__tracer_GreenletTracer *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_8__tracer_14GreenletTracer_14did_block_hub_report(struct __pyx_obj_6gevent_8__tracer_GreenletTracer *__pyx_v_self, PyObject *__pyx_v_hub, PyObject *__pyx_v_active_greenlet, PyObject *__pyx_v_format_kwargs); /* proto */ +static PyObject *__pyx_pf_6gevent_8__tracer_14GreenletTracer_15active_greenlet___get__(struct __pyx_obj_6gevent_8__tracer_GreenletTracer *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_8__tracer_14GreenletTracer_23previous_trace_function___get__(struct __pyx_obj_6gevent_8__tracer_GreenletTracer *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_8__tracer_14GreenletTracer_23greenlet_switch_counter___get__(struct __pyx_obj_6gevent_8__tracer_GreenletTracer *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_8__tracer_10_HubTracer___init__(struct __pyx_obj_6gevent_8__tracer__HubTracer *__pyx_v_self, PyObject *__pyx_v_hub, PyObject *__pyx_v_max_blocking_time); /* proto */ +static PyObject *__pyx_pf_6gevent_8__tracer_10_HubTracer_2kill(struct __pyx_obj_6gevent_8__tracer__HubTracer *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_8__tracer_10_HubTracer_3hub___get__(struct __pyx_obj_6gevent_8__tracer__HubTracer *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_8__tracer_10_HubTracer_17max_blocking_time___get__(struct __pyx_obj_6gevent_8__tracer__HubTracer *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_8__tracer_15HubSwitchTracer___init__(struct __pyx_obj_6gevent_8__tracer_HubSwitchTracer *__pyx_v_self, PyObject *__pyx_v_hub, PyObject *__pyx_v_max_blocking_time); /* proto */ +static PyObject *__pyx_pf_6gevent_8__tracer_15HubSwitchTracer_2_trace(struct __pyx_obj_6gevent_8__tracer_HubSwitchTracer *__pyx_v_self, PyObject *__pyx_v_event, PyObject *__pyx_v_args); /* proto */ +static PyObject *__pyx_pf_6gevent_8__tracer_15HubSwitchTracer_4did_block_hub(struct __pyx_obj_6gevent_8__tracer_HubSwitchTracer *__pyx_v_self, PyObject *__pyx_v_hub); /* proto */ +static PyObject *__pyx_pf_6gevent_8__tracer_15HubSwitchTracer_16last_entered_hub___get__(struct __pyx_obj_6gevent_8__tracer_HubSwitchTracer *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_8__tracer_15MaxSwitchTracer___init__(struct __pyx_obj_6gevent_8__tracer_MaxSwitchTracer *__pyx_v_self, PyObject *__pyx_v_hub, PyObject *__pyx_v_max_blocking_time); /* proto */ +static PyObject *__pyx_pf_6gevent_8__tracer_15MaxSwitchTracer_2_trace(struct __pyx_obj_6gevent_8__tracer_MaxSwitchTracer *__pyx_v_self, PyObject *__pyx_v_event, PyObject *__pyx_v_args); /* proto */ +static PyObject *__pyx_pf_6gevent_8__tracer_15MaxSwitchTracer_4did_block_hub(struct __pyx_obj_6gevent_8__tracer_MaxSwitchTracer *__pyx_v_self, PyObject *__pyx_v_hub); /* proto */ +static PyObject *__pyx_pf_6gevent_8__tracer_15MaxSwitchTracer_12max_blocking___get__(struct __pyx_obj_6gevent_8__tracer_MaxSwitchTracer *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_8__tracer_15MaxSwitchTracer_11last_switch___get__(struct __pyx_obj_6gevent_8__tracer_MaxSwitchTracer *__pyx_v_self); /* proto */ +static PyObject *__pyx_tp_new_6gevent_8__tracer_GreenletTracer(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6gevent_8__tracer__HubTracer(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6gevent_8__tracer_HubSwitchTracer(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6gevent_8__tracer_MaxSwitchTracer(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tuple__3; +static PyObject *__pyx_tuple__5; +static PyObject *__pyx_tuple__7; +static PyObject *__pyx_tuple__9; +static PyObject *__pyx_tuple__11; +static PyObject *__pyx_tuple__13; +static PyObject *__pyx_tuple__15; +static PyObject *__pyx_tuple__17; +static PyObject *__pyx_tuple__19; +static PyObject *__pyx_tuple__21; +static PyObject *__pyx_tuple__23; +static PyObject *__pyx_codeobj__4; +static PyObject *__pyx_codeobj__6; +static PyObject *__pyx_codeobj__8; +static PyObject *__pyx_codeobj__10; +static PyObject *__pyx_codeobj__12; +static PyObject *__pyx_codeobj__14; +static PyObject *__pyx_codeobj__16; +static PyObject *__pyx_codeobj__18; +static PyObject *__pyx_codeobj__20; +static PyObject *__pyx_codeobj__22; +static PyObject *__pyx_codeobj__24; +/* Late includes */ + +/* "src/gevent/_tracer.py":28 + * + * class GreenletTracer(object): + * def __init__(self): # <<<<<<<<<<<<<< + * # A counter, incremented by the greenlet trace function + * # we install on every greenlet switch. This is reset when the + */ + +/* Python wrapper */ +static int __pyx_pw_6gevent_8__tracer_14GreenletTracer_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6gevent_8__tracer_14GreenletTracer_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { + __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;} + if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1; + __pyx_r = __pyx_pf_6gevent_8__tracer_14GreenletTracer___init__(((struct __pyx_obj_6gevent_8__tracer_GreenletTracer *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_8__tracer_14GreenletTracer___init__(struct __pyx_obj_6gevent_8__tracer_GreenletTracer *__pyx_v_self) { + PyObject *__pyx_v_prev_trace = NULL; + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "src/gevent/_tracer.py":33 + * # periodic monitoring thread runs. + * + * self.greenlet_switch_counter = 0 # <<<<<<<<<<<<<< + * + * # The greenlet last switched to. + */ + __pyx_v_self->greenlet_switch_counter = 0; + + /* "src/gevent/_tracer.py":36 + * + * # The greenlet last switched to. + * self.active_greenlet = None # <<<<<<<<<<<<<< + * + * # The trace function that was previously installed, + */ + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->active_greenlet); + __Pyx_DECREF(__pyx_v_self->active_greenlet); + __pyx_v_self->active_greenlet = Py_None; + + /* "src/gevent/_tracer.py":43 + * # calling a bound method (at least when compiled with cython) + * # even when it redirects to another function. + * prev_trace = settrace(self) # <<<<<<<<<<<<<< + * + * self.previous_trace_function = prev_trace + */ + __Pyx_INCREF(__pyx_v_6gevent_8__tracer_settrace); + __pyx_t_2 = __pyx_v_6gevent_8__tracer_settrace; __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, ((PyObject *)__pyx_v_self)) : __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_v_self)); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 43, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_prev_trace = __pyx_t_1; + __pyx_t_1 = 0; + + /* "src/gevent/_tracer.py":45 + * prev_trace = settrace(self) + * + * self.previous_trace_function = prev_trace # <<<<<<<<<<<<<< + * + * self._killed = False + */ + __Pyx_INCREF(__pyx_v_prev_trace); + __Pyx_GIVEREF(__pyx_v_prev_trace); + __Pyx_GOTREF(__pyx_v_self->previous_trace_function); + __Pyx_DECREF(__pyx_v_self->previous_trace_function); + __pyx_v_self->previous_trace_function = __pyx_v_prev_trace; + + /* "src/gevent/_tracer.py":47 + * self.previous_trace_function = prev_trace + * + * self._killed = False # <<<<<<<<<<<<<< + * + * def kill(self): + */ + __pyx_v_self->_killed = 0; + + /* "src/gevent/_tracer.py":28 + * + * class GreenletTracer(object): + * def __init__(self): # <<<<<<<<<<<<<< + * # A counter, incremented by the greenlet trace function + * # we install on every greenlet switch. This is reset when the + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("gevent.__tracer.GreenletTracer.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_prev_trace); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_tracer.py":49 + * self._killed = False + * + * def kill(self): # <<<<<<<<<<<<<< + * # Must be called in the monitored thread. + * if not self._killed: + */ + +static PyObject *__pyx_pw_6gevent_8__tracer_14GreenletTracer_3kill(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_f_6gevent_8__tracer_14GreenletTracer_kill(struct __pyx_obj_6gevent_8__tracer_GreenletTracer *__pyx_v_self, int __pyx_skip_dispatch) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + __Pyx_RefNannySetupContext("kill", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0; + if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self)))))); + else { + PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + #endif + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_kill); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 49, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_8__tracer_14GreenletTracer_3kill)) { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 49, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0; + if (unlikely(type_dict_guard != tp_dict_version)) { + tp_dict_version = obj_dict_version = 0; + } + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + } + #endif + } + + /* "src/gevent/_tracer.py":51 + * def kill(self): + * # Must be called in the monitored thread. + * if not self._killed: # <<<<<<<<<<<<<< + * self._killed = True + * settrace(self.previous_trace_function) + */ + __pyx_t_5 = ((!(__pyx_v_self->_killed != 0)) != 0); + if (__pyx_t_5) { + + /* "src/gevent/_tracer.py":52 + * # Must be called in the monitored thread. + * if not self._killed: + * self._killed = True # <<<<<<<<<<<<<< + * settrace(self.previous_trace_function) + * self.previous_trace_function = None + */ + __pyx_v_self->_killed = 1; + + /* "src/gevent/_tracer.py":53 + * if not self._killed: + * self._killed = True + * settrace(self.previous_trace_function) # <<<<<<<<<<<<<< + * self.previous_trace_function = None + * + */ + __Pyx_INCREF(__pyx_v_6gevent_8__tracer_settrace); + __pyx_t_2 = __pyx_v_6gevent_8__tracer_settrace; __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_self->previous_trace_function) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_self->previous_trace_function); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 53, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_tracer.py":54 + * self._killed = True + * settrace(self.previous_trace_function) + * self.previous_trace_function = None # <<<<<<<<<<<<<< + * + * def _trace(self, event, args): + */ + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->previous_trace_function); + __Pyx_DECREF(__pyx_v_self->previous_trace_function); + __pyx_v_self->previous_trace_function = Py_None; + + /* "src/gevent/_tracer.py":51 + * def kill(self): + * # Must be called in the monitored thread. + * if not self._killed: # <<<<<<<<<<<<<< + * self._killed = True + * settrace(self.previous_trace_function) + */ + } + + /* "src/gevent/_tracer.py":49 + * self._killed = False + * + * def kill(self): # <<<<<<<<<<<<<< + * # Must be called in the monitored thread. + * if not self._killed: + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("gevent.__tracer.GreenletTracer.kill", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_8__tracer_14GreenletTracer_3kill(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6gevent_8__tracer_14GreenletTracer_2kill[] = "GreenletTracer.kill(self)"; +static PyMethodDef __pyx_mdef_6gevent_8__tracer_14GreenletTracer_3kill = {"kill", (PyCFunction)__pyx_pw_6gevent_8__tracer_14GreenletTracer_3kill, METH_NOARGS, __pyx_doc_6gevent_8__tracer_14GreenletTracer_2kill}; +static PyObject *__pyx_pw_6gevent_8__tracer_14GreenletTracer_3kill(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("kill (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_8__tracer_14GreenletTracer_2kill(((struct __pyx_obj_6gevent_8__tracer_GreenletTracer *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_8__tracer_14GreenletTracer_2kill(struct __pyx_obj_6gevent_8__tracer_GreenletTracer *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("kill", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6gevent_8__tracer_14GreenletTracer_kill(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 49, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__tracer.GreenletTracer.kill", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_tracer.py":56 + * self.previous_trace_function = None + * + * def _trace(self, event, args): # <<<<<<<<<<<<<< + * # This function runs in the thread we are monitoring. + * self.greenlet_switch_counter += 1 + */ + +static PyObject *__pyx_pw_6gevent_8__tracer_14GreenletTracer_5_trace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_6gevent_8__tracer_14GreenletTracer__trace(struct __pyx_obj_6gevent_8__tracer_GreenletTracer *__pyx_v_self, PyObject *__pyx_v_event, PyObject *__pyx_v_args, int __pyx_skip_dispatch) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + int __pyx_t_8; + int __pyx_t_9; + int __pyx_t_10; + __Pyx_RefNannySetupContext("_trace", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0; + if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self)))))); + else { + PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + #endif + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_trace); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 56, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_8__tracer_14GreenletTracer_5_trace)) { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; + __pyx_t_5 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_5 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_3)) { + PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_event, __pyx_v_args}; + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 56, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GOTREF(__pyx_t_2); + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { + PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_event, __pyx_v_args}; + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 56, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GOTREF(__pyx_t_2); + } else + #endif + { + __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 56, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (__pyx_t_4) { + __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL; + } + __Pyx_INCREF(__pyx_v_event); + __Pyx_GIVEREF(__pyx_v_event); + PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_event); + __Pyx_INCREF(__pyx_v_args); + __Pyx_GIVEREF(__pyx_v_args); + PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_args); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 56, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0; + if (unlikely(type_dict_guard != tp_dict_version)) { + tp_dict_version = obj_dict_version = 0; + } + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + } + #endif + } + + /* "src/gevent/_tracer.py":58 + * def _trace(self, event, args): + * # This function runs in the thread we are monitoring. + * self.greenlet_switch_counter += 1 # <<<<<<<<<<<<<< + * if event in ('switch', 'throw'): + * # args is (origin, target). This is the only defined + */ + __pyx_v_self->greenlet_switch_counter = (__pyx_v_self->greenlet_switch_counter + 1); + + /* "src/gevent/_tracer.py":59 + * # This function runs in the thread we are monitoring. + * self.greenlet_switch_counter += 1 + * if event in ('switch', 'throw'): # <<<<<<<<<<<<<< + * # args is (origin, target). This is the only defined + * # case + */ + __Pyx_INCREF(__pyx_v_event); + __pyx_t_7 = __pyx_v_event; + __pyx_t_9 = (__Pyx_PyString_Equals(__pyx_t_7, __pyx_n_s_switch, Py_EQ)); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 59, __pyx_L1_error) + __pyx_t_10 = (__pyx_t_9 != 0); + if (!__pyx_t_10) { + } else { + __pyx_t_8 = __pyx_t_10; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_10 = (__Pyx_PyString_Equals(__pyx_t_7, __pyx_n_s_throw, Py_EQ)); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 59, __pyx_L1_error) + __pyx_t_9 = (__pyx_t_10 != 0); + __pyx_t_8 = __pyx_t_9; + __pyx_L4_bool_binop_done:; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_9 = (__pyx_t_8 != 0); + if (__pyx_t_9) { + + /* "src/gevent/_tracer.py":62 + * # args is (origin, target). This is the only defined + * # case + * self.active_greenlet = args[1] # <<<<<<<<<<<<<< + * else: + * self.active_greenlet = None + */ + if (unlikely(__pyx_v_args == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 62, __pyx_L1_error) + } + __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v_args, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 62, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_self->active_greenlet); + __Pyx_DECREF(__pyx_v_self->active_greenlet); + __pyx_v_self->active_greenlet = __pyx_t_1; + __pyx_t_1 = 0; + + /* "src/gevent/_tracer.py":59 + * # This function runs in the thread we are monitoring. + * self.greenlet_switch_counter += 1 + * if event in ('switch', 'throw'): # <<<<<<<<<<<<<< + * # args is (origin, target). This is the only defined + * # case + */ + goto __pyx_L3; + } + + /* "src/gevent/_tracer.py":64 + * self.active_greenlet = args[1] + * else: + * self.active_greenlet = None # <<<<<<<<<<<<<< + * if self.previous_trace_function is not None: + * self.previous_trace_function(event, args) + */ + /*else*/ { + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->active_greenlet); + __Pyx_DECREF(__pyx_v_self->active_greenlet); + __pyx_v_self->active_greenlet = Py_None; + } + __pyx_L3:; + + /* "src/gevent/_tracer.py":65 + * else: + * self.active_greenlet = None + * if self.previous_trace_function is not None: # <<<<<<<<<<<<<< + * self.previous_trace_function(event, args) + * + */ + __pyx_t_9 = (__pyx_v_self->previous_trace_function != Py_None); + __pyx_t_8 = (__pyx_t_9 != 0); + if (__pyx_t_8) { + + /* "src/gevent/_tracer.py":66 + * self.active_greenlet = None + * if self.previous_trace_function is not None: + * self.previous_trace_function(event, args) # <<<<<<<<<<<<<< + * + * def __call__(self, event, args): + */ + __Pyx_INCREF(__pyx_v_self->previous_trace_function); + __pyx_t_2 = __pyx_v_self->previous_trace_function; __pyx_t_3 = NULL; + __pyx_t_5 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_5 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_event, __pyx_v_args}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 66, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_event, __pyx_v_args}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 66, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else + #endif + { + __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 66, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (__pyx_t_3) { + __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); __pyx_t_3 = NULL; + } + __Pyx_INCREF(__pyx_v_event); + __Pyx_GIVEREF(__pyx_v_event); + PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_event); + __Pyx_INCREF(__pyx_v_args); + __Pyx_GIVEREF(__pyx_v_args); + PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_args); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 66, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_tracer.py":65 + * else: + * self.active_greenlet = None + * if self.previous_trace_function is not None: # <<<<<<<<<<<<<< + * self.previous_trace_function(event, args) + * + */ + } + + /* "src/gevent/_tracer.py":56 + * self.previous_trace_function = None + * + * def _trace(self, event, args): # <<<<<<<<<<<<<< + * # This function runs in the thread we are monitoring. + * self.greenlet_switch_counter += 1 + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("gevent.__tracer.GreenletTracer._trace", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_8__tracer_14GreenletTracer_5_trace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6gevent_8__tracer_14GreenletTracer_4_trace[] = "GreenletTracer._trace(self, str event, tuple args)"; +static PyMethodDef __pyx_mdef_6gevent_8__tracer_14GreenletTracer_5_trace = {"_trace", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_8__tracer_14GreenletTracer_5_trace, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_8__tracer_14GreenletTracer_4_trace}; +static PyObject *__pyx_pw_6gevent_8__tracer_14GreenletTracer_5_trace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_event = 0; + PyObject *__pyx_v_args = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_trace (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_event,&__pyx_n_s_args,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_event)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("_trace", 1, 2, 2, 1); __PYX_ERR(0, 56, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_trace") < 0)) __PYX_ERR(0, 56, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_event = ((PyObject*)values[0]); + __pyx_v_args = ((PyObject*)values[1]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("_trace", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 56, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.__tracer.GreenletTracer._trace", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_event), (&PyString_Type), 1, "event", 1))) __PYX_ERR(0, 56, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_args), (&PyTuple_Type), 1, "args", 1))) __PYX_ERR(0, 56, __pyx_L1_error) + __pyx_r = __pyx_pf_6gevent_8__tracer_14GreenletTracer_4_trace(((struct __pyx_obj_6gevent_8__tracer_GreenletTracer *)__pyx_v_self), __pyx_v_event, __pyx_v_args); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_8__tracer_14GreenletTracer_4_trace(struct __pyx_obj_6gevent_8__tracer_GreenletTracer *__pyx_v_self, PyObject *__pyx_v_event, PyObject *__pyx_v_args) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("_trace", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6gevent_8__tracer_14GreenletTracer__trace(__pyx_v_self, __pyx_v_event, __pyx_v_args, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 56, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__tracer.GreenletTracer._trace", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_tracer.py":68 + * self.previous_trace_function(event, args) + * + * def __call__(self, event, args): # <<<<<<<<<<<<<< + * return self._trace(event, args) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_8__tracer_14GreenletTracer_7__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6gevent_8__tracer_14GreenletTracer_7__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_event = 0; + PyObject *__pyx_v_args = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__call__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_event,&__pyx_n_s_args,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_event)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__call__", 1, 2, 2, 1); __PYX_ERR(0, 68, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__call__") < 0)) __PYX_ERR(0, 68, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_event = values[0]; + __pyx_v_args = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__call__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 68, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.__tracer.GreenletTracer.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_8__tracer_14GreenletTracer_6__call__(((struct __pyx_obj_6gevent_8__tracer_GreenletTracer *)__pyx_v_self), __pyx_v_event, __pyx_v_args); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_8__tracer_14GreenletTracer_6__call__(struct __pyx_obj_6gevent_8__tracer_GreenletTracer *__pyx_v_self, PyObject *__pyx_v_event, PyObject *__pyx_v_args) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__call__", 0); + + /* "src/gevent/_tracer.py":69 + * + * def __call__(self, event, args): + * return self._trace(event, args) # <<<<<<<<<<<<<< + * + * def did_block_hub(self, hub): + */ + __Pyx_XDECREF(__pyx_r); + if (!(likely(PyString_CheckExact(__pyx_v_event))||((__pyx_v_event) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_v_event)->tp_name), 0))) __PYX_ERR(0, 69, __pyx_L1_error) + if (!(likely(PyTuple_CheckExact(__pyx_v_args))||((__pyx_v_args) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v_args)->tp_name), 0))) __PYX_ERR(0, 69, __pyx_L1_error) + __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_8__tracer_GreenletTracer *)__pyx_v_self->__pyx_vtab)->_trace(__pyx_v_self, ((PyObject*)__pyx_v_event), ((PyObject*)__pyx_v_args), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 69, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "src/gevent/_tracer.py":68 + * self.previous_trace_function(event, args) + * + * def __call__(self, event, args): # <<<<<<<<<<<<<< + * return self._trace(event, args) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__tracer.GreenletTracer.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_tracer.py":71 + * return self._trace(event, args) + * + * def did_block_hub(self, hub): # <<<<<<<<<<<<<< + * # Check to see if we have blocked since the last call to this + * # method. Returns a true value if we blocked (not in the hub), + */ + +static PyObject *__pyx_pw_6gevent_8__tracer_14GreenletTracer_9did_block_hub(PyObject *__pyx_v_self, PyObject *__pyx_v_hub); /*proto*/ +static PyObject *__pyx_f_6gevent_8__tracer_14GreenletTracer_did_block_hub(struct __pyx_obj_6gevent_8__tracer_GreenletTracer *__pyx_v_self, PyObject *__pyx_v_hub, int __pyx_skip_dispatch) { + int __pyx_v_did_switch; + PyObject *__pyx_v_active_greenlet = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + int __pyx_t_6; + int __pyx_t_7; + __Pyx_RefNannySetupContext("did_block_hub", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0; + if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self)))))); + else { + PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + #endif + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_did_block_hub); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 71, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_8__tracer_14GreenletTracer_9did_block_hub)) { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_hub) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_hub); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 71, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0; + if (unlikely(type_dict_guard != tp_dict_version)) { + tp_dict_version = obj_dict_version = 0; + } + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + } + #endif + } + + /* "src/gevent/_tracer.py":82 + * # annoying false positives. + * + * active_greenlet = self.active_greenlet # <<<<<<<<<<<<<< + * did_switch = self.greenlet_switch_counter != 0 + * self.greenlet_switch_counter = 0 + */ + __pyx_t_1 = __pyx_v_self->active_greenlet; + __Pyx_INCREF(__pyx_t_1); + __pyx_v_active_greenlet = __pyx_t_1; + __pyx_t_1 = 0; + + /* "src/gevent/_tracer.py":83 + * + * active_greenlet = self.active_greenlet + * did_switch = self.greenlet_switch_counter != 0 # <<<<<<<<<<<<<< + * self.greenlet_switch_counter = 0 + * + */ + __pyx_v_did_switch = (__pyx_v_self->greenlet_switch_counter != 0); + + /* "src/gevent/_tracer.py":84 + * active_greenlet = self.active_greenlet + * did_switch = self.greenlet_switch_counter != 0 + * self.greenlet_switch_counter = 0 # <<<<<<<<<<<<<< + * + * if did_switch or active_greenlet is None or active_greenlet is hub: + */ + __pyx_v_self->greenlet_switch_counter = 0; + + /* "src/gevent/_tracer.py":86 + * self.greenlet_switch_counter = 0 + * + * if did_switch or active_greenlet is None or active_greenlet is hub: # <<<<<<<<<<<<<< + * # Either we switched, or nothing is running (we got a + * # trace event we don't know about or were requested to + */ + __pyx_t_6 = (__pyx_v_did_switch != 0); + if (!__pyx_t_6) { + } else { + __pyx_t_5 = __pyx_t_6; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_6 = (__pyx_v_active_greenlet == Py_None); + __pyx_t_7 = (__pyx_t_6 != 0); + if (!__pyx_t_7) { + } else { + __pyx_t_5 = __pyx_t_7; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_7 = (__pyx_v_active_greenlet == __pyx_v_hub); + __pyx_t_6 = (__pyx_t_7 != 0); + __pyx_t_5 = __pyx_t_6; + __pyx_L4_bool_binop_done:; + if (__pyx_t_5) { + + /* "src/gevent/_tracer.py":91 + * # ignore), or we spent the whole time in the hub, blocked + * # for IO. Nothing to report. + * return False # <<<<<<<<<<<<<< + * return True, active_greenlet + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + + /* "src/gevent/_tracer.py":86 + * self.greenlet_switch_counter = 0 + * + * if did_switch or active_greenlet is None or active_greenlet is hub: # <<<<<<<<<<<<<< + * # Either we switched, or nothing is running (we got a + * # trace event we don't know about or were requested to + */ + } + + /* "src/gevent/_tracer.py":92 + * # for IO. Nothing to report. + * return False + * return True, active_greenlet # <<<<<<<<<<<<<< + * + * def ignore_current_greenlet_blocking(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 92, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(Py_True); + __Pyx_GIVEREF(Py_True); + PyTuple_SET_ITEM(__pyx_t_1, 0, Py_True); + __Pyx_INCREF(__pyx_v_active_greenlet); + __Pyx_GIVEREF(__pyx_v_active_greenlet); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_active_greenlet); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "src/gevent/_tracer.py":71 + * return self._trace(event, args) + * + * def did_block_hub(self, hub): # <<<<<<<<<<<<<< + * # Check to see if we have blocked since the last call to this + * # method. Returns a true value if we blocked (not in the hub), + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("gevent.__tracer.GreenletTracer.did_block_hub", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_active_greenlet); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_8__tracer_14GreenletTracer_9did_block_hub(PyObject *__pyx_v_self, PyObject *__pyx_v_hub); /*proto*/ +static char __pyx_doc_6gevent_8__tracer_14GreenletTracer_8did_block_hub[] = "GreenletTracer.did_block_hub(self, hub)"; +static PyMethodDef __pyx_mdef_6gevent_8__tracer_14GreenletTracer_9did_block_hub = {"did_block_hub", (PyCFunction)__pyx_pw_6gevent_8__tracer_14GreenletTracer_9did_block_hub, METH_O, __pyx_doc_6gevent_8__tracer_14GreenletTracer_8did_block_hub}; +static PyObject *__pyx_pw_6gevent_8__tracer_14GreenletTracer_9did_block_hub(PyObject *__pyx_v_self, PyObject *__pyx_v_hub) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("did_block_hub (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_8__tracer_14GreenletTracer_8did_block_hub(((struct __pyx_obj_6gevent_8__tracer_GreenletTracer *)__pyx_v_self), ((PyObject *)__pyx_v_hub)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_8__tracer_14GreenletTracer_8did_block_hub(struct __pyx_obj_6gevent_8__tracer_GreenletTracer *__pyx_v_self, PyObject *__pyx_v_hub) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("did_block_hub", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6gevent_8__tracer_14GreenletTracer_did_block_hub(__pyx_v_self, __pyx_v_hub, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 71, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__tracer.GreenletTracer.did_block_hub", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_tracer.py":94 + * return True, active_greenlet + * + * def ignore_current_greenlet_blocking(self): # <<<<<<<<<<<<<< + * # Don't pay attention to the current greenlet. + * self.active_greenlet = None + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_8__tracer_14GreenletTracer_11ignore_current_greenlet_blocking(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6gevent_8__tracer_14GreenletTracer_10ignore_current_greenlet_blocking[] = "GreenletTracer.ignore_current_greenlet_blocking(self)"; +static PyMethodDef __pyx_mdef_6gevent_8__tracer_14GreenletTracer_11ignore_current_greenlet_blocking = {"ignore_current_greenlet_blocking", (PyCFunction)__pyx_pw_6gevent_8__tracer_14GreenletTracer_11ignore_current_greenlet_blocking, METH_NOARGS, __pyx_doc_6gevent_8__tracer_14GreenletTracer_10ignore_current_greenlet_blocking}; +static PyObject *__pyx_pw_6gevent_8__tracer_14GreenletTracer_11ignore_current_greenlet_blocking(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("ignore_current_greenlet_blocking (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_8__tracer_14GreenletTracer_10ignore_current_greenlet_blocking(((struct __pyx_obj_6gevent_8__tracer_GreenletTracer *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_8__tracer_14GreenletTracer_10ignore_current_greenlet_blocking(struct __pyx_obj_6gevent_8__tracer_GreenletTracer *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("ignore_current_greenlet_blocking", 0); + + /* "src/gevent/_tracer.py":96 + * def ignore_current_greenlet_blocking(self): + * # Don't pay attention to the current greenlet. + * self.active_greenlet = None # <<<<<<<<<<<<<< + * + * def monitor_current_greenlet_blocking(self): + */ + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->active_greenlet); + __Pyx_DECREF(__pyx_v_self->active_greenlet); + __pyx_v_self->active_greenlet = Py_None; + + /* "src/gevent/_tracer.py":94 + * return True, active_greenlet + * + * def ignore_current_greenlet_blocking(self): # <<<<<<<<<<<<<< + * # Don't pay attention to the current greenlet. + * self.active_greenlet = None + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_tracer.py":98 + * self.active_greenlet = None + * + * def monitor_current_greenlet_blocking(self): # <<<<<<<<<<<<<< + * self.active_greenlet = getcurrent() + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_8__tracer_14GreenletTracer_13monitor_current_greenlet_blocking(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6gevent_8__tracer_14GreenletTracer_12monitor_current_greenlet_blocking[] = "GreenletTracer.monitor_current_greenlet_blocking(self)"; +static PyMethodDef __pyx_mdef_6gevent_8__tracer_14GreenletTracer_13monitor_current_greenlet_blocking = {"monitor_current_greenlet_blocking", (PyCFunction)__pyx_pw_6gevent_8__tracer_14GreenletTracer_13monitor_current_greenlet_blocking, METH_NOARGS, __pyx_doc_6gevent_8__tracer_14GreenletTracer_12monitor_current_greenlet_blocking}; +static PyObject *__pyx_pw_6gevent_8__tracer_14GreenletTracer_13monitor_current_greenlet_blocking(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("monitor_current_greenlet_blocking (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_8__tracer_14GreenletTracer_12monitor_current_greenlet_blocking(((struct __pyx_obj_6gevent_8__tracer_GreenletTracer *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_8__tracer_14GreenletTracer_12monitor_current_greenlet_blocking(struct __pyx_obj_6gevent_8__tracer_GreenletTracer *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("monitor_current_greenlet_blocking", 0); + + /* "src/gevent/_tracer.py":99 + * + * def monitor_current_greenlet_blocking(self): + * self.active_greenlet = getcurrent() # <<<<<<<<<<<<<< + * + * def did_block_hub_report(self, hub, active_greenlet, format_kwargs): + */ + __Pyx_INCREF(__pyx_v_6gevent_8__tracer_getcurrent); + __pyx_t_2 = __pyx_v_6gevent_8__tracer_getcurrent; __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 99, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_self->active_greenlet); + __Pyx_DECREF(__pyx_v_self->active_greenlet); + __pyx_v_self->active_greenlet = __pyx_t_1; + __pyx_t_1 = 0; + + /* "src/gevent/_tracer.py":98 + * self.active_greenlet = None + * + * def monitor_current_greenlet_blocking(self): # <<<<<<<<<<<<<< + * self.active_greenlet = getcurrent() + * + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("gevent.__tracer.GreenletTracer.monitor_current_greenlet_blocking", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_tracer.py":101 + * self.active_greenlet = getcurrent() + * + * def did_block_hub_report(self, hub, active_greenlet, format_kwargs): # <<<<<<<<<<<<<< + * report = ['=' * 80, + * '\n%s : Greenlet %s appears to be blocked' % + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_8__tracer_14GreenletTracer_15did_block_hub_report(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6gevent_8__tracer_14GreenletTracer_14did_block_hub_report[] = "GreenletTracer.did_block_hub_report(self, hub, active_greenlet, format_kwargs)"; +static PyMethodDef __pyx_mdef_6gevent_8__tracer_14GreenletTracer_15did_block_hub_report = {"did_block_hub_report", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_8__tracer_14GreenletTracer_15did_block_hub_report, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_8__tracer_14GreenletTracer_14did_block_hub_report}; +static PyObject *__pyx_pw_6gevent_8__tracer_14GreenletTracer_15did_block_hub_report(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_hub = 0; + PyObject *__pyx_v_active_greenlet = 0; + PyObject *__pyx_v_format_kwargs = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("did_block_hub_report (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_hub,&__pyx_n_s_active_greenlet,&__pyx_n_s_format_kwargs,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_hub)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_active_greenlet)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("did_block_hub_report", 1, 3, 3, 1); __PYX_ERR(0, 101, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_format_kwargs)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("did_block_hub_report", 1, 3, 3, 2); __PYX_ERR(0, 101, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "did_block_hub_report") < 0)) __PYX_ERR(0, 101, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + } + __pyx_v_hub = values[0]; + __pyx_v_active_greenlet = values[1]; + __pyx_v_format_kwargs = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("did_block_hub_report", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 101, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.__tracer.GreenletTracer.did_block_hub_report", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_8__tracer_14GreenletTracer_14did_block_hub_report(((struct __pyx_obj_6gevent_8__tracer_GreenletTracer *)__pyx_v_self), __pyx_v_hub, __pyx_v_active_greenlet, __pyx_v_format_kwargs); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_8__tracer_14GreenletTracer_14did_block_hub_report(struct __pyx_obj_6gevent_8__tracer_GreenletTracer *__pyx_v_self, PyObject *__pyx_v_hub, PyObject *__pyx_v_active_greenlet, PyObject *__pyx_v_format_kwargs) { + PyObject *__pyx_v_report = NULL; + PyObject *__pyx_v_frame = NULL; + PyObject *__pyx_v_stack = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + __Pyx_RefNannySetupContext("did_block_hub_report", 0); + + /* "src/gevent/_tracer.py":104 + * report = ['=' * 80, + * '\n%s : Greenlet %s appears to be blocked' % + * (gmctime(), active_greenlet)] # <<<<<<<<<<<<<< + * report.append(" Reported by %s" % (self,)) + * try: + */ + __Pyx_INCREF(__pyx_v_6gevent_8__tracer_gmctime); + __pyx_t_2 = __pyx_v_6gevent_8__tracer_gmctime; __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 104, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 104, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); + __Pyx_INCREF(__pyx_v_active_greenlet); + __Pyx_GIVEREF(__pyx_v_active_greenlet); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_active_greenlet); + __pyx_t_1 = 0; + + /* "src/gevent/_tracer.py":103 + * def did_block_hub_report(self, hub, active_greenlet, format_kwargs): + * report = ['=' * 80, + * '\n%s : Greenlet %s appears to be blocked' % # <<<<<<<<<<<<<< + * (gmctime(), active_greenlet)] + * report.append(" Reported by %s" % (self,)) + */ + __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_s_Greenlet_s_appears_to_be_bloc, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 103, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/_tracer.py":102 + * + * def did_block_hub_report(self, hub, active_greenlet, format_kwargs): + * report = ['=' * 80, # <<<<<<<<<<<<<< + * '\n%s : Greenlet %s appears to be blocked' % + * (gmctime(), active_greenlet)] + */ + __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 102, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_kp_s_b); + __Pyx_GIVEREF(__pyx_kp_s_b); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_kp_s_b); + __Pyx_GIVEREF(__pyx_t_1); + PyList_SET_ITEM(__pyx_t_2, 1, __pyx_t_1); + __pyx_t_1 = 0; + __pyx_v_report = ((PyObject*)__pyx_t_2); + __pyx_t_2 = 0; + + /* "src/gevent/_tracer.py":105 + * '\n%s : Greenlet %s appears to be blocked' % + * (gmctime(), active_greenlet)] + * report.append(" Reported by %s" % (self,)) # <<<<<<<<<<<<<< + * try: + * frame = sys._current_frames()[hub.thread_ident] + */ + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 105, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self)); + __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_Reported_by_s, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 105, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_report, __pyx_t_1); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 105, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_tracer.py":106 + * (gmctime(), active_greenlet)] + * report.append(" Reported by %s" % (self,)) + * try: # <<<<<<<<<<<<<< + * frame = sys._current_frames()[hub.thread_ident] + * except KeyError: + */ + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7); + __Pyx_XGOTREF(__pyx_t_5); + __Pyx_XGOTREF(__pyx_t_6); + __Pyx_XGOTREF(__pyx_t_7); + /*try:*/ { + + /* "src/gevent/_tracer.py":107 + * report.append(" Reported by %s" % (self,)) + * try: + * frame = sys._current_frames()[hub.thread_ident] # <<<<<<<<<<<<<< + * except KeyError: + * # The thread holding the hub has died. Perhaps we shouldn't + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_6gevent_8__tracer_sys, __pyx_n_s_current_frames); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 107, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 107, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_hub, __pyx_n_s_thread_ident); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 107, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 107, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_frame = __pyx_t_3; + __pyx_t_3 = 0; + + /* "src/gevent/_tracer.py":106 + * (gmctime(), active_greenlet)] + * report.append(" Reported by %s" % (self,)) + * try: # <<<<<<<<<<<<<< + * frame = sys._current_frames()[hub.thread_ident] + * except KeyError: + */ + } + + /* "src/gevent/_tracer.py":113 + * stack = ["Unknown: No thread found for hub %r\n" % (hub,)] + * else: + * stack = traceback.format_stack(frame) # <<<<<<<<<<<<<< + * report.append('Blocked Stack (for thread id %s):' % (hex(hub.thread_ident),)) + * report.append(''.join(stack)) + */ + /*else:*/ { + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_6gevent_8__tracer_traceback, __pyx_n_s_format_stack); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 113, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_1)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_1); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_3 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_1, __pyx_v_frame) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_frame); + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 113, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_stack = __pyx_t_3; + __pyx_t_3 = 0; + } + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + goto __pyx_L8_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "src/gevent/_tracer.py":108 + * try: + * frame = sys._current_frames()[hub.thread_ident] + * except KeyError: # <<<<<<<<<<<<<< + * # The thread holding the hub has died. Perhaps we shouldn't + * # even report this? + */ + __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError); + if (__pyx_t_8) { + __Pyx_AddTraceback("gevent.__tracer.GreenletTracer.did_block_hub_report", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_2, &__pyx_t_1) < 0) __PYX_ERR(0, 108, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_t_1); + + /* "src/gevent/_tracer.py":111 + * # The thread holding the hub has died. Perhaps we shouldn't + * # even report this? + * stack = ["Unknown: No thread found for hub %r\n" % (hub,)] # <<<<<<<<<<<<<< + * else: + * stack = traceback.format_stack(frame) + */ + __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 111, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_INCREF(__pyx_v_hub); + __Pyx_GIVEREF(__pyx_v_hub); + PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_hub); + __pyx_t_10 = __Pyx_PyString_Format(__pyx_kp_s_Unknown_No_thread_found_for_hub, __pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 111, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = PyList_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 111, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_GIVEREF(__pyx_t_10); + PyList_SET_ITEM(__pyx_t_9, 0, __pyx_t_10); + __pyx_t_10 = 0; + __pyx_v_stack = __pyx_t_9; + __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + + /* "src/gevent/_tracer.py":106 + * (gmctime(), active_greenlet)] + * report.append(" Reported by %s" % (self,)) + * try: # <<<<<<<<<<<<<< + * frame = sys._current_frames()[hub.thread_ident] + * except KeyError: + */ + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7); + goto __pyx_L1_error; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7); + __pyx_L8_try_end:; + } + + /* "src/gevent/_tracer.py":114 + * else: + * stack = traceback.format_stack(frame) + * report.append('Blocked Stack (for thread id %s):' % (hex(hub.thread_ident),)) # <<<<<<<<<<<<<< + * report.append(''.join(stack)) + * report.append("Info:") + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_hub, __pyx_n_s_thread_ident); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 114, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_hex, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 114, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 114, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_Blocked_Stack_for_thread_id_s, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 114, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_report, __pyx_t_2); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 114, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/_tracer.py":115 + * stack = traceback.format_stack(frame) + * report.append('Blocked Stack (for thread id %s):' % (hex(hub.thread_ident),)) + * report.append(''.join(stack)) # <<<<<<<<<<<<<< + * report.append("Info:") + * report.extend(format_run_info(**format_kwargs)) + */ + __pyx_t_2 = __Pyx_PyString_Join(__pyx_kp_s__2, __pyx_v_stack); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 115, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_report, __pyx_t_2); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 115, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/_tracer.py":116 + * report.append('Blocked Stack (for thread id %s):' % (hex(hub.thread_ident),)) + * report.append(''.join(stack)) + * report.append("Info:") # <<<<<<<<<<<<<< + * report.extend(format_run_info(**format_kwargs)) + * + */ + __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_report, __pyx_kp_s_Info); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 116, __pyx_L1_error) + + /* "src/gevent/_tracer.py":117 + * report.append(''.join(stack)) + * report.append("Info:") + * report.extend(format_run_info(**format_kwargs)) # <<<<<<<<<<<<<< + * + * return report + */ + if (unlikely(__pyx_v_format_kwargs == Py_None)) { + PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); + __PYX_ERR(0, 117, __pyx_L1_error) + } + if (likely(PyDict_CheckExact(__pyx_v_format_kwargs))) { + __pyx_t_2 = PyDict_Copy(__pyx_v_format_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 117, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + } else { + __pyx_t_2 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_format_kwargs, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 117, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + } + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_6gevent_8__tracer_format_run_info, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 117, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_4 = __Pyx_PyList_Extend(__pyx_v_report, __pyx_t_1); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 117, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_tracer.py":119 + * report.extend(format_run_info(**format_kwargs)) + * + * return report # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_report); + __pyx_r = __pyx_v_report; + goto __pyx_L0; + + /* "src/gevent/_tracer.py":101 + * self.active_greenlet = getcurrent() + * + * def did_block_hub_report(self, hub, active_greenlet, format_kwargs): # <<<<<<<<<<<<<< + * report = ['=' * 80, + * '\n%s : Greenlet %s appears to be blocked' % + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_AddTraceback("gevent.__tracer.GreenletTracer.did_block_hub_report", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_report); + __Pyx_XDECREF(__pyx_v_frame); + __Pyx_XDECREF(__pyx_v_stack); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/__tracer.pxd":16 + * + * cdef class GreenletTracer: + * cpdef readonly object active_greenlet # <<<<<<<<<<<<<< + * cpdef readonly object previous_trace_function + * cpdef readonly Py_ssize_t greenlet_switch_counter + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_8__tracer_14GreenletTracer_15active_greenlet_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_8__tracer_14GreenletTracer_15active_greenlet_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_8__tracer_14GreenletTracer_15active_greenlet___get__(((struct __pyx_obj_6gevent_8__tracer_GreenletTracer *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_8__tracer_14GreenletTracer_15active_greenlet___get__(struct __pyx_obj_6gevent_8__tracer_GreenletTracer *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->active_greenlet); + __pyx_r = __pyx_v_self->active_greenlet; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/__tracer.pxd":17 + * cdef class GreenletTracer: + * cpdef readonly object active_greenlet + * cpdef readonly object previous_trace_function # <<<<<<<<<<<<<< + * cpdef readonly Py_ssize_t greenlet_switch_counter + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_8__tracer_14GreenletTracer_23previous_trace_function_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_8__tracer_14GreenletTracer_23previous_trace_function_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_8__tracer_14GreenletTracer_23previous_trace_function___get__(((struct __pyx_obj_6gevent_8__tracer_GreenletTracer *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_8__tracer_14GreenletTracer_23previous_trace_function___get__(struct __pyx_obj_6gevent_8__tracer_GreenletTracer *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->previous_trace_function); + __pyx_r = __pyx_v_self->previous_trace_function; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/__tracer.pxd":18 + * cpdef readonly object active_greenlet + * cpdef readonly object previous_trace_function + * cpdef readonly Py_ssize_t greenlet_switch_counter # <<<<<<<<<<<<<< + * + * cdef bint _killed + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_8__tracer_14GreenletTracer_23greenlet_switch_counter_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_8__tracer_14GreenletTracer_23greenlet_switch_counter_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_8__tracer_14GreenletTracer_23greenlet_switch_counter___get__(((struct __pyx_obj_6gevent_8__tracer_GreenletTracer *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_8__tracer_14GreenletTracer_23greenlet_switch_counter___get__(struct __pyx_obj_6gevent_8__tracer_GreenletTracer *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->greenlet_switch_counter); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 18, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__tracer.GreenletTracer.greenlet_switch_counter.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_tracer.py":123 + * + * class _HubTracer(GreenletTracer): + * def __init__(self, hub, max_blocking_time): # <<<<<<<<<<<<<< + * GreenletTracer.__init__(self) + * self.max_blocking_time = max_blocking_time + */ + +/* Python wrapper */ +static int __pyx_pw_6gevent_8__tracer_10_HubTracer_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6gevent_8__tracer_10_HubTracer_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_hub = 0; + PyObject *__pyx_v_max_blocking_time = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_hub,&__pyx_n_s_max_blocking_time,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_hub)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_max_blocking_time)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(0, 123, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 123, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_hub = values[0]; + __pyx_v_max_blocking_time = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 123, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.__tracer._HubTracer.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_8__tracer_10_HubTracer___init__(((struct __pyx_obj_6gevent_8__tracer__HubTracer *)__pyx_v_self), __pyx_v_hub, __pyx_v_max_blocking_time); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_8__tracer_10_HubTracer___init__(struct __pyx_obj_6gevent_8__tracer__HubTracer *__pyx_v_self, PyObject *__pyx_v_hub, PyObject *__pyx_v_max_blocking_time) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + double __pyx_t_4; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "src/gevent/_tracer.py":124 + * class _HubTracer(GreenletTracer): + * def __init__(self, hub, max_blocking_time): + * GreenletTracer.__init__(self) # <<<<<<<<<<<<<< + * self.max_blocking_time = max_blocking_time + * self.hub = hub + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_6gevent_8__tracer_GreenletTracer), __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 124, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, ((PyObject *)__pyx_v_self)) : __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_v_self)); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 124, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_tracer.py":125 + * def __init__(self, hub, max_blocking_time): + * GreenletTracer.__init__(self) + * self.max_blocking_time = max_blocking_time # <<<<<<<<<<<<<< + * self.hub = hub + * + */ + __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_v_max_blocking_time); if (unlikely((__pyx_t_4 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 125, __pyx_L1_error) + __pyx_v_self->max_blocking_time = __pyx_t_4; + + /* "src/gevent/_tracer.py":126 + * GreenletTracer.__init__(self) + * self.max_blocking_time = max_blocking_time + * self.hub = hub # <<<<<<<<<<<<<< + * + * def kill(self): + */ + __Pyx_INCREF(__pyx_v_hub); + __Pyx_GIVEREF(__pyx_v_hub); + __Pyx_GOTREF(__pyx_v_self->hub); + __Pyx_DECREF(__pyx_v_self->hub); + __pyx_v_self->hub = __pyx_v_hub; + + /* "src/gevent/_tracer.py":123 + * + * class _HubTracer(GreenletTracer): + * def __init__(self, hub, max_blocking_time): # <<<<<<<<<<<<<< + * GreenletTracer.__init__(self) + * self.max_blocking_time = max_blocking_time + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("gevent.__tracer._HubTracer.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_tracer.py":128 + * self.hub = hub + * + * def kill(self): # <<<<<<<<<<<<<< + * self.hub = None + * GreenletTracer.kill(self) + */ + +static PyObject *__pyx_pw_6gevent_8__tracer_10_HubTracer_3kill(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_f_6gevent_8__tracer_10_HubTracer_kill(struct __pyx_obj_6gevent_8__tracer__HubTracer *__pyx_v_self, int __pyx_skip_dispatch) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + __Pyx_RefNannySetupContext("kill", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0; + if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self)))))); + else { + PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + #endif + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_kill); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 128, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_8__tracer_10_HubTracer_3kill)) { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 128, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0; + if (unlikely(type_dict_guard != tp_dict_version)) { + tp_dict_version = obj_dict_version = 0; + } + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + } + #endif + } + + /* "src/gevent/_tracer.py":129 + * + * def kill(self): + * self.hub = None # <<<<<<<<<<<<<< + * GreenletTracer.kill(self) + * + */ + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->hub); + __Pyx_DECREF(__pyx_v_self->hub); + __pyx_v_self->hub = Py_None; + + /* "src/gevent/_tracer.py":130 + * def kill(self): + * self.hub = None + * GreenletTracer.kill(self) # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_1 = __pyx_f_6gevent_8__tracer_14GreenletTracer_kill(((struct __pyx_obj_6gevent_8__tracer_GreenletTracer *)__pyx_v_self), 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 130, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_tracer.py":128 + * self.hub = hub + * + * def kill(self): # <<<<<<<<<<<<<< + * self.hub = None + * GreenletTracer.kill(self) + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("gevent.__tracer._HubTracer.kill", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_8__tracer_10_HubTracer_3kill(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6gevent_8__tracer_10_HubTracer_2kill[] = "_HubTracer.kill(self)"; +static PyMethodDef __pyx_mdef_6gevent_8__tracer_10_HubTracer_3kill = {"kill", (PyCFunction)__pyx_pw_6gevent_8__tracer_10_HubTracer_3kill, METH_NOARGS, __pyx_doc_6gevent_8__tracer_10_HubTracer_2kill}; +static PyObject *__pyx_pw_6gevent_8__tracer_10_HubTracer_3kill(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("kill (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_8__tracer_10_HubTracer_2kill(((struct __pyx_obj_6gevent_8__tracer__HubTracer *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_8__tracer_10_HubTracer_2kill(struct __pyx_obj_6gevent_8__tracer__HubTracer *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("kill", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6gevent_8__tracer_10_HubTracer_kill(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 128, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__tracer._HubTracer.kill", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/__tracer.pxd":31 + * @cython.internal + * cdef class _HubTracer(GreenletTracer): + * cpdef readonly object hub # <<<<<<<<<<<<<< + * cpdef readonly double max_blocking_time + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_8__tracer_10_HubTracer_3hub_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_8__tracer_10_HubTracer_3hub_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_8__tracer_10_HubTracer_3hub___get__(((struct __pyx_obj_6gevent_8__tracer__HubTracer *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_8__tracer_10_HubTracer_3hub___get__(struct __pyx_obj_6gevent_8__tracer__HubTracer *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->hub); + __pyx_r = __pyx_v_self->hub; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/__tracer.pxd":32 + * cdef class _HubTracer(GreenletTracer): + * cpdef readonly object hub + * cpdef readonly double max_blocking_time # <<<<<<<<<<<<<< + * + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_8__tracer_10_HubTracer_17max_blocking_time_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_8__tracer_10_HubTracer_17max_blocking_time_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_8__tracer_10_HubTracer_17max_blocking_time___get__(((struct __pyx_obj_6gevent_8__tracer__HubTracer *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_8__tracer_10_HubTracer_17max_blocking_time___get__(struct __pyx_obj_6gevent_8__tracer__HubTracer *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->max_blocking_time); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 32, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__tracer._HubTracer.max_blocking_time.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_tracer.py":136 + * # A greenlet tracer that records the last time we switched *into* the hub. + * + * def __init__(self, hub, max_blocking_time): # <<<<<<<<<<<<<< + * _HubTracer.__init__(self, hub, max_blocking_time) + * self.last_entered_hub = 0 + */ + +/* Python wrapper */ +static int __pyx_pw_6gevent_8__tracer_15HubSwitchTracer_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6gevent_8__tracer_15HubSwitchTracer_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_hub = 0; + PyObject *__pyx_v_max_blocking_time = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_hub,&__pyx_n_s_max_blocking_time,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_hub)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_max_blocking_time)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(0, 136, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 136, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_hub = values[0]; + __pyx_v_max_blocking_time = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 136, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.__tracer.HubSwitchTracer.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_8__tracer_15HubSwitchTracer___init__(((struct __pyx_obj_6gevent_8__tracer_HubSwitchTracer *)__pyx_v_self), __pyx_v_hub, __pyx_v_max_blocking_time); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_8__tracer_15HubSwitchTracer___init__(struct __pyx_obj_6gevent_8__tracer_HubSwitchTracer *__pyx_v_self, PyObject *__pyx_v_hub, PyObject *__pyx_v_max_blocking_time) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "src/gevent/_tracer.py":137 + * + * def __init__(self, hub, max_blocking_time): + * _HubTracer.__init__(self, hub, max_blocking_time) # <<<<<<<<<<<<<< + * self.last_entered_hub = 0 + * + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_6gevent_8__tracer__HubTracer), __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 137, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + __pyx_t_4 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_4 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[4] = {__pyx_t_3, ((PyObject *)__pyx_v_self), __pyx_v_hub, __pyx_v_max_blocking_time}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 137, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[4] = {__pyx_t_3, ((PyObject *)__pyx_v_self), __pyx_v_hub, __pyx_v_max_blocking_time}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 137, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else + #endif + { + __pyx_t_5 = PyTuple_New(3+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 137, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (__pyx_t_3) { + __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL; + } + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, ((PyObject *)__pyx_v_self)); + __Pyx_INCREF(__pyx_v_hub); + __Pyx_GIVEREF(__pyx_v_hub); + PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_hub); + __Pyx_INCREF(__pyx_v_max_blocking_time); + __Pyx_GIVEREF(__pyx_v_max_blocking_time); + PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_4, __pyx_v_max_blocking_time); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 137, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_tracer.py":138 + * def __init__(self, hub, max_blocking_time): + * _HubTracer.__init__(self, hub, max_blocking_time) + * self.last_entered_hub = 0 # <<<<<<<<<<<<<< + * + * def _trace(self, event, args): + */ + __pyx_v_self->last_entered_hub = 0.0; + + /* "src/gevent/_tracer.py":136 + * # A greenlet tracer that records the last time we switched *into* the hub. + * + * def __init__(self, hub, max_blocking_time): # <<<<<<<<<<<<<< + * _HubTracer.__init__(self, hub, max_blocking_time) + * self.last_entered_hub = 0 + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("gevent.__tracer.HubSwitchTracer.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_tracer.py":140 + * self.last_entered_hub = 0 + * + * def _trace(self, event, args): # <<<<<<<<<<<<<< + * GreenletTracer._trace(self, event, args) + * if self.active_greenlet is self.hub: + */ + +static PyObject *__pyx_pw_6gevent_8__tracer_15HubSwitchTracer_3_trace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_6gevent_8__tracer_15HubSwitchTracer__trace(struct __pyx_obj_6gevent_8__tracer_HubSwitchTracer *__pyx_v_self, PyObject *__pyx_v_event, PyObject *__pyx_v_args, int __pyx_skip_dispatch) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + int __pyx_t_8; + double __pyx_t_9; + __Pyx_RefNannySetupContext("_trace", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0; + if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self)))))); + else { + PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + #endif + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_trace); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 140, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_8__tracer_15HubSwitchTracer_3_trace)) { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; + __pyx_t_5 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_5 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_3)) { + PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_event, __pyx_v_args}; + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 140, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GOTREF(__pyx_t_2); + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { + PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_event, __pyx_v_args}; + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 140, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GOTREF(__pyx_t_2); + } else + #endif + { + __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 140, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (__pyx_t_4) { + __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL; + } + __Pyx_INCREF(__pyx_v_event); + __Pyx_GIVEREF(__pyx_v_event); + PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_event); + __Pyx_INCREF(__pyx_v_args); + __Pyx_GIVEREF(__pyx_v_args); + PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_args); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 140, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0; + if (unlikely(type_dict_guard != tp_dict_version)) { + tp_dict_version = obj_dict_version = 0; + } + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + } + #endif + } + + /* "src/gevent/_tracer.py":141 + * + * def _trace(self, event, args): + * GreenletTracer._trace(self, event, args) # <<<<<<<<<<<<<< + * if self.active_greenlet is self.hub: + * self.last_entered_hub = perf_counter() + */ + __pyx_t_1 = __pyx_f_6gevent_8__tracer_14GreenletTracer__trace(((struct __pyx_obj_6gevent_8__tracer_GreenletTracer *)__pyx_v_self), __pyx_v_event, __pyx_v_args, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 141, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_tracer.py":142 + * def _trace(self, event, args): + * GreenletTracer._trace(self, event, args) + * if self.active_greenlet is self.hub: # <<<<<<<<<<<<<< + * self.last_entered_hub = perf_counter() + * + */ + __pyx_t_7 = (__pyx_v_self->__pyx_base.__pyx_base.active_greenlet == __pyx_v_self->__pyx_base.hub); + __pyx_t_8 = (__pyx_t_7 != 0); + if (__pyx_t_8) { + + /* "src/gevent/_tracer.py":143 + * GreenletTracer._trace(self, event, args) + * if self.active_greenlet is self.hub: + * self.last_entered_hub = perf_counter() # <<<<<<<<<<<<<< + * + * def did_block_hub(self, hub): + */ + __Pyx_INCREF(__pyx_v_6gevent_8__tracer_perf_counter); + __pyx_t_2 = __pyx_v_6gevent_8__tracer_perf_counter; __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 143, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 143, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_self->last_entered_hub = __pyx_t_9; + + /* "src/gevent/_tracer.py":142 + * def _trace(self, event, args): + * GreenletTracer._trace(self, event, args) + * if self.active_greenlet is self.hub: # <<<<<<<<<<<<<< + * self.last_entered_hub = perf_counter() + * + */ + } + + /* "src/gevent/_tracer.py":140 + * self.last_entered_hub = 0 + * + * def _trace(self, event, args): # <<<<<<<<<<<<<< + * GreenletTracer._trace(self, event, args) + * if self.active_greenlet is self.hub: + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("gevent.__tracer.HubSwitchTracer._trace", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_8__tracer_15HubSwitchTracer_3_trace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6gevent_8__tracer_15HubSwitchTracer_2_trace[] = "HubSwitchTracer._trace(self, str event, tuple args)"; +static PyMethodDef __pyx_mdef_6gevent_8__tracer_15HubSwitchTracer_3_trace = {"_trace", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_8__tracer_15HubSwitchTracer_3_trace, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_8__tracer_15HubSwitchTracer_2_trace}; +static PyObject *__pyx_pw_6gevent_8__tracer_15HubSwitchTracer_3_trace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_event = 0; + PyObject *__pyx_v_args = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_trace (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_event,&__pyx_n_s_args,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_event)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("_trace", 1, 2, 2, 1); __PYX_ERR(0, 140, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_trace") < 0)) __PYX_ERR(0, 140, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_event = ((PyObject*)values[0]); + __pyx_v_args = ((PyObject*)values[1]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("_trace", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 140, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.__tracer.HubSwitchTracer._trace", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_event), (&PyString_Type), 1, "event", 1))) __PYX_ERR(0, 140, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_args), (&PyTuple_Type), 1, "args", 1))) __PYX_ERR(0, 140, __pyx_L1_error) + __pyx_r = __pyx_pf_6gevent_8__tracer_15HubSwitchTracer_2_trace(((struct __pyx_obj_6gevent_8__tracer_HubSwitchTracer *)__pyx_v_self), __pyx_v_event, __pyx_v_args); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_8__tracer_15HubSwitchTracer_2_trace(struct __pyx_obj_6gevent_8__tracer_HubSwitchTracer *__pyx_v_self, PyObject *__pyx_v_event, PyObject *__pyx_v_args) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("_trace", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6gevent_8__tracer_15HubSwitchTracer__trace(__pyx_v_self, __pyx_v_event, __pyx_v_args, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 140, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__tracer.HubSwitchTracer._trace", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_tracer.py":145 + * self.last_entered_hub = perf_counter() + * + * def did_block_hub(self, hub): # <<<<<<<<<<<<<< + * if perf_counter() - self.last_entered_hub > self.max_blocking_time: + * return True, self.active_greenlet + */ + +static PyObject *__pyx_pw_6gevent_8__tracer_15HubSwitchTracer_5did_block_hub(PyObject *__pyx_v_self, PyObject *__pyx_v_hub); /*proto*/ +static PyObject *__pyx_f_6gevent_8__tracer_15HubSwitchTracer_did_block_hub(struct __pyx_obj_6gevent_8__tracer_HubSwitchTracer *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_hub, int __pyx_skip_dispatch) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + __Pyx_RefNannySetupContext("did_block_hub", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0; + if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self)))))); + else { + PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + #endif + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_did_block_hub); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 145, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_8__tracer_15HubSwitchTracer_5did_block_hub)) { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_hub) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_hub); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 145, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0; + if (unlikely(type_dict_guard != tp_dict_version)) { + tp_dict_version = obj_dict_version = 0; + } + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + } + #endif + } + + /* "src/gevent/_tracer.py":146 + * + * def did_block_hub(self, hub): + * if perf_counter() - self.last_entered_hub > self.max_blocking_time: # <<<<<<<<<<<<<< + * return True, self.active_greenlet + * + */ + __Pyx_INCREF(__pyx_v_6gevent_8__tracer_perf_counter); + __pyx_t_2 = __pyx_v_6gevent_8__tracer_perf_counter; __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 146, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_self->last_entered_hub); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 146, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyNumber_Subtract(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 146, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_self->__pyx_base.max_blocking_time); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 146, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 146, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 146, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_5) { + + /* "src/gevent/_tracer.py":147 + * def did_block_hub(self, hub): + * if perf_counter() - self.last_entered_hub > self.max_blocking_time: + * return True, self.active_greenlet # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 147, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(Py_True); + __Pyx_GIVEREF(Py_True); + PyTuple_SET_ITEM(__pyx_t_1, 0, Py_True); + __Pyx_INCREF(__pyx_v_self->__pyx_base.__pyx_base.active_greenlet); + __Pyx_GIVEREF(__pyx_v_self->__pyx_base.__pyx_base.active_greenlet); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_self->__pyx_base.__pyx_base.active_greenlet); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "src/gevent/_tracer.py":146 + * + * def did_block_hub(self, hub): + * if perf_counter() - self.last_entered_hub > self.max_blocking_time: # <<<<<<<<<<<<<< + * return True, self.active_greenlet + * + */ + } + + /* "src/gevent/_tracer.py":145 + * self.last_entered_hub = perf_counter() + * + * def did_block_hub(self, hub): # <<<<<<<<<<<<<< + * if perf_counter() - self.last_entered_hub > self.max_blocking_time: + * return True, self.active_greenlet + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("gevent.__tracer.HubSwitchTracer.did_block_hub", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_8__tracer_15HubSwitchTracer_5did_block_hub(PyObject *__pyx_v_self, PyObject *__pyx_v_hub); /*proto*/ +static char __pyx_doc_6gevent_8__tracer_15HubSwitchTracer_4did_block_hub[] = "HubSwitchTracer.did_block_hub(self, hub)"; +static PyMethodDef __pyx_mdef_6gevent_8__tracer_15HubSwitchTracer_5did_block_hub = {"did_block_hub", (PyCFunction)__pyx_pw_6gevent_8__tracer_15HubSwitchTracer_5did_block_hub, METH_O, __pyx_doc_6gevent_8__tracer_15HubSwitchTracer_4did_block_hub}; +static PyObject *__pyx_pw_6gevent_8__tracer_15HubSwitchTracer_5did_block_hub(PyObject *__pyx_v_self, PyObject *__pyx_v_hub) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("did_block_hub (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_8__tracer_15HubSwitchTracer_4did_block_hub(((struct __pyx_obj_6gevent_8__tracer_HubSwitchTracer *)__pyx_v_self), ((PyObject *)__pyx_v_hub)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_8__tracer_15HubSwitchTracer_4did_block_hub(struct __pyx_obj_6gevent_8__tracer_HubSwitchTracer *__pyx_v_self, PyObject *__pyx_v_hub) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("did_block_hub", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6gevent_8__tracer_15HubSwitchTracer_did_block_hub(__pyx_v_self, __pyx_v_hub, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 145, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__tracer.HubSwitchTracer.did_block_hub", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/__tracer.pxd":36 + * + * cdef class HubSwitchTracer(_HubTracer): + * cpdef readonly double last_entered_hub # <<<<<<<<<<<<<< + * + * cdef class MaxSwitchTracer(_HubTracer): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_8__tracer_15HubSwitchTracer_16last_entered_hub_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_8__tracer_15HubSwitchTracer_16last_entered_hub_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_8__tracer_15HubSwitchTracer_16last_entered_hub___get__(((struct __pyx_obj_6gevent_8__tracer_HubSwitchTracer *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_8__tracer_15HubSwitchTracer_16last_entered_hub___get__(struct __pyx_obj_6gevent_8__tracer_HubSwitchTracer *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->last_entered_hub); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 36, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__tracer.HubSwitchTracer.last_entered_hub.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_tracer.py":154 + * # not including time spent in the hub. + * + * def __init__(self, hub, max_blocking_time): # <<<<<<<<<<<<<< + * _HubTracer.__init__(self, hub, max_blocking_time) + * self.last_switch = perf_counter() + */ + +/* Python wrapper */ +static int __pyx_pw_6gevent_8__tracer_15MaxSwitchTracer_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6gevent_8__tracer_15MaxSwitchTracer_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_hub = 0; + PyObject *__pyx_v_max_blocking_time = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_hub,&__pyx_n_s_max_blocking_time,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_hub)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_max_blocking_time)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(0, 154, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 154, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_hub = values[0]; + __pyx_v_max_blocking_time = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 154, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.__tracer.MaxSwitchTracer.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_8__tracer_15MaxSwitchTracer___init__(((struct __pyx_obj_6gevent_8__tracer_MaxSwitchTracer *)__pyx_v_self), __pyx_v_hub, __pyx_v_max_blocking_time); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_8__tracer_15MaxSwitchTracer___init__(struct __pyx_obj_6gevent_8__tracer_MaxSwitchTracer *__pyx_v_self, PyObject *__pyx_v_hub, PyObject *__pyx_v_max_blocking_time) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + double __pyx_t_6; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "src/gevent/_tracer.py":155 + * + * def __init__(self, hub, max_blocking_time): + * _HubTracer.__init__(self, hub, max_blocking_time) # <<<<<<<<<<<<<< + * self.last_switch = perf_counter() + * self.max_blocking = 0 + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_6gevent_8__tracer__HubTracer), __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 155, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + __pyx_t_4 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_4 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[4] = {__pyx_t_3, ((PyObject *)__pyx_v_self), __pyx_v_hub, __pyx_v_max_blocking_time}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 155, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[4] = {__pyx_t_3, ((PyObject *)__pyx_v_self), __pyx_v_hub, __pyx_v_max_blocking_time}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 155, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else + #endif + { + __pyx_t_5 = PyTuple_New(3+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 155, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (__pyx_t_3) { + __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL; + } + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, ((PyObject *)__pyx_v_self)); + __Pyx_INCREF(__pyx_v_hub); + __Pyx_GIVEREF(__pyx_v_hub); + PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_hub); + __Pyx_INCREF(__pyx_v_max_blocking_time); + __Pyx_GIVEREF(__pyx_v_max_blocking_time); + PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_4, __pyx_v_max_blocking_time); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 155, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_tracer.py":156 + * def __init__(self, hub, max_blocking_time): + * _HubTracer.__init__(self, hub, max_blocking_time) + * self.last_switch = perf_counter() # <<<<<<<<<<<<<< + * self.max_blocking = 0 + * + */ + __Pyx_INCREF(__pyx_v_6gevent_8__tracer_perf_counter); + __pyx_t_2 = __pyx_v_6gevent_8__tracer_perf_counter; __pyx_t_5 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 156, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_6 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 156, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_self->last_switch = __pyx_t_6; + + /* "src/gevent/_tracer.py":157 + * _HubTracer.__init__(self, hub, max_blocking_time) + * self.last_switch = perf_counter() + * self.max_blocking = 0 # <<<<<<<<<<<<<< + * + * def _trace(self, event, args): + */ + __pyx_v_self->max_blocking = 0.0; + + /* "src/gevent/_tracer.py":154 + * # not including time spent in the hub. + * + * def __init__(self, hub, max_blocking_time): # <<<<<<<<<<<<<< + * _HubTracer.__init__(self, hub, max_blocking_time) + * self.last_switch = perf_counter() + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("gevent.__tracer.MaxSwitchTracer.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_tracer.py":159 + * self.max_blocking = 0 + * + * def _trace(self, event, args): # <<<<<<<<<<<<<< + * old_active = self.active_greenlet + * GreenletTracer._trace(self, event, args) + */ + +static PyObject *__pyx_pw_6gevent_8__tracer_15MaxSwitchTracer_3_trace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_6gevent_8__tracer_15MaxSwitchTracer__trace(struct __pyx_obj_6gevent_8__tracer_MaxSwitchTracer *__pyx_v_self, PyObject *__pyx_v_event, PyObject *__pyx_v_args, int __pyx_skip_dispatch) { + double __pyx_v_switched_at; + PyObject *__pyx_v_old_active = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + int __pyx_t_8; + int __pyx_t_9; + double __pyx_t_10; + double __pyx_t_11; + double __pyx_t_12; + __Pyx_RefNannySetupContext("_trace", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0; + if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self)))))); + else { + PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + #endif + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_trace); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 159, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_8__tracer_15MaxSwitchTracer_3_trace)) { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; + __pyx_t_5 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_5 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_3)) { + PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_event, __pyx_v_args}; + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 159, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GOTREF(__pyx_t_2); + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { + PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_event, __pyx_v_args}; + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 159, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GOTREF(__pyx_t_2); + } else + #endif + { + __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 159, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (__pyx_t_4) { + __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL; + } + __Pyx_INCREF(__pyx_v_event); + __Pyx_GIVEREF(__pyx_v_event); + PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_event); + __Pyx_INCREF(__pyx_v_args); + __Pyx_GIVEREF(__pyx_v_args); + PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_args); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 159, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0; + if (unlikely(type_dict_guard != tp_dict_version)) { + tp_dict_version = obj_dict_version = 0; + } + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + } + #endif + } + + /* "src/gevent/_tracer.py":160 + * + * def _trace(self, event, args): + * old_active = self.active_greenlet # <<<<<<<<<<<<<< + * GreenletTracer._trace(self, event, args) + * if old_active is not self.hub and old_active is not None: + */ + __pyx_t_1 = __pyx_v_self->__pyx_base.__pyx_base.active_greenlet; + __Pyx_INCREF(__pyx_t_1); + __pyx_v_old_active = __pyx_t_1; + __pyx_t_1 = 0; + + /* "src/gevent/_tracer.py":161 + * def _trace(self, event, args): + * old_active = self.active_greenlet + * GreenletTracer._trace(self, event, args) # <<<<<<<<<<<<<< + * if old_active is not self.hub and old_active is not None: + * # If we're switching out of the hub, the blocking + */ + __pyx_t_1 = __pyx_f_6gevent_8__tracer_14GreenletTracer__trace(((struct __pyx_obj_6gevent_8__tracer_GreenletTracer *)__pyx_v_self), __pyx_v_event, __pyx_v_args, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 161, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_tracer.py":162 + * old_active = self.active_greenlet + * GreenletTracer._trace(self, event, args) + * if old_active is not self.hub and old_active is not None: # <<<<<<<<<<<<<< + * # If we're switching out of the hub, the blocking + * # time doesn't count. + */ + __pyx_t_8 = (__pyx_v_old_active != __pyx_v_self->__pyx_base.hub); + __pyx_t_9 = (__pyx_t_8 != 0); + if (__pyx_t_9) { + } else { + __pyx_t_7 = __pyx_t_9; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_9 = (__pyx_v_old_active != Py_None); + __pyx_t_8 = (__pyx_t_9 != 0); + __pyx_t_7 = __pyx_t_8; + __pyx_L4_bool_binop_done:; + if (__pyx_t_7) { + + /* "src/gevent/_tracer.py":165 + * # If we're switching out of the hub, the blocking + * # time doesn't count. + * switched_at = perf_counter() # <<<<<<<<<<<<<< + * self.max_blocking = max(self.max_blocking, + * switched_at - self.last_switch) + */ + __Pyx_INCREF(__pyx_v_6gevent_8__tracer_perf_counter); + __pyx_t_2 = __pyx_v_6gevent_8__tracer_perf_counter; __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 165, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 165, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_switched_at = __pyx_t_10; + + /* "src/gevent/_tracer.py":167 + * switched_at = perf_counter() + * self.max_blocking = max(self.max_blocking, + * switched_at - self.last_switch) # <<<<<<<<<<<<<< + * + * def did_block_hub(self, hub): + */ + __pyx_t_10 = (__pyx_v_switched_at - __pyx_v_self->last_switch); + + /* "src/gevent/_tracer.py":166 + * # time doesn't count. + * switched_at = perf_counter() + * self.max_blocking = max(self.max_blocking, # <<<<<<<<<<<<<< + * switched_at - self.last_switch) + * + */ + __pyx_t_11 = __pyx_v_self->max_blocking; + + /* "src/gevent/_tracer.py":167 + * switched_at = perf_counter() + * self.max_blocking = max(self.max_blocking, + * switched_at - self.last_switch) # <<<<<<<<<<<<<< + * + * def did_block_hub(self, hub): + */ + if (((__pyx_t_10 > __pyx_t_11) != 0)) { + __pyx_t_12 = __pyx_t_10; + } else { + __pyx_t_12 = __pyx_t_11; + } + + /* "src/gevent/_tracer.py":166 + * # time doesn't count. + * switched_at = perf_counter() + * self.max_blocking = max(self.max_blocking, # <<<<<<<<<<<<<< + * switched_at - self.last_switch) + * + */ + __pyx_v_self->max_blocking = __pyx_t_12; + + /* "src/gevent/_tracer.py":162 + * old_active = self.active_greenlet + * GreenletTracer._trace(self, event, args) + * if old_active is not self.hub and old_active is not None: # <<<<<<<<<<<<<< + * # If we're switching out of the hub, the blocking + * # time doesn't count. + */ + } + + /* "src/gevent/_tracer.py":159 + * self.max_blocking = 0 + * + * def _trace(self, event, args): # <<<<<<<<<<<<<< + * old_active = self.active_greenlet + * GreenletTracer._trace(self, event, args) + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("gevent.__tracer.MaxSwitchTracer._trace", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_old_active); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_8__tracer_15MaxSwitchTracer_3_trace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6gevent_8__tracer_15MaxSwitchTracer_2_trace[] = "MaxSwitchTracer._trace(self, str event, tuple args)"; +static PyMethodDef __pyx_mdef_6gevent_8__tracer_15MaxSwitchTracer_3_trace = {"_trace", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_8__tracer_15MaxSwitchTracer_3_trace, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_8__tracer_15MaxSwitchTracer_2_trace}; +static PyObject *__pyx_pw_6gevent_8__tracer_15MaxSwitchTracer_3_trace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_event = 0; + PyObject *__pyx_v_args = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_trace (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_event,&__pyx_n_s_args,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_event)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("_trace", 1, 2, 2, 1); __PYX_ERR(0, 159, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_trace") < 0)) __PYX_ERR(0, 159, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_event = ((PyObject*)values[0]); + __pyx_v_args = ((PyObject*)values[1]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("_trace", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 159, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.__tracer.MaxSwitchTracer._trace", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_event), (&PyString_Type), 1, "event", 1))) __PYX_ERR(0, 159, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_args), (&PyTuple_Type), 1, "args", 1))) __PYX_ERR(0, 159, __pyx_L1_error) + __pyx_r = __pyx_pf_6gevent_8__tracer_15MaxSwitchTracer_2_trace(((struct __pyx_obj_6gevent_8__tracer_MaxSwitchTracer *)__pyx_v_self), __pyx_v_event, __pyx_v_args); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_8__tracer_15MaxSwitchTracer_2_trace(struct __pyx_obj_6gevent_8__tracer_MaxSwitchTracer *__pyx_v_self, PyObject *__pyx_v_event, PyObject *__pyx_v_args) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("_trace", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6gevent_8__tracer_15MaxSwitchTracer__trace(__pyx_v_self, __pyx_v_event, __pyx_v_args, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 159, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__tracer.MaxSwitchTracer._trace", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_tracer.py":169 + * switched_at - self.last_switch) + * + * def did_block_hub(self, hub): # <<<<<<<<<<<<<< + * if self.max_blocking == 0: + * # We never switched. Check the time now + */ + +static PyObject *__pyx_pw_6gevent_8__tracer_15MaxSwitchTracer_5did_block_hub(PyObject *__pyx_v_self, PyObject *__pyx_v_hub); /*proto*/ +static PyObject *__pyx_f_6gevent_8__tracer_15MaxSwitchTracer_did_block_hub(struct __pyx_obj_6gevent_8__tracer_MaxSwitchTracer *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_hub, int __pyx_skip_dispatch) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + double __pyx_t_6; + __Pyx_RefNannySetupContext("did_block_hub", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0; + if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self)))))); + else { + PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + #endif + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_did_block_hub); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 169, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_8__tracer_15MaxSwitchTracer_5did_block_hub)) { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_hub) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_hub); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 169, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0; + if (unlikely(type_dict_guard != tp_dict_version)) { + tp_dict_version = obj_dict_version = 0; + } + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + } + #endif + } + + /* "src/gevent/_tracer.py":170 + * + * def did_block_hub(self, hub): + * if self.max_blocking == 0: # <<<<<<<<<<<<<< + * # We never switched. Check the time now + * self.max_blocking = perf_counter() - self.last_switch + */ + __pyx_t_5 = ((__pyx_v_self->max_blocking == 0.0) != 0); + if (__pyx_t_5) { + + /* "src/gevent/_tracer.py":172 + * if self.max_blocking == 0: + * # We never switched. Check the time now + * self.max_blocking = perf_counter() - self.last_switch # <<<<<<<<<<<<<< + * + * if self.max_blocking > self.max_blocking_time: + */ + __Pyx_INCREF(__pyx_v_6gevent_8__tracer_perf_counter); + __pyx_t_2 = __pyx_v_6gevent_8__tracer_perf_counter; __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 172, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_self->last_switch); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 172, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyNumber_Subtract(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 172, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_6 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 172, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_self->max_blocking = __pyx_t_6; + + /* "src/gevent/_tracer.py":170 + * + * def did_block_hub(self, hub): + * if self.max_blocking == 0: # <<<<<<<<<<<<<< + * # We never switched. Check the time now + * self.max_blocking = perf_counter() - self.last_switch + */ + } + + /* "src/gevent/_tracer.py":174 + * self.max_blocking = perf_counter() - self.last_switch + * + * if self.max_blocking > self.max_blocking_time: # <<<<<<<<<<<<<< + * return True, self.active_greenlet + * + */ + __pyx_t_5 = ((__pyx_v_self->max_blocking > __pyx_v_self->__pyx_base.max_blocking_time) != 0); + if (__pyx_t_5) { + + /* "src/gevent/_tracer.py":175 + * + * if self.max_blocking > self.max_blocking_time: + * return True, self.active_greenlet # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 175, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(Py_True); + __Pyx_GIVEREF(Py_True); + PyTuple_SET_ITEM(__pyx_t_3, 0, Py_True); + __Pyx_INCREF(__pyx_v_self->__pyx_base.__pyx_base.active_greenlet); + __Pyx_GIVEREF(__pyx_v_self->__pyx_base.__pyx_base.active_greenlet); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_self->__pyx_base.__pyx_base.active_greenlet); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "src/gevent/_tracer.py":174 + * self.max_blocking = perf_counter() - self.last_switch + * + * if self.max_blocking > self.max_blocking_time: # <<<<<<<<<<<<<< + * return True, self.active_greenlet + * + */ + } + + /* "src/gevent/_tracer.py":169 + * switched_at - self.last_switch) + * + * def did_block_hub(self, hub): # <<<<<<<<<<<<<< + * if self.max_blocking == 0: + * # We never switched. Check the time now + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("gevent.__tracer.MaxSwitchTracer.did_block_hub", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_8__tracer_15MaxSwitchTracer_5did_block_hub(PyObject *__pyx_v_self, PyObject *__pyx_v_hub); /*proto*/ +static char __pyx_doc_6gevent_8__tracer_15MaxSwitchTracer_4did_block_hub[] = "MaxSwitchTracer.did_block_hub(self, hub)"; +static PyMethodDef __pyx_mdef_6gevent_8__tracer_15MaxSwitchTracer_5did_block_hub = {"did_block_hub", (PyCFunction)__pyx_pw_6gevent_8__tracer_15MaxSwitchTracer_5did_block_hub, METH_O, __pyx_doc_6gevent_8__tracer_15MaxSwitchTracer_4did_block_hub}; +static PyObject *__pyx_pw_6gevent_8__tracer_15MaxSwitchTracer_5did_block_hub(PyObject *__pyx_v_self, PyObject *__pyx_v_hub) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("did_block_hub (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_8__tracer_15MaxSwitchTracer_4did_block_hub(((struct __pyx_obj_6gevent_8__tracer_MaxSwitchTracer *)__pyx_v_self), ((PyObject *)__pyx_v_hub)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_8__tracer_15MaxSwitchTracer_4did_block_hub(struct __pyx_obj_6gevent_8__tracer_MaxSwitchTracer *__pyx_v_self, PyObject *__pyx_v_hub) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("did_block_hub", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6gevent_8__tracer_15MaxSwitchTracer_did_block_hub(__pyx_v_self, __pyx_v_hub, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 169, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__tracer.MaxSwitchTracer.did_block_hub", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/__tracer.pxd":39 + * + * cdef class MaxSwitchTracer(_HubTracer): + * cpdef readonly double max_blocking # <<<<<<<<<<<<<< + * cpdef readonly double last_switch + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_8__tracer_15MaxSwitchTracer_12max_blocking_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_8__tracer_15MaxSwitchTracer_12max_blocking_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_8__tracer_15MaxSwitchTracer_12max_blocking___get__(((struct __pyx_obj_6gevent_8__tracer_MaxSwitchTracer *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_8__tracer_15MaxSwitchTracer_12max_blocking___get__(struct __pyx_obj_6gevent_8__tracer_MaxSwitchTracer *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->max_blocking); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 39, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__tracer.MaxSwitchTracer.max_blocking.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/__tracer.pxd":40 + * cdef class MaxSwitchTracer(_HubTracer): + * cpdef readonly double max_blocking + * cpdef readonly double last_switch # <<<<<<<<<<<<<< + * + * @cython.locals(switched_at=double) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_8__tracer_15MaxSwitchTracer_11last_switch_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_8__tracer_15MaxSwitchTracer_11last_switch_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_8__tracer_15MaxSwitchTracer_11last_switch___get__(((struct __pyx_obj_6gevent_8__tracer_MaxSwitchTracer *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_8__tracer_15MaxSwitchTracer_11last_switch___get__(struct __pyx_obj_6gevent_8__tracer_MaxSwitchTracer *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->last_switch); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 40, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__tracer.MaxSwitchTracer.last_switch.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} +static struct __pyx_vtabstruct_6gevent_8__tracer_GreenletTracer __pyx_vtable_6gevent_8__tracer_GreenletTracer; + +static PyObject *__pyx_tp_new_6gevent_8__tracer_GreenletTracer(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + struct __pyx_obj_6gevent_8__tracer_GreenletTracer *p; + PyObject *o; + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_6gevent_8__tracer_GreenletTracer *)o); + p->__pyx_vtab = __pyx_vtabptr_6gevent_8__tracer_GreenletTracer; + p->active_greenlet = Py_None; Py_INCREF(Py_None); + p->previous_trace_function = Py_None; Py_INCREF(Py_None); + return o; +} + +static void __pyx_tp_dealloc_6gevent_8__tracer_GreenletTracer(PyObject *o) { + struct __pyx_obj_6gevent_8__tracer_GreenletTracer *p = (struct __pyx_obj_6gevent_8__tracer_GreenletTracer *)o; + #if CYTHON_USE_TP_FINALIZE + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + PyObject_GC_UnTrack(o); + Py_CLEAR(p->active_greenlet); + Py_CLEAR(p->previous_trace_function); + (*Py_TYPE(o)->tp_free)(o); +} + +static int __pyx_tp_traverse_6gevent_8__tracer_GreenletTracer(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_6gevent_8__tracer_GreenletTracer *p = (struct __pyx_obj_6gevent_8__tracer_GreenletTracer *)o; + if (p->active_greenlet) { + e = (*v)(p->active_greenlet, a); if (e) return e; + } + if (p->previous_trace_function) { + e = (*v)(p->previous_trace_function, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_6gevent_8__tracer_GreenletTracer(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_6gevent_8__tracer_GreenletTracer *p = (struct __pyx_obj_6gevent_8__tracer_GreenletTracer *)o; + tmp = ((PyObject*)p->active_greenlet); + p->active_greenlet = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->previous_trace_function); + p->previous_trace_function = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyObject *__pyx_getprop_6gevent_8__tracer_14GreenletTracer_active_greenlet(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_8__tracer_14GreenletTracer_15active_greenlet_1__get__(o); +} + +static PyObject *__pyx_getprop_6gevent_8__tracer_14GreenletTracer_previous_trace_function(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_8__tracer_14GreenletTracer_23previous_trace_function_1__get__(o); +} + +static PyObject *__pyx_getprop_6gevent_8__tracer_14GreenletTracer_greenlet_switch_counter(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_8__tracer_14GreenletTracer_23greenlet_switch_counter_1__get__(o); +} + +static PyMethodDef __pyx_methods_6gevent_8__tracer_GreenletTracer[] = { + {"ignore_current_greenlet_blocking", (PyCFunction)__pyx_pw_6gevent_8__tracer_14GreenletTracer_11ignore_current_greenlet_blocking, METH_NOARGS, __pyx_doc_6gevent_8__tracer_14GreenletTracer_10ignore_current_greenlet_blocking}, + {"monitor_current_greenlet_blocking", (PyCFunction)__pyx_pw_6gevent_8__tracer_14GreenletTracer_13monitor_current_greenlet_blocking, METH_NOARGS, __pyx_doc_6gevent_8__tracer_14GreenletTracer_12monitor_current_greenlet_blocking}, + {"did_block_hub_report", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_8__tracer_14GreenletTracer_15did_block_hub_report, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_8__tracer_14GreenletTracer_14did_block_hub_report}, + {0, 0, 0, 0} +}; + +static struct PyGetSetDef __pyx_getsets_6gevent_8__tracer_GreenletTracer[] = { + {(char *)"active_greenlet", __pyx_getprop_6gevent_8__tracer_14GreenletTracer_active_greenlet, 0, (char *)0, 0}, + {(char *)"previous_trace_function", __pyx_getprop_6gevent_8__tracer_14GreenletTracer_previous_trace_function, 0, (char *)0, 0}, + {(char *)"greenlet_switch_counter", __pyx_getprop_6gevent_8__tracer_14GreenletTracer_greenlet_switch_counter, 0, (char *)0, 0}, + {0, 0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_6gevent_8__tracer_GreenletTracer = { + PyVarObject_HEAD_INIT(0, 0) + "gevent.__tracer.GreenletTracer", /*tp_name*/ + sizeof(struct __pyx_obj_6gevent_8__tracer_GreenletTracer), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6gevent_8__tracer_GreenletTracer, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + __pyx_pw_6gevent_8__tracer_14GreenletTracer_7__call__, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + "GreenletTracer()", /*tp_doc*/ + __pyx_tp_traverse_6gevent_8__tracer_GreenletTracer, /*tp_traverse*/ + __pyx_tp_clear_6gevent_8__tracer_GreenletTracer, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6gevent_8__tracer_GreenletTracer, /*tp_methods*/ + 0, /*tp_members*/ + __pyx_getsets_6gevent_8__tracer_GreenletTracer, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_pw_6gevent_8__tracer_14GreenletTracer_1__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6gevent_8__tracer_GreenletTracer, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; +static struct __pyx_vtabstruct_6gevent_8__tracer__HubTracer __pyx_vtable_6gevent_8__tracer__HubTracer; + +static PyObject *__pyx_tp_new_6gevent_8__tracer__HubTracer(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_6gevent_8__tracer__HubTracer *p; + PyObject *o = __pyx_tp_new_6gevent_8__tracer_GreenletTracer(t, a, k); + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_6gevent_8__tracer__HubTracer *)o); + p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_6gevent_8__tracer_GreenletTracer*)__pyx_vtabptr_6gevent_8__tracer__HubTracer; + p->hub = Py_None; Py_INCREF(Py_None); + return o; +} + +static void __pyx_tp_dealloc_6gevent_8__tracer__HubTracer(PyObject *o) { + struct __pyx_obj_6gevent_8__tracer__HubTracer *p = (struct __pyx_obj_6gevent_8__tracer__HubTracer *)o; + #if CYTHON_USE_TP_FINALIZE + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + PyObject_GC_UnTrack(o); + Py_CLEAR(p->hub); + PyObject_GC_Track(o); + __pyx_tp_dealloc_6gevent_8__tracer_GreenletTracer(o); +} + +static int __pyx_tp_traverse_6gevent_8__tracer__HubTracer(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_6gevent_8__tracer__HubTracer *p = (struct __pyx_obj_6gevent_8__tracer__HubTracer *)o; + e = __pyx_tp_traverse_6gevent_8__tracer_GreenletTracer(o, v, a); if (e) return e; + if (p->hub) { + e = (*v)(p->hub, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_6gevent_8__tracer__HubTracer(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_6gevent_8__tracer__HubTracer *p = (struct __pyx_obj_6gevent_8__tracer__HubTracer *)o; + __pyx_tp_clear_6gevent_8__tracer_GreenletTracer(o); + tmp = ((PyObject*)p->hub); + p->hub = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyObject *__pyx_getprop_6gevent_8__tracer_10_HubTracer_hub(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_8__tracer_10_HubTracer_3hub_1__get__(o); +} + +static PyObject *__pyx_getprop_6gevent_8__tracer_10_HubTracer_max_blocking_time(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_8__tracer_10_HubTracer_17max_blocking_time_1__get__(o); +} + +static PyMethodDef __pyx_methods_6gevent_8__tracer__HubTracer[] = { + {0, 0, 0, 0} +}; + +static struct PyGetSetDef __pyx_getsets_6gevent_8__tracer__HubTracer[] = { + {(char *)"hub", __pyx_getprop_6gevent_8__tracer_10_HubTracer_hub, 0, (char *)0, 0}, + {(char *)"max_blocking_time", __pyx_getprop_6gevent_8__tracer_10_HubTracer_max_blocking_time, 0, (char *)0, 0}, + {0, 0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_6gevent_8__tracer__HubTracer = { + PyVarObject_HEAD_INIT(0, 0) + "gevent.__tracer._HubTracer", /*tp_name*/ + sizeof(struct __pyx_obj_6gevent_8__tracer__HubTracer), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6gevent_8__tracer__HubTracer, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_6gevent_8__tracer_14GreenletTracer_7__call__, /*tp_call*/ + #else + 0, /*tp_call*/ + #endif + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + "_HubTracer(hub, max_blocking_time)", /*tp_doc*/ + __pyx_tp_traverse_6gevent_8__tracer__HubTracer, /*tp_traverse*/ + __pyx_tp_clear_6gevent_8__tracer__HubTracer, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6gevent_8__tracer__HubTracer, /*tp_methods*/ + 0, /*tp_members*/ + __pyx_getsets_6gevent_8__tracer__HubTracer, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_pw_6gevent_8__tracer_10_HubTracer_1__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6gevent_8__tracer__HubTracer, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; +static struct __pyx_vtabstruct_6gevent_8__tracer_HubSwitchTracer __pyx_vtable_6gevent_8__tracer_HubSwitchTracer; + +static PyObject *__pyx_tp_new_6gevent_8__tracer_HubSwitchTracer(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_6gevent_8__tracer_HubSwitchTracer *p; + PyObject *o = __pyx_tp_new_6gevent_8__tracer__HubTracer(t, a, k); + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_6gevent_8__tracer_HubSwitchTracer *)o); + p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_6gevent_8__tracer_GreenletTracer*)__pyx_vtabptr_6gevent_8__tracer_HubSwitchTracer; + return o; +} + +static PyObject *__pyx_getprop_6gevent_8__tracer_15HubSwitchTracer_last_entered_hub(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_8__tracer_15HubSwitchTracer_16last_entered_hub_1__get__(o); +} + +static PyMethodDef __pyx_methods_6gevent_8__tracer_HubSwitchTracer[] = { + {0, 0, 0, 0} +}; + +static struct PyGetSetDef __pyx_getsets_6gevent_8__tracer_HubSwitchTracer[] = { + {(char *)"last_entered_hub", __pyx_getprop_6gevent_8__tracer_15HubSwitchTracer_last_entered_hub, 0, (char *)0, 0}, + {0, 0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_6gevent_8__tracer_HubSwitchTracer = { + PyVarObject_HEAD_INIT(0, 0) + "gevent.__tracer.HubSwitchTracer", /*tp_name*/ + sizeof(struct __pyx_obj_6gevent_8__tracer_HubSwitchTracer), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6gevent_8__tracer__HubTracer, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_6gevent_8__tracer_14GreenletTracer_7__call__, /*tp_call*/ + #else + 0, /*tp_call*/ + #endif + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + "HubSwitchTracer(hub, max_blocking_time)", /*tp_doc*/ + __pyx_tp_traverse_6gevent_8__tracer__HubTracer, /*tp_traverse*/ + __pyx_tp_clear_6gevent_8__tracer__HubTracer, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6gevent_8__tracer_HubSwitchTracer, /*tp_methods*/ + 0, /*tp_members*/ + __pyx_getsets_6gevent_8__tracer_HubSwitchTracer, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_pw_6gevent_8__tracer_15HubSwitchTracer_1__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6gevent_8__tracer_HubSwitchTracer, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; +static struct __pyx_vtabstruct_6gevent_8__tracer_MaxSwitchTracer __pyx_vtable_6gevent_8__tracer_MaxSwitchTracer; + +static PyObject *__pyx_tp_new_6gevent_8__tracer_MaxSwitchTracer(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_6gevent_8__tracer_MaxSwitchTracer *p; + PyObject *o = __pyx_tp_new_6gevent_8__tracer__HubTracer(t, a, k); + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_6gevent_8__tracer_MaxSwitchTracer *)o); + p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_6gevent_8__tracer_GreenletTracer*)__pyx_vtabptr_6gevent_8__tracer_MaxSwitchTracer; + return o; +} + +static PyObject *__pyx_getprop_6gevent_8__tracer_15MaxSwitchTracer_max_blocking(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_8__tracer_15MaxSwitchTracer_12max_blocking_1__get__(o); +} + +static PyObject *__pyx_getprop_6gevent_8__tracer_15MaxSwitchTracer_last_switch(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_8__tracer_15MaxSwitchTracer_11last_switch_1__get__(o); +} + +static PyMethodDef __pyx_methods_6gevent_8__tracer_MaxSwitchTracer[] = { + {0, 0, 0, 0} +}; + +static struct PyGetSetDef __pyx_getsets_6gevent_8__tracer_MaxSwitchTracer[] = { + {(char *)"max_blocking", __pyx_getprop_6gevent_8__tracer_15MaxSwitchTracer_max_blocking, 0, (char *)0, 0}, + {(char *)"last_switch", __pyx_getprop_6gevent_8__tracer_15MaxSwitchTracer_last_switch, 0, (char *)0, 0}, + {0, 0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_6gevent_8__tracer_MaxSwitchTracer = { + PyVarObject_HEAD_INIT(0, 0) + "gevent.__tracer.MaxSwitchTracer", /*tp_name*/ + sizeof(struct __pyx_obj_6gevent_8__tracer_MaxSwitchTracer), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6gevent_8__tracer__HubTracer, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_6gevent_8__tracer_14GreenletTracer_7__call__, /*tp_call*/ + #else + 0, /*tp_call*/ + #endif + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + "MaxSwitchTracer(hub, max_blocking_time)", /*tp_doc*/ + __pyx_tp_traverse_6gevent_8__tracer__HubTracer, /*tp_traverse*/ + __pyx_tp_clear_6gevent_8__tracer__HubTracer, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6gevent_8__tracer_MaxSwitchTracer, /*tp_methods*/ + 0, /*tp_members*/ + __pyx_getsets_6gevent_8__tracer_MaxSwitchTracer, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_pw_6gevent_8__tracer_15MaxSwitchTracer_1__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6gevent_8__tracer_MaxSwitchTracer, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static PyMethodDef __pyx_methods[] = { + {0, 0, 0, 0} +}; + +#if PY_MAJOR_VERSION >= 3 +#if CYTHON_PEP489_MULTI_PHASE_INIT +static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ +static int __pyx_pymod_exec___tracer(PyObject* module); /*proto*/ +static PyModuleDef_Slot __pyx_moduledef_slots[] = { + {Py_mod_create, (void*)__pyx_pymod_create}, + {Py_mod_exec, (void*)__pyx_pymod_exec___tracer}, + {0, NULL} +}; +#endif + +static struct PyModuleDef __pyx_moduledef = { + PyModuleDef_HEAD_INIT, + "__tracer", + 0, /* m_doc */ + #if CYTHON_PEP489_MULTI_PHASE_INIT + 0, /* m_size */ + #else + -1, /* m_size */ + #endif + __pyx_methods /* m_methods */, + #if CYTHON_PEP489_MULTI_PHASE_INIT + __pyx_moduledef_slots, /* m_slots */ + #else + NULL, /* m_reload */ + #endif + NULL, /* m_traverse */ + NULL, /* m_clear */ + NULL /* m_free */ +}; +#endif +#ifndef CYTHON_SMALL_CODE +#if defined(__clang__) + #define CYTHON_SMALL_CODE +#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) + #define CYTHON_SMALL_CODE __attribute__((cold)) +#else + #define CYTHON_SMALL_CODE +#endif +#endif + +static __Pyx_StringTabEntry __pyx_string_tab[] = { + {&__pyx_kp_s_Blocked_Stack_for_thread_id_s, __pyx_k_Blocked_Stack_for_thread_id_s, sizeof(__pyx_k_Blocked_Stack_for_thread_id_s), 0, 0, 1, 0}, + {&__pyx_n_s_GreenletTracer, __pyx_k_GreenletTracer, sizeof(__pyx_k_GreenletTracer), 0, 0, 1, 1}, + {&__pyx_n_s_GreenletTracer__trace, __pyx_k_GreenletTracer__trace, sizeof(__pyx_k_GreenletTracer__trace), 0, 0, 1, 1}, + {&__pyx_n_s_GreenletTracer_did_block_hub, __pyx_k_GreenletTracer_did_block_hub, sizeof(__pyx_k_GreenletTracer_did_block_hub), 0, 0, 1, 1}, + {&__pyx_n_s_GreenletTracer_did_block_hub_rep, __pyx_k_GreenletTracer_did_block_hub_rep, sizeof(__pyx_k_GreenletTracer_did_block_hub_rep), 0, 0, 1, 1}, + {&__pyx_n_s_GreenletTracer_ignore_current_gr, __pyx_k_GreenletTracer_ignore_current_gr, sizeof(__pyx_k_GreenletTracer_ignore_current_gr), 0, 0, 1, 1}, + {&__pyx_n_s_GreenletTracer_kill, __pyx_k_GreenletTracer_kill, sizeof(__pyx_k_GreenletTracer_kill), 0, 0, 1, 1}, + {&__pyx_n_s_GreenletTracer_monitor_current_g, __pyx_k_GreenletTracer_monitor_current_g, sizeof(__pyx_k_GreenletTracer_monitor_current_g), 0, 0, 1, 1}, + {&__pyx_n_s_HubSwitchTracer, __pyx_k_HubSwitchTracer, sizeof(__pyx_k_HubSwitchTracer), 0, 0, 1, 1}, + {&__pyx_n_s_HubSwitchTracer__trace, __pyx_k_HubSwitchTracer__trace, sizeof(__pyx_k_HubSwitchTracer__trace), 0, 0, 1, 1}, + {&__pyx_n_s_HubSwitchTracer_did_block_hub, __pyx_k_HubSwitchTracer_did_block_hub, sizeof(__pyx_k_HubSwitchTracer_did_block_hub), 0, 0, 1, 1}, + {&__pyx_n_s_HubTracer, __pyx_k_HubTracer, sizeof(__pyx_k_HubTracer), 0, 0, 1, 1}, + {&__pyx_n_s_HubTracer_kill, __pyx_k_HubTracer_kill, sizeof(__pyx_k_HubTracer_kill), 0, 0, 1, 1}, + {&__pyx_kp_s_Info, __pyx_k_Info, sizeof(__pyx_k_Info), 0, 0, 1, 0}, + {&__pyx_n_s_KeyError, __pyx_k_KeyError, sizeof(__pyx_k_KeyError), 0, 0, 1, 1}, + {&__pyx_n_s_MaxSwitchTracer, __pyx_k_MaxSwitchTracer, sizeof(__pyx_k_MaxSwitchTracer), 0, 0, 1, 1}, + {&__pyx_n_s_MaxSwitchTracer__trace, __pyx_k_MaxSwitchTracer__trace, sizeof(__pyx_k_MaxSwitchTracer__trace), 0, 0, 1, 1}, + {&__pyx_n_s_MaxSwitchTracer_did_block_hub, __pyx_k_MaxSwitchTracer_did_block_hub, sizeof(__pyx_k_MaxSwitchTracer_did_block_hub), 0, 0, 1, 1}, + {&__pyx_kp_s_Reported_by_s, __pyx_k_Reported_by_s, sizeof(__pyx_k_Reported_by_s), 0, 0, 1, 0}, + {&__pyx_kp_s_Unknown_No_thread_found_for_hub, __pyx_k_Unknown_No_thread_found_for_hub, sizeof(__pyx_k_Unknown_No_thread_found_for_hub), 0, 0, 1, 0}, + {&__pyx_kp_s__2, __pyx_k__2, sizeof(__pyx_k__2), 0, 0, 1, 0}, + {&__pyx_n_s_active_greenlet, __pyx_k_active_greenlet, sizeof(__pyx_k_active_greenlet), 0, 0, 1, 1}, + {&__pyx_n_s_all, __pyx_k_all, sizeof(__pyx_k_all), 0, 0, 1, 1}, + {&__pyx_n_s_args, __pyx_k_args, sizeof(__pyx_k_args), 0, 0, 1, 1}, + #if PY_MAJOR_VERSION >= 3 + {&__pyx_kp_s_b, __pyx_k_, sizeof(__pyx_k_), 0, 1, 0, 0}, + #else + {&__pyx_kp_s_b, __pyx_k_b, sizeof(__pyx_k_b), 0, 0, 1, 0}, + #endif + {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, + {&__pyx_n_s_current_frames, __pyx_k_current_frames, sizeof(__pyx_k_current_frames), 0, 0, 1, 1}, + {&__pyx_n_s_did_block_hub, __pyx_k_did_block_hub, sizeof(__pyx_k_did_block_hub), 0, 0, 1, 1}, + {&__pyx_n_s_did_block_hub_report, __pyx_k_did_block_hub_report, sizeof(__pyx_k_did_block_hub_report), 0, 0, 1, 1}, + {&__pyx_n_s_event, __pyx_k_event, sizeof(__pyx_k_event), 0, 0, 1, 1}, + {&__pyx_n_s_format_kwargs, __pyx_k_format_kwargs, sizeof(__pyx_k_format_kwargs), 0, 0, 1, 1}, + {&__pyx_n_s_format_run_info, __pyx_k_format_run_info, sizeof(__pyx_k_format_run_info), 0, 0, 1, 1}, + {&__pyx_n_s_format_stack, __pyx_k_format_stack, sizeof(__pyx_k_format_stack), 0, 0, 1, 1}, + {&__pyx_n_s_frame, __pyx_k_frame, sizeof(__pyx_k_frame), 0, 0, 1, 1}, + {&__pyx_n_s_getcurrent, __pyx_k_getcurrent, sizeof(__pyx_k_getcurrent), 0, 0, 1, 1}, + {&__pyx_n_s_gevent___tracer, __pyx_k_gevent___tracer, sizeof(__pyx_k_gevent___tracer), 0, 0, 1, 1}, + {&__pyx_n_s_gevent__compat, __pyx_k_gevent__compat, sizeof(__pyx_k_gevent__compat), 0, 0, 1, 1}, + {&__pyx_n_s_gevent__util, __pyx_k_gevent__util, sizeof(__pyx_k_gevent__util), 0, 0, 1, 1}, + {&__pyx_n_s_gevent_util, __pyx_k_gevent_util, sizeof(__pyx_k_gevent_util), 0, 0, 1, 1}, + {&__pyx_n_s_gmctime, __pyx_k_gmctime, sizeof(__pyx_k_gmctime), 0, 0, 1, 1}, + {&__pyx_n_s_greenlet, __pyx_k_greenlet, sizeof(__pyx_k_greenlet), 0, 0, 1, 1}, + {&__pyx_n_s_hex, __pyx_k_hex, sizeof(__pyx_k_hex), 0, 0, 1, 1}, + {&__pyx_n_s_hub, __pyx_k_hub, sizeof(__pyx_k_hub), 0, 0, 1, 1}, + {&__pyx_n_s_ignore_current_greenlet_blocking, __pyx_k_ignore_current_greenlet_blocking, sizeof(__pyx_k_ignore_current_greenlet_blocking), 0, 0, 1, 1}, + {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, + {&__pyx_n_s_import_c_accel, __pyx_k_import_c_accel, sizeof(__pyx_k_import_c_accel), 0, 0, 1, 1}, + {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1}, + {&__pyx_n_s_join, __pyx_k_join, sizeof(__pyx_k_join), 0, 0, 1, 1}, + {&__pyx_n_s_kill, __pyx_k_kill, sizeof(__pyx_k_kill), 0, 0, 1, 1}, + {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, + {&__pyx_n_s_max_blocking_time, __pyx_k_max_blocking_time, sizeof(__pyx_k_max_blocking_time), 0, 0, 1, 1}, + {&__pyx_n_s_monitor_current_greenlet_blockin, __pyx_k_monitor_current_greenlet_blockin, sizeof(__pyx_k_monitor_current_greenlet_blockin), 0, 0, 1, 1}, + {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, + {&__pyx_n_s_perf_counter, __pyx_k_perf_counter, sizeof(__pyx_k_perf_counter), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_capi, __pyx_k_pyx_capi, sizeof(__pyx_k_pyx_capi), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1}, + {&__pyx_n_s_report, __pyx_k_report, sizeof(__pyx_k_report), 0, 0, 1, 1}, + {&__pyx_kp_s_s_Greenlet_s_appears_to_be_bloc, __pyx_k_s_Greenlet_s_appears_to_be_bloc, sizeof(__pyx_k_s_Greenlet_s_appears_to_be_bloc), 0, 0, 1, 0}, + {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1}, + {&__pyx_n_s_settrace, __pyx_k_settrace, sizeof(__pyx_k_settrace), 0, 0, 1, 1}, + {&__pyx_kp_s_src_gevent__tracer_py, __pyx_k_src_gevent__tracer_py, sizeof(__pyx_k_src_gevent__tracer_py), 0, 0, 1, 0}, + {&__pyx_n_s_stack, __pyx_k_stack, sizeof(__pyx_k_stack), 0, 0, 1, 1}, + {&__pyx_n_s_switch, __pyx_k_switch, sizeof(__pyx_k_switch), 0, 0, 1, 1}, + {&__pyx_n_s_sys, __pyx_k_sys, sizeof(__pyx_k_sys), 0, 0, 1, 1}, + {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, + {&__pyx_n_s_thread_ident, __pyx_k_thread_ident, sizeof(__pyx_k_thread_ident), 0, 0, 1, 1}, + {&__pyx_n_s_throw, __pyx_k_throw, sizeof(__pyx_k_throw), 0, 0, 1, 1}, + {&__pyx_n_s_trace, __pyx_k_trace, sizeof(__pyx_k_trace), 0, 0, 1, 1}, + {&__pyx_n_s_traceback, __pyx_k_traceback, sizeof(__pyx_k_traceback), 0, 0, 1, 1}, + {0, 0, 0, 0, 0, 0, 0} +}; +static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { + __pyx_builtin_KeyError = __Pyx_GetBuiltinName(__pyx_n_s_KeyError); if (!__pyx_builtin_KeyError) __PYX_ERR(0, 108, __pyx_L1_error) + __pyx_builtin_hex = __Pyx_GetBuiltinName(__pyx_n_s_hex); if (!__pyx_builtin_hex) __PYX_ERR(0, 114, __pyx_L1_error) + return 0; + __pyx_L1_error:; + return -1; +} + +static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); + + /* "src/gevent/_tracer.py":49 + * self._killed = False + * + * def kill(self): # <<<<<<<<<<<<<< + * # Must be called in the monitored thread. + * if not self._killed: + */ + __pyx_tuple__3 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 49, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__3); + __Pyx_GIVEREF(__pyx_tuple__3); + __pyx_codeobj__4 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__3, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__tracer_py, __pyx_n_s_kill, 49, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__4)) __PYX_ERR(0, 49, __pyx_L1_error) + + /* "src/gevent/_tracer.py":56 + * self.previous_trace_function = None + * + * def _trace(self, event, args): # <<<<<<<<<<<<<< + * # This function runs in the thread we are monitoring. + * self.greenlet_switch_counter += 1 + */ + __pyx_tuple__5 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_event, __pyx_n_s_args); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 56, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__5); + __Pyx_GIVEREF(__pyx_tuple__5); + __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__5, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__tracer_py, __pyx_n_s_trace, 56, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__6)) __PYX_ERR(0, 56, __pyx_L1_error) + + /* "src/gevent/_tracer.py":71 + * return self._trace(event, args) + * + * def did_block_hub(self, hub): # <<<<<<<<<<<<<< + * # Check to see if we have blocked since the last call to this + * # method. Returns a true value if we blocked (not in the hub), + */ + __pyx_tuple__7 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_hub); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 71, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__7); + __Pyx_GIVEREF(__pyx_tuple__7); + __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__tracer_py, __pyx_n_s_did_block_hub, 71, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) __PYX_ERR(0, 71, __pyx_L1_error) + + /* "src/gevent/_tracer.py":94 + * return True, active_greenlet + * + * def ignore_current_greenlet_blocking(self): # <<<<<<<<<<<<<< + * # Don't pay attention to the current greenlet. + * self.active_greenlet = None + */ + __pyx_tuple__9 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 94, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__9); + __Pyx_GIVEREF(__pyx_tuple__9); + __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__9, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__tracer_py, __pyx_n_s_ignore_current_greenlet_blocking, 94, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__10)) __PYX_ERR(0, 94, __pyx_L1_error) + + /* "src/gevent/_tracer.py":98 + * self.active_greenlet = None + * + * def monitor_current_greenlet_blocking(self): # <<<<<<<<<<<<<< + * self.active_greenlet = getcurrent() + * + */ + __pyx_tuple__11 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 98, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__11); + __Pyx_GIVEREF(__pyx_tuple__11); + __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__11, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__tracer_py, __pyx_n_s_monitor_current_greenlet_blockin, 98, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(0, 98, __pyx_L1_error) + + /* "src/gevent/_tracer.py":101 + * self.active_greenlet = getcurrent() + * + * def did_block_hub_report(self, hub, active_greenlet, format_kwargs): # <<<<<<<<<<<<<< + * report = ['=' * 80, + * '\n%s : Greenlet %s appears to be blocked' % + */ + __pyx_tuple__13 = PyTuple_Pack(7, __pyx_n_s_self, __pyx_n_s_hub, __pyx_n_s_active_greenlet, __pyx_n_s_format_kwargs, __pyx_n_s_report, __pyx_n_s_frame, __pyx_n_s_stack); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 101, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__13); + __Pyx_GIVEREF(__pyx_tuple__13); + __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(4, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__13, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__tracer_py, __pyx_n_s_did_block_hub_report, 101, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__14)) __PYX_ERR(0, 101, __pyx_L1_error) + + /* "src/gevent/_tracer.py":128 + * self.hub = hub + * + * def kill(self): # <<<<<<<<<<<<<< + * self.hub = None + * GreenletTracer.kill(self) + */ + __pyx_tuple__15 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(0, 128, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__15); + __Pyx_GIVEREF(__pyx_tuple__15); + __pyx_codeobj__16 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__15, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__tracer_py, __pyx_n_s_kill, 128, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__16)) __PYX_ERR(0, 128, __pyx_L1_error) + + /* "src/gevent/_tracer.py":140 + * self.last_entered_hub = 0 + * + * def _trace(self, event, args): # <<<<<<<<<<<<<< + * GreenletTracer._trace(self, event, args) + * if self.active_greenlet is self.hub: + */ + __pyx_tuple__17 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_event, __pyx_n_s_args); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(0, 140, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__17); + __Pyx_GIVEREF(__pyx_tuple__17); + __pyx_codeobj__18 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__17, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__tracer_py, __pyx_n_s_trace, 140, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__18)) __PYX_ERR(0, 140, __pyx_L1_error) + + /* "src/gevent/_tracer.py":145 + * self.last_entered_hub = perf_counter() + * + * def did_block_hub(self, hub): # <<<<<<<<<<<<<< + * if perf_counter() - self.last_entered_hub > self.max_blocking_time: + * return True, self.active_greenlet + */ + __pyx_tuple__19 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_hub); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(0, 145, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__19); + __Pyx_GIVEREF(__pyx_tuple__19); + __pyx_codeobj__20 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__19, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__tracer_py, __pyx_n_s_did_block_hub, 145, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__20)) __PYX_ERR(0, 145, __pyx_L1_error) + + /* "src/gevent/_tracer.py":159 + * self.max_blocking = 0 + * + * def _trace(self, event, args): # <<<<<<<<<<<<<< + * old_active = self.active_greenlet + * GreenletTracer._trace(self, event, args) + */ + __pyx_tuple__21 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_event, __pyx_n_s_args); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(0, 159, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__21); + __Pyx_GIVEREF(__pyx_tuple__21); + __pyx_codeobj__22 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__21, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__tracer_py, __pyx_n_s_trace, 159, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__22)) __PYX_ERR(0, 159, __pyx_L1_error) + + /* "src/gevent/_tracer.py":169 + * switched_at - self.last_switch) + * + * def did_block_hub(self, hub): # <<<<<<<<<<<<<< + * if self.max_blocking == 0: + * # We never switched. Check the time now + */ + __pyx_tuple__23 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_hub); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(0, 169, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__23); + __Pyx_GIVEREF(__pyx_tuple__23); + __pyx_codeobj__24 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__23, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__tracer_py, __pyx_n_s_did_block_hub, 169, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__24)) __PYX_ERR(0, 169, __pyx_L1_error) + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} + +static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { + if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + return 0; + __pyx_L1_error:; + return -1; +} + +static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/ + +static int __Pyx_modinit_global_init_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); + /*--- Global init code ---*/ + __pyx_v_6gevent_8__tracer_sys = Py_None; Py_INCREF(Py_None); + __pyx_v_6gevent_8__tracer_traceback = Py_None; Py_INCREF(Py_None); + __pyx_v_6gevent_8__tracer_settrace = Py_None; Py_INCREF(Py_None); + __pyx_v_6gevent_8__tracer_getcurrent = Py_None; Py_INCREF(Py_None); + __pyx_v_6gevent_8__tracer_format_run_info = Py_None; Py_INCREF(Py_None); + __pyx_v_6gevent_8__tracer_perf_counter = Py_None; Py_INCREF(Py_None); + __pyx_v_6gevent_8__tracer_gmctime = Py_None; Py_INCREF(Py_None); + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_variable_export_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); + /*--- Variable export code ---*/ + if (__Pyx_ExportVoidPtr(__pyx_n_s_sys, (void *)&__pyx_v_6gevent_8__tracer_sys, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportVoidPtr(__pyx_n_s_traceback, (void *)&__pyx_v_6gevent_8__tracer_traceback, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportVoidPtr(__pyx_n_s_settrace, (void *)&__pyx_v_6gevent_8__tracer_settrace, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportVoidPtr(__pyx_n_s_getcurrent, (void *)&__pyx_v_6gevent_8__tracer_getcurrent, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportVoidPtr(__pyx_n_s_format_run_info, (void *)&__pyx_v_6gevent_8__tracer_format_run_info, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportVoidPtr(__pyx_n_s_perf_counter, (void *)&__pyx_v_6gevent_8__tracer_perf_counter, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportVoidPtr(__pyx_n_s_gmctime, (void *)&__pyx_v_6gevent_8__tracer_gmctime, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_modinit_function_export_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); + /*--- Function export code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_type_init_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); + /*--- Type init code ---*/ + __pyx_vtabptr_6gevent_8__tracer_GreenletTracer = &__pyx_vtable_6gevent_8__tracer_GreenletTracer; + __pyx_vtable_6gevent_8__tracer_GreenletTracer._trace = (PyObject *(*)(struct __pyx_obj_6gevent_8__tracer_GreenletTracer *, PyObject *, PyObject *, int __pyx_skip_dispatch))__pyx_f_6gevent_8__tracer_14GreenletTracer__trace; + __pyx_vtable_6gevent_8__tracer_GreenletTracer.did_block_hub = (PyObject *(*)(struct __pyx_obj_6gevent_8__tracer_GreenletTracer *, PyObject *, int __pyx_skip_dispatch))__pyx_f_6gevent_8__tracer_14GreenletTracer_did_block_hub; + __pyx_vtable_6gevent_8__tracer_GreenletTracer.kill = (PyObject *(*)(struct __pyx_obj_6gevent_8__tracer_GreenletTracer *, int __pyx_skip_dispatch))__pyx_f_6gevent_8__tracer_14GreenletTracer_kill; + if (PyType_Ready(&__pyx_type_6gevent_8__tracer_GreenletTracer) < 0) __PYX_ERR(0, 27, __pyx_L1_error) + __pyx_type_6gevent_8__tracer_GreenletTracer.tp_print = 0; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6gevent_8__tracer_GreenletTracer.tp_dictoffset && __pyx_type_6gevent_8__tracer_GreenletTracer.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_type_6gevent_8__tracer_GreenletTracer.tp_getattro = __Pyx_PyObject_GenericGetAttr; + } + if (__Pyx_SetVtable(__pyx_type_6gevent_8__tracer_GreenletTracer.tp_dict, __pyx_vtabptr_6gevent_8__tracer_GreenletTracer) < 0) __PYX_ERR(0, 27, __pyx_L1_error) + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_GreenletTracer, (PyObject *)&__pyx_type_6gevent_8__tracer_GreenletTracer) < 0) __PYX_ERR(0, 27, __pyx_L1_error) + __pyx_ptype_6gevent_8__tracer_GreenletTracer = &__pyx_type_6gevent_8__tracer_GreenletTracer; + __pyx_vtabptr_6gevent_8__tracer__HubTracer = &__pyx_vtable_6gevent_8__tracer__HubTracer; + __pyx_vtable_6gevent_8__tracer__HubTracer.__pyx_base = *__pyx_vtabptr_6gevent_8__tracer_GreenletTracer; + __pyx_vtable_6gevent_8__tracer__HubTracer.__pyx_base.kill = (PyObject *(*)(struct __pyx_obj_6gevent_8__tracer_GreenletTracer *, int __pyx_skip_dispatch))__pyx_f_6gevent_8__tracer_10_HubTracer_kill; + __pyx_type_6gevent_8__tracer__HubTracer.tp_base = __pyx_ptype_6gevent_8__tracer_GreenletTracer; + if (PyType_Ready(&__pyx_type_6gevent_8__tracer__HubTracer) < 0) __PYX_ERR(0, 122, __pyx_L1_error) + __pyx_type_6gevent_8__tracer__HubTracer.tp_print = 0; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6gevent_8__tracer__HubTracer.tp_dictoffset && __pyx_type_6gevent_8__tracer__HubTracer.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_type_6gevent_8__tracer__HubTracer.tp_getattro = __Pyx_PyObject_GenericGetAttr; + } + if (__Pyx_SetVtable(__pyx_type_6gevent_8__tracer__HubTracer.tp_dict, __pyx_vtabptr_6gevent_8__tracer__HubTracer) < 0) __PYX_ERR(0, 122, __pyx_L1_error) + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_HubTracer, (PyObject *)&__pyx_type_6gevent_8__tracer__HubTracer) < 0) __PYX_ERR(0, 122, __pyx_L1_error) + __pyx_ptype_6gevent_8__tracer__HubTracer = &__pyx_type_6gevent_8__tracer__HubTracer; + __pyx_vtabptr_6gevent_8__tracer_HubSwitchTracer = &__pyx_vtable_6gevent_8__tracer_HubSwitchTracer; + __pyx_vtable_6gevent_8__tracer_HubSwitchTracer.__pyx_base = *__pyx_vtabptr_6gevent_8__tracer__HubTracer; + __pyx_vtable_6gevent_8__tracer_HubSwitchTracer.__pyx_base.__pyx_base._trace = (PyObject *(*)(struct __pyx_obj_6gevent_8__tracer_GreenletTracer *, PyObject *, PyObject *, int __pyx_skip_dispatch))__pyx_f_6gevent_8__tracer_15HubSwitchTracer__trace; + __pyx_vtable_6gevent_8__tracer_HubSwitchTracer.__pyx_base.__pyx_base.did_block_hub = (PyObject *(*)(struct __pyx_obj_6gevent_8__tracer_GreenletTracer *, PyObject *, int __pyx_skip_dispatch))__pyx_f_6gevent_8__tracer_15HubSwitchTracer_did_block_hub; + __pyx_type_6gevent_8__tracer_HubSwitchTracer.tp_base = __pyx_ptype_6gevent_8__tracer__HubTracer; + if (PyType_Ready(&__pyx_type_6gevent_8__tracer_HubSwitchTracer) < 0) __PYX_ERR(0, 133, __pyx_L1_error) + __pyx_type_6gevent_8__tracer_HubSwitchTracer.tp_print = 0; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6gevent_8__tracer_HubSwitchTracer.tp_dictoffset && __pyx_type_6gevent_8__tracer_HubSwitchTracer.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_type_6gevent_8__tracer_HubSwitchTracer.tp_getattro = __Pyx_PyObject_GenericGetAttr; + } + if (__Pyx_SetVtable(__pyx_type_6gevent_8__tracer_HubSwitchTracer.tp_dict, __pyx_vtabptr_6gevent_8__tracer_HubSwitchTracer) < 0) __PYX_ERR(0, 133, __pyx_L1_error) + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_HubSwitchTracer, (PyObject *)&__pyx_type_6gevent_8__tracer_HubSwitchTracer) < 0) __PYX_ERR(0, 133, __pyx_L1_error) + __pyx_ptype_6gevent_8__tracer_HubSwitchTracer = &__pyx_type_6gevent_8__tracer_HubSwitchTracer; + __pyx_vtabptr_6gevent_8__tracer_MaxSwitchTracer = &__pyx_vtable_6gevent_8__tracer_MaxSwitchTracer; + __pyx_vtable_6gevent_8__tracer_MaxSwitchTracer.__pyx_base = *__pyx_vtabptr_6gevent_8__tracer__HubTracer; + __pyx_vtable_6gevent_8__tracer_MaxSwitchTracer.__pyx_base.__pyx_base._trace = (PyObject *(*)(struct __pyx_obj_6gevent_8__tracer_GreenletTracer *, PyObject *, PyObject *, int __pyx_skip_dispatch))__pyx_f_6gevent_8__tracer_15MaxSwitchTracer__trace; + __pyx_vtable_6gevent_8__tracer_MaxSwitchTracer.__pyx_base.__pyx_base.did_block_hub = (PyObject *(*)(struct __pyx_obj_6gevent_8__tracer_GreenletTracer *, PyObject *, int __pyx_skip_dispatch))__pyx_f_6gevent_8__tracer_15MaxSwitchTracer_did_block_hub; + __pyx_type_6gevent_8__tracer_MaxSwitchTracer.tp_base = __pyx_ptype_6gevent_8__tracer__HubTracer; + if (PyType_Ready(&__pyx_type_6gevent_8__tracer_MaxSwitchTracer) < 0) __PYX_ERR(0, 150, __pyx_L1_error) + __pyx_type_6gevent_8__tracer_MaxSwitchTracer.tp_print = 0; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6gevent_8__tracer_MaxSwitchTracer.tp_dictoffset && __pyx_type_6gevent_8__tracer_MaxSwitchTracer.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_type_6gevent_8__tracer_MaxSwitchTracer.tp_getattro = __Pyx_PyObject_GenericGetAttr; + } + if (__Pyx_SetVtable(__pyx_type_6gevent_8__tracer_MaxSwitchTracer.tp_dict, __pyx_vtabptr_6gevent_8__tracer_MaxSwitchTracer) < 0) __PYX_ERR(0, 150, __pyx_L1_error) + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_MaxSwitchTracer, (PyObject *)&__pyx_type_6gevent_8__tracer_MaxSwitchTracer) < 0) __PYX_ERR(0, 150, __pyx_L1_error) + __pyx_ptype_6gevent_8__tracer_MaxSwitchTracer = &__pyx_type_6gevent_8__tracer_MaxSwitchTracer; + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_modinit_type_import_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); + /*--- Type import code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_variable_import_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); + /*--- Variable import code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_function_import_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); + /*--- Function import code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + + +#if PY_MAJOR_VERSION < 3 +#ifdef CYTHON_NO_PYINIT_EXPORT +#define __Pyx_PyMODINIT_FUNC void +#else +#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC +#endif +#else +#ifdef CYTHON_NO_PYINIT_EXPORT +#define __Pyx_PyMODINIT_FUNC PyObject * +#else +#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC +#endif +#endif + + +#if PY_MAJOR_VERSION < 3 +__Pyx_PyMODINIT_FUNC init__tracer(void) CYTHON_SMALL_CODE; /*proto*/ +__Pyx_PyMODINIT_FUNC init__tracer(void) +#else +__Pyx_PyMODINIT_FUNC PyInit___tracer(void) CYTHON_SMALL_CODE; /*proto*/ +__Pyx_PyMODINIT_FUNC PyInit___tracer(void) +#if CYTHON_PEP489_MULTI_PHASE_INIT +{ + return PyModuleDef_Init(&__pyx_moduledef); +} +static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { + #if PY_VERSION_HEX >= 0x030700A1 + static PY_INT64_T main_interpreter_id = -1; + PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); + if (main_interpreter_id == -1) { + main_interpreter_id = current_id; + return (unlikely(current_id == -1)) ? -1 : 0; + } else if (unlikely(main_interpreter_id != current_id)) + #else + static PyInterpreterState *main_interpreter = NULL; + PyInterpreterState *current_interpreter = PyThreadState_Get()->interp; + if (!main_interpreter) { + main_interpreter = current_interpreter; + } else if (unlikely(main_interpreter != current_interpreter)) + #endif + { + PyErr_SetString( + PyExc_ImportError, + "Interpreter change detected - this module can only be loaded into one interpreter per process."); + return -1; + } + return 0; +} +static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) { + PyObject *value = PyObject_GetAttrString(spec, from_name); + int result = 0; + if (likely(value)) { + if (allow_none || value != Py_None) { + result = PyDict_SetItemString(moddict, to_name, value); + } + Py_DECREF(value); + } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_Clear(); + } else { + result = -1; + } + return result; +} +static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) { + PyObject *module = NULL, *moddict, *modname; + if (__Pyx_check_single_interpreter()) + return NULL; + if (__pyx_m) + return __Pyx_NewRef(__pyx_m); + modname = PyObject_GetAttrString(spec, "name"); + if (unlikely(!modname)) goto bad; + module = PyModule_NewObject(modname); + Py_DECREF(modname); + if (unlikely(!module)) goto bad; + moddict = PyModule_GetDict(module); + if (unlikely(!moddict)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad; + return module; +bad: + Py_XDECREF(module); + return NULL; +} + + +static CYTHON_SMALL_CODE int __pyx_pymod_exec___tracer(PyObject *__pyx_pyinit_module) +#endif +#endif +{ + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannyDeclarations + #if CYTHON_PEP489_MULTI_PHASE_INIT + if (__pyx_m) { + if (__pyx_m == __pyx_pyinit_module) return 0; + PyErr_SetString(PyExc_RuntimeError, "Module '__tracer' has already been imported. Re-initialisation is not supported."); + return -1; + } + #elif PY_MAJOR_VERSION >= 3 + if (__pyx_m) return __Pyx_NewRef(__pyx_m); + #endif + #if CYTHON_REFNANNY +__Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); +if (!__Pyx_RefNanny) { + PyErr_Clear(); + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); + if (!__Pyx_RefNanny) + Py_FatalError("failed to import 'refnanny' module"); +} +#endif + __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit___tracer(void)", 0); + if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #ifdef __Pxy_PyFrame_Initialize_Offsets + __Pxy_PyFrame_Initialize_Offsets(); + #endif + __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) + #ifdef __Pyx_CyFunction_USED + if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_FusedFunction_USED + if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_Coroutine_USED + if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_Generator_USED + if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_AsyncGen_USED + if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_StopAsyncIteration_USED + if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + /*--- Library function declarations ---*/ + /*--- Threads initialization code ---*/ + #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS + #ifdef WITH_THREAD /* Python build with threading support? */ + PyEval_InitThreads(); + #endif + #endif + /*--- Module creation code ---*/ + #if CYTHON_PEP489_MULTI_PHASE_INIT + __pyx_m = __pyx_pyinit_module; + Py_INCREF(__pyx_m); + #else + #if PY_MAJOR_VERSION < 3 + __pyx_m = Py_InitModule4("__tracer", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); + #else + __pyx_m = PyModule_Create(&__pyx_moduledef); + #endif + if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) + Py_INCREF(__pyx_d); + __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) + #if CYTHON_COMPILING_IN_PYPY + Py_INCREF(__pyx_b); + #endif + if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + /*--- Initialize various global constants etc. ---*/ + if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) + if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + if (__pyx_module_is_main_gevent____tracer) { + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + } + #if PY_MAJOR_VERSION >= 3 + { + PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) + if (!PyDict_GetItemString(modules, "gevent.__tracer")) { + if (unlikely(PyDict_SetItemString(modules, "gevent.__tracer", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error) + } + } + #endif + /*--- Builtin init code ---*/ + if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + /*--- Constants init code ---*/ + if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + /*--- Global type/function init code ---*/ + (void)__Pyx_modinit_global_init_code(); + if (unlikely(__Pyx_modinit_variable_export_code() != 0)) goto __pyx_L1_error; + (void)__Pyx_modinit_function_export_code(); + if (unlikely(__Pyx_modinit_type_init_code() != 0)) goto __pyx_L1_error; + (void)__Pyx_modinit_type_import_code(); + (void)__Pyx_modinit_variable_import_code(); + (void)__Pyx_modinit_function_import_code(); + /*--- Execution code ---*/ + #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) + if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + + /* "src/gevent/_tracer.py":5 + * from __future__ import print_function, absolute_import, division + * + * import sys # <<<<<<<<<<<<<< + * import traceback + * + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_sys, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_v_6gevent_8__tracer_sys); + __Pyx_DECREF_SET(__pyx_v_6gevent_8__tracer_sys, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + + /* "src/gevent/_tracer.py":6 + * + * import sys + * import traceback # <<<<<<<<<<<<<< + * + * from greenlet import settrace + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_traceback, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_v_6gevent_8__tracer_traceback); + __Pyx_DECREF_SET(__pyx_v_6gevent_8__tracer_traceback, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + + /* "src/gevent/_tracer.py":8 + * import traceback + * + * from greenlet import settrace # <<<<<<<<<<<<<< + * from greenlet import getcurrent + * + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 8, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_settrace); + __Pyx_GIVEREF(__pyx_n_s_settrace); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_settrace); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_greenlet, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_settrace); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 8, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_v_6gevent_8__tracer_settrace); + __Pyx_DECREF_SET(__pyx_v_6gevent_8__tracer_settrace, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/_tracer.py":9 + * + * from greenlet import settrace + * from greenlet import getcurrent # <<<<<<<<<<<<<< + * + * from gevent.util import format_run_info + */ + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_getcurrent); + __Pyx_GIVEREF(__pyx_n_s_getcurrent); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_getcurrent); + __pyx_t_1 = __Pyx_Import(__pyx_n_s_greenlet, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 9, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_getcurrent); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_v_6gevent_8__tracer_getcurrent); + __Pyx_DECREF_SET(__pyx_v_6gevent_8__tracer_getcurrent, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_tracer.py":11 + * from greenlet import getcurrent + * + * from gevent.util import format_run_info # <<<<<<<<<<<<<< + * + * from gevent._compat import perf_counter + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 11, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_format_run_info); + __Pyx_GIVEREF(__pyx_n_s_format_run_info); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_format_run_info); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_gevent_util, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 11, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_format_run_info); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 11, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_v_6gevent_8__tracer_format_run_info); + __Pyx_DECREF_SET(__pyx_v_6gevent_8__tracer_format_run_info, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/_tracer.py":13 + * from gevent.util import format_run_info + * + * from gevent._compat import perf_counter # <<<<<<<<<<<<<< + * from gevent._util import gmctime + * + */ + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_perf_counter); + __Pyx_GIVEREF(__pyx_n_s_perf_counter); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_perf_counter); + __pyx_t_1 = __Pyx_Import(__pyx_n_s_gevent__compat, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_perf_counter); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_v_6gevent_8__tracer_perf_counter); + __Pyx_DECREF_SET(__pyx_v_6gevent_8__tracer_perf_counter, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_tracer.py":14 + * + * from gevent._compat import perf_counter + * from gevent._util import gmctime # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 14, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_gmctime); + __Pyx_GIVEREF(__pyx_n_s_gmctime); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_gmctime); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_gevent__util, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 14, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_gmctime); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 14, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_v_6gevent_8__tracer_gmctime); + __Pyx_DECREF_SET(__pyx_v_6gevent_8__tracer_gmctime, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/_tracer.py":17 + * + * + * __all__ = [ # <<<<<<<<<<<<<< + * 'GreenletTracer', + * 'HubSwitchTracer', + */ + __pyx_t_2 = PyList_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 17, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_GreenletTracer); + __Pyx_GIVEREF(__pyx_n_s_GreenletTracer); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_GreenletTracer); + __Pyx_INCREF(__pyx_n_s_HubSwitchTracer); + __Pyx_GIVEREF(__pyx_n_s_HubSwitchTracer); + PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_HubSwitchTracer); + __Pyx_INCREF(__pyx_n_s_MaxSwitchTracer); + __Pyx_GIVEREF(__pyx_n_s_MaxSwitchTracer); + PyList_SET_ITEM(__pyx_t_2, 2, __pyx_n_s_MaxSwitchTracer); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_all, __pyx_t_2) < 0) __PYX_ERR(0, 17, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/_tracer.py":49 + * self._killed = False + * + * def kill(self): # <<<<<<<<<<<<<< + * # Must be called in the monitored thread. + * if not self._killed: + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_8__tracer_14GreenletTracer_3kill, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_GreenletTracer_kill, NULL, __pyx_n_s_gevent___tracer, __pyx_d, ((PyObject *)__pyx_codeobj__4)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 49, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_8__tracer_GreenletTracer->tp_dict, __pyx_n_s_kill, __pyx_t_2) < 0) __PYX_ERR(0, 49, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_8__tracer_GreenletTracer); + + /* "src/gevent/_tracer.py":56 + * self.previous_trace_function = None + * + * def _trace(self, event, args): # <<<<<<<<<<<<<< + * # This function runs in the thread we are monitoring. + * self.greenlet_switch_counter += 1 + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_8__tracer_14GreenletTracer_5_trace, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_GreenletTracer__trace, NULL, __pyx_n_s_gevent___tracer, __pyx_d, ((PyObject *)__pyx_codeobj__6)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 56, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_8__tracer_GreenletTracer->tp_dict, __pyx_n_s_trace, __pyx_t_2) < 0) __PYX_ERR(0, 56, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_8__tracer_GreenletTracer); + + /* "src/gevent/_tracer.py":71 + * return self._trace(event, args) + * + * def did_block_hub(self, hub): # <<<<<<<<<<<<<< + * # Check to see if we have blocked since the last call to this + * # method. Returns a true value if we blocked (not in the hub), + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_8__tracer_14GreenletTracer_9did_block_hub, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_GreenletTracer_did_block_hub, NULL, __pyx_n_s_gevent___tracer, __pyx_d, ((PyObject *)__pyx_codeobj__8)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 71, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_8__tracer_GreenletTracer->tp_dict, __pyx_n_s_did_block_hub, __pyx_t_2) < 0) __PYX_ERR(0, 71, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_8__tracer_GreenletTracer); + + /* "src/gevent/_tracer.py":94 + * return True, active_greenlet + * + * def ignore_current_greenlet_blocking(self): # <<<<<<<<<<<<<< + * # Don't pay attention to the current greenlet. + * self.active_greenlet = None + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_8__tracer_14GreenletTracer_11ignore_current_greenlet_blocking, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_GreenletTracer_ignore_current_gr, NULL, __pyx_n_s_gevent___tracer, __pyx_d, ((PyObject *)__pyx_codeobj__10)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 94, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_8__tracer_GreenletTracer->tp_dict, __pyx_n_s_ignore_current_greenlet_blocking, __pyx_t_2) < 0) __PYX_ERR(0, 94, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_8__tracer_GreenletTracer); + + /* "src/gevent/_tracer.py":98 + * self.active_greenlet = None + * + * def monitor_current_greenlet_blocking(self): # <<<<<<<<<<<<<< + * self.active_greenlet = getcurrent() + * + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_8__tracer_14GreenletTracer_13monitor_current_greenlet_blocking, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_GreenletTracer_monitor_current_g, NULL, __pyx_n_s_gevent___tracer, __pyx_d, ((PyObject *)__pyx_codeobj__12)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 98, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_8__tracer_GreenletTracer->tp_dict, __pyx_n_s_monitor_current_greenlet_blockin, __pyx_t_2) < 0) __PYX_ERR(0, 98, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_8__tracer_GreenletTracer); + + /* "src/gevent/_tracer.py":101 + * self.active_greenlet = getcurrent() + * + * def did_block_hub_report(self, hub, active_greenlet, format_kwargs): # <<<<<<<<<<<<<< + * report = ['=' * 80, + * '\n%s : Greenlet %s appears to be blocked' % + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_8__tracer_14GreenletTracer_15did_block_hub_report, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_GreenletTracer_did_block_hub_rep, NULL, __pyx_n_s_gevent___tracer, __pyx_d, ((PyObject *)__pyx_codeobj__14)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 101, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_8__tracer_GreenletTracer->tp_dict, __pyx_n_s_did_block_hub_report, __pyx_t_2) < 0) __PYX_ERR(0, 101, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_8__tracer_GreenletTracer); + + /* "src/gevent/_tracer.py":128 + * self.hub = hub + * + * def kill(self): # <<<<<<<<<<<<<< + * self.hub = None + * GreenletTracer.kill(self) + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_8__tracer_10_HubTracer_3kill, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_HubTracer_kill, NULL, __pyx_n_s_gevent___tracer, __pyx_d, ((PyObject *)__pyx_codeobj__16)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 128, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_8__tracer__HubTracer->tp_dict, __pyx_n_s_kill, __pyx_t_2) < 0) __PYX_ERR(0, 128, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_8__tracer__HubTracer); + + /* "src/gevent/_tracer.py":140 + * self.last_entered_hub = 0 + * + * def _trace(self, event, args): # <<<<<<<<<<<<<< + * GreenletTracer._trace(self, event, args) + * if self.active_greenlet is self.hub: + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_8__tracer_15HubSwitchTracer_3_trace, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_HubSwitchTracer__trace, NULL, __pyx_n_s_gevent___tracer, __pyx_d, ((PyObject *)__pyx_codeobj__18)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 140, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_8__tracer_HubSwitchTracer->tp_dict, __pyx_n_s_trace, __pyx_t_2) < 0) __PYX_ERR(0, 140, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_8__tracer_HubSwitchTracer); + + /* "src/gevent/_tracer.py":145 + * self.last_entered_hub = perf_counter() + * + * def did_block_hub(self, hub): # <<<<<<<<<<<<<< + * if perf_counter() - self.last_entered_hub > self.max_blocking_time: + * return True, self.active_greenlet + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_8__tracer_15HubSwitchTracer_5did_block_hub, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_HubSwitchTracer_did_block_hub, NULL, __pyx_n_s_gevent___tracer, __pyx_d, ((PyObject *)__pyx_codeobj__20)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 145, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_8__tracer_HubSwitchTracer->tp_dict, __pyx_n_s_did_block_hub, __pyx_t_2) < 0) __PYX_ERR(0, 145, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_8__tracer_HubSwitchTracer); + + /* "src/gevent/_tracer.py":159 + * self.max_blocking = 0 + * + * def _trace(self, event, args): # <<<<<<<<<<<<<< + * old_active = self.active_greenlet + * GreenletTracer._trace(self, event, args) + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_8__tracer_15MaxSwitchTracer_3_trace, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_MaxSwitchTracer__trace, NULL, __pyx_n_s_gevent___tracer, __pyx_d, ((PyObject *)__pyx_codeobj__22)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 159, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_8__tracer_MaxSwitchTracer->tp_dict, __pyx_n_s_trace, __pyx_t_2) < 0) __PYX_ERR(0, 159, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_8__tracer_MaxSwitchTracer); + + /* "src/gevent/_tracer.py":169 + * switched_at - self.last_switch) + * + * def did_block_hub(self, hub): # <<<<<<<<<<<<<< + * if self.max_blocking == 0: + * # We never switched. Check the time now + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_8__tracer_15MaxSwitchTracer_5did_block_hub, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_MaxSwitchTracer_did_block_hub, NULL, __pyx_n_s_gevent___tracer, __pyx_d, ((PyObject *)__pyx_codeobj__24)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 169, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_8__tracer_MaxSwitchTracer->tp_dict, __pyx_n_s_did_block_hub, __pyx_t_2) < 0) __PYX_ERR(0, 169, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_8__tracer_MaxSwitchTracer); + + /* "src/gevent/_tracer.py":178 + * + * + * from gevent._util import import_c_accel # <<<<<<<<<<<<<< + * import_c_accel(globals(), 'gevent.__tracer') + */ + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 178, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_import_c_accel); + __Pyx_GIVEREF(__pyx_n_s_import_c_accel); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_import_c_accel); + __pyx_t_1 = __Pyx_Import(__pyx_n_s_gevent__util, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 178, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_import_c_accel); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 178, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_import_c_accel, __pyx_t_2) < 0) __PYX_ERR(0, 178, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_tracer.py":179 + * + * from gevent._util import import_c_accel + * import_c_accel(globals(), 'gevent.__tracer') # <<<<<<<<<<<<<< + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_import_c_accel); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 179, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_Globals(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 179, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 179, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __Pyx_INCREF(__pyx_n_s_gevent___tracer); + __Pyx_GIVEREF(__pyx_n_s_gevent___tracer); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_n_s_gevent___tracer); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 179, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/_tracer.py":1 + * # Copyright (c) 2018 gevent. See LICENSE for details. # <<<<<<<<<<<<<< + * # cython: auto_pickle=False,embedsignature=True,always_allow_keywords=False + * from __future__ import print_function, absolute_import, division + */ + __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /*--- Wrapped vars code ---*/ + + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + if (__pyx_m) { + if (__pyx_d) { + __Pyx_AddTraceback("init gevent.__tracer", __pyx_clineno, __pyx_lineno, __pyx_filename); + } + Py_CLEAR(__pyx_m); + } else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_ImportError, "init gevent.__tracer"); + } + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + #if CYTHON_PEP489_MULTI_PHASE_INIT + return (__pyx_m != NULL) ? 0 : -1; + #elif PY_MAJOR_VERSION >= 3 + return __pyx_m; + #else + return; + #endif +} + +/* --- Runtime support code --- */ +/* Refnanny */ +#if CYTHON_REFNANNY +static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { + PyObject *m = NULL, *p = NULL; + void *r = NULL; + m = PyImport_ImportModule(modname); + if (!m) goto end; + p = PyObject_GetAttrString(m, "RefNannyAPI"); + if (!p) goto end; + r = PyLong_AsVoidPtr(p); +end: + Py_XDECREF(p); + Py_XDECREF(m); + return (__Pyx_RefNannyAPIStruct *)r; +} +#endif + +/* PyObjectGetAttrStr */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_getattro)) + return tp->tp_getattro(obj, attr_name); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_getattr)) + return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); +#endif + return PyObject_GetAttr(obj, attr_name); +} +#endif + +/* GetBuiltinName */ +static PyObject *__Pyx_GetBuiltinName(PyObject *name) { + PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name); + if (unlikely(!result)) { + PyErr_Format(PyExc_NameError, +#if PY_MAJOR_VERSION >= 3 + "name '%U' is not defined", name); +#else + "name '%.200s' is not defined", PyString_AS_STRING(name)); +#endif + } + return result; +} + +/* RaiseArgTupleInvalid */ +static void __Pyx_RaiseArgtupleInvalid( + const char* func_name, + int exact, + Py_ssize_t num_min, + Py_ssize_t num_max, + Py_ssize_t num_found) +{ + Py_ssize_t num_expected; + const char *more_or_less; + if (num_found < num_min) { + num_expected = num_min; + more_or_less = "at least"; + } else { + num_expected = num_max; + more_or_less = "at most"; + } + if (exact) { + more_or_less = "exactly"; + } + PyErr_Format(PyExc_TypeError, + "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", + func_name, more_or_less, num_expected, + (num_expected == 1) ? "" : "s", num_found); +} + +/* KeywordStringCheck */ +static int __Pyx_CheckKeywordStrings( + PyObject *kwdict, + const char* function_name, + int kw_allowed) +{ + PyObject* key = 0; + Py_ssize_t pos = 0; +#if CYTHON_COMPILING_IN_PYPY + if (!kw_allowed && PyDict_Next(kwdict, &pos, &key, 0)) + goto invalid_keyword; + return 1; +#else + while (PyDict_Next(kwdict, &pos, &key, 0)) { + #if PY_MAJOR_VERSION < 3 + if (unlikely(!PyString_Check(key))) + #endif + if (unlikely(!PyUnicode_Check(key))) + goto invalid_keyword_type; + } + if ((!kw_allowed) && unlikely(key)) + goto invalid_keyword; + return 1; +invalid_keyword_type: + PyErr_Format(PyExc_TypeError, + "%.200s() keywords must be strings", function_name); + return 0; +#endif +invalid_keyword: + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION < 3 + "%.200s() got an unexpected keyword argument '%.200s'", + function_name, PyString_AsString(key)); + #else + "%s() got an unexpected keyword argument '%U'", + function_name, key); + #endif + return 0; +} + +/* PyCFunctionFastCall */ +#if CYTHON_FAST_PYCCALL +static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) { + PyCFunctionObject *func = (PyCFunctionObject*)func_obj; + PyCFunction meth = PyCFunction_GET_FUNCTION(func); + PyObject *self = PyCFunction_GET_SELF(func); + int flags = PyCFunction_GET_FLAGS(func); + assert(PyCFunction_Check(func)); + assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS))); + assert(nargs >= 0); + assert(nargs == 0 || args != NULL); + /* _PyCFunction_FastCallDict() must not be called with an exception set, + because it may clear it (directly or indirectly) and so the + caller loses its exception */ + assert(!PyErr_Occurred()); + if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) { + return (*((__Pyx_PyCFunctionFastWithKeywords)(void*)meth)) (self, args, nargs, NULL); + } else { + return (*((__Pyx_PyCFunctionFast)(void*)meth)) (self, args, nargs); + } +} +#endif + +/* PyFunctionFastCall */ +#if CYTHON_FAST_PYCALL +static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, + PyObject *globals) { + PyFrameObject *f; + PyThreadState *tstate = __Pyx_PyThreadState_Current; + PyObject **fastlocals; + Py_ssize_t i; + PyObject *result; + assert(globals != NULL); + /* XXX Perhaps we should create a specialized + PyFrame_New() that doesn't take locals, but does + take builtins without sanity checking them. + */ + assert(tstate != NULL); + f = PyFrame_New(tstate, co, globals, NULL); + if (f == NULL) { + return NULL; + } + fastlocals = __Pyx_PyFrame_GetLocalsplus(f); + for (i = 0; i < na; i++) { + Py_INCREF(*args); + fastlocals[i] = *args++; + } + result = PyEval_EvalFrameEx(f,0); + ++tstate->recursion_depth; + Py_DECREF(f); + --tstate->recursion_depth; + return result; +} +#if 1 || PY_VERSION_HEX < 0x030600B1 +static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs) { + PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); + PyObject *globals = PyFunction_GET_GLOBALS(func); + PyObject *argdefs = PyFunction_GET_DEFAULTS(func); + PyObject *closure; +#if PY_MAJOR_VERSION >= 3 + PyObject *kwdefs; +#endif + PyObject *kwtuple, **k; + PyObject **d; + Py_ssize_t nd; + Py_ssize_t nk; + PyObject *result; + assert(kwargs == NULL || PyDict_Check(kwargs)); + nk = kwargs ? PyDict_Size(kwargs) : 0; + if (Py_EnterRecursiveCall((char*)" while calling a Python object")) { + return NULL; + } + if ( +#if PY_MAJOR_VERSION >= 3 + co->co_kwonlyargcount == 0 && +#endif + likely(kwargs == NULL || nk == 0) && + co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { + if (argdefs == NULL && co->co_argcount == nargs) { + result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); + goto done; + } + else if (nargs == 0 && argdefs != NULL + && co->co_argcount == Py_SIZE(argdefs)) { + /* function called with no arguments, but all parameters have + a default value: use default values as arguments .*/ + args = &PyTuple_GET_ITEM(argdefs, 0); + result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); + goto done; + } + } + if (kwargs != NULL) { + Py_ssize_t pos, i; + kwtuple = PyTuple_New(2 * nk); + if (kwtuple == NULL) { + result = NULL; + goto done; + } + k = &PyTuple_GET_ITEM(kwtuple, 0); + pos = i = 0; + while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { + Py_INCREF(k[i]); + Py_INCREF(k[i+1]); + i += 2; + } + nk = i / 2; + } + else { + kwtuple = NULL; + k = NULL; + } + closure = PyFunction_GET_CLOSURE(func); +#if PY_MAJOR_VERSION >= 3 + kwdefs = PyFunction_GET_KW_DEFAULTS(func); +#endif + if (argdefs != NULL) { + d = &PyTuple_GET_ITEM(argdefs, 0); + nd = Py_SIZE(argdefs); + } + else { + d = NULL; + nd = 0; + } +#if PY_MAJOR_VERSION >= 3 + result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, + args, nargs, + k, (int)nk, + d, (int)nd, kwdefs, closure); +#else + result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, + args, nargs, + k, (int)nk, + d, (int)nd, closure); +#endif + Py_XDECREF(kwtuple); +done: + Py_LeaveRecursiveCall(); + return result; +} +#endif +#endif + +/* PyObjectCall */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { + PyObject *result; + ternaryfunc call = func->ob_type->tp_call; + if (unlikely(!call)) + return PyObject_Call(func, arg, kw); + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; + result = (*call)(func, arg, kw); + Py_LeaveRecursiveCall(); + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +/* PyObjectCall2Args */ +static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) { + PyObject *args, *result = NULL; + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(function)) { + PyObject *args[2] = {arg1, arg2}; + return __Pyx_PyFunction_FastCall(function, args, 2); + } + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(function)) { + PyObject *args[2] = {arg1, arg2}; + return __Pyx_PyCFunction_FastCall(function, args, 2); + } + #endif + args = PyTuple_New(2); + if (unlikely(!args)) goto done; + Py_INCREF(arg1); + PyTuple_SET_ITEM(args, 0, arg1); + Py_INCREF(arg2); + PyTuple_SET_ITEM(args, 1, arg2); + Py_INCREF(function); + result = __Pyx_PyObject_Call(function, args, NULL); + Py_DECREF(args); + Py_DECREF(function); +done: + return result; +} + +/* PyObjectCallMethO */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { + PyObject *self, *result; + PyCFunction cfunc; + cfunc = PyCFunction_GET_FUNCTION(func); + self = PyCFunction_GET_SELF(func); + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; + result = cfunc(self, arg); + Py_LeaveRecursiveCall(); + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +/* PyObjectCallOneArg */ +#if CYTHON_COMPILING_IN_CPYTHON +static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) { + PyObject *result; + PyObject *args = PyTuple_New(1); + if (unlikely(!args)) return NULL; + Py_INCREF(arg); + PyTuple_SET_ITEM(args, 0, arg); + result = __Pyx_PyObject_Call(func, args, NULL); + Py_DECREF(args); + return result; +} +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { +#if CYTHON_FAST_PYCALL + if (PyFunction_Check(func)) { + return __Pyx_PyFunction_FastCall(func, &arg, 1); + } +#endif + if (likely(PyCFunction_Check(func))) { + if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) { + return __Pyx_PyObject_CallMethO(func, arg); +#if CYTHON_FAST_PYCCALL + } else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) { + return __Pyx_PyCFunction_FastCall(func, &arg, 1); +#endif + } + } + return __Pyx__PyObject_CallOneArg(func, arg); +} +#else +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { + PyObject *result; + PyObject *args = PyTuple_Pack(1, arg); + if (unlikely(!args)) return NULL; + result = __Pyx_PyObject_Call(func, args, NULL); + Py_DECREF(args); + return result; +} +#endif + +/* PyObjectCallNoArg */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { +#if CYTHON_FAST_PYCALL + if (PyFunction_Check(func)) { + return __Pyx_PyFunction_FastCall(func, NULL, 0); + } +#endif +#ifdef __Pyx_CyFunction_USED + if (likely(PyCFunction_Check(func) || __Pyx_CyFunction_Check(func))) +#else + if (likely(PyCFunction_Check(func))) +#endif + { + if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) { + return __Pyx_PyObject_CallMethO(func, NULL); + } + } + return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL); +} +#endif + +/* BytesEquals */ +static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { +#if CYTHON_COMPILING_IN_PYPY + return PyObject_RichCompareBool(s1, s2, equals); +#else + if (s1 == s2) { + return (equals == Py_EQ); + } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) { + const char *ps1, *ps2; + Py_ssize_t length = PyBytes_GET_SIZE(s1); + if (length != PyBytes_GET_SIZE(s2)) + return (equals == Py_NE); + ps1 = PyBytes_AS_STRING(s1); + ps2 = PyBytes_AS_STRING(s2); + if (ps1[0] != ps2[0]) { + return (equals == Py_NE); + } else if (length == 1) { + return (equals == Py_EQ); + } else { + int result; +#if CYTHON_USE_UNICODE_INTERNALS + Py_hash_t hash1, hash2; + hash1 = ((PyBytesObject*)s1)->ob_shash; + hash2 = ((PyBytesObject*)s2)->ob_shash; + if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { + return (equals == Py_NE); + } +#endif + result = memcmp(ps1, ps2, (size_t)length); + return (equals == Py_EQ) ? (result == 0) : (result != 0); + } + } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) { + return (equals == Py_NE); + } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) { + return (equals == Py_NE); + } else { + int result; + PyObject* py_result = PyObject_RichCompare(s1, s2, equals); + if (!py_result) + return -1; + result = __Pyx_PyObject_IsTrue(py_result); + Py_DECREF(py_result); + return result; + } +#endif +} + +/* UnicodeEquals */ +static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { +#if CYTHON_COMPILING_IN_PYPY + return PyObject_RichCompareBool(s1, s2, equals); +#else +#if PY_MAJOR_VERSION < 3 + PyObject* owned_ref = NULL; +#endif + int s1_is_unicode, s2_is_unicode; + if (s1 == s2) { + goto return_eq; + } + s1_is_unicode = PyUnicode_CheckExact(s1); + s2_is_unicode = PyUnicode_CheckExact(s2); +#if PY_MAJOR_VERSION < 3 + if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) { + owned_ref = PyUnicode_FromObject(s2); + if (unlikely(!owned_ref)) + return -1; + s2 = owned_ref; + s2_is_unicode = 1; + } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) { + owned_ref = PyUnicode_FromObject(s1); + if (unlikely(!owned_ref)) + return -1; + s1 = owned_ref; + s1_is_unicode = 1; + } else if (((!s2_is_unicode) & (!s1_is_unicode))) { + return __Pyx_PyBytes_Equals(s1, s2, equals); + } +#endif + if (s1_is_unicode & s2_is_unicode) { + Py_ssize_t length; + int kind; + void *data1, *data2; + if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0)) + return -1; + length = __Pyx_PyUnicode_GET_LENGTH(s1); + if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) { + goto return_ne; + } +#if CYTHON_USE_UNICODE_INTERNALS + { + Py_hash_t hash1, hash2; + #if CYTHON_PEP393_ENABLED + hash1 = ((PyASCIIObject*)s1)->hash; + hash2 = ((PyASCIIObject*)s2)->hash; + #else + hash1 = ((PyUnicodeObject*)s1)->hash; + hash2 = ((PyUnicodeObject*)s2)->hash; + #endif + if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { + goto return_ne; + } + } +#endif + kind = __Pyx_PyUnicode_KIND(s1); + if (kind != __Pyx_PyUnicode_KIND(s2)) { + goto return_ne; + } + data1 = __Pyx_PyUnicode_DATA(s1); + data2 = __Pyx_PyUnicode_DATA(s2); + if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) { + goto return_ne; + } else if (length == 1) { + goto return_eq; + } else { + int result = memcmp(data1, data2, (size_t)(length * kind)); + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_EQ) ? (result == 0) : (result != 0); + } + } else if ((s1 == Py_None) & s2_is_unicode) { + goto return_ne; + } else if ((s2 == Py_None) & s1_is_unicode) { + goto return_ne; + } else { + int result; + PyObject* py_result = PyObject_RichCompare(s1, s2, equals); + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + if (!py_result) + return -1; + result = __Pyx_PyObject_IsTrue(py_result); + Py_DECREF(py_result); + return result; + } +return_eq: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_EQ); +return_ne: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_NE); +#endif +} + +/* GetItemInt */ +static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { + PyObject *r; + if (!j) return NULL; + r = PyObject_GetItem(o, j); + Py_DECREF(j); + return r; +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, + CYTHON_NCP_UNUSED int wraparound, + CYTHON_NCP_UNUSED int boundscheck) { +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + Py_ssize_t wrapped_i = i; + if (wraparound & unlikely(i < 0)) { + wrapped_i += PyList_GET_SIZE(o); + } + if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) { + PyObject *r = PyList_GET_ITEM(o, wrapped_i); + Py_INCREF(r); + return r; + } + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +#else + return PySequence_GetItem(o, i); +#endif +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, + CYTHON_NCP_UNUSED int wraparound, + CYTHON_NCP_UNUSED int boundscheck) { +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + Py_ssize_t wrapped_i = i; + if (wraparound & unlikely(i < 0)) { + wrapped_i += PyTuple_GET_SIZE(o); + } + if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) { + PyObject *r = PyTuple_GET_ITEM(o, wrapped_i); + Py_INCREF(r); + return r; + } + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +#else + return PySequence_GetItem(o, i); +#endif +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, + CYTHON_NCP_UNUSED int wraparound, + CYTHON_NCP_UNUSED int boundscheck) { +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS + if (is_list || PyList_CheckExact(o)) { + Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); + if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) { + PyObject *r = PyList_GET_ITEM(o, n); + Py_INCREF(r); + return r; + } + } + else if (PyTuple_CheckExact(o)) { + Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o); + if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) { + PyObject *r = PyTuple_GET_ITEM(o, n); + Py_INCREF(r); + return r; + } + } else { + PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence; + if (likely(m && m->sq_item)) { + if (wraparound && unlikely(i < 0) && likely(m->sq_length)) { + Py_ssize_t l = m->sq_length(o); + if (likely(l >= 0)) { + i += l; + } else { + if (!PyErr_ExceptionMatches(PyExc_OverflowError)) + return NULL; + PyErr_Clear(); + } + } + return m->sq_item(o, i); + } + } +#else + if (is_list || PySequence_Check(o)) { + return PySequence_GetItem(o, i); + } +#endif + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +} + +/* RaiseDoubleKeywords */ +static void __Pyx_RaiseDoubleKeywordsError( + const char* func_name, + PyObject* kw_name) +{ + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION >= 3 + "%s() got multiple values for keyword argument '%U'", func_name, kw_name); + #else + "%s() got multiple values for keyword argument '%s'", func_name, + PyString_AsString(kw_name)); + #endif +} + +/* ParseKeywords */ +static int __Pyx_ParseOptionalKeywords( + PyObject *kwds, + PyObject **argnames[], + PyObject *kwds2, + PyObject *values[], + Py_ssize_t num_pos_args, + const char* function_name) +{ + PyObject *key = 0, *value = 0; + Py_ssize_t pos = 0; + PyObject*** name; + PyObject*** first_kw_arg = argnames + num_pos_args; + while (PyDict_Next(kwds, &pos, &key, &value)) { + name = first_kw_arg; + while (*name && (**name != key)) name++; + if (*name) { + values[name-argnames] = value; + continue; + } + name = first_kw_arg; + #if PY_MAJOR_VERSION < 3 + if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) { + while (*name) { + if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) + && _PyString_Eq(**name, key)) { + values[name-argnames] = value; + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + if ((**argname == key) || ( + (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) + && _PyString_Eq(**argname, key))) { + goto arg_passed_twice; + } + argname++; + } + } + } else + #endif + if (likely(PyUnicode_Check(key))) { + while (*name) { + int cmp = (**name == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 : + #endif + PyUnicode_Compare(**name, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) { + values[name-argnames] = value; + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + int cmp = (**argname == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 : + #endif + PyUnicode_Compare(**argname, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) goto arg_passed_twice; + argname++; + } + } + } else + goto invalid_keyword_type; + if (kwds2) { + if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; + } else { + goto invalid_keyword; + } + } + return 0; +arg_passed_twice: + __Pyx_RaiseDoubleKeywordsError(function_name, key); + goto bad; +invalid_keyword_type: + PyErr_Format(PyExc_TypeError, + "%.200s() keywords must be strings", function_name); + goto bad; +invalid_keyword: + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION < 3 + "%.200s() got an unexpected keyword argument '%.200s'", + function_name, PyString_AsString(key)); + #else + "%s() got an unexpected keyword argument '%U'", + function_name, key); + #endif +bad: + return -1; +} + +/* ArgTypeTest */ +static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact) +{ + if (unlikely(!type)) { + PyErr_SetString(PyExc_SystemError, "Missing type object"); + return 0; + } + else if (exact) { + #if PY_MAJOR_VERSION == 2 + if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1; + #endif + } + else { + if (likely(__Pyx_TypeCheck(obj, type))) return 1; + } + PyErr_Format(PyExc_TypeError, + "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)", + name, type->tp_name, Py_TYPE(obj)->tp_name); + return 0; +} + +/* ObjectGetItem */ +#if CYTHON_USE_TYPE_SLOTS +static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject* index) { + PyObject *runerr; + Py_ssize_t key_value; + PySequenceMethods *m = Py_TYPE(obj)->tp_as_sequence; + if (unlikely(!(m && m->sq_item))) { + PyErr_Format(PyExc_TypeError, "'%.200s' object is not subscriptable", Py_TYPE(obj)->tp_name); + return NULL; + } + key_value = __Pyx_PyIndex_AsSsize_t(index); + if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) { + return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1); + } + if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) { + PyErr_Clear(); + PyErr_Format(PyExc_IndexError, "cannot fit '%.200s' into an index-sized integer", Py_TYPE(index)->tp_name); + } + return NULL; +} +static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key) { + PyMappingMethods *m = Py_TYPE(obj)->tp_as_mapping; + if (likely(m && m->mp_subscript)) { + return m->mp_subscript(obj, key); + } + return __Pyx_PyObject_GetIndex(obj, key); +} +#endif + +/* GetTopmostException */ +#if CYTHON_USE_EXC_INFO_STACK +static _PyErr_StackItem * +__Pyx_PyErr_GetTopmostException(PyThreadState *tstate) +{ + _PyErr_StackItem *exc_info = tstate->exc_info; + while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) && + exc_info->previous_item != NULL) + { + exc_info = exc_info->previous_item; + } + return exc_info; +} +#endif + +/* SaveResetException */ +#if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { + #if CYTHON_USE_EXC_INFO_STACK + _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate); + *type = exc_info->exc_type; + *value = exc_info->exc_value; + *tb = exc_info->exc_traceback; + #else + *type = tstate->exc_type; + *value = tstate->exc_value; + *tb = tstate->exc_traceback; + #endif + Py_XINCREF(*type); + Py_XINCREF(*value); + Py_XINCREF(*tb); +} +static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + #if CYTHON_USE_EXC_INFO_STACK + _PyErr_StackItem *exc_info = tstate->exc_info; + tmp_type = exc_info->exc_type; + tmp_value = exc_info->exc_value; + tmp_tb = exc_info->exc_traceback; + exc_info->exc_type = type; + exc_info->exc_value = value; + exc_info->exc_traceback = tb; + #else + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = type; + tstate->exc_value = value; + tstate->exc_traceback = tb; + #endif + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +} +#endif + +/* PyErrExceptionMatches */ +#if CYTHON_FAST_THREAD_STATE +static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { + Py_ssize_t i, n; + n = PyTuple_GET_SIZE(tuple); +#if PY_MAJOR_VERSION >= 3 + for (i=0; icurexc_type; + if (exc_type == err) return 1; + if (unlikely(!exc_type)) return 0; + if (unlikely(PyTuple_Check(err))) + return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err); + return __Pyx_PyErr_GivenExceptionMatches(exc_type, err); +} +#endif + +/* GetException */ +#if CYTHON_FAST_THREAD_STATE +static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) +#else +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) +#endif +{ + PyObject *local_type, *local_value, *local_tb; +#if CYTHON_FAST_THREAD_STATE + PyObject *tmp_type, *tmp_value, *tmp_tb; + local_type = tstate->curexc_type; + local_value = tstate->curexc_value; + local_tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +#else + PyErr_Fetch(&local_type, &local_value, &local_tb); +#endif + PyErr_NormalizeException(&local_type, &local_value, &local_tb); +#if CYTHON_FAST_THREAD_STATE + if (unlikely(tstate->curexc_type)) +#else + if (unlikely(PyErr_Occurred())) +#endif + goto bad; + #if PY_MAJOR_VERSION >= 3 + if (local_tb) { + if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) + goto bad; + } + #endif + Py_XINCREF(local_tb); + Py_XINCREF(local_type); + Py_XINCREF(local_value); + *type = local_type; + *value = local_value; + *tb = local_tb; +#if CYTHON_FAST_THREAD_STATE + #if CYTHON_USE_EXC_INFO_STACK + { + _PyErr_StackItem *exc_info = tstate->exc_info; + tmp_type = exc_info->exc_type; + tmp_value = exc_info->exc_value; + tmp_tb = exc_info->exc_traceback; + exc_info->exc_type = local_type; + exc_info->exc_value = local_value; + exc_info->exc_traceback = local_tb; + } + #else + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = local_type; + tstate->exc_value = local_value; + tstate->exc_traceback = local_tb; + #endif + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#else + PyErr_SetExcInfo(local_type, local_value, local_tb); +#endif + return 0; +bad: + *type = 0; + *value = 0; + *tb = 0; + Py_XDECREF(local_type); + Py_XDECREF(local_value); + Py_XDECREF(local_tb); + return -1; +} + +/* StringJoin */ +#if !CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values) { + return PyObject_CallMethodObjArgs(sep, __pyx_n_s_join, values, NULL); +} +#endif + +/* PyObject_GenericGetAttrNoDict */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) { + PyErr_Format(PyExc_AttributeError, +#if PY_MAJOR_VERSION >= 3 + "'%.50s' object has no attribute '%U'", + tp->tp_name, attr_name); +#else + "'%.50s' object has no attribute '%.400s'", + tp->tp_name, PyString_AS_STRING(attr_name)); +#endif + return NULL; +} +static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) { + PyObject *descr; + PyTypeObject *tp = Py_TYPE(obj); + if (unlikely(!PyString_Check(attr_name))) { + return PyObject_GenericGetAttr(obj, attr_name); + } + assert(!tp->tp_dictoffset); + descr = _PyType_Lookup(tp, attr_name); + if (unlikely(!descr)) { + return __Pyx_RaiseGenericGetAttributeError(tp, attr_name); + } + Py_INCREF(descr); + #if PY_MAJOR_VERSION < 3 + if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS))) + #endif + { + descrgetfunc f = Py_TYPE(descr)->tp_descr_get; + if (unlikely(f)) { + PyObject *res = f(descr, obj, (PyObject *)tp); + Py_DECREF(descr); + return res; + } + } + return descr; +} +#endif + +/* PyObject_GenericGetAttr */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) { + if (unlikely(Py_TYPE(obj)->tp_dictoffset)) { + return PyObject_GenericGetAttr(obj, attr_name); + } + return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name); +} +#endif + +/* SetVTable */ +static int __Pyx_SetVtable(PyObject *dict, void *vtable) { +#if PY_VERSION_HEX >= 0x02070000 + PyObject *ob = PyCapsule_New(vtable, 0, 0); +#else + PyObject *ob = PyCObject_FromVoidPtr(vtable, 0); +#endif + if (!ob) + goto bad; + if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0) + goto bad; + Py_DECREF(ob); + return 0; +bad: + Py_XDECREF(ob); + return -1; +} + +/* Import */ +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { + PyObject *empty_list = 0; + PyObject *module = 0; + PyObject *global_dict = 0; + PyObject *empty_dict = 0; + PyObject *list; + #if PY_MAJOR_VERSION < 3 + PyObject *py_import; + py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); + if (!py_import) + goto bad; + #endif + if (from_list) + list = from_list; + else { + empty_list = PyList_New(0); + if (!empty_list) + goto bad; + list = empty_list; + } + global_dict = PyModule_GetDict(__pyx_m); + if (!global_dict) + goto bad; + empty_dict = PyDict_New(); + if (!empty_dict) + goto bad; + { + #if PY_MAJOR_VERSION >= 3 + if (level == -1) { + if (strchr(__Pyx_MODULE_NAME, '.')) { + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, 1); + if (!module) { + if (!PyErr_ExceptionMatches(PyExc_ImportError)) + goto bad; + PyErr_Clear(); + } + } + level = 0; + } + #endif + if (!module) { + #if PY_MAJOR_VERSION < 3 + PyObject *py_level = PyInt_FromLong(level); + if (!py_level) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, py_level, (PyObject *)NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, level); + #endif + } + } +bad: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(py_import); + #endif + Py_XDECREF(empty_list); + Py_XDECREF(empty_dict); + return module; +} + +/* ImportFrom */ +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { + PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); + if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_Format(PyExc_ImportError, + #if PY_MAJOR_VERSION < 3 + "cannot import name %.230s", PyString_AS_STRING(name)); + #else + "cannot import name %S", name); + #endif + } + return value; +} + +/* FetchCommonType */ +static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { + PyObject* fake_module; + PyTypeObject* cached_type = NULL; + fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI); + if (!fake_module) return NULL; + Py_INCREF(fake_module); + cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name); + if (cached_type) { + if (!PyType_Check((PyObject*)cached_type)) { + PyErr_Format(PyExc_TypeError, + "Shared Cython type %.200s is not a type object", + type->tp_name); + goto bad; + } + if (cached_type->tp_basicsize != type->tp_basicsize) { + PyErr_Format(PyExc_TypeError, + "Shared Cython type %.200s has the wrong size, try recompiling", + type->tp_name); + goto bad; + } + } else { + if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; + PyErr_Clear(); + if (PyType_Ready(type) < 0) goto bad; + if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0) + goto bad; + Py_INCREF(type); + cached_type = type; + } +done: + Py_DECREF(fake_module); + return cached_type; +bad: + Py_XDECREF(cached_type); + cached_type = NULL; + goto done; +} + +/* CythonFunction */ +#include +static PyObject * +__Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure) +{ + if (unlikely(op->func_doc == NULL)) { + if (op->func.m_ml->ml_doc) { +#if PY_MAJOR_VERSION >= 3 + op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc); +#else + op->func_doc = PyString_FromString(op->func.m_ml->ml_doc); +#endif + if (unlikely(op->func_doc == NULL)) + return NULL; + } else { + Py_INCREF(Py_None); + return Py_None; + } + } + Py_INCREF(op->func_doc); + return op->func_doc; +} +static int +__Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context) +{ + PyObject *tmp = op->func_doc; + if (value == NULL) { + value = Py_None; + } + Py_INCREF(value); + op->func_doc = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + if (unlikely(op->func_name == NULL)) { +#if PY_MAJOR_VERSION >= 3 + op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name); +#else + op->func_name = PyString_InternFromString(op->func.m_ml->ml_name); +#endif + if (unlikely(op->func_name == NULL)) + return NULL; + } + Py_INCREF(op->func_name); + return op->func_name; +} +static int +__Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context) +{ + PyObject *tmp; +#if PY_MAJOR_VERSION >= 3 + if (unlikely(value == NULL || !PyUnicode_Check(value))) +#else + if (unlikely(value == NULL || !PyString_Check(value))) +#endif + { + PyErr_SetString(PyExc_TypeError, + "__name__ must be set to a string object"); + return -1; + } + tmp = op->func_name; + Py_INCREF(value); + op->func_name = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + Py_INCREF(op->func_qualname); + return op->func_qualname; +} +static int +__Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context) +{ + PyObject *tmp; +#if PY_MAJOR_VERSION >= 3 + if (unlikely(value == NULL || !PyUnicode_Check(value))) +#else + if (unlikely(value == NULL || !PyString_Check(value))) +#endif + { + PyErr_SetString(PyExc_TypeError, + "__qualname__ must be set to a string object"); + return -1; + } + tmp = op->func_qualname; + Py_INCREF(value); + op->func_qualname = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED void *closure) +{ + PyObject *self; + self = m->func_closure; + if (self == NULL) + self = Py_None; + Py_INCREF(self); + return self; +} +static PyObject * +__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + if (unlikely(op->func_dict == NULL)) { + op->func_dict = PyDict_New(); + if (unlikely(op->func_dict == NULL)) + return NULL; + } + Py_INCREF(op->func_dict); + return op->func_dict; +} +static int +__Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context) +{ + PyObject *tmp; + if (unlikely(value == NULL)) { + PyErr_SetString(PyExc_TypeError, + "function's dictionary may not be deleted"); + return -1; + } + if (unlikely(!PyDict_Check(value))) { + PyErr_SetString(PyExc_TypeError, + "setting function's dictionary to a non-dict"); + return -1; + } + tmp = op->func_dict; + Py_INCREF(value); + op->func_dict = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + Py_INCREF(op->func_globals); + return op->func_globals; +} +static PyObject * +__Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + Py_INCREF(Py_None); + return Py_None; +} +static PyObject * +__Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + PyObject* result = (op->func_code) ? op->func_code : Py_None; + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { + int result = 0; + PyObject *res = op->defaults_getter((PyObject *) op); + if (unlikely(!res)) + return -1; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + op->defaults_tuple = PyTuple_GET_ITEM(res, 0); + Py_INCREF(op->defaults_tuple); + op->defaults_kwdict = PyTuple_GET_ITEM(res, 1); + Py_INCREF(op->defaults_kwdict); + #else + op->defaults_tuple = PySequence_ITEM(res, 0); + if (unlikely(!op->defaults_tuple)) result = -1; + else { + op->defaults_kwdict = PySequence_ITEM(res, 1); + if (unlikely(!op->defaults_kwdict)) result = -1; + } + #endif + Py_DECREF(res); + return result; +} +static int +__Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) { + PyObject* tmp; + if (!value) { + value = Py_None; + } else if (value != Py_None && !PyTuple_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__defaults__ must be set to a tuple object"); + return -1; + } + Py_INCREF(value); + tmp = op->defaults_tuple; + op->defaults_tuple = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) { + PyObject* result = op->defaults_tuple; + if (unlikely(!result)) { + if (op->defaults_getter) { + if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL; + result = op->defaults_tuple; + } else { + result = Py_None; + } + } + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) { + PyObject* tmp; + if (!value) { + value = Py_None; + } else if (value != Py_None && !PyDict_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__kwdefaults__ must be set to a dict object"); + return -1; + } + Py_INCREF(value); + tmp = op->defaults_kwdict; + op->defaults_kwdict = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) { + PyObject* result = op->defaults_kwdict; + if (unlikely(!result)) { + if (op->defaults_getter) { + if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL; + result = op->defaults_kwdict; + } else { + result = Py_None; + } + } + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) { + PyObject* tmp; + if (!value || value == Py_None) { + value = NULL; + } else if (!PyDict_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__annotations__ must be set to a dict object"); + return -1; + } + Py_XINCREF(value); + tmp = op->func_annotations; + op->func_annotations = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) { + PyObject* result = op->func_annotations; + if (unlikely(!result)) { + result = PyDict_New(); + if (unlikely(!result)) return NULL; + op->func_annotations = result; + } + Py_INCREF(result); + return result; +} +static PyGetSetDef __pyx_CyFunction_getsets[] = { + {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, + {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, + {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, + {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, + {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, + {(char *) "__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0}, + {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, + {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, + {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, + {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, + {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, + {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, + {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, + {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, + {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, + {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, + {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, + {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, + {0, 0, 0, 0, 0} +}; +static PyMemberDef __pyx_CyFunction_members[] = { + {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), PY_WRITE_RESTRICTED, 0}, + {0, 0, 0, 0, 0} +}; +static PyObject * +__Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args) +{ +#if PY_MAJOR_VERSION >= 3 + return PyUnicode_FromString(m->func.m_ml->ml_name); +#else + return PyString_FromString(m->func.m_ml->ml_name); +#endif +} +static PyMethodDef __pyx_CyFunction_methods[] = { + {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, + {0, 0, 0, 0} +}; +#if PY_VERSION_HEX < 0x030500A0 +#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist) +#else +#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func.m_weakreflist) +#endif +static PyObject *__Pyx_CyFunction_New(PyTypeObject *type, PyMethodDef *ml, int flags, PyObject* qualname, + PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { + __pyx_CyFunctionObject *op = PyObject_GC_New(__pyx_CyFunctionObject, type); + if (op == NULL) + return NULL; + op->flags = flags; + __Pyx_CyFunction_weakreflist(op) = NULL; + op->func.m_ml = ml; + op->func.m_self = (PyObject *) op; + Py_XINCREF(closure); + op->func_closure = closure; + Py_XINCREF(module); + op->func.m_module = module; + op->func_dict = NULL; + op->func_name = NULL; + Py_INCREF(qualname); + op->func_qualname = qualname; + op->func_doc = NULL; + op->func_classobj = NULL; + op->func_globals = globals; + Py_INCREF(op->func_globals); + Py_XINCREF(code); + op->func_code = code; + op->defaults_pyobjects = 0; + op->defaults = NULL; + op->defaults_tuple = NULL; + op->defaults_kwdict = NULL; + op->defaults_getter = NULL; + op->func_annotations = NULL; + PyObject_GC_Track(op); + return (PyObject *) op; +} +static int +__Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) +{ + Py_CLEAR(m->func_closure); + Py_CLEAR(m->func.m_module); + Py_CLEAR(m->func_dict); + Py_CLEAR(m->func_name); + Py_CLEAR(m->func_qualname); + Py_CLEAR(m->func_doc); + Py_CLEAR(m->func_globals); + Py_CLEAR(m->func_code); + Py_CLEAR(m->func_classobj); + Py_CLEAR(m->defaults_tuple); + Py_CLEAR(m->defaults_kwdict); + Py_CLEAR(m->func_annotations); + if (m->defaults) { + PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); + int i; + for (i = 0; i < m->defaults_pyobjects; i++) + Py_XDECREF(pydefaults[i]); + PyObject_Free(m->defaults); + m->defaults = NULL; + } + return 0; +} +static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m) +{ + if (__Pyx_CyFunction_weakreflist(m) != NULL) + PyObject_ClearWeakRefs((PyObject *) m); + __Pyx_CyFunction_clear(m); + PyObject_GC_Del(m); +} +static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) +{ + PyObject_GC_UnTrack(m); + __Pyx__CyFunction_dealloc(m); +} +static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) +{ + Py_VISIT(m->func_closure); + Py_VISIT(m->func.m_module); + Py_VISIT(m->func_dict); + Py_VISIT(m->func_name); + Py_VISIT(m->func_qualname); + Py_VISIT(m->func_doc); + Py_VISIT(m->func_globals); + Py_VISIT(m->func_code); + Py_VISIT(m->func_classobj); + Py_VISIT(m->defaults_tuple); + Py_VISIT(m->defaults_kwdict); + if (m->defaults) { + PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); + int i; + for (i = 0; i < m->defaults_pyobjects; i++) + Py_VISIT(pydefaults[i]); + } + return 0; +} +static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type) +{ + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) { + Py_INCREF(func); + return func; + } + if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) { + if (type == NULL) + type = (PyObject *)(Py_TYPE(obj)); + return __Pyx_PyMethod_New(func, type, (PyObject *)(Py_TYPE(type))); + } + if (obj == Py_None) + obj = NULL; + return __Pyx_PyMethod_New(func, obj, type); +} +static PyObject* +__Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) +{ +#if PY_MAJOR_VERSION >= 3 + return PyUnicode_FromFormat("", + op->func_qualname, (void *)op); +#else + return PyString_FromFormat("", + PyString_AsString(op->func_qualname), (void *)op); +#endif +} +static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) { + PyCFunctionObject* f = (PyCFunctionObject*)func; + PyCFunction meth = f->m_ml->ml_meth; + Py_ssize_t size; + switch (f->m_ml->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) { + case METH_VARARGS: + if (likely(kw == NULL || PyDict_Size(kw) == 0)) + return (*meth)(self, arg); + break; + case METH_VARARGS | METH_KEYWORDS: + return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw); + case METH_NOARGS: + if (likely(kw == NULL || PyDict_Size(kw) == 0)) { + size = PyTuple_GET_SIZE(arg); + if (likely(size == 0)) + return (*meth)(self, NULL); + PyErr_Format(PyExc_TypeError, + "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", + f->m_ml->ml_name, size); + return NULL; + } + break; + case METH_O: + if (likely(kw == NULL || PyDict_Size(kw) == 0)) { + size = PyTuple_GET_SIZE(arg); + if (likely(size == 1)) { + PyObject *result, *arg0; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + arg0 = PyTuple_GET_ITEM(arg, 0); + #else + arg0 = PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL; + #endif + result = (*meth)(self, arg0); + #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) + Py_DECREF(arg0); + #endif + return result; + } + PyErr_Format(PyExc_TypeError, + "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", + f->m_ml->ml_name, size); + return NULL; + } + break; + default: + PyErr_SetString(PyExc_SystemError, "Bad call flags in " + "__Pyx_CyFunction_Call. METH_OLDARGS is no " + "longer supported!"); + return NULL; + } + PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", + f->m_ml->ml_name); + return NULL; +} +static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { + return __Pyx_CyFunction_CallMethod(func, ((PyCFunctionObject*)func)->m_self, arg, kw); +} +static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) { + PyObject *result; + __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func; + if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { + Py_ssize_t argc; + PyObject *new_args; + PyObject *self; + argc = PyTuple_GET_SIZE(args); + new_args = PyTuple_GetSlice(args, 1, argc); + if (unlikely(!new_args)) + return NULL; + self = PyTuple_GetItem(args, 0); + if (unlikely(!self)) { + Py_DECREF(new_args); + return NULL; + } + result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw); + Py_DECREF(new_args); + } else { + result = __Pyx_CyFunction_Call(func, args, kw); + } + return result; +} +static PyTypeObject __pyx_CyFunctionType_type = { + PyVarObject_HEAD_INIT(0, 0) + "cython_function_or_method", + sizeof(__pyx_CyFunctionObject), + 0, + (destructor) __Pyx_CyFunction_dealloc, + 0, + 0, + 0, +#if PY_MAJOR_VERSION < 3 + 0, +#else + 0, +#endif + (reprfunc) __Pyx_CyFunction_repr, + 0, + 0, + 0, + 0, + __Pyx_CyFunction_CallAsMethod, + 0, + 0, + 0, + 0, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, + 0, + (traverseproc) __Pyx_CyFunction_traverse, + (inquiry) __Pyx_CyFunction_clear, + 0, +#if PY_VERSION_HEX < 0x030500A0 + offsetof(__pyx_CyFunctionObject, func_weakreflist), +#else + offsetof(PyCFunctionObject, m_weakreflist), +#endif + 0, + 0, + __pyx_CyFunction_methods, + __pyx_CyFunction_members, + __pyx_CyFunction_getsets, + 0, + 0, + __Pyx_CyFunction_descr_get, + 0, + offsetof(__pyx_CyFunctionObject, func_dict), + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, +#if PY_VERSION_HEX >= 0x030400a1 + 0, +#endif +}; +static int __pyx_CyFunction_init(void) { + __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); + if (unlikely(__pyx_CyFunctionType == NULL)) { + return -1; + } + return 0; +} +static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults = PyObject_Malloc(size); + if (unlikely(!m->defaults)) + return PyErr_NoMemory(); + memset(m->defaults, 0, size); + m->defaults_pyobjects = pyobjects; + return m->defaults; +} +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults_tuple = tuple; + Py_INCREF(tuple); +} +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults_kwdict = dict; + Py_INCREF(dict); +} +static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->func_annotations = dict; + Py_INCREF(dict); +} + +/* GetModuleGlobalName */ +#if CYTHON_USE_DICT_VERSIONS +static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value) +#else +static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) +#endif +{ + PyObject *result; +#if !CYTHON_AVOID_BORROWED_REFS +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 + result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } else if (unlikely(PyErr_Occurred())) { + return NULL; + } +#else + result = PyDict_GetItem(__pyx_d, name); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } +#endif +#else + result = PyObject_GetItem(__pyx_d, name); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } + PyErr_Clear(); +#endif + return __Pyx_GetBuiltinName(name); +} + +/* GetAttr */ +static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) { +#if CYTHON_USE_TYPE_SLOTS +#if PY_MAJOR_VERSION >= 3 + if (likely(PyUnicode_Check(n))) +#else + if (likely(PyString_Check(n))) +#endif + return __Pyx_PyObject_GetAttrStr(o, n); +#endif + return PyObject_GetAttr(o, n); +} + +/* Globals */ +static PyObject* __Pyx_Globals(void) { + Py_ssize_t i; + PyObject *names; + PyObject *globals = __pyx_d; + Py_INCREF(globals); + names = PyObject_Dir(__pyx_m); + if (!names) + goto bad; + for (i = PyList_GET_SIZE(names)-1; i >= 0; i--) { +#if CYTHON_COMPILING_IN_PYPY + PyObject* name = PySequence_ITEM(names, i); + if (!name) + goto bad; +#else + PyObject* name = PyList_GET_ITEM(names, i); +#endif + if (!PyDict_Contains(globals, name)) { + PyObject* value = __Pyx_GetAttr(__pyx_m, name); + if (!value) { +#if CYTHON_COMPILING_IN_PYPY + Py_DECREF(name); +#endif + goto bad; + } + if (PyDict_SetItem(globals, name, value) < 0) { +#if CYTHON_COMPILING_IN_PYPY + Py_DECREF(name); +#endif + Py_DECREF(value); + goto bad; + } + } +#if CYTHON_COMPILING_IN_PYPY + Py_DECREF(name); +#endif + } + Py_DECREF(names); + return globals; +bad: + Py_XDECREF(names); + Py_XDECREF(globals); + return NULL; +} + +/* PyErrFetchRestore */ +#if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + tmp_type = tstate->curexc_type; + tmp_value = tstate->curexc_value; + tmp_tb = tstate->curexc_traceback; + tstate->curexc_type = type; + tstate->curexc_value = value; + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +} +static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { + *type = tstate->curexc_type; + *value = tstate->curexc_value; + *tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +} +#endif + +/* CLineInTraceback */ +#ifndef CYTHON_CLINE_IN_TRACEBACK +static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { + PyObject *use_cline; + PyObject *ptype, *pvalue, *ptraceback; +#if CYTHON_COMPILING_IN_CPYTHON + PyObject **cython_runtime_dict; +#endif + if (unlikely(!__pyx_cython_runtime)) { + return c_line; + } + __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); +#if CYTHON_COMPILING_IN_CPYTHON + cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); + if (likely(cython_runtime_dict)) { + __PYX_PY_DICT_LOOKUP_IF_MODIFIED( + use_cline, *cython_runtime_dict, + __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback)) + } else +#endif + { + PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback); + if (use_cline_obj) { + use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; + Py_DECREF(use_cline_obj); + } else { + PyErr_Clear(); + use_cline = NULL; + } + } + if (!use_cline) { + c_line = 0; + PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); + } + else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { + c_line = 0; + } + __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); + return c_line; +} +#endif + +/* CodeObjectCache */ +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { + int start = 0, mid = 0, end = count - 1; + if (end >= 0 && code_line > entries[end].code_line) { + return count; + } + while (start < end) { + mid = start + (end - start) / 2; + if (code_line < entries[mid].code_line) { + end = mid; + } else if (code_line > entries[mid].code_line) { + start = mid + 1; + } else { + return mid; + } + } + if (code_line <= entries[mid].code_line) { + return mid; + } else { + return mid + 1; + } +} +static PyCodeObject *__pyx_find_code_object(int code_line) { + PyCodeObject* code_object; + int pos; + if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { + return NULL; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { + return NULL; + } + code_object = __pyx_code_cache.entries[pos].code_object; + Py_INCREF(code_object); + return code_object; +} +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { + int pos, i; + __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; + if (unlikely(!code_line)) { + return; + } + if (unlikely(!entries)) { + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); + if (likely(entries)) { + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = 64; + __pyx_code_cache.count = 1; + entries[0].code_line = code_line; + entries[0].code_object = code_object; + Py_INCREF(code_object); + } + return; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { + PyCodeObject* tmp = entries[pos].code_object; + entries[pos].code_object = code_object; + Py_DECREF(tmp); + return; + } + if (__pyx_code_cache.count == __pyx_code_cache.max_count) { + int new_max = __pyx_code_cache.max_count + 64; + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( + __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry)); + if (unlikely(!entries)) { + return; + } + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = new_max; + } + for (i=__pyx_code_cache.count; i>pos; i--) { + entries[i] = entries[i-1]; + } + entries[pos].code_line = code_line; + entries[pos].code_object = code_object; + __pyx_code_cache.count++; + Py_INCREF(code_object); +} + +/* AddTraceback */ +#include "compile.h" +#include "frameobject.h" +#include "traceback.h" +static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( + const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyObject *py_srcfile = 0; + PyObject *py_funcname = 0; + #if PY_MAJOR_VERSION < 3 + py_srcfile = PyString_FromString(filename); + #else + py_srcfile = PyUnicode_FromString(filename); + #endif + if (!py_srcfile) goto bad; + if (c_line) { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + #else + py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + #endif + } + else { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromString(funcname); + #else + py_funcname = PyUnicode_FromString(funcname); + #endif + } + if (!py_funcname) goto bad; + py_code = __Pyx_PyCode_New( + 0, + 0, + 0, + 0, + 0, + __pyx_empty_bytes, /*PyObject *code,*/ + __pyx_empty_tuple, /*PyObject *consts,*/ + __pyx_empty_tuple, /*PyObject *names,*/ + __pyx_empty_tuple, /*PyObject *varnames,*/ + __pyx_empty_tuple, /*PyObject *freevars,*/ + __pyx_empty_tuple, /*PyObject *cellvars,*/ + py_srcfile, /*PyObject *filename,*/ + py_funcname, /*PyObject *name,*/ + py_line, + __pyx_empty_bytes /*PyObject *lnotab*/ + ); + Py_DECREF(py_srcfile); + Py_DECREF(py_funcname); + return py_code; +bad: + Py_XDECREF(py_srcfile); + Py_XDECREF(py_funcname); + return NULL; +} +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyFrameObject *py_frame = 0; + PyThreadState *tstate = __Pyx_PyThreadState_Current; + if (c_line) { + c_line = __Pyx_CLineForTraceback(tstate, c_line); + } + py_code = __pyx_find_code_object(c_line ? -c_line : py_line); + if (!py_code) { + py_code = __Pyx_CreateCodeObjectForTraceback( + funcname, c_line, py_line, filename); + if (!py_code) goto bad; + __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); + } + py_frame = PyFrame_New( + tstate, /*PyThreadState *tstate,*/ + py_code, /*PyCodeObject *code,*/ + __pyx_d, /*PyObject *globals,*/ + 0 /*PyObject *locals*/ + ); + if (!py_frame) goto bad; + __Pyx_PyFrame_SetLineNumber(py_frame, py_line); + PyTraceBack_Here(py_frame); +bad: + Py_XDECREF(py_code); + Py_XDECREF(py_frame); +} + +/* CIntToPy */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { + const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(long) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(long) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(long) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(long), + little, !is_unsigned); + } +} + +/* CIntFromPyVerify */ +#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ + __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) +#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ + __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) +#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ + {\ + func_type value = func_value;\ + if (sizeof(target_type) < sizeof(func_type)) {\ + if (unlikely(value != (func_type) (target_type) value)) {\ + func_type zero = 0;\ + if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ + return (target_type) -1;\ + if (is_unsigned && unlikely(value < zero))\ + goto raise_neg_overflow;\ + else\ + goto raise_overflow;\ + }\ + }\ + return (target_type) value;\ + } + +/* CIntFromPy */ +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { + const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(long) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (long) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (long) 0; + case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0]) + case 2: + if (8 * sizeof(long) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) { + return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + case 3: + if (8 * sizeof(long) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) { + return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + case 4: + if (8 * sizeof(long) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) { + return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (long) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if (sizeof(long) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (long) 0; + case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0])) + case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0]) + case -2: + if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 2: + if (8 * sizeof(long) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case -3: + if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 3: + if (8 * sizeof(long) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case -4: + if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 4: + if (8 * sizeof(long) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + } +#endif + if (sizeof(long) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + long val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (long) -1; + } + } else { + long val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (long) -1; + val = __Pyx_PyInt_As_long(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to long"); + return (long) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to long"); + return (long) -1; +} + +/* CIntFromPy */ +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { + const int neg_one = (int) ((int) 0 - (int) 1), const_zero = (int) 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(int) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (int) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (int) 0; + case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0]) + case 2: + if (8 * sizeof(int) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) { + return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + case 3: + if (8 * sizeof(int) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) { + return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + case 4: + if (8 * sizeof(int) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) { + return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (int) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if (sizeof(int) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (int) 0; + case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0])) + case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0]) + case -2: + if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { + return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 2: + if (8 * sizeof(int) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { + return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case -3: + if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { + return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 3: + if (8 * sizeof(int) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { + return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case -4: + if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { + return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 4: + if (8 * sizeof(int) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { + return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + } +#endif + if (sizeof(int) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + int val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (int) -1; + } + } else { + int val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (int) -1; + val = __Pyx_PyInt_As_int(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to int"); + return (int) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to int"); + return (int) -1; +} + +/* FastTypeChecks */ +#if CYTHON_COMPILING_IN_CPYTHON +static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) { + while (a) { + a = a->tp_base; + if (a == b) + return 1; + } + return b == &PyBaseObject_Type; +} +static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) { + PyObject *mro; + if (a == b) return 1; + mro = a->tp_mro; + if (likely(mro)) { + Py_ssize_t i, n; + n = PyTuple_GET_SIZE(mro); + for (i = 0; i < n; i++) { + if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b) + return 1; + } + return 0; + } + return __Pyx_InBases(a, b); +} +#if PY_MAJOR_VERSION == 2 +static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { + PyObject *exception, *value, *tb; + int res; + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ErrFetch(&exception, &value, &tb); + res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; + if (unlikely(res == -1)) { + PyErr_WriteUnraisable(err); + res = 0; + } + if (!res) { + res = PyObject_IsSubclass(err, exc_type2); + if (unlikely(res == -1)) { + PyErr_WriteUnraisable(err); + res = 0; + } + } + __Pyx_ErrRestore(exception, value, tb); + return res; +} +#else +static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { + int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0; + if (!res) { + res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); + } + return res; +} +#endif +static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { + Py_ssize_t i, n; + assert(PyExceptionClass_Check(exc_type)); + n = PyTuple_GET_SIZE(tuple); +#if PY_MAJOR_VERSION >= 3 + for (i=0; itp_setattro)) + return tp->tp_setattro(obj, attr_name, value); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_setattr)) + return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value); +#endif + return PyObject_SetAttr(obj, attr_name, value); +} +#endif + +/* VoidPtrExport */ +static int __Pyx_ExportVoidPtr(PyObject *name, void *p, const char *sig) { + PyObject *d; + PyObject *cobj = 0; + d = PyDict_GetItem(__pyx_d, __pyx_n_s_pyx_capi); + Py_XINCREF(d); + if (!d) { + d = PyDict_New(); + if (!d) + goto bad; + if (__Pyx_PyObject_SetAttrStr(__pyx_m, __pyx_n_s_pyx_capi, d) < 0) + goto bad; + } +#if PY_VERSION_HEX >= 0x02070000 + cobj = PyCapsule_New(p, sig, 0); +#else + cobj = PyCObject_FromVoidPtrAndDesc(p, (void *)sig, 0); +#endif + if (!cobj) + goto bad; + if (PyDict_SetItem(d, name, cobj) < 0) + goto bad; + Py_DECREF(cobj); + Py_DECREF(d); + return 0; +bad: + Py_XDECREF(cobj); + Py_XDECREF(d); + return -1; +} + +/* InitStrings */ +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { + while (t->p) { + #if PY_MAJOR_VERSION < 3 + if (t->is_unicode) { + *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); + } else if (t->intern) { + *t->p = PyString_InternFromString(t->s); + } else { + *t->p = PyString_FromStringAndSize(t->s, t->n - 1); + } + #else + if (t->is_unicode | t->is_str) { + if (t->intern) { + *t->p = PyUnicode_InternFromString(t->s); + } else if (t->encoding) { + *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); + } else { + *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); + } + } else { + *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); + } + #endif + if (!*t->p) + return -1; + if (PyObject_Hash(*t->p) == -1) + return -1; + ++t; + } + return 0; +} + +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { + return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); +} +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { + Py_ssize_t ignore; + return __Pyx_PyObject_AsStringAndSize(o, &ignore); +} +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +#if !CYTHON_PEP393_ENABLED +static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { + char* defenc_c; + PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); + if (!defenc) return NULL; + defenc_c = PyBytes_AS_STRING(defenc); +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + { + char* end = defenc_c + PyBytes_GET_SIZE(defenc); + char* c; + for (c = defenc_c; c < end; c++) { + if ((unsigned char) (*c) >= 128) { + PyUnicode_AsASCIIString(o); + return NULL; + } + } + } +#endif + *length = PyBytes_GET_SIZE(defenc); + return defenc_c; +} +#else +static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { + if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + if (likely(PyUnicode_IS_ASCII(o))) { + *length = PyUnicode_GET_LENGTH(o); + return PyUnicode_AsUTF8(o); + } else { + PyUnicode_AsASCIIString(o); + return NULL; + } +#else + return PyUnicode_AsUTF8AndSize(o, length); +#endif +} +#endif +#endif +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT + if ( +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + __Pyx_sys_getdefaultencoding_not_ascii && +#endif + PyUnicode_Check(o)) { + return __Pyx_PyUnicode_AsStringAndSize(o, length); + } else +#endif +#if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) + if (PyByteArray_Check(o)) { + *length = PyByteArray_GET_SIZE(o); + return PyByteArray_AS_STRING(o); + } else +#endif + { + char* result; + int r = PyBytes_AsStringAndSize(o, &result, length); + if (unlikely(r < 0)) { + return NULL; + } else { + return result; + } + } +} +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { + int is_true = x == Py_True; + if (is_true | (x == Py_False) | (x == Py_None)) return is_true; + else return PyObject_IsTrue(x); +} +static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) { + int retval; + if (unlikely(!x)) return -1; + retval = __Pyx_PyObject_IsTrue(x); + Py_DECREF(x); + return retval; +} +static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) { +#if PY_MAJOR_VERSION >= 3 + if (PyLong_Check(result)) { + if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, + "__int__ returned non-int (type %.200s). " + "The ability to return an instance of a strict subclass of int " + "is deprecated, and may be removed in a future version of Python.", + Py_TYPE(result)->tp_name)) { + Py_DECREF(result); + return NULL; + } + return result; + } +#endif + PyErr_Format(PyExc_TypeError, + "__%.4s__ returned non-%.4s (type %.200s)", + type_name, type_name, Py_TYPE(result)->tp_name); + Py_DECREF(result); + return NULL; +} +static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { +#if CYTHON_USE_TYPE_SLOTS + PyNumberMethods *m; +#endif + const char *name = NULL; + PyObject *res = NULL; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x) || PyLong_Check(x))) +#else + if (likely(PyLong_Check(x))) +#endif + return __Pyx_NewRef(x); +#if CYTHON_USE_TYPE_SLOTS + m = Py_TYPE(x)->tp_as_number; + #if PY_MAJOR_VERSION < 3 + if (m && m->nb_int) { + name = "int"; + res = m->nb_int(x); + } + else if (m && m->nb_long) { + name = "long"; + res = m->nb_long(x); + } + #else + if (likely(m && m->nb_int)) { + name = "int"; + res = m->nb_int(x); + } + #endif +#else + if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { + res = PyNumber_Int(x); + } +#endif + if (likely(res)) { +#if PY_MAJOR_VERSION < 3 + if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) { +#else + if (unlikely(!PyLong_CheckExact(res))) { +#endif + return __Pyx_PyNumber_IntOrLongWrongResultType(res, name); + } + } + else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_TypeError, + "an integer is required"); + } + return res; +} +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { + Py_ssize_t ival; + PyObject *x; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_CheckExact(b))) { + if (sizeof(Py_ssize_t) >= sizeof(long)) + return PyInt_AS_LONG(b); + else + return PyInt_AsSsize_t(b); + } +#endif + if (likely(PyLong_CheckExact(b))) { + #if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)b)->ob_digit; + const Py_ssize_t size = Py_SIZE(b); + if (likely(__Pyx_sst_abs(size) <= 1)) { + ival = likely(size) ? digits[0] : 0; + if (size == -1) ival = -ival; + return ival; + } else { + switch (size) { + case 2: + if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { + return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -2: + if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case 3: + if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { + return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -3: + if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case 4: + if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { + return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -4: + if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + } + } + #endif + return PyLong_AsSsize_t(b); + } + x = PyNumber_Index(b); + if (!x) return -1; + ival = PyInt_AsSsize_t(x); + Py_DECREF(x); + return ival; +} +static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) { + return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False); +} +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { + return PyInt_FromSize_t(ival); +} + + +#endif /* Py_PYTHON_H */ diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_tracer.html b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_tracer.html new file mode 100644 index 00000000..ebd91095 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_tracer.html @@ -0,0 +1,3096 @@ + + + + + + Cython: _tracer.py + + + +

Generated by Cython 0.29.2

+

+ Yellow lines hint at Python interaction.
+ Click on a line that starts with a "+" to see the C code that Cython generated for it. +

+

Raw output: _tracer.c

+
 001: # Copyright (c) 2018 gevent. See LICENSE for details.
+
 002: # cython: auto_pickle=False,embedsignature=True,always_allow_keywords=False
+
 003: from __future__ import print_function, absolute_import, division
+
 004: 
+
+005: import sys
+
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_sys, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_XGOTREF(__pyx_v_6gevent_8__tracer_sys);
+  __Pyx_DECREF_SET(__pyx_v_6gevent_8__tracer_sys, __pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_1);
+  __pyx_t_1 = 0;
+
+006: import traceback
+
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_traceback, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_XGOTREF(__pyx_v_6gevent_8__tracer_traceback);
+  __Pyx_DECREF_SET(__pyx_v_6gevent_8__tracer_traceback, __pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_1);
+  __pyx_t_1 = 0;
+
 007: 
+
+008: from greenlet import settrace
+
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 8, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(__pyx_n_s_settrace);
+  __Pyx_GIVEREF(__pyx_n_s_settrace);
+  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_settrace);
+  __pyx_t_2 = __Pyx_Import(__pyx_n_s_greenlet, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_settrace); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 8, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(__pyx_t_1);
+  __Pyx_XGOTREF(__pyx_v_6gevent_8__tracer_settrace);
+  __Pyx_DECREF_SET(__pyx_v_6gevent_8__tracer_settrace, __pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+009: from greenlet import getcurrent
+
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_getcurrent);
+  __Pyx_GIVEREF(__pyx_n_s_getcurrent);
+  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_getcurrent);
+  __pyx_t_1 = __Pyx_Import(__pyx_n_s_greenlet, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 9, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_getcurrent); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(__pyx_t_2);
+  __Pyx_XGOTREF(__pyx_v_6gevent_8__tracer_getcurrent);
+  __Pyx_DECREF_SET(__pyx_v_6gevent_8__tracer_getcurrent, __pyx_t_2);
+  __Pyx_GIVEREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 010: 
+
+011: from gevent.util import format_run_info
+
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 11, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(__pyx_n_s_format_run_info);
+  __Pyx_GIVEREF(__pyx_n_s_format_run_info);
+  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_format_run_info);
+  __pyx_t_2 = __Pyx_Import(__pyx_n_s_gevent_util, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 11, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_format_run_info); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 11, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(__pyx_t_1);
+  __Pyx_XGOTREF(__pyx_v_6gevent_8__tracer_format_run_info);
+  __Pyx_DECREF_SET(__pyx_v_6gevent_8__tracer_format_run_info, __pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
 012: 
+
+013: from gevent._compat import perf_counter
+
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 13, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_perf_counter);
+  __Pyx_GIVEREF(__pyx_n_s_perf_counter);
+  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_perf_counter);
+  __pyx_t_1 = __Pyx_Import(__pyx_n_s_gevent__compat, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 13, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_perf_counter); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 13, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(__pyx_t_2);
+  __Pyx_XGOTREF(__pyx_v_6gevent_8__tracer_perf_counter);
+  __Pyx_DECREF_SET(__pyx_v_6gevent_8__tracer_perf_counter, __pyx_t_2);
+  __Pyx_GIVEREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+014: from gevent._util import gmctime
+
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 14, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(__pyx_n_s_gmctime);
+  __Pyx_GIVEREF(__pyx_n_s_gmctime);
+  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_gmctime);
+  __pyx_t_2 = __Pyx_Import(__pyx_n_s_gevent__util, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 14, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_gmctime); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 14, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(__pyx_t_1);
+  __Pyx_XGOTREF(__pyx_v_6gevent_8__tracer_gmctime);
+  __Pyx_DECREF_SET(__pyx_v_6gevent_8__tracer_gmctime, __pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
 015: 
+
 016: 
+
+017: __all__ = [
+
  __pyx_t_2 = PyList_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 17, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_GreenletTracer);
+  __Pyx_GIVEREF(__pyx_n_s_GreenletTracer);
+  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_GreenletTracer);
+  __Pyx_INCREF(__pyx_n_s_HubSwitchTracer);
+  __Pyx_GIVEREF(__pyx_n_s_HubSwitchTracer);
+  PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_HubSwitchTracer);
+  __Pyx_INCREF(__pyx_n_s_MaxSwitchTracer);
+  __Pyx_GIVEREF(__pyx_n_s_MaxSwitchTracer);
+  PyList_SET_ITEM(__pyx_t_2, 2, __pyx_n_s_MaxSwitchTracer);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_all, __pyx_t_2) < 0) __PYX_ERR(0, 17, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
 018:     'GreenletTracer',
+
 019:     'HubSwitchTracer',
+
 020:     'MaxSwitchTracer',
+
 021: ]
+
 022: 
+
 023: # Recall these classes are cython compiled, so
+
 024: # class variable declarations are bad.
+
 025: 
+
 026: 
+
+027: class GreenletTracer(object):
+
struct __pyx_vtabstruct_6gevent_8__tracer_GreenletTracer {
+  PyObject *(*_trace)(struct __pyx_obj_6gevent_8__tracer_GreenletTracer *, PyObject *, PyObject *, int __pyx_skip_dispatch);
+  PyObject *(*did_block_hub)(struct __pyx_obj_6gevent_8__tracer_GreenletTracer *, PyObject *, int __pyx_skip_dispatch);
+  PyObject *(*kill)(struct __pyx_obj_6gevent_8__tracer_GreenletTracer *, int __pyx_skip_dispatch);
+};
+static struct __pyx_vtabstruct_6gevent_8__tracer_GreenletTracer *__pyx_vtabptr_6gevent_8__tracer_GreenletTracer;
+
+
+028:     def __init__(self):
+
/* Python wrapper */
+static int __pyx_pw_6gevent_8__tracer_14GreenletTracer_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static int __pyx_pw_6gevent_8__tracer_14GreenletTracer_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
+  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
+    __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
+  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1;
+  __pyx_r = __pyx_pf_6gevent_8__tracer_14GreenletTracer___init__(((struct __pyx_obj_6gevent_8__tracer_GreenletTracer *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_8__tracer_14GreenletTracer___init__(struct __pyx_obj_6gevent_8__tracer_GreenletTracer *__pyx_v_self) {
+  PyObject *__pyx_v_prev_trace = NULL;
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = 0;
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_AddTraceback("gevent.__tracer.GreenletTracer.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = -1;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_prev_trace);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
 029:         # A counter, incremented by the greenlet trace function
+
 030:         # we install on every greenlet switch. This is reset when the
+
 031:         # periodic monitoring thread runs.
+
 032: 
+
+033:         self.greenlet_switch_counter = 0
+
  __pyx_v_self->greenlet_switch_counter = 0;
+
 034: 
+
 035:         # The greenlet last switched to.
+
+036:         self.active_greenlet = None
+
  __Pyx_INCREF(Py_None);
+  __Pyx_GIVEREF(Py_None);
+  __Pyx_GOTREF(__pyx_v_self->active_greenlet);
+  __Pyx_DECREF(__pyx_v_self->active_greenlet);
+  __pyx_v_self->active_greenlet = Py_None;
+
 037: 
+
 038:         # The trace function that was previously installed,
+
 039:         # if any.
+
 040:         # NOTE: Calling a class instance is cheaper than
+
 041:         # calling a bound method (at least when compiled with cython)
+
 042:         # even when it redirects to another function.
+
+043:         prev_trace = settrace(self)
+
  __Pyx_INCREF(__pyx_v_6gevent_8__tracer_settrace);
+  __pyx_t_2 = __pyx_v_6gevent_8__tracer_settrace; __pyx_t_3 = NULL;
+  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
+    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+    if (likely(__pyx_t_3)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+      __Pyx_INCREF(__pyx_t_3);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_2, function);
+    }
+  }
+  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, ((PyObject *)__pyx_v_self)) : __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_v_self));
+  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 43, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_v_prev_trace = __pyx_t_1;
+  __pyx_t_1 = 0;
+
 044: 
+
+045:         self.previous_trace_function = prev_trace
+
  __Pyx_INCREF(__pyx_v_prev_trace);
+  __Pyx_GIVEREF(__pyx_v_prev_trace);
+  __Pyx_GOTREF(__pyx_v_self->previous_trace_function);
+  __Pyx_DECREF(__pyx_v_self->previous_trace_function);
+  __pyx_v_self->previous_trace_function = __pyx_v_prev_trace;
+
 046: 
+
+047:         self._killed = False
+
  __pyx_v_self->_killed = 0;
+
 048: 
+
+049:     def kill(self):
+
static PyObject *__pyx_pw_6gevent_8__tracer_14GreenletTracer_3kill(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyObject *__pyx_f_6gevent_8__tracer_14GreenletTracer_kill(struct __pyx_obj_6gevent_8__tracer_GreenletTracer *__pyx_v_self, int __pyx_skip_dispatch) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("kill", 0);
+  /* Check if called by wrapper */
+  if (unlikely(__pyx_skip_dispatch)) ;
+  /* Check if overridden in Python */
+  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
+    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
+    if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
+    else {
+      PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      #endif
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_kill); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 49, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_8__tracer_14GreenletTracer_3kill)) {
+        __Pyx_XDECREF(__pyx_r);
+        __Pyx_INCREF(__pyx_t_1);
+        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+          if (likely(__pyx_t_4)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+            __Pyx_INCREF(__pyx_t_4);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_3, function);
+          }
+        }
+        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
+        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 49, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __pyx_r = __pyx_t_2;
+        __pyx_t_2 = 0;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        goto __pyx_L0;
+      }
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+      tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
+      if (unlikely(type_dict_guard != tp_dict_version)) {
+        tp_dict_version = obj_dict_version = 0;
+      }
+      #endif
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    }
+    #endif
+  }
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_AddTraceback("gevent.__tracer.GreenletTracer.kill", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_8__tracer_14GreenletTracer_3kill(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6gevent_8__tracer_14GreenletTracer_2kill[] = "GreenletTracer.kill(self)";
+static PyMethodDef __pyx_mdef_6gevent_8__tracer_14GreenletTracer_3kill = {"kill", (PyCFunction)__pyx_pw_6gevent_8__tracer_14GreenletTracer_3kill, METH_NOARGS, __pyx_doc_6gevent_8__tracer_14GreenletTracer_2kill};
+static PyObject *__pyx_pw_6gevent_8__tracer_14GreenletTracer_3kill(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("kill (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_8__tracer_14GreenletTracer_2kill(((struct __pyx_obj_6gevent_8__tracer_GreenletTracer *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_8__tracer_14GreenletTracer_2kill(struct __pyx_obj_6gevent_8__tracer_GreenletTracer *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("kill", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __pyx_f_6gevent_8__tracer_14GreenletTracer_kill(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 49, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.__tracer.GreenletTracer.kill", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__3 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 49, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__3);
+  __Pyx_GIVEREF(__pyx_tuple__3);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_8__tracer_14GreenletTracer_3kill, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_GreenletTracer_kill, NULL, __pyx_n_s_gevent___tracer, __pyx_d, ((PyObject *)__pyx_codeobj__4)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 49, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_8__tracer_GreenletTracer->tp_dict, __pyx_n_s_kill, __pyx_t_2) < 0) __PYX_ERR(0, 49, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_8__tracer_GreenletTracer);
+  __pyx_codeobj__4 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__3, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__tracer_py, __pyx_n_s_kill, 49, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__4)) __PYX_ERR(0, 49, __pyx_L1_error)
+
 050:         # Must be called in the monitored thread.
+
+051:         if not self._killed:
+
  __pyx_t_5 = ((!(__pyx_v_self->_killed != 0)) != 0);
+  if (__pyx_t_5) {
+/* … */
+  }
+
+052:             self._killed = True
+
    __pyx_v_self->_killed = 1;
+
+053:             settrace(self.previous_trace_function)
+
    __Pyx_INCREF(__pyx_v_6gevent_8__tracer_settrace);
+    __pyx_t_2 = __pyx_v_6gevent_8__tracer_settrace; __pyx_t_3 = NULL;
+    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
+      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+      if (likely(__pyx_t_3)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+        __Pyx_INCREF(__pyx_t_3);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_2, function);
+      }
+    }
+    __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_self->previous_trace_function) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_self->previous_trace_function);
+    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 53, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+054:             self.previous_trace_function = None
+
    __Pyx_INCREF(Py_None);
+    __Pyx_GIVEREF(Py_None);
+    __Pyx_GOTREF(__pyx_v_self->previous_trace_function);
+    __Pyx_DECREF(__pyx_v_self->previous_trace_function);
+    __pyx_v_self->previous_trace_function = Py_None;
+
 055: 
+
+056:     def _trace(self, event, args):
+
static PyObject *__pyx_pw_6gevent_8__tracer_14GreenletTracer_5_trace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_f_6gevent_8__tracer_14GreenletTracer__trace(struct __pyx_obj_6gevent_8__tracer_GreenletTracer *__pyx_v_self, PyObject *__pyx_v_event, PyObject *__pyx_v_args, int __pyx_skip_dispatch) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_trace", 0);
+  /* Check if called by wrapper */
+  if (unlikely(__pyx_skip_dispatch)) ;
+  /* Check if overridden in Python */
+  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
+    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
+    if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
+    else {
+      PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      #endif
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_trace); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 56, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_8__tracer_14GreenletTracer_5_trace)) {
+        __Pyx_XDECREF(__pyx_r);
+        __Pyx_INCREF(__pyx_t_1);
+        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
+        __pyx_t_5 = 0;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+          if (likely(__pyx_t_4)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+            __Pyx_INCREF(__pyx_t_4);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_3, function);
+            __pyx_t_5 = 1;
+          }
+        }
+        #if CYTHON_FAST_PYCALL
+        if (PyFunction_Check(__pyx_t_3)) {
+          PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_event, __pyx_v_args};
+          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 56, __pyx_L1_error)
+          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+          __Pyx_GOTREF(__pyx_t_2);
+        } else
+        #endif
+        #if CYTHON_FAST_PYCCALL
+        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
+          PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_event, __pyx_v_args};
+          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 56, __pyx_L1_error)
+          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+          __Pyx_GOTREF(__pyx_t_2);
+        } else
+        #endif
+        {
+          __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 56, __pyx_L1_error)
+          __Pyx_GOTREF(__pyx_t_6);
+          if (__pyx_t_4) {
+            __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
+          }
+          __Pyx_INCREF(__pyx_v_event);
+          __Pyx_GIVEREF(__pyx_v_event);
+          PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_event);
+          __Pyx_INCREF(__pyx_v_args);
+          __Pyx_GIVEREF(__pyx_v_args);
+          PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_args);
+          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 56, __pyx_L1_error)
+          __Pyx_GOTREF(__pyx_t_2);
+          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+        }
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __pyx_r = __pyx_t_2;
+        __pyx_t_2 = 0;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        goto __pyx_L0;
+      }
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+      tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
+      if (unlikely(type_dict_guard != tp_dict_version)) {
+        tp_dict_version = obj_dict_version = 0;
+      }
+      #endif
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    }
+    #endif
+  }
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_6);
+  __Pyx_XDECREF(__pyx_t_7);
+  __Pyx_AddTraceback("gevent.__tracer.GreenletTracer._trace", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_8__tracer_14GreenletTracer_5_trace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_6gevent_8__tracer_14GreenletTracer_4_trace[] = "GreenletTracer._trace(self, str event, tuple args)";
+static PyMethodDef __pyx_mdef_6gevent_8__tracer_14GreenletTracer_5_trace = {"_trace", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_8__tracer_14GreenletTracer_5_trace, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_8__tracer_14GreenletTracer_4_trace};
+static PyObject *__pyx_pw_6gevent_8__tracer_14GreenletTracer_5_trace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_event = 0;
+  PyObject *__pyx_v_args = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_trace (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_event,&__pyx_n_s_args,0};
+    PyObject* values[2] = {0,0};
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_event)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args)) != 0)) kw_args--;
+        else {
+          __Pyx_RaiseArgtupleInvalid("_trace", 1, 2, 2, 1); __PYX_ERR(0, 56, __pyx_L3_error)
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_trace") < 0)) __PYX_ERR(0, 56, __pyx_L3_error)
+      }
+    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
+      goto __pyx_L5_argtuple_error;
+    } else {
+      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+    }
+    __pyx_v_event = ((PyObject*)values[0]);
+    __pyx_v_args = ((PyObject*)values[1]);
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("_trace", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 56, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.__tracer.GreenletTracer._trace", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_event), (&PyString_Type), 1, "event", 1))) __PYX_ERR(0, 56, __pyx_L1_error)
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_args), (&PyTuple_Type), 1, "args", 1))) __PYX_ERR(0, 56, __pyx_L1_error)
+  __pyx_r = __pyx_pf_6gevent_8__tracer_14GreenletTracer_4_trace(((struct __pyx_obj_6gevent_8__tracer_GreenletTracer *)__pyx_v_self), __pyx_v_event, __pyx_v_args);
+
+  /* function exit code */
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_8__tracer_14GreenletTracer_4_trace(struct __pyx_obj_6gevent_8__tracer_GreenletTracer *__pyx_v_self, PyObject *__pyx_v_event, PyObject *__pyx_v_args) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_trace", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __pyx_f_6gevent_8__tracer_14GreenletTracer__trace(__pyx_v_self, __pyx_v_event, __pyx_v_args, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 56, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.__tracer.GreenletTracer._trace", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__5 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_event, __pyx_n_s_args); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 56, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__5);
+  __Pyx_GIVEREF(__pyx_tuple__5);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_8__tracer_14GreenletTracer_5_trace, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_GreenletTracer__trace, NULL, __pyx_n_s_gevent___tracer, __pyx_d, ((PyObject *)__pyx_codeobj__6)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 56, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_8__tracer_GreenletTracer->tp_dict, __pyx_n_s_trace, __pyx_t_2) < 0) __PYX_ERR(0, 56, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_8__tracer_GreenletTracer);
+  __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__5, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__tracer_py, __pyx_n_s_trace, 56, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__6)) __PYX_ERR(0, 56, __pyx_L1_error)
+
 057:         # This function runs in the thread we are monitoring.
+
+058:         self.greenlet_switch_counter += 1
+
  __pyx_v_self->greenlet_switch_counter = (__pyx_v_self->greenlet_switch_counter + 1);
+
+059:         if event in ('switch', 'throw'):
+
  __Pyx_INCREF(__pyx_v_event);
+  __pyx_t_7 = __pyx_v_event;
+  __pyx_t_9 = (__Pyx_PyString_Equals(__pyx_t_7, __pyx_n_s_switch, Py_EQ)); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 59, __pyx_L1_error)
+  __pyx_t_10 = (__pyx_t_9 != 0);
+  if (!__pyx_t_10) {
+  } else {
+    __pyx_t_8 = __pyx_t_10;
+    goto __pyx_L4_bool_binop_done;
+  }
+  __pyx_t_10 = (__Pyx_PyString_Equals(__pyx_t_7, __pyx_n_s_throw, Py_EQ)); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 59, __pyx_L1_error)
+  __pyx_t_9 = (__pyx_t_10 != 0);
+  __pyx_t_8 = __pyx_t_9;
+  __pyx_L4_bool_binop_done:;
+  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __pyx_t_9 = (__pyx_t_8 != 0);
+  if (__pyx_t_9) {
+/* … */
+    goto __pyx_L3;
+  }
+
 060:             # args is (origin, target). This is the only defined
+
 061:             # case
+
+062:             self.active_greenlet = args[1]
+
    if (unlikely(__pyx_v_args == Py_None)) {
+      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
+      __PYX_ERR(0, 62, __pyx_L1_error)
+    }
+    __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v_args, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 62, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_GIVEREF(__pyx_t_1);
+    __Pyx_GOTREF(__pyx_v_self->active_greenlet);
+    __Pyx_DECREF(__pyx_v_self->active_greenlet);
+    __pyx_v_self->active_greenlet = __pyx_t_1;
+    __pyx_t_1 = 0;
+
 063:         else:
+
+064:             self.active_greenlet = None
+
  /*else*/ {
+    __Pyx_INCREF(Py_None);
+    __Pyx_GIVEREF(Py_None);
+    __Pyx_GOTREF(__pyx_v_self->active_greenlet);
+    __Pyx_DECREF(__pyx_v_self->active_greenlet);
+    __pyx_v_self->active_greenlet = Py_None;
+  }
+  __pyx_L3:;
+
+065:         if self.previous_trace_function is not None:
+
  __pyx_t_9 = (__pyx_v_self->previous_trace_function != Py_None);
+  __pyx_t_8 = (__pyx_t_9 != 0);
+  if (__pyx_t_8) {
+/* … */
+  }
+
+066:             self.previous_trace_function(event, args)
+
    __Pyx_INCREF(__pyx_v_self->previous_trace_function);
+    __pyx_t_2 = __pyx_v_self->previous_trace_function; __pyx_t_3 = NULL;
+    __pyx_t_5 = 0;
+    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+      if (likely(__pyx_t_3)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+        __Pyx_INCREF(__pyx_t_3);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_2, function);
+        __pyx_t_5 = 1;
+      }
+    }
+    #if CYTHON_FAST_PYCALL
+    if (PyFunction_Check(__pyx_t_2)) {
+      PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_event, __pyx_v_args};
+      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 66, __pyx_L1_error)
+      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __Pyx_GOTREF(__pyx_t_1);
+    } else
+    #endif
+    #if CYTHON_FAST_PYCCALL
+    if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
+      PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_event, __pyx_v_args};
+      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 66, __pyx_L1_error)
+      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __Pyx_GOTREF(__pyx_t_1);
+    } else
+    #endif
+    {
+      __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 66, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_6);
+      if (__pyx_t_3) {
+        __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); __pyx_t_3 = NULL;
+      }
+      __Pyx_INCREF(__pyx_v_event);
+      __Pyx_GIVEREF(__pyx_v_event);
+      PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_event);
+      __Pyx_INCREF(__pyx_v_args);
+      __Pyx_GIVEREF(__pyx_v_args);
+      PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_args);
+      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 66, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+    }
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 067: 
+
+068:     def __call__(self, event, args):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_8__tracer_14GreenletTracer_7__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_pw_6gevent_8__tracer_14GreenletTracer_7__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_event = 0;
+  PyObject *__pyx_v_args = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__call__ (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_event,&__pyx_n_s_args,0};
+    PyObject* values[2] = {0,0};
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_event)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args)) != 0)) kw_args--;
+        else {
+          __Pyx_RaiseArgtupleInvalid("__call__", 1, 2, 2, 1); __PYX_ERR(0, 68, __pyx_L3_error)
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__call__") < 0)) __PYX_ERR(0, 68, __pyx_L3_error)
+      }
+    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
+      goto __pyx_L5_argtuple_error;
+    } else {
+      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+    }
+    __pyx_v_event = values[0];
+    __pyx_v_args = values[1];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("__call__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 68, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.__tracer.GreenletTracer.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_8__tracer_14GreenletTracer_6__call__(((struct __pyx_obj_6gevent_8__tracer_GreenletTracer *)__pyx_v_self), __pyx_v_event, __pyx_v_args);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_8__tracer_14GreenletTracer_6__call__(struct __pyx_obj_6gevent_8__tracer_GreenletTracer *__pyx_v_self, PyObject *__pyx_v_event, PyObject *__pyx_v_args) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__call__", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.__tracer.GreenletTracer.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+069:         return self._trace(event, args)
+
  __Pyx_XDECREF(__pyx_r);
+  if (!(likely(PyString_CheckExact(__pyx_v_event))||((__pyx_v_event) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_v_event)->tp_name), 0))) __PYX_ERR(0, 69, __pyx_L1_error)
+  if (!(likely(PyTuple_CheckExact(__pyx_v_args))||((__pyx_v_args) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v_args)->tp_name), 0))) __PYX_ERR(0, 69, __pyx_L1_error)
+  __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_8__tracer_GreenletTracer *)__pyx_v_self->__pyx_vtab)->_trace(__pyx_v_self, ((PyObject*)__pyx_v_event), ((PyObject*)__pyx_v_args), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 69, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
 070: 
+
+071:     def did_block_hub(self, hub):
+
static PyObject *__pyx_pw_6gevent_8__tracer_14GreenletTracer_9did_block_hub(PyObject *__pyx_v_self, PyObject *__pyx_v_hub); /*proto*/
+static PyObject *__pyx_f_6gevent_8__tracer_14GreenletTracer_did_block_hub(struct __pyx_obj_6gevent_8__tracer_GreenletTracer *__pyx_v_self, PyObject *__pyx_v_hub, int __pyx_skip_dispatch) {
+  int __pyx_v_did_switch;
+  PyObject *__pyx_v_active_greenlet = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("did_block_hub", 0);
+  /* Check if called by wrapper */
+  if (unlikely(__pyx_skip_dispatch)) ;
+  /* Check if overridden in Python */
+  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
+    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
+    if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
+    else {
+      PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      #endif
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_did_block_hub); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 71, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_8__tracer_14GreenletTracer_9did_block_hub)) {
+        __Pyx_XDECREF(__pyx_r);
+        __Pyx_INCREF(__pyx_t_1);
+        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+          if (likely(__pyx_t_4)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+            __Pyx_INCREF(__pyx_t_4);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_3, function);
+          }
+        }
+        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_hub) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_hub);
+        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 71, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __pyx_r = __pyx_t_2;
+        __pyx_t_2 = 0;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        goto __pyx_L0;
+      }
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+      tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
+      if (unlikely(type_dict_guard != tp_dict_version)) {
+        tp_dict_version = obj_dict_version = 0;
+      }
+      #endif
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    }
+    #endif
+  }
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_AddTraceback("gevent.__tracer.GreenletTracer.did_block_hub", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_active_greenlet);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_8__tracer_14GreenletTracer_9did_block_hub(PyObject *__pyx_v_self, PyObject *__pyx_v_hub); /*proto*/
+static char __pyx_doc_6gevent_8__tracer_14GreenletTracer_8did_block_hub[] = "GreenletTracer.did_block_hub(self, hub)";
+static PyMethodDef __pyx_mdef_6gevent_8__tracer_14GreenletTracer_9did_block_hub = {"did_block_hub", (PyCFunction)__pyx_pw_6gevent_8__tracer_14GreenletTracer_9did_block_hub, METH_O, __pyx_doc_6gevent_8__tracer_14GreenletTracer_8did_block_hub};
+static PyObject *__pyx_pw_6gevent_8__tracer_14GreenletTracer_9did_block_hub(PyObject *__pyx_v_self, PyObject *__pyx_v_hub) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("did_block_hub (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_8__tracer_14GreenletTracer_8did_block_hub(((struct __pyx_obj_6gevent_8__tracer_GreenletTracer *)__pyx_v_self), ((PyObject *)__pyx_v_hub));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_8__tracer_14GreenletTracer_8did_block_hub(struct __pyx_obj_6gevent_8__tracer_GreenletTracer *__pyx_v_self, PyObject *__pyx_v_hub) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("did_block_hub", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __pyx_f_6gevent_8__tracer_14GreenletTracer_did_block_hub(__pyx_v_self, __pyx_v_hub, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 71, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.__tracer.GreenletTracer.did_block_hub", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__7 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_hub); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 71, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__7);
+  __Pyx_GIVEREF(__pyx_tuple__7);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_8__tracer_14GreenletTracer_9did_block_hub, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_GreenletTracer_did_block_hub, NULL, __pyx_n_s_gevent___tracer, __pyx_d, ((PyObject *)__pyx_codeobj__8)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 71, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_8__tracer_GreenletTracer->tp_dict, __pyx_n_s_did_block_hub, __pyx_t_2) < 0) __PYX_ERR(0, 71, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_8__tracer_GreenletTracer);
+  __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__tracer_py, __pyx_n_s_did_block_hub, 71, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) __PYX_ERR(0, 71, __pyx_L1_error)
+
 072:         # Check to see if we have blocked since the last call to this
+
 073:         # method. Returns a true value if we blocked (not in the hub),
+
 074:         # a false value if everything is fine.
+
 075: 
+
 076:         # This may be called in the same thread being traced or a
+
 077:         # different thread; if a different thread, there is a race
+
 078:         # condition with this being incremented in the thread we're
+
 079:         # monitoring, but probably not often enough to lead to
+
 080:         # annoying false positives.
+
 081: 
+
+082:         active_greenlet = self.active_greenlet
+
  __pyx_t_1 = __pyx_v_self->active_greenlet;
+  __Pyx_INCREF(__pyx_t_1);
+  __pyx_v_active_greenlet = __pyx_t_1;
+  __pyx_t_1 = 0;
+
+083:         did_switch = self.greenlet_switch_counter != 0
+
  __pyx_v_did_switch = (__pyx_v_self->greenlet_switch_counter != 0);
+
+084:         self.greenlet_switch_counter = 0
+
  __pyx_v_self->greenlet_switch_counter = 0;
+
 085: 
+
+086:         if did_switch or active_greenlet is None or active_greenlet is hub:
+
  __pyx_t_6 = (__pyx_v_did_switch != 0);
+  if (!__pyx_t_6) {
+  } else {
+    __pyx_t_5 = __pyx_t_6;
+    goto __pyx_L4_bool_binop_done;
+  }
+  __pyx_t_6 = (__pyx_v_active_greenlet == Py_None);
+  __pyx_t_7 = (__pyx_t_6 != 0);
+  if (!__pyx_t_7) {
+  } else {
+    __pyx_t_5 = __pyx_t_7;
+    goto __pyx_L4_bool_binop_done;
+  }
+  __pyx_t_7 = (__pyx_v_active_greenlet == __pyx_v_hub);
+  __pyx_t_6 = (__pyx_t_7 != 0);
+  __pyx_t_5 = __pyx_t_6;
+  __pyx_L4_bool_binop_done:;
+  if (__pyx_t_5) {
+/* … */
+  }
+
 087:             # Either we switched, or nothing is running (we got a
+
 088:             # trace event we don't know about or were requested to
+
 089:             # ignore), or we spent the whole time in the hub, blocked
+
 090:             # for IO. Nothing to report.
+
+091:             return False
+
    __Pyx_XDECREF(__pyx_r);
+    __Pyx_INCREF(Py_False);
+    __pyx_r = Py_False;
+    goto __pyx_L0;
+
+092:         return True, active_greenlet
+
  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 92, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(Py_True);
+  __Pyx_GIVEREF(Py_True);
+  PyTuple_SET_ITEM(__pyx_t_1, 0, Py_True);
+  __Pyx_INCREF(__pyx_v_active_greenlet);
+  __Pyx_GIVEREF(__pyx_v_active_greenlet);
+  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_active_greenlet);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
 093: 
+
+094:     def ignore_current_greenlet_blocking(self):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_8__tracer_14GreenletTracer_11ignore_current_greenlet_blocking(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6gevent_8__tracer_14GreenletTracer_10ignore_current_greenlet_blocking[] = "GreenletTracer.ignore_current_greenlet_blocking(self)";
+static PyMethodDef __pyx_mdef_6gevent_8__tracer_14GreenletTracer_11ignore_current_greenlet_blocking = {"ignore_current_greenlet_blocking", (PyCFunction)__pyx_pw_6gevent_8__tracer_14GreenletTracer_11ignore_current_greenlet_blocking, METH_NOARGS, __pyx_doc_6gevent_8__tracer_14GreenletTracer_10ignore_current_greenlet_blocking};
+static PyObject *__pyx_pw_6gevent_8__tracer_14GreenletTracer_11ignore_current_greenlet_blocking(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("ignore_current_greenlet_blocking (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_8__tracer_14GreenletTracer_10ignore_current_greenlet_blocking(((struct __pyx_obj_6gevent_8__tracer_GreenletTracer *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_8__tracer_14GreenletTracer_10ignore_current_greenlet_blocking(struct __pyx_obj_6gevent_8__tracer_GreenletTracer *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("ignore_current_greenlet_blocking", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__9 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 94, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__9);
+  __Pyx_GIVEREF(__pyx_tuple__9);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_8__tracer_14GreenletTracer_11ignore_current_greenlet_blocking, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_GreenletTracer_ignore_current_gr, NULL, __pyx_n_s_gevent___tracer, __pyx_d, ((PyObject *)__pyx_codeobj__10)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 94, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_8__tracer_GreenletTracer->tp_dict, __pyx_n_s_ignore_current_greenlet_blocking, __pyx_t_2) < 0) __PYX_ERR(0, 94, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_8__tracer_GreenletTracer);
+  __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__9, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__tracer_py, __pyx_n_s_ignore_current_greenlet_blocking, 94, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__10)) __PYX_ERR(0, 94, __pyx_L1_error)
+
 095:         # Don't pay attention to the current greenlet.
+
+096:         self.active_greenlet = None
+
  __Pyx_INCREF(Py_None);
+  __Pyx_GIVEREF(Py_None);
+  __Pyx_GOTREF(__pyx_v_self->active_greenlet);
+  __Pyx_DECREF(__pyx_v_self->active_greenlet);
+  __pyx_v_self->active_greenlet = Py_None;
+
 097: 
+
+098:     def monitor_current_greenlet_blocking(self):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_8__tracer_14GreenletTracer_13monitor_current_greenlet_blocking(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6gevent_8__tracer_14GreenletTracer_12monitor_current_greenlet_blocking[] = "GreenletTracer.monitor_current_greenlet_blocking(self)";
+static PyMethodDef __pyx_mdef_6gevent_8__tracer_14GreenletTracer_13monitor_current_greenlet_blocking = {"monitor_current_greenlet_blocking", (PyCFunction)__pyx_pw_6gevent_8__tracer_14GreenletTracer_13monitor_current_greenlet_blocking, METH_NOARGS, __pyx_doc_6gevent_8__tracer_14GreenletTracer_12monitor_current_greenlet_blocking};
+static PyObject *__pyx_pw_6gevent_8__tracer_14GreenletTracer_13monitor_current_greenlet_blocking(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("monitor_current_greenlet_blocking (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_8__tracer_14GreenletTracer_12monitor_current_greenlet_blocking(((struct __pyx_obj_6gevent_8__tracer_GreenletTracer *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_8__tracer_14GreenletTracer_12monitor_current_greenlet_blocking(struct __pyx_obj_6gevent_8__tracer_GreenletTracer *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("monitor_current_greenlet_blocking", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_AddTraceback("gevent.__tracer.GreenletTracer.monitor_current_greenlet_blocking", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__11 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 98, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__11);
+  __Pyx_GIVEREF(__pyx_tuple__11);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_8__tracer_14GreenletTracer_13monitor_current_greenlet_blocking, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_GreenletTracer_monitor_current_g, NULL, __pyx_n_s_gevent___tracer, __pyx_d, ((PyObject *)__pyx_codeobj__12)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 98, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_8__tracer_GreenletTracer->tp_dict, __pyx_n_s_monitor_current_greenlet_blockin, __pyx_t_2) < 0) __PYX_ERR(0, 98, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_8__tracer_GreenletTracer);
+  __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__11, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__tracer_py, __pyx_n_s_monitor_current_greenlet_blockin, 98, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(0, 98, __pyx_L1_error)
+
+099:         self.active_greenlet = getcurrent()
+
  __Pyx_INCREF(__pyx_v_6gevent_8__tracer_getcurrent);
+  __pyx_t_2 = __pyx_v_6gevent_8__tracer_getcurrent; __pyx_t_3 = NULL;
+  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
+    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+    if (likely(__pyx_t_3)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+      __Pyx_INCREF(__pyx_t_3);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_2, function);
+    }
+  }
+  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 99, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_GIVEREF(__pyx_t_1);
+  __Pyx_GOTREF(__pyx_v_self->active_greenlet);
+  __Pyx_DECREF(__pyx_v_self->active_greenlet);
+  __pyx_v_self->active_greenlet = __pyx_t_1;
+  __pyx_t_1 = 0;
+
 100: 
+
+101:     def did_block_hub_report(self, hub, active_greenlet, format_kwargs):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_8__tracer_14GreenletTracer_15did_block_hub_report(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_6gevent_8__tracer_14GreenletTracer_14did_block_hub_report[] = "GreenletTracer.did_block_hub_report(self, hub, active_greenlet, format_kwargs)";
+static PyMethodDef __pyx_mdef_6gevent_8__tracer_14GreenletTracer_15did_block_hub_report = {"did_block_hub_report", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_8__tracer_14GreenletTracer_15did_block_hub_report, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_8__tracer_14GreenletTracer_14did_block_hub_report};
+static PyObject *__pyx_pw_6gevent_8__tracer_14GreenletTracer_15did_block_hub_report(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_hub = 0;
+  PyObject *__pyx_v_active_greenlet = 0;
+  PyObject *__pyx_v_format_kwargs = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("did_block_hub_report (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_hub,&__pyx_n_s_active_greenlet,&__pyx_n_s_format_kwargs,0};
+    PyObject* values[3] = {0,0,0};
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_hub)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_active_greenlet)) != 0)) kw_args--;
+        else {
+          __Pyx_RaiseArgtupleInvalid("did_block_hub_report", 1, 3, 3, 1); __PYX_ERR(0, 101, __pyx_L3_error)
+        }
+        CYTHON_FALLTHROUGH;
+        case  2:
+        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_format_kwargs)) != 0)) kw_args--;
+        else {
+          __Pyx_RaiseArgtupleInvalid("did_block_hub_report", 1, 3, 3, 2); __PYX_ERR(0, 101, __pyx_L3_error)
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "did_block_hub_report") < 0)) __PYX_ERR(0, 101, __pyx_L3_error)
+      }
+    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
+      goto __pyx_L5_argtuple_error;
+    } else {
+      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+    }
+    __pyx_v_hub = values[0];
+    __pyx_v_active_greenlet = values[1];
+    __pyx_v_format_kwargs = values[2];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("did_block_hub_report", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 101, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.__tracer.GreenletTracer.did_block_hub_report", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_8__tracer_14GreenletTracer_14did_block_hub_report(((struct __pyx_obj_6gevent_8__tracer_GreenletTracer *)__pyx_v_self), __pyx_v_hub, __pyx_v_active_greenlet, __pyx_v_format_kwargs);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_8__tracer_14GreenletTracer_14did_block_hub_report(struct __pyx_obj_6gevent_8__tracer_GreenletTracer *__pyx_v_self, PyObject *__pyx_v_hub, PyObject *__pyx_v_active_greenlet, PyObject *__pyx_v_format_kwargs) {
+  PyObject *__pyx_v_report = NULL;
+  PyObject *__pyx_v_frame = NULL;
+  PyObject *__pyx_v_stack = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("did_block_hub_report", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_9);
+  __Pyx_XDECREF(__pyx_t_10);
+  __Pyx_AddTraceback("gevent.__tracer.GreenletTracer.did_block_hub_report", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_report);
+  __Pyx_XDECREF(__pyx_v_frame);
+  __Pyx_XDECREF(__pyx_v_stack);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__13 = PyTuple_Pack(7, __pyx_n_s_self, __pyx_n_s_hub, __pyx_n_s_active_greenlet, __pyx_n_s_format_kwargs, __pyx_n_s_report, __pyx_n_s_frame, __pyx_n_s_stack); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 101, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__13);
+  __Pyx_GIVEREF(__pyx_tuple__13);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_8__tracer_14GreenletTracer_15did_block_hub_report, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_GreenletTracer_did_block_hub_rep, NULL, __pyx_n_s_gevent___tracer, __pyx_d, ((PyObject *)__pyx_codeobj__14)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 101, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_8__tracer_GreenletTracer->tp_dict, __pyx_n_s_did_block_hub_report, __pyx_t_2) < 0) __PYX_ERR(0, 101, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_8__tracer_GreenletTracer);
+  __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(4, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__13, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__tracer_py, __pyx_n_s_did_block_hub_report, 101, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__14)) __PYX_ERR(0, 101, __pyx_L1_error)
+
+102:         report = ['=' * 80,
+
  __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 102, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(__pyx_kp_s_b);
+  __Pyx_GIVEREF(__pyx_kp_s_b);
+  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_kp_s_b);
+  __Pyx_GIVEREF(__pyx_t_1);
+  PyList_SET_ITEM(__pyx_t_2, 1, __pyx_t_1);
+  __pyx_t_1 = 0;
+  __pyx_v_report = ((PyObject*)__pyx_t_2);
+  __pyx_t_2 = 0;
+
+103:                   '\n%s : Greenlet %s appears to be blocked' %
+
  __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_s_Greenlet_s_appears_to_be_bloc, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 103, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+104:                   (gmctime(), active_greenlet)]
+
  __Pyx_INCREF(__pyx_v_6gevent_8__tracer_gmctime);
+  __pyx_t_2 = __pyx_v_6gevent_8__tracer_gmctime; __pyx_t_3 = NULL;
+  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
+    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+    if (likely(__pyx_t_3)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+      __Pyx_INCREF(__pyx_t_3);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_2, function);
+    }
+  }
+  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 104, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 104, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_GIVEREF(__pyx_t_1);
+  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
+  __Pyx_INCREF(__pyx_v_active_greenlet);
+  __Pyx_GIVEREF(__pyx_v_active_greenlet);
+  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_active_greenlet);
+  __pyx_t_1 = 0;
+
+105:         report.append("    Reported by %s" % (self,))
+
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 105, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(((PyObject *)__pyx_v_self));
+  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
+  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self));
+  __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_Reported_by_s, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 105, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_report, __pyx_t_1); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 105, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+106:         try:
+
  {
+    /*try:*/ {
+/* … */
+    }
+/* … */
+    __Pyx_XGIVEREF(__pyx_t_5);
+    __Pyx_XGIVEREF(__pyx_t_6);
+    __Pyx_XGIVEREF(__pyx_t_7);
+    __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7);
+    goto __pyx_L1_error;
+    __pyx_L4_exception_handled:;
+    __Pyx_XGIVEREF(__pyx_t_5);
+    __Pyx_XGIVEREF(__pyx_t_6);
+    __Pyx_XGIVEREF(__pyx_t_7);
+    __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7);
+    __pyx_L8_try_end:;
+  }
+
+107:             frame = sys._current_frames()[hub.thread_ident]
+
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_6gevent_8__tracer_sys, __pyx_n_s_current_frames); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 107, __pyx_L3_error)
+      __Pyx_GOTREF(__pyx_t_2);
+      __pyx_t_3 = NULL;
+      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+        if (likely(__pyx_t_3)) {
+          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+          __Pyx_INCREF(__pyx_t_3);
+          __Pyx_INCREF(function);
+          __Pyx_DECREF_SET(__pyx_t_2, function);
+        }
+      }
+      __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
+      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 107, __pyx_L3_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_hub, __pyx_n_s_thread_ident); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 107, __pyx_L3_error)
+      __Pyx_GOTREF(__pyx_t_2);
+      __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 107, __pyx_L3_error)
+      __Pyx_GOTREF(__pyx_t_3);
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+      __pyx_v_frame = __pyx_t_3;
+      __pyx_t_3 = 0;
+
+108:         except KeyError:
+
    __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
+    if (__pyx_t_8) {
+      __Pyx_AddTraceback("gevent.__tracer.GreenletTracer.did_block_hub_report", __pyx_clineno, __pyx_lineno, __pyx_filename);
+      if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_2, &__pyx_t_1) < 0) __PYX_ERR(0, 108, __pyx_L5_except_error)
+      __Pyx_GOTREF(__pyx_t_3);
+      __Pyx_GOTREF(__pyx_t_2);
+      __Pyx_GOTREF(__pyx_t_1);
+
 109:             # The thread holding the hub has died. Perhaps we shouldn't
+
 110:             # even report this?
+
+111:             stack = ["Unknown: No thread found for hub %r\n" % (hub,)]
+
      __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 111, __pyx_L5_except_error)
+      __Pyx_GOTREF(__pyx_t_9);
+      __Pyx_INCREF(__pyx_v_hub);
+      __Pyx_GIVEREF(__pyx_v_hub);
+      PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_hub);
+      __pyx_t_10 = __Pyx_PyString_Format(__pyx_kp_s_Unknown_No_thread_found_for_hub, __pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 111, __pyx_L5_except_error)
+      __Pyx_GOTREF(__pyx_t_10);
+      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+      __pyx_t_9 = PyList_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 111, __pyx_L5_except_error)
+      __Pyx_GOTREF(__pyx_t_9);
+      __Pyx_GIVEREF(__pyx_t_10);
+      PyList_SET_ITEM(__pyx_t_9, 0, __pyx_t_10);
+      __pyx_t_10 = 0;
+      __pyx_v_stack = __pyx_t_9;
+      __pyx_t_9 = 0;
+      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+      goto __pyx_L4_exception_handled;
+    }
+    goto __pyx_L5_except_error;
+    __pyx_L5_except_error:;
+
 112:         else:
+
+113:             stack = traceback.format_stack(frame)
+
    /*else:*/ {
+      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_6gevent_8__tracer_traceback, __pyx_n_s_format_stack); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 113, __pyx_L5_except_error)
+      __Pyx_GOTREF(__pyx_t_2);
+      __pyx_t_1 = NULL;
+      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+        __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
+        if (likely(__pyx_t_1)) {
+          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+          __Pyx_INCREF(__pyx_t_1);
+          __Pyx_INCREF(function);
+          __Pyx_DECREF_SET(__pyx_t_2, function);
+        }
+      }
+      __pyx_t_3 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_1, __pyx_v_frame) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_frame);
+      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 113, __pyx_L5_except_error)
+      __Pyx_GOTREF(__pyx_t_3);
+      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+      __pyx_v_stack = __pyx_t_3;
+      __pyx_t_3 = 0;
+    }
+    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+    goto __pyx_L8_try_end;
+    __pyx_L3_error:;
+    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+
+114:         report.append('Blocked Stack (for thread id %s):' % (hex(hub.thread_ident),))
+
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_hub, __pyx_n_s_thread_ident); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 114, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_hex, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 114, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 114, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_2);
+  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
+  __pyx_t_2 = 0;
+  __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_Blocked_Stack_for_thread_id_s, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 114, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_report, __pyx_t_2); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 114, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+115:         report.append(''.join(stack))
+
  __pyx_t_2 = __Pyx_PyString_Join(__pyx_kp_s__2, __pyx_v_stack); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 115, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_report, __pyx_t_2); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 115, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+116:         report.append("Info:")
+
  __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_report, __pyx_kp_s_Info); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 116, __pyx_L1_error)
+
+117:         report.extend(format_run_info(**format_kwargs))
+
  if (unlikely(__pyx_v_format_kwargs == Py_None)) {
+    PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType");
+    __PYX_ERR(0, 117, __pyx_L1_error)
+  }
+  if (likely(PyDict_CheckExact(__pyx_v_format_kwargs))) {
+    __pyx_t_2 = PyDict_Copy(__pyx_v_format_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 117, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+  } else {
+    __pyx_t_2 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_format_kwargs, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 117, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+  }
+  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_6gevent_8__tracer_format_run_info, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 117, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_4 = __Pyx_PyList_Extend(__pyx_v_report, __pyx_t_1); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 117, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 118: 
+
+119:         return report
+
  __Pyx_XDECREF(__pyx_r);
+  __Pyx_INCREF(__pyx_v_report);
+  __pyx_r = __pyx_v_report;
+  goto __pyx_L0;
+
 120: 
+
 121: 
+
+122: class _HubTracer(GreenletTracer):
+
struct __pyx_vtabstruct_6gevent_8__tracer__HubTracer {
+  struct __pyx_vtabstruct_6gevent_8__tracer_GreenletTracer __pyx_base;
+};
+static struct __pyx_vtabstruct_6gevent_8__tracer__HubTracer *__pyx_vtabptr_6gevent_8__tracer__HubTracer;
+
+
+123:     def __init__(self, hub, max_blocking_time):
+
/* Python wrapper */
+static int __pyx_pw_6gevent_8__tracer_10_HubTracer_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static int __pyx_pw_6gevent_8__tracer_10_HubTracer_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_hub = 0;
+  PyObject *__pyx_v_max_blocking_time = 0;
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_hub,&__pyx_n_s_max_blocking_time,0};
+    PyObject* values[2] = {0,0};
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_hub)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_max_blocking_time)) != 0)) kw_args--;
+        else {
+          __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(0, 123, __pyx_L3_error)
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 123, __pyx_L3_error)
+      }
+    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
+      goto __pyx_L5_argtuple_error;
+    } else {
+      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+    }
+    __pyx_v_hub = values[0];
+    __pyx_v_max_blocking_time = values[1];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 123, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.__tracer._HubTracer.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return -1;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_8__tracer_10_HubTracer___init__(((struct __pyx_obj_6gevent_8__tracer__HubTracer *)__pyx_v_self), __pyx_v_hub, __pyx_v_max_blocking_time);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_8__tracer_10_HubTracer___init__(struct __pyx_obj_6gevent_8__tracer__HubTracer *__pyx_v_self, PyObject *__pyx_v_hub, PyObject *__pyx_v_max_blocking_time) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = 0;
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_AddTraceback("gevent.__tracer._HubTracer.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = -1;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+124:         GreenletTracer.__init__(self)
+
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_6gevent_8__tracer_GreenletTracer), __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 124, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = NULL;
+  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+    if (likely(__pyx_t_3)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+      __Pyx_INCREF(__pyx_t_3);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_2, function);
+    }
+  }
+  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, ((PyObject *)__pyx_v_self)) : __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_v_self));
+  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 124, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+125:         self.max_blocking_time = max_blocking_time
+
  __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_v_max_blocking_time); if (unlikely((__pyx_t_4 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 125, __pyx_L1_error)
+  __pyx_v_self->max_blocking_time = __pyx_t_4;
+
+126:         self.hub = hub
+
  __Pyx_INCREF(__pyx_v_hub);
+  __Pyx_GIVEREF(__pyx_v_hub);
+  __Pyx_GOTREF(__pyx_v_self->hub);
+  __Pyx_DECREF(__pyx_v_self->hub);
+  __pyx_v_self->hub = __pyx_v_hub;
+
 127: 
+
+128:     def kill(self):
+
static PyObject *__pyx_pw_6gevent_8__tracer_10_HubTracer_3kill(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyObject *__pyx_f_6gevent_8__tracer_10_HubTracer_kill(struct __pyx_obj_6gevent_8__tracer__HubTracer *__pyx_v_self, int __pyx_skip_dispatch) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("kill", 0);
+  /* Check if called by wrapper */
+  if (unlikely(__pyx_skip_dispatch)) ;
+  /* Check if overridden in Python */
+  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
+    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
+    if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
+    else {
+      PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      #endif
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_kill); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 128, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_8__tracer_10_HubTracer_3kill)) {
+        __Pyx_XDECREF(__pyx_r);
+        __Pyx_INCREF(__pyx_t_1);
+        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+          if (likely(__pyx_t_4)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+            __Pyx_INCREF(__pyx_t_4);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_3, function);
+          }
+        }
+        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
+        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 128, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __pyx_r = __pyx_t_2;
+        __pyx_t_2 = 0;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        goto __pyx_L0;
+      }
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+      tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
+      if (unlikely(type_dict_guard != tp_dict_version)) {
+        tp_dict_version = obj_dict_version = 0;
+      }
+      #endif
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    }
+    #endif
+  }
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_AddTraceback("gevent.__tracer._HubTracer.kill", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_8__tracer_10_HubTracer_3kill(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6gevent_8__tracer_10_HubTracer_2kill[] = "_HubTracer.kill(self)";
+static PyMethodDef __pyx_mdef_6gevent_8__tracer_10_HubTracer_3kill = {"kill", (PyCFunction)__pyx_pw_6gevent_8__tracer_10_HubTracer_3kill, METH_NOARGS, __pyx_doc_6gevent_8__tracer_10_HubTracer_2kill};
+static PyObject *__pyx_pw_6gevent_8__tracer_10_HubTracer_3kill(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("kill (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_8__tracer_10_HubTracer_2kill(((struct __pyx_obj_6gevent_8__tracer__HubTracer *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_8__tracer_10_HubTracer_2kill(struct __pyx_obj_6gevent_8__tracer__HubTracer *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("kill", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __pyx_f_6gevent_8__tracer_10_HubTracer_kill(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 128, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.__tracer._HubTracer.kill", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__15 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(0, 128, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__15);
+  __Pyx_GIVEREF(__pyx_tuple__15);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_8__tracer_10_HubTracer_3kill, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_HubTracer_kill, NULL, __pyx_n_s_gevent___tracer, __pyx_d, ((PyObject *)__pyx_codeobj__16)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 128, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_8__tracer__HubTracer->tp_dict, __pyx_n_s_kill, __pyx_t_2) < 0) __PYX_ERR(0, 128, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_8__tracer__HubTracer);
+  __pyx_codeobj__16 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__15, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__tracer_py, __pyx_n_s_kill, 128, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__16)) __PYX_ERR(0, 128, __pyx_L1_error)
+
+129:         self.hub = None
+
  __Pyx_INCREF(Py_None);
+  __Pyx_GIVEREF(Py_None);
+  __Pyx_GOTREF(__pyx_v_self->hub);
+  __Pyx_DECREF(__pyx_v_self->hub);
+  __pyx_v_self->hub = Py_None;
+
+130:         GreenletTracer.kill(self)
+
  __pyx_t_1 = __pyx_f_6gevent_8__tracer_14GreenletTracer_kill(((struct __pyx_obj_6gevent_8__tracer_GreenletTracer *)__pyx_v_self), 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 130, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 131: 
+
 132: 
+
+133: class HubSwitchTracer(_HubTracer):
+
struct __pyx_vtabstruct_6gevent_8__tracer_HubSwitchTracer {
+  struct __pyx_vtabstruct_6gevent_8__tracer__HubTracer __pyx_base;
+};
+static struct __pyx_vtabstruct_6gevent_8__tracer_HubSwitchTracer *__pyx_vtabptr_6gevent_8__tracer_HubSwitchTracer;
+
+
 134:     # A greenlet tracer that records the last time we switched *into* the hub.
+
 135: 
+
+136:     def __init__(self, hub, max_blocking_time):
+
/* Python wrapper */
+static int __pyx_pw_6gevent_8__tracer_15HubSwitchTracer_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static int __pyx_pw_6gevent_8__tracer_15HubSwitchTracer_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_hub = 0;
+  PyObject *__pyx_v_max_blocking_time = 0;
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_hub,&__pyx_n_s_max_blocking_time,0};
+    PyObject* values[2] = {0,0};
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_hub)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_max_blocking_time)) != 0)) kw_args--;
+        else {
+          __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(0, 136, __pyx_L3_error)
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 136, __pyx_L3_error)
+      }
+    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
+      goto __pyx_L5_argtuple_error;
+    } else {
+      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+    }
+    __pyx_v_hub = values[0];
+    __pyx_v_max_blocking_time = values[1];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 136, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.__tracer.HubSwitchTracer.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return -1;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_8__tracer_15HubSwitchTracer___init__(((struct __pyx_obj_6gevent_8__tracer_HubSwitchTracer *)__pyx_v_self), __pyx_v_hub, __pyx_v_max_blocking_time);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_8__tracer_15HubSwitchTracer___init__(struct __pyx_obj_6gevent_8__tracer_HubSwitchTracer *__pyx_v_self, PyObject *__pyx_v_hub, PyObject *__pyx_v_max_blocking_time) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = 0;
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_AddTraceback("gevent.__tracer.HubSwitchTracer.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = -1;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+137:         _HubTracer.__init__(self, hub, max_blocking_time)
+
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_6gevent_8__tracer__HubTracer), __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 137, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = NULL;
+  __pyx_t_4 = 0;
+  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+    if (likely(__pyx_t_3)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+      __Pyx_INCREF(__pyx_t_3);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_2, function);
+      __pyx_t_4 = 1;
+    }
+  }
+  #if CYTHON_FAST_PYCALL
+  if (PyFunction_Check(__pyx_t_2)) {
+    PyObject *__pyx_temp[4] = {__pyx_t_3, ((PyObject *)__pyx_v_self), __pyx_v_hub, __pyx_v_max_blocking_time};
+    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 137, __pyx_L1_error)
+    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __Pyx_GOTREF(__pyx_t_1);
+  } else
+  #endif
+  #if CYTHON_FAST_PYCCALL
+  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
+    PyObject *__pyx_temp[4] = {__pyx_t_3, ((PyObject *)__pyx_v_self), __pyx_v_hub, __pyx_v_max_blocking_time};
+    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 137, __pyx_L1_error)
+    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __Pyx_GOTREF(__pyx_t_1);
+  } else
+  #endif
+  {
+    __pyx_t_5 = PyTuple_New(3+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 137, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_5);
+    if (__pyx_t_3) {
+      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
+    }
+    __Pyx_INCREF(((PyObject *)__pyx_v_self));
+    __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
+    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, ((PyObject *)__pyx_v_self));
+    __Pyx_INCREF(__pyx_v_hub);
+    __Pyx_GIVEREF(__pyx_v_hub);
+    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_hub);
+    __Pyx_INCREF(__pyx_v_max_blocking_time);
+    __Pyx_GIVEREF(__pyx_v_max_blocking_time);
+    PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_4, __pyx_v_max_blocking_time);
+    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 137, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+  }
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+138:         self.last_entered_hub = 0
+
  __pyx_v_self->last_entered_hub = 0.0;
+
 139: 
+
+140:     def _trace(self, event, args):
+
static PyObject *__pyx_pw_6gevent_8__tracer_15HubSwitchTracer_3_trace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_f_6gevent_8__tracer_15HubSwitchTracer__trace(struct __pyx_obj_6gevent_8__tracer_HubSwitchTracer *__pyx_v_self, PyObject *__pyx_v_event, PyObject *__pyx_v_args, int __pyx_skip_dispatch) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_trace", 0);
+  /* Check if called by wrapper */
+  if (unlikely(__pyx_skip_dispatch)) ;
+  /* Check if overridden in Python */
+  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
+    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
+    if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
+    else {
+      PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      #endif
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_trace); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 140, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_8__tracer_15HubSwitchTracer_3_trace)) {
+        __Pyx_XDECREF(__pyx_r);
+        __Pyx_INCREF(__pyx_t_1);
+        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
+        __pyx_t_5 = 0;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+          if (likely(__pyx_t_4)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+            __Pyx_INCREF(__pyx_t_4);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_3, function);
+            __pyx_t_5 = 1;
+          }
+        }
+        #if CYTHON_FAST_PYCALL
+        if (PyFunction_Check(__pyx_t_3)) {
+          PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_event, __pyx_v_args};
+          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 140, __pyx_L1_error)
+          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+          __Pyx_GOTREF(__pyx_t_2);
+        } else
+        #endif
+        #if CYTHON_FAST_PYCCALL
+        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
+          PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_event, __pyx_v_args};
+          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 140, __pyx_L1_error)
+          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+          __Pyx_GOTREF(__pyx_t_2);
+        } else
+        #endif
+        {
+          __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 140, __pyx_L1_error)
+          __Pyx_GOTREF(__pyx_t_6);
+          if (__pyx_t_4) {
+            __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
+          }
+          __Pyx_INCREF(__pyx_v_event);
+          __Pyx_GIVEREF(__pyx_v_event);
+          PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_event);
+          __Pyx_INCREF(__pyx_v_args);
+          __Pyx_GIVEREF(__pyx_v_args);
+          PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_args);
+          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 140, __pyx_L1_error)
+          __Pyx_GOTREF(__pyx_t_2);
+          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+        }
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __pyx_r = __pyx_t_2;
+        __pyx_t_2 = 0;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        goto __pyx_L0;
+      }
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+      tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
+      if (unlikely(type_dict_guard != tp_dict_version)) {
+        tp_dict_version = obj_dict_version = 0;
+      }
+      #endif
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    }
+    #endif
+  }
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_6);
+  __Pyx_AddTraceback("gevent.__tracer.HubSwitchTracer._trace", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_8__tracer_15HubSwitchTracer_3_trace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_6gevent_8__tracer_15HubSwitchTracer_2_trace[] = "HubSwitchTracer._trace(self, str event, tuple args)";
+static PyMethodDef __pyx_mdef_6gevent_8__tracer_15HubSwitchTracer_3_trace = {"_trace", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_8__tracer_15HubSwitchTracer_3_trace, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_8__tracer_15HubSwitchTracer_2_trace};
+static PyObject *__pyx_pw_6gevent_8__tracer_15HubSwitchTracer_3_trace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_event = 0;
+  PyObject *__pyx_v_args = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_trace (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_event,&__pyx_n_s_args,0};
+    PyObject* values[2] = {0,0};
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_event)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args)) != 0)) kw_args--;
+        else {
+          __Pyx_RaiseArgtupleInvalid("_trace", 1, 2, 2, 1); __PYX_ERR(0, 140, __pyx_L3_error)
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_trace") < 0)) __PYX_ERR(0, 140, __pyx_L3_error)
+      }
+    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
+      goto __pyx_L5_argtuple_error;
+    } else {
+      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+    }
+    __pyx_v_event = ((PyObject*)values[0]);
+    __pyx_v_args = ((PyObject*)values[1]);
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("_trace", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 140, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.__tracer.HubSwitchTracer._trace", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_event), (&PyString_Type), 1, "event", 1))) __PYX_ERR(0, 140, __pyx_L1_error)
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_args), (&PyTuple_Type), 1, "args", 1))) __PYX_ERR(0, 140, __pyx_L1_error)
+  __pyx_r = __pyx_pf_6gevent_8__tracer_15HubSwitchTracer_2_trace(((struct __pyx_obj_6gevent_8__tracer_HubSwitchTracer *)__pyx_v_self), __pyx_v_event, __pyx_v_args);
+
+  /* function exit code */
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_8__tracer_15HubSwitchTracer_2_trace(struct __pyx_obj_6gevent_8__tracer_HubSwitchTracer *__pyx_v_self, PyObject *__pyx_v_event, PyObject *__pyx_v_args) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_trace", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __pyx_f_6gevent_8__tracer_15HubSwitchTracer__trace(__pyx_v_self, __pyx_v_event, __pyx_v_args, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 140, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.__tracer.HubSwitchTracer._trace", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__17 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_event, __pyx_n_s_args); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(0, 140, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__17);
+  __Pyx_GIVEREF(__pyx_tuple__17);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_8__tracer_15HubSwitchTracer_3_trace, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_HubSwitchTracer__trace, NULL, __pyx_n_s_gevent___tracer, __pyx_d, ((PyObject *)__pyx_codeobj__18)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 140, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_8__tracer_HubSwitchTracer->tp_dict, __pyx_n_s_trace, __pyx_t_2) < 0) __PYX_ERR(0, 140, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_8__tracer_HubSwitchTracer);
+  __pyx_codeobj__18 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__17, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__tracer_py, __pyx_n_s_trace, 140, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__18)) __PYX_ERR(0, 140, __pyx_L1_error)
+
+141:         GreenletTracer._trace(self, event, args)
+
  __pyx_t_1 = __pyx_f_6gevent_8__tracer_14GreenletTracer__trace(((struct __pyx_obj_6gevent_8__tracer_GreenletTracer *)__pyx_v_self), __pyx_v_event, __pyx_v_args, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 141, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+142:         if self.active_greenlet is self.hub:
+
  __pyx_t_7 = (__pyx_v_self->__pyx_base.__pyx_base.active_greenlet == __pyx_v_self->__pyx_base.hub);
+  __pyx_t_8 = (__pyx_t_7 != 0);
+  if (__pyx_t_8) {
+/* … */
+  }
+
+143:             self.last_entered_hub = perf_counter()
+
    __Pyx_INCREF(__pyx_v_6gevent_8__tracer_perf_counter);
+    __pyx_t_2 = __pyx_v_6gevent_8__tracer_perf_counter; __pyx_t_3 = NULL;
+    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
+      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+      if (likely(__pyx_t_3)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+        __Pyx_INCREF(__pyx_t_3);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_2, function);
+      }
+    }
+    __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
+    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 143, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 143, __pyx_L1_error)
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __pyx_v_self->last_entered_hub = __pyx_t_9;
+
 144: 
+
+145:     def did_block_hub(self, hub):
+
static PyObject *__pyx_pw_6gevent_8__tracer_15HubSwitchTracer_5did_block_hub(PyObject *__pyx_v_self, PyObject *__pyx_v_hub); /*proto*/
+static PyObject *__pyx_f_6gevent_8__tracer_15HubSwitchTracer_did_block_hub(struct __pyx_obj_6gevent_8__tracer_HubSwitchTracer *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_hub, int __pyx_skip_dispatch) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("did_block_hub", 0);
+  /* Check if called by wrapper */
+  if (unlikely(__pyx_skip_dispatch)) ;
+  /* Check if overridden in Python */
+  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
+    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
+    if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
+    else {
+      PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      #endif
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_did_block_hub); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 145, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_8__tracer_15HubSwitchTracer_5did_block_hub)) {
+        __Pyx_XDECREF(__pyx_r);
+        __Pyx_INCREF(__pyx_t_1);
+        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+          if (likely(__pyx_t_4)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+            __Pyx_INCREF(__pyx_t_4);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_3, function);
+          }
+        }
+        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_hub) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_hub);
+        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 145, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __pyx_r = __pyx_t_2;
+        __pyx_t_2 = 0;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        goto __pyx_L0;
+      }
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+      tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
+      if (unlikely(type_dict_guard != tp_dict_version)) {
+        tp_dict_version = obj_dict_version = 0;
+      }
+      #endif
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    }
+    #endif
+  }
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_AddTraceback("gevent.__tracer.HubSwitchTracer.did_block_hub", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_8__tracer_15HubSwitchTracer_5did_block_hub(PyObject *__pyx_v_self, PyObject *__pyx_v_hub); /*proto*/
+static char __pyx_doc_6gevent_8__tracer_15HubSwitchTracer_4did_block_hub[] = "HubSwitchTracer.did_block_hub(self, hub)";
+static PyMethodDef __pyx_mdef_6gevent_8__tracer_15HubSwitchTracer_5did_block_hub = {"did_block_hub", (PyCFunction)__pyx_pw_6gevent_8__tracer_15HubSwitchTracer_5did_block_hub, METH_O, __pyx_doc_6gevent_8__tracer_15HubSwitchTracer_4did_block_hub};
+static PyObject *__pyx_pw_6gevent_8__tracer_15HubSwitchTracer_5did_block_hub(PyObject *__pyx_v_self, PyObject *__pyx_v_hub) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("did_block_hub (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_8__tracer_15HubSwitchTracer_4did_block_hub(((struct __pyx_obj_6gevent_8__tracer_HubSwitchTracer *)__pyx_v_self), ((PyObject *)__pyx_v_hub));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_8__tracer_15HubSwitchTracer_4did_block_hub(struct __pyx_obj_6gevent_8__tracer_HubSwitchTracer *__pyx_v_self, PyObject *__pyx_v_hub) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("did_block_hub", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __pyx_f_6gevent_8__tracer_15HubSwitchTracer_did_block_hub(__pyx_v_self, __pyx_v_hub, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 145, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.__tracer.HubSwitchTracer.did_block_hub", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__19 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_hub); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(0, 145, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__19);
+  __Pyx_GIVEREF(__pyx_tuple__19);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_8__tracer_15HubSwitchTracer_5did_block_hub, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_HubSwitchTracer_did_block_hub, NULL, __pyx_n_s_gevent___tracer, __pyx_d, ((PyObject *)__pyx_codeobj__20)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 145, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_8__tracer_HubSwitchTracer->tp_dict, __pyx_n_s_did_block_hub, __pyx_t_2) < 0) __PYX_ERR(0, 145, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_8__tracer_HubSwitchTracer);
+  __pyx_codeobj__20 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__19, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__tracer_py, __pyx_n_s_did_block_hub, 145, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__20)) __PYX_ERR(0, 145, __pyx_L1_error)
+
+146:         if perf_counter() - self.last_entered_hub > self.max_blocking_time:
+
  __Pyx_INCREF(__pyx_v_6gevent_8__tracer_perf_counter);
+  __pyx_t_2 = __pyx_v_6gevent_8__tracer_perf_counter; __pyx_t_3 = NULL;
+  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
+    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+    if (likely(__pyx_t_3)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+      __Pyx_INCREF(__pyx_t_3);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_2, function);
+    }
+  }
+  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 146, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_2 = PyFloat_FromDouble(__pyx_v_self->last_entered_hub); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 146, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = PyNumber_Subtract(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 146, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_2 = PyFloat_FromDouble(__pyx_v_self->__pyx_base.max_blocking_time); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 146, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 146, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 146, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  if (__pyx_t_5) {
+/* … */
+  }
+
+147:             return True, self.active_greenlet
+
    __Pyx_XDECREF(__pyx_r);
+    __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 147, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_INCREF(Py_True);
+    __Pyx_GIVEREF(Py_True);
+    PyTuple_SET_ITEM(__pyx_t_1, 0, Py_True);
+    __Pyx_INCREF(__pyx_v_self->__pyx_base.__pyx_base.active_greenlet);
+    __Pyx_GIVEREF(__pyx_v_self->__pyx_base.__pyx_base.active_greenlet);
+    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_self->__pyx_base.__pyx_base.active_greenlet);
+    __pyx_r = __pyx_t_1;
+    __pyx_t_1 = 0;
+    goto __pyx_L0;
+
 148: 
+
 149: 
+
+150: class MaxSwitchTracer(_HubTracer):
+
struct __pyx_vtabstruct_6gevent_8__tracer_MaxSwitchTracer {
+  struct __pyx_vtabstruct_6gevent_8__tracer__HubTracer __pyx_base;
+};
+static struct __pyx_vtabstruct_6gevent_8__tracer_MaxSwitchTracer *__pyx_vtabptr_6gevent_8__tracer_MaxSwitchTracer;
+
 151:     # A greenlet tracer that records the maximum time between switches,
+
 152:     # not including time spent in the hub.
+
 153: 
+
+154:     def __init__(self, hub, max_blocking_time):
+
/* Python wrapper */
+static int __pyx_pw_6gevent_8__tracer_15MaxSwitchTracer_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static int __pyx_pw_6gevent_8__tracer_15MaxSwitchTracer_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_hub = 0;
+  PyObject *__pyx_v_max_blocking_time = 0;
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_hub,&__pyx_n_s_max_blocking_time,0};
+    PyObject* values[2] = {0,0};
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_hub)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_max_blocking_time)) != 0)) kw_args--;
+        else {
+          __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(0, 154, __pyx_L3_error)
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 154, __pyx_L3_error)
+      }
+    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
+      goto __pyx_L5_argtuple_error;
+    } else {
+      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+    }
+    __pyx_v_hub = values[0];
+    __pyx_v_max_blocking_time = values[1];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 154, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.__tracer.MaxSwitchTracer.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return -1;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_8__tracer_15MaxSwitchTracer___init__(((struct __pyx_obj_6gevent_8__tracer_MaxSwitchTracer *)__pyx_v_self), __pyx_v_hub, __pyx_v_max_blocking_time);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_8__tracer_15MaxSwitchTracer___init__(struct __pyx_obj_6gevent_8__tracer_MaxSwitchTracer *__pyx_v_self, PyObject *__pyx_v_hub, PyObject *__pyx_v_max_blocking_time) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = 0;
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_AddTraceback("gevent.__tracer.MaxSwitchTracer.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = -1;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+155:         _HubTracer.__init__(self, hub, max_blocking_time)
+
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_6gevent_8__tracer__HubTracer), __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 155, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = NULL;
+  __pyx_t_4 = 0;
+  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+    if (likely(__pyx_t_3)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+      __Pyx_INCREF(__pyx_t_3);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_2, function);
+      __pyx_t_4 = 1;
+    }
+  }
+  #if CYTHON_FAST_PYCALL
+  if (PyFunction_Check(__pyx_t_2)) {
+    PyObject *__pyx_temp[4] = {__pyx_t_3, ((PyObject *)__pyx_v_self), __pyx_v_hub, __pyx_v_max_blocking_time};
+    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 155, __pyx_L1_error)
+    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __Pyx_GOTREF(__pyx_t_1);
+  } else
+  #endif
+  #if CYTHON_FAST_PYCCALL
+  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
+    PyObject *__pyx_temp[4] = {__pyx_t_3, ((PyObject *)__pyx_v_self), __pyx_v_hub, __pyx_v_max_blocking_time};
+    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 155, __pyx_L1_error)
+    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __Pyx_GOTREF(__pyx_t_1);
+  } else
+  #endif
+  {
+    __pyx_t_5 = PyTuple_New(3+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 155, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_5);
+    if (__pyx_t_3) {
+      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
+    }
+    __Pyx_INCREF(((PyObject *)__pyx_v_self));
+    __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
+    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, ((PyObject *)__pyx_v_self));
+    __Pyx_INCREF(__pyx_v_hub);
+    __Pyx_GIVEREF(__pyx_v_hub);
+    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_hub);
+    __Pyx_INCREF(__pyx_v_max_blocking_time);
+    __Pyx_GIVEREF(__pyx_v_max_blocking_time);
+    PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_4, __pyx_v_max_blocking_time);
+    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 155, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+  }
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+156:         self.last_switch = perf_counter()
+
  __Pyx_INCREF(__pyx_v_6gevent_8__tracer_perf_counter);
+  __pyx_t_2 = __pyx_v_6gevent_8__tracer_perf_counter; __pyx_t_5 = NULL;
+  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
+    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
+    if (likely(__pyx_t_5)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+      __Pyx_INCREF(__pyx_t_5);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_2, function);
+    }
+  }
+  __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 156, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_6 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 156, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_v_self->last_switch = __pyx_t_6;
+
+157:         self.max_blocking = 0
+
  __pyx_v_self->max_blocking = 0.0;
+
 158: 
+
+159:     def _trace(self, event, args):
+
static PyObject *__pyx_pw_6gevent_8__tracer_15MaxSwitchTracer_3_trace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_f_6gevent_8__tracer_15MaxSwitchTracer__trace(struct __pyx_obj_6gevent_8__tracer_MaxSwitchTracer *__pyx_v_self, PyObject *__pyx_v_event, PyObject *__pyx_v_args, int __pyx_skip_dispatch) {
+  double __pyx_v_switched_at;
+  PyObject *__pyx_v_old_active = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_trace", 0);
+  /* Check if called by wrapper */
+  if (unlikely(__pyx_skip_dispatch)) ;
+  /* Check if overridden in Python */
+  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
+    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
+    if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
+    else {
+      PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      #endif
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_trace); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 159, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_8__tracer_15MaxSwitchTracer_3_trace)) {
+        __Pyx_XDECREF(__pyx_r);
+        __Pyx_INCREF(__pyx_t_1);
+        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
+        __pyx_t_5 = 0;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+          if (likely(__pyx_t_4)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+            __Pyx_INCREF(__pyx_t_4);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_3, function);
+            __pyx_t_5 = 1;
+          }
+        }
+        #if CYTHON_FAST_PYCALL
+        if (PyFunction_Check(__pyx_t_3)) {
+          PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_event, __pyx_v_args};
+          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 159, __pyx_L1_error)
+          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+          __Pyx_GOTREF(__pyx_t_2);
+        } else
+        #endif
+        #if CYTHON_FAST_PYCCALL
+        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
+          PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_event, __pyx_v_args};
+          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 159, __pyx_L1_error)
+          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+          __Pyx_GOTREF(__pyx_t_2);
+        } else
+        #endif
+        {
+          __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 159, __pyx_L1_error)
+          __Pyx_GOTREF(__pyx_t_6);
+          if (__pyx_t_4) {
+            __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
+          }
+          __Pyx_INCREF(__pyx_v_event);
+          __Pyx_GIVEREF(__pyx_v_event);
+          PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_event);
+          __Pyx_INCREF(__pyx_v_args);
+          __Pyx_GIVEREF(__pyx_v_args);
+          PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_args);
+          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 159, __pyx_L1_error)
+          __Pyx_GOTREF(__pyx_t_2);
+          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+        }
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __pyx_r = __pyx_t_2;
+        __pyx_t_2 = 0;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        goto __pyx_L0;
+      }
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+      tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
+      if (unlikely(type_dict_guard != tp_dict_version)) {
+        tp_dict_version = obj_dict_version = 0;
+      }
+      #endif
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    }
+    #endif
+  }
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_6);
+  __Pyx_AddTraceback("gevent.__tracer.MaxSwitchTracer._trace", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_old_active);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_8__tracer_15MaxSwitchTracer_3_trace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_6gevent_8__tracer_15MaxSwitchTracer_2_trace[] = "MaxSwitchTracer._trace(self, str event, tuple args)";
+static PyMethodDef __pyx_mdef_6gevent_8__tracer_15MaxSwitchTracer_3_trace = {"_trace", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_8__tracer_15MaxSwitchTracer_3_trace, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_8__tracer_15MaxSwitchTracer_2_trace};
+static PyObject *__pyx_pw_6gevent_8__tracer_15MaxSwitchTracer_3_trace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_event = 0;
+  PyObject *__pyx_v_args = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_trace (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_event,&__pyx_n_s_args,0};
+    PyObject* values[2] = {0,0};
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_event)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args)) != 0)) kw_args--;
+        else {
+          __Pyx_RaiseArgtupleInvalid("_trace", 1, 2, 2, 1); __PYX_ERR(0, 159, __pyx_L3_error)
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_trace") < 0)) __PYX_ERR(0, 159, __pyx_L3_error)
+      }
+    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
+      goto __pyx_L5_argtuple_error;
+    } else {
+      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+    }
+    __pyx_v_event = ((PyObject*)values[0]);
+    __pyx_v_args = ((PyObject*)values[1]);
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("_trace", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 159, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.__tracer.MaxSwitchTracer._trace", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_event), (&PyString_Type), 1, "event", 1))) __PYX_ERR(0, 159, __pyx_L1_error)
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_args), (&PyTuple_Type), 1, "args", 1))) __PYX_ERR(0, 159, __pyx_L1_error)
+  __pyx_r = __pyx_pf_6gevent_8__tracer_15MaxSwitchTracer_2_trace(((struct __pyx_obj_6gevent_8__tracer_MaxSwitchTracer *)__pyx_v_self), __pyx_v_event, __pyx_v_args);
+
+  /* function exit code */
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_8__tracer_15MaxSwitchTracer_2_trace(struct __pyx_obj_6gevent_8__tracer_MaxSwitchTracer *__pyx_v_self, PyObject *__pyx_v_event, PyObject *__pyx_v_args) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_trace", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __pyx_f_6gevent_8__tracer_15MaxSwitchTracer__trace(__pyx_v_self, __pyx_v_event, __pyx_v_args, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 159, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.__tracer.MaxSwitchTracer._trace", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__21 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_event, __pyx_n_s_args); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(0, 159, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__21);
+  __Pyx_GIVEREF(__pyx_tuple__21);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_8__tracer_15MaxSwitchTracer_3_trace, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_MaxSwitchTracer__trace, NULL, __pyx_n_s_gevent___tracer, __pyx_d, ((PyObject *)__pyx_codeobj__22)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 159, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_8__tracer_MaxSwitchTracer->tp_dict, __pyx_n_s_trace, __pyx_t_2) < 0) __PYX_ERR(0, 159, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_8__tracer_MaxSwitchTracer);
+  __pyx_codeobj__22 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__21, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__tracer_py, __pyx_n_s_trace, 159, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__22)) __PYX_ERR(0, 159, __pyx_L1_error)
+
+160:         old_active = self.active_greenlet
+
  __pyx_t_1 = __pyx_v_self->__pyx_base.__pyx_base.active_greenlet;
+  __Pyx_INCREF(__pyx_t_1);
+  __pyx_v_old_active = __pyx_t_1;
+  __pyx_t_1 = 0;
+
+161:         GreenletTracer._trace(self, event, args)
+
  __pyx_t_1 = __pyx_f_6gevent_8__tracer_14GreenletTracer__trace(((struct __pyx_obj_6gevent_8__tracer_GreenletTracer *)__pyx_v_self), __pyx_v_event, __pyx_v_args, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 161, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+162:         if old_active is not self.hub and old_active is not None:
+
  __pyx_t_8 = (__pyx_v_old_active != __pyx_v_self->__pyx_base.hub);
+  __pyx_t_9 = (__pyx_t_8 != 0);
+  if (__pyx_t_9) {
+  } else {
+    __pyx_t_7 = __pyx_t_9;
+    goto __pyx_L4_bool_binop_done;
+  }
+  __pyx_t_9 = (__pyx_v_old_active != Py_None);
+  __pyx_t_8 = (__pyx_t_9 != 0);
+  __pyx_t_7 = __pyx_t_8;
+  __pyx_L4_bool_binop_done:;
+  if (__pyx_t_7) {
+/* … */
+  }
+
 163:             # If we're switching out of the hub, the blocking
+
 164:             # time doesn't count.
+
+165:             switched_at = perf_counter()
+
    __Pyx_INCREF(__pyx_v_6gevent_8__tracer_perf_counter);
+    __pyx_t_2 = __pyx_v_6gevent_8__tracer_perf_counter; __pyx_t_3 = NULL;
+    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
+      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+      if (likely(__pyx_t_3)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+        __Pyx_INCREF(__pyx_t_3);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_2, function);
+      }
+    }
+    __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
+    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 165, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 165, __pyx_L1_error)
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __pyx_v_switched_at = __pyx_t_10;
+
+166:             self.max_blocking = max(self.max_blocking,
+
    __pyx_t_11 = __pyx_v_self->max_blocking;
+/* … */
+    __pyx_v_self->max_blocking = __pyx_t_12;
+
+167:                                     switched_at - self.last_switch)
+
    __pyx_t_10 = (__pyx_v_switched_at - __pyx_v_self->last_switch);
+/* … */
+    if (((__pyx_t_10 > __pyx_t_11) != 0)) {
+      __pyx_t_12 = __pyx_t_10;
+    } else {
+      __pyx_t_12 = __pyx_t_11;
+    }
+
 168: 
+
+169:     def did_block_hub(self, hub):
+
static PyObject *__pyx_pw_6gevent_8__tracer_15MaxSwitchTracer_5did_block_hub(PyObject *__pyx_v_self, PyObject *__pyx_v_hub); /*proto*/
+static PyObject *__pyx_f_6gevent_8__tracer_15MaxSwitchTracer_did_block_hub(struct __pyx_obj_6gevent_8__tracer_MaxSwitchTracer *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_hub, int __pyx_skip_dispatch) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("did_block_hub", 0);
+  /* Check if called by wrapper */
+  if (unlikely(__pyx_skip_dispatch)) ;
+  /* Check if overridden in Python */
+  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
+    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
+    if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
+    else {
+      PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      #endif
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_did_block_hub); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 169, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_8__tracer_15MaxSwitchTracer_5did_block_hub)) {
+        __Pyx_XDECREF(__pyx_r);
+        __Pyx_INCREF(__pyx_t_1);
+        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+          if (likely(__pyx_t_4)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+            __Pyx_INCREF(__pyx_t_4);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_3, function);
+          }
+        }
+        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_hub) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_hub);
+        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 169, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __pyx_r = __pyx_t_2;
+        __pyx_t_2 = 0;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        goto __pyx_L0;
+      }
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+      tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
+      if (unlikely(type_dict_guard != tp_dict_version)) {
+        tp_dict_version = obj_dict_version = 0;
+      }
+      #endif
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    }
+    #endif
+  }
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_AddTraceback("gevent.__tracer.MaxSwitchTracer.did_block_hub", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_8__tracer_15MaxSwitchTracer_5did_block_hub(PyObject *__pyx_v_self, PyObject *__pyx_v_hub); /*proto*/
+static char __pyx_doc_6gevent_8__tracer_15MaxSwitchTracer_4did_block_hub[] = "MaxSwitchTracer.did_block_hub(self, hub)";
+static PyMethodDef __pyx_mdef_6gevent_8__tracer_15MaxSwitchTracer_5did_block_hub = {"did_block_hub", (PyCFunction)__pyx_pw_6gevent_8__tracer_15MaxSwitchTracer_5did_block_hub, METH_O, __pyx_doc_6gevent_8__tracer_15MaxSwitchTracer_4did_block_hub};
+static PyObject *__pyx_pw_6gevent_8__tracer_15MaxSwitchTracer_5did_block_hub(PyObject *__pyx_v_self, PyObject *__pyx_v_hub) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("did_block_hub (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_8__tracer_15MaxSwitchTracer_4did_block_hub(((struct __pyx_obj_6gevent_8__tracer_MaxSwitchTracer *)__pyx_v_self), ((PyObject *)__pyx_v_hub));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_8__tracer_15MaxSwitchTracer_4did_block_hub(struct __pyx_obj_6gevent_8__tracer_MaxSwitchTracer *__pyx_v_self, PyObject *__pyx_v_hub) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("did_block_hub", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __pyx_f_6gevent_8__tracer_15MaxSwitchTracer_did_block_hub(__pyx_v_self, __pyx_v_hub, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 169, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.__tracer.MaxSwitchTracer.did_block_hub", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__23 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_hub); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(0, 169, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__23);
+  __Pyx_GIVEREF(__pyx_tuple__23);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_8__tracer_15MaxSwitchTracer_5did_block_hub, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_MaxSwitchTracer_did_block_hub, NULL, __pyx_n_s_gevent___tracer, __pyx_d, ((PyObject *)__pyx_codeobj__24)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 169, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_8__tracer_MaxSwitchTracer->tp_dict, __pyx_n_s_did_block_hub, __pyx_t_2) < 0) __PYX_ERR(0, 169, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_8__tracer_MaxSwitchTracer);
+
+170:         if self.max_blocking == 0:
+
  __pyx_t_5 = ((__pyx_v_self->max_blocking == 0.0) != 0);
+  if (__pyx_t_5) {
+/* … */
+  }
+
 171:             # We never switched. Check the time now
+
+172:             self.max_blocking = perf_counter() - self.last_switch
+
    __Pyx_INCREF(__pyx_v_6gevent_8__tracer_perf_counter);
+    __pyx_t_2 = __pyx_v_6gevent_8__tracer_perf_counter; __pyx_t_3 = NULL;
+    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
+      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+      if (likely(__pyx_t_3)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+        __Pyx_INCREF(__pyx_t_3);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_2, function);
+      }
+    }
+    __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
+    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 172, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __pyx_t_2 = PyFloat_FromDouble(__pyx_v_self->last_switch); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 172, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_3 = PyNumber_Subtract(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 172, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_6 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 172, __pyx_L1_error)
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __pyx_v_self->max_blocking = __pyx_t_6;
+
 173: 
+
+174:         if self.max_blocking > self.max_blocking_time:
+
  __pyx_t_5 = ((__pyx_v_self->max_blocking > __pyx_v_self->__pyx_base.max_blocking_time) != 0);
+  if (__pyx_t_5) {
+/* … */
+  }
+
+175:             return True, self.active_greenlet
+
    __Pyx_XDECREF(__pyx_r);
+    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 175, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_INCREF(Py_True);
+    __Pyx_GIVEREF(Py_True);
+    PyTuple_SET_ITEM(__pyx_t_3, 0, Py_True);
+    __Pyx_INCREF(__pyx_v_self->__pyx_base.__pyx_base.active_greenlet);
+    __Pyx_GIVEREF(__pyx_v_self->__pyx_base.__pyx_base.active_greenlet);
+    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_self->__pyx_base.__pyx_base.active_greenlet);
+    __pyx_r = __pyx_t_3;
+    __pyx_t_3 = 0;
+    goto __pyx_L0;
+
 176: 
+
 177: 
+
+178: from gevent._util import import_c_accel
+
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 178, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_import_c_accel);
+  __Pyx_GIVEREF(__pyx_n_s_import_c_accel);
+  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_import_c_accel);
+  __pyx_t_1 = __Pyx_Import(__pyx_n_s_gevent__util, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 178, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_import_c_accel); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 178, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_import_c_accel, __pyx_t_2) < 0) __PYX_ERR(0, 178, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+179: import_c_accel(globals(), 'gevent.__tracer')
+
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_import_c_accel); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 179, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = __Pyx_Globals(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 179, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 179, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_GIVEREF(__pyx_t_2);
+  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_gevent___tracer);
+  __Pyx_GIVEREF(__pyx_n_s_gevent___tracer);
+  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_n_s_gevent___tracer);
+  __pyx_t_2 = 0;
+  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 179, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_tracer.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_tracer.py new file mode 100644 index 00000000..98307ab5 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_tracer.py @@ -0,0 +1,179 @@ +# Copyright (c) 2018 gevent. See LICENSE for details. +# cython: auto_pickle=False,embedsignature=True,always_allow_keywords=False +from __future__ import print_function, absolute_import, division + +import sys +import traceback + +from greenlet import settrace +from greenlet import getcurrent + +from gevent.util import format_run_info + +from gevent._compat import perf_counter +from gevent._util import gmctime + + +__all__ = [ + 'GreenletTracer', + 'HubSwitchTracer', + 'MaxSwitchTracer', +] + +# Recall these classes are cython compiled, so +# class variable declarations are bad. + + +class GreenletTracer(object): + def __init__(self): + # A counter, incremented by the greenlet trace function + # we install on every greenlet switch. This is reset when the + # periodic monitoring thread runs. + + self.greenlet_switch_counter = 0 + + # The greenlet last switched to. + self.active_greenlet = None + + # The trace function that was previously installed, + # if any. + # NOTE: Calling a class instance is cheaper than + # calling a bound method (at least when compiled with cython) + # even when it redirects to another function. + prev_trace = settrace(self) + + self.previous_trace_function = prev_trace + + self._killed = False + + def kill(self): + # Must be called in the monitored thread. + if not self._killed: + self._killed = True + settrace(self.previous_trace_function) + self.previous_trace_function = None + + def _trace(self, event, args): + # This function runs in the thread we are monitoring. + self.greenlet_switch_counter += 1 + if event in ('switch', 'throw'): + # args is (origin, target). This is the only defined + # case + self.active_greenlet = args[1] + else: + self.active_greenlet = None + if self.previous_trace_function is not None: + self.previous_trace_function(event, args) + + def __call__(self, event, args): + return self._trace(event, args) + + def did_block_hub(self, hub): + # Check to see if we have blocked since the last call to this + # method. Returns a true value if we blocked (not in the hub), + # a false value if everything is fine. + + # This may be called in the same thread being traced or a + # different thread; if a different thread, there is a race + # condition with this being incremented in the thread we're + # monitoring, but probably not often enough to lead to + # annoying false positives. + + active_greenlet = self.active_greenlet + did_switch = self.greenlet_switch_counter != 0 + self.greenlet_switch_counter = 0 + + if did_switch or active_greenlet is None or active_greenlet is hub: + # Either we switched, or nothing is running (we got a + # trace event we don't know about or were requested to + # ignore), or we spent the whole time in the hub, blocked + # for IO. Nothing to report. + return False + return True, active_greenlet + + def ignore_current_greenlet_blocking(self): + # Don't pay attention to the current greenlet. + self.active_greenlet = None + + def monitor_current_greenlet_blocking(self): + self.active_greenlet = getcurrent() + + def did_block_hub_report(self, hub, active_greenlet, format_kwargs): + report = ['=' * 80, + '\n%s : Greenlet %s appears to be blocked' % + (gmctime(), active_greenlet)] + report.append(" Reported by %s" % (self,)) + try: + frame = sys._current_frames()[hub.thread_ident] + except KeyError: + # The thread holding the hub has died. Perhaps we shouldn't + # even report this? + stack = ["Unknown: No thread found for hub %r\n" % (hub,)] + else: + stack = traceback.format_stack(frame) + report.append('Blocked Stack (for thread id %s):' % (hex(hub.thread_ident),)) + report.append(''.join(stack)) + report.append("Info:") + report.extend(format_run_info(**format_kwargs)) + + return report + + +class _HubTracer(GreenletTracer): + def __init__(self, hub, max_blocking_time): + GreenletTracer.__init__(self) + self.max_blocking_time = max_blocking_time + self.hub = hub + + def kill(self): + self.hub = None + GreenletTracer.kill(self) + + +class HubSwitchTracer(_HubTracer): + # A greenlet tracer that records the last time we switched *into* the hub. + + def __init__(self, hub, max_blocking_time): + _HubTracer.__init__(self, hub, max_blocking_time) + self.last_entered_hub = 0 + + def _trace(self, event, args): + GreenletTracer._trace(self, event, args) + if self.active_greenlet is self.hub: + self.last_entered_hub = perf_counter() + + def did_block_hub(self, hub): + if perf_counter() - self.last_entered_hub > self.max_blocking_time: + return True, self.active_greenlet + + +class MaxSwitchTracer(_HubTracer): + # A greenlet tracer that records the maximum time between switches, + # not including time spent in the hub. + + def __init__(self, hub, max_blocking_time): + _HubTracer.__init__(self, hub, max_blocking_time) + self.last_switch = perf_counter() + self.max_blocking = 0 + + def _trace(self, event, args): + old_active = self.active_greenlet + GreenletTracer._trace(self, event, args) + if old_active is not self.hub and old_active is not None: + # If we're switching out of the hub, the blocking + # time doesn't count. + switched_at = perf_counter() + self.max_blocking = max(self.max_blocking, + switched_at - self.last_switch) + + def did_block_hub(self, hub): + if self.max_blocking == 0: + # We never switched. Check the time now + self.max_blocking = perf_counter() - self.last_switch + + if self.max_blocking > self.max_blocking_time: + return True, self.active_greenlet + + +from gevent._util import import_c_accel +import_c_accel(globals(), 'gevent.__tracer') diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_util.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_util.py new file mode 100644 index 00000000..4397aa3e --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_util.py @@ -0,0 +1,178 @@ +# -*- coding: utf-8 -*- +""" +internal gevent utilities, not for external use. +""" + +from __future__ import print_function, absolute_import, division + +from functools import update_wrapper + +from gevent._compat import iteritems + + +class _NONE(object): + """ + A special object you must never pass to any gevent API. + Used as a marker object for keyword arguments that cannot have the + builtin None (because that might be a valid value). + """ + __slots__ = () + + def __repr__(self): + return '' + +_NONE = _NONE() + +def copy_globals(source, + globs, + only_names=None, + ignore_missing_names=False, + names_to_ignore=(), + dunder_names_to_keep=('__implements__', '__all__', '__imports__'), + cleanup_globs=True): + """ + Copy attributes defined in ``source.__dict__`` to the dictionary + in globs (which should be the caller's :func:`globals`). + + Names that start with ``__`` are ignored (unless they are in + *dunder_names_to_keep*). Anything found in *names_to_ignore* is + also ignored. + + If *only_names* is given, only those attributes will be + considered. In this case, *ignore_missing_names* says whether or + not to raise an :exc:`AttributeError` if one of those names can't + be found. + + If *cleanup_globs* has a true value, then common things imported but + not used at runtime are removed, including this function. + + Returns a list of the names copied; this should be assigned to ``__imports__``. + """ + if only_names: + if ignore_missing_names: + items = ((k, getattr(source, k, _NONE)) for k in only_names) + else: + items = ((k, getattr(source, k)) for k in only_names) + else: + items = iteritems(source.__dict__) + + copied = [] + for key, value in items: + if value is _NONE: + continue + if key in names_to_ignore: + continue + if key.startswith("__") and key not in dunder_names_to_keep: + continue + globs[key] = value + copied.append(key) + + if cleanup_globs: + if 'copy_globals' in globs: + del globs['copy_globals'] + + return copied + +def import_c_accel(globs, cname): + """ + Import the C-accelerator for the __name__ + and copy its globals. + """ + + name = globs.get('__name__') + + if not name or name == cname: + # Do nothing if we're being exec'd as a file (no name) + # or we're running from the C extension + return + + + from gevent._compat import PURE_PYTHON + if PURE_PYTHON: + return + + import importlib + import warnings + with warnings.catch_warnings(): + # Python 3.7 likes to produce + # "ImportWarning: can't resolve + # package from __spec__ or __package__, falling back on + # __name__ and __path__" + # when we load cython compiled files. This is probably a bug in + # Cython, but it doesn't seem to have any consequences, it's + # just annoying to see and can mess up our unittests. + warnings.simplefilter('ignore', ImportWarning) + mod = importlib.import_module(cname) + + # By adopting the entire __dict__, we get a more accurate + # __file__ and module repr, plus we don't leak any imported + # things we no longer need. + globs.clear() + globs.update(mod.__dict__) + + if 'import_c_accel' in globs: + del globs['import_c_accel'] + + +class Lazy(object): + """ + A non-data descriptor used just like @property. The + difference is the function value is assigned to the instance + dict the first time it is accessed and then the function is never + called agoin. + """ + def __init__(self, func): + self.data = (func, func.__name__) + update_wrapper(self, func) + + def __get__(self, inst, class_): + if inst is None: + return self + + func, name = self.data + value = func(inst) + inst.__dict__[name] = value + return value + +class readproperty(object): + """ + A non-data descriptor like @property. The difference is that + when the property is assigned to, it is cached in the instance + and the function is not called on that instance again. + """ + + def __init__(self, func): + self.func = func + update_wrapper(self, func) + + def __get__(self, inst, class_): + if inst is None: + return self + + return self.func(inst) + +def gmctime(): + """ + Returns the current time as a string in RFC3339 format. + """ + import time + return time.strftime("%Y-%m-%dT%H:%M:%SZ", time.gmtime()) + +try: + from zope.interface import Interface + from zope.interface import implementer + from zope.interface import Attribute +except ImportError: + class Interface(object): + pass + def implementer(_iface): + def dec(c): + return c + return dec + + def Attribute(s): + return s + +Interface = Interface +implementer = implementer +Attribute = Attribute diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_util_py2.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_util_py2.py new file mode 100644 index 00000000..02332e37 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_util_py2.py @@ -0,0 +1,23 @@ +import sys + +__all__ = ['reraise'] + + +def exec_(_code_, _globs_=None, _locs_=None): + """Execute code in a namespace.""" + if _globs_ is None: + frame = sys._getframe(1) + _globs_ = frame.f_globals + if _locs_ is None: + _locs_ = frame.f_locals + del frame + elif _locs_ is None: + _locs_ = _globs_ + exec("""exec _code_ in _globs_, _locs_""") + +exec_("""def reraise(tp, value, tb=None): + try: + raise tp, value, tb + finally: + tb = None +""") diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_waiter.c b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_waiter.c new file mode 100644 index 00000000..06fc3d9e --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_waiter.c @@ -0,0 +1,8893 @@ +/* Generated by Cython 0.29.2 */ + +/* BEGIN: Cython Metadata +{ + "distutils": { + "depends": [ + "src/gevent/__waiter.pxd", + "src\\gevent\\__waiter.pxd" + ], + "include_dirs": [ + "C:\\Python37\\Include", + "deps" + ], + "name": "gevent.__waiter", + "sources": [ + "src/gevent/_waiter.py" + ] + }, + "module_name": "gevent.__waiter" +} +END: Cython Metadata */ + +#define PY_SSIZE_T_CLEAN +#include "Python.h" +#ifndef Py_PYTHON_H + #error Python headers needed to compile C extensions, please install development version of Python. +#elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) + #error Cython requires Python 2.6+ or Python 3.3+. +#else +#define CYTHON_ABI "0_29_2" +#define CYTHON_HEX_VERSION 0x001D02F0 +#define CYTHON_FUTURE_DIVISION 1 +#include +#ifndef offsetof + #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) +#endif +#if !defined(WIN32) && !defined(MS_WINDOWS) + #ifndef __stdcall + #define __stdcall + #endif + #ifndef __cdecl + #define __cdecl + #endif + #ifndef __fastcall + #define __fastcall + #endif +#endif +#ifndef DL_IMPORT + #define DL_IMPORT(t) t +#endif +#ifndef DL_EXPORT + #define DL_EXPORT(t) t +#endif +#define __PYX_COMMA , +#ifndef HAVE_LONG_LONG + #if PY_VERSION_HEX >= 0x02070000 + #define HAVE_LONG_LONG + #endif +#endif +#ifndef PY_LONG_LONG + #define PY_LONG_LONG LONG_LONG +#endif +#ifndef Py_HUGE_VAL + #define Py_HUGE_VAL HUGE_VAL +#endif +#ifdef PYPY_VERSION + #define CYTHON_COMPILING_IN_PYPY 1 + #define CYTHON_COMPILING_IN_PYSTON 0 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #undef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 0 + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #if PY_VERSION_HEX < 0x03050000 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #elif !defined(CYTHON_USE_ASYNC_SLOTS) + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #undef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 0 + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #undef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 1 + #undef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 0 + #undef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 0 + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #undef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE 0 + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 +#elif defined(PYSTON_VERSION) + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_PYSTON 1 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #ifndef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 1 + #endif + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #ifndef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 1 + #endif + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #ifndef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 0 + #endif + #ifndef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 1 + #endif + #ifndef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 1 + #endif + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #undef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE 0 + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 +#else + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_PYSTON 0 + #define CYTHON_COMPILING_IN_CPYTHON 1 + #ifndef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 1 + #endif + #if PY_VERSION_HEX < 0x02070000 + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #elif !defined(CYTHON_USE_PYTYPE_LOOKUP) + #define CYTHON_USE_PYTYPE_LOOKUP 1 + #endif + #if PY_MAJOR_VERSION < 3 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #elif !defined(CYTHON_USE_ASYNC_SLOTS) + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #if PY_VERSION_HEX < 0x02070000 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #elif !defined(CYTHON_USE_PYLONG_INTERNALS) + #define CYTHON_USE_PYLONG_INTERNALS 1 + #endif + #ifndef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 1 + #endif + #ifndef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 1 + #endif + #if PY_VERSION_HEX < 0x030300F0 + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #elif !defined(CYTHON_USE_UNICODE_WRITER) + #define CYTHON_USE_UNICODE_WRITER 1 + #endif + #ifndef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 0 + #endif + #ifndef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 1 + #endif + #ifndef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 1 + #endif + #ifndef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 1 + #endif + #ifndef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 1 + #endif + #ifndef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000) + #endif + #ifndef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1) + #endif + #ifndef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1) + #endif + #ifndef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3) + #endif +#endif +#if !defined(CYTHON_FAST_PYCCALL) +#define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) +#endif +#if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #undef SHIFT + #undef BASE + #undef MASK + #ifdef SIZEOF_VOID_P + enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) }; + #endif +#endif +#ifndef __has_attribute + #define __has_attribute(x) 0 +#endif +#ifndef __has_cpp_attribute + #define __has_cpp_attribute(x) 0 +#endif +#ifndef CYTHON_RESTRICT + #if defined(__GNUC__) + #define CYTHON_RESTRICT __restrict__ + #elif defined(_MSC_VER) && _MSC_VER >= 1400 + #define CYTHON_RESTRICT __restrict + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_RESTRICT restrict + #else + #define CYTHON_RESTRICT + #endif +#endif +#ifndef CYTHON_UNUSED +# if defined(__GNUC__) +# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +#endif +#ifndef CYTHON_MAYBE_UNUSED_VAR +# if defined(__cplusplus) + template void CYTHON_MAYBE_UNUSED_VAR( const T& ) { } +# else +# define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x) +# endif +#endif +#ifndef CYTHON_NCP_UNUSED +# if CYTHON_COMPILING_IN_CPYTHON +# define CYTHON_NCP_UNUSED +# else +# define CYTHON_NCP_UNUSED CYTHON_UNUSED +# endif +#endif +#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) +#ifdef _MSC_VER + #ifndef _MSC_STDINT_H_ + #if _MSC_VER < 1300 + typedef unsigned char uint8_t; + typedef unsigned int uint32_t; + #else + typedef unsigned __int8 uint8_t; + typedef unsigned __int32 uint32_t; + #endif + #endif +#else + #include +#endif +#ifndef CYTHON_FALLTHROUGH + #if defined(__cplusplus) && __cplusplus >= 201103L + #if __has_cpp_attribute(fallthrough) + #define CYTHON_FALLTHROUGH [[fallthrough]] + #elif __has_cpp_attribute(clang::fallthrough) + #define CYTHON_FALLTHROUGH [[clang::fallthrough]] + #elif __has_cpp_attribute(gnu::fallthrough) + #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] + #endif + #endif + #ifndef CYTHON_FALLTHROUGH + #if __has_attribute(fallthrough) + #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) + #else + #define CYTHON_FALLTHROUGH + #endif + #endif + #if defined(__clang__ ) && defined(__apple_build_version__) + #if __apple_build_version__ < 7000000 + #undef CYTHON_FALLTHROUGH + #define CYTHON_FALLTHROUGH + #endif + #endif +#endif + +#ifndef CYTHON_INLINE + #if defined(__clang__) + #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) + #elif defined(__GNUC__) + #define CYTHON_INLINE __inline__ + #elif defined(_MSC_VER) + #define CYTHON_INLINE __inline + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_INLINE inline + #else + #define CYTHON_INLINE + #endif +#endif + +#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) + #define Py_OptimizeFlag 0 +#endif +#define __PYX_BUILD_PY_SSIZE_T "n" +#define CYTHON_FORMAT_SSIZE_T "z" +#if PY_MAJOR_VERSION < 3 + #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyClass_Type +#else + #define __Pyx_BUILTIN_MODULE_NAME "builtins" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyType_Type +#endif +#ifndef Py_TPFLAGS_CHECKTYPES + #define Py_TPFLAGS_CHECKTYPES 0 +#endif +#ifndef Py_TPFLAGS_HAVE_INDEX + #define Py_TPFLAGS_HAVE_INDEX 0 +#endif +#ifndef Py_TPFLAGS_HAVE_NEWBUFFER + #define Py_TPFLAGS_HAVE_NEWBUFFER 0 +#endif +#ifndef Py_TPFLAGS_HAVE_FINALIZE + #define Py_TPFLAGS_HAVE_FINALIZE 0 +#endif +#ifndef METH_STACKLESS + #define METH_STACKLESS 0 +#endif +#if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) + #ifndef METH_FASTCALL + #define METH_FASTCALL 0x80 + #endif + typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs); + typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args, + Py_ssize_t nargs, PyObject *kwnames); +#else + #define __Pyx_PyCFunctionFast _PyCFunctionFast + #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords +#endif +#if CYTHON_FAST_PYCCALL +#define __Pyx_PyFastCFunction_Check(func)\ + ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS))))) +#else +#define __Pyx_PyFastCFunction_Check(func) 0 +#endif +#if CYTHON_USE_DICT_VERSIONS +#define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) +#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ + (version_var) = __PYX_GET_DICT_VERSION(dict);\ + (cache_var) = (value); +#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ + static PY_UINT64_T __pyx_dict_version = 0;\ + static PyObject *__pyx_dict_cached_value = NULL;\ + if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ + (VAR) = __pyx_dict_cached_value;\ + } else {\ + (VAR) = __pyx_dict_cached_value = (LOOKUP);\ + __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ + }\ + } +#else +#define __PYX_GET_DICT_VERSION(dict) (0) +#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) +#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) + #define PyObject_Malloc(s) PyMem_Malloc(s) + #define PyObject_Free(p) PyMem_Free(p) + #define PyObject_Realloc(p) PyMem_Realloc(p) +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1 + #define PyMem_RawMalloc(n) PyMem_Malloc(n) + #define PyMem_RawRealloc(p, n) PyMem_Realloc(p, n) + #define PyMem_RawFree(p) PyMem_Free(p) +#endif +#if CYTHON_COMPILING_IN_PYSTON + #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co) + #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno) +#else + #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) + #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) +#endif +#if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000 + #define __Pyx_PyThreadState_Current PyThreadState_GET() +#elif PY_VERSION_HEX >= 0x03060000 + #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() +#elif PY_VERSION_HEX >= 0x03000000 + #define __Pyx_PyThreadState_Current PyThreadState_GET() +#else + #define __Pyx_PyThreadState_Current _PyThreadState_Current +#endif +#if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) +#include "pythread.h" +#define Py_tss_NEEDS_INIT 0 +typedef int Py_tss_t; +static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) { + *key = PyThread_create_key(); + return 0; // PyThread_create_key reports success always +} +static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) { + Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t)); + *key = Py_tss_NEEDS_INIT; + return key; +} +static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) { + PyObject_Free(key); +} +static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) { + return *key != Py_tss_NEEDS_INIT; +} +static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) { + PyThread_delete_key(*key); + *key = Py_tss_NEEDS_INIT; +} +static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) { + return PyThread_set_key_value(*key, value); +} +static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { + return PyThread_get_key_value(*key); +} +#endif // TSS (Thread Specific Storage) API +#if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized) +#define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) +#else +#define __Pyx_PyDict_NewPresized(n) PyDict_New() +#endif +#if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION + #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) +#else + #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS +#define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) +#else +#define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name) +#endif +#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) + #define CYTHON_PEP393_ENABLED 1 + #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ + 0 : _PyUnicode_Ready((PyObject *)(op))) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) + #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) + #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) + #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) + #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) + #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch) + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) +#else + #define CYTHON_PEP393_ENABLED 0 + #define PyUnicode_1BYTE_KIND 1 + #define PyUnicode_2BYTE_KIND 2 + #define PyUnicode_4BYTE_KIND 4 + #define __Pyx_PyUnicode_READY(op) (0) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) + #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111) + #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) + #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) + #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) + #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch) + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) +#endif +#if CYTHON_COMPILING_IN_PYPY + #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) +#else + #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ + PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains) + #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check) + #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format) + #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) +#endif +#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) +#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) +#else + #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) +#endif +#if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) + #define PyObject_ASCII(o) PyObject_Repr(o) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBaseString_Type PyUnicode_Type + #define PyStringObject PyUnicodeObject + #define PyString_Type PyUnicode_Type + #define PyString_Check PyUnicode_Check + #define PyString_CheckExact PyUnicode_CheckExact + #define PyObject_Unicode PyObject_Str +#endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) + #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) +#else + #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) + #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) +#endif +#ifndef PySet_CheckExact + #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) +#endif +#if CYTHON_ASSUME_SAFE_MACROS + #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) +#else + #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyIntObject PyLongObject + #define PyInt_Type PyLong_Type + #define PyInt_Check(op) PyLong_Check(op) + #define PyInt_CheckExact(op) PyLong_CheckExact(op) + #define PyInt_FromString PyLong_FromString + #define PyInt_FromUnicode PyLong_FromUnicode + #define PyInt_FromLong PyLong_FromLong + #define PyInt_FromSize_t PyLong_FromSize_t + #define PyInt_FromSsize_t PyLong_FromSsize_t + #define PyInt_AsLong PyLong_AsLong + #define PyInt_AS_LONG PyLong_AS_LONG + #define PyInt_AsSsize_t PyLong_AsSsize_t + #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask + #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask + #define PyNumber_Int PyNumber_Long +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBoolObject PyLongObject +#endif +#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY + #ifndef PyUnicode_InternFromString + #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) + #endif +#endif +#if PY_VERSION_HEX < 0x030200A4 + typedef long Py_hash_t; + #define __Pyx_PyInt_FromHash_t PyInt_FromLong + #define __Pyx_PyInt_AsHash_t PyInt_AsLong +#else + #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t + #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t +#endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : (Py_INCREF(func), func)) +#else + #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) +#endif +#if CYTHON_USE_ASYNC_SLOTS + #if PY_VERSION_HEX >= 0x030500B1 + #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods + #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) + #else + #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) + #endif +#else + #define __Pyx_PyType_AsAsync(obj) NULL +#endif +#ifndef __Pyx_PyAsyncMethodsStruct + typedef struct { + unaryfunc am_await; + unaryfunc am_aiter; + unaryfunc am_anext; + } __Pyx_PyAsyncMethodsStruct; +#endif + +#if defined(WIN32) || defined(MS_WINDOWS) + #define _USE_MATH_DEFINES +#endif +#include +#ifdef NAN +#define __PYX_NAN() ((float) NAN) +#else +static CYTHON_INLINE float __PYX_NAN() { + float value; + memset(&value, 0xFF, sizeof(value)); + return value; +} +#endif +#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) +#define __Pyx_truncl trunc +#else +#define __Pyx_truncl truncl +#endif + + +#define __PYX_ERR(f_index, lineno, Ln_error) \ +{ \ + __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \ +} + +#ifndef __PYX_EXTERN_C + #ifdef __cplusplus + #define __PYX_EXTERN_C extern "C" + #else + #define __PYX_EXTERN_C extern + #endif +#endif + +#define __PYX_HAVE__gevent____waiter +#define __PYX_HAVE_API__gevent____waiter +/* Early includes */ +#include "greenlet/greenlet.h" +#ifdef _OPENMP +#include +#endif /* _OPENMP */ + +#if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) +#define CYTHON_WITHOUT_ASSERTIONS +#endif + +typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; + const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; + +#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 +#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0 +#define __PYX_DEFAULT_STRING_ENCODING "" +#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString +#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#define __Pyx_uchar_cast(c) ((unsigned char)c) +#define __Pyx_long_cast(x) ((long)x) +#define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ + (sizeof(type) < sizeof(Py_ssize_t)) ||\ + (sizeof(type) > sizeof(Py_ssize_t) &&\ + likely(v < (type)PY_SSIZE_T_MAX ||\ + v == (type)PY_SSIZE_T_MAX) &&\ + (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ + v == (type)PY_SSIZE_T_MIN))) ||\ + (sizeof(type) == sizeof(Py_ssize_t) &&\ + (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ + v == (type)PY_SSIZE_T_MAX))) ) +static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) { + return (size_t) i < (size_t) limit; +} +#if defined (__cplusplus) && __cplusplus >= 201103L + #include + #define __Pyx_sst_abs(value) std::abs(value) +#elif SIZEOF_INT >= SIZEOF_SIZE_T + #define __Pyx_sst_abs(value) abs(value) +#elif SIZEOF_LONG >= SIZEOF_SIZE_T + #define __Pyx_sst_abs(value) labs(value) +#elif defined (_MSC_VER) + #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) +#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define __Pyx_sst_abs(value) llabs(value) +#elif defined (__GNUC__) + #define __Pyx_sst_abs(value) __builtin_llabs(value) +#else + #define __Pyx_sst_abs(value) ((value<0) ? -value : value) +#endif +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*); +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); +#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) +#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) +#define __Pyx_PyBytes_FromString PyBytes_FromString +#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); +#if PY_MAJOR_VERSION < 3 + #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#else + #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize +#endif +#define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) +#define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) +#define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) +#define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) +#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) +static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) { + const Py_UNICODE *u_end = u; + while (*u_end++) ; + return (size_t)(u_end - u - 1); +} +#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) +#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode +#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode +#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) +#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) +static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); +static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*); +static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); +#define __Pyx_PySequence_Tuple(obj)\ + (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); +#if CYTHON_ASSUME_SAFE_MACROS +#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) +#else +#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) +#endif +#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) +#if PY_MAJOR_VERSION >= 3 +#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) +#else +#define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) +#endif +#define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x)) +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII +static int __Pyx_sys_getdefaultencoding_not_ascii; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + PyObject* ascii_chars_u = NULL; + PyObject* ascii_chars_b = NULL; + const char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + if (strcmp(default_encoding_c, "ascii") == 0) { + __Pyx_sys_getdefaultencoding_not_ascii = 0; + } else { + char ascii_chars[128]; + int c; + for (c = 0; c < 128; c++) { + ascii_chars[c] = c; + } + __Pyx_sys_getdefaultencoding_not_ascii = 1; + ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); + if (!ascii_chars_u) goto bad; + ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); + if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { + PyErr_Format( + PyExc_ValueError, + "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", + default_encoding_c); + goto bad; + } + Py_DECREF(ascii_chars_u); + Py_DECREF(ascii_chars_b); + } + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + Py_XDECREF(ascii_chars_u); + Py_XDECREF(ascii_chars_b); + return -1; +} +#endif +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) +#else +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +static char* __PYX_DEFAULT_STRING_ENCODING; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1); + if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; + strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + return -1; +} +#endif +#endif + + +/* Test for GCC > 2.95 */ +#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) + #define likely(x) __builtin_expect(!!(x), 1) + #define unlikely(x) __builtin_expect(!!(x), 0) +#else /* !__GNUC__ or GCC < 2.95 */ + #define likely(x) (x) + #define unlikely(x) (x) +#endif /* __GNUC__ */ +static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } + +static PyObject *__pyx_m = NULL; +static PyObject *__pyx_d; +static PyObject *__pyx_b; +static PyObject *__pyx_cython_runtime = NULL; +static PyObject *__pyx_empty_tuple; +static PyObject *__pyx_empty_bytes; +static PyObject *__pyx_empty_unicode; +static int __pyx_lineno; +static int __pyx_clineno = 0; +static const char * __pyx_cfilenm= __FILE__; +static const char *__pyx_filename; + + +static const char *__pyx_f[] = { + "src\\gevent\\_waiter.py", + "src\\gevent\\__greenlet_primitives.pxd", + "src\\gevent\\__waiter.pxd", +}; + +/*--- Type declarations ---*/ +struct __pyx_obj_6gevent_21__greenlet_primitives_TrackedRawGreenlet; +struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop; +struct __pyx_obj_6gevent_8__waiter_Waiter; +struct __pyx_obj_6gevent_8__waiter_MultipleWaiter; + +/* "gevent/__greenlet_primitives.pxd":37 + * return PyGreenlet_Switch(self, NULL, NULL) + * + * cdef class TrackedRawGreenlet(greenlet): # <<<<<<<<<<<<<< + * pass + * + */ +struct __pyx_obj_6gevent_21__greenlet_primitives_TrackedRawGreenlet { + PyGreenlet __pyx_base; +}; + + +/* "gevent/__greenlet_primitives.pxd":40 + * pass + * + * cdef class SwitchOutGreenletWithLoop(TrackedRawGreenlet): # <<<<<<<<<<<<<< + * cdef public loop + * + */ +struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop { + struct __pyx_obj_6gevent_21__greenlet_primitives_TrackedRawGreenlet __pyx_base; + struct __pyx_vtabstruct_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *__pyx_vtab; + PyObject *loop; +}; + + +/* "gevent/__waiter.pxd":33 + * _greenlet_imported = True + * + * cdef class Waiter: # <<<<<<<<<<<<<< + * cdef readonly SwitchOutGreenletWithLoop hub + * cdef readonly greenlet greenlet + */ +struct __pyx_obj_6gevent_8__waiter_Waiter { + PyObject_HEAD + struct __pyx_vtabstruct_6gevent_8__waiter_Waiter *__pyx_vtab; + struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *hub; + PyGreenlet *greenlet; + PyObject *value; + PyObject *_exception; +}; + + +/* "gevent/__waiter.pxd":47 + * @cython.final + * @cython.internal + * cdef class MultipleWaiter(Waiter): # <<<<<<<<<<<<<< + * cdef list _values + */ +struct __pyx_obj_6gevent_8__waiter_MultipleWaiter { + struct __pyx_obj_6gevent_8__waiter_Waiter __pyx_base; + PyObject *_values; +}; + + + +/* "gevent/__greenlet_primitives.pxd":40 + * pass + * + * cdef class SwitchOutGreenletWithLoop(TrackedRawGreenlet): # <<<<<<<<<<<<<< + * cdef public loop + * + */ + +struct __pyx_vtabstruct_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop { + PyObject *(*__pyx_switch)(struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *, int __pyx_skip_dispatch); + PyObject *(*switch_out)(struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *, int __pyx_skip_dispatch); +}; +static struct __pyx_vtabstruct_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *__pyx_vtabptr_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop; + + +/* "src/gevent/_waiter.py":27 + * + * + * class Waiter(object): # <<<<<<<<<<<<<< + * """ + * A low level communication utility for greenlets. + */ + +struct __pyx_vtabstruct_6gevent_8__waiter_Waiter { + PyObject *(*get)(struct __pyx_obj_6gevent_8__waiter_Waiter *, int __pyx_skip_dispatch); + PyObject *(*clear)(struct __pyx_obj_6gevent_8__waiter_Waiter *, int __pyx_skip_dispatch); +}; +static struct __pyx_vtabstruct_6gevent_8__waiter_Waiter *__pyx_vtabptr_6gevent_8__waiter_Waiter; + + +/* "src/gevent/_waiter.py":166 + * + * + * class MultipleWaiter(Waiter): # <<<<<<<<<<<<<< + * """ + * An internal extension of Waiter that can be used if multiple objects + */ + +struct __pyx_vtabstruct_6gevent_8__waiter_MultipleWaiter { + struct __pyx_vtabstruct_6gevent_8__waiter_Waiter __pyx_base; +}; +static struct __pyx_vtabstruct_6gevent_8__waiter_MultipleWaiter *__pyx_vtabptr_6gevent_8__waiter_MultipleWaiter; + +/* --- Runtime support code (head) --- */ +/* Refnanny.proto */ +#ifndef CYTHON_REFNANNY + #define CYTHON_REFNANNY 0 +#endif +#if CYTHON_REFNANNY + typedef struct { + void (*INCREF)(void*, PyObject*, int); + void (*DECREF)(void*, PyObject*, int); + void (*GOTREF)(void*, PyObject*, int); + void (*GIVEREF)(void*, PyObject*, int); + void* (*SetupContext)(const char*, int, const char*); + void (*FinishContext)(void**); + } __Pyx_RefNannyAPIStruct; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); + #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; +#ifdef WITH_THREAD + #define __Pyx_RefNannySetupContext(name, acquire_gil)\ + if (acquire_gil) {\ + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ + PyGILState_Release(__pyx_gilstate_save);\ + } else {\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ + } +#else + #define __Pyx_RefNannySetupContext(name, acquire_gil)\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) +#endif + #define __Pyx_RefNannyFinishContext()\ + __Pyx_RefNanny->FinishContext(&__pyx_refnanny) + #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0) + #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) + #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) + #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) +#else + #define __Pyx_RefNannyDeclarations + #define __Pyx_RefNannySetupContext(name, acquire_gil) + #define __Pyx_RefNannyFinishContext() + #define __Pyx_INCREF(r) Py_INCREF(r) + #define __Pyx_DECREF(r) Py_DECREF(r) + #define __Pyx_GOTREF(r) + #define __Pyx_GIVEREF(r) + #define __Pyx_XINCREF(r) Py_XINCREF(r) + #define __Pyx_XDECREF(r) Py_XDECREF(r) + #define __Pyx_XGOTREF(r) + #define __Pyx_XGIVEREF(r) +#endif +#define __Pyx_XDECREF_SET(r, v) do {\ + PyObject *tmp = (PyObject *) r;\ + r = v; __Pyx_XDECREF(tmp);\ + } while (0) +#define __Pyx_DECREF_SET(r, v) do {\ + PyObject *tmp = (PyObject *) r;\ + r = v; __Pyx_DECREF(tmp);\ + } while (0) +#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) +#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) + +/* PyObjectGetAttrStr.proto */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); +#else +#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) +#endif + +/* GetBuiltinName.proto */ +static PyObject *__Pyx_GetBuiltinName(PyObject *name); + +/* RaiseDoubleKeywords.proto */ +static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); + +/* ParseKeywords.proto */ +static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\ + PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\ + const char* function_name); + +/* RaiseArgTupleInvalid.proto */ +static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, + Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); + +/* ExtTypeTest.proto */ +static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); + +/* PyFunctionFastCall.proto */ +#if CYTHON_FAST_PYCALL +#define __Pyx_PyFunction_FastCall(func, args, nargs)\ + __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) +#if 1 || PY_VERSION_HEX < 0x030600B1 +static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs); +#else +#define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs) +#endif +#define __Pyx_BUILD_ASSERT_EXPR(cond)\ + (sizeof(char [1 - 2*!(cond)]) - 1) +#ifndef Py_MEMBER_SIZE +#define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member) +#endif + static size_t __pyx_pyframe_localsplus_offset = 0; + #include "frameobject.h" + #define __Pxy_PyFrame_Initialize_Offsets()\ + ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\ + (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus))) + #define __Pyx_PyFrame_GetLocalsplus(frame)\ + (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset)) +#endif + +/* PyObjectCall.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); +#else +#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) +#endif + +/* PyObjectCallMethO.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); +#endif + +/* PyObjectCallNoArg.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); +#else +#define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL) +#endif + +/* PyCFunctionFastCall.proto */ +#if CYTHON_FAST_PYCCALL +static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs); +#else +#define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL) +#endif + +/* PyObjectCallOneArg.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); + +/* PyThreadStateGet.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; +#define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; +#define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type +#else +#define __Pyx_PyThreadState_declare +#define __Pyx_PyThreadState_assign +#define __Pyx_PyErr_Occurred() PyErr_Occurred() +#endif + +/* PyErrFetchRestore.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) +#define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) +#define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) +#define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) +#define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); +static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) +#else +#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) +#endif +#else +#define __Pyx_PyErr_Clear() PyErr_Clear() +#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) +#define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) +#define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb) +#define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) +#endif + +/* RaiseException.proto */ +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); + +/* PyObjectCall2Args.proto */ +static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2); + +/* GetTopmostException.proto */ +#if CYTHON_USE_EXC_INFO_STACK +static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate); +#endif + +/* SaveResetException.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); +#else +#define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb) +#define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb) +#endif + +/* GetException.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb) +static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#else +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); +#endif + +/* KeywordStringCheck.proto */ +static int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* function_name, int kw_allowed); + +/* SwapException.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#else +static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb); +#endif + +/* ListAppend.proto */ +#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS +static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) { + PyListObject* L = (PyListObject*) list; + Py_ssize_t len = Py_SIZE(list); + if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) { + Py_INCREF(x); + PyList_SET_ITEM(list, len, x); + Py_SIZE(list) = len+1; + return 0; + } + return PyList_Append(list, x); +} +#else +#define __Pyx_PyList_Append(L,x) PyList_Append(L,x) +#endif + +/* PyObjectGetMethod.proto */ +static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method); + +/* PyObjectCallMethod1.proto */ +static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg); + +/* pop_index.proto */ +static PyObject* __Pyx__PyObject_PopNewIndex(PyObject* L, PyObject* py_ix); +static PyObject* __Pyx__PyObject_PopIndex(PyObject* L, PyObject* py_ix); +#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS +static PyObject* __Pyx__PyList_PopIndex(PyObject* L, PyObject* py_ix, Py_ssize_t ix); +#define __Pyx_PyObject_PopIndex(L, py_ix, ix, is_signed, type, to_py_func) (\ + (likely(PyList_CheckExact(L) && __Pyx_fits_Py_ssize_t(ix, type, is_signed))) ?\ + __Pyx__PyList_PopIndex(L, py_ix, ix) : (\ + (unlikely(py_ix == Py_None)) ? __Pyx__PyObject_PopNewIndex(L, to_py_func(ix)) :\ + __Pyx__PyObject_PopIndex(L, py_ix))) +#define __Pyx_PyList_PopIndex(L, py_ix, ix, is_signed, type, to_py_func) (\ + __Pyx_fits_Py_ssize_t(ix, type, is_signed) ?\ + __Pyx__PyList_PopIndex(L, py_ix, ix) : (\ + (unlikely(py_ix == Py_None)) ? __Pyx__PyObject_PopNewIndex(L, to_py_func(ix)) :\ + __Pyx__PyObject_PopIndex(L, py_ix))) +#else +#define __Pyx_PyList_PopIndex(L, py_ix, ix, is_signed, type, to_py_func)\ + __Pyx_PyObject_PopIndex(L, py_ix, ix, is_signed, type, to_py_func) +#define __Pyx_PyObject_PopIndex(L, py_ix, ix, is_signed, type, to_py_func) (\ + (unlikely(py_ix == Py_None)) ? __Pyx__PyObject_PopNewIndex(L, to_py_func(ix)) :\ + __Pyx__PyObject_PopIndex(L, py_ix)) +#endif + +/* TypeImport.proto */ +#ifndef __PYX_HAVE_RT_ImportType_proto +#define __PYX_HAVE_RT_ImportType_proto +enum __Pyx_ImportType_CheckSize { + __Pyx_ImportType_CheckSize_Error = 0, + __Pyx_ImportType_CheckSize_Warn = 1, + __Pyx_ImportType_CheckSize_Ignore = 2 +}; +static PyTypeObject *__Pyx_ImportType(PyObject* module, const char *module_name, const char *class_name, size_t size, enum __Pyx_ImportType_CheckSize check_size); +#endif + +/* PyObject_GenericGetAttrNoDict.proto */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name); +#else +#define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr +#endif + +/* PyObject_GenericGetAttr.proto */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name); +#else +#define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr +#endif + +/* SetVTable.proto */ +static int __Pyx_SetVtable(PyObject *dict, void *vtable); + +/* GetVTable.proto */ +static void* __Pyx_GetVtable(PyObject *dict); + +/* Import.proto */ +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); + +/* ImportFrom.proto */ +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); + +/* FetchCommonType.proto */ +static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); + +/* CythonFunction.proto */ +#define __Pyx_CyFunction_USED 1 +#define __Pyx_CYFUNCTION_STATICMETHOD 0x01 +#define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 +#define __Pyx_CYFUNCTION_CCLASS 0x04 +#define __Pyx_CyFunction_GetClosure(f)\ + (((__pyx_CyFunctionObject *) (f))->func_closure) +#define __Pyx_CyFunction_GetClassObj(f)\ + (((__pyx_CyFunctionObject *) (f))->func_classobj) +#define __Pyx_CyFunction_Defaults(type, f)\ + ((type *)(((__pyx_CyFunctionObject *) (f))->defaults)) +#define __Pyx_CyFunction_SetDefaultsGetter(f, g)\ + ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g) +typedef struct { + PyCFunctionObject func; +#if PY_VERSION_HEX < 0x030500A0 + PyObject *func_weakreflist; +#endif + PyObject *func_dict; + PyObject *func_name; + PyObject *func_qualname; + PyObject *func_doc; + PyObject *func_globals; + PyObject *func_code; + PyObject *func_closure; + PyObject *func_classobj; + void *defaults; + int defaults_pyobjects; + int flags; + PyObject *defaults_tuple; + PyObject *defaults_kwdict; + PyObject *(*defaults_getter)(PyObject *); + PyObject *func_annotations; +} __pyx_CyFunctionObject; +static PyTypeObject *__pyx_CyFunctionType = 0; +#define __Pyx_CyFunction_Check(obj) (__Pyx_TypeCheck(obj, __pyx_CyFunctionType)) +#define __Pyx_CyFunction_NewEx(ml, flags, qualname, self, module, globals, code)\ + __Pyx_CyFunction_New(__pyx_CyFunctionType, ml, flags, qualname, self, module, globals, code) +static PyObject *__Pyx_CyFunction_New(PyTypeObject *, PyMethodDef *ml, + int flags, PyObject* qualname, + PyObject *self, + PyObject *module, PyObject *globals, + PyObject* code); +static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, + size_t size, + int pyobjects); +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, + PyObject *tuple); +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, + PyObject *dict); +static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m, + PyObject *dict); +static int __pyx_CyFunction_init(void); + +/* GetModuleGlobalName.proto */ +#if CYTHON_USE_DICT_VERSIONS +#define __Pyx_GetModuleGlobalName(var, name) {\ + static PY_UINT64_T __pyx_dict_version = 0;\ + static PyObject *__pyx_dict_cached_value = NULL;\ + (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\ + (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\ + __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ +} +#define __Pyx_GetModuleGlobalNameUncached(var, name) {\ + PY_UINT64_T __pyx_dict_version;\ + PyObject *__pyx_dict_cached_value;\ + (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ +} +static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value); +#else +#define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name) +#define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name) +static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name); +#endif + +/* GetAttr.proto */ +static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *); + +/* Globals.proto */ +static PyObject* __Pyx_Globals(void); + +/* CLineInTraceback.proto */ +#ifdef CYTHON_CLINE_IN_TRACEBACK +#define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) +#else +static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line); +#endif + +/* CodeObjectCache.proto */ +typedef struct { + PyCodeObject* code_object; + int code_line; +} __Pyx_CodeObjectCacheEntry; +struct __Pyx_CodeObjectCache { + int count; + int max_count; + __Pyx_CodeObjectCacheEntry* entries; +}; +static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); +static PyCodeObject *__pyx_find_code_object(int code_line); +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); + +/* AddTraceback.proto */ +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename); + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); + +/* CIntFromPy.proto */ +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); + +/* CIntFromPy.proto */ +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); + +/* FastTypeChecks.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) +static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b); +static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type); +static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2); +#else +#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) +#define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) +#define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) +#endif +#define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) + +/* CheckBinaryVersion.proto */ +static int __Pyx_check_binary_version(void); + +/* PyObjectSetAttrStr.proto */ +#if CYTHON_USE_TYPE_SLOTS +#define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o, n, NULL) +static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value); +#else +#define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n) +#define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v) +#endif + +/* VoidPtrExport.proto */ +static int __Pyx_ExportVoidPtr(PyObject *name, void *p, const char *sig); + +/* VoidPtrImport.proto */ +static int __Pyx_ImportVoidPtr(PyObject *module, const char *name, void **p, const char *sig); + +/* FunctionImport.proto */ +static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig); + +/* InitStrings.proto */ +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); + +static PyObject *__pyx_f_6gevent_8__waiter_6Waiter_clear(struct __pyx_obj_6gevent_8__waiter_Waiter *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/ +static PyObject *__pyx_f_6gevent_8__waiter_6Waiter_get(struct __pyx_obj_6gevent_8__waiter_Waiter *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/ +static PyObject *__pyx_f_6gevent_8__waiter_14MultipleWaiter_get(struct __pyx_obj_6gevent_8__waiter_MultipleWaiter *__pyx_v_self, CYTHON_UNUSED int __pyx_skip_dispatch); /* proto*/ + +/* Module declarations from 'cython' */ + +/* Module declarations from 'greenlet' */ + +/* Module declarations from 'gevent.__greenlet_primitives' */ +static PyTypeObject *__pyx_ptype_6gevent_21__greenlet_primitives_greenlet = 0; +static PyTypeObject *__pyx_ptype_6gevent_21__greenlet_primitives_TrackedRawGreenlet = 0; +static PyTypeObject *__pyx_ptype_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop = 0; +static PyObject **__pyx_vp_6gevent_21__greenlet_primitives_get_objects = 0; +#define __pyx_v_6gevent_21__greenlet_primitives_get_objects (*__pyx_vp_6gevent_21__greenlet_primitives_get_objects) +static PyObject **__pyx_vp_6gevent_21__greenlet_primitives_wref = 0; +#define __pyx_v_6gevent_21__greenlet_primitives_wref (*__pyx_vp_6gevent_21__greenlet_primitives_wref) +static PyObject **__pyx_vp_6gevent_21__greenlet_primitives_BlockingSwitchOutError = 0; +#define __pyx_v_6gevent_21__greenlet_primitives_BlockingSwitchOutError (*__pyx_vp_6gevent_21__greenlet_primitives_BlockingSwitchOutError) +static int *__pyx_vp_6gevent_21__greenlet_primitives__greenlet_imported = 0; +#define __pyx_v_6gevent_21__greenlet_primitives__greenlet_imported (*__pyx_vp_6gevent_21__greenlet_primitives__greenlet_imported) + +/* Module declarations from 'gevent.__hub_local' */ +static PyObject **__pyx_vp_6gevent_11__hub_local__threadlocal = 0; +#define __pyx_v_6gevent_11__hub_local__threadlocal (*__pyx_vp_6gevent_11__hub_local__threadlocal) +static struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *(*__pyx_f_6gevent_11__hub_local_get_hub_noargs)(int __pyx_skip_dispatch); /*proto*/ + +/* Module declarations from 'gevent.__waiter' */ +static PyTypeObject *__pyx_ptype_6gevent_8__waiter_greenlet = 0; +static PyTypeObject *__pyx_ptype_6gevent_8__waiter_Waiter = 0; +static PyTypeObject *__pyx_ptype_6gevent_8__waiter_MultipleWaiter = 0; +static PyObject *__pyx_v_6gevent_8__waiter_sys = 0; +static PyObject *__pyx_v_6gevent_8__waiter_ConcurrentObjectUseError = 0; +static int __pyx_v_6gevent_8__waiter__greenlet_imported; +static PyObject *__pyx_v_6gevent_8__waiter__NONE = 0; +static CYTHON_INLINE PyGreenlet *__pyx_f_6gevent_8__waiter_getcurrent(void); /*proto*/ +static CYTHON_INLINE void __pyx_f_6gevent_8__waiter_greenlet_init(void); /*proto*/ +#define __Pyx_MODULE_NAME "gevent.__waiter" +extern int __pyx_module_is_main_gevent____waiter; +int __pyx_module_is_main_gevent____waiter = 0; + +/* Implementation of 'gevent.__waiter' */ +static PyObject *__pyx_builtin_object; +static PyObject *__pyx_builtin___import__; +static PyObject *__pyx_builtin_AssertionError; +static const char __pyx_k_all[] = "__all__"; +static const char __pyx_k_get[] = "get"; +static const char __pyx_k_hub[] = "hub"; +static const char __pyx_k_pop[] = "pop"; +static const char __pyx_k_sys[] = "sys"; +static const char __pyx_k_NONE[] = "_NONE"; +static const char __pyx_k_args[] = "args"; +static const char __pyx_k_init[] = "__init__"; +static const char __pyx_k_main[] = "__main__"; +static const char __pyx_k_name[] = "__name__"; +static const char __pyx_k_self[] = "self"; +static const char __pyx_k_test[] = "__test__"; +static const char __pyx_k_clear[] = "clear"; +static const char __pyx_k_ready[] = "ready"; +static const char __pyx_k_slots[] = "__slots__"; +static const char __pyx_k_throw[] = "throw"; +static const char __pyx_k_value[] = "value"; +static const char __pyx_k_Waiter[] = "Waiter"; +static const char __pyx_k_import[] = "__import__"; +static const char __pyx_k_init_2[] = "_init"; +static const char __pyx_k_lambda[] = ""; +static const char __pyx_k_object[] = "object"; +static const char __pyx_k_source[] = "source"; +static const char __pyx_k_switch[] = "switch"; +static const char __pyx_k_values[] = "_values"; +static const char __pyx_k_exc_info[] = "exc_info"; +static const char __pyx_k_greenlet[] = "greenlet"; +static const char __pyx_k_pyx_capi[] = "__pyx_capi__"; +static const char __pyx_k_exception[] = "exception"; +static const char __pyx_k_Waiter_get[] = "Waiter.get"; +static const char __pyx_k_getcurrent[] = "getcurrent"; +static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__"; +static const char __pyx_k_successful[] = "successful"; +static const char __pyx_k_throw_args[] = "throw_args"; +static const char __pyx_k_exception_2[] = "_exception"; +static const char __pyx_k_switch_args[] = "switch_args"; +static const char __pyx_k_Waiter_clear[] = "Waiter.clear"; +static const char __pyx_k_Waiter_ready[] = "Waiter.ready"; +static const char __pyx_k_Waiter_throw[] = "Waiter.throw"; +static const char __pyx_k_gevent__util[] = "gevent._util"; +static const char __pyx_k_handle_error[] = "handle_error"; +static const char __pyx_k_s_greenlet_s[] = "<%s greenlet=%s>"; +static const char __pyx_k_Waiter_switch[] = "Waiter.switch"; +static const char __pyx_k_greenlet_init[] = "greenlet_init"; +static const char __pyx_k_AssertionError[] = "AssertionError"; +static const char __pyx_k_MultipleWaiter[] = "MultipleWaiter"; +static const char __pyx_k_get_hub_noargs[] = "get_hub_noargs"; +static const char __pyx_k_import_c_accel[] = "import_c_accel"; +static const char __pyx_k_gevent___waiter[] = "gevent.__waiter"; +static const char __pyx_k_Waiter_successful[] = "Waiter.successful"; +static const char __pyx_k_gevent__hub_local[] = "gevent._hub_local"; +static const char __pyx_k_gevent_exceptions[] = "gevent.exceptions"; +static const char __pyx_k_greenlet_imported[] = "_greenlet_imported"; +static const char __pyx_k_MultipleWaiter_get[] = "MultipleWaiter.get"; +static const char __pyx_k_Waiter_switch_args[] = "Waiter.switch_args"; +static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; +static const char __pyx_k_s_greenlet_s_value_r[] = "<%s greenlet=%s value=%r>"; +static const char __pyx_k_MultipleWaiter_switch[] = "MultipleWaiter.switch"; +static const char __pyx_k_src_gevent__waiter_py[] = "src\\gevent\\_waiter.py"; +static const char __pyx_k_s_greenlet_s_exc_info_r[] = "<%s greenlet=%s exc_info=%r>"; +static const char __pyx_k_ConcurrentObjectUseError[] = "ConcurrentObjectUseError"; +static const char __pyx_k_Low_level_waiting_primitives[] = "\nLow-level waiting primitives.\n\n"; +static const char __pyx_k_Can_only_use_Waiter_switch_metho[] = "Can only use Waiter.switch method from the Hub greenlet"; +static const char __pyx_k_This_Waiter_is_already_used_by_r[] = "This Waiter is already used by %r"; +static PyObject *__pyx_n_s_AssertionError; +static PyObject *__pyx_kp_s_Can_only_use_Waiter_switch_metho; +static PyObject *__pyx_n_s_ConcurrentObjectUseError; +static PyObject *__pyx_n_s_MultipleWaiter; +static PyObject *__pyx_n_s_MultipleWaiter_get; +static PyObject *__pyx_n_s_MultipleWaiter_switch; +static PyObject *__pyx_n_s_NONE; +static PyObject *__pyx_kp_s_This_Waiter_is_already_used_by_r; +static PyObject *__pyx_n_s_Waiter; +static PyObject *__pyx_n_s_Waiter_clear; +static PyObject *__pyx_n_s_Waiter_get; +static PyObject *__pyx_n_s_Waiter_ready; +static PyObject *__pyx_n_s_Waiter_successful; +static PyObject *__pyx_n_s_Waiter_switch; +static PyObject *__pyx_n_s_Waiter_switch_args; +static PyObject *__pyx_n_s_Waiter_throw; +static PyObject *__pyx_n_s_all; +static PyObject *__pyx_n_s_args; +static PyObject *__pyx_n_s_clear; +static PyObject *__pyx_n_s_cline_in_traceback; +static PyObject *__pyx_n_s_exc_info; +static PyObject *__pyx_n_s_exception; +static PyObject *__pyx_n_s_exception_2; +static PyObject *__pyx_n_s_get; +static PyObject *__pyx_n_s_get_hub_noargs; +static PyObject *__pyx_n_s_getcurrent; +static PyObject *__pyx_n_s_gevent___waiter; +static PyObject *__pyx_n_s_gevent__hub_local; +static PyObject *__pyx_n_s_gevent__util; +static PyObject *__pyx_n_s_gevent_exceptions; +static PyObject *__pyx_n_s_greenlet; +static PyObject *__pyx_n_s_greenlet_imported; +static PyObject *__pyx_n_s_greenlet_init; +static PyObject *__pyx_n_s_handle_error; +static PyObject *__pyx_n_s_hub; +static PyObject *__pyx_n_s_import; +static PyObject *__pyx_n_s_import_c_accel; +static PyObject *__pyx_n_s_init; +static PyObject *__pyx_n_s_init_2; +static PyObject *__pyx_n_s_lambda; +static PyObject *__pyx_n_s_main; +static PyObject *__pyx_n_s_name; +static PyObject *__pyx_n_s_object; +static PyObject *__pyx_n_s_pop; +static PyObject *__pyx_n_s_pyx_capi; +static PyObject *__pyx_n_s_pyx_vtable; +static PyObject *__pyx_n_s_ready; +static PyObject *__pyx_kp_s_s_greenlet_s; +static PyObject *__pyx_kp_s_s_greenlet_s_exc_info_r; +static PyObject *__pyx_kp_s_s_greenlet_s_value_r; +static PyObject *__pyx_n_s_self; +static PyObject *__pyx_n_s_slots; +static PyObject *__pyx_n_s_source; +static PyObject *__pyx_kp_s_src_gevent__waiter_py; +static PyObject *__pyx_n_s_successful; +static PyObject *__pyx_n_s_switch; +static PyObject *__pyx_n_s_switch_args; +static PyObject *__pyx_n_s_sys; +static PyObject *__pyx_n_s_test; +static PyObject *__pyx_n_s_throw; +static PyObject *__pyx_n_s_throw_args; +static PyObject *__pyx_n_s_value; +static PyObject *__pyx_n_s_values; +static PyObject *__pyx_lambda_funcdef_6gevent_8__waiter_lambda(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static int __pyx_pf_6gevent_8__waiter_6Waiter___init__(struct __pyx_obj_6gevent_8__waiter_Waiter *__pyx_v_self, PyObject *__pyx_v_hub); /* proto */ +static PyObject *__pyx_pf_6gevent_8__waiter_6Waiter_2clear(struct __pyx_obj_6gevent_8__waiter_Waiter *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_8__waiter_6Waiter_4__str__(struct __pyx_obj_6gevent_8__waiter_Waiter *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_8__waiter_6Waiter_6ready(struct __pyx_obj_6gevent_8__waiter_Waiter *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_8__waiter_6Waiter_8successful(struct __pyx_obj_6gevent_8__waiter_Waiter *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_8__waiter_6Waiter_8exc_info___get__(struct __pyx_obj_6gevent_8__waiter_Waiter *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_8__waiter_6Waiter_10switch(struct __pyx_obj_6gevent_8__waiter_Waiter *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_6gevent_8__waiter_6Waiter_12switch_args(struct __pyx_obj_6gevent_8__waiter_Waiter *__pyx_v_self, PyObject *__pyx_v_args); /* proto */ +static PyObject *__pyx_pf_6gevent_8__waiter_6Waiter_14throw(struct __pyx_obj_6gevent_8__waiter_Waiter *__pyx_v_self, PyObject *__pyx_v_throw_args); /* proto */ +static PyObject *__pyx_pf_6gevent_8__waiter_6Waiter_16get(struct __pyx_obj_6gevent_8__waiter_Waiter *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_8__waiter_6Waiter_18__call__(struct __pyx_obj_6gevent_8__waiter_Waiter *__pyx_v_self, PyObject *__pyx_v_source); /* proto */ +static PyObject *__pyx_pf_6gevent_8__waiter_6Waiter_3hub___get__(struct __pyx_obj_6gevent_8__waiter_Waiter *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_8__waiter_6Waiter_8greenlet___get__(struct __pyx_obj_6gevent_8__waiter_Waiter *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_8__waiter_6Waiter_5value___get__(struct __pyx_obj_6gevent_8__waiter_Waiter *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_8__waiter_14MultipleWaiter___init__(struct __pyx_obj_6gevent_8__waiter_MultipleWaiter *__pyx_v_self, PyObject *__pyx_v_hub); /* proto */ +static PyObject *__pyx_pf_6gevent_8__waiter_14MultipleWaiter_2switch(struct __pyx_obj_6gevent_8__waiter_MultipleWaiter *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_6gevent_8__waiter_14MultipleWaiter_4get(struct __pyx_obj_6gevent_8__waiter_MultipleWaiter *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_8__waiter__init(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_tp_new_6gevent_8__waiter_Waiter(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6gevent_8__waiter_MultipleWaiter(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_int_0; +static PyObject *__pyx_tuple_; +static PyObject *__pyx_tuple__2; +static PyObject *__pyx_tuple__3; +static PyObject *__pyx_tuple__5; +static PyObject *__pyx_tuple__7; +static PyObject *__pyx_tuple__9; +static PyObject *__pyx_tuple__11; +static PyObject *__pyx_tuple__13; +static PyObject *__pyx_tuple__15; +static PyObject *__pyx_tuple__17; +static PyObject *__pyx_tuple__19; +static PyObject *__pyx_codeobj__4; +static PyObject *__pyx_codeobj__6; +static PyObject *__pyx_codeobj__8; +static PyObject *__pyx_codeobj__10; +static PyObject *__pyx_codeobj__12; +static PyObject *__pyx_codeobj__14; +static PyObject *__pyx_codeobj__16; +static PyObject *__pyx_codeobj__18; +static PyObject *__pyx_codeobj__20; +static PyObject *__pyx_codeobj__21; +/* Late includes */ + +/* "src/gevent/_waiter.py":24 + * + * locals()['getcurrent'] = __import__('greenlet').getcurrent + * locals()['greenlet_init'] = lambda: None # <<<<<<<<<<<<<< + * + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_8__waiter_2lambda(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyMethodDef __pyx_mdef_6gevent_8__waiter_2lambda = {"lambda", (PyCFunction)__pyx_pw_6gevent_8__waiter_2lambda, METH_NOARGS, 0}; +static PyObject *__pyx_pw_6gevent_8__waiter_2lambda(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("lambda (wrapper)", 0); + __pyx_r = __pyx_lambda_funcdef_6gevent_8__waiter_lambda(__pyx_self); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_lambda_funcdef_6gevent_8__waiter_lambda(CYTHON_UNUSED PyObject *__pyx_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("lambda", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_waiter.py":70 + * __slots__ = ['hub', 'greenlet', 'value', '_exception'] + * + * def __init__(self, hub=None): # <<<<<<<<<<<<<< + * self.hub = get_hub() if hub is None else hub + * self.greenlet = None + */ + +/* Python wrapper */ +static int __pyx_pw_6gevent_8__waiter_6Waiter_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6gevent_8__waiter_6Waiter_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_hub = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_hub,0}; + PyObject* values[1] = {0}; + values[0] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_hub); + if (value) { values[0] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 70, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_hub = values[0]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 70, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.__waiter.Waiter.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_8__waiter_6Waiter___init__(((struct __pyx_obj_6gevent_8__waiter_Waiter *)__pyx_v_self), __pyx_v_hub); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_8__waiter_6Waiter___init__(struct __pyx_obj_6gevent_8__waiter_Waiter *__pyx_v_self, PyObject *__pyx_v_hub) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "src/gevent/_waiter.py":71 + * + * def __init__(self, hub=None): + * self.hub = get_hub() if hub is None else hub # <<<<<<<<<<<<<< + * self.greenlet = None + * self.value = None + */ + __pyx_t_2 = (__pyx_v_hub == Py_None); + if ((__pyx_t_2 != 0)) { + __pyx_t_3 = ((PyObject *)__pyx_f_6gevent_11__hub_local_get_hub_noargs(0)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 71, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __pyx_t_3; + __pyx_t_3 = 0; + } else { + if (!(likely(((__pyx_v_hub) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_hub, __pyx_ptype_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop))))) __PYX_ERR(0, 71, __pyx_L1_error) + __Pyx_INCREF(__pyx_v_hub); + __pyx_t_1 = __pyx_v_hub; + } + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_self->hub); + __Pyx_DECREF(((PyObject *)__pyx_v_self->hub)); + __pyx_v_self->hub = ((struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "src/gevent/_waiter.py":72 + * def __init__(self, hub=None): + * self.hub = get_hub() if hub is None else hub + * self.greenlet = None # <<<<<<<<<<<<<< + * self.value = None + * self._exception = _NONE + */ + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->greenlet); + __Pyx_DECREF(((PyObject *)__pyx_v_self->greenlet)); + __pyx_v_self->greenlet = ((PyGreenlet *)Py_None); + + /* "src/gevent/_waiter.py":73 + * self.hub = get_hub() if hub is None else hub + * self.greenlet = None + * self.value = None # <<<<<<<<<<<<<< + * self._exception = _NONE + * + */ + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->value); + __Pyx_DECREF(__pyx_v_self->value); + __pyx_v_self->value = Py_None; + + /* "src/gevent/_waiter.py":74 + * self.greenlet = None + * self.value = None + * self._exception = _NONE # <<<<<<<<<<<<<< + * + * def clear(self): + */ + __Pyx_INCREF(__pyx_v_6gevent_8__waiter__NONE); + __Pyx_GIVEREF(__pyx_v_6gevent_8__waiter__NONE); + __Pyx_GOTREF(__pyx_v_self->_exception); + __Pyx_DECREF(__pyx_v_self->_exception); + __pyx_v_self->_exception = __pyx_v_6gevent_8__waiter__NONE; + + /* "src/gevent/_waiter.py":70 + * __slots__ = ['hub', 'greenlet', 'value', '_exception'] + * + * def __init__(self, hub=None): # <<<<<<<<<<<<<< + * self.hub = get_hub() if hub is None else hub + * self.greenlet = None + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("gevent.__waiter.Waiter.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_waiter.py":76 + * self._exception = _NONE + * + * def clear(self): # <<<<<<<<<<<<<< + * self.greenlet = None + * self.value = None + */ + +static PyObject *__pyx_pw_6gevent_8__waiter_6Waiter_3clear(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_f_6gevent_8__waiter_6Waiter_clear(struct __pyx_obj_6gevent_8__waiter_Waiter *__pyx_v_self, int __pyx_skip_dispatch) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + __Pyx_RefNannySetupContext("clear", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0; + if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self)))))); + else { + PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + #endif + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_clear); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 76, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_8__waiter_6Waiter_3clear)) { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 76, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0; + if (unlikely(type_dict_guard != tp_dict_version)) { + tp_dict_version = obj_dict_version = 0; + } + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + } + #endif + } + + /* "src/gevent/_waiter.py":77 + * + * def clear(self): + * self.greenlet = None # <<<<<<<<<<<<<< + * self.value = None + * self._exception = _NONE + */ + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->greenlet); + __Pyx_DECREF(((PyObject *)__pyx_v_self->greenlet)); + __pyx_v_self->greenlet = ((PyGreenlet *)Py_None); + + /* "src/gevent/_waiter.py":78 + * def clear(self): + * self.greenlet = None + * self.value = None # <<<<<<<<<<<<<< + * self._exception = _NONE + * + */ + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->value); + __Pyx_DECREF(__pyx_v_self->value); + __pyx_v_self->value = Py_None; + + /* "src/gevent/_waiter.py":79 + * self.greenlet = None + * self.value = None + * self._exception = _NONE # <<<<<<<<<<<<<< + * + * def __str__(self): + */ + __Pyx_INCREF(__pyx_v_6gevent_8__waiter__NONE); + __Pyx_GIVEREF(__pyx_v_6gevent_8__waiter__NONE); + __Pyx_GOTREF(__pyx_v_self->_exception); + __Pyx_DECREF(__pyx_v_self->_exception); + __pyx_v_self->_exception = __pyx_v_6gevent_8__waiter__NONE; + + /* "src/gevent/_waiter.py":76 + * self._exception = _NONE + * + * def clear(self): # <<<<<<<<<<<<<< + * self.greenlet = None + * self.value = None + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("gevent.__waiter.Waiter.clear", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_8__waiter_6Waiter_3clear(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6gevent_8__waiter_6Waiter_2clear[] = "Waiter.clear(self)"; +static PyMethodDef __pyx_mdef_6gevent_8__waiter_6Waiter_3clear = {"clear", (PyCFunction)__pyx_pw_6gevent_8__waiter_6Waiter_3clear, METH_NOARGS, __pyx_doc_6gevent_8__waiter_6Waiter_2clear}; +static PyObject *__pyx_pw_6gevent_8__waiter_6Waiter_3clear(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("clear (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_8__waiter_6Waiter_2clear(((struct __pyx_obj_6gevent_8__waiter_Waiter *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_8__waiter_6Waiter_2clear(struct __pyx_obj_6gevent_8__waiter_Waiter *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("clear", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6gevent_8__waiter_6Waiter_clear(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 76, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__waiter.Waiter.clear", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_waiter.py":81 + * self._exception = _NONE + * + * def __str__(self): # <<<<<<<<<<<<<< + * if self._exception is _NONE: + * return '<%s greenlet=%s>' % (type(self).__name__, self.greenlet) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_8__waiter_6Waiter_5__str__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_8__waiter_6Waiter_5__str__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__str__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_8__waiter_6Waiter_4__str__(((struct __pyx_obj_6gevent_8__waiter_Waiter *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_8__waiter_6Waiter_4__str__(struct __pyx_obj_6gevent_8__waiter_Waiter *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + __Pyx_RefNannySetupContext("__str__", 0); + + /* "src/gevent/_waiter.py":82 + * + * def __str__(self): + * if self._exception is _NONE: # <<<<<<<<<<<<<< + * return '<%s greenlet=%s>' % (type(self).__name__, self.greenlet) + * if self._exception is None: + */ + __pyx_t_1 = (__pyx_v_self->_exception == __pyx_v_6gevent_8__waiter__NONE); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "src/gevent/_waiter.py":83 + * def __str__(self): + * if self._exception is _NONE: + * return '<%s greenlet=%s>' % (type(self).__name__, self.greenlet) # <<<<<<<<<<<<<< + * if self._exception is None: + * return '<%s greenlet=%s value=%r>' % (type(self).__name__, self.greenlet, self.value) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))), __pyx_n_s_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 83, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 83, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); + __Pyx_INCREF(((PyObject *)__pyx_v_self->greenlet)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self->greenlet)); + PyTuple_SET_ITEM(__pyx_t_4, 1, ((PyObject *)__pyx_v_self->greenlet)); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_s_greenlet_s, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 83, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "src/gevent/_waiter.py":82 + * + * def __str__(self): + * if self._exception is _NONE: # <<<<<<<<<<<<<< + * return '<%s greenlet=%s>' % (type(self).__name__, self.greenlet) + * if self._exception is None: + */ + } + + /* "src/gevent/_waiter.py":84 + * if self._exception is _NONE: + * return '<%s greenlet=%s>' % (type(self).__name__, self.greenlet) + * if self._exception is None: # <<<<<<<<<<<<<< + * return '<%s greenlet=%s value=%r>' % (type(self).__name__, self.greenlet, self.value) + * return '<%s greenlet=%s exc_info=%r>' % (type(self).__name__, self.greenlet, self.exc_info) + */ + __pyx_t_2 = (__pyx_v_self->_exception == Py_None); + __pyx_t_1 = (__pyx_t_2 != 0); + if (__pyx_t_1) { + + /* "src/gevent/_waiter.py":85 + * return '<%s greenlet=%s>' % (type(self).__name__, self.greenlet) + * if self._exception is None: + * return '<%s greenlet=%s value=%r>' % (type(self).__name__, self.greenlet, self.value) # <<<<<<<<<<<<<< + * return '<%s greenlet=%s exc_info=%r>' % (type(self).__name__, self.greenlet, self.exc_info) + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))), __pyx_n_s_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 85, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 85, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); + __Pyx_INCREF(((PyObject *)__pyx_v_self->greenlet)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self->greenlet)); + PyTuple_SET_ITEM(__pyx_t_4, 1, ((PyObject *)__pyx_v_self->greenlet)); + __Pyx_INCREF(__pyx_v_self->value); + __Pyx_GIVEREF(__pyx_v_self->value); + PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_self->value); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_s_greenlet_s_value_r, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 85, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "src/gevent/_waiter.py":84 + * if self._exception is _NONE: + * return '<%s greenlet=%s>' % (type(self).__name__, self.greenlet) + * if self._exception is None: # <<<<<<<<<<<<<< + * return '<%s greenlet=%s value=%r>' % (type(self).__name__, self.greenlet, self.value) + * return '<%s greenlet=%s exc_info=%r>' % (type(self).__name__, self.greenlet, self.exc_info) + */ + } + + /* "src/gevent/_waiter.py":86 + * if self._exception is None: + * return '<%s greenlet=%s value=%r>' % (type(self).__name__, self.greenlet, self.value) + * return '<%s greenlet=%s exc_info=%r>' % (type(self).__name__, self.greenlet, self.exc_info) # <<<<<<<<<<<<<< + * + * def ready(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))), __pyx_n_s_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 86, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_exc_info); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 86, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 86, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); + __Pyx_INCREF(((PyObject *)__pyx_v_self->greenlet)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self->greenlet)); + PyTuple_SET_ITEM(__pyx_t_5, 1, ((PyObject *)__pyx_v_self->greenlet)); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_4); + __pyx_t_3 = 0; + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_s_greenlet_s_exc_info_r, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 86, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + + /* "src/gevent/_waiter.py":81 + * self._exception = _NONE + * + * def __str__(self): # <<<<<<<<<<<<<< + * if self._exception is _NONE: + * return '<%s greenlet=%s>' % (type(self).__name__, self.greenlet) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("gevent.__waiter.Waiter.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_waiter.py":88 + * return '<%s greenlet=%s exc_info=%r>' % (type(self).__name__, self.greenlet, self.exc_info) + * + * def ready(self): # <<<<<<<<<<<<<< + * """Return true if and only if it holds a value or an exception""" + * return self._exception is not _NONE + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_8__waiter_6Waiter_7ready(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6gevent_8__waiter_6Waiter_6ready[] = "Waiter.ready(self)\nReturn true if and only if it holds a value or an exception"; +static PyMethodDef __pyx_mdef_6gevent_8__waiter_6Waiter_7ready = {"ready", (PyCFunction)__pyx_pw_6gevent_8__waiter_6Waiter_7ready, METH_NOARGS, __pyx_doc_6gevent_8__waiter_6Waiter_6ready}; +static PyObject *__pyx_pw_6gevent_8__waiter_6Waiter_7ready(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("ready (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_8__waiter_6Waiter_6ready(((struct __pyx_obj_6gevent_8__waiter_Waiter *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_8__waiter_6Waiter_6ready(struct __pyx_obj_6gevent_8__waiter_Waiter *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("ready", 0); + + /* "src/gevent/_waiter.py":90 + * def ready(self): + * """Return true if and only if it holds a value or an exception""" + * return self._exception is not _NONE # <<<<<<<<<<<<<< + * + * def successful(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = (__pyx_v_self->_exception != __pyx_v_6gevent_8__waiter__NONE); + __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 90, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "src/gevent/_waiter.py":88 + * return '<%s greenlet=%s exc_info=%r>' % (type(self).__name__, self.greenlet, self.exc_info) + * + * def ready(self): # <<<<<<<<<<<<<< + * """Return true if and only if it holds a value or an exception""" + * return self._exception is not _NONE + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent.__waiter.Waiter.ready", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_waiter.py":92 + * return self._exception is not _NONE + * + * def successful(self): # <<<<<<<<<<<<<< + * """Return true if and only if it is ready and holds a value""" + * return self._exception is None + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_8__waiter_6Waiter_9successful(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6gevent_8__waiter_6Waiter_8successful[] = "Waiter.successful(self)\nReturn true if and only if it is ready and holds a value"; +static PyMethodDef __pyx_mdef_6gevent_8__waiter_6Waiter_9successful = {"successful", (PyCFunction)__pyx_pw_6gevent_8__waiter_6Waiter_9successful, METH_NOARGS, __pyx_doc_6gevent_8__waiter_6Waiter_8successful}; +static PyObject *__pyx_pw_6gevent_8__waiter_6Waiter_9successful(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("successful (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_8__waiter_6Waiter_8successful(((struct __pyx_obj_6gevent_8__waiter_Waiter *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_8__waiter_6Waiter_8successful(struct __pyx_obj_6gevent_8__waiter_Waiter *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("successful", 0); + + /* "src/gevent/_waiter.py":94 + * def successful(self): + * """Return true if and only if it is ready and holds a value""" + * return self._exception is None # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = (__pyx_v_self->_exception == Py_None); + __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 94, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "src/gevent/_waiter.py":92 + * return self._exception is not _NONE + * + * def successful(self): # <<<<<<<<<<<<<< + * """Return true if and only if it is ready and holds a value""" + * return self._exception is None + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent.__waiter.Waiter.successful", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_waiter.py":97 + * + * @property + * def exc_info(self): # <<<<<<<<<<<<<< + * "Holds the exception info passed to :meth:`throw` if :meth:`throw` was called. Otherwise ``None``." + * if self._exception is not _NONE: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_8__waiter_6Waiter_8exc_info_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_8__waiter_6Waiter_8exc_info_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_8__waiter_6Waiter_8exc_info___get__(((struct __pyx_obj_6gevent_8__waiter_Waiter *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_8__waiter_6Waiter_8exc_info___get__(struct __pyx_obj_6gevent_8__waiter_Waiter *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "src/gevent/_waiter.py":99 + * def exc_info(self): + * "Holds the exception info passed to :meth:`throw` if :meth:`throw` was called. Otherwise ``None``." + * if self._exception is not _NONE: # <<<<<<<<<<<<<< + * return self._exception + * + */ + __pyx_t_1 = (__pyx_v_self->_exception != __pyx_v_6gevent_8__waiter__NONE); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "src/gevent/_waiter.py":100 + * "Holds the exception info passed to :meth:`throw` if :meth:`throw` was called. Otherwise ``None``." + * if self._exception is not _NONE: + * return self._exception # <<<<<<<<<<<<<< + * + * def switch(self, value): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->_exception); + __pyx_r = __pyx_v_self->_exception; + goto __pyx_L0; + + /* "src/gevent/_waiter.py":99 + * def exc_info(self): + * "Holds the exception info passed to :meth:`throw` if :meth:`throw` was called. Otherwise ``None``." + * if self._exception is not _NONE: # <<<<<<<<<<<<<< + * return self._exception + * + */ + } + + /* "src/gevent/_waiter.py":97 + * + * @property + * def exc_info(self): # <<<<<<<<<<<<<< + * "Holds the exception info passed to :meth:`throw` if :meth:`throw` was called. Otherwise ``None``." + * if self._exception is not _NONE: + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_waiter.py":102 + * return self._exception + * + * def switch(self, value): # <<<<<<<<<<<<<< + * """ + * Switch to the greenlet if one's available. Otherwise store the + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_8__waiter_6Waiter_11switch(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static char __pyx_doc_6gevent_8__waiter_6Waiter_10switch[] = "Waiter.switch(self, value)\n\n Switch to the greenlet if one's available. Otherwise store the\n *value*.\n\n .. versionchanged:: 1.3b1\n The *value* is no longer optional.\n "; +static PyMethodDef __pyx_mdef_6gevent_8__waiter_6Waiter_11switch = {"switch", (PyCFunction)__pyx_pw_6gevent_8__waiter_6Waiter_11switch, METH_O, __pyx_doc_6gevent_8__waiter_6Waiter_10switch}; +static PyObject *__pyx_pw_6gevent_8__waiter_6Waiter_11switch(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("switch (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_8__waiter_6Waiter_10switch(((struct __pyx_obj_6gevent_8__waiter_Waiter *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_8__waiter_6Waiter_10switch(struct __pyx_obj_6gevent_8__waiter_Waiter *__pyx_v_self, PyObject *__pyx_v_value) { + PyGreenlet *__pyx_v_greenlet = NULL; + PyObject *__pyx_v_switch = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + __Pyx_RefNannySetupContext("switch", 0); + + /* "src/gevent/_waiter.py":110 + * The *value* is no longer optional. + * """ + * greenlet = self.greenlet # <<<<<<<<<<<<<< + * if greenlet is None: + * self.value = value + */ + __pyx_t_1 = ((PyObject *)__pyx_v_self->greenlet); + __Pyx_INCREF(__pyx_t_1); + __pyx_v_greenlet = ((PyGreenlet *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "src/gevent/_waiter.py":111 + * """ + * greenlet = self.greenlet + * if greenlet is None: # <<<<<<<<<<<<<< + * self.value = value + * self._exception = None + */ + __pyx_t_2 = (((PyObject *)__pyx_v_greenlet) == Py_None); + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "src/gevent/_waiter.py":112 + * greenlet = self.greenlet + * if greenlet is None: + * self.value = value # <<<<<<<<<<<<<< + * self._exception = None + * else: + */ + __Pyx_INCREF(__pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + __Pyx_GOTREF(__pyx_v_self->value); + __Pyx_DECREF(__pyx_v_self->value); + __pyx_v_self->value = __pyx_v_value; + + /* "src/gevent/_waiter.py":113 + * if greenlet is None: + * self.value = value + * self._exception = None # <<<<<<<<<<<<<< + * else: + * if getcurrent() is not self.hub: # pylint:disable=undefined-variable + */ + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->_exception); + __Pyx_DECREF(__pyx_v_self->_exception); + __pyx_v_self->_exception = Py_None; + + /* "src/gevent/_waiter.py":111 + * """ + * greenlet = self.greenlet + * if greenlet is None: # <<<<<<<<<<<<<< + * self.value = value + * self._exception = None + */ + goto __pyx_L3; + } + + /* "src/gevent/_waiter.py":115 + * self._exception = None + * else: + * if getcurrent() is not self.hub: # pylint:disable=undefined-variable # <<<<<<<<<<<<<< + * raise AssertionError("Can only use Waiter.switch method from the Hub greenlet") + * switch = greenlet.switch + */ + /*else*/ { + __pyx_t_1 = ((PyObject *)__pyx_f_6gevent_8__waiter_getcurrent()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 115, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = (__pyx_t_1 != ((PyObject *)__pyx_v_self->hub)); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_2 = (__pyx_t_3 != 0); + if (unlikely(__pyx_t_2)) { + + /* "src/gevent/_waiter.py":116 + * else: + * if getcurrent() is not self.hub: # pylint:disable=undefined-variable + * raise AssertionError("Can only use Waiter.switch method from the Hub greenlet") # <<<<<<<<<<<<<< + * switch = greenlet.switch + * try: + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_AssertionError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 116, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 116, __pyx_L1_error) + + /* "src/gevent/_waiter.py":115 + * self._exception = None + * else: + * if getcurrent() is not self.hub: # pylint:disable=undefined-variable # <<<<<<<<<<<<<< + * raise AssertionError("Can only use Waiter.switch method from the Hub greenlet") + * switch = greenlet.switch + */ + } + + /* "src/gevent/_waiter.py":117 + * if getcurrent() is not self.hub: # pylint:disable=undefined-variable + * raise AssertionError("Can only use Waiter.switch method from the Hub greenlet") + * switch = greenlet.switch # <<<<<<<<<<<<<< + * try: + * switch(value) + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_greenlet), __pyx_n_s_switch); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 117, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_switch = __pyx_t_1; + __pyx_t_1 = 0; + + /* "src/gevent/_waiter.py":118 + * raise AssertionError("Can only use Waiter.switch method from the Hub greenlet") + * switch = greenlet.switch + * try: # <<<<<<<<<<<<<< + * switch(value) + * except: # pylint:disable=bare-except + */ + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6); + __Pyx_XGOTREF(__pyx_t_4); + __Pyx_XGOTREF(__pyx_t_5); + __Pyx_XGOTREF(__pyx_t_6); + /*try:*/ { + + /* "src/gevent/_waiter.py":119 + * switch = greenlet.switch + * try: + * switch(value) # <<<<<<<<<<<<<< + * except: # pylint:disable=bare-except + * self.hub.handle_error(switch, *sys.exc_info()) + */ + __Pyx_INCREF(__pyx_v_switch); + __pyx_t_7 = __pyx_v_switch; __pyx_t_8 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) { + __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); + if (likely(__pyx_t_8)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); + __Pyx_INCREF(__pyx_t_8); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_7, function); + } + } + __pyx_t_1 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_8, __pyx_v_value) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_value); + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 119, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_waiter.py":118 + * raise AssertionError("Can only use Waiter.switch method from the Hub greenlet") + * switch = greenlet.switch + * try: # <<<<<<<<<<<<<< + * switch(value) + * except: # pylint:disable=bare-except + */ + } + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L10_try_end; + __pyx_L5_error:; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_waiter.py":120 + * try: + * switch(value) + * except: # pylint:disable=bare-except # <<<<<<<<<<<<<< + * self.hub.handle_error(switch, *sys.exc_info()) + * + */ + /*except:*/ { + __Pyx_AddTraceback("gevent.__waiter.Waiter.switch", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(0, 120, __pyx_L7_except_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GOTREF(__pyx_t_8); + + /* "src/gevent/_waiter.py":121 + * switch(value) + * except: # pylint:disable=bare-except + * self.hub.handle_error(switch, *sys.exc_info()) # <<<<<<<<<<<<<< + * + * def switch_args(self, *args): + */ + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->hub), __pyx_n_s_handle_error); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 121, __pyx_L7_except_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 121, __pyx_L7_except_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_INCREF(__pyx_v_switch); + __Pyx_GIVEREF(__pyx_v_switch); + PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v_switch); + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_6gevent_8__waiter_sys, __pyx_n_s_exc_info); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 121, __pyx_L7_except_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_13 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) { + __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_12); + if (likely(__pyx_t_13)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12); + __Pyx_INCREF(__pyx_t_13); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_12, function); + } + } + __pyx_t_11 = (__pyx_t_13) ? __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_13) : __Pyx_PyObject_CallNoArg(__pyx_t_12); + __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; + if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 121, __pyx_L7_except_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_12 = __Pyx_PySequence_Tuple(__pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 121, __pyx_L7_except_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_11 = PyNumber_Add(__pyx_t_10, __pyx_t_12); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 121, __pyx_L7_except_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_11, NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 121, __pyx_L7_except_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + goto __pyx_L6_exception_handled; + } + __pyx_L7_except_error:; + + /* "src/gevent/_waiter.py":118 + * raise AssertionError("Can only use Waiter.switch method from the Hub greenlet") + * switch = greenlet.switch + * try: # <<<<<<<<<<<<<< + * switch(value) + * except: # pylint:disable=bare-except + */ + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6); + goto __pyx_L1_error; + __pyx_L6_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6); + __pyx_L10_try_end:; + } + } + __pyx_L3:; + + /* "src/gevent/_waiter.py":102 + * return self._exception + * + * def switch(self, value): # <<<<<<<<<<<<<< + * """ + * Switch to the greenlet if one's available. Otherwise store the + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_XDECREF(__pyx_t_13); + __Pyx_AddTraceback("gevent.__waiter.Waiter.switch", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_greenlet); + __Pyx_XDECREF(__pyx_v_switch); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_waiter.py":123 + * self.hub.handle_error(switch, *sys.exc_info()) + * + * def switch_args(self, *args): # <<<<<<<<<<<<<< + * return self.switch(args) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_8__waiter_6Waiter_13switch_args(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6gevent_8__waiter_6Waiter_12switch_args[] = "Waiter.switch_args(self, *args)"; +static PyMethodDef __pyx_mdef_6gevent_8__waiter_6Waiter_13switch_args = {"switch_args", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_8__waiter_6Waiter_13switch_args, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_8__waiter_6Waiter_12switch_args}; +static PyObject *__pyx_pw_6gevent_8__waiter_6Waiter_13switch_args(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_args = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("switch_args (wrapper)", 0); + if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "switch_args", 0))) return NULL; + __Pyx_INCREF(__pyx_args); + __pyx_v_args = __pyx_args; + __pyx_r = __pyx_pf_6gevent_8__waiter_6Waiter_12switch_args(((struct __pyx_obj_6gevent_8__waiter_Waiter *)__pyx_v_self), __pyx_v_args); + + /* function exit code */ + __Pyx_XDECREF(__pyx_v_args); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_8__waiter_6Waiter_12switch_args(struct __pyx_obj_6gevent_8__waiter_Waiter *__pyx_v_self, PyObject *__pyx_v_args) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("switch_args", 0); + + /* "src/gevent/_waiter.py":124 + * + * def switch_args(self, *args): + * return self.switch(args) # <<<<<<<<<<<<<< + * + * def throw(self, *throw_args): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_switch); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 124, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_args) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_args); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 124, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "src/gevent/_waiter.py":123 + * self.hub.handle_error(switch, *sys.exc_info()) + * + * def switch_args(self, *args): # <<<<<<<<<<<<<< + * return self.switch(args) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("gevent.__waiter.Waiter.switch_args", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_waiter.py":126 + * return self.switch(args) + * + * def throw(self, *throw_args): # <<<<<<<<<<<<<< + * """Switch to the greenlet with the exception. If there's no greenlet, store the exception.""" + * greenlet = self.greenlet + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_8__waiter_6Waiter_15throw(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6gevent_8__waiter_6Waiter_14throw[] = "Waiter.throw(self, *throw_args)\nSwitch to the greenlet with the exception. If there's no greenlet, store the exception."; +static PyMethodDef __pyx_mdef_6gevent_8__waiter_6Waiter_15throw = {"throw", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_8__waiter_6Waiter_15throw, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_8__waiter_6Waiter_14throw}; +static PyObject *__pyx_pw_6gevent_8__waiter_6Waiter_15throw(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_throw_args = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("throw (wrapper)", 0); + if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "throw", 0))) return NULL; + __Pyx_INCREF(__pyx_args); + __pyx_v_throw_args = __pyx_args; + __pyx_r = __pyx_pf_6gevent_8__waiter_6Waiter_14throw(((struct __pyx_obj_6gevent_8__waiter_Waiter *)__pyx_v_self), __pyx_v_throw_args); + + /* function exit code */ + __Pyx_XDECREF(__pyx_v_throw_args); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_8__waiter_6Waiter_14throw(struct __pyx_obj_6gevent_8__waiter_Waiter *__pyx_v_self, PyObject *__pyx_v_throw_args) { + PyGreenlet *__pyx_v_greenlet = NULL; + PyObject *__pyx_v_throw = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + __Pyx_RefNannySetupContext("throw", 0); + + /* "src/gevent/_waiter.py":128 + * def throw(self, *throw_args): + * """Switch to the greenlet with the exception. If there's no greenlet, store the exception.""" + * greenlet = self.greenlet # <<<<<<<<<<<<<< + * if greenlet is None: + * self._exception = throw_args + */ + __pyx_t_1 = ((PyObject *)__pyx_v_self->greenlet); + __Pyx_INCREF(__pyx_t_1); + __pyx_v_greenlet = ((PyGreenlet *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "src/gevent/_waiter.py":129 + * """Switch to the greenlet with the exception. If there's no greenlet, store the exception.""" + * greenlet = self.greenlet + * if greenlet is None: # <<<<<<<<<<<<<< + * self._exception = throw_args + * else: + */ + __pyx_t_2 = (((PyObject *)__pyx_v_greenlet) == Py_None); + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "src/gevent/_waiter.py":130 + * greenlet = self.greenlet + * if greenlet is None: + * self._exception = throw_args # <<<<<<<<<<<<<< + * else: + * if getcurrent() is not self.hub: # pylint:disable=undefined-variable + */ + __Pyx_INCREF(__pyx_v_throw_args); + __Pyx_GIVEREF(__pyx_v_throw_args); + __Pyx_GOTREF(__pyx_v_self->_exception); + __Pyx_DECREF(__pyx_v_self->_exception); + __pyx_v_self->_exception = __pyx_v_throw_args; + + /* "src/gevent/_waiter.py":129 + * """Switch to the greenlet with the exception. If there's no greenlet, store the exception.""" + * greenlet = self.greenlet + * if greenlet is None: # <<<<<<<<<<<<<< + * self._exception = throw_args + * else: + */ + goto __pyx_L3; + } + + /* "src/gevent/_waiter.py":132 + * self._exception = throw_args + * else: + * if getcurrent() is not self.hub: # pylint:disable=undefined-variable # <<<<<<<<<<<<<< + * raise AssertionError("Can only use Waiter.switch method from the Hub greenlet") + * throw = greenlet.throw + */ + /*else*/ { + __pyx_t_1 = ((PyObject *)__pyx_f_6gevent_8__waiter_getcurrent()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 132, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = (__pyx_t_1 != ((PyObject *)__pyx_v_self->hub)); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_2 = (__pyx_t_3 != 0); + if (unlikely(__pyx_t_2)) { + + /* "src/gevent/_waiter.py":133 + * else: + * if getcurrent() is not self.hub: # pylint:disable=undefined-variable + * raise AssertionError("Can only use Waiter.switch method from the Hub greenlet") # <<<<<<<<<<<<<< + * throw = greenlet.throw + * try: + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_AssertionError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 133, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 133, __pyx_L1_error) + + /* "src/gevent/_waiter.py":132 + * self._exception = throw_args + * else: + * if getcurrent() is not self.hub: # pylint:disable=undefined-variable # <<<<<<<<<<<<<< + * raise AssertionError("Can only use Waiter.switch method from the Hub greenlet") + * throw = greenlet.throw + */ + } + + /* "src/gevent/_waiter.py":134 + * if getcurrent() is not self.hub: # pylint:disable=undefined-variable + * raise AssertionError("Can only use Waiter.switch method from the Hub greenlet") + * throw = greenlet.throw # <<<<<<<<<<<<<< + * try: + * throw(*throw_args) + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_greenlet), __pyx_n_s_throw); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 134, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_throw = __pyx_t_1; + __pyx_t_1 = 0; + + /* "src/gevent/_waiter.py":135 + * raise AssertionError("Can only use Waiter.switch method from the Hub greenlet") + * throw = greenlet.throw + * try: # <<<<<<<<<<<<<< + * throw(*throw_args) + * except: # pylint:disable=bare-except + */ + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6); + __Pyx_XGOTREF(__pyx_t_4); + __Pyx_XGOTREF(__pyx_t_5); + __Pyx_XGOTREF(__pyx_t_6); + /*try:*/ { + + /* "src/gevent/_waiter.py":136 + * throw = greenlet.throw + * try: + * throw(*throw_args) # <<<<<<<<<<<<<< + * except: # pylint:disable=bare-except + * self.hub.handle_error(throw, *sys.exc_info()) + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_throw, __pyx_v_throw_args, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 136, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_waiter.py":135 + * raise AssertionError("Can only use Waiter.switch method from the Hub greenlet") + * throw = greenlet.throw + * try: # <<<<<<<<<<<<<< + * throw(*throw_args) + * except: # pylint:disable=bare-except + */ + } + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L10_try_end; + __pyx_L5_error:; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_waiter.py":137 + * try: + * throw(*throw_args) + * except: # pylint:disable=bare-except # <<<<<<<<<<<<<< + * self.hub.handle_error(throw, *sys.exc_info()) + * + */ + /*except:*/ { + __Pyx_AddTraceback("gevent.__waiter.Waiter.throw", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(0, 137, __pyx_L7_except_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GOTREF(__pyx_t_8); + + /* "src/gevent/_waiter.py":138 + * throw(*throw_args) + * except: # pylint:disable=bare-except + * self.hub.handle_error(throw, *sys.exc_info()) # <<<<<<<<<<<<<< + * + * def get(self): + */ + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->hub), __pyx_n_s_handle_error); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 138, __pyx_L7_except_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 138, __pyx_L7_except_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_INCREF(__pyx_v_throw); + __Pyx_GIVEREF(__pyx_v_throw); + PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v_throw); + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_6gevent_8__waiter_sys, __pyx_n_s_exc_info); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 138, __pyx_L7_except_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_13 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) { + __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_12); + if (likely(__pyx_t_13)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12); + __Pyx_INCREF(__pyx_t_13); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_12, function); + } + } + __pyx_t_11 = (__pyx_t_13) ? __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_13) : __Pyx_PyObject_CallNoArg(__pyx_t_12); + __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; + if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 138, __pyx_L7_except_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_12 = __Pyx_PySequence_Tuple(__pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 138, __pyx_L7_except_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_11 = PyNumber_Add(__pyx_t_10, __pyx_t_12); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 138, __pyx_L7_except_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_11, NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 138, __pyx_L7_except_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + goto __pyx_L6_exception_handled; + } + __pyx_L7_except_error:; + + /* "src/gevent/_waiter.py":135 + * raise AssertionError("Can only use Waiter.switch method from the Hub greenlet") + * throw = greenlet.throw + * try: # <<<<<<<<<<<<<< + * throw(*throw_args) + * except: # pylint:disable=bare-except + */ + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6); + goto __pyx_L1_error; + __pyx_L6_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6); + __pyx_L10_try_end:; + } + } + __pyx_L3:; + + /* "src/gevent/_waiter.py":126 + * return self.switch(args) + * + * def throw(self, *throw_args): # <<<<<<<<<<<<<< + * """Switch to the greenlet with the exception. If there's no greenlet, store the exception.""" + * greenlet = self.greenlet + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_XDECREF(__pyx_t_13); + __Pyx_AddTraceback("gevent.__waiter.Waiter.throw", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_greenlet); + __Pyx_XDECREF(__pyx_v_throw); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_waiter.py":140 + * self.hub.handle_error(throw, *sys.exc_info()) + * + * def get(self): # <<<<<<<<<<<<<< + * """If a value/an exception is stored, return/raise it. Otherwise until switch() or throw() is called.""" + * if self._exception is not _NONE: + */ + +static PyObject *__pyx_pw_6gevent_8__waiter_6Waiter_17get(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_f_6gevent_8__waiter_6Waiter_get(struct __pyx_obj_6gevent_8__waiter_Waiter *__pyx_v_self, int __pyx_skip_dispatch) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + int __pyx_t_6; + int __pyx_t_7; + int __pyx_t_8; + char const *__pyx_t_9; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + PyObject *__pyx_t_14 = NULL; + PyObject *__pyx_t_15 = NULL; + __Pyx_RefNannySetupContext("get", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0; + if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self)))))); + else { + PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + #endif + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 140, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_8__waiter_6Waiter_17get)) { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 140, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0; + if (unlikely(type_dict_guard != tp_dict_version)) { + tp_dict_version = obj_dict_version = 0; + } + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + } + #endif + } + + /* "src/gevent/_waiter.py":142 + * def get(self): + * """If a value/an exception is stored, return/raise it. Otherwise until switch() or throw() is called.""" + * if self._exception is not _NONE: # <<<<<<<<<<<<<< + * if self._exception is None: + * return self.value + */ + __pyx_t_5 = (__pyx_v_self->_exception != __pyx_v_6gevent_8__waiter__NONE); + __pyx_t_6 = (__pyx_t_5 != 0); + if (__pyx_t_6) { + + /* "src/gevent/_waiter.py":143 + * """If a value/an exception is stored, return/raise it. Otherwise until switch() or throw() is called.""" + * if self._exception is not _NONE: + * if self._exception is None: # <<<<<<<<<<<<<< + * return self.value + * getcurrent().throw(*self._exception) # pylint:disable=undefined-variable + */ + __pyx_t_6 = (__pyx_v_self->_exception == Py_None); + __pyx_t_5 = (__pyx_t_6 != 0); + if (__pyx_t_5) { + + /* "src/gevent/_waiter.py":144 + * if self._exception is not _NONE: + * if self._exception is None: + * return self.value # <<<<<<<<<<<<<< + * getcurrent().throw(*self._exception) # pylint:disable=undefined-variable + * else: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->value); + __pyx_r = __pyx_v_self->value; + goto __pyx_L0; + + /* "src/gevent/_waiter.py":143 + * """If a value/an exception is stored, return/raise it. Otherwise until switch() or throw() is called.""" + * if self._exception is not _NONE: + * if self._exception is None: # <<<<<<<<<<<<<< + * return self.value + * getcurrent().throw(*self._exception) # pylint:disable=undefined-variable + */ + } + + /* "src/gevent/_waiter.py":145 + * if self._exception is None: + * return self.value + * getcurrent().throw(*self._exception) # pylint:disable=undefined-variable # <<<<<<<<<<<<<< + * else: + * if self.greenlet is not None: + */ + __pyx_t_1 = ((PyObject *)__pyx_f_6gevent_8__waiter_getcurrent()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 145, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_throw); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 145, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PySequence_Tuple(__pyx_v_self->_exception); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 145, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 145, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "src/gevent/_waiter.py":142 + * def get(self): + * """If a value/an exception is stored, return/raise it. Otherwise until switch() or throw() is called.""" + * if self._exception is not _NONE: # <<<<<<<<<<<<<< + * if self._exception is None: + * return self.value + */ + goto __pyx_L3; + } + + /* "src/gevent/_waiter.py":147 + * getcurrent().throw(*self._exception) # pylint:disable=undefined-variable + * else: + * if self.greenlet is not None: # <<<<<<<<<<<<<< + * raise ConcurrentObjectUseError('This Waiter is already used by %r' % (self.greenlet, )) + * self.greenlet = getcurrent() # pylint:disable=undefined-variable + */ + /*else*/ { + __pyx_t_5 = (((PyObject *)__pyx_v_self->greenlet) != Py_None); + __pyx_t_6 = (__pyx_t_5 != 0); + if (unlikely(__pyx_t_6)) { + + /* "src/gevent/_waiter.py":148 + * else: + * if self.greenlet is not None: + * raise ConcurrentObjectUseError('This Waiter is already used by %r' % (self.greenlet, )) # <<<<<<<<<<<<<< + * self.greenlet = getcurrent() # pylint:disable=undefined-variable + * try: + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 148, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_self->greenlet)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self->greenlet)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self->greenlet)); + __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_This_Waiter_is_already_used_by_r, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 148, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_INCREF(__pyx_v_6gevent_8__waiter_ConcurrentObjectUseError); + __pyx_t_1 = __pyx_v_6gevent_8__waiter_ConcurrentObjectUseError; __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_1, function); + } + } + __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_4, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_2); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 148, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(0, 148, __pyx_L1_error) + + /* "src/gevent/_waiter.py":147 + * getcurrent().throw(*self._exception) # pylint:disable=undefined-variable + * else: + * if self.greenlet is not None: # <<<<<<<<<<<<<< + * raise ConcurrentObjectUseError('This Waiter is already used by %r' % (self.greenlet, )) + * self.greenlet = getcurrent() # pylint:disable=undefined-variable + */ + } + + /* "src/gevent/_waiter.py":149 + * if self.greenlet is not None: + * raise ConcurrentObjectUseError('This Waiter is already used by %r' % (self.greenlet, )) + * self.greenlet = getcurrent() # pylint:disable=undefined-variable # <<<<<<<<<<<<<< + * try: + * return self.hub.switch() + */ + __pyx_t_3 = ((PyObject *)__pyx_f_6gevent_8__waiter_getcurrent()); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 149, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __Pyx_GOTREF(__pyx_v_self->greenlet); + __Pyx_DECREF(((PyObject *)__pyx_v_self->greenlet)); + __pyx_v_self->greenlet = ((PyGreenlet *)__pyx_t_3); + __pyx_t_3 = 0; + + /* "src/gevent/_waiter.py":150 + * raise ConcurrentObjectUseError('This Waiter is already used by %r' % (self.greenlet, )) + * self.greenlet = getcurrent() # pylint:disable=undefined-variable + * try: # <<<<<<<<<<<<<< + * return self.hub.switch() + * finally: + */ + /*try:*/ { + + /* "src/gevent/_waiter.py":151 + * self.greenlet = getcurrent() # pylint:disable=undefined-variable + * try: + * return self.hub.switch() # <<<<<<<<<<<<<< + * finally: + * self.greenlet = None + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = ((struct __pyx_vtabstruct_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *)__pyx_v_self->hub->__pyx_vtab)->__pyx_switch(__pyx_v_self->hub, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 151, __pyx_L7_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L6_return; + } + + /* "src/gevent/_waiter.py":153 + * return self.hub.switch() + * finally: + * self.greenlet = None # <<<<<<<<<<<<<< + * + * def __call__(self, source): + */ + /*finally:*/ { + __pyx_L7_error:; + /*exception exit:*/{ + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15); + if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12) < 0)) __Pyx_ErrFetch(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12); + __Pyx_XGOTREF(__pyx_t_10); + __Pyx_XGOTREF(__pyx_t_11); + __Pyx_XGOTREF(__pyx_t_12); + __Pyx_XGOTREF(__pyx_t_13); + __Pyx_XGOTREF(__pyx_t_14); + __Pyx_XGOTREF(__pyx_t_15); + __pyx_t_7 = __pyx_lineno; __pyx_t_8 = __pyx_clineno; __pyx_t_9 = __pyx_filename; + { + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->greenlet); + __Pyx_DECREF(((PyObject *)__pyx_v_self->greenlet)); + __pyx_v_self->greenlet = ((PyGreenlet *)Py_None); + } + if (PY_MAJOR_VERSION >= 3) { + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_XGIVEREF(__pyx_t_15); + __Pyx_ExceptionReset(__pyx_t_13, __pyx_t_14, __pyx_t_15); + } + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_XGIVEREF(__pyx_t_12); + __Pyx_ErrRestore(__pyx_t_10, __pyx_t_11, __pyx_t_12); + __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; + __pyx_lineno = __pyx_t_7; __pyx_clineno = __pyx_t_8; __pyx_filename = __pyx_t_9; + goto __pyx_L1_error; + } + __pyx_L6_return: { + __pyx_t_15 = __pyx_r; + __pyx_r = 0; + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->greenlet); + __Pyx_DECREF(((PyObject *)__pyx_v_self->greenlet)); + __pyx_v_self->greenlet = ((PyGreenlet *)Py_None); + __pyx_r = __pyx_t_15; + __pyx_t_15 = 0; + goto __pyx_L0; + } + } + } + __pyx_L3:; + + /* "src/gevent/_waiter.py":140 + * self.hub.handle_error(throw, *sys.exc_info()) + * + * def get(self): # <<<<<<<<<<<<<< + * """If a value/an exception is stored, return/raise it. Otherwise until switch() or throw() is called.""" + * if self._exception is not _NONE: + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("gevent.__waiter.Waiter.get", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_8__waiter_6Waiter_17get(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6gevent_8__waiter_6Waiter_16get[] = "Waiter.get(self)\nIf a value/an exception is stored, return/raise it. Otherwise until switch() or throw() is called."; +static PyMethodDef __pyx_mdef_6gevent_8__waiter_6Waiter_17get = {"get", (PyCFunction)__pyx_pw_6gevent_8__waiter_6Waiter_17get, METH_NOARGS, __pyx_doc_6gevent_8__waiter_6Waiter_16get}; +static PyObject *__pyx_pw_6gevent_8__waiter_6Waiter_17get(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_8__waiter_6Waiter_16get(((struct __pyx_obj_6gevent_8__waiter_Waiter *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_8__waiter_6Waiter_16get(struct __pyx_obj_6gevent_8__waiter_Waiter *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("get", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6gevent_8__waiter_6Waiter_get(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 140, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__waiter.Waiter.get", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_waiter.py":155 + * self.greenlet = None + * + * def __call__(self, source): # <<<<<<<<<<<<<< + * if source.exception is None: + * self.switch(source.value) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_8__waiter_6Waiter_19__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6gevent_8__waiter_6Waiter_19__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_source = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__call__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_source,0}; + PyObject* values[1] = {0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_source)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__call__") < 0)) __PYX_ERR(0, 155, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + } + __pyx_v_source = values[0]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__call__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 155, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.__waiter.Waiter.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_8__waiter_6Waiter_18__call__(((struct __pyx_obj_6gevent_8__waiter_Waiter *)__pyx_v_self), __pyx_v_source); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_8__waiter_6Waiter_18__call__(struct __pyx_obj_6gevent_8__waiter_Waiter *__pyx_v_self, PyObject *__pyx_v_source) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + __Pyx_RefNannySetupContext("__call__", 0); + + /* "src/gevent/_waiter.py":156 + * + * def __call__(self, source): + * if source.exception is None: # <<<<<<<<<<<<<< + * self.switch(source.value) + * else: + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_source, __pyx_n_s_exception); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 156, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = (__pyx_t_1 == Py_None); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "src/gevent/_waiter.py":157 + * def __call__(self, source): + * if source.exception is None: + * self.switch(source.value) # <<<<<<<<<<<<<< + * else: + * self.throw(source.exception) + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_switch); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 157, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_source, __pyx_n_s_value); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 157, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_6)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + } + } + __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_6, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 157, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_waiter.py":156 + * + * def __call__(self, source): + * if source.exception is None: # <<<<<<<<<<<<<< + * self.switch(source.value) + * else: + */ + goto __pyx_L3; + } + + /* "src/gevent/_waiter.py":159 + * self.switch(source.value) + * else: + * self.throw(source.exception) # <<<<<<<<<<<<<< + * + * # can also have a debugging version, that wraps the value in a tuple (self, value) in switch() + */ + /*else*/ { + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_throw); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 159, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_source, __pyx_n_s_exception); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 159, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_6)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + } + } + __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_6, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 159, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + __pyx_L3:; + + /* "src/gevent/_waiter.py":155 + * self.greenlet = None + * + * def __call__(self, source): # <<<<<<<<<<<<<< + * if source.exception is None: + * self.switch(source.value) + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("gevent.__waiter.Waiter.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/__waiter.pxd":34 + * + * cdef class Waiter: + * cdef readonly SwitchOutGreenletWithLoop hub # <<<<<<<<<<<<<< + * cdef readonly greenlet greenlet + * cdef readonly value + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_8__waiter_6Waiter_3hub_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_8__waiter_6Waiter_3hub_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_8__waiter_6Waiter_3hub___get__(((struct __pyx_obj_6gevent_8__waiter_Waiter *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_8__waiter_6Waiter_3hub___get__(struct __pyx_obj_6gevent_8__waiter_Waiter *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_self->hub)); + __pyx_r = ((PyObject *)__pyx_v_self->hub); + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/__waiter.pxd":35 + * cdef class Waiter: + * cdef readonly SwitchOutGreenletWithLoop hub + * cdef readonly greenlet greenlet # <<<<<<<<<<<<<< + * cdef readonly value + * cdef _exception + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_8__waiter_6Waiter_8greenlet_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_8__waiter_6Waiter_8greenlet_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_8__waiter_6Waiter_8greenlet___get__(((struct __pyx_obj_6gevent_8__waiter_Waiter *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_8__waiter_6Waiter_8greenlet___get__(struct __pyx_obj_6gevent_8__waiter_Waiter *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_self->greenlet)); + __pyx_r = ((PyObject *)__pyx_v_self->greenlet); + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/__waiter.pxd":36 + * cdef readonly SwitchOutGreenletWithLoop hub + * cdef readonly greenlet greenlet + * cdef readonly value # <<<<<<<<<<<<<< + * cdef _exception + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_8__waiter_6Waiter_5value_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_8__waiter_6Waiter_5value_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_8__waiter_6Waiter_5value___get__(((struct __pyx_obj_6gevent_8__waiter_Waiter *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_8__waiter_6Waiter_5value___get__(struct __pyx_obj_6gevent_8__waiter_Waiter *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->value); + __pyx_r = __pyx_v_self->value; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_waiter.py":177 + * __slots__ = ['_values'] + * + * def __init__(self, hub=None): # <<<<<<<<<<<<<< + * Waiter.__init__(self, hub) + * # we typically expect a relatively small number of these to be outstanding. + */ + +/* Python wrapper */ +static int __pyx_pw_6gevent_8__waiter_14MultipleWaiter_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6gevent_8__waiter_14MultipleWaiter_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_hub = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_hub,0}; + PyObject* values[1] = {0}; + values[0] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_hub); + if (value) { values[0] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 177, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_hub = values[0]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 177, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.__waiter.MultipleWaiter.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_8__waiter_14MultipleWaiter___init__(((struct __pyx_obj_6gevent_8__waiter_MultipleWaiter *)__pyx_v_self), __pyx_v_hub); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_8__waiter_14MultipleWaiter___init__(struct __pyx_obj_6gevent_8__waiter_MultipleWaiter *__pyx_v_self, PyObject *__pyx_v_hub) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "src/gevent/_waiter.py":178 + * + * def __init__(self, hub=None): + * Waiter.__init__(self, hub) # <<<<<<<<<<<<<< + * # we typically expect a relatively small number of these to be outstanding. + * # since we pop from the left, a deque might be slightly + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_6gevent_8__waiter_Waiter), __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 178, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + __pyx_t_4 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_4 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[3] = {__pyx_t_3, ((PyObject *)__pyx_v_self), __pyx_v_hub}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 178, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[3] = {__pyx_t_3, ((PyObject *)__pyx_v_self), __pyx_v_hub}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 178, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else + #endif + { + __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 178, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (__pyx_t_3) { + __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL; + } + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, ((PyObject *)__pyx_v_self)); + __Pyx_INCREF(__pyx_v_hub); + __Pyx_GIVEREF(__pyx_v_hub); + PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_hub); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 178, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_waiter.py":184 + * # we can help it to better support monkey-patching, and delaying the import + * # here can be impractical (see https://github.com/gevent/gevent/issues/652) + * self._values = list() # <<<<<<<<<<<<<< + * + * def switch(self, value): + */ + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 184, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_self->_values); + __Pyx_DECREF(__pyx_v_self->_values); + __pyx_v_self->_values = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "src/gevent/_waiter.py":177 + * __slots__ = ['_values'] + * + * def __init__(self, hub=None): # <<<<<<<<<<<<<< + * Waiter.__init__(self, hub) + * # we typically expect a relatively small number of these to be outstanding. + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("gevent.__waiter.MultipleWaiter.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_waiter.py":186 + * self._values = list() + * + * def switch(self, value): # <<<<<<<<<<<<<< + * self._values.append(value) + * Waiter.switch(self, True) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_8__waiter_14MultipleWaiter_3switch(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static char __pyx_doc_6gevent_8__waiter_14MultipleWaiter_2switch[] = "MultipleWaiter.switch(self, value)"; +static PyMethodDef __pyx_mdef_6gevent_8__waiter_14MultipleWaiter_3switch = {"switch", (PyCFunction)__pyx_pw_6gevent_8__waiter_14MultipleWaiter_3switch, METH_O, __pyx_doc_6gevent_8__waiter_14MultipleWaiter_2switch}; +static PyObject *__pyx_pw_6gevent_8__waiter_14MultipleWaiter_3switch(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("switch (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_8__waiter_14MultipleWaiter_2switch(((struct __pyx_obj_6gevent_8__waiter_MultipleWaiter *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_8__waiter_14MultipleWaiter_2switch(struct __pyx_obj_6gevent_8__waiter_MultipleWaiter *__pyx_v_self, PyObject *__pyx_v_value) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + __Pyx_RefNannySetupContext("switch", 0); + + /* "src/gevent/_waiter.py":187 + * + * def switch(self, value): + * self._values.append(value) # <<<<<<<<<<<<<< + * Waiter.switch(self, True) + * + */ + if (unlikely(__pyx_v_self->_values == Py_None)) { + PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "append"); + __PYX_ERR(0, 187, __pyx_L1_error) + } + __pyx_t_1 = __Pyx_PyList_Append(__pyx_v_self->_values, __pyx_v_value); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 187, __pyx_L1_error) + + /* "src/gevent/_waiter.py":188 + * def switch(self, value): + * self._values.append(value) + * Waiter.switch(self, True) # <<<<<<<<<<<<<< + * + * def get(self): + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_6gevent_8__waiter_Waiter), __pyx_n_s_switch); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 188, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = NULL; + __pyx_t_5 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_5 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_3)) { + PyObject *__pyx_temp[3] = {__pyx_t_4, ((PyObject *)__pyx_v_self), Py_True}; + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 188, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GOTREF(__pyx_t_2); + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { + PyObject *__pyx_temp[3] = {__pyx_t_4, ((PyObject *)__pyx_v_self), Py_True}; + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 188, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GOTREF(__pyx_t_2); + } else + #endif + { + __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 188, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (__pyx_t_4) { + __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL; + } + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, ((PyObject *)__pyx_v_self)); + __Pyx_INCREF(Py_True); + __Pyx_GIVEREF(Py_True); + PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, Py_True); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 188, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/_waiter.py":186 + * self._values = list() + * + * def switch(self, value): # <<<<<<<<<<<<<< + * self._values.append(value) + * Waiter.switch(self, True) + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("gevent.__waiter.MultipleWaiter.switch", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_waiter.py":190 + * Waiter.switch(self, True) + * + * def get(self): # <<<<<<<<<<<<<< + * if not self._values: + * Waiter.get(self) + */ + +static PyObject *__pyx_pw_6gevent_8__waiter_14MultipleWaiter_5get(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_f_6gevent_8__waiter_14MultipleWaiter_get(struct __pyx_obj_6gevent_8__waiter_MultipleWaiter *__pyx_v_self, CYTHON_UNUSED int __pyx_skip_dispatch) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("get", 0); + + /* "src/gevent/_waiter.py":191 + * + * def get(self): + * if not self._values: # <<<<<<<<<<<<<< + * Waiter.get(self) + * Waiter.clear(self) + */ + __pyx_t_1 = (__pyx_v_self->_values != Py_None)&&(PyList_GET_SIZE(__pyx_v_self->_values) != 0); + __pyx_t_2 = ((!__pyx_t_1) != 0); + if (__pyx_t_2) { + + /* "src/gevent/_waiter.py":192 + * def get(self): + * if not self._values: + * Waiter.get(self) # <<<<<<<<<<<<<< + * Waiter.clear(self) + * + */ + __pyx_t_3 = __pyx_f_6gevent_8__waiter_6Waiter_get(((struct __pyx_obj_6gevent_8__waiter_Waiter *)__pyx_v_self), 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 192, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "src/gevent/_waiter.py":193 + * if not self._values: + * Waiter.get(self) + * Waiter.clear(self) # <<<<<<<<<<<<<< + * + * return self._values.pop(0) + */ + __pyx_t_3 = __pyx_f_6gevent_8__waiter_6Waiter_clear(((struct __pyx_obj_6gevent_8__waiter_Waiter *)__pyx_v_self), 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 193, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "src/gevent/_waiter.py":191 + * + * def get(self): + * if not self._values: # <<<<<<<<<<<<<< + * Waiter.get(self) + * Waiter.clear(self) + */ + } + + /* "src/gevent/_waiter.py":195 + * Waiter.clear(self) + * + * return self._values.pop(0) # <<<<<<<<<<<<<< + * + * def _init(): + */ + __Pyx_XDECREF(__pyx_r); + if (unlikely(__pyx_v_self->_values == Py_None)) { + PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "pop"); + __PYX_ERR(0, 195, __pyx_L1_error) + } + __pyx_t_3 = __Pyx_PyList_PopIndex(__pyx_v_self->_values, __pyx_int_0, 0, 1, Py_ssize_t, PyInt_FromSsize_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 195, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "src/gevent/_waiter.py":190 + * Waiter.switch(self, True) + * + * def get(self): # <<<<<<<<<<<<<< + * if not self._values: + * Waiter.get(self) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("gevent.__waiter.MultipleWaiter.get", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_8__waiter_14MultipleWaiter_5get(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6gevent_8__waiter_14MultipleWaiter_4get[] = "MultipleWaiter.get(self)"; +static PyMethodDef __pyx_mdef_6gevent_8__waiter_14MultipleWaiter_5get = {"get", (PyCFunction)__pyx_pw_6gevent_8__waiter_14MultipleWaiter_5get, METH_NOARGS, __pyx_doc_6gevent_8__waiter_14MultipleWaiter_4get}; +static PyObject *__pyx_pw_6gevent_8__waiter_14MultipleWaiter_5get(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_8__waiter_14MultipleWaiter_4get(((struct __pyx_obj_6gevent_8__waiter_MultipleWaiter *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_8__waiter_14MultipleWaiter_4get(struct __pyx_obj_6gevent_8__waiter_MultipleWaiter *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("get", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6gevent_8__waiter_14MultipleWaiter_get(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 190, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__waiter.MultipleWaiter.get", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_waiter.py":197 + * return self._values.pop(0) + * + * def _init(): # <<<<<<<<<<<<<< + * greenlet_init() # pylint:disable=undefined-variable + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_8__waiter_1_init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6gevent_8__waiter__init[] = "_init()"; +static PyMethodDef __pyx_mdef_6gevent_8__waiter_1_init = {"_init", (PyCFunction)__pyx_pw_6gevent_8__waiter_1_init, METH_NOARGS, __pyx_doc_6gevent_8__waiter__init}; +static PyObject *__pyx_pw_6gevent_8__waiter_1_init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_init (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_8__waiter__init(__pyx_self); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_8__waiter__init(CYTHON_UNUSED PyObject *__pyx_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_init", 0); + + /* "src/gevent/_waiter.py":198 + * + * def _init(): + * greenlet_init() # pylint:disable=undefined-variable # <<<<<<<<<<<<<< + * + * _init() + */ + __pyx_f_6gevent_8__waiter_greenlet_init(); + + /* "src/gevent/_waiter.py":197 + * return self._values.pop(0) + * + * def _init(): # <<<<<<<<<<<<<< + * greenlet_init() # pylint:disable=undefined-variable + * + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/__greenlet_primitives.pxd":23 + * + * @cython.final + * cdef inline greenlet getcurrent(): # <<<<<<<<<<<<<< + * return PyGreenlet_GetCurrent() + * + */ + +static CYTHON_INLINE PyGreenlet *__pyx_f_6gevent_21__greenlet_primitives_getcurrent(void) { + PyGreenlet *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("getcurrent", 0); + + /* "gevent/__greenlet_primitives.pxd":24 + * @cython.final + * cdef inline greenlet getcurrent(): + * return PyGreenlet_GetCurrent() # <<<<<<<<<<<<<< + * + * cdef bint _greenlet_imported + */ + __Pyx_XDECREF(((PyObject *)__pyx_r)); + __pyx_t_1 = ((PyObject *)PyGreenlet_GetCurrent()); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 24, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = ((PyGreenlet *)__pyx_t_1); + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "gevent/__greenlet_primitives.pxd":23 + * + * @cython.final + * cdef inline greenlet getcurrent(): # <<<<<<<<<<<<<< + * return PyGreenlet_GetCurrent() + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__greenlet_primitives.getcurrent", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF((PyObject *)__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/__greenlet_primitives.pxd":28 + * cdef bint _greenlet_imported + * + * cdef inline void greenlet_init(): # <<<<<<<<<<<<<< + * global _greenlet_imported + * if not _greenlet_imported: + */ + +static CYTHON_INLINE void __pyx_f_6gevent_21__greenlet_primitives_greenlet_init(void) { + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("greenlet_init", 0); + + /* "gevent/__greenlet_primitives.pxd":30 + * cdef inline void greenlet_init(): + * global _greenlet_imported + * if not _greenlet_imported: # <<<<<<<<<<<<<< + * PyGreenlet_Import() + * _greenlet_imported = True + */ + __pyx_t_1 = ((!(__pyx_v_6gevent_21__greenlet_primitives__greenlet_imported != 0)) != 0); + if (__pyx_t_1) { + + /* "gevent/__greenlet_primitives.pxd":31 + * global _greenlet_imported + * if not _greenlet_imported: + * PyGreenlet_Import() # <<<<<<<<<<<<<< + * _greenlet_imported = True + * + */ + PyGreenlet_Import(); + + /* "gevent/__greenlet_primitives.pxd":32 + * if not _greenlet_imported: + * PyGreenlet_Import() + * _greenlet_imported = True # <<<<<<<<<<<<<< + * + * cdef inline object _greenlet_switch(greenlet self): + */ + __pyx_v_6gevent_21__greenlet_primitives__greenlet_imported = 1; + + /* "gevent/__greenlet_primitives.pxd":30 + * cdef inline void greenlet_init(): + * global _greenlet_imported + * if not _greenlet_imported: # <<<<<<<<<<<<<< + * PyGreenlet_Import() + * _greenlet_imported = True + */ + } + + /* "gevent/__greenlet_primitives.pxd":28 + * cdef bint _greenlet_imported + * + * cdef inline void greenlet_init(): # <<<<<<<<<<<<<< + * global _greenlet_imported + * if not _greenlet_imported: + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "gevent/__greenlet_primitives.pxd":34 + * _greenlet_imported = True + * + * cdef inline object _greenlet_switch(greenlet self): # <<<<<<<<<<<<<< + * return PyGreenlet_Switch(self, NULL, NULL) + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_6gevent_21__greenlet_primitives__greenlet_switch(PyGreenlet *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("_greenlet_switch", 0); + + /* "gevent/__greenlet_primitives.pxd":35 + * + * cdef inline object _greenlet_switch(greenlet self): + * return PyGreenlet_Switch(self, NULL, NULL) # <<<<<<<<<<<<<< + * + * cdef class TrackedRawGreenlet(greenlet): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyGreenlet_Switch(__pyx_v_self, NULL, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 35, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "gevent/__greenlet_primitives.pxd":34 + * _greenlet_imported = True + * + * cdef inline object _greenlet_switch(greenlet self): # <<<<<<<<<<<<<< + * return PyGreenlet_Switch(self, NULL, NULL) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__greenlet_primitives._greenlet_switch", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/__waiter.pxd":24 + * void PyGreenlet_Import() + * + * cdef inline greenlet getcurrent(): # <<<<<<<<<<<<<< + * return PyGreenlet_GetCurrent() + * + */ + +static CYTHON_INLINE PyGreenlet *__pyx_f_6gevent_8__waiter_getcurrent(void) { + PyGreenlet *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("getcurrent", 0); + + /* "gevent/__waiter.pxd":25 + * + * cdef inline greenlet getcurrent(): + * return PyGreenlet_GetCurrent() # <<<<<<<<<<<<<< + * + * cdef inline void greenlet_init(): + */ + __Pyx_XDECREF(((PyObject *)__pyx_r)); + __pyx_t_1 = ((PyObject *)PyGreenlet_GetCurrent()); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 25, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = ((PyGreenlet *)__pyx_t_1); + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "gevent/__waiter.pxd":24 + * void PyGreenlet_Import() + * + * cdef inline greenlet getcurrent(): # <<<<<<<<<<<<<< + * return PyGreenlet_GetCurrent() + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__waiter.getcurrent", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF((PyObject *)__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/__waiter.pxd":27 + * return PyGreenlet_GetCurrent() + * + * cdef inline void greenlet_init(): # <<<<<<<<<<<<<< + * global _greenlet_imported + * if not _greenlet_imported: + */ + +static CYTHON_INLINE void __pyx_f_6gevent_8__waiter_greenlet_init(void) { + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("greenlet_init", 0); + + /* "gevent/__waiter.pxd":29 + * cdef inline void greenlet_init(): + * global _greenlet_imported + * if not _greenlet_imported: # <<<<<<<<<<<<<< + * PyGreenlet_Import() + * _greenlet_imported = True + */ + __pyx_t_1 = ((!(__pyx_v_6gevent_8__waiter__greenlet_imported != 0)) != 0); + if (__pyx_t_1) { + + /* "gevent/__waiter.pxd":30 + * global _greenlet_imported + * if not _greenlet_imported: + * PyGreenlet_Import() # <<<<<<<<<<<<<< + * _greenlet_imported = True + * + */ + PyGreenlet_Import(); + + /* "gevent/__waiter.pxd":31 + * if not _greenlet_imported: + * PyGreenlet_Import() + * _greenlet_imported = True # <<<<<<<<<<<<<< + * + * cdef class Waiter: + */ + __pyx_v_6gevent_8__waiter__greenlet_imported = 1; + + /* "gevent/__waiter.pxd":29 + * cdef inline void greenlet_init(): + * global _greenlet_imported + * if not _greenlet_imported: # <<<<<<<<<<<<<< + * PyGreenlet_Import() + * _greenlet_imported = True + */ + } + + /* "gevent/__waiter.pxd":27 + * return PyGreenlet_GetCurrent() + * + * cdef inline void greenlet_init(): # <<<<<<<<<<<<<< + * global _greenlet_imported + * if not _greenlet_imported: + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} +static struct __pyx_vtabstruct_6gevent_8__waiter_Waiter __pyx_vtable_6gevent_8__waiter_Waiter; + +static PyObject *__pyx_tp_new_6gevent_8__waiter_Waiter(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + struct __pyx_obj_6gevent_8__waiter_Waiter *p; + PyObject *o; + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_6gevent_8__waiter_Waiter *)o); + p->__pyx_vtab = __pyx_vtabptr_6gevent_8__waiter_Waiter; + p->hub = ((struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *)Py_None); Py_INCREF(Py_None); + p->greenlet = ((PyGreenlet *)Py_None); Py_INCREF(Py_None); + p->value = Py_None; Py_INCREF(Py_None); + p->_exception = Py_None; Py_INCREF(Py_None); + return o; +} + +static void __pyx_tp_dealloc_6gevent_8__waiter_Waiter(PyObject *o) { + struct __pyx_obj_6gevent_8__waiter_Waiter *p = (struct __pyx_obj_6gevent_8__waiter_Waiter *)o; + #if CYTHON_USE_TP_FINALIZE + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + PyObject_GC_UnTrack(o); + Py_CLEAR(p->hub); + Py_CLEAR(p->greenlet); + Py_CLEAR(p->value); + Py_CLEAR(p->_exception); + (*Py_TYPE(o)->tp_free)(o); +} + +static int __pyx_tp_traverse_6gevent_8__waiter_Waiter(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_6gevent_8__waiter_Waiter *p = (struct __pyx_obj_6gevent_8__waiter_Waiter *)o; + if (p->hub) { + e = (*v)(((PyObject *)p->hub), a); if (e) return e; + } + if (p->greenlet) { + e = (*v)(((PyObject *)p->greenlet), a); if (e) return e; + } + if (p->value) { + e = (*v)(p->value, a); if (e) return e; + } + if (p->_exception) { + e = (*v)(p->_exception, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_6gevent_8__waiter_Waiter(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_6gevent_8__waiter_Waiter *p = (struct __pyx_obj_6gevent_8__waiter_Waiter *)o; + tmp = ((PyObject*)p->hub); + p->hub = ((struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->greenlet); + p->greenlet = ((PyGreenlet *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->value); + p->value = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->_exception); + p->_exception = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyObject *__pyx_getprop_6gevent_8__waiter_6Waiter_exc_info(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_8__waiter_6Waiter_8exc_info_1__get__(o); +} + +static PyObject *__pyx_getprop_6gevent_8__waiter_6Waiter_hub(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_8__waiter_6Waiter_3hub_1__get__(o); +} + +static PyObject *__pyx_getprop_6gevent_8__waiter_6Waiter_greenlet(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_8__waiter_6Waiter_8greenlet_1__get__(o); +} + +static PyObject *__pyx_getprop_6gevent_8__waiter_6Waiter_value(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_8__waiter_6Waiter_5value_1__get__(o); +} + +static PyMethodDef __pyx_methods_6gevent_8__waiter_Waiter[] = { + {"ready", (PyCFunction)__pyx_pw_6gevent_8__waiter_6Waiter_7ready, METH_NOARGS, __pyx_doc_6gevent_8__waiter_6Waiter_6ready}, + {"successful", (PyCFunction)__pyx_pw_6gevent_8__waiter_6Waiter_9successful, METH_NOARGS, __pyx_doc_6gevent_8__waiter_6Waiter_8successful}, + {"switch", (PyCFunction)__pyx_pw_6gevent_8__waiter_6Waiter_11switch, METH_O, __pyx_doc_6gevent_8__waiter_6Waiter_10switch}, + {"switch_args", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_8__waiter_6Waiter_13switch_args, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_8__waiter_6Waiter_12switch_args}, + {"throw", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_8__waiter_6Waiter_15throw, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_8__waiter_6Waiter_14throw}, + {0, 0, 0, 0} +}; + +static struct PyGetSetDef __pyx_getsets_6gevent_8__waiter_Waiter[] = { + {(char *)"exc_info", __pyx_getprop_6gevent_8__waiter_6Waiter_exc_info, 0, (char *)"Holds the exception info passed to :meth:`throw` if :meth:`throw` was called. Otherwise ``None``.", 0}, + {(char *)"hub", __pyx_getprop_6gevent_8__waiter_6Waiter_hub, 0, (char *)0, 0}, + {(char *)"greenlet", __pyx_getprop_6gevent_8__waiter_6Waiter_greenlet, 0, (char *)0, 0}, + {(char *)"value", __pyx_getprop_6gevent_8__waiter_6Waiter_value, 0, (char *)0, 0}, + {0, 0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_6gevent_8__waiter_Waiter = { + PyVarObject_HEAD_INIT(0, 0) + "gevent.__waiter.Waiter", /*tp_name*/ + sizeof(struct __pyx_obj_6gevent_8__waiter_Waiter), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6gevent_8__waiter_Waiter, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + __pyx_pw_6gevent_8__waiter_6Waiter_19__call__, /*tp_call*/ + __pyx_pw_6gevent_8__waiter_6Waiter_5__str__, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + "Waiter(hub=None)\n\n A low level communication utility for greenlets.\n\n Waiter is a wrapper around greenlet's ``switch()`` and ``throw()`` calls that makes them somewhat safer:\n\n * switching will occur only if the waiting greenlet is executing :meth:`get` method currently;\n * any error raised in the greenlet is handled inside :meth:`switch` and :meth:`throw`\n * if :meth:`switch`/:meth:`throw` is called before the receiver calls :meth:`get`, then :class:`Waiter`\n will store the value/exception. The following :meth:`get` will return the value/raise the exception.\n\n The :meth:`switch` and :meth:`throw` methods must only be called from the :class:`Hub` greenlet.\n The :meth:`get` method must be called from a greenlet other than :class:`Hub`.\n\n >>> result = Waiter()\n >>> timer = get_hub().loop.timer(0.1)\n >>> timer.start(result.switch, 'hello from Waiter')\n >>> result.get() # blocks for 0.1 seconds\n 'hello from Waiter'\n >>> timer.close()\n\n If switch is called before the greenlet gets a chance to call :meth:`get` then\n :class:`Waiter` stores the value.\n\n >>> result = Waiter()\n >>> timer = get_hub().loop.timer(0.1)\n >>> timer.start(result.switch, 'hi from Waiter')\n >>> sleep(0.2)\n >>> result.get() # returns immediately without blocking\n 'hi from Waiter'\n >>> timer.close()\n\n .. warning::\n\n This a limited and dangerous way to communicate between\n greenlets. It can easily leave a greenlet unscheduled forever\n if used incorrectly. Consider using safer classes such as\n :class:`gevent.event.Event`, :class:`gevent.event.AsyncResult`,\n or :class:`gevent.queue.Queue`.\n ", /*tp_doc*/ + __pyx_tp_traverse_6gevent_8__waiter_Waiter, /*tp_traverse*/ + __pyx_tp_clear_6gevent_8__waiter_Waiter, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6gevent_8__waiter_Waiter, /*tp_methods*/ + 0, /*tp_members*/ + __pyx_getsets_6gevent_8__waiter_Waiter, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_pw_6gevent_8__waiter_6Waiter_1__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6gevent_8__waiter_Waiter, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; +static struct __pyx_vtabstruct_6gevent_8__waiter_MultipleWaiter __pyx_vtable_6gevent_8__waiter_MultipleWaiter; + +static PyObject *__pyx_tp_new_6gevent_8__waiter_MultipleWaiter(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_6gevent_8__waiter_MultipleWaiter *p; + PyObject *o = __pyx_tp_new_6gevent_8__waiter_Waiter(t, a, k); + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_6gevent_8__waiter_MultipleWaiter *)o); + p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_6gevent_8__waiter_Waiter*)__pyx_vtabptr_6gevent_8__waiter_MultipleWaiter; + p->_values = ((PyObject*)Py_None); Py_INCREF(Py_None); + return o; +} + +static void __pyx_tp_dealloc_6gevent_8__waiter_MultipleWaiter(PyObject *o) { + struct __pyx_obj_6gevent_8__waiter_MultipleWaiter *p = (struct __pyx_obj_6gevent_8__waiter_MultipleWaiter *)o; + PyObject_GC_UnTrack(o); + Py_CLEAR(p->_values); + PyObject_GC_Track(o); + __pyx_tp_dealloc_6gevent_8__waiter_Waiter(o); +} + +static int __pyx_tp_traverse_6gevent_8__waiter_MultipleWaiter(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_6gevent_8__waiter_MultipleWaiter *p = (struct __pyx_obj_6gevent_8__waiter_MultipleWaiter *)o; + e = __pyx_tp_traverse_6gevent_8__waiter_Waiter(o, v, a); if (e) return e; + if (p->_values) { + e = (*v)(p->_values, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_6gevent_8__waiter_MultipleWaiter(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_6gevent_8__waiter_MultipleWaiter *p = (struct __pyx_obj_6gevent_8__waiter_MultipleWaiter *)o; + __pyx_tp_clear_6gevent_8__waiter_Waiter(o); + tmp = ((PyObject*)p->_values); + p->_values = ((PyObject*)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyMethodDef __pyx_methods_6gevent_8__waiter_MultipleWaiter[] = { + {"switch", (PyCFunction)__pyx_pw_6gevent_8__waiter_14MultipleWaiter_3switch, METH_O, __pyx_doc_6gevent_8__waiter_14MultipleWaiter_2switch}, + {0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_6gevent_8__waiter_MultipleWaiter = { + PyVarObject_HEAD_INIT(0, 0) + "gevent.__waiter.MultipleWaiter", /*tp_name*/ + sizeof(struct __pyx_obj_6gevent_8__waiter_MultipleWaiter), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6gevent_8__waiter_MultipleWaiter, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_6gevent_8__waiter_6Waiter_19__call__, /*tp_call*/ + #else + 0, /*tp_call*/ + #endif + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_6gevent_8__waiter_6Waiter_5__str__, /*tp_str*/ + #else + 0, /*tp_str*/ + #endif + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + "MultipleWaiter(hub=None)\n\n An internal extension of Waiter that can be used if multiple objects\n must be waited on, and there is a chance that in between waits greenlets\n might be switched out. All greenlets that switch to this waiter\n will have their value returned.\n\n This does not handle exceptions or throw methods.\n ", /*tp_doc*/ + __pyx_tp_traverse_6gevent_8__waiter_MultipleWaiter, /*tp_traverse*/ + __pyx_tp_clear_6gevent_8__waiter_MultipleWaiter, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6gevent_8__waiter_MultipleWaiter, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_pw_6gevent_8__waiter_14MultipleWaiter_1__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6gevent_8__waiter_MultipleWaiter, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static PyMethodDef __pyx_methods[] = { + {0, 0, 0, 0} +}; + +#if PY_MAJOR_VERSION >= 3 +#if CYTHON_PEP489_MULTI_PHASE_INIT +static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ +static int __pyx_pymod_exec___waiter(PyObject* module); /*proto*/ +static PyModuleDef_Slot __pyx_moduledef_slots[] = { + {Py_mod_create, (void*)__pyx_pymod_create}, + {Py_mod_exec, (void*)__pyx_pymod_exec___waiter}, + {0, NULL} +}; +#endif + +static struct PyModuleDef __pyx_moduledef = { + PyModuleDef_HEAD_INIT, + "__waiter", + __pyx_k_Low_level_waiting_primitives, /* m_doc */ + #if CYTHON_PEP489_MULTI_PHASE_INIT + 0, /* m_size */ + #else + -1, /* m_size */ + #endif + __pyx_methods /* m_methods */, + #if CYTHON_PEP489_MULTI_PHASE_INIT + __pyx_moduledef_slots, /* m_slots */ + #else + NULL, /* m_reload */ + #endif + NULL, /* m_traverse */ + NULL, /* m_clear */ + NULL /* m_free */ +}; +#endif +#ifndef CYTHON_SMALL_CODE +#if defined(__clang__) + #define CYTHON_SMALL_CODE +#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) + #define CYTHON_SMALL_CODE __attribute__((cold)) +#else + #define CYTHON_SMALL_CODE +#endif +#endif + +static __Pyx_StringTabEntry __pyx_string_tab[] = { + {&__pyx_n_s_AssertionError, __pyx_k_AssertionError, sizeof(__pyx_k_AssertionError), 0, 0, 1, 1}, + {&__pyx_kp_s_Can_only_use_Waiter_switch_metho, __pyx_k_Can_only_use_Waiter_switch_metho, sizeof(__pyx_k_Can_only_use_Waiter_switch_metho), 0, 0, 1, 0}, + {&__pyx_n_s_ConcurrentObjectUseError, __pyx_k_ConcurrentObjectUseError, sizeof(__pyx_k_ConcurrentObjectUseError), 0, 0, 1, 1}, + {&__pyx_n_s_MultipleWaiter, __pyx_k_MultipleWaiter, sizeof(__pyx_k_MultipleWaiter), 0, 0, 1, 1}, + {&__pyx_n_s_MultipleWaiter_get, __pyx_k_MultipleWaiter_get, sizeof(__pyx_k_MultipleWaiter_get), 0, 0, 1, 1}, + {&__pyx_n_s_MultipleWaiter_switch, __pyx_k_MultipleWaiter_switch, sizeof(__pyx_k_MultipleWaiter_switch), 0, 0, 1, 1}, + {&__pyx_n_s_NONE, __pyx_k_NONE, sizeof(__pyx_k_NONE), 0, 0, 1, 1}, + {&__pyx_kp_s_This_Waiter_is_already_used_by_r, __pyx_k_This_Waiter_is_already_used_by_r, sizeof(__pyx_k_This_Waiter_is_already_used_by_r), 0, 0, 1, 0}, + {&__pyx_n_s_Waiter, __pyx_k_Waiter, sizeof(__pyx_k_Waiter), 0, 0, 1, 1}, + {&__pyx_n_s_Waiter_clear, __pyx_k_Waiter_clear, sizeof(__pyx_k_Waiter_clear), 0, 0, 1, 1}, + {&__pyx_n_s_Waiter_get, __pyx_k_Waiter_get, sizeof(__pyx_k_Waiter_get), 0, 0, 1, 1}, + {&__pyx_n_s_Waiter_ready, __pyx_k_Waiter_ready, sizeof(__pyx_k_Waiter_ready), 0, 0, 1, 1}, + {&__pyx_n_s_Waiter_successful, __pyx_k_Waiter_successful, sizeof(__pyx_k_Waiter_successful), 0, 0, 1, 1}, + {&__pyx_n_s_Waiter_switch, __pyx_k_Waiter_switch, sizeof(__pyx_k_Waiter_switch), 0, 0, 1, 1}, + {&__pyx_n_s_Waiter_switch_args, __pyx_k_Waiter_switch_args, sizeof(__pyx_k_Waiter_switch_args), 0, 0, 1, 1}, + {&__pyx_n_s_Waiter_throw, __pyx_k_Waiter_throw, sizeof(__pyx_k_Waiter_throw), 0, 0, 1, 1}, + {&__pyx_n_s_all, __pyx_k_all, sizeof(__pyx_k_all), 0, 0, 1, 1}, + {&__pyx_n_s_args, __pyx_k_args, sizeof(__pyx_k_args), 0, 0, 1, 1}, + {&__pyx_n_s_clear, __pyx_k_clear, sizeof(__pyx_k_clear), 0, 0, 1, 1}, + {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, + {&__pyx_n_s_exc_info, __pyx_k_exc_info, sizeof(__pyx_k_exc_info), 0, 0, 1, 1}, + {&__pyx_n_s_exception, __pyx_k_exception, sizeof(__pyx_k_exception), 0, 0, 1, 1}, + {&__pyx_n_s_exception_2, __pyx_k_exception_2, sizeof(__pyx_k_exception_2), 0, 0, 1, 1}, + {&__pyx_n_s_get, __pyx_k_get, sizeof(__pyx_k_get), 0, 0, 1, 1}, + {&__pyx_n_s_get_hub_noargs, __pyx_k_get_hub_noargs, sizeof(__pyx_k_get_hub_noargs), 0, 0, 1, 1}, + {&__pyx_n_s_getcurrent, __pyx_k_getcurrent, sizeof(__pyx_k_getcurrent), 0, 0, 1, 1}, + {&__pyx_n_s_gevent___waiter, __pyx_k_gevent___waiter, sizeof(__pyx_k_gevent___waiter), 0, 0, 1, 1}, + {&__pyx_n_s_gevent__hub_local, __pyx_k_gevent__hub_local, sizeof(__pyx_k_gevent__hub_local), 0, 0, 1, 1}, + {&__pyx_n_s_gevent__util, __pyx_k_gevent__util, sizeof(__pyx_k_gevent__util), 0, 0, 1, 1}, + {&__pyx_n_s_gevent_exceptions, __pyx_k_gevent_exceptions, sizeof(__pyx_k_gevent_exceptions), 0, 0, 1, 1}, + {&__pyx_n_s_greenlet, __pyx_k_greenlet, sizeof(__pyx_k_greenlet), 0, 0, 1, 1}, + {&__pyx_n_s_greenlet_imported, __pyx_k_greenlet_imported, sizeof(__pyx_k_greenlet_imported), 0, 0, 1, 1}, + {&__pyx_n_s_greenlet_init, __pyx_k_greenlet_init, sizeof(__pyx_k_greenlet_init), 0, 0, 1, 1}, + {&__pyx_n_s_handle_error, __pyx_k_handle_error, sizeof(__pyx_k_handle_error), 0, 0, 1, 1}, + {&__pyx_n_s_hub, __pyx_k_hub, sizeof(__pyx_k_hub), 0, 0, 1, 1}, + {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, + {&__pyx_n_s_import_c_accel, __pyx_k_import_c_accel, sizeof(__pyx_k_import_c_accel), 0, 0, 1, 1}, + {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1}, + {&__pyx_n_s_init_2, __pyx_k_init_2, sizeof(__pyx_k_init_2), 0, 0, 1, 1}, + {&__pyx_n_s_lambda, __pyx_k_lambda, sizeof(__pyx_k_lambda), 0, 0, 1, 1}, + {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, + {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, + {&__pyx_n_s_object, __pyx_k_object, sizeof(__pyx_k_object), 0, 0, 1, 1}, + {&__pyx_n_s_pop, __pyx_k_pop, sizeof(__pyx_k_pop), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_capi, __pyx_k_pyx_capi, sizeof(__pyx_k_pyx_capi), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1}, + {&__pyx_n_s_ready, __pyx_k_ready, sizeof(__pyx_k_ready), 0, 0, 1, 1}, + {&__pyx_kp_s_s_greenlet_s, __pyx_k_s_greenlet_s, sizeof(__pyx_k_s_greenlet_s), 0, 0, 1, 0}, + {&__pyx_kp_s_s_greenlet_s_exc_info_r, __pyx_k_s_greenlet_s_exc_info_r, sizeof(__pyx_k_s_greenlet_s_exc_info_r), 0, 0, 1, 0}, + {&__pyx_kp_s_s_greenlet_s_value_r, __pyx_k_s_greenlet_s_value_r, sizeof(__pyx_k_s_greenlet_s_value_r), 0, 0, 1, 0}, + {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1}, + {&__pyx_n_s_slots, __pyx_k_slots, sizeof(__pyx_k_slots), 0, 0, 1, 1}, + {&__pyx_n_s_source, __pyx_k_source, sizeof(__pyx_k_source), 0, 0, 1, 1}, + {&__pyx_kp_s_src_gevent__waiter_py, __pyx_k_src_gevent__waiter_py, sizeof(__pyx_k_src_gevent__waiter_py), 0, 0, 1, 0}, + {&__pyx_n_s_successful, __pyx_k_successful, sizeof(__pyx_k_successful), 0, 0, 1, 1}, + {&__pyx_n_s_switch, __pyx_k_switch, sizeof(__pyx_k_switch), 0, 0, 1, 1}, + {&__pyx_n_s_switch_args, __pyx_k_switch_args, sizeof(__pyx_k_switch_args), 0, 0, 1, 1}, + {&__pyx_n_s_sys, __pyx_k_sys, sizeof(__pyx_k_sys), 0, 0, 1, 1}, + {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, + {&__pyx_n_s_throw, __pyx_k_throw, sizeof(__pyx_k_throw), 0, 0, 1, 1}, + {&__pyx_n_s_throw_args, __pyx_k_throw_args, sizeof(__pyx_k_throw_args), 0, 0, 1, 1}, + {&__pyx_n_s_value, __pyx_k_value, sizeof(__pyx_k_value), 0, 0, 1, 1}, + {&__pyx_n_s_values, __pyx_k_values, sizeof(__pyx_k_values), 0, 0, 1, 1}, + {0, 0, 0, 0, 0, 0, 0} +}; +static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { + __pyx_builtin_object = __Pyx_GetBuiltinName(__pyx_n_s_object); if (!__pyx_builtin_object) __PYX_ERR(0, 21, __pyx_L1_error) + __pyx_builtin___import__ = __Pyx_GetBuiltinName(__pyx_n_s_import); if (!__pyx_builtin___import__) __PYX_ERR(0, 23, __pyx_L1_error) + __pyx_builtin_AssertionError = __Pyx_GetBuiltinName(__pyx_n_s_AssertionError); if (!__pyx_builtin_AssertionError) __PYX_ERR(0, 116, __pyx_L1_error) + return 0; + __pyx_L1_error:; + return -1; +} + +static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); + + /* "src/gevent/_waiter.py":116 + * else: + * if getcurrent() is not self.hub: # pylint:disable=undefined-variable + * raise AssertionError("Can only use Waiter.switch method from the Hub greenlet") # <<<<<<<<<<<<<< + * switch = greenlet.switch + * try: + */ + __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_Can_only_use_Waiter_switch_metho); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 116, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple_); + __Pyx_GIVEREF(__pyx_tuple_); + + /* "src/gevent/_waiter.py":23 + * _NONE = object() + * + * locals()['getcurrent'] = __import__('greenlet').getcurrent # <<<<<<<<<<<<<< + * locals()['greenlet_init'] = lambda: None + * + */ + __pyx_tuple__2 = PyTuple_Pack(1, __pyx_n_s_greenlet); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 23, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2); + __Pyx_GIVEREF(__pyx_tuple__2); + + /* "src/gevent/_waiter.py":76 + * self._exception = _NONE + * + * def clear(self): # <<<<<<<<<<<<<< + * self.greenlet = None + * self.value = None + */ + __pyx_tuple__3 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 76, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__3); + __Pyx_GIVEREF(__pyx_tuple__3); + __pyx_codeobj__4 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__3, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__waiter_py, __pyx_n_s_clear, 76, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__4)) __PYX_ERR(0, 76, __pyx_L1_error) + + /* "src/gevent/_waiter.py":88 + * return '<%s greenlet=%s exc_info=%r>' % (type(self).__name__, self.greenlet, self.exc_info) + * + * def ready(self): # <<<<<<<<<<<<<< + * """Return true if and only if it holds a value or an exception""" + * return self._exception is not _NONE + */ + __pyx_tuple__5 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 88, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__5); + __Pyx_GIVEREF(__pyx_tuple__5); + __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__5, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__waiter_py, __pyx_n_s_ready, 88, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__6)) __PYX_ERR(0, 88, __pyx_L1_error) + + /* "src/gevent/_waiter.py":92 + * return self._exception is not _NONE + * + * def successful(self): # <<<<<<<<<<<<<< + * """Return true if and only if it is ready and holds a value""" + * return self._exception is None + */ + __pyx_tuple__7 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 92, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__7); + __Pyx_GIVEREF(__pyx_tuple__7); + __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__waiter_py, __pyx_n_s_successful, 92, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) __PYX_ERR(0, 92, __pyx_L1_error) + + /* "src/gevent/_waiter.py":102 + * return self._exception + * + * def switch(self, value): # <<<<<<<<<<<<<< + * """ + * Switch to the greenlet if one's available. Otherwise store the + */ + __pyx_tuple__9 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_value, __pyx_n_s_greenlet, __pyx_n_s_switch); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 102, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__9); + __Pyx_GIVEREF(__pyx_tuple__9); + __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__9, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__waiter_py, __pyx_n_s_switch, 102, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__10)) __PYX_ERR(0, 102, __pyx_L1_error) + + /* "src/gevent/_waiter.py":123 + * self.hub.handle_error(switch, *sys.exc_info()) + * + * def switch_args(self, *args): # <<<<<<<<<<<<<< + * return self.switch(args) + * + */ + __pyx_tuple__11 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_args); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 123, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__11); + __Pyx_GIVEREF(__pyx_tuple__11); + __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__11, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__waiter_py, __pyx_n_s_switch_args, 123, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(0, 123, __pyx_L1_error) + + /* "src/gevent/_waiter.py":126 + * return self.switch(args) + * + * def throw(self, *throw_args): # <<<<<<<<<<<<<< + * """Switch to the greenlet with the exception. If there's no greenlet, store the exception.""" + * greenlet = self.greenlet + */ + __pyx_tuple__13 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_throw_args, __pyx_n_s_greenlet, __pyx_n_s_throw); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 126, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__13); + __Pyx_GIVEREF(__pyx_tuple__13); + __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__13, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__waiter_py, __pyx_n_s_throw, 126, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__14)) __PYX_ERR(0, 126, __pyx_L1_error) + + /* "src/gevent/_waiter.py":140 + * self.hub.handle_error(throw, *sys.exc_info()) + * + * def get(self): # <<<<<<<<<<<<<< + * """If a value/an exception is stored, return/raise it. Otherwise until switch() or throw() is called.""" + * if self._exception is not _NONE: + */ + __pyx_tuple__15 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(0, 140, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__15); + __Pyx_GIVEREF(__pyx_tuple__15); + __pyx_codeobj__16 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__15, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__waiter_py, __pyx_n_s_get, 140, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__16)) __PYX_ERR(0, 140, __pyx_L1_error) + + /* "src/gevent/_waiter.py":186 + * self._values = list() + * + * def switch(self, value): # <<<<<<<<<<<<<< + * self._values.append(value) + * Waiter.switch(self, True) + */ + __pyx_tuple__17 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_value); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(0, 186, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__17); + __Pyx_GIVEREF(__pyx_tuple__17); + __pyx_codeobj__18 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__17, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__waiter_py, __pyx_n_s_switch, 186, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__18)) __PYX_ERR(0, 186, __pyx_L1_error) + + /* "src/gevent/_waiter.py":190 + * Waiter.switch(self, True) + * + * def get(self): # <<<<<<<<<<<<<< + * if not self._values: + * Waiter.get(self) + */ + __pyx_tuple__19 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(0, 190, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__19); + __Pyx_GIVEREF(__pyx_tuple__19); + __pyx_codeobj__20 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__19, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__waiter_py, __pyx_n_s_get, 190, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__20)) __PYX_ERR(0, 190, __pyx_L1_error) + + /* "src/gevent/_waiter.py":197 + * return self._values.pop(0) + * + * def _init(): # <<<<<<<<<<<<<< + * greenlet_init() # pylint:disable=undefined-variable + * + */ + __pyx_codeobj__21 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__waiter_py, __pyx_n_s_init_2, 197, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__21)) __PYX_ERR(0, 197, __pyx_L1_error) + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} + +static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { + if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error) + return 0; + __pyx_L1_error:; + return -1; +} + +static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/ + +static int __Pyx_modinit_global_init_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); + /*--- Global init code ---*/ + __pyx_v_6gevent_8__waiter_sys = Py_None; Py_INCREF(Py_None); + __pyx_v_6gevent_8__waiter_ConcurrentObjectUseError = Py_None; Py_INCREF(Py_None); + __pyx_v_6gevent_8__waiter__NONE = Py_None; Py_INCREF(Py_None); + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_variable_export_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); + /*--- Variable export code ---*/ + if (__Pyx_ExportVoidPtr(__pyx_n_s_sys, (void *)&__pyx_v_6gevent_8__waiter_sys, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportVoidPtr(__pyx_n_s_ConcurrentObjectUseError, (void *)&__pyx_v_6gevent_8__waiter_ConcurrentObjectUseError, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportVoidPtr(__pyx_n_s_greenlet_imported, (void *)&__pyx_v_6gevent_8__waiter__greenlet_imported, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportVoidPtr(__pyx_n_s_NONE, (void *)&__pyx_v_6gevent_8__waiter__NONE, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_modinit_function_export_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); + /*--- Function export code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_type_init_code(void) { + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); + /*--- Type init code ---*/ + __pyx_t_1 = PyImport_ImportModule("greenlet"); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 15, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_ptype_6gevent_8__waiter_greenlet = __Pyx_ImportType(__pyx_t_1, "greenlet", "greenlet", sizeof(PyGreenlet), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_8__waiter_greenlet) __PYX_ERR(2, 15, __pyx_L1_error) + __pyx_vtabptr_6gevent_8__waiter_Waiter = &__pyx_vtable_6gevent_8__waiter_Waiter; + __pyx_vtable_6gevent_8__waiter_Waiter.get = (PyObject *(*)(struct __pyx_obj_6gevent_8__waiter_Waiter *, int __pyx_skip_dispatch))__pyx_f_6gevent_8__waiter_6Waiter_get; + __pyx_vtable_6gevent_8__waiter_Waiter.clear = (PyObject *(*)(struct __pyx_obj_6gevent_8__waiter_Waiter *, int __pyx_skip_dispatch))__pyx_f_6gevent_8__waiter_6Waiter_clear; + if (PyType_Ready(&__pyx_type_6gevent_8__waiter_Waiter) < 0) __PYX_ERR(0, 27, __pyx_L1_error) + __pyx_type_6gevent_8__waiter_Waiter.tp_print = 0; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6gevent_8__waiter_Waiter.tp_dictoffset && __pyx_type_6gevent_8__waiter_Waiter.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_type_6gevent_8__waiter_Waiter.tp_getattro = __Pyx_PyObject_GenericGetAttr; + } + if (__Pyx_SetVtable(__pyx_type_6gevent_8__waiter_Waiter.tp_dict, __pyx_vtabptr_6gevent_8__waiter_Waiter) < 0) __PYX_ERR(0, 27, __pyx_L1_error) + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Waiter, (PyObject *)&__pyx_type_6gevent_8__waiter_Waiter) < 0) __PYX_ERR(0, 27, __pyx_L1_error) + __pyx_ptype_6gevent_8__waiter_Waiter = &__pyx_type_6gevent_8__waiter_Waiter; + __pyx_vtabptr_6gevent_8__waiter_MultipleWaiter = &__pyx_vtable_6gevent_8__waiter_MultipleWaiter; + __pyx_vtable_6gevent_8__waiter_MultipleWaiter.__pyx_base = *__pyx_vtabptr_6gevent_8__waiter_Waiter; + __pyx_vtable_6gevent_8__waiter_MultipleWaiter.__pyx_base.get = (PyObject *(*)(struct __pyx_obj_6gevent_8__waiter_Waiter *, int __pyx_skip_dispatch))__pyx_f_6gevent_8__waiter_14MultipleWaiter_get; + __pyx_type_6gevent_8__waiter_MultipleWaiter.tp_base = __pyx_ptype_6gevent_8__waiter_Waiter; + if (PyType_Ready(&__pyx_type_6gevent_8__waiter_MultipleWaiter) < 0) __PYX_ERR(0, 166, __pyx_L1_error) + __pyx_type_6gevent_8__waiter_MultipleWaiter.tp_print = 0; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6gevent_8__waiter_MultipleWaiter.tp_dictoffset && __pyx_type_6gevent_8__waiter_MultipleWaiter.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_type_6gevent_8__waiter_MultipleWaiter.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + } + if (__Pyx_SetVtable(__pyx_type_6gevent_8__waiter_MultipleWaiter.tp_dict, __pyx_vtabptr_6gevent_8__waiter_MultipleWaiter) < 0) __PYX_ERR(0, 166, __pyx_L1_error) + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_MultipleWaiter, (PyObject *)&__pyx_type_6gevent_8__waiter_MultipleWaiter) < 0) __PYX_ERR(0, 166, __pyx_L1_error) + __pyx_ptype_6gevent_8__waiter_MultipleWaiter = &__pyx_type_6gevent_8__waiter_MultipleWaiter; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_modinit_type_import_code(void) { + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); + /*--- Type import code ---*/ + __pyx_t_1 = PyImport_ImportModule("greenlet"); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_ptype_6gevent_21__greenlet_primitives_greenlet = __Pyx_ImportType(__pyx_t_1, "greenlet", "greenlet", sizeof(PyGreenlet), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_21__greenlet_primitives_greenlet) __PYX_ERR(1, 12, __pyx_L1_error) + __pyx_t_2 = PyImport_ImportModule("gevent.__greenlet_primitives"); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 37, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_ptype_6gevent_21__greenlet_primitives_TrackedRawGreenlet = __Pyx_ImportType(__pyx_t_2, "gevent.__greenlet_primitives", "TrackedRawGreenlet", sizeof(struct __pyx_obj_6gevent_21__greenlet_primitives_TrackedRawGreenlet), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_21__greenlet_primitives_TrackedRawGreenlet) __PYX_ERR(1, 37, __pyx_L1_error) + __pyx_ptype_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop = __Pyx_ImportType(__pyx_t_2, "gevent.__greenlet_primitives", "SwitchOutGreenletWithLoop", sizeof(struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop) __PYX_ERR(1, 40, __pyx_L1_error) + __pyx_vtabptr_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop = (struct __pyx_vtabstruct_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop*)__Pyx_GetVtable(__pyx_ptype_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop->tp_dict); if (unlikely(!__pyx_vtabptr_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop)) __PYX_ERR(1, 40, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_modinit_variable_import_code(void) { + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); + /*--- Variable import code ---*/ + __pyx_t_1 = PyImport_ImportModule("gevent.__greenlet_primitives"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_1, "get_objects", (void **)&__pyx_vp_6gevent_21__greenlet_primitives_get_objects, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_1, "wref", (void **)&__pyx_vp_6gevent_21__greenlet_primitives_wref, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_1, "BlockingSwitchOutError", (void **)&__pyx_vp_6gevent_21__greenlet_primitives_BlockingSwitchOutError, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_1, "_greenlet_imported", (void **)&__pyx_vp_6gevent_21__greenlet_primitives__greenlet_imported, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + Py_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_2 = PyImport_ImportModule("gevent.__hub_local"); if (!__pyx_t_2) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_2, "_threadlocal", (void **)&__pyx_vp_6gevent_11__hub_local__threadlocal, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + Py_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_modinit_function_import_code(void) { + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); + /*--- Function import code ---*/ + __pyx_t_1 = PyImport_ImportModule("gevent.__hub_local"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportFunction(__pyx_t_1, "get_hub_noargs", (void (**)(void))&__pyx_f_6gevent_11__hub_local_get_hub_noargs, "struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *(int __pyx_skip_dispatch)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + Py_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_RefNannyFinishContext(); + return -1; +} + + +#if PY_MAJOR_VERSION < 3 +#ifdef CYTHON_NO_PYINIT_EXPORT +#define __Pyx_PyMODINIT_FUNC void +#else +#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC +#endif +#else +#ifdef CYTHON_NO_PYINIT_EXPORT +#define __Pyx_PyMODINIT_FUNC PyObject * +#else +#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC +#endif +#endif + + +#if PY_MAJOR_VERSION < 3 +__Pyx_PyMODINIT_FUNC init__waiter(void) CYTHON_SMALL_CODE; /*proto*/ +__Pyx_PyMODINIT_FUNC init__waiter(void) +#else +__Pyx_PyMODINIT_FUNC PyInit___waiter(void) CYTHON_SMALL_CODE; /*proto*/ +__Pyx_PyMODINIT_FUNC PyInit___waiter(void) +#if CYTHON_PEP489_MULTI_PHASE_INIT +{ + return PyModuleDef_Init(&__pyx_moduledef); +} +static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { + #if PY_VERSION_HEX >= 0x030700A1 + static PY_INT64_T main_interpreter_id = -1; + PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); + if (main_interpreter_id == -1) { + main_interpreter_id = current_id; + return (unlikely(current_id == -1)) ? -1 : 0; + } else if (unlikely(main_interpreter_id != current_id)) + #else + static PyInterpreterState *main_interpreter = NULL; + PyInterpreterState *current_interpreter = PyThreadState_Get()->interp; + if (!main_interpreter) { + main_interpreter = current_interpreter; + } else if (unlikely(main_interpreter != current_interpreter)) + #endif + { + PyErr_SetString( + PyExc_ImportError, + "Interpreter change detected - this module can only be loaded into one interpreter per process."); + return -1; + } + return 0; +} +static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) { + PyObject *value = PyObject_GetAttrString(spec, from_name); + int result = 0; + if (likely(value)) { + if (allow_none || value != Py_None) { + result = PyDict_SetItemString(moddict, to_name, value); + } + Py_DECREF(value); + } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_Clear(); + } else { + result = -1; + } + return result; +} +static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) { + PyObject *module = NULL, *moddict, *modname; + if (__Pyx_check_single_interpreter()) + return NULL; + if (__pyx_m) + return __Pyx_NewRef(__pyx_m); + modname = PyObject_GetAttrString(spec, "name"); + if (unlikely(!modname)) goto bad; + module = PyModule_NewObject(modname); + Py_DECREF(modname); + if (unlikely(!module)) goto bad; + moddict = PyModule_GetDict(module); + if (unlikely(!moddict)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad; + return module; +bad: + Py_XDECREF(module); + return NULL; +} + + +static CYTHON_SMALL_CODE int __pyx_pymod_exec___waiter(PyObject *__pyx_pyinit_module) +#endif +#endif +{ + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannyDeclarations + #if CYTHON_PEP489_MULTI_PHASE_INIT + if (__pyx_m) { + if (__pyx_m == __pyx_pyinit_module) return 0; + PyErr_SetString(PyExc_RuntimeError, "Module '__waiter' has already been imported. Re-initialisation is not supported."); + return -1; + } + #elif PY_MAJOR_VERSION >= 3 + if (__pyx_m) return __Pyx_NewRef(__pyx_m); + #endif + #if CYTHON_REFNANNY +__Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); +if (!__Pyx_RefNanny) { + PyErr_Clear(); + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); + if (!__Pyx_RefNanny) + Py_FatalError("failed to import 'refnanny' module"); +} +#endif + __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit___waiter(void)", 0); + if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #ifdef __Pxy_PyFrame_Initialize_Offsets + __Pxy_PyFrame_Initialize_Offsets(); + #endif + __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) + #ifdef __Pyx_CyFunction_USED + if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_FusedFunction_USED + if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_Coroutine_USED + if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_Generator_USED + if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_AsyncGen_USED + if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_StopAsyncIteration_USED + if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + /*--- Library function declarations ---*/ + /*--- Threads initialization code ---*/ + #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS + #ifdef WITH_THREAD /* Python build with threading support? */ + PyEval_InitThreads(); + #endif + #endif + /*--- Module creation code ---*/ + #if CYTHON_PEP489_MULTI_PHASE_INIT + __pyx_m = __pyx_pyinit_module; + Py_INCREF(__pyx_m); + #else + #if PY_MAJOR_VERSION < 3 + __pyx_m = Py_InitModule4("__waiter", __pyx_methods, __pyx_k_Low_level_waiting_primitives, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); + #else + __pyx_m = PyModule_Create(&__pyx_moduledef); + #endif + if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) + Py_INCREF(__pyx_d); + __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) + #if CYTHON_COMPILING_IN_PYPY + Py_INCREF(__pyx_b); + #endif + if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + /*--- Initialize various global constants etc. ---*/ + if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) + if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + if (__pyx_module_is_main_gevent____waiter) { + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + } + #if PY_MAJOR_VERSION >= 3 + { + PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) + if (!PyDict_GetItemString(modules, "gevent.__waiter")) { + if (unlikely(PyDict_SetItemString(modules, "gevent.__waiter", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error) + } + } + #endif + /*--- Builtin init code ---*/ + if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + /*--- Constants init code ---*/ + if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + /*--- Global type/function init code ---*/ + (void)__Pyx_modinit_global_init_code(); + if (unlikely(__Pyx_modinit_variable_export_code() != 0)) goto __pyx_L1_error; + (void)__Pyx_modinit_function_export_code(); + if (unlikely(__Pyx_modinit_type_init_code() != 0)) goto __pyx_L1_error; + if (unlikely(__Pyx_modinit_type_import_code() != 0)) goto __pyx_L1_error; + if (unlikely(__Pyx_modinit_variable_import_code() != 0)) goto __pyx_L1_error; + if (unlikely(__Pyx_modinit_function_import_code() != 0)) goto __pyx_L1_error; + /*--- Execution code ---*/ + #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) + if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + + /* "src/gevent/_waiter.py":12 + * from __future__ import print_function + * + * import sys # <<<<<<<<<<<<<< + * + * from gevent._hub_local import get_hub_noargs as get_hub + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_sys, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_v_6gevent_8__waiter_sys); + __Pyx_DECREF_SET(__pyx_v_6gevent_8__waiter_sys, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + + /* "src/gevent/_waiter.py":14 + * import sys + * + * from gevent._hub_local import get_hub_noargs as get_hub # <<<<<<<<<<<<<< + * from gevent.exceptions import ConcurrentObjectUseError + * + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 14, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_get_hub_noargs); + __Pyx_GIVEREF(__pyx_n_s_get_hub_noargs); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_get_hub_noargs); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_gevent__hub_local, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 14, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_get_hub_noargs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 14, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_hub_noargs, __pyx_t_1) < 0) __PYX_ERR(0, 14, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/_waiter.py":15 + * + * from gevent._hub_local import get_hub_noargs as get_hub + * from gevent.exceptions import ConcurrentObjectUseError # <<<<<<<<<<<<<< + * + * __all__ = [ + */ + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 15, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_ConcurrentObjectUseError); + __Pyx_GIVEREF(__pyx_n_s_ConcurrentObjectUseError); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_ConcurrentObjectUseError); + __pyx_t_1 = __Pyx_Import(__pyx_n_s_gevent_exceptions, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 15, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_ConcurrentObjectUseError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 15, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_v_6gevent_8__waiter_ConcurrentObjectUseError); + __Pyx_DECREF_SET(__pyx_v_6gevent_8__waiter_ConcurrentObjectUseError, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_waiter.py":17 + * from gevent.exceptions import ConcurrentObjectUseError + * + * __all__ = [ # <<<<<<<<<<<<<< + * 'Waiter', + * ] + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 17, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_Waiter); + __Pyx_GIVEREF(__pyx_n_s_Waiter); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_Waiter); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_all, __pyx_t_1) < 0) __PYX_ERR(0, 17, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_waiter.py":21 + * ] + * + * _NONE = object() # <<<<<<<<<<<<<< + * + * locals()['getcurrent'] = __import__('greenlet').getcurrent + */ + __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_builtin_object); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 21, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_v_6gevent_8__waiter__NONE); + __Pyx_DECREF_SET(__pyx_v_6gevent_8__waiter__NONE, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + + /* "src/gevent/_waiter.py":23 + * _NONE = object() + * + * locals()['getcurrent'] = __import__('greenlet').getcurrent # <<<<<<<<<<<<<< + * locals()['greenlet_init'] = lambda: None + * + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin___import__, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 23, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_getcurrent); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 23, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_Globals(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 23, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (unlikely(PyDict_SetItem(__pyx_t_1, __pyx_n_s_getcurrent, __pyx_t_2) < 0)) __PYX_ERR(0, 23, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/_waiter.py":24 + * + * locals()['getcurrent'] = __import__('greenlet').getcurrent + * locals()['greenlet_init'] = lambda: None # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_8__waiter_2lambda, 0, __pyx_n_s_lambda, NULL, __pyx_n_s_gevent___waiter, __pyx_d, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 24, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_Globals(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 24, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (unlikely(PyDict_SetItem(__pyx_t_1, __pyx_n_s_greenlet_init, __pyx_t_2) < 0)) __PYX_ERR(0, 24, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/_waiter.py":68 + * """ + * + * __slots__ = ['hub', 'greenlet', 'value', '_exception'] # <<<<<<<<<<<<<< + * + * def __init__(self, hub=None): + */ + __pyx_t_2 = PyList_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 68, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_hub); + __Pyx_GIVEREF(__pyx_n_s_hub); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_hub); + __Pyx_INCREF(__pyx_n_s_greenlet); + __Pyx_GIVEREF(__pyx_n_s_greenlet); + PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_greenlet); + __Pyx_INCREF(__pyx_n_s_value); + __Pyx_GIVEREF(__pyx_n_s_value); + PyList_SET_ITEM(__pyx_t_2, 2, __pyx_n_s_value); + __Pyx_INCREF(__pyx_n_s_exception_2); + __Pyx_GIVEREF(__pyx_n_s_exception_2); + PyList_SET_ITEM(__pyx_t_2, 3, __pyx_n_s_exception_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_8__waiter_Waiter->tp_dict, __pyx_n_s_slots, __pyx_t_2) < 0) __PYX_ERR(0, 68, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_8__waiter_Waiter); + + /* "src/gevent/_waiter.py":76 + * self._exception = _NONE + * + * def clear(self): # <<<<<<<<<<<<<< + * self.greenlet = None + * self.value = None + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_8__waiter_6Waiter_3clear, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Waiter_clear, NULL, __pyx_n_s_gevent___waiter, __pyx_d, ((PyObject *)__pyx_codeobj__4)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 76, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_8__waiter_Waiter->tp_dict, __pyx_n_s_clear, __pyx_t_2) < 0) __PYX_ERR(0, 76, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_8__waiter_Waiter); + + /* "src/gevent/_waiter.py":88 + * return '<%s greenlet=%s exc_info=%r>' % (type(self).__name__, self.greenlet, self.exc_info) + * + * def ready(self): # <<<<<<<<<<<<<< + * """Return true if and only if it holds a value or an exception""" + * return self._exception is not _NONE + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_8__waiter_6Waiter_7ready, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Waiter_ready, NULL, __pyx_n_s_gevent___waiter, __pyx_d, ((PyObject *)__pyx_codeobj__6)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 88, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_8__waiter_Waiter->tp_dict, __pyx_n_s_ready, __pyx_t_2) < 0) __PYX_ERR(0, 88, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_8__waiter_Waiter); + + /* "src/gevent/_waiter.py":92 + * return self._exception is not _NONE + * + * def successful(self): # <<<<<<<<<<<<<< + * """Return true if and only if it is ready and holds a value""" + * return self._exception is None + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_8__waiter_6Waiter_9successful, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Waiter_successful, NULL, __pyx_n_s_gevent___waiter, __pyx_d, ((PyObject *)__pyx_codeobj__8)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 92, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_8__waiter_Waiter->tp_dict, __pyx_n_s_successful, __pyx_t_2) < 0) __PYX_ERR(0, 92, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_8__waiter_Waiter); + + /* "src/gevent/_waiter.py":102 + * return self._exception + * + * def switch(self, value): # <<<<<<<<<<<<<< + * """ + * Switch to the greenlet if one's available. Otherwise store the + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_8__waiter_6Waiter_11switch, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Waiter_switch, NULL, __pyx_n_s_gevent___waiter, __pyx_d, ((PyObject *)__pyx_codeobj__10)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 102, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_8__waiter_Waiter->tp_dict, __pyx_n_s_switch, __pyx_t_2) < 0) __PYX_ERR(0, 102, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_8__waiter_Waiter); + + /* "src/gevent/_waiter.py":123 + * self.hub.handle_error(switch, *sys.exc_info()) + * + * def switch_args(self, *args): # <<<<<<<<<<<<<< + * return self.switch(args) + * + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_8__waiter_6Waiter_13switch_args, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Waiter_switch_args, NULL, __pyx_n_s_gevent___waiter, __pyx_d, ((PyObject *)__pyx_codeobj__12)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 123, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_8__waiter_Waiter->tp_dict, __pyx_n_s_switch_args, __pyx_t_2) < 0) __PYX_ERR(0, 123, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_8__waiter_Waiter); + + /* "src/gevent/_waiter.py":126 + * return self.switch(args) + * + * def throw(self, *throw_args): # <<<<<<<<<<<<<< + * """Switch to the greenlet with the exception. If there's no greenlet, store the exception.""" + * greenlet = self.greenlet + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_8__waiter_6Waiter_15throw, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Waiter_throw, NULL, __pyx_n_s_gevent___waiter, __pyx_d, ((PyObject *)__pyx_codeobj__14)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 126, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_8__waiter_Waiter->tp_dict, __pyx_n_s_throw, __pyx_t_2) < 0) __PYX_ERR(0, 126, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_8__waiter_Waiter); + + /* "src/gevent/_waiter.py":140 + * self.hub.handle_error(throw, *sys.exc_info()) + * + * def get(self): # <<<<<<<<<<<<<< + * """If a value/an exception is stored, return/raise it. Otherwise until switch() or throw() is called.""" + * if self._exception is not _NONE: + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_8__waiter_6Waiter_17get, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Waiter_get, NULL, __pyx_n_s_gevent___waiter, __pyx_d, ((PyObject *)__pyx_codeobj__16)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 140, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_8__waiter_Waiter->tp_dict, __pyx_n_s_get, __pyx_t_2) < 0) __PYX_ERR(0, 140, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_8__waiter_Waiter); + + /* "src/gevent/_waiter.py":175 + * This does not handle exceptions or throw methods. + * """ + * __slots__ = ['_values'] # <<<<<<<<<<<<<< + * + * def __init__(self, hub=None): + */ + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 175, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_values); + __Pyx_GIVEREF(__pyx_n_s_values); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_values); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_8__waiter_MultipleWaiter->tp_dict, __pyx_n_s_slots, __pyx_t_2) < 0) __PYX_ERR(0, 175, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_8__waiter_MultipleWaiter); + + /* "src/gevent/_waiter.py":186 + * self._values = list() + * + * def switch(self, value): # <<<<<<<<<<<<<< + * self._values.append(value) + * Waiter.switch(self, True) + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_8__waiter_14MultipleWaiter_3switch, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_MultipleWaiter_switch, NULL, __pyx_n_s_gevent___waiter, __pyx_d, ((PyObject *)__pyx_codeobj__18)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 186, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_8__waiter_MultipleWaiter->tp_dict, __pyx_n_s_switch, __pyx_t_2) < 0) __PYX_ERR(0, 186, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_8__waiter_MultipleWaiter); + + /* "src/gevent/_waiter.py":190 + * Waiter.switch(self, True) + * + * def get(self): # <<<<<<<<<<<<<< + * if not self._values: + * Waiter.get(self) + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_8__waiter_14MultipleWaiter_5get, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_MultipleWaiter_get, NULL, __pyx_n_s_gevent___waiter, __pyx_d, ((PyObject *)__pyx_codeobj__20)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 190, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_8__waiter_MultipleWaiter->tp_dict, __pyx_n_s_get, __pyx_t_2) < 0) __PYX_ERR(0, 190, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_8__waiter_MultipleWaiter); + + /* "src/gevent/_waiter.py":197 + * return self._values.pop(0) + * + * def _init(): # <<<<<<<<<<<<<< + * greenlet_init() # pylint:disable=undefined-variable + * + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_8__waiter_1_init, 0, __pyx_n_s_init_2, NULL, __pyx_n_s_gevent___waiter, __pyx_d, ((PyObject *)__pyx_codeobj__21)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 197, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_init_2, __pyx_t_2) < 0) __PYX_ERR(0, 197, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/_waiter.py":200 + * greenlet_init() # pylint:disable=undefined-variable + * + * _init() # <<<<<<<<<<<<<< + * + * + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_init_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 200, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 200, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_waiter.py":203 + * + * + * from gevent._util import import_c_accel # <<<<<<<<<<<<<< + * import_c_accel(globals(), 'gevent.__waiter') + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 203, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_import_c_accel); + __Pyx_GIVEREF(__pyx_n_s_import_c_accel); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_import_c_accel); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_gevent__util, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 203, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_import_c_accel); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 203, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_import_c_accel, __pyx_t_1) < 0) __PYX_ERR(0, 203, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/_waiter.py":204 + * + * from gevent._util import import_c_accel + * import_c_accel(globals(), 'gevent.__waiter') # <<<<<<<<<<<<<< + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_import_c_accel); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 204, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_Globals(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 204, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 204, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_INCREF(__pyx_n_s_gevent___waiter); + __Pyx_GIVEREF(__pyx_n_s_gevent___waiter); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_n_s_gevent___waiter); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 204, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_waiter.py":1 + * # -*- coding: utf-8 -*- # <<<<<<<<<<<<<< + * # copyright 2018 gevent + * # cython: auto_pickle=False,embedsignature=True,always_allow_keywords=False + */ + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "gevent/__waiter.pxd":27 + * return PyGreenlet_GetCurrent() + * + * cdef inline void greenlet_init(): # <<<<<<<<<<<<<< + * global _greenlet_imported + * if not _greenlet_imported: + */ + + /*--- Wrapped vars code ---*/ + + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + if (__pyx_m) { + if (__pyx_d) { + __Pyx_AddTraceback("init gevent.__waiter", __pyx_clineno, __pyx_lineno, __pyx_filename); + } + Py_CLEAR(__pyx_m); + } else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_ImportError, "init gevent.__waiter"); + } + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + #if CYTHON_PEP489_MULTI_PHASE_INIT + return (__pyx_m != NULL) ? 0 : -1; + #elif PY_MAJOR_VERSION >= 3 + return __pyx_m; + #else + return; + #endif +} + +/* --- Runtime support code --- */ +/* Refnanny */ +#if CYTHON_REFNANNY +static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { + PyObject *m = NULL, *p = NULL; + void *r = NULL; + m = PyImport_ImportModule(modname); + if (!m) goto end; + p = PyObject_GetAttrString(m, "RefNannyAPI"); + if (!p) goto end; + r = PyLong_AsVoidPtr(p); +end: + Py_XDECREF(p); + Py_XDECREF(m); + return (__Pyx_RefNannyAPIStruct *)r; +} +#endif + +/* PyObjectGetAttrStr */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_getattro)) + return tp->tp_getattro(obj, attr_name); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_getattr)) + return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); +#endif + return PyObject_GetAttr(obj, attr_name); +} +#endif + +/* GetBuiltinName */ +static PyObject *__Pyx_GetBuiltinName(PyObject *name) { + PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name); + if (unlikely(!result)) { + PyErr_Format(PyExc_NameError, +#if PY_MAJOR_VERSION >= 3 + "name '%U' is not defined", name); +#else + "name '%.200s' is not defined", PyString_AS_STRING(name)); +#endif + } + return result; +} + +/* RaiseDoubleKeywords */ +static void __Pyx_RaiseDoubleKeywordsError( + const char* func_name, + PyObject* kw_name) +{ + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION >= 3 + "%s() got multiple values for keyword argument '%U'", func_name, kw_name); + #else + "%s() got multiple values for keyword argument '%s'", func_name, + PyString_AsString(kw_name)); + #endif +} + +/* ParseKeywords */ +static int __Pyx_ParseOptionalKeywords( + PyObject *kwds, + PyObject **argnames[], + PyObject *kwds2, + PyObject *values[], + Py_ssize_t num_pos_args, + const char* function_name) +{ + PyObject *key = 0, *value = 0; + Py_ssize_t pos = 0; + PyObject*** name; + PyObject*** first_kw_arg = argnames + num_pos_args; + while (PyDict_Next(kwds, &pos, &key, &value)) { + name = first_kw_arg; + while (*name && (**name != key)) name++; + if (*name) { + values[name-argnames] = value; + continue; + } + name = first_kw_arg; + #if PY_MAJOR_VERSION < 3 + if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) { + while (*name) { + if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) + && _PyString_Eq(**name, key)) { + values[name-argnames] = value; + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + if ((**argname == key) || ( + (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) + && _PyString_Eq(**argname, key))) { + goto arg_passed_twice; + } + argname++; + } + } + } else + #endif + if (likely(PyUnicode_Check(key))) { + while (*name) { + int cmp = (**name == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 : + #endif + PyUnicode_Compare(**name, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) { + values[name-argnames] = value; + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + int cmp = (**argname == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 : + #endif + PyUnicode_Compare(**argname, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) goto arg_passed_twice; + argname++; + } + } + } else + goto invalid_keyword_type; + if (kwds2) { + if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; + } else { + goto invalid_keyword; + } + } + return 0; +arg_passed_twice: + __Pyx_RaiseDoubleKeywordsError(function_name, key); + goto bad; +invalid_keyword_type: + PyErr_Format(PyExc_TypeError, + "%.200s() keywords must be strings", function_name); + goto bad; +invalid_keyword: + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION < 3 + "%.200s() got an unexpected keyword argument '%.200s'", + function_name, PyString_AsString(key)); + #else + "%s() got an unexpected keyword argument '%U'", + function_name, key); + #endif +bad: + return -1; +} + +/* RaiseArgTupleInvalid */ +static void __Pyx_RaiseArgtupleInvalid( + const char* func_name, + int exact, + Py_ssize_t num_min, + Py_ssize_t num_max, + Py_ssize_t num_found) +{ + Py_ssize_t num_expected; + const char *more_or_less; + if (num_found < num_min) { + num_expected = num_min; + more_or_less = "at least"; + } else { + num_expected = num_max; + more_or_less = "at most"; + } + if (exact) { + more_or_less = "exactly"; + } + PyErr_Format(PyExc_TypeError, + "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", + func_name, more_or_less, num_expected, + (num_expected == 1) ? "" : "s", num_found); +} + +/* ExtTypeTest */ +static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { + if (unlikely(!type)) { + PyErr_SetString(PyExc_SystemError, "Missing type object"); + return 0; + } + if (likely(__Pyx_TypeCheck(obj, type))) + return 1; + PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s", + Py_TYPE(obj)->tp_name, type->tp_name); + return 0; +} + +/* PyFunctionFastCall */ +#if CYTHON_FAST_PYCALL +static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, + PyObject *globals) { + PyFrameObject *f; + PyThreadState *tstate = __Pyx_PyThreadState_Current; + PyObject **fastlocals; + Py_ssize_t i; + PyObject *result; + assert(globals != NULL); + /* XXX Perhaps we should create a specialized + PyFrame_New() that doesn't take locals, but does + take builtins without sanity checking them. + */ + assert(tstate != NULL); + f = PyFrame_New(tstate, co, globals, NULL); + if (f == NULL) { + return NULL; + } + fastlocals = __Pyx_PyFrame_GetLocalsplus(f); + for (i = 0; i < na; i++) { + Py_INCREF(*args); + fastlocals[i] = *args++; + } + result = PyEval_EvalFrameEx(f,0); + ++tstate->recursion_depth; + Py_DECREF(f); + --tstate->recursion_depth; + return result; +} +#if 1 || PY_VERSION_HEX < 0x030600B1 +static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs) { + PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); + PyObject *globals = PyFunction_GET_GLOBALS(func); + PyObject *argdefs = PyFunction_GET_DEFAULTS(func); + PyObject *closure; +#if PY_MAJOR_VERSION >= 3 + PyObject *kwdefs; +#endif + PyObject *kwtuple, **k; + PyObject **d; + Py_ssize_t nd; + Py_ssize_t nk; + PyObject *result; + assert(kwargs == NULL || PyDict_Check(kwargs)); + nk = kwargs ? PyDict_Size(kwargs) : 0; + if (Py_EnterRecursiveCall((char*)" while calling a Python object")) { + return NULL; + } + if ( +#if PY_MAJOR_VERSION >= 3 + co->co_kwonlyargcount == 0 && +#endif + likely(kwargs == NULL || nk == 0) && + co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { + if (argdefs == NULL && co->co_argcount == nargs) { + result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); + goto done; + } + else if (nargs == 0 && argdefs != NULL + && co->co_argcount == Py_SIZE(argdefs)) { + /* function called with no arguments, but all parameters have + a default value: use default values as arguments .*/ + args = &PyTuple_GET_ITEM(argdefs, 0); + result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); + goto done; + } + } + if (kwargs != NULL) { + Py_ssize_t pos, i; + kwtuple = PyTuple_New(2 * nk); + if (kwtuple == NULL) { + result = NULL; + goto done; + } + k = &PyTuple_GET_ITEM(kwtuple, 0); + pos = i = 0; + while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { + Py_INCREF(k[i]); + Py_INCREF(k[i+1]); + i += 2; + } + nk = i / 2; + } + else { + kwtuple = NULL; + k = NULL; + } + closure = PyFunction_GET_CLOSURE(func); +#if PY_MAJOR_VERSION >= 3 + kwdefs = PyFunction_GET_KW_DEFAULTS(func); +#endif + if (argdefs != NULL) { + d = &PyTuple_GET_ITEM(argdefs, 0); + nd = Py_SIZE(argdefs); + } + else { + d = NULL; + nd = 0; + } +#if PY_MAJOR_VERSION >= 3 + result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, + args, nargs, + k, (int)nk, + d, (int)nd, kwdefs, closure); +#else + result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, + args, nargs, + k, (int)nk, + d, (int)nd, closure); +#endif + Py_XDECREF(kwtuple); +done: + Py_LeaveRecursiveCall(); + return result; +} +#endif +#endif + +/* PyObjectCall */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { + PyObject *result; + ternaryfunc call = func->ob_type->tp_call; + if (unlikely(!call)) + return PyObject_Call(func, arg, kw); + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; + result = (*call)(func, arg, kw); + Py_LeaveRecursiveCall(); + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +/* PyObjectCallMethO */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { + PyObject *self, *result; + PyCFunction cfunc; + cfunc = PyCFunction_GET_FUNCTION(func); + self = PyCFunction_GET_SELF(func); + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; + result = cfunc(self, arg); + Py_LeaveRecursiveCall(); + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +/* PyObjectCallNoArg */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { +#if CYTHON_FAST_PYCALL + if (PyFunction_Check(func)) { + return __Pyx_PyFunction_FastCall(func, NULL, 0); + } +#endif +#ifdef __Pyx_CyFunction_USED + if (likely(PyCFunction_Check(func) || __Pyx_CyFunction_Check(func))) +#else + if (likely(PyCFunction_Check(func))) +#endif + { + if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) { + return __Pyx_PyObject_CallMethO(func, NULL); + } + } + return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL); +} +#endif + +/* PyCFunctionFastCall */ +#if CYTHON_FAST_PYCCALL +static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) { + PyCFunctionObject *func = (PyCFunctionObject*)func_obj; + PyCFunction meth = PyCFunction_GET_FUNCTION(func); + PyObject *self = PyCFunction_GET_SELF(func); + int flags = PyCFunction_GET_FLAGS(func); + assert(PyCFunction_Check(func)); + assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS))); + assert(nargs >= 0); + assert(nargs == 0 || args != NULL); + /* _PyCFunction_FastCallDict() must not be called with an exception set, + because it may clear it (directly or indirectly) and so the + caller loses its exception */ + assert(!PyErr_Occurred()); + if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) { + return (*((__Pyx_PyCFunctionFastWithKeywords)(void*)meth)) (self, args, nargs, NULL); + } else { + return (*((__Pyx_PyCFunctionFast)(void*)meth)) (self, args, nargs); + } +} +#endif + +/* PyObjectCallOneArg */ +#if CYTHON_COMPILING_IN_CPYTHON +static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) { + PyObject *result; + PyObject *args = PyTuple_New(1); + if (unlikely(!args)) return NULL; + Py_INCREF(arg); + PyTuple_SET_ITEM(args, 0, arg); + result = __Pyx_PyObject_Call(func, args, NULL); + Py_DECREF(args); + return result; +} +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { +#if CYTHON_FAST_PYCALL + if (PyFunction_Check(func)) { + return __Pyx_PyFunction_FastCall(func, &arg, 1); + } +#endif + if (likely(PyCFunction_Check(func))) { + if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) { + return __Pyx_PyObject_CallMethO(func, arg); +#if CYTHON_FAST_PYCCALL + } else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) { + return __Pyx_PyCFunction_FastCall(func, &arg, 1); +#endif + } + } + return __Pyx__PyObject_CallOneArg(func, arg); +} +#else +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { + PyObject *result; + PyObject *args = PyTuple_Pack(1, arg); + if (unlikely(!args)) return NULL; + result = __Pyx_PyObject_Call(func, args, NULL); + Py_DECREF(args); + return result; +} +#endif + +/* PyErrFetchRestore */ +#if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + tmp_type = tstate->curexc_type; + tmp_value = tstate->curexc_value; + tmp_tb = tstate->curexc_traceback; + tstate->curexc_type = type; + tstate->curexc_value = value; + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +} +static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { + *type = tstate->curexc_type; + *value = tstate->curexc_value; + *tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +} +#endif + +/* RaiseException */ +#if PY_MAJOR_VERSION < 3 +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, + CYTHON_UNUSED PyObject *cause) { + __Pyx_PyThreadState_declare + Py_XINCREF(type); + if (!value || value == Py_None) + value = NULL; + else + Py_INCREF(value); + if (!tb || tb == Py_None) + tb = NULL; + else { + Py_INCREF(tb); + if (!PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto raise_error; + } + } + if (PyType_Check(type)) { +#if CYTHON_COMPILING_IN_PYPY + if (!value) { + Py_INCREF(Py_None); + value = Py_None; + } +#endif + PyErr_NormalizeException(&type, &value, &tb); + } else { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto raise_error; + } + value = type; + type = (PyObject*) Py_TYPE(type); + Py_INCREF(type); + if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto raise_error; + } + } + __Pyx_PyThreadState_assign + __Pyx_ErrRestore(type, value, tb); + return; +raise_error: + Py_XDECREF(value); + Py_XDECREF(type); + Py_XDECREF(tb); + return; +} +#else +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { + PyObject* owned_instance = NULL; + if (tb == Py_None) { + tb = 0; + } else if (tb && !PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto bad; + } + if (value == Py_None) + value = 0; + if (PyExceptionInstance_Check(type)) { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto bad; + } + value = type; + type = (PyObject*) Py_TYPE(value); + } else if (PyExceptionClass_Check(type)) { + PyObject *instance_class = NULL; + if (value && PyExceptionInstance_Check(value)) { + instance_class = (PyObject*) Py_TYPE(value); + if (instance_class != type) { + int is_subclass = PyObject_IsSubclass(instance_class, type); + if (!is_subclass) { + instance_class = NULL; + } else if (unlikely(is_subclass == -1)) { + goto bad; + } else { + type = instance_class; + } + } + } + if (!instance_class) { + PyObject *args; + if (!value) + args = PyTuple_New(0); + else if (PyTuple_Check(value)) { + Py_INCREF(value); + args = value; + } else + args = PyTuple_Pack(1, value); + if (!args) + goto bad; + owned_instance = PyObject_Call(type, args, NULL); + Py_DECREF(args); + if (!owned_instance) + goto bad; + value = owned_instance; + if (!PyExceptionInstance_Check(value)) { + PyErr_Format(PyExc_TypeError, + "calling %R should have returned an instance of " + "BaseException, not %R", + type, Py_TYPE(value)); + goto bad; + } + } + } else { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto bad; + } + if (cause) { + PyObject *fixed_cause; + if (cause == Py_None) { + fixed_cause = NULL; + } else if (PyExceptionClass_Check(cause)) { + fixed_cause = PyObject_CallObject(cause, NULL); + if (fixed_cause == NULL) + goto bad; + } else if (PyExceptionInstance_Check(cause)) { + fixed_cause = cause; + Py_INCREF(fixed_cause); + } else { + PyErr_SetString(PyExc_TypeError, + "exception causes must derive from " + "BaseException"); + goto bad; + } + PyException_SetCause(value, fixed_cause); + } + PyErr_SetObject(type, value); + if (tb) { +#if CYTHON_COMPILING_IN_PYPY + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); + Py_INCREF(tb); + PyErr_Restore(tmp_type, tmp_value, tb); + Py_XDECREF(tmp_tb); +#else + PyThreadState *tstate = __Pyx_PyThreadState_Current; + PyObject* tmp_tb = tstate->curexc_traceback; + if (tb != tmp_tb) { + Py_INCREF(tb); + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_tb); + } +#endif + } +bad: + Py_XDECREF(owned_instance); + return; +} +#endif + +/* PyObjectCall2Args */ +static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) { + PyObject *args, *result = NULL; + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(function)) { + PyObject *args[2] = {arg1, arg2}; + return __Pyx_PyFunction_FastCall(function, args, 2); + } + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(function)) { + PyObject *args[2] = {arg1, arg2}; + return __Pyx_PyCFunction_FastCall(function, args, 2); + } + #endif + args = PyTuple_New(2); + if (unlikely(!args)) goto done; + Py_INCREF(arg1); + PyTuple_SET_ITEM(args, 0, arg1); + Py_INCREF(arg2); + PyTuple_SET_ITEM(args, 1, arg2); + Py_INCREF(function); + result = __Pyx_PyObject_Call(function, args, NULL); + Py_DECREF(args); + Py_DECREF(function); +done: + return result; +} + +/* GetTopmostException */ +#if CYTHON_USE_EXC_INFO_STACK +static _PyErr_StackItem * +__Pyx_PyErr_GetTopmostException(PyThreadState *tstate) +{ + _PyErr_StackItem *exc_info = tstate->exc_info; + while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) && + exc_info->previous_item != NULL) + { + exc_info = exc_info->previous_item; + } + return exc_info; +} +#endif + +/* SaveResetException */ +#if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { + #if CYTHON_USE_EXC_INFO_STACK + _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate); + *type = exc_info->exc_type; + *value = exc_info->exc_value; + *tb = exc_info->exc_traceback; + #else + *type = tstate->exc_type; + *value = tstate->exc_value; + *tb = tstate->exc_traceback; + #endif + Py_XINCREF(*type); + Py_XINCREF(*value); + Py_XINCREF(*tb); +} +static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + #if CYTHON_USE_EXC_INFO_STACK + _PyErr_StackItem *exc_info = tstate->exc_info; + tmp_type = exc_info->exc_type; + tmp_value = exc_info->exc_value; + tmp_tb = exc_info->exc_traceback; + exc_info->exc_type = type; + exc_info->exc_value = value; + exc_info->exc_traceback = tb; + #else + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = type; + tstate->exc_value = value; + tstate->exc_traceback = tb; + #endif + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +} +#endif + +/* GetException */ +#if CYTHON_FAST_THREAD_STATE +static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) +#else +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) +#endif +{ + PyObject *local_type, *local_value, *local_tb; +#if CYTHON_FAST_THREAD_STATE + PyObject *tmp_type, *tmp_value, *tmp_tb; + local_type = tstate->curexc_type; + local_value = tstate->curexc_value; + local_tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +#else + PyErr_Fetch(&local_type, &local_value, &local_tb); +#endif + PyErr_NormalizeException(&local_type, &local_value, &local_tb); +#if CYTHON_FAST_THREAD_STATE + if (unlikely(tstate->curexc_type)) +#else + if (unlikely(PyErr_Occurred())) +#endif + goto bad; + #if PY_MAJOR_VERSION >= 3 + if (local_tb) { + if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) + goto bad; + } + #endif + Py_XINCREF(local_tb); + Py_XINCREF(local_type); + Py_XINCREF(local_value); + *type = local_type; + *value = local_value; + *tb = local_tb; +#if CYTHON_FAST_THREAD_STATE + #if CYTHON_USE_EXC_INFO_STACK + { + _PyErr_StackItem *exc_info = tstate->exc_info; + tmp_type = exc_info->exc_type; + tmp_value = exc_info->exc_value; + tmp_tb = exc_info->exc_traceback; + exc_info->exc_type = local_type; + exc_info->exc_value = local_value; + exc_info->exc_traceback = local_tb; + } + #else + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = local_type; + tstate->exc_value = local_value; + tstate->exc_traceback = local_tb; + #endif + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#else + PyErr_SetExcInfo(local_type, local_value, local_tb); +#endif + return 0; +bad: + *type = 0; + *value = 0; + *tb = 0; + Py_XDECREF(local_type); + Py_XDECREF(local_value); + Py_XDECREF(local_tb); + return -1; +} + +/* KeywordStringCheck */ +static int __Pyx_CheckKeywordStrings( + PyObject *kwdict, + const char* function_name, + int kw_allowed) +{ + PyObject* key = 0; + Py_ssize_t pos = 0; +#if CYTHON_COMPILING_IN_PYPY + if (!kw_allowed && PyDict_Next(kwdict, &pos, &key, 0)) + goto invalid_keyword; + return 1; +#else + while (PyDict_Next(kwdict, &pos, &key, 0)) { + #if PY_MAJOR_VERSION < 3 + if (unlikely(!PyString_Check(key))) + #endif + if (unlikely(!PyUnicode_Check(key))) + goto invalid_keyword_type; + } + if ((!kw_allowed) && unlikely(key)) + goto invalid_keyword; + return 1; +invalid_keyword_type: + PyErr_Format(PyExc_TypeError, + "%.200s() keywords must be strings", function_name); + return 0; +#endif +invalid_keyword: + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION < 3 + "%.200s() got an unexpected keyword argument '%.200s'", + function_name, PyString_AsString(key)); + #else + "%s() got an unexpected keyword argument '%U'", + function_name, key); + #endif + return 0; +} + +/* SwapException */ +#if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + #if CYTHON_USE_EXC_INFO_STACK + _PyErr_StackItem *exc_info = tstate->exc_info; + tmp_type = exc_info->exc_type; + tmp_value = exc_info->exc_value; + tmp_tb = exc_info->exc_traceback; + exc_info->exc_type = *type; + exc_info->exc_value = *value; + exc_info->exc_traceback = *tb; + #else + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = *type; + tstate->exc_value = *value; + tstate->exc_traceback = *tb; + #endif + *type = tmp_type; + *value = tmp_value; + *tb = tmp_tb; +} +#else +static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb); + PyErr_SetExcInfo(*type, *value, *tb); + *type = tmp_type; + *value = tmp_value; + *tb = tmp_tb; +} +#endif + +/* PyObjectGetMethod */ +static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method) { + PyObject *attr; +#if CYTHON_UNPACK_METHODS && CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_PYTYPE_LOOKUP + PyTypeObject *tp = Py_TYPE(obj); + PyObject *descr; + descrgetfunc f = NULL; + PyObject **dictptr, *dict; + int meth_found = 0; + assert (*method == NULL); + if (unlikely(tp->tp_getattro != PyObject_GenericGetAttr)) { + attr = __Pyx_PyObject_GetAttrStr(obj, name); + goto try_unpack; + } + if (unlikely(tp->tp_dict == NULL) && unlikely(PyType_Ready(tp) < 0)) { + return 0; + } + descr = _PyType_Lookup(tp, name); + if (likely(descr != NULL)) { + Py_INCREF(descr); +#if PY_MAJOR_VERSION >= 3 + #ifdef __Pyx_CyFunction_USED + if (likely(PyFunction_Check(descr) || (Py_TYPE(descr) == &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr))) + #else + if (likely(PyFunction_Check(descr) || (Py_TYPE(descr) == &PyMethodDescr_Type))) + #endif +#else + #ifdef __Pyx_CyFunction_USED + if (likely(PyFunction_Check(descr) || __Pyx_CyFunction_Check(descr))) + #else + if (likely(PyFunction_Check(descr))) + #endif +#endif + { + meth_found = 1; + } else { + f = Py_TYPE(descr)->tp_descr_get; + if (f != NULL && PyDescr_IsData(descr)) { + attr = f(descr, obj, (PyObject *)Py_TYPE(obj)); + Py_DECREF(descr); + goto try_unpack; + } + } + } + dictptr = _PyObject_GetDictPtr(obj); + if (dictptr != NULL && (dict = *dictptr) != NULL) { + Py_INCREF(dict); + attr = __Pyx_PyDict_GetItemStr(dict, name); + if (attr != NULL) { + Py_INCREF(attr); + Py_DECREF(dict); + Py_XDECREF(descr); + goto try_unpack; + } + Py_DECREF(dict); + } + if (meth_found) { + *method = descr; + return 1; + } + if (f != NULL) { + attr = f(descr, obj, (PyObject *)Py_TYPE(obj)); + Py_DECREF(descr); + goto try_unpack; + } + if (descr != NULL) { + *method = descr; + return 0; + } + PyErr_Format(PyExc_AttributeError, +#if PY_MAJOR_VERSION >= 3 + "'%.50s' object has no attribute '%U'", + tp->tp_name, name); +#else + "'%.50s' object has no attribute '%.400s'", + tp->tp_name, PyString_AS_STRING(name)); +#endif + return 0; +#else + attr = __Pyx_PyObject_GetAttrStr(obj, name); + goto try_unpack; +#endif +try_unpack: +#if CYTHON_UNPACK_METHODS + if (likely(attr) && PyMethod_Check(attr) && likely(PyMethod_GET_SELF(attr) == obj)) { + PyObject *function = PyMethod_GET_FUNCTION(attr); + Py_INCREF(function); + Py_DECREF(attr); + *method = function; + return 1; + } +#endif + *method = attr; + return 0; +} + +/* PyObjectCallMethod1 */ +static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg) { + PyObject *result = __Pyx_PyObject_CallOneArg(method, arg); + Py_DECREF(method); + return result; +} +static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) { + PyObject *method = NULL, *result; + int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method); + if (likely(is_method)) { + result = __Pyx_PyObject_Call2Args(method, obj, arg); + Py_DECREF(method); + return result; + } + if (unlikely(!method)) return NULL; + return __Pyx__PyObject_CallMethod1(method, arg); +} + +/* pop_index */ +static PyObject* __Pyx__PyObject_PopNewIndex(PyObject* L, PyObject* py_ix) { + PyObject *r; + if (unlikely(!py_ix)) return NULL; + r = __Pyx__PyObject_PopIndex(L, py_ix); + Py_DECREF(py_ix); + return r; +} +static PyObject* __Pyx__PyObject_PopIndex(PyObject* L, PyObject* py_ix) { + return __Pyx_PyObject_CallMethod1(L, __pyx_n_s_pop, py_ix); +} +#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS +static PyObject* __Pyx__PyList_PopIndex(PyObject* L, PyObject* py_ix, Py_ssize_t ix) { + Py_ssize_t size = PyList_GET_SIZE(L); + if (likely(size > (((PyListObject*)L)->allocated >> 1))) { + Py_ssize_t cix = ix; + if (cix < 0) { + cix += size; + } + if (likely(__Pyx_is_valid_index(cix, size))) { + PyObject* v = PyList_GET_ITEM(L, cix); + Py_SIZE(L) -= 1; + size -= 1; + memmove(&PyList_GET_ITEM(L, cix), &PyList_GET_ITEM(L, cix+1), (size_t)(size-cix)*sizeof(PyObject*)); + return v; + } + } + if (py_ix == Py_None) { + return __Pyx__PyObject_PopNewIndex(L, PyInt_FromSsize_t(ix)); + } else { + return __Pyx__PyObject_PopIndex(L, py_ix); + } +} +#endif + +/* TypeImport */ +#ifndef __PYX_HAVE_RT_ImportType +#define __PYX_HAVE_RT_ImportType +static PyTypeObject *__Pyx_ImportType(PyObject *module, const char *module_name, const char *class_name, + size_t size, enum __Pyx_ImportType_CheckSize check_size) +{ + PyObject *result = 0; + char warning[200]; + Py_ssize_t basicsize; +#ifdef Py_LIMITED_API + PyObject *py_basicsize; +#endif + result = PyObject_GetAttrString(module, class_name); + if (!result) + goto bad; + if (!PyType_Check(result)) { + PyErr_Format(PyExc_TypeError, + "%.200s.%.200s is not a type object", + module_name, class_name); + goto bad; + } +#ifndef Py_LIMITED_API + basicsize = ((PyTypeObject *)result)->tp_basicsize; +#else + py_basicsize = PyObject_GetAttrString(result, "__basicsize__"); + if (!py_basicsize) + goto bad; + basicsize = PyLong_AsSsize_t(py_basicsize); + Py_DECREF(py_basicsize); + py_basicsize = 0; + if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred()) + goto bad; +#endif + if ((size_t)basicsize < size) { + PyErr_Format(PyExc_ValueError, + "%.200s.%.200s size changed, may indicate binary incompatibility. " + "Expected %zd from C header, got %zd from PyObject", + module_name, class_name, size, basicsize); + goto bad; + } + if (check_size == __Pyx_ImportType_CheckSize_Error && (size_t)basicsize != size) { + PyErr_Format(PyExc_ValueError, + "%.200s.%.200s size changed, may indicate binary incompatibility. " + "Expected %zd from C header, got %zd from PyObject", + module_name, class_name, size, basicsize); + goto bad; + } + else if (check_size == __Pyx_ImportType_CheckSize_Warn && (size_t)basicsize > size) { + PyOS_snprintf(warning, sizeof(warning), + "%s.%s size changed, may indicate binary incompatibility. " + "Expected %zd from C header, got %zd from PyObject", + module_name, class_name, size, basicsize); + if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad; + } + return (PyTypeObject *)result; +bad: + Py_XDECREF(result); + return NULL; +} +#endif + +/* PyObject_GenericGetAttrNoDict */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) { + PyErr_Format(PyExc_AttributeError, +#if PY_MAJOR_VERSION >= 3 + "'%.50s' object has no attribute '%U'", + tp->tp_name, attr_name); +#else + "'%.50s' object has no attribute '%.400s'", + tp->tp_name, PyString_AS_STRING(attr_name)); +#endif + return NULL; +} +static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) { + PyObject *descr; + PyTypeObject *tp = Py_TYPE(obj); + if (unlikely(!PyString_Check(attr_name))) { + return PyObject_GenericGetAttr(obj, attr_name); + } + assert(!tp->tp_dictoffset); + descr = _PyType_Lookup(tp, attr_name); + if (unlikely(!descr)) { + return __Pyx_RaiseGenericGetAttributeError(tp, attr_name); + } + Py_INCREF(descr); + #if PY_MAJOR_VERSION < 3 + if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS))) + #endif + { + descrgetfunc f = Py_TYPE(descr)->tp_descr_get; + if (unlikely(f)) { + PyObject *res = f(descr, obj, (PyObject *)tp); + Py_DECREF(descr); + return res; + } + } + return descr; +} +#endif + +/* PyObject_GenericGetAttr */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) { + if (unlikely(Py_TYPE(obj)->tp_dictoffset)) { + return PyObject_GenericGetAttr(obj, attr_name); + } + return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name); +} +#endif + +/* SetVTable */ +static int __Pyx_SetVtable(PyObject *dict, void *vtable) { +#if PY_VERSION_HEX >= 0x02070000 + PyObject *ob = PyCapsule_New(vtable, 0, 0); +#else + PyObject *ob = PyCObject_FromVoidPtr(vtable, 0); +#endif + if (!ob) + goto bad; + if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0) + goto bad; + Py_DECREF(ob); + return 0; +bad: + Py_XDECREF(ob); + return -1; +} + +/* GetVTable */ +static void* __Pyx_GetVtable(PyObject *dict) { + void* ptr; + PyObject *ob = PyObject_GetItem(dict, __pyx_n_s_pyx_vtable); + if (!ob) + goto bad; +#if PY_VERSION_HEX >= 0x02070000 + ptr = PyCapsule_GetPointer(ob, 0); +#else + ptr = PyCObject_AsVoidPtr(ob); +#endif + if (!ptr && !PyErr_Occurred()) + PyErr_SetString(PyExc_RuntimeError, "invalid vtable found for imported type"); + Py_DECREF(ob); + return ptr; +bad: + Py_XDECREF(ob); + return NULL; +} + +/* Import */ +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { + PyObject *empty_list = 0; + PyObject *module = 0; + PyObject *global_dict = 0; + PyObject *empty_dict = 0; + PyObject *list; + #if PY_MAJOR_VERSION < 3 + PyObject *py_import; + py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); + if (!py_import) + goto bad; + #endif + if (from_list) + list = from_list; + else { + empty_list = PyList_New(0); + if (!empty_list) + goto bad; + list = empty_list; + } + global_dict = PyModule_GetDict(__pyx_m); + if (!global_dict) + goto bad; + empty_dict = PyDict_New(); + if (!empty_dict) + goto bad; + { + #if PY_MAJOR_VERSION >= 3 + if (level == -1) { + if (strchr(__Pyx_MODULE_NAME, '.')) { + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, 1); + if (!module) { + if (!PyErr_ExceptionMatches(PyExc_ImportError)) + goto bad; + PyErr_Clear(); + } + } + level = 0; + } + #endif + if (!module) { + #if PY_MAJOR_VERSION < 3 + PyObject *py_level = PyInt_FromLong(level); + if (!py_level) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, py_level, (PyObject *)NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, level); + #endif + } + } +bad: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(py_import); + #endif + Py_XDECREF(empty_list); + Py_XDECREF(empty_dict); + return module; +} + +/* ImportFrom */ +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { + PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); + if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_Format(PyExc_ImportError, + #if PY_MAJOR_VERSION < 3 + "cannot import name %.230s", PyString_AS_STRING(name)); + #else + "cannot import name %S", name); + #endif + } + return value; +} + +/* FetchCommonType */ +static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { + PyObject* fake_module; + PyTypeObject* cached_type = NULL; + fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI); + if (!fake_module) return NULL; + Py_INCREF(fake_module); + cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name); + if (cached_type) { + if (!PyType_Check((PyObject*)cached_type)) { + PyErr_Format(PyExc_TypeError, + "Shared Cython type %.200s is not a type object", + type->tp_name); + goto bad; + } + if (cached_type->tp_basicsize != type->tp_basicsize) { + PyErr_Format(PyExc_TypeError, + "Shared Cython type %.200s has the wrong size, try recompiling", + type->tp_name); + goto bad; + } + } else { + if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; + PyErr_Clear(); + if (PyType_Ready(type) < 0) goto bad; + if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0) + goto bad; + Py_INCREF(type); + cached_type = type; + } +done: + Py_DECREF(fake_module); + return cached_type; +bad: + Py_XDECREF(cached_type); + cached_type = NULL; + goto done; +} + +/* CythonFunction */ +#include +static PyObject * +__Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure) +{ + if (unlikely(op->func_doc == NULL)) { + if (op->func.m_ml->ml_doc) { +#if PY_MAJOR_VERSION >= 3 + op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc); +#else + op->func_doc = PyString_FromString(op->func.m_ml->ml_doc); +#endif + if (unlikely(op->func_doc == NULL)) + return NULL; + } else { + Py_INCREF(Py_None); + return Py_None; + } + } + Py_INCREF(op->func_doc); + return op->func_doc; +} +static int +__Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context) +{ + PyObject *tmp = op->func_doc; + if (value == NULL) { + value = Py_None; + } + Py_INCREF(value); + op->func_doc = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + if (unlikely(op->func_name == NULL)) { +#if PY_MAJOR_VERSION >= 3 + op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name); +#else + op->func_name = PyString_InternFromString(op->func.m_ml->ml_name); +#endif + if (unlikely(op->func_name == NULL)) + return NULL; + } + Py_INCREF(op->func_name); + return op->func_name; +} +static int +__Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context) +{ + PyObject *tmp; +#if PY_MAJOR_VERSION >= 3 + if (unlikely(value == NULL || !PyUnicode_Check(value))) +#else + if (unlikely(value == NULL || !PyString_Check(value))) +#endif + { + PyErr_SetString(PyExc_TypeError, + "__name__ must be set to a string object"); + return -1; + } + tmp = op->func_name; + Py_INCREF(value); + op->func_name = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + Py_INCREF(op->func_qualname); + return op->func_qualname; +} +static int +__Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context) +{ + PyObject *tmp; +#if PY_MAJOR_VERSION >= 3 + if (unlikely(value == NULL || !PyUnicode_Check(value))) +#else + if (unlikely(value == NULL || !PyString_Check(value))) +#endif + { + PyErr_SetString(PyExc_TypeError, + "__qualname__ must be set to a string object"); + return -1; + } + tmp = op->func_qualname; + Py_INCREF(value); + op->func_qualname = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED void *closure) +{ + PyObject *self; + self = m->func_closure; + if (self == NULL) + self = Py_None; + Py_INCREF(self); + return self; +} +static PyObject * +__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + if (unlikely(op->func_dict == NULL)) { + op->func_dict = PyDict_New(); + if (unlikely(op->func_dict == NULL)) + return NULL; + } + Py_INCREF(op->func_dict); + return op->func_dict; +} +static int +__Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context) +{ + PyObject *tmp; + if (unlikely(value == NULL)) { + PyErr_SetString(PyExc_TypeError, + "function's dictionary may not be deleted"); + return -1; + } + if (unlikely(!PyDict_Check(value))) { + PyErr_SetString(PyExc_TypeError, + "setting function's dictionary to a non-dict"); + return -1; + } + tmp = op->func_dict; + Py_INCREF(value); + op->func_dict = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + Py_INCREF(op->func_globals); + return op->func_globals; +} +static PyObject * +__Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + Py_INCREF(Py_None); + return Py_None; +} +static PyObject * +__Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + PyObject* result = (op->func_code) ? op->func_code : Py_None; + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { + int result = 0; + PyObject *res = op->defaults_getter((PyObject *) op); + if (unlikely(!res)) + return -1; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + op->defaults_tuple = PyTuple_GET_ITEM(res, 0); + Py_INCREF(op->defaults_tuple); + op->defaults_kwdict = PyTuple_GET_ITEM(res, 1); + Py_INCREF(op->defaults_kwdict); + #else + op->defaults_tuple = PySequence_ITEM(res, 0); + if (unlikely(!op->defaults_tuple)) result = -1; + else { + op->defaults_kwdict = PySequence_ITEM(res, 1); + if (unlikely(!op->defaults_kwdict)) result = -1; + } + #endif + Py_DECREF(res); + return result; +} +static int +__Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) { + PyObject* tmp; + if (!value) { + value = Py_None; + } else if (value != Py_None && !PyTuple_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__defaults__ must be set to a tuple object"); + return -1; + } + Py_INCREF(value); + tmp = op->defaults_tuple; + op->defaults_tuple = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) { + PyObject* result = op->defaults_tuple; + if (unlikely(!result)) { + if (op->defaults_getter) { + if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL; + result = op->defaults_tuple; + } else { + result = Py_None; + } + } + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) { + PyObject* tmp; + if (!value) { + value = Py_None; + } else if (value != Py_None && !PyDict_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__kwdefaults__ must be set to a dict object"); + return -1; + } + Py_INCREF(value); + tmp = op->defaults_kwdict; + op->defaults_kwdict = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) { + PyObject* result = op->defaults_kwdict; + if (unlikely(!result)) { + if (op->defaults_getter) { + if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL; + result = op->defaults_kwdict; + } else { + result = Py_None; + } + } + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) { + PyObject* tmp; + if (!value || value == Py_None) { + value = NULL; + } else if (!PyDict_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__annotations__ must be set to a dict object"); + return -1; + } + Py_XINCREF(value); + tmp = op->func_annotations; + op->func_annotations = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) { + PyObject* result = op->func_annotations; + if (unlikely(!result)) { + result = PyDict_New(); + if (unlikely(!result)) return NULL; + op->func_annotations = result; + } + Py_INCREF(result); + return result; +} +static PyGetSetDef __pyx_CyFunction_getsets[] = { + {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, + {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, + {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, + {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, + {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, + {(char *) "__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0}, + {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, + {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, + {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, + {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, + {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, + {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, + {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, + {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, + {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, + {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, + {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, + {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, + {0, 0, 0, 0, 0} +}; +static PyMemberDef __pyx_CyFunction_members[] = { + {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), PY_WRITE_RESTRICTED, 0}, + {0, 0, 0, 0, 0} +}; +static PyObject * +__Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args) +{ +#if PY_MAJOR_VERSION >= 3 + return PyUnicode_FromString(m->func.m_ml->ml_name); +#else + return PyString_FromString(m->func.m_ml->ml_name); +#endif +} +static PyMethodDef __pyx_CyFunction_methods[] = { + {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, + {0, 0, 0, 0} +}; +#if PY_VERSION_HEX < 0x030500A0 +#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist) +#else +#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func.m_weakreflist) +#endif +static PyObject *__Pyx_CyFunction_New(PyTypeObject *type, PyMethodDef *ml, int flags, PyObject* qualname, + PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { + __pyx_CyFunctionObject *op = PyObject_GC_New(__pyx_CyFunctionObject, type); + if (op == NULL) + return NULL; + op->flags = flags; + __Pyx_CyFunction_weakreflist(op) = NULL; + op->func.m_ml = ml; + op->func.m_self = (PyObject *) op; + Py_XINCREF(closure); + op->func_closure = closure; + Py_XINCREF(module); + op->func.m_module = module; + op->func_dict = NULL; + op->func_name = NULL; + Py_INCREF(qualname); + op->func_qualname = qualname; + op->func_doc = NULL; + op->func_classobj = NULL; + op->func_globals = globals; + Py_INCREF(op->func_globals); + Py_XINCREF(code); + op->func_code = code; + op->defaults_pyobjects = 0; + op->defaults = NULL; + op->defaults_tuple = NULL; + op->defaults_kwdict = NULL; + op->defaults_getter = NULL; + op->func_annotations = NULL; + PyObject_GC_Track(op); + return (PyObject *) op; +} +static int +__Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) +{ + Py_CLEAR(m->func_closure); + Py_CLEAR(m->func.m_module); + Py_CLEAR(m->func_dict); + Py_CLEAR(m->func_name); + Py_CLEAR(m->func_qualname); + Py_CLEAR(m->func_doc); + Py_CLEAR(m->func_globals); + Py_CLEAR(m->func_code); + Py_CLEAR(m->func_classobj); + Py_CLEAR(m->defaults_tuple); + Py_CLEAR(m->defaults_kwdict); + Py_CLEAR(m->func_annotations); + if (m->defaults) { + PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); + int i; + for (i = 0; i < m->defaults_pyobjects; i++) + Py_XDECREF(pydefaults[i]); + PyObject_Free(m->defaults); + m->defaults = NULL; + } + return 0; +} +static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m) +{ + if (__Pyx_CyFunction_weakreflist(m) != NULL) + PyObject_ClearWeakRefs((PyObject *) m); + __Pyx_CyFunction_clear(m); + PyObject_GC_Del(m); +} +static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) +{ + PyObject_GC_UnTrack(m); + __Pyx__CyFunction_dealloc(m); +} +static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) +{ + Py_VISIT(m->func_closure); + Py_VISIT(m->func.m_module); + Py_VISIT(m->func_dict); + Py_VISIT(m->func_name); + Py_VISIT(m->func_qualname); + Py_VISIT(m->func_doc); + Py_VISIT(m->func_globals); + Py_VISIT(m->func_code); + Py_VISIT(m->func_classobj); + Py_VISIT(m->defaults_tuple); + Py_VISIT(m->defaults_kwdict); + if (m->defaults) { + PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); + int i; + for (i = 0; i < m->defaults_pyobjects; i++) + Py_VISIT(pydefaults[i]); + } + return 0; +} +static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type) +{ + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) { + Py_INCREF(func); + return func; + } + if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) { + if (type == NULL) + type = (PyObject *)(Py_TYPE(obj)); + return __Pyx_PyMethod_New(func, type, (PyObject *)(Py_TYPE(type))); + } + if (obj == Py_None) + obj = NULL; + return __Pyx_PyMethod_New(func, obj, type); +} +static PyObject* +__Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) +{ +#if PY_MAJOR_VERSION >= 3 + return PyUnicode_FromFormat("", + op->func_qualname, (void *)op); +#else + return PyString_FromFormat("", + PyString_AsString(op->func_qualname), (void *)op); +#endif +} +static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) { + PyCFunctionObject* f = (PyCFunctionObject*)func; + PyCFunction meth = f->m_ml->ml_meth; + Py_ssize_t size; + switch (f->m_ml->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) { + case METH_VARARGS: + if (likely(kw == NULL || PyDict_Size(kw) == 0)) + return (*meth)(self, arg); + break; + case METH_VARARGS | METH_KEYWORDS: + return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw); + case METH_NOARGS: + if (likely(kw == NULL || PyDict_Size(kw) == 0)) { + size = PyTuple_GET_SIZE(arg); + if (likely(size == 0)) + return (*meth)(self, NULL); + PyErr_Format(PyExc_TypeError, + "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", + f->m_ml->ml_name, size); + return NULL; + } + break; + case METH_O: + if (likely(kw == NULL || PyDict_Size(kw) == 0)) { + size = PyTuple_GET_SIZE(arg); + if (likely(size == 1)) { + PyObject *result, *arg0; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + arg0 = PyTuple_GET_ITEM(arg, 0); + #else + arg0 = PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL; + #endif + result = (*meth)(self, arg0); + #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) + Py_DECREF(arg0); + #endif + return result; + } + PyErr_Format(PyExc_TypeError, + "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", + f->m_ml->ml_name, size); + return NULL; + } + break; + default: + PyErr_SetString(PyExc_SystemError, "Bad call flags in " + "__Pyx_CyFunction_Call. METH_OLDARGS is no " + "longer supported!"); + return NULL; + } + PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", + f->m_ml->ml_name); + return NULL; +} +static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { + return __Pyx_CyFunction_CallMethod(func, ((PyCFunctionObject*)func)->m_self, arg, kw); +} +static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) { + PyObject *result; + __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func; + if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { + Py_ssize_t argc; + PyObject *new_args; + PyObject *self; + argc = PyTuple_GET_SIZE(args); + new_args = PyTuple_GetSlice(args, 1, argc); + if (unlikely(!new_args)) + return NULL; + self = PyTuple_GetItem(args, 0); + if (unlikely(!self)) { + Py_DECREF(new_args); + return NULL; + } + result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw); + Py_DECREF(new_args); + } else { + result = __Pyx_CyFunction_Call(func, args, kw); + } + return result; +} +static PyTypeObject __pyx_CyFunctionType_type = { + PyVarObject_HEAD_INIT(0, 0) + "cython_function_or_method", + sizeof(__pyx_CyFunctionObject), + 0, + (destructor) __Pyx_CyFunction_dealloc, + 0, + 0, + 0, +#if PY_MAJOR_VERSION < 3 + 0, +#else + 0, +#endif + (reprfunc) __Pyx_CyFunction_repr, + 0, + 0, + 0, + 0, + __Pyx_CyFunction_CallAsMethod, + 0, + 0, + 0, + 0, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, + 0, + (traverseproc) __Pyx_CyFunction_traverse, + (inquiry) __Pyx_CyFunction_clear, + 0, +#if PY_VERSION_HEX < 0x030500A0 + offsetof(__pyx_CyFunctionObject, func_weakreflist), +#else + offsetof(PyCFunctionObject, m_weakreflist), +#endif + 0, + 0, + __pyx_CyFunction_methods, + __pyx_CyFunction_members, + __pyx_CyFunction_getsets, + 0, + 0, + __Pyx_CyFunction_descr_get, + 0, + offsetof(__pyx_CyFunctionObject, func_dict), + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, +#if PY_VERSION_HEX >= 0x030400a1 + 0, +#endif +}; +static int __pyx_CyFunction_init(void) { + __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); + if (unlikely(__pyx_CyFunctionType == NULL)) { + return -1; + } + return 0; +} +static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults = PyObject_Malloc(size); + if (unlikely(!m->defaults)) + return PyErr_NoMemory(); + memset(m->defaults, 0, size); + m->defaults_pyobjects = pyobjects; + return m->defaults; +} +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults_tuple = tuple; + Py_INCREF(tuple); +} +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults_kwdict = dict; + Py_INCREF(dict); +} +static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->func_annotations = dict; + Py_INCREF(dict); +} + +/* GetModuleGlobalName */ +#if CYTHON_USE_DICT_VERSIONS +static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value) +#else +static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) +#endif +{ + PyObject *result; +#if !CYTHON_AVOID_BORROWED_REFS +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 + result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } else if (unlikely(PyErr_Occurred())) { + return NULL; + } +#else + result = PyDict_GetItem(__pyx_d, name); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } +#endif +#else + result = PyObject_GetItem(__pyx_d, name); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } + PyErr_Clear(); +#endif + return __Pyx_GetBuiltinName(name); +} + +/* GetAttr */ +static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) { +#if CYTHON_USE_TYPE_SLOTS +#if PY_MAJOR_VERSION >= 3 + if (likely(PyUnicode_Check(n))) +#else + if (likely(PyString_Check(n))) +#endif + return __Pyx_PyObject_GetAttrStr(o, n); +#endif + return PyObject_GetAttr(o, n); +} + +/* Globals */ +static PyObject* __Pyx_Globals(void) { + Py_ssize_t i; + PyObject *names; + PyObject *globals = __pyx_d; + Py_INCREF(globals); + names = PyObject_Dir(__pyx_m); + if (!names) + goto bad; + for (i = PyList_GET_SIZE(names)-1; i >= 0; i--) { +#if CYTHON_COMPILING_IN_PYPY + PyObject* name = PySequence_ITEM(names, i); + if (!name) + goto bad; +#else + PyObject* name = PyList_GET_ITEM(names, i); +#endif + if (!PyDict_Contains(globals, name)) { + PyObject* value = __Pyx_GetAttr(__pyx_m, name); + if (!value) { +#if CYTHON_COMPILING_IN_PYPY + Py_DECREF(name); +#endif + goto bad; + } + if (PyDict_SetItem(globals, name, value) < 0) { +#if CYTHON_COMPILING_IN_PYPY + Py_DECREF(name); +#endif + Py_DECREF(value); + goto bad; + } + } +#if CYTHON_COMPILING_IN_PYPY + Py_DECREF(name); +#endif + } + Py_DECREF(names); + return globals; +bad: + Py_XDECREF(names); + Py_XDECREF(globals); + return NULL; +} + +/* CLineInTraceback */ +#ifndef CYTHON_CLINE_IN_TRACEBACK +static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { + PyObject *use_cline; + PyObject *ptype, *pvalue, *ptraceback; +#if CYTHON_COMPILING_IN_CPYTHON + PyObject **cython_runtime_dict; +#endif + if (unlikely(!__pyx_cython_runtime)) { + return c_line; + } + __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); +#if CYTHON_COMPILING_IN_CPYTHON + cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); + if (likely(cython_runtime_dict)) { + __PYX_PY_DICT_LOOKUP_IF_MODIFIED( + use_cline, *cython_runtime_dict, + __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback)) + } else +#endif + { + PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback); + if (use_cline_obj) { + use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; + Py_DECREF(use_cline_obj); + } else { + PyErr_Clear(); + use_cline = NULL; + } + } + if (!use_cline) { + c_line = 0; + PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); + } + else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { + c_line = 0; + } + __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); + return c_line; +} +#endif + +/* CodeObjectCache */ +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { + int start = 0, mid = 0, end = count - 1; + if (end >= 0 && code_line > entries[end].code_line) { + return count; + } + while (start < end) { + mid = start + (end - start) / 2; + if (code_line < entries[mid].code_line) { + end = mid; + } else if (code_line > entries[mid].code_line) { + start = mid + 1; + } else { + return mid; + } + } + if (code_line <= entries[mid].code_line) { + return mid; + } else { + return mid + 1; + } +} +static PyCodeObject *__pyx_find_code_object(int code_line) { + PyCodeObject* code_object; + int pos; + if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { + return NULL; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { + return NULL; + } + code_object = __pyx_code_cache.entries[pos].code_object; + Py_INCREF(code_object); + return code_object; +} +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { + int pos, i; + __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; + if (unlikely(!code_line)) { + return; + } + if (unlikely(!entries)) { + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); + if (likely(entries)) { + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = 64; + __pyx_code_cache.count = 1; + entries[0].code_line = code_line; + entries[0].code_object = code_object; + Py_INCREF(code_object); + } + return; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { + PyCodeObject* tmp = entries[pos].code_object; + entries[pos].code_object = code_object; + Py_DECREF(tmp); + return; + } + if (__pyx_code_cache.count == __pyx_code_cache.max_count) { + int new_max = __pyx_code_cache.max_count + 64; + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( + __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry)); + if (unlikely(!entries)) { + return; + } + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = new_max; + } + for (i=__pyx_code_cache.count; i>pos; i--) { + entries[i] = entries[i-1]; + } + entries[pos].code_line = code_line; + entries[pos].code_object = code_object; + __pyx_code_cache.count++; + Py_INCREF(code_object); +} + +/* AddTraceback */ +#include "compile.h" +#include "frameobject.h" +#include "traceback.h" +static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( + const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyObject *py_srcfile = 0; + PyObject *py_funcname = 0; + #if PY_MAJOR_VERSION < 3 + py_srcfile = PyString_FromString(filename); + #else + py_srcfile = PyUnicode_FromString(filename); + #endif + if (!py_srcfile) goto bad; + if (c_line) { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + #else + py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + #endif + } + else { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromString(funcname); + #else + py_funcname = PyUnicode_FromString(funcname); + #endif + } + if (!py_funcname) goto bad; + py_code = __Pyx_PyCode_New( + 0, + 0, + 0, + 0, + 0, + __pyx_empty_bytes, /*PyObject *code,*/ + __pyx_empty_tuple, /*PyObject *consts,*/ + __pyx_empty_tuple, /*PyObject *names,*/ + __pyx_empty_tuple, /*PyObject *varnames,*/ + __pyx_empty_tuple, /*PyObject *freevars,*/ + __pyx_empty_tuple, /*PyObject *cellvars,*/ + py_srcfile, /*PyObject *filename,*/ + py_funcname, /*PyObject *name,*/ + py_line, + __pyx_empty_bytes /*PyObject *lnotab*/ + ); + Py_DECREF(py_srcfile); + Py_DECREF(py_funcname); + return py_code; +bad: + Py_XDECREF(py_srcfile); + Py_XDECREF(py_funcname); + return NULL; +} +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyFrameObject *py_frame = 0; + PyThreadState *tstate = __Pyx_PyThreadState_Current; + if (c_line) { + c_line = __Pyx_CLineForTraceback(tstate, c_line); + } + py_code = __pyx_find_code_object(c_line ? -c_line : py_line); + if (!py_code) { + py_code = __Pyx_CreateCodeObjectForTraceback( + funcname, c_line, py_line, filename); + if (!py_code) goto bad; + __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); + } + py_frame = PyFrame_New( + tstate, /*PyThreadState *tstate,*/ + py_code, /*PyCodeObject *code,*/ + __pyx_d, /*PyObject *globals,*/ + 0 /*PyObject *locals*/ + ); + if (!py_frame) goto bad; + __Pyx_PyFrame_SetLineNumber(py_frame, py_line); + PyTraceBack_Here(py_frame); +bad: + Py_XDECREF(py_code); + Py_XDECREF(py_frame); +} + +/* CIntToPy */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { + const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(long) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(long) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(long) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(long), + little, !is_unsigned); + } +} + +/* CIntFromPyVerify */ +#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ + __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) +#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ + __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) +#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ + {\ + func_type value = func_value;\ + if (sizeof(target_type) < sizeof(func_type)) {\ + if (unlikely(value != (func_type) (target_type) value)) {\ + func_type zero = 0;\ + if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ + return (target_type) -1;\ + if (is_unsigned && unlikely(value < zero))\ + goto raise_neg_overflow;\ + else\ + goto raise_overflow;\ + }\ + }\ + return (target_type) value;\ + } + +/* CIntFromPy */ +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { + const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(long) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (long) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (long) 0; + case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0]) + case 2: + if (8 * sizeof(long) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) { + return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + case 3: + if (8 * sizeof(long) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) { + return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + case 4: + if (8 * sizeof(long) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) { + return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (long) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if (sizeof(long) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (long) 0; + case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0])) + case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0]) + case -2: + if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 2: + if (8 * sizeof(long) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case -3: + if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 3: + if (8 * sizeof(long) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case -4: + if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 4: + if (8 * sizeof(long) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + } +#endif + if (sizeof(long) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + long val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (long) -1; + } + } else { + long val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (long) -1; + val = __Pyx_PyInt_As_long(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to long"); + return (long) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to long"); + return (long) -1; +} + +/* CIntFromPy */ +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { + const int neg_one = (int) ((int) 0 - (int) 1), const_zero = (int) 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(int) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (int) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (int) 0; + case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0]) + case 2: + if (8 * sizeof(int) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) { + return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + case 3: + if (8 * sizeof(int) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) { + return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + case 4: + if (8 * sizeof(int) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) { + return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (int) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if (sizeof(int) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (int) 0; + case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0])) + case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0]) + case -2: + if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { + return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 2: + if (8 * sizeof(int) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { + return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case -3: + if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { + return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 3: + if (8 * sizeof(int) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { + return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case -4: + if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { + return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 4: + if (8 * sizeof(int) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { + return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + } +#endif + if (sizeof(int) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + int val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (int) -1; + } + } else { + int val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (int) -1; + val = __Pyx_PyInt_As_int(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to int"); + return (int) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to int"); + return (int) -1; +} + +/* FastTypeChecks */ +#if CYTHON_COMPILING_IN_CPYTHON +static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) { + while (a) { + a = a->tp_base; + if (a == b) + return 1; + } + return b == &PyBaseObject_Type; +} +static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) { + PyObject *mro; + if (a == b) return 1; + mro = a->tp_mro; + if (likely(mro)) { + Py_ssize_t i, n; + n = PyTuple_GET_SIZE(mro); + for (i = 0; i < n; i++) { + if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b) + return 1; + } + return 0; + } + return __Pyx_InBases(a, b); +} +#if PY_MAJOR_VERSION == 2 +static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { + PyObject *exception, *value, *tb; + int res; + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ErrFetch(&exception, &value, &tb); + res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; + if (unlikely(res == -1)) { + PyErr_WriteUnraisable(err); + res = 0; + } + if (!res) { + res = PyObject_IsSubclass(err, exc_type2); + if (unlikely(res == -1)) { + PyErr_WriteUnraisable(err); + res = 0; + } + } + __Pyx_ErrRestore(exception, value, tb); + return res; +} +#else +static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { + int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0; + if (!res) { + res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); + } + return res; +} +#endif +static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { + Py_ssize_t i, n; + assert(PyExceptionClass_Check(exc_type)); + n = PyTuple_GET_SIZE(tuple); +#if PY_MAJOR_VERSION >= 3 + for (i=0; itp_setattro)) + return tp->tp_setattro(obj, attr_name, value); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_setattr)) + return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value); +#endif + return PyObject_SetAttr(obj, attr_name, value); +} +#endif + +/* VoidPtrExport */ +static int __Pyx_ExportVoidPtr(PyObject *name, void *p, const char *sig) { + PyObject *d; + PyObject *cobj = 0; + d = PyDict_GetItem(__pyx_d, __pyx_n_s_pyx_capi); + Py_XINCREF(d); + if (!d) { + d = PyDict_New(); + if (!d) + goto bad; + if (__Pyx_PyObject_SetAttrStr(__pyx_m, __pyx_n_s_pyx_capi, d) < 0) + goto bad; + } +#if PY_VERSION_HEX >= 0x02070000 + cobj = PyCapsule_New(p, sig, 0); +#else + cobj = PyCObject_FromVoidPtrAndDesc(p, (void *)sig, 0); +#endif + if (!cobj) + goto bad; + if (PyDict_SetItem(d, name, cobj) < 0) + goto bad; + Py_DECREF(cobj); + Py_DECREF(d); + return 0; +bad: + Py_XDECREF(cobj); + Py_XDECREF(d); + return -1; +} + +/* VoidPtrImport */ +#ifndef __PYX_HAVE_RT_ImportVoidPtr +#define __PYX_HAVE_RT_ImportVoidPtr +static int __Pyx_ImportVoidPtr(PyObject *module, const char *name, void **p, const char *sig) { + PyObject *d = 0; + PyObject *cobj = 0; + d = PyObject_GetAttrString(module, (char *)"__pyx_capi__"); + if (!d) + goto bad; + cobj = PyDict_GetItemString(d, name); + if (!cobj) { + PyErr_Format(PyExc_ImportError, + "%.200s does not export expected C variable %.200s", + PyModule_GetName(module), name); + goto bad; + } +#if PY_VERSION_HEX >= 0x02070000 + if (!PyCapsule_IsValid(cobj, sig)) { + PyErr_Format(PyExc_TypeError, + "C variable %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", + PyModule_GetName(module), name, sig, PyCapsule_GetName(cobj)); + goto bad; + } + *p = PyCapsule_GetPointer(cobj, sig); +#else + {const char *desc, *s1, *s2; + desc = (const char *)PyCObject_GetDesc(cobj); + if (!desc) + goto bad; + s1 = desc; s2 = sig; + while (*s1 != '\0' && *s1 == *s2) { s1++; s2++; } + if (*s1 != *s2) { + PyErr_Format(PyExc_TypeError, + "C variable %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", + PyModule_GetName(module), name, sig, desc); + goto bad; + } + *p = PyCObject_AsVoidPtr(cobj);} +#endif + if (!(*p)) + goto bad; + Py_DECREF(d); + return 0; +bad: + Py_XDECREF(d); + return -1; +} +#endif + +/* FunctionImport */ +#ifndef __PYX_HAVE_RT_ImportFunction +#define __PYX_HAVE_RT_ImportFunction +static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig) { + PyObject *d = 0; + PyObject *cobj = 0; + union { + void (*fp)(void); + void *p; + } tmp; + d = PyObject_GetAttrString(module, (char *)"__pyx_capi__"); + if (!d) + goto bad; + cobj = PyDict_GetItemString(d, funcname); + if (!cobj) { + PyErr_Format(PyExc_ImportError, + "%.200s does not export expected C function %.200s", + PyModule_GetName(module), funcname); + goto bad; + } +#if PY_VERSION_HEX >= 0x02070000 + if (!PyCapsule_IsValid(cobj, sig)) { + PyErr_Format(PyExc_TypeError, + "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", + PyModule_GetName(module), funcname, sig, PyCapsule_GetName(cobj)); + goto bad; + } + tmp.p = PyCapsule_GetPointer(cobj, sig); +#else + {const char *desc, *s1, *s2; + desc = (const char *)PyCObject_GetDesc(cobj); + if (!desc) + goto bad; + s1 = desc; s2 = sig; + while (*s1 != '\0' && *s1 == *s2) { s1++; s2++; } + if (*s1 != *s2) { + PyErr_Format(PyExc_TypeError, + "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", + PyModule_GetName(module), funcname, sig, desc); + goto bad; + } + tmp.p = PyCObject_AsVoidPtr(cobj);} +#endif + *f = tmp.fp; + if (!(*f)) + goto bad; + Py_DECREF(d); + return 0; +bad: + Py_XDECREF(d); + return -1; +} +#endif + +/* InitStrings */ +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { + while (t->p) { + #if PY_MAJOR_VERSION < 3 + if (t->is_unicode) { + *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); + } else if (t->intern) { + *t->p = PyString_InternFromString(t->s); + } else { + *t->p = PyString_FromStringAndSize(t->s, t->n - 1); + } + #else + if (t->is_unicode | t->is_str) { + if (t->intern) { + *t->p = PyUnicode_InternFromString(t->s); + } else if (t->encoding) { + *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); + } else { + *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); + } + } else { + *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); + } + #endif + if (!*t->p) + return -1; + if (PyObject_Hash(*t->p) == -1) + return -1; + ++t; + } + return 0; +} + +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { + return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); +} +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { + Py_ssize_t ignore; + return __Pyx_PyObject_AsStringAndSize(o, &ignore); +} +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +#if !CYTHON_PEP393_ENABLED +static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { + char* defenc_c; + PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); + if (!defenc) return NULL; + defenc_c = PyBytes_AS_STRING(defenc); +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + { + char* end = defenc_c + PyBytes_GET_SIZE(defenc); + char* c; + for (c = defenc_c; c < end; c++) { + if ((unsigned char) (*c) >= 128) { + PyUnicode_AsASCIIString(o); + return NULL; + } + } + } +#endif + *length = PyBytes_GET_SIZE(defenc); + return defenc_c; +} +#else +static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { + if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + if (likely(PyUnicode_IS_ASCII(o))) { + *length = PyUnicode_GET_LENGTH(o); + return PyUnicode_AsUTF8(o); + } else { + PyUnicode_AsASCIIString(o); + return NULL; + } +#else + return PyUnicode_AsUTF8AndSize(o, length); +#endif +} +#endif +#endif +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT + if ( +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + __Pyx_sys_getdefaultencoding_not_ascii && +#endif + PyUnicode_Check(o)) { + return __Pyx_PyUnicode_AsStringAndSize(o, length); + } else +#endif +#if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) + if (PyByteArray_Check(o)) { + *length = PyByteArray_GET_SIZE(o); + return PyByteArray_AS_STRING(o); + } else +#endif + { + char* result; + int r = PyBytes_AsStringAndSize(o, &result, length); + if (unlikely(r < 0)) { + return NULL; + } else { + return result; + } + } +} +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { + int is_true = x == Py_True; + if (is_true | (x == Py_False) | (x == Py_None)) return is_true; + else return PyObject_IsTrue(x); +} +static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) { + int retval; + if (unlikely(!x)) return -1; + retval = __Pyx_PyObject_IsTrue(x); + Py_DECREF(x); + return retval; +} +static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) { +#if PY_MAJOR_VERSION >= 3 + if (PyLong_Check(result)) { + if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, + "__int__ returned non-int (type %.200s). " + "The ability to return an instance of a strict subclass of int " + "is deprecated, and may be removed in a future version of Python.", + Py_TYPE(result)->tp_name)) { + Py_DECREF(result); + return NULL; + } + return result; + } +#endif + PyErr_Format(PyExc_TypeError, + "__%.4s__ returned non-%.4s (type %.200s)", + type_name, type_name, Py_TYPE(result)->tp_name); + Py_DECREF(result); + return NULL; +} +static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { +#if CYTHON_USE_TYPE_SLOTS + PyNumberMethods *m; +#endif + const char *name = NULL; + PyObject *res = NULL; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x) || PyLong_Check(x))) +#else + if (likely(PyLong_Check(x))) +#endif + return __Pyx_NewRef(x); +#if CYTHON_USE_TYPE_SLOTS + m = Py_TYPE(x)->tp_as_number; + #if PY_MAJOR_VERSION < 3 + if (m && m->nb_int) { + name = "int"; + res = m->nb_int(x); + } + else if (m && m->nb_long) { + name = "long"; + res = m->nb_long(x); + } + #else + if (likely(m && m->nb_int)) { + name = "int"; + res = m->nb_int(x); + } + #endif +#else + if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { + res = PyNumber_Int(x); + } +#endif + if (likely(res)) { +#if PY_MAJOR_VERSION < 3 + if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) { +#else + if (unlikely(!PyLong_CheckExact(res))) { +#endif + return __Pyx_PyNumber_IntOrLongWrongResultType(res, name); + } + } + else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_TypeError, + "an integer is required"); + } + return res; +} +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { + Py_ssize_t ival; + PyObject *x; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_CheckExact(b))) { + if (sizeof(Py_ssize_t) >= sizeof(long)) + return PyInt_AS_LONG(b); + else + return PyInt_AsSsize_t(b); + } +#endif + if (likely(PyLong_CheckExact(b))) { + #if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)b)->ob_digit; + const Py_ssize_t size = Py_SIZE(b); + if (likely(__Pyx_sst_abs(size) <= 1)) { + ival = likely(size) ? digits[0] : 0; + if (size == -1) ival = -ival; + return ival; + } else { + switch (size) { + case 2: + if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { + return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -2: + if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case 3: + if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { + return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -3: + if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case 4: + if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { + return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -4: + if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + } + } + #endif + return PyLong_AsSsize_t(b); + } + x = PyNumber_Index(b); + if (!x) return -1; + ival = PyInt_AsSsize_t(x); + Py_DECREF(x); + return ival; +} +static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) { + return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False); +} +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { + return PyInt_FromSize_t(ival); +} + + +#endif /* Py_PYTHON_H */ diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_waiter.html b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_waiter.html new file mode 100644 index 00000000..20988936 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_waiter.html @@ -0,0 +1,2281 @@ + + + + + + Cython: _waiter.py + + + +

Generated by Cython 0.29.2

+

+ Yellow lines hint at Python interaction.
+ Click on a line that starts with a "+" to see the C code that Cython generated for it. +

+

Raw output: _waiter.c

+
+001: # -*- coding: utf-8 -*-
+
  __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 002: # copyright 2018 gevent
+
 003: # cython: auto_pickle=False,embedsignature=True,always_allow_keywords=False
+
 004: """
+
 005: Low-level waiting primitives.
+
 006: 
+
 007: """
+
 008: from __future__ import absolute_import
+
 009: from __future__ import division
+
 010: from __future__ import print_function
+
 011: 
+
+012: import sys
+
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_sys, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 12, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_XGOTREF(__pyx_v_6gevent_8__waiter_sys);
+  __Pyx_DECREF_SET(__pyx_v_6gevent_8__waiter_sys, __pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_1);
+  __pyx_t_1 = 0;
+
 013: 
+
+014: from gevent._hub_local import get_hub_noargs as get_hub
+
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 14, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(__pyx_n_s_get_hub_noargs);
+  __Pyx_GIVEREF(__pyx_n_s_get_hub_noargs);
+  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_get_hub_noargs);
+  __pyx_t_2 = __Pyx_Import(__pyx_n_s_gevent__hub_local, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 14, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_get_hub_noargs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 14, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_hub_noargs, __pyx_t_1) < 0) __PYX_ERR(0, 14, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+015: from gevent.exceptions import ConcurrentObjectUseError
+
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 15, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_ConcurrentObjectUseError);
+  __Pyx_GIVEREF(__pyx_n_s_ConcurrentObjectUseError);
+  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_ConcurrentObjectUseError);
+  __pyx_t_1 = __Pyx_Import(__pyx_n_s_gevent_exceptions, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 15, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_ConcurrentObjectUseError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 15, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(__pyx_t_2);
+  __Pyx_XGOTREF(__pyx_v_6gevent_8__waiter_ConcurrentObjectUseError);
+  __Pyx_DECREF_SET(__pyx_v_6gevent_8__waiter_ConcurrentObjectUseError, __pyx_t_2);
+  __Pyx_GIVEREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 016: 
+
+017: __all__ = [
+
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 17, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(__pyx_n_s_Waiter);
+  __Pyx_GIVEREF(__pyx_n_s_Waiter);
+  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_Waiter);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_all, __pyx_t_1) < 0) __PYX_ERR(0, 17, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 018:     'Waiter',
+
 019: ]
+
 020: 
+
+021: _NONE = object()
+
  __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_builtin_object); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 21, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_XGOTREF(__pyx_v_6gevent_8__waiter__NONE);
+  __Pyx_DECREF_SET(__pyx_v_6gevent_8__waiter__NONE, __pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_1);
+  __pyx_t_1 = 0;
+
 022: 
+
+023: locals()['getcurrent'] = __import__('greenlet').getcurrent
+
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin___import__, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 23, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_getcurrent); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 23, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_1 = __Pyx_Globals(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 23, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (unlikely(PyDict_SetItem(__pyx_t_1, __pyx_n_s_getcurrent, __pyx_t_2) < 0)) __PYX_ERR(0, 23, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+/* … */
+  __pyx_tuple__2 = PyTuple_Pack(1, __pyx_n_s_greenlet); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 23, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__2);
+  __Pyx_GIVEREF(__pyx_tuple__2);
+
+024: locals()['greenlet_init'] = lambda: None
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_8__waiter_2lambda(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyMethodDef __pyx_mdef_6gevent_8__waiter_2lambda = {"lambda", (PyCFunction)__pyx_pw_6gevent_8__waiter_2lambda, METH_NOARGS, 0};
+static PyObject *__pyx_pw_6gevent_8__waiter_2lambda(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("lambda (wrapper)", 0);
+  __pyx_r = __pyx_lambda_funcdef_6gevent_8__waiter_lambda(__pyx_self);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_lambda_funcdef_6gevent_8__waiter_lambda(CYTHON_UNUSED PyObject *__pyx_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("lambda", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_8__waiter_2lambda, 0, __pyx_n_s_lambda, NULL, __pyx_n_s_gevent___waiter, __pyx_d, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 24, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_1 = __Pyx_Globals(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 24, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (unlikely(PyDict_SetItem(__pyx_t_1, __pyx_n_s_greenlet_init, __pyx_t_2) < 0)) __PYX_ERR(0, 24, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
 025: 
+
 026: 
+
+027: class Waiter(object):
+
struct __pyx_vtabstruct_6gevent_8__waiter_Waiter {
+  PyObject *(*get)(struct __pyx_obj_6gevent_8__waiter_Waiter *, int __pyx_skip_dispatch);
+  PyObject *(*clear)(struct __pyx_obj_6gevent_8__waiter_Waiter *, int __pyx_skip_dispatch);
+};
+static struct __pyx_vtabstruct_6gevent_8__waiter_Waiter *__pyx_vtabptr_6gevent_8__waiter_Waiter;
+
+
 028:     """
+
 029:     A low level communication utility for greenlets.
+
 030: 
+
 031:     Waiter is a wrapper around greenlet's ``switch()`` and ``throw()`` calls that makes them somewhat safer:
+
 032: 
+
 033:     * switching will occur only if the waiting greenlet is executing :meth:`get` method currently;
+
 034:     * any error raised in the greenlet is handled inside :meth:`switch` and :meth:`throw`
+
 035:     * if :meth:`switch`/:meth:`throw` is called before the receiver calls :meth:`get`, then :class:`Waiter`
+
 036:       will store the value/exception. The following :meth:`get` will return the value/raise the exception.
+
 037: 
+
 038:     The :meth:`switch` and :meth:`throw` methods must only be called from the :class:`Hub` greenlet.
+
 039:     The :meth:`get` method must be called from a greenlet other than :class:`Hub`.
+
 040: 
+
 041:         >>> result = Waiter()
+
 042:         >>> timer = get_hub().loop.timer(0.1)
+
 043:         >>> timer.start(result.switch, 'hello from Waiter')
+
 044:         >>> result.get() # blocks for 0.1 seconds
+
 045:         'hello from Waiter'
+
 046:         >>> timer.close()
+
 047: 
+
 048:     If switch is called before the greenlet gets a chance to call :meth:`get` then
+
 049:     :class:`Waiter` stores the value.
+
 050: 
+
 051:         >>> result = Waiter()
+
 052:         >>> timer = get_hub().loop.timer(0.1)
+
 053:         >>> timer.start(result.switch, 'hi from Waiter')
+
 054:         >>> sleep(0.2)
+
 055:         >>> result.get() # returns immediately without blocking
+
 056:         'hi from Waiter'
+
 057:         >>> timer.close()
+
 058: 
+
 059:     .. warning::
+
 060: 
+
 061:         This a limited and dangerous way to communicate between
+
 062:         greenlets. It can easily leave a greenlet unscheduled forever
+
 063:         if used incorrectly. Consider using safer classes such as
+
 064:         :class:`gevent.event.Event`, :class:`gevent.event.AsyncResult`,
+
 065:         or :class:`gevent.queue.Queue`.
+
 066:     """
+
 067: 
+
+068:     __slots__ = ['hub', 'greenlet', 'value', '_exception']
+
  __pyx_t_2 = PyList_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 68, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_hub);
+  __Pyx_GIVEREF(__pyx_n_s_hub);
+  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_hub);
+  __Pyx_INCREF(__pyx_n_s_greenlet);
+  __Pyx_GIVEREF(__pyx_n_s_greenlet);
+  PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_greenlet);
+  __Pyx_INCREF(__pyx_n_s_value);
+  __Pyx_GIVEREF(__pyx_n_s_value);
+  PyList_SET_ITEM(__pyx_t_2, 2, __pyx_n_s_value);
+  __Pyx_INCREF(__pyx_n_s_exception_2);
+  __Pyx_GIVEREF(__pyx_n_s_exception_2);
+  PyList_SET_ITEM(__pyx_t_2, 3, __pyx_n_s_exception_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_8__waiter_Waiter->tp_dict, __pyx_n_s_slots, __pyx_t_2) < 0) __PYX_ERR(0, 68, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_8__waiter_Waiter);
+
 069: 
+
+070:     def __init__(self, hub=None):
+
/* Python wrapper */
+static int __pyx_pw_6gevent_8__waiter_6Waiter_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static int __pyx_pw_6gevent_8__waiter_6Waiter_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_hub = 0;
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_hub,0};
+    PyObject* values[1] = {0};
+    values[0] = ((PyObject *)Py_None);
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_hub);
+          if (value) { values[0] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 70, __pyx_L3_error)
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    __pyx_v_hub = values[0];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 70, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.__waiter.Waiter.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return -1;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_8__waiter_6Waiter___init__(((struct __pyx_obj_6gevent_8__waiter_Waiter *)__pyx_v_self), __pyx_v_hub);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_8__waiter_6Waiter___init__(struct __pyx_obj_6gevent_8__waiter_Waiter *__pyx_v_self, PyObject *__pyx_v_hub) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = 0;
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_AddTraceback("gevent.__waiter.Waiter.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = -1;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+071:         self.hub = get_hub() if hub is None else hub
+
  __pyx_t_2 = (__pyx_v_hub == Py_None);
+  if ((__pyx_t_2 != 0)) {
+    __pyx_t_3 = ((PyObject *)__pyx_f_6gevent_11__hub_local_get_hub_noargs(0)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 71, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __pyx_t_1 = __pyx_t_3;
+    __pyx_t_3 = 0;
+  } else {
+    if (!(likely(((__pyx_v_hub) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_hub, __pyx_ptype_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop))))) __PYX_ERR(0, 71, __pyx_L1_error)
+    __Pyx_INCREF(__pyx_v_hub);
+    __pyx_t_1 = __pyx_v_hub;
+  }
+  __Pyx_GIVEREF(__pyx_t_1);
+  __Pyx_GOTREF(__pyx_v_self->hub);
+  __Pyx_DECREF(((PyObject *)__pyx_v_self->hub));
+  __pyx_v_self->hub = ((struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *)__pyx_t_1);
+  __pyx_t_1 = 0;
+
+072:         self.greenlet = None
+
  __Pyx_INCREF(Py_None);
+  __Pyx_GIVEREF(Py_None);
+  __Pyx_GOTREF(__pyx_v_self->greenlet);
+  __Pyx_DECREF(((PyObject *)__pyx_v_self->greenlet));
+  __pyx_v_self->greenlet = ((PyGreenlet *)Py_None);
+
+073:         self.value = None
+
  __Pyx_INCREF(Py_None);
+  __Pyx_GIVEREF(Py_None);
+  __Pyx_GOTREF(__pyx_v_self->value);
+  __Pyx_DECREF(__pyx_v_self->value);
+  __pyx_v_self->value = Py_None;
+
+074:         self._exception = _NONE
+
  __Pyx_INCREF(__pyx_v_6gevent_8__waiter__NONE);
+  __Pyx_GIVEREF(__pyx_v_6gevent_8__waiter__NONE);
+  __Pyx_GOTREF(__pyx_v_self->_exception);
+  __Pyx_DECREF(__pyx_v_self->_exception);
+  __pyx_v_self->_exception = __pyx_v_6gevent_8__waiter__NONE;
+
 075: 
+
+076:     def clear(self):
+
static PyObject *__pyx_pw_6gevent_8__waiter_6Waiter_3clear(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyObject *__pyx_f_6gevent_8__waiter_6Waiter_clear(struct __pyx_obj_6gevent_8__waiter_Waiter *__pyx_v_self, int __pyx_skip_dispatch) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("clear", 0);
+  /* Check if called by wrapper */
+  if (unlikely(__pyx_skip_dispatch)) ;
+  /* Check if overridden in Python */
+  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
+    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
+    if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
+    else {
+      PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      #endif
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_clear); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 76, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_8__waiter_6Waiter_3clear)) {
+        __Pyx_XDECREF(__pyx_r);
+        __Pyx_INCREF(__pyx_t_1);
+        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+          if (likely(__pyx_t_4)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+            __Pyx_INCREF(__pyx_t_4);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_3, function);
+          }
+        }
+        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
+        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 76, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __pyx_r = __pyx_t_2;
+        __pyx_t_2 = 0;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        goto __pyx_L0;
+      }
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+      tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
+      if (unlikely(type_dict_guard != tp_dict_version)) {
+        tp_dict_version = obj_dict_version = 0;
+      }
+      #endif
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    }
+    #endif
+  }
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_AddTraceback("gevent.__waiter.Waiter.clear", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_8__waiter_6Waiter_3clear(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6gevent_8__waiter_6Waiter_2clear[] = "Waiter.clear(self)";
+static PyMethodDef __pyx_mdef_6gevent_8__waiter_6Waiter_3clear = {"clear", (PyCFunction)__pyx_pw_6gevent_8__waiter_6Waiter_3clear, METH_NOARGS, __pyx_doc_6gevent_8__waiter_6Waiter_2clear};
+static PyObject *__pyx_pw_6gevent_8__waiter_6Waiter_3clear(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("clear (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_8__waiter_6Waiter_2clear(((struct __pyx_obj_6gevent_8__waiter_Waiter *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_8__waiter_6Waiter_2clear(struct __pyx_obj_6gevent_8__waiter_Waiter *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("clear", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __pyx_f_6gevent_8__waiter_6Waiter_clear(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 76, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.__waiter.Waiter.clear", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__3 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 76, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__3);
+  __Pyx_GIVEREF(__pyx_tuple__3);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_8__waiter_6Waiter_3clear, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Waiter_clear, NULL, __pyx_n_s_gevent___waiter, __pyx_d, ((PyObject *)__pyx_codeobj__4)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 76, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_8__waiter_Waiter->tp_dict, __pyx_n_s_clear, __pyx_t_2) < 0) __PYX_ERR(0, 76, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_8__waiter_Waiter);
+  __pyx_codeobj__4 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__3, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__waiter_py, __pyx_n_s_clear, 76, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__4)) __PYX_ERR(0, 76, __pyx_L1_error)
+
+077:         self.greenlet = None
+
  __Pyx_INCREF(Py_None);
+  __Pyx_GIVEREF(Py_None);
+  __Pyx_GOTREF(__pyx_v_self->greenlet);
+  __Pyx_DECREF(((PyObject *)__pyx_v_self->greenlet));
+  __pyx_v_self->greenlet = ((PyGreenlet *)Py_None);
+
+078:         self.value = None
+
  __Pyx_INCREF(Py_None);
+  __Pyx_GIVEREF(Py_None);
+  __Pyx_GOTREF(__pyx_v_self->value);
+  __Pyx_DECREF(__pyx_v_self->value);
+  __pyx_v_self->value = Py_None;
+
+079:         self._exception = _NONE
+
  __Pyx_INCREF(__pyx_v_6gevent_8__waiter__NONE);
+  __Pyx_GIVEREF(__pyx_v_6gevent_8__waiter__NONE);
+  __Pyx_GOTREF(__pyx_v_self->_exception);
+  __Pyx_DECREF(__pyx_v_self->_exception);
+  __pyx_v_self->_exception = __pyx_v_6gevent_8__waiter__NONE;
+
 080: 
+
+081:     def __str__(self):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_8__waiter_6Waiter_5__str__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_8__waiter_6Waiter_5__str__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_8__waiter_6Waiter_4__str__(((struct __pyx_obj_6gevent_8__waiter_Waiter *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_8__waiter_6Waiter_4__str__(struct __pyx_obj_6gevent_8__waiter_Waiter *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__str__", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_AddTraceback("gevent.__waiter.Waiter.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+082:         if self._exception is _NONE:
+
  __pyx_t_1 = (__pyx_v_self->_exception == __pyx_v_6gevent_8__waiter__NONE);
+  __pyx_t_2 = (__pyx_t_1 != 0);
+  if (__pyx_t_2) {
+/* … */
+  }
+
+083:             return '<%s greenlet=%s>' % (type(self).__name__, self.greenlet)
+
    __Pyx_XDECREF(__pyx_r);
+    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))), __pyx_n_s_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 83, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 83, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_GIVEREF(__pyx_t_3);
+    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
+    __Pyx_INCREF(((PyObject *)__pyx_v_self->greenlet));
+    __Pyx_GIVEREF(((PyObject *)__pyx_v_self->greenlet));
+    PyTuple_SET_ITEM(__pyx_t_4, 1, ((PyObject *)__pyx_v_self->greenlet));
+    __pyx_t_3 = 0;
+    __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_s_greenlet_s, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 83, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __pyx_r = __pyx_t_3;
+    __pyx_t_3 = 0;
+    goto __pyx_L0;
+
+084:         if self._exception is None:
+
  __pyx_t_2 = (__pyx_v_self->_exception == Py_None);
+  __pyx_t_1 = (__pyx_t_2 != 0);
+  if (__pyx_t_1) {
+/* … */
+  }
+
+085:             return '<%s greenlet=%s value=%r>' % (type(self).__name__, self.greenlet, self.value)
+
    __Pyx_XDECREF(__pyx_r);
+    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))), __pyx_n_s_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 85, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 85, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_GIVEREF(__pyx_t_3);
+    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
+    __Pyx_INCREF(((PyObject *)__pyx_v_self->greenlet));
+    __Pyx_GIVEREF(((PyObject *)__pyx_v_self->greenlet));
+    PyTuple_SET_ITEM(__pyx_t_4, 1, ((PyObject *)__pyx_v_self->greenlet));
+    __Pyx_INCREF(__pyx_v_self->value);
+    __Pyx_GIVEREF(__pyx_v_self->value);
+    PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_self->value);
+    __pyx_t_3 = 0;
+    __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_s_greenlet_s_value_r, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 85, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __pyx_r = __pyx_t_3;
+    __pyx_t_3 = 0;
+    goto __pyx_L0;
+
+086:         return '<%s greenlet=%s exc_info=%r>' % (type(self).__name__, self.greenlet, self.exc_info)
+
  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))), __pyx_n_s_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 86, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_exc_info); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 86, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_4);
+  __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 86, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_5);
+  __Pyx_GIVEREF(__pyx_t_3);
+  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3);
+  __Pyx_INCREF(((PyObject *)__pyx_v_self->greenlet));
+  __Pyx_GIVEREF(((PyObject *)__pyx_v_self->greenlet));
+  PyTuple_SET_ITEM(__pyx_t_5, 1, ((PyObject *)__pyx_v_self->greenlet));
+  __Pyx_GIVEREF(__pyx_t_4);
+  PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_4);
+  __pyx_t_3 = 0;
+  __pyx_t_4 = 0;
+  __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_s_greenlet_s_exc_info_r, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 86, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_4);
+  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+  __pyx_r = __pyx_t_4;
+  __pyx_t_4 = 0;
+  goto __pyx_L0;
+
 087: 
+
+088:     def ready(self):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_8__waiter_6Waiter_7ready(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6gevent_8__waiter_6Waiter_6ready[] = "Waiter.ready(self)\nReturn true if and only if it holds a value or an exception";
+static PyMethodDef __pyx_mdef_6gevent_8__waiter_6Waiter_7ready = {"ready", (PyCFunction)__pyx_pw_6gevent_8__waiter_6Waiter_7ready, METH_NOARGS, __pyx_doc_6gevent_8__waiter_6Waiter_6ready};
+static PyObject *__pyx_pw_6gevent_8__waiter_6Waiter_7ready(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("ready (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_8__waiter_6Waiter_6ready(((struct __pyx_obj_6gevent_8__waiter_Waiter *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_8__waiter_6Waiter_6ready(struct __pyx_obj_6gevent_8__waiter_Waiter *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("ready", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_AddTraceback("gevent.__waiter.Waiter.ready", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__5 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 88, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__5);
+  __Pyx_GIVEREF(__pyx_tuple__5);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_8__waiter_6Waiter_7ready, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Waiter_ready, NULL, __pyx_n_s_gevent___waiter, __pyx_d, ((PyObject *)__pyx_codeobj__6)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 88, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_8__waiter_Waiter->tp_dict, __pyx_n_s_ready, __pyx_t_2) < 0) __PYX_ERR(0, 88, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_8__waiter_Waiter);
+  __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__5, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__waiter_py, __pyx_n_s_ready, 88, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__6)) __PYX_ERR(0, 88, __pyx_L1_error)
+
 089:         """Return true if and only if it holds a value or an exception"""
+
+090:         return self._exception is not _NONE
+
  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = (__pyx_v_self->_exception != __pyx_v_6gevent_8__waiter__NONE);
+  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 90, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_r = __pyx_t_2;
+  __pyx_t_2 = 0;
+  goto __pyx_L0;
+
 091: 
+
+092:     def successful(self):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_8__waiter_6Waiter_9successful(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6gevent_8__waiter_6Waiter_8successful[] = "Waiter.successful(self)\nReturn true if and only if it is ready and holds a value";
+static PyMethodDef __pyx_mdef_6gevent_8__waiter_6Waiter_9successful = {"successful", (PyCFunction)__pyx_pw_6gevent_8__waiter_6Waiter_9successful, METH_NOARGS, __pyx_doc_6gevent_8__waiter_6Waiter_8successful};
+static PyObject *__pyx_pw_6gevent_8__waiter_6Waiter_9successful(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("successful (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_8__waiter_6Waiter_8successful(((struct __pyx_obj_6gevent_8__waiter_Waiter *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_8__waiter_6Waiter_8successful(struct __pyx_obj_6gevent_8__waiter_Waiter *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("successful", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_AddTraceback("gevent.__waiter.Waiter.successful", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__7 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 92, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__7);
+  __Pyx_GIVEREF(__pyx_tuple__7);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_8__waiter_6Waiter_9successful, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Waiter_successful, NULL, __pyx_n_s_gevent___waiter, __pyx_d, ((PyObject *)__pyx_codeobj__8)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 92, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_8__waiter_Waiter->tp_dict, __pyx_n_s_successful, __pyx_t_2) < 0) __PYX_ERR(0, 92, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_8__waiter_Waiter);
+  __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__waiter_py, __pyx_n_s_successful, 92, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) __PYX_ERR(0, 92, __pyx_L1_error)
+
 093:         """Return true if and only if it is ready and holds a value"""
+
+094:         return self._exception is None
+
  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = (__pyx_v_self->_exception == Py_None);
+  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 94, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_r = __pyx_t_2;
+  __pyx_t_2 = 0;
+  goto __pyx_L0;
+
 095: 
+
 096:     @property
+
+097:     def exc_info(self):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_8__waiter_6Waiter_8exc_info_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_8__waiter_6Waiter_8exc_info_1__get__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_8__waiter_6Waiter_8exc_info___get__(((struct __pyx_obj_6gevent_8__waiter_Waiter *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_8__waiter_6Waiter_8exc_info___get__(struct __pyx_obj_6gevent_8__waiter_Waiter *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
 098:         "Holds the exception info passed to :meth:`throw` if :meth:`throw` was called. Otherwise ``None``."
+
+099:         if self._exception is not _NONE:
+
  __pyx_t_1 = (__pyx_v_self->_exception != __pyx_v_6gevent_8__waiter__NONE);
+  __pyx_t_2 = (__pyx_t_1 != 0);
+  if (__pyx_t_2) {
+/* … */
+  }
+
+100:             return self._exception
+
    __Pyx_XDECREF(__pyx_r);
+    __Pyx_INCREF(__pyx_v_self->_exception);
+    __pyx_r = __pyx_v_self->_exception;
+    goto __pyx_L0;
+
 101: 
+
+102:     def switch(self, value):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_8__waiter_6Waiter_11switch(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
+static char __pyx_doc_6gevent_8__waiter_6Waiter_10switch[] = "Waiter.switch(self, value)\n\n        Switch to the greenlet if one's available. Otherwise store the\n        *value*.\n\n        .. versionchanged:: 1.3b1\n           The *value* is no longer optional.\n        ";
+static PyMethodDef __pyx_mdef_6gevent_8__waiter_6Waiter_11switch = {"switch", (PyCFunction)__pyx_pw_6gevent_8__waiter_6Waiter_11switch, METH_O, __pyx_doc_6gevent_8__waiter_6Waiter_10switch};
+static PyObject *__pyx_pw_6gevent_8__waiter_6Waiter_11switch(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("switch (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_8__waiter_6Waiter_10switch(((struct __pyx_obj_6gevent_8__waiter_Waiter *)__pyx_v_self), ((PyObject *)__pyx_v_value));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_8__waiter_6Waiter_10switch(struct __pyx_obj_6gevent_8__waiter_Waiter *__pyx_v_self, PyObject *__pyx_v_value) {
+  PyGreenlet *__pyx_v_greenlet = NULL;
+  PyObject *__pyx_v_switch = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("switch", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_7);
+  __Pyx_XDECREF(__pyx_t_8);
+  __Pyx_XDECREF(__pyx_t_9);
+  __Pyx_XDECREF(__pyx_t_10);
+  __Pyx_XDECREF(__pyx_t_11);
+  __Pyx_XDECREF(__pyx_t_12);
+  __Pyx_XDECREF(__pyx_t_13);
+  __Pyx_AddTraceback("gevent.__waiter.Waiter.switch", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XDECREF((PyObject *)__pyx_v_greenlet);
+  __Pyx_XDECREF(__pyx_v_switch);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__9 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_value, __pyx_n_s_greenlet, __pyx_n_s_switch); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 102, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__9);
+  __Pyx_GIVEREF(__pyx_tuple__9);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_8__waiter_6Waiter_11switch, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Waiter_switch, NULL, __pyx_n_s_gevent___waiter, __pyx_d, ((PyObject *)__pyx_codeobj__10)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 102, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_8__waiter_Waiter->tp_dict, __pyx_n_s_switch, __pyx_t_2) < 0) __PYX_ERR(0, 102, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_8__waiter_Waiter);
+  __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__9, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__waiter_py, __pyx_n_s_switch, 102, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__10)) __PYX_ERR(0, 102, __pyx_L1_error)
+
 103:         """
+
 104:         Switch to the greenlet if one's available. Otherwise store the
+
 105:         *value*.
+
 106: 
+
 107:         .. versionchanged:: 1.3b1
+
 108:            The *value* is no longer optional.
+
 109:         """
+
+110:         greenlet = self.greenlet
+
  __pyx_t_1 = ((PyObject *)__pyx_v_self->greenlet);
+  __Pyx_INCREF(__pyx_t_1);
+  __pyx_v_greenlet = ((PyGreenlet *)__pyx_t_1);
+  __pyx_t_1 = 0;
+
+111:         if greenlet is None:
+
  __pyx_t_2 = (((PyObject *)__pyx_v_greenlet) == Py_None);
+  __pyx_t_3 = (__pyx_t_2 != 0);
+  if (__pyx_t_3) {
+/* … */
+    goto __pyx_L3;
+  }
+
+112:             self.value = value
+
    __Pyx_INCREF(__pyx_v_value);
+    __Pyx_GIVEREF(__pyx_v_value);
+    __Pyx_GOTREF(__pyx_v_self->value);
+    __Pyx_DECREF(__pyx_v_self->value);
+    __pyx_v_self->value = __pyx_v_value;
+
+113:             self._exception = None
+
    __Pyx_INCREF(Py_None);
+    __Pyx_GIVEREF(Py_None);
+    __Pyx_GOTREF(__pyx_v_self->_exception);
+    __Pyx_DECREF(__pyx_v_self->_exception);
+    __pyx_v_self->_exception = Py_None;
+
 114:         else:
+
+115:             if getcurrent() is not self.hub: # pylint:disable=undefined-variable
+
  /*else*/ {
+    __pyx_t_1 = ((PyObject *)__pyx_f_6gevent_8__waiter_getcurrent()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 115, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __pyx_t_3 = (__pyx_t_1 != ((PyObject *)__pyx_v_self->hub));
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __pyx_t_2 = (__pyx_t_3 != 0);
+    if (unlikely(__pyx_t_2)) {
+/* … */
+    }
+
+116:                 raise AssertionError("Can only use Waiter.switch method from the Hub greenlet")
+
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_AssertionError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 116, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      __Pyx_Raise(__pyx_t_1, 0, 0, 0);
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      __PYX_ERR(0, 116, __pyx_L1_error)
+/* … */
+  __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_Can_only_use_Waiter_switch_metho); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 116, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple_);
+  __Pyx_GIVEREF(__pyx_tuple_);
+
+117:             switch = greenlet.switch
+
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_greenlet), __pyx_n_s_switch); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 117, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __pyx_v_switch = __pyx_t_1;
+    __pyx_t_1 = 0;
+
+118:             try:
+
    {
+      /*try:*/ {
+/* … */
+      }
+      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+      goto __pyx_L10_try_end;
+      __pyx_L5_error:;
+      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
+      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+/* … */
+      __Pyx_XGIVEREF(__pyx_t_4);
+      __Pyx_XGIVEREF(__pyx_t_5);
+      __Pyx_XGIVEREF(__pyx_t_6);
+      __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
+      goto __pyx_L1_error;
+      __pyx_L6_exception_handled:;
+      __Pyx_XGIVEREF(__pyx_t_4);
+      __Pyx_XGIVEREF(__pyx_t_5);
+      __Pyx_XGIVEREF(__pyx_t_6);
+      __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
+      __pyx_L10_try_end:;
+    }
+  }
+  __pyx_L3:;
+
+119:                 switch(value)
+
        __Pyx_INCREF(__pyx_v_switch);
+        __pyx_t_7 = __pyx_v_switch; __pyx_t_8 = NULL;
+        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
+          __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
+          if (likely(__pyx_t_8)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
+            __Pyx_INCREF(__pyx_t_8);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_7, function);
+          }
+        }
+        __pyx_t_1 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_8, __pyx_v_value) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_value);
+        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
+        if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 119, __pyx_L5_error)
+        __Pyx_GOTREF(__pyx_t_1);
+        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+120:             except: # pylint:disable=bare-except
+
      /*except:*/ {
+        __Pyx_AddTraceback("gevent.__waiter.Waiter.switch", __pyx_clineno, __pyx_lineno, __pyx_filename);
+        if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(0, 120, __pyx_L7_except_error)
+        __Pyx_GOTREF(__pyx_t_1);
+        __Pyx_GOTREF(__pyx_t_7);
+        __Pyx_GOTREF(__pyx_t_8);
+
+121:                 self.hub.handle_error(switch, *sys.exc_info())
+
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->hub), __pyx_n_s_handle_error); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 121, __pyx_L7_except_error)
+        __Pyx_GOTREF(__pyx_t_9);
+        __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 121, __pyx_L7_except_error)
+        __Pyx_GOTREF(__pyx_t_10);
+        __Pyx_INCREF(__pyx_v_switch);
+        __Pyx_GIVEREF(__pyx_v_switch);
+        PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v_switch);
+        __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_6gevent_8__waiter_sys, __pyx_n_s_exc_info); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 121, __pyx_L7_except_error)
+        __Pyx_GOTREF(__pyx_t_12);
+        __pyx_t_13 = NULL;
+        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) {
+          __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_12);
+          if (likely(__pyx_t_13)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
+            __Pyx_INCREF(__pyx_t_13);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_12, function);
+          }
+        }
+        __pyx_t_11 = (__pyx_t_13) ? __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_13) : __Pyx_PyObject_CallNoArg(__pyx_t_12);
+        __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
+        if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 121, __pyx_L7_except_error)
+        __Pyx_GOTREF(__pyx_t_11);
+        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
+        __pyx_t_12 = __Pyx_PySequence_Tuple(__pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 121, __pyx_L7_except_error)
+        __Pyx_GOTREF(__pyx_t_12);
+        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+        __pyx_t_11 = PyNumber_Add(__pyx_t_10, __pyx_t_12); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 121, __pyx_L7_except_error)
+        __Pyx_GOTREF(__pyx_t_11);
+        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
+        __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_11, NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 121, __pyx_L7_except_error)
+        __Pyx_GOTREF(__pyx_t_12);
+        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
+        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
+        goto __pyx_L6_exception_handled;
+      }
+      __pyx_L7_except_error:;
+
 122: 
+
+123:     def switch_args(self, *args):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_8__waiter_6Waiter_13switch_args(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_6gevent_8__waiter_6Waiter_12switch_args[] = "Waiter.switch_args(self, *args)";
+static PyMethodDef __pyx_mdef_6gevent_8__waiter_6Waiter_13switch_args = {"switch_args", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_8__waiter_6Waiter_13switch_args, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_8__waiter_6Waiter_12switch_args};
+static PyObject *__pyx_pw_6gevent_8__waiter_6Waiter_13switch_args(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_args = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("switch_args (wrapper)", 0);
+  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "switch_args", 0))) return NULL;
+  __Pyx_INCREF(__pyx_args);
+  __pyx_v_args = __pyx_args;
+  __pyx_r = __pyx_pf_6gevent_8__waiter_6Waiter_12switch_args(((struct __pyx_obj_6gevent_8__waiter_Waiter *)__pyx_v_self), __pyx_v_args);
+
+  /* function exit code */
+  __Pyx_XDECREF(__pyx_v_args);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_8__waiter_6Waiter_12switch_args(struct __pyx_obj_6gevent_8__waiter_Waiter *__pyx_v_self, PyObject *__pyx_v_args) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("switch_args", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_AddTraceback("gevent.__waiter.Waiter.switch_args", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__11 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_args); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 123, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__11);
+  __Pyx_GIVEREF(__pyx_tuple__11);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_8__waiter_6Waiter_13switch_args, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Waiter_switch_args, NULL, __pyx_n_s_gevent___waiter, __pyx_d, ((PyObject *)__pyx_codeobj__12)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 123, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_8__waiter_Waiter->tp_dict, __pyx_n_s_switch_args, __pyx_t_2) < 0) __PYX_ERR(0, 123, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_8__waiter_Waiter);
+  __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__11, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__waiter_py, __pyx_n_s_switch_args, 123, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(0, 123, __pyx_L1_error)
+
+124:         return self.switch(args)
+
  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_switch); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 124, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = NULL;
+  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+    if (likely(__pyx_t_3)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+      __Pyx_INCREF(__pyx_t_3);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_2, function);
+    }
+  }
+  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_args) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_args);
+  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 124, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
 125: 
+
+126:     def throw(self, *throw_args):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_8__waiter_6Waiter_15throw(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_6gevent_8__waiter_6Waiter_14throw[] = "Waiter.throw(self, *throw_args)\nSwitch to the greenlet with the exception. If there's no greenlet, store the exception.";
+static PyMethodDef __pyx_mdef_6gevent_8__waiter_6Waiter_15throw = {"throw", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_8__waiter_6Waiter_15throw, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_8__waiter_6Waiter_14throw};
+static PyObject *__pyx_pw_6gevent_8__waiter_6Waiter_15throw(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_throw_args = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("throw (wrapper)", 0);
+  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "throw", 0))) return NULL;
+  __Pyx_INCREF(__pyx_args);
+  __pyx_v_throw_args = __pyx_args;
+  __pyx_r = __pyx_pf_6gevent_8__waiter_6Waiter_14throw(((struct __pyx_obj_6gevent_8__waiter_Waiter *)__pyx_v_self), __pyx_v_throw_args);
+
+  /* function exit code */
+  __Pyx_XDECREF(__pyx_v_throw_args);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_8__waiter_6Waiter_14throw(struct __pyx_obj_6gevent_8__waiter_Waiter *__pyx_v_self, PyObject *__pyx_v_throw_args) {
+  PyGreenlet *__pyx_v_greenlet = NULL;
+  PyObject *__pyx_v_throw = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("throw", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_7);
+  __Pyx_XDECREF(__pyx_t_8);
+  __Pyx_XDECREF(__pyx_t_9);
+  __Pyx_XDECREF(__pyx_t_10);
+  __Pyx_XDECREF(__pyx_t_11);
+  __Pyx_XDECREF(__pyx_t_12);
+  __Pyx_XDECREF(__pyx_t_13);
+  __Pyx_AddTraceback("gevent.__waiter.Waiter.throw", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XDECREF((PyObject *)__pyx_v_greenlet);
+  __Pyx_XDECREF(__pyx_v_throw);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__13 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_throw_args, __pyx_n_s_greenlet, __pyx_n_s_throw); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 126, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__13);
+  __Pyx_GIVEREF(__pyx_tuple__13);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_8__waiter_6Waiter_15throw, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Waiter_throw, NULL, __pyx_n_s_gevent___waiter, __pyx_d, ((PyObject *)__pyx_codeobj__14)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 126, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_8__waiter_Waiter->tp_dict, __pyx_n_s_throw, __pyx_t_2) < 0) __PYX_ERR(0, 126, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_8__waiter_Waiter);
+  __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__13, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__waiter_py, __pyx_n_s_throw, 126, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__14)) __PYX_ERR(0, 126, __pyx_L1_error)
+
 127:         """Switch to the greenlet with the exception. If there's no greenlet, store the exception."""
+
+128:         greenlet = self.greenlet
+
  __pyx_t_1 = ((PyObject *)__pyx_v_self->greenlet);
+  __Pyx_INCREF(__pyx_t_1);
+  __pyx_v_greenlet = ((PyGreenlet *)__pyx_t_1);
+  __pyx_t_1 = 0;
+
+129:         if greenlet is None:
+
  __pyx_t_2 = (((PyObject *)__pyx_v_greenlet) == Py_None);
+  __pyx_t_3 = (__pyx_t_2 != 0);
+  if (__pyx_t_3) {
+/* … */
+    goto __pyx_L3;
+  }
+
+130:             self._exception = throw_args
+
    __Pyx_INCREF(__pyx_v_throw_args);
+    __Pyx_GIVEREF(__pyx_v_throw_args);
+    __Pyx_GOTREF(__pyx_v_self->_exception);
+    __Pyx_DECREF(__pyx_v_self->_exception);
+    __pyx_v_self->_exception = __pyx_v_throw_args;
+
 131:         else:
+
+132:             if getcurrent() is not self.hub: # pylint:disable=undefined-variable
+
  /*else*/ {
+    __pyx_t_1 = ((PyObject *)__pyx_f_6gevent_8__waiter_getcurrent()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 132, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __pyx_t_3 = (__pyx_t_1 != ((PyObject *)__pyx_v_self->hub));
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __pyx_t_2 = (__pyx_t_3 != 0);
+    if (unlikely(__pyx_t_2)) {
+/* … */
+    }
+
+133:                 raise AssertionError("Can only use Waiter.switch method from the Hub greenlet")
+
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_AssertionError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 133, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      __Pyx_Raise(__pyx_t_1, 0, 0, 0);
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      __PYX_ERR(0, 133, __pyx_L1_error)
+
+134:             throw = greenlet.throw
+
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_greenlet), __pyx_n_s_throw); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 134, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __pyx_v_throw = __pyx_t_1;
+    __pyx_t_1 = 0;
+
+135:             try:
+
    {
+      /*try:*/ {
+/* … */
+      }
+      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+      goto __pyx_L10_try_end;
+      __pyx_L5_error:;
+      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+/* … */
+      __Pyx_XGIVEREF(__pyx_t_4);
+      __Pyx_XGIVEREF(__pyx_t_5);
+      __Pyx_XGIVEREF(__pyx_t_6);
+      __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
+      goto __pyx_L1_error;
+      __pyx_L6_exception_handled:;
+      __Pyx_XGIVEREF(__pyx_t_4);
+      __Pyx_XGIVEREF(__pyx_t_5);
+      __Pyx_XGIVEREF(__pyx_t_6);
+      __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
+      __pyx_L10_try_end:;
+    }
+  }
+  __pyx_L3:;
+
+136:                 throw(*throw_args)
+
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_throw, __pyx_v_throw_args, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 136, __pyx_L5_error)
+        __Pyx_GOTREF(__pyx_t_1);
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+137:             except: # pylint:disable=bare-except
+
      /*except:*/ {
+        __Pyx_AddTraceback("gevent.__waiter.Waiter.throw", __pyx_clineno, __pyx_lineno, __pyx_filename);
+        if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(0, 137, __pyx_L7_except_error)
+        __Pyx_GOTREF(__pyx_t_1);
+        __Pyx_GOTREF(__pyx_t_7);
+        __Pyx_GOTREF(__pyx_t_8);
+
+138:                 self.hub.handle_error(throw, *sys.exc_info())
+
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->hub), __pyx_n_s_handle_error); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 138, __pyx_L7_except_error)
+        __Pyx_GOTREF(__pyx_t_9);
+        __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 138, __pyx_L7_except_error)
+        __Pyx_GOTREF(__pyx_t_10);
+        __Pyx_INCREF(__pyx_v_throw);
+        __Pyx_GIVEREF(__pyx_v_throw);
+        PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v_throw);
+        __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_6gevent_8__waiter_sys, __pyx_n_s_exc_info); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 138, __pyx_L7_except_error)
+        __Pyx_GOTREF(__pyx_t_12);
+        __pyx_t_13 = NULL;
+        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) {
+          __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_12);
+          if (likely(__pyx_t_13)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
+            __Pyx_INCREF(__pyx_t_13);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_12, function);
+          }
+        }
+        __pyx_t_11 = (__pyx_t_13) ? __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_13) : __Pyx_PyObject_CallNoArg(__pyx_t_12);
+        __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
+        if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 138, __pyx_L7_except_error)
+        __Pyx_GOTREF(__pyx_t_11);
+        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
+        __pyx_t_12 = __Pyx_PySequence_Tuple(__pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 138, __pyx_L7_except_error)
+        __Pyx_GOTREF(__pyx_t_12);
+        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+        __pyx_t_11 = PyNumber_Add(__pyx_t_10, __pyx_t_12); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 138, __pyx_L7_except_error)
+        __Pyx_GOTREF(__pyx_t_11);
+        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
+        __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_11, NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 138, __pyx_L7_except_error)
+        __Pyx_GOTREF(__pyx_t_12);
+        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
+        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
+        goto __pyx_L6_exception_handled;
+      }
+      __pyx_L7_except_error:;
+
 139: 
+
+140:     def get(self):
+
static PyObject *__pyx_pw_6gevent_8__waiter_6Waiter_17get(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyObject *__pyx_f_6gevent_8__waiter_6Waiter_get(struct __pyx_obj_6gevent_8__waiter_Waiter *__pyx_v_self, int __pyx_skip_dispatch) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("get", 0);
+  /* Check if called by wrapper */
+  if (unlikely(__pyx_skip_dispatch)) ;
+  /* Check if overridden in Python */
+  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
+    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
+    if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
+    else {
+      PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      #endif
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 140, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_8__waiter_6Waiter_17get)) {
+        __Pyx_XDECREF(__pyx_r);
+        __Pyx_INCREF(__pyx_t_1);
+        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+          if (likely(__pyx_t_4)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+            __Pyx_INCREF(__pyx_t_4);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_3, function);
+          }
+        }
+        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
+        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 140, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __pyx_r = __pyx_t_2;
+        __pyx_t_2 = 0;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        goto __pyx_L0;
+      }
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+      tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
+      if (unlikely(type_dict_guard != tp_dict_version)) {
+        tp_dict_version = obj_dict_version = 0;
+      }
+      #endif
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    }
+    #endif
+  }
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_AddTraceback("gevent.__waiter.Waiter.get", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_8__waiter_6Waiter_17get(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6gevent_8__waiter_6Waiter_16get[] = "Waiter.get(self)\nIf a value/an exception is stored, return/raise it. Otherwise until switch() or throw() is called.";
+static PyMethodDef __pyx_mdef_6gevent_8__waiter_6Waiter_17get = {"get", (PyCFunction)__pyx_pw_6gevent_8__waiter_6Waiter_17get, METH_NOARGS, __pyx_doc_6gevent_8__waiter_6Waiter_16get};
+static PyObject *__pyx_pw_6gevent_8__waiter_6Waiter_17get(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("get (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_8__waiter_6Waiter_16get(((struct __pyx_obj_6gevent_8__waiter_Waiter *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_8__waiter_6Waiter_16get(struct __pyx_obj_6gevent_8__waiter_Waiter *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("get", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __pyx_f_6gevent_8__waiter_6Waiter_get(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 140, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.__waiter.Waiter.get", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__15 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(0, 140, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__15);
+  __Pyx_GIVEREF(__pyx_tuple__15);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_8__waiter_6Waiter_17get, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Waiter_get, NULL, __pyx_n_s_gevent___waiter, __pyx_d, ((PyObject *)__pyx_codeobj__16)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 140, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_8__waiter_Waiter->tp_dict, __pyx_n_s_get, __pyx_t_2) < 0) __PYX_ERR(0, 140, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_8__waiter_Waiter);
+  __pyx_codeobj__16 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__15, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__waiter_py, __pyx_n_s_get, 140, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__16)) __PYX_ERR(0, 140, __pyx_L1_error)
+
 141:         """If a value/an exception is stored, return/raise it. Otherwise until switch() or throw() is called."""
+
+142:         if self._exception is not _NONE:
+
  __pyx_t_5 = (__pyx_v_self->_exception != __pyx_v_6gevent_8__waiter__NONE);
+  __pyx_t_6 = (__pyx_t_5 != 0);
+  if (__pyx_t_6) {
+/* … */
+    goto __pyx_L3;
+  }
+
+143:             if self._exception is None:
+
    __pyx_t_6 = (__pyx_v_self->_exception == Py_None);
+    __pyx_t_5 = (__pyx_t_6 != 0);
+    if (__pyx_t_5) {
+/* … */
+    }
+
+144:                 return self.value
+
      __Pyx_XDECREF(__pyx_r);
+      __Pyx_INCREF(__pyx_v_self->value);
+      __pyx_r = __pyx_v_self->value;
+      goto __pyx_L0;
+
+145:             getcurrent().throw(*self._exception) # pylint:disable=undefined-variable
+
    __pyx_t_1 = ((PyObject *)__pyx_f_6gevent_8__waiter_getcurrent()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 145, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_throw); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 145, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __pyx_t_1 = __Pyx_PySequence_Tuple(__pyx_v_self->_exception); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 145, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 145, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+
 146:         else:
+
+147:             if self.greenlet is not None:
+
  /*else*/ {
+    __pyx_t_5 = (((PyObject *)__pyx_v_self->greenlet) != Py_None);
+    __pyx_t_6 = (__pyx_t_5 != 0);
+    if (unlikely(__pyx_t_6)) {
+/* … */
+    }
+
+148:                 raise ConcurrentObjectUseError('This Waiter is already used by %r' % (self.greenlet, ))
+
      __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 148, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      __Pyx_INCREF(((PyObject *)__pyx_v_self->greenlet));
+      __Pyx_GIVEREF(((PyObject *)__pyx_v_self->greenlet));
+      PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self->greenlet));
+      __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_This_Waiter_is_already_used_by_r, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 148, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_2);
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      __Pyx_INCREF(__pyx_v_6gevent_8__waiter_ConcurrentObjectUseError);
+      __pyx_t_1 = __pyx_v_6gevent_8__waiter_ConcurrentObjectUseError; __pyx_t_4 = NULL;
+      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
+        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1);
+        if (likely(__pyx_t_4)) {
+          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
+          __Pyx_INCREF(__pyx_t_4);
+          __Pyx_INCREF(function);
+          __Pyx_DECREF_SET(__pyx_t_1, function);
+        }
+      }
+      __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_4, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_2);
+      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 148, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_3);
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      __Pyx_Raise(__pyx_t_3, 0, 0, 0);
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __PYX_ERR(0, 148, __pyx_L1_error)
+
+149:             self.greenlet = getcurrent() # pylint:disable=undefined-variable
+
    __pyx_t_3 = ((PyObject *)__pyx_f_6gevent_8__waiter_getcurrent()); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 149, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_GIVEREF(__pyx_t_3);
+    __Pyx_GOTREF(__pyx_v_self->greenlet);
+    __Pyx_DECREF(((PyObject *)__pyx_v_self->greenlet));
+    __pyx_v_self->greenlet = ((PyGreenlet *)__pyx_t_3);
+    __pyx_t_3 = 0;
+
+150:             try:
+
    /*try:*/ {
+
+151:                 return self.hub.switch()
+
      __Pyx_XDECREF(__pyx_r);
+      __pyx_t_3 = ((struct __pyx_vtabstruct_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *)__pyx_v_self->hub->__pyx_vtab)->__pyx_switch(__pyx_v_self->hub, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 151, __pyx_L7_error)
+      __Pyx_GOTREF(__pyx_t_3);
+      __pyx_r = __pyx_t_3;
+      __pyx_t_3 = 0;
+      goto __pyx_L6_return;
+    }
+
 152:             finally:
+
+153:                 self.greenlet = None
+
    /*finally:*/ {
+      __pyx_L7_error:;
+      /*exception exit:*/{
+        __Pyx_PyThreadState_declare
+        __Pyx_PyThreadState_assign
+        __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0;
+        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+        if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15);
+        if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12) < 0)) __Pyx_ErrFetch(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
+        __Pyx_XGOTREF(__pyx_t_10);
+        __Pyx_XGOTREF(__pyx_t_11);
+        __Pyx_XGOTREF(__pyx_t_12);
+        __Pyx_XGOTREF(__pyx_t_13);
+        __Pyx_XGOTREF(__pyx_t_14);
+        __Pyx_XGOTREF(__pyx_t_15);
+        __pyx_t_7 = __pyx_lineno; __pyx_t_8 = __pyx_clineno; __pyx_t_9 = __pyx_filename;
+        {
+          __Pyx_INCREF(Py_None);
+          __Pyx_GIVEREF(Py_None);
+          __Pyx_GOTREF(__pyx_v_self->greenlet);
+          __Pyx_DECREF(((PyObject *)__pyx_v_self->greenlet));
+          __pyx_v_self->greenlet = ((PyGreenlet *)Py_None);
+        }
+        if (PY_MAJOR_VERSION >= 3) {
+          __Pyx_XGIVEREF(__pyx_t_13);
+          __Pyx_XGIVEREF(__pyx_t_14);
+          __Pyx_XGIVEREF(__pyx_t_15);
+          __Pyx_ExceptionReset(__pyx_t_13, __pyx_t_14, __pyx_t_15);
+        }
+        __Pyx_XGIVEREF(__pyx_t_10);
+        __Pyx_XGIVEREF(__pyx_t_11);
+        __Pyx_XGIVEREF(__pyx_t_12);
+        __Pyx_ErrRestore(__pyx_t_10, __pyx_t_11, __pyx_t_12);
+        __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0;
+        __pyx_lineno = __pyx_t_7; __pyx_clineno = __pyx_t_8; __pyx_filename = __pyx_t_9;
+        goto __pyx_L1_error;
+      }
+      __pyx_L6_return: {
+        __pyx_t_15 = __pyx_r;
+        __pyx_r = 0;
+        __Pyx_INCREF(Py_None);
+        __Pyx_GIVEREF(Py_None);
+        __Pyx_GOTREF(__pyx_v_self->greenlet);
+        __Pyx_DECREF(((PyObject *)__pyx_v_self->greenlet));
+        __pyx_v_self->greenlet = ((PyGreenlet *)Py_None);
+        __pyx_r = __pyx_t_15;
+        __pyx_t_15 = 0;
+        goto __pyx_L0;
+      }
+    }
+  }
+  __pyx_L3:;
+
 154: 
+
+155:     def __call__(self, source):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_8__waiter_6Waiter_19__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_pw_6gevent_8__waiter_6Waiter_19__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_source = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__call__ (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_source,0};
+    PyObject* values[1] = {0};
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_source)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__call__") < 0)) __PYX_ERR(0, 155, __pyx_L3_error)
+      }
+    } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
+      goto __pyx_L5_argtuple_error;
+    } else {
+      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+    }
+    __pyx_v_source = values[0];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("__call__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 155, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.__waiter.Waiter.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_8__waiter_6Waiter_18__call__(((struct __pyx_obj_6gevent_8__waiter_Waiter *)__pyx_v_self), __pyx_v_source);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_8__waiter_6Waiter_18__call__(struct __pyx_obj_6gevent_8__waiter_Waiter *__pyx_v_self, PyObject *__pyx_v_source) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__call__", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_XDECREF(__pyx_t_6);
+  __Pyx_AddTraceback("gevent.__waiter.Waiter.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+156:         if source.exception is None:
+
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_source, __pyx_n_s_exception); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 156, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = (__pyx_t_1 == Py_None);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_3 = (__pyx_t_2 != 0);
+  if (__pyx_t_3) {
+/* … */
+    goto __pyx_L3;
+  }
+
+157:             self.switch(source.value)
+
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_switch); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 157, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_source, __pyx_n_s_value); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 157, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_5);
+    __pyx_t_6 = NULL;
+    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
+      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
+      if (likely(__pyx_t_6)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
+        __Pyx_INCREF(__pyx_t_6);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_4, function);
+      }
+    }
+    __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_6, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5);
+    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 157, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 158:         else:
+
+159:             self.throw(source.exception)
+
  /*else*/ {
+    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_throw); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 159, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_source, __pyx_n_s_exception); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 159, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_5);
+    __pyx_t_6 = NULL;
+    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
+      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
+      if (likely(__pyx_t_6)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
+        __Pyx_INCREF(__pyx_t_6);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_4, function);
+      }
+    }
+    __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_6, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5);
+    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 159, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  }
+  __pyx_L3:;
+
 160: 
+
 161:     # can also have a debugging version, that wraps the value in a tuple (self, value) in switch()
+
 162:     # and unwraps it in wait() thus checking that switch() was indeed called
+
 163: 
+
 164: 
+
 165: 
+
+166: class MultipleWaiter(Waiter):
+
struct __pyx_vtabstruct_6gevent_8__waiter_MultipleWaiter {
+  struct __pyx_vtabstruct_6gevent_8__waiter_Waiter __pyx_base;
+};
+static struct __pyx_vtabstruct_6gevent_8__waiter_MultipleWaiter *__pyx_vtabptr_6gevent_8__waiter_MultipleWaiter;
+
 167:     """
+
 168:     An internal extension of Waiter that can be used if multiple objects
+
 169:     must be waited on, and there is a chance that in between waits greenlets
+
 170:     might be switched out. All greenlets that switch to this waiter
+
 171:     will have their value returned.
+
 172: 
+
 173:     This does not handle exceptions or throw methods.
+
 174:     """
+
+175:     __slots__ = ['_values']
+
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 175, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_values);
+  __Pyx_GIVEREF(__pyx_n_s_values);
+  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_values);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_8__waiter_MultipleWaiter->tp_dict, __pyx_n_s_slots, __pyx_t_2) < 0) __PYX_ERR(0, 175, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_8__waiter_MultipleWaiter);
+
 176: 
+
+177:     def __init__(self, hub=None):
+
/* Python wrapper */
+static int __pyx_pw_6gevent_8__waiter_14MultipleWaiter_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static int __pyx_pw_6gevent_8__waiter_14MultipleWaiter_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_hub = 0;
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_hub,0};
+    PyObject* values[1] = {0};
+    values[0] = ((PyObject *)Py_None);
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_hub);
+          if (value) { values[0] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 177, __pyx_L3_error)
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    __pyx_v_hub = values[0];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 177, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.__waiter.MultipleWaiter.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return -1;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_8__waiter_14MultipleWaiter___init__(((struct __pyx_obj_6gevent_8__waiter_MultipleWaiter *)__pyx_v_self), __pyx_v_hub);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_8__waiter_14MultipleWaiter___init__(struct __pyx_obj_6gevent_8__waiter_MultipleWaiter *__pyx_v_self, PyObject *__pyx_v_hub) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = 0;
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_AddTraceback("gevent.__waiter.MultipleWaiter.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = -1;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+178:         Waiter.__init__(self, hub)
+
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_6gevent_8__waiter_Waiter), __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 178, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = NULL;
+  __pyx_t_4 = 0;
+  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+    if (likely(__pyx_t_3)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+      __Pyx_INCREF(__pyx_t_3);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_2, function);
+      __pyx_t_4 = 1;
+    }
+  }
+  #if CYTHON_FAST_PYCALL
+  if (PyFunction_Check(__pyx_t_2)) {
+    PyObject *__pyx_temp[3] = {__pyx_t_3, ((PyObject *)__pyx_v_self), __pyx_v_hub};
+    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 178, __pyx_L1_error)
+    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __Pyx_GOTREF(__pyx_t_1);
+  } else
+  #endif
+  #if CYTHON_FAST_PYCCALL
+  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
+    PyObject *__pyx_temp[3] = {__pyx_t_3, ((PyObject *)__pyx_v_self), __pyx_v_hub};
+    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 178, __pyx_L1_error)
+    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __Pyx_GOTREF(__pyx_t_1);
+  } else
+  #endif
+  {
+    __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 178, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_5);
+    if (__pyx_t_3) {
+      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
+    }
+    __Pyx_INCREF(((PyObject *)__pyx_v_self));
+    __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
+    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, ((PyObject *)__pyx_v_self));
+    __Pyx_INCREF(__pyx_v_hub);
+    __Pyx_GIVEREF(__pyx_v_hub);
+    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_hub);
+    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 178, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+  }
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 179:         # we typically expect a relatively small number of these to be outstanding.
+
 180:         # since we pop from the left, a deque might be slightly
+
 181:         # more efficient, but since we're in the hub we avoid imports if
+
 182:         # we can help it to better support monkey-patching, and delaying the import
+
 183:         # here can be impractical (see https://github.com/gevent/gevent/issues/652)
+
+184:         self._values = list()
+
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 184, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_1);
+  __Pyx_GOTREF(__pyx_v_self->_values);
+  __Pyx_DECREF(__pyx_v_self->_values);
+  __pyx_v_self->_values = ((PyObject*)__pyx_t_1);
+  __pyx_t_1 = 0;
+
 185: 
+
+186:     def switch(self, value):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_8__waiter_14MultipleWaiter_3switch(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
+static char __pyx_doc_6gevent_8__waiter_14MultipleWaiter_2switch[] = "MultipleWaiter.switch(self, value)";
+static PyMethodDef __pyx_mdef_6gevent_8__waiter_14MultipleWaiter_3switch = {"switch", (PyCFunction)__pyx_pw_6gevent_8__waiter_14MultipleWaiter_3switch, METH_O, __pyx_doc_6gevent_8__waiter_14MultipleWaiter_2switch};
+static PyObject *__pyx_pw_6gevent_8__waiter_14MultipleWaiter_3switch(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("switch (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_8__waiter_14MultipleWaiter_2switch(((struct __pyx_obj_6gevent_8__waiter_MultipleWaiter *)__pyx_v_self), ((PyObject *)__pyx_v_value));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_8__waiter_14MultipleWaiter_2switch(struct __pyx_obj_6gevent_8__waiter_MultipleWaiter *__pyx_v_self, PyObject *__pyx_v_value) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("switch", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_6);
+  __Pyx_AddTraceback("gevent.__waiter.MultipleWaiter.switch", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__17 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_value); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(0, 186, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__17);
+  __Pyx_GIVEREF(__pyx_tuple__17);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_8__waiter_14MultipleWaiter_3switch, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_MultipleWaiter_switch, NULL, __pyx_n_s_gevent___waiter, __pyx_d, ((PyObject *)__pyx_codeobj__18)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 186, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_8__waiter_MultipleWaiter->tp_dict, __pyx_n_s_switch, __pyx_t_2) < 0) __PYX_ERR(0, 186, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_8__waiter_MultipleWaiter);
+  __pyx_codeobj__18 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__17, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__waiter_py, __pyx_n_s_switch, 186, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__18)) __PYX_ERR(0, 186, __pyx_L1_error)
+
+187:         self._values.append(value)
+
  if (unlikely(__pyx_v_self->_values == Py_None)) {
+    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "append");
+    __PYX_ERR(0, 187, __pyx_L1_error)
+  }
+  __pyx_t_1 = __Pyx_PyList_Append(__pyx_v_self->_values, __pyx_v_value); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 187, __pyx_L1_error)
+
+188:         Waiter.switch(self, True)
+
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_6gevent_8__waiter_Waiter), __pyx_n_s_switch); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 188, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __pyx_t_4 = NULL;
+  __pyx_t_5 = 0;
+  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
+    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+    if (likely(__pyx_t_4)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+      __Pyx_INCREF(__pyx_t_4);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_3, function);
+      __pyx_t_5 = 1;
+    }
+  }
+  #if CYTHON_FAST_PYCALL
+  if (PyFunction_Check(__pyx_t_3)) {
+    PyObject *__pyx_temp[3] = {__pyx_t_4, ((PyObject *)__pyx_v_self), Py_True};
+    __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 188, __pyx_L1_error)
+    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __Pyx_GOTREF(__pyx_t_2);
+  } else
+  #endif
+  #if CYTHON_FAST_PYCCALL
+  if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
+    PyObject *__pyx_temp[3] = {__pyx_t_4, ((PyObject *)__pyx_v_self), Py_True};
+    __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 188, __pyx_L1_error)
+    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __Pyx_GOTREF(__pyx_t_2);
+  } else
+  #endif
+  {
+    __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 188, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_6);
+    if (__pyx_t_4) {
+      __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
+    }
+    __Pyx_INCREF(((PyObject *)__pyx_v_self));
+    __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
+    PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, ((PyObject *)__pyx_v_self));
+    __Pyx_INCREF(Py_True);
+    __Pyx_GIVEREF(Py_True);
+    PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, Py_True);
+    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 188, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  }
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
 189: 
+
+190:     def get(self):
+
static PyObject *__pyx_pw_6gevent_8__waiter_14MultipleWaiter_5get(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyObject *__pyx_f_6gevent_8__waiter_14MultipleWaiter_get(struct __pyx_obj_6gevent_8__waiter_MultipleWaiter *__pyx_v_self, CYTHON_UNUSED int __pyx_skip_dispatch) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("get", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_AddTraceback("gevent.__waiter.MultipleWaiter.get", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_8__waiter_14MultipleWaiter_5get(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6gevent_8__waiter_14MultipleWaiter_4get[] = "MultipleWaiter.get(self)";
+static PyMethodDef __pyx_mdef_6gevent_8__waiter_14MultipleWaiter_5get = {"get", (PyCFunction)__pyx_pw_6gevent_8__waiter_14MultipleWaiter_5get, METH_NOARGS, __pyx_doc_6gevent_8__waiter_14MultipleWaiter_4get};
+static PyObject *__pyx_pw_6gevent_8__waiter_14MultipleWaiter_5get(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("get (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_8__waiter_14MultipleWaiter_4get(((struct __pyx_obj_6gevent_8__waiter_MultipleWaiter *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_8__waiter_14MultipleWaiter_4get(struct __pyx_obj_6gevent_8__waiter_MultipleWaiter *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("get", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __pyx_f_6gevent_8__waiter_14MultipleWaiter_get(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 190, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.__waiter.MultipleWaiter.get", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__19 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(0, 190, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__19);
+  __Pyx_GIVEREF(__pyx_tuple__19);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_8__waiter_14MultipleWaiter_5get, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_MultipleWaiter_get, NULL, __pyx_n_s_gevent___waiter, __pyx_d, ((PyObject *)__pyx_codeobj__20)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 190, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_8__waiter_MultipleWaiter->tp_dict, __pyx_n_s_get, __pyx_t_2) < 0) __PYX_ERR(0, 190, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_8__waiter_MultipleWaiter);
+  __pyx_codeobj__20 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__19, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__waiter_py, __pyx_n_s_get, 190, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__20)) __PYX_ERR(0, 190, __pyx_L1_error)
+
+191:         if not self._values:
+
  __pyx_t_1 = (__pyx_v_self->_values != Py_None)&&(PyList_GET_SIZE(__pyx_v_self->_values) != 0);
+  __pyx_t_2 = ((!__pyx_t_1) != 0);
+  if (__pyx_t_2) {
+/* … */
+  }
+
+192:             Waiter.get(self)
+
    __pyx_t_3 = __pyx_f_6gevent_8__waiter_6Waiter_get(((struct __pyx_obj_6gevent_8__waiter_Waiter *)__pyx_v_self), 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 192, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+
+193:             Waiter.clear(self)
+
    __pyx_t_3 = __pyx_f_6gevent_8__waiter_6Waiter_clear(((struct __pyx_obj_6gevent_8__waiter_Waiter *)__pyx_v_self), 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 193, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+
 194: 
+
+195:         return self._values.pop(0)
+
  __Pyx_XDECREF(__pyx_r);
+  if (unlikely(__pyx_v_self->_values == Py_None)) {
+    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "pop");
+    __PYX_ERR(0, 195, __pyx_L1_error)
+  }
+  __pyx_t_3 = __Pyx_PyList_PopIndex(__pyx_v_self->_values, __pyx_int_0, 0, 1, Py_ssize_t, PyInt_FromSsize_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 195, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __pyx_r = __pyx_t_3;
+  __pyx_t_3 = 0;
+  goto __pyx_L0;
+
 196: 
+
+197: def _init():
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_8__waiter_1_init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6gevent_8__waiter__init[] = "_init()";
+static PyMethodDef __pyx_mdef_6gevent_8__waiter_1_init = {"_init", (PyCFunction)__pyx_pw_6gevent_8__waiter_1_init, METH_NOARGS, __pyx_doc_6gevent_8__waiter__init};
+static PyObject *__pyx_pw_6gevent_8__waiter_1_init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_init (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_8__waiter__init(__pyx_self);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_8__waiter__init(CYTHON_UNUSED PyObject *__pyx_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_init", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_8__waiter_1_init, 0, __pyx_n_s_init_2, NULL, __pyx_n_s_gevent___waiter, __pyx_d, ((PyObject *)__pyx_codeobj__21)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 197, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_init_2, __pyx_t_2) < 0) __PYX_ERR(0, 197, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+198:     greenlet_init() # pylint:disable=undefined-variable
+
  __pyx_f_6gevent_8__waiter_greenlet_init();
+
 199: 
+
+200: _init()
+
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_init_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 200, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 200, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 201: 
+
 202: 
+
+203: from gevent._util import import_c_accel
+
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 203, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(__pyx_n_s_import_c_accel);
+  __Pyx_GIVEREF(__pyx_n_s_import_c_accel);
+  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_import_c_accel);
+  __pyx_t_2 = __Pyx_Import(__pyx_n_s_gevent__util, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 203, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_import_c_accel); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 203, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_import_c_accel, __pyx_t_1) < 0) __PYX_ERR(0, 203, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+204: import_c_accel(globals(), 'gevent.__waiter')
+
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_import_c_accel); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 204, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_1 = __Pyx_Globals(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 204, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 204, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_GIVEREF(__pyx_t_1);
+  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
+  __Pyx_INCREF(__pyx_n_s_gevent___waiter);
+  __Pyx_GIVEREF(__pyx_n_s_gevent___waiter);
+  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_n_s_gevent___waiter);
+  __pyx_t_1 = 0;
+  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 204, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_waiter.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_waiter.py new file mode 100644 index 00000000..b9ba3e8c --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/_waiter.py @@ -0,0 +1,204 @@ +# -*- coding: utf-8 -*- +# copyright 2018 gevent +# cython: auto_pickle=False,embedsignature=True,always_allow_keywords=False +""" +Low-level waiting primitives. + +""" +from __future__ import absolute_import +from __future__ import division +from __future__ import print_function + +import sys + +from gevent._hub_local import get_hub_noargs as get_hub +from gevent.exceptions import ConcurrentObjectUseError + +__all__ = [ + 'Waiter', +] + +_NONE = object() + +locals()['getcurrent'] = __import__('greenlet').getcurrent +locals()['greenlet_init'] = lambda: None + + +class Waiter(object): + """ + A low level communication utility for greenlets. + + Waiter is a wrapper around greenlet's ``switch()`` and ``throw()`` calls that makes them somewhat safer: + + * switching will occur only if the waiting greenlet is executing :meth:`get` method currently; + * any error raised in the greenlet is handled inside :meth:`switch` and :meth:`throw` + * if :meth:`switch`/:meth:`throw` is called before the receiver calls :meth:`get`, then :class:`Waiter` + will store the value/exception. The following :meth:`get` will return the value/raise the exception. + + The :meth:`switch` and :meth:`throw` methods must only be called from the :class:`Hub` greenlet. + The :meth:`get` method must be called from a greenlet other than :class:`Hub`. + + >>> result = Waiter() + >>> timer = get_hub().loop.timer(0.1) + >>> timer.start(result.switch, 'hello from Waiter') + >>> result.get() # blocks for 0.1 seconds + 'hello from Waiter' + >>> timer.close() + + If switch is called before the greenlet gets a chance to call :meth:`get` then + :class:`Waiter` stores the value. + + >>> result = Waiter() + >>> timer = get_hub().loop.timer(0.1) + >>> timer.start(result.switch, 'hi from Waiter') + >>> sleep(0.2) + >>> result.get() # returns immediately without blocking + 'hi from Waiter' + >>> timer.close() + + .. warning:: + + This a limited and dangerous way to communicate between + greenlets. It can easily leave a greenlet unscheduled forever + if used incorrectly. Consider using safer classes such as + :class:`gevent.event.Event`, :class:`gevent.event.AsyncResult`, + or :class:`gevent.queue.Queue`. + """ + + __slots__ = ['hub', 'greenlet', 'value', '_exception'] + + def __init__(self, hub=None): + self.hub = get_hub() if hub is None else hub + self.greenlet = None + self.value = None + self._exception = _NONE + + def clear(self): + self.greenlet = None + self.value = None + self._exception = _NONE + + def __str__(self): + if self._exception is _NONE: + return '<%s greenlet=%s>' % (type(self).__name__, self.greenlet) + if self._exception is None: + return '<%s greenlet=%s value=%r>' % (type(self).__name__, self.greenlet, self.value) + return '<%s greenlet=%s exc_info=%r>' % (type(self).__name__, self.greenlet, self.exc_info) + + def ready(self): + """Return true if and only if it holds a value or an exception""" + return self._exception is not _NONE + + def successful(self): + """Return true if and only if it is ready and holds a value""" + return self._exception is None + + @property + def exc_info(self): + "Holds the exception info passed to :meth:`throw` if :meth:`throw` was called. Otherwise ``None``." + if self._exception is not _NONE: + return self._exception + + def switch(self, value): + """ + Switch to the greenlet if one's available. Otherwise store the + *value*. + + .. versionchanged:: 1.3b1 + The *value* is no longer optional. + """ + greenlet = self.greenlet + if greenlet is None: + self.value = value + self._exception = None + else: + if getcurrent() is not self.hub: # pylint:disable=undefined-variable + raise AssertionError("Can only use Waiter.switch method from the Hub greenlet") + switch = greenlet.switch + try: + switch(value) + except: # pylint:disable=bare-except + self.hub.handle_error(switch, *sys.exc_info()) + + def switch_args(self, *args): + return self.switch(args) + + def throw(self, *throw_args): + """Switch to the greenlet with the exception. If there's no greenlet, store the exception.""" + greenlet = self.greenlet + if greenlet is None: + self._exception = throw_args + else: + if getcurrent() is not self.hub: # pylint:disable=undefined-variable + raise AssertionError("Can only use Waiter.switch method from the Hub greenlet") + throw = greenlet.throw + try: + throw(*throw_args) + except: # pylint:disable=bare-except + self.hub.handle_error(throw, *sys.exc_info()) + + def get(self): + """If a value/an exception is stored, return/raise it. Otherwise until switch() or throw() is called.""" + if self._exception is not _NONE: + if self._exception is None: + return self.value + getcurrent().throw(*self._exception) # pylint:disable=undefined-variable + else: + if self.greenlet is not None: + raise ConcurrentObjectUseError('This Waiter is already used by %r' % (self.greenlet, )) + self.greenlet = getcurrent() # pylint:disable=undefined-variable + try: + return self.hub.switch() + finally: + self.greenlet = None + + def __call__(self, source): + if source.exception is None: + self.switch(source.value) + else: + self.throw(source.exception) + + # can also have a debugging version, that wraps the value in a tuple (self, value) in switch() + # and unwraps it in wait() thus checking that switch() was indeed called + + + +class MultipleWaiter(Waiter): + """ + An internal extension of Waiter that can be used if multiple objects + must be waited on, and there is a chance that in between waits greenlets + might be switched out. All greenlets that switch to this waiter + will have their value returned. + + This does not handle exceptions or throw methods. + """ + __slots__ = ['_values'] + + def __init__(self, hub=None): + Waiter.__init__(self, hub) + # we typically expect a relatively small number of these to be outstanding. + # since we pop from the left, a deque might be slightly + # more efficient, but since we're in the hub we avoid imports if + # we can help it to better support monkey-patching, and delaying the import + # here can be impractical (see https://github.com/gevent/gevent/issues/652) + self._values = list() + + def switch(self, value): + self._values.append(value) + Waiter.switch(self, True) + + def get(self): + if not self._values: + Waiter.get(self) + Waiter.clear(self) + + return self._values.pop(0) + +def _init(): + greenlet_init() # pylint:disable=undefined-variable + +_init() + + +from gevent._util import import_c_accel +import_c_accel(globals(), 'gevent.__waiter') diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/ares.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/ares.py new file mode 100644 index 00000000..37980b32 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/ares.py @@ -0,0 +1,10 @@ +"""Backwards compatibility alias for :mod:`gevent.resolver.cares`. + +.. deprecated:: 1.3 + Use :mod:`gevent.resolver.cares` +""" + +from gevent.resolver.cares import * # pylint:disable=wildcard-import,unused-wildcard-import, +import gevent.resolver.cares as _cares +__all__ = _cares.__all__ # pylint:disable=c-extension-no-member +del _cares diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/backdoor.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/backdoor.py new file mode 100644 index 00000000..84894178 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/backdoor.py @@ -0,0 +1,210 @@ +# Copyright (c) 2009-2014, gevent contributors +# Based on eventlet.backdoor Copyright (c) 2005-2006, Bob Ippolito +""" +Interactive greenlet-based network console that can be used in any process. + +The :class:`BackdoorServer` provides a REPL inside a running process. As +long as the process is monkey-patched, the ``BackdoorServer`` can coexist +with other elements of the process. + +.. seealso:: :class:`code.InteractiveConsole` +""" +from __future__ import print_function, absolute_import +import sys +from code import InteractiveConsole + +from gevent.greenlet import Greenlet +from gevent.hub import getcurrent +from gevent.server import StreamServer +from gevent.pool import Pool + +__all__ = ['BackdoorServer'] + +try: + sys.ps1 +except AttributeError: + sys.ps1 = '>>> ' +try: + sys.ps2 +except AttributeError: + sys.ps2 = '... ' + +class _Greenlet_stdreplace(Greenlet): + # A greenlet that replaces sys.std[in/out/err] while running. + _fileobj = None + saved = None + + def switch(self, *args, **kw): + if self._fileobj is not None: + self.switch_in() + Greenlet.switch(self, *args, **kw) + + def switch_in(self): + self.saved = sys.stdin, sys.stderr, sys.stdout + sys.stdin = sys.stdout = sys.stderr = self._fileobj + + def switch_out(self): + sys.stdin, sys.stderr, sys.stdout = self.saved + self.saved = None + + def throw(self, *args, **kwargs): + # pylint:disable=arguments-differ + if self.saved is None and self._fileobj is not None: + self.switch_in() + Greenlet.throw(self, *args, **kwargs) + + def run(self): + try: + return Greenlet.run(self) + finally: + # Make sure to restore the originals. + self.switch_out() + + +class BackdoorServer(StreamServer): + """ + Provide a backdoor to a program for debugging purposes. + + .. warning:: This backdoor provides no authentication and makes no + attempt to limit what remote users can do. Anyone that + can access the server can take any action that the running + python process can. Thus, while you may bind to any interface, for + security purposes it is recommended that you bind to one + only accessible to the local machine, e.g., + 127.0.0.1/localhost. + + Basic usage:: + + from gevent.backdoor import BackdoorServer + server = BackdoorServer(('127.0.0.1', 5001), + banner="Hello from gevent backdoor!", + locals={'foo': "From defined scope!"}) + server.serve_forever() + + In a another terminal, connect with...:: + + $ telnet 127.0.0.1 5001 + Trying 127.0.0.1... + Connected to 127.0.0.1. + Escape character is '^]'. + Hello from gevent backdoor! + >> print(foo) + From defined scope! + + .. versionchanged:: 1.2a1 + Spawned greenlets are now tracked in a pool and killed when the server + is stopped. + """ + + def __init__(self, listener, locals=None, banner=None, **server_args): + """ + :keyword locals: If given, a dictionary of "builtin" values that will be available + at the top-level. + :keyword banner: If geven, a string that will be printed to each connecting user. + """ + group = Pool(greenlet_class=_Greenlet_stdreplace) # no limit on number + StreamServer.__init__(self, listener, spawn=group, **server_args) + _locals = {'__doc__': None, '__name__': '__console__'} + if locals: + _locals.update(locals) + self.locals = _locals + + self.banner = banner + self.stderr = sys.stderr + + def _create_interactive_locals(self): + # Create and return a *new* locals dictionary based on self.locals, + # and set any new entries in it. (InteractiveConsole does not + # copy its locals value) + _locals = self.locals.copy() + # __builtins__ may either be the __builtin__ module or + # __builtin__.__dict__; in the latter case typing + # locals() at the backdoor prompt spews out lots of + # useless stuff + try: + import __builtin__ + _locals["__builtins__"] = __builtin__ + except ImportError: + import builtins # pylint:disable=import-error + _locals["builtins"] = builtins + _locals['__builtins__'] = builtins + return _locals + + def handle(self, conn, _address): # pylint: disable=method-hidden + """ + Interact with one remote user. + + .. versionchanged:: 1.1b2 Each connection gets its own + ``locals`` dictionary. Previously they were shared in a + potentially unsafe manner. + """ + fobj = conn.makefile(mode="rw") + fobj = _fileobject(conn, fobj, self.stderr) + getcurrent()._fileobj = fobj + + getcurrent().switch_in() + try: + console = InteractiveConsole(self._create_interactive_locals()) + if sys.version_info[:3] >= (3, 6, 0): + # Beginning in 3.6, the console likes to print "now exiting " + # but probably our socket is already closed, so this just causes problems. + console.interact(banner=self.banner, exitmsg='') # pylint:disable=unexpected-keyword-arg + else: + console.interact(banner=self.banner) + except SystemExit: # raised by quit() + if hasattr(sys, 'exc_clear'): # py2 + sys.exc_clear() + finally: + conn.close() + fobj.close() + + +class _fileobject(object): + """ + A file-like object that wraps the result of socket.makefile (composition + instead of inheritance lets us work identically under CPython and PyPy). + + We write directly to the socket, avoiding the buffering that the text-oriented + makefile would want to do (otherwise we'd be at the mercy of waiting on a + flush() to get called for the remote user to see data); this beats putting + the file in binary mode and translating everywhere with a non-default + encoding. + """ + def __init__(self, sock, fobj, stderr): + self._sock = sock + self._fobj = fobj + self.stderr = stderr + + def __getattr__(self, name): + return getattr(self._fobj, name) + + def close(self): + self._fobj.close() + self._sock.close() + + def write(self, data): + if not isinstance(data, bytes): + data = data.encode('utf-8') + self._sock.sendall(data) + + def isatty(self): + return True + + def flush(self): + pass + + def readline(self, *a): + try: + return self._fobj.readline(*a).replace("\r\n", "\n") + except UnicodeError: + # Typically, under python 3, a ^C on the other end + return '' + + +if __name__ == '__main__': + if not sys.argv[1:]: + print('USAGE: %s PORT [banner]' % sys.argv[0]) + else: + BackdoorServer(('127.0.0.1', int(sys.argv[1])), + banner=(sys.argv[2] if len(sys.argv) > 2 else None), + locals={'hello': 'world'}).serve_forever() diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/baseserver.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/baseserver.py new file mode 100644 index 00000000..f987cc39 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/baseserver.py @@ -0,0 +1,409 @@ +"""Base class for implementing servers""" +# Copyright (c) 2009-2012 Denis Bilenko. See LICENSE for details. +import sys +import _socket +import errno +from gevent.greenlet import Greenlet +from gevent.event import Event +from gevent.hub import get_hub +from gevent._compat import string_types, integer_types, xrange + + +__all__ = ['BaseServer'] + + +# We define a helper function to handle closing the socket in +# do_handle; We'd like to bind it to a kwarg to avoid *any* lookups at +# all, but that's incompatible with the calling convention of +# do_handle. On CPython, this is ~20% faster than creating and calling +# a closure and ~10% faster than using a @staticmethod. (In theory, we +# could create a closure only once in set_handle, to wrap self._handle, +# but this is safer from a backwards compat standpoint.) +# we also avoid unpacking the *args tuple when calling/spawning this object +# for a tiny improvement (benchmark shows a wash) +def _handle_and_close_when_done(handle, close, args_tuple): + try: + return handle(*args_tuple) + finally: + close(*args_tuple) + + +class BaseServer(object): + """ + An abstract base class that implements some common functionality for the servers in gevent. + + :param listener: Either be an address that the server should bind + on or a :class:`gevent.socket.socket` instance that is already + bound (and put into listening mode in case of TCP socket). + + :keyword handle: If given, the request handler. The request + handler can be defined in a few ways. Most commonly, + subclasses will implement a ``handle`` method as an + instance method. Alternatively, a function can be passed + as the ``handle`` argument to the constructor. In either + case, the handler can later be changed by calling + :meth:`set_handle`. + + When the request handler returns, the socket used for the + request will be closed. Therefore, the handler must not return if + the socket is still in use (for example, by manually spawned greenlets). + + :keyword spawn: If provided, is called to create a new + greenlet to run the handler. By default, + :func:`gevent.spawn` is used (meaning there is no + artificial limit on the number of concurrent requests). Possible values for *spawn*: + + - a :class:`gevent.pool.Pool` instance -- ``handle`` will be executed + using :meth:`gevent.pool.Pool.spawn` only if the pool is not full. + While it is full, no new connections are accepted; + - :func:`gevent.spawn_raw` -- ``handle`` will be executed in a raw + greenlet which has a little less overhead then :class:`gevent.Greenlet` instances spawned by default; + - ``None`` -- ``handle`` will be executed right away, in the :class:`Hub` greenlet. + ``handle`` cannot use any blocking functions as it would mean switching to the :class:`Hub`. + - an integer -- a shortcut for ``gevent.pool.Pool(integer)`` + + .. versionchanged:: 1.1a1 + When the *handle* function returns from processing a connection, + the client socket will be closed. This resolves the non-deterministic + closing of the socket, fixing ResourceWarnings under Python 3 and PyPy. + + """ + # pylint: disable=too-many-instance-attributes,bare-except,broad-except + + #: the number of seconds to sleep in case there was an error in accept() call + #: for consecutive errors the delay will double until it reaches max_delay + #: when accept() finally succeeds the delay will be reset to min_delay again + min_delay = 0.01 + max_delay = 1 + + #: Sets the maximum number of consecutive accepts that a process may perform on + #: a single wake up. High values give higher priority to high connection rates, + #: while lower values give higher priority to already established connections. + #: Default is 100. Note, that in case of multiple working processes on the same + #: listening value, it should be set to a lower value. (pywsgi.WSGIServer sets it + #: to 1 when environ["wsgi.multiprocess"] is true) + max_accept = 100 + + _spawn = Greenlet.spawn + + #: the default timeout that we wait for the client connections to close in stop() + stop_timeout = 1 + + fatal_errors = (errno.EBADF, errno.EINVAL, errno.ENOTSOCK) + + def __init__(self, listener, handle=None, spawn='default'): + self._stop_event = Event() + self._stop_event.set() + self._watcher = None + self._timer = None + self._handle = None + # XXX: FIXME: Subclasses rely on the presence or absence of the + # `socket` attribute to determine whether we are open/should be opened. + # Instead, have it be None. + self.pool = None + try: + self.set_listener(listener) + self.set_spawn(spawn) + self.set_handle(handle) + self.delay = self.min_delay + self.loop = get_hub().loop + if self.max_accept < 1: + raise ValueError('max_accept must be positive int: %r' % (self.max_accept, )) + except: + self.close() + raise + + def set_listener(self, listener): + if hasattr(listener, 'accept'): + if hasattr(listener, 'do_handshake'): + raise TypeError('Expected a regular socket, not SSLSocket: %r' % (listener, )) + self.family = listener.family + self.address = listener.getsockname() + self.socket = listener + else: + self.family, self.address = parse_address(listener) + + def set_spawn(self, spawn): + if spawn == 'default': + self.pool = None + self._spawn = self._spawn + elif hasattr(spawn, 'spawn'): + self.pool = spawn + self._spawn = spawn.spawn + elif isinstance(spawn, integer_types): + from gevent.pool import Pool + self.pool = Pool(spawn) + self._spawn = self.pool.spawn + else: + self.pool = None + self._spawn = spawn + if hasattr(self.pool, 'full'): + self.full = self.pool.full + if self.pool is not None: + self.pool._semaphore.rawlink(self._start_accepting_if_started) + + def set_handle(self, handle): + if handle is not None: + self.handle = handle + if hasattr(self, 'handle'): + self._handle = self.handle + else: + raise TypeError("'handle' must be provided") + + def _start_accepting_if_started(self, _event=None): + if self.started: + self.start_accepting() + + def start_accepting(self): + if self._watcher is None: + # just stop watcher without creating a new one? + self._watcher = self.loop.io(self.socket.fileno(), 1) + self._watcher.start(self._do_read) + + def stop_accepting(self): + if self._watcher is not None: + self._watcher.stop() + self._watcher.close() + self._watcher = None + if self._timer is not None: + self._timer.stop() + self._timer.close() + self._timer = None + + def do_handle(self, *args): + spawn = self._spawn + handle = self._handle + close = self.do_close + + try: + if spawn is None: + _handle_and_close_when_done(handle, close, args) + else: + spawn(_handle_and_close_when_done, handle, close, args) + except: + close(*args) + raise + + def do_close(self, *args): + pass + + def do_read(self): + raise NotImplementedError() + + def _do_read(self): + for _ in xrange(self.max_accept): + if self.full(): + self.stop_accepting() + return + try: + args = self.do_read() + self.delay = self.min_delay + if not args: + return + except: + self.loop.handle_error(self, *sys.exc_info()) + ex = sys.exc_info()[1] + if self.is_fatal_error(ex): + self.close() + sys.stderr.write('ERROR: %s failed with %s\n' % (self, str(ex) or repr(ex))) + return + if self.delay >= 0: + self.stop_accepting() + self._timer = self.loop.timer(self.delay) + self._timer.start(self._start_accepting_if_started) + self.delay = min(self.max_delay, self.delay * 2) + break + else: + try: + self.do_handle(*args) + except: + self.loop.handle_error((args[1:], self), *sys.exc_info()) + if self.delay >= 0: + self.stop_accepting() + self._timer = self.loop.timer(self.delay) + self._timer.start(self._start_accepting_if_started) + self.delay = min(self.max_delay, self.delay * 2) + break + + def full(self): + # copied from self.pool + # pylint: disable=method-hidden + return False + + def __repr__(self): + return '<%s at %s %s>' % (type(self).__name__, hex(id(self)), self._formatinfo()) + + def __str__(self): + return '<%s %s>' % (type(self).__name__, self._formatinfo()) + + def _formatinfo(self): + if hasattr(self, 'socket'): + try: + fileno = self.socket.fileno() + except Exception as ex: + fileno = str(ex) + result = 'fileno=%s ' % fileno + else: + result = '' + try: + if isinstance(self.address, tuple) and len(self.address) == 2: + result += 'address=%s:%s' % self.address + else: + result += 'address=%s' % (self.address, ) + except Exception as ex: + result += str(ex) or '' + + handle = self.__dict__.get('handle') + if handle is not None: + fself = getattr(handle, '__self__', None) + try: + if fself is self: + # Checks the __self__ of the handle in case it is a bound + # method of self to prevent recursivly defined reprs. + handle_repr = '' % ( + self.__class__.__name__, + handle.__name__, + ) + else: + handle_repr = repr(handle) + + result += ' handle=' + handle_repr + except Exception as ex: + result += str(ex) or '' + + return result + + @property + def server_host(self): + """IP address that the server is bound to (string).""" + if isinstance(self.address, tuple): + return self.address[0] + + @property + def server_port(self): + """Port that the server is bound to (an integer).""" + if isinstance(self.address, tuple): + return self.address[1] + + def init_socket(self): + """If the user initialized the server with an address rather than socket, + then this function will create a socket, bind it and put it into listening mode. + + It is not supposed to be called by the user, it is called by :meth:`start` before starting + the accept loop.""" + + @property + def started(self): + return not self._stop_event.is_set() + + def start(self): + """Start accepting the connections. + + If an address was provided in the constructor, then also create a socket, + bind it and put it into the listening mode. + """ + self.init_socket() + self._stop_event.clear() + try: + self.start_accepting() + except: + self.close() + raise + + def close(self): + """Close the listener socket and stop accepting.""" + self._stop_event.set() + try: + self.stop_accepting() + finally: + try: + self.socket.close() + except Exception: + pass + finally: + self.__dict__.pop('socket', None) + self.__dict__.pop('handle', None) + self.__dict__.pop('_handle', None) + self.__dict__.pop('_spawn', None) + self.__dict__.pop('full', None) + if self.pool is not None: + self.pool._semaphore.unlink(self._start_accepting_if_started) + # If the pool's semaphore had a notifier already started, + # there's a reference cycle we're a part of + # (self->pool->semaphere-hub callback->semaphore) + # But we can't destroy self.pool, because self.stop() + # calls this method, and then wants to join self.pool() + + @property + def closed(self): + return not hasattr(self, 'socket') + + def stop(self, timeout=None): + """ + Stop accepting the connections and close the listening socket. + + If the server uses a pool to spawn the requests, then + :meth:`stop` also waits for all the handlers to exit. If there + are still handlers executing after *timeout* has expired + (default 1 second, :attr:`stop_timeout`), then the currently + running handlers in the pool are killed. + + If the server does not use a pool, then this merely stops accepting connections; + any spawned greenlets that are handling requests continue running until + they naturally complete. + """ + self.close() + if timeout is None: + timeout = self.stop_timeout + if self.pool: + self.pool.join(timeout=timeout) + self.pool.kill(block=True, timeout=1) + + + def serve_forever(self, stop_timeout=None): + """Start the server if it hasn't been already started and wait until it's stopped.""" + # add test that serve_forever exists on stop() + if not self.started: + self.start() + try: + self._stop_event.wait() + finally: + Greenlet.spawn(self.stop, timeout=stop_timeout).join() + + def is_fatal_error(self, ex): + return isinstance(ex, _socket.error) and ex.args[0] in self.fatal_errors + + +def _extract_family(host): + if host.startswith('[') and host.endswith(']'): + host = host[1:-1] + return _socket.AF_INET6, host + return _socket.AF_INET, host + + +def _parse_address(address): + if isinstance(address, tuple): + if not address[0] or ':' in address[0]: + return _socket.AF_INET6, address + return _socket.AF_INET, address + + if ((isinstance(address, string_types) and ':' not in address) + or isinstance(address, integer_types)): # noqa (pep8 E129) + # Just a port + return _socket.AF_INET6, ('', int(address)) + + if not isinstance(address, string_types): + raise TypeError('Expected tuple or string, got %s' % type(address)) + + host, port = address.rsplit(':', 1) + family, host = _extract_family(host) + if host == '*': + host = '' + return family, (host, int(port)) + + +def parse_address(address): + try: + return _parse_address(address) + except ValueError as ex: # pylint:disable=try-except-raise + raise ValueError('Failed to parse address %r: %s' % (address, ex)) diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/builtins.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/builtins.py new file mode 100644 index 00000000..389a6529 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/builtins.py @@ -0,0 +1,135 @@ +# Copyright (c) 2015 gevent contributors. See LICENSE for details. +"""gevent friendly implementations of builtin functions.""" +from __future__ import absolute_import + +import sys +import weakref + +from gevent.lock import RLock +from gevent._compat import imp_acquire_lock +from gevent._compat import imp_release_lock + + +# Normally we'd have the "expected" case inside the try +# (Python 3, because Python 3 is the way forward). But +# under Python 2, the popular `future` library *also* provides +# a `builtins` module---which lacks the __import__ attribute. +# So we test for the old, deprecated version first + +try: # Py2 + import __builtin__ as __gbuiltins__ + _allowed_module_name_types = (basestring,) # pylint:disable=undefined-variable + __target__ = '__builtin__' +except ImportError: + import builtins as __gbuiltins__ # pylint: disable=import-error + _allowed_module_name_types = (str,) + __target__ = 'builtins' + +_import = __gbuiltins__.__import__ + +# We need to protect imports both across threads and across greenlets. +# And the order matters. Note that under 3.4, the global import lock +# and imp module are deprecated. It seems that in all Py3 versions, a +# module lock is used such that this fix is not necessary. + +# We emulate the per-module locking system under Python 2 in order to +# avoid issues acquiring locks in multiple-level-deep imports +# that attempt to use the gevent blocking API at runtime; using one lock +# could lead to a LoopExit error as a greenlet attempts to block on it while +# it's already held by the main greenlet (issue #798). + +# We base this approach on a simplification of what `importlib._bootstrap` +# does; notably, we don't check for deadlocks + +_g_import_locks = {} # name -> wref of RLock + +__lock_imports = True + + +def __module_lock(name): + # Return the lock for the given module, creating it if necessary. + # It will be removed when no longer needed. + # Nothing in this function yields, so we're multi-greenlet safe + # (But not multi-threading safe.) + # XXX: What about on PyPy, where the GC is asynchronous (not ref-counting)? + # (Does it stop-the-world first?) + lock = None + try: + lock = _g_import_locks[name]() + except KeyError: + pass + + if lock is None: + lock = RLock() + + def cb(_): + # We've seen a KeyError on PyPy on RPi2 + _g_import_locks.pop(name, None) + _g_import_locks[name] = weakref.ref(lock, cb) + return lock + + +def __import__(*args, **kwargs): + """ + __import__(name, globals=None, locals=None, fromlist=(), level=0) -> object + + Normally python protects imports against concurrency by doing some locking + at the C level (at least, it does that in CPython). This function just + wraps the normal __import__ functionality in a recursive lock, ensuring that + we're protected against greenlet import concurrency as well. + """ + if args and not issubclass(type(args[0]), _allowed_module_name_types): + # if a builtin has been acquired as a bound instance method, + # python knows not to pass 'self' when the method is called. + # No such protection exists for monkey-patched builtins, + # however, so this is necessary. + args = args[1:] + + if not __lock_imports: + return _import(*args, **kwargs) + + module_lock = __module_lock(args[0]) # Get a lock for the module name + imp_acquire_lock() + try: + module_lock.acquire() + try: + result = _import(*args, **kwargs) + finally: + module_lock.release() + finally: + imp_release_lock() + return result + + +def _unlock_imports(): + """ + Internal function, called when gevent needs to perform imports + lazily, but does not know the state of the system. It may be impossible + to take the import lock because there are no other running greenlets, for + example. This causes a monkey-patched __import__ to avoid taking any locks. + until the corresponding call to lock_imports. This should only be done for limited + amounts of time and when the set of imports is statically known to be "safe". + """ + global __lock_imports + # This could easily become a list that we push/pop from or an integer + # we increment if we need to do this recursively, but we shouldn't get + # that complex. + __lock_imports = False + + +def _lock_imports(): + global __lock_imports + __lock_imports = True + +if sys.version_info[:2] >= (3, 3): + __implements__ = [] + __import__ = _import +else: + __implements__ = ['__import__'] +__all__ = __implements__ + + +from gevent._util import copy_globals + +__imports__ = copy_globals(__gbuiltins__, globals(), + names_to_ignore=__implements__) diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/core.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/core.py new file mode 100644 index 00000000..906e739e --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/core.py @@ -0,0 +1,20 @@ +# Copyright (c) 2009-2015 Denis Bilenko and gevent contributors. See LICENSE for details. +""" +Deprecated; this does not reflect all the possible options +and its interface varies. + +.. versionchanged:: 1.3a2 + Deprecated. +""" +from __future__ import absolute_import + +import sys + +from gevent._config import config +from gevent._util import copy_globals + +_core = sys.modules[config.loop.__module__] + +copy_globals(_core, globals()) + +__all__ = _core.__all__ # pylint:disable=no-member diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/event.c b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/event.c new file mode 100644 index 00000000..98946f64 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/event.c @@ -0,0 +1,10734 @@ +/* Generated by Cython 0.29.2 */ + +/* BEGIN: Cython Metadata +{ + "distutils": { + "depends": [ + "src/gevent/_event.pxd", + "src\\gevent\\_event.pxd" + ], + "include_dirs": [ + "C:\\Python37\\Include", + "deps" + ], + "name": "gevent._event", + "sources": [ + "src/gevent/event.py" + ] + }, + "module_name": "gevent._event" +} +END: Cython Metadata */ + +#define PY_SSIZE_T_CLEAN +#include "Python.h" +#ifndef Py_PYTHON_H + #error Python headers needed to compile C extensions, please install development version of Python. +#elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) + #error Cython requires Python 2.6+ or Python 3.3+. +#else +#define CYTHON_ABI "0_29_2" +#define CYTHON_HEX_VERSION 0x001D02F0 +#define CYTHON_FUTURE_DIVISION 1 +#include +#ifndef offsetof + #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) +#endif +#if !defined(WIN32) && !defined(MS_WINDOWS) + #ifndef __stdcall + #define __stdcall + #endif + #ifndef __cdecl + #define __cdecl + #endif + #ifndef __fastcall + #define __fastcall + #endif +#endif +#ifndef DL_IMPORT + #define DL_IMPORT(t) t +#endif +#ifndef DL_EXPORT + #define DL_EXPORT(t) t +#endif +#define __PYX_COMMA , +#ifndef HAVE_LONG_LONG + #if PY_VERSION_HEX >= 0x02070000 + #define HAVE_LONG_LONG + #endif +#endif +#ifndef PY_LONG_LONG + #define PY_LONG_LONG LONG_LONG +#endif +#ifndef Py_HUGE_VAL + #define Py_HUGE_VAL HUGE_VAL +#endif +#ifdef PYPY_VERSION + #define CYTHON_COMPILING_IN_PYPY 1 + #define CYTHON_COMPILING_IN_PYSTON 0 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #undef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 0 + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #if PY_VERSION_HEX < 0x03050000 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #elif !defined(CYTHON_USE_ASYNC_SLOTS) + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #undef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 0 + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #undef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 1 + #undef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 0 + #undef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 0 + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #undef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE 0 + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 +#elif defined(PYSTON_VERSION) + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_PYSTON 1 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #ifndef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 1 + #endif + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #ifndef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 1 + #endif + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #ifndef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 0 + #endif + #ifndef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 1 + #endif + #ifndef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 1 + #endif + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #undef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE 0 + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 +#else + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_PYSTON 0 + #define CYTHON_COMPILING_IN_CPYTHON 1 + #ifndef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 1 + #endif + #if PY_VERSION_HEX < 0x02070000 + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #elif !defined(CYTHON_USE_PYTYPE_LOOKUP) + #define CYTHON_USE_PYTYPE_LOOKUP 1 + #endif + #if PY_MAJOR_VERSION < 3 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #elif !defined(CYTHON_USE_ASYNC_SLOTS) + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #if PY_VERSION_HEX < 0x02070000 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #elif !defined(CYTHON_USE_PYLONG_INTERNALS) + #define CYTHON_USE_PYLONG_INTERNALS 1 + #endif + #ifndef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 1 + #endif + #ifndef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 1 + #endif + #if PY_VERSION_HEX < 0x030300F0 + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #elif !defined(CYTHON_USE_UNICODE_WRITER) + #define CYTHON_USE_UNICODE_WRITER 1 + #endif + #ifndef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 0 + #endif + #ifndef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 1 + #endif + #ifndef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 1 + #endif + #ifndef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 1 + #endif + #ifndef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 1 + #endif + #ifndef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000) + #endif + #ifndef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1) + #endif + #ifndef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1) + #endif + #ifndef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3) + #endif +#endif +#if !defined(CYTHON_FAST_PYCCALL) +#define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) +#endif +#if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #undef SHIFT + #undef BASE + #undef MASK + #ifdef SIZEOF_VOID_P + enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) }; + #endif +#endif +#ifndef __has_attribute + #define __has_attribute(x) 0 +#endif +#ifndef __has_cpp_attribute + #define __has_cpp_attribute(x) 0 +#endif +#ifndef CYTHON_RESTRICT + #if defined(__GNUC__) + #define CYTHON_RESTRICT __restrict__ + #elif defined(_MSC_VER) && _MSC_VER >= 1400 + #define CYTHON_RESTRICT __restrict + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_RESTRICT restrict + #else + #define CYTHON_RESTRICT + #endif +#endif +#ifndef CYTHON_UNUSED +# if defined(__GNUC__) +# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +#endif +#ifndef CYTHON_MAYBE_UNUSED_VAR +# if defined(__cplusplus) + template void CYTHON_MAYBE_UNUSED_VAR( const T& ) { } +# else +# define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x) +# endif +#endif +#ifndef CYTHON_NCP_UNUSED +# if CYTHON_COMPILING_IN_CPYTHON +# define CYTHON_NCP_UNUSED +# else +# define CYTHON_NCP_UNUSED CYTHON_UNUSED +# endif +#endif +#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) +#ifdef _MSC_VER + #ifndef _MSC_STDINT_H_ + #if _MSC_VER < 1300 + typedef unsigned char uint8_t; + typedef unsigned int uint32_t; + #else + typedef unsigned __int8 uint8_t; + typedef unsigned __int32 uint32_t; + #endif + #endif +#else + #include +#endif +#ifndef CYTHON_FALLTHROUGH + #if defined(__cplusplus) && __cplusplus >= 201103L + #if __has_cpp_attribute(fallthrough) + #define CYTHON_FALLTHROUGH [[fallthrough]] + #elif __has_cpp_attribute(clang::fallthrough) + #define CYTHON_FALLTHROUGH [[clang::fallthrough]] + #elif __has_cpp_attribute(gnu::fallthrough) + #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] + #endif + #endif + #ifndef CYTHON_FALLTHROUGH + #if __has_attribute(fallthrough) + #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) + #else + #define CYTHON_FALLTHROUGH + #endif + #endif + #if defined(__clang__ ) && defined(__apple_build_version__) + #if __apple_build_version__ < 7000000 + #undef CYTHON_FALLTHROUGH + #define CYTHON_FALLTHROUGH + #endif + #endif +#endif + +#ifndef CYTHON_INLINE + #if defined(__clang__) + #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) + #elif defined(__GNUC__) + #define CYTHON_INLINE __inline__ + #elif defined(_MSC_VER) + #define CYTHON_INLINE __inline + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_INLINE inline + #else + #define CYTHON_INLINE + #endif +#endif + +#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) + #define Py_OptimizeFlag 0 +#endif +#define __PYX_BUILD_PY_SSIZE_T "n" +#define CYTHON_FORMAT_SSIZE_T "z" +#if PY_MAJOR_VERSION < 3 + #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyClass_Type +#else + #define __Pyx_BUILTIN_MODULE_NAME "builtins" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyType_Type +#endif +#ifndef Py_TPFLAGS_CHECKTYPES + #define Py_TPFLAGS_CHECKTYPES 0 +#endif +#ifndef Py_TPFLAGS_HAVE_INDEX + #define Py_TPFLAGS_HAVE_INDEX 0 +#endif +#ifndef Py_TPFLAGS_HAVE_NEWBUFFER + #define Py_TPFLAGS_HAVE_NEWBUFFER 0 +#endif +#ifndef Py_TPFLAGS_HAVE_FINALIZE + #define Py_TPFLAGS_HAVE_FINALIZE 0 +#endif +#ifndef METH_STACKLESS + #define METH_STACKLESS 0 +#endif +#if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) + #ifndef METH_FASTCALL + #define METH_FASTCALL 0x80 + #endif + typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs); + typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args, + Py_ssize_t nargs, PyObject *kwnames); +#else + #define __Pyx_PyCFunctionFast _PyCFunctionFast + #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords +#endif +#if CYTHON_FAST_PYCCALL +#define __Pyx_PyFastCFunction_Check(func)\ + ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS))))) +#else +#define __Pyx_PyFastCFunction_Check(func) 0 +#endif +#if CYTHON_USE_DICT_VERSIONS +#define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) +#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ + (version_var) = __PYX_GET_DICT_VERSION(dict);\ + (cache_var) = (value); +#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ + static PY_UINT64_T __pyx_dict_version = 0;\ + static PyObject *__pyx_dict_cached_value = NULL;\ + if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ + (VAR) = __pyx_dict_cached_value;\ + } else {\ + (VAR) = __pyx_dict_cached_value = (LOOKUP);\ + __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ + }\ + } +#else +#define __PYX_GET_DICT_VERSION(dict) (0) +#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) +#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) + #define PyObject_Malloc(s) PyMem_Malloc(s) + #define PyObject_Free(p) PyMem_Free(p) + #define PyObject_Realloc(p) PyMem_Realloc(p) +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1 + #define PyMem_RawMalloc(n) PyMem_Malloc(n) + #define PyMem_RawRealloc(p, n) PyMem_Realloc(p, n) + #define PyMem_RawFree(p) PyMem_Free(p) +#endif +#if CYTHON_COMPILING_IN_PYSTON + #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co) + #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno) +#else + #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) + #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) +#endif +#if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000 + #define __Pyx_PyThreadState_Current PyThreadState_GET() +#elif PY_VERSION_HEX >= 0x03060000 + #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() +#elif PY_VERSION_HEX >= 0x03000000 + #define __Pyx_PyThreadState_Current PyThreadState_GET() +#else + #define __Pyx_PyThreadState_Current _PyThreadState_Current +#endif +#if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) +#include "pythread.h" +#define Py_tss_NEEDS_INIT 0 +typedef int Py_tss_t; +static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) { + *key = PyThread_create_key(); + return 0; // PyThread_create_key reports success always +} +static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) { + Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t)); + *key = Py_tss_NEEDS_INIT; + return key; +} +static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) { + PyObject_Free(key); +} +static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) { + return *key != Py_tss_NEEDS_INIT; +} +static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) { + PyThread_delete_key(*key); + *key = Py_tss_NEEDS_INIT; +} +static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) { + return PyThread_set_key_value(*key, value); +} +static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { + return PyThread_get_key_value(*key); +} +#endif // TSS (Thread Specific Storage) API +#if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized) +#define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) +#else +#define __Pyx_PyDict_NewPresized(n) PyDict_New() +#endif +#if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION + #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) +#else + #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS +#define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) +#else +#define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name) +#endif +#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) + #define CYTHON_PEP393_ENABLED 1 + #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ + 0 : _PyUnicode_Ready((PyObject *)(op))) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) + #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) + #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) + #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) + #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) + #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch) + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) +#else + #define CYTHON_PEP393_ENABLED 0 + #define PyUnicode_1BYTE_KIND 1 + #define PyUnicode_2BYTE_KIND 2 + #define PyUnicode_4BYTE_KIND 4 + #define __Pyx_PyUnicode_READY(op) (0) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) + #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111) + #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) + #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) + #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) + #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch) + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) +#endif +#if CYTHON_COMPILING_IN_PYPY + #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) +#else + #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ + PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains) + #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check) + #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format) + #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) +#endif +#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) +#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) +#else + #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) +#endif +#if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) + #define PyObject_ASCII(o) PyObject_Repr(o) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBaseString_Type PyUnicode_Type + #define PyStringObject PyUnicodeObject + #define PyString_Type PyUnicode_Type + #define PyString_Check PyUnicode_Check + #define PyString_CheckExact PyUnicode_CheckExact + #define PyObject_Unicode PyObject_Str +#endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) + #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) +#else + #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) + #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) +#endif +#ifndef PySet_CheckExact + #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) +#endif +#if CYTHON_ASSUME_SAFE_MACROS + #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) +#else + #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyIntObject PyLongObject + #define PyInt_Type PyLong_Type + #define PyInt_Check(op) PyLong_Check(op) + #define PyInt_CheckExact(op) PyLong_CheckExact(op) + #define PyInt_FromString PyLong_FromString + #define PyInt_FromUnicode PyLong_FromUnicode + #define PyInt_FromLong PyLong_FromLong + #define PyInt_FromSize_t PyLong_FromSize_t + #define PyInt_FromSsize_t PyLong_FromSsize_t + #define PyInt_AsLong PyLong_AsLong + #define PyInt_AS_LONG PyLong_AS_LONG + #define PyInt_AsSsize_t PyLong_AsSsize_t + #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask + #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask + #define PyNumber_Int PyNumber_Long +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBoolObject PyLongObject +#endif +#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY + #ifndef PyUnicode_InternFromString + #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) + #endif +#endif +#if PY_VERSION_HEX < 0x030200A4 + typedef long Py_hash_t; + #define __Pyx_PyInt_FromHash_t PyInt_FromLong + #define __Pyx_PyInt_AsHash_t PyInt_AsLong +#else + #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t + #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t +#endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : (Py_INCREF(func), func)) +#else + #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) +#endif +#if CYTHON_USE_ASYNC_SLOTS + #if PY_VERSION_HEX >= 0x030500B1 + #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods + #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) + #else + #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) + #endif +#else + #define __Pyx_PyType_AsAsync(obj) NULL +#endif +#ifndef __Pyx_PyAsyncMethodsStruct + typedef struct { + unaryfunc am_await; + unaryfunc am_aiter; + unaryfunc am_anext; + } __Pyx_PyAsyncMethodsStruct; +#endif + +#if defined(WIN32) || defined(MS_WINDOWS) + #define _USE_MATH_DEFINES +#endif +#include +#ifdef NAN +#define __PYX_NAN() ((float) NAN) +#else +static CYTHON_INLINE float __PYX_NAN() { + float value; + memset(&value, 0xFF, sizeof(value)); + return value; +} +#endif +#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) +#define __Pyx_truncl trunc +#else +#define __Pyx_truncl truncl +#endif + + +#define __PYX_ERR(f_index, lineno, Ln_error) \ +{ \ + __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \ +} + +#ifndef __PYX_EXTERN_C + #ifdef __cplusplus + #define __PYX_EXTERN_C extern "C" + #else + #define __PYX_EXTERN_C extern + #endif +#endif + +#define __PYX_HAVE__gevent___event +#define __PYX_HAVE_API__gevent___event +/* Early includes */ +#include "greenlet/greenlet.h" +#ifdef _OPENMP +#include +#endif /* _OPENMP */ + +#if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) +#define CYTHON_WITHOUT_ASSERTIONS +#endif + +typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; + const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; + +#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 +#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0 +#define __PYX_DEFAULT_STRING_ENCODING "" +#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString +#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#define __Pyx_uchar_cast(c) ((unsigned char)c) +#define __Pyx_long_cast(x) ((long)x) +#define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ + (sizeof(type) < sizeof(Py_ssize_t)) ||\ + (sizeof(type) > sizeof(Py_ssize_t) &&\ + likely(v < (type)PY_SSIZE_T_MAX ||\ + v == (type)PY_SSIZE_T_MAX) &&\ + (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ + v == (type)PY_SSIZE_T_MIN))) ||\ + (sizeof(type) == sizeof(Py_ssize_t) &&\ + (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ + v == (type)PY_SSIZE_T_MAX))) ) +static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) { + return (size_t) i < (size_t) limit; +} +#if defined (__cplusplus) && __cplusplus >= 201103L + #include + #define __Pyx_sst_abs(value) std::abs(value) +#elif SIZEOF_INT >= SIZEOF_SIZE_T + #define __Pyx_sst_abs(value) abs(value) +#elif SIZEOF_LONG >= SIZEOF_SIZE_T + #define __Pyx_sst_abs(value) labs(value) +#elif defined (_MSC_VER) + #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) +#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define __Pyx_sst_abs(value) llabs(value) +#elif defined (__GNUC__) + #define __Pyx_sst_abs(value) __builtin_llabs(value) +#else + #define __Pyx_sst_abs(value) ((value<0) ? -value : value) +#endif +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*); +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); +#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) +#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) +#define __Pyx_PyBytes_FromString PyBytes_FromString +#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); +#if PY_MAJOR_VERSION < 3 + #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#else + #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize +#endif +#define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) +#define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) +#define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) +#define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) +#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) +static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) { + const Py_UNICODE *u_end = u; + while (*u_end++) ; + return (size_t)(u_end - u - 1); +} +#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) +#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode +#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode +#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) +#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) +static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); +static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*); +static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); +#define __Pyx_PySequence_Tuple(obj)\ + (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); +#if CYTHON_ASSUME_SAFE_MACROS +#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) +#else +#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) +#endif +#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) +#if PY_MAJOR_VERSION >= 3 +#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) +#else +#define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) +#endif +#define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x)) +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII +static int __Pyx_sys_getdefaultencoding_not_ascii; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + PyObject* ascii_chars_u = NULL; + PyObject* ascii_chars_b = NULL; + const char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + if (strcmp(default_encoding_c, "ascii") == 0) { + __Pyx_sys_getdefaultencoding_not_ascii = 0; + } else { + char ascii_chars[128]; + int c; + for (c = 0; c < 128; c++) { + ascii_chars[c] = c; + } + __Pyx_sys_getdefaultencoding_not_ascii = 1; + ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); + if (!ascii_chars_u) goto bad; + ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); + if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { + PyErr_Format( + PyExc_ValueError, + "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", + default_encoding_c); + goto bad; + } + Py_DECREF(ascii_chars_u); + Py_DECREF(ascii_chars_b); + } + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + Py_XDECREF(ascii_chars_u); + Py_XDECREF(ascii_chars_b); + return -1; +} +#endif +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) +#else +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +static char* __PYX_DEFAULT_STRING_ENCODING; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1); + if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; + strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + return -1; +} +#endif +#endif + + +/* Test for GCC > 2.95 */ +#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) + #define likely(x) __builtin_expect(!!(x), 1) + #define unlikely(x) __builtin_expect(!!(x), 0) +#else /* !__GNUC__ or GCC < 2.95 */ + #define likely(x) (x) + #define unlikely(x) (x) +#endif /* __GNUC__ */ +static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } + +static PyObject *__pyx_m = NULL; +static PyObject *__pyx_d; +static PyObject *__pyx_b; +static PyObject *__pyx_cython_runtime = NULL; +static PyObject *__pyx_empty_tuple; +static PyObject *__pyx_empty_bytes; +static PyObject *__pyx_empty_unicode; +static int __pyx_lineno; +static int __pyx_clineno = 0; +static const char * __pyx_cfilenm= __FILE__; +static const char *__pyx_filename; + + +static const char *__pyx_f[] = { + "src\\gevent\\event.py", + "src\\gevent\\_event.pxd", + "src\\gevent\\__greenlet_primitives.pxd", + "src\\gevent\\__abstract_linkable.pxd", +}; + +/*--- Type declarations ---*/ +struct __pyx_obj_6gevent_21__greenlet_primitives_TrackedRawGreenlet; +struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop; +struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable; +struct __pyx_obj_6gevent_6_event_Event; +struct __pyx_obj_6gevent_6_event_AsyncResult; +struct __pyx_opt_args_6gevent_19__abstract_linkable_16AbstractLinkable__wait_core; +struct __pyx_opt_args_6gevent_19__abstract_linkable_16AbstractLinkable__wait; + +/* "gevent/__abstract_linkable.pxd":51 + * cdef _check_and_notify(self) + * cpdef _notify_links(self) + * cdef _wait_core(self, timeout, catch=*) # <<<<<<<<<<<<<< + * cdef _wait_return_value(self, waited, wait_success) + * cdef _wait(self, timeout=*) + */ +struct __pyx_opt_args_6gevent_19__abstract_linkable_16AbstractLinkable__wait_core { + int __pyx_n; + PyObject *catch; +}; + +/* "gevent/__abstract_linkable.pxd":53 + * cdef _wait_core(self, timeout, catch=*) + * cdef _wait_return_value(self, waited, wait_success) + * cdef _wait(self, timeout=*) # <<<<<<<<<<<<<< + */ +struct __pyx_opt_args_6gevent_19__abstract_linkable_16AbstractLinkable__wait { + int __pyx_n; + PyObject *timeout; +}; +struct __pyx_opt_args_6gevent_6_event_11AsyncResult_get; +struct __pyx_opt_args_6gevent_6_event_11AsyncResult_wait; + +/* "gevent/_event.pxd":23 + * cdef public int _imap_task_index + * + * cpdef get(self, block=*, timeout=*) # <<<<<<<<<<<<<< + * cpdef bint successful(self) + * + */ +struct __pyx_opt_args_6gevent_6_event_11AsyncResult_get { + int __pyx_n; + PyObject *block; + PyObject *timeout; +}; + +/* "gevent/_event.pxd":26 + * cpdef bint successful(self) + * + * cpdef wait(self, timeout=*) # <<<<<<<<<<<<<< + * cpdef bint done(self) + * + */ +struct __pyx_opt_args_6gevent_6_event_11AsyncResult_wait { + int __pyx_n; + PyObject *timeout; +}; + +/* "gevent/__greenlet_primitives.pxd":37 + * return PyGreenlet_Switch(self, NULL, NULL) + * + * cdef class TrackedRawGreenlet(greenlet): # <<<<<<<<<<<<<< + * pass + * + */ +struct __pyx_obj_6gevent_21__greenlet_primitives_TrackedRawGreenlet { + PyGreenlet __pyx_base; +}; + + +/* "gevent/__greenlet_primitives.pxd":40 + * pass + * + * cdef class SwitchOutGreenletWithLoop(TrackedRawGreenlet): # <<<<<<<<<<<<<< + * cdef public loop + * + */ +struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop { + struct __pyx_obj_6gevent_21__greenlet_primitives_TrackedRawGreenlet __pyx_base; + struct __pyx_vtabstruct_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *__pyx_vtab; + PyObject *loop; +}; + + +/* "gevent/__abstract_linkable.pxd":32 + * cdef void _init() + * + * cdef class AbstractLinkable(object): # <<<<<<<<<<<<<< + * # We declare the __weakref__ here in the base (even though + * # that's not really what we want) as a workaround for a Cython + */ +struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable { + PyObject_HEAD + struct __pyx_vtabstruct_6gevent_19__abstract_linkable_AbstractLinkable *__pyx_vtab; + PyObject *__weakref__; + struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *hub; + PyObject *_notifier; + PyObject *_links; + int _notify_all; +}; + + +/* "gevent/_event.pxd":13 + * cdef Timeout + * + * cdef class Event(AbstractLinkable): # <<<<<<<<<<<<<< + * cdef bint _flag + * + */ +struct __pyx_obj_6gevent_6_event_Event { + struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable __pyx_base; + int _flag; +}; + + +/* "gevent/_event.pxd":16 + * cdef bint _flag + * + * cdef class AsyncResult(AbstractLinkable): # <<<<<<<<<<<<<< + * cdef readonly _value + * cdef readonly tuple _exc_info + */ +struct __pyx_obj_6gevent_6_event_AsyncResult { + struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable __pyx_base; + PyObject *_value; + PyObject *_exc_info; + int _imap_task_index; +}; + + + +/* "gevent/__greenlet_primitives.pxd":40 + * pass + * + * cdef class SwitchOutGreenletWithLoop(TrackedRawGreenlet): # <<<<<<<<<<<<<< + * cdef public loop + * + */ + +struct __pyx_vtabstruct_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop { + PyObject *(*__pyx_switch)(struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *, int __pyx_skip_dispatch); + PyObject *(*switch_out)(struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *, int __pyx_skip_dispatch); +}; +static struct __pyx_vtabstruct_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *__pyx_vtabptr_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop; + + +/* "gevent/__abstract_linkable.pxd":32 + * cdef void _init() + * + * cdef class AbstractLinkable(object): # <<<<<<<<<<<<<< + * # We declare the __weakref__ here in the base (even though + * # that's not really what we want) as a workaround for a Cython + */ + +struct __pyx_vtabstruct_6gevent_19__abstract_linkable_AbstractLinkable { + PyObject *(*rawlink)(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *, PyObject *, int __pyx_skip_dispatch); + int (*ready)(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *, int __pyx_skip_dispatch); + PyObject *(*unlink)(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *, PyObject *, int __pyx_skip_dispatch); + PyObject *(*_check_and_notify)(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *); + PyObject *(*_notify_links)(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *, int __pyx_skip_dispatch); + PyObject *(*_wait_core)(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *, PyObject *, struct __pyx_opt_args_6gevent_19__abstract_linkable_16AbstractLinkable__wait_core *__pyx_optional_args); + PyObject *(*_wait_return_value)(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *, PyObject *, PyObject *); + PyObject *(*_wait)(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *, struct __pyx_opt_args_6gevent_19__abstract_linkable_16AbstractLinkable__wait *__pyx_optional_args); +}; +static struct __pyx_vtabstruct_6gevent_19__abstract_linkable_AbstractLinkable *__pyx_vtabptr_6gevent_19__abstract_linkable_AbstractLinkable; + + +/* "src/gevent/event.py":30 + * # pylint:disable=assigning-non-slot + * + * class Event(AbstractLinkable): # pylint:disable=undefined-variable # <<<<<<<<<<<<<< + * """A synchronization primitive that allows one greenlet to wake up one or more others. + * It has the same interface as :class:`threading.Event` but works across greenlets. + */ + +struct __pyx_vtabstruct_6gevent_6_event_Event { + struct __pyx_vtabstruct_6gevent_19__abstract_linkable_AbstractLinkable __pyx_base; +}; +static struct __pyx_vtabstruct_6gevent_6_event_Event *__pyx_vtabptr_6gevent_6_event_Event; + + +/* "src/gevent/event.py":136 + * + * + * class AsyncResult(AbstractLinkable): # pylint:disable=undefined-variable # <<<<<<<<<<<<<< + * """A one-time event that stores a value or an exception. + * + */ + +struct __pyx_vtabstruct_6gevent_6_event_AsyncResult { + struct __pyx_vtabstruct_6gevent_19__abstract_linkable_AbstractLinkable __pyx_base; + PyObject *(*get)(struct __pyx_obj_6gevent_6_event_AsyncResult *, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_6_event_11AsyncResult_get *__pyx_optional_args); + int (*successful)(struct __pyx_obj_6gevent_6_event_AsyncResult *, int __pyx_skip_dispatch); + PyObject *(*wait)(struct __pyx_obj_6gevent_6_event_AsyncResult *, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_6_event_11AsyncResult_wait *__pyx_optional_args); + int (*done)(struct __pyx_obj_6gevent_6_event_AsyncResult *, int __pyx_skip_dispatch); + int (*cancel)(struct __pyx_obj_6gevent_6_event_AsyncResult *, int __pyx_skip_dispatch); + int (*cancelled)(struct __pyx_obj_6gevent_6_event_AsyncResult *, int __pyx_skip_dispatch); +}; +static struct __pyx_vtabstruct_6gevent_6_event_AsyncResult *__pyx_vtabptr_6gevent_6_event_AsyncResult; + +/* --- Runtime support code (head) --- */ +/* Refnanny.proto */ +#ifndef CYTHON_REFNANNY + #define CYTHON_REFNANNY 0 +#endif +#if CYTHON_REFNANNY + typedef struct { + void (*INCREF)(void*, PyObject*, int); + void (*DECREF)(void*, PyObject*, int); + void (*GOTREF)(void*, PyObject*, int); + void (*GIVEREF)(void*, PyObject*, int); + void* (*SetupContext)(const char*, int, const char*); + void (*FinishContext)(void**); + } __Pyx_RefNannyAPIStruct; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); + #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; +#ifdef WITH_THREAD + #define __Pyx_RefNannySetupContext(name, acquire_gil)\ + if (acquire_gil) {\ + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ + PyGILState_Release(__pyx_gilstate_save);\ + } else {\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ + } +#else + #define __Pyx_RefNannySetupContext(name, acquire_gil)\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) +#endif + #define __Pyx_RefNannyFinishContext()\ + __Pyx_RefNanny->FinishContext(&__pyx_refnanny) + #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0) + #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) + #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) + #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) +#else + #define __Pyx_RefNannyDeclarations + #define __Pyx_RefNannySetupContext(name, acquire_gil) + #define __Pyx_RefNannyFinishContext() + #define __Pyx_INCREF(r) Py_INCREF(r) + #define __Pyx_DECREF(r) Py_DECREF(r) + #define __Pyx_GOTREF(r) + #define __Pyx_GIVEREF(r) + #define __Pyx_XINCREF(r) Py_XINCREF(r) + #define __Pyx_XDECREF(r) Py_XDECREF(r) + #define __Pyx_XGOTREF(r) + #define __Pyx_XGIVEREF(r) +#endif +#define __Pyx_XDECREF_SET(r, v) do {\ + PyObject *tmp = (PyObject *) r;\ + r = v; __Pyx_XDECREF(tmp);\ + } while (0) +#define __Pyx_DECREF_SET(r, v) do {\ + PyObject *tmp = (PyObject *) r;\ + r = v; __Pyx_DECREF(tmp);\ + } while (0) +#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) +#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) + +/* PyObjectGetAttrStr.proto */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); +#else +#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) +#endif + +/* GetBuiltinName.proto */ +static PyObject *__Pyx_GetBuiltinName(PyObject *name); + +/* PyObjectCall.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); +#else +#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) +#endif + +/* RaiseArgTupleInvalid.proto */ +static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, + Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); + +/* KeywordStringCheck.proto */ +static int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* function_name, int kw_allowed); + +/* PyFunctionFastCall.proto */ +#if CYTHON_FAST_PYCALL +#define __Pyx_PyFunction_FastCall(func, args, nargs)\ + __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) +#if 1 || PY_VERSION_HEX < 0x030600B1 +static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs); +#else +#define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs) +#endif +#define __Pyx_BUILD_ASSERT_EXPR(cond)\ + (sizeof(char [1 - 2*!(cond)]) - 1) +#ifndef Py_MEMBER_SIZE +#define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member) +#endif + static size_t __pyx_pyframe_localsplus_offset = 0; + #include "frameobject.h" + #define __Pxy_PyFrame_Initialize_Offsets()\ + ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\ + (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus))) + #define __Pyx_PyFrame_GetLocalsplus(frame)\ + (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset)) +#endif + +/* PyObjectCallMethO.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); +#endif + +/* PyObjectCallNoArg.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); +#else +#define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL) +#endif + +/* PyCFunctionFastCall.proto */ +#if CYTHON_FAST_PYCCALL +static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs); +#else +#define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL) +#endif + +/* PyObjectCallOneArg.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); + +/* PyThreadStateGet.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; +#define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; +#define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type +#else +#define __Pyx_PyThreadState_declare +#define __Pyx_PyThreadState_assign +#define __Pyx_PyErr_Occurred() PyErr_Occurred() +#endif + +/* PyErrFetchRestore.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) +#define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) +#define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) +#define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) +#define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); +static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) +#else +#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) +#endif +#else +#define __Pyx_PyErr_Clear() PyErr_Clear() +#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) +#define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) +#define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb) +#define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) +#endif + +/* WriteUnraisableException.proto */ +static void __Pyx_WriteUnraisable(const char *name, int clineno, + int lineno, const char *filename, + int full_traceback, int nogil); + +/* RaiseDoubleKeywords.proto */ +static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); + +/* ParseKeywords.proto */ +static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\ + PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\ + const char* function_name); + +/* GetModuleGlobalName.proto */ +#if CYTHON_USE_DICT_VERSIONS +#define __Pyx_GetModuleGlobalName(var, name) {\ + static PY_UINT64_T __pyx_dict_version = 0;\ + static PyObject *__pyx_dict_cached_value = NULL;\ + (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\ + (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\ + __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ +} +#define __Pyx_GetModuleGlobalNameUncached(var, name) {\ + PY_UINT64_T __pyx_dict_version;\ + PyObject *__pyx_dict_cached_value;\ + (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ +} +static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value); +#else +#define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name) +#define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name) +static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name); +#endif + +/* GetItemInt.proto */ +#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ + __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\ + (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\ + __Pyx_GetItemInt_Generic(o, to_py_func(i)))) +#define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ + __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ + (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL)) +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, + int wraparound, int boundscheck); +#define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ + __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ + (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL)) +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, + int wraparound, int boundscheck); +static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j); +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, + int is_list, int wraparound, int boundscheck); + +/* PyObjectCall2Args.proto */ +static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2); + +/* RaiseException.proto */ +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); + +/* PyErrExceptionMatches.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) +static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); +#else +#define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) +#endif + +/* GetAttr.proto */ +static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *); + +/* GetAttr3.proto */ +static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *); + +/* CallNextTpDealloc.proto */ +static void __Pyx_call_next_tp_dealloc(PyObject* obj, destructor current_tp_dealloc); + +/* CallNextTpTraverse.proto */ +static int __Pyx_call_next_tp_traverse(PyObject* obj, visitproc v, void *a, traverseproc current_tp_traverse); + +/* CallNextTpClear.proto */ +static void __Pyx_call_next_tp_clear(PyObject* obj, inquiry current_tp_dealloc); + +/* TypeImport.proto */ +#ifndef __PYX_HAVE_RT_ImportType_proto +#define __PYX_HAVE_RT_ImportType_proto +enum __Pyx_ImportType_CheckSize { + __Pyx_ImportType_CheckSize_Error = 0, + __Pyx_ImportType_CheckSize_Warn = 1, + __Pyx_ImportType_CheckSize_Ignore = 2 +}; +static PyTypeObject *__Pyx_ImportType(PyObject* module, const char *module_name, const char *class_name, size_t size, enum __Pyx_ImportType_CheckSize check_size); +#endif + +/* GetVTable.proto */ +static void* __Pyx_GetVtable(PyObject *dict); + +/* PyObject_GenericGetAttrNoDict.proto */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name); +#else +#define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr +#endif + +/* PyObject_GenericGetAttr.proto */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name); +#else +#define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr +#endif + +/* SetVTable.proto */ +static int __Pyx_SetVtable(PyObject *dict, void *vtable); + +/* Import.proto */ +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); + +/* ImportFrom.proto */ +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); + +/* FetchCommonType.proto */ +static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); + +/* CythonFunction.proto */ +#define __Pyx_CyFunction_USED 1 +#define __Pyx_CYFUNCTION_STATICMETHOD 0x01 +#define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 +#define __Pyx_CYFUNCTION_CCLASS 0x04 +#define __Pyx_CyFunction_GetClosure(f)\ + (((__pyx_CyFunctionObject *) (f))->func_closure) +#define __Pyx_CyFunction_GetClassObj(f)\ + (((__pyx_CyFunctionObject *) (f))->func_classobj) +#define __Pyx_CyFunction_Defaults(type, f)\ + ((type *)(((__pyx_CyFunctionObject *) (f))->defaults)) +#define __Pyx_CyFunction_SetDefaultsGetter(f, g)\ + ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g) +typedef struct { + PyCFunctionObject func; +#if PY_VERSION_HEX < 0x030500A0 + PyObject *func_weakreflist; +#endif + PyObject *func_dict; + PyObject *func_name; + PyObject *func_qualname; + PyObject *func_doc; + PyObject *func_globals; + PyObject *func_code; + PyObject *func_closure; + PyObject *func_classobj; + void *defaults; + int defaults_pyobjects; + int flags; + PyObject *defaults_tuple; + PyObject *defaults_kwdict; + PyObject *(*defaults_getter)(PyObject *); + PyObject *func_annotations; +} __pyx_CyFunctionObject; +static PyTypeObject *__pyx_CyFunctionType = 0; +#define __Pyx_CyFunction_Check(obj) (__Pyx_TypeCheck(obj, __pyx_CyFunctionType)) +#define __Pyx_CyFunction_NewEx(ml, flags, qualname, self, module, globals, code)\ + __Pyx_CyFunction_New(__pyx_CyFunctionType, ml, flags, qualname, self, module, globals, code) +static PyObject *__Pyx_CyFunction_New(PyTypeObject *, PyMethodDef *ml, + int flags, PyObject* qualname, + PyObject *self, + PyObject *module, PyObject *globals, + PyObject* code); +static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, + size_t size, + int pyobjects); +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, + PyObject *tuple); +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, + PyObject *dict); +static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m, + PyObject *dict); +static int __pyx_CyFunction_init(void); + +/* PyObjectSetAttrStr.proto */ +#if CYTHON_USE_TYPE_SLOTS +#define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o, n, NULL) +static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value); +#else +#define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n) +#define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v) +#endif + +/* GetNameInClass.proto */ +#define __Pyx_GetNameInClass(var, nmspace, name) (var) = __Pyx__GetNameInClass(nmspace, name) +static PyObject *__Pyx__GetNameInClass(PyObject *nmspace, PyObject *name); + +/* Globals.proto */ +static PyObject* __Pyx_Globals(void); + +/* CLineInTraceback.proto */ +#ifdef CYTHON_CLINE_IN_TRACEBACK +#define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) +#else +static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line); +#endif + +/* CodeObjectCache.proto */ +typedef struct { + PyCodeObject* code_object; + int code_line; +} __Pyx_CodeObjectCacheEntry; +struct __Pyx_CodeObjectCache { + int count; + int max_count; + __Pyx_CodeObjectCacheEntry* entries; +}; +static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); +static PyCodeObject *__pyx_find_code_object(int code_line); +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); + +/* AddTraceback.proto */ +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename); + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); + +/* CIntFromPy.proto */ +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); + +/* CIntFromPy.proto */ +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); + +/* FastTypeChecks.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) +static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b); +static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type); +static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2); +#else +#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) +#define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) +#define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) +#endif +#define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) + +/* CheckBinaryVersion.proto */ +static int __Pyx_check_binary_version(void); + +/* VoidPtrExport.proto */ +static int __Pyx_ExportVoidPtr(PyObject *name, void *p, const char *sig); + +/* VoidPtrImport.proto */ +static int __Pyx_ImportVoidPtr(PyObject *module, const char *name, void **p, const char *sig); + +/* FunctionImport.proto */ +static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig); + +/* InitStrings.proto */ +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); + +static int __pyx_f_6gevent_6_event_5Event_ready(struct __pyx_obj_6gevent_6_event_Event *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/ +static PyObject *__pyx_f_6gevent_6_event_5Event__wait_return_value(struct __pyx_obj_6gevent_6_event_Event *__pyx_v_self, PyObject *__pyx_v_waited, PyObject *__pyx_v_wait_success); /* proto*/ +static int __pyx_f_6gevent_6_event_11AsyncResult_ready(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/ +static int __pyx_f_6gevent_6_event_11AsyncResult_successful(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/ +static PyObject *__pyx_f_6gevent_6_event_11AsyncResult_get(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_6_event_11AsyncResult_get *__pyx_optional_args); /* proto*/ +static PyObject *__pyx_f_6gevent_6_event_11AsyncResult__wait_return_value(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_waited, CYTHON_UNUSED PyObject *__pyx_v_wait_success); /* proto*/ +static PyObject *__pyx_f_6gevent_6_event_11AsyncResult_wait(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_6_event_11AsyncResult_wait *__pyx_optional_args); /* proto*/ +static int __pyx_f_6gevent_6_event_11AsyncResult_done(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/ +static int __pyx_f_6gevent_6_event_11AsyncResult_cancel(CYTHON_UNUSED struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/ +static int __pyx_f_6gevent_6_event_11AsyncResult_cancelled(CYTHON_UNUSED struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/ + +/* Module declarations from 'cython' */ + +/* Module declarations from 'greenlet' */ + +/* Module declarations from 'gevent.__greenlet_primitives' */ +static PyTypeObject *__pyx_ptype_6gevent_21__greenlet_primitives_greenlet = 0; +static PyTypeObject *__pyx_ptype_6gevent_21__greenlet_primitives_TrackedRawGreenlet = 0; +static PyTypeObject *__pyx_ptype_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop = 0; +static PyObject **__pyx_vp_6gevent_21__greenlet_primitives_get_objects = 0; +#define __pyx_v_6gevent_21__greenlet_primitives_get_objects (*__pyx_vp_6gevent_21__greenlet_primitives_get_objects) +static PyObject **__pyx_vp_6gevent_21__greenlet_primitives_wref = 0; +#define __pyx_v_6gevent_21__greenlet_primitives_wref (*__pyx_vp_6gevent_21__greenlet_primitives_wref) +static PyObject **__pyx_vp_6gevent_21__greenlet_primitives_BlockingSwitchOutError = 0; +#define __pyx_v_6gevent_21__greenlet_primitives_BlockingSwitchOutError (*__pyx_vp_6gevent_21__greenlet_primitives_BlockingSwitchOutError) +static int *__pyx_vp_6gevent_21__greenlet_primitives__greenlet_imported = 0; +#define __pyx_v_6gevent_21__greenlet_primitives__greenlet_imported (*__pyx_vp_6gevent_21__greenlet_primitives__greenlet_imported) + +/* Module declarations from 'gevent.__hub_local' */ +static PyObject **__pyx_vp_6gevent_11__hub_local__threadlocal = 0; +#define __pyx_v_6gevent_11__hub_local__threadlocal (*__pyx_vp_6gevent_11__hub_local__threadlocal) +static struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *(*__pyx_f_6gevent_11__hub_local_get_hub_noargs)(int __pyx_skip_dispatch); /*proto*/ + +/* Module declarations from 'gevent.__abstract_linkable' */ +static PyTypeObject *__pyx_ptype_6gevent_19__abstract_linkable_greenlet = 0; +static PyTypeObject *__pyx_ptype_6gevent_19__abstract_linkable_AbstractLinkable = 0; +static PyObject **__pyx_vp_6gevent_19__abstract_linkable_InvalidSwitchError = 0; +#define __pyx_v_6gevent_19__abstract_linkable_InvalidSwitchError (*__pyx_vp_6gevent_19__abstract_linkable_InvalidSwitchError) +static PyObject **__pyx_vp_6gevent_19__abstract_linkable_Timeout = 0; +#define __pyx_v_6gevent_19__abstract_linkable_Timeout (*__pyx_vp_6gevent_19__abstract_linkable_Timeout) +static int *__pyx_vp_6gevent_19__abstract_linkable__greenlet_imported = 0; +#define __pyx_v_6gevent_19__abstract_linkable__greenlet_imported (*__pyx_vp_6gevent_19__abstract_linkable__greenlet_imported) + +/* Module declarations from 'gevent._event' */ +static PyTypeObject *__pyx_ptype_6gevent_6_event_Event = 0; +static PyTypeObject *__pyx_ptype_6gevent_6_event_AsyncResult = 0; +static PyObject *__pyx_v_6gevent_6_event__None = 0; +static PyObject *__pyx_v_6gevent_6_event_reraise = 0; +static PyObject *__pyx_v_6gevent_6_event_dump_traceback = 0; +static PyObject *__pyx_v_6gevent_6_event_load_traceback = 0; +static PyObject *__pyx_v_6gevent_6_event_Timeout = 0; +#define __Pyx_MODULE_NAME "gevent._event" +extern int __pyx_module_is_main_gevent___event; +int __pyx_module_is_main_gevent___event = 0; + +/* Implementation of 'gevent._event' */ +static PyObject *__pyx_builtin___import__; +static PyObject *__pyx_builtin_super; +static const char __pyx_k_s[] = "<%s "; +static const char __pyx_k_x[] = "x"; +static const char __pyx_k_all[] = "__all__"; +static const char __pyx_k_get[] = "get"; +static const char __pyx_k_set[] = "set"; +static const char __pyx_k_NONE[] = "_NONE"; +static const char __pyx_k_None[] = "_None"; +static const char __pyx_k_done[] = "done"; +static const char __pyx_k_flag[] = "_flag"; +static const char __pyx_k_init[] = "__init__"; +static const char __pyx_k_main[] = "__main__"; +static const char __pyx_k_name[] = "__name__"; +static const char __pyx_k_self[] = "self"; +static const char __pyx_k_test[] = "__test__"; +static const char __pyx_k_wait[] = "wait"; +static const char __pyx_k_Event[] = "Event"; +static const char __pyx_k_block[] = "block"; +static const char __pyx_k_class[] = "__class__"; +static const char __pyx_k_clear[] = "clear"; +static const char __pyx_k_isSet[] = "isSet"; +static const char __pyx_k_ready[] = "ready"; +static const char __pyx_k_slots[] = "__slots__"; +static const char __pyx_k_super[] = "super"; +static const char __pyx_k_unset[] = "unset "; +static const char __pyx_k_value[] = "value"; +static const char __pyx_k_cancel[] = "cancel"; +static const char __pyx_k_import[] = "__import__"; +static const char __pyx_k_is_set[] = "is_set"; +static const char __pyx_k_result[] = "result"; +static const char __pyx_k_source[] = "source"; +static const char __pyx_k_Timeout[] = "Timeout"; +static const char __pyx_k_links_s[] = " _links[%s]>"; +static const char __pyx_k_reraise[] = "reraise"; +static const char __pyx_k_timeout[] = "timeout"; +static const char __pyx_k_value_2[] = "_value"; +static const char __pyx_k_value_r[] = "value=%r "; +static const char __pyx_k_exc_info[] = "exc_info"; +static const char __pyx_k_pyx_capi[] = "__pyx_capi__"; +static const char __pyx_k_Event_set[] = "Event.set"; +static const char __pyx_k_cancelled[] = "cancelled"; +static const char __pyx_k_exception[] = "_exception"; +static const char __pyx_k_linkcount[] = "linkcount"; +static const char __pyx_k_Event_wait[] = "Event.wait"; +static const char __pyx_k_exc_info_2[] = "_exc_info"; +static const char __pyx_k_get_nowait[] = "get_nowait"; +static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__"; +static const char __pyx_k_set_result[] = "set_result"; +static const char __pyx_k_successful[] = "successful"; +static const char __pyx_k_AsyncResult[] = "AsyncResult"; +static const char __pyx_k_Event_clear[] = "Event.clear"; +static const char __pyx_k_Event_isSet[] = "Event.isSet"; +static const char __pyx_k_Event_ready[] = "Event.ready"; +static const char __pyx_k_exception_2[] = "exception"; +static const char __pyx_k_exception_r[] = "exception=%r "; +static const char __pyx_k_Event_is_set[] = "Event.is_set"; +static const char __pyx_k_get_linkable[] = "_get_linkable"; +static const char __pyx_k_gevent__util[] = "gevent._util"; +static const char __pyx_k_s_s__links_s[] = "<%s %s _links[%s]>"; +static const char __pyx_k_gevent__event[] = "gevent._event"; +static const char __pyx_k_gevent__tblib[] = "gevent._tblib"; +static const char __pyx_k_set_exception[] = "set_exception"; +static const char __pyx_k_dump_traceback[] = "dump_traceback"; +static const char __pyx_k_gevent__compat[] = "gevent._compat"; +static const char __pyx_k_gevent_timeout[] = "gevent.timeout"; +static const char __pyx_k_import_c_accel[] = "import_c_accel"; +static const char __pyx_k_load_traceback[] = "load_traceback"; +static const char __pyx_k_AsyncResult_get[] = "AsyncResult.get"; +static const char __pyx_k_AsyncResult_set[] = "AsyncResult.set"; +static const char __pyx_k_imap_task_index[] = "_imap_task_index"; +static const char __pyx_k_raise_exception[] = "_raise_exception"; +static const char __pyx_k_AbstractLinkable[] = "AbstractLinkable"; +static const char __pyx_k_AsyncResult_done[] = "AsyncResult.done"; +static const char __pyx_k_AsyncResult_wait[] = "AsyncResult.wait"; +static const char __pyx_k_AsyncResult_ready[] = "AsyncResult.ready"; +static const char __pyx_k_abstract_linkable[] = "_abstract_linkable"; +static const char __pyx_k_AsyncResult_cancel[] = "AsyncResult.cancel"; +static const char __pyx_k_AsyncResult_result[] = "AsyncResult.result"; +static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; +static const char __pyx_k_src_gevent_event_py[] = "src\\gevent\\event.py"; +static const char __pyx_k_reset_internal_locks[] = "_reset_internal_locks"; +static const char __pyx_k_AsyncResult_cancelled[] = "AsyncResult.cancelled"; +static const char __pyx_k_AsyncResult_get_nowait[] = "AsyncResult.get_nowait"; +static const char __pyx_k_AsyncResult_successful[] = "AsyncResult.successful"; +static const char __pyx_k_AsyncResult_set_exception[] = "AsyncResult.set_exception"; +static const char __pyx_k_gevent__abstract_linkable[] = "gevent._abstract_linkable"; +static const char __pyx_k_Event__reset_internal_locks[] = "Event._reset_internal_locks"; +static const char __pyx_k_AsyncResult__raise_exception[] = "AsyncResult._raise_exception"; +static const char __pyx_k_Basic_synchronization_primitives[] = "Basic synchronization primitives: Event and AsyncResult"; +static const char __pyx_k_if_we_didn_t_wait_we_should_alre[] = "if we didn't wait we should already be set"; +static PyObject *__pyx_n_s_AbstractLinkable; +static PyObject *__pyx_n_s_AsyncResult; +static PyObject *__pyx_n_s_AsyncResult__raise_exception; +static PyObject *__pyx_n_s_AsyncResult_cancel; +static PyObject *__pyx_n_s_AsyncResult_cancelled; +static PyObject *__pyx_n_s_AsyncResult_done; +static PyObject *__pyx_n_s_AsyncResult_get; +static PyObject *__pyx_n_s_AsyncResult_get_nowait; +static PyObject *__pyx_n_s_AsyncResult_ready; +static PyObject *__pyx_n_s_AsyncResult_result; +static PyObject *__pyx_n_s_AsyncResult_set; +static PyObject *__pyx_n_s_AsyncResult_set_exception; +static PyObject *__pyx_n_s_AsyncResult_successful; +static PyObject *__pyx_n_s_AsyncResult_wait; +static PyObject *__pyx_n_s_Event; +static PyObject *__pyx_n_s_Event__reset_internal_locks; +static PyObject *__pyx_n_s_Event_clear; +static PyObject *__pyx_n_s_Event_isSet; +static PyObject *__pyx_n_s_Event_is_set; +static PyObject *__pyx_n_s_Event_ready; +static PyObject *__pyx_n_s_Event_set; +static PyObject *__pyx_n_s_Event_wait; +static PyObject *__pyx_n_s_NONE; +static PyObject *__pyx_n_s_None; +static PyObject *__pyx_n_s_Timeout; +static PyObject *__pyx_n_s_abstract_linkable; +static PyObject *__pyx_n_s_all; +static PyObject *__pyx_n_s_block; +static PyObject *__pyx_n_s_cancel; +static PyObject *__pyx_n_s_cancelled; +static PyObject *__pyx_n_s_class; +static PyObject *__pyx_n_s_clear; +static PyObject *__pyx_n_s_cline_in_traceback; +static PyObject *__pyx_n_s_done; +static PyObject *__pyx_n_s_dump_traceback; +static PyObject *__pyx_n_s_exc_info; +static PyObject *__pyx_n_s_exc_info_2; +static PyObject *__pyx_n_s_exception; +static PyObject *__pyx_n_s_exception_2; +static PyObject *__pyx_kp_s_exception_r; +static PyObject *__pyx_n_s_flag; +static PyObject *__pyx_n_s_get; +static PyObject *__pyx_n_s_get_linkable; +static PyObject *__pyx_n_s_get_nowait; +static PyObject *__pyx_kp_s_gevent__abstract_linkable; +static PyObject *__pyx_n_s_gevent__compat; +static PyObject *__pyx_n_s_gevent__event; +static PyObject *__pyx_n_s_gevent__tblib; +static PyObject *__pyx_n_s_gevent__util; +static PyObject *__pyx_n_s_gevent_timeout; +static PyObject *__pyx_kp_s_if_we_didn_t_wait_we_should_alre; +static PyObject *__pyx_n_s_imap_task_index; +static PyObject *__pyx_n_s_import; +static PyObject *__pyx_n_s_import_c_accel; +static PyObject *__pyx_n_s_init; +static PyObject *__pyx_n_s_isSet; +static PyObject *__pyx_n_s_is_set; +static PyObject *__pyx_n_s_linkcount; +static PyObject *__pyx_kp_s_links_s; +static PyObject *__pyx_n_s_load_traceback; +static PyObject *__pyx_n_s_main; +static PyObject *__pyx_n_s_name; +static PyObject *__pyx_n_s_pyx_capi; +static PyObject *__pyx_n_s_pyx_vtable; +static PyObject *__pyx_n_s_raise_exception; +static PyObject *__pyx_n_s_ready; +static PyObject *__pyx_n_s_reraise; +static PyObject *__pyx_n_s_reset_internal_locks; +static PyObject *__pyx_n_s_result; +static PyObject *__pyx_kp_s_s; +static PyObject *__pyx_kp_s_s_s__links_s; +static PyObject *__pyx_n_s_self; +static PyObject *__pyx_n_s_set; +static PyObject *__pyx_n_s_set_exception; +static PyObject *__pyx_n_s_set_result; +static PyObject *__pyx_n_s_slots; +static PyObject *__pyx_n_s_source; +static PyObject *__pyx_kp_s_src_gevent_event_py; +static PyObject *__pyx_n_s_successful; +static PyObject *__pyx_n_s_super; +static PyObject *__pyx_n_s_test; +static PyObject *__pyx_n_s_timeout; +static PyObject *__pyx_kp_s_unset; +static PyObject *__pyx_n_s_value; +static PyObject *__pyx_n_s_value_2; +static PyObject *__pyx_kp_s_value_r; +static PyObject *__pyx_n_s_wait; +static PyObject *__pyx_n_s_x; +static PyObject *__pyx_pf_6gevent_6_event__get_linkable(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static int __pyx_pf_6gevent_6_event_5Event___init__(struct __pyx_obj_6gevent_6_event_Event *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_6_event_5Event_2__str__(struct __pyx_obj_6gevent_6_event_Event *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_6_event_5Event_4is_set(struct __pyx_obj_6gevent_6_event_Event *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_6_event_5Event_6isSet(struct __pyx_obj_6gevent_6_event_Event *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_6_event_5Event_8ready(struct __pyx_obj_6gevent_6_event_Event *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_6_event_5Event_10set(struct __pyx_obj_6gevent_6_event_Event *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_6_event_5Event_12clear(struct __pyx_obj_6gevent_6_event_Event *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_6_event_5Event_14wait(struct __pyx_obj_6gevent_6_event_Event *__pyx_v_self, PyObject *__pyx_v_timeout); /* proto */ +static PyObject *__pyx_pf_6gevent_6_event_5Event_16_reset_internal_locks(CYTHON_UNUSED struct __pyx_obj_6gevent_6_event_Event *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_6_event_11AsyncResult___init__(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_6_event_11AsyncResult_10_exception___get__(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_6_event_11AsyncResult_5value___get__(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_6_event_11AsyncResult_8exc_info___get__(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_6_event_11AsyncResult_2__str__(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_6_event_11AsyncResult_4ready(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_6_event_11AsyncResult_6successful(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_6_event_11AsyncResult_9exception___get__(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_6_event_11AsyncResult_8set(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_6gevent_6_event_11AsyncResult_10set_exception(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self, PyObject *__pyx_v_exception, PyObject *__pyx_v_exc_info); /* proto */ +static PyObject *__pyx_pf_6gevent_6_event_11AsyncResult_12_raise_exception(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_6_event_11AsyncResult_14get(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self, PyObject *__pyx_v_block, PyObject *__pyx_v_timeout); /* proto */ +static PyObject *__pyx_pf_6gevent_6_event_11AsyncResult_16get_nowait(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_6_event_11AsyncResult_18wait(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self, PyObject *__pyx_v_timeout); /* proto */ +static PyObject *__pyx_pf_6gevent_6_event_11AsyncResult_20__call__(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self, PyObject *__pyx_v_source); /* proto */ +static PyObject *__pyx_pf_6gevent_6_event_11AsyncResult_22result(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self, PyObject *__pyx_v_timeout); /* proto */ +static PyObject *__pyx_pf_6gevent_6_event_11AsyncResult_24done(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_6_event_11AsyncResult_26cancel(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_6_event_11AsyncResult_28cancelled(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_6_event_11AsyncResult_6_value___get__(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_6_event_11AsyncResult_9_exc_info___get__(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_6_event_11AsyncResult_16_imap_task_index___get__(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_6_event_11AsyncResult_16_imap_task_index_2__set__(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_tp_new_6gevent_6_event_Event(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6gevent_6_event_AsyncResult(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tuple_; +static PyObject *__pyx_tuple__2; +static PyObject *__pyx_tuple__4; +static PyObject *__pyx_tuple__5; +static PyObject *__pyx_tuple__7; +static PyObject *__pyx_tuple__9; +static PyObject *__pyx_tuple__11; +static PyObject *__pyx_tuple__13; +static PyObject *__pyx_tuple__15; +static PyObject *__pyx_tuple__17; +static PyObject *__pyx_tuple__19; +static PyObject *__pyx_tuple__20; +static PyObject *__pyx_tuple__22; +static PyObject *__pyx_tuple__24; +static PyObject *__pyx_tuple__26; +static PyObject *__pyx_tuple__28; +static PyObject *__pyx_tuple__30; +static PyObject *__pyx_tuple__32; +static PyObject *__pyx_tuple__34; +static PyObject *__pyx_tuple__36; +static PyObject *__pyx_tuple__38; +static PyObject *__pyx_tuple__40; +static PyObject *__pyx_tuple__42; +static PyObject *__pyx_codeobj__3; +static PyObject *__pyx_codeobj__6; +static PyObject *__pyx_codeobj__8; +static PyObject *__pyx_codeobj__10; +static PyObject *__pyx_codeobj__12; +static PyObject *__pyx_codeobj__14; +static PyObject *__pyx_codeobj__16; +static PyObject *__pyx_codeobj__18; +static PyObject *__pyx_codeobj__21; +static PyObject *__pyx_codeobj__23; +static PyObject *__pyx_codeobj__25; +static PyObject *__pyx_codeobj__27; +static PyObject *__pyx_codeobj__29; +static PyObject *__pyx_codeobj__31; +static PyObject *__pyx_codeobj__33; +static PyObject *__pyx_codeobj__35; +static PyObject *__pyx_codeobj__37; +static PyObject *__pyx_codeobj__39; +static PyObject *__pyx_codeobj__41; +static PyObject *__pyx_codeobj__43; +/* Late includes */ + +/* "src/gevent/event.py":19 + * ] + * + * def _get_linkable(): # <<<<<<<<<<<<<< + * x = __import__('gevent._abstract_linkable') + * return x._abstract_linkable.AbstractLinkable + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_event_1_get_linkable(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6gevent_6_event__get_linkable[] = "_get_linkable()"; +static PyMethodDef __pyx_mdef_6gevent_6_event_1_get_linkable = {"_get_linkable", (PyCFunction)__pyx_pw_6gevent_6_event_1_get_linkable, METH_NOARGS, __pyx_doc_6gevent_6_event__get_linkable}; +static PyObject *__pyx_pw_6gevent_6_event_1_get_linkable(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_get_linkable (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6_event__get_linkable(__pyx_self); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_event__get_linkable(CYTHON_UNUSED PyObject *__pyx_self) { + PyObject *__pyx_v_x = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("_get_linkable", 0); + + /* "src/gevent/event.py":20 + * + * def _get_linkable(): + * x = __import__('gevent._abstract_linkable') # <<<<<<<<<<<<<< + * return x._abstract_linkable.AbstractLinkable + * locals()['AbstractLinkable'] = _get_linkable() + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin___import__, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 20, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_x = __pyx_t_1; + __pyx_t_1 = 0; + + /* "src/gevent/event.py":21 + * def _get_linkable(): + * x = __import__('gevent._abstract_linkable') + * return x._abstract_linkable.AbstractLinkable # <<<<<<<<<<<<<< + * locals()['AbstractLinkable'] = _get_linkable() + * del _get_linkable + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_abstract_linkable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 21, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_AbstractLinkable); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 21, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "src/gevent/event.py":19 + * ] + * + * def _get_linkable(): # <<<<<<<<<<<<<< + * x = __import__('gevent._abstract_linkable') + * return x._abstract_linkable.AbstractLinkable + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent._event._get_linkable", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_x); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/event.py":48 + * __slots__ = ('_flag',) + * + * def __init__(self): # <<<<<<<<<<<<<< + * super(Event, self).__init__() + * self._flag = False + */ + +/* Python wrapper */ +static int __pyx_pw_6gevent_6_event_5Event_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6gevent_6_event_5Event_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { + __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;} + if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1; + __pyx_r = __pyx_pf_6gevent_6_event_5Event___init__(((struct __pyx_obj_6gevent_6_event_Event *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_6_event_5Event___init__(struct __pyx_obj_6gevent_6_event_Event *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "src/gevent/event.py":49 + * + * def __init__(self): + * super(Event, self).__init__() # <<<<<<<<<<<<<< + * self._flag = False + * + */ + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 49, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_ptype_6gevent_6_event_Event)); + __Pyx_GIVEREF(((PyObject *)__pyx_ptype_6gevent_6_event_Event)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_ptype_6gevent_6_event_Event)); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_self)); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 49, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 49, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 49, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/event.py":50 + * def __init__(self): + * super(Event, self).__init__() + * self._flag = False # <<<<<<<<<<<<<< + * + * def __str__(self): + */ + __pyx_v_self->_flag = 0; + + /* "src/gevent/event.py":48 + * __slots__ = ('_flag',) + * + * def __init__(self): # <<<<<<<<<<<<<< + * super(Event, self).__init__() + * self._flag = False + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("gevent._event.Event.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/event.py":52 + * self._flag = False + * + * def __str__(self): # <<<<<<<<<<<<<< + * return '<%s %s _links[%s]>' % (self.__class__.__name__, (self._flag and 'set') or 'clear', + * self.linkcount()) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_event_5Event_3__str__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_6_event_5Event_3__str__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__str__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6_event_5Event_2__str__(((struct __pyx_obj_6gevent_6_event_Event *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_event_5Event_2__str__(struct __pyx_obj_6gevent_6_event_Event *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + __Pyx_RefNannySetupContext("__str__", 0); + + /* "src/gevent/event.py":53 + * + * def __str__(self): + * return '<%s %s _links[%s]>' % (self.__class__.__name__, (self._flag and 'set') or 'clear', # <<<<<<<<<<<<<< + * self.linkcount()) + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 53, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 53, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!__pyx_v_self->_flag) { + goto __pyx_L4_next_or; + } else { + } + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_n_s_set); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 53, __pyx_L1_error) + if (!__pyx_t_3) { + } else { + __Pyx_INCREF(__pyx_n_s_set); + __pyx_t_1 = __pyx_n_s_set; + goto __pyx_L3_bool_binop_done; + } + __pyx_L4_next_or:; + __Pyx_INCREF(__pyx_n_s_clear); + __pyx_t_1 = __pyx_n_s_clear; + __pyx_L3_bool_binop_done:; + + /* "src/gevent/event.py":54 + * def __str__(self): + * return '<%s %s _links[%s]>' % (self.__class__.__name__, (self._flag and 'set') or 'clear', + * self.linkcount()) # <<<<<<<<<<<<<< + * + * def is_set(self): + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_linkcount); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 54, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); + if (likely(__pyx_t_6)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_5, function); + } + } + __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 54, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "src/gevent/event.py":53 + * + * def __str__(self): + * return '<%s %s _links[%s]>' % (self.__class__.__name__, (self._flag and 'set') or 'clear', # <<<<<<<<<<<<<< + * self.linkcount()) + * + */ + __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 53, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_4); + __pyx_t_2 = 0; + __pyx_t_1 = 0; + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_s_s__links_s, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 53, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + + /* "src/gevent/event.py":52 + * self._flag = False + * + * def __str__(self): # <<<<<<<<<<<<<< + * return '<%s %s _links[%s]>' % (self.__class__.__name__, (self._flag and 'set') or 'clear', + * self.linkcount()) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("gevent._event.Event.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/event.py":56 + * self.linkcount()) + * + * def is_set(self): # <<<<<<<<<<<<<< + * """Return true if and only if the internal flag is true.""" + * return self._flag + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_event_5Event_5is_set(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6gevent_6_event_5Event_4is_set[] = "Event.is_set(self)\nReturn true if and only if the internal flag is true."; +static PyMethodDef __pyx_mdef_6gevent_6_event_5Event_5is_set = {"is_set", (PyCFunction)__pyx_pw_6gevent_6_event_5Event_5is_set, METH_NOARGS, __pyx_doc_6gevent_6_event_5Event_4is_set}; +static PyObject *__pyx_pw_6gevent_6_event_5Event_5is_set(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("is_set (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6_event_5Event_4is_set(((struct __pyx_obj_6gevent_6_event_Event *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_event_5Event_4is_set(struct __pyx_obj_6gevent_6_event_Event *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("is_set", 0); + + /* "src/gevent/event.py":58 + * def is_set(self): + * """Return true if and only if the internal flag is true.""" + * return self._flag # <<<<<<<<<<<<<< + * + * def isSet(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->_flag); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 58, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "src/gevent/event.py":56 + * self.linkcount()) + * + * def is_set(self): # <<<<<<<<<<<<<< + * """Return true if and only if the internal flag is true.""" + * return self._flag + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent._event.Event.is_set", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/event.py":60 + * return self._flag + * + * def isSet(self): # <<<<<<<<<<<<<< + * # makes it a better drop-in replacement for threading.Event + * return self._flag + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_event_5Event_7isSet(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6gevent_6_event_5Event_6isSet[] = "Event.isSet(self)"; +static PyMethodDef __pyx_mdef_6gevent_6_event_5Event_7isSet = {"isSet", (PyCFunction)__pyx_pw_6gevent_6_event_5Event_7isSet, METH_NOARGS, __pyx_doc_6gevent_6_event_5Event_6isSet}; +static PyObject *__pyx_pw_6gevent_6_event_5Event_7isSet(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("isSet (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6_event_5Event_6isSet(((struct __pyx_obj_6gevent_6_event_Event *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_event_5Event_6isSet(struct __pyx_obj_6gevent_6_event_Event *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("isSet", 0); + + /* "src/gevent/event.py":62 + * def isSet(self): + * # makes it a better drop-in replacement for threading.Event + * return self._flag # <<<<<<<<<<<<<< + * + * def ready(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->_flag); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 62, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "src/gevent/event.py":60 + * return self._flag + * + * def isSet(self): # <<<<<<<<<<<<<< + * # makes it a better drop-in replacement for threading.Event + * return self._flag + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent._event.Event.isSet", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/event.py":64 + * return self._flag + * + * def ready(self): # <<<<<<<<<<<<<< + * # makes it compatible with AsyncResult and Greenlet (for + * # example in wait()) + */ + +static PyObject *__pyx_pw_6gevent_6_event_5Event_9ready(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static int __pyx_f_6gevent_6_event_5Event_ready(struct __pyx_obj_6gevent_6_event_Event *__pyx_v_self, int __pyx_skip_dispatch) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + __Pyx_RefNannySetupContext("ready", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0; + if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self)))))); + else { + PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + #endif + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_ready); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 64, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_6_event_5Event_9ready)) { + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 64, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 64, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_5; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0; + if (unlikely(type_dict_guard != tp_dict_version)) { + tp_dict_version = obj_dict_version = 0; + } + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + } + #endif + } + + /* "src/gevent/event.py":67 + * # makes it compatible with AsyncResult and Greenlet (for + * # example in wait()) + * return self._flag # <<<<<<<<<<<<<< + * + * def set(self): + */ + __pyx_r = __pyx_v_self->_flag; + goto __pyx_L0; + + /* "src/gevent/event.py":64 + * return self._flag + * + * def ready(self): # <<<<<<<<<<<<<< + * # makes it compatible with AsyncResult and Greenlet (for + * # example in wait()) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_WriteUnraisable("gevent._event.Event.ready", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_event_5Event_9ready(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6gevent_6_event_5Event_8ready[] = "Event.ready(self) -> bool"; +static PyMethodDef __pyx_mdef_6gevent_6_event_5Event_9ready = {"ready", (PyCFunction)__pyx_pw_6gevent_6_event_5Event_9ready, METH_NOARGS, __pyx_doc_6gevent_6_event_5Event_8ready}; +static PyObject *__pyx_pw_6gevent_6_event_5Event_9ready(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("ready (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6_event_5Event_8ready(((struct __pyx_obj_6gevent_6_event_Event *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_event_5Event_8ready(struct __pyx_obj_6gevent_6_event_Event *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("ready", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_f_6gevent_6_event_5Event_ready(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 64, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent._event.Event.ready", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/event.py":69 + * return self._flag + * + * def set(self): # <<<<<<<<<<<<<< + * """ + * Set the internal flag to true. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_event_5Event_11set(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6gevent_6_event_5Event_10set[] = "Event.set(self)\n\n Set the internal flag to true.\n\n All greenlets waiting for it to become true are awakened in\n some order at some time in the future. Greenlets that call\n :meth:`wait` once the flag is true will not block at all\n (until :meth:`clear` is called).\n "; +static PyMethodDef __pyx_mdef_6gevent_6_event_5Event_11set = {"set", (PyCFunction)__pyx_pw_6gevent_6_event_5Event_11set, METH_NOARGS, __pyx_doc_6gevent_6_event_5Event_10set}; +static PyObject *__pyx_pw_6gevent_6_event_5Event_11set(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("set (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6_event_5Event_10set(((struct __pyx_obj_6gevent_6_event_Event *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_event_5Event_10set(struct __pyx_obj_6gevent_6_event_Event *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("set", 0); + + /* "src/gevent/event.py":78 + * (until :meth:`clear` is called). + * """ + * self._flag = True # <<<<<<<<<<<<<< + * self._check_and_notify() + * + */ + __pyx_v_self->_flag = 1; + + /* "src/gevent/event.py":79 + * """ + * self._flag = True + * self._check_and_notify() # <<<<<<<<<<<<<< + * + * def clear(self): + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_6_event_Event *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._check_and_notify(((struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 79, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/event.py":69 + * return self._flag + * + * def set(self): # <<<<<<<<<<<<<< + * """ + * Set the internal flag to true. + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent._event.Event.set", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/event.py":81 + * self._check_and_notify() + * + * def clear(self): # <<<<<<<<<<<<<< + * """ + * Reset the internal flag to false. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_event_5Event_13clear(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6gevent_6_event_5Event_12clear[] = "Event.clear(self)\n\n Reset the internal flag to false.\n\n Subsequently, threads calling :meth:`wait` will block until\n :meth:`set` is called to set the internal flag to true again.\n "; +static PyMethodDef __pyx_mdef_6gevent_6_event_5Event_13clear = {"clear", (PyCFunction)__pyx_pw_6gevent_6_event_5Event_13clear, METH_NOARGS, __pyx_doc_6gevent_6_event_5Event_12clear}; +static PyObject *__pyx_pw_6gevent_6_event_5Event_13clear(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("clear (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6_event_5Event_12clear(((struct __pyx_obj_6gevent_6_event_Event *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_event_5Event_12clear(struct __pyx_obj_6gevent_6_event_Event *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("clear", 0); + + /* "src/gevent/event.py":88 + * :meth:`set` is called to set the internal flag to true again. + * """ + * self._flag = False # <<<<<<<<<<<<<< + * + * def _wait_return_value(self, waited, wait_success): + */ + __pyx_v_self->_flag = 0; + + /* "src/gevent/event.py":81 + * self._check_and_notify() + * + * def clear(self): # <<<<<<<<<<<<<< + * """ + * Reset the internal flag to false. + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/event.py":90 + * self._flag = False + * + * def _wait_return_value(self, waited, wait_success): # <<<<<<<<<<<<<< + * # To avoid the race condition outlined in http://bugs.python.org/issue13502, + * # if we had to wait, then we need to return whether or not + */ + +static PyObject *__pyx_f_6gevent_6_event_5Event__wait_return_value(struct __pyx_obj_6gevent_6_event_Event *__pyx_v_self, PyObject *__pyx_v_waited, PyObject *__pyx_v_wait_success) { + int __pyx_v_flag; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("_wait_return_value", 0); + + /* "src/gevent/event.py":95 + * # the condition got changed. Otherwise we simply echo + * # the current state of the flag (which should be true) + * if not waited: # <<<<<<<<<<<<<< + * flag = self._flag + * assert flag, "if we didn't wait we should already be set" + */ + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_waited); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 95, __pyx_L1_error) + __pyx_t_2 = ((!__pyx_t_1) != 0); + if (__pyx_t_2) { + + /* "src/gevent/event.py":96 + * # the current state of the flag (which should be true) + * if not waited: + * flag = self._flag # <<<<<<<<<<<<<< + * assert flag, "if we didn't wait we should already be set" + * return flag + */ + __pyx_t_2 = __pyx_v_self->_flag; + __pyx_v_flag = __pyx_t_2; + + /* "src/gevent/event.py":97 + * if not waited: + * flag = self._flag + * assert flag, "if we didn't wait we should already be set" # <<<<<<<<<<<<<< + * return flag + * + */ + #ifndef CYTHON_WITHOUT_ASSERTIONS + if (unlikely(!Py_OptimizeFlag)) { + if (unlikely(!(__pyx_v_flag != 0))) { + PyErr_SetObject(PyExc_AssertionError, __pyx_kp_s_if_we_didn_t_wait_we_should_alre); + __PYX_ERR(0, 97, __pyx_L1_error) + } + } + #endif + + /* "src/gevent/event.py":98 + * flag = self._flag + * assert flag, "if we didn't wait we should already be set" + * return flag # <<<<<<<<<<<<<< + * + * return wait_success + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_v_flag); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 98, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "src/gevent/event.py":95 + * # the condition got changed. Otherwise we simply echo + * # the current state of the flag (which should be true) + * if not waited: # <<<<<<<<<<<<<< + * flag = self._flag + * assert flag, "if we didn't wait we should already be set" + */ + } + + /* "src/gevent/event.py":100 + * return flag + * + * return wait_success # <<<<<<<<<<<<<< + * + * def wait(self, timeout=None): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_wait_success); + __pyx_r = __pyx_v_wait_success; + goto __pyx_L0; + + /* "src/gevent/event.py":90 + * self._flag = False + * + * def _wait_return_value(self, waited, wait_success): # <<<<<<<<<<<<<< + * # To avoid the race condition outlined in http://bugs.python.org/issue13502, + * # if we had to wait, then we need to return whether or not + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("gevent._event.Event._wait_return_value", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/event.py":102 + * return wait_success + * + * def wait(self, timeout=None): # <<<<<<<<<<<<<< + * """ + * Block until the internal flag is true. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_event_5Event_15wait(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6gevent_6_event_5Event_14wait[] = "Event.wait(self, timeout=None)\n\n Block until the internal flag is true.\n\n If the internal flag is true on entry, return immediately. Otherwise,\n block until another thread (greenlet) calls :meth:`set` to set the flag to true,\n or until the optional timeout occurs.\n\n When the *timeout* argument is present and not ``None``, it should be a\n floating point number specifying a timeout for the operation in seconds\n (or fractions thereof).\n\n :return: This method returns true if and only if the internal flag has been set to\n true, either before the wait call or after the wait starts, so it will\n always return ``True`` except if a timeout is given and the operation\n times out.\n\n .. versionchanged:: 1.1\n The return value represents the flag during the elapsed wait, not\n just after it elapses. This solves a race condition if one greenlet\n sets and then clears the flag without switching, while other greenlets\n are waiting. When the waiters wake up, this will return True; previously,\n they would still wake up, but the return value would be False. This is most\n noticeable when the *timeout* is present.\n "; +static PyMethodDef __pyx_mdef_6gevent_6_event_5Event_15wait = {"wait", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_6_event_5Event_15wait, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_6_event_5Event_14wait}; +static PyObject *__pyx_pw_6gevent_6_event_5Event_15wait(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_timeout = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("wait (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_timeout,0}; + PyObject* values[1] = {0}; + values[0] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_timeout); + if (value) { values[0] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "wait") < 0)) __PYX_ERR(0, 102, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_timeout = values[0]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("wait", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 102, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent._event.Event.wait", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_6_event_5Event_14wait(((struct __pyx_obj_6gevent_6_event_Event *)__pyx_v_self), __pyx_v_timeout); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_event_5Event_14wait(struct __pyx_obj_6gevent_6_event_Event *__pyx_v_self, PyObject *__pyx_v_timeout) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + struct __pyx_opt_args_6gevent_19__abstract_linkable_16AbstractLinkable__wait __pyx_t_2; + __Pyx_RefNannySetupContext("wait", 0); + + /* "src/gevent/event.py":127 + * noticeable when the *timeout* is present. + * """ + * return self._wait(timeout) # <<<<<<<<<<<<<< + * + * def _reset_internal_locks(self): # pragma: no cover + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2.__pyx_n = 1; + __pyx_t_2.timeout = __pyx_v_timeout; + __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_6_event_Event *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._wait(((struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *)__pyx_v_self), &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 127, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "src/gevent/event.py":102 + * return wait_success + * + * def wait(self, timeout=None): # <<<<<<<<<<<<<< + * """ + * Block until the internal flag is true. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent._event.Event.wait", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/event.py":129 + * return self._wait(timeout) + * + * def _reset_internal_locks(self): # pragma: no cover # <<<<<<<<<<<<<< + * # for compatibility with threading.Event + * # Exception AttributeError: AttributeError("'Event' object has no attribute '_reset_internal_locks'",) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_event_5Event_17_reset_internal_locks(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6gevent_6_event_5Event_16_reset_internal_locks[] = "Event._reset_internal_locks(self)"; +static PyMethodDef __pyx_mdef_6gevent_6_event_5Event_17_reset_internal_locks = {"_reset_internal_locks", (PyCFunction)__pyx_pw_6gevent_6_event_5Event_17_reset_internal_locks, METH_NOARGS, __pyx_doc_6gevent_6_event_5Event_16_reset_internal_locks}; +static PyObject *__pyx_pw_6gevent_6_event_5Event_17_reset_internal_locks(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_reset_internal_locks (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6_event_5Event_16_reset_internal_locks(((struct __pyx_obj_6gevent_6_event_Event *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_event_5Event_16_reset_internal_locks(CYTHON_UNUSED struct __pyx_obj_6gevent_6_event_Event *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_reset_internal_locks", 0); + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/event.py":188 + * __slots__ = ('_value', '_exc_info', '_imap_task_index') + * + * def __init__(self): # <<<<<<<<<<<<<< + * super(AsyncResult, self).__init__() + * self._value = _NONE + */ + +/* Python wrapper */ +static int __pyx_pw_6gevent_6_event_11AsyncResult_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6gevent_6_event_11AsyncResult_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { + __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;} + if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1; + __pyx_r = __pyx_pf_6gevent_6_event_11AsyncResult___init__(((struct __pyx_obj_6gevent_6_event_AsyncResult *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_6_event_11AsyncResult___init__(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "src/gevent/event.py":189 + * + * def __init__(self): + * super(AsyncResult, self).__init__() # <<<<<<<<<<<<<< + * self._value = _NONE + * self._exc_info = () + */ + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 189, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_ptype_6gevent_6_event_AsyncResult)); + __Pyx_GIVEREF(((PyObject *)__pyx_ptype_6gevent_6_event_AsyncResult)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_ptype_6gevent_6_event_AsyncResult)); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_self)); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 189, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 189, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 189, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/event.py":190 + * def __init__(self): + * super(AsyncResult, self).__init__() + * self._value = _NONE # <<<<<<<<<<<<<< + * self._exc_info = () + * + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_NONE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 190, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_self->_value); + __Pyx_DECREF(__pyx_v_self->_value); + __pyx_v_self->_value = __pyx_t_1; + __pyx_t_1 = 0; + + /* "src/gevent/event.py":191 + * super(AsyncResult, self).__init__() + * self._value = _NONE + * self._exc_info = () # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_INCREF(__pyx_empty_tuple); + __Pyx_GIVEREF(__pyx_empty_tuple); + __Pyx_GOTREF(__pyx_v_self->_exc_info); + __Pyx_DECREF(__pyx_v_self->_exc_info); + __pyx_v_self->_exc_info = __pyx_empty_tuple; + + /* "src/gevent/event.py":188 + * __slots__ = ('_value', '_exc_info', '_imap_task_index') + * + * def __init__(self): # <<<<<<<<<<<<<< + * super(AsyncResult, self).__init__() + * self._value = _NONE + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("gevent._event.AsyncResult.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/event.py":194 + * + * @property + * def _exception(self): # <<<<<<<<<<<<<< + * return self._exc_info[1] if self._exc_info else _NONE + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_10_exception_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_10_exception_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6_event_11AsyncResult_10_exception___get__(((struct __pyx_obj_6gevent_6_event_AsyncResult *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_event_11AsyncResult_10_exception___get__(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "src/gevent/event.py":195 + * @property + * def _exception(self): + * return self._exc_info[1] if self._exc_info else _NONE # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = (__pyx_v_self->_exc_info != Py_None)&&(PyTuple_GET_SIZE(__pyx_v_self->_exc_info) != 0); + if (__pyx_t_2) { + if (unlikely(__pyx_v_self->_exc_info == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 195, __pyx_L1_error) + } + __pyx_t_3 = __Pyx_GetItemInt_Tuple(__pyx_v_self->_exc_info, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 195, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __pyx_t_3; + __pyx_t_3 = 0; + } else { + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_NONE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 195, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __pyx_t_3; + __pyx_t_3 = 0; + } + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "src/gevent/event.py":194 + * + * @property + * def _exception(self): # <<<<<<<<<<<<<< + * return self._exc_info[1] if self._exc_info else _NONE + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("gevent._event.AsyncResult._exception.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/event.py":198 + * + * @property + * def value(self): # <<<<<<<<<<<<<< + * """ + * Holds the value passed to :meth:`set` if :meth:`set` was called. Otherwise, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_5value_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_5value_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6_event_11AsyncResult_5value___get__(((struct __pyx_obj_6gevent_6_event_AsyncResult *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_event_11AsyncResult_5value___get__(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "src/gevent/event.py":203 + * ``None`` + * """ + * return self._value if self._value is not _NONE else None # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_NONE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 203, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = (__pyx_v_self->_value != __pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if ((__pyx_t_3 != 0)) { + __Pyx_INCREF(__pyx_v_self->_value); + __pyx_t_1 = __pyx_v_self->_value; + } else { + __Pyx_INCREF(Py_None); + __pyx_t_1 = Py_None; + } + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "src/gevent/event.py":198 + * + * @property + * def value(self): # <<<<<<<<<<<<<< + * """ + * Holds the value passed to :meth:`set` if :meth:`set` was called. Otherwise, + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent._event.AsyncResult.value.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/event.py":206 + * + * @property + * def exc_info(self): # <<<<<<<<<<<<<< + * """ + * The three-tuple of exception information if :meth:`set_exception` was called. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_8exc_info_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_8exc_info_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6_event_11AsyncResult_8exc_info___get__(((struct __pyx_obj_6gevent_6_event_AsyncResult *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_event_11AsyncResult_8exc_info___get__(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "src/gevent/event.py":210 + * The three-tuple of exception information if :meth:`set_exception` was called. + * """ + * if self._exc_info: # <<<<<<<<<<<<<< + * return (self._exc_info[0], self._exc_info[1], load_traceback(self._exc_info[2])) + * return () + */ + __pyx_t_1 = (__pyx_v_self->_exc_info != Py_None)&&(PyTuple_GET_SIZE(__pyx_v_self->_exc_info) != 0); + if (__pyx_t_1) { + + /* "src/gevent/event.py":211 + * """ + * if self._exc_info: + * return (self._exc_info[0], self._exc_info[1], load_traceback(self._exc_info[2])) # <<<<<<<<<<<<<< + * return () + * + */ + __Pyx_XDECREF(__pyx_r); + if (unlikely(__pyx_v_self->_exc_info == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 211, __pyx_L1_error) + } + __pyx_t_2 = __Pyx_GetItemInt_Tuple(__pyx_v_self->_exc_info, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 211, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (unlikely(__pyx_v_self->_exc_info == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 211, __pyx_L1_error) + } + __pyx_t_3 = __Pyx_GetItemInt_Tuple(__pyx_v_self->_exc_info, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 211, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (unlikely(__pyx_v_self->_exc_info == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 211, __pyx_L1_error) + } + __pyx_t_5 = __Pyx_GetItemInt_Tuple(__pyx_v_self->_exc_info, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 211, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_6gevent_6_event_load_traceback); + __pyx_t_6 = __pyx_v_6gevent_6_event_load_traceback; __pyx_t_7 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) { + __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); + if (likely(__pyx_t_7)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); + __Pyx_INCREF(__pyx_t_7); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_6, function); + } + } + __pyx_t_4 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_5); + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 211, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 211, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_4); + __pyx_t_2 = 0; + __pyx_t_3 = 0; + __pyx_t_4 = 0; + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L0; + + /* "src/gevent/event.py":210 + * The three-tuple of exception information if :meth:`set_exception` was called. + * """ + * if self._exc_info: # <<<<<<<<<<<<<< + * return (self._exc_info[0], self._exc_info[1], load_traceback(self._exc_info[2])) + * return () + */ + } + + /* "src/gevent/event.py":212 + * if self._exc_info: + * return (self._exc_info[0], self._exc_info[1], load_traceback(self._exc_info[2])) + * return () # <<<<<<<<<<<<<< + * + * def __str__(self): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_empty_tuple); + __pyx_r = __pyx_empty_tuple; + goto __pyx_L0; + + /* "src/gevent/event.py":206 + * + * @property + * def exc_info(self): # <<<<<<<<<<<<<< + * """ + * The three-tuple of exception information if :meth:`set_exception` was called. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("gevent._event.AsyncResult.exc_info.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/event.py":214 + * return () + * + * def __str__(self): # <<<<<<<<<<<<<< + * result = '<%s ' % (self.__class__.__name__, ) + * if self.value is not None or self._exception is not _NONE: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_3__str__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_3__str__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__str__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6_event_11AsyncResult_2__str__(((struct __pyx_obj_6gevent_6_event_AsyncResult *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_event_11AsyncResult_2__str__(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self) { + PyObject *__pyx_v_result = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + __Pyx_RefNannySetupContext("__str__", 0); + + /* "src/gevent/event.py":215 + * + * def __str__(self): + * result = '<%s ' % (self.__class__.__name__, ) # <<<<<<<<<<<<<< + * if self.value is not None or self._exception is not _NONE: + * result += 'value=%r ' % self.value + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 215, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 215, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 215, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_s, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 215, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result = ((PyObject*)__pyx_t_2); + __pyx_t_2 = 0; + + /* "src/gevent/event.py":216 + * def __str__(self): + * result = '<%s ' % (self.__class__.__name__, ) + * if self.value is not None or self._exception is not _NONE: # <<<<<<<<<<<<<< + * result += 'value=%r ' % self.value + * if self._exception is not None and self._exception is not _NONE: + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 216, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = (__pyx_t_2 != Py_None); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_5 = (__pyx_t_4 != 0); + if (!__pyx_t_5) { + } else { + __pyx_t_3 = __pyx_t_5; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_exception); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 216, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_NONE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 216, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = (__pyx_t_2 != __pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_4 = (__pyx_t_5 != 0); + __pyx_t_3 = __pyx_t_4; + __pyx_L4_bool_binop_done:; + if (__pyx_t_3) { + + /* "src/gevent/event.py":217 + * result = '<%s ' % (self.__class__.__name__, ) + * if self.value is not None or self._exception is not _NONE: + * result += 'value=%r ' % self.value # <<<<<<<<<<<<<< + * if self._exception is not None and self._exception is not _NONE: + * result += 'exception=%r ' % self._exception + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 217, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyString_FormatSafe(__pyx_kp_s_value_r, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 217, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 217, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_1)); + __pyx_t_1 = 0; + + /* "src/gevent/event.py":216 + * def __str__(self): + * result = '<%s ' % (self.__class__.__name__, ) + * if self.value is not None or self._exception is not _NONE: # <<<<<<<<<<<<<< + * result += 'value=%r ' % self.value + * if self._exception is not None and self._exception is not _NONE: + */ + } + + /* "src/gevent/event.py":218 + * if self.value is not None or self._exception is not _NONE: + * result += 'value=%r ' % self.value + * if self._exception is not None and self._exception is not _NONE: # <<<<<<<<<<<<<< + * result += 'exception=%r ' % self._exception + * if self._exception is _NONE: + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_exception); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 218, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = (__pyx_t_1 != Py_None); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_5 = (__pyx_t_4 != 0); + if (__pyx_t_5) { + } else { + __pyx_t_3 = __pyx_t_5; + goto __pyx_L7_bool_binop_done; + } + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_exception); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 218, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_NONE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 218, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = (__pyx_t_1 != __pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_4 = (__pyx_t_5 != 0); + __pyx_t_3 = __pyx_t_4; + __pyx_L7_bool_binop_done:; + if (__pyx_t_3) { + + /* "src/gevent/event.py":219 + * result += 'value=%r ' % self.value + * if self._exception is not None and self._exception is not _NONE: + * result += 'exception=%r ' % self._exception # <<<<<<<<<<<<<< + * if self._exception is _NONE: + * result += 'unset ' + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_exception); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 219, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyString_FormatSafe(__pyx_kp_s_exception_r, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 219, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 219, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "src/gevent/event.py":218 + * if self.value is not None or self._exception is not _NONE: + * result += 'value=%r ' % self.value + * if self._exception is not None and self._exception is not _NONE: # <<<<<<<<<<<<<< + * result += 'exception=%r ' % self._exception + * if self._exception is _NONE: + */ + } + + /* "src/gevent/event.py":220 + * if self._exception is not None and self._exception is not _NONE: + * result += 'exception=%r ' % self._exception + * if self._exception is _NONE: # <<<<<<<<<<<<<< + * result += 'unset ' + * return result + ' _links[%s]>' % self.linkcount() + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_exception); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 220, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_NONE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 220, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = (__pyx_t_2 == __pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_4 = (__pyx_t_3 != 0); + if (__pyx_t_4) { + + /* "src/gevent/event.py":221 + * result += 'exception=%r ' % self._exception + * if self._exception is _NONE: + * result += 'unset ' # <<<<<<<<<<<<<< + * return result + ' _links[%s]>' % self.linkcount() + * + */ + __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_kp_s_unset); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 221, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_1)); + __pyx_t_1 = 0; + + /* "src/gevent/event.py":220 + * if self._exception is not None and self._exception is not _NONE: + * result += 'exception=%r ' % self._exception + * if self._exception is _NONE: # <<<<<<<<<<<<<< + * result += 'unset ' + * return result + ' _links[%s]>' % self.linkcount() + */ + } + + /* "src/gevent/event.py":222 + * if self._exception is _NONE: + * result += 'unset ' + * return result + ' _links[%s]>' % self.linkcount() # <<<<<<<<<<<<<< + * + * def ready(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_linkcount); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 222, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_6)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 222, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyString_FormatSafe(__pyx_kp_s_links_s, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 222, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyNumber_Add(__pyx_v_result, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 222, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "src/gevent/event.py":214 + * return () + * + * def __str__(self): # <<<<<<<<<<<<<< + * result = '<%s ' % (self.__class__.__name__, ) + * if self.value is not None or self._exception is not _NONE: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("gevent._event.AsyncResult.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/event.py":224 + * return result + ' _links[%s]>' % self.linkcount() + * + * def ready(self): # <<<<<<<<<<<<<< + * """Return true if and only if it holds a value or an exception""" + * return self._exc_info or self._value is not _NONE + */ + +static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_5ready(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static int __pyx_f_6gevent_6_event_11AsyncResult_ready(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self, int __pyx_skip_dispatch) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + int __pyx_t_6; + int __pyx_t_7; + __Pyx_RefNannySetupContext("ready", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0; + if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self)))))); + else { + PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + #endif + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_ready); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 224, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_6_event_11AsyncResult_5ready)) { + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 224, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 224, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_5; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0; + if (unlikely(type_dict_guard != tp_dict_version)) { + tp_dict_version = obj_dict_version = 0; + } + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + } + #endif + } + + /* "src/gevent/event.py":226 + * def ready(self): + * """Return true if and only if it holds a value or an exception""" + * return self._exc_info or self._value is not _NONE # <<<<<<<<<<<<<< + * + * def successful(self): + */ + __pyx_t_6 = (__pyx_v_self->_exc_info != Py_None)&&(PyTuple_GET_SIZE(__pyx_v_self->_exc_info) != 0); + if (!__pyx_t_6) { + } else { + __pyx_t_5 = __pyx_t_6; + goto __pyx_L3_bool_binop_done; + } + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_NONE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 226, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = (__pyx_v_self->_value != __pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_7 = (__pyx_t_6 != 0); + __pyx_t_5 = __pyx_t_7; + __pyx_L3_bool_binop_done:; + __pyx_r = __pyx_t_5; + goto __pyx_L0; + + /* "src/gevent/event.py":224 + * return result + ' _links[%s]>' % self.linkcount() + * + * def ready(self): # <<<<<<<<<<<<<< + * """Return true if and only if it holds a value or an exception""" + * return self._exc_info or self._value is not _NONE + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_WriteUnraisable("gevent._event.AsyncResult.ready", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_5ready(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6gevent_6_event_11AsyncResult_4ready[] = "AsyncResult.ready(self) -> bool\nReturn true if and only if it holds a value or an exception"; +static PyMethodDef __pyx_mdef_6gevent_6_event_11AsyncResult_5ready = {"ready", (PyCFunction)__pyx_pw_6gevent_6_event_11AsyncResult_5ready, METH_NOARGS, __pyx_doc_6gevent_6_event_11AsyncResult_4ready}; +static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_5ready(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("ready (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6_event_11AsyncResult_4ready(((struct __pyx_obj_6gevent_6_event_AsyncResult *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_event_11AsyncResult_4ready(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("ready", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_f_6gevent_6_event_11AsyncResult_ready(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 224, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent._event.AsyncResult.ready", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/event.py":228 + * return self._exc_info or self._value is not _NONE + * + * def successful(self): # <<<<<<<<<<<<<< + * """Return true if and only if it is ready and holds a value""" + * return self._value is not _NONE + */ + +static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_7successful(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static int __pyx_f_6gevent_6_event_11AsyncResult_successful(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self, int __pyx_skip_dispatch) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + __Pyx_RefNannySetupContext("successful", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0; + if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self)))))); + else { + PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + #endif + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_successful); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 228, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_6_event_11AsyncResult_7successful)) { + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 228, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 228, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_5; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0; + if (unlikely(type_dict_guard != tp_dict_version)) { + tp_dict_version = obj_dict_version = 0; + } + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + } + #endif + } + + /* "src/gevent/event.py":230 + * def successful(self): + * """Return true if and only if it is ready and holds a value""" + * return self._value is not _NONE # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_NONE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 230, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = (__pyx_v_self->_value != __pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_5; + goto __pyx_L0; + + /* "src/gevent/event.py":228 + * return self._exc_info or self._value is not _NONE + * + * def successful(self): # <<<<<<<<<<<<<< + * """Return true if and only if it is ready and holds a value""" + * return self._value is not _NONE + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_WriteUnraisable("gevent._event.AsyncResult.successful", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_7successful(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6gevent_6_event_11AsyncResult_6successful[] = "AsyncResult.successful(self) -> bool\nReturn true if and only if it is ready and holds a value"; +static PyMethodDef __pyx_mdef_6gevent_6_event_11AsyncResult_7successful = {"successful", (PyCFunction)__pyx_pw_6gevent_6_event_11AsyncResult_7successful, METH_NOARGS, __pyx_doc_6gevent_6_event_11AsyncResult_6successful}; +static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_7successful(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("successful (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6_event_11AsyncResult_6successful(((struct __pyx_obj_6gevent_6_event_AsyncResult *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_event_11AsyncResult_6successful(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("successful", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_f_6gevent_6_event_11AsyncResult_successful(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 228, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent._event.AsyncResult.successful", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/event.py":233 + * + * @property + * def exception(self): # <<<<<<<<<<<<<< + * """Holds the exception instance passed to :meth:`set_exception` if :meth:`set_exception` was called. + * Otherwise ``None``.""" + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_9exception_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_9exception_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6_event_11AsyncResult_9exception___get__(((struct __pyx_obj_6gevent_6_event_AsyncResult *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_event_11AsyncResult_9exception___get__(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "src/gevent/event.py":236 + * """Holds the exception instance passed to :meth:`set_exception` if :meth:`set_exception` was called. + * Otherwise ``None``.""" + * if self._exc_info: # <<<<<<<<<<<<<< + * return self._exc_info[1] + * + */ + __pyx_t_1 = (__pyx_v_self->_exc_info != Py_None)&&(PyTuple_GET_SIZE(__pyx_v_self->_exc_info) != 0); + if (__pyx_t_1) { + + /* "src/gevent/event.py":237 + * Otherwise ``None``.""" + * if self._exc_info: + * return self._exc_info[1] # <<<<<<<<<<<<<< + * + * def set(self, value=None): + */ + __Pyx_XDECREF(__pyx_r); + if (unlikely(__pyx_v_self->_exc_info == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 237, __pyx_L1_error) + } + __pyx_t_2 = __Pyx_GetItemInt_Tuple(__pyx_v_self->_exc_info, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 237, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "src/gevent/event.py":236 + * """Holds the exception instance passed to :meth:`set_exception` if :meth:`set_exception` was called. + * Otherwise ``None``.""" + * if self._exc_info: # <<<<<<<<<<<<<< + * return self._exc_info[1] + * + */ + } + + /* "src/gevent/event.py":233 + * + * @property + * def exception(self): # <<<<<<<<<<<<<< + * """Holds the exception instance passed to :meth:`set_exception` if :meth:`set_exception` was called. + * Otherwise ``None``.""" + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent._event.AsyncResult.exception.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/event.py":239 + * return self._exc_info[1] + * + * def set(self, value=None): # <<<<<<<<<<<<<< + * """Store the value and wake up any waiters. + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_9set(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6gevent_6_event_11AsyncResult_8set[] = "AsyncResult.set(self, value=None)\nStore the value and wake up any waiters.\n\n All greenlets blocking on :meth:`get` or :meth:`wait` are awakened.\n Subsequent calls to :meth:`wait` and :meth:`get` will not block at all.\n "; +static PyMethodDef __pyx_mdef_6gevent_6_event_11AsyncResult_9set = {"set", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_6_event_11AsyncResult_9set, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_6_event_11AsyncResult_8set}; +static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_9set(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_value = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("set (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_value,0}; + PyObject* values[1] = {0}; + values[0] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value); + if (value) { values[0] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set") < 0)) __PYX_ERR(0, 239, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_value = values[0]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("set", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 239, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent._event.AsyncResult.set", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_6_event_11AsyncResult_8set(((struct __pyx_obj_6gevent_6_event_AsyncResult *)__pyx_v_self), __pyx_v_value); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_event_11AsyncResult_8set(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self, PyObject *__pyx_v_value) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("set", 0); + + /* "src/gevent/event.py":245 + * Subsequent calls to :meth:`wait` and :meth:`get` will not block at all. + * """ + * self._value = value # <<<<<<<<<<<<<< + * self._check_and_notify() + * + */ + __Pyx_INCREF(__pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + __Pyx_GOTREF(__pyx_v_self->_value); + __Pyx_DECREF(__pyx_v_self->_value); + __pyx_v_self->_value = __pyx_v_value; + + /* "src/gevent/event.py":246 + * """ + * self._value = value + * self._check_and_notify() # <<<<<<<<<<<<<< + * + * def set_exception(self, exception, exc_info=None): + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_6_event_AsyncResult *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._check_and_notify(((struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 246, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/event.py":239 + * return self._exc_info[1] + * + * def set(self, value=None): # <<<<<<<<<<<<<< + * """Store the value and wake up any waiters. + * + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent._event.AsyncResult.set", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/event.py":248 + * self._check_and_notify() + * + * def set_exception(self, exception, exc_info=None): # <<<<<<<<<<<<<< + * """Store the exception and wake up any waiters. + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_11set_exception(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6gevent_6_event_11AsyncResult_10set_exception[] = "AsyncResult.set_exception(self, exception, exc_info=None)\nStore the exception and wake up any waiters.\n\n All greenlets blocking on :meth:`get` or :meth:`wait` are awakened.\n Subsequent calls to :meth:`wait` and :meth:`get` will not block at all.\n\n :keyword tuple exc_info: If given, a standard three-tuple of type, value, :class:`traceback`\n as returned by :func:`sys.exc_info`. This will be used when the exception\n is re-raised to propagate the correct traceback.\n "; +static PyMethodDef __pyx_mdef_6gevent_6_event_11AsyncResult_11set_exception = {"set_exception", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_6_event_11AsyncResult_11set_exception, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_6_event_11AsyncResult_10set_exception}; +static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_11set_exception(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_exception = 0; + PyObject *__pyx_v_exc_info = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("set_exception (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_exception_2,&__pyx_n_s_exc_info,0}; + PyObject* values[2] = {0,0}; + values[1] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_exception_2)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_exc_info); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_exception") < 0)) __PYX_ERR(0, 248, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_exception = values[0]; + __pyx_v_exc_info = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("set_exception", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 248, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent._event.AsyncResult.set_exception", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_6_event_11AsyncResult_10set_exception(((struct __pyx_obj_6gevent_6_event_AsyncResult *)__pyx_v_self), __pyx_v_exception, __pyx_v_exc_info); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_event_11AsyncResult_10set_exception(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self, PyObject *__pyx_v_exception, PyObject *__pyx_v_exc_info) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + __Pyx_RefNannySetupContext("set_exception", 0); + + /* "src/gevent/event.py":258 + * is re-raised to propagate the correct traceback. + * """ + * if exc_info: # <<<<<<<<<<<<<< + * self._exc_info = (exc_info[0], exc_info[1], dump_traceback(exc_info[2])) + * else: + */ + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_exc_info); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 258, __pyx_L1_error) + if (__pyx_t_1) { + + /* "src/gevent/event.py":259 + * """ + * if exc_info: + * self._exc_info = (exc_info[0], exc_info[1], dump_traceback(exc_info[2])) # <<<<<<<<<<<<<< + * else: + * self._exc_info = (type(exception), exception, dump_traceback(None)) + */ + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_exc_info, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 259, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_exc_info, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 259, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_exc_info, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 259, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_6gevent_6_event_dump_traceback); + __pyx_t_6 = __pyx_v_6gevent_6_event_dump_traceback; __pyx_t_7 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) { + __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); + if (likely(__pyx_t_7)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); + __Pyx_INCREF(__pyx_t_7); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_6, function); + } + } + __pyx_t_4 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_5); + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 259, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 259, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_4); + __pyx_t_2 = 0; + __pyx_t_3 = 0; + __pyx_t_4 = 0; + __Pyx_GIVEREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_v_self->_exc_info); + __Pyx_DECREF(__pyx_v_self->_exc_info); + __pyx_v_self->_exc_info = ((PyObject*)__pyx_t_6); + __pyx_t_6 = 0; + + /* "src/gevent/event.py":258 + * is re-raised to propagate the correct traceback. + * """ + * if exc_info: # <<<<<<<<<<<<<< + * self._exc_info = (exc_info[0], exc_info[1], dump_traceback(exc_info[2])) + * else: + */ + goto __pyx_L3; + } + + /* "src/gevent/event.py":261 + * self._exc_info = (exc_info[0], exc_info[1], dump_traceback(exc_info[2])) + * else: + * self._exc_info = (type(exception), exception, dump_traceback(None)) # <<<<<<<<<<<<<< + * + * self._check_and_notify() + */ + /*else*/ { + __Pyx_INCREF(__pyx_v_6gevent_6_event_dump_traceback); + __pyx_t_4 = __pyx_v_6gevent_6_event_dump_traceback; __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + } + } + __pyx_t_6 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_3, Py_None) : __Pyx_PyObject_CallOneArg(__pyx_t_4, Py_None); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 261, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 261, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_exception))); + __Pyx_GIVEREF(((PyObject *)Py_TYPE(__pyx_v_exception))); + PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)Py_TYPE(__pyx_v_exception))); + __Pyx_INCREF(__pyx_v_exception); + __Pyx_GIVEREF(__pyx_v_exception); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_exception); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_6); + __pyx_t_6 = 0; + __Pyx_GIVEREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_v_self->_exc_info); + __Pyx_DECREF(__pyx_v_self->_exc_info); + __pyx_v_self->_exc_info = ((PyObject*)__pyx_t_4); + __pyx_t_4 = 0; + } + __pyx_L3:; + + /* "src/gevent/event.py":263 + * self._exc_info = (type(exception), exception, dump_traceback(None)) + * + * self._check_and_notify() # <<<<<<<<<<<<<< + * + * def _raise_exception(self): + */ + __pyx_t_4 = ((struct __pyx_vtabstruct_6gevent_6_event_AsyncResult *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._check_and_notify(((struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *)__pyx_v_self)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 263, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "src/gevent/event.py":248 + * self._check_and_notify() + * + * def set_exception(self, exception, exc_info=None): # <<<<<<<<<<<<<< + * """Store the exception and wake up any waiters. + * + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("gevent._event.AsyncResult.set_exception", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/event.py":265 + * self._check_and_notify() + * + * def _raise_exception(self): # <<<<<<<<<<<<<< + * reraise(*self.exc_info) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_13_raise_exception(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6gevent_6_event_11AsyncResult_12_raise_exception[] = "AsyncResult._raise_exception(self)"; +static PyMethodDef __pyx_mdef_6gevent_6_event_11AsyncResult_13_raise_exception = {"_raise_exception", (PyCFunction)__pyx_pw_6gevent_6_event_11AsyncResult_13_raise_exception, METH_NOARGS, __pyx_doc_6gevent_6_event_11AsyncResult_12_raise_exception}; +static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_13_raise_exception(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_raise_exception (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6_event_11AsyncResult_12_raise_exception(((struct __pyx_obj_6gevent_6_event_AsyncResult *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_event_11AsyncResult_12_raise_exception(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("_raise_exception", 0); + + /* "src/gevent/event.py":266 + * + * def _raise_exception(self): + * reraise(*self.exc_info) # <<<<<<<<<<<<<< + * + * def get(self, block=True, timeout=None): + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_exc_info); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 266, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PySequence_Tuple(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 266, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_6gevent_6_event_reraise, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 266, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/event.py":265 + * self._check_and_notify() + * + * def _raise_exception(self): # <<<<<<<<<<<<<< + * reraise(*self.exc_info) + * + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent._event.AsyncResult._raise_exception", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/event.py":268 + * reraise(*self.exc_info) + * + * def get(self, block=True, timeout=None): # <<<<<<<<<<<<<< + * """Return the stored value or raise the exception. + * + */ + +static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_15get(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_6gevent_6_event_11AsyncResult_get(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_6_event_11AsyncResult_get *__pyx_optional_args) { + PyObject *__pyx_v_block = ((PyObject *)Py_True); + PyObject *__pyx_v_timeout = ((PyObject *)Py_None); + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + int __pyx_t_8; + struct __pyx_opt_args_6gevent_19__abstract_linkable_16AbstractLinkable__wait_core __pyx_t_9; + struct __pyx_opt_args_6gevent_6_event_11AsyncResult_get __pyx_t_10; + __Pyx_RefNannySetupContext("get", 0); + if (__pyx_optional_args) { + if (__pyx_optional_args->__pyx_n > 0) { + __pyx_v_block = __pyx_optional_args->block; + if (__pyx_optional_args->__pyx_n > 1) { + __pyx_v_timeout = __pyx_optional_args->timeout; + } + } + } + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0; + if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self)))))); + else { + PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + #endif + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 268, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_6_event_11AsyncResult_15get)) { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; + __pyx_t_5 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_5 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_3)) { + PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_block, __pyx_v_timeout}; + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 268, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GOTREF(__pyx_t_2); + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { + PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_block, __pyx_v_timeout}; + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 268, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GOTREF(__pyx_t_2); + } else + #endif + { + __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 268, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (__pyx_t_4) { + __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL; + } + __Pyx_INCREF(__pyx_v_block); + __Pyx_GIVEREF(__pyx_v_block); + PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_block); + __Pyx_INCREF(__pyx_v_timeout); + __Pyx_GIVEREF(__pyx_v_timeout); + PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_timeout); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 268, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0; + if (unlikely(type_dict_guard != tp_dict_version)) { + tp_dict_version = obj_dict_version = 0; + } + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + } + #endif + } + + /* "src/gevent/event.py":283 + * immediately raise a :class:`Timeout` exception. + * """ + * if self._value is not _NONE: # <<<<<<<<<<<<<< + * return self._value + * if self._exc_info: + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_NONE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 283, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = (__pyx_v_self->_value != __pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_8 = (__pyx_t_7 != 0); + if (__pyx_t_8) { + + /* "src/gevent/event.py":284 + * """ + * if self._value is not _NONE: + * return self._value # <<<<<<<<<<<<<< + * if self._exc_info: + * return self._raise_exception() + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->_value); + __pyx_r = __pyx_v_self->_value; + goto __pyx_L0; + + /* "src/gevent/event.py":283 + * immediately raise a :class:`Timeout` exception. + * """ + * if self._value is not _NONE: # <<<<<<<<<<<<<< + * return self._value + * if self._exc_info: + */ + } + + /* "src/gevent/event.py":285 + * if self._value is not _NONE: + * return self._value + * if self._exc_info: # <<<<<<<<<<<<<< + * return self._raise_exception() + * + */ + __pyx_t_8 = (__pyx_v_self->_exc_info != Py_None)&&(PyTuple_GET_SIZE(__pyx_v_self->_exc_info) != 0); + if (__pyx_t_8) { + + /* "src/gevent/event.py":286 + * return self._value + * if self._exc_info: + * return self._raise_exception() # <<<<<<<<<<<<<< + * + * if not block: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_raise_exception); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 286, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 286, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "src/gevent/event.py":285 + * if self._value is not _NONE: + * return self._value + * if self._exc_info: # <<<<<<<<<<<<<< + * return self._raise_exception() + * + */ + } + + /* "src/gevent/event.py":288 + * return self._raise_exception() + * + * if not block: # <<<<<<<<<<<<<< + * # Not ready and not blocking, so immediately timeout + * raise Timeout() + */ + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_block); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 288, __pyx_L1_error) + __pyx_t_7 = ((!__pyx_t_8) != 0); + if (unlikely(__pyx_t_7)) { + + /* "src/gevent/event.py":290 + * if not block: + * # Not ready and not blocking, so immediately timeout + * raise Timeout() # <<<<<<<<<<<<<< + * + * # Wait, raising a timeout that elapses + */ + __Pyx_INCREF(__pyx_v_6gevent_6_event_Timeout); + __pyx_t_2 = __pyx_v_6gevent_6_event_Timeout; __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 290, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 290, __pyx_L1_error) + + /* "src/gevent/event.py":288 + * return self._raise_exception() + * + * if not block: # <<<<<<<<<<<<<< + * # Not ready and not blocking, so immediately timeout + * raise Timeout() + */ + } + + /* "src/gevent/event.py":293 + * + * # Wait, raising a timeout that elapses + * self._wait_core(timeout, ()) # <<<<<<<<<<<<<< + * + * # by definition we are now ready + */ + __pyx_t_9.__pyx_n = 1; + __pyx_t_9.catch = __pyx_empty_tuple; + __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_6_event_AsyncResult *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._wait_core(((struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *)__pyx_v_self), __pyx_v_timeout, &__pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 293, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/event.py":296 + * + * # by definition we are now ready + * return self.get(block=False) # <<<<<<<<<<<<<< + * + * def get_nowait(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_10.__pyx_n = 1; + __pyx_t_10.block = Py_False; + __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_6_event_AsyncResult *)__pyx_v_self->__pyx_base.__pyx_vtab)->get(__pyx_v_self, 0, &__pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 296, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "src/gevent/event.py":268 + * reraise(*self.exc_info) + * + * def get(self, block=True, timeout=None): # <<<<<<<<<<<<<< + * """Return the stored value or raise the exception. + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("gevent._event.AsyncResult.get", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_15get(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6gevent_6_event_11AsyncResult_14get[] = "AsyncResult.get(self, block=True, timeout=None)\nReturn the stored value or raise the exception.\n\n If this instance already holds a value or an exception, return or raise it immediately.\n Otherwise, block until another greenlet calls :meth:`set` or :meth:`set_exception` or\n until the optional timeout occurs.\n\n When the *timeout* argument is present and not ``None``, it should be a\n floating point number specifying a timeout for the operation in seconds\n (or fractions thereof). If the *timeout* elapses, the *Timeout* exception will\n be raised.\n\n :keyword bool block: If set to ``False`` and this instance is not ready,\n immediately raise a :class:`Timeout` exception.\n "; +static PyMethodDef __pyx_mdef_6gevent_6_event_11AsyncResult_15get = {"get", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_6_event_11AsyncResult_15get, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_6_event_11AsyncResult_14get}; +static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_15get(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_block = 0; + PyObject *__pyx_v_timeout = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_block,&__pyx_n_s_timeout,0}; + PyObject* values[2] = {0,0}; + values[0] = ((PyObject *)Py_True); + values[1] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_block); + if (value) { values[0] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 1: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_timeout); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get") < 0)) __PYX_ERR(0, 268, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_block = values[0]; + __pyx_v_timeout = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("get", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 268, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent._event.AsyncResult.get", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_6_event_11AsyncResult_14get(((struct __pyx_obj_6gevent_6_event_AsyncResult *)__pyx_v_self), __pyx_v_block, __pyx_v_timeout); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_event_11AsyncResult_14get(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self, PyObject *__pyx_v_block, PyObject *__pyx_v_timeout) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + struct __pyx_opt_args_6gevent_6_event_11AsyncResult_get __pyx_t_2; + __Pyx_RefNannySetupContext("get", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_2.__pyx_n = 2; + __pyx_t_2.block = __pyx_v_block; + __pyx_t_2.timeout = __pyx_v_timeout; + __pyx_t_1 = __pyx_vtabptr_6gevent_6_event_AsyncResult->get(__pyx_v_self, 1, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 268, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent._event.AsyncResult.get", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/event.py":298 + * return self.get(block=False) + * + * def get_nowait(self): # <<<<<<<<<<<<<< + * """ + * Return the value or raise the exception without blocking. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_17get_nowait(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6gevent_6_event_11AsyncResult_16get_nowait[] = "AsyncResult.get_nowait(self)\n\n Return the value or raise the exception without blocking.\n\n If this object is not yet :meth:`ready `, raise\n :class:`gevent.Timeout` immediately.\n "; +static PyMethodDef __pyx_mdef_6gevent_6_event_11AsyncResult_17get_nowait = {"get_nowait", (PyCFunction)__pyx_pw_6gevent_6_event_11AsyncResult_17get_nowait, METH_NOARGS, __pyx_doc_6gevent_6_event_11AsyncResult_16get_nowait}; +static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_17get_nowait(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get_nowait (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6_event_11AsyncResult_16get_nowait(((struct __pyx_obj_6gevent_6_event_AsyncResult *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_event_11AsyncResult_16get_nowait(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + struct __pyx_opt_args_6gevent_6_event_11AsyncResult_get __pyx_t_2; + __Pyx_RefNannySetupContext("get_nowait", 0); + + /* "src/gevent/event.py":305 + * :class:`gevent.Timeout` immediately. + * """ + * return self.get(block=False) # <<<<<<<<<<<<<< + * + * def _wait_return_value(self, waited, wait_success): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2.__pyx_n = 1; + __pyx_t_2.block = Py_False; + __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_6_event_AsyncResult *)__pyx_v_self->__pyx_base.__pyx_vtab)->get(__pyx_v_self, 0, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 305, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "src/gevent/event.py":298 + * return self.get(block=False) + * + * def get_nowait(self): # <<<<<<<<<<<<<< + * """ + * Return the value or raise the exception without blocking. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent._event.AsyncResult.get_nowait", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/event.py":307 + * return self.get(block=False) + * + * def _wait_return_value(self, waited, wait_success): # <<<<<<<<<<<<<< + * # pylint:disable=unused-argument + * # Always return the value. Since this is a one-shot event, + */ + +static PyObject *__pyx_f_6gevent_6_event_11AsyncResult__wait_return_value(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_waited, CYTHON_UNUSED PyObject *__pyx_v_wait_success) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("_wait_return_value", 0); + + /* "src/gevent/event.py":311 + * # Always return the value. Since this is a one-shot event, + * # no race condition should reset it. + * return self.value # <<<<<<<<<<<<<< + * + * def wait(self, timeout=None): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 311, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "src/gevent/event.py":307 + * return self.get(block=False) + * + * def _wait_return_value(self, waited, wait_success): # <<<<<<<<<<<<<< + * # pylint:disable=unused-argument + * # Always return the value. Since this is a one-shot event, + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent._event.AsyncResult._wait_return_value", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/event.py":313 + * return self.value + * + * def wait(self, timeout=None): # <<<<<<<<<<<<<< + * """Block until the instance is ready. + * + */ + +static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_19wait(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_6gevent_6_event_11AsyncResult_wait(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_6_event_11AsyncResult_wait *__pyx_optional_args) { + PyObject *__pyx_v_timeout = ((PyObject *)Py_None); + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + struct __pyx_opt_args_6gevent_19__abstract_linkable_16AbstractLinkable__wait __pyx_t_5; + __Pyx_RefNannySetupContext("wait", 0); + if (__pyx_optional_args) { + if (__pyx_optional_args->__pyx_n > 0) { + __pyx_v_timeout = __pyx_optional_args->timeout; + } + } + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0; + if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self)))))); + else { + PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + #endif + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_wait); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 313, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_6_event_11AsyncResult_19wait)) { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_timeout) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_timeout); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 313, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0; + if (unlikely(type_dict_guard != tp_dict_version)) { + tp_dict_version = obj_dict_version = 0; + } + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + } + #endif + } + + /* "src/gevent/event.py":332 + * + * """ + * return self._wait(timeout) # <<<<<<<<<<<<<< + * + * # link protocol + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_5.__pyx_n = 1; + __pyx_t_5.timeout = __pyx_v_timeout; + __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_6_event_AsyncResult *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._wait(((struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *)__pyx_v_self), &__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 332, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "src/gevent/event.py":313 + * return self.value + * + * def wait(self, timeout=None): # <<<<<<<<<<<<<< + * """Block until the instance is ready. + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("gevent._event.AsyncResult.wait", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_19wait(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6gevent_6_event_11AsyncResult_18wait[] = "AsyncResult.wait(self, timeout=None)\nBlock until the instance is ready.\n\n If this instance already holds a value, it is returned immediately. If this\n instance already holds an exception, ``None`` is returned immediately.\n\n Otherwise, block until another greenlet calls :meth:`set` or :meth:`set_exception`\n (at which point either the value or ``None`` will be returned, respectively),\n or until the optional timeout expires (at which point ``None`` will also be\n returned).\n\n When the *timeout* argument is present and not ``None``, it should be a\n floating point number specifying a timeout for the operation in seconds\n (or fractions thereof).\n\n .. note:: If a timeout is given and expires, ``None`` will be returned\n (no timeout exception will be raised).\n\n "; +static PyMethodDef __pyx_mdef_6gevent_6_event_11AsyncResult_19wait = {"wait", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_6_event_11AsyncResult_19wait, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_6_event_11AsyncResult_18wait}; +static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_19wait(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_timeout = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("wait (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_timeout,0}; + PyObject* values[1] = {0}; + values[0] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_timeout); + if (value) { values[0] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "wait") < 0)) __PYX_ERR(0, 313, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_timeout = values[0]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("wait", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 313, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent._event.AsyncResult.wait", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_6_event_11AsyncResult_18wait(((struct __pyx_obj_6gevent_6_event_AsyncResult *)__pyx_v_self), __pyx_v_timeout); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_event_11AsyncResult_18wait(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self, PyObject *__pyx_v_timeout) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + struct __pyx_opt_args_6gevent_6_event_11AsyncResult_wait __pyx_t_2; + __Pyx_RefNannySetupContext("wait", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_2.__pyx_n = 1; + __pyx_t_2.timeout = __pyx_v_timeout; + __pyx_t_1 = __pyx_vtabptr_6gevent_6_event_AsyncResult->wait(__pyx_v_self, 1, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 313, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent._event.AsyncResult.wait", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/event.py":335 + * + * # link protocol + * def __call__(self, source): # <<<<<<<<<<<<<< + * if source.successful(): + * self.set(source.value) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_21__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_21__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_source = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__call__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_source,0}; + PyObject* values[1] = {0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_source)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__call__") < 0)) __PYX_ERR(0, 335, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + } + __pyx_v_source = values[0]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__call__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 335, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent._event.AsyncResult.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_6_event_11AsyncResult_20__call__(((struct __pyx_obj_6gevent_6_event_AsyncResult *)__pyx_v_self), __pyx_v_source); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_event_11AsyncResult_20__call__(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self, PyObject *__pyx_v_source) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + __Pyx_RefNannySetupContext("__call__", 0); + + /* "src/gevent/event.py":336 + * # link protocol + * def __call__(self, source): + * if source.successful(): # <<<<<<<<<<<<<< + * self.set(source.value) + * else: + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_source, __pyx_n_s_successful); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 336, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 336, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 336, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_4) { + + /* "src/gevent/event.py":337 + * def __call__(self, source): + * if source.successful(): + * self.set(source.value) # <<<<<<<<<<<<<< + * else: + * self.set_exception(source.exception, getattr(source, 'exc_info', None)) + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 337, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_source, __pyx_n_s_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 337, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 337, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/event.py":336 + * # link protocol + * def __call__(self, source): + * if source.successful(): # <<<<<<<<<<<<<< + * self.set(source.value) + * else: + */ + goto __pyx_L3; + } + + /* "src/gevent/event.py":339 + * self.set(source.value) + * else: + * self.set_exception(source.exception, getattr(source, 'exc_info', None)) # <<<<<<<<<<<<<< + * + * # Methods to make us more like concurrent.futures.Future + */ + /*else*/ { + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_exception); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 339, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_source, __pyx_n_s_exception_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 339, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = __Pyx_GetAttr3(__pyx_v_source, __pyx_n_s_exc_info, Py_None); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 339, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = NULL; + __pyx_t_7 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_6)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_7 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_3, __pyx_t_5}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 339, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_3, __pyx_t_5}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 339, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } else + #endif + { + __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 339, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + if (__pyx_t_6) { + __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL; + } + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_t_5); + __pyx_t_3 = 0; + __pyx_t_5 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 339, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + __pyx_L3:; + + /* "src/gevent/event.py":335 + * + * # link protocol + * def __call__(self, source): # <<<<<<<<<<<<<< + * if source.successful(): + * self.set(source.value) + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("gevent._event.AsyncResult.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/event.py":343 + * # Methods to make us more like concurrent.futures.Future + * + * def result(self, timeout=None): # <<<<<<<<<<<<<< + * return self.get(timeout=timeout) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_23result(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6gevent_6_event_11AsyncResult_22result[] = "AsyncResult.result(self, timeout=None)"; +static PyMethodDef __pyx_mdef_6gevent_6_event_11AsyncResult_23result = {"result", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_6_event_11AsyncResult_23result, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_6_event_11AsyncResult_22result}; +static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_23result(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_timeout = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("result (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_timeout,0}; + PyObject* values[1] = {0}; + values[0] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_timeout); + if (value) { values[0] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "result") < 0)) __PYX_ERR(0, 343, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_timeout = values[0]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("result", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 343, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent._event.AsyncResult.result", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_6_event_11AsyncResult_22result(((struct __pyx_obj_6gevent_6_event_AsyncResult *)__pyx_v_self), __pyx_v_timeout); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_event_11AsyncResult_22result(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self, PyObject *__pyx_v_timeout) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("result", 0); + + /* "src/gevent/event.py":344 + * + * def result(self, timeout=None): + * return self.get(timeout=timeout) # <<<<<<<<<<<<<< + * + * set_result = set + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 344, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 344, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_timeout, __pyx_v_timeout) < 0) __PYX_ERR(0, 344, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 344, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "src/gevent/event.py":343 + * # Methods to make us more like concurrent.futures.Future + * + * def result(self, timeout=None): # <<<<<<<<<<<<<< + * return self.get(timeout=timeout) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("gevent._event.AsyncResult.result", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/event.py":348 + * set_result = set + * + * def done(self): # <<<<<<<<<<<<<< + * return self.ready() + * + */ + +static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_25done(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static int __pyx_f_6gevent_6_event_11AsyncResult_done(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self, int __pyx_skip_dispatch) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + __Pyx_RefNannySetupContext("done", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0; + if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self)))))); + else { + PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + #endif + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_done); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 348, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_6_event_11AsyncResult_25done)) { + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 348, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 348, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_5; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0; + if (unlikely(type_dict_guard != tp_dict_version)) { + tp_dict_version = obj_dict_version = 0; + } + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + } + #endif + } + + /* "src/gevent/event.py":349 + * + * def done(self): + * return self.ready() # <<<<<<<<<<<<<< + * + * # we don't support cancelling + */ + __pyx_r = ((struct __pyx_vtabstruct_6gevent_6_event_AsyncResult *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.ready(((struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *)__pyx_v_self), 0); + goto __pyx_L0; + + /* "src/gevent/event.py":348 + * set_result = set + * + * def done(self): # <<<<<<<<<<<<<< + * return self.ready() + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_WriteUnraisable("gevent._event.AsyncResult.done", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_25done(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6gevent_6_event_11AsyncResult_24done[] = "AsyncResult.done(self) -> bool"; +static PyMethodDef __pyx_mdef_6gevent_6_event_11AsyncResult_25done = {"done", (PyCFunction)__pyx_pw_6gevent_6_event_11AsyncResult_25done, METH_NOARGS, __pyx_doc_6gevent_6_event_11AsyncResult_24done}; +static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_25done(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("done (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6_event_11AsyncResult_24done(((struct __pyx_obj_6gevent_6_event_AsyncResult *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_event_11AsyncResult_24done(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("done", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_f_6gevent_6_event_11AsyncResult_done(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 348, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent._event.AsyncResult.done", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/event.py":353 + * # we don't support cancelling + * + * def cancel(self): # <<<<<<<<<<<<<< + * return False + * + */ + +static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_27cancel(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static int __pyx_f_6gevent_6_event_11AsyncResult_cancel(CYTHON_UNUSED struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self, int __pyx_skip_dispatch) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + __Pyx_RefNannySetupContext("cancel", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0; + if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self)))))); + else { + PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + #endif + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_cancel); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 353, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_6_event_11AsyncResult_27cancel)) { + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 353, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 353, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_5; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0; + if (unlikely(type_dict_guard != tp_dict_version)) { + tp_dict_version = obj_dict_version = 0; + } + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + } + #endif + } + + /* "src/gevent/event.py":354 + * + * def cancel(self): + * return False # <<<<<<<<<<<<<< + * + * def cancelled(self): + */ + __pyx_r = 0; + goto __pyx_L0; + + /* "src/gevent/event.py":353 + * # we don't support cancelling + * + * def cancel(self): # <<<<<<<<<<<<<< + * return False + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_WriteUnraisable("gevent._event.AsyncResult.cancel", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_27cancel(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6gevent_6_event_11AsyncResult_26cancel[] = "AsyncResult.cancel(self) -> bool"; +static PyMethodDef __pyx_mdef_6gevent_6_event_11AsyncResult_27cancel = {"cancel", (PyCFunction)__pyx_pw_6gevent_6_event_11AsyncResult_27cancel, METH_NOARGS, __pyx_doc_6gevent_6_event_11AsyncResult_26cancel}; +static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_27cancel(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("cancel (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6_event_11AsyncResult_26cancel(((struct __pyx_obj_6gevent_6_event_AsyncResult *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_event_11AsyncResult_26cancel(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("cancel", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_f_6gevent_6_event_11AsyncResult_cancel(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 353, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent._event.AsyncResult.cancel", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/event.py":356 + * return False + * + * def cancelled(self): # <<<<<<<<<<<<<< + * return False + * + */ + +static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_29cancelled(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static int __pyx_f_6gevent_6_event_11AsyncResult_cancelled(CYTHON_UNUSED struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self, int __pyx_skip_dispatch) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + __Pyx_RefNannySetupContext("cancelled", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0; + if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self)))))); + else { + PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + #endif + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_cancelled); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 356, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_6_event_11AsyncResult_29cancelled)) { + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 356, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 356, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_5; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0; + if (unlikely(type_dict_guard != tp_dict_version)) { + tp_dict_version = obj_dict_version = 0; + } + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + } + #endif + } + + /* "src/gevent/event.py":357 + * + * def cancelled(self): + * return False # <<<<<<<<<<<<<< + * + * # exception is a method, we use it as a property + */ + __pyx_r = 0; + goto __pyx_L0; + + /* "src/gevent/event.py":356 + * return False + * + * def cancelled(self): # <<<<<<<<<<<<<< + * return False + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_WriteUnraisable("gevent._event.AsyncResult.cancelled", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_29cancelled(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6gevent_6_event_11AsyncResult_28cancelled[] = "AsyncResult.cancelled(self) -> bool"; +static PyMethodDef __pyx_mdef_6gevent_6_event_11AsyncResult_29cancelled = {"cancelled", (PyCFunction)__pyx_pw_6gevent_6_event_11AsyncResult_29cancelled, METH_NOARGS, __pyx_doc_6gevent_6_event_11AsyncResult_28cancelled}; +static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_29cancelled(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("cancelled (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6_event_11AsyncResult_28cancelled(((struct __pyx_obj_6gevent_6_event_AsyncResult *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_event_11AsyncResult_28cancelled(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("cancelled", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_f_6gevent_6_event_11AsyncResult_cancelled(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 356, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent._event.AsyncResult.cancelled", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/_event.pxd":17 + * + * cdef class AsyncResult(AbstractLinkable): + * cdef readonly _value # <<<<<<<<<<<<<< + * cdef readonly tuple _exc_info + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_6_value_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_6_value_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6_event_11AsyncResult_6_value___get__(((struct __pyx_obj_6gevent_6_event_AsyncResult *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_event_11AsyncResult_6_value___get__(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->_value); + __pyx_r = __pyx_v_self->_value; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/_event.pxd":18 + * cdef class AsyncResult(AbstractLinkable): + * cdef readonly _value + * cdef readonly tuple _exc_info # <<<<<<<<<<<<<< + * + * # For the use of _imap.py + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_9_exc_info_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_9_exc_info_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6_event_11AsyncResult_9_exc_info___get__(((struct __pyx_obj_6gevent_6_event_AsyncResult *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_event_11AsyncResult_9_exc_info___get__(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->_exc_info); + __pyx_r = __pyx_v_self->_exc_info; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/_event.pxd":21 + * + * # For the use of _imap.py + * cdef public int _imap_task_index # <<<<<<<<<<<<<< + * + * cpdef get(self, block=*, timeout=*) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_16_imap_task_index_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_16_imap_task_index_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6_event_11AsyncResult_16_imap_task_index___get__(((struct __pyx_obj_6gevent_6_event_AsyncResult *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_event_11AsyncResult_16_imap_task_index___get__(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->_imap_task_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 21, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent._event.AsyncResult._imap_task_index.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6gevent_6_event_11AsyncResult_16_imap_task_index_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6gevent_6_event_11AsyncResult_16_imap_task_index_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6_event_11AsyncResult_16_imap_task_index_2__set__(((struct __pyx_obj_6gevent_6_event_AsyncResult *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_6_event_11AsyncResult_16_imap_task_index_2__set__(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("__set__", 0); + __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 21, __pyx_L1_error) + __pyx_v_self->_imap_task_index = __pyx_t_1; + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("gevent._event.AsyncResult._imap_task_index.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/__greenlet_primitives.pxd":23 + * + * @cython.final + * cdef inline greenlet getcurrent(): # <<<<<<<<<<<<<< + * return PyGreenlet_GetCurrent() + * + */ + +static CYTHON_INLINE PyGreenlet *__pyx_f_6gevent_21__greenlet_primitives_getcurrent(void) { + PyGreenlet *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("getcurrent", 0); + + /* "gevent/__greenlet_primitives.pxd":24 + * @cython.final + * cdef inline greenlet getcurrent(): + * return PyGreenlet_GetCurrent() # <<<<<<<<<<<<<< + * + * cdef bint _greenlet_imported + */ + __Pyx_XDECREF(((PyObject *)__pyx_r)); + __pyx_t_1 = ((PyObject *)PyGreenlet_GetCurrent()); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 24, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = ((PyGreenlet *)__pyx_t_1); + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "gevent/__greenlet_primitives.pxd":23 + * + * @cython.final + * cdef inline greenlet getcurrent(): # <<<<<<<<<<<<<< + * return PyGreenlet_GetCurrent() + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__greenlet_primitives.getcurrent", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF((PyObject *)__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/__greenlet_primitives.pxd":28 + * cdef bint _greenlet_imported + * + * cdef inline void greenlet_init(): # <<<<<<<<<<<<<< + * global _greenlet_imported + * if not _greenlet_imported: + */ + +static CYTHON_INLINE void __pyx_f_6gevent_21__greenlet_primitives_greenlet_init(void) { + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("greenlet_init", 0); + + /* "gevent/__greenlet_primitives.pxd":30 + * cdef inline void greenlet_init(): + * global _greenlet_imported + * if not _greenlet_imported: # <<<<<<<<<<<<<< + * PyGreenlet_Import() + * _greenlet_imported = True + */ + __pyx_t_1 = ((!(__pyx_v_6gevent_21__greenlet_primitives__greenlet_imported != 0)) != 0); + if (__pyx_t_1) { + + /* "gevent/__greenlet_primitives.pxd":31 + * global _greenlet_imported + * if not _greenlet_imported: + * PyGreenlet_Import() # <<<<<<<<<<<<<< + * _greenlet_imported = True + * + */ + PyGreenlet_Import(); + + /* "gevent/__greenlet_primitives.pxd":32 + * if not _greenlet_imported: + * PyGreenlet_Import() + * _greenlet_imported = True # <<<<<<<<<<<<<< + * + * cdef inline object _greenlet_switch(greenlet self): + */ + __pyx_v_6gevent_21__greenlet_primitives__greenlet_imported = 1; + + /* "gevent/__greenlet_primitives.pxd":30 + * cdef inline void greenlet_init(): + * global _greenlet_imported + * if not _greenlet_imported: # <<<<<<<<<<<<<< + * PyGreenlet_Import() + * _greenlet_imported = True + */ + } + + /* "gevent/__greenlet_primitives.pxd":28 + * cdef bint _greenlet_imported + * + * cdef inline void greenlet_init(): # <<<<<<<<<<<<<< + * global _greenlet_imported + * if not _greenlet_imported: + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "gevent/__greenlet_primitives.pxd":34 + * _greenlet_imported = True + * + * cdef inline object _greenlet_switch(greenlet self): # <<<<<<<<<<<<<< + * return PyGreenlet_Switch(self, NULL, NULL) + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_6gevent_21__greenlet_primitives__greenlet_switch(PyGreenlet *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("_greenlet_switch", 0); + + /* "gevent/__greenlet_primitives.pxd":35 + * + * cdef inline object _greenlet_switch(greenlet self): + * return PyGreenlet_Switch(self, NULL, NULL) # <<<<<<<<<<<<<< + * + * cdef class TrackedRawGreenlet(greenlet): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyGreenlet_Switch(__pyx_v_self, NULL, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 35, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "gevent/__greenlet_primitives.pxd":34 + * _greenlet_imported = True + * + * cdef inline object _greenlet_switch(greenlet self): # <<<<<<<<<<<<<< + * return PyGreenlet_Switch(self, NULL, NULL) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__greenlet_primitives._greenlet_switch", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/__abstract_linkable.pxd":21 + * void PyGreenlet_Import() + * + * cdef inline greenlet getcurrent(): # <<<<<<<<<<<<<< + * return PyGreenlet_GetCurrent() + * + */ + +static CYTHON_INLINE PyGreenlet *__pyx_f_6gevent_19__abstract_linkable_getcurrent(void) { + PyGreenlet *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("getcurrent", 0); + + /* "gevent/__abstract_linkable.pxd":22 + * + * cdef inline greenlet getcurrent(): + * return PyGreenlet_GetCurrent() # <<<<<<<<<<<<<< + * + * cdef inline void greenlet_init(): + */ + __Pyx_XDECREF(((PyObject *)__pyx_r)); + __pyx_t_1 = ((PyObject *)PyGreenlet_GetCurrent()); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 22, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = ((PyGreenlet *)__pyx_t_1); + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "gevent/__abstract_linkable.pxd":21 + * void PyGreenlet_Import() + * + * cdef inline greenlet getcurrent(): # <<<<<<<<<<<<<< + * return PyGreenlet_GetCurrent() + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__abstract_linkable.getcurrent", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF((PyObject *)__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/__abstract_linkable.pxd":24 + * return PyGreenlet_GetCurrent() + * + * cdef inline void greenlet_init(): # <<<<<<<<<<<<<< + * global _greenlet_imported + * if not _greenlet_imported: + */ + +static CYTHON_INLINE void __pyx_f_6gevent_19__abstract_linkable_greenlet_init(void) { + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("greenlet_init", 0); + + /* "gevent/__abstract_linkable.pxd":26 + * cdef inline void greenlet_init(): + * global _greenlet_imported + * if not _greenlet_imported: # <<<<<<<<<<<<<< + * PyGreenlet_Import() + * _greenlet_imported = True + */ + __pyx_t_1 = ((!(__pyx_v_6gevent_19__abstract_linkable__greenlet_imported != 0)) != 0); + if (__pyx_t_1) { + + /* "gevent/__abstract_linkable.pxd":27 + * global _greenlet_imported + * if not _greenlet_imported: + * PyGreenlet_Import() # <<<<<<<<<<<<<< + * _greenlet_imported = True + * + */ + PyGreenlet_Import(); + + /* "gevent/__abstract_linkable.pxd":28 + * if not _greenlet_imported: + * PyGreenlet_Import() + * _greenlet_imported = True # <<<<<<<<<<<<<< + * + * cdef void _init() + */ + __pyx_v_6gevent_19__abstract_linkable__greenlet_imported = 1; + + /* "gevent/__abstract_linkable.pxd":26 + * cdef inline void greenlet_init(): + * global _greenlet_imported + * if not _greenlet_imported: # <<<<<<<<<<<<<< + * PyGreenlet_Import() + * _greenlet_imported = True + */ + } + + /* "gevent/__abstract_linkable.pxd":24 + * return PyGreenlet_GetCurrent() + * + * cdef inline void greenlet_init(): # <<<<<<<<<<<<<< + * global _greenlet_imported + * if not _greenlet_imported: + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} +static struct __pyx_vtabstruct_6gevent_6_event_Event __pyx_vtable_6gevent_6_event_Event; + +static PyObject *__pyx_tp_new_6gevent_6_event_Event(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_6gevent_6_event_Event *p; + PyObject *o = __pyx_ptype_6gevent_19__abstract_linkable_AbstractLinkable->tp_new(t, a, k); + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_6gevent_6_event_Event *)o); + p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_6gevent_19__abstract_linkable_AbstractLinkable*)__pyx_vtabptr_6gevent_6_event_Event; + return o; +} + +static void __pyx_tp_dealloc_6gevent_6_event_Event(PyObject *o) { + #if CYTHON_USE_TP_FINALIZE + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + PyObject_GC_UnTrack(o); + PyObject_GC_Track(o); + if (likely(__pyx_ptype_6gevent_19__abstract_linkable_AbstractLinkable)) __pyx_ptype_6gevent_19__abstract_linkable_AbstractLinkable->tp_dealloc(o); else __Pyx_call_next_tp_dealloc(o, __pyx_tp_dealloc_6gevent_6_event_Event); +} + +static int __pyx_tp_traverse_6gevent_6_event_Event(PyObject *o, visitproc v, void *a) { + int e; + e = ((likely(__pyx_ptype_6gevent_19__abstract_linkable_AbstractLinkable)) ? ((__pyx_ptype_6gevent_19__abstract_linkable_AbstractLinkable->tp_traverse) ? __pyx_ptype_6gevent_19__abstract_linkable_AbstractLinkable->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_6gevent_6_event_Event)); if (e) return e; + return 0; +} + +static int __pyx_tp_clear_6gevent_6_event_Event(PyObject *o) { + if (likely(__pyx_ptype_6gevent_19__abstract_linkable_AbstractLinkable)) { if (__pyx_ptype_6gevent_19__abstract_linkable_AbstractLinkable->tp_clear) __pyx_ptype_6gevent_19__abstract_linkable_AbstractLinkable->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_6gevent_6_event_Event); + return 0; +} + +static PyMethodDef __pyx_methods_6gevent_6_event_Event[] = { + {"is_set", (PyCFunction)__pyx_pw_6gevent_6_event_5Event_5is_set, METH_NOARGS, __pyx_doc_6gevent_6_event_5Event_4is_set}, + {"isSet", (PyCFunction)__pyx_pw_6gevent_6_event_5Event_7isSet, METH_NOARGS, __pyx_doc_6gevent_6_event_5Event_6isSet}, + {"set", (PyCFunction)__pyx_pw_6gevent_6_event_5Event_11set, METH_NOARGS, __pyx_doc_6gevent_6_event_5Event_10set}, + {"clear", (PyCFunction)__pyx_pw_6gevent_6_event_5Event_13clear, METH_NOARGS, __pyx_doc_6gevent_6_event_5Event_12clear}, + {"wait", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_6_event_5Event_15wait, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_6_event_5Event_14wait}, + {"_reset_internal_locks", (PyCFunction)__pyx_pw_6gevent_6_event_5Event_17_reset_internal_locks, METH_NOARGS, __pyx_doc_6gevent_6_event_5Event_16_reset_internal_locks}, + {0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_6gevent_6_event_Event = { + PyVarObject_HEAD_INIT(0, 0) + "gevent._event.Event", /*tp_name*/ + sizeof(struct __pyx_obj_6gevent_6_event_Event), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6gevent_6_event_Event, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + __pyx_pw_6gevent_6_event_5Event_3__str__, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + "Event()\nA synchronization primitive that allows one greenlet to wake up one or more others.\n It has the same interface as :class:`threading.Event` but works across greenlets.\n\n An event object manages an internal flag that can be set to true with the\n :meth:`set` method and reset to false with the :meth:`clear` method. The :meth:`wait` method\n blocks until the flag is true.\n\n .. note::\n The order and timing in which waiting greenlets are awakened is not determined.\n As an implementation note, in gevent 1.1 and 1.0, waiting greenlets are awakened in a\n undetermined order sometime *after* the current greenlet yields to the event loop. Other greenlets\n (those not waiting to be awakened) may run between the current greenlet yielding and\n the waiting greenlets being awakened. These details may change in the future.\n ", /*tp_doc*/ + __pyx_tp_traverse_6gevent_6_event_Event, /*tp_traverse*/ + __pyx_tp_clear_6gevent_6_event_Event, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6gevent_6_event_Event, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_pw_6gevent_6_event_5Event_1__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6gevent_6_event_Event, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; +static struct __pyx_vtabstruct_6gevent_6_event_AsyncResult __pyx_vtable_6gevent_6_event_AsyncResult; + +static PyObject *__pyx_tp_new_6gevent_6_event_AsyncResult(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_6gevent_6_event_AsyncResult *p; + PyObject *o = __pyx_ptype_6gevent_19__abstract_linkable_AbstractLinkable->tp_new(t, a, k); + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_6gevent_6_event_AsyncResult *)o); + p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_6gevent_19__abstract_linkable_AbstractLinkable*)__pyx_vtabptr_6gevent_6_event_AsyncResult; + p->_value = Py_None; Py_INCREF(Py_None); + p->_exc_info = ((PyObject*)Py_None); Py_INCREF(Py_None); + return o; +} + +static void __pyx_tp_dealloc_6gevent_6_event_AsyncResult(PyObject *o) { + struct __pyx_obj_6gevent_6_event_AsyncResult *p = (struct __pyx_obj_6gevent_6_event_AsyncResult *)o; + #if CYTHON_USE_TP_FINALIZE + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + PyObject_GC_UnTrack(o); + Py_CLEAR(p->_value); + Py_CLEAR(p->_exc_info); + PyObject_GC_Track(o); + if (likely(__pyx_ptype_6gevent_19__abstract_linkable_AbstractLinkable)) __pyx_ptype_6gevent_19__abstract_linkable_AbstractLinkable->tp_dealloc(o); else __Pyx_call_next_tp_dealloc(o, __pyx_tp_dealloc_6gevent_6_event_AsyncResult); +} + +static int __pyx_tp_traverse_6gevent_6_event_AsyncResult(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_6gevent_6_event_AsyncResult *p = (struct __pyx_obj_6gevent_6_event_AsyncResult *)o; + e = ((likely(__pyx_ptype_6gevent_19__abstract_linkable_AbstractLinkable)) ? ((__pyx_ptype_6gevent_19__abstract_linkable_AbstractLinkable->tp_traverse) ? __pyx_ptype_6gevent_19__abstract_linkable_AbstractLinkable->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_6gevent_6_event_AsyncResult)); if (e) return e; + if (p->_value) { + e = (*v)(p->_value, a); if (e) return e; + } + if (p->_exc_info) { + e = (*v)(p->_exc_info, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_6gevent_6_event_AsyncResult(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_6gevent_6_event_AsyncResult *p = (struct __pyx_obj_6gevent_6_event_AsyncResult *)o; + if (likely(__pyx_ptype_6gevent_19__abstract_linkable_AbstractLinkable)) { if (__pyx_ptype_6gevent_19__abstract_linkable_AbstractLinkable->tp_clear) __pyx_ptype_6gevent_19__abstract_linkable_AbstractLinkable->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_6gevent_6_event_AsyncResult); + tmp = ((PyObject*)p->_value); + p->_value = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->_exc_info); + p->_exc_info = ((PyObject*)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyObject *__pyx_getprop_6gevent_6_event_11AsyncResult__exception(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_6_event_11AsyncResult_10_exception_1__get__(o); +} + +static PyObject *__pyx_getprop_6gevent_6_event_11AsyncResult_value(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_6_event_11AsyncResult_5value_1__get__(o); +} + +static PyObject *__pyx_getprop_6gevent_6_event_11AsyncResult_exc_info(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_6_event_11AsyncResult_8exc_info_1__get__(o); +} + +static PyObject *__pyx_getprop_6gevent_6_event_11AsyncResult_exception(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_6_event_11AsyncResult_9exception_1__get__(o); +} + +static PyObject *__pyx_getprop_6gevent_6_event_11AsyncResult__value(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_6_event_11AsyncResult_6_value_1__get__(o); +} + +static PyObject *__pyx_getprop_6gevent_6_event_11AsyncResult__exc_info(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_6_event_11AsyncResult_9_exc_info_1__get__(o); +} + +static PyObject *__pyx_getprop_6gevent_6_event_11AsyncResult__imap_task_index(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_6_event_11AsyncResult_16_imap_task_index_1__get__(o); +} + +static int __pyx_setprop_6gevent_6_event_11AsyncResult__imap_task_index(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6gevent_6_event_11AsyncResult_16_imap_task_index_3__set__(o, v); + } + else { + PyErr_SetString(PyExc_NotImplementedError, "__del__"); + return -1; + } +} + +static PyMethodDef __pyx_methods_6gevent_6_event_AsyncResult[] = { + {"set", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_6_event_11AsyncResult_9set, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_6_event_11AsyncResult_8set}, + {"set_exception", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_6_event_11AsyncResult_11set_exception, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_6_event_11AsyncResult_10set_exception}, + {"_raise_exception", (PyCFunction)__pyx_pw_6gevent_6_event_11AsyncResult_13_raise_exception, METH_NOARGS, __pyx_doc_6gevent_6_event_11AsyncResult_12_raise_exception}, + {"get_nowait", (PyCFunction)__pyx_pw_6gevent_6_event_11AsyncResult_17get_nowait, METH_NOARGS, __pyx_doc_6gevent_6_event_11AsyncResult_16get_nowait}, + {"result", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_6_event_11AsyncResult_23result, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_6_event_11AsyncResult_22result}, + {0, 0, 0, 0} +}; + +static struct PyGetSetDef __pyx_getsets_6gevent_6_event_AsyncResult[] = { + {(char *)"_exception", __pyx_getprop_6gevent_6_event_11AsyncResult__exception, 0, (char *)0, 0}, + {(char *)"value", __pyx_getprop_6gevent_6_event_11AsyncResult_value, 0, (char *)"\n Holds the value passed to :meth:`set` if :meth:`set` was called. Otherwise,\n ``None``\n ", 0}, + {(char *)"exc_info", __pyx_getprop_6gevent_6_event_11AsyncResult_exc_info, 0, (char *)"\n The three-tuple of exception information if :meth:`set_exception` was called.\n ", 0}, + {(char *)"exception", __pyx_getprop_6gevent_6_event_11AsyncResult_exception, 0, (char *)"Holds the exception instance passed to :meth:`set_exception` if :meth:`set_exception` was called.\n Otherwise ``None``.", 0}, + {(char *)"_value", __pyx_getprop_6gevent_6_event_11AsyncResult__value, 0, (char *)0, 0}, + {(char *)"_exc_info", __pyx_getprop_6gevent_6_event_11AsyncResult__exc_info, 0, (char *)0, 0}, + {(char *)"_imap_task_index", __pyx_getprop_6gevent_6_event_11AsyncResult__imap_task_index, __pyx_setprop_6gevent_6_event_11AsyncResult__imap_task_index, (char *)"_imap_task_index: 'int'", 0}, + {0, 0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_6gevent_6_event_AsyncResult = { + PyVarObject_HEAD_INIT(0, 0) + "gevent._event.AsyncResult", /*tp_name*/ + sizeof(struct __pyx_obj_6gevent_6_event_AsyncResult), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6gevent_6_event_AsyncResult, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + __pyx_pw_6gevent_6_event_11AsyncResult_21__call__, /*tp_call*/ + __pyx_pw_6gevent_6_event_11AsyncResult_3__str__, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + "AsyncResult()\nA one-time event that stores a value or an exception.\n\n Like :class:`Event` it wakes up all the waiters when :meth:`set` or :meth:`set_exception`\n is called. Waiters may receive the passed value or exception by calling :meth:`get`\n instead of :meth:`wait`. An :class:`AsyncResult` instance cannot be reset.\n\n To pass a value call :meth:`set`. Calls to :meth:`get` (those that are currently blocking as well as\n those made in the future) will return the value:\n\n >>> result = AsyncResult()\n >>> result.set(100)\n >>> result.get()\n 100\n\n To pass an exception call :meth:`set_exception`. This will cause :meth:`get` to raise that exception:\n\n >>> result = AsyncResult()\n >>> result.set_exception(RuntimeError('failure'))\n >>> result.get()\n Traceback (most recent call last):\n ...\n RuntimeError: failure\n\n :class:`AsyncResult` implements :meth:`__call__` and thus can be used as :meth:`link` target:\n\n >>> import gevent\n >>> result = AsyncResult()\n >>> gevent.spawn(lambda : 1/0).link(result)\n >>> try:\n ... result.get()\n ... except ZeroDivisionError:\n ... print('ZeroDivisionError')\n ZeroDivisionError\n\n .. note::\n The order and timing in which waiting greenlets are awakened is not determined.\n As an implementation note, in gevent 1.1 and 1.0, waiting greenlets are awakened in a\n undetermined order sometime *after* the current greenlet yields to the event loop. Other greenlets\n (those not waiting to be awakened) may run between the current greenlet yielding and\n the waiting greenlets being awakened. These details may change in the future.\n\n .. versionchanged:: 1.1\n The exact order in which waiting greenlets are awakened is not the same\n as in 1.0.\n .. versionchanged:: 1.1\n Callbacks :meth:`linked ` to this"" object are required to be hashable, and duplicates are\n merged.\n ", /*tp_doc*/ + __pyx_tp_traverse_6gevent_6_event_AsyncResult, /*tp_traverse*/ + __pyx_tp_clear_6gevent_6_event_AsyncResult, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6gevent_6_event_AsyncResult, /*tp_methods*/ + 0, /*tp_members*/ + __pyx_getsets_6gevent_6_event_AsyncResult, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_pw_6gevent_6_event_11AsyncResult_1__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6gevent_6_event_AsyncResult, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static PyMethodDef __pyx_methods[] = { + {0, 0, 0, 0} +}; + +#if PY_MAJOR_VERSION >= 3 +#if CYTHON_PEP489_MULTI_PHASE_INIT +static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ +static int __pyx_pymod_exec__event(PyObject* module); /*proto*/ +static PyModuleDef_Slot __pyx_moduledef_slots[] = { + {Py_mod_create, (void*)__pyx_pymod_create}, + {Py_mod_exec, (void*)__pyx_pymod_exec__event}, + {0, NULL} +}; +#endif + +static struct PyModuleDef __pyx_moduledef = { + PyModuleDef_HEAD_INIT, + "_event", + __pyx_k_Basic_synchronization_primitives, /* m_doc */ + #if CYTHON_PEP489_MULTI_PHASE_INIT + 0, /* m_size */ + #else + -1, /* m_size */ + #endif + __pyx_methods /* m_methods */, + #if CYTHON_PEP489_MULTI_PHASE_INIT + __pyx_moduledef_slots, /* m_slots */ + #else + NULL, /* m_reload */ + #endif + NULL, /* m_traverse */ + NULL, /* m_clear */ + NULL /* m_free */ +}; +#endif +#ifndef CYTHON_SMALL_CODE +#if defined(__clang__) + #define CYTHON_SMALL_CODE +#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) + #define CYTHON_SMALL_CODE __attribute__((cold)) +#else + #define CYTHON_SMALL_CODE +#endif +#endif + +static __Pyx_StringTabEntry __pyx_string_tab[] = { + {&__pyx_n_s_AbstractLinkable, __pyx_k_AbstractLinkable, sizeof(__pyx_k_AbstractLinkable), 0, 0, 1, 1}, + {&__pyx_n_s_AsyncResult, __pyx_k_AsyncResult, sizeof(__pyx_k_AsyncResult), 0, 0, 1, 1}, + {&__pyx_n_s_AsyncResult__raise_exception, __pyx_k_AsyncResult__raise_exception, sizeof(__pyx_k_AsyncResult__raise_exception), 0, 0, 1, 1}, + {&__pyx_n_s_AsyncResult_cancel, __pyx_k_AsyncResult_cancel, sizeof(__pyx_k_AsyncResult_cancel), 0, 0, 1, 1}, + {&__pyx_n_s_AsyncResult_cancelled, __pyx_k_AsyncResult_cancelled, sizeof(__pyx_k_AsyncResult_cancelled), 0, 0, 1, 1}, + {&__pyx_n_s_AsyncResult_done, __pyx_k_AsyncResult_done, sizeof(__pyx_k_AsyncResult_done), 0, 0, 1, 1}, + {&__pyx_n_s_AsyncResult_get, __pyx_k_AsyncResult_get, sizeof(__pyx_k_AsyncResult_get), 0, 0, 1, 1}, + {&__pyx_n_s_AsyncResult_get_nowait, __pyx_k_AsyncResult_get_nowait, sizeof(__pyx_k_AsyncResult_get_nowait), 0, 0, 1, 1}, + {&__pyx_n_s_AsyncResult_ready, __pyx_k_AsyncResult_ready, sizeof(__pyx_k_AsyncResult_ready), 0, 0, 1, 1}, + {&__pyx_n_s_AsyncResult_result, __pyx_k_AsyncResult_result, sizeof(__pyx_k_AsyncResult_result), 0, 0, 1, 1}, + {&__pyx_n_s_AsyncResult_set, __pyx_k_AsyncResult_set, sizeof(__pyx_k_AsyncResult_set), 0, 0, 1, 1}, + {&__pyx_n_s_AsyncResult_set_exception, __pyx_k_AsyncResult_set_exception, sizeof(__pyx_k_AsyncResult_set_exception), 0, 0, 1, 1}, + {&__pyx_n_s_AsyncResult_successful, __pyx_k_AsyncResult_successful, sizeof(__pyx_k_AsyncResult_successful), 0, 0, 1, 1}, + {&__pyx_n_s_AsyncResult_wait, __pyx_k_AsyncResult_wait, sizeof(__pyx_k_AsyncResult_wait), 0, 0, 1, 1}, + {&__pyx_n_s_Event, __pyx_k_Event, sizeof(__pyx_k_Event), 0, 0, 1, 1}, + {&__pyx_n_s_Event__reset_internal_locks, __pyx_k_Event__reset_internal_locks, sizeof(__pyx_k_Event__reset_internal_locks), 0, 0, 1, 1}, + {&__pyx_n_s_Event_clear, __pyx_k_Event_clear, sizeof(__pyx_k_Event_clear), 0, 0, 1, 1}, + {&__pyx_n_s_Event_isSet, __pyx_k_Event_isSet, sizeof(__pyx_k_Event_isSet), 0, 0, 1, 1}, + {&__pyx_n_s_Event_is_set, __pyx_k_Event_is_set, sizeof(__pyx_k_Event_is_set), 0, 0, 1, 1}, + {&__pyx_n_s_Event_ready, __pyx_k_Event_ready, sizeof(__pyx_k_Event_ready), 0, 0, 1, 1}, + {&__pyx_n_s_Event_set, __pyx_k_Event_set, sizeof(__pyx_k_Event_set), 0, 0, 1, 1}, + {&__pyx_n_s_Event_wait, __pyx_k_Event_wait, sizeof(__pyx_k_Event_wait), 0, 0, 1, 1}, + {&__pyx_n_s_NONE, __pyx_k_NONE, sizeof(__pyx_k_NONE), 0, 0, 1, 1}, + {&__pyx_n_s_None, __pyx_k_None, sizeof(__pyx_k_None), 0, 0, 1, 1}, + {&__pyx_n_s_Timeout, __pyx_k_Timeout, sizeof(__pyx_k_Timeout), 0, 0, 1, 1}, + {&__pyx_n_s_abstract_linkable, __pyx_k_abstract_linkable, sizeof(__pyx_k_abstract_linkable), 0, 0, 1, 1}, + {&__pyx_n_s_all, __pyx_k_all, sizeof(__pyx_k_all), 0, 0, 1, 1}, + {&__pyx_n_s_block, __pyx_k_block, sizeof(__pyx_k_block), 0, 0, 1, 1}, + {&__pyx_n_s_cancel, __pyx_k_cancel, sizeof(__pyx_k_cancel), 0, 0, 1, 1}, + {&__pyx_n_s_cancelled, __pyx_k_cancelled, sizeof(__pyx_k_cancelled), 0, 0, 1, 1}, + {&__pyx_n_s_class, __pyx_k_class, sizeof(__pyx_k_class), 0, 0, 1, 1}, + {&__pyx_n_s_clear, __pyx_k_clear, sizeof(__pyx_k_clear), 0, 0, 1, 1}, + {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, + {&__pyx_n_s_done, __pyx_k_done, sizeof(__pyx_k_done), 0, 0, 1, 1}, + {&__pyx_n_s_dump_traceback, __pyx_k_dump_traceback, sizeof(__pyx_k_dump_traceback), 0, 0, 1, 1}, + {&__pyx_n_s_exc_info, __pyx_k_exc_info, sizeof(__pyx_k_exc_info), 0, 0, 1, 1}, + {&__pyx_n_s_exc_info_2, __pyx_k_exc_info_2, sizeof(__pyx_k_exc_info_2), 0, 0, 1, 1}, + {&__pyx_n_s_exception, __pyx_k_exception, sizeof(__pyx_k_exception), 0, 0, 1, 1}, + {&__pyx_n_s_exception_2, __pyx_k_exception_2, sizeof(__pyx_k_exception_2), 0, 0, 1, 1}, + {&__pyx_kp_s_exception_r, __pyx_k_exception_r, sizeof(__pyx_k_exception_r), 0, 0, 1, 0}, + {&__pyx_n_s_flag, __pyx_k_flag, sizeof(__pyx_k_flag), 0, 0, 1, 1}, + {&__pyx_n_s_get, __pyx_k_get, sizeof(__pyx_k_get), 0, 0, 1, 1}, + {&__pyx_n_s_get_linkable, __pyx_k_get_linkable, sizeof(__pyx_k_get_linkable), 0, 0, 1, 1}, + {&__pyx_n_s_get_nowait, __pyx_k_get_nowait, sizeof(__pyx_k_get_nowait), 0, 0, 1, 1}, + {&__pyx_kp_s_gevent__abstract_linkable, __pyx_k_gevent__abstract_linkable, sizeof(__pyx_k_gevent__abstract_linkable), 0, 0, 1, 0}, + {&__pyx_n_s_gevent__compat, __pyx_k_gevent__compat, sizeof(__pyx_k_gevent__compat), 0, 0, 1, 1}, + {&__pyx_n_s_gevent__event, __pyx_k_gevent__event, sizeof(__pyx_k_gevent__event), 0, 0, 1, 1}, + {&__pyx_n_s_gevent__tblib, __pyx_k_gevent__tblib, sizeof(__pyx_k_gevent__tblib), 0, 0, 1, 1}, + {&__pyx_n_s_gevent__util, __pyx_k_gevent__util, sizeof(__pyx_k_gevent__util), 0, 0, 1, 1}, + {&__pyx_n_s_gevent_timeout, __pyx_k_gevent_timeout, sizeof(__pyx_k_gevent_timeout), 0, 0, 1, 1}, + {&__pyx_kp_s_if_we_didn_t_wait_we_should_alre, __pyx_k_if_we_didn_t_wait_we_should_alre, sizeof(__pyx_k_if_we_didn_t_wait_we_should_alre), 0, 0, 1, 0}, + {&__pyx_n_s_imap_task_index, __pyx_k_imap_task_index, sizeof(__pyx_k_imap_task_index), 0, 0, 1, 1}, + {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, + {&__pyx_n_s_import_c_accel, __pyx_k_import_c_accel, sizeof(__pyx_k_import_c_accel), 0, 0, 1, 1}, + {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1}, + {&__pyx_n_s_isSet, __pyx_k_isSet, sizeof(__pyx_k_isSet), 0, 0, 1, 1}, + {&__pyx_n_s_is_set, __pyx_k_is_set, sizeof(__pyx_k_is_set), 0, 0, 1, 1}, + {&__pyx_n_s_linkcount, __pyx_k_linkcount, sizeof(__pyx_k_linkcount), 0, 0, 1, 1}, + {&__pyx_kp_s_links_s, __pyx_k_links_s, sizeof(__pyx_k_links_s), 0, 0, 1, 0}, + {&__pyx_n_s_load_traceback, __pyx_k_load_traceback, sizeof(__pyx_k_load_traceback), 0, 0, 1, 1}, + {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, + {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_capi, __pyx_k_pyx_capi, sizeof(__pyx_k_pyx_capi), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1}, + {&__pyx_n_s_raise_exception, __pyx_k_raise_exception, sizeof(__pyx_k_raise_exception), 0, 0, 1, 1}, + {&__pyx_n_s_ready, __pyx_k_ready, sizeof(__pyx_k_ready), 0, 0, 1, 1}, + {&__pyx_n_s_reraise, __pyx_k_reraise, sizeof(__pyx_k_reraise), 0, 0, 1, 1}, + {&__pyx_n_s_reset_internal_locks, __pyx_k_reset_internal_locks, sizeof(__pyx_k_reset_internal_locks), 0, 0, 1, 1}, + {&__pyx_n_s_result, __pyx_k_result, sizeof(__pyx_k_result), 0, 0, 1, 1}, + {&__pyx_kp_s_s, __pyx_k_s, sizeof(__pyx_k_s), 0, 0, 1, 0}, + {&__pyx_kp_s_s_s__links_s, __pyx_k_s_s__links_s, sizeof(__pyx_k_s_s__links_s), 0, 0, 1, 0}, + {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1}, + {&__pyx_n_s_set, __pyx_k_set, sizeof(__pyx_k_set), 0, 0, 1, 1}, + {&__pyx_n_s_set_exception, __pyx_k_set_exception, sizeof(__pyx_k_set_exception), 0, 0, 1, 1}, + {&__pyx_n_s_set_result, __pyx_k_set_result, sizeof(__pyx_k_set_result), 0, 0, 1, 1}, + {&__pyx_n_s_slots, __pyx_k_slots, sizeof(__pyx_k_slots), 0, 0, 1, 1}, + {&__pyx_n_s_source, __pyx_k_source, sizeof(__pyx_k_source), 0, 0, 1, 1}, + {&__pyx_kp_s_src_gevent_event_py, __pyx_k_src_gevent_event_py, sizeof(__pyx_k_src_gevent_event_py), 0, 0, 1, 0}, + {&__pyx_n_s_successful, __pyx_k_successful, sizeof(__pyx_k_successful), 0, 0, 1, 1}, + {&__pyx_n_s_super, __pyx_k_super, sizeof(__pyx_k_super), 0, 0, 1, 1}, + {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, + {&__pyx_n_s_timeout, __pyx_k_timeout, sizeof(__pyx_k_timeout), 0, 0, 1, 1}, + {&__pyx_kp_s_unset, __pyx_k_unset, sizeof(__pyx_k_unset), 0, 0, 1, 0}, + {&__pyx_n_s_value, __pyx_k_value, sizeof(__pyx_k_value), 0, 0, 1, 1}, + {&__pyx_n_s_value_2, __pyx_k_value_2, sizeof(__pyx_k_value_2), 0, 0, 1, 1}, + {&__pyx_kp_s_value_r, __pyx_k_value_r, sizeof(__pyx_k_value_r), 0, 0, 1, 0}, + {&__pyx_n_s_wait, __pyx_k_wait, sizeof(__pyx_k_wait), 0, 0, 1, 1}, + {&__pyx_n_s_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 0, 1, 1}, + {0, 0, 0, 0, 0, 0, 0} +}; +static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { + __pyx_builtin___import__ = __Pyx_GetBuiltinName(__pyx_n_s_import); if (!__pyx_builtin___import__) __PYX_ERR(0, 20, __pyx_L1_error) + __pyx_builtin_super = __Pyx_GetBuiltinName(__pyx_n_s_super); if (!__pyx_builtin_super) __PYX_ERR(0, 49, __pyx_L1_error) + return 0; + __pyx_L1_error:; + return -1; +} + +static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); + + /* "src/gevent/event.py":20 + * + * def _get_linkable(): + * x = __import__('gevent._abstract_linkable') # <<<<<<<<<<<<<< + * return x._abstract_linkable.AbstractLinkable + * locals()['AbstractLinkable'] = _get_linkable() + */ + __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_gevent__abstract_linkable); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 20, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple_); + __Pyx_GIVEREF(__pyx_tuple_); + + /* "src/gevent/event.py":19 + * ] + * + * def _get_linkable(): # <<<<<<<<<<<<<< + * x = __import__('gevent._abstract_linkable') + * return x._abstract_linkable.AbstractLinkable + */ + __pyx_tuple__2 = PyTuple_Pack(1, __pyx_n_s_x); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 19, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2); + __Pyx_GIVEREF(__pyx_tuple__2); + __pyx_codeobj__3 = (PyObject*)__Pyx_PyCode_New(0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_event_py, __pyx_n_s_get_linkable, 19, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__3)) __PYX_ERR(0, 19, __pyx_L1_error) + + /* "src/gevent/event.py":46 + * """ + * + * __slots__ = ('_flag',) # <<<<<<<<<<<<<< + * + * def __init__(self): + */ + __pyx_tuple__4 = PyTuple_Pack(1, __pyx_n_s_flag); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 46, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__4); + __Pyx_GIVEREF(__pyx_tuple__4); + + /* "src/gevent/event.py":56 + * self.linkcount()) + * + * def is_set(self): # <<<<<<<<<<<<<< + * """Return true if and only if the internal flag is true.""" + * return self._flag + */ + __pyx_tuple__5 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 56, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__5); + __Pyx_GIVEREF(__pyx_tuple__5); + __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__5, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_event_py, __pyx_n_s_is_set, 56, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__6)) __PYX_ERR(0, 56, __pyx_L1_error) + + /* "src/gevent/event.py":60 + * return self._flag + * + * def isSet(self): # <<<<<<<<<<<<<< + * # makes it a better drop-in replacement for threading.Event + * return self._flag + */ + __pyx_tuple__7 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 60, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__7); + __Pyx_GIVEREF(__pyx_tuple__7); + __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_event_py, __pyx_n_s_isSet, 60, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) __PYX_ERR(0, 60, __pyx_L1_error) + + /* "src/gevent/event.py":64 + * return self._flag + * + * def ready(self): # <<<<<<<<<<<<<< + * # makes it compatible with AsyncResult and Greenlet (for + * # example in wait()) + */ + __pyx_tuple__9 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 64, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__9); + __Pyx_GIVEREF(__pyx_tuple__9); + __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__9, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_event_py, __pyx_n_s_ready, 64, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__10)) __PYX_ERR(0, 64, __pyx_L1_error) + + /* "src/gevent/event.py":69 + * return self._flag + * + * def set(self): # <<<<<<<<<<<<<< + * """ + * Set the internal flag to true. + */ + __pyx_tuple__11 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 69, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__11); + __Pyx_GIVEREF(__pyx_tuple__11); + __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__11, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_event_py, __pyx_n_s_set, 69, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(0, 69, __pyx_L1_error) + + /* "src/gevent/event.py":81 + * self._check_and_notify() + * + * def clear(self): # <<<<<<<<<<<<<< + * """ + * Reset the internal flag to false. + */ + __pyx_tuple__13 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 81, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__13); + __Pyx_GIVEREF(__pyx_tuple__13); + __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__13, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_event_py, __pyx_n_s_clear, 81, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__14)) __PYX_ERR(0, 81, __pyx_L1_error) + + /* "src/gevent/event.py":102 + * return wait_success + * + * def wait(self, timeout=None): # <<<<<<<<<<<<<< + * """ + * Block until the internal flag is true. + */ + __pyx_tuple__15 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_timeout); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(0, 102, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__15); + __Pyx_GIVEREF(__pyx_tuple__15); + __pyx_codeobj__16 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__15, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_event_py, __pyx_n_s_wait, 102, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__16)) __PYX_ERR(0, 102, __pyx_L1_error) + + /* "src/gevent/event.py":129 + * return self._wait(timeout) + * + * def _reset_internal_locks(self): # pragma: no cover # <<<<<<<<<<<<<< + * # for compatibility with threading.Event + * # Exception AttributeError: AttributeError("'Event' object has no attribute '_reset_internal_locks'",) + */ + __pyx_tuple__17 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(0, 129, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__17); + __Pyx_GIVEREF(__pyx_tuple__17); + __pyx_codeobj__18 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__17, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_event_py, __pyx_n_s_reset_internal_locks, 129, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__18)) __PYX_ERR(0, 129, __pyx_L1_error) + + /* "src/gevent/event.py":186 + * """ + * + * __slots__ = ('_value', '_exc_info', '_imap_task_index') # <<<<<<<<<<<<<< + * + * def __init__(self): + */ + __pyx_tuple__19 = PyTuple_Pack(3, __pyx_n_s_value_2, __pyx_n_s_exc_info_2, __pyx_n_s_imap_task_index); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(0, 186, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__19); + __Pyx_GIVEREF(__pyx_tuple__19); + + /* "src/gevent/event.py":224 + * return result + ' _links[%s]>' % self.linkcount() + * + * def ready(self): # <<<<<<<<<<<<<< + * """Return true if and only if it holds a value or an exception""" + * return self._exc_info or self._value is not _NONE + */ + __pyx_tuple__20 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(0, 224, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__20); + __Pyx_GIVEREF(__pyx_tuple__20); + __pyx_codeobj__21 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__20, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_event_py, __pyx_n_s_ready, 224, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__21)) __PYX_ERR(0, 224, __pyx_L1_error) + + /* "src/gevent/event.py":228 + * return self._exc_info or self._value is not _NONE + * + * def successful(self): # <<<<<<<<<<<<<< + * """Return true if and only if it is ready and holds a value""" + * return self._value is not _NONE + */ + __pyx_tuple__22 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(0, 228, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__22); + __Pyx_GIVEREF(__pyx_tuple__22); + __pyx_codeobj__23 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__22, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_event_py, __pyx_n_s_successful, 228, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__23)) __PYX_ERR(0, 228, __pyx_L1_error) + + /* "src/gevent/event.py":239 + * return self._exc_info[1] + * + * def set(self, value=None): # <<<<<<<<<<<<<< + * """Store the value and wake up any waiters. + * + */ + __pyx_tuple__24 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_value); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(0, 239, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__24); + __Pyx_GIVEREF(__pyx_tuple__24); + __pyx_codeobj__25 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__24, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_event_py, __pyx_n_s_set, 239, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__25)) __PYX_ERR(0, 239, __pyx_L1_error) + + /* "src/gevent/event.py":248 + * self._check_and_notify() + * + * def set_exception(self, exception, exc_info=None): # <<<<<<<<<<<<<< + * """Store the exception and wake up any waiters. + * + */ + __pyx_tuple__26 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_exception_2, __pyx_n_s_exc_info); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(0, 248, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__26); + __Pyx_GIVEREF(__pyx_tuple__26); + __pyx_codeobj__27 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__26, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_event_py, __pyx_n_s_set_exception, 248, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__27)) __PYX_ERR(0, 248, __pyx_L1_error) + + /* "src/gevent/event.py":265 + * self._check_and_notify() + * + * def _raise_exception(self): # <<<<<<<<<<<<<< + * reraise(*self.exc_info) + * + */ + __pyx_tuple__28 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(0, 265, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__28); + __Pyx_GIVEREF(__pyx_tuple__28); + __pyx_codeobj__29 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__28, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_event_py, __pyx_n_s_raise_exception, 265, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__29)) __PYX_ERR(0, 265, __pyx_L1_error) + + /* "src/gevent/event.py":268 + * reraise(*self.exc_info) + * + * def get(self, block=True, timeout=None): # <<<<<<<<<<<<<< + * """Return the stored value or raise the exception. + * + */ + __pyx_tuple__30 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_block, __pyx_n_s_timeout); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(0, 268, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__30); + __Pyx_GIVEREF(__pyx_tuple__30); + __pyx_codeobj__31 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__30, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_event_py, __pyx_n_s_get, 268, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__31)) __PYX_ERR(0, 268, __pyx_L1_error) + + /* "src/gevent/event.py":298 + * return self.get(block=False) + * + * def get_nowait(self): # <<<<<<<<<<<<<< + * """ + * Return the value or raise the exception without blocking. + */ + __pyx_tuple__32 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(0, 298, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__32); + __Pyx_GIVEREF(__pyx_tuple__32); + __pyx_codeobj__33 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__32, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_event_py, __pyx_n_s_get_nowait, 298, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__33)) __PYX_ERR(0, 298, __pyx_L1_error) + + /* "src/gevent/event.py":313 + * return self.value + * + * def wait(self, timeout=None): # <<<<<<<<<<<<<< + * """Block until the instance is ready. + * + */ + __pyx_tuple__34 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_timeout); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(0, 313, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__34); + __Pyx_GIVEREF(__pyx_tuple__34); + __pyx_codeobj__35 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__34, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_event_py, __pyx_n_s_wait, 313, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__35)) __PYX_ERR(0, 313, __pyx_L1_error) + + /* "src/gevent/event.py":343 + * # Methods to make us more like concurrent.futures.Future + * + * def result(self, timeout=None): # <<<<<<<<<<<<<< + * return self.get(timeout=timeout) + * + */ + __pyx_tuple__36 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_timeout); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(0, 343, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__36); + __Pyx_GIVEREF(__pyx_tuple__36); + __pyx_codeobj__37 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__36, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_event_py, __pyx_n_s_result, 343, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__37)) __PYX_ERR(0, 343, __pyx_L1_error) + + /* "src/gevent/event.py":348 + * set_result = set + * + * def done(self): # <<<<<<<<<<<<<< + * return self.ready() + * + */ + __pyx_tuple__38 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(0, 348, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__38); + __Pyx_GIVEREF(__pyx_tuple__38); + __pyx_codeobj__39 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__38, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_event_py, __pyx_n_s_done, 348, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__39)) __PYX_ERR(0, 348, __pyx_L1_error) + + /* "src/gevent/event.py":353 + * # we don't support cancelling + * + * def cancel(self): # <<<<<<<<<<<<<< + * return False + * + */ + __pyx_tuple__40 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__40)) __PYX_ERR(0, 353, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__40); + __Pyx_GIVEREF(__pyx_tuple__40); + __pyx_codeobj__41 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_event_py, __pyx_n_s_cancel, 353, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__41)) __PYX_ERR(0, 353, __pyx_L1_error) + + /* "src/gevent/event.py":356 + * return False + * + * def cancelled(self): # <<<<<<<<<<<<<< + * return False + * + */ + __pyx_tuple__42 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(0, 356, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__42); + __Pyx_GIVEREF(__pyx_tuple__42); + __pyx_codeobj__43 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__42, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_event_py, __pyx_n_s_cancelled, 356, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__43)) __PYX_ERR(0, 356, __pyx_L1_error) + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} + +static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { + if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + return 0; + __pyx_L1_error:; + return -1; +} + +static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/ + +static int __Pyx_modinit_global_init_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); + /*--- Global init code ---*/ + __pyx_v_6gevent_6_event__None = Py_None; Py_INCREF(Py_None); + __pyx_v_6gevent_6_event_reraise = Py_None; Py_INCREF(Py_None); + __pyx_v_6gevent_6_event_dump_traceback = Py_None; Py_INCREF(Py_None); + __pyx_v_6gevent_6_event_load_traceback = Py_None; Py_INCREF(Py_None); + __pyx_v_6gevent_6_event_Timeout = Py_None; Py_INCREF(Py_None); + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_variable_export_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); + /*--- Variable export code ---*/ + if (__Pyx_ExportVoidPtr(__pyx_n_s_None, (void *)&__pyx_v_6gevent_6_event__None, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportVoidPtr(__pyx_n_s_reraise, (void *)&__pyx_v_6gevent_6_event_reraise, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportVoidPtr(__pyx_n_s_dump_traceback, (void *)&__pyx_v_6gevent_6_event_dump_traceback, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportVoidPtr(__pyx_n_s_load_traceback, (void *)&__pyx_v_6gevent_6_event_load_traceback, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportVoidPtr(__pyx_n_s_Timeout, (void *)&__pyx_v_6gevent_6_event_Timeout, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_modinit_function_export_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); + /*--- Function export code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_type_init_code(void) { + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); + /*--- Type init code ---*/ + __pyx_t_1 = PyImport_ImportModule("gevent.__abstract_linkable"); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_ptype_6gevent_19__abstract_linkable_AbstractLinkable = __Pyx_ImportType(__pyx_t_1, "gevent.__abstract_linkable", "AbstractLinkable", sizeof(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_19__abstract_linkable_AbstractLinkable) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_vtabptr_6gevent_19__abstract_linkable_AbstractLinkable = (struct __pyx_vtabstruct_6gevent_19__abstract_linkable_AbstractLinkable*)__Pyx_GetVtable(__pyx_ptype_6gevent_19__abstract_linkable_AbstractLinkable->tp_dict); if (unlikely(!__pyx_vtabptr_6gevent_19__abstract_linkable_AbstractLinkable)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_vtabptr_6gevent_6_event_Event = &__pyx_vtable_6gevent_6_event_Event; + __pyx_vtable_6gevent_6_event_Event.__pyx_base = *__pyx_vtabptr_6gevent_19__abstract_linkable_AbstractLinkable; + __pyx_vtable_6gevent_6_event_Event.__pyx_base.ready = (int (*)(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *, int __pyx_skip_dispatch))__pyx_f_6gevent_6_event_5Event_ready; + __pyx_vtable_6gevent_6_event_Event.__pyx_base._wait_return_value = (PyObject *(*)(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *, PyObject *, PyObject *))__pyx_f_6gevent_6_event_5Event__wait_return_value; + __pyx_type_6gevent_6_event_Event.tp_base = __pyx_ptype_6gevent_19__abstract_linkable_AbstractLinkable; + if (PyType_Ready(&__pyx_type_6gevent_6_event_Event) < 0) __PYX_ERR(0, 30, __pyx_L1_error) + __pyx_type_6gevent_6_event_Event.tp_print = 0; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6gevent_6_event_Event.tp_dictoffset && __pyx_type_6gevent_6_event_Event.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_type_6gevent_6_event_Event.tp_getattro = __Pyx_PyObject_GenericGetAttr; + } + if (__Pyx_SetVtable(__pyx_type_6gevent_6_event_Event.tp_dict, __pyx_vtabptr_6gevent_6_event_Event) < 0) __PYX_ERR(0, 30, __pyx_L1_error) + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Event, (PyObject *)&__pyx_type_6gevent_6_event_Event) < 0) __PYX_ERR(0, 30, __pyx_L1_error) + if (__pyx_type_6gevent_6_event_Event.tp_weaklistoffset == 0) __pyx_type_6gevent_6_event_Event.tp_weaklistoffset = offsetof(struct __pyx_obj_6gevent_6_event_Event, __pyx_base.__weakref__); + __pyx_ptype_6gevent_6_event_Event = &__pyx_type_6gevent_6_event_Event; + __pyx_vtabptr_6gevent_6_event_AsyncResult = &__pyx_vtable_6gevent_6_event_AsyncResult; + __pyx_vtable_6gevent_6_event_AsyncResult.__pyx_base = *__pyx_vtabptr_6gevent_19__abstract_linkable_AbstractLinkable; + __pyx_vtable_6gevent_6_event_AsyncResult.__pyx_base.ready = (int (*)(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *, int __pyx_skip_dispatch))__pyx_f_6gevent_6_event_11AsyncResult_ready; + __pyx_vtable_6gevent_6_event_AsyncResult.__pyx_base._wait_return_value = (PyObject *(*)(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *, PyObject *, PyObject *))__pyx_f_6gevent_6_event_11AsyncResult__wait_return_value; + __pyx_vtable_6gevent_6_event_AsyncResult.get = (PyObject *(*)(struct __pyx_obj_6gevent_6_event_AsyncResult *, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_6_event_11AsyncResult_get *__pyx_optional_args))__pyx_f_6gevent_6_event_11AsyncResult_get; + __pyx_vtable_6gevent_6_event_AsyncResult.successful = (int (*)(struct __pyx_obj_6gevent_6_event_AsyncResult *, int __pyx_skip_dispatch))__pyx_f_6gevent_6_event_11AsyncResult_successful; + __pyx_vtable_6gevent_6_event_AsyncResult.wait = (PyObject *(*)(struct __pyx_obj_6gevent_6_event_AsyncResult *, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_6_event_11AsyncResult_wait *__pyx_optional_args))__pyx_f_6gevent_6_event_11AsyncResult_wait; + __pyx_vtable_6gevent_6_event_AsyncResult.done = (int (*)(struct __pyx_obj_6gevent_6_event_AsyncResult *, int __pyx_skip_dispatch))__pyx_f_6gevent_6_event_11AsyncResult_done; + __pyx_vtable_6gevent_6_event_AsyncResult.cancel = (int (*)(struct __pyx_obj_6gevent_6_event_AsyncResult *, int __pyx_skip_dispatch))__pyx_f_6gevent_6_event_11AsyncResult_cancel; + __pyx_vtable_6gevent_6_event_AsyncResult.cancelled = (int (*)(struct __pyx_obj_6gevent_6_event_AsyncResult *, int __pyx_skip_dispatch))__pyx_f_6gevent_6_event_11AsyncResult_cancelled; + __pyx_type_6gevent_6_event_AsyncResult.tp_base = __pyx_ptype_6gevent_19__abstract_linkable_AbstractLinkable; + if (PyType_Ready(&__pyx_type_6gevent_6_event_AsyncResult) < 0) __PYX_ERR(0, 136, __pyx_L1_error) + __pyx_type_6gevent_6_event_AsyncResult.tp_print = 0; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6gevent_6_event_AsyncResult.tp_dictoffset && __pyx_type_6gevent_6_event_AsyncResult.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_type_6gevent_6_event_AsyncResult.tp_getattro = __Pyx_PyObject_GenericGetAttr; + } + if (__Pyx_SetVtable(__pyx_type_6gevent_6_event_AsyncResult.tp_dict, __pyx_vtabptr_6gevent_6_event_AsyncResult) < 0) __PYX_ERR(0, 136, __pyx_L1_error) + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_AsyncResult, (PyObject *)&__pyx_type_6gevent_6_event_AsyncResult) < 0) __PYX_ERR(0, 136, __pyx_L1_error) + if (__pyx_type_6gevent_6_event_AsyncResult.tp_weaklistoffset == 0) __pyx_type_6gevent_6_event_AsyncResult.tp_weaklistoffset = offsetof(struct __pyx_obj_6gevent_6_event_AsyncResult, __pyx_base.__weakref__); + __pyx_ptype_6gevent_6_event_AsyncResult = &__pyx_type_6gevent_6_event_AsyncResult; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_modinit_type_import_code(void) { + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); + /*--- Type import code ---*/ + __pyx_t_1 = PyImport_ImportModule("greenlet"); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_ptype_6gevent_21__greenlet_primitives_greenlet = __Pyx_ImportType(__pyx_t_1, "greenlet", "greenlet", sizeof(PyGreenlet), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_21__greenlet_primitives_greenlet) __PYX_ERR(2, 12, __pyx_L1_error) + __pyx_t_2 = PyImport_ImportModule("gevent.__greenlet_primitives"); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 37, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_ptype_6gevent_21__greenlet_primitives_TrackedRawGreenlet = __Pyx_ImportType(__pyx_t_2, "gevent.__greenlet_primitives", "TrackedRawGreenlet", sizeof(struct __pyx_obj_6gevent_21__greenlet_primitives_TrackedRawGreenlet), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_21__greenlet_primitives_TrackedRawGreenlet) __PYX_ERR(2, 37, __pyx_L1_error) + __pyx_ptype_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop = __Pyx_ImportType(__pyx_t_2, "gevent.__greenlet_primitives", "SwitchOutGreenletWithLoop", sizeof(struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop) __PYX_ERR(2, 40, __pyx_L1_error) + __pyx_vtabptr_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop = (struct __pyx_vtabstruct_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop*)__Pyx_GetVtable(__pyx_ptype_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop->tp_dict); if (unlikely(!__pyx_vtabptr_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop)) __PYX_ERR(2, 40, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyImport_ImportModule("greenlet"); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_ptype_6gevent_19__abstract_linkable_greenlet = __Pyx_ImportType(__pyx_t_2, "greenlet", "greenlet", sizeof(PyGreenlet), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_19__abstract_linkable_greenlet) __PYX_ERR(3, 12, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_modinit_variable_import_code(void) { + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); + /*--- Variable import code ---*/ + __pyx_t_1 = PyImport_ImportModule("gevent.__greenlet_primitives"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_1, "get_objects", (void **)&__pyx_vp_6gevent_21__greenlet_primitives_get_objects, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_1, "wref", (void **)&__pyx_vp_6gevent_21__greenlet_primitives_wref, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_1, "BlockingSwitchOutError", (void **)&__pyx_vp_6gevent_21__greenlet_primitives_BlockingSwitchOutError, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_1, "_greenlet_imported", (void **)&__pyx_vp_6gevent_21__greenlet_primitives__greenlet_imported, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + Py_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_2 = PyImport_ImportModule("gevent.__hub_local"); if (!__pyx_t_2) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_2, "_threadlocal", (void **)&__pyx_vp_6gevent_11__hub_local__threadlocal, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + Py_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_3 = PyImport_ImportModule("gevent.__abstract_linkable"); if (!__pyx_t_3) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_3, "InvalidSwitchError", (void **)&__pyx_vp_6gevent_19__abstract_linkable_InvalidSwitchError, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_3, "Timeout", (void **)&__pyx_vp_6gevent_19__abstract_linkable_Timeout, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_3, "_greenlet_imported", (void **)&__pyx_vp_6gevent_19__abstract_linkable__greenlet_imported, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + Py_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_modinit_function_import_code(void) { + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); + /*--- Function import code ---*/ + __pyx_t_1 = PyImport_ImportModule("gevent.__hub_local"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportFunction(__pyx_t_1, "get_hub_noargs", (void (**)(void))&__pyx_f_6gevent_11__hub_local_get_hub_noargs, "struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *(int __pyx_skip_dispatch)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + Py_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_RefNannyFinishContext(); + return -1; +} + + +#if PY_MAJOR_VERSION < 3 +#ifdef CYTHON_NO_PYINIT_EXPORT +#define __Pyx_PyMODINIT_FUNC void +#else +#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC +#endif +#else +#ifdef CYTHON_NO_PYINIT_EXPORT +#define __Pyx_PyMODINIT_FUNC PyObject * +#else +#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC +#endif +#endif + + +#if PY_MAJOR_VERSION < 3 +__Pyx_PyMODINIT_FUNC init_event(void) CYTHON_SMALL_CODE; /*proto*/ +__Pyx_PyMODINIT_FUNC init_event(void) +#else +__Pyx_PyMODINIT_FUNC PyInit__event(void) CYTHON_SMALL_CODE; /*proto*/ +__Pyx_PyMODINIT_FUNC PyInit__event(void) +#if CYTHON_PEP489_MULTI_PHASE_INIT +{ + return PyModuleDef_Init(&__pyx_moduledef); +} +static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { + #if PY_VERSION_HEX >= 0x030700A1 + static PY_INT64_T main_interpreter_id = -1; + PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); + if (main_interpreter_id == -1) { + main_interpreter_id = current_id; + return (unlikely(current_id == -1)) ? -1 : 0; + } else if (unlikely(main_interpreter_id != current_id)) + #else + static PyInterpreterState *main_interpreter = NULL; + PyInterpreterState *current_interpreter = PyThreadState_Get()->interp; + if (!main_interpreter) { + main_interpreter = current_interpreter; + } else if (unlikely(main_interpreter != current_interpreter)) + #endif + { + PyErr_SetString( + PyExc_ImportError, + "Interpreter change detected - this module can only be loaded into one interpreter per process."); + return -1; + } + return 0; +} +static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) { + PyObject *value = PyObject_GetAttrString(spec, from_name); + int result = 0; + if (likely(value)) { + if (allow_none || value != Py_None) { + result = PyDict_SetItemString(moddict, to_name, value); + } + Py_DECREF(value); + } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_Clear(); + } else { + result = -1; + } + return result; +} +static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) { + PyObject *module = NULL, *moddict, *modname; + if (__Pyx_check_single_interpreter()) + return NULL; + if (__pyx_m) + return __Pyx_NewRef(__pyx_m); + modname = PyObject_GetAttrString(spec, "name"); + if (unlikely(!modname)) goto bad; + module = PyModule_NewObject(modname); + Py_DECREF(modname); + if (unlikely(!module)) goto bad; + moddict = PyModule_GetDict(module); + if (unlikely(!moddict)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad; + return module; +bad: + Py_XDECREF(module); + return NULL; +} + + +static CYTHON_SMALL_CODE int __pyx_pymod_exec__event(PyObject *__pyx_pyinit_module) +#endif +#endif +{ + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannyDeclarations + #if CYTHON_PEP489_MULTI_PHASE_INIT + if (__pyx_m) { + if (__pyx_m == __pyx_pyinit_module) return 0; + PyErr_SetString(PyExc_RuntimeError, "Module '_event' has already been imported. Re-initialisation is not supported."); + return -1; + } + #elif PY_MAJOR_VERSION >= 3 + if (__pyx_m) return __Pyx_NewRef(__pyx_m); + #endif + #if CYTHON_REFNANNY +__Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); +if (!__Pyx_RefNanny) { + PyErr_Clear(); + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); + if (!__Pyx_RefNanny) + Py_FatalError("failed to import 'refnanny' module"); +} +#endif + __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit__event(void)", 0); + if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #ifdef __Pxy_PyFrame_Initialize_Offsets + __Pxy_PyFrame_Initialize_Offsets(); + #endif + __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) + #ifdef __Pyx_CyFunction_USED + if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_FusedFunction_USED + if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_Coroutine_USED + if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_Generator_USED + if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_AsyncGen_USED + if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_StopAsyncIteration_USED + if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + /*--- Library function declarations ---*/ + /*--- Threads initialization code ---*/ + #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS + #ifdef WITH_THREAD /* Python build with threading support? */ + PyEval_InitThreads(); + #endif + #endif + /*--- Module creation code ---*/ + #if CYTHON_PEP489_MULTI_PHASE_INIT + __pyx_m = __pyx_pyinit_module; + Py_INCREF(__pyx_m); + #else + #if PY_MAJOR_VERSION < 3 + __pyx_m = Py_InitModule4("_event", __pyx_methods, __pyx_k_Basic_synchronization_primitives, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); + #else + __pyx_m = PyModule_Create(&__pyx_moduledef); + #endif + if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) + Py_INCREF(__pyx_d); + __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) + #if CYTHON_COMPILING_IN_PYPY + Py_INCREF(__pyx_b); + #endif + if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + /*--- Initialize various global constants etc. ---*/ + if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) + if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + if (__pyx_module_is_main_gevent___event) { + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + } + #if PY_MAJOR_VERSION >= 3 + { + PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) + if (!PyDict_GetItemString(modules, "gevent._event")) { + if (unlikely(PyDict_SetItemString(modules, "gevent._event", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error) + } + } + #endif + /*--- Builtin init code ---*/ + if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + /*--- Constants init code ---*/ + if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + /*--- Global type/function init code ---*/ + (void)__Pyx_modinit_global_init_code(); + if (unlikely(__Pyx_modinit_variable_export_code() != 0)) goto __pyx_L1_error; + (void)__Pyx_modinit_function_export_code(); + if (unlikely(__Pyx_modinit_type_init_code() != 0)) goto __pyx_L1_error; + if (unlikely(__Pyx_modinit_type_import_code() != 0)) goto __pyx_L1_error; + if (unlikely(__Pyx_modinit_variable_import_code() != 0)) goto __pyx_L1_error; + if (unlikely(__Pyx_modinit_function_import_code() != 0)) goto __pyx_L1_error; + /*--- Execution code ---*/ + #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) + if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + + /* "src/gevent/event.py":7 + * from __future__ import print_function + * + * from gevent._util import _NONE # <<<<<<<<<<<<<< + * from gevent._compat import reraise + * from gevent._tblib import dump_traceback, load_traceback + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_NONE); + __Pyx_GIVEREF(__pyx_n_s_NONE); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_NONE); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_gevent__util, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_NONE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_NONE, __pyx_t_1) < 0) __PYX_ERR(0, 7, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/event.py":8 + * + * from gevent._util import _NONE + * from gevent._compat import reraise # <<<<<<<<<<<<<< + * from gevent._tblib import dump_traceback, load_traceback + * + */ + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_reraise); + __Pyx_GIVEREF(__pyx_n_s_reraise); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_reraise); + __pyx_t_1 = __Pyx_Import(__pyx_n_s_gevent__compat, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 8, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_reraise); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_v_6gevent_6_event_reraise); + __Pyx_DECREF_SET(__pyx_v_6gevent_6_event_reraise, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/event.py":9 + * from gevent._util import _NONE + * from gevent._compat import reraise + * from gevent._tblib import dump_traceback, load_traceback # <<<<<<<<<<<<<< + * + * from gevent.timeout import Timeout + */ + __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 9, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_dump_traceback); + __Pyx_GIVEREF(__pyx_n_s_dump_traceback); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_dump_traceback); + __Pyx_INCREF(__pyx_n_s_load_traceback); + __Pyx_GIVEREF(__pyx_n_s_load_traceback); + PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_load_traceback); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_gevent__tblib, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_dump_traceback); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 9, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_v_6gevent_6_event_dump_traceback); + __Pyx_DECREF_SET(__pyx_v_6gevent_6_event_dump_traceback, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_load_traceback); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 9, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_v_6gevent_6_event_load_traceback); + __Pyx_DECREF_SET(__pyx_v_6gevent_6_event_load_traceback, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/event.py":11 + * from gevent._tblib import dump_traceback, load_traceback + * + * from gevent.timeout import Timeout # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 11, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_Timeout); + __Pyx_GIVEREF(__pyx_n_s_Timeout); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_Timeout); + __pyx_t_1 = __Pyx_Import(__pyx_n_s_gevent_timeout, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 11, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_Timeout); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 11, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_v_6gevent_6_event_Timeout); + __Pyx_DECREF_SET(__pyx_v_6gevent_6_event_Timeout, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/event.py":14 + * + * + * __all__ = [ # <<<<<<<<<<<<<< + * 'Event', + * 'AsyncResult', + */ + __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 14, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_Event); + __Pyx_GIVEREF(__pyx_n_s_Event); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_Event); + __Pyx_INCREF(__pyx_n_s_AsyncResult); + __Pyx_GIVEREF(__pyx_n_s_AsyncResult); + PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_AsyncResult); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_all, __pyx_t_1) < 0) __PYX_ERR(0, 14, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/event.py":19 + * ] + * + * def _get_linkable(): # <<<<<<<<<<<<<< + * x = __import__('gevent._abstract_linkable') + * return x._abstract_linkable.AbstractLinkable + */ + __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_event_1_get_linkable, 0, __pyx_n_s_get_linkable, NULL, __pyx_n_s_gevent__event, __pyx_d, ((PyObject *)__pyx_codeobj__3)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 19, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_linkable, __pyx_t_1) < 0) __PYX_ERR(0, 19, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/event.py":22 + * x = __import__('gevent._abstract_linkable') + * return x._abstract_linkable.AbstractLinkable + * locals()['AbstractLinkable'] = _get_linkable() # <<<<<<<<<<<<<< + * del _get_linkable + * + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_get_linkable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 22, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 22, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_Globals(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 22, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (unlikely(PyDict_SetItem(__pyx_t_1, __pyx_n_s_AbstractLinkable, __pyx_t_2) < 0)) __PYX_ERR(0, 22, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/event.py":23 + * return x._abstract_linkable.AbstractLinkable + * locals()['AbstractLinkable'] = _get_linkable() + * del _get_linkable # <<<<<<<<<<<<<< + * + * # Sadly, something about the way we have to "import" AbstractLinkable + */ + if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_get_linkable) < 0) __PYX_ERR(0, 23, __pyx_L1_error) + + /* "src/gevent/event.py":46 + * """ + * + * __slots__ = ('_flag',) # <<<<<<<<<<<<<< + * + * def __init__(self): + */ + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_event_Event->tp_dict, __pyx_n_s_slots, __pyx_tuple__4) < 0) __PYX_ERR(0, 46, __pyx_L1_error) + PyType_Modified(__pyx_ptype_6gevent_6_event_Event); + + /* "src/gevent/event.py":56 + * self.linkcount()) + * + * def is_set(self): # <<<<<<<<<<<<<< + * """Return true if and only if the internal flag is true.""" + * return self._flag + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_event_5Event_5is_set, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Event_is_set, NULL, __pyx_n_s_gevent__event, __pyx_d, ((PyObject *)__pyx_codeobj__6)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 56, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_event_Event->tp_dict, __pyx_n_s_is_set, __pyx_t_2) < 0) __PYX_ERR(0, 56, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_6_event_Event); + + /* "src/gevent/event.py":60 + * return self._flag + * + * def isSet(self): # <<<<<<<<<<<<<< + * # makes it a better drop-in replacement for threading.Event + * return self._flag + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_event_5Event_7isSet, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Event_isSet, NULL, __pyx_n_s_gevent__event, __pyx_d, ((PyObject *)__pyx_codeobj__8)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 60, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_event_Event->tp_dict, __pyx_n_s_isSet, __pyx_t_2) < 0) __PYX_ERR(0, 60, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_6_event_Event); + + /* "src/gevent/event.py":64 + * return self._flag + * + * def ready(self): # <<<<<<<<<<<<<< + * # makes it compatible with AsyncResult and Greenlet (for + * # example in wait()) + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_event_5Event_9ready, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Event_ready, NULL, __pyx_n_s_gevent__event, __pyx_d, ((PyObject *)__pyx_codeobj__10)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 64, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_event_Event->tp_dict, __pyx_n_s_ready, __pyx_t_2) < 0) __PYX_ERR(0, 64, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_6_event_Event); + + /* "src/gevent/event.py":69 + * return self._flag + * + * def set(self): # <<<<<<<<<<<<<< + * """ + * Set the internal flag to true. + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_event_5Event_11set, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Event_set, NULL, __pyx_n_s_gevent__event, __pyx_d, ((PyObject *)__pyx_codeobj__12)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 69, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_event_Event->tp_dict, __pyx_n_s_set, __pyx_t_2) < 0) __PYX_ERR(0, 69, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_6_event_Event); + + /* "src/gevent/event.py":81 + * self._check_and_notify() + * + * def clear(self): # <<<<<<<<<<<<<< + * """ + * Reset the internal flag to false. + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_event_5Event_13clear, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Event_clear, NULL, __pyx_n_s_gevent__event, __pyx_d, ((PyObject *)__pyx_codeobj__14)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 81, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_event_Event->tp_dict, __pyx_n_s_clear, __pyx_t_2) < 0) __PYX_ERR(0, 81, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_6_event_Event); + + /* "src/gevent/event.py":102 + * return wait_success + * + * def wait(self, timeout=None): # <<<<<<<<<<<<<< + * """ + * Block until the internal flag is true. + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_event_5Event_15wait, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Event_wait, NULL, __pyx_n_s_gevent__event, __pyx_d, ((PyObject *)__pyx_codeobj__16)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 102, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_event_Event->tp_dict, __pyx_n_s_wait, __pyx_t_2) < 0) __PYX_ERR(0, 102, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_6_event_Event); + + /* "src/gevent/event.py":129 + * return self._wait(timeout) + * + * def _reset_internal_locks(self): # pragma: no cover # <<<<<<<<<<<<<< + * # for compatibility with threading.Event + * # Exception AttributeError: AttributeError("'Event' object has no attribute '_reset_internal_locks'",) + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_event_5Event_17_reset_internal_locks, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Event__reset_internal_locks, NULL, __pyx_n_s_gevent__event, __pyx_d, ((PyObject *)__pyx_codeobj__18)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 129, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_event_Event->tp_dict, __pyx_n_s_reset_internal_locks, __pyx_t_2) < 0) __PYX_ERR(0, 129, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_6_event_Event); + + /* "src/gevent/event.py":186 + * """ + * + * __slots__ = ('_value', '_exc_info', '_imap_task_index') # <<<<<<<<<<<<<< + * + * def __init__(self): + */ + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_event_AsyncResult->tp_dict, __pyx_n_s_slots, __pyx_tuple__19) < 0) __PYX_ERR(0, 186, __pyx_L1_error) + PyType_Modified(__pyx_ptype_6gevent_6_event_AsyncResult); + + /* "src/gevent/event.py":224 + * return result + ' _links[%s]>' % self.linkcount() + * + * def ready(self): # <<<<<<<<<<<<<< + * """Return true if and only if it holds a value or an exception""" + * return self._exc_info or self._value is not _NONE + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_event_11AsyncResult_5ready, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AsyncResult_ready, NULL, __pyx_n_s_gevent__event, __pyx_d, ((PyObject *)__pyx_codeobj__21)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 224, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_event_AsyncResult->tp_dict, __pyx_n_s_ready, __pyx_t_2) < 0) __PYX_ERR(0, 224, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_6_event_AsyncResult); + + /* "src/gevent/event.py":228 + * return self._exc_info or self._value is not _NONE + * + * def successful(self): # <<<<<<<<<<<<<< + * """Return true if and only if it is ready and holds a value""" + * return self._value is not _NONE + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_event_11AsyncResult_7successful, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AsyncResult_successful, NULL, __pyx_n_s_gevent__event, __pyx_d, ((PyObject *)__pyx_codeobj__23)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 228, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_event_AsyncResult->tp_dict, __pyx_n_s_successful, __pyx_t_2) < 0) __PYX_ERR(0, 228, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_6_event_AsyncResult); + + /* "src/gevent/event.py":239 + * return self._exc_info[1] + * + * def set(self, value=None): # <<<<<<<<<<<<<< + * """Store the value and wake up any waiters. + * + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_event_11AsyncResult_9set, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AsyncResult_set, NULL, __pyx_n_s_gevent__event, __pyx_d, ((PyObject *)__pyx_codeobj__25)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 239, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_event_AsyncResult->tp_dict, __pyx_n_s_set, __pyx_t_2) < 0) __PYX_ERR(0, 239, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_6_event_AsyncResult); + + /* "src/gevent/event.py":248 + * self._check_and_notify() + * + * def set_exception(self, exception, exc_info=None): # <<<<<<<<<<<<<< + * """Store the exception and wake up any waiters. + * + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_event_11AsyncResult_11set_exception, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AsyncResult_set_exception, NULL, __pyx_n_s_gevent__event, __pyx_d, ((PyObject *)__pyx_codeobj__27)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 248, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_event_AsyncResult->tp_dict, __pyx_n_s_set_exception, __pyx_t_2) < 0) __PYX_ERR(0, 248, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_6_event_AsyncResult); + + /* "src/gevent/event.py":265 + * self._check_and_notify() + * + * def _raise_exception(self): # <<<<<<<<<<<<<< + * reraise(*self.exc_info) + * + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_event_11AsyncResult_13_raise_exception, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AsyncResult__raise_exception, NULL, __pyx_n_s_gevent__event, __pyx_d, ((PyObject *)__pyx_codeobj__29)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 265, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_event_AsyncResult->tp_dict, __pyx_n_s_raise_exception, __pyx_t_2) < 0) __PYX_ERR(0, 265, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_6_event_AsyncResult); + + /* "src/gevent/event.py":268 + * reraise(*self.exc_info) + * + * def get(self, block=True, timeout=None): # <<<<<<<<<<<<<< + * """Return the stored value or raise the exception. + * + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_event_11AsyncResult_15get, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AsyncResult_get, NULL, __pyx_n_s_gevent__event, __pyx_d, ((PyObject *)__pyx_codeobj__31)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 268, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_event_AsyncResult->tp_dict, __pyx_n_s_get, __pyx_t_2) < 0) __PYX_ERR(0, 268, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_6_event_AsyncResult); + + /* "src/gevent/event.py":298 + * return self.get(block=False) + * + * def get_nowait(self): # <<<<<<<<<<<<<< + * """ + * Return the value or raise the exception without blocking. + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_event_11AsyncResult_17get_nowait, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AsyncResult_get_nowait, NULL, __pyx_n_s_gevent__event, __pyx_d, ((PyObject *)__pyx_codeobj__33)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 298, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_event_AsyncResult->tp_dict, __pyx_n_s_get_nowait, __pyx_t_2) < 0) __PYX_ERR(0, 298, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_6_event_AsyncResult); + + /* "src/gevent/event.py":313 + * return self.value + * + * def wait(self, timeout=None): # <<<<<<<<<<<<<< + * """Block until the instance is ready. + * + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_event_11AsyncResult_19wait, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AsyncResult_wait, NULL, __pyx_n_s_gevent__event, __pyx_d, ((PyObject *)__pyx_codeobj__35)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 313, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_event_AsyncResult->tp_dict, __pyx_n_s_wait, __pyx_t_2) < 0) __PYX_ERR(0, 313, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_6_event_AsyncResult); + + /* "src/gevent/event.py":343 + * # Methods to make us more like concurrent.futures.Future + * + * def result(self, timeout=None): # <<<<<<<<<<<<<< + * return self.get(timeout=timeout) + * + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_event_11AsyncResult_23result, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AsyncResult_result, NULL, __pyx_n_s_gevent__event, __pyx_d, ((PyObject *)__pyx_codeobj__37)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 343, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_event_AsyncResult->tp_dict, __pyx_n_s_result, __pyx_t_2) < 0) __PYX_ERR(0, 343, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_6_event_AsyncResult); + + /* "src/gevent/event.py":346 + * return self.get(timeout=timeout) + * + * set_result = set # <<<<<<<<<<<<<< + * + * def done(self): + */ + __Pyx_GetNameInClass(__pyx_t_2, (PyObject *)__pyx_ptype_6gevent_6_event_AsyncResult, __pyx_n_s_set); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 346, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_event_AsyncResult->tp_dict, __pyx_n_s_set_result, __pyx_t_2) < 0) __PYX_ERR(0, 346, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_6_event_AsyncResult); + + /* "src/gevent/event.py":348 + * set_result = set + * + * def done(self): # <<<<<<<<<<<<<< + * return self.ready() + * + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_event_11AsyncResult_25done, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AsyncResult_done, NULL, __pyx_n_s_gevent__event, __pyx_d, ((PyObject *)__pyx_codeobj__39)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 348, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_event_AsyncResult->tp_dict, __pyx_n_s_done, __pyx_t_2) < 0) __PYX_ERR(0, 348, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_6_event_AsyncResult); + + /* "src/gevent/event.py":353 + * # we don't support cancelling + * + * def cancel(self): # <<<<<<<<<<<<<< + * return False + * + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_event_11AsyncResult_27cancel, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AsyncResult_cancel, NULL, __pyx_n_s_gevent__event, __pyx_d, ((PyObject *)__pyx_codeobj__41)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 353, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_event_AsyncResult->tp_dict, __pyx_n_s_cancel, __pyx_t_2) < 0) __PYX_ERR(0, 353, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_6_event_AsyncResult); + + /* "src/gevent/event.py":356 + * return False + * + * def cancelled(self): # <<<<<<<<<<<<<< + * return False + * + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_event_11AsyncResult_29cancelled, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AsyncResult_cancelled, NULL, __pyx_n_s_gevent__event, __pyx_d, ((PyObject *)__pyx_codeobj__43)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 356, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_event_AsyncResult->tp_dict, __pyx_n_s_cancelled, __pyx_t_2) < 0) __PYX_ERR(0, 356, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_6_event_AsyncResult); + + /* "src/gevent/event.py":362 + * + * + * from gevent._util import import_c_accel # <<<<<<<<<<<<<< + * import_c_accel(globals(), 'gevent._event') + */ + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 362, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_import_c_accel); + __Pyx_GIVEREF(__pyx_n_s_import_c_accel); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_import_c_accel); + __pyx_t_1 = __Pyx_Import(__pyx_n_s_gevent__util, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 362, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_import_c_accel); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 362, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_import_c_accel, __pyx_t_2) < 0) __PYX_ERR(0, 362, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/event.py":363 + * + * from gevent._util import import_c_accel + * import_c_accel(globals(), 'gevent._event') # <<<<<<<<<<<<<< + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_import_c_accel); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 363, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_Globals(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 363, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 363, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __Pyx_INCREF(__pyx_n_s_gevent__event); + __Pyx_GIVEREF(__pyx_n_s_gevent__event); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_n_s_gevent__event); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 363, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/event.py":1 + * # Copyright (c) 2009-2016 Denis Bilenko, gevent contributors. See LICENSE for details. # <<<<<<<<<<<<<< + * # cython: auto_pickle=False,embedsignature=True,always_allow_keywords=False,infer_types=True + * + */ + __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "gevent/__abstract_linkable.pxd":24 + * return PyGreenlet_GetCurrent() + * + * cdef inline void greenlet_init(): # <<<<<<<<<<<<<< + * global _greenlet_imported + * if not _greenlet_imported: + */ + + /*--- Wrapped vars code ---*/ + + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + if (__pyx_m) { + if (__pyx_d) { + __Pyx_AddTraceback("init gevent._event", __pyx_clineno, __pyx_lineno, __pyx_filename); + } + Py_CLEAR(__pyx_m); + } else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_ImportError, "init gevent._event"); + } + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + #if CYTHON_PEP489_MULTI_PHASE_INIT + return (__pyx_m != NULL) ? 0 : -1; + #elif PY_MAJOR_VERSION >= 3 + return __pyx_m; + #else + return; + #endif +} + +/* --- Runtime support code --- */ +/* Refnanny */ +#if CYTHON_REFNANNY +static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { + PyObject *m = NULL, *p = NULL; + void *r = NULL; + m = PyImport_ImportModule(modname); + if (!m) goto end; + p = PyObject_GetAttrString(m, "RefNannyAPI"); + if (!p) goto end; + r = PyLong_AsVoidPtr(p); +end: + Py_XDECREF(p); + Py_XDECREF(m); + return (__Pyx_RefNannyAPIStruct *)r; +} +#endif + +/* PyObjectGetAttrStr */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_getattro)) + return tp->tp_getattro(obj, attr_name); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_getattr)) + return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); +#endif + return PyObject_GetAttr(obj, attr_name); +} +#endif + +/* GetBuiltinName */ +static PyObject *__Pyx_GetBuiltinName(PyObject *name) { + PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name); + if (unlikely(!result)) { + PyErr_Format(PyExc_NameError, +#if PY_MAJOR_VERSION >= 3 + "name '%U' is not defined", name); +#else + "name '%.200s' is not defined", PyString_AS_STRING(name)); +#endif + } + return result; +} + +/* PyObjectCall */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { + PyObject *result; + ternaryfunc call = func->ob_type->tp_call; + if (unlikely(!call)) + return PyObject_Call(func, arg, kw); + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; + result = (*call)(func, arg, kw); + Py_LeaveRecursiveCall(); + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +/* RaiseArgTupleInvalid */ +static void __Pyx_RaiseArgtupleInvalid( + const char* func_name, + int exact, + Py_ssize_t num_min, + Py_ssize_t num_max, + Py_ssize_t num_found) +{ + Py_ssize_t num_expected; + const char *more_or_less; + if (num_found < num_min) { + num_expected = num_min; + more_or_less = "at least"; + } else { + num_expected = num_max; + more_or_less = "at most"; + } + if (exact) { + more_or_less = "exactly"; + } + PyErr_Format(PyExc_TypeError, + "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", + func_name, more_or_less, num_expected, + (num_expected == 1) ? "" : "s", num_found); +} + +/* KeywordStringCheck */ +static int __Pyx_CheckKeywordStrings( + PyObject *kwdict, + const char* function_name, + int kw_allowed) +{ + PyObject* key = 0; + Py_ssize_t pos = 0; +#if CYTHON_COMPILING_IN_PYPY + if (!kw_allowed && PyDict_Next(kwdict, &pos, &key, 0)) + goto invalid_keyword; + return 1; +#else + while (PyDict_Next(kwdict, &pos, &key, 0)) { + #if PY_MAJOR_VERSION < 3 + if (unlikely(!PyString_Check(key))) + #endif + if (unlikely(!PyUnicode_Check(key))) + goto invalid_keyword_type; + } + if ((!kw_allowed) && unlikely(key)) + goto invalid_keyword; + return 1; +invalid_keyword_type: + PyErr_Format(PyExc_TypeError, + "%.200s() keywords must be strings", function_name); + return 0; +#endif +invalid_keyword: + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION < 3 + "%.200s() got an unexpected keyword argument '%.200s'", + function_name, PyString_AsString(key)); + #else + "%s() got an unexpected keyword argument '%U'", + function_name, key); + #endif + return 0; +} + +/* PyFunctionFastCall */ +#if CYTHON_FAST_PYCALL +static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, + PyObject *globals) { + PyFrameObject *f; + PyThreadState *tstate = __Pyx_PyThreadState_Current; + PyObject **fastlocals; + Py_ssize_t i; + PyObject *result; + assert(globals != NULL); + /* XXX Perhaps we should create a specialized + PyFrame_New() that doesn't take locals, but does + take builtins without sanity checking them. + */ + assert(tstate != NULL); + f = PyFrame_New(tstate, co, globals, NULL); + if (f == NULL) { + return NULL; + } + fastlocals = __Pyx_PyFrame_GetLocalsplus(f); + for (i = 0; i < na; i++) { + Py_INCREF(*args); + fastlocals[i] = *args++; + } + result = PyEval_EvalFrameEx(f,0); + ++tstate->recursion_depth; + Py_DECREF(f); + --tstate->recursion_depth; + return result; +} +#if 1 || PY_VERSION_HEX < 0x030600B1 +static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs) { + PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); + PyObject *globals = PyFunction_GET_GLOBALS(func); + PyObject *argdefs = PyFunction_GET_DEFAULTS(func); + PyObject *closure; +#if PY_MAJOR_VERSION >= 3 + PyObject *kwdefs; +#endif + PyObject *kwtuple, **k; + PyObject **d; + Py_ssize_t nd; + Py_ssize_t nk; + PyObject *result; + assert(kwargs == NULL || PyDict_Check(kwargs)); + nk = kwargs ? PyDict_Size(kwargs) : 0; + if (Py_EnterRecursiveCall((char*)" while calling a Python object")) { + return NULL; + } + if ( +#if PY_MAJOR_VERSION >= 3 + co->co_kwonlyargcount == 0 && +#endif + likely(kwargs == NULL || nk == 0) && + co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { + if (argdefs == NULL && co->co_argcount == nargs) { + result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); + goto done; + } + else if (nargs == 0 && argdefs != NULL + && co->co_argcount == Py_SIZE(argdefs)) { + /* function called with no arguments, but all parameters have + a default value: use default values as arguments .*/ + args = &PyTuple_GET_ITEM(argdefs, 0); + result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); + goto done; + } + } + if (kwargs != NULL) { + Py_ssize_t pos, i; + kwtuple = PyTuple_New(2 * nk); + if (kwtuple == NULL) { + result = NULL; + goto done; + } + k = &PyTuple_GET_ITEM(kwtuple, 0); + pos = i = 0; + while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { + Py_INCREF(k[i]); + Py_INCREF(k[i+1]); + i += 2; + } + nk = i / 2; + } + else { + kwtuple = NULL; + k = NULL; + } + closure = PyFunction_GET_CLOSURE(func); +#if PY_MAJOR_VERSION >= 3 + kwdefs = PyFunction_GET_KW_DEFAULTS(func); +#endif + if (argdefs != NULL) { + d = &PyTuple_GET_ITEM(argdefs, 0); + nd = Py_SIZE(argdefs); + } + else { + d = NULL; + nd = 0; + } +#if PY_MAJOR_VERSION >= 3 + result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, + args, nargs, + k, (int)nk, + d, (int)nd, kwdefs, closure); +#else + result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, + args, nargs, + k, (int)nk, + d, (int)nd, closure); +#endif + Py_XDECREF(kwtuple); +done: + Py_LeaveRecursiveCall(); + return result; +} +#endif +#endif + +/* PyObjectCallMethO */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { + PyObject *self, *result; + PyCFunction cfunc; + cfunc = PyCFunction_GET_FUNCTION(func); + self = PyCFunction_GET_SELF(func); + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; + result = cfunc(self, arg); + Py_LeaveRecursiveCall(); + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +/* PyObjectCallNoArg */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { +#if CYTHON_FAST_PYCALL + if (PyFunction_Check(func)) { + return __Pyx_PyFunction_FastCall(func, NULL, 0); + } +#endif +#ifdef __Pyx_CyFunction_USED + if (likely(PyCFunction_Check(func) || __Pyx_CyFunction_Check(func))) +#else + if (likely(PyCFunction_Check(func))) +#endif + { + if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) { + return __Pyx_PyObject_CallMethO(func, NULL); + } + } + return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL); +} +#endif + +/* PyCFunctionFastCall */ +#if CYTHON_FAST_PYCCALL +static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) { + PyCFunctionObject *func = (PyCFunctionObject*)func_obj; + PyCFunction meth = PyCFunction_GET_FUNCTION(func); + PyObject *self = PyCFunction_GET_SELF(func); + int flags = PyCFunction_GET_FLAGS(func); + assert(PyCFunction_Check(func)); + assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS))); + assert(nargs >= 0); + assert(nargs == 0 || args != NULL); + /* _PyCFunction_FastCallDict() must not be called with an exception set, + because it may clear it (directly or indirectly) and so the + caller loses its exception */ + assert(!PyErr_Occurred()); + if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) { + return (*((__Pyx_PyCFunctionFastWithKeywords)(void*)meth)) (self, args, nargs, NULL); + } else { + return (*((__Pyx_PyCFunctionFast)(void*)meth)) (self, args, nargs); + } +} +#endif + +/* PyObjectCallOneArg */ +#if CYTHON_COMPILING_IN_CPYTHON +static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) { + PyObject *result; + PyObject *args = PyTuple_New(1); + if (unlikely(!args)) return NULL; + Py_INCREF(arg); + PyTuple_SET_ITEM(args, 0, arg); + result = __Pyx_PyObject_Call(func, args, NULL); + Py_DECREF(args); + return result; +} +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { +#if CYTHON_FAST_PYCALL + if (PyFunction_Check(func)) { + return __Pyx_PyFunction_FastCall(func, &arg, 1); + } +#endif + if (likely(PyCFunction_Check(func))) { + if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) { + return __Pyx_PyObject_CallMethO(func, arg); +#if CYTHON_FAST_PYCCALL + } else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) { + return __Pyx_PyCFunction_FastCall(func, &arg, 1); +#endif + } + } + return __Pyx__PyObject_CallOneArg(func, arg); +} +#else +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { + PyObject *result; + PyObject *args = PyTuple_Pack(1, arg); + if (unlikely(!args)) return NULL; + result = __Pyx_PyObject_Call(func, args, NULL); + Py_DECREF(args); + return result; +} +#endif + +/* PyErrFetchRestore */ +#if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + tmp_type = tstate->curexc_type; + tmp_value = tstate->curexc_value; + tmp_tb = tstate->curexc_traceback; + tstate->curexc_type = type; + tstate->curexc_value = value; + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +} +static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { + *type = tstate->curexc_type; + *value = tstate->curexc_value; + *tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +} +#endif + +/* WriteUnraisableException */ +static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno, + CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename, + int full_traceback, CYTHON_UNUSED int nogil) { + PyObject *old_exc, *old_val, *old_tb; + PyObject *ctx; + __Pyx_PyThreadState_declare +#ifdef WITH_THREAD + PyGILState_STATE state; + if (nogil) + state = PyGILState_Ensure(); +#ifdef _MSC_VER + else state = (PyGILState_STATE)-1; +#endif +#endif + __Pyx_PyThreadState_assign + __Pyx_ErrFetch(&old_exc, &old_val, &old_tb); + if (full_traceback) { + Py_XINCREF(old_exc); + Py_XINCREF(old_val); + Py_XINCREF(old_tb); + __Pyx_ErrRestore(old_exc, old_val, old_tb); + PyErr_PrintEx(1); + } + #if PY_MAJOR_VERSION < 3 + ctx = PyString_FromString(name); + #else + ctx = PyUnicode_FromString(name); + #endif + __Pyx_ErrRestore(old_exc, old_val, old_tb); + if (!ctx) { + PyErr_WriteUnraisable(Py_None); + } else { + PyErr_WriteUnraisable(ctx); + Py_DECREF(ctx); + } +#ifdef WITH_THREAD + if (nogil) + PyGILState_Release(state); +#endif +} + +/* RaiseDoubleKeywords */ +static void __Pyx_RaiseDoubleKeywordsError( + const char* func_name, + PyObject* kw_name) +{ + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION >= 3 + "%s() got multiple values for keyword argument '%U'", func_name, kw_name); + #else + "%s() got multiple values for keyword argument '%s'", func_name, + PyString_AsString(kw_name)); + #endif +} + +/* ParseKeywords */ +static int __Pyx_ParseOptionalKeywords( + PyObject *kwds, + PyObject **argnames[], + PyObject *kwds2, + PyObject *values[], + Py_ssize_t num_pos_args, + const char* function_name) +{ + PyObject *key = 0, *value = 0; + Py_ssize_t pos = 0; + PyObject*** name; + PyObject*** first_kw_arg = argnames + num_pos_args; + while (PyDict_Next(kwds, &pos, &key, &value)) { + name = first_kw_arg; + while (*name && (**name != key)) name++; + if (*name) { + values[name-argnames] = value; + continue; + } + name = first_kw_arg; + #if PY_MAJOR_VERSION < 3 + if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) { + while (*name) { + if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) + && _PyString_Eq(**name, key)) { + values[name-argnames] = value; + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + if ((**argname == key) || ( + (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) + && _PyString_Eq(**argname, key))) { + goto arg_passed_twice; + } + argname++; + } + } + } else + #endif + if (likely(PyUnicode_Check(key))) { + while (*name) { + int cmp = (**name == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 : + #endif + PyUnicode_Compare(**name, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) { + values[name-argnames] = value; + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + int cmp = (**argname == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 : + #endif + PyUnicode_Compare(**argname, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) goto arg_passed_twice; + argname++; + } + } + } else + goto invalid_keyword_type; + if (kwds2) { + if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; + } else { + goto invalid_keyword; + } + } + return 0; +arg_passed_twice: + __Pyx_RaiseDoubleKeywordsError(function_name, key); + goto bad; +invalid_keyword_type: + PyErr_Format(PyExc_TypeError, + "%.200s() keywords must be strings", function_name); + goto bad; +invalid_keyword: + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION < 3 + "%.200s() got an unexpected keyword argument '%.200s'", + function_name, PyString_AsString(key)); + #else + "%s() got an unexpected keyword argument '%U'", + function_name, key); + #endif +bad: + return -1; +} + +/* GetModuleGlobalName */ +#if CYTHON_USE_DICT_VERSIONS +static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value) +#else +static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) +#endif +{ + PyObject *result; +#if !CYTHON_AVOID_BORROWED_REFS +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 + result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } else if (unlikely(PyErr_Occurred())) { + return NULL; + } +#else + result = PyDict_GetItem(__pyx_d, name); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } +#endif +#else + result = PyObject_GetItem(__pyx_d, name); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } + PyErr_Clear(); +#endif + return __Pyx_GetBuiltinName(name); +} + +/* GetItemInt */ +static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { + PyObject *r; + if (!j) return NULL; + r = PyObject_GetItem(o, j); + Py_DECREF(j); + return r; +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, + CYTHON_NCP_UNUSED int wraparound, + CYTHON_NCP_UNUSED int boundscheck) { +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + Py_ssize_t wrapped_i = i; + if (wraparound & unlikely(i < 0)) { + wrapped_i += PyList_GET_SIZE(o); + } + if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) { + PyObject *r = PyList_GET_ITEM(o, wrapped_i); + Py_INCREF(r); + return r; + } + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +#else + return PySequence_GetItem(o, i); +#endif +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, + CYTHON_NCP_UNUSED int wraparound, + CYTHON_NCP_UNUSED int boundscheck) { +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + Py_ssize_t wrapped_i = i; + if (wraparound & unlikely(i < 0)) { + wrapped_i += PyTuple_GET_SIZE(o); + } + if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) { + PyObject *r = PyTuple_GET_ITEM(o, wrapped_i); + Py_INCREF(r); + return r; + } + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +#else + return PySequence_GetItem(o, i); +#endif +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, + CYTHON_NCP_UNUSED int wraparound, + CYTHON_NCP_UNUSED int boundscheck) { +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS + if (is_list || PyList_CheckExact(o)) { + Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); + if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) { + PyObject *r = PyList_GET_ITEM(o, n); + Py_INCREF(r); + return r; + } + } + else if (PyTuple_CheckExact(o)) { + Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o); + if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) { + PyObject *r = PyTuple_GET_ITEM(o, n); + Py_INCREF(r); + return r; + } + } else { + PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence; + if (likely(m && m->sq_item)) { + if (wraparound && unlikely(i < 0) && likely(m->sq_length)) { + Py_ssize_t l = m->sq_length(o); + if (likely(l >= 0)) { + i += l; + } else { + if (!PyErr_ExceptionMatches(PyExc_OverflowError)) + return NULL; + PyErr_Clear(); + } + } + return m->sq_item(o, i); + } + } +#else + if (is_list || PySequence_Check(o)) { + return PySequence_GetItem(o, i); + } +#endif + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +} + +/* PyObjectCall2Args */ +static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) { + PyObject *args, *result = NULL; + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(function)) { + PyObject *args[2] = {arg1, arg2}; + return __Pyx_PyFunction_FastCall(function, args, 2); + } + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(function)) { + PyObject *args[2] = {arg1, arg2}; + return __Pyx_PyCFunction_FastCall(function, args, 2); + } + #endif + args = PyTuple_New(2); + if (unlikely(!args)) goto done; + Py_INCREF(arg1); + PyTuple_SET_ITEM(args, 0, arg1); + Py_INCREF(arg2); + PyTuple_SET_ITEM(args, 1, arg2); + Py_INCREF(function); + result = __Pyx_PyObject_Call(function, args, NULL); + Py_DECREF(args); + Py_DECREF(function); +done: + return result; +} + +/* RaiseException */ +#if PY_MAJOR_VERSION < 3 +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, + CYTHON_UNUSED PyObject *cause) { + __Pyx_PyThreadState_declare + Py_XINCREF(type); + if (!value || value == Py_None) + value = NULL; + else + Py_INCREF(value); + if (!tb || tb == Py_None) + tb = NULL; + else { + Py_INCREF(tb); + if (!PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto raise_error; + } + } + if (PyType_Check(type)) { +#if CYTHON_COMPILING_IN_PYPY + if (!value) { + Py_INCREF(Py_None); + value = Py_None; + } +#endif + PyErr_NormalizeException(&type, &value, &tb); + } else { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto raise_error; + } + value = type; + type = (PyObject*) Py_TYPE(type); + Py_INCREF(type); + if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto raise_error; + } + } + __Pyx_PyThreadState_assign + __Pyx_ErrRestore(type, value, tb); + return; +raise_error: + Py_XDECREF(value); + Py_XDECREF(type); + Py_XDECREF(tb); + return; +} +#else +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { + PyObject* owned_instance = NULL; + if (tb == Py_None) { + tb = 0; + } else if (tb && !PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto bad; + } + if (value == Py_None) + value = 0; + if (PyExceptionInstance_Check(type)) { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto bad; + } + value = type; + type = (PyObject*) Py_TYPE(value); + } else if (PyExceptionClass_Check(type)) { + PyObject *instance_class = NULL; + if (value && PyExceptionInstance_Check(value)) { + instance_class = (PyObject*) Py_TYPE(value); + if (instance_class != type) { + int is_subclass = PyObject_IsSubclass(instance_class, type); + if (!is_subclass) { + instance_class = NULL; + } else if (unlikely(is_subclass == -1)) { + goto bad; + } else { + type = instance_class; + } + } + } + if (!instance_class) { + PyObject *args; + if (!value) + args = PyTuple_New(0); + else if (PyTuple_Check(value)) { + Py_INCREF(value); + args = value; + } else + args = PyTuple_Pack(1, value); + if (!args) + goto bad; + owned_instance = PyObject_Call(type, args, NULL); + Py_DECREF(args); + if (!owned_instance) + goto bad; + value = owned_instance; + if (!PyExceptionInstance_Check(value)) { + PyErr_Format(PyExc_TypeError, + "calling %R should have returned an instance of " + "BaseException, not %R", + type, Py_TYPE(value)); + goto bad; + } + } + } else { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto bad; + } + if (cause) { + PyObject *fixed_cause; + if (cause == Py_None) { + fixed_cause = NULL; + } else if (PyExceptionClass_Check(cause)) { + fixed_cause = PyObject_CallObject(cause, NULL); + if (fixed_cause == NULL) + goto bad; + } else if (PyExceptionInstance_Check(cause)) { + fixed_cause = cause; + Py_INCREF(fixed_cause); + } else { + PyErr_SetString(PyExc_TypeError, + "exception causes must derive from " + "BaseException"); + goto bad; + } + PyException_SetCause(value, fixed_cause); + } + PyErr_SetObject(type, value); + if (tb) { +#if CYTHON_COMPILING_IN_PYPY + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); + Py_INCREF(tb); + PyErr_Restore(tmp_type, tmp_value, tb); + Py_XDECREF(tmp_tb); +#else + PyThreadState *tstate = __Pyx_PyThreadState_Current; + PyObject* tmp_tb = tstate->curexc_traceback; + if (tb != tmp_tb) { + Py_INCREF(tb); + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_tb); + } +#endif + } +bad: + Py_XDECREF(owned_instance); + return; +} +#endif + +/* PyErrExceptionMatches */ +#if CYTHON_FAST_THREAD_STATE +static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { + Py_ssize_t i, n; + n = PyTuple_GET_SIZE(tuple); +#if PY_MAJOR_VERSION >= 3 + for (i=0; icurexc_type; + if (exc_type == err) return 1; + if (unlikely(!exc_type)) return 0; + if (unlikely(PyTuple_Check(err))) + return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err); + return __Pyx_PyErr_GivenExceptionMatches(exc_type, err); +} +#endif + +/* GetAttr */ +static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) { +#if CYTHON_USE_TYPE_SLOTS +#if PY_MAJOR_VERSION >= 3 + if (likely(PyUnicode_Check(n))) +#else + if (likely(PyString_Check(n))) +#endif + return __Pyx_PyObject_GetAttrStr(o, n); +#endif + return PyObject_GetAttr(o, n); +} + +/* GetAttr3 */ +static PyObject *__Pyx_GetAttr3Default(PyObject *d) { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) + return NULL; + __Pyx_PyErr_Clear(); + Py_INCREF(d); + return d; +} +static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) { + PyObject *r = __Pyx_GetAttr(o, n); + return (likely(r)) ? r : __Pyx_GetAttr3Default(d); +} + +/* CallNextTpDealloc */ +static void __Pyx_call_next_tp_dealloc(PyObject* obj, destructor current_tp_dealloc) { + PyTypeObject* type = Py_TYPE(obj); + while (type && type->tp_dealloc != current_tp_dealloc) + type = type->tp_base; + while (type && type->tp_dealloc == current_tp_dealloc) + type = type->tp_base; + if (type) + type->tp_dealloc(obj); +} + +/* CallNextTpTraverse */ +static int __Pyx_call_next_tp_traverse(PyObject* obj, visitproc v, void *a, traverseproc current_tp_traverse) { + PyTypeObject* type = Py_TYPE(obj); + while (type && type->tp_traverse != current_tp_traverse) + type = type->tp_base; + while (type && type->tp_traverse == current_tp_traverse) + type = type->tp_base; + if (type && type->tp_traverse) + return type->tp_traverse(obj, v, a); + return 0; +} + +/* CallNextTpClear */ +static void __Pyx_call_next_tp_clear(PyObject* obj, inquiry current_tp_clear) { + PyTypeObject* type = Py_TYPE(obj); + while (type && type->tp_clear != current_tp_clear) + type = type->tp_base; + while (type && type->tp_clear == current_tp_clear) + type = type->tp_base; + if (type && type->tp_clear) + type->tp_clear(obj); +} + +/* TypeImport */ +#ifndef __PYX_HAVE_RT_ImportType +#define __PYX_HAVE_RT_ImportType +static PyTypeObject *__Pyx_ImportType(PyObject *module, const char *module_name, const char *class_name, + size_t size, enum __Pyx_ImportType_CheckSize check_size) +{ + PyObject *result = 0; + char warning[200]; + Py_ssize_t basicsize; +#ifdef Py_LIMITED_API + PyObject *py_basicsize; +#endif + result = PyObject_GetAttrString(module, class_name); + if (!result) + goto bad; + if (!PyType_Check(result)) { + PyErr_Format(PyExc_TypeError, + "%.200s.%.200s is not a type object", + module_name, class_name); + goto bad; + } +#ifndef Py_LIMITED_API + basicsize = ((PyTypeObject *)result)->tp_basicsize; +#else + py_basicsize = PyObject_GetAttrString(result, "__basicsize__"); + if (!py_basicsize) + goto bad; + basicsize = PyLong_AsSsize_t(py_basicsize); + Py_DECREF(py_basicsize); + py_basicsize = 0; + if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred()) + goto bad; +#endif + if ((size_t)basicsize < size) { + PyErr_Format(PyExc_ValueError, + "%.200s.%.200s size changed, may indicate binary incompatibility. " + "Expected %zd from C header, got %zd from PyObject", + module_name, class_name, size, basicsize); + goto bad; + } + if (check_size == __Pyx_ImportType_CheckSize_Error && (size_t)basicsize != size) { + PyErr_Format(PyExc_ValueError, + "%.200s.%.200s size changed, may indicate binary incompatibility. " + "Expected %zd from C header, got %zd from PyObject", + module_name, class_name, size, basicsize); + goto bad; + } + else if (check_size == __Pyx_ImportType_CheckSize_Warn && (size_t)basicsize > size) { + PyOS_snprintf(warning, sizeof(warning), + "%s.%s size changed, may indicate binary incompatibility. " + "Expected %zd from C header, got %zd from PyObject", + module_name, class_name, size, basicsize); + if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad; + } + return (PyTypeObject *)result; +bad: + Py_XDECREF(result); + return NULL; +} +#endif + +/* GetVTable */ +static void* __Pyx_GetVtable(PyObject *dict) { + void* ptr; + PyObject *ob = PyObject_GetItem(dict, __pyx_n_s_pyx_vtable); + if (!ob) + goto bad; +#if PY_VERSION_HEX >= 0x02070000 + ptr = PyCapsule_GetPointer(ob, 0); +#else + ptr = PyCObject_AsVoidPtr(ob); +#endif + if (!ptr && !PyErr_Occurred()) + PyErr_SetString(PyExc_RuntimeError, "invalid vtable found for imported type"); + Py_DECREF(ob); + return ptr; +bad: + Py_XDECREF(ob); + return NULL; +} + +/* PyObject_GenericGetAttrNoDict */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) { + PyErr_Format(PyExc_AttributeError, +#if PY_MAJOR_VERSION >= 3 + "'%.50s' object has no attribute '%U'", + tp->tp_name, attr_name); +#else + "'%.50s' object has no attribute '%.400s'", + tp->tp_name, PyString_AS_STRING(attr_name)); +#endif + return NULL; +} +static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) { + PyObject *descr; + PyTypeObject *tp = Py_TYPE(obj); + if (unlikely(!PyString_Check(attr_name))) { + return PyObject_GenericGetAttr(obj, attr_name); + } + assert(!tp->tp_dictoffset); + descr = _PyType_Lookup(tp, attr_name); + if (unlikely(!descr)) { + return __Pyx_RaiseGenericGetAttributeError(tp, attr_name); + } + Py_INCREF(descr); + #if PY_MAJOR_VERSION < 3 + if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS))) + #endif + { + descrgetfunc f = Py_TYPE(descr)->tp_descr_get; + if (unlikely(f)) { + PyObject *res = f(descr, obj, (PyObject *)tp); + Py_DECREF(descr); + return res; + } + } + return descr; +} +#endif + +/* PyObject_GenericGetAttr */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) { + if (unlikely(Py_TYPE(obj)->tp_dictoffset)) { + return PyObject_GenericGetAttr(obj, attr_name); + } + return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name); +} +#endif + +/* SetVTable */ +static int __Pyx_SetVtable(PyObject *dict, void *vtable) { +#if PY_VERSION_HEX >= 0x02070000 + PyObject *ob = PyCapsule_New(vtable, 0, 0); +#else + PyObject *ob = PyCObject_FromVoidPtr(vtable, 0); +#endif + if (!ob) + goto bad; + if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0) + goto bad; + Py_DECREF(ob); + return 0; +bad: + Py_XDECREF(ob); + return -1; +} + +/* Import */ +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { + PyObject *empty_list = 0; + PyObject *module = 0; + PyObject *global_dict = 0; + PyObject *empty_dict = 0; + PyObject *list; + #if PY_MAJOR_VERSION < 3 + PyObject *py_import; + py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); + if (!py_import) + goto bad; + #endif + if (from_list) + list = from_list; + else { + empty_list = PyList_New(0); + if (!empty_list) + goto bad; + list = empty_list; + } + global_dict = PyModule_GetDict(__pyx_m); + if (!global_dict) + goto bad; + empty_dict = PyDict_New(); + if (!empty_dict) + goto bad; + { + #if PY_MAJOR_VERSION >= 3 + if (level == -1) { + if (strchr(__Pyx_MODULE_NAME, '.')) { + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, 1); + if (!module) { + if (!PyErr_ExceptionMatches(PyExc_ImportError)) + goto bad; + PyErr_Clear(); + } + } + level = 0; + } + #endif + if (!module) { + #if PY_MAJOR_VERSION < 3 + PyObject *py_level = PyInt_FromLong(level); + if (!py_level) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, py_level, (PyObject *)NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, level); + #endif + } + } +bad: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(py_import); + #endif + Py_XDECREF(empty_list); + Py_XDECREF(empty_dict); + return module; +} + +/* ImportFrom */ +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { + PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); + if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_Format(PyExc_ImportError, + #if PY_MAJOR_VERSION < 3 + "cannot import name %.230s", PyString_AS_STRING(name)); + #else + "cannot import name %S", name); + #endif + } + return value; +} + +/* FetchCommonType */ +static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { + PyObject* fake_module; + PyTypeObject* cached_type = NULL; + fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI); + if (!fake_module) return NULL; + Py_INCREF(fake_module); + cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name); + if (cached_type) { + if (!PyType_Check((PyObject*)cached_type)) { + PyErr_Format(PyExc_TypeError, + "Shared Cython type %.200s is not a type object", + type->tp_name); + goto bad; + } + if (cached_type->tp_basicsize != type->tp_basicsize) { + PyErr_Format(PyExc_TypeError, + "Shared Cython type %.200s has the wrong size, try recompiling", + type->tp_name); + goto bad; + } + } else { + if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; + PyErr_Clear(); + if (PyType_Ready(type) < 0) goto bad; + if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0) + goto bad; + Py_INCREF(type); + cached_type = type; + } +done: + Py_DECREF(fake_module); + return cached_type; +bad: + Py_XDECREF(cached_type); + cached_type = NULL; + goto done; +} + +/* CythonFunction */ +#include +static PyObject * +__Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure) +{ + if (unlikely(op->func_doc == NULL)) { + if (op->func.m_ml->ml_doc) { +#if PY_MAJOR_VERSION >= 3 + op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc); +#else + op->func_doc = PyString_FromString(op->func.m_ml->ml_doc); +#endif + if (unlikely(op->func_doc == NULL)) + return NULL; + } else { + Py_INCREF(Py_None); + return Py_None; + } + } + Py_INCREF(op->func_doc); + return op->func_doc; +} +static int +__Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context) +{ + PyObject *tmp = op->func_doc; + if (value == NULL) { + value = Py_None; + } + Py_INCREF(value); + op->func_doc = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + if (unlikely(op->func_name == NULL)) { +#if PY_MAJOR_VERSION >= 3 + op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name); +#else + op->func_name = PyString_InternFromString(op->func.m_ml->ml_name); +#endif + if (unlikely(op->func_name == NULL)) + return NULL; + } + Py_INCREF(op->func_name); + return op->func_name; +} +static int +__Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context) +{ + PyObject *tmp; +#if PY_MAJOR_VERSION >= 3 + if (unlikely(value == NULL || !PyUnicode_Check(value))) +#else + if (unlikely(value == NULL || !PyString_Check(value))) +#endif + { + PyErr_SetString(PyExc_TypeError, + "__name__ must be set to a string object"); + return -1; + } + tmp = op->func_name; + Py_INCREF(value); + op->func_name = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + Py_INCREF(op->func_qualname); + return op->func_qualname; +} +static int +__Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context) +{ + PyObject *tmp; +#if PY_MAJOR_VERSION >= 3 + if (unlikely(value == NULL || !PyUnicode_Check(value))) +#else + if (unlikely(value == NULL || !PyString_Check(value))) +#endif + { + PyErr_SetString(PyExc_TypeError, + "__qualname__ must be set to a string object"); + return -1; + } + tmp = op->func_qualname; + Py_INCREF(value); + op->func_qualname = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED void *closure) +{ + PyObject *self; + self = m->func_closure; + if (self == NULL) + self = Py_None; + Py_INCREF(self); + return self; +} +static PyObject * +__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + if (unlikely(op->func_dict == NULL)) { + op->func_dict = PyDict_New(); + if (unlikely(op->func_dict == NULL)) + return NULL; + } + Py_INCREF(op->func_dict); + return op->func_dict; +} +static int +__Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context) +{ + PyObject *tmp; + if (unlikely(value == NULL)) { + PyErr_SetString(PyExc_TypeError, + "function's dictionary may not be deleted"); + return -1; + } + if (unlikely(!PyDict_Check(value))) { + PyErr_SetString(PyExc_TypeError, + "setting function's dictionary to a non-dict"); + return -1; + } + tmp = op->func_dict; + Py_INCREF(value); + op->func_dict = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + Py_INCREF(op->func_globals); + return op->func_globals; +} +static PyObject * +__Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + Py_INCREF(Py_None); + return Py_None; +} +static PyObject * +__Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + PyObject* result = (op->func_code) ? op->func_code : Py_None; + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { + int result = 0; + PyObject *res = op->defaults_getter((PyObject *) op); + if (unlikely(!res)) + return -1; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + op->defaults_tuple = PyTuple_GET_ITEM(res, 0); + Py_INCREF(op->defaults_tuple); + op->defaults_kwdict = PyTuple_GET_ITEM(res, 1); + Py_INCREF(op->defaults_kwdict); + #else + op->defaults_tuple = PySequence_ITEM(res, 0); + if (unlikely(!op->defaults_tuple)) result = -1; + else { + op->defaults_kwdict = PySequence_ITEM(res, 1); + if (unlikely(!op->defaults_kwdict)) result = -1; + } + #endif + Py_DECREF(res); + return result; +} +static int +__Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) { + PyObject* tmp; + if (!value) { + value = Py_None; + } else if (value != Py_None && !PyTuple_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__defaults__ must be set to a tuple object"); + return -1; + } + Py_INCREF(value); + tmp = op->defaults_tuple; + op->defaults_tuple = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) { + PyObject* result = op->defaults_tuple; + if (unlikely(!result)) { + if (op->defaults_getter) { + if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL; + result = op->defaults_tuple; + } else { + result = Py_None; + } + } + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) { + PyObject* tmp; + if (!value) { + value = Py_None; + } else if (value != Py_None && !PyDict_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__kwdefaults__ must be set to a dict object"); + return -1; + } + Py_INCREF(value); + tmp = op->defaults_kwdict; + op->defaults_kwdict = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) { + PyObject* result = op->defaults_kwdict; + if (unlikely(!result)) { + if (op->defaults_getter) { + if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL; + result = op->defaults_kwdict; + } else { + result = Py_None; + } + } + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) { + PyObject* tmp; + if (!value || value == Py_None) { + value = NULL; + } else if (!PyDict_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__annotations__ must be set to a dict object"); + return -1; + } + Py_XINCREF(value); + tmp = op->func_annotations; + op->func_annotations = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) { + PyObject* result = op->func_annotations; + if (unlikely(!result)) { + result = PyDict_New(); + if (unlikely(!result)) return NULL; + op->func_annotations = result; + } + Py_INCREF(result); + return result; +} +static PyGetSetDef __pyx_CyFunction_getsets[] = { + {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, + {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, + {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, + {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, + {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, + {(char *) "__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0}, + {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, + {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, + {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, + {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, + {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, + {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, + {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, + {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, + {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, + {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, + {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, + {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, + {0, 0, 0, 0, 0} +}; +static PyMemberDef __pyx_CyFunction_members[] = { + {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), PY_WRITE_RESTRICTED, 0}, + {0, 0, 0, 0, 0} +}; +static PyObject * +__Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args) +{ +#if PY_MAJOR_VERSION >= 3 + return PyUnicode_FromString(m->func.m_ml->ml_name); +#else + return PyString_FromString(m->func.m_ml->ml_name); +#endif +} +static PyMethodDef __pyx_CyFunction_methods[] = { + {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, + {0, 0, 0, 0} +}; +#if PY_VERSION_HEX < 0x030500A0 +#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist) +#else +#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func.m_weakreflist) +#endif +static PyObject *__Pyx_CyFunction_New(PyTypeObject *type, PyMethodDef *ml, int flags, PyObject* qualname, + PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { + __pyx_CyFunctionObject *op = PyObject_GC_New(__pyx_CyFunctionObject, type); + if (op == NULL) + return NULL; + op->flags = flags; + __Pyx_CyFunction_weakreflist(op) = NULL; + op->func.m_ml = ml; + op->func.m_self = (PyObject *) op; + Py_XINCREF(closure); + op->func_closure = closure; + Py_XINCREF(module); + op->func.m_module = module; + op->func_dict = NULL; + op->func_name = NULL; + Py_INCREF(qualname); + op->func_qualname = qualname; + op->func_doc = NULL; + op->func_classobj = NULL; + op->func_globals = globals; + Py_INCREF(op->func_globals); + Py_XINCREF(code); + op->func_code = code; + op->defaults_pyobjects = 0; + op->defaults = NULL; + op->defaults_tuple = NULL; + op->defaults_kwdict = NULL; + op->defaults_getter = NULL; + op->func_annotations = NULL; + PyObject_GC_Track(op); + return (PyObject *) op; +} +static int +__Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) +{ + Py_CLEAR(m->func_closure); + Py_CLEAR(m->func.m_module); + Py_CLEAR(m->func_dict); + Py_CLEAR(m->func_name); + Py_CLEAR(m->func_qualname); + Py_CLEAR(m->func_doc); + Py_CLEAR(m->func_globals); + Py_CLEAR(m->func_code); + Py_CLEAR(m->func_classobj); + Py_CLEAR(m->defaults_tuple); + Py_CLEAR(m->defaults_kwdict); + Py_CLEAR(m->func_annotations); + if (m->defaults) { + PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); + int i; + for (i = 0; i < m->defaults_pyobjects; i++) + Py_XDECREF(pydefaults[i]); + PyObject_Free(m->defaults); + m->defaults = NULL; + } + return 0; +} +static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m) +{ + if (__Pyx_CyFunction_weakreflist(m) != NULL) + PyObject_ClearWeakRefs((PyObject *) m); + __Pyx_CyFunction_clear(m); + PyObject_GC_Del(m); +} +static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) +{ + PyObject_GC_UnTrack(m); + __Pyx__CyFunction_dealloc(m); +} +static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) +{ + Py_VISIT(m->func_closure); + Py_VISIT(m->func.m_module); + Py_VISIT(m->func_dict); + Py_VISIT(m->func_name); + Py_VISIT(m->func_qualname); + Py_VISIT(m->func_doc); + Py_VISIT(m->func_globals); + Py_VISIT(m->func_code); + Py_VISIT(m->func_classobj); + Py_VISIT(m->defaults_tuple); + Py_VISIT(m->defaults_kwdict); + if (m->defaults) { + PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); + int i; + for (i = 0; i < m->defaults_pyobjects; i++) + Py_VISIT(pydefaults[i]); + } + return 0; +} +static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type) +{ + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) { + Py_INCREF(func); + return func; + } + if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) { + if (type == NULL) + type = (PyObject *)(Py_TYPE(obj)); + return __Pyx_PyMethod_New(func, type, (PyObject *)(Py_TYPE(type))); + } + if (obj == Py_None) + obj = NULL; + return __Pyx_PyMethod_New(func, obj, type); +} +static PyObject* +__Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) +{ +#if PY_MAJOR_VERSION >= 3 + return PyUnicode_FromFormat("", + op->func_qualname, (void *)op); +#else + return PyString_FromFormat("", + PyString_AsString(op->func_qualname), (void *)op); +#endif +} +static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) { + PyCFunctionObject* f = (PyCFunctionObject*)func; + PyCFunction meth = f->m_ml->ml_meth; + Py_ssize_t size; + switch (f->m_ml->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) { + case METH_VARARGS: + if (likely(kw == NULL || PyDict_Size(kw) == 0)) + return (*meth)(self, arg); + break; + case METH_VARARGS | METH_KEYWORDS: + return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw); + case METH_NOARGS: + if (likely(kw == NULL || PyDict_Size(kw) == 0)) { + size = PyTuple_GET_SIZE(arg); + if (likely(size == 0)) + return (*meth)(self, NULL); + PyErr_Format(PyExc_TypeError, + "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", + f->m_ml->ml_name, size); + return NULL; + } + break; + case METH_O: + if (likely(kw == NULL || PyDict_Size(kw) == 0)) { + size = PyTuple_GET_SIZE(arg); + if (likely(size == 1)) { + PyObject *result, *arg0; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + arg0 = PyTuple_GET_ITEM(arg, 0); + #else + arg0 = PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL; + #endif + result = (*meth)(self, arg0); + #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) + Py_DECREF(arg0); + #endif + return result; + } + PyErr_Format(PyExc_TypeError, + "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", + f->m_ml->ml_name, size); + return NULL; + } + break; + default: + PyErr_SetString(PyExc_SystemError, "Bad call flags in " + "__Pyx_CyFunction_Call. METH_OLDARGS is no " + "longer supported!"); + return NULL; + } + PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", + f->m_ml->ml_name); + return NULL; +} +static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { + return __Pyx_CyFunction_CallMethod(func, ((PyCFunctionObject*)func)->m_self, arg, kw); +} +static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) { + PyObject *result; + __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func; + if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { + Py_ssize_t argc; + PyObject *new_args; + PyObject *self; + argc = PyTuple_GET_SIZE(args); + new_args = PyTuple_GetSlice(args, 1, argc); + if (unlikely(!new_args)) + return NULL; + self = PyTuple_GetItem(args, 0); + if (unlikely(!self)) { + Py_DECREF(new_args); + return NULL; + } + result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw); + Py_DECREF(new_args); + } else { + result = __Pyx_CyFunction_Call(func, args, kw); + } + return result; +} +static PyTypeObject __pyx_CyFunctionType_type = { + PyVarObject_HEAD_INIT(0, 0) + "cython_function_or_method", + sizeof(__pyx_CyFunctionObject), + 0, + (destructor) __Pyx_CyFunction_dealloc, + 0, + 0, + 0, +#if PY_MAJOR_VERSION < 3 + 0, +#else + 0, +#endif + (reprfunc) __Pyx_CyFunction_repr, + 0, + 0, + 0, + 0, + __Pyx_CyFunction_CallAsMethod, + 0, + 0, + 0, + 0, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, + 0, + (traverseproc) __Pyx_CyFunction_traverse, + (inquiry) __Pyx_CyFunction_clear, + 0, +#if PY_VERSION_HEX < 0x030500A0 + offsetof(__pyx_CyFunctionObject, func_weakreflist), +#else + offsetof(PyCFunctionObject, m_weakreflist), +#endif + 0, + 0, + __pyx_CyFunction_methods, + __pyx_CyFunction_members, + __pyx_CyFunction_getsets, + 0, + 0, + __Pyx_CyFunction_descr_get, + 0, + offsetof(__pyx_CyFunctionObject, func_dict), + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, +#if PY_VERSION_HEX >= 0x030400a1 + 0, +#endif +}; +static int __pyx_CyFunction_init(void) { + __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); + if (unlikely(__pyx_CyFunctionType == NULL)) { + return -1; + } + return 0; +} +static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults = PyObject_Malloc(size); + if (unlikely(!m->defaults)) + return PyErr_NoMemory(); + memset(m->defaults, 0, size); + m->defaults_pyobjects = pyobjects; + return m->defaults; +} +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults_tuple = tuple; + Py_INCREF(tuple); +} +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults_kwdict = dict; + Py_INCREF(dict); +} +static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->func_annotations = dict; + Py_INCREF(dict); +} + +/* PyObjectSetAttrStr */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) { + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_setattro)) + return tp->tp_setattro(obj, attr_name, value); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_setattr)) + return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value); +#endif + return PyObject_SetAttr(obj, attr_name, value); +} +#endif + +/* GetNameInClass */ +static PyObject *__Pyx_GetGlobalNameAfterAttributeLookup(PyObject *name) { + PyObject *result; + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) + return NULL; + __Pyx_PyErr_Clear(); + __Pyx_GetModuleGlobalNameUncached(result, name); + return result; +} +static PyObject *__Pyx__GetNameInClass(PyObject *nmspace, PyObject *name) { + PyObject *result; + result = __Pyx_PyObject_GetAttrStr(nmspace, name); + if (!result) { + result = __Pyx_GetGlobalNameAfterAttributeLookup(name); + } + return result; +} + +/* Globals */ +static PyObject* __Pyx_Globals(void) { + Py_ssize_t i; + PyObject *names; + PyObject *globals = __pyx_d; + Py_INCREF(globals); + names = PyObject_Dir(__pyx_m); + if (!names) + goto bad; + for (i = PyList_GET_SIZE(names)-1; i >= 0; i--) { +#if CYTHON_COMPILING_IN_PYPY + PyObject* name = PySequence_ITEM(names, i); + if (!name) + goto bad; +#else + PyObject* name = PyList_GET_ITEM(names, i); +#endif + if (!PyDict_Contains(globals, name)) { + PyObject* value = __Pyx_GetAttr(__pyx_m, name); + if (!value) { +#if CYTHON_COMPILING_IN_PYPY + Py_DECREF(name); +#endif + goto bad; + } + if (PyDict_SetItem(globals, name, value) < 0) { +#if CYTHON_COMPILING_IN_PYPY + Py_DECREF(name); +#endif + Py_DECREF(value); + goto bad; + } + } +#if CYTHON_COMPILING_IN_PYPY + Py_DECREF(name); +#endif + } + Py_DECREF(names); + return globals; +bad: + Py_XDECREF(names); + Py_XDECREF(globals); + return NULL; +} + +/* CLineInTraceback */ +#ifndef CYTHON_CLINE_IN_TRACEBACK +static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { + PyObject *use_cline; + PyObject *ptype, *pvalue, *ptraceback; +#if CYTHON_COMPILING_IN_CPYTHON + PyObject **cython_runtime_dict; +#endif + if (unlikely(!__pyx_cython_runtime)) { + return c_line; + } + __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); +#if CYTHON_COMPILING_IN_CPYTHON + cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); + if (likely(cython_runtime_dict)) { + __PYX_PY_DICT_LOOKUP_IF_MODIFIED( + use_cline, *cython_runtime_dict, + __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback)) + } else +#endif + { + PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback); + if (use_cline_obj) { + use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; + Py_DECREF(use_cline_obj); + } else { + PyErr_Clear(); + use_cline = NULL; + } + } + if (!use_cline) { + c_line = 0; + PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); + } + else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { + c_line = 0; + } + __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); + return c_line; +} +#endif + +/* CodeObjectCache */ +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { + int start = 0, mid = 0, end = count - 1; + if (end >= 0 && code_line > entries[end].code_line) { + return count; + } + while (start < end) { + mid = start + (end - start) / 2; + if (code_line < entries[mid].code_line) { + end = mid; + } else if (code_line > entries[mid].code_line) { + start = mid + 1; + } else { + return mid; + } + } + if (code_line <= entries[mid].code_line) { + return mid; + } else { + return mid + 1; + } +} +static PyCodeObject *__pyx_find_code_object(int code_line) { + PyCodeObject* code_object; + int pos; + if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { + return NULL; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { + return NULL; + } + code_object = __pyx_code_cache.entries[pos].code_object; + Py_INCREF(code_object); + return code_object; +} +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { + int pos, i; + __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; + if (unlikely(!code_line)) { + return; + } + if (unlikely(!entries)) { + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); + if (likely(entries)) { + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = 64; + __pyx_code_cache.count = 1; + entries[0].code_line = code_line; + entries[0].code_object = code_object; + Py_INCREF(code_object); + } + return; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { + PyCodeObject* tmp = entries[pos].code_object; + entries[pos].code_object = code_object; + Py_DECREF(tmp); + return; + } + if (__pyx_code_cache.count == __pyx_code_cache.max_count) { + int new_max = __pyx_code_cache.max_count + 64; + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( + __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry)); + if (unlikely(!entries)) { + return; + } + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = new_max; + } + for (i=__pyx_code_cache.count; i>pos; i--) { + entries[i] = entries[i-1]; + } + entries[pos].code_line = code_line; + entries[pos].code_object = code_object; + __pyx_code_cache.count++; + Py_INCREF(code_object); +} + +/* AddTraceback */ +#include "compile.h" +#include "frameobject.h" +#include "traceback.h" +static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( + const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyObject *py_srcfile = 0; + PyObject *py_funcname = 0; + #if PY_MAJOR_VERSION < 3 + py_srcfile = PyString_FromString(filename); + #else + py_srcfile = PyUnicode_FromString(filename); + #endif + if (!py_srcfile) goto bad; + if (c_line) { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + #else + py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + #endif + } + else { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromString(funcname); + #else + py_funcname = PyUnicode_FromString(funcname); + #endif + } + if (!py_funcname) goto bad; + py_code = __Pyx_PyCode_New( + 0, + 0, + 0, + 0, + 0, + __pyx_empty_bytes, /*PyObject *code,*/ + __pyx_empty_tuple, /*PyObject *consts,*/ + __pyx_empty_tuple, /*PyObject *names,*/ + __pyx_empty_tuple, /*PyObject *varnames,*/ + __pyx_empty_tuple, /*PyObject *freevars,*/ + __pyx_empty_tuple, /*PyObject *cellvars,*/ + py_srcfile, /*PyObject *filename,*/ + py_funcname, /*PyObject *name,*/ + py_line, + __pyx_empty_bytes /*PyObject *lnotab*/ + ); + Py_DECREF(py_srcfile); + Py_DECREF(py_funcname); + return py_code; +bad: + Py_XDECREF(py_srcfile); + Py_XDECREF(py_funcname); + return NULL; +} +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyFrameObject *py_frame = 0; + PyThreadState *tstate = __Pyx_PyThreadState_Current; + if (c_line) { + c_line = __Pyx_CLineForTraceback(tstate, c_line); + } + py_code = __pyx_find_code_object(c_line ? -c_line : py_line); + if (!py_code) { + py_code = __Pyx_CreateCodeObjectForTraceback( + funcname, c_line, py_line, filename); + if (!py_code) goto bad; + __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); + } + py_frame = PyFrame_New( + tstate, /*PyThreadState *tstate,*/ + py_code, /*PyCodeObject *code,*/ + __pyx_d, /*PyObject *globals,*/ + 0 /*PyObject *locals*/ + ); + if (!py_frame) goto bad; + __Pyx_PyFrame_SetLineNumber(py_frame, py_line); + PyTraceBack_Here(py_frame); +bad: + Py_XDECREF(py_code); + Py_XDECREF(py_frame); +} + +/* CIntToPy */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { + const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(long) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(long) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(long) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(long), + little, !is_unsigned); + } +} + +/* CIntToPy */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { + const int neg_one = (int) ((int) 0 - (int) 1), const_zero = (int) 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(int) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(int) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(int) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(int), + little, !is_unsigned); + } +} + +/* CIntFromPyVerify */ +#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ + __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) +#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ + __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) +#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ + {\ + func_type value = func_value;\ + if (sizeof(target_type) < sizeof(func_type)) {\ + if (unlikely(value != (func_type) (target_type) value)) {\ + func_type zero = 0;\ + if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ + return (target_type) -1;\ + if (is_unsigned && unlikely(value < zero))\ + goto raise_neg_overflow;\ + else\ + goto raise_overflow;\ + }\ + }\ + return (target_type) value;\ + } + +/* CIntFromPy */ +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { + const int neg_one = (int) ((int) 0 - (int) 1), const_zero = (int) 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(int) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (int) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (int) 0; + case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0]) + case 2: + if (8 * sizeof(int) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) { + return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + case 3: + if (8 * sizeof(int) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) { + return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + case 4: + if (8 * sizeof(int) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) { + return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (int) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if (sizeof(int) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (int) 0; + case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0])) + case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0]) + case -2: + if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { + return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 2: + if (8 * sizeof(int) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { + return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case -3: + if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { + return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 3: + if (8 * sizeof(int) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { + return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case -4: + if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { + return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 4: + if (8 * sizeof(int) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { + return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + } +#endif + if (sizeof(int) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + int val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (int) -1; + } + } else { + int val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (int) -1; + val = __Pyx_PyInt_As_int(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to int"); + return (int) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to int"); + return (int) -1; +} + +/* CIntFromPy */ +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { + const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(long) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (long) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (long) 0; + case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0]) + case 2: + if (8 * sizeof(long) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) { + return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + case 3: + if (8 * sizeof(long) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) { + return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + case 4: + if (8 * sizeof(long) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) { + return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (long) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if (sizeof(long) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (long) 0; + case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0])) + case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0]) + case -2: + if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 2: + if (8 * sizeof(long) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case -3: + if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 3: + if (8 * sizeof(long) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case -4: + if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 4: + if (8 * sizeof(long) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + } +#endif + if (sizeof(long) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + long val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (long) -1; + } + } else { + long val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (long) -1; + val = __Pyx_PyInt_As_long(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to long"); + return (long) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to long"); + return (long) -1; +} + +/* FastTypeChecks */ +#if CYTHON_COMPILING_IN_CPYTHON +static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) { + while (a) { + a = a->tp_base; + if (a == b) + return 1; + } + return b == &PyBaseObject_Type; +} +static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) { + PyObject *mro; + if (a == b) return 1; + mro = a->tp_mro; + if (likely(mro)) { + Py_ssize_t i, n; + n = PyTuple_GET_SIZE(mro); + for (i = 0; i < n; i++) { + if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b) + return 1; + } + return 0; + } + return __Pyx_InBases(a, b); +} +#if PY_MAJOR_VERSION == 2 +static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { + PyObject *exception, *value, *tb; + int res; + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ErrFetch(&exception, &value, &tb); + res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; + if (unlikely(res == -1)) { + PyErr_WriteUnraisable(err); + res = 0; + } + if (!res) { + res = PyObject_IsSubclass(err, exc_type2); + if (unlikely(res == -1)) { + PyErr_WriteUnraisable(err); + res = 0; + } + } + __Pyx_ErrRestore(exception, value, tb); + return res; +} +#else +static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { + int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0; + if (!res) { + res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); + } + return res; +} +#endif +static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { + Py_ssize_t i, n; + assert(PyExceptionClass_Check(exc_type)); + n = PyTuple_GET_SIZE(tuple); +#if PY_MAJOR_VERSION >= 3 + for (i=0; i= 0x02070000 + cobj = PyCapsule_New(p, sig, 0); +#else + cobj = PyCObject_FromVoidPtrAndDesc(p, (void *)sig, 0); +#endif + if (!cobj) + goto bad; + if (PyDict_SetItem(d, name, cobj) < 0) + goto bad; + Py_DECREF(cobj); + Py_DECREF(d); + return 0; +bad: + Py_XDECREF(cobj); + Py_XDECREF(d); + return -1; +} + +/* VoidPtrImport */ +#ifndef __PYX_HAVE_RT_ImportVoidPtr +#define __PYX_HAVE_RT_ImportVoidPtr +static int __Pyx_ImportVoidPtr(PyObject *module, const char *name, void **p, const char *sig) { + PyObject *d = 0; + PyObject *cobj = 0; + d = PyObject_GetAttrString(module, (char *)"__pyx_capi__"); + if (!d) + goto bad; + cobj = PyDict_GetItemString(d, name); + if (!cobj) { + PyErr_Format(PyExc_ImportError, + "%.200s does not export expected C variable %.200s", + PyModule_GetName(module), name); + goto bad; + } +#if PY_VERSION_HEX >= 0x02070000 + if (!PyCapsule_IsValid(cobj, sig)) { + PyErr_Format(PyExc_TypeError, + "C variable %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", + PyModule_GetName(module), name, sig, PyCapsule_GetName(cobj)); + goto bad; + } + *p = PyCapsule_GetPointer(cobj, sig); +#else + {const char *desc, *s1, *s2; + desc = (const char *)PyCObject_GetDesc(cobj); + if (!desc) + goto bad; + s1 = desc; s2 = sig; + while (*s1 != '\0' && *s1 == *s2) { s1++; s2++; } + if (*s1 != *s2) { + PyErr_Format(PyExc_TypeError, + "C variable %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", + PyModule_GetName(module), name, sig, desc); + goto bad; + } + *p = PyCObject_AsVoidPtr(cobj);} +#endif + if (!(*p)) + goto bad; + Py_DECREF(d); + return 0; +bad: + Py_XDECREF(d); + return -1; +} +#endif + +/* FunctionImport */ +#ifndef __PYX_HAVE_RT_ImportFunction +#define __PYX_HAVE_RT_ImportFunction +static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig) { + PyObject *d = 0; + PyObject *cobj = 0; + union { + void (*fp)(void); + void *p; + } tmp; + d = PyObject_GetAttrString(module, (char *)"__pyx_capi__"); + if (!d) + goto bad; + cobj = PyDict_GetItemString(d, funcname); + if (!cobj) { + PyErr_Format(PyExc_ImportError, + "%.200s does not export expected C function %.200s", + PyModule_GetName(module), funcname); + goto bad; + } +#if PY_VERSION_HEX >= 0x02070000 + if (!PyCapsule_IsValid(cobj, sig)) { + PyErr_Format(PyExc_TypeError, + "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", + PyModule_GetName(module), funcname, sig, PyCapsule_GetName(cobj)); + goto bad; + } + tmp.p = PyCapsule_GetPointer(cobj, sig); +#else + {const char *desc, *s1, *s2; + desc = (const char *)PyCObject_GetDesc(cobj); + if (!desc) + goto bad; + s1 = desc; s2 = sig; + while (*s1 != '\0' && *s1 == *s2) { s1++; s2++; } + if (*s1 != *s2) { + PyErr_Format(PyExc_TypeError, + "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", + PyModule_GetName(module), funcname, sig, desc); + goto bad; + } + tmp.p = PyCObject_AsVoidPtr(cobj);} +#endif + *f = tmp.fp; + if (!(*f)) + goto bad; + Py_DECREF(d); + return 0; +bad: + Py_XDECREF(d); + return -1; +} +#endif + +/* InitStrings */ +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { + while (t->p) { + #if PY_MAJOR_VERSION < 3 + if (t->is_unicode) { + *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); + } else if (t->intern) { + *t->p = PyString_InternFromString(t->s); + } else { + *t->p = PyString_FromStringAndSize(t->s, t->n - 1); + } + #else + if (t->is_unicode | t->is_str) { + if (t->intern) { + *t->p = PyUnicode_InternFromString(t->s); + } else if (t->encoding) { + *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); + } else { + *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); + } + } else { + *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); + } + #endif + if (!*t->p) + return -1; + if (PyObject_Hash(*t->p) == -1) + return -1; + ++t; + } + return 0; +} + +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { + return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); +} +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { + Py_ssize_t ignore; + return __Pyx_PyObject_AsStringAndSize(o, &ignore); +} +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +#if !CYTHON_PEP393_ENABLED +static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { + char* defenc_c; + PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); + if (!defenc) return NULL; + defenc_c = PyBytes_AS_STRING(defenc); +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + { + char* end = defenc_c + PyBytes_GET_SIZE(defenc); + char* c; + for (c = defenc_c; c < end; c++) { + if ((unsigned char) (*c) >= 128) { + PyUnicode_AsASCIIString(o); + return NULL; + } + } + } +#endif + *length = PyBytes_GET_SIZE(defenc); + return defenc_c; +} +#else +static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { + if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + if (likely(PyUnicode_IS_ASCII(o))) { + *length = PyUnicode_GET_LENGTH(o); + return PyUnicode_AsUTF8(o); + } else { + PyUnicode_AsASCIIString(o); + return NULL; + } +#else + return PyUnicode_AsUTF8AndSize(o, length); +#endif +} +#endif +#endif +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT + if ( +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + __Pyx_sys_getdefaultencoding_not_ascii && +#endif + PyUnicode_Check(o)) { + return __Pyx_PyUnicode_AsStringAndSize(o, length); + } else +#endif +#if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) + if (PyByteArray_Check(o)) { + *length = PyByteArray_GET_SIZE(o); + return PyByteArray_AS_STRING(o); + } else +#endif + { + char* result; + int r = PyBytes_AsStringAndSize(o, &result, length); + if (unlikely(r < 0)) { + return NULL; + } else { + return result; + } + } +} +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { + int is_true = x == Py_True; + if (is_true | (x == Py_False) | (x == Py_None)) return is_true; + else return PyObject_IsTrue(x); +} +static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) { + int retval; + if (unlikely(!x)) return -1; + retval = __Pyx_PyObject_IsTrue(x); + Py_DECREF(x); + return retval; +} +static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) { +#if PY_MAJOR_VERSION >= 3 + if (PyLong_Check(result)) { + if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, + "__int__ returned non-int (type %.200s). " + "The ability to return an instance of a strict subclass of int " + "is deprecated, and may be removed in a future version of Python.", + Py_TYPE(result)->tp_name)) { + Py_DECREF(result); + return NULL; + } + return result; + } +#endif + PyErr_Format(PyExc_TypeError, + "__%.4s__ returned non-%.4s (type %.200s)", + type_name, type_name, Py_TYPE(result)->tp_name); + Py_DECREF(result); + return NULL; +} +static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { +#if CYTHON_USE_TYPE_SLOTS + PyNumberMethods *m; +#endif + const char *name = NULL; + PyObject *res = NULL; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x) || PyLong_Check(x))) +#else + if (likely(PyLong_Check(x))) +#endif + return __Pyx_NewRef(x); +#if CYTHON_USE_TYPE_SLOTS + m = Py_TYPE(x)->tp_as_number; + #if PY_MAJOR_VERSION < 3 + if (m && m->nb_int) { + name = "int"; + res = m->nb_int(x); + } + else if (m && m->nb_long) { + name = "long"; + res = m->nb_long(x); + } + #else + if (likely(m && m->nb_int)) { + name = "int"; + res = m->nb_int(x); + } + #endif +#else + if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { + res = PyNumber_Int(x); + } +#endif + if (likely(res)) { +#if PY_MAJOR_VERSION < 3 + if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) { +#else + if (unlikely(!PyLong_CheckExact(res))) { +#endif + return __Pyx_PyNumber_IntOrLongWrongResultType(res, name); + } + } + else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_TypeError, + "an integer is required"); + } + return res; +} +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { + Py_ssize_t ival; + PyObject *x; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_CheckExact(b))) { + if (sizeof(Py_ssize_t) >= sizeof(long)) + return PyInt_AS_LONG(b); + else + return PyInt_AsSsize_t(b); + } +#endif + if (likely(PyLong_CheckExact(b))) { + #if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)b)->ob_digit; + const Py_ssize_t size = Py_SIZE(b); + if (likely(__Pyx_sst_abs(size) <= 1)) { + ival = likely(size) ? digits[0] : 0; + if (size == -1) ival = -ival; + return ival; + } else { + switch (size) { + case 2: + if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { + return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -2: + if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case 3: + if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { + return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -3: + if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case 4: + if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { + return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -4: + if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + } + } + #endif + return PyLong_AsSsize_t(b); + } + x = PyNumber_Index(b); + if (!x) return -1; + ival = PyInt_AsSsize_t(x); + Py_DECREF(x); + return ival; +} +static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) { + return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False); +} +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { + return PyInt_FromSize_t(ival); +} + + +#endif /* Py_PYTHON_H */ diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/event.html b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/event.html new file mode 100644 index 00000000..1356c532 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/event.html @@ -0,0 +1,3680 @@ + + + + + + Cython: event.py + + + +

Generated by Cython 0.29.2

+

+ Yellow lines hint at Python interaction.
+ Click on a line that starts with a "+" to see the C code that Cython generated for it. +

+

Raw output: event.c

+
+001: # Copyright (c) 2009-2016 Denis Bilenko, gevent contributors. See LICENSE for details.
+
  __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
 002: # cython: auto_pickle=False,embedsignature=True,always_allow_keywords=False,infer_types=True
+
 003: 
+
 004: """Basic synchronization primitives: Event and AsyncResult"""
+
 005: from __future__ import print_function
+
 006: 
+
+007: from gevent._util import _NONE
+
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(__pyx_n_s_NONE);
+  __Pyx_GIVEREF(__pyx_n_s_NONE);
+  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_NONE);
+  __pyx_t_2 = __Pyx_Import(__pyx_n_s_gevent__util, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_NONE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_NONE, __pyx_t_1) < 0) __PYX_ERR(0, 7, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+008: from gevent._compat import reraise
+
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_reraise);
+  __Pyx_GIVEREF(__pyx_n_s_reraise);
+  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_reraise);
+  __pyx_t_1 = __Pyx_Import(__pyx_n_s_gevent__compat, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 8, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_reraise); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(__pyx_t_2);
+  __Pyx_XGOTREF(__pyx_v_6gevent_6_event_reraise);
+  __Pyx_DECREF_SET(__pyx_v_6gevent_6_event_reraise, __pyx_t_2);
+  __Pyx_GIVEREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+009: from gevent._tblib import dump_traceback, load_traceback
+
  __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 9, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(__pyx_n_s_dump_traceback);
+  __Pyx_GIVEREF(__pyx_n_s_dump_traceback);
+  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_dump_traceback);
+  __Pyx_INCREF(__pyx_n_s_load_traceback);
+  __Pyx_GIVEREF(__pyx_n_s_load_traceback);
+  PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_load_traceback);
+  __pyx_t_2 = __Pyx_Import(__pyx_n_s_gevent__tblib, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_dump_traceback); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 9, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(__pyx_t_1);
+  __Pyx_XGOTREF(__pyx_v_6gevent_6_event_dump_traceback);
+  __Pyx_DECREF_SET(__pyx_v_6gevent_6_event_dump_traceback, __pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_load_traceback); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 9, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(__pyx_t_1);
+  __Pyx_XGOTREF(__pyx_v_6gevent_6_event_load_traceback);
+  __Pyx_DECREF_SET(__pyx_v_6gevent_6_event_load_traceback, __pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
 010: 
+
+011: from gevent.timeout import Timeout
+
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 11, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_Timeout);
+  __Pyx_GIVEREF(__pyx_n_s_Timeout);
+  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_Timeout);
+  __pyx_t_1 = __Pyx_Import(__pyx_n_s_gevent_timeout, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 11, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_Timeout); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 11, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(__pyx_t_2);
+  __Pyx_XGOTREF(__pyx_v_6gevent_6_event_Timeout);
+  __Pyx_DECREF_SET(__pyx_v_6gevent_6_event_Timeout, __pyx_t_2);
+  __Pyx_GIVEREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 012: 
+
 013: 
+
+014: __all__ = [
+
  __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 14, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(__pyx_n_s_Event);
+  __Pyx_GIVEREF(__pyx_n_s_Event);
+  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_Event);
+  __Pyx_INCREF(__pyx_n_s_AsyncResult);
+  __Pyx_GIVEREF(__pyx_n_s_AsyncResult);
+  PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_AsyncResult);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_all, __pyx_t_1) < 0) __PYX_ERR(0, 14, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 015:     'Event',
+
 016:     'AsyncResult',
+
 017: ]
+
 018: 
+
+019: def _get_linkable():
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_event_1_get_linkable(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6gevent_6_event__get_linkable[] = "_get_linkable()";
+static PyMethodDef __pyx_mdef_6gevent_6_event_1_get_linkable = {"_get_linkable", (PyCFunction)__pyx_pw_6gevent_6_event_1_get_linkable, METH_NOARGS, __pyx_doc_6gevent_6_event__get_linkable};
+static PyObject *__pyx_pw_6gevent_6_event_1_get_linkable(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_get_linkable (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_6_event__get_linkable(__pyx_self);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_event__get_linkable(CYTHON_UNUSED PyObject *__pyx_self) {
+  PyObject *__pyx_v_x = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_get_linkable", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_AddTraceback("gevent._event._get_linkable", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_x);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__2 = PyTuple_Pack(1, __pyx_n_s_x); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 19, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__2);
+  __Pyx_GIVEREF(__pyx_tuple__2);
+/* … */
+  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_event_1_get_linkable, 0, __pyx_n_s_get_linkable, NULL, __pyx_n_s_gevent__event, __pyx_d, ((PyObject *)__pyx_codeobj__3)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 19, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_linkable, __pyx_t_1) < 0) __PYX_ERR(0, 19, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_codeobj__3 = (PyObject*)__Pyx_PyCode_New(0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_event_py, __pyx_n_s_get_linkable, 19, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__3)) __PYX_ERR(0, 19, __pyx_L1_error)
+
+020:     x = __import__('gevent._abstract_linkable')
+
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin___import__, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 20, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_v_x = __pyx_t_1;
+  __pyx_t_1 = 0;
+/* … */
+  __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_gevent__abstract_linkable); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 20, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple_);
+  __Pyx_GIVEREF(__pyx_tuple_);
+
+021:     return x._abstract_linkable.AbstractLinkable
+
  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_abstract_linkable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 21, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_AbstractLinkable); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 21, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_r = __pyx_t_2;
+  __pyx_t_2 = 0;
+  goto __pyx_L0;
+
+022: locals()['AbstractLinkable'] = _get_linkable()
+
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_get_linkable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 22, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 22, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_1 = __Pyx_Globals(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 22, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (unlikely(PyDict_SetItem(__pyx_t_1, __pyx_n_s_AbstractLinkable, __pyx_t_2) < 0)) __PYX_ERR(0, 22, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+023: del _get_linkable
+
  if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_get_linkable) < 0) __PYX_ERR(0, 23, __pyx_L1_error)
+
 024: 
+
 025: # Sadly, something about the way we have to "import" AbstractLinkable
+
 026: # breaks pylint's inference of slots, even though they're declared
+
 027: # right here.
+
 028: # pylint:disable=assigning-non-slot
+
 029: 
+
+030: class Event(AbstractLinkable): # pylint:disable=undefined-variable
+
struct __pyx_vtabstruct_6gevent_6_event_Event {
+  struct __pyx_vtabstruct_6gevent_19__abstract_linkable_AbstractLinkable __pyx_base;
+};
+static struct __pyx_vtabstruct_6gevent_6_event_Event *__pyx_vtabptr_6gevent_6_event_Event;
+
+
 031:     """A synchronization primitive that allows one greenlet to wake up one or more others.
+
 032:     It has the same interface as :class:`threading.Event` but works across greenlets.
+
 033: 
+
 034:     An event object manages an internal flag that can be set to true with the
+
 035:     :meth:`set` method and reset to false with the :meth:`clear` method. The :meth:`wait` method
+
 036:     blocks until the flag is true.
+
 037: 
+
 038:     .. note::
+
 039:         The order and timing in which waiting greenlets are awakened is not determined.
+
 040:         As an implementation note, in gevent 1.1 and 1.0, waiting greenlets are awakened in a
+
 041:         undetermined order sometime *after* the current greenlet yields to the event loop. Other greenlets
+
 042:         (those not waiting to be awakened) may run between the current greenlet yielding and
+
 043:         the waiting greenlets being awakened. These details may change in the future.
+
 044:     """
+
 045: 
+
+046:     __slots__ = ('_flag',)
+
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_event_Event->tp_dict, __pyx_n_s_slots, __pyx_tuple__4) < 0) __PYX_ERR(0, 46, __pyx_L1_error)
+  PyType_Modified(__pyx_ptype_6gevent_6_event_Event);
+/* … */
+  __pyx_tuple__4 = PyTuple_Pack(1, __pyx_n_s_flag); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 46, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__4);
+  __Pyx_GIVEREF(__pyx_tuple__4);
+
 047: 
+
+048:     def __init__(self):
+
/* Python wrapper */
+static int __pyx_pw_6gevent_6_event_5Event_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static int __pyx_pw_6gevent_6_event_5Event_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
+  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
+    __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
+  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1;
+  __pyx_r = __pyx_pf_6gevent_6_event_5Event___init__(((struct __pyx_obj_6gevent_6_event_Event *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_6_event_5Event___init__(struct __pyx_obj_6gevent_6_event_Event *__pyx_v_self) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = 0;
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_AddTraceback("gevent._event.Event.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = -1;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+049:         super(Event, self).__init__()
+
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 49, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(((PyObject *)__pyx_ptype_6gevent_6_event_Event));
+  __Pyx_GIVEREF(((PyObject *)__pyx_ptype_6gevent_6_event_Event));
+  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_ptype_6gevent_6_event_Event));
+  __Pyx_INCREF(((PyObject *)__pyx_v_self));
+  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
+  PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_self));
+  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 49, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 49, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __pyx_t_3 = NULL;
+  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+    if (likely(__pyx_t_3)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+      __Pyx_INCREF(__pyx_t_3);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_2, function);
+    }
+  }
+  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 49, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+050:         self._flag = False
+
  __pyx_v_self->_flag = 0;
+
 051: 
+
+052:     def __str__(self):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_event_5Event_3__str__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_6_event_5Event_3__str__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_6_event_5Event_2__str__(((struct __pyx_obj_6gevent_6_event_Event *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_event_5Event_2__str__(struct __pyx_obj_6gevent_6_event_Event *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__str__", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_XDECREF(__pyx_t_6);
+  __Pyx_AddTraceback("gevent._event.Event.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+053:         return '<%s %s _links[%s]>' % (self.__class__.__name__, (self._flag and 'set') or 'clear',
+
  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 53, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 53, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  if (!__pyx_v_self->_flag) {
+    goto __pyx_L4_next_or;
+  } else {
+  }
+  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_n_s_set); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 53, __pyx_L1_error)
+  if (!__pyx_t_3) {
+  } else {
+    __Pyx_INCREF(__pyx_n_s_set);
+    __pyx_t_1 = __pyx_n_s_set;
+    goto __pyx_L3_bool_binop_done;
+  }
+  __pyx_L4_next_or:;
+  __Pyx_INCREF(__pyx_n_s_clear);
+  __pyx_t_1 = __pyx_n_s_clear;
+  __pyx_L3_bool_binop_done:;
+/* … */
+  __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 53, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_5);
+  __Pyx_GIVEREF(__pyx_t_2);
+  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2);
+  __Pyx_GIVEREF(__pyx_t_1);
+  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_4);
+  PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_4);
+  __pyx_t_2 = 0;
+  __pyx_t_1 = 0;
+  __pyx_t_4 = 0;
+  __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_s_s__links_s, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 53, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_4);
+  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+  __pyx_r = __pyx_t_4;
+  __pyx_t_4 = 0;
+  goto __pyx_L0;
+
+054:                                        self.linkcount())
+
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_linkcount); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 54, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_5);
+  __pyx_t_6 = NULL;
+  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
+    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
+    if (likely(__pyx_t_6)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
+      __Pyx_INCREF(__pyx_t_6);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_5, function);
+    }
+  }
+  __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
+  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 54, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_4);
+  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+
 055: 
+
+056:     def is_set(self):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_event_5Event_5is_set(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6gevent_6_event_5Event_4is_set[] = "Event.is_set(self)\nReturn true if and only if the internal flag is true.";
+static PyMethodDef __pyx_mdef_6gevent_6_event_5Event_5is_set = {"is_set", (PyCFunction)__pyx_pw_6gevent_6_event_5Event_5is_set, METH_NOARGS, __pyx_doc_6gevent_6_event_5Event_4is_set};
+static PyObject *__pyx_pw_6gevent_6_event_5Event_5is_set(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("is_set (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_6_event_5Event_4is_set(((struct __pyx_obj_6gevent_6_event_Event *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_event_5Event_4is_set(struct __pyx_obj_6gevent_6_event_Event *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("is_set", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent._event.Event.is_set", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__5 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 56, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__5);
+  __Pyx_GIVEREF(__pyx_tuple__5);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_event_5Event_5is_set, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Event_is_set, NULL, __pyx_n_s_gevent__event, __pyx_d, ((PyObject *)__pyx_codeobj__6)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 56, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_event_Event->tp_dict, __pyx_n_s_is_set, __pyx_t_2) < 0) __PYX_ERR(0, 56, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_6_event_Event);
+  __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__5, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_event_py, __pyx_n_s_is_set, 56, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__6)) __PYX_ERR(0, 56, __pyx_L1_error)
+
 057:         """Return true if and only if the internal flag is true."""
+
+058:         return self._flag
+
  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->_flag); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 58, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
 059: 
+
+060:     def isSet(self):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_event_5Event_7isSet(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6gevent_6_event_5Event_6isSet[] = "Event.isSet(self)";
+static PyMethodDef __pyx_mdef_6gevent_6_event_5Event_7isSet = {"isSet", (PyCFunction)__pyx_pw_6gevent_6_event_5Event_7isSet, METH_NOARGS, __pyx_doc_6gevent_6_event_5Event_6isSet};
+static PyObject *__pyx_pw_6gevent_6_event_5Event_7isSet(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("isSet (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_6_event_5Event_6isSet(((struct __pyx_obj_6gevent_6_event_Event *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_event_5Event_6isSet(struct __pyx_obj_6gevent_6_event_Event *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("isSet", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent._event.Event.isSet", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__7 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 60, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__7);
+  __Pyx_GIVEREF(__pyx_tuple__7);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_event_5Event_7isSet, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Event_isSet, NULL, __pyx_n_s_gevent__event, __pyx_d, ((PyObject *)__pyx_codeobj__8)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 60, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_event_Event->tp_dict, __pyx_n_s_isSet, __pyx_t_2) < 0) __PYX_ERR(0, 60, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_6_event_Event);
+  __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_event_py, __pyx_n_s_isSet, 60, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) __PYX_ERR(0, 60, __pyx_L1_error)
+
 061:         # makes it a better drop-in replacement for threading.Event
+
+062:         return self._flag
+
  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->_flag); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 62, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
 063: 
+
+064:     def ready(self):
+
static PyObject *__pyx_pw_6gevent_6_event_5Event_9ready(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static int __pyx_f_6gevent_6_event_5Event_ready(struct __pyx_obj_6gevent_6_event_Event *__pyx_v_self, int __pyx_skip_dispatch) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("ready", 0);
+  /* Check if called by wrapper */
+  if (unlikely(__pyx_skip_dispatch)) ;
+  /* Check if overridden in Python */
+  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
+    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
+    if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
+    else {
+      PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      #endif
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_ready); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 64, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_6_event_5Event_9ready)) {
+        __Pyx_INCREF(__pyx_t_1);
+        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+          if (likely(__pyx_t_4)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+            __Pyx_INCREF(__pyx_t_4);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_3, function);
+          }
+        }
+        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
+        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 64, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 64, __pyx_L1_error)
+        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+        __pyx_r = __pyx_t_5;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        goto __pyx_L0;
+      }
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+      tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
+      if (unlikely(type_dict_guard != tp_dict_version)) {
+        tp_dict_version = obj_dict_version = 0;
+      }
+      #endif
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    }
+    #endif
+  }
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_WriteUnraisable("gevent._event.Event.ready", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_event_5Event_9ready(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6gevent_6_event_5Event_8ready[] = "Event.ready(self) -> bool";
+static PyMethodDef __pyx_mdef_6gevent_6_event_5Event_9ready = {"ready", (PyCFunction)__pyx_pw_6gevent_6_event_5Event_9ready, METH_NOARGS, __pyx_doc_6gevent_6_event_5Event_8ready};
+static PyObject *__pyx_pw_6gevent_6_event_5Event_9ready(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("ready (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_6_event_5Event_8ready(((struct __pyx_obj_6gevent_6_event_Event *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_event_5Event_8ready(struct __pyx_obj_6gevent_6_event_Event *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("ready", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_f_6gevent_6_event_5Event_ready(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 64, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent._event.Event.ready", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__9 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 64, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__9);
+  __Pyx_GIVEREF(__pyx_tuple__9);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_event_5Event_9ready, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Event_ready, NULL, __pyx_n_s_gevent__event, __pyx_d, ((PyObject *)__pyx_codeobj__10)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 64, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_event_Event->tp_dict, __pyx_n_s_ready, __pyx_t_2) < 0) __PYX_ERR(0, 64, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_6_event_Event);
+  __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__9, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_event_py, __pyx_n_s_ready, 64, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__10)) __PYX_ERR(0, 64, __pyx_L1_error)
+
 065:         # makes it compatible with AsyncResult and Greenlet (for
+
 066:         # example in wait())
+
+067:         return self._flag
+
  __pyx_r = __pyx_v_self->_flag;
+  goto __pyx_L0;
+
 068: 
+
+069:     def set(self):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_event_5Event_11set(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6gevent_6_event_5Event_10set[] = "Event.set(self)\n\n        Set the internal flag to true.\n\n        All greenlets waiting for it to become true are awakened in\n        some order at some time in the future. Greenlets that call\n        :meth:`wait` once the flag is true will not block at all\n        (until :meth:`clear` is called).\n        ";
+static PyMethodDef __pyx_mdef_6gevent_6_event_5Event_11set = {"set", (PyCFunction)__pyx_pw_6gevent_6_event_5Event_11set, METH_NOARGS, __pyx_doc_6gevent_6_event_5Event_10set};
+static PyObject *__pyx_pw_6gevent_6_event_5Event_11set(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("set (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_6_event_5Event_10set(((struct __pyx_obj_6gevent_6_event_Event *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_event_5Event_10set(struct __pyx_obj_6gevent_6_event_Event *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("set", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent._event.Event.set", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__11 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 69, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__11);
+  __Pyx_GIVEREF(__pyx_tuple__11);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_event_5Event_11set, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Event_set, NULL, __pyx_n_s_gevent__event, __pyx_d, ((PyObject *)__pyx_codeobj__12)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 69, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_event_Event->tp_dict, __pyx_n_s_set, __pyx_t_2) < 0) __PYX_ERR(0, 69, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_6_event_Event);
+  __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__11, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_event_py, __pyx_n_s_set, 69, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(0, 69, __pyx_L1_error)
+
 070:         """
+
 071:         Set the internal flag to true.
+
 072: 
+
 073:         All greenlets waiting for it to become true are awakened in
+
 074:         some order at some time in the future. Greenlets that call
+
 075:         :meth:`wait` once the flag is true will not block at all
+
 076:         (until :meth:`clear` is called).
+
 077:         """
+
+078:         self._flag = True
+
  __pyx_v_self->_flag = 1;
+
+079:         self._check_and_notify()
+
  __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_6_event_Event *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._check_and_notify(((struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 79, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 080: 
+
+081:     def clear(self):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_event_5Event_13clear(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6gevent_6_event_5Event_12clear[] = "Event.clear(self)\n\n        Reset the internal flag to false.\n\n        Subsequently, threads calling :meth:`wait` will block until\n        :meth:`set` is called to set the internal flag to true again.\n        ";
+static PyMethodDef __pyx_mdef_6gevent_6_event_5Event_13clear = {"clear", (PyCFunction)__pyx_pw_6gevent_6_event_5Event_13clear, METH_NOARGS, __pyx_doc_6gevent_6_event_5Event_12clear};
+static PyObject *__pyx_pw_6gevent_6_event_5Event_13clear(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("clear (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_6_event_5Event_12clear(((struct __pyx_obj_6gevent_6_event_Event *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_event_5Event_12clear(struct __pyx_obj_6gevent_6_event_Event *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("clear", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__13 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 81, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__13);
+  __Pyx_GIVEREF(__pyx_tuple__13);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_event_5Event_13clear, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Event_clear, NULL, __pyx_n_s_gevent__event, __pyx_d, ((PyObject *)__pyx_codeobj__14)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 81, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_event_Event->tp_dict, __pyx_n_s_clear, __pyx_t_2) < 0) __PYX_ERR(0, 81, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_6_event_Event);
+  __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__13, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_event_py, __pyx_n_s_clear, 81, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__14)) __PYX_ERR(0, 81, __pyx_L1_error)
+
 082:         """
+
 083:         Reset the internal flag to false.
+
 084: 
+
 085:         Subsequently, threads calling :meth:`wait` will block until
+
 086:         :meth:`set` is called to set the internal flag to true again.
+
 087:         """
+
+088:         self._flag = False
+
  __pyx_v_self->_flag = 0;
+
 089: 
+
+090:     def _wait_return_value(self, waited, wait_success):
+
static PyObject *__pyx_f_6gevent_6_event_5Event__wait_return_value(struct __pyx_obj_6gevent_6_event_Event *__pyx_v_self, PyObject *__pyx_v_waited, PyObject *__pyx_v_wait_success) {
+  int __pyx_v_flag;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_wait_return_value", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_AddTraceback("gevent._event.Event._wait_return_value", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
 091:         # To avoid the race condition outlined in http://bugs.python.org/issue13502,
+
 092:         # if we had to wait, then we need to return whether or not
+
 093:         # the condition got changed. Otherwise we simply echo
+
 094:         # the current state of the flag (which should be true)
+
+095:         if not waited:
+
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_waited); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 95, __pyx_L1_error)
+  __pyx_t_2 = ((!__pyx_t_1) != 0);
+  if (__pyx_t_2) {
+/* … */
+  }
+
+096:             flag = self._flag
+
    __pyx_t_2 = __pyx_v_self->_flag;
+    __pyx_v_flag = __pyx_t_2;
+
+097:             assert flag, "if we didn't wait we should already be set"
+
    #ifndef CYTHON_WITHOUT_ASSERTIONS
+    if (unlikely(!Py_OptimizeFlag)) {
+      if (unlikely(!(__pyx_v_flag != 0))) {
+        PyErr_SetObject(PyExc_AssertionError, __pyx_kp_s_if_we_didn_t_wait_we_should_alre);
+        __PYX_ERR(0, 97, __pyx_L1_error)
+      }
+    }
+    #endif
+
+098:             return flag
+
    __Pyx_XDECREF(__pyx_r);
+    __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_v_flag); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 98, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __pyx_r = __pyx_t_3;
+    __pyx_t_3 = 0;
+    goto __pyx_L0;
+
 099: 
+
+100:         return wait_success
+
  __Pyx_XDECREF(__pyx_r);
+  __Pyx_INCREF(__pyx_v_wait_success);
+  __pyx_r = __pyx_v_wait_success;
+  goto __pyx_L0;
+
 101: 
+
+102:     def wait(self, timeout=None):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_event_5Event_15wait(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_6gevent_6_event_5Event_14wait[] = "Event.wait(self, timeout=None)\n\n        Block until the internal flag is true.\n\n        If the internal flag is true on entry, return immediately. Otherwise,\n        block until another thread (greenlet) calls :meth:`set` to set the flag to true,\n        or until the optional timeout occurs.\n\n        When the *timeout* argument is present and not ``None``, it should be a\n        floating point number specifying a timeout for the operation in seconds\n        (or fractions thereof).\n\n        :return: This method returns true if and only if the internal flag has been set to\n            true, either before the wait call or after the wait starts, so it will\n            always return ``True`` except if a timeout is given and the operation\n            times out.\n\n        .. versionchanged:: 1.1\n            The return value represents the flag during the elapsed wait, not\n            just after it elapses. This solves a race condition if one greenlet\n            sets and then clears the flag without switching, while other greenlets\n            are waiting. When the waiters wake up, this will return True; previously,\n            they would still wake up, but the return value would be False. This is most\n            noticeable when the *timeout* is present.\n        ";
+static PyMethodDef __pyx_mdef_6gevent_6_event_5Event_15wait = {"wait", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_6_event_5Event_15wait, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_6_event_5Event_14wait};
+static PyObject *__pyx_pw_6gevent_6_event_5Event_15wait(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_timeout = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("wait (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_timeout,0};
+    PyObject* values[1] = {0};
+    values[0] = ((PyObject *)Py_None);
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_timeout);
+          if (value) { values[0] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "wait") < 0)) __PYX_ERR(0, 102, __pyx_L3_error)
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    __pyx_v_timeout = values[0];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("wait", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 102, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent._event.Event.wait", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_6_event_5Event_14wait(((struct __pyx_obj_6gevent_6_event_Event *)__pyx_v_self), __pyx_v_timeout);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_event_5Event_14wait(struct __pyx_obj_6gevent_6_event_Event *__pyx_v_self, PyObject *__pyx_v_timeout) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("wait", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent._event.Event.wait", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__15 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_timeout); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(0, 102, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__15);
+  __Pyx_GIVEREF(__pyx_tuple__15);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_event_5Event_15wait, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Event_wait, NULL, __pyx_n_s_gevent__event, __pyx_d, ((PyObject *)__pyx_codeobj__16)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 102, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_event_Event->tp_dict, __pyx_n_s_wait, __pyx_t_2) < 0) __PYX_ERR(0, 102, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_6_event_Event);
+  __pyx_codeobj__16 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__15, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_event_py, __pyx_n_s_wait, 102, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__16)) __PYX_ERR(0, 102, __pyx_L1_error)
+
 103:         """
+
 104:         Block until the internal flag is true.
+
 105: 
+
 106:         If the internal flag is true on entry, return immediately. Otherwise,
+
 107:         block until another thread (greenlet) calls :meth:`set` to set the flag to true,
+
 108:         or until the optional timeout occurs.
+
 109: 
+
 110:         When the *timeout* argument is present and not ``None``, it should be a
+
 111:         floating point number specifying a timeout for the operation in seconds
+
 112:         (or fractions thereof).
+
 113: 
+
 114:         :return: This method returns true if and only if the internal flag has been set to
+
 115:             true, either before the wait call or after the wait starts, so it will
+
 116:             always return ``True`` except if a timeout is given and the operation
+
 117:             times out.
+
 118: 
+
 119:         .. versionchanged:: 1.1
+
 120:             The return value represents the flag during the elapsed wait, not
+
 121:             just after it elapses. This solves a race condition if one greenlet
+
 122:             sets and then clears the flag without switching, while other greenlets
+
 123:             are waiting. When the waiters wake up, this will return True; previously,
+
 124:             they would still wake up, but the return value would be False. This is most
+
 125:             noticeable when the *timeout* is present.
+
 126:         """
+
+127:         return self._wait(timeout)
+
  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_2.__pyx_n = 1;
+  __pyx_t_2.timeout = __pyx_v_timeout;
+  __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_6_event_Event *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._wait(((struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *)__pyx_v_self), &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 127, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
 128: 
+
+129:     def _reset_internal_locks(self): # pragma: no cover
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_event_5Event_17_reset_internal_locks(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6gevent_6_event_5Event_16_reset_internal_locks[] = "Event._reset_internal_locks(self)";
+static PyMethodDef __pyx_mdef_6gevent_6_event_5Event_17_reset_internal_locks = {"_reset_internal_locks", (PyCFunction)__pyx_pw_6gevent_6_event_5Event_17_reset_internal_locks, METH_NOARGS, __pyx_doc_6gevent_6_event_5Event_16_reset_internal_locks};
+static PyObject *__pyx_pw_6gevent_6_event_5Event_17_reset_internal_locks(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_reset_internal_locks (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_6_event_5Event_16_reset_internal_locks(((struct __pyx_obj_6gevent_6_event_Event *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_event_5Event_16_reset_internal_locks(CYTHON_UNUSED struct __pyx_obj_6gevent_6_event_Event *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_reset_internal_locks", 0);
+
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__17 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(0, 129, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__17);
+  __Pyx_GIVEREF(__pyx_tuple__17);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_event_5Event_17_reset_internal_locks, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Event__reset_internal_locks, NULL, __pyx_n_s_gevent__event, __pyx_d, ((PyObject *)__pyx_codeobj__18)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 129, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_event_Event->tp_dict, __pyx_n_s_reset_internal_locks, __pyx_t_2) < 0) __PYX_ERR(0, 129, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_6_event_Event);
+  __pyx_codeobj__18 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__17, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_event_py, __pyx_n_s_reset_internal_locks, 129, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__18)) __PYX_ERR(0, 129, __pyx_L1_error)
+
 130:         # for compatibility with threading.Event
+
 131:         #  Exception AttributeError: AttributeError("'Event' object has no attribute '_reset_internal_locks'",)
+
 132:         # in <module 'threading' from '/usr/lib/python2.7/threading.pyc'> ignored
+
 133:         pass
+
 134: 
+
 135: 
+
+136: class AsyncResult(AbstractLinkable): # pylint:disable=undefined-variable
+
struct __pyx_vtabstruct_6gevent_6_event_AsyncResult {
+  struct __pyx_vtabstruct_6gevent_19__abstract_linkable_AbstractLinkable __pyx_base;
+  PyObject *(*get)(struct __pyx_obj_6gevent_6_event_AsyncResult *, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_6_event_11AsyncResult_get *__pyx_optional_args);
+  int (*successful)(struct __pyx_obj_6gevent_6_event_AsyncResult *, int __pyx_skip_dispatch);
+  PyObject *(*wait)(struct __pyx_obj_6gevent_6_event_AsyncResult *, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_6_event_11AsyncResult_wait *__pyx_optional_args);
+  int (*done)(struct __pyx_obj_6gevent_6_event_AsyncResult *, int __pyx_skip_dispatch);
+  int (*cancel)(struct __pyx_obj_6gevent_6_event_AsyncResult *, int __pyx_skip_dispatch);
+  int (*cancelled)(struct __pyx_obj_6gevent_6_event_AsyncResult *, int __pyx_skip_dispatch);
+};
+static struct __pyx_vtabstruct_6gevent_6_event_AsyncResult *__pyx_vtabptr_6gevent_6_event_AsyncResult;
+
 137:     """A one-time event that stores a value or an exception.
+
 138: 
+
 139:     Like :class:`Event` it wakes up all the waiters when :meth:`set` or :meth:`set_exception`
+
 140:     is called. Waiters may receive the passed value or exception by calling :meth:`get`
+
 141:     instead of :meth:`wait`. An :class:`AsyncResult` instance cannot be reset.
+
 142: 
+
 143:     To pass a value call :meth:`set`. Calls to :meth:`get` (those that are currently blocking as well as
+
 144:     those made in the future) will return the value:
+
 145: 
+
 146:         >>> result = AsyncResult()
+
 147:         >>> result.set(100)
+
 148:         >>> result.get()
+
 149:         100
+
 150: 
+
 151:     To pass an exception call :meth:`set_exception`. This will cause :meth:`get` to raise that exception:
+
 152: 
+
 153:         >>> result = AsyncResult()
+
 154:         >>> result.set_exception(RuntimeError('failure'))
+
 155:         >>> result.get()
+
 156:         Traceback (most recent call last):
+
 157:          ...
+
 158:         RuntimeError: failure
+
 159: 
+
 160:     :class:`AsyncResult` implements :meth:`__call__` and thus can be used as :meth:`link` target:
+
 161: 
+
 162:         >>> import gevent
+
 163:         >>> result = AsyncResult()
+
 164:         >>> gevent.spawn(lambda : 1/0).link(result)
+
 165:         >>> try:
+
 166:         ...     result.get()
+
 167:         ... except ZeroDivisionError:
+
 168:         ...     print('ZeroDivisionError')
+
 169:         ZeroDivisionError
+
 170: 
+
 171:     .. note::
+
 172:         The order and timing in which waiting greenlets are awakened is not determined.
+
 173:         As an implementation note, in gevent 1.1 and 1.0, waiting greenlets are awakened in a
+
 174:         undetermined order sometime *after* the current greenlet yields to the event loop. Other greenlets
+
 175:         (those not waiting to be awakened) may run between the current greenlet yielding and
+
 176:         the waiting greenlets being awakened. These details may change in the future.
+
 177: 
+
 178:     .. versionchanged:: 1.1
+
 179:        The exact order in which waiting greenlets are awakened is not the same
+
 180:        as in 1.0.
+
 181:     .. versionchanged:: 1.1
+
 182:        Callbacks :meth:`linked <rawlink>` to this object are required to be hashable, and duplicates are
+
 183:        merged.
+
 184:     """
+
 185: 
+
+186:     __slots__ = ('_value', '_exc_info', '_imap_task_index')
+
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_event_AsyncResult->tp_dict, __pyx_n_s_slots, __pyx_tuple__19) < 0) __PYX_ERR(0, 186, __pyx_L1_error)
+  PyType_Modified(__pyx_ptype_6gevent_6_event_AsyncResult);
+/* … */
+  __pyx_tuple__19 = PyTuple_Pack(3, __pyx_n_s_value_2, __pyx_n_s_exc_info_2, __pyx_n_s_imap_task_index); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(0, 186, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__19);
+  __Pyx_GIVEREF(__pyx_tuple__19);
+
 187: 
+
+188:     def __init__(self):
+
/* Python wrapper */
+static int __pyx_pw_6gevent_6_event_11AsyncResult_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static int __pyx_pw_6gevent_6_event_11AsyncResult_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
+  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
+    __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
+  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1;
+  __pyx_r = __pyx_pf_6gevent_6_event_11AsyncResult___init__(((struct __pyx_obj_6gevent_6_event_AsyncResult *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_6_event_11AsyncResult___init__(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = 0;
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_AddTraceback("gevent._event.AsyncResult.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = -1;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+189:         super(AsyncResult, self).__init__()
+
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 189, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(((PyObject *)__pyx_ptype_6gevent_6_event_AsyncResult));
+  __Pyx_GIVEREF(((PyObject *)__pyx_ptype_6gevent_6_event_AsyncResult));
+  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_ptype_6gevent_6_event_AsyncResult));
+  __Pyx_INCREF(((PyObject *)__pyx_v_self));
+  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
+  PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_self));
+  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 189, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 189, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __pyx_t_3 = NULL;
+  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+    if (likely(__pyx_t_3)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+      __Pyx_INCREF(__pyx_t_3);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_2, function);
+    }
+  }
+  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 189, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+190:         self._value = _NONE
+
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_NONE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 190, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_1);
+  __Pyx_GOTREF(__pyx_v_self->_value);
+  __Pyx_DECREF(__pyx_v_self->_value);
+  __pyx_v_self->_value = __pyx_t_1;
+  __pyx_t_1 = 0;
+
+191:         self._exc_info = ()
+
  __Pyx_INCREF(__pyx_empty_tuple);
+  __Pyx_GIVEREF(__pyx_empty_tuple);
+  __Pyx_GOTREF(__pyx_v_self->_exc_info);
+  __Pyx_DECREF(__pyx_v_self->_exc_info);
+  __pyx_v_self->_exc_info = __pyx_empty_tuple;
+
 192: 
+
 193:     @property
+
+194:     def _exception(self):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_10_exception_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_10_exception_1__get__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_6_event_11AsyncResult_10_exception___get__(((struct __pyx_obj_6gevent_6_event_AsyncResult *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_event_11AsyncResult_10_exception___get__(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_AddTraceback("gevent._event.AsyncResult._exception.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+195:         return self._exc_info[1] if self._exc_info else _NONE
+
  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_2 = (__pyx_v_self->_exc_info != Py_None)&&(PyTuple_GET_SIZE(__pyx_v_self->_exc_info) != 0);
+  if (__pyx_t_2) {
+    if (unlikely(__pyx_v_self->_exc_info == Py_None)) {
+      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
+      __PYX_ERR(0, 195, __pyx_L1_error)
+    }
+    __pyx_t_3 = __Pyx_GetItemInt_Tuple(__pyx_v_self->_exc_info, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 195, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __pyx_t_1 = __pyx_t_3;
+    __pyx_t_3 = 0;
+  } else {
+    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_NONE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 195, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __pyx_t_1 = __pyx_t_3;
+    __pyx_t_3 = 0;
+  }
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
 196: 
+
 197:     @property
+
+198:     def value(self):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_5value_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_5value_1__get__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_6_event_11AsyncResult_5value___get__(((struct __pyx_obj_6gevent_6_event_AsyncResult *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_event_11AsyncResult_5value___get__(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_AddTraceback("gevent._event.AsyncResult.value.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
 199:         """
+
 200:         Holds the value passed to :meth:`set` if :meth:`set` was called. Otherwise,
+
 201:         ``None``
+
 202:         """
+
+203:         return self._value if self._value is not _NONE else None
+
  __Pyx_XDECREF(__pyx_r);
+  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_NONE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 203, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = (__pyx_v_self->_value != __pyx_t_2);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  if ((__pyx_t_3 != 0)) {
+    __Pyx_INCREF(__pyx_v_self->_value);
+    __pyx_t_1 = __pyx_v_self->_value;
+  } else {
+    __Pyx_INCREF(Py_None);
+    __pyx_t_1 = Py_None;
+  }
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
 204: 
+
 205:     @property
+
+206:     def exc_info(self):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_8exc_info_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_8exc_info_1__get__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_6_event_11AsyncResult_8exc_info___get__(((struct __pyx_obj_6gevent_6_event_AsyncResult *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_event_11AsyncResult_8exc_info___get__(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_XDECREF(__pyx_t_6);
+  __Pyx_XDECREF(__pyx_t_7);
+  __Pyx_AddTraceback("gevent._event.AsyncResult.exc_info.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
 207:         """
+
 208:         The three-tuple of exception information if :meth:`set_exception` was called.
+
 209:         """
+
+210:         if self._exc_info:
+
  __pyx_t_1 = (__pyx_v_self->_exc_info != Py_None)&&(PyTuple_GET_SIZE(__pyx_v_self->_exc_info) != 0);
+  if (__pyx_t_1) {
+/* … */
+  }
+
+211:             return (self._exc_info[0], self._exc_info[1], load_traceback(self._exc_info[2]))
+
    __Pyx_XDECREF(__pyx_r);
+    if (unlikely(__pyx_v_self->_exc_info == Py_None)) {
+      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
+      __PYX_ERR(0, 211, __pyx_L1_error)
+    }
+    __pyx_t_2 = __Pyx_GetItemInt_Tuple(__pyx_v_self->_exc_info, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 211, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    if (unlikely(__pyx_v_self->_exc_info == Py_None)) {
+      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
+      __PYX_ERR(0, 211, __pyx_L1_error)
+    }
+    __pyx_t_3 = __Pyx_GetItemInt_Tuple(__pyx_v_self->_exc_info, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 211, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    if (unlikely(__pyx_v_self->_exc_info == Py_None)) {
+      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
+      __PYX_ERR(0, 211, __pyx_L1_error)
+    }
+    __pyx_t_5 = __Pyx_GetItemInt_Tuple(__pyx_v_self->_exc_info, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 211, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_5);
+    __Pyx_INCREF(__pyx_v_6gevent_6_event_load_traceback);
+    __pyx_t_6 = __pyx_v_6gevent_6_event_load_traceback; __pyx_t_7 = NULL;
+    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
+      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
+      if (likely(__pyx_t_7)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
+        __Pyx_INCREF(__pyx_t_7);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_6, function);
+      }
+    }
+    __pyx_t_4 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_5);
+    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 211, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+    __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 211, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_6);
+    __Pyx_GIVEREF(__pyx_t_2);
+    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2);
+    __Pyx_GIVEREF(__pyx_t_3);
+    PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_3);
+    __Pyx_GIVEREF(__pyx_t_4);
+    PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_4);
+    __pyx_t_2 = 0;
+    __pyx_t_3 = 0;
+    __pyx_t_4 = 0;
+    __pyx_r = __pyx_t_6;
+    __pyx_t_6 = 0;
+    goto __pyx_L0;
+
+212:         return ()
+
  __Pyx_XDECREF(__pyx_r);
+  __Pyx_INCREF(__pyx_empty_tuple);
+  __pyx_r = __pyx_empty_tuple;
+  goto __pyx_L0;
+
 213: 
+
+214:     def __str__(self):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_3__str__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_3__str__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_6_event_11AsyncResult_2__str__(((struct __pyx_obj_6gevent_6_event_AsyncResult *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_event_11AsyncResult_2__str__(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self) {
+  PyObject *__pyx_v_result = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__str__", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_6);
+  __Pyx_AddTraceback("gevent._event.AsyncResult.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_result);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+215:         result = '<%s ' % (self.__class__.__name__, )
+
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 215, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 215, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 215, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_2);
+  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
+  __pyx_t_2 = 0;
+  __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_s, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 215, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_v_result = ((PyObject*)__pyx_t_2);
+  __pyx_t_2 = 0;
+
+216:         if self.value is not None or self._exception is not _NONE:
+
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 216, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_4 = (__pyx_t_2 != Py_None);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_5 = (__pyx_t_4 != 0);
+  if (!__pyx_t_5) {
+  } else {
+    __pyx_t_3 = __pyx_t_5;
+    goto __pyx_L4_bool_binop_done;
+  }
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_exception); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 216, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_NONE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 216, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_5 = (__pyx_t_2 != __pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_4 = (__pyx_t_5 != 0);
+  __pyx_t_3 = __pyx_t_4;
+  __pyx_L4_bool_binop_done:;
+  if (__pyx_t_3) {
+/* … */
+  }
+
+217:             result += 'value=%r ' % self.value
+
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 217, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __pyx_t_2 = __Pyx_PyString_FormatSafe(__pyx_kp_s_value_r, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 217, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 217, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_1));
+    __pyx_t_1 = 0;
+
+218:         if self._exception is not None and self._exception is not _NONE:
+
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_exception); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 218, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_4 = (__pyx_t_1 != Py_None);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_5 = (__pyx_t_4 != 0);
+  if (__pyx_t_5) {
+  } else {
+    __pyx_t_3 = __pyx_t_5;
+    goto __pyx_L7_bool_binop_done;
+  }
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_exception); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 218, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_NONE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 218, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_5 = (__pyx_t_1 != __pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_4 = (__pyx_t_5 != 0);
+  __pyx_t_3 = __pyx_t_4;
+  __pyx_L7_bool_binop_done:;
+  if (__pyx_t_3) {
+/* … */
+  }
+
+219:             result += 'exception=%r ' % self._exception
+
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_exception); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 219, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_1 = __Pyx_PyString_FormatSafe(__pyx_kp_s_exception_r, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 219, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 219, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_2));
+    __pyx_t_2 = 0;
+
+220:         if self._exception is _NONE:
+
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_exception); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 220, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_NONE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 220, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_3 = (__pyx_t_2 == __pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_4 = (__pyx_t_3 != 0);
+  if (__pyx_t_4) {
+/* … */
+  }
+
+221:             result += 'unset '
+
    __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_kp_s_unset); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 221, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_1));
+    __pyx_t_1 = 0;
+
+222:         return result + ' _links[%s]>' % self.linkcount()
+
  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_linkcount); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 222, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_6 = NULL;
+  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
+    if (likely(__pyx_t_6)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+      __Pyx_INCREF(__pyx_t_6);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_2, function);
+    }
+  }
+  __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 222, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_2 = __Pyx_PyString_FormatSafe(__pyx_kp_s_links_s, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 222, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_1 = PyNumber_Add(__pyx_v_result, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 222, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
 223: 
+
+224:     def ready(self):
+
static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_5ready(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static int __pyx_f_6gevent_6_event_11AsyncResult_ready(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self, int __pyx_skip_dispatch) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("ready", 0);
+  /* Check if called by wrapper */
+  if (unlikely(__pyx_skip_dispatch)) ;
+  /* Check if overridden in Python */
+  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
+    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
+    if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
+    else {
+      PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      #endif
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_ready); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 224, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_6_event_11AsyncResult_5ready)) {
+        __Pyx_INCREF(__pyx_t_1);
+        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+          if (likely(__pyx_t_4)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+            __Pyx_INCREF(__pyx_t_4);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_3, function);
+          }
+        }
+        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
+        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 224, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 224, __pyx_L1_error)
+        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+        __pyx_r = __pyx_t_5;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        goto __pyx_L0;
+      }
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+      tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
+      if (unlikely(type_dict_guard != tp_dict_version)) {
+        tp_dict_version = obj_dict_version = 0;
+      }
+      #endif
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    }
+    #endif
+  }
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_WriteUnraisable("gevent._event.AsyncResult.ready", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_5ready(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6gevent_6_event_11AsyncResult_4ready[] = "AsyncResult.ready(self) -> bool\nReturn true if and only if it holds a value or an exception";
+static PyMethodDef __pyx_mdef_6gevent_6_event_11AsyncResult_5ready = {"ready", (PyCFunction)__pyx_pw_6gevent_6_event_11AsyncResult_5ready, METH_NOARGS, __pyx_doc_6gevent_6_event_11AsyncResult_4ready};
+static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_5ready(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("ready (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_6_event_11AsyncResult_4ready(((struct __pyx_obj_6gevent_6_event_AsyncResult *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_event_11AsyncResult_4ready(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("ready", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_f_6gevent_6_event_11AsyncResult_ready(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 224, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent._event.AsyncResult.ready", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__20 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(0, 224, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__20);
+  __Pyx_GIVEREF(__pyx_tuple__20);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_event_11AsyncResult_5ready, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AsyncResult_ready, NULL, __pyx_n_s_gevent__event, __pyx_d, ((PyObject *)__pyx_codeobj__21)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 224, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_event_AsyncResult->tp_dict, __pyx_n_s_ready, __pyx_t_2) < 0) __PYX_ERR(0, 224, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_6_event_AsyncResult);
+  __pyx_codeobj__21 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__20, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_event_py, __pyx_n_s_ready, 224, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__21)) __PYX_ERR(0, 224, __pyx_L1_error)
+
 225:         """Return true if and only if it holds a value or an exception"""
+
+226:         return self._exc_info or self._value is not _NONE
+
  __pyx_t_6 = (__pyx_v_self->_exc_info != Py_None)&&(PyTuple_GET_SIZE(__pyx_v_self->_exc_info) != 0);
+  if (!__pyx_t_6) {
+  } else {
+    __pyx_t_5 = __pyx_t_6;
+    goto __pyx_L3_bool_binop_done;
+  }
+  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_NONE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 226, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_6 = (__pyx_v_self->_value != __pyx_t_1);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_7 = (__pyx_t_6 != 0);
+  __pyx_t_5 = __pyx_t_7;
+  __pyx_L3_bool_binop_done:;
+  __pyx_r = __pyx_t_5;
+  goto __pyx_L0;
+
 227: 
+
+228:     def successful(self):
+
static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_7successful(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static int __pyx_f_6gevent_6_event_11AsyncResult_successful(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self, int __pyx_skip_dispatch) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("successful", 0);
+  /* Check if called by wrapper */
+  if (unlikely(__pyx_skip_dispatch)) ;
+  /* Check if overridden in Python */
+  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
+    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
+    if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
+    else {
+      PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      #endif
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_successful); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 228, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_6_event_11AsyncResult_7successful)) {
+        __Pyx_INCREF(__pyx_t_1);
+        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+          if (likely(__pyx_t_4)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+            __Pyx_INCREF(__pyx_t_4);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_3, function);
+          }
+        }
+        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
+        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 228, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 228, __pyx_L1_error)
+        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+        __pyx_r = __pyx_t_5;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        goto __pyx_L0;
+      }
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+      tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
+      if (unlikely(type_dict_guard != tp_dict_version)) {
+        tp_dict_version = obj_dict_version = 0;
+      }
+      #endif
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    }
+    #endif
+  }
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_WriteUnraisable("gevent._event.AsyncResult.successful", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_7successful(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6gevent_6_event_11AsyncResult_6successful[] = "AsyncResult.successful(self) -> bool\nReturn true if and only if it is ready and holds a value";
+static PyMethodDef __pyx_mdef_6gevent_6_event_11AsyncResult_7successful = {"successful", (PyCFunction)__pyx_pw_6gevent_6_event_11AsyncResult_7successful, METH_NOARGS, __pyx_doc_6gevent_6_event_11AsyncResult_6successful};
+static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_7successful(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("successful (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_6_event_11AsyncResult_6successful(((struct __pyx_obj_6gevent_6_event_AsyncResult *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_event_11AsyncResult_6successful(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("successful", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_f_6gevent_6_event_11AsyncResult_successful(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 228, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent._event.AsyncResult.successful", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__22 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(0, 228, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__22);
+  __Pyx_GIVEREF(__pyx_tuple__22);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_event_11AsyncResult_7successful, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AsyncResult_successful, NULL, __pyx_n_s_gevent__event, __pyx_d, ((PyObject *)__pyx_codeobj__23)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 228, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_event_AsyncResult->tp_dict, __pyx_n_s_successful, __pyx_t_2) < 0) __PYX_ERR(0, 228, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_6_event_AsyncResult);
+  __pyx_codeobj__23 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__22, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_event_py, __pyx_n_s_successful, 228, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__23)) __PYX_ERR(0, 228, __pyx_L1_error)
+
 229:         """Return true if and only if it is ready and holds a value"""
+
+230:         return self._value is not _NONE
+
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_NONE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 230, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_5 = (__pyx_v_self->_value != __pyx_t_1);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_r = __pyx_t_5;
+  goto __pyx_L0;
+
 231: 
+
 232:     @property
+
+233:     def exception(self):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_9exception_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_9exception_1__get__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_6_event_11AsyncResult_9exception___get__(((struct __pyx_obj_6gevent_6_event_AsyncResult *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_event_11AsyncResult_9exception___get__(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_AddTraceback("gevent._event.AsyncResult.exception.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
 234:         """Holds the exception instance passed to :meth:`set_exception` if :meth:`set_exception` was called.
+
 235:         Otherwise ``None``."""
+
+236:         if self._exc_info:
+
  __pyx_t_1 = (__pyx_v_self->_exc_info != Py_None)&&(PyTuple_GET_SIZE(__pyx_v_self->_exc_info) != 0);
+  if (__pyx_t_1) {
+/* … */
+  }
+
+237:             return self._exc_info[1]
+
    __Pyx_XDECREF(__pyx_r);
+    if (unlikely(__pyx_v_self->_exc_info == Py_None)) {
+      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
+      __PYX_ERR(0, 237, __pyx_L1_error)
+    }
+    __pyx_t_2 = __Pyx_GetItemInt_Tuple(__pyx_v_self->_exc_info, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 237, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_r = __pyx_t_2;
+    __pyx_t_2 = 0;
+    goto __pyx_L0;
+
 238: 
+
+239:     def set(self, value=None):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_9set(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_6gevent_6_event_11AsyncResult_8set[] = "AsyncResult.set(self, value=None)\nStore the value and wake up any waiters.\n\n        All greenlets blocking on :meth:`get` or :meth:`wait` are awakened.\n        Subsequent calls to :meth:`wait` and :meth:`get` will not block at all.\n        ";
+static PyMethodDef __pyx_mdef_6gevent_6_event_11AsyncResult_9set = {"set", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_6_event_11AsyncResult_9set, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_6_event_11AsyncResult_8set};
+static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_9set(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_value = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("set (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_value,0};
+    PyObject* values[1] = {0};
+    values[0] = ((PyObject *)Py_None);
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value);
+          if (value) { values[0] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set") < 0)) __PYX_ERR(0, 239, __pyx_L3_error)
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    __pyx_v_value = values[0];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("set", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 239, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent._event.AsyncResult.set", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_6_event_11AsyncResult_8set(((struct __pyx_obj_6gevent_6_event_AsyncResult *)__pyx_v_self), __pyx_v_value);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_event_11AsyncResult_8set(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self, PyObject *__pyx_v_value) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("set", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent._event.AsyncResult.set", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__24 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_value); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(0, 239, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__24);
+  __Pyx_GIVEREF(__pyx_tuple__24);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_event_11AsyncResult_9set, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AsyncResult_set, NULL, __pyx_n_s_gevent__event, __pyx_d, ((PyObject *)__pyx_codeobj__25)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 239, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_event_AsyncResult->tp_dict, __pyx_n_s_set, __pyx_t_2) < 0) __PYX_ERR(0, 239, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_6_event_AsyncResult);
+  __pyx_codeobj__25 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__24, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_event_py, __pyx_n_s_set, 239, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__25)) __PYX_ERR(0, 239, __pyx_L1_error)
+
 240:         """Store the value and wake up any waiters.
+
 241: 
+
 242:         All greenlets blocking on :meth:`get` or :meth:`wait` are awakened.
+
 243:         Subsequent calls to :meth:`wait` and :meth:`get` will not block at all.
+
 244:         """
+
+245:         self._value = value
+
  __Pyx_INCREF(__pyx_v_value);
+  __Pyx_GIVEREF(__pyx_v_value);
+  __Pyx_GOTREF(__pyx_v_self->_value);
+  __Pyx_DECREF(__pyx_v_self->_value);
+  __pyx_v_self->_value = __pyx_v_value;
+
+246:         self._check_and_notify()
+
  __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_6_event_AsyncResult *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._check_and_notify(((struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 246, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 247: 
+
+248:     def set_exception(self, exception, exc_info=None):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_11set_exception(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_6gevent_6_event_11AsyncResult_10set_exception[] = "AsyncResult.set_exception(self, exception, exc_info=None)\nStore the exception and wake up any waiters.\n\n        All greenlets blocking on :meth:`get` or :meth:`wait` are awakened.\n        Subsequent calls to :meth:`wait` and :meth:`get` will not block at all.\n\n        :keyword tuple exc_info: If given, a standard three-tuple of type, value, :class:`traceback`\n            as returned by :func:`sys.exc_info`. This will be used when the exception\n            is re-raised to propagate the correct traceback.\n        ";
+static PyMethodDef __pyx_mdef_6gevent_6_event_11AsyncResult_11set_exception = {"set_exception", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_6_event_11AsyncResult_11set_exception, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_6_event_11AsyncResult_10set_exception};
+static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_11set_exception(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_exception = 0;
+  PyObject *__pyx_v_exc_info = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("set_exception (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_exception_2,&__pyx_n_s_exc_info,0};
+    PyObject* values[2] = {0,0};
+    values[1] = ((PyObject *)Py_None);
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_exception_2)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_exc_info);
+          if (value) { values[1] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_exception") < 0)) __PYX_ERR(0, 248, __pyx_L3_error)
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    __pyx_v_exception = values[0];
+    __pyx_v_exc_info = values[1];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("set_exception", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 248, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent._event.AsyncResult.set_exception", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_6_event_11AsyncResult_10set_exception(((struct __pyx_obj_6gevent_6_event_AsyncResult *)__pyx_v_self), __pyx_v_exception, __pyx_v_exc_info);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_event_11AsyncResult_10set_exception(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self, PyObject *__pyx_v_exception, PyObject *__pyx_v_exc_info) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("set_exception", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_XDECREF(__pyx_t_6);
+  __Pyx_XDECREF(__pyx_t_7);
+  __Pyx_AddTraceback("gevent._event.AsyncResult.set_exception", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__26 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_exception_2, __pyx_n_s_exc_info); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(0, 248, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__26);
+  __Pyx_GIVEREF(__pyx_tuple__26);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_event_11AsyncResult_11set_exception, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AsyncResult_set_exception, NULL, __pyx_n_s_gevent__event, __pyx_d, ((PyObject *)__pyx_codeobj__27)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 248, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_event_AsyncResult->tp_dict, __pyx_n_s_set_exception, __pyx_t_2) < 0) __PYX_ERR(0, 248, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_6_event_AsyncResult);
+  __pyx_codeobj__27 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__26, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_event_py, __pyx_n_s_set_exception, 248, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__27)) __PYX_ERR(0, 248, __pyx_L1_error)
+
 249:         """Store the exception and wake up any waiters.
+
 250: 
+
 251:         All greenlets blocking on :meth:`get` or :meth:`wait` are awakened.
+
 252:         Subsequent calls to :meth:`wait` and :meth:`get` will not block at all.
+
 253: 
+
 254:         :keyword tuple exc_info: If given, a standard three-tuple of type, value, :class:`traceback`
+
 255:             as returned by :func:`sys.exc_info`. This will be used when the exception
+
 256:             is re-raised to propagate the correct traceback.
+
 257:         """
+
+258:         if exc_info:
+
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_exc_info); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 258, __pyx_L1_error)
+  if (__pyx_t_1) {
+/* … */
+    goto __pyx_L3;
+  }
+
+259:             self._exc_info = (exc_info[0], exc_info[1], dump_traceback(exc_info[2]))
+
    __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_exc_info, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 259, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_exc_info, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 259, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_exc_info, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 259, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_5);
+    __Pyx_INCREF(__pyx_v_6gevent_6_event_dump_traceback);
+    __pyx_t_6 = __pyx_v_6gevent_6_event_dump_traceback; __pyx_t_7 = NULL;
+    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
+      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
+      if (likely(__pyx_t_7)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
+        __Pyx_INCREF(__pyx_t_7);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_6, function);
+      }
+    }
+    __pyx_t_4 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_5);
+    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 259, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+    __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 259, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_6);
+    __Pyx_GIVEREF(__pyx_t_2);
+    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2);
+    __Pyx_GIVEREF(__pyx_t_3);
+    PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_3);
+    __Pyx_GIVEREF(__pyx_t_4);
+    PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_4);
+    __pyx_t_2 = 0;
+    __pyx_t_3 = 0;
+    __pyx_t_4 = 0;
+    __Pyx_GIVEREF(__pyx_t_6);
+    __Pyx_GOTREF(__pyx_v_self->_exc_info);
+    __Pyx_DECREF(__pyx_v_self->_exc_info);
+    __pyx_v_self->_exc_info = ((PyObject*)__pyx_t_6);
+    __pyx_t_6 = 0;
+
 260:         else:
+
+261:             self._exc_info = (type(exception), exception, dump_traceback(None))
+
  /*else*/ {
+    __Pyx_INCREF(__pyx_v_6gevent_6_event_dump_traceback);
+    __pyx_t_4 = __pyx_v_6gevent_6_event_dump_traceback; __pyx_t_3 = NULL;
+    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
+      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
+      if (likely(__pyx_t_3)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
+        __Pyx_INCREF(__pyx_t_3);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_4, function);
+      }
+    }
+    __pyx_t_6 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_3, Py_None) : __Pyx_PyObject_CallOneArg(__pyx_t_4, Py_None);
+    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+    if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 261, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_6);
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 261, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_exception)));
+    __Pyx_GIVEREF(((PyObject *)Py_TYPE(__pyx_v_exception)));
+    PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)Py_TYPE(__pyx_v_exception)));
+    __Pyx_INCREF(__pyx_v_exception);
+    __Pyx_GIVEREF(__pyx_v_exception);
+    PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_exception);
+    __Pyx_GIVEREF(__pyx_t_6);
+    PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_6);
+    __pyx_t_6 = 0;
+    __Pyx_GIVEREF(__pyx_t_4);
+    __Pyx_GOTREF(__pyx_v_self->_exc_info);
+    __Pyx_DECREF(__pyx_v_self->_exc_info);
+    __pyx_v_self->_exc_info = ((PyObject*)__pyx_t_4);
+    __pyx_t_4 = 0;
+  }
+  __pyx_L3:;
+
 262: 
+
+263:         self._check_and_notify()
+
  __pyx_t_4 = ((struct __pyx_vtabstruct_6gevent_6_event_AsyncResult *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._check_and_notify(((struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *)__pyx_v_self)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 263, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_4);
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+
 264: 
+
+265:     def _raise_exception(self):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_13_raise_exception(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6gevent_6_event_11AsyncResult_12_raise_exception[] = "AsyncResult._raise_exception(self)";
+static PyMethodDef __pyx_mdef_6gevent_6_event_11AsyncResult_13_raise_exception = {"_raise_exception", (PyCFunction)__pyx_pw_6gevent_6_event_11AsyncResult_13_raise_exception, METH_NOARGS, __pyx_doc_6gevent_6_event_11AsyncResult_12_raise_exception};
+static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_13_raise_exception(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_raise_exception (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_6_event_11AsyncResult_12_raise_exception(((struct __pyx_obj_6gevent_6_event_AsyncResult *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_event_11AsyncResult_12_raise_exception(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_raise_exception", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_AddTraceback("gevent._event.AsyncResult._raise_exception", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__28 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(0, 265, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__28);
+  __Pyx_GIVEREF(__pyx_tuple__28);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_event_11AsyncResult_13_raise_exception, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AsyncResult__raise_exception, NULL, __pyx_n_s_gevent__event, __pyx_d, ((PyObject *)__pyx_codeobj__29)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 265, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_event_AsyncResult->tp_dict, __pyx_n_s_raise_exception, __pyx_t_2) < 0) __PYX_ERR(0, 265, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_6_event_AsyncResult);
+  __pyx_codeobj__29 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__28, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_event_py, __pyx_n_s_raise_exception, 265, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__29)) __PYX_ERR(0, 265, __pyx_L1_error)
+
+266:         reraise(*self.exc_info)
+
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_exc_info); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 266, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = __Pyx_PySequence_Tuple(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 266, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_6gevent_6_event_reraise, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 266, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 267: 
+
+268:     def get(self, block=True, timeout=None):
+
static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_15get(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_f_6gevent_6_event_11AsyncResult_get(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_6_event_11AsyncResult_get *__pyx_optional_args) {
+  PyObject *__pyx_v_block = ((PyObject *)Py_True);
+  PyObject *__pyx_v_timeout = ((PyObject *)Py_None);
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("get", 0);
+  if (__pyx_optional_args) {
+    if (__pyx_optional_args->__pyx_n > 0) {
+      __pyx_v_block = __pyx_optional_args->block;
+      if (__pyx_optional_args->__pyx_n > 1) {
+        __pyx_v_timeout = __pyx_optional_args->timeout;
+      }
+    }
+  }
+  /* Check if called by wrapper */
+  if (unlikely(__pyx_skip_dispatch)) ;
+  /* Check if overridden in Python */
+  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
+    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
+    if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
+    else {
+      PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      #endif
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 268, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_6_event_11AsyncResult_15get)) {
+        __Pyx_XDECREF(__pyx_r);
+        __Pyx_INCREF(__pyx_t_1);
+        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
+        __pyx_t_5 = 0;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+          if (likely(__pyx_t_4)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+            __Pyx_INCREF(__pyx_t_4);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_3, function);
+            __pyx_t_5 = 1;
+          }
+        }
+        #if CYTHON_FAST_PYCALL
+        if (PyFunction_Check(__pyx_t_3)) {
+          PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_block, __pyx_v_timeout};
+          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 268, __pyx_L1_error)
+          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+          __Pyx_GOTREF(__pyx_t_2);
+        } else
+        #endif
+        #if CYTHON_FAST_PYCCALL
+        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
+          PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_block, __pyx_v_timeout};
+          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 268, __pyx_L1_error)
+          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+          __Pyx_GOTREF(__pyx_t_2);
+        } else
+        #endif
+        {
+          __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 268, __pyx_L1_error)
+          __Pyx_GOTREF(__pyx_t_6);
+          if (__pyx_t_4) {
+            __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
+          }
+          __Pyx_INCREF(__pyx_v_block);
+          __Pyx_GIVEREF(__pyx_v_block);
+          PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_block);
+          __Pyx_INCREF(__pyx_v_timeout);
+          __Pyx_GIVEREF(__pyx_v_timeout);
+          PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_timeout);
+          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 268, __pyx_L1_error)
+          __Pyx_GOTREF(__pyx_t_2);
+          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+        }
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __pyx_r = __pyx_t_2;
+        __pyx_t_2 = 0;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        goto __pyx_L0;
+      }
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+      tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
+      if (unlikely(type_dict_guard != tp_dict_version)) {
+        tp_dict_version = obj_dict_version = 0;
+      }
+      #endif
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    }
+    #endif
+  }
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_6);
+  __Pyx_AddTraceback("gevent._event.AsyncResult.get", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_15get(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_6gevent_6_event_11AsyncResult_14get[] = "AsyncResult.get(self, block=True, timeout=None)\nReturn the stored value or raise the exception.\n\n        If this instance already holds a value or an exception, return  or raise it immediately.\n        Otherwise, block until another greenlet calls :meth:`set` or :meth:`set_exception` or\n        until the optional timeout occurs.\n\n        When the *timeout* argument is present and not ``None``, it should be a\n        floating point number specifying a timeout for the operation in seconds\n        (or fractions thereof). If the *timeout* elapses, the *Timeout* exception will\n        be raised.\n\n        :keyword bool block: If set to ``False`` and this instance is not ready,\n            immediately raise a :class:`Timeout` exception.\n        ";
+static PyMethodDef __pyx_mdef_6gevent_6_event_11AsyncResult_15get = {"get", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_6_event_11AsyncResult_15get, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_6_event_11AsyncResult_14get};
+static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_15get(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_block = 0;
+  PyObject *__pyx_v_timeout = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("get (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_block,&__pyx_n_s_timeout,0};
+    PyObject* values[2] = {0,0};
+    values[0] = ((PyObject *)Py_True);
+    values[1] = ((PyObject *)Py_None);
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_block);
+          if (value) { values[0] = value; kw_args--; }
+        }
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_timeout);
+          if (value) { values[1] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get") < 0)) __PYX_ERR(0, 268, __pyx_L3_error)
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    __pyx_v_block = values[0];
+    __pyx_v_timeout = values[1];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("get", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 268, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent._event.AsyncResult.get", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_6_event_11AsyncResult_14get(((struct __pyx_obj_6gevent_6_event_AsyncResult *)__pyx_v_self), __pyx_v_block, __pyx_v_timeout);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_event_11AsyncResult_14get(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self, PyObject *__pyx_v_block, PyObject *__pyx_v_timeout) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("get", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_2.__pyx_n = 2;
+  __pyx_t_2.block = __pyx_v_block;
+  __pyx_t_2.timeout = __pyx_v_timeout;
+  __pyx_t_1 = __pyx_vtabptr_6gevent_6_event_AsyncResult->get(__pyx_v_self, 1, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 268, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent._event.AsyncResult.get", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__30 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_block, __pyx_n_s_timeout); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(0, 268, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__30);
+  __Pyx_GIVEREF(__pyx_tuple__30);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_event_11AsyncResult_15get, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AsyncResult_get, NULL, __pyx_n_s_gevent__event, __pyx_d, ((PyObject *)__pyx_codeobj__31)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 268, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_event_AsyncResult->tp_dict, __pyx_n_s_get, __pyx_t_2) < 0) __PYX_ERR(0, 268, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_6_event_AsyncResult);
+  __pyx_codeobj__31 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__30, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_event_py, __pyx_n_s_get, 268, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__31)) __PYX_ERR(0, 268, __pyx_L1_error)
+
 269:         """Return the stored value or raise the exception.
+
 270: 
+
 271:         If this instance already holds a value or an exception, return  or raise it immediately.
+
 272:         Otherwise, block until another greenlet calls :meth:`set` or :meth:`set_exception` or
+
 273:         until the optional timeout occurs.
+
 274: 
+
 275:         When the *timeout* argument is present and not ``None``, it should be a
+
 276:         floating point number specifying a timeout for the operation in seconds
+
 277:         (or fractions thereof). If the *timeout* elapses, the *Timeout* exception will
+
 278:         be raised.
+
 279: 
+
 280:         :keyword bool block: If set to ``False`` and this instance is not ready,
+
 281:             immediately raise a :class:`Timeout` exception.
+
 282:         """
+
+283:         if self._value is not _NONE:
+
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_NONE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 283, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_7 = (__pyx_v_self->_value != __pyx_t_1);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_8 = (__pyx_t_7 != 0);
+  if (__pyx_t_8) {
+/* … */
+  }
+
+284:             return self._value
+
    __Pyx_XDECREF(__pyx_r);
+    __Pyx_INCREF(__pyx_v_self->_value);
+    __pyx_r = __pyx_v_self->_value;
+    goto __pyx_L0;
+
+285:         if self._exc_info:
+
  __pyx_t_8 = (__pyx_v_self->_exc_info != Py_None)&&(PyTuple_GET_SIZE(__pyx_v_self->_exc_info) != 0);
+  if (__pyx_t_8) {
+/* … */
+  }
+
+286:             return self._raise_exception()
+
    __Pyx_XDECREF(__pyx_r);
+    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_raise_exception); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 286, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_3 = NULL;
+    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+      if (likely(__pyx_t_3)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+        __Pyx_INCREF(__pyx_t_3);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_2, function);
+      }
+    }
+    __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
+    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 286, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __pyx_r = __pyx_t_1;
+    __pyx_t_1 = 0;
+    goto __pyx_L0;
+
 287: 
+
+288:         if not block:
+
  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_block); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 288, __pyx_L1_error)
+  __pyx_t_7 = ((!__pyx_t_8) != 0);
+  if (unlikely(__pyx_t_7)) {
+/* … */
+  }
+
 289:             # Not ready and not blocking, so immediately timeout
+
+290:             raise Timeout()
+
    __Pyx_INCREF(__pyx_v_6gevent_6_event_Timeout);
+    __pyx_t_2 = __pyx_v_6gevent_6_event_Timeout; __pyx_t_3 = NULL;
+    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
+      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+      if (likely(__pyx_t_3)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+        __Pyx_INCREF(__pyx_t_3);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_2, function);
+      }
+    }
+    __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
+    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 290, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __PYX_ERR(0, 290, __pyx_L1_error)
+
 291: 
+
 292:         # Wait, raising a timeout that elapses
+
+293:         self._wait_core(timeout, ())
+
  __pyx_t_9.__pyx_n = 1;
+  __pyx_t_9.catch = __pyx_empty_tuple;
+  __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_6_event_AsyncResult *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._wait_core(((struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *)__pyx_v_self), __pyx_v_timeout, &__pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 293, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 294: 
+
 295:         # by definition we are now ready
+
+296:         return self.get(block=False)
+
  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_10.__pyx_n = 1;
+  __pyx_t_10.block = Py_False;
+  __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_6_event_AsyncResult *)__pyx_v_self->__pyx_base.__pyx_vtab)->get(__pyx_v_self, 0, &__pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 296, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
 297: 
+
+298:     def get_nowait(self):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_17get_nowait(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6gevent_6_event_11AsyncResult_16get_nowait[] = "AsyncResult.get_nowait(self)\n\n        Return the value or raise the exception without blocking.\n\n        If this object is not yet :meth:`ready <ready>`, raise\n        :class:`gevent.Timeout` immediately.\n        ";
+static PyMethodDef __pyx_mdef_6gevent_6_event_11AsyncResult_17get_nowait = {"get_nowait", (PyCFunction)__pyx_pw_6gevent_6_event_11AsyncResult_17get_nowait, METH_NOARGS, __pyx_doc_6gevent_6_event_11AsyncResult_16get_nowait};
+static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_17get_nowait(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("get_nowait (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_6_event_11AsyncResult_16get_nowait(((struct __pyx_obj_6gevent_6_event_AsyncResult *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_event_11AsyncResult_16get_nowait(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("get_nowait", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent._event.AsyncResult.get_nowait", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__32 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(0, 298, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__32);
+  __Pyx_GIVEREF(__pyx_tuple__32);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_event_11AsyncResult_17get_nowait, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AsyncResult_get_nowait, NULL, __pyx_n_s_gevent__event, __pyx_d, ((PyObject *)__pyx_codeobj__33)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 298, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_event_AsyncResult->tp_dict, __pyx_n_s_get_nowait, __pyx_t_2) < 0) __PYX_ERR(0, 298, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_6_event_AsyncResult);
+  __pyx_codeobj__33 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__32, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_event_py, __pyx_n_s_get_nowait, 298, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__33)) __PYX_ERR(0, 298, __pyx_L1_error)
+
 299:         """
+
 300:         Return the value or raise the exception without blocking.
+
 301: 
+
 302:         If this object is not yet :meth:`ready <ready>`, raise
+
 303:         :class:`gevent.Timeout` immediately.
+
 304:         """
+
+305:         return self.get(block=False)
+
  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_2.__pyx_n = 1;
+  __pyx_t_2.block = Py_False;
+  __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_6_event_AsyncResult *)__pyx_v_self->__pyx_base.__pyx_vtab)->get(__pyx_v_self, 0, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 305, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
 306: 
+
+307:     def _wait_return_value(self, waited, wait_success):
+
static PyObject *__pyx_f_6gevent_6_event_11AsyncResult__wait_return_value(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_waited, CYTHON_UNUSED PyObject *__pyx_v_wait_success) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_wait_return_value", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent._event.AsyncResult._wait_return_value", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
 308:         # pylint:disable=unused-argument
+
 309:         # Always return the value. Since this is a one-shot event,
+
 310:         # no race condition should reset it.
+
+311:         return self.value
+
  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 311, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
 312: 
+
+313:     def wait(self, timeout=None):
+
static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_19wait(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_f_6gevent_6_event_11AsyncResult_wait(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_6_event_11AsyncResult_wait *__pyx_optional_args) {
+  PyObject *__pyx_v_timeout = ((PyObject *)Py_None);
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("wait", 0);
+  if (__pyx_optional_args) {
+    if (__pyx_optional_args->__pyx_n > 0) {
+      __pyx_v_timeout = __pyx_optional_args->timeout;
+    }
+  }
+  /* Check if called by wrapper */
+  if (unlikely(__pyx_skip_dispatch)) ;
+  /* Check if overridden in Python */
+  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
+    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
+    if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
+    else {
+      PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      #endif
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_wait); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 313, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_6_event_11AsyncResult_19wait)) {
+        __Pyx_XDECREF(__pyx_r);
+        __Pyx_INCREF(__pyx_t_1);
+        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+          if (likely(__pyx_t_4)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+            __Pyx_INCREF(__pyx_t_4);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_3, function);
+          }
+        }
+        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_timeout) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_timeout);
+        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 313, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __pyx_r = __pyx_t_2;
+        __pyx_t_2 = 0;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        goto __pyx_L0;
+      }
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+      tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
+      if (unlikely(type_dict_guard != tp_dict_version)) {
+        tp_dict_version = obj_dict_version = 0;
+      }
+      #endif
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    }
+    #endif
+  }
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_AddTraceback("gevent._event.AsyncResult.wait", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_19wait(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_6gevent_6_event_11AsyncResult_18wait[] = "AsyncResult.wait(self, timeout=None)\nBlock until the instance is ready.\n\n        If this instance already holds a value, it is returned immediately. If this\n        instance already holds an exception, ``None`` is returned immediately.\n\n        Otherwise, block until another greenlet calls :meth:`set` or :meth:`set_exception`\n        (at which point either the value or ``None`` will be returned, respectively),\n        or until the optional timeout expires (at which point ``None`` will also be\n        returned).\n\n        When the *timeout* argument is present and not ``None``, it should be a\n        floating point number specifying a timeout for the operation in seconds\n        (or fractions thereof).\n\n        .. note:: If a timeout is given and expires, ``None`` will be returned\n            (no timeout exception will be raised).\n\n        ";
+static PyMethodDef __pyx_mdef_6gevent_6_event_11AsyncResult_19wait = {"wait", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_6_event_11AsyncResult_19wait, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_6_event_11AsyncResult_18wait};
+static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_19wait(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_timeout = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("wait (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_timeout,0};
+    PyObject* values[1] = {0};
+    values[0] = ((PyObject *)Py_None);
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_timeout);
+          if (value) { values[0] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "wait") < 0)) __PYX_ERR(0, 313, __pyx_L3_error)
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    __pyx_v_timeout = values[0];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("wait", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 313, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent._event.AsyncResult.wait", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_6_event_11AsyncResult_18wait(((struct __pyx_obj_6gevent_6_event_AsyncResult *)__pyx_v_self), __pyx_v_timeout);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_event_11AsyncResult_18wait(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self, PyObject *__pyx_v_timeout) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("wait", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_2.__pyx_n = 1;
+  __pyx_t_2.timeout = __pyx_v_timeout;
+  __pyx_t_1 = __pyx_vtabptr_6gevent_6_event_AsyncResult->wait(__pyx_v_self, 1, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 313, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent._event.AsyncResult.wait", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__34 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_timeout); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(0, 313, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__34);
+  __Pyx_GIVEREF(__pyx_tuple__34);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_event_11AsyncResult_19wait, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AsyncResult_wait, NULL, __pyx_n_s_gevent__event, __pyx_d, ((PyObject *)__pyx_codeobj__35)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 313, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_event_AsyncResult->tp_dict, __pyx_n_s_wait, __pyx_t_2) < 0) __PYX_ERR(0, 313, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_6_event_AsyncResult);
+  __pyx_codeobj__35 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__34, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_event_py, __pyx_n_s_wait, 313, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__35)) __PYX_ERR(0, 313, __pyx_L1_error)
+
 314:         """Block until the instance is ready.
+
 315: 
+
 316:         If this instance already holds a value, it is returned immediately. If this
+
 317:         instance already holds an exception, ``None`` is returned immediately.
+
 318: 
+
 319:         Otherwise, block until another greenlet calls :meth:`set` or :meth:`set_exception`
+
 320:         (at which point either the value or ``None`` will be returned, respectively),
+
 321:         or until the optional timeout expires (at which point ``None`` will also be
+
 322:         returned).
+
 323: 
+
 324:         When the *timeout* argument is present and not ``None``, it should be a
+
 325:         floating point number specifying a timeout for the operation in seconds
+
 326:         (or fractions thereof).
+
 327: 
+
 328:         .. note:: If a timeout is given and expires, ``None`` will be returned
+
 329:             (no timeout exception will be raised).
+
 330: 
+
 331:         """
+
+332:         return self._wait(timeout)
+
  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_5.__pyx_n = 1;
+  __pyx_t_5.timeout = __pyx_v_timeout;
+  __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_6_event_AsyncResult *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._wait(((struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *)__pyx_v_self), &__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 332, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
 333: 
+
 334:     # link protocol
+
+335:     def __call__(self, source):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_21__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_21__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_source = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__call__ (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_source,0};
+    PyObject* values[1] = {0};
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_source)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__call__") < 0)) __PYX_ERR(0, 335, __pyx_L3_error)
+      }
+    } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
+      goto __pyx_L5_argtuple_error;
+    } else {
+      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+    }
+    __pyx_v_source = values[0];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("__call__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 335, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent._event.AsyncResult.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_6_event_11AsyncResult_20__call__(((struct __pyx_obj_6gevent_6_event_AsyncResult *)__pyx_v_self), __pyx_v_source);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_event_11AsyncResult_20__call__(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self, PyObject *__pyx_v_source) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__call__", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_XDECREF(__pyx_t_6);
+  __Pyx_XDECREF(__pyx_t_8);
+  __Pyx_AddTraceback("gevent._event.AsyncResult.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+336:         if source.successful():
+
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_source, __pyx_n_s_successful); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 336, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = NULL;
+  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+    if (likely(__pyx_t_3)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+      __Pyx_INCREF(__pyx_t_3);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_2, function);
+    }
+  }
+  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 336, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 336, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  if (__pyx_t_4) {
+/* … */
+    goto __pyx_L3;
+  }
+
+337:             self.set(source.value)
+
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 337, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_source, __pyx_n_s_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 337, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __pyx_t_5 = NULL;
+    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
+      if (likely(__pyx_t_5)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+        __Pyx_INCREF(__pyx_t_5);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_2, function);
+      }
+    }
+    __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
+    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 337, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 338:         else:
+
+339:             self.set_exception(source.exception, getattr(source, 'exc_info', None))
+
  /*else*/ {
+    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_exception); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 339, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_source, __pyx_n_s_exception_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 339, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __pyx_t_5 = __Pyx_GetAttr3(__pyx_v_source, __pyx_n_s_exc_info, Py_None); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 339, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_5);
+    __pyx_t_6 = NULL;
+    __pyx_t_7 = 0;
+    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
+      if (likely(__pyx_t_6)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+        __Pyx_INCREF(__pyx_t_6);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_2, function);
+        __pyx_t_7 = 1;
+      }
+    }
+    #if CYTHON_FAST_PYCALL
+    if (PyFunction_Check(__pyx_t_2)) {
+      PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_3, __pyx_t_5};
+      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 339, __pyx_L1_error)
+      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+      __Pyx_GOTREF(__pyx_t_1);
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    } else
+    #endif
+    #if CYTHON_FAST_PYCCALL
+    if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
+      PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_3, __pyx_t_5};
+      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 339, __pyx_L1_error)
+      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+      __Pyx_GOTREF(__pyx_t_1);
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    } else
+    #endif
+    {
+      __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 339, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_8);
+      if (__pyx_t_6) {
+        __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL;
+      }
+      __Pyx_GIVEREF(__pyx_t_3);
+      PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_3);
+      __Pyx_GIVEREF(__pyx_t_5);
+      PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_t_5);
+      __pyx_t_3 = 0;
+      __pyx_t_5 = 0;
+      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 339, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+    }
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  }
+  __pyx_L3:;
+
 340: 
+
 341:     # Methods to make us more like concurrent.futures.Future
+
 342: 
+
+343:     def result(self, timeout=None):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_23result(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_6gevent_6_event_11AsyncResult_22result[] = "AsyncResult.result(self, timeout=None)";
+static PyMethodDef __pyx_mdef_6gevent_6_event_11AsyncResult_23result = {"result", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_6_event_11AsyncResult_23result, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_6_event_11AsyncResult_22result};
+static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_23result(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_timeout = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("result (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_timeout,0};
+    PyObject* values[1] = {0};
+    values[0] = ((PyObject *)Py_None);
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_timeout);
+          if (value) { values[0] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "result") < 0)) __PYX_ERR(0, 343, __pyx_L3_error)
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    __pyx_v_timeout = values[0];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("result", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 343, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent._event.AsyncResult.result", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_6_event_11AsyncResult_22result(((struct __pyx_obj_6gevent_6_event_AsyncResult *)__pyx_v_self), __pyx_v_timeout);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_event_11AsyncResult_22result(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self, PyObject *__pyx_v_timeout) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("result", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_AddTraceback("gevent._event.AsyncResult.result", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__36 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_timeout); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(0, 343, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__36);
+  __Pyx_GIVEREF(__pyx_tuple__36);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_event_11AsyncResult_23result, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AsyncResult_result, NULL, __pyx_n_s_gevent__event, __pyx_d, ((PyObject *)__pyx_codeobj__37)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 343, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_event_AsyncResult->tp_dict, __pyx_n_s_result, __pyx_t_2) < 0) __PYX_ERR(0, 343, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_6_event_AsyncResult);
+  __pyx_codeobj__37 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__36, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_event_py, __pyx_n_s_result, 343, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__37)) __PYX_ERR(0, 343, __pyx_L1_error)
+
+344:         return self.get(timeout=timeout)
+
  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 344, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 344, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_timeout, __pyx_v_timeout) < 0) __PYX_ERR(0, 344, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 344, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_r = __pyx_t_3;
+  __pyx_t_3 = 0;
+  goto __pyx_L0;
+
 345: 
+
+346:     set_result = set
+
  __Pyx_GetNameInClass(__pyx_t_2, (PyObject *)__pyx_ptype_6gevent_6_event_AsyncResult, __pyx_n_s_set); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 346, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_event_AsyncResult->tp_dict, __pyx_n_s_set_result, __pyx_t_2) < 0) __PYX_ERR(0, 346, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_6_event_AsyncResult);
+
 347: 
+
+348:     def done(self):
+
static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_25done(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static int __pyx_f_6gevent_6_event_11AsyncResult_done(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self, int __pyx_skip_dispatch) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("done", 0);
+  /* Check if called by wrapper */
+  if (unlikely(__pyx_skip_dispatch)) ;
+  /* Check if overridden in Python */
+  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
+    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
+    if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
+    else {
+      PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      #endif
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_done); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 348, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_6_event_11AsyncResult_25done)) {
+        __Pyx_INCREF(__pyx_t_1);
+        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+          if (likely(__pyx_t_4)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+            __Pyx_INCREF(__pyx_t_4);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_3, function);
+          }
+        }
+        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
+        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 348, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 348, __pyx_L1_error)
+        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+        __pyx_r = __pyx_t_5;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        goto __pyx_L0;
+      }
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+      tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
+      if (unlikely(type_dict_guard != tp_dict_version)) {
+        tp_dict_version = obj_dict_version = 0;
+      }
+      #endif
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    }
+    #endif
+  }
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_WriteUnraisable("gevent._event.AsyncResult.done", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_25done(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6gevent_6_event_11AsyncResult_24done[] = "AsyncResult.done(self) -> bool";
+static PyMethodDef __pyx_mdef_6gevent_6_event_11AsyncResult_25done = {"done", (PyCFunction)__pyx_pw_6gevent_6_event_11AsyncResult_25done, METH_NOARGS, __pyx_doc_6gevent_6_event_11AsyncResult_24done};
+static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_25done(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("done (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_6_event_11AsyncResult_24done(((struct __pyx_obj_6gevent_6_event_AsyncResult *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_event_11AsyncResult_24done(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("done", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_f_6gevent_6_event_11AsyncResult_done(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 348, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent._event.AsyncResult.done", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__38 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(0, 348, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__38);
+  __Pyx_GIVEREF(__pyx_tuple__38);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_event_11AsyncResult_25done, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AsyncResult_done, NULL, __pyx_n_s_gevent__event, __pyx_d, ((PyObject *)__pyx_codeobj__39)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 348, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_event_AsyncResult->tp_dict, __pyx_n_s_done, __pyx_t_2) < 0) __PYX_ERR(0, 348, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_6_event_AsyncResult);
+  __pyx_codeobj__39 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__38, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_event_py, __pyx_n_s_done, 348, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__39)) __PYX_ERR(0, 348, __pyx_L1_error)
+
+349:         return self.ready()
+
  __pyx_r = ((struct __pyx_vtabstruct_6gevent_6_event_AsyncResult *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.ready(((struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *)__pyx_v_self), 0);
+  goto __pyx_L0;
+
 350: 
+
 351:     # we don't support cancelling
+
 352: 
+
+353:     def cancel(self):
+
static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_27cancel(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static int __pyx_f_6gevent_6_event_11AsyncResult_cancel(CYTHON_UNUSED struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self, int __pyx_skip_dispatch) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("cancel", 0);
+  /* Check if called by wrapper */
+  if (unlikely(__pyx_skip_dispatch)) ;
+  /* Check if overridden in Python */
+  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
+    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
+    if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
+    else {
+      PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      #endif
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_cancel); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 353, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_6_event_11AsyncResult_27cancel)) {
+        __Pyx_INCREF(__pyx_t_1);
+        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+          if (likely(__pyx_t_4)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+            __Pyx_INCREF(__pyx_t_4);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_3, function);
+          }
+        }
+        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
+        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 353, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 353, __pyx_L1_error)
+        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+        __pyx_r = __pyx_t_5;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        goto __pyx_L0;
+      }
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+      tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
+      if (unlikely(type_dict_guard != tp_dict_version)) {
+        tp_dict_version = obj_dict_version = 0;
+      }
+      #endif
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    }
+    #endif
+  }
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_WriteUnraisable("gevent._event.AsyncResult.cancel", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_27cancel(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6gevent_6_event_11AsyncResult_26cancel[] = "AsyncResult.cancel(self) -> bool";
+static PyMethodDef __pyx_mdef_6gevent_6_event_11AsyncResult_27cancel = {"cancel", (PyCFunction)__pyx_pw_6gevent_6_event_11AsyncResult_27cancel, METH_NOARGS, __pyx_doc_6gevent_6_event_11AsyncResult_26cancel};
+static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_27cancel(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("cancel (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_6_event_11AsyncResult_26cancel(((struct __pyx_obj_6gevent_6_event_AsyncResult *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_event_11AsyncResult_26cancel(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("cancel", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_f_6gevent_6_event_11AsyncResult_cancel(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 353, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent._event.AsyncResult.cancel", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__40 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__40)) __PYX_ERR(0, 353, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__40);
+  __Pyx_GIVEREF(__pyx_tuple__40);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_event_11AsyncResult_27cancel, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AsyncResult_cancel, NULL, __pyx_n_s_gevent__event, __pyx_d, ((PyObject *)__pyx_codeobj__41)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 353, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_event_AsyncResult->tp_dict, __pyx_n_s_cancel, __pyx_t_2) < 0) __PYX_ERR(0, 353, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_6_event_AsyncResult);
+  __pyx_codeobj__41 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_event_py, __pyx_n_s_cancel, 353, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__41)) __PYX_ERR(0, 353, __pyx_L1_error)
+
+354:         return False
+
  __pyx_r = 0;
+  goto __pyx_L0;
+
 355: 
+
+356:     def cancelled(self):
+
static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_29cancelled(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static int __pyx_f_6gevent_6_event_11AsyncResult_cancelled(CYTHON_UNUSED struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self, int __pyx_skip_dispatch) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("cancelled", 0);
+  /* Check if called by wrapper */
+  if (unlikely(__pyx_skip_dispatch)) ;
+  /* Check if overridden in Python */
+  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
+    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
+    if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
+    else {
+      PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      #endif
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_cancelled); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 356, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_6_event_11AsyncResult_29cancelled)) {
+        __Pyx_INCREF(__pyx_t_1);
+        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+          if (likely(__pyx_t_4)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+            __Pyx_INCREF(__pyx_t_4);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_3, function);
+          }
+        }
+        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
+        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 356, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 356, __pyx_L1_error)
+        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+        __pyx_r = __pyx_t_5;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        goto __pyx_L0;
+      }
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+      tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
+      if (unlikely(type_dict_guard != tp_dict_version)) {
+        tp_dict_version = obj_dict_version = 0;
+      }
+      #endif
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    }
+    #endif
+  }
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_WriteUnraisable("gevent._event.AsyncResult.cancelled", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_29cancelled(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6gevent_6_event_11AsyncResult_28cancelled[] = "AsyncResult.cancelled(self) -> bool";
+static PyMethodDef __pyx_mdef_6gevent_6_event_11AsyncResult_29cancelled = {"cancelled", (PyCFunction)__pyx_pw_6gevent_6_event_11AsyncResult_29cancelled, METH_NOARGS, __pyx_doc_6gevent_6_event_11AsyncResult_28cancelled};
+static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_29cancelled(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("cancelled (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_6_event_11AsyncResult_28cancelled(((struct __pyx_obj_6gevent_6_event_AsyncResult *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_event_11AsyncResult_28cancelled(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("cancelled", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_f_6gevent_6_event_11AsyncResult_cancelled(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 356, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent._event.AsyncResult.cancelled", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__42 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(0, 356, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__42);
+  __Pyx_GIVEREF(__pyx_tuple__42);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_event_11AsyncResult_29cancelled, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AsyncResult_cancelled, NULL, __pyx_n_s_gevent__event, __pyx_d, ((PyObject *)__pyx_codeobj__43)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 356, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_event_AsyncResult->tp_dict, __pyx_n_s_cancelled, __pyx_t_2) < 0) __PYX_ERR(0, 356, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_6_event_AsyncResult);
+
+357:         return False
+
  __pyx_r = 0;
+  goto __pyx_L0;
+
 358: 
+
 359:     # exception is a method, we use it as a property
+
 360: 
+
 361: 
+
+362: from gevent._util import import_c_accel
+
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 362, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_import_c_accel);
+  __Pyx_GIVEREF(__pyx_n_s_import_c_accel);
+  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_import_c_accel);
+  __pyx_t_1 = __Pyx_Import(__pyx_n_s_gevent__util, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 362, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_import_c_accel); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 362, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_import_c_accel, __pyx_t_2) < 0) __PYX_ERR(0, 362, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+363: import_c_accel(globals(), 'gevent._event')
+
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_import_c_accel); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 363, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = __Pyx_Globals(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 363, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 363, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_GIVEREF(__pyx_t_2);
+  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_gevent__event);
+  __Pyx_GIVEREF(__pyx_n_s_gevent__event);
+  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_n_s_gevent__event);
+  __pyx_t_2 = 0;
+  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 363, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/event.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/event.py new file mode 100644 index 00000000..9a0d4024 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/event.py @@ -0,0 +1,363 @@ +# Copyright (c) 2009-2016 Denis Bilenko, gevent contributors. See LICENSE for details. +# cython: auto_pickle=False,embedsignature=True,always_allow_keywords=False,infer_types=True + +"""Basic synchronization primitives: Event and AsyncResult""" +from __future__ import print_function + +from gevent._util import _NONE +from gevent._compat import reraise +from gevent._tblib import dump_traceback, load_traceback + +from gevent.timeout import Timeout + + +__all__ = [ + 'Event', + 'AsyncResult', +] + +def _get_linkable(): + x = __import__('gevent._abstract_linkable') + return x._abstract_linkable.AbstractLinkable +locals()['AbstractLinkable'] = _get_linkable() +del _get_linkable + +# Sadly, something about the way we have to "import" AbstractLinkable +# breaks pylint's inference of slots, even though they're declared +# right here. +# pylint:disable=assigning-non-slot + +class Event(AbstractLinkable): # pylint:disable=undefined-variable + """A synchronization primitive that allows one greenlet to wake up one or more others. + It has the same interface as :class:`threading.Event` but works across greenlets. + + An event object manages an internal flag that can be set to true with the + :meth:`set` method and reset to false with the :meth:`clear` method. The :meth:`wait` method + blocks until the flag is true. + + .. note:: + The order and timing in which waiting greenlets are awakened is not determined. + As an implementation note, in gevent 1.1 and 1.0, waiting greenlets are awakened in a + undetermined order sometime *after* the current greenlet yields to the event loop. Other greenlets + (those not waiting to be awakened) may run between the current greenlet yielding and + the waiting greenlets being awakened. These details may change in the future. + """ + + __slots__ = ('_flag',) + + def __init__(self): + super(Event, self).__init__() + self._flag = False + + def __str__(self): + return '<%s %s _links[%s]>' % (self.__class__.__name__, (self._flag and 'set') or 'clear', + self.linkcount()) + + def is_set(self): + """Return true if and only if the internal flag is true.""" + return self._flag + + def isSet(self): + # makes it a better drop-in replacement for threading.Event + return self._flag + + def ready(self): + # makes it compatible with AsyncResult and Greenlet (for + # example in wait()) + return self._flag + + def set(self): + """ + Set the internal flag to true. + + All greenlets waiting for it to become true are awakened in + some order at some time in the future. Greenlets that call + :meth:`wait` once the flag is true will not block at all + (until :meth:`clear` is called). + """ + self._flag = True + self._check_and_notify() + + def clear(self): + """ + Reset the internal flag to false. + + Subsequently, threads calling :meth:`wait` will block until + :meth:`set` is called to set the internal flag to true again. + """ + self._flag = False + + def _wait_return_value(self, waited, wait_success): + # To avoid the race condition outlined in http://bugs.python.org/issue13502, + # if we had to wait, then we need to return whether or not + # the condition got changed. Otherwise we simply echo + # the current state of the flag (which should be true) + if not waited: + flag = self._flag + assert flag, "if we didn't wait we should already be set" + return flag + + return wait_success + + def wait(self, timeout=None): + """ + Block until the internal flag is true. + + If the internal flag is true on entry, return immediately. Otherwise, + block until another thread (greenlet) calls :meth:`set` to set the flag to true, + or until the optional timeout occurs. + + When the *timeout* argument is present and not ``None``, it should be a + floating point number specifying a timeout for the operation in seconds + (or fractions thereof). + + :return: This method returns true if and only if the internal flag has been set to + true, either before the wait call or after the wait starts, so it will + always return ``True`` except if a timeout is given and the operation + times out. + + .. versionchanged:: 1.1 + The return value represents the flag during the elapsed wait, not + just after it elapses. This solves a race condition if one greenlet + sets and then clears the flag without switching, while other greenlets + are waiting. When the waiters wake up, this will return True; previously, + they would still wake up, but the return value would be False. This is most + noticeable when the *timeout* is present. + """ + return self._wait(timeout) + + def _reset_internal_locks(self): # pragma: no cover + # for compatibility with threading.Event + # Exception AttributeError: AttributeError("'Event' object has no attribute '_reset_internal_locks'",) + # in ignored + pass + + +class AsyncResult(AbstractLinkable): # pylint:disable=undefined-variable + """A one-time event that stores a value or an exception. + + Like :class:`Event` it wakes up all the waiters when :meth:`set` or :meth:`set_exception` + is called. Waiters may receive the passed value or exception by calling :meth:`get` + instead of :meth:`wait`. An :class:`AsyncResult` instance cannot be reset. + + To pass a value call :meth:`set`. Calls to :meth:`get` (those that are currently blocking as well as + those made in the future) will return the value: + + >>> result = AsyncResult() + >>> result.set(100) + >>> result.get() + 100 + + To pass an exception call :meth:`set_exception`. This will cause :meth:`get` to raise that exception: + + >>> result = AsyncResult() + >>> result.set_exception(RuntimeError('failure')) + >>> result.get() + Traceback (most recent call last): + ... + RuntimeError: failure + + :class:`AsyncResult` implements :meth:`__call__` and thus can be used as :meth:`link` target: + + >>> import gevent + >>> result = AsyncResult() + >>> gevent.spawn(lambda : 1/0).link(result) + >>> try: + ... result.get() + ... except ZeroDivisionError: + ... print('ZeroDivisionError') + ZeroDivisionError + + .. note:: + The order and timing in which waiting greenlets are awakened is not determined. + As an implementation note, in gevent 1.1 and 1.0, waiting greenlets are awakened in a + undetermined order sometime *after* the current greenlet yields to the event loop. Other greenlets + (those not waiting to be awakened) may run between the current greenlet yielding and + the waiting greenlets being awakened. These details may change in the future. + + .. versionchanged:: 1.1 + The exact order in which waiting greenlets are awakened is not the same + as in 1.0. + .. versionchanged:: 1.1 + Callbacks :meth:`linked ` to this object are required to be hashable, and duplicates are + merged. + """ + + __slots__ = ('_value', '_exc_info', '_imap_task_index') + + def __init__(self): + super(AsyncResult, self).__init__() + self._value = _NONE + self._exc_info = () + + @property + def _exception(self): + return self._exc_info[1] if self._exc_info else _NONE + + @property + def value(self): + """ + Holds the value passed to :meth:`set` if :meth:`set` was called. Otherwise, + ``None`` + """ + return self._value if self._value is not _NONE else None + + @property + def exc_info(self): + """ + The three-tuple of exception information if :meth:`set_exception` was called. + """ + if self._exc_info: + return (self._exc_info[0], self._exc_info[1], load_traceback(self._exc_info[2])) + return () + + def __str__(self): + result = '<%s ' % (self.__class__.__name__, ) + if self.value is not None or self._exception is not _NONE: + result += 'value=%r ' % self.value + if self._exception is not None and self._exception is not _NONE: + result += 'exception=%r ' % self._exception + if self._exception is _NONE: + result += 'unset ' + return result + ' _links[%s]>' % self.linkcount() + + def ready(self): + """Return true if and only if it holds a value or an exception""" + return self._exc_info or self._value is not _NONE + + def successful(self): + """Return true if and only if it is ready and holds a value""" + return self._value is not _NONE + + @property + def exception(self): + """Holds the exception instance passed to :meth:`set_exception` if :meth:`set_exception` was called. + Otherwise ``None``.""" + if self._exc_info: + return self._exc_info[1] + + def set(self, value=None): + """Store the value and wake up any waiters. + + All greenlets blocking on :meth:`get` or :meth:`wait` are awakened. + Subsequent calls to :meth:`wait` and :meth:`get` will not block at all. + """ + self._value = value + self._check_and_notify() + + def set_exception(self, exception, exc_info=None): + """Store the exception and wake up any waiters. + + All greenlets blocking on :meth:`get` or :meth:`wait` are awakened. + Subsequent calls to :meth:`wait` and :meth:`get` will not block at all. + + :keyword tuple exc_info: If given, a standard three-tuple of type, value, :class:`traceback` + as returned by :func:`sys.exc_info`. This will be used when the exception + is re-raised to propagate the correct traceback. + """ + if exc_info: + self._exc_info = (exc_info[0], exc_info[1], dump_traceback(exc_info[2])) + else: + self._exc_info = (type(exception), exception, dump_traceback(None)) + + self._check_and_notify() + + def _raise_exception(self): + reraise(*self.exc_info) + + def get(self, block=True, timeout=None): + """Return the stored value or raise the exception. + + If this instance already holds a value or an exception, return or raise it immediately. + Otherwise, block until another greenlet calls :meth:`set` or :meth:`set_exception` or + until the optional timeout occurs. + + When the *timeout* argument is present and not ``None``, it should be a + floating point number specifying a timeout for the operation in seconds + (or fractions thereof). If the *timeout* elapses, the *Timeout* exception will + be raised. + + :keyword bool block: If set to ``False`` and this instance is not ready, + immediately raise a :class:`Timeout` exception. + """ + if self._value is not _NONE: + return self._value + if self._exc_info: + return self._raise_exception() + + if not block: + # Not ready and not blocking, so immediately timeout + raise Timeout() + + # Wait, raising a timeout that elapses + self._wait_core(timeout, ()) + + # by definition we are now ready + return self.get(block=False) + + def get_nowait(self): + """ + Return the value or raise the exception without blocking. + + If this object is not yet :meth:`ready `, raise + :class:`gevent.Timeout` immediately. + """ + return self.get(block=False) + + def _wait_return_value(self, waited, wait_success): + # pylint:disable=unused-argument + # Always return the value. Since this is a one-shot event, + # no race condition should reset it. + return self.value + + def wait(self, timeout=None): + """Block until the instance is ready. + + If this instance already holds a value, it is returned immediately. If this + instance already holds an exception, ``None`` is returned immediately. + + Otherwise, block until another greenlet calls :meth:`set` or :meth:`set_exception` + (at which point either the value or ``None`` will be returned, respectively), + or until the optional timeout expires (at which point ``None`` will also be + returned). + + When the *timeout* argument is present and not ``None``, it should be a + floating point number specifying a timeout for the operation in seconds + (or fractions thereof). + + .. note:: If a timeout is given and expires, ``None`` will be returned + (no timeout exception will be raised). + + """ + return self._wait(timeout) + + # link protocol + def __call__(self, source): + if source.successful(): + self.set(source.value) + else: + self.set_exception(source.exception, getattr(source, 'exc_info', None)) + + # Methods to make us more like concurrent.futures.Future + + def result(self, timeout=None): + return self.get(timeout=timeout) + + set_result = set + + def done(self): + return self.ready() + + # we don't support cancelling + + def cancel(self): + return False + + def cancelled(self): + return False + + # exception is a method, we use it as a property + + +from gevent._util import import_c_accel +import_c_accel(globals(), 'gevent._event') diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/events.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/events.py new file mode 100644 index 00000000..12c02ec9 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/events.py @@ -0,0 +1,480 @@ +# -*- coding: utf-8 -*- +# Copyright 2018 gevent. See LICENSE for details. +""" +Publish/subscribe event infrastructure. + +When certain "interesting" things happen during the lifetime of the +process, gevent will "publish" an event (an object). That event is +delivered to interested "subscribers" (functions that take one +parameter, the event object). + +Higher level frameworks may take this foundation and build richer +models on it. + +If :mod:`zope.event` is installed, then it will be used to provide the +functionality of `notify` and `subscribers`. See +:mod:`zope.event.classhandler` for a simple class-based approach to +subscribing to a filtered list of events, and see `zope.component +`_ for a +much higher-level, flexible system. If you are using one of these systems, +you generally will not want to directly modify `subscribers`. + +.. versionadded:: 1.3b1 +""" +from __future__ import absolute_import +from __future__ import division +from __future__ import print_function + + +__all__ = [ + 'subscribers', + + # monitor thread + 'IEventLoopBlocked', + 'EventLoopBlocked', + 'IMemoryUsageThresholdExceeded', + 'MemoryUsageThresholdExceeded', + 'IMemoryUsageUnderThreshold', + 'MemoryUsageUnderThreshold', + + # Hub + 'IPeriodicMonitorThread', + 'IPeriodicMonitorThreadStartedEvent', + 'PeriodicMonitorThreadStartedEvent', + + # monkey + 'IGeventPatchEvent', + 'GeventPatchEvent', + 'IGeventWillPatchEvent', + 'DoNotPatch', + 'GeventWillPatchEvent', + 'IGeventDidPatchEvent', + 'IGeventWillPatchModuleEvent', + 'GeventWillPatchModuleEvent', + 'IGeventDidPatchModuleEvent', + 'GeventDidPatchModuleEvent', + 'IGeventWillPatchAllEvent', + 'GeventWillPatchAllEvent', + 'IGeventDidPatchBuiltinModulesEvent', + 'GeventDidPatchBuiltinModulesEvent', + 'IGeventDidPatchAllEvent', + 'GeventDidPatchAllEvent', +] + +# pylint:disable=no-self-argument + +try: + from zope.event import subscribers + from zope.event import notify +except ImportError: + #: Applications may register for notification of events by appending a + #: callable to the ``subscribers`` list. + #: + #: Each subscriber takes a single argument, which is the event object + #: being published. + #: + #: Exceptions raised by subscribers will be propagated *without* running + #: any remaining subscribers. + subscribers = [] + + def notify(event): + """ + Notify all subscribers of ``event``. + """ + for subscriber in subscribers: + subscriber(event) + +notify = notify # export +try: + # pkg_resources is technically optional, we don't + # list a hard dependency on it. + __import__('pkg_resources') +except ImportError: + notify_and_call_entry_points = notify +else: + from pkg_resources import iter_entry_points + import platform + try: + # Cache the platform info. pkg_resources uses + # platform.machine() for environment markers, and + # platform.machine() wants to call os.popen('uname'), which is + # broken on Py2 when the gevent child signal handler is + # installed. (see test__monkey_sigchild_2.py) + platform.uname() + except: # pylint:disable=bare-except + pass + finally: + del platform + + def notify_and_call_entry_points(event): + notify(event) + for plugin in iter_entry_points(event.ENTRY_POINT_NAME): + subscriber = plugin.load() + subscriber(event) + +from gevent._util import Interface +from gevent._util import implementer +from gevent._util import Attribute + + +class IPeriodicMonitorThread(Interface): + """ + The contract for the periodic monitoring thread that is started + by the hub. + """ + + def add_monitoring_function(function, period): + """ + Schedule the *function* to be called approximately every *period* fractional seconds. + + The *function* receives one argument, the hub being monitored. It is called + in the monitoring thread, *not* the hub thread. It **must not** attempt to + use the gevent asynchronous API. + + If the *function* is already a monitoring function, then its *period* + will be updated for future runs. + + If the *period* is ``None``, then the function will be removed. + + A *period* less than or equal to zero is not allowed. + """ + +class IPeriodicMonitorThreadStartedEvent(Interface): + """ + The event emitted when a hub starts a periodic monitoring thread. + + You can use this event to add additional monitoring functions. + """ + + monitor = Attribute("The instance of `IPeriodicMonitorThread` that was started.") + +class PeriodicMonitorThreadStartedEvent(object): + """ + The implementation of :class:`IPeriodicMonitorThreadStartedEvent`. + """ + + #: The name of the setuptools entry point that is called when this + #: event is emitted. + ENTRY_POINT_NAME = 'gevent.plugins.hub.periodic_monitor_thread_started' + + def __init__(self, monitor): + self.monitor = monitor + +class IEventLoopBlocked(Interface): + """ + The event emitted when the event loop is blocked. + + This event is emitted in the monitor thread. + """ + + greenlet = Attribute("The greenlet that appeared to be blocking the loop.") + blocking_time = Attribute("The approximate time in seconds the loop has been blocked.") + info = Attribute("A sequence of string lines providing extra info.") + +@implementer(IEventLoopBlocked) +class EventLoopBlocked(object): + """ + The event emitted when the event loop is blocked. + + Implements `IEventLoopBlocked`. + """ + + def __init__(self, greenlet, blocking_time, info): + self.greenlet = greenlet + self.blocking_time = blocking_time + self.info = info + +class IMemoryUsageThresholdExceeded(Interface): + """ + The event emitted when the memory usage threshold is exceeded. + + This event is emitted only while memory continues to grow + above the threshold. Only if the condition or stabilized is corrected (memory + usage drops) will the event be emitted in the future. + + This event is emitted in the monitor thread. + """ + + mem_usage = Attribute("The current process memory usage, in bytes.") + max_allowed = Attribute("The maximum allowed memory usage, in bytes.") + memory_info = Attribute("The tuple of memory usage stats return by psutil.") + +class _AbstractMemoryEvent(object): + + def __init__(self, mem_usage, max_allowed, memory_info): + self.mem_usage = mem_usage + self.max_allowed = max_allowed + self.memory_info = memory_info + + def __repr__(self): + return "<%s used=%d max=%d details=%r>" % ( + self.__class__.__name__, + self.mem_usage, + self.max_allowed, + self.memory_info, + ) + +@implementer(IMemoryUsageThresholdExceeded) +class MemoryUsageThresholdExceeded(_AbstractMemoryEvent): + """ + Implementation of `IMemoryUsageThresholdExceeded`. + """ + + +class IMemoryUsageUnderThreshold(Interface): + """ + The event emitted when the memory usage drops below the + threshold after having previously been above it. + + This event is emitted only the first time memory usage is detected + to be below the threshold after having previously been above it. + If memory usage climbs again, a `IMemoryUsageThresholdExceeded` + event will be broadcast, and then this event could be broadcast again. + + This event is emitted in the monitor thread. + """ + + mem_usage = Attribute("The current process memory usage, in bytes.") + max_allowed = Attribute("The maximum allowed memory usage, in bytes.") + max_memory_usage = Attribute("The memory usage that caused the previous " + "IMemoryUsageThresholdExceeded event.") + memory_info = Attribute("The tuple of memory usage stats return by psutil.") + + +@implementer(IMemoryUsageUnderThreshold) +class MemoryUsageUnderThreshold(_AbstractMemoryEvent): + """ + Implementation of `IMemoryUsageUnderThreshold`. + """ + + def __init__(self, mem_usage, max_allowed, memory_info, max_usage): + super(MemoryUsageUnderThreshold, self).__init__(mem_usage, max_allowed, memory_info) + self.max_memory_usage = max_usage + + +class IGeventPatchEvent(Interface): + """ + The root for all monkey-patch events gevent emits. + """ + + source = Attribute("The source object containing the patches.") + target = Attribute("The destination object to be patched.") + +@implementer(IGeventPatchEvent) +class GeventPatchEvent(object): + """ + Implementation of `IGeventPatchEvent`. + """ + + def __init__(self, source, target): + self.source = source + self.target = target + + def __repr__(self): + return '<%s source=%r target=%r at %x>' % (self.__class__.__name__, + self.source, + self.target, + id(self)) + +class IGeventWillPatchEvent(IGeventPatchEvent): + """ + An event emitted *before* gevent monkey-patches something. + + If a subscriber raises `DoNotPatch`, then patching this particular + item will not take place. + """ + + +class DoNotPatch(BaseException): + """ + Subscribers to will-patch events can raise instances + of this class to tell gevent not to patch that particular item. + """ + + +@implementer(IGeventWillPatchEvent) +class GeventWillPatchEvent(GeventPatchEvent): + """ + Implementation of `IGeventWillPatchEvent`. + """ + +class IGeventDidPatchEvent(IGeventPatchEvent): + """ + An event emitted *after* gevent has patched something. + """ + +@implementer(IGeventDidPatchEvent) +class GeventDidPatchEvent(GeventPatchEvent): + """ + Implementation of `IGeventDidPatchEvent`. + """ + +class IGeventWillPatchModuleEvent(IGeventWillPatchEvent): + """ + An event emitted *before* gevent begins patching a specific module. + + Both *source* and *target* attributes are module objects. + """ + + module_name = Attribute("The name of the module being patched. " + "This is the same as ``target.__name__``.") + + target_item_names = Attribute("The list of item names to patch. " + "This can be modified in place with caution.") + +@implementer(IGeventWillPatchModuleEvent) +class GeventWillPatchModuleEvent(GeventWillPatchEvent): + """ + Implementation of `IGeventWillPatchModuleEvent`. + """ + + #: The name of the setuptools entry point that is called when this + #: event is emitted. + ENTRY_POINT_NAME = 'gevent.plugins.monkey.will_patch_module' + + def __init__(self, module_name, source, target, items): + super(GeventWillPatchModuleEvent, self).__init__(source, target) + self.module_name = module_name + self.target_item_names = items + + +class IGeventDidPatchModuleEvent(IGeventDidPatchEvent): + """ + An event emitted *after* gevent has completed patching a specific + module. + """ + + module_name = Attribute("The name of the module being patched. " + "This is the same as ``target.__name__``.") + + +@implementer(IGeventDidPatchModuleEvent) +class GeventDidPatchModuleEvent(GeventDidPatchEvent): + """ + Implementation of `IGeventDidPatchModuleEvent`. + """ + + #: The name of the setuptools entry point that is called when this + #: event is emitted. + ENTRY_POINT_NAME = 'gevent.plugins.monkey.did_patch_module' + + def __init__(self, module_name, source, target): + super(GeventDidPatchModuleEvent, self).__init__(source, target) + self.module_name = module_name + +# TODO: Maybe it would be useful for the the module patch events +# to have an attribute telling if they're being done during patch_all? + +class IGeventWillPatchAllEvent(IGeventWillPatchEvent): + """ + An event emitted *before* gevent begins patching the system. + + Following this event will be a series of + `IGeventWillPatchModuleEvent` and `IGeventDidPatchModuleEvent` for + each patched module. + + Once the gevent builtin modules have been processed, + `IGeventDidPatchBuiltinModulesEvent` will be emitted. Processing + this event is an ideal time for third-party modules to be imported + and patched (which may trigger its own will/did patch module + events). + + Finally, a `IGeventDidPatchAllEvent` will be sent. + + If a subscriber to this event raises `DoNotPatch`, no patching + will be done. + + The *source* and *target* attributes have undefined values. + """ + + patch_all_arguments = Attribute( + "A dictionary of all the arguments to `gevent.monkey.patch_all`. " + "This dictionary should not be modified. " + ) + + patch_all_kwargs = Attribute( + "A dictionary of the extra arguments to `gevent.monkey.patch_all`. " + "This dictionary should not be modified. " + ) + + def will_patch_module(module_name): + """ + Return whether the module named *module_name* will be patched. + """ + +class _PatchAllMixin(object): + def __init__(self, patch_all_arguments, patch_all_kwargs): + super(_PatchAllMixin, self).__init__(None, None) + self._patch_all_arguments = patch_all_arguments + self._patch_all_kwargs = patch_all_kwargs + + @property + def patch_all_arguments(self): + return self._patch_all_arguments.copy() + + @property + def patch_all_kwargs(self): + return self._patch_all_kwargs.copy() + + def __repr__(self): + return '<%s %r at %x>' % (self.__class__.__name__, + self._patch_all_arguments, + id(self)) + +@implementer(IGeventWillPatchAllEvent) +class GeventWillPatchAllEvent(_PatchAllMixin, GeventWillPatchEvent): + """ + Implementation of `IGeventWillPatchAllEvent`. + """ + + #: The name of the setuptools entry point that is called when this + #: event is emitted. + ENTRY_POINT_NAME = 'gevent.plugins.monkey.will_patch_all' + + def will_patch_module(self, module_name): + return self.patch_all_arguments.get(module_name) + +class IGeventDidPatchBuiltinModulesEvent(IGeventDidPatchEvent): + """ + Event emitted *after* the builtin modules have been patched. + + The values of the *source* and *target* attributes are undefined. + """ + + patch_all_arguments = Attribute( + "A dictionary of all the arguments to `gevent.monkey.patch_all`. " + "This dictionary should not be modified. " + ) + + patch_all_kwargs = Attribute( + "A dictionary of the extra arguments to `gevent.monkey.patch_all`. " + "This dictionary should not be modified. " + ) + +@implementer(IGeventDidPatchBuiltinModulesEvent) +class GeventDidPatchBuiltinModulesEvent(_PatchAllMixin, GeventDidPatchEvent): + """ + Implementation of `IGeventDidPatchBuiltinModulesEvent`. + """ + + #: The name of the setuptools entry point that is called when this + #: event is emitted. + ENTRY_POINT_NAME = 'gevent.plugins.monkey.did_patch_builtins' + +class IGeventDidPatchAllEvent(IGeventDidPatchEvent): + """ + Event emitted after gevent has patched all modules, both builtin + and those provided by plugins/subscribers. + + The values of the *source* and *target* attributes are undefined. + """ + +@implementer(IGeventDidPatchAllEvent) +class GeventDidPatchAllEvent(_PatchAllMixin, GeventDidPatchEvent): + """ + Implementation of `IGeventDidPatchAllEvent`. + """ + + #: The name of the setuptools entry point that is called when this + #: event is emitted. + ENTRY_POINT_NAME = 'gevent.plugins.monkey.did_patch_all' diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/exceptions.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/exceptions.py new file mode 100644 index 00000000..2c779ce6 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/exceptions.py @@ -0,0 +1,79 @@ +# -*- coding: utf-8 -*- +# copyright 2018 gevent +""" +Exceptions. + +.. versionadded:: 1.3b1 + +""" +from __future__ import absolute_import +from __future__ import division +from __future__ import print_function + + +__all__ = [ + 'LoopExit', +] + + +class LoopExit(Exception): + """ + Exception thrown when the hub finishes running (`gevent.hub.Hub.run` + would return). + + In a normal application, this is never thrown or caught + explicitly. The internal implementation of functions like + :meth:`gevent.hub.Hub.join` and :func:`gevent.joinall` may catch it, but user code + generally should not. + + .. caution:: + Errors in application programming can also lead to this exception being + raised. Some examples include (but are not limited too): + + - greenlets deadlocking on a lock; + - using a socket or other gevent object with native thread + affinity from a different thread + + """ + + def __repr__(self): + # pylint:disable=unsubscriptable-object + if len(self.args) == 3: # From the hub + import pprint + return "%s\n\tHub: %s\n\tHandles:\n%s" % ( + self.args[0], self.args[1], + pprint.pformat(self.args[2]) + ) + return Exception.__repr__(self) + + def __str__(self): + return repr(self) + +class BlockingSwitchOutError(AssertionError): + """ + Raised when a gevent synchronous function is called from a + low-level event loop callback. + + This is usually a programming error. + """ + + +class InvalidSwitchError(AssertionError): + """ + Raised when the event loop returns control to a greenlet in an + unexpected way. + + This is usually a bug in gevent, greenlet, or the event loop. + """ + +class ConcurrentObjectUseError(AssertionError): + """ + Raised when an object is used (waited on) by two greenlets + independently, meaning the object was entered into a blocking + state by one greenlet and then another while still blocking in the + first one. + + This is usually a programming error. + + .. seealso:: `gevent.socket.wait` + """ diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/fileobject.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/fileobject.py new file mode 100644 index 00000000..598f882c --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/fileobject.py @@ -0,0 +1,61 @@ +""" +Wrappers to make file-like objects cooperative. + +.. class:: FileObject + + The main entry point to the file-like gevent-compatible behaviour. It will be defined + to be the best available implementation. + +There are two main implementations of ``FileObject``. On all systems, +there is :class:`FileObjectThread` which uses the built-in native +threadpool to avoid blocking the entire interpreter. On UNIX systems +(those that support the :mod:`fcntl` module), there is also +:class:`FileObjectPosix` which uses native non-blocking semantics. + +A third class, :class:`FileObjectBlock`, is simply a wrapper that executes everything +synchronously (and so is not gevent-compatible). It is provided for testing and debugging +purposes. + +Configuration +============= + +You may change the default value for ``FileObject`` using the +``GEVENT_FILE`` environment variable. Set it to ``posix``, ``thread``, +or ``block`` to choose from :class:`FileObjectPosix`, +:class:`FileObjectThread` and :class:`FileObjectBlock`, respectively. +You may also set it to the fully qualified class name of another +object that implements the file interface to use one of your own +objects. + +.. note:: The environment variable must be set at the time this module + is first imported. + +Classes +======= +""" +from __future__ import absolute_import + +from gevent._config import config + +__all__ = [ + 'FileObjectPosix', + 'FileObjectThread', + 'FileObjectBlock', + 'FileObject', +] + +try: + from fcntl import fcntl +except ImportError: + __all__.remove("FileObjectPosix") +else: + del fcntl + from gevent._fileobjectposix import FileObjectPosix + +from gevent._fileobjectcommon import FileObjectThread +from gevent._fileobjectcommon import FileObjectBlock + + +# None of the possible objects can live in this module because +# we would get an import cycle and the config couldn't be set from code. +FileObject = config.fileobject diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/greenlet.c b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/greenlet.c new file mode 100644 index 00000000..71609211 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/greenlet.c @@ -0,0 +1,24316 @@ +/* Generated by Cython 0.29.2 */ + +/* BEGIN: Cython Metadata +{ + "distutils": { + "depends": [ + "src/gevent/__ident.pxd", + "src/gevent/_greenlet.pxd", + "src/gevent/_ident.py", + "src\\gevent\\__ident.pxd", + "src\\gevent\\_greenlet.pxd", + "src\\gevent\\_ident.py" + ], + "include_dirs": [ + "C:\\Python37\\Include", + "deps" + ], + "name": "gevent._greenlet", + "sources": [ + "src/gevent/greenlet.py" + ] + }, + "module_name": "gevent._greenlet" +} +END: Cython Metadata */ + +#define PY_SSIZE_T_CLEAN +#include "Python.h" +#ifndef Py_PYTHON_H + #error Python headers needed to compile C extensions, please install development version of Python. +#elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) + #error Cython requires Python 2.6+ or Python 3.3+. +#else +#define CYTHON_ABI "0_29_2" +#define CYTHON_HEX_VERSION 0x001D02F0 +#define CYTHON_FUTURE_DIVISION 1 +#include +#ifndef offsetof + #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) +#endif +#if !defined(WIN32) && !defined(MS_WINDOWS) + #ifndef __stdcall + #define __stdcall + #endif + #ifndef __cdecl + #define __cdecl + #endif + #ifndef __fastcall + #define __fastcall + #endif +#endif +#ifndef DL_IMPORT + #define DL_IMPORT(t) t +#endif +#ifndef DL_EXPORT + #define DL_EXPORT(t) t +#endif +#define __PYX_COMMA , +#ifndef HAVE_LONG_LONG + #if PY_VERSION_HEX >= 0x02070000 + #define HAVE_LONG_LONG + #endif +#endif +#ifndef PY_LONG_LONG + #define PY_LONG_LONG LONG_LONG +#endif +#ifndef Py_HUGE_VAL + #define Py_HUGE_VAL HUGE_VAL +#endif +#ifdef PYPY_VERSION + #define CYTHON_COMPILING_IN_PYPY 1 + #define CYTHON_COMPILING_IN_PYSTON 0 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #undef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 0 + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #if PY_VERSION_HEX < 0x03050000 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #elif !defined(CYTHON_USE_ASYNC_SLOTS) + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #undef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 0 + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #undef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 1 + #undef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 0 + #undef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 0 + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #undef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE 0 + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 +#elif defined(PYSTON_VERSION) + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_PYSTON 1 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #ifndef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 1 + #endif + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #ifndef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 1 + #endif + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #ifndef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 0 + #endif + #ifndef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 1 + #endif + #ifndef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 1 + #endif + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #undef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE 0 + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 +#else + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_PYSTON 0 + #define CYTHON_COMPILING_IN_CPYTHON 1 + #ifndef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 1 + #endif + #if PY_VERSION_HEX < 0x02070000 + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #elif !defined(CYTHON_USE_PYTYPE_LOOKUP) + #define CYTHON_USE_PYTYPE_LOOKUP 1 + #endif + #if PY_MAJOR_VERSION < 3 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #elif !defined(CYTHON_USE_ASYNC_SLOTS) + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #if PY_VERSION_HEX < 0x02070000 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #elif !defined(CYTHON_USE_PYLONG_INTERNALS) + #define CYTHON_USE_PYLONG_INTERNALS 1 + #endif + #ifndef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 1 + #endif + #ifndef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 1 + #endif + #if PY_VERSION_HEX < 0x030300F0 + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #elif !defined(CYTHON_USE_UNICODE_WRITER) + #define CYTHON_USE_UNICODE_WRITER 1 + #endif + #ifndef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 0 + #endif + #ifndef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 1 + #endif + #ifndef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 1 + #endif + #ifndef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 1 + #endif + #ifndef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 1 + #endif + #ifndef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000) + #endif + #ifndef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1) + #endif + #ifndef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1) + #endif + #ifndef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3) + #endif +#endif +#if !defined(CYTHON_FAST_PYCCALL) +#define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) +#endif +#if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #undef SHIFT + #undef BASE + #undef MASK + #ifdef SIZEOF_VOID_P + enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) }; + #endif +#endif +#ifndef __has_attribute + #define __has_attribute(x) 0 +#endif +#ifndef __has_cpp_attribute + #define __has_cpp_attribute(x) 0 +#endif +#ifndef CYTHON_RESTRICT + #if defined(__GNUC__) + #define CYTHON_RESTRICT __restrict__ + #elif defined(_MSC_VER) && _MSC_VER >= 1400 + #define CYTHON_RESTRICT __restrict + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_RESTRICT restrict + #else + #define CYTHON_RESTRICT + #endif +#endif +#ifndef CYTHON_UNUSED +# if defined(__GNUC__) +# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +#endif +#ifndef CYTHON_MAYBE_UNUSED_VAR +# if defined(__cplusplus) + template void CYTHON_MAYBE_UNUSED_VAR( const T& ) { } +# else +# define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x) +# endif +#endif +#ifndef CYTHON_NCP_UNUSED +# if CYTHON_COMPILING_IN_CPYTHON +# define CYTHON_NCP_UNUSED +# else +# define CYTHON_NCP_UNUSED CYTHON_UNUSED +# endif +#endif +#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) +#ifdef _MSC_VER + #ifndef _MSC_STDINT_H_ + #if _MSC_VER < 1300 + typedef unsigned char uint8_t; + typedef unsigned int uint32_t; + #else + typedef unsigned __int8 uint8_t; + typedef unsigned __int32 uint32_t; + #endif + #endif +#else + #include +#endif +#ifndef CYTHON_FALLTHROUGH + #if defined(__cplusplus) && __cplusplus >= 201103L + #if __has_cpp_attribute(fallthrough) + #define CYTHON_FALLTHROUGH [[fallthrough]] + #elif __has_cpp_attribute(clang::fallthrough) + #define CYTHON_FALLTHROUGH [[clang::fallthrough]] + #elif __has_cpp_attribute(gnu::fallthrough) + #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] + #endif + #endif + #ifndef CYTHON_FALLTHROUGH + #if __has_attribute(fallthrough) + #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) + #else + #define CYTHON_FALLTHROUGH + #endif + #endif + #if defined(__clang__ ) && defined(__apple_build_version__) + #if __apple_build_version__ < 7000000 + #undef CYTHON_FALLTHROUGH + #define CYTHON_FALLTHROUGH + #endif + #endif +#endif + +#ifndef CYTHON_INLINE + #if defined(__clang__) + #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) + #elif defined(__GNUC__) + #define CYTHON_INLINE __inline__ + #elif defined(_MSC_VER) + #define CYTHON_INLINE __inline + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_INLINE inline + #else + #define CYTHON_INLINE + #endif +#endif + +#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) + #define Py_OptimizeFlag 0 +#endif +#define __PYX_BUILD_PY_SSIZE_T "n" +#define CYTHON_FORMAT_SSIZE_T "z" +#if PY_MAJOR_VERSION < 3 + #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyClass_Type +#else + #define __Pyx_BUILTIN_MODULE_NAME "builtins" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyType_Type +#endif +#ifndef Py_TPFLAGS_CHECKTYPES + #define Py_TPFLAGS_CHECKTYPES 0 +#endif +#ifndef Py_TPFLAGS_HAVE_INDEX + #define Py_TPFLAGS_HAVE_INDEX 0 +#endif +#ifndef Py_TPFLAGS_HAVE_NEWBUFFER + #define Py_TPFLAGS_HAVE_NEWBUFFER 0 +#endif +#ifndef Py_TPFLAGS_HAVE_FINALIZE + #define Py_TPFLAGS_HAVE_FINALIZE 0 +#endif +#ifndef METH_STACKLESS + #define METH_STACKLESS 0 +#endif +#if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) + #ifndef METH_FASTCALL + #define METH_FASTCALL 0x80 + #endif + typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs); + typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args, + Py_ssize_t nargs, PyObject *kwnames); +#else + #define __Pyx_PyCFunctionFast _PyCFunctionFast + #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords +#endif +#if CYTHON_FAST_PYCCALL +#define __Pyx_PyFastCFunction_Check(func)\ + ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS))))) +#else +#define __Pyx_PyFastCFunction_Check(func) 0 +#endif +#if CYTHON_USE_DICT_VERSIONS +#define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) +#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ + (version_var) = __PYX_GET_DICT_VERSION(dict);\ + (cache_var) = (value); +#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ + static PY_UINT64_T __pyx_dict_version = 0;\ + static PyObject *__pyx_dict_cached_value = NULL;\ + if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ + (VAR) = __pyx_dict_cached_value;\ + } else {\ + (VAR) = __pyx_dict_cached_value = (LOOKUP);\ + __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ + }\ + } +#else +#define __PYX_GET_DICT_VERSION(dict) (0) +#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) +#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) + #define PyObject_Malloc(s) PyMem_Malloc(s) + #define PyObject_Free(p) PyMem_Free(p) + #define PyObject_Realloc(p) PyMem_Realloc(p) +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1 + #define PyMem_RawMalloc(n) PyMem_Malloc(n) + #define PyMem_RawRealloc(p, n) PyMem_Realloc(p, n) + #define PyMem_RawFree(p) PyMem_Free(p) +#endif +#if CYTHON_COMPILING_IN_PYSTON + #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co) + #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno) +#else + #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) + #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) +#endif +#if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000 + #define __Pyx_PyThreadState_Current PyThreadState_GET() +#elif PY_VERSION_HEX >= 0x03060000 + #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() +#elif PY_VERSION_HEX >= 0x03000000 + #define __Pyx_PyThreadState_Current PyThreadState_GET() +#else + #define __Pyx_PyThreadState_Current _PyThreadState_Current +#endif +#if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) +#include "pythread.h" +#define Py_tss_NEEDS_INIT 0 +typedef int Py_tss_t; +static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) { + *key = PyThread_create_key(); + return 0; // PyThread_create_key reports success always +} +static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) { + Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t)); + *key = Py_tss_NEEDS_INIT; + return key; +} +static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) { + PyObject_Free(key); +} +static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) { + return *key != Py_tss_NEEDS_INIT; +} +static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) { + PyThread_delete_key(*key); + *key = Py_tss_NEEDS_INIT; +} +static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) { + return PyThread_set_key_value(*key, value); +} +static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { + return PyThread_get_key_value(*key); +} +#endif // TSS (Thread Specific Storage) API +#if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized) +#define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) +#else +#define __Pyx_PyDict_NewPresized(n) PyDict_New() +#endif +#if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION + #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) +#else + #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS +#define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) +#else +#define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name) +#endif +#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) + #define CYTHON_PEP393_ENABLED 1 + #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ + 0 : _PyUnicode_Ready((PyObject *)(op))) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) + #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) + #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) + #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) + #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) + #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch) + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) +#else + #define CYTHON_PEP393_ENABLED 0 + #define PyUnicode_1BYTE_KIND 1 + #define PyUnicode_2BYTE_KIND 2 + #define PyUnicode_4BYTE_KIND 4 + #define __Pyx_PyUnicode_READY(op) (0) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) + #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111) + #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) + #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) + #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) + #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch) + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) +#endif +#if CYTHON_COMPILING_IN_PYPY + #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) +#else + #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ + PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains) + #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check) + #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format) + #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) +#endif +#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) +#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) +#else + #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) +#endif +#if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) + #define PyObject_ASCII(o) PyObject_Repr(o) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBaseString_Type PyUnicode_Type + #define PyStringObject PyUnicodeObject + #define PyString_Type PyUnicode_Type + #define PyString_Check PyUnicode_Check + #define PyString_CheckExact PyUnicode_CheckExact + #define PyObject_Unicode PyObject_Str +#endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) + #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) +#else + #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) + #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) +#endif +#ifndef PySet_CheckExact + #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) +#endif +#if CYTHON_ASSUME_SAFE_MACROS + #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) +#else + #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyIntObject PyLongObject + #define PyInt_Type PyLong_Type + #define PyInt_Check(op) PyLong_Check(op) + #define PyInt_CheckExact(op) PyLong_CheckExact(op) + #define PyInt_FromString PyLong_FromString + #define PyInt_FromUnicode PyLong_FromUnicode + #define PyInt_FromLong PyLong_FromLong + #define PyInt_FromSize_t PyLong_FromSize_t + #define PyInt_FromSsize_t PyLong_FromSsize_t + #define PyInt_AsLong PyLong_AsLong + #define PyInt_AS_LONG PyLong_AS_LONG + #define PyInt_AsSsize_t PyLong_AsSsize_t + #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask + #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask + #define PyNumber_Int PyNumber_Long +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBoolObject PyLongObject +#endif +#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY + #ifndef PyUnicode_InternFromString + #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) + #endif +#endif +#if PY_VERSION_HEX < 0x030200A4 + typedef long Py_hash_t; + #define __Pyx_PyInt_FromHash_t PyInt_FromLong + #define __Pyx_PyInt_AsHash_t PyInt_AsLong +#else + #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t + #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t +#endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : (Py_INCREF(func), func)) +#else + #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) +#endif +#if CYTHON_USE_ASYNC_SLOTS + #if PY_VERSION_HEX >= 0x030500B1 + #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods + #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) + #else + #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) + #endif +#else + #define __Pyx_PyType_AsAsync(obj) NULL +#endif +#ifndef __Pyx_PyAsyncMethodsStruct + typedef struct { + unaryfunc am_await; + unaryfunc am_aiter; + unaryfunc am_anext; + } __Pyx_PyAsyncMethodsStruct; +#endif + +#if defined(WIN32) || defined(MS_WINDOWS) + #define _USE_MATH_DEFINES +#endif +#include +#ifdef NAN +#define __PYX_NAN() ((float) NAN) +#else +static CYTHON_INLINE float __PYX_NAN() { + float value; + memset(&value, 0xFF, sizeof(value)); + return value; +} +#endif +#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) +#define __Pyx_truncl trunc +#else +#define __Pyx_truncl truncl +#endif + + +#define __PYX_ERR(f_index, lineno, Ln_error) \ +{ \ + __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \ +} + +#ifndef __PYX_EXTERN_C + #ifdef __cplusplus + #define __PYX_EXTERN_C extern "C" + #else + #define __PYX_EXTERN_C extern + #endif +#endif + +#define __PYX_HAVE__gevent___greenlet +#define __PYX_HAVE_API__gevent___greenlet +/* Early includes */ +#include "greenlet/greenlet.h" +#include "frameobject.h" +#ifdef _OPENMP +#include +#endif /* _OPENMP */ + +#if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) +#define CYTHON_WITHOUT_ASSERTIONS +#endif + +typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; + const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; + +#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 +#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0 +#define __PYX_DEFAULT_STRING_ENCODING "" +#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString +#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#define __Pyx_uchar_cast(c) ((unsigned char)c) +#define __Pyx_long_cast(x) ((long)x) +#define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ + (sizeof(type) < sizeof(Py_ssize_t)) ||\ + (sizeof(type) > sizeof(Py_ssize_t) &&\ + likely(v < (type)PY_SSIZE_T_MAX ||\ + v == (type)PY_SSIZE_T_MAX) &&\ + (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ + v == (type)PY_SSIZE_T_MIN))) ||\ + (sizeof(type) == sizeof(Py_ssize_t) &&\ + (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ + v == (type)PY_SSIZE_T_MAX))) ) +static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) { + return (size_t) i < (size_t) limit; +} +#if defined (__cplusplus) && __cplusplus >= 201103L + #include + #define __Pyx_sst_abs(value) std::abs(value) +#elif SIZEOF_INT >= SIZEOF_SIZE_T + #define __Pyx_sst_abs(value) abs(value) +#elif SIZEOF_LONG >= SIZEOF_SIZE_T + #define __Pyx_sst_abs(value) labs(value) +#elif defined (_MSC_VER) + #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) +#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define __Pyx_sst_abs(value) llabs(value) +#elif defined (__GNUC__) + #define __Pyx_sst_abs(value) __builtin_llabs(value) +#else + #define __Pyx_sst_abs(value) ((value<0) ? -value : value) +#endif +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*); +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); +#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) +#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) +#define __Pyx_PyBytes_FromString PyBytes_FromString +#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); +#if PY_MAJOR_VERSION < 3 + #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#else + #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize +#endif +#define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) +#define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) +#define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) +#define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) +#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) +static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) { + const Py_UNICODE *u_end = u; + while (*u_end++) ; + return (size_t)(u_end - u - 1); +} +#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) +#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode +#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode +#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) +#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) +static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); +static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*); +static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); +#define __Pyx_PySequence_Tuple(obj)\ + (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); +#if CYTHON_ASSUME_SAFE_MACROS +#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) +#else +#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) +#endif +#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) +#if PY_MAJOR_VERSION >= 3 +#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) +#else +#define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) +#endif +#define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x)) +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII +static int __Pyx_sys_getdefaultencoding_not_ascii; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + PyObject* ascii_chars_u = NULL; + PyObject* ascii_chars_b = NULL; + const char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + if (strcmp(default_encoding_c, "ascii") == 0) { + __Pyx_sys_getdefaultencoding_not_ascii = 0; + } else { + char ascii_chars[128]; + int c; + for (c = 0; c < 128; c++) { + ascii_chars[c] = c; + } + __Pyx_sys_getdefaultencoding_not_ascii = 1; + ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); + if (!ascii_chars_u) goto bad; + ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); + if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { + PyErr_Format( + PyExc_ValueError, + "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", + default_encoding_c); + goto bad; + } + Py_DECREF(ascii_chars_u); + Py_DECREF(ascii_chars_b); + } + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + Py_XDECREF(ascii_chars_u); + Py_XDECREF(ascii_chars_b); + return -1; +} +#endif +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) +#else +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +static char* __PYX_DEFAULT_STRING_ENCODING; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1); + if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; + strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + return -1; +} +#endif +#endif + + +/* Test for GCC > 2.95 */ +#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) + #define likely(x) __builtin_expect(!!(x), 1) + #define unlikely(x) __builtin_expect(!!(x), 0) +#else /* !__GNUC__ or GCC < 2.95 */ + #define likely(x) (x) + #define unlikely(x) (x) +#endif /* __GNUC__ */ +static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } + +static PyObject *__pyx_m = NULL; +static PyObject *__pyx_d; +static PyObject *__pyx_b; +static PyObject *__pyx_cython_runtime = NULL; +static PyObject *__pyx_empty_tuple; +static PyObject *__pyx_empty_bytes; +static PyObject *__pyx_empty_unicode; +static int __pyx_lineno; +static int __pyx_clineno = 0; +static const char * __pyx_cfilenm= __FILE__; +static const char *__pyx_filename; + + +static const char *__pyx_f[] = { + "src\\gevent\\greenlet.py", + "src\\gevent\\_greenlet.pxd", + "src\\gevent\\__greenlet_primitives.pxd", + "src\\gevent\\__waiter.pxd", + "stringsource", + "src\\gevent\\__ident.pxd", +}; + +/*--- Type declarations ---*/ +struct __pyx_obj_6gevent_7__ident_ValuedWeakRef; +struct __pyx_obj_6gevent_7__ident_IdentRegistry; +struct __pyx_obj_6gevent_21__greenlet_primitives_TrackedRawGreenlet; +struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop; +struct __pyx_obj_6gevent_8__waiter_Waiter; +struct __pyx_obj_6gevent_8__waiter_MultipleWaiter; +struct __pyx_obj_6gevent_9_greenlet_SpawnedLink; +struct __pyx_obj_6gevent_9_greenlet_SuccessSpawnedLink; +struct __pyx_obj_6gevent_9_greenlet_FailureSpawnedLink; +struct __pyx_obj_6gevent_9_greenlet__Frame; +struct __pyx_obj_6gevent_9_greenlet_Greenlet; +struct __pyx_obj_6gevent_9_greenlet__dummy_event; +struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_object____list____object____object___to_py; +struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_object____list____object___to_py; +struct __pyx_opt_args_6gevent_9_greenlet_8Greenlet_join; +struct __pyx_opt_args_6gevent_9_greenlet_joinall; +struct __pyx_defaults; +typedef struct __pyx_defaults __pyx_defaults; + +/* "gevent/_greenlet.pxd":105 + * + * cpdef bint has_links(self) + * cpdef join(self, timeout=*) # <<<<<<<<<<<<<< + * cpdef bint ready(self) + * cpdef bint successful(self) + */ +struct __pyx_opt_args_6gevent_9_greenlet_8Greenlet_join { + int __pyx_n; + PyObject *timeout; +}; + +/* "gevent/_greenlet.pxd":174 + * + * @cython.locals(done=list) + * cpdef joinall(greenlets, timeout=*, raise_error=*, count=*) # <<<<<<<<<<<<<< + * + * cdef set _spawn_callbacks + */ +struct __pyx_opt_args_6gevent_9_greenlet_joinall { + int __pyx_n; + PyObject *timeout; + PyObject *raise_error; + PyObject *count; +}; +struct __pyx_defaults { + PyObject *__pyx_arg_exception; +}; + +/* "gevent/__ident.pxd":15 + * @cython.internal + * @cython.final + * cdef class ValuedWeakRef(ref): # <<<<<<<<<<<<<< + * cdef object value + * + */ +struct __pyx_obj_6gevent_7__ident_ValuedWeakRef { + PyWeakReference __pyx_base; + PyObject *value; +}; + + +/* "gevent/__ident.pxd":19 + * + * @cython.final + * cdef class IdentRegistry: # <<<<<<<<<<<<<< + * cdef object _registry + * cdef list _available_idents + */ +struct __pyx_obj_6gevent_7__ident_IdentRegistry { + PyObject_HEAD + struct __pyx_vtabstruct_6gevent_7__ident_IdentRegistry *__pyx_vtab; + PyObject *_registry; + PyObject *_available_idents; +}; + + +/* "gevent/__greenlet_primitives.pxd":37 + * return PyGreenlet_Switch(self, NULL, NULL) + * + * cdef class TrackedRawGreenlet(greenlet): # <<<<<<<<<<<<<< + * pass + * + */ +struct __pyx_obj_6gevent_21__greenlet_primitives_TrackedRawGreenlet { + PyGreenlet __pyx_base; +}; + + +/* "gevent/__greenlet_primitives.pxd":40 + * pass + * + * cdef class SwitchOutGreenletWithLoop(TrackedRawGreenlet): # <<<<<<<<<<<<<< + * cdef public loop + * + */ +struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop { + struct __pyx_obj_6gevent_21__greenlet_primitives_TrackedRawGreenlet __pyx_base; + struct __pyx_vtabstruct_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *__pyx_vtab; + PyObject *loop; +}; + + +/* "gevent/__waiter.pxd":33 + * _greenlet_imported = True + * + * cdef class Waiter: # <<<<<<<<<<<<<< + * cdef readonly SwitchOutGreenletWithLoop hub + * cdef readonly greenlet greenlet + */ +struct __pyx_obj_6gevent_8__waiter_Waiter { + PyObject_HEAD + struct __pyx_vtabstruct_6gevent_8__waiter_Waiter *__pyx_vtab; + struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *hub; + PyGreenlet *greenlet; + PyObject *value; + PyObject *_exception; +}; + + +/* "gevent/__waiter.pxd":47 + * @cython.final + * @cython.internal + * cdef class MultipleWaiter(Waiter): # <<<<<<<<<<<<<< + * cdef list _values + */ +struct __pyx_obj_6gevent_8__waiter_MultipleWaiter { + struct __pyx_obj_6gevent_8__waiter_Waiter __pyx_base; + PyObject *_values; +}; + + +/* "gevent/_greenlet.pxd":56 + * cdef void _init() + * + * cdef class SpawnedLink: # <<<<<<<<<<<<<< + * cdef public object callback + * + */ +struct __pyx_obj_6gevent_9_greenlet_SpawnedLink { + PyObject_HEAD + PyObject *callback; +}; + + +/* "gevent/_greenlet.pxd":61 + * + * @cython.final + * cdef class SuccessSpawnedLink(SpawnedLink): # <<<<<<<<<<<<<< + * pass + * + */ +struct __pyx_obj_6gevent_9_greenlet_SuccessSpawnedLink { + struct __pyx_obj_6gevent_9_greenlet_SpawnedLink __pyx_base; +}; + + +/* "gevent/_greenlet.pxd":65 + * + * @cython.final + * cdef class FailureSpawnedLink(SpawnedLink): # <<<<<<<<<<<<<< + * pass + * + */ +struct __pyx_obj_6gevent_9_greenlet_FailureSpawnedLink { + struct __pyx_obj_6gevent_9_greenlet_SpawnedLink __pyx_base; +}; + + +/* "gevent/_greenlet.pxd":71 + * @cython.internal + * @cython.freelist(1000) + * cdef class _Frame: # <<<<<<<<<<<<<< + * cdef readonly CodeType f_code + * cdef readonly int f_lineno + */ +struct __pyx_obj_6gevent_9_greenlet__Frame { + PyObject_HEAD + PyCodeObject *f_code; + int f_lineno; + struct __pyx_obj_6gevent_9_greenlet__Frame *f_back; +}; + + +/* "gevent/_greenlet.pxd":86 + * + * + * cdef class Greenlet(greenlet): # <<<<<<<<<<<<<< + * cdef readonly object value + * cdef readonly tuple args + */ +struct __pyx_obj_6gevent_9_greenlet_Greenlet { + PyGreenlet __pyx_base; + struct __pyx_vtabstruct_6gevent_9_greenlet_Greenlet *__pyx_vtab; + PyObject *value; + PyObject *args; + PyObject *kwargs; + PyObject *spawning_greenlet; + PyObject *spawn_tree_locals; + PyObject *_spawning_stack_frames; + PyObject *_links; + PyObject *_exc_info; + PyObject *_notifier; + PyObject *_start_event; + PyObject *_formatted_info; + PyObject *_ident; +}; + + +/* "gevent/_greenlet.pxd":157 + * @cython.final + * @cython.internal + * cdef class _dummy_event: # <<<<<<<<<<<<<< + * cdef readonly bint pending + * cdef readonly bint active + */ +struct __pyx_obj_6gevent_9_greenlet__dummy_event { + PyObject_HEAD + struct __pyx_vtabstruct_6gevent_9_greenlet__dummy_event *__pyx_vtab; + int pending; + int active; +}; + + +/* "cfunc.to_py":64 + * + * @cname("__Pyx_CFunc_object____list____object____object___to_py") + * cdef object __Pyx_CFunc_object____list____object____object___to_py(object (*f)(list, object, object) ): # <<<<<<<<<<<<<< + * def wrap(list greenlets, object exception, object waiter): + * """wrap(greenlets: list, exception, waiter)""" + */ +struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_object____list____object____object___to_py { + PyObject_HEAD + PyObject *(*__pyx_v_f)(PyObject *, PyObject *, PyObject *); +}; + +struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_object____list____object___to_py { + PyObject_HEAD + PyObject *(*__pyx_v_f)(PyObject *, PyObject *); +}; + + + +/* "gevent/__ident.pxd":19 + * + * @cython.final + * cdef class IdentRegistry: # <<<<<<<<<<<<<< + * cdef object _registry + * cdef list _available_idents + */ + +struct __pyx_vtabstruct_6gevent_7__ident_IdentRegistry { + PyObject *(*get_ident)(struct __pyx_obj_6gevent_7__ident_IdentRegistry *, PyObject *, int __pyx_skip_dispatch); + PyObject *(*_return_ident)(struct __pyx_obj_6gevent_7__ident_IdentRegistry *, struct __pyx_obj_6gevent_7__ident_ValuedWeakRef *, int __pyx_skip_dispatch); +}; +static struct __pyx_vtabstruct_6gevent_7__ident_IdentRegistry *__pyx_vtabptr_6gevent_7__ident_IdentRegistry; + + +/* "gevent/__greenlet_primitives.pxd":40 + * pass + * + * cdef class SwitchOutGreenletWithLoop(TrackedRawGreenlet): # <<<<<<<<<<<<<< + * cdef public loop + * + */ + +struct __pyx_vtabstruct_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop { + PyObject *(*__pyx_switch)(struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *, int __pyx_skip_dispatch); + PyObject *(*switch_out)(struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *, int __pyx_skip_dispatch); +}; +static struct __pyx_vtabstruct_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *__pyx_vtabptr_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop; + + +/* "gevent/__waiter.pxd":33 + * _greenlet_imported = True + * + * cdef class Waiter: # <<<<<<<<<<<<<< + * cdef readonly SwitchOutGreenletWithLoop hub + * cdef readonly greenlet greenlet + */ + +struct __pyx_vtabstruct_6gevent_8__waiter_Waiter { + PyObject *(*get)(struct __pyx_obj_6gevent_8__waiter_Waiter *, int __pyx_skip_dispatch); + PyObject *(*clear)(struct __pyx_obj_6gevent_8__waiter_Waiter *, int __pyx_skip_dispatch); +}; +static struct __pyx_vtabstruct_6gevent_8__waiter_Waiter *__pyx_vtabptr_6gevent_8__waiter_Waiter; + + +/* "gevent/__waiter.pxd":47 + * @cython.final + * @cython.internal + * cdef class MultipleWaiter(Waiter): # <<<<<<<<<<<<<< + * cdef list _values + */ + +struct __pyx_vtabstruct_6gevent_8__waiter_MultipleWaiter { + struct __pyx_vtabstruct_6gevent_8__waiter_Waiter __pyx_base; +}; +static struct __pyx_vtabstruct_6gevent_8__waiter_MultipleWaiter *__pyx_vtabptr_6gevent_8__waiter_MultipleWaiter; + + +/* "src/gevent/greenlet.py":157 + * _greenlet__init__ = greenlet.__init__ + * + * class Greenlet(greenlet): # <<<<<<<<<<<<<< + * """ + * A light-weight cooperatively-scheduled execution unit. + */ + +struct __pyx_vtabstruct_6gevent_9_greenlet_Greenlet { + int (*has_links)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *, int __pyx_skip_dispatch); + PyObject *(*join)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_9_greenlet_8Greenlet_join *__pyx_optional_args); + int (*ready)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *, int __pyx_skip_dispatch); + int (*successful)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *, int __pyx_skip_dispatch); + PyObject *(*rawlink)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *, PyObject *, int __pyx_skip_dispatch); + PyObject *(*_formatinfo)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *, int __pyx_skip_dispatch); + PyObject *(*_get_minimal_ident)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *); + int (*__pyx___started_but_aborted)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *); + int (*__pyx___start_cancelled_by_kill)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *); + int (*__pyx___start_pending)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *); + int (*__pyx___never_started_or_killed)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *); + int (*__pyx___start_completed)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *); + PyObject *(*__pyx___handle_death_before_start)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *, PyObject *); + PyObject *(*__pyx___cancel_start)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *); + PyObject *(*_report_result)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *, PyObject *); + PyObject *(*_report_error)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *, PyObject *); + PyObject *(*_notify_links)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *, int __pyx_skip_dispatch); +}; +static struct __pyx_vtabstruct_6gevent_9_greenlet_Greenlet *__pyx_vtabptr_6gevent_9_greenlet_Greenlet; + + +/* "src/gevent/greenlet.py":870 + * + * + * class _dummy_event(object): # <<<<<<<<<<<<<< + * __slots__ = ('pending', 'active') + * + */ + +struct __pyx_vtabstruct_6gevent_9_greenlet__dummy_event { + PyObject *(*stop)(struct __pyx_obj_6gevent_9_greenlet__dummy_event *, int __pyx_skip_dispatch); + PyObject *(*start)(struct __pyx_obj_6gevent_9_greenlet__dummy_event *, PyObject *, int __pyx_skip_dispatch); + PyObject *(*close)(struct __pyx_obj_6gevent_9_greenlet__dummy_event *, int __pyx_skip_dispatch); +}; +static struct __pyx_vtabstruct_6gevent_9_greenlet__dummy_event *__pyx_vtabptr_6gevent_9_greenlet__dummy_event; +static PyObject *__pyx_f_6gevent_9_greenlet_12_dummy_event_stop(struct __pyx_obj_6gevent_9_greenlet__dummy_event *, int __pyx_skip_dispatch); +static PyObject *__pyx_f_6gevent_9_greenlet_12_dummy_event_start(struct __pyx_obj_6gevent_9_greenlet__dummy_event *, PyObject *, int __pyx_skip_dispatch); +static PyObject *__pyx_f_6gevent_9_greenlet_12_dummy_event_close(struct __pyx_obj_6gevent_9_greenlet__dummy_event *, int __pyx_skip_dispatch); + +/* --- Runtime support code (head) --- */ +/* Refnanny.proto */ +#ifndef CYTHON_REFNANNY + #define CYTHON_REFNANNY 0 +#endif +#if CYTHON_REFNANNY + typedef struct { + void (*INCREF)(void*, PyObject*, int); + void (*DECREF)(void*, PyObject*, int); + void (*GOTREF)(void*, PyObject*, int); + void (*GIVEREF)(void*, PyObject*, int); + void* (*SetupContext)(const char*, int, const char*); + void (*FinishContext)(void**); + } __Pyx_RefNannyAPIStruct; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); + #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; +#ifdef WITH_THREAD + #define __Pyx_RefNannySetupContext(name, acquire_gil)\ + if (acquire_gil) {\ + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ + PyGILState_Release(__pyx_gilstate_save);\ + } else {\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ + } +#else + #define __Pyx_RefNannySetupContext(name, acquire_gil)\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) +#endif + #define __Pyx_RefNannyFinishContext()\ + __Pyx_RefNanny->FinishContext(&__pyx_refnanny) + #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0) + #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) + #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) + #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) +#else + #define __Pyx_RefNannyDeclarations + #define __Pyx_RefNannySetupContext(name, acquire_gil) + #define __Pyx_RefNannyFinishContext() + #define __Pyx_INCREF(r) Py_INCREF(r) + #define __Pyx_DECREF(r) Py_DECREF(r) + #define __Pyx_GOTREF(r) + #define __Pyx_GIVEREF(r) + #define __Pyx_XINCREF(r) Py_XINCREF(r) + #define __Pyx_XDECREF(r) Py_XDECREF(r) + #define __Pyx_XGOTREF(r) + #define __Pyx_XGIVEREF(r) +#endif +#define __Pyx_XDECREF_SET(r, v) do {\ + PyObject *tmp = (PyObject *) r;\ + r = v; __Pyx_XDECREF(tmp);\ + } while (0) +#define __Pyx_DECREF_SET(r, v) do {\ + PyObject *tmp = (PyObject *) r;\ + r = v; __Pyx_DECREF(tmp);\ + } while (0) +#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) +#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) + +/* PyObjectGetAttrStr.proto */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); +#else +#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) +#endif + +/* GetBuiltinName.proto */ +static PyObject *__Pyx_GetBuiltinName(PyObject *name); + +/* RaiseDoubleKeywords.proto */ +static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); + +/* ParseKeywords.proto */ +static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\ + PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\ + const char* function_name); + +/* RaiseArgTupleInvalid.proto */ +static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, + Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); + +/* CallableCheck.proto */ +#if CYTHON_USE_TYPE_SLOTS && PY_MAJOR_VERSION >= 3 +#define __Pyx_PyCallable_Check(obj) ((obj)->ob_type->tp_call != NULL) +#else +#define __Pyx_PyCallable_Check(obj) PyCallable_Check(obj) +#endif + +/* PyCFunctionFastCall.proto */ +#if CYTHON_FAST_PYCCALL +static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs); +#else +#define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL) +#endif + +/* PyFunctionFastCall.proto */ +#if CYTHON_FAST_PYCALL +#define __Pyx_PyFunction_FastCall(func, args, nargs)\ + __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) +#if 1 || PY_VERSION_HEX < 0x030600B1 +static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs); +#else +#define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs) +#endif +#define __Pyx_BUILD_ASSERT_EXPR(cond)\ + (sizeof(char [1 - 2*!(cond)]) - 1) +#ifndef Py_MEMBER_SIZE +#define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member) +#endif + static size_t __pyx_pyframe_localsplus_offset = 0; + #include "frameobject.h" + #define __Pxy_PyFrame_Initialize_Offsets()\ + ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\ + (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus))) + #define __Pyx_PyFrame_GetLocalsplus(frame)\ + (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset)) +#endif + +/* PyObjectCall.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); +#else +#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) +#endif + +/* PyObjectCallMethO.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); +#endif + +/* PyObjectCallOneArg.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); + +/* PyThreadStateGet.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; +#define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; +#define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type +#else +#define __Pyx_PyThreadState_declare +#define __Pyx_PyThreadState_assign +#define __Pyx_PyErr_Occurred() PyErr_Occurred() +#endif + +/* PyErrFetchRestore.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) +#define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) +#define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) +#define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) +#define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); +static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) +#else +#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) +#endif +#else +#define __Pyx_PyErr_Clear() PyErr_Clear() +#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) +#define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) +#define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb) +#define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) +#endif + +/* RaiseException.proto */ +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); + +/* PyObjectCall2Args.proto */ +static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2); + +/* PyErrExceptionMatches.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) +static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); +#else +#define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) +#endif + +/* GetAttr.proto */ +static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *); + +/* GetAttr3.proto */ +static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *); + +/* IncludeStringH.proto */ +#include + +/* BytesEquals.proto */ +static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); + +/* UnicodeEquals.proto */ +static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); + +/* StrEquals.proto */ +#if PY_MAJOR_VERSION >= 3 +#define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals +#else +#define __Pyx_PyString_Equals __Pyx_PyBytes_Equals +#endif + +/* PyObjectCallNoArg.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); +#else +#define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL) +#endif + +/* ExtTypeTest.proto */ +static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); + +/* GetItemInt.proto */ +#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ + __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\ + (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\ + __Pyx_GetItemInt_Generic(o, to_py_func(i)))) +#define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ + __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ + (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL)) +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, + int wraparound, int boundscheck); +#define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ + __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ + (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL)) +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, + int wraparound, int boundscheck); +static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j); +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, + int is_list, int wraparound, int boundscheck); + +/* GetTopmostException.proto */ +#if CYTHON_USE_EXC_INFO_STACK +static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate); +#endif + +/* SaveResetException.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); +#else +#define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb) +#define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb) +#endif + +/* GetException.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb) +static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#else +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); +#endif + +/* ListAppend.proto */ +#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS +static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) { + PyListObject* L = (PyListObject*) list; + Py_ssize_t len = Py_SIZE(list); + if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) { + Py_INCREF(x); + PyList_SET_ITEM(list, len, x); + Py_SIZE(list) = len+1; + return 0; + } + return PyList_Append(list, x); +} +#else +#define __Pyx_PyList_Append(L,x) PyList_Append(L,x) +#endif + +/* PyObjectSetAttrStr.proto */ +#if CYTHON_USE_TYPE_SLOTS +#define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o, n, NULL) +static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value); +#else +#define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n) +#define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v) +#endif + +/* ListExtend.proto */ +static CYTHON_INLINE int __Pyx_PyList_Extend(PyObject* L, PyObject* v) { +#if CYTHON_COMPILING_IN_CPYTHON + PyObject* none = _PyList_Extend((PyListObject*)L, v); + if (unlikely(!none)) + return -1; + Py_DECREF(none); + return 0; +#else + return PyList_SetSlice(L, PY_SSIZE_T_MAX, PY_SSIZE_T_MAX, v); +#endif +} + +/* WriteUnraisableException.proto */ +static void __Pyx_WriteUnraisable(const char *name, int clineno, + int lineno, const char *filename, + int full_traceback, int nogil); + +/* PySequenceContains.proto */ +static CYTHON_INLINE int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* seq, int eq) { + int result = PySequence_Contains(seq, item); + return unlikely(result < 0) ? result : (result == (eq == Py_EQ)); +} + +/* ListCompAppend.proto */ +#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS +static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) { + PyListObject* L = (PyListObject*) list; + Py_ssize_t len = Py_SIZE(list); + if (likely(L->allocated > len)) { + Py_INCREF(x); + PyList_SET_ITEM(list, len, x); + Py_SIZE(list) = len+1; + return 0; + } + return PyList_Append(list, x); +} +#else +#define __Pyx_ListComp_Append(L,x) PyList_Append(L,x) +#endif + +/* IterFinish.proto */ +static CYTHON_INLINE int __Pyx_IterFinish(void); + +/* PyObjectGetMethod.proto */ +static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method); + +/* PyObjectCallMethod0.proto */ +static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name); + +/* RaiseNeedMoreValuesToUnpack.proto */ +static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); + +/* RaiseTooManyValuesToUnpack.proto */ +static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); + +/* UnpackItemEndCheck.proto */ +static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); + +/* RaiseNoneIterError.proto */ +static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void); + +/* UnpackTupleError.proto */ +static void __Pyx_UnpackTupleError(PyObject *, Py_ssize_t index); + +/* UnpackTuple2.proto */ +#define __Pyx_unpack_tuple2(tuple, value1, value2, is_tuple, has_known_size, decref_tuple)\ + (likely(is_tuple || PyTuple_Check(tuple)) ?\ + (likely(has_known_size || PyTuple_GET_SIZE(tuple) == 2) ?\ + __Pyx_unpack_tuple2_exact(tuple, value1, value2, decref_tuple) :\ + (__Pyx_UnpackTupleError(tuple, 2), -1)) :\ + __Pyx_unpack_tuple2_generic(tuple, value1, value2, has_known_size, decref_tuple)) +static CYTHON_INLINE int __Pyx_unpack_tuple2_exact( + PyObject* tuple, PyObject** value1, PyObject** value2, int decref_tuple); +static int __Pyx_unpack_tuple2_generic( + PyObject* tuple, PyObject** value1, PyObject** value2, int has_known_size, int decref_tuple); + +/* dict_iter.proto */ +static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* dict, int is_dict, PyObject* method_name, + Py_ssize_t* p_orig_length, int* p_is_dict); +static CYTHON_INLINE int __Pyx_dict_iter_next(PyObject* dict_or_iter, Py_ssize_t orig_length, Py_ssize_t* ppos, + PyObject** pkey, PyObject** pvalue, PyObject** pitem, int is_dict); + +/* StringJoin.proto */ +#if PY_MAJOR_VERSION < 3 +#define __Pyx_PyString_Join __Pyx_PyBytes_Join +#define __Pyx_PyBaseString_Join(s, v) (PyUnicode_CheckExact(s) ? PyUnicode_Join(s, v) : __Pyx_PyBytes_Join(s, v)) +#else +#define __Pyx_PyString_Join PyUnicode_Join +#define __Pyx_PyBaseString_Join PyUnicode_Join +#endif +#if CYTHON_COMPILING_IN_CPYTHON + #if PY_MAJOR_VERSION < 3 + #define __Pyx_PyBytes_Join _PyString_Join + #else + #define __Pyx_PyBytes_Join _PyBytes_Join + #endif +#else +static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values); +#endif + +/* KeywordStringCheck.proto */ +static int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* function_name, int kw_allowed); + +/* SwapException.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#else +static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb); +#endif + +/* pyfrozenset_new.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyFrozenSet_New(PyObject* it); + +/* py_set_discard.proto */ +static CYTHON_INLINE int __Pyx_PySet_Discard(PyObject *set, PyObject *key); + +/* PyDictContains.proto */ +static CYTHON_INLINE int __Pyx_PyDict_ContainsTF(PyObject* item, PyObject* dict, int eq) { + int result = PyDict_Contains(dict, item); + return unlikely(result < 0) ? result : (result == (eq == Py_EQ)); +} + +/* GetModuleGlobalName.proto */ +#if CYTHON_USE_DICT_VERSIONS +#define __Pyx_GetModuleGlobalName(var, name) {\ + static PY_UINT64_T __pyx_dict_version = 0;\ + static PyObject *__pyx_dict_cached_value = NULL;\ + (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\ + (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\ + __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ +} +#define __Pyx_GetModuleGlobalNameUncached(var, name) {\ + PY_UINT64_T __pyx_dict_version;\ + PyObject *__pyx_dict_cached_value;\ + (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ +} +static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value); +#else +#define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name) +#define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name) +static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name); +#endif + +/* None.proto */ +static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname); + +/* py_dict_clear.proto */ +#define __Pyx_PyDict_Clear(d) (PyDict_Clear(d), 0) + +/* SliceObject.proto */ +#define __Pyx_PyObject_DelSlice(obj, cstart, cstop, py_start, py_stop, py_slice, has_cstart, has_cstop, wraparound)\ + __Pyx_PyObject_SetSlice(obj, (PyObject*)NULL, cstart, cstop, py_start, py_stop, py_slice, has_cstart, has_cstop, wraparound) +static CYTHON_INLINE int __Pyx_PyObject_SetSlice( + PyObject* obj, PyObject* value, Py_ssize_t cstart, Py_ssize_t cstop, + PyObject** py_start, PyObject** py_stop, PyObject** py_slice, + int has_cstart, int has_cstop, int wraparound); + +/* PyObjectCallMethod1.proto */ +static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg); + +/* pop_index.proto */ +static PyObject* __Pyx__PyObject_PopNewIndex(PyObject* L, PyObject* py_ix); +static PyObject* __Pyx__PyObject_PopIndex(PyObject* L, PyObject* py_ix); +#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS +static PyObject* __Pyx__PyList_PopIndex(PyObject* L, PyObject* py_ix, Py_ssize_t ix); +#define __Pyx_PyObject_PopIndex(L, py_ix, ix, is_signed, type, to_py_func) (\ + (likely(PyList_CheckExact(L) && __Pyx_fits_Py_ssize_t(ix, type, is_signed))) ?\ + __Pyx__PyList_PopIndex(L, py_ix, ix) : (\ + (unlikely(py_ix == Py_None)) ? __Pyx__PyObject_PopNewIndex(L, to_py_func(ix)) :\ + __Pyx__PyObject_PopIndex(L, py_ix))) +#define __Pyx_PyList_PopIndex(L, py_ix, ix, is_signed, type, to_py_func) (\ + __Pyx_fits_Py_ssize_t(ix, type, is_signed) ?\ + __Pyx__PyList_PopIndex(L, py_ix, ix) : (\ + (unlikely(py_ix == Py_None)) ? __Pyx__PyObject_PopNewIndex(L, to_py_func(ix)) :\ + __Pyx__PyObject_PopIndex(L, py_ix))) +#else +#define __Pyx_PyList_PopIndex(L, py_ix, ix, is_signed, type, to_py_func)\ + __Pyx_PyObject_PopIndex(L, py_ix, ix, is_signed, type, to_py_func) +#define __Pyx_PyObject_PopIndex(L, py_ix, ix, is_signed, type, to_py_func) (\ + (unlikely(py_ix == Py_None)) ? __Pyx__PyObject_PopNewIndex(L, to_py_func(ix)) :\ + __Pyx__PyObject_PopIndex(L, py_ix)) +#endif + +/* HasAttr.proto */ +static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *); + +/* set_iter.proto */ +static CYTHON_INLINE PyObject* __Pyx_set_iterator(PyObject* iterable, int is_set, + Py_ssize_t* p_orig_length, int* p_source_is_set); +static CYTHON_INLINE int __Pyx_set_iter_next( + PyObject* iter_obj, Py_ssize_t orig_length, + Py_ssize_t* ppos, PyObject **value, + int source_is_set); + +/* ArgTypeTest.proto */ +#define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\ + ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\ + __Pyx__ArgTypeTest(obj, type, name, exact)) +static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact); + +/* FetchCommonType.proto */ +static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); + +/* CythonFunction.proto */ +#define __Pyx_CyFunction_USED 1 +#define __Pyx_CYFUNCTION_STATICMETHOD 0x01 +#define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 +#define __Pyx_CYFUNCTION_CCLASS 0x04 +#define __Pyx_CyFunction_GetClosure(f)\ + (((__pyx_CyFunctionObject *) (f))->func_closure) +#define __Pyx_CyFunction_GetClassObj(f)\ + (((__pyx_CyFunctionObject *) (f))->func_classobj) +#define __Pyx_CyFunction_Defaults(type, f)\ + ((type *)(((__pyx_CyFunctionObject *) (f))->defaults)) +#define __Pyx_CyFunction_SetDefaultsGetter(f, g)\ + ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g) +typedef struct { + PyCFunctionObject func; +#if PY_VERSION_HEX < 0x030500A0 + PyObject *func_weakreflist; +#endif + PyObject *func_dict; + PyObject *func_name; + PyObject *func_qualname; + PyObject *func_doc; + PyObject *func_globals; + PyObject *func_code; + PyObject *func_closure; + PyObject *func_classobj; + void *defaults; + int defaults_pyobjects; + int flags; + PyObject *defaults_tuple; + PyObject *defaults_kwdict; + PyObject *(*defaults_getter)(PyObject *); + PyObject *func_annotations; +} __pyx_CyFunctionObject; +static PyTypeObject *__pyx_CyFunctionType = 0; +#define __Pyx_CyFunction_Check(obj) (__Pyx_TypeCheck(obj, __pyx_CyFunctionType)) +#define __Pyx_CyFunction_NewEx(ml, flags, qualname, self, module, globals, code)\ + __Pyx_CyFunction_New(__pyx_CyFunctionType, ml, flags, qualname, self, module, globals, code) +static PyObject *__Pyx_CyFunction_New(PyTypeObject *, PyMethodDef *ml, + int flags, PyObject* qualname, + PyObject *self, + PyObject *module, PyObject *globals, + PyObject* code); +static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, + size_t size, + int pyobjects); +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, + PyObject *tuple); +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, + PyObject *dict); +static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m, + PyObject *dict); +static int __pyx_CyFunction_init(void); + +/* PyObject_GenericGetAttrNoDict.proto */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name); +#else +#define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr +#endif + +/* PyObject_GenericGetAttr.proto */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name); +#else +#define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr +#endif + +/* CallNextTpDealloc.proto */ +static void __Pyx_call_next_tp_dealloc(PyObject* obj, destructor current_tp_dealloc); + +/* CallNextTpTraverse.proto */ +static int __Pyx_call_next_tp_traverse(PyObject* obj, visitproc v, void *a, traverseproc current_tp_traverse); + +/* CallNextTpClear.proto */ +static void __Pyx_call_next_tp_clear(PyObject* obj, inquiry current_tp_dealloc); + +/* TypeImport.proto */ +#ifndef __PYX_HAVE_RT_ImportType_proto +#define __PYX_HAVE_RT_ImportType_proto +enum __Pyx_ImportType_CheckSize { + __Pyx_ImportType_CheckSize_Error = 0, + __Pyx_ImportType_CheckSize_Warn = 1, + __Pyx_ImportType_CheckSize_Ignore = 2 +}; +static PyTypeObject *__Pyx_ImportType(PyObject* module, const char *module_name, const char *class_name, size_t size, enum __Pyx_ImportType_CheckSize check_size); +#endif + +/* SetVTable.proto */ +static int __Pyx_SetVtable(PyObject *dict, void *vtable); + +/* GetVTable.proto */ +static void* __Pyx_GetVtable(PyObject *dict); + +/* Import.proto */ +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); + +/* ImportFrom.proto */ +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); + +/* GetNameInClass.proto */ +#define __Pyx_GetNameInClass(var, nmspace, name) (var) = __Pyx__GetNameInClass(nmspace, name) +static PyObject *__Pyx__GetNameInClass(PyObject *nmspace, PyObject *name); + +/* ClassMethod.proto */ +#include "descrobject.h" +static PyObject* __Pyx_Method_ClassMethod(PyObject *method); + +/* Globals.proto */ +static PyObject* __Pyx_Globals(void); + +/* CLineInTraceback.proto */ +#ifdef CYTHON_CLINE_IN_TRACEBACK +#define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) +#else +static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line); +#endif + +/* CodeObjectCache.proto */ +typedef struct { + PyCodeObject* code_object; + int code_line; +} __Pyx_CodeObjectCacheEntry; +struct __Pyx_CodeObjectCache { + int count; + int max_count; + __Pyx_CodeObjectCacheEntry* entries; +}; +static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); +static PyCodeObject *__pyx_find_code_object(int code_line); +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); + +/* AddTraceback.proto */ +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename); + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); + +/* CIntFromPy.proto */ +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); + +/* CIntFromPy.proto */ +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); + +/* FastTypeChecks.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) +static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b); +static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type); +static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2); +#else +#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) +#define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) +#define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) +#endif +#define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) + +/* CheckBinaryVersion.proto */ +static int __Pyx_check_binary_version(void); + +/* VoidPtrExport.proto */ +static int __Pyx_ExportVoidPtr(PyObject *name, void *p, const char *sig); + +/* FunctionExport.proto */ +static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig); + +/* VoidPtrImport.proto */ +static int __Pyx_ImportVoidPtr(PyObject *module, const char *name, void **p, const char *sig); + +/* FunctionImport.proto */ +static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig); + +/* InitStrings.proto */ +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); + +static PyObject *__pyx_f_6gevent_9_greenlet_8Greenlet__get_minimal_ident(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self); /* proto*/ +static int __pyx_f_6gevent_9_greenlet_8Greenlet___never_started_or_killed(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self); /* proto*/ +static int __pyx_f_6gevent_9_greenlet_8Greenlet___start_pending(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self); /* proto*/ +static int __pyx_f_6gevent_9_greenlet_8Greenlet___start_cancelled_by_kill(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self); /* proto*/ +static int __pyx_f_6gevent_9_greenlet_8Greenlet___start_completed(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self); /* proto*/ +static int __pyx_f_6gevent_9_greenlet_8Greenlet___started_but_aborted(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self); /* proto*/ +static PyObject *__pyx_f_6gevent_9_greenlet_8Greenlet___cancel_start(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self); /* proto*/ +static PyObject *__pyx_f_6gevent_9_greenlet_8Greenlet___handle_death_before_start(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self, PyObject *__pyx_v_args); /* proto*/ +static int __pyx_f_6gevent_9_greenlet_8Greenlet_ready(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/ +static int __pyx_f_6gevent_9_greenlet_8Greenlet_successful(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/ +static PyObject *__pyx_f_6gevent_9_greenlet_8Greenlet__formatinfo(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/ +static PyObject *__pyx_f_6gevent_9_greenlet_8Greenlet_join(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_9_greenlet_8Greenlet_join *__pyx_optional_args); /* proto*/ +static PyObject *__pyx_f_6gevent_9_greenlet_8Greenlet__report_result(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self, PyObject *__pyx_v_result); /* proto*/ +static PyObject *__pyx_f_6gevent_9_greenlet_8Greenlet__report_error(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self, PyObject *__pyx_v_exc_info); /* proto*/ +static int __pyx_f_6gevent_9_greenlet_8Greenlet_has_links(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/ +static PyObject *__pyx_f_6gevent_9_greenlet_8Greenlet_rawlink(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self, PyObject *__pyx_v_callback, int __pyx_skip_dispatch); /* proto*/ +static PyObject *__pyx_f_6gevent_9_greenlet_8Greenlet__notify_links(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/ +static PyObject *__pyx_f_6gevent_9_greenlet_12_dummy_event_stop(CYTHON_UNUSED struct __pyx_obj_6gevent_9_greenlet__dummy_event *__pyx_v_self, CYTHON_UNUSED int __pyx_skip_dispatch); /* proto*/ +static PyObject *__pyx_f_6gevent_9_greenlet_12_dummy_event_start(CYTHON_UNUSED struct __pyx_obj_6gevent_9_greenlet__dummy_event *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_cb, CYTHON_UNUSED int __pyx_skip_dispatch); /* proto*/ +static PyObject *__pyx_f_6gevent_9_greenlet_12_dummy_event_close(CYTHON_UNUSED struct __pyx_obj_6gevent_9_greenlet__dummy_event *__pyx_v_self, CYTHON_UNUSED int __pyx_skip_dispatch); /* proto*/ + +/* Module declarations from 'cython' */ + +/* Module declarations from 'weakref' */ + +/* Module declarations from 'gevent.__ident' */ +static PyTypeObject *__pyx_ptype_6gevent_7__ident_ref = 0; +static PyTypeObject *__pyx_ptype_6gevent_7__ident_ValuedWeakRef = 0; +static PyTypeObject *__pyx_ptype_6gevent_7__ident_IdentRegistry = 0; +static PyObject **__pyx_vp_6gevent_7__ident_heappop = 0; +#define __pyx_v_6gevent_7__ident_heappop (*__pyx_vp_6gevent_7__ident_heappop) +static PyObject **__pyx_vp_6gevent_7__ident_heappush = 0; +#define __pyx_v_6gevent_7__ident_heappush (*__pyx_vp_6gevent_7__ident_heappush) +static PyObject **__pyx_vp_6gevent_7__ident_WeakKeyDictionary = 0; +#define __pyx_v_6gevent_7__ident_WeakKeyDictionary (*__pyx_vp_6gevent_7__ident_WeakKeyDictionary) + +/* Module declarations from 'greenlet' */ + +/* Module declarations from 'gevent.__greenlet_primitives' */ +static PyTypeObject *__pyx_ptype_6gevent_21__greenlet_primitives_greenlet = 0; +static PyTypeObject *__pyx_ptype_6gevent_21__greenlet_primitives_TrackedRawGreenlet = 0; +static PyTypeObject *__pyx_ptype_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop = 0; +static PyObject **__pyx_vp_6gevent_21__greenlet_primitives_get_objects = 0; +#define __pyx_v_6gevent_21__greenlet_primitives_get_objects (*__pyx_vp_6gevent_21__greenlet_primitives_get_objects) +static PyObject **__pyx_vp_6gevent_21__greenlet_primitives_wref = 0; +#define __pyx_v_6gevent_21__greenlet_primitives_wref (*__pyx_vp_6gevent_21__greenlet_primitives_wref) +static PyObject **__pyx_vp_6gevent_21__greenlet_primitives_BlockingSwitchOutError = 0; +#define __pyx_v_6gevent_21__greenlet_primitives_BlockingSwitchOutError (*__pyx_vp_6gevent_21__greenlet_primitives_BlockingSwitchOutError) +static int *__pyx_vp_6gevent_21__greenlet_primitives__greenlet_imported = 0; +#define __pyx_v_6gevent_21__greenlet_primitives__greenlet_imported (*__pyx_vp_6gevent_21__greenlet_primitives__greenlet_imported) + +/* Module declarations from 'gevent.__hub_local' */ +static PyObject **__pyx_vp_6gevent_11__hub_local__threadlocal = 0; +#define __pyx_v_6gevent_11__hub_local__threadlocal (*__pyx_vp_6gevent_11__hub_local__threadlocal) +static struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *(*__pyx_f_6gevent_11__hub_local_get_hub_noargs)(int __pyx_skip_dispatch); /*proto*/ + +/* Module declarations from 'gevent.__waiter' */ +static PyTypeObject *__pyx_ptype_6gevent_8__waiter_greenlet = 0; +static PyTypeObject *__pyx_ptype_6gevent_8__waiter_Waiter = 0; +static PyTypeObject *__pyx_ptype_6gevent_8__waiter_MultipleWaiter = 0; +static PyObject **__pyx_vp_6gevent_8__waiter_sys = 0; +#define __pyx_v_6gevent_8__waiter_sys (*__pyx_vp_6gevent_8__waiter_sys) +static PyObject **__pyx_vp_6gevent_8__waiter_ConcurrentObjectUseError = 0; +#define __pyx_v_6gevent_8__waiter_ConcurrentObjectUseError (*__pyx_vp_6gevent_8__waiter_ConcurrentObjectUseError) +static int *__pyx_vp_6gevent_8__waiter__greenlet_imported = 0; +#define __pyx_v_6gevent_8__waiter__greenlet_imported (*__pyx_vp_6gevent_8__waiter__greenlet_imported) +static PyObject **__pyx_vp_6gevent_8__waiter__NONE = 0; +#define __pyx_v_6gevent_8__waiter__NONE (*__pyx_vp_6gevent_8__waiter__NONE) + +/* Module declarations from 'types' */ + +/* Module declarations from 'gevent._greenlet' */ +static PyTypeObject *__pyx_ptype_6gevent_9_greenlet_greenlet = 0; +static PyTypeObject *__pyx_ptype_6gevent_9_greenlet_CodeType = 0; +static PyTypeObject *__pyx_ptype_6gevent_9_greenlet_FrameType = 0; +static PyTypeObject *__pyx_ptype_6gevent_9_greenlet_SpawnedLink = 0; +static PyTypeObject *__pyx_ptype_6gevent_9_greenlet_SuccessSpawnedLink = 0; +static PyTypeObject *__pyx_ptype_6gevent_9_greenlet_FailureSpawnedLink = 0; +static PyTypeObject *__pyx_ptype_6gevent_9_greenlet__Frame = 0; +static PyTypeObject *__pyx_ptype_6gevent_9_greenlet_Greenlet = 0; +static PyTypeObject *__pyx_ptype_6gevent_9_greenlet__dummy_event = 0; +static PyTypeObject *__pyx_ptype___pyx_scope_struct____Pyx_CFunc_object____list____object____object___to_py = 0; +static PyTypeObject *__pyx_ptype___pyx_scope_struct____Pyx_CFunc_object____list____object___to_py = 0; +static int __pyx_v_6gevent_9_greenlet__PYPY; +static PyObject *__pyx_v_6gevent_9_greenlet_sys_getframe = 0; +static PyObject *__pyx_v_6gevent_9_greenlet_sys_exc_info = 0; +static PyObject *__pyx_v_6gevent_9_greenlet_Timeout = 0; +static PyObject *__pyx_v_6gevent_9_greenlet_GreenletExit = 0; +static PyObject *__pyx_v_6gevent_9_greenlet_InvalidSwitchError = 0; +static int __pyx_v_6gevent_9_greenlet__greenlet_imported; +static PyObject *__pyx_v_6gevent_9_greenlet__greenlet__init__ = 0; +static PyObject *__pyx_v_6gevent_9_greenlet__threadlocal = 0; +static PyObject *__pyx_v_6gevent_9_greenlet_get_hub_class = 0; +static PyObject *__pyx_v_6gevent_9_greenlet_wref = 0; +static PyObject *__pyx_v_6gevent_9_greenlet_dump_traceback = 0; +static PyObject *__pyx_v_6gevent_9_greenlet_load_traceback = 0; +static PyObject *__pyx_v_6gevent_9_greenlet_wait = 0; +static PyObject *__pyx_v_6gevent_9_greenlet_iwait = 0; +static PyObject *__pyx_v_6gevent_9_greenlet_reraise = 0; +static PyObject *__pyx_v_6gevent_9_greenlet_GEVENT_CONFIG = 0; +static struct __pyx_obj_6gevent_9_greenlet__dummy_event *__pyx_v_6gevent_9_greenlet__cancelled_start_event = 0; +static struct __pyx_obj_6gevent_9_greenlet__dummy_event *__pyx_v_6gevent_9_greenlet__start_completed_event = 0; +static PyObject *__pyx_v_6gevent_9_greenlet__spawn_callbacks = 0; +static CYTHON_INLINE PyGreenlet *__pyx_f_6gevent_9_greenlet_getcurrent(void); /*proto*/ +static CYTHON_INLINE void __pyx_f_6gevent_9_greenlet_greenlet_init(void); /*proto*/ +static void __pyx_f_6gevent_9_greenlet__init(void); /*proto*/ +static CYTHON_INLINE PyObject *__pyx_f_6gevent_9_greenlet__extract_stack(int); /*proto*/ +static struct __pyx_obj_6gevent_9_greenlet__Frame *__pyx_f_6gevent_9_greenlet__Frame_from_list(PyObject *); /*proto*/ +static PyObject *__pyx_f_6gevent_9_greenlet__killall3(PyObject *, PyObject *, PyObject *); /*proto*/ +static PyObject *__pyx_f_6gevent_9_greenlet__killall(PyObject *, PyObject *); /*proto*/ +static PyObject *__pyx_f_6gevent_9_greenlet_joinall(PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_9_greenlet_joinall *__pyx_optional_args); /*proto*/ +static void __pyx_f_6gevent_9_greenlet__call_spawn_callbacks(struct __pyx_obj_6gevent_9_greenlet_Greenlet *); /*proto*/ +static PyObject *__Pyx_CFunc_object____list____object____object___to_py(PyObject *(*)(PyObject *, PyObject *, PyObject *)); /*proto*/ +static PyObject *__Pyx_CFunc_object____list____object___to_py(PyObject *(*)(PyObject *, PyObject *)); /*proto*/ +#define __Pyx_MODULE_NAME "gevent._greenlet" +extern int __pyx_module_is_main_gevent___greenlet; +int __pyx_module_is_main_gevent___greenlet = 0; + +/* Implementation of 'gevent._greenlet' */ +static PyObject *__pyx_builtin___import__; +static PyObject *__pyx_builtin_NameError; +static PyObject *__pyx_builtin_staticmethod; +static PyObject *__pyx_builtin_TypeError; +static PyObject *__pyx_builtin_reversed; +static PyObject *__pyx_builtin_ValueError; +static PyObject *__pyx_builtin_AttributeError; +static PyObject *__pyx_builtin_hex; +static PyObject *__pyx_builtin_id; +static PyObject *__pyx_builtin_AssertionError; +static const char __pyx_k_g[] = "g"; +static const char __pyx_k_s[] = " \"%s\" "; +static const char __pyx_k_t[] = "t"; +static const char __pyx_k__2[] = " "; +static const char __pyx_k__3[] = ": "; +static const char __pyx_k__4[] = ">"; +static const char __pyx_k__5[] = ""; +static const char __pyx_k__6[] = "("; +static const char __pyx_k__7[] = ", "; +static const char __pyx_k__8[] = ")"; +static const char __pyx_k_cb[] = "cb"; +static const char __pyx_k_id[] = "id"; +static const char __pyx_k_all[] = "__all__"; +static const char __pyx_k_cls[] = "cls"; +static const char __pyx_k_get[] = "__get__"; +static const char __pyx_k_hex[] = "hex"; +static const char __pyx_k_pop[] = "pop"; +static const char __pyx_k_ref[] = "ref"; +static const char __pyx_k_run[] = "run"; +static const char __pyx_k_s_s[] = "%s=%s"; +static const char __pyx_k_sys[] = "sys"; +static const char __pyx_k_Lazy[] = "Lazy"; +static const char __pyx_k_PYPY[] = "_PYPY"; +static const char __pyx_k_args[] = "args"; +static const char __pyx_k_bool[] = "__bool__"; +static const char __pyx_k_call[] = "__call__"; +static const char __pyx_k_dead[] = "dead"; +static const char __pyx_k_dict[] = "__dict__"; +static const char __pyx_k_glet[] = "glet"; +static const char __pyx_k_init[] = "__init__"; +static const char __pyx_k_join[] = "join"; +static const char __pyx_k_kill[] = "_kill"; +static const char __pyx_k_link[] = "link"; +static const char __pyx_k_loop[] = "loop"; +static const char __pyx_k_main[] = "__main__"; +static const char __pyx_k_name[] = "__name__"; +static const char __pyx_k_self[] = "__self__"; +static const char __pyx_k_stop[] = "stop"; +static const char __pyx_k_test[] = "__test__"; +static const char __pyx_k_wait[] = "wait"; +static const char __pyx_k_wrap[] = "wrap"; +static const char __pyx_k_wref[] = "wref"; +static const char __pyx_k_Frame[] = "_Frame"; +static const char __pyx_k_alive[] = "alive"; +static const char __pyx_k_block[] = "block"; +static const char __pyx_k_class[] = "__class__"; +static const char __pyx_k_close[] = "close"; +static const char __pyx_k_count[] = "count"; +static const char __pyx_k_get_2[] = "get"; +static const char __pyx_k_items[] = "items"; +static const char __pyx_k_iwait[] = "iwait"; +static const char __pyx_k_ready[] = "ready"; +static const char __pyx_k_run_2[] = "_run"; +static const char __pyx_k_slots[] = "__slots__"; +static const char __pyx_k_spawn[] = "spawn"; +static const char __pyx_k_start[] = "start"; +static const char __pyx_k_throw[] = "throw"; +static const char __pyx_k_timer[] = "timer"; +static const char __pyx_k_PYPY_2[] = "PYPY"; +static const char __pyx_k_Waiter[] = "Waiter"; +static const char __pyx_k_active[] = "active"; +static const char __pyx_k_cancel[] = "cancel"; +static const char __pyx_k_config[] = "config"; +static const char __pyx_k_f_back[] = "f_back"; +static const char __pyx_k_f_code[] = "f_code"; +static const char __pyx_k_gevent[] = "gevent"; +static const char __pyx_k_import[] = "__import__"; +static const char __pyx_k_kill_2[] = "kill"; +static const char __pyx_k_kwargs[] = "kwargs"; +static const char __pyx_k_lambda[] = ""; +static const char __pyx_k_name_2[] = "name"; +static const char __pyx_k_parent[] = "parent"; +static const char __pyx_k_remove[] = "remove"; +static const char __pyx_k_result[] = "result"; +static const char __pyx_k_self_2[] = "self"; +static const char __pyx_k_source[] = "source"; +static const char __pyx_k_switch[] = "switch"; +static const char __pyx_k_unlink[] = "unlink"; +static const char __pyx_k_waiter[] = "waiter"; +static const char __pyx_k_Timeout[] = "Timeout"; +static const char __pyx_k_joinall[] = "joinall"; +static const char __pyx_k_killall[] = "killall"; +static const char __pyx_k_nonzero[] = "__nonzero__"; +static const char __pyx_k_pending[] = "pending"; +static const char __pyx_k_rawlink[] = "rawlink"; +static const char __pyx_k_reraise[] = "reraise"; +static const char __pyx_k_s_sat_s[] = "<%s%sat %s"; +static const char __pyx_k_seconds[] = "seconds"; +static const char __pyx_k_timeout[] = "timeout"; +static const char __pyx_k_weakref[] = "weakref"; +static const char __pyx_k_Greenlet[] = "Greenlet"; +static const char __pyx_k_callback[] = "callback"; +static const char __pyx_k_exc_info[] = "exc_info"; +static const char __pyx_k_f_lineno[] = "f_lineno"; +static const char __pyx_k_getframe[] = "_getframe"; +static const char __pyx_k_greenlet[] = "greenlet"; +static const char __pyx_k_pyx_capi[] = "__pyx_capi__"; +static const char __pyx_k_reversed[] = "reversed"; +static const char __pyx_k_waiter_2[] = "_waiter"; +static const char __pyx_k_NameError[] = "NameError"; +static const char __pyx_k_TypeError[] = "TypeError"; +static const char __pyx_k_exception[] = "exception"; +static const char __pyx_k_greenlets[] = "greenlets"; +static const char __pyx_k_has_links[] = "has_links"; +static const char __pyx_k_Greenlet_d[] = "Greenlet-%d"; +static const char __pyx_k_ValueError[] = "ValueError"; +static const char __pyx_k_continulet[] = "continulet"; +static const char __pyx_k_formatinfo[] = "_formatinfo"; +static const char __pyx_k_getcurrent[] = "getcurrent"; +static const char __pyx_k_link_value[] = "link_value"; +static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__"; +static const char __pyx_k_successful[] = "successful"; +static const char __pyx_k_unlink_all[] = "unlink_all"; +static const char __pyx_k_SpawnedLink[] = "SpawnedLink"; +static const char __pyx_k_cfunc_to_py[] = "cfunc.to_py"; +static const char __pyx_k_dummy_event[] = "_dummy_event"; +static const char __pyx_k_raise_error[] = "raise_error"; +static const char __pyx_k_spawn_later[] = "spawn_later"; +static const char __pyx_k_start_later[] = "start_later"; +static const char __pyx_k_threadlocal[] = "_threadlocal"; +static const char __pyx_k_GreenletExit[] = "GreenletExit"; +static const char __pyx_k_Greenlet_get[] = "Greenlet.get"; +static const char __pyx_k_Greenlet_run[] = "Greenlet.run"; +static const char __pyx_k_continuation[] = "_continuation"; +static const char __pyx_k_continulet_2[] = "_continulet"; +static const char __pyx_k_gevent__util[] = "gevent._util"; +static const char __pyx_k_handle_error[] = "handle_error"; +static const char __pyx_k_notify_links[] = "_notify_links"; +static const char __pyx_k_readproperty[] = "readproperty"; +static const char __pyx_k_run_callback[] = "run_callback"; +static const char __pyx_k_staticmethod[] = "staticmethod"; +static const char __pyx_k_stringsource[] = "stringsource"; +static const char __pyx_k_sys_exc_info[] = "sys_exc_info"; +static const char __pyx_k_sys_getframe[] = "sys_getframe"; +static const char __pyx_k_GEVENT_CONFIG[] = "GEVENT_CONFIG"; +static const char __pyx_k_Greenlet__run[] = "Greenlet._run"; +static const char __pyx_k_Greenlet_join[] = "Greenlet.join"; +static const char __pyx_k_Greenlet_kill[] = "Greenlet.kill"; +static const char __pyx_k_Greenlet_link[] = "Greenlet.link"; +static const char __pyx_k_Greenlet_name[] = "Greenlet.name"; +static const char __pyx_k_get_hub_class[] = "get_hub_class"; +static const char __pyx_k_gevent__tblib[] = "gevent._tblib"; +static const char __pyx_k_greenlet_init[] = "greenlet_init"; +static const char __pyx_k_minimal_ident[] = "minimal_ident"; +static const char __pyx_k_AssertionError[] = "AssertionError"; +static const char __pyx_k_AttributeError[] = "AttributeError"; +static const char __pyx_k_Greenlet_ready[] = "Greenlet.ready"; +static const char __pyx_k_Greenlet_spawn[] = "Greenlet.spawn"; +static const char __pyx_k_Greenlet_start[] = "Greenlet.start"; +static const char __pyx_k_Greenlet_throw[] = "Greenlet.throw"; +static const char __pyx_k_dump_traceback[] = "dump_traceback"; +static const char __pyx_k_get_hub_noargs[] = "get_hub_noargs"; +static const char __pyx_k_gevent__compat[] = "gevent._compat"; +static const char __pyx_k_gevent__config[] = "gevent._config"; +static const char __pyx_k_gevent_timeout[] = "gevent.timeout"; +static const char __pyx_k_greenlet__init[] = "_greenlet__init__"; +static const char __pyx_k_ident_registry[] = "ident_registry"; +static const char __pyx_k_import_c_accel[] = "import_c_accel"; +static const char __pyx_k_link_exception[] = "link_exception"; +static const char __pyx_k_load_traceback[] = "load_traceback"; +static const char __pyx_k_spawning_stack[] = "spawning_stack"; +static const char __pyx_k_Greenlet_unlink[] = "Greenlet.unlink"; +static const char __pyx_k_raise_exception[] = "_raise_exception"; +static const char __pyx_k_spawn_callbacks[] = "_spawn_callbacks"; +static const char __pyx_k_wait_on_objects[] = "wait_on_objects"; +static const char __pyx_k_Greenlet_rawlink[] = "Greenlet.rawlink"; +static const char __pyx_k_dummy_event_stop[] = "_dummy_event.stop"; +static const char __pyx_k_gevent__greenlet[] = "gevent._greenlet"; +static const char __pyx_k_iwait_on_objects[] = "iwait_on_objects"; +static const char __pyx_k_dummy_event_close[] = "_dummy_event.close"; +static const char __pyx_k_dummy_event_start[] = "_dummy_event.start"; +static const char __pyx_k_gevent__hub_local[] = "gevent._hub_local"; +static const char __pyx_k_gevent_exceptions[] = "gevent.exceptions"; +static const char __pyx_k_greenlet_imported[] = "_greenlet_imported"; +static const char __pyx_k_spawn_tree_locals[] = "spawn_tree_locals"; +static const char __pyx_k_FailureSpawnedLink[] = "FailureSpawnedLink"; +static const char __pyx_k_Greenlet_has_links[] = "Greenlet.has_links"; +static const char __pyx_k_InvalidSwitchError[] = "InvalidSwitchError"; +static const char __pyx_k_SuccessSpawnedLink[] = "SuccessSpawnedLink"; +static const char __pyx_k_add_spawn_callback[] = "add_spawn_callback"; +static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; +static const char __pyx_k_start_new_or_dummy[] = "_start_new_or_dummy"; +static const char __pyx_k_Expected_callable_r[] = "Expected callable: %r"; +static const char __pyx_k_Greenlet_link_value[] = "Greenlet.link_value"; +static const char __pyx_k_Greenlet_successful[] = "Greenlet.successful"; +static const char __pyx_k_Greenlet_unlink_all[] = "Greenlet.unlink_all"; +static const char __pyx_k_track_greenlet_tree[] = "track_greenlet_tree"; +static const char __pyx_k_Greenlet__formatinfo[] = "Greenlet._formatinfo"; +static const char __pyx_k_Greenlet_spawn_later[] = "Greenlet.spawn_later"; +static const char __pyx_k_Greenlet_start_later[] = "Greenlet.start_later"; +static const char __pyx_k_spawning_stack_limit[] = "spawning_stack_limit"; +static const char __pyx_k_cancelled_start_event[] = "_cancelled_start_event"; +static const char __pyx_k_remove_spawn_callback[] = "remove_spawn_callback"; +static const char __pyx_k_spawning_stack_frames[] = "_spawning_stack_frames"; +static const char __pyx_k_start_completed_event[] = "_start_completed_event"; +static const char __pyx_k_Greenlet__notify_links[] = "Greenlet._notify_links"; +static const char __pyx_k_gevent__hub_primitives[] = "gevent._hub_primitives"; +static const char __pyx_k_src_gevent_greenlet_py[] = "src\\gevent\\greenlet.py"; +static const char __pyx_k_Greenlet_link_exception[] = "Greenlet.link_exception"; +static const char __pyx_k_Greenlet_spawning_stack[] = "Greenlet.spawning_stack"; +static const char __pyx_k_Greenlet__raise_exception[] = "Greenlet._raise_exception"; +static const char __pyx_k_Greenlet_add_spawn_callback[] = "Greenlet.add_spawn_callback"; +static const char __pyx_k_Cannot_start_the_dummy_event[] = "Cannot start the dummy event"; +static const char __pyx_k_Greenlet_remove_spawn_callback[] = "Greenlet.remove_spawn_callback"; +static const char __pyx_k_Pyx_CFunc_object____list____ob[] = "__Pyx_CFunc_object____list____object____object___to_py..wrap"; +static const char __pyx_k_Invalid_switch_into_Greenlet_get[] = "Invalid switch into Greenlet.get(): %r"; +static const char __pyx_k_Invalid_switch_into_Greenlet_joi[] = "Invalid switch into Greenlet.join(): %r"; +static const char __pyx_k_Pyx_CFunc_object____list____ob_2[] = "__Pyx_CFunc_object____list____object___to_py..wrap"; +static const char __pyx_k_The_run_argument_or_self__run_mu[] = "The run argument or self._run must be callable"; +static PyObject *__pyx_n_s_AssertionError; +static PyObject *__pyx_n_s_AttributeError; +static PyObject *__pyx_kp_s_Cannot_start_the_dummy_event; +static PyObject *__pyx_kp_s_Expected_callable_r; +static PyObject *__pyx_n_s_FailureSpawnedLink; +static PyObject *__pyx_n_s_Frame; +static PyObject *__pyx_n_s_GEVENT_CONFIG; +static PyObject *__pyx_n_s_Greenlet; +static PyObject *__pyx_n_s_GreenletExit; +static PyObject *__pyx_n_s_Greenlet__formatinfo; +static PyObject *__pyx_n_s_Greenlet__notify_links; +static PyObject *__pyx_n_s_Greenlet__raise_exception; +static PyObject *__pyx_n_s_Greenlet__run; +static PyObject *__pyx_n_s_Greenlet_add_spawn_callback; +static PyObject *__pyx_kp_s_Greenlet_d; +static PyObject *__pyx_n_s_Greenlet_get; +static PyObject *__pyx_n_s_Greenlet_has_links; +static PyObject *__pyx_n_s_Greenlet_join; +static PyObject *__pyx_n_s_Greenlet_kill; +static PyObject *__pyx_n_s_Greenlet_link; +static PyObject *__pyx_n_s_Greenlet_link_exception; +static PyObject *__pyx_n_s_Greenlet_link_value; +static PyObject *__pyx_n_s_Greenlet_name; +static PyObject *__pyx_n_s_Greenlet_rawlink; +static PyObject *__pyx_n_s_Greenlet_ready; +static PyObject *__pyx_n_s_Greenlet_remove_spawn_callback; +static PyObject *__pyx_n_s_Greenlet_run; +static PyObject *__pyx_n_s_Greenlet_spawn; +static PyObject *__pyx_n_s_Greenlet_spawn_later; +static PyObject *__pyx_n_s_Greenlet_spawning_stack; +static PyObject *__pyx_n_s_Greenlet_start; +static PyObject *__pyx_n_s_Greenlet_start_later; +static PyObject *__pyx_n_s_Greenlet_successful; +static PyObject *__pyx_n_s_Greenlet_throw; +static PyObject *__pyx_n_s_Greenlet_unlink; +static PyObject *__pyx_n_s_Greenlet_unlink_all; +static PyObject *__pyx_n_s_InvalidSwitchError; +static PyObject *__pyx_kp_s_Invalid_switch_into_Greenlet_get; +static PyObject *__pyx_kp_s_Invalid_switch_into_Greenlet_joi; +static PyObject *__pyx_n_s_Lazy; +static PyObject *__pyx_n_s_NameError; +static PyObject *__pyx_n_s_PYPY; +static PyObject *__pyx_n_s_PYPY_2; +static PyObject *__pyx_n_s_Pyx_CFunc_object____list____ob; +static PyObject *__pyx_n_s_Pyx_CFunc_object____list____ob_2; +static PyObject *__pyx_n_s_SpawnedLink; +static PyObject *__pyx_n_s_SuccessSpawnedLink; +static PyObject *__pyx_kp_s_The_run_argument_or_self__run_mu; +static PyObject *__pyx_n_s_Timeout; +static PyObject *__pyx_n_s_TypeError; +static PyObject *__pyx_n_s_ValueError; +static PyObject *__pyx_n_s_Waiter; +static PyObject *__pyx_kp_s__2; +static PyObject *__pyx_kp_s__3; +static PyObject *__pyx_kp_s__4; +static PyObject *__pyx_kp_s__5; +static PyObject *__pyx_kp_s__6; +static PyObject *__pyx_kp_s__7; +static PyObject *__pyx_kp_s__8; +static PyObject *__pyx_n_s_active; +static PyObject *__pyx_n_s_add_spawn_callback; +static PyObject *__pyx_n_s_alive; +static PyObject *__pyx_n_s_all; +static PyObject *__pyx_n_s_args; +static PyObject *__pyx_n_s_block; +static PyObject *__pyx_n_s_bool; +static PyObject *__pyx_n_s_call; +static PyObject *__pyx_n_s_callback; +static PyObject *__pyx_n_s_cancel; +static PyObject *__pyx_n_s_cancelled_start_event; +static PyObject *__pyx_n_s_cb; +static PyObject *__pyx_n_s_cfunc_to_py; +static PyObject *__pyx_n_s_class; +static PyObject *__pyx_n_s_cline_in_traceback; +static PyObject *__pyx_n_s_close; +static PyObject *__pyx_n_s_cls; +static PyObject *__pyx_n_s_config; +static PyObject *__pyx_n_s_continuation; +static PyObject *__pyx_n_s_continulet; +static PyObject *__pyx_n_s_continulet_2; +static PyObject *__pyx_n_s_count; +static PyObject *__pyx_n_s_dead; +static PyObject *__pyx_n_s_dict; +static PyObject *__pyx_n_s_dummy_event; +static PyObject *__pyx_n_s_dummy_event_close; +static PyObject *__pyx_n_s_dummy_event_start; +static PyObject *__pyx_n_s_dummy_event_stop; +static PyObject *__pyx_n_s_dump_traceback; +static PyObject *__pyx_n_s_exc_info; +static PyObject *__pyx_n_s_exception; +static PyObject *__pyx_n_s_f_back; +static PyObject *__pyx_n_s_f_code; +static PyObject *__pyx_n_s_f_lineno; +static PyObject *__pyx_n_s_formatinfo; +static PyObject *__pyx_n_s_g; +static PyObject *__pyx_n_s_get; +static PyObject *__pyx_n_s_get_2; +static PyObject *__pyx_n_s_get_hub_class; +static PyObject *__pyx_n_s_get_hub_noargs; +static PyObject *__pyx_n_s_getcurrent; +static PyObject *__pyx_n_s_getframe; +static PyObject *__pyx_n_s_gevent; +static PyObject *__pyx_n_s_gevent__compat; +static PyObject *__pyx_n_s_gevent__config; +static PyObject *__pyx_n_s_gevent__greenlet; +static PyObject *__pyx_n_s_gevent__hub_local; +static PyObject *__pyx_n_s_gevent__hub_primitives; +static PyObject *__pyx_n_s_gevent__tblib; +static PyObject *__pyx_n_s_gevent__util; +static PyObject *__pyx_n_s_gevent_exceptions; +static PyObject *__pyx_n_s_gevent_timeout; +static PyObject *__pyx_n_s_glet; +static PyObject *__pyx_n_s_greenlet; +static PyObject *__pyx_n_s_greenlet__init; +static PyObject *__pyx_n_s_greenlet_imported; +static PyObject *__pyx_n_s_greenlet_init; +static PyObject *__pyx_n_s_greenlets; +static PyObject *__pyx_n_s_handle_error; +static PyObject *__pyx_n_s_has_links; +static PyObject *__pyx_n_s_hex; +static PyObject *__pyx_n_s_id; +static PyObject *__pyx_n_s_ident_registry; +static PyObject *__pyx_n_s_import; +static PyObject *__pyx_n_s_import_c_accel; +static PyObject *__pyx_n_s_init; +static PyObject *__pyx_n_s_items; +static PyObject *__pyx_n_s_iwait; +static PyObject *__pyx_n_s_iwait_on_objects; +static PyObject *__pyx_n_s_join; +static PyObject *__pyx_n_s_joinall; +static PyObject *__pyx_n_s_kill; +static PyObject *__pyx_n_s_kill_2; +static PyObject *__pyx_n_s_killall; +static PyObject *__pyx_n_s_kwargs; +static PyObject *__pyx_n_s_lambda; +static PyObject *__pyx_n_s_link; +static PyObject *__pyx_n_s_link_exception; +static PyObject *__pyx_n_s_link_value; +static PyObject *__pyx_n_s_load_traceback; +static PyObject *__pyx_n_s_loop; +static PyObject *__pyx_n_s_main; +static PyObject *__pyx_n_s_minimal_ident; +static PyObject *__pyx_n_s_name; +static PyObject *__pyx_n_s_name_2; +static PyObject *__pyx_n_s_nonzero; +static PyObject *__pyx_n_s_notify_links; +static PyObject *__pyx_n_s_parent; +static PyObject *__pyx_n_s_pending; +static PyObject *__pyx_n_s_pop; +static PyObject *__pyx_n_s_pyx_capi; +static PyObject *__pyx_n_s_pyx_vtable; +static PyObject *__pyx_n_s_raise_error; +static PyObject *__pyx_n_s_raise_exception; +static PyObject *__pyx_n_s_rawlink; +static PyObject *__pyx_n_s_readproperty; +static PyObject *__pyx_n_s_ready; +static PyObject *__pyx_n_s_ref; +static PyObject *__pyx_n_s_remove; +static PyObject *__pyx_n_s_remove_spawn_callback; +static PyObject *__pyx_n_s_reraise; +static PyObject *__pyx_n_s_result; +static PyObject *__pyx_n_s_reversed; +static PyObject *__pyx_n_s_run; +static PyObject *__pyx_n_s_run_2; +static PyObject *__pyx_n_s_run_callback; +static PyObject *__pyx_kp_s_s; +static PyObject *__pyx_kp_s_s_s; +static PyObject *__pyx_kp_s_s_sat_s; +static PyObject *__pyx_n_s_seconds; +static PyObject *__pyx_n_s_self; +static PyObject *__pyx_n_s_self_2; +static PyObject *__pyx_n_s_slots; +static PyObject *__pyx_n_s_source; +static PyObject *__pyx_n_s_spawn; +static PyObject *__pyx_n_s_spawn_callbacks; +static PyObject *__pyx_n_s_spawn_later; +static PyObject *__pyx_n_s_spawn_tree_locals; +static PyObject *__pyx_n_s_spawning_stack; +static PyObject *__pyx_n_s_spawning_stack_frames; +static PyObject *__pyx_n_s_spawning_stack_limit; +static PyObject *__pyx_kp_s_src_gevent_greenlet_py; +static PyObject *__pyx_n_s_start; +static PyObject *__pyx_n_s_start_completed_event; +static PyObject *__pyx_n_s_start_later; +static PyObject *__pyx_n_s_start_new_or_dummy; +static PyObject *__pyx_n_s_staticmethod; +static PyObject *__pyx_n_s_stop; +static PyObject *__pyx_kp_s_stringsource; +static PyObject *__pyx_n_s_successful; +static PyObject *__pyx_n_s_switch; +static PyObject *__pyx_n_s_sys; +static PyObject *__pyx_n_s_sys_exc_info; +static PyObject *__pyx_n_s_sys_getframe; +static PyObject *__pyx_n_s_t; +static PyObject *__pyx_n_s_test; +static PyObject *__pyx_n_s_threadlocal; +static PyObject *__pyx_n_s_throw; +static PyObject *__pyx_n_s_timeout; +static PyObject *__pyx_n_s_timer; +static PyObject *__pyx_n_s_track_greenlet_tree; +static PyObject *__pyx_n_s_unlink; +static PyObject *__pyx_n_s_unlink_all; +static PyObject *__pyx_n_s_wait; +static PyObject *__pyx_n_s_wait_on_objects; +static PyObject *__pyx_n_s_waiter; +static PyObject *__pyx_n_s_waiter_2; +static PyObject *__pyx_n_s_weakref; +static PyObject *__pyx_n_s_wrap; +static PyObject *__pyx_n_s_wref; +static PyObject *__pyx_lambda_funcdef_6gevent_9_greenlet_lambda(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static int __pyx_pf_6gevent_9_greenlet_11SpawnedLink___init__(struct __pyx_obj_6gevent_9_greenlet_SpawnedLink *__pyx_v_self, PyObject *__pyx_v_callback); /* proto */ +static PyObject *__pyx_pf_6gevent_9_greenlet_11SpawnedLink_2__call__(struct __pyx_obj_6gevent_9_greenlet_SpawnedLink *__pyx_v_self, PyObject *__pyx_v_source); /* proto */ +static Py_hash_t __pyx_pf_6gevent_9_greenlet_11SpawnedLink_4__hash__(struct __pyx_obj_6gevent_9_greenlet_SpawnedLink *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_9_greenlet_11SpawnedLink_6__eq__(struct __pyx_obj_6gevent_9_greenlet_SpawnedLink *__pyx_v_self, PyObject *__pyx_v_other); /* proto */ +static PyObject *__pyx_pf_6gevent_9_greenlet_11SpawnedLink_8__str__(struct __pyx_obj_6gevent_9_greenlet_SpawnedLink *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_9_greenlet_11SpawnedLink_10__repr__(struct __pyx_obj_6gevent_9_greenlet_SpawnedLink *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_9_greenlet_11SpawnedLink_12__getattr__(struct __pyx_obj_6gevent_9_greenlet_SpawnedLink *__pyx_v_self, PyObject *__pyx_v_item); /* proto */ +static PyObject *__pyx_pf_6gevent_9_greenlet_11SpawnedLink_8callback___get__(struct __pyx_obj_6gevent_9_greenlet_SpawnedLink *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_9_greenlet_11SpawnedLink_8callback_2__set__(struct __pyx_obj_6gevent_9_greenlet_SpawnedLink *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6gevent_9_greenlet_11SpawnedLink_8callback_4__del__(struct __pyx_obj_6gevent_9_greenlet_SpawnedLink *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_9_greenlet_18SuccessSpawnedLink___call__(struct __pyx_obj_6gevent_9_greenlet_SuccessSpawnedLink *__pyx_v_self, PyObject *__pyx_v_source); /* proto */ +static PyObject *__pyx_pf_6gevent_9_greenlet_18FailureSpawnedLink___call__(struct __pyx_obj_6gevent_9_greenlet_FailureSpawnedLink *__pyx_v_self, PyObject *__pyx_v_source); /* proto */ +static int __pyx_pf_6gevent_9_greenlet_6_Frame___init__(struct __pyx_obj_6gevent_9_greenlet__Frame *__pyx_v_self, PyObject *__pyx_v_f_code, PyObject *__pyx_v_f_lineno, PyObject *__pyx_v_f_back); /* proto */ +static PyObject *__pyx_pf_6gevent_9_greenlet_6_Frame_9f_globals___get__(CYTHON_UNUSED struct __pyx_obj_6gevent_9_greenlet__Frame *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_9_greenlet_6_Frame_6f_code___get__(struct __pyx_obj_6gevent_9_greenlet__Frame *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_9_greenlet_6_Frame_8f_lineno___get__(struct __pyx_obj_6gevent_9_greenlet__Frame *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_9_greenlet_6_Frame_6f_back___get__(struct __pyx_obj_6gevent_9_greenlet__Frame *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_9_greenlet_8Greenlet___init__(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self, PyObject *__pyx_v_run, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */ +static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_2spawning_stack(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_13minimal_ident___get__(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_4name(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_6_raise_exception(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_4loop___get__(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_9_greenlet_8Greenlet_8__nonzero__(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_4dead___get__(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_7started___get__(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_10ready(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_12successful(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_14__repr__(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_16_formatinfo(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_9exception___get__(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_8exc_info___get__(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_18throw(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self, PyObject *__pyx_v_args); /* proto */ +static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_20start(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_22start_later(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self, PyObject *__pyx_v_seconds); /* proto */ +static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_24add_spawn_callback(PyObject *__pyx_v_callback); /* proto */ +static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_26remove_spawn_callback(PyObject *__pyx_v_callback); /* proto */ +static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_28spawn(PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */ +static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_30spawn_later(PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_seconds, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */ +static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_32kill(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self, PyObject *__pyx_v_exception, PyObject *__pyx_v_block, PyObject *__pyx_v_timeout); /* proto */ +static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_34get(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self, PyObject *__pyx_v_block, PyObject *__pyx_v_timeout); /* proto */ +static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_36join(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self, PyObject *__pyx_v_timeout); /* proto */ +static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_38run(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_40_run(CYTHON_UNUSED struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_42has_links(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_44rawlink(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self, PyObject *__pyx_v_callback); /* proto */ +static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_46link(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self, PyObject *__pyx_v_callback, PyObject *__pyx_v_SpawnedLink); /* proto */ +static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_48unlink(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self, PyObject *__pyx_v_callback); /* proto */ +static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_50unlink_all(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_52link_value(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self, PyObject *__pyx_v_callback, PyObject *__pyx_v_SpawnedLink); /* proto */ +static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_54link_exception(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self, PyObject *__pyx_v_callback, PyObject *__pyx_v_SpawnedLink); /* proto */ +static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_56_notify_links(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_5value___get__(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_4args___get__(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_6kwargs___get__(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_17spawning_greenlet___get__(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_17spawn_tree_locals___get__(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_9_greenlet_8Greenlet_17spawn_tree_locals_2__set__(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6gevent_9_greenlet_8Greenlet_17spawn_tree_locals_4__del__(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_22_spawning_stack_frames___get__(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_9_greenlet_12_dummy_event___init__(struct __pyx_obj_6gevent_9_greenlet__dummy_event *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_9_greenlet_12_dummy_event_2stop(struct __pyx_obj_6gevent_9_greenlet__dummy_event *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_9_greenlet_12_dummy_event_4start(struct __pyx_obj_6gevent_9_greenlet__dummy_event *__pyx_v_self, PyObject *__pyx_v_cb); /* proto */ +static PyObject *__pyx_pf_6gevent_9_greenlet_12_dummy_event_6close(struct __pyx_obj_6gevent_9_greenlet__dummy_event *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_9_greenlet_12_dummy_event_7pending___get__(struct __pyx_obj_6gevent_9_greenlet__dummy_event *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_9_greenlet_12_dummy_event_6active___get__(struct __pyx_obj_6gevent_9_greenlet__dummy_event *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_9_greenlet__kill(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_glet, PyObject *__pyx_v_exception, PyObject *__pyx_v_waiter); /* proto */ +static PyObject *__pyx_pf_6gevent_9_greenlet_2joinall(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_greenlets, PyObject *__pyx_v_timeout, PyObject *__pyx_v_raise_error, PyObject *__pyx_v_count); /* proto */ +static PyObject *__pyx_pf_6gevent_9_greenlet_7__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_6gevent_9_greenlet_4killall(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_greenlets, PyObject *__pyx_v_exception, PyObject *__pyx_v_block, PyObject *__pyx_v_timeout); /* proto */ +static PyObject *__pyx_pf_11cfunc_dot_to_py_54__Pyx_CFunc_object____list____object____object___to_py_wrap(PyObject *__pyx_self, PyObject *__pyx_v_greenlets, PyObject *__pyx_v_exception, PyObject *__pyx_v_waiter); /* proto */ +static PyObject *__pyx_pf_11cfunc_dot_to_py_44__Pyx_CFunc_object____list____object___to_py_wrap(PyObject *__pyx_self, PyObject *__pyx_v_greenlets, PyObject *__pyx_v_exception); /* proto */ +static PyObject *__pyx_tp_new_6gevent_9_greenlet_SpawnedLink(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6gevent_9_greenlet_SuccessSpawnedLink(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6gevent_9_greenlet_FailureSpawnedLink(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6gevent_9_greenlet__Frame(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6gevent_9_greenlet_Greenlet(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6gevent_9_greenlet__dummy_event(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new___pyx_scope_struct____Pyx_CFunc_object____list____object____object___to_py(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new___pyx_scope_struct____Pyx_CFunc_object____list____object___to_py(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_int_0; +static PyObject *__pyx_int_10; +static PyObject *__pyx_k__10; +static PyObject *__pyx_k__13; +static PyObject *__pyx_k__14; +static PyObject *__pyx_k__15; +static PyObject *__pyx_tuple_; +static PyObject *__pyx_tuple__9; +static PyObject *__pyx_tuple__11; +static PyObject *__pyx_tuple__12; +static PyObject *__pyx_tuple__16; +static PyObject *__pyx_tuple__17; +static PyObject *__pyx_tuple__19; +static PyObject *__pyx_tuple__21; +static PyObject *__pyx_tuple__22; +static PyObject *__pyx_tuple__23; +static PyObject *__pyx_tuple__25; +static PyObject *__pyx_tuple__27; +static PyObject *__pyx_tuple__29; +static PyObject *__pyx_tuple__31; +static PyObject *__pyx_tuple__33; +static PyObject *__pyx_tuple__35; +static PyObject *__pyx_tuple__37; +static PyObject *__pyx_tuple__39; +static PyObject *__pyx_tuple__41; +static PyObject *__pyx_tuple__43; +static PyObject *__pyx_tuple__45; +static PyObject *__pyx_tuple__47; +static PyObject *__pyx_tuple__49; +static PyObject *__pyx_tuple__51; +static PyObject *__pyx_tuple__53; +static PyObject *__pyx_tuple__55; +static PyObject *__pyx_tuple__57; +static PyObject *__pyx_tuple__59; +static PyObject *__pyx_tuple__61; +static PyObject *__pyx_tuple__63; +static PyObject *__pyx_tuple__65; +static PyObject *__pyx_tuple__67; +static PyObject *__pyx_tuple__69; +static PyObject *__pyx_tuple__71; +static PyObject *__pyx_tuple__73; +static PyObject *__pyx_tuple__75; +static PyObject *__pyx_tuple__76; +static PyObject *__pyx_tuple__78; +static PyObject *__pyx_tuple__80; +static PyObject *__pyx_tuple__82; +static PyObject *__pyx_tuple__84; +static PyObject *__pyx_tuple__86; +static PyObject *__pyx_codeobj__18; +static PyObject *__pyx_codeobj__20; +static PyObject *__pyx_codeobj__24; +static PyObject *__pyx_codeobj__26; +static PyObject *__pyx_codeobj__28; +static PyObject *__pyx_codeobj__30; +static PyObject *__pyx_codeobj__32; +static PyObject *__pyx_codeobj__34; +static PyObject *__pyx_codeobj__36; +static PyObject *__pyx_codeobj__38; +static PyObject *__pyx_codeobj__40; +static PyObject *__pyx_codeobj__42; +static PyObject *__pyx_codeobj__44; +static PyObject *__pyx_codeobj__46; +static PyObject *__pyx_codeobj__48; +static PyObject *__pyx_codeobj__50; +static PyObject *__pyx_codeobj__52; +static PyObject *__pyx_codeobj__54; +static PyObject *__pyx_codeobj__56; +static PyObject *__pyx_codeobj__58; +static PyObject *__pyx_codeobj__60; +static PyObject *__pyx_codeobj__62; +static PyObject *__pyx_codeobj__64; +static PyObject *__pyx_codeobj__66; +static PyObject *__pyx_codeobj__68; +static PyObject *__pyx_codeobj__70; +static PyObject *__pyx_codeobj__72; +static PyObject *__pyx_codeobj__74; +static PyObject *__pyx_codeobj__77; +static PyObject *__pyx_codeobj__79; +static PyObject *__pyx_codeobj__81; +static PyObject *__pyx_codeobj__83; +static PyObject *__pyx_codeobj__85; +static PyObject *__pyx_codeobj__87; +/* Late includes */ + +/* "src/gevent/greenlet.py":46 + * # error. + * locals()['getcurrent'] = __import__('greenlet').getcurrent + * locals()['greenlet_init'] = lambda: None # <<<<<<<<<<<<<< + * locals()['Waiter'] = _waiter.Waiter + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_9_greenlet_6lambda(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyMethodDef __pyx_mdef_6gevent_9_greenlet_6lambda = {"lambda", (PyCFunction)__pyx_pw_6gevent_9_greenlet_6lambda, METH_NOARGS, 0}; +static PyObject *__pyx_pw_6gevent_9_greenlet_6lambda(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("lambda (wrapper)", 0); + __pyx_r = __pyx_lambda_funcdef_6gevent_9_greenlet_lambda(__pyx_self); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_lambda_funcdef_6gevent_9_greenlet_lambda(CYTHON_UNUSED PyObject *__pyx_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("lambda", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/greenlet.py":63 + * __slots__ = ['callback'] + * + * def __init__(self, callback): # <<<<<<<<<<<<<< + * if not callable(callback): + * raise TypeError("Expected callable: %r" % (callback, )) + */ + +/* Python wrapper */ +static int __pyx_pw_6gevent_9_greenlet_11SpawnedLink_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6gevent_9_greenlet_11SpawnedLink_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_callback = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_callback,0}; + PyObject* values[1] = {0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_callback)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 63, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + } + __pyx_v_callback = values[0]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 63, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent._greenlet.SpawnedLink.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_9_greenlet_11SpawnedLink___init__(((struct __pyx_obj_6gevent_9_greenlet_SpawnedLink *)__pyx_v_self), __pyx_v_callback); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_9_greenlet_11SpawnedLink___init__(struct __pyx_obj_6gevent_9_greenlet_SpawnedLink *__pyx_v_self, PyObject *__pyx_v_callback) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "src/gevent/greenlet.py":64 + * + * def __init__(self, callback): + * if not callable(callback): # <<<<<<<<<<<<<< + * raise TypeError("Expected callable: %r" % (callback, )) + * self.callback = callback + */ + __pyx_t_1 = __Pyx_PyCallable_Check(__pyx_v_callback); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 64, __pyx_L1_error) + __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0); + if (unlikely(__pyx_t_2)) { + + /* "src/gevent/greenlet.py":65 + * def __init__(self, callback): + * if not callable(callback): + * raise TypeError("Expected callable: %r" % (callback, )) # <<<<<<<<<<<<<< + * self.callback = callback + * + */ + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 65, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_callback); + __Pyx_GIVEREF(__pyx_v_callback); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_callback); + __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Expected_callable_r, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 65, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 65, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(0, 65, __pyx_L1_error) + + /* "src/gevent/greenlet.py":64 + * + * def __init__(self, callback): + * if not callable(callback): # <<<<<<<<<<<<<< + * raise TypeError("Expected callable: %r" % (callback, )) + * self.callback = callback + */ + } + + /* "src/gevent/greenlet.py":66 + * if not callable(callback): + * raise TypeError("Expected callable: %r" % (callback, )) + * self.callback = callback # <<<<<<<<<<<<<< + * + * def __call__(self, source): + */ + __Pyx_INCREF(__pyx_v_callback); + __Pyx_GIVEREF(__pyx_v_callback); + __Pyx_GOTREF(__pyx_v_self->callback); + __Pyx_DECREF(__pyx_v_self->callback); + __pyx_v_self->callback = __pyx_v_callback; + + /* "src/gevent/greenlet.py":63 + * __slots__ = ['callback'] + * + * def __init__(self, callback): # <<<<<<<<<<<<<< + * if not callable(callback): + * raise TypeError("Expected callable: %r" % (callback, )) + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("gevent._greenlet.SpawnedLink.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/greenlet.py":68 + * self.callback = callback + * + * def __call__(self, source): # <<<<<<<<<<<<<< + * g = greenlet(self.callback, get_hub()) + * g.switch(source) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_9_greenlet_11SpawnedLink_3__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6gevent_9_greenlet_11SpawnedLink_3__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_source = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__call__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_source,0}; + PyObject* values[1] = {0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_source)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__call__") < 0)) __PYX_ERR(0, 68, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + } + __pyx_v_source = values[0]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__call__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 68, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent._greenlet.SpawnedLink.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_9_greenlet_11SpawnedLink_2__call__(((struct __pyx_obj_6gevent_9_greenlet_SpawnedLink *)__pyx_v_self), __pyx_v_source); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_9_greenlet_11SpawnedLink_2__call__(struct __pyx_obj_6gevent_9_greenlet_SpawnedLink *__pyx_v_self, PyObject *__pyx_v_source) { + PyGreenlet *__pyx_v_g = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("__call__", 0); + + /* "src/gevent/greenlet.py":69 + * + * def __call__(self, source): + * g = greenlet(self.callback, get_hub()) # <<<<<<<<<<<<<< + * g.switch(source) + * + */ + __pyx_t_1 = ((PyObject *)__pyx_f_6gevent_11__hub_local_get_hub_noargs(0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 69, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 69, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_self->callback); + __Pyx_GIVEREF(__pyx_v_self->callback); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_self->callback); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6gevent_9_greenlet_greenlet), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 69, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_g = ((PyGreenlet *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "src/gevent/greenlet.py":70 + * def __call__(self, source): + * g = greenlet(self.callback, get_hub()) + * g.switch(source) # <<<<<<<<<<<<<< + * + * def __hash__(self): + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_g), __pyx_n_s_switch); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 70, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_source) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_source); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 70, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/greenlet.py":68 + * self.callback = callback + * + * def __call__(self, source): # <<<<<<<<<<<<<< + * g = greenlet(self.callback, get_hub()) + * g.switch(source) + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("gevent._greenlet.SpawnedLink.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_g); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/greenlet.py":72 + * g.switch(source) + * + * def __hash__(self): # <<<<<<<<<<<<<< + * return hash(self.callback) + * + */ + +/* Python wrapper */ +static Py_hash_t __pyx_pw_6gevent_9_greenlet_11SpawnedLink_5__hash__(PyObject *__pyx_v_self); /*proto*/ +static Py_hash_t __pyx_pw_6gevent_9_greenlet_11SpawnedLink_5__hash__(PyObject *__pyx_v_self) { + Py_hash_t __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__hash__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_9_greenlet_11SpawnedLink_4__hash__(((struct __pyx_obj_6gevent_9_greenlet_SpawnedLink *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static Py_hash_t __pyx_pf_6gevent_9_greenlet_11SpawnedLink_4__hash__(struct __pyx_obj_6gevent_9_greenlet_SpawnedLink *__pyx_v_self) { + Py_hash_t __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_hash_t __pyx_t_2; + __Pyx_RefNannySetupContext("__hash__", 0); + + /* "src/gevent/greenlet.py":73 + * + * def __hash__(self): + * return hash(self.callback) # <<<<<<<<<<<<<< + * + * def __eq__(self, other): + */ + __pyx_t_1 = __pyx_v_self->callback; + __Pyx_INCREF(__pyx_t_1); + __pyx_t_2 = PyObject_Hash(__pyx_t_1); if (unlikely(__pyx_t_2 == ((Py_hash_t)-1))) __PYX_ERR(0, 73, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + goto __pyx_L0; + + /* "src/gevent/greenlet.py":72 + * g.switch(source) + * + * def __hash__(self): # <<<<<<<<<<<<<< + * return hash(self.callback) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent._greenlet.SpawnedLink.__hash__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + if (unlikely(__pyx_r == -1) && !PyErr_Occurred()) __pyx_r = -2; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/greenlet.py":75 + * return hash(self.callback) + * + * def __eq__(self, other): # <<<<<<<<<<<<<< + * return self.callback == getattr(other, 'callback', other) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_9_greenlet_11SpawnedLink_7__eq__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/ +static PyObject *__pyx_pw_6gevent_9_greenlet_11SpawnedLink_7__eq__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__eq__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_9_greenlet_11SpawnedLink_6__eq__(((struct __pyx_obj_6gevent_9_greenlet_SpawnedLink *)__pyx_v_self), ((PyObject *)__pyx_v_other)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_9_greenlet_11SpawnedLink_6__eq__(struct __pyx_obj_6gevent_9_greenlet_SpawnedLink *__pyx_v_self, PyObject *__pyx_v_other) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("__eq__", 0); + + /* "src/gevent/greenlet.py":76 + * + * def __eq__(self, other): + * return self.callback == getattr(other, 'callback', other) # <<<<<<<<<<<<<< + * + * def __str__(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_GetAttr3(__pyx_v_other, __pyx_n_s_callback, __pyx_v_other); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 76, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyObject_RichCompare(__pyx_v_self->callback, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 76, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "src/gevent/greenlet.py":75 + * return hash(self.callback) + * + * def __eq__(self, other): # <<<<<<<<<<<<<< + * return self.callback == getattr(other, 'callback', other) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent._greenlet.SpawnedLink.__eq__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/greenlet.py":78 + * return self.callback == getattr(other, 'callback', other) + * + * def __str__(self): # <<<<<<<<<<<<<< + * return str(self.callback) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_9_greenlet_11SpawnedLink_9__str__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_9_greenlet_11SpawnedLink_9__str__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__str__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_9_greenlet_11SpawnedLink_8__str__(((struct __pyx_obj_6gevent_9_greenlet_SpawnedLink *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_9_greenlet_11SpawnedLink_8__str__(struct __pyx_obj_6gevent_9_greenlet_SpawnedLink *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__str__", 0); + + /* "src/gevent/greenlet.py":79 + * + * def __str__(self): + * return str(self.callback) # <<<<<<<<<<<<<< + * + * def __repr__(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyString_Type)), __pyx_v_self->callback); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 79, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "src/gevent/greenlet.py":78 + * return self.callback == getattr(other, 'callback', other) + * + * def __str__(self): # <<<<<<<<<<<<<< + * return str(self.callback) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent._greenlet.SpawnedLink.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/greenlet.py":81 + * return str(self.callback) + * + * def __repr__(self): # <<<<<<<<<<<<<< + * return repr(self.callback) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_9_greenlet_11SpawnedLink_11__repr__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_9_greenlet_11SpawnedLink_11__repr__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_9_greenlet_11SpawnedLink_10__repr__(((struct __pyx_obj_6gevent_9_greenlet_SpawnedLink *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_9_greenlet_11SpawnedLink_10__repr__(struct __pyx_obj_6gevent_9_greenlet_SpawnedLink *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("__repr__", 0); + + /* "src/gevent/greenlet.py":82 + * + * def __repr__(self): + * return repr(self.callback) # <<<<<<<<<<<<<< + * + * def __getattr__(self, item): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_v_self->callback; + __Pyx_INCREF(__pyx_t_1); + __pyx_t_2 = PyObject_Repr(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 82, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "src/gevent/greenlet.py":81 + * return str(self.callback) + * + * def __repr__(self): # <<<<<<<<<<<<<< + * return repr(self.callback) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent._greenlet.SpawnedLink.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/greenlet.py":84 + * return repr(self.callback) + * + * def __getattr__(self, item): # <<<<<<<<<<<<<< + * assert item != 'callback' + * return getattr(self.callback, item) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_9_greenlet_11SpawnedLink_13__getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_item); /*proto*/ +static PyObject *__pyx_pw_6gevent_9_greenlet_11SpawnedLink_13__getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_item) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__getattr__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_9_greenlet_11SpawnedLink_12__getattr__(((struct __pyx_obj_6gevent_9_greenlet_SpawnedLink *)__pyx_v_self), ((PyObject *)__pyx_v_item)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_9_greenlet_11SpawnedLink_12__getattr__(struct __pyx_obj_6gevent_9_greenlet_SpawnedLink *__pyx_v_self, PyObject *__pyx_v_item) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("__getattr__", 0); + + /* "src/gevent/greenlet.py":85 + * + * def __getattr__(self, item): + * assert item != 'callback' # <<<<<<<<<<<<<< + * return getattr(self.callback, item) + * + */ + #ifndef CYTHON_WITHOUT_ASSERTIONS + if (unlikely(!Py_OptimizeFlag)) { + __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_item, __pyx_n_s_callback, Py_NE)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 85, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) { + PyErr_SetNone(PyExc_AssertionError); + __PYX_ERR(0, 85, __pyx_L1_error) + } + } + #endif + + /* "src/gevent/greenlet.py":86 + * def __getattr__(self, item): + * assert item != 'callback' + * return getattr(self.callback, item) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __pyx_v_self->callback; + __Pyx_INCREF(__pyx_t_2); + __pyx_t_3 = __Pyx_GetAttr(__pyx_t_2, __pyx_v_item); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 86, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "src/gevent/greenlet.py":84 + * return repr(self.callback) + * + * def __getattr__(self, item): # <<<<<<<<<<<<<< + * assert item != 'callback' + * return getattr(self.callback, item) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("gevent._greenlet.SpawnedLink.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/_greenlet.pxd":57 + * + * cdef class SpawnedLink: + * cdef public object callback # <<<<<<<<<<<<<< + * + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_9_greenlet_11SpawnedLink_8callback_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_9_greenlet_11SpawnedLink_8callback_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_9_greenlet_11SpawnedLink_8callback___get__(((struct __pyx_obj_6gevent_9_greenlet_SpawnedLink *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_9_greenlet_11SpawnedLink_8callback___get__(struct __pyx_obj_6gevent_9_greenlet_SpawnedLink *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->callback); + __pyx_r = __pyx_v_self->callback; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6gevent_9_greenlet_11SpawnedLink_8callback_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6gevent_9_greenlet_11SpawnedLink_8callback_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_9_greenlet_11SpawnedLink_8callback_2__set__(((struct __pyx_obj_6gevent_9_greenlet_SpawnedLink *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_9_greenlet_11SpawnedLink_8callback_2__set__(struct __pyx_obj_6gevent_9_greenlet_SpawnedLink *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__", 0); + __Pyx_INCREF(__pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + __Pyx_GOTREF(__pyx_v_self->callback); + __Pyx_DECREF(__pyx_v_self->callback); + __pyx_v_self->callback = __pyx_v_value; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6gevent_9_greenlet_11SpawnedLink_8callback_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6gevent_9_greenlet_11SpawnedLink_8callback_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_9_greenlet_11SpawnedLink_8callback_4__del__(((struct __pyx_obj_6gevent_9_greenlet_SpawnedLink *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_9_greenlet_11SpawnedLink_8callback_4__del__(struct __pyx_obj_6gevent_9_greenlet_SpawnedLink *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->callback); + __Pyx_DECREF(__pyx_v_self->callback); + __pyx_v_self->callback = Py_None; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/greenlet.py":96 + * __slots__ = [] + * + * def __call__(self, source): # <<<<<<<<<<<<<< + * if source.successful(): + * return SpawnedLink.__call__(self, source) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_9_greenlet_18SuccessSpawnedLink_1__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6gevent_9_greenlet_18SuccessSpawnedLink_1__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_source = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__call__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_source,0}; + PyObject* values[1] = {0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_source)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__call__") < 0)) __PYX_ERR(0, 96, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + } + __pyx_v_source = values[0]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__call__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 96, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent._greenlet.SuccessSpawnedLink.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_9_greenlet_18SuccessSpawnedLink___call__(((struct __pyx_obj_6gevent_9_greenlet_SuccessSpawnedLink *)__pyx_v_self), __pyx_v_source); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_9_greenlet_18SuccessSpawnedLink___call__(struct __pyx_obj_6gevent_9_greenlet_SuccessSpawnedLink *__pyx_v_self, PyObject *__pyx_v_source) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + __Pyx_RefNannySetupContext("__call__", 0); + + /* "src/gevent/greenlet.py":97 + * + * def __call__(self, source): + * if source.successful(): # <<<<<<<<<<<<<< + * return SpawnedLink.__call__(self, source) + * + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_source, __pyx_n_s_successful); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 97, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 97, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 97, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_4) { + + /* "src/gevent/greenlet.py":98 + * def __call__(self, source): + * if source.successful(): + * return SpawnedLink.__call__(self, source) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_6gevent_9_greenlet_SpawnedLink), __pyx_n_s_call); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 98, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + __pyx_t_5 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_5 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[3] = {__pyx_t_3, ((PyObject *)__pyx_v_self), __pyx_v_source}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 98, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[3] = {__pyx_t_3, ((PyObject *)__pyx_v_self), __pyx_v_source}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 98, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else + #endif + { + __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 98, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (__pyx_t_3) { + __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); __pyx_t_3 = NULL; + } + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, ((PyObject *)__pyx_v_self)); + __Pyx_INCREF(__pyx_v_source); + __Pyx_GIVEREF(__pyx_v_source); + PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_source); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 98, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "src/gevent/greenlet.py":97 + * + * def __call__(self, source): + * if source.successful(): # <<<<<<<<<<<<<< + * return SpawnedLink.__call__(self, source) + * + */ + } + + /* "src/gevent/greenlet.py":96 + * __slots__ = [] + * + * def __call__(self, source): # <<<<<<<<<<<<<< + * if source.successful(): + * return SpawnedLink.__call__(self, source) + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("gevent._greenlet.SuccessSpawnedLink.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/greenlet.py":108 + * __slots__ = [] + * + * def __call__(self, source): # <<<<<<<<<<<<<< + * if not source.successful(): + * return SpawnedLink.__call__(self, source) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_9_greenlet_18FailureSpawnedLink_1__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6gevent_9_greenlet_18FailureSpawnedLink_1__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_source = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__call__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_source,0}; + PyObject* values[1] = {0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_source)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__call__") < 0)) __PYX_ERR(0, 108, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + } + __pyx_v_source = values[0]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__call__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 108, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent._greenlet.FailureSpawnedLink.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_9_greenlet_18FailureSpawnedLink___call__(((struct __pyx_obj_6gevent_9_greenlet_FailureSpawnedLink *)__pyx_v_self), __pyx_v_source); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_9_greenlet_18FailureSpawnedLink___call__(struct __pyx_obj_6gevent_9_greenlet_FailureSpawnedLink *__pyx_v_self, PyObject *__pyx_v_source) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_t_5; + int __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + __Pyx_RefNannySetupContext("__call__", 0); + + /* "src/gevent/greenlet.py":109 + * + * def __call__(self, source): + * if not source.successful(): # <<<<<<<<<<<<<< + * return SpawnedLink.__call__(self, source) + * + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_source, __pyx_n_s_successful); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 109, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 109, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 109, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_5 = ((!__pyx_t_4) != 0); + if (__pyx_t_5) { + + /* "src/gevent/greenlet.py":110 + * def __call__(self, source): + * if not source.successful(): + * return SpawnedLink.__call__(self, source) # <<<<<<<<<<<<<< + * + * class _Frame(object): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_6gevent_9_greenlet_SpawnedLink), __pyx_n_s_call); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 110, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + __pyx_t_6 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_6 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[3] = {__pyx_t_3, ((PyObject *)__pyx_v_self), __pyx_v_source}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 110, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[3] = {__pyx_t_3, ((PyObject *)__pyx_v_self), __pyx_v_source}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 110, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else + #endif + { + __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 110, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + if (__pyx_t_3) { + __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3); __pyx_t_3 = NULL; + } + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, ((PyObject *)__pyx_v_self)); + __Pyx_INCREF(__pyx_v_source); + __Pyx_GIVEREF(__pyx_v_source); + PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_source); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 110, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "src/gevent/greenlet.py":109 + * + * def __call__(self, source): + * if not source.successful(): # <<<<<<<<<<<<<< + * return SpawnedLink.__call__(self, source) + * + */ + } + + /* "src/gevent/greenlet.py":108 + * __slots__ = [] + * + * def __call__(self, source): # <<<<<<<<<<<<<< + * if not source.successful(): + * return SpawnedLink.__call__(self, source) + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("gevent._greenlet.FailureSpawnedLink.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/greenlet.py":116 + * __slots__ = ('f_code', 'f_lineno', 'f_back') + * + * def __init__(self, f_code, f_lineno, f_back): # <<<<<<<<<<<<<< + * self.f_code = f_code + * self.f_lineno = f_lineno + */ + +/* Python wrapper */ +static int __pyx_pw_6gevent_9_greenlet_6_Frame_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6gevent_9_greenlet_6_Frame_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_f_code = 0; + PyObject *__pyx_v_f_lineno = 0; + PyObject *__pyx_v_f_back = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_f_code,&__pyx_n_s_f_lineno,&__pyx_n_s_f_back,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_f_code)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_f_lineno)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 1); __PYX_ERR(0, 116, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_f_back)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 2); __PYX_ERR(0, 116, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 116, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + } + __pyx_v_f_code = values[0]; + __pyx_v_f_lineno = values[1]; + __pyx_v_f_back = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 116, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent._greenlet._Frame.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_9_greenlet_6_Frame___init__(((struct __pyx_obj_6gevent_9_greenlet__Frame *)__pyx_v_self), __pyx_v_f_code, __pyx_v_f_lineno, __pyx_v_f_back); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_9_greenlet_6_Frame___init__(struct __pyx_obj_6gevent_9_greenlet__Frame *__pyx_v_self, PyObject *__pyx_v_f_code, PyObject *__pyx_v_f_lineno, PyObject *__pyx_v_f_back) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "src/gevent/greenlet.py":117 + * + * def __init__(self, f_code, f_lineno, f_back): + * self.f_code = f_code # <<<<<<<<<<<<<< + * self.f_lineno = f_lineno + * self.f_back = f_back + */ + if (!(likely(((__pyx_v_f_code) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_f_code, __pyx_ptype_6gevent_9_greenlet_CodeType))))) __PYX_ERR(0, 117, __pyx_L1_error) + __pyx_t_1 = __pyx_v_f_code; + __Pyx_INCREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_self->f_code); + __Pyx_DECREF(((PyObject *)__pyx_v_self->f_code)); + __pyx_v_self->f_code = ((PyCodeObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "src/gevent/greenlet.py":118 + * def __init__(self, f_code, f_lineno, f_back): + * self.f_code = f_code + * self.f_lineno = f_lineno # <<<<<<<<<<<<<< + * self.f_back = f_back + * + */ + __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_f_lineno); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 118, __pyx_L1_error) + __pyx_v_self->f_lineno = __pyx_t_2; + + /* "src/gevent/greenlet.py":119 + * self.f_code = f_code + * self.f_lineno = f_lineno + * self.f_back = f_back # <<<<<<<<<<<<<< + * + * @property + */ + if (!(likely(((__pyx_v_f_back) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_f_back, __pyx_ptype_6gevent_9_greenlet__Frame))))) __PYX_ERR(0, 119, __pyx_L1_error) + __pyx_t_1 = __pyx_v_f_back; + __Pyx_INCREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_self->f_back); + __Pyx_DECREF(((PyObject *)__pyx_v_self->f_back)); + __pyx_v_self->f_back = ((struct __pyx_obj_6gevent_9_greenlet__Frame *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "src/gevent/greenlet.py":116 + * __slots__ = ('f_code', 'f_lineno', 'f_back') + * + * def __init__(self, f_code, f_lineno, f_back): # <<<<<<<<<<<<<< + * self.f_code = f_code + * self.f_lineno = f_lineno + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent._greenlet._Frame.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/greenlet.py":122 + * + * @property + * def f_globals(self): # <<<<<<<<<<<<<< + * return None + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_9_greenlet_6_Frame_9f_globals_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_9_greenlet_6_Frame_9f_globals_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_9_greenlet_6_Frame_9f_globals___get__(((struct __pyx_obj_6gevent_9_greenlet__Frame *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_9_greenlet_6_Frame_9f_globals___get__(CYTHON_UNUSED struct __pyx_obj_6gevent_9_greenlet__Frame *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + + /* "src/gevent/greenlet.py":123 + * @property + * def f_globals(self): + * return None # <<<<<<<<<<<<<< + * + * def _Frame_from_list(frames): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + + /* "src/gevent/greenlet.py":122 + * + * @property + * def f_globals(self): # <<<<<<<<<<<<<< + * return None + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/_greenlet.pxd":72 + * @cython.freelist(1000) + * cdef class _Frame: + * cdef readonly CodeType f_code # <<<<<<<<<<<<<< + * cdef readonly int f_lineno + * cdef readonly _Frame f_back + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_9_greenlet_6_Frame_6f_code_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_9_greenlet_6_Frame_6f_code_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_9_greenlet_6_Frame_6f_code___get__(((struct __pyx_obj_6gevent_9_greenlet__Frame *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_9_greenlet_6_Frame_6f_code___get__(struct __pyx_obj_6gevent_9_greenlet__Frame *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_self->f_code)); + __pyx_r = ((PyObject *)__pyx_v_self->f_code); + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/_greenlet.pxd":73 + * cdef class _Frame: + * cdef readonly CodeType f_code + * cdef readonly int f_lineno # <<<<<<<<<<<<<< + * cdef readonly _Frame f_back + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_9_greenlet_6_Frame_8f_lineno_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_9_greenlet_6_Frame_8f_lineno_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_9_greenlet_6_Frame_8f_lineno___get__(((struct __pyx_obj_6gevent_9_greenlet__Frame *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_9_greenlet_6_Frame_8f_lineno___get__(struct __pyx_obj_6gevent_9_greenlet__Frame *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->f_lineno); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 73, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent._greenlet._Frame.f_lineno.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/_greenlet.pxd":74 + * cdef readonly CodeType f_code + * cdef readonly int f_lineno + * cdef readonly _Frame f_back # <<<<<<<<<<<<<< + * + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_9_greenlet_6_Frame_6f_back_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_9_greenlet_6_Frame_6f_back_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_9_greenlet_6_Frame_6f_back___get__(((struct __pyx_obj_6gevent_9_greenlet__Frame *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_9_greenlet_6_Frame_6f_back___get__(struct __pyx_obj_6gevent_9_greenlet__Frame *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_self->f_back)); + __pyx_r = ((PyObject *)__pyx_v_self->f_back); + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/greenlet.py":125 + * return None + * + * def _Frame_from_list(frames): # <<<<<<<<<<<<<< + * previous = None + * for frame in reversed(frames): + */ + +static struct __pyx_obj_6gevent_9_greenlet__Frame *__pyx_f_6gevent_9_greenlet__Frame_from_list(PyObject *__pyx_v_frames) { + struct __pyx_obj_6gevent_9_greenlet__Frame *__pyx_v_previous = 0; + PyObject *__pyx_v_frame = 0; + struct __pyx_obj_6gevent_9_greenlet__Frame *__pyx_v_f = 0; + struct __pyx_obj_6gevent_9_greenlet__Frame *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + __Pyx_RefNannySetupContext("_Frame_from_list", 0); + + /* "src/gevent/greenlet.py":126 + * + * def _Frame_from_list(frames): + * previous = None # <<<<<<<<<<<<<< + * for frame in reversed(frames): + * f = _Frame(frame[0], frame[1], previous) + */ + __Pyx_INCREF(Py_None); + __pyx_v_previous = ((struct __pyx_obj_6gevent_9_greenlet__Frame *)Py_None); + + /* "src/gevent/greenlet.py":127 + * def _Frame_from_list(frames): + * previous = None + * for frame in reversed(frames): # <<<<<<<<<<<<<< + * f = _Frame(frame[0], frame[1], previous) + * previous = f + */ + if (unlikely(__pyx_v_frames == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); + __PYX_ERR(0, 127, __pyx_L1_error) + } + __pyx_t_1 = __pyx_v_frames; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = PyList_GET_SIZE(__pyx_t_1) - 1; + for (;;) { + if (__pyx_t_2 < 0) break; + if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2--; if (unlikely(0 < 0)) __PYX_ERR(0, 127, __pyx_L1_error) + #else + __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2--; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 127, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + #endif + if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(0, 127, __pyx_L1_error) + __Pyx_XDECREF_SET(__pyx_v_frame, ((PyObject*)__pyx_t_3)); + __pyx_t_3 = 0; + + /* "src/gevent/greenlet.py":128 + * previous = None + * for frame in reversed(frames): + * f = _Frame(frame[0], frame[1], previous) # <<<<<<<<<<<<<< + * previous = f + * return previous + */ + if (unlikely(__pyx_v_frame == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 128, __pyx_L1_error) + } + __pyx_t_3 = __Pyx_GetItemInt_Tuple(__pyx_v_frame, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 128, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (unlikely(__pyx_v_frame == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 128, __pyx_L1_error) + } + __pyx_t_4 = __Pyx_GetItemInt_Tuple(__pyx_v_frame, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 128, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 128, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4); + __Pyx_INCREF(((PyObject *)__pyx_v_previous)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_previous)); + PyTuple_SET_ITEM(__pyx_t_5, 2, ((PyObject *)__pyx_v_previous)); + __pyx_t_3 = 0; + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6gevent_9_greenlet__Frame), __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 128, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF_SET(__pyx_v_f, ((struct __pyx_obj_6gevent_9_greenlet__Frame *)__pyx_t_4)); + __pyx_t_4 = 0; + + /* "src/gevent/greenlet.py":129 + * for frame in reversed(frames): + * f = _Frame(frame[0], frame[1], previous) + * previous = f # <<<<<<<<<<<<<< + * return previous + * + */ + __Pyx_INCREF(((PyObject *)__pyx_v_f)); + __Pyx_DECREF_SET(__pyx_v_previous, __pyx_v_f); + + /* "src/gevent/greenlet.py":127 + * def _Frame_from_list(frames): + * previous = None + * for frame in reversed(frames): # <<<<<<<<<<<<<< + * f = _Frame(frame[0], frame[1], previous) + * previous = f + */ + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/greenlet.py":130 + * f = _Frame(frame[0], frame[1], previous) + * previous = f + * return previous # <<<<<<<<<<<<<< + * + * def _extract_stack(limit): + */ + __Pyx_XDECREF(((PyObject *)__pyx_r)); + __Pyx_INCREF(((PyObject *)__pyx_v_previous)); + __pyx_r = __pyx_v_previous; + goto __pyx_L0; + + /* "src/gevent/greenlet.py":125 + * return None + * + * def _Frame_from_list(frames): # <<<<<<<<<<<<<< + * previous = None + * for frame in reversed(frames): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("gevent._greenlet._Frame_from_list", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_previous); + __Pyx_XDECREF(__pyx_v_frame); + __Pyx_XDECREF((PyObject *)__pyx_v_f); + __Pyx_XGIVEREF((PyObject *)__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/greenlet.py":132 + * return previous + * + * def _extract_stack(limit): # <<<<<<<<<<<<<< + * try: + * frame = sys_getframe() + */ + +static CYTHON_INLINE PyObject *__pyx_f_6gevent_9_greenlet__extract_stack(int __pyx_v_limit) { + PyObject *__pyx_v_frames = 0; + PyFrameObject *__pyx_v_frame = 0; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + int __pyx_t_8; + int __pyx_t_9; + int __pyx_t_10; + int __pyx_t_11; + __Pyx_RefNannySetupContext("_extract_stack", 0); + + /* "src/gevent/greenlet.py":133 + * + * def _extract_stack(limit): + * try: # <<<<<<<<<<<<<< + * frame = sys_getframe() + * except ValueError: + */ + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "src/gevent/greenlet.py":134 + * def _extract_stack(limit): + * try: + * frame = sys_getframe() # <<<<<<<<<<<<<< + * except ValueError: + * # In certain embedded cases that directly use the Python C api + */ + __Pyx_INCREF(__pyx_v_6gevent_9_greenlet_sys_getframe); + __pyx_t_5 = __pyx_v_6gevent_9_greenlet_sys_getframe; __pyx_t_6 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); + if (likely(__pyx_t_6)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_5, function); + } + } + __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 134, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_6gevent_9_greenlet_FrameType))))) __PYX_ERR(0, 134, __pyx_L3_error) + __pyx_v_frame = ((PyFrameObject *)__pyx_t_4); + __pyx_t_4 = 0; + + /* "src/gevent/greenlet.py":133 + * + * def _extract_stack(limit): + * try: # <<<<<<<<<<<<<< + * frame = sys_getframe() + * except ValueError: + */ + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L8_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "src/gevent/greenlet.py":135 + * try: + * frame = sys_getframe() + * except ValueError: # <<<<<<<<<<<<<< + * # In certain embedded cases that directly use the Python C api + * # to call Greenlet.spawn (e.g., uwsgi) this can raise + */ + __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ValueError); + if (__pyx_t_7) { + __Pyx_AddTraceback("gevent._greenlet._extract_stack", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6) < 0) __PYX_ERR(0, 135, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_6); + + /* "src/gevent/greenlet.py":143 + * # not the Python level. + * # See https://github.com/gevent/gevent/issues/1212 + * frame = None # <<<<<<<<<<<<<< + * + * frames = [] + */ + __Pyx_INCREF(Py_None); + __Pyx_XDECREF_SET(__pyx_v_frame, ((PyFrameObject *)Py_None)); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + + /* "src/gevent/greenlet.py":133 + * + * def _extract_stack(limit): + * try: # <<<<<<<<<<<<<< + * frame = sys_getframe() + * except ValueError: + */ + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L8_try_end:; + } + + /* "src/gevent/greenlet.py":145 + * frame = None + * + * frames = [] # <<<<<<<<<<<<<< + * + * while limit and frame is not None: + */ + __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 145, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_v_frames = ((PyObject*)__pyx_t_6); + __pyx_t_6 = 0; + + /* "src/gevent/greenlet.py":147 + * frames = [] + * + * while limit and frame is not None: # <<<<<<<<<<<<<< + * limit -= 1 + * frames.append((frame.f_code, frame.f_lineno)) + */ + while (1) { + __pyx_t_9 = (__pyx_v_limit != 0); + if (__pyx_t_9) { + } else { + __pyx_t_8 = __pyx_t_9; + goto __pyx_L13_bool_binop_done; + } + __pyx_t_9 = (((PyObject *)__pyx_v_frame) != Py_None); + __pyx_t_10 = (__pyx_t_9 != 0); + __pyx_t_8 = __pyx_t_10; + __pyx_L13_bool_binop_done:; + if (!__pyx_t_8) break; + + /* "src/gevent/greenlet.py":148 + * + * while limit and frame is not None: + * limit -= 1 # <<<<<<<<<<<<<< + * frames.append((frame.f_code, frame.f_lineno)) + * frame = frame.f_back + */ + __pyx_v_limit = (__pyx_v_limit - 1); + + /* "src/gevent/greenlet.py":149 + * while limit and frame is not None: + * limit -= 1 + * frames.append((frame.f_code, frame.f_lineno)) # <<<<<<<<<<<<<< + * frame = frame.f_back + * + */ + __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_frame->f_lineno); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 149, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 149, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(((PyObject *)__pyx_v_frame->f_code)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_frame->f_code)); + PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_frame->f_code)); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_frames, __pyx_t_5); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 149, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "src/gevent/greenlet.py":150 + * limit -= 1 + * frames.append((frame.f_code, frame.f_lineno)) + * frame = frame.f_back # <<<<<<<<<<<<<< + * + * return frames + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_frame), __pyx_n_s_f_back); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 150, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_6gevent_9_greenlet_FrameType))))) __PYX_ERR(0, 150, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_frame, ((PyFrameObject *)__pyx_t_5)); + __pyx_t_5 = 0; + } + + /* "src/gevent/greenlet.py":152 + * frame = frame.f_back + * + * return frames # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_frames); + __pyx_r = __pyx_v_frames; + goto __pyx_L0; + + /* "src/gevent/greenlet.py":132 + * return previous + * + * def _extract_stack(limit): # <<<<<<<<<<<<<< + * try: + * frame = sys_getframe() + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("gevent._greenlet._extract_stack", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_frames); + __Pyx_XDECREF((PyObject *)__pyx_v_frame); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/greenlet.py":166 + * + * # pylint:disable=keyword-arg-before-vararg,super-init-not-called + * def __init__(self, run=None, *args, **kwargs): # <<<<<<<<<<<<<< + * """ + * :param args: The arguments passed to the ``run`` function. + */ + +/* Python wrapper */ +static int __pyx_pw_6gevent_9_greenlet_8Greenlet_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6gevent_9_greenlet_8Greenlet___init__[] = "\n :param args: The arguments passed to the ``run`` function.\n :param kwargs: The keyword arguments passed to the ``run`` function.\n :keyword callable run: The callable object to run. If not given, this object's\n `_run` method will be invoked (typically defined by subclasses).\n\n .. versionchanged:: 1.1b1\n The ``run`` argument to the constructor is now verified to be a callable\n object. Previously, passing a non-callable object would fail after the greenlet\n was spawned.\n\n .. versionchanged:: 1.3b1\n The ``GEVENT_TRACK_GREENLET_TREE`` configuration value may be set to\n a false value to disable ``spawn_tree_locals``, ``spawning_greenlet``,\n and ``spawning_stack``. The first two will be None in that case, and the\n latter will be empty.\n "; +#if CYTHON_COMPILING_IN_CPYTHON +struct wrapperbase __pyx_wrapperbase_6gevent_9_greenlet_8Greenlet___init__; +#endif +static int __pyx_pw_6gevent_9_greenlet_8Greenlet_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_run = 0; + PyObject *__pyx_v_args = 0; + PyObject *__pyx_v_kwargs = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return -1; + __Pyx_GOTREF(__pyx_v_kwargs); + if (PyTuple_GET_SIZE(__pyx_args) > 1) { + __pyx_v_args = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args)); + if (unlikely(!__pyx_v_args)) { + __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0; + __Pyx_RefNannyFinishContext(); + return -1; + } + __Pyx_GOTREF(__pyx_v_args); + } else { + __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple); + } + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_run,0}; + PyObject* values[1] = {0}; + values[0] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + default: + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_run); + if (value) { values[0] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, used_pos_args, "__init__") < 0)) __PYX_ERR(0, 166, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + default: + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + } + } + __pyx_v_run = values[0]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0; + __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0; + __Pyx_AddTraceback("gevent._greenlet.Greenlet.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_9_greenlet_8Greenlet___init__(((struct __pyx_obj_6gevent_9_greenlet_Greenlet *)__pyx_v_self), __pyx_v_run, __pyx_v_args, __pyx_v_kwargs); + + /* function exit code */ + __Pyx_XDECREF(__pyx_v_args); + __Pyx_XDECREF(__pyx_v_kwargs); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_9_greenlet_8Greenlet___init__(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self, PyObject *__pyx_v_run, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) { + PyGreenlet *__pyx_v_spawner = NULL; + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + int __pyx_t_12; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "src/gevent/greenlet.py":213 + * + * + * _greenlet__init__(self, None, get_hub()) # <<<<<<<<<<<<<< + * + * if run is not None: + */ + __pyx_t_2 = ((PyObject *)__pyx_f_6gevent_11__hub_local_get_hub_noargs(0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 213, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_6gevent_9_greenlet__greenlet__init__); + __pyx_t_3 = __pyx_v_6gevent_9_greenlet__greenlet__init__; __pyx_t_4 = NULL; + __pyx_t_5 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_5 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_3)) { + PyObject *__pyx_temp[4] = {__pyx_t_4, ((PyObject *)__pyx_v_self), Py_None, __pyx_t_2}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 213, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { + PyObject *__pyx_temp[4] = {__pyx_t_4, ((PyObject *)__pyx_v_self), Py_None, __pyx_t_2}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 213, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } else + #endif + { + __pyx_t_6 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 213, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (__pyx_t_4) { + __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL; + } + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, ((PyObject *)__pyx_v_self)); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, Py_None); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 213, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/greenlet.py":215 + * _greenlet__init__(self, None, get_hub()) + * + * if run is not None: # <<<<<<<<<<<<<< + * self._run = run + * + */ + __pyx_t_7 = (__pyx_v_run != Py_None); + __pyx_t_8 = (__pyx_t_7 != 0); + if (__pyx_t_8) { + + /* "src/gevent/greenlet.py":216 + * + * if run is not None: + * self._run = run # <<<<<<<<<<<<<< + * + * # If they didn't pass a callable at all, then they must + */ + if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_run_2, __pyx_v_run) < 0) __PYX_ERR(0, 216, __pyx_L1_error) + + /* "src/gevent/greenlet.py":215 + * _greenlet__init__(self, None, get_hub()) + * + * if run is not None: # <<<<<<<<<<<<<< + * self._run = run + * + */ + } + + /* "src/gevent/greenlet.py":221 + * # already have one. Note that subclassing to override the run() method + * # itself has never been documented or supported. + * if not callable(self._run): # <<<<<<<<<<<<<< + * raise TypeError("The run argument or self._run must be callable") + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_run_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 221, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_8 = __Pyx_PyCallable_Check(__pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 221, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_7 = ((!(__pyx_t_8 != 0)) != 0); + if (unlikely(__pyx_t_7)) { + + /* "src/gevent/greenlet.py":222 + * # itself has never been documented or supported. + * if not callable(self._run): + * raise TypeError("The run argument or self._run must be callable") # <<<<<<<<<<<<<< + * + * self.args = args + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 222, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 222, __pyx_L1_error) + + /* "src/gevent/greenlet.py":221 + * # already have one. Note that subclassing to override the run() method + * # itself has never been documented or supported. + * if not callable(self._run): # <<<<<<<<<<<<<< + * raise TypeError("The run argument or self._run must be callable") + * + */ + } + + /* "src/gevent/greenlet.py":224 + * raise TypeError("The run argument or self._run must be callable") + * + * self.args = args # <<<<<<<<<<<<<< + * self.kwargs = kwargs + * self.value = None + */ + __Pyx_INCREF(__pyx_v_args); + __Pyx_GIVEREF(__pyx_v_args); + __Pyx_GOTREF(__pyx_v_self->args); + __Pyx_DECREF(__pyx_v_self->args); + __pyx_v_self->args = __pyx_v_args; + + /* "src/gevent/greenlet.py":225 + * + * self.args = args + * self.kwargs = kwargs # <<<<<<<<<<<<<< + * self.value = None + * + */ + __Pyx_INCREF(__pyx_v_kwargs); + __Pyx_GIVEREF(__pyx_v_kwargs); + __Pyx_GOTREF(__pyx_v_self->kwargs); + __Pyx_DECREF(__pyx_v_self->kwargs); + __pyx_v_self->kwargs = __pyx_v_kwargs; + + /* "src/gevent/greenlet.py":226 + * self.args = args + * self.kwargs = kwargs + * self.value = None # <<<<<<<<<<<<<< + * + * #: An event, such as a timer or a callback that fires. It is established in + */ + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->value); + __Pyx_DECREF(__pyx_v_self->value); + __pyx_v_self->value = Py_None; + + /* "src/gevent/greenlet.py":234 + * #: scheduled for starting. A placeholder _dummy_event is assigned by them to prevent + * #: the greenlet from being started in the future, if necessary. + * self._start_event = None # <<<<<<<<<<<<<< + * + * self._notifier = None + */ + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->_start_event); + __Pyx_DECREF(__pyx_v_self->_start_event); + __pyx_v_self->_start_event = Py_None; + + /* "src/gevent/greenlet.py":236 + * self._start_event = None + * + * self._notifier = None # <<<<<<<<<<<<<< + * self._formatted_info = None + * self._links = [] + */ + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->_notifier); + __Pyx_DECREF(__pyx_v_self->_notifier); + __pyx_v_self->_notifier = Py_None; + + /* "src/gevent/greenlet.py":237 + * + * self._notifier = None + * self._formatted_info = None # <<<<<<<<<<<<<< + * self._links = [] + * self._ident = None + */ + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->_formatted_info); + __Pyx_DECREF(__pyx_v_self->_formatted_info); + __pyx_v_self->_formatted_info = ((PyObject*)Py_None); + + /* "src/gevent/greenlet.py":238 + * self._notifier = None + * self._formatted_info = None + * self._links = [] # <<<<<<<<<<<<<< + * self._ident = None + * + */ + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 238, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_self->_links); + __Pyx_DECREF(__pyx_v_self->_links); + __pyx_v_self->_links = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "src/gevent/greenlet.py":239 + * self._formatted_info = None + * self._links = [] + * self._ident = None # <<<<<<<<<<<<<< + * + * # Initial state: None. + */ + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->_ident); + __Pyx_DECREF(__pyx_v_self->_ident); + __pyx_v_self->_ident = Py_None; + + /* "src/gevent/greenlet.py":244 + * # Completed successfully: (None, None, None) + * # Failed with exception: (t, v, dump_traceback(tb))) + * self._exc_info = None # <<<<<<<<<<<<<< + * + * if GEVENT_CONFIG.track_greenlet_tree: + */ + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->_exc_info); + __Pyx_DECREF(__pyx_v_self->_exc_info); + __pyx_v_self->_exc_info = ((PyObject*)Py_None); + + /* "src/gevent/greenlet.py":246 + * self._exc_info = None + * + * if GEVENT_CONFIG.track_greenlet_tree: # <<<<<<<<<<<<<< + * spawner = getcurrent() # pylint:disable=undefined-variable + * self.spawning_greenlet = wref(spawner) + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_6gevent_9_greenlet_GEVENT_CONFIG, __pyx_n_s_track_greenlet_tree); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 246, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 246, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_7) { + + /* "src/gevent/greenlet.py":247 + * + * if GEVENT_CONFIG.track_greenlet_tree: + * spawner = getcurrent() # pylint:disable=undefined-variable # <<<<<<<<<<<<<< + * self.spawning_greenlet = wref(spawner) + * try: + */ + __pyx_t_1 = ((PyObject *)__pyx_f_6gevent_9_greenlet_getcurrent()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 247, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_spawner = ((PyGreenlet *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "src/gevent/greenlet.py":248 + * if GEVENT_CONFIG.track_greenlet_tree: + * spawner = getcurrent() # pylint:disable=undefined-variable + * self.spawning_greenlet = wref(spawner) # <<<<<<<<<<<<<< + * try: + * self.spawn_tree_locals = spawner.spawn_tree_locals + */ + __Pyx_INCREF(__pyx_v_6gevent_9_greenlet_wref); + __pyx_t_3 = __pyx_v_6gevent_9_greenlet_wref; __pyx_t_6 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_6)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_6, ((PyObject *)__pyx_v_spawner)) : __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_spawner)); + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 248, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_self->spawning_greenlet); + __Pyx_DECREF(__pyx_v_self->spawning_greenlet); + __pyx_v_self->spawning_greenlet = __pyx_t_1; + __pyx_t_1 = 0; + + /* "src/gevent/greenlet.py":249 + * spawner = getcurrent() # pylint:disable=undefined-variable + * self.spawning_greenlet = wref(spawner) + * try: # <<<<<<<<<<<<<< + * self.spawn_tree_locals = spawner.spawn_tree_locals + * except AttributeError: + */ + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); + __Pyx_XGOTREF(__pyx_t_9); + __Pyx_XGOTREF(__pyx_t_10); + __Pyx_XGOTREF(__pyx_t_11); + /*try:*/ { + + /* "src/gevent/greenlet.py":250 + * self.spawning_greenlet = wref(spawner) + * try: + * self.spawn_tree_locals = spawner.spawn_tree_locals # <<<<<<<<<<<<<< + * except AttributeError: + * self.spawn_tree_locals = {} + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_spawner), __pyx_n_s_spawn_tree_locals); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 250, __pyx_L6_error) + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(PyDict_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 250, __pyx_L6_error) + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_self->spawn_tree_locals); + __Pyx_DECREF(__pyx_v_self->spawn_tree_locals); + __pyx_v_self->spawn_tree_locals = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "src/gevent/greenlet.py":249 + * spawner = getcurrent() # pylint:disable=undefined-variable + * self.spawning_greenlet = wref(spawner) + * try: # <<<<<<<<<<<<<< + * self.spawn_tree_locals = spawner.spawn_tree_locals + * except AttributeError: + */ + } + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + goto __pyx_L11_try_end; + __pyx_L6_error:; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/greenlet.py":251 + * try: + * self.spawn_tree_locals = spawner.spawn_tree_locals + * except AttributeError: # <<<<<<<<<<<<<< + * self.spawn_tree_locals = {} + * if spawner.parent is not None: + */ + __pyx_t_5 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_AttributeError); + if (__pyx_t_5) { + __Pyx_AddTraceback("gevent._greenlet.Greenlet.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_3, &__pyx_t_6) < 0) __PYX_ERR(0, 251, __pyx_L8_except_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GOTREF(__pyx_t_6); + + /* "src/gevent/greenlet.py":252 + * self.spawn_tree_locals = spawner.spawn_tree_locals + * except AttributeError: + * self.spawn_tree_locals = {} # <<<<<<<<<<<<<< + * if spawner.parent is not None: + * # The main greenlet has no parent. + */ + __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 252, __pyx_L8_except_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_v_self->spawn_tree_locals); + __Pyx_DECREF(__pyx_v_self->spawn_tree_locals); + __pyx_v_self->spawn_tree_locals = ((PyObject*)__pyx_t_2); + __pyx_t_2 = 0; + + /* "src/gevent/greenlet.py":253 + * except AttributeError: + * self.spawn_tree_locals = {} + * if spawner.parent is not None: # <<<<<<<<<<<<<< + * # The main greenlet has no parent. + * # Its children get separate locals. + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_spawner), __pyx_n_s_parent); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 253, __pyx_L8_except_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_7 = (__pyx_t_2 != Py_None); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_8 = (__pyx_t_7 != 0); + if (__pyx_t_8) { + + /* "src/gevent/greenlet.py":256 + * # The main greenlet has no parent. + * # Its children get separate locals. + * spawner.spawn_tree_locals = self.spawn_tree_locals # <<<<<<<<<<<<<< + * + * self._spawning_stack_frames = _extract_stack(self.spawning_stack_limit) + */ + __pyx_t_2 = __pyx_v_self->spawn_tree_locals; + __Pyx_INCREF(__pyx_t_2); + if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_spawner), __pyx_n_s_spawn_tree_locals, __pyx_t_2) < 0) __PYX_ERR(0, 256, __pyx_L8_except_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/greenlet.py":253 + * except AttributeError: + * self.spawn_tree_locals = {} + * if spawner.parent is not None: # <<<<<<<<<<<<<< + * # The main greenlet has no parent. + * # Its children get separate locals. + */ + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L7_exception_handled; + } + goto __pyx_L8_except_error; + __pyx_L8_except_error:; + + /* "src/gevent/greenlet.py":249 + * spawner = getcurrent() # pylint:disable=undefined-variable + * self.spawning_greenlet = wref(spawner) + * try: # <<<<<<<<<<<<<< + * self.spawn_tree_locals = spawner.spawn_tree_locals + * except AttributeError: + */ + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11); + goto __pyx_L1_error; + __pyx_L7_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11); + __pyx_L11_try_end:; + } + + /* "src/gevent/greenlet.py":258 + * spawner.spawn_tree_locals = self.spawn_tree_locals + * + * self._spawning_stack_frames = _extract_stack(self.spawning_stack_limit) # <<<<<<<<<<<<<< + * self._spawning_stack_frames.extend(getattr(spawner, '_spawning_stack_frames', [])) + * else: + */ + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_spawning_stack_limit); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 258, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_6); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 258, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __pyx_f_6gevent_9_greenlet__extract_stack(__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 258, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_v_self->_spawning_stack_frames); + __Pyx_DECREF(__pyx_v_self->_spawning_stack_frames); + __pyx_v_self->_spawning_stack_frames = ((PyObject*)__pyx_t_6); + __pyx_t_6 = 0; + + /* "src/gevent/greenlet.py":259 + * + * self._spawning_stack_frames = _extract_stack(self.spawning_stack_limit) + * self._spawning_stack_frames.extend(getattr(spawner, '_spawning_stack_frames', [])) # <<<<<<<<<<<<<< + * else: + * # None is the default for all of these in Cython, but we + */ + if (unlikely(__pyx_v_self->_spawning_stack_frames == Py_None)) { + PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "extend"); + __PYX_ERR(0, 259, __pyx_L1_error) + } + __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 259, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_3 = __Pyx_GetAttr3(((PyObject *)__pyx_v_spawner), __pyx_n_s_spawning_stack_frames, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 259, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_12 = __Pyx_PyList_Extend(__pyx_v_self->_spawning_stack_frames, __pyx_t_3); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 259, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "src/gevent/greenlet.py":246 + * self._exc_info = None + * + * if GEVENT_CONFIG.track_greenlet_tree: # <<<<<<<<<<<<<< + * spawner = getcurrent() # pylint:disable=undefined-variable + * self.spawning_greenlet = wref(spawner) + */ + goto __pyx_L5; + } + + /* "src/gevent/greenlet.py":263 + * # None is the default for all of these in Cython, but we + * # need to declare them for pure-Python mode. + * self.spawning_greenlet = None # <<<<<<<<<<<<<< + * self.spawn_tree_locals = None + * self._spawning_stack_frames = None + */ + /*else*/ { + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->spawning_greenlet); + __Pyx_DECREF(__pyx_v_self->spawning_greenlet); + __pyx_v_self->spawning_greenlet = Py_None; + + /* "src/gevent/greenlet.py":264 + * # need to declare them for pure-Python mode. + * self.spawning_greenlet = None + * self.spawn_tree_locals = None # <<<<<<<<<<<<<< + * self._spawning_stack_frames = None + * + */ + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->spawn_tree_locals); + __Pyx_DECREF(__pyx_v_self->spawn_tree_locals); + __pyx_v_self->spawn_tree_locals = ((PyObject*)Py_None); + + /* "src/gevent/greenlet.py":265 + * self.spawning_greenlet = None + * self.spawn_tree_locals = None + * self._spawning_stack_frames = None # <<<<<<<<<<<<<< + * + * @Lazy + */ + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->_spawning_stack_frames); + __Pyx_DECREF(__pyx_v_self->_spawning_stack_frames); + __pyx_v_self->_spawning_stack_frames = ((PyObject*)Py_None); + } + __pyx_L5:; + + /* "src/gevent/greenlet.py":166 + * + * # pylint:disable=keyword-arg-before-vararg,super-init-not-called + * def __init__(self, run=None, *args, **kwargs): # <<<<<<<<<<<<<< + * """ + * :param args: The arguments passed to the ``run`` function. + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("gevent._greenlet.Greenlet.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_spawner); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/greenlet.py":268 + * + * @Lazy + * def spawning_stack(self): # <<<<<<<<<<<<<< + * # Store this in the __dict__. We don't use it from the C + * # code. It's tempting to discard _spawning_stack_frames + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_3spawning_stack(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6gevent_9_greenlet_8Greenlet_2spawning_stack[] = "Greenlet.spawning_stack(self)"; +static PyMethodDef __pyx_mdef_6gevent_9_greenlet_8Greenlet_3spawning_stack = {"spawning_stack", (PyCFunction)__pyx_pw_6gevent_9_greenlet_8Greenlet_3spawning_stack, METH_NOARGS, __pyx_doc_6gevent_9_greenlet_8Greenlet_2spawning_stack}; +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_3spawning_stack(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("spawning_stack (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_9_greenlet_8Greenlet_2spawning_stack(((struct __pyx_obj_6gevent_9_greenlet_Greenlet *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_2spawning_stack(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("spawning_stack", 0); + + /* "src/gevent/greenlet.py":273 + * # after this, but child greenlets may still be created + * # that need it. + * return _Frame_from_list(self._spawning_stack_frames or []) # <<<<<<<<<<<<<< + * + * def _get_minimal_ident(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_self->_spawning_stack_frames); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 273, __pyx_L1_error) + if (!__pyx_t_2) { + } else { + __Pyx_INCREF(__pyx_v_self->_spawning_stack_frames); + __pyx_t_1 = __pyx_v_self->_spawning_stack_frames; + goto __pyx_L3_bool_binop_done; + } + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 273, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_t_3); + __pyx_t_1 = __pyx_t_3; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_L3_bool_binop_done:; + __pyx_t_3 = ((PyObject *)__pyx_f_6gevent_9_greenlet__Frame_from_list(((PyObject*)__pyx_t_1))); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 273, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "src/gevent/greenlet.py":268 + * + * @Lazy + * def spawning_stack(self): # <<<<<<<<<<<<<< + * # Store this in the __dict__. We don't use it from the C + * # code. It's tempting to discard _spawning_stack_frames + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("gevent._greenlet.Greenlet.spawning_stack", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/greenlet.py":275 + * return _Frame_from_list(self._spawning_stack_frames or []) + * + * def _get_minimal_ident(self): # <<<<<<<<<<<<<< + * reg = self.parent.ident_registry + * return reg.get_ident(self) + */ + +static PyObject *__pyx_f_6gevent_9_greenlet_8Greenlet__get_minimal_ident(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self) { + struct __pyx_obj_6gevent_7__ident_IdentRegistry *__pyx_v_reg = 0; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("_get_minimal_ident", 0); + + /* "src/gevent/greenlet.py":276 + * + * def _get_minimal_ident(self): + * reg = self.parent.ident_registry # <<<<<<<<<<<<<< + * return reg.get_ident(self) + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_parent); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 276, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_ident_registry); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 276, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_6gevent_7__ident_IdentRegistry))))) __PYX_ERR(0, 276, __pyx_L1_error) + __pyx_v_reg = ((struct __pyx_obj_6gevent_7__ident_IdentRegistry *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "src/gevent/greenlet.py":277 + * def _get_minimal_ident(self): + * reg = self.parent.ident_registry + * return reg.get_ident(self) # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = ((struct __pyx_vtabstruct_6gevent_7__ident_IdentRegistry *)__pyx_v_reg->__pyx_vtab)->get_ident(__pyx_v_reg, ((PyObject *)__pyx_v_self), 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 277, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "src/gevent/greenlet.py":275 + * return _Frame_from_list(self._spawning_stack_frames or []) + * + * def _get_minimal_ident(self): # <<<<<<<<<<<<<< + * reg = self.parent.ident_registry + * return reg.get_ident(self) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent._greenlet.Greenlet._get_minimal_ident", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_reg); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/greenlet.py":280 + * + * @property + * def minimal_ident(self): # <<<<<<<<<<<<<< + * """ + * A small, unique integer that identifies this object. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_13minimal_ident_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_13minimal_ident_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_9_greenlet_8Greenlet_13minimal_ident___get__(((struct __pyx_obj_6gevent_9_greenlet_Greenlet *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_13minimal_ident___get__(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "src/gevent/greenlet.py":296 + * .. versionadded:: 1.3a2 + * """ + * if self._ident is None: # <<<<<<<<<<<<<< + * self._ident = self._get_minimal_ident() + * return self._ident + */ + __pyx_t_1 = (__pyx_v_self->_ident == Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "src/gevent/greenlet.py":297 + * """ + * if self._ident is None: + * self._ident = self._get_minimal_ident() # <<<<<<<<<<<<<< + * return self._ident + * + */ + __pyx_t_3 = ((struct __pyx_vtabstruct_6gevent_9_greenlet_Greenlet *)__pyx_v_self->__pyx_vtab)->_get_minimal_ident(__pyx_v_self); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 297, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __Pyx_GOTREF(__pyx_v_self->_ident); + __Pyx_DECREF(__pyx_v_self->_ident); + __pyx_v_self->_ident = __pyx_t_3; + __pyx_t_3 = 0; + + /* "src/gevent/greenlet.py":296 + * .. versionadded:: 1.3a2 + * """ + * if self._ident is None: # <<<<<<<<<<<<<< + * self._ident = self._get_minimal_ident() + * return self._ident + */ + } + + /* "src/gevent/greenlet.py":298 + * if self._ident is None: + * self._ident = self._get_minimal_ident() + * return self._ident # <<<<<<<<<<<<<< + * + * @readproperty + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->_ident); + __pyx_r = __pyx_v_self->_ident; + goto __pyx_L0; + + /* "src/gevent/greenlet.py":280 + * + * @property + * def minimal_ident(self): # <<<<<<<<<<<<<< + * """ + * A small, unique integer that identifies this object. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("gevent._greenlet.Greenlet.minimal_ident.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/greenlet.py":301 + * + * @readproperty + * def name(self): # <<<<<<<<<<<<<< + * """ + * The greenlet name. By default, a unique name is constructed using + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_5name(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6gevent_9_greenlet_8Greenlet_4name[] = "Greenlet.name(self)\n\n The greenlet name. By default, a unique name is constructed using\n the :attr:`minimal_ident`. You can assign a string to this\n value to change it. It is shown in the `repr` of this object if it\n has been assigned to or if the `minimal_ident` has already been generated.\n\n .. versionadded:: 1.3a2\n .. versionchanged:: 1.4\n Stop showing generated names in the `repr` when the ``minimal_ident``\n hasn't been requested. This reduces overhead and may be less confusing,\n since ``minimal_ident`` can get reused.\n "; +static PyMethodDef __pyx_mdef_6gevent_9_greenlet_8Greenlet_5name = {"name", (PyCFunction)__pyx_pw_6gevent_9_greenlet_8Greenlet_5name, METH_NOARGS, __pyx_doc_6gevent_9_greenlet_8Greenlet_4name}; +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_5name(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("name (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_9_greenlet_8Greenlet_4name(((struct __pyx_obj_6gevent_9_greenlet_Greenlet *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_4name(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("name", 0); + + /* "src/gevent/greenlet.py":314 + * since ``minimal_ident`` can get reused. + * """ + * return 'Greenlet-%d' % (self.minimal_ident,) # <<<<<<<<<<<<<< + * + * def _raise_exception(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_minimal_ident); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 314, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 314, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_Greenlet_d, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 314, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "src/gevent/greenlet.py":301 + * + * @readproperty + * def name(self): # <<<<<<<<<<<<<< + * """ + * The greenlet name. By default, a unique name is constructed using + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent._greenlet.Greenlet.name", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/greenlet.py":316 + * return 'Greenlet-%d' % (self.minimal_ident,) + * + * def _raise_exception(self): # <<<<<<<<<<<<<< + * reraise(*self.exc_info) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_7_raise_exception(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6gevent_9_greenlet_8Greenlet_6_raise_exception[] = "Greenlet._raise_exception(self)"; +static PyMethodDef __pyx_mdef_6gevent_9_greenlet_8Greenlet_7_raise_exception = {"_raise_exception", (PyCFunction)__pyx_pw_6gevent_9_greenlet_8Greenlet_7_raise_exception, METH_NOARGS, __pyx_doc_6gevent_9_greenlet_8Greenlet_6_raise_exception}; +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_7_raise_exception(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_raise_exception (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_9_greenlet_8Greenlet_6_raise_exception(((struct __pyx_obj_6gevent_9_greenlet_Greenlet *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_6_raise_exception(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("_raise_exception", 0); + + /* "src/gevent/greenlet.py":317 + * + * def _raise_exception(self): + * reraise(*self.exc_info) # <<<<<<<<<<<<<< + * + * @property + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_exc_info); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 317, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PySequence_Tuple(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 317, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_6gevent_9_greenlet_reraise, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 317, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/greenlet.py":316 + * return 'Greenlet-%d' % (self.minimal_ident,) + * + * def _raise_exception(self): # <<<<<<<<<<<<<< + * reraise(*self.exc_info) + * + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent._greenlet.Greenlet._raise_exception", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/greenlet.py":320 + * + * @property + * def loop(self): # <<<<<<<<<<<<<< + * # needed by killall + * return self.parent.loop + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_4loop_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_4loop_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_9_greenlet_8Greenlet_4loop___get__(((struct __pyx_obj_6gevent_9_greenlet_Greenlet *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_4loop___get__(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "src/gevent/greenlet.py":322 + * def loop(self): + * # needed by killall + * return self.parent.loop # <<<<<<<<<<<<<< + * + * def __nonzero__(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_parent); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 322, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_loop); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 322, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "src/gevent/greenlet.py":320 + * + * @property + * def loop(self): # <<<<<<<<<<<<<< + * # needed by killall + * return self.parent.loop + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent._greenlet.Greenlet.loop.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/greenlet.py":324 + * return self.parent.loop + * + * def __nonzero__(self): # <<<<<<<<<<<<<< + * return self._start_event is not None and self._exc_info is None + * try: + */ + +/* Python wrapper */ +static int __pyx_pw_6gevent_9_greenlet_8Greenlet_9__nonzero__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6gevent_9_greenlet_8Greenlet_9__nonzero__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__nonzero__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_9_greenlet_8Greenlet_8__nonzero__(((struct __pyx_obj_6gevent_9_greenlet_Greenlet *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_9_greenlet_8Greenlet_8__nonzero__(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + __Pyx_RefNannySetupContext("__nonzero__", 0); + + /* "src/gevent/greenlet.py":325 + * + * def __nonzero__(self): + * return self._start_event is not None and self._exc_info is None # <<<<<<<<<<<<<< + * try: + * __bool__ = __nonzero__ # Python 3 + */ + __pyx_t_2 = (__pyx_v_self->_start_event != Py_None); + if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L3_bool_binop_done; + } + __pyx_t_2 = (__pyx_v_self->_exc_info == ((PyObject*)Py_None)); + __pyx_t_1 = __pyx_t_2; + __pyx_L3_bool_binop_done:; + __pyx_r = __pyx_t_1; + goto __pyx_L0; + + /* "src/gevent/greenlet.py":324 + * return self.parent.loop + * + * def __nonzero__(self): # <<<<<<<<<<<<<< + * return self._start_event is not None and self._exc_info is None + * try: + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/greenlet.py":348 + * else: + * @property + * def dead(self): # <<<<<<<<<<<<<< + * "Boolean indicating that the greenlet is dead and will not run again." + * return self.__start_cancelled_by_kill() or self.__started_but_aborted() or greenlet.dead.__get__(self) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_4dead_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_4dead_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_9_greenlet_8Greenlet_4dead___get__(((struct __pyx_obj_6gevent_9_greenlet_Greenlet *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_4dead___get__(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "src/gevent/greenlet.py":350 + * def dead(self): + * "Boolean indicating that the greenlet is dead and will not run again." + * return self.__start_cancelled_by_kill() or self.__started_but_aborted() or greenlet.dead.__get__(self) # <<<<<<<<<<<<<< + * + * def __never_started_or_killed(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = ((struct __pyx_vtabstruct_6gevent_9_greenlet_Greenlet *)__pyx_v_self->__pyx_vtab)->__pyx___start_cancelled_by_kill(__pyx_v_self); + if (!__pyx_t_2) { + } else { + __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 350, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L3_bool_binop_done; + } + __pyx_t_2 = ((struct __pyx_vtabstruct_6gevent_9_greenlet_Greenlet *)__pyx_v_self->__pyx_vtab)->__pyx___started_but_aborted(__pyx_v_self); + if (!__pyx_t_2) { + } else { + __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 350, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L3_bool_binop_done; + } + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_6gevent_9_greenlet_greenlet), __pyx_n_s_dead); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 350, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_get); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 350, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_5, function); + } + } + __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_4, ((PyObject *)__pyx_v_self)) : __Pyx_PyObject_CallOneArg(__pyx_t_5, ((PyObject *)__pyx_v_self)); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 350, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_INCREF(__pyx_t_3); + __pyx_t_1 = __pyx_t_3; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_L3_bool_binop_done:; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "src/gevent/greenlet.py":348 + * else: + * @property + * def dead(self): # <<<<<<<<<<<<<< + * "Boolean indicating that the greenlet is dead and will not run again." + * return self.__start_cancelled_by_kill() or self.__started_but_aborted() or greenlet.dead.__get__(self) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("gevent._greenlet.Greenlet.dead.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/greenlet.py":352 + * return self.__start_cancelled_by_kill() or self.__started_but_aborted() or greenlet.dead.__get__(self) + * + * def __never_started_or_killed(self): # <<<<<<<<<<<<<< + * return self._start_event is None + * + */ + +static int __pyx_f_6gevent_9_greenlet_8Greenlet___never_started_or_killed(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("__never_started_or_killed", 0); + + /* "src/gevent/greenlet.py":353 + * + * def __never_started_or_killed(self): + * return self._start_event is None # <<<<<<<<<<<<<< + * + * def __start_pending(self): + */ + __pyx_t_1 = (__pyx_v_self->_start_event == Py_None); + __pyx_r = __pyx_t_1; + goto __pyx_L0; + + /* "src/gevent/greenlet.py":352 + * return self.__start_cancelled_by_kill() or self.__started_but_aborted() or greenlet.dead.__get__(self) + * + * def __never_started_or_killed(self): # <<<<<<<<<<<<<< + * return self._start_event is None + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/greenlet.py":355 + * return self._start_event is None + * + * def __start_pending(self): # <<<<<<<<<<<<<< + * return (self._start_event is not None + * and (self._start_event.pending or getattr(self._start_event, 'active', False))) + */ + +static int __pyx_f_6gevent_9_greenlet_8Greenlet___start_pending(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + __Pyx_RefNannySetupContext("__start_pending", 0); + + /* "src/gevent/greenlet.py":356 + * + * def __start_pending(self): + * return (self._start_event is not None # <<<<<<<<<<<<<< + * and (self._start_event.pending or getattr(self._start_event, 'active', False))) + * + */ + __pyx_t_2 = (__pyx_v_self->_start_event != Py_None); + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + } else { + __pyx_t_1 = __pyx_t_3; + goto __pyx_L3_bool_binop_done; + } + + /* "src/gevent/greenlet.py":357 + * def __start_pending(self): + * return (self._start_event is not None + * and (self._start_event.pending or getattr(self._start_event, 'active', False))) # <<<<<<<<<<<<<< + * + * def __start_cancelled_by_kill(self): + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_start_event, __pyx_n_s_pending); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 357, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 357, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (!__pyx_t_3) { + } else { + __pyx_t_1 = __pyx_t_3; + goto __pyx_L3_bool_binop_done; + } + __pyx_t_4 = __pyx_v_self->_start_event; + __Pyx_INCREF(__pyx_t_4); + __pyx_t_5 = __Pyx_GetAttr3(__pyx_t_4, __pyx_n_s_active, Py_False); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 357, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 357, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_1 = __pyx_t_3; + __pyx_L3_bool_binop_done:; + __pyx_r = __pyx_t_1; + goto __pyx_L0; + + /* "src/gevent/greenlet.py":355 + * return self._start_event is None + * + * def __start_pending(self): # <<<<<<<<<<<<<< + * return (self._start_event is not None + * and (self._start_event.pending or getattr(self._start_event, 'active', False))) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_WriteUnraisable("gevent._greenlet.Greenlet.__start_pending", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/greenlet.py":359 + * and (self._start_event.pending or getattr(self._start_event, 'active', False))) + * + * def __start_cancelled_by_kill(self): # <<<<<<<<<<<<<< + * return self._start_event is _cancelled_start_event + * + */ + +static int __pyx_f_6gevent_9_greenlet_8Greenlet___start_cancelled_by_kill(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("__start_cancelled_by_kill", 0); + + /* "src/gevent/greenlet.py":360 + * + * def __start_cancelled_by_kill(self): + * return self._start_event is _cancelled_start_event # <<<<<<<<<<<<<< + * + * def __start_completed(self): + */ + __pyx_t_1 = (__pyx_v_self->_start_event == ((PyObject *)__pyx_v_6gevent_9_greenlet__cancelled_start_event)); + __pyx_r = __pyx_t_1; + goto __pyx_L0; + + /* "src/gevent/greenlet.py":359 + * and (self._start_event.pending or getattr(self._start_event, 'active', False))) + * + * def __start_cancelled_by_kill(self): # <<<<<<<<<<<<<< + * return self._start_event is _cancelled_start_event + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/greenlet.py":362 + * return self._start_event is _cancelled_start_event + * + * def __start_completed(self): # <<<<<<<<<<<<<< + * return self._start_event is _start_completed_event + * + */ + +static int __pyx_f_6gevent_9_greenlet_8Greenlet___start_completed(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("__start_completed", 0); + + /* "src/gevent/greenlet.py":363 + * + * def __start_completed(self): + * return self._start_event is _start_completed_event # <<<<<<<<<<<<<< + * + * def __started_but_aborted(self): + */ + __pyx_t_1 = (__pyx_v_self->_start_event == ((PyObject *)__pyx_v_6gevent_9_greenlet__start_completed_event)); + __pyx_r = __pyx_t_1; + goto __pyx_L0; + + /* "src/gevent/greenlet.py":362 + * return self._start_event is _cancelled_start_event + * + * def __start_completed(self): # <<<<<<<<<<<<<< + * return self._start_event is _start_completed_event + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/greenlet.py":365 + * return self._start_event is _start_completed_event + * + * def __started_but_aborted(self): # <<<<<<<<<<<<<< + * return (not self.__never_started_or_killed() # we have been started or killed + * and not self.__start_cancelled_by_kill() # we weren't killed, so we must have been started + */ + +static int __pyx_f_6gevent_9_greenlet_8Greenlet___started_but_aborted(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + __Pyx_RefNannySetupContext("__started_but_aborted", 0); + + /* "src/gevent/greenlet.py":366 + * + * def __started_but_aborted(self): + * return (not self.__never_started_or_killed() # we have been started or killed # <<<<<<<<<<<<<< + * and not self.__start_cancelled_by_kill() # we weren't killed, so we must have been started + * and not self.__start_completed() # the start never completed + */ + __pyx_t_2 = ((!(((struct __pyx_vtabstruct_6gevent_9_greenlet_Greenlet *)__pyx_v_self->__pyx_vtab)->__pyx___never_started_or_killed(__pyx_v_self) != 0)) != 0); + if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L3_bool_binop_done; + } + + /* "src/gevent/greenlet.py":367 + * def __started_but_aborted(self): + * return (not self.__never_started_or_killed() # we have been started or killed + * and not self.__start_cancelled_by_kill() # we weren't killed, so we must have been started # <<<<<<<<<<<<<< + * and not self.__start_completed() # the start never completed + * and not self.__start_pending()) # and we're not pending, so we must have been aborted + */ + __pyx_t_2 = ((!(((struct __pyx_vtabstruct_6gevent_9_greenlet_Greenlet *)__pyx_v_self->__pyx_vtab)->__pyx___start_cancelled_by_kill(__pyx_v_self) != 0)) != 0); + if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L3_bool_binop_done; + } + + /* "src/gevent/greenlet.py":368 + * return (not self.__never_started_or_killed() # we have been started or killed + * and not self.__start_cancelled_by_kill() # we weren't killed, so we must have been started + * and not self.__start_completed() # the start never completed # <<<<<<<<<<<<<< + * and not self.__start_pending()) # and we're not pending, so we must have been aborted + * + */ + __pyx_t_2 = ((!(((struct __pyx_vtabstruct_6gevent_9_greenlet_Greenlet *)__pyx_v_self->__pyx_vtab)->__pyx___start_completed(__pyx_v_self) != 0)) != 0); + if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L3_bool_binop_done; + } + + /* "src/gevent/greenlet.py":369 + * and not self.__start_cancelled_by_kill() # we weren't killed, so we must have been started + * and not self.__start_completed() # the start never completed + * and not self.__start_pending()) # and we're not pending, so we must have been aborted # <<<<<<<<<<<<<< + * + * def __cancel_start(self): + */ + __pyx_t_2 = ((!(((struct __pyx_vtabstruct_6gevent_9_greenlet_Greenlet *)__pyx_v_self->__pyx_vtab)->__pyx___start_pending(__pyx_v_self) != 0)) != 0); + __pyx_t_1 = __pyx_t_2; + __pyx_L3_bool_binop_done:; + __pyx_r = __pyx_t_1; + goto __pyx_L0; + + /* "src/gevent/greenlet.py":365 + * return self._start_event is _start_completed_event + * + * def __started_but_aborted(self): # <<<<<<<<<<<<<< + * return (not self.__never_started_or_killed() # we have been started or killed + * and not self.__start_cancelled_by_kill() # we weren't killed, so we must have been started + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/greenlet.py":371 + * and not self.__start_pending()) # and we're not pending, so we must have been aborted + * + * def __cancel_start(self): # <<<<<<<<<<<<<< + * if self._start_event is None: + * # prevent self from ever being started in the future + */ + +static PyObject *__pyx_f_6gevent_9_greenlet_8Greenlet___cancel_start(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + __Pyx_RefNannySetupContext("__cancel_start", 0); + + /* "src/gevent/greenlet.py":372 + * + * def __cancel_start(self): + * if self._start_event is None: # <<<<<<<<<<<<<< + * # prevent self from ever being started in the future + * self._start_event = _cancelled_start_event + */ + __pyx_t_1 = (__pyx_v_self->_start_event == Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "src/gevent/greenlet.py":374 + * if self._start_event is None: + * # prevent self from ever being started in the future + * self._start_event = _cancelled_start_event # <<<<<<<<<<<<<< + * # cancel any pending start event + * # NOTE: If this was a real pending start event, this will leave a + */ + __Pyx_INCREF(((PyObject *)__pyx_v_6gevent_9_greenlet__cancelled_start_event)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_6gevent_9_greenlet__cancelled_start_event)); + __Pyx_GOTREF(__pyx_v_self->_start_event); + __Pyx_DECREF(__pyx_v_self->_start_event); + __pyx_v_self->_start_event = ((PyObject *)__pyx_v_6gevent_9_greenlet__cancelled_start_event); + + /* "src/gevent/greenlet.py":372 + * + * def __cancel_start(self): + * if self._start_event is None: # <<<<<<<<<<<<<< + * # prevent self from ever being started in the future + * self._start_event = _cancelled_start_event + */ + } + + /* "src/gevent/greenlet.py":381 + * # variable copy of that list (in _run_callbacks). This isn't a problem, + * # except for the leak-tests. + * self._start_event.stop() # <<<<<<<<<<<<<< + * self._start_event.close() + * + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_start_event, __pyx_n_s_stop); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 381, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + } + } + __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 381, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "src/gevent/greenlet.py":382 + * # except for the leak-tests. + * self._start_event.stop() + * self._start_event.close() # <<<<<<<<<<<<<< + * + * def __handle_death_before_start(self, args): + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_start_event, __pyx_n_s_close); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 382, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + } + } + __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 382, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "src/gevent/greenlet.py":371 + * and not self.__start_pending()) # and we're not pending, so we must have been aborted + * + * def __cancel_start(self): # <<<<<<<<<<<<<< + * if self._start_event is None: + * # prevent self from ever being started in the future + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("gevent._greenlet.Greenlet.__cancel_start", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/greenlet.py":384 + * self._start_event.close() + * + * def __handle_death_before_start(self, args): # <<<<<<<<<<<<<< + * # args is (t, v, tb) or simply t or v + * if self._exc_info is None and self.dead: + */ + +static PyObject *__pyx_f_6gevent_9_greenlet_8Greenlet___handle_death_before_start(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self, PyObject *__pyx_v_args) { + PyObject *__pyx_v_arg = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + Py_ssize_t __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + __Pyx_RefNannySetupContext("__handle_death_before_start", 0); + __Pyx_INCREF(__pyx_v_args); + + /* "src/gevent/greenlet.py":386 + * def __handle_death_before_start(self, args): + * # args is (t, v, tb) or simply t or v + * if self._exc_info is None and self.dead: # <<<<<<<<<<<<<< + * # the greenlet was never switched to before and it will never be, _report_error was not called + * # the result was not set and the links weren't notified. let's do it here. + */ + __pyx_t_2 = (__pyx_v_self->_exc_info == ((PyObject*)Py_None)); + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + } else { + __pyx_t_1 = __pyx_t_3; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_dead); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 386, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 386, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_1 = __pyx_t_3; + __pyx_L4_bool_binop_done:; + if (__pyx_t_1) { + + /* "src/gevent/greenlet.py":391 + * # checking that self.dead is true is essential, because throw() does not necessarily kill the greenlet + * # (if the exception raised by throw() is caught somewhere inside the greenlet). + * if len(args) == 1: # <<<<<<<<<<<<<< + * arg = args[0] + * #if isinstance(arg, type): + */ + if (unlikely(__pyx_v_args == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + __PYX_ERR(0, 391, __pyx_L1_error) + } + __pyx_t_5 = PyTuple_GET_SIZE(__pyx_v_args); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 391, __pyx_L1_error) + __pyx_t_1 = ((__pyx_t_5 == 1) != 0); + if (__pyx_t_1) { + + /* "src/gevent/greenlet.py":392 + * # (if the exception raised by throw() is caught somewhere inside the greenlet). + * if len(args) == 1: + * arg = args[0] # <<<<<<<<<<<<<< + * #if isinstance(arg, type): + * if type(arg) is type(Exception): + */ + if (unlikely(__pyx_v_args == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 392, __pyx_L1_error) + } + __pyx_t_4 = __Pyx_GetItemInt_Tuple(__pyx_v_args, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 392, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_v_arg = __pyx_t_4; + __pyx_t_4 = 0; + + /* "src/gevent/greenlet.py":394 + * arg = args[0] + * #if isinstance(arg, type): + * if type(arg) is type(Exception): # <<<<<<<<<<<<<< + * args = (arg, arg(), None) + * else: + */ + __pyx_t_1 = (((PyObject *)Py_TYPE(__pyx_v_arg)) == ((PyObject *)Py_TYPE(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))))); + __pyx_t_3 = (__pyx_t_1 != 0); + if (__pyx_t_3) { + + /* "src/gevent/greenlet.py":395 + * #if isinstance(arg, type): + * if type(arg) is type(Exception): + * args = (arg, arg(), None) # <<<<<<<<<<<<<< + * else: + * args = (type(arg), arg, None) + */ + __Pyx_INCREF(__pyx_v_arg); + __pyx_t_6 = __pyx_v_arg; __pyx_t_7 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) { + __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); + if (likely(__pyx_t_7)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); + __Pyx_INCREF(__pyx_t_7); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_6, function); + } + } + __pyx_t_4 = (__pyx_t_7) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7) : __Pyx_PyObject_CallNoArg(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 395, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 395, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(__pyx_v_arg); + __Pyx_GIVEREF(__pyx_v_arg); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_arg); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_4); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + PyTuple_SET_ITEM(__pyx_t_6, 2, Py_None); + __pyx_t_4 = 0; + __Pyx_DECREF_SET(__pyx_v_args, ((PyObject*)__pyx_t_6)); + __pyx_t_6 = 0; + + /* "src/gevent/greenlet.py":394 + * arg = args[0] + * #if isinstance(arg, type): + * if type(arg) is type(Exception): # <<<<<<<<<<<<<< + * args = (arg, arg(), None) + * else: + */ + goto __pyx_L7; + } + + /* "src/gevent/greenlet.py":397 + * args = (arg, arg(), None) + * else: + * args = (type(arg), arg, None) # <<<<<<<<<<<<<< + * elif not args: + * args = (GreenletExit, GreenletExit(), None) + */ + /*else*/ { + __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 397, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_arg))); + __Pyx_GIVEREF(((PyObject *)Py_TYPE(__pyx_v_arg))); + PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)Py_TYPE(__pyx_v_arg))); + __Pyx_INCREF(__pyx_v_arg); + __Pyx_GIVEREF(__pyx_v_arg); + PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_arg); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + PyTuple_SET_ITEM(__pyx_t_6, 2, Py_None); + __Pyx_DECREF_SET(__pyx_v_args, ((PyObject*)__pyx_t_6)); + __pyx_t_6 = 0; + } + __pyx_L7:; + + /* "src/gevent/greenlet.py":391 + * # checking that self.dead is true is essential, because throw() does not necessarily kill the greenlet + * # (if the exception raised by throw() is caught somewhere inside the greenlet). + * if len(args) == 1: # <<<<<<<<<<<<<< + * arg = args[0] + * #if isinstance(arg, type): + */ + goto __pyx_L6; + } + + /* "src/gevent/greenlet.py":398 + * else: + * args = (type(arg), arg, None) + * elif not args: # <<<<<<<<<<<<<< + * args = (GreenletExit, GreenletExit(), None) + * self._report_error(args) + */ + __pyx_t_3 = (__pyx_v_args != Py_None)&&(PyTuple_GET_SIZE(__pyx_v_args) != 0); + __pyx_t_1 = ((!__pyx_t_3) != 0); + if (__pyx_t_1) { + + /* "src/gevent/greenlet.py":399 + * args = (type(arg), arg, None) + * elif not args: + * args = (GreenletExit, GreenletExit(), None) # <<<<<<<<<<<<<< + * self._report_error(args) + * + */ + __Pyx_INCREF(__pyx_v_6gevent_9_greenlet_GreenletExit); + __pyx_t_4 = __pyx_v_6gevent_9_greenlet_GreenletExit; __pyx_t_7 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_7)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_7); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + } + } + __pyx_t_6 = (__pyx_t_7) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_7) : __Pyx_PyObject_CallNoArg(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 399, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 399, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_6gevent_9_greenlet_GreenletExit); + __Pyx_GIVEREF(__pyx_v_6gevent_9_greenlet_GreenletExit); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_6gevent_9_greenlet_GreenletExit); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_6); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + PyTuple_SET_ITEM(__pyx_t_4, 2, Py_None); + __pyx_t_6 = 0; + __Pyx_DECREF_SET(__pyx_v_args, ((PyObject*)__pyx_t_4)); + __pyx_t_4 = 0; + + /* "src/gevent/greenlet.py":398 + * else: + * args = (type(arg), arg, None) + * elif not args: # <<<<<<<<<<<<<< + * args = (GreenletExit, GreenletExit(), None) + * self._report_error(args) + */ + } + __pyx_L6:; + + /* "src/gevent/greenlet.py":400 + * elif not args: + * args = (GreenletExit, GreenletExit(), None) + * self._report_error(args) # <<<<<<<<<<<<<< + * + * @property + */ + __pyx_t_4 = ((struct __pyx_vtabstruct_6gevent_9_greenlet_Greenlet *)__pyx_v_self->__pyx_vtab)->_report_error(__pyx_v_self, __pyx_v_args); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 400, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "src/gevent/greenlet.py":386 + * def __handle_death_before_start(self, args): + * # args is (t, v, tb) or simply t or v + * if self._exc_info is None and self.dead: # <<<<<<<<<<<<<< + * # the greenlet was never switched to before and it will never be, _report_error was not called + * # the result was not set and the links weren't notified. let's do it here. + */ + } + + /* "src/gevent/greenlet.py":384 + * self._start_event.close() + * + * def __handle_death_before_start(self, args): # <<<<<<<<<<<<<< + * # args is (t, v, tb) or simply t or v + * if self._exc_info is None and self.dead: + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("gevent._greenlet.Greenlet.__handle_death_before_start", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_arg); + __Pyx_XDECREF(__pyx_v_args); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/greenlet.py":403 + * + * @property + * def started(self): # <<<<<<<<<<<<<< + * # DEPRECATED + * return bool(self) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_7started_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_7started_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_9_greenlet_8Greenlet_7started___get__(((struct __pyx_obj_6gevent_9_greenlet_Greenlet *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_7started___get__(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "src/gevent/greenlet.py":405 + * def started(self): + * # DEPRECATED + * return bool(self) # <<<<<<<<<<<<<< + * + * def ready(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_self)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 405, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBool_FromLong((!(!__pyx_t_1))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 405, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "src/gevent/greenlet.py":403 + * + * @property + * def started(self): # <<<<<<<<<<<<<< + * # DEPRECATED + * return bool(self) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent._greenlet.Greenlet.started.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/greenlet.py":407 + * return bool(self) + * + * def ready(self): # <<<<<<<<<<<<<< + * """ + * Return a true value if and only if the greenlet has finished + */ + +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_11ready(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static int __pyx_f_6gevent_9_greenlet_8Greenlet_ready(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self, int __pyx_skip_dispatch) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + int __pyx_t_6; + int __pyx_t_7; + __Pyx_RefNannySetupContext("ready", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0; + if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self)))))); + else { + PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + #endif + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_ready); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 407, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_9_greenlet_8Greenlet_11ready)) { + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 407, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 407, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_5; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0; + if (unlikely(type_dict_guard != tp_dict_version)) { + tp_dict_version = obj_dict_version = 0; + } + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + } + #endif + } + + /* "src/gevent/greenlet.py":416 + * necessarily the literal constants ``True`` or ``False``. + * """ + * return self.dead or self._exc_info is not None # <<<<<<<<<<<<<< + * + * def successful(self): + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_dead); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 416, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 416, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!__pyx_t_6) { + } else { + __pyx_t_5 = __pyx_t_6; + goto __pyx_L3_bool_binop_done; + } + __pyx_t_6 = (__pyx_v_self->_exc_info != ((PyObject*)Py_None)); + __pyx_t_7 = (__pyx_t_6 != 0); + __pyx_t_5 = __pyx_t_7; + __pyx_L3_bool_binop_done:; + __pyx_r = __pyx_t_5; + goto __pyx_L0; + + /* "src/gevent/greenlet.py":407 + * return bool(self) + * + * def ready(self): # <<<<<<<<<<<<<< + * """ + * Return a true value if and only if the greenlet has finished + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_WriteUnraisable("gevent._greenlet.Greenlet.ready", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_11ready(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6gevent_9_greenlet_8Greenlet_10ready[] = "Greenlet.ready(self) -> bool\n\n Return a true value if and only if the greenlet has finished\n execution.\n\n .. versionchanged:: 1.1\n This function is only guaranteed to return true or false *values*, not\n necessarily the literal constants ``True`` or ``False``.\n "; +static PyMethodDef __pyx_mdef_6gevent_9_greenlet_8Greenlet_11ready = {"ready", (PyCFunction)__pyx_pw_6gevent_9_greenlet_8Greenlet_11ready, METH_NOARGS, __pyx_doc_6gevent_9_greenlet_8Greenlet_10ready}; +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_11ready(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("ready (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_9_greenlet_8Greenlet_10ready(((struct __pyx_obj_6gevent_9_greenlet_Greenlet *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_10ready(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("ready", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_f_6gevent_9_greenlet_8Greenlet_ready(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 407, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent._greenlet.Greenlet.ready", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/greenlet.py":418 + * return self.dead or self._exc_info is not None + * + * def successful(self): # <<<<<<<<<<<<<< + * """ + * Return a true value if and only if the greenlet has finished execution + */ + +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_13successful(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static int __pyx_f_6gevent_9_greenlet_8Greenlet_successful(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self, int __pyx_skip_dispatch) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + int __pyx_t_6; + int __pyx_t_7; + __Pyx_RefNannySetupContext("successful", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0; + if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self)))))); + else { + PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + #endif + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_successful); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 418, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_9_greenlet_8Greenlet_13successful)) { + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 418, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 418, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_5; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0; + if (unlikely(type_dict_guard != tp_dict_version)) { + tp_dict_version = obj_dict_version = 0; + } + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + } + #endif + } + + /* "src/gevent/greenlet.py":430 + * not necessarily the literal constants ``True`` or ``False``. + * """ + * return self._exc_info is not None and self._exc_info[1] is None # <<<<<<<<<<<<<< + * + * def __repr__(self): + */ + __pyx_t_6 = (__pyx_v_self->_exc_info != ((PyObject*)Py_None)); + __pyx_t_7 = (__pyx_t_6 != 0); + if (__pyx_t_7) { + } else { + __pyx_t_5 = __pyx_t_7; + goto __pyx_L3_bool_binop_done; + } + if (unlikely(__pyx_v_self->_exc_info == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 430, __pyx_L1_error) + } + __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v_self->_exc_info, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 430, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = (__pyx_t_1 == Py_None); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_6 = (__pyx_t_7 != 0); + __pyx_t_5 = __pyx_t_6; + __pyx_L3_bool_binop_done:; + __pyx_r = __pyx_t_5; + goto __pyx_L0; + + /* "src/gevent/greenlet.py":418 + * return self.dead or self._exc_info is not None + * + * def successful(self): # <<<<<<<<<<<<<< + * """ + * Return a true value if and only if the greenlet has finished execution + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_WriteUnraisable("gevent._greenlet.Greenlet.successful", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_13successful(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6gevent_9_greenlet_8Greenlet_12successful[] = "Greenlet.successful(self) -> bool\n\n Return a true value if and only if the greenlet has finished execution\n successfully, that is, without raising an error.\n\n .. tip:: A greenlet that has been killed with the default\n :class:`GreenletExit` exception is considered successful.\n That is, ``GreenletExit`` is not considered an error.\n\n .. note:: This function is only guaranteed to return true or false *values*,\n not necessarily the literal constants ``True`` or ``False``.\n "; +static PyMethodDef __pyx_mdef_6gevent_9_greenlet_8Greenlet_13successful = {"successful", (PyCFunction)__pyx_pw_6gevent_9_greenlet_8Greenlet_13successful, METH_NOARGS, __pyx_doc_6gevent_9_greenlet_8Greenlet_12successful}; +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_13successful(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("successful (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_9_greenlet_8Greenlet_12successful(((struct __pyx_obj_6gevent_9_greenlet_Greenlet *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_12successful(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("successful", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_f_6gevent_9_greenlet_8Greenlet_successful(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 418, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent._greenlet.Greenlet.successful", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/greenlet.py":432 + * return self._exc_info is not None and self._exc_info[1] is None + * + * def __repr__(self): # <<<<<<<<<<<<<< + * classname = self.__class__.__name__ + * # If no name has been assigned, don't generate one, including a minimal_ident, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_15__repr__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_15__repr__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_9_greenlet_8Greenlet_14__repr__(((struct __pyx_obj_6gevent_9_greenlet_Greenlet *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_14__repr__(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self) { + PyObject *__pyx_v_classname = NULL; + PyObject *__pyx_v_name = NULL; + PyObject *__pyx_v_result = NULL; + PyObject *__pyx_v_formatted = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + __Pyx_RefNannySetupContext("__repr__", 0); + + /* "src/gevent/greenlet.py":433 + * + * def __repr__(self): + * classname = self.__class__.__name__ # <<<<<<<<<<<<<< + * # If no name has been assigned, don't generate one, including a minimal_ident, + * # if not necessary. This reduces the use of weak references and associated + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 433, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 433, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_classname = __pyx_t_2; + __pyx_t_2 = 0; + + /* "src/gevent/greenlet.py":437 + * # if not necessary. This reduces the use of weak references and associated + * # overhead. + * if 'name' not in self.__dict__ and self._ident is None: # <<<<<<<<<<<<<< + * name = ' ' + * else: + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_dict); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 437, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = (__Pyx_PySequence_ContainsTF(__pyx_n_s_name_2, __pyx_t_2, Py_NE)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 437, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_5 = (__pyx_t_4 != 0); + if (__pyx_t_5) { + } else { + __pyx_t_3 = __pyx_t_5; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_5 = (__pyx_v_self->_ident == Py_None); + __pyx_t_4 = (__pyx_t_5 != 0); + __pyx_t_3 = __pyx_t_4; + __pyx_L4_bool_binop_done:; + if (__pyx_t_3) { + + /* "src/gevent/greenlet.py":438 + * # overhead. + * if 'name' not in self.__dict__ and self._ident is None: + * name = ' ' # <<<<<<<<<<<<<< + * else: + * name = ' "%s" ' % (self.name,) + */ + __Pyx_INCREF(__pyx_kp_s__2); + __pyx_v_name = __pyx_kp_s__2; + + /* "src/gevent/greenlet.py":437 + * # if not necessary. This reduces the use of weak references and associated + * # overhead. + * if 'name' not in self.__dict__ and self._ident is None: # <<<<<<<<<<<<<< + * name = ' ' + * else: + */ + goto __pyx_L3; + } + + /* "src/gevent/greenlet.py":440 + * name = ' ' + * else: + * name = ' "%s" ' % (self.name,) # <<<<<<<<<<<<<< + * result = '<%s%sat %s' % (classname, name, hex(id(self))) + * formatted = self._formatinfo() + */ + /*else*/ { + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_name_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 440, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 440, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_s, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 440, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_name = __pyx_t_2; + __pyx_t_2 = 0; + } + __pyx_L3:; + + /* "src/gevent/greenlet.py":441 + * else: + * name = ' "%s" ' % (self.name,) + * result = '<%s%sat %s' % (classname, name, hex(id(self))) # <<<<<<<<<<<<<< + * formatted = self._formatinfo() + * if formatted: + */ + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 441, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_hex, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 441, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 441, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_classname); + __Pyx_GIVEREF(__pyx_v_classname); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_classname); + __Pyx_INCREF(__pyx_v_name); + __Pyx_GIVEREF(__pyx_v_name); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_name); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_s_sat_s, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 441, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_result = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "src/gevent/greenlet.py":442 + * name = ' "%s" ' % (self.name,) + * result = '<%s%sat %s' % (classname, name, hex(id(self))) + * formatted = self._formatinfo() # <<<<<<<<<<<<<< + * if formatted: + * result += ': ' + formatted + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_9_greenlet_Greenlet *)__pyx_v_self->__pyx_vtab)->_formatinfo(__pyx_v_self, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 442, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_formatted = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "src/gevent/greenlet.py":443 + * result = '<%s%sat %s' % (classname, name, hex(id(self))) + * formatted = self._formatinfo() + * if formatted: # <<<<<<<<<<<<<< + * result += ': ' + formatted + * return result + '>' + */ + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_formatted); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 443, __pyx_L1_error) + if (__pyx_t_3) { + + /* "src/gevent/greenlet.py":444 + * formatted = self._formatinfo() + * if formatted: + * result += ': ' + formatted # <<<<<<<<<<<<<< + * return result + '>' + * + */ + __pyx_t_1 = PyNumber_Add(__pyx_kp_s__3, __pyx_v_formatted); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 444, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 444, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "src/gevent/greenlet.py":443 + * result = '<%s%sat %s' % (classname, name, hex(id(self))) + * formatted = self._formatinfo() + * if formatted: # <<<<<<<<<<<<<< + * result += ': ' + formatted + * return result + '>' + */ + } + + /* "src/gevent/greenlet.py":445 + * if formatted: + * result += ': ' + formatted + * return result + '>' # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyNumber_Add(__pyx_v_result, __pyx_kp_s__4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 445, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "src/gevent/greenlet.py":432 + * return self._exc_info is not None and self._exc_info[1] is None + * + * def __repr__(self): # <<<<<<<<<<<<<< + * classname = self.__class__.__name__ + * # If no name has been assigned, don't generate one, including a minimal_ident, + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent._greenlet.Greenlet.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_classname); + __Pyx_XDECREF(__pyx_v_name); + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XDECREF(__pyx_v_formatted); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/greenlet.py":448 + * + * + * def _formatinfo(self): # <<<<<<<<<<<<<< + * info = self._formatted_info + * if info is not None: + */ + +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_17_formatinfo(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_f_6gevent_9_greenlet_8Greenlet__formatinfo(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self, int __pyx_skip_dispatch) { + PyObject *__pyx_v_info = NULL; + PyObject *__pyx_v_func = NULL; + PyObject *__pyx_v_im_self = NULL; + PyObject *__pyx_v_funcname = NULL; + PyObject *__pyx_v_result = NULL; + PyObject *__pyx_v_args = NULL; + PyObject *__pyx_7genexpr__pyx_v_x = NULL; + PyObject *__pyx_8genexpr1__pyx_v_key = NULL; + PyObject *__pyx_8genexpr1__pyx_v_value = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + int __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + int __pyx_t_9; + int __pyx_t_10; + int __pyx_t_11; + __Pyx_RefNannySetupContext("_formatinfo", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0; + if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self)))))); + else { + PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + #endif + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_formatinfo); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 448, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_9_greenlet_8Greenlet_17_formatinfo)) { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 448, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (!(likely(PyString_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(0, 448, __pyx_L1_error) + __pyx_r = ((PyObject*)__pyx_t_2); + __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0; + if (unlikely(type_dict_guard != tp_dict_version)) { + tp_dict_version = obj_dict_version = 0; + } + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + } + #endif + } + + /* "src/gevent/greenlet.py":449 + * + * def _formatinfo(self): + * info = self._formatted_info # <<<<<<<<<<<<<< + * if info is not None: + * return info + */ + __pyx_t_1 = __pyx_v_self->_formatted_info; + __Pyx_INCREF(__pyx_t_1); + __pyx_v_info = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "src/gevent/greenlet.py":450 + * def _formatinfo(self): + * info = self._formatted_info + * if info is not None: # <<<<<<<<<<<<<< + * return info + * + */ + __pyx_t_5 = (__pyx_v_info != ((PyObject*)Py_None)); + __pyx_t_6 = (__pyx_t_5 != 0); + if (__pyx_t_6) { + + /* "src/gevent/greenlet.py":451 + * info = self._formatted_info + * if info is not None: + * return info # <<<<<<<<<<<<<< + * + * # Are we running an arbitrary function provided to the constructor, + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_info); + __pyx_r = __pyx_v_info; + goto __pyx_L0; + + /* "src/gevent/greenlet.py":450 + * def _formatinfo(self): + * info = self._formatted_info + * if info is not None: # <<<<<<<<<<<<<< + * return info + * + */ + } + + /* "src/gevent/greenlet.py":455 + * # Are we running an arbitrary function provided to the constructor, + * # or did a subclass override _run? + * func = self._run # <<<<<<<<<<<<<< + * im_self = getattr(func, '__self__', None) + * if im_self is self: + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_run_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 455, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_func = __pyx_t_1; + __pyx_t_1 = 0; + + /* "src/gevent/greenlet.py":456 + * # or did a subclass override _run? + * func = self._run + * im_self = getattr(func, '__self__', None) # <<<<<<<<<<<<<< + * if im_self is self: + * funcname = '_run' + */ + __pyx_t_1 = __Pyx_GetAttr3(__pyx_v_func, __pyx_n_s_self, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 456, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_im_self = __pyx_t_1; + __pyx_t_1 = 0; + + /* "src/gevent/greenlet.py":457 + * func = self._run + * im_self = getattr(func, '__self__', None) + * if im_self is self: # <<<<<<<<<<<<<< + * funcname = '_run' + * elif im_self is not None: + */ + __pyx_t_6 = (__pyx_v_im_self == ((PyObject *)__pyx_v_self)); + __pyx_t_5 = (__pyx_t_6 != 0); + if (__pyx_t_5) { + + /* "src/gevent/greenlet.py":458 + * im_self = getattr(func, '__self__', None) + * if im_self is self: + * funcname = '_run' # <<<<<<<<<<<<<< + * elif im_self is not None: + * funcname = repr(func) + */ + __Pyx_INCREF(__pyx_n_s_run_2); + __pyx_v_funcname = __pyx_n_s_run_2; + + /* "src/gevent/greenlet.py":457 + * func = self._run + * im_self = getattr(func, '__self__', None) + * if im_self is self: # <<<<<<<<<<<<<< + * funcname = '_run' + * elif im_self is not None: + */ + goto __pyx_L4; + } + + /* "src/gevent/greenlet.py":459 + * if im_self is self: + * funcname = '_run' + * elif im_self is not None: # <<<<<<<<<<<<<< + * funcname = repr(func) + * else: + */ + __pyx_t_5 = (__pyx_v_im_self != Py_None); + __pyx_t_6 = (__pyx_t_5 != 0); + if (__pyx_t_6) { + + /* "src/gevent/greenlet.py":460 + * funcname = '_run' + * elif im_self is not None: + * funcname = repr(func) # <<<<<<<<<<<<<< + * else: + * funcname = getattr(func, '__name__', '') or repr(func) + */ + __pyx_t_1 = PyObject_Repr(__pyx_v_func); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 460, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_funcname = __pyx_t_1; + __pyx_t_1 = 0; + + /* "src/gevent/greenlet.py":459 + * if im_self is self: + * funcname = '_run' + * elif im_self is not None: # <<<<<<<<<<<<<< + * funcname = repr(func) + * else: + */ + goto __pyx_L4; + } + + /* "src/gevent/greenlet.py":462 + * funcname = repr(func) + * else: + * funcname = getattr(func, '__name__', '') or repr(func) # <<<<<<<<<<<<<< + * + * result = funcname + */ + /*else*/ { + __pyx_t_2 = __Pyx_GetAttr3(__pyx_v_func, __pyx_n_s_name, __pyx_kp_s__5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 462, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 462, __pyx_L1_error) + if (!__pyx_t_6) { + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } else { + __Pyx_INCREF(__pyx_t_2); + __pyx_t_1 = __pyx_t_2; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + goto __pyx_L5_bool_binop_done; + } + __pyx_t_2 = PyObject_Repr(__pyx_v_func); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 462, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_2); + __pyx_t_1 = __pyx_t_2; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_L5_bool_binop_done:; + __pyx_v_funcname = __pyx_t_1; + __pyx_t_1 = 0; + } + __pyx_L4:; + + /* "src/gevent/greenlet.py":464 + * funcname = getattr(func, '__name__', '') or repr(func) + * + * result = funcname # <<<<<<<<<<<<<< + * args = [] + * if self.args: + */ + __Pyx_INCREF(__pyx_v_funcname); + __pyx_v_result = __pyx_v_funcname; + + /* "src/gevent/greenlet.py":465 + * + * result = funcname + * args = [] # <<<<<<<<<<<<<< + * if self.args: + * args = [repr(x)[:50] for x in self.args] + */ + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 465, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_args = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "src/gevent/greenlet.py":466 + * result = funcname + * args = [] + * if self.args: # <<<<<<<<<<<<<< + * args = [repr(x)[:50] for x in self.args] + * if self.kwargs: + */ + __pyx_t_6 = (__pyx_v_self->args != Py_None)&&(PyTuple_GET_SIZE(__pyx_v_self->args) != 0); + if (__pyx_t_6) { + + /* "src/gevent/greenlet.py":467 + * args = [] + * if self.args: + * args = [repr(x)[:50] for x in self.args] # <<<<<<<<<<<<<< + * if self.kwargs: + * args.extend(['%s=%s' % (key, repr(value)[:50]) for (key, value) in self.kwargs.items()]) + */ + { /* enter inner scope */ + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 467, __pyx_L10_error) + __Pyx_GOTREF(__pyx_t_1); + if (unlikely(__pyx_v_self->args == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); + __PYX_ERR(0, 467, __pyx_L10_error) + } + __pyx_t_2 = __pyx_v_self->args; __Pyx_INCREF(__pyx_t_2); __pyx_t_7 = 0; + for (;;) { + if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_3); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 467, __pyx_L10_error) + #else + __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 467, __pyx_L10_error) + __Pyx_GOTREF(__pyx_t_3); + #endif + __Pyx_XDECREF_SET(__pyx_7genexpr__pyx_v_x, __pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = PyObject_Repr(__pyx_7genexpr__pyx_v_x); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 467, __pyx_L10_error) + __Pyx_GOTREF(__pyx_t_3); + if (unlikely(__pyx_t_3 == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 467, __pyx_L10_error) + } + __pyx_t_4 = PySequence_GetSlice(__pyx_t_3, 0, 50); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 467, __pyx_L10_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_4))) __PYX_ERR(0, 467, __pyx_L10_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_7genexpr__pyx_v_x); __pyx_7genexpr__pyx_v_x = 0; + goto __pyx_L13_exit_scope; + __pyx_L10_error:; + __Pyx_XDECREF(__pyx_7genexpr__pyx_v_x); __pyx_7genexpr__pyx_v_x = 0; + goto __pyx_L1_error; + __pyx_L13_exit_scope:; + } /* exit inner scope */ + __Pyx_DECREF_SET(__pyx_v_args, ((PyObject*)__pyx_t_1)); + __pyx_t_1 = 0; + + /* "src/gevent/greenlet.py":466 + * result = funcname + * args = [] + * if self.args: # <<<<<<<<<<<<<< + * args = [repr(x)[:50] for x in self.args] + * if self.kwargs: + */ + } + + /* "src/gevent/greenlet.py":468 + * if self.args: + * args = [repr(x)[:50] for x in self.args] + * if self.kwargs: # <<<<<<<<<<<<<< + * args.extend(['%s=%s' % (key, repr(value)[:50]) for (key, value) in self.kwargs.items()]) + * if args: + */ + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_self->kwargs); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 468, __pyx_L1_error) + if (__pyx_t_6) { + + /* "src/gevent/greenlet.py":469 + * args = [repr(x)[:50] for x in self.args] + * if self.kwargs: + * args.extend(['%s=%s' % (key, repr(value)[:50]) for (key, value) in self.kwargs.items()]) # <<<<<<<<<<<<<< + * if args: + * result += '(' + ', '.join(args) + ')' + */ + { /* enter inner scope */ + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 469, __pyx_L17_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = 0; + if (unlikely(__pyx_v_self->kwargs == Py_None)) { + PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items"); + __PYX_ERR(0, 469, __pyx_L17_error) + } + __pyx_t_4 = __Pyx_dict_iterator(__pyx_v_self->kwargs, 1, __pyx_n_s_items, (&__pyx_t_8), (&__pyx_t_9)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 469, __pyx_L17_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_2); + __pyx_t_2 = __pyx_t_4; + __pyx_t_4 = 0; + while (1) { + __pyx_t_10 = __Pyx_dict_iter_next(__pyx_t_2, __pyx_t_8, &__pyx_t_7, &__pyx_t_4, &__pyx_t_3, NULL, __pyx_t_9); + if (unlikely(__pyx_t_10 == 0)) break; + if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 469, __pyx_L17_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_3); + __Pyx_XDECREF_SET(__pyx_8genexpr1__pyx_v_key, __pyx_t_4); + __pyx_t_4 = 0; + __Pyx_XDECREF_SET(__pyx_8genexpr1__pyx_v_value, __pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = PyObject_Repr(__pyx_8genexpr1__pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 469, __pyx_L17_error) + __Pyx_GOTREF(__pyx_t_3); + if (unlikely(__pyx_t_3 == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 469, __pyx_L17_error) + } + __pyx_t_4 = PySequence_GetSlice(__pyx_t_3, 0, 50); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 469, __pyx_L17_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 469, __pyx_L17_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_8genexpr1__pyx_v_key); + __Pyx_GIVEREF(__pyx_8genexpr1__pyx_v_key); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_8genexpr1__pyx_v_key); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_s_s, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 469, __pyx_L17_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_4))) __PYX_ERR(0, 469, __pyx_L17_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_key); __pyx_8genexpr1__pyx_v_key = 0; + __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_value); __pyx_8genexpr1__pyx_v_value = 0; + goto __pyx_L20_exit_scope; + __pyx_L17_error:; + __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_key); __pyx_8genexpr1__pyx_v_key = 0; + __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_value); __pyx_8genexpr1__pyx_v_value = 0; + goto __pyx_L1_error; + __pyx_L20_exit_scope:; + } /* exit inner scope */ + __pyx_t_11 = __Pyx_PyList_Extend(__pyx_v_args, __pyx_t_1); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 469, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/greenlet.py":468 + * if self.args: + * args = [repr(x)[:50] for x in self.args] + * if self.kwargs: # <<<<<<<<<<<<<< + * args.extend(['%s=%s' % (key, repr(value)[:50]) for (key, value) in self.kwargs.items()]) + * if args: + */ + } + + /* "src/gevent/greenlet.py":470 + * if self.kwargs: + * args.extend(['%s=%s' % (key, repr(value)[:50]) for (key, value) in self.kwargs.items()]) + * if args: # <<<<<<<<<<<<<< + * result += '(' + ', '.join(args) + ')' + * # it is important to save the result here, because once the greenlet exits '_run' attribute will be removed + */ + __pyx_t_6 = (PyList_GET_SIZE(__pyx_v_args) != 0); + if (__pyx_t_6) { + + /* "src/gevent/greenlet.py":471 + * args.extend(['%s=%s' % (key, repr(value)[:50]) for (key, value) in self.kwargs.items()]) + * if args: + * result += '(' + ', '.join(args) + ')' # <<<<<<<<<<<<<< + * # it is important to save the result here, because once the greenlet exits '_run' attribute will be removed + * self._formatted_info = result + */ + __pyx_t_1 = __Pyx_PyString_Join(__pyx_kp_s__7, __pyx_v_args); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 471, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyNumber_Add(__pyx_kp_s__6, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 471, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyNumber_Add(__pyx_t_2, __pyx_kp_s__8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 471, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 471, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_2); + __pyx_t_2 = 0; + + /* "src/gevent/greenlet.py":470 + * if self.kwargs: + * args.extend(['%s=%s' % (key, repr(value)[:50]) for (key, value) in self.kwargs.items()]) + * if args: # <<<<<<<<<<<<<< + * result += '(' + ', '.join(args) + ')' + * # it is important to save the result here, because once the greenlet exits '_run' attribute will be removed + */ + } + + /* "src/gevent/greenlet.py":473 + * result += '(' + ', '.join(args) + ')' + * # it is important to save the result here, because once the greenlet exits '_run' attribute will be removed + * self._formatted_info = result # <<<<<<<<<<<<<< + * return result + * + */ + if (!(likely(PyString_CheckExact(__pyx_v_result))||((__pyx_v_result) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_v_result)->tp_name), 0))) __PYX_ERR(0, 473, __pyx_L1_error) + __pyx_t_2 = __pyx_v_result; + __Pyx_INCREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_v_self->_formatted_info); + __Pyx_DECREF(__pyx_v_self->_formatted_info); + __pyx_v_self->_formatted_info = ((PyObject*)__pyx_t_2); + __pyx_t_2 = 0; + + /* "src/gevent/greenlet.py":474 + * # it is important to save the result here, because once the greenlet exits '_run' attribute will be removed + * self._formatted_info = result + * return result # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_XDECREF(__pyx_r); + if (!(likely(PyString_CheckExact(__pyx_v_result))||((__pyx_v_result) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_v_result)->tp_name), 0))) __PYX_ERR(0, 474, __pyx_L1_error) + __Pyx_INCREF(__pyx_v_result); + __pyx_r = ((PyObject*)__pyx_v_result); + goto __pyx_L0; + + /* "src/gevent/greenlet.py":448 + * + * + * def _formatinfo(self): # <<<<<<<<<<<<<< + * info = self._formatted_info + * if info is not None: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("gevent._greenlet.Greenlet._formatinfo", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_info); + __Pyx_XDECREF(__pyx_v_func); + __Pyx_XDECREF(__pyx_v_im_self); + __Pyx_XDECREF(__pyx_v_funcname); + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XDECREF(__pyx_v_args); + __Pyx_XDECREF(__pyx_7genexpr__pyx_v_x); + __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_key); + __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_value); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_17_formatinfo(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6gevent_9_greenlet_8Greenlet_16_formatinfo[] = "Greenlet._formatinfo(self) -> str"; +static PyMethodDef __pyx_mdef_6gevent_9_greenlet_8Greenlet_17_formatinfo = {"_formatinfo", (PyCFunction)__pyx_pw_6gevent_9_greenlet_8Greenlet_17_formatinfo, METH_NOARGS, __pyx_doc_6gevent_9_greenlet_8Greenlet_16_formatinfo}; +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_17_formatinfo(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_formatinfo (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_9_greenlet_8Greenlet_16_formatinfo(((struct __pyx_obj_6gevent_9_greenlet_Greenlet *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_16_formatinfo(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("_formatinfo", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6gevent_9_greenlet_8Greenlet__formatinfo(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 448, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent._greenlet.Greenlet._formatinfo", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/greenlet.py":477 + * + * @property + * def exception(self): # <<<<<<<<<<<<<< + * """ + * Holds the exception instance raised by the function if the + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_9exception_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_9exception_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_9_greenlet_8Greenlet_9exception___get__(((struct __pyx_obj_6gevent_9_greenlet_Greenlet *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_9exception___get__(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "src/gevent/greenlet.py":482 + * greenlet has finished with an error. Otherwise ``None``. + * """ + * return self._exc_info[1] if self._exc_info is not None else None # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = (__pyx_v_self->_exc_info != ((PyObject*)Py_None)); + if ((__pyx_t_2 != 0)) { + if (unlikely(__pyx_v_self->_exc_info == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 482, __pyx_L1_error) + } + __pyx_t_3 = __Pyx_GetItemInt_Tuple(__pyx_v_self->_exc_info, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 482, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __pyx_t_3; + __pyx_t_3 = 0; + } else { + __Pyx_INCREF(Py_None); + __pyx_t_1 = Py_None; + } + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "src/gevent/greenlet.py":477 + * + * @property + * def exception(self): # <<<<<<<<<<<<<< + * """ + * Holds the exception instance raised by the function if the + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("gevent._greenlet.Greenlet.exception.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/greenlet.py":485 + * + * @property + * def exc_info(self): # <<<<<<<<<<<<<< + * """ + * Holds the exc_info three-tuple raised by the function if the + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_8exc_info_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_8exc_info_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_9_greenlet_8Greenlet_8exc_info___get__(((struct __pyx_obj_6gevent_9_greenlet_Greenlet *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_8exc_info___get__(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self) { + PyObject *__pyx_v_ei = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "src/gevent/greenlet.py":494 + * .. versionadded:: 1.1 + * """ + * ei = self._exc_info # <<<<<<<<<<<<<< + * if ei is not None and ei[0] is not None: + * return (ei[0], ei[1], load_traceback(ei[2])) + */ + __pyx_t_1 = __pyx_v_self->_exc_info; + __Pyx_INCREF(__pyx_t_1); + __pyx_v_ei = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "src/gevent/greenlet.py":495 + * """ + * ei = self._exc_info + * if ei is not None and ei[0] is not None: # <<<<<<<<<<<<<< + * return (ei[0], ei[1], load_traceback(ei[2])) + * + */ + __pyx_t_3 = (__pyx_v_ei != ((PyObject*)Py_None)); + __pyx_t_4 = (__pyx_t_3 != 0); + if (__pyx_t_4) { + } else { + __pyx_t_2 = __pyx_t_4; + goto __pyx_L4_bool_binop_done; + } + if (unlikely(__pyx_v_ei == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 495, __pyx_L1_error) + } + __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v_ei, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 495, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = (__pyx_t_1 != Py_None); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = (__pyx_t_4 != 0); + __pyx_t_2 = __pyx_t_3; + __pyx_L4_bool_binop_done:; + if (__pyx_t_2) { + + /* "src/gevent/greenlet.py":496 + * ei = self._exc_info + * if ei is not None and ei[0] is not None: + * return (ei[0], ei[1], load_traceback(ei[2])) # <<<<<<<<<<<<<< + * + * def throw(self, *args): + */ + __Pyx_XDECREF(__pyx_r); + if (unlikely(__pyx_v_ei == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 496, __pyx_L1_error) + } + __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v_ei, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 496, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (unlikely(__pyx_v_ei == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 496, __pyx_L1_error) + } + __pyx_t_5 = __Pyx_GetItemInt_Tuple(__pyx_v_ei, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 496, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (unlikely(__pyx_v_ei == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 496, __pyx_L1_error) + } + __pyx_t_7 = __Pyx_GetItemInt_Tuple(__pyx_v_ei, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 496, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_INCREF(__pyx_v_6gevent_9_greenlet_load_traceback); + __pyx_t_8 = __pyx_v_6gevent_9_greenlet_load_traceback; __pyx_t_9 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) { + __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8); + if (likely(__pyx_t_9)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); + __Pyx_INCREF(__pyx_t_9); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_8, function); + } + } + __pyx_t_6 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_9, __pyx_t_7) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_7); + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 496, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 496, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_6); + __pyx_t_1 = 0; + __pyx_t_5 = 0; + __pyx_t_6 = 0; + __pyx_r = __pyx_t_8; + __pyx_t_8 = 0; + goto __pyx_L0; + + /* "src/gevent/greenlet.py":495 + * """ + * ei = self._exc_info + * if ei is not None and ei[0] is not None: # <<<<<<<<<<<<<< + * return (ei[0], ei[1], load_traceback(ei[2])) + * + */ + } + + /* "src/gevent/greenlet.py":485 + * + * @property + * def exc_info(self): # <<<<<<<<<<<<<< + * """ + * Holds the exc_info three-tuple raised by the function if the + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_AddTraceback("gevent._greenlet.Greenlet.exc_info.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_ei); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/greenlet.py":498 + * return (ei[0], ei[1], load_traceback(ei[2])) + * + * def throw(self, *args): # <<<<<<<<<<<<<< + * """Immediately switch into the greenlet and raise an exception in it. + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_19throw(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6gevent_9_greenlet_8Greenlet_18throw[] = "Greenlet.throw(self, *args)\nImmediately switch into the greenlet and raise an exception in it.\n\n Should only be called from the HUB, otherwise the current greenlet is left unscheduled forever.\n To raise an exception in a safe manner from any greenlet, use :meth:`kill`.\n\n If a greenlet was started but never switched to yet, then also\n a) cancel the event that will start it\n b) fire the notifications as if an exception was raised in a greenlet\n "; +static PyMethodDef __pyx_mdef_6gevent_9_greenlet_8Greenlet_19throw = {"throw", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_9_greenlet_8Greenlet_19throw, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_9_greenlet_8Greenlet_18throw}; +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_19throw(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_args = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("throw (wrapper)", 0); + if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "throw", 0))) return NULL; + __Pyx_INCREF(__pyx_args); + __pyx_v_args = __pyx_args; + __pyx_r = __pyx_pf_6gevent_9_greenlet_8Greenlet_18throw(((struct __pyx_obj_6gevent_9_greenlet_Greenlet *)__pyx_v_self), __pyx_v_args); + + /* function exit code */ + __Pyx_XDECREF(__pyx_v_args); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_18throw(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self, PyObject *__pyx_v_args) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + int __pyx_t_7; + char const *__pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + PyObject *__pyx_t_14 = NULL; + __Pyx_RefNannySetupContext("throw", 0); + + /* "src/gevent/greenlet.py":508 + * b) fire the notifications as if an exception was raised in a greenlet + * """ + * self.__cancel_start() # <<<<<<<<<<<<<< + * + * try: + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_9_greenlet_Greenlet *)__pyx_v_self->__pyx_vtab)->__pyx___cancel_start(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 508, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/greenlet.py":510 + * self.__cancel_start() + * + * try: # <<<<<<<<<<<<<< + * if not self.dead: + * # Prevent switching into a greenlet *at all* if we had never + */ + /*try:*/ { + + /* "src/gevent/greenlet.py":511 + * + * try: + * if not self.dead: # <<<<<<<<<<<<<< + * # Prevent switching into a greenlet *at all* if we had never + * # started it. Usually this is the same thing that happens by throwing, + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_dead); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 511, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 511, __pyx_L4_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = ((!__pyx_t_2) != 0); + if (__pyx_t_3) { + + /* "src/gevent/greenlet.py":516 + * # but if this is done from the hub with nothing else running, prevents a + * # LoopExit. + * greenlet.throw(self, *args) # <<<<<<<<<<<<<< + * finally: + * self.__handle_death_before_start(args) + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_6gevent_9_greenlet_greenlet), __pyx_n_s_throw); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 516, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 516, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_self)); + __pyx_t_5 = PyNumber_Add(__pyx_t_4, __pyx_v_args); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 516, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 516, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "src/gevent/greenlet.py":511 + * + * try: + * if not self.dead: # <<<<<<<<<<<<<< + * # Prevent switching into a greenlet *at all* if we had never + * # started it. Usually this is the same thing that happens by throwing, + */ + } + } + + /* "src/gevent/greenlet.py":518 + * greenlet.throw(self, *args) + * finally: + * self.__handle_death_before_start(args) # <<<<<<<<<<<<<< + * + * def start(self): + */ + /*finally:*/ { + /*normal exit:*/{ + __pyx_t_4 = ((struct __pyx_vtabstruct_6gevent_9_greenlet_Greenlet *)__pyx_v_self->__pyx_vtab)->__pyx___handle_death_before_start(__pyx_v_self, __pyx_v_args); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 518, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L5; + } + __pyx_L4_error:; + /*exception exit:*/{ + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14); + if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11) < 0)) __Pyx_ErrFetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); + __Pyx_XGOTREF(__pyx_t_9); + __Pyx_XGOTREF(__pyx_t_10); + __Pyx_XGOTREF(__pyx_t_11); + __Pyx_XGOTREF(__pyx_t_12); + __Pyx_XGOTREF(__pyx_t_13); + __Pyx_XGOTREF(__pyx_t_14); + __pyx_t_6 = __pyx_lineno; __pyx_t_7 = __pyx_clineno; __pyx_t_8 = __pyx_filename; + { + __pyx_t_4 = ((struct __pyx_vtabstruct_6gevent_9_greenlet_Greenlet *)__pyx_v_self->__pyx_vtab)->__pyx___handle_death_before_start(__pyx_v_self, __pyx_v_args); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 518, __pyx_L8_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + if (PY_MAJOR_VERSION >= 3) { + __Pyx_XGIVEREF(__pyx_t_12); + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14); + } + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_ErrRestore(__pyx_t_9, __pyx_t_10, __pyx_t_11); + __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; + __pyx_lineno = __pyx_t_6; __pyx_clineno = __pyx_t_7; __pyx_filename = __pyx_t_8; + goto __pyx_L1_error; + __pyx_L8_error:; + if (PY_MAJOR_VERSION >= 3) { + __Pyx_XGIVEREF(__pyx_t_12); + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14); + } + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; + goto __pyx_L1_error; + } + __pyx_L5:; + } + + /* "src/gevent/greenlet.py":498 + * return (ei[0], ei[1], load_traceback(ei[2])) + * + * def throw(self, *args): # <<<<<<<<<<<<<< + * """Immediately switch into the greenlet and raise an exception in it. + * + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("gevent._greenlet.Greenlet.throw", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/greenlet.py":520 + * self.__handle_death_before_start(args) + * + * def start(self): # <<<<<<<<<<<<<< + * """Schedule the greenlet to run in this loop iteration""" + * if self._start_event is None: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_21start(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6gevent_9_greenlet_8Greenlet_20start[] = "Greenlet.start(self)\nSchedule the greenlet to run in this loop iteration"; +static PyMethodDef __pyx_mdef_6gevent_9_greenlet_8Greenlet_21start = {"start", (PyCFunction)__pyx_pw_6gevent_9_greenlet_8Greenlet_21start, METH_NOARGS, __pyx_doc_6gevent_9_greenlet_8Greenlet_20start}; +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_21start(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("start (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_9_greenlet_8Greenlet_20start(((struct __pyx_obj_6gevent_9_greenlet_Greenlet *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_20start(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + __Pyx_RefNannySetupContext("start", 0); + + /* "src/gevent/greenlet.py":522 + * def start(self): + * """Schedule the greenlet to run in this loop iteration""" + * if self._start_event is None: # <<<<<<<<<<<<<< + * _call_spawn_callbacks(self) + * self._start_event = self.parent.loop.run_callback(self.switch) + */ + __pyx_t_1 = (__pyx_v_self->_start_event == Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "src/gevent/greenlet.py":523 + * """Schedule the greenlet to run in this loop iteration""" + * if self._start_event is None: + * _call_spawn_callbacks(self) # <<<<<<<<<<<<<< + * self._start_event = self.parent.loop.run_callback(self.switch) + * + */ + __pyx_f_6gevent_9_greenlet__call_spawn_callbacks(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 523, __pyx_L1_error) + + /* "src/gevent/greenlet.py":524 + * if self._start_event is None: + * _call_spawn_callbacks(self) + * self._start_event = self.parent.loop.run_callback(self.switch) # <<<<<<<<<<<<<< + * + * def start_later(self, seconds): + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_parent); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 524, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_loop); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 524, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_run_callback); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 524, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_switch); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 524, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_6)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + } + } + __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_6, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 524, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GIVEREF(__pyx_t_3); + __Pyx_GOTREF(__pyx_v_self->_start_event); + __Pyx_DECREF(__pyx_v_self->_start_event); + __pyx_v_self->_start_event = __pyx_t_3; + __pyx_t_3 = 0; + + /* "src/gevent/greenlet.py":522 + * def start(self): + * """Schedule the greenlet to run in this loop iteration""" + * if self._start_event is None: # <<<<<<<<<<<<<< + * _call_spawn_callbacks(self) + * self._start_event = self.parent.loop.run_callback(self.switch) + */ + } + + /* "src/gevent/greenlet.py":520 + * self.__handle_death_before_start(args) + * + * def start(self): # <<<<<<<<<<<<<< + * """Schedule the greenlet to run in this loop iteration""" + * if self._start_event is None: + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("gevent._greenlet.Greenlet.start", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/greenlet.py":526 + * self._start_event = self.parent.loop.run_callback(self.switch) + * + * def start_later(self, seconds): # <<<<<<<<<<<<<< + * """ + * start_later(seconds) -> None + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_23start_later(PyObject *__pyx_v_self, PyObject *__pyx_v_seconds); /*proto*/ +static char __pyx_doc_6gevent_9_greenlet_8Greenlet_22start_later[] = "Greenlet.start_later(self, seconds)\n\n start_later(seconds) -> None\n\n Schedule the greenlet to run in the future loop iteration\n *seconds* later\n "; +static PyMethodDef __pyx_mdef_6gevent_9_greenlet_8Greenlet_23start_later = {"start_later", (PyCFunction)__pyx_pw_6gevent_9_greenlet_8Greenlet_23start_later, METH_O, __pyx_doc_6gevent_9_greenlet_8Greenlet_22start_later}; +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_23start_later(PyObject *__pyx_v_self, PyObject *__pyx_v_seconds) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("start_later (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_9_greenlet_8Greenlet_22start_later(((struct __pyx_obj_6gevent_9_greenlet_Greenlet *)__pyx_v_self), ((PyObject *)__pyx_v_seconds)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_22start_later(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self, PyObject *__pyx_v_seconds) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + __Pyx_RefNannySetupContext("start_later", 0); + + /* "src/gevent/greenlet.py":533 + * *seconds* later + * """ + * if self._start_event is None: # <<<<<<<<<<<<<< + * _call_spawn_callbacks(self) + * self._start_event = self.parent.loop.timer(seconds) + */ + __pyx_t_1 = (__pyx_v_self->_start_event == Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "src/gevent/greenlet.py":534 + * """ + * if self._start_event is None: + * _call_spawn_callbacks(self) # <<<<<<<<<<<<<< + * self._start_event = self.parent.loop.timer(seconds) + * self._start_event.start(self.switch) + */ + __pyx_f_6gevent_9_greenlet__call_spawn_callbacks(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 534, __pyx_L1_error) + + /* "src/gevent/greenlet.py":535 + * if self._start_event is None: + * _call_spawn_callbacks(self) + * self._start_event = self.parent.loop.timer(seconds) # <<<<<<<<<<<<<< + * self._start_event.start(self.switch) + * + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_parent); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 535, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_loop); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 535, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_timer); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 535, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + } + } + __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_v_seconds) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_seconds); + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 535, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GIVEREF(__pyx_t_3); + __Pyx_GOTREF(__pyx_v_self->_start_event); + __Pyx_DECREF(__pyx_v_self->_start_event); + __pyx_v_self->_start_event = __pyx_t_3; + __pyx_t_3 = 0; + + /* "src/gevent/greenlet.py":536 + * _call_spawn_callbacks(self) + * self._start_event = self.parent.loop.timer(seconds) + * self._start_event.start(self.switch) # <<<<<<<<<<<<<< + * + * @staticmethod + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_start_event, __pyx_n_s_start); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 536, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_switch); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 536, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_6)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + } + } + __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_6, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 536, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "src/gevent/greenlet.py":533 + * *seconds* later + * """ + * if self._start_event is None: # <<<<<<<<<<<<<< + * _call_spawn_callbacks(self) + * self._start_event = self.parent.loop.timer(seconds) + */ + } + + /* "src/gevent/greenlet.py":526 + * self._start_event = self.parent.loop.run_callback(self.switch) + * + * def start_later(self, seconds): # <<<<<<<<<<<<<< + * """ + * start_later(seconds) -> None + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("gevent._greenlet.Greenlet.start_later", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/greenlet.py":539 + * + * @staticmethod + * def add_spawn_callback(callback): # <<<<<<<<<<<<<< + * """ + * add_spawn_callback(callback) -> None + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_25add_spawn_callback(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6gevent_9_greenlet_8Greenlet_24add_spawn_callback[] = "Greenlet.add_spawn_callback(callback)\n\n add_spawn_callback(callback) -> None\n\n Set up a *callback* to be invoked when :class:`Greenlet` objects\n are started.\n\n The invocation order of spawn callbacks is unspecified. Adding the\n same callback more than one time will not cause it to be called more\n than once.\n\n .. versionadded:: 1.4.0\n "; +static PyMethodDef __pyx_mdef_6gevent_9_greenlet_8Greenlet_25add_spawn_callback = {"add_spawn_callback", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_9_greenlet_8Greenlet_25add_spawn_callback, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_9_greenlet_8Greenlet_24add_spawn_callback}; +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_25add_spawn_callback(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_callback = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("add_spawn_callback (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_callback,0}; + PyObject* values[1] = {0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_callback)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "add_spawn_callback") < 0)) __PYX_ERR(0, 539, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + } + __pyx_v_callback = values[0]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("add_spawn_callback", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 539, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent._greenlet.Greenlet.add_spawn_callback", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_9_greenlet_8Greenlet_24add_spawn_callback(__pyx_v_callback); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_24add_spawn_callback(PyObject *__pyx_v_callback) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + __Pyx_RefNannySetupContext("add_spawn_callback", 0); + + /* "src/gevent/greenlet.py":553 + * """ + * global _spawn_callbacks + * if _spawn_callbacks is None: # pylint:disable=used-before-assignment # <<<<<<<<<<<<<< + * _spawn_callbacks = set() + * _spawn_callbacks.add(callback) + */ + __pyx_t_1 = (__pyx_v_6gevent_9_greenlet__spawn_callbacks == ((PyObject*)Py_None)); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "src/gevent/greenlet.py":554 + * global _spawn_callbacks + * if _spawn_callbacks is None: # pylint:disable=used-before-assignment + * _spawn_callbacks = set() # <<<<<<<<<<<<<< + * _spawn_callbacks.add(callback) + * + */ + __pyx_t_3 = PySet_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 554, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_XGOTREF(__pyx_v_6gevent_9_greenlet__spawn_callbacks); + __Pyx_DECREF_SET(__pyx_v_6gevent_9_greenlet__spawn_callbacks, ((PyObject*)__pyx_t_3)); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + + /* "src/gevent/greenlet.py":553 + * """ + * global _spawn_callbacks + * if _spawn_callbacks is None: # pylint:disable=used-before-assignment # <<<<<<<<<<<<<< + * _spawn_callbacks = set() + * _spawn_callbacks.add(callback) + */ + } + + /* "src/gevent/greenlet.py":555 + * if _spawn_callbacks is None: # pylint:disable=used-before-assignment + * _spawn_callbacks = set() + * _spawn_callbacks.add(callback) # <<<<<<<<<<<<<< + * + * @staticmethod + */ + if (unlikely(__pyx_v_6gevent_9_greenlet__spawn_callbacks == Py_None)) { + PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "add"); + __PYX_ERR(0, 555, __pyx_L1_error) + } + __pyx_t_4 = PySet_Add(__pyx_v_6gevent_9_greenlet__spawn_callbacks, __pyx_v_callback); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 555, __pyx_L1_error) + + /* "src/gevent/greenlet.py":539 + * + * @staticmethod + * def add_spawn_callback(callback): # <<<<<<<<<<<<<< + * """ + * add_spawn_callback(callback) -> None + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("gevent._greenlet.Greenlet.add_spawn_callback", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/greenlet.py":558 + * + * @staticmethod + * def remove_spawn_callback(callback): # <<<<<<<<<<<<<< + * """ + * remove_spawn_callback(callback) -> None + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_27remove_spawn_callback(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6gevent_9_greenlet_8Greenlet_26remove_spawn_callback[] = "Greenlet.remove_spawn_callback(callback)\n\n remove_spawn_callback(callback) -> None\n\n Remove *callback* function added with :meth:`Greenlet.add_spawn_callback`.\n This function will not fail if *callback* has been already removed or\n if *callback* was never added.\n\n .. versionadded:: 1.4.0\n "; +static PyMethodDef __pyx_mdef_6gevent_9_greenlet_8Greenlet_27remove_spawn_callback = {"remove_spawn_callback", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_9_greenlet_8Greenlet_27remove_spawn_callback, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_9_greenlet_8Greenlet_26remove_spawn_callback}; +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_27remove_spawn_callback(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_callback = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("remove_spawn_callback (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_callback,0}; + PyObject* values[1] = {0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_callback)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "remove_spawn_callback") < 0)) __PYX_ERR(0, 558, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + } + __pyx_v_callback = values[0]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("remove_spawn_callback", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 558, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent._greenlet.Greenlet.remove_spawn_callback", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_9_greenlet_8Greenlet_26remove_spawn_callback(__pyx_v_callback); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_26remove_spawn_callback(PyObject *__pyx_v_callback) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + __Pyx_RefNannySetupContext("remove_spawn_callback", 0); + + /* "src/gevent/greenlet.py":569 + * """ + * global _spawn_callbacks + * if _spawn_callbacks is not None: # <<<<<<<<<<<<<< + * _spawn_callbacks.discard(callback) + * if not _spawn_callbacks: + */ + __pyx_t_1 = (__pyx_v_6gevent_9_greenlet__spawn_callbacks != ((PyObject*)Py_None)); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "src/gevent/greenlet.py":570 + * global _spawn_callbacks + * if _spawn_callbacks is not None: + * _spawn_callbacks.discard(callback) # <<<<<<<<<<<<<< + * if not _spawn_callbacks: + * _spawn_callbacks = None + */ + if (unlikely(__pyx_v_6gevent_9_greenlet__spawn_callbacks == Py_None)) { + PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "discard"); + __PYX_ERR(0, 570, __pyx_L1_error) + } + __pyx_t_3 = __Pyx_PySet_Discard(__pyx_v_6gevent_9_greenlet__spawn_callbacks, __pyx_v_callback); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 570, __pyx_L1_error) + + /* "src/gevent/greenlet.py":571 + * if _spawn_callbacks is not None: + * _spawn_callbacks.discard(callback) + * if not _spawn_callbacks: # <<<<<<<<<<<<<< + * _spawn_callbacks = None + * + */ + __pyx_t_2 = (__pyx_v_6gevent_9_greenlet__spawn_callbacks != Py_None)&&(PySet_GET_SIZE(__pyx_v_6gevent_9_greenlet__spawn_callbacks) != 0); + __pyx_t_1 = ((!__pyx_t_2) != 0); + if (__pyx_t_1) { + + /* "src/gevent/greenlet.py":572 + * _spawn_callbacks.discard(callback) + * if not _spawn_callbacks: + * _spawn_callbacks = None # <<<<<<<<<<<<<< + * + * @classmethod + */ + __Pyx_INCREF(Py_None); + __Pyx_XGOTREF(__pyx_v_6gevent_9_greenlet__spawn_callbacks); + __Pyx_DECREF_SET(__pyx_v_6gevent_9_greenlet__spawn_callbacks, ((PyObject*)Py_None)); + __Pyx_GIVEREF(Py_None); + + /* "src/gevent/greenlet.py":571 + * if _spawn_callbacks is not None: + * _spawn_callbacks.discard(callback) + * if not _spawn_callbacks: # <<<<<<<<<<<<<< + * _spawn_callbacks = None + * + */ + } + + /* "src/gevent/greenlet.py":569 + * """ + * global _spawn_callbacks + * if _spawn_callbacks is not None: # <<<<<<<<<<<<<< + * _spawn_callbacks.discard(callback) + * if not _spawn_callbacks: + */ + } + + /* "src/gevent/greenlet.py":558 + * + * @staticmethod + * def remove_spawn_callback(callback): # <<<<<<<<<<<<<< + * """ + * remove_spawn_callback(callback) -> None + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("gevent._greenlet.Greenlet.remove_spawn_callback", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/greenlet.py":575 + * + * @classmethod + * def spawn(cls, *args, **kwargs): # <<<<<<<<<<<<<< + * """ + * spawn(function, *args, **kwargs) -> Greenlet + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_29spawn(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6gevent_9_greenlet_8Greenlet_28spawn[] = "Greenlet.spawn(type cls, *args, **kwargs)\n\n spawn(function, *args, **kwargs) -> Greenlet\n\n Create a new :class:`Greenlet` object and schedule it to run ``function(*args, **kwargs)``.\n This can be used as ``gevent.spawn`` or ``Greenlet.spawn``.\n\n The arguments are passed to :meth:`Greenlet.__init__`.\n\n .. versionchanged:: 1.1b1\n If a *function* is given that is not callable, immediately raise a :exc:`TypeError`\n instead of spawning a greenlet that will raise an uncaught TypeError.\n "; +static PyMethodDef __pyx_mdef_6gevent_9_greenlet_8Greenlet_29spawn = {"spawn", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_9_greenlet_8Greenlet_29spawn, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_9_greenlet_8Greenlet_28spawn}; +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_29spawn(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_args = 0; + PyObject *__pyx_v_kwargs = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("spawn (wrapper)", 0); + if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "spawn", 1))) return NULL; + if (unlikely(__pyx_kwds)) { + __pyx_v_kwargs = PyDict_Copy(__pyx_kwds); if (unlikely(!__pyx_v_kwargs)) return NULL; + __Pyx_GOTREF(__pyx_v_kwargs); + } else { + __pyx_v_kwargs = NULL; + } + __Pyx_INCREF(__pyx_args); + __pyx_v_args = __pyx_args; + __pyx_r = __pyx_pf_6gevent_9_greenlet_8Greenlet_28spawn(((PyTypeObject*)__pyx_v_cls), __pyx_v_args, __pyx_v_kwargs); + + /* function exit code */ + __Pyx_XDECREF(__pyx_v_args); + __Pyx_XDECREF(__pyx_v_kwargs); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_28spawn(PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) { + PyObject *__pyx_v_g = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("spawn", 0); + + /* "src/gevent/greenlet.py":588 + * instead of spawning a greenlet that will raise an uncaught TypeError. + * """ + * g = cls(*args, **kwargs) # <<<<<<<<<<<<<< + * g.start() + * return g + */ + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_v_cls), __pyx_v_args, __pyx_v_kwargs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 588, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_g = __pyx_t_1; + __pyx_t_1 = 0; + + /* "src/gevent/greenlet.py":589 + * """ + * g = cls(*args, **kwargs) + * g.start() # <<<<<<<<<<<<<< + * return g + * + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_g, __pyx_n_s_start); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 589, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 589, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/greenlet.py":590 + * g = cls(*args, **kwargs) + * g.start() + * return g # <<<<<<<<<<<<<< + * + * @classmethod + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_g); + __pyx_r = __pyx_v_g; + goto __pyx_L0; + + /* "src/gevent/greenlet.py":575 + * + * @classmethod + * def spawn(cls, *args, **kwargs): # <<<<<<<<<<<<<< + * """ + * spawn(function, *args, **kwargs) -> Greenlet + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("gevent._greenlet.Greenlet.spawn", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_g); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/greenlet.py":593 + * + * @classmethod + * def spawn_later(cls, seconds, *args, **kwargs): # <<<<<<<<<<<<<< + * """ + * spawn_later(seconds, function, *args, **kwargs) -> Greenlet + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_31spawn_later(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6gevent_9_greenlet_8Greenlet_30spawn_later[] = "Greenlet.spawn_later(type cls, seconds, *args, **kwargs)\n\n spawn_later(seconds, function, *args, **kwargs) -> Greenlet\n\n Create and return a new `Greenlet` object scheduled to run ``function(*args, **kwargs)``\n in a future loop iteration *seconds* later. This can be used as ``Greenlet.spawn_later``\n or ``gevent.spawn_later``.\n\n The arguments are passed to :meth:`Greenlet.__init__`.\n\n .. versionchanged:: 1.1b1\n If an argument that's meant to be a function (the first argument in *args*, or the ``run`` keyword )\n is given to this classmethod (and not a classmethod of a subclass),\n it is verified to be callable. Previously, the spawned greenlet would have failed\n when it started running.\n "; +static PyMethodDef __pyx_mdef_6gevent_9_greenlet_8Greenlet_31spawn_later = {"spawn_later", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_9_greenlet_8Greenlet_31spawn_later, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_9_greenlet_8Greenlet_30spawn_later}; +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_31spawn_later(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_seconds = 0; + PyObject *__pyx_v_args = 0; + PyObject *__pyx_v_kwargs = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("spawn_later (wrapper)", 0); + __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL; + __Pyx_GOTREF(__pyx_v_kwargs); + if (PyTuple_GET_SIZE(__pyx_args) > 1) { + __pyx_v_args = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args)); + if (unlikely(!__pyx_v_args)) { + __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0; + __Pyx_RefNannyFinishContext(); + return NULL; + } + __Pyx_GOTREF(__pyx_v_args); + } else { + __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple); + } + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_seconds,0}; + PyObject* values[1] = {0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + default: + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_seconds)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, used_pos_args, "spawn_later") < 0)) __PYX_ERR(0, 593, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) < 1) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + } + __pyx_v_seconds = values[0]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("spawn_later", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 593, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0; + __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0; + __Pyx_AddTraceback("gevent._greenlet.Greenlet.spawn_later", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_9_greenlet_8Greenlet_30spawn_later(((PyTypeObject*)__pyx_v_cls), __pyx_v_seconds, __pyx_v_args, __pyx_v_kwargs); + + /* function exit code */ + __Pyx_XDECREF(__pyx_v_args); + __Pyx_XDECREF(__pyx_v_kwargs); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_30spawn_later(PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_seconds, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) { + PyObject *__pyx_v_g = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + __Pyx_RefNannySetupContext("spawn_later", 0); + + /* "src/gevent/greenlet.py":609 + * when it started running. + * """ + * if cls is Greenlet and not args and 'run' not in kwargs: # <<<<<<<<<<<<<< + * raise TypeError("") + * g = cls(*args, **kwargs) + */ + __pyx_t_2 = (__pyx_v_cls == __pyx_ptype_6gevent_9_greenlet_Greenlet); + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + } else { + __pyx_t_1 = __pyx_t_3; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_3 = (PyTuple_GET_SIZE(__pyx_v_args) != 0); + __pyx_t_2 = ((!__pyx_t_3) != 0); + if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_2 = (__Pyx_PyDict_ContainsTF(__pyx_n_s_run, __pyx_v_kwargs, Py_NE)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 609, __pyx_L1_error) + __pyx_t_3 = (__pyx_t_2 != 0); + __pyx_t_1 = __pyx_t_3; + __pyx_L4_bool_binop_done:; + if (unlikely(__pyx_t_1)) { + + /* "src/gevent/greenlet.py":610 + * """ + * if cls is Greenlet and not args and 'run' not in kwargs: + * raise TypeError("") # <<<<<<<<<<<<<< + * g = cls(*args, **kwargs) + * g.start_later(seconds) + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 610, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __PYX_ERR(0, 610, __pyx_L1_error) + + /* "src/gevent/greenlet.py":609 + * when it started running. + * """ + * if cls is Greenlet and not args and 'run' not in kwargs: # <<<<<<<<<<<<<< + * raise TypeError("") + * g = cls(*args, **kwargs) + */ + } + + /* "src/gevent/greenlet.py":611 + * if cls is Greenlet and not args and 'run' not in kwargs: + * raise TypeError("") + * g = cls(*args, **kwargs) # <<<<<<<<<<<<<< + * g.start_later(seconds) + * return g + */ + __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_v_cls), __pyx_v_args, __pyx_v_kwargs); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 611, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_v_g = __pyx_t_4; + __pyx_t_4 = 0; + + /* "src/gevent/greenlet.py":612 + * raise TypeError("") + * g = cls(*args, **kwargs) + * g.start_later(seconds) # <<<<<<<<<<<<<< + * return g + * + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_g, __pyx_n_s_start_later); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 612, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); + if (likely(__pyx_t_6)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_5, function); + } + } + __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_v_seconds) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_seconds); + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 612, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "src/gevent/greenlet.py":613 + * g = cls(*args, **kwargs) + * g.start_later(seconds) + * return g # <<<<<<<<<<<<<< + * + * def kill(self, exception=GreenletExit, block=True, timeout=None): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_g); + __pyx_r = __pyx_v_g; + goto __pyx_L0; + + /* "src/gevent/greenlet.py":593 + * + * @classmethod + * def spawn_later(cls, seconds, *args, **kwargs): # <<<<<<<<<<<<<< + * """ + * spawn_later(seconds, function, *args, **kwargs) -> Greenlet + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("gevent._greenlet.Greenlet.spawn_later", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_g); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/greenlet.py":615 + * return g + * + * def kill(self, exception=GreenletExit, block=True, timeout=None): # <<<<<<<<<<<<<< + * """ + * Raise the ``exception`` in the greenlet. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_33kill(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6gevent_9_greenlet_8Greenlet_32kill[] = "Greenlet.kill(self, exception=GreenletExit, block=True, timeout=None)\n\n Raise the ``exception`` in the greenlet.\n\n If ``block`` is ``True`` (the default), wait until the greenlet dies or the optional timeout expires.\n If block is ``False``, the current greenlet is not unscheduled.\n\n The function always returns ``None`` and never raises an error.\n\n .. note::\n\n Depending on what this greenlet is executing and the state\n of the event loop, the exception may or may not be raised\n immediately when this greenlet resumes execution. It may\n be raised on a subsequent green call, or, if this greenlet\n exits before making such a call, it may not be raised at\n all. As of 1.1, an example where the exception is raised\n later is if this greenlet had called :func:`sleep(0)\n `; an example where the exception is raised\n immediately is if this greenlet had called\n :func:`sleep(0.1) `.\n\n .. caution::\n\n Use care when killing greenlets. If the code executing is not\n exception safe (e.g., makes proper use of ``finally``) then an\n unexpected exception could result in corrupted state.\n\n See also :func:`gevent.kill`.\n\n :keyword type exception: The type of exception to raise in the greenlet. The default\n is :class:`GreenletExit`, which indicates a :meth:`successful` completion\n of the greenlet.\n\n .. versionchanged:: 0.13.0\n *block* is now ``True`` by default.\n .. versionchanged:: 1.1a2\n If this greenlet had never been switched to, killing it will prevent it from ever being switched to.\n "; +static PyMethodDef __pyx_mdef_6gevent_9_greenlet_8Greenlet_33kill = {"kill", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_9_greenlet_8Greenlet_33kill, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_9_greenlet_8Greenlet_32kill}; +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_33kill(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_exception = 0; + PyObject *__pyx_v_block = 0; + PyObject *__pyx_v_timeout = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("kill (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_exception,&__pyx_n_s_block,&__pyx_n_s_timeout,0}; + PyObject* values[3] = {0,0,0}; + values[0] = __pyx_k__10; + values[1] = ((PyObject *)Py_True); + values[2] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_exception); + if (value) { values[0] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 1: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_block); + if (value) { values[1] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 2: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_timeout); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "kill") < 0)) __PYX_ERR(0, 615, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_exception = values[0]; + __pyx_v_block = values[1]; + __pyx_v_timeout = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("kill", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 615, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent._greenlet.Greenlet.kill", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_9_greenlet_8Greenlet_32kill(((struct __pyx_obj_6gevent_9_greenlet_Greenlet *)__pyx_v_self), __pyx_v_exception, __pyx_v_block, __pyx_v_timeout); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_32kill(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self, PyObject *__pyx_v_exception, PyObject *__pyx_v_block, PyObject *__pyx_v_timeout) { + PyObject *__pyx_v_waiter = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + struct __pyx_opt_args_6gevent_9_greenlet_8Greenlet_join __pyx_t_8; + __Pyx_RefNannySetupContext("kill", 0); + + /* "src/gevent/greenlet.py":654 + * If this greenlet had never been switched to, killing it will prevent it from ever being switched to. + * """ + * self.__cancel_start() # <<<<<<<<<<<<<< + * + * if self.dead: + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_9_greenlet_Greenlet *)__pyx_v_self->__pyx_vtab)->__pyx___cancel_start(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 654, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/greenlet.py":656 + * self.__cancel_start() + * + * if self.dead: # <<<<<<<<<<<<<< + * self.__handle_death_before_start((exception,)) + * else: + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_dead); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 656, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 656, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_2) { + + /* "src/gevent/greenlet.py":657 + * + * if self.dead: + * self.__handle_death_before_start((exception,)) # <<<<<<<<<<<<<< + * else: + * waiter = Waiter() if block else None # pylint:disable=undefined-variable + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 657, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_exception); + __Pyx_GIVEREF(__pyx_v_exception); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_exception); + __pyx_t_3 = ((struct __pyx_vtabstruct_6gevent_9_greenlet_Greenlet *)__pyx_v_self->__pyx_vtab)->__pyx___handle_death_before_start(__pyx_v_self, ((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 657, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "src/gevent/greenlet.py":656 + * self.__cancel_start() + * + * if self.dead: # <<<<<<<<<<<<<< + * self.__handle_death_before_start((exception,)) + * else: + */ + goto __pyx_L3; + } + + /* "src/gevent/greenlet.py":659 + * self.__handle_death_before_start((exception,)) + * else: + * waiter = Waiter() if block else None # pylint:disable=undefined-variable # <<<<<<<<<<<<<< + * self.parent.loop.run_callback(_kill, self, exception, waiter) + * if block: + */ + /*else*/ { + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_block); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 659, __pyx_L1_error) + if (__pyx_t_2) { + __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_6gevent_8__waiter_Waiter)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 659, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __pyx_t_1; + __pyx_t_1 = 0; + } else { + __Pyx_INCREF(Py_None); + __pyx_t_3 = Py_None; + } + __pyx_v_waiter = __pyx_t_3; + __pyx_t_3 = 0; + + /* "src/gevent/greenlet.py":660 + * else: + * waiter = Waiter() if block else None # pylint:disable=undefined-variable + * self.parent.loop.run_callback(_kill, self, exception, waiter) # <<<<<<<<<<<<<< + * if block: + * waiter.get() + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_parent); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 660, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_loop); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 660, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_run_callback); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 660, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_kill); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 660, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = NULL; + __pyx_t_6 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_1, function); + __pyx_t_6 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_1)) { + PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_t_4, ((PyObject *)__pyx_v_self), __pyx_v_exception, __pyx_v_waiter}; + __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_6, 4+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 660, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) { + PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_t_4, ((PyObject *)__pyx_v_self), __pyx_v_exception, __pyx_v_waiter}; + __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_6, 4+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 660, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } else + #endif + { + __pyx_t_7 = PyTuple_New(4+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 660, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + if (__pyx_t_5) { + __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL; + } + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_t_4); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, ((PyObject *)__pyx_v_self)); + __Pyx_INCREF(__pyx_v_exception); + __Pyx_GIVEREF(__pyx_v_exception); + PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_6, __pyx_v_exception); + __Pyx_INCREF(__pyx_v_waiter); + __Pyx_GIVEREF(__pyx_v_waiter); + PyTuple_SET_ITEM(__pyx_t_7, 3+__pyx_t_6, __pyx_v_waiter); + __pyx_t_4 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 660, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "src/gevent/greenlet.py":661 + * waiter = Waiter() if block else None # pylint:disable=undefined-variable + * self.parent.loop.run_callback(_kill, self, exception, waiter) + * if block: # <<<<<<<<<<<<<< + * waiter.get() + * self.join(timeout) + */ + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_block); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 661, __pyx_L1_error) + if (__pyx_t_2) { + + /* "src/gevent/greenlet.py":662 + * self.parent.loop.run_callback(_kill, self, exception, waiter) + * if block: + * waiter.get() # <<<<<<<<<<<<<< + * self.join(timeout) + * # it should be OK to use kill() in finally or kill a greenlet from more than one place; + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_waiter, __pyx_n_s_get_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 662, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { + __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_1); + if (likely(__pyx_t_7)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); + __Pyx_INCREF(__pyx_t_7); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_1, function); + } + } + __pyx_t_3 = (__pyx_t_7) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_7) : __Pyx_PyObject_CallNoArg(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 662, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "src/gevent/greenlet.py":663 + * if block: + * waiter.get() + * self.join(timeout) # <<<<<<<<<<<<<< + * # it should be OK to use kill() in finally or kill a greenlet from more than one place; + * # thus it should not raise when the greenlet is already killed (= not started) + */ + __pyx_t_8.__pyx_n = 1; + __pyx_t_8.timeout = __pyx_v_timeout; + __pyx_t_3 = ((struct __pyx_vtabstruct_6gevent_9_greenlet_Greenlet *)__pyx_v_self->__pyx_vtab)->join(__pyx_v_self, 0, &__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 663, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "src/gevent/greenlet.py":661 + * waiter = Waiter() if block else None # pylint:disable=undefined-variable + * self.parent.loop.run_callback(_kill, self, exception, waiter) + * if block: # <<<<<<<<<<<<<< + * waiter.get() + * self.join(timeout) + */ + } + } + __pyx_L3:; + + /* "src/gevent/greenlet.py":615 + * return g + * + * def kill(self, exception=GreenletExit, block=True, timeout=None): # <<<<<<<<<<<<<< + * """ + * Raise the ``exception`` in the greenlet. + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("gevent._greenlet.Greenlet.kill", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_waiter); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/greenlet.py":667 + * # thus it should not raise when the greenlet is already killed (= not started) + * + * def get(self, block=True, timeout=None): # <<<<<<<<<<<<<< + * """ + * get(block=True, timeout=None) -> object + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_35get(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6gevent_9_greenlet_8Greenlet_34get[] = "Greenlet.get(self, block=True, timeout=None)\n\n get(block=True, timeout=None) -> object\n\n Return the result the greenlet has returned or re-raise the\n exception it has raised.\n\n If block is ``False``, raise :class:`gevent.Timeout` if the\n greenlet is still alive. If block is ``True``, unschedule the\n current greenlet until the result is available or the timeout\n expires. In the latter case, :class:`gevent.Timeout` is\n raised.\n "; +static PyMethodDef __pyx_mdef_6gevent_9_greenlet_8Greenlet_35get = {"get", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_9_greenlet_8Greenlet_35get, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_9_greenlet_8Greenlet_34get}; +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_35get(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_block = 0; + PyObject *__pyx_v_timeout = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_block,&__pyx_n_s_timeout,0}; + PyObject* values[2] = {0,0}; + values[0] = ((PyObject *)Py_True); + values[1] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_block); + if (value) { values[0] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 1: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_timeout); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get") < 0)) __PYX_ERR(0, 667, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_block = values[0]; + __pyx_v_timeout = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("get", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 667, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent._greenlet.Greenlet.get", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_9_greenlet_8Greenlet_34get(((struct __pyx_obj_6gevent_9_greenlet_Greenlet *)__pyx_v_self), __pyx_v_block, __pyx_v_timeout); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_34get(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self, PyObject *__pyx_v_block, PyObject *__pyx_v_timeout) { + PyObject *__pyx_v_switch = NULL; + PyObject *__pyx_v_t = NULL; + PyObject *__pyx_v_result = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + int __pyx_t_10; + int __pyx_t_11; + char const *__pyx_t_12; + PyObject *__pyx_t_13 = NULL; + PyObject *__pyx_t_14 = NULL; + PyObject *__pyx_t_15 = NULL; + PyObject *__pyx_t_16 = NULL; + PyObject *__pyx_t_17 = NULL; + PyObject *__pyx_t_18 = NULL; + PyObject *__pyx_t_19 = NULL; + PyObject *__pyx_t_20 = NULL; + __Pyx_RefNannySetupContext("get", 0); + + /* "src/gevent/greenlet.py":680 + * raised. + * """ + * if self.ready(): # <<<<<<<<<<<<<< + * if self.successful(): + * return self.value + */ + __pyx_t_1 = (((struct __pyx_vtabstruct_6gevent_9_greenlet_Greenlet *)__pyx_v_self->__pyx_vtab)->ready(__pyx_v_self, 0) != 0); + if (__pyx_t_1) { + + /* "src/gevent/greenlet.py":681 + * """ + * if self.ready(): + * if self.successful(): # <<<<<<<<<<<<<< + * return self.value + * self._raise_exception() + */ + __pyx_t_1 = (((struct __pyx_vtabstruct_6gevent_9_greenlet_Greenlet *)__pyx_v_self->__pyx_vtab)->successful(__pyx_v_self, 0) != 0); + if (__pyx_t_1) { + + /* "src/gevent/greenlet.py":682 + * if self.ready(): + * if self.successful(): + * return self.value # <<<<<<<<<<<<<< + * self._raise_exception() + * if not block: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->value); + __pyx_r = __pyx_v_self->value; + goto __pyx_L0; + + /* "src/gevent/greenlet.py":681 + * """ + * if self.ready(): + * if self.successful(): # <<<<<<<<<<<<<< + * return self.value + * self._raise_exception() + */ + } + + /* "src/gevent/greenlet.py":683 + * if self.successful(): + * return self.value + * self._raise_exception() # <<<<<<<<<<<<<< + * if not block: + * raise Timeout() + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_raise_exception); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 683, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 683, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/greenlet.py":680 + * raised. + * """ + * if self.ready(): # <<<<<<<<<<<<<< + * if self.successful(): + * return self.value + */ + } + + /* "src/gevent/greenlet.py":684 + * return self.value + * self._raise_exception() + * if not block: # <<<<<<<<<<<<<< + * raise Timeout() + * + */ + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_block); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 684, __pyx_L1_error) + __pyx_t_5 = ((!__pyx_t_1) != 0); + if (unlikely(__pyx_t_5)) { + + /* "src/gevent/greenlet.py":685 + * self._raise_exception() + * if not block: + * raise Timeout() # <<<<<<<<<<<<<< + * + * switch = getcurrent().switch # pylint:disable=undefined-variable + */ + __Pyx_INCREF(__pyx_v_6gevent_9_greenlet_Timeout); + __pyx_t_3 = __pyx_v_6gevent_9_greenlet_Timeout; __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 685, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 685, __pyx_L1_error) + + /* "src/gevent/greenlet.py":684 + * return self.value + * self._raise_exception() + * if not block: # <<<<<<<<<<<<<< + * raise Timeout() + * + */ + } + + /* "src/gevent/greenlet.py":687 + * raise Timeout() + * + * switch = getcurrent().switch # pylint:disable=undefined-variable # <<<<<<<<<<<<<< + * self.rawlink(switch) + * try: + */ + __pyx_t_2 = ((PyObject *)__pyx_f_6gevent_9_greenlet_getcurrent()); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 687, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_switch); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 687, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_switch = __pyx_t_3; + __pyx_t_3 = 0; + + /* "src/gevent/greenlet.py":688 + * + * switch = getcurrent().switch # pylint:disable=undefined-variable + * self.rawlink(switch) # <<<<<<<<<<<<<< + * try: + * t = Timeout._start_new_or_dummy(timeout) + */ + __pyx_t_3 = ((struct __pyx_vtabstruct_6gevent_9_greenlet_Greenlet *)__pyx_v_self->__pyx_vtab)->rawlink(__pyx_v_self, __pyx_v_switch, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 688, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "src/gevent/greenlet.py":689 + * switch = getcurrent().switch # pylint:disable=undefined-variable + * self.rawlink(switch) + * try: # <<<<<<<<<<<<<< + * t = Timeout._start_new_or_dummy(timeout) + * try: + */ + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); + __Pyx_XGOTREF(__pyx_t_6); + __Pyx_XGOTREF(__pyx_t_7); + __Pyx_XGOTREF(__pyx_t_8); + /*try:*/ { + + /* "src/gevent/greenlet.py":690 + * self.rawlink(switch) + * try: + * t = Timeout._start_new_or_dummy(timeout) # <<<<<<<<<<<<<< + * try: + * result = self.parent.switch() + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_6gevent_9_greenlet_Timeout, __pyx_n_s_start_new_or_dummy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 690, __pyx_L6_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_v_timeout) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_timeout); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 690, __pyx_L6_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_t = __pyx_t_3; + __pyx_t_3 = 0; + + /* "src/gevent/greenlet.py":691 + * try: + * t = Timeout._start_new_or_dummy(timeout) + * try: # <<<<<<<<<<<<<< + * result = self.parent.switch() + * if result is not self: + */ + /*try:*/ { + + /* "src/gevent/greenlet.py":692 + * t = Timeout._start_new_or_dummy(timeout) + * try: + * result = self.parent.switch() # <<<<<<<<<<<<<< + * if result is not self: + * raise InvalidSwitchError('Invalid switch into Greenlet.get(): %r' % (result, )) + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_parent); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 692, __pyx_L13_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_switch); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 692, __pyx_L13_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_2)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + } + } + __pyx_t_3 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 692, __pyx_L13_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_result = __pyx_t_3; + __pyx_t_3 = 0; + + /* "src/gevent/greenlet.py":693 + * try: + * result = self.parent.switch() + * if result is not self: # <<<<<<<<<<<<<< + * raise InvalidSwitchError('Invalid switch into Greenlet.get(): %r' % (result, )) + * finally: + */ + __pyx_t_5 = (__pyx_v_result != ((PyObject *)__pyx_v_self)); + __pyx_t_1 = (__pyx_t_5 != 0); + if (unlikely(__pyx_t_1)) { + + /* "src/gevent/greenlet.py":694 + * result = self.parent.switch() + * if result is not self: + * raise InvalidSwitchError('Invalid switch into Greenlet.get(): %r' % (result, )) # <<<<<<<<<<<<<< + * finally: + * t.cancel() + */ + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 694, __pyx_L13_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_result); + __Pyx_GIVEREF(__pyx_v_result); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_result); + __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_switch_into_Greenlet_get, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 694, __pyx_L13_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_INCREF(__pyx_v_6gevent_9_greenlet_InvalidSwitchError); + __pyx_t_4 = __pyx_v_6gevent_9_greenlet_InvalidSwitchError; __pyx_t_9 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_9)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_9); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + } + } + __pyx_t_3 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_9, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_2); + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 694, __pyx_L13_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(0, 694, __pyx_L13_error) + + /* "src/gevent/greenlet.py":693 + * try: + * result = self.parent.switch() + * if result is not self: # <<<<<<<<<<<<<< + * raise InvalidSwitchError('Invalid switch into Greenlet.get(): %r' % (result, )) + * finally: + */ + } + } + + /* "src/gevent/greenlet.py":696 + * raise InvalidSwitchError('Invalid switch into Greenlet.get(): %r' % (result, )) + * finally: + * t.cancel() # <<<<<<<<<<<<<< + * except: + * # unlinking in 'except' instead of finally is an optimization: + */ + /*finally:*/ { + /*normal exit:*/{ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_t, __pyx_n_s_cancel); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 696, __pyx_L6_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_2)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + } + } + __pyx_t_3 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 696, __pyx_L6_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L14; + } + __pyx_L13_error:; + /*exception exit:*/{ + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18); + if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15) < 0)) __Pyx_ErrFetch(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15); + __Pyx_XGOTREF(__pyx_t_13); + __Pyx_XGOTREF(__pyx_t_14); + __Pyx_XGOTREF(__pyx_t_15); + __Pyx_XGOTREF(__pyx_t_16); + __Pyx_XGOTREF(__pyx_t_17); + __Pyx_XGOTREF(__pyx_t_18); + __pyx_t_10 = __pyx_lineno; __pyx_t_11 = __pyx_clineno; __pyx_t_12 = __pyx_filename; + { + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_t, __pyx_n_s_cancel); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 696, __pyx_L17_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_2)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + } + } + __pyx_t_3 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 696, __pyx_L17_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + if (PY_MAJOR_VERSION >= 3) { + __Pyx_XGIVEREF(__pyx_t_16); + __Pyx_XGIVEREF(__pyx_t_17); + __Pyx_XGIVEREF(__pyx_t_18); + __Pyx_ExceptionReset(__pyx_t_16, __pyx_t_17, __pyx_t_18); + } + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_XGIVEREF(__pyx_t_15); + __Pyx_ErrRestore(__pyx_t_13, __pyx_t_14, __pyx_t_15); + __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; + __pyx_lineno = __pyx_t_10; __pyx_clineno = __pyx_t_11; __pyx_filename = __pyx_t_12; + goto __pyx_L6_error; + __pyx_L17_error:; + if (PY_MAJOR_VERSION >= 3) { + __Pyx_XGIVEREF(__pyx_t_16); + __Pyx_XGIVEREF(__pyx_t_17); + __Pyx_XGIVEREF(__pyx_t_18); + __Pyx_ExceptionReset(__pyx_t_16, __pyx_t_17, __pyx_t_18); + } + __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; + __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; + goto __pyx_L6_error; + } + __pyx_L14:; + } + + /* "src/gevent/greenlet.py":689 + * switch = getcurrent().switch # pylint:disable=undefined-variable + * self.rawlink(switch) + * try: # <<<<<<<<<<<<<< + * t = Timeout._start_new_or_dummy(timeout) + * try: + */ + } + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + goto __pyx_L11_try_end; + __pyx_L6_error:; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "src/gevent/greenlet.py":697 + * finally: + * t.cancel() + * except: # <<<<<<<<<<<<<< + * # unlinking in 'except' instead of finally is an optimization: + * # if switch occurred normally then link was already removed in _notify_links + */ + /*except:*/ { + __Pyx_AddTraceback("gevent._greenlet.Greenlet.get", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_4, &__pyx_t_2) < 0) __PYX_ERR(0, 697, __pyx_L8_except_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_2); + + /* "src/gevent/greenlet.py":703 + * # Note, however, that if "Invalid switch" assert was removed and invalid switch + * # did happen, the link would remain, causing another invalid switch later in this greenlet. + * self.unlink(switch) # <<<<<<<<<<<<<< + * raise + * + */ + __pyx_t_19 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_unlink); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 703, __pyx_L8_except_error) + __Pyx_GOTREF(__pyx_t_19); + __pyx_t_20 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_19))) { + __pyx_t_20 = PyMethod_GET_SELF(__pyx_t_19); + if (likely(__pyx_t_20)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_19); + __Pyx_INCREF(__pyx_t_20); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_19, function); + } + } + __pyx_t_9 = (__pyx_t_20) ? __Pyx_PyObject_Call2Args(__pyx_t_19, __pyx_t_20, __pyx_v_switch) : __Pyx_PyObject_CallOneArg(__pyx_t_19, __pyx_v_switch); + __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0; + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 703, __pyx_L8_except_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "src/gevent/greenlet.py":704 + * # did happen, the link would remain, causing another invalid switch later in this greenlet. + * self.unlink(switch) + * raise # <<<<<<<<<<<<<< + * + * if self.ready(): + */ + __Pyx_GIVEREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_ErrRestoreWithState(__pyx_t_3, __pyx_t_4, __pyx_t_2); + __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_t_2 = 0; + __PYX_ERR(0, 704, __pyx_L8_except_error) + } + __pyx_L8_except_error:; + + /* "src/gevent/greenlet.py":689 + * switch = getcurrent().switch # pylint:disable=undefined-variable + * self.rawlink(switch) + * try: # <<<<<<<<<<<<<< + * t = Timeout._start_new_or_dummy(timeout) + * try: + */ + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); + goto __pyx_L1_error; + __pyx_L11_try_end:; + } + + /* "src/gevent/greenlet.py":706 + * raise + * + * if self.ready(): # <<<<<<<<<<<<<< + * if self.successful(): + * return self.value + */ + __pyx_t_1 = (((struct __pyx_vtabstruct_6gevent_9_greenlet_Greenlet *)__pyx_v_self->__pyx_vtab)->ready(__pyx_v_self, 0) != 0); + if (__pyx_t_1) { + + /* "src/gevent/greenlet.py":707 + * + * if self.ready(): + * if self.successful(): # <<<<<<<<<<<<<< + * return self.value + * self._raise_exception() + */ + __pyx_t_1 = (((struct __pyx_vtabstruct_6gevent_9_greenlet_Greenlet *)__pyx_v_self->__pyx_vtab)->successful(__pyx_v_self, 0) != 0); + if (__pyx_t_1) { + + /* "src/gevent/greenlet.py":708 + * if self.ready(): + * if self.successful(): + * return self.value # <<<<<<<<<<<<<< + * self._raise_exception() + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->value); + __pyx_r = __pyx_v_self->value; + goto __pyx_L0; + + /* "src/gevent/greenlet.py":707 + * + * if self.ready(): + * if self.successful(): # <<<<<<<<<<<<<< + * return self.value + * self._raise_exception() + */ + } + + /* "src/gevent/greenlet.py":709 + * if self.successful(): + * return self.value + * self._raise_exception() # <<<<<<<<<<<<<< + * + * def join(self, timeout=None): + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_raise_exception); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 709, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + } + } + __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 709, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/greenlet.py":706 + * raise + * + * if self.ready(): # <<<<<<<<<<<<<< + * if self.successful(): + * return self.value + */ + } + + /* "src/gevent/greenlet.py":667 + * # thus it should not raise when the greenlet is already killed (= not started) + * + * def get(self, block=True, timeout=None): # <<<<<<<<<<<<<< + * """ + * get(block=True, timeout=None) -> object + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_19); + __Pyx_XDECREF(__pyx_t_20); + __Pyx_AddTraceback("gevent._greenlet.Greenlet.get", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_switch); + __Pyx_XDECREF(__pyx_v_t); + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/greenlet.py":711 + * self._raise_exception() + * + * def join(self, timeout=None): # <<<<<<<<<<<<<< + * """ + * join(timeout=None) -> None + */ + +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_37join(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_6gevent_9_greenlet_8Greenlet_join(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_9_greenlet_8Greenlet_join *__pyx_optional_args) { + PyObject *__pyx_v_timeout = ((PyObject *)Py_None); + PyObject *__pyx_v_switch = NULL; + PyObject *__pyx_v_t = NULL; + PyObject *__pyx_v_result = NULL; + PyObject *__pyx_v_ex = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + int __pyx_t_9; + int __pyx_t_10; + int __pyx_t_11; + char const *__pyx_t_12; + PyObject *__pyx_t_13 = NULL; + PyObject *__pyx_t_14 = NULL; + PyObject *__pyx_t_15 = NULL; + PyObject *__pyx_t_16 = NULL; + PyObject *__pyx_t_17 = NULL; + PyObject *__pyx_t_18 = NULL; + PyObject *__pyx_t_19 = NULL; + PyObject *__pyx_t_20 = NULL; + char const *__pyx_t_21; + __Pyx_RefNannySetupContext("join", 0); + if (__pyx_optional_args) { + if (__pyx_optional_args->__pyx_n > 0) { + __pyx_v_timeout = __pyx_optional_args->timeout; + } + } + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0; + if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self)))))); + else { + PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + #endif + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_join); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 711, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_9_greenlet_8Greenlet_37join)) { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_timeout) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_timeout); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 711, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0; + if (unlikely(type_dict_guard != tp_dict_version)) { + tp_dict_version = obj_dict_version = 0; + } + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + } + #endif + } + + /* "src/gevent/greenlet.py":718 + * ``None`` regardless. + * """ + * if self.ready(): # <<<<<<<<<<<<<< + * return + * + */ + __pyx_t_5 = (((struct __pyx_vtabstruct_6gevent_9_greenlet_Greenlet *)__pyx_v_self->__pyx_vtab)->ready(__pyx_v_self, 0) != 0); + if (__pyx_t_5) { + + /* "src/gevent/greenlet.py":719 + * """ + * if self.ready(): + * return # <<<<<<<<<<<<<< + * + * switch = getcurrent().switch # pylint:disable=undefined-variable + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + + /* "src/gevent/greenlet.py":718 + * ``None`` regardless. + * """ + * if self.ready(): # <<<<<<<<<<<<<< + * return + * + */ + } + + /* "src/gevent/greenlet.py":721 + * return + * + * switch = getcurrent().switch # pylint:disable=undefined-variable # <<<<<<<<<<<<<< + * self.rawlink(switch) + * try: + */ + __pyx_t_1 = ((PyObject *)__pyx_f_6gevent_9_greenlet_getcurrent()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 721, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_switch); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 721, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_switch = __pyx_t_2; + __pyx_t_2 = 0; + + /* "src/gevent/greenlet.py":722 + * + * switch = getcurrent().switch # pylint:disable=undefined-variable + * self.rawlink(switch) # <<<<<<<<<<<<<< + * try: + * t = Timeout._start_new_or_dummy(timeout) + */ + __pyx_t_2 = ((struct __pyx_vtabstruct_6gevent_9_greenlet_Greenlet *)__pyx_v_self->__pyx_vtab)->rawlink(__pyx_v_self, __pyx_v_switch, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 722, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/greenlet.py":723 + * switch = getcurrent().switch # pylint:disable=undefined-variable + * self.rawlink(switch) + * try: # <<<<<<<<<<<<<< + * t = Timeout._start_new_or_dummy(timeout) + * try: + */ + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); + __Pyx_XGOTREF(__pyx_t_6); + __Pyx_XGOTREF(__pyx_t_7); + __Pyx_XGOTREF(__pyx_t_8); + /*try:*/ { + + /* "src/gevent/greenlet.py":724 + * self.rawlink(switch) + * try: + * t = Timeout._start_new_or_dummy(timeout) # <<<<<<<<<<<<<< + * try: + * result = self.parent.switch() + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_6gevent_9_greenlet_Timeout, __pyx_n_s_start_new_or_dummy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 724, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_1, function); + } + } + __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_3, __pyx_v_timeout) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_timeout); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 724, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_t = __pyx_t_2; + __pyx_t_2 = 0; + + /* "src/gevent/greenlet.py":725 + * try: + * t = Timeout._start_new_or_dummy(timeout) + * try: # <<<<<<<<<<<<<< + * result = self.parent.switch() + * if result is not self: + */ + /*try:*/ { + + /* "src/gevent/greenlet.py":726 + * t = Timeout._start_new_or_dummy(timeout) + * try: + * result = self.parent.switch() # <<<<<<<<<<<<<< + * if result is not self: + * raise InvalidSwitchError('Invalid switch into Greenlet.join(): %r' % (result, )) + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_parent); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 726, __pyx_L11_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_switch); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 726, __pyx_L11_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_1)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_1); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_1) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1) : __Pyx_PyObject_CallNoArg(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 726, __pyx_L11_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_result = __pyx_t_2; + __pyx_t_2 = 0; + + /* "src/gevent/greenlet.py":727 + * try: + * result = self.parent.switch() + * if result is not self: # <<<<<<<<<<<<<< + * raise InvalidSwitchError('Invalid switch into Greenlet.join(): %r' % (result, )) + * finally: + */ + __pyx_t_5 = (__pyx_v_result != ((PyObject *)__pyx_v_self)); + __pyx_t_9 = (__pyx_t_5 != 0); + if (unlikely(__pyx_t_9)) { + + /* "src/gevent/greenlet.py":728 + * result = self.parent.switch() + * if result is not self: + * raise InvalidSwitchError('Invalid switch into Greenlet.join(): %r' % (result, )) # <<<<<<<<<<<<<< + * finally: + * t.cancel() + */ + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 728, __pyx_L11_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_result); + __Pyx_GIVEREF(__pyx_v_result); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_result); + __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_switch_into_Greenlet_joi, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 728, __pyx_L11_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_INCREF(__pyx_v_6gevent_9_greenlet_InvalidSwitchError); + __pyx_t_3 = __pyx_v_6gevent_9_greenlet_InvalidSwitchError; __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_t_1) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 728, __pyx_L11_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 728, __pyx_L11_error) + + /* "src/gevent/greenlet.py":727 + * try: + * result = self.parent.switch() + * if result is not self: # <<<<<<<<<<<<<< + * raise InvalidSwitchError('Invalid switch into Greenlet.join(): %r' % (result, )) + * finally: + */ + } + } + + /* "src/gevent/greenlet.py":730 + * raise InvalidSwitchError('Invalid switch into Greenlet.join(): %r' % (result, )) + * finally: + * t.cancel() # <<<<<<<<<<<<<< + * except Timeout as ex: + * self.unlink(switch) + */ + /*finally:*/ { + /*normal exit:*/{ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_t, __pyx_n_s_cancel); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 730, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_1)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_1); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_1) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1) : __Pyx_PyObject_CallNoArg(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 730, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + goto __pyx_L12; + } + __pyx_L11_error:; + /*exception exit:*/{ + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18); + if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15) < 0)) __Pyx_ErrFetch(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15); + __Pyx_XGOTREF(__pyx_t_13); + __Pyx_XGOTREF(__pyx_t_14); + __Pyx_XGOTREF(__pyx_t_15); + __Pyx_XGOTREF(__pyx_t_16); + __Pyx_XGOTREF(__pyx_t_17); + __Pyx_XGOTREF(__pyx_t_18); + __pyx_t_10 = __pyx_lineno; __pyx_t_11 = __pyx_clineno; __pyx_t_12 = __pyx_filename; + { + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_t, __pyx_n_s_cancel); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 730, __pyx_L15_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_1)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_1); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_1) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1) : __Pyx_PyObject_CallNoArg(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 730, __pyx_L15_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + if (PY_MAJOR_VERSION >= 3) { + __Pyx_XGIVEREF(__pyx_t_16); + __Pyx_XGIVEREF(__pyx_t_17); + __Pyx_XGIVEREF(__pyx_t_18); + __Pyx_ExceptionReset(__pyx_t_16, __pyx_t_17, __pyx_t_18); + } + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_XGIVEREF(__pyx_t_15); + __Pyx_ErrRestore(__pyx_t_13, __pyx_t_14, __pyx_t_15); + __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; + __pyx_lineno = __pyx_t_10; __pyx_clineno = __pyx_t_11; __pyx_filename = __pyx_t_12; + goto __pyx_L4_error; + __pyx_L15_error:; + if (PY_MAJOR_VERSION >= 3) { + __Pyx_XGIVEREF(__pyx_t_16); + __Pyx_XGIVEREF(__pyx_t_17); + __Pyx_XGIVEREF(__pyx_t_18); + __Pyx_ExceptionReset(__pyx_t_16, __pyx_t_17, __pyx_t_18); + } + __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; + __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; + goto __pyx_L4_error; + } + __pyx_L12:; + } + + /* "src/gevent/greenlet.py":723 + * switch = getcurrent().switch # pylint:disable=undefined-variable + * self.rawlink(switch) + * try: # <<<<<<<<<<<<<< + * t = Timeout._start_new_or_dummy(timeout) + * try: + */ + } + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + goto __pyx_L9_try_end; + __pyx_L4_error:; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/greenlet.py":731 + * finally: + * t.cancel() + * except Timeout as ex: # <<<<<<<<<<<<<< + * self.unlink(switch) + * if ex is not t: + */ + __pyx_t_11 = __Pyx_PyErr_ExceptionMatches(__pyx_v_6gevent_9_greenlet_Timeout); + if (__pyx_t_11) { + __Pyx_AddTraceback("gevent._greenlet.Greenlet.join", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_3, &__pyx_t_1) < 0) __PYX_ERR(0, 731, __pyx_L6_except_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_t_3); + __pyx_v_ex = __pyx_t_3; + /*try:*/ { + + /* "src/gevent/greenlet.py":732 + * t.cancel() + * except Timeout as ex: + * self.unlink(switch) # <<<<<<<<<<<<<< + * if ex is not t: + * raise + */ + __pyx_t_19 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_unlink); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 732, __pyx_L21_error) + __Pyx_GOTREF(__pyx_t_19); + __pyx_t_20 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_19))) { + __pyx_t_20 = PyMethod_GET_SELF(__pyx_t_19); + if (likely(__pyx_t_20)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_19); + __Pyx_INCREF(__pyx_t_20); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_19, function); + } + } + __pyx_t_4 = (__pyx_t_20) ? __Pyx_PyObject_Call2Args(__pyx_t_19, __pyx_t_20, __pyx_v_switch) : __Pyx_PyObject_CallOneArg(__pyx_t_19, __pyx_v_switch); + __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 732, __pyx_L21_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "src/gevent/greenlet.py":733 + * except Timeout as ex: + * self.unlink(switch) + * if ex is not t: # <<<<<<<<<<<<<< + * raise + * except: + */ + if (unlikely(!__pyx_v_t)) { __Pyx_RaiseUnboundLocalError("t"); __PYX_ERR(0, 733, __pyx_L21_error) } + __pyx_t_9 = (__pyx_v_ex != __pyx_v_t); + __pyx_t_5 = (__pyx_t_9 != 0); + if (unlikely(__pyx_t_5)) { + + /* "src/gevent/greenlet.py":734 + * self.unlink(switch) + * if ex is not t: + * raise # <<<<<<<<<<<<<< + * except: + * self.unlink(switch) + */ + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_ErrRestoreWithState(__pyx_t_2, __pyx_t_3, __pyx_t_1); + __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_1 = 0; + __PYX_ERR(0, 734, __pyx_L21_error) + + /* "src/gevent/greenlet.py":733 + * except Timeout as ex: + * self.unlink(switch) + * if ex is not t: # <<<<<<<<<<<<<< + * raise + * except: + */ + } + } + + /* "src/gevent/greenlet.py":731 + * finally: + * t.cancel() + * except Timeout as ex: # <<<<<<<<<<<<<< + * self.unlink(switch) + * if ex is not t: + */ + /*finally:*/ { + /*normal exit:*/{ + __Pyx_DECREF(__pyx_v_ex); + __pyx_v_ex = NULL; + goto __pyx_L22; + } + __pyx_L21_error:; + /*exception exit:*/{ + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __pyx_t_18 = 0; __pyx_t_17 = 0; __pyx_t_16 = 0; __pyx_t_15 = 0; __pyx_t_14 = 0; __pyx_t_13 = 0; + __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0; + __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_15, &__pyx_t_14, &__pyx_t_13); + if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_18, &__pyx_t_17, &__pyx_t_16) < 0)) __Pyx_ErrFetch(&__pyx_t_18, &__pyx_t_17, &__pyx_t_16); + __Pyx_XGOTREF(__pyx_t_18); + __Pyx_XGOTREF(__pyx_t_17); + __Pyx_XGOTREF(__pyx_t_16); + __Pyx_XGOTREF(__pyx_t_15); + __Pyx_XGOTREF(__pyx_t_14); + __Pyx_XGOTREF(__pyx_t_13); + __pyx_t_11 = __pyx_lineno; __pyx_t_10 = __pyx_clineno; __pyx_t_21 = __pyx_filename; + { + __Pyx_DECREF(__pyx_v_ex); + __pyx_v_ex = NULL; + } + if (PY_MAJOR_VERSION >= 3) { + __Pyx_XGIVEREF(__pyx_t_15); + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_ExceptionReset(__pyx_t_15, __pyx_t_14, __pyx_t_13); + } + __Pyx_XGIVEREF(__pyx_t_18); + __Pyx_XGIVEREF(__pyx_t_17); + __Pyx_XGIVEREF(__pyx_t_16); + __Pyx_ErrRestore(__pyx_t_18, __pyx_t_17, __pyx_t_16); + __pyx_t_18 = 0; __pyx_t_17 = 0; __pyx_t_16 = 0; __pyx_t_15 = 0; __pyx_t_14 = 0; __pyx_t_13 = 0; + __pyx_lineno = __pyx_t_11; __pyx_clineno = __pyx_t_10; __pyx_filename = __pyx_t_21; + goto __pyx_L6_except_error; + } + __pyx_L22:; + } + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L5_exception_handled; + } + + /* "src/gevent/greenlet.py":735 + * if ex is not t: + * raise + * except: # <<<<<<<<<<<<<< + * self.unlink(switch) + * raise + */ + /*except:*/ { + __Pyx_AddTraceback("gevent._greenlet.Greenlet.join", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_3, &__pyx_t_2) < 0) __PYX_ERR(0, 735, __pyx_L6_except_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GOTREF(__pyx_t_2); + + /* "src/gevent/greenlet.py":736 + * raise + * except: + * self.unlink(switch) # <<<<<<<<<<<<<< + * raise + * + */ + __pyx_t_19 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_unlink); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 736, __pyx_L6_except_error) + __Pyx_GOTREF(__pyx_t_19); + __pyx_t_20 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_19))) { + __pyx_t_20 = PyMethod_GET_SELF(__pyx_t_19); + if (likely(__pyx_t_20)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_19); + __Pyx_INCREF(__pyx_t_20); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_19, function); + } + } + __pyx_t_4 = (__pyx_t_20) ? __Pyx_PyObject_Call2Args(__pyx_t_19, __pyx_t_20, __pyx_v_switch) : __Pyx_PyObject_CallOneArg(__pyx_t_19, __pyx_v_switch); + __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 736, __pyx_L6_except_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "src/gevent/greenlet.py":737 + * except: + * self.unlink(switch) + * raise # <<<<<<<<<<<<<< + * + * def _report_result(self, result): + */ + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_ErrRestoreWithState(__pyx_t_1, __pyx_t_3, __pyx_t_2); + __pyx_t_1 = 0; __pyx_t_3 = 0; __pyx_t_2 = 0; + __PYX_ERR(0, 737, __pyx_L6_except_error) + } + __pyx_L6_except_error:; + + /* "src/gevent/greenlet.py":723 + * switch = getcurrent().switch # pylint:disable=undefined-variable + * self.rawlink(switch) + * try: # <<<<<<<<<<<<<< + * t = Timeout._start_new_or_dummy(timeout) + * try: + */ + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); + goto __pyx_L1_error; + __pyx_L5_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); + __pyx_L9_try_end:; + } + + /* "src/gevent/greenlet.py":711 + * self._raise_exception() + * + * def join(self, timeout=None): # <<<<<<<<<<<<<< + * """ + * join(timeout=None) -> None + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_19); + __Pyx_XDECREF(__pyx_t_20); + __Pyx_AddTraceback("gevent._greenlet.Greenlet.join", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_switch); + __Pyx_XDECREF(__pyx_v_t); + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XDECREF(__pyx_v_ex); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_37join(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6gevent_9_greenlet_8Greenlet_36join[] = "Greenlet.join(self, timeout=None)\n\n join(timeout=None) -> None\n\n Wait until the greenlet finishes or *timeout* expires. Return\n ``None`` regardless.\n "; +static PyMethodDef __pyx_mdef_6gevent_9_greenlet_8Greenlet_37join = {"join", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_9_greenlet_8Greenlet_37join, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_9_greenlet_8Greenlet_36join}; +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_37join(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_timeout = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("join (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_timeout,0}; + PyObject* values[1] = {0}; + values[0] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_timeout); + if (value) { values[0] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "join") < 0)) __PYX_ERR(0, 711, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_timeout = values[0]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("join", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 711, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent._greenlet.Greenlet.join", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_9_greenlet_8Greenlet_36join(((struct __pyx_obj_6gevent_9_greenlet_Greenlet *)__pyx_v_self), __pyx_v_timeout); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_36join(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self, PyObject *__pyx_v_timeout) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + struct __pyx_opt_args_6gevent_9_greenlet_8Greenlet_join __pyx_t_2; + __Pyx_RefNannySetupContext("join", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_2.__pyx_n = 1; + __pyx_t_2.timeout = __pyx_v_timeout; + __pyx_t_1 = __pyx_vtabptr_6gevent_9_greenlet_Greenlet->join(__pyx_v_self, 1, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 711, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent._greenlet.Greenlet.join", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/greenlet.py":739 + * raise + * + * def _report_result(self, result): # <<<<<<<<<<<<<< + * self._exc_info = (None, None, None) + * self.value = result + */ + +static PyObject *__pyx_f_6gevent_9_greenlet_8Greenlet__report_result(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self, PyObject *__pyx_v_result) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + __Pyx_RefNannySetupContext("_report_result", 0); + + /* "src/gevent/greenlet.py":740 + * + * def _report_result(self, result): + * self._exc_info = (None, None, None) # <<<<<<<<<<<<<< + * self.value = result + * if self._links and not self._notifier: + */ + __Pyx_INCREF(__pyx_tuple__11); + __Pyx_GIVEREF(__pyx_tuple__11); + __Pyx_GOTREF(__pyx_v_self->_exc_info); + __Pyx_DECREF(__pyx_v_self->_exc_info); + __pyx_v_self->_exc_info = __pyx_tuple__11; + + /* "src/gevent/greenlet.py":741 + * def _report_result(self, result): + * self._exc_info = (None, None, None) + * self.value = result # <<<<<<<<<<<<<< + * if self._links and not self._notifier: + * self._notifier = self.parent.loop.run_callback(self._notify_links) + */ + __Pyx_INCREF(__pyx_v_result); + __Pyx_GIVEREF(__pyx_v_result); + __Pyx_GOTREF(__pyx_v_self->value); + __Pyx_DECREF(__pyx_v_self->value); + __pyx_v_self->value = __pyx_v_result; + + /* "src/gevent/greenlet.py":742 + * self._exc_info = (None, None, None) + * self.value = result + * if self._links and not self._notifier: # <<<<<<<<<<<<<< + * self._notifier = self.parent.loop.run_callback(self._notify_links) + * + */ + __pyx_t_2 = (__pyx_v_self->_links != Py_None)&&(PyList_GET_SIZE(__pyx_v_self->_links) != 0); + if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_self->_notifier); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 742, __pyx_L1_error) + __pyx_t_3 = ((!__pyx_t_2) != 0); + __pyx_t_1 = __pyx_t_3; + __pyx_L4_bool_binop_done:; + if (__pyx_t_1) { + + /* "src/gevent/greenlet.py":743 + * self.value = result + * if self._links and not self._notifier: + * self._notifier = self.parent.loop.run_callback(self._notify_links) # <<<<<<<<<<<<<< + * + * def _report_error(self, exc_info): + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_parent); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 743, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_loop); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 743, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_run_callback); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 743, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_notify_links); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 743, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5); + if (likely(__pyx_t_7)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_7); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_5, function); + } + } + __pyx_t_4 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_7, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 743, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GIVEREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_v_self->_notifier); + __Pyx_DECREF(__pyx_v_self->_notifier); + __pyx_v_self->_notifier = __pyx_t_4; + __pyx_t_4 = 0; + + /* "src/gevent/greenlet.py":742 + * self._exc_info = (None, None, None) + * self.value = result + * if self._links and not self._notifier: # <<<<<<<<<<<<<< + * self._notifier = self.parent.loop.run_callback(self._notify_links) + * + */ + } + + /* "src/gevent/greenlet.py":739 + * raise + * + * def _report_result(self, result): # <<<<<<<<<<<<<< + * self._exc_info = (None, None, None) + * self.value = result + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("gevent._greenlet.Greenlet._report_result", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/greenlet.py":745 + * self._notifier = self.parent.loop.run_callback(self._notify_links) + * + * def _report_error(self, exc_info): # <<<<<<<<<<<<<< + * if isinstance(exc_info[1], GreenletExit): + * self._report_result(exc_info[1]) + */ + +static PyObject *__pyx_f_6gevent_9_greenlet_8Greenlet__report_error(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self, PyObject *__pyx_v_exc_info) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + int __pyx_t_9; + int __pyx_t_10; + int __pyx_t_11; + char const *__pyx_t_12; + PyObject *__pyx_t_13 = NULL; + PyObject *__pyx_t_14 = NULL; + PyObject *__pyx_t_15 = NULL; + PyObject *__pyx_t_16 = NULL; + PyObject *__pyx_t_17 = NULL; + PyObject *__pyx_t_18 = NULL; + __Pyx_RefNannySetupContext("_report_error", 0); + __Pyx_INCREF(__pyx_v_exc_info); + + /* "src/gevent/greenlet.py":746 + * + * def _report_error(self, exc_info): + * if isinstance(exc_info[1], GreenletExit): # <<<<<<<<<<<<<< + * self._report_result(exc_info[1]) + * return + */ + if (unlikely(__pyx_v_exc_info == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 746, __pyx_L1_error) + } + __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v_exc_info, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 746, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __pyx_v_6gevent_9_greenlet_GreenletExit; + __Pyx_INCREF(__pyx_t_2); + __pyx_t_3 = PyObject_IsInstance(__pyx_t_1, __pyx_t_2); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 746, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_4 = (__pyx_t_3 != 0); + if (__pyx_t_4) { + + /* "src/gevent/greenlet.py":747 + * def _report_error(self, exc_info): + * if isinstance(exc_info[1], GreenletExit): + * self._report_result(exc_info[1]) # <<<<<<<<<<<<<< + * return + * + */ + if (unlikely(__pyx_v_exc_info == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 747, __pyx_L1_error) + } + __pyx_t_2 = __Pyx_GetItemInt_Tuple(__pyx_v_exc_info, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 747, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_9_greenlet_Greenlet *)__pyx_v_self->__pyx_vtab)->_report_result(__pyx_v_self, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 747, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/greenlet.py":748 + * if isinstance(exc_info[1], GreenletExit): + * self._report_result(exc_info[1]) + * return # <<<<<<<<<<<<<< + * + * self._exc_info = exc_info[0], exc_info[1], dump_traceback(exc_info[2]) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + + /* "src/gevent/greenlet.py":746 + * + * def _report_error(self, exc_info): + * if isinstance(exc_info[1], GreenletExit): # <<<<<<<<<<<<<< + * self._report_result(exc_info[1]) + * return + */ + } + + /* "src/gevent/greenlet.py":750 + * return + * + * self._exc_info = exc_info[0], exc_info[1], dump_traceback(exc_info[2]) # <<<<<<<<<<<<<< + * + * if self._links and not self._notifier: + */ + if (unlikely(__pyx_v_exc_info == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 750, __pyx_L1_error) + } + __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v_exc_info, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 750, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (unlikely(__pyx_v_exc_info == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 750, __pyx_L1_error) + } + __pyx_t_2 = __Pyx_GetItemInt_Tuple(__pyx_v_exc_info, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 750, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (unlikely(__pyx_v_exc_info == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 750, __pyx_L1_error) + } + __pyx_t_6 = __Pyx_GetItemInt_Tuple(__pyx_v_exc_info, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 750, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(__pyx_v_6gevent_9_greenlet_dump_traceback); + __pyx_t_7 = __pyx_v_6gevent_9_greenlet_dump_traceback; __pyx_t_8 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) { + __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); + if (likely(__pyx_t_8)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); + __Pyx_INCREF(__pyx_t_8); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_7, function); + } + } + __pyx_t_5 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_8, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6); + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 750, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 750, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_5); + __pyx_t_1 = 0; + __pyx_t_2 = 0; + __pyx_t_5 = 0; + __Pyx_GIVEREF(__pyx_t_7); + __Pyx_GOTREF(__pyx_v_self->_exc_info); + __Pyx_DECREF(__pyx_v_self->_exc_info); + __pyx_v_self->_exc_info = ((PyObject*)__pyx_t_7); + __pyx_t_7 = 0; + + /* "src/gevent/greenlet.py":752 + * self._exc_info = exc_info[0], exc_info[1], dump_traceback(exc_info[2]) + * + * if self._links and not self._notifier: # <<<<<<<<<<<<<< + * self._notifier = self.parent.loop.run_callback(self._notify_links) + * + */ + __pyx_t_3 = (__pyx_v_self->_links != Py_None)&&(PyList_GET_SIZE(__pyx_v_self->_links) != 0); + if (__pyx_t_3) { + } else { + __pyx_t_4 = __pyx_t_3; + goto __pyx_L5_bool_binop_done; + } + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_self->_notifier); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 752, __pyx_L1_error) + __pyx_t_9 = ((!__pyx_t_3) != 0); + __pyx_t_4 = __pyx_t_9; + __pyx_L5_bool_binop_done:; + if (__pyx_t_4) { + + /* "src/gevent/greenlet.py":753 + * + * if self._links and not self._notifier: + * self._notifier = self.parent.loop.run_callback(self._notify_links) # <<<<<<<<<<<<<< + * + * try: + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_parent); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 753, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_loop); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 753, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_run_callback); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 753, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_notify_links); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 753, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_5); + if (likely(__pyx_t_1)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_1); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_5, function); + } + } + __pyx_t_7 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_1, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_2); + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 753, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GIVEREF(__pyx_t_7); + __Pyx_GOTREF(__pyx_v_self->_notifier); + __Pyx_DECREF(__pyx_v_self->_notifier); + __pyx_v_self->_notifier = __pyx_t_7; + __pyx_t_7 = 0; + + /* "src/gevent/greenlet.py":752 + * self._exc_info = exc_info[0], exc_info[1], dump_traceback(exc_info[2]) + * + * if self._links and not self._notifier: # <<<<<<<<<<<<<< + * self._notifier = self.parent.loop.run_callback(self._notify_links) + * + */ + } + + /* "src/gevent/greenlet.py":755 + * self._notifier = self.parent.loop.run_callback(self._notify_links) + * + * try: # <<<<<<<<<<<<<< + * self.parent.handle_error(self, *exc_info) + * finally: + */ + /*try:*/ { + + /* "src/gevent/greenlet.py":756 + * + * try: + * self.parent.handle_error(self, *exc_info) # <<<<<<<<<<<<<< + * finally: + * del exc_info + */ + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_parent); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 756, __pyx_L8_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_handle_error); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 756, __pyx_L8_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 756, __pyx_L8_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)__pyx_v_self)); + if (unlikely(__pyx_v_exc_info == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); + __PYX_ERR(0, 756, __pyx_L8_error) + } + __pyx_t_2 = PyNumber_Add(__pyx_t_7, __pyx_v_exc_info); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 756, __pyx_L8_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_2, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 756, __pyx_L8_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } + + /* "src/gevent/greenlet.py":758 + * self.parent.handle_error(self, *exc_info) + * finally: + * del exc_info # <<<<<<<<<<<<<< + * + * def run(self): + */ + /*finally:*/ { + /*normal exit:*/{ + __Pyx_DECREF(__pyx_v_exc_info); + __pyx_v_exc_info = NULL; + goto __pyx_L9; + } + __pyx_L8_error:; + /*exception exit:*/{ + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18); + if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15) < 0)) __Pyx_ErrFetch(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15); + __Pyx_XGOTREF(__pyx_t_13); + __Pyx_XGOTREF(__pyx_t_14); + __Pyx_XGOTREF(__pyx_t_15); + __Pyx_XGOTREF(__pyx_t_16); + __Pyx_XGOTREF(__pyx_t_17); + __Pyx_XGOTREF(__pyx_t_18); + __pyx_t_10 = __pyx_lineno; __pyx_t_11 = __pyx_clineno; __pyx_t_12 = __pyx_filename; + { + __Pyx_DECREF(__pyx_v_exc_info); + __pyx_v_exc_info = NULL; + } + if (PY_MAJOR_VERSION >= 3) { + __Pyx_XGIVEREF(__pyx_t_16); + __Pyx_XGIVEREF(__pyx_t_17); + __Pyx_XGIVEREF(__pyx_t_18); + __Pyx_ExceptionReset(__pyx_t_16, __pyx_t_17, __pyx_t_18); + } + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_XGIVEREF(__pyx_t_15); + __Pyx_ErrRestore(__pyx_t_13, __pyx_t_14, __pyx_t_15); + __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; + __pyx_lineno = __pyx_t_10; __pyx_clineno = __pyx_t_11; __pyx_filename = __pyx_t_12; + goto __pyx_L1_error; + } + __pyx_L9:; + } + + /* "src/gevent/greenlet.py":745 + * self._notifier = self.parent.loop.run_callback(self._notify_links) + * + * def _report_error(self, exc_info): # <<<<<<<<<<<<<< + * if isinstance(exc_info[1], GreenletExit): + * self._report_result(exc_info[1]) + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("gevent._greenlet.Greenlet._report_error", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_exc_info); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/greenlet.py":760 + * del exc_info + * + * def run(self): # <<<<<<<<<<<<<< + * try: + * self.__cancel_start() + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_39run(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6gevent_9_greenlet_8Greenlet_38run[] = "Greenlet.run(self)"; +static PyMethodDef __pyx_mdef_6gevent_9_greenlet_8Greenlet_39run = {"run", (PyCFunction)__pyx_pw_6gevent_9_greenlet_8Greenlet_39run, METH_NOARGS, __pyx_doc_6gevent_9_greenlet_8Greenlet_38run}; +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_39run(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("run (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_9_greenlet_8Greenlet_38run(((struct __pyx_obj_6gevent_9_greenlet_Greenlet *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_38run(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self) { + PyObject *__pyx_v_result = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + int __pyx_t_10; + int __pyx_t_11; + int __pyx_t_12; + char const *__pyx_t_13; + PyObject *__pyx_t_14 = NULL; + PyObject *__pyx_t_15 = NULL; + PyObject *__pyx_t_16 = NULL; + __Pyx_RefNannySetupContext("run", 0); + + /* "src/gevent/greenlet.py":761 + * + * def run(self): + * try: # <<<<<<<<<<<<<< + * self.__cancel_start() + * self._start_event = _start_completed_event + */ + /*try:*/ { + + /* "src/gevent/greenlet.py":762 + * def run(self): + * try: + * self.__cancel_start() # <<<<<<<<<<<<<< + * self._start_event = _start_completed_event + * + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_9_greenlet_Greenlet *)__pyx_v_self->__pyx_vtab)->__pyx___cancel_start(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 762, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/greenlet.py":763 + * try: + * self.__cancel_start() + * self._start_event = _start_completed_event # <<<<<<<<<<<<<< + * + * try: + */ + __Pyx_INCREF(((PyObject *)__pyx_v_6gevent_9_greenlet__start_completed_event)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_6gevent_9_greenlet__start_completed_event)); + __Pyx_GOTREF(__pyx_v_self->_start_event); + __Pyx_DECREF(__pyx_v_self->_start_event); + __pyx_v_self->_start_event = ((PyObject *)__pyx_v_6gevent_9_greenlet__start_completed_event); + + /* "src/gevent/greenlet.py":765 + * self._start_event = _start_completed_event + * + * try: # <<<<<<<<<<<<<< + * result = self._run(*self.args, **self.kwargs) + * except: # pylint:disable=bare-except + */ + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_4); + /*try:*/ { + + /* "src/gevent/greenlet.py":766 + * + * try: + * result = self._run(*self.args, **self.kwargs) # <<<<<<<<<<<<<< + * except: # pylint:disable=bare-except + * self._report_error(sys_exc_info()) + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_run_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 766, __pyx_L6_error) + __Pyx_GOTREF(__pyx_t_1); + if (unlikely(__pyx_v_self->args == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); + __PYX_ERR(0, 766, __pyx_L6_error) + } + if (unlikely(__pyx_v_self->kwargs == Py_None)) { + PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); + __PYX_ERR(0, 766, __pyx_L6_error) + } + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_v_self->args, __pyx_v_self->kwargs); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 766, __pyx_L6_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result = __pyx_t_5; + __pyx_t_5 = 0; + + /* "src/gevent/greenlet.py":765 + * self._start_event = _start_completed_event + * + * try: # <<<<<<<<<<<<<< + * result = self._run(*self.args, **self.kwargs) + * except: # pylint:disable=bare-except + */ + } + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L11_try_end; + __pyx_L6_error:; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "src/gevent/greenlet.py":767 + * try: + * result = self._run(*self.args, **self.kwargs) + * except: # pylint:disable=bare-except # <<<<<<<<<<<<<< + * self._report_error(sys_exc_info()) + * return + */ + /*except:*/ { + __Pyx_AddTraceback("gevent._greenlet.Greenlet.run", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_1, &__pyx_t_6) < 0) __PYX_ERR(0, 767, __pyx_L8_except_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_t_6); + + /* "src/gevent/greenlet.py":768 + * result = self._run(*self.args, **self.kwargs) + * except: # pylint:disable=bare-except + * self._report_error(sys_exc_info()) # <<<<<<<<<<<<<< + * return + * self._report_result(result) + */ + __Pyx_INCREF(__pyx_v_6gevent_9_greenlet_sys_exc_info); + __pyx_t_8 = __pyx_v_6gevent_9_greenlet_sys_exc_info; __pyx_t_9 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) { + __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8); + if (likely(__pyx_t_9)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); + __Pyx_INCREF(__pyx_t_9); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_8, function); + } + } + __pyx_t_7 = (__pyx_t_9) ? __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_9) : __Pyx_PyObject_CallNoArg(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 768, __pyx_L8_except_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (!(likely(PyTuple_CheckExact(__pyx_t_7))||((__pyx_t_7) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_7)->tp_name), 0))) __PYX_ERR(0, 768, __pyx_L8_except_error) + __pyx_t_8 = ((struct __pyx_vtabstruct_6gevent_9_greenlet_Greenlet *)__pyx_v_self->__pyx_vtab)->_report_error(__pyx_v_self, ((PyObject*)__pyx_t_7)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 768, __pyx_L8_except_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + + /* "src/gevent/greenlet.py":769 + * except: # pylint:disable=bare-except + * self._report_error(sys_exc_info()) + * return # <<<<<<<<<<<<<< + * self._report_result(result) + * finally: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L9_except_return; + } + __pyx_L8_except_error:; + + /* "src/gevent/greenlet.py":765 + * self._start_event = _start_completed_event + * + * try: # <<<<<<<<<<<<<< + * result = self._run(*self.args, **self.kwargs) + * except: # pylint:disable=bare-except + */ + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4); + goto __pyx_L4_error; + __pyx_L9_except_return:; + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4); + goto __pyx_L3_return; + __pyx_L11_try_end:; + } + + /* "src/gevent/greenlet.py":770 + * self._report_error(sys_exc_info()) + * return + * self._report_result(result) # <<<<<<<<<<<<<< + * finally: + * self.__dict__.pop('_run', None) + */ + __pyx_t_6 = ((struct __pyx_vtabstruct_6gevent_9_greenlet_Greenlet *)__pyx_v_self->__pyx_vtab)->_report_result(__pyx_v_self, __pyx_v_result); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 770, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + + /* "src/gevent/greenlet.py":772 + * self._report_result(result) + * finally: + * self.__dict__.pop('_run', None) # <<<<<<<<<<<<<< + * self.args = () + * self.kwargs.clear() + */ + /*finally:*/ { + /*normal exit:*/{ + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_dict); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 772, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_pop); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 772, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 772, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "src/gevent/greenlet.py":773 + * finally: + * self.__dict__.pop('_run', None) + * self.args = () # <<<<<<<<<<<<<< + * self.kwargs.clear() + * + */ + __Pyx_INCREF(__pyx_empty_tuple); + __Pyx_GIVEREF(__pyx_empty_tuple); + __Pyx_GOTREF(__pyx_v_self->args); + __Pyx_DECREF(__pyx_v_self->args); + __pyx_v_self->args = __pyx_empty_tuple; + + /* "src/gevent/greenlet.py":774 + * self.__dict__.pop('_run', None) + * self.args = () + * self.kwargs.clear() # <<<<<<<<<<<<<< + * + * def _run(self): + */ + if (unlikely(__pyx_v_self->kwargs == Py_None)) { + PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "clear"); + __PYX_ERR(0, 774, __pyx_L1_error) + } + __pyx_t_10 = __Pyx_PyDict_Clear(__pyx_v_self->kwargs); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(0, 774, __pyx_L1_error) + goto __pyx_L5; + } + __pyx_L4_error:; + /*exception exit:*/{ + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __pyx_t_4 = 0; __pyx_t_3 = 0; __pyx_t_2 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_14, &__pyx_t_15, &__pyx_t_16); + if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_4, &__pyx_t_3, &__pyx_t_2) < 0)) __Pyx_ErrFetch(&__pyx_t_4, &__pyx_t_3, &__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_4); + __Pyx_XGOTREF(__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_14); + __Pyx_XGOTREF(__pyx_t_15); + __Pyx_XGOTREF(__pyx_t_16); + __pyx_t_11 = __pyx_lineno; __pyx_t_12 = __pyx_clineno; __pyx_t_13 = __pyx_filename; + { + + /* "src/gevent/greenlet.py":772 + * self._report_result(result) + * finally: + * self.__dict__.pop('_run', None) # <<<<<<<<<<<<<< + * self.args = () + * self.kwargs.clear() + */ + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_dict); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 772, __pyx_L15_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_pop); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 772, __pyx_L15_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 772, __pyx_L15_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "src/gevent/greenlet.py":773 + * finally: + * self.__dict__.pop('_run', None) + * self.args = () # <<<<<<<<<<<<<< + * self.kwargs.clear() + * + */ + __Pyx_INCREF(__pyx_empty_tuple); + __Pyx_GIVEREF(__pyx_empty_tuple); + __Pyx_GOTREF(__pyx_v_self->args); + __Pyx_DECREF(__pyx_v_self->args); + __pyx_v_self->args = __pyx_empty_tuple; + + /* "src/gevent/greenlet.py":774 + * self.__dict__.pop('_run', None) + * self.args = () + * self.kwargs.clear() # <<<<<<<<<<<<<< + * + * def _run(self): + */ + if (unlikely(__pyx_v_self->kwargs == Py_None)) { + PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "clear"); + __PYX_ERR(0, 774, __pyx_L15_error) + } + __pyx_t_10 = __Pyx_PyDict_Clear(__pyx_v_self->kwargs); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(0, 774, __pyx_L15_error) + } + if (PY_MAJOR_VERSION >= 3) { + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_XGIVEREF(__pyx_t_15); + __Pyx_XGIVEREF(__pyx_t_16); + __Pyx_ExceptionReset(__pyx_t_14, __pyx_t_15, __pyx_t_16); + } + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_ErrRestore(__pyx_t_4, __pyx_t_3, __pyx_t_2); + __pyx_t_4 = 0; __pyx_t_3 = 0; __pyx_t_2 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; + __pyx_lineno = __pyx_t_11; __pyx_clineno = __pyx_t_12; __pyx_filename = __pyx_t_13; + goto __pyx_L1_error; + __pyx_L15_error:; + if (PY_MAJOR_VERSION >= 3) { + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_XGIVEREF(__pyx_t_15); + __Pyx_XGIVEREF(__pyx_t_16); + __Pyx_ExceptionReset(__pyx_t_14, __pyx_t_15, __pyx_t_16); + } + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; + goto __pyx_L1_error; + } + __pyx_L3_return: { + __pyx_t_16 = __pyx_r; + __pyx_r = 0; + + /* "src/gevent/greenlet.py":772 + * self._report_result(result) + * finally: + * self.__dict__.pop('_run', None) # <<<<<<<<<<<<<< + * self.args = () + * self.kwargs.clear() + */ + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_dict); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 772, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_pop); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 772, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 772, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "src/gevent/greenlet.py":773 + * finally: + * self.__dict__.pop('_run', None) + * self.args = () # <<<<<<<<<<<<<< + * self.kwargs.clear() + * + */ + __Pyx_INCREF(__pyx_empty_tuple); + __Pyx_GIVEREF(__pyx_empty_tuple); + __Pyx_GOTREF(__pyx_v_self->args); + __Pyx_DECREF(__pyx_v_self->args); + __pyx_v_self->args = __pyx_empty_tuple; + + /* "src/gevent/greenlet.py":774 + * self.__dict__.pop('_run', None) + * self.args = () + * self.kwargs.clear() # <<<<<<<<<<<<<< + * + * def _run(self): + */ + if (unlikely(__pyx_v_self->kwargs == Py_None)) { + PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "clear"); + __PYX_ERR(0, 774, __pyx_L1_error) + } + __pyx_t_10 = __Pyx_PyDict_Clear(__pyx_v_self->kwargs); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(0, 774, __pyx_L1_error) + __pyx_r = __pyx_t_16; + __pyx_t_16 = 0; + goto __pyx_L0; + } + __pyx_L5:; + } + + /* "src/gevent/greenlet.py":760 + * del exc_info + * + * def run(self): # <<<<<<<<<<<<<< + * try: + * self.__cancel_start() + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_AddTraceback("gevent._greenlet.Greenlet.run", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/greenlet.py":776 + * self.kwargs.clear() + * + * def _run(self): # <<<<<<<<<<<<<< + * """ + * Subclasses may override this method to take any number of + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_41_run(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6gevent_9_greenlet_8Greenlet_40_run[] = "Greenlet._run(self)\n\n Subclasses may override this method to take any number of\n arguments and keyword arguments.\n\n .. versionadded:: 1.1a3\n Previously, if no callable object was\n passed to the constructor, the spawned greenlet would later\n fail with an AttributeError.\n "; +static PyMethodDef __pyx_mdef_6gevent_9_greenlet_8Greenlet_41_run = {"_run", (PyCFunction)__pyx_pw_6gevent_9_greenlet_8Greenlet_41_run, METH_NOARGS, __pyx_doc_6gevent_9_greenlet_8Greenlet_40_run}; +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_41_run(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_run (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_9_greenlet_8Greenlet_40_run(((struct __pyx_obj_6gevent_9_greenlet_Greenlet *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_40_run(CYTHON_UNUSED struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_run", 0); + + /* "src/gevent/greenlet.py":788 + * # We usually override this in __init__ + * # pylint: disable=method-hidden + * return # <<<<<<<<<<<<<< + * + * def has_links(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + + /* "src/gevent/greenlet.py":776 + * self.kwargs.clear() + * + * def _run(self): # <<<<<<<<<<<<<< + * """ + * Subclasses may override this method to take any number of + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/greenlet.py":790 + * return + * + * def has_links(self): # <<<<<<<<<<<<<< + * return len(self._links) + * + */ + +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_43has_links(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static int __pyx_f_6gevent_9_greenlet_8Greenlet_has_links(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self, int __pyx_skip_dispatch) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + Py_ssize_t __pyx_t_6; + __Pyx_RefNannySetupContext("has_links", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0; + if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self)))))); + else { + PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + #endif + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_has_links); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 790, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_9_greenlet_8Greenlet_43has_links)) { + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 790, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 790, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_5; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0; + if (unlikely(type_dict_guard != tp_dict_version)) { + tp_dict_version = obj_dict_version = 0; + } + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + } + #endif + } + + /* "src/gevent/greenlet.py":791 + * + * def has_links(self): + * return len(self._links) # <<<<<<<<<<<<<< + * + * def rawlink(self, callback): + */ + __pyx_t_1 = __pyx_v_self->_links; + __Pyx_INCREF(__pyx_t_1); + if (unlikely(__pyx_t_1 == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + __PYX_ERR(0, 791, __pyx_L1_error) + } + __pyx_t_6 = PyList_GET_SIZE(__pyx_t_1); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 791, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_6; + goto __pyx_L0; + + /* "src/gevent/greenlet.py":790 + * return + * + * def has_links(self): # <<<<<<<<<<<<<< + * return len(self._links) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_WriteUnraisable("gevent._greenlet.Greenlet.has_links", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_43has_links(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6gevent_9_greenlet_8Greenlet_42has_links[] = "Greenlet.has_links(self) -> bool"; +static PyMethodDef __pyx_mdef_6gevent_9_greenlet_8Greenlet_43has_links = {"has_links", (PyCFunction)__pyx_pw_6gevent_9_greenlet_8Greenlet_43has_links, METH_NOARGS, __pyx_doc_6gevent_9_greenlet_8Greenlet_42has_links}; +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_43has_links(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("has_links (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_9_greenlet_8Greenlet_42has_links(((struct __pyx_obj_6gevent_9_greenlet_Greenlet *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_42has_links(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("has_links", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_f_6gevent_9_greenlet_8Greenlet_has_links(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 790, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent._greenlet.Greenlet.has_links", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/greenlet.py":793 + * return len(self._links) + * + * def rawlink(self, callback): # <<<<<<<<<<<<<< + * """ + * Register a callable to be executed when the greenlet finishes + */ + +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_45rawlink(PyObject *__pyx_v_self, PyObject *__pyx_v_callback); /*proto*/ +static PyObject *__pyx_f_6gevent_9_greenlet_8Greenlet_rawlink(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self, PyObject *__pyx_v_callback, int __pyx_skip_dispatch) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + int __pyx_t_6; + int __pyx_t_7; + int __pyx_t_8; + __Pyx_RefNannySetupContext("rawlink", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0; + if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self)))))); + else { + PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + #endif + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_rawlink); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 793, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_9_greenlet_8Greenlet_45rawlink)) { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_callback) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_callback); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 793, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0; + if (unlikely(type_dict_guard != tp_dict_version)) { + tp_dict_version = obj_dict_version = 0; + } + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + } + #endif + } + + /* "src/gevent/greenlet.py":803 + * .. caution:: The callable will be called in the HUB greenlet. + * """ + * if not callable(callback): # <<<<<<<<<<<<<< + * raise TypeError('Expected callable: %r' % (callback, )) + * self._links.append(callback) # pylint:disable=no-member + */ + __pyx_t_5 = __Pyx_PyCallable_Check(__pyx_v_callback); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 803, __pyx_L1_error) + __pyx_t_6 = ((!(__pyx_t_5 != 0)) != 0); + if (unlikely(__pyx_t_6)) { + + /* "src/gevent/greenlet.py":804 + * """ + * if not callable(callback): + * raise TypeError('Expected callable: %r' % (callback, )) # <<<<<<<<<<<<<< + * self._links.append(callback) # pylint:disable=no-member + * if self.ready() and self._links and not self._notifier: + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 804, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_callback); + __Pyx_GIVEREF(__pyx_v_callback); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_callback); + __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_Expected_callable_r, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 804, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 804, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 804, __pyx_L1_error) + + /* "src/gevent/greenlet.py":803 + * .. caution:: The callable will be called in the HUB greenlet. + * """ + * if not callable(callback): # <<<<<<<<<<<<<< + * raise TypeError('Expected callable: %r' % (callback, )) + * self._links.append(callback) # pylint:disable=no-member + */ + } + + /* "src/gevent/greenlet.py":805 + * if not callable(callback): + * raise TypeError('Expected callable: %r' % (callback, )) + * self._links.append(callback) # pylint:disable=no-member # <<<<<<<<<<<<<< + * if self.ready() and self._links and not self._notifier: + * self._notifier = self.parent.loop.run_callback(self._notify_links) + */ + if (unlikely(__pyx_v_self->_links == Py_None)) { + PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "append"); + __PYX_ERR(0, 805, __pyx_L1_error) + } + __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_self->_links, __pyx_v_callback); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 805, __pyx_L1_error) + + /* "src/gevent/greenlet.py":806 + * raise TypeError('Expected callable: %r' % (callback, )) + * self._links.append(callback) # pylint:disable=no-member + * if self.ready() and self._links and not self._notifier: # <<<<<<<<<<<<<< + * self._notifier = self.parent.loop.run_callback(self._notify_links) + * + */ + __pyx_t_5 = (((struct __pyx_vtabstruct_6gevent_9_greenlet_Greenlet *)__pyx_v_self->__pyx_vtab)->ready(__pyx_v_self, 0) != 0); + if (__pyx_t_5) { + } else { + __pyx_t_6 = __pyx_t_5; + goto __pyx_L5_bool_binop_done; + } + __pyx_t_5 = (__pyx_v_self->_links != Py_None)&&(PyList_GET_SIZE(__pyx_v_self->_links) != 0); + if (__pyx_t_5) { + } else { + __pyx_t_6 = __pyx_t_5; + goto __pyx_L5_bool_binop_done; + } + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_self->_notifier); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 806, __pyx_L1_error) + __pyx_t_8 = ((!__pyx_t_5) != 0); + __pyx_t_6 = __pyx_t_8; + __pyx_L5_bool_binop_done:; + if (__pyx_t_6) { + + /* "src/gevent/greenlet.py":807 + * self._links.append(callback) # pylint:disable=no-member + * if self.ready() and self._links and not self._notifier: + * self._notifier = self.parent.loop.run_callback(self._notify_links) # <<<<<<<<<<<<<< + * + * def link(self, callback, SpawnedLink=SpawnedLink): + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_parent); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 807, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_loop); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 807, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_run_callback); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 807, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_notify_links); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 807, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 807, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_self->_notifier); + __Pyx_DECREF(__pyx_v_self->_notifier); + __pyx_v_self->_notifier = __pyx_t_1; + __pyx_t_1 = 0; + + /* "src/gevent/greenlet.py":806 + * raise TypeError('Expected callable: %r' % (callback, )) + * self._links.append(callback) # pylint:disable=no-member + * if self.ready() and self._links and not self._notifier: # <<<<<<<<<<<<<< + * self._notifier = self.parent.loop.run_callback(self._notify_links) + * + */ + } + + /* "src/gevent/greenlet.py":793 + * return len(self._links) + * + * def rawlink(self, callback): # <<<<<<<<<<<<<< + * """ + * Register a callable to be executed when the greenlet finishes + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("gevent._greenlet.Greenlet.rawlink", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_45rawlink(PyObject *__pyx_v_self, PyObject *__pyx_v_callback); /*proto*/ +static char __pyx_doc_6gevent_9_greenlet_8Greenlet_44rawlink[] = "Greenlet.rawlink(self, callback)\n\n Register a callable to be executed when the greenlet finishes\n execution.\n\n The *callback* will be called with this instance as an\n argument.\n\n .. caution:: The callable will be called in the HUB greenlet.\n "; +static PyMethodDef __pyx_mdef_6gevent_9_greenlet_8Greenlet_45rawlink = {"rawlink", (PyCFunction)__pyx_pw_6gevent_9_greenlet_8Greenlet_45rawlink, METH_O, __pyx_doc_6gevent_9_greenlet_8Greenlet_44rawlink}; +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_45rawlink(PyObject *__pyx_v_self, PyObject *__pyx_v_callback) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("rawlink (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_9_greenlet_8Greenlet_44rawlink(((struct __pyx_obj_6gevent_9_greenlet_Greenlet *)__pyx_v_self), ((PyObject *)__pyx_v_callback)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_44rawlink(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self, PyObject *__pyx_v_callback) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("rawlink", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6gevent_9_greenlet_8Greenlet_rawlink(__pyx_v_self, __pyx_v_callback, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 793, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent._greenlet.Greenlet.rawlink", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/greenlet.py":809 + * self._notifier = self.parent.loop.run_callback(self._notify_links) + * + * def link(self, callback, SpawnedLink=SpawnedLink): # <<<<<<<<<<<<<< + * """ + * Link greenlet's completion to a callable. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_47link(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6gevent_9_greenlet_8Greenlet_46link[] = "Greenlet.link(self, callback, SpawnedLink=SpawnedLink)\n\n Link greenlet's completion to a callable.\n\n The *callback* will be called with this instance as an\n argument once this greenlet is dead. A callable is called in\n its own :class:`greenlet.greenlet` (*not* a\n :class:`Greenlet`).\n "; +static PyMethodDef __pyx_mdef_6gevent_9_greenlet_8Greenlet_47link = {"link", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_9_greenlet_8Greenlet_47link, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_9_greenlet_8Greenlet_46link}; +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_47link(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_callback = 0; + PyObject *__pyx_v_SpawnedLink = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("link (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_callback,&__pyx_n_s_SpawnedLink,0}; + PyObject* values[2] = {0,0}; + values[1] = __pyx_k__13; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_callback)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_SpawnedLink); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "link") < 0)) __PYX_ERR(0, 809, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_callback = values[0]; + __pyx_v_SpawnedLink = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("link", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 809, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent._greenlet.Greenlet.link", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_9_greenlet_8Greenlet_46link(((struct __pyx_obj_6gevent_9_greenlet_Greenlet *)__pyx_v_self), __pyx_v_callback, __pyx_v_SpawnedLink); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_46link(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self, PyObject *__pyx_v_callback, PyObject *__pyx_v_SpawnedLink) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("link", 0); + + /* "src/gevent/greenlet.py":821 + * # optimization, or do people use it? It's not documented + * # pylint:disable=redefined-outer-name + * self.rawlink(SpawnedLink(callback)) # <<<<<<<<<<<<<< + * + * def unlink(self, callback): + */ + __Pyx_INCREF(__pyx_v_SpawnedLink); + __pyx_t_2 = __pyx_v_SpawnedLink; __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_callback) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_callback); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 821, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = ((struct __pyx_vtabstruct_6gevent_9_greenlet_Greenlet *)__pyx_v_self->__pyx_vtab)->rawlink(__pyx_v_self, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 821, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/greenlet.py":809 + * self._notifier = self.parent.loop.run_callback(self._notify_links) + * + * def link(self, callback, SpawnedLink=SpawnedLink): # <<<<<<<<<<<<<< + * """ + * Link greenlet's completion to a callable. + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("gevent._greenlet.Greenlet.link", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/greenlet.py":823 + * self.rawlink(SpawnedLink(callback)) + * + * def unlink(self, callback): # <<<<<<<<<<<<<< + * """Remove the callback set by :meth:`link` or :meth:`rawlink`""" + * try: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_49unlink(PyObject *__pyx_v_self, PyObject *__pyx_v_callback); /*proto*/ +static char __pyx_doc_6gevent_9_greenlet_8Greenlet_48unlink[] = "Greenlet.unlink(self, callback)\nRemove the callback set by :meth:`link` or :meth:`rawlink`"; +static PyMethodDef __pyx_mdef_6gevent_9_greenlet_8Greenlet_49unlink = {"unlink", (PyCFunction)__pyx_pw_6gevent_9_greenlet_8Greenlet_49unlink, METH_O, __pyx_doc_6gevent_9_greenlet_8Greenlet_48unlink}; +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_49unlink(PyObject *__pyx_v_self, PyObject *__pyx_v_callback) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("unlink (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_9_greenlet_8Greenlet_48unlink(((struct __pyx_obj_6gevent_9_greenlet_Greenlet *)__pyx_v_self), ((PyObject *)__pyx_v_callback)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_48unlink(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self, PyObject *__pyx_v_callback) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + __Pyx_RefNannySetupContext("unlink", 0); + + /* "src/gevent/greenlet.py":825 + * def unlink(self, callback): + * """Remove the callback set by :meth:`link` or :meth:`rawlink`""" + * try: # <<<<<<<<<<<<<< + * self._links.remove(callback) # pylint:disable=no-member + * except ValueError: + */ + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "src/gevent/greenlet.py":826 + * """Remove the callback set by :meth:`link` or :meth:`rawlink`""" + * try: + * self._links.remove(callback) # pylint:disable=no-member # <<<<<<<<<<<<<< + * except ValueError: + * pass + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_links, __pyx_n_s_remove); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 826, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); + if (likely(__pyx_t_6)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_5, function); + } + } + __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_v_callback) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_callback); + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 826, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "src/gevent/greenlet.py":825 + * def unlink(self, callback): + * """Remove the callback set by :meth:`link` or :meth:`rawlink`""" + * try: # <<<<<<<<<<<<<< + * self._links.remove(callback) # pylint:disable=no-member + * except ValueError: + */ + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L8_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "src/gevent/greenlet.py":827 + * try: + * self._links.remove(callback) # pylint:disable=no-member + * except ValueError: # <<<<<<<<<<<<<< + * pass + * + */ + __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ValueError); + if (__pyx_t_7) { + __Pyx_ErrRestore(0,0,0); + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + + /* "src/gevent/greenlet.py":825 + * def unlink(self, callback): + * """Remove the callback set by :meth:`link` or :meth:`rawlink`""" + * try: # <<<<<<<<<<<<<< + * self._links.remove(callback) # pylint:disable=no-member + * except ValueError: + */ + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L8_try_end:; + } + + /* "src/gevent/greenlet.py":823 + * self.rawlink(SpawnedLink(callback)) + * + * def unlink(self, callback): # <<<<<<<<<<<<<< + * """Remove the callback set by :meth:`link` or :meth:`rawlink`""" + * try: + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("gevent._greenlet.Greenlet.unlink", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/greenlet.py":830 + * pass + * + * def unlink_all(self): # <<<<<<<<<<<<<< + * """ + * Remove all the callbacks. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_51unlink_all(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6gevent_9_greenlet_8Greenlet_50unlink_all[] = "Greenlet.unlink_all(self)\n\n Remove all the callbacks.\n\n .. versionadded:: 1.3a2\n "; +static PyMethodDef __pyx_mdef_6gevent_9_greenlet_8Greenlet_51unlink_all = {"unlink_all", (PyCFunction)__pyx_pw_6gevent_9_greenlet_8Greenlet_51unlink_all, METH_NOARGS, __pyx_doc_6gevent_9_greenlet_8Greenlet_50unlink_all}; +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_51unlink_all(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("unlink_all (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_9_greenlet_8Greenlet_50unlink_all(((struct __pyx_obj_6gevent_9_greenlet_Greenlet *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_50unlink_all(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("unlink_all", 0); + + /* "src/gevent/greenlet.py":836 + * .. versionadded:: 1.3a2 + * """ + * del self._links[:] # <<<<<<<<<<<<<< + * + * def link_value(self, callback, SpawnedLink=SuccessSpawnedLink): + */ + if (unlikely(__pyx_v_self->_links == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 836, __pyx_L1_error) + } + if (__Pyx_PyObject_DelSlice(__pyx_v_self->_links, 0, 0, NULL, NULL, NULL, 0, 0, 1) < 0) __PYX_ERR(0, 836, __pyx_L1_error) + + /* "src/gevent/greenlet.py":830 + * pass + * + * def unlink_all(self): # <<<<<<<<<<<<<< + * """ + * Remove all the callbacks. + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("gevent._greenlet.Greenlet.unlink_all", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/greenlet.py":838 + * del self._links[:] + * + * def link_value(self, callback, SpawnedLink=SuccessSpawnedLink): # <<<<<<<<<<<<<< + * """ + * Like :meth:`link` but *callback* is only notified when the greenlet + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_53link_value(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6gevent_9_greenlet_8Greenlet_52link_value[] = "Greenlet.link_value(self, callback, SpawnedLink=SuccessSpawnedLink)\n\n Like :meth:`link` but *callback* is only notified when the greenlet\n has completed successfully.\n "; +static PyMethodDef __pyx_mdef_6gevent_9_greenlet_8Greenlet_53link_value = {"link_value", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_9_greenlet_8Greenlet_53link_value, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_9_greenlet_8Greenlet_52link_value}; +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_53link_value(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_callback = 0; + PyObject *__pyx_v_SpawnedLink = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("link_value (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_callback,&__pyx_n_s_SpawnedLink,0}; + PyObject* values[2] = {0,0}; + values[1] = __pyx_k__14; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_callback)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_SpawnedLink); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "link_value") < 0)) __PYX_ERR(0, 838, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_callback = values[0]; + __pyx_v_SpawnedLink = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("link_value", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 838, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent._greenlet.Greenlet.link_value", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_9_greenlet_8Greenlet_52link_value(((struct __pyx_obj_6gevent_9_greenlet_Greenlet *)__pyx_v_self), __pyx_v_callback, __pyx_v_SpawnedLink); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_52link_value(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self, PyObject *__pyx_v_callback, PyObject *__pyx_v_SpawnedLink) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + __Pyx_RefNannySetupContext("link_value", 0); + + /* "src/gevent/greenlet.py":844 + * """ + * # pylint:disable=redefined-outer-name + * self.link(callback, SpawnedLink=SpawnedLink) # <<<<<<<<<<<<<< + * + * def link_exception(self, callback, SpawnedLink=FailureSpawnedLink): + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_link); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 844, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 844, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_callback); + __Pyx_GIVEREF(__pyx_v_callback); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_callback); + __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 844, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_SpawnedLink, __pyx_v_SpawnedLink) < 0) __PYX_ERR(0, 844, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 844, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "src/gevent/greenlet.py":838 + * del self._links[:] + * + * def link_value(self, callback, SpawnedLink=SuccessSpawnedLink): # <<<<<<<<<<<<<< + * """ + * Like :meth:`link` but *callback* is only notified when the greenlet + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("gevent._greenlet.Greenlet.link_value", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/greenlet.py":846 + * self.link(callback, SpawnedLink=SpawnedLink) + * + * def link_exception(self, callback, SpawnedLink=FailureSpawnedLink): # <<<<<<<<<<<<<< + * """ + * Like :meth:`link` but *callback* is only notified when the + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_55link_exception(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6gevent_9_greenlet_8Greenlet_54link_exception[] = "Greenlet.link_exception(self, callback, SpawnedLink=FailureSpawnedLink)\n\n Like :meth:`link` but *callback* is only notified when the\n greenlet dies because of an unhandled exception.\n "; +static PyMethodDef __pyx_mdef_6gevent_9_greenlet_8Greenlet_55link_exception = {"link_exception", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_9_greenlet_8Greenlet_55link_exception, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_9_greenlet_8Greenlet_54link_exception}; +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_55link_exception(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_callback = 0; + PyObject *__pyx_v_SpawnedLink = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("link_exception (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_callback,&__pyx_n_s_SpawnedLink,0}; + PyObject* values[2] = {0,0}; + values[1] = __pyx_k__15; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_callback)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_SpawnedLink); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "link_exception") < 0)) __PYX_ERR(0, 846, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_callback = values[0]; + __pyx_v_SpawnedLink = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("link_exception", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 846, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent._greenlet.Greenlet.link_exception", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_9_greenlet_8Greenlet_54link_exception(((struct __pyx_obj_6gevent_9_greenlet_Greenlet *)__pyx_v_self), __pyx_v_callback, __pyx_v_SpawnedLink); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_54link_exception(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self, PyObject *__pyx_v_callback, PyObject *__pyx_v_SpawnedLink) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + __Pyx_RefNannySetupContext("link_exception", 0); + + /* "src/gevent/greenlet.py":852 + * """ + * # pylint:disable=redefined-outer-name + * self.link(callback, SpawnedLink=SpawnedLink) # <<<<<<<<<<<<<< + * + * def _notify_links(self): + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_link); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 852, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 852, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_callback); + __Pyx_GIVEREF(__pyx_v_callback); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_callback); + __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 852, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_SpawnedLink, __pyx_v_SpawnedLink) < 0) __PYX_ERR(0, 852, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 852, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "src/gevent/greenlet.py":846 + * self.link(callback, SpawnedLink=SpawnedLink) + * + * def link_exception(self, callback, SpawnedLink=FailureSpawnedLink): # <<<<<<<<<<<<<< + * """ + * Like :meth:`link` but *callback* is only notified when the + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("gevent._greenlet.Greenlet.link_exception", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/greenlet.py":854 + * self.link(callback, SpawnedLink=SpawnedLink) + * + * def _notify_links(self): # <<<<<<<<<<<<<< + * while self._links: + * # Early links are allowed to remove later links + */ + +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_57_notify_links(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_f_6gevent_9_greenlet_8Greenlet__notify_links(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self, int __pyx_skip_dispatch) { + PyObject *__pyx_v_link = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + __Pyx_RefNannySetupContext("_notify_links", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0; + if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self)))))); + else { + PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + #endif + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_notify_links); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 854, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_9_greenlet_8Greenlet_57_notify_links)) { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 854, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0; + if (unlikely(type_dict_guard != tp_dict_version)) { + tp_dict_version = obj_dict_version = 0; + } + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + } + #endif + } + + /* "src/gevent/greenlet.py":855 + * + * def _notify_links(self): + * while self._links: # <<<<<<<<<<<<<< + * # Early links are allowed to remove later links + * # before we get to them, and they're also allowed to + */ + while (1) { + __pyx_t_5 = (__pyx_v_self->_links != Py_None)&&(PyList_GET_SIZE(__pyx_v_self->_links) != 0); + if (!__pyx_t_5) break; + + /* "src/gevent/greenlet.py":863 + * # manipulating it should be small. a deque is probably not justified. + * # Cython has optimizations to transform this into a memmove anyway. + * link = self._links.pop(0) # <<<<<<<<<<<<<< + * try: + * link(self) + */ + if (unlikely(__pyx_v_self->_links == Py_None)) { + PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "pop"); + __PYX_ERR(0, 863, __pyx_L1_error) + } + __pyx_t_1 = __Pyx_PyList_PopIndex(__pyx_v_self->_links, __pyx_int_0, 0, 1, Py_ssize_t, PyInt_FromSsize_t); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 863, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XDECREF_SET(__pyx_v_link, __pyx_t_1); + __pyx_t_1 = 0; + + /* "src/gevent/greenlet.py":864 + * # Cython has optimizations to transform this into a memmove anyway. + * link = self._links.pop(0) + * try: # <<<<<<<<<<<<<< + * link(self) + * except: # pylint:disable=bare-except + */ + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); + __Pyx_XGOTREF(__pyx_t_6); + __Pyx_XGOTREF(__pyx_t_7); + __Pyx_XGOTREF(__pyx_t_8); + /*try:*/ { + + /* "src/gevent/greenlet.py":865 + * link = self._links.pop(0) + * try: + * link(self) # <<<<<<<<<<<<<< + * except: # pylint:disable=bare-except + * self.parent.handle_error((link, self), *sys_exc_info()) + */ + __Pyx_INCREF(__pyx_v_link); + __pyx_t_2 = __pyx_v_link; __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, ((PyObject *)__pyx_v_self)) : __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_v_self)); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 865, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/greenlet.py":864 + * # Cython has optimizations to transform this into a memmove anyway. + * link = self._links.pop(0) + * try: # <<<<<<<<<<<<<< + * link(self) + * except: # pylint:disable=bare-except + */ + } + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + goto __pyx_L12_try_end; + __pyx_L5_error:; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/greenlet.py":866 + * try: + * link(self) + * except: # pylint:disable=bare-except # <<<<<<<<<<<<<< + * self.parent.handle_error((link, self), *sys_exc_info()) + * + */ + /*except:*/ { + __Pyx_AddTraceback("gevent._greenlet.Greenlet._notify_links", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3) < 0) __PYX_ERR(0, 866, __pyx_L7_except_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_t_3); + + /* "src/gevent/greenlet.py":867 + * link(self) + * except: # pylint:disable=bare-except + * self.parent.handle_error((link, self), *sys_exc_info()) # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_parent); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 867, __pyx_L7_except_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_handle_error); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 867, __pyx_L7_except_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 867, __pyx_L7_except_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_link); + __Pyx_GIVEREF(__pyx_v_link); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_link); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_4, 1, ((PyObject *)__pyx_v_self)); + __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 867, __pyx_L7_except_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_4); + __pyx_t_4 = 0; + __Pyx_INCREF(__pyx_v_6gevent_9_greenlet_sys_exc_info); + __pyx_t_11 = __pyx_v_6gevent_9_greenlet_sys_exc_info; __pyx_t_12 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_11))) { + __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_11); + if (likely(__pyx_t_12)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11); + __Pyx_INCREF(__pyx_t_12); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_11, function); + } + } + __pyx_t_4 = (__pyx_t_12) ? __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_t_12) : __Pyx_PyObject_CallNoArg(__pyx_t_11); + __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 867, __pyx_L7_except_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_11 = __Pyx_PySequence_Tuple(__pyx_t_4); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 867, __pyx_L7_except_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyNumber_Add(__pyx_t_10, __pyx_t_11); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 867, __pyx_L7_except_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_4, NULL); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 867, __pyx_L7_except_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L6_exception_handled; + } + __pyx_L7_except_error:; + + /* "src/gevent/greenlet.py":864 + * # Cython has optimizations to transform this into a memmove anyway. + * link = self._links.pop(0) + * try: # <<<<<<<<<<<<<< + * link(self) + * except: # pylint:disable=bare-except + */ + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); + goto __pyx_L1_error; + __pyx_L6_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); + __pyx_L12_try_end:; + } + } + + /* "src/gevent/greenlet.py":854 + * self.link(callback, SpawnedLink=SpawnedLink) + * + * def _notify_links(self): # <<<<<<<<<<<<<< + * while self._links: + * # Early links are allowed to remove later links + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_AddTraceback("gevent._greenlet.Greenlet._notify_links", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_link); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_57_notify_links(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6gevent_9_greenlet_8Greenlet_56_notify_links[] = "Greenlet._notify_links(self)"; +static PyMethodDef __pyx_mdef_6gevent_9_greenlet_8Greenlet_57_notify_links = {"_notify_links", (PyCFunction)__pyx_pw_6gevent_9_greenlet_8Greenlet_57_notify_links, METH_NOARGS, __pyx_doc_6gevent_9_greenlet_8Greenlet_56_notify_links}; +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_57_notify_links(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_notify_links (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_9_greenlet_8Greenlet_56_notify_links(((struct __pyx_obj_6gevent_9_greenlet_Greenlet *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_56_notify_links(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("_notify_links", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6gevent_9_greenlet_8Greenlet__notify_links(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 854, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent._greenlet.Greenlet._notify_links", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/_greenlet.pxd":87 + * + * cdef class Greenlet(greenlet): + * cdef readonly object value # <<<<<<<<<<<<<< + * cdef readonly tuple args + * cdef readonly dict kwargs + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_5value_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_5value_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_9_greenlet_8Greenlet_5value___get__(((struct __pyx_obj_6gevent_9_greenlet_Greenlet *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_5value___get__(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->value); + __pyx_r = __pyx_v_self->value; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/_greenlet.pxd":88 + * cdef class Greenlet(greenlet): + * cdef readonly object value + * cdef readonly tuple args # <<<<<<<<<<<<<< + * cdef readonly dict kwargs + * cdef readonly object spawning_greenlet + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_4args_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_4args_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_9_greenlet_8Greenlet_4args___get__(((struct __pyx_obj_6gevent_9_greenlet_Greenlet *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_4args___get__(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->args); + __pyx_r = __pyx_v_self->args; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/_greenlet.pxd":89 + * cdef readonly object value + * cdef readonly tuple args + * cdef readonly dict kwargs # <<<<<<<<<<<<<< + * cdef readonly object spawning_greenlet + * cdef public dict spawn_tree_locals + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_6kwargs_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_6kwargs_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_9_greenlet_8Greenlet_6kwargs___get__(((struct __pyx_obj_6gevent_9_greenlet_Greenlet *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_6kwargs___get__(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->kwargs); + __pyx_r = __pyx_v_self->kwargs; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/_greenlet.pxd":90 + * cdef readonly tuple args + * cdef readonly dict kwargs + * cdef readonly object spawning_greenlet # <<<<<<<<<<<<<< + * cdef public dict spawn_tree_locals + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_17spawning_greenlet_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_17spawning_greenlet_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_9_greenlet_8Greenlet_17spawning_greenlet___get__(((struct __pyx_obj_6gevent_9_greenlet_Greenlet *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_17spawning_greenlet___get__(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->spawning_greenlet); + __pyx_r = __pyx_v_self->spawning_greenlet; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/_greenlet.pxd":91 + * cdef readonly dict kwargs + * cdef readonly object spawning_greenlet + * cdef public dict spawn_tree_locals # <<<<<<<<<<<<<< + * + * # This is accessed with getattr() dynamically so it + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_17spawn_tree_locals_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_17spawn_tree_locals_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_9_greenlet_8Greenlet_17spawn_tree_locals___get__(((struct __pyx_obj_6gevent_9_greenlet_Greenlet *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_17spawn_tree_locals___get__(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->spawn_tree_locals); + __pyx_r = __pyx_v_self->spawn_tree_locals; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6gevent_9_greenlet_8Greenlet_17spawn_tree_locals_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6gevent_9_greenlet_8Greenlet_17spawn_tree_locals_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_9_greenlet_8Greenlet_17spawn_tree_locals_2__set__(((struct __pyx_obj_6gevent_9_greenlet_Greenlet *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_9_greenlet_8Greenlet_17spawn_tree_locals_2__set__(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__set__", 0); + if (!(likely(PyDict_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_v_value)->tp_name), 0))) __PYX_ERR(1, 91, __pyx_L1_error) + __pyx_t_1 = __pyx_v_value; + __Pyx_INCREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_self->spawn_tree_locals); + __Pyx_DECREF(__pyx_v_self->spawn_tree_locals); + __pyx_v_self->spawn_tree_locals = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent._greenlet.Greenlet.spawn_tree_locals.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6gevent_9_greenlet_8Greenlet_17spawn_tree_locals_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6gevent_9_greenlet_8Greenlet_17spawn_tree_locals_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_9_greenlet_8Greenlet_17spawn_tree_locals_4__del__(((struct __pyx_obj_6gevent_9_greenlet_Greenlet *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_9_greenlet_8Greenlet_17spawn_tree_locals_4__del__(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->spawn_tree_locals); + __Pyx_DECREF(__pyx_v_self->spawn_tree_locals); + __pyx_v_self->spawn_tree_locals = ((PyObject*)Py_None); + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/_greenlet.pxd":95 + * # This is accessed with getattr() dynamically so it + * # must be visible to Python + * cdef readonly list _spawning_stack_frames # <<<<<<<<<<<<<< + * + * cdef list _links + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_22_spawning_stack_frames_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_22_spawning_stack_frames_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_9_greenlet_8Greenlet_22_spawning_stack_frames___get__(((struct __pyx_obj_6gevent_9_greenlet_Greenlet *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_22_spawning_stack_frames___get__(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->_spawning_stack_frames); + __pyx_r = __pyx_v_self->_spawning_stack_frames; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/greenlet.py":873 + * __slots__ = ('pending', 'active') + * + * def __init__(self): # <<<<<<<<<<<<<< + * self.pending = self.active = False + * + */ + +/* Python wrapper */ +static int __pyx_pw_6gevent_9_greenlet_12_dummy_event_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6gevent_9_greenlet_12_dummy_event_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { + __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;} + if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1; + __pyx_r = __pyx_pf_6gevent_9_greenlet_12_dummy_event___init__(((struct __pyx_obj_6gevent_9_greenlet__dummy_event *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_9_greenlet_12_dummy_event___init__(struct __pyx_obj_6gevent_9_greenlet__dummy_event *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__", 0); + + /* "src/gevent/greenlet.py":874 + * + * def __init__(self): + * self.pending = self.active = False # <<<<<<<<<<<<<< + * + * def stop(self): + */ + __pyx_v_self->pending = 0; + __pyx_v_self->active = 0; + + /* "src/gevent/greenlet.py":873 + * __slots__ = ('pending', 'active') + * + * def __init__(self): # <<<<<<<<<<<<<< + * self.pending = self.active = False + * + */ + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/greenlet.py":876 + * self.pending = self.active = False + * + * def stop(self): # <<<<<<<<<<<<<< + * pass + * + */ + +static PyObject *__pyx_pw_6gevent_9_greenlet_12_dummy_event_3stop(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_f_6gevent_9_greenlet_12_dummy_event_stop(CYTHON_UNUSED struct __pyx_obj_6gevent_9_greenlet__dummy_event *__pyx_v_self, CYTHON_UNUSED int __pyx_skip_dispatch) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stop", 0); + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_9_greenlet_12_dummy_event_3stop(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6gevent_9_greenlet_12_dummy_event_2stop[] = "_dummy_event.stop(self)"; +static PyMethodDef __pyx_mdef_6gevent_9_greenlet_12_dummy_event_3stop = {"stop", (PyCFunction)__pyx_pw_6gevent_9_greenlet_12_dummy_event_3stop, METH_NOARGS, __pyx_doc_6gevent_9_greenlet_12_dummy_event_2stop}; +static PyObject *__pyx_pw_6gevent_9_greenlet_12_dummy_event_3stop(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stop (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_9_greenlet_12_dummy_event_2stop(((struct __pyx_obj_6gevent_9_greenlet__dummy_event *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_9_greenlet_12_dummy_event_2stop(struct __pyx_obj_6gevent_9_greenlet__dummy_event *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("stop", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6gevent_9_greenlet_12_dummy_event_stop(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 876, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent._greenlet._dummy_event.stop", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/greenlet.py":879 + * pass + * + * def start(self, cb): # pylint:disable=unused-argument # <<<<<<<<<<<<<< + * raise AssertionError("Cannot start the dummy event") + * + */ + +static PyObject *__pyx_pw_6gevent_9_greenlet_12_dummy_event_5start(PyObject *__pyx_v_self, PyObject *__pyx_v_cb); /*proto*/ +static PyObject *__pyx_f_6gevent_9_greenlet_12_dummy_event_start(CYTHON_UNUSED struct __pyx_obj_6gevent_9_greenlet__dummy_event *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_cb, CYTHON_UNUSED int __pyx_skip_dispatch) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("start", 0); + + /* "src/gevent/greenlet.py":880 + * + * def start(self, cb): # pylint:disable=unused-argument + * raise AssertionError("Cannot start the dummy event") # <<<<<<<<<<<<<< + * + * def close(self): + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_AssertionError, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 880, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 880, __pyx_L1_error) + + /* "src/gevent/greenlet.py":879 + * pass + * + * def start(self, cb): # pylint:disable=unused-argument # <<<<<<<<<<<<<< + * raise AssertionError("Cannot start the dummy event") + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent._greenlet._dummy_event.start", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_9_greenlet_12_dummy_event_5start(PyObject *__pyx_v_self, PyObject *__pyx_v_cb); /*proto*/ +static char __pyx_doc_6gevent_9_greenlet_12_dummy_event_4start[] = "_dummy_event.start(self, cb)"; +static PyMethodDef __pyx_mdef_6gevent_9_greenlet_12_dummy_event_5start = {"start", (PyCFunction)__pyx_pw_6gevent_9_greenlet_12_dummy_event_5start, METH_O, __pyx_doc_6gevent_9_greenlet_12_dummy_event_4start}; +static PyObject *__pyx_pw_6gevent_9_greenlet_12_dummy_event_5start(PyObject *__pyx_v_self, PyObject *__pyx_v_cb) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("start (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_9_greenlet_12_dummy_event_4start(((struct __pyx_obj_6gevent_9_greenlet__dummy_event *)__pyx_v_self), ((PyObject *)__pyx_v_cb)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_9_greenlet_12_dummy_event_4start(struct __pyx_obj_6gevent_9_greenlet__dummy_event *__pyx_v_self, PyObject *__pyx_v_cb) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("start", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6gevent_9_greenlet_12_dummy_event_start(__pyx_v_self, __pyx_v_cb, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 879, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent._greenlet._dummy_event.start", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/greenlet.py":882 + * raise AssertionError("Cannot start the dummy event") + * + * def close(self): # <<<<<<<<<<<<<< + * pass + * + */ + +static PyObject *__pyx_pw_6gevent_9_greenlet_12_dummy_event_7close(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_f_6gevent_9_greenlet_12_dummy_event_close(CYTHON_UNUSED struct __pyx_obj_6gevent_9_greenlet__dummy_event *__pyx_v_self, CYTHON_UNUSED int __pyx_skip_dispatch) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("close", 0); + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_9_greenlet_12_dummy_event_7close(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6gevent_9_greenlet_12_dummy_event_6close[] = "_dummy_event.close(self)"; +static PyMethodDef __pyx_mdef_6gevent_9_greenlet_12_dummy_event_7close = {"close", (PyCFunction)__pyx_pw_6gevent_9_greenlet_12_dummy_event_7close, METH_NOARGS, __pyx_doc_6gevent_9_greenlet_12_dummy_event_6close}; +static PyObject *__pyx_pw_6gevent_9_greenlet_12_dummy_event_7close(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("close (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_9_greenlet_12_dummy_event_6close(((struct __pyx_obj_6gevent_9_greenlet__dummy_event *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_9_greenlet_12_dummy_event_6close(struct __pyx_obj_6gevent_9_greenlet__dummy_event *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("close", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6gevent_9_greenlet_12_dummy_event_close(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 882, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent._greenlet._dummy_event.close", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/_greenlet.pxd":158 + * @cython.internal + * cdef class _dummy_event: + * cdef readonly bint pending # <<<<<<<<<<<<<< + * cdef readonly bint active + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_9_greenlet_12_dummy_event_7pending_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_9_greenlet_12_dummy_event_7pending_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_9_greenlet_12_dummy_event_7pending___get__(((struct __pyx_obj_6gevent_9_greenlet__dummy_event *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_9_greenlet_12_dummy_event_7pending___get__(struct __pyx_obj_6gevent_9_greenlet__dummy_event *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->pending); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 158, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent._greenlet._dummy_event.pending.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/_greenlet.pxd":159 + * cdef class _dummy_event: + * cdef readonly bint pending + * cdef readonly bint active # <<<<<<<<<<<<<< + * + * cpdef stop(self) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_9_greenlet_12_dummy_event_6active_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_9_greenlet_12_dummy_event_6active_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_9_greenlet_12_dummy_event_6active___get__(((struct __pyx_obj_6gevent_9_greenlet__dummy_event *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_9_greenlet_12_dummy_event_6active___get__(struct __pyx_obj_6gevent_9_greenlet__dummy_event *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->active); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 159, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent._greenlet._dummy_event.active.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/greenlet.py":889 + * + * + * def _kill(glet, exception, waiter): # <<<<<<<<<<<<<< + * try: + * glet.throw(exception) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_9_greenlet_1_kill(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6gevent_9_greenlet__kill[] = "_kill(glet, exception, waiter)"; +static PyMethodDef __pyx_mdef_6gevent_9_greenlet_1_kill = {"_kill", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_9_greenlet_1_kill, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_9_greenlet__kill}; +static PyObject *__pyx_pw_6gevent_9_greenlet_1_kill(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_glet = 0; + PyObject *__pyx_v_exception = 0; + PyObject *__pyx_v_waiter = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_kill (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_glet,&__pyx_n_s_exception,&__pyx_n_s_waiter,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_glet)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_exception)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("_kill", 1, 3, 3, 1); __PYX_ERR(0, 889, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_waiter)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("_kill", 1, 3, 3, 2); __PYX_ERR(0, 889, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_kill") < 0)) __PYX_ERR(0, 889, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + } + __pyx_v_glet = values[0]; + __pyx_v_exception = values[1]; + __pyx_v_waiter = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("_kill", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 889, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent._greenlet._kill", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_9_greenlet__kill(__pyx_self, __pyx_v_glet, __pyx_v_exception, __pyx_v_waiter); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_9_greenlet__kill(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_glet, PyObject *__pyx_v_exception, PyObject *__pyx_v_waiter) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + int __pyx_t_12; + int __pyx_t_13; + __Pyx_RefNannySetupContext("_kill", 0); + + /* "src/gevent/greenlet.py":890 + * + * def _kill(glet, exception, waiter): + * try: # <<<<<<<<<<<<<< + * glet.throw(exception) + * except: # pylint:disable=bare-except + */ + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "src/gevent/greenlet.py":891 + * def _kill(glet, exception, waiter): + * try: + * glet.throw(exception) # <<<<<<<<<<<<<< + * except: # pylint:disable=bare-except + * # XXX do we need this here? + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_glet, __pyx_n_s_throw); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 891, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); + if (likely(__pyx_t_6)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_5, function); + } + } + __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_v_exception) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_exception); + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 891, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "src/gevent/greenlet.py":890 + * + * def _kill(glet, exception, waiter): + * try: # <<<<<<<<<<<<<< + * glet.throw(exception) + * except: # pylint:disable=bare-except + */ + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L8_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "src/gevent/greenlet.py":892 + * try: + * glet.throw(exception) + * except: # pylint:disable=bare-except # <<<<<<<<<<<<<< + * # XXX do we need this here? + * glet.parent.handle_error(glet, *sys_exc_info()) + */ + /*except:*/ { + __Pyx_AddTraceback("gevent._greenlet._kill", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6) < 0) __PYX_ERR(0, 892, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_6); + + /* "src/gevent/greenlet.py":894 + * except: # pylint:disable=bare-except + * # XXX do we need this here? + * glet.parent.handle_error(glet, *sys_exc_info()) # <<<<<<<<<<<<<< + * if waiter is not None: + * waiter.switch(None) + */ + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_glet, __pyx_n_s_parent); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 894, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_handle_error); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 894, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 894, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_INCREF(__pyx_v_glet); + __Pyx_GIVEREF(__pyx_v_glet); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_glet); + __Pyx_INCREF(__pyx_v_6gevent_9_greenlet_sys_exc_info); + __pyx_t_10 = __pyx_v_6gevent_9_greenlet_sys_exc_info; __pyx_t_11 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_10))) { + __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_10); + if (likely(__pyx_t_11)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10); + __Pyx_INCREF(__pyx_t_11); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_10, function); + } + } + __pyx_t_9 = (__pyx_t_11) ? __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_t_11) : __Pyx_PyObject_CallNoArg(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 894, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PySequence_Tuple(__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 894, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = PyNumber_Add(__pyx_t_7, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 894, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_9, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 894, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L4_exception_handled; + } + __pyx_L5_except_error:; + + /* "src/gevent/greenlet.py":890 + * + * def _kill(glet, exception, waiter): + * try: # <<<<<<<<<<<<<< + * glet.throw(exception) + * except: # pylint:disable=bare-except + */ + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L8_try_end:; + } + + /* "src/gevent/greenlet.py":895 + * # XXX do we need this here? + * glet.parent.handle_error(glet, *sys_exc_info()) + * if waiter is not None: # <<<<<<<<<<<<<< + * waiter.switch(None) + * + */ + __pyx_t_12 = (__pyx_v_waiter != Py_None); + __pyx_t_13 = (__pyx_t_12 != 0); + if (__pyx_t_13) { + + /* "src/gevent/greenlet.py":896 + * glet.parent.handle_error(glet, *sys_exc_info()) + * if waiter is not None: + * waiter.switch(None) # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_waiter, __pyx_n_s_switch); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 896, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_5, function); + } + } + __pyx_t_6 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_4, Py_None) : __Pyx_PyObject_CallOneArg(__pyx_t_5, Py_None); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 896, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "src/gevent/greenlet.py":895 + * # XXX do we need this here? + * glet.parent.handle_error(glet, *sys_exc_info()) + * if waiter is not None: # <<<<<<<<<<<<<< + * waiter.switch(None) + * + */ + } + + /* "src/gevent/greenlet.py":889 + * + * + * def _kill(glet, exception, waiter): # <<<<<<<<<<<<<< + * try: + * glet.throw(exception) + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_AddTraceback("gevent._greenlet._kill", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/greenlet.py":899 + * + * + * def joinall(greenlets, timeout=None, raise_error=False, count=None): # <<<<<<<<<<<<<< + * """ + * Wait for the ``greenlets`` to finish. + */ + +static PyObject *__pyx_pw_6gevent_9_greenlet_3joinall(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_6gevent_9_greenlet_joinall(PyObject *__pyx_v_greenlets, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_9_greenlet_joinall *__pyx_optional_args) { + PyObject *__pyx_v_timeout = ((PyObject *)Py_None); + PyObject *__pyx_v_raise_error = ((PyObject *)Py_False); + PyObject *__pyx_v_count = ((PyObject *)Py_None); + PyObject *__pyx_v_done = 0; + PyObject *__pyx_v_obj = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + Py_ssize_t __pyx_t_6; + PyObject *(*__pyx_t_7)(PyObject *); + PyObject *__pyx_t_8 = NULL; + int __pyx_t_9; + __Pyx_RefNannySetupContext("joinall", 0); + if (__pyx_optional_args) { + if (__pyx_optional_args->__pyx_n > 0) { + __pyx_v_timeout = __pyx_optional_args->timeout; + if (__pyx_optional_args->__pyx_n > 1) { + __pyx_v_raise_error = __pyx_optional_args->raise_error; + if (__pyx_optional_args->__pyx_n > 2) { + __pyx_v_count = __pyx_optional_args->count; + } + } + } + } + + /* "src/gevent/greenlet.py":908 + * expired. + * """ + * if not raise_error: # <<<<<<<<<<<<<< + * return wait(greenlets, timeout=timeout, count=count) + * + */ + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_raise_error); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 908, __pyx_L1_error) + __pyx_t_2 = ((!__pyx_t_1) != 0); + if (__pyx_t_2) { + + /* "src/gevent/greenlet.py":909 + * """ + * if not raise_error: + * return wait(greenlets, timeout=timeout, count=count) # <<<<<<<<<<<<<< + * + * done = [] + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 909, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_greenlets); + __Pyx_GIVEREF(__pyx_v_greenlets); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_greenlets); + __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 909, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_timeout, __pyx_v_timeout) < 0) __PYX_ERR(0, 909, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_count, __pyx_v_count) < 0) __PYX_ERR(0, 909, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_v_6gevent_9_greenlet_wait, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 909, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L0; + + /* "src/gevent/greenlet.py":908 + * expired. + * """ + * if not raise_error: # <<<<<<<<<<<<<< + * return wait(greenlets, timeout=timeout, count=count) + * + */ + } + + /* "src/gevent/greenlet.py":911 + * return wait(greenlets, timeout=timeout, count=count) + * + * done = [] # <<<<<<<<<<<<<< + * for obj in iwait(greenlets, timeout=timeout, count=count): + * if getattr(obj, 'exception', None) is not None: + */ + __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 911, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_v_done = ((PyObject*)__pyx_t_5); + __pyx_t_5 = 0; + + /* "src/gevent/greenlet.py":912 + * + * done = [] + * for obj in iwait(greenlets, timeout=timeout, count=count): # <<<<<<<<<<<<<< + * if getattr(obj, 'exception', None) is not None: + * if hasattr(obj, '_raise_exception'): + */ + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 912, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_greenlets); + __Pyx_GIVEREF(__pyx_v_greenlets); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_greenlets); + __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 912, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_timeout, __pyx_v_timeout) < 0) __PYX_ERR(0, 912, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_count, __pyx_v_count) < 0) __PYX_ERR(0, 912, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_v_6gevent_9_greenlet_iwait, __pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 912, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) { + __pyx_t_4 = __pyx_t_3; __Pyx_INCREF(__pyx_t_4); __pyx_t_6 = 0; + __pyx_t_7 = NULL; + } else { + __pyx_t_6 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 912, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_7 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 912, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + for (;;) { + if (likely(!__pyx_t_7)) { + if (likely(PyList_CheckExact(__pyx_t_4))) { + if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_3 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_6); __Pyx_INCREF(__pyx_t_3); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 912, __pyx_L1_error) + #else + __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 912, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + #endif + } else { + if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_6); __Pyx_INCREF(__pyx_t_3); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 912, __pyx_L1_error) + #else + __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 912, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + #endif + } + } else { + __pyx_t_3 = __pyx_t_7(__pyx_t_4); + if (unlikely(!__pyx_t_3)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(0, 912, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_3); + } + __Pyx_XDECREF_SET(__pyx_v_obj, __pyx_t_3); + __pyx_t_3 = 0; + + /* "src/gevent/greenlet.py":913 + * done = [] + * for obj in iwait(greenlets, timeout=timeout, count=count): + * if getattr(obj, 'exception', None) is not None: # <<<<<<<<<<<<<< + * if hasattr(obj, '_raise_exception'): + * obj._raise_exception() + */ + __pyx_t_3 = __Pyx_GetAttr3(__pyx_v_obj, __pyx_n_s_exception, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 913, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = (__pyx_t_3 != Py_None); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_1 = (__pyx_t_2 != 0); + if (__pyx_t_1) { + + /* "src/gevent/greenlet.py":914 + * for obj in iwait(greenlets, timeout=timeout, count=count): + * if getattr(obj, 'exception', None) is not None: + * if hasattr(obj, '_raise_exception'): # <<<<<<<<<<<<<< + * obj._raise_exception() + * else: + */ + __pyx_t_1 = __Pyx_HasAttr(__pyx_v_obj, __pyx_n_s_raise_exception); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 914, __pyx_L1_error) + __pyx_t_2 = (__pyx_t_1 != 0); + if (likely(__pyx_t_2)) { + + /* "src/gevent/greenlet.py":915 + * if getattr(obj, 'exception', None) is not None: + * if hasattr(obj, '_raise_exception'): + * obj._raise_exception() # <<<<<<<<<<<<<< + * else: + * raise obj.exception + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_raise_exception); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 915, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_8 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5); + if (likely(__pyx_t_8)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_8); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_5, function); + } + } + __pyx_t_3 = (__pyx_t_8) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_8) : __Pyx_PyObject_CallNoArg(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 915, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "src/gevent/greenlet.py":914 + * for obj in iwait(greenlets, timeout=timeout, count=count): + * if getattr(obj, 'exception', None) is not None: + * if hasattr(obj, '_raise_exception'): # <<<<<<<<<<<<<< + * obj._raise_exception() + * else: + */ + goto __pyx_L7; + } + + /* "src/gevent/greenlet.py":917 + * obj._raise_exception() + * else: + * raise obj.exception # <<<<<<<<<<<<<< + * done.append(obj) + * return done + */ + /*else*/ { + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_exception); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 917, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(0, 917, __pyx_L1_error) + } + __pyx_L7:; + + /* "src/gevent/greenlet.py":913 + * done = [] + * for obj in iwait(greenlets, timeout=timeout, count=count): + * if getattr(obj, 'exception', None) is not None: # <<<<<<<<<<<<<< + * if hasattr(obj, '_raise_exception'): + * obj._raise_exception() + */ + } + + /* "src/gevent/greenlet.py":918 + * else: + * raise obj.exception + * done.append(obj) # <<<<<<<<<<<<<< + * return done + * + */ + __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_done, __pyx_v_obj); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 918, __pyx_L1_error) + + /* "src/gevent/greenlet.py":912 + * + * done = [] + * for obj in iwait(greenlets, timeout=timeout, count=count): # <<<<<<<<<<<<<< + * if getattr(obj, 'exception', None) is not None: + * if hasattr(obj, '_raise_exception'): + */ + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "src/gevent/greenlet.py":919 + * raise obj.exception + * done.append(obj) + * return done # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_done); + __pyx_r = __pyx_v_done; + goto __pyx_L0; + + /* "src/gevent/greenlet.py":899 + * + * + * def joinall(greenlets, timeout=None, raise_error=False, count=None): # <<<<<<<<<<<<<< + * """ + * Wait for the ``greenlets`` to finish. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("gevent._greenlet.joinall", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_done); + __Pyx_XDECREF(__pyx_v_obj); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_9_greenlet_3joinall(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6gevent_9_greenlet_2joinall[] = "joinall(greenlets, timeout=None, raise_error=False, count=None)\n\n Wait for the ``greenlets`` to finish.\n\n :param greenlets: A sequence (supporting :func:`len`) of greenlets to wait for.\n :keyword float timeout: If given, the maximum number of seconds to wait.\n :return: A sequence of the greenlets that finished before the timeout (if any)\n expired.\n "; +static PyMethodDef __pyx_mdef_6gevent_9_greenlet_3joinall = {"joinall", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_9_greenlet_3joinall, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_9_greenlet_2joinall}; +static PyObject *__pyx_pw_6gevent_9_greenlet_3joinall(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_greenlets = 0; + PyObject *__pyx_v_timeout = 0; + PyObject *__pyx_v_raise_error = 0; + PyObject *__pyx_v_count = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("joinall (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_greenlets,&__pyx_n_s_timeout,&__pyx_n_s_raise_error,&__pyx_n_s_count,0}; + PyObject* values[4] = {0,0,0,0}; + values[1] = ((PyObject *)Py_None); + values[2] = ((PyObject *)Py_False); + values[3] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_greenlets)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_timeout); + if (value) { values[1] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 2: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_raise_error); + if (value) { values[2] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 3: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_count); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "joinall") < 0)) __PYX_ERR(0, 899, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_greenlets = values[0]; + __pyx_v_timeout = values[1]; + __pyx_v_raise_error = values[2]; + __pyx_v_count = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("joinall", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 899, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent._greenlet.joinall", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_9_greenlet_2joinall(__pyx_self, __pyx_v_greenlets, __pyx_v_timeout, __pyx_v_raise_error, __pyx_v_count); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_9_greenlet_2joinall(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_greenlets, PyObject *__pyx_v_timeout, PyObject *__pyx_v_raise_error, PyObject *__pyx_v_count) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + struct __pyx_opt_args_6gevent_9_greenlet_joinall __pyx_t_2; + __Pyx_RefNannySetupContext("joinall", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_2.__pyx_n = 3; + __pyx_t_2.timeout = __pyx_v_timeout; + __pyx_t_2.raise_error = __pyx_v_raise_error; + __pyx_t_2.count = __pyx_v_count; + __pyx_t_1 = __pyx_f_6gevent_9_greenlet_joinall(__pyx_v_greenlets, 0, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 899, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent._greenlet.joinall", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/greenlet.py":922 + * + * + * def _killall3(greenlets, exception, waiter): # <<<<<<<<<<<<<< + * diehards = [] + * for g in greenlets: + */ + +static PyObject *__pyx_f_6gevent_9_greenlet__killall3(PyObject *__pyx_v_greenlets, PyObject *__pyx_v_exception, PyObject *__pyx_v_waiter) { + PyObject *__pyx_v_diehards = 0; + PyObject *__pyx_v_g = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + PyObject *__pyx_t_14 = NULL; + PyObject *__pyx_t_15 = NULL; + int __pyx_t_16; + __Pyx_RefNannySetupContext("_killall3", 0); + + /* "src/gevent/greenlet.py":923 + * + * def _killall3(greenlets, exception, waiter): + * diehards = [] # <<<<<<<<<<<<<< + * for g in greenlets: + * if not g.dead: + */ + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 923, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_diehards = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "src/gevent/greenlet.py":924 + * def _killall3(greenlets, exception, waiter): + * diehards = [] + * for g in greenlets: # <<<<<<<<<<<<<< + * if not g.dead: + * try: + */ + if (unlikely(__pyx_v_greenlets == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); + __PYX_ERR(0, 924, __pyx_L1_error) + } + __pyx_t_1 = __pyx_v_greenlets; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; + for (;;) { + if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 924, __pyx_L1_error) + #else + __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 924, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + #endif + __Pyx_XDECREF_SET(__pyx_v_g, __pyx_t_3); + __pyx_t_3 = 0; + + /* "src/gevent/greenlet.py":925 + * diehards = [] + * for g in greenlets: + * if not g.dead: # <<<<<<<<<<<<<< + * try: + * g.throw(exception) + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_g, __pyx_n_s_dead); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 925, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 925, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_5 = ((!__pyx_t_4) != 0); + if (__pyx_t_5) { + + /* "src/gevent/greenlet.py":926 + * for g in greenlets: + * if not g.dead: + * try: # <<<<<<<<<<<<<< + * g.throw(exception) + * except: # pylint:disable=bare-except + */ + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); + __Pyx_XGOTREF(__pyx_t_6); + __Pyx_XGOTREF(__pyx_t_7); + __Pyx_XGOTREF(__pyx_t_8); + /*try:*/ { + + /* "src/gevent/greenlet.py":927 + * if not g.dead: + * try: + * g.throw(exception) # <<<<<<<<<<<<<< + * except: # pylint:disable=bare-except + * g.parent.handle_error(g, *sys_exc_info()) + */ + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_g, __pyx_n_s_throw); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 927, __pyx_L6_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) { + __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9); + if (likely(__pyx_t_10)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); + __Pyx_INCREF(__pyx_t_10); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_9, function); + } + } + __pyx_t_3 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_10, __pyx_v_exception) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_v_exception); + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 927, __pyx_L6_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "src/gevent/greenlet.py":926 + * for g in greenlets: + * if not g.dead: + * try: # <<<<<<<<<<<<<< + * g.throw(exception) + * except: # pylint:disable=bare-except + */ + } + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + goto __pyx_L13_try_end; + __pyx_L6_error:; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "src/gevent/greenlet.py":928 + * try: + * g.throw(exception) + * except: # pylint:disable=bare-except # <<<<<<<<<<<<<< + * g.parent.handle_error(g, *sys_exc_info()) + * if not g.dead: + */ + /*except:*/ { + __Pyx_AddTraceback("gevent._greenlet._killall3", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_9, &__pyx_t_10) < 0) __PYX_ERR(0, 928, __pyx_L8_except_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GOTREF(__pyx_t_9); + __Pyx_GOTREF(__pyx_t_10); + + /* "src/gevent/greenlet.py":929 + * g.throw(exception) + * except: # pylint:disable=bare-except + * g.parent.handle_error(g, *sys_exc_info()) # <<<<<<<<<<<<<< + * if not g.dead: + * diehards.append(g) + */ + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_g, __pyx_n_s_parent); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 929, __pyx_L8_except_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_handle_error); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 929, __pyx_L8_except_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 929, __pyx_L8_except_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_INCREF(__pyx_v_g); + __Pyx_GIVEREF(__pyx_v_g); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_v_g); + __Pyx_INCREF(__pyx_v_6gevent_9_greenlet_sys_exc_info); + __pyx_t_14 = __pyx_v_6gevent_9_greenlet_sys_exc_info; __pyx_t_15 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_14))) { + __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_14); + if (likely(__pyx_t_15)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14); + __Pyx_INCREF(__pyx_t_15); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_14, function); + } + } + __pyx_t_13 = (__pyx_t_15) ? __Pyx_PyObject_CallOneArg(__pyx_t_14, __pyx_t_15) : __Pyx_PyObject_CallNoArg(__pyx_t_14); + __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; + if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 929, __pyx_L8_except_error) + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __pyx_t_14 = __Pyx_PySequence_Tuple(__pyx_t_13); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 929, __pyx_L8_except_error) + __Pyx_GOTREF(__pyx_t_14); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_13 = PyNumber_Add(__pyx_t_11, __pyx_t_14); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 929, __pyx_L8_except_error) + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_13, NULL); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 929, __pyx_L8_except_error) + __Pyx_GOTREF(__pyx_t_14); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + goto __pyx_L7_exception_handled; + } + __pyx_L8_except_error:; + + /* "src/gevent/greenlet.py":926 + * for g in greenlets: + * if not g.dead: + * try: # <<<<<<<<<<<<<< + * g.throw(exception) + * except: # pylint:disable=bare-except + */ + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); + goto __pyx_L1_error; + __pyx_L7_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); + __pyx_L13_try_end:; + } + + /* "src/gevent/greenlet.py":930 + * except: # pylint:disable=bare-except + * g.parent.handle_error(g, *sys_exc_info()) + * if not g.dead: # <<<<<<<<<<<<<< + * diehards.append(g) + * waiter.switch(diehards) + */ + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_g, __pyx_n_s_dead); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 930, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 930, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_4 = ((!__pyx_t_5) != 0); + if (__pyx_t_4) { + + /* "src/gevent/greenlet.py":931 + * g.parent.handle_error(g, *sys_exc_info()) + * if not g.dead: + * diehards.append(g) # <<<<<<<<<<<<<< + * waiter.switch(diehards) + * + */ + __pyx_t_16 = __Pyx_PyList_Append(__pyx_v_diehards, __pyx_v_g); if (unlikely(__pyx_t_16 == ((int)-1))) __PYX_ERR(0, 931, __pyx_L1_error) + + /* "src/gevent/greenlet.py":930 + * except: # pylint:disable=bare-except + * g.parent.handle_error(g, *sys_exc_info()) + * if not g.dead: # <<<<<<<<<<<<<< + * diehards.append(g) + * waiter.switch(diehards) + */ + } + + /* "src/gevent/greenlet.py":925 + * diehards = [] + * for g in greenlets: + * if not g.dead: # <<<<<<<<<<<<<< + * try: + * g.throw(exception) + */ + } + + /* "src/gevent/greenlet.py":924 + * def _killall3(greenlets, exception, waiter): + * diehards = [] + * for g in greenlets: # <<<<<<<<<<<<<< + * if not g.dead: + * try: + */ + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/greenlet.py":932 + * if not g.dead: + * diehards.append(g) + * waiter.switch(diehards) # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_waiter, __pyx_n_s_switch); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 932, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_9 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_10))) { + __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_10); + if (likely(__pyx_t_9)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10); + __Pyx_INCREF(__pyx_t_9); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_10, function); + } + } + __pyx_t_1 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_10, __pyx_t_9, __pyx_v_diehards) : __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_v_diehards); + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 932, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/greenlet.py":922 + * + * + * def _killall3(greenlets, exception, waiter): # <<<<<<<<<<<<<< + * diehards = [] + * for g in greenlets: + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_XDECREF(__pyx_t_13); + __Pyx_XDECREF(__pyx_t_14); + __Pyx_XDECREF(__pyx_t_15); + __Pyx_AddTraceback("gevent._greenlet._killall3", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_diehards); + __Pyx_XDECREF(__pyx_v_g); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/greenlet.py":935 + * + * + * def _killall(greenlets, exception): # <<<<<<<<<<<<<< + * for g in greenlets: + * if not g.dead: + */ + +static PyObject *__pyx_f_6gevent_9_greenlet__killall(PyObject *__pyx_v_greenlets, PyObject *__pyx_v_exception) { + PyObject *__pyx_v_g = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + PyObject *__pyx_t_14 = NULL; + PyObject *__pyx_t_15 = NULL; + __Pyx_RefNannySetupContext("_killall", 0); + + /* "src/gevent/greenlet.py":936 + * + * def _killall(greenlets, exception): + * for g in greenlets: # <<<<<<<<<<<<<< + * if not g.dead: + * try: + */ + if (unlikely(__pyx_v_greenlets == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); + __PYX_ERR(0, 936, __pyx_L1_error) + } + __pyx_t_1 = __pyx_v_greenlets; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; + for (;;) { + if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 936, __pyx_L1_error) + #else + __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 936, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + #endif + __Pyx_XDECREF_SET(__pyx_v_g, __pyx_t_3); + __pyx_t_3 = 0; + + /* "src/gevent/greenlet.py":937 + * def _killall(greenlets, exception): + * for g in greenlets: + * if not g.dead: # <<<<<<<<<<<<<< + * try: + * g.throw(exception) + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_g, __pyx_n_s_dead); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 937, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 937, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_5 = ((!__pyx_t_4) != 0); + if (__pyx_t_5) { + + /* "src/gevent/greenlet.py":938 + * for g in greenlets: + * if not g.dead: + * try: # <<<<<<<<<<<<<< + * g.throw(exception) + * except: # pylint:disable=bare-except + */ + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); + __Pyx_XGOTREF(__pyx_t_6); + __Pyx_XGOTREF(__pyx_t_7); + __Pyx_XGOTREF(__pyx_t_8); + /*try:*/ { + + /* "src/gevent/greenlet.py":939 + * if not g.dead: + * try: + * g.throw(exception) # <<<<<<<<<<<<<< + * except: # pylint:disable=bare-except + * g.parent.handle_error(g, *sys_exc_info()) + */ + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_g, __pyx_n_s_throw); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 939, __pyx_L6_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) { + __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9); + if (likely(__pyx_t_10)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); + __Pyx_INCREF(__pyx_t_10); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_9, function); + } + } + __pyx_t_3 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_10, __pyx_v_exception) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_v_exception); + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 939, __pyx_L6_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "src/gevent/greenlet.py":938 + * for g in greenlets: + * if not g.dead: + * try: # <<<<<<<<<<<<<< + * g.throw(exception) + * except: # pylint:disable=bare-except + */ + } + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + goto __pyx_L13_try_end; + __pyx_L6_error:; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "src/gevent/greenlet.py":940 + * try: + * g.throw(exception) + * except: # pylint:disable=bare-except # <<<<<<<<<<<<<< + * g.parent.handle_error(g, *sys_exc_info()) + * + */ + /*except:*/ { + __Pyx_AddTraceback("gevent._greenlet._killall", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_9, &__pyx_t_10) < 0) __PYX_ERR(0, 940, __pyx_L8_except_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GOTREF(__pyx_t_9); + __Pyx_GOTREF(__pyx_t_10); + + /* "src/gevent/greenlet.py":941 + * g.throw(exception) + * except: # pylint:disable=bare-except + * g.parent.handle_error(g, *sys_exc_info()) # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_g, __pyx_n_s_parent); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 941, __pyx_L8_except_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_handle_error); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 941, __pyx_L8_except_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 941, __pyx_L8_except_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_INCREF(__pyx_v_g); + __Pyx_GIVEREF(__pyx_v_g); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_v_g); + __Pyx_INCREF(__pyx_v_6gevent_9_greenlet_sys_exc_info); + __pyx_t_14 = __pyx_v_6gevent_9_greenlet_sys_exc_info; __pyx_t_15 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_14))) { + __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_14); + if (likely(__pyx_t_15)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14); + __Pyx_INCREF(__pyx_t_15); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_14, function); + } + } + __pyx_t_13 = (__pyx_t_15) ? __Pyx_PyObject_CallOneArg(__pyx_t_14, __pyx_t_15) : __Pyx_PyObject_CallNoArg(__pyx_t_14); + __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; + if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 941, __pyx_L8_except_error) + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __pyx_t_14 = __Pyx_PySequence_Tuple(__pyx_t_13); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 941, __pyx_L8_except_error) + __Pyx_GOTREF(__pyx_t_14); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_13 = PyNumber_Add(__pyx_t_11, __pyx_t_14); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 941, __pyx_L8_except_error) + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_13, NULL); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 941, __pyx_L8_except_error) + __Pyx_GOTREF(__pyx_t_14); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + goto __pyx_L7_exception_handled; + } + __pyx_L8_except_error:; + + /* "src/gevent/greenlet.py":938 + * for g in greenlets: + * if not g.dead: + * try: # <<<<<<<<<<<<<< + * g.throw(exception) + * except: # pylint:disable=bare-except + */ + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); + goto __pyx_L1_error; + __pyx_L7_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); + __pyx_L13_try_end:; + } + + /* "src/gevent/greenlet.py":937 + * def _killall(greenlets, exception): + * for g in greenlets: + * if not g.dead: # <<<<<<<<<<<<<< + * try: + * g.throw(exception) + */ + } + + /* "src/gevent/greenlet.py":936 + * + * def _killall(greenlets, exception): + * for g in greenlets: # <<<<<<<<<<<<<< + * if not g.dead: + * try: + */ + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/greenlet.py":935 + * + * + * def _killall(greenlets, exception): # <<<<<<<<<<<<<< + * for g in greenlets: + * if not g.dead: + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_XDECREF(__pyx_t_13); + __Pyx_XDECREF(__pyx_t_14); + __Pyx_XDECREF(__pyx_t_15); + __Pyx_AddTraceback("gevent._greenlet._killall", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_g); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/greenlet.py":944 + * + * + * def _call_spawn_callbacks(gr): # <<<<<<<<<<<<<< + * if _spawn_callbacks is not None: + * for cb in _spawn_callbacks: + */ + +static void __pyx_f_6gevent_9_greenlet__call_spawn_callbacks(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_gr) { + PyObject *__pyx_v_cb = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + Py_ssize_t __pyx_t_4; + Py_ssize_t __pyx_t_5; + int __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + __Pyx_RefNannySetupContext("_call_spawn_callbacks", 0); + + /* "src/gevent/greenlet.py":945 + * + * def _call_spawn_callbacks(gr): + * if _spawn_callbacks is not None: # <<<<<<<<<<<<<< + * for cb in _spawn_callbacks: + * cb(gr) + */ + __pyx_t_1 = (__pyx_v_6gevent_9_greenlet__spawn_callbacks != ((PyObject*)Py_None)); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "src/gevent/greenlet.py":946 + * def _call_spawn_callbacks(gr): + * if _spawn_callbacks is not None: + * for cb in _spawn_callbacks: # <<<<<<<<<<<<<< + * cb(gr) + * + */ + __pyx_t_4 = 0; + __pyx_t_7 = __Pyx_set_iterator(__pyx_v_6gevent_9_greenlet__spawn_callbacks, 1, (&__pyx_t_5), (&__pyx_t_6)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 946, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_3); + __pyx_t_3 = __pyx_t_7; + __pyx_t_7 = 0; + while (1) { + __pyx_t_8 = __Pyx_set_iter_next(__pyx_t_3, __pyx_t_5, &__pyx_t_4, &__pyx_t_7, __pyx_t_6); + if (unlikely(__pyx_t_8 == 0)) break; + if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(0, 946, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_XDECREF_SET(__pyx_v_cb, __pyx_t_7); + __pyx_t_7 = 0; + + /* "src/gevent/greenlet.py":947 + * if _spawn_callbacks is not None: + * for cb in _spawn_callbacks: + * cb(gr) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_INCREF(__pyx_v_cb); + __pyx_t_9 = __pyx_v_cb; __pyx_t_10 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) { + __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9); + if (likely(__pyx_t_10)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); + __Pyx_INCREF(__pyx_t_10); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_9, function); + } + } + __pyx_t_7 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_10, ((PyObject *)__pyx_v_gr)) : __Pyx_PyObject_CallOneArg(__pyx_t_9, ((PyObject *)__pyx_v_gr)); + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 947, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "src/gevent/greenlet.py":945 + * + * def _call_spawn_callbacks(gr): + * if _spawn_callbacks is not None: # <<<<<<<<<<<<<< + * for cb in _spawn_callbacks: + * cb(gr) + */ + } + + /* "src/gevent/greenlet.py":944 + * + * + * def _call_spawn_callbacks(gr): # <<<<<<<<<<<<<< + * if _spawn_callbacks is not None: + * for cb in _spawn_callbacks: + */ + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_AddTraceback("gevent._greenlet._call_spawn_callbacks", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_cb); + __Pyx_RefNannyFinishContext(); +} + +/* "src/gevent/greenlet.py":953 + * + * + * def killall(greenlets, exception=GreenletExit, block=True, timeout=None): # <<<<<<<<<<<<<< + * """ + * Forceably terminate all the ``greenlets`` by causing them to raise ``exception``. + */ + +static PyObject *__pyx_pf_6gevent_9_greenlet_7__defaults__(CYTHON_UNUSED PyObject *__pyx_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("__defaults__", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 953, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_exception); + __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_exception); + PyTuple_SET_ITEM(__pyx_t_1, 0, __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_exception); + __Pyx_INCREF(((PyObject *)Py_True)); + __Pyx_GIVEREF(((PyObject *)Py_True)); + PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)Py_True)); + __Pyx_INCREF(((PyObject *)Py_None)); + __Pyx_GIVEREF(((PyObject *)Py_None)); + PyTuple_SET_ITEM(__pyx_t_1, 2, ((PyObject *)Py_None)); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 953, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None); + __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent._greenlet.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_9_greenlet_5killall(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6gevent_9_greenlet_4killall[] = "killall(greenlets, exception=GreenletExit, block=True, timeout=None)\n\n Forceably terminate all the ``greenlets`` by causing them to raise ``exception``.\n\n .. caution:: Use care when killing greenlets. If they are not prepared for exceptions,\n this could result in corrupted state.\n\n :param greenlets: A **bounded** iterable of the non-None greenlets to terminate.\n *All* the items in this iterable must be greenlets that belong to the same thread.\n :keyword exception: The exception to raise in the greenlets. By default this is\n :class:`GreenletExit`.\n :keyword bool block: If True (the default) then this function only returns when all the\n greenlets are dead; the current greenlet is unscheduled during that process.\n If greenlets ignore the initial exception raised in them,\n then they will be joined (with :func:`gevent.joinall`) and allowed to die naturally.\n If False, this function returns immediately and greenlets will raise\n the exception asynchronously.\n :keyword float timeout: A time in seconds to wait for greenlets to die. If given, it is\n only honored when ``block`` is True.\n :raise Timeout: If blocking and a timeout is given that elapses before\n all the greenlets are dead.\n\n .. versionchanged:: 1.1a2\n *greenlets* can be any iterable of greenlets, like an iterator or a set.\n Previously it had to be a list or tuple.\n "; +static PyMethodDef __pyx_mdef_6gevent_9_greenlet_5killall = {"killall", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_9_greenlet_5killall, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_9_greenlet_4killall}; +static PyObject *__pyx_pw_6gevent_9_greenlet_5killall(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_greenlets = 0; + PyObject *__pyx_v_exception = 0; + PyObject *__pyx_v_block = 0; + PyObject *__pyx_v_timeout = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("killall (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_greenlets,&__pyx_n_s_exception,&__pyx_n_s_block,&__pyx_n_s_timeout,0}; + PyObject* values[4] = {0,0,0,0}; + __pyx_defaults *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self); + values[1] = __pyx_dynamic_args->__pyx_arg_exception; + values[2] = ((PyObject *)((PyObject *)Py_True)); + values[3] = ((PyObject *)((PyObject *)Py_None)); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_greenlets)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_exception); + if (value) { values[1] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 2: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_block); + if (value) { values[2] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 3: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_timeout); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "killall") < 0)) __PYX_ERR(0, 953, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_greenlets = values[0]; + __pyx_v_exception = values[1]; + __pyx_v_block = values[2]; + __pyx_v_timeout = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("killall", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 953, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent._greenlet.killall", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_9_greenlet_4killall(__pyx_self, __pyx_v_greenlets, __pyx_v_exception, __pyx_v_block, __pyx_v_timeout); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_9_greenlet_4killall(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_greenlets, PyObject *__pyx_v_exception, PyObject *__pyx_v_block, PyObject *__pyx_v_timeout) { + PyObject *__pyx_v_loop = NULL; + struct __pyx_obj_6gevent_8__waiter_Waiter *__pyx_v_waiter = NULL; + PyObject *__pyx_v_t = NULL; + PyObject *__pyx_v_alive = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + int __pyx_t_9; + char const *__pyx_t_10; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + PyObject *__pyx_t_14 = NULL; + PyObject *__pyx_t_15 = NULL; + PyObject *__pyx_t_16 = NULL; + __Pyx_RefNannySetupContext("killall", 0); + __Pyx_INCREF(__pyx_v_greenlets); + + /* "src/gevent/greenlet.py":980 + * """ + * # support non-indexable containers like iterators or set objects + * greenlets = list(greenlets) # <<<<<<<<<<<<<< + * if not greenlets: + * return + */ + __pyx_t_1 = PySequence_List(__pyx_v_greenlets); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 980, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF_SET(__pyx_v_greenlets, __pyx_t_1); + __pyx_t_1 = 0; + + /* "src/gevent/greenlet.py":981 + * # support non-indexable containers like iterators or set objects + * greenlets = list(greenlets) + * if not greenlets: # <<<<<<<<<<<<<< + * return + * loop = greenlets[0].loop + */ + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_greenlets); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 981, __pyx_L1_error) + __pyx_t_3 = ((!__pyx_t_2) != 0); + if (__pyx_t_3) { + + /* "src/gevent/greenlet.py":982 + * greenlets = list(greenlets) + * if not greenlets: + * return # <<<<<<<<<<<<<< + * loop = greenlets[0].loop + * if block: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + + /* "src/gevent/greenlet.py":981 + * # support non-indexable containers like iterators or set objects + * greenlets = list(greenlets) + * if not greenlets: # <<<<<<<<<<<<<< + * return + * loop = greenlets[0].loop + */ + } + + /* "src/gevent/greenlet.py":983 + * if not greenlets: + * return + * loop = greenlets[0].loop # <<<<<<<<<<<<<< + * if block: + * waiter = Waiter() # pylint:disable=undefined-variable + */ + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_greenlets, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 983, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_loop); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 983, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_loop = __pyx_t_4; + __pyx_t_4 = 0; + + /* "src/gevent/greenlet.py":984 + * return + * loop = greenlets[0].loop + * if block: # <<<<<<<<<<<<<< + * waiter = Waiter() # pylint:disable=undefined-variable + * loop.run_callback(_killall3, greenlets, exception, waiter) + */ + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_block); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 984, __pyx_L1_error) + if (__pyx_t_3) { + + /* "src/gevent/greenlet.py":985 + * loop = greenlets[0].loop + * if block: + * waiter = Waiter() # pylint:disable=undefined-variable # <<<<<<<<<<<<<< + * loop.run_callback(_killall3, greenlets, exception, waiter) + * t = Timeout._start_new_or_dummy(timeout) + */ + __pyx_t_4 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_6gevent_8__waiter_Waiter)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 985, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_v_waiter = ((struct __pyx_obj_6gevent_8__waiter_Waiter *)__pyx_t_4); + __pyx_t_4 = 0; + + /* "src/gevent/greenlet.py":986 + * if block: + * waiter = Waiter() # pylint:disable=undefined-variable + * loop.run_callback(_killall3, greenlets, exception, waiter) # <<<<<<<<<<<<<< + * t = Timeout._start_new_or_dummy(timeout) + * try: + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_loop, __pyx_n_s_run_callback); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 986, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_CFunc_object____list____object____object___to_py(__pyx_f_6gevent_9_greenlet__killall3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 986, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = NULL; + __pyx_t_7 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1); + if (likely(__pyx_t_6)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_1, function); + __pyx_t_7 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_1)) { + PyObject *__pyx_temp[5] = {__pyx_t_6, __pyx_t_5, __pyx_v_greenlets, __pyx_v_exception, ((PyObject *)__pyx_v_waiter)}; + __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_7, 4+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 986, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) { + PyObject *__pyx_temp[5] = {__pyx_t_6, __pyx_t_5, __pyx_v_greenlets, __pyx_v_exception, ((PyObject *)__pyx_v_waiter)}; + __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_7, 4+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 986, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } else + #endif + { + __pyx_t_8 = PyTuple_New(4+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 986, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + if (__pyx_t_6) { + __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL; + } + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_5); + __Pyx_INCREF(__pyx_v_greenlets); + __Pyx_GIVEREF(__pyx_v_greenlets); + PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_greenlets); + __Pyx_INCREF(__pyx_v_exception); + __Pyx_GIVEREF(__pyx_v_exception); + PyTuple_SET_ITEM(__pyx_t_8, 2+__pyx_t_7, __pyx_v_exception); + __Pyx_INCREF(((PyObject *)__pyx_v_waiter)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_waiter)); + PyTuple_SET_ITEM(__pyx_t_8, 3+__pyx_t_7, ((PyObject *)__pyx_v_waiter)); + __pyx_t_5 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 986, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "src/gevent/greenlet.py":987 + * waiter = Waiter() # pylint:disable=undefined-variable + * loop.run_callback(_killall3, greenlets, exception, waiter) + * t = Timeout._start_new_or_dummy(timeout) # <<<<<<<<<<<<<< + * try: + * alive = waiter.get() + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_6gevent_9_greenlet_Timeout, __pyx_n_s_start_new_or_dummy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 987, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_8 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { + __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_1); + if (likely(__pyx_t_8)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); + __Pyx_INCREF(__pyx_t_8); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_1, function); + } + } + __pyx_t_4 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_8, __pyx_v_timeout) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_timeout); + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 987, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_t = __pyx_t_4; + __pyx_t_4 = 0; + + /* "src/gevent/greenlet.py":988 + * loop.run_callback(_killall3, greenlets, exception, waiter) + * t = Timeout._start_new_or_dummy(timeout) + * try: # <<<<<<<<<<<<<< + * alive = waiter.get() + * if alive: + */ + /*try:*/ { + + /* "src/gevent/greenlet.py":989 + * t = Timeout._start_new_or_dummy(timeout) + * try: + * alive = waiter.get() # <<<<<<<<<<<<<< + * if alive: + * joinall(alive, raise_error=False) + */ + __pyx_t_4 = ((struct __pyx_vtabstruct_6gevent_8__waiter_Waiter *)__pyx_v_waiter->__pyx_vtab)->get(__pyx_v_waiter, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 989, __pyx_L6_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_v_alive = __pyx_t_4; + __pyx_t_4 = 0; + + /* "src/gevent/greenlet.py":990 + * try: + * alive = waiter.get() + * if alive: # <<<<<<<<<<<<<< + * joinall(alive, raise_error=False) + * finally: + */ + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_alive); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 990, __pyx_L6_error) + if (__pyx_t_3) { + + /* "src/gevent/greenlet.py":991 + * alive = waiter.get() + * if alive: + * joinall(alive, raise_error=False) # <<<<<<<<<<<<<< + * finally: + * t.cancel() + */ + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_joinall); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 991, __pyx_L6_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 991, __pyx_L6_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_alive); + __Pyx_GIVEREF(__pyx_v_alive); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_alive); + __pyx_t_8 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 991, __pyx_L6_error) + __Pyx_GOTREF(__pyx_t_8); + if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_raise_error, Py_False) < 0) __PYX_ERR(0, 991, __pyx_L6_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_1, __pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 991, __pyx_L6_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "src/gevent/greenlet.py":990 + * try: + * alive = waiter.get() + * if alive: # <<<<<<<<<<<<<< + * joinall(alive, raise_error=False) + * finally: + */ + } + } + + /* "src/gevent/greenlet.py":993 + * joinall(alive, raise_error=False) + * finally: + * t.cancel() # <<<<<<<<<<<<<< + * else: + * loop.run_callback(_killall, greenlets, exception) + */ + /*finally:*/ { + /*normal exit:*/{ + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_t, __pyx_n_s_cancel); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 993, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_1 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) { + __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_8); + if (likely(__pyx_t_1)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); + __Pyx_INCREF(__pyx_t_1); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_8, function); + } + } + __pyx_t_5 = (__pyx_t_1) ? __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_1) : __Pyx_PyObject_CallNoArg(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 993, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + goto __pyx_L7; + } + __pyx_L6_error:; + /*exception exit:*/{ + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_14, &__pyx_t_15, &__pyx_t_16); + if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13) < 0)) __Pyx_ErrFetch(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13); + __Pyx_XGOTREF(__pyx_t_11); + __Pyx_XGOTREF(__pyx_t_12); + __Pyx_XGOTREF(__pyx_t_13); + __Pyx_XGOTREF(__pyx_t_14); + __Pyx_XGOTREF(__pyx_t_15); + __Pyx_XGOTREF(__pyx_t_16); + __pyx_t_7 = __pyx_lineno; __pyx_t_9 = __pyx_clineno; __pyx_t_10 = __pyx_filename; + { + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_t, __pyx_n_s_cancel); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 993, __pyx_L10_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_1 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) { + __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_8); + if (likely(__pyx_t_1)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); + __Pyx_INCREF(__pyx_t_1); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_8, function); + } + } + __pyx_t_5 = (__pyx_t_1) ? __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_1) : __Pyx_PyObject_CallNoArg(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 993, __pyx_L10_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + if (PY_MAJOR_VERSION >= 3) { + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_XGIVEREF(__pyx_t_15); + __Pyx_XGIVEREF(__pyx_t_16); + __Pyx_ExceptionReset(__pyx_t_14, __pyx_t_15, __pyx_t_16); + } + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_XGIVEREF(__pyx_t_12); + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_ErrRestore(__pyx_t_11, __pyx_t_12, __pyx_t_13); + __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; + __pyx_lineno = __pyx_t_7; __pyx_clineno = __pyx_t_9; __pyx_filename = __pyx_t_10; + goto __pyx_L1_error; + __pyx_L10_error:; + if (PY_MAJOR_VERSION >= 3) { + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_XGIVEREF(__pyx_t_15); + __Pyx_XGIVEREF(__pyx_t_16); + __Pyx_ExceptionReset(__pyx_t_14, __pyx_t_15, __pyx_t_16); + } + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; + goto __pyx_L1_error; + } + __pyx_L7:; + } + + /* "src/gevent/greenlet.py":984 + * return + * loop = greenlets[0].loop + * if block: # <<<<<<<<<<<<<< + * waiter = Waiter() # pylint:disable=undefined-variable + * loop.run_callback(_killall3, greenlets, exception, waiter) + */ + goto __pyx_L4; + } + + /* "src/gevent/greenlet.py":995 + * t.cancel() + * else: + * loop.run_callback(_killall, greenlets, exception) # <<<<<<<<<<<<<< + * + * def _init(): + */ + /*else*/ { + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_loop, __pyx_n_s_run_callback); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 995, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_1 = __Pyx_CFunc_object____list____object___to_py(__pyx_f_6gevent_9_greenlet__killall); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 995, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = NULL; + __pyx_t_9 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_8); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_8, function); + __pyx_t_9 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_8)) { + PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_t_1, __pyx_v_greenlets, __pyx_v_exception}; + __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_9, 3+__pyx_t_9); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 995, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_8)) { + PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_t_1, __pyx_v_greenlets, __pyx_v_exception}; + __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_9, 3+__pyx_t_9); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 995, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else + #endif + { + __pyx_t_6 = PyTuple_New(3+__pyx_t_9); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 995, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (__pyx_t_4) { + __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL; + } + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_9, __pyx_t_1); + __Pyx_INCREF(__pyx_v_greenlets); + __Pyx_GIVEREF(__pyx_v_greenlets); + PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_9, __pyx_v_greenlets); + __Pyx_INCREF(__pyx_v_exception); + __Pyx_GIVEREF(__pyx_v_exception); + PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_9, __pyx_v_exception); + __pyx_t_1 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 995, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + __pyx_L4:; + + /* "src/gevent/greenlet.py":953 + * + * + * def killall(greenlets, exception=GreenletExit, block=True, timeout=None): # <<<<<<<<<<<<<< + * """ + * Forceably terminate all the ``greenlets`` by causing them to raise ``exception``. + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("gevent._greenlet.killall", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_loop); + __Pyx_XDECREF((PyObject *)__pyx_v_waiter); + __Pyx_XDECREF(__pyx_v_t); + __Pyx_XDECREF(__pyx_v_alive); + __Pyx_XDECREF(__pyx_v_greenlets); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/greenlet.py":997 + * loop.run_callback(_killall, greenlets, exception) + * + * def _init(): # <<<<<<<<<<<<<< + * greenlet_init() # pylint:disable=undefined-variable + * + */ + +static void __pyx_f_6gevent_9_greenlet__init(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_init", 0); + + /* "src/gevent/greenlet.py":998 + * + * def _init(): + * greenlet_init() # pylint:disable=undefined-variable # <<<<<<<<<<<<<< + * + * _init() + */ + __pyx_f_6gevent_9_greenlet_greenlet_init(); + + /* "src/gevent/greenlet.py":997 + * loop.run_callback(_killall, greenlets, exception) + * + * def _init(): # <<<<<<<<<<<<<< + * greenlet_init() # pylint:disable=undefined-variable + * + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "gevent/__greenlet_primitives.pxd":23 + * + * @cython.final + * cdef inline greenlet getcurrent(): # <<<<<<<<<<<<<< + * return PyGreenlet_GetCurrent() + * + */ + +static CYTHON_INLINE PyGreenlet *__pyx_f_6gevent_21__greenlet_primitives_getcurrent(void) { + PyGreenlet *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("getcurrent", 0); + + /* "gevent/__greenlet_primitives.pxd":24 + * @cython.final + * cdef inline greenlet getcurrent(): + * return PyGreenlet_GetCurrent() # <<<<<<<<<<<<<< + * + * cdef bint _greenlet_imported + */ + __Pyx_XDECREF(((PyObject *)__pyx_r)); + __pyx_t_1 = ((PyObject *)PyGreenlet_GetCurrent()); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 24, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = ((PyGreenlet *)__pyx_t_1); + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "gevent/__greenlet_primitives.pxd":23 + * + * @cython.final + * cdef inline greenlet getcurrent(): # <<<<<<<<<<<<<< + * return PyGreenlet_GetCurrent() + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__greenlet_primitives.getcurrent", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF((PyObject *)__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/__greenlet_primitives.pxd":28 + * cdef bint _greenlet_imported + * + * cdef inline void greenlet_init(): # <<<<<<<<<<<<<< + * global _greenlet_imported + * if not _greenlet_imported: + */ + +static CYTHON_INLINE void __pyx_f_6gevent_21__greenlet_primitives_greenlet_init(void) { + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("greenlet_init", 0); + + /* "gevent/__greenlet_primitives.pxd":30 + * cdef inline void greenlet_init(): + * global _greenlet_imported + * if not _greenlet_imported: # <<<<<<<<<<<<<< + * PyGreenlet_Import() + * _greenlet_imported = True + */ + __pyx_t_1 = ((!(__pyx_v_6gevent_21__greenlet_primitives__greenlet_imported != 0)) != 0); + if (__pyx_t_1) { + + /* "gevent/__greenlet_primitives.pxd":31 + * global _greenlet_imported + * if not _greenlet_imported: + * PyGreenlet_Import() # <<<<<<<<<<<<<< + * _greenlet_imported = True + * + */ + PyGreenlet_Import(); + + /* "gevent/__greenlet_primitives.pxd":32 + * if not _greenlet_imported: + * PyGreenlet_Import() + * _greenlet_imported = True # <<<<<<<<<<<<<< + * + * cdef inline object _greenlet_switch(greenlet self): + */ + __pyx_v_6gevent_21__greenlet_primitives__greenlet_imported = 1; + + /* "gevent/__greenlet_primitives.pxd":30 + * cdef inline void greenlet_init(): + * global _greenlet_imported + * if not _greenlet_imported: # <<<<<<<<<<<<<< + * PyGreenlet_Import() + * _greenlet_imported = True + */ + } + + /* "gevent/__greenlet_primitives.pxd":28 + * cdef bint _greenlet_imported + * + * cdef inline void greenlet_init(): # <<<<<<<<<<<<<< + * global _greenlet_imported + * if not _greenlet_imported: + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "gevent/__greenlet_primitives.pxd":34 + * _greenlet_imported = True + * + * cdef inline object _greenlet_switch(greenlet self): # <<<<<<<<<<<<<< + * return PyGreenlet_Switch(self, NULL, NULL) + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_6gevent_21__greenlet_primitives__greenlet_switch(PyGreenlet *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("_greenlet_switch", 0); + + /* "gevent/__greenlet_primitives.pxd":35 + * + * cdef inline object _greenlet_switch(greenlet self): + * return PyGreenlet_Switch(self, NULL, NULL) # <<<<<<<<<<<<<< + * + * cdef class TrackedRawGreenlet(greenlet): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyGreenlet_Switch(__pyx_v_self, NULL, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 35, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "gevent/__greenlet_primitives.pxd":34 + * _greenlet_imported = True + * + * cdef inline object _greenlet_switch(greenlet self): # <<<<<<<<<<<<<< + * return PyGreenlet_Switch(self, NULL, NULL) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__greenlet_primitives._greenlet_switch", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/__waiter.pxd":24 + * void PyGreenlet_Import() + * + * cdef inline greenlet getcurrent(): # <<<<<<<<<<<<<< + * return PyGreenlet_GetCurrent() + * + */ + +static CYTHON_INLINE PyGreenlet *__pyx_f_6gevent_8__waiter_getcurrent(void) { + PyGreenlet *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("getcurrent", 0); + + /* "gevent/__waiter.pxd":25 + * + * cdef inline greenlet getcurrent(): + * return PyGreenlet_GetCurrent() # <<<<<<<<<<<<<< + * + * cdef inline void greenlet_init(): + */ + __Pyx_XDECREF(((PyObject *)__pyx_r)); + __pyx_t_1 = ((PyObject *)PyGreenlet_GetCurrent()); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 25, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = ((PyGreenlet *)__pyx_t_1); + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "gevent/__waiter.pxd":24 + * void PyGreenlet_Import() + * + * cdef inline greenlet getcurrent(): # <<<<<<<<<<<<<< + * return PyGreenlet_GetCurrent() + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__waiter.getcurrent", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF((PyObject *)__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/__waiter.pxd":27 + * return PyGreenlet_GetCurrent() + * + * cdef inline void greenlet_init(): # <<<<<<<<<<<<<< + * global _greenlet_imported + * if not _greenlet_imported: + */ + +static CYTHON_INLINE void __pyx_f_6gevent_8__waiter_greenlet_init(void) { + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("greenlet_init", 0); + + /* "gevent/__waiter.pxd":29 + * cdef inline void greenlet_init(): + * global _greenlet_imported + * if not _greenlet_imported: # <<<<<<<<<<<<<< + * PyGreenlet_Import() + * _greenlet_imported = True + */ + __pyx_t_1 = ((!(__pyx_v_6gevent_8__waiter__greenlet_imported != 0)) != 0); + if (__pyx_t_1) { + + /* "gevent/__waiter.pxd":30 + * global _greenlet_imported + * if not _greenlet_imported: + * PyGreenlet_Import() # <<<<<<<<<<<<<< + * _greenlet_imported = True + * + */ + PyGreenlet_Import(); + + /* "gevent/__waiter.pxd":31 + * if not _greenlet_imported: + * PyGreenlet_Import() + * _greenlet_imported = True # <<<<<<<<<<<<<< + * + * cdef class Waiter: + */ + __pyx_v_6gevent_8__waiter__greenlet_imported = 1; + + /* "gevent/__waiter.pxd":29 + * cdef inline void greenlet_init(): + * global _greenlet_imported + * if not _greenlet_imported: # <<<<<<<<<<<<<< + * PyGreenlet_Import() + * _greenlet_imported = True + */ + } + + /* "gevent/__waiter.pxd":27 + * return PyGreenlet_GetCurrent() + * + * cdef inline void greenlet_init(): # <<<<<<<<<<<<<< + * global _greenlet_imported + * if not _greenlet_imported: + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "gevent/_greenlet.pxd":27 + * + * @cython.final + * cdef inline greenlet getcurrent(): # <<<<<<<<<<<<<< + * return PyGreenlet_GetCurrent() + * + */ + +static CYTHON_INLINE PyGreenlet *__pyx_f_6gevent_9_greenlet_getcurrent(void) { + PyGreenlet *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("getcurrent", 0); + + /* "gevent/_greenlet.pxd":28 + * @cython.final + * cdef inline greenlet getcurrent(): + * return PyGreenlet_GetCurrent() # <<<<<<<<<<<<<< + * + * cdef bint _greenlet_imported + */ + __Pyx_XDECREF(((PyObject *)__pyx_r)); + __pyx_t_1 = ((PyObject *)PyGreenlet_GetCurrent()); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 28, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = ((PyGreenlet *)__pyx_t_1); + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "gevent/_greenlet.pxd":27 + * + * @cython.final + * cdef inline greenlet getcurrent(): # <<<<<<<<<<<<<< + * return PyGreenlet_GetCurrent() + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent._greenlet.getcurrent", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF((PyObject *)__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/_greenlet.pxd":32 + * cdef bint _greenlet_imported + * + * cdef inline void greenlet_init(): # <<<<<<<<<<<<<< + * global _greenlet_imported + * if not _greenlet_imported: + */ + +static CYTHON_INLINE void __pyx_f_6gevent_9_greenlet_greenlet_init(void) { + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("greenlet_init", 0); + + /* "gevent/_greenlet.pxd":34 + * cdef inline void greenlet_init(): + * global _greenlet_imported + * if not _greenlet_imported: # <<<<<<<<<<<<<< + * PyGreenlet_Import() + * _greenlet_imported = True + */ + __pyx_t_1 = ((!(__pyx_v_6gevent_9_greenlet__greenlet_imported != 0)) != 0); + if (__pyx_t_1) { + + /* "gevent/_greenlet.pxd":35 + * global _greenlet_imported + * if not _greenlet_imported: + * PyGreenlet_Import() # <<<<<<<<<<<<<< + * _greenlet_imported = True + * + */ + PyGreenlet_Import(); + + /* "gevent/_greenlet.pxd":36 + * if not _greenlet_imported: + * PyGreenlet_Import() + * _greenlet_imported = True # <<<<<<<<<<<<<< + * + * cdef extern from "Python.h": + */ + __pyx_v_6gevent_9_greenlet__greenlet_imported = 1; + + /* "gevent/_greenlet.pxd":34 + * cdef inline void greenlet_init(): + * global _greenlet_imported + * if not _greenlet_imported: # <<<<<<<<<<<<<< + * PyGreenlet_Import() + * _greenlet_imported = True + */ + } + + /* "gevent/_greenlet.pxd":32 + * cdef bint _greenlet_imported + * + * cdef inline void greenlet_init(): # <<<<<<<<<<<<<< + * global _greenlet_imported + * if not _greenlet_imported: + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "cfunc.to_py":65 + * @cname("__Pyx_CFunc_object____list____object____object___to_py") + * cdef object __Pyx_CFunc_object____list____object____object___to_py(object (*f)(list, object, object) ): + * def wrap(list greenlets, object exception, object waiter): # <<<<<<<<<<<<<< + * """wrap(greenlets: list, exception, waiter)""" + * return f(greenlets, exception, waiter) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_11cfunc_dot_to_py_54__Pyx_CFunc_object____list____object____object___to_py_1wrap(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_11cfunc_dot_to_py_54__Pyx_CFunc_object____list____object____object___to_py_wrap[] = "wrap(greenlets: list, exception, waiter)"; +static PyMethodDef __pyx_mdef_11cfunc_dot_to_py_54__Pyx_CFunc_object____list____object____object___to_py_1wrap = {"wrap", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11cfunc_dot_to_py_54__Pyx_CFunc_object____list____object____object___to_py_1wrap, METH_VARARGS|METH_KEYWORDS, __pyx_doc_11cfunc_dot_to_py_54__Pyx_CFunc_object____list____object____object___to_py_wrap}; +static PyObject *__pyx_pw_11cfunc_dot_to_py_54__Pyx_CFunc_object____list____object____object___to_py_1wrap(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_greenlets = 0; + PyObject *__pyx_v_exception = 0; + PyObject *__pyx_v_waiter = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("wrap (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_greenlets,&__pyx_n_s_exception,&__pyx_n_s_waiter,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_greenlets)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_exception)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("wrap", 1, 3, 3, 1); __PYX_ERR(4, 65, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_waiter)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("wrap", 1, 3, 3, 2); __PYX_ERR(4, 65, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "wrap") < 0)) __PYX_ERR(4, 65, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + } + __pyx_v_greenlets = ((PyObject*)values[0]); + __pyx_v_exception = values[1]; + __pyx_v_waiter = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("wrap", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(4, 65, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("cfunc.to_py.__Pyx_CFunc_object____list____object____object___to_py.wrap", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_greenlets), (&PyList_Type), 1, "greenlets", 1))) __PYX_ERR(4, 65, __pyx_L1_error) + __pyx_r = __pyx_pf_11cfunc_dot_to_py_54__Pyx_CFunc_object____list____object____object___to_py_wrap(__pyx_self, __pyx_v_greenlets, __pyx_v_exception, __pyx_v_waiter); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_11cfunc_dot_to_py_54__Pyx_CFunc_object____list____object____object___to_py_wrap(PyObject *__pyx_self, PyObject *__pyx_v_greenlets, PyObject *__pyx_v_exception, PyObject *__pyx_v_waiter) { + struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_object____list____object____object___to_py *__pyx_cur_scope; + struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_object____list____object____object___to_py *__pyx_outer_scope; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("wrap", 0); + __pyx_outer_scope = (struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_object____list____object____object___to_py *) __Pyx_CyFunction_GetClosure(__pyx_self); + __pyx_cur_scope = __pyx_outer_scope; + + /* "cfunc.to_py":67 + * def wrap(list greenlets, object exception, object waiter): + * """wrap(greenlets: list, exception, waiter)""" + * return f(greenlets, exception, waiter) # <<<<<<<<<<<<<< + * return wrap + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_cur_scope->__pyx_v_f(__pyx_v_greenlets, __pyx_v_exception, __pyx_v_waiter); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 67, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "cfunc.to_py":65 + * @cname("__Pyx_CFunc_object____list____object____object___to_py") + * cdef object __Pyx_CFunc_object____list____object____object___to_py(object (*f)(list, object, object) ): + * def wrap(list greenlets, object exception, object waiter): # <<<<<<<<<<<<<< + * """wrap(greenlets: list, exception, waiter)""" + * return f(greenlets, exception, waiter) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("cfunc.to_py.__Pyx_CFunc_object____list____object____object___to_py.wrap", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "cfunc.to_py":64 + * + * @cname("__Pyx_CFunc_object____list____object____object___to_py") + * cdef object __Pyx_CFunc_object____list____object____object___to_py(object (*f)(list, object, object) ): # <<<<<<<<<<<<<< + * def wrap(list greenlets, object exception, object waiter): + * """wrap(greenlets: list, exception, waiter)""" + */ + +static PyObject *__Pyx_CFunc_object____list____object____object___to_py(PyObject *(*__pyx_v_f)(PyObject *, PyObject *, PyObject *)) { + struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_object____list____object____object___to_py *__pyx_cur_scope; + PyObject *__pyx_v_wrap = 0; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__Pyx_CFunc_object____list____object____object___to_py", 0); + __pyx_cur_scope = (struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_object____list____object____object___to_py *)__pyx_tp_new___pyx_scope_struct____Pyx_CFunc_object____list____object____object___to_py(__pyx_ptype___pyx_scope_struct____Pyx_CFunc_object____list____object____object___to_py, __pyx_empty_tuple, NULL); + if (unlikely(!__pyx_cur_scope)) { + __pyx_cur_scope = ((struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_object____list____object____object___to_py *)Py_None); + __Pyx_INCREF(Py_None); + __PYX_ERR(4, 64, __pyx_L1_error) + } else { + __Pyx_GOTREF(__pyx_cur_scope); + } + __pyx_cur_scope->__pyx_v_f = __pyx_v_f; + + /* "cfunc.to_py":65 + * @cname("__Pyx_CFunc_object____list____object____object___to_py") + * cdef object __Pyx_CFunc_object____list____object____object___to_py(object (*f)(list, object, object) ): + * def wrap(list greenlets, object exception, object waiter): # <<<<<<<<<<<<<< + * """wrap(greenlets: list, exception, waiter)""" + * return f(greenlets, exception, waiter) + */ + __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_11cfunc_dot_to_py_54__Pyx_CFunc_object____list____object____object___to_py_1wrap, 0, __pyx_n_s_Pyx_CFunc_object____list____ob, ((PyObject*)__pyx_cur_scope), __pyx_n_s_cfunc_to_py, __pyx_d, ((PyObject *)__pyx_codeobj__18)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 65, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_wrap = __pyx_t_1; + __pyx_t_1 = 0; + + /* "cfunc.to_py":68 + * """wrap(greenlets: list, exception, waiter)""" + * return f(greenlets, exception, waiter) + * return wrap # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_wrap); + __pyx_r = __pyx_v_wrap; + goto __pyx_L0; + + /* "cfunc.to_py":64 + * + * @cname("__Pyx_CFunc_object____list____object____object___to_py") + * cdef object __Pyx_CFunc_object____list____object____object___to_py(object (*f)(list, object, object) ): # <<<<<<<<<<<<<< + * def wrap(list greenlets, object exception, object waiter): + * """wrap(greenlets: list, exception, waiter)""" + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("cfunc.to_py.__Pyx_CFunc_object____list____object____object___to_py", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_wrap); + __Pyx_DECREF(((PyObject *)__pyx_cur_scope)); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "cfunc.to_py":65 + * @cname("__Pyx_CFunc_object____list____object___to_py") + * cdef object __Pyx_CFunc_object____list____object___to_py(object (*f)(list, object) ): + * def wrap(list greenlets, object exception): # <<<<<<<<<<<<<< + * """wrap(greenlets: list, exception)""" + * return f(greenlets, exception) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_11cfunc_dot_to_py_44__Pyx_CFunc_object____list____object___to_py_1wrap(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_11cfunc_dot_to_py_44__Pyx_CFunc_object____list____object___to_py_wrap[] = "wrap(greenlets: list, exception)"; +static PyMethodDef __pyx_mdef_11cfunc_dot_to_py_44__Pyx_CFunc_object____list____object___to_py_1wrap = {"wrap", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11cfunc_dot_to_py_44__Pyx_CFunc_object____list____object___to_py_1wrap, METH_VARARGS|METH_KEYWORDS, __pyx_doc_11cfunc_dot_to_py_44__Pyx_CFunc_object____list____object___to_py_wrap}; +static PyObject *__pyx_pw_11cfunc_dot_to_py_44__Pyx_CFunc_object____list____object___to_py_1wrap(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_greenlets = 0; + PyObject *__pyx_v_exception = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("wrap (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_greenlets,&__pyx_n_s_exception,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_greenlets)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_exception)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("wrap", 1, 2, 2, 1); __PYX_ERR(4, 65, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "wrap") < 0)) __PYX_ERR(4, 65, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_greenlets = ((PyObject*)values[0]); + __pyx_v_exception = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("wrap", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(4, 65, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("cfunc.to_py.__Pyx_CFunc_object____list____object___to_py.wrap", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_greenlets), (&PyList_Type), 1, "greenlets", 1))) __PYX_ERR(4, 65, __pyx_L1_error) + __pyx_r = __pyx_pf_11cfunc_dot_to_py_44__Pyx_CFunc_object____list____object___to_py_wrap(__pyx_self, __pyx_v_greenlets, __pyx_v_exception); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_11cfunc_dot_to_py_44__Pyx_CFunc_object____list____object___to_py_wrap(PyObject *__pyx_self, PyObject *__pyx_v_greenlets, PyObject *__pyx_v_exception) { + struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_object____list____object___to_py *__pyx_cur_scope; + struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_object____list____object___to_py *__pyx_outer_scope; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("wrap", 0); + __pyx_outer_scope = (struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_object____list____object___to_py *) __Pyx_CyFunction_GetClosure(__pyx_self); + __pyx_cur_scope = __pyx_outer_scope; + + /* "cfunc.to_py":67 + * def wrap(list greenlets, object exception): + * """wrap(greenlets: list, exception)""" + * return f(greenlets, exception) # <<<<<<<<<<<<<< + * return wrap + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_cur_scope->__pyx_v_f(__pyx_v_greenlets, __pyx_v_exception); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 67, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "cfunc.to_py":65 + * @cname("__Pyx_CFunc_object____list____object___to_py") + * cdef object __Pyx_CFunc_object____list____object___to_py(object (*f)(list, object) ): + * def wrap(list greenlets, object exception): # <<<<<<<<<<<<<< + * """wrap(greenlets: list, exception)""" + * return f(greenlets, exception) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("cfunc.to_py.__Pyx_CFunc_object____list____object___to_py.wrap", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "cfunc.to_py":64 + * + * @cname("__Pyx_CFunc_object____list____object___to_py") + * cdef object __Pyx_CFunc_object____list____object___to_py(object (*f)(list, object) ): # <<<<<<<<<<<<<< + * def wrap(list greenlets, object exception): + * """wrap(greenlets: list, exception)""" + */ + +static PyObject *__Pyx_CFunc_object____list____object___to_py(PyObject *(*__pyx_v_f)(PyObject *, PyObject *)) { + struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_object____list____object___to_py *__pyx_cur_scope; + PyObject *__pyx_v_wrap = 0; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__Pyx_CFunc_object____list____object___to_py", 0); + __pyx_cur_scope = (struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_object____list____object___to_py *)__pyx_tp_new___pyx_scope_struct____Pyx_CFunc_object____list____object___to_py(__pyx_ptype___pyx_scope_struct____Pyx_CFunc_object____list____object___to_py, __pyx_empty_tuple, NULL); + if (unlikely(!__pyx_cur_scope)) { + __pyx_cur_scope = ((struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_object____list____object___to_py *)Py_None); + __Pyx_INCREF(Py_None); + __PYX_ERR(4, 64, __pyx_L1_error) + } else { + __Pyx_GOTREF(__pyx_cur_scope); + } + __pyx_cur_scope->__pyx_v_f = __pyx_v_f; + + /* "cfunc.to_py":65 + * @cname("__Pyx_CFunc_object____list____object___to_py") + * cdef object __Pyx_CFunc_object____list____object___to_py(object (*f)(list, object) ): + * def wrap(list greenlets, object exception): # <<<<<<<<<<<<<< + * """wrap(greenlets: list, exception)""" + * return f(greenlets, exception) + */ + __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_11cfunc_dot_to_py_44__Pyx_CFunc_object____list____object___to_py_1wrap, 0, __pyx_n_s_Pyx_CFunc_object____list____ob_2, ((PyObject*)__pyx_cur_scope), __pyx_n_s_cfunc_to_py, __pyx_d, ((PyObject *)__pyx_codeobj__20)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 65, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_wrap = __pyx_t_1; + __pyx_t_1 = 0; + + /* "cfunc.to_py":68 + * """wrap(greenlets: list, exception)""" + * return f(greenlets, exception) + * return wrap # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_wrap); + __pyx_r = __pyx_v_wrap; + goto __pyx_L0; + + /* "cfunc.to_py":64 + * + * @cname("__Pyx_CFunc_object____list____object___to_py") + * cdef object __Pyx_CFunc_object____list____object___to_py(object (*f)(list, object) ): # <<<<<<<<<<<<<< + * def wrap(list greenlets, object exception): + * """wrap(greenlets: list, exception)""" + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("cfunc.to_py.__Pyx_CFunc_object____list____object___to_py", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_wrap); + __Pyx_DECREF(((PyObject *)__pyx_cur_scope)); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_tp_new_6gevent_9_greenlet_SpawnedLink(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + struct __pyx_obj_6gevent_9_greenlet_SpawnedLink *p; + PyObject *o; + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_6gevent_9_greenlet_SpawnedLink *)o); + p->callback = Py_None; Py_INCREF(Py_None); + return o; +} + +static void __pyx_tp_dealloc_6gevent_9_greenlet_SpawnedLink(PyObject *o) { + struct __pyx_obj_6gevent_9_greenlet_SpawnedLink *p = (struct __pyx_obj_6gevent_9_greenlet_SpawnedLink *)o; + #if CYTHON_USE_TP_FINALIZE + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + PyObject_GC_UnTrack(o); + Py_CLEAR(p->callback); + (*Py_TYPE(o)->tp_free)(o); +} + +static int __pyx_tp_traverse_6gevent_9_greenlet_SpawnedLink(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_6gevent_9_greenlet_SpawnedLink *p = (struct __pyx_obj_6gevent_9_greenlet_SpawnedLink *)o; + if (p->callback) { + e = (*v)(p->callback, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_6gevent_9_greenlet_SpawnedLink(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_6gevent_9_greenlet_SpawnedLink *p = (struct __pyx_obj_6gevent_9_greenlet_SpawnedLink *)o; + tmp = ((PyObject*)p->callback); + p->callback = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyObject *__pyx_tp_getattro_6gevent_9_greenlet_SpawnedLink(PyObject *o, PyObject *n) { + PyObject *v = __Pyx_PyObject_GenericGetAttr(o, n); + if (!v && PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_Clear(); + v = __pyx_pw_6gevent_9_greenlet_11SpawnedLink_13__getattr__(o, n); + } + return v; +} + +static PyObject *__pyx_tp_richcompare_6gevent_9_greenlet_SpawnedLink(PyObject *o1, PyObject *o2, int op) { + switch (op) { + case Py_EQ: { + return __pyx_pw_6gevent_9_greenlet_11SpawnedLink_7__eq__(o1, o2); + } + case Py_NE: { + PyObject *ret; + ret = __pyx_pw_6gevent_9_greenlet_11SpawnedLink_7__eq__(o1, o2); + if (likely(ret && ret != Py_NotImplemented)) { + int b = __Pyx_PyObject_IsTrue(ret); Py_DECREF(ret); + if (unlikely(b < 0)) return NULL; + ret = (b) ? Py_False : Py_True; + Py_INCREF(ret); + } + return ret; + } + default: { + return __Pyx_NewRef(Py_NotImplemented); + } + } +} + +static PyObject *__pyx_getprop_6gevent_9_greenlet_11SpawnedLink_callback(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_9_greenlet_11SpawnedLink_8callback_1__get__(o); +} + +static int __pyx_setprop_6gevent_9_greenlet_11SpawnedLink_callback(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6gevent_9_greenlet_11SpawnedLink_8callback_3__set__(o, v); + } + else { + return __pyx_pw_6gevent_9_greenlet_11SpawnedLink_8callback_5__del__(o); + } +} + +static PyMethodDef __pyx_methods_6gevent_9_greenlet_SpawnedLink[] = { + {"__getattr__", (PyCFunction)__pyx_pw_6gevent_9_greenlet_11SpawnedLink_13__getattr__, METH_O|METH_COEXIST, 0}, + {0, 0, 0, 0} +}; + +static struct PyGetSetDef __pyx_getsets_6gevent_9_greenlet_SpawnedLink[] = { + {(char *)"callback", __pyx_getprop_6gevent_9_greenlet_11SpawnedLink_callback, __pyx_setprop_6gevent_9_greenlet_11SpawnedLink_callback, (char *)"callback: object", 0}, + {0, 0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_6gevent_9_greenlet_SpawnedLink = { + PyVarObject_HEAD_INIT(0, 0) + "gevent._greenlet.SpawnedLink", /*tp_name*/ + sizeof(struct __pyx_obj_6gevent_9_greenlet_SpawnedLink), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6gevent_9_greenlet_SpawnedLink, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + __pyx_pw_6gevent_9_greenlet_11SpawnedLink_11__repr__, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + __pyx_pw_6gevent_9_greenlet_11SpawnedLink_5__hash__, /*tp_hash*/ + __pyx_pw_6gevent_9_greenlet_11SpawnedLink_3__call__, /*tp_call*/ + __pyx_pw_6gevent_9_greenlet_11SpawnedLink_9__str__, /*tp_str*/ + __pyx_tp_getattro_6gevent_9_greenlet_SpawnedLink, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + "SpawnedLink(callback)\n\n A wrapper around link that calls it in another greenlet.\n\n Can be called only from main loop.\n ", /*tp_doc*/ + __pyx_tp_traverse_6gevent_9_greenlet_SpawnedLink, /*tp_traverse*/ + __pyx_tp_clear_6gevent_9_greenlet_SpawnedLink, /*tp_clear*/ + __pyx_tp_richcompare_6gevent_9_greenlet_SpawnedLink, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6gevent_9_greenlet_SpawnedLink, /*tp_methods*/ + 0, /*tp_members*/ + __pyx_getsets_6gevent_9_greenlet_SpawnedLink, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_pw_6gevent_9_greenlet_11SpawnedLink_1__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6gevent_9_greenlet_SpawnedLink, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static PyObject *__pyx_tp_new_6gevent_9_greenlet_SuccessSpawnedLink(PyTypeObject *t, PyObject *a, PyObject *k) { + PyObject *o = __pyx_tp_new_6gevent_9_greenlet_SpawnedLink(t, a, k); + if (unlikely(!o)) return 0; + return o; +} + +static PyMethodDef __pyx_methods_6gevent_9_greenlet_SuccessSpawnedLink[] = { + {0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_6gevent_9_greenlet_SuccessSpawnedLink = { + PyVarObject_HEAD_INIT(0, 0) + "gevent._greenlet.SuccessSpawnedLink", /*tp_name*/ + sizeof(struct __pyx_obj_6gevent_9_greenlet_SuccessSpawnedLink), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6gevent_9_greenlet_SpawnedLink, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_6gevent_9_greenlet_11SpawnedLink_11__repr__, /*tp_repr*/ + #else + 0, /*tp_repr*/ + #endif + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + __pyx_pw_6gevent_9_greenlet_18SuccessSpawnedLink_1__call__, /*tp_call*/ + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_6gevent_9_greenlet_11SpawnedLink_9__str__, /*tp_str*/ + #else + 0, /*tp_str*/ + #endif + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + "A wrapper around link that calls it in another greenlet only if source succeed.\n\n Can be called only from main loop.\n ", /*tp_doc*/ + __pyx_tp_traverse_6gevent_9_greenlet_SpawnedLink, /*tp_traverse*/ + __pyx_tp_clear_6gevent_9_greenlet_SpawnedLink, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6gevent_9_greenlet_SuccessSpawnedLink, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_6gevent_9_greenlet_11SpawnedLink_1__init__, /*tp_init*/ + #else + 0, /*tp_init*/ + #endif + 0, /*tp_alloc*/ + __pyx_tp_new_6gevent_9_greenlet_SuccessSpawnedLink, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static PyObject *__pyx_tp_new_6gevent_9_greenlet_FailureSpawnedLink(PyTypeObject *t, PyObject *a, PyObject *k) { + PyObject *o = __pyx_tp_new_6gevent_9_greenlet_SpawnedLink(t, a, k); + if (unlikely(!o)) return 0; + return o; +} + +static PyMethodDef __pyx_methods_6gevent_9_greenlet_FailureSpawnedLink[] = { + {0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_6gevent_9_greenlet_FailureSpawnedLink = { + PyVarObject_HEAD_INIT(0, 0) + "gevent._greenlet.FailureSpawnedLink", /*tp_name*/ + sizeof(struct __pyx_obj_6gevent_9_greenlet_FailureSpawnedLink), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6gevent_9_greenlet_SpawnedLink, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_6gevent_9_greenlet_11SpawnedLink_11__repr__, /*tp_repr*/ + #else + 0, /*tp_repr*/ + #endif + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + __pyx_pw_6gevent_9_greenlet_18FailureSpawnedLink_1__call__, /*tp_call*/ + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_6gevent_9_greenlet_11SpawnedLink_9__str__, /*tp_str*/ + #else + 0, /*tp_str*/ + #endif + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + "A wrapper around link that calls it in another greenlet only if source failed.\n\n Can be called only from main loop.\n ", /*tp_doc*/ + __pyx_tp_traverse_6gevent_9_greenlet_SpawnedLink, /*tp_traverse*/ + __pyx_tp_clear_6gevent_9_greenlet_SpawnedLink, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6gevent_9_greenlet_FailureSpawnedLink, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_6gevent_9_greenlet_11SpawnedLink_1__init__, /*tp_init*/ + #else + 0, /*tp_init*/ + #endif + 0, /*tp_alloc*/ + __pyx_tp_new_6gevent_9_greenlet_FailureSpawnedLink, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static PyObject *__pyx_tp_new_6gevent_9_greenlet__Frame(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + struct __pyx_obj_6gevent_9_greenlet__Frame *p; + PyObject *o; + o = (*t->tp_alloc)(t, 0); + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_6gevent_9_greenlet__Frame *)o); + p->f_code = ((PyCodeObject *)Py_None); Py_INCREF(Py_None); + p->f_back = ((struct __pyx_obj_6gevent_9_greenlet__Frame *)Py_None); Py_INCREF(Py_None); + return o; +} + +static void __pyx_tp_dealloc_6gevent_9_greenlet__Frame(PyObject *o) { + struct __pyx_obj_6gevent_9_greenlet__Frame *p = (struct __pyx_obj_6gevent_9_greenlet__Frame *)o; + PyObject_GC_UnTrack(o); + Py_CLEAR(p->f_code); + Py_CLEAR(p->f_back); + (*Py_TYPE(o)->tp_free)(o); +} + +static int __pyx_tp_traverse_6gevent_9_greenlet__Frame(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_6gevent_9_greenlet__Frame *p = (struct __pyx_obj_6gevent_9_greenlet__Frame *)o; + if (p->f_code) { + e = (*v)(((PyObject *)p->f_code), a); if (e) return e; + } + if (p->f_back) { + e = (*v)(((PyObject *)p->f_back), a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_6gevent_9_greenlet__Frame(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_6gevent_9_greenlet__Frame *p = (struct __pyx_obj_6gevent_9_greenlet__Frame *)o; + tmp = ((PyObject*)p->f_code); + p->f_code = ((PyCodeObject *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->f_back); + p->f_back = ((struct __pyx_obj_6gevent_9_greenlet__Frame *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyObject *__pyx_getprop_6gevent_9_greenlet_6_Frame_f_globals(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_9_greenlet_6_Frame_9f_globals_1__get__(o); +} + +static PyObject *__pyx_getprop_6gevent_9_greenlet_6_Frame_f_code(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_9_greenlet_6_Frame_6f_code_1__get__(o); +} + +static PyObject *__pyx_getprop_6gevent_9_greenlet_6_Frame_f_lineno(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_9_greenlet_6_Frame_8f_lineno_1__get__(o); +} + +static PyObject *__pyx_getprop_6gevent_9_greenlet_6_Frame_f_back(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_9_greenlet_6_Frame_6f_back_1__get__(o); +} + +static PyMethodDef __pyx_methods_6gevent_9_greenlet__Frame[] = { + {0, 0, 0, 0} +}; + +static struct PyGetSetDef __pyx_getsets_6gevent_9_greenlet__Frame[] = { + {(char *)"f_globals", __pyx_getprop_6gevent_9_greenlet_6_Frame_f_globals, 0, (char *)0, 0}, + {(char *)"f_code", __pyx_getprop_6gevent_9_greenlet_6_Frame_f_code, 0, (char *)0, 0}, + {(char *)"f_lineno", __pyx_getprop_6gevent_9_greenlet_6_Frame_f_lineno, 0, (char *)0, 0}, + {(char *)"f_back", __pyx_getprop_6gevent_9_greenlet_6_Frame_f_back, 0, (char *)0, 0}, + {0, 0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_6gevent_9_greenlet__Frame = { + PyVarObject_HEAD_INIT(0, 0) + "gevent._greenlet._Frame", /*tp_name*/ + sizeof(struct __pyx_obj_6gevent_9_greenlet__Frame), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6gevent_9_greenlet__Frame, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + "_Frame(f_code, f_lineno, f_back)", /*tp_doc*/ + __pyx_tp_traverse_6gevent_9_greenlet__Frame, /*tp_traverse*/ + __pyx_tp_clear_6gevent_9_greenlet__Frame, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6gevent_9_greenlet__Frame, /*tp_methods*/ + 0, /*tp_members*/ + __pyx_getsets_6gevent_9_greenlet__Frame, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_pw_6gevent_9_greenlet_6_Frame_1__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6gevent_9_greenlet__Frame, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; +static struct __pyx_vtabstruct_6gevent_9_greenlet_Greenlet __pyx_vtable_6gevent_9_greenlet_Greenlet; + +static PyObject *__pyx_tp_new_6gevent_9_greenlet_Greenlet(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_6gevent_9_greenlet_Greenlet *p; + PyObject *o = __pyx_ptype_6gevent_9_greenlet_greenlet->tp_new(t, a, k); + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_6gevent_9_greenlet_Greenlet *)o); + p->__pyx_vtab = __pyx_vtabptr_6gevent_9_greenlet_Greenlet; + p->value = Py_None; Py_INCREF(Py_None); + p->args = ((PyObject*)Py_None); Py_INCREF(Py_None); + p->kwargs = ((PyObject*)Py_None); Py_INCREF(Py_None); + p->spawning_greenlet = Py_None; Py_INCREF(Py_None); + p->spawn_tree_locals = ((PyObject*)Py_None); Py_INCREF(Py_None); + p->_spawning_stack_frames = ((PyObject*)Py_None); Py_INCREF(Py_None); + p->_links = ((PyObject*)Py_None); Py_INCREF(Py_None); + p->_exc_info = ((PyObject*)Py_None); Py_INCREF(Py_None); + p->_notifier = Py_None; Py_INCREF(Py_None); + p->_start_event = Py_None; Py_INCREF(Py_None); + p->_formatted_info = ((PyObject*)Py_None); Py_INCREF(Py_None); + p->_ident = Py_None; Py_INCREF(Py_None); + return o; +} + +static void __pyx_tp_dealloc_6gevent_9_greenlet_Greenlet(PyObject *o) { + struct __pyx_obj_6gevent_9_greenlet_Greenlet *p = (struct __pyx_obj_6gevent_9_greenlet_Greenlet *)o; + #if CYTHON_USE_TP_FINALIZE + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + PyObject_GC_UnTrack(o); + Py_CLEAR(p->value); + Py_CLEAR(p->args); + Py_CLEAR(p->kwargs); + Py_CLEAR(p->spawning_greenlet); + Py_CLEAR(p->spawn_tree_locals); + Py_CLEAR(p->_spawning_stack_frames); + Py_CLEAR(p->_links); + Py_CLEAR(p->_exc_info); + Py_CLEAR(p->_notifier); + Py_CLEAR(p->_start_event); + Py_CLEAR(p->_formatted_info); + Py_CLEAR(p->_ident); + #if CYTHON_USE_TYPE_SLOTS + if (PyType_IS_GC(Py_TYPE(o)->tp_base)) + #endif + PyObject_GC_Track(o); + if (likely(__pyx_ptype_6gevent_9_greenlet_greenlet)) __pyx_ptype_6gevent_9_greenlet_greenlet->tp_dealloc(o); else __Pyx_call_next_tp_dealloc(o, __pyx_tp_dealloc_6gevent_9_greenlet_Greenlet); +} + +static int __pyx_tp_traverse_6gevent_9_greenlet_Greenlet(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_6gevent_9_greenlet_Greenlet *p = (struct __pyx_obj_6gevent_9_greenlet_Greenlet *)o; + e = ((likely(__pyx_ptype_6gevent_9_greenlet_greenlet)) ? ((__pyx_ptype_6gevent_9_greenlet_greenlet->tp_traverse) ? __pyx_ptype_6gevent_9_greenlet_greenlet->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_6gevent_9_greenlet_Greenlet)); if (e) return e; + if (p->value) { + e = (*v)(p->value, a); if (e) return e; + } + if (p->args) { + e = (*v)(p->args, a); if (e) return e; + } + if (p->kwargs) { + e = (*v)(p->kwargs, a); if (e) return e; + } + if (p->spawning_greenlet) { + e = (*v)(p->spawning_greenlet, a); if (e) return e; + } + if (p->spawn_tree_locals) { + e = (*v)(p->spawn_tree_locals, a); if (e) return e; + } + if (p->_spawning_stack_frames) { + e = (*v)(p->_spawning_stack_frames, a); if (e) return e; + } + if (p->_links) { + e = (*v)(p->_links, a); if (e) return e; + } + if (p->_exc_info) { + e = (*v)(p->_exc_info, a); if (e) return e; + } + if (p->_notifier) { + e = (*v)(p->_notifier, a); if (e) return e; + } + if (p->_start_event) { + e = (*v)(p->_start_event, a); if (e) return e; + } + if (p->_ident) { + e = (*v)(p->_ident, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_6gevent_9_greenlet_Greenlet(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_6gevent_9_greenlet_Greenlet *p = (struct __pyx_obj_6gevent_9_greenlet_Greenlet *)o; + if (likely(__pyx_ptype_6gevent_9_greenlet_greenlet)) { if (__pyx_ptype_6gevent_9_greenlet_greenlet->tp_clear) __pyx_ptype_6gevent_9_greenlet_greenlet->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_6gevent_9_greenlet_Greenlet); + tmp = ((PyObject*)p->value); + p->value = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->args); + p->args = ((PyObject*)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->kwargs); + p->kwargs = ((PyObject*)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->spawning_greenlet); + p->spawning_greenlet = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->spawn_tree_locals); + p->spawn_tree_locals = ((PyObject*)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->_spawning_stack_frames); + p->_spawning_stack_frames = ((PyObject*)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->_links); + p->_links = ((PyObject*)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->_exc_info); + p->_exc_info = ((PyObject*)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->_notifier); + p->_notifier = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->_start_event); + p->_start_event = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->_ident); + p->_ident = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyObject *__pyx_getprop_6gevent_9_greenlet_8Greenlet_minimal_ident(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_9_greenlet_8Greenlet_13minimal_ident_1__get__(o); +} + +static PyObject *__pyx_getprop_6gevent_9_greenlet_8Greenlet_loop(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_9_greenlet_8Greenlet_4loop_1__get__(o); +} + +static PyObject *__pyx_getprop_6gevent_9_greenlet_8Greenlet_dead(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_9_greenlet_8Greenlet_4dead_1__get__(o); +} + +static PyObject *__pyx_getprop_6gevent_9_greenlet_8Greenlet_started(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_9_greenlet_8Greenlet_7started_1__get__(o); +} + +static PyObject *__pyx_getprop_6gevent_9_greenlet_8Greenlet_exception(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_9_greenlet_8Greenlet_9exception_1__get__(o); +} + +static PyObject *__pyx_getprop_6gevent_9_greenlet_8Greenlet_exc_info(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_9_greenlet_8Greenlet_8exc_info_1__get__(o); +} + +static PyObject *__pyx_getprop_6gevent_9_greenlet_8Greenlet_value(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_9_greenlet_8Greenlet_5value_1__get__(o); +} + +static PyObject *__pyx_getprop_6gevent_9_greenlet_8Greenlet_args(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_9_greenlet_8Greenlet_4args_1__get__(o); +} + +static PyObject *__pyx_getprop_6gevent_9_greenlet_8Greenlet_kwargs(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_9_greenlet_8Greenlet_6kwargs_1__get__(o); +} + +static PyObject *__pyx_getprop_6gevent_9_greenlet_8Greenlet_spawning_greenlet(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_9_greenlet_8Greenlet_17spawning_greenlet_1__get__(o); +} + +static PyObject *__pyx_getprop_6gevent_9_greenlet_8Greenlet_spawn_tree_locals(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_9_greenlet_8Greenlet_17spawn_tree_locals_1__get__(o); +} + +static int __pyx_setprop_6gevent_9_greenlet_8Greenlet_spawn_tree_locals(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6gevent_9_greenlet_8Greenlet_17spawn_tree_locals_3__set__(o, v); + } + else { + return __pyx_pw_6gevent_9_greenlet_8Greenlet_17spawn_tree_locals_5__del__(o); + } +} + +static PyObject *__pyx_getprop_6gevent_9_greenlet_8Greenlet__spawning_stack_frames(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_9_greenlet_8Greenlet_22_spawning_stack_frames_1__get__(o); +} + +static PyMethodDef __pyx_methods_6gevent_9_greenlet_Greenlet[] = { + {"spawning_stack", (PyCFunction)__pyx_pw_6gevent_9_greenlet_8Greenlet_3spawning_stack, METH_NOARGS, __pyx_doc_6gevent_9_greenlet_8Greenlet_2spawning_stack}, + {"name", (PyCFunction)__pyx_pw_6gevent_9_greenlet_8Greenlet_5name, METH_NOARGS, __pyx_doc_6gevent_9_greenlet_8Greenlet_4name}, + {"_raise_exception", (PyCFunction)__pyx_pw_6gevent_9_greenlet_8Greenlet_7_raise_exception, METH_NOARGS, __pyx_doc_6gevent_9_greenlet_8Greenlet_6_raise_exception}, + {"throw", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_9_greenlet_8Greenlet_19throw, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_9_greenlet_8Greenlet_18throw}, + {"start", (PyCFunction)__pyx_pw_6gevent_9_greenlet_8Greenlet_21start, METH_NOARGS, __pyx_doc_6gevent_9_greenlet_8Greenlet_20start}, + {"start_later", (PyCFunction)__pyx_pw_6gevent_9_greenlet_8Greenlet_23start_later, METH_O, __pyx_doc_6gevent_9_greenlet_8Greenlet_22start_later}, + {"add_spawn_callback", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_9_greenlet_8Greenlet_25add_spawn_callback, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_9_greenlet_8Greenlet_24add_spawn_callback}, + {"remove_spawn_callback", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_9_greenlet_8Greenlet_27remove_spawn_callback, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_9_greenlet_8Greenlet_26remove_spawn_callback}, + {"spawn", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_9_greenlet_8Greenlet_29spawn, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_9_greenlet_8Greenlet_28spawn}, + {"spawn_later", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_9_greenlet_8Greenlet_31spawn_later, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_9_greenlet_8Greenlet_30spawn_later}, + {"kill", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_9_greenlet_8Greenlet_33kill, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_9_greenlet_8Greenlet_32kill}, + {"get", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_9_greenlet_8Greenlet_35get, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_9_greenlet_8Greenlet_34get}, + {"run", (PyCFunction)__pyx_pw_6gevent_9_greenlet_8Greenlet_39run, METH_NOARGS, __pyx_doc_6gevent_9_greenlet_8Greenlet_38run}, + {"_run", (PyCFunction)__pyx_pw_6gevent_9_greenlet_8Greenlet_41_run, METH_NOARGS, __pyx_doc_6gevent_9_greenlet_8Greenlet_40_run}, + {"link", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_9_greenlet_8Greenlet_47link, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_9_greenlet_8Greenlet_46link}, + {"unlink", (PyCFunction)__pyx_pw_6gevent_9_greenlet_8Greenlet_49unlink, METH_O, __pyx_doc_6gevent_9_greenlet_8Greenlet_48unlink}, + {"unlink_all", (PyCFunction)__pyx_pw_6gevent_9_greenlet_8Greenlet_51unlink_all, METH_NOARGS, __pyx_doc_6gevent_9_greenlet_8Greenlet_50unlink_all}, + {"link_value", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_9_greenlet_8Greenlet_53link_value, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_9_greenlet_8Greenlet_52link_value}, + {"link_exception", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_9_greenlet_8Greenlet_55link_exception, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_9_greenlet_8Greenlet_54link_exception}, + {0, 0, 0, 0} +}; + +static struct PyGetSetDef __pyx_getsets_6gevent_9_greenlet_Greenlet[] = { + {(char *)"minimal_ident", __pyx_getprop_6gevent_9_greenlet_8Greenlet_minimal_ident, 0, (char *)"\n A small, unique integer that identifies this object.\n\n This is similar to :attr:`threading.Thread.ident` (and `id`)\n in that as long as this object is alive, no other greenlet *in\n this hub* will have the same id, but it makes a stronger\n guarantee that the assigned values will be small and\n sequential. Sometime after this object has died, the value\n will be available for reuse.\n\n To get ids that are unique across all hubs, combine this with\n the hub's ``minimal_ident``.\n\n .. versionadded:: 1.3a2\n ", 0}, + {(char *)"loop", __pyx_getprop_6gevent_9_greenlet_8Greenlet_loop, 0, (char *)0, 0}, + {(char *)"dead", __pyx_getprop_6gevent_9_greenlet_8Greenlet_dead, 0, (char *)"Boolean indicating that the greenlet is dead and will not run again.", 0}, + {(char *)"started", __pyx_getprop_6gevent_9_greenlet_8Greenlet_started, 0, (char *)0, 0}, + {(char *)"exception", __pyx_getprop_6gevent_9_greenlet_8Greenlet_exception, 0, (char *)"\n Holds the exception instance raised by the function if the\n greenlet has finished with an error. Otherwise ``None``.\n ", 0}, + {(char *)"exc_info", __pyx_getprop_6gevent_9_greenlet_8Greenlet_exc_info, 0, (char *)"\n Holds the exc_info three-tuple raised by the function if the\n greenlet finished with an error. Otherwise a false value.\n\n .. note:: This is a provisional API and may change.\n\n .. versionadded:: 1.1\n ", 0}, + {(char *)"value", __pyx_getprop_6gevent_9_greenlet_8Greenlet_value, 0, (char *)0, 0}, + {(char *)"args", __pyx_getprop_6gevent_9_greenlet_8Greenlet_args, 0, (char *)0, 0}, + {(char *)"kwargs", __pyx_getprop_6gevent_9_greenlet_8Greenlet_kwargs, 0, (char *)0, 0}, + {(char *)"spawning_greenlet", __pyx_getprop_6gevent_9_greenlet_8Greenlet_spawning_greenlet, 0, (char *)0, 0}, + {(char *)"spawn_tree_locals", __pyx_getprop_6gevent_9_greenlet_8Greenlet_spawn_tree_locals, __pyx_setprop_6gevent_9_greenlet_8Greenlet_spawn_tree_locals, (char *)"spawn_tree_locals: dict", 0}, + {(char *)"_spawning_stack_frames", __pyx_getprop_6gevent_9_greenlet_8Greenlet__spawning_stack_frames, 0, (char *)0, 0}, + {0, 0, 0, 0, 0} +}; + +static PyNumberMethods __pyx_tp_as_number_Greenlet = { + 0, /*nb_add*/ + 0, /*nb_subtract*/ + 0, /*nb_multiply*/ + #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) + 0, /*nb_divide*/ + #endif + 0, /*nb_remainder*/ + 0, /*nb_divmod*/ + 0, /*nb_power*/ + 0, /*nb_negative*/ + 0, /*nb_positive*/ + 0, /*nb_absolute*/ + __pyx_pw_6gevent_9_greenlet_8Greenlet_9__nonzero__, /*nb_nonzero*/ + 0, /*nb_invert*/ + 0, /*nb_lshift*/ + 0, /*nb_rshift*/ + 0, /*nb_and*/ + 0, /*nb_xor*/ + 0, /*nb_or*/ + #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) + 0, /*nb_coerce*/ + #endif + 0, /*nb_int*/ + #if PY_MAJOR_VERSION < 3 + 0, /*nb_long*/ + #else + 0, /*reserved*/ + #endif + 0, /*nb_float*/ + #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) + 0, /*nb_oct*/ + #endif + #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) + 0, /*nb_hex*/ + #endif + 0, /*nb_inplace_add*/ + 0, /*nb_inplace_subtract*/ + 0, /*nb_inplace_multiply*/ + #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) + 0, /*nb_inplace_divide*/ + #endif + 0, /*nb_inplace_remainder*/ + 0, /*nb_inplace_power*/ + 0, /*nb_inplace_lshift*/ + 0, /*nb_inplace_rshift*/ + 0, /*nb_inplace_and*/ + 0, /*nb_inplace_xor*/ + 0, /*nb_inplace_or*/ + 0, /*nb_floor_divide*/ + 0, /*nb_true_divide*/ + 0, /*nb_inplace_floor_divide*/ + 0, /*nb_inplace_true_divide*/ + 0, /*nb_index*/ + #if PY_VERSION_HEX >= 0x03050000 + 0, /*nb_matrix_multiply*/ + #endif + #if PY_VERSION_HEX >= 0x03050000 + 0, /*nb_inplace_matrix_multiply*/ + #endif +}; + +static PyTypeObject __pyx_type_6gevent_9_greenlet_Greenlet = { + PyVarObject_HEAD_INIT(0, 0) + "gevent._greenlet.Greenlet", /*tp_name*/ + sizeof(struct __pyx_obj_6gevent_9_greenlet_Greenlet), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6gevent_9_greenlet_Greenlet, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + __pyx_pw_6gevent_9_greenlet_8Greenlet_15__repr__, /*tp_repr*/ + &__pyx_tp_as_number_Greenlet, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + "Greenlet(run=None, *args, **kwargs)\n\n A light-weight cooperatively-scheduled execution unit.\n ", /*tp_doc*/ + __pyx_tp_traverse_6gevent_9_greenlet_Greenlet, /*tp_traverse*/ + __pyx_tp_clear_6gevent_9_greenlet_Greenlet, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6gevent_9_greenlet_Greenlet, /*tp_methods*/ + 0, /*tp_members*/ + __pyx_getsets_6gevent_9_greenlet_Greenlet, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_pw_6gevent_9_greenlet_8Greenlet_1__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6gevent_9_greenlet_Greenlet, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; +static struct __pyx_vtabstruct_6gevent_9_greenlet__dummy_event __pyx_vtable_6gevent_9_greenlet__dummy_event; + +static PyObject *__pyx_tp_new_6gevent_9_greenlet__dummy_event(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + struct __pyx_obj_6gevent_9_greenlet__dummy_event *p; + PyObject *o; + o = (*t->tp_alloc)(t, 0); + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_6gevent_9_greenlet__dummy_event *)o); + p->__pyx_vtab = __pyx_vtabptr_6gevent_9_greenlet__dummy_event; + return o; +} + +static void __pyx_tp_dealloc_6gevent_9_greenlet__dummy_event(PyObject *o) { + (*Py_TYPE(o)->tp_free)(o); +} + +static PyObject *__pyx_getprop_6gevent_9_greenlet_12_dummy_event_pending(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_9_greenlet_12_dummy_event_7pending_1__get__(o); +} + +static PyObject *__pyx_getprop_6gevent_9_greenlet_12_dummy_event_active(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_9_greenlet_12_dummy_event_6active_1__get__(o); +} + +static PyMethodDef __pyx_methods_6gevent_9_greenlet__dummy_event[] = { + {0, 0, 0, 0} +}; + +static struct PyGetSetDef __pyx_getsets_6gevent_9_greenlet__dummy_event[] = { + {(char *)"pending", __pyx_getprop_6gevent_9_greenlet_12_dummy_event_pending, 0, (char *)0, 0}, + {(char *)"active", __pyx_getprop_6gevent_9_greenlet_12_dummy_event_active, 0, (char *)0, 0}, + {0, 0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_6gevent_9_greenlet__dummy_event = { + PyVarObject_HEAD_INIT(0, 0) + "gevent._greenlet._dummy_event", /*tp_name*/ + sizeof(struct __pyx_obj_6gevent_9_greenlet__dummy_event), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6gevent_9_greenlet__dummy_event, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER, /*tp_flags*/ + "_dummy_event()", /*tp_doc*/ + 0, /*tp_traverse*/ + 0, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6gevent_9_greenlet__dummy_event, /*tp_methods*/ + 0, /*tp_members*/ + __pyx_getsets_6gevent_9_greenlet__dummy_event, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_pw_6gevent_9_greenlet_12_dummy_event_1__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6gevent_9_greenlet__dummy_event, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_object____list____object____object___to_py *__pyx_freelist___pyx_scope_struct____Pyx_CFunc_object____list____object____object___to_py[8]; +static int __pyx_freecount___pyx_scope_struct____Pyx_CFunc_object____list____object____object___to_py = 0; + +static PyObject *__pyx_tp_new___pyx_scope_struct____Pyx_CFunc_object____list____object____object___to_py(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + PyObject *o; + if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount___pyx_scope_struct____Pyx_CFunc_object____list____object____object___to_py > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_object____list____object____object___to_py)))) { + o = (PyObject*)__pyx_freelist___pyx_scope_struct____Pyx_CFunc_object____list____object____object___to_py[--__pyx_freecount___pyx_scope_struct____Pyx_CFunc_object____list____object____object___to_py]; + memset(o, 0, sizeof(struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_object____list____object____object___to_py)); + (void) PyObject_INIT(o, t); + } else { + o = (*t->tp_alloc)(t, 0); + if (unlikely(!o)) return 0; + } + return o; +} + +static void __pyx_tp_dealloc___pyx_scope_struct____Pyx_CFunc_object____list____object____object___to_py(PyObject *o) { + if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount___pyx_scope_struct____Pyx_CFunc_object____list____object____object___to_py < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_object____list____object____object___to_py)))) { + __pyx_freelist___pyx_scope_struct____Pyx_CFunc_object____list____object____object___to_py[__pyx_freecount___pyx_scope_struct____Pyx_CFunc_object____list____object____object___to_py++] = ((struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_object____list____object____object___to_py *)o); + } else { + (*Py_TYPE(o)->tp_free)(o); + } +} + +static PyTypeObject __pyx_scope_struct____Pyx_CFunc_object____list____object____object___to_py = { + PyVarObject_HEAD_INIT(0, 0) + "gevent._greenlet.__pyx_scope_struct____Pyx_CFunc_object____list____object____object___to_py", /*tp_name*/ + sizeof(struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_object____list____object____object___to_py), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc___pyx_scope_struct____Pyx_CFunc_object____list____object____object___to_py, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER, /*tp_flags*/ + 0, /*tp_doc*/ + 0, /*tp_traverse*/ + 0, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + 0, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new___pyx_scope_struct____Pyx_CFunc_object____list____object____object___to_py, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_object____list____object___to_py *__pyx_freelist___pyx_scope_struct____Pyx_CFunc_object____list____object___to_py[8]; +static int __pyx_freecount___pyx_scope_struct____Pyx_CFunc_object____list____object___to_py = 0; + +static PyObject *__pyx_tp_new___pyx_scope_struct____Pyx_CFunc_object____list____object___to_py(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + PyObject *o; + if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount___pyx_scope_struct____Pyx_CFunc_object____list____object___to_py > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_object____list____object___to_py)))) { + o = (PyObject*)__pyx_freelist___pyx_scope_struct____Pyx_CFunc_object____list____object___to_py[--__pyx_freecount___pyx_scope_struct____Pyx_CFunc_object____list____object___to_py]; + memset(o, 0, sizeof(struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_object____list____object___to_py)); + (void) PyObject_INIT(o, t); + } else { + o = (*t->tp_alloc)(t, 0); + if (unlikely(!o)) return 0; + } + return o; +} + +static void __pyx_tp_dealloc___pyx_scope_struct____Pyx_CFunc_object____list____object___to_py(PyObject *o) { + if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount___pyx_scope_struct____Pyx_CFunc_object____list____object___to_py < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_object____list____object___to_py)))) { + __pyx_freelist___pyx_scope_struct____Pyx_CFunc_object____list____object___to_py[__pyx_freecount___pyx_scope_struct____Pyx_CFunc_object____list____object___to_py++] = ((struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_object____list____object___to_py *)o); + } else { + (*Py_TYPE(o)->tp_free)(o); + } +} + +static PyTypeObject __pyx_scope_struct____Pyx_CFunc_object____list____object___to_py = { + PyVarObject_HEAD_INIT(0, 0) + "gevent._greenlet.__pyx_scope_struct____Pyx_CFunc_object____list____object___to_py", /*tp_name*/ + sizeof(struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_object____list____object___to_py), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc___pyx_scope_struct____Pyx_CFunc_object____list____object___to_py, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER, /*tp_flags*/ + 0, /*tp_doc*/ + 0, /*tp_traverse*/ + 0, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + 0, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new___pyx_scope_struct____Pyx_CFunc_object____list____object___to_py, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static PyMethodDef __pyx_methods[] = { + {0, 0, 0, 0} +}; + +#if PY_MAJOR_VERSION >= 3 +#if CYTHON_PEP489_MULTI_PHASE_INIT +static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ +static int __pyx_pymod_exec__greenlet(PyObject* module); /*proto*/ +static PyModuleDef_Slot __pyx_moduledef_slots[] = { + {Py_mod_create, (void*)__pyx_pymod_create}, + {Py_mod_exec, (void*)__pyx_pymod_exec__greenlet}, + {0, NULL} +}; +#endif + +static struct PyModuleDef __pyx_moduledef = { + PyModuleDef_HEAD_INIT, + "_greenlet", + 0, /* m_doc */ + #if CYTHON_PEP489_MULTI_PHASE_INIT + 0, /* m_size */ + #else + -1, /* m_size */ + #endif + __pyx_methods /* m_methods */, + #if CYTHON_PEP489_MULTI_PHASE_INIT + __pyx_moduledef_slots, /* m_slots */ + #else + NULL, /* m_reload */ + #endif + NULL, /* m_traverse */ + NULL, /* m_clear */ + NULL /* m_free */ +}; +#endif +#ifndef CYTHON_SMALL_CODE +#if defined(__clang__) + #define CYTHON_SMALL_CODE +#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) + #define CYTHON_SMALL_CODE __attribute__((cold)) +#else + #define CYTHON_SMALL_CODE +#endif +#endif + +static __Pyx_StringTabEntry __pyx_string_tab[] = { + {&__pyx_n_s_AssertionError, __pyx_k_AssertionError, sizeof(__pyx_k_AssertionError), 0, 0, 1, 1}, + {&__pyx_n_s_AttributeError, __pyx_k_AttributeError, sizeof(__pyx_k_AttributeError), 0, 0, 1, 1}, + {&__pyx_kp_s_Cannot_start_the_dummy_event, __pyx_k_Cannot_start_the_dummy_event, sizeof(__pyx_k_Cannot_start_the_dummy_event), 0, 0, 1, 0}, + {&__pyx_kp_s_Expected_callable_r, __pyx_k_Expected_callable_r, sizeof(__pyx_k_Expected_callable_r), 0, 0, 1, 0}, + {&__pyx_n_s_FailureSpawnedLink, __pyx_k_FailureSpawnedLink, sizeof(__pyx_k_FailureSpawnedLink), 0, 0, 1, 1}, + {&__pyx_n_s_Frame, __pyx_k_Frame, sizeof(__pyx_k_Frame), 0, 0, 1, 1}, + {&__pyx_n_s_GEVENT_CONFIG, __pyx_k_GEVENT_CONFIG, sizeof(__pyx_k_GEVENT_CONFIG), 0, 0, 1, 1}, + {&__pyx_n_s_Greenlet, __pyx_k_Greenlet, sizeof(__pyx_k_Greenlet), 0, 0, 1, 1}, + {&__pyx_n_s_GreenletExit, __pyx_k_GreenletExit, sizeof(__pyx_k_GreenletExit), 0, 0, 1, 1}, + {&__pyx_n_s_Greenlet__formatinfo, __pyx_k_Greenlet__formatinfo, sizeof(__pyx_k_Greenlet__formatinfo), 0, 0, 1, 1}, + {&__pyx_n_s_Greenlet__notify_links, __pyx_k_Greenlet__notify_links, sizeof(__pyx_k_Greenlet__notify_links), 0, 0, 1, 1}, + {&__pyx_n_s_Greenlet__raise_exception, __pyx_k_Greenlet__raise_exception, sizeof(__pyx_k_Greenlet__raise_exception), 0, 0, 1, 1}, + {&__pyx_n_s_Greenlet__run, __pyx_k_Greenlet__run, sizeof(__pyx_k_Greenlet__run), 0, 0, 1, 1}, + {&__pyx_n_s_Greenlet_add_spawn_callback, __pyx_k_Greenlet_add_spawn_callback, sizeof(__pyx_k_Greenlet_add_spawn_callback), 0, 0, 1, 1}, + {&__pyx_kp_s_Greenlet_d, __pyx_k_Greenlet_d, sizeof(__pyx_k_Greenlet_d), 0, 0, 1, 0}, + {&__pyx_n_s_Greenlet_get, __pyx_k_Greenlet_get, sizeof(__pyx_k_Greenlet_get), 0, 0, 1, 1}, + {&__pyx_n_s_Greenlet_has_links, __pyx_k_Greenlet_has_links, sizeof(__pyx_k_Greenlet_has_links), 0, 0, 1, 1}, + {&__pyx_n_s_Greenlet_join, __pyx_k_Greenlet_join, sizeof(__pyx_k_Greenlet_join), 0, 0, 1, 1}, + {&__pyx_n_s_Greenlet_kill, __pyx_k_Greenlet_kill, sizeof(__pyx_k_Greenlet_kill), 0, 0, 1, 1}, + {&__pyx_n_s_Greenlet_link, __pyx_k_Greenlet_link, sizeof(__pyx_k_Greenlet_link), 0, 0, 1, 1}, + {&__pyx_n_s_Greenlet_link_exception, __pyx_k_Greenlet_link_exception, sizeof(__pyx_k_Greenlet_link_exception), 0, 0, 1, 1}, + {&__pyx_n_s_Greenlet_link_value, __pyx_k_Greenlet_link_value, sizeof(__pyx_k_Greenlet_link_value), 0, 0, 1, 1}, + {&__pyx_n_s_Greenlet_name, __pyx_k_Greenlet_name, sizeof(__pyx_k_Greenlet_name), 0, 0, 1, 1}, + {&__pyx_n_s_Greenlet_rawlink, __pyx_k_Greenlet_rawlink, sizeof(__pyx_k_Greenlet_rawlink), 0, 0, 1, 1}, + {&__pyx_n_s_Greenlet_ready, __pyx_k_Greenlet_ready, sizeof(__pyx_k_Greenlet_ready), 0, 0, 1, 1}, + {&__pyx_n_s_Greenlet_remove_spawn_callback, __pyx_k_Greenlet_remove_spawn_callback, sizeof(__pyx_k_Greenlet_remove_spawn_callback), 0, 0, 1, 1}, + {&__pyx_n_s_Greenlet_run, __pyx_k_Greenlet_run, sizeof(__pyx_k_Greenlet_run), 0, 0, 1, 1}, + {&__pyx_n_s_Greenlet_spawn, __pyx_k_Greenlet_spawn, sizeof(__pyx_k_Greenlet_spawn), 0, 0, 1, 1}, + {&__pyx_n_s_Greenlet_spawn_later, __pyx_k_Greenlet_spawn_later, sizeof(__pyx_k_Greenlet_spawn_later), 0, 0, 1, 1}, + {&__pyx_n_s_Greenlet_spawning_stack, __pyx_k_Greenlet_spawning_stack, sizeof(__pyx_k_Greenlet_spawning_stack), 0, 0, 1, 1}, + {&__pyx_n_s_Greenlet_start, __pyx_k_Greenlet_start, sizeof(__pyx_k_Greenlet_start), 0, 0, 1, 1}, + {&__pyx_n_s_Greenlet_start_later, __pyx_k_Greenlet_start_later, sizeof(__pyx_k_Greenlet_start_later), 0, 0, 1, 1}, + {&__pyx_n_s_Greenlet_successful, __pyx_k_Greenlet_successful, sizeof(__pyx_k_Greenlet_successful), 0, 0, 1, 1}, + {&__pyx_n_s_Greenlet_throw, __pyx_k_Greenlet_throw, sizeof(__pyx_k_Greenlet_throw), 0, 0, 1, 1}, + {&__pyx_n_s_Greenlet_unlink, __pyx_k_Greenlet_unlink, sizeof(__pyx_k_Greenlet_unlink), 0, 0, 1, 1}, + {&__pyx_n_s_Greenlet_unlink_all, __pyx_k_Greenlet_unlink_all, sizeof(__pyx_k_Greenlet_unlink_all), 0, 0, 1, 1}, + {&__pyx_n_s_InvalidSwitchError, __pyx_k_InvalidSwitchError, sizeof(__pyx_k_InvalidSwitchError), 0, 0, 1, 1}, + {&__pyx_kp_s_Invalid_switch_into_Greenlet_get, __pyx_k_Invalid_switch_into_Greenlet_get, sizeof(__pyx_k_Invalid_switch_into_Greenlet_get), 0, 0, 1, 0}, + {&__pyx_kp_s_Invalid_switch_into_Greenlet_joi, __pyx_k_Invalid_switch_into_Greenlet_joi, sizeof(__pyx_k_Invalid_switch_into_Greenlet_joi), 0, 0, 1, 0}, + {&__pyx_n_s_Lazy, __pyx_k_Lazy, sizeof(__pyx_k_Lazy), 0, 0, 1, 1}, + {&__pyx_n_s_NameError, __pyx_k_NameError, sizeof(__pyx_k_NameError), 0, 0, 1, 1}, + {&__pyx_n_s_PYPY, __pyx_k_PYPY, sizeof(__pyx_k_PYPY), 0, 0, 1, 1}, + {&__pyx_n_s_PYPY_2, __pyx_k_PYPY_2, sizeof(__pyx_k_PYPY_2), 0, 0, 1, 1}, + {&__pyx_n_s_Pyx_CFunc_object____list____ob, __pyx_k_Pyx_CFunc_object____list____ob, sizeof(__pyx_k_Pyx_CFunc_object____list____ob), 0, 0, 1, 1}, + {&__pyx_n_s_Pyx_CFunc_object____list____ob_2, __pyx_k_Pyx_CFunc_object____list____ob_2, sizeof(__pyx_k_Pyx_CFunc_object____list____ob_2), 0, 0, 1, 1}, + {&__pyx_n_s_SpawnedLink, __pyx_k_SpawnedLink, sizeof(__pyx_k_SpawnedLink), 0, 0, 1, 1}, + {&__pyx_n_s_SuccessSpawnedLink, __pyx_k_SuccessSpawnedLink, sizeof(__pyx_k_SuccessSpawnedLink), 0, 0, 1, 1}, + {&__pyx_kp_s_The_run_argument_or_self__run_mu, __pyx_k_The_run_argument_or_self__run_mu, sizeof(__pyx_k_The_run_argument_or_self__run_mu), 0, 0, 1, 0}, + {&__pyx_n_s_Timeout, __pyx_k_Timeout, sizeof(__pyx_k_Timeout), 0, 0, 1, 1}, + {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1}, + {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1}, + {&__pyx_n_s_Waiter, __pyx_k_Waiter, sizeof(__pyx_k_Waiter), 0, 0, 1, 1}, + {&__pyx_kp_s__2, __pyx_k__2, sizeof(__pyx_k__2), 0, 0, 1, 0}, + {&__pyx_kp_s__3, __pyx_k__3, sizeof(__pyx_k__3), 0, 0, 1, 0}, + {&__pyx_kp_s__4, __pyx_k__4, sizeof(__pyx_k__4), 0, 0, 1, 0}, + {&__pyx_kp_s__5, __pyx_k__5, sizeof(__pyx_k__5), 0, 0, 1, 0}, + {&__pyx_kp_s__6, __pyx_k__6, sizeof(__pyx_k__6), 0, 0, 1, 0}, + {&__pyx_kp_s__7, __pyx_k__7, sizeof(__pyx_k__7), 0, 0, 1, 0}, + {&__pyx_kp_s__8, __pyx_k__8, sizeof(__pyx_k__8), 0, 0, 1, 0}, + {&__pyx_n_s_active, __pyx_k_active, sizeof(__pyx_k_active), 0, 0, 1, 1}, + {&__pyx_n_s_add_spawn_callback, __pyx_k_add_spawn_callback, sizeof(__pyx_k_add_spawn_callback), 0, 0, 1, 1}, + {&__pyx_n_s_alive, __pyx_k_alive, sizeof(__pyx_k_alive), 0, 0, 1, 1}, + {&__pyx_n_s_all, __pyx_k_all, sizeof(__pyx_k_all), 0, 0, 1, 1}, + {&__pyx_n_s_args, __pyx_k_args, sizeof(__pyx_k_args), 0, 0, 1, 1}, + {&__pyx_n_s_block, __pyx_k_block, sizeof(__pyx_k_block), 0, 0, 1, 1}, + {&__pyx_n_s_bool, __pyx_k_bool, sizeof(__pyx_k_bool), 0, 0, 1, 1}, + {&__pyx_n_s_call, __pyx_k_call, sizeof(__pyx_k_call), 0, 0, 1, 1}, + {&__pyx_n_s_callback, __pyx_k_callback, sizeof(__pyx_k_callback), 0, 0, 1, 1}, + {&__pyx_n_s_cancel, __pyx_k_cancel, sizeof(__pyx_k_cancel), 0, 0, 1, 1}, + {&__pyx_n_s_cancelled_start_event, __pyx_k_cancelled_start_event, sizeof(__pyx_k_cancelled_start_event), 0, 0, 1, 1}, + {&__pyx_n_s_cb, __pyx_k_cb, sizeof(__pyx_k_cb), 0, 0, 1, 1}, + {&__pyx_n_s_cfunc_to_py, __pyx_k_cfunc_to_py, sizeof(__pyx_k_cfunc_to_py), 0, 0, 1, 1}, + {&__pyx_n_s_class, __pyx_k_class, sizeof(__pyx_k_class), 0, 0, 1, 1}, + {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, + {&__pyx_n_s_close, __pyx_k_close, sizeof(__pyx_k_close), 0, 0, 1, 1}, + {&__pyx_n_s_cls, __pyx_k_cls, sizeof(__pyx_k_cls), 0, 0, 1, 1}, + {&__pyx_n_s_config, __pyx_k_config, sizeof(__pyx_k_config), 0, 0, 1, 1}, + {&__pyx_n_s_continuation, __pyx_k_continuation, sizeof(__pyx_k_continuation), 0, 0, 1, 1}, + {&__pyx_n_s_continulet, __pyx_k_continulet, sizeof(__pyx_k_continulet), 0, 0, 1, 1}, + {&__pyx_n_s_continulet_2, __pyx_k_continulet_2, sizeof(__pyx_k_continulet_2), 0, 0, 1, 1}, + {&__pyx_n_s_count, __pyx_k_count, sizeof(__pyx_k_count), 0, 0, 1, 1}, + {&__pyx_n_s_dead, __pyx_k_dead, sizeof(__pyx_k_dead), 0, 0, 1, 1}, + {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1}, + {&__pyx_n_s_dummy_event, __pyx_k_dummy_event, sizeof(__pyx_k_dummy_event), 0, 0, 1, 1}, + {&__pyx_n_s_dummy_event_close, __pyx_k_dummy_event_close, sizeof(__pyx_k_dummy_event_close), 0, 0, 1, 1}, + {&__pyx_n_s_dummy_event_start, __pyx_k_dummy_event_start, sizeof(__pyx_k_dummy_event_start), 0, 0, 1, 1}, + {&__pyx_n_s_dummy_event_stop, __pyx_k_dummy_event_stop, sizeof(__pyx_k_dummy_event_stop), 0, 0, 1, 1}, + {&__pyx_n_s_dump_traceback, __pyx_k_dump_traceback, sizeof(__pyx_k_dump_traceback), 0, 0, 1, 1}, + {&__pyx_n_s_exc_info, __pyx_k_exc_info, sizeof(__pyx_k_exc_info), 0, 0, 1, 1}, + {&__pyx_n_s_exception, __pyx_k_exception, sizeof(__pyx_k_exception), 0, 0, 1, 1}, + {&__pyx_n_s_f_back, __pyx_k_f_back, sizeof(__pyx_k_f_back), 0, 0, 1, 1}, + {&__pyx_n_s_f_code, __pyx_k_f_code, sizeof(__pyx_k_f_code), 0, 0, 1, 1}, + {&__pyx_n_s_f_lineno, __pyx_k_f_lineno, sizeof(__pyx_k_f_lineno), 0, 0, 1, 1}, + {&__pyx_n_s_formatinfo, __pyx_k_formatinfo, sizeof(__pyx_k_formatinfo), 0, 0, 1, 1}, + {&__pyx_n_s_g, __pyx_k_g, sizeof(__pyx_k_g), 0, 0, 1, 1}, + {&__pyx_n_s_get, __pyx_k_get, sizeof(__pyx_k_get), 0, 0, 1, 1}, + {&__pyx_n_s_get_2, __pyx_k_get_2, sizeof(__pyx_k_get_2), 0, 0, 1, 1}, + {&__pyx_n_s_get_hub_class, __pyx_k_get_hub_class, sizeof(__pyx_k_get_hub_class), 0, 0, 1, 1}, + {&__pyx_n_s_get_hub_noargs, __pyx_k_get_hub_noargs, sizeof(__pyx_k_get_hub_noargs), 0, 0, 1, 1}, + {&__pyx_n_s_getcurrent, __pyx_k_getcurrent, sizeof(__pyx_k_getcurrent), 0, 0, 1, 1}, + {&__pyx_n_s_getframe, __pyx_k_getframe, sizeof(__pyx_k_getframe), 0, 0, 1, 1}, + {&__pyx_n_s_gevent, __pyx_k_gevent, sizeof(__pyx_k_gevent), 0, 0, 1, 1}, + {&__pyx_n_s_gevent__compat, __pyx_k_gevent__compat, sizeof(__pyx_k_gevent__compat), 0, 0, 1, 1}, + {&__pyx_n_s_gevent__config, __pyx_k_gevent__config, sizeof(__pyx_k_gevent__config), 0, 0, 1, 1}, + {&__pyx_n_s_gevent__greenlet, __pyx_k_gevent__greenlet, sizeof(__pyx_k_gevent__greenlet), 0, 0, 1, 1}, + {&__pyx_n_s_gevent__hub_local, __pyx_k_gevent__hub_local, sizeof(__pyx_k_gevent__hub_local), 0, 0, 1, 1}, + {&__pyx_n_s_gevent__hub_primitives, __pyx_k_gevent__hub_primitives, sizeof(__pyx_k_gevent__hub_primitives), 0, 0, 1, 1}, + {&__pyx_n_s_gevent__tblib, __pyx_k_gevent__tblib, sizeof(__pyx_k_gevent__tblib), 0, 0, 1, 1}, + {&__pyx_n_s_gevent__util, __pyx_k_gevent__util, sizeof(__pyx_k_gevent__util), 0, 0, 1, 1}, + {&__pyx_n_s_gevent_exceptions, __pyx_k_gevent_exceptions, sizeof(__pyx_k_gevent_exceptions), 0, 0, 1, 1}, + {&__pyx_n_s_gevent_timeout, __pyx_k_gevent_timeout, sizeof(__pyx_k_gevent_timeout), 0, 0, 1, 1}, + {&__pyx_n_s_glet, __pyx_k_glet, sizeof(__pyx_k_glet), 0, 0, 1, 1}, + {&__pyx_n_s_greenlet, __pyx_k_greenlet, sizeof(__pyx_k_greenlet), 0, 0, 1, 1}, + {&__pyx_n_s_greenlet__init, __pyx_k_greenlet__init, sizeof(__pyx_k_greenlet__init), 0, 0, 1, 1}, + {&__pyx_n_s_greenlet_imported, __pyx_k_greenlet_imported, sizeof(__pyx_k_greenlet_imported), 0, 0, 1, 1}, + {&__pyx_n_s_greenlet_init, __pyx_k_greenlet_init, sizeof(__pyx_k_greenlet_init), 0, 0, 1, 1}, + {&__pyx_n_s_greenlets, __pyx_k_greenlets, sizeof(__pyx_k_greenlets), 0, 0, 1, 1}, + {&__pyx_n_s_handle_error, __pyx_k_handle_error, sizeof(__pyx_k_handle_error), 0, 0, 1, 1}, + {&__pyx_n_s_has_links, __pyx_k_has_links, sizeof(__pyx_k_has_links), 0, 0, 1, 1}, + {&__pyx_n_s_hex, __pyx_k_hex, sizeof(__pyx_k_hex), 0, 0, 1, 1}, + {&__pyx_n_s_id, __pyx_k_id, sizeof(__pyx_k_id), 0, 0, 1, 1}, + {&__pyx_n_s_ident_registry, __pyx_k_ident_registry, sizeof(__pyx_k_ident_registry), 0, 0, 1, 1}, + {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, + {&__pyx_n_s_import_c_accel, __pyx_k_import_c_accel, sizeof(__pyx_k_import_c_accel), 0, 0, 1, 1}, + {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1}, + {&__pyx_n_s_items, __pyx_k_items, sizeof(__pyx_k_items), 0, 0, 1, 1}, + {&__pyx_n_s_iwait, __pyx_k_iwait, sizeof(__pyx_k_iwait), 0, 0, 1, 1}, + {&__pyx_n_s_iwait_on_objects, __pyx_k_iwait_on_objects, sizeof(__pyx_k_iwait_on_objects), 0, 0, 1, 1}, + {&__pyx_n_s_join, __pyx_k_join, sizeof(__pyx_k_join), 0, 0, 1, 1}, + {&__pyx_n_s_joinall, __pyx_k_joinall, sizeof(__pyx_k_joinall), 0, 0, 1, 1}, + {&__pyx_n_s_kill, __pyx_k_kill, sizeof(__pyx_k_kill), 0, 0, 1, 1}, + {&__pyx_n_s_kill_2, __pyx_k_kill_2, sizeof(__pyx_k_kill_2), 0, 0, 1, 1}, + {&__pyx_n_s_killall, __pyx_k_killall, sizeof(__pyx_k_killall), 0, 0, 1, 1}, + {&__pyx_n_s_kwargs, __pyx_k_kwargs, sizeof(__pyx_k_kwargs), 0, 0, 1, 1}, + {&__pyx_n_s_lambda, __pyx_k_lambda, sizeof(__pyx_k_lambda), 0, 0, 1, 1}, + {&__pyx_n_s_link, __pyx_k_link, sizeof(__pyx_k_link), 0, 0, 1, 1}, + {&__pyx_n_s_link_exception, __pyx_k_link_exception, sizeof(__pyx_k_link_exception), 0, 0, 1, 1}, + {&__pyx_n_s_link_value, __pyx_k_link_value, sizeof(__pyx_k_link_value), 0, 0, 1, 1}, + {&__pyx_n_s_load_traceback, __pyx_k_load_traceback, sizeof(__pyx_k_load_traceback), 0, 0, 1, 1}, + {&__pyx_n_s_loop, __pyx_k_loop, sizeof(__pyx_k_loop), 0, 0, 1, 1}, + {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, + {&__pyx_n_s_minimal_ident, __pyx_k_minimal_ident, sizeof(__pyx_k_minimal_ident), 0, 0, 1, 1}, + {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, + {&__pyx_n_s_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 0, 1, 1}, + {&__pyx_n_s_nonzero, __pyx_k_nonzero, sizeof(__pyx_k_nonzero), 0, 0, 1, 1}, + {&__pyx_n_s_notify_links, __pyx_k_notify_links, sizeof(__pyx_k_notify_links), 0, 0, 1, 1}, + {&__pyx_n_s_parent, __pyx_k_parent, sizeof(__pyx_k_parent), 0, 0, 1, 1}, + {&__pyx_n_s_pending, __pyx_k_pending, sizeof(__pyx_k_pending), 0, 0, 1, 1}, + {&__pyx_n_s_pop, __pyx_k_pop, sizeof(__pyx_k_pop), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_capi, __pyx_k_pyx_capi, sizeof(__pyx_k_pyx_capi), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1}, + {&__pyx_n_s_raise_error, __pyx_k_raise_error, sizeof(__pyx_k_raise_error), 0, 0, 1, 1}, + {&__pyx_n_s_raise_exception, __pyx_k_raise_exception, sizeof(__pyx_k_raise_exception), 0, 0, 1, 1}, + {&__pyx_n_s_rawlink, __pyx_k_rawlink, sizeof(__pyx_k_rawlink), 0, 0, 1, 1}, + {&__pyx_n_s_readproperty, __pyx_k_readproperty, sizeof(__pyx_k_readproperty), 0, 0, 1, 1}, + {&__pyx_n_s_ready, __pyx_k_ready, sizeof(__pyx_k_ready), 0, 0, 1, 1}, + {&__pyx_n_s_ref, __pyx_k_ref, sizeof(__pyx_k_ref), 0, 0, 1, 1}, + {&__pyx_n_s_remove, __pyx_k_remove, sizeof(__pyx_k_remove), 0, 0, 1, 1}, + {&__pyx_n_s_remove_spawn_callback, __pyx_k_remove_spawn_callback, sizeof(__pyx_k_remove_spawn_callback), 0, 0, 1, 1}, + {&__pyx_n_s_reraise, __pyx_k_reraise, sizeof(__pyx_k_reraise), 0, 0, 1, 1}, + {&__pyx_n_s_result, __pyx_k_result, sizeof(__pyx_k_result), 0, 0, 1, 1}, + {&__pyx_n_s_reversed, __pyx_k_reversed, sizeof(__pyx_k_reversed), 0, 0, 1, 1}, + {&__pyx_n_s_run, __pyx_k_run, sizeof(__pyx_k_run), 0, 0, 1, 1}, + {&__pyx_n_s_run_2, __pyx_k_run_2, sizeof(__pyx_k_run_2), 0, 0, 1, 1}, + {&__pyx_n_s_run_callback, __pyx_k_run_callback, sizeof(__pyx_k_run_callback), 0, 0, 1, 1}, + {&__pyx_kp_s_s, __pyx_k_s, sizeof(__pyx_k_s), 0, 0, 1, 0}, + {&__pyx_kp_s_s_s, __pyx_k_s_s, sizeof(__pyx_k_s_s), 0, 0, 1, 0}, + {&__pyx_kp_s_s_sat_s, __pyx_k_s_sat_s, sizeof(__pyx_k_s_sat_s), 0, 0, 1, 0}, + {&__pyx_n_s_seconds, __pyx_k_seconds, sizeof(__pyx_k_seconds), 0, 0, 1, 1}, + {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1}, + {&__pyx_n_s_self_2, __pyx_k_self_2, sizeof(__pyx_k_self_2), 0, 0, 1, 1}, + {&__pyx_n_s_slots, __pyx_k_slots, sizeof(__pyx_k_slots), 0, 0, 1, 1}, + {&__pyx_n_s_source, __pyx_k_source, sizeof(__pyx_k_source), 0, 0, 1, 1}, + {&__pyx_n_s_spawn, __pyx_k_spawn, sizeof(__pyx_k_spawn), 0, 0, 1, 1}, + {&__pyx_n_s_spawn_callbacks, __pyx_k_spawn_callbacks, sizeof(__pyx_k_spawn_callbacks), 0, 0, 1, 1}, + {&__pyx_n_s_spawn_later, __pyx_k_spawn_later, sizeof(__pyx_k_spawn_later), 0, 0, 1, 1}, + {&__pyx_n_s_spawn_tree_locals, __pyx_k_spawn_tree_locals, sizeof(__pyx_k_spawn_tree_locals), 0, 0, 1, 1}, + {&__pyx_n_s_spawning_stack, __pyx_k_spawning_stack, sizeof(__pyx_k_spawning_stack), 0, 0, 1, 1}, + {&__pyx_n_s_spawning_stack_frames, __pyx_k_spawning_stack_frames, sizeof(__pyx_k_spawning_stack_frames), 0, 0, 1, 1}, + {&__pyx_n_s_spawning_stack_limit, __pyx_k_spawning_stack_limit, sizeof(__pyx_k_spawning_stack_limit), 0, 0, 1, 1}, + {&__pyx_kp_s_src_gevent_greenlet_py, __pyx_k_src_gevent_greenlet_py, sizeof(__pyx_k_src_gevent_greenlet_py), 0, 0, 1, 0}, + {&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1}, + {&__pyx_n_s_start_completed_event, __pyx_k_start_completed_event, sizeof(__pyx_k_start_completed_event), 0, 0, 1, 1}, + {&__pyx_n_s_start_later, __pyx_k_start_later, sizeof(__pyx_k_start_later), 0, 0, 1, 1}, + {&__pyx_n_s_start_new_or_dummy, __pyx_k_start_new_or_dummy, sizeof(__pyx_k_start_new_or_dummy), 0, 0, 1, 1}, + {&__pyx_n_s_staticmethod, __pyx_k_staticmethod, sizeof(__pyx_k_staticmethod), 0, 0, 1, 1}, + {&__pyx_n_s_stop, __pyx_k_stop, sizeof(__pyx_k_stop), 0, 0, 1, 1}, + {&__pyx_kp_s_stringsource, __pyx_k_stringsource, sizeof(__pyx_k_stringsource), 0, 0, 1, 0}, + {&__pyx_n_s_successful, __pyx_k_successful, sizeof(__pyx_k_successful), 0, 0, 1, 1}, + {&__pyx_n_s_switch, __pyx_k_switch, sizeof(__pyx_k_switch), 0, 0, 1, 1}, + {&__pyx_n_s_sys, __pyx_k_sys, sizeof(__pyx_k_sys), 0, 0, 1, 1}, + {&__pyx_n_s_sys_exc_info, __pyx_k_sys_exc_info, sizeof(__pyx_k_sys_exc_info), 0, 0, 1, 1}, + {&__pyx_n_s_sys_getframe, __pyx_k_sys_getframe, sizeof(__pyx_k_sys_getframe), 0, 0, 1, 1}, + {&__pyx_n_s_t, __pyx_k_t, sizeof(__pyx_k_t), 0, 0, 1, 1}, + {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, + {&__pyx_n_s_threadlocal, __pyx_k_threadlocal, sizeof(__pyx_k_threadlocal), 0, 0, 1, 1}, + {&__pyx_n_s_throw, __pyx_k_throw, sizeof(__pyx_k_throw), 0, 0, 1, 1}, + {&__pyx_n_s_timeout, __pyx_k_timeout, sizeof(__pyx_k_timeout), 0, 0, 1, 1}, + {&__pyx_n_s_timer, __pyx_k_timer, sizeof(__pyx_k_timer), 0, 0, 1, 1}, + {&__pyx_n_s_track_greenlet_tree, __pyx_k_track_greenlet_tree, sizeof(__pyx_k_track_greenlet_tree), 0, 0, 1, 1}, + {&__pyx_n_s_unlink, __pyx_k_unlink, sizeof(__pyx_k_unlink), 0, 0, 1, 1}, + {&__pyx_n_s_unlink_all, __pyx_k_unlink_all, sizeof(__pyx_k_unlink_all), 0, 0, 1, 1}, + {&__pyx_n_s_wait, __pyx_k_wait, sizeof(__pyx_k_wait), 0, 0, 1, 1}, + {&__pyx_n_s_wait_on_objects, __pyx_k_wait_on_objects, sizeof(__pyx_k_wait_on_objects), 0, 0, 1, 1}, + {&__pyx_n_s_waiter, __pyx_k_waiter, sizeof(__pyx_k_waiter), 0, 0, 1, 1}, + {&__pyx_n_s_waiter_2, __pyx_k_waiter_2, sizeof(__pyx_k_waiter_2), 0, 0, 1, 1}, + {&__pyx_n_s_weakref, __pyx_k_weakref, sizeof(__pyx_k_weakref), 0, 0, 1, 1}, + {&__pyx_n_s_wrap, __pyx_k_wrap, sizeof(__pyx_k_wrap), 0, 0, 1, 1}, + {&__pyx_n_s_wref, __pyx_k_wref, sizeof(__pyx_k_wref), 0, 0, 1, 1}, + {0, 0, 0, 0, 0, 0, 0} +}; +static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { + __pyx_builtin___import__ = __Pyx_GetBuiltinName(__pyx_n_s_import); if (!__pyx_builtin___import__) __PYX_ERR(0, 45, __pyx_L1_error) + __pyx_builtin_NameError = __Pyx_GetBuiltinName(__pyx_n_s_NameError); if (!__pyx_builtin_NameError) __PYX_ERR(0, 328, __pyx_L1_error) + __pyx_builtin_staticmethod = __Pyx_GetBuiltinName(__pyx_n_s_staticmethod); if (!__pyx_builtin_staticmethod) __PYX_ERR(0, 538, __pyx_L1_error) + __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(0, 65, __pyx_L1_error) + __pyx_builtin_reversed = __Pyx_GetBuiltinName(__pyx_n_s_reversed); if (!__pyx_builtin_reversed) __PYX_ERR(0, 127, __pyx_L1_error) + __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 135, __pyx_L1_error) + __pyx_builtin_AttributeError = __Pyx_GetBuiltinName(__pyx_n_s_AttributeError); if (!__pyx_builtin_AttributeError) __PYX_ERR(0, 251, __pyx_L1_error) + __pyx_builtin_hex = __Pyx_GetBuiltinName(__pyx_n_s_hex); if (!__pyx_builtin_hex) __PYX_ERR(0, 441, __pyx_L1_error) + __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(0, 441, __pyx_L1_error) + __pyx_builtin_AssertionError = __Pyx_GetBuiltinName(__pyx_n_s_AssertionError); if (!__pyx_builtin_AssertionError) __PYX_ERR(0, 880, __pyx_L1_error) + return 0; + __pyx_L1_error:; + return -1; +} + +static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); + + /* "src/gevent/greenlet.py":222 + * # itself has never been documented or supported. + * if not callable(self._run): + * raise TypeError("The run argument or self._run must be callable") # <<<<<<<<<<<<<< + * + * self.args = args + */ + __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_The_run_argument_or_self__run_mu); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 222, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple_); + __Pyx_GIVEREF(__pyx_tuple_); + + /* "src/gevent/greenlet.py":610 + * """ + * if cls is Greenlet and not args and 'run' not in kwargs: + * raise TypeError("") # <<<<<<<<<<<<<< + * g = cls(*args, **kwargs) + * g.start_later(seconds) + */ + __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_s__5); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 610, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__9); + __Pyx_GIVEREF(__pyx_tuple__9); + + /* "src/gevent/greenlet.py":740 + * + * def _report_result(self, result): + * self._exc_info = (None, None, None) # <<<<<<<<<<<<<< + * self.value = result + * if self._links and not self._notifier: + */ + __pyx_tuple__11 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 740, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__11); + __Pyx_GIVEREF(__pyx_tuple__11); + + /* "src/gevent/greenlet.py":772 + * self._report_result(result) + * finally: + * self.__dict__.pop('_run', None) # <<<<<<<<<<<<<< + * self.args = () + * self.kwargs.clear() + */ + __pyx_tuple__12 = PyTuple_Pack(2, __pyx_n_s_run_2, Py_None); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 772, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__12); + __Pyx_GIVEREF(__pyx_tuple__12); + + /* "src/gevent/greenlet.py":880 + * + * def start(self, cb): # pylint:disable=unused-argument + * raise AssertionError("Cannot start the dummy event") # <<<<<<<<<<<<<< + * + * def close(self): + */ + __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s_Cannot_start_the_dummy_event); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(0, 880, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__16); + __Pyx_GIVEREF(__pyx_tuple__16); + + /* "cfunc.to_py":65 + * @cname("__Pyx_CFunc_object____list____object____object___to_py") + * cdef object __Pyx_CFunc_object____list____object____object___to_py(object (*f)(list, object, object) ): + * def wrap(list greenlets, object exception, object waiter): # <<<<<<<<<<<<<< + * """wrap(greenlets: list, exception, waiter)""" + * return f(greenlets, exception, waiter) + */ + __pyx_tuple__17 = PyTuple_Pack(3, __pyx_n_s_greenlets, __pyx_n_s_exception, __pyx_n_s_waiter); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(4, 65, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__17); + __Pyx_GIVEREF(__pyx_tuple__17); + __pyx_codeobj__18 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__17, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_wrap, 65, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__18)) __PYX_ERR(4, 65, __pyx_L1_error) + __pyx_tuple__19 = PyTuple_Pack(2, __pyx_n_s_greenlets, __pyx_n_s_exception); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(4, 65, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__19); + __Pyx_GIVEREF(__pyx_tuple__19); + __pyx_codeobj__20 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__19, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_wrap, 65, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__20)) __PYX_ERR(4, 65, __pyx_L1_error) + + /* "src/gevent/greenlet.py":45 + * # is assignment) without generating a 'lvalue is not valid target' + * # error. + * locals()['getcurrent'] = __import__('greenlet').getcurrent # <<<<<<<<<<<<<< + * locals()['greenlet_init'] = lambda: None + * locals()['Waiter'] = _waiter.Waiter + */ + __pyx_tuple__21 = PyTuple_Pack(1, __pyx_n_s_greenlet); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(0, 45, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__21); + __Pyx_GIVEREF(__pyx_tuple__21); + + /* "src/gevent/greenlet.py":114 + * class _Frame(object): + * + * __slots__ = ('f_code', 'f_lineno', 'f_back') # <<<<<<<<<<<<<< + * + * def __init__(self, f_code, f_lineno, f_back): + */ + __pyx_tuple__22 = PyTuple_Pack(3, __pyx_n_s_f_code, __pyx_n_s_f_lineno, __pyx_n_s_f_back); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(0, 114, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__22); + __Pyx_GIVEREF(__pyx_tuple__22); + + /* "src/gevent/greenlet.py":268 + * + * @Lazy + * def spawning_stack(self): # <<<<<<<<<<<<<< + * # Store this in the __dict__. We don't use it from the C + * # code. It's tempting to discard _spawning_stack_frames + */ + __pyx_tuple__23 = PyTuple_Pack(1, __pyx_n_s_self_2); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(0, 268, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__23); + __Pyx_GIVEREF(__pyx_tuple__23); + __pyx_codeobj__24 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__23, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_greenlet_py, __pyx_n_s_spawning_stack, 268, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__24)) __PYX_ERR(0, 268, __pyx_L1_error) + + /* "src/gevent/greenlet.py":301 + * + * @readproperty + * def name(self): # <<<<<<<<<<<<<< + * """ + * The greenlet name. By default, a unique name is constructed using + */ + __pyx_tuple__25 = PyTuple_Pack(1, __pyx_n_s_self_2); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(0, 301, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__25); + __Pyx_GIVEREF(__pyx_tuple__25); + __pyx_codeobj__26 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__25, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_greenlet_py, __pyx_n_s_name_2, 301, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__26)) __PYX_ERR(0, 301, __pyx_L1_error) + + /* "src/gevent/greenlet.py":316 + * return 'Greenlet-%d' % (self.minimal_ident,) + * + * def _raise_exception(self): # <<<<<<<<<<<<<< + * reraise(*self.exc_info) + * + */ + __pyx_tuple__27 = PyTuple_Pack(1, __pyx_n_s_self_2); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(0, 316, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__27); + __Pyx_GIVEREF(__pyx_tuple__27); + __pyx_codeobj__28 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__27, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_greenlet_py, __pyx_n_s_raise_exception, 316, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__28)) __PYX_ERR(0, 316, __pyx_L1_error) + + /* "src/gevent/greenlet.py":407 + * return bool(self) + * + * def ready(self): # <<<<<<<<<<<<<< + * """ + * Return a true value if and only if the greenlet has finished + */ + __pyx_tuple__29 = PyTuple_Pack(1, __pyx_n_s_self_2); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(0, 407, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__29); + __Pyx_GIVEREF(__pyx_tuple__29); + __pyx_codeobj__30 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__29, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_greenlet_py, __pyx_n_s_ready, 407, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__30)) __PYX_ERR(0, 407, __pyx_L1_error) + + /* "src/gevent/greenlet.py":418 + * return self.dead or self._exc_info is not None + * + * def successful(self): # <<<<<<<<<<<<<< + * """ + * Return a true value if and only if the greenlet has finished execution + */ + __pyx_tuple__31 = PyTuple_Pack(1, __pyx_n_s_self_2); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(0, 418, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__31); + __Pyx_GIVEREF(__pyx_tuple__31); + __pyx_codeobj__32 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__31, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_greenlet_py, __pyx_n_s_successful, 418, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__32)) __PYX_ERR(0, 418, __pyx_L1_error) + + /* "src/gevent/greenlet.py":448 + * + * + * def _formatinfo(self): # <<<<<<<<<<<<<< + * info = self._formatted_info + * if info is not None: + */ + __pyx_tuple__33 = PyTuple_Pack(1, __pyx_n_s_self_2); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(0, 448, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__33); + __Pyx_GIVEREF(__pyx_tuple__33); + __pyx_codeobj__34 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__33, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_greenlet_py, __pyx_n_s_formatinfo, 448, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__34)) __PYX_ERR(0, 448, __pyx_L1_error) + + /* "src/gevent/greenlet.py":498 + * return (ei[0], ei[1], load_traceback(ei[2])) + * + * def throw(self, *args): # <<<<<<<<<<<<<< + * """Immediately switch into the greenlet and raise an exception in it. + * + */ + __pyx_tuple__35 = PyTuple_Pack(2, __pyx_n_s_self_2, __pyx_n_s_args); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(0, 498, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__35); + __Pyx_GIVEREF(__pyx_tuple__35); + __pyx_codeobj__36 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__35, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_greenlet_py, __pyx_n_s_throw, 498, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__36)) __PYX_ERR(0, 498, __pyx_L1_error) + + /* "src/gevent/greenlet.py":520 + * self.__handle_death_before_start(args) + * + * def start(self): # <<<<<<<<<<<<<< + * """Schedule the greenlet to run in this loop iteration""" + * if self._start_event is None: + */ + __pyx_tuple__37 = PyTuple_Pack(1, __pyx_n_s_self_2); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(0, 520, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__37); + __Pyx_GIVEREF(__pyx_tuple__37); + __pyx_codeobj__38 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__37, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_greenlet_py, __pyx_n_s_start, 520, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__38)) __PYX_ERR(0, 520, __pyx_L1_error) + + /* "src/gevent/greenlet.py":526 + * self._start_event = self.parent.loop.run_callback(self.switch) + * + * def start_later(self, seconds): # <<<<<<<<<<<<<< + * """ + * start_later(seconds) -> None + */ + __pyx_tuple__39 = PyTuple_Pack(2, __pyx_n_s_self_2, __pyx_n_s_seconds); if (unlikely(!__pyx_tuple__39)) __PYX_ERR(0, 526, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__39); + __Pyx_GIVEREF(__pyx_tuple__39); + __pyx_codeobj__40 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__39, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_greenlet_py, __pyx_n_s_start_later, 526, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__40)) __PYX_ERR(0, 526, __pyx_L1_error) + + /* "src/gevent/greenlet.py":539 + * + * @staticmethod + * def add_spawn_callback(callback): # <<<<<<<<<<<<<< + * """ + * add_spawn_callback(callback) -> None + */ + __pyx_tuple__41 = PyTuple_Pack(1, __pyx_n_s_callback); if (unlikely(!__pyx_tuple__41)) __PYX_ERR(0, 539, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__41); + __Pyx_GIVEREF(__pyx_tuple__41); + __pyx_codeobj__42 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__41, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_greenlet_py, __pyx_n_s_add_spawn_callback, 539, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__42)) __PYX_ERR(0, 539, __pyx_L1_error) + + /* "src/gevent/greenlet.py":558 + * + * @staticmethod + * def remove_spawn_callback(callback): # <<<<<<<<<<<<<< + * """ + * remove_spawn_callback(callback) -> None + */ + __pyx_tuple__43 = PyTuple_Pack(1, __pyx_n_s_callback); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(0, 558, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__43); + __Pyx_GIVEREF(__pyx_tuple__43); + __pyx_codeobj__44 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__43, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_greenlet_py, __pyx_n_s_remove_spawn_callback, 558, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__44)) __PYX_ERR(0, 558, __pyx_L1_error) + + /* "src/gevent/greenlet.py":575 + * + * @classmethod + * def spawn(cls, *args, **kwargs): # <<<<<<<<<<<<<< + * """ + * spawn(function, *args, **kwargs) -> Greenlet + */ + __pyx_tuple__45 = PyTuple_Pack(4, __pyx_n_s_cls, __pyx_n_s_args, __pyx_n_s_kwargs, __pyx_n_s_g); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(0, 575, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__45); + __Pyx_GIVEREF(__pyx_tuple__45); + __pyx_codeobj__46 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__45, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_greenlet_py, __pyx_n_s_spawn, 575, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__46)) __PYX_ERR(0, 575, __pyx_L1_error) + + /* "src/gevent/greenlet.py":593 + * + * @classmethod + * def spawn_later(cls, seconds, *args, **kwargs): # <<<<<<<<<<<<<< + * """ + * spawn_later(seconds, function, *args, **kwargs) -> Greenlet + */ + __pyx_tuple__47 = PyTuple_Pack(5, __pyx_n_s_cls, __pyx_n_s_seconds, __pyx_n_s_args, __pyx_n_s_kwargs, __pyx_n_s_g); if (unlikely(!__pyx_tuple__47)) __PYX_ERR(0, 593, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__47); + __Pyx_GIVEREF(__pyx_tuple__47); + __pyx_codeobj__48 = (PyObject*)__Pyx_PyCode_New(2, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__47, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_greenlet_py, __pyx_n_s_spawn_later, 593, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__48)) __PYX_ERR(0, 593, __pyx_L1_error) + + /* "src/gevent/greenlet.py":615 + * return g + * + * def kill(self, exception=GreenletExit, block=True, timeout=None): # <<<<<<<<<<<<<< + * """ + * Raise the ``exception`` in the greenlet. + */ + __pyx_tuple__49 = PyTuple_Pack(5, __pyx_n_s_self_2, __pyx_n_s_exception, __pyx_n_s_block, __pyx_n_s_timeout, __pyx_n_s_waiter); if (unlikely(!__pyx_tuple__49)) __PYX_ERR(0, 615, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__49); + __Pyx_GIVEREF(__pyx_tuple__49); + __pyx_codeobj__50 = (PyObject*)__Pyx_PyCode_New(4, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__49, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_greenlet_py, __pyx_n_s_kill_2, 615, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__50)) __PYX_ERR(0, 615, __pyx_L1_error) + + /* "src/gevent/greenlet.py":667 + * # thus it should not raise when the greenlet is already killed (= not started) + * + * def get(self, block=True, timeout=None): # <<<<<<<<<<<<<< + * """ + * get(block=True, timeout=None) -> object + */ + __pyx_tuple__51 = PyTuple_Pack(6, __pyx_n_s_self_2, __pyx_n_s_block, __pyx_n_s_timeout, __pyx_n_s_switch, __pyx_n_s_t, __pyx_n_s_result); if (unlikely(!__pyx_tuple__51)) __PYX_ERR(0, 667, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__51); + __Pyx_GIVEREF(__pyx_tuple__51); + __pyx_codeobj__52 = (PyObject*)__Pyx_PyCode_New(3, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__51, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_greenlet_py, __pyx_n_s_get_2, 667, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__52)) __PYX_ERR(0, 667, __pyx_L1_error) + + /* "src/gevent/greenlet.py":711 + * self._raise_exception() + * + * def join(self, timeout=None): # <<<<<<<<<<<<<< + * """ + * join(timeout=None) -> None + */ + __pyx_tuple__53 = PyTuple_Pack(2, __pyx_n_s_self_2, __pyx_n_s_timeout); if (unlikely(!__pyx_tuple__53)) __PYX_ERR(0, 711, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__53); + __Pyx_GIVEREF(__pyx_tuple__53); + __pyx_codeobj__54 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__53, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_greenlet_py, __pyx_n_s_join, 711, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__54)) __PYX_ERR(0, 711, __pyx_L1_error) + + /* "src/gevent/greenlet.py":760 + * del exc_info + * + * def run(self): # <<<<<<<<<<<<<< + * try: + * self.__cancel_start() + */ + __pyx_tuple__55 = PyTuple_Pack(2, __pyx_n_s_self_2, __pyx_n_s_result); if (unlikely(!__pyx_tuple__55)) __PYX_ERR(0, 760, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__55); + __Pyx_GIVEREF(__pyx_tuple__55); + __pyx_codeobj__56 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__55, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_greenlet_py, __pyx_n_s_run, 760, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__56)) __PYX_ERR(0, 760, __pyx_L1_error) + + /* "src/gevent/greenlet.py":776 + * self.kwargs.clear() + * + * def _run(self): # <<<<<<<<<<<<<< + * """ + * Subclasses may override this method to take any number of + */ + __pyx_tuple__57 = PyTuple_Pack(1, __pyx_n_s_self_2); if (unlikely(!__pyx_tuple__57)) __PYX_ERR(0, 776, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__57); + __Pyx_GIVEREF(__pyx_tuple__57); + __pyx_codeobj__58 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__57, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_greenlet_py, __pyx_n_s_run_2, 776, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__58)) __PYX_ERR(0, 776, __pyx_L1_error) + + /* "src/gevent/greenlet.py":790 + * return + * + * def has_links(self): # <<<<<<<<<<<<<< + * return len(self._links) + * + */ + __pyx_tuple__59 = PyTuple_Pack(1, __pyx_n_s_self_2); if (unlikely(!__pyx_tuple__59)) __PYX_ERR(0, 790, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__59); + __Pyx_GIVEREF(__pyx_tuple__59); + __pyx_codeobj__60 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__59, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_greenlet_py, __pyx_n_s_has_links, 790, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__60)) __PYX_ERR(0, 790, __pyx_L1_error) + + /* "src/gevent/greenlet.py":793 + * return len(self._links) + * + * def rawlink(self, callback): # <<<<<<<<<<<<<< + * """ + * Register a callable to be executed when the greenlet finishes + */ + __pyx_tuple__61 = PyTuple_Pack(2, __pyx_n_s_self_2, __pyx_n_s_callback); if (unlikely(!__pyx_tuple__61)) __PYX_ERR(0, 793, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__61); + __Pyx_GIVEREF(__pyx_tuple__61); + __pyx_codeobj__62 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__61, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_greenlet_py, __pyx_n_s_rawlink, 793, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__62)) __PYX_ERR(0, 793, __pyx_L1_error) + + /* "src/gevent/greenlet.py":809 + * self._notifier = self.parent.loop.run_callback(self._notify_links) + * + * def link(self, callback, SpawnedLink=SpawnedLink): # <<<<<<<<<<<<<< + * """ + * Link greenlet's completion to a callable. + */ + __pyx_tuple__63 = PyTuple_Pack(3, __pyx_n_s_self_2, __pyx_n_s_callback, __pyx_n_s_SpawnedLink); if (unlikely(!__pyx_tuple__63)) __PYX_ERR(0, 809, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__63); + __Pyx_GIVEREF(__pyx_tuple__63); + __pyx_codeobj__64 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__63, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_greenlet_py, __pyx_n_s_link, 809, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__64)) __PYX_ERR(0, 809, __pyx_L1_error) + + /* "src/gevent/greenlet.py":823 + * self.rawlink(SpawnedLink(callback)) + * + * def unlink(self, callback): # <<<<<<<<<<<<<< + * """Remove the callback set by :meth:`link` or :meth:`rawlink`""" + * try: + */ + __pyx_tuple__65 = PyTuple_Pack(2, __pyx_n_s_self_2, __pyx_n_s_callback); if (unlikely(!__pyx_tuple__65)) __PYX_ERR(0, 823, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__65); + __Pyx_GIVEREF(__pyx_tuple__65); + __pyx_codeobj__66 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__65, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_greenlet_py, __pyx_n_s_unlink, 823, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__66)) __PYX_ERR(0, 823, __pyx_L1_error) + + /* "src/gevent/greenlet.py":830 + * pass + * + * def unlink_all(self): # <<<<<<<<<<<<<< + * """ + * Remove all the callbacks. + */ + __pyx_tuple__67 = PyTuple_Pack(1, __pyx_n_s_self_2); if (unlikely(!__pyx_tuple__67)) __PYX_ERR(0, 830, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__67); + __Pyx_GIVEREF(__pyx_tuple__67); + __pyx_codeobj__68 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__67, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_greenlet_py, __pyx_n_s_unlink_all, 830, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__68)) __PYX_ERR(0, 830, __pyx_L1_error) + + /* "src/gevent/greenlet.py":838 + * del self._links[:] + * + * def link_value(self, callback, SpawnedLink=SuccessSpawnedLink): # <<<<<<<<<<<<<< + * """ + * Like :meth:`link` but *callback* is only notified when the greenlet + */ + __pyx_tuple__69 = PyTuple_Pack(3, __pyx_n_s_self_2, __pyx_n_s_callback, __pyx_n_s_SpawnedLink); if (unlikely(!__pyx_tuple__69)) __PYX_ERR(0, 838, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__69); + __Pyx_GIVEREF(__pyx_tuple__69); + __pyx_codeobj__70 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__69, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_greenlet_py, __pyx_n_s_link_value, 838, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__70)) __PYX_ERR(0, 838, __pyx_L1_error) + + /* "src/gevent/greenlet.py":846 + * self.link(callback, SpawnedLink=SpawnedLink) + * + * def link_exception(self, callback, SpawnedLink=FailureSpawnedLink): # <<<<<<<<<<<<<< + * """ + * Like :meth:`link` but *callback* is only notified when the + */ + __pyx_tuple__71 = PyTuple_Pack(3, __pyx_n_s_self_2, __pyx_n_s_callback, __pyx_n_s_SpawnedLink); if (unlikely(!__pyx_tuple__71)) __PYX_ERR(0, 846, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__71); + __Pyx_GIVEREF(__pyx_tuple__71); + __pyx_codeobj__72 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__71, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_greenlet_py, __pyx_n_s_link_exception, 846, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__72)) __PYX_ERR(0, 846, __pyx_L1_error) + + /* "src/gevent/greenlet.py":854 + * self.link(callback, SpawnedLink=SpawnedLink) + * + * def _notify_links(self): # <<<<<<<<<<<<<< + * while self._links: + * # Early links are allowed to remove later links + */ + __pyx_tuple__73 = PyTuple_Pack(1, __pyx_n_s_self_2); if (unlikely(!__pyx_tuple__73)) __PYX_ERR(0, 854, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__73); + __Pyx_GIVEREF(__pyx_tuple__73); + __pyx_codeobj__74 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__73, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_greenlet_py, __pyx_n_s_notify_links, 854, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__74)) __PYX_ERR(0, 854, __pyx_L1_error) + + /* "src/gevent/greenlet.py":871 + * + * class _dummy_event(object): + * __slots__ = ('pending', 'active') # <<<<<<<<<<<<<< + * + * def __init__(self): + */ + __pyx_tuple__75 = PyTuple_Pack(2, __pyx_n_s_pending, __pyx_n_s_active); if (unlikely(!__pyx_tuple__75)) __PYX_ERR(0, 871, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__75); + __Pyx_GIVEREF(__pyx_tuple__75); + + /* "src/gevent/greenlet.py":876 + * self.pending = self.active = False + * + * def stop(self): # <<<<<<<<<<<<<< + * pass + * + */ + __pyx_tuple__76 = PyTuple_Pack(1, __pyx_n_s_self_2); if (unlikely(!__pyx_tuple__76)) __PYX_ERR(0, 876, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__76); + __Pyx_GIVEREF(__pyx_tuple__76); + __pyx_codeobj__77 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__76, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_greenlet_py, __pyx_n_s_stop, 876, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__77)) __PYX_ERR(0, 876, __pyx_L1_error) + + /* "src/gevent/greenlet.py":879 + * pass + * + * def start(self, cb): # pylint:disable=unused-argument # <<<<<<<<<<<<<< + * raise AssertionError("Cannot start the dummy event") + * + */ + __pyx_tuple__78 = PyTuple_Pack(2, __pyx_n_s_self_2, __pyx_n_s_cb); if (unlikely(!__pyx_tuple__78)) __PYX_ERR(0, 879, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__78); + __Pyx_GIVEREF(__pyx_tuple__78); + __pyx_codeobj__79 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__78, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_greenlet_py, __pyx_n_s_start, 879, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__79)) __PYX_ERR(0, 879, __pyx_L1_error) + + /* "src/gevent/greenlet.py":882 + * raise AssertionError("Cannot start the dummy event") + * + * def close(self): # <<<<<<<<<<<<<< + * pass + * + */ + __pyx_tuple__80 = PyTuple_Pack(1, __pyx_n_s_self_2); if (unlikely(!__pyx_tuple__80)) __PYX_ERR(0, 882, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__80); + __Pyx_GIVEREF(__pyx_tuple__80); + __pyx_codeobj__81 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__80, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_greenlet_py, __pyx_n_s_close, 882, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__81)) __PYX_ERR(0, 882, __pyx_L1_error) + + /* "src/gevent/greenlet.py":889 + * + * + * def _kill(glet, exception, waiter): # <<<<<<<<<<<<<< + * try: + * glet.throw(exception) + */ + __pyx_tuple__82 = PyTuple_Pack(3, __pyx_n_s_glet, __pyx_n_s_exception, __pyx_n_s_waiter); if (unlikely(!__pyx_tuple__82)) __PYX_ERR(0, 889, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__82); + __Pyx_GIVEREF(__pyx_tuple__82); + __pyx_codeobj__83 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__82, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_greenlet_py, __pyx_n_s_kill, 889, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__83)) __PYX_ERR(0, 889, __pyx_L1_error) + + /* "src/gevent/greenlet.py":899 + * + * + * def joinall(greenlets, timeout=None, raise_error=False, count=None): # <<<<<<<<<<<<<< + * """ + * Wait for the ``greenlets`` to finish. + */ + __pyx_tuple__84 = PyTuple_Pack(4, __pyx_n_s_greenlets, __pyx_n_s_timeout, __pyx_n_s_raise_error, __pyx_n_s_count); if (unlikely(!__pyx_tuple__84)) __PYX_ERR(0, 899, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__84); + __Pyx_GIVEREF(__pyx_tuple__84); + __pyx_codeobj__85 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__84, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_greenlet_py, __pyx_n_s_joinall, 899, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__85)) __PYX_ERR(0, 899, __pyx_L1_error) + + /* "src/gevent/greenlet.py":953 + * + * + * def killall(greenlets, exception=GreenletExit, block=True, timeout=None): # <<<<<<<<<<<<<< + * """ + * Forceably terminate all the ``greenlets`` by causing them to raise ``exception``. + */ + __pyx_tuple__86 = PyTuple_Pack(8, __pyx_n_s_greenlets, __pyx_n_s_exception, __pyx_n_s_block, __pyx_n_s_timeout, __pyx_n_s_loop, __pyx_n_s_waiter, __pyx_n_s_t, __pyx_n_s_alive); if (unlikely(!__pyx_tuple__86)) __PYX_ERR(0, 953, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__86); + __Pyx_GIVEREF(__pyx_tuple__86); + __pyx_codeobj__87 = (PyObject*)__Pyx_PyCode_New(4, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__86, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_greenlet_py, __pyx_n_s_killall, 953, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__87)) __PYX_ERR(0, 953, __pyx_L1_error) + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} + +static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { + if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_10 = PyInt_FromLong(10); if (unlikely(!__pyx_int_10)) __PYX_ERR(0, 1, __pyx_L1_error) + return 0; + __pyx_L1_error:; + return -1; +} + +static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/ + +static int __Pyx_modinit_global_init_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); + /*--- Global init code ---*/ + __pyx_v_6gevent_9_greenlet_sys_getframe = Py_None; Py_INCREF(Py_None); + __pyx_v_6gevent_9_greenlet_sys_exc_info = Py_None; Py_INCREF(Py_None); + __pyx_v_6gevent_9_greenlet_Timeout = Py_None; Py_INCREF(Py_None); + __pyx_v_6gevent_9_greenlet_GreenletExit = Py_None; Py_INCREF(Py_None); + __pyx_v_6gevent_9_greenlet_InvalidSwitchError = Py_None; Py_INCREF(Py_None); + __pyx_v_6gevent_9_greenlet__greenlet__init__ = Py_None; Py_INCREF(Py_None); + __pyx_v_6gevent_9_greenlet__threadlocal = Py_None; Py_INCREF(Py_None); + __pyx_v_6gevent_9_greenlet_get_hub_class = Py_None; Py_INCREF(Py_None); + __pyx_v_6gevent_9_greenlet_wref = Py_None; Py_INCREF(Py_None); + __pyx_v_6gevent_9_greenlet_dump_traceback = Py_None; Py_INCREF(Py_None); + __pyx_v_6gevent_9_greenlet_load_traceback = Py_None; Py_INCREF(Py_None); + __pyx_v_6gevent_9_greenlet_wait = Py_None; Py_INCREF(Py_None); + __pyx_v_6gevent_9_greenlet_iwait = Py_None; Py_INCREF(Py_None); + __pyx_v_6gevent_9_greenlet_reraise = Py_None; Py_INCREF(Py_None); + __pyx_v_6gevent_9_greenlet_GEVENT_CONFIG = Py_None; Py_INCREF(Py_None); + __pyx_v_6gevent_9_greenlet__cancelled_start_event = ((struct __pyx_obj_6gevent_9_greenlet__dummy_event *)Py_None); Py_INCREF(Py_None); + __pyx_v_6gevent_9_greenlet__start_completed_event = ((struct __pyx_obj_6gevent_9_greenlet__dummy_event *)Py_None); Py_INCREF(Py_None); + __pyx_v_6gevent_9_greenlet__spawn_callbacks = ((PyObject*)Py_None); Py_INCREF(Py_None); + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_variable_export_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); + /*--- Variable export code ---*/ + if (__Pyx_ExportVoidPtr(__pyx_n_s_PYPY, (void *)&__pyx_v_6gevent_9_greenlet__PYPY, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportVoidPtr(__pyx_n_s_sys_getframe, (void *)&__pyx_v_6gevent_9_greenlet_sys_getframe, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportVoidPtr(__pyx_n_s_sys_exc_info, (void *)&__pyx_v_6gevent_9_greenlet_sys_exc_info, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportVoidPtr(__pyx_n_s_Timeout, (void *)&__pyx_v_6gevent_9_greenlet_Timeout, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportVoidPtr(__pyx_n_s_GreenletExit, (void *)&__pyx_v_6gevent_9_greenlet_GreenletExit, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportVoidPtr(__pyx_n_s_InvalidSwitchError, (void *)&__pyx_v_6gevent_9_greenlet_InvalidSwitchError, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportVoidPtr(__pyx_n_s_greenlet_imported, (void *)&__pyx_v_6gevent_9_greenlet__greenlet_imported, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportVoidPtr(__pyx_n_s_greenlet__init, (void *)&__pyx_v_6gevent_9_greenlet__greenlet__init__, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportVoidPtr(__pyx_n_s_threadlocal, (void *)&__pyx_v_6gevent_9_greenlet__threadlocal, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportVoidPtr(__pyx_n_s_get_hub_class, (void *)&__pyx_v_6gevent_9_greenlet_get_hub_class, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportVoidPtr(__pyx_n_s_wref, (void *)&__pyx_v_6gevent_9_greenlet_wref, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportVoidPtr(__pyx_n_s_dump_traceback, (void *)&__pyx_v_6gevent_9_greenlet_dump_traceback, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportVoidPtr(__pyx_n_s_load_traceback, (void *)&__pyx_v_6gevent_9_greenlet_load_traceback, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportVoidPtr(__pyx_n_s_wait, (void *)&__pyx_v_6gevent_9_greenlet_wait, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportVoidPtr(__pyx_n_s_iwait, (void *)&__pyx_v_6gevent_9_greenlet_iwait, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportVoidPtr(__pyx_n_s_reraise, (void *)&__pyx_v_6gevent_9_greenlet_reraise, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportVoidPtr(__pyx_n_s_GEVENT_CONFIG, (void *)&__pyx_v_6gevent_9_greenlet_GEVENT_CONFIG, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportVoidPtr(__pyx_n_s_cancelled_start_event, (void *)&__pyx_v_6gevent_9_greenlet__cancelled_start_event, "struct __pyx_obj_6gevent_9_greenlet__dummy_event *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportVoidPtr(__pyx_n_s_start_completed_event, (void *)&__pyx_v_6gevent_9_greenlet__start_completed_event, "struct __pyx_obj_6gevent_9_greenlet__dummy_event *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportVoidPtr(__pyx_n_s_spawn_callbacks, (void *)&__pyx_v_6gevent_9_greenlet__spawn_callbacks, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_modinit_function_export_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); + /*--- Function export code ---*/ + if (__Pyx_ExportFunction("_init", (void (*)(void))__pyx_f_6gevent_9_greenlet__init, "void (void)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportFunction("_extract_stack", (void (*)(void))__pyx_f_6gevent_9_greenlet__extract_stack, "PyObject *(int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportFunction("_Frame_from_list", (void (*)(void))__pyx_f_6gevent_9_greenlet__Frame_from_list, "struct __pyx_obj_6gevent_9_greenlet__Frame *(PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportFunction("_killall3", (void (*)(void))__pyx_f_6gevent_9_greenlet__killall3, "PyObject *(PyObject *, PyObject *, PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportFunction("_killall", (void (*)(void))__pyx_f_6gevent_9_greenlet__killall, "PyObject *(PyObject *, PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportFunction("joinall", (void (*)(void))__pyx_f_6gevent_9_greenlet_joinall, "PyObject *(PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_9_greenlet_joinall *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportFunction("_call_spawn_callbacks", (void (*)(void))__pyx_f_6gevent_9_greenlet__call_spawn_callbacks, "void (struct __pyx_obj_6gevent_9_greenlet_Greenlet *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_modinit_type_init_code(void) { + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); + /*--- Type init code ---*/ + __pyx_t_1 = PyImport_ImportModule("greenlet"); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_ptype_6gevent_9_greenlet_greenlet = __Pyx_ImportType(__pyx_t_1, "greenlet", "greenlet", sizeof(PyGreenlet), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_9_greenlet_greenlet) __PYX_ERR(1, 17, __pyx_L1_error) + __pyx_t_2 = PyImport_ImportModule("types"); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 40, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_ptype_6gevent_9_greenlet_CodeType = __Pyx_ImportType(__pyx_t_2, "types", "CodeType", sizeof(PyCodeObject), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_9_greenlet_CodeType) __PYX_ERR(1, 40, __pyx_L1_error) + __pyx_ptype_6gevent_9_greenlet_FrameType = __Pyx_ImportType(__pyx_t_2, "types", "FrameType", sizeof(PyFrameObject), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_9_greenlet_FrameType) __PYX_ERR(1, 45, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_6gevent_9_greenlet_SpawnedLink) < 0) __PYX_ERR(0, 55, __pyx_L1_error) + __pyx_type_6gevent_9_greenlet_SpawnedLink.tp_print = 0; + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_SpawnedLink, (PyObject *)&__pyx_type_6gevent_9_greenlet_SpawnedLink) < 0) __PYX_ERR(0, 55, __pyx_L1_error) + __pyx_ptype_6gevent_9_greenlet_SpawnedLink = &__pyx_type_6gevent_9_greenlet_SpawnedLink; + __pyx_type_6gevent_9_greenlet_SuccessSpawnedLink.tp_base = __pyx_ptype_6gevent_9_greenlet_SpawnedLink; + if (PyType_Ready(&__pyx_type_6gevent_9_greenlet_SuccessSpawnedLink) < 0) __PYX_ERR(0, 89, __pyx_L1_error) + __pyx_type_6gevent_9_greenlet_SuccessSpawnedLink.tp_print = 0; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6gevent_9_greenlet_SuccessSpawnedLink.tp_dictoffset && __pyx_type_6gevent_9_greenlet_SuccessSpawnedLink.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_type_6gevent_9_greenlet_SuccessSpawnedLink.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + } + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_SuccessSpawnedLink, (PyObject *)&__pyx_type_6gevent_9_greenlet_SuccessSpawnedLink) < 0) __PYX_ERR(0, 89, __pyx_L1_error) + __pyx_ptype_6gevent_9_greenlet_SuccessSpawnedLink = &__pyx_type_6gevent_9_greenlet_SuccessSpawnedLink; + __pyx_type_6gevent_9_greenlet_FailureSpawnedLink.tp_base = __pyx_ptype_6gevent_9_greenlet_SpawnedLink; + if (PyType_Ready(&__pyx_type_6gevent_9_greenlet_FailureSpawnedLink) < 0) __PYX_ERR(0, 101, __pyx_L1_error) + __pyx_type_6gevent_9_greenlet_FailureSpawnedLink.tp_print = 0; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6gevent_9_greenlet_FailureSpawnedLink.tp_dictoffset && __pyx_type_6gevent_9_greenlet_FailureSpawnedLink.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_type_6gevent_9_greenlet_FailureSpawnedLink.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + } + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_FailureSpawnedLink, (PyObject *)&__pyx_type_6gevent_9_greenlet_FailureSpawnedLink) < 0) __PYX_ERR(0, 101, __pyx_L1_error) + __pyx_ptype_6gevent_9_greenlet_FailureSpawnedLink = &__pyx_type_6gevent_9_greenlet_FailureSpawnedLink; + if (PyType_Ready(&__pyx_type_6gevent_9_greenlet__Frame) < 0) __PYX_ERR(0, 112, __pyx_L1_error) + __pyx_type_6gevent_9_greenlet__Frame.tp_print = 0; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6gevent_9_greenlet__Frame.tp_dictoffset && __pyx_type_6gevent_9_greenlet__Frame.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_type_6gevent_9_greenlet__Frame.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + } + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Frame, (PyObject *)&__pyx_type_6gevent_9_greenlet__Frame) < 0) __PYX_ERR(0, 112, __pyx_L1_error) + __pyx_ptype_6gevent_9_greenlet__Frame = &__pyx_type_6gevent_9_greenlet__Frame; + __pyx_vtabptr_6gevent_9_greenlet_Greenlet = &__pyx_vtable_6gevent_9_greenlet_Greenlet; + __pyx_vtable_6gevent_9_greenlet_Greenlet.has_links = (int (*)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *, int __pyx_skip_dispatch))__pyx_f_6gevent_9_greenlet_8Greenlet_has_links; + __pyx_vtable_6gevent_9_greenlet_Greenlet.join = (PyObject *(*)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_9_greenlet_8Greenlet_join *__pyx_optional_args))__pyx_f_6gevent_9_greenlet_8Greenlet_join; + __pyx_vtable_6gevent_9_greenlet_Greenlet.ready = (int (*)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *, int __pyx_skip_dispatch))__pyx_f_6gevent_9_greenlet_8Greenlet_ready; + __pyx_vtable_6gevent_9_greenlet_Greenlet.successful = (int (*)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *, int __pyx_skip_dispatch))__pyx_f_6gevent_9_greenlet_8Greenlet_successful; + __pyx_vtable_6gevent_9_greenlet_Greenlet.rawlink = (PyObject *(*)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *, PyObject *, int __pyx_skip_dispatch))__pyx_f_6gevent_9_greenlet_8Greenlet_rawlink; + __pyx_vtable_6gevent_9_greenlet_Greenlet._formatinfo = (PyObject *(*)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *, int __pyx_skip_dispatch))__pyx_f_6gevent_9_greenlet_8Greenlet__formatinfo; + __pyx_vtable_6gevent_9_greenlet_Greenlet._get_minimal_ident = (PyObject *(*)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *))__pyx_f_6gevent_9_greenlet_8Greenlet__get_minimal_ident; + __pyx_vtable_6gevent_9_greenlet_Greenlet.__pyx___started_but_aborted = (int (*)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *))__pyx_f_6gevent_9_greenlet_8Greenlet___started_but_aborted; + __pyx_vtable_6gevent_9_greenlet_Greenlet.__pyx___start_cancelled_by_kill = (int (*)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *))__pyx_f_6gevent_9_greenlet_8Greenlet___start_cancelled_by_kill; + __pyx_vtable_6gevent_9_greenlet_Greenlet.__pyx___start_pending = (int (*)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *))__pyx_f_6gevent_9_greenlet_8Greenlet___start_pending; + __pyx_vtable_6gevent_9_greenlet_Greenlet.__pyx___never_started_or_killed = (int (*)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *))__pyx_f_6gevent_9_greenlet_8Greenlet___never_started_or_killed; + __pyx_vtable_6gevent_9_greenlet_Greenlet.__pyx___start_completed = (int (*)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *))__pyx_f_6gevent_9_greenlet_8Greenlet___start_completed; + __pyx_vtable_6gevent_9_greenlet_Greenlet.__pyx___handle_death_before_start = (PyObject *(*)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *, PyObject *))__pyx_f_6gevent_9_greenlet_8Greenlet___handle_death_before_start; + __pyx_vtable_6gevent_9_greenlet_Greenlet.__pyx___cancel_start = (PyObject *(*)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *))__pyx_f_6gevent_9_greenlet_8Greenlet___cancel_start; + __pyx_vtable_6gevent_9_greenlet_Greenlet._report_result = (PyObject *(*)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *, PyObject *))__pyx_f_6gevent_9_greenlet_8Greenlet__report_result; + __pyx_vtable_6gevent_9_greenlet_Greenlet._report_error = (PyObject *(*)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *, PyObject *))__pyx_f_6gevent_9_greenlet_8Greenlet__report_error; + __pyx_vtable_6gevent_9_greenlet_Greenlet._notify_links = (PyObject *(*)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *, int __pyx_skip_dispatch))__pyx_f_6gevent_9_greenlet_8Greenlet__notify_links; + __pyx_type_6gevent_9_greenlet_Greenlet.tp_base = __pyx_ptype_6gevent_9_greenlet_greenlet; + if (PyType_Ready(&__pyx_type_6gevent_9_greenlet_Greenlet) < 0) __PYX_ERR(0, 157, __pyx_L1_error) + __pyx_type_6gevent_9_greenlet_Greenlet.tp_print = 0; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6gevent_9_greenlet_Greenlet.tp_dictoffset && __pyx_type_6gevent_9_greenlet_Greenlet.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_type_6gevent_9_greenlet_Greenlet.tp_getattro = __Pyx_PyObject_GenericGetAttr; + } + #if CYTHON_COMPILING_IN_CPYTHON + { + PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_6gevent_9_greenlet_Greenlet, "__init__"); if (unlikely(!wrapper)) __PYX_ERR(0, 157, __pyx_L1_error) + if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) { + __pyx_wrapperbase_6gevent_9_greenlet_8Greenlet___init__ = *((PyWrapperDescrObject *)wrapper)->d_base; + __pyx_wrapperbase_6gevent_9_greenlet_8Greenlet___init__.doc = __pyx_doc_6gevent_9_greenlet_8Greenlet___init__; + ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_6gevent_9_greenlet_8Greenlet___init__; + } + } + #endif + if (__Pyx_SetVtable(__pyx_type_6gevent_9_greenlet_Greenlet.tp_dict, __pyx_vtabptr_6gevent_9_greenlet_Greenlet) < 0) __PYX_ERR(0, 157, __pyx_L1_error) + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Greenlet, (PyObject *)&__pyx_type_6gevent_9_greenlet_Greenlet) < 0) __PYX_ERR(0, 157, __pyx_L1_error) + __pyx_ptype_6gevent_9_greenlet_Greenlet = &__pyx_type_6gevent_9_greenlet_Greenlet; + __pyx_vtabptr_6gevent_9_greenlet__dummy_event = &__pyx_vtable_6gevent_9_greenlet__dummy_event; + __pyx_vtable_6gevent_9_greenlet__dummy_event.stop = (PyObject *(*)(struct __pyx_obj_6gevent_9_greenlet__dummy_event *, int __pyx_skip_dispatch))__pyx_f_6gevent_9_greenlet_12_dummy_event_stop; + __pyx_vtable_6gevent_9_greenlet__dummy_event.start = (PyObject *(*)(struct __pyx_obj_6gevent_9_greenlet__dummy_event *, PyObject *, int __pyx_skip_dispatch))__pyx_f_6gevent_9_greenlet_12_dummy_event_start; + __pyx_vtable_6gevent_9_greenlet__dummy_event.close = (PyObject *(*)(struct __pyx_obj_6gevent_9_greenlet__dummy_event *, int __pyx_skip_dispatch))__pyx_f_6gevent_9_greenlet_12_dummy_event_close; + if (PyType_Ready(&__pyx_type_6gevent_9_greenlet__dummy_event) < 0) __PYX_ERR(0, 870, __pyx_L1_error) + __pyx_type_6gevent_9_greenlet__dummy_event.tp_print = 0; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6gevent_9_greenlet__dummy_event.tp_dictoffset && __pyx_type_6gevent_9_greenlet__dummy_event.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_type_6gevent_9_greenlet__dummy_event.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + } + if (__Pyx_SetVtable(__pyx_type_6gevent_9_greenlet__dummy_event.tp_dict, __pyx_vtabptr_6gevent_9_greenlet__dummy_event) < 0) __PYX_ERR(0, 870, __pyx_L1_error) + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_dummy_event, (PyObject *)&__pyx_type_6gevent_9_greenlet__dummy_event) < 0) __PYX_ERR(0, 870, __pyx_L1_error) + __pyx_ptype_6gevent_9_greenlet__dummy_event = &__pyx_type_6gevent_9_greenlet__dummy_event; + if (PyType_Ready(&__pyx_scope_struct____Pyx_CFunc_object____list____object____object___to_py) < 0) __PYX_ERR(4, 64, __pyx_L1_error) + __pyx_scope_struct____Pyx_CFunc_object____list____object____object___to_py.tp_print = 0; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_scope_struct____Pyx_CFunc_object____list____object____object___to_py.tp_dictoffset && __pyx_scope_struct____Pyx_CFunc_object____list____object____object___to_py.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_scope_struct____Pyx_CFunc_object____list____object____object___to_py.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + } + __pyx_ptype___pyx_scope_struct____Pyx_CFunc_object____list____object____object___to_py = &__pyx_scope_struct____Pyx_CFunc_object____list____object____object___to_py; + if (PyType_Ready(&__pyx_scope_struct____Pyx_CFunc_object____list____object___to_py) < 0) __PYX_ERR(4, 64, __pyx_L1_error) + __pyx_scope_struct____Pyx_CFunc_object____list____object___to_py.tp_print = 0; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_scope_struct____Pyx_CFunc_object____list____object___to_py.tp_dictoffset && __pyx_scope_struct____Pyx_CFunc_object____list____object___to_py.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_scope_struct____Pyx_CFunc_object____list____object___to_py.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + } + __pyx_ptype___pyx_scope_struct____Pyx_CFunc_object____list____object___to_py = &__pyx_scope_struct____Pyx_CFunc_object____list____object___to_py; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_modinit_type_import_code(void) { + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); + /*--- Type import code ---*/ + __pyx_t_1 = PyImport_ImportModule("weakref"); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 5, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_ptype_6gevent_7__ident_ref = __Pyx_ImportType(__pyx_t_1, "weakref", "ref", sizeof(PyWeakReference), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_7__ident_ref) __PYX_ERR(5, 5, __pyx_L1_error) + __pyx_t_2 = PyImport_ImportModule("gevent.__ident"); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 15, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_ptype_6gevent_7__ident_ValuedWeakRef = __Pyx_ImportType(__pyx_t_2, "gevent.__ident", "ValuedWeakRef", sizeof(struct __pyx_obj_6gevent_7__ident_ValuedWeakRef), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_7__ident_ValuedWeakRef) __PYX_ERR(5, 15, __pyx_L1_error) + __pyx_ptype_6gevent_7__ident_IdentRegistry = __Pyx_ImportType(__pyx_t_2, "gevent.__ident", "IdentRegistry", sizeof(struct __pyx_obj_6gevent_7__ident_IdentRegistry), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_7__ident_IdentRegistry) __PYX_ERR(5, 19, __pyx_L1_error) + __pyx_vtabptr_6gevent_7__ident_IdentRegistry = (struct __pyx_vtabstruct_6gevent_7__ident_IdentRegistry*)__Pyx_GetVtable(__pyx_ptype_6gevent_7__ident_IdentRegistry->tp_dict); if (unlikely(!__pyx_vtabptr_6gevent_7__ident_IdentRegistry)) __PYX_ERR(5, 19, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyImport_ImportModule("greenlet"); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_ptype_6gevent_21__greenlet_primitives_greenlet = __Pyx_ImportType(__pyx_t_2, "greenlet", "greenlet", sizeof(PyGreenlet), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_21__greenlet_primitives_greenlet) __PYX_ERR(2, 12, __pyx_L1_error) + __pyx_t_1 = PyImport_ImportModule("gevent.__greenlet_primitives"); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 37, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_ptype_6gevent_21__greenlet_primitives_TrackedRawGreenlet = __Pyx_ImportType(__pyx_t_1, "gevent.__greenlet_primitives", "TrackedRawGreenlet", sizeof(struct __pyx_obj_6gevent_21__greenlet_primitives_TrackedRawGreenlet), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_21__greenlet_primitives_TrackedRawGreenlet) __PYX_ERR(2, 37, __pyx_L1_error) + __pyx_ptype_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop = __Pyx_ImportType(__pyx_t_1, "gevent.__greenlet_primitives", "SwitchOutGreenletWithLoop", sizeof(struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop) __PYX_ERR(2, 40, __pyx_L1_error) + __pyx_vtabptr_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop = (struct __pyx_vtabstruct_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop*)__Pyx_GetVtable(__pyx_ptype_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop->tp_dict); if (unlikely(!__pyx_vtabptr_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop)) __PYX_ERR(2, 40, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyImport_ImportModule("greenlet"); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 15, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_ptype_6gevent_8__waiter_greenlet = __Pyx_ImportType(__pyx_t_1, "greenlet", "greenlet", sizeof(PyGreenlet), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_8__waiter_greenlet) __PYX_ERR(3, 15, __pyx_L1_error) + __pyx_t_2 = PyImport_ImportModule("gevent.__waiter"); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 33, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_ptype_6gevent_8__waiter_Waiter = __Pyx_ImportType(__pyx_t_2, "gevent.__waiter", "Waiter", sizeof(struct __pyx_obj_6gevent_8__waiter_Waiter), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_8__waiter_Waiter) __PYX_ERR(3, 33, __pyx_L1_error) + __pyx_vtabptr_6gevent_8__waiter_Waiter = (struct __pyx_vtabstruct_6gevent_8__waiter_Waiter*)__Pyx_GetVtable(__pyx_ptype_6gevent_8__waiter_Waiter->tp_dict); if (unlikely(!__pyx_vtabptr_6gevent_8__waiter_Waiter)) __PYX_ERR(3, 33, __pyx_L1_error) + __pyx_ptype_6gevent_8__waiter_MultipleWaiter = __Pyx_ImportType(__pyx_t_2, "gevent.__waiter", "MultipleWaiter", sizeof(struct __pyx_obj_6gevent_8__waiter_MultipleWaiter), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_8__waiter_MultipleWaiter) __PYX_ERR(3, 47, __pyx_L1_error) + __pyx_vtabptr_6gevent_8__waiter_MultipleWaiter = (struct __pyx_vtabstruct_6gevent_8__waiter_MultipleWaiter*)__Pyx_GetVtable(__pyx_ptype_6gevent_8__waiter_MultipleWaiter->tp_dict); if (unlikely(!__pyx_vtabptr_6gevent_8__waiter_MultipleWaiter)) __PYX_ERR(3, 47, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_modinit_variable_import_code(void) { + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); + /*--- Variable import code ---*/ + __pyx_t_1 = PyImport_ImportModule("gevent.__ident"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_1, "heappop", (void **)&__pyx_vp_6gevent_7__ident_heappop, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_1, "heappush", (void **)&__pyx_vp_6gevent_7__ident_heappush, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_1, "WeakKeyDictionary", (void **)&__pyx_vp_6gevent_7__ident_WeakKeyDictionary, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + Py_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_2 = PyImport_ImportModule("gevent.__greenlet_primitives"); if (!__pyx_t_2) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_2, "get_objects", (void **)&__pyx_vp_6gevent_21__greenlet_primitives_get_objects, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_2, "wref", (void **)&__pyx_vp_6gevent_21__greenlet_primitives_wref, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_2, "BlockingSwitchOutError", (void **)&__pyx_vp_6gevent_21__greenlet_primitives_BlockingSwitchOutError, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_2, "_greenlet_imported", (void **)&__pyx_vp_6gevent_21__greenlet_primitives__greenlet_imported, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + Py_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_3 = PyImport_ImportModule("gevent.__hub_local"); if (!__pyx_t_3) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_3, "_threadlocal", (void **)&__pyx_vp_6gevent_11__hub_local__threadlocal, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + Py_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_4 = PyImport_ImportModule("gevent.__waiter"); if (!__pyx_t_4) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_4, "sys", (void **)&__pyx_vp_6gevent_8__waiter_sys, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_4, "ConcurrentObjectUseError", (void **)&__pyx_vp_6gevent_8__waiter_ConcurrentObjectUseError, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_4, "_greenlet_imported", (void **)&__pyx_vp_6gevent_8__waiter__greenlet_imported, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_4, "_NONE", (void **)&__pyx_vp_6gevent_8__waiter__NONE, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + Py_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_modinit_function_import_code(void) { + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); + /*--- Function import code ---*/ + __pyx_t_1 = PyImport_ImportModule("gevent.__hub_local"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportFunction(__pyx_t_1, "get_hub_noargs", (void (**)(void))&__pyx_f_6gevent_11__hub_local_get_hub_noargs, "struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *(int __pyx_skip_dispatch)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + Py_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_RefNannyFinishContext(); + return -1; +} + + +#if PY_MAJOR_VERSION < 3 +#ifdef CYTHON_NO_PYINIT_EXPORT +#define __Pyx_PyMODINIT_FUNC void +#else +#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC +#endif +#else +#ifdef CYTHON_NO_PYINIT_EXPORT +#define __Pyx_PyMODINIT_FUNC PyObject * +#else +#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC +#endif +#endif + + +#if PY_MAJOR_VERSION < 3 +__Pyx_PyMODINIT_FUNC init_greenlet(void) CYTHON_SMALL_CODE; /*proto*/ +__Pyx_PyMODINIT_FUNC init_greenlet(void) +#else +__Pyx_PyMODINIT_FUNC PyInit__greenlet(void) CYTHON_SMALL_CODE; /*proto*/ +__Pyx_PyMODINIT_FUNC PyInit__greenlet(void) +#if CYTHON_PEP489_MULTI_PHASE_INIT +{ + return PyModuleDef_Init(&__pyx_moduledef); +} +static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { + #if PY_VERSION_HEX >= 0x030700A1 + static PY_INT64_T main_interpreter_id = -1; + PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); + if (main_interpreter_id == -1) { + main_interpreter_id = current_id; + return (unlikely(current_id == -1)) ? -1 : 0; + } else if (unlikely(main_interpreter_id != current_id)) + #else + static PyInterpreterState *main_interpreter = NULL; + PyInterpreterState *current_interpreter = PyThreadState_Get()->interp; + if (!main_interpreter) { + main_interpreter = current_interpreter; + } else if (unlikely(main_interpreter != current_interpreter)) + #endif + { + PyErr_SetString( + PyExc_ImportError, + "Interpreter change detected - this module can only be loaded into one interpreter per process."); + return -1; + } + return 0; +} +static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) { + PyObject *value = PyObject_GetAttrString(spec, from_name); + int result = 0; + if (likely(value)) { + if (allow_none || value != Py_None) { + result = PyDict_SetItemString(moddict, to_name, value); + } + Py_DECREF(value); + } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_Clear(); + } else { + result = -1; + } + return result; +} +static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) { + PyObject *module = NULL, *moddict, *modname; + if (__Pyx_check_single_interpreter()) + return NULL; + if (__pyx_m) + return __Pyx_NewRef(__pyx_m); + modname = PyObject_GetAttrString(spec, "name"); + if (unlikely(!modname)) goto bad; + module = PyModule_NewObject(modname); + Py_DECREF(modname); + if (unlikely(!module)) goto bad; + moddict = PyModule_GetDict(module); + if (unlikely(!moddict)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad; + return module; +bad: + Py_XDECREF(module); + return NULL; +} + + +static CYTHON_SMALL_CODE int __pyx_pymod_exec__greenlet(PyObject *__pyx_pyinit_module) +#endif +#endif +{ + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + int __pyx_t_9; + __Pyx_RefNannyDeclarations + #if CYTHON_PEP489_MULTI_PHASE_INIT + if (__pyx_m) { + if (__pyx_m == __pyx_pyinit_module) return 0; + PyErr_SetString(PyExc_RuntimeError, "Module '_greenlet' has already been imported. Re-initialisation is not supported."); + return -1; + } + #elif PY_MAJOR_VERSION >= 3 + if (__pyx_m) return __Pyx_NewRef(__pyx_m); + #endif + #if CYTHON_REFNANNY +__Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); +if (!__Pyx_RefNanny) { + PyErr_Clear(); + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); + if (!__Pyx_RefNanny) + Py_FatalError("failed to import 'refnanny' module"); +} +#endif + __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit__greenlet(void)", 0); + if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #ifdef __Pxy_PyFrame_Initialize_Offsets + __Pxy_PyFrame_Initialize_Offsets(); + #endif + __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) + #ifdef __Pyx_CyFunction_USED + if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_FusedFunction_USED + if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_Coroutine_USED + if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_Generator_USED + if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_AsyncGen_USED + if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_StopAsyncIteration_USED + if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + /*--- Library function declarations ---*/ + /*--- Threads initialization code ---*/ + #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS + #ifdef WITH_THREAD /* Python build with threading support? */ + PyEval_InitThreads(); + #endif + #endif + /*--- Module creation code ---*/ + #if CYTHON_PEP489_MULTI_PHASE_INIT + __pyx_m = __pyx_pyinit_module; + Py_INCREF(__pyx_m); + #else + #if PY_MAJOR_VERSION < 3 + __pyx_m = Py_InitModule4("_greenlet", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); + #else + __pyx_m = PyModule_Create(&__pyx_moduledef); + #endif + if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) + Py_INCREF(__pyx_d); + __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) + #if CYTHON_COMPILING_IN_PYPY + Py_INCREF(__pyx_b); + #endif + if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + /*--- Initialize various global constants etc. ---*/ + if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) + if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + if (__pyx_module_is_main_gevent___greenlet) { + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + } + #if PY_MAJOR_VERSION >= 3 + { + PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) + if (!PyDict_GetItemString(modules, "gevent._greenlet")) { + if (unlikely(PyDict_SetItemString(modules, "gevent._greenlet", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error) + } + } + #endif + /*--- Builtin init code ---*/ + if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + /*--- Constants init code ---*/ + if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + /*--- Global type/function init code ---*/ + (void)__Pyx_modinit_global_init_code(); + if (unlikely(__Pyx_modinit_variable_export_code() != 0)) goto __pyx_L1_error; + if (unlikely(__Pyx_modinit_function_export_code() != 0)) goto __pyx_L1_error; + if (unlikely(__Pyx_modinit_type_init_code() != 0)) goto __pyx_L1_error; + if (unlikely(__Pyx_modinit_type_import_code() != 0)) goto __pyx_L1_error; + if (unlikely(__Pyx_modinit_variable_import_code() != 0)) goto __pyx_L1_error; + if (unlikely(__Pyx_modinit_function_import_code() != 0)) goto __pyx_L1_error; + /*--- Execution code ---*/ + #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) + if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + + /* "src/gevent/greenlet.py":6 + * from __future__ import absolute_import, print_function, division + * + * from sys import _getframe as sys_getframe # <<<<<<<<<<<<<< + * from sys import exc_info as sys_exc_info + * from weakref import ref as wref + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_getframe); + __Pyx_GIVEREF(__pyx_n_s_getframe); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_getframe); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_sys, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_getframe); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_v_6gevent_9_greenlet_sys_getframe); + __Pyx_DECREF_SET(__pyx_v_6gevent_9_greenlet_sys_getframe, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/greenlet.py":7 + * + * from sys import _getframe as sys_getframe + * from sys import exc_info as sys_exc_info # <<<<<<<<<<<<<< + * from weakref import ref as wref + * + */ + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_exc_info); + __Pyx_GIVEREF(__pyx_n_s_exc_info); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_exc_info); + __pyx_t_1 = __Pyx_Import(__pyx_n_s_sys, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_exc_info); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_v_6gevent_9_greenlet_sys_exc_info); + __Pyx_DECREF_SET(__pyx_v_6gevent_9_greenlet_sys_exc_info, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/greenlet.py":8 + * from sys import _getframe as sys_getframe + * from sys import exc_info as sys_exc_info + * from weakref import ref as wref # <<<<<<<<<<<<<< + * + * # XXX: How to get cython to let us rename this as RawGreenlet + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 8, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_ref); + __Pyx_GIVEREF(__pyx_n_s_ref); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_ref); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_weakref, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_ref); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 8, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_v_6gevent_9_greenlet_wref); + __Pyx_DECREF_SET(__pyx_v_6gevent_9_greenlet_wref, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/greenlet.py":12 + * # XXX: How to get cython to let us rename this as RawGreenlet + * # like we prefer? + * from greenlet import greenlet # <<<<<<<<<<<<<< + * from greenlet import GreenletExit + * + */ + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_greenlet); + __Pyx_GIVEREF(__pyx_n_s_greenlet); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_greenlet); + __pyx_t_1 = __Pyx_Import(__pyx_n_s_greenlet, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/greenlet.py":13 + * # like we prefer? + * from greenlet import greenlet + * from greenlet import GreenletExit # <<<<<<<<<<<<<< + * + * from gevent._compat import reraise + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_GreenletExit); + __Pyx_GIVEREF(__pyx_n_s_GreenletExit); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_GreenletExit); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_greenlet, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_GreenletExit); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_v_6gevent_9_greenlet_GreenletExit); + __Pyx_DECREF_SET(__pyx_v_6gevent_9_greenlet_GreenletExit, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/greenlet.py":15 + * from greenlet import GreenletExit + * + * from gevent._compat import reraise # <<<<<<<<<<<<<< + * from gevent._compat import PYPY as _PYPY + * from gevent._tblib import dump_traceback + */ + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 15, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_reraise); + __Pyx_GIVEREF(__pyx_n_s_reraise); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_reraise); + __pyx_t_1 = __Pyx_Import(__pyx_n_s_gevent__compat, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 15, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_reraise); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 15, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_v_6gevent_9_greenlet_reraise); + __Pyx_DECREF_SET(__pyx_v_6gevent_9_greenlet_reraise, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/greenlet.py":16 + * + * from gevent._compat import reraise + * from gevent._compat import PYPY as _PYPY # <<<<<<<<<<<<<< + * from gevent._tblib import dump_traceback + * from gevent._tblib import load_traceback + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 16, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_PYPY_2); + __Pyx_GIVEREF(__pyx_n_s_PYPY_2); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_PYPY_2); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_gevent__compat, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 16, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_PYPY_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 16, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 16, __pyx_L1_error) + __pyx_v_6gevent_9_greenlet__PYPY = __pyx_t_3; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/greenlet.py":17 + * from gevent._compat import reraise + * from gevent._compat import PYPY as _PYPY + * from gevent._tblib import dump_traceback # <<<<<<<<<<<<<< + * from gevent._tblib import load_traceback + * + */ + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 17, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_dump_traceback); + __Pyx_GIVEREF(__pyx_n_s_dump_traceback); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_dump_traceback); + __pyx_t_1 = __Pyx_Import(__pyx_n_s_gevent__tblib, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 17, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_dump_traceback); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 17, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_v_6gevent_9_greenlet_dump_traceback); + __Pyx_DECREF_SET(__pyx_v_6gevent_9_greenlet_dump_traceback, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/greenlet.py":18 + * from gevent._compat import PYPY as _PYPY + * from gevent._tblib import dump_traceback + * from gevent._tblib import load_traceback # <<<<<<<<<<<<<< + * + * from gevent.exceptions import InvalidSwitchError + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 18, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_load_traceback); + __Pyx_GIVEREF(__pyx_n_s_load_traceback); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_load_traceback); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_gevent__tblib, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 18, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_load_traceback); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 18, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_v_6gevent_9_greenlet_load_traceback); + __Pyx_DECREF_SET(__pyx_v_6gevent_9_greenlet_load_traceback, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/greenlet.py":20 + * from gevent._tblib import load_traceback + * + * from gevent.exceptions import InvalidSwitchError # <<<<<<<<<<<<<< + * + * from gevent._hub_primitives import iwait_on_objects as iwait + */ + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 20, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_InvalidSwitchError); + __Pyx_GIVEREF(__pyx_n_s_InvalidSwitchError); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_InvalidSwitchError); + __pyx_t_1 = __Pyx_Import(__pyx_n_s_gevent_exceptions, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 20, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_InvalidSwitchError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 20, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_v_6gevent_9_greenlet_InvalidSwitchError); + __Pyx_DECREF_SET(__pyx_v_6gevent_9_greenlet_InvalidSwitchError, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/greenlet.py":22 + * from gevent.exceptions import InvalidSwitchError + * + * from gevent._hub_primitives import iwait_on_objects as iwait # <<<<<<<<<<<<<< + * from gevent._hub_primitives import wait_on_objects as wait + * + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 22, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_iwait_on_objects); + __Pyx_GIVEREF(__pyx_n_s_iwait_on_objects); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_iwait_on_objects); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_gevent__hub_primitives, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 22, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_iwait_on_objects); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 22, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_v_6gevent_9_greenlet_iwait); + __Pyx_DECREF_SET(__pyx_v_6gevent_9_greenlet_iwait, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/greenlet.py":23 + * + * from gevent._hub_primitives import iwait_on_objects as iwait + * from gevent._hub_primitives import wait_on_objects as wait # <<<<<<<<<<<<<< + * + * from gevent.timeout import Timeout + */ + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 23, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_wait_on_objects); + __Pyx_GIVEREF(__pyx_n_s_wait_on_objects); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_wait_on_objects); + __pyx_t_1 = __Pyx_Import(__pyx_n_s_gevent__hub_primitives, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 23, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_wait_on_objects); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 23, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_v_6gevent_9_greenlet_wait); + __Pyx_DECREF_SET(__pyx_v_6gevent_9_greenlet_wait, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/greenlet.py":25 + * from gevent._hub_primitives import wait_on_objects as wait + * + * from gevent.timeout import Timeout # <<<<<<<<<<<<<< + * + * from gevent._config import config as GEVENT_CONFIG + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 25, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_Timeout); + __Pyx_GIVEREF(__pyx_n_s_Timeout); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_Timeout); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_gevent_timeout, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 25, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_Timeout); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 25, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_v_6gevent_9_greenlet_Timeout); + __Pyx_DECREF_SET(__pyx_v_6gevent_9_greenlet_Timeout, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/greenlet.py":27 + * from gevent.timeout import Timeout + * + * from gevent._config import config as GEVENT_CONFIG # <<<<<<<<<<<<<< + * from gevent._util import Lazy + * from gevent._util import readproperty + */ + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 27, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_config); + __Pyx_GIVEREF(__pyx_n_s_config); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_config); + __pyx_t_1 = __Pyx_Import(__pyx_n_s_gevent__config, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 27, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_config); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 27, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_v_6gevent_9_greenlet_GEVENT_CONFIG); + __Pyx_DECREF_SET(__pyx_v_6gevent_9_greenlet_GEVENT_CONFIG, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/greenlet.py":28 + * + * from gevent._config import config as GEVENT_CONFIG + * from gevent._util import Lazy # <<<<<<<<<<<<<< + * from gevent._util import readproperty + * from gevent._hub_local import get_hub_noargs as get_hub + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 28, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_Lazy); + __Pyx_GIVEREF(__pyx_n_s_Lazy); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_Lazy); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_gevent__util, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 28, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_Lazy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 28, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_Lazy, __pyx_t_1) < 0) __PYX_ERR(0, 28, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/greenlet.py":29 + * from gevent._config import config as GEVENT_CONFIG + * from gevent._util import Lazy + * from gevent._util import readproperty # <<<<<<<<<<<<<< + * from gevent._hub_local import get_hub_noargs as get_hub + * from gevent import _waiter + */ + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 29, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_readproperty); + __Pyx_GIVEREF(__pyx_n_s_readproperty); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_readproperty); + __pyx_t_1 = __Pyx_Import(__pyx_n_s_gevent__util, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 29, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_readproperty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 29, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_readproperty, __pyx_t_2) < 0) __PYX_ERR(0, 29, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/greenlet.py":30 + * from gevent._util import Lazy + * from gevent._util import readproperty + * from gevent._hub_local import get_hub_noargs as get_hub # <<<<<<<<<<<<<< + * from gevent import _waiter + * + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 30, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_get_hub_noargs); + __Pyx_GIVEREF(__pyx_n_s_get_hub_noargs); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_get_hub_noargs); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_gevent__hub_local, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 30, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_get_hub_noargs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 30, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_hub_noargs, __pyx_t_1) < 0) __PYX_ERR(0, 30, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/greenlet.py":31 + * from gevent._util import readproperty + * from gevent._hub_local import get_hub_noargs as get_hub + * from gevent import _waiter # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 31, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_waiter_2); + __Pyx_GIVEREF(__pyx_n_s_waiter_2); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_waiter_2); + __pyx_t_1 = __Pyx_Import(__pyx_n_s_gevent, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 31, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_waiter_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 31, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_waiter_2, __pyx_t_2) < 0) __PYX_ERR(0, 31, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/greenlet.py":34 + * + * + * __all__ = [ # <<<<<<<<<<<<<< + * 'Greenlet', + * 'joinall', + */ + __pyx_t_1 = PyList_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 34, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_Greenlet); + __Pyx_GIVEREF(__pyx_n_s_Greenlet); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_Greenlet); + __Pyx_INCREF(__pyx_n_s_joinall); + __Pyx_GIVEREF(__pyx_n_s_joinall); + PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_joinall); + __Pyx_INCREF(__pyx_n_s_killall); + __Pyx_GIVEREF(__pyx_n_s_killall); + PyList_SET_ITEM(__pyx_t_1, 2, __pyx_n_s_killall); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_all, __pyx_t_1) < 0) __PYX_ERR(0, 34, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/greenlet.py":45 + * # is assignment) without generating a 'lvalue is not valid target' + * # error. + * locals()['getcurrent'] = __import__('greenlet').getcurrent # <<<<<<<<<<<<<< + * locals()['greenlet_init'] = lambda: None + * locals()['Waiter'] = _waiter.Waiter + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin___import__, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 45, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_getcurrent); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 45, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_Globals(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 45, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (unlikely(PyDict_SetItem(__pyx_t_1, __pyx_n_s_getcurrent, __pyx_t_2) < 0)) __PYX_ERR(0, 45, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/greenlet.py":46 + * # error. + * locals()['getcurrent'] = __import__('greenlet').getcurrent + * locals()['greenlet_init'] = lambda: None # <<<<<<<<<<<<<< + * locals()['Waiter'] = _waiter.Waiter + * + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_9_greenlet_6lambda, 0, __pyx_n_s_lambda, NULL, __pyx_n_s_gevent__greenlet, __pyx_d, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 46, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_Globals(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 46, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (unlikely(PyDict_SetItem(__pyx_t_1, __pyx_n_s_greenlet_init, __pyx_t_2) < 0)) __PYX_ERR(0, 46, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/greenlet.py":47 + * locals()['getcurrent'] = __import__('greenlet').getcurrent + * locals()['greenlet_init'] = lambda: None + * locals()['Waiter'] = _waiter.Waiter # <<<<<<<<<<<<<< + * + * + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_waiter_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 47, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_Waiter); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 47, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_Globals(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 47, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (unlikely(PyDict_SetItem(__pyx_t_2, __pyx_n_s_Waiter, __pyx_t_1) < 0)) __PYX_ERR(0, 47, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/greenlet.py":50 + * + * + * if _PYPY: # <<<<<<<<<<<<<< + * import _continuation # pylint:disable=import-error + * _continulet = _continuation.continulet + */ + __pyx_t_3 = (__pyx_v_6gevent_9_greenlet__PYPY != 0); + if (__pyx_t_3) { + + /* "src/gevent/greenlet.py":51 + * + * if _PYPY: + * import _continuation # pylint:disable=import-error # <<<<<<<<<<<<<< + * _continulet = _continuation.continulet + * + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_continuation, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 51, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_continuation, __pyx_t_1) < 0) __PYX_ERR(0, 51, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/greenlet.py":52 + * if _PYPY: + * import _continuation # pylint:disable=import-error + * _continulet = _continuation.continulet # <<<<<<<<<<<<<< + * + * + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_continuation); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 52, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_continulet); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 52, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_continulet_2, __pyx_t_2) < 0) __PYX_ERR(0, 52, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/greenlet.py":50 + * + * + * if _PYPY: # <<<<<<<<<<<<<< + * import _continuation # pylint:disable=import-error + * _continulet = _continuation.continulet + */ + } + + /* "src/gevent/greenlet.py":61 + * Can be called only from main loop. + * """ + * __slots__ = ['callback'] # <<<<<<<<<<<<<< + * + * def __init__(self, callback): + */ + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 61, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_callback); + __Pyx_GIVEREF(__pyx_n_s_callback); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_callback); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet_SpawnedLink->tp_dict, __pyx_n_s_slots, __pyx_t_2) < 0) __PYX_ERR(0, 61, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_9_greenlet_SpawnedLink); + + /* "src/gevent/greenlet.py":94 + * Can be called only from main loop. + * """ + * __slots__ = [] # <<<<<<<<<<<<<< + * + * def __call__(self, source): + */ + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 94, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet_SuccessSpawnedLink->tp_dict, __pyx_n_s_slots, __pyx_t_2) < 0) __PYX_ERR(0, 94, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_9_greenlet_SuccessSpawnedLink); + + /* "src/gevent/greenlet.py":106 + * Can be called only from main loop. + * """ + * __slots__ = [] # <<<<<<<<<<<<<< + * + * def __call__(self, source): + */ + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 106, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet_FailureSpawnedLink->tp_dict, __pyx_n_s_slots, __pyx_t_2) < 0) __PYX_ERR(0, 106, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_9_greenlet_FailureSpawnedLink); + + /* "src/gevent/greenlet.py":114 + * class _Frame(object): + * + * __slots__ = ('f_code', 'f_lineno', 'f_back') # <<<<<<<<<<<<<< + * + * def __init__(self, f_code, f_lineno, f_back): + */ + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet__Frame->tp_dict, __pyx_n_s_slots, __pyx_tuple__22) < 0) __PYX_ERR(0, 114, __pyx_L1_error) + PyType_Modified(__pyx_ptype_6gevent_9_greenlet__Frame); + + /* "src/gevent/greenlet.py":155 + * + * + * _greenlet__init__ = greenlet.__init__ # <<<<<<<<<<<<<< + * + * class Greenlet(greenlet): + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_6gevent_9_greenlet_greenlet), __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 155, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_v_6gevent_9_greenlet__greenlet__init__); + __Pyx_DECREF_SET(__pyx_v_6gevent_9_greenlet__greenlet__init__, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + + /* "src/gevent/greenlet.py":163 + * # pylint:disable=too-many-public-methods,too-many-instance-attributes + * + * spawning_stack_limit = 10 # <<<<<<<<<<<<<< + * + * # pylint:disable=keyword-arg-before-vararg,super-init-not-called + */ + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet->tp_dict, __pyx_n_s_spawning_stack_limit, __pyx_int_10) < 0) __PYX_ERR(0, 163, __pyx_L1_error) + PyType_Modified(__pyx_ptype_6gevent_9_greenlet_Greenlet); + + /* "src/gevent/greenlet.py":268 + * + * @Lazy + * def spawning_stack(self): # <<<<<<<<<<<<<< + * # Store this in the __dict__. We don't use it from the C + * # code. It's tempting to discard _spawning_stack_frames + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_9_greenlet_8Greenlet_3spawning_stack, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Greenlet_spawning_stack, NULL, __pyx_n_s_gevent__greenlet, __pyx_d, ((PyObject *)__pyx_codeobj__24)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 268, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet->tp_dict, __pyx_n_s_spawning_stack, __pyx_t_2) < 0) __PYX_ERR(0, 268, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_9_greenlet_Greenlet); + + /* "src/gevent/greenlet.py":267 + * self._spawning_stack_frames = None + * + * @Lazy # <<<<<<<<<<<<<< + * def spawning_stack(self): + * # Store this in the __dict__. We don't use it from the C + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Lazy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 267, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + + /* "src/gevent/greenlet.py":268 + * + * @Lazy + * def spawning_stack(self): # <<<<<<<<<<<<<< + * # Store this in the __dict__. We don't use it from the C + * # code. It's tempting to discard _spawning_stack_frames + */ + __Pyx_GetNameInClass(__pyx_t_4, (PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet, __pyx_n_s_spawning_stack); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 268, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_1, function); + } + } + __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 267, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet->tp_dict, __pyx_n_s_spawning_stack, __pyx_t_2) < 0) __PYX_ERR(0, 268, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_9_greenlet_Greenlet); + + /* "src/gevent/greenlet.py":301 + * + * @readproperty + * def name(self): # <<<<<<<<<<<<<< + * """ + * The greenlet name. By default, a unique name is constructed using + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_9_greenlet_8Greenlet_5name, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Greenlet_name, NULL, __pyx_n_s_gevent__greenlet, __pyx_d, ((PyObject *)__pyx_codeobj__26)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 301, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet->tp_dict, __pyx_n_s_name_2, __pyx_t_2) < 0) __PYX_ERR(0, 301, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_9_greenlet_Greenlet); + + /* "src/gevent/greenlet.py":300 + * return self._ident + * + * @readproperty # <<<<<<<<<<<<<< + * def name(self): + * """ + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_readproperty); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 300, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + + /* "src/gevent/greenlet.py":301 + * + * @readproperty + * def name(self): # <<<<<<<<<<<<<< + * """ + * The greenlet name. By default, a unique name is constructed using + */ + __Pyx_GetNameInClass(__pyx_t_4, (PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet, __pyx_n_s_name_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 301, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_1, function); + } + } + __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 300, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet->tp_dict, __pyx_n_s_name_2, __pyx_t_2) < 0) __PYX_ERR(0, 301, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_9_greenlet_Greenlet); + + /* "src/gevent/greenlet.py":316 + * return 'Greenlet-%d' % (self.minimal_ident,) + * + * def _raise_exception(self): # <<<<<<<<<<<<<< + * reraise(*self.exc_info) + * + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_9_greenlet_8Greenlet_7_raise_exception, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Greenlet__raise_exception, NULL, __pyx_n_s_gevent__greenlet, __pyx_d, ((PyObject *)__pyx_codeobj__28)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 316, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet->tp_dict, __pyx_n_s_raise_exception, __pyx_t_2) < 0) __PYX_ERR(0, 316, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_9_greenlet_Greenlet); + + /* "src/gevent/greenlet.py":326 + * def __nonzero__(self): + * return self._start_event is not None and self._exc_info is None + * try: # <<<<<<<<<<<<<< + * __bool__ = __nonzero__ # Python 3 + * except NameError: # pragma: no cover + */ + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); + __Pyx_XGOTREF(__pyx_t_6); + __Pyx_XGOTREF(__pyx_t_7); + __Pyx_XGOTREF(__pyx_t_8); + /*try:*/ { + + /* "src/gevent/greenlet.py":327 + * return self._start_event is not None and self._exc_info is None + * try: + * __bool__ = __nonzero__ # Python 3 # <<<<<<<<<<<<<< + * except NameError: # pragma: no cover + * # When we're compiled with Cython, the __nonzero__ function + */ + __Pyx_GetNameInClass(__pyx_t_2, (PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet, __pyx_n_s_nonzero); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 327, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet->tp_dict, __pyx_n_s_bool, __pyx_t_2) < 0) __PYX_ERR(0, 327, __pyx_L3_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_9_greenlet_Greenlet); + + /* "src/gevent/greenlet.py":326 + * def __nonzero__(self): + * return self._start_event is not None and self._exc_info is None + * try: # <<<<<<<<<<<<<< + * __bool__ = __nonzero__ # Python 3 + * except NameError: # pragma: no cover + */ + } + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + goto __pyx_L8_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/greenlet.py":328 + * try: + * __bool__ = __nonzero__ # Python 3 + * except NameError: # pragma: no cover # <<<<<<<<<<<<<< + * # When we're compiled with Cython, the __nonzero__ function + * # goes directly into the slot and can't be accessed by name. + */ + __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_NameError); + if (__pyx_t_9) { + __Pyx_ErrRestore(0,0,0); + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + + /* "src/gevent/greenlet.py":326 + * def __nonzero__(self): + * return self._start_event is not None and self._exc_info is None + * try: # <<<<<<<<<<<<<< + * __bool__ = __nonzero__ # Python 3 + * except NameError: # pragma: no cover + */ + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); + goto __pyx_L1_error; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); + __pyx_L8_try_end:; + } + + /* "src/gevent/greenlet.py":335 + * ### Lifecycle + * + * if _PYPY: # <<<<<<<<<<<<<< + * # oops - pypy's .dead relies on __nonzero__ which we overriden above + * @property + */ + __pyx_t_3 = (__pyx_v_6gevent_9_greenlet__PYPY != 0); + if (__pyx_t_3) { + + /* "src/gevent/greenlet.py":348 + * else: + * @property + * def dead(self): # <<<<<<<<<<<<<< + * "Boolean indicating that the greenlet is dead and will not run again." + * return self.__start_cancelled_by_kill() or self.__started_but_aborted() or greenlet.dead.__get__(self) + */ + goto __pyx_L9; + } + /*else*/ { + } + __pyx_L9:; + + /* "src/gevent/greenlet.py":407 + * return bool(self) + * + * def ready(self): # <<<<<<<<<<<<<< + * """ + * Return a true value if and only if the greenlet has finished + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_9_greenlet_8Greenlet_11ready, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Greenlet_ready, NULL, __pyx_n_s_gevent__greenlet, __pyx_d, ((PyObject *)__pyx_codeobj__30)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 407, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet->tp_dict, __pyx_n_s_ready, __pyx_t_2) < 0) __PYX_ERR(0, 407, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_9_greenlet_Greenlet); + + /* "src/gevent/greenlet.py":418 + * return self.dead or self._exc_info is not None + * + * def successful(self): # <<<<<<<<<<<<<< + * """ + * Return a true value if and only if the greenlet has finished execution + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_9_greenlet_8Greenlet_13successful, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Greenlet_successful, NULL, __pyx_n_s_gevent__greenlet, __pyx_d, ((PyObject *)__pyx_codeobj__32)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 418, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet->tp_dict, __pyx_n_s_successful, __pyx_t_2) < 0) __PYX_ERR(0, 418, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_9_greenlet_Greenlet); + + /* "src/gevent/greenlet.py":448 + * + * + * def _formatinfo(self): # <<<<<<<<<<<<<< + * info = self._formatted_info + * if info is not None: + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_9_greenlet_8Greenlet_17_formatinfo, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Greenlet__formatinfo, NULL, __pyx_n_s_gevent__greenlet, __pyx_d, ((PyObject *)__pyx_codeobj__34)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 448, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet->tp_dict, __pyx_n_s_formatinfo, __pyx_t_2) < 0) __PYX_ERR(0, 448, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_9_greenlet_Greenlet); + + /* "src/gevent/greenlet.py":498 + * return (ei[0], ei[1], load_traceback(ei[2])) + * + * def throw(self, *args): # <<<<<<<<<<<<<< + * """Immediately switch into the greenlet and raise an exception in it. + * + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_9_greenlet_8Greenlet_19throw, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Greenlet_throw, NULL, __pyx_n_s_gevent__greenlet, __pyx_d, ((PyObject *)__pyx_codeobj__36)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 498, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet->tp_dict, __pyx_n_s_throw, __pyx_t_2) < 0) __PYX_ERR(0, 498, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_9_greenlet_Greenlet); + + /* "src/gevent/greenlet.py":520 + * self.__handle_death_before_start(args) + * + * def start(self): # <<<<<<<<<<<<<< + * """Schedule the greenlet to run in this loop iteration""" + * if self._start_event is None: + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_9_greenlet_8Greenlet_21start, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Greenlet_start, NULL, __pyx_n_s_gevent__greenlet, __pyx_d, ((PyObject *)__pyx_codeobj__38)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 520, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet->tp_dict, __pyx_n_s_start, __pyx_t_2) < 0) __PYX_ERR(0, 520, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_9_greenlet_Greenlet); + + /* "src/gevent/greenlet.py":526 + * self._start_event = self.parent.loop.run_callback(self.switch) + * + * def start_later(self, seconds): # <<<<<<<<<<<<<< + * """ + * start_later(seconds) -> None + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_9_greenlet_8Greenlet_23start_later, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Greenlet_start_later, NULL, __pyx_n_s_gevent__greenlet, __pyx_d, ((PyObject *)__pyx_codeobj__40)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 526, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet->tp_dict, __pyx_n_s_start_later, __pyx_t_2) < 0) __PYX_ERR(0, 526, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_9_greenlet_Greenlet); + + /* "src/gevent/greenlet.py":539 + * + * @staticmethod + * def add_spawn_callback(callback): # <<<<<<<<<<<<<< + * """ + * add_spawn_callback(callback) -> None + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_9_greenlet_8Greenlet_25add_spawn_callback, __Pyx_CYFUNCTION_STATICMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Greenlet_add_spawn_callback, NULL, __pyx_n_s_gevent__greenlet, __pyx_d, ((PyObject *)__pyx_codeobj__42)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 539, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet->tp_dict, __pyx_n_s_add_spawn_callback, __pyx_t_2) < 0) __PYX_ERR(0, 539, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_9_greenlet_Greenlet); + + /* "src/gevent/greenlet.py":538 + * self._start_event.start(self.switch) + * + * @staticmethod # <<<<<<<<<<<<<< + * def add_spawn_callback(callback): + * """ + */ + __Pyx_GetNameInClass(__pyx_t_2, (PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet, __pyx_n_s_add_spawn_callback); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 539, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_staticmethod, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 538, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet->tp_dict, __pyx_n_s_add_spawn_callback, __pyx_t_1) < 0) __PYX_ERR(0, 539, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + PyType_Modified(__pyx_ptype_6gevent_9_greenlet_Greenlet); + + /* "src/gevent/greenlet.py":558 + * + * @staticmethod + * def remove_spawn_callback(callback): # <<<<<<<<<<<<<< + * """ + * remove_spawn_callback(callback) -> None + */ + __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_9_greenlet_8Greenlet_27remove_spawn_callback, __Pyx_CYFUNCTION_STATICMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Greenlet_remove_spawn_callback, NULL, __pyx_n_s_gevent__greenlet, __pyx_d, ((PyObject *)__pyx_codeobj__44)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 558, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet->tp_dict, __pyx_n_s_remove_spawn_callback, __pyx_t_1) < 0) __PYX_ERR(0, 558, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + PyType_Modified(__pyx_ptype_6gevent_9_greenlet_Greenlet); + + /* "src/gevent/greenlet.py":557 + * _spawn_callbacks.add(callback) + * + * @staticmethod # <<<<<<<<<<<<<< + * def remove_spawn_callback(callback): + * """ + */ + __Pyx_GetNameInClass(__pyx_t_1, (PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet, __pyx_n_s_remove_spawn_callback); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 558, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_staticmethod, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 557, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet->tp_dict, __pyx_n_s_remove_spawn_callback, __pyx_t_2) < 0) __PYX_ERR(0, 558, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_9_greenlet_Greenlet); + + /* "src/gevent/greenlet.py":575 + * + * @classmethod + * def spawn(cls, *args, **kwargs): # <<<<<<<<<<<<<< + * """ + * spawn(function, *args, **kwargs) -> Greenlet + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_9_greenlet_8Greenlet_29spawn, __Pyx_CYFUNCTION_CLASSMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Greenlet_spawn, NULL, __pyx_n_s_gevent__greenlet, __pyx_d, ((PyObject *)__pyx_codeobj__46)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 575, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet->tp_dict, __pyx_n_s_spawn, __pyx_t_2) < 0) __PYX_ERR(0, 575, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_9_greenlet_Greenlet); + + /* "src/gevent/greenlet.py":574 + * _spawn_callbacks = None + * + * @classmethod # <<<<<<<<<<<<<< + * def spawn(cls, *args, **kwargs): + * """ + */ + __Pyx_GetNameInClass(__pyx_t_2, (PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet, __pyx_n_s_spawn); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 575, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_Method_ClassMethod(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 574, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet->tp_dict, __pyx_n_s_spawn, __pyx_t_1) < 0) __PYX_ERR(0, 575, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + PyType_Modified(__pyx_ptype_6gevent_9_greenlet_Greenlet); + + /* "src/gevent/greenlet.py":593 + * + * @classmethod + * def spawn_later(cls, seconds, *args, **kwargs): # <<<<<<<<<<<<<< + * """ + * spawn_later(seconds, function, *args, **kwargs) -> Greenlet + */ + __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_9_greenlet_8Greenlet_31spawn_later, __Pyx_CYFUNCTION_CLASSMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Greenlet_spawn_later, NULL, __pyx_n_s_gevent__greenlet, __pyx_d, ((PyObject *)__pyx_codeobj__48)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 593, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet->tp_dict, __pyx_n_s_spawn_later, __pyx_t_1) < 0) __PYX_ERR(0, 593, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + PyType_Modified(__pyx_ptype_6gevent_9_greenlet_Greenlet); + + /* "src/gevent/greenlet.py":592 + * return g + * + * @classmethod # <<<<<<<<<<<<<< + * def spawn_later(cls, seconds, *args, **kwargs): + * """ + */ + __Pyx_GetNameInClass(__pyx_t_1, (PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet, __pyx_n_s_spawn_later); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 593, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_Method_ClassMethod(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 592, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet->tp_dict, __pyx_n_s_spawn_later, __pyx_t_2) < 0) __PYX_ERR(0, 593, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_9_greenlet_Greenlet); + + /* "src/gevent/greenlet.py":615 + * return g + * + * def kill(self, exception=GreenletExit, block=True, timeout=None): # <<<<<<<<<<<<<< + * """ + * Raise the ``exception`` in the greenlet. + */ + __Pyx_INCREF(__pyx_v_6gevent_9_greenlet_GreenletExit); + __pyx_k__10 = __pyx_v_6gevent_9_greenlet_GreenletExit; + __Pyx_GIVEREF(__pyx_v_6gevent_9_greenlet_GreenletExit); + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_9_greenlet_8Greenlet_33kill, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Greenlet_kill, NULL, __pyx_n_s_gevent__greenlet, __pyx_d, ((PyObject *)__pyx_codeobj__50)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 615, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet->tp_dict, __pyx_n_s_kill_2, __pyx_t_2) < 0) __PYX_ERR(0, 615, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_9_greenlet_Greenlet); + + /* "src/gevent/greenlet.py":667 + * # thus it should not raise when the greenlet is already killed (= not started) + * + * def get(self, block=True, timeout=None): # <<<<<<<<<<<<<< + * """ + * get(block=True, timeout=None) -> object + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_9_greenlet_8Greenlet_35get, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Greenlet_get, NULL, __pyx_n_s_gevent__greenlet, __pyx_d, ((PyObject *)__pyx_codeobj__52)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 667, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet->tp_dict, __pyx_n_s_get_2, __pyx_t_2) < 0) __PYX_ERR(0, 667, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_9_greenlet_Greenlet); + + /* "src/gevent/greenlet.py":711 + * self._raise_exception() + * + * def join(self, timeout=None): # <<<<<<<<<<<<<< + * """ + * join(timeout=None) -> None + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_9_greenlet_8Greenlet_37join, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Greenlet_join, NULL, __pyx_n_s_gevent__greenlet, __pyx_d, ((PyObject *)__pyx_codeobj__54)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 711, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet->tp_dict, __pyx_n_s_join, __pyx_t_2) < 0) __PYX_ERR(0, 711, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_9_greenlet_Greenlet); + + /* "src/gevent/greenlet.py":760 + * del exc_info + * + * def run(self): # <<<<<<<<<<<<<< + * try: + * self.__cancel_start() + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_9_greenlet_8Greenlet_39run, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Greenlet_run, NULL, __pyx_n_s_gevent__greenlet, __pyx_d, ((PyObject *)__pyx_codeobj__56)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 760, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet->tp_dict, __pyx_n_s_run, __pyx_t_2) < 0) __PYX_ERR(0, 760, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_9_greenlet_Greenlet); + + /* "src/gevent/greenlet.py":776 + * self.kwargs.clear() + * + * def _run(self): # <<<<<<<<<<<<<< + * """ + * Subclasses may override this method to take any number of + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_9_greenlet_8Greenlet_41_run, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Greenlet__run, NULL, __pyx_n_s_gevent__greenlet, __pyx_d, ((PyObject *)__pyx_codeobj__58)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 776, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet->tp_dict, __pyx_n_s_run_2, __pyx_t_2) < 0) __PYX_ERR(0, 776, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_9_greenlet_Greenlet); + + /* "src/gevent/greenlet.py":790 + * return + * + * def has_links(self): # <<<<<<<<<<<<<< + * return len(self._links) + * + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_9_greenlet_8Greenlet_43has_links, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Greenlet_has_links, NULL, __pyx_n_s_gevent__greenlet, __pyx_d, ((PyObject *)__pyx_codeobj__60)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 790, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet->tp_dict, __pyx_n_s_has_links, __pyx_t_2) < 0) __PYX_ERR(0, 790, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_9_greenlet_Greenlet); + + /* "src/gevent/greenlet.py":793 + * return len(self._links) + * + * def rawlink(self, callback): # <<<<<<<<<<<<<< + * """ + * Register a callable to be executed when the greenlet finishes + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_9_greenlet_8Greenlet_45rawlink, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Greenlet_rawlink, NULL, __pyx_n_s_gevent__greenlet, __pyx_d, ((PyObject *)__pyx_codeobj__62)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 793, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet->tp_dict, __pyx_n_s_rawlink, __pyx_t_2) < 0) __PYX_ERR(0, 793, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_9_greenlet_Greenlet); + + /* "src/gevent/greenlet.py":809 + * self._notifier = self.parent.loop.run_callback(self._notify_links) + * + * def link(self, callback, SpawnedLink=SpawnedLink): # <<<<<<<<<<<<<< + * """ + * Link greenlet's completion to a callable. + */ + __Pyx_INCREF(((PyObject *)__pyx_ptype_6gevent_9_greenlet_SpawnedLink)); + __pyx_k__13 = ((PyObject *)__pyx_ptype_6gevent_9_greenlet_SpawnedLink); + __Pyx_GIVEREF(__pyx_ptype_6gevent_9_greenlet_SpawnedLink); + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_9_greenlet_8Greenlet_47link, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Greenlet_link, NULL, __pyx_n_s_gevent__greenlet, __pyx_d, ((PyObject *)__pyx_codeobj__64)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 809, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet->tp_dict, __pyx_n_s_link, __pyx_t_2) < 0) __PYX_ERR(0, 809, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_9_greenlet_Greenlet); + + /* "src/gevent/greenlet.py":823 + * self.rawlink(SpawnedLink(callback)) + * + * def unlink(self, callback): # <<<<<<<<<<<<<< + * """Remove the callback set by :meth:`link` or :meth:`rawlink`""" + * try: + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_9_greenlet_8Greenlet_49unlink, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Greenlet_unlink, NULL, __pyx_n_s_gevent__greenlet, __pyx_d, ((PyObject *)__pyx_codeobj__66)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 823, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet->tp_dict, __pyx_n_s_unlink, __pyx_t_2) < 0) __PYX_ERR(0, 823, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_9_greenlet_Greenlet); + + /* "src/gevent/greenlet.py":830 + * pass + * + * def unlink_all(self): # <<<<<<<<<<<<<< + * """ + * Remove all the callbacks. + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_9_greenlet_8Greenlet_51unlink_all, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Greenlet_unlink_all, NULL, __pyx_n_s_gevent__greenlet, __pyx_d, ((PyObject *)__pyx_codeobj__68)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 830, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet->tp_dict, __pyx_n_s_unlink_all, __pyx_t_2) < 0) __PYX_ERR(0, 830, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_9_greenlet_Greenlet); + + /* "src/gevent/greenlet.py":838 + * del self._links[:] + * + * def link_value(self, callback, SpawnedLink=SuccessSpawnedLink): # <<<<<<<<<<<<<< + * """ + * Like :meth:`link` but *callback* is only notified when the greenlet + */ + __Pyx_INCREF(((PyObject *)__pyx_ptype_6gevent_9_greenlet_SuccessSpawnedLink)); + __pyx_k__14 = ((PyObject *)__pyx_ptype_6gevent_9_greenlet_SuccessSpawnedLink); + __Pyx_GIVEREF(__pyx_ptype_6gevent_9_greenlet_SuccessSpawnedLink); + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_9_greenlet_8Greenlet_53link_value, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Greenlet_link_value, NULL, __pyx_n_s_gevent__greenlet, __pyx_d, ((PyObject *)__pyx_codeobj__70)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 838, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet->tp_dict, __pyx_n_s_link_value, __pyx_t_2) < 0) __PYX_ERR(0, 838, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_9_greenlet_Greenlet); + + /* "src/gevent/greenlet.py":846 + * self.link(callback, SpawnedLink=SpawnedLink) + * + * def link_exception(self, callback, SpawnedLink=FailureSpawnedLink): # <<<<<<<<<<<<<< + * """ + * Like :meth:`link` but *callback* is only notified when the + */ + __Pyx_INCREF(((PyObject *)__pyx_ptype_6gevent_9_greenlet_FailureSpawnedLink)); + __pyx_k__15 = ((PyObject *)__pyx_ptype_6gevent_9_greenlet_FailureSpawnedLink); + __Pyx_GIVEREF(__pyx_ptype_6gevent_9_greenlet_FailureSpawnedLink); + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_9_greenlet_8Greenlet_55link_exception, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Greenlet_link_exception, NULL, __pyx_n_s_gevent__greenlet, __pyx_d, ((PyObject *)__pyx_codeobj__72)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 846, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet->tp_dict, __pyx_n_s_link_exception, __pyx_t_2) < 0) __PYX_ERR(0, 846, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_9_greenlet_Greenlet); + + /* "src/gevent/greenlet.py":854 + * self.link(callback, SpawnedLink=SpawnedLink) + * + * def _notify_links(self): # <<<<<<<<<<<<<< + * while self._links: + * # Early links are allowed to remove later links + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_9_greenlet_8Greenlet_57_notify_links, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Greenlet__notify_links, NULL, __pyx_n_s_gevent__greenlet, __pyx_d, ((PyObject *)__pyx_codeobj__74)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 854, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet->tp_dict, __pyx_n_s_notify_links, __pyx_t_2) < 0) __PYX_ERR(0, 854, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_9_greenlet_Greenlet); + + /* "src/gevent/greenlet.py":871 + * + * class _dummy_event(object): + * __slots__ = ('pending', 'active') # <<<<<<<<<<<<<< + * + * def __init__(self): + */ + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet__dummy_event->tp_dict, __pyx_n_s_slots, __pyx_tuple__75) < 0) __PYX_ERR(0, 871, __pyx_L1_error) + PyType_Modified(__pyx_ptype_6gevent_9_greenlet__dummy_event); + + /* "src/gevent/greenlet.py":876 + * self.pending = self.active = False + * + * def stop(self): # <<<<<<<<<<<<<< + * pass + * + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_9_greenlet_12_dummy_event_3stop, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_dummy_event_stop, NULL, __pyx_n_s_gevent__greenlet, __pyx_d, ((PyObject *)__pyx_codeobj__77)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 876, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet__dummy_event->tp_dict, __pyx_n_s_stop, __pyx_t_2) < 0) __PYX_ERR(0, 876, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_9_greenlet__dummy_event); + + /* "src/gevent/greenlet.py":879 + * pass + * + * def start(self, cb): # pylint:disable=unused-argument # <<<<<<<<<<<<<< + * raise AssertionError("Cannot start the dummy event") + * + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_9_greenlet_12_dummy_event_5start, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_dummy_event_start, NULL, __pyx_n_s_gevent__greenlet, __pyx_d, ((PyObject *)__pyx_codeobj__79)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 879, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet__dummy_event->tp_dict, __pyx_n_s_start, __pyx_t_2) < 0) __PYX_ERR(0, 879, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_9_greenlet__dummy_event); + + /* "src/gevent/greenlet.py":882 + * raise AssertionError("Cannot start the dummy event") + * + * def close(self): # <<<<<<<<<<<<<< + * pass + * + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_9_greenlet_12_dummy_event_7close, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_dummy_event_close, NULL, __pyx_n_s_gevent__greenlet, __pyx_d, ((PyObject *)__pyx_codeobj__81)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 882, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet__dummy_event->tp_dict, __pyx_n_s_close, __pyx_t_2) < 0) __PYX_ERR(0, 882, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_9_greenlet__dummy_event); + + /* "src/gevent/greenlet.py":885 + * pass + * + * _cancelled_start_event = _dummy_event() # <<<<<<<<<<<<<< + * _start_completed_event = _dummy_event() + * + */ + __pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_6gevent_9_greenlet__dummy_event)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 885, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_XGOTREF(((PyObject *)__pyx_v_6gevent_9_greenlet__cancelled_start_event)); + __Pyx_DECREF_SET(__pyx_v_6gevent_9_greenlet__cancelled_start_event, ((struct __pyx_obj_6gevent_9_greenlet__dummy_event *)__pyx_t_2)); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + + /* "src/gevent/greenlet.py":886 + * + * _cancelled_start_event = _dummy_event() + * _start_completed_event = _dummy_event() # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_6gevent_9_greenlet__dummy_event)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 886, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_XGOTREF(((PyObject *)__pyx_v_6gevent_9_greenlet__start_completed_event)); + __Pyx_DECREF_SET(__pyx_v_6gevent_9_greenlet__start_completed_event, ((struct __pyx_obj_6gevent_9_greenlet__dummy_event *)__pyx_t_2)); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + + /* "src/gevent/greenlet.py":889 + * + * + * def _kill(glet, exception, waiter): # <<<<<<<<<<<<<< + * try: + * glet.throw(exception) + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_9_greenlet_1_kill, 0, __pyx_n_s_kill, NULL, __pyx_n_s_gevent__greenlet, __pyx_d, ((PyObject *)__pyx_codeobj__83)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 889, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_kill, __pyx_t_2) < 0) __PYX_ERR(0, 889, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/greenlet.py":899 + * + * + * def joinall(greenlets, timeout=None, raise_error=False, count=None): # <<<<<<<<<<<<<< + * """ + * Wait for the ``greenlets`` to finish. + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_9_greenlet_3joinall, 0, __pyx_n_s_joinall, NULL, __pyx_n_s_gevent__greenlet, __pyx_d, ((PyObject *)__pyx_codeobj__85)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 899, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_joinall, __pyx_t_2) < 0) __PYX_ERR(0, 899, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/greenlet.py":950 + * + * + * _spawn_callbacks = None # <<<<<<<<<<<<<< + * + * + */ + __Pyx_INCREF(Py_None); + __Pyx_XGOTREF(__pyx_v_6gevent_9_greenlet__spawn_callbacks); + __Pyx_DECREF_SET(__pyx_v_6gevent_9_greenlet__spawn_callbacks, ((PyObject*)Py_None)); + __Pyx_GIVEREF(Py_None); + + /* "src/gevent/greenlet.py":953 + * + * + * def killall(greenlets, exception=GreenletExit, block=True, timeout=None): # <<<<<<<<<<<<<< + * """ + * Forceably terminate all the ``greenlets`` by causing them to raise ``exception``. + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_9_greenlet_5killall, 0, __pyx_n_s_killall, NULL, __pyx_n_s_gevent__greenlet, __pyx_d, ((PyObject *)__pyx_codeobj__87)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 953, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!__Pyx_CyFunction_InitDefaults(__pyx_t_2, sizeof(__pyx_defaults), 1)) __PYX_ERR(0, 953, __pyx_L1_error) + __Pyx_INCREF(__pyx_v_6gevent_9_greenlet_GreenletExit); + __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_t_2)->__pyx_arg_exception = __pyx_v_6gevent_9_greenlet_GreenletExit; + __Pyx_GIVEREF(__pyx_v_6gevent_9_greenlet_GreenletExit); + __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_2, __pyx_pf_6gevent_9_greenlet_7__defaults__); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_killall, __pyx_t_2) < 0) __PYX_ERR(0, 953, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/greenlet.py":1000 + * greenlet_init() # pylint:disable=undefined-variable + * + * _init() # <<<<<<<<<<<<<< + * + * from gevent._util import import_c_accel + */ + __pyx_f_6gevent_9_greenlet__init(); + + /* "src/gevent/greenlet.py":1002 + * _init() + * + * from gevent._util import import_c_accel # <<<<<<<<<<<<<< + * import_c_accel(globals(), 'gevent._greenlet') + */ + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1002, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_import_c_accel); + __Pyx_GIVEREF(__pyx_n_s_import_c_accel); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_import_c_accel); + __pyx_t_1 = __Pyx_Import(__pyx_n_s_gevent__util, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1002, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_import_c_accel); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1002, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_import_c_accel, __pyx_t_2) < 0) __PYX_ERR(0, 1002, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/greenlet.py":1003 + * + * from gevent._util import import_c_accel + * import_c_accel(globals(), 'gevent._greenlet') # <<<<<<<<<<<<<< + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_import_c_accel); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1003, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_Globals(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1003, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1003, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_INCREF(__pyx_n_s_gevent__greenlet); + __Pyx_GIVEREF(__pyx_n_s_gevent__greenlet); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_n_s_gevent__greenlet); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1003, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/greenlet.py":1 + * # Copyright (c) 2009-2012 Denis Bilenko. See LICENSE for details. # <<<<<<<<<<<<<< + * # cython: auto_pickle=False,embedsignature=True,always_allow_keywords=False + * + */ + __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "cfunc.to_py":64 + * + * @cname("__Pyx_CFunc_object____list____object___to_py") + * cdef object __Pyx_CFunc_object____list____object___to_py(object (*f)(list, object) ): # <<<<<<<<<<<<<< + * def wrap(list greenlets, object exception): + * """wrap(greenlets: list, exception)""" + */ + + /*--- Wrapped vars code ---*/ + + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + if (__pyx_m) { + if (__pyx_d) { + __Pyx_AddTraceback("init gevent._greenlet", __pyx_clineno, __pyx_lineno, __pyx_filename); + } + Py_CLEAR(__pyx_m); + } else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_ImportError, "init gevent._greenlet"); + } + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + #if CYTHON_PEP489_MULTI_PHASE_INIT + return (__pyx_m != NULL) ? 0 : -1; + #elif PY_MAJOR_VERSION >= 3 + return __pyx_m; + #else + return; + #endif +} + +/* --- Runtime support code --- */ +/* Refnanny */ +#if CYTHON_REFNANNY +static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { + PyObject *m = NULL, *p = NULL; + void *r = NULL; + m = PyImport_ImportModule(modname); + if (!m) goto end; + p = PyObject_GetAttrString(m, "RefNannyAPI"); + if (!p) goto end; + r = PyLong_AsVoidPtr(p); +end: + Py_XDECREF(p); + Py_XDECREF(m); + return (__Pyx_RefNannyAPIStruct *)r; +} +#endif + +/* PyObjectGetAttrStr */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_getattro)) + return tp->tp_getattro(obj, attr_name); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_getattr)) + return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); +#endif + return PyObject_GetAttr(obj, attr_name); +} +#endif + +/* GetBuiltinName */ +static PyObject *__Pyx_GetBuiltinName(PyObject *name) { + PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name); + if (unlikely(!result)) { + PyErr_Format(PyExc_NameError, +#if PY_MAJOR_VERSION >= 3 + "name '%U' is not defined", name); +#else + "name '%.200s' is not defined", PyString_AS_STRING(name)); +#endif + } + return result; +} + +/* RaiseDoubleKeywords */ +static void __Pyx_RaiseDoubleKeywordsError( + const char* func_name, + PyObject* kw_name) +{ + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION >= 3 + "%s() got multiple values for keyword argument '%U'", func_name, kw_name); + #else + "%s() got multiple values for keyword argument '%s'", func_name, + PyString_AsString(kw_name)); + #endif +} + +/* ParseKeywords */ +static int __Pyx_ParseOptionalKeywords( + PyObject *kwds, + PyObject **argnames[], + PyObject *kwds2, + PyObject *values[], + Py_ssize_t num_pos_args, + const char* function_name) +{ + PyObject *key = 0, *value = 0; + Py_ssize_t pos = 0; + PyObject*** name; + PyObject*** first_kw_arg = argnames + num_pos_args; + while (PyDict_Next(kwds, &pos, &key, &value)) { + name = first_kw_arg; + while (*name && (**name != key)) name++; + if (*name) { + values[name-argnames] = value; + continue; + } + name = first_kw_arg; + #if PY_MAJOR_VERSION < 3 + if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) { + while (*name) { + if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) + && _PyString_Eq(**name, key)) { + values[name-argnames] = value; + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + if ((**argname == key) || ( + (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) + && _PyString_Eq(**argname, key))) { + goto arg_passed_twice; + } + argname++; + } + } + } else + #endif + if (likely(PyUnicode_Check(key))) { + while (*name) { + int cmp = (**name == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 : + #endif + PyUnicode_Compare(**name, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) { + values[name-argnames] = value; + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + int cmp = (**argname == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 : + #endif + PyUnicode_Compare(**argname, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) goto arg_passed_twice; + argname++; + } + } + } else + goto invalid_keyword_type; + if (kwds2) { + if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; + } else { + goto invalid_keyword; + } + } + return 0; +arg_passed_twice: + __Pyx_RaiseDoubleKeywordsError(function_name, key); + goto bad; +invalid_keyword_type: + PyErr_Format(PyExc_TypeError, + "%.200s() keywords must be strings", function_name); + goto bad; +invalid_keyword: + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION < 3 + "%.200s() got an unexpected keyword argument '%.200s'", + function_name, PyString_AsString(key)); + #else + "%s() got an unexpected keyword argument '%U'", + function_name, key); + #endif +bad: + return -1; +} + +/* RaiseArgTupleInvalid */ +static void __Pyx_RaiseArgtupleInvalid( + const char* func_name, + int exact, + Py_ssize_t num_min, + Py_ssize_t num_max, + Py_ssize_t num_found) +{ + Py_ssize_t num_expected; + const char *more_or_less; + if (num_found < num_min) { + num_expected = num_min; + more_or_less = "at least"; + } else { + num_expected = num_max; + more_or_less = "at most"; + } + if (exact) { + more_or_less = "exactly"; + } + PyErr_Format(PyExc_TypeError, + "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", + func_name, more_or_less, num_expected, + (num_expected == 1) ? "" : "s", num_found); +} + +/* PyCFunctionFastCall */ +#if CYTHON_FAST_PYCCALL +static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) { + PyCFunctionObject *func = (PyCFunctionObject*)func_obj; + PyCFunction meth = PyCFunction_GET_FUNCTION(func); + PyObject *self = PyCFunction_GET_SELF(func); + int flags = PyCFunction_GET_FLAGS(func); + assert(PyCFunction_Check(func)); + assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS))); + assert(nargs >= 0); + assert(nargs == 0 || args != NULL); + /* _PyCFunction_FastCallDict() must not be called with an exception set, + because it may clear it (directly or indirectly) and so the + caller loses its exception */ + assert(!PyErr_Occurred()); + if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) { + return (*((__Pyx_PyCFunctionFastWithKeywords)(void*)meth)) (self, args, nargs, NULL); + } else { + return (*((__Pyx_PyCFunctionFast)(void*)meth)) (self, args, nargs); + } +} +#endif + +/* PyFunctionFastCall */ +#if CYTHON_FAST_PYCALL +static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, + PyObject *globals) { + PyFrameObject *f; + PyThreadState *tstate = __Pyx_PyThreadState_Current; + PyObject **fastlocals; + Py_ssize_t i; + PyObject *result; + assert(globals != NULL); + /* XXX Perhaps we should create a specialized + PyFrame_New() that doesn't take locals, but does + take builtins without sanity checking them. + */ + assert(tstate != NULL); + f = PyFrame_New(tstate, co, globals, NULL); + if (f == NULL) { + return NULL; + } + fastlocals = __Pyx_PyFrame_GetLocalsplus(f); + for (i = 0; i < na; i++) { + Py_INCREF(*args); + fastlocals[i] = *args++; + } + result = PyEval_EvalFrameEx(f,0); + ++tstate->recursion_depth; + Py_DECREF(f); + --tstate->recursion_depth; + return result; +} +#if 1 || PY_VERSION_HEX < 0x030600B1 +static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs) { + PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); + PyObject *globals = PyFunction_GET_GLOBALS(func); + PyObject *argdefs = PyFunction_GET_DEFAULTS(func); + PyObject *closure; +#if PY_MAJOR_VERSION >= 3 + PyObject *kwdefs; +#endif + PyObject *kwtuple, **k; + PyObject **d; + Py_ssize_t nd; + Py_ssize_t nk; + PyObject *result; + assert(kwargs == NULL || PyDict_Check(kwargs)); + nk = kwargs ? PyDict_Size(kwargs) : 0; + if (Py_EnterRecursiveCall((char*)" while calling a Python object")) { + return NULL; + } + if ( +#if PY_MAJOR_VERSION >= 3 + co->co_kwonlyargcount == 0 && +#endif + likely(kwargs == NULL || nk == 0) && + co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { + if (argdefs == NULL && co->co_argcount == nargs) { + result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); + goto done; + } + else if (nargs == 0 && argdefs != NULL + && co->co_argcount == Py_SIZE(argdefs)) { + /* function called with no arguments, but all parameters have + a default value: use default values as arguments .*/ + args = &PyTuple_GET_ITEM(argdefs, 0); + result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); + goto done; + } + } + if (kwargs != NULL) { + Py_ssize_t pos, i; + kwtuple = PyTuple_New(2 * nk); + if (kwtuple == NULL) { + result = NULL; + goto done; + } + k = &PyTuple_GET_ITEM(kwtuple, 0); + pos = i = 0; + while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { + Py_INCREF(k[i]); + Py_INCREF(k[i+1]); + i += 2; + } + nk = i / 2; + } + else { + kwtuple = NULL; + k = NULL; + } + closure = PyFunction_GET_CLOSURE(func); +#if PY_MAJOR_VERSION >= 3 + kwdefs = PyFunction_GET_KW_DEFAULTS(func); +#endif + if (argdefs != NULL) { + d = &PyTuple_GET_ITEM(argdefs, 0); + nd = Py_SIZE(argdefs); + } + else { + d = NULL; + nd = 0; + } +#if PY_MAJOR_VERSION >= 3 + result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, + args, nargs, + k, (int)nk, + d, (int)nd, kwdefs, closure); +#else + result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, + args, nargs, + k, (int)nk, + d, (int)nd, closure); +#endif + Py_XDECREF(kwtuple); +done: + Py_LeaveRecursiveCall(); + return result; +} +#endif +#endif + +/* PyObjectCall */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { + PyObject *result; + ternaryfunc call = func->ob_type->tp_call; + if (unlikely(!call)) + return PyObject_Call(func, arg, kw); + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; + result = (*call)(func, arg, kw); + Py_LeaveRecursiveCall(); + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +/* PyObjectCallMethO */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { + PyObject *self, *result; + PyCFunction cfunc; + cfunc = PyCFunction_GET_FUNCTION(func); + self = PyCFunction_GET_SELF(func); + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; + result = cfunc(self, arg); + Py_LeaveRecursiveCall(); + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +/* PyObjectCallOneArg */ +#if CYTHON_COMPILING_IN_CPYTHON +static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) { + PyObject *result; + PyObject *args = PyTuple_New(1); + if (unlikely(!args)) return NULL; + Py_INCREF(arg); + PyTuple_SET_ITEM(args, 0, arg); + result = __Pyx_PyObject_Call(func, args, NULL); + Py_DECREF(args); + return result; +} +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { +#if CYTHON_FAST_PYCALL + if (PyFunction_Check(func)) { + return __Pyx_PyFunction_FastCall(func, &arg, 1); + } +#endif + if (likely(PyCFunction_Check(func))) { + if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) { + return __Pyx_PyObject_CallMethO(func, arg); +#if CYTHON_FAST_PYCCALL + } else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) { + return __Pyx_PyCFunction_FastCall(func, &arg, 1); +#endif + } + } + return __Pyx__PyObject_CallOneArg(func, arg); +} +#else +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { + PyObject *result; + PyObject *args = PyTuple_Pack(1, arg); + if (unlikely(!args)) return NULL; + result = __Pyx_PyObject_Call(func, args, NULL); + Py_DECREF(args); + return result; +} +#endif + +/* PyErrFetchRestore */ +#if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + tmp_type = tstate->curexc_type; + tmp_value = tstate->curexc_value; + tmp_tb = tstate->curexc_traceback; + tstate->curexc_type = type; + tstate->curexc_value = value; + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +} +static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { + *type = tstate->curexc_type; + *value = tstate->curexc_value; + *tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +} +#endif + +/* RaiseException */ +#if PY_MAJOR_VERSION < 3 +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, + CYTHON_UNUSED PyObject *cause) { + __Pyx_PyThreadState_declare + Py_XINCREF(type); + if (!value || value == Py_None) + value = NULL; + else + Py_INCREF(value); + if (!tb || tb == Py_None) + tb = NULL; + else { + Py_INCREF(tb); + if (!PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto raise_error; + } + } + if (PyType_Check(type)) { +#if CYTHON_COMPILING_IN_PYPY + if (!value) { + Py_INCREF(Py_None); + value = Py_None; + } +#endif + PyErr_NormalizeException(&type, &value, &tb); + } else { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto raise_error; + } + value = type; + type = (PyObject*) Py_TYPE(type); + Py_INCREF(type); + if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto raise_error; + } + } + __Pyx_PyThreadState_assign + __Pyx_ErrRestore(type, value, tb); + return; +raise_error: + Py_XDECREF(value); + Py_XDECREF(type); + Py_XDECREF(tb); + return; +} +#else +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { + PyObject* owned_instance = NULL; + if (tb == Py_None) { + tb = 0; + } else if (tb && !PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto bad; + } + if (value == Py_None) + value = 0; + if (PyExceptionInstance_Check(type)) { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto bad; + } + value = type; + type = (PyObject*) Py_TYPE(value); + } else if (PyExceptionClass_Check(type)) { + PyObject *instance_class = NULL; + if (value && PyExceptionInstance_Check(value)) { + instance_class = (PyObject*) Py_TYPE(value); + if (instance_class != type) { + int is_subclass = PyObject_IsSubclass(instance_class, type); + if (!is_subclass) { + instance_class = NULL; + } else if (unlikely(is_subclass == -1)) { + goto bad; + } else { + type = instance_class; + } + } + } + if (!instance_class) { + PyObject *args; + if (!value) + args = PyTuple_New(0); + else if (PyTuple_Check(value)) { + Py_INCREF(value); + args = value; + } else + args = PyTuple_Pack(1, value); + if (!args) + goto bad; + owned_instance = PyObject_Call(type, args, NULL); + Py_DECREF(args); + if (!owned_instance) + goto bad; + value = owned_instance; + if (!PyExceptionInstance_Check(value)) { + PyErr_Format(PyExc_TypeError, + "calling %R should have returned an instance of " + "BaseException, not %R", + type, Py_TYPE(value)); + goto bad; + } + } + } else { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto bad; + } + if (cause) { + PyObject *fixed_cause; + if (cause == Py_None) { + fixed_cause = NULL; + } else if (PyExceptionClass_Check(cause)) { + fixed_cause = PyObject_CallObject(cause, NULL); + if (fixed_cause == NULL) + goto bad; + } else if (PyExceptionInstance_Check(cause)) { + fixed_cause = cause; + Py_INCREF(fixed_cause); + } else { + PyErr_SetString(PyExc_TypeError, + "exception causes must derive from " + "BaseException"); + goto bad; + } + PyException_SetCause(value, fixed_cause); + } + PyErr_SetObject(type, value); + if (tb) { +#if CYTHON_COMPILING_IN_PYPY + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); + Py_INCREF(tb); + PyErr_Restore(tmp_type, tmp_value, tb); + Py_XDECREF(tmp_tb); +#else + PyThreadState *tstate = __Pyx_PyThreadState_Current; + PyObject* tmp_tb = tstate->curexc_traceback; + if (tb != tmp_tb) { + Py_INCREF(tb); + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_tb); + } +#endif + } +bad: + Py_XDECREF(owned_instance); + return; +} +#endif + +/* PyObjectCall2Args */ +static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) { + PyObject *args, *result = NULL; + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(function)) { + PyObject *args[2] = {arg1, arg2}; + return __Pyx_PyFunction_FastCall(function, args, 2); + } + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(function)) { + PyObject *args[2] = {arg1, arg2}; + return __Pyx_PyCFunction_FastCall(function, args, 2); + } + #endif + args = PyTuple_New(2); + if (unlikely(!args)) goto done; + Py_INCREF(arg1); + PyTuple_SET_ITEM(args, 0, arg1); + Py_INCREF(arg2); + PyTuple_SET_ITEM(args, 1, arg2); + Py_INCREF(function); + result = __Pyx_PyObject_Call(function, args, NULL); + Py_DECREF(args); + Py_DECREF(function); +done: + return result; +} + +/* PyErrExceptionMatches */ +#if CYTHON_FAST_THREAD_STATE +static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { + Py_ssize_t i, n; + n = PyTuple_GET_SIZE(tuple); +#if PY_MAJOR_VERSION >= 3 + for (i=0; icurexc_type; + if (exc_type == err) return 1; + if (unlikely(!exc_type)) return 0; + if (unlikely(PyTuple_Check(err))) + return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err); + return __Pyx_PyErr_GivenExceptionMatches(exc_type, err); +} +#endif + +/* GetAttr */ +static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) { +#if CYTHON_USE_TYPE_SLOTS +#if PY_MAJOR_VERSION >= 3 + if (likely(PyUnicode_Check(n))) +#else + if (likely(PyString_Check(n))) +#endif + return __Pyx_PyObject_GetAttrStr(o, n); +#endif + return PyObject_GetAttr(o, n); +} + +/* GetAttr3 */ +static PyObject *__Pyx_GetAttr3Default(PyObject *d) { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) + return NULL; + __Pyx_PyErr_Clear(); + Py_INCREF(d); + return d; +} +static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) { + PyObject *r = __Pyx_GetAttr(o, n); + return (likely(r)) ? r : __Pyx_GetAttr3Default(d); +} + +/* BytesEquals */ +static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { +#if CYTHON_COMPILING_IN_PYPY + return PyObject_RichCompareBool(s1, s2, equals); +#else + if (s1 == s2) { + return (equals == Py_EQ); + } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) { + const char *ps1, *ps2; + Py_ssize_t length = PyBytes_GET_SIZE(s1); + if (length != PyBytes_GET_SIZE(s2)) + return (equals == Py_NE); + ps1 = PyBytes_AS_STRING(s1); + ps2 = PyBytes_AS_STRING(s2); + if (ps1[0] != ps2[0]) { + return (equals == Py_NE); + } else if (length == 1) { + return (equals == Py_EQ); + } else { + int result; +#if CYTHON_USE_UNICODE_INTERNALS + Py_hash_t hash1, hash2; + hash1 = ((PyBytesObject*)s1)->ob_shash; + hash2 = ((PyBytesObject*)s2)->ob_shash; + if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { + return (equals == Py_NE); + } +#endif + result = memcmp(ps1, ps2, (size_t)length); + return (equals == Py_EQ) ? (result == 0) : (result != 0); + } + } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) { + return (equals == Py_NE); + } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) { + return (equals == Py_NE); + } else { + int result; + PyObject* py_result = PyObject_RichCompare(s1, s2, equals); + if (!py_result) + return -1; + result = __Pyx_PyObject_IsTrue(py_result); + Py_DECREF(py_result); + return result; + } +#endif +} + +/* UnicodeEquals */ +static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { +#if CYTHON_COMPILING_IN_PYPY + return PyObject_RichCompareBool(s1, s2, equals); +#else +#if PY_MAJOR_VERSION < 3 + PyObject* owned_ref = NULL; +#endif + int s1_is_unicode, s2_is_unicode; + if (s1 == s2) { + goto return_eq; + } + s1_is_unicode = PyUnicode_CheckExact(s1); + s2_is_unicode = PyUnicode_CheckExact(s2); +#if PY_MAJOR_VERSION < 3 + if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) { + owned_ref = PyUnicode_FromObject(s2); + if (unlikely(!owned_ref)) + return -1; + s2 = owned_ref; + s2_is_unicode = 1; + } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) { + owned_ref = PyUnicode_FromObject(s1); + if (unlikely(!owned_ref)) + return -1; + s1 = owned_ref; + s1_is_unicode = 1; + } else if (((!s2_is_unicode) & (!s1_is_unicode))) { + return __Pyx_PyBytes_Equals(s1, s2, equals); + } +#endif + if (s1_is_unicode & s2_is_unicode) { + Py_ssize_t length; + int kind; + void *data1, *data2; + if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0)) + return -1; + length = __Pyx_PyUnicode_GET_LENGTH(s1); + if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) { + goto return_ne; + } +#if CYTHON_USE_UNICODE_INTERNALS + { + Py_hash_t hash1, hash2; + #if CYTHON_PEP393_ENABLED + hash1 = ((PyASCIIObject*)s1)->hash; + hash2 = ((PyASCIIObject*)s2)->hash; + #else + hash1 = ((PyUnicodeObject*)s1)->hash; + hash2 = ((PyUnicodeObject*)s2)->hash; + #endif + if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { + goto return_ne; + } + } +#endif + kind = __Pyx_PyUnicode_KIND(s1); + if (kind != __Pyx_PyUnicode_KIND(s2)) { + goto return_ne; + } + data1 = __Pyx_PyUnicode_DATA(s1); + data2 = __Pyx_PyUnicode_DATA(s2); + if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) { + goto return_ne; + } else if (length == 1) { + goto return_eq; + } else { + int result = memcmp(data1, data2, (size_t)(length * kind)); + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_EQ) ? (result == 0) : (result != 0); + } + } else if ((s1 == Py_None) & s2_is_unicode) { + goto return_ne; + } else if ((s2 == Py_None) & s1_is_unicode) { + goto return_ne; + } else { + int result; + PyObject* py_result = PyObject_RichCompare(s1, s2, equals); + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + if (!py_result) + return -1; + result = __Pyx_PyObject_IsTrue(py_result); + Py_DECREF(py_result); + return result; + } +return_eq: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_EQ); +return_ne: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_NE); +#endif +} + +/* PyObjectCallNoArg */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { +#if CYTHON_FAST_PYCALL + if (PyFunction_Check(func)) { + return __Pyx_PyFunction_FastCall(func, NULL, 0); + } +#endif +#ifdef __Pyx_CyFunction_USED + if (likely(PyCFunction_Check(func) || __Pyx_CyFunction_Check(func))) +#else + if (likely(PyCFunction_Check(func))) +#endif + { + if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) { + return __Pyx_PyObject_CallMethO(func, NULL); + } + } + return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL); +} +#endif + +/* ExtTypeTest */ +static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { + if (unlikely(!type)) { + PyErr_SetString(PyExc_SystemError, "Missing type object"); + return 0; + } + if (likely(__Pyx_TypeCheck(obj, type))) + return 1; + PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s", + Py_TYPE(obj)->tp_name, type->tp_name); + return 0; +} + +/* GetItemInt */ +static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { + PyObject *r; + if (!j) return NULL; + r = PyObject_GetItem(o, j); + Py_DECREF(j); + return r; +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, + CYTHON_NCP_UNUSED int wraparound, + CYTHON_NCP_UNUSED int boundscheck) { +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + Py_ssize_t wrapped_i = i; + if (wraparound & unlikely(i < 0)) { + wrapped_i += PyList_GET_SIZE(o); + } + if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) { + PyObject *r = PyList_GET_ITEM(o, wrapped_i); + Py_INCREF(r); + return r; + } + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +#else + return PySequence_GetItem(o, i); +#endif +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, + CYTHON_NCP_UNUSED int wraparound, + CYTHON_NCP_UNUSED int boundscheck) { +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + Py_ssize_t wrapped_i = i; + if (wraparound & unlikely(i < 0)) { + wrapped_i += PyTuple_GET_SIZE(o); + } + if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) { + PyObject *r = PyTuple_GET_ITEM(o, wrapped_i); + Py_INCREF(r); + return r; + } + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +#else + return PySequence_GetItem(o, i); +#endif +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, + CYTHON_NCP_UNUSED int wraparound, + CYTHON_NCP_UNUSED int boundscheck) { +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS + if (is_list || PyList_CheckExact(o)) { + Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); + if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) { + PyObject *r = PyList_GET_ITEM(o, n); + Py_INCREF(r); + return r; + } + } + else if (PyTuple_CheckExact(o)) { + Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o); + if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) { + PyObject *r = PyTuple_GET_ITEM(o, n); + Py_INCREF(r); + return r; + } + } else { + PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence; + if (likely(m && m->sq_item)) { + if (wraparound && unlikely(i < 0) && likely(m->sq_length)) { + Py_ssize_t l = m->sq_length(o); + if (likely(l >= 0)) { + i += l; + } else { + if (!PyErr_ExceptionMatches(PyExc_OverflowError)) + return NULL; + PyErr_Clear(); + } + } + return m->sq_item(o, i); + } + } +#else + if (is_list || PySequence_Check(o)) { + return PySequence_GetItem(o, i); + } +#endif + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +} + +/* GetTopmostException */ +#if CYTHON_USE_EXC_INFO_STACK +static _PyErr_StackItem * +__Pyx_PyErr_GetTopmostException(PyThreadState *tstate) +{ + _PyErr_StackItem *exc_info = tstate->exc_info; + while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) && + exc_info->previous_item != NULL) + { + exc_info = exc_info->previous_item; + } + return exc_info; +} +#endif + +/* SaveResetException */ +#if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { + #if CYTHON_USE_EXC_INFO_STACK + _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate); + *type = exc_info->exc_type; + *value = exc_info->exc_value; + *tb = exc_info->exc_traceback; + #else + *type = tstate->exc_type; + *value = tstate->exc_value; + *tb = tstate->exc_traceback; + #endif + Py_XINCREF(*type); + Py_XINCREF(*value); + Py_XINCREF(*tb); +} +static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + #if CYTHON_USE_EXC_INFO_STACK + _PyErr_StackItem *exc_info = tstate->exc_info; + tmp_type = exc_info->exc_type; + tmp_value = exc_info->exc_value; + tmp_tb = exc_info->exc_traceback; + exc_info->exc_type = type; + exc_info->exc_value = value; + exc_info->exc_traceback = tb; + #else + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = type; + tstate->exc_value = value; + tstate->exc_traceback = tb; + #endif + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +} +#endif + +/* GetException */ +#if CYTHON_FAST_THREAD_STATE +static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) +#else +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) +#endif +{ + PyObject *local_type, *local_value, *local_tb; +#if CYTHON_FAST_THREAD_STATE + PyObject *tmp_type, *tmp_value, *tmp_tb; + local_type = tstate->curexc_type; + local_value = tstate->curexc_value; + local_tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +#else + PyErr_Fetch(&local_type, &local_value, &local_tb); +#endif + PyErr_NormalizeException(&local_type, &local_value, &local_tb); +#if CYTHON_FAST_THREAD_STATE + if (unlikely(tstate->curexc_type)) +#else + if (unlikely(PyErr_Occurred())) +#endif + goto bad; + #if PY_MAJOR_VERSION >= 3 + if (local_tb) { + if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) + goto bad; + } + #endif + Py_XINCREF(local_tb); + Py_XINCREF(local_type); + Py_XINCREF(local_value); + *type = local_type; + *value = local_value; + *tb = local_tb; +#if CYTHON_FAST_THREAD_STATE + #if CYTHON_USE_EXC_INFO_STACK + { + _PyErr_StackItem *exc_info = tstate->exc_info; + tmp_type = exc_info->exc_type; + tmp_value = exc_info->exc_value; + tmp_tb = exc_info->exc_traceback; + exc_info->exc_type = local_type; + exc_info->exc_value = local_value; + exc_info->exc_traceback = local_tb; + } + #else + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = local_type; + tstate->exc_value = local_value; + tstate->exc_traceback = local_tb; + #endif + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#else + PyErr_SetExcInfo(local_type, local_value, local_tb); +#endif + return 0; +bad: + *type = 0; + *value = 0; + *tb = 0; + Py_XDECREF(local_type); + Py_XDECREF(local_value); + Py_XDECREF(local_tb); + return -1; +} + +/* PyObjectSetAttrStr */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) { + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_setattro)) + return tp->tp_setattro(obj, attr_name, value); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_setattr)) + return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value); +#endif + return PyObject_SetAttr(obj, attr_name, value); +} +#endif + +/* WriteUnraisableException */ +static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno, + CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename, + int full_traceback, CYTHON_UNUSED int nogil) { + PyObject *old_exc, *old_val, *old_tb; + PyObject *ctx; + __Pyx_PyThreadState_declare +#ifdef WITH_THREAD + PyGILState_STATE state; + if (nogil) + state = PyGILState_Ensure(); +#ifdef _MSC_VER + else state = (PyGILState_STATE)-1; +#endif +#endif + __Pyx_PyThreadState_assign + __Pyx_ErrFetch(&old_exc, &old_val, &old_tb); + if (full_traceback) { + Py_XINCREF(old_exc); + Py_XINCREF(old_val); + Py_XINCREF(old_tb); + __Pyx_ErrRestore(old_exc, old_val, old_tb); + PyErr_PrintEx(1); + } + #if PY_MAJOR_VERSION < 3 + ctx = PyString_FromString(name); + #else + ctx = PyUnicode_FromString(name); + #endif + __Pyx_ErrRestore(old_exc, old_val, old_tb); + if (!ctx) { + PyErr_WriteUnraisable(Py_None); + } else { + PyErr_WriteUnraisable(ctx); + Py_DECREF(ctx); + } +#ifdef WITH_THREAD + if (nogil) + PyGILState_Release(state); +#endif +} + +/* IterFinish */ +static CYTHON_INLINE int __Pyx_IterFinish(void) { +#if CYTHON_FAST_THREAD_STATE + PyThreadState *tstate = __Pyx_PyThreadState_Current; + PyObject* exc_type = tstate->curexc_type; + if (unlikely(exc_type)) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) { + PyObject *exc_value, *exc_tb; + exc_value = tstate->curexc_value; + exc_tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; + Py_DECREF(exc_type); + Py_XDECREF(exc_value); + Py_XDECREF(exc_tb); + return 0; + } else { + return -1; + } + } + return 0; +#else + if (unlikely(PyErr_Occurred())) { + if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) { + PyErr_Clear(); + return 0; + } else { + return -1; + } + } + return 0; +#endif +} + +/* PyObjectGetMethod */ +static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method) { + PyObject *attr; +#if CYTHON_UNPACK_METHODS && CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_PYTYPE_LOOKUP + PyTypeObject *tp = Py_TYPE(obj); + PyObject *descr; + descrgetfunc f = NULL; + PyObject **dictptr, *dict; + int meth_found = 0; + assert (*method == NULL); + if (unlikely(tp->tp_getattro != PyObject_GenericGetAttr)) { + attr = __Pyx_PyObject_GetAttrStr(obj, name); + goto try_unpack; + } + if (unlikely(tp->tp_dict == NULL) && unlikely(PyType_Ready(tp) < 0)) { + return 0; + } + descr = _PyType_Lookup(tp, name); + if (likely(descr != NULL)) { + Py_INCREF(descr); +#if PY_MAJOR_VERSION >= 3 + #ifdef __Pyx_CyFunction_USED + if (likely(PyFunction_Check(descr) || (Py_TYPE(descr) == &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr))) + #else + if (likely(PyFunction_Check(descr) || (Py_TYPE(descr) == &PyMethodDescr_Type))) + #endif +#else + #ifdef __Pyx_CyFunction_USED + if (likely(PyFunction_Check(descr) || __Pyx_CyFunction_Check(descr))) + #else + if (likely(PyFunction_Check(descr))) + #endif +#endif + { + meth_found = 1; + } else { + f = Py_TYPE(descr)->tp_descr_get; + if (f != NULL && PyDescr_IsData(descr)) { + attr = f(descr, obj, (PyObject *)Py_TYPE(obj)); + Py_DECREF(descr); + goto try_unpack; + } + } + } + dictptr = _PyObject_GetDictPtr(obj); + if (dictptr != NULL && (dict = *dictptr) != NULL) { + Py_INCREF(dict); + attr = __Pyx_PyDict_GetItemStr(dict, name); + if (attr != NULL) { + Py_INCREF(attr); + Py_DECREF(dict); + Py_XDECREF(descr); + goto try_unpack; + } + Py_DECREF(dict); + } + if (meth_found) { + *method = descr; + return 1; + } + if (f != NULL) { + attr = f(descr, obj, (PyObject *)Py_TYPE(obj)); + Py_DECREF(descr); + goto try_unpack; + } + if (descr != NULL) { + *method = descr; + return 0; + } + PyErr_Format(PyExc_AttributeError, +#if PY_MAJOR_VERSION >= 3 + "'%.50s' object has no attribute '%U'", + tp->tp_name, name); +#else + "'%.50s' object has no attribute '%.400s'", + tp->tp_name, PyString_AS_STRING(name)); +#endif + return 0; +#else + attr = __Pyx_PyObject_GetAttrStr(obj, name); + goto try_unpack; +#endif +try_unpack: +#if CYTHON_UNPACK_METHODS + if (likely(attr) && PyMethod_Check(attr) && likely(PyMethod_GET_SELF(attr) == obj)) { + PyObject *function = PyMethod_GET_FUNCTION(attr); + Py_INCREF(function); + Py_DECREF(attr); + *method = function; + return 1; + } +#endif + *method = attr; + return 0; +} + +/* PyObjectCallMethod0 */ +static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) { + PyObject *method = NULL, *result = NULL; + int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method); + if (likely(is_method)) { + result = __Pyx_PyObject_CallOneArg(method, obj); + Py_DECREF(method); + return result; + } + if (unlikely(!method)) goto bad; + result = __Pyx_PyObject_CallNoArg(method); + Py_DECREF(method); +bad: + return result; +} + +/* RaiseNeedMoreValuesToUnpack */ +static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { + PyErr_Format(PyExc_ValueError, + "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack", + index, (index == 1) ? "" : "s"); +} + +/* RaiseTooManyValuesToUnpack */ +static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { + PyErr_Format(PyExc_ValueError, + "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected); +} + +/* UnpackItemEndCheck */ +static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { + if (unlikely(retval)) { + Py_DECREF(retval); + __Pyx_RaiseTooManyValuesError(expected); + return -1; + } else { + return __Pyx_IterFinish(); + } + return 0; +} + +/* RaiseNoneIterError */ +static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); +} + +/* UnpackTupleError */ +static void __Pyx_UnpackTupleError(PyObject *t, Py_ssize_t index) { + if (t == Py_None) { + __Pyx_RaiseNoneNotIterableError(); + } else if (PyTuple_GET_SIZE(t) < index) { + __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(t)); + } else { + __Pyx_RaiseTooManyValuesError(index); + } +} + +/* UnpackTuple2 */ +static CYTHON_INLINE int __Pyx_unpack_tuple2_exact( + PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2, int decref_tuple) { + PyObject *value1 = NULL, *value2 = NULL; +#if CYTHON_COMPILING_IN_PYPY + value1 = PySequence_ITEM(tuple, 0); if (unlikely(!value1)) goto bad; + value2 = PySequence_ITEM(tuple, 1); if (unlikely(!value2)) goto bad; +#else + value1 = PyTuple_GET_ITEM(tuple, 0); Py_INCREF(value1); + value2 = PyTuple_GET_ITEM(tuple, 1); Py_INCREF(value2); +#endif + if (decref_tuple) { + Py_DECREF(tuple); + } + *pvalue1 = value1; + *pvalue2 = value2; + return 0; +#if CYTHON_COMPILING_IN_PYPY +bad: + Py_XDECREF(value1); + Py_XDECREF(value2); + if (decref_tuple) { Py_XDECREF(tuple); } + return -1; +#endif +} +static int __Pyx_unpack_tuple2_generic(PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2, + int has_known_size, int decref_tuple) { + Py_ssize_t index; + PyObject *value1 = NULL, *value2 = NULL, *iter = NULL; + iternextfunc iternext; + iter = PyObject_GetIter(tuple); + if (unlikely(!iter)) goto bad; + if (decref_tuple) { Py_DECREF(tuple); tuple = NULL; } + iternext = Py_TYPE(iter)->tp_iternext; + value1 = iternext(iter); if (unlikely(!value1)) { index = 0; goto unpacking_failed; } + value2 = iternext(iter); if (unlikely(!value2)) { index = 1; goto unpacking_failed; } + if (!has_known_size && unlikely(__Pyx_IternextUnpackEndCheck(iternext(iter), 2))) goto bad; + Py_DECREF(iter); + *pvalue1 = value1; + *pvalue2 = value2; + return 0; +unpacking_failed: + if (!has_known_size && __Pyx_IterFinish() == 0) + __Pyx_RaiseNeedMoreValuesError(index); +bad: + Py_XDECREF(iter); + Py_XDECREF(value1); + Py_XDECREF(value2); + if (decref_tuple) { Py_XDECREF(tuple); } + return -1; +} + +/* dict_iter */ +static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* iterable, int is_dict, PyObject* method_name, + Py_ssize_t* p_orig_length, int* p_source_is_dict) { + is_dict = is_dict || likely(PyDict_CheckExact(iterable)); + *p_source_is_dict = is_dict; + if (is_dict) { +#if !CYTHON_COMPILING_IN_PYPY + *p_orig_length = PyDict_Size(iterable); + Py_INCREF(iterable); + return iterable; +#elif PY_MAJOR_VERSION >= 3 + static PyObject *py_items = NULL, *py_keys = NULL, *py_values = NULL; + PyObject **pp = NULL; + if (method_name) { + const char *name = PyUnicode_AsUTF8(method_name); + if (strcmp(name, "iteritems") == 0) pp = &py_items; + else if (strcmp(name, "iterkeys") == 0) pp = &py_keys; + else if (strcmp(name, "itervalues") == 0) pp = &py_values; + if (pp) { + if (!*pp) { + *pp = PyUnicode_FromString(name + 4); + if (!*pp) + return NULL; + } + method_name = *pp; + } + } +#endif + } + *p_orig_length = 0; + if (method_name) { + PyObject* iter; + iterable = __Pyx_PyObject_CallMethod0(iterable, method_name); + if (!iterable) + return NULL; +#if !CYTHON_COMPILING_IN_PYPY + if (PyTuple_CheckExact(iterable) || PyList_CheckExact(iterable)) + return iterable; +#endif + iter = PyObject_GetIter(iterable); + Py_DECREF(iterable); + return iter; + } + return PyObject_GetIter(iterable); +} +static CYTHON_INLINE int __Pyx_dict_iter_next( + PyObject* iter_obj, CYTHON_NCP_UNUSED Py_ssize_t orig_length, CYTHON_NCP_UNUSED Py_ssize_t* ppos, + PyObject** pkey, PyObject** pvalue, PyObject** pitem, int source_is_dict) { + PyObject* next_item; +#if !CYTHON_COMPILING_IN_PYPY + if (source_is_dict) { + PyObject *key, *value; + if (unlikely(orig_length != PyDict_Size(iter_obj))) { + PyErr_SetString(PyExc_RuntimeError, "dictionary changed size during iteration"); + return -1; + } + if (unlikely(!PyDict_Next(iter_obj, ppos, &key, &value))) { + return 0; + } + if (pitem) { + PyObject* tuple = PyTuple_New(2); + if (unlikely(!tuple)) { + return -1; + } + Py_INCREF(key); + Py_INCREF(value); + PyTuple_SET_ITEM(tuple, 0, key); + PyTuple_SET_ITEM(tuple, 1, value); + *pitem = tuple; + } else { + if (pkey) { + Py_INCREF(key); + *pkey = key; + } + if (pvalue) { + Py_INCREF(value); + *pvalue = value; + } + } + return 1; + } else if (PyTuple_CheckExact(iter_obj)) { + Py_ssize_t pos = *ppos; + if (unlikely(pos >= PyTuple_GET_SIZE(iter_obj))) return 0; + *ppos = pos + 1; + next_item = PyTuple_GET_ITEM(iter_obj, pos); + Py_INCREF(next_item); + } else if (PyList_CheckExact(iter_obj)) { + Py_ssize_t pos = *ppos; + if (unlikely(pos >= PyList_GET_SIZE(iter_obj))) return 0; + *ppos = pos + 1; + next_item = PyList_GET_ITEM(iter_obj, pos); + Py_INCREF(next_item); + } else +#endif + { + next_item = PyIter_Next(iter_obj); + if (unlikely(!next_item)) { + return __Pyx_IterFinish(); + } + } + if (pitem) { + *pitem = next_item; + } else if (pkey && pvalue) { + if (__Pyx_unpack_tuple2(next_item, pkey, pvalue, source_is_dict, source_is_dict, 1)) + return -1; + } else if (pkey) { + *pkey = next_item; + } else { + *pvalue = next_item; + } + return 1; +} + +/* StringJoin */ +#if !CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values) { + return PyObject_CallMethodObjArgs(sep, __pyx_n_s_join, values, NULL); +} +#endif + +/* KeywordStringCheck */ +static int __Pyx_CheckKeywordStrings( + PyObject *kwdict, + const char* function_name, + int kw_allowed) +{ + PyObject* key = 0; + Py_ssize_t pos = 0; +#if CYTHON_COMPILING_IN_PYPY + if (!kw_allowed && PyDict_Next(kwdict, &pos, &key, 0)) + goto invalid_keyword; + return 1; +#else + while (PyDict_Next(kwdict, &pos, &key, 0)) { + #if PY_MAJOR_VERSION < 3 + if (unlikely(!PyString_Check(key))) + #endif + if (unlikely(!PyUnicode_Check(key))) + goto invalid_keyword_type; + } + if ((!kw_allowed) && unlikely(key)) + goto invalid_keyword; + return 1; +invalid_keyword_type: + PyErr_Format(PyExc_TypeError, + "%.200s() keywords must be strings", function_name); + return 0; +#endif +invalid_keyword: + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION < 3 + "%.200s() got an unexpected keyword argument '%.200s'", + function_name, PyString_AsString(key)); + #else + "%s() got an unexpected keyword argument '%U'", + function_name, key); + #endif + return 0; +} + +/* SwapException */ +#if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + #if CYTHON_USE_EXC_INFO_STACK + _PyErr_StackItem *exc_info = tstate->exc_info; + tmp_type = exc_info->exc_type; + tmp_value = exc_info->exc_value; + tmp_tb = exc_info->exc_traceback; + exc_info->exc_type = *type; + exc_info->exc_value = *value; + exc_info->exc_traceback = *tb; + #else + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = *type; + tstate->exc_value = *value; + tstate->exc_traceback = *tb; + #endif + *type = tmp_type; + *value = tmp_value; + *tb = tmp_tb; +} +#else +static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb); + PyErr_SetExcInfo(*type, *value, *tb); + *type = tmp_type; + *value = tmp_value; + *tb = tmp_tb; +} +#endif + +/* pyfrozenset_new */ +static CYTHON_INLINE PyObject* __Pyx_PyFrozenSet_New(PyObject* it) { + if (it) { + PyObject* result; +#if CYTHON_COMPILING_IN_PYPY + PyObject* args; + args = PyTuple_Pack(1, it); + if (unlikely(!args)) + return NULL; + result = PyObject_Call((PyObject*)&PyFrozenSet_Type, args, NULL); + Py_DECREF(args); + return result; +#else + if (PyFrozenSet_CheckExact(it)) { + Py_INCREF(it); + return it; + } + result = PyFrozenSet_New(it); + if (unlikely(!result)) + return NULL; + if (likely(PySet_GET_SIZE(result))) + return result; + Py_DECREF(result); +#endif + } +#if CYTHON_USE_TYPE_SLOTS + return PyFrozenSet_Type.tp_new(&PyFrozenSet_Type, __pyx_empty_tuple, NULL); +#else + return PyObject_Call((PyObject*)&PyFrozenSet_Type, __pyx_empty_tuple, NULL); +#endif +} + +/* py_set_discard_unhashable */ +static int __Pyx_PySet_DiscardUnhashable(PyObject *set, PyObject *key) { + PyObject *tmpkey; + int rv; + if (likely(!PySet_Check(key) || !PyErr_ExceptionMatches(PyExc_TypeError))) + return -1; + PyErr_Clear(); + tmpkey = __Pyx_PyFrozenSet_New(key); + if (tmpkey == NULL) + return -1; + rv = PySet_Discard(set, tmpkey); + Py_DECREF(tmpkey); + return rv; +} + +/* py_set_discard */ +static CYTHON_INLINE int __Pyx_PySet_Discard(PyObject *set, PyObject *key) { + int found = PySet_Discard(set, key); + if (unlikely(found < 0)) { + found = __Pyx_PySet_DiscardUnhashable(set, key); + } + return found; +} + +/* GetModuleGlobalName */ +#if CYTHON_USE_DICT_VERSIONS +static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value) +#else +static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) +#endif +{ + PyObject *result; +#if !CYTHON_AVOID_BORROWED_REFS +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 + result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } else if (unlikely(PyErr_Occurred())) { + return NULL; + } +#else + result = PyDict_GetItem(__pyx_d, name); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } +#endif +#else + result = PyObject_GetItem(__pyx_d, name); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } + PyErr_Clear(); +#endif + return __Pyx_GetBuiltinName(name); +} + +/* None */ +static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) { + PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname); +} + +/* SliceObject */ +static CYTHON_INLINE int __Pyx_PyObject_SetSlice(PyObject* obj, PyObject* value, + Py_ssize_t cstart, Py_ssize_t cstop, + PyObject** _py_start, PyObject** _py_stop, PyObject** _py_slice, + int has_cstart, int has_cstop, CYTHON_UNUSED int wraparound) { +#if CYTHON_USE_TYPE_SLOTS + PyMappingMethods* mp; +#if PY_MAJOR_VERSION < 3 + PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence; + if (likely(ms && ms->sq_ass_slice)) { + if (!has_cstart) { + if (_py_start && (*_py_start != Py_None)) { + cstart = __Pyx_PyIndex_AsSsize_t(*_py_start); + if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; + } else + cstart = 0; + } + if (!has_cstop) { + if (_py_stop && (*_py_stop != Py_None)) { + cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop); + if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; + } else + cstop = PY_SSIZE_T_MAX; + } + if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) { + Py_ssize_t l = ms->sq_length(obj); + if (likely(l >= 0)) { + if (cstop < 0) { + cstop += l; + if (cstop < 0) cstop = 0; + } + if (cstart < 0) { + cstart += l; + if (cstart < 0) cstart = 0; + } + } else { + if (!PyErr_ExceptionMatches(PyExc_OverflowError)) + goto bad; + PyErr_Clear(); + } + } + return ms->sq_ass_slice(obj, cstart, cstop, value); + } +#endif + mp = Py_TYPE(obj)->tp_as_mapping; + if (likely(mp && mp->mp_ass_subscript)) +#endif + { + int result; + PyObject *py_slice, *py_start, *py_stop; + if (_py_slice) { + py_slice = *_py_slice; + } else { + PyObject* owned_start = NULL; + PyObject* owned_stop = NULL; + if (_py_start) { + py_start = *_py_start; + } else { + if (has_cstart) { + owned_start = py_start = PyInt_FromSsize_t(cstart); + if (unlikely(!py_start)) goto bad; + } else + py_start = Py_None; + } + if (_py_stop) { + py_stop = *_py_stop; + } else { + if (has_cstop) { + owned_stop = py_stop = PyInt_FromSsize_t(cstop); + if (unlikely(!py_stop)) { + Py_XDECREF(owned_start); + goto bad; + } + } else + py_stop = Py_None; + } + py_slice = PySlice_New(py_start, py_stop, Py_None); + Py_XDECREF(owned_start); + Py_XDECREF(owned_stop); + if (unlikely(!py_slice)) goto bad; + } +#if CYTHON_USE_TYPE_SLOTS + result = mp->mp_ass_subscript(obj, py_slice, value); +#else + result = value ? PyObject_SetItem(obj, py_slice, value) : PyObject_DelItem(obj, py_slice); +#endif + if (!_py_slice) { + Py_DECREF(py_slice); + } + return result; + } + PyErr_Format(PyExc_TypeError, + "'%.200s' object does not support slice %.10s", + Py_TYPE(obj)->tp_name, value ? "assignment" : "deletion"); +bad: + return -1; +} + +/* PyObjectCallMethod1 */ +static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg) { + PyObject *result = __Pyx_PyObject_CallOneArg(method, arg); + Py_DECREF(method); + return result; +} +static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) { + PyObject *method = NULL, *result; + int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method); + if (likely(is_method)) { + result = __Pyx_PyObject_Call2Args(method, obj, arg); + Py_DECREF(method); + return result; + } + if (unlikely(!method)) return NULL; + return __Pyx__PyObject_CallMethod1(method, arg); +} + +/* pop_index */ +static PyObject* __Pyx__PyObject_PopNewIndex(PyObject* L, PyObject* py_ix) { + PyObject *r; + if (unlikely(!py_ix)) return NULL; + r = __Pyx__PyObject_PopIndex(L, py_ix); + Py_DECREF(py_ix); + return r; +} +static PyObject* __Pyx__PyObject_PopIndex(PyObject* L, PyObject* py_ix) { + return __Pyx_PyObject_CallMethod1(L, __pyx_n_s_pop, py_ix); +} +#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS +static PyObject* __Pyx__PyList_PopIndex(PyObject* L, PyObject* py_ix, Py_ssize_t ix) { + Py_ssize_t size = PyList_GET_SIZE(L); + if (likely(size > (((PyListObject*)L)->allocated >> 1))) { + Py_ssize_t cix = ix; + if (cix < 0) { + cix += size; + } + if (likely(__Pyx_is_valid_index(cix, size))) { + PyObject* v = PyList_GET_ITEM(L, cix); + Py_SIZE(L) -= 1; + size -= 1; + memmove(&PyList_GET_ITEM(L, cix), &PyList_GET_ITEM(L, cix+1), (size_t)(size-cix)*sizeof(PyObject*)); + return v; + } + } + if (py_ix == Py_None) { + return __Pyx__PyObject_PopNewIndex(L, PyInt_FromSsize_t(ix)); + } else { + return __Pyx__PyObject_PopIndex(L, py_ix); + } +} +#endif + +/* HasAttr */ +static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) { + PyObject *r; + if (unlikely(!__Pyx_PyBaseString_Check(n))) { + PyErr_SetString(PyExc_TypeError, + "hasattr(): attribute name must be string"); + return -1; + } + r = __Pyx_GetAttr(o, n); + if (unlikely(!r)) { + PyErr_Clear(); + return 0; + } else { + Py_DECREF(r); + return 1; + } +} + +/* set_iter */ +static CYTHON_INLINE PyObject* __Pyx_set_iterator(PyObject* iterable, int is_set, + Py_ssize_t* p_orig_length, int* p_source_is_set) { +#if CYTHON_COMPILING_IN_CPYTHON + is_set = is_set || likely(PySet_CheckExact(iterable) || PyFrozenSet_CheckExact(iterable)); + *p_source_is_set = is_set; + if (likely(is_set)) { + *p_orig_length = PySet_Size(iterable); + Py_INCREF(iterable); + return iterable; + } +#else + (void)is_set; + *p_source_is_set = 0; +#endif + *p_orig_length = 0; + return PyObject_GetIter(iterable); +} +static CYTHON_INLINE int __Pyx_set_iter_next( + PyObject* iter_obj, Py_ssize_t orig_length, + Py_ssize_t* ppos, PyObject **value, + int source_is_set) { + if (!CYTHON_COMPILING_IN_CPYTHON || unlikely(!source_is_set)) { + *value = PyIter_Next(iter_obj); + if (unlikely(!*value)) { + return __Pyx_IterFinish(); + } + (void)orig_length; + (void)ppos; + return 1; + } +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(PySet_GET_SIZE(iter_obj) != orig_length)) { + PyErr_SetString( + PyExc_RuntimeError, + "set changed size during iteration"); + return -1; + } + { + Py_hash_t hash; + int ret = _PySet_NextEntry(iter_obj, ppos, value, &hash); + assert (ret != -1); + if (likely(ret)) { + Py_INCREF(*value); + return 1; + } + } +#endif + return 0; +} + +/* ArgTypeTest */ +static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact) +{ + if (unlikely(!type)) { + PyErr_SetString(PyExc_SystemError, "Missing type object"); + return 0; + } + else if (exact) { + #if PY_MAJOR_VERSION == 2 + if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1; + #endif + } + else { + if (likely(__Pyx_TypeCheck(obj, type))) return 1; + } + PyErr_Format(PyExc_TypeError, + "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)", + name, type->tp_name, Py_TYPE(obj)->tp_name); + return 0; +} + +/* FetchCommonType */ +static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { + PyObject* fake_module; + PyTypeObject* cached_type = NULL; + fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI); + if (!fake_module) return NULL; + Py_INCREF(fake_module); + cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name); + if (cached_type) { + if (!PyType_Check((PyObject*)cached_type)) { + PyErr_Format(PyExc_TypeError, + "Shared Cython type %.200s is not a type object", + type->tp_name); + goto bad; + } + if (cached_type->tp_basicsize != type->tp_basicsize) { + PyErr_Format(PyExc_TypeError, + "Shared Cython type %.200s has the wrong size, try recompiling", + type->tp_name); + goto bad; + } + } else { + if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; + PyErr_Clear(); + if (PyType_Ready(type) < 0) goto bad; + if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0) + goto bad; + Py_INCREF(type); + cached_type = type; + } +done: + Py_DECREF(fake_module); + return cached_type; +bad: + Py_XDECREF(cached_type); + cached_type = NULL; + goto done; +} + +/* CythonFunction */ +#include +static PyObject * +__Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure) +{ + if (unlikely(op->func_doc == NULL)) { + if (op->func.m_ml->ml_doc) { +#if PY_MAJOR_VERSION >= 3 + op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc); +#else + op->func_doc = PyString_FromString(op->func.m_ml->ml_doc); +#endif + if (unlikely(op->func_doc == NULL)) + return NULL; + } else { + Py_INCREF(Py_None); + return Py_None; + } + } + Py_INCREF(op->func_doc); + return op->func_doc; +} +static int +__Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context) +{ + PyObject *tmp = op->func_doc; + if (value == NULL) { + value = Py_None; + } + Py_INCREF(value); + op->func_doc = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + if (unlikely(op->func_name == NULL)) { +#if PY_MAJOR_VERSION >= 3 + op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name); +#else + op->func_name = PyString_InternFromString(op->func.m_ml->ml_name); +#endif + if (unlikely(op->func_name == NULL)) + return NULL; + } + Py_INCREF(op->func_name); + return op->func_name; +} +static int +__Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context) +{ + PyObject *tmp; +#if PY_MAJOR_VERSION >= 3 + if (unlikely(value == NULL || !PyUnicode_Check(value))) +#else + if (unlikely(value == NULL || !PyString_Check(value))) +#endif + { + PyErr_SetString(PyExc_TypeError, + "__name__ must be set to a string object"); + return -1; + } + tmp = op->func_name; + Py_INCREF(value); + op->func_name = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + Py_INCREF(op->func_qualname); + return op->func_qualname; +} +static int +__Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context) +{ + PyObject *tmp; +#if PY_MAJOR_VERSION >= 3 + if (unlikely(value == NULL || !PyUnicode_Check(value))) +#else + if (unlikely(value == NULL || !PyString_Check(value))) +#endif + { + PyErr_SetString(PyExc_TypeError, + "__qualname__ must be set to a string object"); + return -1; + } + tmp = op->func_qualname; + Py_INCREF(value); + op->func_qualname = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED void *closure) +{ + PyObject *self; + self = m->func_closure; + if (self == NULL) + self = Py_None; + Py_INCREF(self); + return self; +} +static PyObject * +__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + if (unlikely(op->func_dict == NULL)) { + op->func_dict = PyDict_New(); + if (unlikely(op->func_dict == NULL)) + return NULL; + } + Py_INCREF(op->func_dict); + return op->func_dict; +} +static int +__Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context) +{ + PyObject *tmp; + if (unlikely(value == NULL)) { + PyErr_SetString(PyExc_TypeError, + "function's dictionary may not be deleted"); + return -1; + } + if (unlikely(!PyDict_Check(value))) { + PyErr_SetString(PyExc_TypeError, + "setting function's dictionary to a non-dict"); + return -1; + } + tmp = op->func_dict; + Py_INCREF(value); + op->func_dict = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + Py_INCREF(op->func_globals); + return op->func_globals; +} +static PyObject * +__Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + Py_INCREF(Py_None); + return Py_None; +} +static PyObject * +__Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + PyObject* result = (op->func_code) ? op->func_code : Py_None; + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { + int result = 0; + PyObject *res = op->defaults_getter((PyObject *) op); + if (unlikely(!res)) + return -1; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + op->defaults_tuple = PyTuple_GET_ITEM(res, 0); + Py_INCREF(op->defaults_tuple); + op->defaults_kwdict = PyTuple_GET_ITEM(res, 1); + Py_INCREF(op->defaults_kwdict); + #else + op->defaults_tuple = PySequence_ITEM(res, 0); + if (unlikely(!op->defaults_tuple)) result = -1; + else { + op->defaults_kwdict = PySequence_ITEM(res, 1); + if (unlikely(!op->defaults_kwdict)) result = -1; + } + #endif + Py_DECREF(res); + return result; +} +static int +__Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) { + PyObject* tmp; + if (!value) { + value = Py_None; + } else if (value != Py_None && !PyTuple_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__defaults__ must be set to a tuple object"); + return -1; + } + Py_INCREF(value); + tmp = op->defaults_tuple; + op->defaults_tuple = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) { + PyObject* result = op->defaults_tuple; + if (unlikely(!result)) { + if (op->defaults_getter) { + if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL; + result = op->defaults_tuple; + } else { + result = Py_None; + } + } + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) { + PyObject* tmp; + if (!value) { + value = Py_None; + } else if (value != Py_None && !PyDict_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__kwdefaults__ must be set to a dict object"); + return -1; + } + Py_INCREF(value); + tmp = op->defaults_kwdict; + op->defaults_kwdict = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) { + PyObject* result = op->defaults_kwdict; + if (unlikely(!result)) { + if (op->defaults_getter) { + if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL; + result = op->defaults_kwdict; + } else { + result = Py_None; + } + } + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) { + PyObject* tmp; + if (!value || value == Py_None) { + value = NULL; + } else if (!PyDict_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__annotations__ must be set to a dict object"); + return -1; + } + Py_XINCREF(value); + tmp = op->func_annotations; + op->func_annotations = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) { + PyObject* result = op->func_annotations; + if (unlikely(!result)) { + result = PyDict_New(); + if (unlikely(!result)) return NULL; + op->func_annotations = result; + } + Py_INCREF(result); + return result; +} +static PyGetSetDef __pyx_CyFunction_getsets[] = { + {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, + {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, + {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, + {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, + {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, + {(char *) "__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0}, + {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, + {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, + {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, + {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, + {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, + {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, + {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, + {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, + {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, + {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, + {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, + {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, + {0, 0, 0, 0, 0} +}; +static PyMemberDef __pyx_CyFunction_members[] = { + {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), PY_WRITE_RESTRICTED, 0}, + {0, 0, 0, 0, 0} +}; +static PyObject * +__Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args) +{ +#if PY_MAJOR_VERSION >= 3 + return PyUnicode_FromString(m->func.m_ml->ml_name); +#else + return PyString_FromString(m->func.m_ml->ml_name); +#endif +} +static PyMethodDef __pyx_CyFunction_methods[] = { + {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, + {0, 0, 0, 0} +}; +#if PY_VERSION_HEX < 0x030500A0 +#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist) +#else +#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func.m_weakreflist) +#endif +static PyObject *__Pyx_CyFunction_New(PyTypeObject *type, PyMethodDef *ml, int flags, PyObject* qualname, + PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { + __pyx_CyFunctionObject *op = PyObject_GC_New(__pyx_CyFunctionObject, type); + if (op == NULL) + return NULL; + op->flags = flags; + __Pyx_CyFunction_weakreflist(op) = NULL; + op->func.m_ml = ml; + op->func.m_self = (PyObject *) op; + Py_XINCREF(closure); + op->func_closure = closure; + Py_XINCREF(module); + op->func.m_module = module; + op->func_dict = NULL; + op->func_name = NULL; + Py_INCREF(qualname); + op->func_qualname = qualname; + op->func_doc = NULL; + op->func_classobj = NULL; + op->func_globals = globals; + Py_INCREF(op->func_globals); + Py_XINCREF(code); + op->func_code = code; + op->defaults_pyobjects = 0; + op->defaults = NULL; + op->defaults_tuple = NULL; + op->defaults_kwdict = NULL; + op->defaults_getter = NULL; + op->func_annotations = NULL; + PyObject_GC_Track(op); + return (PyObject *) op; +} +static int +__Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) +{ + Py_CLEAR(m->func_closure); + Py_CLEAR(m->func.m_module); + Py_CLEAR(m->func_dict); + Py_CLEAR(m->func_name); + Py_CLEAR(m->func_qualname); + Py_CLEAR(m->func_doc); + Py_CLEAR(m->func_globals); + Py_CLEAR(m->func_code); + Py_CLEAR(m->func_classobj); + Py_CLEAR(m->defaults_tuple); + Py_CLEAR(m->defaults_kwdict); + Py_CLEAR(m->func_annotations); + if (m->defaults) { + PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); + int i; + for (i = 0; i < m->defaults_pyobjects; i++) + Py_XDECREF(pydefaults[i]); + PyObject_Free(m->defaults); + m->defaults = NULL; + } + return 0; +} +static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m) +{ + if (__Pyx_CyFunction_weakreflist(m) != NULL) + PyObject_ClearWeakRefs((PyObject *) m); + __Pyx_CyFunction_clear(m); + PyObject_GC_Del(m); +} +static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) +{ + PyObject_GC_UnTrack(m); + __Pyx__CyFunction_dealloc(m); +} +static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) +{ + Py_VISIT(m->func_closure); + Py_VISIT(m->func.m_module); + Py_VISIT(m->func_dict); + Py_VISIT(m->func_name); + Py_VISIT(m->func_qualname); + Py_VISIT(m->func_doc); + Py_VISIT(m->func_globals); + Py_VISIT(m->func_code); + Py_VISIT(m->func_classobj); + Py_VISIT(m->defaults_tuple); + Py_VISIT(m->defaults_kwdict); + if (m->defaults) { + PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); + int i; + for (i = 0; i < m->defaults_pyobjects; i++) + Py_VISIT(pydefaults[i]); + } + return 0; +} +static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type) +{ + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) { + Py_INCREF(func); + return func; + } + if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) { + if (type == NULL) + type = (PyObject *)(Py_TYPE(obj)); + return __Pyx_PyMethod_New(func, type, (PyObject *)(Py_TYPE(type))); + } + if (obj == Py_None) + obj = NULL; + return __Pyx_PyMethod_New(func, obj, type); +} +static PyObject* +__Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) +{ +#if PY_MAJOR_VERSION >= 3 + return PyUnicode_FromFormat("", + op->func_qualname, (void *)op); +#else + return PyString_FromFormat("", + PyString_AsString(op->func_qualname), (void *)op); +#endif +} +static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) { + PyCFunctionObject* f = (PyCFunctionObject*)func; + PyCFunction meth = f->m_ml->ml_meth; + Py_ssize_t size; + switch (f->m_ml->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) { + case METH_VARARGS: + if (likely(kw == NULL || PyDict_Size(kw) == 0)) + return (*meth)(self, arg); + break; + case METH_VARARGS | METH_KEYWORDS: + return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw); + case METH_NOARGS: + if (likely(kw == NULL || PyDict_Size(kw) == 0)) { + size = PyTuple_GET_SIZE(arg); + if (likely(size == 0)) + return (*meth)(self, NULL); + PyErr_Format(PyExc_TypeError, + "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", + f->m_ml->ml_name, size); + return NULL; + } + break; + case METH_O: + if (likely(kw == NULL || PyDict_Size(kw) == 0)) { + size = PyTuple_GET_SIZE(arg); + if (likely(size == 1)) { + PyObject *result, *arg0; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + arg0 = PyTuple_GET_ITEM(arg, 0); + #else + arg0 = PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL; + #endif + result = (*meth)(self, arg0); + #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) + Py_DECREF(arg0); + #endif + return result; + } + PyErr_Format(PyExc_TypeError, + "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", + f->m_ml->ml_name, size); + return NULL; + } + break; + default: + PyErr_SetString(PyExc_SystemError, "Bad call flags in " + "__Pyx_CyFunction_Call. METH_OLDARGS is no " + "longer supported!"); + return NULL; + } + PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", + f->m_ml->ml_name); + return NULL; +} +static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { + return __Pyx_CyFunction_CallMethod(func, ((PyCFunctionObject*)func)->m_self, arg, kw); +} +static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) { + PyObject *result; + __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func; + if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { + Py_ssize_t argc; + PyObject *new_args; + PyObject *self; + argc = PyTuple_GET_SIZE(args); + new_args = PyTuple_GetSlice(args, 1, argc); + if (unlikely(!new_args)) + return NULL; + self = PyTuple_GetItem(args, 0); + if (unlikely(!self)) { + Py_DECREF(new_args); + return NULL; + } + result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw); + Py_DECREF(new_args); + } else { + result = __Pyx_CyFunction_Call(func, args, kw); + } + return result; +} +static PyTypeObject __pyx_CyFunctionType_type = { + PyVarObject_HEAD_INIT(0, 0) + "cython_function_or_method", + sizeof(__pyx_CyFunctionObject), + 0, + (destructor) __Pyx_CyFunction_dealloc, + 0, + 0, + 0, +#if PY_MAJOR_VERSION < 3 + 0, +#else + 0, +#endif + (reprfunc) __Pyx_CyFunction_repr, + 0, + 0, + 0, + 0, + __Pyx_CyFunction_CallAsMethod, + 0, + 0, + 0, + 0, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, + 0, + (traverseproc) __Pyx_CyFunction_traverse, + (inquiry) __Pyx_CyFunction_clear, + 0, +#if PY_VERSION_HEX < 0x030500A0 + offsetof(__pyx_CyFunctionObject, func_weakreflist), +#else + offsetof(PyCFunctionObject, m_weakreflist), +#endif + 0, + 0, + __pyx_CyFunction_methods, + __pyx_CyFunction_members, + __pyx_CyFunction_getsets, + 0, + 0, + __Pyx_CyFunction_descr_get, + 0, + offsetof(__pyx_CyFunctionObject, func_dict), + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, +#if PY_VERSION_HEX >= 0x030400a1 + 0, +#endif +}; +static int __pyx_CyFunction_init(void) { + __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); + if (unlikely(__pyx_CyFunctionType == NULL)) { + return -1; + } + return 0; +} +static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults = PyObject_Malloc(size); + if (unlikely(!m->defaults)) + return PyErr_NoMemory(); + memset(m->defaults, 0, size); + m->defaults_pyobjects = pyobjects; + return m->defaults; +} +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults_tuple = tuple; + Py_INCREF(tuple); +} +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults_kwdict = dict; + Py_INCREF(dict); +} +static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->func_annotations = dict; + Py_INCREF(dict); +} + +/* PyObject_GenericGetAttrNoDict */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) { + PyErr_Format(PyExc_AttributeError, +#if PY_MAJOR_VERSION >= 3 + "'%.50s' object has no attribute '%U'", + tp->tp_name, attr_name); +#else + "'%.50s' object has no attribute '%.400s'", + tp->tp_name, PyString_AS_STRING(attr_name)); +#endif + return NULL; +} +static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) { + PyObject *descr; + PyTypeObject *tp = Py_TYPE(obj); + if (unlikely(!PyString_Check(attr_name))) { + return PyObject_GenericGetAttr(obj, attr_name); + } + assert(!tp->tp_dictoffset); + descr = _PyType_Lookup(tp, attr_name); + if (unlikely(!descr)) { + return __Pyx_RaiseGenericGetAttributeError(tp, attr_name); + } + Py_INCREF(descr); + #if PY_MAJOR_VERSION < 3 + if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS))) + #endif + { + descrgetfunc f = Py_TYPE(descr)->tp_descr_get; + if (unlikely(f)) { + PyObject *res = f(descr, obj, (PyObject *)tp); + Py_DECREF(descr); + return res; + } + } + return descr; +} +#endif + +/* PyObject_GenericGetAttr */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) { + if (unlikely(Py_TYPE(obj)->tp_dictoffset)) { + return PyObject_GenericGetAttr(obj, attr_name); + } + return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name); +} +#endif + +/* CallNextTpDealloc */ +static void __Pyx_call_next_tp_dealloc(PyObject* obj, destructor current_tp_dealloc) { + PyTypeObject* type = Py_TYPE(obj); + while (type && type->tp_dealloc != current_tp_dealloc) + type = type->tp_base; + while (type && type->tp_dealloc == current_tp_dealloc) + type = type->tp_base; + if (type) + type->tp_dealloc(obj); +} + +/* CallNextTpTraverse */ +static int __Pyx_call_next_tp_traverse(PyObject* obj, visitproc v, void *a, traverseproc current_tp_traverse) { + PyTypeObject* type = Py_TYPE(obj); + while (type && type->tp_traverse != current_tp_traverse) + type = type->tp_base; + while (type && type->tp_traverse == current_tp_traverse) + type = type->tp_base; + if (type && type->tp_traverse) + return type->tp_traverse(obj, v, a); + return 0; +} + +/* CallNextTpClear */ +static void __Pyx_call_next_tp_clear(PyObject* obj, inquiry current_tp_clear) { + PyTypeObject* type = Py_TYPE(obj); + while (type && type->tp_clear != current_tp_clear) + type = type->tp_base; + while (type && type->tp_clear == current_tp_clear) + type = type->tp_base; + if (type && type->tp_clear) + type->tp_clear(obj); +} + +/* TypeImport */ +#ifndef __PYX_HAVE_RT_ImportType +#define __PYX_HAVE_RT_ImportType +static PyTypeObject *__Pyx_ImportType(PyObject *module, const char *module_name, const char *class_name, + size_t size, enum __Pyx_ImportType_CheckSize check_size) +{ + PyObject *result = 0; + char warning[200]; + Py_ssize_t basicsize; +#ifdef Py_LIMITED_API + PyObject *py_basicsize; +#endif + result = PyObject_GetAttrString(module, class_name); + if (!result) + goto bad; + if (!PyType_Check(result)) { + PyErr_Format(PyExc_TypeError, + "%.200s.%.200s is not a type object", + module_name, class_name); + goto bad; + } +#ifndef Py_LIMITED_API + basicsize = ((PyTypeObject *)result)->tp_basicsize; +#else + py_basicsize = PyObject_GetAttrString(result, "__basicsize__"); + if (!py_basicsize) + goto bad; + basicsize = PyLong_AsSsize_t(py_basicsize); + Py_DECREF(py_basicsize); + py_basicsize = 0; + if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred()) + goto bad; +#endif + if ((size_t)basicsize < size) { + PyErr_Format(PyExc_ValueError, + "%.200s.%.200s size changed, may indicate binary incompatibility. " + "Expected %zd from C header, got %zd from PyObject", + module_name, class_name, size, basicsize); + goto bad; + } + if (check_size == __Pyx_ImportType_CheckSize_Error && (size_t)basicsize != size) { + PyErr_Format(PyExc_ValueError, + "%.200s.%.200s size changed, may indicate binary incompatibility. " + "Expected %zd from C header, got %zd from PyObject", + module_name, class_name, size, basicsize); + goto bad; + } + else if (check_size == __Pyx_ImportType_CheckSize_Warn && (size_t)basicsize > size) { + PyOS_snprintf(warning, sizeof(warning), + "%s.%s size changed, may indicate binary incompatibility. " + "Expected %zd from C header, got %zd from PyObject", + module_name, class_name, size, basicsize); + if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad; + } + return (PyTypeObject *)result; +bad: + Py_XDECREF(result); + return NULL; +} +#endif + +/* SetVTable */ +static int __Pyx_SetVtable(PyObject *dict, void *vtable) { +#if PY_VERSION_HEX >= 0x02070000 + PyObject *ob = PyCapsule_New(vtable, 0, 0); +#else + PyObject *ob = PyCObject_FromVoidPtr(vtable, 0); +#endif + if (!ob) + goto bad; + if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0) + goto bad; + Py_DECREF(ob); + return 0; +bad: + Py_XDECREF(ob); + return -1; +} + +/* GetVTable */ +static void* __Pyx_GetVtable(PyObject *dict) { + void* ptr; + PyObject *ob = PyObject_GetItem(dict, __pyx_n_s_pyx_vtable); + if (!ob) + goto bad; +#if PY_VERSION_HEX >= 0x02070000 + ptr = PyCapsule_GetPointer(ob, 0); +#else + ptr = PyCObject_AsVoidPtr(ob); +#endif + if (!ptr && !PyErr_Occurred()) + PyErr_SetString(PyExc_RuntimeError, "invalid vtable found for imported type"); + Py_DECREF(ob); + return ptr; +bad: + Py_XDECREF(ob); + return NULL; +} + +/* Import */ +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { + PyObject *empty_list = 0; + PyObject *module = 0; + PyObject *global_dict = 0; + PyObject *empty_dict = 0; + PyObject *list; + #if PY_MAJOR_VERSION < 3 + PyObject *py_import; + py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); + if (!py_import) + goto bad; + #endif + if (from_list) + list = from_list; + else { + empty_list = PyList_New(0); + if (!empty_list) + goto bad; + list = empty_list; + } + global_dict = PyModule_GetDict(__pyx_m); + if (!global_dict) + goto bad; + empty_dict = PyDict_New(); + if (!empty_dict) + goto bad; + { + #if PY_MAJOR_VERSION >= 3 + if (level == -1) { + if (strchr(__Pyx_MODULE_NAME, '.')) { + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, 1); + if (!module) { + if (!PyErr_ExceptionMatches(PyExc_ImportError)) + goto bad; + PyErr_Clear(); + } + } + level = 0; + } + #endif + if (!module) { + #if PY_MAJOR_VERSION < 3 + PyObject *py_level = PyInt_FromLong(level); + if (!py_level) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, py_level, (PyObject *)NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, level); + #endif + } + } +bad: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(py_import); + #endif + Py_XDECREF(empty_list); + Py_XDECREF(empty_dict); + return module; +} + +/* ImportFrom */ +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { + PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); + if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_Format(PyExc_ImportError, + #if PY_MAJOR_VERSION < 3 + "cannot import name %.230s", PyString_AS_STRING(name)); + #else + "cannot import name %S", name); + #endif + } + return value; +} + +/* GetNameInClass */ +static PyObject *__Pyx_GetGlobalNameAfterAttributeLookup(PyObject *name) { + PyObject *result; + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) + return NULL; + __Pyx_PyErr_Clear(); + __Pyx_GetModuleGlobalNameUncached(result, name); + return result; +} +static PyObject *__Pyx__GetNameInClass(PyObject *nmspace, PyObject *name) { + PyObject *result; + result = __Pyx_PyObject_GetAttrStr(nmspace, name); + if (!result) { + result = __Pyx_GetGlobalNameAfterAttributeLookup(name); + } + return result; +} + +/* ClassMethod */ +static PyObject* __Pyx_Method_ClassMethod(PyObject *method) { +#if CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM <= 0x05080000 + if (PyObject_TypeCheck(method, &PyWrapperDescr_Type)) { + return PyClassMethod_New(method); + } +#else +#if CYTHON_COMPILING_IN_PYSTON || CYTHON_COMPILING_IN_PYPY + if (PyMethodDescr_Check(method)) +#else + static PyTypeObject *methoddescr_type = NULL; + if (methoddescr_type == NULL) { + PyObject *meth = PyObject_GetAttrString((PyObject*)&PyList_Type, "append"); + if (!meth) return NULL; + methoddescr_type = Py_TYPE(meth); + Py_DECREF(meth); + } + if (__Pyx_TypeCheck(method, methoddescr_type)) +#endif + { + PyMethodDescrObject *descr = (PyMethodDescrObject *)method; + #if PY_VERSION_HEX < 0x03020000 + PyTypeObject *d_type = descr->d_type; + #else + PyTypeObject *d_type = descr->d_common.d_type; + #endif + return PyDescr_NewClassMethod(d_type, descr->d_method); + } +#endif + else if (PyMethod_Check(method)) { + return PyClassMethod_New(PyMethod_GET_FUNCTION(method)); + } + else if (PyCFunction_Check(method)) { + return PyClassMethod_New(method); + } +#ifdef __Pyx_CyFunction_USED + else if (__Pyx_CyFunction_Check(method)) { + return PyClassMethod_New(method); + } +#endif + PyErr_SetString(PyExc_TypeError, + "Class-level classmethod() can only be called on " + "a method_descriptor or instance method."); + return NULL; +} + +/* Globals */ +static PyObject* __Pyx_Globals(void) { + Py_ssize_t i; + PyObject *names; + PyObject *globals = __pyx_d; + Py_INCREF(globals); + names = PyObject_Dir(__pyx_m); + if (!names) + goto bad; + for (i = PyList_GET_SIZE(names)-1; i >= 0; i--) { +#if CYTHON_COMPILING_IN_PYPY + PyObject* name = PySequence_ITEM(names, i); + if (!name) + goto bad; +#else + PyObject* name = PyList_GET_ITEM(names, i); +#endif + if (!PyDict_Contains(globals, name)) { + PyObject* value = __Pyx_GetAttr(__pyx_m, name); + if (!value) { +#if CYTHON_COMPILING_IN_PYPY + Py_DECREF(name); +#endif + goto bad; + } + if (PyDict_SetItem(globals, name, value) < 0) { +#if CYTHON_COMPILING_IN_PYPY + Py_DECREF(name); +#endif + Py_DECREF(value); + goto bad; + } + } +#if CYTHON_COMPILING_IN_PYPY + Py_DECREF(name); +#endif + } + Py_DECREF(names); + return globals; +bad: + Py_XDECREF(names); + Py_XDECREF(globals); + return NULL; +} + +/* CLineInTraceback */ +#ifndef CYTHON_CLINE_IN_TRACEBACK +static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { + PyObject *use_cline; + PyObject *ptype, *pvalue, *ptraceback; +#if CYTHON_COMPILING_IN_CPYTHON + PyObject **cython_runtime_dict; +#endif + if (unlikely(!__pyx_cython_runtime)) { + return c_line; + } + __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); +#if CYTHON_COMPILING_IN_CPYTHON + cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); + if (likely(cython_runtime_dict)) { + __PYX_PY_DICT_LOOKUP_IF_MODIFIED( + use_cline, *cython_runtime_dict, + __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback)) + } else +#endif + { + PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback); + if (use_cline_obj) { + use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; + Py_DECREF(use_cline_obj); + } else { + PyErr_Clear(); + use_cline = NULL; + } + } + if (!use_cline) { + c_line = 0; + PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); + } + else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { + c_line = 0; + } + __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); + return c_line; +} +#endif + +/* CodeObjectCache */ +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { + int start = 0, mid = 0, end = count - 1; + if (end >= 0 && code_line > entries[end].code_line) { + return count; + } + while (start < end) { + mid = start + (end - start) / 2; + if (code_line < entries[mid].code_line) { + end = mid; + } else if (code_line > entries[mid].code_line) { + start = mid + 1; + } else { + return mid; + } + } + if (code_line <= entries[mid].code_line) { + return mid; + } else { + return mid + 1; + } +} +static PyCodeObject *__pyx_find_code_object(int code_line) { + PyCodeObject* code_object; + int pos; + if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { + return NULL; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { + return NULL; + } + code_object = __pyx_code_cache.entries[pos].code_object; + Py_INCREF(code_object); + return code_object; +} +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { + int pos, i; + __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; + if (unlikely(!code_line)) { + return; + } + if (unlikely(!entries)) { + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); + if (likely(entries)) { + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = 64; + __pyx_code_cache.count = 1; + entries[0].code_line = code_line; + entries[0].code_object = code_object; + Py_INCREF(code_object); + } + return; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { + PyCodeObject* tmp = entries[pos].code_object; + entries[pos].code_object = code_object; + Py_DECREF(tmp); + return; + } + if (__pyx_code_cache.count == __pyx_code_cache.max_count) { + int new_max = __pyx_code_cache.max_count + 64; + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( + __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry)); + if (unlikely(!entries)) { + return; + } + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = new_max; + } + for (i=__pyx_code_cache.count; i>pos; i--) { + entries[i] = entries[i-1]; + } + entries[pos].code_line = code_line; + entries[pos].code_object = code_object; + __pyx_code_cache.count++; + Py_INCREF(code_object); +} + +/* AddTraceback */ +#include "compile.h" +#include "frameobject.h" +#include "traceback.h" +static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( + const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyObject *py_srcfile = 0; + PyObject *py_funcname = 0; + #if PY_MAJOR_VERSION < 3 + py_srcfile = PyString_FromString(filename); + #else + py_srcfile = PyUnicode_FromString(filename); + #endif + if (!py_srcfile) goto bad; + if (c_line) { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + #else + py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + #endif + } + else { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromString(funcname); + #else + py_funcname = PyUnicode_FromString(funcname); + #endif + } + if (!py_funcname) goto bad; + py_code = __Pyx_PyCode_New( + 0, + 0, + 0, + 0, + 0, + __pyx_empty_bytes, /*PyObject *code,*/ + __pyx_empty_tuple, /*PyObject *consts,*/ + __pyx_empty_tuple, /*PyObject *names,*/ + __pyx_empty_tuple, /*PyObject *varnames,*/ + __pyx_empty_tuple, /*PyObject *freevars,*/ + __pyx_empty_tuple, /*PyObject *cellvars,*/ + py_srcfile, /*PyObject *filename,*/ + py_funcname, /*PyObject *name,*/ + py_line, + __pyx_empty_bytes /*PyObject *lnotab*/ + ); + Py_DECREF(py_srcfile); + Py_DECREF(py_funcname); + return py_code; +bad: + Py_XDECREF(py_srcfile); + Py_XDECREF(py_funcname); + return NULL; +} +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyFrameObject *py_frame = 0; + PyThreadState *tstate = __Pyx_PyThreadState_Current; + if (c_line) { + c_line = __Pyx_CLineForTraceback(tstate, c_line); + } + py_code = __pyx_find_code_object(c_line ? -c_line : py_line); + if (!py_code) { + py_code = __Pyx_CreateCodeObjectForTraceback( + funcname, c_line, py_line, filename); + if (!py_code) goto bad; + __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); + } + py_frame = PyFrame_New( + tstate, /*PyThreadState *tstate,*/ + py_code, /*PyCodeObject *code,*/ + __pyx_d, /*PyObject *globals,*/ + 0 /*PyObject *locals*/ + ); + if (!py_frame) goto bad; + __Pyx_PyFrame_SetLineNumber(py_frame, py_line); + PyTraceBack_Here(py_frame); +bad: + Py_XDECREF(py_code); + Py_XDECREF(py_frame); +} + +/* CIntFromPyVerify */ +#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ + __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) +#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ + __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) +#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ + {\ + func_type value = func_value;\ + if (sizeof(target_type) < sizeof(func_type)) {\ + if (unlikely(value != (func_type) (target_type) value)) {\ + func_type zero = 0;\ + if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ + return (target_type) -1;\ + if (is_unsigned && unlikely(value < zero))\ + goto raise_neg_overflow;\ + else\ + goto raise_overflow;\ + }\ + }\ + return (target_type) value;\ + } + +/* CIntToPy */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { + const int neg_one = (int) ((int) 0 - (int) 1), const_zero = (int) 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(int) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(int) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(int) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(int), + little, !is_unsigned); + } +} + +/* CIntToPy */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { + const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(long) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(long) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(long) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(long), + little, !is_unsigned); + } +} + +/* CIntFromPy */ +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { + const int neg_one = (int) ((int) 0 - (int) 1), const_zero = (int) 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(int) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (int) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (int) 0; + case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0]) + case 2: + if (8 * sizeof(int) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) { + return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + case 3: + if (8 * sizeof(int) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) { + return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + case 4: + if (8 * sizeof(int) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) { + return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (int) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if (sizeof(int) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (int) 0; + case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0])) + case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0]) + case -2: + if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { + return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 2: + if (8 * sizeof(int) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { + return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case -3: + if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { + return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 3: + if (8 * sizeof(int) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { + return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case -4: + if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { + return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 4: + if (8 * sizeof(int) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { + return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + } +#endif + if (sizeof(int) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + int val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (int) -1; + } + } else { + int val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (int) -1; + val = __Pyx_PyInt_As_int(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to int"); + return (int) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to int"); + return (int) -1; +} + +/* CIntFromPy */ +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { + const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(long) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (long) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (long) 0; + case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0]) + case 2: + if (8 * sizeof(long) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) { + return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + case 3: + if (8 * sizeof(long) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) { + return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + case 4: + if (8 * sizeof(long) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) { + return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (long) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if (sizeof(long) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (long) 0; + case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0])) + case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0]) + case -2: + if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 2: + if (8 * sizeof(long) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case -3: + if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 3: + if (8 * sizeof(long) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case -4: + if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 4: + if (8 * sizeof(long) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + } +#endif + if (sizeof(long) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + long val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (long) -1; + } + } else { + long val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (long) -1; + val = __Pyx_PyInt_As_long(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to long"); + return (long) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to long"); + return (long) -1; +} + +/* FastTypeChecks */ +#if CYTHON_COMPILING_IN_CPYTHON +static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) { + while (a) { + a = a->tp_base; + if (a == b) + return 1; + } + return b == &PyBaseObject_Type; +} +static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) { + PyObject *mro; + if (a == b) return 1; + mro = a->tp_mro; + if (likely(mro)) { + Py_ssize_t i, n; + n = PyTuple_GET_SIZE(mro); + for (i = 0; i < n; i++) { + if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b) + return 1; + } + return 0; + } + return __Pyx_InBases(a, b); +} +#if PY_MAJOR_VERSION == 2 +static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { + PyObject *exception, *value, *tb; + int res; + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ErrFetch(&exception, &value, &tb); + res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; + if (unlikely(res == -1)) { + PyErr_WriteUnraisable(err); + res = 0; + } + if (!res) { + res = PyObject_IsSubclass(err, exc_type2); + if (unlikely(res == -1)) { + PyErr_WriteUnraisable(err); + res = 0; + } + } + __Pyx_ErrRestore(exception, value, tb); + return res; +} +#else +static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { + int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0; + if (!res) { + res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); + } + return res; +} +#endif +static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { + Py_ssize_t i, n; + assert(PyExceptionClass_Check(exc_type)); + n = PyTuple_GET_SIZE(tuple); +#if PY_MAJOR_VERSION >= 3 + for (i=0; i= 0x02070000 + cobj = PyCapsule_New(p, sig, 0); +#else + cobj = PyCObject_FromVoidPtrAndDesc(p, (void *)sig, 0); +#endif + if (!cobj) + goto bad; + if (PyDict_SetItem(d, name, cobj) < 0) + goto bad; + Py_DECREF(cobj); + Py_DECREF(d); + return 0; +bad: + Py_XDECREF(cobj); + Py_XDECREF(d); + return -1; +} + +/* FunctionExport */ +static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig) { + PyObject *d = 0; + PyObject *cobj = 0; + union { + void (*fp)(void); + void *p; + } tmp; + d = PyObject_GetAttrString(__pyx_m, (char *)"__pyx_capi__"); + if (!d) { + PyErr_Clear(); + d = PyDict_New(); + if (!d) + goto bad; + Py_INCREF(d); + if (PyModule_AddObject(__pyx_m, (char *)"__pyx_capi__", d) < 0) + goto bad; + } + tmp.fp = f; +#if PY_VERSION_HEX >= 0x02070000 + cobj = PyCapsule_New(tmp.p, sig, 0); +#else + cobj = PyCObject_FromVoidPtrAndDesc(tmp.p, (void *)sig, 0); +#endif + if (!cobj) + goto bad; + if (PyDict_SetItemString(d, name, cobj) < 0) + goto bad; + Py_DECREF(cobj); + Py_DECREF(d); + return 0; +bad: + Py_XDECREF(cobj); + Py_XDECREF(d); + return -1; +} + +/* VoidPtrImport */ +#ifndef __PYX_HAVE_RT_ImportVoidPtr +#define __PYX_HAVE_RT_ImportVoidPtr +static int __Pyx_ImportVoidPtr(PyObject *module, const char *name, void **p, const char *sig) { + PyObject *d = 0; + PyObject *cobj = 0; + d = PyObject_GetAttrString(module, (char *)"__pyx_capi__"); + if (!d) + goto bad; + cobj = PyDict_GetItemString(d, name); + if (!cobj) { + PyErr_Format(PyExc_ImportError, + "%.200s does not export expected C variable %.200s", + PyModule_GetName(module), name); + goto bad; + } +#if PY_VERSION_HEX >= 0x02070000 + if (!PyCapsule_IsValid(cobj, sig)) { + PyErr_Format(PyExc_TypeError, + "C variable %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", + PyModule_GetName(module), name, sig, PyCapsule_GetName(cobj)); + goto bad; + } + *p = PyCapsule_GetPointer(cobj, sig); +#else + {const char *desc, *s1, *s2; + desc = (const char *)PyCObject_GetDesc(cobj); + if (!desc) + goto bad; + s1 = desc; s2 = sig; + while (*s1 != '\0' && *s1 == *s2) { s1++; s2++; } + if (*s1 != *s2) { + PyErr_Format(PyExc_TypeError, + "C variable %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", + PyModule_GetName(module), name, sig, desc); + goto bad; + } + *p = PyCObject_AsVoidPtr(cobj);} +#endif + if (!(*p)) + goto bad; + Py_DECREF(d); + return 0; +bad: + Py_XDECREF(d); + return -1; +} +#endif + +/* FunctionImport */ +#ifndef __PYX_HAVE_RT_ImportFunction +#define __PYX_HAVE_RT_ImportFunction +static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig) { + PyObject *d = 0; + PyObject *cobj = 0; + union { + void (*fp)(void); + void *p; + } tmp; + d = PyObject_GetAttrString(module, (char *)"__pyx_capi__"); + if (!d) + goto bad; + cobj = PyDict_GetItemString(d, funcname); + if (!cobj) { + PyErr_Format(PyExc_ImportError, + "%.200s does not export expected C function %.200s", + PyModule_GetName(module), funcname); + goto bad; + } +#if PY_VERSION_HEX >= 0x02070000 + if (!PyCapsule_IsValid(cobj, sig)) { + PyErr_Format(PyExc_TypeError, + "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", + PyModule_GetName(module), funcname, sig, PyCapsule_GetName(cobj)); + goto bad; + } + tmp.p = PyCapsule_GetPointer(cobj, sig); +#else + {const char *desc, *s1, *s2; + desc = (const char *)PyCObject_GetDesc(cobj); + if (!desc) + goto bad; + s1 = desc; s2 = sig; + while (*s1 != '\0' && *s1 == *s2) { s1++; s2++; } + if (*s1 != *s2) { + PyErr_Format(PyExc_TypeError, + "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", + PyModule_GetName(module), funcname, sig, desc); + goto bad; + } + tmp.p = PyCObject_AsVoidPtr(cobj);} +#endif + *f = tmp.fp; + if (!(*f)) + goto bad; + Py_DECREF(d); + return 0; +bad: + Py_XDECREF(d); + return -1; +} +#endif + +/* InitStrings */ +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { + while (t->p) { + #if PY_MAJOR_VERSION < 3 + if (t->is_unicode) { + *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); + } else if (t->intern) { + *t->p = PyString_InternFromString(t->s); + } else { + *t->p = PyString_FromStringAndSize(t->s, t->n - 1); + } + #else + if (t->is_unicode | t->is_str) { + if (t->intern) { + *t->p = PyUnicode_InternFromString(t->s); + } else if (t->encoding) { + *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); + } else { + *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); + } + } else { + *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); + } + #endif + if (!*t->p) + return -1; + if (PyObject_Hash(*t->p) == -1) + return -1; + ++t; + } + return 0; +} + +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { + return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); +} +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { + Py_ssize_t ignore; + return __Pyx_PyObject_AsStringAndSize(o, &ignore); +} +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +#if !CYTHON_PEP393_ENABLED +static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { + char* defenc_c; + PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); + if (!defenc) return NULL; + defenc_c = PyBytes_AS_STRING(defenc); +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + { + char* end = defenc_c + PyBytes_GET_SIZE(defenc); + char* c; + for (c = defenc_c; c < end; c++) { + if ((unsigned char) (*c) >= 128) { + PyUnicode_AsASCIIString(o); + return NULL; + } + } + } +#endif + *length = PyBytes_GET_SIZE(defenc); + return defenc_c; +} +#else +static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { + if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + if (likely(PyUnicode_IS_ASCII(o))) { + *length = PyUnicode_GET_LENGTH(o); + return PyUnicode_AsUTF8(o); + } else { + PyUnicode_AsASCIIString(o); + return NULL; + } +#else + return PyUnicode_AsUTF8AndSize(o, length); +#endif +} +#endif +#endif +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT + if ( +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + __Pyx_sys_getdefaultencoding_not_ascii && +#endif + PyUnicode_Check(o)) { + return __Pyx_PyUnicode_AsStringAndSize(o, length); + } else +#endif +#if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) + if (PyByteArray_Check(o)) { + *length = PyByteArray_GET_SIZE(o); + return PyByteArray_AS_STRING(o); + } else +#endif + { + char* result; + int r = PyBytes_AsStringAndSize(o, &result, length); + if (unlikely(r < 0)) { + return NULL; + } else { + return result; + } + } +} +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { + int is_true = x == Py_True; + if (is_true | (x == Py_False) | (x == Py_None)) return is_true; + else return PyObject_IsTrue(x); +} +static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) { + int retval; + if (unlikely(!x)) return -1; + retval = __Pyx_PyObject_IsTrue(x); + Py_DECREF(x); + return retval; +} +static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) { +#if PY_MAJOR_VERSION >= 3 + if (PyLong_Check(result)) { + if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, + "__int__ returned non-int (type %.200s). " + "The ability to return an instance of a strict subclass of int " + "is deprecated, and may be removed in a future version of Python.", + Py_TYPE(result)->tp_name)) { + Py_DECREF(result); + return NULL; + } + return result; + } +#endif + PyErr_Format(PyExc_TypeError, + "__%.4s__ returned non-%.4s (type %.200s)", + type_name, type_name, Py_TYPE(result)->tp_name); + Py_DECREF(result); + return NULL; +} +static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { +#if CYTHON_USE_TYPE_SLOTS + PyNumberMethods *m; +#endif + const char *name = NULL; + PyObject *res = NULL; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x) || PyLong_Check(x))) +#else + if (likely(PyLong_Check(x))) +#endif + return __Pyx_NewRef(x); +#if CYTHON_USE_TYPE_SLOTS + m = Py_TYPE(x)->tp_as_number; + #if PY_MAJOR_VERSION < 3 + if (m && m->nb_int) { + name = "int"; + res = m->nb_int(x); + } + else if (m && m->nb_long) { + name = "long"; + res = m->nb_long(x); + } + #else + if (likely(m && m->nb_int)) { + name = "int"; + res = m->nb_int(x); + } + #endif +#else + if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { + res = PyNumber_Int(x); + } +#endif + if (likely(res)) { +#if PY_MAJOR_VERSION < 3 + if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) { +#else + if (unlikely(!PyLong_CheckExact(res))) { +#endif + return __Pyx_PyNumber_IntOrLongWrongResultType(res, name); + } + } + else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_TypeError, + "an integer is required"); + } + return res; +} +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { + Py_ssize_t ival; + PyObject *x; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_CheckExact(b))) { + if (sizeof(Py_ssize_t) >= sizeof(long)) + return PyInt_AS_LONG(b); + else + return PyInt_AsSsize_t(b); + } +#endif + if (likely(PyLong_CheckExact(b))) { + #if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)b)->ob_digit; + const Py_ssize_t size = Py_SIZE(b); + if (likely(__Pyx_sst_abs(size) <= 1)) { + ival = likely(size) ? digits[0] : 0; + if (size == -1) ival = -ival; + return ival; + } else { + switch (size) { + case 2: + if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { + return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -2: + if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case 3: + if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { + return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -3: + if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case 4: + if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { + return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -4: + if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + } + } + #endif + return PyLong_AsSsize_t(b); + } + x = PyNumber_Index(b); + if (!x) return -1; + ival = PyInt_AsSsize_t(x); + Py_DECREF(x); + return ival; +} +static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) { + return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False); +} +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { + return PyInt_FromSize_t(ival); +} + + +#endif /* Py_PYTHON_H */ diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/greenlet.html b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/greenlet.html new file mode 100644 index 00000000..1761ea1e --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/greenlet.html @@ -0,0 +1,10062 @@ + + + + + + Cython: greenlet.py + + + +

Generated by Cython 0.29.2

+

+ Yellow lines hint at Python interaction.
+ Click on a line that starts with a "+" to see the C code that Cython generated for it. +

+

Raw output: greenlet.c

+
+0001: # Copyright (c) 2009-2012 Denis Bilenko. See LICENSE for details.
+
  __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
 0002: # cython: auto_pickle=False,embedsignature=True,always_allow_keywords=False
+
 0003: 
+
 0004: from __future__ import absolute_import, print_function, division
+
 0005: 
+
+0006: from sys import _getframe as sys_getframe
+
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(__pyx_n_s_getframe);
+  __Pyx_GIVEREF(__pyx_n_s_getframe);
+  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_getframe);
+  __pyx_t_2 = __Pyx_Import(__pyx_n_s_sys, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_getframe); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(__pyx_t_1);
+  __Pyx_XGOTREF(__pyx_v_6gevent_9_greenlet_sys_getframe);
+  __Pyx_DECREF_SET(__pyx_v_6gevent_9_greenlet_sys_getframe, __pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+0007: from sys import exc_info as sys_exc_info
+
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_exc_info);
+  __Pyx_GIVEREF(__pyx_n_s_exc_info);
+  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_exc_info);
+  __pyx_t_1 = __Pyx_Import(__pyx_n_s_sys, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_exc_info); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(__pyx_t_2);
+  __Pyx_XGOTREF(__pyx_v_6gevent_9_greenlet_sys_exc_info);
+  __Pyx_DECREF_SET(__pyx_v_6gevent_9_greenlet_sys_exc_info, __pyx_t_2);
+  __Pyx_GIVEREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+0008: from weakref import ref as wref
+
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 8, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(__pyx_n_s_ref);
+  __Pyx_GIVEREF(__pyx_n_s_ref);
+  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_ref);
+  __pyx_t_2 = __Pyx_Import(__pyx_n_s_weakref, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_ref); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 8, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(__pyx_t_1);
+  __Pyx_XGOTREF(__pyx_v_6gevent_9_greenlet_wref);
+  __Pyx_DECREF_SET(__pyx_v_6gevent_9_greenlet_wref, __pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
 0009: 
+
 0010: # XXX: How to get cython to let us rename this as RawGreenlet
+
 0011: # like we prefer?
+
+0012: from greenlet import greenlet
+
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 12, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_greenlet);
+  __Pyx_GIVEREF(__pyx_n_s_greenlet);
+  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_greenlet);
+  __pyx_t_1 = __Pyx_Import(__pyx_n_s_greenlet, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 12, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+0013: from greenlet import GreenletExit
+
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 13, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(__pyx_n_s_GreenletExit);
+  __Pyx_GIVEREF(__pyx_n_s_GreenletExit);
+  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_GreenletExit);
+  __pyx_t_2 = __Pyx_Import(__pyx_n_s_greenlet, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 13, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_GreenletExit); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 13, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(__pyx_t_1);
+  __Pyx_XGOTREF(__pyx_v_6gevent_9_greenlet_GreenletExit);
+  __Pyx_DECREF_SET(__pyx_v_6gevent_9_greenlet_GreenletExit, __pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
 0014: 
+
+0015: from gevent._compat import reraise
+
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 15, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_reraise);
+  __Pyx_GIVEREF(__pyx_n_s_reraise);
+  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_reraise);
+  __pyx_t_1 = __Pyx_Import(__pyx_n_s_gevent__compat, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 15, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_reraise); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 15, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(__pyx_t_2);
+  __Pyx_XGOTREF(__pyx_v_6gevent_9_greenlet_reraise);
+  __Pyx_DECREF_SET(__pyx_v_6gevent_9_greenlet_reraise, __pyx_t_2);
+  __Pyx_GIVEREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+0016: from gevent._compat import PYPY as _PYPY
+
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 16, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(__pyx_n_s_PYPY_2);
+  __Pyx_GIVEREF(__pyx_n_s_PYPY_2);
+  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_PYPY_2);
+  __pyx_t_2 = __Pyx_Import(__pyx_n_s_gevent__compat, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 16, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_PYPY_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 16, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 16, __pyx_L1_error)
+  __pyx_v_6gevent_9_greenlet__PYPY = __pyx_t_3;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+0017: from gevent._tblib import dump_traceback
+
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 17, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_dump_traceback);
+  __Pyx_GIVEREF(__pyx_n_s_dump_traceback);
+  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_dump_traceback);
+  __pyx_t_1 = __Pyx_Import(__pyx_n_s_gevent__tblib, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 17, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_dump_traceback); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 17, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(__pyx_t_2);
+  __Pyx_XGOTREF(__pyx_v_6gevent_9_greenlet_dump_traceback);
+  __Pyx_DECREF_SET(__pyx_v_6gevent_9_greenlet_dump_traceback, __pyx_t_2);
+  __Pyx_GIVEREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+0018: from gevent._tblib import load_traceback
+
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 18, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(__pyx_n_s_load_traceback);
+  __Pyx_GIVEREF(__pyx_n_s_load_traceback);
+  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_load_traceback);
+  __pyx_t_2 = __Pyx_Import(__pyx_n_s_gevent__tblib, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 18, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_load_traceback); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 18, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(__pyx_t_1);
+  __Pyx_XGOTREF(__pyx_v_6gevent_9_greenlet_load_traceback);
+  __Pyx_DECREF_SET(__pyx_v_6gevent_9_greenlet_load_traceback, __pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
 0019: 
+
+0020: from gevent.exceptions import InvalidSwitchError
+
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 20, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_InvalidSwitchError);
+  __Pyx_GIVEREF(__pyx_n_s_InvalidSwitchError);
+  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_InvalidSwitchError);
+  __pyx_t_1 = __Pyx_Import(__pyx_n_s_gevent_exceptions, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 20, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_InvalidSwitchError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 20, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(__pyx_t_2);
+  __Pyx_XGOTREF(__pyx_v_6gevent_9_greenlet_InvalidSwitchError);
+  __Pyx_DECREF_SET(__pyx_v_6gevent_9_greenlet_InvalidSwitchError, __pyx_t_2);
+  __Pyx_GIVEREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 0021: 
+
+0022: from gevent._hub_primitives import iwait_on_objects as iwait
+
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 22, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(__pyx_n_s_iwait_on_objects);
+  __Pyx_GIVEREF(__pyx_n_s_iwait_on_objects);
+  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_iwait_on_objects);
+  __pyx_t_2 = __Pyx_Import(__pyx_n_s_gevent__hub_primitives, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 22, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_iwait_on_objects); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 22, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(__pyx_t_1);
+  __Pyx_XGOTREF(__pyx_v_6gevent_9_greenlet_iwait);
+  __Pyx_DECREF_SET(__pyx_v_6gevent_9_greenlet_iwait, __pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+0023: from gevent._hub_primitives import wait_on_objects as wait
+
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 23, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_wait_on_objects);
+  __Pyx_GIVEREF(__pyx_n_s_wait_on_objects);
+  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_wait_on_objects);
+  __pyx_t_1 = __Pyx_Import(__pyx_n_s_gevent__hub_primitives, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 23, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_wait_on_objects); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 23, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(__pyx_t_2);
+  __Pyx_XGOTREF(__pyx_v_6gevent_9_greenlet_wait);
+  __Pyx_DECREF_SET(__pyx_v_6gevent_9_greenlet_wait, __pyx_t_2);
+  __Pyx_GIVEREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 0024: 
+
+0025: from gevent.timeout import Timeout
+
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 25, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(__pyx_n_s_Timeout);
+  __Pyx_GIVEREF(__pyx_n_s_Timeout);
+  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_Timeout);
+  __pyx_t_2 = __Pyx_Import(__pyx_n_s_gevent_timeout, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 25, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_Timeout); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 25, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(__pyx_t_1);
+  __Pyx_XGOTREF(__pyx_v_6gevent_9_greenlet_Timeout);
+  __Pyx_DECREF_SET(__pyx_v_6gevent_9_greenlet_Timeout, __pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
 0026: 
+
+0027: from gevent._config import config as GEVENT_CONFIG
+
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 27, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_config);
+  __Pyx_GIVEREF(__pyx_n_s_config);
+  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_config);
+  __pyx_t_1 = __Pyx_Import(__pyx_n_s_gevent__config, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 27, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_config); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 27, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(__pyx_t_2);
+  __Pyx_XGOTREF(__pyx_v_6gevent_9_greenlet_GEVENT_CONFIG);
+  __Pyx_DECREF_SET(__pyx_v_6gevent_9_greenlet_GEVENT_CONFIG, __pyx_t_2);
+  __Pyx_GIVEREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+0028: from gevent._util import Lazy
+
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 28, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(__pyx_n_s_Lazy);
+  __Pyx_GIVEREF(__pyx_n_s_Lazy);
+  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_Lazy);
+  __pyx_t_2 = __Pyx_Import(__pyx_n_s_gevent__util, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 28, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_Lazy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 28, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Lazy, __pyx_t_1) < 0) __PYX_ERR(0, 28, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+0029: from gevent._util import readproperty
+
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 29, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_readproperty);
+  __Pyx_GIVEREF(__pyx_n_s_readproperty);
+  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_readproperty);
+  __pyx_t_1 = __Pyx_Import(__pyx_n_s_gevent__util, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 29, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_readproperty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 29, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_readproperty, __pyx_t_2) < 0) __PYX_ERR(0, 29, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+0030: from gevent._hub_local import get_hub_noargs as get_hub
+
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 30, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(__pyx_n_s_get_hub_noargs);
+  __Pyx_GIVEREF(__pyx_n_s_get_hub_noargs);
+  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_get_hub_noargs);
+  __pyx_t_2 = __Pyx_Import(__pyx_n_s_gevent__hub_local, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 30, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_get_hub_noargs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 30, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_hub_noargs, __pyx_t_1) < 0) __PYX_ERR(0, 30, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+0031: from gevent import _waiter
+
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 31, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_waiter_2);
+  __Pyx_GIVEREF(__pyx_n_s_waiter_2);
+  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_waiter_2);
+  __pyx_t_1 = __Pyx_Import(__pyx_n_s_gevent, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 31, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_waiter_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 31, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_waiter_2, __pyx_t_2) < 0) __PYX_ERR(0, 31, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 0032: 
+
 0033: 
+
+0034: __all__ = [
+
  __pyx_t_1 = PyList_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 34, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(__pyx_n_s_Greenlet);
+  __Pyx_GIVEREF(__pyx_n_s_Greenlet);
+  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_Greenlet);
+  __Pyx_INCREF(__pyx_n_s_joinall);
+  __Pyx_GIVEREF(__pyx_n_s_joinall);
+  PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_joinall);
+  __Pyx_INCREF(__pyx_n_s_killall);
+  __Pyx_GIVEREF(__pyx_n_s_killall);
+  PyList_SET_ITEM(__pyx_t_1, 2, __pyx_n_s_killall);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_all, __pyx_t_1) < 0) __PYX_ERR(0, 34, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 0035:     'Greenlet',
+
 0036:     'joinall',
+
 0037:     'killall',
+
 0038: ]
+
 0039: 
+
 0040: 
+
 0041: # In Cython, we define these as 'cdef inline' functions. The
+
 0042: # compilation unit cannot have a direct assignment to them (import
+
 0043: # is assignment) without generating a 'lvalue is not valid target'
+
 0044: # error.
+
+0045: locals()['getcurrent'] = __import__('greenlet').getcurrent
+
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin___import__, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 45, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_getcurrent); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 45, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_1 = __Pyx_Globals(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 45, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (unlikely(PyDict_SetItem(__pyx_t_1, __pyx_n_s_getcurrent, __pyx_t_2) < 0)) __PYX_ERR(0, 45, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+/* … */
+  __pyx_tuple__21 = PyTuple_Pack(1, __pyx_n_s_greenlet); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(0, 45, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__21);
+  __Pyx_GIVEREF(__pyx_tuple__21);
+
+0046: locals()['greenlet_init'] = lambda: None
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_9_greenlet_6lambda(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyMethodDef __pyx_mdef_6gevent_9_greenlet_6lambda = {"lambda", (PyCFunction)__pyx_pw_6gevent_9_greenlet_6lambda, METH_NOARGS, 0};
+static PyObject *__pyx_pw_6gevent_9_greenlet_6lambda(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("lambda (wrapper)", 0);
+  __pyx_r = __pyx_lambda_funcdef_6gevent_9_greenlet_lambda(__pyx_self);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_lambda_funcdef_6gevent_9_greenlet_lambda(CYTHON_UNUSED PyObject *__pyx_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("lambda", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_9_greenlet_6lambda, 0, __pyx_n_s_lambda, NULL, __pyx_n_s_gevent__greenlet, __pyx_d, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 46, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_1 = __Pyx_Globals(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 46, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (unlikely(PyDict_SetItem(__pyx_t_1, __pyx_n_s_greenlet_init, __pyx_t_2) < 0)) __PYX_ERR(0, 46, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+0047: locals()['Waiter'] = _waiter.Waiter
+
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_waiter_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 47, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_Waiter); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 47, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_2 = __Pyx_Globals(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 47, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (unlikely(PyDict_SetItem(__pyx_t_2, __pyx_n_s_Waiter, __pyx_t_1) < 0)) __PYX_ERR(0, 47, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 0048: 
+
 0049: 
+
+0050: if _PYPY:
+
  __pyx_t_3 = (__pyx_v_6gevent_9_greenlet__PYPY != 0);
+  if (__pyx_t_3) {
+/* … */
+  }
+
+0051:     import _continuation # pylint:disable=import-error
+
    __pyx_t_1 = __Pyx_Import(__pyx_n_s_continuation, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 51, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    if (PyDict_SetItem(__pyx_d, __pyx_n_s_continuation, __pyx_t_1) < 0) __PYX_ERR(0, 51, __pyx_L1_error)
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+0052:     _continulet = _continuation.continulet
+
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_continuation); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 52, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_continulet); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 52, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    if (PyDict_SetItem(__pyx_d, __pyx_n_s_continulet_2, __pyx_t_2) < 0) __PYX_ERR(0, 52, __pyx_L1_error)
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
 0053: 
+
 0054: 
+
 0055: class SpawnedLink(object):
+
 0056:     """
+
 0057:     A wrapper around link that calls it in another greenlet.
+
 0058: 
+
 0059:     Can be called only from main loop.
+
 0060:     """
+
+0061:     __slots__ = ['callback']
+
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 61, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_callback);
+  __Pyx_GIVEREF(__pyx_n_s_callback);
+  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_callback);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet_SpawnedLink->tp_dict, __pyx_n_s_slots, __pyx_t_2) < 0) __PYX_ERR(0, 61, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_9_greenlet_SpawnedLink);
+
 0062: 
+
+0063:     def __init__(self, callback):
+
/* Python wrapper */
+static int __pyx_pw_6gevent_9_greenlet_11SpawnedLink_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static int __pyx_pw_6gevent_9_greenlet_11SpawnedLink_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_callback = 0;
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_callback,0};
+    PyObject* values[1] = {0};
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_callback)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 63, __pyx_L3_error)
+      }
+    } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
+      goto __pyx_L5_argtuple_error;
+    } else {
+      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+    }
+    __pyx_v_callback = values[0];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 63, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent._greenlet.SpawnedLink.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return -1;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_9_greenlet_11SpawnedLink___init__(((struct __pyx_obj_6gevent_9_greenlet_SpawnedLink *)__pyx_v_self), __pyx_v_callback);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_9_greenlet_11SpawnedLink___init__(struct __pyx_obj_6gevent_9_greenlet_SpawnedLink *__pyx_v_self, PyObject *__pyx_v_callback) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = 0;
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_AddTraceback("gevent._greenlet.SpawnedLink.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = -1;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0064:         if not callable(callback):
+
  __pyx_t_1 = __Pyx_PyCallable_Check(__pyx_v_callback); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 64, __pyx_L1_error)
+  __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
+  if (unlikely(__pyx_t_2)) {
+/* … */
+  }
+
+0065:             raise TypeError("Expected callable: %r" % (callback, ))
+
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 65, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_INCREF(__pyx_v_callback);
+    __Pyx_GIVEREF(__pyx_v_callback);
+    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_callback);
+    __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Expected_callable_r, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 65, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 65, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __PYX_ERR(0, 65, __pyx_L1_error)
+
+0066:         self.callback = callback
+
  __Pyx_INCREF(__pyx_v_callback);
+  __Pyx_GIVEREF(__pyx_v_callback);
+  __Pyx_GOTREF(__pyx_v_self->callback);
+  __Pyx_DECREF(__pyx_v_self->callback);
+  __pyx_v_self->callback = __pyx_v_callback;
+
 0067: 
+
+0068:     def __call__(self, source):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_9_greenlet_11SpawnedLink_3__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_pw_6gevent_9_greenlet_11SpawnedLink_3__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_source = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__call__ (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_source,0};
+    PyObject* values[1] = {0};
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_source)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__call__") < 0)) __PYX_ERR(0, 68, __pyx_L3_error)
+      }
+    } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
+      goto __pyx_L5_argtuple_error;
+    } else {
+      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+    }
+    __pyx_v_source = values[0];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("__call__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 68, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent._greenlet.SpawnedLink.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_9_greenlet_11SpawnedLink_2__call__(((struct __pyx_obj_6gevent_9_greenlet_SpawnedLink *)__pyx_v_self), __pyx_v_source);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_9_greenlet_11SpawnedLink_2__call__(struct __pyx_obj_6gevent_9_greenlet_SpawnedLink *__pyx_v_self, PyObject *__pyx_v_source) {
+  PyGreenlet *__pyx_v_g = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__call__", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_AddTraceback("gevent._greenlet.SpawnedLink.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XDECREF((PyObject *)__pyx_v_g);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0069:         g = greenlet(self.callback, get_hub())
+
  __pyx_t_1 = ((PyObject *)__pyx_f_6gevent_11__hub_local_get_hub_noargs(0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 69, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 69, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(__pyx_v_self->callback);
+  __Pyx_GIVEREF(__pyx_v_self->callback);
+  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_self->callback);
+  __Pyx_GIVEREF(__pyx_t_1);
+  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1);
+  __pyx_t_1 = 0;
+  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6gevent_9_greenlet_greenlet), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 69, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_v_g = ((PyGreenlet *)__pyx_t_1);
+  __pyx_t_1 = 0;
+
+0070:         g.switch(source)
+
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_g), __pyx_n_s_switch); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 70, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = NULL;
+  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+    if (likely(__pyx_t_3)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+      __Pyx_INCREF(__pyx_t_3);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_2, function);
+    }
+  }
+  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_source) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_source);
+  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 70, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 0071: 
+
+0072:     def __hash__(self):
+
/* Python wrapper */
+static Py_hash_t __pyx_pw_6gevent_9_greenlet_11SpawnedLink_5__hash__(PyObject *__pyx_v_self); /*proto*/
+static Py_hash_t __pyx_pw_6gevent_9_greenlet_11SpawnedLink_5__hash__(PyObject *__pyx_v_self) {
+  Py_hash_t __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__hash__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_9_greenlet_11SpawnedLink_4__hash__(((struct __pyx_obj_6gevent_9_greenlet_SpawnedLink *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static Py_hash_t __pyx_pf_6gevent_9_greenlet_11SpawnedLink_4__hash__(struct __pyx_obj_6gevent_9_greenlet_SpawnedLink *__pyx_v_self) {
+  Py_hash_t __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__hash__", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent._greenlet.SpawnedLink.__hash__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = -1;
+  __pyx_L0:;
+  if (unlikely(__pyx_r == -1) && !PyErr_Occurred()) __pyx_r = -2;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0073:         return hash(self.callback)
+
  __pyx_t_1 = __pyx_v_self->callback;
+  __Pyx_INCREF(__pyx_t_1);
+  __pyx_t_2 = PyObject_Hash(__pyx_t_1); if (unlikely(__pyx_t_2 == ((Py_hash_t)-1))) __PYX_ERR(0, 73, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_r = __pyx_t_2;
+  goto __pyx_L0;
+
 0074: 
+
+0075:     def __eq__(self, other):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_9_greenlet_11SpawnedLink_7__eq__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
+static PyObject *__pyx_pw_6gevent_9_greenlet_11SpawnedLink_7__eq__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__eq__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_9_greenlet_11SpawnedLink_6__eq__(((struct __pyx_obj_6gevent_9_greenlet_SpawnedLink *)__pyx_v_self), ((PyObject *)__pyx_v_other));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_9_greenlet_11SpawnedLink_6__eq__(struct __pyx_obj_6gevent_9_greenlet_SpawnedLink *__pyx_v_self, PyObject *__pyx_v_other) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__eq__", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_AddTraceback("gevent._greenlet.SpawnedLink.__eq__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0076:         return self.callback == getattr(other, 'callback', other)
+
  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __Pyx_GetAttr3(__pyx_v_other, __pyx_n_s_callback, __pyx_v_other); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 76, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = PyObject_RichCompare(__pyx_v_self->callback, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 76, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_r = __pyx_t_2;
+  __pyx_t_2 = 0;
+  goto __pyx_L0;
+
 0077: 
+
+0078:     def __str__(self):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_9_greenlet_11SpawnedLink_9__str__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_9_greenlet_11SpawnedLink_9__str__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_9_greenlet_11SpawnedLink_8__str__(((struct __pyx_obj_6gevent_9_greenlet_SpawnedLink *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_9_greenlet_11SpawnedLink_8__str__(struct __pyx_obj_6gevent_9_greenlet_SpawnedLink *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__str__", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent._greenlet.SpawnedLink.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0079:         return str(self.callback)
+
  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyString_Type)), __pyx_v_self->callback); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 79, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
 0080: 
+
+0081:     def __repr__(self):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_9_greenlet_11SpawnedLink_11__repr__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_9_greenlet_11SpawnedLink_11__repr__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_9_greenlet_11SpawnedLink_10__repr__(((struct __pyx_obj_6gevent_9_greenlet_SpawnedLink *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_9_greenlet_11SpawnedLink_10__repr__(struct __pyx_obj_6gevent_9_greenlet_SpawnedLink *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__repr__", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_AddTraceback("gevent._greenlet.SpawnedLink.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0082:         return repr(self.callback)
+
  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __pyx_v_self->callback;
+  __Pyx_INCREF(__pyx_t_1);
+  __pyx_t_2 = PyObject_Repr(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 82, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_r = __pyx_t_2;
+  __pyx_t_2 = 0;
+  goto __pyx_L0;
+
 0083: 
+
+0084:     def __getattr__(self, item):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_9_greenlet_11SpawnedLink_13__getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_item); /*proto*/
+static PyObject *__pyx_pw_6gevent_9_greenlet_11SpawnedLink_13__getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_item) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__getattr__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_9_greenlet_11SpawnedLink_12__getattr__(((struct __pyx_obj_6gevent_9_greenlet_SpawnedLink *)__pyx_v_self), ((PyObject *)__pyx_v_item));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_9_greenlet_11SpawnedLink_12__getattr__(struct __pyx_obj_6gevent_9_greenlet_SpawnedLink *__pyx_v_self, PyObject *__pyx_v_item) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__getattr__", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_AddTraceback("gevent._greenlet.SpawnedLink.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0085:         assert item != 'callback'
+
  #ifndef CYTHON_WITHOUT_ASSERTIONS
+  if (unlikely(!Py_OptimizeFlag)) {
+    __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_item, __pyx_n_s_callback, Py_NE)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 85, __pyx_L1_error)
+    if (unlikely(!__pyx_t_1)) {
+      PyErr_SetNone(PyExc_AssertionError);
+      __PYX_ERR(0, 85, __pyx_L1_error)
+    }
+  }
+  #endif
+
+0086:         return getattr(self.callback, item)
+
  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_2 = __pyx_v_self->callback;
+  __Pyx_INCREF(__pyx_t_2);
+  __pyx_t_3 = __Pyx_GetAttr(__pyx_t_2, __pyx_v_item); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 86, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_r = __pyx_t_3;
+  __pyx_t_3 = 0;
+  goto __pyx_L0;
+
 0087: 
+
 0088: 
+
 0089: class SuccessSpawnedLink(SpawnedLink):
+
 0090:     """A wrapper around link that calls it in another greenlet only if source succeed.
+
 0091: 
+
 0092:     Can be called only from main loop.
+
 0093:     """
+
+0094:     __slots__ = []
+
  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 94, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet_SuccessSpawnedLink->tp_dict, __pyx_n_s_slots, __pyx_t_2) < 0) __PYX_ERR(0, 94, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_9_greenlet_SuccessSpawnedLink);
+
 0095: 
+
+0096:     def __call__(self, source):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_9_greenlet_18SuccessSpawnedLink_1__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_pw_6gevent_9_greenlet_18SuccessSpawnedLink_1__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_source = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__call__ (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_source,0};
+    PyObject* values[1] = {0};
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_source)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__call__") < 0)) __PYX_ERR(0, 96, __pyx_L3_error)
+      }
+    } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
+      goto __pyx_L5_argtuple_error;
+    } else {
+      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+    }
+    __pyx_v_source = values[0];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("__call__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 96, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent._greenlet.SuccessSpawnedLink.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_9_greenlet_18SuccessSpawnedLink___call__(((struct __pyx_obj_6gevent_9_greenlet_SuccessSpawnedLink *)__pyx_v_self), __pyx_v_source);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_9_greenlet_18SuccessSpawnedLink___call__(struct __pyx_obj_6gevent_9_greenlet_SuccessSpawnedLink *__pyx_v_self, PyObject *__pyx_v_source) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__call__", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_6);
+  __Pyx_AddTraceback("gevent._greenlet.SuccessSpawnedLink.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0097:         if source.successful():
+
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_source, __pyx_n_s_successful); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 97, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = NULL;
+  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+    if (likely(__pyx_t_3)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+      __Pyx_INCREF(__pyx_t_3);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_2, function);
+    }
+  }
+  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 97, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 97, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  if (__pyx_t_4) {
+/* … */
+  }
+
+0098:             return SpawnedLink.__call__(self, source)
+
    __Pyx_XDECREF(__pyx_r);
+    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_6gevent_9_greenlet_SpawnedLink), __pyx_n_s_call); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 98, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_3 = NULL;
+    __pyx_t_5 = 0;
+    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+      if (likely(__pyx_t_3)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+        __Pyx_INCREF(__pyx_t_3);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_2, function);
+        __pyx_t_5 = 1;
+      }
+    }
+    #if CYTHON_FAST_PYCALL
+    if (PyFunction_Check(__pyx_t_2)) {
+      PyObject *__pyx_temp[3] = {__pyx_t_3, ((PyObject *)__pyx_v_self), __pyx_v_source};
+      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 98, __pyx_L1_error)
+      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __Pyx_GOTREF(__pyx_t_1);
+    } else
+    #endif
+    #if CYTHON_FAST_PYCCALL
+    if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
+      PyObject *__pyx_temp[3] = {__pyx_t_3, ((PyObject *)__pyx_v_self), __pyx_v_source};
+      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 98, __pyx_L1_error)
+      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __Pyx_GOTREF(__pyx_t_1);
+    } else
+    #endif
+    {
+      __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 98, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_6);
+      if (__pyx_t_3) {
+        __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); __pyx_t_3 = NULL;
+      }
+      __Pyx_INCREF(((PyObject *)__pyx_v_self));
+      __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
+      PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, ((PyObject *)__pyx_v_self));
+      __Pyx_INCREF(__pyx_v_source);
+      __Pyx_GIVEREF(__pyx_v_source);
+      PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_source);
+      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 98, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+    }
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __pyx_r = __pyx_t_1;
+    __pyx_t_1 = 0;
+    goto __pyx_L0;
+
 0099: 
+
 0100: 
+
 0101: class FailureSpawnedLink(SpawnedLink):
+
 0102:     """A wrapper around link that calls it in another greenlet only if source failed.
+
 0103: 
+
 0104:     Can be called only from main loop.
+
 0105:     """
+
+0106:     __slots__ = []
+
  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 106, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet_FailureSpawnedLink->tp_dict, __pyx_n_s_slots, __pyx_t_2) < 0) __PYX_ERR(0, 106, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_9_greenlet_FailureSpawnedLink);
+
 0107: 
+
+0108:     def __call__(self, source):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_9_greenlet_18FailureSpawnedLink_1__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_pw_6gevent_9_greenlet_18FailureSpawnedLink_1__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_source = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__call__ (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_source,0};
+    PyObject* values[1] = {0};
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_source)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__call__") < 0)) __PYX_ERR(0, 108, __pyx_L3_error)
+      }
+    } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
+      goto __pyx_L5_argtuple_error;
+    } else {
+      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+    }
+    __pyx_v_source = values[0];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("__call__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 108, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent._greenlet.FailureSpawnedLink.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_9_greenlet_18FailureSpawnedLink___call__(((struct __pyx_obj_6gevent_9_greenlet_FailureSpawnedLink *)__pyx_v_self), __pyx_v_source);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_9_greenlet_18FailureSpawnedLink___call__(struct __pyx_obj_6gevent_9_greenlet_FailureSpawnedLink *__pyx_v_self, PyObject *__pyx_v_source) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__call__", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_7);
+  __Pyx_AddTraceback("gevent._greenlet.FailureSpawnedLink.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0109:         if not source.successful():
+
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_source, __pyx_n_s_successful); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 109, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = NULL;
+  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+    if (likely(__pyx_t_3)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+      __Pyx_INCREF(__pyx_t_3);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_2, function);
+    }
+  }
+  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 109, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 109, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_5 = ((!__pyx_t_4) != 0);
+  if (__pyx_t_5) {
+/* … */
+  }
+
+0110:             return SpawnedLink.__call__(self, source)
+
    __Pyx_XDECREF(__pyx_r);
+    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_6gevent_9_greenlet_SpawnedLink), __pyx_n_s_call); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 110, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_3 = NULL;
+    __pyx_t_6 = 0;
+    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+      if (likely(__pyx_t_3)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+        __Pyx_INCREF(__pyx_t_3);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_2, function);
+        __pyx_t_6 = 1;
+      }
+    }
+    #if CYTHON_FAST_PYCALL
+    if (PyFunction_Check(__pyx_t_2)) {
+      PyObject *__pyx_temp[3] = {__pyx_t_3, ((PyObject *)__pyx_v_self), __pyx_v_source};
+      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 110, __pyx_L1_error)
+      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __Pyx_GOTREF(__pyx_t_1);
+    } else
+    #endif
+    #if CYTHON_FAST_PYCCALL
+    if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
+      PyObject *__pyx_temp[3] = {__pyx_t_3, ((PyObject *)__pyx_v_self), __pyx_v_source};
+      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 110, __pyx_L1_error)
+      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __Pyx_GOTREF(__pyx_t_1);
+    } else
+    #endif
+    {
+      __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 110, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_7);
+      if (__pyx_t_3) {
+        __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3); __pyx_t_3 = NULL;
+      }
+      __Pyx_INCREF(((PyObject *)__pyx_v_self));
+      __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
+      PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, ((PyObject *)__pyx_v_self));
+      __Pyx_INCREF(__pyx_v_source);
+      __Pyx_GIVEREF(__pyx_v_source);
+      PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_source);
+      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 110, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+    }
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __pyx_r = __pyx_t_1;
+    __pyx_t_1 = 0;
+    goto __pyx_L0;
+
 0111: 
+
 0112: class _Frame(object):
+
 0113: 
+
+0114:     __slots__ = ('f_code', 'f_lineno', 'f_back')
+
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet__Frame->tp_dict, __pyx_n_s_slots, __pyx_tuple__22) < 0) __PYX_ERR(0, 114, __pyx_L1_error)
+  PyType_Modified(__pyx_ptype_6gevent_9_greenlet__Frame);
+/* … */
+  __pyx_tuple__22 = PyTuple_Pack(3, __pyx_n_s_f_code, __pyx_n_s_f_lineno, __pyx_n_s_f_back); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(0, 114, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__22);
+  __Pyx_GIVEREF(__pyx_tuple__22);
+
 0115: 
+
+0116:     def __init__(self, f_code, f_lineno, f_back):
+
/* Python wrapper */
+static int __pyx_pw_6gevent_9_greenlet_6_Frame_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static int __pyx_pw_6gevent_9_greenlet_6_Frame_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_f_code = 0;
+  PyObject *__pyx_v_f_lineno = 0;
+  PyObject *__pyx_v_f_back = 0;
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_f_code,&__pyx_n_s_f_lineno,&__pyx_n_s_f_back,0};
+    PyObject* values[3] = {0,0,0};
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_f_code)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_f_lineno)) != 0)) kw_args--;
+        else {
+          __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 1); __PYX_ERR(0, 116, __pyx_L3_error)
+        }
+        CYTHON_FALLTHROUGH;
+        case  2:
+        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_f_back)) != 0)) kw_args--;
+        else {
+          __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 2); __PYX_ERR(0, 116, __pyx_L3_error)
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 116, __pyx_L3_error)
+      }
+    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
+      goto __pyx_L5_argtuple_error;
+    } else {
+      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+    }
+    __pyx_v_f_code = values[0];
+    __pyx_v_f_lineno = values[1];
+    __pyx_v_f_back = values[2];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 116, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent._greenlet._Frame.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return -1;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_9_greenlet_6_Frame___init__(((struct __pyx_obj_6gevent_9_greenlet__Frame *)__pyx_v_self), __pyx_v_f_code, __pyx_v_f_lineno, __pyx_v_f_back);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_9_greenlet_6_Frame___init__(struct __pyx_obj_6gevent_9_greenlet__Frame *__pyx_v_self, PyObject *__pyx_v_f_code, PyObject *__pyx_v_f_lineno, PyObject *__pyx_v_f_back) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = 0;
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent._greenlet._Frame.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = -1;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0117:         self.f_code = f_code
+
  if (!(likely(((__pyx_v_f_code) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_f_code, __pyx_ptype_6gevent_9_greenlet_CodeType))))) __PYX_ERR(0, 117, __pyx_L1_error)
+  __pyx_t_1 = __pyx_v_f_code;
+  __Pyx_INCREF(__pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_1);
+  __Pyx_GOTREF(__pyx_v_self->f_code);
+  __Pyx_DECREF(((PyObject *)__pyx_v_self->f_code));
+  __pyx_v_self->f_code = ((PyCodeObject *)__pyx_t_1);
+  __pyx_t_1 = 0;
+
+0118:         self.f_lineno = f_lineno
+
  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_f_lineno); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 118, __pyx_L1_error)
+  __pyx_v_self->f_lineno = __pyx_t_2;
+
+0119:         self.f_back = f_back
+
  if (!(likely(((__pyx_v_f_back) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_f_back, __pyx_ptype_6gevent_9_greenlet__Frame))))) __PYX_ERR(0, 119, __pyx_L1_error)
+  __pyx_t_1 = __pyx_v_f_back;
+  __Pyx_INCREF(__pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_1);
+  __Pyx_GOTREF(__pyx_v_self->f_back);
+  __Pyx_DECREF(((PyObject *)__pyx_v_self->f_back));
+  __pyx_v_self->f_back = ((struct __pyx_obj_6gevent_9_greenlet__Frame *)__pyx_t_1);
+  __pyx_t_1 = 0;
+
 0120: 
+
 0121:     @property
+
+0122:     def f_globals(self):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_9_greenlet_6_Frame_9f_globals_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_9_greenlet_6_Frame_9f_globals_1__get__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_9_greenlet_6_Frame_9f_globals___get__(((struct __pyx_obj_6gevent_9_greenlet__Frame *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_9_greenlet_6_Frame_9f_globals___get__(CYTHON_UNUSED struct __pyx_obj_6gevent_9_greenlet__Frame *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__", 0);
+/* … */
+  /* function exit code */
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0123:         return None
+
  __Pyx_XDECREF(__pyx_r);
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+
 0124: 
+
+0125: def _Frame_from_list(frames):
+
static struct __pyx_obj_6gevent_9_greenlet__Frame *__pyx_f_6gevent_9_greenlet__Frame_from_list(PyObject *__pyx_v_frames) {
+  struct __pyx_obj_6gevent_9_greenlet__Frame *__pyx_v_previous = 0;
+  PyObject *__pyx_v_frame = 0;
+  struct __pyx_obj_6gevent_9_greenlet__Frame *__pyx_v_f = 0;
+  struct __pyx_obj_6gevent_9_greenlet__Frame *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_Frame_from_list", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_AddTraceback("gevent._greenlet._Frame_from_list", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XDECREF((PyObject *)__pyx_v_previous);
+  __Pyx_XDECREF(__pyx_v_frame);
+  __Pyx_XDECREF((PyObject *)__pyx_v_f);
+  __Pyx_XGIVEREF((PyObject *)__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0126:     previous = None
+
  __Pyx_INCREF(Py_None);
+  __pyx_v_previous = ((struct __pyx_obj_6gevent_9_greenlet__Frame *)Py_None);
+
+0127:     for frame in reversed(frames):
+
  if (unlikely(__pyx_v_frames == Py_None)) {
+    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
+    __PYX_ERR(0, 127, __pyx_L1_error)
+  }
+  __pyx_t_1 = __pyx_v_frames; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = PyList_GET_SIZE(__pyx_t_1) - 1;
+  for (;;) {
+    if (__pyx_t_2 < 0) break;
+    if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
+    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+    __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2--; if (unlikely(0 < 0)) __PYX_ERR(0, 127, __pyx_L1_error)
+    #else
+    __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2--; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 127, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    #endif
+    if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(0, 127, __pyx_L1_error)
+    __Pyx_XDECREF_SET(__pyx_v_frame, ((PyObject*)__pyx_t_3));
+    __pyx_t_3 = 0;
+/* … */
+  }
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+0128:         f = _Frame(frame[0], frame[1], previous)
+
    if (unlikely(__pyx_v_frame == Py_None)) {
+      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
+      __PYX_ERR(0, 128, __pyx_L1_error)
+    }
+    __pyx_t_3 = __Pyx_GetItemInt_Tuple(__pyx_v_frame, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 128, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    if (unlikely(__pyx_v_frame == Py_None)) {
+      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
+      __PYX_ERR(0, 128, __pyx_L1_error)
+    }
+    __pyx_t_4 = __Pyx_GetItemInt_Tuple(__pyx_v_frame, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 128, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 128, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_5);
+    __Pyx_GIVEREF(__pyx_t_3);
+    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3);
+    __Pyx_GIVEREF(__pyx_t_4);
+    PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4);
+    __Pyx_INCREF(((PyObject *)__pyx_v_previous));
+    __Pyx_GIVEREF(((PyObject *)__pyx_v_previous));
+    PyTuple_SET_ITEM(__pyx_t_5, 2, ((PyObject *)__pyx_v_previous));
+    __pyx_t_3 = 0;
+    __pyx_t_4 = 0;
+    __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6gevent_9_greenlet__Frame), __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 128, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __Pyx_XDECREF_SET(__pyx_v_f, ((struct __pyx_obj_6gevent_9_greenlet__Frame *)__pyx_t_4));
+    __pyx_t_4 = 0;
+
+0129:         previous = f
+
    __Pyx_INCREF(((PyObject *)__pyx_v_f));
+    __Pyx_DECREF_SET(__pyx_v_previous, __pyx_v_f);
+
+0130:     return previous
+
  __Pyx_XDECREF(((PyObject *)__pyx_r));
+  __Pyx_INCREF(((PyObject *)__pyx_v_previous));
+  __pyx_r = __pyx_v_previous;
+  goto __pyx_L0;
+
 0131: 
+
+0132: def _extract_stack(limit):
+
static CYTHON_INLINE PyObject *__pyx_f_6gevent_9_greenlet__extract_stack(int __pyx_v_limit) {
+  PyObject *__pyx_v_frames = 0;
+  PyFrameObject *__pyx_v_frame = 0;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_extract_stack", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_XDECREF(__pyx_t_6);
+  __Pyx_AddTraceback("gevent._greenlet._extract_stack", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_frames);
+  __Pyx_XDECREF((PyObject *)__pyx_v_frame);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0133:     try:
+
  {
+    /*try:*/ {
+/* … */
+    }
+    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+    goto __pyx_L8_try_end;
+    __pyx_L3_error:;
+    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+/* … */
+    __Pyx_XGIVEREF(__pyx_t_1);
+    __Pyx_XGIVEREF(__pyx_t_2);
+    __Pyx_XGIVEREF(__pyx_t_3);
+    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
+    goto __pyx_L1_error;
+    __pyx_L4_exception_handled:;
+    __Pyx_XGIVEREF(__pyx_t_1);
+    __Pyx_XGIVEREF(__pyx_t_2);
+    __Pyx_XGIVEREF(__pyx_t_3);
+    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
+    __pyx_L8_try_end:;
+  }
+
+0134:         frame = sys_getframe()
+
      __Pyx_INCREF(__pyx_v_6gevent_9_greenlet_sys_getframe);
+      __pyx_t_5 = __pyx_v_6gevent_9_greenlet_sys_getframe; __pyx_t_6 = NULL;
+      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
+        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
+        if (likely(__pyx_t_6)) {
+          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
+          __Pyx_INCREF(__pyx_t_6);
+          __Pyx_INCREF(function);
+          __Pyx_DECREF_SET(__pyx_t_5, function);
+        }
+      }
+      __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
+      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 134, __pyx_L3_error)
+      __Pyx_GOTREF(__pyx_t_4);
+      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+      if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_6gevent_9_greenlet_FrameType))))) __PYX_ERR(0, 134, __pyx_L3_error)
+      __pyx_v_frame = ((PyFrameObject *)__pyx_t_4);
+      __pyx_t_4 = 0;
+
+0135:     except ValueError:
+
    __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ValueError);
+    if (__pyx_t_7) {
+      __Pyx_AddTraceback("gevent._greenlet._extract_stack", __pyx_clineno, __pyx_lineno, __pyx_filename);
+      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6) < 0) __PYX_ERR(0, 135, __pyx_L5_except_error)
+      __Pyx_GOTREF(__pyx_t_4);
+      __Pyx_GOTREF(__pyx_t_5);
+      __Pyx_GOTREF(__pyx_t_6);
+
 0136:         # In certain embedded cases that directly use the Python C api
+
 0137:         # to call Greenlet.spawn (e.g., uwsgi) this can raise
+
 0138:         # `ValueError: call stack is not deep enough`. This is because
+
 0139:         # the Cython stack frames for Greenlet.spawn ->
+
 0140:         # Greenlet.__init__ -> _extract_stack are all on the C level,
+
 0141:         # not the Python level.
+
 0142:         # See https://github.com/gevent/gevent/issues/1212
+
+0143:         frame = None
+
      __Pyx_INCREF(Py_None);
+      __Pyx_XDECREF_SET(__pyx_v_frame, ((PyFrameObject *)Py_None));
+      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+      goto __pyx_L4_exception_handled;
+    }
+    goto __pyx_L5_except_error;
+    __pyx_L5_except_error:;
+
 0144: 
+
+0145:     frames = []
+
  __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 145, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  __pyx_v_frames = ((PyObject*)__pyx_t_6);
+  __pyx_t_6 = 0;
+
 0146: 
+
+0147:     while limit and frame is not None:
+
  while (1) {
+    __pyx_t_9 = (__pyx_v_limit != 0);
+    if (__pyx_t_9) {
+    } else {
+      __pyx_t_8 = __pyx_t_9;
+      goto __pyx_L13_bool_binop_done;
+    }
+    __pyx_t_9 = (((PyObject *)__pyx_v_frame) != Py_None);
+    __pyx_t_10 = (__pyx_t_9 != 0);
+    __pyx_t_8 = __pyx_t_10;
+    __pyx_L13_bool_binop_done:;
+    if (!__pyx_t_8) break;
+
+0148:         limit -= 1
+
    __pyx_v_limit = (__pyx_v_limit - 1);
+
+0149:         frames.append((frame.f_code, frame.f_lineno))
+
    __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_frame->f_lineno); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 149, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_6);
+    __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 149, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_5);
+    __Pyx_INCREF(((PyObject *)__pyx_v_frame->f_code));
+    __Pyx_GIVEREF(((PyObject *)__pyx_v_frame->f_code));
+    PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_frame->f_code));
+    __Pyx_GIVEREF(__pyx_t_6);
+    PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_6);
+    __pyx_t_6 = 0;
+    __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_frames, __pyx_t_5); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 149, __pyx_L1_error)
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+
+0150:         frame = frame.f_back
+
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_frame), __pyx_n_s_f_back); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 150, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_5);
+    if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_6gevent_9_greenlet_FrameType))))) __PYX_ERR(0, 150, __pyx_L1_error)
+    __Pyx_DECREF_SET(__pyx_v_frame, ((PyFrameObject *)__pyx_t_5));
+    __pyx_t_5 = 0;
+  }
+
 0151: 
+
+0152:     return frames
+
  __Pyx_XDECREF(__pyx_r);
+  __Pyx_INCREF(__pyx_v_frames);
+  __pyx_r = __pyx_v_frames;
+  goto __pyx_L0;
+
 0153: 
+
 0154: 
+
+0155: _greenlet__init__ = greenlet.__init__
+
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_6gevent_9_greenlet_greenlet), __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 155, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_XGOTREF(__pyx_v_6gevent_9_greenlet__greenlet__init__);
+  __Pyx_DECREF_SET(__pyx_v_6gevent_9_greenlet__greenlet__init__, __pyx_t_2);
+  __Pyx_GIVEREF(__pyx_t_2);
+  __pyx_t_2 = 0;
+
 0156: 
+
+0157: class Greenlet(greenlet):
+
struct __pyx_vtabstruct_6gevent_9_greenlet_Greenlet {
+  int (*has_links)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *, int __pyx_skip_dispatch);
+  PyObject *(*join)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_9_greenlet_8Greenlet_join *__pyx_optional_args);
+  int (*ready)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *, int __pyx_skip_dispatch);
+  int (*successful)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *, int __pyx_skip_dispatch);
+  PyObject *(*rawlink)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *, PyObject *, int __pyx_skip_dispatch);
+  PyObject *(*_formatinfo)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *, int __pyx_skip_dispatch);
+  PyObject *(*_get_minimal_ident)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *);
+  int (*__pyx___started_but_aborted)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *);
+  int (*__pyx___start_cancelled_by_kill)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *);
+  int (*__pyx___start_pending)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *);
+  int (*__pyx___never_started_or_killed)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *);
+  int (*__pyx___start_completed)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *);
+  PyObject *(*__pyx___handle_death_before_start)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *, PyObject *);
+  PyObject *(*__pyx___cancel_start)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *);
+  PyObject *(*_report_result)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *, PyObject *);
+  PyObject *(*_report_error)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *, PyObject *);
+  PyObject *(*_notify_links)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *, int __pyx_skip_dispatch);
+};
+static struct __pyx_vtabstruct_6gevent_9_greenlet_Greenlet *__pyx_vtabptr_6gevent_9_greenlet_Greenlet;
+
+
 0158:     """
+
 0159:     A light-weight cooperatively-scheduled execution unit.
+
 0160:     """
+
 0161:     # pylint:disable=too-many-public-methods,too-many-instance-attributes
+
 0162: 
+
+0163:     spawning_stack_limit = 10
+
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet->tp_dict, __pyx_n_s_spawning_stack_limit, __pyx_int_10) < 0) __PYX_ERR(0, 163, __pyx_L1_error)
+  PyType_Modified(__pyx_ptype_6gevent_9_greenlet_Greenlet);
+
 0164: 
+
 0165:     # pylint:disable=keyword-arg-before-vararg,super-init-not-called
+
+0166:     def __init__(self, run=None, *args, **kwargs):
+
/* Python wrapper */
+static int __pyx_pw_6gevent_9_greenlet_8Greenlet_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_6gevent_9_greenlet_8Greenlet___init__[] = "\n        :param args: The arguments passed to the ``run`` function.\n        :param kwargs: The keyword arguments passed to the ``run`` function.\n        :keyword callable run: The callable object to run. If not given, this object's\n            `_run` method will be invoked (typically defined by subclasses).\n\n        .. versionchanged:: 1.1b1\n            The ``run`` argument to the constructor is now verified to be a callable\n            object. Previously, passing a non-callable object would fail after the greenlet\n            was spawned.\n\n        .. versionchanged:: 1.3b1\n           The ``GEVENT_TRACK_GREENLET_TREE`` configuration value may be set to\n           a false value to disable ``spawn_tree_locals``, ``spawning_greenlet``,\n           and ``spawning_stack``. The first two will be None in that case, and the\n           latter will be empty.\n        ";
+#if CYTHON_COMPILING_IN_CPYTHON
+struct wrapperbase __pyx_wrapperbase_6gevent_9_greenlet_8Greenlet___init__;
+#endif
+static int __pyx_pw_6gevent_9_greenlet_8Greenlet_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_run = 0;
+  PyObject *__pyx_v_args = 0;
+  PyObject *__pyx_v_kwargs = 0;
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
+  __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return -1;
+  __Pyx_GOTREF(__pyx_v_kwargs);
+  if (PyTuple_GET_SIZE(__pyx_args) > 1) {
+    __pyx_v_args = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args));
+    if (unlikely(!__pyx_v_args)) {
+      __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
+      __Pyx_RefNannyFinishContext();
+      return -1;
+    }
+    __Pyx_GOTREF(__pyx_v_args);
+  } else {
+    __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple);
+  }
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_run,0};
+    PyObject* values[1] = {0};
+    values[0] = ((PyObject *)Py_None);
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        default:
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_run);
+          if (value) { values[0] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1;
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, used_pos_args, "__init__") < 0)) __PYX_ERR(0, 166, __pyx_L3_error)
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        default:
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+      }
+    }
+    __pyx_v_run = values[0];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L3_error:;
+  __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0;
+  __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
+  __Pyx_AddTraceback("gevent._greenlet.Greenlet.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return -1;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_9_greenlet_8Greenlet___init__(((struct __pyx_obj_6gevent_9_greenlet_Greenlet *)__pyx_v_self), __pyx_v_run, __pyx_v_args, __pyx_v_kwargs);
+
+  /* function exit code */
+  __Pyx_XDECREF(__pyx_v_args);
+  __Pyx_XDECREF(__pyx_v_kwargs);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_9_greenlet_8Greenlet___init__(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self, PyObject *__pyx_v_run, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) {
+  PyGreenlet *__pyx_v_spawner = NULL;
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = 0;
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_6);
+  __Pyx_AddTraceback("gevent._greenlet.Greenlet.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = -1;
+  __pyx_L0:;
+  __Pyx_XDECREF((PyObject *)__pyx_v_spawner);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
 0167:         """
+
 0168:         :param args: The arguments passed to the ``run`` function.
+
 0169:         :param kwargs: The keyword arguments passed to the ``run`` function.
+
 0170:         :keyword callable run: The callable object to run. If not given, this object's
+
 0171:             `_run` method will be invoked (typically defined by subclasses).
+
 0172: 
+
 0173:         .. versionchanged:: 1.1b1
+
 0174:             The ``run`` argument to the constructor is now verified to be a callable
+
 0175:             object. Previously, passing a non-callable object would fail after the greenlet
+
 0176:             was spawned.
+
 0177: 
+
 0178:         .. versionchanged:: 1.3b1
+
 0179:            The ``GEVENT_TRACK_GREENLET_TREE`` configuration value may be set to
+
 0180:            a false value to disable ``spawn_tree_locals``, ``spawning_greenlet``,
+
 0181:            and ``spawning_stack``. The first two will be None in that case, and the
+
 0182:            latter will be empty.
+
 0183:         """
+
 0184:         # The attributes are documented in the .rst file
+
 0185: 
+
 0186:         # greenlet.greenlet(run=None, parent=None)
+
 0187:         # Calling it with both positional arguments instead of a keyword
+
 0188:         # argument (parent=get_hub()) speeds up creation of this object ~30%:
+
 0189:         # python -m timeit -s 'import gevent' 'gevent.Greenlet()'
+
 0190:         # Python 3.5: 2.70usec with keywords vs 1.94usec with positional
+
 0191:         # Python 3.4: 2.32usec with keywords vs 1.74usec with positional
+
 0192:         # Python 3.3: 2.55usec with keywords vs 1.92usec with positional
+
 0193:         # Python 2.7: 1.73usec with keywords vs 1.40usec with positional
+
 0194: 
+
 0195:         # Timings taken Feb 21 2018 prior to integration of #755
+
 0196:         # python -m perf timeit -s 'import gevent' 'gevent.Greenlet()'
+
 0197:         # 3.6.4       : Mean +- std dev: 1.08 us +- 0.05 us
+
 0198:         # 2.7.14      : Mean +- std dev: 1.44 us +- 0.06 us
+
 0199:         # PyPy2 5.10.0: Mean +- std dev: 2.14 ns +- 0.08 ns
+
 0200: 
+
 0201:         # After the integration of spawning_stack, spawning_greenlet,
+
 0202:         # and spawn_tree_locals on that same date:
+
 0203:         # 3.6.4       : Mean +- std dev: 8.92 us +- 0.36 us ->  8.2x
+
 0204:         # 2.7.14      : Mean +- std dev: 14.8 us +- 0.5 us  -> 10.2x
+
 0205:         # PyPy2 5.10.0: Mean +- std dev: 3.24 us +- 0.17 us ->  1.5x
+
 0206: 
+
 0207:         # Compiling with Cython gets us to these numbers:
+
 0208:         # 3.6.4        : Mean +- std dev: 3.63 us +- 0.14 us
+
 0209:         # 2.7.14       : Mean +- std dev: 3.37 us +- 0.20 us
+
 0210:         # PyPy2 5.10.0 : Mean +- std dev: 4.44 us +- 0.28 us
+
 0211: 
+
 0212: 
+
+0213:         _greenlet__init__(self, None, get_hub())
+
  __pyx_t_2 = ((PyObject *)__pyx_f_6gevent_11__hub_local_get_hub_noargs(0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 213, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(__pyx_v_6gevent_9_greenlet__greenlet__init__);
+  __pyx_t_3 = __pyx_v_6gevent_9_greenlet__greenlet__init__; __pyx_t_4 = NULL;
+  __pyx_t_5 = 0;
+  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+    if (likely(__pyx_t_4)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+      __Pyx_INCREF(__pyx_t_4);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_3, function);
+      __pyx_t_5 = 1;
+    }
+  }
+  #if CYTHON_FAST_PYCALL
+  if (PyFunction_Check(__pyx_t_3)) {
+    PyObject *__pyx_temp[4] = {__pyx_t_4, ((PyObject *)__pyx_v_self), Py_None, __pyx_t_2};
+    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 213, __pyx_L1_error)
+    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  } else
+  #endif
+  #if CYTHON_FAST_PYCCALL
+  if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
+    PyObject *__pyx_temp[4] = {__pyx_t_4, ((PyObject *)__pyx_v_self), Py_None, __pyx_t_2};
+    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 213, __pyx_L1_error)
+    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  } else
+  #endif
+  {
+    __pyx_t_6 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 213, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_6);
+    if (__pyx_t_4) {
+      __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
+    }
+    __Pyx_INCREF(((PyObject *)__pyx_v_self));
+    __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
+    PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, ((PyObject *)__pyx_v_self));
+    __Pyx_INCREF(Py_None);
+    __Pyx_GIVEREF(Py_None);
+    PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, Py_None);
+    __Pyx_GIVEREF(__pyx_t_2);
+    PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_t_2);
+    __pyx_t_2 = 0;
+    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 213, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  }
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 0214: 
+
+0215:         if run is not None:
+
  __pyx_t_7 = (__pyx_v_run != Py_None);
+  __pyx_t_8 = (__pyx_t_7 != 0);
+  if (__pyx_t_8) {
+/* … */
+  }
+
+0216:             self._run = run
+
    if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_run_2, __pyx_v_run) < 0) __PYX_ERR(0, 216, __pyx_L1_error)
+
 0217: 
+
 0218:         # If they didn't pass a callable at all, then they must
+
 0219:         # already have one. Note that subclassing to override the run() method
+
 0220:         # itself has never been documented or supported.
+
+0221:         if not callable(self._run):
+
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_run_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 221, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_8 = __Pyx_PyCallable_Check(__pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 221, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_7 = ((!(__pyx_t_8 != 0)) != 0);
+  if (unlikely(__pyx_t_7)) {
+/* … */
+  }
+
+0222:             raise TypeError("The run argument or self._run must be callable")
+
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 222, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __PYX_ERR(0, 222, __pyx_L1_error)
+/* … */
+  __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_The_run_argument_or_self__run_mu); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 222, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple_);
+  __Pyx_GIVEREF(__pyx_tuple_);
+
 0223: 
+
+0224:         self.args = args
+
  __Pyx_INCREF(__pyx_v_args);
+  __Pyx_GIVEREF(__pyx_v_args);
+  __Pyx_GOTREF(__pyx_v_self->args);
+  __Pyx_DECREF(__pyx_v_self->args);
+  __pyx_v_self->args = __pyx_v_args;
+
+0225:         self.kwargs = kwargs
+
  __Pyx_INCREF(__pyx_v_kwargs);
+  __Pyx_GIVEREF(__pyx_v_kwargs);
+  __Pyx_GOTREF(__pyx_v_self->kwargs);
+  __Pyx_DECREF(__pyx_v_self->kwargs);
+  __pyx_v_self->kwargs = __pyx_v_kwargs;
+
+0226:         self.value = None
+
  __Pyx_INCREF(Py_None);
+  __Pyx_GIVEREF(Py_None);
+  __Pyx_GOTREF(__pyx_v_self->value);
+  __Pyx_DECREF(__pyx_v_self->value);
+  __pyx_v_self->value = Py_None;
+
 0227: 
+
 0228:         #: An event, such as a timer or a callback that fires. It is established in
+
 0229:         #: start() and start_later() as those two objects, respectively.
+
 0230:         #: Once this becomes non-None, the Greenlet cannot be started again. Conversely,
+
 0231:         #: kill() and throw() check for non-None to determine if this object has ever been
+
 0232:         #: scheduled for starting. A placeholder _dummy_event is assigned by them to prevent
+
 0233:         #: the greenlet from being started in the future, if necessary.
+
+0234:         self._start_event = None
+
  __Pyx_INCREF(Py_None);
+  __Pyx_GIVEREF(Py_None);
+  __Pyx_GOTREF(__pyx_v_self->_start_event);
+  __Pyx_DECREF(__pyx_v_self->_start_event);
+  __pyx_v_self->_start_event = Py_None;
+
 0235: 
+
+0236:         self._notifier = None
+
  __Pyx_INCREF(Py_None);
+  __Pyx_GIVEREF(Py_None);
+  __Pyx_GOTREF(__pyx_v_self->_notifier);
+  __Pyx_DECREF(__pyx_v_self->_notifier);
+  __pyx_v_self->_notifier = Py_None;
+
+0237:         self._formatted_info = None
+
  __Pyx_INCREF(Py_None);
+  __Pyx_GIVEREF(Py_None);
+  __Pyx_GOTREF(__pyx_v_self->_formatted_info);
+  __Pyx_DECREF(__pyx_v_self->_formatted_info);
+  __pyx_v_self->_formatted_info = ((PyObject*)Py_None);
+
+0238:         self._links = []
+
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 238, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_1);
+  __Pyx_GOTREF(__pyx_v_self->_links);
+  __Pyx_DECREF(__pyx_v_self->_links);
+  __pyx_v_self->_links = ((PyObject*)__pyx_t_1);
+  __pyx_t_1 = 0;
+
+0239:         self._ident = None
+
  __Pyx_INCREF(Py_None);
+  __Pyx_GIVEREF(Py_None);
+  __Pyx_GOTREF(__pyx_v_self->_ident);
+  __Pyx_DECREF(__pyx_v_self->_ident);
+  __pyx_v_self->_ident = Py_None;
+
 0240: 
+
 0241:         # Initial state: None.
+
 0242:         # Completed successfully: (None, None, None)
+
 0243:         # Failed with exception: (t, v, dump_traceback(tb)))
+
+0244:         self._exc_info = None
+
  __Pyx_INCREF(Py_None);
+  __Pyx_GIVEREF(Py_None);
+  __Pyx_GOTREF(__pyx_v_self->_exc_info);
+  __Pyx_DECREF(__pyx_v_self->_exc_info);
+  __pyx_v_self->_exc_info = ((PyObject*)Py_None);
+
 0245: 
+
+0246:         if GEVENT_CONFIG.track_greenlet_tree:
+
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_6gevent_9_greenlet_GEVENT_CONFIG, __pyx_n_s_track_greenlet_tree); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 246, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 246, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  if (__pyx_t_7) {
+/* … */
+    goto __pyx_L5;
+  }
+
+0247:             spawner = getcurrent() # pylint:disable=undefined-variable
+
    __pyx_t_1 = ((PyObject *)__pyx_f_6gevent_9_greenlet_getcurrent()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 247, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __pyx_v_spawner = ((PyGreenlet *)__pyx_t_1);
+    __pyx_t_1 = 0;
+
+0248:             self.spawning_greenlet = wref(spawner)
+
    __Pyx_INCREF(__pyx_v_6gevent_9_greenlet_wref);
+    __pyx_t_3 = __pyx_v_6gevent_9_greenlet_wref; __pyx_t_6 = NULL;
+    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
+      if (likely(__pyx_t_6)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+        __Pyx_INCREF(__pyx_t_6);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_3, function);
+      }
+    }
+    __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_6, ((PyObject *)__pyx_v_spawner)) : __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_spawner));
+    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 248, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __Pyx_GIVEREF(__pyx_t_1);
+    __Pyx_GOTREF(__pyx_v_self->spawning_greenlet);
+    __Pyx_DECREF(__pyx_v_self->spawning_greenlet);
+    __pyx_v_self->spawning_greenlet = __pyx_t_1;
+    __pyx_t_1 = 0;
+
+0249:             try:
+
    {
+      /*try:*/ {
+/* … */
+      }
+      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
+      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
+      __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
+      goto __pyx_L11_try_end;
+      __pyx_L6_error:;
+      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+/* … */
+      __Pyx_XGIVEREF(__pyx_t_9);
+      __Pyx_XGIVEREF(__pyx_t_10);
+      __Pyx_XGIVEREF(__pyx_t_11);
+      __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
+      goto __pyx_L1_error;
+      __pyx_L7_exception_handled:;
+      __Pyx_XGIVEREF(__pyx_t_9);
+      __Pyx_XGIVEREF(__pyx_t_10);
+      __Pyx_XGIVEREF(__pyx_t_11);
+      __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
+      __pyx_L11_try_end:;
+    }
+
+0250:                 self.spawn_tree_locals = spawner.spawn_tree_locals
+
        __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_spawner), __pyx_n_s_spawn_tree_locals); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 250, __pyx_L6_error)
+        __Pyx_GOTREF(__pyx_t_1);
+        if (!(likely(PyDict_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 250, __pyx_L6_error)
+        __Pyx_GIVEREF(__pyx_t_1);
+        __Pyx_GOTREF(__pyx_v_self->spawn_tree_locals);
+        __Pyx_DECREF(__pyx_v_self->spawn_tree_locals);
+        __pyx_v_self->spawn_tree_locals = ((PyObject*)__pyx_t_1);
+        __pyx_t_1 = 0;
+
+0251:             except AttributeError:
+
      __pyx_t_5 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_AttributeError);
+      if (__pyx_t_5) {
+        __Pyx_AddTraceback("gevent._greenlet.Greenlet.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+        if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_3, &__pyx_t_6) < 0) __PYX_ERR(0, 251, __pyx_L8_except_error)
+        __Pyx_GOTREF(__pyx_t_1);
+        __Pyx_GOTREF(__pyx_t_3);
+        __Pyx_GOTREF(__pyx_t_6);
+
+0252:                 self.spawn_tree_locals = {}
+
        __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 252, __pyx_L8_except_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        __Pyx_GIVEREF(__pyx_t_2);
+        __Pyx_GOTREF(__pyx_v_self->spawn_tree_locals);
+        __Pyx_DECREF(__pyx_v_self->spawn_tree_locals);
+        __pyx_v_self->spawn_tree_locals = ((PyObject*)__pyx_t_2);
+        __pyx_t_2 = 0;
+
+0253:                 if spawner.parent is not None:
+
        __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_spawner), __pyx_n_s_parent); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 253, __pyx_L8_except_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        __pyx_t_7 = (__pyx_t_2 != Py_None);
+        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+        __pyx_t_8 = (__pyx_t_7 != 0);
+        if (__pyx_t_8) {
+/* … */
+        }
+        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+        goto __pyx_L7_exception_handled;
+      }
+      goto __pyx_L8_except_error;
+      __pyx_L8_except_error:;
+
 0254:                     # The main greenlet has no parent.
+
 0255:                     # Its children get separate locals.
+
+0256:                     spawner.spawn_tree_locals = self.spawn_tree_locals
+
          __pyx_t_2 = __pyx_v_self->spawn_tree_locals;
+          __Pyx_INCREF(__pyx_t_2);
+          if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_spawner), __pyx_n_s_spawn_tree_locals, __pyx_t_2) < 0) __PYX_ERR(0, 256, __pyx_L8_except_error)
+          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
 0257: 
+
+0258:             self._spawning_stack_frames = _extract_stack(self.spawning_stack_limit)
+
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_spawning_stack_limit); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 258, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_6);
+    __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_6); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 258, __pyx_L1_error)
+    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+    __pyx_t_6 = __pyx_f_6gevent_9_greenlet__extract_stack(__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 258, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_6);
+    __Pyx_GIVEREF(__pyx_t_6);
+    __Pyx_GOTREF(__pyx_v_self->_spawning_stack_frames);
+    __Pyx_DECREF(__pyx_v_self->_spawning_stack_frames);
+    __pyx_v_self->_spawning_stack_frames = ((PyObject*)__pyx_t_6);
+    __pyx_t_6 = 0;
+
+0259:             self._spawning_stack_frames.extend(getattr(spawner, '_spawning_stack_frames', []))
+
    if (unlikely(__pyx_v_self->_spawning_stack_frames == Py_None)) {
+      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "extend");
+      __PYX_ERR(0, 259, __pyx_L1_error)
+    }
+    __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 259, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_6);
+    __pyx_t_3 = __Pyx_GetAttr3(((PyObject *)__pyx_v_spawner), __pyx_n_s_spawning_stack_frames, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 259, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+    __pyx_t_12 = __Pyx_PyList_Extend(__pyx_v_self->_spawning_stack_frames, __pyx_t_3); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 259, __pyx_L1_error)
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+
 0260:         else:
+
 0261:             # None is the default for all of these in Cython, but we
+
 0262:             # need to declare them for pure-Python mode.
+
+0263:             self.spawning_greenlet = None
+
  /*else*/ {
+    __Pyx_INCREF(Py_None);
+    __Pyx_GIVEREF(Py_None);
+    __Pyx_GOTREF(__pyx_v_self->spawning_greenlet);
+    __Pyx_DECREF(__pyx_v_self->spawning_greenlet);
+    __pyx_v_self->spawning_greenlet = Py_None;
+
+0264:             self.spawn_tree_locals = None
+
    __Pyx_INCREF(Py_None);
+    __Pyx_GIVEREF(Py_None);
+    __Pyx_GOTREF(__pyx_v_self->spawn_tree_locals);
+    __Pyx_DECREF(__pyx_v_self->spawn_tree_locals);
+    __pyx_v_self->spawn_tree_locals = ((PyObject*)Py_None);
+
+0265:             self._spawning_stack_frames = None
+
    __Pyx_INCREF(Py_None);
+    __Pyx_GIVEREF(Py_None);
+    __Pyx_GOTREF(__pyx_v_self->_spawning_stack_frames);
+    __Pyx_DECREF(__pyx_v_self->_spawning_stack_frames);
+    __pyx_v_self->_spawning_stack_frames = ((PyObject*)Py_None);
+  }
+  __pyx_L5:;
+
 0266: 
+
+0267:     @Lazy
+
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Lazy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 267, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+
+0268:     def spawning_stack(self):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_3spawning_stack(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6gevent_9_greenlet_8Greenlet_2spawning_stack[] = "Greenlet.spawning_stack(self)";
+static PyMethodDef __pyx_mdef_6gevent_9_greenlet_8Greenlet_3spawning_stack = {"spawning_stack", (PyCFunction)__pyx_pw_6gevent_9_greenlet_8Greenlet_3spawning_stack, METH_NOARGS, __pyx_doc_6gevent_9_greenlet_8Greenlet_2spawning_stack};
+static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_3spawning_stack(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("spawning_stack (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_9_greenlet_8Greenlet_2spawning_stack(((struct __pyx_obj_6gevent_9_greenlet_Greenlet *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_2spawning_stack(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("spawning_stack", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_AddTraceback("gevent._greenlet.Greenlet.spawning_stack", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__23 = PyTuple_Pack(1, __pyx_n_s_self_2); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(0, 268, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__23);
+  __Pyx_GIVEREF(__pyx_tuple__23);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_9_greenlet_8Greenlet_3spawning_stack, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Greenlet_spawning_stack, NULL, __pyx_n_s_gevent__greenlet, __pyx_d, ((PyObject *)__pyx_codeobj__24)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 268, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet->tp_dict, __pyx_n_s_spawning_stack, __pyx_t_2) < 0) __PYX_ERR(0, 268, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_9_greenlet_Greenlet);
+/* … */
+  __Pyx_GetNameInClass(__pyx_t_4, (PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet, __pyx_n_s_spawning_stack); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 268, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_4);
+  __pyx_t_5 = NULL;
+  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
+    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
+    if (likely(__pyx_t_5)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
+      __Pyx_INCREF(__pyx_t_5);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_1, function);
+    }
+  }
+  __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 267, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet->tp_dict, __pyx_n_s_spawning_stack, __pyx_t_2) < 0) __PYX_ERR(0, 268, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_9_greenlet_Greenlet);
+  __pyx_codeobj__24 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__23, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_greenlet_py, __pyx_n_s_spawning_stack, 268, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__24)) __PYX_ERR(0, 268, __pyx_L1_error)
+
 0269:         # Store this in the __dict__. We don't use it from the C
+
 0270:         # code. It's tempting to discard _spawning_stack_frames
+
 0271:         # after this, but child greenlets may still be created
+
 0272:         # that need it.
+
+0273:         return _Frame_from_list(self._spawning_stack_frames or [])
+
  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_self->_spawning_stack_frames); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 273, __pyx_L1_error)
+  if (!__pyx_t_2) {
+  } else {
+    __Pyx_INCREF(__pyx_v_self->_spawning_stack_frames);
+    __pyx_t_1 = __pyx_v_self->_spawning_stack_frames;
+    goto __pyx_L3_bool_binop_done;
+  }
+  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 273, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_INCREF(__pyx_t_3);
+  __pyx_t_1 = __pyx_t_3;
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __pyx_L3_bool_binop_done:;
+  __pyx_t_3 = ((PyObject *)__pyx_f_6gevent_9_greenlet__Frame_from_list(((PyObject*)__pyx_t_1))); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 273, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_r = __pyx_t_3;
+  __pyx_t_3 = 0;
+  goto __pyx_L0;
+
 0274: 
+
+0275:     def _get_minimal_ident(self):
+
static PyObject *__pyx_f_6gevent_9_greenlet_8Greenlet__get_minimal_ident(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self) {
+  struct __pyx_obj_6gevent_7__ident_IdentRegistry *__pyx_v_reg = 0;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_get_minimal_ident", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_AddTraceback("gevent._greenlet.Greenlet._get_minimal_ident", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XDECREF((PyObject *)__pyx_v_reg);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0276:         reg = self.parent.ident_registry
+
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_parent); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 276, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_ident_registry); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 276, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_6gevent_7__ident_IdentRegistry))))) __PYX_ERR(0, 276, __pyx_L1_error)
+  __pyx_v_reg = ((struct __pyx_obj_6gevent_7__ident_IdentRegistry *)__pyx_t_2);
+  __pyx_t_2 = 0;
+
+0277:         return reg.get_ident(self)
+
  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_2 = ((struct __pyx_vtabstruct_6gevent_7__ident_IdentRegistry *)__pyx_v_reg->__pyx_vtab)->get_ident(__pyx_v_reg, ((PyObject *)__pyx_v_self), 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 277, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_r = __pyx_t_2;
+  __pyx_t_2 = 0;
+  goto __pyx_L0;
+
 0278: 
+
 0279:     @property
+
+0280:     def minimal_ident(self):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_13minimal_ident_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_13minimal_ident_1__get__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_9_greenlet_8Greenlet_13minimal_ident___get__(((struct __pyx_obj_6gevent_9_greenlet_Greenlet *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_13minimal_ident___get__(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_AddTraceback("gevent._greenlet.Greenlet.minimal_ident.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
 0281:         """
+
 0282:         A small, unique integer that identifies this object.
+
 0283: 
+
 0284:         This is similar to :attr:`threading.Thread.ident` (and `id`)
+
 0285:         in that as long as this object is alive, no other greenlet *in
+
 0286:         this hub* will have the same id, but it makes a stronger
+
 0287:         guarantee that the assigned values will be small and
+
 0288:         sequential. Sometime after this object has died, the value
+
 0289:         will be available for reuse.
+
 0290: 
+
 0291:         To get ids that are unique across all hubs, combine this with
+
 0292:         the hub's ``minimal_ident``.
+
 0293: 
+
 0294:         .. versionadded:: 1.3a2
+
 0295:         """
+
+0296:         if self._ident is None:
+
  __pyx_t_1 = (__pyx_v_self->_ident == Py_None);
+  __pyx_t_2 = (__pyx_t_1 != 0);
+  if (__pyx_t_2) {
+/* … */
+  }
+
+0297:             self._ident = self._get_minimal_ident()
+
    __pyx_t_3 = ((struct __pyx_vtabstruct_6gevent_9_greenlet_Greenlet *)__pyx_v_self->__pyx_vtab)->_get_minimal_ident(__pyx_v_self); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 297, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_GIVEREF(__pyx_t_3);
+    __Pyx_GOTREF(__pyx_v_self->_ident);
+    __Pyx_DECREF(__pyx_v_self->_ident);
+    __pyx_v_self->_ident = __pyx_t_3;
+    __pyx_t_3 = 0;
+
+0298:         return self._ident
+
  __Pyx_XDECREF(__pyx_r);
+  __Pyx_INCREF(__pyx_v_self->_ident);
+  __pyx_r = __pyx_v_self->_ident;
+  goto __pyx_L0;
+
 0299: 
+
+0300:     @readproperty
+
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_readproperty); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 300, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+
+0301:     def name(self):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_5name(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6gevent_9_greenlet_8Greenlet_4name[] = "Greenlet.name(self)\n\n        The greenlet name. By default, a unique name is constructed using\n        the :attr:`minimal_ident`. You can assign a string to this\n        value to change it. It is shown in the `repr` of this object if it\n        has been assigned to or if the `minimal_ident` has already been generated.\n\n        .. versionadded:: 1.3a2\n        .. versionchanged:: 1.4\n           Stop showing generated names in the `repr` when the ``minimal_ident``\n           hasn't been requested. This reduces overhead and may be less confusing,\n           since ``minimal_ident`` can get reused.\n        ";
+static PyMethodDef __pyx_mdef_6gevent_9_greenlet_8Greenlet_5name = {"name", (PyCFunction)__pyx_pw_6gevent_9_greenlet_8Greenlet_5name, METH_NOARGS, __pyx_doc_6gevent_9_greenlet_8Greenlet_4name};
+static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_5name(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("name (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_9_greenlet_8Greenlet_4name(((struct __pyx_obj_6gevent_9_greenlet_Greenlet *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_4name(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("name", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_AddTraceback("gevent._greenlet.Greenlet.name", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__25 = PyTuple_Pack(1, __pyx_n_s_self_2); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(0, 301, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__25);
+  __Pyx_GIVEREF(__pyx_tuple__25);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_9_greenlet_8Greenlet_5name, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Greenlet_name, NULL, __pyx_n_s_gevent__greenlet, __pyx_d, ((PyObject *)__pyx_codeobj__26)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 301, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet->tp_dict, __pyx_n_s_name_2, __pyx_t_2) < 0) __PYX_ERR(0, 301, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_9_greenlet_Greenlet);
+/* … */
+  __Pyx_GetNameInClass(__pyx_t_4, (PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet, __pyx_n_s_name_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 301, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_4);
+  __pyx_t_5 = NULL;
+  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
+    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
+    if (likely(__pyx_t_5)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
+      __Pyx_INCREF(__pyx_t_5);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_1, function);
+    }
+  }
+  __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 300, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet->tp_dict, __pyx_n_s_name_2, __pyx_t_2) < 0) __PYX_ERR(0, 301, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_9_greenlet_Greenlet);
+  __pyx_codeobj__26 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__25, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_greenlet_py, __pyx_n_s_name_2, 301, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__26)) __PYX_ERR(0, 301, __pyx_L1_error)
+
 0302:         """
+
 0303:         The greenlet name. By default, a unique name is constructed using
+
 0304:         the :attr:`minimal_ident`. You can assign a string to this
+
 0305:         value to change it. It is shown in the `repr` of this object if it
+
 0306:         has been assigned to or if the `minimal_ident` has already been generated.
+
 0307: 
+
 0308:         .. versionadded:: 1.3a2
+
 0309:         .. versionchanged:: 1.4
+
 0310:            Stop showing generated names in the `repr` when the ``minimal_ident``
+
 0311:            hasn't been requested. This reduces overhead and may be less confusing,
+
 0312:            since ``minimal_ident`` can get reused.
+
 0313:         """
+
+0314:         return 'Greenlet-%d' % (self.minimal_ident,)
+
  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_minimal_ident); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 314, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 314, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_GIVEREF(__pyx_t_1);
+  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
+  __pyx_t_1 = 0;
+  __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_Greenlet_d, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 314, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
 0315: 
+
+0316:     def _raise_exception(self):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_7_raise_exception(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6gevent_9_greenlet_8Greenlet_6_raise_exception[] = "Greenlet._raise_exception(self)";
+static PyMethodDef __pyx_mdef_6gevent_9_greenlet_8Greenlet_7_raise_exception = {"_raise_exception", (PyCFunction)__pyx_pw_6gevent_9_greenlet_8Greenlet_7_raise_exception, METH_NOARGS, __pyx_doc_6gevent_9_greenlet_8Greenlet_6_raise_exception};
+static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_7_raise_exception(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_raise_exception (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_9_greenlet_8Greenlet_6_raise_exception(((struct __pyx_obj_6gevent_9_greenlet_Greenlet *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_6_raise_exception(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_raise_exception", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_AddTraceback("gevent._greenlet.Greenlet._raise_exception", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__27 = PyTuple_Pack(1, __pyx_n_s_self_2); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(0, 316, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__27);
+  __Pyx_GIVEREF(__pyx_tuple__27);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_9_greenlet_8Greenlet_7_raise_exception, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Greenlet__raise_exception, NULL, __pyx_n_s_gevent__greenlet, __pyx_d, ((PyObject *)__pyx_codeobj__28)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 316, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet->tp_dict, __pyx_n_s_raise_exception, __pyx_t_2) < 0) __PYX_ERR(0, 316, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_9_greenlet_Greenlet);
+  __pyx_codeobj__28 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__27, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_greenlet_py, __pyx_n_s_raise_exception, 316, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__28)) __PYX_ERR(0, 316, __pyx_L1_error)
+
+0317:         reraise(*self.exc_info)
+
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_exc_info); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 317, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = __Pyx_PySequence_Tuple(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 317, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_6gevent_9_greenlet_reraise, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 317, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 0318: 
+
 0319:     @property
+
+0320:     def loop(self):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_4loop_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_4loop_1__get__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_9_greenlet_8Greenlet_4loop___get__(((struct __pyx_obj_6gevent_9_greenlet_Greenlet *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_4loop___get__(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_AddTraceback("gevent._greenlet.Greenlet.loop.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
 0321:         # needed by killall
+
+0322:         return self.parent.loop
+
  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_parent); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 322, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_loop); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 322, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_r = __pyx_t_2;
+  __pyx_t_2 = 0;
+  goto __pyx_L0;
+
 0323: 
+
+0324:     def __nonzero__(self):
+
/* Python wrapper */
+static int __pyx_pw_6gevent_9_greenlet_8Greenlet_9__nonzero__(PyObject *__pyx_v_self); /*proto*/
+static int __pyx_pw_6gevent_9_greenlet_8Greenlet_9__nonzero__(PyObject *__pyx_v_self) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__nonzero__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_9_greenlet_8Greenlet_8__nonzero__(((struct __pyx_obj_6gevent_9_greenlet_Greenlet *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_9_greenlet_8Greenlet_8__nonzero__(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__nonzero__", 0);
+/* … */
+  /* function exit code */
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0325:         return self._start_event is not None and self._exc_info is None
+
  __pyx_t_2 = (__pyx_v_self->_start_event != Py_None);
+  if (__pyx_t_2) {
+  } else {
+    __pyx_t_1 = __pyx_t_2;
+    goto __pyx_L3_bool_binop_done;
+  }
+  __pyx_t_2 = (__pyx_v_self->_exc_info == ((PyObject*)Py_None));
+  __pyx_t_1 = __pyx_t_2;
+  __pyx_L3_bool_binop_done:;
+  __pyx_r = __pyx_t_1;
+  goto __pyx_L0;
+
+0326:     try:
+
  {
+    /*try:*/ {
+/* … */
+    }
+    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
+    goto __pyx_L8_try_end;
+    __pyx_L3_error:;
+    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+/* … */
+    __Pyx_XGIVEREF(__pyx_t_6);
+    __Pyx_XGIVEREF(__pyx_t_7);
+    __Pyx_XGIVEREF(__pyx_t_8);
+    __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
+    goto __pyx_L1_error;
+    __pyx_L4_exception_handled:;
+    __Pyx_XGIVEREF(__pyx_t_6);
+    __Pyx_XGIVEREF(__pyx_t_7);
+    __Pyx_XGIVEREF(__pyx_t_8);
+    __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
+    __pyx_L8_try_end:;
+  }
+
+0327:         __bool__ = __nonzero__ # Python 3
+
      __Pyx_GetNameInClass(__pyx_t_2, (PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet, __pyx_n_s_nonzero); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 327, __pyx_L3_error)
+      __Pyx_GOTREF(__pyx_t_2);
+      if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet->tp_dict, __pyx_n_s_bool, __pyx_t_2) < 0) __PYX_ERR(0, 327, __pyx_L3_error)
+      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+      PyType_Modified(__pyx_ptype_6gevent_9_greenlet_Greenlet);
+
+0328:     except NameError: # pragma: no cover
+
    __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_NameError);
+    if (__pyx_t_9) {
+      __Pyx_ErrRestore(0,0,0);
+      goto __pyx_L4_exception_handled;
+    }
+    goto __pyx_L5_except_error;
+    __pyx_L5_except_error:;
+
 0329:         # When we're compiled with Cython, the __nonzero__ function
+
 0330:         # goes directly into the slot and can't be accessed by name.
+
 0331:         pass
+
 0332: 
+
 0333:     ### Lifecycle
+
 0334: 
+
+0335:     if _PYPY:
+
  __pyx_t_3 = (__pyx_v_6gevent_9_greenlet__PYPY != 0);
+  if (__pyx_t_3) {
+/* … */
+    goto __pyx_L9;
+  }
+
 0336:         # oops - pypy's .dead relies on __nonzero__ which we overriden above
+
 0337:         @property
+
 0338:         def dead(self):
+
 0339:             "Boolean indicating that the greenlet is dead and will not run again."
+
 0340:             if self._greenlet__main:
+
 0341:                 return False
+
 0342:             if self.__start_cancelled_by_kill() or self.__started_but_aborted():
+
 0343:                 return True
+
 0344: 
+
 0345:             return self._greenlet__started and not _continulet.is_pending(self)
+
 0346:     else:
+
 0347:         @property
+
+0348:         def dead(self):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_4dead_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_4dead_1__get__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_9_greenlet_8Greenlet_4dead___get__(((struct __pyx_obj_6gevent_9_greenlet_Greenlet *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_4dead___get__(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_AddTraceback("gevent._greenlet.Greenlet.dead.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+  /*else*/ {
+  }
+  __pyx_L9:;
+
 0349:             "Boolean indicating that the greenlet is dead and will not run again."
+
+0350:             return self.__start_cancelled_by_kill() or self.__started_but_aborted() or greenlet.dead.__get__(self)
+
  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_2 = ((struct __pyx_vtabstruct_6gevent_9_greenlet_Greenlet *)__pyx_v_self->__pyx_vtab)->__pyx___start_cancelled_by_kill(__pyx_v_self);
+  if (!__pyx_t_2) {
+  } else {
+    __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 350, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __pyx_t_1 = __pyx_t_3;
+    __pyx_t_3 = 0;
+    goto __pyx_L3_bool_binop_done;
+  }
+  __pyx_t_2 = ((struct __pyx_vtabstruct_6gevent_9_greenlet_Greenlet *)__pyx_v_self->__pyx_vtab)->__pyx___started_but_aborted(__pyx_v_self);
+  if (!__pyx_t_2) {
+  } else {
+    __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 350, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __pyx_t_1 = __pyx_t_3;
+    __pyx_t_3 = 0;
+    goto __pyx_L3_bool_binop_done;
+  }
+  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_6gevent_9_greenlet_greenlet), __pyx_n_s_dead); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 350, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_4);
+  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_get); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 350, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_5);
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __pyx_t_4 = NULL;
+  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
+    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
+    if (likely(__pyx_t_4)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
+      __Pyx_INCREF(__pyx_t_4);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_5, function);
+    }
+  }
+  __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_4, ((PyObject *)__pyx_v_self)) : __Pyx_PyObject_CallOneArg(__pyx_t_5, ((PyObject *)__pyx_v_self));
+  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 350, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+  __Pyx_INCREF(__pyx_t_3);
+  __pyx_t_1 = __pyx_t_3;
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __pyx_L3_bool_binop_done:;
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
 0351: 
+
+0352:     def __never_started_or_killed(self):
+
static int __pyx_f_6gevent_9_greenlet_8Greenlet___never_started_or_killed(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__never_started_or_killed", 0);
+/* … */
+  /* function exit code */
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0353:         return self._start_event is None
+
  __pyx_t_1 = (__pyx_v_self->_start_event == Py_None);
+  __pyx_r = __pyx_t_1;
+  goto __pyx_L0;
+
 0354: 
+
+0355:     def __start_pending(self):
+
static int __pyx_f_6gevent_9_greenlet_8Greenlet___start_pending(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__start_pending", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_WriteUnraisable("gevent._greenlet.Greenlet.__start_pending", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0356:         return (self._start_event is not None
+
  __pyx_t_2 = (__pyx_v_self->_start_event != Py_None);
+  __pyx_t_3 = (__pyx_t_2 != 0);
+  if (__pyx_t_3) {
+  } else {
+    __pyx_t_1 = __pyx_t_3;
+    goto __pyx_L3_bool_binop_done;
+  }
+
+0357:                 and (self._start_event.pending or getattr(self._start_event, 'active', False)))
+
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_start_event, __pyx_n_s_pending); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 357, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_4);
+  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 357, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  if (!__pyx_t_3) {
+  } else {
+    __pyx_t_1 = __pyx_t_3;
+    goto __pyx_L3_bool_binop_done;
+  }
+  __pyx_t_4 = __pyx_v_self->_start_event;
+  __Pyx_INCREF(__pyx_t_4);
+  __pyx_t_5 = __Pyx_GetAttr3(__pyx_t_4, __pyx_n_s_active, Py_False); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 357, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_5);
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 357, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+  __pyx_t_1 = __pyx_t_3;
+  __pyx_L3_bool_binop_done:;
+  __pyx_r = __pyx_t_1;
+  goto __pyx_L0;
+
 0358: 
+
+0359:     def __start_cancelled_by_kill(self):
+
static int __pyx_f_6gevent_9_greenlet_8Greenlet___start_cancelled_by_kill(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__start_cancelled_by_kill", 0);
+/* … */
+  /* function exit code */
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0360:         return self._start_event is _cancelled_start_event
+
  __pyx_t_1 = (__pyx_v_self->_start_event == ((PyObject *)__pyx_v_6gevent_9_greenlet__cancelled_start_event));
+  __pyx_r = __pyx_t_1;
+  goto __pyx_L0;
+
 0361: 
+
+0362:     def __start_completed(self):
+
static int __pyx_f_6gevent_9_greenlet_8Greenlet___start_completed(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__start_completed", 0);
+/* … */
+  /* function exit code */
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0363:         return self._start_event is _start_completed_event
+
  __pyx_t_1 = (__pyx_v_self->_start_event == ((PyObject *)__pyx_v_6gevent_9_greenlet__start_completed_event));
+  __pyx_r = __pyx_t_1;
+  goto __pyx_L0;
+
 0364: 
+
+0365:     def __started_but_aborted(self):
+
static int __pyx_f_6gevent_9_greenlet_8Greenlet___started_but_aborted(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__started_but_aborted", 0);
+/* … */
+  /* function exit code */
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0366:         return (not self.__never_started_or_killed() # we have been started or killed
+
  __pyx_t_2 = ((!(((struct __pyx_vtabstruct_6gevent_9_greenlet_Greenlet *)__pyx_v_self->__pyx_vtab)->__pyx___never_started_or_killed(__pyx_v_self) != 0)) != 0);
+  if (__pyx_t_2) {
+  } else {
+    __pyx_t_1 = __pyx_t_2;
+    goto __pyx_L3_bool_binop_done;
+  }
+
+0367:                 and not self.__start_cancelled_by_kill() # we weren't killed, so we must have been started
+
  __pyx_t_2 = ((!(((struct __pyx_vtabstruct_6gevent_9_greenlet_Greenlet *)__pyx_v_self->__pyx_vtab)->__pyx___start_cancelled_by_kill(__pyx_v_self) != 0)) != 0);
+  if (__pyx_t_2) {
+  } else {
+    __pyx_t_1 = __pyx_t_2;
+    goto __pyx_L3_bool_binop_done;
+  }
+
+0368:                 and not self.__start_completed() # the start never completed
+
  __pyx_t_2 = ((!(((struct __pyx_vtabstruct_6gevent_9_greenlet_Greenlet *)__pyx_v_self->__pyx_vtab)->__pyx___start_completed(__pyx_v_self) != 0)) != 0);
+  if (__pyx_t_2) {
+  } else {
+    __pyx_t_1 = __pyx_t_2;
+    goto __pyx_L3_bool_binop_done;
+  }
+
+0369:                 and not self.__start_pending()) # and we're not pending, so we must have been aborted
+
  __pyx_t_2 = ((!(((struct __pyx_vtabstruct_6gevent_9_greenlet_Greenlet *)__pyx_v_self->__pyx_vtab)->__pyx___start_pending(__pyx_v_self) != 0)) != 0);
+  __pyx_t_1 = __pyx_t_2;
+  __pyx_L3_bool_binop_done:;
+  __pyx_r = __pyx_t_1;
+  goto __pyx_L0;
+
 0370: 
+
+0371:     def __cancel_start(self):
+
static PyObject *__pyx_f_6gevent_9_greenlet_8Greenlet___cancel_start(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__cancel_start", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_AddTraceback("gevent._greenlet.Greenlet.__cancel_start", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0372:         if self._start_event is None:
+
  __pyx_t_1 = (__pyx_v_self->_start_event == Py_None);
+  __pyx_t_2 = (__pyx_t_1 != 0);
+  if (__pyx_t_2) {
+/* … */
+  }
+
 0373:             # prevent self from ever being started in the future
+
+0374:             self._start_event = _cancelled_start_event
+
    __Pyx_INCREF(((PyObject *)__pyx_v_6gevent_9_greenlet__cancelled_start_event));
+    __Pyx_GIVEREF(((PyObject *)__pyx_v_6gevent_9_greenlet__cancelled_start_event));
+    __Pyx_GOTREF(__pyx_v_self->_start_event);
+    __Pyx_DECREF(__pyx_v_self->_start_event);
+    __pyx_v_self->_start_event = ((PyObject *)__pyx_v_6gevent_9_greenlet__cancelled_start_event);
+
 0375:         # cancel any pending start event
+
 0376:         # NOTE: If this was a real pending start event, this will leave a
+
 0377:         # "dangling" callback/timer object in the hub.loop.callbacks list;
+
 0378:         # depending on where we are in the event loop, it may even be in a local
+
 0379:         # variable copy of that list (in _run_callbacks). This isn't a problem,
+
 0380:         # except for the leak-tests.
+
+0381:         self._start_event.stop()
+
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_start_event, __pyx_n_s_stop); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 381, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_4);
+  __pyx_t_5 = NULL;
+  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
+    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
+    if (likely(__pyx_t_5)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
+      __Pyx_INCREF(__pyx_t_5);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_4, function);
+    }
+  }
+  __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 381, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+
+0382:         self._start_event.close()
+
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_start_event, __pyx_n_s_close); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 382, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_4);
+  __pyx_t_5 = NULL;
+  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
+    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
+    if (likely(__pyx_t_5)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
+      __Pyx_INCREF(__pyx_t_5);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_4, function);
+    }
+  }
+  __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 382, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+
 0383: 
+
+0384:     def __handle_death_before_start(self, args):
+
static PyObject *__pyx_f_6gevent_9_greenlet_8Greenlet___handle_death_before_start(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self, PyObject *__pyx_v_args) {
+  PyObject *__pyx_v_arg = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__handle_death_before_start", 0);
+  __Pyx_INCREF(__pyx_v_args);
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_6);
+  __Pyx_XDECREF(__pyx_t_7);
+  __Pyx_AddTraceback("gevent._greenlet.Greenlet.__handle_death_before_start", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_arg);
+  __Pyx_XDECREF(__pyx_v_args);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
 0385:         # args is (t, v, tb) or simply t or v
+
+0386:         if self._exc_info is None and self.dead:
+
  __pyx_t_2 = (__pyx_v_self->_exc_info == ((PyObject*)Py_None));
+  __pyx_t_3 = (__pyx_t_2 != 0);
+  if (__pyx_t_3) {
+  } else {
+    __pyx_t_1 = __pyx_t_3;
+    goto __pyx_L4_bool_binop_done;
+  }
+  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_dead); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 386, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_4);
+  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 386, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __pyx_t_1 = __pyx_t_3;
+  __pyx_L4_bool_binop_done:;
+  if (__pyx_t_1) {
+/* … */
+  }
+
 0387:             # the greenlet was never switched to before and it will never be, _report_error was not called
+
 0388:             # the result was not set and the links weren't notified. let's do it here.
+
 0389:             # checking that self.dead is true is essential, because throw() does not necessarily kill the greenlet
+
 0390:             # (if the exception raised by throw() is caught somewhere inside the greenlet).
+
+0391:             if len(args) == 1:
+
    if (unlikely(__pyx_v_args == Py_None)) {
+      PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
+      __PYX_ERR(0, 391, __pyx_L1_error)
+    }
+    __pyx_t_5 = PyTuple_GET_SIZE(__pyx_v_args); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 391, __pyx_L1_error)
+    __pyx_t_1 = ((__pyx_t_5 == 1) != 0);
+    if (__pyx_t_1) {
+/* … */
+      goto __pyx_L6;
+    }
+
+0392:                 arg = args[0]
+
      if (unlikely(__pyx_v_args == Py_None)) {
+        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
+        __PYX_ERR(0, 392, __pyx_L1_error)
+      }
+      __pyx_t_4 = __Pyx_GetItemInt_Tuple(__pyx_v_args, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 392, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_4);
+      __pyx_v_arg = __pyx_t_4;
+      __pyx_t_4 = 0;
+
 0393:                 #if isinstance(arg, type):
+
+0394:                 if type(arg) is type(Exception):
+
      __pyx_t_1 = (((PyObject *)Py_TYPE(__pyx_v_arg)) == ((PyObject *)Py_TYPE(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])))));
+      __pyx_t_3 = (__pyx_t_1 != 0);
+      if (__pyx_t_3) {
+/* … */
+        goto __pyx_L7;
+      }
+
+0395:                     args = (arg, arg(), None)
+
        __Pyx_INCREF(__pyx_v_arg);
+        __pyx_t_6 = __pyx_v_arg; __pyx_t_7 = NULL;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
+          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
+          if (likely(__pyx_t_7)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
+            __Pyx_INCREF(__pyx_t_7);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_6, function);
+          }
+        }
+        __pyx_t_4 = (__pyx_t_7) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7) : __Pyx_PyObject_CallNoArg(__pyx_t_6);
+        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+        if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 395, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_4);
+        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+        __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 395, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_6);
+        __Pyx_INCREF(__pyx_v_arg);
+        __Pyx_GIVEREF(__pyx_v_arg);
+        PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_arg);
+        __Pyx_GIVEREF(__pyx_t_4);
+        PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_4);
+        __Pyx_INCREF(Py_None);
+        __Pyx_GIVEREF(Py_None);
+        PyTuple_SET_ITEM(__pyx_t_6, 2, Py_None);
+        __pyx_t_4 = 0;
+        __Pyx_DECREF_SET(__pyx_v_args, ((PyObject*)__pyx_t_6));
+        __pyx_t_6 = 0;
+
 0396:                 else:
+
+0397:                     args = (type(arg), arg, None)
+
      /*else*/ {
+        __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 397, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_6);
+        __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_arg)));
+        __Pyx_GIVEREF(((PyObject *)Py_TYPE(__pyx_v_arg)));
+        PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)Py_TYPE(__pyx_v_arg)));
+        __Pyx_INCREF(__pyx_v_arg);
+        __Pyx_GIVEREF(__pyx_v_arg);
+        PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_arg);
+        __Pyx_INCREF(Py_None);
+        __Pyx_GIVEREF(Py_None);
+        PyTuple_SET_ITEM(__pyx_t_6, 2, Py_None);
+        __Pyx_DECREF_SET(__pyx_v_args, ((PyObject*)__pyx_t_6));
+        __pyx_t_6 = 0;
+      }
+      __pyx_L7:;
+
+0398:             elif not args:
+
    __pyx_t_3 = (__pyx_v_args != Py_None)&&(PyTuple_GET_SIZE(__pyx_v_args) != 0);
+    __pyx_t_1 = ((!__pyx_t_3) != 0);
+    if (__pyx_t_1) {
+/* … */
+    }
+    __pyx_L6:;
+
+0399:                 args = (GreenletExit, GreenletExit(), None)
+
      __Pyx_INCREF(__pyx_v_6gevent_9_greenlet_GreenletExit);
+      __pyx_t_4 = __pyx_v_6gevent_9_greenlet_GreenletExit; __pyx_t_7 = NULL;
+      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
+        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4);
+        if (likely(__pyx_t_7)) {
+          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
+          __Pyx_INCREF(__pyx_t_7);
+          __Pyx_INCREF(function);
+          __Pyx_DECREF_SET(__pyx_t_4, function);
+        }
+      }
+      __pyx_t_6 = (__pyx_t_7) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_7) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
+      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+      if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 399, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_6);
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 399, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_4);
+      __Pyx_INCREF(__pyx_v_6gevent_9_greenlet_GreenletExit);
+      __Pyx_GIVEREF(__pyx_v_6gevent_9_greenlet_GreenletExit);
+      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_6gevent_9_greenlet_GreenletExit);
+      __Pyx_GIVEREF(__pyx_t_6);
+      PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_6);
+      __Pyx_INCREF(Py_None);
+      __Pyx_GIVEREF(Py_None);
+      PyTuple_SET_ITEM(__pyx_t_4, 2, Py_None);
+      __pyx_t_6 = 0;
+      __Pyx_DECREF_SET(__pyx_v_args, ((PyObject*)__pyx_t_4));
+      __pyx_t_4 = 0;
+
+0400:             self._report_error(args)
+
    __pyx_t_4 = ((struct __pyx_vtabstruct_6gevent_9_greenlet_Greenlet *)__pyx_v_self->__pyx_vtab)->_report_error(__pyx_v_self, __pyx_v_args); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 400, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+
 0401: 
+
 0402:     @property
+
+0403:     def started(self):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_7started_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_7started_1__get__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_9_greenlet_8Greenlet_7started___get__(((struct __pyx_obj_6gevent_9_greenlet_Greenlet *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_7started___get__(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_AddTraceback("gevent._greenlet.Greenlet.started.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
 0404:         # DEPRECATED
+
+0405:         return bool(self)
+
  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_self)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 405, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyBool_FromLong((!(!__pyx_t_1))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 405, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_r = __pyx_t_2;
+  __pyx_t_2 = 0;
+  goto __pyx_L0;
+
 0406: 
+
+0407:     def ready(self):
+
static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_11ready(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static int __pyx_f_6gevent_9_greenlet_8Greenlet_ready(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self, int __pyx_skip_dispatch) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("ready", 0);
+  /* Check if called by wrapper */
+  if (unlikely(__pyx_skip_dispatch)) ;
+  /* Check if overridden in Python */
+  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
+    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
+    if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
+    else {
+      PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      #endif
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_ready); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 407, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_9_greenlet_8Greenlet_11ready)) {
+        __Pyx_INCREF(__pyx_t_1);
+        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+          if (likely(__pyx_t_4)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+            __Pyx_INCREF(__pyx_t_4);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_3, function);
+          }
+        }
+        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
+        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 407, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 407, __pyx_L1_error)
+        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+        __pyx_r = __pyx_t_5;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        goto __pyx_L0;
+      }
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+      tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
+      if (unlikely(type_dict_guard != tp_dict_version)) {
+        tp_dict_version = obj_dict_version = 0;
+      }
+      #endif
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    }
+    #endif
+  }
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_WriteUnraisable("gevent._greenlet.Greenlet.ready", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_11ready(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6gevent_9_greenlet_8Greenlet_10ready[] = "Greenlet.ready(self) -> bool\n\n        Return a true value if and only if the greenlet has finished\n        execution.\n\n        .. versionchanged:: 1.1\n            This function is only guaranteed to return true or false *values*, not\n            necessarily the literal constants ``True`` or ``False``.\n        ";
+static PyMethodDef __pyx_mdef_6gevent_9_greenlet_8Greenlet_11ready = {"ready", (PyCFunction)__pyx_pw_6gevent_9_greenlet_8Greenlet_11ready, METH_NOARGS, __pyx_doc_6gevent_9_greenlet_8Greenlet_10ready};
+static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_11ready(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("ready (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_9_greenlet_8Greenlet_10ready(((struct __pyx_obj_6gevent_9_greenlet_Greenlet *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_10ready(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("ready", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_f_6gevent_9_greenlet_8Greenlet_ready(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 407, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent._greenlet.Greenlet.ready", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__29 = PyTuple_Pack(1, __pyx_n_s_self_2); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(0, 407, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__29);
+  __Pyx_GIVEREF(__pyx_tuple__29);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_9_greenlet_8Greenlet_11ready, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Greenlet_ready, NULL, __pyx_n_s_gevent__greenlet, __pyx_d, ((PyObject *)__pyx_codeobj__30)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 407, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet->tp_dict, __pyx_n_s_ready, __pyx_t_2) < 0) __PYX_ERR(0, 407, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_9_greenlet_Greenlet);
+  __pyx_codeobj__30 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__29, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_greenlet_py, __pyx_n_s_ready, 407, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__30)) __PYX_ERR(0, 407, __pyx_L1_error)
+
 0408:         """
+
 0409:         Return a true value if and only if the greenlet has finished
+
 0410:         execution.
+
 0411: 
+
 0412:         .. versionchanged:: 1.1
+
 0413:             This function is only guaranteed to return true or false *values*, not
+
 0414:             necessarily the literal constants ``True`` or ``False``.
+
 0415:         """
+
+0416:         return self.dead or self._exc_info is not None
+
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_dead); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 416, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 416, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  if (!__pyx_t_6) {
+  } else {
+    __pyx_t_5 = __pyx_t_6;
+    goto __pyx_L3_bool_binop_done;
+  }
+  __pyx_t_6 = (__pyx_v_self->_exc_info != ((PyObject*)Py_None));
+  __pyx_t_7 = (__pyx_t_6 != 0);
+  __pyx_t_5 = __pyx_t_7;
+  __pyx_L3_bool_binop_done:;
+  __pyx_r = __pyx_t_5;
+  goto __pyx_L0;
+
 0417: 
+
+0418:     def successful(self):
+
static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_13successful(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static int __pyx_f_6gevent_9_greenlet_8Greenlet_successful(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self, int __pyx_skip_dispatch) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("successful", 0);
+  /* Check if called by wrapper */
+  if (unlikely(__pyx_skip_dispatch)) ;
+  /* Check if overridden in Python */
+  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
+    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
+    if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
+    else {
+      PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      #endif
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_successful); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 418, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_9_greenlet_8Greenlet_13successful)) {
+        __Pyx_INCREF(__pyx_t_1);
+        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+          if (likely(__pyx_t_4)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+            __Pyx_INCREF(__pyx_t_4);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_3, function);
+          }
+        }
+        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
+        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 418, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 418, __pyx_L1_error)
+        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+        __pyx_r = __pyx_t_5;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        goto __pyx_L0;
+      }
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+      tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
+      if (unlikely(type_dict_guard != tp_dict_version)) {
+        tp_dict_version = obj_dict_version = 0;
+      }
+      #endif
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    }
+    #endif
+  }
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_WriteUnraisable("gevent._greenlet.Greenlet.successful", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_13successful(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6gevent_9_greenlet_8Greenlet_12successful[] = "Greenlet.successful(self) -> bool\n\n        Return a true value if and only if the greenlet has finished execution\n        successfully, that is, without raising an error.\n\n        .. tip:: A greenlet that has been killed with the default\n            :class:`GreenletExit` exception is considered successful.\n            That is, ``GreenletExit`` is not considered an error.\n\n        .. note:: This function is only guaranteed to return true or false *values*,\n              not necessarily the literal constants ``True`` or ``False``.\n        ";
+static PyMethodDef __pyx_mdef_6gevent_9_greenlet_8Greenlet_13successful = {"successful", (PyCFunction)__pyx_pw_6gevent_9_greenlet_8Greenlet_13successful, METH_NOARGS, __pyx_doc_6gevent_9_greenlet_8Greenlet_12successful};
+static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_13successful(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("successful (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_9_greenlet_8Greenlet_12successful(((struct __pyx_obj_6gevent_9_greenlet_Greenlet *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_12successful(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("successful", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_f_6gevent_9_greenlet_8Greenlet_successful(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 418, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent._greenlet.Greenlet.successful", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__31 = PyTuple_Pack(1, __pyx_n_s_self_2); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(0, 418, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__31);
+  __Pyx_GIVEREF(__pyx_tuple__31);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_9_greenlet_8Greenlet_13successful, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Greenlet_successful, NULL, __pyx_n_s_gevent__greenlet, __pyx_d, ((PyObject *)__pyx_codeobj__32)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 418, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet->tp_dict, __pyx_n_s_successful, __pyx_t_2) < 0) __PYX_ERR(0, 418, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_9_greenlet_Greenlet);
+  __pyx_codeobj__32 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__31, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_greenlet_py, __pyx_n_s_successful, 418, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__32)) __PYX_ERR(0, 418, __pyx_L1_error)
+
 0419:         """
+
 0420:         Return a true value if and only if the greenlet has finished execution
+
 0421:         successfully, that is, without raising an error.
+
 0422: 
+
 0423:         .. tip:: A greenlet that has been killed with the default
+
 0424:             :class:`GreenletExit` exception is considered successful.
+
 0425:             That is, ``GreenletExit`` is not considered an error.
+
 0426: 
+
 0427:         .. note:: This function is only guaranteed to return true or false *values*,
+
 0428:               not necessarily the literal constants ``True`` or ``False``.
+
 0429:         """
+
+0430:         return self._exc_info is not None and self._exc_info[1] is None
+
  __pyx_t_6 = (__pyx_v_self->_exc_info != ((PyObject*)Py_None));
+  __pyx_t_7 = (__pyx_t_6 != 0);
+  if (__pyx_t_7) {
+  } else {
+    __pyx_t_5 = __pyx_t_7;
+    goto __pyx_L3_bool_binop_done;
+  }
+  if (unlikely(__pyx_v_self->_exc_info == Py_None)) {
+    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
+    __PYX_ERR(0, 430, __pyx_L1_error)
+  }
+  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v_self->_exc_info, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 430, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_7 = (__pyx_t_1 == Py_None);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_6 = (__pyx_t_7 != 0);
+  __pyx_t_5 = __pyx_t_6;
+  __pyx_L3_bool_binop_done:;
+  __pyx_r = __pyx_t_5;
+  goto __pyx_L0;
+
 0431: 
+
+0432:     def __repr__(self):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_15__repr__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_15__repr__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_9_greenlet_8Greenlet_14__repr__(((struct __pyx_obj_6gevent_9_greenlet_Greenlet *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_14__repr__(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self) {
+  PyObject *__pyx_v_classname = NULL;
+  PyObject *__pyx_v_name = NULL;
+  PyObject *__pyx_v_result = NULL;
+  PyObject *__pyx_v_formatted = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__repr__", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_AddTraceback("gevent._greenlet.Greenlet.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_classname);
+  __Pyx_XDECREF(__pyx_v_name);
+  __Pyx_XDECREF(__pyx_v_result);
+  __Pyx_XDECREF(__pyx_v_formatted);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0433:         classname = self.__class__.__name__
+
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 433, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 433, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_v_classname = __pyx_t_2;
+  __pyx_t_2 = 0;
+
 0434:         # If no name has been assigned, don't generate one, including a minimal_ident,
+
 0435:         # if not necessary. This reduces the use of weak references and associated
+
 0436:         # overhead.
+
+0437:         if 'name' not in self.__dict__ and self._ident is None:
+
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_dict); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 437, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_4 = (__Pyx_PySequence_ContainsTF(__pyx_n_s_name_2, __pyx_t_2, Py_NE)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 437, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_5 = (__pyx_t_4 != 0);
+  if (__pyx_t_5) {
+  } else {
+    __pyx_t_3 = __pyx_t_5;
+    goto __pyx_L4_bool_binop_done;
+  }
+  __pyx_t_5 = (__pyx_v_self->_ident == Py_None);
+  __pyx_t_4 = (__pyx_t_5 != 0);
+  __pyx_t_3 = __pyx_t_4;
+  __pyx_L4_bool_binop_done:;
+  if (__pyx_t_3) {
+/* … */
+    goto __pyx_L3;
+  }
+
+0438:             name = ' '
+
    __Pyx_INCREF(__pyx_kp_s__2);
+    __pyx_v_name = __pyx_kp_s__2;
+
 0439:         else:
+
+0440:             name = ' "%s" ' % (self.name,)
+
  /*else*/ {
+    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_name_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 440, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 440, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_GIVEREF(__pyx_t_2);
+    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
+    __pyx_t_2 = 0;
+    __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_s, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 440, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __pyx_v_name = __pyx_t_2;
+    __pyx_t_2 = 0;
+  }
+  __pyx_L3:;
+
+0441:         result = '<%s%sat %s' % (classname, name, hex(id(self)))
+
  __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 441, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_hex, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 441, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 441, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(__pyx_v_classname);
+  __Pyx_GIVEREF(__pyx_v_classname);
+  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_classname);
+  __Pyx_INCREF(__pyx_v_name);
+  __Pyx_GIVEREF(__pyx_v_name);
+  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_name);
+  __Pyx_GIVEREF(__pyx_t_1);
+  PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_1);
+  __pyx_t_1 = 0;
+  __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_s_sat_s, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 441, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_v_result = ((PyObject*)__pyx_t_1);
+  __pyx_t_1 = 0;
+
+0442:         formatted = self._formatinfo()
+
  __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_9_greenlet_Greenlet *)__pyx_v_self->__pyx_vtab)->_formatinfo(__pyx_v_self, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 442, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_v_formatted = ((PyObject*)__pyx_t_1);
+  __pyx_t_1 = 0;
+
+0443:         if formatted:
+
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_formatted); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 443, __pyx_L1_error)
+  if (__pyx_t_3) {
+/* … */
+  }
+
+0444:             result += ': ' + formatted
+
    __pyx_t_1 = PyNumber_Add(__pyx_kp_s__3, __pyx_v_formatted); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 444, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 444, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_2));
+    __pyx_t_2 = 0;
+
+0445:         return result + '>'
+
  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_2 = PyNumber_Add(__pyx_v_result, __pyx_kp_s__4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 445, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_r = __pyx_t_2;
+  __pyx_t_2 = 0;
+  goto __pyx_L0;
+
 0446: 
+
 0447: 
+
+0448:     def _formatinfo(self):
+
static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_17_formatinfo(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyObject *__pyx_f_6gevent_9_greenlet_8Greenlet__formatinfo(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self, int __pyx_skip_dispatch) {
+  PyObject *__pyx_v_info = NULL;
+  PyObject *__pyx_v_func = NULL;
+  PyObject *__pyx_v_im_self = NULL;
+  PyObject *__pyx_v_funcname = NULL;
+  PyObject *__pyx_v_result = NULL;
+  PyObject *__pyx_v_args = NULL;
+  PyObject *__pyx_7genexpr__pyx_v_x = NULL;
+  PyObject *__pyx_8genexpr1__pyx_v_key = NULL;
+  PyObject *__pyx_8genexpr1__pyx_v_value = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_formatinfo", 0);
+  /* Check if called by wrapper */
+  if (unlikely(__pyx_skip_dispatch)) ;
+  /* Check if overridden in Python */
+  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
+    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
+    if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
+    else {
+      PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      #endif
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_formatinfo); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 448, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_9_greenlet_8Greenlet_17_formatinfo)) {
+        __Pyx_XDECREF(__pyx_r);
+        __Pyx_INCREF(__pyx_t_1);
+        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+          if (likely(__pyx_t_4)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+            __Pyx_INCREF(__pyx_t_4);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_3, function);
+          }
+        }
+        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
+        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 448, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        if (!(likely(PyString_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(0, 448, __pyx_L1_error)
+        __pyx_r = ((PyObject*)__pyx_t_2);
+        __pyx_t_2 = 0;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        goto __pyx_L0;
+      }
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+      tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
+      if (unlikely(type_dict_guard != tp_dict_version)) {
+        tp_dict_version = obj_dict_version = 0;
+      }
+      #endif
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    }
+    #endif
+  }
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_AddTraceback("gevent._greenlet.Greenlet._formatinfo", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_info);
+  __Pyx_XDECREF(__pyx_v_func);
+  __Pyx_XDECREF(__pyx_v_im_self);
+  __Pyx_XDECREF(__pyx_v_funcname);
+  __Pyx_XDECREF(__pyx_v_result);
+  __Pyx_XDECREF(__pyx_v_args);
+  __Pyx_XDECREF(__pyx_7genexpr__pyx_v_x);
+  __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_key);
+  __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_value);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_17_formatinfo(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6gevent_9_greenlet_8Greenlet_16_formatinfo[] = "Greenlet._formatinfo(self) -> str";
+static PyMethodDef __pyx_mdef_6gevent_9_greenlet_8Greenlet_17_formatinfo = {"_formatinfo", (PyCFunction)__pyx_pw_6gevent_9_greenlet_8Greenlet_17_formatinfo, METH_NOARGS, __pyx_doc_6gevent_9_greenlet_8Greenlet_16_formatinfo};
+static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_17_formatinfo(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_formatinfo (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_9_greenlet_8Greenlet_16_formatinfo(((struct __pyx_obj_6gevent_9_greenlet_Greenlet *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_16_formatinfo(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_formatinfo", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __pyx_f_6gevent_9_greenlet_8Greenlet__formatinfo(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 448, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent._greenlet.Greenlet._formatinfo", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__33 = PyTuple_Pack(1, __pyx_n_s_self_2); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(0, 448, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__33);
+  __Pyx_GIVEREF(__pyx_tuple__33);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_9_greenlet_8Greenlet_17_formatinfo, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Greenlet__formatinfo, NULL, __pyx_n_s_gevent__greenlet, __pyx_d, ((PyObject *)__pyx_codeobj__34)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 448, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet->tp_dict, __pyx_n_s_formatinfo, __pyx_t_2) < 0) __PYX_ERR(0, 448, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_9_greenlet_Greenlet);
+  __pyx_codeobj__34 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__33, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_greenlet_py, __pyx_n_s_formatinfo, 448, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__34)) __PYX_ERR(0, 448, __pyx_L1_error)
+
+0449:         info = self._formatted_info
+
  __pyx_t_1 = __pyx_v_self->_formatted_info;
+  __Pyx_INCREF(__pyx_t_1);
+  __pyx_v_info = ((PyObject*)__pyx_t_1);
+  __pyx_t_1 = 0;
+
+0450:         if info is not None:
+
  __pyx_t_5 = (__pyx_v_info != ((PyObject*)Py_None));
+  __pyx_t_6 = (__pyx_t_5 != 0);
+  if (__pyx_t_6) {
+/* … */
+  }
+
+0451:             return info
+
    __Pyx_XDECREF(__pyx_r);
+    __Pyx_INCREF(__pyx_v_info);
+    __pyx_r = __pyx_v_info;
+    goto __pyx_L0;
+
 0452: 
+
 0453:         # Are we running an arbitrary function provided to the constructor,
+
 0454:         # or did a subclass override _run?
+
+0455:         func = self._run
+
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_run_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 455, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_v_func = __pyx_t_1;
+  __pyx_t_1 = 0;
+
+0456:         im_self = getattr(func, '__self__', None)
+
  __pyx_t_1 = __Pyx_GetAttr3(__pyx_v_func, __pyx_n_s_self, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 456, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_v_im_self = __pyx_t_1;
+  __pyx_t_1 = 0;
+
+0457:         if im_self is self:
+
  __pyx_t_6 = (__pyx_v_im_self == ((PyObject *)__pyx_v_self));
+  __pyx_t_5 = (__pyx_t_6 != 0);
+  if (__pyx_t_5) {
+/* … */
+    goto __pyx_L4;
+  }
+
+0458:             funcname = '_run'
+
    __Pyx_INCREF(__pyx_n_s_run_2);
+    __pyx_v_funcname = __pyx_n_s_run_2;
+
+0459:         elif im_self is not None:
+
  __pyx_t_5 = (__pyx_v_im_self != Py_None);
+  __pyx_t_6 = (__pyx_t_5 != 0);
+  if (__pyx_t_6) {
+/* … */
+    goto __pyx_L4;
+  }
+
+0460:             funcname = repr(func)
+
    __pyx_t_1 = PyObject_Repr(__pyx_v_func); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 460, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __pyx_v_funcname = __pyx_t_1;
+    __pyx_t_1 = 0;
+
 0461:         else:
+
+0462:             funcname = getattr(func, '__name__', '') or repr(func)
+
  /*else*/ {
+    __pyx_t_2 = __Pyx_GetAttr3(__pyx_v_func, __pyx_n_s_name, __pyx_kp_s__5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 462, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 462, __pyx_L1_error)
+    if (!__pyx_t_6) {
+      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    } else {
+      __Pyx_INCREF(__pyx_t_2);
+      __pyx_t_1 = __pyx_t_2;
+      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+      goto __pyx_L5_bool_binop_done;
+    }
+    __pyx_t_2 = PyObject_Repr(__pyx_v_func); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 462, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_INCREF(__pyx_t_2);
+    __pyx_t_1 = __pyx_t_2;
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __pyx_L5_bool_binop_done:;
+    __pyx_v_funcname = __pyx_t_1;
+    __pyx_t_1 = 0;
+  }
+  __pyx_L4:;
+
 0463: 
+
+0464:         result = funcname
+
  __Pyx_INCREF(__pyx_v_funcname);
+  __pyx_v_result = __pyx_v_funcname;
+
+0465:         args = []
+
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 465, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_v_args = ((PyObject*)__pyx_t_1);
+  __pyx_t_1 = 0;
+
+0466:         if self.args:
+
  __pyx_t_6 = (__pyx_v_self->args != Py_None)&&(PyTuple_GET_SIZE(__pyx_v_self->args) != 0);
+  if (__pyx_t_6) {
+/* … */
+  }
+
+0467:             args = [repr(x)[:50] for x in self.args]
+
    { /* enter inner scope */
+      __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 467, __pyx_L10_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      if (unlikely(__pyx_v_self->args == Py_None)) {
+        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
+        __PYX_ERR(0, 467, __pyx_L10_error)
+      }
+      __pyx_t_2 = __pyx_v_self->args; __Pyx_INCREF(__pyx_t_2); __pyx_t_7 = 0;
+      for (;;) {
+        if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
+        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+        __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_3); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 467, __pyx_L10_error)
+        #else
+        __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 467, __pyx_L10_error)
+        __Pyx_GOTREF(__pyx_t_3);
+        #endif
+        __Pyx_XDECREF_SET(__pyx_7genexpr__pyx_v_x, __pyx_t_3);
+        __pyx_t_3 = 0;
+        __pyx_t_3 = PyObject_Repr(__pyx_7genexpr__pyx_v_x); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 467, __pyx_L10_error)
+        __Pyx_GOTREF(__pyx_t_3);
+        if (unlikely(__pyx_t_3 == Py_None)) {
+          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
+          __PYX_ERR(0, 467, __pyx_L10_error)
+        }
+        __pyx_t_4 = PySequence_GetSlice(__pyx_t_3, 0, 50); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 467, __pyx_L10_error)
+        __Pyx_GOTREF(__pyx_t_4);
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_4))) __PYX_ERR(0, 467, __pyx_L10_error)
+        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      }
+      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+      __Pyx_XDECREF(__pyx_7genexpr__pyx_v_x); __pyx_7genexpr__pyx_v_x = 0;
+      goto __pyx_L13_exit_scope;
+      __pyx_L10_error:;
+      __Pyx_XDECREF(__pyx_7genexpr__pyx_v_x); __pyx_7genexpr__pyx_v_x = 0;
+      goto __pyx_L1_error;
+      __pyx_L13_exit_scope:;
+    } /* exit inner scope */
+    __Pyx_DECREF_SET(__pyx_v_args, ((PyObject*)__pyx_t_1));
+    __pyx_t_1 = 0;
+
+0468:         if self.kwargs:
+
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_self->kwargs); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 468, __pyx_L1_error)
+  if (__pyx_t_6) {
+/* … */
+  }
+
+0469:             args.extend(['%s=%s' % (key, repr(value)[:50]) for (key, value) in self.kwargs.items()])
+
    { /* enter inner scope */
+      __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 469, __pyx_L17_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      __pyx_t_7 = 0;
+      if (unlikely(__pyx_v_self->kwargs == Py_None)) {
+        PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items");
+        __PYX_ERR(0, 469, __pyx_L17_error)
+      }
+      __pyx_t_4 = __Pyx_dict_iterator(__pyx_v_self->kwargs, 1, __pyx_n_s_items, (&__pyx_t_8), (&__pyx_t_9)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 469, __pyx_L17_error)
+      __Pyx_GOTREF(__pyx_t_4);
+      __Pyx_XDECREF(__pyx_t_2);
+      __pyx_t_2 = __pyx_t_4;
+      __pyx_t_4 = 0;
+      while (1) {
+        __pyx_t_10 = __Pyx_dict_iter_next(__pyx_t_2, __pyx_t_8, &__pyx_t_7, &__pyx_t_4, &__pyx_t_3, NULL, __pyx_t_9);
+        if (unlikely(__pyx_t_10 == 0)) break;
+        if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 469, __pyx_L17_error)
+        __Pyx_GOTREF(__pyx_t_4);
+        __Pyx_GOTREF(__pyx_t_3);
+        __Pyx_XDECREF_SET(__pyx_8genexpr1__pyx_v_key, __pyx_t_4);
+        __pyx_t_4 = 0;
+        __Pyx_XDECREF_SET(__pyx_8genexpr1__pyx_v_value, __pyx_t_3);
+        __pyx_t_3 = 0;
+        __pyx_t_3 = PyObject_Repr(__pyx_8genexpr1__pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 469, __pyx_L17_error)
+        __Pyx_GOTREF(__pyx_t_3);
+        if (unlikely(__pyx_t_3 == Py_None)) {
+          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
+          __PYX_ERR(0, 469, __pyx_L17_error)
+        }
+        __pyx_t_4 = PySequence_GetSlice(__pyx_t_3, 0, 50); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 469, __pyx_L17_error)
+        __Pyx_GOTREF(__pyx_t_4);
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 469, __pyx_L17_error)
+        __Pyx_GOTREF(__pyx_t_3);
+        __Pyx_INCREF(__pyx_8genexpr1__pyx_v_key);
+        __Pyx_GIVEREF(__pyx_8genexpr1__pyx_v_key);
+        PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_8genexpr1__pyx_v_key);
+        __Pyx_GIVEREF(__pyx_t_4);
+        PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_4);
+        __pyx_t_4 = 0;
+        __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_s_s, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 469, __pyx_L17_error)
+        __Pyx_GOTREF(__pyx_t_4);
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_4))) __PYX_ERR(0, 469, __pyx_L17_error)
+        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      }
+      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+      __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_key); __pyx_8genexpr1__pyx_v_key = 0;
+      __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_value); __pyx_8genexpr1__pyx_v_value = 0;
+      goto __pyx_L20_exit_scope;
+      __pyx_L17_error:;
+      __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_key); __pyx_8genexpr1__pyx_v_key = 0;
+      __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_value); __pyx_8genexpr1__pyx_v_value = 0;
+      goto __pyx_L1_error;
+      __pyx_L20_exit_scope:;
+    } /* exit inner scope */
+    __pyx_t_11 = __Pyx_PyList_Extend(__pyx_v_args, __pyx_t_1); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 469, __pyx_L1_error)
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+0470:         if args:
+
  __pyx_t_6 = (PyList_GET_SIZE(__pyx_v_args) != 0);
+  if (__pyx_t_6) {
+/* … */
+  }
+
+0471:             result += '(' + ', '.join(args) + ')'
+
    __pyx_t_1 = __Pyx_PyString_Join(__pyx_kp_s__7, __pyx_v_args); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 471, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __pyx_t_2 = PyNumber_Add(__pyx_kp_s__6, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 471, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __pyx_t_1 = PyNumber_Add(__pyx_t_2, __pyx_kp_s__8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 471, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 471, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_2);
+    __pyx_t_2 = 0;
+
 0472:         # it is important to save the result here, because once the greenlet exits '_run' attribute will be removed
+
+0473:         self._formatted_info = result
+
  if (!(likely(PyString_CheckExact(__pyx_v_result))||((__pyx_v_result) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_v_result)->tp_name), 0))) __PYX_ERR(0, 473, __pyx_L1_error)
+  __pyx_t_2 = __pyx_v_result;
+  __Pyx_INCREF(__pyx_t_2);
+  __Pyx_GIVEREF(__pyx_t_2);
+  __Pyx_GOTREF(__pyx_v_self->_formatted_info);
+  __Pyx_DECREF(__pyx_v_self->_formatted_info);
+  __pyx_v_self->_formatted_info = ((PyObject*)__pyx_t_2);
+  __pyx_t_2 = 0;
+
+0474:         return result
+
  __Pyx_XDECREF(__pyx_r);
+  if (!(likely(PyString_CheckExact(__pyx_v_result))||((__pyx_v_result) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_v_result)->tp_name), 0))) __PYX_ERR(0, 474, __pyx_L1_error)
+  __Pyx_INCREF(__pyx_v_result);
+  __pyx_r = ((PyObject*)__pyx_v_result);
+  goto __pyx_L0;
+
 0475: 
+
 0476:     @property
+
+0477:     def exception(self):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_9exception_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_9exception_1__get__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_9_greenlet_8Greenlet_9exception___get__(((struct __pyx_obj_6gevent_9_greenlet_Greenlet *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_9exception___get__(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_AddTraceback("gevent._greenlet.Greenlet.exception.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
 0478:         """
+
 0479:         Holds the exception instance raised by the function if the
+
 0480:         greenlet has finished with an error. Otherwise ``None``.
+
 0481:         """
+
+0482:         return self._exc_info[1] if self._exc_info is not None else None
+
  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_2 = (__pyx_v_self->_exc_info != ((PyObject*)Py_None));
+  if ((__pyx_t_2 != 0)) {
+    if (unlikely(__pyx_v_self->_exc_info == Py_None)) {
+      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
+      __PYX_ERR(0, 482, __pyx_L1_error)
+    }
+    __pyx_t_3 = __Pyx_GetItemInt_Tuple(__pyx_v_self->_exc_info, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 482, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __pyx_t_1 = __pyx_t_3;
+    __pyx_t_3 = 0;
+  } else {
+    __Pyx_INCREF(Py_None);
+    __pyx_t_1 = Py_None;
+  }
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
 0483: 
+
 0484:     @property
+
+0485:     def exc_info(self):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_8exc_info_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_8exc_info_1__get__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_9_greenlet_8Greenlet_8exc_info___get__(((struct __pyx_obj_6gevent_9_greenlet_Greenlet *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_8exc_info___get__(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self) {
+  PyObject *__pyx_v_ei = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_XDECREF(__pyx_t_6);
+  __Pyx_XDECREF(__pyx_t_7);
+  __Pyx_XDECREF(__pyx_t_8);
+  __Pyx_XDECREF(__pyx_t_9);
+  __Pyx_AddTraceback("gevent._greenlet.Greenlet.exc_info.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_ei);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
 0486:         """
+
 0487:         Holds the exc_info three-tuple raised by the function if the
+
 0488:         greenlet finished with an error. Otherwise a false value.
+
 0489: 
+
 0490:         .. note:: This is a provisional API and may change.
+
 0491: 
+
 0492:         .. versionadded:: 1.1
+
 0493:         """
+
+0494:         ei = self._exc_info
+
  __pyx_t_1 = __pyx_v_self->_exc_info;
+  __Pyx_INCREF(__pyx_t_1);
+  __pyx_v_ei = ((PyObject*)__pyx_t_1);
+  __pyx_t_1 = 0;
+
+0495:         if ei is not None and ei[0] is not None:
+
  __pyx_t_3 = (__pyx_v_ei != ((PyObject*)Py_None));
+  __pyx_t_4 = (__pyx_t_3 != 0);
+  if (__pyx_t_4) {
+  } else {
+    __pyx_t_2 = __pyx_t_4;
+    goto __pyx_L4_bool_binop_done;
+  }
+  if (unlikely(__pyx_v_ei == Py_None)) {
+    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
+    __PYX_ERR(0, 495, __pyx_L1_error)
+  }
+  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v_ei, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 495, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_4 = (__pyx_t_1 != Py_None);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_3 = (__pyx_t_4 != 0);
+  __pyx_t_2 = __pyx_t_3;
+  __pyx_L4_bool_binop_done:;
+  if (__pyx_t_2) {
+/* … */
+  }
+
+0496:             return (ei[0], ei[1], load_traceback(ei[2]))
+
    __Pyx_XDECREF(__pyx_r);
+    if (unlikely(__pyx_v_ei == Py_None)) {
+      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
+      __PYX_ERR(0, 496, __pyx_L1_error)
+    }
+    __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v_ei, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 496, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    if (unlikely(__pyx_v_ei == Py_None)) {
+      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
+      __PYX_ERR(0, 496, __pyx_L1_error)
+    }
+    __pyx_t_5 = __Pyx_GetItemInt_Tuple(__pyx_v_ei, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 496, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_5);
+    if (unlikely(__pyx_v_ei == Py_None)) {
+      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
+      __PYX_ERR(0, 496, __pyx_L1_error)
+    }
+    __pyx_t_7 = __Pyx_GetItemInt_Tuple(__pyx_v_ei, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 496, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_7);
+    __Pyx_INCREF(__pyx_v_6gevent_9_greenlet_load_traceback);
+    __pyx_t_8 = __pyx_v_6gevent_9_greenlet_load_traceback; __pyx_t_9 = NULL;
+    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
+      __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8);
+      if (likely(__pyx_t_9)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
+        __Pyx_INCREF(__pyx_t_9);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_8, function);
+      }
+    }
+    __pyx_t_6 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_9, __pyx_t_7) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_7);
+    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
+    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+    if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 496, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_6);
+    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+    __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 496, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_8);
+    __Pyx_GIVEREF(__pyx_t_1);
+    PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_1);
+    __Pyx_GIVEREF(__pyx_t_5);
+    PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_5);
+    __Pyx_GIVEREF(__pyx_t_6);
+    PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_6);
+    __pyx_t_1 = 0;
+    __pyx_t_5 = 0;
+    __pyx_t_6 = 0;
+    __pyx_r = __pyx_t_8;
+    __pyx_t_8 = 0;
+    goto __pyx_L0;
+
 0497: 
+
+0498:     def throw(self, *args):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_19throw(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_6gevent_9_greenlet_8Greenlet_18throw[] = "Greenlet.throw(self, *args)\nImmediately switch into the greenlet and raise an exception in it.\n\n        Should only be called from the HUB, otherwise the current greenlet is left unscheduled forever.\n        To raise an exception in a safe manner from any greenlet, use :meth:`kill`.\n\n        If a greenlet was started but never switched to yet, then also\n        a) cancel the event that will start it\n        b) fire the notifications as if an exception was raised in a greenlet\n        ";
+static PyMethodDef __pyx_mdef_6gevent_9_greenlet_8Greenlet_19throw = {"throw", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_9_greenlet_8Greenlet_19throw, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_9_greenlet_8Greenlet_18throw};
+static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_19throw(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_args = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("throw (wrapper)", 0);
+  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "throw", 0))) return NULL;
+  __Pyx_INCREF(__pyx_args);
+  __pyx_v_args = __pyx_args;
+  __pyx_r = __pyx_pf_6gevent_9_greenlet_8Greenlet_18throw(((struct __pyx_obj_6gevent_9_greenlet_Greenlet *)__pyx_v_self), __pyx_v_args);
+
+  /* function exit code */
+  __Pyx_XDECREF(__pyx_v_args);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_18throw(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self, PyObject *__pyx_v_args) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("throw", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_AddTraceback("gevent._greenlet.Greenlet.throw", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__35 = PyTuple_Pack(2, __pyx_n_s_self_2, __pyx_n_s_args); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(0, 498, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__35);
+  __Pyx_GIVEREF(__pyx_tuple__35);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_9_greenlet_8Greenlet_19throw, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Greenlet_throw, NULL, __pyx_n_s_gevent__greenlet, __pyx_d, ((PyObject *)__pyx_codeobj__36)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 498, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet->tp_dict, __pyx_n_s_throw, __pyx_t_2) < 0) __PYX_ERR(0, 498, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_9_greenlet_Greenlet);
+  __pyx_codeobj__36 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__35, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_greenlet_py, __pyx_n_s_throw, 498, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__36)) __PYX_ERR(0, 498, __pyx_L1_error)
+
 0499:         """Immediately switch into the greenlet and raise an exception in it.
+
 0500: 
+
 0501:         Should only be called from the HUB, otherwise the current greenlet is left unscheduled forever.
+
 0502:         To raise an exception in a safe manner from any greenlet, use :meth:`kill`.
+
 0503: 
+
 0504:         If a greenlet was started but never switched to yet, then also
+
 0505:         a) cancel the event that will start it
+
 0506:         b) fire the notifications as if an exception was raised in a greenlet
+
 0507:         """
+
+0508:         self.__cancel_start()
+
  __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_9_greenlet_Greenlet *)__pyx_v_self->__pyx_vtab)->__pyx___cancel_start(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 508, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 0509: 
+
+0510:         try:
+
  /*try:*/ {
+
+0511:             if not self.dead:
+
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_dead); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 511, __pyx_L4_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 511, __pyx_L4_error)
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __pyx_t_3 = ((!__pyx_t_2) != 0);
+    if (__pyx_t_3) {
+/* … */
+    }
+  }
+
 0512:                 # Prevent switching into a greenlet *at all* if we had never
+
 0513:                 # started it. Usually this is the same thing that happens by throwing,
+
 0514:                 # but if this is done from the hub with nothing else running, prevents a
+
 0515:                 # LoopExit.
+
+0516:                 greenlet.throw(self, *args)
+
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_6gevent_9_greenlet_greenlet), __pyx_n_s_throw); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 516, __pyx_L4_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 516, __pyx_L4_error)
+      __Pyx_GOTREF(__pyx_t_4);
+      __Pyx_INCREF(((PyObject *)__pyx_v_self));
+      __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
+      PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_self));
+      __pyx_t_5 = PyNumber_Add(__pyx_t_4, __pyx_v_args); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 516, __pyx_L4_error)
+      __Pyx_GOTREF(__pyx_t_5);
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 516, __pyx_L4_error)
+      __Pyx_GOTREF(__pyx_t_4);
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+
 0517:         finally:
+
+0518:             self.__handle_death_before_start(args)
+
  /*finally:*/ {
+    /*normal exit:*/{
+      __pyx_t_4 = ((struct __pyx_vtabstruct_6gevent_9_greenlet_Greenlet *)__pyx_v_self->__pyx_vtab)->__pyx___handle_death_before_start(__pyx_v_self, __pyx_v_args); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 518, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_4);
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      goto __pyx_L5;
+    }
+    __pyx_L4_error:;
+    /*exception exit:*/{
+      __Pyx_PyThreadState_declare
+      __Pyx_PyThreadState_assign
+      __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0;
+      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+      if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14);
+      if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11) < 0)) __Pyx_ErrFetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
+      __Pyx_XGOTREF(__pyx_t_9);
+      __Pyx_XGOTREF(__pyx_t_10);
+      __Pyx_XGOTREF(__pyx_t_11);
+      __Pyx_XGOTREF(__pyx_t_12);
+      __Pyx_XGOTREF(__pyx_t_13);
+      __Pyx_XGOTREF(__pyx_t_14);
+      __pyx_t_6 = __pyx_lineno; __pyx_t_7 = __pyx_clineno; __pyx_t_8 = __pyx_filename;
+      {
+        __pyx_t_4 = ((struct __pyx_vtabstruct_6gevent_9_greenlet_Greenlet *)__pyx_v_self->__pyx_vtab)->__pyx___handle_death_before_start(__pyx_v_self, __pyx_v_args); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 518, __pyx_L8_error)
+        __Pyx_GOTREF(__pyx_t_4);
+        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      }
+      if (PY_MAJOR_VERSION >= 3) {
+        __Pyx_XGIVEREF(__pyx_t_12);
+        __Pyx_XGIVEREF(__pyx_t_13);
+        __Pyx_XGIVEREF(__pyx_t_14);
+        __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14);
+      }
+      __Pyx_XGIVEREF(__pyx_t_9);
+      __Pyx_XGIVEREF(__pyx_t_10);
+      __Pyx_XGIVEREF(__pyx_t_11);
+      __Pyx_ErrRestore(__pyx_t_9, __pyx_t_10, __pyx_t_11);
+      __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0;
+      __pyx_lineno = __pyx_t_6; __pyx_clineno = __pyx_t_7; __pyx_filename = __pyx_t_8;
+      goto __pyx_L1_error;
+      __pyx_L8_error:;
+      if (PY_MAJOR_VERSION >= 3) {
+        __Pyx_XGIVEREF(__pyx_t_12);
+        __Pyx_XGIVEREF(__pyx_t_13);
+        __Pyx_XGIVEREF(__pyx_t_14);
+        __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14);
+      }
+      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
+      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
+      __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
+      __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0;
+      goto __pyx_L1_error;
+    }
+    __pyx_L5:;
+  }
+
 0519: 
+
+0520:     def start(self):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_21start(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6gevent_9_greenlet_8Greenlet_20start[] = "Greenlet.start(self)\nSchedule the greenlet to run in this loop iteration";
+static PyMethodDef __pyx_mdef_6gevent_9_greenlet_8Greenlet_21start = {"start", (PyCFunction)__pyx_pw_6gevent_9_greenlet_8Greenlet_21start, METH_NOARGS, __pyx_doc_6gevent_9_greenlet_8Greenlet_20start};
+static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_21start(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("start (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_9_greenlet_8Greenlet_20start(((struct __pyx_obj_6gevent_9_greenlet_Greenlet *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_20start(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("start", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_XDECREF(__pyx_t_6);
+  __Pyx_AddTraceback("gevent._greenlet.Greenlet.start", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__37 = PyTuple_Pack(1, __pyx_n_s_self_2); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(0, 520, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__37);
+  __Pyx_GIVEREF(__pyx_tuple__37);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_9_greenlet_8Greenlet_21start, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Greenlet_start, NULL, __pyx_n_s_gevent__greenlet, __pyx_d, ((PyObject *)__pyx_codeobj__38)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 520, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet->tp_dict, __pyx_n_s_start, __pyx_t_2) < 0) __PYX_ERR(0, 520, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_9_greenlet_Greenlet);
+  __pyx_codeobj__38 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__37, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_greenlet_py, __pyx_n_s_start, 520, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__38)) __PYX_ERR(0, 520, __pyx_L1_error)
+
 0521:         """Schedule the greenlet to run in this loop iteration"""
+
+0522:         if self._start_event is None:
+
  __pyx_t_1 = (__pyx_v_self->_start_event == Py_None);
+  __pyx_t_2 = (__pyx_t_1 != 0);
+  if (__pyx_t_2) {
+/* … */
+  }
+
+0523:             _call_spawn_callbacks(self)
+
    __pyx_f_6gevent_9_greenlet__call_spawn_callbacks(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 523, __pyx_L1_error)
+
+0524:             self._start_event = self.parent.loop.run_callback(self.switch)
+
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_parent); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 524, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_loop); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 524, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_5);
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_run_callback); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 524, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_switch); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 524, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_5);
+    __pyx_t_6 = NULL;
+    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
+      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
+      if (likely(__pyx_t_6)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
+        __Pyx_INCREF(__pyx_t_6);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_4, function);
+      }
+    }
+    __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_6, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5);
+    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 524, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __Pyx_GIVEREF(__pyx_t_3);
+    __Pyx_GOTREF(__pyx_v_self->_start_event);
+    __Pyx_DECREF(__pyx_v_self->_start_event);
+    __pyx_v_self->_start_event = __pyx_t_3;
+    __pyx_t_3 = 0;
+
 0525: 
+
+0526:     def start_later(self, seconds):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_23start_later(PyObject *__pyx_v_self, PyObject *__pyx_v_seconds); /*proto*/
+static char __pyx_doc_6gevent_9_greenlet_8Greenlet_22start_later[] = "Greenlet.start_later(self, seconds)\n\n        start_later(seconds) -> None\n\n        Schedule the greenlet to run in the future loop iteration\n        *seconds* later\n        ";
+static PyMethodDef __pyx_mdef_6gevent_9_greenlet_8Greenlet_23start_later = {"start_later", (PyCFunction)__pyx_pw_6gevent_9_greenlet_8Greenlet_23start_later, METH_O, __pyx_doc_6gevent_9_greenlet_8Greenlet_22start_later};
+static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_23start_later(PyObject *__pyx_v_self, PyObject *__pyx_v_seconds) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("start_later (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_9_greenlet_8Greenlet_22start_later(((struct __pyx_obj_6gevent_9_greenlet_Greenlet *)__pyx_v_self), ((PyObject *)__pyx_v_seconds));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_22start_later(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self, PyObject *__pyx_v_seconds) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("start_later", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_XDECREF(__pyx_t_6);
+  __Pyx_AddTraceback("gevent._greenlet.Greenlet.start_later", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__39 = PyTuple_Pack(2, __pyx_n_s_self_2, __pyx_n_s_seconds); if (unlikely(!__pyx_tuple__39)) __PYX_ERR(0, 526, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__39);
+  __Pyx_GIVEREF(__pyx_tuple__39);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_9_greenlet_8Greenlet_23start_later, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Greenlet_start_later, NULL, __pyx_n_s_gevent__greenlet, __pyx_d, ((PyObject *)__pyx_codeobj__40)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 526, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet->tp_dict, __pyx_n_s_start_later, __pyx_t_2) < 0) __PYX_ERR(0, 526, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_9_greenlet_Greenlet);
+  __pyx_codeobj__40 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__39, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_greenlet_py, __pyx_n_s_start_later, 526, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__40)) __PYX_ERR(0, 526, __pyx_L1_error)
+
 0527:         """
+
 0528:         start_later(seconds) -> None
+
 0529: 
+
 0530:         Schedule the greenlet to run in the future loop iteration
+
 0531:         *seconds* later
+
 0532:         """
+
+0533:         if self._start_event is None:
+
  __pyx_t_1 = (__pyx_v_self->_start_event == Py_None);
+  __pyx_t_2 = (__pyx_t_1 != 0);
+  if (__pyx_t_2) {
+/* … */
+  }
+
+0534:             _call_spawn_callbacks(self)
+
    __pyx_f_6gevent_9_greenlet__call_spawn_callbacks(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 534, __pyx_L1_error)
+
+0535:             self._start_event = self.parent.loop.timer(seconds)
+
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_parent); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 535, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_loop); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 535, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_5);
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_timer); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 535, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __pyx_t_5 = NULL;
+    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
+      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
+      if (likely(__pyx_t_5)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
+        __Pyx_INCREF(__pyx_t_5);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_4, function);
+      }
+    }
+    __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_v_seconds) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_seconds);
+    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 535, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __Pyx_GIVEREF(__pyx_t_3);
+    __Pyx_GOTREF(__pyx_v_self->_start_event);
+    __Pyx_DECREF(__pyx_v_self->_start_event);
+    __pyx_v_self->_start_event = __pyx_t_3;
+    __pyx_t_3 = 0;
+
+0536:             self._start_event.start(self.switch)
+
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_start_event, __pyx_n_s_start); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 536, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_switch); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 536, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_5);
+    __pyx_t_6 = NULL;
+    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
+      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
+      if (likely(__pyx_t_6)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
+        __Pyx_INCREF(__pyx_t_6);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_4, function);
+      }
+    }
+    __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_6, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5);
+    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 536, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+
 0537: 
+
+0538:     @staticmethod
+
  __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_staticmethod, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 538, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet->tp_dict, __pyx_n_s_add_spawn_callback, __pyx_t_1) < 0) __PYX_ERR(0, 539, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_9_greenlet_Greenlet);
+
+0539:     def add_spawn_callback(callback):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_25add_spawn_callback(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_6gevent_9_greenlet_8Greenlet_24add_spawn_callback[] = "Greenlet.add_spawn_callback(callback)\n\n        add_spawn_callback(callback) -> None\n\n        Set up a *callback* to be invoked when :class:`Greenlet` objects\n        are started.\n\n        The invocation order of spawn callbacks is unspecified.  Adding the\n        same callback more than one time will not cause it to be called more\n        than once.\n\n        .. versionadded:: 1.4.0\n        ";
+static PyMethodDef __pyx_mdef_6gevent_9_greenlet_8Greenlet_25add_spawn_callback = {"add_spawn_callback", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_9_greenlet_8Greenlet_25add_spawn_callback, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_9_greenlet_8Greenlet_24add_spawn_callback};
+static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_25add_spawn_callback(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_callback = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("add_spawn_callback (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_callback,0};
+    PyObject* values[1] = {0};
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_callback)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "add_spawn_callback") < 0)) __PYX_ERR(0, 539, __pyx_L3_error)
+      }
+    } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
+      goto __pyx_L5_argtuple_error;
+    } else {
+      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+    }
+    __pyx_v_callback = values[0];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("add_spawn_callback", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 539, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent._greenlet.Greenlet.add_spawn_callback", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_9_greenlet_8Greenlet_24add_spawn_callback(__pyx_v_callback);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_24add_spawn_callback(PyObject *__pyx_v_callback) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("add_spawn_callback", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_AddTraceback("gevent._greenlet.Greenlet.add_spawn_callback", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__41 = PyTuple_Pack(1, __pyx_n_s_callback); if (unlikely(!__pyx_tuple__41)) __PYX_ERR(0, 539, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__41);
+  __Pyx_GIVEREF(__pyx_tuple__41);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_9_greenlet_8Greenlet_25add_spawn_callback, __Pyx_CYFUNCTION_STATICMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Greenlet_add_spawn_callback, NULL, __pyx_n_s_gevent__greenlet, __pyx_d, ((PyObject *)__pyx_codeobj__42)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 539, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet->tp_dict, __pyx_n_s_add_spawn_callback, __pyx_t_2) < 0) __PYX_ERR(0, 539, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_9_greenlet_Greenlet);
+/* … */
+  __Pyx_GetNameInClass(__pyx_t_2, (PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet, __pyx_n_s_add_spawn_callback); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 539, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_codeobj__42 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__41, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_greenlet_py, __pyx_n_s_add_spawn_callback, 539, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__42)) __PYX_ERR(0, 539, __pyx_L1_error)
+
 0540:         """
+
 0541:         add_spawn_callback(callback) -> None
+
 0542: 
+
 0543:         Set up a *callback* to be invoked when :class:`Greenlet` objects
+
 0544:         are started.
+
 0545: 
+
 0546:         The invocation order of spawn callbacks is unspecified.  Adding the
+
 0547:         same callback more than one time will not cause it to be called more
+
 0548:         than once.
+
 0549: 
+
 0550:         .. versionadded:: 1.4.0
+
 0551:         """
+
 0552:         global _spawn_callbacks
+
+0553:         if _spawn_callbacks is None:  # pylint:disable=used-before-assignment
+
  __pyx_t_1 = (__pyx_v_6gevent_9_greenlet__spawn_callbacks == ((PyObject*)Py_None));
+  __pyx_t_2 = (__pyx_t_1 != 0);
+  if (__pyx_t_2) {
+/* … */
+  }
+
+0554:             _spawn_callbacks = set()
+
    __pyx_t_3 = PySet_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 554, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_XGOTREF(__pyx_v_6gevent_9_greenlet__spawn_callbacks);
+    __Pyx_DECREF_SET(__pyx_v_6gevent_9_greenlet__spawn_callbacks, ((PyObject*)__pyx_t_3));
+    __Pyx_GIVEREF(__pyx_t_3);
+    __pyx_t_3 = 0;
+
+0555:         _spawn_callbacks.add(callback)
+
  if (unlikely(__pyx_v_6gevent_9_greenlet__spawn_callbacks == Py_None)) {
+    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "add");
+    __PYX_ERR(0, 555, __pyx_L1_error)
+  }
+  __pyx_t_4 = PySet_Add(__pyx_v_6gevent_9_greenlet__spawn_callbacks, __pyx_v_callback); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 555, __pyx_L1_error)
+
 0556: 
+
+0557:     @staticmethod
+
  __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_staticmethod, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 557, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet->tp_dict, __pyx_n_s_remove_spawn_callback, __pyx_t_2) < 0) __PYX_ERR(0, 558, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_9_greenlet_Greenlet);
+
+0558:     def remove_spawn_callback(callback):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_27remove_spawn_callback(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_6gevent_9_greenlet_8Greenlet_26remove_spawn_callback[] = "Greenlet.remove_spawn_callback(callback)\n\n        remove_spawn_callback(callback) -> None\n\n        Remove *callback* function added with :meth:`Greenlet.add_spawn_callback`.\n        This function will not fail if *callback* has been already removed or\n        if *callback* was never added.\n\n        .. versionadded:: 1.4.0\n        ";
+static PyMethodDef __pyx_mdef_6gevent_9_greenlet_8Greenlet_27remove_spawn_callback = {"remove_spawn_callback", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_9_greenlet_8Greenlet_27remove_spawn_callback, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_9_greenlet_8Greenlet_26remove_spawn_callback};
+static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_27remove_spawn_callback(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_callback = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("remove_spawn_callback (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_callback,0};
+    PyObject* values[1] = {0};
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_callback)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "remove_spawn_callback") < 0)) __PYX_ERR(0, 558, __pyx_L3_error)
+      }
+    } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
+      goto __pyx_L5_argtuple_error;
+    } else {
+      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+    }
+    __pyx_v_callback = values[0];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("remove_spawn_callback", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 558, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent._greenlet.Greenlet.remove_spawn_callback", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_9_greenlet_8Greenlet_26remove_spawn_callback(__pyx_v_callback);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_26remove_spawn_callback(PyObject *__pyx_v_callback) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("remove_spawn_callback", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_AddTraceback("gevent._greenlet.Greenlet.remove_spawn_callback", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__43 = PyTuple_Pack(1, __pyx_n_s_callback); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(0, 558, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__43);
+  __Pyx_GIVEREF(__pyx_tuple__43);
+/* … */
+  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_9_greenlet_8Greenlet_27remove_spawn_callback, __Pyx_CYFUNCTION_STATICMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Greenlet_remove_spawn_callback, NULL, __pyx_n_s_gevent__greenlet, __pyx_d, ((PyObject *)__pyx_codeobj__44)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 558, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet->tp_dict, __pyx_n_s_remove_spawn_callback, __pyx_t_1) < 0) __PYX_ERR(0, 558, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_9_greenlet_Greenlet);
+/* … */
+  __Pyx_GetNameInClass(__pyx_t_1, (PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet, __pyx_n_s_remove_spawn_callback); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 558, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_codeobj__44 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__43, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_greenlet_py, __pyx_n_s_remove_spawn_callback, 558, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__44)) __PYX_ERR(0, 558, __pyx_L1_error)
+
 0559:         """
+
 0560:         remove_spawn_callback(callback) -> None
+
 0561: 
+
 0562:         Remove *callback* function added with :meth:`Greenlet.add_spawn_callback`.
+
 0563:         This function will not fail if *callback* has been already removed or
+
 0564:         if *callback* was never added.
+
 0565: 
+
 0566:         .. versionadded:: 1.4.0
+
 0567:         """
+
 0568:         global _spawn_callbacks
+
+0569:         if _spawn_callbacks is not None:
+
  __pyx_t_1 = (__pyx_v_6gevent_9_greenlet__spawn_callbacks != ((PyObject*)Py_None));
+  __pyx_t_2 = (__pyx_t_1 != 0);
+  if (__pyx_t_2) {
+/* … */
+  }
+
+0570:             _spawn_callbacks.discard(callback)
+
    if (unlikely(__pyx_v_6gevent_9_greenlet__spawn_callbacks == Py_None)) {
+      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "discard");
+      __PYX_ERR(0, 570, __pyx_L1_error)
+    }
+    __pyx_t_3 = __Pyx_PySet_Discard(__pyx_v_6gevent_9_greenlet__spawn_callbacks, __pyx_v_callback); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 570, __pyx_L1_error)
+
+0571:             if not _spawn_callbacks:
+
    __pyx_t_2 = (__pyx_v_6gevent_9_greenlet__spawn_callbacks != Py_None)&&(PySet_GET_SIZE(__pyx_v_6gevent_9_greenlet__spawn_callbacks) != 0);
+    __pyx_t_1 = ((!__pyx_t_2) != 0);
+    if (__pyx_t_1) {
+/* … */
+    }
+
+0572:                 _spawn_callbacks = None
+
      __Pyx_INCREF(Py_None);
+      __Pyx_XGOTREF(__pyx_v_6gevent_9_greenlet__spawn_callbacks);
+      __Pyx_DECREF_SET(__pyx_v_6gevent_9_greenlet__spawn_callbacks, ((PyObject*)Py_None));
+      __Pyx_GIVEREF(Py_None);
+
 0573: 
+
+0574:     @classmethod
+
  __pyx_t_1 = __Pyx_Method_ClassMethod(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 574, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet->tp_dict, __pyx_n_s_spawn, __pyx_t_1) < 0) __PYX_ERR(0, 575, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_9_greenlet_Greenlet);
+
+0575:     def spawn(cls, *args, **kwargs):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_29spawn(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_6gevent_9_greenlet_8Greenlet_28spawn[] = "Greenlet.spawn(type cls, *args, **kwargs)\n\n        spawn(function, *args, **kwargs) -> Greenlet\n\n        Create a new :class:`Greenlet` object and schedule it to run ``function(*args, **kwargs)``.\n        This can be used as ``gevent.spawn`` or ``Greenlet.spawn``.\n\n        The arguments are passed to :meth:`Greenlet.__init__`.\n\n        .. versionchanged:: 1.1b1\n            If a *function* is given that is not callable, immediately raise a :exc:`TypeError`\n            instead of spawning a greenlet that will raise an uncaught TypeError.\n        ";
+static PyMethodDef __pyx_mdef_6gevent_9_greenlet_8Greenlet_29spawn = {"spawn", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_9_greenlet_8Greenlet_29spawn, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_9_greenlet_8Greenlet_28spawn};
+static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_29spawn(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_args = 0;
+  PyObject *__pyx_v_kwargs = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("spawn (wrapper)", 0);
+  if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "spawn", 1))) return NULL;
+  if (unlikely(__pyx_kwds)) {
+    __pyx_v_kwargs = PyDict_Copy(__pyx_kwds); if (unlikely(!__pyx_v_kwargs)) return NULL;
+    __Pyx_GOTREF(__pyx_v_kwargs);
+  } else {
+    __pyx_v_kwargs = NULL;
+  }
+  __Pyx_INCREF(__pyx_args);
+  __pyx_v_args = __pyx_args;
+  __pyx_r = __pyx_pf_6gevent_9_greenlet_8Greenlet_28spawn(((PyTypeObject*)__pyx_v_cls), __pyx_v_args, __pyx_v_kwargs);
+
+  /* function exit code */
+  __Pyx_XDECREF(__pyx_v_args);
+  __Pyx_XDECREF(__pyx_v_kwargs);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_28spawn(PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) {
+  PyObject *__pyx_v_g = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("spawn", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_AddTraceback("gevent._greenlet.Greenlet.spawn", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_g);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__45 = PyTuple_Pack(4, __pyx_n_s_cls, __pyx_n_s_args, __pyx_n_s_kwargs, __pyx_n_s_g); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(0, 575, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__45);
+  __Pyx_GIVEREF(__pyx_tuple__45);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_9_greenlet_8Greenlet_29spawn, __Pyx_CYFUNCTION_CLASSMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Greenlet_spawn, NULL, __pyx_n_s_gevent__greenlet, __pyx_d, ((PyObject *)__pyx_codeobj__46)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 575, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet->tp_dict, __pyx_n_s_spawn, __pyx_t_2) < 0) __PYX_ERR(0, 575, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_9_greenlet_Greenlet);
+/* … */
+  __Pyx_GetNameInClass(__pyx_t_2, (PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet, __pyx_n_s_spawn); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 575, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_codeobj__46 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__45, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_greenlet_py, __pyx_n_s_spawn, 575, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__46)) __PYX_ERR(0, 575, __pyx_L1_error)
+
 0576:         """
+
 0577:         spawn(function, *args, **kwargs) -> Greenlet
+
 0578: 
+
 0579:         Create a new :class:`Greenlet` object and schedule it to run ``function(*args, **kwargs)``.
+
 0580:         This can be used as ``gevent.spawn`` or ``Greenlet.spawn``.
+
 0581: 
+
 0582:         The arguments are passed to :meth:`Greenlet.__init__`.
+
 0583: 
+
 0584:         .. versionchanged:: 1.1b1
+
 0585:             If a *function* is given that is not callable, immediately raise a :exc:`TypeError`
+
 0586:             instead of spawning a greenlet that will raise an uncaught TypeError.
+
 0587:         """
+
+0588:         g = cls(*args, **kwargs)
+
  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_v_cls), __pyx_v_args, __pyx_v_kwargs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 588, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_v_g = __pyx_t_1;
+  __pyx_t_1 = 0;
+
+0589:         g.start()
+
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_g, __pyx_n_s_start); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 589, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = NULL;
+  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+    if (likely(__pyx_t_3)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+      __Pyx_INCREF(__pyx_t_3);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_2, function);
+    }
+  }
+  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 589, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+0590:         return g
+
  __Pyx_XDECREF(__pyx_r);
+  __Pyx_INCREF(__pyx_v_g);
+  __pyx_r = __pyx_v_g;
+  goto __pyx_L0;
+
 0591: 
+
+0592:     @classmethod
+
  __pyx_t_2 = __Pyx_Method_ClassMethod(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 592, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet->tp_dict, __pyx_n_s_spawn_later, __pyx_t_2) < 0) __PYX_ERR(0, 593, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_9_greenlet_Greenlet);
+
+0593:     def spawn_later(cls, seconds, *args, **kwargs):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_31spawn_later(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_6gevent_9_greenlet_8Greenlet_30spawn_later[] = "Greenlet.spawn_later(type cls, seconds, *args, **kwargs)\n\n        spawn_later(seconds, function, *args, **kwargs) -> Greenlet\n\n        Create and return a new `Greenlet` object scheduled to run ``function(*args, **kwargs)``\n        in a future loop iteration *seconds* later. This can be used as ``Greenlet.spawn_later``\n        or ``gevent.spawn_later``.\n\n        The arguments are passed to :meth:`Greenlet.__init__`.\n\n        .. versionchanged:: 1.1b1\n           If an argument that's meant to be a function (the first argument in *args*, or the ``run`` keyword )\n           is given to this classmethod (and not a classmethod of a subclass),\n           it is verified to be callable. Previously, the spawned greenlet would have failed\n           when it started running.\n        ";
+static PyMethodDef __pyx_mdef_6gevent_9_greenlet_8Greenlet_31spawn_later = {"spawn_later", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_9_greenlet_8Greenlet_31spawn_later, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_9_greenlet_8Greenlet_30spawn_later};
+static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_31spawn_later(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_seconds = 0;
+  PyObject *__pyx_v_args = 0;
+  PyObject *__pyx_v_kwargs = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("spawn_later (wrapper)", 0);
+  __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL;
+  __Pyx_GOTREF(__pyx_v_kwargs);
+  if (PyTuple_GET_SIZE(__pyx_args) > 1) {
+    __pyx_v_args = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args));
+    if (unlikely(!__pyx_v_args)) {
+      __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
+      __Pyx_RefNannyFinishContext();
+      return NULL;
+    }
+    __Pyx_GOTREF(__pyx_v_args);
+  } else {
+    __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple);
+  }
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_seconds,0};
+    PyObject* values[1] = {0};
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        default:
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_seconds)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+      }
+      if (unlikely(kw_args > 0)) {
+        const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1;
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, used_pos_args, "spawn_later") < 0)) __PYX_ERR(0, 593, __pyx_L3_error)
+      }
+    } else if (PyTuple_GET_SIZE(__pyx_args) < 1) {
+      goto __pyx_L5_argtuple_error;
+    } else {
+      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+    }
+    __pyx_v_seconds = values[0];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("spawn_later", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 593, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0;
+  __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
+  __Pyx_AddTraceback("gevent._greenlet.Greenlet.spawn_later", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_9_greenlet_8Greenlet_30spawn_later(((PyTypeObject*)__pyx_v_cls), __pyx_v_seconds, __pyx_v_args, __pyx_v_kwargs);
+
+  /* function exit code */
+  __Pyx_XDECREF(__pyx_v_args);
+  __Pyx_XDECREF(__pyx_v_kwargs);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_30spawn_later(PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_seconds, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) {
+  PyObject *__pyx_v_g = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("spawn_later", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_XDECREF(__pyx_t_6);
+  __Pyx_AddTraceback("gevent._greenlet.Greenlet.spawn_later", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_g);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__47 = PyTuple_Pack(5, __pyx_n_s_cls, __pyx_n_s_seconds, __pyx_n_s_args, __pyx_n_s_kwargs, __pyx_n_s_g); if (unlikely(!__pyx_tuple__47)) __PYX_ERR(0, 593, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__47);
+  __Pyx_GIVEREF(__pyx_tuple__47);
+/* … */
+  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_9_greenlet_8Greenlet_31spawn_later, __Pyx_CYFUNCTION_CLASSMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Greenlet_spawn_later, NULL, __pyx_n_s_gevent__greenlet, __pyx_d, ((PyObject *)__pyx_codeobj__48)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 593, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet->tp_dict, __pyx_n_s_spawn_later, __pyx_t_1) < 0) __PYX_ERR(0, 593, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_9_greenlet_Greenlet);
+/* … */
+  __Pyx_GetNameInClass(__pyx_t_1, (PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet, __pyx_n_s_spawn_later); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 593, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_codeobj__48 = (PyObject*)__Pyx_PyCode_New(2, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__47, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_greenlet_py, __pyx_n_s_spawn_later, 593, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__48)) __PYX_ERR(0, 593, __pyx_L1_error)
+
 0594:         """
+
 0595:         spawn_later(seconds, function, *args, **kwargs) -> Greenlet
+
 0596: 
+
 0597:         Create and return a new `Greenlet` object scheduled to run ``function(*args, **kwargs)``
+
 0598:         in a future loop iteration *seconds* later. This can be used as ``Greenlet.spawn_later``
+
 0599:         or ``gevent.spawn_later``.
+
 0600: 
+
 0601:         The arguments are passed to :meth:`Greenlet.__init__`.
+
 0602: 
+
 0603:         .. versionchanged:: 1.1b1
+
 0604:            If an argument that's meant to be a function (the first argument in *args*, or the ``run`` keyword )
+
 0605:            is given to this classmethod (and not a classmethod of a subclass),
+
 0606:            it is verified to be callable. Previously, the spawned greenlet would have failed
+
 0607:            when it started running.
+
 0608:         """
+
+0609:         if cls is Greenlet and not args and 'run' not in kwargs:
+
  __pyx_t_2 = (__pyx_v_cls == __pyx_ptype_6gevent_9_greenlet_Greenlet);
+  __pyx_t_3 = (__pyx_t_2 != 0);
+  if (__pyx_t_3) {
+  } else {
+    __pyx_t_1 = __pyx_t_3;
+    goto __pyx_L4_bool_binop_done;
+  }
+  __pyx_t_3 = (PyTuple_GET_SIZE(__pyx_v_args) != 0);
+  __pyx_t_2 = ((!__pyx_t_3) != 0);
+  if (__pyx_t_2) {
+  } else {
+    __pyx_t_1 = __pyx_t_2;
+    goto __pyx_L4_bool_binop_done;
+  }
+  __pyx_t_2 = (__Pyx_PyDict_ContainsTF(__pyx_n_s_run, __pyx_v_kwargs, Py_NE)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 609, __pyx_L1_error)
+  __pyx_t_3 = (__pyx_t_2 != 0);
+  __pyx_t_1 = __pyx_t_3;
+  __pyx_L4_bool_binop_done:;
+  if (unlikely(__pyx_t_1)) {
+/* … */
+  }
+
+0610:             raise TypeError("")
+
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 610, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __PYX_ERR(0, 610, __pyx_L1_error)
+/* … */
+  __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_s__5); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 610, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__9);
+  __Pyx_GIVEREF(__pyx_tuple__9);
+
+0611:         g = cls(*args, **kwargs)
+
  __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_v_cls), __pyx_v_args, __pyx_v_kwargs); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 611, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_4);
+  __pyx_v_g = __pyx_t_4;
+  __pyx_t_4 = 0;
+
+0612:         g.start_later(seconds)
+
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_g, __pyx_n_s_start_later); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 612, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_5);
+  __pyx_t_6 = NULL;
+  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
+    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
+    if (likely(__pyx_t_6)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
+      __Pyx_INCREF(__pyx_t_6);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_5, function);
+    }
+  }
+  __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_v_seconds) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_seconds);
+  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 612, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_4);
+  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+
+0613:         return g
+
  __Pyx_XDECREF(__pyx_r);
+  __Pyx_INCREF(__pyx_v_g);
+  __pyx_r = __pyx_v_g;
+  goto __pyx_L0;
+
 0614: 
+
+0615:     def kill(self, exception=GreenletExit, block=True, timeout=None):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_33kill(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_6gevent_9_greenlet_8Greenlet_32kill[] = "Greenlet.kill(self, exception=GreenletExit, block=True, timeout=None)\n\n        Raise the ``exception`` in the greenlet.\n\n        If ``block`` is ``True`` (the default), wait until the greenlet dies or the optional timeout expires.\n        If block is ``False``, the current greenlet is not unscheduled.\n\n        The function always returns ``None`` and never raises an error.\n\n        .. note::\n\n            Depending on what this greenlet is executing and the state\n            of the event loop, the exception may or may not be raised\n            immediately when this greenlet resumes execution. It may\n            be raised on a subsequent green call, or, if this greenlet\n            exits before making such a call, it may not be raised at\n            all. As of 1.1, an example where the exception is raised\n            later is if this greenlet had called :func:`sleep(0)\n            <gevent.sleep>`; an example where the exception is raised\n            immediately is if this greenlet had called\n            :func:`sleep(0.1) <gevent.sleep>`.\n\n        .. caution::\n\n            Use care when killing greenlets. If the code executing is not\n            exception safe (e.g., makes proper use of ``finally``) then an\n            unexpected exception could result in corrupted state.\n\n        See also :func:`gevent.kill`.\n\n        :keyword type exception: The type of exception to raise in the greenlet. The default\n            is :class:`GreenletExit`, which indicates a :meth:`successful` completion\n            of the greenlet.\n\n        .. versionchanged:: 0.13.0\n            *block* is now ``True`` by default.\n        .. versionchanged:: 1.1a2\n            If this greenlet had never been switched to, killing it will prevent it from ever being switched to.\n        ";
+static PyMethodDef __pyx_mdef_6gevent_9_greenlet_8Greenlet_33kill = {"kill", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_9_greenlet_8Greenlet_33kill, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_9_greenlet_8Greenlet_32kill};
+static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_33kill(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_exception = 0;
+  PyObject *__pyx_v_block = 0;
+  PyObject *__pyx_v_timeout = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("kill (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_exception,&__pyx_n_s_block,&__pyx_n_s_timeout,0};
+    PyObject* values[3] = {0,0,0};
+    values[0] = __pyx_k__10;
+    values[1] = ((PyObject *)Py_True);
+    values[2] = ((PyObject *)Py_None);
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_exception);
+          if (value) { values[0] = value; kw_args--; }
+        }
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_block);
+          if (value) { values[1] = value; kw_args--; }
+        }
+        CYTHON_FALLTHROUGH;
+        case  2:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_timeout);
+          if (value) { values[2] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "kill") < 0)) __PYX_ERR(0, 615, __pyx_L3_error)
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    __pyx_v_exception = values[0];
+    __pyx_v_block = values[1];
+    __pyx_v_timeout = values[2];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("kill", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 615, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent._greenlet.Greenlet.kill", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_9_greenlet_8Greenlet_32kill(((struct __pyx_obj_6gevent_9_greenlet_Greenlet *)__pyx_v_self), __pyx_v_exception, __pyx_v_block, __pyx_v_timeout);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_32kill(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self, PyObject *__pyx_v_exception, PyObject *__pyx_v_block, PyObject *__pyx_v_timeout) {
+  PyObject *__pyx_v_waiter = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("kill", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_XDECREF(__pyx_t_7);
+  __Pyx_AddTraceback("gevent._greenlet.Greenlet.kill", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_waiter);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __Pyx_INCREF(__pyx_v_6gevent_9_greenlet_GreenletExit);
+  __pyx_k__10 = __pyx_v_6gevent_9_greenlet_GreenletExit;
+  __Pyx_GIVEREF(__pyx_v_6gevent_9_greenlet_GreenletExit);
+/* … */
+  __pyx_tuple__49 = PyTuple_Pack(5, __pyx_n_s_self_2, __pyx_n_s_exception, __pyx_n_s_block, __pyx_n_s_timeout, __pyx_n_s_waiter); if (unlikely(!__pyx_tuple__49)) __PYX_ERR(0, 615, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__49);
+  __Pyx_GIVEREF(__pyx_tuple__49);
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_9_greenlet_8Greenlet_33kill, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Greenlet_kill, NULL, __pyx_n_s_gevent__greenlet, __pyx_d, ((PyObject *)__pyx_codeobj__50)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 615, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet->tp_dict, __pyx_n_s_kill_2, __pyx_t_2) < 0) __PYX_ERR(0, 615, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_9_greenlet_Greenlet);
+  __pyx_codeobj__50 = (PyObject*)__Pyx_PyCode_New(4, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__49, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_greenlet_py, __pyx_n_s_kill_2, 615, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__50)) __PYX_ERR(0, 615, __pyx_L1_error)
+
 0616:         """
+
 0617:         Raise the ``exception`` in the greenlet.
+
 0618: 
+
 0619:         If ``block`` is ``True`` (the default), wait until the greenlet dies or the optional timeout expires.
+
 0620:         If block is ``False``, the current greenlet is not unscheduled.
+
 0621: 
+
 0622:         The function always returns ``None`` and never raises an error.
+
 0623: 
+
 0624:         .. note::
+
 0625: 
+
 0626:             Depending on what this greenlet is executing and the state
+
 0627:             of the event loop, the exception may or may not be raised
+
 0628:             immediately when this greenlet resumes execution. It may
+
 0629:             be raised on a subsequent green call, or, if this greenlet
+
 0630:             exits before making such a call, it may not be raised at
+
 0631:             all. As of 1.1, an example where the exception is raised
+
 0632:             later is if this greenlet had called :func:`sleep(0)
+
 0633:             <gevent.sleep>`; an example where the exception is raised
+
 0634:             immediately is if this greenlet had called
+
 0635:             :func:`sleep(0.1) <gevent.sleep>`.
+
 0636: 
+
 0637:         .. caution::
+
 0638: 
+
 0639:             Use care when killing greenlets. If the code executing is not
+
 0640:             exception safe (e.g., makes proper use of ``finally``) then an
+
 0641:             unexpected exception could result in corrupted state.
+
 0642: 
+
 0643:         See also :func:`gevent.kill`.
+
 0644: 
+
 0645:         :keyword type exception: The type of exception to raise in the greenlet. The default
+
 0646:             is :class:`GreenletExit`, which indicates a :meth:`successful` completion
+
 0647:             of the greenlet.
+
 0648: 
+
 0649:         .. versionchanged:: 0.13.0
+
 0650:             *block* is now ``True`` by default.
+
 0651:         .. versionchanged:: 1.1a2
+
 0652:             If this greenlet had never been switched to, killing it will prevent it from ever being switched to.
+
 0653:         """
+
+0654:         self.__cancel_start()
+
  __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_9_greenlet_Greenlet *)__pyx_v_self->__pyx_vtab)->__pyx___cancel_start(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 654, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 0655: 
+
+0656:         if self.dead:
+
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_dead); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 656, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 656, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  if (__pyx_t_2) {
+/* … */
+    goto __pyx_L3;
+  }
+
+0657:             self.__handle_death_before_start((exception,))
+
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 657, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_INCREF(__pyx_v_exception);
+    __Pyx_GIVEREF(__pyx_v_exception);
+    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_exception);
+    __pyx_t_3 = ((struct __pyx_vtabstruct_6gevent_9_greenlet_Greenlet *)__pyx_v_self->__pyx_vtab)->__pyx___handle_death_before_start(__pyx_v_self, ((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 657, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+
 0658:         else:
+
+0659:             waiter = Waiter() if block else None # pylint:disable=undefined-variable
+
  /*else*/ {
+    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_block); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 659, __pyx_L1_error)
+    if (__pyx_t_2) {
+      __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_6gevent_8__waiter_Waiter)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 659, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      __pyx_t_3 = __pyx_t_1;
+      __pyx_t_1 = 0;
+    } else {
+      __Pyx_INCREF(Py_None);
+      __pyx_t_3 = Py_None;
+    }
+    __pyx_v_waiter = __pyx_t_3;
+    __pyx_t_3 = 0;
+
+0660:             self.parent.loop.run_callback(_kill, self, exception, waiter)
+
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_parent); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 660, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_loop); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 660, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_run_callback); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 660, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_kill); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 660, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    __pyx_t_5 = NULL;
+    __pyx_t_6 = 0;
+    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
+      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
+      if (likely(__pyx_t_5)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
+        __Pyx_INCREF(__pyx_t_5);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_1, function);
+        __pyx_t_6 = 1;
+      }
+    }
+    #if CYTHON_FAST_PYCALL
+    if (PyFunction_Check(__pyx_t_1)) {
+      PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_t_4, ((PyObject *)__pyx_v_self), __pyx_v_exception, __pyx_v_waiter};
+      __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_6, 4+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 660, __pyx_L1_error)
+      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+      __Pyx_GOTREF(__pyx_t_3);
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    } else
+    #endif
+    #if CYTHON_FAST_PYCCALL
+    if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
+      PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_t_4, ((PyObject *)__pyx_v_self), __pyx_v_exception, __pyx_v_waiter};
+      __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_6, 4+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 660, __pyx_L1_error)
+      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+      __Pyx_GOTREF(__pyx_t_3);
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    } else
+    #endif
+    {
+      __pyx_t_7 = PyTuple_New(4+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 660, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_7);
+      if (__pyx_t_5) {
+        __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
+      }
+      __Pyx_GIVEREF(__pyx_t_4);
+      PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_t_4);
+      __Pyx_INCREF(((PyObject *)__pyx_v_self));
+      __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
+      PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, ((PyObject *)__pyx_v_self));
+      __Pyx_INCREF(__pyx_v_exception);
+      __Pyx_GIVEREF(__pyx_v_exception);
+      PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_6, __pyx_v_exception);
+      __Pyx_INCREF(__pyx_v_waiter);
+      __Pyx_GIVEREF(__pyx_v_waiter);
+      PyTuple_SET_ITEM(__pyx_t_7, 3+__pyx_t_6, __pyx_v_waiter);
+      __pyx_t_4 = 0;
+      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 660, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_3);
+      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+    }
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+
+0661:             if block:
+
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_block); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 661, __pyx_L1_error)
+    if (__pyx_t_2) {
+/* … */
+    }
+  }
+  __pyx_L3:;
+
+0662:                 waiter.get()
+
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_waiter, __pyx_n_s_get_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 662, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      __pyx_t_7 = NULL;
+      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
+        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_1);
+        if (likely(__pyx_t_7)) {
+          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
+          __Pyx_INCREF(__pyx_t_7);
+          __Pyx_INCREF(function);
+          __Pyx_DECREF_SET(__pyx_t_1, function);
+        }
+      }
+      __pyx_t_3 = (__pyx_t_7) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_7) : __Pyx_PyObject_CallNoArg(__pyx_t_1);
+      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 662, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_3);
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+
+0663:                 self.join(timeout)
+
      __pyx_t_8.__pyx_n = 1;
+      __pyx_t_8.timeout = __pyx_v_timeout;
+      __pyx_t_3 = ((struct __pyx_vtabstruct_6gevent_9_greenlet_Greenlet *)__pyx_v_self->__pyx_vtab)->join(__pyx_v_self, 0, &__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 663, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_3);
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+
 0664:         # it should be OK to use kill() in finally or kill a greenlet from more than one place;
+
 0665:         # thus it should not raise when the greenlet is already killed (= not started)
+
 0666: 
+
+0667:     def get(self, block=True, timeout=None):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_35get(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_6gevent_9_greenlet_8Greenlet_34get[] = "Greenlet.get(self, block=True, timeout=None)\n\n        get(block=True, timeout=None) -> object\n\n        Return the result the greenlet has returned or re-raise the\n        exception it has raised.\n\n        If block is ``False``, raise :class:`gevent.Timeout` if the\n        greenlet is still alive. If block is ``True``, unschedule the\n        current greenlet until the result is available or the timeout\n        expires. In the latter case, :class:`gevent.Timeout` is\n        raised.\n        ";
+static PyMethodDef __pyx_mdef_6gevent_9_greenlet_8Greenlet_35get = {"get", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_9_greenlet_8Greenlet_35get, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_9_greenlet_8Greenlet_34get};
+static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_35get(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_block = 0;
+  PyObject *__pyx_v_timeout = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("get (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_block,&__pyx_n_s_timeout,0};
+    PyObject* values[2] = {0,0};
+    values[0] = ((PyObject *)Py_True);
+    values[1] = ((PyObject *)Py_None);
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_block);
+          if (value) { values[0] = value; kw_args--; }
+        }
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_timeout);
+          if (value) { values[1] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get") < 0)) __PYX_ERR(0, 667, __pyx_L3_error)
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    __pyx_v_block = values[0];
+    __pyx_v_timeout = values[1];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("get", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 667, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent._greenlet.Greenlet.get", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_9_greenlet_8Greenlet_34get(((struct __pyx_obj_6gevent_9_greenlet_Greenlet *)__pyx_v_self), __pyx_v_block, __pyx_v_timeout);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_34get(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self, PyObject *__pyx_v_block, PyObject *__pyx_v_timeout) {
+  PyObject *__pyx_v_switch = NULL;
+  PyObject *__pyx_v_t = NULL;
+  PyObject *__pyx_v_result = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("get", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_9);
+  __Pyx_XDECREF(__pyx_t_19);
+  __Pyx_XDECREF(__pyx_t_20);
+  __Pyx_AddTraceback("gevent._greenlet.Greenlet.get", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_switch);
+  __Pyx_XDECREF(__pyx_v_t);
+  __Pyx_XDECREF(__pyx_v_result);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__51 = PyTuple_Pack(6, __pyx_n_s_self_2, __pyx_n_s_block, __pyx_n_s_timeout, __pyx_n_s_switch, __pyx_n_s_t, __pyx_n_s_result); if (unlikely(!__pyx_tuple__51)) __PYX_ERR(0, 667, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__51);
+  __Pyx_GIVEREF(__pyx_tuple__51);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_9_greenlet_8Greenlet_35get, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Greenlet_get, NULL, __pyx_n_s_gevent__greenlet, __pyx_d, ((PyObject *)__pyx_codeobj__52)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 667, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet->tp_dict, __pyx_n_s_get_2, __pyx_t_2) < 0) __PYX_ERR(0, 667, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_9_greenlet_Greenlet);
+  __pyx_codeobj__52 = (PyObject*)__Pyx_PyCode_New(3, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__51, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_greenlet_py, __pyx_n_s_get_2, 667, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__52)) __PYX_ERR(0, 667, __pyx_L1_error)
+
 0668:         """
+
 0669:         get(block=True, timeout=None) -> object
+
 0670: 
+
 0671:         Return the result the greenlet has returned or re-raise the
+
 0672:         exception it has raised.
+
 0673: 
+
 0674:         If block is ``False``, raise :class:`gevent.Timeout` if the
+
 0675:         greenlet is still alive. If block is ``True``, unschedule the
+
 0676:         current greenlet until the result is available or the timeout
+
 0677:         expires. In the latter case, :class:`gevent.Timeout` is
+
 0678:         raised.
+
 0679:         """
+
+0680:         if self.ready():
+
  __pyx_t_1 = (((struct __pyx_vtabstruct_6gevent_9_greenlet_Greenlet *)__pyx_v_self->__pyx_vtab)->ready(__pyx_v_self, 0) != 0);
+  if (__pyx_t_1) {
+/* … */
+  }
+
+0681:             if self.successful():
+
    __pyx_t_1 = (((struct __pyx_vtabstruct_6gevent_9_greenlet_Greenlet *)__pyx_v_self->__pyx_vtab)->successful(__pyx_v_self, 0) != 0);
+    if (__pyx_t_1) {
+/* … */
+    }
+
+0682:                 return self.value
+
      __Pyx_XDECREF(__pyx_r);
+      __Pyx_INCREF(__pyx_v_self->value);
+      __pyx_r = __pyx_v_self->value;
+      goto __pyx_L0;
+
+0683:             self._raise_exception()
+
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_raise_exception); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 683, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __pyx_t_4 = NULL;
+    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
+      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+      if (likely(__pyx_t_4)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+        __Pyx_INCREF(__pyx_t_4);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_3, function);
+      }
+    }
+    __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
+    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 683, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+0684:         if not block:
+
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_block); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 684, __pyx_L1_error)
+  __pyx_t_5 = ((!__pyx_t_1) != 0);
+  if (unlikely(__pyx_t_5)) {
+/* … */
+  }
+
+0685:             raise Timeout()
+
    __Pyx_INCREF(__pyx_v_6gevent_9_greenlet_Timeout);
+    __pyx_t_3 = __pyx_v_6gevent_9_greenlet_Timeout; __pyx_t_4 = NULL;
+    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+      if (likely(__pyx_t_4)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+        __Pyx_INCREF(__pyx_t_4);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_3, function);
+      }
+    }
+    __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
+    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 685, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __PYX_ERR(0, 685, __pyx_L1_error)
+
 0686: 
+
+0687:         switch = getcurrent().switch # pylint:disable=undefined-variable
+
  __pyx_t_2 = ((PyObject *)__pyx_f_6gevent_9_greenlet_getcurrent()); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 687, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_switch); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 687, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_v_switch = __pyx_t_3;
+  __pyx_t_3 = 0;
+
+0688:         self.rawlink(switch)
+
  __pyx_t_3 = ((struct __pyx_vtabstruct_6gevent_9_greenlet_Greenlet *)__pyx_v_self->__pyx_vtab)->rawlink(__pyx_v_self, __pyx_v_switch, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 688, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+
+0689:         try:
+
  {
+    /*try:*/ {
+/* … */
+    }
+    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
+    goto __pyx_L11_try_end;
+    __pyx_L6_error:;
+    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
+    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+/* … */
+    __Pyx_XGIVEREF(__pyx_t_6);
+    __Pyx_XGIVEREF(__pyx_t_7);
+    __Pyx_XGIVEREF(__pyx_t_8);
+    __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
+    goto __pyx_L1_error;
+    __pyx_L11_try_end:;
+  }
+
+0690:             t = Timeout._start_new_or_dummy(timeout)
+
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_6gevent_9_greenlet_Timeout, __pyx_n_s_start_new_or_dummy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 690, __pyx_L6_error)
+      __Pyx_GOTREF(__pyx_t_2);
+      __pyx_t_4 = NULL;
+      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
+        if (likely(__pyx_t_4)) {
+          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+          __Pyx_INCREF(__pyx_t_4);
+          __Pyx_INCREF(function);
+          __Pyx_DECREF_SET(__pyx_t_2, function);
+        }
+      }
+      __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_v_timeout) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_timeout);
+      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 690, __pyx_L6_error)
+      __Pyx_GOTREF(__pyx_t_3);
+      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+      __pyx_v_t = __pyx_t_3;
+      __pyx_t_3 = 0;
+
+0691:             try:
+
      /*try:*/ {
+
+0692:                 result = self.parent.switch()
+
        __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_parent); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 692, __pyx_L13_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_switch); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 692, __pyx_L13_error)
+        __Pyx_GOTREF(__pyx_t_4);
+        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+        __pyx_t_2 = NULL;
+        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
+          __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
+          if (likely(__pyx_t_2)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
+            __Pyx_INCREF(__pyx_t_2);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_4, function);
+          }
+        }
+        __pyx_t_3 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
+        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+        if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 692, __pyx_L13_error)
+        __Pyx_GOTREF(__pyx_t_3);
+        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+        __pyx_v_result = __pyx_t_3;
+        __pyx_t_3 = 0;
+
+0693:                 if result is not self:
+
        __pyx_t_5 = (__pyx_v_result != ((PyObject *)__pyx_v_self));
+        __pyx_t_1 = (__pyx_t_5 != 0);
+        if (unlikely(__pyx_t_1)) {
+/* … */
+        }
+      }
+
+0694:                     raise InvalidSwitchError('Invalid switch into Greenlet.get(): %r' % (result, ))
+
          __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 694, __pyx_L13_error)
+          __Pyx_GOTREF(__pyx_t_4);
+          __Pyx_INCREF(__pyx_v_result);
+          __Pyx_GIVEREF(__pyx_v_result);
+          PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_result);
+          __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_switch_into_Greenlet_get, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 694, __pyx_L13_error)
+          __Pyx_GOTREF(__pyx_t_2);
+          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+          __Pyx_INCREF(__pyx_v_6gevent_9_greenlet_InvalidSwitchError);
+          __pyx_t_4 = __pyx_v_6gevent_9_greenlet_InvalidSwitchError; __pyx_t_9 = NULL;
+          if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
+            __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_4);
+            if (likely(__pyx_t_9)) {
+              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
+              __Pyx_INCREF(__pyx_t_9);
+              __Pyx_INCREF(function);
+              __Pyx_DECREF_SET(__pyx_t_4, function);
+            }
+          }
+          __pyx_t_3 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_9, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_2);
+          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
+          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+          if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 694, __pyx_L13_error)
+          __Pyx_GOTREF(__pyx_t_3);
+          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+          __Pyx_Raise(__pyx_t_3, 0, 0, 0);
+          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+          __PYX_ERR(0, 694, __pyx_L13_error)
+
 0695:             finally:
+
+0696:                 t.cancel()
+
      /*finally:*/ {
+        /*normal exit:*/{
+          __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_t, __pyx_n_s_cancel); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 696, __pyx_L6_error)
+          __Pyx_GOTREF(__pyx_t_4);
+          __pyx_t_2 = NULL;
+          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
+            __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
+            if (likely(__pyx_t_2)) {
+              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
+              __Pyx_INCREF(__pyx_t_2);
+              __Pyx_INCREF(function);
+              __Pyx_DECREF_SET(__pyx_t_4, function);
+            }
+          }
+          __pyx_t_3 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
+          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+          if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 696, __pyx_L6_error)
+          __Pyx_GOTREF(__pyx_t_3);
+          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+          goto __pyx_L14;
+        }
+        __pyx_L13_error:;
+        /*exception exit:*/{
+          __Pyx_PyThreadState_declare
+          __Pyx_PyThreadState_assign
+          __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0;
+          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
+          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18);
+          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15) < 0)) __Pyx_ErrFetch(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15);
+          __Pyx_XGOTREF(__pyx_t_13);
+          __Pyx_XGOTREF(__pyx_t_14);
+          __Pyx_XGOTREF(__pyx_t_15);
+          __Pyx_XGOTREF(__pyx_t_16);
+          __Pyx_XGOTREF(__pyx_t_17);
+          __Pyx_XGOTREF(__pyx_t_18);
+          __pyx_t_10 = __pyx_lineno; __pyx_t_11 = __pyx_clineno; __pyx_t_12 = __pyx_filename;
+          {
+            __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_t, __pyx_n_s_cancel); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 696, __pyx_L17_error)
+            __Pyx_GOTREF(__pyx_t_4);
+            __pyx_t_2 = NULL;
+            if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
+              __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
+              if (likely(__pyx_t_2)) {
+                PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
+                __Pyx_INCREF(__pyx_t_2);
+                __Pyx_INCREF(function);
+                __Pyx_DECREF_SET(__pyx_t_4, function);
+              }
+            }
+            __pyx_t_3 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
+            __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+            if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 696, __pyx_L17_error)
+            __Pyx_GOTREF(__pyx_t_3);
+            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+          }
+          if (PY_MAJOR_VERSION >= 3) {
+            __Pyx_XGIVEREF(__pyx_t_16);
+            __Pyx_XGIVEREF(__pyx_t_17);
+            __Pyx_XGIVEREF(__pyx_t_18);
+            __Pyx_ExceptionReset(__pyx_t_16, __pyx_t_17, __pyx_t_18);
+          }
+          __Pyx_XGIVEREF(__pyx_t_13);
+          __Pyx_XGIVEREF(__pyx_t_14);
+          __Pyx_XGIVEREF(__pyx_t_15);
+          __Pyx_ErrRestore(__pyx_t_13, __pyx_t_14, __pyx_t_15);
+          __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0;
+          __pyx_lineno = __pyx_t_10; __pyx_clineno = __pyx_t_11; __pyx_filename = __pyx_t_12;
+          goto __pyx_L6_error;
+          __pyx_L17_error:;
+          if (PY_MAJOR_VERSION >= 3) {
+            __Pyx_XGIVEREF(__pyx_t_16);
+            __Pyx_XGIVEREF(__pyx_t_17);
+            __Pyx_XGIVEREF(__pyx_t_18);
+            __Pyx_ExceptionReset(__pyx_t_16, __pyx_t_17, __pyx_t_18);
+          }
+          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
+          __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
+          __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
+          __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0;
+          goto __pyx_L6_error;
+        }
+        __pyx_L14:;
+      }
+
+0697:         except:
+
    /*except:*/ {
+      __Pyx_AddTraceback("gevent._greenlet.Greenlet.get", __pyx_clineno, __pyx_lineno, __pyx_filename);
+      if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_4, &__pyx_t_2) < 0) __PYX_ERR(0, 697, __pyx_L8_except_error)
+      __Pyx_GOTREF(__pyx_t_3);
+      __Pyx_GOTREF(__pyx_t_4);
+      __Pyx_GOTREF(__pyx_t_2);
+
 0698:             # unlinking in 'except' instead of finally is an optimization:
+
 0699:             # if switch occurred normally then link was already removed in _notify_links
+
 0700:             # and there's no need to touch the links set.
+
 0701:             # Note, however, that if "Invalid switch" assert was removed and invalid switch
+
 0702:             # did happen, the link would remain, causing another invalid switch later in this greenlet.
+
+0703:             self.unlink(switch)
+
      __pyx_t_19 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_unlink); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 703, __pyx_L8_except_error)
+      __Pyx_GOTREF(__pyx_t_19);
+      __pyx_t_20 = NULL;
+      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_19))) {
+        __pyx_t_20 = PyMethod_GET_SELF(__pyx_t_19);
+        if (likely(__pyx_t_20)) {
+          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_19);
+          __Pyx_INCREF(__pyx_t_20);
+          __Pyx_INCREF(function);
+          __Pyx_DECREF_SET(__pyx_t_19, function);
+        }
+      }
+      __pyx_t_9 = (__pyx_t_20) ? __Pyx_PyObject_Call2Args(__pyx_t_19, __pyx_t_20, __pyx_v_switch) : __Pyx_PyObject_CallOneArg(__pyx_t_19, __pyx_v_switch);
+      __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
+      if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 703, __pyx_L8_except_error)
+      __Pyx_GOTREF(__pyx_t_9);
+      __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
+      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+
+0704:             raise
+
      __Pyx_GIVEREF(__pyx_t_3);
+      __Pyx_GIVEREF(__pyx_t_4);
+      __Pyx_XGIVEREF(__pyx_t_2);
+      __Pyx_ErrRestoreWithState(__pyx_t_3, __pyx_t_4, __pyx_t_2);
+      __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_t_2 = 0; 
+      __PYX_ERR(0, 704, __pyx_L8_except_error)
+    }
+    __pyx_L8_except_error:;
+
 0705: 
+
+0706:         if self.ready():
+
  __pyx_t_1 = (((struct __pyx_vtabstruct_6gevent_9_greenlet_Greenlet *)__pyx_v_self->__pyx_vtab)->ready(__pyx_v_self, 0) != 0);
+  if (__pyx_t_1) {
+/* … */
+  }
+
+0707:             if self.successful():
+
    __pyx_t_1 = (((struct __pyx_vtabstruct_6gevent_9_greenlet_Greenlet *)__pyx_v_self->__pyx_vtab)->successful(__pyx_v_self, 0) != 0);
+    if (__pyx_t_1) {
+/* … */
+    }
+
+0708:                 return self.value
+
      __Pyx_XDECREF(__pyx_r);
+      __Pyx_INCREF(__pyx_v_self->value);
+      __pyx_r = __pyx_v_self->value;
+      goto __pyx_L0;
+
+0709:             self._raise_exception()
+
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_raise_exception); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 709, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    __pyx_t_3 = NULL;
+    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
+      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
+      if (likely(__pyx_t_3)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
+        __Pyx_INCREF(__pyx_t_3);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_4, function);
+      }
+    }
+    __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
+    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 709, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
 0710: 
+
+0711:     def join(self, timeout=None):
+
static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_37join(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_f_6gevent_9_greenlet_8Greenlet_join(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_9_greenlet_8Greenlet_join *__pyx_optional_args) {
+  PyObject *__pyx_v_timeout = ((PyObject *)Py_None);
+  PyObject *__pyx_v_switch = NULL;
+  PyObject *__pyx_v_t = NULL;
+  PyObject *__pyx_v_result = NULL;
+  PyObject *__pyx_v_ex = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("join", 0);
+  if (__pyx_optional_args) {
+    if (__pyx_optional_args->__pyx_n > 0) {
+      __pyx_v_timeout = __pyx_optional_args->timeout;
+    }
+  }
+  /* Check if called by wrapper */
+  if (unlikely(__pyx_skip_dispatch)) ;
+  /* Check if overridden in Python */
+  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
+    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
+    if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
+    else {
+      PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      #endif
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_join); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 711, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_9_greenlet_8Greenlet_37join)) {
+        __Pyx_XDECREF(__pyx_r);
+        __Pyx_INCREF(__pyx_t_1);
+        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+          if (likely(__pyx_t_4)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+            __Pyx_INCREF(__pyx_t_4);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_3, function);
+          }
+        }
+        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_timeout) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_timeout);
+        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 711, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __pyx_r = __pyx_t_2;
+        __pyx_t_2 = 0;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        goto __pyx_L0;
+      }
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+      tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
+      if (unlikely(type_dict_guard != tp_dict_version)) {
+        tp_dict_version = obj_dict_version = 0;
+      }
+      #endif
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    }
+    #endif
+  }
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_19);
+  __Pyx_XDECREF(__pyx_t_20);
+  __Pyx_AddTraceback("gevent._greenlet.Greenlet.join", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_switch);
+  __Pyx_XDECREF(__pyx_v_t);
+  __Pyx_XDECREF(__pyx_v_result);
+  __Pyx_XDECREF(__pyx_v_ex);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_37join(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_6gevent_9_greenlet_8Greenlet_36join[] = "Greenlet.join(self, timeout=None)\n\n        join(timeout=None) -> None\n\n        Wait until the greenlet finishes or *timeout* expires. Return\n        ``None`` regardless.\n        ";
+static PyMethodDef __pyx_mdef_6gevent_9_greenlet_8Greenlet_37join = {"join", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_9_greenlet_8Greenlet_37join, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_9_greenlet_8Greenlet_36join};
+static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_37join(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_timeout = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("join (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_timeout,0};
+    PyObject* values[1] = {0};
+    values[0] = ((PyObject *)Py_None);
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_timeout);
+          if (value) { values[0] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "join") < 0)) __PYX_ERR(0, 711, __pyx_L3_error)
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    __pyx_v_timeout = values[0];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("join", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 711, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent._greenlet.Greenlet.join", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_9_greenlet_8Greenlet_36join(((struct __pyx_obj_6gevent_9_greenlet_Greenlet *)__pyx_v_self), __pyx_v_timeout);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_36join(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self, PyObject *__pyx_v_timeout) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("join", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_2.__pyx_n = 1;
+  __pyx_t_2.timeout = __pyx_v_timeout;
+  __pyx_t_1 = __pyx_vtabptr_6gevent_9_greenlet_Greenlet->join(__pyx_v_self, 1, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 711, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent._greenlet.Greenlet.join", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__53 = PyTuple_Pack(2, __pyx_n_s_self_2, __pyx_n_s_timeout); if (unlikely(!__pyx_tuple__53)) __PYX_ERR(0, 711, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__53);
+  __Pyx_GIVEREF(__pyx_tuple__53);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_9_greenlet_8Greenlet_37join, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Greenlet_join, NULL, __pyx_n_s_gevent__greenlet, __pyx_d, ((PyObject *)__pyx_codeobj__54)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 711, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet->tp_dict, __pyx_n_s_join, __pyx_t_2) < 0) __PYX_ERR(0, 711, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_9_greenlet_Greenlet);
+  __pyx_codeobj__54 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__53, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_greenlet_py, __pyx_n_s_join, 711, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__54)) __PYX_ERR(0, 711, __pyx_L1_error)
+
 0712:         """
+
 0713:         join(timeout=None) -> None
+
 0714: 
+
 0715:         Wait until the greenlet finishes or *timeout* expires. Return
+
 0716:         ``None`` regardless.
+
 0717:         """
+
+0718:         if self.ready():
+
  __pyx_t_5 = (((struct __pyx_vtabstruct_6gevent_9_greenlet_Greenlet *)__pyx_v_self->__pyx_vtab)->ready(__pyx_v_self, 0) != 0);
+  if (__pyx_t_5) {
+/* … */
+  }
+
+0719:             return
+
    __Pyx_XDECREF(__pyx_r);
+    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+    goto __pyx_L0;
+
 0720: 
+
+0721:         switch = getcurrent().switch # pylint:disable=undefined-variable
+
  __pyx_t_1 = ((PyObject *)__pyx_f_6gevent_9_greenlet_getcurrent()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 721, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_switch); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 721, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_v_switch = __pyx_t_2;
+  __pyx_t_2 = 0;
+
+0722:         self.rawlink(switch)
+
  __pyx_t_2 = ((struct __pyx_vtabstruct_6gevent_9_greenlet_Greenlet *)__pyx_v_self->__pyx_vtab)->rawlink(__pyx_v_self, __pyx_v_switch, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 722, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+0723:         try:
+
  {
+    /*try:*/ {
+/* … */
+    }
+    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
+    goto __pyx_L9_try_end;
+    __pyx_L4_error:;
+    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+/* … */
+    __Pyx_XGIVEREF(__pyx_t_6);
+    __Pyx_XGIVEREF(__pyx_t_7);
+    __Pyx_XGIVEREF(__pyx_t_8);
+    __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
+    goto __pyx_L1_error;
+    __pyx_L5_exception_handled:;
+    __Pyx_XGIVEREF(__pyx_t_6);
+    __Pyx_XGIVEREF(__pyx_t_7);
+    __Pyx_XGIVEREF(__pyx_t_8);
+    __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
+    __pyx_L9_try_end:;
+  }
+
+0724:             t = Timeout._start_new_or_dummy(timeout)
+
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_6gevent_9_greenlet_Timeout, __pyx_n_s_start_new_or_dummy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 724, __pyx_L4_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      __pyx_t_3 = NULL;
+      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
+        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
+        if (likely(__pyx_t_3)) {
+          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
+          __Pyx_INCREF(__pyx_t_3);
+          __Pyx_INCREF(function);
+          __Pyx_DECREF_SET(__pyx_t_1, function);
+        }
+      }
+      __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_3, __pyx_v_timeout) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_timeout);
+      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 724, __pyx_L4_error)
+      __Pyx_GOTREF(__pyx_t_2);
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      __pyx_v_t = __pyx_t_2;
+      __pyx_t_2 = 0;
+
+0725:             try:
+
      /*try:*/ {
+
+0726:                 result = self.parent.switch()
+
        __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_parent); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 726, __pyx_L11_error)
+        __Pyx_GOTREF(__pyx_t_1);
+        __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_switch); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 726, __pyx_L11_error)
+        __Pyx_GOTREF(__pyx_t_3);
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        __pyx_t_1 = NULL;
+        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
+          __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
+          if (likely(__pyx_t_1)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+            __Pyx_INCREF(__pyx_t_1);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_3, function);
+          }
+        }
+        __pyx_t_2 = (__pyx_t_1) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
+        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 726, __pyx_L11_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __pyx_v_result = __pyx_t_2;
+        __pyx_t_2 = 0;
+
+0727:                 if result is not self:
+
        __pyx_t_5 = (__pyx_v_result != ((PyObject *)__pyx_v_self));
+        __pyx_t_9 = (__pyx_t_5 != 0);
+        if (unlikely(__pyx_t_9)) {
+/* … */
+        }
+      }
+
+0728:                     raise InvalidSwitchError('Invalid switch into Greenlet.join(): %r' % (result, ))
+
          __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 728, __pyx_L11_error)
+          __Pyx_GOTREF(__pyx_t_3);
+          __Pyx_INCREF(__pyx_v_result);
+          __Pyx_GIVEREF(__pyx_v_result);
+          PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_result);
+          __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_switch_into_Greenlet_joi, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 728, __pyx_L11_error)
+          __Pyx_GOTREF(__pyx_t_1);
+          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+          __Pyx_INCREF(__pyx_v_6gevent_9_greenlet_InvalidSwitchError);
+          __pyx_t_3 = __pyx_v_6gevent_9_greenlet_InvalidSwitchError; __pyx_t_4 = NULL;
+          if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+            __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+            if (likely(__pyx_t_4)) {
+              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+              __Pyx_INCREF(__pyx_t_4);
+              __Pyx_INCREF(function);
+              __Pyx_DECREF_SET(__pyx_t_3, function);
+            }
+          }
+          __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_t_1) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1);
+          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 728, __pyx_L11_error)
+          __Pyx_GOTREF(__pyx_t_2);
+          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+          __Pyx_Raise(__pyx_t_2, 0, 0, 0);
+          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+          __PYX_ERR(0, 728, __pyx_L11_error)
+
 0729:             finally:
+
+0730:                 t.cancel()
+
      /*finally:*/ {
+        /*normal exit:*/{
+          __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_t, __pyx_n_s_cancel); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 730, __pyx_L4_error)
+          __Pyx_GOTREF(__pyx_t_3);
+          __pyx_t_1 = NULL;
+          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
+            __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
+            if (likely(__pyx_t_1)) {
+              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+              __Pyx_INCREF(__pyx_t_1);
+              __Pyx_INCREF(function);
+              __Pyx_DECREF_SET(__pyx_t_3, function);
+            }
+          }
+          __pyx_t_2 = (__pyx_t_1) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
+          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 730, __pyx_L4_error)
+          __Pyx_GOTREF(__pyx_t_2);
+          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+          goto __pyx_L12;
+        }
+        __pyx_L11_error:;
+        /*exception exit:*/{
+          __Pyx_PyThreadState_declare
+          __Pyx_PyThreadState_assign
+          __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0;
+          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18);
+          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15) < 0)) __Pyx_ErrFetch(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15);
+          __Pyx_XGOTREF(__pyx_t_13);
+          __Pyx_XGOTREF(__pyx_t_14);
+          __Pyx_XGOTREF(__pyx_t_15);
+          __Pyx_XGOTREF(__pyx_t_16);
+          __Pyx_XGOTREF(__pyx_t_17);
+          __Pyx_XGOTREF(__pyx_t_18);
+          __pyx_t_10 = __pyx_lineno; __pyx_t_11 = __pyx_clineno; __pyx_t_12 = __pyx_filename;
+          {
+            __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_t, __pyx_n_s_cancel); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 730, __pyx_L15_error)
+            __Pyx_GOTREF(__pyx_t_3);
+            __pyx_t_1 = NULL;
+            if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
+              __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
+              if (likely(__pyx_t_1)) {
+                PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+                __Pyx_INCREF(__pyx_t_1);
+                __Pyx_INCREF(function);
+                __Pyx_DECREF_SET(__pyx_t_3, function);
+              }
+            }
+            __pyx_t_2 = (__pyx_t_1) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
+            __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+            if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 730, __pyx_L15_error)
+            __Pyx_GOTREF(__pyx_t_2);
+            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+          }
+          if (PY_MAJOR_VERSION >= 3) {
+            __Pyx_XGIVEREF(__pyx_t_16);
+            __Pyx_XGIVEREF(__pyx_t_17);
+            __Pyx_XGIVEREF(__pyx_t_18);
+            __Pyx_ExceptionReset(__pyx_t_16, __pyx_t_17, __pyx_t_18);
+          }
+          __Pyx_XGIVEREF(__pyx_t_13);
+          __Pyx_XGIVEREF(__pyx_t_14);
+          __Pyx_XGIVEREF(__pyx_t_15);
+          __Pyx_ErrRestore(__pyx_t_13, __pyx_t_14, __pyx_t_15);
+          __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0;
+          __pyx_lineno = __pyx_t_10; __pyx_clineno = __pyx_t_11; __pyx_filename = __pyx_t_12;
+          goto __pyx_L4_error;
+          __pyx_L15_error:;
+          if (PY_MAJOR_VERSION >= 3) {
+            __Pyx_XGIVEREF(__pyx_t_16);
+            __Pyx_XGIVEREF(__pyx_t_17);
+            __Pyx_XGIVEREF(__pyx_t_18);
+            __Pyx_ExceptionReset(__pyx_t_16, __pyx_t_17, __pyx_t_18);
+          }
+          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
+          __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
+          __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
+          __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0;
+          goto __pyx_L4_error;
+        }
+        __pyx_L12:;
+      }
+
+0731:         except Timeout as ex:
+
    __pyx_t_11 = __Pyx_PyErr_ExceptionMatches(__pyx_v_6gevent_9_greenlet_Timeout);
+    if (__pyx_t_11) {
+      __Pyx_AddTraceback("gevent._greenlet.Greenlet.join", __pyx_clineno, __pyx_lineno, __pyx_filename);
+      if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_3, &__pyx_t_1) < 0) __PYX_ERR(0, 731, __pyx_L6_except_error)
+      __Pyx_GOTREF(__pyx_t_2);
+      __Pyx_GOTREF(__pyx_t_3);
+      __Pyx_GOTREF(__pyx_t_1);
+      __Pyx_INCREF(__pyx_t_3);
+      __pyx_v_ex = __pyx_t_3;
+      /*try:*/ {
+/* … */
+      /*finally:*/ {
+        /*normal exit:*/{
+          __Pyx_DECREF(__pyx_v_ex);
+          __pyx_v_ex = NULL;
+          goto __pyx_L22;
+        }
+        __pyx_L21_error:;
+        /*exception exit:*/{
+          __Pyx_PyThreadState_declare
+          __Pyx_PyThreadState_assign
+          __pyx_t_18 = 0; __pyx_t_17 = 0; __pyx_t_16 = 0; __pyx_t_15 = 0; __pyx_t_14 = 0; __pyx_t_13 = 0;
+          __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
+          __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
+          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_15, &__pyx_t_14, &__pyx_t_13);
+          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_18, &__pyx_t_17, &__pyx_t_16) < 0)) __Pyx_ErrFetch(&__pyx_t_18, &__pyx_t_17, &__pyx_t_16);
+          __Pyx_XGOTREF(__pyx_t_18);
+          __Pyx_XGOTREF(__pyx_t_17);
+          __Pyx_XGOTREF(__pyx_t_16);
+          __Pyx_XGOTREF(__pyx_t_15);
+          __Pyx_XGOTREF(__pyx_t_14);
+          __Pyx_XGOTREF(__pyx_t_13);
+          __pyx_t_11 = __pyx_lineno; __pyx_t_10 = __pyx_clineno; __pyx_t_21 = __pyx_filename;
+          {
+            __Pyx_DECREF(__pyx_v_ex);
+            __pyx_v_ex = NULL;
+          }
+          if (PY_MAJOR_VERSION >= 3) {
+            __Pyx_XGIVEREF(__pyx_t_15);
+            __Pyx_XGIVEREF(__pyx_t_14);
+            __Pyx_XGIVEREF(__pyx_t_13);
+            __Pyx_ExceptionReset(__pyx_t_15, __pyx_t_14, __pyx_t_13);
+          }
+          __Pyx_XGIVEREF(__pyx_t_18);
+          __Pyx_XGIVEREF(__pyx_t_17);
+          __Pyx_XGIVEREF(__pyx_t_16);
+          __Pyx_ErrRestore(__pyx_t_18, __pyx_t_17, __pyx_t_16);
+          __pyx_t_18 = 0; __pyx_t_17 = 0; __pyx_t_16 = 0; __pyx_t_15 = 0; __pyx_t_14 = 0; __pyx_t_13 = 0;
+          __pyx_lineno = __pyx_t_11; __pyx_clineno = __pyx_t_10; __pyx_filename = __pyx_t_21;
+          goto __pyx_L6_except_error;
+        }
+        __pyx_L22:;
+      }
+      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+      goto __pyx_L5_exception_handled;
+    }
+
+0732:             self.unlink(switch)
+
        __pyx_t_19 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_unlink); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 732, __pyx_L21_error)
+        __Pyx_GOTREF(__pyx_t_19);
+        __pyx_t_20 = NULL;
+        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_19))) {
+          __pyx_t_20 = PyMethod_GET_SELF(__pyx_t_19);
+          if (likely(__pyx_t_20)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_19);
+            __Pyx_INCREF(__pyx_t_20);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_19, function);
+          }
+        }
+        __pyx_t_4 = (__pyx_t_20) ? __Pyx_PyObject_Call2Args(__pyx_t_19, __pyx_t_20, __pyx_v_switch) : __Pyx_PyObject_CallOneArg(__pyx_t_19, __pyx_v_switch);
+        __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
+        if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 732, __pyx_L21_error)
+        __Pyx_GOTREF(__pyx_t_4);
+        __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
+        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+
+0733:             if ex is not t:
+
        if (unlikely(!__pyx_v_t)) { __Pyx_RaiseUnboundLocalError("t"); __PYX_ERR(0, 733, __pyx_L21_error) }
+        __pyx_t_9 = (__pyx_v_ex != __pyx_v_t);
+        __pyx_t_5 = (__pyx_t_9 != 0);
+        if (unlikely(__pyx_t_5)) {
+/* … */
+        }
+      }
+
+0734:                 raise
+
          __Pyx_GIVEREF(__pyx_t_2);
+          __Pyx_GIVEREF(__pyx_t_3);
+          __Pyx_XGIVEREF(__pyx_t_1);
+          __Pyx_ErrRestoreWithState(__pyx_t_2, __pyx_t_3, __pyx_t_1);
+          __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_1 = 0; 
+          __PYX_ERR(0, 734, __pyx_L21_error)
+
+0735:         except:
+
    /*except:*/ {
+      __Pyx_AddTraceback("gevent._greenlet.Greenlet.join", __pyx_clineno, __pyx_lineno, __pyx_filename);
+      if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_3, &__pyx_t_2) < 0) __PYX_ERR(0, 735, __pyx_L6_except_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      __Pyx_GOTREF(__pyx_t_3);
+      __Pyx_GOTREF(__pyx_t_2);
+
+0736:             self.unlink(switch)
+
      __pyx_t_19 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_unlink); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 736, __pyx_L6_except_error)
+      __Pyx_GOTREF(__pyx_t_19);
+      __pyx_t_20 = NULL;
+      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_19))) {
+        __pyx_t_20 = PyMethod_GET_SELF(__pyx_t_19);
+        if (likely(__pyx_t_20)) {
+          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_19);
+          __Pyx_INCREF(__pyx_t_20);
+          __Pyx_INCREF(function);
+          __Pyx_DECREF_SET(__pyx_t_19, function);
+        }
+      }
+      __pyx_t_4 = (__pyx_t_20) ? __Pyx_PyObject_Call2Args(__pyx_t_19, __pyx_t_20, __pyx_v_switch) : __Pyx_PyObject_CallOneArg(__pyx_t_19, __pyx_v_switch);
+      __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
+      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 736, __pyx_L6_except_error)
+      __Pyx_GOTREF(__pyx_t_4);
+      __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+
+0737:             raise
+
      __Pyx_GIVEREF(__pyx_t_1);
+      __Pyx_GIVEREF(__pyx_t_3);
+      __Pyx_XGIVEREF(__pyx_t_2);
+      __Pyx_ErrRestoreWithState(__pyx_t_1, __pyx_t_3, __pyx_t_2);
+      __pyx_t_1 = 0; __pyx_t_3 = 0; __pyx_t_2 = 0; 
+      __PYX_ERR(0, 737, __pyx_L6_except_error)
+    }
+    __pyx_L6_except_error:;
+
 0738: 
+
+0739:     def _report_result(self, result):
+
static PyObject *__pyx_f_6gevent_9_greenlet_8Greenlet__report_result(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self, PyObject *__pyx_v_result) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_report_result", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_XDECREF(__pyx_t_6);
+  __Pyx_XDECREF(__pyx_t_7);
+  __Pyx_AddTraceback("gevent._greenlet.Greenlet._report_result", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0740:         self._exc_info = (None, None, None)
+
  __Pyx_INCREF(__pyx_tuple__11);
+  __Pyx_GIVEREF(__pyx_tuple__11);
+  __Pyx_GOTREF(__pyx_v_self->_exc_info);
+  __Pyx_DECREF(__pyx_v_self->_exc_info);
+  __pyx_v_self->_exc_info = __pyx_tuple__11;
+/* … */
+  __pyx_tuple__11 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 740, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__11);
+  __Pyx_GIVEREF(__pyx_tuple__11);
+
+0741:         self.value = result
+
  __Pyx_INCREF(__pyx_v_result);
+  __Pyx_GIVEREF(__pyx_v_result);
+  __Pyx_GOTREF(__pyx_v_self->value);
+  __Pyx_DECREF(__pyx_v_self->value);
+  __pyx_v_self->value = __pyx_v_result;
+
+0742:         if self._links and not self._notifier:
+
  __pyx_t_2 = (__pyx_v_self->_links != Py_None)&&(PyList_GET_SIZE(__pyx_v_self->_links) != 0);
+  if (__pyx_t_2) {
+  } else {
+    __pyx_t_1 = __pyx_t_2;
+    goto __pyx_L4_bool_binop_done;
+  }
+  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_self->_notifier); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 742, __pyx_L1_error)
+  __pyx_t_3 = ((!__pyx_t_2) != 0);
+  __pyx_t_1 = __pyx_t_3;
+  __pyx_L4_bool_binop_done:;
+  if (__pyx_t_1) {
+/* … */
+  }
+
+0743:             self._notifier = self.parent.loop.run_callback(self._notify_links)
+
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_parent); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 743, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_5);
+    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_loop); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 743, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_6);
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_run_callback); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 743, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_5);
+    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_notify_links); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 743, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_6);
+    __pyx_t_7 = NULL;
+    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
+      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
+      if (likely(__pyx_t_7)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
+        __Pyx_INCREF(__pyx_t_7);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_5, function);
+      }
+    }
+    __pyx_t_4 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_7, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6);
+    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 743, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __Pyx_GIVEREF(__pyx_t_4);
+    __Pyx_GOTREF(__pyx_v_self->_notifier);
+    __Pyx_DECREF(__pyx_v_self->_notifier);
+    __pyx_v_self->_notifier = __pyx_t_4;
+    __pyx_t_4 = 0;
+
 0744: 
+
+0745:     def _report_error(self, exc_info):
+
static PyObject *__pyx_f_6gevent_9_greenlet_8Greenlet__report_error(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self, PyObject *__pyx_v_exc_info) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_report_error", 0);
+  __Pyx_INCREF(__pyx_v_exc_info);
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_XDECREF(__pyx_t_6);
+  __Pyx_XDECREF(__pyx_t_7);
+  __Pyx_XDECREF(__pyx_t_8);
+  __Pyx_AddTraceback("gevent._greenlet.Greenlet._report_error", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_exc_info);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0746:         if isinstance(exc_info[1], GreenletExit):
+
  if (unlikely(__pyx_v_exc_info == Py_None)) {
+    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
+    __PYX_ERR(0, 746, __pyx_L1_error)
+  }
+  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v_exc_info, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 746, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = __pyx_v_6gevent_9_greenlet_GreenletExit;
+  __Pyx_INCREF(__pyx_t_2);
+  __pyx_t_3 = PyObject_IsInstance(__pyx_t_1, __pyx_t_2); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 746, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_4 = (__pyx_t_3 != 0);
+  if (__pyx_t_4) {
+/* … */
+  }
+
+0747:             self._report_result(exc_info[1])
+
    if (unlikely(__pyx_v_exc_info == Py_None)) {
+      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
+      __PYX_ERR(0, 747, __pyx_L1_error)
+    }
+    __pyx_t_2 = __Pyx_GetItemInt_Tuple(__pyx_v_exc_info, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 747, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_9_greenlet_Greenlet *)__pyx_v_self->__pyx_vtab)->_report_result(__pyx_v_self, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 747, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+0748:             return
+
    __Pyx_XDECREF(__pyx_r);
+    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+    goto __pyx_L0;
+
 0749: 
+
+0750:         self._exc_info = exc_info[0], exc_info[1], dump_traceback(exc_info[2])
+
  if (unlikely(__pyx_v_exc_info == Py_None)) {
+    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
+    __PYX_ERR(0, 750, __pyx_L1_error)
+  }
+  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v_exc_info, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 750, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (unlikely(__pyx_v_exc_info == Py_None)) {
+    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
+    __PYX_ERR(0, 750, __pyx_L1_error)
+  }
+  __pyx_t_2 = __Pyx_GetItemInt_Tuple(__pyx_v_exc_info, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 750, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (unlikely(__pyx_v_exc_info == Py_None)) {
+    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
+    __PYX_ERR(0, 750, __pyx_L1_error)
+  }
+  __pyx_t_6 = __Pyx_GetItemInt_Tuple(__pyx_v_exc_info, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 750, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  __Pyx_INCREF(__pyx_v_6gevent_9_greenlet_dump_traceback);
+  __pyx_t_7 = __pyx_v_6gevent_9_greenlet_dump_traceback; __pyx_t_8 = NULL;
+  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
+    __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
+    if (likely(__pyx_t_8)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
+      __Pyx_INCREF(__pyx_t_8);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_7, function);
+    }
+  }
+  __pyx_t_5 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_8, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6);
+  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 750, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_5);
+  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 750, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_7);
+  __Pyx_GIVEREF(__pyx_t_1);
+  PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_2);
+  PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_2);
+  __Pyx_GIVEREF(__pyx_t_5);
+  PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_5);
+  __pyx_t_1 = 0;
+  __pyx_t_2 = 0;
+  __pyx_t_5 = 0;
+  __Pyx_GIVEREF(__pyx_t_7);
+  __Pyx_GOTREF(__pyx_v_self->_exc_info);
+  __Pyx_DECREF(__pyx_v_self->_exc_info);
+  __pyx_v_self->_exc_info = ((PyObject*)__pyx_t_7);
+  __pyx_t_7 = 0;
+
 0751: 
+
+0752:         if self._links and not self._notifier:
+
  __pyx_t_3 = (__pyx_v_self->_links != Py_None)&&(PyList_GET_SIZE(__pyx_v_self->_links) != 0);
+  if (__pyx_t_3) {
+  } else {
+    __pyx_t_4 = __pyx_t_3;
+    goto __pyx_L5_bool_binop_done;
+  }
+  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_self->_notifier); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 752, __pyx_L1_error)
+  __pyx_t_9 = ((!__pyx_t_3) != 0);
+  __pyx_t_4 = __pyx_t_9;
+  __pyx_L5_bool_binop_done:;
+  if (__pyx_t_4) {
+/* … */
+  }
+
+0753:             self._notifier = self.parent.loop.run_callback(self._notify_links)
+
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_parent); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 753, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_5);
+    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_loop); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 753, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_run_callback); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 753, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_5);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_notify_links); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 753, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_1 = NULL;
+    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
+      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_5);
+      if (likely(__pyx_t_1)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
+        __Pyx_INCREF(__pyx_t_1);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_5, function);
+      }
+    }
+    __pyx_t_7 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_1, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_2);
+    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 753, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_7);
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __Pyx_GIVEREF(__pyx_t_7);
+    __Pyx_GOTREF(__pyx_v_self->_notifier);
+    __Pyx_DECREF(__pyx_v_self->_notifier);
+    __pyx_v_self->_notifier = __pyx_t_7;
+    __pyx_t_7 = 0;
+
 0754: 
+
+0755:         try:
+
  /*try:*/ {
+
+0756:             self.parent.handle_error(self, *exc_info)
+
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_parent); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 756, __pyx_L8_error)
+    __Pyx_GOTREF(__pyx_t_7);
+    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_handle_error); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 756, __pyx_L8_error)
+    __Pyx_GOTREF(__pyx_t_5);
+    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+    __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 756, __pyx_L8_error)
+    __Pyx_GOTREF(__pyx_t_7);
+    __Pyx_INCREF(((PyObject *)__pyx_v_self));
+    __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
+    PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)__pyx_v_self));
+    if (unlikely(__pyx_v_exc_info == Py_None)) {
+      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
+      __PYX_ERR(0, 756, __pyx_L8_error)
+    }
+    __pyx_t_2 = PyNumber_Add(__pyx_t_7, __pyx_v_exc_info); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 756, __pyx_L8_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+    __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_2, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 756, __pyx_L8_error)
+    __Pyx_GOTREF(__pyx_t_7);
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  }
+
 0757:         finally:
+
+0758:             del exc_info
+
  /*finally:*/ {
+    /*normal exit:*/{
+      __Pyx_DECREF(__pyx_v_exc_info);
+      __pyx_v_exc_info = NULL;
+      goto __pyx_L9;
+    }
+    __pyx_L8_error:;
+    /*exception exit:*/{
+      __Pyx_PyThreadState_declare
+      __Pyx_PyThreadState_assign
+      __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0;
+      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
+      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+      if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18);
+      if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15) < 0)) __Pyx_ErrFetch(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15);
+      __Pyx_XGOTREF(__pyx_t_13);
+      __Pyx_XGOTREF(__pyx_t_14);
+      __Pyx_XGOTREF(__pyx_t_15);
+      __Pyx_XGOTREF(__pyx_t_16);
+      __Pyx_XGOTREF(__pyx_t_17);
+      __Pyx_XGOTREF(__pyx_t_18);
+      __pyx_t_10 = __pyx_lineno; __pyx_t_11 = __pyx_clineno; __pyx_t_12 = __pyx_filename;
+      {
+        __Pyx_DECREF(__pyx_v_exc_info);
+        __pyx_v_exc_info = NULL;
+      }
+      if (PY_MAJOR_VERSION >= 3) {
+        __Pyx_XGIVEREF(__pyx_t_16);
+        __Pyx_XGIVEREF(__pyx_t_17);
+        __Pyx_XGIVEREF(__pyx_t_18);
+        __Pyx_ExceptionReset(__pyx_t_16, __pyx_t_17, __pyx_t_18);
+      }
+      __Pyx_XGIVEREF(__pyx_t_13);
+      __Pyx_XGIVEREF(__pyx_t_14);
+      __Pyx_XGIVEREF(__pyx_t_15);
+      __Pyx_ErrRestore(__pyx_t_13, __pyx_t_14, __pyx_t_15);
+      __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0;
+      __pyx_lineno = __pyx_t_10; __pyx_clineno = __pyx_t_11; __pyx_filename = __pyx_t_12;
+      goto __pyx_L1_error;
+    }
+    __pyx_L9:;
+  }
+
 0759: 
+
+0760:     def run(self):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_39run(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6gevent_9_greenlet_8Greenlet_38run[] = "Greenlet.run(self)";
+static PyMethodDef __pyx_mdef_6gevent_9_greenlet_8Greenlet_39run = {"run", (PyCFunction)__pyx_pw_6gevent_9_greenlet_8Greenlet_39run, METH_NOARGS, __pyx_doc_6gevent_9_greenlet_8Greenlet_38run};
+static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_39run(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("run (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_9_greenlet_8Greenlet_38run(((struct __pyx_obj_6gevent_9_greenlet_Greenlet *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_38run(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self) {
+  PyObject *__pyx_v_result = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("run", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_XDECREF(__pyx_t_6);
+  __Pyx_XDECREF(__pyx_t_7);
+  __Pyx_XDECREF(__pyx_t_8);
+  __Pyx_XDECREF(__pyx_t_9);
+  __Pyx_AddTraceback("gevent._greenlet.Greenlet.run", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_result);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__55 = PyTuple_Pack(2, __pyx_n_s_self_2, __pyx_n_s_result); if (unlikely(!__pyx_tuple__55)) __PYX_ERR(0, 760, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__55);
+  __Pyx_GIVEREF(__pyx_tuple__55);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_9_greenlet_8Greenlet_39run, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Greenlet_run, NULL, __pyx_n_s_gevent__greenlet, __pyx_d, ((PyObject *)__pyx_codeobj__56)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 760, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet->tp_dict, __pyx_n_s_run, __pyx_t_2) < 0) __PYX_ERR(0, 760, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_9_greenlet_Greenlet);
+  __pyx_codeobj__56 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__55, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_greenlet_py, __pyx_n_s_run, 760, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__56)) __PYX_ERR(0, 760, __pyx_L1_error)
+
+0761:         try:
+
  /*try:*/ {
+
+0762:             self.__cancel_start()
+
    __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_9_greenlet_Greenlet *)__pyx_v_self->__pyx_vtab)->__pyx___cancel_start(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 762, __pyx_L4_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+0763:             self._start_event = _start_completed_event
+
    __Pyx_INCREF(((PyObject *)__pyx_v_6gevent_9_greenlet__start_completed_event));
+    __Pyx_GIVEREF(((PyObject *)__pyx_v_6gevent_9_greenlet__start_completed_event));
+    __Pyx_GOTREF(__pyx_v_self->_start_event);
+    __Pyx_DECREF(__pyx_v_self->_start_event);
+    __pyx_v_self->_start_event = ((PyObject *)__pyx_v_6gevent_9_greenlet__start_completed_event);
+
 0764: 
+
+0765:             try:
+
    {
+      /*try:*/ {
+/* … */
+      }
+      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+      goto __pyx_L11_try_end;
+      __pyx_L6_error:;
+      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+/* … */
+      __Pyx_XGIVEREF(__pyx_t_2);
+      __Pyx_XGIVEREF(__pyx_t_3);
+      __Pyx_XGIVEREF(__pyx_t_4);
+      __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
+      goto __pyx_L4_error;
+      __pyx_L9_except_return:;
+      __Pyx_XGIVEREF(__pyx_t_2);
+      __Pyx_XGIVEREF(__pyx_t_3);
+      __Pyx_XGIVEREF(__pyx_t_4);
+      __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
+      goto __pyx_L3_return;
+      __pyx_L11_try_end:;
+    }
+
+0766:                 result = self._run(*self.args, **self.kwargs)
+
        __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_run_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 766, __pyx_L6_error)
+        __Pyx_GOTREF(__pyx_t_1);
+        if (unlikely(__pyx_v_self->args == Py_None)) {
+          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
+          __PYX_ERR(0, 766, __pyx_L6_error)
+        }
+        if (unlikely(__pyx_v_self->kwargs == Py_None)) {
+          PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType");
+          __PYX_ERR(0, 766, __pyx_L6_error)
+        }
+        __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_v_self->args, __pyx_v_self->kwargs); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 766, __pyx_L6_error)
+        __Pyx_GOTREF(__pyx_t_5);
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        __pyx_v_result = __pyx_t_5;
+        __pyx_t_5 = 0;
+
+0767:             except: # pylint:disable=bare-except
+
      /*except:*/ {
+        __Pyx_AddTraceback("gevent._greenlet.Greenlet.run", __pyx_clineno, __pyx_lineno, __pyx_filename);
+        if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_1, &__pyx_t_6) < 0) __PYX_ERR(0, 767, __pyx_L8_except_error)
+        __Pyx_GOTREF(__pyx_t_5);
+        __Pyx_GOTREF(__pyx_t_1);
+        __Pyx_GOTREF(__pyx_t_6);
+
+0768:                 self._report_error(sys_exc_info())
+
        __Pyx_INCREF(__pyx_v_6gevent_9_greenlet_sys_exc_info);
+        __pyx_t_8 = __pyx_v_6gevent_9_greenlet_sys_exc_info; __pyx_t_9 = NULL;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
+          __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8);
+          if (likely(__pyx_t_9)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
+            __Pyx_INCREF(__pyx_t_9);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_8, function);
+          }
+        }
+        __pyx_t_7 = (__pyx_t_9) ? __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_9) : __Pyx_PyObject_CallNoArg(__pyx_t_8);
+        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
+        if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 768, __pyx_L8_except_error)
+        __Pyx_GOTREF(__pyx_t_7);
+        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+        if (!(likely(PyTuple_CheckExact(__pyx_t_7))||((__pyx_t_7) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_7)->tp_name), 0))) __PYX_ERR(0, 768, __pyx_L8_except_error)
+        __pyx_t_8 = ((struct __pyx_vtabstruct_6gevent_9_greenlet_Greenlet *)__pyx_v_self->__pyx_vtab)->_report_error(__pyx_v_self, ((PyObject*)__pyx_t_7)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 768, __pyx_L8_except_error)
+        __Pyx_GOTREF(__pyx_t_8);
+        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+
+0769:                 return
+
        __Pyx_XDECREF(__pyx_r);
+        __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+        goto __pyx_L9_except_return;
+      }
+      __pyx_L8_except_error:;
+
+0770:             self._report_result(result)
+
    __pyx_t_6 = ((struct __pyx_vtabstruct_6gevent_9_greenlet_Greenlet *)__pyx_v_self->__pyx_vtab)->_report_result(__pyx_v_self, __pyx_v_result); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 770, __pyx_L4_error)
+    __Pyx_GOTREF(__pyx_t_6);
+    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  }
+
 0771:         finally:
+
+0772:             self.__dict__.pop('_run', None)
+
  /*finally:*/ {
+    /*normal exit:*/{
+      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_dict); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 772, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_6);
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_pop); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 772, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+      __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 772, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_6);
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+/* … */
+        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_dict); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 772, __pyx_L15_error)
+        __Pyx_GOTREF(__pyx_t_6);
+        __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_pop); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 772, __pyx_L15_error)
+        __Pyx_GOTREF(__pyx_t_1);
+        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+        __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 772, __pyx_L15_error)
+        __Pyx_GOTREF(__pyx_t_6);
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+/* … */
+      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_dict); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 772, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_6);
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_pop); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 772, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+      __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 772, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_6);
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+/* … */
+  __pyx_tuple__12 = PyTuple_Pack(2, __pyx_n_s_run_2, Py_None); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 772, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__12);
+  __Pyx_GIVEREF(__pyx_tuple__12);
+
+0773:             self.args = ()
+
      __Pyx_INCREF(__pyx_empty_tuple);
+      __Pyx_GIVEREF(__pyx_empty_tuple);
+      __Pyx_GOTREF(__pyx_v_self->args);
+      __Pyx_DECREF(__pyx_v_self->args);
+      __pyx_v_self->args = __pyx_empty_tuple;
+/* … */
+        __Pyx_INCREF(__pyx_empty_tuple);
+        __Pyx_GIVEREF(__pyx_empty_tuple);
+        __Pyx_GOTREF(__pyx_v_self->args);
+        __Pyx_DECREF(__pyx_v_self->args);
+        __pyx_v_self->args = __pyx_empty_tuple;
+/* … */
+      __Pyx_INCREF(__pyx_empty_tuple);
+      __Pyx_GIVEREF(__pyx_empty_tuple);
+      __Pyx_GOTREF(__pyx_v_self->args);
+      __Pyx_DECREF(__pyx_v_self->args);
+      __pyx_v_self->args = __pyx_empty_tuple;
+
+0774:             self.kwargs.clear()
+
      if (unlikely(__pyx_v_self->kwargs == Py_None)) {
+        PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "clear");
+        __PYX_ERR(0, 774, __pyx_L1_error)
+      }
+      __pyx_t_10 = __Pyx_PyDict_Clear(__pyx_v_self->kwargs); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(0, 774, __pyx_L1_error)
+      goto __pyx_L5;
+    }
+    __pyx_L4_error:;
+    /*exception exit:*/{
+      __Pyx_PyThreadState_declare
+      __Pyx_PyThreadState_assign
+      __pyx_t_4 = 0; __pyx_t_3 = 0; __pyx_t_2 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0;
+      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
+      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
+      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+      if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_14, &__pyx_t_15, &__pyx_t_16);
+      if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_4, &__pyx_t_3, &__pyx_t_2) < 0)) __Pyx_ErrFetch(&__pyx_t_4, &__pyx_t_3, &__pyx_t_2);
+      __Pyx_XGOTREF(__pyx_t_4);
+      __Pyx_XGOTREF(__pyx_t_3);
+      __Pyx_XGOTREF(__pyx_t_2);
+      __Pyx_XGOTREF(__pyx_t_14);
+      __Pyx_XGOTREF(__pyx_t_15);
+      __Pyx_XGOTREF(__pyx_t_16);
+      __pyx_t_11 = __pyx_lineno; __pyx_t_12 = __pyx_clineno; __pyx_t_13 = __pyx_filename;
+      {
+/* … */
+        if (unlikely(__pyx_v_self->kwargs == Py_None)) {
+          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "clear");
+          __PYX_ERR(0, 774, __pyx_L15_error)
+        }
+        __pyx_t_10 = __Pyx_PyDict_Clear(__pyx_v_self->kwargs); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(0, 774, __pyx_L15_error)
+      }
+      if (PY_MAJOR_VERSION >= 3) {
+        __Pyx_XGIVEREF(__pyx_t_14);
+        __Pyx_XGIVEREF(__pyx_t_15);
+        __Pyx_XGIVEREF(__pyx_t_16);
+        __Pyx_ExceptionReset(__pyx_t_14, __pyx_t_15, __pyx_t_16);
+      }
+      __Pyx_XGIVEREF(__pyx_t_4);
+      __Pyx_XGIVEREF(__pyx_t_3);
+      __Pyx_XGIVEREF(__pyx_t_2);
+      __Pyx_ErrRestore(__pyx_t_4, __pyx_t_3, __pyx_t_2);
+      __pyx_t_4 = 0; __pyx_t_3 = 0; __pyx_t_2 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0;
+      __pyx_lineno = __pyx_t_11; __pyx_clineno = __pyx_t_12; __pyx_filename = __pyx_t_13;
+      goto __pyx_L1_error;
+      __pyx_L15_error:;
+      if (PY_MAJOR_VERSION >= 3) {
+        __Pyx_XGIVEREF(__pyx_t_14);
+        __Pyx_XGIVEREF(__pyx_t_15);
+        __Pyx_XGIVEREF(__pyx_t_16);
+        __Pyx_ExceptionReset(__pyx_t_14, __pyx_t_15, __pyx_t_16);
+      }
+      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+      __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0;
+      goto __pyx_L1_error;
+    }
+    __pyx_L3_return: {
+      __pyx_t_16 = __pyx_r;
+      __pyx_r = 0;
+/* … */
+      if (unlikely(__pyx_v_self->kwargs == Py_None)) {
+        PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "clear");
+        __PYX_ERR(0, 774, __pyx_L1_error)
+      }
+      __pyx_t_10 = __Pyx_PyDict_Clear(__pyx_v_self->kwargs); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(0, 774, __pyx_L1_error)
+      __pyx_r = __pyx_t_16;
+      __pyx_t_16 = 0;
+      goto __pyx_L0;
+    }
+    __pyx_L5:;
+  }
+
 0775: 
+
+0776:     def _run(self):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_41_run(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6gevent_9_greenlet_8Greenlet_40_run[] = "Greenlet._run(self)\n\n        Subclasses may override this method to take any number of\n        arguments and keyword arguments.\n\n        .. versionadded:: 1.1a3\n            Previously, if no callable object was\n            passed to the constructor, the spawned greenlet would later\n            fail with an AttributeError.\n        ";
+static PyMethodDef __pyx_mdef_6gevent_9_greenlet_8Greenlet_41_run = {"_run", (PyCFunction)__pyx_pw_6gevent_9_greenlet_8Greenlet_41_run, METH_NOARGS, __pyx_doc_6gevent_9_greenlet_8Greenlet_40_run};
+static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_41_run(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_run (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_9_greenlet_8Greenlet_40_run(((struct __pyx_obj_6gevent_9_greenlet_Greenlet *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_40_run(CYTHON_UNUSED struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_run", 0);
+/* … */
+  /* function exit code */
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__57 = PyTuple_Pack(1, __pyx_n_s_self_2); if (unlikely(!__pyx_tuple__57)) __PYX_ERR(0, 776, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__57);
+  __Pyx_GIVEREF(__pyx_tuple__57);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_9_greenlet_8Greenlet_41_run, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Greenlet__run, NULL, __pyx_n_s_gevent__greenlet, __pyx_d, ((PyObject *)__pyx_codeobj__58)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 776, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet->tp_dict, __pyx_n_s_run_2, __pyx_t_2) < 0) __PYX_ERR(0, 776, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_9_greenlet_Greenlet);
+  __pyx_codeobj__58 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__57, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_greenlet_py, __pyx_n_s_run_2, 776, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__58)) __PYX_ERR(0, 776, __pyx_L1_error)
+
 0777:         """
+
 0778:         Subclasses may override this method to take any number of
+
 0779:         arguments and keyword arguments.
+
 0780: 
+
 0781:         .. versionadded:: 1.1a3
+
 0782:             Previously, if no callable object was
+
 0783:             passed to the constructor, the spawned greenlet would later
+
 0784:             fail with an AttributeError.
+
 0785:         """
+
 0786:         # We usually override this in __init__
+
 0787:         # pylint: disable=method-hidden
+
+0788:         return
+
  __Pyx_XDECREF(__pyx_r);
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+
 0789: 
+
+0790:     def has_links(self):
+
static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_43has_links(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static int __pyx_f_6gevent_9_greenlet_8Greenlet_has_links(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self, int __pyx_skip_dispatch) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("has_links", 0);
+  /* Check if called by wrapper */
+  if (unlikely(__pyx_skip_dispatch)) ;
+  /* Check if overridden in Python */
+  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
+    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
+    if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
+    else {
+      PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      #endif
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_has_links); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 790, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_9_greenlet_8Greenlet_43has_links)) {
+        __Pyx_INCREF(__pyx_t_1);
+        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+          if (likely(__pyx_t_4)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+            __Pyx_INCREF(__pyx_t_4);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_3, function);
+          }
+        }
+        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
+        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 790, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 790, __pyx_L1_error)
+        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+        __pyx_r = __pyx_t_5;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        goto __pyx_L0;
+      }
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+      tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
+      if (unlikely(type_dict_guard != tp_dict_version)) {
+        tp_dict_version = obj_dict_version = 0;
+      }
+      #endif
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    }
+    #endif
+  }
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_WriteUnraisable("gevent._greenlet.Greenlet.has_links", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_43has_links(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6gevent_9_greenlet_8Greenlet_42has_links[] = "Greenlet.has_links(self) -> bool";
+static PyMethodDef __pyx_mdef_6gevent_9_greenlet_8Greenlet_43has_links = {"has_links", (PyCFunction)__pyx_pw_6gevent_9_greenlet_8Greenlet_43has_links, METH_NOARGS, __pyx_doc_6gevent_9_greenlet_8Greenlet_42has_links};
+static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_43has_links(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("has_links (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_9_greenlet_8Greenlet_42has_links(((struct __pyx_obj_6gevent_9_greenlet_Greenlet *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_42has_links(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("has_links", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_f_6gevent_9_greenlet_8Greenlet_has_links(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 790, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent._greenlet.Greenlet.has_links", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__59 = PyTuple_Pack(1, __pyx_n_s_self_2); if (unlikely(!__pyx_tuple__59)) __PYX_ERR(0, 790, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__59);
+  __Pyx_GIVEREF(__pyx_tuple__59);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_9_greenlet_8Greenlet_43has_links, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Greenlet_has_links, NULL, __pyx_n_s_gevent__greenlet, __pyx_d, ((PyObject *)__pyx_codeobj__60)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 790, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet->tp_dict, __pyx_n_s_has_links, __pyx_t_2) < 0) __PYX_ERR(0, 790, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_9_greenlet_Greenlet);
+  __pyx_codeobj__60 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__59, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_greenlet_py, __pyx_n_s_has_links, 790, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__60)) __PYX_ERR(0, 790, __pyx_L1_error)
+
+0791:         return len(self._links)
+
  __pyx_t_1 = __pyx_v_self->_links;
+  __Pyx_INCREF(__pyx_t_1);
+  if (unlikely(__pyx_t_1 == Py_None)) {
+    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
+    __PYX_ERR(0, 791, __pyx_L1_error)
+  }
+  __pyx_t_6 = PyList_GET_SIZE(__pyx_t_1); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 791, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_r = __pyx_t_6;
+  goto __pyx_L0;
+
 0792: 
+
+0793:     def rawlink(self, callback):
+
static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_45rawlink(PyObject *__pyx_v_self, PyObject *__pyx_v_callback); /*proto*/
+static PyObject *__pyx_f_6gevent_9_greenlet_8Greenlet_rawlink(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self, PyObject *__pyx_v_callback, int __pyx_skip_dispatch) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("rawlink", 0);
+  /* Check if called by wrapper */
+  if (unlikely(__pyx_skip_dispatch)) ;
+  /* Check if overridden in Python */
+  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
+    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
+    if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
+    else {
+      PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      #endif
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_rawlink); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 793, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_9_greenlet_8Greenlet_45rawlink)) {
+        __Pyx_XDECREF(__pyx_r);
+        __Pyx_INCREF(__pyx_t_1);
+        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+          if (likely(__pyx_t_4)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+            __Pyx_INCREF(__pyx_t_4);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_3, function);
+          }
+        }
+        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_callback) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_callback);
+        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 793, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __pyx_r = __pyx_t_2;
+        __pyx_t_2 = 0;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        goto __pyx_L0;
+      }
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+      tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
+      if (unlikely(type_dict_guard != tp_dict_version)) {
+        tp_dict_version = obj_dict_version = 0;
+      }
+      #endif
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    }
+    #endif
+  }
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_AddTraceback("gevent._greenlet.Greenlet.rawlink", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_45rawlink(PyObject *__pyx_v_self, PyObject *__pyx_v_callback); /*proto*/
+static char __pyx_doc_6gevent_9_greenlet_8Greenlet_44rawlink[] = "Greenlet.rawlink(self, callback)\n\n        Register a callable to be executed when the greenlet finishes\n        execution.\n\n        The *callback* will be called with this instance as an\n        argument.\n\n        .. caution:: The callable will be called in the HUB greenlet.\n        ";
+static PyMethodDef __pyx_mdef_6gevent_9_greenlet_8Greenlet_45rawlink = {"rawlink", (PyCFunction)__pyx_pw_6gevent_9_greenlet_8Greenlet_45rawlink, METH_O, __pyx_doc_6gevent_9_greenlet_8Greenlet_44rawlink};
+static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_45rawlink(PyObject *__pyx_v_self, PyObject *__pyx_v_callback) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("rawlink (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_9_greenlet_8Greenlet_44rawlink(((struct __pyx_obj_6gevent_9_greenlet_Greenlet *)__pyx_v_self), ((PyObject *)__pyx_v_callback));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_44rawlink(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self, PyObject *__pyx_v_callback) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("rawlink", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __pyx_f_6gevent_9_greenlet_8Greenlet_rawlink(__pyx_v_self, __pyx_v_callback, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 793, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent._greenlet.Greenlet.rawlink", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__61 = PyTuple_Pack(2, __pyx_n_s_self_2, __pyx_n_s_callback); if (unlikely(!__pyx_tuple__61)) __PYX_ERR(0, 793, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__61);
+  __Pyx_GIVEREF(__pyx_tuple__61);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_9_greenlet_8Greenlet_45rawlink, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Greenlet_rawlink, NULL, __pyx_n_s_gevent__greenlet, __pyx_d, ((PyObject *)__pyx_codeobj__62)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 793, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet->tp_dict, __pyx_n_s_rawlink, __pyx_t_2) < 0) __PYX_ERR(0, 793, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_9_greenlet_Greenlet);
+  __pyx_codeobj__62 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__61, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_greenlet_py, __pyx_n_s_rawlink, 793, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__62)) __PYX_ERR(0, 793, __pyx_L1_error)
+
 0794:         """
+
 0795:         Register a callable to be executed when the greenlet finishes
+
 0796:         execution.
+
 0797: 
+
 0798:         The *callback* will be called with this instance as an
+
 0799:         argument.
+
 0800: 
+
 0801:         .. caution:: The callable will be called in the HUB greenlet.
+
 0802:         """
+
+0803:         if not callable(callback):
+
  __pyx_t_5 = __Pyx_PyCallable_Check(__pyx_v_callback); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 803, __pyx_L1_error)
+  __pyx_t_6 = ((!(__pyx_t_5 != 0)) != 0);
+  if (unlikely(__pyx_t_6)) {
+/* … */
+  }
+
+0804:             raise TypeError('Expected callable: %r' % (callback, ))
+
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 804, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_INCREF(__pyx_v_callback);
+    __Pyx_GIVEREF(__pyx_v_callback);
+    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_callback);
+    __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_Expected_callable_r, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 804, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 804, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __PYX_ERR(0, 804, __pyx_L1_error)
+
+0805:         self._links.append(callback) # pylint:disable=no-member
+
  if (unlikely(__pyx_v_self->_links == Py_None)) {
+    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "append");
+    __PYX_ERR(0, 805, __pyx_L1_error)
+  }
+  __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_self->_links, __pyx_v_callback); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 805, __pyx_L1_error)
+
+0806:         if self.ready() and self._links and not self._notifier:
+
  __pyx_t_5 = (((struct __pyx_vtabstruct_6gevent_9_greenlet_Greenlet *)__pyx_v_self->__pyx_vtab)->ready(__pyx_v_self, 0) != 0);
+  if (__pyx_t_5) {
+  } else {
+    __pyx_t_6 = __pyx_t_5;
+    goto __pyx_L5_bool_binop_done;
+  }
+  __pyx_t_5 = (__pyx_v_self->_links != Py_None)&&(PyList_GET_SIZE(__pyx_v_self->_links) != 0);
+  if (__pyx_t_5) {
+  } else {
+    __pyx_t_6 = __pyx_t_5;
+    goto __pyx_L5_bool_binop_done;
+  }
+  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_self->_notifier); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 806, __pyx_L1_error)
+  __pyx_t_8 = ((!__pyx_t_5) != 0);
+  __pyx_t_6 = __pyx_t_8;
+  __pyx_L5_bool_binop_done:;
+  if (__pyx_t_6) {
+/* … */
+  }
+
+0807:             self._notifier = self.parent.loop.run_callback(self._notify_links)
+
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_parent); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 807, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_loop); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 807, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_run_callback); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 807, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_notify_links); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 807, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __pyx_t_4 = NULL;
+    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
+      if (likely(__pyx_t_4)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+        __Pyx_INCREF(__pyx_t_4);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_2, function);
+      }
+    }
+    __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
+    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 807, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __Pyx_GIVEREF(__pyx_t_1);
+    __Pyx_GOTREF(__pyx_v_self->_notifier);
+    __Pyx_DECREF(__pyx_v_self->_notifier);
+    __pyx_v_self->_notifier = __pyx_t_1;
+    __pyx_t_1 = 0;
+
 0808: 
+
+0809:     def link(self, callback, SpawnedLink=SpawnedLink):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_47link(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_6gevent_9_greenlet_8Greenlet_46link[] = "Greenlet.link(self, callback, SpawnedLink=SpawnedLink)\n\n        Link greenlet's completion to a callable.\n\n        The *callback* will be called with this instance as an\n        argument once this greenlet is dead. A callable is called in\n        its own :class:`greenlet.greenlet` (*not* a\n        :class:`Greenlet`).\n        ";
+static PyMethodDef __pyx_mdef_6gevent_9_greenlet_8Greenlet_47link = {"link", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_9_greenlet_8Greenlet_47link, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_9_greenlet_8Greenlet_46link};
+static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_47link(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_callback = 0;
+  PyObject *__pyx_v_SpawnedLink = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("link (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_callback,&__pyx_n_s_SpawnedLink,0};
+    PyObject* values[2] = {0,0};
+    values[1] = __pyx_k__13;
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_callback)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_SpawnedLink);
+          if (value) { values[1] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "link") < 0)) __PYX_ERR(0, 809, __pyx_L3_error)
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    __pyx_v_callback = values[0];
+    __pyx_v_SpawnedLink = values[1];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("link", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 809, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent._greenlet.Greenlet.link", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_9_greenlet_8Greenlet_46link(((struct __pyx_obj_6gevent_9_greenlet_Greenlet *)__pyx_v_self), __pyx_v_callback, __pyx_v_SpawnedLink);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_46link(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self, PyObject *__pyx_v_callback, PyObject *__pyx_v_SpawnedLink) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("link", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_AddTraceback("gevent._greenlet.Greenlet.link", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __Pyx_INCREF(((PyObject *)__pyx_ptype_6gevent_9_greenlet_SpawnedLink));
+  __pyx_k__13 = ((PyObject *)__pyx_ptype_6gevent_9_greenlet_SpawnedLink);
+  __Pyx_GIVEREF(__pyx_ptype_6gevent_9_greenlet_SpawnedLink);
+/* … */
+  __pyx_tuple__63 = PyTuple_Pack(3, __pyx_n_s_self_2, __pyx_n_s_callback, __pyx_n_s_SpawnedLink); if (unlikely(!__pyx_tuple__63)) __PYX_ERR(0, 809, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__63);
+  __Pyx_GIVEREF(__pyx_tuple__63);
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_9_greenlet_8Greenlet_47link, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Greenlet_link, NULL, __pyx_n_s_gevent__greenlet, __pyx_d, ((PyObject *)__pyx_codeobj__64)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 809, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet->tp_dict, __pyx_n_s_link, __pyx_t_2) < 0) __PYX_ERR(0, 809, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_9_greenlet_Greenlet);
+  __pyx_codeobj__64 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__63, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_greenlet_py, __pyx_n_s_link, 809, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__64)) __PYX_ERR(0, 809, __pyx_L1_error)
+
 0810:         """
+
 0811:         Link greenlet's completion to a callable.
+
 0812: 
+
 0813:         The *callback* will be called with this instance as an
+
 0814:         argument once this greenlet is dead. A callable is called in
+
 0815:         its own :class:`greenlet.greenlet` (*not* a
+
 0816:         :class:`Greenlet`).
+
 0817:         """
+
 0818:         # XXX: Is the redefinition of SpawnedLink supposed to just be an
+
 0819:         # optimization, or do people use it? It's not documented
+
 0820:         # pylint:disable=redefined-outer-name
+
+0821:         self.rawlink(SpawnedLink(callback))
+
  __Pyx_INCREF(__pyx_v_SpawnedLink);
+  __pyx_t_2 = __pyx_v_SpawnedLink; __pyx_t_3 = NULL;
+  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
+    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+    if (likely(__pyx_t_3)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+      __Pyx_INCREF(__pyx_t_3);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_2, function);
+    }
+  }
+  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_callback) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_callback);
+  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 821, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_2 = ((struct __pyx_vtabstruct_6gevent_9_greenlet_Greenlet *)__pyx_v_self->__pyx_vtab)->rawlink(__pyx_v_self, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 821, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
 0822: 
+
+0823:     def unlink(self, callback):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_49unlink(PyObject *__pyx_v_self, PyObject *__pyx_v_callback); /*proto*/
+static char __pyx_doc_6gevent_9_greenlet_8Greenlet_48unlink[] = "Greenlet.unlink(self, callback)\nRemove the callback set by :meth:`link` or :meth:`rawlink`";
+static PyMethodDef __pyx_mdef_6gevent_9_greenlet_8Greenlet_49unlink = {"unlink", (PyCFunction)__pyx_pw_6gevent_9_greenlet_8Greenlet_49unlink, METH_O, __pyx_doc_6gevent_9_greenlet_8Greenlet_48unlink};
+static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_49unlink(PyObject *__pyx_v_self, PyObject *__pyx_v_callback) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("unlink (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_9_greenlet_8Greenlet_48unlink(((struct __pyx_obj_6gevent_9_greenlet_Greenlet *)__pyx_v_self), ((PyObject *)__pyx_v_callback));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_48unlink(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self, PyObject *__pyx_v_callback) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("unlink", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_XDECREF(__pyx_t_6);
+  __Pyx_AddTraceback("gevent._greenlet.Greenlet.unlink", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__65 = PyTuple_Pack(2, __pyx_n_s_self_2, __pyx_n_s_callback); if (unlikely(!__pyx_tuple__65)) __PYX_ERR(0, 823, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__65);
+  __Pyx_GIVEREF(__pyx_tuple__65);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_9_greenlet_8Greenlet_49unlink, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Greenlet_unlink, NULL, __pyx_n_s_gevent__greenlet, __pyx_d, ((PyObject *)__pyx_codeobj__66)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 823, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet->tp_dict, __pyx_n_s_unlink, __pyx_t_2) < 0) __PYX_ERR(0, 823, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_9_greenlet_Greenlet);
+  __pyx_codeobj__66 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__65, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_greenlet_py, __pyx_n_s_unlink, 823, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__66)) __PYX_ERR(0, 823, __pyx_L1_error)
+
 0824:         """Remove the callback set by :meth:`link` or :meth:`rawlink`"""
+
+0825:         try:
+
  {
+    /*try:*/ {
+/* … */
+    }
+    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+    goto __pyx_L8_try_end;
+    __pyx_L3_error:;
+    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+/* … */
+    __Pyx_XGIVEREF(__pyx_t_1);
+    __Pyx_XGIVEREF(__pyx_t_2);
+    __Pyx_XGIVEREF(__pyx_t_3);
+    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
+    goto __pyx_L1_error;
+    __pyx_L4_exception_handled:;
+    __Pyx_XGIVEREF(__pyx_t_1);
+    __Pyx_XGIVEREF(__pyx_t_2);
+    __Pyx_XGIVEREF(__pyx_t_3);
+    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
+    __pyx_L8_try_end:;
+  }
+
+0826:             self._links.remove(callback) # pylint:disable=no-member
+
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_links, __pyx_n_s_remove); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 826, __pyx_L3_error)
+      __Pyx_GOTREF(__pyx_t_5);
+      __pyx_t_6 = NULL;
+      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
+        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
+        if (likely(__pyx_t_6)) {
+          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
+          __Pyx_INCREF(__pyx_t_6);
+          __Pyx_INCREF(function);
+          __Pyx_DECREF_SET(__pyx_t_5, function);
+        }
+      }
+      __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_v_callback) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_callback);
+      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 826, __pyx_L3_error)
+      __Pyx_GOTREF(__pyx_t_4);
+      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+
+0827:         except ValueError:
+
    __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ValueError);
+    if (__pyx_t_7) {
+      __Pyx_ErrRestore(0,0,0);
+      goto __pyx_L4_exception_handled;
+    }
+    goto __pyx_L5_except_error;
+    __pyx_L5_except_error:;
+
 0828:             pass
+
 0829: 
+
+0830:     def unlink_all(self):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_51unlink_all(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6gevent_9_greenlet_8Greenlet_50unlink_all[] = "Greenlet.unlink_all(self)\n\n        Remove all the callbacks.\n\n        .. versionadded:: 1.3a2\n        ";
+static PyMethodDef __pyx_mdef_6gevent_9_greenlet_8Greenlet_51unlink_all = {"unlink_all", (PyCFunction)__pyx_pw_6gevent_9_greenlet_8Greenlet_51unlink_all, METH_NOARGS, __pyx_doc_6gevent_9_greenlet_8Greenlet_50unlink_all};
+static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_51unlink_all(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("unlink_all (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_9_greenlet_8Greenlet_50unlink_all(((struct __pyx_obj_6gevent_9_greenlet_Greenlet *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_50unlink_all(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("unlink_all", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_AddTraceback("gevent._greenlet.Greenlet.unlink_all", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__67 = PyTuple_Pack(1, __pyx_n_s_self_2); if (unlikely(!__pyx_tuple__67)) __PYX_ERR(0, 830, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__67);
+  __Pyx_GIVEREF(__pyx_tuple__67);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_9_greenlet_8Greenlet_51unlink_all, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Greenlet_unlink_all, NULL, __pyx_n_s_gevent__greenlet, __pyx_d, ((PyObject *)__pyx_codeobj__68)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 830, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet->tp_dict, __pyx_n_s_unlink_all, __pyx_t_2) < 0) __PYX_ERR(0, 830, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_9_greenlet_Greenlet);
+  __pyx_codeobj__68 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__67, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_greenlet_py, __pyx_n_s_unlink_all, 830, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__68)) __PYX_ERR(0, 830, __pyx_L1_error)
+
 0831:         """
+
 0832:         Remove all the callbacks.
+
 0833: 
+
 0834:         .. versionadded:: 1.3a2
+
 0835:         """
+
+0836:         del self._links[:]
+
  if (unlikely(__pyx_v_self->_links == Py_None)) {
+    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
+    __PYX_ERR(0, 836, __pyx_L1_error)
+  }
+  if (__Pyx_PyObject_DelSlice(__pyx_v_self->_links, 0, 0, NULL, NULL, NULL, 0, 0, 1) < 0) __PYX_ERR(0, 836, __pyx_L1_error)
+
 0837: 
+
+0838:     def link_value(self, callback, SpawnedLink=SuccessSpawnedLink):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_53link_value(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_6gevent_9_greenlet_8Greenlet_52link_value[] = "Greenlet.link_value(self, callback, SpawnedLink=SuccessSpawnedLink)\n\n        Like :meth:`link` but *callback* is only notified when the greenlet\n        has completed successfully.\n        ";
+static PyMethodDef __pyx_mdef_6gevent_9_greenlet_8Greenlet_53link_value = {"link_value", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_9_greenlet_8Greenlet_53link_value, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_9_greenlet_8Greenlet_52link_value};
+static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_53link_value(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_callback = 0;
+  PyObject *__pyx_v_SpawnedLink = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("link_value (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_callback,&__pyx_n_s_SpawnedLink,0};
+    PyObject* values[2] = {0,0};
+    values[1] = __pyx_k__14;
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_callback)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_SpawnedLink);
+          if (value) { values[1] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "link_value") < 0)) __PYX_ERR(0, 838, __pyx_L3_error)
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    __pyx_v_callback = values[0];
+    __pyx_v_SpawnedLink = values[1];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("link_value", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 838, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent._greenlet.Greenlet.link_value", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_9_greenlet_8Greenlet_52link_value(((struct __pyx_obj_6gevent_9_greenlet_Greenlet *)__pyx_v_self), __pyx_v_callback, __pyx_v_SpawnedLink);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_52link_value(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self, PyObject *__pyx_v_callback, PyObject *__pyx_v_SpawnedLink) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("link_value", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_AddTraceback("gevent._greenlet.Greenlet.link_value", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __Pyx_INCREF(((PyObject *)__pyx_ptype_6gevent_9_greenlet_SuccessSpawnedLink));
+  __pyx_k__14 = ((PyObject *)__pyx_ptype_6gevent_9_greenlet_SuccessSpawnedLink);
+  __Pyx_GIVEREF(__pyx_ptype_6gevent_9_greenlet_SuccessSpawnedLink);
+/* … */
+  __pyx_tuple__69 = PyTuple_Pack(3, __pyx_n_s_self_2, __pyx_n_s_callback, __pyx_n_s_SpawnedLink); if (unlikely(!__pyx_tuple__69)) __PYX_ERR(0, 838, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__69);
+  __Pyx_GIVEREF(__pyx_tuple__69);
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_9_greenlet_8Greenlet_53link_value, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Greenlet_link_value, NULL, __pyx_n_s_gevent__greenlet, __pyx_d, ((PyObject *)__pyx_codeobj__70)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 838, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet->tp_dict, __pyx_n_s_link_value, __pyx_t_2) < 0) __PYX_ERR(0, 838, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_9_greenlet_Greenlet);
+  __pyx_codeobj__70 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__69, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_greenlet_py, __pyx_n_s_link_value, 838, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__70)) __PYX_ERR(0, 838, __pyx_L1_error)
+
 0839:         """
+
 0840:         Like :meth:`link` but *callback* is only notified when the greenlet
+
 0841:         has completed successfully.
+
 0842:         """
+
 0843:         # pylint:disable=redefined-outer-name
+
+0844:         self.link(callback, SpawnedLink=SpawnedLink)
+
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_link); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 844, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 844, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(__pyx_v_callback);
+  __Pyx_GIVEREF(__pyx_v_callback);
+  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_callback);
+  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 844, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_SpawnedLink, __pyx_v_SpawnedLink) < 0) __PYX_ERR(0, 844, __pyx_L1_error)
+  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 844, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_4);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+
 0845: 
+
+0846:     def link_exception(self, callback, SpawnedLink=FailureSpawnedLink):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_55link_exception(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_6gevent_9_greenlet_8Greenlet_54link_exception[] = "Greenlet.link_exception(self, callback, SpawnedLink=FailureSpawnedLink)\n\n        Like :meth:`link` but *callback* is only notified when the\n        greenlet dies because of an unhandled exception.\n        ";
+static PyMethodDef __pyx_mdef_6gevent_9_greenlet_8Greenlet_55link_exception = {"link_exception", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_9_greenlet_8Greenlet_55link_exception, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_9_greenlet_8Greenlet_54link_exception};
+static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_55link_exception(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_callback = 0;
+  PyObject *__pyx_v_SpawnedLink = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("link_exception (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_callback,&__pyx_n_s_SpawnedLink,0};
+    PyObject* values[2] = {0,0};
+    values[1] = __pyx_k__15;
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_callback)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_SpawnedLink);
+          if (value) { values[1] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "link_exception") < 0)) __PYX_ERR(0, 846, __pyx_L3_error)
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    __pyx_v_callback = values[0];
+    __pyx_v_SpawnedLink = values[1];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("link_exception", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 846, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent._greenlet.Greenlet.link_exception", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_9_greenlet_8Greenlet_54link_exception(((struct __pyx_obj_6gevent_9_greenlet_Greenlet *)__pyx_v_self), __pyx_v_callback, __pyx_v_SpawnedLink);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_54link_exception(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self, PyObject *__pyx_v_callback, PyObject *__pyx_v_SpawnedLink) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("link_exception", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_AddTraceback("gevent._greenlet.Greenlet.link_exception", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __Pyx_INCREF(((PyObject *)__pyx_ptype_6gevent_9_greenlet_FailureSpawnedLink));
+  __pyx_k__15 = ((PyObject *)__pyx_ptype_6gevent_9_greenlet_FailureSpawnedLink);
+  __Pyx_GIVEREF(__pyx_ptype_6gevent_9_greenlet_FailureSpawnedLink);
+/* … */
+  __pyx_tuple__71 = PyTuple_Pack(3, __pyx_n_s_self_2, __pyx_n_s_callback, __pyx_n_s_SpawnedLink); if (unlikely(!__pyx_tuple__71)) __PYX_ERR(0, 846, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__71);
+  __Pyx_GIVEREF(__pyx_tuple__71);
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_9_greenlet_8Greenlet_55link_exception, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Greenlet_link_exception, NULL, __pyx_n_s_gevent__greenlet, __pyx_d, ((PyObject *)__pyx_codeobj__72)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 846, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet->tp_dict, __pyx_n_s_link_exception, __pyx_t_2) < 0) __PYX_ERR(0, 846, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_9_greenlet_Greenlet);
+  __pyx_codeobj__72 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__71, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_greenlet_py, __pyx_n_s_link_exception, 846, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__72)) __PYX_ERR(0, 846, __pyx_L1_error)
+
 0847:         """
+
 0848:         Like :meth:`link` but *callback* is only notified when the
+
 0849:         greenlet dies because of an unhandled exception.
+
 0850:         """
+
 0851:         # pylint:disable=redefined-outer-name
+
+0852:         self.link(callback, SpawnedLink=SpawnedLink)
+
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_link); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 852, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 852, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(__pyx_v_callback);
+  __Pyx_GIVEREF(__pyx_v_callback);
+  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_callback);
+  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 852, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_SpawnedLink, __pyx_v_SpawnedLink) < 0) __PYX_ERR(0, 852, __pyx_L1_error)
+  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 852, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_4);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+
 0853: 
+
+0854:     def _notify_links(self):
+
static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_57_notify_links(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyObject *__pyx_f_6gevent_9_greenlet_8Greenlet__notify_links(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self, int __pyx_skip_dispatch) {
+  PyObject *__pyx_v_link = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_notify_links", 0);
+  /* Check if called by wrapper */
+  if (unlikely(__pyx_skip_dispatch)) ;
+  /* Check if overridden in Python */
+  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
+    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
+    if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
+    else {
+      PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      #endif
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_notify_links); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 854, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_9_greenlet_8Greenlet_57_notify_links)) {
+        __Pyx_XDECREF(__pyx_r);
+        __Pyx_INCREF(__pyx_t_1);
+        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+          if (likely(__pyx_t_4)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+            __Pyx_INCREF(__pyx_t_4);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_3, function);
+          }
+        }
+        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
+        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 854, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __pyx_r = __pyx_t_2;
+        __pyx_t_2 = 0;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        goto __pyx_L0;
+      }
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+      tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
+      if (unlikely(type_dict_guard != tp_dict_version)) {
+        tp_dict_version = obj_dict_version = 0;
+      }
+      #endif
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    }
+    #endif
+  }
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_9);
+  __Pyx_XDECREF(__pyx_t_10);
+  __Pyx_XDECREF(__pyx_t_11);
+  __Pyx_XDECREF(__pyx_t_12);
+  __Pyx_AddTraceback("gevent._greenlet.Greenlet._notify_links", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_link);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_57_notify_links(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6gevent_9_greenlet_8Greenlet_56_notify_links[] = "Greenlet._notify_links(self)";
+static PyMethodDef __pyx_mdef_6gevent_9_greenlet_8Greenlet_57_notify_links = {"_notify_links", (PyCFunction)__pyx_pw_6gevent_9_greenlet_8Greenlet_57_notify_links, METH_NOARGS, __pyx_doc_6gevent_9_greenlet_8Greenlet_56_notify_links};
+static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_57_notify_links(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_notify_links (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_9_greenlet_8Greenlet_56_notify_links(((struct __pyx_obj_6gevent_9_greenlet_Greenlet *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_56_notify_links(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_notify_links", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __pyx_f_6gevent_9_greenlet_8Greenlet__notify_links(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 854, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent._greenlet.Greenlet._notify_links", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__73 = PyTuple_Pack(1, __pyx_n_s_self_2); if (unlikely(!__pyx_tuple__73)) __PYX_ERR(0, 854, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__73);
+  __Pyx_GIVEREF(__pyx_tuple__73);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_9_greenlet_8Greenlet_57_notify_links, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Greenlet__notify_links, NULL, __pyx_n_s_gevent__greenlet, __pyx_d, ((PyObject *)__pyx_codeobj__74)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 854, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet->tp_dict, __pyx_n_s_notify_links, __pyx_t_2) < 0) __PYX_ERR(0, 854, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_9_greenlet_Greenlet);
+  __pyx_codeobj__74 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__73, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_greenlet_py, __pyx_n_s_notify_links, 854, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__74)) __PYX_ERR(0, 854, __pyx_L1_error)
+
+0855:         while self._links:
+
  while (1) {
+    __pyx_t_5 = (__pyx_v_self->_links != Py_None)&&(PyList_GET_SIZE(__pyx_v_self->_links) != 0);
+    if (!__pyx_t_5) break;
+
 0856:             # Early links are allowed to remove later links
+
 0857:             # before we get to them, and they're also allowed to
+
 0858:             # add new links, so we have to be careful about iterating.
+
 0859: 
+
 0860:             # We don't expect this list to be very large, so the time spent
+
 0861:             # manipulating it should be small. a deque is probably not justified.
+
 0862:             # Cython has optimizations to transform this into a memmove anyway.
+
+0863:             link = self._links.pop(0)
+
    if (unlikely(__pyx_v_self->_links == Py_None)) {
+      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "pop");
+      __PYX_ERR(0, 863, __pyx_L1_error)
+    }
+    __pyx_t_1 = __Pyx_PyList_PopIndex(__pyx_v_self->_links, __pyx_int_0, 0, 1, Py_ssize_t, PyInt_FromSsize_t); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 863, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_XDECREF_SET(__pyx_v_link, __pyx_t_1);
+    __pyx_t_1 = 0;
+
+0864:             try:
+
    {
+      /*try:*/ {
+/* … */
+      }
+      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
+      goto __pyx_L12_try_end;
+      __pyx_L5_error:;
+      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+/* … */
+      __Pyx_XGIVEREF(__pyx_t_6);
+      __Pyx_XGIVEREF(__pyx_t_7);
+      __Pyx_XGIVEREF(__pyx_t_8);
+      __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
+      goto __pyx_L1_error;
+      __pyx_L6_exception_handled:;
+      __Pyx_XGIVEREF(__pyx_t_6);
+      __Pyx_XGIVEREF(__pyx_t_7);
+      __Pyx_XGIVEREF(__pyx_t_8);
+      __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
+      __pyx_L12_try_end:;
+    }
+  }
+
+0865:                 link(self)
+
        __Pyx_INCREF(__pyx_v_link);
+        __pyx_t_2 = __pyx_v_link; __pyx_t_3 = NULL;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
+          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+          if (likely(__pyx_t_3)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+            __Pyx_INCREF(__pyx_t_3);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_2, function);
+          }
+        }
+        __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, ((PyObject *)__pyx_v_self)) : __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_v_self));
+        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+        if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 865, __pyx_L5_error)
+        __Pyx_GOTREF(__pyx_t_1);
+        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+0866:             except: # pylint:disable=bare-except
+
      /*except:*/ {
+        __Pyx_AddTraceback("gevent._greenlet.Greenlet._notify_links", __pyx_clineno, __pyx_lineno, __pyx_filename);
+        if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3) < 0) __PYX_ERR(0, 866, __pyx_L7_except_error)
+        __Pyx_GOTREF(__pyx_t_1);
+        __Pyx_GOTREF(__pyx_t_2);
+        __Pyx_GOTREF(__pyx_t_3);
+
+0867:                 self.parent.handle_error((link, self), *sys_exc_info())
+
        __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_parent); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 867, __pyx_L7_except_error)
+        __Pyx_GOTREF(__pyx_t_4);
+        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_handle_error); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 867, __pyx_L7_except_error)
+        __Pyx_GOTREF(__pyx_t_9);
+        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+        __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 867, __pyx_L7_except_error)
+        __Pyx_GOTREF(__pyx_t_4);
+        __Pyx_INCREF(__pyx_v_link);
+        __Pyx_GIVEREF(__pyx_v_link);
+        PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_link);
+        __Pyx_INCREF(((PyObject *)__pyx_v_self));
+        __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
+        PyTuple_SET_ITEM(__pyx_t_4, 1, ((PyObject *)__pyx_v_self));
+        __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 867, __pyx_L7_except_error)
+        __Pyx_GOTREF(__pyx_t_10);
+        __Pyx_GIVEREF(__pyx_t_4);
+        PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_4);
+        __pyx_t_4 = 0;
+        __Pyx_INCREF(__pyx_v_6gevent_9_greenlet_sys_exc_info);
+        __pyx_t_11 = __pyx_v_6gevent_9_greenlet_sys_exc_info; __pyx_t_12 = NULL;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_11))) {
+          __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_11);
+          if (likely(__pyx_t_12)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
+            __Pyx_INCREF(__pyx_t_12);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_11, function);
+          }
+        }
+        __pyx_t_4 = (__pyx_t_12) ? __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_t_12) : __Pyx_PyObject_CallNoArg(__pyx_t_11);
+        __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
+        if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 867, __pyx_L7_except_error)
+        __Pyx_GOTREF(__pyx_t_4);
+        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+        __pyx_t_11 = __Pyx_PySequence_Tuple(__pyx_t_4); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 867, __pyx_L7_except_error)
+        __Pyx_GOTREF(__pyx_t_11);
+        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+        __pyx_t_4 = PyNumber_Add(__pyx_t_10, __pyx_t_11); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 867, __pyx_L7_except_error)
+        __Pyx_GOTREF(__pyx_t_4);
+        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+        __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_4, NULL); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 867, __pyx_L7_except_error)
+        __Pyx_GOTREF(__pyx_t_11);
+        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+        goto __pyx_L6_exception_handled;
+      }
+      __pyx_L7_except_error:;
+
 0868: 
+
 0869: 
+
+0870: class _dummy_event(object):
+
struct __pyx_vtabstruct_6gevent_9_greenlet__dummy_event {
+  PyObject *(*stop)(struct __pyx_obj_6gevent_9_greenlet__dummy_event *, int __pyx_skip_dispatch);
+  PyObject *(*start)(struct __pyx_obj_6gevent_9_greenlet__dummy_event *, PyObject *, int __pyx_skip_dispatch);
+  PyObject *(*close)(struct __pyx_obj_6gevent_9_greenlet__dummy_event *, int __pyx_skip_dispatch);
+};
+static struct __pyx_vtabstruct_6gevent_9_greenlet__dummy_event *__pyx_vtabptr_6gevent_9_greenlet__dummy_event;
+
+0871:     __slots__ = ('pending', 'active')
+
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet__dummy_event->tp_dict, __pyx_n_s_slots, __pyx_tuple__75) < 0) __PYX_ERR(0, 871, __pyx_L1_error)
+  PyType_Modified(__pyx_ptype_6gevent_9_greenlet__dummy_event);
+/* … */
+  __pyx_tuple__75 = PyTuple_Pack(2, __pyx_n_s_pending, __pyx_n_s_active); if (unlikely(!__pyx_tuple__75)) __PYX_ERR(0, 871, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__75);
+  __Pyx_GIVEREF(__pyx_tuple__75);
+
 0872: 
+
+0873:     def __init__(self):
+
/* Python wrapper */
+static int __pyx_pw_6gevent_9_greenlet_12_dummy_event_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static int __pyx_pw_6gevent_9_greenlet_12_dummy_event_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
+  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
+    __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
+  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1;
+  __pyx_r = __pyx_pf_6gevent_9_greenlet_12_dummy_event___init__(((struct __pyx_obj_6gevent_9_greenlet__dummy_event *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_9_greenlet_12_dummy_event___init__(struct __pyx_obj_6gevent_9_greenlet__dummy_event *__pyx_v_self) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = 0;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0874:         self.pending = self.active = False
+
  __pyx_v_self->pending = 0;
+  __pyx_v_self->active = 0;
+
 0875: 
+
+0876:     def stop(self):
+
static PyObject *__pyx_pw_6gevent_9_greenlet_12_dummy_event_3stop(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyObject *__pyx_f_6gevent_9_greenlet_12_dummy_event_stop(CYTHON_UNUSED struct __pyx_obj_6gevent_9_greenlet__dummy_event *__pyx_v_self, CYTHON_UNUSED int __pyx_skip_dispatch) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("stop", 0);
+
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_9_greenlet_12_dummy_event_3stop(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6gevent_9_greenlet_12_dummy_event_2stop[] = "_dummy_event.stop(self)";
+static PyMethodDef __pyx_mdef_6gevent_9_greenlet_12_dummy_event_3stop = {"stop", (PyCFunction)__pyx_pw_6gevent_9_greenlet_12_dummy_event_3stop, METH_NOARGS, __pyx_doc_6gevent_9_greenlet_12_dummy_event_2stop};
+static PyObject *__pyx_pw_6gevent_9_greenlet_12_dummy_event_3stop(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("stop (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_9_greenlet_12_dummy_event_2stop(((struct __pyx_obj_6gevent_9_greenlet__dummy_event *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_9_greenlet_12_dummy_event_2stop(struct __pyx_obj_6gevent_9_greenlet__dummy_event *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("stop", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __pyx_f_6gevent_9_greenlet_12_dummy_event_stop(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 876, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent._greenlet._dummy_event.stop", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__76 = PyTuple_Pack(1, __pyx_n_s_self_2); if (unlikely(!__pyx_tuple__76)) __PYX_ERR(0, 876, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__76);
+  __Pyx_GIVEREF(__pyx_tuple__76);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_9_greenlet_12_dummy_event_3stop, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_dummy_event_stop, NULL, __pyx_n_s_gevent__greenlet, __pyx_d, ((PyObject *)__pyx_codeobj__77)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 876, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet__dummy_event->tp_dict, __pyx_n_s_stop, __pyx_t_2) < 0) __PYX_ERR(0, 876, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_9_greenlet__dummy_event);
+  __pyx_codeobj__77 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__76, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_greenlet_py, __pyx_n_s_stop, 876, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__77)) __PYX_ERR(0, 876, __pyx_L1_error)
+
 0877:         pass
+
 0878: 
+
+0879:     def start(self, cb): # pylint:disable=unused-argument
+
static PyObject *__pyx_pw_6gevent_9_greenlet_12_dummy_event_5start(PyObject *__pyx_v_self, PyObject *__pyx_v_cb); /*proto*/
+static PyObject *__pyx_f_6gevent_9_greenlet_12_dummy_event_start(CYTHON_UNUSED struct __pyx_obj_6gevent_9_greenlet__dummy_event *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_cb, CYTHON_UNUSED int __pyx_skip_dispatch) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("start", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent._greenlet._dummy_event.start", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_9_greenlet_12_dummy_event_5start(PyObject *__pyx_v_self, PyObject *__pyx_v_cb); /*proto*/
+static char __pyx_doc_6gevent_9_greenlet_12_dummy_event_4start[] = "_dummy_event.start(self, cb)";
+static PyMethodDef __pyx_mdef_6gevent_9_greenlet_12_dummy_event_5start = {"start", (PyCFunction)__pyx_pw_6gevent_9_greenlet_12_dummy_event_5start, METH_O, __pyx_doc_6gevent_9_greenlet_12_dummy_event_4start};
+static PyObject *__pyx_pw_6gevent_9_greenlet_12_dummy_event_5start(PyObject *__pyx_v_self, PyObject *__pyx_v_cb) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("start (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_9_greenlet_12_dummy_event_4start(((struct __pyx_obj_6gevent_9_greenlet__dummy_event *)__pyx_v_self), ((PyObject *)__pyx_v_cb));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_9_greenlet_12_dummy_event_4start(struct __pyx_obj_6gevent_9_greenlet__dummy_event *__pyx_v_self, PyObject *__pyx_v_cb) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("start", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __pyx_f_6gevent_9_greenlet_12_dummy_event_start(__pyx_v_self, __pyx_v_cb, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 879, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent._greenlet._dummy_event.start", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__78 = PyTuple_Pack(2, __pyx_n_s_self_2, __pyx_n_s_cb); if (unlikely(!__pyx_tuple__78)) __PYX_ERR(0, 879, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__78);
+  __Pyx_GIVEREF(__pyx_tuple__78);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_9_greenlet_12_dummy_event_5start, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_dummy_event_start, NULL, __pyx_n_s_gevent__greenlet, __pyx_d, ((PyObject *)__pyx_codeobj__79)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 879, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet__dummy_event->tp_dict, __pyx_n_s_start, __pyx_t_2) < 0) __PYX_ERR(0, 879, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_9_greenlet__dummy_event);
+  __pyx_codeobj__79 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__78, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_greenlet_py, __pyx_n_s_start, 879, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__79)) __PYX_ERR(0, 879, __pyx_L1_error)
+
+0880:         raise AssertionError("Cannot start the dummy event")
+
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_AssertionError, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 880, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __PYX_ERR(0, 880, __pyx_L1_error)
+/* … */
+  __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s_Cannot_start_the_dummy_event); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(0, 880, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__16);
+  __Pyx_GIVEREF(__pyx_tuple__16);
+
 0881: 
+
+0882:     def close(self):
+
static PyObject *__pyx_pw_6gevent_9_greenlet_12_dummy_event_7close(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyObject *__pyx_f_6gevent_9_greenlet_12_dummy_event_close(CYTHON_UNUSED struct __pyx_obj_6gevent_9_greenlet__dummy_event *__pyx_v_self, CYTHON_UNUSED int __pyx_skip_dispatch) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("close", 0);
+
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_9_greenlet_12_dummy_event_7close(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6gevent_9_greenlet_12_dummy_event_6close[] = "_dummy_event.close(self)";
+static PyMethodDef __pyx_mdef_6gevent_9_greenlet_12_dummy_event_7close = {"close", (PyCFunction)__pyx_pw_6gevent_9_greenlet_12_dummy_event_7close, METH_NOARGS, __pyx_doc_6gevent_9_greenlet_12_dummy_event_6close};
+static PyObject *__pyx_pw_6gevent_9_greenlet_12_dummy_event_7close(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("close (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_9_greenlet_12_dummy_event_6close(((struct __pyx_obj_6gevent_9_greenlet__dummy_event *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_9_greenlet_12_dummy_event_6close(struct __pyx_obj_6gevent_9_greenlet__dummy_event *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("close", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __pyx_f_6gevent_9_greenlet_12_dummy_event_close(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 882, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent._greenlet._dummy_event.close", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__80 = PyTuple_Pack(1, __pyx_n_s_self_2); if (unlikely(!__pyx_tuple__80)) __PYX_ERR(0, 882, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__80);
+  __Pyx_GIVEREF(__pyx_tuple__80);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_9_greenlet_12_dummy_event_7close, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_dummy_event_close, NULL, __pyx_n_s_gevent__greenlet, __pyx_d, ((PyObject *)__pyx_codeobj__81)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 882, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet__dummy_event->tp_dict, __pyx_n_s_close, __pyx_t_2) < 0) __PYX_ERR(0, 882, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_9_greenlet__dummy_event);
+  __pyx_codeobj__81 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__80, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_greenlet_py, __pyx_n_s_close, 882, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__81)) __PYX_ERR(0, 882, __pyx_L1_error)
+
 0883:         pass
+
 0884: 
+
+0885: _cancelled_start_event = _dummy_event()
+
  __pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_6gevent_9_greenlet__dummy_event)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 885, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_XGOTREF(((PyObject *)__pyx_v_6gevent_9_greenlet__cancelled_start_event));
+  __Pyx_DECREF_SET(__pyx_v_6gevent_9_greenlet__cancelled_start_event, ((struct __pyx_obj_6gevent_9_greenlet__dummy_event *)__pyx_t_2));
+  __Pyx_GIVEREF(__pyx_t_2);
+  __pyx_t_2 = 0;
+
+0886: _start_completed_event = _dummy_event()
+
  __pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_6gevent_9_greenlet__dummy_event)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 886, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_XGOTREF(((PyObject *)__pyx_v_6gevent_9_greenlet__start_completed_event));
+  __Pyx_DECREF_SET(__pyx_v_6gevent_9_greenlet__start_completed_event, ((struct __pyx_obj_6gevent_9_greenlet__dummy_event *)__pyx_t_2));
+  __Pyx_GIVEREF(__pyx_t_2);
+  __pyx_t_2 = 0;
+
 0887: 
+
 0888: 
+
+0889: def _kill(glet, exception, waiter):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_9_greenlet_1_kill(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_6gevent_9_greenlet__kill[] = "_kill(glet, exception, waiter)";
+static PyMethodDef __pyx_mdef_6gevent_9_greenlet_1_kill = {"_kill", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_9_greenlet_1_kill, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_9_greenlet__kill};
+static PyObject *__pyx_pw_6gevent_9_greenlet_1_kill(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_glet = 0;
+  PyObject *__pyx_v_exception = 0;
+  PyObject *__pyx_v_waiter = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_kill (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_glet,&__pyx_n_s_exception,&__pyx_n_s_waiter,0};
+    PyObject* values[3] = {0,0,0};
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_glet)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_exception)) != 0)) kw_args--;
+        else {
+          __Pyx_RaiseArgtupleInvalid("_kill", 1, 3, 3, 1); __PYX_ERR(0, 889, __pyx_L3_error)
+        }
+        CYTHON_FALLTHROUGH;
+        case  2:
+        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_waiter)) != 0)) kw_args--;
+        else {
+          __Pyx_RaiseArgtupleInvalid("_kill", 1, 3, 3, 2); __PYX_ERR(0, 889, __pyx_L3_error)
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_kill") < 0)) __PYX_ERR(0, 889, __pyx_L3_error)
+      }
+    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
+      goto __pyx_L5_argtuple_error;
+    } else {
+      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+    }
+    __pyx_v_glet = values[0];
+    __pyx_v_exception = values[1];
+    __pyx_v_waiter = values[2];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("_kill", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 889, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent._greenlet._kill", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_9_greenlet__kill(__pyx_self, __pyx_v_glet, __pyx_v_exception, __pyx_v_waiter);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_9_greenlet__kill(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_glet, PyObject *__pyx_v_exception, PyObject *__pyx_v_waiter) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_kill", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_XDECREF(__pyx_t_6);
+  __Pyx_XDECREF(__pyx_t_7);
+  __Pyx_XDECREF(__pyx_t_8);
+  __Pyx_XDECREF(__pyx_t_9);
+  __Pyx_XDECREF(__pyx_t_10);
+  __Pyx_XDECREF(__pyx_t_11);
+  __Pyx_AddTraceback("gevent._greenlet._kill", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__82 = PyTuple_Pack(3, __pyx_n_s_glet, __pyx_n_s_exception, __pyx_n_s_waiter); if (unlikely(!__pyx_tuple__82)) __PYX_ERR(0, 889, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__82);
+  __Pyx_GIVEREF(__pyx_tuple__82);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_9_greenlet_1_kill, 0, __pyx_n_s_kill, NULL, __pyx_n_s_gevent__greenlet, __pyx_d, ((PyObject *)__pyx_codeobj__83)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 889, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_kill, __pyx_t_2) < 0) __PYX_ERR(0, 889, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_codeobj__83 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__82, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_greenlet_py, __pyx_n_s_kill, 889, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__83)) __PYX_ERR(0, 889, __pyx_L1_error)
+
+0890:     try:
+
  {
+    /*try:*/ {
+/* … */
+    }
+    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+    goto __pyx_L8_try_end;
+    __pyx_L3_error:;
+    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+/* … */
+    __Pyx_XGIVEREF(__pyx_t_1);
+    __Pyx_XGIVEREF(__pyx_t_2);
+    __Pyx_XGIVEREF(__pyx_t_3);
+    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
+    goto __pyx_L1_error;
+    __pyx_L4_exception_handled:;
+    __Pyx_XGIVEREF(__pyx_t_1);
+    __Pyx_XGIVEREF(__pyx_t_2);
+    __Pyx_XGIVEREF(__pyx_t_3);
+    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
+    __pyx_L8_try_end:;
+  }
+
+0891:         glet.throw(exception)
+
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_glet, __pyx_n_s_throw); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 891, __pyx_L3_error)
+      __Pyx_GOTREF(__pyx_t_5);
+      __pyx_t_6 = NULL;
+      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
+        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
+        if (likely(__pyx_t_6)) {
+          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
+          __Pyx_INCREF(__pyx_t_6);
+          __Pyx_INCREF(function);
+          __Pyx_DECREF_SET(__pyx_t_5, function);
+        }
+      }
+      __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_v_exception) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_exception);
+      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 891, __pyx_L3_error)
+      __Pyx_GOTREF(__pyx_t_4);
+      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+
+0892:     except: # pylint:disable=bare-except
+
    /*except:*/ {
+      __Pyx_AddTraceback("gevent._greenlet._kill", __pyx_clineno, __pyx_lineno, __pyx_filename);
+      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6) < 0) __PYX_ERR(0, 892, __pyx_L5_except_error)
+      __Pyx_GOTREF(__pyx_t_4);
+      __Pyx_GOTREF(__pyx_t_5);
+      __Pyx_GOTREF(__pyx_t_6);
+
 0893:         # XXX do we need this here?
+
+0894:         glet.parent.handle_error(glet, *sys_exc_info())
+
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_glet, __pyx_n_s_parent); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 894, __pyx_L5_except_error)
+      __Pyx_GOTREF(__pyx_t_7);
+      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_handle_error); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 894, __pyx_L5_except_error)
+      __Pyx_GOTREF(__pyx_t_8);
+      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+      __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 894, __pyx_L5_except_error)
+      __Pyx_GOTREF(__pyx_t_7);
+      __Pyx_INCREF(__pyx_v_glet);
+      __Pyx_GIVEREF(__pyx_v_glet);
+      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_glet);
+      __Pyx_INCREF(__pyx_v_6gevent_9_greenlet_sys_exc_info);
+      __pyx_t_10 = __pyx_v_6gevent_9_greenlet_sys_exc_info; __pyx_t_11 = NULL;
+      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_10))) {
+        __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_10);
+        if (likely(__pyx_t_11)) {
+          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
+          __Pyx_INCREF(__pyx_t_11);
+          __Pyx_INCREF(function);
+          __Pyx_DECREF_SET(__pyx_t_10, function);
+        }
+      }
+      __pyx_t_9 = (__pyx_t_11) ? __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_t_11) : __Pyx_PyObject_CallNoArg(__pyx_t_10);
+      __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
+      if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 894, __pyx_L5_except_error)
+      __Pyx_GOTREF(__pyx_t_9);
+      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+      __pyx_t_10 = __Pyx_PySequence_Tuple(__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 894, __pyx_L5_except_error)
+      __Pyx_GOTREF(__pyx_t_10);
+      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+      __pyx_t_9 = PyNumber_Add(__pyx_t_7, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 894, __pyx_L5_except_error)
+      __Pyx_GOTREF(__pyx_t_9);
+      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+      __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_9, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 894, __pyx_L5_except_error)
+      __Pyx_GOTREF(__pyx_t_10);
+      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+      goto __pyx_L4_exception_handled;
+    }
+    __pyx_L5_except_error:;
+
+0895:     if waiter is not None:
+
  __pyx_t_12 = (__pyx_v_waiter != Py_None);
+  __pyx_t_13 = (__pyx_t_12 != 0);
+  if (__pyx_t_13) {
+/* … */
+  }
+
+0896:         waiter.switch(None)
+
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_waiter, __pyx_n_s_switch); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 896, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_5);
+    __pyx_t_4 = NULL;
+    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
+      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
+      if (likely(__pyx_t_4)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
+        __Pyx_INCREF(__pyx_t_4);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_5, function);
+      }
+    }
+    __pyx_t_6 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_4, Py_None) : __Pyx_PyObject_CallOneArg(__pyx_t_5, Py_None);
+    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+    if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 896, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_6);
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+
 0897: 
+
 0898: 
+
+0899: def joinall(greenlets, timeout=None, raise_error=False, count=None):
+
static PyObject *__pyx_pw_6gevent_9_greenlet_3joinall(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_f_6gevent_9_greenlet_joinall(PyObject *__pyx_v_greenlets, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_9_greenlet_joinall *__pyx_optional_args) {
+  PyObject *__pyx_v_timeout = ((PyObject *)Py_None);
+  PyObject *__pyx_v_raise_error = ((PyObject *)Py_False);
+  PyObject *__pyx_v_count = ((PyObject *)Py_None);
+  PyObject *__pyx_v_done = 0;
+  PyObject *__pyx_v_obj = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("joinall", 0);
+  if (__pyx_optional_args) {
+    if (__pyx_optional_args->__pyx_n > 0) {
+      __pyx_v_timeout = __pyx_optional_args->timeout;
+      if (__pyx_optional_args->__pyx_n > 1) {
+        __pyx_v_raise_error = __pyx_optional_args->raise_error;
+        if (__pyx_optional_args->__pyx_n > 2) {
+          __pyx_v_count = __pyx_optional_args->count;
+        }
+      }
+    }
+  }
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_XDECREF(__pyx_t_8);
+  __Pyx_AddTraceback("gevent._greenlet.joinall", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_done);
+  __Pyx_XDECREF(__pyx_v_obj);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_9_greenlet_3joinall(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_6gevent_9_greenlet_2joinall[] = "joinall(greenlets, timeout=None, raise_error=False, count=None)\n\n    Wait for the ``greenlets`` to finish.\n\n    :param greenlets: A sequence (supporting :func:`len`) of greenlets to wait for.\n    :keyword float timeout: If given, the maximum number of seconds to wait.\n    :return: A sequence of the greenlets that finished before the timeout (if any)\n        expired.\n    ";
+static PyMethodDef __pyx_mdef_6gevent_9_greenlet_3joinall = {"joinall", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_9_greenlet_3joinall, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_9_greenlet_2joinall};
+static PyObject *__pyx_pw_6gevent_9_greenlet_3joinall(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_greenlets = 0;
+  PyObject *__pyx_v_timeout = 0;
+  PyObject *__pyx_v_raise_error = 0;
+  PyObject *__pyx_v_count = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("joinall (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_greenlets,&__pyx_n_s_timeout,&__pyx_n_s_raise_error,&__pyx_n_s_count,0};
+    PyObject* values[4] = {0,0,0,0};
+    values[1] = ((PyObject *)Py_None);
+    values[2] = ((PyObject *)Py_False);
+    values[3] = ((PyObject *)Py_None);
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
+        CYTHON_FALLTHROUGH;
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_greenlets)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_timeout);
+          if (value) { values[1] = value; kw_args--; }
+        }
+        CYTHON_FALLTHROUGH;
+        case  2:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_raise_error);
+          if (value) { values[2] = value; kw_args--; }
+        }
+        CYTHON_FALLTHROUGH;
+        case  3:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_count);
+          if (value) { values[3] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "joinall") < 0)) __PYX_ERR(0, 899, __pyx_L3_error)
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
+        CYTHON_FALLTHROUGH;
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    __pyx_v_greenlets = values[0];
+    __pyx_v_timeout = values[1];
+    __pyx_v_raise_error = values[2];
+    __pyx_v_count = values[3];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("joinall", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 899, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent._greenlet.joinall", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_9_greenlet_2joinall(__pyx_self, __pyx_v_greenlets, __pyx_v_timeout, __pyx_v_raise_error, __pyx_v_count);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_9_greenlet_2joinall(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_greenlets, PyObject *__pyx_v_timeout, PyObject *__pyx_v_raise_error, PyObject *__pyx_v_count) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("joinall", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_2.__pyx_n = 3;
+  __pyx_t_2.timeout = __pyx_v_timeout;
+  __pyx_t_2.raise_error = __pyx_v_raise_error;
+  __pyx_t_2.count = __pyx_v_count;
+  __pyx_t_1 = __pyx_f_6gevent_9_greenlet_joinall(__pyx_v_greenlets, 0, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 899, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent._greenlet.joinall", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__84 = PyTuple_Pack(4, __pyx_n_s_greenlets, __pyx_n_s_timeout, __pyx_n_s_raise_error, __pyx_n_s_count); if (unlikely(!__pyx_tuple__84)) __PYX_ERR(0, 899, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__84);
+  __Pyx_GIVEREF(__pyx_tuple__84);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_9_greenlet_3joinall, 0, __pyx_n_s_joinall, NULL, __pyx_n_s_gevent__greenlet, __pyx_d, ((PyObject *)__pyx_codeobj__85)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 899, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_joinall, __pyx_t_2) < 0) __PYX_ERR(0, 899, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_codeobj__85 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__84, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_greenlet_py, __pyx_n_s_joinall, 899, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__85)) __PYX_ERR(0, 899, __pyx_L1_error)
+
 0900:     """
+
 0901:     Wait for the ``greenlets`` to finish.
+
 0902: 
+
 0903:     :param greenlets: A sequence (supporting :func:`len`) of greenlets to wait for.
+
 0904:     :keyword float timeout: If given, the maximum number of seconds to wait.
+
 0905:     :return: A sequence of the greenlets that finished before the timeout (if any)
+
 0906:         expired.
+
 0907:     """
+
+0908:     if not raise_error:
+
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_raise_error); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 908, __pyx_L1_error)
+  __pyx_t_2 = ((!__pyx_t_1) != 0);
+  if (__pyx_t_2) {
+/* … */
+  }
+
+0909:         return wait(greenlets, timeout=timeout, count=count)
+
    __Pyx_XDECREF(__pyx_r);
+    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 909, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_INCREF(__pyx_v_greenlets);
+    __Pyx_GIVEREF(__pyx_v_greenlets);
+    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_greenlets);
+    __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 909, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_timeout, __pyx_v_timeout) < 0) __PYX_ERR(0, 909, __pyx_L1_error)
+    if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_count, __pyx_v_count) < 0) __PYX_ERR(0, 909, __pyx_L1_error)
+    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_v_6gevent_9_greenlet_wait, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 909, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_5);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __pyx_r = __pyx_t_5;
+    __pyx_t_5 = 0;
+    goto __pyx_L0;
+
 0910: 
+
+0911:     done = []
+
  __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 911, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_5);
+  __pyx_v_done = ((PyObject*)__pyx_t_5);
+  __pyx_t_5 = 0;
+
+0912:     for obj in iwait(greenlets, timeout=timeout, count=count):
+
  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 912, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_5);
+  __Pyx_INCREF(__pyx_v_greenlets);
+  __Pyx_GIVEREF(__pyx_v_greenlets);
+  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_greenlets);
+  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 912, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_4);
+  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_timeout, __pyx_v_timeout) < 0) __PYX_ERR(0, 912, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_count, __pyx_v_count) < 0) __PYX_ERR(0, 912, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_v_6gevent_9_greenlet_iwait, __pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 912, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
+    __pyx_t_4 = __pyx_t_3; __Pyx_INCREF(__pyx_t_4); __pyx_t_6 = 0;
+    __pyx_t_7 = NULL;
+  } else {
+    __pyx_t_6 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 912, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    __pyx_t_7 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 912, __pyx_L1_error)
+  }
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  for (;;) {
+    if (likely(!__pyx_t_7)) {
+      if (likely(PyList_CheckExact(__pyx_t_4))) {
+        if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_4)) break;
+        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+        __pyx_t_3 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_6); __Pyx_INCREF(__pyx_t_3); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 912, __pyx_L1_error)
+        #else
+        __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 912, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_3);
+        #endif
+      } else {
+        if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
+        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+        __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_6); __Pyx_INCREF(__pyx_t_3); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 912, __pyx_L1_error)
+        #else
+        __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 912, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_3);
+        #endif
+      }
+    } else {
+      __pyx_t_3 = __pyx_t_7(__pyx_t_4);
+      if (unlikely(!__pyx_t_3)) {
+        PyObject* exc_type = PyErr_Occurred();
+        if (exc_type) {
+          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+          else __PYX_ERR(0, 912, __pyx_L1_error)
+        }
+        break;
+      }
+      __Pyx_GOTREF(__pyx_t_3);
+    }
+    __Pyx_XDECREF_SET(__pyx_v_obj, __pyx_t_3);
+    __pyx_t_3 = 0;
+/* … */
+  }
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+
+0913:         if getattr(obj, 'exception', None) is not None:
+
    __pyx_t_3 = __Pyx_GetAttr3(__pyx_v_obj, __pyx_n_s_exception, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 913, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __pyx_t_2 = (__pyx_t_3 != Py_None);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __pyx_t_1 = (__pyx_t_2 != 0);
+    if (__pyx_t_1) {
+/* … */
+    }
+
+0914:             if hasattr(obj, '_raise_exception'):
+
      __pyx_t_1 = __Pyx_HasAttr(__pyx_v_obj, __pyx_n_s_raise_exception); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 914, __pyx_L1_error)
+      __pyx_t_2 = (__pyx_t_1 != 0);
+      if (likely(__pyx_t_2)) {
+/* … */
+        goto __pyx_L7;
+      }
+
+0915:                 obj._raise_exception()
+
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_raise_exception); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 915, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_5);
+        __pyx_t_8 = NULL;
+        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
+          __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5);
+          if (likely(__pyx_t_8)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
+            __Pyx_INCREF(__pyx_t_8);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_5, function);
+          }
+        }
+        __pyx_t_3 = (__pyx_t_8) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_8) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
+        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
+        if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 915, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_3);
+        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+
 0916:             else:
+
+0917:                 raise obj.exception
+
      /*else*/ {
+        __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_exception); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 917, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_3);
+        __Pyx_Raise(__pyx_t_3, 0, 0, 0);
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __PYX_ERR(0, 917, __pyx_L1_error)
+      }
+      __pyx_L7:;
+
+0918:         done.append(obj)
+
    __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_done, __pyx_v_obj); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 918, __pyx_L1_error)
+
+0919:     return done
+
  __Pyx_XDECREF(__pyx_r);
+  __Pyx_INCREF(__pyx_v_done);
+  __pyx_r = __pyx_v_done;
+  goto __pyx_L0;
+
 0920: 
+
 0921: 
+
+0922: def _killall3(greenlets, exception, waiter):
+
static PyObject *__pyx_f_6gevent_9_greenlet__killall3(PyObject *__pyx_v_greenlets, PyObject *__pyx_v_exception, PyObject *__pyx_v_waiter) {
+  PyObject *__pyx_v_diehards = 0;
+  PyObject *__pyx_v_g = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_killall3", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_9);
+  __Pyx_XDECREF(__pyx_t_10);
+  __Pyx_XDECREF(__pyx_t_11);
+  __Pyx_XDECREF(__pyx_t_12);
+  __Pyx_XDECREF(__pyx_t_13);
+  __Pyx_XDECREF(__pyx_t_14);
+  __Pyx_XDECREF(__pyx_t_15);
+  __Pyx_AddTraceback("gevent._greenlet._killall3", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_diehards);
+  __Pyx_XDECREF(__pyx_v_g);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0923:     diehards = []
+
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 923, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_v_diehards = ((PyObject*)__pyx_t_1);
+  __pyx_t_1 = 0;
+
+0924:     for g in greenlets:
+
  if (unlikely(__pyx_v_greenlets == Py_None)) {
+    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
+    __PYX_ERR(0, 924, __pyx_L1_error)
+  }
+  __pyx_t_1 = __pyx_v_greenlets; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
+  for (;;) {
+    if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
+    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+    __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 924, __pyx_L1_error)
+    #else
+    __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 924, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    #endif
+    __Pyx_XDECREF_SET(__pyx_v_g, __pyx_t_3);
+    __pyx_t_3 = 0;
+/* … */
+  }
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+0925:         if not g.dead:
+
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_g, __pyx_n_s_dead); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 925, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 925, __pyx_L1_error)
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __pyx_t_5 = ((!__pyx_t_4) != 0);
+    if (__pyx_t_5) {
+/* … */
+    }
+
+0926:             try:
+
      {
+        /*try:*/ {
+/* … */
+        }
+        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
+        goto __pyx_L13_try_end;
+        __pyx_L6_error:;
+        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
+        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
+        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+/* … */
+        __Pyx_XGIVEREF(__pyx_t_6);
+        __Pyx_XGIVEREF(__pyx_t_7);
+        __Pyx_XGIVEREF(__pyx_t_8);
+        __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
+        goto __pyx_L1_error;
+        __pyx_L7_exception_handled:;
+        __Pyx_XGIVEREF(__pyx_t_6);
+        __Pyx_XGIVEREF(__pyx_t_7);
+        __Pyx_XGIVEREF(__pyx_t_8);
+        __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
+        __pyx_L13_try_end:;
+      }
+
+0927:                 g.throw(exception)
+
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_g, __pyx_n_s_throw); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 927, __pyx_L6_error)
+          __Pyx_GOTREF(__pyx_t_9);
+          __pyx_t_10 = NULL;
+          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
+            __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9);
+            if (likely(__pyx_t_10)) {
+              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
+              __Pyx_INCREF(__pyx_t_10);
+              __Pyx_INCREF(function);
+              __Pyx_DECREF_SET(__pyx_t_9, function);
+            }
+          }
+          __pyx_t_3 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_10, __pyx_v_exception) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_v_exception);
+          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
+          if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 927, __pyx_L6_error)
+          __Pyx_GOTREF(__pyx_t_3);
+          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+
+0928:             except: # pylint:disable=bare-except
+
        /*except:*/ {
+          __Pyx_AddTraceback("gevent._greenlet._killall3", __pyx_clineno, __pyx_lineno, __pyx_filename);
+          if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_9, &__pyx_t_10) < 0) __PYX_ERR(0, 928, __pyx_L8_except_error)
+          __Pyx_GOTREF(__pyx_t_3);
+          __Pyx_GOTREF(__pyx_t_9);
+          __Pyx_GOTREF(__pyx_t_10);
+
+0929:                 g.parent.handle_error(g, *sys_exc_info())
+
          __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_g, __pyx_n_s_parent); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 929, __pyx_L8_except_error)
+          __Pyx_GOTREF(__pyx_t_11);
+          __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_handle_error); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 929, __pyx_L8_except_error)
+          __Pyx_GOTREF(__pyx_t_12);
+          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+          __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 929, __pyx_L8_except_error)
+          __Pyx_GOTREF(__pyx_t_11);
+          __Pyx_INCREF(__pyx_v_g);
+          __Pyx_GIVEREF(__pyx_v_g);
+          PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_v_g);
+          __Pyx_INCREF(__pyx_v_6gevent_9_greenlet_sys_exc_info);
+          __pyx_t_14 = __pyx_v_6gevent_9_greenlet_sys_exc_info; __pyx_t_15 = NULL;
+          if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_14))) {
+            __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_14);
+            if (likely(__pyx_t_15)) {
+              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14);
+              __Pyx_INCREF(__pyx_t_15);
+              __Pyx_INCREF(function);
+              __Pyx_DECREF_SET(__pyx_t_14, function);
+            }
+          }
+          __pyx_t_13 = (__pyx_t_15) ? __Pyx_PyObject_CallOneArg(__pyx_t_14, __pyx_t_15) : __Pyx_PyObject_CallNoArg(__pyx_t_14);
+          __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
+          if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 929, __pyx_L8_except_error)
+          __Pyx_GOTREF(__pyx_t_13);
+          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
+          __pyx_t_14 = __Pyx_PySequence_Tuple(__pyx_t_13); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 929, __pyx_L8_except_error)
+          __Pyx_GOTREF(__pyx_t_14);
+          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+          __pyx_t_13 = PyNumber_Add(__pyx_t_11, __pyx_t_14); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 929, __pyx_L8_except_error)
+          __Pyx_GOTREF(__pyx_t_13);
+          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
+          __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_13, NULL); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 929, __pyx_L8_except_error)
+          __Pyx_GOTREF(__pyx_t_14);
+          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
+          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
+          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
+          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
+          goto __pyx_L7_exception_handled;
+        }
+        __pyx_L8_except_error:;
+
+0930:             if not g.dead:
+
      __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_g, __pyx_n_s_dead); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 930, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_10);
+      __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 930, __pyx_L1_error)
+      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+      __pyx_t_4 = ((!__pyx_t_5) != 0);
+      if (__pyx_t_4) {
+/* … */
+      }
+
+0931:                 diehards.append(g)
+
        __pyx_t_16 = __Pyx_PyList_Append(__pyx_v_diehards, __pyx_v_g); if (unlikely(__pyx_t_16 == ((int)-1))) __PYX_ERR(0, 931, __pyx_L1_error)
+
+0932:     waiter.switch(diehards)
+
  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_waiter, __pyx_n_s_switch); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 932, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_10);
+  __pyx_t_9 = NULL;
+  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_10))) {
+    __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_10);
+    if (likely(__pyx_t_9)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
+      __Pyx_INCREF(__pyx_t_9);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_10, function);
+    }
+  }
+  __pyx_t_1 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_10, __pyx_t_9, __pyx_v_diehards) : __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_v_diehards);
+  __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
+  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 932, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 0933: 
+
 0934: 
+
+0935: def _killall(greenlets, exception):
+
static PyObject *__pyx_f_6gevent_9_greenlet__killall(PyObject *__pyx_v_greenlets, PyObject *__pyx_v_exception) {
+  PyObject *__pyx_v_g = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_killall", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_9);
+  __Pyx_XDECREF(__pyx_t_10);
+  __Pyx_XDECREF(__pyx_t_11);
+  __Pyx_XDECREF(__pyx_t_12);
+  __Pyx_XDECREF(__pyx_t_13);
+  __Pyx_XDECREF(__pyx_t_14);
+  __Pyx_XDECREF(__pyx_t_15);
+  __Pyx_AddTraceback("gevent._greenlet._killall", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_g);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0936:     for g in greenlets:
+
  if (unlikely(__pyx_v_greenlets == Py_None)) {
+    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
+    __PYX_ERR(0, 936, __pyx_L1_error)
+  }
+  __pyx_t_1 = __pyx_v_greenlets; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
+  for (;;) {
+    if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
+    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+    __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 936, __pyx_L1_error)
+    #else
+    __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 936, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    #endif
+    __Pyx_XDECREF_SET(__pyx_v_g, __pyx_t_3);
+    __pyx_t_3 = 0;
+/* … */
+  }
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+0937:         if not g.dead:
+
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_g, __pyx_n_s_dead); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 937, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 937, __pyx_L1_error)
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __pyx_t_5 = ((!__pyx_t_4) != 0);
+    if (__pyx_t_5) {
+/* … */
+    }
+
+0938:             try:
+
      {
+        /*try:*/ {
+/* … */
+        }
+        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
+        goto __pyx_L13_try_end;
+        __pyx_L6_error:;
+        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
+        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
+        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+/* … */
+        __Pyx_XGIVEREF(__pyx_t_6);
+        __Pyx_XGIVEREF(__pyx_t_7);
+        __Pyx_XGIVEREF(__pyx_t_8);
+        __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
+        goto __pyx_L1_error;
+        __pyx_L7_exception_handled:;
+        __Pyx_XGIVEREF(__pyx_t_6);
+        __Pyx_XGIVEREF(__pyx_t_7);
+        __Pyx_XGIVEREF(__pyx_t_8);
+        __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
+        __pyx_L13_try_end:;
+      }
+
+0939:                 g.throw(exception)
+
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_g, __pyx_n_s_throw); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 939, __pyx_L6_error)
+          __Pyx_GOTREF(__pyx_t_9);
+          __pyx_t_10 = NULL;
+          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
+            __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9);
+            if (likely(__pyx_t_10)) {
+              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
+              __Pyx_INCREF(__pyx_t_10);
+              __Pyx_INCREF(function);
+              __Pyx_DECREF_SET(__pyx_t_9, function);
+            }
+          }
+          __pyx_t_3 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_10, __pyx_v_exception) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_v_exception);
+          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
+          if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 939, __pyx_L6_error)
+          __Pyx_GOTREF(__pyx_t_3);
+          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+
+0940:             except: # pylint:disable=bare-except
+
        /*except:*/ {
+          __Pyx_AddTraceback("gevent._greenlet._killall", __pyx_clineno, __pyx_lineno, __pyx_filename);
+          if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_9, &__pyx_t_10) < 0) __PYX_ERR(0, 940, __pyx_L8_except_error)
+          __Pyx_GOTREF(__pyx_t_3);
+          __Pyx_GOTREF(__pyx_t_9);
+          __Pyx_GOTREF(__pyx_t_10);
+
+0941:                 g.parent.handle_error(g, *sys_exc_info())
+
          __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_g, __pyx_n_s_parent); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 941, __pyx_L8_except_error)
+          __Pyx_GOTREF(__pyx_t_11);
+          __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_handle_error); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 941, __pyx_L8_except_error)
+          __Pyx_GOTREF(__pyx_t_12);
+          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+          __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 941, __pyx_L8_except_error)
+          __Pyx_GOTREF(__pyx_t_11);
+          __Pyx_INCREF(__pyx_v_g);
+          __Pyx_GIVEREF(__pyx_v_g);
+          PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_v_g);
+          __Pyx_INCREF(__pyx_v_6gevent_9_greenlet_sys_exc_info);
+          __pyx_t_14 = __pyx_v_6gevent_9_greenlet_sys_exc_info; __pyx_t_15 = NULL;
+          if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_14))) {
+            __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_14);
+            if (likely(__pyx_t_15)) {
+              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14);
+              __Pyx_INCREF(__pyx_t_15);
+              __Pyx_INCREF(function);
+              __Pyx_DECREF_SET(__pyx_t_14, function);
+            }
+          }
+          __pyx_t_13 = (__pyx_t_15) ? __Pyx_PyObject_CallOneArg(__pyx_t_14, __pyx_t_15) : __Pyx_PyObject_CallNoArg(__pyx_t_14);
+          __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
+          if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 941, __pyx_L8_except_error)
+          __Pyx_GOTREF(__pyx_t_13);
+          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
+          __pyx_t_14 = __Pyx_PySequence_Tuple(__pyx_t_13); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 941, __pyx_L8_except_error)
+          __Pyx_GOTREF(__pyx_t_14);
+          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+          __pyx_t_13 = PyNumber_Add(__pyx_t_11, __pyx_t_14); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 941, __pyx_L8_except_error)
+          __Pyx_GOTREF(__pyx_t_13);
+          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
+          __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_13, NULL); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 941, __pyx_L8_except_error)
+          __Pyx_GOTREF(__pyx_t_14);
+          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
+          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
+          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
+          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
+          goto __pyx_L7_exception_handled;
+        }
+        __pyx_L8_except_error:;
+
 0942: 
+
 0943: 
+
+0944: def _call_spawn_callbacks(gr):
+
static void __pyx_f_6gevent_9_greenlet__call_spawn_callbacks(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_gr) {
+  PyObject *__pyx_v_cb = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_call_spawn_callbacks", 0);
+/* … */
+  /* function exit code */
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_7);
+  __Pyx_XDECREF(__pyx_t_9);
+  __Pyx_XDECREF(__pyx_t_10);
+  __Pyx_AddTraceback("gevent._greenlet._call_spawn_callbacks", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_cb);
+  __Pyx_RefNannyFinishContext();
+}
+
+0945:     if _spawn_callbacks is not None:
+
  __pyx_t_1 = (__pyx_v_6gevent_9_greenlet__spawn_callbacks != ((PyObject*)Py_None));
+  __pyx_t_2 = (__pyx_t_1 != 0);
+  if (__pyx_t_2) {
+/* … */
+  }
+
+0946:         for cb in _spawn_callbacks:
+
    __pyx_t_4 = 0;
+    __pyx_t_7 = __Pyx_set_iterator(__pyx_v_6gevent_9_greenlet__spawn_callbacks, 1, (&__pyx_t_5), (&__pyx_t_6)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 946, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_7);
+    __Pyx_XDECREF(__pyx_t_3);
+    __pyx_t_3 = __pyx_t_7;
+    __pyx_t_7 = 0;
+    while (1) {
+      __pyx_t_8 = __Pyx_set_iter_next(__pyx_t_3, __pyx_t_5, &__pyx_t_4, &__pyx_t_7, __pyx_t_6);
+      if (unlikely(__pyx_t_8 == 0)) break;
+      if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(0, 946, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_7);
+      __Pyx_XDECREF_SET(__pyx_v_cb, __pyx_t_7);
+      __pyx_t_7 = 0;
+
+0947:             cb(gr)
+
      __Pyx_INCREF(__pyx_v_cb);
+      __pyx_t_9 = __pyx_v_cb; __pyx_t_10 = NULL;
+      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
+        __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9);
+        if (likely(__pyx_t_10)) {
+          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
+          __Pyx_INCREF(__pyx_t_10);
+          __Pyx_INCREF(function);
+          __Pyx_DECREF_SET(__pyx_t_9, function);
+        }
+      }
+      __pyx_t_7 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_10, ((PyObject *)__pyx_v_gr)) : __Pyx_PyObject_CallOneArg(__pyx_t_9, ((PyObject *)__pyx_v_gr));
+      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
+      if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 947, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_7);
+      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+    }
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+
 0948: 
+
 0949: 
+
+0950: _spawn_callbacks = None
+
  __Pyx_INCREF(Py_None);
+  __Pyx_XGOTREF(__pyx_v_6gevent_9_greenlet__spawn_callbacks);
+  __Pyx_DECREF_SET(__pyx_v_6gevent_9_greenlet__spawn_callbacks, ((PyObject*)Py_None));
+  __Pyx_GIVEREF(Py_None);
+
 0951: 
+
 0952: 
+
+0953: def killall(greenlets, exception=GreenletExit, block=True, timeout=None):
+
static PyObject *__pyx_pf_6gevent_9_greenlet_7__defaults__(CYTHON_UNUSED PyObject *__pyx_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__defaults__", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 953, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_exception);
+  __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_exception);
+  PyTuple_SET_ITEM(__pyx_t_1, 0, __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_exception);
+  __Pyx_INCREF(((PyObject *)Py_True));
+  __Pyx_GIVEREF(((PyObject *)Py_True));
+  PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)Py_True));
+  __Pyx_INCREF(((PyObject *)Py_None));
+  __Pyx_GIVEREF(((PyObject *)Py_None));
+  PyTuple_SET_ITEM(__pyx_t_1, 2, ((PyObject *)Py_None));
+  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 953, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_GIVEREF(__pyx_t_1);
+  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
+  __Pyx_INCREF(Py_None);
+  __Pyx_GIVEREF(Py_None);
+  PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None);
+  __pyx_t_1 = 0;
+  __pyx_r = __pyx_t_2;
+  __pyx_t_2 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_AddTraceback("gevent._greenlet.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_9_greenlet_5killall(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_6gevent_9_greenlet_4killall[] = "killall(greenlets, exception=GreenletExit, block=True, timeout=None)\n\n    Forceably terminate all the ``greenlets`` by causing them to raise ``exception``.\n\n    .. caution:: Use care when killing greenlets. If they are not prepared for exceptions,\n       this could result in corrupted state.\n\n    :param greenlets: A **bounded** iterable of the non-None greenlets to terminate.\n       *All* the items in this iterable must be greenlets that belong to the same thread.\n    :keyword exception: The exception to raise in the greenlets. By default this is\n        :class:`GreenletExit`.\n    :keyword bool block: If True (the default) then this function only returns when all the\n        greenlets are dead; the current greenlet is unscheduled during that process.\n        If greenlets ignore the initial exception raised in them,\n        then they will be joined (with :func:`gevent.joinall`) and allowed to die naturally.\n        If False, this function returns immediately and greenlets will raise\n        the exception asynchronously.\n    :keyword float timeout: A time in seconds to wait for greenlets to die. If given, it is\n        only honored when ``block`` is True.\n    :raise Timeout: If blocking and a timeout is given that elapses before\n        all the greenlets are dead.\n\n    .. versionchanged:: 1.1a2\n        *greenlets* can be any iterable of greenlets, like an iterator or a set.\n        Previously it had to be a list or tuple.\n    ";
+static PyMethodDef __pyx_mdef_6gevent_9_greenlet_5killall = {"killall", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_9_greenlet_5killall, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_9_greenlet_4killall};
+static PyObject *__pyx_pw_6gevent_9_greenlet_5killall(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_greenlets = 0;
+  PyObject *__pyx_v_exception = 0;
+  PyObject *__pyx_v_block = 0;
+  PyObject *__pyx_v_timeout = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("killall (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_greenlets,&__pyx_n_s_exception,&__pyx_n_s_block,&__pyx_n_s_timeout,0};
+    PyObject* values[4] = {0,0,0,0};
+    __pyx_defaults *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self);
+    values[1] = __pyx_dynamic_args->__pyx_arg_exception;
+    values[2] = ((PyObject *)((PyObject *)Py_True));
+    values[3] = ((PyObject *)((PyObject *)Py_None));
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
+        CYTHON_FALLTHROUGH;
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_greenlets)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_exception);
+          if (value) { values[1] = value; kw_args--; }
+        }
+        CYTHON_FALLTHROUGH;
+        case  2:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_block);
+          if (value) { values[2] = value; kw_args--; }
+        }
+        CYTHON_FALLTHROUGH;
+        case  3:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_timeout);
+          if (value) { values[3] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "killall") < 0)) __PYX_ERR(0, 953, __pyx_L3_error)
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
+        CYTHON_FALLTHROUGH;
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    __pyx_v_greenlets = values[0];
+    __pyx_v_exception = values[1];
+    __pyx_v_block = values[2];
+    __pyx_v_timeout = values[3];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("killall", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 953, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent._greenlet.killall", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_9_greenlet_4killall(__pyx_self, __pyx_v_greenlets, __pyx_v_exception, __pyx_v_block, __pyx_v_timeout);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_9_greenlet_4killall(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_greenlets, PyObject *__pyx_v_exception, PyObject *__pyx_v_block, PyObject *__pyx_v_timeout) {
+  PyObject *__pyx_v_loop = NULL;
+  struct __pyx_obj_6gevent_8__waiter_Waiter *__pyx_v_waiter = NULL;
+  PyObject *__pyx_v_t = NULL;
+  PyObject *__pyx_v_alive = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("killall", 0);
+  __Pyx_INCREF(__pyx_v_greenlets);
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_XDECREF(__pyx_t_6);
+  __Pyx_XDECREF(__pyx_t_8);
+  __Pyx_AddTraceback("gevent._greenlet.killall", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_loop);
+  __Pyx_XDECREF((PyObject *)__pyx_v_waiter);
+  __Pyx_XDECREF(__pyx_v_t);
+  __Pyx_XDECREF(__pyx_v_alive);
+  __Pyx_XDECREF(__pyx_v_greenlets);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__86 = PyTuple_Pack(8, __pyx_n_s_greenlets, __pyx_n_s_exception, __pyx_n_s_block, __pyx_n_s_timeout, __pyx_n_s_loop, __pyx_n_s_waiter, __pyx_n_s_t, __pyx_n_s_alive); if (unlikely(!__pyx_tuple__86)) __PYX_ERR(0, 953, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__86);
+  __Pyx_GIVEREF(__pyx_tuple__86);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_9_greenlet_5killall, 0, __pyx_n_s_killall, NULL, __pyx_n_s_gevent__greenlet, __pyx_d, ((PyObject *)__pyx_codeobj__87)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 953, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (!__Pyx_CyFunction_InitDefaults(__pyx_t_2, sizeof(__pyx_defaults), 1)) __PYX_ERR(0, 953, __pyx_L1_error)
+  __Pyx_INCREF(__pyx_v_6gevent_9_greenlet_GreenletExit);
+  __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_t_2)->__pyx_arg_exception = __pyx_v_6gevent_9_greenlet_GreenletExit;
+  __Pyx_GIVEREF(__pyx_v_6gevent_9_greenlet_GreenletExit);
+  __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_2, __pyx_pf_6gevent_9_greenlet_7__defaults__);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_killall, __pyx_t_2) < 0) __PYX_ERR(0, 953, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
 0954:     """
+
 0955:     Forceably terminate all the ``greenlets`` by causing them to raise ``exception``.
+
 0956: 
+
 0957:     .. caution:: Use care when killing greenlets. If they are not prepared for exceptions,
+
 0958:        this could result in corrupted state.
+
 0959: 
+
 0960:     :param greenlets: A **bounded** iterable of the non-None greenlets to terminate.
+
 0961:        *All* the items in this iterable must be greenlets that belong to the same thread.
+
 0962:     :keyword exception: The exception to raise in the greenlets. By default this is
+
 0963:         :class:`GreenletExit`.
+
 0964:     :keyword bool block: If True (the default) then this function only returns when all the
+
 0965:         greenlets are dead; the current greenlet is unscheduled during that process.
+
 0966:         If greenlets ignore the initial exception raised in them,
+
 0967:         then they will be joined (with :func:`gevent.joinall`) and allowed to die naturally.
+
 0968:         If False, this function returns immediately and greenlets will raise
+
 0969:         the exception asynchronously.
+
 0970:     :keyword float timeout: A time in seconds to wait for greenlets to die. If given, it is
+
 0971:         only honored when ``block`` is True.
+
 0972:     :raise Timeout: If blocking and a timeout is given that elapses before
+
 0973:         all the greenlets are dead.
+
 0974: 
+
 0975:     .. versionchanged:: 1.1a2
+
 0976:         *greenlets* can be any iterable of greenlets, like an iterator or a set.
+
 0977:         Previously it had to be a list or tuple.
+
 0978:     """
+
 0979:     # support non-indexable containers like iterators or set objects
+
+0980:     greenlets = list(greenlets)
+
  __pyx_t_1 = PySequence_List(__pyx_v_greenlets); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 980, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF_SET(__pyx_v_greenlets, __pyx_t_1);
+  __pyx_t_1 = 0;
+
+0981:     if not greenlets:
+
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_greenlets); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 981, __pyx_L1_error)
+  __pyx_t_3 = ((!__pyx_t_2) != 0);
+  if (__pyx_t_3) {
+/* … */
+  }
+
+0982:         return
+
    __Pyx_XDECREF(__pyx_r);
+    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+    goto __pyx_L0;
+
+0983:     loop = greenlets[0].loop
+
  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_greenlets, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 983, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_loop); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 983, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_4);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_v_loop = __pyx_t_4;
+  __pyx_t_4 = 0;
+
+0984:     if block:
+
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_block); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 984, __pyx_L1_error)
+  if (__pyx_t_3) {
+/* … */
+    goto __pyx_L4;
+  }
+
+0985:         waiter = Waiter() # pylint:disable=undefined-variable
+
    __pyx_t_4 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_6gevent_8__waiter_Waiter)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 985, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    __pyx_v_waiter = ((struct __pyx_obj_6gevent_8__waiter_Waiter *)__pyx_t_4);
+    __pyx_t_4 = 0;
+
+0986:         loop.run_callback(_killall3, greenlets, exception, waiter)
+
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_loop, __pyx_n_s_run_callback); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 986, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __pyx_t_5 = __Pyx_CFunc_object____list____object____object___to_py(__pyx_f_6gevent_9_greenlet__killall3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 986, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_5);
+    __pyx_t_6 = NULL;
+    __pyx_t_7 = 0;
+    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
+      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1);
+      if (likely(__pyx_t_6)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
+        __Pyx_INCREF(__pyx_t_6);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_1, function);
+        __pyx_t_7 = 1;
+      }
+    }
+    #if CYTHON_FAST_PYCALL
+    if (PyFunction_Check(__pyx_t_1)) {
+      PyObject *__pyx_temp[5] = {__pyx_t_6, __pyx_t_5, __pyx_v_greenlets, __pyx_v_exception, ((PyObject *)__pyx_v_waiter)};
+      __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_7, 4+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 986, __pyx_L1_error)
+      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+      __Pyx_GOTREF(__pyx_t_4);
+      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    } else
+    #endif
+    #if CYTHON_FAST_PYCCALL
+    if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
+      PyObject *__pyx_temp[5] = {__pyx_t_6, __pyx_t_5, __pyx_v_greenlets, __pyx_v_exception, ((PyObject *)__pyx_v_waiter)};
+      __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_7, 4+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 986, __pyx_L1_error)
+      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+      __Pyx_GOTREF(__pyx_t_4);
+      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    } else
+    #endif
+    {
+      __pyx_t_8 = PyTuple_New(4+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 986, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_8);
+      if (__pyx_t_6) {
+        __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL;
+      }
+      __Pyx_GIVEREF(__pyx_t_5);
+      PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_5);
+      __Pyx_INCREF(__pyx_v_greenlets);
+      __Pyx_GIVEREF(__pyx_v_greenlets);
+      PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_greenlets);
+      __Pyx_INCREF(__pyx_v_exception);
+      __Pyx_GIVEREF(__pyx_v_exception);
+      PyTuple_SET_ITEM(__pyx_t_8, 2+__pyx_t_7, __pyx_v_exception);
+      __Pyx_INCREF(((PyObject *)__pyx_v_waiter));
+      __Pyx_GIVEREF(((PyObject *)__pyx_v_waiter));
+      PyTuple_SET_ITEM(__pyx_t_8, 3+__pyx_t_7, ((PyObject *)__pyx_v_waiter));
+      __pyx_t_5 = 0;
+      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 986, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_4);
+      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+    }
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+
+0987:         t = Timeout._start_new_or_dummy(timeout)
+
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_6gevent_9_greenlet_Timeout, __pyx_n_s_start_new_or_dummy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 987, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __pyx_t_8 = NULL;
+    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
+      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_1);
+      if (likely(__pyx_t_8)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
+        __Pyx_INCREF(__pyx_t_8);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_1, function);
+      }
+    }
+    __pyx_t_4 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_8, __pyx_v_timeout) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_timeout);
+    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
+    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 987, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __pyx_v_t = __pyx_t_4;
+    __pyx_t_4 = 0;
+
+0988:         try:
+
    /*try:*/ {
+
+0989:             alive = waiter.get()
+
      __pyx_t_4 = ((struct __pyx_vtabstruct_6gevent_8__waiter_Waiter *)__pyx_v_waiter->__pyx_vtab)->get(__pyx_v_waiter, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 989, __pyx_L6_error)
+      __Pyx_GOTREF(__pyx_t_4);
+      __pyx_v_alive = __pyx_t_4;
+      __pyx_t_4 = 0;
+
+0990:             if alive:
+
      __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_alive); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 990, __pyx_L6_error)
+      if (__pyx_t_3) {
+/* … */
+      }
+    }
+
+0991:                 joinall(alive, raise_error=False)
+
        __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_joinall); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 991, __pyx_L6_error)
+        __Pyx_GOTREF(__pyx_t_4);
+        __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 991, __pyx_L6_error)
+        __Pyx_GOTREF(__pyx_t_1);
+        __Pyx_INCREF(__pyx_v_alive);
+        __Pyx_GIVEREF(__pyx_v_alive);
+        PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_alive);
+        __pyx_t_8 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 991, __pyx_L6_error)
+        __Pyx_GOTREF(__pyx_t_8);
+        if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_raise_error, Py_False) < 0) __PYX_ERR(0, 991, __pyx_L6_error)
+        __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_1, __pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 991, __pyx_L6_error)
+        __Pyx_GOTREF(__pyx_t_5);
+        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+
 0992:         finally:
+
+0993:             t.cancel()
+
    /*finally:*/ {
+      /*normal exit:*/{
+        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_t, __pyx_n_s_cancel); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 993, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_8);
+        __pyx_t_1 = NULL;
+        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
+          __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_8);
+          if (likely(__pyx_t_1)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
+            __Pyx_INCREF(__pyx_t_1);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_8, function);
+          }
+        }
+        __pyx_t_5 = (__pyx_t_1) ? __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_1) : __Pyx_PyObject_CallNoArg(__pyx_t_8);
+        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+        if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 993, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_5);
+        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+        goto __pyx_L7;
+      }
+      __pyx_L6_error:;
+      /*exception exit:*/{
+        __Pyx_PyThreadState_declare
+        __Pyx_PyThreadState_assign
+        __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0;
+        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
+        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+        if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_14, &__pyx_t_15, &__pyx_t_16);
+        if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13) < 0)) __Pyx_ErrFetch(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13);
+        __Pyx_XGOTREF(__pyx_t_11);
+        __Pyx_XGOTREF(__pyx_t_12);
+        __Pyx_XGOTREF(__pyx_t_13);
+        __Pyx_XGOTREF(__pyx_t_14);
+        __Pyx_XGOTREF(__pyx_t_15);
+        __Pyx_XGOTREF(__pyx_t_16);
+        __pyx_t_7 = __pyx_lineno; __pyx_t_9 = __pyx_clineno; __pyx_t_10 = __pyx_filename;
+        {
+          __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_t, __pyx_n_s_cancel); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 993, __pyx_L10_error)
+          __Pyx_GOTREF(__pyx_t_8);
+          __pyx_t_1 = NULL;
+          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
+            __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_8);
+            if (likely(__pyx_t_1)) {
+              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
+              __Pyx_INCREF(__pyx_t_1);
+              __Pyx_INCREF(function);
+              __Pyx_DECREF_SET(__pyx_t_8, function);
+            }
+          }
+          __pyx_t_5 = (__pyx_t_1) ? __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_1) : __Pyx_PyObject_CallNoArg(__pyx_t_8);
+          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+          if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 993, __pyx_L10_error)
+          __Pyx_GOTREF(__pyx_t_5);
+          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+        }
+        if (PY_MAJOR_VERSION >= 3) {
+          __Pyx_XGIVEREF(__pyx_t_14);
+          __Pyx_XGIVEREF(__pyx_t_15);
+          __Pyx_XGIVEREF(__pyx_t_16);
+          __Pyx_ExceptionReset(__pyx_t_14, __pyx_t_15, __pyx_t_16);
+        }
+        __Pyx_XGIVEREF(__pyx_t_11);
+        __Pyx_XGIVEREF(__pyx_t_12);
+        __Pyx_XGIVEREF(__pyx_t_13);
+        __Pyx_ErrRestore(__pyx_t_11, __pyx_t_12, __pyx_t_13);
+        __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0;
+        __pyx_lineno = __pyx_t_7; __pyx_clineno = __pyx_t_9; __pyx_filename = __pyx_t_10;
+        goto __pyx_L1_error;
+        __pyx_L10_error:;
+        if (PY_MAJOR_VERSION >= 3) {
+          __Pyx_XGIVEREF(__pyx_t_14);
+          __Pyx_XGIVEREF(__pyx_t_15);
+          __Pyx_XGIVEREF(__pyx_t_16);
+          __Pyx_ExceptionReset(__pyx_t_14, __pyx_t_15, __pyx_t_16);
+        }
+        __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
+        __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
+        __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
+        __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0;
+        goto __pyx_L1_error;
+      }
+      __pyx_L7:;
+    }
+
 0994:     else:
+
+0995:         loop.run_callback(_killall, greenlets, exception)
+
  /*else*/ {
+    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_loop, __pyx_n_s_run_callback); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 995, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_8);
+    __pyx_t_1 = __Pyx_CFunc_object____list____object___to_py(__pyx_f_6gevent_9_greenlet__killall); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 995, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __pyx_t_4 = NULL;
+    __pyx_t_9 = 0;
+    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
+      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_8);
+      if (likely(__pyx_t_4)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
+        __Pyx_INCREF(__pyx_t_4);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_8, function);
+        __pyx_t_9 = 1;
+      }
+    }
+    #if CYTHON_FAST_PYCALL
+    if (PyFunction_Check(__pyx_t_8)) {
+      PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_t_1, __pyx_v_greenlets, __pyx_v_exception};
+      __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_9, 3+__pyx_t_9); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 995, __pyx_L1_error)
+      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __Pyx_GOTREF(__pyx_t_5);
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    } else
+    #endif
+    #if CYTHON_FAST_PYCCALL
+    if (__Pyx_PyFastCFunction_Check(__pyx_t_8)) {
+      PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_t_1, __pyx_v_greenlets, __pyx_v_exception};
+      __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_9, 3+__pyx_t_9); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 995, __pyx_L1_error)
+      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __Pyx_GOTREF(__pyx_t_5);
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    } else
+    #endif
+    {
+      __pyx_t_6 = PyTuple_New(3+__pyx_t_9); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 995, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_6);
+      if (__pyx_t_4) {
+        __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
+      }
+      __Pyx_GIVEREF(__pyx_t_1);
+      PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_9, __pyx_t_1);
+      __Pyx_INCREF(__pyx_v_greenlets);
+      __Pyx_GIVEREF(__pyx_v_greenlets);
+      PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_9, __pyx_v_greenlets);
+      __Pyx_INCREF(__pyx_v_exception);
+      __Pyx_GIVEREF(__pyx_v_exception);
+      PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_9, __pyx_v_exception);
+      __pyx_t_1 = 0;
+      __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 995, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_5);
+      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+    }
+    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+  }
+  __pyx_L4:;
+
 0996: 
+
+0997: def _init():
+
static void __pyx_f_6gevent_9_greenlet__init(void) {
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_init", 0);
+/* … */
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+}
+
+0998:     greenlet_init() # pylint:disable=undefined-variable
+
  __pyx_f_6gevent_9_greenlet_greenlet_init();
+
 0999: 
+
+1000: _init()
+
  __pyx_f_6gevent_9_greenlet__init();
+
 1001: 
+
+1002: from gevent._util import import_c_accel
+
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1002, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_import_c_accel);
+  __Pyx_GIVEREF(__pyx_n_s_import_c_accel);
+  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_import_c_accel);
+  __pyx_t_1 = __Pyx_Import(__pyx_n_s_gevent__util, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1002, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_import_c_accel); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1002, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_import_c_accel, __pyx_t_2) < 0) __PYX_ERR(0, 1002, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+1003: import_c_accel(globals(), 'gevent._greenlet')
+
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_import_c_accel); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1003, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = __Pyx_Globals(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1003, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1003, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_4);
+  __Pyx_GIVEREF(__pyx_t_2);
+  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_gevent__greenlet);
+  __Pyx_GIVEREF(__pyx_n_s_gevent__greenlet);
+  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_n_s_gevent__greenlet);
+  __pyx_t_2 = 0;
+  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1003, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/greenlet.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/greenlet.py new file mode 100644 index 00000000..a2268567 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/greenlet.py @@ -0,0 +1,1003 @@ +# Copyright (c) 2009-2012 Denis Bilenko. See LICENSE for details. +# cython: auto_pickle=False,embedsignature=True,always_allow_keywords=False + +from __future__ import absolute_import, print_function, division + +from sys import _getframe as sys_getframe +from sys import exc_info as sys_exc_info +from weakref import ref as wref + +# XXX: How to get cython to let us rename this as RawGreenlet +# like we prefer? +from greenlet import greenlet +from greenlet import GreenletExit + +from gevent._compat import reraise +from gevent._compat import PYPY as _PYPY +from gevent._tblib import dump_traceback +from gevent._tblib import load_traceback + +from gevent.exceptions import InvalidSwitchError + +from gevent._hub_primitives import iwait_on_objects as iwait +from gevent._hub_primitives import wait_on_objects as wait + +from gevent.timeout import Timeout + +from gevent._config import config as GEVENT_CONFIG +from gevent._util import Lazy +from gevent._util import readproperty +from gevent._hub_local import get_hub_noargs as get_hub +from gevent import _waiter + + +__all__ = [ + 'Greenlet', + 'joinall', + 'killall', +] + + +# In Cython, we define these as 'cdef inline' functions. The +# compilation unit cannot have a direct assignment to them (import +# is assignment) without generating a 'lvalue is not valid target' +# error. +locals()['getcurrent'] = __import__('greenlet').getcurrent +locals()['greenlet_init'] = lambda: None +locals()['Waiter'] = _waiter.Waiter + + +if _PYPY: + import _continuation # pylint:disable=import-error + _continulet = _continuation.continulet + + +class SpawnedLink(object): + """ + A wrapper around link that calls it in another greenlet. + + Can be called only from main loop. + """ + __slots__ = ['callback'] + + def __init__(self, callback): + if not callable(callback): + raise TypeError("Expected callable: %r" % (callback, )) + self.callback = callback + + def __call__(self, source): + g = greenlet(self.callback, get_hub()) + g.switch(source) + + def __hash__(self): + return hash(self.callback) + + def __eq__(self, other): + return self.callback == getattr(other, 'callback', other) + + def __str__(self): + return str(self.callback) + + def __repr__(self): + return repr(self.callback) + + def __getattr__(self, item): + assert item != 'callback' + return getattr(self.callback, item) + + +class SuccessSpawnedLink(SpawnedLink): + """A wrapper around link that calls it in another greenlet only if source succeed. + + Can be called only from main loop. + """ + __slots__ = [] + + def __call__(self, source): + if source.successful(): + return SpawnedLink.__call__(self, source) + + +class FailureSpawnedLink(SpawnedLink): + """A wrapper around link that calls it in another greenlet only if source failed. + + Can be called only from main loop. + """ + __slots__ = [] + + def __call__(self, source): + if not source.successful(): + return SpawnedLink.__call__(self, source) + +class _Frame(object): + + __slots__ = ('f_code', 'f_lineno', 'f_back') + + def __init__(self, f_code, f_lineno, f_back): + self.f_code = f_code + self.f_lineno = f_lineno + self.f_back = f_back + + @property + def f_globals(self): + return None + +def _Frame_from_list(frames): + previous = None + for frame in reversed(frames): + f = _Frame(frame[0], frame[1], previous) + previous = f + return previous + +def _extract_stack(limit): + try: + frame = sys_getframe() + except ValueError: + # In certain embedded cases that directly use the Python C api + # to call Greenlet.spawn (e.g., uwsgi) this can raise + # `ValueError: call stack is not deep enough`. This is because + # the Cython stack frames for Greenlet.spawn -> + # Greenlet.__init__ -> _extract_stack are all on the C level, + # not the Python level. + # See https://github.com/gevent/gevent/issues/1212 + frame = None + + frames = [] + + while limit and frame is not None: + limit -= 1 + frames.append((frame.f_code, frame.f_lineno)) + frame = frame.f_back + + return frames + + +_greenlet__init__ = greenlet.__init__ + +class Greenlet(greenlet): + """ + A light-weight cooperatively-scheduled execution unit. + """ + # pylint:disable=too-many-public-methods,too-many-instance-attributes + + spawning_stack_limit = 10 + + # pylint:disable=keyword-arg-before-vararg,super-init-not-called + def __init__(self, run=None, *args, **kwargs): + """ + :param args: The arguments passed to the ``run`` function. + :param kwargs: The keyword arguments passed to the ``run`` function. + :keyword callable run: The callable object to run. If not given, this object's + `_run` method will be invoked (typically defined by subclasses). + + .. versionchanged:: 1.1b1 + The ``run`` argument to the constructor is now verified to be a callable + object. Previously, passing a non-callable object would fail after the greenlet + was spawned. + + .. versionchanged:: 1.3b1 + The ``GEVENT_TRACK_GREENLET_TREE`` configuration value may be set to + a false value to disable ``spawn_tree_locals``, ``spawning_greenlet``, + and ``spawning_stack``. The first two will be None in that case, and the + latter will be empty. + """ + # The attributes are documented in the .rst file + + # greenlet.greenlet(run=None, parent=None) + # Calling it with both positional arguments instead of a keyword + # argument (parent=get_hub()) speeds up creation of this object ~30%: + # python -m timeit -s 'import gevent' 'gevent.Greenlet()' + # Python 3.5: 2.70usec with keywords vs 1.94usec with positional + # Python 3.4: 2.32usec with keywords vs 1.74usec with positional + # Python 3.3: 2.55usec with keywords vs 1.92usec with positional + # Python 2.7: 1.73usec with keywords vs 1.40usec with positional + + # Timings taken Feb 21 2018 prior to integration of #755 + # python -m perf timeit -s 'import gevent' 'gevent.Greenlet()' + # 3.6.4 : Mean +- std dev: 1.08 us +- 0.05 us + # 2.7.14 : Mean +- std dev: 1.44 us +- 0.06 us + # PyPy2 5.10.0: Mean +- std dev: 2.14 ns +- 0.08 ns + + # After the integration of spawning_stack, spawning_greenlet, + # and spawn_tree_locals on that same date: + # 3.6.4 : Mean +- std dev: 8.92 us +- 0.36 us -> 8.2x + # 2.7.14 : Mean +- std dev: 14.8 us +- 0.5 us -> 10.2x + # PyPy2 5.10.0: Mean +- std dev: 3.24 us +- 0.17 us -> 1.5x + + # Compiling with Cython gets us to these numbers: + # 3.6.4 : Mean +- std dev: 3.63 us +- 0.14 us + # 2.7.14 : Mean +- std dev: 3.37 us +- 0.20 us + # PyPy2 5.10.0 : Mean +- std dev: 4.44 us +- 0.28 us + + + _greenlet__init__(self, None, get_hub()) + + if run is not None: + self._run = run + + # If they didn't pass a callable at all, then they must + # already have one. Note that subclassing to override the run() method + # itself has never been documented or supported. + if not callable(self._run): + raise TypeError("The run argument or self._run must be callable") + + self.args = args + self.kwargs = kwargs + self.value = None + + #: An event, such as a timer or a callback that fires. It is established in + #: start() and start_later() as those two objects, respectively. + #: Once this becomes non-None, the Greenlet cannot be started again. Conversely, + #: kill() and throw() check for non-None to determine if this object has ever been + #: scheduled for starting. A placeholder _dummy_event is assigned by them to prevent + #: the greenlet from being started in the future, if necessary. + self._start_event = None + + self._notifier = None + self._formatted_info = None + self._links = [] + self._ident = None + + # Initial state: None. + # Completed successfully: (None, None, None) + # Failed with exception: (t, v, dump_traceback(tb))) + self._exc_info = None + + if GEVENT_CONFIG.track_greenlet_tree: + spawner = getcurrent() # pylint:disable=undefined-variable + self.spawning_greenlet = wref(spawner) + try: + self.spawn_tree_locals = spawner.spawn_tree_locals + except AttributeError: + self.spawn_tree_locals = {} + if spawner.parent is not None: + # The main greenlet has no parent. + # Its children get separate locals. + spawner.spawn_tree_locals = self.spawn_tree_locals + + self._spawning_stack_frames = _extract_stack(self.spawning_stack_limit) + self._spawning_stack_frames.extend(getattr(spawner, '_spawning_stack_frames', [])) + else: + # None is the default for all of these in Cython, but we + # need to declare them for pure-Python mode. + self.spawning_greenlet = None + self.spawn_tree_locals = None + self._spawning_stack_frames = None + + @Lazy + def spawning_stack(self): + # Store this in the __dict__. We don't use it from the C + # code. It's tempting to discard _spawning_stack_frames + # after this, but child greenlets may still be created + # that need it. + return _Frame_from_list(self._spawning_stack_frames or []) + + def _get_minimal_ident(self): + reg = self.parent.ident_registry + return reg.get_ident(self) + + @property + def minimal_ident(self): + """ + A small, unique integer that identifies this object. + + This is similar to :attr:`threading.Thread.ident` (and `id`) + in that as long as this object is alive, no other greenlet *in + this hub* will have the same id, but it makes a stronger + guarantee that the assigned values will be small and + sequential. Sometime after this object has died, the value + will be available for reuse. + + To get ids that are unique across all hubs, combine this with + the hub's ``minimal_ident``. + + .. versionadded:: 1.3a2 + """ + if self._ident is None: + self._ident = self._get_minimal_ident() + return self._ident + + @readproperty + def name(self): + """ + The greenlet name. By default, a unique name is constructed using + the :attr:`minimal_ident`. You can assign a string to this + value to change it. It is shown in the `repr` of this object if it + has been assigned to or if the `minimal_ident` has already been generated. + + .. versionadded:: 1.3a2 + .. versionchanged:: 1.4 + Stop showing generated names in the `repr` when the ``minimal_ident`` + hasn't been requested. This reduces overhead and may be less confusing, + since ``minimal_ident`` can get reused. + """ + return 'Greenlet-%d' % (self.minimal_ident,) + + def _raise_exception(self): + reraise(*self.exc_info) + + @property + def loop(self): + # needed by killall + return self.parent.loop + + def __nonzero__(self): + return self._start_event is not None and self._exc_info is None + try: + __bool__ = __nonzero__ # Python 3 + except NameError: # pragma: no cover + # When we're compiled with Cython, the __nonzero__ function + # goes directly into the slot and can't be accessed by name. + pass + + ### Lifecycle + + if _PYPY: + # oops - pypy's .dead relies on __nonzero__ which we overriden above + @property + def dead(self): + "Boolean indicating that the greenlet is dead and will not run again." + if self._greenlet__main: + return False + if self.__start_cancelled_by_kill() or self.__started_but_aborted(): + return True + + return self._greenlet__started and not _continulet.is_pending(self) + else: + @property + def dead(self): + "Boolean indicating that the greenlet is dead and will not run again." + return self.__start_cancelled_by_kill() or self.__started_but_aborted() or greenlet.dead.__get__(self) + + def __never_started_or_killed(self): + return self._start_event is None + + def __start_pending(self): + return (self._start_event is not None + and (self._start_event.pending or getattr(self._start_event, 'active', False))) + + def __start_cancelled_by_kill(self): + return self._start_event is _cancelled_start_event + + def __start_completed(self): + return self._start_event is _start_completed_event + + def __started_but_aborted(self): + return (not self.__never_started_or_killed() # we have been started or killed + and not self.__start_cancelled_by_kill() # we weren't killed, so we must have been started + and not self.__start_completed() # the start never completed + and not self.__start_pending()) # and we're not pending, so we must have been aborted + + def __cancel_start(self): + if self._start_event is None: + # prevent self from ever being started in the future + self._start_event = _cancelled_start_event + # cancel any pending start event + # NOTE: If this was a real pending start event, this will leave a + # "dangling" callback/timer object in the hub.loop.callbacks list; + # depending on where we are in the event loop, it may even be in a local + # variable copy of that list (in _run_callbacks). This isn't a problem, + # except for the leak-tests. + self._start_event.stop() + self._start_event.close() + + def __handle_death_before_start(self, args): + # args is (t, v, tb) or simply t or v + if self._exc_info is None and self.dead: + # the greenlet was never switched to before and it will never be, _report_error was not called + # the result was not set and the links weren't notified. let's do it here. + # checking that self.dead is true is essential, because throw() does not necessarily kill the greenlet + # (if the exception raised by throw() is caught somewhere inside the greenlet). + if len(args) == 1: + arg = args[0] + #if isinstance(arg, type): + if type(arg) is type(Exception): + args = (arg, arg(), None) + else: + args = (type(arg), arg, None) + elif not args: + args = (GreenletExit, GreenletExit(), None) + self._report_error(args) + + @property + def started(self): + # DEPRECATED + return bool(self) + + def ready(self): + """ + Return a true value if and only if the greenlet has finished + execution. + + .. versionchanged:: 1.1 + This function is only guaranteed to return true or false *values*, not + necessarily the literal constants ``True`` or ``False``. + """ + return self.dead or self._exc_info is not None + + def successful(self): + """ + Return a true value if and only if the greenlet has finished execution + successfully, that is, without raising an error. + + .. tip:: A greenlet that has been killed with the default + :class:`GreenletExit` exception is considered successful. + That is, ``GreenletExit`` is not considered an error. + + .. note:: This function is only guaranteed to return true or false *values*, + not necessarily the literal constants ``True`` or ``False``. + """ + return self._exc_info is not None and self._exc_info[1] is None + + def __repr__(self): + classname = self.__class__.__name__ + # If no name has been assigned, don't generate one, including a minimal_ident, + # if not necessary. This reduces the use of weak references and associated + # overhead. + if 'name' not in self.__dict__ and self._ident is None: + name = ' ' + else: + name = ' "%s" ' % (self.name,) + result = '<%s%sat %s' % (classname, name, hex(id(self))) + formatted = self._formatinfo() + if formatted: + result += ': ' + formatted + return result + '>' + + + def _formatinfo(self): + info = self._formatted_info + if info is not None: + return info + + # Are we running an arbitrary function provided to the constructor, + # or did a subclass override _run? + func = self._run + im_self = getattr(func, '__self__', None) + if im_self is self: + funcname = '_run' + elif im_self is not None: + funcname = repr(func) + else: + funcname = getattr(func, '__name__', '') or repr(func) + + result = funcname + args = [] + if self.args: + args = [repr(x)[:50] for x in self.args] + if self.kwargs: + args.extend(['%s=%s' % (key, repr(value)[:50]) for (key, value) in self.kwargs.items()]) + if args: + result += '(' + ', '.join(args) + ')' + # it is important to save the result here, because once the greenlet exits '_run' attribute will be removed + self._formatted_info = result + return result + + @property + def exception(self): + """ + Holds the exception instance raised by the function if the + greenlet has finished with an error. Otherwise ``None``. + """ + return self._exc_info[1] if self._exc_info is not None else None + + @property + def exc_info(self): + """ + Holds the exc_info three-tuple raised by the function if the + greenlet finished with an error. Otherwise a false value. + + .. note:: This is a provisional API and may change. + + .. versionadded:: 1.1 + """ + ei = self._exc_info + if ei is not None and ei[0] is not None: + return (ei[0], ei[1], load_traceback(ei[2])) + + def throw(self, *args): + """Immediately switch into the greenlet and raise an exception in it. + + Should only be called from the HUB, otherwise the current greenlet is left unscheduled forever. + To raise an exception in a safe manner from any greenlet, use :meth:`kill`. + + If a greenlet was started but never switched to yet, then also + a) cancel the event that will start it + b) fire the notifications as if an exception was raised in a greenlet + """ + self.__cancel_start() + + try: + if not self.dead: + # Prevent switching into a greenlet *at all* if we had never + # started it. Usually this is the same thing that happens by throwing, + # but if this is done from the hub with nothing else running, prevents a + # LoopExit. + greenlet.throw(self, *args) + finally: + self.__handle_death_before_start(args) + + def start(self): + """Schedule the greenlet to run in this loop iteration""" + if self._start_event is None: + _call_spawn_callbacks(self) + self._start_event = self.parent.loop.run_callback(self.switch) + + def start_later(self, seconds): + """ + start_later(seconds) -> None + + Schedule the greenlet to run in the future loop iteration + *seconds* later + """ + if self._start_event is None: + _call_spawn_callbacks(self) + self._start_event = self.parent.loop.timer(seconds) + self._start_event.start(self.switch) + + @staticmethod + def add_spawn_callback(callback): + """ + add_spawn_callback(callback) -> None + + Set up a *callback* to be invoked when :class:`Greenlet` objects + are started. + + The invocation order of spawn callbacks is unspecified. Adding the + same callback more than one time will not cause it to be called more + than once. + + .. versionadded:: 1.4.0 + """ + global _spawn_callbacks + if _spawn_callbacks is None: # pylint:disable=used-before-assignment + _spawn_callbacks = set() + _spawn_callbacks.add(callback) + + @staticmethod + def remove_spawn_callback(callback): + """ + remove_spawn_callback(callback) -> None + + Remove *callback* function added with :meth:`Greenlet.add_spawn_callback`. + This function will not fail if *callback* has been already removed or + if *callback* was never added. + + .. versionadded:: 1.4.0 + """ + global _spawn_callbacks + if _spawn_callbacks is not None: + _spawn_callbacks.discard(callback) + if not _spawn_callbacks: + _spawn_callbacks = None + + @classmethod + def spawn(cls, *args, **kwargs): + """ + spawn(function, *args, **kwargs) -> Greenlet + + Create a new :class:`Greenlet` object and schedule it to run ``function(*args, **kwargs)``. + This can be used as ``gevent.spawn`` or ``Greenlet.spawn``. + + The arguments are passed to :meth:`Greenlet.__init__`. + + .. versionchanged:: 1.1b1 + If a *function* is given that is not callable, immediately raise a :exc:`TypeError` + instead of spawning a greenlet that will raise an uncaught TypeError. + """ + g = cls(*args, **kwargs) + g.start() + return g + + @classmethod + def spawn_later(cls, seconds, *args, **kwargs): + """ + spawn_later(seconds, function, *args, **kwargs) -> Greenlet + + Create and return a new `Greenlet` object scheduled to run ``function(*args, **kwargs)`` + in a future loop iteration *seconds* later. This can be used as ``Greenlet.spawn_later`` + or ``gevent.spawn_later``. + + The arguments are passed to :meth:`Greenlet.__init__`. + + .. versionchanged:: 1.1b1 + If an argument that's meant to be a function (the first argument in *args*, or the ``run`` keyword ) + is given to this classmethod (and not a classmethod of a subclass), + it is verified to be callable. Previously, the spawned greenlet would have failed + when it started running. + """ + if cls is Greenlet and not args and 'run' not in kwargs: + raise TypeError("") + g = cls(*args, **kwargs) + g.start_later(seconds) + return g + + def kill(self, exception=GreenletExit, block=True, timeout=None): + """ + Raise the ``exception`` in the greenlet. + + If ``block`` is ``True`` (the default), wait until the greenlet dies or the optional timeout expires. + If block is ``False``, the current greenlet is not unscheduled. + + The function always returns ``None`` and never raises an error. + + .. note:: + + Depending on what this greenlet is executing and the state + of the event loop, the exception may or may not be raised + immediately when this greenlet resumes execution. It may + be raised on a subsequent green call, or, if this greenlet + exits before making such a call, it may not be raised at + all. As of 1.1, an example where the exception is raised + later is if this greenlet had called :func:`sleep(0) + `; an example where the exception is raised + immediately is if this greenlet had called + :func:`sleep(0.1) `. + + .. caution:: + + Use care when killing greenlets. If the code executing is not + exception safe (e.g., makes proper use of ``finally``) then an + unexpected exception could result in corrupted state. + + See also :func:`gevent.kill`. + + :keyword type exception: The type of exception to raise in the greenlet. The default + is :class:`GreenletExit`, which indicates a :meth:`successful` completion + of the greenlet. + + .. versionchanged:: 0.13.0 + *block* is now ``True`` by default. + .. versionchanged:: 1.1a2 + If this greenlet had never been switched to, killing it will prevent it from ever being switched to. + """ + self.__cancel_start() + + if self.dead: + self.__handle_death_before_start((exception,)) + else: + waiter = Waiter() if block else None # pylint:disable=undefined-variable + self.parent.loop.run_callback(_kill, self, exception, waiter) + if block: + waiter.get() + self.join(timeout) + # it should be OK to use kill() in finally or kill a greenlet from more than one place; + # thus it should not raise when the greenlet is already killed (= not started) + + def get(self, block=True, timeout=None): + """ + get(block=True, timeout=None) -> object + + Return the result the greenlet has returned or re-raise the + exception it has raised. + + If block is ``False``, raise :class:`gevent.Timeout` if the + greenlet is still alive. If block is ``True``, unschedule the + current greenlet until the result is available or the timeout + expires. In the latter case, :class:`gevent.Timeout` is + raised. + """ + if self.ready(): + if self.successful(): + return self.value + self._raise_exception() + if not block: + raise Timeout() + + switch = getcurrent().switch # pylint:disable=undefined-variable + self.rawlink(switch) + try: + t = Timeout._start_new_or_dummy(timeout) + try: + result = self.parent.switch() + if result is not self: + raise InvalidSwitchError('Invalid switch into Greenlet.get(): %r' % (result, )) + finally: + t.cancel() + except: + # unlinking in 'except' instead of finally is an optimization: + # if switch occurred normally then link was already removed in _notify_links + # and there's no need to touch the links set. + # Note, however, that if "Invalid switch" assert was removed and invalid switch + # did happen, the link would remain, causing another invalid switch later in this greenlet. + self.unlink(switch) + raise + + if self.ready(): + if self.successful(): + return self.value + self._raise_exception() + + def join(self, timeout=None): + """ + join(timeout=None) -> None + + Wait until the greenlet finishes or *timeout* expires. Return + ``None`` regardless. + """ + if self.ready(): + return + + switch = getcurrent().switch # pylint:disable=undefined-variable + self.rawlink(switch) + try: + t = Timeout._start_new_or_dummy(timeout) + try: + result = self.parent.switch() + if result is not self: + raise InvalidSwitchError('Invalid switch into Greenlet.join(): %r' % (result, )) + finally: + t.cancel() + except Timeout as ex: + self.unlink(switch) + if ex is not t: + raise + except: + self.unlink(switch) + raise + + def _report_result(self, result): + self._exc_info = (None, None, None) + self.value = result + if self._links and not self._notifier: + self._notifier = self.parent.loop.run_callback(self._notify_links) + + def _report_error(self, exc_info): + if isinstance(exc_info[1], GreenletExit): + self._report_result(exc_info[1]) + return + + self._exc_info = exc_info[0], exc_info[1], dump_traceback(exc_info[2]) + + if self._links and not self._notifier: + self._notifier = self.parent.loop.run_callback(self._notify_links) + + try: + self.parent.handle_error(self, *exc_info) + finally: + del exc_info + + def run(self): + try: + self.__cancel_start() + self._start_event = _start_completed_event + + try: + result = self._run(*self.args, **self.kwargs) + except: # pylint:disable=bare-except + self._report_error(sys_exc_info()) + return + self._report_result(result) + finally: + self.__dict__.pop('_run', None) + self.args = () + self.kwargs.clear() + + def _run(self): + """ + Subclasses may override this method to take any number of + arguments and keyword arguments. + + .. versionadded:: 1.1a3 + Previously, if no callable object was + passed to the constructor, the spawned greenlet would later + fail with an AttributeError. + """ + # We usually override this in __init__ + # pylint: disable=method-hidden + return + + def has_links(self): + return len(self._links) + + def rawlink(self, callback): + """ + Register a callable to be executed when the greenlet finishes + execution. + + The *callback* will be called with this instance as an + argument. + + .. caution:: The callable will be called in the HUB greenlet. + """ + if not callable(callback): + raise TypeError('Expected callable: %r' % (callback, )) + self._links.append(callback) # pylint:disable=no-member + if self.ready() and self._links and not self._notifier: + self._notifier = self.parent.loop.run_callback(self._notify_links) + + def link(self, callback, SpawnedLink=SpawnedLink): + """ + Link greenlet's completion to a callable. + + The *callback* will be called with this instance as an + argument once this greenlet is dead. A callable is called in + its own :class:`greenlet.greenlet` (*not* a + :class:`Greenlet`). + """ + # XXX: Is the redefinition of SpawnedLink supposed to just be an + # optimization, or do people use it? It's not documented + # pylint:disable=redefined-outer-name + self.rawlink(SpawnedLink(callback)) + + def unlink(self, callback): + """Remove the callback set by :meth:`link` or :meth:`rawlink`""" + try: + self._links.remove(callback) # pylint:disable=no-member + except ValueError: + pass + + def unlink_all(self): + """ + Remove all the callbacks. + + .. versionadded:: 1.3a2 + """ + del self._links[:] + + def link_value(self, callback, SpawnedLink=SuccessSpawnedLink): + """ + Like :meth:`link` but *callback* is only notified when the greenlet + has completed successfully. + """ + # pylint:disable=redefined-outer-name + self.link(callback, SpawnedLink=SpawnedLink) + + def link_exception(self, callback, SpawnedLink=FailureSpawnedLink): + """ + Like :meth:`link` but *callback* is only notified when the + greenlet dies because of an unhandled exception. + """ + # pylint:disable=redefined-outer-name + self.link(callback, SpawnedLink=SpawnedLink) + + def _notify_links(self): + while self._links: + # Early links are allowed to remove later links + # before we get to them, and they're also allowed to + # add new links, so we have to be careful about iterating. + + # We don't expect this list to be very large, so the time spent + # manipulating it should be small. a deque is probably not justified. + # Cython has optimizations to transform this into a memmove anyway. + link = self._links.pop(0) + try: + link(self) + except: # pylint:disable=bare-except + self.parent.handle_error((link, self), *sys_exc_info()) + + +class _dummy_event(object): + __slots__ = ('pending', 'active') + + def __init__(self): + self.pending = self.active = False + + def stop(self): + pass + + def start(self, cb): # pylint:disable=unused-argument + raise AssertionError("Cannot start the dummy event") + + def close(self): + pass + +_cancelled_start_event = _dummy_event() +_start_completed_event = _dummy_event() + + +def _kill(glet, exception, waiter): + try: + glet.throw(exception) + except: # pylint:disable=bare-except + # XXX do we need this here? + glet.parent.handle_error(glet, *sys_exc_info()) + if waiter is not None: + waiter.switch(None) + + +def joinall(greenlets, timeout=None, raise_error=False, count=None): + """ + Wait for the ``greenlets`` to finish. + + :param greenlets: A sequence (supporting :func:`len`) of greenlets to wait for. + :keyword float timeout: If given, the maximum number of seconds to wait. + :return: A sequence of the greenlets that finished before the timeout (if any) + expired. + """ + if not raise_error: + return wait(greenlets, timeout=timeout, count=count) + + done = [] + for obj in iwait(greenlets, timeout=timeout, count=count): + if getattr(obj, 'exception', None) is not None: + if hasattr(obj, '_raise_exception'): + obj._raise_exception() + else: + raise obj.exception + done.append(obj) + return done + + +def _killall3(greenlets, exception, waiter): + diehards = [] + for g in greenlets: + if not g.dead: + try: + g.throw(exception) + except: # pylint:disable=bare-except + g.parent.handle_error(g, *sys_exc_info()) + if not g.dead: + diehards.append(g) + waiter.switch(diehards) + + +def _killall(greenlets, exception): + for g in greenlets: + if not g.dead: + try: + g.throw(exception) + except: # pylint:disable=bare-except + g.parent.handle_error(g, *sys_exc_info()) + + +def _call_spawn_callbacks(gr): + if _spawn_callbacks is not None: + for cb in _spawn_callbacks: + cb(gr) + + +_spawn_callbacks = None + + +def killall(greenlets, exception=GreenletExit, block=True, timeout=None): + """ + Forceably terminate all the ``greenlets`` by causing them to raise ``exception``. + + .. caution:: Use care when killing greenlets. If they are not prepared for exceptions, + this could result in corrupted state. + + :param greenlets: A **bounded** iterable of the non-None greenlets to terminate. + *All* the items in this iterable must be greenlets that belong to the same thread. + :keyword exception: The exception to raise in the greenlets. By default this is + :class:`GreenletExit`. + :keyword bool block: If True (the default) then this function only returns when all the + greenlets are dead; the current greenlet is unscheduled during that process. + If greenlets ignore the initial exception raised in them, + then they will be joined (with :func:`gevent.joinall`) and allowed to die naturally. + If False, this function returns immediately and greenlets will raise + the exception asynchronously. + :keyword float timeout: A time in seconds to wait for greenlets to die. If given, it is + only honored when ``block`` is True. + :raise Timeout: If blocking and a timeout is given that elapses before + all the greenlets are dead. + + .. versionchanged:: 1.1a2 + *greenlets* can be any iterable of greenlets, like an iterator or a set. + Previously it had to be a list or tuple. + """ + # support non-indexable containers like iterators or set objects + greenlets = list(greenlets) + if not greenlets: + return + loop = greenlets[0].loop + if block: + waiter = Waiter() # pylint:disable=undefined-variable + loop.run_callback(_killall3, greenlets, exception, waiter) + t = Timeout._start_new_or_dummy(timeout) + try: + alive = waiter.get() + if alive: + joinall(alive, raise_error=False) + finally: + t.cancel() + else: + loop.run_callback(_killall, greenlets, exception) + +def _init(): + greenlet_init() # pylint:disable=undefined-variable + +_init() + +from gevent._util import import_c_accel +import_c_accel(globals(), 'gevent._greenlet') diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/hub.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/hub.py new file mode 100644 index 00000000..2e26fa3a --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/hub.py @@ -0,0 +1,750 @@ +# Copyright (c) 2009-2015 Denis Bilenko. See LICENSE for details. +""" +Event-loop hub. +""" +from __future__ import absolute_import, print_function +# XXX: FIXME: Refactor to make this smaller +# pylint:disable=too-many-lines +from functools import partial as _functools_partial + +import sys +import traceback + + +from greenlet import greenlet as RawGreenlet +from greenlet import getcurrent +from greenlet import GreenletExit + + + +__all__ = [ + 'getcurrent', + 'GreenletExit', + 'spawn_raw', + 'sleep', + 'kill', + 'signal', + 'reinit', + 'get_hub', + 'Hub', + 'Waiter', +] + +from gevent._config import config as GEVENT_CONFIG +from gevent._compat import thread_mod_name +from gevent._util import readproperty +from gevent._util import Lazy +from gevent._util import gmctime +from gevent._ident import IdentRegistry + +from gevent._hub_local import get_hub +from gevent._hub_local import get_loop +from gevent._hub_local import set_hub +from gevent._hub_local import set_loop +from gevent._hub_local import get_hub_if_exists as _get_hub +from gevent._hub_local import get_hub_noargs as _get_hub_noargs +from gevent._hub_local import set_default_hub_class + +from gevent._greenlet_primitives import TrackedRawGreenlet +from gevent._hub_primitives import WaitOperationsGreenlet + +# Export +from gevent import _hub_primitives +wait = _hub_primitives.wait_on_objects +iwait = _hub_primitives.iwait_on_objects + + +from gevent.exceptions import LoopExit + +from gevent._waiter import Waiter + +# Need the real get_ident. We're imported early enough (by gevent/__init__.py) +# that we can be sure nothing is monkey patched yet. +get_thread_ident = __import__(thread_mod_name).get_ident +MAIN_THREAD_IDENT = get_thread_ident() # XXX: Assuming import is done on the main thread. + + +def spawn_raw(function, *args, **kwargs): + """ + Create a new :class:`greenlet.greenlet` object and schedule it to + run ``function(*args, **kwargs)``. + + This returns a raw :class:`~greenlet.greenlet` which does not have all the useful + methods that :class:`gevent.Greenlet` has. Typically, applications + should prefer :func:`~gevent.spawn`, but this method may + occasionally be useful as an optimization if there are many + greenlets involved. + + .. versionchanged:: 1.1a3 + Verify that ``function`` is callable, raising a TypeError if not. Previously, + the spawned greenlet would have failed the first time it was switched to. + + .. versionchanged:: 1.1b1 + If *function* is not callable, immediately raise a :exc:`TypeError` + instead of spawning a greenlet that will raise an uncaught TypeError. + + .. versionchanged:: 1.1rc2 + Accept keyword arguments for ``function`` as previously (incorrectly) + documented. Note that this may incur an additional expense. + + .. versionchanged:: 1.3a2 + Populate the ``spawning_greenlet`` and ``spawn_tree_locals`` + attributes of the returned greenlet. + + .. versionchanged:: 1.3b1 + *Only* populate ``spawning_greenlet`` and ``spawn_tree_locals`` + if ``GEVENT_TRACK_GREENLET_TREE`` is enabled (the default). If not enabled, + those attributes will not be set. + + """ + if not callable(function): + raise TypeError("function must be callable") + + # The hub is always the parent. + hub = _get_hub_noargs() + + factory = TrackedRawGreenlet if GEVENT_CONFIG.track_greenlet_tree else RawGreenlet + + # The callback class object that we use to run this doesn't + # accept kwargs (and those objects are heavily used, as well as being + # implemented twice in core.ppyx and corecffi.py) so do it with a partial + if kwargs: + function = _functools_partial(function, *args, **kwargs) + g = factory(function, hub) + hub.loop.run_callback(g.switch) + else: + g = factory(function, hub) + hub.loop.run_callback(g.switch, *args) + + return g + + +def sleep(seconds=0, ref=True): + """ + Put the current greenlet to sleep for at least *seconds*. + + *seconds* may be specified as an integer, or a float if fractional + seconds are desired. + + .. tip:: In the current implementation, a value of 0 (the default) + means to yield execution to any other runnable greenlets, but + this greenlet may be scheduled again before the event loop + cycles (in an extreme case, a greenlet that repeatedly sleeps + with 0 can prevent greenlets that are ready to do I/O from + being scheduled for some (small) period of time); a value greater than + 0, on the other hand, will delay running this greenlet until + the next iteration of the loop. + + If *ref* is False, the greenlet running ``sleep()`` will not prevent :func:`gevent.wait` + from exiting. + + .. versionchanged:: 1.3a1 + Sleeping with a value of 0 will now be bounded to approximately block the + loop for no longer than :func:`gevent.getswitchinterval`. + + .. seealso:: :func:`idle` + """ + hub = _get_hub_noargs() + loop = hub.loop + if seconds <= 0: + waiter = Waiter(hub) + loop.run_callback(waiter.switch, None) + waiter.get() + else: + with loop.timer(seconds, ref=ref) as t: + # Sleeping is expected to be an "absolute" measure with + # respect to time.time(), not a relative measure, so it's + # important to update the loop's notion of now before we start + loop.update_now() + hub.wait(t) + + +def idle(priority=0): + """ + Cause the calling greenlet to wait until the event loop is idle. + + Idle is defined as having no other events of the same or higher + *priority* pending. That is, as long as sockets, timeouts or even + signals of the same or higher priority are being processed, the loop + is not idle. + + .. seealso:: :func:`sleep` + """ + hub = _get_hub_noargs() + watcher = hub.loop.idle() + if priority: + watcher.priority = priority + hub.wait(watcher) + + +def kill(greenlet, exception=GreenletExit): + """ + Kill greenlet asynchronously. The current greenlet is not unscheduled. + + .. note:: + + The method :meth:`Greenlet.kill` method does the same and + more (and the same caveats listed there apply here). However, the MAIN + greenlet - the one that exists initially - does not have a + ``kill()`` method, and neither do any created with :func:`spawn_raw`, + so you have to use this function. + + .. caution:: Use care when killing greenlets. If they are not prepared for + exceptions, this could result in corrupted state. + + .. versionchanged:: 1.1a2 + If the ``greenlet`` has a :meth:`kill ` method, calls it. This prevents a + greenlet from being switched to for the first time after it's been + killed but not yet executed. + """ + if not greenlet.dead: + if hasattr(greenlet, 'kill'): + # dealing with gevent.greenlet.Greenlet. Use it, especially + # to avoid allowing one to be switched to for the first time + # after it's been killed + greenlet.kill(exception=exception, block=False) + else: + _get_hub_noargs().loop.run_callback(greenlet.throw, exception) + + +class signal(object): + """ + Call the *handler* with the *args* and *kwargs* when the process + receives the signal *signalnum*. + + The *handler* will be run in a new greenlet when the signal is delivered. + + This returns an object with the useful method ``cancel``, which, when called, + will prevent future deliveries of *signalnum* from calling *handler*. + + .. note:: + + This may not operate correctly with SIGCHLD if libev child watchers + are used (as they are by default with os.fork). + + .. versionchanged:: 1.2a1 + The ``handler`` argument is required to be callable at construction time. + """ + + # XXX: This is manually documented in gevent.rst while it is aliased in + # the gevent module. + + greenlet_class = None + + def __init__(self, signalnum, handler, *args, **kwargs): + if not callable(handler): + raise TypeError("signal handler must be callable.") + + self.hub = _get_hub_noargs() + self.watcher = self.hub.loop.signal(signalnum, ref=False) + self.watcher.start(self._start) + self.handler = handler + self.args = args + self.kwargs = kwargs + if self.greenlet_class is None: + from gevent import Greenlet + self.greenlet_class = Greenlet + + def _get_ref(self): + return self.watcher.ref + + def _set_ref(self, value): + self.watcher.ref = value + + ref = property(_get_ref, _set_ref) + del _get_ref, _set_ref + + def cancel(self): + self.watcher.stop() + + def _start(self): + try: + greenlet = self.greenlet_class(self.handle) + greenlet.switch() + except: # pylint:disable=bare-except + self.hub.handle_error(None, *sys._exc_info()) # pylint:disable=no-member + + def handle(self): + try: + self.handler(*self.args, **self.kwargs) + except: # pylint:disable=bare-except + self.hub.handle_error(None, *sys.exc_info()) + + +def reinit(hub=None): + """ + reinit() -> None + + Prepare the gevent hub to run in a new (forked) process. + + This should be called *immediately* after :func:`os.fork` in the + child process. This is done automatically by + :func:`gevent.os.fork` or if the :mod:`os` module has been + monkey-patched. If this function is not called in a forked + process, symptoms may include hanging of functions like + :func:`socket.getaddrinfo`, and the hub's threadpool is unlikely + to work. + + .. note:: Registered fork watchers may or may not run before + this function (and thus ``gevent.os.fork``) return. If they have + not run, they will run "soon", after an iteration of the event loop. + You can force this by inserting a few small (but non-zero) calls to :func:`sleep` + after fork returns. (As of gevent 1.1 and before, fork watchers will + not have run, but this may change in the future.) + + .. note:: This function may be removed in a future major release + if the fork process can be more smoothly managed. + + .. warning:: See remarks in :func:`gevent.os.fork` about greenlets + and event loop watchers in the child process. + """ + # Note the signature line in the docstring: hub is not a public param. + + # The loop reinit function in turn calls libev's ev_loop_fork + # function. + hub = _get_hub() if hub is None else hub + if hub is None: + return + + # Note that we reinit the existing loop, not destroy it. + # See https://github.com/gevent/gevent/issues/200. + hub.loop.reinit() + # libev's fork watchers are slow to fire because the only fire + # at the beginning of a loop; due to our use of callbacks that + # run at the end of the loop, that may be too late. The + # threadpool and resolvers depend on the fork handlers being + # run (specifically, the threadpool will fail in the forked + # child if there were any threads in it, which there will be + # if the resolver_thread was in use (the default) before the + # fork.) + # + # If the forked process wants to use the threadpool or + # resolver immediately (in a queued callback), it would hang. + # + # The below is a workaround. Fortunately, all of these + # methods are idempotent and can be called multiple times + # following a fork if the suddenly started working, or were + # already working on some platforms. Other threadpools and fork handlers + # will be called at an arbitrary time later ('soon') + for obj in (hub._threadpool, hub._resolver, hub.periodic_monitoring_thread): + getattr(obj, '_on_fork', lambda: None)() + + # TODO: We'd like to sleep for a non-zero amount of time to force the loop to make a + # pass around before returning to this greenlet. That will allow any + # user-provided fork watchers to run. (Two calls are necessary.) HOWEVER, if + # we do this, certain tests that heavily mix threads and forking, + # like 2.7/test_threading:test_reinit_tls_after_fork, fail. It's not immediately clear + # why. + #sleep(0.00001) + #sleep(0.00001) + + +class Hub(WaitOperationsGreenlet): + """ + A greenlet that runs the event loop. + + It is created automatically by :func:`get_hub`. + + .. rubric:: Switching + + Every time this greenlet (i.e., the event loop) is switched *to*, + if the current greenlet has a ``switch_out`` method, it will be + called. This allows a greenlet to take some cleanup actions before + yielding control. This method should not call any gevent blocking + functions. + """ + + #: If instances of these classes are raised into the event loop, + #: they will be propagated out to the main greenlet (where they will + #: usually be caught by Python itself) + SYSTEM_ERROR = (KeyboardInterrupt, SystemExit, SystemError) + + #: Instances of these classes are not considered to be errors and + #: do not get logged/printed when raised by the event loop. + NOT_ERROR = (GreenletExit, SystemExit) + + #: The size we use for our threadpool. Either use a subclass + #: for this, or change it immediately after creating the hub. + threadpool_size = 10 + + # An instance of PeriodicMonitoringThread, if started. + periodic_monitoring_thread = None + + # The ident of the thread we were created in, which should be the + # thread that we run in. + thread_ident = None + + #: A string giving the name of this hub. Useful for associating hubs + #: with particular threads. Printed as part of the default repr. + #: + #: .. versionadded:: 1.3b1 + name = '' + + # NOTE: We cannot define a class-level 'loop' attribute + # because that conflicts with the slot we inherit from the + # Cythonized-bases. + + # This is the source for our 'minimal_ident' property. We don't use a + # IdentRegistry because we've seen some crashes having to do with + # clearing weak references on shutdown in Windows (see known_failures.py). + # This gives us slightly different semantics than a greenlet's minimal_ident + # (notably, there can be holes) but we never documented this object's minimal_ident, + # and there should be few enough hub's over the lifetime of a process so as not + # to matter much. + _hub_counter = 0 + + def __init__(self, loop=None, default=None): + WaitOperationsGreenlet.__init__(self, None, None) + self.thread_ident = get_thread_ident() + if hasattr(loop, 'run'): + if default is not None: + raise TypeError("Unexpected argument: default") + self.loop = loop + elif get_loop() is not None: + # Reuse a loop instance previously set by + # destroying a hub without destroying the associated + # loop. See #237 and #238. + self.loop = get_loop() + else: + if default is None and self.thread_ident != MAIN_THREAD_IDENT: + default = False + + if loop is None: + loop = self.backend + self.loop = self.loop_class(flags=loop, default=default) # pylint:disable=not-callable + self._resolver = None + self._threadpool = None + self.format_context = GEVENT_CONFIG.format_context + + Hub._hub_counter += 1 + self.minimal_ident = Hub._hub_counter + + @Lazy + def ident_registry(self): + return IdentRegistry() + + @property + def loop_class(self): + return GEVENT_CONFIG.loop + + @property + def backend(self): + return GEVENT_CONFIG.libev_backend + + @property + def main_hub(self): + """ + Is this the hub for the main thread? + + .. versionadded:: 1.3b1 + """ + return self.thread_ident == MAIN_THREAD_IDENT + + def __repr__(self): + if self.loop is None: + info = 'destroyed' + else: + try: + info = self.loop._format() + except Exception as ex: # pylint:disable=broad-except + info = str(ex) or repr(ex) or 'error' + result = '<%s %r at 0x%x %s' % ( + self.__class__.__name__, + self.name, + id(self), + info) + if self._resolver is not None: + result += ' resolver=%r' % self._resolver + if self._threadpool is not None: + result += ' threadpool=%r' % self._threadpool + result += ' thread_ident=%s' % (hex(self.thread_ident), ) + return result + '>' + + def handle_error(self, context, type, value, tb): + """ + Called by the event loop when an error occurs. The arguments + type, value, and tb are the standard tuple returned by :func:`sys.exc_info`. + + Applications can set a property on the hub with this same signature + to override the error handling provided by this class. + + Errors that are :attr:`system errors ` are passed + to :meth:`handle_system_error`. + + :param context: If this is ``None``, indicates a system error that + should generally result in exiting the loop and being thrown to the + parent greenlet. + """ + if isinstance(value, str): + # Cython can raise errors where the value is a plain string + # e.g., AttributeError, "_semaphore.Semaphore has no attr", + value = type(value) + if not issubclass(type, self.NOT_ERROR): + self.print_exception(context, type, value, tb) + if context is None or issubclass(type, self.SYSTEM_ERROR): + self.handle_system_error(type, value) + + def handle_system_error(self, type, value): + """ + Called from `handle_error` when the exception type is determined + to be a :attr:`system error `. + + System errors cause the exception to be raised in the main + greenlet (the parent of this hub). + """ + current = getcurrent() + if current is self or current is self.parent or self.loop is None: + self.parent.throw(type, value) + else: + # in case system error was handled and life goes on + # switch back to this greenlet as well + cb = None + try: + cb = self.loop.run_callback(current.switch) + except: # pylint:disable=bare-except + traceback.print_exc(file=self.exception_stream) + try: + self.parent.throw(type, value) + finally: + if cb is not None: + cb.stop() + + @readproperty + def exception_stream(self): + """ + The stream to which exceptions will be written. + Defaults to ``sys.stderr`` unless assigned to. + + .. versionadded:: 1.2a1 + """ + # Unwrap any FileObjectThread we have thrown around sys.stderr + # (because it can't be used in the hub). Tricky because we are + # called in error situations when it's not safe to import. + # Be careful not to access sys if we're in the process of interpreter + # shutdown. + stderr = sys.stderr if sys else None # pylint:disable=using-constant-test + if type(stderr).__name__ == 'FileObjectThread': + stderr = stderr.io # pylint:disable=no-member + return stderr + + def print_exception(self, context, type, value, tb): + # Python 3 does not gracefully handle None value or tb in + # traceback.print_exception() as previous versions did. + # pylint:disable=no-member + errstream = self.exception_stream + if not errstream: # pragma: no cover + # If the error stream is gone, such as when the sys dict + # gets cleared during interpreter shutdown, + # don't cause follow-on errors. + # See https://github.com/gevent/gevent/issues/1295 + return + + if value is None: + errstream.write('%s\n' % type.__name__) + else: + traceback.print_exception(type, value, tb, file=errstream) + del tb + + try: + errstream.write(gmctime()) + errstream.write(' ' if context is not None else '\n') + except: # pylint:disable=bare-except + # Possible not safe to import under certain + # error conditions in Python 2 + pass + + if context is not None: + if not isinstance(context, str): + try: + context = self.format_context(context) + except: # pylint:disable=bare-except + traceback.print_exc(file=self.exception_stream) + context = repr(context) + errstream.write('%s failed with %s\n\n' % (context, getattr(type, '__name__', 'exception'), )) + + + def run(self): + """ + Entry-point to running the loop. This method is called automatically + when the hub greenlet is scheduled; do not call it directly. + + :raises gevent.exceptions.LoopExit: If the loop finishes running. This means + that there are no other scheduled greenlets, and no active + watchers or servers. In some situations, this indicates a + programming error. + """ + assert self is getcurrent(), 'Do not call Hub.run() directly' + self.start_periodic_monitoring_thread() + while 1: + loop = self.loop + loop.error_handler = self + try: + loop.run() + finally: + loop.error_handler = None # break the refcount cycle + debug = [] + if hasattr(loop, 'debug'): + debug = loop.debug() + self.parent.throw(LoopExit('This operation would block forever', self, debug)) + # this function must never return, as it will cause switch() in the parent greenlet + # to return an unexpected value + # It is still possible to kill this greenlet with throw. However, in that case + # switching to it is no longer safe, as switch will return immediately + + def start_periodic_monitoring_thread(self): + if self.periodic_monitoring_thread is None and GEVENT_CONFIG.monitor_thread: + # Note that it is possible for one real thread to + # (temporarily) wind up with multiple monitoring threads, + # if hubs are started and stopped within the thread. This shows up + # in the threadpool tests. The monitoring threads will eventually notice their + # hub object is gone. + from gevent._monitor import PeriodicMonitoringThread + from gevent.events import PeriodicMonitorThreadStartedEvent + from gevent.events import notify_and_call_entry_points + self.periodic_monitoring_thread = PeriodicMonitoringThread(self) + + if self.main_hub: + self.periodic_monitoring_thread.install_monitor_memory_usage() + + notify_and_call_entry_points(PeriodicMonitorThreadStartedEvent( + self.periodic_monitoring_thread)) + + return self.periodic_monitoring_thread + + def join(self, timeout=None): + """Wait for the event loop to finish. Exits only when there are + no more spawned greenlets, started servers, active timeouts or watchers. + + If *timeout* is provided, wait no longer for the specified number of seconds. + + Returns True if exited because the loop finished execution. + Returns False if exited because of timeout expired. + """ + assert getcurrent() is self.parent, "only possible from the MAIN greenlet" + if self.dead: + return True + + waiter = Waiter(self) + + if timeout is not None: + timeout = self.loop.timer(timeout, ref=False) + timeout.start(waiter.switch, None) + + try: + try: + waiter.get() + except LoopExit: + return True + finally: + if timeout is not None: + timeout.stop() + timeout.close() + return False + + def destroy(self, destroy_loop=None): + """ + Destroy this hub and clean up its resources. + + If you manually create hubs, you *should* call this + method before disposing of the hub object reference. + """ + if self.periodic_monitoring_thread is not None: + self.periodic_monitoring_thread.kill() + self.periodic_monitoring_thread = None + if self._resolver is not None: + self._resolver.close() + del self._resolver + if self._threadpool is not None: + self._threadpool.kill() + del self._threadpool + if destroy_loop is None: + destroy_loop = not self.loop.default + if destroy_loop: + if get_loop() is self.loop: + # Don't let anyone try to reuse this + set_loop(None) + self.loop.destroy() + else: + # Store in case another hub is created for this + # thread. + set_loop(self.loop) + + + self.loop = None + if _get_hub() is self: + set_hub(None) + + + # XXX: We can probably simplify the resolver and threadpool properties. + + @property + def resolver_class(self): + return GEVENT_CONFIG.resolver + + def _get_resolver(self): + if self._resolver is None: + self._resolver = self.resolver_class(hub=self) # pylint:disable=not-callable + return self._resolver + + def _set_resolver(self, value): + self._resolver = value + + def _del_resolver(self): + self._resolver = None + + resolver = property(_get_resolver, _set_resolver, _del_resolver, + """ + The DNS resolver that the socket functions will use. + + .. seealso:: :doc:`/dns` + """) + + + @property + def threadpool_class(self): + return GEVENT_CONFIG.threadpool + + def _get_threadpool(self): + if self._threadpool is None: + # pylint:disable=not-callable + self._threadpool = self.threadpool_class(self.threadpool_size, hub=self) + return self._threadpool + + def _set_threadpool(self, value): + self._threadpool = value + + def _del_threadpool(self): + self._threadpool = None + + threadpool = property(_get_threadpool, _set_threadpool, _del_threadpool, + """ + The threadpool associated with this hub. + + Usually this is a + :class:`gevent.threadpool.ThreadPool`, but + you :attr:`can customize that + `. + + Use this object to schedule blocking + (non-cooperative) operations in a different + thread to prevent them from halting the event loop. + """) + + +set_default_hub_class(Hub) + + + +class linkproxy(object): + __slots__ = ['callback', 'obj'] + + def __init__(self, callback, obj): + self.callback = callback + self.obj = obj + + def __call__(self, *args): + callback = self.callback + obj = self.obj + self.callback = None + self.obj = None + callback(obj) diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/libev/__init__.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/libev/__init__.py new file mode 100644 index 00000000..412d64ce --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/libev/__init__.py @@ -0,0 +1,7 @@ +# -*- coding: utf-8 -*- +from __future__ import absolute_import +from __future__ import division +from __future__ import print_function + +# Nothing public here +__all__ = [] diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/libev/_corecffi_build.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/libev/_corecffi_build.py new file mode 100644 index 00000000..a6025fc4 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/libev/_corecffi_build.py @@ -0,0 +1,75 @@ +# pylint: disable=no-member + +# This module is only used to create and compile the gevent._corecffi module; +# nothing should be directly imported from it except `ffi`, which should only be +# used for `ffi.compile()`; programs should import gevent._corecfffi. +# However, because we are using "out-of-line" mode, it is necessary to examine +# this file to know what functions are created and available on the generated +# module. +from __future__ import absolute_import, print_function +import sys +import os +import os.path # pylint:disable=no-name-in-module +import struct + +__all__ = [] + + +def system_bits(): + return struct.calcsize('P') * 8 + + +def st_nlink_type(): + if sys.platform == "darwin" or sys.platform.startswith("freebsd"): + return "short" + if system_bits() == 32: + return "unsigned long" + return "long long" + + +from cffi import FFI +ffi = FFI() + +thisdir = os.path.dirname(os.path.abspath(__file__)) +def read_source(name): + with open(os.path.join(thisdir, name), 'r') as f: + return f.read() + +_cdef = read_source('_corecffi_cdef.c') +_source = read_source('_corecffi_source.c') + +_cdef = _cdef.replace('#define GEVENT_ST_NLINK_T int', '') +_cdef = _cdef.replace('#define GEVENT_STRUCT_DONE int', '') +_cdef = _cdef.replace('GEVENT_ST_NLINK_T', st_nlink_type()) +_cdef = _cdef.replace("GEVENT_STRUCT_DONE _;", '...;') + + +if sys.platform.startswith('win'): + # We must have the vfd_open, etc, functions on + # Windows. But on other platforms, going through + # CFFI to just return the file-descriptor is slower + # than just doing it in Python, so we check for and + # workaround their absence in corecffi.py + _cdef += """ +typedef int... vfd_socket_t; +int vfd_open(vfd_socket_t); +vfd_socket_t vfd_get(int); +void vfd_free(int); +""" + + + +include_dirs = [ + thisdir, # libev_vfd.h + os.path.abspath(os.path.join(thisdir, '..', '..', '..', 'deps', 'libev')), +] +ffi.cdef(_cdef) +ffi.set_source('gevent.libev._corecffi', _source, include_dirs=include_dirs) + +if __name__ == '__main__': + # XXX: Note, on Windows, we would need to specify the external libraries + # that should be linked in, such as ws2_32 and (because libev_vfd.h makes + # Python.h calls) the proper Python library---at least for PyPy. I never got + # that to work though, and calling python functions is strongly discouraged + # from CFFI code. + ffi.compile() diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/libev/_corecffi_cdef.c b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/libev/_corecffi_cdef.c new file mode 100644 index 00000000..3280e991 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/libev/_corecffi_cdef.c @@ -0,0 +1,243 @@ +/* libev interface */ + +#define EV_MINPRI ... +#define EV_MAXPRI ... + +#define EV_VERSION_MAJOR ... +#define EV_VERSION_MINOR ... + +#define EV_UNDEF ... +#define EV_NONE ... +#define EV_READ ... +#define EV_WRITE ... +#define EV__IOFDSET ... +#define EV_TIMER ... +#define EV_PERIODIC ... +#define EV_SIGNAL ... +#define EV_CHILD ... +#define EV_STAT ... +#define EV_IDLE ... +#define EV_PREPARE ... +#define EV_CHECK ... +#define EV_EMBED ... +#define EV_FORK ... +#define EV_CLEANUP ... +#define EV_ASYNC ... +#define EV_CUSTOM ... +#define EV_ERROR ... + +#define EVFLAG_AUTO ... +#define EVFLAG_NOENV ... +#define EVFLAG_FORKCHECK ... +#define EVFLAG_NOINOTIFY ... +#define EVFLAG_SIGNALFD ... +#define EVFLAG_NOSIGMASK ... + +#define EVBACKEND_SELECT ... +#define EVBACKEND_POLL ... +#define EVBACKEND_EPOLL ... +#define EVBACKEND_KQUEUE ... +#define EVBACKEND_DEVPOLL ... +#define EVBACKEND_PORT ... +/* #define EVBACKEND_IOCP ... */ + +#define EVBACKEND_ALL ... +#define EVBACKEND_MASK ... + +#define EVRUN_NOWAIT ... +#define EVRUN_ONCE ... + +#define EVBREAK_CANCEL ... +#define EVBREAK_ONE ... +#define EVBREAK_ALL ... + +/* markers for the CFFI parser. Replaced when the string is read. */ +#define GEVENT_STRUCT_DONE int +#define GEVENT_ST_NLINK_T int + +struct ev_loop { + int backend_fd; + int activecnt; + GEVENT_STRUCT_DONE _; +}; + +// Watcher types +// base for all watchers +struct ev_watcher{ + void* data; + GEVENT_STRUCT_DONE _; +}; + +struct ev_io { + int fd; + int events; + void* data; + GEVENT_STRUCT_DONE _; +}; +struct ev_timer { + double at; + void* data; + GEVENT_STRUCT_DONE _; +}; +struct ev_signal { + void* data; + GEVENT_STRUCT_DONE _; +}; +struct ev_idle { + void* data; + GEVENT_STRUCT_DONE _; +}; +struct ev_prepare { + void* data; + GEVENT_STRUCT_DONE _; +}; +struct ev_check { + void* data; + GEVENT_STRUCT_DONE _; +}; +struct ev_fork { + void* data; + GEVENT_STRUCT_DONE _; +}; +struct ev_async { + void* data; + GEVENT_STRUCT_DONE _; +}; + +struct ev_child { + int pid; + int rpid; + int rstatus; + void* data; + GEVENT_STRUCT_DONE _; +}; + +struct stat { + GEVENT_ST_NLINK_T st_nlink; + GEVENT_STRUCT_DONE _; +}; + +struct ev_stat { + struct stat attr; + const char* path; + struct stat prev; + double interval; + void* data; + GEVENT_STRUCT_DONE _; +}; + +typedef double ev_tstamp; + +int ev_version_major(); +int ev_version_minor(); + +unsigned int ev_supported_backends (void); +unsigned int ev_recommended_backends (void); +unsigned int ev_embeddable_backends (void); + +ev_tstamp ev_time (void); +void ev_set_syserr_cb(void *); + +void ev_set_userdata(struct ev_loop*, void*); +void* ev_userdata(struct ev_loop*); + +int ev_priority(void*); +void ev_set_priority(void*, int); + +int ev_is_pending(void*); +int ev_is_active(void*); +void ev_io_init(struct ev_io*, void* callback, int fd, int events); +void ev_io_start(struct ev_loop*, struct ev_io*); +void ev_io_stop(struct ev_loop*, struct ev_io*); +void ev_feed_event(struct ev_loop*, void*, int); + +void ev_timer_init(struct ev_timer*, void *callback, double, double); +void ev_timer_start(struct ev_loop*, struct ev_timer*); +void ev_timer_stop(struct ev_loop*, struct ev_timer*); +void ev_timer_again(struct ev_loop*, struct ev_timer*); + +void ev_signal_init(struct ev_signal*, void* callback, int); +void ev_signal_start(struct ev_loop*, struct ev_signal*); +void ev_signal_stop(struct ev_loop*, struct ev_signal*); + +void ev_idle_init(struct ev_idle*, void* callback); +void ev_idle_start(struct ev_loop*, struct ev_idle*); +void ev_idle_stop(struct ev_loop*, struct ev_idle*); + +void ev_prepare_init(struct ev_prepare*, void* callback); +void ev_prepare_start(struct ev_loop*, struct ev_prepare*); +void ev_prepare_stop(struct ev_loop*, struct ev_prepare*); + +void ev_check_init(struct ev_check*, void* callback); +void ev_check_start(struct ev_loop*, struct ev_check*); +void ev_check_stop(struct ev_loop*, struct ev_check*); + +void ev_fork_init(struct ev_fork*, void* callback); +void ev_fork_start(struct ev_loop*, struct ev_fork*); +void ev_fork_stop(struct ev_loop*, struct ev_fork*); + +void ev_async_init(struct ev_async*, void* callback); +void ev_async_start(struct ev_loop*, struct ev_async*); +void ev_async_stop(struct ev_loop*, struct ev_async*); +void ev_async_send(struct ev_loop*, struct ev_async*); +int ev_async_pending(struct ev_async*); + +void ev_child_init(struct ev_child*, void* callback, int, int); +void ev_child_start(struct ev_loop*, struct ev_child*); +void ev_child_stop(struct ev_loop*, struct ev_child*); + +void ev_stat_init(struct ev_stat*, void* callback, char*, double); +void ev_stat_start(struct ev_loop*, struct ev_stat*); +void ev_stat_stop(struct ev_loop*, struct ev_stat*); + +struct ev_loop *ev_default_loop (unsigned int flags); +struct ev_loop* ev_loop_new(unsigned int flags); +void ev_loop_destroy(struct ev_loop*); +void ev_loop_fork(struct ev_loop*); +int ev_is_default_loop (struct ev_loop *); +unsigned int ev_iteration(struct ev_loop*); +unsigned int ev_depth(struct ev_loop*); +unsigned int ev_backend(struct ev_loop*); +void ev_verify(struct ev_loop*); +void ev_run(struct ev_loop*, int flags); + +ev_tstamp ev_now (struct ev_loop *); +void ev_now_update (struct ev_loop *); /* update event loop time */ +void ev_ref(struct ev_loop*); +void ev_unref(struct ev_loop*); +void ev_break(struct ev_loop*, int); +unsigned int ev_pending_count(struct ev_loop*); + +struct ev_loop* gevent_ev_default_loop(unsigned int flags); +void gevent_install_sigchld_handler(); +void gevent_reset_sigchld_handler(); + +void (*gevent_noop)(struct ev_loop *_loop, struct ev_timer *w, int revents); +void ev_sleep (ev_tstamp delay); /* sleep for a while */ + +/* gevent callbacks */ +/* These will be created as static functions at the end of the + * _source.c and must be declared there too. + */ +extern "Python" { + int python_callback(void* handle, int revents); + void python_handle_error(void* handle, int revents); + void python_stop(void* handle); + void python_check_callback(struct ev_loop*, void*, int); + void python_prepare_callback(struct ev_loop*, void*, int); + + // libev specific + void _syserr_cb(char*); +} +/* + * We use a single C callback for every watcher type, which in turn calls the + * Python callbacks. The ev_watcher pointer type can be used for every watcher type + * because they all start with the same members---libev itself relies on this. Each + * watcher types has a 'void* data' that stores the CFFI handle to the Python watcher + * object. + */ +static void _gevent_generic_callback(struct ev_loop* loop, struct ev_watcher* watcher, int revents); + +static void gevent_zero_check(struct ev_check* handle); +static void gevent_zero_timer(struct ev_timer* handle); +static void gevent_zero_prepare(struct ev_prepare* handle); diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/libev/_corecffi_source.c b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/libev/_corecffi_source.c new file mode 100644 index 00000000..63b216e5 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/libev/_corecffi_source.c @@ -0,0 +1,69 @@ +// passed to the real C compiler +#define LIBEV_EMBED 1 + +#ifdef _WIN32 +#define EV_STANDALONE 1 +#include "libev_vfd.h" +#endif + + +#include "libev.h" + +static void +_gevent_noop(struct ev_loop *_loop, struct ev_timer *w, int revents) { } + +void (*gevent_noop)(struct ev_loop *, struct ev_timer *, int) = &_gevent_noop; + +static int python_callback(void* handle, int revents); +static void python_handle_error(void* handle, int revents); +static void python_stop(void* handle); + +static void _gevent_generic_callback(struct ev_loop* loop, + struct ev_watcher* watcher, + int revents) +{ + void* handle = watcher->data; + int cb_result = python_callback(handle, revents); + switch(cb_result) { + case -1: + // in case of exception, call self.loop.handle_error; + // this function is also responsible for stopping the watcher + // and allowing memory to be freed + python_handle_error(handle, revents); + break; + case 1: + // Code to stop the event. Note that if python_callback + // has disposed of the last reference to the handle, + // `watcher` could now be invalid/disposed memory! + if (!ev_is_active(watcher)) { + python_stop(handle); + } + break; + case 2: + // watcher is already stopped and dead, nothing to do. + break; + default: + fprintf(stderr, + "WARNING: gevent: Unexpected return value %d from Python callback " + "for watcher %p and handle %d\n", + cb_result, + watcher, handle); + // XXX: Possible leaking of resources here? Should we be + // closing the watcher? + } +} + +static void gevent_zero_timer(struct ev_timer* handle) +{ + memset(handle, 0, sizeof(struct ev_timer)); +} + +static void gevent_zero_check(struct ev_check* handle) +{ + memset(handle, 0, sizeof(struct ev_check)); +} + +static void gevent_zero_prepare(struct ev_prepare* handle) +{ + memset(handle, 0, sizeof(struct ev_prepare)); +} diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/libev/callbacks.c b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/libev/callbacks.c new file mode 100644 index 00000000..751b4258 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/libev/callbacks.c @@ -0,0 +1,216 @@ +/* Copyright (c) 2011-2012 Denis Bilenko. See LICENSE for details. */ +#include +#include "Python.h" +#include "ev.h" +#include "corecext.h" +#include "callbacks.h" +#ifdef Py_PYTHON_H + +#if PY_MAJOR_VERSION >= 3 + #define PyInt_FromLong PyLong_FromLong +#endif + + +#ifndef CYTHON_INLINE + #if defined(__clang__) + #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) + #elif defined(__GNUC__) + #define CYTHON_INLINE __inline__ + #elif defined(_MSC_VER) + #define CYTHON_INLINE __inline + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_INLINE inline + #else + #define CYTHON_INLINE + #endif +#endif + + +static CYTHON_INLINE void gevent_check_signals(struct PyGeventLoopObject* loop) { + if (!ev_is_default_loop(loop->_ptr)) { + /* only reporting signals on the default loop */ + return; + } + PyErr_CheckSignals(); + if (PyErr_Occurred()) gevent_handle_error(loop, Py_None); +} + +#define GET_OBJECT(PY_TYPE, EV_PTR, MEMBER) \ + ((struct PY_TYPE *)(((char *)EV_PTR) - offsetof(struct PY_TYPE, MEMBER))) + + +#ifdef WITH_THREAD +#define GIL_DECLARE PyGILState_STATE ___save +#define GIL_ENSURE ___save = PyGILState_Ensure(); +#define GIL_RELEASE PyGILState_Release(___save); +#else +#define GIL_DECLARE +#define GIL_ENSURE +#define GIL_RELEASE +#endif + + +static void gevent_stop(PyObject* watcher, struct PyGeventLoopObject* loop) { + PyObject *result, *method; + int error; + error = 1; + method = PyObject_GetAttrString(watcher, "stop"); + if (method) { + result = PyObject_Call(method, _empty_tuple, NULL); + if (result) { + Py_DECREF(result); + error = 0; + } + Py_DECREF(method); + } + if (error) { + gevent_handle_error(loop, watcher); + } +} + + +static void gevent_callback(struct PyGeventLoopObject* loop, PyObject* callback, PyObject* args, PyObject* watcher, void *c_watcher, int revents) { + GIL_DECLARE; + PyObject *result, *py_events; + long length; + py_events = 0; + GIL_ENSURE; + Py_INCREF(loop); + Py_INCREF(callback); + Py_INCREF(args); + Py_INCREF(watcher); + gevent_check_signals(loop); + if (args == Py_None) { + args = _empty_tuple; + } + length = PyTuple_Size(args); + if (length < 0) { + gevent_handle_error(loop, watcher); + goto end; + } + if (length > 0 && PyTuple_GET_ITEM(args, 0) == GEVENT_CORE_EVENTS) { + py_events = PyInt_FromLong(revents); + if (!py_events) { + gevent_handle_error(loop, watcher); + goto end; + } + PyTuple_SET_ITEM(args, 0, py_events); + } + else { + py_events = NULL; + } + result = PyObject_Call(callback, args, NULL); + if (result) { + Py_DECREF(result); + } + else { + gevent_handle_error(loop, watcher); + if (revents & (EV_READ|EV_WRITE)) { + /* io watcher: not stopping it may cause the failing callback to be called repeatedly */ + gevent_stop(watcher, loop); + goto end; + } + } + if (!ev_is_active(c_watcher)) { + /* Watcher was stopped, maybe by libev. Let's call stop() to clean up + * 'callback' and 'args' properties, do Py_DECREF() and ev_ref() if necessary. + * BTW, we don't need to check for EV_ERROR, because libev stops the watcher in that case. */ + gevent_stop(watcher, loop); + } +end: + if (py_events) { + Py_DECREF(py_events); + PyTuple_SET_ITEM(args, 0, GEVENT_CORE_EVENTS); + } + Py_DECREF(watcher); + Py_DECREF(args); + Py_DECREF(callback); + Py_DECREF(loop); + GIL_RELEASE; +} + + +void gevent_call(struct PyGeventLoopObject* loop, struct PyGeventCallbackObject* cb) { + /* no need for GIL here because it is only called from run_callbacks which already has GIL */ + PyObject *result, *callback, *args; + if (!loop || !cb) + return; + callback = cb->callback; + args = cb->args; + if (!callback || !args) + return; + if (callback == Py_None || args == Py_None) + return; + Py_INCREF(loop); + Py_INCREF(callback); + Py_INCREF(args); + + Py_INCREF(Py_None); + Py_DECREF(cb->callback); + cb->callback = Py_None; + + result = PyObject_Call(callback, args, NULL); + if (result) { + Py_DECREF(result); + } + else { + gevent_handle_error(loop, (PyObject*)cb); + } + + Py_INCREF(Py_None); + Py_DECREF(cb->args); + cb->args = Py_None; + + Py_DECREF(callback); + Py_DECREF(args); + Py_DECREF(loop); +} + +/* + * PyGeventWatcherObject is the first member of all the structs, so + * it is the same in all of them and they can all safely be cast to + * it. We could also use the *data member of the libev watcher objects. + */ + +#undef DEFINE_CALLBACK +#define DEFINE_CALLBACK(WATCHER_LC, WATCHER_TYPE) \ + void gevent_callback_##WATCHER_LC(struct ev_loop *_loop, void *c_watcher, int revents) { \ + struct PyGeventWatcherObject* watcher = (struct PyGeventWatcherObject*)GET_OBJECT(PyGevent##WATCHER_TYPE##Object, c_watcher, _watcher); \ + gevent_callback(watcher->loop, watcher->_callback, watcher->args, (PyObject*)watcher, c_watcher, revents); \ + } + + +DEFINE_CALLBACKS + + +void gevent_run_callbacks(struct ev_loop *_loop, void *watcher, int revents) { + struct PyGeventLoopObject* loop; + PyObject *result; + GIL_DECLARE; + GIL_ENSURE; + loop = GET_OBJECT(PyGeventLoopObject, watcher, _prepare); + Py_INCREF(loop); + gevent_check_signals(loop); + result = gevent_loop_run_callbacks(loop); + if (result) { + Py_DECREF(result); + } + else { + PyErr_Print(); + PyErr_Clear(); + } + Py_DECREF(loop); + GIL_RELEASE; +} + +/* This is only used on Win32 */ + +void gevent_periodic_signal_check(struct ev_loop *_loop, void *watcher, int revents) { + GIL_DECLARE; + GIL_ENSURE; + gevent_check_signals(GET_OBJECT(PyGeventLoopObject, watcher, _periodic_signal_checker)); + GIL_RELEASE; +} + + +#endif /* Py_PYTHON_H */ diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/libev/callbacks.h b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/libev/callbacks.h new file mode 100644 index 00000000..ed872247 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/libev/callbacks.h @@ -0,0 +1,38 @@ +struct ev_loop; +struct PyGeventLoopObject; +struct PyGeventCallbackObject; + +#define DEFINE_CALLBACK(WATCHER_LC, WATCHER_TYPE) \ + void gevent_callback_##WATCHER_LC(struct ev_loop *, void *, int); + + +#define DEFINE_CALLBACKS0 \ + DEFINE_CALLBACK(io, IO); \ + DEFINE_CALLBACK(timer, Timer); \ + DEFINE_CALLBACK(signal, Signal); \ + DEFINE_CALLBACK(idle, Idle); \ + DEFINE_CALLBACK(prepare, Prepare); \ + DEFINE_CALLBACK(check, Check); \ + DEFINE_CALLBACK(fork, Fork); \ + DEFINE_CALLBACK(async, Async); \ + DEFINE_CALLBACK(stat, Stat); \ + DEFINE_CALLBACK(child, Child); + + +#define DEFINE_CALLBACKS DEFINE_CALLBACKS0 + + +DEFINE_CALLBACKS + + +void gevent_run_callbacks(struct ev_loop *, void *, int); + + + +void gevent_call(struct PyGeventLoopObject* loop, struct PyGeventCallbackObject* cb); + +static void gevent_noop(struct ev_loop *_loop, void *watcher, int revents) { +} + +/* Only used on Win32 */ +void gevent_periodic_signal_check(struct ev_loop *, void *, int); diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/libev/corecext.c b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/libev/corecext.c new file mode 100644 index 00000000..fa8f3f65 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/libev/corecext.c @@ -0,0 +1,23545 @@ +/* Generated by Cython 0.29.2 */ + +/* BEGIN: Cython Metadata +{ + "distutils": { + "define_macros": [ + [ + "FD_SETSIZE", + "1024" + ], + [ + "_WIN32", + "1" + ], + [ + "EV_STANDALONE", + "1" + ], + [ + "LIBEV_EMBED", + "1" + ], + [ + "EV_COMMON", + "" + ], + [ + "EV_CLEANUP_ENABLE", + "0" + ], + [ + "EV_EMBED_ENABLE", + "0" + ], + [ + "EV_PERIODIC_ENABLE", + "0" + ] + ], + "depends": [ + "deps/libev\\ev++.h", + "deps/libev\\ev.c", + "deps/libev\\ev.h", + "deps/libev\\ev_epoll.c", + "deps/libev\\ev_kqueue.c", + "deps/libev\\ev_poll.c", + "deps/libev\\ev_port.c", + "deps/libev\\ev_select.c", + "deps/libev\\ev_vars.h", + "deps/libev\\ev_win32.c", + "deps/libev\\ev_wrap.h", + "deps/libev\\event.c", + "deps/libev\\event.h", + "deps\\libev\\ev++.h", + "deps\\libev\\ev.c", + "deps\\libev\\ev.h", + "deps\\libev\\ev_epoll.c", + "deps\\libev\\ev_kqueue.c", + "deps\\libev\\ev_poll.c", + "deps\\libev\\ev_port.c", + "deps\\libev\\ev_select.c", + "deps\\libev\\ev_vars.h", + "deps\\libev\\ev_win32.c", + "deps\\libev\\ev_wrap.h", + "deps\\libev\\event.c", + "deps\\libev\\event.h", + "src/gevent/libev/stathelper.c", + "src/gevent/libev\\callbacks.c", + "src/gevent/libev\\callbacks.h", + "src/gevent/libev\\libev.h", + "src/gevent/libev\\libev_vfd.h", + "src\\gevent\\libev\\callbacks.c", + "src\\gevent\\libev\\callbacks.h", + "src\\gevent\\libev\\libev.h", + "src\\gevent\\libev\\libev_vfd.h", + "src\\gevent\\libev\\stathelper.c" + ], + "include_dirs": [ + "src/gevent/libev", + "C:\\Users\\appveyor\\AppData\\Local\\Temp\\1\\pip-req-build-4mw8a1z7\\deps\\libev" + ], + "libraries": [ + "ws2_32" + ], + "name": "gevent.libev.corecext", + "sources": [ + "src/gevent/libev/corecext.pyx", + "src/gevent/libev/callbacks.c" + ] + }, + "module_name": "gevent.libev.corecext" +} +END: Cython Metadata */ + +#define PY_SSIZE_T_CLEAN +#include "Python.h" +#ifndef Py_PYTHON_H + #error Python headers needed to compile C extensions, please install development version of Python. +#elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) + #error Cython requires Python 2.6+ or Python 3.3+. +#else +#define CYTHON_ABI "0_29_2" +#define CYTHON_HEX_VERSION 0x001D02F0 +#define CYTHON_FUTURE_DIVISION 1 +#include +#ifndef offsetof + #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) +#endif +#if !defined(WIN32) && !defined(MS_WINDOWS) + #ifndef __stdcall + #define __stdcall + #endif + #ifndef __cdecl + #define __cdecl + #endif + #ifndef __fastcall + #define __fastcall + #endif +#endif +#ifndef DL_IMPORT + #define DL_IMPORT(t) t +#endif +#ifndef DL_EXPORT + #define DL_EXPORT(t) t +#endif +#define __PYX_COMMA , +#ifndef HAVE_LONG_LONG + #if PY_VERSION_HEX >= 0x02070000 + #define HAVE_LONG_LONG + #endif +#endif +#ifndef PY_LONG_LONG + #define PY_LONG_LONG LONG_LONG +#endif +#ifndef Py_HUGE_VAL + #define Py_HUGE_VAL HUGE_VAL +#endif +#ifdef PYPY_VERSION + #define CYTHON_COMPILING_IN_PYPY 1 + #define CYTHON_COMPILING_IN_PYSTON 0 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #undef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 0 + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #if PY_VERSION_HEX < 0x03050000 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #elif !defined(CYTHON_USE_ASYNC_SLOTS) + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #undef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 0 + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #undef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 1 + #undef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 0 + #undef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 0 + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #undef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE 0 + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 +#elif defined(PYSTON_VERSION) + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_PYSTON 1 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #ifndef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 1 + #endif + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #ifndef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 1 + #endif + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #ifndef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 0 + #endif + #ifndef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 1 + #endif + #ifndef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 1 + #endif + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #undef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE 0 + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 +#else + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_PYSTON 0 + #define CYTHON_COMPILING_IN_CPYTHON 1 + #ifndef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 1 + #endif + #if PY_VERSION_HEX < 0x02070000 + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #elif !defined(CYTHON_USE_PYTYPE_LOOKUP) + #define CYTHON_USE_PYTYPE_LOOKUP 1 + #endif + #if PY_MAJOR_VERSION < 3 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #elif !defined(CYTHON_USE_ASYNC_SLOTS) + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #if PY_VERSION_HEX < 0x02070000 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #elif !defined(CYTHON_USE_PYLONG_INTERNALS) + #define CYTHON_USE_PYLONG_INTERNALS 1 + #endif + #ifndef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 1 + #endif + #ifndef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 1 + #endif + #if PY_VERSION_HEX < 0x030300F0 + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #elif !defined(CYTHON_USE_UNICODE_WRITER) + #define CYTHON_USE_UNICODE_WRITER 1 + #endif + #ifndef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 0 + #endif + #ifndef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 1 + #endif + #ifndef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 1 + #endif + #ifndef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 1 + #endif + #ifndef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 1 + #endif + #ifndef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000) + #endif + #ifndef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1) + #endif + #ifndef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1) + #endif + #ifndef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3) + #endif +#endif +#if !defined(CYTHON_FAST_PYCCALL) +#define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) +#endif +#if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #undef SHIFT + #undef BASE + #undef MASK + #ifdef SIZEOF_VOID_P + enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) }; + #endif +#endif +#ifndef __has_attribute + #define __has_attribute(x) 0 +#endif +#ifndef __has_cpp_attribute + #define __has_cpp_attribute(x) 0 +#endif +#ifndef CYTHON_RESTRICT + #if defined(__GNUC__) + #define CYTHON_RESTRICT __restrict__ + #elif defined(_MSC_VER) && _MSC_VER >= 1400 + #define CYTHON_RESTRICT __restrict + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_RESTRICT restrict + #else + #define CYTHON_RESTRICT + #endif +#endif +#ifndef CYTHON_UNUSED +# if defined(__GNUC__) +# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +#endif +#ifndef CYTHON_MAYBE_UNUSED_VAR +# if defined(__cplusplus) + template void CYTHON_MAYBE_UNUSED_VAR( const T& ) { } +# else +# define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x) +# endif +#endif +#ifndef CYTHON_NCP_UNUSED +# if CYTHON_COMPILING_IN_CPYTHON +# define CYTHON_NCP_UNUSED +# else +# define CYTHON_NCP_UNUSED CYTHON_UNUSED +# endif +#endif +#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) +#ifdef _MSC_VER + #ifndef _MSC_STDINT_H_ + #if _MSC_VER < 1300 + typedef unsigned char uint8_t; + typedef unsigned int uint32_t; + #else + typedef unsigned __int8 uint8_t; + typedef unsigned __int32 uint32_t; + #endif + #endif +#else + #include +#endif +#ifndef CYTHON_FALLTHROUGH + #if defined(__cplusplus) && __cplusplus >= 201103L + #if __has_cpp_attribute(fallthrough) + #define CYTHON_FALLTHROUGH [[fallthrough]] + #elif __has_cpp_attribute(clang::fallthrough) + #define CYTHON_FALLTHROUGH [[clang::fallthrough]] + #elif __has_cpp_attribute(gnu::fallthrough) + #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] + #endif + #endif + #ifndef CYTHON_FALLTHROUGH + #if __has_attribute(fallthrough) + #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) + #else + #define CYTHON_FALLTHROUGH + #endif + #endif + #if defined(__clang__ ) && defined(__apple_build_version__) + #if __apple_build_version__ < 7000000 + #undef CYTHON_FALLTHROUGH + #define CYTHON_FALLTHROUGH + #endif + #endif +#endif + +#ifndef CYTHON_INLINE + #if defined(__clang__) + #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) + #elif defined(__GNUC__) + #define CYTHON_INLINE __inline__ + #elif defined(_MSC_VER) + #define CYTHON_INLINE __inline + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_INLINE inline + #else + #define CYTHON_INLINE + #endif +#endif + +#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) + #define Py_OptimizeFlag 0 +#endif +#define __PYX_BUILD_PY_SSIZE_T "n" +#define CYTHON_FORMAT_SSIZE_T "z" +#if PY_MAJOR_VERSION < 3 + #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyClass_Type +#else + #define __Pyx_BUILTIN_MODULE_NAME "builtins" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyType_Type +#endif +#ifndef Py_TPFLAGS_CHECKTYPES + #define Py_TPFLAGS_CHECKTYPES 0 +#endif +#ifndef Py_TPFLAGS_HAVE_INDEX + #define Py_TPFLAGS_HAVE_INDEX 0 +#endif +#ifndef Py_TPFLAGS_HAVE_NEWBUFFER + #define Py_TPFLAGS_HAVE_NEWBUFFER 0 +#endif +#ifndef Py_TPFLAGS_HAVE_FINALIZE + #define Py_TPFLAGS_HAVE_FINALIZE 0 +#endif +#ifndef METH_STACKLESS + #define METH_STACKLESS 0 +#endif +#if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) + #ifndef METH_FASTCALL + #define METH_FASTCALL 0x80 + #endif + typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs); + typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args, + Py_ssize_t nargs, PyObject *kwnames); +#else + #define __Pyx_PyCFunctionFast _PyCFunctionFast + #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords +#endif +#if CYTHON_FAST_PYCCALL +#define __Pyx_PyFastCFunction_Check(func)\ + ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS))))) +#else +#define __Pyx_PyFastCFunction_Check(func) 0 +#endif +#if CYTHON_USE_DICT_VERSIONS +#define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) +#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ + (version_var) = __PYX_GET_DICT_VERSION(dict);\ + (cache_var) = (value); +#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ + static PY_UINT64_T __pyx_dict_version = 0;\ + static PyObject *__pyx_dict_cached_value = NULL;\ + if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ + (VAR) = __pyx_dict_cached_value;\ + } else {\ + (VAR) = __pyx_dict_cached_value = (LOOKUP);\ + __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ + }\ + } +#else +#define __PYX_GET_DICT_VERSION(dict) (0) +#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) +#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) + #define PyObject_Malloc(s) PyMem_Malloc(s) + #define PyObject_Free(p) PyMem_Free(p) + #define PyObject_Realloc(p) PyMem_Realloc(p) +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1 + #define PyMem_RawMalloc(n) PyMem_Malloc(n) + #define PyMem_RawRealloc(p, n) PyMem_Realloc(p, n) + #define PyMem_RawFree(p) PyMem_Free(p) +#endif +#if CYTHON_COMPILING_IN_PYSTON + #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co) + #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno) +#else + #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) + #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) +#endif +#if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000 + #define __Pyx_PyThreadState_Current PyThreadState_GET() +#elif PY_VERSION_HEX >= 0x03060000 + #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() +#elif PY_VERSION_HEX >= 0x03000000 + #define __Pyx_PyThreadState_Current PyThreadState_GET() +#else + #define __Pyx_PyThreadState_Current _PyThreadState_Current +#endif +#if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) +#include "pythread.h" +#define Py_tss_NEEDS_INIT 0 +typedef int Py_tss_t; +static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) { + *key = PyThread_create_key(); + return 0; // PyThread_create_key reports success always +} +static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) { + Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t)); + *key = Py_tss_NEEDS_INIT; + return key; +} +static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) { + PyObject_Free(key); +} +static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) { + return *key != Py_tss_NEEDS_INIT; +} +static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) { + PyThread_delete_key(*key); + *key = Py_tss_NEEDS_INIT; +} +static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) { + return PyThread_set_key_value(*key, value); +} +static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { + return PyThread_get_key_value(*key); +} +#endif // TSS (Thread Specific Storage) API +#if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized) +#define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) +#else +#define __Pyx_PyDict_NewPresized(n) PyDict_New() +#endif +#if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION + #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) +#else + #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS +#define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) +#else +#define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name) +#endif +#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) + #define CYTHON_PEP393_ENABLED 1 + #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ + 0 : _PyUnicode_Ready((PyObject *)(op))) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) + #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) + #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) + #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) + #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) + #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch) + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) +#else + #define CYTHON_PEP393_ENABLED 0 + #define PyUnicode_1BYTE_KIND 1 + #define PyUnicode_2BYTE_KIND 2 + #define PyUnicode_4BYTE_KIND 4 + #define __Pyx_PyUnicode_READY(op) (0) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) + #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111) + #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) + #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) + #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) + #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch) + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) +#endif +#if CYTHON_COMPILING_IN_PYPY + #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) +#else + #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ + PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains) + #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check) + #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format) + #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) +#endif +#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) +#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) +#else + #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) +#endif +#if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) + #define PyObject_ASCII(o) PyObject_Repr(o) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBaseString_Type PyUnicode_Type + #define PyStringObject PyUnicodeObject + #define PyString_Type PyUnicode_Type + #define PyString_Check PyUnicode_Check + #define PyString_CheckExact PyUnicode_CheckExact + #define PyObject_Unicode PyObject_Str +#endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) + #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) +#else + #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) + #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) +#endif +#ifndef PySet_CheckExact + #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) +#endif +#if CYTHON_ASSUME_SAFE_MACROS + #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) +#else + #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyIntObject PyLongObject + #define PyInt_Type PyLong_Type + #define PyInt_Check(op) PyLong_Check(op) + #define PyInt_CheckExact(op) PyLong_CheckExact(op) + #define PyInt_FromString PyLong_FromString + #define PyInt_FromUnicode PyLong_FromUnicode + #define PyInt_FromLong PyLong_FromLong + #define PyInt_FromSize_t PyLong_FromSize_t + #define PyInt_FromSsize_t PyLong_FromSsize_t + #define PyInt_AsLong PyLong_AsLong + #define PyInt_AS_LONG PyLong_AS_LONG + #define PyInt_AsSsize_t PyLong_AsSsize_t + #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask + #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask + #define PyNumber_Int PyNumber_Long +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBoolObject PyLongObject +#endif +#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY + #ifndef PyUnicode_InternFromString + #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) + #endif +#endif +#if PY_VERSION_HEX < 0x030200A4 + typedef long Py_hash_t; + #define __Pyx_PyInt_FromHash_t PyInt_FromLong + #define __Pyx_PyInt_AsHash_t PyInt_AsLong +#else + #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t + #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t +#endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : (Py_INCREF(func), func)) +#else + #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) +#endif +#if CYTHON_USE_ASYNC_SLOTS + #if PY_VERSION_HEX >= 0x030500B1 + #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods + #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) + #else + #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) + #endif +#else + #define __Pyx_PyType_AsAsync(obj) NULL +#endif +#ifndef __Pyx_PyAsyncMethodsStruct + typedef struct { + unaryfunc am_await; + unaryfunc am_aiter; + unaryfunc am_anext; + } __Pyx_PyAsyncMethodsStruct; +#endif + +#if defined(WIN32) || defined(MS_WINDOWS) + #define _USE_MATH_DEFINES +#endif +#include +#ifdef NAN +#define __PYX_NAN() ((float) NAN) +#else +static CYTHON_INLINE float __PYX_NAN() { + float value; + memset(&value, 0xFF, sizeof(value)); + return value; +} +#endif +#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) +#define __Pyx_truncl trunc +#else +#define __Pyx_truncl truncl +#endif + + +#define __PYX_ERR(f_index, lineno, Ln_error) \ +{ \ + __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \ +} + +#ifndef __PYX_EXTERN_C + #ifdef __cplusplus + #define __PYX_EXTERN_C extern "C" + #else + #define __PYX_EXTERN_C extern + #endif +#endif + +#define __PYX_HAVE__gevent__libev__corecext +#define __PYX_HAVE_API__gevent__libev__corecext +/* Early includes */ +#include "libev_vfd.h" +#include "libev.h" +#include +#include +#include +#include "callbacks.h" +#include "stathelper.c" +#include "pythread.h" +#ifdef _OPENMP +#include +#endif /* _OPENMP */ + +#if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) +#define CYTHON_WITHOUT_ASSERTIONS +#endif + +typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; + const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; + +#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 +#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0 +#define __PYX_DEFAULT_STRING_ENCODING "" +#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString +#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#define __Pyx_uchar_cast(c) ((unsigned char)c) +#define __Pyx_long_cast(x) ((long)x) +#define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ + (sizeof(type) < sizeof(Py_ssize_t)) ||\ + (sizeof(type) > sizeof(Py_ssize_t) &&\ + likely(v < (type)PY_SSIZE_T_MAX ||\ + v == (type)PY_SSIZE_T_MAX) &&\ + (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ + v == (type)PY_SSIZE_T_MIN))) ||\ + (sizeof(type) == sizeof(Py_ssize_t) &&\ + (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ + v == (type)PY_SSIZE_T_MAX))) ) +static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) { + return (size_t) i < (size_t) limit; +} +#if defined (__cplusplus) && __cplusplus >= 201103L + #include + #define __Pyx_sst_abs(value) std::abs(value) +#elif SIZEOF_INT >= SIZEOF_SIZE_T + #define __Pyx_sst_abs(value) abs(value) +#elif SIZEOF_LONG >= SIZEOF_SIZE_T + #define __Pyx_sst_abs(value) labs(value) +#elif defined (_MSC_VER) + #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) +#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define __Pyx_sst_abs(value) llabs(value) +#elif defined (__GNUC__) + #define __Pyx_sst_abs(value) __builtin_llabs(value) +#else + #define __Pyx_sst_abs(value) ((value<0) ? -value : value) +#endif +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*); +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); +#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) +#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) +#define __Pyx_PyBytes_FromString PyBytes_FromString +#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); +#if PY_MAJOR_VERSION < 3 + #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#else + #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize +#endif +#define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) +#define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) +#define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) +#define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) +#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) +static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) { + const Py_UNICODE *u_end = u; + while (*u_end++) ; + return (size_t)(u_end - u - 1); +} +#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) +#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode +#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode +#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) +#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) +static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); +static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*); +static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); +#define __Pyx_PySequence_Tuple(obj)\ + (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); +#if CYTHON_ASSUME_SAFE_MACROS +#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) +#else +#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) +#endif +#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) +#if PY_MAJOR_VERSION >= 3 +#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) +#else +#define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) +#endif +#define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x)) +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII +static int __Pyx_sys_getdefaultencoding_not_ascii; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + PyObject* ascii_chars_u = NULL; + PyObject* ascii_chars_b = NULL; + const char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + if (strcmp(default_encoding_c, "ascii") == 0) { + __Pyx_sys_getdefaultencoding_not_ascii = 0; + } else { + char ascii_chars[128]; + int c; + for (c = 0; c < 128; c++) { + ascii_chars[c] = c; + } + __Pyx_sys_getdefaultencoding_not_ascii = 1; + ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); + if (!ascii_chars_u) goto bad; + ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); + if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { + PyErr_Format( + PyExc_ValueError, + "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", + default_encoding_c); + goto bad; + } + Py_DECREF(ascii_chars_u); + Py_DECREF(ascii_chars_b); + } + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + Py_XDECREF(ascii_chars_u); + Py_XDECREF(ascii_chars_b); + return -1; +} +#endif +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) +#else +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +static char* __PYX_DEFAULT_STRING_ENCODING; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1); + if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; + strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + return -1; +} +#endif +#endif + + +/* Test for GCC > 2.95 */ +#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) + #define likely(x) __builtin_expect(!!(x), 1) + #define unlikely(x) __builtin_expect(!!(x), 0) +#else /* !__GNUC__ or GCC < 2.95 */ + #define likely(x) (x) + #define unlikely(x) (x) +#endif /* __GNUC__ */ +static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } + +static PyObject *__pyx_m = NULL; +static PyObject *__pyx_d; +static PyObject *__pyx_b; +static PyObject *__pyx_cython_runtime = NULL; +static PyObject *__pyx_empty_tuple; +static PyObject *__pyx_empty_bytes; +static PyObject *__pyx_empty_unicode; +static int __pyx_lineno; +static int __pyx_clineno = 0; +static const char * __pyx_cfilenm= __FILE__; +static const char *__pyx_filename; + + +static const char *__pyx_f[] = { + "src\\gevent\\libev\\corecext.pyx", + "type.pxd", + "bool.pxd", + "complex.pxd", +}; +/* NoFastGil.proto */ +#define __Pyx_PyGILState_Ensure PyGILState_Ensure +#define __Pyx_PyGILState_Release PyGILState_Release +#define __Pyx_FastGIL_Remember() +#define __Pyx_FastGIL_Forget() +#define __Pyx_FastGilFuncInit() + +/* ForceInitThreads.proto */ +#ifndef __PYX_FORCE_INIT_THREADS + #define __PYX_FORCE_INIT_THREADS 0 +#endif + + +/*--- Type declarations ---*/ +struct __pyx_obj_6gevent_5libev_8corecext__EVENTSType; +struct PyGeventCallbackObject; +struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO; +struct PyGeventLoopObject; +struct PyGeventWatcherObject; +struct PyGeventIOObject; +struct PyGeventTimerObject; +struct PyGeventSignalObject; +struct PyGeventIdleObject; +struct PyGeventPrepareObject; +struct PyGeventCheckObject; +struct PyGeventForkObject; +struct PyGeventAsyncObject; +struct PyGeventChildObject; +struct PyGeventStatObject; +struct __pyx_obj_6gevent_5libev_8corecext___pyx_scope_struct__genexpr; +struct __pyx_t_6gevent_5libev_8corecext_start_and_stop; + +typedef void (*__pyx_t_6gevent_5libev_8corecext_start_stop_func)(struct ev_loop *, void *); + +struct __pyx_t_6gevent_5libev_8corecext_start_and_stop { + __pyx_t_6gevent_5libev_8corecext_start_stop_func start; + __pyx_t_6gevent_5libev_8corecext_start_stop_func stop; +}; + +struct __pyx_obj_6gevent_5libev_8corecext__EVENTSType { + PyObject_HEAD +}; + + +struct PyGeventCallbackObject { + PyObject_HEAD + PyObject *callback; + PyObject *args; + struct PyGeventCallbackObject *next; +}; + +__PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyGeventCallback_Type; + +struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO { + PyObject_HEAD + struct __pyx_vtabstruct_6gevent_5libev_8corecext_CallbackFIFO *__pyx_vtab; + struct PyGeventCallbackObject *head; + struct PyGeventCallbackObject *tail; +}; + + +struct PyGeventLoopObject { + PyObject_HEAD + struct __pyx_vtabstruct_6gevent_5libev_8corecext_loop *__pyx_vtab; + struct ev_prepare _prepare; + struct ev_timer _timer0; + struct ev_timer _periodic_signal_checker; + PyObject *error_handler; + struct ev_loop *_ptr; + struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *_callbacks; + int starting_timer_may_update_loop_time; + int _default; + double approx_timer_resolution; +}; + +__PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyGeventLoop_Type; + +struct PyGeventWatcherObject { + PyObject_HEAD + struct PyGeventLoopObject *loop; + PyObject *_callback; + PyObject *args; + struct ev_watcher *__pyx___watcher; + struct __pyx_t_6gevent_5libev_8corecext_start_and_stop *__pyx___ss; + unsigned int _flags; +}; + +__PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyGeventWatcher_Type; + +struct PyGeventIOObject { + struct PyGeventWatcherObject __pyx_base; + struct ev_io _watcher; +}; + +__PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyGeventIO_Type; + +struct PyGeventTimerObject { + struct PyGeventWatcherObject __pyx_base; + struct ev_timer _watcher; +}; + +__PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyGeventTimer_Type; + +struct PyGeventSignalObject { + struct PyGeventWatcherObject __pyx_base; + struct ev_signal _watcher; +}; + +__PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyGeventSignal_Type; + +struct PyGeventIdleObject { + struct PyGeventWatcherObject __pyx_base; + struct ev_idle _watcher; +}; + +__PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyGeventIdle_Type; + +struct PyGeventPrepareObject { + struct PyGeventWatcherObject __pyx_base; + struct ev_prepare _watcher; +}; + +__PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyGeventPrepare_Type; + +struct PyGeventCheckObject { + struct PyGeventWatcherObject __pyx_base; + struct ev_check _watcher; +}; + +__PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyGeventCheck_Type; + +struct PyGeventForkObject { + struct PyGeventWatcherObject __pyx_base; + struct ev_fork _watcher; +}; + +__PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyGeventFork_Type; + +struct PyGeventAsyncObject { + struct PyGeventWatcherObject __pyx_base; + struct ev_async _watcher; +}; + +__PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyGeventAsync_Type; + +struct PyGeventChildObject { + struct PyGeventWatcherObject __pyx_base; + struct ev_child _watcher; +}; + +__PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyGeventChild_Type; + +struct PyGeventStatObject { + struct PyGeventWatcherObject __pyx_base; + struct ev_stat _watcher; + PyObject *path; + PyObject *_paths; +}; + +__PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyGeventStat_Type; + +struct __pyx_obj_6gevent_5libev_8corecext___pyx_scope_struct__genexpr { + PyObject_HEAD + PyObject *__pyx_v_flag; + PyObject *__pyx_v_string; +}; + + + + +struct __pyx_vtabstruct_6gevent_5libev_8corecext_CallbackFIFO { + struct PyGeventCallbackObject *(*popleft)(struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *); + PyObject *(*append)(struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *, struct PyGeventCallbackObject *); + int (*has_callbacks)(struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *); +}; +static struct __pyx_vtabstruct_6gevent_5libev_8corecext_CallbackFIFO *__pyx_vtabptr_6gevent_5libev_8corecext_CallbackFIFO; +static CYTHON_INLINE struct PyGeventCallbackObject *__pyx_f_6gevent_5libev_8corecext_12CallbackFIFO_popleft(struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *); +static CYTHON_INLINE PyObject *__pyx_f_6gevent_5libev_8corecext_12CallbackFIFO_append(struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *, struct PyGeventCallbackObject *); +static int __pyx_f_6gevent_5libev_8corecext_12CallbackFIFO_has_callbacks(struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *); + +__PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyGeventLoop_Type; + + +struct __pyx_vtabstruct_6gevent_5libev_8corecext_loop { + PyObject *(*_run_callbacks)(struct PyGeventLoopObject *); + PyObject *(*_stop_watchers)(struct PyGeventLoopObject *, struct ev_loop *); + PyObject *(*handle_error)(struct PyGeventLoopObject *, PyObject *, PyObject *, PyObject *, PyObject *, int __pyx_skip_dispatch); + PyObject *(*_default_handle_error)(struct PyGeventLoopObject *, PyObject *, PyObject *, PyObject *, PyObject *, int __pyx_skip_dispatch); + ev_tstamp (*now)(struct PyGeventLoopObject *, int __pyx_skip_dispatch); + void (*update_now)(struct PyGeventLoopObject *, int __pyx_skip_dispatch); +}; +static struct __pyx_vtabstruct_6gevent_5libev_8corecext_loop *__pyx_vtabptr_6gevent_5libev_8corecext_loop; + +/* --- Runtime support code (head) --- */ +/* Refnanny.proto */ +#ifndef CYTHON_REFNANNY + #define CYTHON_REFNANNY 0 +#endif +#if CYTHON_REFNANNY + typedef struct { + void (*INCREF)(void*, PyObject*, int); + void (*DECREF)(void*, PyObject*, int); + void (*GOTREF)(void*, PyObject*, int); + void (*GIVEREF)(void*, PyObject*, int); + void* (*SetupContext)(const char*, int, const char*); + void (*FinishContext)(void**); + } __Pyx_RefNannyAPIStruct; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); + #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; +#ifdef WITH_THREAD + #define __Pyx_RefNannySetupContext(name, acquire_gil)\ + if (acquire_gil) {\ + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ + PyGILState_Release(__pyx_gilstate_save);\ + } else {\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ + } +#else + #define __Pyx_RefNannySetupContext(name, acquire_gil)\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) +#endif + #define __Pyx_RefNannyFinishContext()\ + __Pyx_RefNanny->FinishContext(&__pyx_refnanny) + #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0) + #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) + #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) + #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) +#else + #define __Pyx_RefNannyDeclarations + #define __Pyx_RefNannySetupContext(name, acquire_gil) + #define __Pyx_RefNannyFinishContext() + #define __Pyx_INCREF(r) Py_INCREF(r) + #define __Pyx_DECREF(r) Py_DECREF(r) + #define __Pyx_GOTREF(r) + #define __Pyx_GIVEREF(r) + #define __Pyx_XINCREF(r) Py_XINCREF(r) + #define __Pyx_XDECREF(r) Py_XDECREF(r) + #define __Pyx_XGOTREF(r) + #define __Pyx_XGIVEREF(r) +#endif +#define __Pyx_XDECREF_SET(r, v) do {\ + PyObject *tmp = (PyObject *) r;\ + r = v; __Pyx_XDECREF(tmp);\ + } while (0) +#define __Pyx_DECREF_SET(r, v) do {\ + PyObject *tmp = (PyObject *) r;\ + r = v; __Pyx_DECREF(tmp);\ + } while (0) +#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) +#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) + +/* PyObjectGetAttrStr.proto */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); +#else +#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) +#endif + +/* GetBuiltinName.proto */ +static PyObject *__Pyx_GetBuiltinName(PyObject *name); + +/* GetModuleGlobalName.proto */ +#if CYTHON_USE_DICT_VERSIONS +#define __Pyx_GetModuleGlobalName(var, name) {\ + static PY_UINT64_T __pyx_dict_version = 0;\ + static PyObject *__pyx_dict_cached_value = NULL;\ + (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\ + (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\ + __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ +} +#define __Pyx_GetModuleGlobalNameUncached(var, name) {\ + PY_UINT64_T __pyx_dict_version;\ + PyObject *__pyx_dict_cached_value;\ + (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ +} +static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value); +#else +#define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name) +#define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name) +static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name); +#endif + +/* RaiseTooManyValuesToUnpack.proto */ +static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); + +/* RaiseNeedMoreValuesToUnpack.proto */ +static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); + +/* IterFinish.proto */ +static CYTHON_INLINE int __Pyx_IterFinish(void); + +/* UnpackItemEndCheck.proto */ +static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); + +/* ListAppend.proto */ +#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS +static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) { + PyListObject* L = (PyListObject*) list; + Py_ssize_t len = Py_SIZE(list); + if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) { + Py_INCREF(x); + PyList_SET_ITEM(list, len, x); + Py_SIZE(list) = len+1; + return 0; + } + return PyList_Append(list, x); +} +#else +#define __Pyx_PyList_Append(L,x) PyList_Append(L,x) +#endif + +/* PyCFunctionFastCall.proto */ +#if CYTHON_FAST_PYCCALL +static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs); +#else +#define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL) +#endif + +/* PyFunctionFastCall.proto */ +#if CYTHON_FAST_PYCALL +#define __Pyx_PyFunction_FastCall(func, args, nargs)\ + __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) +#if 1 || PY_VERSION_HEX < 0x030600B1 +static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs); +#else +#define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs) +#endif +#define __Pyx_BUILD_ASSERT_EXPR(cond)\ + (sizeof(char [1 - 2*!(cond)]) - 1) +#ifndef Py_MEMBER_SIZE +#define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member) +#endif + static size_t __pyx_pyframe_localsplus_offset = 0; + #include "frameobject.h" + #define __Pxy_PyFrame_Initialize_Offsets()\ + ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\ + (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus))) + #define __Pyx_PyFrame_GetLocalsplus(frame)\ + (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset)) +#endif + +/* PyObjectCall.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); +#else +#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) +#endif + +/* PyObjectCall2Args.proto */ +static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2); + +/* PyObjectCallMethO.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); +#endif + +/* PyObjectCallOneArg.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); + +/* PyObjectCallNoArg.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); +#else +#define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL) +#endif + +/* GetItemInt.proto */ +#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ + __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\ + (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\ + __Pyx_GetItemInt_Generic(o, to_py_func(i)))) +#define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ + __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ + (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL)) +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, + int wraparound, int boundscheck); +#define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ + __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ + (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL)) +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, + int wraparound, int boundscheck); +static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j); +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, + int is_list, int wraparound, int boundscheck); + +/* ObjectGetItem.proto */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key); +#else +#define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key) +#endif + +/* GetTopmostException.proto */ +#if CYTHON_USE_EXC_INFO_STACK +static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate); +#endif + +/* PyThreadStateGet.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; +#define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; +#define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type +#else +#define __Pyx_PyThreadState_declare +#define __Pyx_PyThreadState_assign +#define __Pyx_PyErr_Occurred() PyErr_Occurred() +#endif + +/* SaveResetException.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); +#else +#define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb) +#define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb) +#endif + +/* PyErrExceptionMatches.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) +static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); +#else +#define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) +#endif + +/* GetException.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb) +static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#else +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); +#endif + +/* StringJoin.proto */ +#if PY_MAJOR_VERSION < 3 +#define __Pyx_PyString_Join __Pyx_PyBytes_Join +#define __Pyx_PyBaseString_Join(s, v) (PyUnicode_CheckExact(s) ? PyUnicode_Join(s, v) : __Pyx_PyBytes_Join(s, v)) +#else +#define __Pyx_PyString_Join PyUnicode_Join +#define __Pyx_PyBaseString_Join PyUnicode_Join +#endif +#if CYTHON_COMPILING_IN_CPYTHON + #if PY_MAJOR_VERSION < 3 + #define __Pyx_PyBytes_Join _PyString_Join + #else + #define __Pyx_PyBytes_Join _PyBytes_Join + #endif +#else +static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values); +#endif + +/* PyErrFetchRestore.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) +#define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) +#define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) +#define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) +#define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); +static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) +#else +#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) +#endif +#else +#define __Pyx_PyErr_Clear() PyErr_Clear() +#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) +#define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) +#define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb) +#define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) +#endif + +/* RaiseException.proto */ +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); + +/* SwapException.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#else +static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb); +#endif + +/* ListCompAppend.proto */ +#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS +static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) { + PyListObject* L = (PyListObject*) list; + Py_ssize_t len = Py_SIZE(list); + if (likely(L->allocated > len)) { + Py_INCREF(x); + PyList_SET_ITEM(list, len, x); + Py_SIZE(list) = len+1; + return 0; + } + return PyList_Append(list, x); +} +#else +#define __Pyx_ListComp_Append(L,x) PyList_Append(L,x) +#endif + +/* RaiseArgTupleInvalid.proto */ +static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, + Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); + +/* RaiseDoubleKeywords.proto */ +static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); + +/* ParseKeywords.proto */ +static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\ + PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\ + const char* function_name); + +/* KeywordStringCheck.proto */ +static int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* function_name, int kw_allowed); + +/* WriteUnraisableException.proto */ +static void __Pyx_WriteUnraisable(const char *name, int clineno, + int lineno, const char *filename, + int full_traceback, int nogil); + +/* IncludeStringH.proto */ +#include + +/* BytesEquals.proto */ +static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); + +/* UnicodeEquals.proto */ +static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); + +/* StrEquals.proto */ +#if PY_MAJOR_VERSION >= 3 +#define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals +#else +#define __Pyx_PyString_Equals __Pyx_PyBytes_Equals +#endif + +/* GetAttr.proto */ +static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *); + +/* GetAttr3.proto */ +static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *); + +/* ArgTypeTest.proto */ +#define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\ + ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\ + __Pyx__ArgTypeTest(obj, type, name, exact)) +static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact); + +/* ExtTypeTest.proto */ +static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); + +/* CallableCheck.proto */ +#if CYTHON_USE_TYPE_SLOTS && PY_MAJOR_VERSION >= 3 +#define __Pyx_PyCallable_Check(obj) ((obj)->ob_type->tp_call != NULL) +#else +#define __Pyx_PyCallable_Check(obj) PyCallable_Check(obj) +#endif + +/* PyObjectSetAttrStr.proto */ +#if CYTHON_USE_TYPE_SLOTS +#define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o, n, NULL) +static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value); +#else +#define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n) +#define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v) +#endif + +/* PyObject_GenericGetAttrNoDict.proto */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name); +#else +#define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr +#endif + +/* PyObject_GenericGetAttr.proto */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name); +#else +#define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr +#endif + +/* SetVTable.proto */ +static int __Pyx_SetVtable(PyObject *dict, void *vtable); + +/* TypeImport.proto */ +#ifndef __PYX_HAVE_RT_ImportType_proto +#define __PYX_HAVE_RT_ImportType_proto +enum __Pyx_ImportType_CheckSize { + __Pyx_ImportType_CheckSize_Error = 0, + __Pyx_ImportType_CheckSize_Warn = 1, + __Pyx_ImportType_CheckSize_Ignore = 2 +}; +static PyTypeObject *__Pyx_ImportType(PyObject* module, const char *module_name, const char *class_name, size_t size, enum __Pyx_ImportType_CheckSize check_size); +#endif + +/* GetNameInClass.proto */ +#define __Pyx_GetNameInClass(var, nmspace, name) (var) = __Pyx__GetNameInClass(nmspace, name) +static PyObject *__Pyx__GetNameInClass(PyObject *nmspace, PyObject *name); + +/* Import.proto */ +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); + +/* ImportFrom.proto */ +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); + +/* CLineInTraceback.proto */ +#ifdef CYTHON_CLINE_IN_TRACEBACK +#define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) +#else +static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line); +#endif + +/* CodeObjectCache.proto */ +typedef struct { + PyCodeObject* code_object; + int code_line; +} __Pyx_CodeObjectCacheEntry; +struct __Pyx_CodeObjectCache { + int count; + int max_count; + __Pyx_CodeObjectCacheEntry* entries; +}; +static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); +static PyCodeObject *__pyx_find_code_object(int code_line); +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); + +/* AddTraceback.proto */ +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename); + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_int(unsigned int value); + +/* CIntFromPy.proto */ +static CYTHON_INLINE unsigned int __Pyx_PyInt_As_unsigned_int(PyObject *); + +/* CIntFromPy.proto */ +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); + +/* CIntFromPy.proto */ +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); + +/* FastTypeChecks.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) +static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b); +static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type); +static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2); +#else +#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) +#define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) +#define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) +#endif +#define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) + +/* FetchCommonType.proto */ +static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); + +/* PyObjectGetMethod.proto */ +static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method); + +/* PyObjectCallMethod1.proto */ +static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg); + +/* CoroutineBase.proto */ +typedef PyObject *(*__pyx_coroutine_body_t)(PyObject *, PyThreadState *, PyObject *); +#if CYTHON_USE_EXC_INFO_STACK +#define __Pyx_ExcInfoStruct _PyErr_StackItem +#else +typedef struct { + PyObject *exc_type; + PyObject *exc_value; + PyObject *exc_traceback; +} __Pyx_ExcInfoStruct; +#endif +typedef struct { + PyObject_HEAD + __pyx_coroutine_body_t body; + PyObject *closure; + __Pyx_ExcInfoStruct gi_exc_state; + PyObject *gi_weakreflist; + PyObject *classobj; + PyObject *yieldfrom; + PyObject *gi_name; + PyObject *gi_qualname; + PyObject *gi_modulename; + PyObject *gi_code; + int resume_label; + char is_running; +} __pyx_CoroutineObject; +static __pyx_CoroutineObject *__Pyx__Coroutine_New( + PyTypeObject *type, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure, + PyObject *name, PyObject *qualname, PyObject *module_name); +static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit( + __pyx_CoroutineObject *gen, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure, + PyObject *name, PyObject *qualname, PyObject *module_name); +static CYTHON_INLINE void __Pyx_Coroutine_ExceptionClear(__Pyx_ExcInfoStruct *self); +static int __Pyx_Coroutine_clear(PyObject *self); +static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value); +static PyObject *__Pyx_Coroutine_Close(PyObject *self); +static PyObject *__Pyx_Coroutine_Throw(PyObject *gen, PyObject *args); +#if CYTHON_USE_EXC_INFO_STACK +#define __Pyx_Coroutine_SwapException(self) +#define __Pyx_Coroutine_ResetAndClearException(self) __Pyx_Coroutine_ExceptionClear(&(self)->gi_exc_state) +#else +#define __Pyx_Coroutine_SwapException(self) {\ + __Pyx_ExceptionSwap(&(self)->gi_exc_state.exc_type, &(self)->gi_exc_state.exc_value, &(self)->gi_exc_state.exc_traceback);\ + __Pyx_Coroutine_ResetFrameBackpointer(&(self)->gi_exc_state);\ + } +#define __Pyx_Coroutine_ResetAndClearException(self) {\ + __Pyx_ExceptionReset((self)->gi_exc_state.exc_type, (self)->gi_exc_state.exc_value, (self)->gi_exc_state.exc_traceback);\ + (self)->gi_exc_state.exc_type = (self)->gi_exc_state.exc_value = (self)->gi_exc_state.exc_traceback = NULL;\ + } +#endif +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyGen_FetchStopIterationValue(pvalue)\ + __Pyx_PyGen__FetchStopIterationValue(__pyx_tstate, pvalue) +#else +#define __Pyx_PyGen_FetchStopIterationValue(pvalue)\ + __Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, pvalue) +#endif +static int __Pyx_PyGen__FetchStopIterationValue(PyThreadState *tstate, PyObject **pvalue); +static CYTHON_INLINE void __Pyx_Coroutine_ResetFrameBackpointer(__Pyx_ExcInfoStruct *exc_state); + +/* PatchModuleWithCoroutine.proto */ +static PyObject* __Pyx_Coroutine_patch_module(PyObject* module, const char* py_code); + +/* PatchGeneratorABC.proto */ +static int __Pyx_patch_abc(void); + +/* Generator.proto */ +#define __Pyx_Generator_USED +static PyTypeObject *__pyx_GeneratorType = 0; +#define __Pyx_Generator_CheckExact(obj) (Py_TYPE(obj) == __pyx_GeneratorType) +#define __Pyx_Generator_New(body, code, closure, name, qualname, module_name)\ + __Pyx__Coroutine_New(__pyx_GeneratorType, body, code, closure, name, qualname, module_name) +static PyObject *__Pyx_Generator_Next(PyObject *self); +static int __pyx_Generator_init(void); + +/* CheckBinaryVersion.proto */ +static int __Pyx_check_binary_version(void); + +/* InitStrings.proto */ +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); + +static CYTHON_INLINE struct PyGeventCallbackObject *__pyx_f_6gevent_5libev_8corecext_12CallbackFIFO_popleft(struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *__pyx_v_self); /* proto*/ +static CYTHON_INLINE PyObject *__pyx_f_6gevent_5libev_8corecext_12CallbackFIFO_append(struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *__pyx_v_self, struct PyGeventCallbackObject *__pyx_v_new_tail); /* proto*/ +static int __pyx_f_6gevent_5libev_8corecext_12CallbackFIFO_has_callbacks(struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *__pyx_v_self); /* proto*/ +static PyObject *__pyx_f_6gevent_5libev_8corecext_4loop__run_callbacks(struct PyGeventLoopObject *__pyx_v_self); /* proto*/ +static PyObject *__pyx_f_6gevent_5libev_8corecext_4loop__stop_watchers(struct PyGeventLoopObject *__pyx_v_self, struct ev_loop *__pyx_v_ptr); /* proto*/ +static PyObject *__pyx_f_6gevent_5libev_8corecext_4loop_handle_error(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_context, PyObject *__pyx_v_type, PyObject *__pyx_v_value, PyObject *__pyx_v_tb, int __pyx_skip_dispatch); /* proto*/ +static PyObject *__pyx_f_6gevent_5libev_8corecext_4loop__default_handle_error(struct PyGeventLoopObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_context, PyObject *__pyx_v_type, PyObject *__pyx_v_value, PyObject *__pyx_v_tb, int __pyx_skip_dispatch); /* proto*/ +static ev_tstamp __pyx_f_6gevent_5libev_8corecext_4loop_now(struct PyGeventLoopObject *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/ +static void __pyx_f_6gevent_5libev_8corecext_4loop_update_now(struct PyGeventLoopObject *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/ + +/* Module declarations from 'cython' */ + +/* Module declarations from 'libev' */ + +/* Module declarations from 'libc.string' */ + +/* Module declarations from 'libc.stdio' */ + +/* Module declarations from '__builtin__' */ + +/* Module declarations from 'cpython.type' */ +static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0; + +/* Module declarations from 'cpython.version' */ + +/* Module declarations from 'cpython.exc' */ + +/* Module declarations from 'cpython.module' */ + +/* Module declarations from 'cpython.mem' */ + +/* Module declarations from 'cpython.tuple' */ + +/* Module declarations from 'cpython.list' */ + +/* Module declarations from 'cpython.sequence' */ + +/* Module declarations from 'cpython.mapping' */ + +/* Module declarations from 'cpython.iterator' */ + +/* Module declarations from 'cpython.number' */ + +/* Module declarations from 'cpython.int' */ + +/* Module declarations from '__builtin__' */ + +/* Module declarations from 'cpython.bool' */ +static PyTypeObject *__pyx_ptype_7cpython_4bool_bool = 0; + +/* Module declarations from 'cpython.long' */ + +/* Module declarations from 'cpython.float' */ + +/* Module declarations from '__builtin__' */ + +/* Module declarations from 'cpython.complex' */ +static PyTypeObject *__pyx_ptype_7cpython_7complex_complex = 0; + +/* Module declarations from 'cpython.string' */ + +/* Module declarations from 'cpython.unicode' */ + +/* Module declarations from 'cpython.dict' */ + +/* Module declarations from 'cpython.instance' */ + +/* Module declarations from 'cpython.function' */ + +/* Module declarations from 'cpython.method' */ + +/* Module declarations from 'cpython.weakref' */ + +/* Module declarations from 'cpython.getargs' */ + +/* Module declarations from 'cpython.pythread' */ + +/* Module declarations from 'cpython.pystate' */ + +/* Module declarations from 'cpython.cobject' */ + +/* Module declarations from 'cpython.oldbuffer' */ + +/* Module declarations from 'cpython.set' */ + +/* Module declarations from 'cpython.buffer' */ + +/* Module declarations from 'cpython.bytes' */ + +/* Module declarations from 'cpython.pycapsule' */ + +/* Module declarations from 'cpython' */ + +/* Module declarations from 'cpython.object' */ + +/* Module declarations from 'cpython.ref' */ + +/* Module declarations from 'libc.errno' */ + +/* Module declarations from 'gevent.libev.corecext' */ +static PyTypeObject *__pyx_ptype_6gevent_5libev_8corecext__EVENTSType = 0; +static PyTypeObject *__pyx_ptype_6gevent_5libev_8corecext_callback = 0; +static PyTypeObject *__pyx_ptype_6gevent_5libev_8corecext_CallbackFIFO = 0; +static PyTypeObject *__pyx_ptype_6gevent_5libev_8corecext_loop = 0; +static PyTypeObject *__pyx_ptype_6gevent_5libev_8corecext_watcher = 0; +static PyTypeObject *__pyx_ptype_6gevent_5libev_8corecext_io = 0; +static PyTypeObject *__pyx_ptype_6gevent_5libev_8corecext_timer = 0; +static PyTypeObject *__pyx_ptype_6gevent_5libev_8corecext_signal = 0; +static PyTypeObject *__pyx_ptype_6gevent_5libev_8corecext_idle = 0; +static PyTypeObject *__pyx_ptype_6gevent_5libev_8corecext_prepare = 0; +static PyTypeObject *__pyx_ptype_6gevent_5libev_8corecext_check = 0; +static PyTypeObject *__pyx_ptype_6gevent_5libev_8corecext_fork = 0; +static PyTypeObject *__pyx_ptype_6gevent_5libev_8corecext_async_ = 0; +static PyTypeObject *__pyx_ptype_6gevent_5libev_8corecext_child = 0; +static PyTypeObject *__pyx_ptype_6gevent_5libev_8corecext_stat = 0; +static PyTypeObject *__pyx_ptype_6gevent_5libev_8corecext___pyx_scope_struct__genexpr = 0; +static PyObject *__pyx_v_6gevent_5libev_8corecext_integer_types = 0; +__PYX_EXTERN_C DL_EXPORT(PyObject) *GEVENT_CORE_EVENTS; +static struct __pyx_t_6gevent_5libev_8corecext_start_and_stop __pyx_v_6gevent_5libev_8corecext_io_ss; +static struct __pyx_t_6gevent_5libev_8corecext_start_and_stop __pyx_v_6gevent_5libev_8corecext_timer_ss; +static struct __pyx_t_6gevent_5libev_8corecext_start_and_stop __pyx_v_6gevent_5libev_8corecext_signal_ss; +static struct __pyx_t_6gevent_5libev_8corecext_start_and_stop __pyx_v_6gevent_5libev_8corecext_idle_ss; +static struct __pyx_t_6gevent_5libev_8corecext_start_and_stop __pyx_v_6gevent_5libev_8corecext_prepare_ss; +static struct __pyx_t_6gevent_5libev_8corecext_start_and_stop __pyx_v_6gevent_5libev_8corecext_check_ss; +static struct __pyx_t_6gevent_5libev_8corecext_start_and_stop __pyx_v_6gevent_5libev_8corecext_fork_ss; +static struct __pyx_t_6gevent_5libev_8corecext_start_and_stop __pyx_v_6gevent_5libev_8corecext_async_ss; +static struct __pyx_t_6gevent_5libev_8corecext_start_and_stop __pyx_v_6gevent_5libev_8corecext_child_ss; +static struct __pyx_t_6gevent_5libev_8corecext_start_and_stop __pyx_v_6gevent_5libev_8corecext_stat_ss; +__PYX_EXTERN_C DL_EXPORT(PyObject) *_empty_tuple; +static PyObject *__pyx_f_6gevent_5libev_8corecext__flags_to_list(unsigned int, int __pyx_skip_dispatch); /*proto*/ +static unsigned int __pyx_f_6gevent_5libev_8corecext__flags_to_int(PyObject *, int __pyx_skip_dispatch); /*proto*/ +static PyObject *__pyx_f_6gevent_5libev_8corecext__str_hex(PyObject *); /*proto*/ +static PyObject *__pyx_f_6gevent_5libev_8corecext__check_flags(unsigned int, int __pyx_skip_dispatch); /*proto*/ +static PyObject *__pyx_f_6gevent_5libev_8corecext__events_to_str(int, int __pyx_skip_dispatch); /*proto*/ +static int __pyx_f_6gevent_5libev_8corecext__check_loop(struct PyGeventLoopObject *); /*proto*/ +static void __pyx_f_6gevent_5libev_8corecext__python_incref(struct PyGeventWatcherObject *); /*proto*/ +static void __pyx_f_6gevent_5libev_8corecext__python_decref(struct PyGeventWatcherObject *); /*proto*/ +static void __pyx_f_6gevent_5libev_8corecext__libev_ref(struct PyGeventWatcherObject *); /*proto*/ +static void __pyx_f_6gevent_5libev_8corecext__libev_unref(struct PyGeventWatcherObject *); /*proto*/ +static struct __pyx_t_6gevent_5libev_8corecext_start_and_stop __pyx_f_6gevent_5libev_8corecext_make_ss(void *, void *); /*proto*/ +static int __pyx_f_6gevent_5libev_8corecext__watcher_start(struct PyGeventWatcherObject *, PyObject *, PyObject *); /*proto*/ +static void __pyx_f_6gevent_5libev_8corecext__syserr_cb(char *); /*proto*/ +static PyObject *__pyx_f_6gevent_5libev_8corecext_set_syserr_cb(PyObject *, int __pyx_skip_dispatch); /*proto*/ +__PYX_EXTERN_C void gevent_handle_error(struct PyGeventLoopObject *, PyObject *); /*proto*/ +__PYX_EXTERN_C PyObject *gevent_loop_run_callbacks(struct PyGeventLoopObject *); /*proto*/ +#define __Pyx_MODULE_NAME "gevent.libev.corecext" +extern int __pyx_module_is_main_gevent__libev__corecext; +int __pyx_module_is_main_gevent__libev__corecext = 0; + +/* Implementation of 'gevent.libev.corecext' */ +static PyObject *__pyx_builtin___import__; +static PyObject *__pyx_builtin_ImportError; +static PyObject *__pyx_builtin_KeyError; +static PyObject *__pyx_builtin_ValueError; +static PyObject *__pyx_builtin_hex; +static PyObject *__pyx_builtin_id; +static PyObject *__pyx_builtin_SystemError; +static PyObject *__pyx_builtin_AttributeError; +static PyObject *__pyx_builtin_TypeError; +static const char __pyx_k_[] = ","; +static const char __pyx_k_t[] = "t"; +static const char __pyx_k_v[] = "v"; +static const char __pyx_k__2[] = ", "; +static const char __pyx_k__3[] = "|"; +static const char __pyx_k__5[] = "<...>"; +static const char __pyx_k__6[] = ">"; +static const char __pyx_k__7[] = ""; +static const char __pyx_k__8[] = ": "; +static const char __pyx_k_fd[] = "fd"; +static const char __pyx_k_id[] = "id"; +static const char __pyx_k_io[] = "io"; +static const char __pyx_k_os[] = "os"; +static const char __pyx_k_tb[] = "tb"; +static const char __pyx_k_all[] = "__all__"; +static const char __pyx_k_hex[] = "hex"; +static const char __pyx_k_how[] = "how"; +static const char __pyx_k_now[] = "now"; +static const char __pyx_k_pid[] = "pid"; +static const char __pyx_k_ptr[] = "ptr"; +static const char __pyx_k_ref[] = "ref"; +static const char __pyx_k_sys[] = "sys"; +static const char __pyx_k_FORK[] = "FORK"; +static const char __pyx_k_IDLE[] = "IDLE"; +static const char __pyx_k_NONE[] = "NONE"; +static const char __pyx_k_NSIG[] = "NSIG"; +static const char __pyx_k_READ[] = "READ"; +static const char __pyx_k_STAT[] = "STAT"; +static const char __pyx_k_args[] = "args"; +static const char __pyx_k_fork[] = "fork"; +static const char __pyx_k_func[] = "func"; +static const char __pyx_k_idle[] = "idle"; +static const char __pyx_k_init[] = "__init__"; +static const char __pyx_k_join[] = "join"; +static const char __pyx_k_keys[] = "keys"; +static const char __pyx_k_loop[] = "loop"; +static const char __pyx_k_main[] = "__main__"; +static const char __pyx_k_name[] = "__name__"; +static const char __pyx_k_once[] = "once"; +static const char __pyx_k_path[] = "path"; +static const char __pyx_k_poll[] = "poll"; +static const char __pyx_k_port[] = "port"; +static const char __pyx_k_send[] = "send"; +static const char __pyx_k_stat[] = "stat"; +static const char __pyx_k_stop[] = "stop"; +static const char __pyx_k_test[] = "__test__"; +static const char __pyx_k_time[] = "time"; +static const char __pyx_k_type[] = "type"; +static const char __pyx_k_ASYNC[] = "ASYNC"; +static const char __pyx_k_CHECK[] = "CHECK"; +static const char __pyx_k_CHILD[] = "CHILD"; +static const char __pyx_k_EMBED[] = "EMBED"; +static const char __pyx_k_ERROR[] = "ERROR"; +static const char __pyx_k_ILoop[] = "ILoop"; +static const char __pyx_k_TIMER[] = "TIMER"; +static const char __pyx_k_UNDEF[] = "UNDEF"; +static const char __pyx_k_WRITE[] = "WRITE"; +static const char __pyx_k_after[] = "after"; +static const char __pyx_k_async[] = "async_"; +static const char __pyx_k_check[] = "check"; +static const char __pyx_k_child[] = "child"; +static const char __pyx_k_class[] = "__class__"; +static const char __pyx_k_close[] = "close"; +static const char __pyx_k_epoll[] = "epoll"; +static const char __pyx_k_errno[] = "errno"; +static const char __pyx_k_flags[] = "_flags"; +static const char __pyx_k_level[] = "level"; +static const char __pyx_k_lower[] = "lower"; +static const char __pyx_k_noenv[] = "noenv"; +static const char __pyx_k_ref_2[] = " ref="; +static const char __pyx_k_sigfd[] = "sigfd"; +static const char __pyx_k_split[] = "split"; +static const char __pyx_k_start[] = "start"; +static const char __pyx_k_strip[] = "strip"; +static const char __pyx_k_throw[] = "throw"; +static const char __pyx_k_timer[] = "timer"; +static const char __pyx_k_trace[] = "trace"; +static const char __pyx_k_value[] = "value"; +static const char __pyx_k_win32[] = "win32"; +static const char __pyx_k_CUSTOM[] = "CUSTOM"; +static const char __pyx_k_EVENTS[] = "EVENTS"; +static const char __pyx_k_MAXPRI[] = "MAXPRI"; +static const char __pyx_k_MINPRI[] = "MINPRI"; +static const char __pyx_k_SIGNAL[] = "SIGNAL"; +static const char __pyx_k_active[] = "active"; +static const char __pyx_k_args_r[] = " args=%r"; +static const char __pyx_k_decode[] = "decode"; +static const char __pyx_k_encode[] = "encode"; +static const char __pyx_k_events[] = "_events"; +static const char __pyx_k_fileno[] = "fileno"; +static const char __pyx_k_format[] = "_format"; +static const char __pyx_k_gevent[] = "gevent"; +static const char __pyx_k_import[] = "__import__"; +static const char __pyx_k_kqueue[] = "kqueue"; +static const char __pyx_k_nowait[] = "nowait"; +static const char __pyx_k_repeat[] = "repeat"; +static const char __pyx_k_select[] = "select"; +static const char __pyx_k_signal[] = "signal"; +static const char __pyx_k_signum[] = "signum"; +static const char __pyx_k_update[] = "update"; +static const char __pyx_k_CLEANUP[] = "CLEANUP"; +static const char __pyx_k_IOFDSET[] = "_IOFDSET"; +static const char __pyx_k_PREPARE[] = "PREPARE"; +static const char __pyx_k_async_2[] = "async"; +static const char __pyx_k_backend[] = "backend"; +static const char __pyx_k_context[] = "context"; +static const char __pyx_k_default[] = "default"; +static const char __pyx_k_flags_2[] = "flags"; +static const char __pyx_k_genexpr[] = "genexpr"; +static const char __pyx_k_message[] = "message"; +static const char __pyx_k_pending[] = "pending"; +static const char __pyx_k_prepare[] = "prepare"; +static const char __pyx_k_revents[] = "revents"; +static const char __pyx_k_rstatus[] = "rstatus"; +static const char __pyx_k_stopped[] = " stopped"; +static const char __pyx_k_watcher[] = "watcher"; +static const char __pyx_k_KeyError[] = "KeyError"; +static const char __pyx_k_PERIODIC[] = "PERIODIC"; +static const char __pyx_k_SIGNALFD[] = "SIGNALFD"; +static const char __pyx_k_active_2[] = " active"; +static const char __pyx_k_builtins[] = "__builtins__"; +static const char __pyx_k_callback[] = "callback"; +static const char __pyx_k_events_2[] = "events"; +static const char __pyx_k_fileno_2[] = " fileno="; +static const char __pyx_k_interval[] = "interval"; +static const char __pyx_k_platform[] = "platform"; +static const char __pyx_k_priority[] = "priority"; +static const char __pyx_k_signalfd[] = "signalfd"; +static const char __pyx_k_strerror[] = "strerror"; +static const char __pyx_k_FORKCHECK[] = "FORKCHECK"; +static const char __pyx_k_NOINOTIFY[] = "NOINOTIFY"; +static const char __pyx_k_NOSIGMASK[] = "NOSIGMASK"; +static const char __pyx_k_READWRITE[] = "READWRITE"; +static const char __pyx_k_TypeError[] = "TypeError"; +static const char __pyx_k_activecnt[] = "activecnt"; +static const char __pyx_k_default_2[] = " default"; +static const char __pyx_k_destroyed[] = "destroyed"; +static const char __pyx_k_forkcheck[] = "forkcheck"; +static const char __pyx_k_noinotify[] = "noinotify"; +static const char __pyx_k_nosigmask[] = "nosigmask"; +static const char __pyx_k_pending_2[] = " pending"; +static const char __pyx_k_pending_s[] = " pending=%s"; +static const char __pyx_k_print_exc[] = "print_exc"; +static const char __pyx_k_signalnum[] = "signalnum"; +static const char __pyx_k_traceback[] = "traceback"; +static const char __pyx_k_ValueError[] = "ValueError"; +static const char __pyx_k_basestring[] = "basestring"; +static const char __pyx_k_callback_r[] = " callback=%r"; +static const char __pyx_k_events_str[] = "events_str"; +static const char __pyx_k_pendingcnt[] = "pendingcnt"; +static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__"; +static const char __pyx_k_update_now[] = "update_now"; +static const char __pyx_k_ImportError[] = "ImportError"; +static const char __pyx_k_LIBEV_EMBED[] = "LIBEV_EMBED"; +static const char __pyx_k_SystemError[] = "SystemError"; +static const char __pyx_k_get_version[] = "get_version"; +static const char __pyx_k_libev_d_02d[] = "libev-%d.%02d"; +static const char __pyx_k_pass_events[] = "pass_events"; +static const char __pyx_k_s_at_0x_x_s[] = "<%s at 0x%x%s"; +static const char __pyx_k_BACKEND_POLL[] = "BACKEND_POLL"; +static const char __pyx_k_BACKEND_PORT[] = "BACKEND_PORT"; +static const char __pyx_k_EV_USE_4HEAP[] = "EV_USE_4HEAP"; +static const char __pyx_k_EV_USE_FLOOR[] = "EV_USE_FLOOR"; +static const char __pyx_k_handle_error[] = "handle_error"; +static const char __pyx_k_signalmodule[] = "signalmodule"; +static const char __pyx_k_version_info[] = "version_info"; +static const char __pyx_k_BACKEND_EPOLL[] = "BACKEND_EPOLL"; +static const char __pyx_k_fd_s_events_s[] = " fd=%s events=%s"; +static const char __pyx_k_flags_str2int[] = "_flags_str2int"; +static const char __pyx_k_handle_syserr[] = "_handle_syserr"; +static const char __pyx_k_origflags_int[] = "origflags_int"; +static const char __pyx_k_s_at_0x_x_s_2[] = "<%s at 0x%x %s>"; +static const char __pyx_k_AttributeError[] = "AttributeError"; +static const char __pyx_k_BACKEND_KQUEUE[] = "BACKEND_KQUEUE"; +static const char __pyx_k_BACKEND_SELECT[] = "BACKEND_SELECT"; +static const char __pyx_k_EV_USE_EVENTFD[] = "EV_USE_EVENTFD"; +static const char __pyx_k_EV_USE_INOTIFY[] = "EV_USE_INOTIFY"; +static const char __pyx_k_format_details[] = "_format_details"; +static const char __pyx_k_zope_interface[] = "zope.interface"; +static const char __pyx_k_EV_USE_REALTIME[] = "EV_USE_REALTIME"; +static const char __pyx_k_EV_USE_SIGNALFD[] = "EV_USE_SIGNALFD"; +static const char __pyx_k_SYSERR_CALLBACK[] = "__SYSERR_CALLBACK"; +static const char __pyx_k_classImplements[] = "classImplements"; +static const char __pyx_k_pid_r_rstatus_r[] = " pid=%r rstatus=%r"; +static const char __pyx_k_print_exception[] = "print_exception"; +static const char __pyx_k_EV_USE_MONOTONIC[] = "EV_USE_MONOTONIC"; +static const char __pyx_k_EV_USE_NANOSLEEP[] = "EV_USE_NANOSLEEP"; +static const char __pyx_k_getswitchinterval[] = "getswitchinterval"; +static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; +static const char __pyx_k_get_header_version[] = "get_header_version"; +static const char __pyx_k_gevent__interfaces[] = "gevent._interfaces"; +static const char __pyx_k_gevent_core_EVENTS[] = "gevent.core.EVENTS"; +static const char __pyx_k_supported_backends[] = "supported_backends"; +static const char __pyx_k_embeddable_backends[] = "embeddable_backends"; +static const char __pyx_k_EV_USE_CLOCK_SYSCALL[] = "EV_USE_CLOCK_SYSCALL"; +static const char __pyx_k_default_handle_error[] = "_default_handle_error"; +static const char __pyx_k_ev_loop_new_s_failed[] = "ev_loop_new(%s) failed"; +static const char __pyx_k_illegal_event_mask_r[] = "illegal event mask: %r"; +static const char __pyx_k_recommended_backends[] = "recommended_backends"; +static const char __pyx_k_Unsupported_backend_s[] = "Unsupported backend: %s"; +static const char __pyx_k_getfilesystemencoding[] = "getfilesystemencoding"; +static const char __pyx_k_gevent_libev_corecext[] = "gevent.libev.corecext"; +static const char __pyx_k_Expected_callable_not_r[] = "Expected callable, not %r"; +static const char __pyx_k_illegal_signal_number_r[] = "illegal signal number: %r"; +static const char __pyx_k_ev_default_loop_s_failed[] = "ev_default_loop(%s) failed"; +static const char __pyx_k_fd_must_be_non_negative_r[] = "fd must be non-negative: %r"; +static const char __pyx_k_operation_on_destroyed_loop[] = "operation on destroyed loop"; +static const char __pyx_k_src_gevent_libev_corecext_pyx[] = "src\\gevent\\libev\\corecext.pyx"; +static const char __pyx_k_Invalid_value_for_backend_0x_x[] = "Invalid value for backend: 0x%x"; +static const char __pyx_k_io_watcher_attribute_events_is[] = "'io' watcher attribute 'events' is read-only while watcher is active"; +static const char __pyx_k_Cannot_construct_a_bare_watcher[] = "Cannot construct a bare watcher"; +static const char __pyx_k_Expected_callable_or_None_got_r[] = "Expected callable or None, got %r"; +static const char __pyx_k_callbacks_r_len_d_head_r_tail_r[] = ""; +static const char __pyx_k_io_watcher_attribute_fd_is_read[] = "'io' watcher attribute 'fd' is read-only while watcher is active"; +static const char __pyx_k_repeat_must_be_positive_or_zero[] = "repeat must be positive or zero: %r"; +static const char __pyx_k_Cannot_set_priority_of_an_active[] = "Cannot set priority of an active watcher"; +static const char __pyx_k_Child_watchers_are_not_supported[] = "Child watchers are not supported on Windows"; +static const char __pyx_k_Invalid_backend_or_flag_s_Possib[] = "Invalid backend or flag: %s\nPossible values: %s"; +static const char __pyx_k_child_watchers_are_only_availabl[] = "child watchers are only available on the default loop"; +static PyObject *__pyx_kp_s_; +static PyObject *__pyx_n_s_ASYNC; +static PyObject *__pyx_n_s_AttributeError; +static PyObject *__pyx_n_s_BACKEND_EPOLL; +static PyObject *__pyx_n_s_BACKEND_KQUEUE; +static PyObject *__pyx_n_s_BACKEND_POLL; +static PyObject *__pyx_n_s_BACKEND_PORT; +static PyObject *__pyx_n_s_BACKEND_SELECT; +static PyObject *__pyx_n_s_CHECK; +static PyObject *__pyx_n_s_CHILD; +static PyObject *__pyx_n_s_CLEANUP; +static PyObject *__pyx_n_s_CUSTOM; +static PyObject *__pyx_kp_s_Cannot_construct_a_bare_watcher; +static PyObject *__pyx_kp_s_Cannot_set_priority_of_an_active; +static PyObject *__pyx_kp_s_Child_watchers_are_not_supported; +static PyObject *__pyx_n_s_EMBED; +static PyObject *__pyx_n_s_ERROR; +static PyObject *__pyx_n_s_EVENTS; +static PyObject *__pyx_n_s_EV_USE_4HEAP; +static PyObject *__pyx_n_s_EV_USE_CLOCK_SYSCALL; +static PyObject *__pyx_n_s_EV_USE_EVENTFD; +static PyObject *__pyx_n_s_EV_USE_FLOOR; +static PyObject *__pyx_n_s_EV_USE_INOTIFY; +static PyObject *__pyx_n_s_EV_USE_MONOTONIC; +static PyObject *__pyx_n_s_EV_USE_NANOSLEEP; +static PyObject *__pyx_n_s_EV_USE_REALTIME; +static PyObject *__pyx_n_s_EV_USE_SIGNALFD; +static PyObject *__pyx_kp_s_Expected_callable_not_r; +static PyObject *__pyx_kp_s_Expected_callable_or_None_got_r; +static PyObject *__pyx_n_s_FORK; +static PyObject *__pyx_n_s_FORKCHECK; +static PyObject *__pyx_n_s_IDLE; +static PyObject *__pyx_n_s_ILoop; +static PyObject *__pyx_n_s_IOFDSET; +static PyObject *__pyx_n_s_ImportError; +static PyObject *__pyx_kp_s_Invalid_backend_or_flag_s_Possib; +static PyObject *__pyx_kp_s_Invalid_value_for_backend_0x_x; +static PyObject *__pyx_n_s_KeyError; +static PyObject *__pyx_n_s_LIBEV_EMBED; +static PyObject *__pyx_n_s_MAXPRI; +static PyObject *__pyx_n_s_MINPRI; +static PyObject *__pyx_n_s_NOINOTIFY; +static PyObject *__pyx_n_s_NONE; +static PyObject *__pyx_n_s_NOSIGMASK; +static PyObject *__pyx_n_s_NSIG; +static PyObject *__pyx_n_s_PERIODIC; +static PyObject *__pyx_n_s_PREPARE; +static PyObject *__pyx_n_s_READ; +static PyObject *__pyx_n_s_READWRITE; +static PyObject *__pyx_n_s_SIGNAL; +static PyObject *__pyx_n_s_SIGNALFD; +static PyObject *__pyx_n_s_STAT; +static PyObject *__pyx_n_s_SYSERR_CALLBACK; +static PyObject *__pyx_n_s_SystemError; +static PyObject *__pyx_n_s_TIMER; +static PyObject *__pyx_n_s_TypeError; +static PyObject *__pyx_n_s_UNDEF; +static PyObject *__pyx_kp_s_Unsupported_backend_s; +static PyObject *__pyx_n_s_ValueError; +static PyObject *__pyx_n_s_WRITE; +static PyObject *__pyx_kp_s__2; +static PyObject *__pyx_kp_s__3; +static PyObject *__pyx_kp_s__5; +static PyObject *__pyx_kp_s__6; +static PyObject *__pyx_kp_s__7; +static PyObject *__pyx_kp_s__8; +static PyObject *__pyx_n_s_active; +static PyObject *__pyx_kp_s_active_2; +static PyObject *__pyx_n_s_activecnt; +static PyObject *__pyx_n_s_after; +static PyObject *__pyx_n_s_all; +static PyObject *__pyx_n_s_args; +static PyObject *__pyx_kp_s_args_r; +static PyObject *__pyx_n_s_async; +static PyObject *__pyx_n_s_async_2; +static PyObject *__pyx_n_s_backend; +static PyObject *__pyx_n_s_basestring; +static PyObject *__pyx_n_s_builtins; +static PyObject *__pyx_n_s_callback; +static PyObject *__pyx_kp_s_callback_r; +static PyObject *__pyx_kp_s_callbacks_r_len_d_head_r_tail_r; +static PyObject *__pyx_n_s_check; +static PyObject *__pyx_n_s_child; +static PyObject *__pyx_kp_s_child_watchers_are_only_availabl; +static PyObject *__pyx_n_s_class; +static PyObject *__pyx_n_s_classImplements; +static PyObject *__pyx_n_s_cline_in_traceback; +static PyObject *__pyx_n_s_close; +static PyObject *__pyx_n_s_context; +static PyObject *__pyx_n_s_decode; +static PyObject *__pyx_n_s_default; +static PyObject *__pyx_kp_s_default_2; +static PyObject *__pyx_n_s_default_handle_error; +static PyObject *__pyx_n_s_destroyed; +static PyObject *__pyx_n_s_embeddable_backends; +static PyObject *__pyx_n_s_encode; +static PyObject *__pyx_n_s_epoll; +static PyObject *__pyx_n_s_errno; +static PyObject *__pyx_kp_s_ev_default_loop_s_failed; +static PyObject *__pyx_kp_s_ev_loop_new_s_failed; +static PyObject *__pyx_n_s_events; +static PyObject *__pyx_n_s_events_2; +static PyObject *__pyx_n_s_events_str; +static PyObject *__pyx_n_s_fd; +static PyObject *__pyx_kp_s_fd_must_be_non_negative_r; +static PyObject *__pyx_kp_s_fd_s_events_s; +static PyObject *__pyx_n_s_fileno; +static PyObject *__pyx_kp_s_fileno_2; +static PyObject *__pyx_n_s_flags; +static PyObject *__pyx_n_s_flags_2; +static PyObject *__pyx_n_s_flags_str2int; +static PyObject *__pyx_n_s_fork; +static PyObject *__pyx_n_s_forkcheck; +static PyObject *__pyx_n_s_format; +static PyObject *__pyx_n_s_format_details; +static PyObject *__pyx_n_s_func; +static PyObject *__pyx_n_s_genexpr; +static PyObject *__pyx_n_s_get_header_version; +static PyObject *__pyx_n_s_get_version; +static PyObject *__pyx_n_s_getfilesystemencoding; +static PyObject *__pyx_n_s_getswitchinterval; +static PyObject *__pyx_n_s_gevent; +static PyObject *__pyx_n_s_gevent__interfaces; +static PyObject *__pyx_kp_s_gevent_core_EVENTS; +static PyObject *__pyx_n_s_gevent_libev_corecext; +static PyObject *__pyx_n_s_handle_error; +static PyObject *__pyx_n_s_handle_syserr; +static PyObject *__pyx_n_s_hex; +static PyObject *__pyx_n_s_how; +static PyObject *__pyx_n_s_id; +static PyObject *__pyx_n_s_idle; +static PyObject *__pyx_kp_s_illegal_event_mask_r; +static PyObject *__pyx_kp_s_illegal_signal_number_r; +static PyObject *__pyx_n_s_import; +static PyObject *__pyx_n_s_init; +static PyObject *__pyx_n_s_interval; +static PyObject *__pyx_n_s_io; +static PyObject *__pyx_kp_s_io_watcher_attribute_events_is; +static PyObject *__pyx_kp_s_io_watcher_attribute_fd_is_read; +static PyObject *__pyx_n_s_join; +static PyObject *__pyx_n_s_keys; +static PyObject *__pyx_n_s_kqueue; +static PyObject *__pyx_n_s_level; +static PyObject *__pyx_kp_s_libev_d_02d; +static PyObject *__pyx_n_s_loop; +static PyObject *__pyx_n_s_lower; +static PyObject *__pyx_n_s_main; +static PyObject *__pyx_n_s_message; +static PyObject *__pyx_n_s_name; +static PyObject *__pyx_n_s_noenv; +static PyObject *__pyx_n_s_noinotify; +static PyObject *__pyx_n_s_nosigmask; +static PyObject *__pyx_n_s_now; +static PyObject *__pyx_n_s_nowait; +static PyObject *__pyx_n_s_once; +static PyObject *__pyx_kp_s_operation_on_destroyed_loop; +static PyObject *__pyx_n_s_origflags_int; +static PyObject *__pyx_n_s_os; +static PyObject *__pyx_n_s_pass_events; +static PyObject *__pyx_n_s_path; +static PyObject *__pyx_n_s_pending; +static PyObject *__pyx_kp_s_pending_2; +static PyObject *__pyx_kp_s_pending_s; +static PyObject *__pyx_n_s_pendingcnt; +static PyObject *__pyx_n_s_pid; +static PyObject *__pyx_kp_s_pid_r_rstatus_r; +static PyObject *__pyx_n_s_platform; +static PyObject *__pyx_n_s_poll; +static PyObject *__pyx_n_s_port; +static PyObject *__pyx_n_s_prepare; +static PyObject *__pyx_n_s_print_exc; +static PyObject *__pyx_n_s_print_exception; +static PyObject *__pyx_n_s_priority; +static PyObject *__pyx_n_s_ptr; +static PyObject *__pyx_n_s_pyx_vtable; +static PyObject *__pyx_n_s_recommended_backends; +static PyObject *__pyx_n_s_ref; +static PyObject *__pyx_kp_s_ref_2; +static PyObject *__pyx_n_s_repeat; +static PyObject *__pyx_kp_s_repeat_must_be_positive_or_zero; +static PyObject *__pyx_n_s_revents; +static PyObject *__pyx_n_s_rstatus; +static PyObject *__pyx_kp_s_s_at_0x_x_s; +static PyObject *__pyx_kp_s_s_at_0x_x_s_2; +static PyObject *__pyx_n_s_select; +static PyObject *__pyx_n_s_send; +static PyObject *__pyx_n_s_sigfd; +static PyObject *__pyx_n_s_signal; +static PyObject *__pyx_n_s_signalfd; +static PyObject *__pyx_n_s_signalmodule; +static PyObject *__pyx_n_s_signalnum; +static PyObject *__pyx_n_s_signum; +static PyObject *__pyx_n_s_split; +static PyObject *__pyx_kp_s_src_gevent_libev_corecext_pyx; +static PyObject *__pyx_n_s_start; +static PyObject *__pyx_n_s_stat; +static PyObject *__pyx_n_s_stop; +static PyObject *__pyx_kp_s_stopped; +static PyObject *__pyx_n_s_strerror; +static PyObject *__pyx_n_s_strip; +static PyObject *__pyx_n_s_supported_backends; +static PyObject *__pyx_n_s_sys; +static PyObject *__pyx_n_s_t; +static PyObject *__pyx_n_s_tb; +static PyObject *__pyx_n_s_test; +static PyObject *__pyx_n_s_throw; +static PyObject *__pyx_n_s_time; +static PyObject *__pyx_n_s_timer; +static PyObject *__pyx_n_s_trace; +static PyObject *__pyx_n_s_traceback; +static PyObject *__pyx_n_s_type; +static PyObject *__pyx_n_s_update; +static PyObject *__pyx_n_s_update_now; +static PyObject *__pyx_n_s_v; +static PyObject *__pyx_n_s_value; +static PyObject *__pyx_n_s_version_info; +static PyObject *__pyx_n_s_watcher; +static PyObject *__pyx_n_s_win32; +static PyObject *__pyx_n_s_zope_interface; +static PyObject *__pyx_pf_6gevent_5libev_8corecext_22genexpr(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_11_EVENTSType___repr__(CYTHON_UNUSED struct __pyx_obj_6gevent_5libev_8corecext__EVENTSType *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_get_version(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_2get_header_version(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4_flags_to_list(CYTHON_UNUSED PyObject *__pyx_self, unsigned int __pyx_v_flags); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_6_flags_to_int(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_flags); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_8_check_flags(CYTHON_UNUSED PyObject *__pyx_self, unsigned int __pyx_v_flags); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_10_events_to_str(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_events); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_12supported_backends(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_14recommended_backends(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_16embeddable_backends(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_18time(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_8callback___init__(struct PyGeventCallbackObject *__pyx_v_self, PyObject *__pyx_v_callback, PyObject *__pyx_v_args); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_8callback_2stop(struct PyGeventCallbackObject *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_8callback_4__nonzero__(struct PyGeventCallbackObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_8callback_7pending___get__(struct PyGeventCallbackObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_8callback_6__repr__(struct PyGeventCallbackObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_8callback_8_format(CYTHON_UNUSED struct PyGeventCallbackObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_8callback_8callback___get__(struct PyGeventCallbackObject *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_8callback_8callback_2__set__(struct PyGeventCallbackObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_8callback_8callback_4__del__(struct PyGeventCallbackObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_8callback_4args___get__(struct PyGeventCallbackObject *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_8callback_4args_2__set__(struct PyGeventCallbackObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_8callback_4args_4__del__(struct PyGeventCallbackObject *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_12CallbackFIFO___init__(struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_12CallbackFIFO_2__nonzero__(struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *__pyx_v_self); /* proto */ +static Py_ssize_t __pyx_pf_6gevent_5libev_8corecext_12CallbackFIFO_4__len__(struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_12CallbackFIFO_6__iter__(struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_12CallbackFIFO_8__repr__(struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_4loop___cinit__(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_flags, PyObject *__pyx_v_default, intptr_t __pyx_v_ptr); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_4loop_2__init__(struct PyGeventLoopObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_flags, CYTHON_UNUSED PyObject *__pyx_v_default, CYTHON_UNUSED intptr_t __pyx_v_ptr); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_4destroy(struct PyGeventLoopObject *__pyx_v_self); /* proto */ +static void __pyx_pf_6gevent_5libev_8corecext_4loop_6__dealloc__(struct PyGeventLoopObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_3ptr___get__(struct PyGeventLoopObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_11WatcherType___get__(CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_6MAXPRI___get__(CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_6MINPRI___get__(CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_8_handle_syserr(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_message, PyObject *__pyx_v_errno); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_10handle_error(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_context, PyObject *__pyx_v_type, PyObject *__pyx_v_value, PyObject *__pyx_v_tb); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_12_default_handle_error(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_context, PyObject *__pyx_v_type, PyObject *__pyx_v_value, PyObject *__pyx_v_tb); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_14run(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_nowait, PyObject *__pyx_v_once); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_16reinit(struct PyGeventLoopObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_18ref(struct PyGeventLoopObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_20unref(struct PyGeventLoopObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_22break_(struct PyGeventLoopObject *__pyx_v_self, int __pyx_v_how); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_24verify(struct PyGeventLoopObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_26now(struct PyGeventLoopObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_28update_now(struct PyGeventLoopObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_30__repr__(struct PyGeventLoopObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_7default___get__(struct PyGeventLoopObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_9iteration___get__(struct PyGeventLoopObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_5depth___get__(struct PyGeventLoopObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_11backend_int___get__(struct PyGeventLoopObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_7backend___get__(struct PyGeventLoopObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_10pendingcnt___get__(struct PyGeventLoopObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_32io(struct PyGeventLoopObject *__pyx_v_self, vfd_socket_t __pyx_v_fd, int __pyx_v_events, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_34timer(struct PyGeventLoopObject *__pyx_v_self, double __pyx_v_after, double __pyx_v_repeat, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_36signal(struct PyGeventLoopObject *__pyx_v_self, int __pyx_v_signum, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_38idle(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_40prepare(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_42check(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_44fork(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_46async_(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_48child(struct PyGeventLoopObject *__pyx_v_self, int __pyx_v_pid, int __pyx_v_trace, PyObject *__pyx_v_ref); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_50install_sigchld(CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_52reset_sigchld(CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_54stat(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_path, float __pyx_v_interval, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_56run_callback(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_func, PyObject *__pyx_v_args); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_58_format(struct PyGeventLoopObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_60_format_details(struct PyGeventLoopObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_62fileno(struct PyGeventLoopObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_9activecnt___get__(struct PyGeventLoopObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_11sig_pending___get__(struct PyGeventLoopObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_9origflags___get__(struct PyGeventLoopObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_13origflags_int___get__(struct PyGeventLoopObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_5sigfd___get__(struct PyGeventLoopObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_13error_handler___get__(struct PyGeventLoopObject *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_4loop_13error_handler_2__set__(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_4loop_13error_handler_4__del__(struct PyGeventLoopObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_10_callbacks___get__(struct PyGeventLoopObject *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_4loop_10_callbacks_2__set__(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_4loop_10_callbacks_4__del__(struct PyGeventLoopObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_23approx_timer_resolution___get__(struct PyGeventLoopObject *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_7watcher___init__(struct PyGeventWatcherObject *__pyx_v_self, struct PyGeventLoopObject *__pyx_v_loop, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_7watcher_3ref___get__(struct PyGeventWatcherObject *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_7watcher_3ref_2__set__(struct PyGeventWatcherObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_7watcher_8callback___get__(struct PyGeventWatcherObject *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_7watcher_8callback_2__set__(struct PyGeventWatcherObject *__pyx_v_self, PyObject *__pyx_v_callback); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_7watcher_8priority___get__(struct PyGeventWatcherObject *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_7watcher_8priority_2__set__(struct PyGeventWatcherObject *__pyx_v_self, int __pyx_v_priority); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_7watcher_6active___get__(struct PyGeventWatcherObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_7watcher_7pending___get__(struct PyGeventWatcherObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_7watcher_2start(struct PyGeventWatcherObject *__pyx_v_self, PyObject *__pyx_v_callback, PyObject *__pyx_v_args); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_7watcher_4stop(struct PyGeventWatcherObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_7watcher_6feed(struct PyGeventWatcherObject *__pyx_v_self, int __pyx_v_revents, PyObject *__pyx_v_callback, PyObject *__pyx_v_args); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_7watcher_8__repr__(struct PyGeventWatcherObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_7watcher_10_format(CYTHON_UNUSED struct PyGeventWatcherObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_7watcher_12close(struct PyGeventWatcherObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_7watcher_14__enter__(struct PyGeventWatcherObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_7watcher_16__exit__(struct PyGeventWatcherObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_t, CYTHON_UNUSED PyObject *__pyx_v_v, CYTHON_UNUSED PyObject *__pyx_v_tb); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_7watcher_4loop___get__(struct PyGeventWatcherObject *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_7watcher_4loop_2__set__(struct PyGeventWatcherObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_7watcher_4loop_4__del__(struct PyGeventWatcherObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_7watcher_4args___get__(struct PyGeventWatcherObject *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_7watcher_4args_2__set__(struct PyGeventWatcherObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_7watcher_4args_4__del__(struct PyGeventWatcherObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_7watcher_6_flags___get__(struct PyGeventWatcherObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_2io_start(struct PyGeventIOObject *__pyx_v_self, PyObject *__pyx_v_callback, PyObject *__pyx_v_pass_events, PyObject *__pyx_v_args); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_2io_2__init__(struct PyGeventIOObject *__pyx_v_self, struct PyGeventLoopObject *__pyx_v_loop, CYTHON_UNUSED vfd_socket_t __pyx_v_fd, CYTHON_UNUSED int __pyx_v_events, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_2io_4__cinit__(struct PyGeventIOObject *__pyx_v_self, CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_loop, vfd_socket_t __pyx_v_fd, int __pyx_v_events, CYTHON_UNUSED PyObject *__pyx_v_ref, CYTHON_UNUSED PyObject *__pyx_v_priority); /* proto */ +static void __pyx_pf_6gevent_5libev_8corecext_2io_6__dealloc__(struct PyGeventIOObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_2io_2fd___get__(struct PyGeventIOObject *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_2io_2fd_2__set__(struct PyGeventIOObject *__pyx_v_self, long __pyx_v_fd); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_2io_6events___get__(struct PyGeventIOObject *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_2io_6events_2__set__(struct PyGeventIOObject *__pyx_v_self, int __pyx_v_events); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_2io_10events_str___get__(struct PyGeventIOObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_2io_8_format(struct PyGeventIOObject *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_5timer___cinit__(struct PyGeventTimerObject *__pyx_v_self, CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_loop, double __pyx_v_after, double __pyx_v_repeat, CYTHON_UNUSED PyObject *__pyx_v_ref, CYTHON_UNUSED PyObject *__pyx_v_priority); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_5timer_2__init__(struct PyGeventTimerObject *__pyx_v_self, struct PyGeventLoopObject *__pyx_v_loop, CYTHON_UNUSED double __pyx_v_after, CYTHON_UNUSED double __pyx_v_repeat, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_5timer_4start(struct PyGeventTimerObject *__pyx_v_self, PyObject *__pyx_v_callback, PyObject *__pyx_v_update, PyObject *__pyx_v_args); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_5timer_2at___get__(struct PyGeventTimerObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_5timer_6again(struct PyGeventTimerObject *__pyx_v_self, PyObject *__pyx_v_callback, PyObject *__pyx_v_update, PyObject *__pyx_v_args); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_6signal___cinit__(struct PyGeventSignalObject *__pyx_v_self, CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_loop, int __pyx_v_signalnum, CYTHON_UNUSED PyObject *__pyx_v_ref, CYTHON_UNUSED PyObject *__pyx_v_priority); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_6signal_2__init__(struct PyGeventSignalObject *__pyx_v_self, struct PyGeventLoopObject *__pyx_v_loop, CYTHON_UNUSED int __pyx_v_signalnum, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_4idle___cinit__(struct PyGeventIdleObject *__pyx_v_self, CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_loop, CYTHON_UNUSED PyObject *__pyx_v_ref, CYTHON_UNUSED PyObject *__pyx_v_priority); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_7prepare___cinit__(struct PyGeventPrepareObject *__pyx_v_self, CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_loop, CYTHON_UNUSED PyObject *__pyx_v_ref, CYTHON_UNUSED PyObject *__pyx_v_priority); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_5check___cinit__(struct PyGeventCheckObject *__pyx_v_self, CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_loop, CYTHON_UNUSED PyObject *__pyx_v_ref, CYTHON_UNUSED PyObject *__pyx_v_priority); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_4fork___cinit__(struct PyGeventForkObject *__pyx_v_self, CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_loop, CYTHON_UNUSED PyObject *__pyx_v_ref, CYTHON_UNUSED PyObject *__pyx_v_priority); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_6async__7pending___get__(struct PyGeventAsyncObject *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_6async____cinit__(struct PyGeventAsyncObject *__pyx_v_self, CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_loop, CYTHON_UNUSED PyObject *__pyx_v_ref, CYTHON_UNUSED PyObject *__pyx_v_priority); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_6async__2send(struct PyGeventAsyncObject *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_5child___cinit__(struct PyGeventChildObject *__pyx_v_self, struct PyGeventLoopObject *__pyx_v_loop, int __pyx_v_pid, int __pyx_v_trace, CYTHON_UNUSED PyObject *__pyx_v_ref); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_5child_2__init__(struct PyGeventChildObject *__pyx_v_self, struct PyGeventLoopObject *__pyx_v_loop, CYTHON_UNUSED int __pyx_v_pid, CYTHON_UNUSED int __pyx_v_trace, PyObject *__pyx_v_ref); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_5child_4_format(struct PyGeventChildObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_5child_3pid___get__(struct PyGeventChildObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_5child_4rpid___get__(struct PyGeventChildObject *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_5child_4rpid_2__set__(struct PyGeventChildObject *__pyx_v_self, int __pyx_v_value); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_5child_7rstatus___get__(struct PyGeventChildObject *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_5child_7rstatus_2__set__(struct PyGeventChildObject *__pyx_v_self, int __pyx_v_value); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_4stat___cinit__(struct PyGeventStatObject *__pyx_v_self, CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_loop, PyObject *__pyx_v_path, float __pyx_v_interval, CYTHON_UNUSED PyObject *__pyx_v_ref, CYTHON_UNUSED PyObject *__pyx_v_priority); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_4stat_2__init__(struct PyGeventStatObject *__pyx_v_self, struct PyGeventLoopObject *__pyx_v_loop, CYTHON_UNUSED PyObject *__pyx_v_path, CYTHON_UNUSED float __pyx_v_interval, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4stat_4attr___get__(struct PyGeventStatObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4stat_4prev___get__(struct PyGeventStatObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4stat_8interval___get__(struct PyGeventStatObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4stat_4path___get__(struct PyGeventStatObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4stat_6_paths___get__(struct PyGeventStatObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_20set_syserr_cb(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_callback); /* proto */ +static PyObject *__pyx_tp_new_6gevent_5libev_8corecext__EVENTSType(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6gevent_5libev_8corecext_callback(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6gevent_5libev_8corecext_CallbackFIFO(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6gevent_5libev_8corecext_loop(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6gevent_5libev_8corecext_watcher(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6gevent_5libev_8corecext_io(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6gevent_5libev_8corecext_timer(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6gevent_5libev_8corecext_signal(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6gevent_5libev_8corecext_idle(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6gevent_5libev_8corecext_prepare(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6gevent_5libev_8corecext_check(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6gevent_5libev_8corecext_fork(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6gevent_5libev_8corecext_async_(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6gevent_5libev_8corecext_child(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6gevent_5libev_8corecext_stat(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6gevent_5libev_8corecext___pyx_scope_struct__genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_int_0; +static PyObject *__pyx_int_3; +static int __pyx_k__9; +static PyObject *__pyx_tuple__4; +static PyObject *__pyx_tuple__10; +static PyObject *__pyx_tuple__11; +static PyObject *__pyx_tuple__12; +static PyObject *__pyx_tuple__13; +static PyObject *__pyx_tuple__14; +static PyObject *__pyx_tuple__15; +static PyObject *__pyx_tuple__16; +static PyObject *__pyx_tuple__17; +static PyObject *__pyx_tuple__18; +static PyObject *__pyx_tuple__19; +static PyObject *__pyx_tuple__20; +static PyObject *__pyx_tuple__21; +static PyObject *__pyx_codeobj__22; +static PyObject *__pyx_codeobj__23; +static PyObject *__pyx_codeobj__24; +static PyObject *__pyx_codeobj__25; +static PyObject *__pyx_codeobj__26; +static PyObject *__pyx_codeobj__27; +/* Late includes */ +static PyObject *__pyx_gb_6gevent_5libev_8corecext_24generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ + + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_22genexpr(CYTHON_UNUSED PyObject *__pyx_self) { + struct __pyx_obj_6gevent_5libev_8corecext___pyx_scope_struct__genexpr *__pyx_cur_scope; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("genexpr", 0); + __pyx_cur_scope = (struct __pyx_obj_6gevent_5libev_8corecext___pyx_scope_struct__genexpr *)__pyx_tp_new_6gevent_5libev_8corecext___pyx_scope_struct__genexpr(__pyx_ptype_6gevent_5libev_8corecext___pyx_scope_struct__genexpr, __pyx_empty_tuple, NULL); + if (unlikely(!__pyx_cur_scope)) { + __pyx_cur_scope = ((struct __pyx_obj_6gevent_5libev_8corecext___pyx_scope_struct__genexpr *)Py_None); + __Pyx_INCREF(Py_None); + __PYX_ERR(0, 149, __pyx_L1_error) + } else { + __Pyx_GOTREF(__pyx_cur_scope); + } + { + __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_6gevent_5libev_8corecext_24generator, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_genexpr, __pyx_n_s_gevent_libev_corecext); if (unlikely(!gen)) __PYX_ERR(0, 149, __pyx_L1_error) + __Pyx_DECREF(__pyx_cur_scope); + __Pyx_RefNannyFinishContext(); + return (PyObject *) gen; + } + + /* function exit code */ + __pyx_L1_error:; + __Pyx_AddTraceback("gevent.libev.corecext.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_DECREF(((PyObject *)__pyx_cur_scope)); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_gb_6gevent_5libev_8corecext_24generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ +{ + struct __pyx_obj_6gevent_5libev_8corecext___pyx_scope_struct__genexpr *__pyx_cur_scope = ((struct __pyx_obj_6gevent_5libev_8corecext___pyx_scope_struct__genexpr *)__pyx_generator->closure); + PyObject *__pyx_r = NULL; + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + PyObject *(*__pyx_t_4)(PyObject *); + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *(*__pyx_t_8)(PyObject *); + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("genexpr", 0); + switch (__pyx_generator->resume_label) { + case 0: goto __pyx_L3_first_run; + default: /* CPython raises the right error here */ + __Pyx_RefNannyFinishContext(); + return NULL; + } + __pyx_L3_first_run:; + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 149, __pyx_L1_error) + __pyx_r = PyDict_New(); if (unlikely(!__pyx_r)) __PYX_ERR(0, 149, __pyx_L1_error) + __Pyx_GOTREF(__pyx_r); + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 149, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { + __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; + __pyx_t_4 = NULL; + } else { + __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 149, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 149, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + for (;;) { + if (likely(!__pyx_t_4)) { + if (likely(PyList_CheckExact(__pyx_t_2))) { + if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 149, __pyx_L1_error) + #else + __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 149, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + #endif + } else { + if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 149, __pyx_L1_error) + #else + __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 149, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + #endif + } + } else { + __pyx_t_1 = __pyx_t_4(__pyx_t_2); + if (unlikely(!__pyx_t_1)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(0, 149, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_1); + } + if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { + PyObject* sequence = __pyx_t_1; + Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + __PYX_ERR(0, 149, __pyx_L1_error) + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_5 = PyList_GET_ITEM(sequence, 0); + __pyx_t_6 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(__pyx_t_6); + #else + __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 149, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 149, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_7 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 149, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; + index = 0; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L6_unpacking_failed; + __Pyx_GOTREF(__pyx_t_5); + index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L6_unpacking_failed; + __Pyx_GOTREF(__pyx_t_6); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(0, 149, __pyx_L1_error) + __pyx_t_8 = NULL; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + goto __pyx_L7_unpacking_done; + __pyx_L6_unpacking_failed:; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_8 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + __PYX_ERR(0, 149, __pyx_L1_error) + __pyx_L7_unpacking_done:; + } + __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_flag); + __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_flag, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_string); + __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_string, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __pyx_t_6 = 0; + if (unlikely(PyDict_SetItem(__pyx_r, (PyObject*)__pyx_cur_scope->__pyx_v_string, (PyObject*)__pyx_cur_scope->__pyx_v_flag))) __PYX_ERR(0, 149, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_r); __pyx_r = 0; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + #if !CYTHON_USE_EXC_INFO_STACK + __Pyx_Coroutine_ResetAndClearException(__pyx_generator); + #endif + __pyx_generator->resume_label = -1; + __Pyx_Coroutine_clear((PyObject*)__pyx_generator); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} +PyObject *GEVENT_CORE_EVENTS = 0; +PyObject *_empty_tuple = 0; + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_11_EVENTSType_1__repr__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_11_EVENTSType_1__repr__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_11_EVENTSType___repr__(((struct __pyx_obj_6gevent_5libev_8corecext__EVENTSType *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_11_EVENTSType___repr__(CYTHON_UNUSED struct __pyx_obj_6gevent_5libev_8corecext__EVENTSType *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__repr__", 0); + + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_kp_s_gevent_core_EVENTS); + __pyx_r = __pyx_kp_s_gevent_core_EVENTS; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_1get_version(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyMethodDef __pyx_mdef_6gevent_5libev_8corecext_1get_version = {"get_version", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_1get_version, METH_NOARGS, 0}; +static PyObject *__pyx_pw_6gevent_5libev_8corecext_1get_version(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get_version (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_get_version(__pyx_self); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_get_version(CYTHON_UNUSED PyObject *__pyx_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("get_version", 0); + + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_int(ev_version_major()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 129, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyInt_From_int(ev_version_minor()); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 129, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 129, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); + __pyx_t_1 = 0; + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_libev_d_02d, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 129, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("gevent.libev.corecext.get_version", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_3get_header_version(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyMethodDef __pyx_mdef_6gevent_5libev_8corecext_3get_header_version = {"get_header_version", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_3get_header_version, METH_NOARGS, 0}; +static PyObject *__pyx_pw_6gevent_5libev_8corecext_3get_header_version(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get_header_version (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_2get_header_version(__pyx_self); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_2get_header_version(CYTHON_UNUSED PyObject *__pyx_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("get_header_version", 0); + + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_int(EV_VERSION_MAJOR); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 133, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyInt_From_int(EV_VERSION_MINOR); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 133, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 133, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); + __pyx_t_1 = 0; + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_libev_d_02d, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 133, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("gevent.libev.corecext.get_header_version", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +static PyObject *__pyx_pw_6gevent_5libev_8corecext_5_flags_to_list(PyObject *__pyx_self, PyObject *__pyx_arg_flags); /*proto*/ +static PyObject *__pyx_f_6gevent_5libev_8corecext__flags_to_list(unsigned int __pyx_v_flags, CYTHON_UNUSED int __pyx_skip_dispatch) { + PyObject *__pyx_v_result = 0; + PyObject *__pyx_v_code = NULL; + PyObject *__pyx_v_value = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + PyObject *(*__pyx_t_4)(PyObject *); + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *(*__pyx_t_8)(PyObject *); + int __pyx_t_9; + int __pyx_t_10; + unsigned int __pyx_t_11; + __Pyx_RefNannySetupContext("_flags_to_list", 0); + + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 171, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_result = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 172, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { + __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; + __pyx_t_4 = NULL; + } else { + __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 172, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 172, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + for (;;) { + if (likely(!__pyx_t_4)) { + if (likely(PyList_CheckExact(__pyx_t_2))) { + if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 172, __pyx_L1_error) + #else + __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 172, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + #endif + } else { + if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 172, __pyx_L1_error) + #else + __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 172, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + #endif + } + } else { + __pyx_t_1 = __pyx_t_4(__pyx_t_2); + if (unlikely(!__pyx_t_1)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(0, 172, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_1); + } + if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { + PyObject* sequence = __pyx_t_1; + Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + __PYX_ERR(0, 172, __pyx_L1_error) + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_5 = PyList_GET_ITEM(sequence, 0); + __pyx_t_6 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(__pyx_t_6); + #else + __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 172, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 172, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_7 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 172, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; + index = 0; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L5_unpacking_failed; + __Pyx_GOTREF(__pyx_t_5); + index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed; + __Pyx_GOTREF(__pyx_t_6); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(0, 172, __pyx_L1_error) + __pyx_t_8 = NULL; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + goto __pyx_L6_unpacking_done; + __pyx_L5_unpacking_failed:; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_8 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + __PYX_ERR(0, 172, __pyx_L1_error) + __pyx_L6_unpacking_done:; + } + __Pyx_XDECREF_SET(__pyx_v_code, __pyx_t_5); + __pyx_t_5 = 0; + __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_6); + __pyx_t_6 = 0; + + __pyx_t_1 = __Pyx_PyInt_From_unsigned_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 173, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = PyNumber_And(__pyx_t_1, __pyx_v_code); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 173, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 173, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (__pyx_t_9) { + + __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_value); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(0, 174, __pyx_L1_error) + + } + + __pyx_t_6 = __Pyx_PyInt_From_unsigned_int(__pyx_v_flags); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 175, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_1 = PyNumber_Invert(__pyx_v_code); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 175, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = PyNumber_InPlaceAnd(__pyx_t_6, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 175, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_11 = __Pyx_PyInt_As_unsigned_int(__pyx_t_5); if (unlikely((__pyx_t_11 == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 175, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_flags = __pyx_t_11; + + __pyx_t_9 = ((!(__pyx_v_flags != 0)) != 0); + if (__pyx_t_9) { + + goto __pyx_L4_break; + + } + + } + __pyx_L4_break:; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + __pyx_t_9 = (__pyx_v_flags != 0); + if (__pyx_t_9) { + + __pyx_t_2 = __Pyx_PyInt_From_unsigned_int(__pyx_v_flags); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 179, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_2); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(0, 179, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + } + + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("gevent.libev.corecext._flags_to_list", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XDECREF(__pyx_v_code); + __Pyx_XDECREF(__pyx_v_value); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_5_flags_to_list(PyObject *__pyx_self, PyObject *__pyx_arg_flags); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_5_flags_to_list(PyObject *__pyx_self, PyObject *__pyx_arg_flags) { + unsigned int __pyx_v_flags; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_flags_to_list (wrapper)", 0); + assert(__pyx_arg_flags); { + __pyx_v_flags = __Pyx_PyInt_As_unsigned_int(__pyx_arg_flags); if (unlikely((__pyx_v_flags == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 170, __pyx_L3_error) + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.libev.corecext._flags_to_list", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4_flags_to_list(__pyx_self, ((unsigned int)__pyx_v_flags)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4_flags_to_list(CYTHON_UNUSED PyObject *__pyx_self, unsigned int __pyx_v_flags) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("_flags_to_list", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6gevent_5libev_8corecext__flags_to_list(__pyx_v_flags, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 170, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.libev.corecext._flags_to_list", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +static PyObject *__pyx_pw_6gevent_5libev_8corecext_7_flags_to_int(PyObject *__pyx_self, PyObject *__pyx_v_flags); /*proto*/ +static unsigned int __pyx_f_6gevent_5libev_8corecext__flags_to_int(PyObject *__pyx_v_flags, CYTHON_UNUSED int __pyx_skip_dispatch) { + unsigned int __pyx_v_result; + PyObject *__pyx_v_value = NULL; + PyObject *__pyx_v_ex = NULL; + unsigned int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + unsigned int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + Py_ssize_t __pyx_t_10; + PyObject *(*__pyx_t_11)(PyObject *); + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + int __pyx_t_14; + PyObject *__pyx_t_15 = NULL; + PyObject *__pyx_t_16 = NULL; + int __pyx_t_17; + int __pyx_t_18; + char const *__pyx_t_19; + PyObject *__pyx_t_20 = NULL; + PyObject *__pyx_t_21 = NULL; + PyObject *__pyx_t_22 = NULL; + PyObject *__pyx_t_23 = NULL; + PyObject *__pyx_t_24 = NULL; + PyObject *__pyx_t_25 = NULL; + __Pyx_RefNannySetupContext("_flags_to_int", 0); + __Pyx_INCREF(__pyx_v_flags); + + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_flags); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 191, __pyx_L1_error) + __pyx_t_2 = ((!__pyx_t_1) != 0); + if (__pyx_t_2) { + + __pyx_r = 0; + goto __pyx_L0; + + } + + __pyx_t_3 = __pyx_v_6gevent_5libev_8corecext_integer_types; + __Pyx_INCREF(__pyx_t_3); + __pyx_t_2 = PyObject_IsInstance(__pyx_v_flags, __pyx_t_3); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 193, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_1 = (__pyx_t_2 != 0); + if (__pyx_t_1) { + + __pyx_t_4 = __Pyx_PyInt_As_unsigned_int(__pyx_v_flags); if (unlikely((__pyx_t_4 == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 194, __pyx_L1_error) + __pyx_r = __pyx_t_4; + goto __pyx_L0; + + } + + __pyx_v_result = 0; + + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7); + __Pyx_XGOTREF(__pyx_t_5); + __Pyx_XGOTREF(__pyx_t_6); + __Pyx_XGOTREF(__pyx_t_7); + /*try:*/ { + + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_basestring); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 197, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = PyObject_IsInstance(__pyx_v_flags, __pyx_t_3); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 197, __pyx_L5_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_flags, __pyx_n_s_split); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 198, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) { + __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8); + if (likely(__pyx_t_9)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); + __Pyx_INCREF(__pyx_t_9); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_8, function); + } + } + __pyx_t_3 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_9, __pyx_kp_s_) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_kp_s_); + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 198, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF_SET(__pyx_v_flags, __pyx_t_3); + __pyx_t_3 = 0; + + } + + if (likely(PyList_CheckExact(__pyx_v_flags)) || PyTuple_CheckExact(__pyx_v_flags)) { + __pyx_t_3 = __pyx_v_flags; __Pyx_INCREF(__pyx_t_3); __pyx_t_10 = 0; + __pyx_t_11 = NULL; + } else { + __pyx_t_10 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_flags); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 199, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_11 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 199, __pyx_L5_error) + } + for (;;) { + if (likely(!__pyx_t_11)) { + if (likely(PyList_CheckExact(__pyx_t_3))) { + if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_8 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_10); __Pyx_INCREF(__pyx_t_8); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 199, __pyx_L5_error) + #else + __pyx_t_8 = PySequence_ITEM(__pyx_t_3, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 199, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_8); + #endif + } else { + if (__pyx_t_10 >= PyTuple_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_10); __Pyx_INCREF(__pyx_t_8); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 199, __pyx_L5_error) + #else + __pyx_t_8 = PySequence_ITEM(__pyx_t_3, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 199, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_8); + #endif + } + } else { + __pyx_t_8 = __pyx_t_11(__pyx_t_3); + if (unlikely(!__pyx_t_8)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(0, 199, __pyx_L5_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_8); + } + __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_8); + __pyx_t_8 = 0; + + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_value, __pyx_n_s_strip); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 200, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_13 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) { + __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_12); + if (likely(__pyx_t_13)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12); + __Pyx_INCREF(__pyx_t_13); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_12, function); + } + } + __pyx_t_9 = (__pyx_t_13) ? __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_13) : __Pyx_PyObject_CallNoArg(__pyx_t_12); + __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 200, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_lower); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 200, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) { + __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_12); + if (likely(__pyx_t_9)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12); + __Pyx_INCREF(__pyx_t_9); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_12, function); + } + } + __pyx_t_8 = (__pyx_t_9) ? __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_9) : __Pyx_PyObject_CallNoArg(__pyx_t_12); + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 200, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_8); + __pyx_t_8 = 0; + + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_value); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 201, __pyx_L5_error) + if (__pyx_t_2) { + + __pyx_t_8 = __Pyx_PyInt_From_unsigned_int(__pyx_v_result); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 202, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_flags_str2int); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 202, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_9 = __Pyx_PyObject_GetItem(__pyx_t_12, __pyx_v_value); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 202, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_12 = PyNumber_InPlaceOr(__pyx_t_8, __pyx_t_9); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 202, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_4 = __Pyx_PyInt_As_unsigned_int(__pyx_t_12); if (unlikely((__pyx_t_4 == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 202, __pyx_L5_error) + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_v_result = __pyx_t_4; + + } + + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + } + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + goto __pyx_L10_try_end; + __pyx_L5_error:; + __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + + __pyx_t_14 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError); + if (__pyx_t_14) { + __Pyx_AddTraceback("gevent.libev.corecext._flags_to_int", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_12, &__pyx_t_9) < 0) __PYX_ERR(0, 203, __pyx_L7_except_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GOTREF(__pyx_t_12); + __Pyx_GOTREF(__pyx_t_9); + __Pyx_INCREF(__pyx_t_12); + __pyx_v_ex = __pyx_t_12; + /*try:*/ { + + __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_n_s_flags_str2int); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 204, __pyx_L20_error) + __Pyx_GOTREF(__pyx_t_15); + __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_n_s_keys); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 204, __pyx_L20_error) + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + __pyx_t_15 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_16))) { + __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_16); + if (likely(__pyx_t_15)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_16); + __Pyx_INCREF(__pyx_t_15); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_16, function); + } + } + __pyx_t_13 = (__pyx_t_15) ? __Pyx_PyObject_CallOneArg(__pyx_t_16, __pyx_t_15) : __Pyx_PyObject_CallNoArg(__pyx_t_16); + __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; + if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 204, __pyx_L20_error) + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_t_16 = PySequence_List(__pyx_t_13); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 204, __pyx_L20_error) + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_8 = ((PyObject*)__pyx_t_16); + __pyx_t_16 = 0; + __pyx_t_17 = PyList_Sort(__pyx_t_8); if (unlikely(__pyx_t_17 == ((int)-1))) __PYX_ERR(0, 204, __pyx_L20_error) + __pyx_t_16 = __Pyx_PyString_Join(__pyx_kp_s__2, __pyx_t_8); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 204, __pyx_L20_error) + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 204, __pyx_L20_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(__pyx_v_ex); + __Pyx_GIVEREF(__pyx_v_ex); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_ex); + __Pyx_GIVEREF(__pyx_t_16); + PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_16); + __pyx_t_16 = 0; + __pyx_t_16 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_backend_or_flag_s_Possib, __pyx_t_8); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 204, __pyx_L20_error) + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_16); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 204, __pyx_L20_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __Pyx_Raise(__pyx_t_8, 0, 0, 0); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __PYX_ERR(0, 204, __pyx_L20_error) + } + + /*finally:*/ { + __pyx_L20_error:; + /*exception exit:*/{ + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_t_23 = 0; __pyx_t_24 = 0; __pyx_t_25 = 0; + __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; + __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_23, &__pyx_t_24, &__pyx_t_25); + if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22) < 0)) __Pyx_ErrFetch(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22); + __Pyx_XGOTREF(__pyx_t_20); + __Pyx_XGOTREF(__pyx_t_21); + __Pyx_XGOTREF(__pyx_t_22); + __Pyx_XGOTREF(__pyx_t_23); + __Pyx_XGOTREF(__pyx_t_24); + __Pyx_XGOTREF(__pyx_t_25); + __pyx_t_14 = __pyx_lineno; __pyx_t_18 = __pyx_clineno; __pyx_t_19 = __pyx_filename; + { + __Pyx_DECREF(__pyx_v_ex); + __pyx_v_ex = NULL; + } + if (PY_MAJOR_VERSION >= 3) { + __Pyx_XGIVEREF(__pyx_t_23); + __Pyx_XGIVEREF(__pyx_t_24); + __Pyx_XGIVEREF(__pyx_t_25); + __Pyx_ExceptionReset(__pyx_t_23, __pyx_t_24, __pyx_t_25); + } + __Pyx_XGIVEREF(__pyx_t_20); + __Pyx_XGIVEREF(__pyx_t_21); + __Pyx_XGIVEREF(__pyx_t_22); + __Pyx_ErrRestore(__pyx_t_20, __pyx_t_21, __pyx_t_22); + __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_t_23 = 0; __pyx_t_24 = 0; __pyx_t_25 = 0; + __pyx_lineno = __pyx_t_14; __pyx_clineno = __pyx_t_18; __pyx_filename = __pyx_t_19; + goto __pyx_L7_except_error; + } + } + } + goto __pyx_L7_except_error; + __pyx_L7_except_error:; + + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7); + goto __pyx_L1_error; + __pyx_L10_try_end:; + } + + __pyx_r = __pyx_v_result; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_XDECREF(__pyx_t_13); + __Pyx_XDECREF(__pyx_t_15); + __Pyx_XDECREF(__pyx_t_16); + __Pyx_AddTraceback("gevent.libev.corecext._flags_to_int", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_value); + __Pyx_XDECREF(__pyx_v_ex); + __Pyx_XDECREF(__pyx_v_flags); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_7_flags_to_int(PyObject *__pyx_self, PyObject *__pyx_v_flags); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_7_flags_to_int(PyObject *__pyx_self, PyObject *__pyx_v_flags) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_flags_to_int (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_6_flags_to_int(__pyx_self, ((PyObject *)__pyx_v_flags)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_6_flags_to_int(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_flags) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + unsigned int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("_flags_to_int", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6gevent_5libev_8corecext__flags_to_int(__pyx_v_flags, 0); if (unlikely(__pyx_t_1 == ((unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 189, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_unsigned_int(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 189, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent.libev.corecext._flags_to_int", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +static PyObject *__pyx_f_6gevent_5libev_8corecext__str_hex(PyObject *__pyx_v_flag) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + __Pyx_RefNannySetupContext("_str_hex", 0); + + __pyx_t_1 = __pyx_v_6gevent_5libev_8corecext_integer_types; + __Pyx_INCREF(__pyx_t_1); + __pyx_t_2 = PyObject_IsInstance(__pyx_v_flag, __pyx_t_1); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 209, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_hex, __pyx_v_flag); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 210, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(PyString_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 210, __pyx_L1_error) + __pyx_r = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + goto __pyx_L0; + + } + + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyString_Type)), __pyx_v_flag); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 211, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(PyString_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 211, __pyx_L1_error) + __pyx_r = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.libev.corecext._str_hex", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +static PyObject *__pyx_pw_6gevent_5libev_8corecext_9_check_flags(PyObject *__pyx_self, PyObject *__pyx_arg_flags); /*proto*/ +static PyObject *__pyx_f_6gevent_5libev_8corecext__check_flags(unsigned int __pyx_v_flags, CYTHON_UNUSED int __pyx_skip_dispatch) { + PyObject *__pyx_v_as_list = 0; + PyObject *__pyx_8genexpr1__pyx_v_x = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + Py_ssize_t __pyx_t_5; + PyObject *(*__pyx_t_6)(PyObject *); + __Pyx_RefNannySetupContext("_check_flags", 0); + + __pyx_v_flags = (__pyx_v_flags & EVBACKEND_MASK); + + __pyx_t_1 = ((!(__pyx_v_flags != 0)) != 0); + if (__pyx_t_1) { + + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + + } + + __pyx_t_1 = ((!((__pyx_v_flags & EVBACKEND_ALL) != 0)) != 0); + if (unlikely(__pyx_t_1)) { + + __pyx_t_2 = __Pyx_PyInt_From_unsigned_int(__pyx_v_flags); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 220, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_value_for_backend_0x_x, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 220, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 220, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 220, __pyx_L1_error) + + } + + __pyx_t_1 = ((!((__pyx_v_flags & ev_supported_backends()) != 0)) != 0); + if (unlikely(__pyx_t_1)) { + + { /* enter inner scope */ + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 222, __pyx_L8_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __pyx_f_6gevent_5libev_8corecext__flags_to_list(__pyx_v_flags, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 222, __pyx_L8_error) + __Pyx_GOTREF(__pyx_t_3); + if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) { + __pyx_t_4 = __pyx_t_3; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0; + __pyx_t_6 = NULL; + } else { + __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 222, __pyx_L8_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 222, __pyx_L8_error) + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + for (;;) { + if (likely(!__pyx_t_6)) { + if (likely(PyList_CheckExact(__pyx_t_4))) { + if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_3 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 222, __pyx_L8_error) + #else + __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 222, __pyx_L8_error) + __Pyx_GOTREF(__pyx_t_3); + #endif + } else { + if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 222, __pyx_L8_error) + #else + __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 222, __pyx_L8_error) + __Pyx_GOTREF(__pyx_t_3); + #endif + } + } else { + __pyx_t_3 = __pyx_t_6(__pyx_t_4); + if (unlikely(!__pyx_t_3)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(0, 222, __pyx_L8_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_3); + } + __Pyx_XDECREF_SET(__pyx_8genexpr1__pyx_v_x, __pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __pyx_f_6gevent_5libev_8corecext__str_hex(__pyx_8genexpr1__pyx_v_x); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 222, __pyx_L8_error) + __Pyx_GOTREF(__pyx_t_3); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 222, __pyx_L8_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_x); __pyx_8genexpr1__pyx_v_x = 0; + goto __pyx_L11_exit_scope; + __pyx_L8_error:; + __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_x); __pyx_8genexpr1__pyx_v_x = 0; + goto __pyx_L1_error; + __pyx_L11_exit_scope:; + } /* exit inner scope */ + __pyx_v_as_list = ((PyObject*)__pyx_t_2); + __pyx_t_2 = 0; + + __pyx_t_2 = __Pyx_PyString_Join(__pyx_kp_s__3, __pyx_v_as_list); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 223, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Unsupported_backend_s, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 223, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 223, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 223, __pyx_L1_error) + + } + + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("gevent.libev.corecext._check_flags", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_as_list); + __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_x); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_9_check_flags(PyObject *__pyx_self, PyObject *__pyx_arg_flags); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_9_check_flags(PyObject *__pyx_self, PyObject *__pyx_arg_flags) { + unsigned int __pyx_v_flags; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_check_flags (wrapper)", 0); + assert(__pyx_arg_flags); { + __pyx_v_flags = __Pyx_PyInt_As_unsigned_int(__pyx_arg_flags); if (unlikely((__pyx_v_flags == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 214, __pyx_L3_error) + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.libev.corecext._check_flags", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_8_check_flags(__pyx_self, ((unsigned int)__pyx_v_flags)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_8_check_flags(CYTHON_UNUSED PyObject *__pyx_self, unsigned int __pyx_v_flags) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("_check_flags", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6gevent_5libev_8corecext__check_flags(__pyx_v_flags, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 214, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.libev.corecext._check_flags", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +static PyObject *__pyx_pw_6gevent_5libev_8corecext_11_events_to_str(PyObject *__pyx_self, PyObject *__pyx_arg_events); /*proto*/ +static PyObject *__pyx_f_6gevent_5libev_8corecext__events_to_str(int __pyx_v_events, CYTHON_UNUSED int __pyx_skip_dispatch) { + PyObject *__pyx_v_result = 0; + int __pyx_v_c_flag; + PyObject *__pyx_v_flag = NULL; + PyObject *__pyx_v_string = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + PyObject *(*__pyx_t_4)(PyObject *); + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *(*__pyx_t_8)(PyObject *); + int __pyx_t_9; + int __pyx_t_10; + int __pyx_t_11; + __Pyx_RefNannySetupContext("_events_to_str", 0); + + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 227, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_result = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_events); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 229, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { + __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; + __pyx_t_4 = NULL; + } else { + __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 229, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 229, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + for (;;) { + if (likely(!__pyx_t_4)) { + if (likely(PyList_CheckExact(__pyx_t_2))) { + if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 229, __pyx_L1_error) + #else + __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 229, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + #endif + } else { + if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 229, __pyx_L1_error) + #else + __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 229, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + #endif + } + } else { + __pyx_t_1 = __pyx_t_4(__pyx_t_2); + if (unlikely(!__pyx_t_1)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(0, 229, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_1); + } + if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { + PyObject* sequence = __pyx_t_1; + Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + __PYX_ERR(0, 229, __pyx_L1_error) + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_5 = PyList_GET_ITEM(sequence, 0); + __pyx_t_6 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(__pyx_t_6); + #else + __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 229, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 229, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_7 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 229, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; + index = 0; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L5_unpacking_failed; + __Pyx_GOTREF(__pyx_t_5); + index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed; + __Pyx_GOTREF(__pyx_t_6); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(0, 229, __pyx_L1_error) + __pyx_t_8 = NULL; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + goto __pyx_L6_unpacking_done; + __pyx_L5_unpacking_failed:; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_8 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + __PYX_ERR(0, 229, __pyx_L1_error) + __pyx_L6_unpacking_done:; + } + __Pyx_XDECREF_SET(__pyx_v_flag, __pyx_t_5); + __pyx_t_5 = 0; + __Pyx_XDECREF_SET(__pyx_v_string, __pyx_t_6); + __pyx_t_6 = 0; + + __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_v_flag); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 230, __pyx_L1_error) + __pyx_v_c_flag = __pyx_t_9; + + __pyx_t_10 = ((__pyx_v_events & __pyx_v_c_flag) != 0); + if (__pyx_t_10) { + + __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_string); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 232, __pyx_L1_error) + + __pyx_v_events = (__pyx_v_events & (~__pyx_v_c_flag)); + + } + + __pyx_t_10 = ((!(__pyx_v_events != 0)) != 0); + if (__pyx_t_10) { + + goto __pyx_L4_break; + + } + + } + __pyx_L4_break:; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + __pyx_t_10 = (__pyx_v_events != 0); + if (__pyx_t_10) { + + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_events); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 237, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_hex, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 237, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_1); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 237, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + } + + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyString_Join(__pyx_kp_s__3, __pyx_v_result); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 238, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("gevent.libev.corecext._events_to_str", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XDECREF(__pyx_v_flag); + __Pyx_XDECREF(__pyx_v_string); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_11_events_to_str(PyObject *__pyx_self, PyObject *__pyx_arg_events); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_11_events_to_str(PyObject *__pyx_self, PyObject *__pyx_arg_events) { + int __pyx_v_events; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_events_to_str (wrapper)", 0); + assert(__pyx_arg_events); { + __pyx_v_events = __Pyx_PyInt_As_int(__pyx_arg_events); if (unlikely((__pyx_v_events == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 226, __pyx_L3_error) + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.libev.corecext._events_to_str", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_10_events_to_str(__pyx_self, ((int)__pyx_v_events)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_10_events_to_str(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_events) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("_events_to_str", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6gevent_5libev_8corecext__events_to_str(__pyx_v_events, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 226, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.libev.corecext._events_to_str", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_13supported_backends(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyMethodDef __pyx_mdef_6gevent_5libev_8corecext_13supported_backends = {"supported_backends", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_13supported_backends, METH_NOARGS, 0}; +static PyObject *__pyx_pw_6gevent_5libev_8corecext_13supported_backends(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("supported_backends (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_12supported_backends(__pyx_self); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_12supported_backends(CYTHON_UNUSED PyObject *__pyx_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("supported_backends", 0); + + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6gevent_5libev_8corecext__flags_to_list(ev_supported_backends(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 242, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.libev.corecext.supported_backends", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_15recommended_backends(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyMethodDef __pyx_mdef_6gevent_5libev_8corecext_15recommended_backends = {"recommended_backends", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_15recommended_backends, METH_NOARGS, 0}; +static PyObject *__pyx_pw_6gevent_5libev_8corecext_15recommended_backends(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("recommended_backends (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_14recommended_backends(__pyx_self); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_14recommended_backends(CYTHON_UNUSED PyObject *__pyx_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("recommended_backends", 0); + + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6gevent_5libev_8corecext__flags_to_list(ev_recommended_backends(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 246, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.libev.corecext.recommended_backends", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_17embeddable_backends(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyMethodDef __pyx_mdef_6gevent_5libev_8corecext_17embeddable_backends = {"embeddable_backends", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_17embeddable_backends, METH_NOARGS, 0}; +static PyObject *__pyx_pw_6gevent_5libev_8corecext_17embeddable_backends(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("embeddable_backends (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_16embeddable_backends(__pyx_self); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_16embeddable_backends(CYTHON_UNUSED PyObject *__pyx_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("embeddable_backends", 0); + + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6gevent_5libev_8corecext__flags_to_list(ev_embeddable_backends(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 250, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.libev.corecext.embeddable_backends", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_19time(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyMethodDef __pyx_mdef_6gevent_5libev_8corecext_19time = {"time", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_19time, METH_NOARGS, 0}; +static PyObject *__pyx_pw_6gevent_5libev_8corecext_19time(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("time (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_18time(__pyx_self); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_18time(CYTHON_UNUSED PyObject *__pyx_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("time", 0); + + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyFloat_FromDouble(ev_time()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 254, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.libev.corecext.time", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +static int __pyx_f_6gevent_5libev_8corecext__check_loop(struct PyGeventLoopObject *__pyx_v_loop) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("_check_loop", 0); + + __pyx_t_1 = ((!(__pyx_v_loop->_ptr != 0)) != 0); + if (unlikely(__pyx_t_1)) { + + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 258, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 258, __pyx_L1_error) + + } + + __pyx_r = 1; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent.libev.corecext._check_loop", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_8callback_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_8callback_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_callback = 0; + PyObject *__pyx_v_args = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_callback,&__pyx_n_s_args,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_callback)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(0, 268, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 268, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_callback = values[0]; + __pyx_v_args = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 268, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.libev.corecext.callback.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_8callback___init__(((struct PyGeventCallbackObject *)__pyx_v_self), __pyx_v_callback, __pyx_v_args); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_8callback___init__(struct PyGeventCallbackObject *__pyx_v_self, PyObject *__pyx_v_callback, PyObject *__pyx_v_args) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__init__", 0); + + __Pyx_INCREF(__pyx_v_callback); + __Pyx_GIVEREF(__pyx_v_callback); + __Pyx_GOTREF(__pyx_v_self->callback); + __Pyx_DECREF(__pyx_v_self->callback); + __pyx_v_self->callback = __pyx_v_callback; + + if (!(likely(PyTuple_CheckExact(__pyx_v_args))||((__pyx_v_args) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v_args)->tp_name), 0))) __PYX_ERR(0, 270, __pyx_L1_error) + __pyx_t_1 = __pyx_v_args; + __Pyx_INCREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_self->args); + __Pyx_DECREF(__pyx_v_self->args); + __pyx_v_self->args = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.libev.corecext.callback.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_8callback_3stop(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_8callback_3stop(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stop (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_8callback_2stop(((struct PyGeventCallbackObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_8callback_2stop(struct PyGeventCallbackObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stop", 0); + + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->callback); + __Pyx_DECREF(__pyx_v_self->callback); + __pyx_v_self->callback = Py_None; + + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->args); + __Pyx_DECREF(__pyx_v_self->args); + __pyx_v_self->args = ((PyObject*)Py_None); + + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_8callback_5__nonzero__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_8callback_5__nonzero__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__nonzero__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_8callback_4__nonzero__(((struct PyGeventCallbackObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_8callback_4__nonzero__(struct PyGeventCallbackObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("__nonzero__", 0); + + __pyx_t_1 = (__pyx_v_self->args != ((PyObject*)Py_None)); + __pyx_r = __pyx_t_1; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_8callback_7pending_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_8callback_7pending_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_8callback_7pending___get__(((struct PyGeventCallbackObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_8callback_7pending___get__(struct PyGeventCallbackObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = (__pyx_v_self->callback != Py_None); + __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 289, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent.libev.corecext.callback.pending.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_8callback_7__repr__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_8callback_7__repr__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_8callback_6__repr__(((struct PyGeventCallbackObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_8callback_6__repr__(struct PyGeventCallbackObject *__pyx_v_self) { + PyObject *__pyx_v_format = NULL; + PyObject *__pyx_v_result = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + int __pyx_t_6; + int __pyx_t_7; + int __pyx_t_8; + char const *__pyx_t_9; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + PyObject *__pyx_t_14 = NULL; + PyObject *__pyx_t_15 = NULL; + __Pyx_RefNannySetupContext("__repr__", 0); + + __pyx_t_1 = ((Py_ReprEnter(((PyObject *)__pyx_v_self)) != 0) != 0); + if (__pyx_t_1) { + + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_kp_s__5); + __pyx_r = __pyx_kp_s__5; + goto __pyx_L0; + + } + + /*try:*/ { + + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 295, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 295, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_format = __pyx_t_2; + __pyx_t_2 = 0; + + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 296, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 296, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 296, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 296, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2); + __Pyx_INCREF(__pyx_v_format); + __Pyx_GIVEREF(__pyx_v_format); + PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_format); + __pyx_t_3 = 0; + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_s_at_0x_x_s, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 296, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_result = ((PyObject*)__pyx_t_2); + __pyx_t_2 = 0; + + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_pending); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 297, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 297, __pyx_L5_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_1) { + + __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_kp_s_pending_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 298, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_2)); + __pyx_t_2 = 0; + + } + + __pyx_t_1 = (__pyx_v_self->callback != Py_None); + __pyx_t_5 = (__pyx_t_1 != 0); + if (__pyx_t_5) { + + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 300, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_self->callback); + __Pyx_GIVEREF(__pyx_v_self->callback); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_self->callback); + __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_callback_r, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 300, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 300, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_2)); + __pyx_t_2 = 0; + + } + + __pyx_t_5 = (__pyx_v_self->args != ((PyObject*)Py_None)); + __pyx_t_1 = (__pyx_t_5 != 0); + if (__pyx_t_1) { + + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 302, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_self->args); + __Pyx_GIVEREF(__pyx_v_self->args); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_self->args); + __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_args_r, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 302, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 302, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_2)); + __pyx_t_2 = 0; + + } + + __pyx_t_5 = (__pyx_v_self->callback == Py_None); + __pyx_t_6 = (__pyx_t_5 != 0); + if (__pyx_t_6) { + } else { + __pyx_t_1 = __pyx_t_6; + goto __pyx_L11_bool_binop_done; + } + __pyx_t_6 = (__pyx_v_self->args == ((PyObject*)Py_None)); + __pyx_t_5 = (__pyx_t_6 != 0); + __pyx_t_1 = __pyx_t_5; + __pyx_L11_bool_binop_done:; + if (__pyx_t_1) { + + __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_kp_s_stopped); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 304, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_2)); + __pyx_t_2 = 0; + + } + + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyNumber_Add(__pyx_v_result, __pyx_kp_s__6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 305, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L4_return; + } + + /*finally:*/ { + __pyx_L5_error:; + /*exception exit:*/{ + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15); + if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12) < 0)) __Pyx_ErrFetch(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12); + __Pyx_XGOTREF(__pyx_t_10); + __Pyx_XGOTREF(__pyx_t_11); + __Pyx_XGOTREF(__pyx_t_12); + __Pyx_XGOTREF(__pyx_t_13); + __Pyx_XGOTREF(__pyx_t_14); + __Pyx_XGOTREF(__pyx_t_15); + __pyx_t_7 = __pyx_lineno; __pyx_t_8 = __pyx_clineno; __pyx_t_9 = __pyx_filename; + { + Py_ReprLeave(((PyObject *)__pyx_v_self)); + } + if (PY_MAJOR_VERSION >= 3) { + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_XGIVEREF(__pyx_t_15); + __Pyx_ExceptionReset(__pyx_t_13, __pyx_t_14, __pyx_t_15); + } + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_XGIVEREF(__pyx_t_12); + __Pyx_ErrRestore(__pyx_t_10, __pyx_t_11, __pyx_t_12); + __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; + __pyx_lineno = __pyx_t_7; __pyx_clineno = __pyx_t_8; __pyx_filename = __pyx_t_9; + goto __pyx_L1_error; + } + __pyx_L4_return: { + __pyx_t_15 = __pyx_r; + __pyx_r = 0; + Py_ReprLeave(((PyObject *)__pyx_v_self)); + __pyx_r = __pyx_t_15; + __pyx_t_15 = 0; + goto __pyx_L0; + } + } + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("gevent.libev.corecext.callback.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_format); + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_8callback_9_format(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_8callback_9_format(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_format (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_8callback_8_format(((struct PyGeventCallbackObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_8callback_8_format(CYTHON_UNUSED struct PyGeventCallbackObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_format", 0); + + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_kp_s__7); + __pyx_r = __pyx_kp_s__7; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_8callback_8callback_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_8callback_8callback_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_8callback_8callback___get__(((struct PyGeventCallbackObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_8callback_8callback___get__(struct PyGeventCallbackObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->callback); + __pyx_r = __pyx_v_self->callback; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_8callback_8callback_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_8callback_8callback_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_8callback_8callback_2__set__(((struct PyGeventCallbackObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_8callback_8callback_2__set__(struct PyGeventCallbackObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__", 0); + __Pyx_INCREF(__pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + __Pyx_GOTREF(__pyx_v_self->callback); + __Pyx_DECREF(__pyx_v_self->callback); + __pyx_v_self->callback = __pyx_v_value; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_8callback_8callback_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_8callback_8callback_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_8callback_8callback_4__del__(((struct PyGeventCallbackObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_8callback_8callback_4__del__(struct PyGeventCallbackObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->callback); + __Pyx_DECREF(__pyx_v_self->callback); + __pyx_v_self->callback = Py_None; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_8callback_4args_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_8callback_4args_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_8callback_4args___get__(((struct PyGeventCallbackObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_8callback_4args___get__(struct PyGeventCallbackObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->args); + __pyx_r = __pyx_v_self->args; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_8callback_4args_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_8callback_4args_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_8callback_4args_2__set__(((struct PyGeventCallbackObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_8callback_4args_2__set__(struct PyGeventCallbackObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__set__", 0); + if (!(likely(PyTuple_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v_value)->tp_name), 0))) __PYX_ERR(0, 265, __pyx_L1_error) + __pyx_t_1 = __pyx_v_value; + __Pyx_INCREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_self->args); + __Pyx_DECREF(__pyx_v_self->args); + __pyx_v_self->args = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.libev.corecext.callback.args.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_8callback_4args_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_8callback_4args_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_8callback_4args_4__del__(((struct PyGeventCallbackObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_8callback_4args_4__del__(struct PyGeventCallbackObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->args); + __Pyx_DECREF(__pyx_v_self->args); + __pyx_v_self->args = ((PyObject*)Py_None); + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_12CallbackFIFO_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_12CallbackFIFO_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { + __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;} + if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1; + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_12CallbackFIFO___init__(((struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_12CallbackFIFO___init__(struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__", 0); + + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->head); + __Pyx_DECREF(((PyObject *)__pyx_v_self->head)); + __pyx_v_self->head = ((struct PyGeventCallbackObject *)Py_None); + + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->tail); + __Pyx_DECREF(((PyObject *)__pyx_v_self->tail)); + __pyx_v_self->tail = ((struct PyGeventCallbackObject *)Py_None); + + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +static CYTHON_INLINE struct PyGeventCallbackObject *__pyx_f_6gevent_5libev_8corecext_12CallbackFIFO_popleft(struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *__pyx_v_self) { + struct PyGeventCallbackObject *__pyx_v_head = 0; + struct PyGeventCallbackObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + __Pyx_RefNannySetupContext("popleft", 0); + + __pyx_t_1 = ((PyObject *)__pyx_v_self->head); + __Pyx_INCREF(__pyx_t_1); + __pyx_v_head = ((struct PyGeventCallbackObject *)__pyx_t_1); + __pyx_t_1 = 0; + + __pyx_t_1 = ((PyObject *)__pyx_v_head->next); + __Pyx_INCREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_self->head); + __Pyx_DECREF(((PyObject *)__pyx_v_self->head)); + __pyx_v_self->head = ((struct PyGeventCallbackObject *)__pyx_t_1); + __pyx_t_1 = 0; + + __pyx_t_3 = (__pyx_v_self->head == __pyx_v_self->tail); + __pyx_t_4 = (__pyx_t_3 != 0); + if (!__pyx_t_4) { + } else { + __pyx_t_2 = __pyx_t_4; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_4 = (((PyObject *)__pyx_v_self->head) == Py_None); + __pyx_t_3 = (__pyx_t_4 != 0); + __pyx_t_2 = __pyx_t_3; + __pyx_L4_bool_binop_done:; + if (__pyx_t_2) { + + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->tail); + __Pyx_DECREF(((PyObject *)__pyx_v_self->tail)); + __pyx_v_self->tail = ((struct PyGeventCallbackObject *)Py_None); + + } + + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_head->next); + __Pyx_DECREF(((PyObject *)__pyx_v_head->next)); + __pyx_v_head->next = ((struct PyGeventCallbackObject *)Py_None); + + __Pyx_XDECREF(((PyObject *)__pyx_r)); + __Pyx_INCREF(((PyObject *)__pyx_v_head)); + __pyx_r = __pyx_v_head; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_head); + __Pyx_XGIVEREF((PyObject *)__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +static CYTHON_INLINE PyObject *__pyx_f_6gevent_5libev_8corecext_12CallbackFIFO_append(struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *__pyx_v_self, struct PyGeventCallbackObject *__pyx_v_new_tail) { + struct PyGeventCallbackObject *__pyx_v_old_tail = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("append", 0); + + #ifndef CYTHON_WITHOUT_ASSERTIONS + if (unlikely(!Py_OptimizeFlag)) { + __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_new_tail->next)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 334, __pyx_L1_error) + if (unlikely(!((!__pyx_t_1) != 0))) { + PyErr_SetNone(PyExc_AssertionError); + __PYX_ERR(0, 334, __pyx_L1_error) + } + } + #endif + + __pyx_t_1 = (((PyObject *)__pyx_v_self->tail) == Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + __pyx_t_2 = (((PyObject *)__pyx_v_self->head) == Py_None); + __pyx_t_1 = (__pyx_t_2 != 0); + if (__pyx_t_1) { + + __Pyx_INCREF(((PyObject *)__pyx_v_new_tail)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_new_tail)); + __Pyx_GOTREF(__pyx_v_self->head); + __Pyx_DECREF(((PyObject *)__pyx_v_self->head)); + __pyx_v_self->head = __pyx_v_new_tail; + + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + + } + + __pyx_t_3 = ((PyObject *)__pyx_v_self->head); + __Pyx_INCREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __Pyx_GOTREF(__pyx_v_self->tail); + __Pyx_DECREF(((PyObject *)__pyx_v_self->tail)); + __pyx_v_self->tail = ((struct PyGeventCallbackObject *)__pyx_t_3); + __pyx_t_3 = 0; + + } + + #ifndef CYTHON_WITHOUT_ASSERTIONS + if (unlikely(!Py_OptimizeFlag)) { + __pyx_t_1 = (((PyObject *)__pyx_v_self->head) != Py_None); + if (unlikely(!(__pyx_t_1 != 0))) { + PyErr_SetNone(PyExc_AssertionError); + __PYX_ERR(0, 344, __pyx_L1_error) + } + } + #endif + + __pyx_t_3 = ((PyObject *)__pyx_v_self->tail); + __Pyx_INCREF(__pyx_t_3); + __pyx_v_old_tail = ((struct PyGeventCallbackObject *)__pyx_t_3); + __pyx_t_3 = 0; + + __Pyx_INCREF(((PyObject *)__pyx_v_new_tail)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_new_tail)); + __Pyx_GOTREF(__pyx_v_old_tail->next); + __Pyx_DECREF(((PyObject *)__pyx_v_old_tail->next)); + __pyx_v_old_tail->next = __pyx_v_new_tail; + + __Pyx_INCREF(((PyObject *)__pyx_v_new_tail)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_new_tail)); + __Pyx_GOTREF(__pyx_v_self->tail); + __Pyx_DECREF(((PyObject *)__pyx_v_self->tail)); + __pyx_v_self->tail = __pyx_v_new_tail; + + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("gevent.libev.corecext.CallbackFIFO.append", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_old_tail); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_12CallbackFIFO_3__nonzero__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_12CallbackFIFO_3__nonzero__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__nonzero__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_12CallbackFIFO_2__nonzero__(((struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_12CallbackFIFO_2__nonzero__(struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("__nonzero__", 0); + + __pyx_t_1 = (((PyObject *)__pyx_v_self->head) != Py_None); + __pyx_r = __pyx_t_1; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static Py_ssize_t __pyx_pw_6gevent_5libev_8corecext_12CallbackFIFO_5__len__(PyObject *__pyx_v_self); /*proto*/ +static Py_ssize_t __pyx_pw_6gevent_5libev_8corecext_12CallbackFIFO_5__len__(PyObject *__pyx_v_self) { + Py_ssize_t __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__len__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_12CallbackFIFO_4__len__(((struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static Py_ssize_t __pyx_pf_6gevent_5libev_8corecext_12CallbackFIFO_4__len__(struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *__pyx_v_self) { + Py_ssize_t __pyx_v_count; + struct PyGeventCallbackObject *__pyx_v_head = NULL; + Py_ssize_t __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + __Pyx_RefNannySetupContext("__len__", 0); + + __pyx_v_count = 0; + + __pyx_t_1 = ((PyObject *)__pyx_v_self->head); + __Pyx_INCREF(__pyx_t_1); + __pyx_v_head = ((struct PyGeventCallbackObject *)__pyx_t_1); + __pyx_t_1 = 0; + + while (1) { + __pyx_t_2 = (((PyObject *)__pyx_v_head) != Py_None); + __pyx_t_3 = (__pyx_t_2 != 0); + if (!__pyx_t_3) break; + + __pyx_v_count = (__pyx_v_count + 1); + + __pyx_t_1 = ((PyObject *)__pyx_v_head->next); + __Pyx_INCREF(__pyx_t_1); + __Pyx_DECREF_SET(__pyx_v_head, ((struct PyGeventCallbackObject *)__pyx_t_1)); + __pyx_t_1 = 0; + } + + __pyx_r = __pyx_v_count; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_head); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_12CallbackFIFO_7__iter__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_12CallbackFIFO_7__iter__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_12CallbackFIFO_6__iter__(((struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_12CallbackFIFO_6__iter__(struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *__pyx_v_self) { + PyObject *__pyx_v_objects = 0; + struct PyGeventCallbackObject *__pyx_v_head = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + __Pyx_RefNannySetupContext("__iter__", 0); + + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 361, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_objects = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + __pyx_t_1 = ((PyObject *)__pyx_v_self->head); + __Pyx_INCREF(__pyx_t_1); + __pyx_v_head = ((struct PyGeventCallbackObject *)__pyx_t_1); + __pyx_t_1 = 0; + + while (1) { + __pyx_t_2 = (((PyObject *)__pyx_v_head) != Py_None); + __pyx_t_3 = (__pyx_t_2 != 0); + if (!__pyx_t_3) break; + + __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_objects, ((PyObject *)__pyx_v_head)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 364, __pyx_L1_error) + + __pyx_t_1 = ((PyObject *)__pyx_v_head->next); + __Pyx_INCREF(__pyx_t_1); + __Pyx_DECREF_SET(__pyx_v_head, ((struct PyGeventCallbackObject *)__pyx_t_1)); + __pyx_t_1 = 0; + } + + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyObject_GetIter(__pyx_v_objects); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 366, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.libev.corecext.CallbackFIFO.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_objects); + __Pyx_XDECREF((PyObject *)__pyx_v_head); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +static int __pyx_f_6gevent_5libev_8corecext_12CallbackFIFO_has_callbacks(struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("has_callbacks", 0); + + __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_self->head)); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 369, __pyx_L1_error) + __pyx_r = __pyx_t_1; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_WriteUnraisable("gevent.libev.corecext.CallbackFIFO.has_callbacks", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_12CallbackFIFO_9__repr__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_12CallbackFIFO_9__repr__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_12CallbackFIFO_8__repr__(((struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_12CallbackFIFO_8__repr__(struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + __Pyx_RefNannySetupContext("__repr__", 0); + + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 372, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_self)); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 372, __pyx_L1_error) + __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 372, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 372, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); + __Pyx_INCREF(((PyObject *)__pyx_v_self->head)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self->head)); + PyTuple_SET_ITEM(__pyx_t_4, 2, ((PyObject *)__pyx_v_self->head)); + __Pyx_INCREF(((PyObject *)__pyx_v_self->tail)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self->tail)); + PyTuple_SET_ITEM(__pyx_t_4, 3, ((PyObject *)__pyx_v_self->tail)); + __pyx_t_1 = 0; + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_callbacks_r_len_d_head_r_tail_r, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 372, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("gevent.libev.corecext.CallbackFIFO.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_4loop_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_4loop_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_flags = 0; + PyObject *__pyx_v_default = 0; + intptr_t __pyx_v_ptr; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_flags_2,&__pyx_n_s_default,&__pyx_n_s_ptr,0}; + PyObject* values[3] = {0,0,0}; + values[0] = ((PyObject *)Py_None); + values[1] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flags_2); + if (value) { values[0] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 1: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_default); + if (value) { values[1] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 2: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ptr); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 397, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_flags = values[0]; + __pyx_v_default = values[1]; + if (values[2]) { + __pyx_v_ptr = __Pyx_PyIndex_AsSsize_t(values[2]); if (unlikely((__pyx_v_ptr == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 397, __pyx_L3_error) + } else { + __pyx_v_ptr = ((intptr_t)0); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 397, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.libev.corecext.loop.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop___cinit__(((struct PyGeventLoopObject *)__pyx_v_self), __pyx_v_flags, __pyx_v_default, __pyx_v_ptr); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_4loop___cinit__(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_flags, PyObject *__pyx_v_default, intptr_t __pyx_v_ptr) { + unsigned int __pyx_v_c_flags; + CYTHON_UNUSED PyObject *__pyx_v_old_handler = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + unsigned int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + __Pyx_RefNannySetupContext("__cinit__", 0); + __Pyx_INCREF(__pyx_v_default); + + __pyx_v_self->starting_timer_may_update_loop_time = 0; + + __pyx_v_self->_default = 0; + + ev_prepare_init((&__pyx_v_self->_prepare), ((void *)gevent_run_callbacks)); + + ev_timer_init((&__pyx_v_self->_periodic_signal_checker), ((void *)gevent_periodic_signal_check), 0.3, 0.3); + + ev_timer_init((&__pyx_v_self->_timer0), ((void *)gevent_noop), 0.0, 0.0); + + __Pyx_INCREF(Py_None); + __pyx_v_old_handler = Py_None; + + __pyx_t_1 = (__pyx_v_ptr != 0); + if (__pyx_t_1) { + + __pyx_v_self->_ptr = ((struct ev_loop *)__pyx_v_ptr); + + __pyx_v_self->_default = ev_is_default_loop(__pyx_v_self->_ptr); + + goto __pyx_L3; + } + + /*else*/ { + __pyx_t_2 = __pyx_f_6gevent_5libev_8corecext__flags_to_int(__pyx_v_flags, 0); if (unlikely(__pyx_t_2 == ((unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 415, __pyx_L1_error) + __pyx_v_c_flags = __pyx_t_2; + + __pyx_t_3 = __pyx_f_6gevent_5libev_8corecext__check_flags(__pyx_v_c_flags, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 416, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + __pyx_v_c_flags = (__pyx_v_c_flags | EVFLAG_NOENV); + + __pyx_v_c_flags = (__pyx_v_c_flags | EVFLAG_FORKCHECK); + + __pyx_t_1 = (__pyx_v_default == Py_None); + __pyx_t_4 = (__pyx_t_1 != 0); + if (__pyx_t_4) { + + __Pyx_INCREF(Py_True); + __Pyx_DECREF_SET(__pyx_v_default, Py_True); + + } + + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_default); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 421, __pyx_L1_error) + if (__pyx_t_4) { + + __pyx_v_self->_default = 1; + + __pyx_v_self->_ptr = gevent_ev_default_loop(__pyx_v_c_flags); + + __pyx_t_4 = ((!(__pyx_v_self->_ptr != 0)) != 0); + if (unlikely(__pyx_t_4)) { + + __pyx_t_3 = __Pyx_PyInt_From_unsigned_int(__pyx_v_c_flags); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 425, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 425, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_ev_default_loop_s_failed, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 425, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_SystemError, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 425, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __PYX_ERR(0, 425, __pyx_L1_error) + + } + + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_sys); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 426, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_platform); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 426, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_t_3, __pyx_n_s_win32, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 426, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_4) { + + ev_timer_start(__pyx_v_self->_ptr, (&__pyx_v_self->_periodic_signal_checker)); + + ev_unref(__pyx_v_self->_ptr); + + } + + goto __pyx_L5; + } + + /*else*/ { + __pyx_v_self->_ptr = ev_loop_new(__pyx_v_c_flags); + + __pyx_t_4 = ((!(__pyx_v_self->_ptr != 0)) != 0); + if (unlikely(__pyx_t_4)) { + + __pyx_t_3 = __Pyx_PyInt_From_unsigned_int(__pyx_v_c_flags); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 432, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 432, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_ev_loop_new_s_failed, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 432, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_SystemError, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 432, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __PYX_ERR(0, 432, __pyx_L1_error) + + } + } + __pyx_L5:; + + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_default); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 433, __pyx_L1_error) + if (!__pyx_t_1) { + } else { + __pyx_t_4 = __pyx_t_1; + goto __pyx_L10_bool_binop_done; + } + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_SYSERR_CALLBACK); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 433, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_1 = (__pyx_t_5 == Py_None); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = (__pyx_t_1 != 0); + __pyx_t_4 = __pyx_t_6; + __pyx_L10_bool_binop_done:; + if (__pyx_t_4) { + + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_handle_syserr); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 434, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = __pyx_f_6gevent_5libev_8corecext_set_syserr_cb(__pyx_t_5, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 434, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + } + } + __pyx_L3:; + + ev_set_userdata(__pyx_v_self->_ptr, __pyx_v_self->_ptr); + + ev_prepare_start(__pyx_v_self->_ptr, (&__pyx_v_self->_prepare)); + + ev_unref(__pyx_v_self->_ptr); + + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("gevent.libev.corecext.loop.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_old_handler); + __Pyx_XDECREF(__pyx_v_default); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_4loop_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_4loop_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + CYTHON_UNUSED PyObject *__pyx_v_flags = 0; + CYTHON_UNUSED PyObject *__pyx_v_default = 0; + CYTHON_UNUSED intptr_t __pyx_v_ptr; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_flags_2,&__pyx_n_s_default,&__pyx_n_s_ptr,0}; + PyObject* values[3] = {0,0,0}; + values[0] = ((PyObject *)Py_None); + values[1] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flags_2); + if (value) { values[0] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 1: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_default); + if (value) { values[1] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 2: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ptr); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 442, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_flags = values[0]; + __pyx_v_default = values[1]; + if (values[2]) { + __pyx_v_ptr = __Pyx_PyIndex_AsSsize_t(values[2]); if (unlikely((__pyx_v_ptr == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 442, __pyx_L3_error) + } else { + __pyx_v_ptr = ((intptr_t)0); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 442, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.libev.corecext.loop.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_2__init__(((struct PyGeventLoopObject *)__pyx_v_self), __pyx_v_flags, __pyx_v_default, __pyx_v_ptr); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_4loop_2__init__(struct PyGeventLoopObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_flags, CYTHON_UNUSED PyObject *__pyx_v_default, CYTHON_UNUSED intptr_t __pyx_v_ptr) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__init__", 0); + + __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_6gevent_5libev_8corecext_CallbackFIFO)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 443, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_self->_callbacks); + __Pyx_DECREF(((PyObject *)__pyx_v_self->_callbacks)); + __pyx_v_self->_callbacks = ((struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *)__pyx_t_1); + __pyx_t_1 = 0; + + __pyx_v_self->approx_timer_resolution = 0.00001; + + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.libev.corecext.loop.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +static PyObject *__pyx_f_6gevent_5libev_8corecext_4loop__run_callbacks(struct PyGeventLoopObject *__pyx_v_self) { + struct PyGeventCallbackObject *__pyx_v_cb = 0; + int __pyx_v_count; + ev_tstamp __pyx_v_now; + ev_tstamp __pyx_v_expiration; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + ev_tstamp __pyx_t_4; + int __pyx_t_5; + int __pyx_t_6; + int __pyx_t_7; + int __pyx_t_8; + int __pyx_t_9; + char const *__pyx_t_10; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + PyObject *__pyx_t_14 = NULL; + PyObject *__pyx_t_15 = NULL; + PyObject *__pyx_t_16 = NULL; + __Pyx_RefNannySetupContext("_run_callbacks", 0); + + __pyx_v_count = 50; + + __pyx_v_self->starting_timer_may_update_loop_time = 1; + + __pyx_v_now = ev_now(__pyx_v_self->_ptr); + + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_getswitchinterval); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 453, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 453, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_4 == ((ev_tstamp)-1)) && PyErr_Occurred())) __PYX_ERR(0, 453, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_expiration = (__pyx_v_now + ((ev_tstamp)__pyx_t_4)); + + /*try:*/ { + + ev_timer_stop(__pyx_v_self->_ptr, (&__pyx_v_self->_timer0)); + + while (1) { + __pyx_t_5 = (((PyObject *)__pyx_v_self->_callbacks->head) != Py_None); + __pyx_t_6 = (__pyx_t_5 != 0); + if (!__pyx_t_6) break; + + __pyx_t_1 = ((PyObject *)__pyx_f_6gevent_5libev_8corecext_12CallbackFIFO_popleft(__pyx_v_self->_callbacks)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 458, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XDECREF_SET(__pyx_v_cb, ((struct PyGeventCallbackObject *)__pyx_t_1)); + __pyx_t_1 = 0; + + ev_unref(__pyx_v_self->_ptr); + + gevent_call(__pyx_v_self, __pyx_v_cb); + + __pyx_v_count = (__pyx_v_count - 1); + + __pyx_t_5 = ((__pyx_v_count == 0) != 0); + if (__pyx_t_5) { + } else { + __pyx_t_6 = __pyx_t_5; + goto __pyx_L9_bool_binop_done; + } + __pyx_t_5 = (((PyObject *)__pyx_v_self->_callbacks->head) != Py_None); + __pyx_t_7 = (__pyx_t_5 != 0); + __pyx_t_6 = __pyx_t_7; + __pyx_L9_bool_binop_done:; + if (__pyx_t_6) { + + __pyx_v_count = 50; + + ev_now_update(__pyx_v_self->_ptr); + + __pyx_t_6 = ((ev_now(__pyx_v_self->_ptr) >= __pyx_v_expiration) != 0); + if (__pyx_t_6) { + + __pyx_v_now = 0.0; + + goto __pyx_L7_break; + + } + + } + } + __pyx_L7_break:; + + __pyx_t_6 = ((__pyx_v_now != 0.0) != 0); + if (__pyx_t_6) { + + ev_now_update(__pyx_v_self->_ptr); + + } + + __pyx_t_6 = (((PyObject *)__pyx_v_self->_callbacks->head) != Py_None); + __pyx_t_7 = (__pyx_t_6 != 0); + if (__pyx_t_7) { + + ev_timer_start(__pyx_v_self->_ptr, (&__pyx_v_self->_timer0)); + + } + } + + /*finally:*/ { + /*normal exit:*/{ + __pyx_v_self->starting_timer_may_update_loop_time = 0; + goto __pyx_L5; + } + __pyx_L4_error:; + /*exception exit:*/{ + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_14, &__pyx_t_15, &__pyx_t_16); + if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13) < 0)) __Pyx_ErrFetch(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13); + __Pyx_XGOTREF(__pyx_t_11); + __Pyx_XGOTREF(__pyx_t_12); + __Pyx_XGOTREF(__pyx_t_13); + __Pyx_XGOTREF(__pyx_t_14); + __Pyx_XGOTREF(__pyx_t_15); + __Pyx_XGOTREF(__pyx_t_16); + __pyx_t_8 = __pyx_lineno; __pyx_t_9 = __pyx_clineno; __pyx_t_10 = __pyx_filename; + { + __pyx_v_self->starting_timer_may_update_loop_time = 0; + } + if (PY_MAJOR_VERSION >= 3) { + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_XGIVEREF(__pyx_t_15); + __Pyx_XGIVEREF(__pyx_t_16); + __Pyx_ExceptionReset(__pyx_t_14, __pyx_t_15, __pyx_t_16); + } + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_XGIVEREF(__pyx_t_12); + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_ErrRestore(__pyx_t_11, __pyx_t_12, __pyx_t_13); + __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; + __pyx_lineno = __pyx_t_8; __pyx_clineno = __pyx_t_9; __pyx_filename = __pyx_t_10; + goto __pyx_L1_error; + } + __pyx_L5:; + } + + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("gevent.libev.corecext.loop._run_callbacks", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_cb); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +static PyObject *__pyx_f_6gevent_5libev_8corecext_4loop__stop_watchers(struct PyGeventLoopObject *__pyx_v_self, struct ev_loop *__pyx_v_ptr) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("_stop_watchers", 0); + + __pyx_t_1 = ((!(__pyx_v_ptr != 0)) != 0); + if (__pyx_t_1) { + + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + + } + + __pyx_t_1 = (ev_is_active((&__pyx_v_self->_prepare)) != 0); + if (__pyx_t_1) { + + ev_ref(__pyx_v_ptr); + + ev_prepare_stop(__pyx_v_ptr, (&__pyx_v_self->_prepare)); + + } + + __pyx_t_1 = (ev_is_active((&__pyx_v_self->_periodic_signal_checker)) != 0); + if (__pyx_t_1) { + + ev_ref(__pyx_v_ptr); + + ev_timer_stop(__pyx_v_ptr, (&__pyx_v_self->_periodic_signal_checker)); + + } + + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_5destroy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_5destroy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("destroy (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_4destroy(((struct PyGeventLoopObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_4destroy(struct PyGeventLoopObject *__pyx_v_self) { + struct ev_loop *__pyx_v_ptr; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + struct ev_loop *__pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + __Pyx_RefNannySetupContext("destroy", 0); + + __pyx_t_1 = __pyx_v_self->_ptr; + __pyx_v_ptr = __pyx_t_1; + + __pyx_v_self->_ptr = NULL; + + __pyx_t_2 = (__pyx_v_ptr != 0); + if (__pyx_t_2) { + + __pyx_t_2 = ((!(ev_userdata(__pyx_v_ptr) != 0)) != 0); + if (__pyx_t_2) { + + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + + } + + ev_set_userdata(__pyx_v_ptr, NULL); + + __pyx_t_3 = ((struct __pyx_vtabstruct_6gevent_5libev_8corecext_loop *)__pyx_v_self->__pyx_vtab)->_stop_watchers(__pyx_v_self, __pyx_v_ptr); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 505, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_SYSERR_CALLBACK); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 506, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_handle_syserr); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 506, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 506, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 506, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_2) { + + __pyx_t_5 = __pyx_f_6gevent_5libev_8corecext_set_syserr_cb(Py_None, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 507, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + } + + ev_loop_destroy(__pyx_v_ptr); + + } + + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("gevent.libev.corecext.loop.destroy", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static void __pyx_pw_6gevent_5libev_8corecext_4loop_7__dealloc__(PyObject *__pyx_v_self); /*proto*/ +static void __pyx_pw_6gevent_5libev_8corecext_4loop_7__dealloc__(PyObject *__pyx_v_self) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); + __pyx_pf_6gevent_5libev_8corecext_4loop_6__dealloc__(((struct PyGeventLoopObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +static void __pyx_pf_6gevent_5libev_8corecext_4loop_6__dealloc__(struct PyGeventLoopObject *__pyx_v_self) { + struct ev_loop *__pyx_v_ptr; + __Pyx_RefNannyDeclarations + struct ev_loop *__pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("__dealloc__", 0); + + __pyx_t_1 = __pyx_v_self->_ptr; + __pyx_v_ptr = __pyx_t_1; + + __pyx_v_self->_ptr = NULL; + + __pyx_t_2 = ((__pyx_v_ptr != NULL) != 0); + if (__pyx_t_2) { + + __pyx_t_2 = ((!(ev_userdata(__pyx_v_ptr) != 0)) != 0); + if (__pyx_t_2) { + + goto __pyx_L0; + + } + + __pyx_t_3 = ((struct __pyx_vtabstruct_6gevent_5libev_8corecext_loop *)__pyx_v_self->__pyx_vtab)->_stop_watchers(__pyx_v_self, __pyx_v_ptr); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 517, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + __pyx_t_2 = ((!(__pyx_v_self->_default != 0)) != 0); + if (__pyx_t_2) { + + ev_loop_destroy(__pyx_v_ptr); + + ev_set_userdata(__pyx_v_ptr, NULL); + + } + + } + + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_WriteUnraisable("gevent.libev.corecext.loop.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); + __pyx_L0:; + __Pyx_RefNannyFinishContext(); +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_3ptr_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_3ptr_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_3ptr___get__(((struct PyGeventLoopObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_3ptr___get__(struct PyGeventLoopObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_self->_ptr)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 525, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.libev.corecext.loop.ptr.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_11WatcherType_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_11WatcherType_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_11WatcherType___get__(((struct PyGeventLoopObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_11WatcherType___get__(CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_ptype_6gevent_5libev_8corecext_watcher)); + __pyx_r = ((PyObject *)__pyx_ptype_6gevent_5libev_8corecext_watcher); + goto __pyx_L0; + + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_6MAXPRI_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_6MAXPRI_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_6MAXPRI___get__(((struct PyGeventLoopObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_6MAXPRI___get__(CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_int(EV_MAXPRI); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 533, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.libev.corecext.loop.MAXPRI.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_6MINPRI_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_6MINPRI_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_6MINPRI___get__(((struct PyGeventLoopObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_6MINPRI___get__(CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_int(EV_MINPRI); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 537, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.libev.corecext.loop.MINPRI.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_9_handle_syserr(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_9_handle_syserr(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_message = 0; + PyObject *__pyx_v_errno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_handle_syserr (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_message,&__pyx_n_s_errno,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_message)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_errno)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("_handle_syserr", 1, 2, 2, 1); __PYX_ERR(0, 539, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_handle_syserr") < 0)) __PYX_ERR(0, 539, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_message = values[0]; + __pyx_v_errno = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("_handle_syserr", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 539, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.libev.corecext.loop._handle_syserr", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_8_handle_syserr(((struct PyGeventLoopObject *)__pyx_v_self), __pyx_v_message, __pyx_v_errno); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_8_handle_syserr(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_message, PyObject *__pyx_v_errno) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + __Pyx_RefNannySetupContext("_handle_syserr", 0); + __Pyx_INCREF(__pyx_v_message); + + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_sys); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 540, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_version_info); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 540, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 540, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_int_3, Py_GE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 540, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 540, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_3) { + + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_message, __pyx_n_s_decode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 541, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_1, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 541, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF_SET(__pyx_v_message, __pyx_t_2); + __pyx_t_2 = 0; + + } + + __pyx_t_2 = PyNumber_Add(__pyx_v_message, __pyx_kp_s__8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 542, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_os); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 542, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_strerror); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 542, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_5, function); + } + } + __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_4, __pyx_v_errno) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_errno); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 542, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyNumber_Add(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 542, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_SystemError, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 542, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = ((struct __pyx_vtabstruct_6gevent_5libev_8corecext_loop *)__pyx_v_self->__pyx_vtab)->handle_error(__pyx_v_self, Py_None, __pyx_builtin_SystemError, __pyx_t_1, Py_None, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 542, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("gevent.libev.corecext.loop._handle_syserr", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_message); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_11handle_error(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_6gevent_5libev_8corecext_4loop_handle_error(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_context, PyObject *__pyx_v_type, PyObject *__pyx_v_value, PyObject *__pyx_v_tb, int __pyx_skip_dispatch) { + PyObject *__pyx_v_handle_error = 0; + PyObject *__pyx_v_error_handler = 0; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + int __pyx_t_8; + __Pyx_RefNannySetupContext("handle_error", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0; + if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self)))))); + else { + PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + #endif + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_handle_error); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 544, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_5libev_8corecext_4loop_11handle_error)) { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; + __pyx_t_5 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_5 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_3)) { + PyObject *__pyx_temp[5] = {__pyx_t_4, __pyx_v_context, __pyx_v_type, __pyx_v_value, __pyx_v_tb}; + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 4+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 544, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GOTREF(__pyx_t_2); + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { + PyObject *__pyx_temp[5] = {__pyx_t_4, __pyx_v_context, __pyx_v_type, __pyx_v_value, __pyx_v_tb}; + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 4+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 544, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GOTREF(__pyx_t_2); + } else + #endif + { + __pyx_t_6 = PyTuple_New(4+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 544, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (__pyx_t_4) { + __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL; + } + __Pyx_INCREF(__pyx_v_context); + __Pyx_GIVEREF(__pyx_v_context); + PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_context); + __Pyx_INCREF(__pyx_v_type); + __Pyx_GIVEREF(__pyx_v_type); + PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_type); + __Pyx_INCREF(__pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_v_value); + __Pyx_INCREF(__pyx_v_tb); + __Pyx_GIVEREF(__pyx_v_tb); + PyTuple_SET_ITEM(__pyx_t_6, 3+__pyx_t_5, __pyx_v_tb); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 544, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0; + if (unlikely(type_dict_guard != tp_dict_version)) { + tp_dict_version = obj_dict_version = 0; + } + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + } + #endif + } + + __pyx_t_1 = __pyx_v_self->error_handler; + __Pyx_INCREF(__pyx_t_1); + __pyx_v_error_handler = __pyx_t_1; + __pyx_t_1 = 0; + + __pyx_t_7 = (__pyx_v_error_handler != Py_None); + __pyx_t_8 = (__pyx_t_7 != 0); + if (__pyx_t_8) { + + __pyx_t_1 = __Pyx_GetAttr3(__pyx_v_error_handler, __pyx_n_s_handle_error, __pyx_v_error_handler); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 549, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_handle_error = __pyx_t_1; + __pyx_t_1 = 0; + + __Pyx_INCREF(__pyx_v_handle_error); + __pyx_t_2 = __pyx_v_handle_error; __pyx_t_3 = NULL; + __pyx_t_5 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_5 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[5] = {__pyx_t_3, __pyx_v_context, __pyx_v_type, __pyx_v_value, __pyx_v_tb}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 4+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 550, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[5] = {__pyx_t_3, __pyx_v_context, __pyx_v_type, __pyx_v_value, __pyx_v_tb}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 4+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 550, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else + #endif + { + __pyx_t_6 = PyTuple_New(4+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 550, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (__pyx_t_3) { + __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); __pyx_t_3 = NULL; + } + __Pyx_INCREF(__pyx_v_context); + __Pyx_GIVEREF(__pyx_v_context); + PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_context); + __Pyx_INCREF(__pyx_v_type); + __Pyx_GIVEREF(__pyx_v_type); + PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_type); + __Pyx_INCREF(__pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_v_value); + __Pyx_INCREF(__pyx_v_tb); + __Pyx_GIVEREF(__pyx_v_tb); + PyTuple_SET_ITEM(__pyx_t_6, 3+__pyx_t_5, __pyx_v_tb); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 550, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + goto __pyx_L3; + } + + /*else*/ { + __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_5libev_8corecext_loop *)__pyx_v_self->__pyx_vtab)->_default_handle_error(__pyx_v_self, __pyx_v_context, __pyx_v_type, __pyx_v_value, __pyx_v_tb, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 552, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + __pyx_L3:; + + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("gevent.libev.corecext.loop.handle_error", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_handle_error); + __Pyx_XDECREF(__pyx_v_error_handler); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_11handle_error(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_11handle_error(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_context = 0; + PyObject *__pyx_v_type = 0; + PyObject *__pyx_v_value = 0; + PyObject *__pyx_v_tb = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("handle_error (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_context,&__pyx_n_s_type,&__pyx_n_s_value,&__pyx_n_s_tb,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_context)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_type)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("handle_error", 1, 4, 4, 1); __PYX_ERR(0, 544, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("handle_error", 1, 4, 4, 2); __PYX_ERR(0, 544, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 3: + if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tb)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("handle_error", 1, 4, 4, 3); __PYX_ERR(0, 544, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "handle_error") < 0)) __PYX_ERR(0, 544, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_context = values[0]; + __pyx_v_type = values[1]; + __pyx_v_value = values[2]; + __pyx_v_tb = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("handle_error", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 544, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.libev.corecext.loop.handle_error", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_10handle_error(((struct PyGeventLoopObject *)__pyx_v_self), __pyx_v_context, __pyx_v_type, __pyx_v_value, __pyx_v_tb); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_10handle_error(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_context, PyObject *__pyx_v_type, PyObject *__pyx_v_value, PyObject *__pyx_v_tb) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("handle_error", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6gevent_5libev_8corecext_4loop_handle_error(__pyx_v_self, __pyx_v_context, __pyx_v_type, __pyx_v_value, __pyx_v_tb, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 544, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.libev.corecext.loop.handle_error", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_13_default_handle_error(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_6gevent_5libev_8corecext_4loop__default_handle_error(struct PyGeventLoopObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_context, PyObject *__pyx_v_type, PyObject *__pyx_v_value, PyObject *__pyx_v_tb, int __pyx_skip_dispatch) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + __Pyx_RefNannySetupContext("_default_handle_error", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0; + if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self)))))); + else { + PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + #endif + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_default_handle_error); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 554, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_5libev_8corecext_4loop_13_default_handle_error)) { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; + __pyx_t_5 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_5 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_3)) { + PyObject *__pyx_temp[5] = {__pyx_t_4, __pyx_v_context, __pyx_v_type, __pyx_v_value, __pyx_v_tb}; + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 4+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 554, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GOTREF(__pyx_t_2); + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { + PyObject *__pyx_temp[5] = {__pyx_t_4, __pyx_v_context, __pyx_v_type, __pyx_v_value, __pyx_v_tb}; + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 4+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 554, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GOTREF(__pyx_t_2); + } else + #endif + { + __pyx_t_6 = PyTuple_New(4+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 554, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (__pyx_t_4) { + __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL; + } + __Pyx_INCREF(__pyx_v_context); + __Pyx_GIVEREF(__pyx_v_context); + PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_context); + __Pyx_INCREF(__pyx_v_type); + __Pyx_GIVEREF(__pyx_v_type); + PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_type); + __Pyx_INCREF(__pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_v_value); + __Pyx_INCREF(__pyx_v_tb); + __Pyx_GIVEREF(__pyx_v_tb); + PyTuple_SET_ITEM(__pyx_t_6, 3+__pyx_t_5, __pyx_v_tb); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 554, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0; + if (unlikely(type_dict_guard != tp_dict_version)) { + tp_dict_version = obj_dict_version = 0; + } + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + } + #endif + } + + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_traceback); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 557, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_print_exception); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 557, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = NULL; + __pyx_t_5 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_2)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_5 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_3)) { + PyObject *__pyx_temp[4] = {__pyx_t_2, __pyx_v_type, __pyx_v_value, __pyx_v_tb}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 557, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { + PyObject *__pyx_temp[4] = {__pyx_t_2, __pyx_v_type, __pyx_v_value, __pyx_v_tb}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 557, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else + #endif + { + __pyx_t_6 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 557, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (__pyx_t_2) { + __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); __pyx_t_2 = NULL; + } + __Pyx_INCREF(__pyx_v_type); + __Pyx_GIVEREF(__pyx_v_type); + PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_type); + __Pyx_INCREF(__pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_value); + __Pyx_INCREF(__pyx_v_tb); + __Pyx_GIVEREF(__pyx_v_tb); + PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_v_tb); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 557, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + __pyx_t_7 = (__pyx_v_self->_ptr != 0); + if (__pyx_t_7) { + + ev_break(__pyx_v_self->_ptr, EVBREAK_ONE); + + } + + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("gevent.libev.corecext.loop._default_handle_error", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_13_default_handle_error(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_13_default_handle_error(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_context = 0; + PyObject *__pyx_v_type = 0; + PyObject *__pyx_v_value = 0; + PyObject *__pyx_v_tb = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_default_handle_error (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_context,&__pyx_n_s_type,&__pyx_n_s_value,&__pyx_n_s_tb,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_context)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_type)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("_default_handle_error", 1, 4, 4, 1); __PYX_ERR(0, 554, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("_default_handle_error", 1, 4, 4, 2); __PYX_ERR(0, 554, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 3: + if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tb)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("_default_handle_error", 1, 4, 4, 3); __PYX_ERR(0, 554, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_default_handle_error") < 0)) __PYX_ERR(0, 554, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_context = values[0]; + __pyx_v_type = values[1]; + __pyx_v_value = values[2]; + __pyx_v_tb = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("_default_handle_error", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 554, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.libev.corecext.loop._default_handle_error", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_12_default_handle_error(((struct PyGeventLoopObject *)__pyx_v_self), __pyx_v_context, __pyx_v_type, __pyx_v_value, __pyx_v_tb); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_12_default_handle_error(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_context, PyObject *__pyx_v_type, PyObject *__pyx_v_value, PyObject *__pyx_v_tb) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("_default_handle_error", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6gevent_5libev_8corecext_4loop__default_handle_error(__pyx_v_self, __pyx_v_context, __pyx_v_type, __pyx_v_value, __pyx_v_tb, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 554, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.libev.corecext.loop._default_handle_error", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_15run(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_15run(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_nowait = 0; + PyObject *__pyx_v_once = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("run (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_nowait,&__pyx_n_s_once,0}; + PyObject* values[2] = {0,0}; + values[0] = ((PyObject *)Py_False); + values[1] = ((PyObject *)Py_False); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nowait); + if (value) { values[0] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 1: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_once); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "run") < 0)) __PYX_ERR(0, 561, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_nowait = values[0]; + __pyx_v_once = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("run", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 561, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.libev.corecext.loop.run", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_14run(((struct PyGeventLoopObject *)__pyx_v_self), __pyx_v_nowait, __pyx_v_once); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_14run(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_nowait, PyObject *__pyx_v_once) { + unsigned int __pyx_v_flags; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("run", 0); + + __pyx_t_1 = __pyx_f_6gevent_5libev_8corecext__check_loop(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 562, __pyx_L1_error) + + __pyx_v_flags = 0; + + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_nowait); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 564, __pyx_L1_error) + if (__pyx_t_1) { + + __pyx_v_flags = (__pyx_v_flags | EVRUN_NOWAIT); + + } + + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_once); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 566, __pyx_L1_error) + if (__pyx_t_1) { + + __pyx_v_flags = (__pyx_v_flags | EVRUN_ONCE); + + } + + { + #ifdef WITH_THREAD + PyThreadState *_save; + Py_UNBLOCK_THREADS + __Pyx_FastGIL_Remember(); + #endif + /*try:*/ { + + ev_run(__pyx_v_self->_ptr, __pyx_v_flags); + } + + /*finally:*/ { + /*normal exit:*/{ + #ifdef WITH_THREAD + __Pyx_FastGIL_Forget(); + Py_BLOCK_THREADS + #endif + goto __pyx_L7; + } + __pyx_L7:; + } + } + + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("gevent.libev.corecext.loop.run", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_17reinit(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_17reinit(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("reinit (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_16reinit(((struct PyGeventLoopObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_16reinit(struct PyGeventLoopObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("reinit", 0); + + __pyx_t_1 = (__pyx_v_self->_ptr != 0); + if (__pyx_t_1) { + + ev_loop_fork(__pyx_v_self->_ptr); + + } + + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_19ref(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_19ref(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("ref (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_18ref(((struct PyGeventLoopObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_18ref(struct PyGeventLoopObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("ref", 0); + + __pyx_t_1 = __pyx_f_6gevent_5libev_8corecext__check_loop(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 576, __pyx_L1_error) + + ev_ref(__pyx_v_self->_ptr); + + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("gevent.libev.corecext.loop.ref", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_21unref(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_21unref(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("unref (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_20unref(((struct PyGeventLoopObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_20unref(struct PyGeventLoopObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("unref", 0); + + __pyx_t_1 = __pyx_f_6gevent_5libev_8corecext__check_loop(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 580, __pyx_L1_error) + + ev_unref(__pyx_v_self->_ptr); + + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("gevent.libev.corecext.loop.unref", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_23break_(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_23break_(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + int __pyx_v_how; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("break_ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_how,0}; + PyObject* values[1] = {0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_how); + if (value) { values[0] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "break_") < 0)) __PYX_ERR(0, 583, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + } + if (values[0]) { + __pyx_v_how = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_how == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 583, __pyx_L3_error) + } else { + __pyx_v_how = __pyx_k__9; + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("break_", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 583, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.libev.corecext.loop.break_", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_22break_(((struct PyGeventLoopObject *)__pyx_v_self), __pyx_v_how); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_22break_(struct PyGeventLoopObject *__pyx_v_self, int __pyx_v_how) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("break_", 0); + + __pyx_t_1 = __pyx_f_6gevent_5libev_8corecext__check_loop(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 584, __pyx_L1_error) + + ev_break(__pyx_v_self->_ptr, __pyx_v_how); + + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("gevent.libev.corecext.loop.break_", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_25verify(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_25verify(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("verify (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_24verify(((struct PyGeventLoopObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_24verify(struct PyGeventLoopObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("verify", 0); + + __pyx_t_1 = __pyx_f_6gevent_5libev_8corecext__check_loop(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 588, __pyx_L1_error) + + ev_verify(__pyx_v_self->_ptr); + + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("gevent.libev.corecext.loop.verify", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_27now(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static ev_tstamp __pyx_f_6gevent_5libev_8corecext_4loop_now(struct PyGeventLoopObject *__pyx_v_self, int __pyx_skip_dispatch) { + ev_tstamp __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + ev_tstamp __pyx_t_5; + int __pyx_t_6; + __Pyx_RefNannySetupContext("now", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0; + if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self)))))); + else { + PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + #endif + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_now); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 591, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_5libev_8corecext_4loop_27now)) { + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 591, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_5 == ((ev_tstamp)-1)) && PyErr_Occurred())) __PYX_ERR(0, 591, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_5; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0; + if (unlikely(type_dict_guard != tp_dict_version)) { + tp_dict_version = obj_dict_version = 0; + } + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + } + #endif + } + + __pyx_t_6 = __pyx_f_6gevent_5libev_8corecext__check_loop(__pyx_v_self); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 592, __pyx_L1_error) + + __pyx_r = ev_now(__pyx_v_self->_ptr); + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("gevent.libev.corecext.loop.now", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_27now(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_27now(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("now (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_26now(((struct PyGeventLoopObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_26now(struct PyGeventLoopObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + ev_tstamp __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("now", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6gevent_5libev_8corecext_4loop_now(__pyx_v_self, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 591, __pyx_L1_error) + __pyx_t_2 = PyFloat_FromDouble(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 591, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent.libev.corecext.loop.now", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_29update_now(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static void __pyx_f_6gevent_5libev_8corecext_4loop_update_now(struct PyGeventLoopObject *__pyx_v_self, int __pyx_skip_dispatch) { + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + __Pyx_RefNannySetupContext("update_now", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0; + if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self)))))); + else { + PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + #endif + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_update_now); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 595, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_5libev_8corecext_4loop_29update_now)) { + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 595, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0; + if (unlikely(type_dict_guard != tp_dict_version)) { + tp_dict_version = obj_dict_version = 0; + } + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + } + #endif + } + + __pyx_t_5 = __pyx_f_6gevent_5libev_8corecext__check_loop(__pyx_v_self); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 596, __pyx_L1_error) + + ev_now_update(__pyx_v_self->_ptr); + + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("gevent.libev.corecext.loop.update_now", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_L0:; + __Pyx_RefNannyFinishContext(); +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_29update_now(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_29update_now(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("update_now (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_28update_now(((struct PyGeventLoopObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_28update_now(struct PyGeventLoopObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("update_now", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_f_6gevent_5libev_8corecext_4loop_update_now(__pyx_v_self, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 595, __pyx_L1_error) + __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 595, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.libev.corecext.loop.update_now", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_31__repr__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_31__repr__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_30__repr__(((struct PyGeventLoopObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_30__repr__(struct PyGeventLoopObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + __Pyx_RefNannySetupContext("__repr__", 0); + + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 602, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 602, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 602, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 602, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + } + } + __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 602, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 602, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3); + __pyx_t_2 = 0; + __pyx_t_1 = 0; + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_s_at_0x_x_s_2, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 602, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("gevent.libev.corecext.loop.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_7default_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_7default_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_7default___get__(((struct PyGeventLoopObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_7default___get__(struct PyGeventLoopObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + __Pyx_XDECREF(__pyx_r); + if ((__pyx_v_self->_ptr != 0)) { + __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->_default); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 608, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __pyx_t_2; + __pyx_t_2 = 0; + } else { + __Pyx_INCREF(Py_False); + __pyx_t_1 = Py_False; + } + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent.libev.corecext.loop.default.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_9iteration_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_9iteration_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_9iteration___get__(((struct PyGeventLoopObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_9iteration___get__(struct PyGeventLoopObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + __pyx_t_1 = __pyx_f_6gevent_5libev_8corecext__check_loop(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 612, __pyx_L1_error) + + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_unsigned_int(ev_iteration(__pyx_v_self->_ptr)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 613, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent.libev.corecext.loop.iteration.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_5depth_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_5depth_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_5depth___get__(((struct PyGeventLoopObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_5depth___get__(struct PyGeventLoopObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + __pyx_t_1 = __pyx_f_6gevent_5libev_8corecext__check_loop(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 617, __pyx_L1_error) + + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_unsigned_int(ev_depth(__pyx_v_self->_ptr)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 618, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent.libev.corecext.loop.depth.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_11backend_int_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_11backend_int_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_11backend_int___get__(((struct PyGeventLoopObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_11backend_int___get__(struct PyGeventLoopObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + __pyx_t_1 = __pyx_f_6gevent_5libev_8corecext__check_loop(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 622, __pyx_L1_error) + + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_unsigned_int(ev_backend(__pyx_v_self->_ptr)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 623, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent.libev.corecext.loop.backend_int.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_7backend_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_7backend_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_7backend___get__(((struct PyGeventLoopObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_7backend___get__(struct PyGeventLoopObject *__pyx_v_self) { + unsigned int __pyx_v_backend; + PyObject *__pyx_v_key = NULL; + PyObject *__pyx_v_value = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + Py_ssize_t __pyx_t_4; + PyObject *(*__pyx_t_5)(PyObject *); + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *(*__pyx_t_9)(PyObject *); + __Pyx_RefNannySetupContext("__get__", 0); + + __pyx_t_1 = __pyx_f_6gevent_5libev_8corecext__check_loop(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 627, __pyx_L1_error) + + __pyx_v_backend = ev_backend(__pyx_v_self->_ptr); + + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_flags); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 629, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) { + __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0; + __pyx_t_5 = NULL; + } else { + __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 629, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 629, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + for (;;) { + if (likely(!__pyx_t_5)) { + if (likely(PyList_CheckExact(__pyx_t_3))) { + if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 629, __pyx_L1_error) + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 629, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + #endif + } else { + if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 629, __pyx_L1_error) + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 629, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + #endif + } + } else { + __pyx_t_2 = __pyx_t_5(__pyx_t_3); + if (unlikely(!__pyx_t_2)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(0, 629, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_2); + } + if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) { + PyObject* sequence = __pyx_t_2; + Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + __PYX_ERR(0, 629, __pyx_L1_error) + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_6 = PyList_GET_ITEM(sequence, 0); + __pyx_t_7 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(__pyx_t_7); + #else + __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 629, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 629, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + #endif + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_8 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 629, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_9 = Py_TYPE(__pyx_t_8)->tp_iternext; + index = 0; __pyx_t_6 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed; + __Pyx_GOTREF(__pyx_t_6); + index = 1; __pyx_t_7 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_7)) goto __pyx_L5_unpacking_failed; + __Pyx_GOTREF(__pyx_t_7); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 2) < 0) __PYX_ERR(0, 629, __pyx_L1_error) + __pyx_t_9 = NULL; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + goto __pyx_L6_unpacking_done; + __pyx_L5_unpacking_failed:; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_9 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + __PYX_ERR(0, 629, __pyx_L1_error) + __pyx_L6_unpacking_done:; + } + __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_6); + __pyx_t_6 = 0; + __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_7); + __pyx_t_7 = 0; + + __pyx_t_2 = __Pyx_PyInt_From_unsigned_int(__pyx_v_backend); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 630, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_7 = PyObject_RichCompare(__pyx_v_key, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 630, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 630, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (__pyx_t_1) { + + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_value); + __pyx_r = __pyx_v_value; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L0; + + } + + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyInt_From_unsigned_int(__pyx_v_backend); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 632, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("gevent.libev.corecext.loop.backend.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_key); + __Pyx_XDECREF(__pyx_v_value); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_10pendingcnt_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_10pendingcnt_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_10pendingcnt___get__(((struct PyGeventLoopObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_10pendingcnt___get__(struct PyGeventLoopObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + __pyx_t_1 = __pyx_f_6gevent_5libev_8corecext__check_loop(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 636, __pyx_L1_error) + + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_unsigned_int(ev_pending_count(__pyx_v_self->_ptr)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 637, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent.libev.corecext.loop.pendingcnt.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_33io(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_33io(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + vfd_socket_t __pyx_v_fd; + int __pyx_v_events; + PyObject *__pyx_v_ref = 0; + PyObject *__pyx_v_priority = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("io (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_fd,&__pyx_n_s_events_2,&__pyx_n_s_ref,&__pyx_n_s_priority,0}; + PyObject* values[4] = {0,0,0,0}; + values[2] = ((PyObject *)Py_True); + values[3] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_fd)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_events_2)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("io", 0, 2, 4, 1); __PYX_ERR(0, 639, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ref); + if (value) { values[2] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 3: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_priority); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "io") < 0)) __PYX_ERR(0, 639, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_fd = __Pyx_PyIndex_AsSsize_t(values[0]); if (unlikely((__pyx_v_fd == ((vfd_socket_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 639, __pyx_L3_error) + __pyx_v_events = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_events == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 639, __pyx_L3_error) + __pyx_v_ref = values[2]; + __pyx_v_priority = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("io", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 639, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.libev.corecext.loop.io", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_32io(((struct PyGeventLoopObject *)__pyx_v_self), __pyx_v_fd, __pyx_v_events, __pyx_v_ref, __pyx_v_priority); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_32io(struct PyGeventLoopObject *__pyx_v_self, vfd_socket_t __pyx_v_fd, int __pyx_v_events, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("io", 0); + + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_fd); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 640, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_events); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 640, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 640, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2); + __Pyx_INCREF(__pyx_v_ref); + __Pyx_GIVEREF(__pyx_v_ref); + PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_v_ref); + __Pyx_INCREF(__pyx_v_priority); + __Pyx_GIVEREF(__pyx_v_priority); + PyTuple_SET_ITEM(__pyx_t_3, 4, __pyx_v_priority); + __pyx_t_1 = 0; + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6gevent_5libev_8corecext_io), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 640, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("gevent.libev.corecext.loop.io", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_35timer(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_35timer(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + double __pyx_v_after; + double __pyx_v_repeat; + PyObject *__pyx_v_ref = 0; + PyObject *__pyx_v_priority = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("timer (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_after,&__pyx_n_s_repeat,&__pyx_n_s_ref,&__pyx_n_s_priority,0}; + PyObject* values[4] = {0,0,0,0}; + values[2] = ((PyObject *)Py_True); + values[3] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_after)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_repeat); + if (value) { values[1] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 2: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ref); + if (value) { values[2] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 3: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_priority); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "timer") < 0)) __PYX_ERR(0, 642, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_after = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_after == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 642, __pyx_L3_error) + if (values[1]) { + __pyx_v_repeat = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_repeat == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 642, __pyx_L3_error) + } else { + __pyx_v_repeat = ((double)0.0); + } + __pyx_v_ref = values[2]; + __pyx_v_priority = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("timer", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 642, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.libev.corecext.loop.timer", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_34timer(((struct PyGeventLoopObject *)__pyx_v_self), __pyx_v_after, __pyx_v_repeat, __pyx_v_ref, __pyx_v_priority); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_34timer(struct PyGeventLoopObject *__pyx_v_self, double __pyx_v_after, double __pyx_v_repeat, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("timer", 0); + + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyFloat_FromDouble(__pyx_v_after); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 643, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_repeat); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 643, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 643, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2); + __Pyx_INCREF(__pyx_v_ref); + __Pyx_GIVEREF(__pyx_v_ref); + PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_v_ref); + __Pyx_INCREF(__pyx_v_priority); + __Pyx_GIVEREF(__pyx_v_priority); + PyTuple_SET_ITEM(__pyx_t_3, 4, __pyx_v_priority); + __pyx_t_1 = 0; + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6gevent_5libev_8corecext_timer), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 643, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("gevent.libev.corecext.loop.timer", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_37signal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_37signal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + int __pyx_v_signum; + PyObject *__pyx_v_ref = 0; + PyObject *__pyx_v_priority = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("signal (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_signum,&__pyx_n_s_ref,&__pyx_n_s_priority,0}; + PyObject* values[3] = {0,0,0}; + values[1] = ((PyObject *)Py_True); + values[2] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_signum)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ref); + if (value) { values[1] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 2: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_priority); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "signal") < 0)) __PYX_ERR(0, 645, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_signum = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_signum == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 645, __pyx_L3_error) + __pyx_v_ref = values[1]; + __pyx_v_priority = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("signal", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 645, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.libev.corecext.loop.signal", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_36signal(((struct PyGeventLoopObject *)__pyx_v_self), __pyx_v_signum, __pyx_v_ref, __pyx_v_priority); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_36signal(struct PyGeventLoopObject *__pyx_v_self, int __pyx_v_signum, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("signal", 0); + + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_signum); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 646, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 646, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1); + __Pyx_INCREF(__pyx_v_ref); + __Pyx_GIVEREF(__pyx_v_ref); + PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_ref); + __Pyx_INCREF(__pyx_v_priority); + __Pyx_GIVEREF(__pyx_v_priority); + PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_v_priority); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6gevent_5libev_8corecext_signal), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 646, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent.libev.corecext.loop.signal", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_39idle(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_39idle(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_ref = 0; + PyObject *__pyx_v_priority = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("idle (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ref,&__pyx_n_s_priority,0}; + PyObject* values[2] = {0,0}; + values[0] = ((PyObject *)Py_True); + values[1] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ref); + if (value) { values[0] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 1: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_priority); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "idle") < 0)) __PYX_ERR(0, 648, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_ref = values[0]; + __pyx_v_priority = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("idle", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 648, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.libev.corecext.loop.idle", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_38idle(((struct PyGeventLoopObject *)__pyx_v_self), __pyx_v_ref, __pyx_v_priority); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_38idle(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("idle", 0); + + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 649, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self)); + __Pyx_INCREF(__pyx_v_ref); + __Pyx_GIVEREF(__pyx_v_ref); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_ref); + __Pyx_INCREF(__pyx_v_priority); + __Pyx_GIVEREF(__pyx_v_priority); + PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_priority); + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6gevent_5libev_8corecext_idle), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 649, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent.libev.corecext.loop.idle", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_41prepare(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_41prepare(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_ref = 0; + PyObject *__pyx_v_priority = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("prepare (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ref,&__pyx_n_s_priority,0}; + PyObject* values[2] = {0,0}; + values[0] = ((PyObject *)Py_True); + values[1] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ref); + if (value) { values[0] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 1: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_priority); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "prepare") < 0)) __PYX_ERR(0, 651, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_ref = values[0]; + __pyx_v_priority = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("prepare", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 651, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.libev.corecext.loop.prepare", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_40prepare(((struct PyGeventLoopObject *)__pyx_v_self), __pyx_v_ref, __pyx_v_priority); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_40prepare(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("prepare", 0); + + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 652, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self)); + __Pyx_INCREF(__pyx_v_ref); + __Pyx_GIVEREF(__pyx_v_ref); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_ref); + __Pyx_INCREF(__pyx_v_priority); + __Pyx_GIVEREF(__pyx_v_priority); + PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_priority); + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6gevent_5libev_8corecext_prepare), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 652, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent.libev.corecext.loop.prepare", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_43check(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_43check(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_ref = 0; + PyObject *__pyx_v_priority = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("check (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ref,&__pyx_n_s_priority,0}; + PyObject* values[2] = {0,0}; + values[0] = ((PyObject *)Py_True); + values[1] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ref); + if (value) { values[0] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 1: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_priority); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "check") < 0)) __PYX_ERR(0, 654, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_ref = values[0]; + __pyx_v_priority = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("check", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 654, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.libev.corecext.loop.check", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_42check(((struct PyGeventLoopObject *)__pyx_v_self), __pyx_v_ref, __pyx_v_priority); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_42check(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("check", 0); + + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 655, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self)); + __Pyx_INCREF(__pyx_v_ref); + __Pyx_GIVEREF(__pyx_v_ref); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_ref); + __Pyx_INCREF(__pyx_v_priority); + __Pyx_GIVEREF(__pyx_v_priority); + PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_priority); + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6gevent_5libev_8corecext_check), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 655, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent.libev.corecext.loop.check", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_45fork(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_45fork(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_ref = 0; + PyObject *__pyx_v_priority = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("fork (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ref,&__pyx_n_s_priority,0}; + PyObject* values[2] = {0,0}; + values[0] = ((PyObject *)Py_True); + values[1] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ref); + if (value) { values[0] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 1: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_priority); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "fork") < 0)) __PYX_ERR(0, 657, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_ref = values[0]; + __pyx_v_priority = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("fork", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 657, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.libev.corecext.loop.fork", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_44fork(((struct PyGeventLoopObject *)__pyx_v_self), __pyx_v_ref, __pyx_v_priority); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_44fork(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("fork", 0); + + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 658, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self)); + __Pyx_INCREF(__pyx_v_ref); + __Pyx_GIVEREF(__pyx_v_ref); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_ref); + __Pyx_INCREF(__pyx_v_priority); + __Pyx_GIVEREF(__pyx_v_priority); + PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_priority); + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6gevent_5libev_8corecext_fork), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 658, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent.libev.corecext.loop.fork", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_47async_(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_47async_(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_ref = 0; + PyObject *__pyx_v_priority = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("async_ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ref,&__pyx_n_s_priority,0}; + PyObject* values[2] = {0,0}; + values[0] = ((PyObject *)Py_True); + values[1] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ref); + if (value) { values[0] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 1: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_priority); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "async_") < 0)) __PYX_ERR(0, 660, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_ref = values[0]; + __pyx_v_priority = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("async_", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 660, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.libev.corecext.loop.async_", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_46async_(((struct PyGeventLoopObject *)__pyx_v_self), __pyx_v_ref, __pyx_v_priority); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_46async_(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("async_", 0); + + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 661, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self)); + __Pyx_INCREF(__pyx_v_ref); + __Pyx_GIVEREF(__pyx_v_ref); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_ref); + __Pyx_INCREF(__pyx_v_priority); + __Pyx_GIVEREF(__pyx_v_priority); + PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_priority); + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6gevent_5libev_8corecext_async_), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 661, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent.libev.corecext.loop.async_", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_49child(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_49child(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + int __pyx_v_pid; + int __pyx_v_trace; + PyObject *__pyx_v_ref = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("child (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pid,&__pyx_n_s_trace,&__pyx_n_s_ref,0}; + PyObject* values[3] = {0,0,0}; + values[2] = ((PyObject *)Py_True); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pid)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_trace); + if (value) { values[1] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 2: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ref); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "child") < 0)) __PYX_ERR(0, 666, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_pid = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_pid == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 666, __pyx_L3_error) + if (values[1]) { + __pyx_v_trace = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_trace == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 666, __pyx_L3_error) + } else { + __pyx_v_trace = ((int)0); + } + __pyx_v_ref = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("child", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 666, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.libev.corecext.loop.child", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_48child(((struct PyGeventLoopObject *)__pyx_v_self), __pyx_v_pid, __pyx_v_trace, __pyx_v_ref); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_48child(struct PyGeventLoopObject *__pyx_v_self, int __pyx_v_pid, int __pyx_v_trace, PyObject *__pyx_v_ref) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + __Pyx_RefNannySetupContext("child", 0); + + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_sys); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 667, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_platform); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 667, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_t_2, __pyx_n_s_win32, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 667, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(__pyx_t_3)) { + + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_AttributeError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 668, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 668, __pyx_L1_error) + + } + + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_pid); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 669, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_trace); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 669, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = PyTuple_New(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 669, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_1); + __Pyx_INCREF(__pyx_v_ref); + __Pyx_GIVEREF(__pyx_v_ref); + PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_v_ref); + __pyx_t_2 = 0; + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6gevent_5libev_8corecext_child), __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 669, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("gevent.libev.corecext.loop.child", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_51install_sigchld(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_51install_sigchld(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("install_sigchld (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_50install_sigchld(((struct PyGeventLoopObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_50install_sigchld(CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("install_sigchld", 0); + + gevent_install_sigchld_handler(); + + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_53reset_sigchld(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_53reset_sigchld(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("reset_sigchld (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_52reset_sigchld(((struct PyGeventLoopObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_52reset_sigchld(CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("reset_sigchld", 0); + + gevent_reset_sigchld_handler(); + + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_55stat(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_55stat(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_path = 0; + float __pyx_v_interval; + PyObject *__pyx_v_ref = 0; + PyObject *__pyx_v_priority = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stat (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_path,&__pyx_n_s_interval,&__pyx_n_s_ref,&__pyx_n_s_priority,0}; + PyObject* values[4] = {0,0,0,0}; + values[2] = ((PyObject *)Py_True); + values[3] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_path)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_interval); + if (value) { values[1] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 2: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ref); + if (value) { values[2] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 3: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_priority); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stat") < 0)) __PYX_ERR(0, 677, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_path = ((PyObject*)values[0]); + if (values[1]) { + __pyx_v_interval = __pyx_PyFloat_AsFloat(values[1]); if (unlikely((__pyx_v_interval == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 677, __pyx_L3_error) + } else { + __pyx_v_interval = ((float)0.0); + } + __pyx_v_ref = values[2]; + __pyx_v_priority = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("stat", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 677, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.libev.corecext.loop.stat", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_path), (&PyString_Type), 1, "path", 1))) __PYX_ERR(0, 677, __pyx_L1_error) + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_54stat(((struct PyGeventLoopObject *)__pyx_v_self), __pyx_v_path, __pyx_v_interval, __pyx_v_ref, __pyx_v_priority); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_54stat(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_path, float __pyx_v_interval, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("stat", 0); + + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyFloat_FromDouble(__pyx_v_interval); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 678, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 678, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self)); + __Pyx_INCREF(__pyx_v_path); + __Pyx_GIVEREF(__pyx_v_path); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_path); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_1); + __Pyx_INCREF(__pyx_v_ref); + __Pyx_GIVEREF(__pyx_v_ref); + PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_v_ref); + __Pyx_INCREF(__pyx_v_priority); + __Pyx_GIVEREF(__pyx_v_priority); + PyTuple_SET_ITEM(__pyx_t_2, 4, __pyx_v_priority); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6gevent_5libev_8corecext_stat), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 678, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent.libev.corecext.loop.stat", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_57run_callback(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_57run_callback(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_func = 0; + PyObject *__pyx_v_args = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("run_callback (wrapper)", 0); + if (PyTuple_GET_SIZE(__pyx_args) > 1) { + __pyx_v_args = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args)); + if (unlikely(!__pyx_v_args)) { + __Pyx_RefNannyFinishContext(); + return NULL; + } + __Pyx_GOTREF(__pyx_v_args); + } else { + __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple); + } + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_func,0}; + PyObject* values[1] = {0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + default: + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_func)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "run_callback") < 0)) __PYX_ERR(0, 680, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) < 1) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + } + __pyx_v_func = values[0]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("run_callback", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 680, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0; + __Pyx_AddTraceback("gevent.libev.corecext.loop.run_callback", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_56run_callback(((struct PyGeventLoopObject *)__pyx_v_self), __pyx_v_func, __pyx_v_args); + + /* function exit code */ + __Pyx_XDECREF(__pyx_v_args); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_56run_callback(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_func, PyObject *__pyx_v_args) { + struct PyGeventCallbackObject *__pyx_v_cb = 0; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("run_callback", 0); + + __pyx_t_1 = __pyx_f_6gevent_5libev_8corecext__check_loop(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 681, __pyx_L1_error) + + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 682, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_func); + __Pyx_GIVEREF(__pyx_v_func); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_func); + __Pyx_INCREF(__pyx_v_args); + __Pyx_GIVEREF(__pyx_v_args); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_args); + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6gevent_5libev_8corecext_callback), __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 682, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_cb = ((struct PyGeventCallbackObject *)__pyx_t_3); + __pyx_t_3 = 0; + + __pyx_t_3 = __pyx_f_6gevent_5libev_8corecext_12CallbackFIFO_append(__pyx_v_self->_callbacks, __pyx_v_cb); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 683, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + ev_ref(__pyx_v_self->_ptr); + + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_cb)); + __pyx_r = ((PyObject *)__pyx_v_cb); + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("gevent.libev.corecext.loop.run_callback", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_cb); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_59_format(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_59_format(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_format (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_58_format(((struct PyGeventLoopObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_58_format(struct PyGeventLoopObject *__pyx_v_self) { + PyObject *__pyx_v_msg = 0; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + __Pyx_RefNannySetupContext("_format", 0); + + __pyx_t_1 = ((!(__pyx_v_self->_ptr != 0)) != 0); + if (__pyx_t_1) { + + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_n_s_destroyed); + __pyx_r = __pyx_n_s_destroyed; + goto __pyx_L0; + + } + + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_backend); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 690, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_msg = __pyx_t_2; + __pyx_t_2 = 0; + + __pyx_t_1 = (__pyx_v_self->_default != 0); + if (__pyx_t_1) { + + __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_msg, __pyx_kp_s_default_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 692, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF_SET(__pyx_v_msg, __pyx_t_2); + __pyx_t_2 = 0; + + } + + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_pendingcnt); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 693, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyString_FormatSafe(__pyx_kp_s_pending_s, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 693, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_msg, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 693, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF_SET(__pyx_v_msg, __pyx_t_2); + __pyx_t_2 = 0; + + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_format_details); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 694, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 694, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_msg, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 694, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF_SET(__pyx_v_msg, __pyx_t_3); + __pyx_t_3 = 0; + + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_msg); + __pyx_r = __pyx_v_msg; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("gevent.libev.corecext.loop._format", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_msg); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_61_format_details(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_61_format_details(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_format_details (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_60_format_details(((struct PyGeventLoopObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_60_format_details(struct PyGeventLoopObject *__pyx_v_self) { + PyObject *__pyx_v_msg = 0; + PyObject *__pyx_v_fileno = 0; + PyObject *__pyx_v_activecnt = 0; + CYTHON_UNUSED PyObject *__pyx_v_sigfd = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + int __pyx_t_8; + int __pyx_t_9; + __Pyx_RefNannySetupContext("_format_details", 0); + + __Pyx_INCREF(__pyx_kp_s__7); + __pyx_v_msg = __pyx_kp_s__7; + + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_fileno); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 699, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 699, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_fileno = __pyx_t_1; + __pyx_t_1 = 0; + + __Pyx_INCREF(Py_None); + __pyx_v_activecnt = Py_None; + + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6); + __Pyx_XGOTREF(__pyx_t_4); + __Pyx_XGOTREF(__pyx_t_5); + __Pyx_XGOTREF(__pyx_t_6); + /*try:*/ { + + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_sigfd); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 702, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_sigfd = __pyx_t_1; + __pyx_t_1 = 0; + + } + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L8_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + + __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_AttributeError); + if (__pyx_t_7) { + __Pyx_AddTraceback("gevent.libev.corecext.loop._format_details", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3) < 0) __PYX_ERR(0, 703, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_t_3); + + __Pyx_INCREF(Py_None); + __Pyx_XDECREF_SET(__pyx_v_sigfd, Py_None); + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6); + goto __pyx_L1_error; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6); + __pyx_L8_try_end:; + } + + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4); + __Pyx_XGOTREF(__pyx_t_6); + __Pyx_XGOTREF(__pyx_t_5); + __Pyx_XGOTREF(__pyx_t_4); + /*try:*/ { + + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_activecnt); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 706, __pyx_L11_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF_SET(__pyx_v_activecnt, __pyx_t_3); + __pyx_t_3 = 0; + + } + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L16_try_end; + __pyx_L11_error:; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + + __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_AttributeError); + if (__pyx_t_7) { + __Pyx_ErrRestore(0,0,0); + goto __pyx_L12_exception_handled; + } + goto __pyx_L13_except_error; + __pyx_L13_except_error:; + + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_5, __pyx_t_4); + goto __pyx_L1_error; + __pyx_L12_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_5, __pyx_t_4); + __pyx_L16_try_end:; + } + + __pyx_t_8 = (__pyx_v_activecnt != Py_None); + __pyx_t_9 = (__pyx_t_8 != 0); + if (__pyx_t_9) { + + __pyx_t_3 = PyObject_Repr(__pyx_v_activecnt); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 710, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyNumber_Add(__pyx_kp_s_ref_2, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 710, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_msg, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 710, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF_SET(__pyx_v_msg, ((PyObject*)__pyx_t_3)); + __pyx_t_3 = 0; + + } + + __pyx_t_9 = (__pyx_v_fileno != Py_None); + __pyx_t_8 = (__pyx_t_9 != 0); + if (__pyx_t_8) { + + __pyx_t_3 = PyObject_Repr(__pyx_v_fileno); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 712, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyNumber_Add(__pyx_kp_s_fileno_2, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 712, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_msg, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 712, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF_SET(__pyx_v_msg, ((PyObject*)__pyx_t_3)); + __pyx_t_3 = 0; + + } + + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_msg); + __pyx_r = __pyx_v_msg; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("gevent.libev.corecext.loop._format_details", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_msg); + __Pyx_XDECREF(__pyx_v_fileno); + __Pyx_XDECREF(__pyx_v_activecnt); + __Pyx_XDECREF(__pyx_v_sigfd); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_63fileno(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_63fileno(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("fileno (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_62fileno(((struct PyGeventLoopObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_62fileno(struct PyGeventLoopObject *__pyx_v_self) { + int __pyx_v_fd; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("fileno", 0); + + __pyx_t_1 = (__pyx_v_self->_ptr != 0); + if (__pyx_t_1) { + + __pyx_v_fd = gevent_ev_loop_backend_fd(__pyx_v_self->_ptr); + + __pyx_t_1 = ((__pyx_v_fd >= 0) != 0); + if (__pyx_t_1) { + + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_fd); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 720, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + } + + } + + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent.libev.corecext.loop.fileno", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_9activecnt_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_9activecnt_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_9activecnt___get__(((struct PyGeventLoopObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_9activecnt___get__(struct PyGeventLoopObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + __pyx_t_1 = __pyx_f_6gevent_5libev_8corecext__check_loop(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 724, __pyx_L1_error) + + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(gevent_ev_loop_activecnt(__pyx_v_self->_ptr)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 725, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent.libev.corecext.loop.activecnt.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_11sig_pending_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_11sig_pending_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_11sig_pending___get__(((struct PyGeventLoopObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_11sig_pending___get__(struct PyGeventLoopObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + __pyx_t_1 = __pyx_f_6gevent_5libev_8corecext__check_loop(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 729, __pyx_L1_error) + + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(gevent_ev_loop_sig_pending(__pyx_v_self->_ptr)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 730, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent.libev.corecext.loop.sig_pending.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_9origflags_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_9origflags_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_9origflags___get__(((struct PyGeventLoopObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_9origflags___get__(struct PyGeventLoopObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + unsigned int __pyx_t_2; + __Pyx_RefNannySetupContext("__get__", 0); + + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_origflags_int); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 734, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyInt_As_unsigned_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 734, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __pyx_f_6gevent_5libev_8corecext__flags_to_list(__pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 734, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.libev.corecext.loop.origflags.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_13origflags_int_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_13origflags_int_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_13origflags_int___get__(((struct PyGeventLoopObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_13origflags_int___get__(struct PyGeventLoopObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + __pyx_t_1 = __pyx_f_6gevent_5libev_8corecext__check_loop(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 738, __pyx_L1_error) + + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_unsigned_int(gevent_ev_loop_origflags(__pyx_v_self->_ptr)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 739, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent.libev.corecext.loop.origflags_int.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_5sigfd_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_5sigfd_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_5sigfd___get__(((struct PyGeventLoopObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_5sigfd___get__(struct PyGeventLoopObject *__pyx_v_self) { + int __pyx_v_fd; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + __pyx_t_1 = __pyx_f_6gevent_5libev_8corecext__check_loop(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 743, __pyx_L1_error) + + __pyx_v_fd = gevent_ev_loop_sigfd(__pyx_v_self->_ptr); + + __pyx_t_1 = ((__pyx_v_fd >= 0) != 0); + if (__pyx_t_1) { + + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_fd); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 746, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + } + + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_AttributeError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 749, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 749, __pyx_L1_error) + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent.libev.corecext.loop.sigfd.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_13error_handler_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_13error_handler_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_13error_handler___get__(((struct PyGeventLoopObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_13error_handler___get__(struct PyGeventLoopObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->error_handler); + __pyx_r = __pyx_v_self->error_handler; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_4loop_13error_handler_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_4loop_13error_handler_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_13error_handler_2__set__(((struct PyGeventLoopObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_4loop_13error_handler_2__set__(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__", 0); + __Pyx_INCREF(__pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + __Pyx_GOTREF(__pyx_v_self->error_handler); + __Pyx_DECREF(__pyx_v_self->error_handler); + __pyx_v_self->error_handler = __pyx_v_value; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_4loop_13error_handler_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_4loop_13error_handler_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_13error_handler_4__del__(((struct PyGeventLoopObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_4loop_13error_handler_4__del__(struct PyGeventLoopObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->error_handler); + __Pyx_DECREF(__pyx_v_self->error_handler); + __pyx_v_self->error_handler = Py_None; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_10_callbacks_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_10_callbacks_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_10_callbacks___get__(((struct PyGeventLoopObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_10_callbacks___get__(struct PyGeventLoopObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_self->_callbacks)); + __pyx_r = ((PyObject *)__pyx_v_self->_callbacks); + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_4loop_10_callbacks_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_4loop_10_callbacks_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_10_callbacks_2__set__(((struct PyGeventLoopObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_4loop_10_callbacks_2__set__(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__set__", 0); + if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_6gevent_5libev_8corecext_CallbackFIFO))))) __PYX_ERR(0, 386, __pyx_L1_error) + __pyx_t_1 = __pyx_v_value; + __Pyx_INCREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_self->_callbacks); + __Pyx_DECREF(((PyObject *)__pyx_v_self->_callbacks)); + __pyx_v_self->_callbacks = ((struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *)__pyx_t_1); + __pyx_t_1 = 0; + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.libev.corecext.loop._callbacks.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_4loop_10_callbacks_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_4loop_10_callbacks_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_10_callbacks_4__del__(((struct PyGeventLoopObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_4loop_10_callbacks_4__del__(struct PyGeventLoopObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->_callbacks); + __Pyx_DECREF(((PyObject *)__pyx_v_self->_callbacks)); + __pyx_v_self->_callbacks = ((struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *)Py_None); + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_23approx_timer_resolution_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_23approx_timer_resolution_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_23approx_timer_resolution___get__(((struct PyGeventLoopObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_23approx_timer_resolution___get__(struct PyGeventLoopObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->approx_timer_resolution); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 395, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.libev.corecext.loop.approx_timer_resolution.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +static void __pyx_f_6gevent_5libev_8corecext__python_incref(struct PyGeventWatcherObject *__pyx_v_self) { + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("_python_incref", 0); + + __pyx_t_1 = ((!((__pyx_v_self->_flags & 1) != 0)) != 0); + if (__pyx_t_1) { + + Py_INCREF(((PyObject *)__pyx_v_self)); + + __pyx_v_self->_flags = (__pyx_v_self->_flags | 1); + + } + + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + + +static void __pyx_f_6gevent_5libev_8corecext__python_decref(struct PyGeventWatcherObject *__pyx_v_self) { + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("_python_decref", 0); + + __pyx_t_1 = ((__pyx_v_self->_flags & 1) != 0); + if (__pyx_t_1) { + + Py_DECREF(((PyObject *)__pyx_v_self)); + + __pyx_v_self->_flags = (__pyx_v_self->_flags & (~1)); + + } + + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + + +static void __pyx_f_6gevent_5libev_8corecext__libev_ref(struct PyGeventWatcherObject *__pyx_v_self) { + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("_libev_ref", 0); + + __pyx_t_1 = ((__pyx_v_self->_flags & 2) != 0); + if (__pyx_t_1) { + + ev_ref(__pyx_v_self->loop->_ptr); + + __pyx_v_self->_flags = (__pyx_v_self->_flags & (~2)); + + } + + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + + +static void __pyx_f_6gevent_5libev_8corecext__libev_unref(struct PyGeventWatcherObject *__pyx_v_self) { + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("_libev_unref", 0); + + __pyx_t_1 = (((__pyx_v_self->_flags & 6) == 4) != 0); + if (__pyx_t_1) { + + ev_unref(__pyx_v_self->loop->_ptr); + + __pyx_v_self->_flags = (__pyx_v_self->_flags | 2); + + } + + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + + +static struct __pyx_t_6gevent_5libev_8corecext_start_and_stop __pyx_f_6gevent_5libev_8corecext_make_ss(void *__pyx_v_start, void *__pyx_v_stop) { + struct __pyx_t_6gevent_5libev_8corecext_start_and_stop __pyx_v_result; + struct __pyx_t_6gevent_5libev_8corecext_start_and_stop __pyx_r; + __Pyx_RefNannyDeclarations + struct __pyx_t_6gevent_5libev_8corecext_start_and_stop __pyx_t_1; + __Pyx_RefNannySetupContext("make_ss", 0); + + __pyx_t_1.start = ((__pyx_t_6gevent_5libev_8corecext_start_stop_func)__pyx_v_start); + __pyx_t_1.stop = ((__pyx_t_6gevent_5libev_8corecext_start_stop_func)__pyx_v_stop); + __pyx_v_result = __pyx_t_1; + + __pyx_r = __pyx_v_result; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +static int __pyx_f_6gevent_5libev_8corecext__watcher_start(struct PyGeventWatcherObject *__pyx_v_self, PyObject *__pyx_v_callback, PyObject *__pyx_v_args) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + __Pyx_RefNannySetupContext("_watcher_start", 0); + + __pyx_t_1 = ((PyObject *)__pyx_v_self->loop); + __Pyx_INCREF(__pyx_t_1); + __pyx_t_2 = __pyx_f_6gevent_5libev_8corecext__check_loop(((struct PyGeventLoopObject *)__pyx_t_1)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 817, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + __pyx_t_3 = (__pyx_v_callback == Py_None); + __pyx_t_4 = (__pyx_t_3 != 0); + if (!__pyx_t_4) { + } else { + __pyx_t_2 = __pyx_t_4; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_4 = __Pyx_PyCallable_Check(__pyx_v_callback); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 818, __pyx_L1_error) + __pyx_t_3 = ((!(__pyx_t_4 != 0)) != 0); + __pyx_t_2 = __pyx_t_3; + __pyx_L4_bool_binop_done:; + if (unlikely(__pyx_t_2)) { + + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 819, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_callback); + __Pyx_GIVEREF(__pyx_v_callback); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_callback); + __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_Expected_callable_not_r, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 819, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 819, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 819, __pyx_L1_error) + + } + + __Pyx_INCREF(__pyx_v_callback); + __Pyx_GIVEREF(__pyx_v_callback); + __Pyx_GOTREF(__pyx_v_self->_callback); + __Pyx_DECREF(__pyx_v_self->_callback); + __pyx_v_self->_callback = __pyx_v_callback; + + __Pyx_INCREF(__pyx_v_args); + __Pyx_GIVEREF(__pyx_v_args); + __Pyx_GOTREF(__pyx_v_self->args); + __Pyx_DECREF(__pyx_v_self->args); + __pyx_v_self->args = __pyx_v_args; + + __pyx_f_6gevent_5libev_8corecext__libev_unref(__pyx_v_self); + + __pyx_f_6gevent_5libev_8corecext__python_incref(__pyx_v_self); + + __pyx_v_self->__pyx___ss->start(__pyx_v_self->loop->_ptr, __pyx_v_self->__pyx___watcher); + + __pyx_r = 1; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("gevent.libev.corecext._watcher_start", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_7watcher_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_7watcher_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + struct PyGeventLoopObject *__pyx_v_loop = 0; + PyObject *__pyx_v_ref = 0; + PyObject *__pyx_v_priority = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_loop,&__pyx_n_s_ref,&__pyx_n_s_priority,0}; + PyObject* values[3] = {0,0,0}; + values[1] = ((PyObject *)Py_True); + values[2] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_loop)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ref); + if (value) { values[1] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 2: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_priority); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 872, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_loop = ((struct PyGeventLoopObject *)values[0]); + __pyx_v_ref = values[1]; + __pyx_v_priority = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 872, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.libev.corecext.watcher.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_loop), __pyx_ptype_6gevent_5libev_8corecext_loop, 1, "loop", 0))) __PYX_ERR(0, 872, __pyx_L1_error) + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_7watcher___init__(((struct PyGeventWatcherObject *)__pyx_v_self), __pyx_v_loop, __pyx_v_ref, __pyx_v_priority); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_7watcher___init__(struct PyGeventWatcherObject *__pyx_v_self, struct PyGeventLoopObject *__pyx_v_loop, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + unsigned int __pyx_t_4; + int __pyx_t_5; + __Pyx_RefNannySetupContext("__init__", 0); + + __pyx_t_2 = ((!(__pyx_v_self->__pyx___watcher != 0)) != 0); + if (!__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_2 = ((!(__pyx_v_self->__pyx___ss->start != 0)) != 0); + if (!__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_2 = ((!(__pyx_v_self->__pyx___ss->stop != 0)) != 0); + __pyx_t_1 = __pyx_t_2; + __pyx_L4_bool_binop_done:; + if (unlikely(__pyx_t_1)) { + + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 874, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(0, 874, __pyx_L1_error) + + } + + __Pyx_INCREF(((PyObject *)__pyx_v_loop)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_loop)); + __Pyx_GOTREF(__pyx_v_self->loop); + __Pyx_DECREF(((PyObject *)__pyx_v_self->loop)); + __pyx_v_self->loop = __pyx_v_loop; + + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_ref); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 876, __pyx_L1_error) + if (__pyx_t_1) { + __pyx_t_4 = 0; + } else { + __pyx_t_4 = 4; + } + __pyx_v_self->_flags = __pyx_t_4; + + __pyx_t_1 = (__pyx_v_priority != Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_v_priority); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 878, __pyx_L1_error) + ev_set_priority(__pyx_v_self->__pyx___watcher, __pyx_t_5); + + } + + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("gevent.libev.corecext.watcher.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_3ref_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_3ref_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_7watcher_3ref___get__(((struct PyGeventWatcherObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_7watcher_3ref___get__(struct PyGeventWatcherObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + __Pyx_XDECREF(__pyx_r); + if (((__pyx_v_self->_flags & 4) != 0)) { + __Pyx_INCREF(Py_False); + __pyx_t_1 = Py_False; + } else { + __Pyx_INCREF(Py_True); + __pyx_t_1 = Py_True; + } + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_7watcher_3ref_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_7watcher_3ref_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_7watcher_3ref_2__set__(((struct PyGeventWatcherObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_7watcher_3ref_2__set__(struct PyGeventWatcherObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + __Pyx_RefNannySetupContext("__set__", 0); + + __pyx_t_1 = ((PyObject *)__pyx_v_self->loop); + __Pyx_INCREF(__pyx_t_1); + __pyx_t_2 = __pyx_f_6gevent_5libev_8corecext__check_loop(((struct PyGeventLoopObject *)__pyx_t_1)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 886, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_value); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 887, __pyx_L1_error) + if (__pyx_t_2) { + + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_ref); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 889, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 889, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_2) { + + __pyx_r = 0; + goto __pyx_L0; + + } + + __pyx_t_2 = ((__pyx_v_self->_flags & 2) != 0); + if (__pyx_t_2) { + + ev_ref(__pyx_v_self->loop->_ptr); + + } + + __pyx_v_self->_flags = (__pyx_v_self->_flags & (~6)); + + goto __pyx_L3; + } + + /*else*/ { + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_ref); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 898, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 898, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = ((!__pyx_t_2) != 0); + if (__pyx_t_3) { + + __pyx_r = 0; + goto __pyx_L0; + + } + + __pyx_v_self->_flags = (__pyx_v_self->_flags | 4); + + __pyx_t_2 = ((!((__pyx_v_self->_flags & 2) != 0)) != 0); + if (__pyx_t_2) { + } else { + __pyx_t_3 = __pyx_t_2; + goto __pyx_L8_bool_binop_done; + } + __pyx_t_2 = (ev_is_active(__pyx_v_self->__pyx___watcher) != 0); + __pyx_t_3 = __pyx_t_2; + __pyx_L8_bool_binop_done:; + if (__pyx_t_3) { + + ev_unref(__pyx_v_self->loop->_ptr); + + __pyx_v_self->_flags = (__pyx_v_self->_flags | 2); + + } + } + __pyx_L3:; + + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.libev.corecext.watcher.ref.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_8callback_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_8callback_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_7watcher_8callback___get__(((struct PyGeventWatcherObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_7watcher_8callback___get__(struct PyGeventWatcherObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->_callback); + __pyx_r = __pyx_v_self->_callback; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_7watcher_8callback_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_callback); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_7watcher_8callback_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_callback) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_7watcher_8callback_2__set__(((struct PyGeventWatcherObject *)__pyx_v_self), ((PyObject *)__pyx_v_callback)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_7watcher_8callback_2__set__(struct PyGeventWatcherObject *__pyx_v_self, PyObject *__pyx_v_callback) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + __Pyx_RefNannySetupContext("__set__", 0); + + __pyx_t_2 = (__pyx_v_callback != Py_None); + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + } else { + __pyx_t_1 = __pyx_t_3; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_3 = __Pyx_PyCallable_Check(__pyx_v_callback); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 911, __pyx_L1_error) + __pyx_t_2 = ((!(__pyx_t_3 != 0)) != 0); + __pyx_t_1 = __pyx_t_2; + __pyx_L4_bool_binop_done:; + if (unlikely(__pyx_t_1)) { + + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 912, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_callback); + __Pyx_GIVEREF(__pyx_v_callback); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_callback); + __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_Expected_callable_not_r, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 912, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 912, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __PYX_ERR(0, 912, __pyx_L1_error) + + } + + __Pyx_INCREF(__pyx_v_callback); + __Pyx_GIVEREF(__pyx_v_callback); + __Pyx_GOTREF(__pyx_v_self->_callback); + __Pyx_DECREF(__pyx_v_self->_callback); + __pyx_v_self->_callback = __pyx_v_callback; + + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("gevent.libev.corecext.watcher.callback.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_8priority_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_8priority_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_7watcher_8priority___get__(((struct PyGeventWatcherObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_7watcher_8priority___get__(struct PyGeventWatcherObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_int(ev_priority(__pyx_v_self->__pyx___watcher)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 917, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.libev.corecext.watcher.priority.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_7watcher_8priority_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_priority); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_7watcher_8priority_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_priority) { + int __pyx_v_priority; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + assert(__pyx_arg_priority); { + __pyx_v_priority = __Pyx_PyInt_As_int(__pyx_arg_priority); if (unlikely((__pyx_v_priority == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 920, __pyx_L3_error) + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.libev.corecext.watcher.priority.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_7watcher_8priority_2__set__(((struct PyGeventWatcherObject *)__pyx_v_self), ((int)__pyx_v_priority)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_7watcher_8priority_2__set__(struct PyGeventWatcherObject *__pyx_v_self, int __pyx_v_priority) { + struct ev_watcher *__pyx_v_w; + int __pyx_r; + __Pyx_RefNannyDeclarations + struct ev_watcher *__pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("__set__", 0); + + __pyx_t_1 = __pyx_v_self->__pyx___watcher; + __pyx_v_w = __pyx_t_1; + + __pyx_t_2 = (ev_is_active(__pyx_v_w) != 0); + if (unlikely(__pyx_t_2)) { + + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_AttributeError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 923, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(0, 923, __pyx_L1_error) + + } + + ev_set_priority(__pyx_v_w, __pyx_v_priority); + + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("gevent.libev.corecext.watcher.priority.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_6active_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_6active_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_7watcher_6active___get__(((struct PyGeventWatcherObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_7watcher_6active___get__(struct PyGeventWatcherObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + __Pyx_XDECREF(__pyx_r); + if ((ev_is_active(__pyx_v_self->__pyx___watcher) != 0)) { + __Pyx_INCREF(Py_True); + __pyx_t_1 = Py_True; + } else { + __Pyx_INCREF(Py_False); + __pyx_t_1 = Py_False; + } + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_7pending_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_7pending_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_7watcher_7pending___get__(((struct PyGeventWatcherObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_7watcher_7pending___get__(struct PyGeventWatcherObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + __Pyx_XDECREF(__pyx_r); + if ((ev_is_pending(__pyx_v_self->__pyx___watcher) != 0)) { + __Pyx_INCREF(Py_True); + __pyx_t_1 = Py_True; + } else { + __Pyx_INCREF(Py_False); + __pyx_t_1 = Py_False; + } + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_3start(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_3start(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_callback = 0; + PyObject *__pyx_v_args = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("start (wrapper)", 0); + if (PyTuple_GET_SIZE(__pyx_args) > 1) { + __pyx_v_args = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args)); + if (unlikely(!__pyx_v_args)) { + __Pyx_RefNannyFinishContext(); + return NULL; + } + __Pyx_GOTREF(__pyx_v_args); + } else { + __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple); + } + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_callback,0}; + PyObject* values[1] = {0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + default: + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_callback)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "start") < 0)) __PYX_ERR(0, 934, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) < 1) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + } + __pyx_v_callback = values[0]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("start", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 934, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0; + __Pyx_AddTraceback("gevent.libev.corecext.watcher.start", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_7watcher_2start(((struct PyGeventWatcherObject *)__pyx_v_self), __pyx_v_callback, __pyx_v_args); + + /* function exit code */ + __Pyx_XDECREF(__pyx_v_args); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_7watcher_2start(struct PyGeventWatcherObject *__pyx_v_self, PyObject *__pyx_v_callback, PyObject *__pyx_v_args) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("start", 0); + + __pyx_t_1 = __pyx_f_6gevent_5libev_8corecext__watcher_start(__pyx_v_self, __pyx_v_callback, __pyx_v_args); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 935, __pyx_L1_error) + + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("gevent.libev.corecext.watcher.start", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_5stop(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_5stop(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stop (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_7watcher_4stop(((struct PyGeventWatcherObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_7watcher_4stop(struct PyGeventWatcherObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + __Pyx_RefNannySetupContext("stop", 0); + + __pyx_t_1 = ((PyObject *)__pyx_v_self->loop); + __Pyx_INCREF(__pyx_t_1); + __pyx_t_2 = __pyx_f_6gevent_5libev_8corecext__check_loop(((struct PyGeventLoopObject *)__pyx_t_1)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 938, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + __pyx_f_6gevent_5libev_8corecext__libev_ref(__pyx_v_self); + + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->_callback); + __Pyx_DECREF(__pyx_v_self->_callback); + __pyx_v_self->_callback = Py_None; + + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->args); + __Pyx_DECREF(__pyx_v_self->args); + __pyx_v_self->args = ((PyObject*)Py_None); + + __pyx_v_self->__pyx___ss->stop(__pyx_v_self->loop->_ptr, __pyx_v_self->__pyx___watcher); + + __pyx_f_6gevent_5libev_8corecext__python_decref(__pyx_v_self); + + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.libev.corecext.watcher.stop", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_7feed(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_7feed(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + int __pyx_v_revents; + PyObject *__pyx_v_callback = 0; + PyObject *__pyx_v_args = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("feed (wrapper)", 0); + if (PyTuple_GET_SIZE(__pyx_args) > 2) { + __pyx_v_args = PyTuple_GetSlice(__pyx_args, 2, PyTuple_GET_SIZE(__pyx_args)); + if (unlikely(!__pyx_v_args)) { + __Pyx_RefNannyFinishContext(); + return NULL; + } + __Pyx_GOTREF(__pyx_v_args); + } else { + __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple); + } + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_revents,&__pyx_n_s_callback,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + default: + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_revents)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_callback)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("feed", 0, 2, 2, 1); __PYX_ERR(0, 947, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t used_pos_args = (pos_args < 2) ? pos_args : 2; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "feed") < 0)) __PYX_ERR(0, 947, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) < 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_revents = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_revents == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 947, __pyx_L3_error) + __pyx_v_callback = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("feed", 0, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 947, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0; + __Pyx_AddTraceback("gevent.libev.corecext.watcher.feed", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_7watcher_6feed(((struct PyGeventWatcherObject *)__pyx_v_self), __pyx_v_revents, __pyx_v_callback, __pyx_v_args); + + /* function exit code */ + __Pyx_XDECREF(__pyx_v_args); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_7watcher_6feed(struct PyGeventWatcherObject *__pyx_v_self, int __pyx_v_revents, PyObject *__pyx_v_callback, PyObject *__pyx_v_args) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + __Pyx_RefNannySetupContext("feed", 0); + + __pyx_t_1 = ((PyObject *)__pyx_v_self->loop); + __Pyx_INCREF(__pyx_t_1); + __pyx_t_2 = __pyx_f_6gevent_5libev_8corecext__check_loop(((struct PyGeventLoopObject *)__pyx_t_1)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 948, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_callback, __pyx_v_callback) < 0) __PYX_ERR(0, 949, __pyx_L1_error) + + __Pyx_INCREF(__pyx_v_args); + __Pyx_GIVEREF(__pyx_v_args); + __Pyx_GOTREF(__pyx_v_self->args); + __Pyx_DECREF(__pyx_v_self->args); + __pyx_v_self->args = __pyx_v_args; + + __pyx_f_6gevent_5libev_8corecext__libev_unref(__pyx_v_self); + + ev_feed_event(__pyx_v_self->loop->_ptr, __pyx_v_self->__pyx___watcher, __pyx_v_revents); + + __pyx_f_6gevent_5libev_8corecext__python_incref(__pyx_v_self); + + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.libev.corecext.watcher.feed", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_9__repr__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_9__repr__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_7watcher_8__repr__(((struct PyGeventWatcherObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_7watcher_8__repr__(struct PyGeventWatcherObject *__pyx_v_self) { + PyObject *__pyx_v_format = NULL; + PyObject *__pyx_v_result = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + int __pyx_t_6; + int __pyx_t_7; + char const *__pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + PyObject *__pyx_t_14 = NULL; + __Pyx_RefNannySetupContext("__repr__", 0); + + __pyx_t_1 = ((Py_ReprEnter(((PyObject *)__pyx_v_self)) != 0) != 0); + if (__pyx_t_1) { + + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_kp_s__5); + __pyx_r = __pyx_kp_s__5; + goto __pyx_L0; + + } + + /*try:*/ { + + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 959, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 959, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_format = __pyx_t_2; + __pyx_t_2 = 0; + + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 960, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 960, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 960, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 960, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2); + __Pyx_INCREF(__pyx_v_format); + __Pyx_GIVEREF(__pyx_v_format); + PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_format); + __pyx_t_3 = 0; + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_s_at_0x_x_s, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 960, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_result = ((PyObject*)__pyx_t_2); + __pyx_t_2 = 0; + + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_active); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 961, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 961, __pyx_L5_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_1) { + + __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_kp_s_active_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 962, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_2)); + __pyx_t_2 = 0; + + } + + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_pending); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 963, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 963, __pyx_L5_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_1) { + + __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_kp_s_pending_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 964, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_2)); + __pyx_t_2 = 0; + + } + + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_callback); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 965, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = (__pyx_t_2 != Py_None); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_5 = (__pyx_t_1 != 0); + if (__pyx_t_5) { + + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_callback); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 966, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 966, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_callback_r, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 966, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 966, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_4)); + __pyx_t_4 = 0; + + } + + __pyx_t_5 = (__pyx_v_self->args != ((PyObject*)Py_None)); + __pyx_t_1 = (__pyx_t_5 != 0); + if (__pyx_t_1) { + + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 968, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_self->args); + __Pyx_GIVEREF(__pyx_v_self->args); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_self->args); + __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_args_r, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 968, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 968, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_4)); + __pyx_t_4 = 0; + + } + + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = PyNumber_Add(__pyx_v_result, __pyx_kp_s__6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 969, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L4_return; + } + + /*finally:*/ { + __pyx_L5_error:; + /*exception exit:*/{ + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14); + if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11) < 0)) __Pyx_ErrFetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); + __Pyx_XGOTREF(__pyx_t_9); + __Pyx_XGOTREF(__pyx_t_10); + __Pyx_XGOTREF(__pyx_t_11); + __Pyx_XGOTREF(__pyx_t_12); + __Pyx_XGOTREF(__pyx_t_13); + __Pyx_XGOTREF(__pyx_t_14); + __pyx_t_6 = __pyx_lineno; __pyx_t_7 = __pyx_clineno; __pyx_t_8 = __pyx_filename; + { + Py_ReprLeave(((PyObject *)__pyx_v_self)); + } + if (PY_MAJOR_VERSION >= 3) { + __Pyx_XGIVEREF(__pyx_t_12); + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14); + } + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_ErrRestore(__pyx_t_9, __pyx_t_10, __pyx_t_11); + __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; + __pyx_lineno = __pyx_t_6; __pyx_clineno = __pyx_t_7; __pyx_filename = __pyx_t_8; + goto __pyx_L1_error; + } + __pyx_L4_return: { + __pyx_t_14 = __pyx_r; + __pyx_r = 0; + Py_ReprLeave(((PyObject *)__pyx_v_self)); + __pyx_r = __pyx_t_14; + __pyx_t_14 = 0; + goto __pyx_L0; + } + } + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("gevent.libev.corecext.watcher.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_format); + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_11_format(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_11_format(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_format (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_7watcher_10_format(((struct PyGeventWatcherObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_7watcher_10_format(CYTHON_UNUSED struct PyGeventWatcherObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_format", 0); + + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_kp_s__7); + __pyx_r = __pyx_kp_s__7; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_13close(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_13close(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("close (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_7watcher_12close(((struct PyGeventWatcherObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_7watcher_12close(struct PyGeventWatcherObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("close", 0); + + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_stop); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 977, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 977, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("gevent.libev.corecext.watcher.close", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_15__enter__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_15__enter__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__enter__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_7watcher_14__enter__(((struct PyGeventWatcherObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_7watcher_14__enter__(struct PyGeventWatcherObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__enter__", 0); + + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __pyx_r = ((PyObject *)__pyx_v_self); + goto __pyx_L0; + + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_17__exit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_17__exit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + CYTHON_UNUSED PyObject *__pyx_v_t = 0; + CYTHON_UNUSED PyObject *__pyx_v_v = 0; + CYTHON_UNUSED PyObject *__pyx_v_tb = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__exit__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_t,&__pyx_n_s_v,&__pyx_n_s_tb,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_v)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, 1); __PYX_ERR(0, 982, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tb)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, 2); __PYX_ERR(0, 982, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__exit__") < 0)) __PYX_ERR(0, 982, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + } + __pyx_v_t = values[0]; + __pyx_v_v = values[1]; + __pyx_v_tb = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 982, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.libev.corecext.watcher.__exit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_7watcher_16__exit__(((struct PyGeventWatcherObject *)__pyx_v_self), __pyx_v_t, __pyx_v_v, __pyx_v_tb); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_7watcher_16__exit__(struct PyGeventWatcherObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_t, CYTHON_UNUSED PyObject *__pyx_v_v, CYTHON_UNUSED PyObject *__pyx_v_tb) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("__exit__", 0); + + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 983, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 983, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("gevent.libev.corecext.watcher.__exit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_4loop_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_4loop_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_7watcher_4loop___get__(((struct PyGeventWatcherObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_7watcher_4loop___get__(struct PyGeventWatcherObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_self->loop)); + __pyx_r = ((PyObject *)__pyx_v_self->loop); + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_7watcher_4loop_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_7watcher_4loop_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_7watcher_4loop_2__set__(((struct PyGeventWatcherObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_7watcher_4loop_2__set__(struct PyGeventWatcherObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__set__", 0); + if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_6gevent_5libev_8corecext_loop))))) __PYX_ERR(0, 830, __pyx_L1_error) + __pyx_t_1 = __pyx_v_value; + __Pyx_INCREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_self->loop); + __Pyx_DECREF(((PyObject *)__pyx_v_self->loop)); + __pyx_v_self->loop = ((struct PyGeventLoopObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.libev.corecext.watcher.loop.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_7watcher_4loop_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_7watcher_4loop_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_7watcher_4loop_4__del__(((struct PyGeventWatcherObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_7watcher_4loop_4__del__(struct PyGeventWatcherObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->loop); + __Pyx_DECREF(((PyObject *)__pyx_v_self->loop)); + __pyx_v_self->loop = ((struct PyGeventLoopObject *)Py_None); + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_4args_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_4args_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_7watcher_4args___get__(((struct PyGeventWatcherObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_7watcher_4args___get__(struct PyGeventWatcherObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->args); + __pyx_r = __pyx_v_self->args; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_7watcher_4args_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_7watcher_4args_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_7watcher_4args_2__set__(((struct PyGeventWatcherObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_7watcher_4args_2__set__(struct PyGeventWatcherObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__set__", 0); + if (!(likely(PyTuple_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v_value)->tp_name), 0))) __PYX_ERR(0, 832, __pyx_L1_error) + __pyx_t_1 = __pyx_v_value; + __Pyx_INCREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_self->args); + __Pyx_DECREF(__pyx_v_self->args); + __pyx_v_self->args = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.libev.corecext.watcher.args.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_7watcher_4args_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_7watcher_4args_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_7watcher_4args_4__del__(((struct PyGeventWatcherObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_7watcher_4args_4__del__(struct PyGeventWatcherObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->args); + __Pyx_DECREF(__pyx_v_self->args); + __pyx_v_self->args = ((PyObject*)Py_None); + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_6_flags_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_6_flags_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_7watcher_6_flags___get__(((struct PyGeventWatcherObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_7watcher_6_flags___get__(struct PyGeventWatcherObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_unsigned_int(__pyx_v_self->_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 870, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.libev.corecext.watcher._flags.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_2io_1start(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_2io_1start(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_callback = 0; + PyObject *__pyx_v_pass_events = 0; + PyObject *__pyx_v_args = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("start (wrapper)", 0); + if (PyTuple_GET_SIZE(__pyx_args) > 1) { + __pyx_v_args = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args)); + if (unlikely(!__pyx_v_args)) { + __Pyx_RefNannyFinishContext(); + return NULL; + } + __Pyx_GOTREF(__pyx_v_args); + } else { + __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple); + } + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_callback,&__pyx_n_s_pass_events,0}; + PyObject* values[2] = {0,0}; + values[1] = ((PyObject *)Py_False); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + default: + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_callback)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + } + if (kw_args == 1) { + const Py_ssize_t index = 1; + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, *__pyx_pyargnames[index]); + if (value) { values[index] = value; kw_args--; } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "start") < 0)) __PYX_ERR(0, 992, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) < 1) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + } + __pyx_v_callback = values[0]; + __pyx_v_pass_events = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("start", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 992, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0; + __Pyx_AddTraceback("gevent.libev.corecext.io.start", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_2io_start(((struct PyGeventIOObject *)__pyx_v_self), __pyx_v_callback, __pyx_v_pass_events, __pyx_v_args); + + /* function exit code */ + __Pyx_XDECREF(__pyx_v_args); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_2io_start(struct PyGeventIOObject *__pyx_v_self, PyObject *__pyx_v_callback, PyObject *__pyx_v_pass_events, PyObject *__pyx_v_args) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("start", 0); + __Pyx_INCREF(__pyx_v_args); + + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_pass_events); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 993, __pyx_L1_error) + if (__pyx_t_1) { + + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 994, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(GEVENT_CORE_EVENTS); + __Pyx_GIVEREF(GEVENT_CORE_EVENTS); + PyTuple_SET_ITEM(__pyx_t_2, 0, GEVENT_CORE_EVENTS); + __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_v_args); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 994, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF_SET(__pyx_v_args, ((PyObject*)__pyx_t_3)); + __pyx_t_3 = 0; + + } + + __pyx_t_1 = __pyx_f_6gevent_5libev_8corecext__watcher_start(((struct PyGeventWatcherObject *)__pyx_v_self), __pyx_v_callback, __pyx_v_args); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 995, __pyx_L1_error) + + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("gevent.libev.corecext.io.start", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_args); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_2io_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_2io_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + struct PyGeventLoopObject *__pyx_v_loop = 0; + CYTHON_UNUSED vfd_socket_t __pyx_v_fd; + CYTHON_UNUSED int __pyx_v_events; + PyObject *__pyx_v_ref = 0; + PyObject *__pyx_v_priority = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_loop,&__pyx_n_s_fd,&__pyx_n_s_events_2,&__pyx_n_s_ref,&__pyx_n_s_priority,0}; + PyObject* values[5] = {0,0,0,0,0}; + values[3] = ((PyObject *)Py_True); + values[4] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + CYTHON_FALLTHROUGH; + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_loop)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_fd)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 5, 1); __PYX_ERR(0, 997, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_events_2)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 5, 2); __PYX_ERR(0, 997, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 3: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ref); + if (value) { values[3] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 4: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_priority); + if (value) { values[4] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 997, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + CYTHON_FALLTHROUGH; + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_loop = ((struct PyGeventLoopObject *)values[0]); + __pyx_v_fd = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_fd == ((vfd_socket_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 997, __pyx_L3_error) + __pyx_v_events = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_events == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 997, __pyx_L3_error) + __pyx_v_ref = values[3]; + __pyx_v_priority = values[4]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 997, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.libev.corecext.io.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_loop), __pyx_ptype_6gevent_5libev_8corecext_loop, 1, "loop", 0))) __PYX_ERR(0, 997, __pyx_L1_error) + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_2io_2__init__(((struct PyGeventIOObject *)__pyx_v_self), __pyx_v_loop, __pyx_v_fd, __pyx_v_events, __pyx_v_ref, __pyx_v_priority); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_2io_2__init__(struct PyGeventIOObject *__pyx_v_self, struct PyGeventLoopObject *__pyx_v_loop, CYTHON_UNUSED vfd_socket_t __pyx_v_fd, CYTHON_UNUSED int __pyx_v_events, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + __Pyx_RefNannySetupContext("__init__", 0); + + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_6gevent_5libev_8corecext_watcher), __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 998, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + __pyx_t_4 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_4 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[5] = {__pyx_t_3, ((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_loop), __pyx_v_ref, __pyx_v_priority}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 4+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 998, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[5] = {__pyx_t_3, ((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_loop), __pyx_v_ref, __pyx_v_priority}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 4+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 998, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else + #endif + { + __pyx_t_5 = PyTuple_New(4+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 998, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (__pyx_t_3) { + __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL; + } + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, ((PyObject *)__pyx_v_self)); + __Pyx_INCREF(((PyObject *)__pyx_v_loop)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_loop)); + PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, ((PyObject *)__pyx_v_loop)); + __Pyx_INCREF(__pyx_v_ref); + __Pyx_GIVEREF(__pyx_v_ref); + PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_4, __pyx_v_ref); + __Pyx_INCREF(__pyx_v_priority); + __Pyx_GIVEREF(__pyx_v_priority); + PyTuple_SET_ITEM(__pyx_t_5, 3+__pyx_t_4, __pyx_v_priority); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 998, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("gevent.libev.corecext.io.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_2io_5__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_2io_5__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_loop = 0; + vfd_socket_t __pyx_v_fd; + int __pyx_v_events; + CYTHON_UNUSED PyObject *__pyx_v_ref = 0; + CYTHON_UNUSED PyObject *__pyx_v_priority = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_loop,&__pyx_n_s_fd,&__pyx_n_s_events_2,&__pyx_n_s_ref,&__pyx_n_s_priority,0}; + PyObject* values[5] = {0,0,0,0,0}; + values[3] = ((PyObject *)Py_True); + values[4] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + CYTHON_FALLTHROUGH; + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_loop)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_fd)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 1); __PYX_ERR(0, 1000, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_events_2)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 2); __PYX_ERR(0, 1000, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 3: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ref); + if (value) { values[3] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 4: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_priority); + if (value) { values[4] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 1000, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + CYTHON_FALLTHROUGH; + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_loop = ((struct PyGeventLoopObject *)values[0]); + __pyx_v_fd = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_fd == ((vfd_socket_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1000, __pyx_L3_error) + __pyx_v_events = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_events == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1000, __pyx_L3_error) + __pyx_v_ref = values[3]; + __pyx_v_priority = values[4]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1000, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.libev.corecext.io.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_loop), __pyx_ptype_6gevent_5libev_8corecext_loop, 1, "loop", 0))) __PYX_ERR(0, 1000, __pyx_L1_error) + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_2io_4__cinit__(((struct PyGeventIOObject *)__pyx_v_self), __pyx_v_loop, __pyx_v_fd, __pyx_v_events, __pyx_v_ref, __pyx_v_priority); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_2io_4__cinit__(struct PyGeventIOObject *__pyx_v_self, CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_loop, vfd_socket_t __pyx_v_fd, int __pyx_v_events, CYTHON_UNUSED PyObject *__pyx_v_ref, CYTHON_UNUSED PyObject *__pyx_v_priority) { + int __pyx_v_vfd; + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + __Pyx_RefNannySetupContext("__cinit__", 0); + + __pyx_t_1 = ((__pyx_v_fd < 0) != 0); + if (unlikely(__pyx_t_1)) { + + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_fd); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1002, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_fd_must_be_non_negative_r, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1002, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1002, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 1002, __pyx_L1_error) + + } + + __pyx_t_1 = ((__pyx_v_events & (~((EV__IOFDSET | EV_READ) | EV_WRITE))) != 0); + if (unlikely(__pyx_t_1)) { + + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_events); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1004, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_illegal_event_mask_r, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1004, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1004, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 1004, __pyx_L1_error) + + } + + __pyx_t_4 = vfd_open(__pyx_v_fd); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 1006, __pyx_L1_error) + __pyx_v_vfd = __pyx_t_4; + + ev_io_init((&__pyx_v_self->_watcher), ((void *)gevent_callback_io), __pyx_v_vfd, __pyx_v_events); + + __pyx_v_self->__pyx_base.__pyx___watcher = ((struct ev_watcher *)(&__pyx_v_self->_watcher)); + + __pyx_v_self->__pyx_base.__pyx___ss = (&__pyx_v_6gevent_5libev_8corecext_io_ss); + + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("gevent.libev.corecext.io.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static void __pyx_pw_6gevent_5libev_8corecext_2io_7__dealloc__(PyObject *__pyx_v_self); /*proto*/ +static void __pyx_pw_6gevent_5libev_8corecext_2io_7__dealloc__(PyObject *__pyx_v_self) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); + __pyx_pf_6gevent_5libev_8corecext_2io_6__dealloc__(((struct PyGeventIOObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +static void __pyx_pf_6gevent_5libev_8corecext_2io_6__dealloc__(struct PyGeventIOObject *__pyx_v_self) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__dealloc__", 0); + + vfd_free(__pyx_v_self->_watcher.fd); + + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_2io_2fd_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_2io_2fd_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_2io_2fd___get__(((struct PyGeventIOObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_2io_2fd___get__(struct PyGeventIOObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyInt_FromSsize_t(vfd_get(__pyx_v_self->_watcher.fd)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1016, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.libev.corecext.io.fd.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_2io_2fd_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_fd); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_2io_2fd_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_fd) { + long __pyx_v_fd; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + assert(__pyx_arg_fd); { + __pyx_v_fd = __Pyx_PyInt_As_long(__pyx_arg_fd); if (unlikely((__pyx_v_fd == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 1019, __pyx_L3_error) + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.libev.corecext.io.fd.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_2io_2fd_2__set__(((struct PyGeventIOObject *)__pyx_v_self), ((long)__pyx_v_fd)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_2io_2fd_2__set__(struct PyGeventIOObject *__pyx_v_self, long __pyx_v_fd) { + int __pyx_v_vfd; + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + __Pyx_RefNannySetupContext("__set__", 0); + + __pyx_t_1 = (ev_is_active((&__pyx_v_self->_watcher)) != 0); + if (unlikely(__pyx_t_1)) { + + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_AttributeError, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1021, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 1021, __pyx_L1_error) + + } + + __pyx_t_3 = vfd_open(__pyx_v_fd); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 1022, __pyx_L1_error) + __pyx_v_vfd = __pyx_t_3; + + vfd_free(__pyx_v_self->_watcher.fd); + + ev_io_init((&__pyx_v_self->_watcher), ((void *)gevent_callback_io), __pyx_v_vfd, __pyx_v_self->_watcher.events); + + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent.libev.corecext.io.fd.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_2io_6events_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_2io_6events_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_2io_6events___get__(((struct PyGeventIOObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_2io_6events___get__(struct PyGeventIOObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->_watcher.events); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1028, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.libev.corecext.io.events.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_2io_6events_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_events); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_2io_6events_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_events) { + int __pyx_v_events; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + assert(__pyx_arg_events); { + __pyx_v_events = __Pyx_PyInt_As_int(__pyx_arg_events); if (unlikely((__pyx_v_events == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1031, __pyx_L3_error) + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.libev.corecext.io.events.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_2io_6events_2__set__(((struct PyGeventIOObject *)__pyx_v_self), ((int)__pyx_v_events)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_2io_6events_2__set__(struct PyGeventIOObject *__pyx_v_self, int __pyx_v_events) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("__set__", 0); + + __pyx_t_1 = (ev_is_active((&__pyx_v_self->_watcher)) != 0); + if (unlikely(__pyx_t_1)) { + + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_AttributeError, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1033, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 1033, __pyx_L1_error) + + } + + ev_io_init((&__pyx_v_self->_watcher), ((void *)gevent_callback_io), __pyx_v_self->_watcher.fd, __pyx_v_events); + + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent.libev.corecext.io.events.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_2io_10events_str_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_2io_10events_str_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_2io_10events_str___get__(((struct PyGeventIOObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_2io_10events_str___get__(struct PyGeventIOObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6gevent_5libev_8corecext__events_to_str(__pyx_v_self->_watcher.events, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1038, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.libev.corecext.io.events_str.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_2io_9_format(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_2io_9_format(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_format (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_2io_8_format(((struct PyGeventIOObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_2io_8_format(struct PyGeventIOObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("_format", 0); + + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_fd); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1041, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_events_str); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1041, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1041, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); + __pyx_t_1 = 0; + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_fd_s_events_s, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1041, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("gevent.libev.corecext.io._format", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_5timer_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_5timer_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_loop = 0; + double __pyx_v_after; + double __pyx_v_repeat; + CYTHON_UNUSED PyObject *__pyx_v_ref = 0; + CYTHON_UNUSED PyObject *__pyx_v_priority = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_loop,&__pyx_n_s_after,&__pyx_n_s_repeat,&__pyx_n_s_ref,&__pyx_n_s_priority,0}; + PyObject* values[5] = {0,0,0,0,0}; + values[3] = ((PyObject *)Py_True); + values[4] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + CYTHON_FALLTHROUGH; + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_loop)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_after); + if (value) { values[1] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 2: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_repeat); + if (value) { values[2] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 3: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ref); + if (value) { values[3] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 4: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_priority); + if (value) { values[4] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 1049, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + CYTHON_FALLTHROUGH; + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_loop = ((struct PyGeventLoopObject *)values[0]); + if (values[1]) { + __pyx_v_after = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_after == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1049, __pyx_L3_error) + } else { + __pyx_v_after = ((double)0.0); + } + if (values[2]) { + __pyx_v_repeat = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_repeat == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1049, __pyx_L3_error) + } else { + __pyx_v_repeat = ((double)0.0); + } + __pyx_v_ref = values[3]; + __pyx_v_priority = values[4]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1049, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.libev.corecext.timer.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_loop), __pyx_ptype_6gevent_5libev_8corecext_loop, 1, "loop", 0))) __PYX_ERR(0, 1049, __pyx_L1_error) + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_5timer___cinit__(((struct PyGeventTimerObject *)__pyx_v_self), __pyx_v_loop, __pyx_v_after, __pyx_v_repeat, __pyx_v_ref, __pyx_v_priority); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_5timer___cinit__(struct PyGeventTimerObject *__pyx_v_self, CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_loop, double __pyx_v_after, double __pyx_v_repeat, CYTHON_UNUSED PyObject *__pyx_v_ref, CYTHON_UNUSED PyObject *__pyx_v_priority) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("__cinit__", 0); + + __pyx_t_1 = ((__pyx_v_repeat < 0.0) != 0); + if (unlikely(__pyx_t_1)) { + + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_repeat); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1051, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_repeat_must_be_positive_or_zero, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1051, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1051, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 1051, __pyx_L1_error) + + } + + ev_timer_init((&__pyx_v_self->_watcher), ((void *)gevent_callback_timer), __pyx_v_after, __pyx_v_repeat); + + __pyx_v_self->__pyx_base.__pyx___watcher = ((struct ev_watcher *)(&__pyx_v_self->_watcher)); + + __pyx_v_self->__pyx_base.__pyx___ss = (&__pyx_v_6gevent_5libev_8corecext_timer_ss); + + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("gevent.libev.corecext.timer.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_5timer_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_5timer_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + struct PyGeventLoopObject *__pyx_v_loop = 0; + CYTHON_UNUSED double __pyx_v_after; + CYTHON_UNUSED double __pyx_v_repeat; + PyObject *__pyx_v_ref = 0; + PyObject *__pyx_v_priority = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_loop,&__pyx_n_s_after,&__pyx_n_s_repeat,&__pyx_n_s_ref,&__pyx_n_s_priority,0}; + PyObject* values[5] = {0,0,0,0,0}; + values[3] = ((PyObject *)Py_True); + values[4] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + CYTHON_FALLTHROUGH; + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_loop)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_after); + if (value) { values[1] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 2: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_repeat); + if (value) { values[2] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 3: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ref); + if (value) { values[3] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 4: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_priority); + if (value) { values[4] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 1056, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + CYTHON_FALLTHROUGH; + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_loop = ((struct PyGeventLoopObject *)values[0]); + if (values[1]) { + __pyx_v_after = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_after == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1056, __pyx_L3_error) + } else { + __pyx_v_after = ((double)0.0); + } + if (values[2]) { + __pyx_v_repeat = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_repeat == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1056, __pyx_L3_error) + } else { + __pyx_v_repeat = ((double)0.0); + } + __pyx_v_ref = values[3]; + __pyx_v_priority = values[4]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1056, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.libev.corecext.timer.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_loop), __pyx_ptype_6gevent_5libev_8corecext_loop, 1, "loop", 0))) __PYX_ERR(0, 1056, __pyx_L1_error) + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_5timer_2__init__(((struct PyGeventTimerObject *)__pyx_v_self), __pyx_v_loop, __pyx_v_after, __pyx_v_repeat, __pyx_v_ref, __pyx_v_priority); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_5timer_2__init__(struct PyGeventTimerObject *__pyx_v_self, struct PyGeventLoopObject *__pyx_v_loop, CYTHON_UNUSED double __pyx_v_after, CYTHON_UNUSED double __pyx_v_repeat, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + __Pyx_RefNannySetupContext("__init__", 0); + + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_6gevent_5libev_8corecext_watcher), __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1057, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + __pyx_t_4 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_4 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[5] = {__pyx_t_3, ((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_loop), __pyx_v_ref, __pyx_v_priority}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 4+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1057, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[5] = {__pyx_t_3, ((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_loop), __pyx_v_ref, __pyx_v_priority}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 4+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1057, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else + #endif + { + __pyx_t_5 = PyTuple_New(4+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1057, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (__pyx_t_3) { + __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL; + } + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, ((PyObject *)__pyx_v_self)); + __Pyx_INCREF(((PyObject *)__pyx_v_loop)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_loop)); + PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, ((PyObject *)__pyx_v_loop)); + __Pyx_INCREF(__pyx_v_ref); + __Pyx_GIVEREF(__pyx_v_ref); + PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_4, __pyx_v_ref); + __Pyx_INCREF(__pyx_v_priority); + __Pyx_GIVEREF(__pyx_v_priority); + PyTuple_SET_ITEM(__pyx_t_5, 3+__pyx_t_4, __pyx_v_priority); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1057, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("gevent.libev.corecext.timer.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_5timer_5start(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_5timer_5start(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_callback = 0; + PyObject *__pyx_v_update = 0; + PyObject *__pyx_v_args = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("start (wrapper)", 0); + if (PyTuple_GET_SIZE(__pyx_args) > 1) { + __pyx_v_args = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args)); + if (unlikely(!__pyx_v_args)) { + __Pyx_RefNannyFinishContext(); + return NULL; + } + __Pyx_GOTREF(__pyx_v_args); + } else { + __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple); + } + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_callback,&__pyx_n_s_update,0}; + PyObject* values[2] = {0,0}; + values[1] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + default: + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_callback)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + } + if (kw_args == 1) { + const Py_ssize_t index = 1; + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, *__pyx_pyargnames[index]); + if (value) { values[index] = value; kw_args--; } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "start") < 0)) __PYX_ERR(0, 1059, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) < 1) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + } + __pyx_v_callback = values[0]; + __pyx_v_update = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("start", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1059, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0; + __Pyx_AddTraceback("gevent.libev.corecext.timer.start", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_5timer_4start(((struct PyGeventTimerObject *)__pyx_v_self), __pyx_v_callback, __pyx_v_update, __pyx_v_args); + + /* function exit code */ + __Pyx_XDECREF(__pyx_v_args); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_5timer_4start(struct PyGeventTimerObject *__pyx_v_self, PyObject *__pyx_v_callback, PyObject *__pyx_v_update, PyObject *__pyx_v_args) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("start", 0); + __Pyx_INCREF(__pyx_v_update); + + __pyx_t_2 = (__pyx_v_update != Py_None); + if ((__pyx_t_2 != 0)) { + __Pyx_INCREF(__pyx_v_update); + __pyx_t_1 = __pyx_v_update; + } else { + __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_v_self->__pyx_base.loop->starting_timer_may_update_loop_time); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1060, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __pyx_t_3; + __pyx_t_3 = 0; + } + __Pyx_DECREF_SET(__pyx_v_update, __pyx_t_1); + __pyx_t_1 = 0; + + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_update); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1061, __pyx_L1_error) + if (__pyx_t_2) { + + ((struct __pyx_vtabstruct_6gevent_5libev_8corecext_loop *)__pyx_v_self->__pyx_base.loop->__pyx_vtab)->update_now(__pyx_v_self->__pyx_base.loop, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1062, __pyx_L1_error) + + } + + __pyx_t_2 = __pyx_f_6gevent_5libev_8corecext__watcher_start(((struct PyGeventWatcherObject *)__pyx_v_self), __pyx_v_callback, __pyx_v_args); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 1063, __pyx_L1_error) + + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("gevent.libev.corecext.timer.start", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_update); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_5timer_2at_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_5timer_2at_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_5timer_2at___get__(((struct PyGeventTimerObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_5timer_2at___get__(struct PyGeventTimerObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->_watcher.at); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1067, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.libev.corecext.timer.at.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_5timer_7again(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_5timer_7again(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_callback = 0; + PyObject *__pyx_v_update = 0; + PyObject *__pyx_v_args = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("again (wrapper)", 0); + if (PyTuple_GET_SIZE(__pyx_args) > 1) { + __pyx_v_args = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args)); + if (unlikely(!__pyx_v_args)) { + __Pyx_RefNannyFinishContext(); + return NULL; + } + __Pyx_GOTREF(__pyx_v_args); + } else { + __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple); + } + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_callback,&__pyx_n_s_update,0}; + PyObject* values[2] = {0,0}; + values[1] = ((PyObject *)Py_True); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + default: + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_callback)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + } + if (kw_args == 1) { + const Py_ssize_t index = 1; + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, *__pyx_pyargnames[index]); + if (value) { values[index] = value; kw_args--; } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "again") < 0)) __PYX_ERR(0, 1071, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) < 1) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + } + __pyx_v_callback = values[0]; + __pyx_v_update = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("again", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1071, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0; + __Pyx_AddTraceback("gevent.libev.corecext.timer.again", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_5timer_6again(((struct PyGeventTimerObject *)__pyx_v_self), __pyx_v_callback, __pyx_v_update, __pyx_v_args); + + /* function exit code */ + __Pyx_XDECREF(__pyx_v_args); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_5timer_6again(struct PyGeventTimerObject *__pyx_v_self, PyObject *__pyx_v_callback, PyObject *__pyx_v_update, PyObject *__pyx_v_args) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + __Pyx_RefNannySetupContext("again", 0); + + __pyx_t_1 = ((PyObject *)__pyx_v_self->__pyx_base.loop); + __Pyx_INCREF(__pyx_t_1); + __pyx_t_2 = __pyx_f_6gevent_5libev_8corecext__check_loop(((struct PyGeventLoopObject *)__pyx_t_1)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 1072, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_callback, __pyx_v_callback) < 0) __PYX_ERR(0, 1073, __pyx_L1_error) + + __Pyx_INCREF(__pyx_v_args); + __Pyx_GIVEREF(__pyx_v_args); + __Pyx_GOTREF(__pyx_v_self->__pyx_base.args); + __Pyx_DECREF(__pyx_v_self->__pyx_base.args); + __pyx_v_self->__pyx_base.args = __pyx_v_args; + + __pyx_f_6gevent_5libev_8corecext__libev_unref(((struct PyGeventWatcherObject *)__pyx_v_self)); + + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_update); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1076, __pyx_L1_error) + if (__pyx_t_2) { + + ev_now_update(__pyx_v_self->__pyx_base.loop->_ptr); + + } + + ev_timer_again(__pyx_v_self->__pyx_base.loop->_ptr, (&__pyx_v_self->_watcher)); + + __pyx_f_6gevent_5libev_8corecext__python_incref(((struct PyGeventWatcherObject *)__pyx_v_self)); + + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.libev.corecext.timer.again", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_6signal_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_6signal_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_loop = 0; + int __pyx_v_signalnum; + CYTHON_UNUSED PyObject *__pyx_v_ref = 0; + CYTHON_UNUSED PyObject *__pyx_v_priority = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_loop,&__pyx_n_s_signalnum,&__pyx_n_s_ref,&__pyx_n_s_priority,0}; + PyObject* values[4] = {0,0,0,0}; + values[2] = ((PyObject *)Py_True); + values[3] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_loop)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_signalnum)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 4, 1); __PYX_ERR(0, 1089, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ref); + if (value) { values[2] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 3: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_priority); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 1089, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_loop = ((struct PyGeventLoopObject *)values[0]); + __pyx_v_signalnum = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_signalnum == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1089, __pyx_L3_error) + __pyx_v_ref = values[2]; + __pyx_v_priority = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1089, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.libev.corecext.signal.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_loop), __pyx_ptype_6gevent_5libev_8corecext_loop, 1, "loop", 0))) __PYX_ERR(0, 1089, __pyx_L1_error) + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_6signal___cinit__(((struct PyGeventSignalObject *)__pyx_v_self), __pyx_v_loop, __pyx_v_signalnum, __pyx_v_ref, __pyx_v_priority); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_6signal___cinit__(struct PyGeventSignalObject *__pyx_v_self, CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_loop, int __pyx_v_signalnum, CYTHON_UNUSED PyObject *__pyx_v_ref, CYTHON_UNUSED PyObject *__pyx_v_priority) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + __Pyx_RefNannySetupContext("__cinit__", 0); + + __pyx_t_2 = ((__pyx_v_signalnum < 1) != 0); + if (!__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_signalnum); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1090, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_signalmodule); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1090, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_NSIG); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1090, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_t_5, Py_GE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1090, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1090, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_1 = __pyx_t_2; + __pyx_L4_bool_binop_done:; + if (unlikely(__pyx_t_1)) { + + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_signalnum); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1091, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_illegal_signal_number_r, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1091, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1091, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __PYX_ERR(0, 1091, __pyx_L1_error) + + } + + ev_signal_init((&__pyx_v_self->_watcher), ((void *)gevent_callback_signal), __pyx_v_signalnum); + + __pyx_v_self->__pyx_base.__pyx___watcher = ((struct ev_watcher *)(&__pyx_v_self->_watcher)); + + __pyx_v_self->__pyx_base.__pyx___ss = (&__pyx_v_6gevent_5libev_8corecext_signal_ss); + + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("gevent.libev.corecext.signal.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_6signal_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_6signal_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + struct PyGeventLoopObject *__pyx_v_loop = 0; + CYTHON_UNUSED int __pyx_v_signalnum; + PyObject *__pyx_v_ref = 0; + PyObject *__pyx_v_priority = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_loop,&__pyx_n_s_signalnum,&__pyx_n_s_ref,&__pyx_n_s_priority,0}; + PyObject* values[4] = {0,0,0,0}; + values[2] = ((PyObject *)Py_True); + values[3] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_loop)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_signalnum)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 4, 1); __PYX_ERR(0, 1101, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ref); + if (value) { values[2] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 3: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_priority); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 1101, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_loop = ((struct PyGeventLoopObject *)values[0]); + __pyx_v_signalnum = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_signalnum == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1101, __pyx_L3_error) + __pyx_v_ref = values[2]; + __pyx_v_priority = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1101, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.libev.corecext.signal.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_loop), __pyx_ptype_6gevent_5libev_8corecext_loop, 1, "loop", 0))) __PYX_ERR(0, 1101, __pyx_L1_error) + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_6signal_2__init__(((struct PyGeventSignalObject *)__pyx_v_self), __pyx_v_loop, __pyx_v_signalnum, __pyx_v_ref, __pyx_v_priority); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_6signal_2__init__(struct PyGeventSignalObject *__pyx_v_self, struct PyGeventLoopObject *__pyx_v_loop, CYTHON_UNUSED int __pyx_v_signalnum, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + __Pyx_RefNannySetupContext("__init__", 0); + + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_6gevent_5libev_8corecext_watcher), __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1102, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + __pyx_t_4 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_4 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[5] = {__pyx_t_3, ((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_loop), __pyx_v_ref, __pyx_v_priority}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 4+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1102, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[5] = {__pyx_t_3, ((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_loop), __pyx_v_ref, __pyx_v_priority}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 4+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1102, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else + #endif + { + __pyx_t_5 = PyTuple_New(4+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1102, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (__pyx_t_3) { + __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL; + } + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, ((PyObject *)__pyx_v_self)); + __Pyx_INCREF(((PyObject *)__pyx_v_loop)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_loop)); + PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, ((PyObject *)__pyx_v_loop)); + __Pyx_INCREF(__pyx_v_ref); + __Pyx_GIVEREF(__pyx_v_ref); + PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_4, __pyx_v_ref); + __Pyx_INCREF(__pyx_v_priority); + __Pyx_GIVEREF(__pyx_v_priority); + PyTuple_SET_ITEM(__pyx_t_5, 3+__pyx_t_4, __pyx_v_priority); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1102, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("gevent.libev.corecext.signal.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_4idle_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_4idle_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_loop = 0; + CYTHON_UNUSED PyObject *__pyx_v_ref = 0; + CYTHON_UNUSED PyObject *__pyx_v_priority = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_loop,&__pyx_n_s_ref,&__pyx_n_s_priority,0}; + PyObject* values[3] = {0,0,0}; + values[1] = ((PyObject *)Py_True); + values[2] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_loop)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ref); + if (value) { values[1] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 2: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_priority); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 1112, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_loop = ((struct PyGeventLoopObject *)values[0]); + __pyx_v_ref = values[1]; + __pyx_v_priority = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1112, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.libev.corecext.idle.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_loop), __pyx_ptype_6gevent_5libev_8corecext_loop, 1, "loop", 0))) __PYX_ERR(0, 1112, __pyx_L1_error) + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4idle___cinit__(((struct PyGeventIdleObject *)__pyx_v_self), __pyx_v_loop, __pyx_v_ref, __pyx_v_priority); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_4idle___cinit__(struct PyGeventIdleObject *__pyx_v_self, CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_loop, CYTHON_UNUSED PyObject *__pyx_v_ref, CYTHON_UNUSED PyObject *__pyx_v_priority) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__cinit__", 0); + + ev_idle_init((&__pyx_v_self->_watcher), ((void *)gevent_callback_idle)); + + __pyx_v_self->__pyx_base.__pyx___watcher = ((struct ev_watcher *)(&__pyx_v_self->_watcher)); + + __pyx_v_self->__pyx_base.__pyx___ss = (&__pyx_v_6gevent_5libev_8corecext_idle_ss); + + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_7prepare_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_7prepare_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_loop = 0; + CYTHON_UNUSED PyObject *__pyx_v_ref = 0; + CYTHON_UNUSED PyObject *__pyx_v_priority = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_loop,&__pyx_n_s_ref,&__pyx_n_s_priority,0}; + PyObject* values[3] = {0,0,0}; + values[1] = ((PyObject *)Py_True); + values[2] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_loop)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ref); + if (value) { values[1] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 2: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_priority); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 1125, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_loop = ((struct PyGeventLoopObject *)values[0]); + __pyx_v_ref = values[1]; + __pyx_v_priority = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1125, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.libev.corecext.prepare.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_loop), __pyx_ptype_6gevent_5libev_8corecext_loop, 1, "loop", 0))) __PYX_ERR(0, 1125, __pyx_L1_error) + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_7prepare___cinit__(((struct PyGeventPrepareObject *)__pyx_v_self), __pyx_v_loop, __pyx_v_ref, __pyx_v_priority); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_7prepare___cinit__(struct PyGeventPrepareObject *__pyx_v_self, CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_loop, CYTHON_UNUSED PyObject *__pyx_v_ref, CYTHON_UNUSED PyObject *__pyx_v_priority) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__cinit__", 0); + + ev_prepare_init((&__pyx_v_self->_watcher), ((void *)gevent_callback_prepare)); + + __pyx_v_self->__pyx_base.__pyx___watcher = ((struct ev_watcher *)(&__pyx_v_self->_watcher)); + + __pyx_v_self->__pyx_base.__pyx___ss = (&__pyx_v_6gevent_5libev_8corecext_prepare_ss); + + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_5check_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_5check_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_loop = 0; + CYTHON_UNUSED PyObject *__pyx_v_ref = 0; + CYTHON_UNUSED PyObject *__pyx_v_priority = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_loop,&__pyx_n_s_ref,&__pyx_n_s_priority,0}; + PyObject* values[3] = {0,0,0}; + values[1] = ((PyObject *)Py_True); + values[2] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_loop)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ref); + if (value) { values[1] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 2: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_priority); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 1138, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_loop = ((struct PyGeventLoopObject *)values[0]); + __pyx_v_ref = values[1]; + __pyx_v_priority = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1138, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.libev.corecext.check.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_loop), __pyx_ptype_6gevent_5libev_8corecext_loop, 1, "loop", 0))) __PYX_ERR(0, 1138, __pyx_L1_error) + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_5check___cinit__(((struct PyGeventCheckObject *)__pyx_v_self), __pyx_v_loop, __pyx_v_ref, __pyx_v_priority); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_5check___cinit__(struct PyGeventCheckObject *__pyx_v_self, CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_loop, CYTHON_UNUSED PyObject *__pyx_v_ref, CYTHON_UNUSED PyObject *__pyx_v_priority) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__cinit__", 0); + + ev_check_init((&__pyx_v_self->_watcher), ((void *)gevent_callback_check)); + + __pyx_v_self->__pyx_base.__pyx___watcher = ((struct ev_watcher *)(&__pyx_v_self->_watcher)); + + __pyx_v_self->__pyx_base.__pyx___ss = (&__pyx_v_6gevent_5libev_8corecext_check_ss); + + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_4fork_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_4fork_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_loop = 0; + CYTHON_UNUSED PyObject *__pyx_v_ref = 0; + CYTHON_UNUSED PyObject *__pyx_v_priority = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_loop,&__pyx_n_s_ref,&__pyx_n_s_priority,0}; + PyObject* values[3] = {0,0,0}; + values[1] = ((PyObject *)Py_True); + values[2] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_loop)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ref); + if (value) { values[1] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 2: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_priority); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 1151, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_loop = ((struct PyGeventLoopObject *)values[0]); + __pyx_v_ref = values[1]; + __pyx_v_priority = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1151, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.libev.corecext.fork.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_loop), __pyx_ptype_6gevent_5libev_8corecext_loop, 1, "loop", 0))) __PYX_ERR(0, 1151, __pyx_L1_error) + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4fork___cinit__(((struct PyGeventForkObject *)__pyx_v_self), __pyx_v_loop, __pyx_v_ref, __pyx_v_priority); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_4fork___cinit__(struct PyGeventForkObject *__pyx_v_self, CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_loop, CYTHON_UNUSED PyObject *__pyx_v_ref, CYTHON_UNUSED PyObject *__pyx_v_priority) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__cinit__", 0); + + ev_fork_init((&__pyx_v_self->_watcher), ((void *)gevent_callback_fork)); + + __pyx_v_self->__pyx_base.__pyx___watcher = ((struct ev_watcher *)(&__pyx_v_self->_watcher)); + + __pyx_v_self->__pyx_base.__pyx___ss = (&__pyx_v_6gevent_5libev_8corecext_fork_ss); + + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_6async__7pending_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_6async__7pending_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_6async__7pending___get__(((struct PyGeventAsyncObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_6async__7pending___get__(struct PyGeventAsyncObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + __Pyx_XDECREF(__pyx_r); + if ((ev_async_pending((&__pyx_v_self->_watcher)) != 0)) { + __Pyx_INCREF(Py_True); + __pyx_t_1 = Py_True; + } else { + __Pyx_INCREF(Py_False); + __pyx_t_1 = Py_False; + } + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_6async__1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_6async__1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_loop = 0; + CYTHON_UNUSED PyObject *__pyx_v_ref = 0; + CYTHON_UNUSED PyObject *__pyx_v_priority = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_loop,&__pyx_n_s_ref,&__pyx_n_s_priority,0}; + PyObject* values[3] = {0,0,0}; + values[1] = ((PyObject *)Py_True); + values[2] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_loop)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ref); + if (value) { values[1] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 2: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_priority); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 1168, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_loop = ((struct PyGeventLoopObject *)values[0]); + __pyx_v_ref = values[1]; + __pyx_v_priority = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1168, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.libev.corecext.async_.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_loop), __pyx_ptype_6gevent_5libev_8corecext_loop, 1, "loop", 0))) __PYX_ERR(0, 1168, __pyx_L1_error) + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_6async____cinit__(((struct PyGeventAsyncObject *)__pyx_v_self), __pyx_v_loop, __pyx_v_ref, __pyx_v_priority); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_6async____cinit__(struct PyGeventAsyncObject *__pyx_v_self, CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_loop, CYTHON_UNUSED PyObject *__pyx_v_ref, CYTHON_UNUSED PyObject *__pyx_v_priority) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__cinit__", 0); + + ev_async_init((&__pyx_v_self->_watcher), ((void *)gevent_callback_async)); + + __pyx_v_self->__pyx_base.__pyx___watcher = ((struct ev_watcher *)(&__pyx_v_self->_watcher)); + + __pyx_v_self->__pyx_base.__pyx___ss = (&__pyx_v_6gevent_5libev_8corecext_async_ss); + + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_6async__3send(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_6async__3send(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("send (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_6async__2send(((struct PyGeventAsyncObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_6async__2send(struct PyGeventAsyncObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + __Pyx_RefNannySetupContext("send", 0); + + __pyx_t_1 = ((PyObject *)__pyx_v_self->__pyx_base.loop); + __Pyx_INCREF(__pyx_t_1); + __pyx_t_2 = __pyx_f_6gevent_5libev_8corecext__check_loop(((struct PyGeventLoopObject *)__pyx_t_1)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 1175, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + ev_async_send(__pyx_v_self->__pyx_base.loop->_ptr, (&__pyx_v_self->_watcher)); + + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.libev.corecext.async_.send", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_5child_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_5child_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + struct PyGeventLoopObject *__pyx_v_loop = 0; + int __pyx_v_pid; + int __pyx_v_trace; + CYTHON_UNUSED PyObject *__pyx_v_ref = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_loop,&__pyx_n_s_pid,&__pyx_n_s_trace,&__pyx_n_s_ref,0}; + PyObject* values[4] = {0,0,0,0}; + values[3] = ((PyObject *)Py_True); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_loop)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pid)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 4, 1); __PYX_ERR(0, 1186, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_trace); + if (value) { values[2] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 3: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ref); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 1186, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_loop = ((struct PyGeventLoopObject *)values[0]); + __pyx_v_pid = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_pid == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1186, __pyx_L3_error) + if (values[2]) { + __pyx_v_trace = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_trace == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1186, __pyx_L3_error) + } else { + __pyx_v_trace = ((int)0); + } + __pyx_v_ref = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1186, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.libev.corecext.child.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_loop), __pyx_ptype_6gevent_5libev_8corecext_loop, 1, "loop", 0))) __PYX_ERR(0, 1186, __pyx_L1_error) + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_5child___cinit__(((struct PyGeventChildObject *)__pyx_v_self), __pyx_v_loop, __pyx_v_pid, __pyx_v_trace, __pyx_v_ref); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_5child___cinit__(struct PyGeventChildObject *__pyx_v_self, struct PyGeventLoopObject *__pyx_v_loop, int __pyx_v_pid, int __pyx_v_trace, CYTHON_UNUSED PyObject *__pyx_v_ref) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + int __pyx_t_4; + __Pyx_RefNannySetupContext("__cinit__", 0); + + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_sys); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1187, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_platform); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1187, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_t_2, __pyx_n_s_win32, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1187, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(__pyx_t_3)) { + + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_AttributeError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1188, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 1188, __pyx_L1_error) + + } + + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_loop), __pyx_n_s_default); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1189, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1189, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_4 = ((!__pyx_t_3) != 0); + if (unlikely(__pyx_t_4)) { + + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1190, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 1190, __pyx_L1_error) + + } + + gevent_install_sigchld_handler(); + + ev_child_init((&__pyx_v_self->_watcher), ((void *)gevent_callback_child), __pyx_v_pid, __pyx_v_trace); + + __pyx_v_self->__pyx_base.__pyx___watcher = ((struct ev_watcher *)(&__pyx_v_self->_watcher)); + + __pyx_v_self->__pyx_base.__pyx___ss = (&__pyx_v_6gevent_5libev_8corecext_child_ss); + + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent.libev.corecext.child.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_5child_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_5child_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + struct PyGeventLoopObject *__pyx_v_loop = 0; + CYTHON_UNUSED int __pyx_v_pid; + CYTHON_UNUSED int __pyx_v_trace; + PyObject *__pyx_v_ref = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_loop,&__pyx_n_s_pid,&__pyx_n_s_trace,&__pyx_n_s_ref,0}; + PyObject* values[4] = {0,0,0,0}; + values[3] = ((PyObject *)Py_True); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_loop)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pid)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 4, 1); __PYX_ERR(0, 1196, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_trace); + if (value) { values[2] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 3: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ref); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 1196, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_loop = ((struct PyGeventLoopObject *)values[0]); + __pyx_v_pid = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_pid == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1196, __pyx_L3_error) + if (values[2]) { + __pyx_v_trace = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_trace == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1196, __pyx_L3_error) + } else { + __pyx_v_trace = ((int)0); + } + __pyx_v_ref = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1196, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.libev.corecext.child.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_loop), __pyx_ptype_6gevent_5libev_8corecext_loop, 1, "loop", 0))) __PYX_ERR(0, 1196, __pyx_L1_error) + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_5child_2__init__(((struct PyGeventChildObject *)__pyx_v_self), __pyx_v_loop, __pyx_v_pid, __pyx_v_trace, __pyx_v_ref); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_5child_2__init__(struct PyGeventChildObject *__pyx_v_self, struct PyGeventLoopObject *__pyx_v_loop, CYTHON_UNUSED int __pyx_v_pid, CYTHON_UNUSED int __pyx_v_trace, PyObject *__pyx_v_ref) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + __Pyx_RefNannySetupContext("__init__", 0); + + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_6gevent_5libev_8corecext_watcher), __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1197, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + __pyx_t_4 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_4 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[5] = {__pyx_t_3, ((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_loop), __pyx_v_ref, Py_None}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 4+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1197, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[5] = {__pyx_t_3, ((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_loop), __pyx_v_ref, Py_None}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 4+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1197, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else + #endif + { + __pyx_t_5 = PyTuple_New(4+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1197, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (__pyx_t_3) { + __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL; + } + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, ((PyObject *)__pyx_v_self)); + __Pyx_INCREF(((PyObject *)__pyx_v_loop)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_loop)); + PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, ((PyObject *)__pyx_v_loop)); + __Pyx_INCREF(__pyx_v_ref); + __Pyx_GIVEREF(__pyx_v_ref); + PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_4, __pyx_v_ref); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + PyTuple_SET_ITEM(__pyx_t_5, 3+__pyx_t_4, Py_None); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1197, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("gevent.libev.corecext.child.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_5child_5_format(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_5child_5_format(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_format (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_5child_4_format(((struct PyGeventChildObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_5child_4_format(struct PyGeventChildObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("_format", 0); + + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_pid); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1201, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_rstatus); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1201, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1201, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); + __pyx_t_1 = 0; + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_pid_r_rstatus_r, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1201, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("gevent.libev.corecext.child._format", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_5child_3pid_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_5child_3pid_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_5child_3pid___get__(((struct PyGeventChildObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_5child_3pid___get__(struct PyGeventChildObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->_watcher.pid); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1205, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.libev.corecext.child.pid.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_5child_4rpid_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_5child_4rpid_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_5child_4rpid___get__(((struct PyGeventChildObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_5child_4rpid___get__(struct PyGeventChildObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->_watcher.rpid); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1209, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.libev.corecext.child.rpid.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_5child_4rpid_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_value); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_5child_4rpid_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_value) { + int __pyx_v_value; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + assert(__pyx_arg_value); { + __pyx_v_value = __Pyx_PyInt_As_int(__pyx_arg_value); if (unlikely((__pyx_v_value == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1212, __pyx_L3_error) + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.libev.corecext.child.rpid.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_5child_4rpid_2__set__(((struct PyGeventChildObject *)__pyx_v_self), ((int)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_5child_4rpid_2__set__(struct PyGeventChildObject *__pyx_v_self, int __pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__", 0); + + __pyx_v_self->_watcher.rpid = __pyx_v_value; + + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_5child_7rstatus_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_5child_7rstatus_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_5child_7rstatus___get__(((struct PyGeventChildObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_5child_7rstatus___get__(struct PyGeventChildObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->_watcher.rstatus); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1217, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.libev.corecext.child.rstatus.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_5child_7rstatus_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_value); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_5child_7rstatus_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_value) { + int __pyx_v_value; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + assert(__pyx_arg_value); { + __pyx_v_value = __Pyx_PyInt_As_int(__pyx_arg_value); if (unlikely((__pyx_v_value == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1220, __pyx_L3_error) + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.libev.corecext.child.rstatus.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_5child_7rstatus_2__set__(((struct PyGeventChildObject *)__pyx_v_self), ((int)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_5child_7rstatus_2__set__(struct PyGeventChildObject *__pyx_v_self, int __pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__", 0); + + __pyx_v_self->_watcher.rstatus = __pyx_v_value; + + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_4stat_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_4stat_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_loop = 0; + PyObject *__pyx_v_path = 0; + float __pyx_v_interval; + CYTHON_UNUSED PyObject *__pyx_v_ref = 0; + CYTHON_UNUSED PyObject *__pyx_v_priority = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_loop,&__pyx_n_s_path,&__pyx_n_s_interval,&__pyx_n_s_ref,&__pyx_n_s_priority,0}; + PyObject* values[5] = {0,0,0,0,0}; + values[3] = ((PyObject *)Py_True); + values[4] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + CYTHON_FALLTHROUGH; + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_loop)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_path)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 5, 1); __PYX_ERR(0, 1231, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_interval); + if (value) { values[2] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 3: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ref); + if (value) { values[3] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 4: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_priority); + if (value) { values[4] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 1231, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + CYTHON_FALLTHROUGH; + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_loop = ((struct PyGeventLoopObject *)values[0]); + __pyx_v_path = ((PyObject*)values[1]); + if (values[2]) { + __pyx_v_interval = __pyx_PyFloat_AsFloat(values[2]); if (unlikely((__pyx_v_interval == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 1231, __pyx_L3_error) + } else { + __pyx_v_interval = ((float)0.0); + } + __pyx_v_ref = values[3]; + __pyx_v_priority = values[4]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1231, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.libev.corecext.stat.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_loop), __pyx_ptype_6gevent_5libev_8corecext_loop, 1, "loop", 0))) __PYX_ERR(0, 1231, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_path), (&PyString_Type), 1, "path", 1))) __PYX_ERR(0, 1231, __pyx_L1_error) + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4stat___cinit__(((struct PyGeventStatObject *)__pyx_v_self), __pyx_v_loop, __pyx_v_path, __pyx_v_interval, __pyx_v_ref, __pyx_v_priority); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_4stat___cinit__(struct PyGeventStatObject *__pyx_v_self, CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_loop, PyObject *__pyx_v_path, float __pyx_v_interval, CYTHON_UNUSED PyObject *__pyx_v_ref, CYTHON_UNUSED PyObject *__pyx_v_priority) { + PyObject *__pyx_v_paths = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + char *__pyx_t_8; + __Pyx_RefNannySetupContext("__cinit__", 0); + + __Pyx_INCREF(__pyx_v_path); + __Pyx_GIVEREF(__pyx_v_path); + __Pyx_GOTREF(__pyx_v_self->path); + __Pyx_DECREF(__pyx_v_self->path); + __pyx_v_self->path = __pyx_v_path; + + __pyx_t_1 = PyUnicode_Check(__pyx_v_path); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_path, __pyx_n_s_encode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1238, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_sys); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1238, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_getfilesystemencoding); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1238, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7); + if (likely(__pyx_t_6)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_7, function); + } + } + __pyx_t_5 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1238, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_7)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_7); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + } + } + __pyx_t_3 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_7, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1238, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (!(likely(PyBytes_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(0, 1238, __pyx_L1_error) + __pyx_v_paths = ((PyObject*)__pyx_t_3); + __pyx_t_3 = 0; + + __Pyx_INCREF(__pyx_v_paths); + __Pyx_GIVEREF(__pyx_v_paths); + __Pyx_GOTREF(__pyx_v_self->_paths); + __Pyx_DECREF(__pyx_v_self->_paths); + __pyx_v_self->_paths = __pyx_v_paths; + + goto __pyx_L3; + } + + /*else*/ { + __pyx_t_3 = __pyx_v_path; + __Pyx_INCREF(__pyx_t_3); + __pyx_v_paths = ((PyObject*)__pyx_t_3); + __pyx_t_3 = 0; + + __Pyx_INCREF(__pyx_v_paths); + __Pyx_GIVEREF(__pyx_v_paths); + __Pyx_GOTREF(__pyx_v_self->_paths); + __Pyx_DECREF(__pyx_v_self->_paths); + __pyx_v_self->_paths = __pyx_v_paths; + } + __pyx_L3:; + + if (unlikely(__pyx_v_paths == Py_None)) { + PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); + __PYX_ERR(0, 1243, __pyx_L1_error) + } + __pyx_t_8 = __Pyx_PyBytes_AsWritableString(__pyx_v_paths); if (unlikely((!__pyx_t_8) && PyErr_Occurred())) __PYX_ERR(0, 1243, __pyx_L1_error) + ev_stat_init((&__pyx_v_self->_watcher), ((void *)gevent_callback_stat), ((char *)__pyx_t_8), __pyx_v_interval); + + __pyx_v_self->__pyx_base.__pyx___watcher = ((struct ev_watcher *)(&__pyx_v_self->_watcher)); + + __pyx_v_self->__pyx_base.__pyx___ss = (&__pyx_v_6gevent_5libev_8corecext_stat_ss); + + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("gevent.libev.corecext.stat.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_paths); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_4stat_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_4stat_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + struct PyGeventLoopObject *__pyx_v_loop = 0; + CYTHON_UNUSED PyObject *__pyx_v_path = 0; + CYTHON_UNUSED float __pyx_v_interval; + PyObject *__pyx_v_ref = 0; + PyObject *__pyx_v_priority = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_loop,&__pyx_n_s_path,&__pyx_n_s_interval,&__pyx_n_s_ref,&__pyx_n_s_priority,0}; + PyObject* values[5] = {0,0,0,0,0}; + values[3] = ((PyObject *)Py_True); + values[4] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + CYTHON_FALLTHROUGH; + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_loop)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_path)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 5, 1); __PYX_ERR(0, 1247, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_interval); + if (value) { values[2] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 3: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ref); + if (value) { values[3] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 4: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_priority); + if (value) { values[4] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 1247, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + CYTHON_FALLTHROUGH; + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_loop = ((struct PyGeventLoopObject *)values[0]); + __pyx_v_path = ((PyObject*)values[1]); + if (values[2]) { + __pyx_v_interval = __pyx_PyFloat_AsFloat(values[2]); if (unlikely((__pyx_v_interval == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 1247, __pyx_L3_error) + } else { + __pyx_v_interval = ((float)0.0); + } + __pyx_v_ref = values[3]; + __pyx_v_priority = values[4]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1247, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.libev.corecext.stat.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_loop), __pyx_ptype_6gevent_5libev_8corecext_loop, 1, "loop", 0))) __PYX_ERR(0, 1247, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_path), (&PyString_Type), 1, "path", 1))) __PYX_ERR(0, 1247, __pyx_L1_error) + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4stat_2__init__(((struct PyGeventStatObject *)__pyx_v_self), __pyx_v_loop, __pyx_v_path, __pyx_v_interval, __pyx_v_ref, __pyx_v_priority); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_4stat_2__init__(struct PyGeventStatObject *__pyx_v_self, struct PyGeventLoopObject *__pyx_v_loop, CYTHON_UNUSED PyObject *__pyx_v_path, CYTHON_UNUSED float __pyx_v_interval, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + __Pyx_RefNannySetupContext("__init__", 0); + + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_6gevent_5libev_8corecext_watcher), __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1248, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + __pyx_t_4 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_4 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[5] = {__pyx_t_3, ((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_loop), __pyx_v_ref, __pyx_v_priority}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 4+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1248, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[5] = {__pyx_t_3, ((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_loop), __pyx_v_ref, __pyx_v_priority}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 4+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1248, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else + #endif + { + __pyx_t_5 = PyTuple_New(4+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1248, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (__pyx_t_3) { + __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL; + } + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, ((PyObject *)__pyx_v_self)); + __Pyx_INCREF(((PyObject *)__pyx_v_loop)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_loop)); + PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, ((PyObject *)__pyx_v_loop)); + __Pyx_INCREF(__pyx_v_ref); + __Pyx_GIVEREF(__pyx_v_ref); + PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_4, __pyx_v_ref); + __Pyx_INCREF(__pyx_v_priority); + __Pyx_GIVEREF(__pyx_v_priority); + PyTuple_SET_ITEM(__pyx_t_5, 3+__pyx_t_4, __pyx_v_priority); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1248, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("gevent.libev.corecext.stat.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4stat_4attr_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4stat_4attr_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4stat_4attr___get__(((struct PyGeventStatObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4stat_4attr___get__(struct PyGeventStatObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + __pyx_t_1 = ((!(__pyx_v_self->_watcher.attr.st_nlink != 0)) != 0); + if (__pyx_t_1) { + + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + + } + + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = _pystat_fromstructstat((&__pyx_v_self->_watcher.attr)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1255, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent.libev.corecext.stat.attr.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4stat_4prev_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4stat_4prev_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4stat_4prev___get__(((struct PyGeventStatObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4stat_4prev___get__(struct PyGeventStatObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + __pyx_t_1 = ((!(__pyx_v_self->_watcher.prev.st_nlink != 0)) != 0); + if (__pyx_t_1) { + + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + + } + + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = _pystat_fromstructstat((&__pyx_v_self->_watcher.prev)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1261, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent.libev.corecext.stat.prev.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4stat_8interval_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4stat_8interval_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4stat_8interval___get__(((struct PyGeventStatObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4stat_8interval___get__(struct PyGeventStatObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->_watcher.interval); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1265, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.libev.corecext.stat.interval.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4stat_4path_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4stat_4path_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4stat_4path___get__(((struct PyGeventStatObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4stat_4path___get__(struct PyGeventStatObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->path); + __pyx_r = __pyx_v_self->path; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4stat_6_paths_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4stat_6_paths_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4stat_6_paths___get__(((struct PyGeventStatObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4stat_6_paths___get__(struct PyGeventStatObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->_paths); + __pyx_r = __pyx_v_self->_paths; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +static void __pyx_f_6gevent_5libev_8corecext__syserr_cb(char *__pyx_v_msg) { + PyObject *__pyx_v_print_exc = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + int __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + int __pyx_t_11; + int __pyx_t_12; + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_RefNannySetupContext("_syserr_cb", 0); + + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_SYSERR_CALLBACK); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1274, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_msg); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1274, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = __Pyx_PyInt_From_int(errno); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1274, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = NULL; + __pyx_t_9 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5); + if (likely(__pyx_t_8)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_8); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_5, function); + __pyx_t_9 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_5)) { + PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_t_6, __pyx_t_7}; + __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1274, __pyx_L3_error) + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { + PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_t_6, __pyx_t_7}; + __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1274, __pyx_L3_error) + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } else + #endif + { + __pyx_t_10 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1274, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_10); + if (__pyx_t_8) { + __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_8); __pyx_t_8 = NULL; + } + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_9, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_9, __pyx_t_7); + __pyx_t_6 = 0; + __pyx_t_7 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_10, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1274, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + } + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L8_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + + /*except:*/ { + __Pyx_AddTraceback("gevent.libev.corecext._syserr_cb", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_5, &__pyx_t_10) < 0) __PYX_ERR(0, 1275, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_10); + + __pyx_t_7 = __pyx_f_6gevent_5libev_8corecext_set_syserr_cb(Py_None, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1276, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_traceback); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1277, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_6 = __Pyx_GetAttr3(__pyx_t_7, __pyx_n_s_print_exc, Py_None); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1277, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_v_print_exc = __pyx_t_6; + __pyx_t_6 = 0; + + __pyx_t_11 = (__pyx_v_print_exc != Py_None); + __pyx_t_12 = (__pyx_t_11 != 0); + if (__pyx_t_12) { + + __Pyx_INCREF(__pyx_v_print_exc); + __pyx_t_7 = __pyx_v_print_exc; __pyx_t_8 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) { + __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); + if (likely(__pyx_t_8)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); + __Pyx_INCREF(__pyx_t_8); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_7, function); + } + } + __pyx_t_6 = (__pyx_t_8) ? __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_8) : __Pyx_PyObject_CallNoArg(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1279, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + } + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + goto __pyx_L4_exception_handled; + } + __pyx_L5_except_error:; + + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L8_try_end:; + } + + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_WriteUnraisable("gevent.libev.corecext._syserr_cb", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_print_exc); + __Pyx_RefNannyFinishContext(); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif +} + + +static PyObject *__pyx_pw_6gevent_5libev_8corecext_21set_syserr_cb(PyObject *__pyx_self, PyObject *__pyx_v_callback); /*proto*/ +static PyObject *__pyx_f_6gevent_5libev_8corecext_set_syserr_cb(PyObject *__pyx_v_callback, CYTHON_UNUSED int __pyx_skip_dispatch) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + __Pyx_RefNannySetupContext("set_syserr_cb", 0); + + __pyx_t_1 = (__pyx_v_callback == Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + ev_set_syserr_cb(NULL); + + if (PyDict_SetItem(__pyx_d, __pyx_n_s_SYSERR_CALLBACK, Py_None) < 0) __PYX_ERR(0, 1286, __pyx_L1_error) + + goto __pyx_L3; + } + + __pyx_t_2 = __Pyx_PyCallable_Check(__pyx_v_callback); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 1287, __pyx_L1_error) + __pyx_t_1 = (__pyx_t_2 != 0); + if (likely(__pyx_t_1)) { + + ev_set_syserr_cb(((void *)__pyx_f_6gevent_5libev_8corecext__syserr_cb)); + + if (PyDict_SetItem(__pyx_d, __pyx_n_s_SYSERR_CALLBACK, __pyx_v_callback) < 0) __PYX_ERR(0, 1289, __pyx_L1_error) + + goto __pyx_L3; + } + + /*else*/ { + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1291, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_callback); + __Pyx_GIVEREF(__pyx_v_callback); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_callback); + __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Expected_callable_or_None_got_r, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1291, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1291, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(0, 1291, __pyx_L1_error) + } + __pyx_L3:; + + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("gevent.libev.corecext.set_syserr_cb", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_21set_syserr_cb(PyObject *__pyx_self, PyObject *__pyx_v_callback); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_21set_syserr_cb(PyObject *__pyx_self, PyObject *__pyx_v_callback) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("set_syserr_cb (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_20set_syserr_cb(__pyx_self, ((PyObject *)__pyx_v_callback)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_20set_syserr_cb(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_callback) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("set_syserr_cb", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6gevent_5libev_8corecext_set_syserr_cb(__pyx_v_callback, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1282, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.libev.corecext.set_syserr_cb", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +void gevent_handle_error(struct PyGeventLoopObject *__pyx_v_loop, PyObject *__pyx_v_context) { + PyObject *__pyx_v_typep; + PyObject *__pyx_v_valuep; + PyObject *__pyx_v_tracebackp; + PyObject *__pyx_v_type = 0; + PyObject *__pyx_v_value = 0; + PyObject *__pyx_v_traceback = 0; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("gevent_handle_error", 0); + + __Pyx_INCREF(Py_None); + __pyx_v_value = Py_None; + + __Pyx_INCREF(Py_None); + __pyx_v_traceback = Py_None; + + PyErr_Fetch((&__pyx_v_typep), (&__pyx_v_valuep), (&__pyx_v_tracebackp)); + + __pyx_t_1 = ((!(__pyx_v_typep != 0)) != 0); + if (__pyx_t_1) { + + goto __pyx_L0; + + } + + __pyx_t_2 = ((PyObject *)__pyx_v_typep); + __Pyx_INCREF(__pyx_t_2); + __pyx_v_type = __pyx_t_2; + __pyx_t_2 = 0; + + Py_DECREF(__pyx_v_type); + + __pyx_t_1 = (__pyx_v_valuep != 0); + if (__pyx_t_1) { + + __pyx_t_2 = ((PyObject *)__pyx_v_valuep); + __Pyx_INCREF(__pyx_t_2); + __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_2); + __pyx_t_2 = 0; + + Py_DECREF(__pyx_v_value); + + } + + __pyx_t_1 = (__pyx_v_tracebackp != 0); + if (__pyx_t_1) { + + __pyx_t_2 = ((PyObject *)__pyx_v_tracebackp); + __Pyx_INCREF(__pyx_t_2); + __Pyx_DECREF_SET(__pyx_v_traceback, __pyx_t_2); + __pyx_t_2 = 0; + + Py_DECREF(__pyx_v_traceback); + + } + + __pyx_t_2 = ((struct __pyx_vtabstruct_6gevent_5libev_8corecext_loop *)__pyx_v_loop->__pyx_vtab)->handle_error(__pyx_v_loop, __pyx_v_context, __pyx_v_type, __pyx_v_value, __pyx_v_traceback, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1347, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_WriteUnraisable("gevent.libev.corecext.gevent_handle_error", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_type); + __Pyx_XDECREF(__pyx_v_value); + __Pyx_XDECREF(__pyx_v_traceback); + __Pyx_RefNannyFinishContext(); +} + + +PyObject *gevent_loop_run_callbacks(struct PyGeventLoopObject *__pyx_v_loop) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("gevent_loop_run_callbacks", 0); + + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_5libev_8corecext_loop *)__pyx_v_loop->__pyx_vtab)->_run_callbacks(__pyx_v_loop); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1352, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.libev.corecext.gevent_loop_run_callbacks", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_tp_new_6gevent_5libev_8corecext__EVENTSType(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + PyObject *o; + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + return o; +} + +static void __pyx_tp_dealloc_6gevent_5libev_8corecext__EVENTSType(PyObject *o) { + #if CYTHON_USE_TP_FINALIZE + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + (*Py_TYPE(o)->tp_free)(o); +} + +static PyMethodDef __pyx_methods_6gevent_5libev_8corecext__EVENTSType[] = { + {0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_6gevent_5libev_8corecext__EVENTSType = { + PyVarObject_HEAD_INIT(0, 0) + "gevent.libev.corecext._EVENTSType", /*tp_name*/ + sizeof(struct __pyx_obj_6gevent_5libev_8corecext__EVENTSType), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6gevent_5libev_8corecext__EVENTSType, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + __pyx_pw_6gevent_5libev_8corecext_11_EVENTSType_1__repr__, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ + 0, /*tp_doc*/ + 0, /*tp_traverse*/ + 0, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6gevent_5libev_8corecext__EVENTSType, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6gevent_5libev_8corecext__EVENTSType, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static PyObject *__pyx_tp_new_6gevent_5libev_8corecext_callback(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + struct PyGeventCallbackObject *p; + PyObject *o; + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + p = ((struct PyGeventCallbackObject *)o); + p->callback = Py_None; Py_INCREF(Py_None); + p->args = ((PyObject*)Py_None); Py_INCREF(Py_None); + p->next = ((struct PyGeventCallbackObject *)Py_None); Py_INCREF(Py_None); + return o; +} + +static void __pyx_tp_dealloc_6gevent_5libev_8corecext_callback(PyObject *o) { + struct PyGeventCallbackObject *p = (struct PyGeventCallbackObject *)o; + #if CYTHON_USE_TP_FINALIZE + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + PyObject_GC_UnTrack(o); + Py_CLEAR(p->callback); + Py_CLEAR(p->args); + Py_CLEAR(p->next); + (*Py_TYPE(o)->tp_free)(o); +} + +static int __pyx_tp_traverse_6gevent_5libev_8corecext_callback(PyObject *o, visitproc v, void *a) { + int e; + struct PyGeventCallbackObject *p = (struct PyGeventCallbackObject *)o; + if (p->callback) { + e = (*v)(p->callback, a); if (e) return e; + } + if (p->args) { + e = (*v)(p->args, a); if (e) return e; + } + if (p->next) { + e = (*v)(((PyObject *)p->next), a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_6gevent_5libev_8corecext_callback(PyObject *o) { + PyObject* tmp; + struct PyGeventCallbackObject *p = (struct PyGeventCallbackObject *)o; + tmp = ((PyObject*)p->callback); + p->callback = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->args); + p->args = ((PyObject*)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->next); + p->next = ((struct PyGeventCallbackObject *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_8callback_pending(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_8callback_7pending_1__get__(o); +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_8callback_callback(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_8callback_8callback_1__get__(o); +} + +static int __pyx_setprop_6gevent_5libev_8corecext_8callback_callback(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6gevent_5libev_8corecext_8callback_8callback_3__set__(o, v); + } + else { + return __pyx_pw_6gevent_5libev_8corecext_8callback_8callback_5__del__(o); + } +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_8callback_args(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_8callback_4args_1__get__(o); +} + +static int __pyx_setprop_6gevent_5libev_8corecext_8callback_args(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6gevent_5libev_8corecext_8callback_4args_3__set__(o, v); + } + else { + return __pyx_pw_6gevent_5libev_8corecext_8callback_4args_5__del__(o); + } +} + +static PyMethodDef __pyx_methods_6gevent_5libev_8corecext_callback[] = { + {"stop", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_8callback_3stop, METH_NOARGS, 0}, + {"_format", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_8callback_9_format, METH_NOARGS, 0}, + {0, 0, 0, 0} +}; + +static struct PyGetSetDef __pyx_getsets_6gevent_5libev_8corecext_callback[] = { + {(char *)"pending", __pyx_getprop_6gevent_5libev_8corecext_8callback_pending, 0, (char *)0, 0}, + {(char *)"callback", __pyx_getprop_6gevent_5libev_8corecext_8callback_callback, __pyx_setprop_6gevent_5libev_8corecext_8callback_callback, (char *)0, 0}, + {(char *)"args", __pyx_getprop_6gevent_5libev_8corecext_8callback_args, __pyx_setprop_6gevent_5libev_8corecext_8callback_args, (char *)0, 0}, + {0, 0, 0, 0, 0} +}; + +static PyNumberMethods __pyx_tp_as_number_callback = { + 0, /*nb_add*/ + 0, /*nb_subtract*/ + 0, /*nb_multiply*/ + #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) + 0, /*nb_divide*/ + #endif + 0, /*nb_remainder*/ + 0, /*nb_divmod*/ + 0, /*nb_power*/ + 0, /*nb_negative*/ + 0, /*nb_positive*/ + 0, /*nb_absolute*/ + __pyx_pw_6gevent_5libev_8corecext_8callback_5__nonzero__, /*nb_nonzero*/ + 0, /*nb_invert*/ + 0, /*nb_lshift*/ + 0, /*nb_rshift*/ + 0, /*nb_and*/ + 0, /*nb_xor*/ + 0, /*nb_or*/ + #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) + 0, /*nb_coerce*/ + #endif + 0, /*nb_int*/ + #if PY_MAJOR_VERSION < 3 + 0, /*nb_long*/ + #else + 0, /*reserved*/ + #endif + 0, /*nb_float*/ + #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) + 0, /*nb_oct*/ + #endif + #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) + 0, /*nb_hex*/ + #endif + 0, /*nb_inplace_add*/ + 0, /*nb_inplace_subtract*/ + 0, /*nb_inplace_multiply*/ + #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) + 0, /*nb_inplace_divide*/ + #endif + 0, /*nb_inplace_remainder*/ + 0, /*nb_inplace_power*/ + 0, /*nb_inplace_lshift*/ + 0, /*nb_inplace_rshift*/ + 0, /*nb_inplace_and*/ + 0, /*nb_inplace_xor*/ + 0, /*nb_inplace_or*/ + 0, /*nb_floor_divide*/ + 0, /*nb_true_divide*/ + 0, /*nb_inplace_floor_divide*/ + 0, /*nb_inplace_true_divide*/ + 0, /*nb_index*/ + #if PY_VERSION_HEX >= 0x03050000 + 0, /*nb_matrix_multiply*/ + #endif + #if PY_VERSION_HEX >= 0x03050000 + 0, /*nb_inplace_matrix_multiply*/ + #endif +}; + +DL_EXPORT(PyTypeObject) PyGeventCallback_Type = { + PyVarObject_HEAD_INIT(0, 0) + "gevent.libev.corecext.callback", /*tp_name*/ + sizeof(struct PyGeventCallbackObject), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6gevent_5libev_8corecext_callback, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + __pyx_pw_6gevent_5libev_8corecext_8callback_7__repr__, /*tp_repr*/ + &__pyx_tp_as_number_callback, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_6gevent_5libev_8corecext_callback, /*tp_traverse*/ + __pyx_tp_clear_6gevent_5libev_8corecext_callback, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6gevent_5libev_8corecext_callback, /*tp_methods*/ + 0, /*tp_members*/ + __pyx_getsets_6gevent_5libev_8corecext_callback, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_pw_6gevent_5libev_8corecext_8callback_1__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6gevent_5libev_8corecext_callback, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; +static struct __pyx_vtabstruct_6gevent_5libev_8corecext_CallbackFIFO __pyx_vtable_6gevent_5libev_8corecext_CallbackFIFO; + +static PyObject *__pyx_tp_new_6gevent_5libev_8corecext_CallbackFIFO(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *p; + PyObject *o; + o = (*t->tp_alloc)(t, 0); + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *)o); + p->__pyx_vtab = __pyx_vtabptr_6gevent_5libev_8corecext_CallbackFIFO; + p->head = ((struct PyGeventCallbackObject *)Py_None); Py_INCREF(Py_None); + p->tail = ((struct PyGeventCallbackObject *)Py_None); Py_INCREF(Py_None); + return o; +} + +static void __pyx_tp_dealloc_6gevent_5libev_8corecext_CallbackFIFO(PyObject *o) { + struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *p = (struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *)o; + PyObject_GC_UnTrack(o); + Py_CLEAR(p->head); + Py_CLEAR(p->tail); + (*Py_TYPE(o)->tp_free)(o); +} + +static int __pyx_tp_traverse_6gevent_5libev_8corecext_CallbackFIFO(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *p = (struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *)o; + if (p->head) { + e = (*v)(((PyObject *)p->head), a); if (e) return e; + } + if (p->tail) { + e = (*v)(((PyObject *)p->tail), a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_6gevent_5libev_8corecext_CallbackFIFO(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *p = (struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *)o; + tmp = ((PyObject*)p->head); + p->head = ((struct PyGeventCallbackObject *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->tail); + p->tail = ((struct PyGeventCallbackObject *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyMethodDef __pyx_methods_6gevent_5libev_8corecext_CallbackFIFO[] = { + {0, 0, 0, 0} +}; + +static PyNumberMethods __pyx_tp_as_number_CallbackFIFO = { + 0, /*nb_add*/ + 0, /*nb_subtract*/ + 0, /*nb_multiply*/ + #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) + 0, /*nb_divide*/ + #endif + 0, /*nb_remainder*/ + 0, /*nb_divmod*/ + 0, /*nb_power*/ + 0, /*nb_negative*/ + 0, /*nb_positive*/ + 0, /*nb_absolute*/ + __pyx_pw_6gevent_5libev_8corecext_12CallbackFIFO_3__nonzero__, /*nb_nonzero*/ + 0, /*nb_invert*/ + 0, /*nb_lshift*/ + 0, /*nb_rshift*/ + 0, /*nb_and*/ + 0, /*nb_xor*/ + 0, /*nb_or*/ + #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) + 0, /*nb_coerce*/ + #endif + 0, /*nb_int*/ + #if PY_MAJOR_VERSION < 3 + 0, /*nb_long*/ + #else + 0, /*reserved*/ + #endif + 0, /*nb_float*/ + #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) + 0, /*nb_oct*/ + #endif + #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) + 0, /*nb_hex*/ + #endif + 0, /*nb_inplace_add*/ + 0, /*nb_inplace_subtract*/ + 0, /*nb_inplace_multiply*/ + #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) + 0, /*nb_inplace_divide*/ + #endif + 0, /*nb_inplace_remainder*/ + 0, /*nb_inplace_power*/ + 0, /*nb_inplace_lshift*/ + 0, /*nb_inplace_rshift*/ + 0, /*nb_inplace_and*/ + 0, /*nb_inplace_xor*/ + 0, /*nb_inplace_or*/ + 0, /*nb_floor_divide*/ + 0, /*nb_true_divide*/ + 0, /*nb_inplace_floor_divide*/ + 0, /*nb_inplace_true_divide*/ + 0, /*nb_index*/ + #if PY_VERSION_HEX >= 0x03050000 + 0, /*nb_matrix_multiply*/ + #endif + #if PY_VERSION_HEX >= 0x03050000 + 0, /*nb_inplace_matrix_multiply*/ + #endif +}; + +static PySequenceMethods __pyx_tp_as_sequence_CallbackFIFO = { + __pyx_pw_6gevent_5libev_8corecext_12CallbackFIFO_5__len__, /*sq_length*/ + 0, /*sq_concat*/ + 0, /*sq_repeat*/ + 0, /*sq_item*/ + 0, /*sq_slice*/ + 0, /*sq_ass_item*/ + 0, /*sq_ass_slice*/ + 0, /*sq_contains*/ + 0, /*sq_inplace_concat*/ + 0, /*sq_inplace_repeat*/ +}; + +static PyMappingMethods __pyx_tp_as_mapping_CallbackFIFO = { + __pyx_pw_6gevent_5libev_8corecext_12CallbackFIFO_5__len__, /*mp_length*/ + 0, /*mp_subscript*/ + 0, /*mp_ass_subscript*/ +}; + +static PyTypeObject __pyx_type_6gevent_5libev_8corecext_CallbackFIFO = { + PyVarObject_HEAD_INIT(0, 0) + "gevent.libev.corecext.CallbackFIFO", /*tp_name*/ + sizeof(struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6gevent_5libev_8corecext_CallbackFIFO, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + __pyx_pw_6gevent_5libev_8corecext_12CallbackFIFO_9__repr__, /*tp_repr*/ + &__pyx_tp_as_number_CallbackFIFO, /*tp_as_number*/ + &__pyx_tp_as_sequence_CallbackFIFO, /*tp_as_sequence*/ + &__pyx_tp_as_mapping_CallbackFIFO, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_6gevent_5libev_8corecext_CallbackFIFO, /*tp_traverse*/ + __pyx_tp_clear_6gevent_5libev_8corecext_CallbackFIFO, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + __pyx_pw_6gevent_5libev_8corecext_12CallbackFIFO_7__iter__, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6gevent_5libev_8corecext_CallbackFIFO, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_pw_6gevent_5libev_8corecext_12CallbackFIFO_1__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6gevent_5libev_8corecext_CallbackFIFO, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; +static struct __pyx_vtabstruct_6gevent_5libev_8corecext_loop __pyx_vtable_6gevent_5libev_8corecext_loop; + +static PyObject *__pyx_tp_new_6gevent_5libev_8corecext_loop(PyTypeObject *t, PyObject *a, PyObject *k) { + struct PyGeventLoopObject *p; + PyObject *o; + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + p = ((struct PyGeventLoopObject *)o); + p->__pyx_vtab = __pyx_vtabptr_6gevent_5libev_8corecext_loop; + p->error_handler = Py_None; Py_INCREF(Py_None); + p->_callbacks = ((struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *)Py_None); Py_INCREF(Py_None); + if (unlikely(__pyx_pw_6gevent_5libev_8corecext_4loop_1__cinit__(o, a, k) < 0)) goto bad; + return o; + bad: + Py_DECREF(o); o = 0; + return NULL; +} + +static void __pyx_tp_dealloc_6gevent_5libev_8corecext_loop(PyObject *o) { + struct PyGeventLoopObject *p = (struct PyGeventLoopObject *)o; + #if CYTHON_USE_TP_FINALIZE + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + PyObject_GC_UnTrack(o); + { + PyObject *etype, *eval, *etb; + PyErr_Fetch(&etype, &eval, &etb); + ++Py_REFCNT(o); + __pyx_pw_6gevent_5libev_8corecext_4loop_7__dealloc__(o); + --Py_REFCNT(o); + PyErr_Restore(etype, eval, etb); + } + Py_CLEAR(p->error_handler); + Py_CLEAR(p->_callbacks); + (*Py_TYPE(o)->tp_free)(o); +} + +static int __pyx_tp_traverse_6gevent_5libev_8corecext_loop(PyObject *o, visitproc v, void *a) { + int e; + struct PyGeventLoopObject *p = (struct PyGeventLoopObject *)o; + if (p->error_handler) { + e = (*v)(p->error_handler, a); if (e) return e; + } + if (p->_callbacks) { + e = (*v)(((PyObject *)p->_callbacks), a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_6gevent_5libev_8corecext_loop(PyObject *o) { + PyObject* tmp; + struct PyGeventLoopObject *p = (struct PyGeventLoopObject *)o; + tmp = ((PyObject*)p->error_handler); + p->error_handler = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->_callbacks); + p->_callbacks = ((struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_4loop_ptr(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_4loop_3ptr_1__get__(o); +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_4loop_WatcherType(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_4loop_11WatcherType_1__get__(o); +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_4loop_MAXPRI(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_4loop_6MAXPRI_1__get__(o); +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_4loop_MINPRI(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_4loop_6MINPRI_1__get__(o); +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_4loop_default(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_4loop_7default_1__get__(o); +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_4loop_iteration(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_4loop_9iteration_1__get__(o); +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_4loop_depth(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_4loop_5depth_1__get__(o); +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_4loop_backend_int(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_4loop_11backend_int_1__get__(o); +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_4loop_backend(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_4loop_7backend_1__get__(o); +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_4loop_pendingcnt(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_4loop_10pendingcnt_1__get__(o); +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_4loop_activecnt(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_4loop_9activecnt_1__get__(o); +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_4loop_sig_pending(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_4loop_11sig_pending_1__get__(o); +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_4loop_origflags(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_4loop_9origflags_1__get__(o); +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_4loop_origflags_int(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_4loop_13origflags_int_1__get__(o); +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_4loop_sigfd(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_4loop_5sigfd_1__get__(o); +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_4loop_error_handler(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_4loop_13error_handler_1__get__(o); +} + +static int __pyx_setprop_6gevent_5libev_8corecext_4loop_error_handler(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6gevent_5libev_8corecext_4loop_13error_handler_3__set__(o, v); + } + else { + return __pyx_pw_6gevent_5libev_8corecext_4loop_13error_handler_5__del__(o); + } +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_4loop__callbacks(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_4loop_10_callbacks_1__get__(o); +} + +static int __pyx_setprop_6gevent_5libev_8corecext_4loop__callbacks(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6gevent_5libev_8corecext_4loop_10_callbacks_3__set__(o, v); + } + else { + return __pyx_pw_6gevent_5libev_8corecext_4loop_10_callbacks_5__del__(o); + } +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_4loop_approx_timer_resolution(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_4loop_23approx_timer_resolution_1__get__(o); +} + +static PyMethodDef __pyx_methods_6gevent_5libev_8corecext_loop[] = { + {"destroy", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_4loop_5destroy, METH_NOARGS, 0}, + {"_handle_syserr", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_5libev_8corecext_4loop_9_handle_syserr, METH_VARARGS|METH_KEYWORDS, 0}, + {"handle_error", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_5libev_8corecext_4loop_11handle_error, METH_VARARGS|METH_KEYWORDS, 0}, + {"_default_handle_error", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_5libev_8corecext_4loop_13_default_handle_error, METH_VARARGS|METH_KEYWORDS, 0}, + {"run", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_5libev_8corecext_4loop_15run, METH_VARARGS|METH_KEYWORDS, 0}, + {"reinit", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_4loop_17reinit, METH_NOARGS, 0}, + {"ref", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_4loop_19ref, METH_NOARGS, 0}, + {"unref", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_4loop_21unref, METH_NOARGS, 0}, + {"break_", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_5libev_8corecext_4loop_23break_, METH_VARARGS|METH_KEYWORDS, 0}, + {"verify", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_4loop_25verify, METH_NOARGS, 0}, + {"now", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_4loop_27now, METH_NOARGS, 0}, + {"update_now", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_4loop_29update_now, METH_NOARGS, 0}, + {"io", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_5libev_8corecext_4loop_33io, METH_VARARGS|METH_KEYWORDS, 0}, + {"timer", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_5libev_8corecext_4loop_35timer, METH_VARARGS|METH_KEYWORDS, 0}, + {"signal", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_5libev_8corecext_4loop_37signal, METH_VARARGS|METH_KEYWORDS, 0}, + {"idle", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_5libev_8corecext_4loop_39idle, METH_VARARGS|METH_KEYWORDS, 0}, + {"prepare", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_5libev_8corecext_4loop_41prepare, METH_VARARGS|METH_KEYWORDS, 0}, + {"check", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_5libev_8corecext_4loop_43check, METH_VARARGS|METH_KEYWORDS, 0}, + {"fork", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_5libev_8corecext_4loop_45fork, METH_VARARGS|METH_KEYWORDS, 0}, + {"async_", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_5libev_8corecext_4loop_47async_, METH_VARARGS|METH_KEYWORDS, 0}, + {"child", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_5libev_8corecext_4loop_49child, METH_VARARGS|METH_KEYWORDS, 0}, + {"install_sigchld", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_4loop_51install_sigchld, METH_NOARGS, 0}, + {"reset_sigchld", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_4loop_53reset_sigchld, METH_NOARGS, 0}, + {"stat", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_5libev_8corecext_4loop_55stat, METH_VARARGS|METH_KEYWORDS, 0}, + {"run_callback", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_5libev_8corecext_4loop_57run_callback, METH_VARARGS|METH_KEYWORDS, 0}, + {"_format", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_4loop_59_format, METH_NOARGS, 0}, + {"_format_details", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_4loop_61_format_details, METH_NOARGS, 0}, + {"fileno", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_4loop_63fileno, METH_NOARGS, 0}, + {0, 0, 0, 0} +}; + +static struct PyGetSetDef __pyx_getsets_6gevent_5libev_8corecext_loop[] = { + {(char *)"ptr", __pyx_getprop_6gevent_5libev_8corecext_4loop_ptr, 0, (char *)0, 0}, + {(char *)"WatcherType", __pyx_getprop_6gevent_5libev_8corecext_4loop_WatcherType, 0, (char *)0, 0}, + {(char *)"MAXPRI", __pyx_getprop_6gevent_5libev_8corecext_4loop_MAXPRI, 0, (char *)0, 0}, + {(char *)"MINPRI", __pyx_getprop_6gevent_5libev_8corecext_4loop_MINPRI, 0, (char *)0, 0}, + {(char *)"default", __pyx_getprop_6gevent_5libev_8corecext_4loop_default, 0, (char *)0, 0}, + {(char *)"iteration", __pyx_getprop_6gevent_5libev_8corecext_4loop_iteration, 0, (char *)0, 0}, + {(char *)"depth", __pyx_getprop_6gevent_5libev_8corecext_4loop_depth, 0, (char *)0, 0}, + {(char *)"backend_int", __pyx_getprop_6gevent_5libev_8corecext_4loop_backend_int, 0, (char *)0, 0}, + {(char *)"backend", __pyx_getprop_6gevent_5libev_8corecext_4loop_backend, 0, (char *)0, 0}, + {(char *)"pendingcnt", __pyx_getprop_6gevent_5libev_8corecext_4loop_pendingcnt, 0, (char *)0, 0}, + {(char *)"activecnt", __pyx_getprop_6gevent_5libev_8corecext_4loop_activecnt, 0, (char *)0, 0}, + {(char *)"sig_pending", __pyx_getprop_6gevent_5libev_8corecext_4loop_sig_pending, 0, (char *)0, 0}, + {(char *)"origflags", __pyx_getprop_6gevent_5libev_8corecext_4loop_origflags, 0, (char *)0, 0}, + {(char *)"origflags_int", __pyx_getprop_6gevent_5libev_8corecext_4loop_origflags_int, 0, (char *)0, 0}, + {(char *)"sigfd", __pyx_getprop_6gevent_5libev_8corecext_4loop_sigfd, 0, (char *)0, 0}, + {(char *)"error_handler", __pyx_getprop_6gevent_5libev_8corecext_4loop_error_handler, __pyx_setprop_6gevent_5libev_8corecext_4loop_error_handler, (char *)0, 0}, + {(char *)"_callbacks", __pyx_getprop_6gevent_5libev_8corecext_4loop__callbacks, __pyx_setprop_6gevent_5libev_8corecext_4loop__callbacks, (char *)0, 0}, + {(char *)"approx_timer_resolution", __pyx_getprop_6gevent_5libev_8corecext_4loop_approx_timer_resolution, 0, (char *)0, 0}, + {0, 0, 0, 0, 0} +}; + +DL_EXPORT(PyTypeObject) PyGeventLoop_Type = { + PyVarObject_HEAD_INIT(0, 0) + "gevent.libev.corecext.loop", /*tp_name*/ + sizeof(struct PyGeventLoopObject), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6gevent_5libev_8corecext_loop, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + __pyx_pw_6gevent_5libev_8corecext_4loop_31__repr__, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_6gevent_5libev_8corecext_loop, /*tp_traverse*/ + __pyx_tp_clear_6gevent_5libev_8corecext_loop, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6gevent_5libev_8corecext_loop, /*tp_methods*/ + 0, /*tp_members*/ + __pyx_getsets_6gevent_5libev_8corecext_loop, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_pw_6gevent_5libev_8corecext_4loop_3__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6gevent_5libev_8corecext_loop, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static PyObject *__pyx_tp_new_6gevent_5libev_8corecext_watcher(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + struct PyGeventWatcherObject *p; + PyObject *o; + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + p = ((struct PyGeventWatcherObject *)o); + p->loop = ((struct PyGeventLoopObject *)Py_None); Py_INCREF(Py_None); + p->_callback = Py_None; Py_INCREF(Py_None); + p->args = ((PyObject*)Py_None); Py_INCREF(Py_None); + return o; +} + +static void __pyx_tp_dealloc_6gevent_5libev_8corecext_watcher(PyObject *o) { + struct PyGeventWatcherObject *p = (struct PyGeventWatcherObject *)o; + #if CYTHON_USE_TP_FINALIZE + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + PyObject_GC_UnTrack(o); + Py_CLEAR(p->loop); + Py_CLEAR(p->_callback); + Py_CLEAR(p->args); + (*Py_TYPE(o)->tp_free)(o); +} + +static int __pyx_tp_traverse_6gevent_5libev_8corecext_watcher(PyObject *o, visitproc v, void *a) { + int e; + struct PyGeventWatcherObject *p = (struct PyGeventWatcherObject *)o; + if (p->loop) { + e = (*v)(((PyObject *)p->loop), a); if (e) return e; + } + if (p->_callback) { + e = (*v)(p->_callback, a); if (e) return e; + } + if (p->args) { + e = (*v)(p->args, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_6gevent_5libev_8corecext_watcher(PyObject *o) { + PyObject* tmp; + struct PyGeventWatcherObject *p = (struct PyGeventWatcherObject *)o; + tmp = ((PyObject*)p->loop); + p->loop = ((struct PyGeventLoopObject *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->_callback); + p->_callback = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->args); + p->args = ((PyObject*)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_7watcher_ref(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_7watcher_3ref_1__get__(o); +} + +static int __pyx_setprop_6gevent_5libev_8corecext_7watcher_ref(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6gevent_5libev_8corecext_7watcher_3ref_3__set__(o, v); + } + else { + PyErr_SetString(PyExc_NotImplementedError, "__del__"); + return -1; + } +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_7watcher_callback(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_7watcher_8callback_1__get__(o); +} + +static int __pyx_setprop_6gevent_5libev_8corecext_7watcher_callback(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6gevent_5libev_8corecext_7watcher_8callback_3__set__(o, v); + } + else { + PyErr_SetString(PyExc_NotImplementedError, "__del__"); + return -1; + } +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_7watcher_priority(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_7watcher_8priority_1__get__(o); +} + +static int __pyx_setprop_6gevent_5libev_8corecext_7watcher_priority(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6gevent_5libev_8corecext_7watcher_8priority_3__set__(o, v); + } + else { + PyErr_SetString(PyExc_NotImplementedError, "__del__"); + return -1; + } +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_7watcher_active(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_7watcher_6active_1__get__(o); +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_7watcher_pending(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_7watcher_7pending_1__get__(o); +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_7watcher_loop(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_7watcher_4loop_1__get__(o); +} + +static int __pyx_setprop_6gevent_5libev_8corecext_7watcher_loop(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6gevent_5libev_8corecext_7watcher_4loop_3__set__(o, v); + } + else { + return __pyx_pw_6gevent_5libev_8corecext_7watcher_4loop_5__del__(o); + } +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_7watcher_args(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_7watcher_4args_1__get__(o); +} + +static int __pyx_setprop_6gevent_5libev_8corecext_7watcher_args(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6gevent_5libev_8corecext_7watcher_4args_3__set__(o, v); + } + else { + return __pyx_pw_6gevent_5libev_8corecext_7watcher_4args_5__del__(o); + } +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_7watcher__flags(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_7watcher_6_flags_1__get__(o); +} + +static PyMethodDef __pyx_methods_6gevent_5libev_8corecext_watcher[] = { + {"start", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_5libev_8corecext_7watcher_3start, METH_VARARGS|METH_KEYWORDS, 0}, + {"stop", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_7watcher_5stop, METH_NOARGS, 0}, + {"feed", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_5libev_8corecext_7watcher_7feed, METH_VARARGS|METH_KEYWORDS, 0}, + {"_format", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_7watcher_11_format, METH_NOARGS, 0}, + {"close", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_7watcher_13close, METH_NOARGS, 0}, + {"__enter__", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_7watcher_15__enter__, METH_NOARGS, 0}, + {"__exit__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_5libev_8corecext_7watcher_17__exit__, METH_VARARGS|METH_KEYWORDS, 0}, + {0, 0, 0, 0} +}; + +static struct PyGetSetDef __pyx_getsets_6gevent_5libev_8corecext_watcher[] = { + {(char *)"ref", __pyx_getprop_6gevent_5libev_8corecext_7watcher_ref, __pyx_setprop_6gevent_5libev_8corecext_7watcher_ref, (char *)0, 0}, + {(char *)"callback", __pyx_getprop_6gevent_5libev_8corecext_7watcher_callback, __pyx_setprop_6gevent_5libev_8corecext_7watcher_callback, (char *)0, 0}, + {(char *)"priority", __pyx_getprop_6gevent_5libev_8corecext_7watcher_priority, __pyx_setprop_6gevent_5libev_8corecext_7watcher_priority, (char *)0, 0}, + {(char *)"active", __pyx_getprop_6gevent_5libev_8corecext_7watcher_active, 0, (char *)0, 0}, + {(char *)"pending", __pyx_getprop_6gevent_5libev_8corecext_7watcher_pending, 0, (char *)0, 0}, + {(char *)"loop", __pyx_getprop_6gevent_5libev_8corecext_7watcher_loop, __pyx_setprop_6gevent_5libev_8corecext_7watcher_loop, (char *)0, 0}, + {(char *)"args", __pyx_getprop_6gevent_5libev_8corecext_7watcher_args, __pyx_setprop_6gevent_5libev_8corecext_7watcher_args, (char *)0, 0}, + {(char *)"_flags", __pyx_getprop_6gevent_5libev_8corecext_7watcher__flags, 0, (char *)0, 0}, + {0, 0, 0, 0, 0} +}; + +DL_EXPORT(PyTypeObject) PyGeventWatcher_Type = { + PyVarObject_HEAD_INIT(0, 0) + "gevent.libev.corecext.watcher", /*tp_name*/ + sizeof(struct PyGeventWatcherObject), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6gevent_5libev_8corecext_watcher, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + __pyx_pw_6gevent_5libev_8corecext_7watcher_9__repr__, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + "Abstract base class for all the watchers", /*tp_doc*/ + __pyx_tp_traverse_6gevent_5libev_8corecext_watcher, /*tp_traverse*/ + __pyx_tp_clear_6gevent_5libev_8corecext_watcher, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6gevent_5libev_8corecext_watcher, /*tp_methods*/ + 0, /*tp_members*/ + __pyx_getsets_6gevent_5libev_8corecext_watcher, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_pw_6gevent_5libev_8corecext_7watcher_1__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6gevent_5libev_8corecext_watcher, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static PyObject *__pyx_tp_new_6gevent_5libev_8corecext_io(PyTypeObject *t, PyObject *a, PyObject *k) { + PyObject *o = __pyx_tp_new_6gevent_5libev_8corecext_watcher(t, a, k); + if (unlikely(!o)) return 0; + if (unlikely(__pyx_pw_6gevent_5libev_8corecext_2io_5__cinit__(o, a, k) < 0)) goto bad; + return o; + bad: + Py_DECREF(o); o = 0; + return NULL; +} + +static void __pyx_tp_dealloc_6gevent_5libev_8corecext_io(PyObject *o) { + #if CYTHON_USE_TP_FINALIZE + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + PyObject_GC_UnTrack(o); + { + PyObject *etype, *eval, *etb; + PyErr_Fetch(&etype, &eval, &etb); + ++Py_REFCNT(o); + __pyx_pw_6gevent_5libev_8corecext_2io_7__dealloc__(o); + --Py_REFCNT(o); + PyErr_Restore(etype, eval, etb); + } + PyObject_GC_Track(o); + __pyx_tp_dealloc_6gevent_5libev_8corecext_watcher(o); +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_2io_fd(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_2io_2fd_1__get__(o); +} + +static int __pyx_setprop_6gevent_5libev_8corecext_2io_fd(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6gevent_5libev_8corecext_2io_2fd_3__set__(o, v); + } + else { + PyErr_SetString(PyExc_NotImplementedError, "__del__"); + return -1; + } +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_2io_events(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_2io_6events_1__get__(o); +} + +static int __pyx_setprop_6gevent_5libev_8corecext_2io_events(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6gevent_5libev_8corecext_2io_6events_3__set__(o, v); + } + else { + PyErr_SetString(PyExc_NotImplementedError, "__del__"); + return -1; + } +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_2io_events_str(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_2io_10events_str_1__get__(o); +} + +static PyMethodDef __pyx_methods_6gevent_5libev_8corecext_io[] = { + {"start", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_5libev_8corecext_2io_1start, METH_VARARGS|METH_KEYWORDS, 0}, + {"_format", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_2io_9_format, METH_NOARGS, 0}, + {0, 0, 0, 0} +}; + +static struct PyGetSetDef __pyx_getsets_6gevent_5libev_8corecext_io[] = { + {(char *)"fd", __pyx_getprop_6gevent_5libev_8corecext_2io_fd, __pyx_setprop_6gevent_5libev_8corecext_2io_fd, (char *)0, 0}, + {(char *)"events", __pyx_getprop_6gevent_5libev_8corecext_2io_events, __pyx_setprop_6gevent_5libev_8corecext_2io_events, (char *)0, 0}, + {(char *)"events_str", __pyx_getprop_6gevent_5libev_8corecext_2io_events_str, 0, (char *)0, 0}, + {0, 0, 0, 0, 0} +}; + +DL_EXPORT(PyTypeObject) PyGeventIO_Type = { + PyVarObject_HEAD_INIT(0, 0) + "gevent.libev.corecext.io", /*tp_name*/ + sizeof(struct PyGeventIOObject), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6gevent_5libev_8corecext_io, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_6gevent_5libev_8corecext_7watcher_9__repr__, /*tp_repr*/ + #else + 0, /*tp_repr*/ + #endif + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_6gevent_5libev_8corecext_watcher, /*tp_traverse*/ + __pyx_tp_clear_6gevent_5libev_8corecext_watcher, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6gevent_5libev_8corecext_io, /*tp_methods*/ + 0, /*tp_members*/ + __pyx_getsets_6gevent_5libev_8corecext_io, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_pw_6gevent_5libev_8corecext_2io_3__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6gevent_5libev_8corecext_io, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static PyObject *__pyx_tp_new_6gevent_5libev_8corecext_timer(PyTypeObject *t, PyObject *a, PyObject *k) { + PyObject *o = __pyx_tp_new_6gevent_5libev_8corecext_watcher(t, a, k); + if (unlikely(!o)) return 0; + if (unlikely(__pyx_pw_6gevent_5libev_8corecext_5timer_1__cinit__(o, a, k) < 0)) goto bad; + return o; + bad: + Py_DECREF(o); o = 0; + return NULL; +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_5timer_at(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_5timer_2at_1__get__(o); +} + +static PyMethodDef __pyx_methods_6gevent_5libev_8corecext_timer[] = { + {"start", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_5libev_8corecext_5timer_5start, METH_VARARGS|METH_KEYWORDS, 0}, + {"again", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_5libev_8corecext_5timer_7again, METH_VARARGS|METH_KEYWORDS, 0}, + {0, 0, 0, 0} +}; + +static struct PyGetSetDef __pyx_getsets_6gevent_5libev_8corecext_timer[] = { + {(char *)"at", __pyx_getprop_6gevent_5libev_8corecext_5timer_at, 0, (char *)0, 0}, + {0, 0, 0, 0, 0} +}; + +DL_EXPORT(PyTypeObject) PyGeventTimer_Type = { + PyVarObject_HEAD_INIT(0, 0) + "gevent.libev.corecext.timer", /*tp_name*/ + sizeof(struct PyGeventTimerObject), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6gevent_5libev_8corecext_watcher, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_6gevent_5libev_8corecext_7watcher_9__repr__, /*tp_repr*/ + #else + 0, /*tp_repr*/ + #endif + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_6gevent_5libev_8corecext_watcher, /*tp_traverse*/ + __pyx_tp_clear_6gevent_5libev_8corecext_watcher, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6gevent_5libev_8corecext_timer, /*tp_methods*/ + 0, /*tp_members*/ + __pyx_getsets_6gevent_5libev_8corecext_timer, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_pw_6gevent_5libev_8corecext_5timer_3__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6gevent_5libev_8corecext_timer, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static PyObject *__pyx_tp_new_6gevent_5libev_8corecext_signal(PyTypeObject *t, PyObject *a, PyObject *k) { + PyObject *o = __pyx_tp_new_6gevent_5libev_8corecext_watcher(t, a, k); + if (unlikely(!o)) return 0; + if (unlikely(__pyx_pw_6gevent_5libev_8corecext_6signal_1__cinit__(o, a, k) < 0)) goto bad; + return o; + bad: + Py_DECREF(o); o = 0; + return NULL; +} + +static PyMethodDef __pyx_methods_6gevent_5libev_8corecext_signal[] = { + {0, 0, 0, 0} +}; + +DL_EXPORT(PyTypeObject) PyGeventSignal_Type = { + PyVarObject_HEAD_INIT(0, 0) + "gevent.libev.corecext.signal", /*tp_name*/ + sizeof(struct PyGeventSignalObject), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6gevent_5libev_8corecext_watcher, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_6gevent_5libev_8corecext_7watcher_9__repr__, /*tp_repr*/ + #else + 0, /*tp_repr*/ + #endif + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_6gevent_5libev_8corecext_watcher, /*tp_traverse*/ + __pyx_tp_clear_6gevent_5libev_8corecext_watcher, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6gevent_5libev_8corecext_signal, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_pw_6gevent_5libev_8corecext_6signal_3__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6gevent_5libev_8corecext_signal, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static PyObject *__pyx_tp_new_6gevent_5libev_8corecext_idle(PyTypeObject *t, PyObject *a, PyObject *k) { + PyObject *o = __pyx_tp_new_6gevent_5libev_8corecext_watcher(t, a, k); + if (unlikely(!o)) return 0; + if (unlikely(__pyx_pw_6gevent_5libev_8corecext_4idle_1__cinit__(o, a, k) < 0)) goto bad; + return o; + bad: + Py_DECREF(o); o = 0; + return NULL; +} + +static PyMethodDef __pyx_methods_6gevent_5libev_8corecext_idle[] = { + {0, 0, 0, 0} +}; + +DL_EXPORT(PyTypeObject) PyGeventIdle_Type = { + PyVarObject_HEAD_INIT(0, 0) + "gevent.libev.corecext.idle", /*tp_name*/ + sizeof(struct PyGeventIdleObject), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6gevent_5libev_8corecext_watcher, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_6gevent_5libev_8corecext_7watcher_9__repr__, /*tp_repr*/ + #else + 0, /*tp_repr*/ + #endif + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_6gevent_5libev_8corecext_watcher, /*tp_traverse*/ + __pyx_tp_clear_6gevent_5libev_8corecext_watcher, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6gevent_5libev_8corecext_idle, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_6gevent_5libev_8corecext_7watcher_1__init__, /*tp_init*/ + #else + 0, /*tp_init*/ + #endif + 0, /*tp_alloc*/ + __pyx_tp_new_6gevent_5libev_8corecext_idle, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static PyObject *__pyx_tp_new_6gevent_5libev_8corecext_prepare(PyTypeObject *t, PyObject *a, PyObject *k) { + PyObject *o = __pyx_tp_new_6gevent_5libev_8corecext_watcher(t, a, k); + if (unlikely(!o)) return 0; + if (unlikely(__pyx_pw_6gevent_5libev_8corecext_7prepare_1__cinit__(o, a, k) < 0)) goto bad; + return o; + bad: + Py_DECREF(o); o = 0; + return NULL; +} + +static PyMethodDef __pyx_methods_6gevent_5libev_8corecext_prepare[] = { + {0, 0, 0, 0} +}; + +DL_EXPORT(PyTypeObject) PyGeventPrepare_Type = { + PyVarObject_HEAD_INIT(0, 0) + "gevent.libev.corecext.prepare", /*tp_name*/ + sizeof(struct PyGeventPrepareObject), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6gevent_5libev_8corecext_watcher, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_6gevent_5libev_8corecext_7watcher_9__repr__, /*tp_repr*/ + #else + 0, /*tp_repr*/ + #endif + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_6gevent_5libev_8corecext_watcher, /*tp_traverse*/ + __pyx_tp_clear_6gevent_5libev_8corecext_watcher, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6gevent_5libev_8corecext_prepare, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_6gevent_5libev_8corecext_7watcher_1__init__, /*tp_init*/ + #else + 0, /*tp_init*/ + #endif + 0, /*tp_alloc*/ + __pyx_tp_new_6gevent_5libev_8corecext_prepare, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static PyObject *__pyx_tp_new_6gevent_5libev_8corecext_check(PyTypeObject *t, PyObject *a, PyObject *k) { + PyObject *o = __pyx_tp_new_6gevent_5libev_8corecext_watcher(t, a, k); + if (unlikely(!o)) return 0; + if (unlikely(__pyx_pw_6gevent_5libev_8corecext_5check_1__cinit__(o, a, k) < 0)) goto bad; + return o; + bad: + Py_DECREF(o); o = 0; + return NULL; +} + +static PyMethodDef __pyx_methods_6gevent_5libev_8corecext_check[] = { + {0, 0, 0, 0} +}; + +DL_EXPORT(PyTypeObject) PyGeventCheck_Type = { + PyVarObject_HEAD_INIT(0, 0) + "gevent.libev.corecext.check", /*tp_name*/ + sizeof(struct PyGeventCheckObject), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6gevent_5libev_8corecext_watcher, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_6gevent_5libev_8corecext_7watcher_9__repr__, /*tp_repr*/ + #else + 0, /*tp_repr*/ + #endif + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_6gevent_5libev_8corecext_watcher, /*tp_traverse*/ + __pyx_tp_clear_6gevent_5libev_8corecext_watcher, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6gevent_5libev_8corecext_check, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_6gevent_5libev_8corecext_7watcher_1__init__, /*tp_init*/ + #else + 0, /*tp_init*/ + #endif + 0, /*tp_alloc*/ + __pyx_tp_new_6gevent_5libev_8corecext_check, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static PyObject *__pyx_tp_new_6gevent_5libev_8corecext_fork(PyTypeObject *t, PyObject *a, PyObject *k) { + PyObject *o = __pyx_tp_new_6gevent_5libev_8corecext_watcher(t, a, k); + if (unlikely(!o)) return 0; + if (unlikely(__pyx_pw_6gevent_5libev_8corecext_4fork_1__cinit__(o, a, k) < 0)) goto bad; + return o; + bad: + Py_DECREF(o); o = 0; + return NULL; +} + +static PyMethodDef __pyx_methods_6gevent_5libev_8corecext_fork[] = { + {0, 0, 0, 0} +}; + +DL_EXPORT(PyTypeObject) PyGeventFork_Type = { + PyVarObject_HEAD_INIT(0, 0) + "gevent.libev.corecext.fork", /*tp_name*/ + sizeof(struct PyGeventForkObject), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6gevent_5libev_8corecext_watcher, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_6gevent_5libev_8corecext_7watcher_9__repr__, /*tp_repr*/ + #else + 0, /*tp_repr*/ + #endif + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_6gevent_5libev_8corecext_watcher, /*tp_traverse*/ + __pyx_tp_clear_6gevent_5libev_8corecext_watcher, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6gevent_5libev_8corecext_fork, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_6gevent_5libev_8corecext_7watcher_1__init__, /*tp_init*/ + #else + 0, /*tp_init*/ + #endif + 0, /*tp_alloc*/ + __pyx_tp_new_6gevent_5libev_8corecext_fork, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static PyObject *__pyx_tp_new_6gevent_5libev_8corecext_async_(PyTypeObject *t, PyObject *a, PyObject *k) { + PyObject *o = __pyx_tp_new_6gevent_5libev_8corecext_watcher(t, a, k); + if (unlikely(!o)) return 0; + if (unlikely(__pyx_pw_6gevent_5libev_8corecext_6async__1__cinit__(o, a, k) < 0)) goto bad; + return o; + bad: + Py_DECREF(o); o = 0; + return NULL; +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_6async__pending(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_6async__7pending_1__get__(o); +} + +static PyMethodDef __pyx_methods_6gevent_5libev_8corecext_async_[] = { + {"send", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_6async__3send, METH_NOARGS, 0}, + {0, 0, 0, 0} +}; + +static struct PyGetSetDef __pyx_getsets_6gevent_5libev_8corecext_async_[] = { + {(char *)"pending", __pyx_getprop_6gevent_5libev_8corecext_6async__pending, 0, (char *)0, 0}, + {0, 0, 0, 0, 0} +}; + +DL_EXPORT(PyTypeObject) PyGeventAsync_Type = { + PyVarObject_HEAD_INIT(0, 0) + "gevent.libev.corecext.async_", /*tp_name*/ + sizeof(struct PyGeventAsyncObject), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6gevent_5libev_8corecext_watcher, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_6gevent_5libev_8corecext_7watcher_9__repr__, /*tp_repr*/ + #else + 0, /*tp_repr*/ + #endif + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_6gevent_5libev_8corecext_watcher, /*tp_traverse*/ + __pyx_tp_clear_6gevent_5libev_8corecext_watcher, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6gevent_5libev_8corecext_async_, /*tp_methods*/ + 0, /*tp_members*/ + __pyx_getsets_6gevent_5libev_8corecext_async_, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_6gevent_5libev_8corecext_7watcher_1__init__, /*tp_init*/ + #else + 0, /*tp_init*/ + #endif + 0, /*tp_alloc*/ + __pyx_tp_new_6gevent_5libev_8corecext_async_, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static PyObject *__pyx_tp_new_6gevent_5libev_8corecext_child(PyTypeObject *t, PyObject *a, PyObject *k) { + PyObject *o = __pyx_tp_new_6gevent_5libev_8corecext_watcher(t, a, k); + if (unlikely(!o)) return 0; + if (unlikely(__pyx_pw_6gevent_5libev_8corecext_5child_1__cinit__(o, a, k) < 0)) goto bad; + return o; + bad: + Py_DECREF(o); o = 0; + return NULL; +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_5child_pid(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_5child_3pid_1__get__(o); +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_5child_rpid(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_5child_4rpid_1__get__(o); +} + +static int __pyx_setprop_6gevent_5libev_8corecext_5child_rpid(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6gevent_5libev_8corecext_5child_4rpid_3__set__(o, v); + } + else { + PyErr_SetString(PyExc_NotImplementedError, "__del__"); + return -1; + } +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_5child_rstatus(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_5child_7rstatus_1__get__(o); +} + +static int __pyx_setprop_6gevent_5libev_8corecext_5child_rstatus(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6gevent_5libev_8corecext_5child_7rstatus_3__set__(o, v); + } + else { + PyErr_SetString(PyExc_NotImplementedError, "__del__"); + return -1; + } +} + +static PyMethodDef __pyx_methods_6gevent_5libev_8corecext_child[] = { + {"_format", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_5child_5_format, METH_NOARGS, 0}, + {0, 0, 0, 0} +}; + +static struct PyGetSetDef __pyx_getsets_6gevent_5libev_8corecext_child[] = { + {(char *)"pid", __pyx_getprop_6gevent_5libev_8corecext_5child_pid, 0, (char *)0, 0}, + {(char *)"rpid", __pyx_getprop_6gevent_5libev_8corecext_5child_rpid, __pyx_setprop_6gevent_5libev_8corecext_5child_rpid, (char *)0, 0}, + {(char *)"rstatus", __pyx_getprop_6gevent_5libev_8corecext_5child_rstatus, __pyx_setprop_6gevent_5libev_8corecext_5child_rstatus, (char *)0, 0}, + {0, 0, 0, 0, 0} +}; + +DL_EXPORT(PyTypeObject) PyGeventChild_Type = { + PyVarObject_HEAD_INIT(0, 0) + "gevent.libev.corecext.child", /*tp_name*/ + sizeof(struct PyGeventChildObject), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6gevent_5libev_8corecext_watcher, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_6gevent_5libev_8corecext_7watcher_9__repr__, /*tp_repr*/ + #else + 0, /*tp_repr*/ + #endif + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_6gevent_5libev_8corecext_watcher, /*tp_traverse*/ + __pyx_tp_clear_6gevent_5libev_8corecext_watcher, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6gevent_5libev_8corecext_child, /*tp_methods*/ + 0, /*tp_members*/ + __pyx_getsets_6gevent_5libev_8corecext_child, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_pw_6gevent_5libev_8corecext_5child_3__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6gevent_5libev_8corecext_child, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static PyObject *__pyx_tp_new_6gevent_5libev_8corecext_stat(PyTypeObject *t, PyObject *a, PyObject *k) { + struct PyGeventStatObject *p; + PyObject *o = __pyx_tp_new_6gevent_5libev_8corecext_watcher(t, a, k); + if (unlikely(!o)) return 0; + p = ((struct PyGeventStatObject *)o); + p->path = ((PyObject*)Py_None); Py_INCREF(Py_None); + p->_paths = ((PyObject*)Py_None); Py_INCREF(Py_None); + if (unlikely(__pyx_pw_6gevent_5libev_8corecext_4stat_1__cinit__(o, a, k) < 0)) goto bad; + return o; + bad: + Py_DECREF(o); o = 0; + return NULL; +} + +static void __pyx_tp_dealloc_6gevent_5libev_8corecext_stat(PyObject *o) { + struct PyGeventStatObject *p = (struct PyGeventStatObject *)o; + #if CYTHON_USE_TP_FINALIZE + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + PyObject_GC_UnTrack(o); + Py_CLEAR(p->path); + Py_CLEAR(p->_paths); + PyObject_GC_Track(o); + __pyx_tp_dealloc_6gevent_5libev_8corecext_watcher(o); +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_4stat_attr(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_4stat_4attr_1__get__(o); +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_4stat_prev(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_4stat_4prev_1__get__(o); +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_4stat_interval(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_4stat_8interval_1__get__(o); +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_4stat_path(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_4stat_4path_1__get__(o); +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_4stat__paths(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_4stat_6_paths_1__get__(o); +} + +static PyMethodDef __pyx_methods_6gevent_5libev_8corecext_stat[] = { + {0, 0, 0, 0} +}; + +static struct PyGetSetDef __pyx_getsets_6gevent_5libev_8corecext_stat[] = { + {(char *)"attr", __pyx_getprop_6gevent_5libev_8corecext_4stat_attr, 0, (char *)0, 0}, + {(char *)"prev", __pyx_getprop_6gevent_5libev_8corecext_4stat_prev, 0, (char *)0, 0}, + {(char *)"interval", __pyx_getprop_6gevent_5libev_8corecext_4stat_interval, 0, (char *)0, 0}, + {(char *)"path", __pyx_getprop_6gevent_5libev_8corecext_4stat_path, 0, (char *)0, 0}, + {(char *)"_paths", __pyx_getprop_6gevent_5libev_8corecext_4stat__paths, 0, (char *)0, 0}, + {0, 0, 0, 0, 0} +}; + +DL_EXPORT(PyTypeObject) PyGeventStat_Type = { + PyVarObject_HEAD_INIT(0, 0) + "gevent.libev.corecext.stat", /*tp_name*/ + sizeof(struct PyGeventStatObject), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6gevent_5libev_8corecext_stat, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_6gevent_5libev_8corecext_7watcher_9__repr__, /*tp_repr*/ + #else + 0, /*tp_repr*/ + #endif + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_6gevent_5libev_8corecext_watcher, /*tp_traverse*/ + __pyx_tp_clear_6gevent_5libev_8corecext_watcher, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6gevent_5libev_8corecext_stat, /*tp_methods*/ + 0, /*tp_members*/ + __pyx_getsets_6gevent_5libev_8corecext_stat, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_pw_6gevent_5libev_8corecext_4stat_3__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6gevent_5libev_8corecext_stat, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static struct __pyx_obj_6gevent_5libev_8corecext___pyx_scope_struct__genexpr *__pyx_freelist_6gevent_5libev_8corecext___pyx_scope_struct__genexpr[8]; +static int __pyx_freecount_6gevent_5libev_8corecext___pyx_scope_struct__genexpr = 0; + +static PyObject *__pyx_tp_new_6gevent_5libev_8corecext___pyx_scope_struct__genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + PyObject *o; + if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_6gevent_5libev_8corecext___pyx_scope_struct__genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_6gevent_5libev_8corecext___pyx_scope_struct__genexpr)))) { + o = (PyObject*)__pyx_freelist_6gevent_5libev_8corecext___pyx_scope_struct__genexpr[--__pyx_freecount_6gevent_5libev_8corecext___pyx_scope_struct__genexpr]; + memset(o, 0, sizeof(struct __pyx_obj_6gevent_5libev_8corecext___pyx_scope_struct__genexpr)); + (void) PyObject_INIT(o, t); + PyObject_GC_Track(o); + } else { + o = (*t->tp_alloc)(t, 0); + if (unlikely(!o)) return 0; + } + return o; +} + +static void __pyx_tp_dealloc_6gevent_5libev_8corecext___pyx_scope_struct__genexpr(PyObject *o) { + struct __pyx_obj_6gevent_5libev_8corecext___pyx_scope_struct__genexpr *p = (struct __pyx_obj_6gevent_5libev_8corecext___pyx_scope_struct__genexpr *)o; + PyObject_GC_UnTrack(o); + Py_CLEAR(p->__pyx_v_flag); + Py_CLEAR(p->__pyx_v_string); + if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_6gevent_5libev_8corecext___pyx_scope_struct__genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_6gevent_5libev_8corecext___pyx_scope_struct__genexpr)))) { + __pyx_freelist_6gevent_5libev_8corecext___pyx_scope_struct__genexpr[__pyx_freecount_6gevent_5libev_8corecext___pyx_scope_struct__genexpr++] = ((struct __pyx_obj_6gevent_5libev_8corecext___pyx_scope_struct__genexpr *)o); + } else { + (*Py_TYPE(o)->tp_free)(o); + } +} + +static int __pyx_tp_traverse_6gevent_5libev_8corecext___pyx_scope_struct__genexpr(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_6gevent_5libev_8corecext___pyx_scope_struct__genexpr *p = (struct __pyx_obj_6gevent_5libev_8corecext___pyx_scope_struct__genexpr *)o; + if (p->__pyx_v_flag) { + e = (*v)(p->__pyx_v_flag, a); if (e) return e; + } + if (p->__pyx_v_string) { + e = (*v)(p->__pyx_v_string, a); if (e) return e; + } + return 0; +} + +static PyTypeObject __pyx_type_6gevent_5libev_8corecext___pyx_scope_struct__genexpr = { + PyVarObject_HEAD_INIT(0, 0) + "gevent.libev.corecext.__pyx_scope_struct__genexpr", /*tp_name*/ + sizeof(struct __pyx_obj_6gevent_5libev_8corecext___pyx_scope_struct__genexpr), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6gevent_5libev_8corecext___pyx_scope_struct__genexpr, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_6gevent_5libev_8corecext___pyx_scope_struct__genexpr, /*tp_traverse*/ + 0, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + 0, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6gevent_5libev_8corecext___pyx_scope_struct__genexpr, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static PyMethodDef __pyx_methods[] = { + {"_flags_to_list", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_5_flags_to_list, METH_O, 0}, + {"_flags_to_int", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_7_flags_to_int, METH_O, 0}, + {"_check_flags", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_9_check_flags, METH_O, 0}, + {"_events_to_str", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_11_events_to_str, METH_O, 0}, + {"set_syserr_cb", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_21set_syserr_cb, METH_O, 0}, + {0, 0, 0, 0} +}; + +#if PY_MAJOR_VERSION >= 3 +#if CYTHON_PEP489_MULTI_PHASE_INIT +static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ +static int __pyx_pymod_exec_corecext(PyObject* module); /*proto*/ +static PyModuleDef_Slot __pyx_moduledef_slots[] = { + {Py_mod_create, (void*)__pyx_pymod_create}, + {Py_mod_exec, (void*)__pyx_pymod_exec_corecext}, + {0, NULL} +}; +#endif + +static struct PyModuleDef __pyx_moduledef = { + PyModuleDef_HEAD_INIT, + "corecext", + 0, /* m_doc */ + #if CYTHON_PEP489_MULTI_PHASE_INIT + 0, /* m_size */ + #else + -1, /* m_size */ + #endif + __pyx_methods /* m_methods */, + #if CYTHON_PEP489_MULTI_PHASE_INIT + __pyx_moduledef_slots, /* m_slots */ + #else + NULL, /* m_reload */ + #endif + NULL, /* m_traverse */ + NULL, /* m_clear */ + NULL /* m_free */ +}; +#endif +#ifndef CYTHON_SMALL_CODE +#if defined(__clang__) + #define CYTHON_SMALL_CODE +#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) + #define CYTHON_SMALL_CODE __attribute__((cold)) +#else + #define CYTHON_SMALL_CODE +#endif +#endif + +static __Pyx_StringTabEntry __pyx_string_tab[] = { + {&__pyx_kp_s_, __pyx_k_, sizeof(__pyx_k_), 0, 0, 1, 0}, + {&__pyx_n_s_ASYNC, __pyx_k_ASYNC, sizeof(__pyx_k_ASYNC), 0, 0, 1, 1}, + {&__pyx_n_s_AttributeError, __pyx_k_AttributeError, sizeof(__pyx_k_AttributeError), 0, 0, 1, 1}, + {&__pyx_n_s_BACKEND_EPOLL, __pyx_k_BACKEND_EPOLL, sizeof(__pyx_k_BACKEND_EPOLL), 0, 0, 1, 1}, + {&__pyx_n_s_BACKEND_KQUEUE, __pyx_k_BACKEND_KQUEUE, sizeof(__pyx_k_BACKEND_KQUEUE), 0, 0, 1, 1}, + {&__pyx_n_s_BACKEND_POLL, __pyx_k_BACKEND_POLL, sizeof(__pyx_k_BACKEND_POLL), 0, 0, 1, 1}, + {&__pyx_n_s_BACKEND_PORT, __pyx_k_BACKEND_PORT, sizeof(__pyx_k_BACKEND_PORT), 0, 0, 1, 1}, + {&__pyx_n_s_BACKEND_SELECT, __pyx_k_BACKEND_SELECT, sizeof(__pyx_k_BACKEND_SELECT), 0, 0, 1, 1}, + {&__pyx_n_s_CHECK, __pyx_k_CHECK, sizeof(__pyx_k_CHECK), 0, 0, 1, 1}, + {&__pyx_n_s_CHILD, __pyx_k_CHILD, sizeof(__pyx_k_CHILD), 0, 0, 1, 1}, + {&__pyx_n_s_CLEANUP, __pyx_k_CLEANUP, sizeof(__pyx_k_CLEANUP), 0, 0, 1, 1}, + {&__pyx_n_s_CUSTOM, __pyx_k_CUSTOM, sizeof(__pyx_k_CUSTOM), 0, 0, 1, 1}, + {&__pyx_kp_s_Cannot_construct_a_bare_watcher, __pyx_k_Cannot_construct_a_bare_watcher, sizeof(__pyx_k_Cannot_construct_a_bare_watcher), 0, 0, 1, 0}, + {&__pyx_kp_s_Cannot_set_priority_of_an_active, __pyx_k_Cannot_set_priority_of_an_active, sizeof(__pyx_k_Cannot_set_priority_of_an_active), 0, 0, 1, 0}, + {&__pyx_kp_s_Child_watchers_are_not_supported, __pyx_k_Child_watchers_are_not_supported, sizeof(__pyx_k_Child_watchers_are_not_supported), 0, 0, 1, 0}, + {&__pyx_n_s_EMBED, __pyx_k_EMBED, sizeof(__pyx_k_EMBED), 0, 0, 1, 1}, + {&__pyx_n_s_ERROR, __pyx_k_ERROR, sizeof(__pyx_k_ERROR), 0, 0, 1, 1}, + {&__pyx_n_s_EVENTS, __pyx_k_EVENTS, sizeof(__pyx_k_EVENTS), 0, 0, 1, 1}, + {&__pyx_n_s_EV_USE_4HEAP, __pyx_k_EV_USE_4HEAP, sizeof(__pyx_k_EV_USE_4HEAP), 0, 0, 1, 1}, + {&__pyx_n_s_EV_USE_CLOCK_SYSCALL, __pyx_k_EV_USE_CLOCK_SYSCALL, sizeof(__pyx_k_EV_USE_CLOCK_SYSCALL), 0, 0, 1, 1}, + {&__pyx_n_s_EV_USE_EVENTFD, __pyx_k_EV_USE_EVENTFD, sizeof(__pyx_k_EV_USE_EVENTFD), 0, 0, 1, 1}, + {&__pyx_n_s_EV_USE_FLOOR, __pyx_k_EV_USE_FLOOR, sizeof(__pyx_k_EV_USE_FLOOR), 0, 0, 1, 1}, + {&__pyx_n_s_EV_USE_INOTIFY, __pyx_k_EV_USE_INOTIFY, sizeof(__pyx_k_EV_USE_INOTIFY), 0, 0, 1, 1}, + {&__pyx_n_s_EV_USE_MONOTONIC, __pyx_k_EV_USE_MONOTONIC, sizeof(__pyx_k_EV_USE_MONOTONIC), 0, 0, 1, 1}, + {&__pyx_n_s_EV_USE_NANOSLEEP, __pyx_k_EV_USE_NANOSLEEP, sizeof(__pyx_k_EV_USE_NANOSLEEP), 0, 0, 1, 1}, + {&__pyx_n_s_EV_USE_REALTIME, __pyx_k_EV_USE_REALTIME, sizeof(__pyx_k_EV_USE_REALTIME), 0, 0, 1, 1}, + {&__pyx_n_s_EV_USE_SIGNALFD, __pyx_k_EV_USE_SIGNALFD, sizeof(__pyx_k_EV_USE_SIGNALFD), 0, 0, 1, 1}, + {&__pyx_kp_s_Expected_callable_not_r, __pyx_k_Expected_callable_not_r, sizeof(__pyx_k_Expected_callable_not_r), 0, 0, 1, 0}, + {&__pyx_kp_s_Expected_callable_or_None_got_r, __pyx_k_Expected_callable_or_None_got_r, sizeof(__pyx_k_Expected_callable_or_None_got_r), 0, 0, 1, 0}, + {&__pyx_n_s_FORK, __pyx_k_FORK, sizeof(__pyx_k_FORK), 0, 0, 1, 1}, + {&__pyx_n_s_FORKCHECK, __pyx_k_FORKCHECK, sizeof(__pyx_k_FORKCHECK), 0, 0, 1, 1}, + {&__pyx_n_s_IDLE, __pyx_k_IDLE, sizeof(__pyx_k_IDLE), 0, 0, 1, 1}, + {&__pyx_n_s_ILoop, __pyx_k_ILoop, sizeof(__pyx_k_ILoop), 0, 0, 1, 1}, + {&__pyx_n_s_IOFDSET, __pyx_k_IOFDSET, sizeof(__pyx_k_IOFDSET), 0, 0, 1, 1}, + {&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1}, + {&__pyx_kp_s_Invalid_backend_or_flag_s_Possib, __pyx_k_Invalid_backend_or_flag_s_Possib, sizeof(__pyx_k_Invalid_backend_or_flag_s_Possib), 0, 0, 1, 0}, + {&__pyx_kp_s_Invalid_value_for_backend_0x_x, __pyx_k_Invalid_value_for_backend_0x_x, sizeof(__pyx_k_Invalid_value_for_backend_0x_x), 0, 0, 1, 0}, + {&__pyx_n_s_KeyError, __pyx_k_KeyError, sizeof(__pyx_k_KeyError), 0, 0, 1, 1}, + {&__pyx_n_s_LIBEV_EMBED, __pyx_k_LIBEV_EMBED, sizeof(__pyx_k_LIBEV_EMBED), 0, 0, 1, 1}, + {&__pyx_n_s_MAXPRI, __pyx_k_MAXPRI, sizeof(__pyx_k_MAXPRI), 0, 0, 1, 1}, + {&__pyx_n_s_MINPRI, __pyx_k_MINPRI, sizeof(__pyx_k_MINPRI), 0, 0, 1, 1}, + {&__pyx_n_s_NOINOTIFY, __pyx_k_NOINOTIFY, sizeof(__pyx_k_NOINOTIFY), 0, 0, 1, 1}, + {&__pyx_n_s_NONE, __pyx_k_NONE, sizeof(__pyx_k_NONE), 0, 0, 1, 1}, + {&__pyx_n_s_NOSIGMASK, __pyx_k_NOSIGMASK, sizeof(__pyx_k_NOSIGMASK), 0, 0, 1, 1}, + {&__pyx_n_s_NSIG, __pyx_k_NSIG, sizeof(__pyx_k_NSIG), 0, 0, 1, 1}, + {&__pyx_n_s_PERIODIC, __pyx_k_PERIODIC, sizeof(__pyx_k_PERIODIC), 0, 0, 1, 1}, + {&__pyx_n_s_PREPARE, __pyx_k_PREPARE, sizeof(__pyx_k_PREPARE), 0, 0, 1, 1}, + {&__pyx_n_s_READ, __pyx_k_READ, sizeof(__pyx_k_READ), 0, 0, 1, 1}, + {&__pyx_n_s_READWRITE, __pyx_k_READWRITE, sizeof(__pyx_k_READWRITE), 0, 0, 1, 1}, + {&__pyx_n_s_SIGNAL, __pyx_k_SIGNAL, sizeof(__pyx_k_SIGNAL), 0, 0, 1, 1}, + {&__pyx_n_s_SIGNALFD, __pyx_k_SIGNALFD, sizeof(__pyx_k_SIGNALFD), 0, 0, 1, 1}, + {&__pyx_n_s_STAT, __pyx_k_STAT, sizeof(__pyx_k_STAT), 0, 0, 1, 1}, + {&__pyx_n_s_SYSERR_CALLBACK, __pyx_k_SYSERR_CALLBACK, sizeof(__pyx_k_SYSERR_CALLBACK), 0, 0, 1, 1}, + {&__pyx_n_s_SystemError, __pyx_k_SystemError, sizeof(__pyx_k_SystemError), 0, 0, 1, 1}, + {&__pyx_n_s_TIMER, __pyx_k_TIMER, sizeof(__pyx_k_TIMER), 0, 0, 1, 1}, + {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1}, + {&__pyx_n_s_UNDEF, __pyx_k_UNDEF, sizeof(__pyx_k_UNDEF), 0, 0, 1, 1}, + {&__pyx_kp_s_Unsupported_backend_s, __pyx_k_Unsupported_backend_s, sizeof(__pyx_k_Unsupported_backend_s), 0, 0, 1, 0}, + {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1}, + {&__pyx_n_s_WRITE, __pyx_k_WRITE, sizeof(__pyx_k_WRITE), 0, 0, 1, 1}, + {&__pyx_kp_s__2, __pyx_k__2, sizeof(__pyx_k__2), 0, 0, 1, 0}, + {&__pyx_kp_s__3, __pyx_k__3, sizeof(__pyx_k__3), 0, 0, 1, 0}, + {&__pyx_kp_s__5, __pyx_k__5, sizeof(__pyx_k__5), 0, 0, 1, 0}, + {&__pyx_kp_s__6, __pyx_k__6, sizeof(__pyx_k__6), 0, 0, 1, 0}, + {&__pyx_kp_s__7, __pyx_k__7, sizeof(__pyx_k__7), 0, 0, 1, 0}, + {&__pyx_kp_s__8, __pyx_k__8, sizeof(__pyx_k__8), 0, 0, 1, 0}, + {&__pyx_n_s_active, __pyx_k_active, sizeof(__pyx_k_active), 0, 0, 1, 1}, + {&__pyx_kp_s_active_2, __pyx_k_active_2, sizeof(__pyx_k_active_2), 0, 0, 1, 0}, + {&__pyx_n_s_activecnt, __pyx_k_activecnt, sizeof(__pyx_k_activecnt), 0, 0, 1, 1}, + {&__pyx_n_s_after, __pyx_k_after, sizeof(__pyx_k_after), 0, 0, 1, 1}, + {&__pyx_n_s_all, __pyx_k_all, sizeof(__pyx_k_all), 0, 0, 1, 1}, + {&__pyx_n_s_args, __pyx_k_args, sizeof(__pyx_k_args), 0, 0, 1, 1}, + {&__pyx_kp_s_args_r, __pyx_k_args_r, sizeof(__pyx_k_args_r), 0, 0, 1, 0}, + {&__pyx_n_s_async, __pyx_k_async, sizeof(__pyx_k_async), 0, 0, 1, 1}, + {&__pyx_n_s_async_2, __pyx_k_async_2, sizeof(__pyx_k_async_2), 0, 0, 1, 1}, + {&__pyx_n_s_backend, __pyx_k_backend, sizeof(__pyx_k_backend), 0, 0, 1, 1}, + {&__pyx_n_s_basestring, __pyx_k_basestring, sizeof(__pyx_k_basestring), 0, 0, 1, 1}, + {&__pyx_n_s_builtins, __pyx_k_builtins, sizeof(__pyx_k_builtins), 0, 0, 1, 1}, + {&__pyx_n_s_callback, __pyx_k_callback, sizeof(__pyx_k_callback), 0, 0, 1, 1}, + {&__pyx_kp_s_callback_r, __pyx_k_callback_r, sizeof(__pyx_k_callback_r), 0, 0, 1, 0}, + {&__pyx_kp_s_callbacks_r_len_d_head_r_tail_r, __pyx_k_callbacks_r_len_d_head_r_tail_r, sizeof(__pyx_k_callbacks_r_len_d_head_r_tail_r), 0, 0, 1, 0}, + {&__pyx_n_s_check, __pyx_k_check, sizeof(__pyx_k_check), 0, 0, 1, 1}, + {&__pyx_n_s_child, __pyx_k_child, sizeof(__pyx_k_child), 0, 0, 1, 1}, + {&__pyx_kp_s_child_watchers_are_only_availabl, __pyx_k_child_watchers_are_only_availabl, sizeof(__pyx_k_child_watchers_are_only_availabl), 0, 0, 1, 0}, + {&__pyx_n_s_class, __pyx_k_class, sizeof(__pyx_k_class), 0, 0, 1, 1}, + {&__pyx_n_s_classImplements, __pyx_k_classImplements, sizeof(__pyx_k_classImplements), 0, 0, 1, 1}, + {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, + {&__pyx_n_s_close, __pyx_k_close, sizeof(__pyx_k_close), 0, 0, 1, 1}, + {&__pyx_n_s_context, __pyx_k_context, sizeof(__pyx_k_context), 0, 0, 1, 1}, + {&__pyx_n_s_decode, __pyx_k_decode, sizeof(__pyx_k_decode), 0, 0, 1, 1}, + {&__pyx_n_s_default, __pyx_k_default, sizeof(__pyx_k_default), 0, 0, 1, 1}, + {&__pyx_kp_s_default_2, __pyx_k_default_2, sizeof(__pyx_k_default_2), 0, 0, 1, 0}, + {&__pyx_n_s_default_handle_error, __pyx_k_default_handle_error, sizeof(__pyx_k_default_handle_error), 0, 0, 1, 1}, + {&__pyx_n_s_destroyed, __pyx_k_destroyed, sizeof(__pyx_k_destroyed), 0, 0, 1, 1}, + {&__pyx_n_s_embeddable_backends, __pyx_k_embeddable_backends, sizeof(__pyx_k_embeddable_backends), 0, 0, 1, 1}, + {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1}, + {&__pyx_n_s_epoll, __pyx_k_epoll, sizeof(__pyx_k_epoll), 0, 0, 1, 1}, + {&__pyx_n_s_errno, __pyx_k_errno, sizeof(__pyx_k_errno), 0, 0, 1, 1}, + {&__pyx_kp_s_ev_default_loop_s_failed, __pyx_k_ev_default_loop_s_failed, sizeof(__pyx_k_ev_default_loop_s_failed), 0, 0, 1, 0}, + {&__pyx_kp_s_ev_loop_new_s_failed, __pyx_k_ev_loop_new_s_failed, sizeof(__pyx_k_ev_loop_new_s_failed), 0, 0, 1, 0}, + {&__pyx_n_s_events, __pyx_k_events, sizeof(__pyx_k_events), 0, 0, 1, 1}, + {&__pyx_n_s_events_2, __pyx_k_events_2, sizeof(__pyx_k_events_2), 0, 0, 1, 1}, + {&__pyx_n_s_events_str, __pyx_k_events_str, sizeof(__pyx_k_events_str), 0, 0, 1, 1}, + {&__pyx_n_s_fd, __pyx_k_fd, sizeof(__pyx_k_fd), 0, 0, 1, 1}, + {&__pyx_kp_s_fd_must_be_non_negative_r, __pyx_k_fd_must_be_non_negative_r, sizeof(__pyx_k_fd_must_be_non_negative_r), 0, 0, 1, 0}, + {&__pyx_kp_s_fd_s_events_s, __pyx_k_fd_s_events_s, sizeof(__pyx_k_fd_s_events_s), 0, 0, 1, 0}, + {&__pyx_n_s_fileno, __pyx_k_fileno, sizeof(__pyx_k_fileno), 0, 0, 1, 1}, + {&__pyx_kp_s_fileno_2, __pyx_k_fileno_2, sizeof(__pyx_k_fileno_2), 0, 0, 1, 0}, + {&__pyx_n_s_flags, __pyx_k_flags, sizeof(__pyx_k_flags), 0, 0, 1, 1}, + {&__pyx_n_s_flags_2, __pyx_k_flags_2, sizeof(__pyx_k_flags_2), 0, 0, 1, 1}, + {&__pyx_n_s_flags_str2int, __pyx_k_flags_str2int, sizeof(__pyx_k_flags_str2int), 0, 0, 1, 1}, + {&__pyx_n_s_fork, __pyx_k_fork, sizeof(__pyx_k_fork), 0, 0, 1, 1}, + {&__pyx_n_s_forkcheck, __pyx_k_forkcheck, sizeof(__pyx_k_forkcheck), 0, 0, 1, 1}, + {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1}, + {&__pyx_n_s_format_details, __pyx_k_format_details, sizeof(__pyx_k_format_details), 0, 0, 1, 1}, + {&__pyx_n_s_func, __pyx_k_func, sizeof(__pyx_k_func), 0, 0, 1, 1}, + {&__pyx_n_s_genexpr, __pyx_k_genexpr, sizeof(__pyx_k_genexpr), 0, 0, 1, 1}, + {&__pyx_n_s_get_header_version, __pyx_k_get_header_version, sizeof(__pyx_k_get_header_version), 0, 0, 1, 1}, + {&__pyx_n_s_get_version, __pyx_k_get_version, sizeof(__pyx_k_get_version), 0, 0, 1, 1}, + {&__pyx_n_s_getfilesystemencoding, __pyx_k_getfilesystemencoding, sizeof(__pyx_k_getfilesystemencoding), 0, 0, 1, 1}, + {&__pyx_n_s_getswitchinterval, __pyx_k_getswitchinterval, sizeof(__pyx_k_getswitchinterval), 0, 0, 1, 1}, + {&__pyx_n_s_gevent, __pyx_k_gevent, sizeof(__pyx_k_gevent), 0, 0, 1, 1}, + {&__pyx_n_s_gevent__interfaces, __pyx_k_gevent__interfaces, sizeof(__pyx_k_gevent__interfaces), 0, 0, 1, 1}, + {&__pyx_kp_s_gevent_core_EVENTS, __pyx_k_gevent_core_EVENTS, sizeof(__pyx_k_gevent_core_EVENTS), 0, 0, 1, 0}, + {&__pyx_n_s_gevent_libev_corecext, __pyx_k_gevent_libev_corecext, sizeof(__pyx_k_gevent_libev_corecext), 0, 0, 1, 1}, + {&__pyx_n_s_handle_error, __pyx_k_handle_error, sizeof(__pyx_k_handle_error), 0, 0, 1, 1}, + {&__pyx_n_s_handle_syserr, __pyx_k_handle_syserr, sizeof(__pyx_k_handle_syserr), 0, 0, 1, 1}, + {&__pyx_n_s_hex, __pyx_k_hex, sizeof(__pyx_k_hex), 0, 0, 1, 1}, + {&__pyx_n_s_how, __pyx_k_how, sizeof(__pyx_k_how), 0, 0, 1, 1}, + {&__pyx_n_s_id, __pyx_k_id, sizeof(__pyx_k_id), 0, 0, 1, 1}, + {&__pyx_n_s_idle, __pyx_k_idle, sizeof(__pyx_k_idle), 0, 0, 1, 1}, + {&__pyx_kp_s_illegal_event_mask_r, __pyx_k_illegal_event_mask_r, sizeof(__pyx_k_illegal_event_mask_r), 0, 0, 1, 0}, + {&__pyx_kp_s_illegal_signal_number_r, __pyx_k_illegal_signal_number_r, sizeof(__pyx_k_illegal_signal_number_r), 0, 0, 1, 0}, + {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, + {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1}, + {&__pyx_n_s_interval, __pyx_k_interval, sizeof(__pyx_k_interval), 0, 0, 1, 1}, + {&__pyx_n_s_io, __pyx_k_io, sizeof(__pyx_k_io), 0, 0, 1, 1}, + {&__pyx_kp_s_io_watcher_attribute_events_is, __pyx_k_io_watcher_attribute_events_is, sizeof(__pyx_k_io_watcher_attribute_events_is), 0, 0, 1, 0}, + {&__pyx_kp_s_io_watcher_attribute_fd_is_read, __pyx_k_io_watcher_attribute_fd_is_read, sizeof(__pyx_k_io_watcher_attribute_fd_is_read), 0, 0, 1, 0}, + {&__pyx_n_s_join, __pyx_k_join, sizeof(__pyx_k_join), 0, 0, 1, 1}, + {&__pyx_n_s_keys, __pyx_k_keys, sizeof(__pyx_k_keys), 0, 0, 1, 1}, + {&__pyx_n_s_kqueue, __pyx_k_kqueue, sizeof(__pyx_k_kqueue), 0, 0, 1, 1}, + {&__pyx_n_s_level, __pyx_k_level, sizeof(__pyx_k_level), 0, 0, 1, 1}, + {&__pyx_kp_s_libev_d_02d, __pyx_k_libev_d_02d, sizeof(__pyx_k_libev_d_02d), 0, 0, 1, 0}, + {&__pyx_n_s_loop, __pyx_k_loop, sizeof(__pyx_k_loop), 0, 0, 1, 1}, + {&__pyx_n_s_lower, __pyx_k_lower, sizeof(__pyx_k_lower), 0, 0, 1, 1}, + {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, + {&__pyx_n_s_message, __pyx_k_message, sizeof(__pyx_k_message), 0, 0, 1, 1}, + {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, + {&__pyx_n_s_noenv, __pyx_k_noenv, sizeof(__pyx_k_noenv), 0, 0, 1, 1}, + {&__pyx_n_s_noinotify, __pyx_k_noinotify, sizeof(__pyx_k_noinotify), 0, 0, 1, 1}, + {&__pyx_n_s_nosigmask, __pyx_k_nosigmask, sizeof(__pyx_k_nosigmask), 0, 0, 1, 1}, + {&__pyx_n_s_now, __pyx_k_now, sizeof(__pyx_k_now), 0, 0, 1, 1}, + {&__pyx_n_s_nowait, __pyx_k_nowait, sizeof(__pyx_k_nowait), 0, 0, 1, 1}, + {&__pyx_n_s_once, __pyx_k_once, sizeof(__pyx_k_once), 0, 0, 1, 1}, + {&__pyx_kp_s_operation_on_destroyed_loop, __pyx_k_operation_on_destroyed_loop, sizeof(__pyx_k_operation_on_destroyed_loop), 0, 0, 1, 0}, + {&__pyx_n_s_origflags_int, __pyx_k_origflags_int, sizeof(__pyx_k_origflags_int), 0, 0, 1, 1}, + {&__pyx_n_s_os, __pyx_k_os, sizeof(__pyx_k_os), 0, 0, 1, 1}, + {&__pyx_n_s_pass_events, __pyx_k_pass_events, sizeof(__pyx_k_pass_events), 0, 0, 1, 1}, + {&__pyx_n_s_path, __pyx_k_path, sizeof(__pyx_k_path), 0, 0, 1, 1}, + {&__pyx_n_s_pending, __pyx_k_pending, sizeof(__pyx_k_pending), 0, 0, 1, 1}, + {&__pyx_kp_s_pending_2, __pyx_k_pending_2, sizeof(__pyx_k_pending_2), 0, 0, 1, 0}, + {&__pyx_kp_s_pending_s, __pyx_k_pending_s, sizeof(__pyx_k_pending_s), 0, 0, 1, 0}, + {&__pyx_n_s_pendingcnt, __pyx_k_pendingcnt, sizeof(__pyx_k_pendingcnt), 0, 0, 1, 1}, + {&__pyx_n_s_pid, __pyx_k_pid, sizeof(__pyx_k_pid), 0, 0, 1, 1}, + {&__pyx_kp_s_pid_r_rstatus_r, __pyx_k_pid_r_rstatus_r, sizeof(__pyx_k_pid_r_rstatus_r), 0, 0, 1, 0}, + {&__pyx_n_s_platform, __pyx_k_platform, sizeof(__pyx_k_platform), 0, 0, 1, 1}, + {&__pyx_n_s_poll, __pyx_k_poll, sizeof(__pyx_k_poll), 0, 0, 1, 1}, + {&__pyx_n_s_port, __pyx_k_port, sizeof(__pyx_k_port), 0, 0, 1, 1}, + {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1}, + {&__pyx_n_s_print_exc, __pyx_k_print_exc, sizeof(__pyx_k_print_exc), 0, 0, 1, 1}, + {&__pyx_n_s_print_exception, __pyx_k_print_exception, sizeof(__pyx_k_print_exception), 0, 0, 1, 1}, + {&__pyx_n_s_priority, __pyx_k_priority, sizeof(__pyx_k_priority), 0, 0, 1, 1}, + {&__pyx_n_s_ptr, __pyx_k_ptr, sizeof(__pyx_k_ptr), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1}, + {&__pyx_n_s_recommended_backends, __pyx_k_recommended_backends, sizeof(__pyx_k_recommended_backends), 0, 0, 1, 1}, + {&__pyx_n_s_ref, __pyx_k_ref, sizeof(__pyx_k_ref), 0, 0, 1, 1}, + {&__pyx_kp_s_ref_2, __pyx_k_ref_2, sizeof(__pyx_k_ref_2), 0, 0, 1, 0}, + {&__pyx_n_s_repeat, __pyx_k_repeat, sizeof(__pyx_k_repeat), 0, 0, 1, 1}, + {&__pyx_kp_s_repeat_must_be_positive_or_zero, __pyx_k_repeat_must_be_positive_or_zero, sizeof(__pyx_k_repeat_must_be_positive_or_zero), 0, 0, 1, 0}, + {&__pyx_n_s_revents, __pyx_k_revents, sizeof(__pyx_k_revents), 0, 0, 1, 1}, + {&__pyx_n_s_rstatus, __pyx_k_rstatus, sizeof(__pyx_k_rstatus), 0, 0, 1, 1}, + {&__pyx_kp_s_s_at_0x_x_s, __pyx_k_s_at_0x_x_s, sizeof(__pyx_k_s_at_0x_x_s), 0, 0, 1, 0}, + {&__pyx_kp_s_s_at_0x_x_s_2, __pyx_k_s_at_0x_x_s_2, sizeof(__pyx_k_s_at_0x_x_s_2), 0, 0, 1, 0}, + {&__pyx_n_s_select, __pyx_k_select, sizeof(__pyx_k_select), 0, 0, 1, 1}, + {&__pyx_n_s_send, __pyx_k_send, sizeof(__pyx_k_send), 0, 0, 1, 1}, + {&__pyx_n_s_sigfd, __pyx_k_sigfd, sizeof(__pyx_k_sigfd), 0, 0, 1, 1}, + {&__pyx_n_s_signal, __pyx_k_signal, sizeof(__pyx_k_signal), 0, 0, 1, 1}, + {&__pyx_n_s_signalfd, __pyx_k_signalfd, sizeof(__pyx_k_signalfd), 0, 0, 1, 1}, + {&__pyx_n_s_signalmodule, __pyx_k_signalmodule, sizeof(__pyx_k_signalmodule), 0, 0, 1, 1}, + {&__pyx_n_s_signalnum, __pyx_k_signalnum, sizeof(__pyx_k_signalnum), 0, 0, 1, 1}, + {&__pyx_n_s_signum, __pyx_k_signum, sizeof(__pyx_k_signum), 0, 0, 1, 1}, + {&__pyx_n_s_split, __pyx_k_split, sizeof(__pyx_k_split), 0, 0, 1, 1}, + {&__pyx_kp_s_src_gevent_libev_corecext_pyx, __pyx_k_src_gevent_libev_corecext_pyx, sizeof(__pyx_k_src_gevent_libev_corecext_pyx), 0, 0, 1, 0}, + {&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1}, + {&__pyx_n_s_stat, __pyx_k_stat, sizeof(__pyx_k_stat), 0, 0, 1, 1}, + {&__pyx_n_s_stop, __pyx_k_stop, sizeof(__pyx_k_stop), 0, 0, 1, 1}, + {&__pyx_kp_s_stopped, __pyx_k_stopped, sizeof(__pyx_k_stopped), 0, 0, 1, 0}, + {&__pyx_n_s_strerror, __pyx_k_strerror, sizeof(__pyx_k_strerror), 0, 0, 1, 1}, + {&__pyx_n_s_strip, __pyx_k_strip, sizeof(__pyx_k_strip), 0, 0, 1, 1}, + {&__pyx_n_s_supported_backends, __pyx_k_supported_backends, sizeof(__pyx_k_supported_backends), 0, 0, 1, 1}, + {&__pyx_n_s_sys, __pyx_k_sys, sizeof(__pyx_k_sys), 0, 0, 1, 1}, + {&__pyx_n_s_t, __pyx_k_t, sizeof(__pyx_k_t), 0, 0, 1, 1}, + {&__pyx_n_s_tb, __pyx_k_tb, sizeof(__pyx_k_tb), 0, 0, 1, 1}, + {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, + {&__pyx_n_s_throw, __pyx_k_throw, sizeof(__pyx_k_throw), 0, 0, 1, 1}, + {&__pyx_n_s_time, __pyx_k_time, sizeof(__pyx_k_time), 0, 0, 1, 1}, + {&__pyx_n_s_timer, __pyx_k_timer, sizeof(__pyx_k_timer), 0, 0, 1, 1}, + {&__pyx_n_s_trace, __pyx_k_trace, sizeof(__pyx_k_trace), 0, 0, 1, 1}, + {&__pyx_n_s_traceback, __pyx_k_traceback, sizeof(__pyx_k_traceback), 0, 0, 1, 1}, + {&__pyx_n_s_type, __pyx_k_type, sizeof(__pyx_k_type), 0, 0, 1, 1}, + {&__pyx_n_s_update, __pyx_k_update, sizeof(__pyx_k_update), 0, 0, 1, 1}, + {&__pyx_n_s_update_now, __pyx_k_update_now, sizeof(__pyx_k_update_now), 0, 0, 1, 1}, + {&__pyx_n_s_v, __pyx_k_v, sizeof(__pyx_k_v), 0, 0, 1, 1}, + {&__pyx_n_s_value, __pyx_k_value, sizeof(__pyx_k_value), 0, 0, 1, 1}, + {&__pyx_n_s_version_info, __pyx_k_version_info, sizeof(__pyx_k_version_info), 0, 0, 1, 1}, + {&__pyx_n_s_watcher, __pyx_k_watcher, sizeof(__pyx_k_watcher), 0, 0, 1, 1}, + {&__pyx_n_s_win32, __pyx_k_win32, sizeof(__pyx_k_win32), 0, 0, 1, 1}, + {&__pyx_n_s_zope_interface, __pyx_k_zope_interface, sizeof(__pyx_k_zope_interface), 0, 0, 1, 1}, + {0, 0, 0, 0, 0, 0, 0} +}; +static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { + __pyx_builtin___import__ = __Pyx_GetBuiltinName(__pyx_n_s_import); if (!__pyx_builtin___import__) __PYX_ERR(0, 39, __pyx_L1_error) + __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(0, 753, __pyx_L1_error) + __pyx_builtin_KeyError = __Pyx_GetBuiltinName(__pyx_n_s_KeyError); if (!__pyx_builtin_KeyError) __PYX_ERR(0, 203, __pyx_L1_error) + __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 204, __pyx_L1_error) + __pyx_builtin_hex = __Pyx_GetBuiltinName(__pyx_n_s_hex); if (!__pyx_builtin_hex) __PYX_ERR(0, 210, __pyx_L1_error) + __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(0, 296, __pyx_L1_error) + __pyx_builtin_SystemError = __Pyx_GetBuiltinName(__pyx_n_s_SystemError); if (!__pyx_builtin_SystemError) __PYX_ERR(0, 425, __pyx_L1_error) + __pyx_builtin_AttributeError = __Pyx_GetBuiltinName(__pyx_n_s_AttributeError); if (!__pyx_builtin_AttributeError) __PYX_ERR(0, 668, __pyx_L1_error) + __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(0, 819, __pyx_L1_error) + return 0; + __pyx_L1_error:; + return -1; +} + +static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); + + __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 258, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__4); + __Pyx_GIVEREF(__pyx_tuple__4); + + __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_Child_watchers_are_not_supported); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 668, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__10); + __Pyx_GIVEREF(__pyx_tuple__10); + + __pyx_tuple__11 = PyTuple_Pack(1, __pyx_n_s_sigfd); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 749, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__11); + __Pyx_GIVEREF(__pyx_tuple__11); + + __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_s_Cannot_construct_a_bare_watcher); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 874, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__12); + __Pyx_GIVEREF(__pyx_tuple__12); + + __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_s_Cannot_set_priority_of_an_active); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 923, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__13); + __Pyx_GIVEREF(__pyx_tuple__13); + + __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_s_io_watcher_attribute_fd_is_read); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(0, 1021, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__14); + __Pyx_GIVEREF(__pyx_tuple__14); + + __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_io_watcher_attribute_events_is); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(0, 1033, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__15); + __Pyx_GIVEREF(__pyx_tuple__15); + + __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s_child_watchers_are_only_availabl); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(0, 1190, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__16); + __Pyx_GIVEREF(__pyx_tuple__16); + + __pyx_tuple__17 = PyTuple_Pack(1, __pyx_n_s_sys); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(0, 39, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__17); + __Pyx_GIVEREF(__pyx_tuple__17); + + __pyx_tuple__18 = PyTuple_Pack(1, __pyx_n_s_os); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(0, 40, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__18); + __Pyx_GIVEREF(__pyx_tuple__18); + + __pyx_tuple__19 = PyTuple_Pack(1, __pyx_n_s_traceback); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(0, 41, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__19); + __Pyx_GIVEREF(__pyx_tuple__19); + + __pyx_tuple__20 = PyTuple_Pack(1, __pyx_n_s_signal); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(0, 42, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__20); + __Pyx_GIVEREF(__pyx_tuple__20); + + __pyx_tuple__21 = PyTuple_Pack(1, __pyx_n_s_gevent); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(0, 43, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__21); + __Pyx_GIVEREF(__pyx_tuple__21); + + __pyx_codeobj__22 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_libev_corecext_pyx, __pyx_n_s_get_version, 128, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__22)) __PYX_ERR(0, 128, __pyx_L1_error) + + __pyx_codeobj__23 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_libev_corecext_pyx, __pyx_n_s_get_header_version, 132, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__23)) __PYX_ERR(0, 132, __pyx_L1_error) + + __pyx_codeobj__24 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_libev_corecext_pyx, __pyx_n_s_supported_backends, 241, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__24)) __PYX_ERR(0, 241, __pyx_L1_error) + + __pyx_codeobj__25 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_libev_corecext_pyx, __pyx_n_s_recommended_backends, 245, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__25)) __PYX_ERR(0, 245, __pyx_L1_error) + + __pyx_codeobj__26 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_libev_corecext_pyx, __pyx_n_s_embeddable_backends, 249, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__26)) __PYX_ERR(0, 249, __pyx_L1_error) + + __pyx_codeobj__27 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_libev_corecext_pyx, __pyx_n_s_time, 253, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__27)) __PYX_ERR(0, 253, __pyx_L1_error) + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} + +static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { + if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) __PYX_ERR(0, 1, __pyx_L1_error) + return 0; + __pyx_L1_error:; + return -1; +} + +static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/ + +static int __Pyx_modinit_global_init_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); + /*--- Global init code ---*/ + __pyx_v_6gevent_5libev_8corecext_integer_types = ((PyObject*)Py_None); Py_INCREF(Py_None); + GEVENT_CORE_EVENTS = Py_None; Py_INCREF(Py_None); + _empty_tuple = ((PyObject*)Py_None); Py_INCREF(Py_None); + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_variable_export_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); + /*--- Variable export code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_function_export_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); + /*--- Function export code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_type_init_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); + /*--- Type init code ---*/ + if (PyType_Ready(&__pyx_type_6gevent_5libev_8corecext__EVENTSType) < 0) __PYX_ERR(0, 118, __pyx_L1_error) + __pyx_type_6gevent_5libev_8corecext__EVENTSType.tp_print = 0; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6gevent_5libev_8corecext__EVENTSType.tp_dictoffset && __pyx_type_6gevent_5libev_8corecext__EVENTSType.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_type_6gevent_5libev_8corecext__EVENTSType.tp_getattro = __Pyx_PyObject_GenericGetAttr; + } + __pyx_ptype_6gevent_5libev_8corecext__EVENTSType = &__pyx_type_6gevent_5libev_8corecext__EVENTSType; + if (PyType_Ready(&PyGeventCallback_Type) < 0) __PYX_ERR(0, 263, __pyx_L1_error) + PyGeventCallback_Type.tp_print = 0; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!PyGeventCallback_Type.tp_dictoffset && PyGeventCallback_Type.tp_getattro == PyObject_GenericGetAttr)) { + PyGeventCallback_Type.tp_getattro = __Pyx_PyObject_GenericGetAttr; + } + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_callback, (PyObject *)&PyGeventCallback_Type) < 0) __PYX_ERR(0, 263, __pyx_L1_error) + __pyx_ptype_6gevent_5libev_8corecext_callback = &PyGeventCallback_Type; + __pyx_vtabptr_6gevent_5libev_8corecext_CallbackFIFO = &__pyx_vtable_6gevent_5libev_8corecext_CallbackFIFO; + __pyx_vtable_6gevent_5libev_8corecext_CallbackFIFO.popleft = (struct PyGeventCallbackObject *(*)(struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *))__pyx_f_6gevent_5libev_8corecext_12CallbackFIFO_popleft; + __pyx_vtable_6gevent_5libev_8corecext_CallbackFIFO.append = (PyObject *(*)(struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *, struct PyGeventCallbackObject *))__pyx_f_6gevent_5libev_8corecext_12CallbackFIFO_append; + __pyx_vtable_6gevent_5libev_8corecext_CallbackFIFO.has_callbacks = (int (*)(struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *))__pyx_f_6gevent_5libev_8corecext_12CallbackFIFO_has_callbacks; + if (PyType_Ready(&__pyx_type_6gevent_5libev_8corecext_CallbackFIFO) < 0) __PYX_ERR(0, 316, __pyx_L1_error) + __pyx_type_6gevent_5libev_8corecext_CallbackFIFO.tp_print = 0; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6gevent_5libev_8corecext_CallbackFIFO.tp_dictoffset && __pyx_type_6gevent_5libev_8corecext_CallbackFIFO.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_type_6gevent_5libev_8corecext_CallbackFIFO.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + } + if (__Pyx_SetVtable(__pyx_type_6gevent_5libev_8corecext_CallbackFIFO.tp_dict, __pyx_vtabptr_6gevent_5libev_8corecext_CallbackFIFO) < 0) __PYX_ERR(0, 316, __pyx_L1_error) + __pyx_ptype_6gevent_5libev_8corecext_CallbackFIFO = &__pyx_type_6gevent_5libev_8corecext_CallbackFIFO; + __pyx_vtabptr_6gevent_5libev_8corecext_loop = &__pyx_vtable_6gevent_5libev_8corecext_loop; + __pyx_vtable_6gevent_5libev_8corecext_loop._run_callbacks = (PyObject *(*)(struct PyGeventLoopObject *))__pyx_f_6gevent_5libev_8corecext_4loop__run_callbacks; + __pyx_vtable_6gevent_5libev_8corecext_loop._stop_watchers = (PyObject *(*)(struct PyGeventLoopObject *, struct ev_loop *))__pyx_f_6gevent_5libev_8corecext_4loop__stop_watchers; + __pyx_vtable_6gevent_5libev_8corecext_loop.handle_error = (PyObject *(*)(struct PyGeventLoopObject *, PyObject *, PyObject *, PyObject *, PyObject *, int __pyx_skip_dispatch))__pyx_f_6gevent_5libev_8corecext_4loop_handle_error; + __pyx_vtable_6gevent_5libev_8corecext_loop._default_handle_error = (PyObject *(*)(struct PyGeventLoopObject *, PyObject *, PyObject *, PyObject *, PyObject *, int __pyx_skip_dispatch))__pyx_f_6gevent_5libev_8corecext_4loop__default_handle_error; + __pyx_vtable_6gevent_5libev_8corecext_loop.now = (ev_tstamp (*)(struct PyGeventLoopObject *, int __pyx_skip_dispatch))__pyx_f_6gevent_5libev_8corecext_4loop_now; + __pyx_vtable_6gevent_5libev_8corecext_loop.update_now = (void (*)(struct PyGeventLoopObject *, int __pyx_skip_dispatch))__pyx_f_6gevent_5libev_8corecext_4loop_update_now; + if (PyType_Ready(&PyGeventLoop_Type) < 0) __PYX_ERR(0, 375, __pyx_L1_error) + PyGeventLoop_Type.tp_print = 0; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!PyGeventLoop_Type.tp_dictoffset && PyGeventLoop_Type.tp_getattro == PyObject_GenericGetAttr)) { + PyGeventLoop_Type.tp_getattro = __Pyx_PyObject_GenericGetAttr; + } + if (__Pyx_SetVtable(PyGeventLoop_Type.tp_dict, __pyx_vtabptr_6gevent_5libev_8corecext_loop) < 0) __PYX_ERR(0, 375, __pyx_L1_error) + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_loop, (PyObject *)&PyGeventLoop_Type) < 0) __PYX_ERR(0, 375, __pyx_L1_error) + __pyx_ptype_6gevent_5libev_8corecext_loop = &PyGeventLoop_Type; + if (PyType_Ready(&PyGeventWatcher_Type) < 0) __PYX_ERR(0, 827, __pyx_L1_error) + PyGeventWatcher_Type.tp_print = 0; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!PyGeventWatcher_Type.tp_dictoffset && PyGeventWatcher_Type.tp_getattro == PyObject_GenericGetAttr)) { + PyGeventWatcher_Type.tp_getattro = __Pyx_PyObject_GenericGetAttr; + } + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_watcher, (PyObject *)&PyGeventWatcher_Type) < 0) __PYX_ERR(0, 827, __pyx_L1_error) + __pyx_ptype_6gevent_5libev_8corecext_watcher = &PyGeventWatcher_Type; + PyGeventIO_Type.tp_base = __pyx_ptype_6gevent_5libev_8corecext_watcher; + if (PyType_Ready(&PyGeventIO_Type) < 0) __PYX_ERR(0, 988, __pyx_L1_error) + PyGeventIO_Type.tp_print = 0; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!PyGeventIO_Type.tp_dictoffset && PyGeventIO_Type.tp_getattro == PyObject_GenericGetAttr)) { + PyGeventIO_Type.tp_getattro = __Pyx_PyObject_GenericGetAttr; + } + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_io, (PyObject *)&PyGeventIO_Type) < 0) __PYX_ERR(0, 988, __pyx_L1_error) + __pyx_ptype_6gevent_5libev_8corecext_io = &PyGeventIO_Type; + PyGeventTimer_Type.tp_base = __pyx_ptype_6gevent_5libev_8corecext_watcher; + if (PyType_Ready(&PyGeventTimer_Type) < 0) __PYX_ERR(0, 1045, __pyx_L1_error) + PyGeventTimer_Type.tp_print = 0; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!PyGeventTimer_Type.tp_dictoffset && PyGeventTimer_Type.tp_getattro == PyObject_GenericGetAttr)) { + PyGeventTimer_Type.tp_getattro = __Pyx_PyObject_GenericGetAttr; + } + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_timer, (PyObject *)&PyGeventTimer_Type) < 0) __PYX_ERR(0, 1045, __pyx_L1_error) + __pyx_ptype_6gevent_5libev_8corecext_timer = &PyGeventTimer_Type; + PyGeventSignal_Type.tp_base = __pyx_ptype_6gevent_5libev_8corecext_watcher; + if (PyType_Ready(&PyGeventSignal_Type) < 0) __PYX_ERR(0, 1085, __pyx_L1_error) + PyGeventSignal_Type.tp_print = 0; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!PyGeventSignal_Type.tp_dictoffset && PyGeventSignal_Type.tp_getattro == PyObject_GenericGetAttr)) { + PyGeventSignal_Type.tp_getattro = __Pyx_PyObject_GenericGetAttr; + } + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_signal, (PyObject *)&PyGeventSignal_Type) < 0) __PYX_ERR(0, 1085, __pyx_L1_error) + __pyx_ptype_6gevent_5libev_8corecext_signal = &PyGeventSignal_Type; + PyGeventIdle_Type.tp_base = __pyx_ptype_6gevent_5libev_8corecext_watcher; + if (PyType_Ready(&PyGeventIdle_Type) < 0) __PYX_ERR(0, 1108, __pyx_L1_error) + PyGeventIdle_Type.tp_print = 0; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!PyGeventIdle_Type.tp_dictoffset && PyGeventIdle_Type.tp_getattro == PyObject_GenericGetAttr)) { + PyGeventIdle_Type.tp_getattro = __Pyx_PyObject_GenericGetAttr; + } + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_idle, (PyObject *)&PyGeventIdle_Type) < 0) __PYX_ERR(0, 1108, __pyx_L1_error) + __pyx_ptype_6gevent_5libev_8corecext_idle = &PyGeventIdle_Type; + PyGeventPrepare_Type.tp_base = __pyx_ptype_6gevent_5libev_8corecext_watcher; + if (PyType_Ready(&PyGeventPrepare_Type) < 0) __PYX_ERR(0, 1121, __pyx_L1_error) + PyGeventPrepare_Type.tp_print = 0; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!PyGeventPrepare_Type.tp_dictoffset && PyGeventPrepare_Type.tp_getattro == PyObject_GenericGetAttr)) { + PyGeventPrepare_Type.tp_getattro = __Pyx_PyObject_GenericGetAttr; + } + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_prepare, (PyObject *)&PyGeventPrepare_Type) < 0) __PYX_ERR(0, 1121, __pyx_L1_error) + __pyx_ptype_6gevent_5libev_8corecext_prepare = &PyGeventPrepare_Type; + PyGeventCheck_Type.tp_base = __pyx_ptype_6gevent_5libev_8corecext_watcher; + if (PyType_Ready(&PyGeventCheck_Type) < 0) __PYX_ERR(0, 1134, __pyx_L1_error) + PyGeventCheck_Type.tp_print = 0; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!PyGeventCheck_Type.tp_dictoffset && PyGeventCheck_Type.tp_getattro == PyObject_GenericGetAttr)) { + PyGeventCheck_Type.tp_getattro = __Pyx_PyObject_GenericGetAttr; + } + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_check, (PyObject *)&PyGeventCheck_Type) < 0) __PYX_ERR(0, 1134, __pyx_L1_error) + __pyx_ptype_6gevent_5libev_8corecext_check = &PyGeventCheck_Type; + PyGeventFork_Type.tp_base = __pyx_ptype_6gevent_5libev_8corecext_watcher; + if (PyType_Ready(&PyGeventFork_Type) < 0) __PYX_ERR(0, 1147, __pyx_L1_error) + PyGeventFork_Type.tp_print = 0; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!PyGeventFork_Type.tp_dictoffset && PyGeventFork_Type.tp_getattro == PyObject_GenericGetAttr)) { + PyGeventFork_Type.tp_getattro = __Pyx_PyObject_GenericGetAttr; + } + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_fork, (PyObject *)&PyGeventFork_Type) < 0) __PYX_ERR(0, 1147, __pyx_L1_error) + __pyx_ptype_6gevent_5libev_8corecext_fork = &PyGeventFork_Type; + PyGeventAsync_Type.tp_base = __pyx_ptype_6gevent_5libev_8corecext_watcher; + if (PyType_Ready(&PyGeventAsync_Type) < 0) __PYX_ERR(0, 1159, __pyx_L1_error) + PyGeventAsync_Type.tp_print = 0; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!PyGeventAsync_Type.tp_dictoffset && PyGeventAsync_Type.tp_getattro == PyObject_GenericGetAttr)) { + PyGeventAsync_Type.tp_getattro = __Pyx_PyObject_GenericGetAttr; + } + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_async, (PyObject *)&PyGeventAsync_Type) < 0) __PYX_ERR(0, 1159, __pyx_L1_error) + __pyx_ptype_6gevent_5libev_8corecext_async_ = &PyGeventAsync_Type; + PyGeventChild_Type.tp_base = __pyx_ptype_6gevent_5libev_8corecext_watcher; + if (PyType_Ready(&PyGeventChild_Type) < 0) __PYX_ERR(0, 1182, __pyx_L1_error) + PyGeventChild_Type.tp_print = 0; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!PyGeventChild_Type.tp_dictoffset && PyGeventChild_Type.tp_getattro == PyObject_GenericGetAttr)) { + PyGeventChild_Type.tp_getattro = __Pyx_PyObject_GenericGetAttr; + } + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_child, (PyObject *)&PyGeventChild_Type) < 0) __PYX_ERR(0, 1182, __pyx_L1_error) + __pyx_ptype_6gevent_5libev_8corecext_child = &PyGeventChild_Type; + PyGeventStat_Type.tp_base = __pyx_ptype_6gevent_5libev_8corecext_watcher; + if (PyType_Ready(&PyGeventStat_Type) < 0) __PYX_ERR(0, 1225, __pyx_L1_error) + PyGeventStat_Type.tp_print = 0; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!PyGeventStat_Type.tp_dictoffset && PyGeventStat_Type.tp_getattro == PyObject_GenericGetAttr)) { + PyGeventStat_Type.tp_getattro = __Pyx_PyObject_GenericGetAttr; + } + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_stat, (PyObject *)&PyGeventStat_Type) < 0) __PYX_ERR(0, 1225, __pyx_L1_error) + __pyx_ptype_6gevent_5libev_8corecext_stat = &PyGeventStat_Type; + if (PyType_Ready(&__pyx_type_6gevent_5libev_8corecext___pyx_scope_struct__genexpr) < 0) __PYX_ERR(0, 149, __pyx_L1_error) + __pyx_type_6gevent_5libev_8corecext___pyx_scope_struct__genexpr.tp_print = 0; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6gevent_5libev_8corecext___pyx_scope_struct__genexpr.tp_dictoffset && __pyx_type_6gevent_5libev_8corecext___pyx_scope_struct__genexpr.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_type_6gevent_5libev_8corecext___pyx_scope_struct__genexpr.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + } + __pyx_ptype_6gevent_5libev_8corecext___pyx_scope_struct__genexpr = &__pyx_type_6gevent_5libev_8corecext___pyx_scope_struct__genexpr; + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_modinit_type_import_code(void) { + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); + /*--- Type import code ---*/ + __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 9, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type", + #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000 + sizeof(PyTypeObject), + #else + sizeof(PyHeapTypeObject), + #endif + __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(1, 9, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 8, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_ptype_7cpython_4bool_bool = __Pyx_ImportType(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "bool", sizeof(PyBoolObject), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_7cpython_4bool_bool) __PYX_ERR(2, 8, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 15, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_ptype_7cpython_7complex_complex = __Pyx_ImportType(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "complex", sizeof(PyComplexObject), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_7cpython_7complex_complex) __PYX_ERR(3, 15, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_modinit_variable_import_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); + /*--- Variable import code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_function_import_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); + /*--- Function import code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + + +#if PY_MAJOR_VERSION < 3 +#ifdef CYTHON_NO_PYINIT_EXPORT +#define __Pyx_PyMODINIT_FUNC void +#else +#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC +#endif +#else +#ifdef CYTHON_NO_PYINIT_EXPORT +#define __Pyx_PyMODINIT_FUNC PyObject * +#else +#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC +#endif +#endif + + +#if PY_MAJOR_VERSION < 3 +__Pyx_PyMODINIT_FUNC initcorecext(void) CYTHON_SMALL_CODE; /*proto*/ +__Pyx_PyMODINIT_FUNC initcorecext(void) +#else +__Pyx_PyMODINIT_FUNC PyInit_corecext(void) CYTHON_SMALL_CODE; /*proto*/ +__Pyx_PyMODINIT_FUNC PyInit_corecext(void) +#if CYTHON_PEP489_MULTI_PHASE_INIT +{ + return PyModuleDef_Init(&__pyx_moduledef); +} +static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { + #if PY_VERSION_HEX >= 0x030700A1 + static PY_INT64_T main_interpreter_id = -1; + PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); + if (main_interpreter_id == -1) { + main_interpreter_id = current_id; + return (unlikely(current_id == -1)) ? -1 : 0; + } else if (unlikely(main_interpreter_id != current_id)) + #else + static PyInterpreterState *main_interpreter = NULL; + PyInterpreterState *current_interpreter = PyThreadState_Get()->interp; + if (!main_interpreter) { + main_interpreter = current_interpreter; + } else if (unlikely(main_interpreter != current_interpreter)) + #endif + { + PyErr_SetString( + PyExc_ImportError, + "Interpreter change detected - this module can only be loaded into one interpreter per process."); + return -1; + } + return 0; +} +static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) { + PyObject *value = PyObject_GetAttrString(spec, from_name); + int result = 0; + if (likely(value)) { + if (allow_none || value != Py_None) { + result = PyDict_SetItemString(moddict, to_name, value); + } + Py_DECREF(value); + } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_Clear(); + } else { + result = -1; + } + return result; +} +static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) { + PyObject *module = NULL, *moddict, *modname; + if (__Pyx_check_single_interpreter()) + return NULL; + if (__pyx_m) + return __Pyx_NewRef(__pyx_m); + modname = PyObject_GetAttrString(spec, "name"); + if (unlikely(!modname)) goto bad; + module = PyModule_NewObject(modname); + Py_DECREF(modname); + if (unlikely(!module)) goto bad; + moddict = PyModule_GetDict(module); + if (unlikely(!moddict)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad; + return module; +bad: + Py_XDECREF(module); + return NULL; +} + + +static CYTHON_SMALL_CODE int __pyx_pymod_exec_corecext(PyObject *__pyx_pyinit_module) +#endif +#endif +{ + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + PyObject *__pyx_t_14 = NULL; + PyObject *__pyx_t_15 = NULL; + PyObject *__pyx_t_16 = NULL; + PyObject *__pyx_t_17 = NULL; + PyObject *__pyx_t_18 = NULL; + PyObject *__pyx_t_19 = NULL; + PyObject *__pyx_t_20 = NULL; + PyObject *__pyx_t_21 = NULL; + int __pyx_t_22; + __Pyx_RefNannyDeclarations + #if CYTHON_PEP489_MULTI_PHASE_INIT + if (__pyx_m) { + if (__pyx_m == __pyx_pyinit_module) return 0; + PyErr_SetString(PyExc_RuntimeError, "Module 'corecext' has already been imported. Re-initialisation is not supported."); + return -1; + } + #elif PY_MAJOR_VERSION >= 3 + if (__pyx_m) return __Pyx_NewRef(__pyx_m); + #endif + #if CYTHON_REFNANNY +__Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); +if (!__Pyx_RefNanny) { + PyErr_Clear(); + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); + if (!__Pyx_RefNanny) + Py_FatalError("failed to import 'refnanny' module"); +} +#endif + __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_corecext(void)", 0); + if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #ifdef __Pxy_PyFrame_Initialize_Offsets + __Pxy_PyFrame_Initialize_Offsets(); + #endif + __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) + #ifdef __Pyx_CyFunction_USED + if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_FusedFunction_USED + if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_Coroutine_USED + if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_Generator_USED + if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_AsyncGen_USED + if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_StopAsyncIteration_USED + if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + /*--- Library function declarations ---*/ + /*--- Threads initialization code ---*/ + #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS + #ifdef WITH_THREAD /* Python build with threading support? */ + PyEval_InitThreads(); + #endif + #endif + /*--- Module creation code ---*/ + #if CYTHON_PEP489_MULTI_PHASE_INIT + __pyx_m = __pyx_pyinit_module; + Py_INCREF(__pyx_m); + #else + #if PY_MAJOR_VERSION < 3 + __pyx_m = Py_InitModule4("corecext", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); + #else + __pyx_m = PyModule_Create(&__pyx_moduledef); + #endif + if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) + Py_INCREF(__pyx_d); + __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) + #if CYTHON_COMPILING_IN_PYPY + Py_INCREF(__pyx_b); + #endif + if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + /*--- Initialize various global constants etc. ---*/ + if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) + if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + if (__pyx_module_is_main_gevent__libev__corecext) { + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + } + #if PY_MAJOR_VERSION >= 3 + { + PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) + if (!PyDict_GetItemString(modules, "gevent.libev.corecext")) { + if (unlikely(PyDict_SetItemString(modules, "gevent.libev.corecext", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error) + } + } + #endif + /*--- Builtin init code ---*/ + if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + /*--- Constants init code ---*/ + if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + /*--- Global type/function init code ---*/ + (void)__Pyx_modinit_global_init_code(); + (void)__Pyx_modinit_variable_export_code(); + (void)__Pyx_modinit_function_export_code(); + if (unlikely(__Pyx_modinit_type_init_code() != 0)) goto __pyx_L1_error; + if (unlikely(__Pyx_modinit_type_import_code() != 0)) goto __pyx_L1_error; + (void)__Pyx_modinit_variable_import_code(); + (void)__Pyx_modinit_function_import_code(); + /*--- Execution code ---*/ + #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) + if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + + __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 39, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_level, __pyx_int_0) < 0) __PYX_ERR(0, 39, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin___import__, __pyx_tuple__17, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 39, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_sys, __pyx_t_2) < 0) __PYX_ERR(0, 39, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 40, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_level, __pyx_int_0) < 0) __PYX_ERR(0, 40, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin___import__, __pyx_tuple__18, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 40, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_os, __pyx_t_1) < 0) __PYX_ERR(0, 40, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 41, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_level, __pyx_int_0) < 0) __PYX_ERR(0, 41, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin___import__, __pyx_tuple__19, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 41, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_traceback, __pyx_t_2) < 0) __PYX_ERR(0, 41, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 42, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_level, __pyx_int_0) < 0) __PYX_ERR(0, 42, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin___import__, __pyx_tuple__20, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 42, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_signalmodule, __pyx_t_1) < 0) __PYX_ERR(0, 42, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 43, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_level, __pyx_int_0) < 0) __PYX_ERR(0, 43, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin___import__, __pyx_tuple__21, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 43, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_getswitchinterval); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 43, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_getswitchinterval, __pyx_t_1) < 0) __PYX_ERR(0, 43, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + __pyx_t_1 = PyList_New(7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 46, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_get_version); + __Pyx_GIVEREF(__pyx_n_s_get_version); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_get_version); + __Pyx_INCREF(__pyx_n_s_get_header_version); + __Pyx_GIVEREF(__pyx_n_s_get_header_version); + PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_get_header_version); + __Pyx_INCREF(__pyx_n_s_supported_backends); + __Pyx_GIVEREF(__pyx_n_s_supported_backends); + PyList_SET_ITEM(__pyx_t_1, 2, __pyx_n_s_supported_backends); + __Pyx_INCREF(__pyx_n_s_recommended_backends); + __Pyx_GIVEREF(__pyx_n_s_recommended_backends); + PyList_SET_ITEM(__pyx_t_1, 3, __pyx_n_s_recommended_backends); + __Pyx_INCREF(__pyx_n_s_embeddable_backends); + __Pyx_GIVEREF(__pyx_n_s_embeddable_backends); + PyList_SET_ITEM(__pyx_t_1, 4, __pyx_n_s_embeddable_backends); + __Pyx_INCREF(__pyx_n_s_time); + __Pyx_GIVEREF(__pyx_n_s_time); + PyList_SET_ITEM(__pyx_t_1, 5, __pyx_n_s_time); + __Pyx_INCREF(__pyx_n_s_loop); + __Pyx_GIVEREF(__pyx_n_s_loop); + PyList_SET_ITEM(__pyx_t_1, 6, __pyx_n_s_loop); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_all, __pyx_t_1) < 0) __PYX_ERR(0, 46, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_sys); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 56, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_version_info); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 56, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 56, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_int_3, Py_GE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 56, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 56, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_3) { + + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 57, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)(&PyInt_Type))); + __Pyx_GIVEREF(((PyObject *)(&PyInt_Type))); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)(&PyInt_Type))); + __Pyx_XGOTREF(__pyx_v_6gevent_5libev_8corecext_integer_types); + __Pyx_DECREF_SET(__pyx_v_6gevent_5libev_8corecext_integer_types, ((PyObject*)__pyx_t_2)); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + + goto __pyx_L2; + } + + /*else*/ { + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 59, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)(&PyInt_Type))); + __Pyx_GIVEREF(((PyObject *)(&PyInt_Type))); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)(&PyInt_Type))); + __Pyx_INCREF(((PyObject *)(&PyLong_Type))); + __Pyx_GIVEREF(((PyObject *)(&PyLong_Type))); + PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)(&PyLong_Type))); + __Pyx_XGOTREF(__pyx_v_6gevent_5libev_8corecext_integer_types); + __Pyx_DECREF_SET(__pyx_v_6gevent_5libev_8corecext_integer_types, ((PyObject*)__pyx_t_2)); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + } + __pyx_L2:; + + __pyx_t_2 = __Pyx_PyInt_From_int(EV_UNDEF); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 82, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_UNDEF, __pyx_t_2) < 0) __PYX_ERR(0, 82, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + __pyx_t_2 = __Pyx_PyInt_From_int(EV_NONE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 83, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_NONE, __pyx_t_2) < 0) __PYX_ERR(0, 83, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + __pyx_t_2 = __Pyx_PyInt_From_int(EV_READ); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 84, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_READ, __pyx_t_2) < 0) __PYX_ERR(0, 84, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + __pyx_t_2 = __Pyx_PyInt_From_int(EV_WRITE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 85, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_WRITE, __pyx_t_2) < 0) __PYX_ERR(0, 85, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + __pyx_t_2 = __Pyx_PyInt_From_int(EV_TIMER); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 86, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_TIMER, __pyx_t_2) < 0) __PYX_ERR(0, 86, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + __pyx_t_2 = __Pyx_PyInt_From_int(EV_PERIODIC); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 87, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_PERIODIC, __pyx_t_2) < 0) __PYX_ERR(0, 87, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + __pyx_t_2 = __Pyx_PyInt_From_int(EV_SIGNAL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 88, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_SIGNAL, __pyx_t_2) < 0) __PYX_ERR(0, 88, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + __pyx_t_2 = __Pyx_PyInt_From_int(EV_CHILD); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 89, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_CHILD, __pyx_t_2) < 0) __PYX_ERR(0, 89, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + __pyx_t_2 = __Pyx_PyInt_From_int(EV_STAT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 90, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_STAT, __pyx_t_2) < 0) __PYX_ERR(0, 90, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + __pyx_t_2 = __Pyx_PyInt_From_int(EV_IDLE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 91, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_IDLE, __pyx_t_2) < 0) __PYX_ERR(0, 91, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + __pyx_t_2 = __Pyx_PyInt_From_int(EV_PREPARE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 92, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_PREPARE, __pyx_t_2) < 0) __PYX_ERR(0, 92, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + __pyx_t_2 = __Pyx_PyInt_From_int(EV_CHECK); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 93, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_CHECK, __pyx_t_2) < 0) __PYX_ERR(0, 93, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + __pyx_t_2 = __Pyx_PyInt_From_int(EV_EMBED); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 94, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_EMBED, __pyx_t_2) < 0) __PYX_ERR(0, 94, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + __pyx_t_2 = __Pyx_PyInt_From_int(EV_FORK); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 95, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_FORK, __pyx_t_2) < 0) __PYX_ERR(0, 95, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + __pyx_t_2 = __Pyx_PyInt_From_int(EV_CLEANUP); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 96, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_CLEANUP, __pyx_t_2) < 0) __PYX_ERR(0, 96, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + __pyx_t_2 = __Pyx_PyInt_From_int(EV_ASYNC); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 97, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ASYNC, __pyx_t_2) < 0) __PYX_ERR(0, 97, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + __pyx_t_2 = __Pyx_PyInt_From_int(EV_CUSTOM); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 98, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_CUSTOM, __pyx_t_2) < 0) __PYX_ERR(0, 98, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + __pyx_t_2 = __Pyx_PyInt_From_int(EV_ERROR); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 99, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ERROR, __pyx_t_2) < 0) __PYX_ERR(0, 99, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + __pyx_t_2 = __Pyx_PyInt_From_int((EV_READ | EV_WRITE)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 101, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_READWRITE, __pyx_t_2) < 0) __PYX_ERR(0, 101, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + __pyx_t_2 = __Pyx_PyInt_From_int(EV_MINPRI); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 103, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_MINPRI, __pyx_t_2) < 0) __PYX_ERR(0, 103, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + __pyx_t_2 = __Pyx_PyInt_From_int(EV_MAXPRI); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 104, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_MAXPRI, __pyx_t_2) < 0) __PYX_ERR(0, 104, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + __pyx_t_2 = __Pyx_PyInt_From_int(EVBACKEND_PORT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 106, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_BACKEND_PORT, __pyx_t_2) < 0) __PYX_ERR(0, 106, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + __pyx_t_2 = __Pyx_PyInt_From_int(EVBACKEND_KQUEUE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 107, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_BACKEND_KQUEUE, __pyx_t_2) < 0) __PYX_ERR(0, 107, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + __pyx_t_2 = __Pyx_PyInt_From_int(EVBACKEND_EPOLL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 108, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_BACKEND_EPOLL, __pyx_t_2) < 0) __PYX_ERR(0, 108, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + __pyx_t_2 = __Pyx_PyInt_From_int(EVBACKEND_POLL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 109, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_BACKEND_POLL, __pyx_t_2) < 0) __PYX_ERR(0, 109, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + __pyx_t_2 = __Pyx_PyInt_From_int(EVBACKEND_SELECT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 110, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_BACKEND_SELECT, __pyx_t_2) < 0) __PYX_ERR(0, 110, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + __pyx_t_2 = __Pyx_PyInt_From_int(EVFLAG_FORKCHECK); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 111, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_FORKCHECK, __pyx_t_2) < 0) __PYX_ERR(0, 111, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + __pyx_t_2 = __Pyx_PyInt_From_int(EVFLAG_NOINOTIFY); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 112, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_NOINOTIFY, __pyx_t_2) < 0) __PYX_ERR(0, 112, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + __pyx_t_2 = __Pyx_PyInt_From_int(EVFLAG_SIGNALFD); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 113, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_SIGNALFD, __pyx_t_2) < 0) __PYX_ERR(0, 113, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + __pyx_t_2 = __Pyx_PyInt_From_int(EVFLAG_NOSIGMASK); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 114, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_NOSIGMASK, __pyx_t_2) < 0) __PYX_ERR(0, 114, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + __pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_6gevent_5libev_8corecext__EVENTSType)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 124, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_XGOTREF(GEVENT_CORE_EVENTS); + __Pyx_DECREF_SET(GEVENT_CORE_EVENTS, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + + if (PyDict_SetItem(__pyx_d, __pyx_n_s_EVENTS, GEVENT_CORE_EVENTS) < 0) __PYX_ERR(0, 125, __pyx_L1_error) + + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6gevent_5libev_8corecext_1get_version, NULL, __pyx_n_s_gevent_libev_corecext); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 128, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_version, __pyx_t_2) < 0) __PYX_ERR(0, 128, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6gevent_5libev_8corecext_3get_header_version, NULL, __pyx_n_s_gevent_libev_corecext); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 132, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_header_version, __pyx_t_2) < 0) __PYX_ERR(0, 132, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + __pyx_t_2 = __Pyx_PyInt_From_int(EVBACKEND_PORT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 137, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 137, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); + __Pyx_INCREF(__pyx_n_s_port); + __Pyx_GIVEREF(__pyx_n_s_port); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_port); + __pyx_t_2 = 0; + + __pyx_t_2 = __Pyx_PyInt_From_int(EVBACKEND_KQUEUE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 138, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 138, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_INCREF(__pyx_n_s_kqueue); + __Pyx_GIVEREF(__pyx_n_s_kqueue); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_n_s_kqueue); + __pyx_t_2 = 0; + + __pyx_t_2 = __Pyx_PyInt_From_int(EVBACKEND_EPOLL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 139, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 139, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); + __Pyx_INCREF(__pyx_n_s_epoll); + __Pyx_GIVEREF(__pyx_n_s_epoll); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_n_s_epoll); + __pyx_t_2 = 0; + + __pyx_t_2 = __Pyx_PyInt_From_int(EVBACKEND_POLL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 140, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 140, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); + __Pyx_INCREF(__pyx_n_s_poll); + __Pyx_GIVEREF(__pyx_n_s_poll); + PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_n_s_poll); + __pyx_t_2 = 0; + + __pyx_t_2 = __Pyx_PyInt_From_int(EVBACKEND_SELECT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 141, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 141, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2); + __Pyx_INCREF(__pyx_n_s_select); + __Pyx_GIVEREF(__pyx_n_s_select); + PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_n_s_select); + __pyx_t_2 = 0; + + __pyx_t_2 = __Pyx_PyInt_From_int(EVFLAG_NOENV); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 142, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 142, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_2); + __Pyx_INCREF(__pyx_n_s_noenv); + __Pyx_GIVEREF(__pyx_n_s_noenv); + PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_n_s_noenv); + __pyx_t_2 = 0; + + __pyx_t_2 = __Pyx_PyInt_From_int(EVFLAG_FORKCHECK); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 143, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 143, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_2); + __Pyx_INCREF(__pyx_n_s_forkcheck); + __Pyx_GIVEREF(__pyx_n_s_forkcheck); + PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_n_s_forkcheck); + __pyx_t_2 = 0; + + __pyx_t_2 = __Pyx_PyInt_From_int(EVFLAG_NOINOTIFY); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 144, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 144, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_2); + __Pyx_INCREF(__pyx_n_s_noinotify); + __Pyx_GIVEREF(__pyx_n_s_noinotify); + PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_n_s_noinotify); + __pyx_t_2 = 0; + + __pyx_t_2 = __Pyx_PyInt_From_int(EVFLAG_SIGNALFD); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 145, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 145, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_2); + __Pyx_INCREF(__pyx_n_s_signalfd); + __Pyx_GIVEREF(__pyx_n_s_signalfd); + PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_n_s_signalfd); + __pyx_t_2 = 0; + + __pyx_t_2 = __Pyx_PyInt_From_int(EVFLAG_NOSIGMASK); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 146, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 146, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_2); + __Pyx_INCREF(__pyx_n_s_nosigmask); + __Pyx_GIVEREF(__pyx_n_s_nosigmask); + PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_n_s_nosigmask); + __pyx_t_2 = 0; + + __pyx_t_2 = PyList_New(10); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 137, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_1); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_4); + PyList_SET_ITEM(__pyx_t_2, 1, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_5); + PyList_SET_ITEM(__pyx_t_2, 2, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_6); + PyList_SET_ITEM(__pyx_t_2, 3, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_7); + PyList_SET_ITEM(__pyx_t_2, 4, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_8); + PyList_SET_ITEM(__pyx_t_2, 5, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_9); + PyList_SET_ITEM(__pyx_t_2, 6, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_10); + PyList_SET_ITEM(__pyx_t_2, 7, __pyx_t_10); + __Pyx_GIVEREF(__pyx_t_11); + PyList_SET_ITEM(__pyx_t_2, 8, __pyx_t_11); + __Pyx_GIVEREF(__pyx_t_12); + PyList_SET_ITEM(__pyx_t_2, 9, __pyx_t_12); + __pyx_t_1 = 0; + __pyx_t_4 = 0; + __pyx_t_5 = 0; + __pyx_t_6 = 0; + __pyx_t_7 = 0; + __pyx_t_8 = 0; + __pyx_t_9 = 0; + __pyx_t_10 = 0; + __pyx_t_11 = 0; + __pyx_t_12 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_flags, __pyx_t_2) < 0) __PYX_ERR(0, 137, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + __pyx_t_2 = __pyx_pf_6gevent_5libev_8corecext_22genexpr(NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 149, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_12 = __Pyx_Generator_Next(__pyx_t_2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 149, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_flags_str2int, __pyx_t_12) < 0) __PYX_ERR(0, 149, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + + __pyx_t_12 = __Pyx_PyInt_From_int(EV_READ); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 152, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 152, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_12); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_12); + __Pyx_INCREF(__pyx_n_s_READ); + __Pyx_GIVEREF(__pyx_n_s_READ); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_READ); + __pyx_t_12 = 0; + + __pyx_t_12 = __Pyx_PyInt_From_int(EV_WRITE); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 153, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 153, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_GIVEREF(__pyx_t_12); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_12); + __Pyx_INCREF(__pyx_n_s_WRITE); + __Pyx_GIVEREF(__pyx_n_s_WRITE); + PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_n_s_WRITE); + __pyx_t_12 = 0; + + __pyx_t_12 = __Pyx_PyInt_From_int(EV__IOFDSET); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 154, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 154, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_GIVEREF(__pyx_t_12); + PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_12); + __Pyx_INCREF(__pyx_n_s_IOFDSET); + __Pyx_GIVEREF(__pyx_n_s_IOFDSET); + PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_n_s_IOFDSET); + __pyx_t_12 = 0; + + __pyx_t_12 = __Pyx_PyInt_From_int(EV_PERIODIC); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 155, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 155, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_GIVEREF(__pyx_t_12); + PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_12); + __Pyx_INCREF(__pyx_n_s_PERIODIC); + __Pyx_GIVEREF(__pyx_n_s_PERIODIC); + PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_n_s_PERIODIC); + __pyx_t_12 = 0; + + __pyx_t_12 = __Pyx_PyInt_From_int(EV_SIGNAL); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 156, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 156, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_GIVEREF(__pyx_t_12); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_12); + __Pyx_INCREF(__pyx_n_s_SIGNAL); + __Pyx_GIVEREF(__pyx_n_s_SIGNAL); + PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_n_s_SIGNAL); + __pyx_t_12 = 0; + + __pyx_t_12 = __Pyx_PyInt_From_int(EV_CHILD); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 157, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 157, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GIVEREF(__pyx_t_12); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_12); + __Pyx_INCREF(__pyx_n_s_CHILD); + __Pyx_GIVEREF(__pyx_n_s_CHILD); + PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_n_s_CHILD); + __pyx_t_12 = 0; + + __pyx_t_12 = __Pyx_PyInt_From_int(EV_STAT); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 158, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 158, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GIVEREF(__pyx_t_12); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_12); + __Pyx_INCREF(__pyx_n_s_STAT); + __Pyx_GIVEREF(__pyx_n_s_STAT); + PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_n_s_STAT); + __pyx_t_12 = 0; + + __pyx_t_12 = __Pyx_PyInt_From_int(EV_IDLE); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 159, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 159, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_12); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_12); + __Pyx_INCREF(__pyx_n_s_IDLE); + __Pyx_GIVEREF(__pyx_n_s_IDLE); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_n_s_IDLE); + __pyx_t_12 = 0; + + __pyx_t_12 = __Pyx_PyInt_From_int(EV_PREPARE); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 160, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 160, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_12); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_12); + __Pyx_INCREF(__pyx_n_s_PREPARE); + __Pyx_GIVEREF(__pyx_n_s_PREPARE); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_n_s_PREPARE); + __pyx_t_12 = 0; + + __pyx_t_12 = __Pyx_PyInt_From_int(EV_CHECK); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 161, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 161, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_12); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_12); + __Pyx_INCREF(__pyx_n_s_CHECK); + __Pyx_GIVEREF(__pyx_n_s_CHECK); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_CHECK); + __pyx_t_12 = 0; + + __pyx_t_12 = __Pyx_PyInt_From_int(EV_EMBED); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 162, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_13 = PyTuple_New(2); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 162, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + __Pyx_GIVEREF(__pyx_t_12); + PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_12); + __Pyx_INCREF(__pyx_n_s_EMBED); + __Pyx_GIVEREF(__pyx_n_s_EMBED); + PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_n_s_EMBED); + __pyx_t_12 = 0; + + __pyx_t_12 = __Pyx_PyInt_From_int(EV_FORK); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 163, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_14 = PyTuple_New(2); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 163, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_14); + __Pyx_GIVEREF(__pyx_t_12); + PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_12); + __Pyx_INCREF(__pyx_n_s_FORK); + __Pyx_GIVEREF(__pyx_n_s_FORK); + PyTuple_SET_ITEM(__pyx_t_14, 1, __pyx_n_s_FORK); + __pyx_t_12 = 0; + + __pyx_t_12 = __Pyx_PyInt_From_int(EV_CLEANUP); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 164, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_15 = PyTuple_New(2); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 164, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_15); + __Pyx_GIVEREF(__pyx_t_12); + PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_12); + __Pyx_INCREF(__pyx_n_s_CLEANUP); + __Pyx_GIVEREF(__pyx_n_s_CLEANUP); + PyTuple_SET_ITEM(__pyx_t_15, 1, __pyx_n_s_CLEANUP); + __pyx_t_12 = 0; + + __pyx_t_12 = __Pyx_PyInt_From_int(EV_ASYNC); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 165, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_16 = PyTuple_New(2); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 165, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_16); + __Pyx_GIVEREF(__pyx_t_12); + PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_12); + __Pyx_INCREF(__pyx_n_s_ASYNC); + __Pyx_GIVEREF(__pyx_n_s_ASYNC); + PyTuple_SET_ITEM(__pyx_t_16, 1, __pyx_n_s_ASYNC); + __pyx_t_12 = 0; + + __pyx_t_12 = __Pyx_PyInt_From_int(EV_CUSTOM); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 166, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_17 = PyTuple_New(2); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 166, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_17); + __Pyx_GIVEREF(__pyx_t_12); + PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_12); + __Pyx_INCREF(__pyx_n_s_CUSTOM); + __Pyx_GIVEREF(__pyx_n_s_CUSTOM); + PyTuple_SET_ITEM(__pyx_t_17, 1, __pyx_n_s_CUSTOM); + __pyx_t_12 = 0; + + __pyx_t_12 = __Pyx_PyInt_From_int(EV_ERROR); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 167, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_18 = PyTuple_New(2); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 167, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_18); + __Pyx_GIVEREF(__pyx_t_12); + PyTuple_SET_ITEM(__pyx_t_18, 0, __pyx_t_12); + __Pyx_INCREF(__pyx_n_s_ERROR); + __Pyx_GIVEREF(__pyx_n_s_ERROR); + PyTuple_SET_ITEM(__pyx_t_18, 1, __pyx_n_s_ERROR); + __pyx_t_12 = 0; + + __pyx_t_12 = PyList_New(16); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 152, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_GIVEREF(__pyx_t_2); + PyList_SET_ITEM(__pyx_t_12, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_11); + PyList_SET_ITEM(__pyx_t_12, 1, __pyx_t_11); + __Pyx_GIVEREF(__pyx_t_10); + PyList_SET_ITEM(__pyx_t_12, 2, __pyx_t_10); + __Pyx_GIVEREF(__pyx_t_9); + PyList_SET_ITEM(__pyx_t_12, 3, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_8); + PyList_SET_ITEM(__pyx_t_12, 4, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_7); + PyList_SET_ITEM(__pyx_t_12, 5, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_6); + PyList_SET_ITEM(__pyx_t_12, 6, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_5); + PyList_SET_ITEM(__pyx_t_12, 7, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_4); + PyList_SET_ITEM(__pyx_t_12, 8, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_1); + PyList_SET_ITEM(__pyx_t_12, 9, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_13); + PyList_SET_ITEM(__pyx_t_12, 10, __pyx_t_13); + __Pyx_GIVEREF(__pyx_t_14); + PyList_SET_ITEM(__pyx_t_12, 11, __pyx_t_14); + __Pyx_GIVEREF(__pyx_t_15); + PyList_SET_ITEM(__pyx_t_12, 12, __pyx_t_15); + __Pyx_GIVEREF(__pyx_t_16); + PyList_SET_ITEM(__pyx_t_12, 13, __pyx_t_16); + __Pyx_GIVEREF(__pyx_t_17); + PyList_SET_ITEM(__pyx_t_12, 14, __pyx_t_17); + __Pyx_GIVEREF(__pyx_t_18); + PyList_SET_ITEM(__pyx_t_12, 15, __pyx_t_18); + __pyx_t_2 = 0; + __pyx_t_11 = 0; + __pyx_t_10 = 0; + __pyx_t_9 = 0; + __pyx_t_8 = 0; + __pyx_t_7 = 0; + __pyx_t_6 = 0; + __pyx_t_5 = 0; + __pyx_t_4 = 0; + __pyx_t_1 = 0; + __pyx_t_13 = 0; + __pyx_t_14 = 0; + __pyx_t_15 = 0; + __pyx_t_16 = 0; + __pyx_t_17 = 0; + __pyx_t_18 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_events, __pyx_t_12) < 0) __PYX_ERR(0, 152, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + + __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_sys); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 183, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_version_info); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 183, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_18); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_12 = __Pyx_GetItemInt(__pyx_t_18, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 183, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + __pyx_t_18 = PyObject_RichCompare(__pyx_t_12, __pyx_int_3, Py_GE); __Pyx_XGOTREF(__pyx_t_18); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 183, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_18); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 183, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + if (__pyx_t_3) { + + __pyx_t_18 = PyTuple_New(2); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 184, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_18); + __Pyx_INCREF(((PyObject *)(&PyBytes_Type))); + __Pyx_GIVEREF(((PyObject *)(&PyBytes_Type))); + PyTuple_SET_ITEM(__pyx_t_18, 0, ((PyObject *)(&PyBytes_Type))); + __Pyx_INCREF(((PyObject *)(&PyString_Type))); + __Pyx_GIVEREF(((PyObject *)(&PyString_Type))); + PyTuple_SET_ITEM(__pyx_t_18, 1, ((PyObject *)(&PyString_Type))); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_basestring, __pyx_t_18) < 0) __PYX_ERR(0, 184, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + + goto __pyx_L3; + } + + /*else*/ { + __Pyx_GetModuleGlobalName(__pyx_t_18, __pyx_n_s_builtins); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 186, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_18); + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_18, __pyx_n_s_basestring); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 186, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_basestring, __pyx_t_12) < 0) __PYX_ERR(0, 186, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + } + __pyx_L3:; + + __pyx_t_12 = PyCFunction_NewEx(&__pyx_mdef_6gevent_5libev_8corecext_13supported_backends, NULL, __pyx_n_s_gevent_libev_corecext); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 241, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_supported_backends, __pyx_t_12) < 0) __PYX_ERR(0, 241, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + + __pyx_t_12 = PyCFunction_NewEx(&__pyx_mdef_6gevent_5libev_8corecext_15recommended_backends, NULL, __pyx_n_s_gevent_libev_corecext); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 245, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_recommended_backends, __pyx_t_12) < 0) __PYX_ERR(0, 245, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + + __pyx_t_12 = PyCFunction_NewEx(&__pyx_mdef_6gevent_5libev_8corecext_17embeddable_backends, NULL, __pyx_n_s_gevent_libev_corecext); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 249, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_embeddable_backends, __pyx_t_12) < 0) __PYX_ERR(0, 249, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + + __pyx_t_12 = PyCFunction_NewEx(&__pyx_mdef_6gevent_5libev_8corecext_19time, NULL, __pyx_n_s_gevent_libev_corecext); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 253, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_time, __pyx_t_12) < 0) __PYX_ERR(0, 253, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + + __Pyx_GetNameInClass(__pyx_t_12, (PyObject *)__pyx_ptype_6gevent_5libev_8corecext_callback, __pyx_n_s_stop); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 276, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_5libev_8corecext_callback->tp_dict, __pyx_n_s_close, __pyx_t_12) < 0) __PYX_ERR(0, 276, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + PyType_Modified(__pyx_ptype_6gevent_5libev_8corecext_callback); + + __pyx_k__9 = EVBREAK_ONE; + + __Pyx_GetNameInClass(__pyx_t_12, (PyObject *)__pyx_ptype_6gevent_5libev_8corecext_loop, __pyx_n_s_update_now); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 599, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_5libev_8corecext_loop->tp_dict, __pyx_n_s_update, __pyx_t_12) < 0) __PYX_ERR(0, 599, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + PyType_Modified(__pyx_ptype_6gevent_5libev_8corecext_loop); + + __Pyx_GetNameInClass(__pyx_t_12, (PyObject *)__pyx_ptype_6gevent_5libev_8corecext_loop, __pyx_n_s_async); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 664, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_5libev_8corecext_loop->tp_dict, __pyx_n_s_async_2, __pyx_t_12) < 0) __PYX_ERR(0, 664, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + PyType_Modified(__pyx_ptype_6gevent_5libev_8corecext_loop); + + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_19, &__pyx_t_20, &__pyx_t_21); + __Pyx_XGOTREF(__pyx_t_19); + __Pyx_XGOTREF(__pyx_t_20); + __Pyx_XGOTREF(__pyx_t_21); + /*try:*/ { + + __pyx_t_12 = PyList_New(1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 752, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_INCREF(__pyx_n_s_classImplements); + __Pyx_GIVEREF(__pyx_n_s_classImplements); + PyList_SET_ITEM(__pyx_t_12, 0, __pyx_n_s_classImplements); + __pyx_t_18 = __Pyx_Import(__pyx_n_s_zope_interface, __pyx_t_12, 0); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 752, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_18); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_12 = __Pyx_ImportFrom(__pyx_t_18, __pyx_n_s_classImplements); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 752, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_12); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_classImplements, __pyx_t_12) < 0) __PYX_ERR(0, 752, __pyx_L4_error) + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + + } + + /*else:*/ { + __pyx_t_18 = PyList_New(1); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 758, __pyx_L6_except_error) + __Pyx_GOTREF(__pyx_t_18); + __Pyx_INCREF(__pyx_n_s_ILoop); + __Pyx_GIVEREF(__pyx_n_s_ILoop); + PyList_SET_ITEM(__pyx_t_18, 0, __pyx_n_s_ILoop); + __pyx_t_12 = __Pyx_Import(__pyx_n_s_gevent__interfaces, __pyx_t_18, 0); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 758, __pyx_L6_except_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + __pyx_t_18 = __Pyx_ImportFrom(__pyx_t_12, __pyx_n_s_ILoop); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 758, __pyx_L6_except_error) + __Pyx_GOTREF(__pyx_t_18); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ILoop, __pyx_t_18) < 0) __PYX_ERR(0, 758, __pyx_L6_except_error) + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + + __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_classImplements); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 759, __pyx_L6_except_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_GetModuleGlobalName(__pyx_t_18, __pyx_n_s_ILoop); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 759, __pyx_L6_except_error) + __Pyx_GOTREF(__pyx_t_18); + __pyx_t_17 = PyTuple_New(2); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 759, __pyx_L6_except_error) + __Pyx_GOTREF(__pyx_t_17); + __Pyx_INCREF(((PyObject *)__pyx_ptype_6gevent_5libev_8corecext_loop)); + __Pyx_GIVEREF(((PyObject *)__pyx_ptype_6gevent_5libev_8corecext_loop)); + PyTuple_SET_ITEM(__pyx_t_17, 0, ((PyObject *)__pyx_ptype_6gevent_5libev_8corecext_loop)); + __Pyx_GIVEREF(__pyx_t_18); + PyTuple_SET_ITEM(__pyx_t_17, 1, __pyx_t_18); + __pyx_t_18 = 0; + __pyx_t_18 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_17, NULL); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 759, __pyx_L6_except_error) + __Pyx_GOTREF(__pyx_t_18); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + } + __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0; + __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0; + __Pyx_XDECREF(__pyx_t_21); __pyx_t_21 = 0; + goto __pyx_L9_try_end; + __pyx_L4_error:; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; + __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; + __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0; + __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0; + + __pyx_t_22 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ImportError); + if (__pyx_t_22) { + __Pyx_ErrRestore(0,0,0); + goto __pyx_L5_exception_handled; + } + goto __pyx_L6_except_error; + __pyx_L6_except_error:; + + __Pyx_XGIVEREF(__pyx_t_19); + __Pyx_XGIVEREF(__pyx_t_20); + __Pyx_XGIVEREF(__pyx_t_21); + __Pyx_ExceptionReset(__pyx_t_19, __pyx_t_20, __pyx_t_21); + goto __pyx_L1_error; + __pyx_L5_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_19); + __Pyx_XGIVEREF(__pyx_t_20); + __Pyx_XGIVEREF(__pyx_t_21); + __Pyx_ExceptionReset(__pyx_t_19, __pyx_t_20, __pyx_t_21); + __pyx_L9_try_end:; + } + + __pyx_v_6gevent_5libev_8corecext_io_ss = __pyx_f_6gevent_5libev_8corecext_make_ss(((void *)ev_io_start), ((void *)ev_io_stop)); + + __pyx_v_6gevent_5libev_8corecext_timer_ss = __pyx_f_6gevent_5libev_8corecext_make_ss(((void *)ev_timer_start), ((void *)ev_timer_stop)); + + __pyx_v_6gevent_5libev_8corecext_signal_ss = __pyx_f_6gevent_5libev_8corecext_make_ss(((void *)ev_signal_start), ((void *)ev_signal_stop)); + + __pyx_v_6gevent_5libev_8corecext_idle_ss = __pyx_f_6gevent_5libev_8corecext_make_ss(((void *)ev_idle_start), ((void *)ev_idle_stop)); + + __pyx_v_6gevent_5libev_8corecext_prepare_ss = __pyx_f_6gevent_5libev_8corecext_make_ss(((void *)ev_prepare_start), ((void *)ev_prepare_stop)); + + __pyx_v_6gevent_5libev_8corecext_check_ss = __pyx_f_6gevent_5libev_8corecext_make_ss(((void *)ev_check_start), ((void *)ev_check_stop)); + + __pyx_v_6gevent_5libev_8corecext_fork_ss = __pyx_f_6gevent_5libev_8corecext_make_ss(((void *)ev_fork_start), ((void *)ev_fork_stop)); + + __pyx_v_6gevent_5libev_8corecext_async_ss = __pyx_f_6gevent_5libev_8corecext_make_ss(((void *)ev_async_start), ((void *)ev_async_stop)); + + if (PyDict_SetItem(__pyx_d, __pyx_n_s_async_2, ((PyObject *)__pyx_ptype_6gevent_5libev_8corecext_async_)) < 0) __PYX_ERR(0, 1178, __pyx_L1_error) + + __pyx_v_6gevent_5libev_8corecext_child_ss = __pyx_f_6gevent_5libev_8corecext_make_ss(((void *)ev_child_start), ((void *)ev_child_stop)); + + __pyx_v_6gevent_5libev_8corecext_stat_ss = __pyx_f_6gevent_5libev_8corecext_make_ss(((void *)ev_stat_start), ((void *)ev_stat_stop)); + + if (PyDict_SetItem(__pyx_d, __pyx_n_s_SYSERR_CALLBACK, Py_None) < 0) __PYX_ERR(0, 1269, __pyx_L1_error) + + __pyx_t_18 = __Pyx_PyInt_From_int(LIBEV_EMBED); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1295, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_18); + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_18); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1295, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + __pyx_t_18 = __Pyx_PyBool_FromLong((!(!__pyx_t_3))); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1295, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_18); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBEV_EMBED, __pyx_t_18) < 0) __PYX_ERR(0, 1295, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + + __pyx_t_18 = __Pyx_PyInt_From_int(EV_USE_FLOOR); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1296, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_18); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_EV_USE_FLOOR, __pyx_t_18) < 0) __PYX_ERR(0, 1296, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + + __pyx_t_18 = __Pyx_PyInt_From_int(EV_USE_CLOCK_SYSCALL); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1297, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_18); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_EV_USE_CLOCK_SYSCALL, __pyx_t_18) < 0) __PYX_ERR(0, 1297, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + + __pyx_t_18 = __Pyx_PyInt_From_int(EV_USE_REALTIME); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1298, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_18); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_EV_USE_REALTIME, __pyx_t_18) < 0) __PYX_ERR(0, 1298, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + + __pyx_t_18 = __Pyx_PyInt_From_int(EV_USE_MONOTONIC); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1299, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_18); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_EV_USE_MONOTONIC, __pyx_t_18) < 0) __PYX_ERR(0, 1299, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + + __pyx_t_18 = __Pyx_PyInt_From_int(EV_USE_NANOSLEEP); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1300, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_18); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_EV_USE_NANOSLEEP, __pyx_t_18) < 0) __PYX_ERR(0, 1300, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + + __pyx_t_18 = __Pyx_PyInt_From_int(EV_USE_INOTIFY); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1301, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_18); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_EV_USE_INOTIFY, __pyx_t_18) < 0) __PYX_ERR(0, 1301, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + + __pyx_t_18 = __Pyx_PyInt_From_int(EV_USE_SIGNALFD); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1302, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_18); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_EV_USE_SIGNALFD, __pyx_t_18) < 0) __PYX_ERR(0, 1302, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + + __pyx_t_18 = __Pyx_PyInt_From_int(EV_USE_EVENTFD); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1303, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_18); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_EV_USE_EVENTFD, __pyx_t_18) < 0) __PYX_ERR(0, 1303, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + + __pyx_t_18 = __Pyx_PyInt_From_int(EV_USE_4HEAP); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1304, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_18); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_EV_USE_4HEAP, __pyx_t_18) < 0) __PYX_ERR(0, 1304, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + + __Pyx_INCREF(__pyx_empty_tuple); + __Pyx_XGOTREF(_empty_tuple); + __Pyx_DECREF_SET(_empty_tuple, __pyx_empty_tuple); + __Pyx_GIVEREF(__pyx_empty_tuple); + + __pyx_t_18 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_18); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_18) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + + /*--- Wrapped vars code ---*/ + + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_XDECREF(__pyx_t_13); + __Pyx_XDECREF(__pyx_t_14); + __Pyx_XDECREF(__pyx_t_15); + __Pyx_XDECREF(__pyx_t_16); + __Pyx_XDECREF(__pyx_t_17); + __Pyx_XDECREF(__pyx_t_18); + if (__pyx_m) { + if (__pyx_d) { + __Pyx_AddTraceback("init gevent.libev.corecext", __pyx_clineno, __pyx_lineno, __pyx_filename); + } + Py_CLEAR(__pyx_m); + } else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_ImportError, "init gevent.libev.corecext"); + } + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + #if CYTHON_PEP489_MULTI_PHASE_INIT + return (__pyx_m != NULL) ? 0 : -1; + #elif PY_MAJOR_VERSION >= 3 + return __pyx_m; + #else + return; + #endif +} + +/* --- Runtime support code --- */ +/* Refnanny */ +#if CYTHON_REFNANNY +static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { + PyObject *m = NULL, *p = NULL; + void *r = NULL; + m = PyImport_ImportModule(modname); + if (!m) goto end; + p = PyObject_GetAttrString(m, "RefNannyAPI"); + if (!p) goto end; + r = PyLong_AsVoidPtr(p); +end: + Py_XDECREF(p); + Py_XDECREF(m); + return (__Pyx_RefNannyAPIStruct *)r; +} +#endif + +/* PyObjectGetAttrStr */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_getattro)) + return tp->tp_getattro(obj, attr_name); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_getattr)) + return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); +#endif + return PyObject_GetAttr(obj, attr_name); +} +#endif + +/* GetBuiltinName */ +static PyObject *__Pyx_GetBuiltinName(PyObject *name) { + PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name); + if (unlikely(!result)) { + PyErr_Format(PyExc_NameError, +#if PY_MAJOR_VERSION >= 3 + "name '%U' is not defined", name); +#else + "name '%.200s' is not defined", PyString_AS_STRING(name)); +#endif + } + return result; +} + +/* GetModuleGlobalName */ +#if CYTHON_USE_DICT_VERSIONS +static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value) +#else +static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) +#endif +{ + PyObject *result; +#if !CYTHON_AVOID_BORROWED_REFS +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 + result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } else if (unlikely(PyErr_Occurred())) { + return NULL; + } +#else + result = PyDict_GetItem(__pyx_d, name); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } +#endif +#else + result = PyObject_GetItem(__pyx_d, name); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } + PyErr_Clear(); +#endif + return __Pyx_GetBuiltinName(name); +} + +/* RaiseTooManyValuesToUnpack */ +static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { + PyErr_Format(PyExc_ValueError, + "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected); +} + +/* RaiseNeedMoreValuesToUnpack */ +static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { + PyErr_Format(PyExc_ValueError, + "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack", + index, (index == 1) ? "" : "s"); +} + +/* IterFinish */ +static CYTHON_INLINE int __Pyx_IterFinish(void) { +#if CYTHON_FAST_THREAD_STATE + PyThreadState *tstate = __Pyx_PyThreadState_Current; + PyObject* exc_type = tstate->curexc_type; + if (unlikely(exc_type)) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) { + PyObject *exc_value, *exc_tb; + exc_value = tstate->curexc_value; + exc_tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; + Py_DECREF(exc_type); + Py_XDECREF(exc_value); + Py_XDECREF(exc_tb); + return 0; + } else { + return -1; + } + } + return 0; +#else + if (unlikely(PyErr_Occurred())) { + if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) { + PyErr_Clear(); + return 0; + } else { + return -1; + } + } + return 0; +#endif +} + +/* UnpackItemEndCheck */ +static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { + if (unlikely(retval)) { + Py_DECREF(retval); + __Pyx_RaiseTooManyValuesError(expected); + return -1; + } else { + return __Pyx_IterFinish(); + } + return 0; +} + +/* PyCFunctionFastCall */ +#if CYTHON_FAST_PYCCALL +static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) { + PyCFunctionObject *func = (PyCFunctionObject*)func_obj; + PyCFunction meth = PyCFunction_GET_FUNCTION(func); + PyObject *self = PyCFunction_GET_SELF(func); + int flags = PyCFunction_GET_FLAGS(func); + assert(PyCFunction_Check(func)); + assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS))); + assert(nargs >= 0); + assert(nargs == 0 || args != NULL); + /* _PyCFunction_FastCallDict() must not be called with an exception set, + because it may clear it (directly or indirectly) and so the + caller loses its exception */ + assert(!PyErr_Occurred()); + if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) { + return (*((__Pyx_PyCFunctionFastWithKeywords)(void*)meth)) (self, args, nargs, NULL); + } else { + return (*((__Pyx_PyCFunctionFast)(void*)meth)) (self, args, nargs); + } +} +#endif + +/* PyFunctionFastCall */ +#if CYTHON_FAST_PYCALL +static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, + PyObject *globals) { + PyFrameObject *f; + PyThreadState *tstate = __Pyx_PyThreadState_Current; + PyObject **fastlocals; + Py_ssize_t i; + PyObject *result; + assert(globals != NULL); + /* XXX Perhaps we should create a specialized + PyFrame_New() that doesn't take locals, but does + take builtins without sanity checking them. + */ + assert(tstate != NULL); + f = PyFrame_New(tstate, co, globals, NULL); + if (f == NULL) { + return NULL; + } + fastlocals = __Pyx_PyFrame_GetLocalsplus(f); + for (i = 0; i < na; i++) { + Py_INCREF(*args); + fastlocals[i] = *args++; + } + result = PyEval_EvalFrameEx(f,0); + ++tstate->recursion_depth; + Py_DECREF(f); + --tstate->recursion_depth; + return result; +} +#if 1 || PY_VERSION_HEX < 0x030600B1 +static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs) { + PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); + PyObject *globals = PyFunction_GET_GLOBALS(func); + PyObject *argdefs = PyFunction_GET_DEFAULTS(func); + PyObject *closure; +#if PY_MAJOR_VERSION >= 3 + PyObject *kwdefs; +#endif + PyObject *kwtuple, **k; + PyObject **d; + Py_ssize_t nd; + Py_ssize_t nk; + PyObject *result; + assert(kwargs == NULL || PyDict_Check(kwargs)); + nk = kwargs ? PyDict_Size(kwargs) : 0; + if (Py_EnterRecursiveCall((char*)" while calling a Python object")) { + return NULL; + } + if ( +#if PY_MAJOR_VERSION >= 3 + co->co_kwonlyargcount == 0 && +#endif + likely(kwargs == NULL || nk == 0) && + co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { + if (argdefs == NULL && co->co_argcount == nargs) { + result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); + goto done; + } + else if (nargs == 0 && argdefs != NULL + && co->co_argcount == Py_SIZE(argdefs)) { + /* function called with no arguments, but all parameters have + a default value: use default values as arguments .*/ + args = &PyTuple_GET_ITEM(argdefs, 0); + result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); + goto done; + } + } + if (kwargs != NULL) { + Py_ssize_t pos, i; + kwtuple = PyTuple_New(2 * nk); + if (kwtuple == NULL) { + result = NULL; + goto done; + } + k = &PyTuple_GET_ITEM(kwtuple, 0); + pos = i = 0; + while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { + Py_INCREF(k[i]); + Py_INCREF(k[i+1]); + i += 2; + } + nk = i / 2; + } + else { + kwtuple = NULL; + k = NULL; + } + closure = PyFunction_GET_CLOSURE(func); +#if PY_MAJOR_VERSION >= 3 + kwdefs = PyFunction_GET_KW_DEFAULTS(func); +#endif + if (argdefs != NULL) { + d = &PyTuple_GET_ITEM(argdefs, 0); + nd = Py_SIZE(argdefs); + } + else { + d = NULL; + nd = 0; + } +#if PY_MAJOR_VERSION >= 3 + result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, + args, nargs, + k, (int)nk, + d, (int)nd, kwdefs, closure); +#else + result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, + args, nargs, + k, (int)nk, + d, (int)nd, closure); +#endif + Py_XDECREF(kwtuple); +done: + Py_LeaveRecursiveCall(); + return result; +} +#endif +#endif + +/* PyObjectCall */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { + PyObject *result; + ternaryfunc call = func->ob_type->tp_call; + if (unlikely(!call)) + return PyObject_Call(func, arg, kw); + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; + result = (*call)(func, arg, kw); + Py_LeaveRecursiveCall(); + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +/* PyObjectCall2Args */ +static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) { + PyObject *args, *result = NULL; + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(function)) { + PyObject *args[2] = {arg1, arg2}; + return __Pyx_PyFunction_FastCall(function, args, 2); + } + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(function)) { + PyObject *args[2] = {arg1, arg2}; + return __Pyx_PyCFunction_FastCall(function, args, 2); + } + #endif + args = PyTuple_New(2); + if (unlikely(!args)) goto done; + Py_INCREF(arg1); + PyTuple_SET_ITEM(args, 0, arg1); + Py_INCREF(arg2); + PyTuple_SET_ITEM(args, 1, arg2); + Py_INCREF(function); + result = __Pyx_PyObject_Call(function, args, NULL); + Py_DECREF(args); + Py_DECREF(function); +done: + return result; +} + +/* PyObjectCallMethO */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { + PyObject *self, *result; + PyCFunction cfunc; + cfunc = PyCFunction_GET_FUNCTION(func); + self = PyCFunction_GET_SELF(func); + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; + result = cfunc(self, arg); + Py_LeaveRecursiveCall(); + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +/* PyObjectCallOneArg */ +#if CYTHON_COMPILING_IN_CPYTHON +static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) { + PyObject *result; + PyObject *args = PyTuple_New(1); + if (unlikely(!args)) return NULL; + Py_INCREF(arg); + PyTuple_SET_ITEM(args, 0, arg); + result = __Pyx_PyObject_Call(func, args, NULL); + Py_DECREF(args); + return result; +} +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { +#if CYTHON_FAST_PYCALL + if (PyFunction_Check(func)) { + return __Pyx_PyFunction_FastCall(func, &arg, 1); + } +#endif + if (likely(PyCFunction_Check(func))) { + if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) { + return __Pyx_PyObject_CallMethO(func, arg); +#if CYTHON_FAST_PYCCALL + } else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) { + return __Pyx_PyCFunction_FastCall(func, &arg, 1); +#endif + } + } + return __Pyx__PyObject_CallOneArg(func, arg); +} +#else +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { + PyObject *result; + PyObject *args = PyTuple_Pack(1, arg); + if (unlikely(!args)) return NULL; + result = __Pyx_PyObject_Call(func, args, NULL); + Py_DECREF(args); + return result; +} +#endif + +/* PyObjectCallNoArg */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { +#if CYTHON_FAST_PYCALL + if (PyFunction_Check(func)) { + return __Pyx_PyFunction_FastCall(func, NULL, 0); + } +#endif +#ifdef __Pyx_CyFunction_USED + if (likely(PyCFunction_Check(func) || __Pyx_CyFunction_Check(func))) +#else + if (likely(PyCFunction_Check(func))) +#endif + { + if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) { + return __Pyx_PyObject_CallMethO(func, NULL); + } + } + return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL); +} +#endif + +/* GetItemInt */ +static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { + PyObject *r; + if (!j) return NULL; + r = PyObject_GetItem(o, j); + Py_DECREF(j); + return r; +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, + CYTHON_NCP_UNUSED int wraparound, + CYTHON_NCP_UNUSED int boundscheck) { +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + Py_ssize_t wrapped_i = i; + if (wraparound & unlikely(i < 0)) { + wrapped_i += PyList_GET_SIZE(o); + } + if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) { + PyObject *r = PyList_GET_ITEM(o, wrapped_i); + Py_INCREF(r); + return r; + } + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +#else + return PySequence_GetItem(o, i); +#endif +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, + CYTHON_NCP_UNUSED int wraparound, + CYTHON_NCP_UNUSED int boundscheck) { +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + Py_ssize_t wrapped_i = i; + if (wraparound & unlikely(i < 0)) { + wrapped_i += PyTuple_GET_SIZE(o); + } + if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) { + PyObject *r = PyTuple_GET_ITEM(o, wrapped_i); + Py_INCREF(r); + return r; + } + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +#else + return PySequence_GetItem(o, i); +#endif +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, + CYTHON_NCP_UNUSED int wraparound, + CYTHON_NCP_UNUSED int boundscheck) { +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS + if (is_list || PyList_CheckExact(o)) { + Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); + if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) { + PyObject *r = PyList_GET_ITEM(o, n); + Py_INCREF(r); + return r; + } + } + else if (PyTuple_CheckExact(o)) { + Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o); + if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) { + PyObject *r = PyTuple_GET_ITEM(o, n); + Py_INCREF(r); + return r; + } + } else { + PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence; + if (likely(m && m->sq_item)) { + if (wraparound && unlikely(i < 0) && likely(m->sq_length)) { + Py_ssize_t l = m->sq_length(o); + if (likely(l >= 0)) { + i += l; + } else { + if (!PyErr_ExceptionMatches(PyExc_OverflowError)) + return NULL; + PyErr_Clear(); + } + } + return m->sq_item(o, i); + } + } +#else + if (is_list || PySequence_Check(o)) { + return PySequence_GetItem(o, i); + } +#endif + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +} + +/* ObjectGetItem */ +#if CYTHON_USE_TYPE_SLOTS +static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject* index) { + PyObject *runerr; + Py_ssize_t key_value; + PySequenceMethods *m = Py_TYPE(obj)->tp_as_sequence; + if (unlikely(!(m && m->sq_item))) { + PyErr_Format(PyExc_TypeError, "'%.200s' object is not subscriptable", Py_TYPE(obj)->tp_name); + return NULL; + } + key_value = __Pyx_PyIndex_AsSsize_t(index); + if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) { + return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1); + } + if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) { + PyErr_Clear(); + PyErr_Format(PyExc_IndexError, "cannot fit '%.200s' into an index-sized integer", Py_TYPE(index)->tp_name); + } + return NULL; +} +static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key) { + PyMappingMethods *m = Py_TYPE(obj)->tp_as_mapping; + if (likely(m && m->mp_subscript)) { + return m->mp_subscript(obj, key); + } + return __Pyx_PyObject_GetIndex(obj, key); +} +#endif + +/* GetTopmostException */ +#if CYTHON_USE_EXC_INFO_STACK +static _PyErr_StackItem * +__Pyx_PyErr_GetTopmostException(PyThreadState *tstate) +{ + _PyErr_StackItem *exc_info = tstate->exc_info; + while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) && + exc_info->previous_item != NULL) + { + exc_info = exc_info->previous_item; + } + return exc_info; +} +#endif + +/* SaveResetException */ +#if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { + #if CYTHON_USE_EXC_INFO_STACK + _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate); + *type = exc_info->exc_type; + *value = exc_info->exc_value; + *tb = exc_info->exc_traceback; + #else + *type = tstate->exc_type; + *value = tstate->exc_value; + *tb = tstate->exc_traceback; + #endif + Py_XINCREF(*type); + Py_XINCREF(*value); + Py_XINCREF(*tb); +} +static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + #if CYTHON_USE_EXC_INFO_STACK + _PyErr_StackItem *exc_info = tstate->exc_info; + tmp_type = exc_info->exc_type; + tmp_value = exc_info->exc_value; + tmp_tb = exc_info->exc_traceback; + exc_info->exc_type = type; + exc_info->exc_value = value; + exc_info->exc_traceback = tb; + #else + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = type; + tstate->exc_value = value; + tstate->exc_traceback = tb; + #endif + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +} +#endif + +/* PyErrExceptionMatches */ +#if CYTHON_FAST_THREAD_STATE +static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { + Py_ssize_t i, n; + n = PyTuple_GET_SIZE(tuple); +#if PY_MAJOR_VERSION >= 3 + for (i=0; icurexc_type; + if (exc_type == err) return 1; + if (unlikely(!exc_type)) return 0; + if (unlikely(PyTuple_Check(err))) + return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err); + return __Pyx_PyErr_GivenExceptionMatches(exc_type, err); +} +#endif + +/* GetException */ +#if CYTHON_FAST_THREAD_STATE +static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) +#else +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) +#endif +{ + PyObject *local_type, *local_value, *local_tb; +#if CYTHON_FAST_THREAD_STATE + PyObject *tmp_type, *tmp_value, *tmp_tb; + local_type = tstate->curexc_type; + local_value = tstate->curexc_value; + local_tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +#else + PyErr_Fetch(&local_type, &local_value, &local_tb); +#endif + PyErr_NormalizeException(&local_type, &local_value, &local_tb); +#if CYTHON_FAST_THREAD_STATE + if (unlikely(tstate->curexc_type)) +#else + if (unlikely(PyErr_Occurred())) +#endif + goto bad; + #if PY_MAJOR_VERSION >= 3 + if (local_tb) { + if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) + goto bad; + } + #endif + Py_XINCREF(local_tb); + Py_XINCREF(local_type); + Py_XINCREF(local_value); + *type = local_type; + *value = local_value; + *tb = local_tb; +#if CYTHON_FAST_THREAD_STATE + #if CYTHON_USE_EXC_INFO_STACK + { + _PyErr_StackItem *exc_info = tstate->exc_info; + tmp_type = exc_info->exc_type; + tmp_value = exc_info->exc_value; + tmp_tb = exc_info->exc_traceback; + exc_info->exc_type = local_type; + exc_info->exc_value = local_value; + exc_info->exc_traceback = local_tb; + } + #else + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = local_type; + tstate->exc_value = local_value; + tstate->exc_traceback = local_tb; + #endif + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#else + PyErr_SetExcInfo(local_type, local_value, local_tb); +#endif + return 0; +bad: + *type = 0; + *value = 0; + *tb = 0; + Py_XDECREF(local_type); + Py_XDECREF(local_value); + Py_XDECREF(local_tb); + return -1; +} + +/* StringJoin */ +#if !CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values) { + return PyObject_CallMethodObjArgs(sep, __pyx_n_s_join, values, NULL); +} +#endif + +/* PyErrFetchRestore */ +#if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + tmp_type = tstate->curexc_type; + tmp_value = tstate->curexc_value; + tmp_tb = tstate->curexc_traceback; + tstate->curexc_type = type; + tstate->curexc_value = value; + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +} +static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { + *type = tstate->curexc_type; + *value = tstate->curexc_value; + *tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +} +#endif + +/* RaiseException */ +#if PY_MAJOR_VERSION < 3 +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, + CYTHON_UNUSED PyObject *cause) { + __Pyx_PyThreadState_declare + Py_XINCREF(type); + if (!value || value == Py_None) + value = NULL; + else + Py_INCREF(value); + if (!tb || tb == Py_None) + tb = NULL; + else { + Py_INCREF(tb); + if (!PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto raise_error; + } + } + if (PyType_Check(type)) { +#if CYTHON_COMPILING_IN_PYPY + if (!value) { + Py_INCREF(Py_None); + value = Py_None; + } +#endif + PyErr_NormalizeException(&type, &value, &tb); + } else { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto raise_error; + } + value = type; + type = (PyObject*) Py_TYPE(type); + Py_INCREF(type); + if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto raise_error; + } + } + __Pyx_PyThreadState_assign + __Pyx_ErrRestore(type, value, tb); + return; +raise_error: + Py_XDECREF(value); + Py_XDECREF(type); + Py_XDECREF(tb); + return; +} +#else +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { + PyObject* owned_instance = NULL; + if (tb == Py_None) { + tb = 0; + } else if (tb && !PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto bad; + } + if (value == Py_None) + value = 0; + if (PyExceptionInstance_Check(type)) { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto bad; + } + value = type; + type = (PyObject*) Py_TYPE(value); + } else if (PyExceptionClass_Check(type)) { + PyObject *instance_class = NULL; + if (value && PyExceptionInstance_Check(value)) { + instance_class = (PyObject*) Py_TYPE(value); + if (instance_class != type) { + int is_subclass = PyObject_IsSubclass(instance_class, type); + if (!is_subclass) { + instance_class = NULL; + } else if (unlikely(is_subclass == -1)) { + goto bad; + } else { + type = instance_class; + } + } + } + if (!instance_class) { + PyObject *args; + if (!value) + args = PyTuple_New(0); + else if (PyTuple_Check(value)) { + Py_INCREF(value); + args = value; + } else + args = PyTuple_Pack(1, value); + if (!args) + goto bad; + owned_instance = PyObject_Call(type, args, NULL); + Py_DECREF(args); + if (!owned_instance) + goto bad; + value = owned_instance; + if (!PyExceptionInstance_Check(value)) { + PyErr_Format(PyExc_TypeError, + "calling %R should have returned an instance of " + "BaseException, not %R", + type, Py_TYPE(value)); + goto bad; + } + } + } else { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto bad; + } + if (cause) { + PyObject *fixed_cause; + if (cause == Py_None) { + fixed_cause = NULL; + } else if (PyExceptionClass_Check(cause)) { + fixed_cause = PyObject_CallObject(cause, NULL); + if (fixed_cause == NULL) + goto bad; + } else if (PyExceptionInstance_Check(cause)) { + fixed_cause = cause; + Py_INCREF(fixed_cause); + } else { + PyErr_SetString(PyExc_TypeError, + "exception causes must derive from " + "BaseException"); + goto bad; + } + PyException_SetCause(value, fixed_cause); + } + PyErr_SetObject(type, value); + if (tb) { +#if CYTHON_COMPILING_IN_PYPY + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); + Py_INCREF(tb); + PyErr_Restore(tmp_type, tmp_value, tb); + Py_XDECREF(tmp_tb); +#else + PyThreadState *tstate = __Pyx_PyThreadState_Current; + PyObject* tmp_tb = tstate->curexc_traceback; + if (tb != tmp_tb) { + Py_INCREF(tb); + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_tb); + } +#endif + } +bad: + Py_XDECREF(owned_instance); + return; +} +#endif + +/* SwapException */ +#if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + #if CYTHON_USE_EXC_INFO_STACK + _PyErr_StackItem *exc_info = tstate->exc_info; + tmp_type = exc_info->exc_type; + tmp_value = exc_info->exc_value; + tmp_tb = exc_info->exc_traceback; + exc_info->exc_type = *type; + exc_info->exc_value = *value; + exc_info->exc_traceback = *tb; + #else + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = *type; + tstate->exc_value = *value; + tstate->exc_traceback = *tb; + #endif + *type = tmp_type; + *value = tmp_value; + *tb = tmp_tb; +} +#else +static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb); + PyErr_SetExcInfo(*type, *value, *tb); + *type = tmp_type; + *value = tmp_value; + *tb = tmp_tb; +} +#endif + +/* RaiseArgTupleInvalid */ +static void __Pyx_RaiseArgtupleInvalid( + const char* func_name, + int exact, + Py_ssize_t num_min, + Py_ssize_t num_max, + Py_ssize_t num_found) +{ + Py_ssize_t num_expected; + const char *more_or_less; + if (num_found < num_min) { + num_expected = num_min; + more_or_less = "at least"; + } else { + num_expected = num_max; + more_or_less = "at most"; + } + if (exact) { + more_or_less = "exactly"; + } + PyErr_Format(PyExc_TypeError, + "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", + func_name, more_or_less, num_expected, + (num_expected == 1) ? "" : "s", num_found); +} + +/* RaiseDoubleKeywords */ +static void __Pyx_RaiseDoubleKeywordsError( + const char* func_name, + PyObject* kw_name) +{ + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION >= 3 + "%s() got multiple values for keyword argument '%U'", func_name, kw_name); + #else + "%s() got multiple values for keyword argument '%s'", func_name, + PyString_AsString(kw_name)); + #endif +} + +/* ParseKeywords */ +static int __Pyx_ParseOptionalKeywords( + PyObject *kwds, + PyObject **argnames[], + PyObject *kwds2, + PyObject *values[], + Py_ssize_t num_pos_args, + const char* function_name) +{ + PyObject *key = 0, *value = 0; + Py_ssize_t pos = 0; + PyObject*** name; + PyObject*** first_kw_arg = argnames + num_pos_args; + while (PyDict_Next(kwds, &pos, &key, &value)) { + name = first_kw_arg; + while (*name && (**name != key)) name++; + if (*name) { + values[name-argnames] = value; + continue; + } + name = first_kw_arg; + #if PY_MAJOR_VERSION < 3 + if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) { + while (*name) { + if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) + && _PyString_Eq(**name, key)) { + values[name-argnames] = value; + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + if ((**argname == key) || ( + (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) + && _PyString_Eq(**argname, key))) { + goto arg_passed_twice; + } + argname++; + } + } + } else + #endif + if (likely(PyUnicode_Check(key))) { + while (*name) { + int cmp = (**name == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 : + #endif + PyUnicode_Compare(**name, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) { + values[name-argnames] = value; + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + int cmp = (**argname == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 : + #endif + PyUnicode_Compare(**argname, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) goto arg_passed_twice; + argname++; + } + } + } else + goto invalid_keyword_type; + if (kwds2) { + if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; + } else { + goto invalid_keyword; + } + } + return 0; +arg_passed_twice: + __Pyx_RaiseDoubleKeywordsError(function_name, key); + goto bad; +invalid_keyword_type: + PyErr_Format(PyExc_TypeError, + "%.200s() keywords must be strings", function_name); + goto bad; +invalid_keyword: + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION < 3 + "%.200s() got an unexpected keyword argument '%.200s'", + function_name, PyString_AsString(key)); + #else + "%s() got an unexpected keyword argument '%U'", + function_name, key); + #endif +bad: + return -1; +} + +/* KeywordStringCheck */ +static int __Pyx_CheckKeywordStrings( + PyObject *kwdict, + const char* function_name, + int kw_allowed) +{ + PyObject* key = 0; + Py_ssize_t pos = 0; +#if CYTHON_COMPILING_IN_PYPY + if (!kw_allowed && PyDict_Next(kwdict, &pos, &key, 0)) + goto invalid_keyword; + return 1; +#else + while (PyDict_Next(kwdict, &pos, &key, 0)) { + #if PY_MAJOR_VERSION < 3 + if (unlikely(!PyString_Check(key))) + #endif + if (unlikely(!PyUnicode_Check(key))) + goto invalid_keyword_type; + } + if ((!kw_allowed) && unlikely(key)) + goto invalid_keyword; + return 1; +invalid_keyword_type: + PyErr_Format(PyExc_TypeError, + "%.200s() keywords must be strings", function_name); + return 0; +#endif +invalid_keyword: + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION < 3 + "%.200s() got an unexpected keyword argument '%.200s'", + function_name, PyString_AsString(key)); + #else + "%s() got an unexpected keyword argument '%U'", + function_name, key); + #endif + return 0; +} + +/* WriteUnraisableException */ +static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno, + CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename, + int full_traceback, CYTHON_UNUSED int nogil) { + PyObject *old_exc, *old_val, *old_tb; + PyObject *ctx; + __Pyx_PyThreadState_declare +#ifdef WITH_THREAD + PyGILState_STATE state; + if (nogil) + state = PyGILState_Ensure(); +#ifdef _MSC_VER + else state = (PyGILState_STATE)-1; +#endif +#endif + __Pyx_PyThreadState_assign + __Pyx_ErrFetch(&old_exc, &old_val, &old_tb); + if (full_traceback) { + Py_XINCREF(old_exc); + Py_XINCREF(old_val); + Py_XINCREF(old_tb); + __Pyx_ErrRestore(old_exc, old_val, old_tb); + PyErr_PrintEx(1); + } + #if PY_MAJOR_VERSION < 3 + ctx = PyString_FromString(name); + #else + ctx = PyUnicode_FromString(name); + #endif + __Pyx_ErrRestore(old_exc, old_val, old_tb); + if (!ctx) { + PyErr_WriteUnraisable(Py_None); + } else { + PyErr_WriteUnraisable(ctx); + Py_DECREF(ctx); + } +#ifdef WITH_THREAD + if (nogil) + PyGILState_Release(state); +#endif +} + +/* BytesEquals */ +static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { +#if CYTHON_COMPILING_IN_PYPY + return PyObject_RichCompareBool(s1, s2, equals); +#else + if (s1 == s2) { + return (equals == Py_EQ); + } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) { + const char *ps1, *ps2; + Py_ssize_t length = PyBytes_GET_SIZE(s1); + if (length != PyBytes_GET_SIZE(s2)) + return (equals == Py_NE); + ps1 = PyBytes_AS_STRING(s1); + ps2 = PyBytes_AS_STRING(s2); + if (ps1[0] != ps2[0]) { + return (equals == Py_NE); + } else if (length == 1) { + return (equals == Py_EQ); + } else { + int result; +#if CYTHON_USE_UNICODE_INTERNALS + Py_hash_t hash1, hash2; + hash1 = ((PyBytesObject*)s1)->ob_shash; + hash2 = ((PyBytesObject*)s2)->ob_shash; + if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { + return (equals == Py_NE); + } +#endif + result = memcmp(ps1, ps2, (size_t)length); + return (equals == Py_EQ) ? (result == 0) : (result != 0); + } + } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) { + return (equals == Py_NE); + } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) { + return (equals == Py_NE); + } else { + int result; + PyObject* py_result = PyObject_RichCompare(s1, s2, equals); + if (!py_result) + return -1; + result = __Pyx_PyObject_IsTrue(py_result); + Py_DECREF(py_result); + return result; + } +#endif +} + +/* UnicodeEquals */ +static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { +#if CYTHON_COMPILING_IN_PYPY + return PyObject_RichCompareBool(s1, s2, equals); +#else +#if PY_MAJOR_VERSION < 3 + PyObject* owned_ref = NULL; +#endif + int s1_is_unicode, s2_is_unicode; + if (s1 == s2) { + goto return_eq; + } + s1_is_unicode = PyUnicode_CheckExact(s1); + s2_is_unicode = PyUnicode_CheckExact(s2); +#if PY_MAJOR_VERSION < 3 + if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) { + owned_ref = PyUnicode_FromObject(s2); + if (unlikely(!owned_ref)) + return -1; + s2 = owned_ref; + s2_is_unicode = 1; + } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) { + owned_ref = PyUnicode_FromObject(s1); + if (unlikely(!owned_ref)) + return -1; + s1 = owned_ref; + s1_is_unicode = 1; + } else if (((!s2_is_unicode) & (!s1_is_unicode))) { + return __Pyx_PyBytes_Equals(s1, s2, equals); + } +#endif + if (s1_is_unicode & s2_is_unicode) { + Py_ssize_t length; + int kind; + void *data1, *data2; + if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0)) + return -1; + length = __Pyx_PyUnicode_GET_LENGTH(s1); + if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) { + goto return_ne; + } +#if CYTHON_USE_UNICODE_INTERNALS + { + Py_hash_t hash1, hash2; + #if CYTHON_PEP393_ENABLED + hash1 = ((PyASCIIObject*)s1)->hash; + hash2 = ((PyASCIIObject*)s2)->hash; + #else + hash1 = ((PyUnicodeObject*)s1)->hash; + hash2 = ((PyUnicodeObject*)s2)->hash; + #endif + if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { + goto return_ne; + } + } +#endif + kind = __Pyx_PyUnicode_KIND(s1); + if (kind != __Pyx_PyUnicode_KIND(s2)) { + goto return_ne; + } + data1 = __Pyx_PyUnicode_DATA(s1); + data2 = __Pyx_PyUnicode_DATA(s2); + if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) { + goto return_ne; + } else if (length == 1) { + goto return_eq; + } else { + int result = memcmp(data1, data2, (size_t)(length * kind)); + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_EQ) ? (result == 0) : (result != 0); + } + } else if ((s1 == Py_None) & s2_is_unicode) { + goto return_ne; + } else if ((s2 == Py_None) & s1_is_unicode) { + goto return_ne; + } else { + int result; + PyObject* py_result = PyObject_RichCompare(s1, s2, equals); + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + if (!py_result) + return -1; + result = __Pyx_PyObject_IsTrue(py_result); + Py_DECREF(py_result); + return result; + } +return_eq: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_EQ); +return_ne: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_NE); +#endif +} + +/* GetAttr */ +static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) { +#if CYTHON_USE_TYPE_SLOTS +#if PY_MAJOR_VERSION >= 3 + if (likely(PyUnicode_Check(n))) +#else + if (likely(PyString_Check(n))) +#endif + return __Pyx_PyObject_GetAttrStr(o, n); +#endif + return PyObject_GetAttr(o, n); +} + +/* GetAttr3 */ +static PyObject *__Pyx_GetAttr3Default(PyObject *d) { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) + return NULL; + __Pyx_PyErr_Clear(); + Py_INCREF(d); + return d; +} +static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) { + PyObject *r = __Pyx_GetAttr(o, n); + return (likely(r)) ? r : __Pyx_GetAttr3Default(d); +} + +/* ArgTypeTest */ +static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact) +{ + if (unlikely(!type)) { + PyErr_SetString(PyExc_SystemError, "Missing type object"); + return 0; + } + else if (exact) { + #if PY_MAJOR_VERSION == 2 + if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1; + #endif + } + else { + if (likely(__Pyx_TypeCheck(obj, type))) return 1; + } + PyErr_Format(PyExc_TypeError, + "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)", + name, type->tp_name, Py_TYPE(obj)->tp_name); + return 0; +} + +/* ExtTypeTest */ +static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { + if (unlikely(!type)) { + PyErr_SetString(PyExc_SystemError, "Missing type object"); + return 0; + } + if (likely(__Pyx_TypeCheck(obj, type))) + return 1; + PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s", + Py_TYPE(obj)->tp_name, type->tp_name); + return 0; +} + +/* PyObjectSetAttrStr */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) { + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_setattro)) + return tp->tp_setattro(obj, attr_name, value); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_setattr)) + return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value); +#endif + return PyObject_SetAttr(obj, attr_name, value); +} +#endif + +/* PyObject_GenericGetAttrNoDict */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) { + PyErr_Format(PyExc_AttributeError, +#if PY_MAJOR_VERSION >= 3 + "'%.50s' object has no attribute '%U'", + tp->tp_name, attr_name); +#else + "'%.50s' object has no attribute '%.400s'", + tp->tp_name, PyString_AS_STRING(attr_name)); +#endif + return NULL; +} +static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) { + PyObject *descr; + PyTypeObject *tp = Py_TYPE(obj); + if (unlikely(!PyString_Check(attr_name))) { + return PyObject_GenericGetAttr(obj, attr_name); + } + assert(!tp->tp_dictoffset); + descr = _PyType_Lookup(tp, attr_name); + if (unlikely(!descr)) { + return __Pyx_RaiseGenericGetAttributeError(tp, attr_name); + } + Py_INCREF(descr); + #if PY_MAJOR_VERSION < 3 + if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS))) + #endif + { + descrgetfunc f = Py_TYPE(descr)->tp_descr_get; + if (unlikely(f)) { + PyObject *res = f(descr, obj, (PyObject *)tp); + Py_DECREF(descr); + return res; + } + } + return descr; +} +#endif + +/* PyObject_GenericGetAttr */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) { + if (unlikely(Py_TYPE(obj)->tp_dictoffset)) { + return PyObject_GenericGetAttr(obj, attr_name); + } + return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name); +} +#endif + +/* SetVTable */ +static int __Pyx_SetVtable(PyObject *dict, void *vtable) { +#if PY_VERSION_HEX >= 0x02070000 + PyObject *ob = PyCapsule_New(vtable, 0, 0); +#else + PyObject *ob = PyCObject_FromVoidPtr(vtable, 0); +#endif + if (!ob) + goto bad; + if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0) + goto bad; + Py_DECREF(ob); + return 0; +bad: + Py_XDECREF(ob); + return -1; +} + +/* TypeImport */ +#ifndef __PYX_HAVE_RT_ImportType +#define __PYX_HAVE_RT_ImportType +static PyTypeObject *__Pyx_ImportType(PyObject *module, const char *module_name, const char *class_name, + size_t size, enum __Pyx_ImportType_CheckSize check_size) +{ + PyObject *result = 0; + char warning[200]; + Py_ssize_t basicsize; +#ifdef Py_LIMITED_API + PyObject *py_basicsize; +#endif + result = PyObject_GetAttrString(module, class_name); + if (!result) + goto bad; + if (!PyType_Check(result)) { + PyErr_Format(PyExc_TypeError, + "%.200s.%.200s is not a type object", + module_name, class_name); + goto bad; + } +#ifndef Py_LIMITED_API + basicsize = ((PyTypeObject *)result)->tp_basicsize; +#else + py_basicsize = PyObject_GetAttrString(result, "__basicsize__"); + if (!py_basicsize) + goto bad; + basicsize = PyLong_AsSsize_t(py_basicsize); + Py_DECREF(py_basicsize); + py_basicsize = 0; + if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred()) + goto bad; +#endif + if ((size_t)basicsize < size) { + PyErr_Format(PyExc_ValueError, + "%.200s.%.200s size changed, may indicate binary incompatibility. " + "Expected %zd from C header, got %zd from PyObject", + module_name, class_name, size, basicsize); + goto bad; + } + if (check_size == __Pyx_ImportType_CheckSize_Error && (size_t)basicsize != size) { + PyErr_Format(PyExc_ValueError, + "%.200s.%.200s size changed, may indicate binary incompatibility. " + "Expected %zd from C header, got %zd from PyObject", + module_name, class_name, size, basicsize); + goto bad; + } + else if (check_size == __Pyx_ImportType_CheckSize_Warn && (size_t)basicsize > size) { + PyOS_snprintf(warning, sizeof(warning), + "%s.%s size changed, may indicate binary incompatibility. " + "Expected %zd from C header, got %zd from PyObject", + module_name, class_name, size, basicsize); + if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad; + } + return (PyTypeObject *)result; +bad: + Py_XDECREF(result); + return NULL; +} +#endif + +/* GetNameInClass */ +static PyObject *__Pyx_GetGlobalNameAfterAttributeLookup(PyObject *name) { + PyObject *result; + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) + return NULL; + __Pyx_PyErr_Clear(); + __Pyx_GetModuleGlobalNameUncached(result, name); + return result; +} +static PyObject *__Pyx__GetNameInClass(PyObject *nmspace, PyObject *name) { + PyObject *result; + result = __Pyx_PyObject_GetAttrStr(nmspace, name); + if (!result) { + result = __Pyx_GetGlobalNameAfterAttributeLookup(name); + } + return result; +} + +/* Import */ +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { + PyObject *empty_list = 0; + PyObject *module = 0; + PyObject *global_dict = 0; + PyObject *empty_dict = 0; + PyObject *list; + #if PY_MAJOR_VERSION < 3 + PyObject *py_import; + py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); + if (!py_import) + goto bad; + #endif + if (from_list) + list = from_list; + else { + empty_list = PyList_New(0); + if (!empty_list) + goto bad; + list = empty_list; + } + global_dict = PyModule_GetDict(__pyx_m); + if (!global_dict) + goto bad; + empty_dict = PyDict_New(); + if (!empty_dict) + goto bad; + { + #if PY_MAJOR_VERSION >= 3 + if (level == -1) { + if (strchr(__Pyx_MODULE_NAME, '.')) { + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, 1); + if (!module) { + if (!PyErr_ExceptionMatches(PyExc_ImportError)) + goto bad; + PyErr_Clear(); + } + } + level = 0; + } + #endif + if (!module) { + #if PY_MAJOR_VERSION < 3 + PyObject *py_level = PyInt_FromLong(level); + if (!py_level) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, py_level, (PyObject *)NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, level); + #endif + } + } +bad: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(py_import); + #endif + Py_XDECREF(empty_list); + Py_XDECREF(empty_dict); + return module; +} + +/* ImportFrom */ +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { + PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); + if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_Format(PyExc_ImportError, + #if PY_MAJOR_VERSION < 3 + "cannot import name %.230s", PyString_AS_STRING(name)); + #else + "cannot import name %S", name); + #endif + } + return value; +} + +/* CLineInTraceback */ +#ifndef CYTHON_CLINE_IN_TRACEBACK +static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { + PyObject *use_cline; + PyObject *ptype, *pvalue, *ptraceback; +#if CYTHON_COMPILING_IN_CPYTHON + PyObject **cython_runtime_dict; +#endif + if (unlikely(!__pyx_cython_runtime)) { + return c_line; + } + __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); +#if CYTHON_COMPILING_IN_CPYTHON + cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); + if (likely(cython_runtime_dict)) { + __PYX_PY_DICT_LOOKUP_IF_MODIFIED( + use_cline, *cython_runtime_dict, + __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback)) + } else +#endif + { + PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback); + if (use_cline_obj) { + use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; + Py_DECREF(use_cline_obj); + } else { + PyErr_Clear(); + use_cline = NULL; + } + } + if (!use_cline) { + c_line = 0; + PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); + } + else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { + c_line = 0; + } + __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); + return c_line; +} +#endif + +/* CodeObjectCache */ +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { + int start = 0, mid = 0, end = count - 1; + if (end >= 0 && code_line > entries[end].code_line) { + return count; + } + while (start < end) { + mid = start + (end - start) / 2; + if (code_line < entries[mid].code_line) { + end = mid; + } else if (code_line > entries[mid].code_line) { + start = mid + 1; + } else { + return mid; + } + } + if (code_line <= entries[mid].code_line) { + return mid; + } else { + return mid + 1; + } +} +static PyCodeObject *__pyx_find_code_object(int code_line) { + PyCodeObject* code_object; + int pos; + if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { + return NULL; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { + return NULL; + } + code_object = __pyx_code_cache.entries[pos].code_object; + Py_INCREF(code_object); + return code_object; +} +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { + int pos, i; + __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; + if (unlikely(!code_line)) { + return; + } + if (unlikely(!entries)) { + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); + if (likely(entries)) { + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = 64; + __pyx_code_cache.count = 1; + entries[0].code_line = code_line; + entries[0].code_object = code_object; + Py_INCREF(code_object); + } + return; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { + PyCodeObject* tmp = entries[pos].code_object; + entries[pos].code_object = code_object; + Py_DECREF(tmp); + return; + } + if (__pyx_code_cache.count == __pyx_code_cache.max_count) { + int new_max = __pyx_code_cache.max_count + 64; + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( + __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry)); + if (unlikely(!entries)) { + return; + } + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = new_max; + } + for (i=__pyx_code_cache.count; i>pos; i--) { + entries[i] = entries[i-1]; + } + entries[pos].code_line = code_line; + entries[pos].code_object = code_object; + __pyx_code_cache.count++; + Py_INCREF(code_object); +} + +/* AddTraceback */ +#include "compile.h" +#include "frameobject.h" +#include "traceback.h" +static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( + const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyObject *py_srcfile = 0; + PyObject *py_funcname = 0; + #if PY_MAJOR_VERSION < 3 + py_srcfile = PyString_FromString(filename); + #else + py_srcfile = PyUnicode_FromString(filename); + #endif + if (!py_srcfile) goto bad; + if (c_line) { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + #else + py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + #endif + } + else { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromString(funcname); + #else + py_funcname = PyUnicode_FromString(funcname); + #endif + } + if (!py_funcname) goto bad; + py_code = __Pyx_PyCode_New( + 0, + 0, + 0, + 0, + 0, + __pyx_empty_bytes, /*PyObject *code,*/ + __pyx_empty_tuple, /*PyObject *consts,*/ + __pyx_empty_tuple, /*PyObject *names,*/ + __pyx_empty_tuple, /*PyObject *varnames,*/ + __pyx_empty_tuple, /*PyObject *freevars,*/ + __pyx_empty_tuple, /*PyObject *cellvars,*/ + py_srcfile, /*PyObject *filename,*/ + py_funcname, /*PyObject *name,*/ + py_line, + __pyx_empty_bytes /*PyObject *lnotab*/ + ); + Py_DECREF(py_srcfile); + Py_DECREF(py_funcname); + return py_code; +bad: + Py_XDECREF(py_srcfile); + Py_XDECREF(py_funcname); + return NULL; +} +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyFrameObject *py_frame = 0; + PyThreadState *tstate = __Pyx_PyThreadState_Current; + if (c_line) { + c_line = __Pyx_CLineForTraceback(tstate, c_line); + } + py_code = __pyx_find_code_object(c_line ? -c_line : py_line); + if (!py_code) { + py_code = __Pyx_CreateCodeObjectForTraceback( + funcname, c_line, py_line, filename); + if (!py_code) goto bad; + __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); + } + py_frame = PyFrame_New( + tstate, /*PyThreadState *tstate,*/ + py_code, /*PyCodeObject *code,*/ + __pyx_d, /*PyObject *globals,*/ + 0 /*PyObject *locals*/ + ); + if (!py_frame) goto bad; + __Pyx_PyFrame_SetLineNumber(py_frame, py_line); + PyTraceBack_Here(py_frame); +bad: + Py_XDECREF(py_code); + Py_XDECREF(py_frame); +} + +/* CIntToPy */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { + const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(long) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(long) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(long) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(long), + little, !is_unsigned); + } +} + +/* CIntToPy */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { + const int neg_one = (int) ((int) 0 - (int) 1), const_zero = (int) 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(int) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(int) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(int) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(int), + little, !is_unsigned); + } +} + +/* CIntFromPyVerify */ +#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ + __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) +#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ + __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) +#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ + {\ + func_type value = func_value;\ + if (sizeof(target_type) < sizeof(func_type)) {\ + if (unlikely(value != (func_type) (target_type) value)) {\ + func_type zero = 0;\ + if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ + return (target_type) -1;\ + if (is_unsigned && unlikely(value < zero))\ + goto raise_neg_overflow;\ + else\ + goto raise_overflow;\ + }\ + }\ + return (target_type) value;\ + } + +/* CIntToPy */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_int(unsigned int value) { + const unsigned int neg_one = (unsigned int) ((unsigned int) 0 - (unsigned int) 1), const_zero = (unsigned int) 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(unsigned int) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(unsigned int) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(unsigned int) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(unsigned int) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(unsigned int) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(unsigned int), + little, !is_unsigned); + } +} + +/* CIntFromPy */ +static CYTHON_INLINE unsigned int __Pyx_PyInt_As_unsigned_int(PyObject *x) { + const unsigned int neg_one = (unsigned int) ((unsigned int) 0 - (unsigned int) 1), const_zero = (unsigned int) 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(unsigned int) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(unsigned int, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (unsigned int) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (unsigned int) 0; + case 1: __PYX_VERIFY_RETURN_INT(unsigned int, digit, digits[0]) + case 2: + if (8 * sizeof(unsigned int) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(unsigned int) >= 2 * PyLong_SHIFT) { + return (unsigned int) (((((unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0])); + } + } + break; + case 3: + if (8 * sizeof(unsigned int) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(unsigned int) >= 3 * PyLong_SHIFT) { + return (unsigned int) (((((((unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0])); + } + } + break; + case 4: + if (8 * sizeof(unsigned int) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(unsigned int) >= 4 * PyLong_SHIFT) { + return (unsigned int) (((((((((unsigned int)digits[3]) << PyLong_SHIFT) | (unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0])); + } + } + break; + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (unsigned int) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if (sizeof(unsigned int) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(unsigned int, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(unsigned int) <= sizeof(unsigned PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(unsigned int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (unsigned int) 0; + case -1: __PYX_VERIFY_RETURN_INT(unsigned int, sdigit, (sdigit) (-(sdigit)digits[0])) + case 1: __PYX_VERIFY_RETURN_INT(unsigned int, digit, +digits[0]) + case -2: + if (8 * sizeof(unsigned int) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(unsigned int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(unsigned int) - 1 > 2 * PyLong_SHIFT) { + return (unsigned int) (((unsigned int)-1)*(((((unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0]))); + } + } + break; + case 2: + if (8 * sizeof(unsigned int) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(unsigned int) - 1 > 2 * PyLong_SHIFT) { + return (unsigned int) ((((((unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0]))); + } + } + break; + case -3: + if (8 * sizeof(unsigned int) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(unsigned int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(unsigned int) - 1 > 3 * PyLong_SHIFT) { + return (unsigned int) (((unsigned int)-1)*(((((((unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0]))); + } + } + break; + case 3: + if (8 * sizeof(unsigned int) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(unsigned int) - 1 > 3 * PyLong_SHIFT) { + return (unsigned int) ((((((((unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0]))); + } + } + break; + case -4: + if (8 * sizeof(unsigned int) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(unsigned int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(unsigned int) - 1 > 4 * PyLong_SHIFT) { + return (unsigned int) (((unsigned int)-1)*(((((((((unsigned int)digits[3]) << PyLong_SHIFT) | (unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0]))); + } + } + break; + case 4: + if (8 * sizeof(unsigned int) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(unsigned int) - 1 > 4 * PyLong_SHIFT) { + return (unsigned int) ((((((((((unsigned int)digits[3]) << PyLong_SHIFT) | (unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0]))); + } + } + break; + } +#endif + if (sizeof(unsigned int) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(unsigned int, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(unsigned int) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(unsigned int, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + unsigned int val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (unsigned int) -1; + } + } else { + unsigned int val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (unsigned int) -1; + val = __Pyx_PyInt_As_unsigned_int(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to unsigned int"); + return (unsigned int) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to unsigned int"); + return (unsigned int) -1; +} + +/* CIntFromPy */ +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { + const int neg_one = (int) ((int) 0 - (int) 1), const_zero = (int) 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(int) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (int) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (int) 0; + case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0]) + case 2: + if (8 * sizeof(int) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) { + return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + case 3: + if (8 * sizeof(int) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) { + return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + case 4: + if (8 * sizeof(int) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) { + return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (int) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if (sizeof(int) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (int) 0; + case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0])) + case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0]) + case -2: + if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { + return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 2: + if (8 * sizeof(int) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { + return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case -3: + if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { + return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 3: + if (8 * sizeof(int) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { + return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case -4: + if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { + return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 4: + if (8 * sizeof(int) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { + return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + } +#endif + if (sizeof(int) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + int val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (int) -1; + } + } else { + int val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (int) -1; + val = __Pyx_PyInt_As_int(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to int"); + return (int) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to int"); + return (int) -1; +} + +/* CIntFromPy */ +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { + const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(long) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (long) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (long) 0; + case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0]) + case 2: + if (8 * sizeof(long) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) { + return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + case 3: + if (8 * sizeof(long) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) { + return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + case 4: + if (8 * sizeof(long) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) { + return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (long) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if (sizeof(long) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (long) 0; + case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0])) + case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0]) + case -2: + if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 2: + if (8 * sizeof(long) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case -3: + if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 3: + if (8 * sizeof(long) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case -4: + if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 4: + if (8 * sizeof(long) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + } +#endif + if (sizeof(long) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + long val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (long) -1; + } + } else { + long val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (long) -1; + val = __Pyx_PyInt_As_long(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to long"); + return (long) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to long"); + return (long) -1; +} + +/* FastTypeChecks */ +#if CYTHON_COMPILING_IN_CPYTHON +static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) { + while (a) { + a = a->tp_base; + if (a == b) + return 1; + } + return b == &PyBaseObject_Type; +} +static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) { + PyObject *mro; + if (a == b) return 1; + mro = a->tp_mro; + if (likely(mro)) { + Py_ssize_t i, n; + n = PyTuple_GET_SIZE(mro); + for (i = 0; i < n; i++) { + if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b) + return 1; + } + return 0; + } + return __Pyx_InBases(a, b); +} +#if PY_MAJOR_VERSION == 2 +static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { + PyObject *exception, *value, *tb; + int res; + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ErrFetch(&exception, &value, &tb); + res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; + if (unlikely(res == -1)) { + PyErr_WriteUnraisable(err); + res = 0; + } + if (!res) { + res = PyObject_IsSubclass(err, exc_type2); + if (unlikely(res == -1)) { + PyErr_WriteUnraisable(err); + res = 0; + } + } + __Pyx_ErrRestore(exception, value, tb); + return res; +} +#else +static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { + int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0; + if (!res) { + res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); + } + return res; +} +#endif +static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { + Py_ssize_t i, n; + assert(PyExceptionClass_Check(exc_type)); + n = PyTuple_GET_SIZE(tuple); +#if PY_MAJOR_VERSION >= 3 + for (i=0; itp_name); + if (cached_type) { + if (!PyType_Check((PyObject*)cached_type)) { + PyErr_Format(PyExc_TypeError, + "Shared Cython type %.200s is not a type object", + type->tp_name); + goto bad; + } + if (cached_type->tp_basicsize != type->tp_basicsize) { + PyErr_Format(PyExc_TypeError, + "Shared Cython type %.200s has the wrong size, try recompiling", + type->tp_name); + goto bad; + } + } else { + if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; + PyErr_Clear(); + if (PyType_Ready(type) < 0) goto bad; + if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0) + goto bad; + Py_INCREF(type); + cached_type = type; + } +done: + Py_DECREF(fake_module); + return cached_type; +bad: + Py_XDECREF(cached_type); + cached_type = NULL; + goto done; +} + +/* PyObjectGetMethod */ +static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method) { + PyObject *attr; +#if CYTHON_UNPACK_METHODS && CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_PYTYPE_LOOKUP + PyTypeObject *tp = Py_TYPE(obj); + PyObject *descr; + descrgetfunc f = NULL; + PyObject **dictptr, *dict; + int meth_found = 0; + assert (*method == NULL); + if (unlikely(tp->tp_getattro != PyObject_GenericGetAttr)) { + attr = __Pyx_PyObject_GetAttrStr(obj, name); + goto try_unpack; + } + if (unlikely(tp->tp_dict == NULL) && unlikely(PyType_Ready(tp) < 0)) { + return 0; + } + descr = _PyType_Lookup(tp, name); + if (likely(descr != NULL)) { + Py_INCREF(descr); +#if PY_MAJOR_VERSION >= 3 + #ifdef __Pyx_CyFunction_USED + if (likely(PyFunction_Check(descr) || (Py_TYPE(descr) == &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr))) + #else + if (likely(PyFunction_Check(descr) || (Py_TYPE(descr) == &PyMethodDescr_Type))) + #endif +#else + #ifdef __Pyx_CyFunction_USED + if (likely(PyFunction_Check(descr) || __Pyx_CyFunction_Check(descr))) + #else + if (likely(PyFunction_Check(descr))) + #endif +#endif + { + meth_found = 1; + } else { + f = Py_TYPE(descr)->tp_descr_get; + if (f != NULL && PyDescr_IsData(descr)) { + attr = f(descr, obj, (PyObject *)Py_TYPE(obj)); + Py_DECREF(descr); + goto try_unpack; + } + } + } + dictptr = _PyObject_GetDictPtr(obj); + if (dictptr != NULL && (dict = *dictptr) != NULL) { + Py_INCREF(dict); + attr = __Pyx_PyDict_GetItemStr(dict, name); + if (attr != NULL) { + Py_INCREF(attr); + Py_DECREF(dict); + Py_XDECREF(descr); + goto try_unpack; + } + Py_DECREF(dict); + } + if (meth_found) { + *method = descr; + return 1; + } + if (f != NULL) { + attr = f(descr, obj, (PyObject *)Py_TYPE(obj)); + Py_DECREF(descr); + goto try_unpack; + } + if (descr != NULL) { + *method = descr; + return 0; + } + PyErr_Format(PyExc_AttributeError, +#if PY_MAJOR_VERSION >= 3 + "'%.50s' object has no attribute '%U'", + tp->tp_name, name); +#else + "'%.50s' object has no attribute '%.400s'", + tp->tp_name, PyString_AS_STRING(name)); +#endif + return 0; +#else + attr = __Pyx_PyObject_GetAttrStr(obj, name); + goto try_unpack; +#endif +try_unpack: +#if CYTHON_UNPACK_METHODS + if (likely(attr) && PyMethod_Check(attr) && likely(PyMethod_GET_SELF(attr) == obj)) { + PyObject *function = PyMethod_GET_FUNCTION(attr); + Py_INCREF(function); + Py_DECREF(attr); + *method = function; + return 1; + } +#endif + *method = attr; + return 0; +} + +/* PyObjectCallMethod1 */ +static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg) { + PyObject *result = __Pyx_PyObject_CallOneArg(method, arg); + Py_DECREF(method); + return result; +} +static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) { + PyObject *method = NULL, *result; + int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method); + if (likely(is_method)) { + result = __Pyx_PyObject_Call2Args(method, obj, arg); + Py_DECREF(method); + return result; + } + if (unlikely(!method)) return NULL; + return __Pyx__PyObject_CallMethod1(method, arg); +} + +/* CoroutineBase */ +#include +#include +#define __Pyx_Coroutine_Undelegate(gen) Py_CLEAR((gen)->yieldfrom) +static int __Pyx_PyGen__FetchStopIterationValue(CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject **pvalue) { + PyObject *et, *ev, *tb; + PyObject *value = NULL; + __Pyx_ErrFetch(&et, &ev, &tb); + if (!et) { + Py_XDECREF(tb); + Py_XDECREF(ev); + Py_INCREF(Py_None); + *pvalue = Py_None; + return 0; + } + if (likely(et == PyExc_StopIteration)) { + if (!ev) { + Py_INCREF(Py_None); + value = Py_None; + } +#if PY_VERSION_HEX >= 0x030300A0 + else if (Py_TYPE(ev) == (PyTypeObject*)PyExc_StopIteration) { + value = ((PyStopIterationObject *)ev)->value; + Py_INCREF(value); + Py_DECREF(ev); + } +#endif + else if (unlikely(PyTuple_Check(ev))) { + if (PyTuple_GET_SIZE(ev) >= 1) { +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + value = PyTuple_GET_ITEM(ev, 0); + Py_INCREF(value); +#else + value = PySequence_ITEM(ev, 0); +#endif + } else { + Py_INCREF(Py_None); + value = Py_None; + } + Py_DECREF(ev); + } + else if (!__Pyx_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration)) { + value = ev; + } + if (likely(value)) { + Py_XDECREF(tb); + Py_DECREF(et); + *pvalue = value; + return 0; + } + } else if (!__Pyx_PyErr_GivenExceptionMatches(et, PyExc_StopIteration)) { + __Pyx_ErrRestore(et, ev, tb); + return -1; + } + PyErr_NormalizeException(&et, &ev, &tb); + if (unlikely(!PyObject_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration))) { + __Pyx_ErrRestore(et, ev, tb); + return -1; + } + Py_XDECREF(tb); + Py_DECREF(et); +#if PY_VERSION_HEX >= 0x030300A0 + value = ((PyStopIterationObject *)ev)->value; + Py_INCREF(value); + Py_DECREF(ev); +#else + { + PyObject* args = __Pyx_PyObject_GetAttrStr(ev, __pyx_n_s_args); + Py_DECREF(ev); + if (likely(args)) { + value = PySequence_GetItem(args, 0); + Py_DECREF(args); + } + if (unlikely(!value)) { + __Pyx_ErrRestore(NULL, NULL, NULL); + Py_INCREF(Py_None); + value = Py_None; + } + } +#endif + *pvalue = value; + return 0; +} +static CYTHON_INLINE +void __Pyx_Coroutine_ExceptionClear(__Pyx_ExcInfoStruct *exc_state) { + PyObject *t, *v, *tb; + t = exc_state->exc_type; + v = exc_state->exc_value; + tb = exc_state->exc_traceback; + exc_state->exc_type = NULL; + exc_state->exc_value = NULL; + exc_state->exc_traceback = NULL; + Py_XDECREF(t); + Py_XDECREF(v); + Py_XDECREF(tb); +} +#define __Pyx_Coroutine_AlreadyRunningError(gen) (__Pyx__Coroutine_AlreadyRunningError(gen), (PyObject*)NULL) +static void __Pyx__Coroutine_AlreadyRunningError(CYTHON_UNUSED __pyx_CoroutineObject *gen) { + const char *msg; + if ((0)) { + #ifdef __Pyx_Coroutine_USED + } else if (__Pyx_Coroutine_Check((PyObject*)gen)) { + msg = "coroutine already executing"; + #endif + #ifdef __Pyx_AsyncGen_USED + } else if (__Pyx_AsyncGen_CheckExact((PyObject*)gen)) { + msg = "async generator already executing"; + #endif + } else { + msg = "generator already executing"; + } + PyErr_SetString(PyExc_ValueError, msg); +} +#define __Pyx_Coroutine_NotStartedError(gen) (__Pyx__Coroutine_NotStartedError(gen), (PyObject*)NULL) +static void __Pyx__Coroutine_NotStartedError(CYTHON_UNUSED PyObject *gen) { + const char *msg; + if ((0)) { + #ifdef __Pyx_Coroutine_USED + } else if (__Pyx_Coroutine_Check(gen)) { + msg = "can't send non-None value to a just-started coroutine"; + #endif + #ifdef __Pyx_AsyncGen_USED + } else if (__Pyx_AsyncGen_CheckExact(gen)) { + msg = "can't send non-None value to a just-started async generator"; + #endif + } else { + msg = "can't send non-None value to a just-started generator"; + } + PyErr_SetString(PyExc_TypeError, msg); +} +#define __Pyx_Coroutine_AlreadyTerminatedError(gen, value, closing) (__Pyx__Coroutine_AlreadyTerminatedError(gen, value, closing), (PyObject*)NULL) +static void __Pyx__Coroutine_AlreadyTerminatedError(CYTHON_UNUSED PyObject *gen, PyObject *value, CYTHON_UNUSED int closing) { + #ifdef __Pyx_Coroutine_USED + if (!closing && __Pyx_Coroutine_Check(gen)) { + PyErr_SetString(PyExc_RuntimeError, "cannot reuse already awaited coroutine"); + } else + #endif + if (value) { + #ifdef __Pyx_AsyncGen_USED + if (__Pyx_AsyncGen_CheckExact(gen)) + PyErr_SetNone(__Pyx_PyExc_StopAsyncIteration); + else + #endif + PyErr_SetNone(PyExc_StopIteration); + } +} +static +PyObject *__Pyx_Coroutine_SendEx(__pyx_CoroutineObject *self, PyObject *value, int closing) { + __Pyx_PyThreadState_declare + PyThreadState *tstate; + __Pyx_ExcInfoStruct *exc_state; + PyObject *retval; + assert(!self->is_running); + if (unlikely(self->resume_label == 0)) { + if (unlikely(value && value != Py_None)) { + return __Pyx_Coroutine_NotStartedError((PyObject*)self); + } + } + if (unlikely(self->resume_label == -1)) { + return __Pyx_Coroutine_AlreadyTerminatedError((PyObject*)self, value, closing); + } +#if CYTHON_FAST_THREAD_STATE + __Pyx_PyThreadState_assign + tstate = __pyx_tstate; +#else + tstate = __Pyx_PyThreadState_Current; +#endif + exc_state = &self->gi_exc_state; + if (exc_state->exc_type) { + #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_PYSTON + #else + if (exc_state->exc_traceback) { + PyTracebackObject *tb = (PyTracebackObject *) exc_state->exc_traceback; + PyFrameObject *f = tb->tb_frame; + Py_XINCREF(tstate->frame); + assert(f->f_back == NULL); + f->f_back = tstate->frame; + } + #endif + } +#if CYTHON_USE_EXC_INFO_STACK + exc_state->previous_item = tstate->exc_info; + tstate->exc_info = exc_state; +#else + if (exc_state->exc_type) { + __Pyx_ExceptionSwap(&exc_state->exc_type, &exc_state->exc_value, &exc_state->exc_traceback); + } else { + __Pyx_Coroutine_ExceptionClear(exc_state); + __Pyx_ExceptionSave(&exc_state->exc_type, &exc_state->exc_value, &exc_state->exc_traceback); + } +#endif + self->is_running = 1; + retval = self->body((PyObject *) self, tstate, value); + self->is_running = 0; +#if CYTHON_USE_EXC_INFO_STACK + exc_state = &self->gi_exc_state; + tstate->exc_info = exc_state->previous_item; + exc_state->previous_item = NULL; + __Pyx_Coroutine_ResetFrameBackpointer(exc_state); +#endif + return retval; +} +static CYTHON_INLINE void __Pyx_Coroutine_ResetFrameBackpointer(__Pyx_ExcInfoStruct *exc_state) { + PyObject *exc_tb = exc_state->exc_traceback; + if (likely(exc_tb)) { +#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_PYSTON +#else + PyTracebackObject *tb = (PyTracebackObject *) exc_tb; + PyFrameObject *f = tb->tb_frame; + Py_CLEAR(f->f_back); +#endif + } +} +static CYTHON_INLINE +PyObject *__Pyx_Coroutine_MethodReturn(CYTHON_UNUSED PyObject* gen, PyObject *retval) { + if (unlikely(!retval)) { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + if (!__Pyx_PyErr_Occurred()) { + PyObject *exc = PyExc_StopIteration; + #ifdef __Pyx_AsyncGen_USED + if (__Pyx_AsyncGen_CheckExact(gen)) + exc = __Pyx_PyExc_StopAsyncIteration; + #endif + __Pyx_PyErr_SetNone(exc); + } + } + return retval; +} +static CYTHON_INLINE +PyObject *__Pyx_Coroutine_FinishDelegation(__pyx_CoroutineObject *gen) { + PyObject *ret; + PyObject *val = NULL; + __Pyx_Coroutine_Undelegate(gen); + __Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, &val); + ret = __Pyx_Coroutine_SendEx(gen, val, 0); + Py_XDECREF(val); + return ret; +} +static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value) { + PyObject *retval; + __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self; + PyObject *yf = gen->yieldfrom; + if (unlikely(gen->is_running)) + return __Pyx_Coroutine_AlreadyRunningError(gen); + if (yf) { + PyObject *ret; + gen->is_running = 1; + #ifdef __Pyx_Generator_USED + if (__Pyx_Generator_CheckExact(yf)) { + ret = __Pyx_Coroutine_Send(yf, value); + } else + #endif + #ifdef __Pyx_Coroutine_USED + if (__Pyx_Coroutine_Check(yf)) { + ret = __Pyx_Coroutine_Send(yf, value); + } else + #endif + #ifdef __Pyx_AsyncGen_USED + if (__pyx_PyAsyncGenASend_CheckExact(yf)) { + ret = __Pyx_async_gen_asend_send(yf, value); + } else + #endif + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3) + if (PyGen_CheckExact(yf)) { + ret = _PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value); + } else + #endif + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03050000 && defined(PyCoro_CheckExact) && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3) + if (PyCoro_CheckExact(yf)) { + ret = _PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value); + } else + #endif + { + if (value == Py_None) + ret = Py_TYPE(yf)->tp_iternext(yf); + else + ret = __Pyx_PyObject_CallMethod1(yf, __pyx_n_s_send, value); + } + gen->is_running = 0; + if (likely(ret)) { + return ret; + } + retval = __Pyx_Coroutine_FinishDelegation(gen); + } else { + retval = __Pyx_Coroutine_SendEx(gen, value, 0); + } + return __Pyx_Coroutine_MethodReturn(self, retval); +} +static int __Pyx_Coroutine_CloseIter(__pyx_CoroutineObject *gen, PyObject *yf) { + PyObject *retval = NULL; + int err = 0; + #ifdef __Pyx_Generator_USED + if (__Pyx_Generator_CheckExact(yf)) { + retval = __Pyx_Coroutine_Close(yf); + if (!retval) + return -1; + } else + #endif + #ifdef __Pyx_Coroutine_USED + if (__Pyx_Coroutine_Check(yf)) { + retval = __Pyx_Coroutine_Close(yf); + if (!retval) + return -1; + } else + if (__Pyx_CoroutineAwait_CheckExact(yf)) { + retval = __Pyx_CoroutineAwait_Close((__pyx_CoroutineAwaitObject*)yf, NULL); + if (!retval) + return -1; + } else + #endif + #ifdef __Pyx_AsyncGen_USED + if (__pyx_PyAsyncGenASend_CheckExact(yf)) { + retval = __Pyx_async_gen_asend_close(yf, NULL); + } else + if (__pyx_PyAsyncGenAThrow_CheckExact(yf)) { + retval = __Pyx_async_gen_athrow_close(yf, NULL); + } else + #endif + { + PyObject *meth; + gen->is_running = 1; + meth = __Pyx_PyObject_GetAttrStr(yf, __pyx_n_s_close); + if (unlikely(!meth)) { + if (!PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_WriteUnraisable(yf); + } + PyErr_Clear(); + } else { + retval = PyObject_CallFunction(meth, NULL); + Py_DECREF(meth); + if (!retval) + err = -1; + } + gen->is_running = 0; + } + Py_XDECREF(retval); + return err; +} +static PyObject *__Pyx_Generator_Next(PyObject *self) { + __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self; + PyObject *yf = gen->yieldfrom; + if (unlikely(gen->is_running)) + return __Pyx_Coroutine_AlreadyRunningError(gen); + if (yf) { + PyObject *ret; + gen->is_running = 1; + #ifdef __Pyx_Generator_USED + if (__Pyx_Generator_CheckExact(yf)) { + ret = __Pyx_Generator_Next(yf); + } else + #endif + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3) + if (PyGen_CheckExact(yf)) { + ret = _PyGen_Send((PyGenObject*)yf, NULL); + } else + #endif + #ifdef __Pyx_Coroutine_USED + if (__Pyx_Coroutine_Check(yf)) { + ret = __Pyx_Coroutine_Send(yf, Py_None); + } else + #endif + ret = Py_TYPE(yf)->tp_iternext(yf); + gen->is_running = 0; + if (likely(ret)) { + return ret; + } + return __Pyx_Coroutine_FinishDelegation(gen); + } + return __Pyx_Coroutine_SendEx(gen, Py_None, 0); +} +static PyObject *__Pyx_Coroutine_Close_Method(PyObject *self, CYTHON_UNUSED PyObject *arg) { + return __Pyx_Coroutine_Close(self); +} +static PyObject *__Pyx_Coroutine_Close(PyObject *self) { + __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self; + PyObject *retval, *raised_exception; + PyObject *yf = gen->yieldfrom; + int err = 0; + if (unlikely(gen->is_running)) + return __Pyx_Coroutine_AlreadyRunningError(gen); + if (yf) { + Py_INCREF(yf); + err = __Pyx_Coroutine_CloseIter(gen, yf); + __Pyx_Coroutine_Undelegate(gen); + Py_DECREF(yf); + } + if (err == 0) + PyErr_SetNone(PyExc_GeneratorExit); + retval = __Pyx_Coroutine_SendEx(gen, NULL, 1); + if (unlikely(retval)) { + const char *msg; + Py_DECREF(retval); + if ((0)) { + #ifdef __Pyx_Coroutine_USED + } else if (__Pyx_Coroutine_Check(self)) { + msg = "coroutine ignored GeneratorExit"; + #endif + #ifdef __Pyx_AsyncGen_USED + } else if (__Pyx_AsyncGen_CheckExact(self)) { +#if PY_VERSION_HEX < 0x03060000 + msg = "async generator ignored GeneratorExit - might require Python 3.6+ finalisation (PEP 525)"; +#else + msg = "async generator ignored GeneratorExit"; +#endif + #endif + } else { + msg = "generator ignored GeneratorExit"; + } + PyErr_SetString(PyExc_RuntimeError, msg); + return NULL; + } + raised_exception = PyErr_Occurred(); + if (likely(!raised_exception || __Pyx_PyErr_GivenExceptionMatches2(raised_exception, PyExc_GeneratorExit, PyExc_StopIteration))) { + if (raised_exception) PyErr_Clear(); + Py_INCREF(Py_None); + return Py_None; + } + return NULL; +} +static PyObject *__Pyx__Coroutine_Throw(PyObject *self, PyObject *typ, PyObject *val, PyObject *tb, + PyObject *args, int close_on_genexit) { + __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self; + PyObject *yf = gen->yieldfrom; + if (unlikely(gen->is_running)) + return __Pyx_Coroutine_AlreadyRunningError(gen); + if (yf) { + PyObject *ret; + Py_INCREF(yf); + if (__Pyx_PyErr_GivenExceptionMatches(typ, PyExc_GeneratorExit) && close_on_genexit) { + int err = __Pyx_Coroutine_CloseIter(gen, yf); + Py_DECREF(yf); + __Pyx_Coroutine_Undelegate(gen); + if (err < 0) + return __Pyx_Coroutine_MethodReturn(self, __Pyx_Coroutine_SendEx(gen, NULL, 0)); + goto throw_here; + } + gen->is_running = 1; + if (0 + #ifdef __Pyx_Generator_USED + || __Pyx_Generator_CheckExact(yf) + #endif + #ifdef __Pyx_Coroutine_USED + || __Pyx_Coroutine_Check(yf) + #endif + ) { + ret = __Pyx__Coroutine_Throw(yf, typ, val, tb, args, close_on_genexit); + #ifdef __Pyx_Coroutine_USED + } else if (__Pyx_CoroutineAwait_CheckExact(yf)) { + ret = __Pyx__Coroutine_Throw(((__pyx_CoroutineAwaitObject*)yf)->coroutine, typ, val, tb, args, close_on_genexit); + #endif + } else { + PyObject *meth = __Pyx_PyObject_GetAttrStr(yf, __pyx_n_s_throw); + if (unlikely(!meth)) { + Py_DECREF(yf); + if (!PyErr_ExceptionMatches(PyExc_AttributeError)) { + gen->is_running = 0; + return NULL; + } + PyErr_Clear(); + __Pyx_Coroutine_Undelegate(gen); + gen->is_running = 0; + goto throw_here; + } + if (likely(args)) { + ret = PyObject_CallObject(meth, args); + } else { + ret = PyObject_CallFunctionObjArgs(meth, typ, val, tb, NULL); + } + Py_DECREF(meth); + } + gen->is_running = 0; + Py_DECREF(yf); + if (!ret) { + ret = __Pyx_Coroutine_FinishDelegation(gen); + } + return __Pyx_Coroutine_MethodReturn(self, ret); + } +throw_here: + __Pyx_Raise(typ, val, tb, NULL); + return __Pyx_Coroutine_MethodReturn(self, __Pyx_Coroutine_SendEx(gen, NULL, 0)); +} +static PyObject *__Pyx_Coroutine_Throw(PyObject *self, PyObject *args) { + PyObject *typ; + PyObject *val = NULL; + PyObject *tb = NULL; + if (!PyArg_UnpackTuple(args, (char *)"throw", 1, 3, &typ, &val, &tb)) + return NULL; + return __Pyx__Coroutine_Throw(self, typ, val, tb, args, 1); +} +static CYTHON_INLINE int __Pyx_Coroutine_traverse_excstate(__Pyx_ExcInfoStruct *exc_state, visitproc visit, void *arg) { + Py_VISIT(exc_state->exc_type); + Py_VISIT(exc_state->exc_value); + Py_VISIT(exc_state->exc_traceback); + return 0; +} +static int __Pyx_Coroutine_traverse(__pyx_CoroutineObject *gen, visitproc visit, void *arg) { + Py_VISIT(gen->closure); + Py_VISIT(gen->classobj); + Py_VISIT(gen->yieldfrom); + return __Pyx_Coroutine_traverse_excstate(&gen->gi_exc_state, visit, arg); +} +static int __Pyx_Coroutine_clear(PyObject *self) { + __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self; + Py_CLEAR(gen->closure); + Py_CLEAR(gen->classobj); + Py_CLEAR(gen->yieldfrom); + __Pyx_Coroutine_ExceptionClear(&gen->gi_exc_state); +#ifdef __Pyx_AsyncGen_USED + if (__Pyx_AsyncGen_CheckExact(self)) { + Py_CLEAR(((__pyx_PyAsyncGenObject*)gen)->ag_finalizer); + } +#endif + Py_CLEAR(gen->gi_code); + Py_CLEAR(gen->gi_name); + Py_CLEAR(gen->gi_qualname); + Py_CLEAR(gen->gi_modulename); + return 0; +} +static void __Pyx_Coroutine_dealloc(PyObject *self) { + __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self; + PyObject_GC_UnTrack(gen); + if (gen->gi_weakreflist != NULL) + PyObject_ClearWeakRefs(self); + if (gen->resume_label >= 0) { + PyObject_GC_Track(self); +#if PY_VERSION_HEX >= 0x030400a1 && CYTHON_USE_TP_FINALIZE + if (PyObject_CallFinalizerFromDealloc(self)) +#else + Py_TYPE(gen)->tp_del(self); + if (self->ob_refcnt > 0) +#endif + { + return; + } + PyObject_GC_UnTrack(self); + } +#ifdef __Pyx_AsyncGen_USED + if (__Pyx_AsyncGen_CheckExact(self)) { + /* We have to handle this case for asynchronous generators + right here, because this code has to be between UNTRACK + and GC_Del. */ + Py_CLEAR(((__pyx_PyAsyncGenObject*)self)->ag_finalizer); + } +#endif + __Pyx_Coroutine_clear(self); + PyObject_GC_Del(gen); +} +static void __Pyx_Coroutine_del(PyObject *self) { + PyObject *error_type, *error_value, *error_traceback; + __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self; + __Pyx_PyThreadState_declare + if (gen->resume_label < 0) { + return; + } +#if !CYTHON_USE_TP_FINALIZE + assert(self->ob_refcnt == 0); + self->ob_refcnt = 1; +#endif + __Pyx_PyThreadState_assign + __Pyx_ErrFetch(&error_type, &error_value, &error_traceback); +#ifdef __Pyx_AsyncGen_USED + if (__Pyx_AsyncGen_CheckExact(self)) { + __pyx_PyAsyncGenObject *agen = (__pyx_PyAsyncGenObject*)self; + PyObject *finalizer = agen->ag_finalizer; + if (finalizer && !agen->ag_closed) { + PyObject *res = __Pyx_PyObject_CallOneArg(finalizer, self); + if (unlikely(!res)) { + PyErr_WriteUnraisable(self); + } else { + Py_DECREF(res); + } + __Pyx_ErrRestore(error_type, error_value, error_traceback); + return; + } + } +#endif + if (unlikely(gen->resume_label == 0 && !error_value)) { +#ifdef __Pyx_Coroutine_USED +#ifdef __Pyx_Generator_USED + if (!__Pyx_Generator_CheckExact(self)) +#endif + { + PyObject_GC_UnTrack(self); +#if PY_MAJOR_VERSION >= 3 || defined(PyErr_WarnFormat) + if (unlikely(PyErr_WarnFormat(PyExc_RuntimeWarning, 1, "coroutine '%.50S' was never awaited", gen->gi_qualname) < 0)) + PyErr_WriteUnraisable(self); +#else + {PyObject *msg; + char *cmsg; + #if CYTHON_COMPILING_IN_PYPY + msg = NULL; + cmsg = (char*) "coroutine was never awaited"; + #else + char *cname; + PyObject *qualname; + qualname = gen->gi_qualname; + cname = PyString_AS_STRING(qualname); + msg = PyString_FromFormat("coroutine '%.50s' was never awaited", cname); + if (unlikely(!msg)) { + PyErr_Clear(); + cmsg = (char*) "coroutine was never awaited"; + } else { + cmsg = PyString_AS_STRING(msg); + } + #endif + if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, cmsg, 1) < 0)) + PyErr_WriteUnraisable(self); + Py_XDECREF(msg);} +#endif + PyObject_GC_Track(self); + } +#endif + } else { + PyObject *res = __Pyx_Coroutine_Close(self); + if (unlikely(!res)) { + if (PyErr_Occurred()) + PyErr_WriteUnraisable(self); + } else { + Py_DECREF(res); + } + } + __Pyx_ErrRestore(error_type, error_value, error_traceback); +#if !CYTHON_USE_TP_FINALIZE + assert(self->ob_refcnt > 0); + if (--self->ob_refcnt == 0) { + return; + } + { + Py_ssize_t refcnt = self->ob_refcnt; + _Py_NewReference(self); + self->ob_refcnt = refcnt; + } +#if CYTHON_COMPILING_IN_CPYTHON + assert(PyType_IS_GC(self->ob_type) && + _Py_AS_GC(self)->gc.gc_refs != _PyGC_REFS_UNTRACKED); + _Py_DEC_REFTOTAL; +#endif +#ifdef COUNT_ALLOCS + --Py_TYPE(self)->tp_frees; + --Py_TYPE(self)->tp_allocs; +#endif +#endif +} +static PyObject * +__Pyx_Coroutine_get_name(__pyx_CoroutineObject *self, CYTHON_UNUSED void *context) +{ + PyObject *name = self->gi_name; + if (unlikely(!name)) name = Py_None; + Py_INCREF(name); + return name; +} +static int +__Pyx_Coroutine_set_name(__pyx_CoroutineObject *self, PyObject *value, CYTHON_UNUSED void *context) +{ + PyObject *tmp; +#if PY_MAJOR_VERSION >= 3 + if (unlikely(value == NULL || !PyUnicode_Check(value))) +#else + if (unlikely(value == NULL || !PyString_Check(value))) +#endif + { + PyErr_SetString(PyExc_TypeError, + "__name__ must be set to a string object"); + return -1; + } + tmp = self->gi_name; + Py_INCREF(value); + self->gi_name = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_Coroutine_get_qualname(__pyx_CoroutineObject *self, CYTHON_UNUSED void *context) +{ + PyObject *name = self->gi_qualname; + if (unlikely(!name)) name = Py_None; + Py_INCREF(name); + return name; +} +static int +__Pyx_Coroutine_set_qualname(__pyx_CoroutineObject *self, PyObject *value, CYTHON_UNUSED void *context) +{ + PyObject *tmp; +#if PY_MAJOR_VERSION >= 3 + if (unlikely(value == NULL || !PyUnicode_Check(value))) +#else + if (unlikely(value == NULL || !PyString_Check(value))) +#endif + { + PyErr_SetString(PyExc_TypeError, + "__qualname__ must be set to a string object"); + return -1; + } + tmp = self->gi_qualname; + Py_INCREF(value); + self->gi_qualname = value; + Py_XDECREF(tmp); + return 0; +} +static __pyx_CoroutineObject *__Pyx__Coroutine_New( + PyTypeObject* type, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure, + PyObject *name, PyObject *qualname, PyObject *module_name) { + __pyx_CoroutineObject *gen = PyObject_GC_New(__pyx_CoroutineObject, type); + if (unlikely(!gen)) + return NULL; + return __Pyx__Coroutine_NewInit(gen, body, code, closure, name, qualname, module_name); +} +static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit( + __pyx_CoroutineObject *gen, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure, + PyObject *name, PyObject *qualname, PyObject *module_name) { + gen->body = body; + gen->closure = closure; + Py_XINCREF(closure); + gen->is_running = 0; + gen->resume_label = 0; + gen->classobj = NULL; + gen->yieldfrom = NULL; + gen->gi_exc_state.exc_type = NULL; + gen->gi_exc_state.exc_value = NULL; + gen->gi_exc_state.exc_traceback = NULL; +#if CYTHON_USE_EXC_INFO_STACK + gen->gi_exc_state.previous_item = NULL; +#endif + gen->gi_weakreflist = NULL; + Py_XINCREF(qualname); + gen->gi_qualname = qualname; + Py_XINCREF(name); + gen->gi_name = name; + Py_XINCREF(module_name); + gen->gi_modulename = module_name; + Py_XINCREF(code); + gen->gi_code = code; + PyObject_GC_Track(gen); + return gen; +} + +/* PatchModuleWithCoroutine */ +static PyObject* __Pyx_Coroutine_patch_module(PyObject* module, const char* py_code) { +#if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) + int result; + PyObject *globals, *result_obj; + globals = PyDict_New(); if (unlikely(!globals)) goto ignore; + result = PyDict_SetItemString(globals, "_cython_coroutine_type", + #ifdef __Pyx_Coroutine_USED + (PyObject*)__pyx_CoroutineType); + #else + Py_None); + #endif + if (unlikely(result < 0)) goto ignore; + result = PyDict_SetItemString(globals, "_cython_generator_type", + #ifdef __Pyx_Generator_USED + (PyObject*)__pyx_GeneratorType); + #else + Py_None); + #endif + if (unlikely(result < 0)) goto ignore; + if (unlikely(PyDict_SetItemString(globals, "_module", module) < 0)) goto ignore; + if (unlikely(PyDict_SetItemString(globals, "__builtins__", __pyx_b) < 0)) goto ignore; + result_obj = PyRun_String(py_code, Py_file_input, globals, globals); + if (unlikely(!result_obj)) goto ignore; + Py_DECREF(result_obj); + Py_DECREF(globals); + return module; +ignore: + Py_XDECREF(globals); + PyErr_WriteUnraisable(module); + if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, "Cython module failed to patch module with custom type", 1) < 0)) { + Py_DECREF(module); + module = NULL; + } +#else + py_code++; +#endif + return module; +} + +/* PatchGeneratorABC */ +#ifndef CYTHON_REGISTER_ABCS +#define CYTHON_REGISTER_ABCS 1 +#endif +#if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) +static PyObject* __Pyx_patch_abc_module(PyObject *module); +static PyObject* __Pyx_patch_abc_module(PyObject *module) { + module = __Pyx_Coroutine_patch_module( + module, "" +"if _cython_generator_type is not None:\n" +" try: Generator = _module.Generator\n" +" except AttributeError: pass\n" +" else: Generator.register(_cython_generator_type)\n" +"if _cython_coroutine_type is not None:\n" +" try: Coroutine = _module.Coroutine\n" +" except AttributeError: pass\n" +" else: Coroutine.register(_cython_coroutine_type)\n" + ); + return module; +} +#endif +static int __Pyx_patch_abc(void) { +#if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) + static int abc_patched = 0; + if (CYTHON_REGISTER_ABCS && !abc_patched) { + PyObject *module; + module = PyImport_ImportModule((PY_MAJOR_VERSION >= 3) ? "collections.abc" : "collections"); + if (!module) { + PyErr_WriteUnraisable(NULL); + if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, + ((PY_MAJOR_VERSION >= 3) ? + "Cython module failed to register with collections.abc module" : + "Cython module failed to register with collections module"), 1) < 0)) { + return -1; + } + } else { + module = __Pyx_patch_abc_module(module); + abc_patched = 1; + if (unlikely(!module)) + return -1; + Py_DECREF(module); + } + module = PyImport_ImportModule("backports_abc"); + if (module) { + module = __Pyx_patch_abc_module(module); + Py_XDECREF(module); + } + if (!module) { + PyErr_Clear(); + } + } +#else + if ((0)) __Pyx_Coroutine_patch_module(NULL, NULL); +#endif + return 0; +} + +/* Generator */ +static PyMethodDef __pyx_Generator_methods[] = { + {"send", (PyCFunction) __Pyx_Coroutine_Send, METH_O, + (char*) PyDoc_STR("send(arg) -> send 'arg' into generator,\nreturn next yielded value or raise StopIteration.")}, + {"throw", (PyCFunction) __Pyx_Coroutine_Throw, METH_VARARGS, + (char*) PyDoc_STR("throw(typ[,val[,tb]]) -> raise exception in generator,\nreturn next yielded value or raise StopIteration.")}, + {"close", (PyCFunction) __Pyx_Coroutine_Close_Method, METH_NOARGS, + (char*) PyDoc_STR("close() -> raise GeneratorExit inside generator.")}, + {0, 0, 0, 0} +}; +static PyMemberDef __pyx_Generator_memberlist[] = { + {(char *) "gi_running", T_BOOL, offsetof(__pyx_CoroutineObject, is_running), READONLY, NULL}, + {(char*) "gi_yieldfrom", T_OBJECT, offsetof(__pyx_CoroutineObject, yieldfrom), READONLY, + (char*) PyDoc_STR("object being iterated by 'yield from', or None")}, + {(char*) "gi_code", T_OBJECT, offsetof(__pyx_CoroutineObject, gi_code), READONLY, NULL}, + {0, 0, 0, 0, 0} +}; +static PyGetSetDef __pyx_Generator_getsets[] = { + {(char *) "__name__", (getter)__Pyx_Coroutine_get_name, (setter)__Pyx_Coroutine_set_name, + (char*) PyDoc_STR("name of the generator"), 0}, + {(char *) "__qualname__", (getter)__Pyx_Coroutine_get_qualname, (setter)__Pyx_Coroutine_set_qualname, + (char*) PyDoc_STR("qualified name of the generator"), 0}, + {0, 0, 0, 0, 0} +}; +static PyTypeObject __pyx_GeneratorType_type = { + PyVarObject_HEAD_INIT(0, 0) + "generator", + sizeof(__pyx_CoroutineObject), + 0, + (destructor) __Pyx_Coroutine_dealloc, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_FINALIZE, + 0, + (traverseproc) __Pyx_Coroutine_traverse, + 0, + 0, + offsetof(__pyx_CoroutineObject, gi_weakreflist), + 0, + (iternextfunc) __Pyx_Generator_Next, + __pyx_Generator_methods, + __pyx_Generator_memberlist, + __pyx_Generator_getsets, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, +#if CYTHON_USE_TP_FINALIZE + 0, +#else + __Pyx_Coroutine_del, +#endif + 0, +#if CYTHON_USE_TP_FINALIZE + __Pyx_Coroutine_del, +#elif PY_VERSION_HEX >= 0x030400a1 + 0, +#endif +}; +static int __pyx_Generator_init(void) { + __pyx_GeneratorType_type.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + __pyx_GeneratorType_type.tp_iter = PyObject_SelfIter; + __pyx_GeneratorType = __Pyx_FetchCommonType(&__pyx_GeneratorType_type); + if (unlikely(!__pyx_GeneratorType)) { + return -1; + } + return 0; +} + +/* CheckBinaryVersion */ +static int __Pyx_check_binary_version(void) { + char ctversion[4], rtversion[4]; + PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION); + PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion()); + if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) { + char message[200]; + PyOS_snprintf(message, sizeof(message), + "compiletime version %s of module '%.100s' " + "does not match runtime version %s", + ctversion, __Pyx_MODULE_NAME, rtversion); + return PyErr_WarnEx(NULL, message, 1); + } + return 0; +} + +/* InitStrings */ +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { + while (t->p) { + #if PY_MAJOR_VERSION < 3 + if (t->is_unicode) { + *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); + } else if (t->intern) { + *t->p = PyString_InternFromString(t->s); + } else { + *t->p = PyString_FromStringAndSize(t->s, t->n - 1); + } + #else + if (t->is_unicode | t->is_str) { + if (t->intern) { + *t->p = PyUnicode_InternFromString(t->s); + } else if (t->encoding) { + *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); + } else { + *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); + } + } else { + *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); + } + #endif + if (!*t->p) + return -1; + if (PyObject_Hash(*t->p) == -1) + return -1; + ++t; + } + return 0; +} + +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { + return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); +} +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { + Py_ssize_t ignore; + return __Pyx_PyObject_AsStringAndSize(o, &ignore); +} +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +#if !CYTHON_PEP393_ENABLED +static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { + char* defenc_c; + PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); + if (!defenc) return NULL; + defenc_c = PyBytes_AS_STRING(defenc); +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + { + char* end = defenc_c + PyBytes_GET_SIZE(defenc); + char* c; + for (c = defenc_c; c < end; c++) { + if ((unsigned char) (*c) >= 128) { + PyUnicode_AsASCIIString(o); + return NULL; + } + } + } +#endif + *length = PyBytes_GET_SIZE(defenc); + return defenc_c; +} +#else +static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { + if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + if (likely(PyUnicode_IS_ASCII(o))) { + *length = PyUnicode_GET_LENGTH(o); + return PyUnicode_AsUTF8(o); + } else { + PyUnicode_AsASCIIString(o); + return NULL; + } +#else + return PyUnicode_AsUTF8AndSize(o, length); +#endif +} +#endif +#endif +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT + if ( +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + __Pyx_sys_getdefaultencoding_not_ascii && +#endif + PyUnicode_Check(o)) { + return __Pyx_PyUnicode_AsStringAndSize(o, length); + } else +#endif +#if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) + if (PyByteArray_Check(o)) { + *length = PyByteArray_GET_SIZE(o); + return PyByteArray_AS_STRING(o); + } else +#endif + { + char* result; + int r = PyBytes_AsStringAndSize(o, &result, length); + if (unlikely(r < 0)) { + return NULL; + } else { + return result; + } + } +} +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { + int is_true = x == Py_True; + if (is_true | (x == Py_False) | (x == Py_None)) return is_true; + else return PyObject_IsTrue(x); +} +static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) { + int retval; + if (unlikely(!x)) return -1; + retval = __Pyx_PyObject_IsTrue(x); + Py_DECREF(x); + return retval; +} +static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) { +#if PY_MAJOR_VERSION >= 3 + if (PyLong_Check(result)) { + if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, + "__int__ returned non-int (type %.200s). " + "The ability to return an instance of a strict subclass of int " + "is deprecated, and may be removed in a future version of Python.", + Py_TYPE(result)->tp_name)) { + Py_DECREF(result); + return NULL; + } + return result; + } +#endif + PyErr_Format(PyExc_TypeError, + "__%.4s__ returned non-%.4s (type %.200s)", + type_name, type_name, Py_TYPE(result)->tp_name); + Py_DECREF(result); + return NULL; +} +static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { +#if CYTHON_USE_TYPE_SLOTS + PyNumberMethods *m; +#endif + const char *name = NULL; + PyObject *res = NULL; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x) || PyLong_Check(x))) +#else + if (likely(PyLong_Check(x))) +#endif + return __Pyx_NewRef(x); +#if CYTHON_USE_TYPE_SLOTS + m = Py_TYPE(x)->tp_as_number; + #if PY_MAJOR_VERSION < 3 + if (m && m->nb_int) { + name = "int"; + res = m->nb_int(x); + } + else if (m && m->nb_long) { + name = "long"; + res = m->nb_long(x); + } + #else + if (likely(m && m->nb_int)) { + name = "int"; + res = m->nb_int(x); + } + #endif +#else + if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { + res = PyNumber_Int(x); + } +#endif + if (likely(res)) { +#if PY_MAJOR_VERSION < 3 + if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) { +#else + if (unlikely(!PyLong_CheckExact(res))) { +#endif + return __Pyx_PyNumber_IntOrLongWrongResultType(res, name); + } + } + else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_TypeError, + "an integer is required"); + } + return res; +} +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { + Py_ssize_t ival; + PyObject *x; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_CheckExact(b))) { + if (sizeof(Py_ssize_t) >= sizeof(long)) + return PyInt_AS_LONG(b); + else + return PyInt_AsSsize_t(b); + } +#endif + if (likely(PyLong_CheckExact(b))) { + #if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)b)->ob_digit; + const Py_ssize_t size = Py_SIZE(b); + if (likely(__Pyx_sst_abs(size) <= 1)) { + ival = likely(size) ? digits[0] : 0; + if (size == -1) ival = -ival; + return ival; + } else { + switch (size) { + case 2: + if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { + return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -2: + if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case 3: + if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { + return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -3: + if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case 4: + if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { + return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -4: + if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + } + } + #endif + return PyLong_AsSsize_t(b); + } + x = PyNumber_Index(b); + if (!x) return -1; + ival = PyInt_AsSsize_t(x); + Py_DECREF(x); + return ival; +} +static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) { + return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False); +} +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { + return PyInt_FromSize_t(ival); +} + + +#endif /* Py_PYTHON_H */ diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/libev/corecext.cp37-win32.pyd b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/libev/corecext.cp37-win32.pyd new file mode 100644 index 0000000000000000000000000000000000000000..9b87bb3f3b66263d8fb477e4815d96cca660be0e GIT binary patch literal 217600 zcmeFadwf*Yxj(#UauC{2$h>9|!SOH@v zIWjJyoL}`EdTLuz>?v*SIrP+8NU043Nf1=LQ=u)bs5=hSh!kRr&innYwP){S_MRm6 z{NBIb7e1N2_TKAx)^|PYS8!JH_2I7x&lqAD!3^HvU;L_V zf|My_{7coUAUQ;2T=S}Kw|+ZSV}hQ?Q?*{cu1eGTcuoB0Pt!I|)wHD>QnlQ~cm3|0 z@V=_wJ#lVhfhYNQb?}x|LA-O_g-j41^J?IZljI@UtM6HMbMR(O``VRw3Z7aau0dS; z{i_1{t5q~jy9Y0};{C0-ZnDMexcVEn-nML|re%@72ml!+V<6Bf^1El{JzvKwDHF&> z#&bKxyJh)Zh)5Y}kd;=8>nK~iNqGAI>3`e$E=u!t?l=F<701Fy`&z4g{zfep^29=J z{r55aTj7co#j>*=O7(?z=ZJR~b(Uwkwx;?{gi=p*p6Hnk!Gcm$d&0UFEDq}_!94zq z+UhAsg`DMzwMem1iIirOupE@_qrv*ne zj?h0Cp=n*|yazW;_aka^NAMQ?xLeZ#ndfUh{Tb9v{acLY%Ktw(c(9od9#apx!>PW& zZv5z98;w-ww{(QA(2pRSV3HT;;M*O1d%b+C5~9jpdk9#%s?U4|ndwvTp!txuWg2g0 zgR$rhU#|tfP_JLDvJyNSGHy(T9K@HzOZtz2E%s(Cy(ufr2chZj;=c2dMeoN#@96(R ziq1w)z)y*^;7uE&wRAk_D(;BRtli8zeIyXBt3GN8BUK9H56oFR-i0rf5{d)7003Fe zZhZ>b&oAEF+~IvLcTcuVCVCyc26YEwPYyLM4-ZkR|duc*%5Q zDZx?USZXj`Eb>LK!O!dlrqGV}qBjyc+H%U<{C(W0$IpKniuh%9D8#y zm6kPVjVC3Pt_PrVRszpKCBnNsMifXrJHIKFRUnpKfIwiROY4Yb=OO5iW#{6uh>1RQ zEFWdic&`3i2)(5vnBJH=|HUgduggyJMKYWDo883UajW@Tx{AM*LHypjK6{hAWIir0 z<5tK^`f_=>G$1cmEyLx>$I>_ABC55`>*dw8c>}Jk)$Ywt^1kKpnOLkV{U8cDMN84z z_;T~(xa&$^hhO6EN?$MEvdV2VLXEC@w|8h=O;6&UHACGCX*MF$())0~^N1!g(JJ_O zA2`bT^k+zk=0#c)cfF{sNbC0gdSX^#El4|2{$}tzG2K&sqvxJcVv;*; zlBc};9#42zLHV1Z4~jb$FX|M#qMzswpyW_-)2{94T-HWIQ~%r+7zE*WMP20wf~aHS zgrfgpM5H{)h&N+(Rx%V65v zF&~zzQ@;yOVVz`*udDC~{i_H>k0Y|~M@YX3Ke$2e^glvnkZ_Jv7O70rv!sf*QEldC z#X`BUP>$Y%X!GYU>eT;B#t(V|Pa_L@FCTa6pUH>bX6hgDMESVqUHnQlbZemzd(wB) z24Wpn@A#}EI;D-RLu=?{L-@#rza!$ty!qq1!`-phx{K5K zE>e9mQr#D+KJ%j={pfe3R}VmfXIoS7bje~WLSwpqA=GDoqdTyH#z)YK!Pak^{#7^= z6HrE)FSMww0+)xj@rIsTXxjGCF#ESoScg*gg{~LX?(KXxey6`qZ-Z^1K@VOYUX`z{ zzR0NQTT`MJit1xRE8hE18Q6AsABQ2NJuo6%+o8`v;Eh~J>NeHJ;ldS6-emCR2s^2_^q+{h>!OWID z!I7sAY-W9n-r8Dy5@x0lW=2%^6|*eP#IoJEy@mmo3ba-qL!>H3n%>)5eWrN&vEu1x zio45S4vpA86TG9omX|^vu`_e*R88A?#5cM-BJ20*S0b`rt0I)D2#a`DxRM4G0t5b7 zwg-IC%F!SOx*>vCwhvD_Wmtb5lAhnW?Es#4>J6u16lz^zw<}WX(%(nMqdF`UQk|IR>;ebmdne}1Gqf-Sj&^Rh-z1)<#7aB z8Q6qCmqbA8DXPvi`XenHVEb=Zeg9M;bh$`kBgZ9$iuf)8S9T_QF z@RG`<8L3(@w{it9*_D2DW`bkz5SI~nn5KosipnFv5q>!(A_LJ3bfk}> zj#M98eQo22dBuBGs;!F-M$#fHU6GsIk=cNJ_$TZIMXGxt-r&ga%c+XplEpuP$rFX8>pK_ab5cz23m?fS-W%@A2o<;N4SlhVVheY> z6*;PncB;BJZ!@0;&kA?vspl|KntWE=A+-(_yR*1sLV6aWv32a+AG`mWdC&s17 zTJ{Dr+k$u!)8wVIZ4UZ4xZwp+#6(wpdHQnPgjR~X-D1yoig%6Q74A!U5Kd{(=l%5! zFn^~HhChof_EzugEZ*Dy4pl4snft!0z0dxOJ`T=ie#=2z;Khs~-OeN4(K{D+4!Avi zaB(Lf=Ado?q70uw+UPgzcG2-f1G>1gq27!k`obBg9%6>8Ufhrqdj-)%*OJAZ8@`Q% zzJRyWb8Fyh+ZdZ&Ol`6G-`fP z(^u=~i|p4`hN9!lM{h*OnBnYvLqs!rBPpV$SFq)}zz@5;+XZJJ=nL=33a{{ zFGA(Tgz`*;^G4{Kpp)KAWY0f`@J9Jc*0%Gfwe0SrB#QkZIKsVkZjm8wjDB$Qpb|Df2k3PIW0*k??>qC=|p@(h9kp1mNZgeSD;ipXl&E_W& z(syBGZL=#U&Bq4q^ubz{;c#W&IGB5H%Xh#v(DW{pBHITVNDCTs8Jfa;h`X%-j~Y_~ z8~7eNMI=(E?k|MwIz_i01i9$$N+&lqx3B~6hErITCc5h4Iu$rDkbm$ZP|AK}H{xe8 zes=%(utl-#ZlrG+r5=nA^sjSh6~!m9Y#otAFMGm2!~2+2QZa5BU&Bnvp&&`Ea@ z>ZZXrev!Orj=fXTX~|;Rz!=HXFJ$_KgQvf2nCTZLO~0;Q1oJ)NwH2CoJuSfOxzLa! z5T7_GZYmLzE5z+(U6V^F_^!!P{#}!05tAe`Ek7rM0t>lXjt8&70N9;yBLwPJ=-F{5nB0+qfjT!-`v)oacVIAyL#y)H`fxkOZGO{dsU=Cp%m668+<)*${a zGDwDDNi@}DeHqN>z$aOv1~2-@NiFUez-~W=T3TKCU9cDwfS+x4{~HX$r=cBN$a)&g zFN|fcl9nkK$+64WDdyz6VFKtn1@m+8=fA7{1R7t0W5>9?S>hIA>)07__?coY3ePP3pQ ziGxs_{toF(rJ+-uHMHfBH&O}yb;YlO#|~Hk$Q<^jr5Tx61Zm;6=Wh_to~c!EkX+^I zY!O3wb;xPHcnw3axbjcWlg1gAr)L{TW2Jey80)L5tp`X~>_9XlmfZvkDs&dt@z8u* zoo_3nfkkV!PE}I~dE~mORm3pgXxPQzc>zQ%dLQgi9@5P8&xM~Z%gY_jhC>w0&*R^0 zJl-f%$O>0$N?g^hx$$~N9yVw#heBD9&RR%V9K_8C{T&$uHqi-m&`KY4A%{ZA6Z`bg zMN*7Xq_;tKhDfi0gyJIoAsE2^z#WO}!TFAQu!OY?HgX~g{>|C??No)C1wcWYm847^ z@Gl7Y+NeO3?|R4?h*XKcz>L5zae?7@TNQ6R44Oa%^&f;rcY>;k0#RL#U;)OEshLtg zW7mkY&`!@C70+{X1@f%CvNkrLOBSPZ$AGFCP-0ilX$(3WHC)>JrnOZXtU~ZSM}bIr zbOdYQucTlc3KL<}N4H<^Ktj>n^2`-L6B>g)KrFjMma{uL(k~{iko^>TIZ&+g#7m2N z{##Znf~i9ru@k*Bh@oHO08DkWQCER+E_!Lj$6=2R^*;}VT*a|+I*}~``mVYK^E>xU z1gyy}cr-=uZK40O6ZF52`X38j=AiDQW~;^)FqFummp5u?(5nCuROkjKI(Kkc0APyF zws*;%D&);?t0T}~H^oH_uiaF>m zPoD=FhjIbHgFc>glDt!P`O%Ax3x6DHhNnE6a>hhk)e3ZIqZzaGk5s)d3Phj;E`%7P zUdCp5T!Ye~TEZ0Fj#L--tibC!Rv1`lH^Q1|D1d)u)`CPgPdP%ZG|}C97^O>JLcCdr ziu?ws!CUk>ii`fT;eRL|;Z-GC=o?DU0bnG$>HZS2s!Xh?h}4#JRVl}+N;+1K9-m|5 zZKd7M?_aXm>b#)5#6-4Wd7{cAYU!q&(^X}yJ$J)JN9%#bo!~*?T5erLfL<5P;3{U_NoWAH-c#Wfqn!0`0|S&T{(YY(Os% z{RGPafON+Uz-eV2x!=FvF`NAwVMmM7@4Xn?1+`-z{%&{IM5$#B;(k}xL?|n|IZnNa z&r`OY;bXqpb45>NPJR{?X;Fy?m5DVK@CJO5V18BvE>l;v^46=BQdKLZIuyDQ>15mL zKU6x)QIDjJg>}s}4ep{y3JNs5+t(=tD17B_ds{X$SEoYf%IGLZ)f1-Y21wEQ9B+Cd zG(y~)7t4rVa(dz%M0W)zgx9)LR^zD$PcsLSPRp15@_{87=QmP64F3YENvFTTIYUSn zzOT1M&R4_#?cp#ftnEE00Z?89JCp+xktJSaNdE`s&|#2Z2Qe@sa|a(ThmM@_gJ~5Q z9{L2(M6?$w^ICa#&`Tq=LbVW3#s7q~a!|$WJr}(2*;+<$%n~ag7rb@IG9-^?GIEUp zN-8IQ>O}T#xJB?e>l^&&hr?;n2yfx>^(AZ~eWahxi$@zXz%k@VWgM7sHS`m>WTyq>e@8fr7{wwN z^fQ;bDkj&Kr*q^ecyYsAh|a@m?iPJL9PdzWp1S{t+4>DLhnYAuZrh}^Y17yF5w!u2 zo&p<=Z*sb`64IoHnTHY!7L=!NU=n#^-8#^-vx?F=KfG-{*#*bOLTHs^uSCB|fULCe z>pDQ7#5hCbv>XafiKWHv^Dvo{NExHG7}bdd&x?()cdt$br$$R`kI{+AWmO2Th7dwC zQRp1eXjEy_w#7$)`>*oj8{*%%M-dn+~2K@s^+wG+@E=Rl1$v&@+mOTUb(z2XW=pn z2F6IlC=uzu6rU0|x}neRmc47etynx!7MxoX?r@cVwE84w(dM@7^*;I_$XgpdV!9Sj z_||yBi^@L<-Yy<~8Zn@Y`C^5;_|=wEYr(;@VS+p8pF~z~u09zpS)w!x_M*#sVH4tO zqKTLCok1^zaH2f(DM$pP^U-t}lY*HXe%@6MjbGioXn`^|xW@T#d|wKf76Gw6Fhp*; z(lE{%jY&UwJ!AkZtS7>~KX@zxL`_f8hj}v9PV@9_a#gP9s9DzapGIWM9;0K4{qc< zkSB36Xy83(hMtra&DB}2PkK*z|M5v7nB&Lj96Ot1WKjD#Qsm!b_|;r&1FeqOwbkRt!Sg1>9Isw$+egVD+B|_@W$qg@B7>6{UdxeAEW`(Ln@!>xM(X^+)`@gTIfAzq&g1-q3@R z<>u~;-ye{s#SMSV)AsZi(%_V_sYBc>4u~27K8BF!o~^&f&IbF`<(Yi6<}4X!!oqGBe5sOdcuj?}l}D2% z-kPi5hsqN-z_)_E>-3+%{8KroGajZ3V;7|x0g}Vu`BKc(t^*@%qRq8+m8Y|h|or$>& zV{+Bj)X4Fdel%LRe0W&&f){9hDO!hiOC9C!u#fmH}zCJh6JcC<$Km#IbnIHt2L`L zbdeYpxem^vx1|+is2=8Q)?$oxlZ(hC`|^)M*R*Miy+@4SBYn{~>ndC-e6q)1+A5RG#6U$Mcps$GlQ>3CZ zHX(uoS|YF%uScxzK-ibuC$dSr9Z0 z?3F=(TJMP!$FP*|_jHq6POTbKKJ8=I+6LcaTI$dj1s^q|I+a^o^p;FEjAF!!G`K*VW#f*~KsGAtpENfsL z6*DUQxaM}%lu&xc%#tyArMy7H(}5(<7B~9JGmo5yL85cSq^$DvqYRD~m8)^>X#ss( zKIDwaaQ`gBPdrUVL03h?Pn- z*_&jwfso`(j96SI)>dHN4XTh8sVT!HCsLDSYG&9I4oenrED27TQRk3(8cqnHp)NrL zy;S8>p(`DnzH{1^LmUl(WqlETT%KA*x`~iy{LvV+RV;DO=3xau?VnrG> zdbf(d#!3rNG?+S6@?y0F9>_~)JR0qD8#N4OU?NdjQIC{X76wv3kI}?vFY9m|9{mf9 zw_w(`HX-}Wd&Y0r^AA2v>u^n*CJUY)l@uD9iXF2-q z=Sd@=x+9*>hmP%Mh2b(Vx!$20cbwALk$)H=@pc26@P7RXZ?m+5MxWw5*>h-^9eDCj z{mb1K{VKW`SgCLXEXsGTyudF#V2p0Vm7dnx4DsNqSW zx$+^ry8yn%c!w4PmJ5jyIhI5`^AeXtFjJj)_&Tm)4=fSh{D<|%EN+a~vyqy`{?rje z0X>l6W%aSrC!v4P%cD{O(P_E=TzlGZau(Ys_336?^$F_fLVHisUp0+dl_3YwFyL-f za7+94?{9fEl+(5vl_`*Kh{_zJM{{+z3ts7MC#gKa5r(H7yT_wCaQAuws|Sb|?r314Co$P4;mTIg)_8ugTc>7Zu@ld6)s$Ae7y0%Ze|%VKhzmamJ?+>dcG zrK%#0MC0P>!QQWg`S;|N=~7!|>cv_RRHiFV$jX#1SM&V8T$5tens}adCthX)^6NA6 zD~s5TB5sma$ucl)$DmHLQ3}O-VP+@PxVWn7)d^E^-PQ7nxA`k*9Z%Kxn#8!JD4`Ih z#<>s*J!apjslKMr*aqYN{t-(SL;2u;Eq0eLaeG_l%Vre|MX+=~I41lFmZV}J*xNFZ z&+C2S1u@mPvnO?@o*Mr1i13jS<=x(vOYv^*Z}U+Ir*`E9$DZ0%C7y53!L7G?S6Xk> zE$+>iw;rz9P zhd=o=crDg~T{kHubbk1g&w`geQj>b!q|{I*bCmN)P1<#n(t^GV_G10%-jpRRdl#d# zy8z1sF~AbP5#yFa=;&&GjCU=&LX!~u2ZK99Uv5m5;{;Ys_clMnS)Z5mv#~8JNnej^ z#FTfmAM?wyYk}4)-l^ylca?~#Wul=1?kRg4IT#Gi?V74QnW<{jcd8ooJswPh2BGp| zh#lST)L5#RSt6E{iTf%dca=n@mPHyqPlN8%&|&5}J0JN+1S(AQDwZ zi|Y$cl#Pf-GBHU)ZzJ1i&4bl`Y0d&qJ_}=bVn=FHptb=KXhTqsTPW$`k{ zh|x675PLA@QVUZP-U-7HI$=5(K5ugmD7e7j4A^@woC5L@!d?D?xB2&Y5WYW43tk~6 z`oc$+RxAxwU`ix~Svx;Tjkq4^c^=X0VsD5MFg|i@+HI1hlPpc# zofrNlMo>r1LaaF$Fh{&ezAaV3k+2l$ViKcF$}8^;T`5M);@IK_=0drU_oM2Zfpz0d zV4VcaBrprn)%S_!n%zR%a(ro$m z#Pc0m)N)GZ`P?x2Pk-{ZoQEvW0=SaEdMH^GQf0UVVb$P5fX0w8jDEaoAx@D};J`r5 zL~~GZ=Gai4e|CHPllqRDHlCl-jloi;2*G4;WP2aZATICPG6Xx%}g$a|J@kg9@LmUjlZ5i`3A2@^#}@Laaq%}u!H2nziiL8JCJO-0xu%xm&a%_Z6^VyLiT=ODsG1D*3!^Ac0U1TgC`63vlfM_FF zPvF=h4_hjWIr4+-bb?(D>u487MKK1$AL?MP3ORN`5uJ+|?0r+_%kjk$Wtif_4g19n z=qSghWH9`nh9P{jLBp(z2OxT;Vrbsbu(_g<%LOt0a9mBb6a}Zs>4z6F)dK5)$G5hA z)g#Wvq|&nZWK!j6V=}1(tko3H`NkAaa4dYkbFl?3ddXthp<2`_=XqZglj( zi6-w+HceE!M|zJqyQ| zR=Qv&@cypwDvuVt4NG|bvX9dP*!UBg8gC|pl_HZ<3$bfpBBvRKx+4g~){UnyU+jn7ak95rzbk;Sd)M3nhpME)#hK5sov3pe)Hn4mkMcl(z%Q;VoC9d*uE^ziX z{|AW6$N7<9=<3t27I*CY;KB(oN9a(DJ^=CViKb%-Oxm9Escvt01LBG)4>KjmQ7kAy z-Fz_o0CIT0oNx|KYB_cP^&$-!FKeJ&WX~?GS4{R`+@5kGMme3r+^my^gifAZG;3sg zKwR-samVRbcJ`QV4CSpd#QY;`<@Co;C;x5F|-zP$F~n4!R##AK479>`R4uF z2erijy-5HPu63qXU~mj$fO2c)!3R$PDHx@0p<&=CLnVgN1#^9DupP`s9 z!P+>3{}m`4QRUv^#w2nFN{6qSJMKSA5_t5VyJRAKDjQU`p>au#ERHRP81O2VCf;n+ z#LJPz9(}xm-q1^SNJnEt#~d5(~5_eIuv^w;T6Z~+rrf>uyg(lHJi8*UNkNPo$bk|Z_3(zs zWHgip`iCPQ`h+8BYtvijzZA`Y7u}kB1Gv@tCd~7#$%wtRrz(pJi!O}UP3%mQV@Op- zJ&HR781l77M`VAFeW8!A*79wbV?!4%W?O?2^VBt_q9|prS^rll0=MiGn))$M)Vndc zE_Q~Gv{p6&V5o+)Ao9rOdzS0e&O8XA145|roZ6Y%iY6&|76$cF>-@1-!@GS3zxch! zxNpEQA*x7>39?CS>%?0q>z5)+JaDMA$W&h}L+(#v$>_tHyu!LnYInT2;J?x%V%9~V z3M1WT(?x*nekYj*Y|S9$Cw`9+4fkAe6;am1 zR>6aZ@9tv(#NMF7`3;5ht<4QQlK^^@QaDN_yw)Q{{0TMgP&S1E z-zP`Br7A7g;AhaV=HrF zE3;H&gwBmH{iuXcl^RR3&H3eZ%jyLGYpr6laXUM5jn#}Um8vsj#-FlEV}q|{B${+ATqfnvB7zA5^Bep zxpUg)K#Q-xU1i;x7w-IMoJ*e_DPm z{-)ut2x(qbUhU?2A@ovkHiO#TFz@XFCJj1dyw<<4n^Ohe$fHo&wuLR&8q2jJUFqBK z3xHT3pkXoR>RMQ!N`lp}&;WyI;Yt>l7Cc{M^L<^clmy$|kh3nJ#}L2BWPB|2YW{FC z2vTssk7NL*-j>671VO2l15yfTP>gN3apY5ATj66=`NFzuGfjrsq2El02*&V|nUpblfP=8uLKa^m3mG}^Gz%KTAY2IviEgH951!ed zl0zOi1h$dZq~wJA;FLcj<$E}0#Mm6%O?qRF`gJKVP7w|Q{=a4Z!9d^W$GFs>aeu+M z_ap9vaqF-dCO9cpx=t=oc#;bnj8u);!@)T{OHN-T?Cd5;iDMmu=d+yzpPhk(4kCws z94n)=0aRa6DF=F)b+{l{b|c-#Au_&$9G?b9{VQ{a%J@#kZDQPaW)2m%lX2%T?zxDo ze+?CtgJqNW0kc)KtaGq7$k9v_%Ml! zn4Rp$Ar2*tdc7MHDHO2MN41L=ElPw-gQZ0xp&BTsYShnYsH6rZvS#3&q#(-Crd z822n3n_vgm3g9=i;vI6?^~peCIBA7N@-9in7zvB)9sRUo=f{>-7=SIh_el39%Fz)p zG@(RV3fj~`3&Y~rLynul@pEYck1JJG;uz_l?;Du;!8O4m{ws+uV|KES^wWgrFttC3 zCRp?zlK#ERl54_JRE$A1!Qym+oYsJoqhJTugz=^@{zfj_aLm?F_Q4`KO%j)pu*lxu zPZNIqkxdgUx<1nFzcdM8k-Y^uhrd1h6wcpDV*M><{~)vPgITf~MQ(%0(c<(OIh7`Z z)i}af@O6O2i-7>Fd$C!mt4(pH+yG{`AqQ>Cpw_d{f4b2lgOQZBXK3=|1BNix+P2kv z!VrdC+m5jDlyMls&bGGY^swX;h9VPvZ5vH0h9VQQ+SZv*7>Z2HiIr}3tW`$swD9H- zZ&`k_GLha(+d3p%KG7GtqHVnlWrZ$m+kz0>+L72(%U~3(K`qkOt6>tOIqIgJgaN+R zzYh~JNd4fvg{qtv5KsY|ne2ne0@glH21mKt*8p$D9mlv2T#^Jlde+=${F46a2TYrz zFpeID#V?QiZUjF^ooY;vl|BPqhnbv4Ul9EdEWircP+dYU?_Qh)74XdZbzH&iUYG^u zQnL9i*f@e|>1g99U65me2LyG~NiQduV!eXgUO^$W@eC)Cc?^XT$>uLNMbqEH5?-8Y zb2q*J=+`mibimk}ZP)g4lk1ns^#PNsj&$83rr!A1>(b@PTmG229O6B(_A z-3JPNcqlC5=_LMBo)d}`$YUY;$M8hQ8Jhp0GQ=G zs(lE_%rn6(Bfm}@$py&-hbI|}_*N3ctS!jY;MShPRmy&579vF-GnYAoUhNxak<4{QwZG!qYkL&#^biRW8nd6&X7Z+I2l zB5o$}f%6^ZgMCB5vrghk9SYA96VJnB`KPFqPtox3Si}($S0%yYBA)dUk83DAOHDlM z$#SN`;~HMgvWOog@z(R4<>Mxv4HA!gC_Fctc>a|ve+So)jpp!dphf&`66Ynsqon}P z;}VaCF~30@h_9J={*5fZsPG&do*A@=H&YdZc`` z;gy#~{5=wDPIwyA0Om=gl7_z_z}#Yj*+hP4DKPtor_2`d4@tc8TnFJaeg-g`kP60G zhjKr^VS@P)`L*a$GAD;uQWo)#N&Mb9PGC|2<|(8C_hKl?1WYhLCBHr_3xXQw4o{6O z;-^VG-w{k6z-&P(c|(I~G{O8g`Q5I-EFT^ii})8L-k76Y%7$bP53e>^#2qBQ)DaBr-ZrF?g1;fE_MIk}PV)P*0#i1;cHAO< zp2Qn*UaUix0YU+u9Y_fOu!LezJA4=7D8HhcEPsq0;1JHd;gys{`~r#HN$~jCPIV9s zT+$)%tUx4%=S8wSSK&E0yuz}GUncP?90=hgpFHB(E%D?Hh39S)&#Pql@Hi^N@$X4I&k2vntU~7W_psT3o?~wa>;0|Sk(~Viv?lI_#>%}&iv(7an7&_8QlRqH8=?aV-3mv*| zWf31E@qc+8z%;U{+K*K7@Ha%YikM(NB)^U$n23(AuHvZ)n5@S#VY@^vx{pYA8E{1I z#`;VYXCoV@1K=wgCrv)XDD6NX#vtJ%X7YcR$&bMa3kk{N(A1E_%$h}chLjsXNdPOT z6Ks%P2WQzJY4TYz0Kx>2ek0g?#Q^}e0y_b)C`XXeYXCTddH6=!*@NIL8zHTY&yoRH zZvya<&2yP{3Eig$7LYOmN(y1Mfq?~a zR6;<5r^(03Fg#{rxQ3ic9WY=|iBmyXl*Ob>H!$Qu6(I-N$mtRT8ab_vkCS28U}C5s zr(cY=%c0B}gGG5gDIWr*lmkp0Fvy1On8bjF4RXNaWElR{#4wedu5!SDlZc(G0%>s^d;IUZ_Cc&bbL#j1Qf2F4_ z2MINfLW>Cc_XtZOm5Syn^^_g=Nnck@m}=#iCSBB-UdGhYS_r8#^jg7^yX$6-03I zqI{blsl_xlDW*hfaoRCMRgqdAyNnRdrp#5LvPf-S@m_?v3<`gR_$!Fa%P&3@D}9|+ z1h=YDLWpanxMqrLsj3E@47TvEA^v|G>Ci6dAN&Si-Qh7Ywg&PEQ{YV`-~KilNc|r_ zK^ty}dk~6mk>XOP1ZT%eeaMo%jlEQ^hblhRZw;4)poRRNCBMXTx20J-38?-2>16oW zy;mk>9r?Wvx5ZQ;OjNPxZF#b29wE)Oz<_n*ZJa@nCcO_l4U^7ik(zj;mJGyqOc38D zL$-(}2%~jnU9thO=$;^5_Xq%)?`h)%LZFE}oAb}$!XWgTkFA=N49kCzPA-!BK6wVg zGZ71Iiw%oKw~2HW29^!7Rzn)VBFh6oVBzDTv3%FW@)PpZGwfJsYi(F8x}TA5E9fW} zP9Fr=+5?M=x`80D@bS=Co;0yML!JvAu(0j1VX^3*C0)LOg|i0%7BsN9i3LGm;p3sP ze9y%4JMuh`ZkG$&VjC8VZYSwBf{t?GW4vAjW^+fcrVSm>qMuvm0&k**1JQeR}t zTqUu{<0=uPz6@xYlhvb5CYB@QS?GX;E~^cTMfVrdoy2e-v2f-fpfyP>IV>XtfrXEU zmP;Grt2!Me&rRT&C>KZX-J&~Ax`2U&vj%9X<#2y4u^)OLu+kO_L1^sP*NWAWL<`th0f+l3>f0qSqRlfsd16c*?}!A*a)zN|Xb>Hsd4*i*gJpdFCcX_0)9B-PkP)W$LXMlRG~fE$XG->B?@w}mIxtMn|lp$x>Xwgrif+nW&+ zHp6){E)1LV3s_(07ic1!U!Waxe&M`X9;o0EI8*RrBo2Frv4zEP69-tq3^-9>lR&Z; zs4xx`$pi?s@-}yKq>(57{SE`{ZH7OFdI9w5h~^C82a?`DLizy3c+i~ z*Io=y9_K4F1n)jeh2Zh$s1SMqxhjO7L7obMU%m>}MrsRGC=cHrQlT7t1xbana8|tv zxu0{s3KlZl%bHtg0x+0M~jNUfi1ff&AE;Tw~R7zjC0(>3$BhrG<^GKOxNE z*c@oJ_`ak=m{*!jG115vabimw^BAlyf? zFFHZMS6-UG-QO-6X32(On<>Qy$Sfa%YdZkY4X{bP;(&j7CKYav$y@Za=D=?-`dfyo z7{albg~{v*xPtN!3@^+W55eg945=CVp@E6g50?y4Kb}V8XXr;I!_<$BRD@fw`J3w- zdDBkH0AK6Ry`c2Nv83D0oIOG?H$s<0HlahL}&gXMZ}#dXbAN*|edd7K>A0zTl#g{%X>T(0`O zFz1jr{QknfY%as`Bob%z1OBHl#e|H6{|cvusF&UdTPI0xxED5w+a|Kz*e`_>EU+U~-??3G=4@UC8Sz2!s|^kM4y*#l-n268zMg~YJi1-_ zH`<{=yL~;MBBnjtGC7-z-M@I~?;8!tDYHP{L|%GMpfa>|_bUvBWnnb2Fvj#7{IoGR zL^9+kj*NFX}R?6nyKrR+8u5p+fv zFHMtpMIQGs(G$6!`d|ATr4HEOc9Y`Pi^xiGPeTDLwT6lnLDi<=>Zji7XP|%3>)reu z#1y&BS#DqM8IN`KHX{a#9Gl|VwE;f8b8W!bezF%ujxV~>SEC$O%t(bPZ$hYdIzvH( ziezXNLQALdSph;vZe*wsA-@di7p3`{YWVCJLYfTq;cZhjpPfM{PlldCXwwuv+k#M) z3>`(NV=|xV2rWe@R{FSXQgU#AU=r_XhP%>palb;|Q)l80nyoqf4_CaIxpo>h(#a=%eNN?@@1n`5SXI~jcj{}ko>dNR9VMZbg5xrW15kK`voMCMZH$Y%b;IHm?q zFMbXN?3uB}+_860)2eJ|h)FD0h|btbzDhOAR`mN2-D;p)aF}KhXaUdLaybH~O-1@W z=cqTK>&>Umr*p&)W5JzI)sd==(j612>M?hs%KviF%uNAnQ1sZ5f7R01`X*62F?lb9eq7k+8eE z8Ig?kCwMQuY`h-)0vZlzzz1&j>1$aq9P3;4RlIZKaUd)H?rY||>+vp^?+W7YYRq>R zW5}S0?<(T&t~B3e@cRx9-?WdPrN{i^uow77KJj+{?+DdNx~aac)95=JD+NW7#~k3Mat%ahx7QnH#av z4`RI}^GOCiiG{K@^U)={BH4U`PiYmPtR|%MVaPo}J`5gL<-QTp?RQufQZf(vVP^3! z@cLg7B|8^dfs^cSl1OWVjprEifQ2B{J*v~0k3RUS|}$R{0m{#PZxY!~p4fK9_0C1V8e<5$%Mg+_Ec&F^y%uv7=<$JD_O_s4?)GAAu*08$H+v`s7MoEK>Lgj4Op`RDlb+tQxcL1=ws=u zbFj!j3y1m`{?IwVum95&gnAL`_y`q|$N`34M`*(yh7Ka+-_FosgqHrwIeYh+*_)RDAzZly7?8aZUR3s$BB-**kjN$~ zk@+OTdfj(z*|T^rO5iQChf{;3=a8&;E%L>QIXUThIh;`Cn zb2%>x=SBn-PKIO}vC>}I4@id7N+6VwfWn#6%OZaqWkST8H{#X_XQhdARRSC6GiZRb zgcpT#DT0PRBNSj7m}ZgvhGaOc1lA-Zpl}8-m4Y*WP~l`Kz%;NcYEYb30#76)pm5fXlsI9M$Zc~sZk^=$fQfTs0vp&R&;aK$ zUX(mHAgFLM6kr;$(!N0(MJs{tB_yD5t~x>e^g(yXZF3)Pop3&E;@p(LCS2+MSnB8F zAT@AyAgFLM6kr;$Qcissr@=Wi-c|xXN=QKA3}7Y@^&LFOZL=;X2JQ9e`zFpU32ac0 zK*M^(i<0M71Qkw(0!#zvcnn(ZRsugyNI>B{2(9c&uV6g_x6Sk5csR*(uZeSO0-JDU z05rgP5}XX2d3d65G8AAM7?2#)E?EiuDj|VDAEpqy(&s>wl959zWUWm8bpmm?avi!1 zK$pdfl42Et3LQgB7Q@^j`%ESN9in)rBC$V_crQQZzBzs(4g5a2lM0jl92PbD<^5^& zn^s6K!x$tV1+dZUF*+{y`9V20FNZ?{x88U^n(x2Rm}b4_Sw47wv2qPOcyD#al}`qL zNMp}QCX4NWC8#N)be_q1@-Y>#2sio^dj>#HH*a1Hb ziT5Xb5+fgquq%PEyC30hJK=GYa9;x97L;>5#e;UJji$r#asuI2=vSQZNju?pO~Tg_ z2;DHwal);3!cR@Yw-N}oeo(XQgd@#5b0~o@*iSgkcEbNO3ICKp$m6QwP&e2KFGu04 z;&>;4kZ1M92_Lr;a^y@AzMnu?(l3uY?1WdCgwX^-x*_otdFot(=5U}xrTAe2;o*Kz z_uC1_n}i<^AngCC+&~i|#Y(w*P?T;(U5u3;h2)HH=cbw8&V^c6Y}V{)kX(T~oji?Z znTFaFn4J42J9iQ)?w=&*&SfX@H7d!uciXvJ>s9`doIBTÜ<=f2L)orDVer^&f< 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

&|7a-*eZxTgW8`+#~LB_cvy~8u_G&*W7FA z-S2fF0v_{*d!xxGuXwMqDi(MjcpJQ}-Y#z+WAUSx;O8f=l=Ex(lJEMB{M-Dy{kCM7 z-hO}oDWc^$;$^D;w!hF{?yvPf_CNJ^k#COrr-+(_Ab(IKC>PX=BBx<+Ptcb9(=B*} zRW>*n9*hm926KY>!O~z&@M*9;_?D{csHWCdRkfkoOnpFo zkZka{I$52ezNs#y>Ks&0sy~zS@@l2D3R-3Io}t~QrD|QZN3|EVH?_IiVr`XnK+D!n zYQJmw^g6n)HzXsr&^zgm=#S}x^%45>`XqgZK1W}ouhci_TlL-gxB3tIG5wsL$Eab{ zF?1s|ZZ}#O9gVI=Ph*Jjv@ynb$(U)pYkX+@X8d8~GmD$L>6v#>vqqU?%@@sS<~nni zxz9Xc{zw+OWG0ez>sXRySSi+BR!gc_XRD``W=*hWT5nnNt>xB6>oaSI^)2!Fqjko* zp7mGHR&C$D)4tbkYj?9Bw$toE_AGmey*#RSd+e|6@9k6e8T&Uo(YeL(SgB2&dz{Wr zce3~sQ4~M#ta3Ix+nk-wH_l1tjPsk5-!1HxbZ>B*k-yrzo!v*=C*5JJ-k03T?rZKG zcbEIUn@x5<=N9yed1bt0?9{Ehxre>=7Fx}bcJ6jTlB242uGXcn}LBDiPp zO7K=NFIW<+4z?1vdx_hl!KvVUP&+h3FKie#4?B<%dxZVMC&HoOnDBjS>eg_3xIa7| zMJ>4{Ef!lr%qB|LNyVj#(rwax)YmRjFKMteTpBG+kY1t2zAb$z9U)?Wk}gO^O^dP*(O#8%7f+M@>t?^raVVpCciI#C~qcS3n)dDQc4o>s!(+sDYq$iD{aZJ6O>n! z>B`&6`^tyP$I2JP?SA66v|2^2q1IK6DCf5LGh%0`3y9bEK}kE*FV%0=V``3iR*h-( zG*?T}nh>#_w1>1_TDta>_Ov!mTd8f*KGSw+Uu!3{pUHLk^g?^`gy z(lhjD^cVG)^;h+`^qthdBV_hp^#VpwqqI@ksBYYBXhvtUVn1V$F~XQ&OfhCe`EfZo z>ojqjXcnRZR5x!nC8Dzchg@a~EtFl#{DymtHtlONX2YL_&sX_N3Ef^Y%38q9j_x)gfuroLooC)%VMZ-$uS`*CEG;9<03Dd(- z;dt`x;&6GmhS=R39t?k^x)Zk<>^UQD^Ae?F$*T*brPBM-dg%l)dQQqiMy)R2ENgNr zxxL(3?k)F|2gxI-l^@C*z~VdQA3#gz;rHof*5}_X{Ss<#f zlpn~d1=XTzY4t|+7PYZ@m)b$?taexXs>9U@>MQDW^=);f`h~hr%~ns4S1+o?v}Elj zt&XM>qxTb`{j?{vq1qU*ToKKcM&5hv;MV z@kHqB~B6pU+^Zl zaqB7Td26<{fV#iY+G`!V5}Bp!+O}dhu-=Z@*`MY=2HxJ#PO5CdlKI za4LcdbSHG0fq_oDFVY_@@ZJUIe(e1~B|qa`@(PjpD*M&_+P>#E@SFPg_?`U6h@GeW zQT`gT-cditzvSl)t_w0YU`)I&;> z21!$-*QLeMd(vv@6KOY9`bX)sbY99US0k1jIg}gAcT=Ccfwl)lId2{ndcC|!-Ub58 zmQTtT`R)OYC&v(&xncWNH3sCJ9yX}4;3(4TbI9@hqI6Nsf5p!v_W z-P(TbFqr?= zX67TGRUn@!WV0q_3$vZs-Rx!dHAk8+5iN_&9p=~OVe^`QiD=Q_G8*>ORa{hcSBks)|b3IPd)=a1EIN%%-e=wp?`!V_ zIV=yjGKK1U2far({}F$XKZ2fPjlbUi%>SDF^^F&XwPl*O0Zg%U{ah$cN@I*DfZO|>Lc~%^ojaw`aAj}eHmEs19I9XeVe{r-%FH! zN1PtlbM&+NZ+bza7#XgLaSPZn1?-q=v?gjFCT^c1ZeK7a(y6>{EHzd~e8+YekHba| zJxhMGC=p!MtZCLW)hiXbo%s+^oMsN7vmI?dZ%#H}Hy4om)|y+)&q0}AUCDoWtYUQb z6|Ebss#lQaZB}dReyfM|m^F}G__Q_NdYO9t4xP{{YaPAN7P8_uRyKL@l9kUcVP9`o zwr_$Dux0G9+ z9;=!wyQbT~z5NO{?dCr0rn^JnZpKsBXVZJFbU&oBe@bot);;R}+`BV$6rD(Cf3mx{vQ9J|D%7Fl@tq#1!aOtLCrv8 zMKu8pvfU+GC{g!F%XR4ykc$u&T?j@*QN--?XigN#2^9!+01S$s+got*XQfY^|ksZ zdKReSh<=)N7Xw+8X5G~R`8p9RAdtnQth*t`C|2EcV~(-FSONb1-1yS?&d4@?GJZGO znzKO?8(ByBV2Ub7%%Z3e%cu;;t(cw9E(}jr+rHa=2qfDVB>MvSeVbj?=>RX1?mSII zZ*)GV$NJ6r!^!6sCze~d_raD8ai4Wxa3{LcVa>jAe{@g575(9s_MY=z^d@`Ly*Gk| z!Lndwuz{XOuwxyB{$o--bWH8^+e+zk@f)O9YrwD0O7^(_qaq=xTOI z2bt~C^7YK=6nVNlTV6;d|4A;TG$f-wPhUNidc8*3plqQ>`HA`ZL#d+HQx$4;L$x)y zZNc|QC}f?pEG#PaV0oeNAg9R#(Sar>0YwU63W zffdy?%nT=nQ^VQxhdbdjeiL;n3y96w<&);au&$6klD0`6bxH6~-59f%& zq~O9|qatlk55Y^EQ3H_9o!Wg7Z`oHHMg5toy`e48mTD`sPeIOmwePgE5rWzu=R64wV`dmi44&yrcCKXvkl;x!!Vsc!Ez>ned}1d)qs(2 zZMBE%>}L&$IP$lxrLdgGt!Cu&_AtFwox8}QpSoG@ZaAznZe{v=$uqnZ_^Why-0|Ma z^!M+QC69ZjyIvsMJDgD?LD#Is_uURenMqPab+z{(xTQkbFiiuT*EW zTPS^r+UdmV^<e(By0CEc%np>UMPx`Q()PJG@VIt+pnkEi|FpKS0ci zTEARdPyhS{i1I7g!W_o<0v&V-U86hk^b~SQGrc+E+){6&cK~H})qCi@^ws*u`ZtXF zQT=C_p8`fn;|36CeZw;vpi;CmdQrO<7^O|iTu$}11C)XZDSA7h+M@ZkG!s$bFD7K5Gf+}qr) zFpkf|#~h=FElmg8(7WBc*X!U7q<@|6y+!x>p_k?DrVBYAbs^>bn|(E^Vk2P?C&9eT zf<;^m=e)t+0`L3{6)Q0)2!B|Dx>W%dCON1c)PjkTs9;vmHR#R!rPH5G3RVRhBOYdd zkOLwtA0~xW!@6M#Nbo7tjM3qX;hW*7Xd3&&@8DlpV>#?QW{zXh4N^_1E?LThFMLEA z7;!ISQIl3l8{rGL(~0DuDHWCL$};SA1NmM#O&)^2Ay~rM;KIFdgeQrFOL95oMmWN* zRGtwqgA0{q%1Tz;KBcHC(X);u3ciOw$)|~0BKW>u)Q~}1hW4?xm3eQ(yw0XBWb3E& zU-WWD5_8xbCS|MGpJK%CgEt{Xnu^ojg|8mS8!=+_q$9d(urlWj}4dVZRN-vD#i|e`4>3 zWB$>;U{`Q%bgDV^oG#9@%=eq9Q(M76qE=La!)WL>cYC;xQ7@i`VP5Ti0pc&sdS{z9EY;7hS@C`lnPo0T~J)ogQu9qXM;tk3J1aT z7lLx(4Ph17Un9cvPcws=)R*Pq>Tm-b+Me+1@CdWW@1bB0>w@PsaE2$P!233nnoAE$ z{iGovjhC6nx8QqklIy_nwggS|21BfYBg>YrQ_3r~&;+|FeUv52DrG%f*bmB&XgI$r ziIF~4QLV0~Qg8a9Qw^gloC7X+7dC8@x{c1ToR-8YZbZ##&RlkfyX^zfJAmq#xAt8O32{+Zzuuwb!PYOsA-rQOfNa&8j*R3o_7=5A`# z(M^V#`q2H%P4I5?YJ1JRo~-84WZRFu&%ILM&}y&gIdulj)n5 z>ubodhsdv`=#3hJ&c-og$BbWLBa51)%<^Vsv!6LU>U3TbKc19 z+{U12&5YFIZ=4+G7nsF-Ah*u+9)0M;2g8o9a@V;#+(TfuORh}@?gtN^fl|B}U1uj1 zGLd<^lNo#2e}lPtpNzX6)#j9cG2(qn1vf?t-(@XyQt(>vMld&cKllLbvMneSk znjBU~FRmL(kuuXa92h=NSFoJ<+XV)UCG&d@n7=xbfogmY_^&5x@(J+YI@s(B%$trv ze>dFVP?*8@0G9li+8%nM=_cZRW8Jm9wk$J}it- zKuXyanY$_WTzdPOL!CoP1HetM?o}S z_e=e$fy3y~mcZ#Af`uz1SCKurgZz*@mwNY|{42ThX2oGWbwMP`iPFo&l)~miBdKY8e%9J!>rolzC3QfRd2Nj1^(d%AkWK!P-{WYN3XS zRoFr6Oit|!12TizTcdqKjohW>(F^Jo^-8d8x9CmaYg?cr%#2j9PtXy5iqx-i%wi+* z>T||;)Pvb@ZC_nkr-G$0;9>{j(io2BHN#v*2elOyc|Y2FIV;JMEjLmKGOZ~Q-?o_A zxhG=QiqK8nVBcfkXHT$SjTo~fRLbA&0!|U96k4nV|9>C7RTrn1lL7BP$N8Aq{~GT9 zxTBL%?{XgiA3g3q<-QuR0>9x!sO6bn1MeR1KJOv4swb$H3(=>xf@8n-YWYf}vUVW` zdZWre;m`M%`rFV|PoYfT8uTTLX5vy<9(+R2el$pAJxbxdVJEbvH^TYhuVPM9*w@UQ z=9NmIE>)7MNp)C>LJu7e+d7-BVkeCKuhJhkS`{sdv=h{$eDU#mJ&b)V$heXVjdD=2TShh2~!K8?tDEbzPK2 zb-J`W&~aMRE5th@)}rJHJ~YcZ5C2&lMyQ@`f?V&9vgp(HczY_&fVrqQ8$qyQwyHX{ zVKxWS$IXc5>01=@;_x_4+-K0tC(!%Oa^H@;0qfmuWYWWA(zEUz%v1+@yI$ndsS%!C z!n)0ZoB0ETQy&)d-iV3mj`v2)*ihJ*DJbBT139=m=o$16hTyz;E_gFo5WGh=T_0?w z6Fd^!7xpB34hx@)^cFh6)P&e9<}FbwCY52%G~7*nKr>&!lKf2OtSc+>U7(qM;Lz8Z zrG=65w@&_y8Tv{-Ku>r=&I3ljK)g+Q+*dK;xGCi zdNRth(49LP>2!cIKs4K7ECgRs&a8vle6M*wy!Ke;b~ZTX8*t2dvlvwm)UX_d9B!CiZ-xclv1RKv;kTOiaU_DMSd?yelppDJY5lJ505ecoWU7J@=I zyFPhUtf+_K(q6*VvN+N{KJ~VHDXgTy;La`n5x-PW5iPfC@C5mB6dr`}sJV+-OCLtL za%ZqVh=s+%(r6piK%imRBzz}ahMutjY;qt%p0Q4s*H$ufb1VJfM7s2i(r5S!j^Qo1 z3AEWAonkaAXlc};UqtOHiY9w~w0ca%BYU=?y1k<;R+iJ5@54cGL^-Kk7x|)YRBb9; z6ZKBD3%v0=>LT?${3Kh*n-|d|3gR26LErc=Tt|QA<|XX|c;U~ zRW|^yz%%+Px{6&eAwTGnVKYC?jJwdU+R>dKF$$Sw&1AIH0Ib=}Qb;kDwA1_DlE` z&^SY!C(ZqKbP(NGUyJ-@C)ZlVh6lmvq* z=I{=Y6Vv#;Hmt3ok%w&({lPL^gU9Ic&f;GyLyvbin&nU!mf7+G=5Cd|JL3IMqFJ6t zVJZ)wGMzd5TibwZIr{H#fCY@k#@(>(1B?tRS0?!KOXCMTg*mu2ih(b?fG`I! zGq0I*=mN@F$yQVAZmTVfNhZCX;QdyzW{z5g;Ka+*0klBD?gIC{*nWx}w&wVH~Mwy-oy;_ zgHOruo1?~b3LXlE1<$a0CZP*13)V)u;4XT%3gL~cn|kel}<|ej4swVnf8+@HlvqnCKx7~~P?mN_#U%?m!z!#N474<>&FM|YUq5-d=H_L)& zIiOwA>cg)%a4Q{HFFo{Gkw%hWNUV{&StA4RAWSsgGuFeq<~K{29dOCagT>k%Ib;Nb zRhzXT(ET0Eg+PUmqR*`ZGklFIcMMhT94dvFlj~6_n#DQxI@w)u?e)ST(+}_7FlyB6 z%+&@~&klH&lPDB+5~ycmuWTn43f8is6j8k)B+_7t* z=ev=BxH_5kCzh>gj6>R<|xB+)iw+_q4;WA^Ww{4XN zmELG;Ps3a;jNB^QaRPj&B&jvkuGFh%)hTr1`(P{;tsx!wJ*>L+FqUcXXoDlv|J9%C zt~97W)Ni9|b&1?l^XTW!z`I|M*Q9ZzZ+%3a+KX~8xJseP<_GhOtoVreg!!~N4kh*t z^JAE^FU@aZE`K-kkPVw!BdljxcPp)3@Mejuw=T?QU+UD8uqm0S^V7f_i$I7%M-@DZ zioVp58SLW>r#pC&8QkND*>jk=ZgB1saDV)Siz&g&?-gcE3Vo<9^OeGUO^w_iiEHIzBP8JaP~esuk`X)m578NXgl2lyFNag90hR4Bkj86Kzg84=v=Y9K6jYqsand~n z&d3ZWMfy!ncn0);LCo2V1Tk%~{C{fm-6Fkas5DM`QJRd)W4n|nUndvGF(*^qe5%_s zaM6458dX+mD0P&(;G28H-cO~P9mWZ%!qdN~zD0kwlX*Iig3^u|5>AZKc!gd>L4Qk| z539Ud+lbTcIE?2R?HpZNOiu*m7lHXKqgQ}mzUs~BM$Q!eq388!cr)IjgF6JPU%{wk z)IzUp3RgA)FUG6PV-fW9I=C-dqNb&T|Bq})y)h7`sxnR%1RGr1n*F#4#HRdhWn-?00!#g*G7esHFBHWEZ+`4{8O-5Q&5Q)7^~ncKQs1` zH%po~Fdwze`t)9|*&0+YTv{8YcbSXovWAi0j*GW2`LCi|*{$K$aof7@;&DBK%e$CY!K)HwyMx|gG=a0Q z&DTdPRVu6HQGW>D=6PrWtLdeW`6kGrExv*wXfx|U3|~b~zLUY(;D)ev9DSlWVgXXmithW|L;4_eg@PnQr&vin@?|}}GhN74bFH_ZKQrA8(x1orgMh`1$T@UW7k29%pw11(mHGq8gBF@kE(PcdN#SN^DZ0gh* zydrIIa6UxeyUE$*>~p?#eq#T^MW+BWQ-|!<&7B6)DC%`Zs~JOQdlV|(`>}#0kyhpUxa3!}d-hyXv*^GCm!X+)F#;>9E0@HN-((eJ~@_n`g)d{ALD z^+t3%?Tjw0fg#3NlwZLKy@OxxBN)EVj6JB6tBZ*{eanc%pZ*!G6{up2A+*~{gwFVx8R^I6;(JPu zvxjFaE{xgI$I@Q1RTcQ3y6l;19O1GD@IO694>Up^0~7Q*yLcAE|Ll;zmM_XpmFDn1 z9dJDjheKb)evMT)iFc!%{1SPd%1}+3s`sev)Q;5tdFm2%HQvnKbVxsf3|uQD~hral@^`FYyW7`~Jx1TiU5hmK%qwcNU%?G4~%w zN>~8zF7Wm`cOxCuQIK|iJm{6Y`fz(5eeDqM4fba(r=Qvo?JYUT-Vzl?cQ(6?Hv6aj z;<(F|;7+vYw!s7RuaBUE%>);0rV5=7ilc#rVS9FD^~QNK5N>Y-8p#V(qIbkvWM`wm z2qnpY4Pe+$*IKuKy< zypXQiKH`F=u~T6i8SoH}fQsxRNL1U_~leeExFw59YU)PJ8f*BX9r6t3AV zs9V|ixf6`4Ms4)VCdNJR=^cz)(JWgrXWuX{KT=^5!C}2{yAC2-K5M;TO=Mr(QtJr& zno2SUCTO}HSb99}tz~GEVz)~nr#MdQBsiZM%!I+dfh=b~UM%6lYU3|YYqnlmXGdJCPhwk<$I!Ipj0TiSEsq6Q}JtcNNO~Em> zo4k0~|IM$A+I%xgb2Ajme!-w%L@*hKXagM4&LEq)DFa@s9$J68UPne9?pD-~ldQdq zXjpk7PCYLj&|NrP+e#0jWIYjeyRWkLmY`&T~8mizdDo^C3Y@uWOnv})=tvn=0#C1t5sviqJmGgIk~Yt%+M3y>=(7S zSyKnJA6Qjl#tP}haU(r}{_&hXMW3fH1uuN8pJ$yF!Gp8}m(doK=3OWs7vN+Im?h1d zBG#@KtL%CDpjYXHzM}Unz^bZZ)r|Irbh_fz8-*J31y0oSAZp5dYgql2&Ih;X-yWr;cinE%o2hG*+T2s%4 zkwd4TJ?^5e9gTK!T<4eflkmaUW+#UQ#%l#X)DwP4XeMJLSHWxG@cB_@-NC$m5BFCK zwkX6=DsbQYU{mk~DEt&2_}}Pnlfs%XeuBBU1BK+J$P+RL%(owh+ex96BzytiMu4L|73 ztZ)t*7xg zsJps(OXLpd8~H3(;fwm&%uFqDmV>u9I&Zo2afFFEDGawdh&`0^U{{yZlkQ?26=fFc zQ`2rmSG?DsMl}<9#Ts@Y?DD^j_77f!rz=h^t4TFe*h_O4+JASH|A`>J8tgi4!2ZfS zf}V>NlWM>R&A}a*pRQ&kyIR&qy9Q20dj`tm^i$wZ?*KUnpWjnByoL8>AvpR2@WXe? zG4MkL@|mvQ&zk9{4uac$NqrTkSWGLVRm5%k6gx7R?<$;l8(AaY!)%{4&KaV!NiiEoJE?lZ(mlaGs!b@s zd)a>?G^HAheG~Yhd#FB-Mh^c`xb>!@V9d9c;Lg~KgZnfHQTVp&uwQB&j{g1j3g>z> zqmH17(I`f5GxDFH92R0dlqGvDW*^9Q_N|`B5n38%&VvVN29}sW{+fY@W|{wo--KH7 zRK(9s2wq2TUrC(r3p#=nri1DZ;@6C&o0kw7%w3?Adw7%)}QwgI*&Ub;rSr^dY?e9_tqvv%*m~coREu=E8~z zPV6*@s{q=KVEr4QgZH8voC32s7f1R^T)F3+M~KSh=rLPxmw)5shaI_{On%O)51Ifks8C>O(J+FgE1eiK(|33SZ{ij4AcSJY{}L9P2%`%!C8 zRJ^J8#L+ezyjat`n?Cj_^A+27?gN?iqIVogy%zfxE5eSoXV+I6jOQ58*a~>D{o#qr z{_`}(oA}NHD|VaIRhlb(%C6}@P;{z+l^F0JcnNMR^(7w zhXP)Re%(+#wGka+d$kk$3J1fpWU>opk@`V|mA_#hyYQHmM^UXxez_Gtx!|O`!;bYQ z@`p!?_!|-Ta!kt)FI`0!*f|A`ER{;$l^upput!UH#uwA$Z`QxSD}I`;r+l=VK{H%D z5M6MnPBKmzjm@6X-j;F1$7R%9hRQG${q$Y*@#E+O%j`{{DB&r(7;&1VsNfo1eK%)< z^9J*`m>qvxoH6X?dy9&F66aWZ_B=h})ra$c7!_?ay-EW4`pIB=q?-K@jdM)kpNu>) z@%yP)fK#&76z!@j&NDfgdHH9e8{8x{Lq!<@TR#gA4?jDQCsvDjC}N5GHKQBofQFcciZ}v))MW7CJmPjOO5#qKy=?EC zcfl)y>XFPY9gV8i4BevxyL7tZ2I%Lf)&r57n{F>B zPb?cRcXj+#{iJj{hIw?@2Us=P>_J>3BOu%X!WSUX z^9iR_8#t+6#Bm1sdjjt3Ik5SwwY9MMJLv^S={O6T` zk=T-2+=FU77&bB!-BaxHUjb_%bnFA{sXYTbDIzop_pyY=CZe+q`@e){kil;M2{2`1 z-_C0Klq|5-A^4bcxb}+R@=At95V70LX^tnM6MK02u|s?`zM*OG35(z^H?YHYFWlvE z=YkV+OTeR5C!Q@LS~$Nt;Z^7d+c28Ao)-PSfMuu&o1*wWPJG9_#3-(7!BBfJ)TwAk zUD-#Tj?;527;Of-$d}>#+k~58KYPe?P>~YB+7&!b{j3&b1R+ zT15V6Vt*Q1pxc2PGT_b!o$vA2>ev66lD5lZ9rGqdt z=nKZOcBVzEX9eqL6IFRH``82vFBtd=^mVoLx>uaXjiOc5k`t={fE79z?oSViE+ z$`I$mpW2e1VHT0Snusnz&sPB~S{)v^1Fk9&yFx`iMBG+~5o;7hsc>w}!>4$F+?#zR z`xYVVcHsA=^dllCunST|;$C7g8$MX%*MjUk6VX_Uc(lMzBFDBN%Zi9hCniVJJxq>p z?7S!{HxZY6=^wJmw&!qLiO8%#Y}NwJTAmf@i@-Fo|WFM5z%KaX(phO!U?(?yVT!t*gE*;o1_}IaO;(e(t34IR7hu{twnP B$N2yN literal 0 HcmV?d00001 diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/libev/corecext.h b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/libev/corecext.h new file mode 100644 index 00000000..804ccefb --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/libev/corecext.h @@ -0,0 +1,148 @@ +/* Generated by Cython 0.29.2 */ + +#ifndef __PYX_HAVE__gevent__libev__corecext +#define __PYX_HAVE__gevent__libev__corecext + +struct PyGeventCallbackObject; +struct PyGeventLoopObject; +struct PyGeventWatcherObject; +struct PyGeventIOObject; +struct PyGeventTimerObject; +struct PyGeventSignalObject; +struct PyGeventIdleObject; +struct PyGeventPrepareObject; +struct PyGeventCheckObject; +struct PyGeventForkObject; +struct PyGeventAsyncObject; +struct PyGeventChildObject; +struct PyGeventStatObject; + +struct PyGeventCallbackObject { + PyObject_HEAD + PyObject *callback; + PyObject *args; + struct PyGeventCallbackObject *next; +}; + +struct PyGeventLoopObject { + PyObject_HEAD + struct __pyx_vtabstruct_6gevent_5libev_8corecext_loop *__pyx_vtab; + struct ev_prepare _prepare; + struct ev_timer _timer0; + struct ev_timer _periodic_signal_checker; + PyObject *error_handler; + struct ev_loop *_ptr; + struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *_callbacks; + int starting_timer_may_update_loop_time; + int _default; + double approx_timer_resolution; +}; + +struct PyGeventWatcherObject { + PyObject_HEAD + struct PyGeventLoopObject *loop; + PyObject *_callback; + PyObject *args; + struct ev_watcher *__pyx___watcher; + struct __pyx_t_6gevent_5libev_8corecext_start_and_stop *__pyx___ss; + unsigned int _flags; +}; + +struct PyGeventIOObject { + struct PyGeventWatcherObject __pyx_base; + struct ev_io _watcher; +}; + +struct PyGeventTimerObject { + struct PyGeventWatcherObject __pyx_base; + struct ev_timer _watcher; +}; + +struct PyGeventSignalObject { + struct PyGeventWatcherObject __pyx_base; + struct ev_signal _watcher; +}; + +struct PyGeventIdleObject { + struct PyGeventWatcherObject __pyx_base; + struct ev_idle _watcher; +}; + +struct PyGeventPrepareObject { + struct PyGeventWatcherObject __pyx_base; + struct ev_prepare _watcher; +}; + +struct PyGeventCheckObject { + struct PyGeventWatcherObject __pyx_base; + struct ev_check _watcher; +}; + +struct PyGeventForkObject { + struct PyGeventWatcherObject __pyx_base; + struct ev_fork _watcher; +}; + +struct PyGeventAsyncObject { + struct PyGeventWatcherObject __pyx_base; + struct ev_async _watcher; +}; + +struct PyGeventChildObject { + struct PyGeventWatcherObject __pyx_base; + struct ev_child _watcher; +}; + +struct PyGeventStatObject { + struct PyGeventWatcherObject __pyx_base; + struct ev_stat _watcher; + PyObject *path; + PyObject *_paths; +}; + +#ifndef __PYX_HAVE_API__gevent__libev__corecext + +#ifndef __PYX_EXTERN_C + #ifdef __cplusplus + #define __PYX_EXTERN_C extern "C" + #else + #define __PYX_EXTERN_C extern + #endif +#endif + +#ifndef DL_IMPORT + #define DL_IMPORT(_T) _T +#endif + +__PYX_EXTERN_C DL_IMPORT(PyTypeObject) PyGeventCallback_Type; +__PYX_EXTERN_C DL_IMPORT(PyTypeObject) PyGeventLoop_Type; +__PYX_EXTERN_C DL_IMPORT(PyTypeObject) PyGeventWatcher_Type; +__PYX_EXTERN_C DL_IMPORT(PyTypeObject) PyGeventIO_Type; +__PYX_EXTERN_C DL_IMPORT(PyTypeObject) PyGeventTimer_Type; +__PYX_EXTERN_C DL_IMPORT(PyTypeObject) PyGeventSignal_Type; +__PYX_EXTERN_C DL_IMPORT(PyTypeObject) PyGeventIdle_Type; +__PYX_EXTERN_C DL_IMPORT(PyTypeObject) PyGeventPrepare_Type; +__PYX_EXTERN_C DL_IMPORT(PyTypeObject) PyGeventCheck_Type; +__PYX_EXTERN_C DL_IMPORT(PyTypeObject) PyGeventFork_Type; +__PYX_EXTERN_C DL_IMPORT(PyTypeObject) PyGeventAsync_Type; +__PYX_EXTERN_C DL_IMPORT(PyTypeObject) PyGeventChild_Type; +__PYX_EXTERN_C DL_IMPORT(PyTypeObject) PyGeventStat_Type; + +__PYX_EXTERN_C void gevent_handle_error(struct PyGeventLoopObject *, PyObject *); +__PYX_EXTERN_C PyObject *gevent_loop_run_callbacks(struct PyGeventLoopObject *); + +__PYX_EXTERN_C PyObject *GEVENT_CORE_EVENTS; +__PYX_EXTERN_C PyObject *_empty_tuple; + +#endif /* !__PYX_HAVE_API__gevent__libev__corecext */ + +/* WARNING: the interface of the module init function changed in CPython 3.5. */ +/* It now returns a PyModuleDef instance instead of a PyModule instance. */ + +#if PY_MAJOR_VERSION < 3 +PyMODINIT_FUNC initcorecext(void); +#else +PyMODINIT_FUNC PyInit_corecext(void); +#endif + +#endif /* !__PYX_HAVE__gevent__libev__corecext */ diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/libev/corecext.html b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/libev/corecext.html new file mode 100644 index 00000000..f4aad72e --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/libev/corecext.html @@ -0,0 +1,15651 @@ + + + + + + Cython: corecext.pyx + + + +

Generated by Cython 0.29.2

+

+ Yellow lines hint at Python interaction.
+ Click on a line that starts with a "+" to see the C code that Cython generated for it. +

+

Raw output: corecext.c

+
 0001: # Copyright (c) 2009-2012 Denis Bilenko. See LICENSE for details.
+
 0002: 
+
 0003: # This first directive, supported in Cython 0.24+, causes sources
+
 0004: # files to be *much* smaller when it's false (139,027 LOC vs 35,000
+
 0005: # LOC) and thus cythonpp.py (and probably the compiler; also Visual C
+
 0006: # has limits on source file sizes) to be faster (73s vs 46s). But it does
+
 0007: # make debugging more difficult. Auto-pickling was added in 0.26, and
+
 0008: # that's a new feature that we don't need or want to allow in a gevent
+
 0009: # point release.
+
 0010: 
+
 0011: # cython: emit_code_comments=False, auto_pickle=False
+
 0012: 
+
 0013: # NOTE: We generally cannot use the Cython IF directive as documented
+
 0014: # at
+
 0015: # http://cython.readthedocs.io/en/latest/src/userguide/language_basics.html#conditional-compilation
+
 0016: # (e.g., IF UNAME_SYSNAME == "Windows") because when Cython says
+
 0017: # "compilation", it means when *Cython* compiles, not when the C
+
 0018: # compiler compiles. We distribute an sdist with a single pre-compiled
+
 0019: # C file for all platforms so that end users that don't use a binary
+
 0020: # wheel don't have to sit through cythonpp and other steps the Makefile does.
+
 0021: # See https://github.com/gevent/gevent/issues/1076
+
 0022: 
+
 0023: cimport cython
+
 0024: cimport libev
+
 0025: 
+
 0026: from cpython.ref cimport Py_INCREF
+
 0027: from cpython.ref cimport Py_DECREF
+
 0028: from cpython.mem cimport PyMem_Malloc
+
 0029: from cpython.mem cimport PyMem_Free
+
 0030: from libc.errno cimport errno
+
 0031: 
+
 0032: cdef extern from "Python.h":
+
 0033:     int    Py_ReprEnter(object)
+
 0034:     void   Py_ReprLeave(object)
+
 0035: 
+
 0036: # Work around lack of absolute_import in Cython
+
 0037: # Note for PY3: not doing so will leave reference to locals() on import
+
 0038: # (reproducible under Python 3.3, not under Python 3.4; see test__refcount_core.py)
+
+0039: sys = __import__('sys', level=0)
+
+  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 39, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_level, __pyx_int_0) < 0) __PYX_ERR(0, 39, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin___import__, __pyx_tuple__17, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 39, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_sys, __pyx_t_2) < 0) __PYX_ERR(0, 39, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+  __pyx_tuple__17 = PyTuple_Pack(1, __pyx_n_s_sys); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(0, 39, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__17);
+  __Pyx_GIVEREF(__pyx_tuple__17);
+
+0040: os = __import__('os', level=0)
+
+  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 40, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_level, __pyx_int_0) < 0) __PYX_ERR(0, 40, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin___import__, __pyx_tuple__18, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 40, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_os, __pyx_t_1) < 0) __PYX_ERR(0, 40, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+  __pyx_tuple__18 = PyTuple_Pack(1, __pyx_n_s_os); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(0, 40, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__18);
+  __Pyx_GIVEREF(__pyx_tuple__18);
+
+0041: traceback = __import__('traceback', level=0)
+
+  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 41, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_level, __pyx_int_0) < 0) __PYX_ERR(0, 41, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin___import__, __pyx_tuple__19, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 41, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_traceback, __pyx_t_2) < 0) __PYX_ERR(0, 41, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+  __pyx_tuple__19 = PyTuple_Pack(1, __pyx_n_s_traceback); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(0, 41, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__19);
+  __Pyx_GIVEREF(__pyx_tuple__19);
+
+0042: signalmodule = __import__('signal', level=0)
+
+  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 42, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_level, __pyx_int_0) < 0) __PYX_ERR(0, 42, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin___import__, __pyx_tuple__20, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 42, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_signalmodule, __pyx_t_1) < 0) __PYX_ERR(0, 42, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+  __pyx_tuple__20 = PyTuple_Pack(1, __pyx_n_s_signal); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(0, 42, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__20);
+  __Pyx_GIVEREF(__pyx_tuple__20);
+
+0043: getswitchinterval = __import__('gevent', level=0).getswitchinterval
+
+  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 43, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_level, __pyx_int_0) < 0) __PYX_ERR(0, 43, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin___import__, __pyx_tuple__21, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 43, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_getswitchinterval); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 43, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_getswitchinterval, __pyx_t_1) < 0) __PYX_ERR(0, 43, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+  __pyx_tuple__21 = PyTuple_Pack(1, __pyx_n_s_gevent); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(0, 43, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__21);
+  __Pyx_GIVEREF(__pyx_tuple__21);
+
 0044: 
+
 0045: 
+
+0046: __all__ = ['get_version',
+
+  __pyx_t_1 = PyList_New(7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 46, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(__pyx_n_s_get_version);
+  __Pyx_GIVEREF(__pyx_n_s_get_version);
+  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_get_version);
+  __Pyx_INCREF(__pyx_n_s_get_header_version);
+  __Pyx_GIVEREF(__pyx_n_s_get_header_version);
+  PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_get_header_version);
+  __Pyx_INCREF(__pyx_n_s_supported_backends);
+  __Pyx_GIVEREF(__pyx_n_s_supported_backends);
+  PyList_SET_ITEM(__pyx_t_1, 2, __pyx_n_s_supported_backends);
+  __Pyx_INCREF(__pyx_n_s_recommended_backends);
+  __Pyx_GIVEREF(__pyx_n_s_recommended_backends);
+  PyList_SET_ITEM(__pyx_t_1, 3, __pyx_n_s_recommended_backends);
+  __Pyx_INCREF(__pyx_n_s_embeddable_backends);
+  __Pyx_GIVEREF(__pyx_n_s_embeddable_backends);
+  PyList_SET_ITEM(__pyx_t_1, 4, __pyx_n_s_embeddable_backends);
+  __Pyx_INCREF(__pyx_n_s_time);
+  __Pyx_GIVEREF(__pyx_n_s_time);
+  PyList_SET_ITEM(__pyx_t_1, 5, __pyx_n_s_time);
+  __Pyx_INCREF(__pyx_n_s_loop);
+  __Pyx_GIVEREF(__pyx_n_s_loop);
+  PyList_SET_ITEM(__pyx_t_1, 6, __pyx_n_s_loop);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_all, __pyx_t_1) < 0) __PYX_ERR(0, 46, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 0047:            'get_header_version',
+
 0048:            'supported_backends',
+
 0049:            'recommended_backends',
+
 0050:            'embeddable_backends',
+
 0051:            'time',
+
 0052:            'loop']
+
 0053: 
+
 0054: cdef tuple integer_types
+
 0055: 
+
+0056: if sys.version_info[0] >= 3:
+
+  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_sys); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 56, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_version_info); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 56, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 56, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_int_3, Py_GE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 56, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 56, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  if (__pyx_t_3) {
+
+    goto __pyx_L2;
+  }
+
+0057:     integer_types = int,
+
+    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 57, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_INCREF(((PyObject *)(&PyInt_Type)));
+    __Pyx_GIVEREF(((PyObject *)(&PyInt_Type)));
+    PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)(&PyInt_Type)));
+    __Pyx_XGOTREF(__pyx_v_6gevent_5libev_8corecext_integer_types);
+    __Pyx_DECREF_SET(__pyx_v_6gevent_5libev_8corecext_integer_types, ((PyObject*)__pyx_t_2));
+    __Pyx_GIVEREF(__pyx_t_2);
+    __pyx_t_2 = 0;
+
 0058: else:
+
+0059:     integer_types = (int, long)
+
+  /*else*/ {
+    __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 59, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_INCREF(((PyObject *)(&PyInt_Type)));
+    __Pyx_GIVEREF(((PyObject *)(&PyInt_Type)));
+    PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)(&PyInt_Type)));
+    __Pyx_INCREF(((PyObject *)(&PyLong_Type)));
+    __Pyx_GIVEREF(((PyObject *)(&PyLong_Type)));
+    PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)(&PyLong_Type)));
+    __Pyx_XGOTREF(__pyx_v_6gevent_5libev_8corecext_integer_types);
+    __Pyx_DECREF_SET(__pyx_v_6gevent_5libev_8corecext_integer_types, ((PyObject*)__pyx_t_2));
+    __Pyx_GIVEREF(__pyx_t_2);
+    __pyx_t_2 = 0;
+  }
+  __pyx_L2:;
+
 0060: 
+
 0061: 
+
 0062: cdef extern from "callbacks.h":
+
 0063:     void gevent_callback_io(libev.ev_loop, void*, int)
+
 0064:     void gevent_callback_timer(libev.ev_loop, void*, int)
+
 0065:     void gevent_callback_signal(libev.ev_loop, void*, int)
+
 0066:     void gevent_callback_idle(libev.ev_loop, void*, int)
+
 0067:     void gevent_callback_prepare(libev.ev_loop, void*, int)
+
 0068:     void gevent_callback_check(libev.ev_loop, void*, int)
+
 0069:     void gevent_callback_fork(libev.ev_loop, void*, int)
+
 0070:     void gevent_callback_async(libev.ev_loop, void*, int)
+
 0071:     void gevent_callback_child(libev.ev_loop, void*, int)
+
 0072:     void gevent_callback_stat(libev.ev_loop, void*, int)
+
 0073:     void gevent_run_callbacks(libev.ev_loop, void*, int)
+
 0074:     void gevent_periodic_signal_check(libev.ev_loop, void*, int)
+
 0075:     void gevent_call(loop, callback)
+
 0076:     void gevent_noop(libev.ev_loop, void*, int)
+
 0077: 
+
 0078: cdef extern from "stathelper.c":
+
 0079:     object _pystat_fromstructstat(void*)
+
 0080: 
+
 0081: 
+
+0082: UNDEF = libev.EV_UNDEF
+
+  __pyx_t_2 = __Pyx_PyInt_From_int(EV_UNDEF); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 82, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_UNDEF, __pyx_t_2) < 0) __PYX_ERR(0, 82, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+0083: NONE = libev.EV_NONE
+
+  __pyx_t_2 = __Pyx_PyInt_From_int(EV_NONE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 83, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_NONE, __pyx_t_2) < 0) __PYX_ERR(0, 83, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+0084: READ = libev.EV_READ
+
+  __pyx_t_2 = __Pyx_PyInt_From_int(EV_READ); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 84, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_READ, __pyx_t_2) < 0) __PYX_ERR(0, 84, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+0085: WRITE = libev.EV_WRITE
+
+  __pyx_t_2 = __Pyx_PyInt_From_int(EV_WRITE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 85, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_WRITE, __pyx_t_2) < 0) __PYX_ERR(0, 85, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+0086: TIMER = libev.EV_TIMER
+
+  __pyx_t_2 = __Pyx_PyInt_From_int(EV_TIMER); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 86, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_TIMER, __pyx_t_2) < 0) __PYX_ERR(0, 86, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+0087: PERIODIC = libev.EV_PERIODIC
+
+  __pyx_t_2 = __Pyx_PyInt_From_int(EV_PERIODIC); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 87, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_PERIODIC, __pyx_t_2) < 0) __PYX_ERR(0, 87, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+0088: SIGNAL = libev.EV_SIGNAL
+
+  __pyx_t_2 = __Pyx_PyInt_From_int(EV_SIGNAL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 88, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_SIGNAL, __pyx_t_2) < 0) __PYX_ERR(0, 88, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+0089: CHILD = libev.EV_CHILD
+
+  __pyx_t_2 = __Pyx_PyInt_From_int(EV_CHILD); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 89, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_CHILD, __pyx_t_2) < 0) __PYX_ERR(0, 89, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+0090: STAT = libev.EV_STAT
+
+  __pyx_t_2 = __Pyx_PyInt_From_int(EV_STAT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 90, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_STAT, __pyx_t_2) < 0) __PYX_ERR(0, 90, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+0091: IDLE = libev.EV_IDLE
+
+  __pyx_t_2 = __Pyx_PyInt_From_int(EV_IDLE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 91, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_IDLE, __pyx_t_2) < 0) __PYX_ERR(0, 91, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+0092: PREPARE = libev.EV_PREPARE
+
+  __pyx_t_2 = __Pyx_PyInt_From_int(EV_PREPARE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 92, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_PREPARE, __pyx_t_2) < 0) __PYX_ERR(0, 92, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+0093: CHECK = libev.EV_CHECK
+
+  __pyx_t_2 = __Pyx_PyInt_From_int(EV_CHECK); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 93, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_CHECK, __pyx_t_2) < 0) __PYX_ERR(0, 93, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+0094: EMBED = libev.EV_EMBED
+
+  __pyx_t_2 = __Pyx_PyInt_From_int(EV_EMBED); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 94, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_EMBED, __pyx_t_2) < 0) __PYX_ERR(0, 94, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+0095: FORK = libev.EV_FORK
+
+  __pyx_t_2 = __Pyx_PyInt_From_int(EV_FORK); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 95, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_FORK, __pyx_t_2) < 0) __PYX_ERR(0, 95, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+0096: CLEANUP = libev.EV_CLEANUP
+
+  __pyx_t_2 = __Pyx_PyInt_From_int(EV_CLEANUP); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 96, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_CLEANUP, __pyx_t_2) < 0) __PYX_ERR(0, 96, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+0097: ASYNC = libev.EV_ASYNC
+
+  __pyx_t_2 = __Pyx_PyInt_From_int(EV_ASYNC); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 97, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ASYNC, __pyx_t_2) < 0) __PYX_ERR(0, 97, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+0098: CUSTOM = libev.EV_CUSTOM
+
+  __pyx_t_2 = __Pyx_PyInt_From_int(EV_CUSTOM); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 98, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_CUSTOM, __pyx_t_2) < 0) __PYX_ERR(0, 98, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+0099: ERROR = libev.EV_ERROR
+
+  __pyx_t_2 = __Pyx_PyInt_From_int(EV_ERROR); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 99, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ERROR, __pyx_t_2) < 0) __PYX_ERR(0, 99, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
 0100: 
+
+0101: READWRITE = libev.EV_READ | libev.EV_WRITE
+
+  __pyx_t_2 = __Pyx_PyInt_From_int((EV_READ | EV_WRITE)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 101, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_READWRITE, __pyx_t_2) < 0) __PYX_ERR(0, 101, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
 0102: 
+
+0103: MINPRI = libev.EV_MINPRI
+
+  __pyx_t_2 = __Pyx_PyInt_From_int(EV_MINPRI); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 103, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_MINPRI, __pyx_t_2) < 0) __PYX_ERR(0, 103, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+0104: MAXPRI = libev.EV_MAXPRI
+
+  __pyx_t_2 = __Pyx_PyInt_From_int(EV_MAXPRI); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 104, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_MAXPRI, __pyx_t_2) < 0) __PYX_ERR(0, 104, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
 0105: 
+
+0106: BACKEND_PORT = libev.EVBACKEND_PORT
+
+  __pyx_t_2 = __Pyx_PyInt_From_int(EVBACKEND_PORT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 106, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_BACKEND_PORT, __pyx_t_2) < 0) __PYX_ERR(0, 106, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+0107: BACKEND_KQUEUE = libev.EVBACKEND_KQUEUE
+
+  __pyx_t_2 = __Pyx_PyInt_From_int(EVBACKEND_KQUEUE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 107, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_BACKEND_KQUEUE, __pyx_t_2) < 0) __PYX_ERR(0, 107, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+0108: BACKEND_EPOLL = libev.EVBACKEND_EPOLL
+
+  __pyx_t_2 = __Pyx_PyInt_From_int(EVBACKEND_EPOLL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 108, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_BACKEND_EPOLL, __pyx_t_2) < 0) __PYX_ERR(0, 108, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+0109: BACKEND_POLL = libev.EVBACKEND_POLL
+
+  __pyx_t_2 = __Pyx_PyInt_From_int(EVBACKEND_POLL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 109, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_BACKEND_POLL, __pyx_t_2) < 0) __PYX_ERR(0, 109, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+0110: BACKEND_SELECT = libev.EVBACKEND_SELECT
+
+  __pyx_t_2 = __Pyx_PyInt_From_int(EVBACKEND_SELECT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 110, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_BACKEND_SELECT, __pyx_t_2) < 0) __PYX_ERR(0, 110, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+0111: FORKCHECK = libev.EVFLAG_FORKCHECK
+
+  __pyx_t_2 = __Pyx_PyInt_From_int(EVFLAG_FORKCHECK); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 111, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_FORKCHECK, __pyx_t_2) < 0) __PYX_ERR(0, 111, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+0112: NOINOTIFY = libev.EVFLAG_NOINOTIFY
+
+  __pyx_t_2 = __Pyx_PyInt_From_int(EVFLAG_NOINOTIFY); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 112, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_NOINOTIFY, __pyx_t_2) < 0) __PYX_ERR(0, 112, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+0113: SIGNALFD = libev.EVFLAG_SIGNALFD
+
+  __pyx_t_2 = __Pyx_PyInt_From_int(EVFLAG_SIGNALFD); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 113, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_SIGNALFD, __pyx_t_2) < 0) __PYX_ERR(0, 113, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+0114: NOSIGMASK = libev.EVFLAG_NOSIGMASK
+
+  __pyx_t_2 = __Pyx_PyInt_From_int(EVFLAG_NOSIGMASK); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 114, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_NOSIGMASK, __pyx_t_2) < 0) __PYX_ERR(0, 114, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
 0115: 
+
 0116: 
+
 0117: @cython.internal
+
+0118: cdef class _EVENTSType:
+
+struct __pyx_obj_6gevent_5libev_8corecext__EVENTSType {
+  PyObject_HEAD
+};
+
+
 0119: 
+
+0120:     def __repr__(self):
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_11_EVENTSType_1__repr__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_11_EVENTSType_1__repr__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_11_EVENTSType___repr__(((struct __pyx_obj_6gevent_5libev_8corecext__EVENTSType *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_11_EVENTSType___repr__(CYTHON_UNUSED struct __pyx_obj_6gevent_5libev_8corecext__EVENTSType *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__repr__", 0);
+
+
+  /* function exit code */
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0121:         return 'gevent.core.EVENTS'
+
+  __Pyx_XDECREF(__pyx_r);
+  __Pyx_INCREF(__pyx_kp_s_gevent_core_EVENTS);
+  __pyx_r = __pyx_kp_s_gevent_core_EVENTS;
+  goto __pyx_L0;
+
 0122: 
+
 0123: 
+
+0124: cdef public object GEVENT_CORE_EVENTS = _EVENTSType()
+
+  __pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_6gevent_5libev_8corecext__EVENTSType)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 124, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_XGOTREF(GEVENT_CORE_EVENTS);
+  __Pyx_DECREF_SET(GEVENT_CORE_EVENTS, __pyx_t_2);
+  __Pyx_GIVEREF(__pyx_t_2);
+  __pyx_t_2 = 0;
+
+0125: EVENTS = GEVENT_CORE_EVENTS
+
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_EVENTS, GEVENT_CORE_EVENTS) < 0) __PYX_ERR(0, 125, __pyx_L1_error)
+
 0126: 
+
 0127: 
+
+0128: def get_version():
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_1get_version(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyMethodDef __pyx_mdef_6gevent_5libev_8corecext_1get_version = {"get_version", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_1get_version, METH_NOARGS, 0};
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_1get_version(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("get_version (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_get_version(__pyx_self);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_get_version(CYTHON_UNUSED PyObject *__pyx_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("get_version", 0);
+
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_AddTraceback("gevent.libev.corecext.get_version", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6gevent_5libev_8corecext_1get_version, NULL, __pyx_n_s_gevent_libev_corecext); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 128, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_version, __pyx_t_2) < 0) __PYX_ERR(0, 128, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+  __pyx_codeobj__22 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_libev_corecext_pyx, __pyx_n_s_get_version, 128, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__22)) __PYX_ERR(0, 128, __pyx_L1_error)
+
+0129:     return 'libev-%d.%02d' % (libev.ev_version_major(), libev.ev_version_minor())
+
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __Pyx_PyInt_From_int(ev_version_major()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 129, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = __Pyx_PyInt_From_int(ev_version_minor()); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 129, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 129, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_GIVEREF(__pyx_t_1);
+  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_2);
+  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
+  __pyx_t_1 = 0;
+  __pyx_t_2 = 0;
+  __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_libev_d_02d, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 129, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __pyx_r = __pyx_t_2;
+  __pyx_t_2 = 0;
+  goto __pyx_L0;
+
 0130: 
+
 0131: 
+
+0132: def get_header_version():
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_3get_header_version(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyMethodDef __pyx_mdef_6gevent_5libev_8corecext_3get_header_version = {"get_header_version", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_3get_header_version, METH_NOARGS, 0};
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_3get_header_version(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("get_header_version (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_2get_header_version(__pyx_self);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_2get_header_version(CYTHON_UNUSED PyObject *__pyx_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("get_header_version", 0);
+
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_AddTraceback("gevent.libev.corecext.get_header_version", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6gevent_5libev_8corecext_3get_header_version, NULL, __pyx_n_s_gevent_libev_corecext); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 132, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_header_version, __pyx_t_2) < 0) __PYX_ERR(0, 132, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+  __pyx_codeobj__23 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_libev_corecext_pyx, __pyx_n_s_get_header_version, 132, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__23)) __PYX_ERR(0, 132, __pyx_L1_error)
+
+0133:     return 'libev-%d.%02d' % (libev.EV_VERSION_MAJOR, libev.EV_VERSION_MINOR)
+
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __Pyx_PyInt_From_int(EV_VERSION_MAJOR); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 133, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = __Pyx_PyInt_From_int(EV_VERSION_MINOR); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 133, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 133, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_GIVEREF(__pyx_t_1);
+  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_2);
+  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
+  __pyx_t_1 = 0;
+  __pyx_t_2 = 0;
+  __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_libev_d_02d, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 133, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __pyx_r = __pyx_t_2;
+  __pyx_t_2 = 0;
+  goto __pyx_L0;
+
 0134: 
+
 0135: 
+
 0136: # This list backends in the order they are actually tried by libev
+
+0137: _flags = [(libev.EVBACKEND_PORT, 'port'),
+
+  __pyx_t_2 = __Pyx_PyInt_From_int(EVBACKEND_PORT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 137, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 137, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_2);
+  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_port);
+  __Pyx_GIVEREF(__pyx_n_s_port);
+  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_port);
+  __pyx_t_2 = 0;
+
+  __pyx_t_2 = PyList_New(10); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 137, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_GIVEREF(__pyx_t_1);
+  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_4);
+  PyList_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
+  __Pyx_GIVEREF(__pyx_t_5);
+  PyList_SET_ITEM(__pyx_t_2, 2, __pyx_t_5);
+  __Pyx_GIVEREF(__pyx_t_6);
+  PyList_SET_ITEM(__pyx_t_2, 3, __pyx_t_6);
+  __Pyx_GIVEREF(__pyx_t_7);
+  PyList_SET_ITEM(__pyx_t_2, 4, __pyx_t_7);
+  __Pyx_GIVEREF(__pyx_t_8);
+  PyList_SET_ITEM(__pyx_t_2, 5, __pyx_t_8);
+  __Pyx_GIVEREF(__pyx_t_9);
+  PyList_SET_ITEM(__pyx_t_2, 6, __pyx_t_9);
+  __Pyx_GIVEREF(__pyx_t_10);
+  PyList_SET_ITEM(__pyx_t_2, 7, __pyx_t_10);
+  __Pyx_GIVEREF(__pyx_t_11);
+  PyList_SET_ITEM(__pyx_t_2, 8, __pyx_t_11);
+  __Pyx_GIVEREF(__pyx_t_12);
+  PyList_SET_ITEM(__pyx_t_2, 9, __pyx_t_12);
+  __pyx_t_1 = 0;
+  __pyx_t_4 = 0;
+  __pyx_t_5 = 0;
+  __pyx_t_6 = 0;
+  __pyx_t_7 = 0;
+  __pyx_t_8 = 0;
+  __pyx_t_9 = 0;
+  __pyx_t_10 = 0;
+  __pyx_t_11 = 0;
+  __pyx_t_12 = 0;
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_flags, __pyx_t_2) < 0) __PYX_ERR(0, 137, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+0138:           (libev.EVBACKEND_KQUEUE, 'kqueue'),
+
+  __pyx_t_2 = __Pyx_PyInt_From_int(EVBACKEND_KQUEUE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 138, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 138, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_4);
+  __Pyx_GIVEREF(__pyx_t_2);
+  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_kqueue);
+  __Pyx_GIVEREF(__pyx_n_s_kqueue);
+  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_n_s_kqueue);
+  __pyx_t_2 = 0;
+
+0139:           (libev.EVBACKEND_EPOLL, 'epoll'),
+
+  __pyx_t_2 = __Pyx_PyInt_From_int(EVBACKEND_EPOLL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 139, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 139, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_5);
+  __Pyx_GIVEREF(__pyx_t_2);
+  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_epoll);
+  __Pyx_GIVEREF(__pyx_n_s_epoll);
+  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_n_s_epoll);
+  __pyx_t_2 = 0;
+
+0140:           (libev.EVBACKEND_POLL, 'poll'),
+
+  __pyx_t_2 = __Pyx_PyInt_From_int(EVBACKEND_POLL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 140, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 140, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  __Pyx_GIVEREF(__pyx_t_2);
+  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_poll);
+  __Pyx_GIVEREF(__pyx_n_s_poll);
+  PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_n_s_poll);
+  __pyx_t_2 = 0;
+
+0141:           (libev.EVBACKEND_SELECT, 'select'),
+
+  __pyx_t_2 = __Pyx_PyInt_From_int(EVBACKEND_SELECT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 141, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 141, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_7);
+  __Pyx_GIVEREF(__pyx_t_2);
+  PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_select);
+  __Pyx_GIVEREF(__pyx_n_s_select);
+  PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_n_s_select);
+  __pyx_t_2 = 0;
+
+0142:           (libev.EVFLAG_NOENV, 'noenv'),
+
+  __pyx_t_2 = __Pyx_PyInt_From_int(EVFLAG_NOENV); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 142, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 142, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_8);
+  __Pyx_GIVEREF(__pyx_t_2);
+  PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_noenv);
+  __Pyx_GIVEREF(__pyx_n_s_noenv);
+  PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_n_s_noenv);
+  __pyx_t_2 = 0;
+
+0143:           (libev.EVFLAG_FORKCHECK, 'forkcheck'),
+
+  __pyx_t_2 = __Pyx_PyInt_From_int(EVFLAG_FORKCHECK); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 143, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 143, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_9);
+  __Pyx_GIVEREF(__pyx_t_2);
+  PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_forkcheck);
+  __Pyx_GIVEREF(__pyx_n_s_forkcheck);
+  PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_n_s_forkcheck);
+  __pyx_t_2 = 0;
+
+0144:           (libev.EVFLAG_NOINOTIFY, 'noinotify'),
+
+  __pyx_t_2 = __Pyx_PyInt_From_int(EVFLAG_NOINOTIFY); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 144, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 144, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_10);
+  __Pyx_GIVEREF(__pyx_t_2);
+  PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_noinotify);
+  __Pyx_GIVEREF(__pyx_n_s_noinotify);
+  PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_n_s_noinotify);
+  __pyx_t_2 = 0;
+
+0145:           (libev.EVFLAG_SIGNALFD, 'signalfd'),
+
+  __pyx_t_2 = __Pyx_PyInt_From_int(EVFLAG_SIGNALFD); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 145, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 145, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_11);
+  __Pyx_GIVEREF(__pyx_t_2);
+  PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_signalfd);
+  __Pyx_GIVEREF(__pyx_n_s_signalfd);
+  PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_n_s_signalfd);
+  __pyx_t_2 = 0;
+
+0146:           (libev.EVFLAG_NOSIGMASK, 'nosigmask')]
+
+  __pyx_t_2 = __Pyx_PyInt_From_int(EVFLAG_NOSIGMASK); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 146, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 146, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_12);
+  __Pyx_GIVEREF(__pyx_t_2);
+  PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_nosigmask);
+  __Pyx_GIVEREF(__pyx_n_s_nosigmask);
+  PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_n_s_nosigmask);
+  __pyx_t_2 = 0;
+
 0147: 
+
 0148: 
+
+0149: _flags_str2int = dict((string, flag) for (flag, string) in _flags)
+
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_22genexpr(CYTHON_UNUSED PyObject *__pyx_self) {
+  struct __pyx_obj_6gevent_5libev_8corecext___pyx_scope_struct__genexpr *__pyx_cur_scope;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("genexpr", 0);
+  __pyx_cur_scope = (struct __pyx_obj_6gevent_5libev_8corecext___pyx_scope_struct__genexpr *)__pyx_tp_new_6gevent_5libev_8corecext___pyx_scope_struct__genexpr(__pyx_ptype_6gevent_5libev_8corecext___pyx_scope_struct__genexpr, __pyx_empty_tuple, NULL);
+  if (unlikely(!__pyx_cur_scope)) {
+    __pyx_cur_scope = ((struct __pyx_obj_6gevent_5libev_8corecext___pyx_scope_struct__genexpr *)Py_None);
+    __Pyx_INCREF(Py_None);
+    __PYX_ERR(0, 149, __pyx_L1_error)
+  } else {
+    __Pyx_GOTREF(__pyx_cur_scope);
+  }
+  {
+    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_6gevent_5libev_8corecext_24generator, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_genexpr, __pyx_n_s_gevent_libev_corecext); if (unlikely(!gen)) __PYX_ERR(0, 149, __pyx_L1_error)
+    __Pyx_DECREF(__pyx_cur_scope);
+    __Pyx_RefNannyFinishContext();
+    return (PyObject *) gen;
+  }
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_AddTraceback("gevent.libev.corecext.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_gb_6gevent_5libev_8corecext_24generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
+{
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("genexpr", 0);
+  __pyx_L3_first_run:;
+  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 149, __pyx_L1_error)
+  __pyx_r = PyDict_New(); if (unlikely(!__pyx_r)) __PYX_ERR(0, 149, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_r);
+  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 149, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
+    __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
+    __pyx_t_4 = NULL;
+  } else {
+    __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 149, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 149, __pyx_L1_error)
+  }
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  for (;;) {
+    if (likely(!__pyx_t_4)) {
+      if (likely(PyList_CheckExact(__pyx_t_2))) {
+        if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
+        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 149, __pyx_L1_error)
+        #else
+        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 149, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_1);
+        #endif
+      } else {
+        if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
+        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 149, __pyx_L1_error)
+        #else
+        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 149, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_1);
+        #endif
+      }
+    } else {
+      __pyx_t_1 = __pyx_t_4(__pyx_t_2);
+      if (unlikely(!__pyx_t_1)) {
+        PyObject* exc_type = PyErr_Occurred();
+        if (exc_type) {
+          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+          else __PYX_ERR(0, 149, __pyx_L1_error)
+        }
+        break;
+      }
+      __Pyx_GOTREF(__pyx_t_1);
+    }
+    if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
+      PyObject* sequence = __pyx_t_1;
+      Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
+      if (unlikely(size != 2)) {
+        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
+        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
+        __PYX_ERR(0, 149, __pyx_L1_error)
+      }
+      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+      if (likely(PyTuple_CheckExact(sequence))) {
+        __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); 
+        __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); 
+      } else {
+        __pyx_t_5 = PyList_GET_ITEM(sequence, 0); 
+        __pyx_t_6 = PyList_GET_ITEM(sequence, 1); 
+      }
+      __Pyx_INCREF(__pyx_t_5);
+      __Pyx_INCREF(__pyx_t_6);
+      #else
+      __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 149, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_5);
+      __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 149, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_6);
+      #endif
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    } else {
+      Py_ssize_t index = -1;
+      __pyx_t_7 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 149, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_7);
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
+      index = 0; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L6_unpacking_failed;
+      __Pyx_GOTREF(__pyx_t_5);
+      index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L6_unpacking_failed;
+      __Pyx_GOTREF(__pyx_t_6);
+      if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(0, 149, __pyx_L1_error)
+      __pyx_t_8 = NULL;
+      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+      goto __pyx_L7_unpacking_done;
+      __pyx_L6_unpacking_failed:;
+      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+      __pyx_t_8 = NULL;
+      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
+      __PYX_ERR(0, 149, __pyx_L1_error)
+      __pyx_L7_unpacking_done:;
+    }
+    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_flag);
+    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_flag, __pyx_t_5);
+    __Pyx_GIVEREF(__pyx_t_5);
+    __pyx_t_5 = 0;
+    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_string);
+    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_string, __pyx_t_6);
+    __Pyx_GIVEREF(__pyx_t_6);
+    __pyx_t_6 = 0;
+    if (unlikely(PyDict_SetItem(__pyx_r, (PyObject*)__pyx_cur_scope->__pyx_v_string, (PyObject*)__pyx_cur_scope->__pyx_v_flag))) __PYX_ERR(0, 149, __pyx_L1_error)
+  }
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);
+
+  /* function exit code */
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_XDECREF(__pyx_t_6);
+  __Pyx_XDECREF(__pyx_t_7);
+  __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  #if !CYTHON_USE_EXC_INFO_STACK
+  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
+  #endif
+  __pyx_generator->resume_label = -1;
+  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+PyObject *GEVENT_CORE_EVENTS = 0;
+PyObject *_empty_tuple = 0;
+
+  __pyx_t_2 = __pyx_pf_6gevent_5libev_8corecext_22genexpr(NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 149, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_12 = __Pyx_Generator_Next(__pyx_t_2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 149, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_12);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_flags_str2int, __pyx_t_12) < 0) __PYX_ERR(0, 149, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
+
+struct __pyx_obj_6gevent_5libev_8corecext___pyx_scope_struct__genexpr {
+  PyObject_HEAD
+  PyObject *__pyx_v_flag;
+  PyObject *__pyx_v_string;
+};
+
+
+
 0150: 
+
 0151: 
+
+0152: _events = [(libev.EV_READ,     'READ'),
+
+  __pyx_t_12 = __Pyx_PyInt_From_int(EV_READ); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 152, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_12);
+  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 152, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_GIVEREF(__pyx_t_12);
+  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_12);
+  __Pyx_INCREF(__pyx_n_s_READ);
+  __Pyx_GIVEREF(__pyx_n_s_READ);
+  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_READ);
+  __pyx_t_12 = 0;
+
+  __pyx_t_12 = PyList_New(16); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 152, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_12);
+  __Pyx_GIVEREF(__pyx_t_2);
+  PyList_SET_ITEM(__pyx_t_12, 0, __pyx_t_2);
+  __Pyx_GIVEREF(__pyx_t_11);
+  PyList_SET_ITEM(__pyx_t_12, 1, __pyx_t_11);
+  __Pyx_GIVEREF(__pyx_t_10);
+  PyList_SET_ITEM(__pyx_t_12, 2, __pyx_t_10);
+  __Pyx_GIVEREF(__pyx_t_9);
+  PyList_SET_ITEM(__pyx_t_12, 3, __pyx_t_9);
+  __Pyx_GIVEREF(__pyx_t_8);
+  PyList_SET_ITEM(__pyx_t_12, 4, __pyx_t_8);
+  __Pyx_GIVEREF(__pyx_t_7);
+  PyList_SET_ITEM(__pyx_t_12, 5, __pyx_t_7);
+  __Pyx_GIVEREF(__pyx_t_6);
+  PyList_SET_ITEM(__pyx_t_12, 6, __pyx_t_6);
+  __Pyx_GIVEREF(__pyx_t_5);
+  PyList_SET_ITEM(__pyx_t_12, 7, __pyx_t_5);
+  __Pyx_GIVEREF(__pyx_t_4);
+  PyList_SET_ITEM(__pyx_t_12, 8, __pyx_t_4);
+  __Pyx_GIVEREF(__pyx_t_1);
+  PyList_SET_ITEM(__pyx_t_12, 9, __pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_13);
+  PyList_SET_ITEM(__pyx_t_12, 10, __pyx_t_13);
+  __Pyx_GIVEREF(__pyx_t_14);
+  PyList_SET_ITEM(__pyx_t_12, 11, __pyx_t_14);
+  __Pyx_GIVEREF(__pyx_t_15);
+  PyList_SET_ITEM(__pyx_t_12, 12, __pyx_t_15);
+  __Pyx_GIVEREF(__pyx_t_16);
+  PyList_SET_ITEM(__pyx_t_12, 13, __pyx_t_16);
+  __Pyx_GIVEREF(__pyx_t_17);
+  PyList_SET_ITEM(__pyx_t_12, 14, __pyx_t_17);
+  __Pyx_GIVEREF(__pyx_t_18);
+  PyList_SET_ITEM(__pyx_t_12, 15, __pyx_t_18);
+  __pyx_t_2 = 0;
+  __pyx_t_11 = 0;
+  __pyx_t_10 = 0;
+  __pyx_t_9 = 0;
+  __pyx_t_8 = 0;
+  __pyx_t_7 = 0;
+  __pyx_t_6 = 0;
+  __pyx_t_5 = 0;
+  __pyx_t_4 = 0;
+  __pyx_t_1 = 0;
+  __pyx_t_13 = 0;
+  __pyx_t_14 = 0;
+  __pyx_t_15 = 0;
+  __pyx_t_16 = 0;
+  __pyx_t_17 = 0;
+  __pyx_t_18 = 0;
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_events, __pyx_t_12) < 0) __PYX_ERR(0, 152, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
+
+0153:            (libev.EV_WRITE,    'WRITE'),
+
+  __pyx_t_12 = __Pyx_PyInt_From_int(EV_WRITE); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 153, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_12);
+  __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 153, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_11);
+  __Pyx_GIVEREF(__pyx_t_12);
+  PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_12);
+  __Pyx_INCREF(__pyx_n_s_WRITE);
+  __Pyx_GIVEREF(__pyx_n_s_WRITE);
+  PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_n_s_WRITE);
+  __pyx_t_12 = 0;
+
+0154:            (libev.EV__IOFDSET, '_IOFDSET'),
+
+  __pyx_t_12 = __Pyx_PyInt_From_int(EV__IOFDSET); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 154, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_12);
+  __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 154, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_10);
+  __Pyx_GIVEREF(__pyx_t_12);
+  PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_12);
+  __Pyx_INCREF(__pyx_n_s_IOFDSET);
+  __Pyx_GIVEREF(__pyx_n_s_IOFDSET);
+  PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_n_s_IOFDSET);
+  __pyx_t_12 = 0;
+
+0155:            (libev.EV_PERIODIC, 'PERIODIC'),
+
+  __pyx_t_12 = __Pyx_PyInt_From_int(EV_PERIODIC); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 155, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_12);
+  __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 155, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_9);
+  __Pyx_GIVEREF(__pyx_t_12);
+  PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_12);
+  __Pyx_INCREF(__pyx_n_s_PERIODIC);
+  __Pyx_GIVEREF(__pyx_n_s_PERIODIC);
+  PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_n_s_PERIODIC);
+  __pyx_t_12 = 0;
+
+0156:            (libev.EV_SIGNAL,   'SIGNAL'),
+
+  __pyx_t_12 = __Pyx_PyInt_From_int(EV_SIGNAL); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 156, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_12);
+  __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 156, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_8);
+  __Pyx_GIVEREF(__pyx_t_12);
+  PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_12);
+  __Pyx_INCREF(__pyx_n_s_SIGNAL);
+  __Pyx_GIVEREF(__pyx_n_s_SIGNAL);
+  PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_n_s_SIGNAL);
+  __pyx_t_12 = 0;
+
+0157:            (libev.EV_CHILD,    'CHILD'),
+
+  __pyx_t_12 = __Pyx_PyInt_From_int(EV_CHILD); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 157, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_12);
+  __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 157, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_7);
+  __Pyx_GIVEREF(__pyx_t_12);
+  PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_12);
+  __Pyx_INCREF(__pyx_n_s_CHILD);
+  __Pyx_GIVEREF(__pyx_n_s_CHILD);
+  PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_n_s_CHILD);
+  __pyx_t_12 = 0;
+
+0158:            (libev.EV_STAT,     'STAT'),
+
+  __pyx_t_12 = __Pyx_PyInt_From_int(EV_STAT); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 158, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_12);
+  __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 158, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  __Pyx_GIVEREF(__pyx_t_12);
+  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_12);
+  __Pyx_INCREF(__pyx_n_s_STAT);
+  __Pyx_GIVEREF(__pyx_n_s_STAT);
+  PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_n_s_STAT);
+  __pyx_t_12 = 0;
+
+0159:            (libev.EV_IDLE,     'IDLE'),
+
+  __pyx_t_12 = __Pyx_PyInt_From_int(EV_IDLE); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 159, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_12);
+  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 159, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_5);
+  __Pyx_GIVEREF(__pyx_t_12);
+  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_12);
+  __Pyx_INCREF(__pyx_n_s_IDLE);
+  __Pyx_GIVEREF(__pyx_n_s_IDLE);
+  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_n_s_IDLE);
+  __pyx_t_12 = 0;
+
+0160:            (libev.EV_PREPARE,  'PREPARE'),
+
+  __pyx_t_12 = __Pyx_PyInt_From_int(EV_PREPARE); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 160, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_12);
+  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 160, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_4);
+  __Pyx_GIVEREF(__pyx_t_12);
+  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_12);
+  __Pyx_INCREF(__pyx_n_s_PREPARE);
+  __Pyx_GIVEREF(__pyx_n_s_PREPARE);
+  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_n_s_PREPARE);
+  __pyx_t_12 = 0;
+
+0161:            (libev.EV_CHECK,    'CHECK'),
+
+  __pyx_t_12 = __Pyx_PyInt_From_int(EV_CHECK); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 161, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_12);
+  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 161, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_12);
+  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_12);
+  __Pyx_INCREF(__pyx_n_s_CHECK);
+  __Pyx_GIVEREF(__pyx_n_s_CHECK);
+  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_CHECK);
+  __pyx_t_12 = 0;
+
+0162:            (libev.EV_EMBED,    'EMBED'),
+
+  __pyx_t_12 = __Pyx_PyInt_From_int(EV_EMBED); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 162, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_12);
+  __pyx_t_13 = PyTuple_New(2); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 162, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_13);
+  __Pyx_GIVEREF(__pyx_t_12);
+  PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_12);
+  __Pyx_INCREF(__pyx_n_s_EMBED);
+  __Pyx_GIVEREF(__pyx_n_s_EMBED);
+  PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_n_s_EMBED);
+  __pyx_t_12 = 0;
+
+0163:            (libev.EV_FORK,     'FORK'),
+
+  __pyx_t_12 = __Pyx_PyInt_From_int(EV_FORK); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 163, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_12);
+  __pyx_t_14 = PyTuple_New(2); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 163, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_14);
+  __Pyx_GIVEREF(__pyx_t_12);
+  PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_12);
+  __Pyx_INCREF(__pyx_n_s_FORK);
+  __Pyx_GIVEREF(__pyx_n_s_FORK);
+  PyTuple_SET_ITEM(__pyx_t_14, 1, __pyx_n_s_FORK);
+  __pyx_t_12 = 0;
+
+0164:            (libev.EV_CLEANUP,  'CLEANUP'),
+
+  __pyx_t_12 = __Pyx_PyInt_From_int(EV_CLEANUP); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 164, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_12);
+  __pyx_t_15 = PyTuple_New(2); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 164, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_15);
+  __Pyx_GIVEREF(__pyx_t_12);
+  PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_12);
+  __Pyx_INCREF(__pyx_n_s_CLEANUP);
+  __Pyx_GIVEREF(__pyx_n_s_CLEANUP);
+  PyTuple_SET_ITEM(__pyx_t_15, 1, __pyx_n_s_CLEANUP);
+  __pyx_t_12 = 0;
+
+0165:            (libev.EV_ASYNC,    'ASYNC'),
+
+  __pyx_t_12 = __Pyx_PyInt_From_int(EV_ASYNC); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 165, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_12);
+  __pyx_t_16 = PyTuple_New(2); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 165, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_16);
+  __Pyx_GIVEREF(__pyx_t_12);
+  PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_12);
+  __Pyx_INCREF(__pyx_n_s_ASYNC);
+  __Pyx_GIVEREF(__pyx_n_s_ASYNC);
+  PyTuple_SET_ITEM(__pyx_t_16, 1, __pyx_n_s_ASYNC);
+  __pyx_t_12 = 0;
+
+0166:            (libev.EV_CUSTOM,   'CUSTOM'),
+
+  __pyx_t_12 = __Pyx_PyInt_From_int(EV_CUSTOM); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 166, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_12);
+  __pyx_t_17 = PyTuple_New(2); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 166, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_17);
+  __Pyx_GIVEREF(__pyx_t_12);
+  PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_12);
+  __Pyx_INCREF(__pyx_n_s_CUSTOM);
+  __Pyx_GIVEREF(__pyx_n_s_CUSTOM);
+  PyTuple_SET_ITEM(__pyx_t_17, 1, __pyx_n_s_CUSTOM);
+  __pyx_t_12 = 0;
+
+0167:            (libev.EV_ERROR,    'ERROR')]
+
+  __pyx_t_12 = __Pyx_PyInt_From_int(EV_ERROR); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 167, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_12);
+  __pyx_t_18 = PyTuple_New(2); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 167, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_18);
+  __Pyx_GIVEREF(__pyx_t_12);
+  PyTuple_SET_ITEM(__pyx_t_18, 0, __pyx_t_12);
+  __Pyx_INCREF(__pyx_n_s_ERROR);
+  __Pyx_GIVEREF(__pyx_n_s_ERROR);
+  PyTuple_SET_ITEM(__pyx_t_18, 1, __pyx_n_s_ERROR);
+  __pyx_t_12 = 0;
+
 0168: 
+
 0169: 
+
+0170: cpdef _flags_to_list(unsigned int flags):
+
+
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_5_flags_to_list(PyObject *__pyx_self, PyObject *__pyx_arg_flags); /*proto*/
+static PyObject *__pyx_f_6gevent_5libev_8corecext__flags_to_list(unsigned int __pyx_v_flags, CYTHON_UNUSED int __pyx_skip_dispatch) {
+  PyObject *__pyx_v_result = 0;
+  PyObject *__pyx_v_code = NULL;
+  PyObject *__pyx_v_value = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_flags_to_list", 0);
+
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_XDECREF(__pyx_t_6);
+  __Pyx_XDECREF(__pyx_t_7);
+  __Pyx_AddTraceback("gevent.libev.corecext._flags_to_list", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_result);
+  __Pyx_XDECREF(__pyx_v_code);
+  __Pyx_XDECREF(__pyx_v_value);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_5_flags_to_list(PyObject *__pyx_self, PyObject *__pyx_arg_flags); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_5_flags_to_list(PyObject *__pyx_self, PyObject *__pyx_arg_flags) {
+  unsigned int __pyx_v_flags;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_flags_to_list (wrapper)", 0);
+  assert(__pyx_arg_flags); {
+    __pyx_v_flags = __Pyx_PyInt_As_unsigned_int(__pyx_arg_flags); if (unlikely((__pyx_v_flags == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 170, __pyx_L3_error)
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.libev.corecext._flags_to_list", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4_flags_to_list(__pyx_self, ((unsigned int)__pyx_v_flags));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_4_flags_to_list(CYTHON_UNUSED PyObject *__pyx_self, unsigned int __pyx_v_flags) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_flags_to_list", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __pyx_f_6gevent_5libev_8corecext__flags_to_list(__pyx_v_flags, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 170, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.libev.corecext._flags_to_list", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0171:     cdef list result = []
+
+  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 171, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_v_result = ((PyObject*)__pyx_t_1);
+  __pyx_t_1 = 0;
+
+0172:     for code, value in _flags:
+
+  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 172, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
+    __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
+    __pyx_t_4 = NULL;
+  } else {
+    __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 172, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 172, __pyx_L1_error)
+  }
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  for (;;) {
+    if (likely(!__pyx_t_4)) {
+      if (likely(PyList_CheckExact(__pyx_t_2))) {
+        if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
+        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 172, __pyx_L1_error)
+        #else
+        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 172, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_1);
+        #endif
+      } else {
+        if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
+        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 172, __pyx_L1_error)
+        #else
+        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 172, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_1);
+        #endif
+      }
+    } else {
+      __pyx_t_1 = __pyx_t_4(__pyx_t_2);
+      if (unlikely(!__pyx_t_1)) {
+        PyObject* exc_type = PyErr_Occurred();
+        if (exc_type) {
+          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+          else __PYX_ERR(0, 172, __pyx_L1_error)
+        }
+        break;
+      }
+      __Pyx_GOTREF(__pyx_t_1);
+    }
+    if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
+      PyObject* sequence = __pyx_t_1;
+      Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
+      if (unlikely(size != 2)) {
+        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
+        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
+        __PYX_ERR(0, 172, __pyx_L1_error)
+      }
+      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+      if (likely(PyTuple_CheckExact(sequence))) {
+        __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); 
+        __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); 
+      } else {
+        __pyx_t_5 = PyList_GET_ITEM(sequence, 0); 
+        __pyx_t_6 = PyList_GET_ITEM(sequence, 1); 
+      }
+      __Pyx_INCREF(__pyx_t_5);
+      __Pyx_INCREF(__pyx_t_6);
+      #else
+      __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 172, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_5);
+      __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 172, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_6);
+      #endif
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    } else {
+      Py_ssize_t index = -1;
+      __pyx_t_7 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 172, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_7);
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
+      index = 0; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L5_unpacking_failed;
+      __Pyx_GOTREF(__pyx_t_5);
+      index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed;
+      __Pyx_GOTREF(__pyx_t_6);
+      if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(0, 172, __pyx_L1_error)
+      __pyx_t_8 = NULL;
+      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+      goto __pyx_L6_unpacking_done;
+      __pyx_L5_unpacking_failed:;
+      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+      __pyx_t_8 = NULL;
+      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
+      __PYX_ERR(0, 172, __pyx_L1_error)
+      __pyx_L6_unpacking_done:;
+    }
+    __Pyx_XDECREF_SET(__pyx_v_code, __pyx_t_5);
+    __pyx_t_5 = 0;
+    __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_6);
+    __pyx_t_6 = 0;
+
+  }
+  __pyx_L4_break:;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+0173:         if flags & code:
+
+    __pyx_t_1 = __Pyx_PyInt_From_unsigned_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 173, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __pyx_t_6 = PyNumber_And(__pyx_t_1, __pyx_v_code); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 173, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_6);
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 173, __pyx_L1_error)
+    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+    if (__pyx_t_9) {
+
+    }
+
+0174:             result.append(value)
+
+      __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_value); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(0, 174, __pyx_L1_error)
+
+0175:         flags &= ~code
+
+    __pyx_t_6 = __Pyx_PyInt_From_unsigned_int(__pyx_v_flags); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 175, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_6);
+    __pyx_t_1 = PyNumber_Invert(__pyx_v_code); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 175, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __pyx_t_5 = PyNumber_InPlaceAnd(__pyx_t_6, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 175, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_5);
+    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __pyx_t_11 = __Pyx_PyInt_As_unsigned_int(__pyx_t_5); if (unlikely((__pyx_t_11 == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 175, __pyx_L1_error)
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __pyx_v_flags = __pyx_t_11;
+
+0176:         if not flags:
+
+    __pyx_t_9 = ((!(__pyx_v_flags != 0)) != 0);
+    if (__pyx_t_9) {
+
+    }
+
+0177:             break
+
+      goto __pyx_L4_break;
+
+0178:     if flags:
+
+  __pyx_t_9 = (__pyx_v_flags != 0);
+  if (__pyx_t_9) {
+
+  }
+
+0179:         result.append(flags)
+
+    __pyx_t_2 = __Pyx_PyInt_From_unsigned_int(__pyx_v_flags); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 179, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_2); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(0, 179, __pyx_L1_error)
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+0180:     return result
+
+  __Pyx_XDECREF(__pyx_r);
+  __Pyx_INCREF(__pyx_v_result);
+  __pyx_r = __pyx_v_result;
+  goto __pyx_L0;
+
 0181: 
+
 0182: 
+
+0183: if sys.version_info[0] >= 3:
+
+  __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_sys); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 183, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_12);
+  __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_version_info); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 183, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_18);
+  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
+  __pyx_t_12 = __Pyx_GetItemInt(__pyx_t_18, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 183, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_12);
+  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
+  __pyx_t_18 = PyObject_RichCompare(__pyx_t_12, __pyx_int_3, Py_GE); __Pyx_XGOTREF(__pyx_t_18); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 183, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
+  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_18); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 183, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
+  if (__pyx_t_3) {
+
+    goto __pyx_L3;
+  }
+
+0184:     basestring = (bytes, str)
+
+    __pyx_t_18 = PyTuple_New(2); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 184, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_18);
+    __Pyx_INCREF(((PyObject *)(&PyBytes_Type)));
+    __Pyx_GIVEREF(((PyObject *)(&PyBytes_Type)));
+    PyTuple_SET_ITEM(__pyx_t_18, 0, ((PyObject *)(&PyBytes_Type)));
+    __Pyx_INCREF(((PyObject *)(&PyString_Type)));
+    __Pyx_GIVEREF(((PyObject *)(&PyString_Type)));
+    PyTuple_SET_ITEM(__pyx_t_18, 1, ((PyObject *)(&PyString_Type)));
+    if (PyDict_SetItem(__pyx_d, __pyx_n_s_basestring, __pyx_t_18) < 0) __PYX_ERR(0, 184, __pyx_L1_error)
+    __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
+
 0185: else:
+
+0186:     basestring = __builtins__.basestring
+
+  /*else*/ {
+    __Pyx_GetModuleGlobalName(__pyx_t_18, __pyx_n_s_builtins); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 186, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_18);
+    __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_18, __pyx_n_s_basestring); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 186, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_12);
+    __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
+    if (PyDict_SetItem(__pyx_d, __pyx_n_s_basestring, __pyx_t_12) < 0) __PYX_ERR(0, 186, __pyx_L1_error)
+    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
+  }
+  __pyx_L3:;
+
 0187: 
+
 0188: 
+
+0189: cpdef unsigned int _flags_to_int(object flags) except? -1:
+
+
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_7_flags_to_int(PyObject *__pyx_self, PyObject *__pyx_v_flags); /*proto*/
+static unsigned int __pyx_f_6gevent_5libev_8corecext__flags_to_int(PyObject *__pyx_v_flags, CYTHON_UNUSED int __pyx_skip_dispatch) {
+  unsigned int __pyx_v_result;
+  PyObject *__pyx_v_value = NULL;
+  PyObject *__pyx_v_ex = NULL;
+  unsigned int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_flags_to_int", 0);
+  __Pyx_INCREF(__pyx_v_flags);
+
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_8);
+  __Pyx_XDECREF(__pyx_t_9);
+  __Pyx_XDECREF(__pyx_t_12);
+  __Pyx_XDECREF(__pyx_t_13);
+  __Pyx_XDECREF(__pyx_t_15);
+  __Pyx_XDECREF(__pyx_t_16);
+  __Pyx_AddTraceback("gevent.libev.corecext._flags_to_int", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = -1;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_value);
+  __Pyx_XDECREF(__pyx_v_ex);
+  __Pyx_XDECREF(__pyx_v_flags);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_7_flags_to_int(PyObject *__pyx_self, PyObject *__pyx_v_flags); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_7_flags_to_int(PyObject *__pyx_self, PyObject *__pyx_v_flags) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_flags_to_int (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_6_flags_to_int(__pyx_self, ((PyObject *)__pyx_v_flags));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_6_flags_to_int(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_flags) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_flags_to_int", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __pyx_f_6gevent_5libev_8corecext__flags_to_int(__pyx_v_flags, 0); if (unlikely(__pyx_t_1 == ((unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 189, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyInt_From_unsigned_int(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 189, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_r = __pyx_t_2;
+  __pyx_t_2 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_AddTraceback("gevent.libev.corecext._flags_to_int", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
 0190:     # Note, that order does not matter, libev has its own predefined order
+
+0191:     if not flags:
+
+  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_flags); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 191, __pyx_L1_error)
+  __pyx_t_2 = ((!__pyx_t_1) != 0);
+  if (__pyx_t_2) {
+
+  }
+
+0192:         return 0
+
+    __pyx_r = 0;
+    goto __pyx_L0;
+
+0193:     if isinstance(flags, integer_types):
+
+  __pyx_t_3 = __pyx_v_6gevent_5libev_8corecext_integer_types;
+  __Pyx_INCREF(__pyx_t_3);
+  __pyx_t_2 = PyObject_IsInstance(__pyx_v_flags, __pyx_t_3); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 193, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __pyx_t_1 = (__pyx_t_2 != 0);
+  if (__pyx_t_1) {
+
+  }
+
+0194:         return flags
+
+    __pyx_t_4 = __Pyx_PyInt_As_unsigned_int(__pyx_v_flags); if (unlikely((__pyx_t_4 == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 194, __pyx_L1_error)
+    __pyx_r = __pyx_t_4;
+    goto __pyx_L0;
+
+0195:     cdef unsigned int result = 0
+
+  __pyx_v_result = 0;
+
+0196:     try:
+
+  {
+    /*try:*/ {
+
+    }
+    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+    goto __pyx_L10_try_end;
+    __pyx_L5_error:;
+    __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
+    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
+    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
+    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
+    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+
+    __Pyx_XGIVEREF(__pyx_t_5);
+    __Pyx_XGIVEREF(__pyx_t_6);
+    __Pyx_XGIVEREF(__pyx_t_7);
+    __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7);
+    goto __pyx_L1_error;
+    __pyx_L10_try_end:;
+  }
+
+0197:         if isinstance(flags, basestring):
+
+      __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_basestring); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 197, __pyx_L5_error)
+      __Pyx_GOTREF(__pyx_t_3);
+      __pyx_t_1 = PyObject_IsInstance(__pyx_v_flags, __pyx_t_3); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 197, __pyx_L5_error)
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __pyx_t_2 = (__pyx_t_1 != 0);
+      if (__pyx_t_2) {
+
+      }
+
+0198:             flags = flags.split(',')
+
+        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_flags, __pyx_n_s_split); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 198, __pyx_L5_error)
+        __Pyx_GOTREF(__pyx_t_8);
+        __pyx_t_9 = NULL;
+        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
+          __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8);
+          if (likely(__pyx_t_9)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
+            __Pyx_INCREF(__pyx_t_9);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_8, function);
+          }
+        }
+        __pyx_t_3 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_9, __pyx_kp_s_) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_kp_s_);
+        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
+        if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 198, __pyx_L5_error)
+        __Pyx_GOTREF(__pyx_t_3);
+        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+        __Pyx_DECREF_SET(__pyx_v_flags, __pyx_t_3);
+        __pyx_t_3 = 0;
+
+0199:         for value in flags:
+
+      if (likely(PyList_CheckExact(__pyx_v_flags)) || PyTuple_CheckExact(__pyx_v_flags)) {
+        __pyx_t_3 = __pyx_v_flags; __Pyx_INCREF(__pyx_t_3); __pyx_t_10 = 0;
+        __pyx_t_11 = NULL;
+      } else {
+        __pyx_t_10 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_flags); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 199, __pyx_L5_error)
+        __Pyx_GOTREF(__pyx_t_3);
+        __pyx_t_11 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 199, __pyx_L5_error)
+      }
+      for (;;) {
+        if (likely(!__pyx_t_11)) {
+          if (likely(PyList_CheckExact(__pyx_t_3))) {
+            if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_3)) break;
+            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+            __pyx_t_8 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_10); __Pyx_INCREF(__pyx_t_8); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 199, __pyx_L5_error)
+            #else
+            __pyx_t_8 = PySequence_ITEM(__pyx_t_3, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 199, __pyx_L5_error)
+            __Pyx_GOTREF(__pyx_t_8);
+            #endif
+          } else {
+            if (__pyx_t_10 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
+            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+            __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_10); __Pyx_INCREF(__pyx_t_8); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 199, __pyx_L5_error)
+            #else
+            __pyx_t_8 = PySequence_ITEM(__pyx_t_3, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 199, __pyx_L5_error)
+            __Pyx_GOTREF(__pyx_t_8);
+            #endif
+          }
+        } else {
+          __pyx_t_8 = __pyx_t_11(__pyx_t_3);
+          if (unlikely(!__pyx_t_8)) {
+            PyObject* exc_type = PyErr_Occurred();
+            if (exc_type) {
+              if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+              else __PYX_ERR(0, 199, __pyx_L5_error)
+            }
+            break;
+          }
+          __Pyx_GOTREF(__pyx_t_8);
+        }
+        __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_8);
+        __pyx_t_8 = 0;
+
+      }
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+
+0200:             value = value.strip().lower()
+
+        __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_value, __pyx_n_s_strip); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 200, __pyx_L5_error)
+        __Pyx_GOTREF(__pyx_t_12);
+        __pyx_t_13 = NULL;
+        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) {
+          __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_12);
+          if (likely(__pyx_t_13)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
+            __Pyx_INCREF(__pyx_t_13);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_12, function);
+          }
+        }
+        __pyx_t_9 = (__pyx_t_13) ? __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_13) : __Pyx_PyObject_CallNoArg(__pyx_t_12);
+        __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
+        if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 200, __pyx_L5_error)
+        __Pyx_GOTREF(__pyx_t_9);
+        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
+        __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_lower); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 200, __pyx_L5_error)
+        __Pyx_GOTREF(__pyx_t_12);
+        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+        __pyx_t_9 = NULL;
+        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) {
+          __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_12);
+          if (likely(__pyx_t_9)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
+            __Pyx_INCREF(__pyx_t_9);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_12, function);
+          }
+        }
+        __pyx_t_8 = (__pyx_t_9) ? __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_9) : __Pyx_PyObject_CallNoArg(__pyx_t_12);
+        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
+        if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 200, __pyx_L5_error)
+        __Pyx_GOTREF(__pyx_t_8);
+        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
+        __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_8);
+        __pyx_t_8 = 0;
+
+0201:             if value:
+
+        __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_value); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 201, __pyx_L5_error)
+        if (__pyx_t_2) {
+
+        }
+
+0202:                 result |= _flags_str2int[value]
+
+          __pyx_t_8 = __Pyx_PyInt_From_unsigned_int(__pyx_v_result); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 202, __pyx_L5_error)
+          __Pyx_GOTREF(__pyx_t_8);
+          __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_flags_str2int); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 202, __pyx_L5_error)
+          __Pyx_GOTREF(__pyx_t_12);
+          __pyx_t_9 = __Pyx_PyObject_GetItem(__pyx_t_12, __pyx_v_value); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 202, __pyx_L5_error)
+          __Pyx_GOTREF(__pyx_t_9);
+          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
+          __pyx_t_12 = PyNumber_InPlaceOr(__pyx_t_8, __pyx_t_9); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 202, __pyx_L5_error)
+          __Pyx_GOTREF(__pyx_t_12);
+          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+          __pyx_t_4 = __Pyx_PyInt_As_unsigned_int(__pyx_t_12); if (unlikely((__pyx_t_4 == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 202, __pyx_L5_error)
+          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
+          __pyx_v_result = __pyx_t_4;
+
+0203:     except KeyError as ex:
+
+    __pyx_t_14 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
+    if (__pyx_t_14) {
+      __Pyx_AddTraceback("gevent.libev.corecext._flags_to_int", __pyx_clineno, __pyx_lineno, __pyx_filename);
+      if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_12, &__pyx_t_9) < 0) __PYX_ERR(0, 203, __pyx_L7_except_error)
+      __Pyx_GOTREF(__pyx_t_3);
+      __Pyx_GOTREF(__pyx_t_12);
+      __Pyx_GOTREF(__pyx_t_9);
+      __Pyx_INCREF(__pyx_t_12);
+      __pyx_v_ex = __pyx_t_12;
+      /*try:*/ {
+
+      /*finally:*/ {
+        __pyx_L20_error:;
+        /*exception exit:*/{
+          __Pyx_PyThreadState_declare
+          __Pyx_PyThreadState_assign
+          __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_t_23 = 0; __pyx_t_24 = 0; __pyx_t_25 = 0;
+          __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
+          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
+          __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
+          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
+          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_23, &__pyx_t_24, &__pyx_t_25);
+          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22) < 0)) __Pyx_ErrFetch(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22);
+          __Pyx_XGOTREF(__pyx_t_20);
+          __Pyx_XGOTREF(__pyx_t_21);
+          __Pyx_XGOTREF(__pyx_t_22);
+          __Pyx_XGOTREF(__pyx_t_23);
+          __Pyx_XGOTREF(__pyx_t_24);
+          __Pyx_XGOTREF(__pyx_t_25);
+          __pyx_t_14 = __pyx_lineno; __pyx_t_18 = __pyx_clineno; __pyx_t_19 = __pyx_filename;
+          {
+            __Pyx_DECREF(__pyx_v_ex);
+            __pyx_v_ex = NULL;
+          }
+          if (PY_MAJOR_VERSION >= 3) {
+            __Pyx_XGIVEREF(__pyx_t_23);
+            __Pyx_XGIVEREF(__pyx_t_24);
+            __Pyx_XGIVEREF(__pyx_t_25);
+            __Pyx_ExceptionReset(__pyx_t_23, __pyx_t_24, __pyx_t_25);
+          }
+          __Pyx_XGIVEREF(__pyx_t_20);
+          __Pyx_XGIVEREF(__pyx_t_21);
+          __Pyx_XGIVEREF(__pyx_t_22);
+          __Pyx_ErrRestore(__pyx_t_20, __pyx_t_21, __pyx_t_22);
+          __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_t_23 = 0; __pyx_t_24 = 0; __pyx_t_25 = 0;
+          __pyx_lineno = __pyx_t_14; __pyx_clineno = __pyx_t_18; __pyx_filename = __pyx_t_19;
+          goto __pyx_L7_except_error;
+        }
+      }
+    }
+    goto __pyx_L7_except_error;
+    __pyx_L7_except_error:;
+
+0204:         raise ValueError('Invalid backend or flag: %s\nPossible values: %s' % (ex, ', '.join(sorted(_flags_str2int.keys()))))
+
+        __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_n_s_flags_str2int); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 204, __pyx_L20_error)
+        __Pyx_GOTREF(__pyx_t_15);
+        __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_n_s_keys); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 204, __pyx_L20_error)
+        __Pyx_GOTREF(__pyx_t_16);
+        __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
+        __pyx_t_15 = NULL;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_16))) {
+          __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_16);
+          if (likely(__pyx_t_15)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_16);
+            __Pyx_INCREF(__pyx_t_15);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_16, function);
+          }
+        }
+        __pyx_t_13 = (__pyx_t_15) ? __Pyx_PyObject_CallOneArg(__pyx_t_16, __pyx_t_15) : __Pyx_PyObject_CallNoArg(__pyx_t_16);
+        __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
+        if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 204, __pyx_L20_error)
+        __Pyx_GOTREF(__pyx_t_13);
+        __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
+        __pyx_t_16 = PySequence_List(__pyx_t_13); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 204, __pyx_L20_error)
+        __Pyx_GOTREF(__pyx_t_16);
+        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+        __pyx_t_8 = ((PyObject*)__pyx_t_16);
+        __pyx_t_16 = 0;
+        __pyx_t_17 = PyList_Sort(__pyx_t_8); if (unlikely(__pyx_t_17 == ((int)-1))) __PYX_ERR(0, 204, __pyx_L20_error)
+        __pyx_t_16 = __Pyx_PyString_Join(__pyx_kp_s__2, __pyx_t_8); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 204, __pyx_L20_error)
+        __Pyx_GOTREF(__pyx_t_16);
+        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+        __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 204, __pyx_L20_error)
+        __Pyx_GOTREF(__pyx_t_8);
+        __Pyx_INCREF(__pyx_v_ex);
+        __Pyx_GIVEREF(__pyx_v_ex);
+        PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_ex);
+        __Pyx_GIVEREF(__pyx_t_16);
+        PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_16);
+        __pyx_t_16 = 0;
+        __pyx_t_16 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_backend_or_flag_s_Possib, __pyx_t_8); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 204, __pyx_L20_error)
+        __Pyx_GOTREF(__pyx_t_16);
+        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+        __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_16); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 204, __pyx_L20_error)
+        __Pyx_GOTREF(__pyx_t_8);
+        __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
+        __Pyx_Raise(__pyx_t_8, 0, 0, 0);
+        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+        __PYX_ERR(0, 204, __pyx_L20_error)
+      }
+
+0205:     return result
+
+  __pyx_r = __pyx_v_result;
+  goto __pyx_L0;
+
 0206: 
+
 0207: 
+
+0208: cdef str _str_hex(object flag):
+
+
+static PyObject *__pyx_f_6gevent_5libev_8corecext__str_hex(PyObject *__pyx_v_flag) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_str_hex", 0);
+
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.libev.corecext._str_hex", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0209:     if isinstance(flag, integer_types):
+
+  __pyx_t_1 = __pyx_v_6gevent_5libev_8corecext_integer_types;
+  __Pyx_INCREF(__pyx_t_1);
+  __pyx_t_2 = PyObject_IsInstance(__pyx_v_flag, __pyx_t_1); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 209, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_3 = (__pyx_t_2 != 0);
+  if (__pyx_t_3) {
+
+  }
+
+0210:         return hex(flag)
+
+    __Pyx_XDECREF(__pyx_r);
+    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_hex, __pyx_v_flag); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 210, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    if (!(likely(PyString_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 210, __pyx_L1_error)
+    __pyx_r = ((PyObject*)__pyx_t_1);
+    __pyx_t_1 = 0;
+    goto __pyx_L0;
+
+0211:     return str(flag)
+
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyString_Type)), __pyx_v_flag); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 211, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (!(likely(PyString_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 211, __pyx_L1_error)
+  __pyx_r = ((PyObject*)__pyx_t_1);
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
 0212: 
+
 0213: 
+
+0214: cpdef _check_flags(unsigned int flags):
+
+
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_9_check_flags(PyObject *__pyx_self, PyObject *__pyx_arg_flags); /*proto*/
+static PyObject *__pyx_f_6gevent_5libev_8corecext__check_flags(unsigned int __pyx_v_flags, CYTHON_UNUSED int __pyx_skip_dispatch) {
+  PyObject *__pyx_v_as_list = 0;
+  PyObject *__pyx_8genexpr1__pyx_v_x = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_check_flags", 0);
+
+
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_AddTraceback("gevent.libev.corecext._check_flags", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_as_list);
+  __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_x);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_9_check_flags(PyObject *__pyx_self, PyObject *__pyx_arg_flags); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_9_check_flags(PyObject *__pyx_self, PyObject *__pyx_arg_flags) {
+  unsigned int __pyx_v_flags;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_check_flags (wrapper)", 0);
+  assert(__pyx_arg_flags); {
+    __pyx_v_flags = __Pyx_PyInt_As_unsigned_int(__pyx_arg_flags); if (unlikely((__pyx_v_flags == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 214, __pyx_L3_error)
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.libev.corecext._check_flags", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_8_check_flags(__pyx_self, ((unsigned int)__pyx_v_flags));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_8_check_flags(CYTHON_UNUSED PyObject *__pyx_self, unsigned int __pyx_v_flags) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_check_flags", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __pyx_f_6gevent_5libev_8corecext__check_flags(__pyx_v_flags, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 214, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.libev.corecext._check_flags", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
 0215:     cdef list as_list
+
+0216:     flags &= libev.EVBACKEND_MASK
+
+  __pyx_v_flags = (__pyx_v_flags & EVBACKEND_MASK);
+
+0217:     if not flags:
+
+  __pyx_t_1 = ((!(__pyx_v_flags != 0)) != 0);
+  if (__pyx_t_1) {
+
+  }
+
+0218:         return
+
+    __Pyx_XDECREF(__pyx_r);
+    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+    goto __pyx_L0;
+
+0219:     if not (flags & libev.EVBACKEND_ALL):
+
+  __pyx_t_1 = ((!((__pyx_v_flags & EVBACKEND_ALL) != 0)) != 0);
+  if (unlikely(__pyx_t_1)) {
+
+  }
+
+0220:         raise ValueError('Invalid value for backend: 0x%x' % flags)
+
+    __pyx_t_2 = __Pyx_PyInt_From_unsigned_int(__pyx_v_flags); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 220, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_value_for_backend_0x_x, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 220, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 220, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __PYX_ERR(0, 220, __pyx_L1_error)
+
+0221:     if not (flags & libev.ev_supported_backends()):
+
+  __pyx_t_1 = ((!((__pyx_v_flags & ev_supported_backends()) != 0)) != 0);
+  if (unlikely(__pyx_t_1)) {
+
+  }
+
+0222:         as_list = [_str_hex(x) for x in _flags_to_list(flags)]
+
+    { /* enter inner scope */
+      __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 222, __pyx_L8_error)
+      __Pyx_GOTREF(__pyx_t_2);
+      __pyx_t_3 = __pyx_f_6gevent_5libev_8corecext__flags_to_list(__pyx_v_flags, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 222, __pyx_L8_error)
+      __Pyx_GOTREF(__pyx_t_3);
+      if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
+        __pyx_t_4 = __pyx_t_3; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0;
+        __pyx_t_6 = NULL;
+      } else {
+        __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 222, __pyx_L8_error)
+        __Pyx_GOTREF(__pyx_t_4);
+        __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 222, __pyx_L8_error)
+      }
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+      for (;;) {
+        if (likely(!__pyx_t_6)) {
+          if (likely(PyList_CheckExact(__pyx_t_4))) {
+            if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break;
+            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+            __pyx_t_3 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 222, __pyx_L8_error)
+            #else
+            __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 222, __pyx_L8_error)
+            __Pyx_GOTREF(__pyx_t_3);
+            #endif
+          } else {
+            if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
+            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+            __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 222, __pyx_L8_error)
+            #else
+            __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 222, __pyx_L8_error)
+            __Pyx_GOTREF(__pyx_t_3);
+            #endif
+          }
+        } else {
+          __pyx_t_3 = __pyx_t_6(__pyx_t_4);
+          if (unlikely(!__pyx_t_3)) {
+            PyObject* exc_type = PyErr_Occurred();
+            if (exc_type) {
+              if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+              else __PYX_ERR(0, 222, __pyx_L8_error)
+            }
+            break;
+          }
+          __Pyx_GOTREF(__pyx_t_3);
+        }
+        __Pyx_XDECREF_SET(__pyx_8genexpr1__pyx_v_x, __pyx_t_3);
+        __pyx_t_3 = 0;
+        __pyx_t_3 = __pyx_f_6gevent_5libev_8corecext__str_hex(__pyx_8genexpr1__pyx_v_x); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 222, __pyx_L8_error)
+        __Pyx_GOTREF(__pyx_t_3);
+        if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 222, __pyx_L8_error)
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+      }
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_x); __pyx_8genexpr1__pyx_v_x = 0;
+      goto __pyx_L11_exit_scope;
+      __pyx_L8_error:;
+      __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_x); __pyx_8genexpr1__pyx_v_x = 0;
+      goto __pyx_L1_error;
+      __pyx_L11_exit_scope:;
+    } /* exit inner scope */
+    __pyx_v_as_list = ((PyObject*)__pyx_t_2);
+    __pyx_t_2 = 0;
+
+0223:         raise ValueError('Unsupported backend: %s' % '|'.join(as_list))
+
+    __pyx_t_2 = __Pyx_PyString_Join(__pyx_kp_s__3, __pyx_v_as_list); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 223, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Unsupported_backend_s, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 223, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 223, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __PYX_ERR(0, 223, __pyx_L1_error)
+
 0224: 
+
 0225: 
+
+0226: cpdef _events_to_str(int events):
+
+
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_11_events_to_str(PyObject *__pyx_self, PyObject *__pyx_arg_events); /*proto*/
+static PyObject *__pyx_f_6gevent_5libev_8corecext__events_to_str(int __pyx_v_events, CYTHON_UNUSED int __pyx_skip_dispatch) {
+  PyObject *__pyx_v_result = 0;
+  int __pyx_v_c_flag;
+  PyObject *__pyx_v_flag = NULL;
+  PyObject *__pyx_v_string = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_events_to_str", 0);
+
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_XDECREF(__pyx_t_6);
+  __Pyx_XDECREF(__pyx_t_7);
+  __Pyx_AddTraceback("gevent.libev.corecext._events_to_str", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_result);
+  __Pyx_XDECREF(__pyx_v_flag);
+  __Pyx_XDECREF(__pyx_v_string);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_11_events_to_str(PyObject *__pyx_self, PyObject *__pyx_arg_events); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_11_events_to_str(PyObject *__pyx_self, PyObject *__pyx_arg_events) {
+  int __pyx_v_events;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_events_to_str (wrapper)", 0);
+  assert(__pyx_arg_events); {
+    __pyx_v_events = __Pyx_PyInt_As_int(__pyx_arg_events); if (unlikely((__pyx_v_events == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 226, __pyx_L3_error)
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.libev.corecext._events_to_str", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_10_events_to_str(__pyx_self, ((int)__pyx_v_events));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_10_events_to_str(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_events) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_events_to_str", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __pyx_f_6gevent_5libev_8corecext__events_to_str(__pyx_v_events, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 226, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.libev.corecext._events_to_str", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0227:     cdef list result = []
+
+  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 227, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_v_result = ((PyObject*)__pyx_t_1);
+  __pyx_t_1 = 0;
+
 0228:     cdef int c_flag
+
+0229:     for (flag, string) in _events:
+
+  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_events); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 229, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
+    __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
+    __pyx_t_4 = NULL;
+  } else {
+    __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 229, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 229, __pyx_L1_error)
+  }
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  for (;;) {
+    if (likely(!__pyx_t_4)) {
+      if (likely(PyList_CheckExact(__pyx_t_2))) {
+        if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
+        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 229, __pyx_L1_error)
+        #else
+        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 229, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_1);
+        #endif
+      } else {
+        if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
+        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 229, __pyx_L1_error)
+        #else
+        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 229, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_1);
+        #endif
+      }
+    } else {
+      __pyx_t_1 = __pyx_t_4(__pyx_t_2);
+      if (unlikely(!__pyx_t_1)) {
+        PyObject* exc_type = PyErr_Occurred();
+        if (exc_type) {
+          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+          else __PYX_ERR(0, 229, __pyx_L1_error)
+        }
+        break;
+      }
+      __Pyx_GOTREF(__pyx_t_1);
+    }
+    if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
+      PyObject* sequence = __pyx_t_1;
+      Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
+      if (unlikely(size != 2)) {
+        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
+        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
+        __PYX_ERR(0, 229, __pyx_L1_error)
+      }
+      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+      if (likely(PyTuple_CheckExact(sequence))) {
+        __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); 
+        __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); 
+      } else {
+        __pyx_t_5 = PyList_GET_ITEM(sequence, 0); 
+        __pyx_t_6 = PyList_GET_ITEM(sequence, 1); 
+      }
+      __Pyx_INCREF(__pyx_t_5);
+      __Pyx_INCREF(__pyx_t_6);
+      #else
+      __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 229, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_5);
+      __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 229, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_6);
+      #endif
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    } else {
+      Py_ssize_t index = -1;
+      __pyx_t_7 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 229, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_7);
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
+      index = 0; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L5_unpacking_failed;
+      __Pyx_GOTREF(__pyx_t_5);
+      index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed;
+      __Pyx_GOTREF(__pyx_t_6);
+      if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(0, 229, __pyx_L1_error)
+      __pyx_t_8 = NULL;
+      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+      goto __pyx_L6_unpacking_done;
+      __pyx_L5_unpacking_failed:;
+      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+      __pyx_t_8 = NULL;
+      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
+      __PYX_ERR(0, 229, __pyx_L1_error)
+      __pyx_L6_unpacking_done:;
+    }
+    __Pyx_XDECREF_SET(__pyx_v_flag, __pyx_t_5);
+    __pyx_t_5 = 0;
+    __Pyx_XDECREF_SET(__pyx_v_string, __pyx_t_6);
+    __pyx_t_6 = 0;
+
+  }
+  __pyx_L4_break:;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+0230:         c_flag = flag
+
+    __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_v_flag); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 230, __pyx_L1_error)
+    __pyx_v_c_flag = __pyx_t_9;
+
+0231:         if events & c_flag:
+
+    __pyx_t_10 = ((__pyx_v_events & __pyx_v_c_flag) != 0);
+    if (__pyx_t_10) {
+
+    }
+
+0232:             result.append(string)
+
+      __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_string); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 232, __pyx_L1_error)
+
+0233:             events = events & (~c_flag)
+
+      __pyx_v_events = (__pyx_v_events & (~__pyx_v_c_flag));
+
+0234:         if not events:
+
+    __pyx_t_10 = ((!(__pyx_v_events != 0)) != 0);
+    if (__pyx_t_10) {
+
+    }
+
+0235:             break
+
+      goto __pyx_L4_break;
+
+0236:     if events:
+
+  __pyx_t_10 = (__pyx_v_events != 0);
+  if (__pyx_t_10) {
+
+  }
+
+0237:         result.append(hex(events))
+
+    __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_events); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 237, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_hex, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 237, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_1); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 237, __pyx_L1_error)
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+0238:     return '|'.join(result)
+
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __Pyx_PyString_Join(__pyx_kp_s__3, __pyx_v_result); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 238, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
 0239: 
+
 0240: 
+
+0241: def supported_backends():
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_13supported_backends(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyMethodDef __pyx_mdef_6gevent_5libev_8corecext_13supported_backends = {"supported_backends", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_13supported_backends, METH_NOARGS, 0};
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_13supported_backends(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("supported_backends (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_12supported_backends(__pyx_self);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_12supported_backends(CYTHON_UNUSED PyObject *__pyx_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("supported_backends", 0);
+
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.libev.corecext.supported_backends", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+  __pyx_t_12 = PyCFunction_NewEx(&__pyx_mdef_6gevent_5libev_8corecext_13supported_backends, NULL, __pyx_n_s_gevent_libev_corecext); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 241, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_12);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_supported_backends, __pyx_t_12) < 0) __PYX_ERR(0, 241, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
+
+  __pyx_codeobj__24 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_libev_corecext_pyx, __pyx_n_s_supported_backends, 241, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__24)) __PYX_ERR(0, 241, __pyx_L1_error)
+
+0242:     return _flags_to_list(libev.ev_supported_backends())
+
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __pyx_f_6gevent_5libev_8corecext__flags_to_list(ev_supported_backends(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 242, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
 0243: 
+
 0244: 
+
+0245: def recommended_backends():
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_15recommended_backends(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyMethodDef __pyx_mdef_6gevent_5libev_8corecext_15recommended_backends = {"recommended_backends", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_15recommended_backends, METH_NOARGS, 0};
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_15recommended_backends(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("recommended_backends (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_14recommended_backends(__pyx_self);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_14recommended_backends(CYTHON_UNUSED PyObject *__pyx_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("recommended_backends", 0);
+
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.libev.corecext.recommended_backends", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+  __pyx_t_12 = PyCFunction_NewEx(&__pyx_mdef_6gevent_5libev_8corecext_15recommended_backends, NULL, __pyx_n_s_gevent_libev_corecext); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 245, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_12);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_recommended_backends, __pyx_t_12) < 0) __PYX_ERR(0, 245, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
+
+  __pyx_codeobj__25 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_libev_corecext_pyx, __pyx_n_s_recommended_backends, 245, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__25)) __PYX_ERR(0, 245, __pyx_L1_error)
+
+0246:     return _flags_to_list(libev.ev_recommended_backends())
+
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __pyx_f_6gevent_5libev_8corecext__flags_to_list(ev_recommended_backends(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 246, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
 0247: 
+
 0248: 
+
+0249: def embeddable_backends():
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_17embeddable_backends(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyMethodDef __pyx_mdef_6gevent_5libev_8corecext_17embeddable_backends = {"embeddable_backends", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_17embeddable_backends, METH_NOARGS, 0};
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_17embeddable_backends(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("embeddable_backends (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_16embeddable_backends(__pyx_self);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_16embeddable_backends(CYTHON_UNUSED PyObject *__pyx_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("embeddable_backends", 0);
+
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.libev.corecext.embeddable_backends", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+  __pyx_t_12 = PyCFunction_NewEx(&__pyx_mdef_6gevent_5libev_8corecext_17embeddable_backends, NULL, __pyx_n_s_gevent_libev_corecext); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 249, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_12);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_embeddable_backends, __pyx_t_12) < 0) __PYX_ERR(0, 249, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
+
+  __pyx_codeobj__26 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_libev_corecext_pyx, __pyx_n_s_embeddable_backends, 249, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__26)) __PYX_ERR(0, 249, __pyx_L1_error)
+
+0250:     return _flags_to_list(libev.ev_embeddable_backends())
+
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __pyx_f_6gevent_5libev_8corecext__flags_to_list(ev_embeddable_backends(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 250, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
 0251: 
+
 0252: 
+
+0253: def time():
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_19time(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyMethodDef __pyx_mdef_6gevent_5libev_8corecext_19time = {"time", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_19time, METH_NOARGS, 0};
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_19time(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("time (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_18time(__pyx_self);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_18time(CYTHON_UNUSED PyObject *__pyx_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("time", 0);
+
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.libev.corecext.time", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+  __pyx_t_12 = PyCFunction_NewEx(&__pyx_mdef_6gevent_5libev_8corecext_19time, NULL, __pyx_n_s_gevent_libev_corecext); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 253, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_12);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_time, __pyx_t_12) < 0) __PYX_ERR(0, 253, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
+
+0254:     return libev.ev_time()
+
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = PyFloat_FromDouble(ev_time()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 254, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
 0255: 
+
+0256: cdef bint _check_loop(loop loop) except -1:
+
+
+static int __pyx_f_6gevent_5libev_8corecext__check_loop(struct PyGeventLoopObject *__pyx_v_loop) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_check_loop", 0);
+
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_AddTraceback("gevent.libev.corecext._check_loop", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = -1;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0257:     if not loop._ptr:
+
+  __pyx_t_1 = ((!(__pyx_v_loop->_ptr != 0)) != 0);
+  if (unlikely(__pyx_t_1)) {
+
+  }
+
+0258:         raise ValueError('operation on destroyed loop')
+
+    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 258, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __PYX_ERR(0, 258, __pyx_L1_error)
+
+  __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 258, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__4);
+  __Pyx_GIVEREF(__pyx_tuple__4);
+
+0259:     return 1
+
+  __pyx_r = 1;
+  goto __pyx_L0;
+
 0260: 
+
 0261: 
+
 0262: 
+
+0263: cdef public class callback [object PyGeventCallbackObject, type PyGeventCallback_Type]:
+
+struct PyGeventCallbackObject {
+  PyObject_HEAD
+  PyObject *callback;
+  PyObject *args;
+  struct PyGeventCallbackObject *next;
+};
+
+__PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyGeventCallback_Type;
+
+0264:     cdef public object callback
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_8callback_8callback_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_8callback_8callback_1__get__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_8callback_8callback___get__(((struct PyGeventCallbackObject *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_8callback_8callback___get__(struct PyGeventCallbackObject *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __Pyx_INCREF(__pyx_v_self->callback);
+  __pyx_r = __pyx_v_self->callback;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static int __pyx_pw_6gevent_5libev_8corecext_8callback_8callback_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
+static int __pyx_pw_6gevent_5libev_8corecext_8callback_8callback_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_8callback_8callback_2__set__(((struct PyGeventCallbackObject *)__pyx_v_self), ((PyObject *)__pyx_v_value));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_5libev_8corecext_8callback_8callback_2__set__(struct PyGeventCallbackObject *__pyx_v_self, PyObject *__pyx_v_value) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__set__", 0);
+  __Pyx_INCREF(__pyx_v_value);
+  __Pyx_GIVEREF(__pyx_v_value);
+  __Pyx_GOTREF(__pyx_v_self->callback);
+  __Pyx_DECREF(__pyx_v_self->callback);
+  __pyx_v_self->callback = __pyx_v_value;
+
+  /* function exit code */
+  __pyx_r = 0;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static int __pyx_pw_6gevent_5libev_8corecext_8callback_8callback_5__del__(PyObject *__pyx_v_self); /*proto*/
+static int __pyx_pw_6gevent_5libev_8corecext_8callback_8callback_5__del__(PyObject *__pyx_v_self) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_8callback_8callback_4__del__(((struct PyGeventCallbackObject *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_5libev_8corecext_8callback_8callback_4__del__(struct PyGeventCallbackObject *__pyx_v_self) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__del__", 0);
+  __Pyx_INCREF(Py_None);
+  __Pyx_GIVEREF(Py_None);
+  __Pyx_GOTREF(__pyx_v_self->callback);
+  __Pyx_DECREF(__pyx_v_self->callback);
+  __pyx_v_self->callback = Py_None;
+
+  /* function exit code */
+  __pyx_r = 0;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0265:     cdef public tuple args
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_8callback_4args_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_8callback_4args_1__get__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_8callback_4args___get__(((struct PyGeventCallbackObject *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_8callback_4args___get__(struct PyGeventCallbackObject *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __Pyx_INCREF(__pyx_v_self->args);
+  __pyx_r = __pyx_v_self->args;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static int __pyx_pw_6gevent_5libev_8corecext_8callback_4args_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
+static int __pyx_pw_6gevent_5libev_8corecext_8callback_4args_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_8callback_4args_2__set__(((struct PyGeventCallbackObject *)__pyx_v_self), ((PyObject *)__pyx_v_value));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_5libev_8corecext_8callback_4args_2__set__(struct PyGeventCallbackObject *__pyx_v_self, PyObject *__pyx_v_value) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__set__", 0);
+  if (!(likely(PyTuple_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v_value)->tp_name), 0))) __PYX_ERR(0, 265, __pyx_L1_error)
+  __pyx_t_1 = __pyx_v_value;
+  __Pyx_INCREF(__pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_1);
+  __Pyx_GOTREF(__pyx_v_self->args);
+  __Pyx_DECREF(__pyx_v_self->args);
+  __pyx_v_self->args = ((PyObject*)__pyx_t_1);
+  __pyx_t_1 = 0;
+
+  /* function exit code */
+  __pyx_r = 0;
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.libev.corecext.callback.args.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = -1;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static int __pyx_pw_6gevent_5libev_8corecext_8callback_4args_5__del__(PyObject *__pyx_v_self); /*proto*/
+static int __pyx_pw_6gevent_5libev_8corecext_8callback_4args_5__del__(PyObject *__pyx_v_self) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_8callback_4args_4__del__(((struct PyGeventCallbackObject *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_5libev_8corecext_8callback_4args_4__del__(struct PyGeventCallbackObject *__pyx_v_self) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__del__", 0);
+  __Pyx_INCREF(Py_None);
+  __Pyx_GIVEREF(Py_None);
+  __Pyx_GOTREF(__pyx_v_self->args);
+  __Pyx_DECREF(__pyx_v_self->args);
+  __pyx_v_self->args = ((PyObject*)Py_None);
+
+  /* function exit code */
+  __pyx_r = 0;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
 0266:     cdef callback next
+
 0267: 
+
+0268:     def __init__(self, callback, args):
+
+
+/* Python wrapper */
+static int __pyx_pw_6gevent_5libev_8corecext_8callback_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static int __pyx_pw_6gevent_5libev_8corecext_8callback_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_callback = 0;
+  PyObject *__pyx_v_args = 0;
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_callback,&__pyx_n_s_args,0};
+    PyObject* values[2] = {0,0};
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_callback)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args)) != 0)) kw_args--;
+        else {
+          __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(0, 268, __pyx_L3_error)
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 268, __pyx_L3_error)
+      }
+    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
+      goto __pyx_L5_argtuple_error;
+    } else {
+      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+    }
+    __pyx_v_callback = values[0];
+    __pyx_v_args = values[1];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 268, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.libev.corecext.callback.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return -1;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_8callback___init__(((struct PyGeventCallbackObject *)__pyx_v_self), __pyx_v_callback, __pyx_v_args);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_5libev_8corecext_8callback___init__(struct PyGeventCallbackObject *__pyx_v_self, PyObject *__pyx_v_callback, PyObject *__pyx_v_args) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__", 0);
+
+
+  /* function exit code */
+  __pyx_r = 0;
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.libev.corecext.callback.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = -1;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0269:         self.callback = callback
+
+  __Pyx_INCREF(__pyx_v_callback);
+  __Pyx_GIVEREF(__pyx_v_callback);
+  __Pyx_GOTREF(__pyx_v_self->callback);
+  __Pyx_DECREF(__pyx_v_self->callback);
+  __pyx_v_self->callback = __pyx_v_callback;
+
+0270:         self.args = args
+
+  if (!(likely(PyTuple_CheckExact(__pyx_v_args))||((__pyx_v_args) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v_args)->tp_name), 0))) __PYX_ERR(0, 270, __pyx_L1_error)
+  __pyx_t_1 = __pyx_v_args;
+  __Pyx_INCREF(__pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_1);
+  __Pyx_GOTREF(__pyx_v_self->args);
+  __Pyx_DECREF(__pyx_v_self->args);
+  __pyx_v_self->args = ((PyObject*)__pyx_t_1);
+  __pyx_t_1 = 0;
+
 0271: 
+
+0272:     def stop(self):
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_8callback_3stop(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_8callback_3stop(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("stop (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_8callback_2stop(((struct PyGeventCallbackObject *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_8callback_2stop(struct PyGeventCallbackObject *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("stop", 0);
+
+
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0273:         self.callback = None
+
+  __Pyx_INCREF(Py_None);
+  __Pyx_GIVEREF(Py_None);
+  __Pyx_GOTREF(__pyx_v_self->callback);
+  __Pyx_DECREF(__pyx_v_self->callback);
+  __pyx_v_self->callback = Py_None;
+
+0274:         self.args = None
+
+  __Pyx_INCREF(Py_None);
+  __Pyx_GIVEREF(Py_None);
+  __Pyx_GOTREF(__pyx_v_self->args);
+  __Pyx_DECREF(__pyx_v_self->args);
+  __pyx_v_self->args = ((PyObject*)Py_None);
+
 0275: 
+
+0276:     close = stop
+
+  __Pyx_GetNameInClass(__pyx_t_12, (PyObject *)__pyx_ptype_6gevent_5libev_8corecext_callback, __pyx_n_s_stop); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 276, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_12);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_5libev_8corecext_callback->tp_dict, __pyx_n_s_close, __pyx_t_12) < 0) __PYX_ERR(0, 276, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_5libev_8corecext_callback);
+
 0277: 
+
 0278:     # Note, that __nonzero__ and pending are different
+
 0279:     # nonzero is used in contexts where we need to know whether to schedule another callback,
+
 0280:     # so it's true if it's pending or currently running
+
 0281:     # 'pending' has the same meaning as libev watchers: it is cleared before entering callback
+
 0282: 
+
+0283:     def __nonzero__(self):
+
+
+/* Python wrapper */
+static int __pyx_pw_6gevent_5libev_8corecext_8callback_5__nonzero__(PyObject *__pyx_v_self); /*proto*/
+static int __pyx_pw_6gevent_5libev_8corecext_8callback_5__nonzero__(PyObject *__pyx_v_self) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__nonzero__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_8callback_4__nonzero__(((struct PyGeventCallbackObject *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_5libev_8corecext_8callback_4__nonzero__(struct PyGeventCallbackObject *__pyx_v_self) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__nonzero__", 0);
+
+
+  /* function exit code */
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
 0284:         # it's nonzero if it's pending or currently executing
+
+0285:         return self.args is not None
+
+  __pyx_t_1 = (__pyx_v_self->args != ((PyObject*)Py_None));
+  __pyx_r = __pyx_t_1;
+  goto __pyx_L0;
+
 0286: 
+
 0287:     @property
+
+0288:     def pending(self):
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_8callback_7pending_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_8callback_7pending_1__get__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_8callback_7pending___get__(((struct PyGeventCallbackObject *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_8callback_7pending___get__(struct PyGeventCallbackObject *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__", 0);
+
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_AddTraceback("gevent.libev.corecext.callback.pending.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0289:         return self.callback is not None
+
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = (__pyx_v_self->callback != Py_None);
+  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 289, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_r = __pyx_t_2;
+  __pyx_t_2 = 0;
+  goto __pyx_L0;
+
 0290: 
+
+0291:     def __repr__(self):
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_8callback_7__repr__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_8callback_7__repr__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_8callback_6__repr__(((struct PyGeventCallbackObject *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_8callback_6__repr__(struct PyGeventCallbackObject *__pyx_v_self) {
+  PyObject *__pyx_v_format = NULL;
+  PyObject *__pyx_v_result = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__repr__", 0);
+
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_AddTraceback("gevent.libev.corecext.callback.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_format);
+  __Pyx_XDECREF(__pyx_v_result);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0292:         if Py_ReprEnter(self) != 0:
+
+  __pyx_t_1 = ((Py_ReprEnter(((PyObject *)__pyx_v_self)) != 0) != 0);
+  if (__pyx_t_1) {
+
+  }
+
+0293:             return "<...>"
+
+    __Pyx_XDECREF(__pyx_r);
+    __Pyx_INCREF(__pyx_kp_s__5);
+    __pyx_r = __pyx_kp_s__5;
+    goto __pyx_L0;
+
+0294:         try:
+
+  /*try:*/ {
+
+0295:             format = self._format()
+
+    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 295, __pyx_L5_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __pyx_t_4 = NULL;
+    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
+      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+      if (likely(__pyx_t_4)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+        __Pyx_INCREF(__pyx_t_4);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_3, function);
+      }
+    }
+    __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
+    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 295, __pyx_L5_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __pyx_v_format = __pyx_t_2;
+    __pyx_t_2 = 0;
+
+0296:             result = "<%s at 0x%x%s" % (self.__class__.__name__, id(self), format)
+
+    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 296, __pyx_L5_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 296, __pyx_L5_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 296, __pyx_L5_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 296, __pyx_L5_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_GIVEREF(__pyx_t_3);
+    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
+    __Pyx_GIVEREF(__pyx_t_2);
+    PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
+    __Pyx_INCREF(__pyx_v_format);
+    __Pyx_GIVEREF(__pyx_v_format);
+    PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_format);
+    __pyx_t_3 = 0;
+    __pyx_t_2 = 0;
+    __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_s_at_0x_x_s, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 296, __pyx_L5_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __pyx_v_result = ((PyObject*)__pyx_t_2);
+    __pyx_t_2 = 0;
+
+0297:             if self.pending:
+
+    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_pending); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 297, __pyx_L5_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 297, __pyx_L5_error)
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    if (__pyx_t_1) {
+
+    }
+
+0298:                 result += " pending"
+
+      __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_kp_s_pending_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 298, __pyx_L5_error)
+      __Pyx_GOTREF(__pyx_t_2);
+      __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_2));
+      __pyx_t_2 = 0;
+
+0299:             if self.callback is not None:
+
+    __pyx_t_1 = (__pyx_v_self->callback != Py_None);
+    __pyx_t_5 = (__pyx_t_1 != 0);
+    if (__pyx_t_5) {
+
+    }
+
+0300:                 result += " callback=%r" % (self.callback, )
+
+      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 300, __pyx_L5_error)
+      __Pyx_GOTREF(__pyx_t_2);
+      __Pyx_INCREF(__pyx_v_self->callback);
+      __Pyx_GIVEREF(__pyx_v_self->callback);
+      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_self->callback);
+      __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_callback_r, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 300, __pyx_L5_error)
+      __Pyx_GOTREF(__pyx_t_4);
+      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+      __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 300, __pyx_L5_error)
+      __Pyx_GOTREF(__pyx_t_2);
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_2));
+      __pyx_t_2 = 0;
+
+0301:             if self.args is not None:
+
+    __pyx_t_5 = (__pyx_v_self->args != ((PyObject*)Py_None));
+    __pyx_t_1 = (__pyx_t_5 != 0);
+    if (__pyx_t_1) {
+
+    }
+
+0302:                 result += " args=%r" % (self.args, )
+
+      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 302, __pyx_L5_error)
+      __Pyx_GOTREF(__pyx_t_2);
+      __Pyx_INCREF(__pyx_v_self->args);
+      __Pyx_GIVEREF(__pyx_v_self->args);
+      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_self->args);
+      __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_args_r, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 302, __pyx_L5_error)
+      __Pyx_GOTREF(__pyx_t_4);
+      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+      __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 302, __pyx_L5_error)
+      __Pyx_GOTREF(__pyx_t_2);
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_2));
+      __pyx_t_2 = 0;
+
+0303:             if self.callback is None and self.args is None:
+
+    __pyx_t_5 = (__pyx_v_self->callback == Py_None);
+    __pyx_t_6 = (__pyx_t_5 != 0);
+    if (__pyx_t_6) {
+    } else {
+      __pyx_t_1 = __pyx_t_6;
+      goto __pyx_L11_bool_binop_done;
+    }
+    __pyx_t_6 = (__pyx_v_self->args == ((PyObject*)Py_None));
+    __pyx_t_5 = (__pyx_t_6 != 0);
+    __pyx_t_1 = __pyx_t_5;
+    __pyx_L11_bool_binop_done:;
+    if (__pyx_t_1) {
+
+    }
+
+0304:                 result += " stopped"
+
+      __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_kp_s_stopped); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 304, __pyx_L5_error)
+      __Pyx_GOTREF(__pyx_t_2);
+      __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_2));
+      __pyx_t_2 = 0;
+
+0305:             return result + ">"
+
+    __Pyx_XDECREF(__pyx_r);
+    __pyx_t_2 = PyNumber_Add(__pyx_v_result, __pyx_kp_s__6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 305, __pyx_L5_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_r = __pyx_t_2;
+    __pyx_t_2 = 0;
+    goto __pyx_L4_return;
+  }
+
 0306:         finally:
+
+0307:             Py_ReprLeave(self)
+
+  /*finally:*/ {
+    __pyx_L5_error:;
+    /*exception exit:*/{
+      __Pyx_PyThreadState_declare
+      __Pyx_PyThreadState_assign
+      __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0;
+      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+      if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15);
+      if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12) < 0)) __Pyx_ErrFetch(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
+      __Pyx_XGOTREF(__pyx_t_10);
+      __Pyx_XGOTREF(__pyx_t_11);
+      __Pyx_XGOTREF(__pyx_t_12);
+      __Pyx_XGOTREF(__pyx_t_13);
+      __Pyx_XGOTREF(__pyx_t_14);
+      __Pyx_XGOTREF(__pyx_t_15);
+      __pyx_t_7 = __pyx_lineno; __pyx_t_8 = __pyx_clineno; __pyx_t_9 = __pyx_filename;
+      {
+        Py_ReprLeave(((PyObject *)__pyx_v_self));
+      }
+      if (PY_MAJOR_VERSION >= 3) {
+        __Pyx_XGIVEREF(__pyx_t_13);
+        __Pyx_XGIVEREF(__pyx_t_14);
+        __Pyx_XGIVEREF(__pyx_t_15);
+        __Pyx_ExceptionReset(__pyx_t_13, __pyx_t_14, __pyx_t_15);
+      }
+      __Pyx_XGIVEREF(__pyx_t_10);
+      __Pyx_XGIVEREF(__pyx_t_11);
+      __Pyx_XGIVEREF(__pyx_t_12);
+      __Pyx_ErrRestore(__pyx_t_10, __pyx_t_11, __pyx_t_12);
+      __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0;
+      __pyx_lineno = __pyx_t_7; __pyx_clineno = __pyx_t_8; __pyx_filename = __pyx_t_9;
+      goto __pyx_L1_error;
+    }
+    __pyx_L4_return: {
+      __pyx_t_15 = __pyx_r;
+      __pyx_r = 0;
+      Py_ReprLeave(((PyObject *)__pyx_v_self));
+      __pyx_r = __pyx_t_15;
+      __pyx_t_15 = 0;
+      goto __pyx_L0;
+    }
+  }
+
 0308: 
+
+0309:     def _format(self):
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_8callback_9_format(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_8callback_9_format(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_format (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_8callback_8_format(((struct PyGeventCallbackObject *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_8callback_8_format(CYTHON_UNUSED struct PyGeventCallbackObject *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_format", 0);
+
+
+  /* function exit code */
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0310:         return ''
+
+  __Pyx_XDECREF(__pyx_r);
+  __Pyx_INCREF(__pyx_kp_s__7);
+  __pyx_r = __pyx_kp_s__7;
+  goto __pyx_L0;
+
 0311: 
+
 0312: DEF CALLBACK_CHECK_COUNT = 50
+
 0313: 
+
 0314: @cython.final
+
 0315: @cython.internal
+
+0316: cdef class CallbackFIFO(object):
+
+struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO {
+  PyObject_HEAD
+  struct __pyx_vtabstruct_6gevent_5libev_8corecext_CallbackFIFO *__pyx_vtab;
+  struct PyGeventCallbackObject *head;
+  struct PyGeventCallbackObject *tail;
+};
+
+
+
+struct __pyx_vtabstruct_6gevent_5libev_8corecext_CallbackFIFO {
+  struct PyGeventCallbackObject *(*popleft)(struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *);
+  PyObject *(*append)(struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *, struct PyGeventCallbackObject *);
+  int (*has_callbacks)(struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *);
+};
+static struct __pyx_vtabstruct_6gevent_5libev_8corecext_CallbackFIFO *__pyx_vtabptr_6gevent_5libev_8corecext_CallbackFIFO;
+static CYTHON_INLINE struct PyGeventCallbackObject *__pyx_f_6gevent_5libev_8corecext_12CallbackFIFO_popleft(struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *);
+static CYTHON_INLINE PyObject *__pyx_f_6gevent_5libev_8corecext_12CallbackFIFO_append(struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *, struct PyGeventCallbackObject *);
+static int __pyx_f_6gevent_5libev_8corecext_12CallbackFIFO_has_callbacks(struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *);
+
+__PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyGeventLoop_Type;
+
 0317:     cdef callback head
+
 0318:     cdef callback tail
+
 0319: 
+
+0320:     def __init__(self):
+
+
+/* Python wrapper */
+static int __pyx_pw_6gevent_5libev_8corecext_12CallbackFIFO_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static int __pyx_pw_6gevent_5libev_8corecext_12CallbackFIFO_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
+  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
+    __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
+  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1;
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_12CallbackFIFO___init__(((struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_5libev_8corecext_12CallbackFIFO___init__(struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *__pyx_v_self) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__", 0);
+
+
+  /* function exit code */
+  __pyx_r = 0;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0321:         self.head = None
+
+  __Pyx_INCREF(Py_None);
+  __Pyx_GIVEREF(Py_None);
+  __Pyx_GOTREF(__pyx_v_self->head);
+  __Pyx_DECREF(((PyObject *)__pyx_v_self->head));
+  __pyx_v_self->head = ((struct PyGeventCallbackObject *)Py_None);
+
+0322:         self.tail = None
+
+  __Pyx_INCREF(Py_None);
+  __Pyx_GIVEREF(Py_None);
+  __Pyx_GOTREF(__pyx_v_self->tail);
+  __Pyx_DECREF(((PyObject *)__pyx_v_self->tail));
+  __pyx_v_self->tail = ((struct PyGeventCallbackObject *)Py_None);
+
 0323: 
+
+0324:     cdef inline callback popleft(self):
+
+
+static CYTHON_INLINE struct PyGeventCallbackObject *__pyx_f_6gevent_5libev_8corecext_12CallbackFIFO_popleft(struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *__pyx_v_self) {
+  struct PyGeventCallbackObject *__pyx_v_head = 0;
+  struct PyGeventCallbackObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("popleft", 0);
+
+
+  /* function exit code */
+  __pyx_L0:;
+  __Pyx_XDECREF((PyObject *)__pyx_v_head);
+  __Pyx_XGIVEREF((PyObject *)__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0325:         cdef callback head = self.head
+
+  __pyx_t_1 = ((PyObject *)__pyx_v_self->head);
+  __Pyx_INCREF(__pyx_t_1);
+  __pyx_v_head = ((struct PyGeventCallbackObject *)__pyx_t_1);
+  __pyx_t_1 = 0;
+
+0326:         self.head = head.next
+
+  __pyx_t_1 = ((PyObject *)__pyx_v_head->next);
+  __Pyx_INCREF(__pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_1);
+  __Pyx_GOTREF(__pyx_v_self->head);
+  __Pyx_DECREF(((PyObject *)__pyx_v_self->head));
+  __pyx_v_self->head = ((struct PyGeventCallbackObject *)__pyx_t_1);
+  __pyx_t_1 = 0;
+
+0327:         if self.head is self.tail or self.head is None:
+
+  __pyx_t_3 = (__pyx_v_self->head == __pyx_v_self->tail);
+  __pyx_t_4 = (__pyx_t_3 != 0);
+  if (!__pyx_t_4) {
+  } else {
+    __pyx_t_2 = __pyx_t_4;
+    goto __pyx_L4_bool_binop_done;
+  }
+  __pyx_t_4 = (((PyObject *)__pyx_v_self->head) == Py_None);
+  __pyx_t_3 = (__pyx_t_4 != 0);
+  __pyx_t_2 = __pyx_t_3;
+  __pyx_L4_bool_binop_done:;
+  if (__pyx_t_2) {
+
+  }
+
+0328:             self.tail = None
+
+    __Pyx_INCREF(Py_None);
+    __Pyx_GIVEREF(Py_None);
+    __Pyx_GOTREF(__pyx_v_self->tail);
+    __Pyx_DECREF(((PyObject *)__pyx_v_self->tail));
+    __pyx_v_self->tail = ((struct PyGeventCallbackObject *)Py_None);
+
+0329:         head.next = None
+
+  __Pyx_INCREF(Py_None);
+  __Pyx_GIVEREF(Py_None);
+  __Pyx_GOTREF(__pyx_v_head->next);
+  __Pyx_DECREF(((PyObject *)__pyx_v_head->next));
+  __pyx_v_head->next = ((struct PyGeventCallbackObject *)Py_None);
+
+0330:         return head
+
+  __Pyx_XDECREF(((PyObject *)__pyx_r));
+  __Pyx_INCREF(((PyObject *)__pyx_v_head));
+  __pyx_r = __pyx_v_head;
+  goto __pyx_L0;
+
 0331: 
+
 0332: 
+
+0333:     cdef inline append(self, callback new_tail):
+
+
+static CYTHON_INLINE PyObject *__pyx_f_6gevent_5libev_8corecext_12CallbackFIFO_append(struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *__pyx_v_self, struct PyGeventCallbackObject *__pyx_v_new_tail) {
+  struct PyGeventCallbackObject *__pyx_v_old_tail = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("append", 0);
+
+
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_AddTraceback("gevent.libev.corecext.CallbackFIFO.append", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XDECREF((PyObject *)__pyx_v_old_tail);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0334:         assert not new_tail.next
+
+  #ifndef CYTHON_WITHOUT_ASSERTIONS
+  if (unlikely(!Py_OptimizeFlag)) {
+    __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_new_tail->next)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 334, __pyx_L1_error)
+    if (unlikely(!((!__pyx_t_1) != 0))) {
+      PyErr_SetNone(PyExc_AssertionError);
+      __PYX_ERR(0, 334, __pyx_L1_error)
+    }
+  }
+  #endif
+
+0335:         if self.tail is None:
+
+  __pyx_t_1 = (((PyObject *)__pyx_v_self->tail) == Py_None);
+  __pyx_t_2 = (__pyx_t_1 != 0);
+  if (__pyx_t_2) {
+
+  }
+
+0336:             if self.head is None:
+
+    __pyx_t_2 = (((PyObject *)__pyx_v_self->head) == Py_None);
+    __pyx_t_1 = (__pyx_t_2 != 0);
+    if (__pyx_t_1) {
+
+    }
+
 0337:                 # Completely empty, so this
+
 0338:                 # is now our head
+
+0339:                 self.head = new_tail
+
+      __Pyx_INCREF(((PyObject *)__pyx_v_new_tail));
+      __Pyx_GIVEREF(((PyObject *)__pyx_v_new_tail));
+      __Pyx_GOTREF(__pyx_v_self->head);
+      __Pyx_DECREF(((PyObject *)__pyx_v_self->head));
+      __pyx_v_self->head = __pyx_v_new_tail;
+
+0340:                 return
+
+      __Pyx_XDECREF(__pyx_r);
+      __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+      goto __pyx_L0;
+
+0341:             self.tail = self.head
+
+    __pyx_t_3 = ((PyObject *)__pyx_v_self->head);
+    __Pyx_INCREF(__pyx_t_3);
+    __Pyx_GIVEREF(__pyx_t_3);
+    __Pyx_GOTREF(__pyx_v_self->tail);
+    __Pyx_DECREF(((PyObject *)__pyx_v_self->tail));
+    __pyx_v_self->tail = ((struct PyGeventCallbackObject *)__pyx_t_3);
+    __pyx_t_3 = 0;
+
 0342: 
+
 0343: 
+
+0344:         assert self.head is not None
+
+  #ifndef CYTHON_WITHOUT_ASSERTIONS
+  if (unlikely(!Py_OptimizeFlag)) {
+    __pyx_t_1 = (((PyObject *)__pyx_v_self->head) != Py_None);
+    if (unlikely(!(__pyx_t_1 != 0))) {
+      PyErr_SetNone(PyExc_AssertionError);
+      __PYX_ERR(0, 344, __pyx_L1_error)
+    }
+  }
+  #endif
+
+0345:         old_tail = self.tail
+
+  __pyx_t_3 = ((PyObject *)__pyx_v_self->tail);
+  __Pyx_INCREF(__pyx_t_3);
+  __pyx_v_old_tail = ((struct PyGeventCallbackObject *)__pyx_t_3);
+  __pyx_t_3 = 0;
+
+0346:         old_tail.next = new_tail
+
+  __Pyx_INCREF(((PyObject *)__pyx_v_new_tail));
+  __Pyx_GIVEREF(((PyObject *)__pyx_v_new_tail));
+  __Pyx_GOTREF(__pyx_v_old_tail->next);
+  __Pyx_DECREF(((PyObject *)__pyx_v_old_tail->next));
+  __pyx_v_old_tail->next = __pyx_v_new_tail;
+
+0347:         self.tail = new_tail
+
+  __Pyx_INCREF(((PyObject *)__pyx_v_new_tail));
+  __Pyx_GIVEREF(((PyObject *)__pyx_v_new_tail));
+  __Pyx_GOTREF(__pyx_v_self->tail);
+  __Pyx_DECREF(((PyObject *)__pyx_v_self->tail));
+  __pyx_v_self->tail = __pyx_v_new_tail;
+
 0348: 
+
+0349:     def __nonzero__(self):
+
+
+/* Python wrapper */
+static int __pyx_pw_6gevent_5libev_8corecext_12CallbackFIFO_3__nonzero__(PyObject *__pyx_v_self); /*proto*/
+static int __pyx_pw_6gevent_5libev_8corecext_12CallbackFIFO_3__nonzero__(PyObject *__pyx_v_self) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__nonzero__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_12CallbackFIFO_2__nonzero__(((struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_5libev_8corecext_12CallbackFIFO_2__nonzero__(struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *__pyx_v_self) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__nonzero__", 0);
+
+
+  /* function exit code */
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0350:         return self.head is not None
+
+  __pyx_t_1 = (((PyObject *)__pyx_v_self->head) != Py_None);
+  __pyx_r = __pyx_t_1;
+  goto __pyx_L0;
+
 0351: 
+
+0352:     def __len__(self):
+
+
+/* Python wrapper */
+static Py_ssize_t __pyx_pw_6gevent_5libev_8corecext_12CallbackFIFO_5__len__(PyObject *__pyx_v_self); /*proto*/
+static Py_ssize_t __pyx_pw_6gevent_5libev_8corecext_12CallbackFIFO_5__len__(PyObject *__pyx_v_self) {
+  Py_ssize_t __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_12CallbackFIFO_4__len__(((struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static Py_ssize_t __pyx_pf_6gevent_5libev_8corecext_12CallbackFIFO_4__len__(struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *__pyx_v_self) {
+  Py_ssize_t __pyx_v_count;
+  struct PyGeventCallbackObject *__pyx_v_head = NULL;
+  Py_ssize_t __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__len__", 0);
+
+
+  /* function exit code */
+  __pyx_L0:;
+  __Pyx_XDECREF((PyObject *)__pyx_v_head);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0353:         cdef Py_ssize_t count = 0
+
+  __pyx_v_count = 0;
+
+0354:         head = self.head
+
+  __pyx_t_1 = ((PyObject *)__pyx_v_self->head);
+  __Pyx_INCREF(__pyx_t_1);
+  __pyx_v_head = ((struct PyGeventCallbackObject *)__pyx_t_1);
+  __pyx_t_1 = 0;
+
+0355:         while head is not None:
+
+  while (1) {
+    __pyx_t_2 = (((PyObject *)__pyx_v_head) != Py_None);
+    __pyx_t_3 = (__pyx_t_2 != 0);
+    if (!__pyx_t_3) break;
+
+0356:             count += 1
+
+    __pyx_v_count = (__pyx_v_count + 1);
+
+0357:             head = head.next
+
+    __pyx_t_1 = ((PyObject *)__pyx_v_head->next);
+    __Pyx_INCREF(__pyx_t_1);
+    __Pyx_DECREF_SET(__pyx_v_head, ((struct PyGeventCallbackObject *)__pyx_t_1));
+    __pyx_t_1 = 0;
+  }
+
+0358:         return count
+
+  __pyx_r = __pyx_v_count;
+  goto __pyx_L0;
+
 0359: 
+
+0360:     def __iter__(self):
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_12CallbackFIFO_7__iter__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_12CallbackFIFO_7__iter__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_12CallbackFIFO_6__iter__(((struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_12CallbackFIFO_6__iter__(struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *__pyx_v_self) {
+  PyObject *__pyx_v_objects = 0;
+  struct PyGeventCallbackObject *__pyx_v_head = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__iter__", 0);
+
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.libev.corecext.CallbackFIFO.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_objects);
+  __Pyx_XDECREF((PyObject *)__pyx_v_head);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0361:         cdef list objects = []
+
+  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 361, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_v_objects = ((PyObject*)__pyx_t_1);
+  __pyx_t_1 = 0;
+
+0362:         head = self.head
+
+  __pyx_t_1 = ((PyObject *)__pyx_v_self->head);
+  __Pyx_INCREF(__pyx_t_1);
+  __pyx_v_head = ((struct PyGeventCallbackObject *)__pyx_t_1);
+  __pyx_t_1 = 0;
+
+0363:         while head is not None:
+
+  while (1) {
+    __pyx_t_2 = (((PyObject *)__pyx_v_head) != Py_None);
+    __pyx_t_3 = (__pyx_t_2 != 0);
+    if (!__pyx_t_3) break;
+
+0364:             objects.append(head)
+
+    __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_objects, ((PyObject *)__pyx_v_head)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 364, __pyx_L1_error)
+
+0365:             head = head.next
+
+    __pyx_t_1 = ((PyObject *)__pyx_v_head->next);
+    __Pyx_INCREF(__pyx_t_1);
+    __Pyx_DECREF_SET(__pyx_v_head, ((struct PyGeventCallbackObject *)__pyx_t_1));
+    __pyx_t_1 = 0;
+  }
+
+0366:         return iter(objects)
+
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = PyObject_GetIter(__pyx_v_objects); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 366, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
 0367: 
+
+0368:     cdef bint has_callbacks(self):
+
+
+static int __pyx_f_6gevent_5libev_8corecext_12CallbackFIFO_has_callbacks(struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *__pyx_v_self) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("has_callbacks", 0);
+
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_WriteUnraisable("gevent.libev.corecext.CallbackFIFO.has_callbacks", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0369:         return self.head
+
+  __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_self->head)); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 369, __pyx_L1_error)
+  __pyx_r = __pyx_t_1;
+  goto __pyx_L0;
+
 0370: 
+
+0371:     def __repr__(self):
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_12CallbackFIFO_9__repr__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_12CallbackFIFO_9__repr__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_12CallbackFIFO_8__repr__(((struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_12CallbackFIFO_8__repr__(struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__repr__", 0);
+
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_AddTraceback("gevent.libev.corecext.CallbackFIFO.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0372:         return "<callbacks@%r len=%d head=%r tail=%r>" % (id(self), len(self), self.head, self.tail)
+
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 372, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_self)); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 372, __pyx_L1_error)
+  __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 372, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __pyx_t_4 = PyTuple_New(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 372, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_4);
+  __Pyx_GIVEREF(__pyx_t_1);
+  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_3);
+  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
+  __Pyx_INCREF(((PyObject *)__pyx_v_self->head));
+  __Pyx_GIVEREF(((PyObject *)__pyx_v_self->head));
+  PyTuple_SET_ITEM(__pyx_t_4, 2, ((PyObject *)__pyx_v_self->head));
+  __Pyx_INCREF(((PyObject *)__pyx_v_self->tail));
+  __Pyx_GIVEREF(((PyObject *)__pyx_v_self->tail));
+  PyTuple_SET_ITEM(__pyx_t_4, 3, ((PyObject *)__pyx_v_self->tail));
+  __pyx_t_1 = 0;
+  __pyx_t_3 = 0;
+  __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_callbacks_r_len_d_head_r_tail_r, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 372, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __pyx_r = __pyx_t_3;
+  __pyx_t_3 = 0;
+  goto __pyx_L0;
+
 0373: 
+
 0374: 
+
+0375: cdef public class loop [object PyGeventLoopObject, type PyGeventLoop_Type]:
+
+struct PyGeventLoopObject {
+  PyObject_HEAD
+  struct __pyx_vtabstruct_6gevent_5libev_8corecext_loop *__pyx_vtab;
+  struct ev_prepare _prepare;
+  struct ev_timer _timer0;
+  struct ev_timer _periodic_signal_checker;
+  PyObject *error_handler;
+  struct ev_loop *_ptr;
+  struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *_callbacks;
+  int starting_timer_may_update_loop_time;
+  int _default;
+  double approx_timer_resolution;
+};
+
+__PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyGeventLoop_Type;
+
+
+struct __pyx_vtabstruct_6gevent_5libev_8corecext_loop {
+  PyObject *(*_run_callbacks)(struct PyGeventLoopObject *);
+  PyObject *(*_stop_watchers)(struct PyGeventLoopObject *, struct ev_loop *);
+  PyObject *(*handle_error)(struct PyGeventLoopObject *, PyObject *, PyObject *, PyObject *, PyObject *, int __pyx_skip_dispatch);
+  PyObject *(*_default_handle_error)(struct PyGeventLoopObject *, PyObject *, PyObject *, PyObject *, PyObject *, int __pyx_skip_dispatch);
+  ev_tstamp (*now)(struct PyGeventLoopObject *, int __pyx_skip_dispatch);
+  void (*update_now)(struct PyGeventLoopObject *, int __pyx_skip_dispatch);
+};
+static struct __pyx_vtabstruct_6gevent_5libev_8corecext_loop *__pyx_vtabptr_6gevent_5libev_8corecext_loop;
+
 0376:     ## embedded struct members
+
 0377:     cdef libev.ev_prepare _prepare
+
 0378:     cdef libev.ev_timer _timer0
+
 0379:     # We'll only actually start this timer if we're on Windows,
+
 0380:     # but it doesn't hurt to compile it in on all platforms.
+
 0381:     cdef libev.ev_timer _periodic_signal_checker
+
 0382: 
+
 0383:     ## pointer members
+
+0384:     cdef public object error_handler
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_13error_handler_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_13error_handler_1__get__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_13error_handler___get__(((struct PyGeventLoopObject *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_13error_handler___get__(struct PyGeventLoopObject *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __Pyx_INCREF(__pyx_v_self->error_handler);
+  __pyx_r = __pyx_v_self->error_handler;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static int __pyx_pw_6gevent_5libev_8corecext_4loop_13error_handler_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
+static int __pyx_pw_6gevent_5libev_8corecext_4loop_13error_handler_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_13error_handler_2__set__(((struct PyGeventLoopObject *)__pyx_v_self), ((PyObject *)__pyx_v_value));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_5libev_8corecext_4loop_13error_handler_2__set__(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_value) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__set__", 0);
+  __Pyx_INCREF(__pyx_v_value);
+  __Pyx_GIVEREF(__pyx_v_value);
+  __Pyx_GOTREF(__pyx_v_self->error_handler);
+  __Pyx_DECREF(__pyx_v_self->error_handler);
+  __pyx_v_self->error_handler = __pyx_v_value;
+
+  /* function exit code */
+  __pyx_r = 0;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static int __pyx_pw_6gevent_5libev_8corecext_4loop_13error_handler_5__del__(PyObject *__pyx_v_self); /*proto*/
+static int __pyx_pw_6gevent_5libev_8corecext_4loop_13error_handler_5__del__(PyObject *__pyx_v_self) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_13error_handler_4__del__(((struct PyGeventLoopObject *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_5libev_8corecext_4loop_13error_handler_4__del__(struct PyGeventLoopObject *__pyx_v_self) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__del__", 0);
+  __Pyx_INCREF(Py_None);
+  __Pyx_GIVEREF(Py_None);
+  __Pyx_GOTREF(__pyx_v_self->error_handler);
+  __Pyx_DECREF(__pyx_v_self->error_handler);
+  __pyx_v_self->error_handler = Py_None;
+
+  /* function exit code */
+  __pyx_r = 0;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
 0385:     cdef libev.ev_loop* _ptr
+
+0386:     cdef public CallbackFIFO _callbacks
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_10_callbacks_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_10_callbacks_1__get__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_10_callbacks___get__(((struct PyGeventLoopObject *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_10_callbacks___get__(struct PyGeventLoopObject *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __Pyx_INCREF(((PyObject *)__pyx_v_self->_callbacks));
+  __pyx_r = ((PyObject *)__pyx_v_self->_callbacks);
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static int __pyx_pw_6gevent_5libev_8corecext_4loop_10_callbacks_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
+static int __pyx_pw_6gevent_5libev_8corecext_4loop_10_callbacks_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_10_callbacks_2__set__(((struct PyGeventLoopObject *)__pyx_v_self), ((PyObject *)__pyx_v_value));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_5libev_8corecext_4loop_10_callbacks_2__set__(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_value) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__set__", 0);
+  if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_6gevent_5libev_8corecext_CallbackFIFO))))) __PYX_ERR(0, 386, __pyx_L1_error)
+  __pyx_t_1 = __pyx_v_value;
+  __Pyx_INCREF(__pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_1);
+  __Pyx_GOTREF(__pyx_v_self->_callbacks);
+  __Pyx_DECREF(((PyObject *)__pyx_v_self->_callbacks));
+  __pyx_v_self->_callbacks = ((struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *)__pyx_t_1);
+  __pyx_t_1 = 0;
+
+  /* function exit code */
+  __pyx_r = 0;
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.libev.corecext.loop._callbacks.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = -1;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static int __pyx_pw_6gevent_5libev_8corecext_4loop_10_callbacks_5__del__(PyObject *__pyx_v_self); /*proto*/
+static int __pyx_pw_6gevent_5libev_8corecext_4loop_10_callbacks_5__del__(PyObject *__pyx_v_self) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_10_callbacks_4__del__(((struct PyGeventLoopObject *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_5libev_8corecext_4loop_10_callbacks_4__del__(struct PyGeventLoopObject *__pyx_v_self) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__del__", 0);
+  __Pyx_INCREF(Py_None);
+  __Pyx_GIVEREF(Py_None);
+  __Pyx_GOTREF(__pyx_v_self->_callbacks);
+  __Pyx_DECREF(((PyObject *)__pyx_v_self->_callbacks));
+  __pyx_v_self->_callbacks = ((struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *)Py_None);
+
+  /* function exit code */
+  __pyx_r = 0;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
 0387: 
+
 0388:     ## data members
+
 0389:     cdef bint starting_timer_may_update_loop_time
+
 0390:     # We must capture the 'default' state at initialiaztion
+
 0391:     # time. Destroying the default loop in libev sets
+
 0392:     # the libev internal pointer to 0, and ev_is_default_loop will
+
 0393:     # no longer work.
+
 0394:     cdef bint _default
+
+0395:     cdef readonly double approx_timer_resolution
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_23approx_timer_resolution_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_23approx_timer_resolution_1__get__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_23approx_timer_resolution___get__(((struct PyGeventLoopObject *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_23approx_timer_resolution___get__(struct PyGeventLoopObject *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->approx_timer_resolution); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 395, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.libev.corecext.loop.approx_timer_resolution.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
 0396: 
+
+0397:     def __cinit__(self, object flags=None, object default=None, libev.intptr_t ptr=0):
+
+
+/* Python wrapper */
+static int __pyx_pw_6gevent_5libev_8corecext_4loop_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static int __pyx_pw_6gevent_5libev_8corecext_4loop_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_flags = 0;
+  PyObject *__pyx_v_default = 0;
+  intptr_t __pyx_v_ptr;
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_flags_2,&__pyx_n_s_default,&__pyx_n_s_ptr,0};
+    PyObject* values[3] = {0,0,0};
+    values[0] = ((PyObject *)Py_None);
+    values[1] = ((PyObject *)Py_None);
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flags_2);
+          if (value) { values[0] = value; kw_args--; }
+        }
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_default);
+          if (value) { values[1] = value; kw_args--; }
+        }
+        CYTHON_FALLTHROUGH;
+        case  2:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ptr);
+          if (value) { values[2] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 397, __pyx_L3_error)
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    __pyx_v_flags = values[0];
+    __pyx_v_default = values[1];
+    if (values[2]) {
+      __pyx_v_ptr = __Pyx_PyIndex_AsSsize_t(values[2]); if (unlikely((__pyx_v_ptr == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 397, __pyx_L3_error)
+    } else {
+      __pyx_v_ptr = ((intptr_t)0);
+    }
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 397, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.libev.corecext.loop.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return -1;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop___cinit__(((struct PyGeventLoopObject *)__pyx_v_self), __pyx_v_flags, __pyx_v_default, __pyx_v_ptr);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_5libev_8corecext_4loop___cinit__(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_flags, PyObject *__pyx_v_default, intptr_t __pyx_v_ptr) {
+  unsigned int __pyx_v_c_flags;
+  CYTHON_UNUSED PyObject *__pyx_v_old_handler = 0;
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__cinit__", 0);
+  __Pyx_INCREF(__pyx_v_default);
+
+
+  /* function exit code */
+  __pyx_r = 0;
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_AddTraceback("gevent.libev.corecext.loop.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = -1;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_old_handler);
+  __Pyx_XDECREF(__pyx_v_default);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0398:         self.starting_timer_may_update_loop_time = 0
+
+  __pyx_v_self->starting_timer_may_update_loop_time = 0;
+
+0399:         self._default = 0
+
+  __pyx_v_self->_default = 0;
+
+0400:         libev.ev_prepare_init(&self._prepare,
+
+  ev_prepare_init((&__pyx_v_self->_prepare), ((void *)gevent_run_callbacks));
+
 0401:                               <void*>gevent_run_callbacks)
+
+0402:         libev.ev_timer_init(&self._periodic_signal_checker,
+
+  ev_timer_init((&__pyx_v_self->_periodic_signal_checker), ((void *)gevent_periodic_signal_check), 0.3, 0.3);
+
 0403:                             <void*>gevent_periodic_signal_check,
+
 0404:                             0.3, 0.3)
+
+0405:         libev.ev_timer_init(&self._timer0,
+
+  ev_timer_init((&__pyx_v_self->_timer0), ((void *)gevent_noop), 0.0, 0.0);
+
 0406:                             <void*>gevent_noop,
+
 0407:                             0.0, 0.0)
+
 0408: 
+
 0409:         cdef unsigned int c_flags
+
+0410:         cdef object old_handler = None
+
+  __Pyx_INCREF(Py_None);
+  __pyx_v_old_handler = Py_None;
+
+0411:         if ptr:
+
+  __pyx_t_1 = (__pyx_v_ptr != 0);
+  if (__pyx_t_1) {
+
+    goto __pyx_L3;
+  }
+
+0412:             self._ptr = <libev.ev_loop*>ptr
+
+    __pyx_v_self->_ptr = ((struct ev_loop *)__pyx_v_ptr);
+
+0413:             self._default = libev.ev_is_default_loop(self._ptr)
+
+    __pyx_v_self->_default = ev_is_default_loop(__pyx_v_self->_ptr);
+
 0414:         else:
+
+0415:             c_flags = _flags_to_int(flags)
+
+  /*else*/ {
+    __pyx_t_2 = __pyx_f_6gevent_5libev_8corecext__flags_to_int(__pyx_v_flags, 0); if (unlikely(__pyx_t_2 == ((unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 415, __pyx_L1_error)
+    __pyx_v_c_flags = __pyx_t_2;
+
+0416:             _check_flags(c_flags)
+
+    __pyx_t_3 = __pyx_f_6gevent_5libev_8corecext__check_flags(__pyx_v_c_flags, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 416, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+
+0417:             c_flags |= libev.EVFLAG_NOENV
+
+    __pyx_v_c_flags = (__pyx_v_c_flags | EVFLAG_NOENV);
+
+0418:             c_flags |= libev.EVFLAG_FORKCHECK
+
+    __pyx_v_c_flags = (__pyx_v_c_flags | EVFLAG_FORKCHECK);
+
+0419:             if default is None:
+
+    __pyx_t_1 = (__pyx_v_default == Py_None);
+    __pyx_t_4 = (__pyx_t_1 != 0);
+    if (__pyx_t_4) {
+
+    }
+
+0420:                 default = True
+
+      __Pyx_INCREF(Py_True);
+      __Pyx_DECREF_SET(__pyx_v_default, Py_True);
+
+0421:             if default:
+
+    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_default); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 421, __pyx_L1_error)
+    if (__pyx_t_4) {
+
+      goto __pyx_L5;
+    }
+
+0422:                 self._default = 1
+
+      __pyx_v_self->_default = 1;
+
+0423:                 self._ptr = libev.gevent_ev_default_loop(c_flags)
+
+      __pyx_v_self->_ptr = gevent_ev_default_loop(__pyx_v_c_flags);
+
+0424:                 if not self._ptr:
+
+      __pyx_t_4 = ((!(__pyx_v_self->_ptr != 0)) != 0);
+      if (unlikely(__pyx_t_4)) {
+
+      }
+
+0425:                     raise SystemError("ev_default_loop(%s) failed" % (c_flags, ))
+
+        __pyx_t_3 = __Pyx_PyInt_From_unsigned_int(__pyx_v_c_flags); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 425, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_3);
+        __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 425, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_5);
+        __Pyx_GIVEREF(__pyx_t_3);
+        PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3);
+        __pyx_t_3 = 0;
+        __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_ev_default_loop_s_failed, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 425, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_3);
+        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+        __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_SystemError, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 425, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_5);
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __Pyx_Raise(__pyx_t_5, 0, 0, 0);
+        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+        __PYX_ERR(0, 425, __pyx_L1_error)
+
+0426:                 if sys.platform == "win32":
+
+      __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_sys); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 426, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_5);
+      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_platform); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 426, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_3);
+      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+      __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_t_3, __pyx_n_s_win32, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 426, __pyx_L1_error)
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+      if (__pyx_t_4) {
+
+      }
+
+0427:                     libev.ev_timer_start(self._ptr, &self._periodic_signal_checker)
+
+        ev_timer_start(__pyx_v_self->_ptr, (&__pyx_v_self->_periodic_signal_checker));
+
+0428:                     libev.ev_unref(self._ptr)
+
+        ev_unref(__pyx_v_self->_ptr);
+
 0429:             else:
+
+0430:                 self._ptr = libev.ev_loop_new(c_flags)
+
+    /*else*/ {
+      __pyx_v_self->_ptr = ev_loop_new(__pyx_v_c_flags);
+
+0431:                 if not self._ptr:
+
+      __pyx_t_4 = ((!(__pyx_v_self->_ptr != 0)) != 0);
+      if (unlikely(__pyx_t_4)) {
+
+      }
+    }
+    __pyx_L5:;
+
+0432:                     raise SystemError("ev_loop_new(%s) failed" % (c_flags, ))
+
+        __pyx_t_3 = __Pyx_PyInt_From_unsigned_int(__pyx_v_c_flags); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 432, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_3);
+        __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 432, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_5);
+        __Pyx_GIVEREF(__pyx_t_3);
+        PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3);
+        __pyx_t_3 = 0;
+        __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_ev_loop_new_s_failed, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 432, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_3);
+        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+        __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_SystemError, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 432, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_5);
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __Pyx_Raise(__pyx_t_5, 0, 0, 0);
+        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+        __PYX_ERR(0, 432, __pyx_L1_error)
+
+0433:             if default or __SYSERR_CALLBACK is None:
+
+    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_default); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 433, __pyx_L1_error)
+    if (!__pyx_t_1) {
+    } else {
+      __pyx_t_4 = __pyx_t_1;
+      goto __pyx_L10_bool_binop_done;
+    }
+    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_SYSERR_CALLBACK); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 433, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_5);
+    __pyx_t_1 = (__pyx_t_5 == Py_None);
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __pyx_t_6 = (__pyx_t_1 != 0);
+    __pyx_t_4 = __pyx_t_6;
+    __pyx_L10_bool_binop_done:;
+    if (__pyx_t_4) {
+
+    }
+  }
+  __pyx_L3:;
+
+0434:                 set_syserr_cb(self._handle_syserr)
+
+      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_handle_syserr); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 434, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_5);
+      __pyx_t_3 = __pyx_f_6gevent_5libev_8corecext_set_syserr_cb(__pyx_t_5, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 434, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_3);
+      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+
 0435: 
+
 0436:         # Mark as not destroyed
+
+0437:         libev.ev_set_userdata(self._ptr, self._ptr)
+
+  ev_set_userdata(__pyx_v_self->_ptr, __pyx_v_self->_ptr);
+
 0438: 
+
+0439:         libev.ev_prepare_start(self._ptr, &self._prepare)
+
+  ev_prepare_start(__pyx_v_self->_ptr, (&__pyx_v_self->_prepare));
+
+0440:         libev.ev_unref(self._ptr)
+
+  ev_unref(__pyx_v_self->_ptr);
+
 0441: 
+
+0442:     def __init__(self, object flags=None, object default=None, libev.intptr_t ptr=0):
+
+
+/* Python wrapper */
+static int __pyx_pw_6gevent_5libev_8corecext_4loop_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static int __pyx_pw_6gevent_5libev_8corecext_4loop_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  CYTHON_UNUSED PyObject *__pyx_v_flags = 0;
+  CYTHON_UNUSED PyObject *__pyx_v_default = 0;
+  CYTHON_UNUSED intptr_t __pyx_v_ptr;
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_flags_2,&__pyx_n_s_default,&__pyx_n_s_ptr,0};
+    PyObject* values[3] = {0,0,0};
+    values[0] = ((PyObject *)Py_None);
+    values[1] = ((PyObject *)Py_None);
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flags_2);
+          if (value) { values[0] = value; kw_args--; }
+        }
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_default);
+          if (value) { values[1] = value; kw_args--; }
+        }
+        CYTHON_FALLTHROUGH;
+        case  2:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ptr);
+          if (value) { values[2] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 442, __pyx_L3_error)
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    __pyx_v_flags = values[0];
+    __pyx_v_default = values[1];
+    if (values[2]) {
+      __pyx_v_ptr = __Pyx_PyIndex_AsSsize_t(values[2]); if (unlikely((__pyx_v_ptr == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 442, __pyx_L3_error)
+    } else {
+      __pyx_v_ptr = ((intptr_t)0);
+    }
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 442, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.libev.corecext.loop.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return -1;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_2__init__(((struct PyGeventLoopObject *)__pyx_v_self), __pyx_v_flags, __pyx_v_default, __pyx_v_ptr);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_5libev_8corecext_4loop_2__init__(struct PyGeventLoopObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_flags, CYTHON_UNUSED PyObject *__pyx_v_default, CYTHON_UNUSED intptr_t __pyx_v_ptr) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__", 0);
+
+
+  /* function exit code */
+  __pyx_r = 0;
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.libev.corecext.loop.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = -1;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0443:         self._callbacks = CallbackFIFO()
+
+  __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_6gevent_5libev_8corecext_CallbackFIFO)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 443, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_1);
+  __Pyx_GOTREF(__pyx_v_self->_callbacks);
+  __Pyx_DECREF(((PyObject *)__pyx_v_self->_callbacks));
+  __pyx_v_self->_callbacks = ((struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *)__pyx_t_1);
+  __pyx_t_1 = 0;
+
 0444:         # See libev.corecffi for this attribute.
+
+0445:         self.approx_timer_resolution = 0.00001
+
+  __pyx_v_self->approx_timer_resolution = 0.00001;
+
 0446: 
+
+0447:     cdef _run_callbacks(self):
+
+
+static PyObject *__pyx_f_6gevent_5libev_8corecext_4loop__run_callbacks(struct PyGeventLoopObject *__pyx_v_self) {
+  struct PyGeventCallbackObject *__pyx_v_cb = 0;
+  int __pyx_v_count;
+  ev_tstamp __pyx_v_now;
+  ev_tstamp __pyx_v_expiration;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_run_callbacks", 0);
+
+
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_AddTraceback("gevent.libev.corecext.loop._run_callbacks", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XDECREF((PyObject *)__pyx_v_cb);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
 0448:         cdef callback cb
+
 0449:         cdef object callbacks
+
+0450:         cdef int count = CALLBACK_CHECK_COUNT
+
+  __pyx_v_count = 50;
+
+0451:         self.starting_timer_may_update_loop_time = True
+
+  __pyx_v_self->starting_timer_may_update_loop_time = 1;
+
+0452:         cdef libev.ev_tstamp now = libev.ev_now(self._ptr)
+
+  __pyx_v_now = ev_now(__pyx_v_self->_ptr);
+
+0453:         cdef libev.ev_tstamp expiration = now + <libev.ev_tstamp>getswitchinterval()
+
+  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_getswitchinterval); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 453, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = NULL;
+  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
+    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+    if (likely(__pyx_t_3)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+      __Pyx_INCREF(__pyx_t_3);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_2, function);
+    }
+  }
+  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 453, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_4 == ((ev_tstamp)-1)) && PyErr_Occurred())) __PYX_ERR(0, 453, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_v_expiration = (__pyx_v_now + ((ev_tstamp)__pyx_t_4));
+
 0454: 
+
+0455:         try:
+
+  /*try:*/ {
+
+0456:             libev.ev_timer_stop(self._ptr, &self._timer0)
+
+    ev_timer_stop(__pyx_v_self->_ptr, (&__pyx_v_self->_timer0));
+
+0457:             while self._callbacks.head is not None:
+
+    while (1) {
+      __pyx_t_5 = (((PyObject *)__pyx_v_self->_callbacks->head) != Py_None);
+      __pyx_t_6 = (__pyx_t_5 != 0);
+      if (!__pyx_t_6) break;
+
+0458:                 cb = self._callbacks.popleft()
+
+      __pyx_t_1 = ((PyObject *)__pyx_f_6gevent_5libev_8corecext_12CallbackFIFO_popleft(__pyx_v_self->_callbacks)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 458, __pyx_L4_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      __Pyx_XDECREF_SET(__pyx_v_cb, ((struct PyGeventCallbackObject *)__pyx_t_1));
+      __pyx_t_1 = 0;
+
 0459: 
+
+0460:                 libev.ev_unref(self._ptr)
+
+      ev_unref(__pyx_v_self->_ptr);
+
+0461:                 gevent_call(self, cb) # XXX: Why is this a C callback, not cython?
+
+      gevent_call(__pyx_v_self, __pyx_v_cb);
+
+0462:                 count -= 1
+
+      __pyx_v_count = (__pyx_v_count - 1);
+
 0463: 
+
+0464:                 if count == 0 and self._callbacks.head is not None:
+
+      __pyx_t_5 = ((__pyx_v_count == 0) != 0);
+      if (__pyx_t_5) {
+      } else {
+        __pyx_t_6 = __pyx_t_5;
+        goto __pyx_L9_bool_binop_done;
+      }
+      __pyx_t_5 = (((PyObject *)__pyx_v_self->_callbacks->head) != Py_None);
+      __pyx_t_7 = (__pyx_t_5 != 0);
+      __pyx_t_6 = __pyx_t_7;
+      __pyx_L9_bool_binop_done:;
+      if (__pyx_t_6) {
+
+      }
+    }
+    __pyx_L7_break:;
+
 0465:                     # We still have more to run but we've reached
+
 0466:                     # the end of one check group
+
+0467:                     count = CALLBACK_CHECK_COUNT
+
+        __pyx_v_count = 50;
+
 0468: 
+
+0469:                     libev.ev_now_update(self._ptr)
+
+        ev_now_update(__pyx_v_self->_ptr);
+
+0470:                     if libev.ev_now(self._ptr) >= expiration:
+
+        __pyx_t_6 = ((ev_now(__pyx_v_self->_ptr) >= __pyx_v_expiration) != 0);
+        if (__pyx_t_6) {
+
+        }
+
+0471:                         now = 0
+
+          __pyx_v_now = 0.0;
+
+0472:                         break
+
+          goto __pyx_L7_break;
+
 0473: 
+
+0474:             if now != 0:
+
+    __pyx_t_6 = ((__pyx_v_now != 0.0) != 0);
+    if (__pyx_t_6) {
+
+    }
+
+0475:                 libev.ev_now_update(self._ptr)
+
+      ev_now_update(__pyx_v_self->_ptr);
+
+0476:             if self._callbacks.head is not None:
+
+    __pyx_t_6 = (((PyObject *)__pyx_v_self->_callbacks->head) != Py_None);
+    __pyx_t_7 = (__pyx_t_6 != 0);
+    if (__pyx_t_7) {
+
+    }
+  }
+
+0477:                 libev.ev_timer_start(self._ptr, &self._timer0)
+
+      ev_timer_start(__pyx_v_self->_ptr, (&__pyx_v_self->_timer0));
+
 0478:         finally:
+
+0479:             self.starting_timer_may_update_loop_time = False
+
+  /*finally:*/ {
+    /*normal exit:*/{
+      __pyx_v_self->starting_timer_may_update_loop_time = 0;
+      goto __pyx_L5;
+    }
+    __pyx_L4_error:;
+    /*exception exit:*/{
+      __Pyx_PyThreadState_declare
+      __Pyx_PyThreadState_assign
+      __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0;
+      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+      if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_14, &__pyx_t_15, &__pyx_t_16);
+      if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13) < 0)) __Pyx_ErrFetch(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13);
+      __Pyx_XGOTREF(__pyx_t_11);
+      __Pyx_XGOTREF(__pyx_t_12);
+      __Pyx_XGOTREF(__pyx_t_13);
+      __Pyx_XGOTREF(__pyx_t_14);
+      __Pyx_XGOTREF(__pyx_t_15);
+      __Pyx_XGOTREF(__pyx_t_16);
+      __pyx_t_8 = __pyx_lineno; __pyx_t_9 = __pyx_clineno; __pyx_t_10 = __pyx_filename;
+      {
+        __pyx_v_self->starting_timer_may_update_loop_time = 0;
+      }
+      if (PY_MAJOR_VERSION >= 3) {
+        __Pyx_XGIVEREF(__pyx_t_14);
+        __Pyx_XGIVEREF(__pyx_t_15);
+        __Pyx_XGIVEREF(__pyx_t_16);
+        __Pyx_ExceptionReset(__pyx_t_14, __pyx_t_15, __pyx_t_16);
+      }
+      __Pyx_XGIVEREF(__pyx_t_11);
+      __Pyx_XGIVEREF(__pyx_t_12);
+      __Pyx_XGIVEREF(__pyx_t_13);
+      __Pyx_ErrRestore(__pyx_t_11, __pyx_t_12, __pyx_t_13);
+      __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0;
+      __pyx_lineno = __pyx_t_8; __pyx_clineno = __pyx_t_9; __pyx_filename = __pyx_t_10;
+      goto __pyx_L1_error;
+    }
+    __pyx_L5:;
+  }
+
 0480: 
+
+0481:     cdef _stop_watchers(self, libev.ev_loop* ptr):
+
+
+static PyObject *__pyx_f_6gevent_5libev_8corecext_4loop__stop_watchers(struct PyGeventLoopObject *__pyx_v_self, struct ev_loop *__pyx_v_ptr) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_stop_watchers", 0);
+
+
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0482:         if not ptr:
+
+  __pyx_t_1 = ((!(__pyx_v_ptr != 0)) != 0);
+  if (__pyx_t_1) {
+
+  }
+
+0483:             return
+
+    __Pyx_XDECREF(__pyx_r);
+    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+    goto __pyx_L0;
+
 0484: 
+
+0485:         if libev.ev_is_active(&self._prepare):
+
+  __pyx_t_1 = (ev_is_active((&__pyx_v_self->_prepare)) != 0);
+  if (__pyx_t_1) {
+
+  }
+
+0486:             libev.ev_ref(ptr)
+
+    ev_ref(__pyx_v_ptr);
+
+0487:             libev.ev_prepare_stop(ptr, &self._prepare)
+
+    ev_prepare_stop(__pyx_v_ptr, (&__pyx_v_self->_prepare));
+
+0488:         if libev.ev_is_active(&self._periodic_signal_checker):
+
+  __pyx_t_1 = (ev_is_active((&__pyx_v_self->_periodic_signal_checker)) != 0);
+  if (__pyx_t_1) {
+
+  }
+
+0489:             libev.ev_ref(ptr)
+
+    ev_ref(__pyx_v_ptr);
+
+0490:             libev.ev_timer_stop(ptr, &self._periodic_signal_checker)
+
+    ev_timer_stop(__pyx_v_ptr, (&__pyx_v_self->_periodic_signal_checker));
+
 0491: 
+
+0492:     def destroy(self):
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_5destroy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_5destroy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("destroy (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_4destroy(((struct PyGeventLoopObject *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_4destroy(struct PyGeventLoopObject *__pyx_v_self) {
+  struct ev_loop *__pyx_v_ptr;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("destroy", 0);
+
+
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_AddTraceback("gevent.libev.corecext.loop.destroy", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0493:         cdef libev.ev_loop* ptr = self._ptr
+
+  __pyx_t_1 = __pyx_v_self->_ptr;
+  __pyx_v_ptr = __pyx_t_1;
+
+0494:         self._ptr = NULL
+
+  __pyx_v_self->_ptr = NULL;
+
 0495: 
+
+0496:         if ptr:
+
+  __pyx_t_2 = (__pyx_v_ptr != 0);
+  if (__pyx_t_2) {
+
+  }
+
+0497:             if not libev.ev_userdata(ptr):
+
+    __pyx_t_2 = ((!(ev_userdata(__pyx_v_ptr) != 0)) != 0);
+    if (__pyx_t_2) {
+
+    }
+
 0498:                 # Whoops! Program error. They destroyed the loop,
+
 0499:                 # using a different loop object. Our _ptr is still
+
 0500:                 # valid, but the libev loop is gone. Doing anything
+
 0501:                 # else with it will likely cause a crash.
+
+0502:                 return
+
+      __Pyx_XDECREF(__pyx_r);
+      __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+      goto __pyx_L0;
+
 0503:             # Mark as destroyed
+
+0504:             libev.ev_set_userdata(ptr, NULL)
+
+    ev_set_userdata(__pyx_v_ptr, NULL);
+
+0505:             self._stop_watchers(ptr)
+
+    __pyx_t_3 = ((struct __pyx_vtabstruct_6gevent_5libev_8corecext_loop *)__pyx_v_self->__pyx_vtab)->_stop_watchers(__pyx_v_self, __pyx_v_ptr); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 505, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+
+0506:             if __SYSERR_CALLBACK == self._handle_syserr:
+
+    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_SYSERR_CALLBACK); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 506, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_handle_syserr); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 506, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 506, __pyx_L1_error)
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 506, __pyx_L1_error)
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    if (__pyx_t_2) {
+
+    }
+
+0507:                 set_syserr_cb(None)
+
+      __pyx_t_5 = __pyx_f_6gevent_5libev_8corecext_set_syserr_cb(Py_None, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 507, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_5);
+      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+
+0508:             libev.ev_loop_destroy(ptr)
+
+    ev_loop_destroy(__pyx_v_ptr);
+
 0509: 
+
+0510:     def __dealloc__(self):
+
+
+/* Python wrapper */
+static void __pyx_pw_6gevent_5libev_8corecext_4loop_7__dealloc__(PyObject *__pyx_v_self); /*proto*/
+static void __pyx_pw_6gevent_5libev_8corecext_4loop_7__dealloc__(PyObject *__pyx_v_self) {
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
+  __pyx_pf_6gevent_5libev_8corecext_4loop_6__dealloc__(((struct PyGeventLoopObject *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+}
+
+static void __pyx_pf_6gevent_5libev_8corecext_4loop_6__dealloc__(struct PyGeventLoopObject *__pyx_v_self) {
+  struct ev_loop *__pyx_v_ptr;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__dealloc__", 0);
+
+
+  /* function exit code */
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_WriteUnraisable("gevent.libev.corecext.loop.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+}
+
+0511:         cdef libev.ev_loop* ptr = self._ptr
+
+  __pyx_t_1 = __pyx_v_self->_ptr;
+  __pyx_v_ptr = __pyx_t_1;
+
+0512:         self._ptr = NULL
+
+  __pyx_v_self->_ptr = NULL;
+
+0513:         if ptr != NULL:
+
+  __pyx_t_2 = ((__pyx_v_ptr != NULL) != 0);
+  if (__pyx_t_2) {
+
+  }
+
+0514:             if not libev.ev_userdata(ptr):
+
+    __pyx_t_2 = ((!(ev_userdata(__pyx_v_ptr) != 0)) != 0);
+    if (__pyx_t_2) {
+
+    }
+
 0515:                 # See destroy(). This is a bug in the caller.
+
+0516:                 return
+
+      goto __pyx_L0;
+
+0517:             self._stop_watchers(ptr)
+
+    __pyx_t_3 = ((struct __pyx_vtabstruct_6gevent_5libev_8corecext_loop *)__pyx_v_self->__pyx_vtab)->_stop_watchers(__pyx_v_self, __pyx_v_ptr); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 517, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+
+0518:             if not self._default:
+
+    __pyx_t_2 = ((!(__pyx_v_self->_default != 0)) != 0);
+    if (__pyx_t_2) {
+
+    }
+
+0519:                 libev.ev_loop_destroy(ptr)
+
+      ev_loop_destroy(__pyx_v_ptr);
+
 0520:                 # Mark as destroyed
+
+0521:                 libev.ev_set_userdata(ptr, NULL)
+
+      ev_set_userdata(__pyx_v_ptr, NULL);
+
 0522: 
+
 0523:     @property
+
+0524:     def ptr(self):
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_3ptr_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_3ptr_1__get__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_3ptr___get__(((struct PyGeventLoopObject *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_3ptr___get__(struct PyGeventLoopObject *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__", 0);
+
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.libev.corecext.loop.ptr.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0525:         return <size_t>self._ptr
+
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_self->_ptr)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 525, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
 0526: 
+
 0527:     @property
+
+0528:     def WatcherType(self):
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_11WatcherType_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_11WatcherType_1__get__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_11WatcherType___get__(((struct PyGeventLoopObject *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_11WatcherType___get__(CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__", 0);
+
+
+  /* function exit code */
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0529:         return watcher
+
+  __Pyx_XDECREF(__pyx_r);
+  __Pyx_INCREF(((PyObject *)__pyx_ptype_6gevent_5libev_8corecext_watcher));
+  __pyx_r = ((PyObject *)__pyx_ptype_6gevent_5libev_8corecext_watcher);
+  goto __pyx_L0;
+
 0530: 
+
 0531:     @property
+
+0532:     def MAXPRI(self):
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_6MAXPRI_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_6MAXPRI_1__get__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_6MAXPRI___get__(((struct PyGeventLoopObject *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_6MAXPRI___get__(CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__", 0);
+
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.libev.corecext.loop.MAXPRI.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0533:         return libev.EV_MAXPRI
+
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __Pyx_PyInt_From_int(EV_MAXPRI); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 533, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
 0534: 
+
 0535:     @property
+
+0536:     def MINPRI(self):
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_6MINPRI_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_6MINPRI_1__get__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_6MINPRI___get__(((struct PyGeventLoopObject *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_6MINPRI___get__(CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__", 0);
+
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.libev.corecext.loop.MINPRI.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0537:         return libev.EV_MINPRI
+
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __Pyx_PyInt_From_int(EV_MINPRI); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 537, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
 0538: 
+
+0539:     def _handle_syserr(self, message, errno):
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_9_handle_syserr(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_9_handle_syserr(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_message = 0;
+  PyObject *__pyx_v_errno = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_handle_syserr (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_message,&__pyx_n_s_errno,0};
+    PyObject* values[2] = {0,0};
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_message)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_errno)) != 0)) kw_args--;
+        else {
+          __Pyx_RaiseArgtupleInvalid("_handle_syserr", 1, 2, 2, 1); __PYX_ERR(0, 539, __pyx_L3_error)
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_handle_syserr") < 0)) __PYX_ERR(0, 539, __pyx_L3_error)
+      }
+    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
+      goto __pyx_L5_argtuple_error;
+    } else {
+      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+    }
+    __pyx_v_message = values[0];
+    __pyx_v_errno = values[1];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("_handle_syserr", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 539, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.libev.corecext.loop._handle_syserr", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_8_handle_syserr(((struct PyGeventLoopObject *)__pyx_v_self), __pyx_v_message, __pyx_v_errno);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_8_handle_syserr(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_message, PyObject *__pyx_v_errno) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_handle_syserr", 0);
+  __Pyx_INCREF(__pyx_v_message);
+
+
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_AddTraceback("gevent.libev.corecext.loop._handle_syserr", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_message);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0540:         if sys.version_info[0] >= 3:
+
+  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_sys); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 540, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_version_info); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 540, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 540, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_int_3, Py_GE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 540, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 540, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  if (__pyx_t_3) {
+
+  }
+
+0541:             message = message.decode()
+
+    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_message, __pyx_n_s_decode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 541, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __pyx_t_4 = NULL;
+    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
+      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1);
+      if (likely(__pyx_t_4)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
+        __Pyx_INCREF(__pyx_t_4);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_1, function);
+      }
+    }
+    __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_1);
+    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 541, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __Pyx_DECREF_SET(__pyx_v_message, __pyx_t_2);
+    __pyx_t_2 = 0;
+
+0542:         self.handle_error(None, SystemError, SystemError(message + ': ' + os.strerror(errno)), None)
+
+  __pyx_t_2 = PyNumber_Add(__pyx_v_message, __pyx_kp_s__8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 542, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_os); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 542, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_4);
+  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_strerror); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 542, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_5);
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __pyx_t_4 = NULL;
+  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
+    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
+    if (likely(__pyx_t_4)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
+      __Pyx_INCREF(__pyx_t_4);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_5, function);
+    }
+  }
+  __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_4, __pyx_v_errno) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_errno);
+  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 542, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+  __pyx_t_5 = PyNumber_Add(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 542, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_5);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_SystemError, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 542, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+  __pyx_t_5 = ((struct __pyx_vtabstruct_6gevent_5libev_8corecext_loop *)__pyx_v_self->__pyx_vtab)->handle_error(__pyx_v_self, Py_None, __pyx_builtin_SystemError, __pyx_t_1, Py_None, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 542, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_5);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+
 0543: 
+
+0544:     cpdef handle_error(self, context, type, value, tb):
+
+
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_11handle_error(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_f_6gevent_5libev_8corecext_4loop_handle_error(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_context, PyObject *__pyx_v_type, PyObject *__pyx_v_value, PyObject *__pyx_v_tb, int __pyx_skip_dispatch) {
+  PyObject *__pyx_v_handle_error = 0;
+  PyObject *__pyx_v_error_handler = 0;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("handle_error", 0);
+  /* Check if called by wrapper */
+  if (unlikely(__pyx_skip_dispatch)) ;
+  /* Check if overridden in Python */
+  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
+    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
+    if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
+    else {
+      PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      #endif
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_handle_error); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 544, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_5libev_8corecext_4loop_11handle_error)) {
+        __Pyx_XDECREF(__pyx_r);
+        __Pyx_INCREF(__pyx_t_1);
+        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
+        __pyx_t_5 = 0;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+          if (likely(__pyx_t_4)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+            __Pyx_INCREF(__pyx_t_4);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_3, function);
+            __pyx_t_5 = 1;
+          }
+        }
+        #if CYTHON_FAST_PYCALL
+        if (PyFunction_Check(__pyx_t_3)) {
+          PyObject *__pyx_temp[5] = {__pyx_t_4, __pyx_v_context, __pyx_v_type, __pyx_v_value, __pyx_v_tb};
+          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 4+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 544, __pyx_L1_error)
+          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+          __Pyx_GOTREF(__pyx_t_2);
+        } else
+        #endif
+        #if CYTHON_FAST_PYCCALL
+        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
+          PyObject *__pyx_temp[5] = {__pyx_t_4, __pyx_v_context, __pyx_v_type, __pyx_v_value, __pyx_v_tb};
+          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 4+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 544, __pyx_L1_error)
+          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+          __Pyx_GOTREF(__pyx_t_2);
+        } else
+        #endif
+        {
+          __pyx_t_6 = PyTuple_New(4+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 544, __pyx_L1_error)
+          __Pyx_GOTREF(__pyx_t_6);
+          if (__pyx_t_4) {
+            __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
+          }
+          __Pyx_INCREF(__pyx_v_context);
+          __Pyx_GIVEREF(__pyx_v_context);
+          PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_context);
+          __Pyx_INCREF(__pyx_v_type);
+          __Pyx_GIVEREF(__pyx_v_type);
+          PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_type);
+          __Pyx_INCREF(__pyx_v_value);
+          __Pyx_GIVEREF(__pyx_v_value);
+          PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_v_value);
+          __Pyx_INCREF(__pyx_v_tb);
+          __Pyx_GIVEREF(__pyx_v_tb);
+          PyTuple_SET_ITEM(__pyx_t_6, 3+__pyx_t_5, __pyx_v_tb);
+          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 544, __pyx_L1_error)
+          __Pyx_GOTREF(__pyx_t_2);
+          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+        }
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __pyx_r = __pyx_t_2;
+        __pyx_t_2 = 0;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        goto __pyx_L0;
+      }
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+      tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
+      if (unlikely(type_dict_guard != tp_dict_version)) {
+        tp_dict_version = obj_dict_version = 0;
+      }
+      #endif
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    }
+    #endif
+  }
+
+
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_6);
+  __Pyx_AddTraceback("gevent.libev.corecext.loop.handle_error", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_handle_error);
+  __Pyx_XDECREF(__pyx_v_error_handler);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_11handle_error(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_11handle_error(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_context = 0;
+  PyObject *__pyx_v_type = 0;
+  PyObject *__pyx_v_value = 0;
+  PyObject *__pyx_v_tb = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("handle_error (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_context,&__pyx_n_s_type,&__pyx_n_s_value,&__pyx_n_s_tb,0};
+    PyObject* values[4] = {0,0,0,0};
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
+        CYTHON_FALLTHROUGH;
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_context)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_type)) != 0)) kw_args--;
+        else {
+          __Pyx_RaiseArgtupleInvalid("handle_error", 1, 4, 4, 1); __PYX_ERR(0, 544, __pyx_L3_error)
+        }
+        CYTHON_FALLTHROUGH;
+        case  2:
+        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
+        else {
+          __Pyx_RaiseArgtupleInvalid("handle_error", 1, 4, 4, 2); __PYX_ERR(0, 544, __pyx_L3_error)
+        }
+        CYTHON_FALLTHROUGH;
+        case  3:
+        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tb)) != 0)) kw_args--;
+        else {
+          __Pyx_RaiseArgtupleInvalid("handle_error", 1, 4, 4, 3); __PYX_ERR(0, 544, __pyx_L3_error)
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "handle_error") < 0)) __PYX_ERR(0, 544, __pyx_L3_error)
+      }
+    } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
+      goto __pyx_L5_argtuple_error;
+    } else {
+      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
+    }
+    __pyx_v_context = values[0];
+    __pyx_v_type = values[1];
+    __pyx_v_value = values[2];
+    __pyx_v_tb = values[3];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("handle_error", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 544, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.libev.corecext.loop.handle_error", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_10handle_error(((struct PyGeventLoopObject *)__pyx_v_self), __pyx_v_context, __pyx_v_type, __pyx_v_value, __pyx_v_tb);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_10handle_error(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_context, PyObject *__pyx_v_type, PyObject *__pyx_v_value, PyObject *__pyx_v_tb) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("handle_error", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __pyx_f_6gevent_5libev_8corecext_4loop_handle_error(__pyx_v_self, __pyx_v_context, __pyx_v_type, __pyx_v_value, __pyx_v_tb, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 544, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.libev.corecext.loop.handle_error", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
 0545:         cdef object handle_error
+
+0546:         cdef object error_handler = self.error_handler
+
+  __pyx_t_1 = __pyx_v_self->error_handler;
+  __Pyx_INCREF(__pyx_t_1);
+  __pyx_v_error_handler = __pyx_t_1;
+  __pyx_t_1 = 0;
+
+0547:         if error_handler is not None:
+
+  __pyx_t_7 = (__pyx_v_error_handler != Py_None);
+  __pyx_t_8 = (__pyx_t_7 != 0);
+  if (__pyx_t_8) {
+
+    goto __pyx_L3;
+  }
+
 0548:             # we do want to do getattr every time so that setting Hub.handle_error property just works
+
+0549:             handle_error = getattr(error_handler, 'handle_error', error_handler)
+
+    __pyx_t_1 = __Pyx_GetAttr3(__pyx_v_error_handler, __pyx_n_s_handle_error, __pyx_v_error_handler); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 549, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __pyx_v_handle_error = __pyx_t_1;
+    __pyx_t_1 = 0;
+
+0550:             handle_error(context, type, value, tb)
+
+    __Pyx_INCREF(__pyx_v_handle_error);
+    __pyx_t_2 = __pyx_v_handle_error; __pyx_t_3 = NULL;
+    __pyx_t_5 = 0;
+    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
+      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+      if (likely(__pyx_t_3)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+        __Pyx_INCREF(__pyx_t_3);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_2, function);
+        __pyx_t_5 = 1;
+      }
+    }
+    #if CYTHON_FAST_PYCALL
+    if (PyFunction_Check(__pyx_t_2)) {
+      PyObject *__pyx_temp[5] = {__pyx_t_3, __pyx_v_context, __pyx_v_type, __pyx_v_value, __pyx_v_tb};
+      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 4+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 550, __pyx_L1_error)
+      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __Pyx_GOTREF(__pyx_t_1);
+    } else
+    #endif
+    #if CYTHON_FAST_PYCCALL
+    if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
+      PyObject *__pyx_temp[5] = {__pyx_t_3, __pyx_v_context, __pyx_v_type, __pyx_v_value, __pyx_v_tb};
+      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 4+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 550, __pyx_L1_error)
+      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __Pyx_GOTREF(__pyx_t_1);
+    } else
+    #endif
+    {
+      __pyx_t_6 = PyTuple_New(4+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 550, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_6);
+      if (__pyx_t_3) {
+        __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); __pyx_t_3 = NULL;
+      }
+      __Pyx_INCREF(__pyx_v_context);
+      __Pyx_GIVEREF(__pyx_v_context);
+      PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_context);
+      __Pyx_INCREF(__pyx_v_type);
+      __Pyx_GIVEREF(__pyx_v_type);
+      PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_type);
+      __Pyx_INCREF(__pyx_v_value);
+      __Pyx_GIVEREF(__pyx_v_value);
+      PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_v_value);
+      __Pyx_INCREF(__pyx_v_tb);
+      __Pyx_GIVEREF(__pyx_v_tb);
+      PyTuple_SET_ITEM(__pyx_t_6, 3+__pyx_t_5, __pyx_v_tb);
+      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 550, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+    }
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 0551:         else:
+
+0552:             self._default_handle_error(context, type, value, tb)
+
+  /*else*/ {
+    __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_5libev_8corecext_loop *)__pyx_v_self->__pyx_vtab)->_default_handle_error(__pyx_v_self, __pyx_v_context, __pyx_v_type, __pyx_v_value, __pyx_v_tb, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 552, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  }
+  __pyx_L3:;
+
 0553: 
+
+0554:     cpdef _default_handle_error(self, context, type, value, tb):
+
+
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_13_default_handle_error(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_f_6gevent_5libev_8corecext_4loop__default_handle_error(struct PyGeventLoopObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_context, PyObject *__pyx_v_type, PyObject *__pyx_v_value, PyObject *__pyx_v_tb, int __pyx_skip_dispatch) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_default_handle_error", 0);
+  /* Check if called by wrapper */
+  if (unlikely(__pyx_skip_dispatch)) ;
+  /* Check if overridden in Python */
+  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
+    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
+    if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
+    else {
+      PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      #endif
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_default_handle_error); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 554, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_5libev_8corecext_4loop_13_default_handle_error)) {
+        __Pyx_XDECREF(__pyx_r);
+        __Pyx_INCREF(__pyx_t_1);
+        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
+        __pyx_t_5 = 0;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+          if (likely(__pyx_t_4)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+            __Pyx_INCREF(__pyx_t_4);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_3, function);
+            __pyx_t_5 = 1;
+          }
+        }
+        #if CYTHON_FAST_PYCALL
+        if (PyFunction_Check(__pyx_t_3)) {
+          PyObject *__pyx_temp[5] = {__pyx_t_4, __pyx_v_context, __pyx_v_type, __pyx_v_value, __pyx_v_tb};
+          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 4+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 554, __pyx_L1_error)
+          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+          __Pyx_GOTREF(__pyx_t_2);
+        } else
+        #endif
+        #if CYTHON_FAST_PYCCALL
+        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
+          PyObject *__pyx_temp[5] = {__pyx_t_4, __pyx_v_context, __pyx_v_type, __pyx_v_value, __pyx_v_tb};
+          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 4+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 554, __pyx_L1_error)
+          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+          __Pyx_GOTREF(__pyx_t_2);
+        } else
+        #endif
+        {
+          __pyx_t_6 = PyTuple_New(4+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 554, __pyx_L1_error)
+          __Pyx_GOTREF(__pyx_t_6);
+          if (__pyx_t_4) {
+            __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
+          }
+          __Pyx_INCREF(__pyx_v_context);
+          __Pyx_GIVEREF(__pyx_v_context);
+          PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_context);
+          __Pyx_INCREF(__pyx_v_type);
+          __Pyx_GIVEREF(__pyx_v_type);
+          PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_type);
+          __Pyx_INCREF(__pyx_v_value);
+          __Pyx_GIVEREF(__pyx_v_value);
+          PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_v_value);
+          __Pyx_INCREF(__pyx_v_tb);
+          __Pyx_GIVEREF(__pyx_v_tb);
+          PyTuple_SET_ITEM(__pyx_t_6, 3+__pyx_t_5, __pyx_v_tb);
+          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 554, __pyx_L1_error)
+          __Pyx_GOTREF(__pyx_t_2);
+          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+        }
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __pyx_r = __pyx_t_2;
+        __pyx_t_2 = 0;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        goto __pyx_L0;
+      }
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+      tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
+      if (unlikely(type_dict_guard != tp_dict_version)) {
+        tp_dict_version = obj_dict_version = 0;
+      }
+      #endif
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    }
+    #endif
+  }
+
+
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_6);
+  __Pyx_AddTraceback("gevent.libev.corecext.loop._default_handle_error", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_13_default_handle_error(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_13_default_handle_error(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_context = 0;
+  PyObject *__pyx_v_type = 0;
+  PyObject *__pyx_v_value = 0;
+  PyObject *__pyx_v_tb = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_default_handle_error (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_context,&__pyx_n_s_type,&__pyx_n_s_value,&__pyx_n_s_tb,0};
+    PyObject* values[4] = {0,0,0,0};
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
+        CYTHON_FALLTHROUGH;
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_context)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_type)) != 0)) kw_args--;
+        else {
+          __Pyx_RaiseArgtupleInvalid("_default_handle_error", 1, 4, 4, 1); __PYX_ERR(0, 554, __pyx_L3_error)
+        }
+        CYTHON_FALLTHROUGH;
+        case  2:
+        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
+        else {
+          __Pyx_RaiseArgtupleInvalid("_default_handle_error", 1, 4, 4, 2); __PYX_ERR(0, 554, __pyx_L3_error)
+        }
+        CYTHON_FALLTHROUGH;
+        case  3:
+        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tb)) != 0)) kw_args--;
+        else {
+          __Pyx_RaiseArgtupleInvalid("_default_handle_error", 1, 4, 4, 3); __PYX_ERR(0, 554, __pyx_L3_error)
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_default_handle_error") < 0)) __PYX_ERR(0, 554, __pyx_L3_error)
+      }
+    } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
+      goto __pyx_L5_argtuple_error;
+    } else {
+      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
+    }
+    __pyx_v_context = values[0];
+    __pyx_v_type = values[1];
+    __pyx_v_value = values[2];
+    __pyx_v_tb = values[3];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("_default_handle_error", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 554, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.libev.corecext.loop._default_handle_error", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_12_default_handle_error(((struct PyGeventLoopObject *)__pyx_v_self), __pyx_v_context, __pyx_v_type, __pyx_v_value, __pyx_v_tb);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_12_default_handle_error(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_context, PyObject *__pyx_v_type, PyObject *__pyx_v_value, PyObject *__pyx_v_tb) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_default_handle_error", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __pyx_f_6gevent_5libev_8corecext_4loop__default_handle_error(__pyx_v_self, __pyx_v_context, __pyx_v_type, __pyx_v_value, __pyx_v_tb, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 554, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.libev.corecext.loop._default_handle_error", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
 0555:         # note: Hub sets its own error handler so this is not used by gevent
+
 0556:         # this is here to make core.loop usable without the rest of gevent
+
+0557:         traceback.print_exception(type, value, tb)
+
+  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_traceback); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 557, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_print_exception); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 557, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_2 = NULL;
+  __pyx_t_5 = 0;
+  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
+    if (likely(__pyx_t_2)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+      __Pyx_INCREF(__pyx_t_2);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_3, function);
+      __pyx_t_5 = 1;
+    }
+  }
+  #if CYTHON_FAST_PYCALL
+  if (PyFunction_Check(__pyx_t_3)) {
+    PyObject *__pyx_temp[4] = {__pyx_t_2, __pyx_v_type, __pyx_v_value, __pyx_v_tb};
+    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 557, __pyx_L1_error)
+    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __Pyx_GOTREF(__pyx_t_1);
+  } else
+  #endif
+  #if CYTHON_FAST_PYCCALL
+  if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
+    PyObject *__pyx_temp[4] = {__pyx_t_2, __pyx_v_type, __pyx_v_value, __pyx_v_tb};
+    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 557, __pyx_L1_error)
+    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __Pyx_GOTREF(__pyx_t_1);
+  } else
+  #endif
+  {
+    __pyx_t_6 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 557, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_6);
+    if (__pyx_t_2) {
+      __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); __pyx_t_2 = NULL;
+    }
+    __Pyx_INCREF(__pyx_v_type);
+    __Pyx_GIVEREF(__pyx_v_type);
+    PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_type);
+    __Pyx_INCREF(__pyx_v_value);
+    __Pyx_GIVEREF(__pyx_v_value);
+    PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_value);
+    __Pyx_INCREF(__pyx_v_tb);
+    __Pyx_GIVEREF(__pyx_v_tb);
+    PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_v_tb);
+    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 557, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  }
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+0558:         if self._ptr:
+
+  __pyx_t_7 = (__pyx_v_self->_ptr != 0);
+  if (__pyx_t_7) {
+
+  }
+
+0559:             libev.ev_break(self._ptr, libev.EVBREAK_ONE)
+
+    ev_break(__pyx_v_self->_ptr, EVBREAK_ONE);
+
 0560: 
+
+0561:     def run(self, nowait=False, once=False):
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_15run(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_15run(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_nowait = 0;
+  PyObject *__pyx_v_once = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("run (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_nowait,&__pyx_n_s_once,0};
+    PyObject* values[2] = {0,0};
+    values[0] = ((PyObject *)Py_False);
+    values[1] = ((PyObject *)Py_False);
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nowait);
+          if (value) { values[0] = value; kw_args--; }
+        }
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_once);
+          if (value) { values[1] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "run") < 0)) __PYX_ERR(0, 561, __pyx_L3_error)
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    __pyx_v_nowait = values[0];
+    __pyx_v_once = values[1];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("run", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 561, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.libev.corecext.loop.run", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_14run(((struct PyGeventLoopObject *)__pyx_v_self), __pyx_v_nowait, __pyx_v_once);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_14run(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_nowait, PyObject *__pyx_v_once) {
+  unsigned int __pyx_v_flags;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("run", 0);
+
+
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_AddTraceback("gevent.libev.corecext.loop.run", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0562:         _check_loop(self)
+
+  __pyx_t_1 = __pyx_f_6gevent_5libev_8corecext__check_loop(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 562, __pyx_L1_error)
+
+0563:         cdef unsigned int flags = 0
+
+  __pyx_v_flags = 0;
+
+0564:         if nowait:
+
+  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_nowait); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 564, __pyx_L1_error)
+  if (__pyx_t_1) {
+
+  }
+
+0565:             flags |= libev.EVRUN_NOWAIT
+
+    __pyx_v_flags = (__pyx_v_flags | EVRUN_NOWAIT);
+
+0566:         if once:
+
+  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_once); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 566, __pyx_L1_error)
+  if (__pyx_t_1) {
+
+  }
+
+0567:             flags |= libev.EVRUN_ONCE
+
+    __pyx_v_flags = (__pyx_v_flags | EVRUN_ONCE);
+
+0568:         with nogil:
+
+  {
+      #ifdef WITH_THREAD
+      PyThreadState *_save;
+      Py_UNBLOCK_THREADS
+      __Pyx_FastGIL_Remember();
+      #endif
+      /*try:*/ {
+
+      /*finally:*/ {
+        /*normal exit:*/{
+          #ifdef WITH_THREAD
+          __Pyx_FastGIL_Forget();
+          Py_BLOCK_THREADS
+          #endif
+          goto __pyx_L7;
+        }
+        __pyx_L7:;
+      }
+  }
+
+0569:             libev.ev_run(self._ptr, flags)
+
+        ev_run(__pyx_v_self->_ptr, __pyx_v_flags);
+      }
+
 0570: 
+
+0571:     def reinit(self):
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_17reinit(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_17reinit(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("reinit (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_16reinit(((struct PyGeventLoopObject *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_16reinit(struct PyGeventLoopObject *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("reinit", 0);
+
+
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0572:         if self._ptr:
+
+  __pyx_t_1 = (__pyx_v_self->_ptr != 0);
+  if (__pyx_t_1) {
+
+  }
+
+0573:             libev.ev_loop_fork(self._ptr)
+
+    ev_loop_fork(__pyx_v_self->_ptr);
+
 0574: 
+
+0575:     def ref(self):
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_19ref(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_19ref(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("ref (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_18ref(((struct PyGeventLoopObject *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_18ref(struct PyGeventLoopObject *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("ref", 0);
+
+
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_AddTraceback("gevent.libev.corecext.loop.ref", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0576:         _check_loop(self)
+
+  __pyx_t_1 = __pyx_f_6gevent_5libev_8corecext__check_loop(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 576, __pyx_L1_error)
+
+0577:         libev.ev_ref(self._ptr)
+
+  ev_ref(__pyx_v_self->_ptr);
+
 0578: 
+
+0579:     def unref(self):
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_21unref(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_21unref(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("unref (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_20unref(((struct PyGeventLoopObject *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_20unref(struct PyGeventLoopObject *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("unref", 0);
+
+
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_AddTraceback("gevent.libev.corecext.loop.unref", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0580:         _check_loop(self)
+
+  __pyx_t_1 = __pyx_f_6gevent_5libev_8corecext__check_loop(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 580, __pyx_L1_error)
+
+0581:         libev.ev_unref(self._ptr)
+
+  ev_unref(__pyx_v_self->_ptr);
+
 0582: 
+
+0583:     def break_(self, int how=libev.EVBREAK_ONE):
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_23break_(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_23break_(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  int __pyx_v_how;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("break_ (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_how,0};
+    PyObject* values[1] = {0};
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_how);
+          if (value) { values[0] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "break_") < 0)) __PYX_ERR(0, 583, __pyx_L3_error)
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    if (values[0]) {
+      __pyx_v_how = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_how == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 583, __pyx_L3_error)
+    } else {
+      __pyx_v_how = __pyx_k__9;
+    }
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("break_", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 583, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.libev.corecext.loop.break_", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_22break_(((struct PyGeventLoopObject *)__pyx_v_self), __pyx_v_how);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_22break_(struct PyGeventLoopObject *__pyx_v_self, int __pyx_v_how) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("break_", 0);
+
+
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_AddTraceback("gevent.libev.corecext.loop.break_", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+  __pyx_k__9 = EVBREAK_ONE;
+
+0584:         _check_loop(self)
+
+  __pyx_t_1 = __pyx_f_6gevent_5libev_8corecext__check_loop(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 584, __pyx_L1_error)
+
+0585:         libev.ev_break(self._ptr, how)
+
+  ev_break(__pyx_v_self->_ptr, __pyx_v_how);
+
 0586: 
+
+0587:     def verify(self):
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_25verify(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_25verify(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("verify (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_24verify(((struct PyGeventLoopObject *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_24verify(struct PyGeventLoopObject *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("verify", 0);
+
+
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_AddTraceback("gevent.libev.corecext.loop.verify", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0588:         _check_loop(self)
+
+  __pyx_t_1 = __pyx_f_6gevent_5libev_8corecext__check_loop(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 588, __pyx_L1_error)
+
+0589:         libev.ev_verify(self._ptr)
+
+  ev_verify(__pyx_v_self->_ptr);
+
 0590: 
+
+0591:     cpdef libev.ev_tstamp now(self) except *:
+
+
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_27now(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static ev_tstamp __pyx_f_6gevent_5libev_8corecext_4loop_now(struct PyGeventLoopObject *__pyx_v_self, int __pyx_skip_dispatch) {
+  ev_tstamp __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("now", 0);
+  /* Check if called by wrapper */
+  if (unlikely(__pyx_skip_dispatch)) ;
+  /* Check if overridden in Python */
+  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
+    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
+    if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
+    else {
+      PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      #endif
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_now); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 591, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_5libev_8corecext_4loop_27now)) {
+        __Pyx_INCREF(__pyx_t_1);
+        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+          if (likely(__pyx_t_4)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+            __Pyx_INCREF(__pyx_t_4);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_3, function);
+          }
+        }
+        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
+        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 591, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_5 == ((ev_tstamp)-1)) && PyErr_Occurred())) __PYX_ERR(0, 591, __pyx_L1_error)
+        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+        __pyx_r = __pyx_t_5;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        goto __pyx_L0;
+      }
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+      tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
+      if (unlikely(type_dict_guard != tp_dict_version)) {
+        tp_dict_version = obj_dict_version = 0;
+      }
+      #endif
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    }
+    #endif
+  }
+
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_AddTraceback("gevent.libev.corecext.loop.now", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_27now(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_27now(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("now (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_26now(((struct PyGeventLoopObject *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_26now(struct PyGeventLoopObject *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("now", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __pyx_f_6gevent_5libev_8corecext_4loop_now(__pyx_v_self, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 591, __pyx_L1_error)
+  __pyx_t_2 = PyFloat_FromDouble(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 591, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_r = __pyx_t_2;
+  __pyx_t_2 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_AddTraceback("gevent.libev.corecext.loop.now", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0592:         _check_loop(self)
+
+  __pyx_t_6 = __pyx_f_6gevent_5libev_8corecext__check_loop(__pyx_v_self); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 592, __pyx_L1_error)
+
+0593:         return libev.ev_now(self._ptr)
+
+  __pyx_r = ev_now(__pyx_v_self->_ptr);
+  goto __pyx_L0;
+
 0594: 
+
+0595:     cpdef void update_now(self) except *:
+
+
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_29update_now(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static void __pyx_f_6gevent_5libev_8corecext_4loop_update_now(struct PyGeventLoopObject *__pyx_v_self, int __pyx_skip_dispatch) {
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("update_now", 0);
+  /* Check if called by wrapper */
+  if (unlikely(__pyx_skip_dispatch)) ;
+  /* Check if overridden in Python */
+  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
+    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
+    if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
+    else {
+      PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      #endif
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_update_now); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 595, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_5libev_8corecext_4loop_29update_now)) {
+        __Pyx_INCREF(__pyx_t_1);
+        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+          if (likely(__pyx_t_4)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+            __Pyx_INCREF(__pyx_t_4);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_3, function);
+          }
+        }
+        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
+        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 595, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        goto __pyx_L0;
+      }
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+      tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
+      if (unlikely(type_dict_guard != tp_dict_version)) {
+        tp_dict_version = obj_dict_version = 0;
+      }
+      #endif
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    }
+    #endif
+  }
+
+
+  /* function exit code */
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_AddTraceback("gevent.libev.corecext.loop.update_now", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_29update_now(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_29update_now(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("update_now (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_28update_now(((struct PyGeventLoopObject *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_28update_now(struct PyGeventLoopObject *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("update_now", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_f_6gevent_5libev_8corecext_4loop_update_now(__pyx_v_self, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 595, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 595, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.libev.corecext.loop.update_now", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0596:         _check_loop(self)
+
+  __pyx_t_5 = __pyx_f_6gevent_5libev_8corecext__check_loop(__pyx_v_self); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 596, __pyx_L1_error)
+
+0597:         libev.ev_now_update(self._ptr)
+
+  ev_now_update(__pyx_v_self->_ptr);
+
 0598: 
+
+0599:     update = update_now # Old name, deprecated.
+
+  __Pyx_GetNameInClass(__pyx_t_12, (PyObject *)__pyx_ptype_6gevent_5libev_8corecext_loop, __pyx_n_s_update_now); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 599, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_12);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_5libev_8corecext_loop->tp_dict, __pyx_n_s_update, __pyx_t_12) < 0) __PYX_ERR(0, 599, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_5libev_8corecext_loop);
+
 0600: 
+
+0601:     def __repr__(self):
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_31__repr__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_31__repr__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_30__repr__(((struct PyGeventLoopObject *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_30__repr__(struct PyGeventLoopObject *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__repr__", 0);
+
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_AddTraceback("gevent.libev.corecext.loop.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0602:         return '<%s at 0x%x %s>' % (self.__class__.__name__, id(self), self._format())
+
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 602, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 602, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 602, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 602, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_4);
+  __pyx_t_5 = NULL;
+  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
+    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
+    if (likely(__pyx_t_5)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
+      __Pyx_INCREF(__pyx_t_5);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_4, function);
+    }
+  }
+  __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 602, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 602, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_4);
+  __Pyx_GIVEREF(__pyx_t_2);
+  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
+  __Pyx_GIVEREF(__pyx_t_1);
+  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_3);
+  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
+  __pyx_t_2 = 0;
+  __pyx_t_1 = 0;
+  __pyx_t_3 = 0;
+  __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_s_at_0x_x_s_2, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 602, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __pyx_r = __pyx_t_3;
+  __pyx_t_3 = 0;
+  goto __pyx_L0;
+
 0603: 
+
 0604:     @property
+
+0605:     def default(self):
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_7default_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_7default_1__get__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_7default___get__(((struct PyGeventLoopObject *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_7default___get__(struct PyGeventLoopObject *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__", 0);
+
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_AddTraceback("gevent.libev.corecext.loop.default.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
 0606:         # If we're destroyed, we are not the default loop anymore,
+
 0607:         # as far as Python is concerned.
+
+0608:         return self._default if self._ptr else False
+
+  __Pyx_XDECREF(__pyx_r);
+  if ((__pyx_v_self->_ptr != 0)) {
+    __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->_default); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 608, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_1 = __pyx_t_2;
+    __pyx_t_2 = 0;
+  } else {
+    __Pyx_INCREF(Py_False);
+    __pyx_t_1 = Py_False;
+  }
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
 0609: 
+
 0610:     @property
+
+0611:     def iteration(self):
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_9iteration_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_9iteration_1__get__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_9iteration___get__(((struct PyGeventLoopObject *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_9iteration___get__(struct PyGeventLoopObject *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__", 0);
+
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_AddTraceback("gevent.libev.corecext.loop.iteration.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0612:         _check_loop(self)
+
+  __pyx_t_1 = __pyx_f_6gevent_5libev_8corecext__check_loop(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 612, __pyx_L1_error)
+
+0613:         return libev.ev_iteration(self._ptr)
+
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_2 = __Pyx_PyInt_From_unsigned_int(ev_iteration(__pyx_v_self->_ptr)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 613, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_r = __pyx_t_2;
+  __pyx_t_2 = 0;
+  goto __pyx_L0;
+
 0614: 
+
 0615:     @property
+
+0616:     def depth(self):
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_5depth_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_5depth_1__get__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_5depth___get__(((struct PyGeventLoopObject *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_5depth___get__(struct PyGeventLoopObject *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__", 0);
+
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_AddTraceback("gevent.libev.corecext.loop.depth.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0617:         _check_loop(self)
+
+  __pyx_t_1 = __pyx_f_6gevent_5libev_8corecext__check_loop(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 617, __pyx_L1_error)
+
+0618:         return libev.ev_depth(self._ptr)
+
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_2 = __Pyx_PyInt_From_unsigned_int(ev_depth(__pyx_v_self->_ptr)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 618, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_r = __pyx_t_2;
+  __pyx_t_2 = 0;
+  goto __pyx_L0;
+
 0619: 
+
 0620:     @property
+
+0621:     def backend_int(self):
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_11backend_int_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_11backend_int_1__get__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_11backend_int___get__(((struct PyGeventLoopObject *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_11backend_int___get__(struct PyGeventLoopObject *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__", 0);
+
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_AddTraceback("gevent.libev.corecext.loop.backend_int.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0622:         _check_loop(self)
+
+  __pyx_t_1 = __pyx_f_6gevent_5libev_8corecext__check_loop(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 622, __pyx_L1_error)
+
+0623:         return libev.ev_backend(self._ptr)
+
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_2 = __Pyx_PyInt_From_unsigned_int(ev_backend(__pyx_v_self->_ptr)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 623, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_r = __pyx_t_2;
+  __pyx_t_2 = 0;
+  goto __pyx_L0;
+
 0624: 
+
 0625:     @property
+
+0626:     def backend(self):
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_7backend_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_7backend_1__get__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_7backend___get__(((struct PyGeventLoopObject *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_7backend___get__(struct PyGeventLoopObject *__pyx_v_self) {
+  unsigned int __pyx_v_backend;
+  PyObject *__pyx_v_key = NULL;
+  PyObject *__pyx_v_value = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__", 0);
+
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_6);
+  __Pyx_XDECREF(__pyx_t_7);
+  __Pyx_XDECREF(__pyx_t_8);
+  __Pyx_AddTraceback("gevent.libev.corecext.loop.backend.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_key);
+  __Pyx_XDECREF(__pyx_v_value);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0627:         _check_loop(self)
+
+  __pyx_t_1 = __pyx_f_6gevent_5libev_8corecext__check_loop(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 627, __pyx_L1_error)
+
+0628:         cdef unsigned int backend = libev.ev_backend(self._ptr)
+
+  __pyx_v_backend = ev_backend(__pyx_v_self->_ptr);
+
+0629:         for key, value in _flags:
+
+  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_flags); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 629, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
+    __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0;
+    __pyx_t_5 = NULL;
+  } else {
+    __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 629, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 629, __pyx_L1_error)
+  }
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  for (;;) {
+    if (likely(!__pyx_t_5)) {
+      if (likely(PyList_CheckExact(__pyx_t_3))) {
+        if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break;
+        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+        __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 629, __pyx_L1_error)
+        #else
+        __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 629, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        #endif
+      } else {
+        if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
+        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+        __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 629, __pyx_L1_error)
+        #else
+        __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 629, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        #endif
+      }
+    } else {
+      __pyx_t_2 = __pyx_t_5(__pyx_t_3);
+      if (unlikely(!__pyx_t_2)) {
+        PyObject* exc_type = PyErr_Occurred();
+        if (exc_type) {
+          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+          else __PYX_ERR(0, 629, __pyx_L1_error)
+        }
+        break;
+      }
+      __Pyx_GOTREF(__pyx_t_2);
+    }
+    if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) {
+      PyObject* sequence = __pyx_t_2;
+      Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
+      if (unlikely(size != 2)) {
+        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
+        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
+        __PYX_ERR(0, 629, __pyx_L1_error)
+      }
+      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+      if (likely(PyTuple_CheckExact(sequence))) {
+        __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); 
+        __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1); 
+      } else {
+        __pyx_t_6 = PyList_GET_ITEM(sequence, 0); 
+        __pyx_t_7 = PyList_GET_ITEM(sequence, 1); 
+      }
+      __Pyx_INCREF(__pyx_t_6);
+      __Pyx_INCREF(__pyx_t_7);
+      #else
+      __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 629, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_6);
+      __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 629, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_7);
+      #endif
+      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    } else {
+      Py_ssize_t index = -1;
+      __pyx_t_8 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 629, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_8);
+      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+      __pyx_t_9 = Py_TYPE(__pyx_t_8)->tp_iternext;
+      index = 0; __pyx_t_6 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed;
+      __Pyx_GOTREF(__pyx_t_6);
+      index = 1; __pyx_t_7 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_7)) goto __pyx_L5_unpacking_failed;
+      __Pyx_GOTREF(__pyx_t_7);
+      if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 2) < 0) __PYX_ERR(0, 629, __pyx_L1_error)
+      __pyx_t_9 = NULL;
+      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+      goto __pyx_L6_unpacking_done;
+      __pyx_L5_unpacking_failed:;
+      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+      __pyx_t_9 = NULL;
+      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
+      __PYX_ERR(0, 629, __pyx_L1_error)
+      __pyx_L6_unpacking_done:;
+    }
+    __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_6);
+    __pyx_t_6 = 0;
+    __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_7);
+    __pyx_t_7 = 0;
+
+  }
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+
+0630:             if key == backend:
+
+    __pyx_t_2 = __Pyx_PyInt_From_unsigned_int(__pyx_v_backend); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 630, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_7 = PyObject_RichCompare(__pyx_v_key, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 630, __pyx_L1_error)
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 630, __pyx_L1_error)
+    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+    if (__pyx_t_1) {
+
+    }
+
+0631:                 return value
+
+      __Pyx_XDECREF(__pyx_r);
+      __Pyx_INCREF(__pyx_v_value);
+      __pyx_r = __pyx_v_value;
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+      goto __pyx_L0;
+
+0632:         return backend
+
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_3 = __Pyx_PyInt_From_unsigned_int(__pyx_v_backend); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 632, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __pyx_r = __pyx_t_3;
+  __pyx_t_3 = 0;
+  goto __pyx_L0;
+
 0633: 
+
 0634:     @property
+
+0635:     def pendingcnt(self):
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_10pendingcnt_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_10pendingcnt_1__get__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_10pendingcnt___get__(((struct PyGeventLoopObject *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_10pendingcnt___get__(struct PyGeventLoopObject *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__", 0);
+
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_AddTraceback("gevent.libev.corecext.loop.pendingcnt.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0636:         _check_loop(self)
+
+  __pyx_t_1 = __pyx_f_6gevent_5libev_8corecext__check_loop(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 636, __pyx_L1_error)
+
+0637:         return libev.ev_pending_count(self._ptr)
+
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_2 = __Pyx_PyInt_From_unsigned_int(ev_pending_count(__pyx_v_self->_ptr)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 637, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_r = __pyx_t_2;
+  __pyx_t_2 = 0;
+  goto __pyx_L0;
+
 0638: 
+
+0639:     def io(self, libev.vfd_socket_t fd, int events, ref=True, priority=None):
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_33io(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_33io(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  vfd_socket_t __pyx_v_fd;
+  int __pyx_v_events;
+  PyObject *__pyx_v_ref = 0;
+  PyObject *__pyx_v_priority = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("io (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_fd,&__pyx_n_s_events_2,&__pyx_n_s_ref,&__pyx_n_s_priority,0};
+    PyObject* values[4] = {0,0,0,0};
+    values[2] = ((PyObject *)Py_True);
+    values[3] = ((PyObject *)Py_None);
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
+        CYTHON_FALLTHROUGH;
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_fd)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_events_2)) != 0)) kw_args--;
+        else {
+          __Pyx_RaiseArgtupleInvalid("io", 0, 2, 4, 1); __PYX_ERR(0, 639, __pyx_L3_error)
+        }
+        CYTHON_FALLTHROUGH;
+        case  2:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ref);
+          if (value) { values[2] = value; kw_args--; }
+        }
+        CYTHON_FALLTHROUGH;
+        case  3:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_priority);
+          if (value) { values[3] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "io") < 0)) __PYX_ERR(0, 639, __pyx_L3_error)
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
+        CYTHON_FALLTHROUGH;
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    __pyx_v_fd = __Pyx_PyIndex_AsSsize_t(values[0]); if (unlikely((__pyx_v_fd == ((vfd_socket_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 639, __pyx_L3_error)
+    __pyx_v_events = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_events == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 639, __pyx_L3_error)
+    __pyx_v_ref = values[2];
+    __pyx_v_priority = values[3];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("io", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 639, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.libev.corecext.loop.io", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_32io(((struct PyGeventLoopObject *)__pyx_v_self), __pyx_v_fd, __pyx_v_events, __pyx_v_ref, __pyx_v_priority);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_32io(struct PyGeventLoopObject *__pyx_v_self, vfd_socket_t __pyx_v_fd, int __pyx_v_events, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("io", 0);
+
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_AddTraceback("gevent.libev.corecext.loop.io", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0640:         return io(self, fd, events, ref, priority)
+
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_fd); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 640, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_events); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 640, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = PyTuple_New(5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 640, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_INCREF(((PyObject *)__pyx_v_self));
+  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
+  PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self));
+  __Pyx_GIVEREF(__pyx_t_1);
+  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_2);
+  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
+  __Pyx_INCREF(__pyx_v_ref);
+  __Pyx_GIVEREF(__pyx_v_ref);
+  PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_v_ref);
+  __Pyx_INCREF(__pyx_v_priority);
+  __Pyx_GIVEREF(__pyx_v_priority);
+  PyTuple_SET_ITEM(__pyx_t_3, 4, __pyx_v_priority);
+  __pyx_t_1 = 0;
+  __pyx_t_2 = 0;
+  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6gevent_5libev_8corecext_io), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 640, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __pyx_r = __pyx_t_2;
+  __pyx_t_2 = 0;
+  goto __pyx_L0;
+
 0641: 
+
+0642:     def timer(self, double after, double repeat=0.0, ref=True, priority=None):
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_35timer(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_35timer(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  double __pyx_v_after;
+  double __pyx_v_repeat;
+  PyObject *__pyx_v_ref = 0;
+  PyObject *__pyx_v_priority = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("timer (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_after,&__pyx_n_s_repeat,&__pyx_n_s_ref,&__pyx_n_s_priority,0};
+    PyObject* values[4] = {0,0,0,0};
+    values[2] = ((PyObject *)Py_True);
+    values[3] = ((PyObject *)Py_None);
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
+        CYTHON_FALLTHROUGH;
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_after)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_repeat);
+          if (value) { values[1] = value; kw_args--; }
+        }
+        CYTHON_FALLTHROUGH;
+        case  2:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ref);
+          if (value) { values[2] = value; kw_args--; }
+        }
+        CYTHON_FALLTHROUGH;
+        case  3:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_priority);
+          if (value) { values[3] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "timer") < 0)) __PYX_ERR(0, 642, __pyx_L3_error)
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
+        CYTHON_FALLTHROUGH;
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    __pyx_v_after = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_after == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 642, __pyx_L3_error)
+    if (values[1]) {
+      __pyx_v_repeat = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_repeat == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 642, __pyx_L3_error)
+    } else {
+      __pyx_v_repeat = ((double)0.0);
+    }
+    __pyx_v_ref = values[2];
+    __pyx_v_priority = values[3];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("timer", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 642, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.libev.corecext.loop.timer", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_34timer(((struct PyGeventLoopObject *)__pyx_v_self), __pyx_v_after, __pyx_v_repeat, __pyx_v_ref, __pyx_v_priority);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_34timer(struct PyGeventLoopObject *__pyx_v_self, double __pyx_v_after, double __pyx_v_repeat, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("timer", 0);
+
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_AddTraceback("gevent.libev.corecext.loop.timer", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0643:         return timer(self, after, repeat, ref, priority)
+
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_after); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 643, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = PyFloat_FromDouble(__pyx_v_repeat); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 643, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = PyTuple_New(5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 643, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_INCREF(((PyObject *)__pyx_v_self));
+  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
+  PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self));
+  __Pyx_GIVEREF(__pyx_t_1);
+  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_2);
+  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
+  __Pyx_INCREF(__pyx_v_ref);
+  __Pyx_GIVEREF(__pyx_v_ref);
+  PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_v_ref);
+  __Pyx_INCREF(__pyx_v_priority);
+  __Pyx_GIVEREF(__pyx_v_priority);
+  PyTuple_SET_ITEM(__pyx_t_3, 4, __pyx_v_priority);
+  __pyx_t_1 = 0;
+  __pyx_t_2 = 0;
+  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6gevent_5libev_8corecext_timer), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 643, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __pyx_r = __pyx_t_2;
+  __pyx_t_2 = 0;
+  goto __pyx_L0;
+
 0644: 
+
+0645:     def signal(self, int signum, ref=True, priority=None):
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_37signal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_37signal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  int __pyx_v_signum;
+  PyObject *__pyx_v_ref = 0;
+  PyObject *__pyx_v_priority = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("signal (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_signum,&__pyx_n_s_ref,&__pyx_n_s_priority,0};
+    PyObject* values[3] = {0,0,0};
+    values[1] = ((PyObject *)Py_True);
+    values[2] = ((PyObject *)Py_None);
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_signum)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ref);
+          if (value) { values[1] = value; kw_args--; }
+        }
+        CYTHON_FALLTHROUGH;
+        case  2:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_priority);
+          if (value) { values[2] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "signal") < 0)) __PYX_ERR(0, 645, __pyx_L3_error)
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    __pyx_v_signum = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_signum == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 645, __pyx_L3_error)
+    __pyx_v_ref = values[1];
+    __pyx_v_priority = values[2];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("signal", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 645, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.libev.corecext.loop.signal", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_36signal(((struct PyGeventLoopObject *)__pyx_v_self), __pyx_v_signum, __pyx_v_ref, __pyx_v_priority);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_36signal(struct PyGeventLoopObject *__pyx_v_self, int __pyx_v_signum, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("signal", 0);
+
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_AddTraceback("gevent.libev.corecext.loop.signal", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0646:         return signal(self, signum, ref, priority)
+
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_signum); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 646, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 646, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(((PyObject *)__pyx_v_self));
+  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
+  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self));
+  __Pyx_GIVEREF(__pyx_t_1);
+  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1);
+  __Pyx_INCREF(__pyx_v_ref);
+  __Pyx_GIVEREF(__pyx_v_ref);
+  PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_ref);
+  __Pyx_INCREF(__pyx_v_priority);
+  __Pyx_GIVEREF(__pyx_v_priority);
+  PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_v_priority);
+  __pyx_t_1 = 0;
+  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6gevent_5libev_8corecext_signal), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 646, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
 0647: 
+
+0648:     def idle(self, ref=True, priority=None):
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_39idle(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_39idle(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_ref = 0;
+  PyObject *__pyx_v_priority = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("idle (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ref,&__pyx_n_s_priority,0};
+    PyObject* values[2] = {0,0};
+    values[0] = ((PyObject *)Py_True);
+    values[1] = ((PyObject *)Py_None);
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ref);
+          if (value) { values[0] = value; kw_args--; }
+        }
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_priority);
+          if (value) { values[1] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "idle") < 0)) __PYX_ERR(0, 648, __pyx_L3_error)
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    __pyx_v_ref = values[0];
+    __pyx_v_priority = values[1];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("idle", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 648, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.libev.corecext.loop.idle", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_38idle(((struct PyGeventLoopObject *)__pyx_v_self), __pyx_v_ref, __pyx_v_priority);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_38idle(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("idle", 0);
+
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_AddTraceback("gevent.libev.corecext.loop.idle", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0649:         return idle(self, ref, priority)
+
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 649, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(((PyObject *)__pyx_v_self));
+  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
+  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self));
+  __Pyx_INCREF(__pyx_v_ref);
+  __Pyx_GIVEREF(__pyx_v_ref);
+  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_ref);
+  __Pyx_INCREF(__pyx_v_priority);
+  __Pyx_GIVEREF(__pyx_v_priority);
+  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_priority);
+  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6gevent_5libev_8corecext_idle), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 649, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_r = __pyx_t_2;
+  __pyx_t_2 = 0;
+  goto __pyx_L0;
+
 0650: 
+
+0651:     def prepare(self, ref=True, priority=None):
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_41prepare(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_41prepare(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_ref = 0;
+  PyObject *__pyx_v_priority = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("prepare (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ref,&__pyx_n_s_priority,0};
+    PyObject* values[2] = {0,0};
+    values[0] = ((PyObject *)Py_True);
+    values[1] = ((PyObject *)Py_None);
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ref);
+          if (value) { values[0] = value; kw_args--; }
+        }
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_priority);
+          if (value) { values[1] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "prepare") < 0)) __PYX_ERR(0, 651, __pyx_L3_error)
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    __pyx_v_ref = values[0];
+    __pyx_v_priority = values[1];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("prepare", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 651, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.libev.corecext.loop.prepare", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_40prepare(((struct PyGeventLoopObject *)__pyx_v_self), __pyx_v_ref, __pyx_v_priority);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_40prepare(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("prepare", 0);
+
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_AddTraceback("gevent.libev.corecext.loop.prepare", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0652:         return prepare(self, ref, priority)
+
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 652, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(((PyObject *)__pyx_v_self));
+  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
+  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self));
+  __Pyx_INCREF(__pyx_v_ref);
+  __Pyx_GIVEREF(__pyx_v_ref);
+  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_ref);
+  __Pyx_INCREF(__pyx_v_priority);
+  __Pyx_GIVEREF(__pyx_v_priority);
+  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_priority);
+  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6gevent_5libev_8corecext_prepare), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 652, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_r = __pyx_t_2;
+  __pyx_t_2 = 0;
+  goto __pyx_L0;
+
 0653: 
+
+0654:     def check(self, ref=True, priority=None):
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_43check(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_43check(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_ref = 0;
+  PyObject *__pyx_v_priority = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("check (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ref,&__pyx_n_s_priority,0};
+    PyObject* values[2] = {0,0};
+    values[0] = ((PyObject *)Py_True);
+    values[1] = ((PyObject *)Py_None);
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ref);
+          if (value) { values[0] = value; kw_args--; }
+        }
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_priority);
+          if (value) { values[1] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "check") < 0)) __PYX_ERR(0, 654, __pyx_L3_error)
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    __pyx_v_ref = values[0];
+    __pyx_v_priority = values[1];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("check", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 654, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.libev.corecext.loop.check", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_42check(((struct PyGeventLoopObject *)__pyx_v_self), __pyx_v_ref, __pyx_v_priority);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_42check(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("check", 0);
+
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_AddTraceback("gevent.libev.corecext.loop.check", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0655:         return check(self, ref, priority)
+
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 655, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(((PyObject *)__pyx_v_self));
+  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
+  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self));
+  __Pyx_INCREF(__pyx_v_ref);
+  __Pyx_GIVEREF(__pyx_v_ref);
+  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_ref);
+  __Pyx_INCREF(__pyx_v_priority);
+  __Pyx_GIVEREF(__pyx_v_priority);
+  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_priority);
+  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6gevent_5libev_8corecext_check), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 655, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_r = __pyx_t_2;
+  __pyx_t_2 = 0;
+  goto __pyx_L0;
+
 0656: 
+
+0657:     def fork(self, ref=True, priority=None):
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_45fork(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_45fork(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_ref = 0;
+  PyObject *__pyx_v_priority = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("fork (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ref,&__pyx_n_s_priority,0};
+    PyObject* values[2] = {0,0};
+    values[0] = ((PyObject *)Py_True);
+    values[1] = ((PyObject *)Py_None);
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ref);
+          if (value) { values[0] = value; kw_args--; }
+        }
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_priority);
+          if (value) { values[1] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "fork") < 0)) __PYX_ERR(0, 657, __pyx_L3_error)
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    __pyx_v_ref = values[0];
+    __pyx_v_priority = values[1];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("fork", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 657, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.libev.corecext.loop.fork", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_44fork(((struct PyGeventLoopObject *)__pyx_v_self), __pyx_v_ref, __pyx_v_priority);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_44fork(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("fork", 0);
+
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_AddTraceback("gevent.libev.corecext.loop.fork", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0658:         return fork(self, ref, priority)
+
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 658, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(((PyObject *)__pyx_v_self));
+  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
+  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self));
+  __Pyx_INCREF(__pyx_v_ref);
+  __Pyx_GIVEREF(__pyx_v_ref);
+  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_ref);
+  __Pyx_INCREF(__pyx_v_priority);
+  __Pyx_GIVEREF(__pyx_v_priority);
+  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_priority);
+  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6gevent_5libev_8corecext_fork), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 658, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_r = __pyx_t_2;
+  __pyx_t_2 = 0;
+  goto __pyx_L0;
+
 0659: 
+
+0660:     def async_(self, ref=True, priority=None):
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_47async_(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_47async_(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_ref = 0;
+  PyObject *__pyx_v_priority = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("async_ (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ref,&__pyx_n_s_priority,0};
+    PyObject* values[2] = {0,0};
+    values[0] = ((PyObject *)Py_True);
+    values[1] = ((PyObject *)Py_None);
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ref);
+          if (value) { values[0] = value; kw_args--; }
+        }
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_priority);
+          if (value) { values[1] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "async_") < 0)) __PYX_ERR(0, 660, __pyx_L3_error)
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    __pyx_v_ref = values[0];
+    __pyx_v_priority = values[1];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("async_", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 660, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.libev.corecext.loop.async_", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_46async_(((struct PyGeventLoopObject *)__pyx_v_self), __pyx_v_ref, __pyx_v_priority);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_46async_(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("async_", 0);
+
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_AddTraceback("gevent.libev.corecext.loop.async_", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0661:         return async_(self, ref, priority)
+
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 661, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(((PyObject *)__pyx_v_self));
+  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
+  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self));
+  __Pyx_INCREF(__pyx_v_ref);
+  __Pyx_GIVEREF(__pyx_v_ref);
+  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_ref);
+  __Pyx_INCREF(__pyx_v_priority);
+  __Pyx_GIVEREF(__pyx_v_priority);
+  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_priority);
+  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6gevent_5libev_8corecext_async_), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 661, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_r = __pyx_t_2;
+  __pyx_t_2 = 0;
+  goto __pyx_L0;
+
 0662: 
+
 0663:     # cython doesn't enforce async as a keyword
+
+0664:     async = async_
+
+  __Pyx_GetNameInClass(__pyx_t_12, (PyObject *)__pyx_ptype_6gevent_5libev_8corecext_loop, __pyx_n_s_async); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 664, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_12);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_5libev_8corecext_loop->tp_dict, __pyx_n_s_async_2, __pyx_t_12) < 0) __PYX_ERR(0, 664, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_5libev_8corecext_loop);
+
 0665: 
+
+0666:     def child(self, int pid, bint trace=0, ref=True):
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_49child(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_49child(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  int __pyx_v_pid;
+  int __pyx_v_trace;
+  PyObject *__pyx_v_ref = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("child (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pid,&__pyx_n_s_trace,&__pyx_n_s_ref,0};
+    PyObject* values[3] = {0,0,0};
+    values[2] = ((PyObject *)Py_True);
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pid)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_trace);
+          if (value) { values[1] = value; kw_args--; }
+        }
+        CYTHON_FALLTHROUGH;
+        case  2:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ref);
+          if (value) { values[2] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "child") < 0)) __PYX_ERR(0, 666, __pyx_L3_error)
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    __pyx_v_pid = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_pid == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 666, __pyx_L3_error)
+    if (values[1]) {
+      __pyx_v_trace = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_trace == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 666, __pyx_L3_error)
+    } else {
+      __pyx_v_trace = ((int)0);
+    }
+    __pyx_v_ref = values[2];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("child", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 666, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.libev.corecext.loop.child", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_48child(((struct PyGeventLoopObject *)__pyx_v_self), __pyx_v_pid, __pyx_v_trace, __pyx_v_ref);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_48child(struct PyGeventLoopObject *__pyx_v_self, int __pyx_v_pid, int __pyx_v_trace, PyObject *__pyx_v_ref) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("child", 0);
+
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_AddTraceback("gevent.libev.corecext.loop.child", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0667:         if sys.platform == 'win32':
+
+  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_sys); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 667, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_platform); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 667, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_t_2, __pyx_n_s_win32, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 667, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  if (unlikely(__pyx_t_3)) {
+
+  }
+
+0668:             raise AttributeError("Child watchers are not supported on Windows")
+
+    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_AttributeError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 668, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __PYX_ERR(0, 668, __pyx_L1_error)
+
+  __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_Child_watchers_are_not_supported); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 668, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__10);
+  __Pyx_GIVEREF(__pyx_tuple__10);
+
+0669:         return child(self, pid, trace, ref)
+
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_pid); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 669, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_trace); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 669, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_4 = PyTuple_New(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 669, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_4);
+  __Pyx_INCREF(((PyObject *)__pyx_v_self));
+  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
+  PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_self));
+  __Pyx_GIVEREF(__pyx_t_2);
+  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
+  __Pyx_GIVEREF(__pyx_t_1);
+  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_1);
+  __Pyx_INCREF(__pyx_v_ref);
+  __Pyx_GIVEREF(__pyx_v_ref);
+  PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_v_ref);
+  __pyx_t_2 = 0;
+  __pyx_t_1 = 0;
+  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6gevent_5libev_8corecext_child), __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 669, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
 0670: 
+
+0671:     def install_sigchld(self):
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_51install_sigchld(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_51install_sigchld(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("install_sigchld (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_50install_sigchld(((struct PyGeventLoopObject *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_50install_sigchld(CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("install_sigchld", 0);
+
+
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0672:         libev.gevent_install_sigchld_handler()
+
+  gevent_install_sigchld_handler();
+
 0673: 
+
+0674:     def reset_sigchld(self):
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_53reset_sigchld(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_53reset_sigchld(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("reset_sigchld (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_52reset_sigchld(((struct PyGeventLoopObject *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_52reset_sigchld(CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("reset_sigchld", 0);
+
+
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0675:         libev.gevent_reset_sigchld_handler()
+
+  gevent_reset_sigchld_handler();
+
 0676: 
+
+0677:     def stat(self, str path, float interval=0.0, ref=True, priority=None):
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_55stat(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_55stat(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_path = 0;
+  float __pyx_v_interval;
+  PyObject *__pyx_v_ref = 0;
+  PyObject *__pyx_v_priority = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("stat (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_path,&__pyx_n_s_interval,&__pyx_n_s_ref,&__pyx_n_s_priority,0};
+    PyObject* values[4] = {0,0,0,0};
+    values[2] = ((PyObject *)Py_True);
+    values[3] = ((PyObject *)Py_None);
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
+        CYTHON_FALLTHROUGH;
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_path)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_interval);
+          if (value) { values[1] = value; kw_args--; }
+        }
+        CYTHON_FALLTHROUGH;
+        case  2:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ref);
+          if (value) { values[2] = value; kw_args--; }
+        }
+        CYTHON_FALLTHROUGH;
+        case  3:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_priority);
+          if (value) { values[3] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stat") < 0)) __PYX_ERR(0, 677, __pyx_L3_error)
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
+        CYTHON_FALLTHROUGH;
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    __pyx_v_path = ((PyObject*)values[0]);
+    if (values[1]) {
+      __pyx_v_interval = __pyx_PyFloat_AsFloat(values[1]); if (unlikely((__pyx_v_interval == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 677, __pyx_L3_error)
+    } else {
+      __pyx_v_interval = ((float)0.0);
+    }
+    __pyx_v_ref = values[2];
+    __pyx_v_priority = values[3];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("stat", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 677, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.libev.corecext.loop.stat", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_path), (&PyString_Type), 1, "path", 1))) __PYX_ERR(0, 677, __pyx_L1_error)
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_54stat(((struct PyGeventLoopObject *)__pyx_v_self), __pyx_v_path, __pyx_v_interval, __pyx_v_ref, __pyx_v_priority);
+
+  /* function exit code */
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_54stat(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_path, float __pyx_v_interval, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("stat", 0);
+
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_AddTraceback("gevent.libev.corecext.loop.stat", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0678:         return stat(self, path, interval, ref, priority)
+
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_interval); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 678, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = PyTuple_New(5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 678, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(((PyObject *)__pyx_v_self));
+  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
+  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self));
+  __Pyx_INCREF(__pyx_v_path);
+  __Pyx_GIVEREF(__pyx_v_path);
+  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_path);
+  __Pyx_GIVEREF(__pyx_t_1);
+  PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_1);
+  __Pyx_INCREF(__pyx_v_ref);
+  __Pyx_GIVEREF(__pyx_v_ref);
+  PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_v_ref);
+  __Pyx_INCREF(__pyx_v_priority);
+  __Pyx_GIVEREF(__pyx_v_priority);
+  PyTuple_SET_ITEM(__pyx_t_2, 4, __pyx_v_priority);
+  __pyx_t_1 = 0;
+  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6gevent_5libev_8corecext_stat), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 678, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
 0679: 
+
+0680:     def run_callback(self, func, *args):
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_57run_callback(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_57run_callback(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_func = 0;
+  PyObject *__pyx_v_args = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("run_callback (wrapper)", 0);
+  if (PyTuple_GET_SIZE(__pyx_args) > 1) {
+    __pyx_v_args = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args));
+    if (unlikely(!__pyx_v_args)) {
+      __Pyx_RefNannyFinishContext();
+      return NULL;
+    }
+    __Pyx_GOTREF(__pyx_v_args);
+  } else {
+    __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple);
+  }
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_func,0};
+    PyObject* values[1] = {0};
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        default:
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_func)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+      }
+      if (unlikely(kw_args > 0)) {
+        const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1;
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "run_callback") < 0)) __PYX_ERR(0, 680, __pyx_L3_error)
+      }
+    } else if (PyTuple_GET_SIZE(__pyx_args) < 1) {
+      goto __pyx_L5_argtuple_error;
+    } else {
+      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+    }
+    __pyx_v_func = values[0];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("run_callback", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 680, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0;
+  __Pyx_AddTraceback("gevent.libev.corecext.loop.run_callback", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_56run_callback(((struct PyGeventLoopObject *)__pyx_v_self), __pyx_v_func, __pyx_v_args);
+
+  /* function exit code */
+  __Pyx_XDECREF(__pyx_v_args);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_56run_callback(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_func, PyObject *__pyx_v_args) {
+  struct PyGeventCallbackObject *__pyx_v_cb = 0;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("run_callback", 0);
+
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_AddTraceback("gevent.libev.corecext.loop.run_callback", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XDECREF((PyObject *)__pyx_v_cb);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0681:         _check_loop(self)
+
+  __pyx_t_1 = __pyx_f_6gevent_5libev_8corecext__check_loop(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 681, __pyx_L1_error)
+
+0682:         cdef callback cb = callback(func, args)
+
+  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 682, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(__pyx_v_func);
+  __Pyx_GIVEREF(__pyx_v_func);
+  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_func);
+  __Pyx_INCREF(__pyx_v_args);
+  __Pyx_GIVEREF(__pyx_v_args);
+  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_args);
+  __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6gevent_5libev_8corecext_callback), __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 682, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_v_cb = ((struct PyGeventCallbackObject *)__pyx_t_3);
+  __pyx_t_3 = 0;
+
+0683:         self._callbacks.append(cb)
+
+  __pyx_t_3 = __pyx_f_6gevent_5libev_8corecext_12CallbackFIFO_append(__pyx_v_self->_callbacks, __pyx_v_cb); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 683, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+
+0684:         libev.ev_ref(self._ptr)
+
+  ev_ref(__pyx_v_self->_ptr);
+
+0685:         return cb
+
+  __Pyx_XDECREF(__pyx_r);
+  __Pyx_INCREF(((PyObject *)__pyx_v_cb));
+  __pyx_r = ((PyObject *)__pyx_v_cb);
+  goto __pyx_L0;
+
 0686: 
+
+0687:     def _format(self):
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_59_format(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_59_format(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_format (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_58_format(((struct PyGeventLoopObject *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_58_format(struct PyGeventLoopObject *__pyx_v_self) {
+  PyObject *__pyx_v_msg = 0;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_format", 0);
+
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_AddTraceback("gevent.libev.corecext.loop._format", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_msg);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0688:         if not self._ptr:
+
+  __pyx_t_1 = ((!(__pyx_v_self->_ptr != 0)) != 0);
+  if (__pyx_t_1) {
+
+  }
+
+0689:             return 'destroyed'
+
+    __Pyx_XDECREF(__pyx_r);
+    __Pyx_INCREF(__pyx_n_s_destroyed);
+    __pyx_r = __pyx_n_s_destroyed;
+    goto __pyx_L0;
+
+0690:         cdef object msg = self.backend
+
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_backend); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 690, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_v_msg = __pyx_t_2;
+  __pyx_t_2 = 0;
+
+0691:         if self._default:
+
+  __pyx_t_1 = (__pyx_v_self->_default != 0);
+  if (__pyx_t_1) {
+
+  }
+
+0692:             msg += ' default'
+
+    __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_msg, __pyx_kp_s_default_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 692, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_DECREF_SET(__pyx_v_msg, __pyx_t_2);
+    __pyx_t_2 = 0;
+
+0693:         msg += ' pending=%s' % self.pendingcnt
+
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_pendingcnt); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 693, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = __Pyx_PyString_FormatSafe(__pyx_kp_s_pending_s, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 693, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_msg, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 693, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __Pyx_DECREF_SET(__pyx_v_msg, __pyx_t_2);
+  __pyx_t_2 = 0;
+
+0694:         msg += self._format_details()
+
+  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_format_details); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 694, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __pyx_t_4 = NULL;
+  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
+    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+    if (likely(__pyx_t_4)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+      __Pyx_INCREF(__pyx_t_4);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_3, function);
+    }
+  }
+  __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 694, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_msg, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 694, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF_SET(__pyx_v_msg, __pyx_t_3);
+  __pyx_t_3 = 0;
+
+0695:         return msg
+
+  __Pyx_XDECREF(__pyx_r);
+  __Pyx_INCREF(__pyx_v_msg);
+  __pyx_r = __pyx_v_msg;
+  goto __pyx_L0;
+
 0696: 
+
+0697:     def _format_details(self):
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_61_format_details(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_61_format_details(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_format_details (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_60_format_details(((struct PyGeventLoopObject *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_60_format_details(struct PyGeventLoopObject *__pyx_v_self) {
+  PyObject *__pyx_v_msg = 0;
+  PyObject *__pyx_v_fileno = 0;
+  PyObject *__pyx_v_activecnt = 0;
+  CYTHON_UNUSED PyObject *__pyx_v_sigfd = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_format_details", 0);
+
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_AddTraceback("gevent.libev.corecext.loop._format_details", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_msg);
+  __Pyx_XDECREF(__pyx_v_fileno);
+  __Pyx_XDECREF(__pyx_v_activecnt);
+  __Pyx_XDECREF(__pyx_v_sigfd);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0698:         cdef str msg = ''
+
+  __Pyx_INCREF(__pyx_kp_s__7);
+  __pyx_v_msg = __pyx_kp_s__7;
+
+0699:         cdef object fileno = self.fileno()
+
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_fileno); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 699, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = NULL;
+  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+    if (likely(__pyx_t_3)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+      __Pyx_INCREF(__pyx_t_3);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_2, function);
+    }
+  }
+  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 699, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_v_fileno = __pyx_t_1;
+  __pyx_t_1 = 0;
+
+0700:         cdef object activecnt = None
+
+  __Pyx_INCREF(Py_None);
+  __pyx_v_activecnt = Py_None;
+
+0701:         try:
+
+  {
+    /*try:*/ {
+
+    }
+    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+    goto __pyx_L8_try_end;
+    __pyx_L3_error:;
+    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+    __Pyx_XGIVEREF(__pyx_t_4);
+    __Pyx_XGIVEREF(__pyx_t_5);
+    __Pyx_XGIVEREF(__pyx_t_6);
+    __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
+    goto __pyx_L1_error;
+    __pyx_L4_exception_handled:;
+    __Pyx_XGIVEREF(__pyx_t_4);
+    __Pyx_XGIVEREF(__pyx_t_5);
+    __Pyx_XGIVEREF(__pyx_t_6);
+    __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
+    __pyx_L8_try_end:;
+  }
+
+0702:             sigfd = self.sigfd
+
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_sigfd); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 702, __pyx_L3_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      __pyx_v_sigfd = __pyx_t_1;
+      __pyx_t_1 = 0;
+
+0703:         except AttributeError:
+
+    __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_AttributeError);
+    if (__pyx_t_7) {
+      __Pyx_AddTraceback("gevent.libev.corecext.loop._format_details", __pyx_clineno, __pyx_lineno, __pyx_filename);
+      if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3) < 0) __PYX_ERR(0, 703, __pyx_L5_except_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      __Pyx_GOTREF(__pyx_t_2);
+      __Pyx_GOTREF(__pyx_t_3);
+
+0704:             sigfd = None
+
+      __Pyx_INCREF(Py_None);
+      __Pyx_XDECREF_SET(__pyx_v_sigfd, Py_None);
+      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+      goto __pyx_L4_exception_handled;
+    }
+    goto __pyx_L5_except_error;
+    __pyx_L5_except_error:;
+
+0705:         try:
+
+  {
+    /*try:*/ {
+
+    }
+    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+    goto __pyx_L16_try_end;
+    __pyx_L11_error:;
+    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+
+    __Pyx_XGIVEREF(__pyx_t_6);
+    __Pyx_XGIVEREF(__pyx_t_5);
+    __Pyx_XGIVEREF(__pyx_t_4);
+    __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_5, __pyx_t_4);
+    goto __pyx_L1_error;
+    __pyx_L12_exception_handled:;
+    __Pyx_XGIVEREF(__pyx_t_6);
+    __Pyx_XGIVEREF(__pyx_t_5);
+    __Pyx_XGIVEREF(__pyx_t_4);
+    __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_5, __pyx_t_4);
+    __pyx_L16_try_end:;
+  }
+
+0706:             activecnt = self.activecnt
+
+      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_activecnt); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 706, __pyx_L11_error)
+      __Pyx_GOTREF(__pyx_t_3);
+      __Pyx_DECREF_SET(__pyx_v_activecnt, __pyx_t_3);
+      __pyx_t_3 = 0;
+
+0707:         except AttributeError:
+
+    __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_AttributeError);
+    if (__pyx_t_7) {
+      __Pyx_ErrRestore(0,0,0);
+      goto __pyx_L12_exception_handled;
+    }
+    goto __pyx_L13_except_error;
+    __pyx_L13_except_error:;
+
 0708:             pass
+
+0709:         if activecnt is not None:
+
+  __pyx_t_8 = (__pyx_v_activecnt != Py_None);
+  __pyx_t_9 = (__pyx_t_8 != 0);
+  if (__pyx_t_9) {
+
+  }
+
+0710:             msg += ' ref=' + repr(activecnt)
+
+    __pyx_t_3 = PyObject_Repr(__pyx_v_activecnt); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 710, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __pyx_t_2 = PyNumber_Add(__pyx_kp_s_ref_2, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 710, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_msg, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 710, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __Pyx_DECREF_SET(__pyx_v_msg, ((PyObject*)__pyx_t_3));
+    __pyx_t_3 = 0;
+
+0711:         if fileno is not None:
+
+  __pyx_t_9 = (__pyx_v_fileno != Py_None);
+  __pyx_t_8 = (__pyx_t_9 != 0);
+  if (__pyx_t_8) {
+
+  }
+
+0712:             msg += ' fileno=' + repr(fileno)
+
+    __pyx_t_3 = PyObject_Repr(__pyx_v_fileno); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 712, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __pyx_t_2 = PyNumber_Add(__pyx_kp_s_fileno_2, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 712, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_msg, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 712, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __Pyx_DECREF_SET(__pyx_v_msg, ((PyObject*)__pyx_t_3));
+    __pyx_t_3 = 0;
+
+0713:         return msg
+
+  __Pyx_XDECREF(__pyx_r);
+  __Pyx_INCREF(__pyx_v_msg);
+  __pyx_r = __pyx_v_msg;
+  goto __pyx_L0;
+
 0714: 
+
+0715:     def fileno(self):
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_63fileno(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_63fileno(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("fileno (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_62fileno(((struct PyGeventLoopObject *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_62fileno(struct PyGeventLoopObject *__pyx_v_self) {
+  int __pyx_v_fd;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("fileno", 0);
+
+
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_AddTraceback("gevent.libev.corecext.loop.fileno", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
 0716:         cdef int fd
+
+0717:         if self._ptr:
+
+  __pyx_t_1 = (__pyx_v_self->_ptr != 0);
+  if (__pyx_t_1) {
+
+  }
+
+0718:             fd = libev.gevent_ev_loop_backend_fd(self._ptr)
+
+    __pyx_v_fd = gevent_ev_loop_backend_fd(__pyx_v_self->_ptr);
+
+0719:             if fd >= 0:
+
+    __pyx_t_1 = ((__pyx_v_fd >= 0) != 0);
+    if (__pyx_t_1) {
+
+    }
+
+0720:                 return fd
+
+      __Pyx_XDECREF(__pyx_r);
+      __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_fd); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 720, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_2);
+      __pyx_r = __pyx_t_2;
+      __pyx_t_2 = 0;
+      goto __pyx_L0;
+
 0721: 
+
 0722:     @property
+
+0723:     def activecnt(self):
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_9activecnt_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_9activecnt_1__get__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_9activecnt___get__(((struct PyGeventLoopObject *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_9activecnt___get__(struct PyGeventLoopObject *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__", 0);
+
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_AddTraceback("gevent.libev.corecext.loop.activecnt.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0724:         _check_loop(self)
+
+  __pyx_t_1 = __pyx_f_6gevent_5libev_8corecext__check_loop(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 724, __pyx_L1_error)
+
+0725:         return libev.gevent_ev_loop_activecnt(self._ptr)
+
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_2 = __Pyx_PyInt_From_int(gevent_ev_loop_activecnt(__pyx_v_self->_ptr)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 725, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_r = __pyx_t_2;
+  __pyx_t_2 = 0;
+  goto __pyx_L0;
+
 0726: 
+
 0727:     @property
+
+0728:     def sig_pending(self):
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_11sig_pending_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_11sig_pending_1__get__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_11sig_pending___get__(((struct PyGeventLoopObject *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_11sig_pending___get__(struct PyGeventLoopObject *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__", 0);
+
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_AddTraceback("gevent.libev.corecext.loop.sig_pending.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0729:         _check_loop(self)
+
+  __pyx_t_1 = __pyx_f_6gevent_5libev_8corecext__check_loop(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 729, __pyx_L1_error)
+
+0730:         return libev.gevent_ev_loop_sig_pending(self._ptr)
+
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_2 = __Pyx_PyInt_From_int(gevent_ev_loop_sig_pending(__pyx_v_self->_ptr)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 730, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_r = __pyx_t_2;
+  __pyx_t_2 = 0;
+  goto __pyx_L0;
+
 0731: 
+
 0732:     @property
+
+0733:     def origflags(self):
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_9origflags_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_9origflags_1__get__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_9origflags___get__(((struct PyGeventLoopObject *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_9origflags___get__(struct PyGeventLoopObject *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__", 0);
+
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.libev.corecext.loop.origflags.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0734:         return _flags_to_list(self.origflags_int)
+
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_origflags_int); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 734, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = __Pyx_PyInt_As_unsigned_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 734, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_1 = __pyx_f_6gevent_5libev_8corecext__flags_to_list(__pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 734, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
 0735: 
+
 0736:     @property
+
+0737:     def origflags_int(self):
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_13origflags_int_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_13origflags_int_1__get__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_13origflags_int___get__(((struct PyGeventLoopObject *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_13origflags_int___get__(struct PyGeventLoopObject *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__", 0);
+
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_AddTraceback("gevent.libev.corecext.loop.origflags_int.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0738:         _check_loop(self)
+
+  __pyx_t_1 = __pyx_f_6gevent_5libev_8corecext__check_loop(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 738, __pyx_L1_error)
+
+0739:         return libev.gevent_ev_loop_origflags(self._ptr)
+
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_2 = __Pyx_PyInt_From_unsigned_int(gevent_ev_loop_origflags(__pyx_v_self->_ptr)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 739, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_r = __pyx_t_2;
+  __pyx_t_2 = 0;
+  goto __pyx_L0;
+
 0740: 
+
 0741:     @property
+
+0742:     def sigfd(self):
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_5sigfd_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_5sigfd_1__get__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_5sigfd___get__(((struct PyGeventLoopObject *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_5sigfd___get__(struct PyGeventLoopObject *__pyx_v_self) {
+  int __pyx_v_fd;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__", 0);
+
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_AddTraceback("gevent.libev.corecext.loop.sigfd.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0743:         _check_loop(self)
+
+  __pyx_t_1 = __pyx_f_6gevent_5libev_8corecext__check_loop(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 743, __pyx_L1_error)
+
+0744:         fd = libev.gevent_ev_loop_sigfd(self._ptr)
+
+  __pyx_v_fd = gevent_ev_loop_sigfd(__pyx_v_self->_ptr);
+
+0745:         if fd >= 0:
+
+  __pyx_t_1 = ((__pyx_v_fd >= 0) != 0);
+  if (__pyx_t_1) {
+
+  }
+
+0746:             return fd
+
+    __Pyx_XDECREF(__pyx_r);
+    __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_fd); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 746, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_r = __pyx_t_2;
+    __pyx_t_2 = 0;
+    goto __pyx_L0;
+
 0747: 
+
 0748:         # Explicitly not EV_USE_SIGNALFD
+
+0749:         raise AttributeError("sigfd")
+
+  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_AttributeError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 749, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_Raise(__pyx_t_2, 0, 0, 0);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __PYX_ERR(0, 749, __pyx_L1_error)
+
+  __pyx_tuple__11 = PyTuple_Pack(1, __pyx_n_s_sigfd); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 749, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__11);
+  __Pyx_GIVEREF(__pyx_tuple__11);
+
 0750: 
+
+0751: try:
+
+  {
+    /*try:*/ {
+
+    }
+
+    __Pyx_XGIVEREF(__pyx_t_19);
+    __Pyx_XGIVEREF(__pyx_t_20);
+    __Pyx_XGIVEREF(__pyx_t_21);
+    __Pyx_ExceptionReset(__pyx_t_19, __pyx_t_20, __pyx_t_21);
+    goto __pyx_L1_error;
+    __pyx_L5_exception_handled:;
+    __Pyx_XGIVEREF(__pyx_t_19);
+    __Pyx_XGIVEREF(__pyx_t_20);
+    __Pyx_XGIVEREF(__pyx_t_21);
+    __Pyx_ExceptionReset(__pyx_t_19, __pyx_t_20, __pyx_t_21);
+    __pyx_L9_try_end:;
+  }
+
+0752:     from zope.interface import classImplements
+
+      __pyx_t_12 = PyList_New(1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 752, __pyx_L4_error)
+      __Pyx_GOTREF(__pyx_t_12);
+      __Pyx_INCREF(__pyx_n_s_classImplements);
+      __Pyx_GIVEREF(__pyx_n_s_classImplements);
+      PyList_SET_ITEM(__pyx_t_12, 0, __pyx_n_s_classImplements);
+      __pyx_t_18 = __Pyx_Import(__pyx_n_s_zope_interface, __pyx_t_12, 0); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 752, __pyx_L4_error)
+      __Pyx_GOTREF(__pyx_t_18);
+      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
+      __pyx_t_12 = __Pyx_ImportFrom(__pyx_t_18, __pyx_n_s_classImplements); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 752, __pyx_L4_error)
+      __Pyx_GOTREF(__pyx_t_12);
+      if (PyDict_SetItem(__pyx_d, __pyx_n_s_classImplements, __pyx_t_12) < 0) __PYX_ERR(0, 752, __pyx_L4_error)
+      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
+      __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
+
+0753: except ImportError:
+
+    __pyx_t_22 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ImportError);
+    if (__pyx_t_22) {
+      __Pyx_ErrRestore(0,0,0);
+      goto __pyx_L5_exception_handled;
+    }
+    goto __pyx_L6_except_error;
+    __pyx_L6_except_error:;
+
 0754:     pass
+
 0755: else:
+
 0756:     # XXX: This invokes the side-table lookup, we would
+
 0757:     # prefer to have it stored directly on the class.
+
+0758:     from gevent._interfaces import ILoop
+
+    /*else:*/ {
+      __pyx_t_18 = PyList_New(1); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 758, __pyx_L6_except_error)
+      __Pyx_GOTREF(__pyx_t_18);
+      __Pyx_INCREF(__pyx_n_s_ILoop);
+      __Pyx_GIVEREF(__pyx_n_s_ILoop);
+      PyList_SET_ITEM(__pyx_t_18, 0, __pyx_n_s_ILoop);
+      __pyx_t_12 = __Pyx_Import(__pyx_n_s_gevent__interfaces, __pyx_t_18, 0); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 758, __pyx_L6_except_error)
+      __Pyx_GOTREF(__pyx_t_12);
+      __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
+      __pyx_t_18 = __Pyx_ImportFrom(__pyx_t_12, __pyx_n_s_ILoop); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 758, __pyx_L6_except_error)
+      __Pyx_GOTREF(__pyx_t_18);
+      if (PyDict_SetItem(__pyx_d, __pyx_n_s_ILoop, __pyx_t_18) < 0) __PYX_ERR(0, 758, __pyx_L6_except_error)
+      __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
+      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
+
+0759:     classImplements(loop, ILoop)
+
+      __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_classImplements); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 759, __pyx_L6_except_error)
+      __Pyx_GOTREF(__pyx_t_12);
+      __Pyx_GetModuleGlobalName(__pyx_t_18, __pyx_n_s_ILoop); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 759, __pyx_L6_except_error)
+      __Pyx_GOTREF(__pyx_t_18);
+      __pyx_t_17 = PyTuple_New(2); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 759, __pyx_L6_except_error)
+      __Pyx_GOTREF(__pyx_t_17);
+      __Pyx_INCREF(((PyObject *)__pyx_ptype_6gevent_5libev_8corecext_loop));
+      __Pyx_GIVEREF(((PyObject *)__pyx_ptype_6gevent_5libev_8corecext_loop));
+      PyTuple_SET_ITEM(__pyx_t_17, 0, ((PyObject *)__pyx_ptype_6gevent_5libev_8corecext_loop));
+      __Pyx_GIVEREF(__pyx_t_18);
+      PyTuple_SET_ITEM(__pyx_t_17, 1, __pyx_t_18);
+      __pyx_t_18 = 0;
+      __pyx_t_18 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_17, NULL); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 759, __pyx_L6_except_error)
+      __Pyx_GOTREF(__pyx_t_18);
+      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
+      __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
+      __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
+    }
+    __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
+    __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
+    __Pyx_XDECREF(__pyx_t_21); __pyx_t_21 = 0;
+    goto __pyx_L9_try_end;
+    __pyx_L4_error:;
+    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
+    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
+    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
+    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
+    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
+    __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
+    __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
+    __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
+    __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
+    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
+    __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
+
 0760: 
+
 0761: # about readonly _flags attribute:
+
 0762: # bit #1 set if object owns Python reference to itself (Py_INCREF was
+
 0763: # called and we must call Py_DECREF later)
+
 0764: DEF FLAG_WATCHER_OWNS_PYREF = 1 << 0 # 0x1
+
 0765: # bit #2 set if ev_unref() was called and we must call ev_ref() later
+
 0766: DEF FLAG_WATCHER_NEEDS_EVREF = 1 << 1 # 0x2
+
 0767: # bit #3 set if user wants to call ev_unref() before start()
+
 0768: DEF FLAG_WATCHER_UNREF_BEFORE_START = 1 << 2 # 0x4
+
 0769: # bits 2 and 3 are *both* set when we are active, but the user
+
 0770: # request us not to be ref'd anymore. We unref us (because going active will
+
 0771: # ref us) and then make a note of this in the future
+
 0772: DEF FLAG_WATCHER_MASK_UNREF_NEEDS_REF = 0x6
+
 0773: 
+
 0774: 
+
+0775: cdef void _python_incref(watcher self):
+
+
+static void __pyx_f_6gevent_5libev_8corecext__python_incref(struct PyGeventWatcherObject *__pyx_v_self) {
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_python_incref", 0);
+
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+}
+
+0776:     if not self._flags & FLAG_WATCHER_OWNS_PYREF:
+
+  __pyx_t_1 = ((!((__pyx_v_self->_flags & 1) != 0)) != 0);
+  if (__pyx_t_1) {
+
+  }
+
+0777:         Py_INCREF(self)
+
+    Py_INCREF(((PyObject *)__pyx_v_self));
+
+0778:         self._flags |= FLAG_WATCHER_OWNS_PYREF
+
+    __pyx_v_self->_flags = (__pyx_v_self->_flags | 1);
+
 0779: 
+
+0780: cdef void _python_decref(watcher self):
+
+
+static void __pyx_f_6gevent_5libev_8corecext__python_decref(struct PyGeventWatcherObject *__pyx_v_self) {
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_python_decref", 0);
+
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+}
+
+0781:     if self._flags & FLAG_WATCHER_OWNS_PYREF:
+
+  __pyx_t_1 = ((__pyx_v_self->_flags & 1) != 0);
+  if (__pyx_t_1) {
+
+  }
+
+0782:         Py_DECREF(self)
+
+    Py_DECREF(((PyObject *)__pyx_v_self));
+
+0783:         self._flags &= ~FLAG_WATCHER_OWNS_PYREF
+
+    __pyx_v_self->_flags = (__pyx_v_self->_flags & (~1));
+
 0784: 
+
+0785: cdef void _libev_ref(watcher self):
+
+
+static void __pyx_f_6gevent_5libev_8corecext__libev_ref(struct PyGeventWatcherObject *__pyx_v_self) {
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_libev_ref", 0);
+
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+}
+
+0786:     if self._flags & FLAG_WATCHER_NEEDS_EVREF:
+
+  __pyx_t_1 = ((__pyx_v_self->_flags & 2) != 0);
+  if (__pyx_t_1) {
+
+  }
+
+0787:         libev.ev_ref(self.loop._ptr)
+
+    ev_ref(__pyx_v_self->loop->_ptr);
+
+0788:         self._flags &= ~FLAG_WATCHER_NEEDS_EVREF
+
+    __pyx_v_self->_flags = (__pyx_v_self->_flags & (~2));
+
 0789: 
+
+0790: cdef void _libev_unref(watcher self):
+
+
+static void __pyx_f_6gevent_5libev_8corecext__libev_unref(struct PyGeventWatcherObject *__pyx_v_self) {
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_libev_unref", 0);
+
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+}
+
+0791:     if self._flags & FLAG_WATCHER_MASK_UNREF_NEEDS_REF == FLAG_WATCHER_UNREF_BEFORE_START:
+
+  __pyx_t_1 = (((__pyx_v_self->_flags & 6) == 4) != 0);
+  if (__pyx_t_1) {
+
+  }
+
+0792:         libev.ev_unref(self.loop._ptr)
+
+    ev_unref(__pyx_v_self->loop->_ptr);
+
+0793:         self._flags |= FLAG_WATCHER_NEEDS_EVREF
+
+    __pyx_v_self->_flags = (__pyx_v_self->_flags | 2);
+
 0794: 
+
 0795: 
+
+0796: ctypedef void (*start_stop_func)(libev.ev_loop*, void*) nogil
+
+typedef void (*__pyx_t_6gevent_5libev_8corecext_start_stop_func)(struct ev_loop *, void *);
+
 0797: 
+
+0798: cdef struct start_and_stop:
+
+struct __pyx_t_6gevent_5libev_8corecext_start_and_stop {
+  __pyx_t_6gevent_5libev_8corecext_start_stop_func start;
+  __pyx_t_6gevent_5libev_8corecext_start_stop_func stop;
+};
+
 0799:     start_stop_func start
+
 0800:     start_stop_func stop
+
 0801: 
+
+0802: cdef start_and_stop make_ss(void* start, void* stop):
+
+
+static struct __pyx_t_6gevent_5libev_8corecext_start_and_stop __pyx_f_6gevent_5libev_8corecext_make_ss(void *__pyx_v_start, void *__pyx_v_stop) {
+  struct __pyx_t_6gevent_5libev_8corecext_start_and_stop __pyx_v_result;
+  struct __pyx_t_6gevent_5libev_8corecext_start_and_stop __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("make_ss", 0);
+
+
+  /* function exit code */
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0803:     cdef start_and_stop result = start_and_stop(<start_stop_func>start, <start_stop_func>stop)
+
+  __pyx_t_1.start = ((__pyx_t_6gevent_5libev_8corecext_start_stop_func)__pyx_v_start);
+  __pyx_t_1.stop = ((__pyx_t_6gevent_5libev_8corecext_start_stop_func)__pyx_v_stop);
+  __pyx_v_result = __pyx_t_1;
+
+0804:     return result
+
+  __pyx_r = __pyx_v_result;
+  goto __pyx_L0;
+
 0805: 
+
+0806: cdef bint _watcher_start(watcher self, object callback, tuple args) except -1:
+
+
+static int __pyx_f_6gevent_5libev_8corecext__watcher_start(struct PyGeventWatcherObject *__pyx_v_self, PyObject *__pyx_v_callback, PyObject *__pyx_v_args) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_watcher_start", 0);
+
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_AddTraceback("gevent.libev.corecext._watcher_start", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = -1;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
 0807:     # This method should be called by subclasses of watcher, if they
+
 0808:     # override the python-level `start` function: they've already paid
+
 0809:     # for argument unpacking, and `start` cannot be cpdef since it
+
 0810:     # uses varargs.
+
 0811: 
+
 0812:     # We keep this as a function, not a cdef method of watcher.
+
 0813:     # If it's a cdef method, it could potentially be overridden
+
 0814:     # by a subclass, which means that the watcher gains a pointer to a
+
 0815:     # function table (vtable), making each object 8 bytes larger.
+
 0816: 
+
+0817:     _check_loop(self.loop)
+
+  __pyx_t_1 = ((PyObject *)__pyx_v_self->loop);
+  __Pyx_INCREF(__pyx_t_1);
+  __pyx_t_2 = __pyx_f_6gevent_5libev_8corecext__check_loop(((struct PyGeventLoopObject *)__pyx_t_1)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 817, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+0818:     if callback is None or not callable(callback):
+
+  __pyx_t_3 = (__pyx_v_callback == Py_None);
+  __pyx_t_4 = (__pyx_t_3 != 0);
+  if (!__pyx_t_4) {
+  } else {
+    __pyx_t_2 = __pyx_t_4;
+    goto __pyx_L4_bool_binop_done;
+  }
+  __pyx_t_4 = __Pyx_PyCallable_Check(__pyx_v_callback); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 818, __pyx_L1_error)
+  __pyx_t_3 = ((!(__pyx_t_4 != 0)) != 0);
+  __pyx_t_2 = __pyx_t_3;
+  __pyx_L4_bool_binop_done:;
+  if (unlikely(__pyx_t_2)) {
+
+  }
+
+0819:         raise TypeError("Expected callable, not %r" % (callback, ))
+
+    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 819, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_INCREF(__pyx_v_callback);
+    __Pyx_GIVEREF(__pyx_v_callback);
+    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_callback);
+    __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_Expected_callable_not_r, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 819, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_5);
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 819, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __PYX_ERR(0, 819, __pyx_L1_error)
+
+0820:     self._callback = callback
+
+  __Pyx_INCREF(__pyx_v_callback);
+  __Pyx_GIVEREF(__pyx_v_callback);
+  __Pyx_GOTREF(__pyx_v_self->_callback);
+  __Pyx_DECREF(__pyx_v_self->_callback);
+  __pyx_v_self->_callback = __pyx_v_callback;
+
+0821:     self.args = args
+
+  __Pyx_INCREF(__pyx_v_args);
+  __Pyx_GIVEREF(__pyx_v_args);
+  __Pyx_GOTREF(__pyx_v_self->args);
+  __Pyx_DECREF(__pyx_v_self->args);
+  __pyx_v_self->args = __pyx_v_args;
+
+0822:     _libev_unref(self)
+
+  __pyx_f_6gevent_5libev_8corecext__libev_unref(__pyx_v_self);
+
+0823:     _python_incref(self)
+
+  __pyx_f_6gevent_5libev_8corecext__python_incref(__pyx_v_self);
+
+0824:     self.__ss.start(self.loop._ptr, self.__watcher)
+
+  __pyx_v_self->__pyx___ss->start(__pyx_v_self->loop->_ptr, __pyx_v_self->__pyx___watcher);
+
+0825:     return 1
+
+  __pyx_r = 1;
+  goto __pyx_L0;
+
 0826: 
+
+0827: cdef public class watcher [object PyGeventWatcherObject, type PyGeventWatcher_Type]:
+
+struct PyGeventWatcherObject {
+  PyObject_HEAD
+  struct PyGeventLoopObject *loop;
+  PyObject *_callback;
+  PyObject *args;
+  struct ev_watcher *__pyx___watcher;
+  struct __pyx_t_6gevent_5libev_8corecext_start_and_stop *__pyx___ss;
+  unsigned int _flags;
+};
+
+__PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyGeventWatcher_Type;
+
 0828:     """Abstract base class for all the watchers"""
+
 0829:     ## pointer members
+
+0830:     cdef public loop loop
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_4loop_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_4loop_1__get__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_7watcher_4loop___get__(((struct PyGeventWatcherObject *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_7watcher_4loop___get__(struct PyGeventWatcherObject *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __Pyx_INCREF(((PyObject *)__pyx_v_self->loop));
+  __pyx_r = ((PyObject *)__pyx_v_self->loop);
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static int __pyx_pw_6gevent_5libev_8corecext_7watcher_4loop_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
+static int __pyx_pw_6gevent_5libev_8corecext_7watcher_4loop_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_7watcher_4loop_2__set__(((struct PyGeventWatcherObject *)__pyx_v_self), ((PyObject *)__pyx_v_value));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_5libev_8corecext_7watcher_4loop_2__set__(struct PyGeventWatcherObject *__pyx_v_self, PyObject *__pyx_v_value) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__set__", 0);
+  if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_6gevent_5libev_8corecext_loop))))) __PYX_ERR(0, 830, __pyx_L1_error)
+  __pyx_t_1 = __pyx_v_value;
+  __Pyx_INCREF(__pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_1);
+  __Pyx_GOTREF(__pyx_v_self->loop);
+  __Pyx_DECREF(((PyObject *)__pyx_v_self->loop));
+  __pyx_v_self->loop = ((struct PyGeventLoopObject *)__pyx_t_1);
+  __pyx_t_1 = 0;
+
+  /* function exit code */
+  __pyx_r = 0;
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.libev.corecext.watcher.loop.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = -1;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static int __pyx_pw_6gevent_5libev_8corecext_7watcher_4loop_5__del__(PyObject *__pyx_v_self); /*proto*/
+static int __pyx_pw_6gevent_5libev_8corecext_7watcher_4loop_5__del__(PyObject *__pyx_v_self) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_7watcher_4loop_4__del__(((struct PyGeventWatcherObject *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_5libev_8corecext_7watcher_4loop_4__del__(struct PyGeventWatcherObject *__pyx_v_self) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__del__", 0);
+  __Pyx_INCREF(Py_None);
+  __Pyx_GIVEREF(Py_None);
+  __Pyx_GOTREF(__pyx_v_self->loop);
+  __Pyx_DECREF(((PyObject *)__pyx_v_self->loop));
+  __pyx_v_self->loop = ((struct PyGeventLoopObject *)Py_None);
+
+  /* function exit code */
+  __pyx_r = 0;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
 0831:     cdef object _callback
+
+0832:     cdef public tuple args
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_4args_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_4args_1__get__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_7watcher_4args___get__(((struct PyGeventWatcherObject *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_7watcher_4args___get__(struct PyGeventWatcherObject *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __Pyx_INCREF(__pyx_v_self->args);
+  __pyx_r = __pyx_v_self->args;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static int __pyx_pw_6gevent_5libev_8corecext_7watcher_4args_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
+static int __pyx_pw_6gevent_5libev_8corecext_7watcher_4args_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_7watcher_4args_2__set__(((struct PyGeventWatcherObject *)__pyx_v_self), ((PyObject *)__pyx_v_value));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_5libev_8corecext_7watcher_4args_2__set__(struct PyGeventWatcherObject *__pyx_v_self, PyObject *__pyx_v_value) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__set__", 0);
+  if (!(likely(PyTuple_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v_value)->tp_name), 0))) __PYX_ERR(0, 832, __pyx_L1_error)
+  __pyx_t_1 = __pyx_v_value;
+  __Pyx_INCREF(__pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_1);
+  __Pyx_GOTREF(__pyx_v_self->args);
+  __Pyx_DECREF(__pyx_v_self->args);
+  __pyx_v_self->args = ((PyObject*)__pyx_t_1);
+  __pyx_t_1 = 0;
+
+  /* function exit code */
+  __pyx_r = 0;
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.libev.corecext.watcher.args.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = -1;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static int __pyx_pw_6gevent_5libev_8corecext_7watcher_4args_5__del__(PyObject *__pyx_v_self); /*proto*/
+static int __pyx_pw_6gevent_5libev_8corecext_7watcher_4args_5__del__(PyObject *__pyx_v_self) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_7watcher_4args_4__del__(((struct PyGeventWatcherObject *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_5libev_8corecext_7watcher_4args_4__del__(struct PyGeventWatcherObject *__pyx_v_self) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__del__", 0);
+  __Pyx_INCREF(Py_None);
+  __Pyx_GIVEREF(Py_None);
+  __Pyx_GOTREF(__pyx_v_self->args);
+  __Pyx_DECREF(__pyx_v_self->args);
+  __pyx_v_self->args = ((PyObject*)Py_None);
+
+  /* function exit code */
+  __pyx_r = 0;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
 0833: 
+
 0834:     # By keeping a __watcher cached, the size of the io and timer
+
 0835:     # structs becomes 152 bytes and child is 160 and stat is 512 (when
+
 0836:     # the start_and_stop is inlined). On 64-bit macOS CPython 2.7. I
+
 0837:     # hoped that using libev's data pointer and allocating the
+
 0838:     # watchers directly and not as inline members would result in
+
 0839:     # overall savings thanks to better padding, but it didn't. And it
+
 0840:     # added lots of casts, making the code ugly.
+
 0841: 
+
 0842:     # Table:
+
 0843:     # gevent ver   | 1.2 | This | +data
+
 0844:     # Watcher Kind |     |      |
+
 0845:     # Timer        | 120 | 152  | 160
+
 0846:     # IO           | 120 | 152  | 160
+
 0847:     # Child        | 128 | 160  | 168
+
 0848:     # Stat         | 480 | 512  | 512
+
 0849:     cdef libev.ev_watcher* __watcher
+
 0850: 
+
 0851:     # By inlining the start_and_stop struct, instead of taking the address
+
 0852:     # of a static struct or using the watcher's data pointer, we
+
 0853:     # use an additional pointer of memory and incur an additional pointer copy
+
 0854:     # on creation.
+
 0855:     # But we use fewer pointer accesses for start/stop, and they have
+
 0856:     # better cache locality. (Then again, we're bigger).
+
 0857:     # Right now we're going for size, so we use the pointer. IO/Timer objects
+
 0858:     # are then 144 bytes.
+
 0859:     cdef start_and_stop* __ss
+
 0860: 
+
 0861:     ## Int members
+
 0862: 
+
 0863:     # Our subclasses will declare the ev_X struct
+
 0864:     # as an inline member. This is good for locality, but
+
 0865:     # probably bad for alignment, as it will get tacked on
+
 0866:     # immediately after our data.
+
 0867: 
+
 0868:     # But all ev_watchers start with some ints, so maybe we can help that
+
 0869:     # out by putting our ints here.
+
+0870:     cdef readonly unsigned int _flags
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_6_flags_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_6_flags_1__get__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_7watcher_6_flags___get__(((struct PyGeventWatcherObject *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_7watcher_6_flags___get__(struct PyGeventWatcherObject *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __Pyx_PyInt_From_unsigned_int(__pyx_v_self->_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 870, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.libev.corecext.watcher._flags.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
 0871: 
+
+0872:     def __init__(self, loop loop, ref=True, priority=None):
+
+
+/* Python wrapper */
+static int __pyx_pw_6gevent_5libev_8corecext_7watcher_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static int __pyx_pw_6gevent_5libev_8corecext_7watcher_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  struct PyGeventLoopObject *__pyx_v_loop = 0;
+  PyObject *__pyx_v_ref = 0;
+  PyObject *__pyx_v_priority = 0;
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_loop,&__pyx_n_s_ref,&__pyx_n_s_priority,0};
+    PyObject* values[3] = {0,0,0};
+    values[1] = ((PyObject *)Py_True);
+    values[2] = ((PyObject *)Py_None);
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_loop)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ref);
+          if (value) { values[1] = value; kw_args--; }
+        }
+        CYTHON_FALLTHROUGH;
+        case  2:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_priority);
+          if (value) { values[2] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 872, __pyx_L3_error)
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    __pyx_v_loop = ((struct PyGeventLoopObject *)values[0]);
+    __pyx_v_ref = values[1];
+    __pyx_v_priority = values[2];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 872, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.libev.corecext.watcher.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return -1;
+  __pyx_L4_argument_unpacking_done:;
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_loop), __pyx_ptype_6gevent_5libev_8corecext_loop, 1, "loop", 0))) __PYX_ERR(0, 872, __pyx_L1_error)
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_7watcher___init__(((struct PyGeventWatcherObject *)__pyx_v_self), __pyx_v_loop, __pyx_v_ref, __pyx_v_priority);
+
+  /* function exit code */
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __pyx_r = -1;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_5libev_8corecext_7watcher___init__(struct PyGeventWatcherObject *__pyx_v_self, struct PyGeventLoopObject *__pyx_v_loop, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__", 0);
+
+
+  /* function exit code */
+  __pyx_r = 0;
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_AddTraceback("gevent.libev.corecext.watcher.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = -1;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0873:         if not self.__watcher or not self.__ss.start or not self.__ss.stop:
+
+  __pyx_t_2 = ((!(__pyx_v_self->__pyx___watcher != 0)) != 0);
+  if (!__pyx_t_2) {
+  } else {
+    __pyx_t_1 = __pyx_t_2;
+    goto __pyx_L4_bool_binop_done;
+  }
+  __pyx_t_2 = ((!(__pyx_v_self->__pyx___ss->start != 0)) != 0);
+  if (!__pyx_t_2) {
+  } else {
+    __pyx_t_1 = __pyx_t_2;
+    goto __pyx_L4_bool_binop_done;
+  }
+  __pyx_t_2 = ((!(__pyx_v_self->__pyx___ss->stop != 0)) != 0);
+  __pyx_t_1 = __pyx_t_2;
+  __pyx_L4_bool_binop_done:;
+  if (unlikely(__pyx_t_1)) {
+
+  }
+
+0874:             raise ValueError("Cannot construct a bare watcher")
+
+    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 874, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __PYX_ERR(0, 874, __pyx_L1_error)
+
+  __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_s_Cannot_construct_a_bare_watcher); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 874, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__12);
+  __Pyx_GIVEREF(__pyx_tuple__12);
+
+0875:         self.loop = loop
+
+  __Pyx_INCREF(((PyObject *)__pyx_v_loop));
+  __Pyx_GIVEREF(((PyObject *)__pyx_v_loop));
+  __Pyx_GOTREF(__pyx_v_self->loop);
+  __Pyx_DECREF(((PyObject *)__pyx_v_self->loop));
+  __pyx_v_self->loop = __pyx_v_loop;
+
+0876:         self._flags = 0 if ref else FLAG_WATCHER_UNREF_BEFORE_START
+
+  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_ref); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 876, __pyx_L1_error)
+  if (__pyx_t_1) {
+    __pyx_t_4 = 0;
+  } else {
+    __pyx_t_4 = 4;
+  }
+  __pyx_v_self->_flags = __pyx_t_4;
+
+0877:         if priority is not None:
+
+  __pyx_t_1 = (__pyx_v_priority != Py_None);
+  __pyx_t_2 = (__pyx_t_1 != 0);
+  if (__pyx_t_2) {
+
+  }
+
+0878:             libev.ev_set_priority(self.__watcher, priority)
+
+    __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_v_priority); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 878, __pyx_L1_error)
+    ev_set_priority(__pyx_v_self->__pyx___watcher, __pyx_t_5);
+
 0879: 
+
 0880:     @property
+
+0881:     def ref(self):
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_3ref_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_3ref_1__get__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_7watcher_3ref___get__(((struct PyGeventWatcherObject *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_7watcher_3ref___get__(struct PyGeventWatcherObject *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__", 0);
+
+
+  /* function exit code */
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0882:         return False if self._flags & 4 else True
+
+  __Pyx_XDECREF(__pyx_r);
+  if (((__pyx_v_self->_flags & 4) != 0)) {
+    __Pyx_INCREF(Py_False);
+    __pyx_t_1 = Py_False;
+  } else {
+    __Pyx_INCREF(Py_True);
+    __pyx_t_1 = Py_True;
+  }
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
 0883: 
+
 0884:     @ref.setter
+
+0885:     def ref(self, object value):
+
+
+/* Python wrapper */
+static int __pyx_pw_6gevent_5libev_8corecext_7watcher_3ref_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
+static int __pyx_pw_6gevent_5libev_8corecext_7watcher_3ref_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_7watcher_3ref_2__set__(((struct PyGeventWatcherObject *)__pyx_v_self), ((PyObject *)__pyx_v_value));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_5libev_8corecext_7watcher_3ref_2__set__(struct PyGeventWatcherObject *__pyx_v_self, PyObject *__pyx_v_value) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__set__", 0);
+
+
+  /* function exit code */
+  __pyx_r = 0;
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.libev.corecext.watcher.ref.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = -1;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0886:         _check_loop(self.loop)
+
+  __pyx_t_1 = ((PyObject *)__pyx_v_self->loop);
+  __Pyx_INCREF(__pyx_t_1);
+  __pyx_t_2 = __pyx_f_6gevent_5libev_8corecext__check_loop(((struct PyGeventLoopObject *)__pyx_t_1)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 886, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+0887:         if value:
+
+  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_value); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 887, __pyx_L1_error)
+  if (__pyx_t_2) {
+
+    goto __pyx_L3;
+  }
+
 0888:             # self.ref should be true after this.
+
+0889:             if self.ref:
+
+    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_ref); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 889, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 889, __pyx_L1_error)
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    if (__pyx_t_2) {
+
+    }
+
+0890:                return  # ref is already True
+
+      __pyx_r = 0;
+      goto __pyx_L0;
+
 0891: 
+
+0892:             if self._flags & FLAG_WATCHER_NEEDS_EVREF:  # ev_unref was called, undo
+
+    __pyx_t_2 = ((__pyx_v_self->_flags & 2) != 0);
+    if (__pyx_t_2) {
+
+    }
+
+0893:                libev.ev_ref(self.loop._ptr)
+
+      ev_ref(__pyx_v_self->loop->_ptr);
+
 0894: 			# do not want unref, no outstanding unref
+
+0895:             self._flags &= ~FLAG_WATCHER_MASK_UNREF_NEEDS_REF
+
+    __pyx_v_self->_flags = (__pyx_v_self->_flags & (~6));
+
 0896:         else:
+
 0897: 			# self.ref must be false after this
+
+0898:             if not self.ref:
+
+  /*else*/ {
+    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_ref); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 898, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 898, __pyx_L1_error)
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __pyx_t_3 = ((!__pyx_t_2) != 0);
+    if (__pyx_t_3) {
+
+    }
+
+0899:                return  # ref is already False
+
+      __pyx_r = 0;
+      goto __pyx_L0;
+
+0900:             self._flags |= FLAG_WATCHER_UNREF_BEFORE_START
+
+    __pyx_v_self->_flags = (__pyx_v_self->_flags | 4);
+
+0901:             if not self._flags & FLAG_WATCHER_NEEDS_EVREF and libev.ev_is_active(self.__watcher):
+
+    __pyx_t_2 = ((!((__pyx_v_self->_flags & 2) != 0)) != 0);
+    if (__pyx_t_2) {
+    } else {
+      __pyx_t_3 = __pyx_t_2;
+      goto __pyx_L8_bool_binop_done;
+    }
+    __pyx_t_2 = (ev_is_active(__pyx_v_self->__pyx___watcher) != 0);
+    __pyx_t_3 = __pyx_t_2;
+    __pyx_L8_bool_binop_done:;
+    if (__pyx_t_3) {
+
+    }
+  }
+  __pyx_L3:;
+
+0902:                libev.ev_unref(self.loop._ptr)
+
+      ev_unref(__pyx_v_self->loop->_ptr);
+
+0903:                self._flags |= FLAG_WATCHER_NEEDS_EVREF
+
+      __pyx_v_self->_flags = (__pyx_v_self->_flags | 2);
+
 0904: 
+
 0905:     @property
+
+0906:     def callback(self):
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_8callback_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_8callback_1__get__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_7watcher_8callback___get__(((struct PyGeventWatcherObject *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_7watcher_8callback___get__(struct PyGeventWatcherObject *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__", 0);
+
+
+  /* function exit code */
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0907:         return self._callback
+
+  __Pyx_XDECREF(__pyx_r);
+  __Pyx_INCREF(__pyx_v_self->_callback);
+  __pyx_r = __pyx_v_self->_callback;
+  goto __pyx_L0;
+
 0908: 
+
 0909:     @callback.setter
+
+0910:     def callback(self, object callback):
+
+
+/* Python wrapper */
+static int __pyx_pw_6gevent_5libev_8corecext_7watcher_8callback_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_callback); /*proto*/
+static int __pyx_pw_6gevent_5libev_8corecext_7watcher_8callback_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_callback) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_7watcher_8callback_2__set__(((struct PyGeventWatcherObject *)__pyx_v_self), ((PyObject *)__pyx_v_callback));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_5libev_8corecext_7watcher_8callback_2__set__(struct PyGeventWatcherObject *__pyx_v_self, PyObject *__pyx_v_callback) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__set__", 0);
+
+
+  /* function exit code */
+  __pyx_r = 0;
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_AddTraceback("gevent.libev.corecext.watcher.callback.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = -1;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0911:         if callback is not None and not callable(callback):
+
+  __pyx_t_2 = (__pyx_v_callback != Py_None);
+  __pyx_t_3 = (__pyx_t_2 != 0);
+  if (__pyx_t_3) {
+  } else {
+    __pyx_t_1 = __pyx_t_3;
+    goto __pyx_L4_bool_binop_done;
+  }
+  __pyx_t_3 = __Pyx_PyCallable_Check(__pyx_v_callback); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 911, __pyx_L1_error)
+  __pyx_t_2 = ((!(__pyx_t_3 != 0)) != 0);
+  __pyx_t_1 = __pyx_t_2;
+  __pyx_L4_bool_binop_done:;
+  if (unlikely(__pyx_t_1)) {
+
+  }
+
+0912:            raise TypeError("Expected callable, not %r" % (callback, ))
+
+    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 912, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_INCREF(__pyx_v_callback);
+    __Pyx_GIVEREF(__pyx_v_callback);
+    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_callback);
+    __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_Expected_callable_not_r, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 912, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_5);
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 912, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __PYX_ERR(0, 912, __pyx_L1_error)
+
+0913:         self._callback = callback
+
+  __Pyx_INCREF(__pyx_v_callback);
+  __Pyx_GIVEREF(__pyx_v_callback);
+  __Pyx_GOTREF(__pyx_v_self->_callback);
+  __Pyx_DECREF(__pyx_v_self->_callback);
+  __pyx_v_self->_callback = __pyx_v_callback;
+
 0914: 
+
 0915:     @property
+
+0916:     def priority(self):
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_8priority_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_8priority_1__get__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_7watcher_8priority___get__(((struct PyGeventWatcherObject *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_7watcher_8priority___get__(struct PyGeventWatcherObject *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__", 0);
+
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.libev.corecext.watcher.priority.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0917:         return libev.ev_priority(self.__watcher)
+
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __Pyx_PyInt_From_int(ev_priority(__pyx_v_self->__pyx___watcher)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 917, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
 0918: 
+
 0919:     @priority.setter
+
+0920:     def priority(self, int priority):
+
+
+/* Python wrapper */
+static int __pyx_pw_6gevent_5libev_8corecext_7watcher_8priority_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_priority); /*proto*/
+static int __pyx_pw_6gevent_5libev_8corecext_7watcher_8priority_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_priority) {
+  int __pyx_v_priority;
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
+  assert(__pyx_arg_priority); {
+    __pyx_v_priority = __Pyx_PyInt_As_int(__pyx_arg_priority); if (unlikely((__pyx_v_priority == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 920, __pyx_L3_error)
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.libev.corecext.watcher.priority.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return -1;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_7watcher_8priority_2__set__(((struct PyGeventWatcherObject *)__pyx_v_self), ((int)__pyx_v_priority));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_5libev_8corecext_7watcher_8priority_2__set__(struct PyGeventWatcherObject *__pyx_v_self, int __pyx_v_priority) {
+  struct ev_watcher *__pyx_v_w;
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__set__", 0);
+
+
+  /* function exit code */
+  __pyx_r = 0;
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_AddTraceback("gevent.libev.corecext.watcher.priority.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = -1;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0921:         cdef libev.ev_watcher* w = self.__watcher
+
+  __pyx_t_1 = __pyx_v_self->__pyx___watcher;
+  __pyx_v_w = __pyx_t_1;
+
+0922:         if libev.ev_is_active(w):
+
+  __pyx_t_2 = (ev_is_active(__pyx_v_w) != 0);
+  if (unlikely(__pyx_t_2)) {
+
+  }
+
+0923:            raise AttributeError("Cannot set priority of an active watcher")
+
+    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_AttributeError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 923, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __PYX_ERR(0, 923, __pyx_L1_error)
+
+  __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_s_Cannot_set_priority_of_an_active); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 923, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__13);
+  __Pyx_GIVEREF(__pyx_tuple__13);
+
+0924:         libev.ev_set_priority(w, priority)
+
+  ev_set_priority(__pyx_v_w, __pyx_v_priority);
+
 0925: 
+
 0926:     @property
+
+0927:     def active(self):
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_6active_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_6active_1__get__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_7watcher_6active___get__(((struct PyGeventWatcherObject *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_7watcher_6active___get__(struct PyGeventWatcherObject *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__", 0);
+
+
+  /* function exit code */
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0928:         return True if libev.ev_is_active(self.__watcher) else False
+
+  __Pyx_XDECREF(__pyx_r);
+  if ((ev_is_active(__pyx_v_self->__pyx___watcher) != 0)) {
+    __Pyx_INCREF(Py_True);
+    __pyx_t_1 = Py_True;
+  } else {
+    __Pyx_INCREF(Py_False);
+    __pyx_t_1 = Py_False;
+  }
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
 0929: 
+
 0930:     @property
+
+0931:     def pending(self):
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_7pending_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_7pending_1__get__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_7watcher_7pending___get__(((struct PyGeventWatcherObject *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_7watcher_7pending___get__(struct PyGeventWatcherObject *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__", 0);
+
+
+  /* function exit code */
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0932:         return True if libev.ev_is_pending(self.__watcher) else False
+
+  __Pyx_XDECREF(__pyx_r);
+  if ((ev_is_pending(__pyx_v_self->__pyx___watcher) != 0)) {
+    __Pyx_INCREF(Py_True);
+    __pyx_t_1 = Py_True;
+  } else {
+    __Pyx_INCREF(Py_False);
+    __pyx_t_1 = Py_False;
+  }
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
 0933: 
+
+0934:     def start(self, object callback, *args):
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_3start(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_3start(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_callback = 0;
+  PyObject *__pyx_v_args = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("start (wrapper)", 0);
+  if (PyTuple_GET_SIZE(__pyx_args) > 1) {
+    __pyx_v_args = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args));
+    if (unlikely(!__pyx_v_args)) {
+      __Pyx_RefNannyFinishContext();
+      return NULL;
+    }
+    __Pyx_GOTREF(__pyx_v_args);
+  } else {
+    __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple);
+  }
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_callback,0};
+    PyObject* values[1] = {0};
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        default:
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_callback)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+      }
+      if (unlikely(kw_args > 0)) {
+        const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1;
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "start") < 0)) __PYX_ERR(0, 934, __pyx_L3_error)
+      }
+    } else if (PyTuple_GET_SIZE(__pyx_args) < 1) {
+      goto __pyx_L5_argtuple_error;
+    } else {
+      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+    }
+    __pyx_v_callback = values[0];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("start", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 934, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0;
+  __Pyx_AddTraceback("gevent.libev.corecext.watcher.start", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_7watcher_2start(((struct PyGeventWatcherObject *)__pyx_v_self), __pyx_v_callback, __pyx_v_args);
+
+  /* function exit code */
+  __Pyx_XDECREF(__pyx_v_args);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_7watcher_2start(struct PyGeventWatcherObject *__pyx_v_self, PyObject *__pyx_v_callback, PyObject *__pyx_v_args) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("start", 0);
+
+
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_AddTraceback("gevent.libev.corecext.watcher.start", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0935:         _watcher_start(self, callback, args)
+
+  __pyx_t_1 = __pyx_f_6gevent_5libev_8corecext__watcher_start(__pyx_v_self, __pyx_v_callback, __pyx_v_args); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 935, __pyx_L1_error)
+
 0936: 
+
+0937:     def stop(self):
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_5stop(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_5stop(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("stop (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_7watcher_4stop(((struct PyGeventWatcherObject *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_7watcher_4stop(struct PyGeventWatcherObject *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("stop", 0);
+
+
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.libev.corecext.watcher.stop", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0938:         _check_loop(self.loop)
+
+  __pyx_t_1 = ((PyObject *)__pyx_v_self->loop);
+  __Pyx_INCREF(__pyx_t_1);
+  __pyx_t_2 = __pyx_f_6gevent_5libev_8corecext__check_loop(((struct PyGeventLoopObject *)__pyx_t_1)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 938, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+0939:         _libev_ref(self)
+
+  __pyx_f_6gevent_5libev_8corecext__libev_ref(__pyx_v_self);
+
 0940:         # The callback cannot possibly fire while we are executing,
+
 0941:         # so this is safe.
+
+0942:         self._callback = None
+
+  __Pyx_INCREF(Py_None);
+  __Pyx_GIVEREF(Py_None);
+  __Pyx_GOTREF(__pyx_v_self->_callback);
+  __Pyx_DECREF(__pyx_v_self->_callback);
+  __pyx_v_self->_callback = Py_None;
+
+0943:         self.args = None
+
+  __Pyx_INCREF(Py_None);
+  __Pyx_GIVEREF(Py_None);
+  __Pyx_GOTREF(__pyx_v_self->args);
+  __Pyx_DECREF(__pyx_v_self->args);
+  __pyx_v_self->args = ((PyObject*)Py_None);
+
+0944:         self.__ss.stop(self.loop._ptr, self.__watcher)
+
+  __pyx_v_self->__pyx___ss->stop(__pyx_v_self->loop->_ptr, __pyx_v_self->__pyx___watcher);
+
+0945:         _python_decref(self)
+
+  __pyx_f_6gevent_5libev_8corecext__python_decref(__pyx_v_self);
+
 0946: 
+
+0947:     def feed(self, int revents, object callback, *args):
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_7feed(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_7feed(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  int __pyx_v_revents;
+  PyObject *__pyx_v_callback = 0;
+  PyObject *__pyx_v_args = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("feed (wrapper)", 0);
+  if (PyTuple_GET_SIZE(__pyx_args) > 2) {
+    __pyx_v_args = PyTuple_GetSlice(__pyx_args, 2, PyTuple_GET_SIZE(__pyx_args));
+    if (unlikely(!__pyx_v_args)) {
+      __Pyx_RefNannyFinishContext();
+      return NULL;
+    }
+    __Pyx_GOTREF(__pyx_v_args);
+  } else {
+    __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple);
+  }
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_revents,&__pyx_n_s_callback,0};
+    PyObject* values[2] = {0,0};
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        default:
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_revents)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_callback)) != 0)) kw_args--;
+        else {
+          __Pyx_RaiseArgtupleInvalid("feed", 0, 2, 2, 1); __PYX_ERR(0, 947, __pyx_L3_error)
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        const Py_ssize_t used_pos_args = (pos_args < 2) ? pos_args : 2;
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "feed") < 0)) __PYX_ERR(0, 947, __pyx_L3_error)
+      }
+    } else if (PyTuple_GET_SIZE(__pyx_args) < 2) {
+      goto __pyx_L5_argtuple_error;
+    } else {
+      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+    }
+    __pyx_v_revents = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_revents == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 947, __pyx_L3_error)
+    __pyx_v_callback = values[1];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("feed", 0, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 947, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0;
+  __Pyx_AddTraceback("gevent.libev.corecext.watcher.feed", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_7watcher_6feed(((struct PyGeventWatcherObject *)__pyx_v_self), __pyx_v_revents, __pyx_v_callback, __pyx_v_args);
+
+  /* function exit code */
+  __Pyx_XDECREF(__pyx_v_args);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_7watcher_6feed(struct PyGeventWatcherObject *__pyx_v_self, int __pyx_v_revents, PyObject *__pyx_v_callback, PyObject *__pyx_v_args) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("feed", 0);
+
+
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.libev.corecext.watcher.feed", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0948:         _check_loop(self.loop)
+
+  __pyx_t_1 = ((PyObject *)__pyx_v_self->loop);
+  __Pyx_INCREF(__pyx_t_1);
+  __pyx_t_2 = __pyx_f_6gevent_5libev_8corecext__check_loop(((struct PyGeventLoopObject *)__pyx_t_1)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 948, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+0949:         self.callback = callback
+
+  if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_callback, __pyx_v_callback) < 0) __PYX_ERR(0, 949, __pyx_L1_error)
+
+0950:         self.args = args
+
+  __Pyx_INCREF(__pyx_v_args);
+  __Pyx_GIVEREF(__pyx_v_args);
+  __Pyx_GOTREF(__pyx_v_self->args);
+  __Pyx_DECREF(__pyx_v_self->args);
+  __pyx_v_self->args = __pyx_v_args;
+
+0951:         _libev_unref(self)
+
+  __pyx_f_6gevent_5libev_8corecext__libev_unref(__pyx_v_self);
+
+0952:         libev.ev_feed_event(self.loop._ptr, self.__watcher, revents)
+
+  ev_feed_event(__pyx_v_self->loop->_ptr, __pyx_v_self->__pyx___watcher, __pyx_v_revents);
+
+0953:         _python_incref(self)
+
+  __pyx_f_6gevent_5libev_8corecext__python_incref(__pyx_v_self);
+
 0954: 
+
+0955:     def __repr__(self):
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_9__repr__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_9__repr__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_7watcher_8__repr__(((struct PyGeventWatcherObject *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_7watcher_8__repr__(struct PyGeventWatcherObject *__pyx_v_self) {
+  PyObject *__pyx_v_format = NULL;
+  PyObject *__pyx_v_result = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__repr__", 0);
+
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_AddTraceback("gevent.libev.corecext.watcher.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_format);
+  __Pyx_XDECREF(__pyx_v_result);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0956:         if Py_ReprEnter(self) != 0:
+
+  __pyx_t_1 = ((Py_ReprEnter(((PyObject *)__pyx_v_self)) != 0) != 0);
+  if (__pyx_t_1) {
+
+  }
+
+0957:             return "<...>"
+
+    __Pyx_XDECREF(__pyx_r);
+    __Pyx_INCREF(__pyx_kp_s__5);
+    __pyx_r = __pyx_kp_s__5;
+    goto __pyx_L0;
+
+0958:         try:
+
+  /*try:*/ {
+
+0959:             format = self._format()
+
+    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 959, __pyx_L5_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __pyx_t_4 = NULL;
+    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
+      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+      if (likely(__pyx_t_4)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+        __Pyx_INCREF(__pyx_t_4);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_3, function);
+      }
+    }
+    __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
+    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 959, __pyx_L5_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __pyx_v_format = __pyx_t_2;
+    __pyx_t_2 = 0;
+
+0960:             result = "<%s at 0x%x%s" % (self.__class__.__name__, id(self), format)
+
+    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 960, __pyx_L5_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 960, __pyx_L5_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 960, __pyx_L5_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 960, __pyx_L5_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_GIVEREF(__pyx_t_3);
+    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
+    __Pyx_GIVEREF(__pyx_t_2);
+    PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
+    __Pyx_INCREF(__pyx_v_format);
+    __Pyx_GIVEREF(__pyx_v_format);
+    PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_format);
+    __pyx_t_3 = 0;
+    __pyx_t_2 = 0;
+    __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_s_at_0x_x_s, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 960, __pyx_L5_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __pyx_v_result = ((PyObject*)__pyx_t_2);
+    __pyx_t_2 = 0;
+
+0961:             if self.active:
+
+    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_active); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 961, __pyx_L5_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 961, __pyx_L5_error)
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    if (__pyx_t_1) {
+
+    }
+
+0962:                 result += " active"
+
+      __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_kp_s_active_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 962, __pyx_L5_error)
+      __Pyx_GOTREF(__pyx_t_2);
+      __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_2));
+      __pyx_t_2 = 0;
+
+0963:             if self.pending:
+
+    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_pending); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 963, __pyx_L5_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 963, __pyx_L5_error)
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    if (__pyx_t_1) {
+
+    }
+
+0964:                 result += " pending"
+
+      __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_kp_s_pending_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 964, __pyx_L5_error)
+      __Pyx_GOTREF(__pyx_t_2);
+      __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_2));
+      __pyx_t_2 = 0;
+
+0965:             if self.callback is not None:
+
+    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_callback); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 965, __pyx_L5_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_1 = (__pyx_t_2 != Py_None);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __pyx_t_5 = (__pyx_t_1 != 0);
+    if (__pyx_t_5) {
+
+    }
+
+0966:                 result += " callback=%r" % (self.callback, )
+
+      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_callback); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 966, __pyx_L5_error)
+      __Pyx_GOTREF(__pyx_t_2);
+      __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 966, __pyx_L5_error)
+      __Pyx_GOTREF(__pyx_t_4);
+      __Pyx_GIVEREF(__pyx_t_2);
+      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
+      __pyx_t_2 = 0;
+      __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_callback_r, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 966, __pyx_L5_error)
+      __Pyx_GOTREF(__pyx_t_2);
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 966, __pyx_L5_error)
+      __Pyx_GOTREF(__pyx_t_4);
+      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+      __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_4));
+      __pyx_t_4 = 0;
+
+0967:             if self.args is not None:
+
+    __pyx_t_5 = (__pyx_v_self->args != ((PyObject*)Py_None));
+    __pyx_t_1 = (__pyx_t_5 != 0);
+    if (__pyx_t_1) {
+
+    }
+
+0968:                 result += " args=%r" % (self.args, )
+
+      __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 968, __pyx_L5_error)
+      __Pyx_GOTREF(__pyx_t_4);
+      __Pyx_INCREF(__pyx_v_self->args);
+      __Pyx_GIVEREF(__pyx_v_self->args);
+      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_self->args);
+      __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_args_r, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 968, __pyx_L5_error)
+      __Pyx_GOTREF(__pyx_t_2);
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 968, __pyx_L5_error)
+      __Pyx_GOTREF(__pyx_t_4);
+      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+      __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_4));
+      __pyx_t_4 = 0;
+
+0969:             return result + ">"
+
+    __Pyx_XDECREF(__pyx_r);
+    __pyx_t_4 = PyNumber_Add(__pyx_v_result, __pyx_kp_s__6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 969, __pyx_L5_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    __pyx_r = __pyx_t_4;
+    __pyx_t_4 = 0;
+    goto __pyx_L4_return;
+  }
+
 0970:         finally:
+
+0971:             Py_ReprLeave(self)
+
+  /*finally:*/ {
+    __pyx_L5_error:;
+    /*exception exit:*/{
+      __Pyx_PyThreadState_declare
+      __Pyx_PyThreadState_assign
+      __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0;
+      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+      if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14);
+      if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11) < 0)) __Pyx_ErrFetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
+      __Pyx_XGOTREF(__pyx_t_9);
+      __Pyx_XGOTREF(__pyx_t_10);
+      __Pyx_XGOTREF(__pyx_t_11);
+      __Pyx_XGOTREF(__pyx_t_12);
+      __Pyx_XGOTREF(__pyx_t_13);
+      __Pyx_XGOTREF(__pyx_t_14);
+      __pyx_t_6 = __pyx_lineno; __pyx_t_7 = __pyx_clineno; __pyx_t_8 = __pyx_filename;
+      {
+        Py_ReprLeave(((PyObject *)__pyx_v_self));
+      }
+      if (PY_MAJOR_VERSION >= 3) {
+        __Pyx_XGIVEREF(__pyx_t_12);
+        __Pyx_XGIVEREF(__pyx_t_13);
+        __Pyx_XGIVEREF(__pyx_t_14);
+        __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14);
+      }
+      __Pyx_XGIVEREF(__pyx_t_9);
+      __Pyx_XGIVEREF(__pyx_t_10);
+      __Pyx_XGIVEREF(__pyx_t_11);
+      __Pyx_ErrRestore(__pyx_t_9, __pyx_t_10, __pyx_t_11);
+      __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0;
+      __pyx_lineno = __pyx_t_6; __pyx_clineno = __pyx_t_7; __pyx_filename = __pyx_t_8;
+      goto __pyx_L1_error;
+    }
+    __pyx_L4_return: {
+      __pyx_t_14 = __pyx_r;
+      __pyx_r = 0;
+      Py_ReprLeave(((PyObject *)__pyx_v_self));
+      __pyx_r = __pyx_t_14;
+      __pyx_t_14 = 0;
+      goto __pyx_L0;
+    }
+  }
+
 0972: 
+
+0973:     def _format(self):
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_11_format(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_11_format(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_format (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_7watcher_10_format(((struct PyGeventWatcherObject *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_7watcher_10_format(CYTHON_UNUSED struct PyGeventWatcherObject *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_format", 0);
+
+
+  /* function exit code */
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0974:         return ''
+
+  __Pyx_XDECREF(__pyx_r);
+  __Pyx_INCREF(__pyx_kp_s__7);
+  __pyx_r = __pyx_kp_s__7;
+  goto __pyx_L0;
+
 0975: 
+
+0976:     def close(self):
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_13close(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_13close(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("close (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_7watcher_12close(((struct PyGeventWatcherObject *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_7watcher_12close(struct PyGeventWatcherObject *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("close", 0);
+
+
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_AddTraceback("gevent.libev.corecext.watcher.close", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0977:         self.stop()
+
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_stop); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 977, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = NULL;
+  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+    if (likely(__pyx_t_3)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+      __Pyx_INCREF(__pyx_t_3);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_2, function);
+    }
+  }
+  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 977, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 0978: 
+
+0979:     def __enter__(self):
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_15__enter__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_15__enter__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__enter__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_7watcher_14__enter__(((struct PyGeventWatcherObject *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_7watcher_14__enter__(struct PyGeventWatcherObject *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__enter__", 0);
+
+
+  /* function exit code */
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0980:         return self
+
+  __Pyx_XDECREF(__pyx_r);
+  __Pyx_INCREF(((PyObject *)__pyx_v_self));
+  __pyx_r = ((PyObject *)__pyx_v_self);
+  goto __pyx_L0;
+
 0981: 
+
+0982:     def __exit__(self, t, v, tb):
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_17__exit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_17__exit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  CYTHON_UNUSED PyObject *__pyx_v_t = 0;
+  CYTHON_UNUSED PyObject *__pyx_v_v = 0;
+  CYTHON_UNUSED PyObject *__pyx_v_tb = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__exit__ (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_t,&__pyx_n_s_v,&__pyx_n_s_tb,0};
+    PyObject* values[3] = {0,0,0};
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_v)) != 0)) kw_args--;
+        else {
+          __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, 1); __PYX_ERR(0, 982, __pyx_L3_error)
+        }
+        CYTHON_FALLTHROUGH;
+        case  2:
+        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tb)) != 0)) kw_args--;
+        else {
+          __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, 2); __PYX_ERR(0, 982, __pyx_L3_error)
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__exit__") < 0)) __PYX_ERR(0, 982, __pyx_L3_error)
+      }
+    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
+      goto __pyx_L5_argtuple_error;
+    } else {
+      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+    }
+    __pyx_v_t = values[0];
+    __pyx_v_v = values[1];
+    __pyx_v_tb = values[2];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 982, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.libev.corecext.watcher.__exit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_7watcher_16__exit__(((struct PyGeventWatcherObject *)__pyx_v_self), __pyx_v_t, __pyx_v_v, __pyx_v_tb);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_7watcher_16__exit__(struct PyGeventWatcherObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_t, CYTHON_UNUSED PyObject *__pyx_v_v, CYTHON_UNUSED PyObject *__pyx_v_tb) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__exit__", 0);
+
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_AddTraceback("gevent.libev.corecext.watcher.__exit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0983:         self.close()
+
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 983, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = NULL;
+  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+    if (likely(__pyx_t_3)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+      __Pyx_INCREF(__pyx_t_3);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_2, function);
+    }
+  }
+  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 983, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+0984:         return
+
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+
 0985: 
+
+0986: cdef start_and_stop io_ss = make_ss(<void*>libev.ev_io_start, <void*>libev.ev_io_stop)
+
+  __pyx_v_6gevent_5libev_8corecext_io_ss = __pyx_f_6gevent_5libev_8corecext_make_ss(((void *)ev_io_start), ((void *)ev_io_stop));
+
 0987: 
+
+0988: cdef public class io(watcher) [object PyGeventIOObject, type PyGeventIO_Type]:
+
+struct PyGeventIOObject {
+  struct PyGeventWatcherObject __pyx_base;
+  struct ev_io _watcher;
+};
+
+__PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyGeventIO_Type;
+
 0989: 
+
 0990:     cdef libev.ev_io _watcher
+
 0991: 
+
+0992:     def start(self, object callback, *args, pass_events=False):
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_2io_1start(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_2io_1start(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_callback = 0;
+  PyObject *__pyx_v_pass_events = 0;
+  PyObject *__pyx_v_args = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("start (wrapper)", 0);
+  if (PyTuple_GET_SIZE(__pyx_args) > 1) {
+    __pyx_v_args = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args));
+    if (unlikely(!__pyx_v_args)) {
+      __Pyx_RefNannyFinishContext();
+      return NULL;
+    }
+    __Pyx_GOTREF(__pyx_v_args);
+  } else {
+    __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple);
+  }
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_callback,&__pyx_n_s_pass_events,0};
+    PyObject* values[2] = {0,0};
+    values[1] = ((PyObject *)Py_False);
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        default:
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_callback)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+      }
+      if (kw_args == 1) {
+        const Py_ssize_t index = 1;
+        PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, *__pyx_pyargnames[index]);
+        if (value) { values[index] = value; kw_args--; }
+      }
+      if (unlikely(kw_args > 0)) {
+        const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1;
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "start") < 0)) __PYX_ERR(0, 992, __pyx_L3_error)
+      }
+    } else if (PyTuple_GET_SIZE(__pyx_args) < 1) {
+      goto __pyx_L5_argtuple_error;
+    } else {
+      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+    }
+    __pyx_v_callback = values[0];
+    __pyx_v_pass_events = values[1];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("start", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 992, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0;
+  __Pyx_AddTraceback("gevent.libev.corecext.io.start", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_2io_start(((struct PyGeventIOObject *)__pyx_v_self), __pyx_v_callback, __pyx_v_pass_events, __pyx_v_args);
+
+  /* function exit code */
+  __Pyx_XDECREF(__pyx_v_args);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_2io_start(struct PyGeventIOObject *__pyx_v_self, PyObject *__pyx_v_callback, PyObject *__pyx_v_pass_events, PyObject *__pyx_v_args) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("start", 0);
+  __Pyx_INCREF(__pyx_v_args);
+
+
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_AddTraceback("gevent.libev.corecext.io.start", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_args);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0993:         if pass_events:
+
+  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_pass_events); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 993, __pyx_L1_error)
+  if (__pyx_t_1) {
+
+  }
+
+0994:             args = (GEVENT_CORE_EVENTS, ) + args
+
+    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 994, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_INCREF(GEVENT_CORE_EVENTS);
+    __Pyx_GIVEREF(GEVENT_CORE_EVENTS);
+    PyTuple_SET_ITEM(__pyx_t_2, 0, GEVENT_CORE_EVENTS);
+    __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_v_args); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 994, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __Pyx_DECREF_SET(__pyx_v_args, ((PyObject*)__pyx_t_3));
+    __pyx_t_3 = 0;
+
+0995:         _watcher_start(self, callback, args)
+
+  __pyx_t_1 = __pyx_f_6gevent_5libev_8corecext__watcher_start(((struct PyGeventWatcherObject *)__pyx_v_self), __pyx_v_callback, __pyx_v_args); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 995, __pyx_L1_error)
+
 0996: 
+
+0997:     def __init__(self, loop loop, libev.vfd_socket_t fd, int events, ref=True, priority=None):
+
+
+/* Python wrapper */
+static int __pyx_pw_6gevent_5libev_8corecext_2io_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static int __pyx_pw_6gevent_5libev_8corecext_2io_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  struct PyGeventLoopObject *__pyx_v_loop = 0;
+  CYTHON_UNUSED vfd_socket_t __pyx_v_fd;
+  CYTHON_UNUSED int __pyx_v_events;
+  PyObject *__pyx_v_ref = 0;
+  PyObject *__pyx_v_priority = 0;
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_loop,&__pyx_n_s_fd,&__pyx_n_s_events_2,&__pyx_n_s_ref,&__pyx_n_s_priority,0};
+    PyObject* values[5] = {0,0,0,0,0};
+    values[3] = ((PyObject *)Py_True);
+    values[4] = ((PyObject *)Py_None);
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
+        CYTHON_FALLTHROUGH;
+        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
+        CYTHON_FALLTHROUGH;
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_loop)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_fd)) != 0)) kw_args--;
+        else {
+          __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 5, 1); __PYX_ERR(0, 997, __pyx_L3_error)
+        }
+        CYTHON_FALLTHROUGH;
+        case  2:
+        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_events_2)) != 0)) kw_args--;
+        else {
+          __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 5, 2); __PYX_ERR(0, 997, __pyx_L3_error)
+        }
+        CYTHON_FALLTHROUGH;
+        case  3:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ref);
+          if (value) { values[3] = value; kw_args--; }
+        }
+        CYTHON_FALLTHROUGH;
+        case  4:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_priority);
+          if (value) { values[4] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 997, __pyx_L3_error)
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
+        CYTHON_FALLTHROUGH;
+        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
+        CYTHON_FALLTHROUGH;
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    __pyx_v_loop = ((struct PyGeventLoopObject *)values[0]);
+    __pyx_v_fd = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_fd == ((vfd_socket_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 997, __pyx_L3_error)
+    __pyx_v_events = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_events == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 997, __pyx_L3_error)
+    __pyx_v_ref = values[3];
+    __pyx_v_priority = values[4];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 997, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.libev.corecext.io.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return -1;
+  __pyx_L4_argument_unpacking_done:;
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_loop), __pyx_ptype_6gevent_5libev_8corecext_loop, 1, "loop", 0))) __PYX_ERR(0, 997, __pyx_L1_error)
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_2io_2__init__(((struct PyGeventIOObject *)__pyx_v_self), __pyx_v_loop, __pyx_v_fd, __pyx_v_events, __pyx_v_ref, __pyx_v_priority);
+
+  /* function exit code */
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __pyx_r = -1;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_5libev_8corecext_2io_2__init__(struct PyGeventIOObject *__pyx_v_self, struct PyGeventLoopObject *__pyx_v_loop, CYTHON_UNUSED vfd_socket_t __pyx_v_fd, CYTHON_UNUSED int __pyx_v_events, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__", 0);
+
+
+  /* function exit code */
+  __pyx_r = 0;
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_AddTraceback("gevent.libev.corecext.io.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = -1;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0998:         watcher.__init__(self, loop, ref, priority)
+
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_6gevent_5libev_8corecext_watcher), __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 998, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = NULL;
+  __pyx_t_4 = 0;
+  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+    if (likely(__pyx_t_3)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+      __Pyx_INCREF(__pyx_t_3);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_2, function);
+      __pyx_t_4 = 1;
+    }
+  }
+  #if CYTHON_FAST_PYCALL
+  if (PyFunction_Check(__pyx_t_2)) {
+    PyObject *__pyx_temp[5] = {__pyx_t_3, ((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_loop), __pyx_v_ref, __pyx_v_priority};
+    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 4+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 998, __pyx_L1_error)
+    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __Pyx_GOTREF(__pyx_t_1);
+  } else
+  #endif
+  #if CYTHON_FAST_PYCCALL
+  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
+    PyObject *__pyx_temp[5] = {__pyx_t_3, ((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_loop), __pyx_v_ref, __pyx_v_priority};
+    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 4+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 998, __pyx_L1_error)
+    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __Pyx_GOTREF(__pyx_t_1);
+  } else
+  #endif
+  {
+    __pyx_t_5 = PyTuple_New(4+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 998, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_5);
+    if (__pyx_t_3) {
+      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
+    }
+    __Pyx_INCREF(((PyObject *)__pyx_v_self));
+    __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
+    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, ((PyObject *)__pyx_v_self));
+    __Pyx_INCREF(((PyObject *)__pyx_v_loop));
+    __Pyx_GIVEREF(((PyObject *)__pyx_v_loop));
+    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, ((PyObject *)__pyx_v_loop));
+    __Pyx_INCREF(__pyx_v_ref);
+    __Pyx_GIVEREF(__pyx_v_ref);
+    PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_4, __pyx_v_ref);
+    __Pyx_INCREF(__pyx_v_priority);
+    __Pyx_GIVEREF(__pyx_v_priority);
+    PyTuple_SET_ITEM(__pyx_t_5, 3+__pyx_t_4, __pyx_v_priority);
+    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 998, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+  }
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 0999: 
+
+1000:     def __cinit__(self, loop loop, libev.vfd_socket_t fd, int events, ref=True, priority=None):
+
+
+/* Python wrapper */
+static int __pyx_pw_6gevent_5libev_8corecext_2io_5__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static int __pyx_pw_6gevent_5libev_8corecext_2io_5__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_loop = 0;
+  vfd_socket_t __pyx_v_fd;
+  int __pyx_v_events;
+  CYTHON_UNUSED PyObject *__pyx_v_ref = 0;
+  CYTHON_UNUSED PyObject *__pyx_v_priority = 0;
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_loop,&__pyx_n_s_fd,&__pyx_n_s_events_2,&__pyx_n_s_ref,&__pyx_n_s_priority,0};
+    PyObject* values[5] = {0,0,0,0,0};
+    values[3] = ((PyObject *)Py_True);
+    values[4] = ((PyObject *)Py_None);
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
+        CYTHON_FALLTHROUGH;
+        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
+        CYTHON_FALLTHROUGH;
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_loop)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_fd)) != 0)) kw_args--;
+        else {
+          __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 1); __PYX_ERR(0, 1000, __pyx_L3_error)
+        }
+        CYTHON_FALLTHROUGH;
+        case  2:
+        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_events_2)) != 0)) kw_args--;
+        else {
+          __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 2); __PYX_ERR(0, 1000, __pyx_L3_error)
+        }
+        CYTHON_FALLTHROUGH;
+        case  3:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ref);
+          if (value) { values[3] = value; kw_args--; }
+        }
+        CYTHON_FALLTHROUGH;
+        case  4:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_priority);
+          if (value) { values[4] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 1000, __pyx_L3_error)
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
+        CYTHON_FALLTHROUGH;
+        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
+        CYTHON_FALLTHROUGH;
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    __pyx_v_loop = ((struct PyGeventLoopObject *)values[0]);
+    __pyx_v_fd = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_fd == ((vfd_socket_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1000, __pyx_L3_error)
+    __pyx_v_events = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_events == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1000, __pyx_L3_error)
+    __pyx_v_ref = values[3];
+    __pyx_v_priority = values[4];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1000, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.libev.corecext.io.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return -1;
+  __pyx_L4_argument_unpacking_done:;
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_loop), __pyx_ptype_6gevent_5libev_8corecext_loop, 1, "loop", 0))) __PYX_ERR(0, 1000, __pyx_L1_error)
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_2io_4__cinit__(((struct PyGeventIOObject *)__pyx_v_self), __pyx_v_loop, __pyx_v_fd, __pyx_v_events, __pyx_v_ref, __pyx_v_priority);
+
+  /* function exit code */
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __pyx_r = -1;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_5libev_8corecext_2io_4__cinit__(struct PyGeventIOObject *__pyx_v_self, CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_loop, vfd_socket_t __pyx_v_fd, int __pyx_v_events, CYTHON_UNUSED PyObject *__pyx_v_ref, CYTHON_UNUSED PyObject *__pyx_v_priority) {
+  int __pyx_v_vfd;
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__cinit__", 0);
+
+
+  /* function exit code */
+  __pyx_r = 0;
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_AddTraceback("gevent.libev.corecext.io.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = -1;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+1001:         if fd < 0:
+
+  __pyx_t_1 = ((__pyx_v_fd < 0) != 0);
+  if (unlikely(__pyx_t_1)) {
+
+  }
+
+1002:             raise ValueError('fd must be non-negative: %r' % fd)
+
+    __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_fd); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1002, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_fd_must_be_non_negative_r, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1002, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1002, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __PYX_ERR(0, 1002, __pyx_L1_error)
+
+1003:         if events & ~(libev.EV__IOFDSET | libev.EV_READ | libev.EV_WRITE):
+
+  __pyx_t_1 = ((__pyx_v_events & (~((EV__IOFDSET | EV_READ) | EV_WRITE))) != 0);
+  if (unlikely(__pyx_t_1)) {
+
+  }
+
+1004:             raise ValueError('illegal event mask: %r' % events)
+
+    __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_events); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1004, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_illegal_event_mask_r, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1004, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1004, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __PYX_ERR(0, 1004, __pyx_L1_error)
+
 1005:         # All the vfd_functions are no-ops on POSIX
+
+1006:         cdef int vfd = libev.vfd_open(fd)
+
+  __pyx_t_4 = vfd_open(__pyx_v_fd); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 1006, __pyx_L1_error)
+  __pyx_v_vfd = __pyx_t_4;
+
+1007:         libev.ev_io_init(&self._watcher, <void *>gevent_callback_io, vfd, events)
+
+  ev_io_init((&__pyx_v_self->_watcher), ((void *)gevent_callback_io), __pyx_v_vfd, __pyx_v_events);
+
+1008:         self.__watcher = <libev.ev_watcher*>&self._watcher
+
+  __pyx_v_self->__pyx_base.__pyx___watcher = ((struct ev_watcher *)(&__pyx_v_self->_watcher));
+
+1009:         self.__ss = &io_ss
+
+  __pyx_v_self->__pyx_base.__pyx___ss = (&__pyx_v_6gevent_5libev_8corecext_io_ss);
+
 1010: 
+
+1011:     def __dealloc__(self):
+
+
+/* Python wrapper */
+static void __pyx_pw_6gevent_5libev_8corecext_2io_7__dealloc__(PyObject *__pyx_v_self); /*proto*/
+static void __pyx_pw_6gevent_5libev_8corecext_2io_7__dealloc__(PyObject *__pyx_v_self) {
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
+  __pyx_pf_6gevent_5libev_8corecext_2io_6__dealloc__(((struct PyGeventIOObject *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+}
+
+static void __pyx_pf_6gevent_5libev_8corecext_2io_6__dealloc__(struct PyGeventIOObject *__pyx_v_self) {
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__dealloc__", 0);
+
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+}
+
+1012:         libev.vfd_free(self._watcher.fd)
+
+  vfd_free(__pyx_v_self->_watcher.fd);
+
 1013: 
+
 1014:     @property
+
+1015:     def fd(self):
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_2io_2fd_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_2io_2fd_1__get__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_2io_2fd___get__(((struct PyGeventIOObject *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_2io_2fd___get__(struct PyGeventIOObject *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__", 0);
+
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.libev.corecext.io.fd.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+1016:         return libev.vfd_get(self._watcher.fd)
+
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = PyInt_FromSsize_t(vfd_get(__pyx_v_self->_watcher.fd)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1016, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
 1017: 
+
 1018:     @fd.setter
+
+1019:     def fd(self, long fd):
+
+
+/* Python wrapper */
+static int __pyx_pw_6gevent_5libev_8corecext_2io_2fd_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_fd); /*proto*/
+static int __pyx_pw_6gevent_5libev_8corecext_2io_2fd_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_fd) {
+  long __pyx_v_fd;
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
+  assert(__pyx_arg_fd); {
+    __pyx_v_fd = __Pyx_PyInt_As_long(__pyx_arg_fd); if (unlikely((__pyx_v_fd == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 1019, __pyx_L3_error)
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.libev.corecext.io.fd.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return -1;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_2io_2fd_2__set__(((struct PyGeventIOObject *)__pyx_v_self), ((long)__pyx_v_fd));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_5libev_8corecext_2io_2fd_2__set__(struct PyGeventIOObject *__pyx_v_self, long __pyx_v_fd) {
+  int __pyx_v_vfd;
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__set__", 0);
+
+
+  /* function exit code */
+  __pyx_r = 0;
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_AddTraceback("gevent.libev.corecext.io.fd.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = -1;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+1020:         if libev.ev_is_active(&self._watcher):
+
+  __pyx_t_1 = (ev_is_active((&__pyx_v_self->_watcher)) != 0);
+  if (unlikely(__pyx_t_1)) {
+
+  }
+
+1021:             raise AttributeError("'io' watcher attribute 'fd' is read-only while watcher is active")
+
+    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_AttributeError, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1021, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __PYX_ERR(0, 1021, __pyx_L1_error)
+
+  __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_s_io_watcher_attribute_fd_is_read); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(0, 1021, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__14);
+  __Pyx_GIVEREF(__pyx_tuple__14);
+
+1022:         cdef int vfd = libev.vfd_open(fd)
+
+  __pyx_t_3 = vfd_open(__pyx_v_fd); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 1022, __pyx_L1_error)
+  __pyx_v_vfd = __pyx_t_3;
+
+1023:         libev.vfd_free(self._watcher.fd)
+
+  vfd_free(__pyx_v_self->_watcher.fd);
+
+1024:         libev.ev_io_init(&self._watcher, <void *>gevent_callback_io, vfd, self._watcher.events)
+
+  ev_io_init((&__pyx_v_self->_watcher), ((void *)gevent_callback_io), __pyx_v_vfd, __pyx_v_self->_watcher.events);
+
 1025: 
+
 1026:     @property
+
+1027:     def events(self):
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_2io_6events_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_2io_6events_1__get__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_2io_6events___get__(((struct PyGeventIOObject *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_2io_6events___get__(struct PyGeventIOObject *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__", 0);
+
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.libev.corecext.io.events.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+1028:         return self._watcher.events
+
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->_watcher.events); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1028, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
 1029: 
+
 1030:     @events.setter
+
+1031:     def events(self, int events):
+
+
+/* Python wrapper */
+static int __pyx_pw_6gevent_5libev_8corecext_2io_6events_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_events); /*proto*/
+static int __pyx_pw_6gevent_5libev_8corecext_2io_6events_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_events) {
+  int __pyx_v_events;
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
+  assert(__pyx_arg_events); {
+    __pyx_v_events = __Pyx_PyInt_As_int(__pyx_arg_events); if (unlikely((__pyx_v_events == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1031, __pyx_L3_error)
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.libev.corecext.io.events.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return -1;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_2io_6events_2__set__(((struct PyGeventIOObject *)__pyx_v_self), ((int)__pyx_v_events));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_5libev_8corecext_2io_6events_2__set__(struct PyGeventIOObject *__pyx_v_self, int __pyx_v_events) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__set__", 0);
+
+
+  /* function exit code */
+  __pyx_r = 0;
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_AddTraceback("gevent.libev.corecext.io.events.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = -1;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+1032:         if libev.ev_is_active(&self._watcher):
+
+  __pyx_t_1 = (ev_is_active((&__pyx_v_self->_watcher)) != 0);
+  if (unlikely(__pyx_t_1)) {
+
+  }
+
+1033:             raise AttributeError("'io' watcher attribute 'events' is read-only while watcher is active")
+
+    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_AttributeError, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1033, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __PYX_ERR(0, 1033, __pyx_L1_error)
+
+  __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_io_watcher_attribute_events_is); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(0, 1033, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__15);
+  __Pyx_GIVEREF(__pyx_tuple__15);
+
+1034:         libev.ev_io_init(&self._watcher, <void *>gevent_callback_io, self._watcher.fd, events)
+
+  ev_io_init((&__pyx_v_self->_watcher), ((void *)gevent_callback_io), __pyx_v_self->_watcher.fd, __pyx_v_events);
+
 1035: 
+
 1036:     @property
+
+1037:     def events_str(self):
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_2io_10events_str_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_2io_10events_str_1__get__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_2io_10events_str___get__(((struct PyGeventIOObject *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_2io_10events_str___get__(struct PyGeventIOObject *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__", 0);
+
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.libev.corecext.io.events_str.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+1038:         return _events_to_str(self._watcher.events)
+
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __pyx_f_6gevent_5libev_8corecext__events_to_str(__pyx_v_self->_watcher.events, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1038, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
 1039: 
+
+1040:     def _format(self):
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_2io_9_format(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_2io_9_format(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_format (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_2io_8_format(((struct PyGeventIOObject *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_2io_8_format(struct PyGeventIOObject *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_format", 0);
+
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_AddTraceback("gevent.libev.corecext.io._format", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+1041:         return ' fd=%s events=%s' % (self.fd, self.events_str)
+
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_fd); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1041, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_events_str); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1041, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1041, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_GIVEREF(__pyx_t_1);
+  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_2);
+  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
+  __pyx_t_1 = 0;
+  __pyx_t_2 = 0;
+  __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_fd_s_events_s, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1041, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __pyx_r = __pyx_t_2;
+  __pyx_t_2 = 0;
+  goto __pyx_L0;
+
 1042: 
+
+1043: cdef start_and_stop timer_ss = make_ss(<void*>libev.ev_timer_start, <void*>libev.ev_timer_stop)
+
+  __pyx_v_6gevent_5libev_8corecext_timer_ss = __pyx_f_6gevent_5libev_8corecext_make_ss(((void *)ev_timer_start), ((void *)ev_timer_stop));
+
 1044: 
+
+1045: cdef public class timer(watcher) [object PyGeventTimerObject, type PyGeventTimer_Type]:
+
+struct PyGeventTimerObject {
+  struct PyGeventWatcherObject __pyx_base;
+  struct ev_timer _watcher;
+};
+
+__PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyGeventTimer_Type;
+
 1046: 
+
 1047:     cdef libev.ev_timer _watcher
+
 1048: 
+
+1049:     def __cinit__(self, loop loop, double after=0.0, double repeat=0.0, ref=True, priority=None):
+
+
+/* Python wrapper */
+static int __pyx_pw_6gevent_5libev_8corecext_5timer_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static int __pyx_pw_6gevent_5libev_8corecext_5timer_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_loop = 0;
+  double __pyx_v_after;
+  double __pyx_v_repeat;
+  CYTHON_UNUSED PyObject *__pyx_v_ref = 0;
+  CYTHON_UNUSED PyObject *__pyx_v_priority = 0;
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_loop,&__pyx_n_s_after,&__pyx_n_s_repeat,&__pyx_n_s_ref,&__pyx_n_s_priority,0};
+    PyObject* values[5] = {0,0,0,0,0};
+    values[3] = ((PyObject *)Py_True);
+    values[4] = ((PyObject *)Py_None);
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
+        CYTHON_FALLTHROUGH;
+        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
+        CYTHON_FALLTHROUGH;
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_loop)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_after);
+          if (value) { values[1] = value; kw_args--; }
+        }
+        CYTHON_FALLTHROUGH;
+        case  2:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_repeat);
+          if (value) { values[2] = value; kw_args--; }
+        }
+        CYTHON_FALLTHROUGH;
+        case  3:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ref);
+          if (value) { values[3] = value; kw_args--; }
+        }
+        CYTHON_FALLTHROUGH;
+        case  4:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_priority);
+          if (value) { values[4] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 1049, __pyx_L3_error)
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
+        CYTHON_FALLTHROUGH;
+        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
+        CYTHON_FALLTHROUGH;
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    __pyx_v_loop = ((struct PyGeventLoopObject *)values[0]);
+    if (values[1]) {
+      __pyx_v_after = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_after == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1049, __pyx_L3_error)
+    } else {
+      __pyx_v_after = ((double)0.0);
+    }
+    if (values[2]) {
+      __pyx_v_repeat = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_repeat == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1049, __pyx_L3_error)
+    } else {
+      __pyx_v_repeat = ((double)0.0);
+    }
+    __pyx_v_ref = values[3];
+    __pyx_v_priority = values[4];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1049, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.libev.corecext.timer.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return -1;
+  __pyx_L4_argument_unpacking_done:;
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_loop), __pyx_ptype_6gevent_5libev_8corecext_loop, 1, "loop", 0))) __PYX_ERR(0, 1049, __pyx_L1_error)
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_5timer___cinit__(((struct PyGeventTimerObject *)__pyx_v_self), __pyx_v_loop, __pyx_v_after, __pyx_v_repeat, __pyx_v_ref, __pyx_v_priority);
+
+  /* function exit code */
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __pyx_r = -1;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_5libev_8corecext_5timer___cinit__(struct PyGeventTimerObject *__pyx_v_self, CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_loop, double __pyx_v_after, double __pyx_v_repeat, CYTHON_UNUSED PyObject *__pyx_v_ref, CYTHON_UNUSED PyObject *__pyx_v_priority) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__cinit__", 0);
+
+
+  /* function exit code */
+  __pyx_r = 0;
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_AddTraceback("gevent.libev.corecext.timer.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = -1;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+1050:         if repeat < 0.0:
+
+  __pyx_t_1 = ((__pyx_v_repeat < 0.0) != 0);
+  if (unlikely(__pyx_t_1)) {
+
+  }
+
+1051:             raise ValueError("repeat must be positive or zero: %r" % repeat)
+
+    __pyx_t_2 = PyFloat_FromDouble(__pyx_v_repeat); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1051, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_repeat_must_be_positive_or_zero, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1051, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1051, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __PYX_ERR(0, 1051, __pyx_L1_error)
+
+1052:         libev.ev_timer_init(&self._watcher, <void *>gevent_callback_timer, after, repeat)
+
+  ev_timer_init((&__pyx_v_self->_watcher), ((void *)gevent_callback_timer), __pyx_v_after, __pyx_v_repeat);
+
+1053:         self.__watcher = <libev.ev_watcher*>&self._watcher
+
+  __pyx_v_self->__pyx_base.__pyx___watcher = ((struct ev_watcher *)(&__pyx_v_self->_watcher));
+
+1054:         self.__ss = &timer_ss
+
+  __pyx_v_self->__pyx_base.__pyx___ss = (&__pyx_v_6gevent_5libev_8corecext_timer_ss);
+
 1055: 
+
+1056:     def __init__(self, loop loop, double after=0.0, double repeat=0.0, ref=True, priority=None):
+
+
+/* Python wrapper */
+static int __pyx_pw_6gevent_5libev_8corecext_5timer_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static int __pyx_pw_6gevent_5libev_8corecext_5timer_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  struct PyGeventLoopObject *__pyx_v_loop = 0;
+  CYTHON_UNUSED double __pyx_v_after;
+  CYTHON_UNUSED double __pyx_v_repeat;
+  PyObject *__pyx_v_ref = 0;
+  PyObject *__pyx_v_priority = 0;
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_loop,&__pyx_n_s_after,&__pyx_n_s_repeat,&__pyx_n_s_ref,&__pyx_n_s_priority,0};
+    PyObject* values[5] = {0,0,0,0,0};
+    values[3] = ((PyObject *)Py_True);
+    values[4] = ((PyObject *)Py_None);
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
+        CYTHON_FALLTHROUGH;
+        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
+        CYTHON_FALLTHROUGH;
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_loop)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_after);
+          if (value) { values[1] = value; kw_args--; }
+        }
+        CYTHON_FALLTHROUGH;
+        case  2:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_repeat);
+          if (value) { values[2] = value; kw_args--; }
+        }
+        CYTHON_FALLTHROUGH;
+        case  3:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ref);
+          if (value) { values[3] = value; kw_args--; }
+        }
+        CYTHON_FALLTHROUGH;
+        case  4:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_priority);
+          if (value) { values[4] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 1056, __pyx_L3_error)
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
+        CYTHON_FALLTHROUGH;
+        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
+        CYTHON_FALLTHROUGH;
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    __pyx_v_loop = ((struct PyGeventLoopObject *)values[0]);
+    if (values[1]) {
+      __pyx_v_after = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_after == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1056, __pyx_L3_error)
+    } else {
+      __pyx_v_after = ((double)0.0);
+    }
+    if (values[2]) {
+      __pyx_v_repeat = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_repeat == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1056, __pyx_L3_error)
+    } else {
+      __pyx_v_repeat = ((double)0.0);
+    }
+    __pyx_v_ref = values[3];
+    __pyx_v_priority = values[4];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1056, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.libev.corecext.timer.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return -1;
+  __pyx_L4_argument_unpacking_done:;
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_loop), __pyx_ptype_6gevent_5libev_8corecext_loop, 1, "loop", 0))) __PYX_ERR(0, 1056, __pyx_L1_error)
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_5timer_2__init__(((struct PyGeventTimerObject *)__pyx_v_self), __pyx_v_loop, __pyx_v_after, __pyx_v_repeat, __pyx_v_ref, __pyx_v_priority);
+
+  /* function exit code */
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __pyx_r = -1;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_5libev_8corecext_5timer_2__init__(struct PyGeventTimerObject *__pyx_v_self, struct PyGeventLoopObject *__pyx_v_loop, CYTHON_UNUSED double __pyx_v_after, CYTHON_UNUSED double __pyx_v_repeat, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__", 0);
+
+
+  /* function exit code */
+  __pyx_r = 0;
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_AddTraceback("gevent.libev.corecext.timer.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = -1;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+1057:         watcher.__init__(self, loop, ref, priority)
+
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_6gevent_5libev_8corecext_watcher), __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1057, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = NULL;
+  __pyx_t_4 = 0;
+  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+    if (likely(__pyx_t_3)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+      __Pyx_INCREF(__pyx_t_3);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_2, function);
+      __pyx_t_4 = 1;
+    }
+  }
+  #if CYTHON_FAST_PYCALL
+  if (PyFunction_Check(__pyx_t_2)) {
+    PyObject *__pyx_temp[5] = {__pyx_t_3, ((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_loop), __pyx_v_ref, __pyx_v_priority};
+    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 4+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1057, __pyx_L1_error)
+    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __Pyx_GOTREF(__pyx_t_1);
+  } else
+  #endif
+  #if CYTHON_FAST_PYCCALL
+  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
+    PyObject *__pyx_temp[5] = {__pyx_t_3, ((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_loop), __pyx_v_ref, __pyx_v_priority};
+    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 4+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1057, __pyx_L1_error)
+    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __Pyx_GOTREF(__pyx_t_1);
+  } else
+  #endif
+  {
+    __pyx_t_5 = PyTuple_New(4+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1057, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_5);
+    if (__pyx_t_3) {
+      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
+    }
+    __Pyx_INCREF(((PyObject *)__pyx_v_self));
+    __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
+    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, ((PyObject *)__pyx_v_self));
+    __Pyx_INCREF(((PyObject *)__pyx_v_loop));
+    __Pyx_GIVEREF(((PyObject *)__pyx_v_loop));
+    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, ((PyObject *)__pyx_v_loop));
+    __Pyx_INCREF(__pyx_v_ref);
+    __Pyx_GIVEREF(__pyx_v_ref);
+    PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_4, __pyx_v_ref);
+    __Pyx_INCREF(__pyx_v_priority);
+    __Pyx_GIVEREF(__pyx_v_priority);
+    PyTuple_SET_ITEM(__pyx_t_5, 3+__pyx_t_4, __pyx_v_priority);
+    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1057, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+  }
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 1058: 
+
+1059:     def start(self, object callback, *args, update=None):
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_5timer_5start(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_5timer_5start(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_callback = 0;
+  PyObject *__pyx_v_update = 0;
+  PyObject *__pyx_v_args = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("start (wrapper)", 0);
+  if (PyTuple_GET_SIZE(__pyx_args) > 1) {
+    __pyx_v_args = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args));
+    if (unlikely(!__pyx_v_args)) {
+      __Pyx_RefNannyFinishContext();
+      return NULL;
+    }
+    __Pyx_GOTREF(__pyx_v_args);
+  } else {
+    __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple);
+  }
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_callback,&__pyx_n_s_update,0};
+    PyObject* values[2] = {0,0};
+    values[1] = ((PyObject *)Py_None);
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        default:
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_callback)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+      }
+      if (kw_args == 1) {
+        const Py_ssize_t index = 1;
+        PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, *__pyx_pyargnames[index]);
+        if (value) { values[index] = value; kw_args--; }
+      }
+      if (unlikely(kw_args > 0)) {
+        const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1;
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "start") < 0)) __PYX_ERR(0, 1059, __pyx_L3_error)
+      }
+    } else if (PyTuple_GET_SIZE(__pyx_args) < 1) {
+      goto __pyx_L5_argtuple_error;
+    } else {
+      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+    }
+    __pyx_v_callback = values[0];
+    __pyx_v_update = values[1];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("start", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1059, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0;
+  __Pyx_AddTraceback("gevent.libev.corecext.timer.start", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_5timer_4start(((struct PyGeventTimerObject *)__pyx_v_self), __pyx_v_callback, __pyx_v_update, __pyx_v_args);
+
+  /* function exit code */
+  __Pyx_XDECREF(__pyx_v_args);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_5timer_4start(struct PyGeventTimerObject *__pyx_v_self, PyObject *__pyx_v_callback, PyObject *__pyx_v_update, PyObject *__pyx_v_args) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("start", 0);
+  __Pyx_INCREF(__pyx_v_update);
+
+
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_AddTraceback("gevent.libev.corecext.timer.start", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_update);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+1060:         update = update if update is not None else self.loop.starting_timer_may_update_loop_time
+
+  __pyx_t_2 = (__pyx_v_update != Py_None);
+  if ((__pyx_t_2 != 0)) {
+    __Pyx_INCREF(__pyx_v_update);
+    __pyx_t_1 = __pyx_v_update;
+  } else {
+    __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_v_self->__pyx_base.loop->starting_timer_may_update_loop_time); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1060, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __pyx_t_1 = __pyx_t_3;
+    __pyx_t_3 = 0;
+  }
+  __Pyx_DECREF_SET(__pyx_v_update, __pyx_t_1);
+  __pyx_t_1 = 0;
+
+1061:         if update:
+
+  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_update); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1061, __pyx_L1_error)
+  if (__pyx_t_2) {
+
+  }
+
+1062:             self.loop.update_now()
+
+    ((struct __pyx_vtabstruct_6gevent_5libev_8corecext_loop *)__pyx_v_self->__pyx_base.loop->__pyx_vtab)->update_now(__pyx_v_self->__pyx_base.loop, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1062, __pyx_L1_error)
+
+1063:         _watcher_start(self, callback, args)
+
+  __pyx_t_2 = __pyx_f_6gevent_5libev_8corecext__watcher_start(((struct PyGeventWatcherObject *)__pyx_v_self), __pyx_v_callback, __pyx_v_args); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 1063, __pyx_L1_error)
+
 1064: 
+
 1065:     @property
+
+1066:     def at(self):
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_5timer_2at_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_5timer_2at_1__get__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_5timer_2at___get__(((struct PyGeventTimerObject *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_5timer_2at___get__(struct PyGeventTimerObject *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__", 0);
+
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.libev.corecext.timer.at.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+1067:         return self._watcher.at
+
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->_watcher.at); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1067, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
 1068: 
+
 1069:     # QQQ: add 'after' and 'repeat' properties?
+
 1070: 
+
+1071:     def again(self, object callback, *args, update=True):
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_5timer_7again(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_5timer_7again(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_callback = 0;
+  PyObject *__pyx_v_update = 0;
+  PyObject *__pyx_v_args = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("again (wrapper)", 0);
+  if (PyTuple_GET_SIZE(__pyx_args) > 1) {
+    __pyx_v_args = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args));
+    if (unlikely(!__pyx_v_args)) {
+      __Pyx_RefNannyFinishContext();
+      return NULL;
+    }
+    __Pyx_GOTREF(__pyx_v_args);
+  } else {
+    __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple);
+  }
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_callback,&__pyx_n_s_update,0};
+    PyObject* values[2] = {0,0};
+    values[1] = ((PyObject *)Py_True);
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        default:
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_callback)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+      }
+      if (kw_args == 1) {
+        const Py_ssize_t index = 1;
+        PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, *__pyx_pyargnames[index]);
+        if (value) { values[index] = value; kw_args--; }
+      }
+      if (unlikely(kw_args > 0)) {
+        const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1;
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "again") < 0)) __PYX_ERR(0, 1071, __pyx_L3_error)
+      }
+    } else if (PyTuple_GET_SIZE(__pyx_args) < 1) {
+      goto __pyx_L5_argtuple_error;
+    } else {
+      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+    }
+    __pyx_v_callback = values[0];
+    __pyx_v_update = values[1];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("again", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1071, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0;
+  __Pyx_AddTraceback("gevent.libev.corecext.timer.again", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_5timer_6again(((struct PyGeventTimerObject *)__pyx_v_self), __pyx_v_callback, __pyx_v_update, __pyx_v_args);
+
+  /* function exit code */
+  __Pyx_XDECREF(__pyx_v_args);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_5timer_6again(struct PyGeventTimerObject *__pyx_v_self, PyObject *__pyx_v_callback, PyObject *__pyx_v_update, PyObject *__pyx_v_args) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("again", 0);
+
+
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.libev.corecext.timer.again", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+1072:         _check_loop(self.loop)
+
+  __pyx_t_1 = ((PyObject *)__pyx_v_self->__pyx_base.loop);
+  __Pyx_INCREF(__pyx_t_1);
+  __pyx_t_2 = __pyx_f_6gevent_5libev_8corecext__check_loop(((struct PyGeventLoopObject *)__pyx_t_1)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 1072, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+1073:         self.callback = callback
+
+  if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_callback, __pyx_v_callback) < 0) __PYX_ERR(0, 1073, __pyx_L1_error)
+
+1074:         self.args = args
+
+  __Pyx_INCREF(__pyx_v_args);
+  __Pyx_GIVEREF(__pyx_v_args);
+  __Pyx_GOTREF(__pyx_v_self->__pyx_base.args);
+  __Pyx_DECREF(__pyx_v_self->__pyx_base.args);
+  __pyx_v_self->__pyx_base.args = __pyx_v_args;
+
+1075:         _libev_unref(self)
+
+  __pyx_f_6gevent_5libev_8corecext__libev_unref(((struct PyGeventWatcherObject *)__pyx_v_self));
+
+1076:         if update:
+
+  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_update); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1076, __pyx_L1_error)
+  if (__pyx_t_2) {
+
+  }
+
+1077:             libev.ev_now_update(self.loop._ptr)
+
+    ev_now_update(__pyx_v_self->__pyx_base.loop->_ptr);
+
+1078:         libev.ev_timer_again(self.loop._ptr, &self._watcher)
+
+  ev_timer_again(__pyx_v_self->__pyx_base.loop->_ptr, (&__pyx_v_self->_watcher));
+
+1079:         _python_incref(self)
+
+  __pyx_f_6gevent_5libev_8corecext__python_incref(((struct PyGeventWatcherObject *)__pyx_v_self));
+
 1080: 
+
 1081: 
+
 1082: 
+
+1083: cdef start_and_stop signal_ss = make_ss(<void*>libev.ev_signal_start, <void*>libev.ev_signal_stop)
+
+  __pyx_v_6gevent_5libev_8corecext_signal_ss = __pyx_f_6gevent_5libev_8corecext_make_ss(((void *)ev_signal_start), ((void *)ev_signal_stop));
+
 1084: 
+
+1085: cdef public class signal(watcher) [object PyGeventSignalObject, type PyGeventSignal_Type]:
+
+struct PyGeventSignalObject {
+  struct PyGeventWatcherObject __pyx_base;
+  struct ev_signal _watcher;
+};
+
+__PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyGeventSignal_Type;
+
 1086: 
+
 1087:     cdef libev.ev_signal _watcher
+
 1088: 
+
+1089:     def __cinit__(self, loop loop, int signalnum, ref=True, priority=None):
+
+
+/* Python wrapper */
+static int __pyx_pw_6gevent_5libev_8corecext_6signal_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static int __pyx_pw_6gevent_5libev_8corecext_6signal_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_loop = 0;
+  int __pyx_v_signalnum;
+  CYTHON_UNUSED PyObject *__pyx_v_ref = 0;
+  CYTHON_UNUSED PyObject *__pyx_v_priority = 0;
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_loop,&__pyx_n_s_signalnum,&__pyx_n_s_ref,&__pyx_n_s_priority,0};
+    PyObject* values[4] = {0,0,0,0};
+    values[2] = ((PyObject *)Py_True);
+    values[3] = ((PyObject *)Py_None);
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
+        CYTHON_FALLTHROUGH;
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_loop)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_signalnum)) != 0)) kw_args--;
+        else {
+          __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 4, 1); __PYX_ERR(0, 1089, __pyx_L3_error)
+        }
+        CYTHON_FALLTHROUGH;
+        case  2:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ref);
+          if (value) { values[2] = value; kw_args--; }
+        }
+        CYTHON_FALLTHROUGH;
+        case  3:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_priority);
+          if (value) { values[3] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 1089, __pyx_L3_error)
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
+        CYTHON_FALLTHROUGH;
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    __pyx_v_loop = ((struct PyGeventLoopObject *)values[0]);
+    __pyx_v_signalnum = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_signalnum == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1089, __pyx_L3_error)
+    __pyx_v_ref = values[2];
+    __pyx_v_priority = values[3];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1089, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.libev.corecext.signal.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return -1;
+  __pyx_L4_argument_unpacking_done:;
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_loop), __pyx_ptype_6gevent_5libev_8corecext_loop, 1, "loop", 0))) __PYX_ERR(0, 1089, __pyx_L1_error)
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_6signal___cinit__(((struct PyGeventSignalObject *)__pyx_v_self), __pyx_v_loop, __pyx_v_signalnum, __pyx_v_ref, __pyx_v_priority);
+
+  /* function exit code */
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __pyx_r = -1;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_5libev_8corecext_6signal___cinit__(struct PyGeventSignalObject *__pyx_v_self, CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_loop, int __pyx_v_signalnum, CYTHON_UNUSED PyObject *__pyx_v_ref, CYTHON_UNUSED PyObject *__pyx_v_priority) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__cinit__", 0);
+
+
+  /* function exit code */
+  __pyx_r = 0;
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_AddTraceback("gevent.libev.corecext.signal.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = -1;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+1090:         if signalnum < 1 or signalnum >= signalmodule.NSIG:
+
+  __pyx_t_2 = ((__pyx_v_signalnum < 1) != 0);
+  if (!__pyx_t_2) {
+  } else {
+    __pyx_t_1 = __pyx_t_2;
+    goto __pyx_L4_bool_binop_done;
+  }
+  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_signalnum); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1090, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_signalmodule); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1090, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_4);
+  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_NSIG); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1090, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_5);
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_t_5, Py_GE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1090, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1090, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __pyx_t_1 = __pyx_t_2;
+  __pyx_L4_bool_binop_done:;
+  if (unlikely(__pyx_t_1)) {
+
+  }
+
+1091:             raise ValueError('illegal signal number: %r' % signalnum)
+
+    __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_signalnum); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1091, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_illegal_signal_number_r, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1091, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_5);
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1091, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __PYX_ERR(0, 1091, __pyx_L1_error)
+
 1092:         # still possible to crash on one of libev's asserts:
+
 1093:         # 1) "libev: ev_signal_start called with illegal signal number"
+
 1094:         #    EV_NSIG might be different from signal.NSIG on some platforms
+
 1095:         # 2) "libev: a signal must not be attached to two different loops"
+
 1096:         #    we probably could check that in LIBEV_EMBED mode, but not in general
+
+1097:         libev.ev_signal_init(&self._watcher, <void *>gevent_callback_signal, signalnum)
+
+  ev_signal_init((&__pyx_v_self->_watcher), ((void *)gevent_callback_signal), __pyx_v_signalnum);
+
+1098:         self.__watcher = <libev.ev_watcher*>&self._watcher
+
+  __pyx_v_self->__pyx_base.__pyx___watcher = ((struct ev_watcher *)(&__pyx_v_self->_watcher));
+
+1099:         self.__ss = &signal_ss
+
+  __pyx_v_self->__pyx_base.__pyx___ss = (&__pyx_v_6gevent_5libev_8corecext_signal_ss);
+
 1100: 
+
+1101:     def __init__(self, loop loop, int signalnum, ref=True, priority=None):
+
+
+/* Python wrapper */
+static int __pyx_pw_6gevent_5libev_8corecext_6signal_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static int __pyx_pw_6gevent_5libev_8corecext_6signal_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  struct PyGeventLoopObject *__pyx_v_loop = 0;
+  CYTHON_UNUSED int __pyx_v_signalnum;
+  PyObject *__pyx_v_ref = 0;
+  PyObject *__pyx_v_priority = 0;
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_loop,&__pyx_n_s_signalnum,&__pyx_n_s_ref,&__pyx_n_s_priority,0};
+    PyObject* values[4] = {0,0,0,0};
+    values[2] = ((PyObject *)Py_True);
+    values[3] = ((PyObject *)Py_None);
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
+        CYTHON_FALLTHROUGH;
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_loop)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_signalnum)) != 0)) kw_args--;
+        else {
+          __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 4, 1); __PYX_ERR(0, 1101, __pyx_L3_error)
+        }
+        CYTHON_FALLTHROUGH;
+        case  2:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ref);
+          if (value) { values[2] = value; kw_args--; }
+        }
+        CYTHON_FALLTHROUGH;
+        case  3:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_priority);
+          if (value) { values[3] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 1101, __pyx_L3_error)
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
+        CYTHON_FALLTHROUGH;
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    __pyx_v_loop = ((struct PyGeventLoopObject *)values[0]);
+    __pyx_v_signalnum = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_signalnum == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1101, __pyx_L3_error)
+    __pyx_v_ref = values[2];
+    __pyx_v_priority = values[3];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1101, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.libev.corecext.signal.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return -1;
+  __pyx_L4_argument_unpacking_done:;
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_loop), __pyx_ptype_6gevent_5libev_8corecext_loop, 1, "loop", 0))) __PYX_ERR(0, 1101, __pyx_L1_error)
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_6signal_2__init__(((struct PyGeventSignalObject *)__pyx_v_self), __pyx_v_loop, __pyx_v_signalnum, __pyx_v_ref, __pyx_v_priority);
+
+  /* function exit code */
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __pyx_r = -1;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_5libev_8corecext_6signal_2__init__(struct PyGeventSignalObject *__pyx_v_self, struct PyGeventLoopObject *__pyx_v_loop, CYTHON_UNUSED int __pyx_v_signalnum, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__", 0);
+
+
+  /* function exit code */
+  __pyx_r = 0;
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_AddTraceback("gevent.libev.corecext.signal.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = -1;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+1102:         watcher.__init__(self, loop, ref, priority)
+
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_6gevent_5libev_8corecext_watcher), __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1102, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = NULL;
+  __pyx_t_4 = 0;
+  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+    if (likely(__pyx_t_3)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+      __Pyx_INCREF(__pyx_t_3);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_2, function);
+      __pyx_t_4 = 1;
+    }
+  }
+  #if CYTHON_FAST_PYCALL
+  if (PyFunction_Check(__pyx_t_2)) {
+    PyObject *__pyx_temp[5] = {__pyx_t_3, ((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_loop), __pyx_v_ref, __pyx_v_priority};
+    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 4+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1102, __pyx_L1_error)
+    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __Pyx_GOTREF(__pyx_t_1);
+  } else
+  #endif
+  #if CYTHON_FAST_PYCCALL
+  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
+    PyObject *__pyx_temp[5] = {__pyx_t_3, ((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_loop), __pyx_v_ref, __pyx_v_priority};
+    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 4+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1102, __pyx_L1_error)
+    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __Pyx_GOTREF(__pyx_t_1);
+  } else
+  #endif
+  {
+    __pyx_t_5 = PyTuple_New(4+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1102, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_5);
+    if (__pyx_t_3) {
+      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
+    }
+    __Pyx_INCREF(((PyObject *)__pyx_v_self));
+    __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
+    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, ((PyObject *)__pyx_v_self));
+    __Pyx_INCREF(((PyObject *)__pyx_v_loop));
+    __Pyx_GIVEREF(((PyObject *)__pyx_v_loop));
+    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, ((PyObject *)__pyx_v_loop));
+    __Pyx_INCREF(__pyx_v_ref);
+    __Pyx_GIVEREF(__pyx_v_ref);
+    PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_4, __pyx_v_ref);
+    __Pyx_INCREF(__pyx_v_priority);
+    __Pyx_GIVEREF(__pyx_v_priority);
+    PyTuple_SET_ITEM(__pyx_t_5, 3+__pyx_t_4, __pyx_v_priority);
+    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1102, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+  }
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 1103: 
+
 1104: 
+
 1105: 
+
+1106: cdef start_and_stop idle_ss = make_ss(<void*>libev.ev_idle_start, <void*>libev.ev_idle_stop)
+
+  __pyx_v_6gevent_5libev_8corecext_idle_ss = __pyx_f_6gevent_5libev_8corecext_make_ss(((void *)ev_idle_start), ((void *)ev_idle_stop));
+
 1107: 
+
+1108: cdef public class idle(watcher) [object PyGeventIdleObject, type PyGeventIdle_Type]:
+
+struct PyGeventIdleObject {
+  struct PyGeventWatcherObject __pyx_base;
+  struct ev_idle _watcher;
+};
+
+__PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyGeventIdle_Type;
+
 1109: 
+
 1110:     cdef libev.ev_idle _watcher
+
 1111: 
+
+1112:     def __cinit__(self, loop loop, ref=True, priority=None):
+
+
+/* Python wrapper */
+static int __pyx_pw_6gevent_5libev_8corecext_4idle_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static int __pyx_pw_6gevent_5libev_8corecext_4idle_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_loop = 0;
+  CYTHON_UNUSED PyObject *__pyx_v_ref = 0;
+  CYTHON_UNUSED PyObject *__pyx_v_priority = 0;
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_loop,&__pyx_n_s_ref,&__pyx_n_s_priority,0};
+    PyObject* values[3] = {0,0,0};
+    values[1] = ((PyObject *)Py_True);
+    values[2] = ((PyObject *)Py_None);
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_loop)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ref);
+          if (value) { values[1] = value; kw_args--; }
+        }
+        CYTHON_FALLTHROUGH;
+        case  2:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_priority);
+          if (value) { values[2] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 1112, __pyx_L3_error)
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    __pyx_v_loop = ((struct PyGeventLoopObject *)values[0]);
+    __pyx_v_ref = values[1];
+    __pyx_v_priority = values[2];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1112, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.libev.corecext.idle.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return -1;
+  __pyx_L4_argument_unpacking_done:;
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_loop), __pyx_ptype_6gevent_5libev_8corecext_loop, 1, "loop", 0))) __PYX_ERR(0, 1112, __pyx_L1_error)
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4idle___cinit__(((struct PyGeventIdleObject *)__pyx_v_self), __pyx_v_loop, __pyx_v_ref, __pyx_v_priority);
+
+  /* function exit code */
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __pyx_r = -1;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_5libev_8corecext_4idle___cinit__(struct PyGeventIdleObject *__pyx_v_self, CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_loop, CYTHON_UNUSED PyObject *__pyx_v_ref, CYTHON_UNUSED PyObject *__pyx_v_priority) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__cinit__", 0);
+
+
+  /* function exit code */
+  __pyx_r = 0;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+1113:         libev.ev_idle_init(&self._watcher, <void*>gevent_callback_idle)
+
+  ev_idle_init((&__pyx_v_self->_watcher), ((void *)gevent_callback_idle));
+
+1114:         self.__watcher = <libev.ev_watcher*>&self._watcher
+
+  __pyx_v_self->__pyx_base.__pyx___watcher = ((struct ev_watcher *)(&__pyx_v_self->_watcher));
+
+1115:         self.__ss = &idle_ss
+
+  __pyx_v_self->__pyx_base.__pyx___ss = (&__pyx_v_6gevent_5libev_8corecext_idle_ss);
+
 1116: 
+
 1117: 
+
 1118: 
+
+1119: cdef start_and_stop prepare_ss = make_ss(<void*>libev.ev_prepare_start, <void*>libev.ev_prepare_stop)
+
+  __pyx_v_6gevent_5libev_8corecext_prepare_ss = __pyx_f_6gevent_5libev_8corecext_make_ss(((void *)ev_prepare_start), ((void *)ev_prepare_stop));
+
 1120: 
+
+1121: cdef public class prepare(watcher) [object PyGeventPrepareObject, type PyGeventPrepare_Type]:
+
+struct PyGeventPrepareObject {
+  struct PyGeventWatcherObject __pyx_base;
+  struct ev_prepare _watcher;
+};
+
+__PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyGeventPrepare_Type;
+
 1122: 
+
 1123:     cdef libev.ev_prepare _watcher
+
 1124: 
+
+1125:     def __cinit__(self, loop loop, ref=True, priority=None):
+
+
+/* Python wrapper */
+static int __pyx_pw_6gevent_5libev_8corecext_7prepare_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static int __pyx_pw_6gevent_5libev_8corecext_7prepare_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_loop = 0;
+  CYTHON_UNUSED PyObject *__pyx_v_ref = 0;
+  CYTHON_UNUSED PyObject *__pyx_v_priority = 0;
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_loop,&__pyx_n_s_ref,&__pyx_n_s_priority,0};
+    PyObject* values[3] = {0,0,0};
+    values[1] = ((PyObject *)Py_True);
+    values[2] = ((PyObject *)Py_None);
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_loop)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ref);
+          if (value) { values[1] = value; kw_args--; }
+        }
+        CYTHON_FALLTHROUGH;
+        case  2:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_priority);
+          if (value) { values[2] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 1125, __pyx_L3_error)
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    __pyx_v_loop = ((struct PyGeventLoopObject *)values[0]);
+    __pyx_v_ref = values[1];
+    __pyx_v_priority = values[2];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1125, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.libev.corecext.prepare.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return -1;
+  __pyx_L4_argument_unpacking_done:;
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_loop), __pyx_ptype_6gevent_5libev_8corecext_loop, 1, "loop", 0))) __PYX_ERR(0, 1125, __pyx_L1_error)
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_7prepare___cinit__(((struct PyGeventPrepareObject *)__pyx_v_self), __pyx_v_loop, __pyx_v_ref, __pyx_v_priority);
+
+  /* function exit code */
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __pyx_r = -1;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_5libev_8corecext_7prepare___cinit__(struct PyGeventPrepareObject *__pyx_v_self, CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_loop, CYTHON_UNUSED PyObject *__pyx_v_ref, CYTHON_UNUSED PyObject *__pyx_v_priority) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__cinit__", 0);
+
+
+  /* function exit code */
+  __pyx_r = 0;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+1126:         libev.ev_prepare_init(&self._watcher, <void*>gevent_callback_prepare)
+
+  ev_prepare_init((&__pyx_v_self->_watcher), ((void *)gevent_callback_prepare));
+
+1127:         self.__watcher = <libev.ev_watcher*>&self._watcher
+
+  __pyx_v_self->__pyx_base.__pyx___watcher = ((struct ev_watcher *)(&__pyx_v_self->_watcher));
+
+1128:         self.__ss = &prepare_ss
+
+  __pyx_v_self->__pyx_base.__pyx___ss = (&__pyx_v_6gevent_5libev_8corecext_prepare_ss);
+
 1129: 
+
 1130: 
+
 1131: 
+
+1132: cdef start_and_stop check_ss = make_ss(<void*>libev.ev_check_start, <void*>libev.ev_check_stop)
+
+  __pyx_v_6gevent_5libev_8corecext_check_ss = __pyx_f_6gevent_5libev_8corecext_make_ss(((void *)ev_check_start), ((void *)ev_check_stop));
+
 1133: 
+
+1134: cdef public class check(watcher) [object PyGeventCheckObject, type PyGeventCheck_Type]:
+
+struct PyGeventCheckObject {
+  struct PyGeventWatcherObject __pyx_base;
+  struct ev_check _watcher;
+};
+
+__PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyGeventCheck_Type;
+
 1135: 
+
 1136:     cdef libev.ev_check _watcher
+
 1137: 
+
+1138:     def __cinit__(self, loop loop, ref=True, priority=None):
+
+
+/* Python wrapper */
+static int __pyx_pw_6gevent_5libev_8corecext_5check_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static int __pyx_pw_6gevent_5libev_8corecext_5check_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_loop = 0;
+  CYTHON_UNUSED PyObject *__pyx_v_ref = 0;
+  CYTHON_UNUSED PyObject *__pyx_v_priority = 0;
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_loop,&__pyx_n_s_ref,&__pyx_n_s_priority,0};
+    PyObject* values[3] = {0,0,0};
+    values[1] = ((PyObject *)Py_True);
+    values[2] = ((PyObject *)Py_None);
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_loop)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ref);
+          if (value) { values[1] = value; kw_args--; }
+        }
+        CYTHON_FALLTHROUGH;
+        case  2:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_priority);
+          if (value) { values[2] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 1138, __pyx_L3_error)
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    __pyx_v_loop = ((struct PyGeventLoopObject *)values[0]);
+    __pyx_v_ref = values[1];
+    __pyx_v_priority = values[2];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1138, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.libev.corecext.check.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return -1;
+  __pyx_L4_argument_unpacking_done:;
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_loop), __pyx_ptype_6gevent_5libev_8corecext_loop, 1, "loop", 0))) __PYX_ERR(0, 1138, __pyx_L1_error)
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_5check___cinit__(((struct PyGeventCheckObject *)__pyx_v_self), __pyx_v_loop, __pyx_v_ref, __pyx_v_priority);
+
+  /* function exit code */
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __pyx_r = -1;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_5libev_8corecext_5check___cinit__(struct PyGeventCheckObject *__pyx_v_self, CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_loop, CYTHON_UNUSED PyObject *__pyx_v_ref, CYTHON_UNUSED PyObject *__pyx_v_priority) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__cinit__", 0);
+
+
+  /* function exit code */
+  __pyx_r = 0;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+1139:         libev.ev_check_init(&self._watcher, <void*>gevent_callback_check)
+
+  ev_check_init((&__pyx_v_self->_watcher), ((void *)gevent_callback_check));
+
+1140:         self.__watcher = <libev.ev_watcher*>&self._watcher
+
+  __pyx_v_self->__pyx_base.__pyx___watcher = ((struct ev_watcher *)(&__pyx_v_self->_watcher));
+
+1141:         self.__ss = &check_ss
+
+  __pyx_v_self->__pyx_base.__pyx___ss = (&__pyx_v_6gevent_5libev_8corecext_check_ss);
+
 1142: 
+
 1143: 
+
 1144: 
+
+1145: cdef start_and_stop fork_ss = make_ss(<void*>libev.ev_fork_start, <void*>libev.ev_fork_stop)
+
+  __pyx_v_6gevent_5libev_8corecext_fork_ss = __pyx_f_6gevent_5libev_8corecext_make_ss(((void *)ev_fork_start), ((void *)ev_fork_stop));
+
 1146: 
+
+1147: cdef public class fork(watcher) [object PyGeventForkObject, type PyGeventFork_Type]:
+
+struct PyGeventForkObject {
+  struct PyGeventWatcherObject __pyx_base;
+  struct ev_fork _watcher;
+};
+
+__PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyGeventFork_Type;
+
 1148: 
+
 1149:     cdef libev.ev_fork _watcher
+
 1150: 
+
+1151:     def __cinit__(self, loop loop, ref=True, priority=None):
+
+
+/* Python wrapper */
+static int __pyx_pw_6gevent_5libev_8corecext_4fork_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static int __pyx_pw_6gevent_5libev_8corecext_4fork_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_loop = 0;
+  CYTHON_UNUSED PyObject *__pyx_v_ref = 0;
+  CYTHON_UNUSED PyObject *__pyx_v_priority = 0;
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_loop,&__pyx_n_s_ref,&__pyx_n_s_priority,0};
+    PyObject* values[3] = {0,0,0};
+    values[1] = ((PyObject *)Py_True);
+    values[2] = ((PyObject *)Py_None);
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_loop)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ref);
+          if (value) { values[1] = value; kw_args--; }
+        }
+        CYTHON_FALLTHROUGH;
+        case  2:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_priority);
+          if (value) { values[2] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 1151, __pyx_L3_error)
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    __pyx_v_loop = ((struct PyGeventLoopObject *)values[0]);
+    __pyx_v_ref = values[1];
+    __pyx_v_priority = values[2];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1151, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.libev.corecext.fork.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return -1;
+  __pyx_L4_argument_unpacking_done:;
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_loop), __pyx_ptype_6gevent_5libev_8corecext_loop, 1, "loop", 0))) __PYX_ERR(0, 1151, __pyx_L1_error)
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4fork___cinit__(((struct PyGeventForkObject *)__pyx_v_self), __pyx_v_loop, __pyx_v_ref, __pyx_v_priority);
+
+  /* function exit code */
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __pyx_r = -1;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_5libev_8corecext_4fork___cinit__(struct PyGeventForkObject *__pyx_v_self, CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_loop, CYTHON_UNUSED PyObject *__pyx_v_ref, CYTHON_UNUSED PyObject *__pyx_v_priority) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__cinit__", 0);
+
+
+  /* function exit code */
+  __pyx_r = 0;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+1152:         libev.ev_fork_init(&self._watcher, <void*>gevent_callback_fork)
+
+  ev_fork_init((&__pyx_v_self->_watcher), ((void *)gevent_callback_fork));
+
+1153:         self.__watcher = <libev.ev_watcher*>&self._watcher
+
+  __pyx_v_self->__pyx_base.__pyx___watcher = ((struct ev_watcher *)(&__pyx_v_self->_watcher));
+
+1154:         self.__ss = &fork_ss
+
+  __pyx_v_self->__pyx_base.__pyx___ss = (&__pyx_v_6gevent_5libev_8corecext_fork_ss);
+
 1155: 
+
 1156: 
+
+1157: cdef start_and_stop async_ss = make_ss(<void*>libev.ev_async_start, <void*>libev.ev_async_stop)
+
+  __pyx_v_6gevent_5libev_8corecext_async_ss = __pyx_f_6gevent_5libev_8corecext_make_ss(((void *)ev_async_start), ((void *)ev_async_stop));
+
 1158: 
+
+1159: cdef public class async_(watcher) [object PyGeventAsyncObject, type PyGeventAsync_Type]:
+
+struct PyGeventAsyncObject {
+  struct PyGeventWatcherObject __pyx_base;
+  struct ev_async _watcher;
+};
+
+__PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyGeventAsync_Type;
+
 1160: 
+
 1161:     cdef libev.ev_async _watcher
+
 1162: 
+
 1163:     @property
+
+1164:     def pending(self):
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_6async__7pending_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_6async__7pending_1__get__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_6async__7pending___get__(((struct PyGeventAsyncObject *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_6async__7pending___get__(struct PyGeventAsyncObject *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__", 0);
+
+
+  /* function exit code */
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
 1165:         # Note the use of ev_async_pending instead of ev_is_pending
+
+1166:         return True if libev.ev_async_pending(&self._watcher) else False
+
+  __Pyx_XDECREF(__pyx_r);
+  if ((ev_async_pending((&__pyx_v_self->_watcher)) != 0)) {
+    __Pyx_INCREF(Py_True);
+    __pyx_t_1 = Py_True;
+  } else {
+    __Pyx_INCREF(Py_False);
+    __pyx_t_1 = Py_False;
+  }
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
 1167: 
+
+1168:     def __cinit__(self, loop loop, ref=True, priority=None):
+
+
+/* Python wrapper */
+static int __pyx_pw_6gevent_5libev_8corecext_6async__1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static int __pyx_pw_6gevent_5libev_8corecext_6async__1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_loop = 0;
+  CYTHON_UNUSED PyObject *__pyx_v_ref = 0;
+  CYTHON_UNUSED PyObject *__pyx_v_priority = 0;
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_loop,&__pyx_n_s_ref,&__pyx_n_s_priority,0};
+    PyObject* values[3] = {0,0,0};
+    values[1] = ((PyObject *)Py_True);
+    values[2] = ((PyObject *)Py_None);
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_loop)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ref);
+          if (value) { values[1] = value; kw_args--; }
+        }
+        CYTHON_FALLTHROUGH;
+        case  2:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_priority);
+          if (value) { values[2] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 1168, __pyx_L3_error)
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    __pyx_v_loop = ((struct PyGeventLoopObject *)values[0]);
+    __pyx_v_ref = values[1];
+    __pyx_v_priority = values[2];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1168, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.libev.corecext.async_.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return -1;
+  __pyx_L4_argument_unpacking_done:;
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_loop), __pyx_ptype_6gevent_5libev_8corecext_loop, 1, "loop", 0))) __PYX_ERR(0, 1168, __pyx_L1_error)
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_6async____cinit__(((struct PyGeventAsyncObject *)__pyx_v_self), __pyx_v_loop, __pyx_v_ref, __pyx_v_priority);
+
+  /* function exit code */
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __pyx_r = -1;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_5libev_8corecext_6async____cinit__(struct PyGeventAsyncObject *__pyx_v_self, CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_loop, CYTHON_UNUSED PyObject *__pyx_v_ref, CYTHON_UNUSED PyObject *__pyx_v_priority) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__cinit__", 0);
+
+
+  /* function exit code */
+  __pyx_r = 0;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+1169:         libev.ev_async_init(&self._watcher, <void*>gevent_callback_async)
+
+  ev_async_init((&__pyx_v_self->_watcher), ((void *)gevent_callback_async));
+
+1170:         self.__watcher = <libev.ev_watcher*>&self._watcher
+
+  __pyx_v_self->__pyx_base.__pyx___watcher = ((struct ev_watcher *)(&__pyx_v_self->_watcher));
+
+1171:         self.__ss = &async_ss
+
+  __pyx_v_self->__pyx_base.__pyx___ss = (&__pyx_v_6gevent_5libev_8corecext_async_ss);
+
 1172: 
+
 1173: 
+
+1174:     def send(self):
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_6async__3send(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_6async__3send(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("send (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_6async__2send(((struct PyGeventAsyncObject *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_6async__2send(struct PyGeventAsyncObject *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("send", 0);
+
+
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.libev.corecext.async_.send", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+1175:         _check_loop(self.loop)
+
+  __pyx_t_1 = ((PyObject *)__pyx_v_self->__pyx_base.loop);
+  __Pyx_INCREF(__pyx_t_1);
+  __pyx_t_2 = __pyx_f_6gevent_5libev_8corecext__check_loop(((struct PyGeventLoopObject *)__pyx_t_1)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 1175, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+1176:         libev.ev_async_send(self.loop._ptr, &self._watcher)
+
+  ev_async_send(__pyx_v_self->__pyx_base.loop->_ptr, (&__pyx_v_self->_watcher));
+
 1177: 
+
+1178: async = async_
+
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_async_2, ((PyObject *)__pyx_ptype_6gevent_5libev_8corecext_async_)) < 0) __PYX_ERR(0, 1178, __pyx_L1_error)
+
 1179: 
+
+1180: cdef start_and_stop child_ss = make_ss(<void*>libev.ev_child_start, <void*>libev.ev_child_stop)
+
+  __pyx_v_6gevent_5libev_8corecext_child_ss = __pyx_f_6gevent_5libev_8corecext_make_ss(((void *)ev_child_start), ((void *)ev_child_stop));
+
 1181: 
+
+1182: cdef public class child(watcher) [object PyGeventChildObject, type PyGeventChild_Type]:
+
+struct PyGeventChildObject {
+  struct PyGeventWatcherObject __pyx_base;
+  struct ev_child _watcher;
+};
+
+__PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyGeventChild_Type;
+
 1183: 
+
 1184:     cdef libev.ev_child _watcher
+
 1185: 
+
+1186:     def __cinit__(self, loop loop, int pid, bint trace=0, ref=True):
+
+
+/* Python wrapper */
+static int __pyx_pw_6gevent_5libev_8corecext_5child_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static int __pyx_pw_6gevent_5libev_8corecext_5child_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  struct PyGeventLoopObject *__pyx_v_loop = 0;
+  int __pyx_v_pid;
+  int __pyx_v_trace;
+  CYTHON_UNUSED PyObject *__pyx_v_ref = 0;
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_loop,&__pyx_n_s_pid,&__pyx_n_s_trace,&__pyx_n_s_ref,0};
+    PyObject* values[4] = {0,0,0,0};
+    values[3] = ((PyObject *)Py_True);
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
+        CYTHON_FALLTHROUGH;
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_loop)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pid)) != 0)) kw_args--;
+        else {
+          __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 4, 1); __PYX_ERR(0, 1186, __pyx_L3_error)
+        }
+        CYTHON_FALLTHROUGH;
+        case  2:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_trace);
+          if (value) { values[2] = value; kw_args--; }
+        }
+        CYTHON_FALLTHROUGH;
+        case  3:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ref);
+          if (value) { values[3] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 1186, __pyx_L3_error)
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
+        CYTHON_FALLTHROUGH;
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    __pyx_v_loop = ((struct PyGeventLoopObject *)values[0]);
+    __pyx_v_pid = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_pid == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1186, __pyx_L3_error)
+    if (values[2]) {
+      __pyx_v_trace = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_trace == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1186, __pyx_L3_error)
+    } else {
+      __pyx_v_trace = ((int)0);
+    }
+    __pyx_v_ref = values[3];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1186, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.libev.corecext.child.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return -1;
+  __pyx_L4_argument_unpacking_done:;
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_loop), __pyx_ptype_6gevent_5libev_8corecext_loop, 1, "loop", 0))) __PYX_ERR(0, 1186, __pyx_L1_error)
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_5child___cinit__(((struct PyGeventChildObject *)__pyx_v_self), __pyx_v_loop, __pyx_v_pid, __pyx_v_trace, __pyx_v_ref);
+
+  /* function exit code */
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __pyx_r = -1;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_5libev_8corecext_5child___cinit__(struct PyGeventChildObject *__pyx_v_self, struct PyGeventLoopObject *__pyx_v_loop, int __pyx_v_pid, int __pyx_v_trace, CYTHON_UNUSED PyObject *__pyx_v_ref) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__cinit__", 0);
+
+
+  /* function exit code */
+  __pyx_r = 0;
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_AddTraceback("gevent.libev.corecext.child.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = -1;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+1187:         if sys.platform == 'win32':
+
+  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_sys); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1187, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_platform); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1187, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_t_2, __pyx_n_s_win32, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1187, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  if (unlikely(__pyx_t_3)) {
+
+  }
+
+1188:             raise AttributeError("Child watchers are not supported on Windows")
+
+    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_AttributeError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1188, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __PYX_ERR(0, 1188, __pyx_L1_error)
+
+1189:         if not loop.default:
+
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_loop), __pyx_n_s_default); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1189, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1189, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_4 = ((!__pyx_t_3) != 0);
+  if (unlikely(__pyx_t_4)) {
+
+  }
+
+1190:             raise TypeError('child watchers are only available on the default loop')
+
+    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1190, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __PYX_ERR(0, 1190, __pyx_L1_error)
+
+  __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s_child_watchers_are_only_availabl); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(0, 1190, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__16);
+  __Pyx_GIVEREF(__pyx_tuple__16);
+
+1191:         libev.gevent_install_sigchld_handler()
+
+  gevent_install_sigchld_handler();
+
+1192:         libev.ev_child_init(&self._watcher, <void *>gevent_callback_child, pid, trace)
+
+  ev_child_init((&__pyx_v_self->_watcher), ((void *)gevent_callback_child), __pyx_v_pid, __pyx_v_trace);
+
+1193:         self.__watcher = <libev.ev_watcher*>&self._watcher
+
+  __pyx_v_self->__pyx_base.__pyx___watcher = ((struct ev_watcher *)(&__pyx_v_self->_watcher));
+
+1194:         self.__ss = &child_ss
+
+  __pyx_v_self->__pyx_base.__pyx___ss = (&__pyx_v_6gevent_5libev_8corecext_child_ss);
+
 1195: 
+
+1196:     def __init__(self, loop loop, int pid, bint trace=0, ref=True):
+
+
+/* Python wrapper */
+static int __pyx_pw_6gevent_5libev_8corecext_5child_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static int __pyx_pw_6gevent_5libev_8corecext_5child_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  struct PyGeventLoopObject *__pyx_v_loop = 0;
+  CYTHON_UNUSED int __pyx_v_pid;
+  CYTHON_UNUSED int __pyx_v_trace;
+  PyObject *__pyx_v_ref = 0;
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_loop,&__pyx_n_s_pid,&__pyx_n_s_trace,&__pyx_n_s_ref,0};
+    PyObject* values[4] = {0,0,0,0};
+    values[3] = ((PyObject *)Py_True);
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
+        CYTHON_FALLTHROUGH;
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_loop)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pid)) != 0)) kw_args--;
+        else {
+          __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 4, 1); __PYX_ERR(0, 1196, __pyx_L3_error)
+        }
+        CYTHON_FALLTHROUGH;
+        case  2:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_trace);
+          if (value) { values[2] = value; kw_args--; }
+        }
+        CYTHON_FALLTHROUGH;
+        case  3:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ref);
+          if (value) { values[3] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 1196, __pyx_L3_error)
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
+        CYTHON_FALLTHROUGH;
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    __pyx_v_loop = ((struct PyGeventLoopObject *)values[0]);
+    __pyx_v_pid = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_pid == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1196, __pyx_L3_error)
+    if (values[2]) {
+      __pyx_v_trace = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_trace == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1196, __pyx_L3_error)
+    } else {
+      __pyx_v_trace = ((int)0);
+    }
+    __pyx_v_ref = values[3];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1196, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.libev.corecext.child.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return -1;
+  __pyx_L4_argument_unpacking_done:;
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_loop), __pyx_ptype_6gevent_5libev_8corecext_loop, 1, "loop", 0))) __PYX_ERR(0, 1196, __pyx_L1_error)
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_5child_2__init__(((struct PyGeventChildObject *)__pyx_v_self), __pyx_v_loop, __pyx_v_pid, __pyx_v_trace, __pyx_v_ref);
+
+  /* function exit code */
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __pyx_r = -1;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_5libev_8corecext_5child_2__init__(struct PyGeventChildObject *__pyx_v_self, struct PyGeventLoopObject *__pyx_v_loop, CYTHON_UNUSED int __pyx_v_pid, CYTHON_UNUSED int __pyx_v_trace, PyObject *__pyx_v_ref) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__", 0);
+
+
+  /* function exit code */
+  __pyx_r = 0;
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_AddTraceback("gevent.libev.corecext.child.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = -1;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+1197:         watcher.__init__(self, loop, ref, None)
+
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_6gevent_5libev_8corecext_watcher), __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1197, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = NULL;
+  __pyx_t_4 = 0;
+  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+    if (likely(__pyx_t_3)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+      __Pyx_INCREF(__pyx_t_3);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_2, function);
+      __pyx_t_4 = 1;
+    }
+  }
+  #if CYTHON_FAST_PYCALL
+  if (PyFunction_Check(__pyx_t_2)) {
+    PyObject *__pyx_temp[5] = {__pyx_t_3, ((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_loop), __pyx_v_ref, Py_None};
+    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 4+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1197, __pyx_L1_error)
+    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __Pyx_GOTREF(__pyx_t_1);
+  } else
+  #endif
+  #if CYTHON_FAST_PYCCALL
+  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
+    PyObject *__pyx_temp[5] = {__pyx_t_3, ((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_loop), __pyx_v_ref, Py_None};
+    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 4+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1197, __pyx_L1_error)
+    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __Pyx_GOTREF(__pyx_t_1);
+  } else
+  #endif
+  {
+    __pyx_t_5 = PyTuple_New(4+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1197, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_5);
+    if (__pyx_t_3) {
+      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
+    }
+    __Pyx_INCREF(((PyObject *)__pyx_v_self));
+    __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
+    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, ((PyObject *)__pyx_v_self));
+    __Pyx_INCREF(((PyObject *)__pyx_v_loop));
+    __Pyx_GIVEREF(((PyObject *)__pyx_v_loop));
+    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, ((PyObject *)__pyx_v_loop));
+    __Pyx_INCREF(__pyx_v_ref);
+    __Pyx_GIVEREF(__pyx_v_ref);
+    PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_4, __pyx_v_ref);
+    __Pyx_INCREF(Py_None);
+    __Pyx_GIVEREF(Py_None);
+    PyTuple_SET_ITEM(__pyx_t_5, 3+__pyx_t_4, Py_None);
+    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1197, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+  }
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 1198: 
+
 1199: 
+
+1200:     def _format(self):
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_5child_5_format(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_5child_5_format(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_format (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_5child_4_format(((struct PyGeventChildObject *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_5child_4_format(struct PyGeventChildObject *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_format", 0);
+
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_AddTraceback("gevent.libev.corecext.child._format", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+1201:         return ' pid=%r rstatus=%r' % (self.pid, self.rstatus)
+
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_pid); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1201, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_rstatus); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1201, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1201, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_GIVEREF(__pyx_t_1);
+  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_2);
+  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
+  __pyx_t_1 = 0;
+  __pyx_t_2 = 0;
+  __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_pid_r_rstatus_r, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1201, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __pyx_r = __pyx_t_2;
+  __pyx_t_2 = 0;
+  goto __pyx_L0;
+
 1202: 
+
 1203:     @property
+
+1204:     def pid(self):
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_5child_3pid_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_5child_3pid_1__get__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_5child_3pid___get__(((struct PyGeventChildObject *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_5child_3pid___get__(struct PyGeventChildObject *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__", 0);
+
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.libev.corecext.child.pid.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+1205:         return self._watcher.pid
+
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->_watcher.pid); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1205, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
 1206: 
+
 1207:     @property
+
+1208:     def rpid(self):
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_5child_4rpid_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_5child_4rpid_1__get__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_5child_4rpid___get__(((struct PyGeventChildObject *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_5child_4rpid___get__(struct PyGeventChildObject *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__", 0);
+
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.libev.corecext.child.rpid.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+1209:         return self._watcher.rpid
+
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->_watcher.rpid); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1209, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
 1210: 
+
 1211:     @rpid.setter
+
+1212:     def rpid(self, int value):
+
+
+/* Python wrapper */
+static int __pyx_pw_6gevent_5libev_8corecext_5child_4rpid_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_value); /*proto*/
+static int __pyx_pw_6gevent_5libev_8corecext_5child_4rpid_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_value) {
+  int __pyx_v_value;
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
+  assert(__pyx_arg_value); {
+    __pyx_v_value = __Pyx_PyInt_As_int(__pyx_arg_value); if (unlikely((__pyx_v_value == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1212, __pyx_L3_error)
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.libev.corecext.child.rpid.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return -1;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_5child_4rpid_2__set__(((struct PyGeventChildObject *)__pyx_v_self), ((int)__pyx_v_value));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_5libev_8corecext_5child_4rpid_2__set__(struct PyGeventChildObject *__pyx_v_self, int __pyx_v_value) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__set__", 0);
+
+
+  /* function exit code */
+  __pyx_r = 0;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+1213:         self._watcher.rpid = value
+
+  __pyx_v_self->_watcher.rpid = __pyx_v_value;
+
 1214: 
+
 1215:     @property
+
+1216:     def rstatus(self):
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_5child_7rstatus_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_5child_7rstatus_1__get__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_5child_7rstatus___get__(((struct PyGeventChildObject *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_5child_7rstatus___get__(struct PyGeventChildObject *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__", 0);
+
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.libev.corecext.child.rstatus.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+1217:         return self._watcher.rstatus
+
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->_watcher.rstatus); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1217, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
 1218: 
+
 1219:     @rstatus.setter
+
+1220:     def rstatus(self, int value):
+
+
+/* Python wrapper */
+static int __pyx_pw_6gevent_5libev_8corecext_5child_7rstatus_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_value); /*proto*/
+static int __pyx_pw_6gevent_5libev_8corecext_5child_7rstatus_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_value) {
+  int __pyx_v_value;
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
+  assert(__pyx_arg_value); {
+    __pyx_v_value = __Pyx_PyInt_As_int(__pyx_arg_value); if (unlikely((__pyx_v_value == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1220, __pyx_L3_error)
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.libev.corecext.child.rstatus.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return -1;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_5child_7rstatus_2__set__(((struct PyGeventChildObject *)__pyx_v_self), ((int)__pyx_v_value));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_5libev_8corecext_5child_7rstatus_2__set__(struct PyGeventChildObject *__pyx_v_self, int __pyx_v_value) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__set__", 0);
+
+
+  /* function exit code */
+  __pyx_r = 0;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+1221:         self._watcher.rstatus = value
+
+  __pyx_v_self->_watcher.rstatus = __pyx_v_value;
+
 1222: 
+
+1223: cdef start_and_stop stat_ss = make_ss(<void*>libev.ev_stat_start, <void*>libev.ev_stat_stop)
+
+  __pyx_v_6gevent_5libev_8corecext_stat_ss = __pyx_f_6gevent_5libev_8corecext_make_ss(((void *)ev_stat_start), ((void *)ev_stat_stop));
+
 1224: 
+
+1225: cdef public class stat(watcher) [object PyGeventStatObject, type PyGeventStat_Type]:
+
+struct PyGeventStatObject {
+  struct PyGeventWatcherObject __pyx_base;
+  struct ev_stat _watcher;
+  PyObject *path;
+  PyObject *_paths;
+};
+
+__PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyGeventStat_Type;
+
 1226: 
+
 1227:     cdef libev.ev_stat _watcher
+
+1228:     cdef readonly str path
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4stat_4path_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4stat_4path_1__get__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4stat_4path___get__(((struct PyGeventStatObject *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_4stat_4path___get__(struct PyGeventStatObject *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __Pyx_INCREF(__pyx_v_self->path);
+  __pyx_r = __pyx_v_self->path;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+1229:     cdef readonly bytes _paths
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4stat_6_paths_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4stat_6_paths_1__get__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4stat_6_paths___get__(((struct PyGeventStatObject *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_4stat_6_paths___get__(struct PyGeventStatObject *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __Pyx_INCREF(__pyx_v_self->_paths);
+  __pyx_r = __pyx_v_self->_paths;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
 1230: 
+
+1231:     def __cinit__(self, loop loop, str path, float interval=0.0, ref=True, priority=None):
+
+
+/* Python wrapper */
+static int __pyx_pw_6gevent_5libev_8corecext_4stat_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static int __pyx_pw_6gevent_5libev_8corecext_4stat_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_loop = 0;
+  PyObject *__pyx_v_path = 0;
+  float __pyx_v_interval;
+  CYTHON_UNUSED PyObject *__pyx_v_ref = 0;
+  CYTHON_UNUSED PyObject *__pyx_v_priority = 0;
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_loop,&__pyx_n_s_path,&__pyx_n_s_interval,&__pyx_n_s_ref,&__pyx_n_s_priority,0};
+    PyObject* values[5] = {0,0,0,0,0};
+    values[3] = ((PyObject *)Py_True);
+    values[4] = ((PyObject *)Py_None);
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
+        CYTHON_FALLTHROUGH;
+        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
+        CYTHON_FALLTHROUGH;
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_loop)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_path)) != 0)) kw_args--;
+        else {
+          __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 5, 1); __PYX_ERR(0, 1231, __pyx_L3_error)
+        }
+        CYTHON_FALLTHROUGH;
+        case  2:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_interval);
+          if (value) { values[2] = value; kw_args--; }
+        }
+        CYTHON_FALLTHROUGH;
+        case  3:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ref);
+          if (value) { values[3] = value; kw_args--; }
+        }
+        CYTHON_FALLTHROUGH;
+        case  4:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_priority);
+          if (value) { values[4] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 1231, __pyx_L3_error)
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
+        CYTHON_FALLTHROUGH;
+        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
+        CYTHON_FALLTHROUGH;
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    __pyx_v_loop = ((struct PyGeventLoopObject *)values[0]);
+    __pyx_v_path = ((PyObject*)values[1]);
+    if (values[2]) {
+      __pyx_v_interval = __pyx_PyFloat_AsFloat(values[2]); if (unlikely((__pyx_v_interval == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 1231, __pyx_L3_error)
+    } else {
+      __pyx_v_interval = ((float)0.0);
+    }
+    __pyx_v_ref = values[3];
+    __pyx_v_priority = values[4];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1231, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.libev.corecext.stat.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return -1;
+  __pyx_L4_argument_unpacking_done:;
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_loop), __pyx_ptype_6gevent_5libev_8corecext_loop, 1, "loop", 0))) __PYX_ERR(0, 1231, __pyx_L1_error)
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_path), (&PyString_Type), 1, "path", 1))) __PYX_ERR(0, 1231, __pyx_L1_error)
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4stat___cinit__(((struct PyGeventStatObject *)__pyx_v_self), __pyx_v_loop, __pyx_v_path, __pyx_v_interval, __pyx_v_ref, __pyx_v_priority);
+
+  /* function exit code */
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __pyx_r = -1;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_5libev_8corecext_4stat___cinit__(struct PyGeventStatObject *__pyx_v_self, CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_loop, PyObject *__pyx_v_path, float __pyx_v_interval, CYTHON_UNUSED PyObject *__pyx_v_ref, CYTHON_UNUSED PyObject *__pyx_v_priority) {
+  PyObject *__pyx_v_paths = 0;
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__cinit__", 0);
+
+
+  /* function exit code */
+  __pyx_r = 0;
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_XDECREF(__pyx_t_6);
+  __Pyx_XDECREF(__pyx_t_7);
+  __Pyx_AddTraceback("gevent.libev.corecext.stat.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = -1;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_paths);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+1232:         self.path = path
+
+  __Pyx_INCREF(__pyx_v_path);
+  __Pyx_GIVEREF(__pyx_v_path);
+  __Pyx_GOTREF(__pyx_v_self->path);
+  __Pyx_DECREF(__pyx_v_self->path);
+  __pyx_v_self->path = __pyx_v_path;
+
 1233:         cdef bytes paths
+
+1234:         if isinstance(path, unicode):
+
+  __pyx_t_1 = PyUnicode_Check(__pyx_v_path); 
+  __pyx_t_2 = (__pyx_t_1 != 0);
+  if (__pyx_t_2) {
+
+    goto __pyx_L3;
+  }
+
 1235:             # the famous Python3 filesystem encoding debacle hits us here. Can we do better?
+
 1236:             # We must keep a reference to the encoded string so that its bytes don't get freed
+
 1237:             # and overwritten, leading to strange errors from libev ("no such file or directory")
+
+1238:             paths = (<unicode>path).encode(sys.getfilesystemencoding())
+
+    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_path, __pyx_n_s_encode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1238, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_sys); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1238, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_6);
+    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_getfilesystemencoding); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1238, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_7);
+    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+    __pyx_t_6 = NULL;
+    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
+      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
+      if (likely(__pyx_t_6)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
+        __Pyx_INCREF(__pyx_t_6);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_7, function);
+      }
+    }
+    __pyx_t_5 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_7);
+    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+    if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1238, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_5);
+    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+    __pyx_t_7 = NULL;
+    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
+      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4);
+      if (likely(__pyx_t_7)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
+        __Pyx_INCREF(__pyx_t_7);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_4, function);
+      }
+    }
+    __pyx_t_3 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_7, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5);
+    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1238, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    if (!(likely(PyBytes_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(0, 1238, __pyx_L1_error)
+    __pyx_v_paths = ((PyObject*)__pyx_t_3);
+    __pyx_t_3 = 0;
+
+1239:             self._paths = paths
+
+    __Pyx_INCREF(__pyx_v_paths);
+    __Pyx_GIVEREF(__pyx_v_paths);
+    __Pyx_GOTREF(__pyx_v_self->_paths);
+    __Pyx_DECREF(__pyx_v_self->_paths);
+    __pyx_v_self->_paths = __pyx_v_paths;
+
 1240:         else:
+
+1241:             paths = <bytes>path
+
+  /*else*/ {
+    __pyx_t_3 = __pyx_v_path;
+    __Pyx_INCREF(__pyx_t_3);
+    __pyx_v_paths = ((PyObject*)__pyx_t_3);
+    __pyx_t_3 = 0;
+
+1242:             self._paths = paths
+
+    __Pyx_INCREF(__pyx_v_paths);
+    __Pyx_GIVEREF(__pyx_v_paths);
+    __Pyx_GOTREF(__pyx_v_self->_paths);
+    __Pyx_DECREF(__pyx_v_self->_paths);
+    __pyx_v_self->_paths = __pyx_v_paths;
+  }
+  __pyx_L3:;
+
+1243:         libev.ev_stat_init(&self._watcher, <void *>gevent_callback_stat, <char*>paths, interval)
+
+  if (unlikely(__pyx_v_paths == Py_None)) {
+    PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found");
+    __PYX_ERR(0, 1243, __pyx_L1_error)
+  }
+  __pyx_t_8 = __Pyx_PyBytes_AsWritableString(__pyx_v_paths); if (unlikely((!__pyx_t_8) && PyErr_Occurred())) __PYX_ERR(0, 1243, __pyx_L1_error)
+  ev_stat_init((&__pyx_v_self->_watcher), ((void *)gevent_callback_stat), ((char *)__pyx_t_8), __pyx_v_interval);
+
+1244:         self.__watcher = <libev.ev_watcher*>&self._watcher
+
+  __pyx_v_self->__pyx_base.__pyx___watcher = ((struct ev_watcher *)(&__pyx_v_self->_watcher));
+
+1245:         self.__ss = &stat_ss
+
+  __pyx_v_self->__pyx_base.__pyx___ss = (&__pyx_v_6gevent_5libev_8corecext_stat_ss);
+
 1246: 
+
+1247:     def __init__(self, loop loop, str path, float interval=0.0, ref=True, priority=None):
+
+
+/* Python wrapper */
+static int __pyx_pw_6gevent_5libev_8corecext_4stat_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static int __pyx_pw_6gevent_5libev_8corecext_4stat_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  struct PyGeventLoopObject *__pyx_v_loop = 0;
+  CYTHON_UNUSED PyObject *__pyx_v_path = 0;
+  CYTHON_UNUSED float __pyx_v_interval;
+  PyObject *__pyx_v_ref = 0;
+  PyObject *__pyx_v_priority = 0;
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_loop,&__pyx_n_s_path,&__pyx_n_s_interval,&__pyx_n_s_ref,&__pyx_n_s_priority,0};
+    PyObject* values[5] = {0,0,0,0,0};
+    values[3] = ((PyObject *)Py_True);
+    values[4] = ((PyObject *)Py_None);
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
+        CYTHON_FALLTHROUGH;
+        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
+        CYTHON_FALLTHROUGH;
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_loop)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_path)) != 0)) kw_args--;
+        else {
+          __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 5, 1); __PYX_ERR(0, 1247, __pyx_L3_error)
+        }
+        CYTHON_FALLTHROUGH;
+        case  2:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_interval);
+          if (value) { values[2] = value; kw_args--; }
+        }
+        CYTHON_FALLTHROUGH;
+        case  3:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ref);
+          if (value) { values[3] = value; kw_args--; }
+        }
+        CYTHON_FALLTHROUGH;
+        case  4:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_priority);
+          if (value) { values[4] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 1247, __pyx_L3_error)
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
+        CYTHON_FALLTHROUGH;
+        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
+        CYTHON_FALLTHROUGH;
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    __pyx_v_loop = ((struct PyGeventLoopObject *)values[0]);
+    __pyx_v_path = ((PyObject*)values[1]);
+    if (values[2]) {
+      __pyx_v_interval = __pyx_PyFloat_AsFloat(values[2]); if (unlikely((__pyx_v_interval == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 1247, __pyx_L3_error)
+    } else {
+      __pyx_v_interval = ((float)0.0);
+    }
+    __pyx_v_ref = values[3];
+    __pyx_v_priority = values[4];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1247, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.libev.corecext.stat.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return -1;
+  __pyx_L4_argument_unpacking_done:;
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_loop), __pyx_ptype_6gevent_5libev_8corecext_loop, 1, "loop", 0))) __PYX_ERR(0, 1247, __pyx_L1_error)
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_path), (&PyString_Type), 1, "path", 1))) __PYX_ERR(0, 1247, __pyx_L1_error)
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4stat_2__init__(((struct PyGeventStatObject *)__pyx_v_self), __pyx_v_loop, __pyx_v_path, __pyx_v_interval, __pyx_v_ref, __pyx_v_priority);
+
+  /* function exit code */
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __pyx_r = -1;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_5libev_8corecext_4stat_2__init__(struct PyGeventStatObject *__pyx_v_self, struct PyGeventLoopObject *__pyx_v_loop, CYTHON_UNUSED PyObject *__pyx_v_path, CYTHON_UNUSED float __pyx_v_interval, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__", 0);
+
+
+  /* function exit code */
+  __pyx_r = 0;
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_AddTraceback("gevent.libev.corecext.stat.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = -1;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+1248:         watcher.__init__(self, loop, ref, priority)
+
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_6gevent_5libev_8corecext_watcher), __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1248, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = NULL;
+  __pyx_t_4 = 0;
+  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+    if (likely(__pyx_t_3)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+      __Pyx_INCREF(__pyx_t_3);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_2, function);
+      __pyx_t_4 = 1;
+    }
+  }
+  #if CYTHON_FAST_PYCALL
+  if (PyFunction_Check(__pyx_t_2)) {
+    PyObject *__pyx_temp[5] = {__pyx_t_3, ((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_loop), __pyx_v_ref, __pyx_v_priority};
+    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 4+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1248, __pyx_L1_error)
+    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __Pyx_GOTREF(__pyx_t_1);
+  } else
+  #endif
+  #if CYTHON_FAST_PYCCALL
+  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
+    PyObject *__pyx_temp[5] = {__pyx_t_3, ((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_loop), __pyx_v_ref, __pyx_v_priority};
+    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 4+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1248, __pyx_L1_error)
+    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __Pyx_GOTREF(__pyx_t_1);
+  } else
+  #endif
+  {
+    __pyx_t_5 = PyTuple_New(4+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1248, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_5);
+    if (__pyx_t_3) {
+      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
+    }
+    __Pyx_INCREF(((PyObject *)__pyx_v_self));
+    __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
+    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, ((PyObject *)__pyx_v_self));
+    __Pyx_INCREF(((PyObject *)__pyx_v_loop));
+    __Pyx_GIVEREF(((PyObject *)__pyx_v_loop));
+    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, ((PyObject *)__pyx_v_loop));
+    __Pyx_INCREF(__pyx_v_ref);
+    __Pyx_GIVEREF(__pyx_v_ref);
+    PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_4, __pyx_v_ref);
+    __Pyx_INCREF(__pyx_v_priority);
+    __Pyx_GIVEREF(__pyx_v_priority);
+    PyTuple_SET_ITEM(__pyx_t_5, 3+__pyx_t_4, __pyx_v_priority);
+    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1248, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+  }
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 1249: 
+
 1250: 
+
 1251:     @property
+
+1252:     def attr(self):
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4stat_4attr_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4stat_4attr_1__get__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4stat_4attr___get__(((struct PyGeventStatObject *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_4stat_4attr___get__(struct PyGeventStatObject *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__", 0);
+
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_AddTraceback("gevent.libev.corecext.stat.attr.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+1253:         if not self._watcher.attr.st_nlink:
+
+  __pyx_t_1 = ((!(__pyx_v_self->_watcher.attr.st_nlink != 0)) != 0);
+  if (__pyx_t_1) {
+
+  }
+
+1254:             return
+
+    __Pyx_XDECREF(__pyx_r);
+    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+    goto __pyx_L0;
+
+1255:         return _pystat_fromstructstat(&self._watcher.attr)
+
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_2 = _pystat_fromstructstat((&__pyx_v_self->_watcher.attr)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1255, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_r = __pyx_t_2;
+  __pyx_t_2 = 0;
+  goto __pyx_L0;
+
 1256: 
+
 1257:     @property
+
+1258:     def prev(self):
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4stat_4prev_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4stat_4prev_1__get__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4stat_4prev___get__(((struct PyGeventStatObject *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_4stat_4prev___get__(struct PyGeventStatObject *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__", 0);
+
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_AddTraceback("gevent.libev.corecext.stat.prev.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+1259:         if not self._watcher.prev.st_nlink:
+
+  __pyx_t_1 = ((!(__pyx_v_self->_watcher.prev.st_nlink != 0)) != 0);
+  if (__pyx_t_1) {
+
+  }
+
+1260:             return
+
+    __Pyx_XDECREF(__pyx_r);
+    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+    goto __pyx_L0;
+
+1261:         return _pystat_fromstructstat(&self._watcher.prev)
+
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_2 = _pystat_fromstructstat((&__pyx_v_self->_watcher.prev)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1261, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_r = __pyx_t_2;
+  __pyx_t_2 = 0;
+  goto __pyx_L0;
+
 1262: 
+
 1263:     @property
+
+1264:     def interval(self):
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4stat_8interval_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4stat_8interval_1__get__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4stat_8interval___get__(((struct PyGeventStatObject *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_4stat_8interval___get__(struct PyGeventStatObject *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__", 0);
+
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.libev.corecext.stat.interval.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+1265:         return self._watcher.interval
+
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->_watcher.interval); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1265, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
 1266: 
+
 1267: 
+
 1268: 
+
+1269: __SYSERR_CALLBACK = None
+
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_SYSERR_CALLBACK, Py_None) < 0) __PYX_ERR(0, 1269, __pyx_L1_error)
+
 1270: 
+
 1271: 
+
+1272: cdef void _syserr_cb(char* msg) with gil:
+
+
+static void __pyx_f_6gevent_5libev_8corecext__syserr_cb(char *__pyx_v_msg) {
+  PyObject *__pyx_v_print_exc = NULL;
+  #ifdef WITH_THREAD
+  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
+  #endif
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_syserr_cb", 0);
+
+
+  /* function exit code */
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_XDECREF(__pyx_t_6);
+  __Pyx_XDECREF(__pyx_t_7);
+  __Pyx_XDECREF(__pyx_t_8);
+  __Pyx_XDECREF(__pyx_t_10);
+  __Pyx_WriteUnraisable("gevent.libev.corecext._syserr_cb", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_print_exc);
+  __Pyx_RefNannyFinishContext();
+  #ifdef WITH_THREAD
+  __Pyx_PyGILState_Release(__pyx_gilstate_save);
+  #endif
+}
+
+1273:     try:
+
+  {
+    /*try:*/ {
+
+    }
+    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+    goto __pyx_L8_try_end;
+    __pyx_L3_error:;
+    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
+    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
+    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+
+    __Pyx_XGIVEREF(__pyx_t_1);
+    __Pyx_XGIVEREF(__pyx_t_2);
+    __Pyx_XGIVEREF(__pyx_t_3);
+    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
+    goto __pyx_L1_error;
+    __pyx_L4_exception_handled:;
+    __Pyx_XGIVEREF(__pyx_t_1);
+    __Pyx_XGIVEREF(__pyx_t_2);
+    __Pyx_XGIVEREF(__pyx_t_3);
+    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
+    __pyx_L8_try_end:;
+  }
+
+1274:         __SYSERR_CALLBACK(msg, errno)
+
+      __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_SYSERR_CALLBACK); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1274, __pyx_L3_error)
+      __Pyx_GOTREF(__pyx_t_5);
+      __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_msg); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1274, __pyx_L3_error)
+      __Pyx_GOTREF(__pyx_t_6);
+      __pyx_t_7 = __Pyx_PyInt_From_int(errno); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1274, __pyx_L3_error)
+      __Pyx_GOTREF(__pyx_t_7);
+      __pyx_t_8 = NULL;
+      __pyx_t_9 = 0;
+      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
+        __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5);
+        if (likely(__pyx_t_8)) {
+          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
+          __Pyx_INCREF(__pyx_t_8);
+          __Pyx_INCREF(function);
+          __Pyx_DECREF_SET(__pyx_t_5, function);
+          __pyx_t_9 = 1;
+        }
+      }
+      #if CYTHON_FAST_PYCALL
+      if (PyFunction_Check(__pyx_t_5)) {
+        PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_t_6, __pyx_t_7};
+        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1274, __pyx_L3_error)
+        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
+        __Pyx_GOTREF(__pyx_t_4);
+        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+      } else
+      #endif
+      #if CYTHON_FAST_PYCCALL
+      if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
+        PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_t_6, __pyx_t_7};
+        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1274, __pyx_L3_error)
+        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
+        __Pyx_GOTREF(__pyx_t_4);
+        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+      } else
+      #endif
+      {
+        __pyx_t_10 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1274, __pyx_L3_error)
+        __Pyx_GOTREF(__pyx_t_10);
+        if (__pyx_t_8) {
+          __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_8); __pyx_t_8 = NULL;
+        }
+        __Pyx_GIVEREF(__pyx_t_6);
+        PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_9, __pyx_t_6);
+        __Pyx_GIVEREF(__pyx_t_7);
+        PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_9, __pyx_t_7);
+        __pyx_t_6 = 0;
+        __pyx_t_7 = 0;
+        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_10, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1274, __pyx_L3_error)
+        __Pyx_GOTREF(__pyx_t_4);
+        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+      }
+      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+
+1275:     except:
+
+    /*except:*/ {
+      __Pyx_AddTraceback("gevent.libev.corecext._syserr_cb", __pyx_clineno, __pyx_lineno, __pyx_filename);
+      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_5, &__pyx_t_10) < 0) __PYX_ERR(0, 1275, __pyx_L5_except_error)
+      __Pyx_GOTREF(__pyx_t_4);
+      __Pyx_GOTREF(__pyx_t_5);
+      __Pyx_GOTREF(__pyx_t_10);
+
+1276:         set_syserr_cb(None)
+
+      __pyx_t_7 = __pyx_f_6gevent_5libev_8corecext_set_syserr_cb(Py_None, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1276, __pyx_L5_except_error)
+      __Pyx_GOTREF(__pyx_t_7);
+      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+
+1277:         print_exc = getattr(traceback, 'print_exc', None)
+
+      __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_traceback); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1277, __pyx_L5_except_error)
+      __Pyx_GOTREF(__pyx_t_7);
+      __pyx_t_6 = __Pyx_GetAttr3(__pyx_t_7, __pyx_n_s_print_exc, Py_None); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1277, __pyx_L5_except_error)
+      __Pyx_GOTREF(__pyx_t_6);
+      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+      __pyx_v_print_exc = __pyx_t_6;
+      __pyx_t_6 = 0;
+
+1278:         if print_exc is not None:
+
+      __pyx_t_11 = (__pyx_v_print_exc != Py_None);
+      __pyx_t_12 = (__pyx_t_11 != 0);
+      if (__pyx_t_12) {
+
+      }
+      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
+      goto __pyx_L4_exception_handled;
+    }
+    __pyx_L5_except_error:;
+
+1279:             print_exc()
+
+        __Pyx_INCREF(__pyx_v_print_exc);
+        __pyx_t_7 = __pyx_v_print_exc; __pyx_t_8 = NULL;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
+          __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
+          if (likely(__pyx_t_8)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
+            __Pyx_INCREF(__pyx_t_8);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_7, function);
+          }
+        }
+        __pyx_t_6 = (__pyx_t_8) ? __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_8) : __Pyx_PyObject_CallNoArg(__pyx_t_7);
+        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
+        if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1279, __pyx_L5_except_error)
+        __Pyx_GOTREF(__pyx_t_6);
+        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+
 1280: 
+
 1281: 
+
+1282: cpdef set_syserr_cb(callback):
+
+
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_21set_syserr_cb(PyObject *__pyx_self, PyObject *__pyx_v_callback); /*proto*/
+static PyObject *__pyx_f_6gevent_5libev_8corecext_set_syserr_cb(PyObject *__pyx_v_callback, CYTHON_UNUSED int __pyx_skip_dispatch) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("set_syserr_cb", 0);
+
+
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_AddTraceback("gevent.libev.corecext.set_syserr_cb", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_21set_syserr_cb(PyObject *__pyx_self, PyObject *__pyx_v_callback); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_21set_syserr_cb(PyObject *__pyx_self, PyObject *__pyx_v_callback) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("set_syserr_cb (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_20set_syserr_cb(__pyx_self, ((PyObject *)__pyx_v_callback));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_20set_syserr_cb(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_callback) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("set_syserr_cb", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __pyx_f_6gevent_5libev_8corecext_set_syserr_cb(__pyx_v_callback, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1282, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.libev.corecext.set_syserr_cb", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
 1283:     global __SYSERR_CALLBACK
+
+1284:     if callback is None:
+
+  __pyx_t_1 = (__pyx_v_callback == Py_None);
+  __pyx_t_2 = (__pyx_t_1 != 0);
+  if (__pyx_t_2) {
+
+    goto __pyx_L3;
+  }
+
+1285:         libev.ev_set_syserr_cb(NULL)
+
+    ev_set_syserr_cb(NULL);
+
+1286:         __SYSERR_CALLBACK = None
+
+    if (PyDict_SetItem(__pyx_d, __pyx_n_s_SYSERR_CALLBACK, Py_None) < 0) __PYX_ERR(0, 1286, __pyx_L1_error)
+
+1287:     elif callable(callback):
+
+  __pyx_t_2 = __Pyx_PyCallable_Check(__pyx_v_callback); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 1287, __pyx_L1_error)
+  __pyx_t_1 = (__pyx_t_2 != 0);
+  if (likely(__pyx_t_1)) {
+
+    goto __pyx_L3;
+  }
+
+1288:         libev.ev_set_syserr_cb(<void *>_syserr_cb)
+
+    ev_set_syserr_cb(((void *)__pyx_f_6gevent_5libev_8corecext__syserr_cb));
+
+1289:         __SYSERR_CALLBACK = callback
+
+    if (PyDict_SetItem(__pyx_d, __pyx_n_s_SYSERR_CALLBACK, __pyx_v_callback) < 0) __PYX_ERR(0, 1289, __pyx_L1_error)
+
 1290:     else:
+
+1291:         raise TypeError('Expected callable or None, got %r' % (callback, ))
+
+  /*else*/ {
+    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1291, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_INCREF(__pyx_v_callback);
+    __Pyx_GIVEREF(__pyx_v_callback);
+    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_callback);
+    __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Expected_callable_or_None_got_r, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1291, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1291, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __PYX_ERR(0, 1291, __pyx_L1_error)
+  }
+  __pyx_L3:;
+
 1292: 
+
 1293: 
+
 1294: 
+
+1295: LIBEV_EMBED = bool(libev.LIBEV_EMBED)
+
+  __pyx_t_18 = __Pyx_PyInt_From_int(LIBEV_EMBED); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1295, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_18);
+  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_18); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1295, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
+  __pyx_t_18 = __Pyx_PyBool_FromLong((!(!__pyx_t_3))); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1295, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_18);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBEV_EMBED, __pyx_t_18) < 0) __PYX_ERR(0, 1295, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
+
+1296: EV_USE_FLOOR = libev.EV_USE_FLOOR
+
+  __pyx_t_18 = __Pyx_PyInt_From_int(EV_USE_FLOOR); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1296, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_18);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_EV_USE_FLOOR, __pyx_t_18) < 0) __PYX_ERR(0, 1296, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
+
+1297: EV_USE_CLOCK_SYSCALL = libev.EV_USE_CLOCK_SYSCALL
+
+  __pyx_t_18 = __Pyx_PyInt_From_int(EV_USE_CLOCK_SYSCALL); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1297, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_18);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_EV_USE_CLOCK_SYSCALL, __pyx_t_18) < 0) __PYX_ERR(0, 1297, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
+
+1298: EV_USE_REALTIME = libev.EV_USE_REALTIME
+
+  __pyx_t_18 = __Pyx_PyInt_From_int(EV_USE_REALTIME); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1298, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_18);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_EV_USE_REALTIME, __pyx_t_18) < 0) __PYX_ERR(0, 1298, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
+
+1299: EV_USE_MONOTONIC = libev.EV_USE_MONOTONIC
+
+  __pyx_t_18 = __Pyx_PyInt_From_int(EV_USE_MONOTONIC); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1299, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_18);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_EV_USE_MONOTONIC, __pyx_t_18) < 0) __PYX_ERR(0, 1299, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
+
+1300: EV_USE_NANOSLEEP = libev.EV_USE_NANOSLEEP
+
+  __pyx_t_18 = __Pyx_PyInt_From_int(EV_USE_NANOSLEEP); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1300, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_18);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_EV_USE_NANOSLEEP, __pyx_t_18) < 0) __PYX_ERR(0, 1300, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
+
+1301: EV_USE_INOTIFY = libev.EV_USE_INOTIFY
+
+  __pyx_t_18 = __Pyx_PyInt_From_int(EV_USE_INOTIFY); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1301, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_18);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_EV_USE_INOTIFY, __pyx_t_18) < 0) __PYX_ERR(0, 1301, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
+
+1302: EV_USE_SIGNALFD = libev.EV_USE_SIGNALFD
+
+  __pyx_t_18 = __Pyx_PyInt_From_int(EV_USE_SIGNALFD); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1302, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_18);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_EV_USE_SIGNALFD, __pyx_t_18) < 0) __PYX_ERR(0, 1302, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
+
+1303: EV_USE_EVENTFD = libev.EV_USE_EVENTFD
+
+  __pyx_t_18 = __Pyx_PyInt_From_int(EV_USE_EVENTFD); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1303, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_18);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_EV_USE_EVENTFD, __pyx_t_18) < 0) __PYX_ERR(0, 1303, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
+
+1304: EV_USE_4HEAP = libev.EV_USE_4HEAP
+
+  __pyx_t_18 = __Pyx_PyInt_From_int(EV_USE_4HEAP); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1304, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_18);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_EV_USE_4HEAP, __pyx_t_18) < 0) __PYX_ERR(0, 1304, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
+
 1305: 
+
 1306: # Things used in callbacks.c
+
 1307: 
+
 1308: from cpython cimport PyErr_Fetch
+
 1309: from cpython cimport PyObject
+
 1310: 
+
+1311: cdef public void gevent_handle_error(loop loop, object context):
+
+
+void gevent_handle_error(struct PyGeventLoopObject *__pyx_v_loop, PyObject *__pyx_v_context) {
+  PyObject *__pyx_v_typep;
+  PyObject *__pyx_v_valuep;
+  PyObject *__pyx_v_tracebackp;
+  PyObject *__pyx_v_type = 0;
+  PyObject *__pyx_v_value = 0;
+  PyObject *__pyx_v_traceback = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("gevent_handle_error", 0);
+
+
+  /* function exit code */
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_WriteUnraisable("gevent.libev.corecext.gevent_handle_error", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_type);
+  __Pyx_XDECREF(__pyx_v_value);
+  __Pyx_XDECREF(__pyx_v_traceback);
+  __Pyx_RefNannyFinishContext();
+}
+
 1312:     cdef PyObject* typep
+
 1313:     cdef PyObject* valuep
+
 1314:     cdef PyObject* tracebackp
+
 1315: 
+
 1316:     cdef object type
+
+1317:     cdef object value = None
+
+  __Pyx_INCREF(Py_None);
+  __pyx_v_value = Py_None;
+
+1318:     cdef object traceback = None
+
+  __Pyx_INCREF(Py_None);
+  __pyx_v_traceback = Py_None;
+
 1319:     cdef object result
+
 1320: 
+
 1321:     # If it was set, this will clear it, and we will own
+
 1322:     # the references.
+
+1323:     PyErr_Fetch(&typep, &valuep, &tracebackp)
+
+  PyErr_Fetch((&__pyx_v_typep), (&__pyx_v_valuep), (&__pyx_v_tracebackp));
+
 1324:     # TODO: Should we call PyErr_Normalize? There's code in
+
 1325:     # Hub.handle_error that works around what looks like an
+
 1326:     # unnormalized exception.
+
 1327: 
+
+1328:     if not typep:
+
+  __pyx_t_1 = ((!(__pyx_v_typep != 0)) != 0);
+  if (__pyx_t_1) {
+
+  }
+
+1329:         return
+
+    goto __pyx_L0;
+
 1330:     # This assignment will do a Py_INCREF
+
 1331:     # on the value. We already own the reference
+
 1332:     # returned from PyErr_Fetch,
+
 1333:     # so we must decref immediately
+
+1334:     type = <object>typep
+
+  __pyx_t_2 = ((PyObject *)__pyx_v_typep);
+  __Pyx_INCREF(__pyx_t_2);
+  __pyx_v_type = __pyx_t_2;
+  __pyx_t_2 = 0;
+
+1335:     Py_DECREF(type)
+
+  Py_DECREF(__pyx_v_type);
+
 1336: 
+
+1337:     if valuep:
+
+  __pyx_t_1 = (__pyx_v_valuep != 0);
+  if (__pyx_t_1) {
+
+  }
+
+1338:         value = <object>valuep
+
+    __pyx_t_2 = ((PyObject *)__pyx_v_valuep);
+    __Pyx_INCREF(__pyx_t_2);
+    __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_2);
+    __pyx_t_2 = 0;
+
+1339:         Py_DECREF(value)
+
+    Py_DECREF(__pyx_v_value);
+
+1340:     if tracebackp:
+
+  __pyx_t_1 = (__pyx_v_tracebackp != 0);
+  if (__pyx_t_1) {
+
+  }
+
+1341:         traceback = <object>tracebackp
+
+    __pyx_t_2 = ((PyObject *)__pyx_v_tracebackp);
+    __Pyx_INCREF(__pyx_t_2);
+    __Pyx_DECREF_SET(__pyx_v_traceback, __pyx_t_2);
+    __pyx_t_2 = 0;
+
+1342:         Py_DECREF(traceback)
+
+    Py_DECREF(__pyx_v_traceback);
+
 1343: 
+
 1344:     # If this method fails by raising an exception,
+
 1345:     # cython will print it for us because we don't return a
+
 1346:     # Python object and we don't declare an `except` clause.
+
+1347:     loop.handle_error(context, type, value, traceback)
+
+  __pyx_t_2 = ((struct __pyx_vtabstruct_6gevent_5libev_8corecext_loop *)__pyx_v_loop->__pyx_vtab)->handle_error(__pyx_v_loop, __pyx_v_context, __pyx_v_type, __pyx_v_value, __pyx_v_traceback, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1347, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
 1348: 
+
+1349: cdef public tuple _empty_tuple = ()
+
+  __Pyx_INCREF(__pyx_empty_tuple);
+  __Pyx_XGOTREF(_empty_tuple);
+  __Pyx_DECREF_SET(_empty_tuple, __pyx_empty_tuple);
+  __Pyx_GIVEREF(__pyx_empty_tuple);
+
 1350: 
+
+1351: cdef public object gevent_loop_run_callbacks(loop loop):
+
+
+PyObject *gevent_loop_run_callbacks(struct PyGeventLoopObject *__pyx_v_loop) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("gevent_loop_run_callbacks", 0);
+
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.libev.corecext.gevent_loop_run_callbacks", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+1352:     return loop._run_callbacks()
+
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_5libev_8corecext_loop *)__pyx_v_loop->__pyx_vtab)->_run_callbacks(__pyx_v_loop); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1352, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/libev/corecext.pyx b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/libev/corecext.pyx new file mode 100644 index 00000000..c7ec4c17 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/libev/corecext.pyx @@ -0,0 +1,1352 @@ +# Copyright (c) 2009-2012 Denis Bilenko. See LICENSE for details. + +# This first directive, supported in Cython 0.24+, causes sources +# files to be *much* smaller when it's false (139,027 LOC vs 35,000 +# LOC) and thus cythonpp.py (and probably the compiler; also Visual C +# has limits on source file sizes) to be faster (73s vs 46s). But it does +# make debugging more difficult. Auto-pickling was added in 0.26, and +# that's a new feature that we don't need or want to allow in a gevent +# point release. + +# cython: emit_code_comments=False, auto_pickle=False + +# NOTE: We generally cannot use the Cython IF directive as documented +# at +# http://cython.readthedocs.io/en/latest/src/userguide/language_basics.html#conditional-compilation +# (e.g., IF UNAME_SYSNAME == "Windows") because when Cython says +# "compilation", it means when *Cython* compiles, not when the C +# compiler compiles. We distribute an sdist with a single pre-compiled +# C file for all platforms so that end users that don't use a binary +# wheel don't have to sit through cythonpp and other steps the Makefile does. +# See https://github.com/gevent/gevent/issues/1076 + +cimport cython +cimport libev + +from cpython.ref cimport Py_INCREF +from cpython.ref cimport Py_DECREF +from cpython.mem cimport PyMem_Malloc +from cpython.mem cimport PyMem_Free +from libc.errno cimport errno + +cdef extern from "Python.h": + int Py_ReprEnter(object) + void Py_ReprLeave(object) + +# Work around lack of absolute_import in Cython +# Note for PY3: not doing so will leave reference to locals() on import +# (reproducible under Python 3.3, not under Python 3.4; see test__refcount_core.py) +sys = __import__('sys', level=0) +os = __import__('os', level=0) +traceback = __import__('traceback', level=0) +signalmodule = __import__('signal', level=0) +getswitchinterval = __import__('gevent', level=0).getswitchinterval + + +__all__ = ['get_version', + 'get_header_version', + 'supported_backends', + 'recommended_backends', + 'embeddable_backends', + 'time', + 'loop'] + +cdef tuple integer_types + +if sys.version_info[0] >= 3: + integer_types = int, +else: + integer_types = (int, long) + + +cdef extern from "callbacks.h": + void gevent_callback_io(libev.ev_loop, void*, int) + void gevent_callback_timer(libev.ev_loop, void*, int) + void gevent_callback_signal(libev.ev_loop, void*, int) + void gevent_callback_idle(libev.ev_loop, void*, int) + void gevent_callback_prepare(libev.ev_loop, void*, int) + void gevent_callback_check(libev.ev_loop, void*, int) + void gevent_callback_fork(libev.ev_loop, void*, int) + void gevent_callback_async(libev.ev_loop, void*, int) + void gevent_callback_child(libev.ev_loop, void*, int) + void gevent_callback_stat(libev.ev_loop, void*, int) + void gevent_run_callbacks(libev.ev_loop, void*, int) + void gevent_periodic_signal_check(libev.ev_loop, void*, int) + void gevent_call(loop, callback) + void gevent_noop(libev.ev_loop, void*, int) + +cdef extern from "stathelper.c": + object _pystat_fromstructstat(void*) + + +UNDEF = libev.EV_UNDEF +NONE = libev.EV_NONE +READ = libev.EV_READ +WRITE = libev.EV_WRITE +TIMER = libev.EV_TIMER +PERIODIC = libev.EV_PERIODIC +SIGNAL = libev.EV_SIGNAL +CHILD = libev.EV_CHILD +STAT = libev.EV_STAT +IDLE = libev.EV_IDLE +PREPARE = libev.EV_PREPARE +CHECK = libev.EV_CHECK +EMBED = libev.EV_EMBED +FORK = libev.EV_FORK +CLEANUP = libev.EV_CLEANUP +ASYNC = libev.EV_ASYNC +CUSTOM = libev.EV_CUSTOM +ERROR = libev.EV_ERROR + +READWRITE = libev.EV_READ | libev.EV_WRITE + +MINPRI = libev.EV_MINPRI +MAXPRI = libev.EV_MAXPRI + +BACKEND_PORT = libev.EVBACKEND_PORT +BACKEND_KQUEUE = libev.EVBACKEND_KQUEUE +BACKEND_EPOLL = libev.EVBACKEND_EPOLL +BACKEND_POLL = libev.EVBACKEND_POLL +BACKEND_SELECT = libev.EVBACKEND_SELECT +FORKCHECK = libev.EVFLAG_FORKCHECK +NOINOTIFY = libev.EVFLAG_NOINOTIFY +SIGNALFD = libev.EVFLAG_SIGNALFD +NOSIGMASK = libev.EVFLAG_NOSIGMASK + + +@cython.internal +cdef class _EVENTSType: + + def __repr__(self): + return 'gevent.core.EVENTS' + + +cdef public object GEVENT_CORE_EVENTS = _EVENTSType() +EVENTS = GEVENT_CORE_EVENTS + + +def get_version(): + return 'libev-%d.%02d' % (libev.ev_version_major(), libev.ev_version_minor()) + + +def get_header_version(): + return 'libev-%d.%02d' % (libev.EV_VERSION_MAJOR, libev.EV_VERSION_MINOR) + + +# This list backends in the order they are actually tried by libev +_flags = [(libev.EVBACKEND_PORT, 'port'), + (libev.EVBACKEND_KQUEUE, 'kqueue'), + (libev.EVBACKEND_EPOLL, 'epoll'), + (libev.EVBACKEND_POLL, 'poll'), + (libev.EVBACKEND_SELECT, 'select'), + (libev.EVFLAG_NOENV, 'noenv'), + (libev.EVFLAG_FORKCHECK, 'forkcheck'), + (libev.EVFLAG_NOINOTIFY, 'noinotify'), + (libev.EVFLAG_SIGNALFD, 'signalfd'), + (libev.EVFLAG_NOSIGMASK, 'nosigmask')] + + +_flags_str2int = dict((string, flag) for (flag, string) in _flags) + + +_events = [(libev.EV_READ, 'READ'), + (libev.EV_WRITE, 'WRITE'), + (libev.EV__IOFDSET, '_IOFDSET'), + (libev.EV_PERIODIC, 'PERIODIC'), + (libev.EV_SIGNAL, 'SIGNAL'), + (libev.EV_CHILD, 'CHILD'), + (libev.EV_STAT, 'STAT'), + (libev.EV_IDLE, 'IDLE'), + (libev.EV_PREPARE, 'PREPARE'), + (libev.EV_CHECK, 'CHECK'), + (libev.EV_EMBED, 'EMBED'), + (libev.EV_FORK, 'FORK'), + (libev.EV_CLEANUP, 'CLEANUP'), + (libev.EV_ASYNC, 'ASYNC'), + (libev.EV_CUSTOM, 'CUSTOM'), + (libev.EV_ERROR, 'ERROR')] + + +cpdef _flags_to_list(unsigned int flags): + cdef list result = [] + for code, value in _flags: + if flags & code: + result.append(value) + flags &= ~code + if not flags: + break + if flags: + result.append(flags) + return result + + +if sys.version_info[0] >= 3: + basestring = (bytes, str) +else: + basestring = __builtins__.basestring + + +cpdef unsigned int _flags_to_int(object flags) except? -1: + # Note, that order does not matter, libev has its own predefined order + if not flags: + return 0 + if isinstance(flags, integer_types): + return flags + cdef unsigned int result = 0 + try: + if isinstance(flags, basestring): + flags = flags.split(',') + for value in flags: + value = value.strip().lower() + if value: + result |= _flags_str2int[value] + except KeyError as ex: + raise ValueError('Invalid backend or flag: %s\nPossible values: %s' % (ex, ', '.join(sorted(_flags_str2int.keys())))) + return result + + +cdef str _str_hex(object flag): + if isinstance(flag, integer_types): + return hex(flag) + return str(flag) + + +cpdef _check_flags(unsigned int flags): + cdef list as_list + flags &= libev.EVBACKEND_MASK + if not flags: + return + if not (flags & libev.EVBACKEND_ALL): + raise ValueError('Invalid value for backend: 0x%x' % flags) + if not (flags & libev.ev_supported_backends()): + as_list = [_str_hex(x) for x in _flags_to_list(flags)] + raise ValueError('Unsupported backend: %s' % '|'.join(as_list)) + + +cpdef _events_to_str(int events): + cdef list result = [] + cdef int c_flag + for (flag, string) in _events: + c_flag = flag + if events & c_flag: + result.append(string) + events = events & (~c_flag) + if not events: + break + if events: + result.append(hex(events)) + return '|'.join(result) + + +def supported_backends(): + return _flags_to_list(libev.ev_supported_backends()) + + +def recommended_backends(): + return _flags_to_list(libev.ev_recommended_backends()) + + +def embeddable_backends(): + return _flags_to_list(libev.ev_embeddable_backends()) + + +def time(): + return libev.ev_time() + +cdef bint _check_loop(loop loop) except -1: + if not loop._ptr: + raise ValueError('operation on destroyed loop') + return 1 + + + +cdef public class callback [object PyGeventCallbackObject, type PyGeventCallback_Type]: + cdef public object callback + cdef public tuple args + cdef callback next + + def __init__(self, callback, args): + self.callback = callback + self.args = args + + def stop(self): + self.callback = None + self.args = None + + close = stop + + # Note, that __nonzero__ and pending are different + # nonzero is used in contexts where we need to know whether to schedule another callback, + # so it's true if it's pending or currently running + # 'pending' has the same meaning as libev watchers: it is cleared before entering callback + + def __nonzero__(self): + # it's nonzero if it's pending or currently executing + return self.args is not None + + @property + def pending(self): + return self.callback is not None + + def __repr__(self): + if Py_ReprEnter(self) != 0: + return "<...>" + try: + format = self._format() + result = "<%s at 0x%x%s" % (self.__class__.__name__, id(self), format) + if self.pending: + result += " pending" + if self.callback is not None: + result += " callback=%r" % (self.callback, ) + if self.args is not None: + result += " args=%r" % (self.args, ) + if self.callback is None and self.args is None: + result += " stopped" + return result + ">" + finally: + Py_ReprLeave(self) + + def _format(self): + return '' + +DEF CALLBACK_CHECK_COUNT = 50 + +@cython.final +@cython.internal +cdef class CallbackFIFO(object): + cdef callback head + cdef callback tail + + def __init__(self): + self.head = None + self.tail = None + + cdef inline callback popleft(self): + cdef callback head = self.head + self.head = head.next + if self.head is self.tail or self.head is None: + self.tail = None + head.next = None + return head + + + cdef inline append(self, callback new_tail): + assert not new_tail.next + if self.tail is None: + if self.head is None: + # Completely empty, so this + # is now our head + self.head = new_tail + return + self.tail = self.head + + + assert self.head is not None + old_tail = self.tail + old_tail.next = new_tail + self.tail = new_tail + + def __nonzero__(self): + return self.head is not None + + def __len__(self): + cdef Py_ssize_t count = 0 + head = self.head + while head is not None: + count += 1 + head = head.next + return count + + def __iter__(self): + cdef list objects = [] + head = self.head + while head is not None: + objects.append(head) + head = head.next + return iter(objects) + + cdef bint has_callbacks(self): + return self.head + + def __repr__(self): + return "" % (id(self), len(self), self.head, self.tail) + + +cdef public class loop [object PyGeventLoopObject, type PyGeventLoop_Type]: + ## embedded struct members + cdef libev.ev_prepare _prepare + cdef libev.ev_timer _timer0 + # We'll only actually start this timer if we're on Windows, + # but it doesn't hurt to compile it in on all platforms. + cdef libev.ev_timer _periodic_signal_checker + + ## pointer members + cdef public object error_handler + cdef libev.ev_loop* _ptr + cdef public CallbackFIFO _callbacks + + ## data members + cdef bint starting_timer_may_update_loop_time + # We must capture the 'default' state at initialiaztion + # time. Destroying the default loop in libev sets + # the libev internal pointer to 0, and ev_is_default_loop will + # no longer work. + cdef bint _default + cdef readonly double approx_timer_resolution + + def __cinit__(self, object flags=None, object default=None, libev.intptr_t ptr=0): + self.starting_timer_may_update_loop_time = 0 + self._default = 0 + libev.ev_prepare_init(&self._prepare, + gevent_run_callbacks) + libev.ev_timer_init(&self._periodic_signal_checker, + gevent_periodic_signal_check, + 0.3, 0.3) + libev.ev_timer_init(&self._timer0, + gevent_noop, + 0.0, 0.0) + + cdef unsigned int c_flags + cdef object old_handler = None + if ptr: + self._ptr = ptr + self._default = libev.ev_is_default_loop(self._ptr) + else: + c_flags = _flags_to_int(flags) + _check_flags(c_flags) + c_flags |= libev.EVFLAG_NOENV + c_flags |= libev.EVFLAG_FORKCHECK + if default is None: + default = True + if default: + self._default = 1 + self._ptr = libev.gevent_ev_default_loop(c_flags) + if not self._ptr: + raise SystemError("ev_default_loop(%s) failed" % (c_flags, )) + if sys.platform == "win32": + libev.ev_timer_start(self._ptr, &self._periodic_signal_checker) + libev.ev_unref(self._ptr) + else: + self._ptr = libev.ev_loop_new(c_flags) + if not self._ptr: + raise SystemError("ev_loop_new(%s) failed" % (c_flags, )) + if default or __SYSERR_CALLBACK is None: + set_syserr_cb(self._handle_syserr) + + # Mark as not destroyed + libev.ev_set_userdata(self._ptr, self._ptr) + + libev.ev_prepare_start(self._ptr, &self._prepare) + libev.ev_unref(self._ptr) + + def __init__(self, object flags=None, object default=None, libev.intptr_t ptr=0): + self._callbacks = CallbackFIFO() + # See libev.corecffi for this attribute. + self.approx_timer_resolution = 0.00001 + + cdef _run_callbacks(self): + cdef callback cb + cdef object callbacks + cdef int count = CALLBACK_CHECK_COUNT + self.starting_timer_may_update_loop_time = True + cdef libev.ev_tstamp now = libev.ev_now(self._ptr) + cdef libev.ev_tstamp expiration = now + getswitchinterval() + + try: + libev.ev_timer_stop(self._ptr, &self._timer0) + while self._callbacks.head is not None: + cb = self._callbacks.popleft() + + libev.ev_unref(self._ptr) + gevent_call(self, cb) # XXX: Why is this a C callback, not cython? + count -= 1 + + if count == 0 and self._callbacks.head is not None: + # We still have more to run but we've reached + # the end of one check group + count = CALLBACK_CHECK_COUNT + + libev.ev_now_update(self._ptr) + if libev.ev_now(self._ptr) >= expiration: + now = 0 + break + + if now != 0: + libev.ev_now_update(self._ptr) + if self._callbacks.head is not None: + libev.ev_timer_start(self._ptr, &self._timer0) + finally: + self.starting_timer_may_update_loop_time = False + + cdef _stop_watchers(self, libev.ev_loop* ptr): + if not ptr: + return + + if libev.ev_is_active(&self._prepare): + libev.ev_ref(ptr) + libev.ev_prepare_stop(ptr, &self._prepare) + if libev.ev_is_active(&self._periodic_signal_checker): + libev.ev_ref(ptr) + libev.ev_timer_stop(ptr, &self._periodic_signal_checker) + + def destroy(self): + cdef libev.ev_loop* ptr = self._ptr + self._ptr = NULL + + if ptr: + if not libev.ev_userdata(ptr): + # Whoops! Program error. They destroyed the loop, + # using a different loop object. Our _ptr is still + # valid, but the libev loop is gone. Doing anything + # else with it will likely cause a crash. + return + # Mark as destroyed + libev.ev_set_userdata(ptr, NULL) + self._stop_watchers(ptr) + if __SYSERR_CALLBACK == self._handle_syserr: + set_syserr_cb(None) + libev.ev_loop_destroy(ptr) + + def __dealloc__(self): + cdef libev.ev_loop* ptr = self._ptr + self._ptr = NULL + if ptr != NULL: + if not libev.ev_userdata(ptr): + # See destroy(). This is a bug in the caller. + return + self._stop_watchers(ptr) + if not self._default: + libev.ev_loop_destroy(ptr) + # Mark as destroyed + libev.ev_set_userdata(ptr, NULL) + + @property + def ptr(self): + return self._ptr + + @property + def WatcherType(self): + return watcher + + @property + def MAXPRI(self): + return libev.EV_MAXPRI + + @property + def MINPRI(self): + return libev.EV_MINPRI + + def _handle_syserr(self, message, errno): + if sys.version_info[0] >= 3: + message = message.decode() + self.handle_error(None, SystemError, SystemError(message + ': ' + os.strerror(errno)), None) + + cpdef handle_error(self, context, type, value, tb): + cdef object handle_error + cdef object error_handler = self.error_handler + if error_handler is not None: + # we do want to do getattr every time so that setting Hub.handle_error property just works + handle_error = getattr(error_handler, 'handle_error', error_handler) + handle_error(context, type, value, tb) + else: + self._default_handle_error(context, type, value, tb) + + cpdef _default_handle_error(self, context, type, value, tb): + # note: Hub sets its own error handler so this is not used by gevent + # this is here to make core.loop usable without the rest of gevent + traceback.print_exception(type, value, tb) + if self._ptr: + libev.ev_break(self._ptr, libev.EVBREAK_ONE) + + def run(self, nowait=False, once=False): + _check_loop(self) + cdef unsigned int flags = 0 + if nowait: + flags |= libev.EVRUN_NOWAIT + if once: + flags |= libev.EVRUN_ONCE + with nogil: + libev.ev_run(self._ptr, flags) + + def reinit(self): + if self._ptr: + libev.ev_loop_fork(self._ptr) + + def ref(self): + _check_loop(self) + libev.ev_ref(self._ptr) + + def unref(self): + _check_loop(self) + libev.ev_unref(self._ptr) + + def break_(self, int how=libev.EVBREAK_ONE): + _check_loop(self) + libev.ev_break(self._ptr, how) + + def verify(self): + _check_loop(self) + libev.ev_verify(self._ptr) + + cpdef libev.ev_tstamp now(self) except *: + _check_loop(self) + return libev.ev_now(self._ptr) + + cpdef void update_now(self) except *: + _check_loop(self) + libev.ev_now_update(self._ptr) + + update = update_now # Old name, deprecated. + + def __repr__(self): + return '<%s at 0x%x %s>' % (self.__class__.__name__, id(self), self._format()) + + @property + def default(self): + # If we're destroyed, we are not the default loop anymore, + # as far as Python is concerned. + return self._default if self._ptr else False + + @property + def iteration(self): + _check_loop(self) + return libev.ev_iteration(self._ptr) + + @property + def depth(self): + _check_loop(self) + return libev.ev_depth(self._ptr) + + @property + def backend_int(self): + _check_loop(self) + return libev.ev_backend(self._ptr) + + @property + def backend(self): + _check_loop(self) + cdef unsigned int backend = libev.ev_backend(self._ptr) + for key, value in _flags: + if key == backend: + return value + return backend + + @property + def pendingcnt(self): + _check_loop(self) + return libev.ev_pending_count(self._ptr) + + def io(self, libev.vfd_socket_t fd, int events, ref=True, priority=None): + return io(self, fd, events, ref, priority) + + def timer(self, double after, double repeat=0.0, ref=True, priority=None): + return timer(self, after, repeat, ref, priority) + + def signal(self, int signum, ref=True, priority=None): + return signal(self, signum, ref, priority) + + def idle(self, ref=True, priority=None): + return idle(self, ref, priority) + + def prepare(self, ref=True, priority=None): + return prepare(self, ref, priority) + + def check(self, ref=True, priority=None): + return check(self, ref, priority) + + def fork(self, ref=True, priority=None): + return fork(self, ref, priority) + + def async_(self, ref=True, priority=None): + return async_(self, ref, priority) + + # cython doesn't enforce async as a keyword + async = async_ + + def child(self, int pid, bint trace=0, ref=True): + if sys.platform == 'win32': + raise AttributeError("Child watchers are not supported on Windows") + return child(self, pid, trace, ref) + + def install_sigchld(self): + libev.gevent_install_sigchld_handler() + + def reset_sigchld(self): + libev.gevent_reset_sigchld_handler() + + def stat(self, str path, float interval=0.0, ref=True, priority=None): + return stat(self, path, interval, ref, priority) + + def run_callback(self, func, *args): + _check_loop(self) + cdef callback cb = callback(func, args) + self._callbacks.append(cb) + libev.ev_ref(self._ptr) + return cb + + def _format(self): + if not self._ptr: + return 'destroyed' + cdef object msg = self.backend + if self._default: + msg += ' default' + msg += ' pending=%s' % self.pendingcnt + msg += self._format_details() + return msg + + def _format_details(self): + cdef str msg = '' + cdef object fileno = self.fileno() + cdef object activecnt = None + try: + sigfd = self.sigfd + except AttributeError: + sigfd = None + try: + activecnt = self.activecnt + except AttributeError: + pass + if activecnt is not None: + msg += ' ref=' + repr(activecnt) + if fileno is not None: + msg += ' fileno=' + repr(fileno) + return msg + + def fileno(self): + cdef int fd + if self._ptr: + fd = libev.gevent_ev_loop_backend_fd(self._ptr) + if fd >= 0: + return fd + + @property + def activecnt(self): + _check_loop(self) + return libev.gevent_ev_loop_activecnt(self._ptr) + + @property + def sig_pending(self): + _check_loop(self) + return libev.gevent_ev_loop_sig_pending(self._ptr) + + @property + def origflags(self): + return _flags_to_list(self.origflags_int) + + @property + def origflags_int(self): + _check_loop(self) + return libev.gevent_ev_loop_origflags(self._ptr) + + @property + def sigfd(self): + _check_loop(self) + fd = libev.gevent_ev_loop_sigfd(self._ptr) + if fd >= 0: + return fd + + # Explicitly not EV_USE_SIGNALFD + raise AttributeError("sigfd") + +try: + from zope.interface import classImplements +except ImportError: + pass +else: + # XXX: This invokes the side-table lookup, we would + # prefer to have it stored directly on the class. + from gevent._interfaces import ILoop + classImplements(loop, ILoop) + +# about readonly _flags attribute: +# bit #1 set if object owns Python reference to itself (Py_INCREF was +# called and we must call Py_DECREF later) +DEF FLAG_WATCHER_OWNS_PYREF = 1 << 0 # 0x1 +# bit #2 set if ev_unref() was called and we must call ev_ref() later +DEF FLAG_WATCHER_NEEDS_EVREF = 1 << 1 # 0x2 +# bit #3 set if user wants to call ev_unref() before start() +DEF FLAG_WATCHER_UNREF_BEFORE_START = 1 << 2 # 0x4 +# bits 2 and 3 are *both* set when we are active, but the user +# request us not to be ref'd anymore. We unref us (because going active will +# ref us) and then make a note of this in the future +DEF FLAG_WATCHER_MASK_UNREF_NEEDS_REF = 0x6 + + +cdef void _python_incref(watcher self): + if not self._flags & FLAG_WATCHER_OWNS_PYREF: + Py_INCREF(self) + self._flags |= FLAG_WATCHER_OWNS_PYREF + +cdef void _python_decref(watcher self): + if self._flags & FLAG_WATCHER_OWNS_PYREF: + Py_DECREF(self) + self._flags &= ~FLAG_WATCHER_OWNS_PYREF + +cdef void _libev_ref(watcher self): + if self._flags & FLAG_WATCHER_NEEDS_EVREF: + libev.ev_ref(self.loop._ptr) + self._flags &= ~FLAG_WATCHER_NEEDS_EVREF + +cdef void _libev_unref(watcher self): + if self._flags & FLAG_WATCHER_MASK_UNREF_NEEDS_REF == FLAG_WATCHER_UNREF_BEFORE_START: + libev.ev_unref(self.loop._ptr) + self._flags |= FLAG_WATCHER_NEEDS_EVREF + + +ctypedef void (*start_stop_func)(libev.ev_loop*, void*) nogil + +cdef struct start_and_stop: + start_stop_func start + start_stop_func stop + +cdef start_and_stop make_ss(void* start, void* stop): + cdef start_and_stop result = start_and_stop(start, stop) + return result + +cdef bint _watcher_start(watcher self, object callback, tuple args) except -1: + # This method should be called by subclasses of watcher, if they + # override the python-level `start` function: they've already paid + # for argument unpacking, and `start` cannot be cpdef since it + # uses varargs. + + # We keep this as a function, not a cdef method of watcher. + # If it's a cdef method, it could potentially be overridden + # by a subclass, which means that the watcher gains a pointer to a + # function table (vtable), making each object 8 bytes larger. + + _check_loop(self.loop) + if callback is None or not callable(callback): + raise TypeError("Expected callable, not %r" % (callback, )) + self._callback = callback + self.args = args + _libev_unref(self) + _python_incref(self) + self.__ss.start(self.loop._ptr, self.__watcher) + return 1 + +cdef public class watcher [object PyGeventWatcherObject, type PyGeventWatcher_Type]: + """Abstract base class for all the watchers""" + ## pointer members + cdef public loop loop + cdef object _callback + cdef public tuple args + + # By keeping a __watcher cached, the size of the io and timer + # structs becomes 152 bytes and child is 160 and stat is 512 (when + # the start_and_stop is inlined). On 64-bit macOS CPython 2.7. I + # hoped that using libev's data pointer and allocating the + # watchers directly and not as inline members would result in + # overall savings thanks to better padding, but it didn't. And it + # added lots of casts, making the code ugly. + + # Table: + # gevent ver | 1.2 | This | +data + # Watcher Kind | | | + # Timer | 120 | 152 | 160 + # IO | 120 | 152 | 160 + # Child | 128 | 160 | 168 + # Stat | 480 | 512 | 512 + cdef libev.ev_watcher* __watcher + + # By inlining the start_and_stop struct, instead of taking the address + # of a static struct or using the watcher's data pointer, we + # use an additional pointer of memory and incur an additional pointer copy + # on creation. + # But we use fewer pointer accesses for start/stop, and they have + # better cache locality. (Then again, we're bigger). + # Right now we're going for size, so we use the pointer. IO/Timer objects + # are then 144 bytes. + cdef start_and_stop* __ss + + ## Int members + + # Our subclasses will declare the ev_X struct + # as an inline member. This is good for locality, but + # probably bad for alignment, as it will get tacked on + # immediately after our data. + + # But all ev_watchers start with some ints, so maybe we can help that + # out by putting our ints here. + cdef readonly unsigned int _flags + + def __init__(self, loop loop, ref=True, priority=None): + if not self.__watcher or not self.__ss.start or not self.__ss.stop: + raise ValueError("Cannot construct a bare watcher") + self.loop = loop + self._flags = 0 if ref else FLAG_WATCHER_UNREF_BEFORE_START + if priority is not None: + libev.ev_set_priority(self.__watcher, priority) + + @property + def ref(self): + return False if self._flags & 4 else True + + @ref.setter + def ref(self, object value): + _check_loop(self.loop) + if value: + # self.ref should be true after this. + if self.ref: + return # ref is already True + + if self._flags & FLAG_WATCHER_NEEDS_EVREF: # ev_unref was called, undo + libev.ev_ref(self.loop._ptr) + # do not want unref, no outstanding unref + self._flags &= ~FLAG_WATCHER_MASK_UNREF_NEEDS_REF + else: + # self.ref must be false after this + if not self.ref: + return # ref is already False + self._flags |= FLAG_WATCHER_UNREF_BEFORE_START + if not self._flags & FLAG_WATCHER_NEEDS_EVREF and libev.ev_is_active(self.__watcher): + libev.ev_unref(self.loop._ptr) + self._flags |= FLAG_WATCHER_NEEDS_EVREF + + @property + def callback(self): + return self._callback + + @callback.setter + def callback(self, object callback): + if callback is not None and not callable(callback): + raise TypeError("Expected callable, not %r" % (callback, )) + self._callback = callback + + @property + def priority(self): + return libev.ev_priority(self.__watcher) + + @priority.setter + def priority(self, int priority): + cdef libev.ev_watcher* w = self.__watcher + if libev.ev_is_active(w): + raise AttributeError("Cannot set priority of an active watcher") + libev.ev_set_priority(w, priority) + + @property + def active(self): + return True if libev.ev_is_active(self.__watcher) else False + + @property + def pending(self): + return True if libev.ev_is_pending(self.__watcher) else False + + def start(self, object callback, *args): + _watcher_start(self, callback, args) + + def stop(self): + _check_loop(self.loop) + _libev_ref(self) + # The callback cannot possibly fire while we are executing, + # so this is safe. + self._callback = None + self.args = None + self.__ss.stop(self.loop._ptr, self.__watcher) + _python_decref(self) + + def feed(self, int revents, object callback, *args): + _check_loop(self.loop) + self.callback = callback + self.args = args + _libev_unref(self) + libev.ev_feed_event(self.loop._ptr, self.__watcher, revents) + _python_incref(self) + + def __repr__(self): + if Py_ReprEnter(self) != 0: + return "<...>" + try: + format = self._format() + result = "<%s at 0x%x%s" % (self.__class__.__name__, id(self), format) + if self.active: + result += " active" + if self.pending: + result += " pending" + if self.callback is not None: + result += " callback=%r" % (self.callback, ) + if self.args is not None: + result += " args=%r" % (self.args, ) + return result + ">" + finally: + Py_ReprLeave(self) + + def _format(self): + return '' + + def close(self): + self.stop() + + def __enter__(self): + return self + + def __exit__(self, t, v, tb): + self.close() + return + +cdef start_and_stop io_ss = make_ss(libev.ev_io_start, libev.ev_io_stop) + +cdef public class io(watcher) [object PyGeventIOObject, type PyGeventIO_Type]: + + cdef libev.ev_io _watcher + + def start(self, object callback, *args, pass_events=False): + if pass_events: + args = (GEVENT_CORE_EVENTS, ) + args + _watcher_start(self, callback, args) + + def __init__(self, loop loop, libev.vfd_socket_t fd, int events, ref=True, priority=None): + watcher.__init__(self, loop, ref, priority) + + def __cinit__(self, loop loop, libev.vfd_socket_t fd, int events, ref=True, priority=None): + if fd < 0: + raise ValueError('fd must be non-negative: %r' % fd) + if events & ~(libev.EV__IOFDSET | libev.EV_READ | libev.EV_WRITE): + raise ValueError('illegal event mask: %r' % events) + # All the vfd_functions are no-ops on POSIX + cdef int vfd = libev.vfd_open(fd) + libev.ev_io_init(&self._watcher, gevent_callback_io, vfd, events) + self.__watcher = &self._watcher + self.__ss = &io_ss + + def __dealloc__(self): + libev.vfd_free(self._watcher.fd) + + @property + def fd(self): + return libev.vfd_get(self._watcher.fd) + + @fd.setter + def fd(self, long fd): + if libev.ev_is_active(&self._watcher): + raise AttributeError("'io' watcher attribute 'fd' is read-only while watcher is active") + cdef int vfd = libev.vfd_open(fd) + libev.vfd_free(self._watcher.fd) + libev.ev_io_init(&self._watcher, gevent_callback_io, vfd, self._watcher.events) + + @property + def events(self): + return self._watcher.events + + @events.setter + def events(self, int events): + if libev.ev_is_active(&self._watcher): + raise AttributeError("'io' watcher attribute 'events' is read-only while watcher is active") + libev.ev_io_init(&self._watcher, gevent_callback_io, self._watcher.fd, events) + + @property + def events_str(self): + return _events_to_str(self._watcher.events) + + def _format(self): + return ' fd=%s events=%s' % (self.fd, self.events_str) + +cdef start_and_stop timer_ss = make_ss(libev.ev_timer_start, libev.ev_timer_stop) + +cdef public class timer(watcher) [object PyGeventTimerObject, type PyGeventTimer_Type]: + + cdef libev.ev_timer _watcher + + def __cinit__(self, loop loop, double after=0.0, double repeat=0.0, ref=True, priority=None): + if repeat < 0.0: + raise ValueError("repeat must be positive or zero: %r" % repeat) + libev.ev_timer_init(&self._watcher, gevent_callback_timer, after, repeat) + self.__watcher = &self._watcher + self.__ss = &timer_ss + + def __init__(self, loop loop, double after=0.0, double repeat=0.0, ref=True, priority=None): + watcher.__init__(self, loop, ref, priority) + + def start(self, object callback, *args, update=None): + update = update if update is not None else self.loop.starting_timer_may_update_loop_time + if update: + self.loop.update_now() + _watcher_start(self, callback, args) + + @property + def at(self): + return self._watcher.at + + # QQQ: add 'after' and 'repeat' properties? + + def again(self, object callback, *args, update=True): + _check_loop(self.loop) + self.callback = callback + self.args = args + _libev_unref(self) + if update: + libev.ev_now_update(self.loop._ptr) + libev.ev_timer_again(self.loop._ptr, &self._watcher) + _python_incref(self) + + + +cdef start_and_stop signal_ss = make_ss(libev.ev_signal_start, libev.ev_signal_stop) + +cdef public class signal(watcher) [object PyGeventSignalObject, type PyGeventSignal_Type]: + + cdef libev.ev_signal _watcher + + def __cinit__(self, loop loop, int signalnum, ref=True, priority=None): + if signalnum < 1 or signalnum >= signalmodule.NSIG: + raise ValueError('illegal signal number: %r' % signalnum) + # still possible to crash on one of libev's asserts: + # 1) "libev: ev_signal_start called with illegal signal number" + # EV_NSIG might be different from signal.NSIG on some platforms + # 2) "libev: a signal must not be attached to two different loops" + # we probably could check that in LIBEV_EMBED mode, but not in general + libev.ev_signal_init(&self._watcher, gevent_callback_signal, signalnum) + self.__watcher = &self._watcher + self.__ss = &signal_ss + + def __init__(self, loop loop, int signalnum, ref=True, priority=None): + watcher.__init__(self, loop, ref, priority) + + + +cdef start_and_stop idle_ss = make_ss(libev.ev_idle_start, libev.ev_idle_stop) + +cdef public class idle(watcher) [object PyGeventIdleObject, type PyGeventIdle_Type]: + + cdef libev.ev_idle _watcher + + def __cinit__(self, loop loop, ref=True, priority=None): + libev.ev_idle_init(&self._watcher, gevent_callback_idle) + self.__watcher = &self._watcher + self.__ss = &idle_ss + + + +cdef start_and_stop prepare_ss = make_ss(libev.ev_prepare_start, libev.ev_prepare_stop) + +cdef public class prepare(watcher) [object PyGeventPrepareObject, type PyGeventPrepare_Type]: + + cdef libev.ev_prepare _watcher + + def __cinit__(self, loop loop, ref=True, priority=None): + libev.ev_prepare_init(&self._watcher, gevent_callback_prepare) + self.__watcher = &self._watcher + self.__ss = &prepare_ss + + + +cdef start_and_stop check_ss = make_ss(libev.ev_check_start, libev.ev_check_stop) + +cdef public class check(watcher) [object PyGeventCheckObject, type PyGeventCheck_Type]: + + cdef libev.ev_check _watcher + + def __cinit__(self, loop loop, ref=True, priority=None): + libev.ev_check_init(&self._watcher, gevent_callback_check) + self.__watcher = &self._watcher + self.__ss = &check_ss + + + +cdef start_and_stop fork_ss = make_ss(libev.ev_fork_start, libev.ev_fork_stop) + +cdef public class fork(watcher) [object PyGeventForkObject, type PyGeventFork_Type]: + + cdef libev.ev_fork _watcher + + def __cinit__(self, loop loop, ref=True, priority=None): + libev.ev_fork_init(&self._watcher, gevent_callback_fork) + self.__watcher = &self._watcher + self.__ss = &fork_ss + + +cdef start_and_stop async_ss = make_ss(libev.ev_async_start, libev.ev_async_stop) + +cdef public class async_(watcher) [object PyGeventAsyncObject, type PyGeventAsync_Type]: + + cdef libev.ev_async _watcher + + @property + def pending(self): + # Note the use of ev_async_pending instead of ev_is_pending + return True if libev.ev_async_pending(&self._watcher) else False + + def __cinit__(self, loop loop, ref=True, priority=None): + libev.ev_async_init(&self._watcher, gevent_callback_async) + self.__watcher = &self._watcher + self.__ss = &async_ss + + + def send(self): + _check_loop(self.loop) + libev.ev_async_send(self.loop._ptr, &self._watcher) + +async = async_ + +cdef start_and_stop child_ss = make_ss(libev.ev_child_start, libev.ev_child_stop) + +cdef public class child(watcher) [object PyGeventChildObject, type PyGeventChild_Type]: + + cdef libev.ev_child _watcher + + def __cinit__(self, loop loop, int pid, bint trace=0, ref=True): + if sys.platform == 'win32': + raise AttributeError("Child watchers are not supported on Windows") + if not loop.default: + raise TypeError('child watchers are only available on the default loop') + libev.gevent_install_sigchld_handler() + libev.ev_child_init(&self._watcher, gevent_callback_child, pid, trace) + self.__watcher = &self._watcher + self.__ss = &child_ss + + def __init__(self, loop loop, int pid, bint trace=0, ref=True): + watcher.__init__(self, loop, ref, None) + + + def _format(self): + return ' pid=%r rstatus=%r' % (self.pid, self.rstatus) + + @property + def pid(self): + return self._watcher.pid + + @property + def rpid(self): + return self._watcher.rpid + + @rpid.setter + def rpid(self, int value): + self._watcher.rpid = value + + @property + def rstatus(self): + return self._watcher.rstatus + + @rstatus.setter + def rstatus(self, int value): + self._watcher.rstatus = value + +cdef start_and_stop stat_ss = make_ss(libev.ev_stat_start, libev.ev_stat_stop) + +cdef public class stat(watcher) [object PyGeventStatObject, type PyGeventStat_Type]: + + cdef libev.ev_stat _watcher + cdef readonly str path + cdef readonly bytes _paths + + def __cinit__(self, loop loop, str path, float interval=0.0, ref=True, priority=None): + self.path = path + cdef bytes paths + if isinstance(path, unicode): + # the famous Python3 filesystem encoding debacle hits us here. Can we do better? + # We must keep a reference to the encoded string so that its bytes don't get freed + # and overwritten, leading to strange errors from libev ("no such file or directory") + paths = (path).encode(sys.getfilesystemencoding()) + self._paths = paths + else: + paths = path + self._paths = paths + libev.ev_stat_init(&self._watcher, gevent_callback_stat, paths, interval) + self.__watcher = &self._watcher + self.__ss = &stat_ss + + def __init__(self, loop loop, str path, float interval=0.0, ref=True, priority=None): + watcher.__init__(self, loop, ref, priority) + + + @property + def attr(self): + if not self._watcher.attr.st_nlink: + return + return _pystat_fromstructstat(&self._watcher.attr) + + @property + def prev(self): + if not self._watcher.prev.st_nlink: + return + return _pystat_fromstructstat(&self._watcher.prev) + + @property + def interval(self): + return self._watcher.interval + + + +__SYSERR_CALLBACK = None + + +cdef void _syserr_cb(char* msg) with gil: + try: + __SYSERR_CALLBACK(msg, errno) + except: + set_syserr_cb(None) + print_exc = getattr(traceback, 'print_exc', None) + if print_exc is not None: + print_exc() + + +cpdef set_syserr_cb(callback): + global __SYSERR_CALLBACK + if callback is None: + libev.ev_set_syserr_cb(NULL) + __SYSERR_CALLBACK = None + elif callable(callback): + libev.ev_set_syserr_cb(_syserr_cb) + __SYSERR_CALLBACK = callback + else: + raise TypeError('Expected callable or None, got %r' % (callback, )) + + + +LIBEV_EMBED = bool(libev.LIBEV_EMBED) +EV_USE_FLOOR = libev.EV_USE_FLOOR +EV_USE_CLOCK_SYSCALL = libev.EV_USE_CLOCK_SYSCALL +EV_USE_REALTIME = libev.EV_USE_REALTIME +EV_USE_MONOTONIC = libev.EV_USE_MONOTONIC +EV_USE_NANOSLEEP = libev.EV_USE_NANOSLEEP +EV_USE_INOTIFY = libev.EV_USE_INOTIFY +EV_USE_SIGNALFD = libev.EV_USE_SIGNALFD +EV_USE_EVENTFD = libev.EV_USE_EVENTFD +EV_USE_4HEAP = libev.EV_USE_4HEAP + +# Things used in callbacks.c + +from cpython cimport PyErr_Fetch +from cpython cimport PyObject + +cdef public void gevent_handle_error(loop loop, object context): + cdef PyObject* typep + cdef PyObject* valuep + cdef PyObject* tracebackp + + cdef object type + cdef object value = None + cdef object traceback = None + cdef object result + + # If it was set, this will clear it, and we will own + # the references. + PyErr_Fetch(&typep, &valuep, &tracebackp) + # TODO: Should we call PyErr_Normalize? There's code in + # Hub.handle_error that works around what looks like an + # unnormalized exception. + + if not typep: + return + # This assignment will do a Py_INCREF + # on the value. We already own the reference + # returned from PyErr_Fetch, + # so we must decref immediately + type = typep + Py_DECREF(type) + + if valuep: + value = valuep + Py_DECREF(value) + if tracebackp: + traceback = tracebackp + Py_DECREF(traceback) + + # If this method fails by raising an exception, + # cython will print it for us because we don't return a + # Python object and we don't declare an `except` clause. + loop.handle_error(context, type, value, traceback) + +cdef public tuple _empty_tuple = () + +cdef public object gevent_loop_run_callbacks(loop loop): + return loop._run_callbacks() diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/libev/corecffi.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/libev/corecffi.py new file mode 100644 index 00000000..51701c43 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/libev/corecffi.py @@ -0,0 +1,427 @@ +# pylint: disable=too-many-lines, protected-access, redefined-outer-name, not-callable +# pylint: disable=no-member +from __future__ import absolute_import, print_function +import sys + +# pylint: disable=undefined-all-variable +__all__ = [ + 'get_version', + 'get_header_version', + 'supported_backends', + 'recommended_backends', + 'embeddable_backends', + 'time', + 'loop', +] + +from gevent._util import implementer +from gevent._interfaces import ILoop + +from gevent.libev import _corecffi # pylint:disable=no-name-in-module,import-error + +ffi = _corecffi.ffi # pylint:disable=no-member +libev = _corecffi.lib # pylint:disable=no-member + +if hasattr(libev, 'vfd_open'): + # Must be on windows + assert sys.platform.startswith("win"), "vfd functions only needed on windows" + vfd_open = libev.vfd_open + vfd_free = libev.vfd_free + vfd_get = libev.vfd_get +else: + vfd_open = vfd_free = vfd_get = lambda fd: fd + +##### +## NOTE on Windows: +# The C implementation does several things specially for Windows; +# a possibly incomplete list is: +# +# - the loop runs a periodic signal checker; +# - the io watcher constructor is different and it has a destructor; +# - the child watcher is not defined +# +# The CFFI implementation does none of these things, and so +# is possibly NOT FUNCTIONALLY CORRECT on Win32 +##### + + +from gevent._ffi.loop import AbstractCallbacks +from gevent._ffi.loop import assign_standard_callbacks + +class _Callbacks(AbstractCallbacks): + # pylint:disable=arguments-differ + + def python_check_callback(self, _loop, watcher_ptr, _events): + pass + + def python_prepare_callback(self, _loop_ptr, watcher_ptr, _events): + AbstractCallbacks.python_prepare_callback(self, watcher_ptr) + + def _find_loop_from_c_watcher(self, watcher_ptr): + loop_handle = ffi.cast('struct ev_watcher*', watcher_ptr).data + return self.from_handle(loop_handle) + +_callbacks = assign_standard_callbacks(ffi, libev, _Callbacks) + + +UNDEF = libev.EV_UNDEF +NONE = libev.EV_NONE +READ = libev.EV_READ +WRITE = libev.EV_WRITE +TIMER = libev.EV_TIMER +PERIODIC = libev.EV_PERIODIC +SIGNAL = libev.EV_SIGNAL +CHILD = libev.EV_CHILD +STAT = libev.EV_STAT +IDLE = libev.EV_IDLE +PREPARE = libev.EV_PREPARE +CHECK = libev.EV_CHECK +EMBED = libev.EV_EMBED +FORK = libev.EV_FORK +CLEANUP = libev.EV_CLEANUP +ASYNC = libev.EV_ASYNC +CUSTOM = libev.EV_CUSTOM +ERROR = libev.EV_ERROR + +READWRITE = libev.EV_READ | libev.EV_WRITE + +MINPRI = libev.EV_MINPRI +MAXPRI = libev.EV_MAXPRI + +BACKEND_PORT = libev.EVBACKEND_PORT +BACKEND_KQUEUE = libev.EVBACKEND_KQUEUE +BACKEND_EPOLL = libev.EVBACKEND_EPOLL +BACKEND_POLL = libev.EVBACKEND_POLL +BACKEND_SELECT = libev.EVBACKEND_SELECT +FORKCHECK = libev.EVFLAG_FORKCHECK +NOINOTIFY = libev.EVFLAG_NOINOTIFY +SIGNALFD = libev.EVFLAG_SIGNALFD +NOSIGMASK = libev.EVFLAG_NOSIGMASK + + +from gevent._ffi.loop import EVENTS +GEVENT_CORE_EVENTS = EVENTS + + +def get_version(): + return 'libev-%d.%02d' % (libev.ev_version_major(), libev.ev_version_minor()) + + +def get_header_version(): + return 'libev-%d.%02d' % (libev.EV_VERSION_MAJOR, libev.EV_VERSION_MINOR) + +_flags = [(libev.EVBACKEND_PORT, 'port'), + (libev.EVBACKEND_KQUEUE, 'kqueue'), + (libev.EVBACKEND_EPOLL, 'epoll'), + (libev.EVBACKEND_POLL, 'poll'), + (libev.EVBACKEND_SELECT, 'select'), + (libev.EVFLAG_NOENV, 'noenv'), + (libev.EVFLAG_FORKCHECK, 'forkcheck'), + (libev.EVFLAG_SIGNALFD, 'signalfd'), + (libev.EVFLAG_NOSIGMASK, 'nosigmask')] + +_flags_str2int = dict((string, flag) for (flag, string) in _flags) + + + +def _flags_to_list(flags): + result = [] + for code, value in _flags: + if flags & code: + result.append(value) + flags &= ~code + if not flags: + break + if flags: + result.append(flags) + return result + +if sys.version_info[0] >= 3: + basestring = (bytes, str) + integer_types = (int,) +else: + import __builtin__ # pylint:disable=import-error + basestring = (__builtin__.basestring,) + integer_types = (int, __builtin__.long) + + +def _flags_to_int(flags): + # Note, that order does not matter, libev has its own predefined order + if not flags: + return 0 + if isinstance(flags, integer_types): + return flags + result = 0 + try: + if isinstance(flags, basestring): + flags = flags.split(',') + for value in flags: + value = value.strip().lower() + if value: + result |= _flags_str2int[value] + except KeyError as ex: + raise ValueError('Invalid backend or flag: %s\nPossible values: %s' % (ex, ', '.join(sorted(_flags_str2int.keys())))) + return result + + +def _str_hex(flag): + if isinstance(flag, integer_types): + return hex(flag) + return str(flag) + + +def _check_flags(flags): + as_list = [] + flags &= libev.EVBACKEND_MASK + if not flags: + return + if not flags & libev.EVBACKEND_ALL: + raise ValueError('Invalid value for backend: 0x%x' % flags) + if not flags & libev.ev_supported_backends(): + as_list = [_str_hex(x) for x in _flags_to_list(flags)] + raise ValueError('Unsupported backend: %s' % '|'.join(as_list)) + + +def supported_backends(): + return _flags_to_list(libev.ev_supported_backends()) + + +def recommended_backends(): + return _flags_to_list(libev.ev_recommended_backends()) + + +def embeddable_backends(): + return _flags_to_list(libev.ev_embeddable_backends()) + + +def time(): + return libev.ev_time() + +from gevent._ffi.loop import AbstractLoop + + +from gevent.libev import watcher as _watchers +_events_to_str = _watchers._events_to_str # exported + + +@implementer(ILoop) +class loop(AbstractLoop): + # pylint:disable=too-many-public-methods + + # libuv parameters simply won't accept anything lower than 1ms + # (0.001s), but libev takes fractional seconds. In practice, on + # one machine, libev can sleep for very small periods of time: + # + # sleep(0.00001) -> 0.000024 + # sleep(0.0001) -> 0.000156 + # sleep(0.001) -> 0.00136 (which is comparable to libuv) + + approx_timer_resolution = 0.00001 + + error_handler = None + + _CHECK_POINTER = 'struct ev_check *' + + _PREPARE_POINTER = 'struct ev_prepare *' + + _TIMER_POINTER = 'struct ev_timer *' + + def __init__(self, flags=None, default=None): + AbstractLoop.__init__(self, ffi, libev, _watchers, flags, default) + self._default = bool(libev.ev_is_default_loop(self._ptr)) + + def _init_loop(self, flags, default): + c_flags = _flags_to_int(flags) + _check_flags(c_flags) + c_flags |= libev.EVFLAG_NOENV + c_flags |= libev.EVFLAG_FORKCHECK + if default is None: + default = True + if default: + ptr = libev.gevent_ev_default_loop(c_flags) + if not ptr: + raise SystemError("ev_default_loop(%s) failed" % (c_flags, )) + else: + ptr = libev.ev_loop_new(c_flags) + if not ptr: + raise SystemError("ev_loop_new(%s) failed" % (c_flags, )) + if default or globals()["__SYSERR_CALLBACK"] is None: + set_syserr_cb(self._handle_syserr) + + # Mark this loop as being used. + libev.ev_set_userdata(ptr, ptr) + return ptr + + def _init_and_start_check(self): + libev.ev_check_init(self._check, libev.python_check_callback) + self._check.data = self._handle_to_self + libev.ev_check_start(self._ptr, self._check) + self.unref() + + def _init_and_start_prepare(self): + libev.ev_prepare_init(self._prepare, libev.python_prepare_callback) + libev.ev_prepare_start(self._ptr, self._prepare) + self.unref() + + def _init_callback_timer(self): + libev.ev_timer_init(self._timer0, libev.gevent_noop, 0.0, 0.0) + + def _stop_callback_timer(self): + libev.ev_timer_stop(self._ptr, self._timer0) + + def _start_callback_timer(self): + libev.ev_timer_start(self._ptr, self._timer0) + + def _stop_aux_watchers(self): + if libev.ev_is_active(self._prepare): + self.ref() + libev.ev_prepare_stop(self._ptr, self._prepare) + if libev.ev_is_active(self._check): + self.ref() + libev.ev_check_stop(self._ptr, self._check) + if libev.ev_is_active(self._timer0): + libev.ev_timer_stop(self._timer0) + + def _setup_for_run_callback(self): + self.ref() # we should go through the loop now + + def destroy(self): + if self._ptr: + super(loop, self).destroy() + # pylint:disable=comparison-with-callable + if globals()["__SYSERR_CALLBACK"] == self._handle_syserr: + set_syserr_cb(None) + + + def _can_destroy_loop(self, ptr): + # Is it marked as destroyed? + return libev.ev_userdata(ptr) + + def _destroy_loop(self, ptr): + # Mark as destroyed. + libev.ev_set_userdata(ptr, ffi.NULL) + libev.ev_loop_destroy(ptr) + + libev.gevent_zero_prepare(self._prepare) + libev.gevent_zero_check(self._check) + libev.gevent_zero_timer(self._timer0) + + del self._prepare + del self._check + del self._timer0 + + + @property + def MAXPRI(self): + return libev.EV_MAXPRI + + @property + def MINPRI(self): + return libev.EV_MINPRI + + def _default_handle_error(self, context, type, value, tb): # pylint:disable=unused-argument + super(loop, self)._default_handle_error(context, type, value, tb) + libev.ev_break(self._ptr, libev.EVBREAK_ONE) + + def run(self, nowait=False, once=False): + flags = 0 + if nowait: + flags |= libev.EVRUN_NOWAIT + if once: + flags |= libev.EVRUN_ONCE + + libev.ev_run(self._ptr, flags) + + def reinit(self): + libev.ev_loop_fork(self._ptr) + + def ref(self): + libev.ev_ref(self._ptr) + + def unref(self): + libev.ev_unref(self._ptr) + + def break_(self, how=libev.EVBREAK_ONE): + libev.ev_break(self._ptr, how) + + def verify(self): + libev.ev_verify(self._ptr) + + def now(self): + return libev.ev_now(self._ptr) + + def update_now(self): + libev.ev_now_update(self._ptr) + + def __repr__(self): + return '<%s at 0x%x %s>' % (self.__class__.__name__, id(self), self._format()) + + @property + def iteration(self): + return libev.ev_iteration(self._ptr) + + @property + def depth(self): + return libev.ev_depth(self._ptr) + + @property + def backend_int(self): + return libev.ev_backend(self._ptr) + + @property + def backend(self): + backend = libev.ev_backend(self._ptr) + for key, value in _flags: + if key == backend: + return value + return backend + + @property + def pendingcnt(self): + return libev.ev_pending_count(self._ptr) + + if sys.platform != "win32": + + def install_sigchld(self): + libev.gevent_install_sigchld_handler() + + def reset_sigchld(self): + libev.gevent_reset_sigchld_handler() + + def fileno(self): + if self._ptr: + fd = self._ptr.backend_fd + if fd >= 0: + return fd + + @property + def activecnt(self): + if not self._ptr: + raise ValueError('operation on destroyed loop') + return self._ptr.activecnt + + +@ffi.def_extern() +def _syserr_cb(msg): + try: + msg = ffi.string(msg) + __SYSERR_CALLBACK(msg, ffi.errno) + except: + set_syserr_cb(None) + raise # let cffi print the traceback + + +def set_syserr_cb(callback): + global __SYSERR_CALLBACK + if callback is None: + libev.ev_set_syserr_cb(ffi.NULL) + __SYSERR_CALLBACK = None + elif callable(callback): + libev.ev_set_syserr_cb(libev._syserr_cb) + __SYSERR_CALLBACK = callback + else: + raise TypeError('Expected callable or None, got %r' % (callback, )) + +__SYSERR_CALLBACK = None + +LIBEV_EMBED = True diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/libev/libev.h b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/libev/libev.h new file mode 100644 index 00000000..66959d9b --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/libev/libev.h @@ -0,0 +1,100 @@ +#if defined(LIBEV_EMBED) +#include "ev.c" +#undef LIBEV_EMBED +#define LIBEV_EMBED 1 +#define gevent_ev_loop_origflags(loop) ((loop)->origflags) +#define gevent_ev_loop_sig_pending(loop) ((loop))->sig_pending +#define gevent_ev_loop_backend_fd(loop) ((loop))->backend_fd +#define gevent_ev_loop_activecnt(loop) ((loop))->activecnt +#if EV_USE_SIGNALFD +#define gevent_ev_loop_sigfd(loop) ((loop))->sigfd +#else +#define gevent_ev_loop_sigfd(loop) -1 +#endif /* !EV_USE_SIGNALFD */ +#else /* !LIBEV_EMBED */ +#include "ev.h" + +#define gevent_ev_loop_origflags(loop) -1 +#define gevent_ev_loop_sig_pending(loop) -1 +#define gevent_ev_loop_backend_fd(loop) -1 +#define gevent_ev_loop_activecnt(loop) -1 +#define gevent_ev_loop_sigfd(loop) -1 + +#define LIBEV_EMBED 0 +#define EV_USE_FLOOR -1 +#define EV_USE_CLOCK_SYSCALL -1 +#define EV_USE_REALTIME -1 +#define EV_USE_MONOTONIC -1 +#define EV_USE_NANOSLEEP -1 +#define EV_USE_INOTIFY -1 +#define EV_USE_SIGNALFD -1 +#define EV_USE_EVENTFD -1 +#define EV_USE_4HEAP -1 + + +#ifndef _WIN32 +#include +#endif /* !_WIN32 */ + +#endif /* LIBEV_EMBED */ + +#ifndef _WIN32 + +static struct sigaction libev_sigchld; +/* + * Track the state of whether we have installed + * the libev sigchld handler specifically. + * If it's non-zero, libev_sigchld will be valid and set to the action + * that libev needs to do. + * If it's 1, we need to install libev_sigchld to make libev + * child handlers work (on request). + */ +static int sigchld_state = 0; + +static struct ev_loop* gevent_ev_default_loop(unsigned int flags) +{ + struct ev_loop* result; + struct sigaction tmp; + + if (sigchld_state) + return ev_default_loop(flags); + + // Request the old SIGCHLD handler + sigaction(SIGCHLD, NULL, &tmp); + // Get the loop, which will install a SIGCHLD handler + result = ev_default_loop(flags); + // XXX what if SIGCHLD received there? + // Now restore the previous SIGCHLD handler + sigaction(SIGCHLD, &tmp, &libev_sigchld); + sigchld_state = 1; + return result; +} + + +static void gevent_install_sigchld_handler(void) { + if (sigchld_state == 1) { + sigaction(SIGCHLD, &libev_sigchld, NULL); + sigchld_state = 2; + } +} + +static void gevent_reset_sigchld_handler(void) { + // We could have any state at this point, depending on + // whether the default loop has been used. If it has, + // then always be in state 1 ("need to install) + if (sigchld_state) { + sigchld_state = 1; + } +} + +#else /* !_WIN32 */ + +#define gevent_ev_default_loop ev_default_loop +static void gevent_install_sigchld_handler(void) { } +static void gevent_reset_sigchld_handler(void) { } + +// Fake child functions that we can link to. +static void ev_child_start(struct ev_loop* loop, ev_child* w) {}; +static void ev_child_stop(struct ev_loop* loop, ev_child* w) {}; + +#endif /* _WIN32 */ diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/libev/libev.pxd b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/libev/libev.pxd new file mode 100644 index 00000000..e3be5259 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/libev/libev.pxd @@ -0,0 +1,235 @@ +# From cython/includes/libc/stdint.pxd +# Longness only used for type promotion. +# Actual compile time size used for conversions. +# We don't have stdint.h on visual studio 9.0 (2008) on windows, sigh, +# so go with Py_ssize_t +# ssize_t -> intptr_t + +cdef extern from "libev_vfd.h": +# cython doesn't process pre-processor directives, so they +# don't matter in this file. It just takes the last definition it sees. + ctypedef Py_ssize_t intptr_t + ctypedef intptr_t vfd_socket_t + + vfd_socket_t vfd_get(int) + int vfd_open(long) except -1 + void vfd_free(int) + +cdef extern from "libev.h" nogil: + int LIBEV_EMBED + int EV_MINPRI + int EV_MAXPRI + + int EV_VERSION_MAJOR + int EV_VERSION_MINOR + + int EV_USE_FLOOR + int EV_USE_CLOCK_SYSCALL + int EV_USE_REALTIME + int EV_USE_MONOTONIC + int EV_USE_NANOSLEEP + int EV_USE_SELECT + int EV_USE_POLL + int EV_USE_EPOLL + int EV_USE_KQUEUE + int EV_USE_PORT + int EV_USE_INOTIFY + int EV_USE_SIGNALFD + int EV_USE_EVENTFD + int EV_USE_4HEAP + int EV_USE_IOCP + int EV_SELECT_IS_WINSOCKET + + int EV_UNDEF + int EV_NONE + int EV_READ + int EV_WRITE + int EV__IOFDSET + int EV_TIMER + int EV_PERIODIC + int EV_SIGNAL + int EV_CHILD + int EV_STAT + int EV_IDLE + int EV_PREPARE + int EV_CHECK + int EV_EMBED + int EV_FORK + int EV_CLEANUP + int EV_ASYNC + int EV_CUSTOM + int EV_ERROR + + int EVFLAG_AUTO + int EVFLAG_NOENV + int EVFLAG_FORKCHECK + int EVFLAG_NOINOTIFY + int EVFLAG_SIGNALFD + int EVFLAG_NOSIGMASK + + int EVBACKEND_SELECT + int EVBACKEND_POLL + int EVBACKEND_EPOLL + int EVBACKEND_KQUEUE + int EVBACKEND_DEVPOLL + int EVBACKEND_PORT + int EVBACKEND_IOCP + int EVBACKEND_ALL + int EVBACKEND_MASK + + int EVRUN_NOWAIT + int EVRUN_ONCE + + int EVBREAK_CANCEL + int EVBREAK_ONE + int EVBREAK_ALL + + struct ev_loop: + int activecnt + int sig_pending + int backend_fd + int sigfd + unsigned int origflags + + struct ev_watcher: + void* data; + + struct ev_io: + int fd + int events + + struct ev_timer: + double at + + struct ev_signal: + pass + + struct ev_idle: + pass + + struct ev_prepare: + pass + + struct ev_check: + pass + + struct ev_fork: + pass + + struct ev_async: + pass + + struct ev_child: + int pid + int rpid + int rstatus + + struct stat: + int st_nlink + + struct ev_stat: + stat attr + stat prev + double interval + + union ev_any_watcher: + ev_watcher w + ev_io io + ev_timer timer + ev_signal signal + ev_idle idle + + int ev_version_major() + int ev_version_minor() + + unsigned int ev_supported_backends() + unsigned int ev_recommended_backends() + unsigned int ev_embeddable_backends() + + ctypedef double ev_tstamp + + ev_tstamp ev_time() + void ev_set_syserr_cb(void *) + + int ev_priority(void*) + void ev_set_priority(void*, int) + + int ev_is_pending(void*) + int ev_is_active(void*) + void ev_io_init(ev_io*, void* callback, int fd, int events) + void ev_io_start(ev_loop*, ev_io*) + void ev_io_stop(ev_loop*, ev_io*) + void ev_feed_event(ev_loop*, void*, int) + + void ev_timer_init(ev_timer*, void* callback, double, double) + void ev_timer_start(ev_loop*, ev_timer*) + void ev_timer_stop(ev_loop*, ev_timer*) + void ev_timer_again(ev_loop*, ev_timer*) + + void ev_signal_init(ev_signal*, void* callback, int) + void ev_signal_start(ev_loop*, ev_signal*) + void ev_signal_stop(ev_loop*, ev_signal*) + + void ev_idle_init(ev_idle*, void* callback) + void ev_idle_start(ev_loop*, ev_idle*) + void ev_idle_stop(ev_loop*, ev_idle*) + + void ev_prepare_init(ev_prepare*, void* callback) + void ev_prepare_start(ev_loop*, ev_prepare*) + void ev_prepare_stop(ev_loop*, ev_prepare*) + + void ev_check_init(ev_check*, void* callback) + void ev_check_start(ev_loop*, ev_check*) + void ev_check_stop(ev_loop*, ev_check*) + + void ev_fork_init(ev_fork*, void* callback) + void ev_fork_start(ev_loop*, ev_fork*) + void ev_fork_stop(ev_loop*, ev_fork*) + + void ev_async_init(ev_async*, void* callback) + void ev_async_start(ev_loop*, ev_async*) + void ev_async_stop(ev_loop*, ev_async*) + void ev_async_send(ev_loop*, ev_async*) + int ev_async_pending(ev_async*) + + void ev_child_init(ev_child*, void* callback, int, int) + void ev_child_start(ev_loop*, ev_child*) + void ev_child_stop(ev_loop*, ev_child*) + + void ev_stat_init(ev_stat*, void* callback, char*, double) + void ev_stat_start(ev_loop*, ev_stat*) + void ev_stat_stop(ev_loop*, ev_stat*) + + ev_loop* ev_default_loop(unsigned int flags) + ev_loop* ev_loop_new(unsigned int flags) + void* ev_userdata(ev_loop*) + void ev_set_userdata(ev_loop*, void*) + void ev_loop_destroy(ev_loop*) + void ev_loop_fork(ev_loop*) + int ev_is_default_loop(ev_loop*) + unsigned int ev_iteration(ev_loop*) + unsigned int ev_depth(ev_loop*) + unsigned int ev_backend(ev_loop*) + void ev_verify(ev_loop*) + void ev_run(ev_loop*, int flags) nogil + + ev_tstamp ev_now(ev_loop*) + void ev_now_update(ev_loop*) + + void ev_ref(ev_loop*) + void ev_unref(ev_loop*) + void ev_break(ev_loop*, int) + unsigned int ev_pending_count(ev_loop*) + + # gevent extra functions. These are defined in libev.h. + ev_loop* gevent_ev_default_loop(unsigned int flags) + void gevent_install_sigchld_handler() + void gevent_reset_sigchld_handler() + + # These compensate for lack of access to ev_loop struct definition + # when LIBEV_EMBED is false. + unsigned int gevent_ev_loop_origflags(ev_loop*); + int gevent_ev_loop_sig_pending(ev_loop*); + int gevent_ev_loop_backend_fd(ev_loop*); + int gevent_ev_loop_activecnt(ev_loop*); + int gevent_ev_loop_sigfd(ev_loop*); diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/libev/libev_vfd.h b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/libev/libev_vfd.h new file mode 100644 index 00000000..ff30fd8d --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/libev/libev_vfd.h @@ -0,0 +1,225 @@ +#ifdef _WIN32 +/* see discussion in the libuv directory: this is a SOCKET which is a + HANDLE which is a PVOID (even though they're really small ints), + and CPython and PyPy return that SOCKET cast to an int from + fileno() +*/ +typedef intptr_t vfd_socket_t; +#define vfd_socket_object PyLong_FromLongLong + +#ifdef LIBEV_EMBED +/* + * If libev on win32 is embedded, then we can use an + * arbitrary mapping between integer fds and OS + * handles. Then by defining special macros libev + * will use our functions. + */ + +#define WIN32_LEAN_AND_MEAN +#include +#include + +typedef struct vfd_entry_t +{ + vfd_socket_t handle; /* OS handle, i.e. SOCKET */ + int count; /* Reference count, 0 if free */ + int next; /* Next free fd, -1 if last */ +} vfd_entry; + +#define VFD_INCREMENT 128 +static int vfd_num = 0; /* num allocated fds */ +static int vfd_max = 0; /* max allocated fds */ +static int vfd_next = -1; /* next free fd for reuse */ +static PyObject* vfd_map = NULL; /* map OS handle -> virtual fd */ +static vfd_entry* vfd_entries = NULL; /* list of virtual fd entries */ + +#ifdef WITH_THREAD +static CRITICAL_SECTION* volatile vfd_lock = NULL; +static CRITICAL_SECTION* vfd_make_lock() +{ + if (vfd_lock == NULL) { + /* must use malloc and not PyMem_Malloc here */ + CRITICAL_SECTION* lock = malloc(sizeof(CRITICAL_SECTION)); + InitializeCriticalSection(lock); + if (InterlockedCompareExchangePointer(&vfd_lock, lock, NULL) != NULL) { + /* another thread initialized lock first */ + DeleteCriticalSection(lock); + free(lock); + } + } + return vfd_lock; +} +#define VFD_LOCK_ENTER EnterCriticalSection(vfd_make_lock()) +#define VFD_LOCK_LEAVE LeaveCriticalSection(vfd_lock) +#define VFD_GIL_DECLARE PyGILState_STATE ___save +#define VFD_GIL_ENSURE ___save = PyGILState_Ensure() +#define VFD_GIL_RELEASE PyGILState_Release(___save) +#else /* ! WITH_THREAD */ +#define VFD_LOCK_ENTER +#define VFD_LOCK_LEAVE +#define VFD_GIL_DECLARE +#define VFD_GIL_ENSURE +#define VFD_GIL_RELEASE +#endif /*_WITH_THREAD */ + +/* + * Given a virtual fd returns an OS handle or -1 + * This function is speed critical, so it cannot use GIL + */ +static vfd_socket_t vfd_get(int fd) +{ + vfd_socket_t handle = -1; + VFD_LOCK_ENTER; + if (vfd_entries != NULL && fd >= 0 && fd < vfd_num) + handle = vfd_entries[fd].handle; + VFD_LOCK_LEAVE; + return handle; +} + +#define EV_FD_TO_WIN32_HANDLE(fd) vfd_get((fd)) + +/* + * Given an OS handle finds or allocates a virtual fd + * Returns -1 on failure and sets Python exception if pyexc is non-zero + */ +static int vfd_open_(vfd_socket_t handle, int pyexc) +{ + VFD_GIL_DECLARE; + int fd = -1; + unsigned long arg; + PyObject* key = NULL; + PyObject* value; + + if (!pyexc) { + VFD_GIL_ENSURE; + } + if (ioctlsocket(handle, FIONREAD, &arg) != 0) { + if (pyexc) + PyErr_Format(PyExc_IOError, +#ifdef _WIN64 + "%lld is not a socket (files are not supported)", +#else + "%ld is not a socket (files are not supported)", +#endif + handle); + goto done; + } + if (vfd_map == NULL) { + vfd_map = PyDict_New(); + if (vfd_map == NULL) + goto done; + } + key = vfd_socket_object(handle); + /* check if it's already in the dict */ + value = PyDict_GetItem(vfd_map, key); + if (value != NULL) { + /* is it safe to use PyInt_AS_LONG(value) here? */ + fd = PyInt_AsLong(value); + if (fd >= 0) { + ++vfd_entries[fd].count; + goto done; + } + } + /* use the free entry, if available */ + if (vfd_next >= 0) { + fd = vfd_next; + vfd_next = vfd_entries[fd].next; + VFD_LOCK_ENTER; + goto allocated; + } + /* check if it would be out of bounds */ + if (vfd_num >= FD_SETSIZE) { + /* libev's select doesn't support more that FD_SETSIZE fds */ + if (pyexc) + PyErr_Format(PyExc_IOError, "cannot watch more than %d sockets", (int)FD_SETSIZE); + goto done; + } + /* allocate more space if needed */ + VFD_LOCK_ENTER; + if (vfd_num >= vfd_max) { + int newsize = vfd_max + VFD_INCREMENT; + vfd_entry* entries = PyMem_Realloc(vfd_entries, sizeof(vfd_entry) * newsize); + if (entries == NULL) { + VFD_LOCK_LEAVE; + if (pyexc) + PyErr_NoMemory(); + goto done; + } + vfd_entries = entries; + vfd_max = newsize; + } + fd = vfd_num++; +allocated: + /* vfd_lock must be acquired when entering here */ + vfd_entries[fd].handle = handle; + vfd_entries[fd].count = 1; + VFD_LOCK_LEAVE; + value = PyInt_FromLong(fd); + PyDict_SetItem(vfd_map, key, value); + Py_DECREF(value); +done: + Py_XDECREF(key); + if (!pyexc) { + VFD_GIL_RELEASE; + } + return fd; +} + +#define vfd_open(fd) vfd_open_((fd), 1) +#define EV_WIN32_HANDLE_TO_FD(handle) vfd_open_((handle), 0) + +static void vfd_free_(int fd, int needclose) +{ + VFD_GIL_DECLARE; + PyObject* key; + + if (needclose) { + VFD_GIL_ENSURE; + } + if (fd < 0 || fd >= vfd_num) + goto done; /* out of bounds */ + if (vfd_entries[fd].count <= 0) + goto done; /* free entry, ignore */ + if (!--vfd_entries[fd].count) { + /* fd has just been freed */ + vfd_socket_t handle = vfd_entries[fd].handle; + vfd_entries[fd].handle = -1; + vfd_entries[fd].next = vfd_next; + vfd_next = fd; + if (needclose) + closesocket(handle); + /* vfd_map is assumed to be != NULL */ + key = vfd_socket_object(handle); + PyDict_DelItem(vfd_map, key); + Py_DECREF(key); + } +done: + if (needclose) { + VFD_GIL_RELEASE; + } +} + +#define vfd_free(fd) vfd_free_((fd), 0) +#define EV_WIN32_CLOSE_FD(fd) vfd_free_((fd), 1) + +#else /* !LIBEV_EMBED */ +/* + * If libev on win32 is not embedded in gevent, then + * the only way to map vfds is to use the default of + * using runtime fds in libev. Note that it will leak + * fds, because there's no way of closing them safely + */ +#define vfd_get(fd) _get_osfhandle((fd)) +#define vfd_open(fd) _open_osfhandle((fd), 0) +#define vfd_free(fd) +#endif /* LIBEV_EMBED */ + +#else /* !_WIN32 */ +/* + * On non-win32 platforms vfd_* are noop macros + */ +typedef int vfd_socket_t; +#define vfd_get(fd) (fd) +#define vfd_open(fd) (fd) +#define vfd_free(fd) +#endif /* _WIN32 */ diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/libev/stathelper.c b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/libev/stathelper.c new file mode 100644 index 00000000..1a70b550 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/libev/stathelper.c @@ -0,0 +1,187 @@ +/* copied from Python-2.7.2/Modules/posixmodule.c */ +#include "structseq.h" + +#define STRUCT_STAT struct stat + +#ifdef HAVE_STRUCT_STAT_ST_BLKSIZE +#define ST_BLKSIZE_IDX 13 +#else +#define ST_BLKSIZE_IDX 12 +#endif + +#ifdef HAVE_STRUCT_STAT_ST_BLOCKS +#define ST_BLOCKS_IDX (ST_BLKSIZE_IDX+1) +#else +#define ST_BLOCKS_IDX ST_BLKSIZE_IDX +#endif + +#ifdef HAVE_STRUCT_STAT_ST_RDEV +#define ST_RDEV_IDX (ST_BLOCKS_IDX+1) +#else +#define ST_RDEV_IDX ST_BLOCKS_IDX +#endif + +#ifdef HAVE_STRUCT_STAT_ST_FLAGS +#define ST_FLAGS_IDX (ST_RDEV_IDX+1) +#else +#define ST_FLAGS_IDX ST_RDEV_IDX +#endif + +#ifdef HAVE_STRUCT_STAT_ST_GEN +#define ST_GEN_IDX (ST_FLAGS_IDX+1) +#else +#define ST_GEN_IDX ST_FLAGS_IDX +#endif + +#ifdef HAVE_STRUCT_STAT_ST_BIRTHTIME +#define ST_BIRTHTIME_IDX (ST_GEN_IDX+1) +#else +#define ST_BIRTHTIME_IDX ST_GEN_IDX +#endif + + + +static PyObject* posixmodule = NULL; +static PyTypeObject* pStatResultType = NULL; + + +static PyObject* import_posixmodule(void) +{ + if (!posixmodule) { + posixmodule = PyImport_ImportModule("posix"); + } + return posixmodule; +} + + +static PyObject* import_StatResultType(void) +{ + PyObject* p = NULL; + if (!pStatResultType) { + PyObject* module; + module = import_posixmodule(); + if (module) { + p = PyObject_GetAttrString(module, "stat_result"); + } + } + return p; +} + +static void +fill_time(PyObject *v, int index, time_t sec, unsigned long nsec) +{ + PyObject *fval,*ival; +#if SIZEOF_TIME_T > SIZEOF_LONG + ival = PyLong_FromLongLong((PY_LONG_LONG)sec); +#else + ival = PyInt_FromLong((long)sec); +#endif + if (!ival) + return; + fval = PyFloat_FromDouble(sec + 1e-9*nsec); + PyStructSequence_SET_ITEM(v, index, ival); + PyStructSequence_SET_ITEM(v, index+3, fval); +} + +/* pack a system stat C structure into the Python stat tuple + (used by posix_stat() and posix_fstat()) */ +static PyObject* +_pystat_fromstructstat(STRUCT_STAT *st) +{ + unsigned long ansec, mnsec, cnsec; + PyObject *v; + + PyTypeObject* StatResultType = (PyTypeObject*)import_StatResultType(); + if (StatResultType == NULL) { + return NULL; + } + + v = PyStructSequence_New(StatResultType); + if (v == NULL) + return NULL; + + PyStructSequence_SET_ITEM(v, 0, PyInt_FromLong((long)st->st_mode)); +#ifdef HAVE_LARGEFILE_SUPPORT + PyStructSequence_SET_ITEM(v, 1, + PyLong_FromLongLong((PY_LONG_LONG)st->st_ino)); +#else + PyStructSequence_SET_ITEM(v, 1, PyInt_FromLong((long)st->st_ino)); +#endif +#if defined(HAVE_LONG_LONG) && !defined(MS_WINDOWS) + PyStructSequence_SET_ITEM(v, 2, + PyLong_FromLongLong((PY_LONG_LONG)st->st_dev)); +#else + PyStructSequence_SET_ITEM(v, 2, PyInt_FromLong((long)st->st_dev)); +#endif + PyStructSequence_SET_ITEM(v, 3, PyInt_FromLong((long)st->st_nlink)); + PyStructSequence_SET_ITEM(v, 4, PyInt_FromLong((long)st->st_uid)); + PyStructSequence_SET_ITEM(v, 5, PyInt_FromLong((long)st->st_gid)); +#ifdef HAVE_LARGEFILE_SUPPORT + PyStructSequence_SET_ITEM(v, 6, + PyLong_FromLongLong((PY_LONG_LONG)st->st_size)); +#else + PyStructSequence_SET_ITEM(v, 6, PyInt_FromLong(st->st_size)); +#endif + +#if defined(HAVE_STAT_TV_NSEC) + ansec = st->st_atim.tv_nsec; + mnsec = st->st_mtim.tv_nsec; + cnsec = st->st_ctim.tv_nsec; +#elif defined(HAVE_STAT_TV_NSEC2) + ansec = st->st_atimespec.tv_nsec; + mnsec = st->st_mtimespec.tv_nsec; + cnsec = st->st_ctimespec.tv_nsec; +#elif defined(HAVE_STAT_NSEC) + ansec = st->st_atime_nsec; + mnsec = st->st_mtime_nsec; + cnsec = st->st_ctime_nsec; +#else + ansec = mnsec = cnsec = 0; +#endif + fill_time(v, 7, st->st_atime, ansec); + fill_time(v, 8, st->st_mtime, mnsec); + fill_time(v, 9, st->st_ctime, cnsec); + +#ifdef HAVE_STRUCT_STAT_ST_BLKSIZE + PyStructSequence_SET_ITEM(v, ST_BLKSIZE_IDX, + PyInt_FromLong((long)st->st_blksize)); +#endif +#ifdef HAVE_STRUCT_STAT_ST_BLOCKS + PyStructSequence_SET_ITEM(v, ST_BLOCKS_IDX, + PyInt_FromLong((long)st->st_blocks)); +#endif +#ifdef HAVE_STRUCT_STAT_ST_RDEV + PyStructSequence_SET_ITEM(v, ST_RDEV_IDX, + PyInt_FromLong((long)st->st_rdev)); +#endif +#ifdef HAVE_STRUCT_STAT_ST_GEN + PyStructSequence_SET_ITEM(v, ST_GEN_IDX, + PyInt_FromLong((long)st->st_gen)); +#endif +#ifdef HAVE_STRUCT_STAT_ST_BIRTHTIME + { + PyObject *val; + unsigned long bsec,bnsec; + bsec = (long)st->st_birthtime; +#ifdef HAVE_STAT_TV_NSEC2 + bnsec = st->st_birthtimespec.tv_nsec; +#else + bnsec = 0; +#endif + val = PyFloat_FromDouble(bsec + 1e-9*bnsec); + PyStructSequence_SET_ITEM(v, ST_BIRTHTIME_IDX, + val); + } +#endif +#ifdef HAVE_STRUCT_STAT_ST_FLAGS + PyStructSequence_SET_ITEM(v, ST_FLAGS_IDX, + PyInt_FromLong((long)st->st_flags)); +#endif + + if (PyErr_Occurred()) { + Py_DECREF(v); + return NULL; + } + + return v; +} diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/libev/watcher.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/libev/watcher.py new file mode 100644 index 00000000..74db0c13 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/libev/watcher.py @@ -0,0 +1,286 @@ +# pylint: disable=too-many-lines, protected-access, redefined-outer-name, not-callable +# pylint: disable=no-member +from __future__ import absolute_import, print_function +import sys + +from gevent.libev import _corecffi # pylint:disable=no-name-in-module,import-error + +# Nothing public here +__all__ = [] + + +ffi = _corecffi.ffi # pylint:disable=no-member +libev = _corecffi.lib # pylint:disable=no-member + +if hasattr(libev, 'vfd_open'): + # Must be on windows + assert sys.platform.startswith("win"), "vfd functions only needed on windows" + vfd_open = libev.vfd_open + vfd_free = libev.vfd_free + vfd_get = libev.vfd_get +else: + vfd_open = vfd_free = vfd_get = lambda fd: fd + +##### +## NOTE on Windows: +# The C implementation does several things specially for Windows; +# a possibly incomplete list is: +# +# - the loop runs a periodic signal checker; +# - the io watcher constructor is different and it has a destructor; +# - the child watcher is not defined +# +# The CFFI implementation does none of these things, and so +# is possibly NOT FUNCTIONALLY CORRECT on Win32 +##### +_NOARGS = () +_events = [(libev.EV_READ, 'READ'), + (libev.EV_WRITE, 'WRITE'), + (libev.EV__IOFDSET, '_IOFDSET'), + (libev.EV_PERIODIC, 'PERIODIC'), + (libev.EV_SIGNAL, 'SIGNAL'), + (libev.EV_CHILD, 'CHILD'), + (libev.EV_STAT, 'STAT'), + (libev.EV_IDLE, 'IDLE'), + (libev.EV_PREPARE, 'PREPARE'), + (libev.EV_CHECK, 'CHECK'), + (libev.EV_EMBED, 'EMBED'), + (libev.EV_FORK, 'FORK'), + (libev.EV_CLEANUP, 'CLEANUP'), + (libev.EV_ASYNC, 'ASYNC'), + (libev.EV_CUSTOM, 'CUSTOM'), + (libev.EV_ERROR, 'ERROR')] + +from gevent._ffi import watcher as _base + +def _events_to_str(events): + return _base.events_to_str(events, _events) + + + +class watcher(_base.watcher): + _FFI = ffi + _LIB = libev + _watcher_prefix = 'ev' + + # Flags is a bitfield with the following meaning: + # 0000 -> default, referenced (when active) + # 0010 -> ev_unref has been called + # 0100 -> not referenced; independent of 0010 + _flags = 0 + + def __init__(self, _loop, ref=True, priority=None, args=_base._NOARGS): + if ref: + self._flags = 0 + else: + self._flags = 4 + + super(watcher, self).__init__(_loop, ref=ref, priority=priority, args=args) + + def _watcher_ffi_set_priority(self, priority): + libev.ev_set_priority(self._watcher, priority) + + def _watcher_ffi_init(self, args): + self._watcher_init(self._watcher, + self._watcher_callback, + *args) + + def _watcher_ffi_start(self): + self._watcher_start(self.loop._ptr, self._watcher) + + def _watcher_ffi_ref(self): + if self._flags & 2: # we've told libev we're not referenced + self.loop.ref() + self._flags &= ~2 + + def _watcher_ffi_unref(self): + if self._flags & 6 == 4: + # We're not referenced, but we haven't told libev that + self.loop.unref() + self._flags |= 2 # now we've told libev + + def _get_ref(self): + return not self._flags & 4 + + def _set_ref(self, value): + if value: + if not self._flags & 4: + return # ref is already True + if self._flags & 2: # ev_unref was called, undo + self.loop.ref() + self._flags &= ~6 # do not want unref, no outstanding unref + else: + if self._flags & 4: + return # ref is already False + self._flags |= 4 # we're not referenced + if not self._flags & 2 and libev.ev_is_active(self._watcher): + # we haven't told libev we're not referenced, but it thinks we're + # active so we need to undo that + self.loop.unref() + self._flags |= 2 # libev knows we're not referenced + + ref = property(_get_ref, _set_ref) + + + def _get_priority(self): + return libev.ev_priority(self._watcher) + + @_base.not_while_active + def _set_priority(self, priority): + libev.ev_set_priority(self._watcher, priority) + + priority = property(_get_priority, _set_priority) + + def feed(self, revents, callback, *args): + self.callback = callback + self.args = args or _NOARGS + if self._flags & 6 == 4: + self.loop.unref() + self._flags |= 2 + libev.ev_feed_event(self.loop._ptr, self._watcher, revents) + if not self._flags & 1: + # Py_INCREF(self) + self._flags |= 1 + + @property + def pending(self): + return bool(self._watcher and libev.ev_is_pending(self._watcher)) + + +class io(_base.IoMixin, watcher): + + EVENT_MASK = libev.EV__IOFDSET | libev.EV_READ | libev.EV_WRITE + + def _get_fd(self): + return vfd_get(self._watcher.fd) + + @_base.not_while_active + def _set_fd(self, fd): + vfd = vfd_open(fd) + vfd_free(self._watcher.fd) + self._watcher_init(self._watcher, self._watcher_callback, vfd, self._watcher.events) + + fd = property(_get_fd, _set_fd) + + def _get_events(self): + return self._watcher.events + + @_base.not_while_active + def _set_events(self, events): + self._watcher_init(self._watcher, self._watcher_callback, self._watcher.fd, events) + + events = property(_get_events, _set_events) + + @property + def events_str(self): + return _events_to_str(self._watcher.events) + + def _format(self): + return ' fd=%s events=%s' % (self.fd, self.events_str) + + +class timer(_base.TimerMixin, watcher): + + @property + def at(self): + return self._watcher.at + + def again(self, callback, *args, **kw): + # Exactly the same as start(), just with a different initializer + # function + self._watcher_start = libev.ev_timer_again + try: + self.start(callback, *args, **kw) + finally: + del self._watcher_start + + +class signal(_base.SignalMixin, watcher): + pass + +class idle(_base.IdleMixin, watcher): + pass + +class prepare(_base.PrepareMixin, watcher): + pass + +class check(_base.CheckMixin, watcher): + pass + +class fork(_base.ForkMixin, watcher): + pass + + +class async_(_base.AsyncMixin, watcher): + + def send(self): + libev.ev_async_send(self.loop._ptr, self._watcher) + + @property + def pending(self): + return bool(libev.ev_async_pending(self._watcher)) + +# Provide BWC for those that have async +locals()['async'] = async_ + +class _ClosedWatcher(object): + __slots__ = ('pid', 'rpid', 'rstatus') + + def __init__(self, other): + self.pid = other.pid + self.rpid = other.rpid + self.rstatus = other.rstatus + + def __bool__(self): + return False + __nonzero__ = __bool__ + +class child(_base.ChildMixin, watcher): + _watcher_type = 'child' + + def close(self): + # Capture the properties we defer to our _watcher, because + # we're about to discard it. + closed_watcher = _ClosedWatcher(self._watcher) + super(child, self).close() + self._watcher = closed_watcher + + @property + def pid(self): + return self._watcher.pid + + @property + def rpid(self): + return self._watcher.rpid + + @rpid.setter + def rpid(self, value): + self._watcher.rpid = value + + @property + def rstatus(self): + return self._watcher.rstatus + + @rstatus.setter + def rstatus(self, value): + self._watcher.rstatus = value + + +class stat(_base.StatMixin, watcher): + _watcher_type = 'stat' + + @property + def attr(self): + if not self._watcher.attr.st_nlink: + return + return self._watcher.attr + + @property + def prev(self): + if not self._watcher.prev.st_nlink: + return + return self._watcher.prev + + @property + def interval(self): + return self._watcher.interval diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/libuv/__init__.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/libuv/__init__.py new file mode 100644 index 00000000..412d64ce --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/libuv/__init__.py @@ -0,0 +1,7 @@ +# -*- coding: utf-8 -*- +from __future__ import absolute_import +from __future__ import division +from __future__ import print_function + +# Nothing public here +__all__ = [] diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/libuv/_corecffi.cp37-win32.pyd b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/libuv/_corecffi.cp37-win32.pyd new file mode 100644 index 0000000000000000000000000000000000000000..82d89a3b0bbc03400bb5877498bd3710d583ece5 GIT binary patch literal 128000 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 sXM8#>qzS#LH +#include "uv.h" + +typedef void* GeventWatcherObject; + +static int python_callback(GeventWatcherObject handle, int revents); +static void python_queue_callback(uv_handle_t* watcher_ptr, int revents); +static void python_handle_error(GeventWatcherObject handle, int revents); +static void python_stop(GeventWatcherObject handle); + +static void _gevent_noop(void* handle) {} + +static void (*gevent_noop)(void* handle) = &_gevent_noop; + +static void _gevent_generic_callback1_unused(uv_handle_t* watcher, int arg) +{ + // Python code may set this to NULL or even change it + // out from under us, which would tend to break things. + GeventWatcherObject handle = watcher->data; + const int cb_result = python_callback(handle, arg); + switch(cb_result) { + case -1: + // in case of exception, call self.loop.handle_error; + // this function is also responsible for stopping the watcher + // and allowing memory to be freed + python_handle_error(handle, arg); + break; + case 1: + // Code to stop the event IF NEEDED. Note that if python_callback + // has disposed of the last reference to the handle, + // `watcher` could now be invalid/disposed memory! + if (!uv_is_active(watcher)) { + if (watcher->data != handle) { + if (watcher->data) { + // If Python set the data to NULL, then they + // expected to be stopped. That's fine. + // Otherwise, something weird happened. + fprintf(stderr, + "WARNING: gevent: watcher handle changed in callback " + "from %p to %p for watcher at %p of type %d\n", + handle, watcher->data, watcher, watcher->type); + // There's a very good chance that the object the + // handle referred to has been changed and/or the + // old handle has been deallocated (most common), so + // passing the old handle will crash. Instead we + // pass a sigil to let python distinguish this case. + python_stop(NULL); + } + } + else { + python_stop(handle); + } + } + break; + case 2: + // watcher is already stopped and dead, nothing to do. + break; + default: + fprintf(stderr, + "WARNING: gevent: Unexpected return value %d from Python callback " + "for watcher %p (of type %d) and handle %p\n", + cb_result, + watcher, watcher->type, handle); + // XXX: Possible leaking of resources here? Should we be + // closing the watcher? + } +} + + +static void _gevent_generic_callback1(uv_handle_t* watcher, int arg) +{ + python_queue_callback(watcher, arg); +} + +static void _gevent_generic_callback0(uv_handle_t* handle) +{ + _gevent_generic_callback1(handle, 0); +} + +static void _gevent_async_callback0(uv_async_t* handle) +{ + _gevent_generic_callback0((uv_handle_t*)handle); +} + +static void _gevent_timer_callback0(uv_timer_t* handle) +{ + _gevent_generic_callback0((uv_handle_t*)handle); +} + +static void _gevent_prepare_callback0(uv_prepare_t* handle) +{ + _gevent_generic_callback0((uv_handle_t*)handle); +} + +static void _gevent_check_callback0(uv_check_t* handle) +{ + _gevent_generic_callback0((uv_handle_t*)handle); +} + +static void _gevent_idle_callback0(uv_idle_t* handle) +{ + _gevent_generic_callback0((uv_handle_t*)handle); +} + +static void _gevent_signal_callback1(uv_signal_t* handle, int signum) +{ + _gevent_generic_callback1((uv_handle_t*)handle, signum); +} + + +static void _gevent_poll_callback2(void* handle, int status, int events) +{ + _gevent_generic_callback1(handle, status < 0 ? status : events); +} + +static void _gevent_fs_event_callback3(void* handle, const char* filename, int events, int status) +{ + _gevent_generic_callback1(handle, status < 0 ? status : events); +} + + +typedef struct _gevent_fs_poll_s { + uv_fs_poll_t handle; + uv_stat_t curr; + uv_stat_t prev; +} gevent_fs_poll_t; + +static void _gevent_fs_poll_callback3(void* handlep, int status, const uv_stat_t* prev, const uv_stat_t* curr) +{ + // stat pointers are valid for this callback only. + // if given, copy them into our structure, where they can be reached + // from python, just like libev's watcher does, before calling + // the callback. + + // The callback is invoked with status < 0 if path does not exist + // or is inaccessible. The watcher is not stopped but your + // callback is not called again until something changes (e.g. when + // the file is created or the error reason changes). + // In that case the fields will be 0 in curr/prev. + + + gevent_fs_poll_t* handle = (gevent_fs_poll_t*)handlep; + assert(status == 0); + + handle->curr = *curr; + handle->prev = *prev; + + _gevent_generic_callback1((uv_handle_t*)handle, 0); +} + +static void gevent_uv_walk_callback_close(uv_handle_t* handle, void* arg) +{ + if( handle && !uv_is_closing(handle) ) { + uv_close(handle, NULL); + } +} + +static void gevent_close_all_handles(uv_loop_t* loop) +{ + uv_walk(loop, gevent_uv_walk_callback_close, NULL); +} + +static void gevent_zero_timer(uv_timer_t* handle) +{ + memset(handle, 0, sizeof(uv_timer_t)); +} + +static void gevent_zero_check(uv_check_t* handle) +{ + memset(handle, 0, sizeof(uv_check_t)); +} + +static void gevent_zero_prepare(uv_prepare_t* handle) +{ + memset(handle, 0, sizeof(uv_prepare_t)); +} + +static void gevent_zero_loop(uv_loop_t* handle) +{ + memset(handle, 0, sizeof(uv_loop_t)); +} diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/libuv/loop.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/libuv/loop.py new file mode 100644 index 00000000..5f7ff815 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/libuv/loop.py @@ -0,0 +1,602 @@ +""" +libuv loop implementation +""" +# pylint: disable=no-member +from __future__ import absolute_import, print_function + +import os +from collections import defaultdict +from collections import namedtuple +from operator import delitem +import signal + +from gevent._ffi import _dbg # pylint: disable=unused-import +from gevent._ffi.loop import AbstractLoop +from gevent.libuv import _corecffi # pylint:disable=no-name-in-module,import-error +from gevent._ffi.loop import assign_standard_callbacks +from gevent._ffi.loop import AbstractCallbacks +from gevent._util import implementer +from gevent._interfaces import ILoop + +ffi = _corecffi.ffi +libuv = _corecffi.lib + +__all__ = [ +] + + +class _Callbacks(AbstractCallbacks): + + def _find_loop_from_c_watcher(self, watcher_ptr): + loop_handle = ffi.cast('uv_handle_t*', watcher_ptr).data + return self.from_handle(loop_handle) if loop_handle else None + + def python_sigchld_callback(self, watcher_ptr, _signum): + self.from_handle(ffi.cast('uv_handle_t*', watcher_ptr).data)._sigchld_callback() + + def python_timer0_callback(self, watcher_ptr): + return self.python_prepare_callback(watcher_ptr) + + def python_queue_callback(self, watcher_ptr, revents): + watcher_handle = watcher_ptr.data + the_watcher = self.from_handle(watcher_handle) + + the_watcher.loop._queue_callback(watcher_ptr, revents) + + +_callbacks = assign_standard_callbacks( + ffi, libuv, _Callbacks, + [('python_sigchld_callback', None), + ('python_timer0_callback', None), + ('python_queue_callback', None)]) + +from gevent._ffi.loop import EVENTS +GEVENT_CORE_EVENTS = EVENTS # export + +from gevent.libuv import watcher as _watchers # pylint:disable=no-name-in-module + +_events_to_str = _watchers._events_to_str # export + +READ = libuv.UV_READABLE +WRITE = libuv.UV_WRITABLE + +def get_version(): + uv_bytes = ffi.string(libuv.uv_version_string()) + if not isinstance(uv_bytes, str): + # Py3 + uv_str = uv_bytes.decode("ascii") + else: + uv_str = uv_bytes + + return 'libuv-' + uv_str + +def get_header_version(): + return 'libuv-%d.%d.%d' % (libuv.UV_VERSION_MAJOR, libuv.UV_VERSION_MINOR, libuv.UV_VERSION_PATCH) + +def supported_backends(): + return ['default'] + +@implementer(ILoop) +class loop(AbstractLoop): + + # libuv parameters simply won't accept anything lower than 1ms. In + # practice, looping on gevent.sleep(0.001) takes about 0.00138 s + # (+- 0.000036s) + approx_timer_resolution = 0.001 # 1ms + + error_handler = None + + _CHECK_POINTER = 'uv_check_t *' + + _PREPARE_POINTER = 'uv_prepare_t *' + _PREPARE_CALLBACK_SIG = "void(*)(void*)" + + _TIMER_POINTER = _CHECK_POINTER # This is poorly named. It's for the callback "timer" + + def __init__(self, flags=None, default=None): + AbstractLoop.__init__(self, ffi, libuv, _watchers, flags, default) + self.__loop_pid = os.getpid() + self._child_watchers = defaultdict(list) + self._io_watchers = dict() + self._fork_watchers = set() + self._pid = os.getpid() + self._default = self._ptr == libuv.uv_default_loop() + self._queued_callbacks = [] + + def _queue_callback(self, watcher_ptr, revents): + self._queued_callbacks.append((watcher_ptr, revents)) + + def _init_loop(self, flags, default): + if default is None: + default = True + # Unlike libev, libuv creates a new default + # loop automatically if the old default loop was + # closed. + + if default: + # XXX: If the default loop had been destroyed, this + # will create a new one, but we won't destroy it + ptr = libuv.uv_default_loop() + else: + ptr = libuv.uv_loop_new() + + + if not ptr: + raise SystemError("Failed to get loop") + + # Track whether or not any object has destroyed + # this loop. See _can_destroy_default_loop + ptr.data = ptr + return ptr + + _signal_idle = None + + def _init_and_start_check(self): + libuv.uv_check_init(self._ptr, self._check) + libuv.uv_check_start(self._check, libuv.python_check_callback) + libuv.uv_unref(self._check) + + # We also have to have an idle watcher to be able to handle + # signals in a timely manner. Without them, libuv won't loop again + # and call into its check and prepare handlers. + # Note that this basically forces us into a busy-loop + # XXX: As predicted, using an idle watcher causes our process + # to eat 100% CPU time. We instead use a timer with a max of a .3 second + # delay to notice signals. Note that this timeout also implements fork + # watchers, effectively. + + # XXX: Perhaps we could optimize this to notice when there are other + # timers in the loop and start/stop it then. When we have a callback + # scheduled, this should also be the same and unnecessary? + # libev does takes this basic approach on Windows. + self._signal_idle = ffi.new("uv_timer_t*") + libuv.uv_timer_init(self._ptr, self._signal_idle) + self._signal_idle.data = self._handle_to_self + sig_cb = ffi.cast('void(*)(uv_timer_t*)', libuv.python_check_callback) + libuv.uv_timer_start(self._signal_idle, + sig_cb, + 300, + 300) + libuv.uv_unref(self._signal_idle) + + def _run_callbacks(self): + # Manually handle fork watchers. + curpid = os.getpid() + if curpid != self._pid: + self._pid = curpid + for watcher in self._fork_watchers: + watcher._on_fork() + + + # The contents of queued_callbacks at this point should be timers + # that expired when the loop began along with any idle watchers. + # We need to run them so that any manual callbacks they want to schedule + # get added to the list and ran next before we go on to poll for IO. + # This is critical for libuv on linux: closing a socket schedules some manual + # callbacks to actually stop the watcher; if those don't run before + # we poll for IO, then libuv can abort the process for the closed file descriptor. + + # XXX: There's still a race condition here because we may not run *all* the manual + # callbacks. We need a way to prioritize those. + + # Running these before the manual callbacks lead to some + # random test failures. In test__event.TestEvent_SetThenClear + # we would get a LoopExit sometimes. The problem occurred when + # a timer expired on entering the first loop; we would process + # it there, and then process the callback that it created + # below, leaving nothing for the loop to do. Having the + # self.run() manually process manual callbacks before + # continuing solves the problem. (But we must still run callbacks + # here again.) + self._prepare_ran_callbacks = self.__run_queued_callbacks() + + super(loop, self)._run_callbacks() + + def _init_and_start_prepare(self): + libuv.uv_prepare_init(self._ptr, self._prepare) + libuv.uv_prepare_start(self._prepare, libuv.python_prepare_callback) + libuv.uv_unref(self._prepare) + + def _init_callback_timer(self): + libuv.uv_check_init(self._ptr, self._timer0) + + def _stop_callback_timer(self): + libuv.uv_check_stop(self._timer0) + + def _start_callback_timer(self): + # The purpose of the callback timer is to ensure that we run + # callbacks as soon as possible on the next iteration of the event loop. + + # In libev, we set a 0 duration timer with a no-op callback. + # This executes immediately *after* the IO poll is done (it + # actually determines the time that the IO poll will block + # for), so having the timer present simply spins the loop, and + # our normal prepare watcher kicks in to run the callbacks. + + # In libuv, however, timers are run *first*, before prepare + # callbacks and before polling for IO. So a no-op 0 duration + # timer actually does *nothing*. (Also note that libev queues all + # watchers found during IO poll to run at the end (I think), while libuv + # runs them in uv__io_poll itself.) + + # From the loop inside uv_run: + # while True: + # uv__update_time(loop); + # uv__run_timers(loop); + # # we don't use pending watchers. They are how libuv + # # implements the pipe/udp/tcp streams. + # ran_pending = uv__run_pending(loop); + # uv__run_idle(loop); + # uv__run_prepare(loop); + # ... + # uv__io_poll(loop, timeout); # <--- IO watchers run here! + # uv__run_check(loop); + + # libev looks something like this (pseudo code because the real code is + # hard to read): + # + # do { + # run_fork_callbacks(); + # run_prepare_callbacks(); + # timeout = min(time of all timers or normal block time) + # io_poll() # <--- Only queues IO callbacks + # update_now(); calculate_expired_timers(); + # run callbacks in this order: (although specificying priorities changes it) + # check + # stat + # child + # signal + # timer + # io + # } + + # So instead of running a no-op and letting the side-effect of spinning + # the loop run the callbacks, we must explicitly run them here. + + # If we don't, test__systemerror:TestCallback will be flaky, failing + # one time out of ~20, depending on timing. + + # To get them to run immediately after this current loop, + # we use a check watcher, instead of a 0 duration timer entirely. + # If we use a 0 duration timer, we can get stuck in a timer loop. + # Python 3.6 fails in test_ftplib.py + + # As a final note, if we have not yet entered the loop *at + # all*, and a timer was created with a duration shorter than + # the amount of time it took for us to enter the loop in the + # first place, it may expire and get called before our callback + # does. This could also lead to test__systemerror:TestCallback + # appearing to be flaky. + + # As yet another final note, if we are currently running a + # timer callback, meaning we're inside uv__run_timers() in C, + # and the Python starts a new timer, if the Python code then + # update's the loop's time, it's possible that timer will + # expire *and be run in the same iteration of the loop*. This + # is trivial to do: In sequential code, anything after + # `gevent.sleep(0.1)` is running in a timer callback. Starting + # a new timer---e.g., another gevent.sleep() call---will + # update the time, *before* uv__run_timers exits, meaning + # other timers get a chance to run before our check or prepare + # watcher callbacks do. Therefore, we do indeed have to have a 0 + # timer to run callbacks---it gets inserted before any other user + # timers---ideally, this should be especially careful about how much time + # it runs for. + + # AND YET: We can't actually do that. We get timeouts that I haven't fully + # investigated if we do. Probably stuck in a timer loop. + + # As a partial remedy to this, unlike libev, our timer watcher + # class doesn't update the loop time by default. + + libuv.uv_check_start(self._timer0, libuv.python_timer0_callback) + + + def _stop_aux_watchers(self): + assert self._prepare + assert self._check + assert self._signal_idle + libuv.uv_prepare_stop(self._prepare) + libuv.uv_ref(self._prepare) # Why are we doing this? + + libuv.uv_check_stop(self._check) + libuv.uv_ref(self._check) + + libuv.uv_timer_stop(self._signal_idle) + libuv.uv_ref(self._signal_idle) + + libuv.uv_check_stop(self._timer0) + + def _setup_for_run_callback(self): + self._start_callback_timer() + libuv.uv_ref(self._timer0) + + + def _can_destroy_loop(self, ptr): + # We're being asked to destroy a loop that's, + # at the time it was constructed, was the default loop. + # If loop objects were constructed more than once, + # it may have already been destroyed, though. + # We track this in the data member. + return ptr.data + + def _destroy_loop(self, ptr): + ptr.data = ffi.NULL + libuv.uv_stop(ptr) + + libuv.gevent_close_all_handles(ptr) + + closed_failed = libuv.uv_loop_close(ptr) + if closed_failed: + assert closed_failed == libuv.UV_EBUSY + # We already closed all the handles. Run the loop + # once to let them be cut off from the loop. + ran_has_more_callbacks = libuv.uv_run(ptr, libuv.UV_RUN_ONCE) + if ran_has_more_callbacks: + libuv.uv_run(ptr, libuv.UV_RUN_NOWAIT) + closed_failed = libuv.uv_loop_close(ptr) + assert closed_failed == 0, closed_failed + + # Destroy the native resources *after* we have closed + # the loop. If we do it before, walking the handles + # attached to the loop is likely to segfault. + + libuv.gevent_zero_check(self._check) + libuv.gevent_zero_check(self._timer0) + libuv.gevent_zero_prepare(self._prepare) + libuv.gevent_zero_timer(self._signal_idle) + del self._check + del self._prepare + del self._signal_idle + del self._timer0 + + libuv.gevent_zero_loop(ptr) + + # Destroy any watchers we're still holding on to. + del self._io_watchers + del self._fork_watchers + del self._child_watchers + + + def debug(self): + """ + Return all the handles that are open and their ref status. + """ + handle_state = namedtuple("HandleState", + ['handle', + 'type', + 'watcher', + 'ref', + 'active', + 'closing']) + handles = [] + + # XXX: Convert this to a modern callback. + def walk(handle, _arg): + data = handle.data + if data: + watcher = ffi.from_handle(data) + else: + watcher = None + handles.append(handle_state(handle, + ffi.string(libuv.uv_handle_type_name(handle.type)), + watcher, + libuv.uv_has_ref(handle), + libuv.uv_is_active(handle), + libuv.uv_is_closing(handle))) + + libuv.uv_walk(self._ptr, + ffi.callback("void(*)(uv_handle_t*,void*)", + walk), + ffi.NULL) + return handles + + def ref(self): + pass + + def unref(self): + # XXX: Called by _run_callbacks. + pass + + def break_(self, how=None): + libuv.uv_stop(self._ptr) + + def reinit(self): + # TODO: How to implement? We probably have to simply + # re-__init__ this whole class? Does it matter? + # OR maybe we need to uv_walk() and close all the handles? + + # XXX: libuv < 1.12 simply CANNOT handle a fork unless you immediately + # exec() in the child. There are multiple calls to abort() that + # will kill the child process: + # - The OS X poll implementation (kqueue) aborts on an error return + # value; since kqueue FDs can't be inherited, then the next call + # to kqueue in the child will fail and get aborted; fork() is likely + # to be called during the gevent loop, meaning we're deep inside the + # runloop already, so we can't even close the loop that we're in: + # it's too late, the next call to kqueue is already scheduled. + # - The threadpool, should it be in use, also aborts + # (https://github.com/joyent/libuv/pull/1136) + # - There global shared state that breaks signal handling + # and leads to an abort() in the child, EVEN IF the loop in the parent + # had already been closed + # (https://github.com/joyent/libuv/issues/1405) + + # In 1.12, the uv_loop_fork function was added (by gevent!) + libuv.uv_loop_fork(self._ptr) + + _prepare_ran_callbacks = False + + def __run_queued_callbacks(self): + if not self._queued_callbacks: + return False + + cbs = list(self._queued_callbacks) + self._queued_callbacks = [] + + for watcher_ptr, arg in cbs: + handle = watcher_ptr.data + if not handle: + # It's been stopped and possibly closed + assert not libuv.uv_is_active(watcher_ptr) + continue + val = _callbacks.python_callback(handle, arg) + if val == -1: + _callbacks.python_handle_error(handle, arg) + elif val == 1: + if not libuv.uv_is_active(watcher_ptr): + if watcher_ptr.data != handle: + if watcher_ptr.data: + _callbacks.python_stop(None) + else: + _callbacks.python_stop(handle) + return True + + + def run(self, nowait=False, once=False): + # we can only respect one flag or the other. + # nowait takes precedence because it can't block + mode = libuv.UV_RUN_DEFAULT + if once: + mode = libuv.UV_RUN_ONCE + if nowait: + mode = libuv.UV_RUN_NOWAIT + + if mode == libuv.UV_RUN_DEFAULT: + while self._ptr and self._ptr.data: + # This is here to better preserve order guarantees. See _run_callbacks + # for details. + # It may get run again from the prepare watcher, so potentially we + # could take twice as long as the switch interval. + self._run_callbacks() + self._prepare_ran_callbacks = False + ran_status = libuv.uv_run(self._ptr, libuv.UV_RUN_ONCE) + # Note that we run queued callbacks when the prepare watcher runs, + # thus accounting for timers that expired before polling for IO, + # and idle watchers. This next call should get IO callbacks and + # callbacks from timers that expired *after* polling for IO. + ran_callbacks = self.__run_queued_callbacks() + + if not ran_status and not ran_callbacks and not self._prepare_ran_callbacks: + # A return of 0 means there are no referenced and + # active handles. The loop is over. + # If we didn't run any callbacks, then we couldn't schedule + # anything to switch in the future, so there's no point + # running again. + return ran_status + return 0 # Somebody closed the loop + + result = libuv.uv_run(self._ptr, mode) + self.__run_queued_callbacks() + return result + + def now(self): + # libuv's now is expressed as an integer number of + # milliseconds, so to get it compatible with time.time units + # that this method is supposed to return, we have to divide by 1000.0 + now = libuv.uv_now(self._ptr) + return now / 1000.0 + + def update_now(self): + libuv.uv_update_time(self._ptr) + + def fileno(self): + if self._ptr: + fd = libuv.uv_backend_fd(self._ptr) + if fd >= 0: + return fd + + _sigchld_watcher = None + _sigchld_callback_ffi = None + + def install_sigchld(self): + if not self.default: + return + + if self._sigchld_watcher: + return + + self._sigchld_watcher = ffi.new('uv_signal_t*') + libuv.uv_signal_init(self._ptr, self._sigchld_watcher) + self._sigchld_watcher.data = self._handle_to_self + + libuv.uv_signal_start(self._sigchld_watcher, + libuv.python_sigchld_callback, + signal.SIGCHLD) + + def reset_sigchld(self): + if not self.default or not self._sigchld_watcher: + return + + libuv.uv_signal_stop(self._sigchld_watcher) + # Must go through this to manage the memory lifetime + # correctly. Alternately, we could just stop it and restart + # it in install_sigchld? + _watchers.watcher._watcher_ffi_close(self._sigchld_watcher) + del self._sigchld_watcher + + + def _sigchld_callback(self): + # Signals can arrive at (relatively) any time. To eliminate + # race conditions, and behave more like libev, we "queue" + # sigchld to run when we run callbacks. + while True: + try: + pid, status, _usage = os.wait3(os.WNOHANG) + except OSError: + # Python 3 raises ChildProcessError + break + + if pid == 0: + break + children_watchers = self._child_watchers.get(pid, []) + self._child_watchers.get(0, []) + for watcher in children_watchers: + self.run_callback(watcher._set_waitpid_status, pid, status) + + # Don't invoke child watchers for 0 more than once + self._child_watchers[0] = [] + + def _register_child_watcher(self, watcher): + self._child_watchers[watcher._pid].append(watcher) + + def _unregister_child_watcher(self, watcher): + try: + # stop() should be idempotent + self._child_watchers[watcher._pid].remove(watcher) + except ValueError: + pass + + # Now's a good time to clean up any dead lists we don't need + # anymore + for pid in list(self._child_watchers): + if not self._child_watchers[pid]: + del self._child_watchers[pid] + + def io(self, fd, events, ref=True, priority=None): + # We rely on hard references here and explicit calls to + # close() on the returned object to correctly manage + # the watcher lifetimes. + + io_watchers = self._io_watchers + try: + io_watcher = io_watchers[fd] + assert io_watcher._multiplex_watchers, ("IO Watcher %s unclosed but should be dead" % io_watcher) + except KeyError: + # Start the watcher with just the events that we're interested in. + # as multiplexers are added, the real event mask will be updated to keep in sync. + # If we watch for too much, we get spurious wakeups and busy loops. + io_watcher = self._watchers.io(self, fd, 0) + io_watchers[fd] = io_watcher + io_watcher._no_more_watchers = lambda: delitem(io_watchers, fd) + + return io_watcher.multiplex(events) + + def prepare(self, ref=True, priority=None): + # We run arbitrary code in python_prepare_callback. That could switch + # greenlets. If it does that while also manipulating the active prepare + # watchers, we could corrupt the process state, since the prepare watcher + # queue is iterated on the stack (on unix). We could workaround this by implementing + # prepare watchers in pure Python. + # See https://github.com/gevent/gevent/issues/1126 + raise TypeError("prepare watchers are not currently supported in libuv. " + "If you need them, please contact the maintainers.") diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/libuv/watcher.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/libuv/watcher.py new file mode 100644 index 00000000..84a8ca4e --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/libuv/watcher.py @@ -0,0 +1,735 @@ +# pylint: disable=too-many-lines, protected-access, redefined-outer-name, not-callable +# pylint: disable=no-member +from __future__ import absolute_import, print_function + +import functools +import sys + +from gevent.libuv import _corecffi # pylint:disable=no-name-in-module,import-error + +# Nothing public here +__all__ = [] + +ffi = _corecffi.ffi +libuv = _corecffi.lib + +from gevent._ffi import watcher as _base +from gevent._ffi import _dbg + +_closing_watchers = set() + +# In debug mode, it would be nice to be able to clear the memory of +# the watcher (its size determined by +# libuv.uv_handle_size(ffi_watcher.type)) using memset so that if we +# are using it after it's supposedly been closed and deleted, we'd +# catch it sooner. BUT doing so breaks test__threadpool. We get errors +# about `pthread_mutex_lock[3]: Invalid argument` (and sometimes we +# crash) suggesting either that we're writing on memory that doesn't +# belong to us, somehow, or that we haven't actually lost all +# references... +_uv_close_callback = ffi.def_extern(name='_uv_close_callback')(_closing_watchers.remove) + + +_events = [(libuv.UV_READABLE, "READ"), + (libuv.UV_WRITABLE, "WRITE")] + +def _events_to_str(events): # export + return _base.events_to_str(events, _events) + +class UVFuncallError(ValueError): + pass + +class libuv_error_wrapper(object): + # Makes sure that everything stored as a function + # on the wrapper instances (classes, actually, + # because this is used by the metaclass) + # checks its return value and raises an error. + # This expects that everything we call has an int + # or void return value and follows the conventions + # of error handling (that negative values are errors) + def __init__(self, uv): + self._libuv = uv + + def __getattr__(self, name): + libuv_func = getattr(self._libuv, name) + + @functools.wraps(libuv_func) + def wrap(*args, **kwargs): + if args and isinstance(args[0], watcher): + args = args[1:] + res = libuv_func(*args, **kwargs) + if res is not None and res < 0: + raise UVFuncallError( + str(ffi.string(libuv.uv_err_name(res)).decode('ascii') + + ' ' + + ffi.string(libuv.uv_strerror(res)).decode('ascii')) + + " Args: " + repr(args) + " KWARGS: " + repr(kwargs) + ) + return res + + setattr(self, name, wrap) + + return wrap + + +class ffi_unwrapper(object): + # undoes the wrapping of libuv_error_wrapper for + # the methods used by the metaclass that care + + def __init__(self, ff): + self._ffi = ff + + def __getattr__(self, name): + return getattr(self._ffi, name) + + def addressof(self, lib, name): + assert isinstance(lib, libuv_error_wrapper) + return self._ffi.addressof(libuv, name) + + +class watcher(_base.watcher): + _FFI = ffi_unwrapper(ffi) + _LIB = libuv_error_wrapper(libuv) + + _watcher_prefix = 'uv' + _watcher_struct_pattern = '%s_t' + + @classmethod + def _watcher_ffi_close(cls, ffi_watcher): + # Managing the lifetime of _watcher is tricky. + # They have to be uv_close()'d, but that only + # queues them to be closed in the *next* loop iteration. + # The memory must stay valid for at least that long, + # or assert errors are triggered. We can't use a ffi.gc() + # pointer to queue the uv_close, because by the time the + # destructor is called, there's no way to keep the memory alive + # and it could be re-used. + # So here we resort to resurrecting the pointer object out + # of our scope, keeping it alive past this object's lifetime. + # We then use the uv_close callback to handle removing that + # reference. There's no context passed to the close callback, + # so we have to do this globally. + + # Sadly, doing this causes crashes if there were multiple + # watchers for a given FD, so we have to take special care + # about that. See https://github.com/gevent/gevent/issues/790#issuecomment-208076604 + + # Note that this cannot be a __del__ method, because we store + # the CFFI handle to self on self, which is a cycle, and + # objects with a __del__ method cannot be collected on CPython < 3.4 + + # Instead, this is arranged as a callback to GC when the + # watcher class dies. Obviously it's important to keep the ffi + # watcher alive. + # We can pass in "subclasses" if uv_handle_t that line up at the C level, + # but that don't in CFFI without a cast. But be careful what we use the cast + # for, don't pass it back to C. + ffi_handle_watcher = cls._FFI.cast('uv_handle_t*', ffi_watcher) + if ffi_handle_watcher.type and not libuv.uv_is_closing(ffi_watcher): + # If the type isn't set, we were never properly initialized, + # and trying to close it results in libuv terminating the process. + # Sigh. Same thing if it's already in the process of being + # closed. + _closing_watchers.add(ffi_watcher) + libuv.uv_close(ffi_watcher, libuv._uv_close_callback) + + ffi_handle_watcher.data = ffi.NULL + + + def _watcher_ffi_set_init_ref(self, ref): + self.ref = ref + + def _watcher_ffi_init(self, args): + # TODO: we could do a better job chokepointing this + return self._watcher_init(self.loop.ptr, + self._watcher, + *args) + + def _watcher_ffi_start(self): + self._watcher_start(self._watcher, self._watcher_callback) + + def _watcher_ffi_stop(self): + if self._watcher: + # The multiplexed io watcher deletes self._watcher + # when it closes down. If that's in the process of + # an error handler, AbstractCallbacks.unhandled_onerror + # will try to close us again. + self._watcher_stop(self._watcher) + + @_base.only_if_watcher + def _watcher_ffi_ref(self): + libuv.uv_ref(self._watcher) + + @_base.only_if_watcher + def _watcher_ffi_unref(self): + libuv.uv_unref(self._watcher) + + def _watcher_ffi_start_unref(self): + pass + + def _watcher_ffi_stop_ref(self): + pass + + def _get_ref(self): + # Convert 1/0 to True/False + if self._watcher is None: + return None + return bool(libuv.uv_has_ref(self._watcher)) + + def _set_ref(self, value): + if value: + self._watcher_ffi_ref() + else: + self._watcher_ffi_unref() + + ref = property(_get_ref, _set_ref) + + def feed(self, _revents, _callback, *_args): + raise Exception("Not implemented") + +class io(_base.IoMixin, watcher): + _watcher_type = 'poll' + _watcher_callback_name = '_gevent_poll_callback2' + + # On Windows is critical to be able to garbage collect these + # objects in a timely fashion so that they don't get reused + # for multiplexing completely different sockets. This is because + # uv_poll_init_socket does a lot of setup for the socket to make + # polling work. If get reused for another socket that has the same + # fileno, things break badly. (In theory this could be a problem + # on posix too, but in practice it isn't). + + # TODO: We should probably generalize this to all + # ffi watchers. Avoiding GC cycles as much as possible + # is a good thing, and potentially allocating new handles + # as needed gets us better memory locality. + + # Especially on Windows, we must also account for the case that a + # reference to this object has leaked (e.g., the socket object is + # still around), but the fileno has been closed and a new one + # opened. We must still get a new native watcher at that point. We + # handle this case by simply making sure that we don't even have + # a native watcher until the object is started, and we shut it down + # when the object is stopped. + + # XXX: I was able to solve at least Windows test_ftplib.py issues + # with more of a careful use of io objects in socket.py, so + # delaying this entirely is at least temporarily on hold. Instead + # sticking with the _watcher_create function override for the + # moment. + + # XXX: Note 2: Moving to a deterministic close model, which was necessary + # for PyPy, also seems to solve the Windows issues. So we're completely taking + # this object out of the loop's registration; we don't want GC callbacks and + # uv_close anywhere *near* this object. + + _watcher_registers_with_loop_on_create = False + + EVENT_MASK = libuv.UV_READABLE | libuv.UV_WRITABLE | libuv.UV_DISCONNECT + + _multiplex_watchers = () + + def __init__(self, loop, fd, events, ref=True, priority=None): + super(io, self).__init__(loop, fd, events, ref=ref, priority=priority, _args=(fd,)) + self._fd = fd + self._events = events + self._multiplex_watchers = [] + + def _get_fd(self): + return self._fd + + @_base.not_while_active + def _set_fd(self, fd): + self._fd = fd + self._watcher_ffi_init((fd,)) + + def _get_events(self): + return self._events + + def _set_events(self, events): + if events == self._events: + return + self._events = events + if self.active: + # We're running but libuv specifically says we can + # call start again to change our event mask. + assert self._handle is not None + self._watcher_start(self._watcher, self._events, self._watcher_callback) + + events = property(_get_events, _set_events) + + def _watcher_ffi_start(self): + self._watcher_start(self._watcher, self._events, self._watcher_callback) + + if sys.platform.startswith('win32'): + # uv_poll can only handle sockets on Windows, but the plain + # uv_poll_init we call on POSIX assumes that the fileno + # argument is already a C fileno, as created by + # _get_osfhandle. C filenos are limited resources, must be + # closed with _close. So there are lifetime issues with that: + # calling the C function _close to dispose of the fileno + # *also* closes the underlying win32 handle, possibly + # prematurely. (XXX: Maybe could do something with weak + # references? But to what?) + + # All libuv wants to do with the fileno in uv_poll_init is + # turn it back into a Win32 SOCKET handle. + + # Now, libuv provides uv_poll_init_socket, which instead of + # taking a C fileno takes the SOCKET, avoiding the need to dance with + # the C runtime. + + # It turns out that SOCKET (win32 handles in general) can be + # represented with `intptr_t`. It further turns out that + # CPython *directly* exposes the SOCKET handle as the value of + # fileno (32-bit PyPy does some munging on it, which should + # rarely matter). So we can pass socket.fileno() through + # to uv_poll_init_socket. + + # See _corecffi_build. + _watcher_init = watcher._LIB.uv_poll_init_socket + + + class _multiplexwatcher(object): + + callback = None + args = () + pass_events = False + ref = True + + def __init__(self, events, watcher): + self._events = events + + # References: + # These objects must keep the original IO object alive; + # the IO object SHOULD NOT keep these alive to avoid cycles + # We MUST NOT rely on GC to clean up the IO objects, but the explicit + # calls to close(); see _multiplex_closed. + self._watcher_ref = watcher + + events = property( + lambda self: self._events, + _base.not_while_active(lambda self, nv: setattr(self, '_events', nv))) + + def start(self, callback, *args, **kwargs): + self.pass_events = kwargs.get("pass_events") + self.callback = callback + self.args = args + + watcher = self._watcher_ref + if watcher is not None: + if not watcher.active: + watcher._io_start() + else: + # Make sure we're in the event mask + watcher._calc_and_update_events() + + def stop(self): + self.callback = None + self.pass_events = None + self.args = None + watcher = self._watcher_ref + if watcher is not None: + watcher._io_maybe_stop() + + def close(self): + if self._watcher_ref is not None: + self._watcher_ref._multiplex_closed(self) + self._watcher_ref = None + + @property + def active(self): + return self.callback is not None + + @property + def _watcher(self): + # For testing. + return self._watcher_ref._watcher + + # ares.pyx depends on this property, + # and test__core uses it too + fd = property(lambda self: getattr(self._watcher_ref, '_fd', -1), + lambda self, nv: self._watcher_ref._set_fd(nv)) + + def _io_maybe_stop(self): + self._calc_and_update_events() + for w in self._multiplex_watchers: + if w.callback is not None: + # There's still a reference to it, and it's started, + # so we can't stop. + return + # If we get here, nothing was started + # so we can take ourself out of the polling set + self.stop() + + def _io_start(self): + self._calc_and_update_events() + self.start(self._io_callback, pass_events=True) + + def _calc_and_update_events(self): + events = 0 + for watcher in self._multiplex_watchers: + if watcher.callback is not None: + # Only ask for events that are active. + events |= watcher.events + self._set_events(events) + + + def multiplex(self, events): + watcher = self._multiplexwatcher(events, self) + self._multiplex_watchers.append(watcher) + self._calc_and_update_events() + return watcher + + def close(self): + super(io, self).close() + del self._multiplex_watchers + + def _multiplex_closed(self, watcher): + self._multiplex_watchers.remove(watcher) + if not self._multiplex_watchers: + self.stop() # should already be stopped + self._no_more_watchers() + # It is absolutely critical that we control when the call + # to uv_close() gets made. uv_close() of a uv_poll_t + # handle winds up calling uv__platform_invalidate_fd, + # which, as the name implies, destroys any outstanding + # events for the *fd* that haven't been delivered yet, and also removes + # the *fd* from the poll set. So if this happens later, at some + # non-deterministic time when (cyclic or otherwise) GC runs, + # *and* we've opened a new watcher for the fd, that watcher will + # suddenly and mysteriously stop seeing events. So we do this now; + # this method is smart enough not to close the handle twice. + self.close() + else: + self._calc_and_update_events() + + def _no_more_watchers(self): + # The loop sets this on an individual watcher to delete it from + # the active list where it keeps hard references. + pass + + def _io_callback(self, events): + if events < 0: + # actually a status error code + _dbg("Callback error on", self._fd, + ffi.string(libuv.uv_err_name(events)), + ffi.string(libuv.uv_strerror(events))) + # XXX: We've seen one half of a FileObjectPosix pair + # (the read side of a pipe) report errno 11 'bad file descriptor' + # after the write side was closed and its watcher removed. But + # we still need to attempt to read from it to clear out what's in + # its buffers--if we return with the watcher inactive before proceeding to wake up + # the reader, we get a LoopExit. So we can't return here and arguably shouldn't print it + # either. The negative events mask will match the watcher's mask. + # See test__fileobject.py:Test.test_newlines for an example. + + # On Windows (at least with PyPy), we can get ENOTSOCK (socket operation on non-socket) + # if a socket gets closed. If we don't pass the events on, we hang. + # See test__makefile_ref.TestSSL for examples. + # return + + for watcher in self._multiplex_watchers: + if not watcher.callback: + # Stopped + continue + assert watcher._watcher_ref is self, (self, watcher._watcher_ref) + + send_event = (events & watcher.events) or events < 0 + if send_event: + if not watcher.pass_events: + watcher.callback(*watcher.args) + else: + watcher.callback(events, *watcher.args) + +class _SimulatedWithAsyncMixin(object): + _watcher_skip_ffi = True + + def __init__(self, loop, *args, **kwargs): + self._async = loop.async_() + try: + super(_SimulatedWithAsyncMixin, self).__init__(loop, *args, **kwargs) + except: + self._async.close() + raise + + def _watcher_create(self, _args): + return + + @property + def _watcher_handle(self): + return None + + def _watcher_ffi_init(self, _args): + return + + def _watcher_ffi_set_init_ref(self, ref): + self._async.ref = ref + + @property + def active(self): + return self._async.active + + def start(self, cb, *args): + self._register_loop_callback() + self.callback = cb + self.args = args + self._async.start(cb, *args) + #watcher.start(self, cb, *args) + + def stop(self): + self._unregister_loop_callback() + self.callback = None + self.args = None + self._async.stop() + + def close(self): + if self._async is not None: + a = self._async + #self._async = None + a.close() + + def _register_loop_callback(self): + # called from start() + raise NotImplementedError() + + def _unregister_loop_callback(self): + # called from stop + raise NotImplementedError() + +class fork(_SimulatedWithAsyncMixin, + _base.ForkMixin, + watcher): + # We'll have to implement this one completely manually + # Right now it doesn't matter much since libuv doesn't survive + # a fork anyway. (That's a work in progress) + _watcher_skip_ffi = False + + def _register_loop_callback(self): + self.loop._fork_watchers.add(self) + + def _unregister_loop_callback(self): + try: + # stop() should be idempotent + self.loop._fork_watchers.remove(self) + except KeyError: + pass + + def _on_fork(self): + self._async.send() + + +class child(_SimulatedWithAsyncMixin, + _base.ChildMixin, + watcher): + _watcher_skip_ffi = True + # We'll have to implement this one completely manually. + # Our approach is to use a SIGCHLD handler and the original + # os.waitpid call. + + # On Unix, libuv's uv_process_t and uv_spawn use SIGCHLD, + # just like libev does for its child watchers. So + # we're not adding any new SIGCHLD related issues not already + # present in libev. + + + def _register_loop_callback(self): + self.loop._register_child_watcher(self) + + def _unregister_loop_callback(self): + self.loop._unregister_child_watcher(self) + + def _set_waitpid_status(self, pid, status): + self._rpid = pid + self._rstatus = status + self._async.send() + + +class async_(_base.AsyncMixin, watcher): + _watcher_callback_name = '_gevent_async_callback0' + + def _watcher_ffi_init(self, args): + # It's dangerous to have a raw, non-initted struct + # around; it will crash in uv_close() when we get GC'd, + # and send() will also crash. + # NOTE: uv_async_init is NOT idempotent. Calling it more than + # once adds the uv_async_t to the internal queue multiple times, + # and uv_close only cleans up one of them, meaning that we tend to + # crash. Thus we have to be very careful not to allow that. + return self._watcher_init(self.loop.ptr, self._watcher, ffi.NULL) + + def _watcher_ffi_start(self): + # we're created in a started state, but we didn't provide a + # callback (because if we did and we don't have a value in our + # callback attribute, then python_callback would crash.) Note that + # uv_async_t->async_cb is not technically documented as public. + self._watcher.async_cb = self._watcher_callback + + def _watcher_ffi_stop(self): + self._watcher.async_cb = ffi.NULL + # We have to unref this because we're setting the cb behind libuv's + # back, basically: once a async watcher is started, it can't ever be + # stopped through libuv interfaces, so it would never lose its active + # status, and thus if it stays reffed it would keep the event loop + # from exiting. + self._watcher_ffi_unref() + + def send(self): + if libuv.uv_is_closing(self._watcher): + raise Exception("Closing handle") + libuv.uv_async_send(self._watcher) + + @property + def pending(self): + return None + +locals()['async'] = async_ + +class timer(_base.TimerMixin, watcher): + + _watcher_callback_name = '_gevent_timer_callback0' + + # In libuv, timer callbacks continue running while any timer is + # expired, including newly added timers. Newly added non-zero + # timers (especially of small duration) can be seen to be expired + # if the loop time is updated while we are in a timer callback. + # This can lead to us being stuck running timers for a terribly + # long time, which is not good. So default to not updating the + # time. + + # Also, newly-added timers of 0 duration can *also* stall the + # loop, because they'll be seen to be expired immediately. + # Updating the time can prevent that, *if* there was already a + # timer for a longer duration scheduled. + + # To mitigate the above problems, our loop implementation turns + # zero duration timers into check watchers instead using OneShotCheck. + # This ensures the loop cycles. Of course, the 'again' method does + # nothing on them and doesn't exist. In practice that's not an issue. + + _again = False + + def _watcher_ffi_init(self, args): + self._watcher_init(self.loop._ptr, self._watcher) + self._after, self._repeat = args + if self._after and self._after < 0.001: + import warnings + # XXX: The stack level is hard to determine, could be getting here + # through a number of different ways. + warnings.warn("libuv only supports millisecond timer resolution; " + "all times less will be set to 1 ms", + stacklevel=6) + # The alternative is to effectively pass in int(0.1) == 0, which + # means no sleep at all, which leads to excessive wakeups + self._after = 0.001 + if self._repeat and self._repeat < 0.001: + import warnings + warnings.warn("libuv only supports millisecond timer resolution; " + "all times less will be set to 1 ms", + stacklevel=6) + self._repeat = 0.001 + + def _watcher_ffi_start(self): + if self._again: + libuv.uv_timer_again(self._watcher) + else: + try: + self._watcher_start(self._watcher, self._watcher_callback, + int(self._after * 1000), + int(self._repeat * 1000)) + except ValueError: + # in case of non-ints in _after/_repeat + raise TypeError() + + def again(self, callback, *args, **kw): + if not self.active: + # If we've never been started, this is the same as starting us. + # libuv makes the distinction, libev doesn't. + self.start(callback, *args, **kw) + return + + self._again = True + try: + self.start(callback, *args, **kw) + finally: + del self._again + + +class stat(_base.StatMixin, watcher): + _watcher_type = 'fs_poll' + _watcher_struct_name = 'gevent_fs_poll_t' + _watcher_callback_name = '_gevent_fs_poll_callback3' + + def _watcher_set_data(self, the_watcher, data): + the_watcher.handle.data = data + return data + + def _watcher_ffi_init(self, args): + return self._watcher_init(self.loop._ptr, self._watcher) + + MIN_STAT_INTERVAL = 0.1074891 # match libev; 0.0 is default + + def _watcher_ffi_start(self): + # libev changes this when the watcher is started + if self._interval < self.MIN_STAT_INTERVAL: + self._interval = self.MIN_STAT_INTERVAL + self._watcher_start(self._watcher, self._watcher_callback, + self._cpath, + int(self._interval * 1000)) + + @property + def _watcher_handle(self): + return self._watcher.handle.data + + @property + def attr(self): + if not self._watcher.curr.st_nlink: + return + return self._watcher.curr + + @property + def prev(self): + if not self._watcher.prev.st_nlink: + return + return self._watcher.prev + + +class signal(_base.SignalMixin, watcher): + _watcher_callback_name = '_gevent_signal_callback1' + + def _watcher_ffi_init(self, args): + self._watcher_init(self.loop._ptr, self._watcher) + self.ref = False # libev doesn't ref these by default + + + def _watcher_ffi_start(self): + self._watcher_start(self._watcher, self._watcher_callback, + self._signalnum) + + +class idle(_base.IdleMixin, watcher): + # Because libuv doesn't support priorities, idle watchers are + # potentially quite a bit different than under libev + _watcher_callback_name = '_gevent_idle_callback0' + + +class check(_base.CheckMixin, watcher): + _watcher_callback_name = '_gevent_check_callback0' + +class OneShotCheck(check): + + _watcher_skip_ffi = True + + def __make_cb(self, func): + stop = self.stop + @functools.wraps(func) + def cb(*args): + stop() + return func(*args) + return cb + + def start(self, callback, *args): + return check.start(self, self.__make_cb(callback), *args) + +class prepare(_base.PrepareMixin, watcher): + _watcher_callback_name = '_gevent_prepare_callback0' diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/local.c b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/local.c new file mode 100644 index 00000000..020cb7df --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/local.c @@ -0,0 +1,13993 @@ +/* Generated by Cython 0.29.2 */ + +/* BEGIN: Cython Metadata +{ + "distutils": { + "depends": [ + "src/gevent/_local.pxd", + "src\\gevent\\_local.pxd" + ], + "include_dirs": [ + "C:\\Python37\\Include", + "deps" + ], + "name": "gevent._local", + "sources": [ + "src/gevent/local.py" + ] + }, + "module_name": "gevent._local" +} +END: Cython Metadata */ + +#define PY_SSIZE_T_CLEAN +#include "Python.h" +#ifndef Py_PYTHON_H + #error Python headers needed to compile C extensions, please install development version of Python. +#elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) + #error Cython requires Python 2.6+ or Python 3.3+. +#else +#define CYTHON_ABI "0_29_2" +#define CYTHON_HEX_VERSION 0x001D02F0 +#define CYTHON_FUTURE_DIVISION 1 +#include +#ifndef offsetof + #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) +#endif +#if !defined(WIN32) && !defined(MS_WINDOWS) + #ifndef __stdcall + #define __stdcall + #endif + #ifndef __cdecl + #define __cdecl + #endif + #ifndef __fastcall + #define __fastcall + #endif +#endif +#ifndef DL_IMPORT + #define DL_IMPORT(t) t +#endif +#ifndef DL_EXPORT + #define DL_EXPORT(t) t +#endif +#define __PYX_COMMA , +#ifndef HAVE_LONG_LONG + #if PY_VERSION_HEX >= 0x02070000 + #define HAVE_LONG_LONG + #endif +#endif +#ifndef PY_LONG_LONG + #define PY_LONG_LONG LONG_LONG +#endif +#ifndef Py_HUGE_VAL + #define Py_HUGE_VAL HUGE_VAL +#endif +#ifdef PYPY_VERSION + #define CYTHON_COMPILING_IN_PYPY 1 + #define CYTHON_COMPILING_IN_PYSTON 0 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #undef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 0 + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #if PY_VERSION_HEX < 0x03050000 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #elif !defined(CYTHON_USE_ASYNC_SLOTS) + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #undef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 0 + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #undef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 1 + #undef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 0 + #undef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 0 + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #undef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE 0 + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 +#elif defined(PYSTON_VERSION) + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_PYSTON 1 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #ifndef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 1 + #endif + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #ifndef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 1 + #endif + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #ifndef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 0 + #endif + #ifndef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 1 + #endif + #ifndef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 1 + #endif + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #undef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE 0 + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 +#else + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_PYSTON 0 + #define CYTHON_COMPILING_IN_CPYTHON 1 + #ifndef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 1 + #endif + #if PY_VERSION_HEX < 0x02070000 + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #elif !defined(CYTHON_USE_PYTYPE_LOOKUP) + #define CYTHON_USE_PYTYPE_LOOKUP 1 + #endif + #if PY_MAJOR_VERSION < 3 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #elif !defined(CYTHON_USE_ASYNC_SLOTS) + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #if PY_VERSION_HEX < 0x02070000 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #elif !defined(CYTHON_USE_PYLONG_INTERNALS) + #define CYTHON_USE_PYLONG_INTERNALS 1 + #endif + #ifndef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 1 + #endif + #ifndef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 1 + #endif + #if PY_VERSION_HEX < 0x030300F0 + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #elif !defined(CYTHON_USE_UNICODE_WRITER) + #define CYTHON_USE_UNICODE_WRITER 1 + #endif + #ifndef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 0 + #endif + #ifndef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 1 + #endif + #ifndef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 1 + #endif + #ifndef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 1 + #endif + #ifndef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 1 + #endif + #ifndef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000) + #endif + #ifndef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1) + #endif + #ifndef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1) + #endif + #ifndef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3) + #endif +#endif +#if !defined(CYTHON_FAST_PYCCALL) +#define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) +#endif +#if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #undef SHIFT + #undef BASE + #undef MASK + #ifdef SIZEOF_VOID_P + enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) }; + #endif +#endif +#ifndef __has_attribute + #define __has_attribute(x) 0 +#endif +#ifndef __has_cpp_attribute + #define __has_cpp_attribute(x) 0 +#endif +#ifndef CYTHON_RESTRICT + #if defined(__GNUC__) + #define CYTHON_RESTRICT __restrict__ + #elif defined(_MSC_VER) && _MSC_VER >= 1400 + #define CYTHON_RESTRICT __restrict + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_RESTRICT restrict + #else + #define CYTHON_RESTRICT + #endif +#endif +#ifndef CYTHON_UNUSED +# if defined(__GNUC__) +# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +#endif +#ifndef CYTHON_MAYBE_UNUSED_VAR +# if defined(__cplusplus) + template void CYTHON_MAYBE_UNUSED_VAR( const T& ) { } +# else +# define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x) +# endif +#endif +#ifndef CYTHON_NCP_UNUSED +# if CYTHON_COMPILING_IN_CPYTHON +# define CYTHON_NCP_UNUSED +# else +# define CYTHON_NCP_UNUSED CYTHON_UNUSED +# endif +#endif +#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) +#ifdef _MSC_VER + #ifndef _MSC_STDINT_H_ + #if _MSC_VER < 1300 + typedef unsigned char uint8_t; + typedef unsigned int uint32_t; + #else + typedef unsigned __int8 uint8_t; + typedef unsigned __int32 uint32_t; + #endif + #endif +#else + #include +#endif +#ifndef CYTHON_FALLTHROUGH + #if defined(__cplusplus) && __cplusplus >= 201103L + #if __has_cpp_attribute(fallthrough) + #define CYTHON_FALLTHROUGH [[fallthrough]] + #elif __has_cpp_attribute(clang::fallthrough) + #define CYTHON_FALLTHROUGH [[clang::fallthrough]] + #elif __has_cpp_attribute(gnu::fallthrough) + #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] + #endif + #endif + #ifndef CYTHON_FALLTHROUGH + #if __has_attribute(fallthrough) + #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) + #else + #define CYTHON_FALLTHROUGH + #endif + #endif + #if defined(__clang__ ) && defined(__apple_build_version__) + #if __apple_build_version__ < 7000000 + #undef CYTHON_FALLTHROUGH + #define CYTHON_FALLTHROUGH + #endif + #endif +#endif + +#ifndef CYTHON_INLINE + #if defined(__clang__) + #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) + #elif defined(__GNUC__) + #define CYTHON_INLINE __inline__ + #elif defined(_MSC_VER) + #define CYTHON_INLINE __inline + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_INLINE inline + #else + #define CYTHON_INLINE + #endif +#endif + +#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) + #define Py_OptimizeFlag 0 +#endif +#define __PYX_BUILD_PY_SSIZE_T "n" +#define CYTHON_FORMAT_SSIZE_T "z" +#if PY_MAJOR_VERSION < 3 + #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyClass_Type +#else + #define __Pyx_BUILTIN_MODULE_NAME "builtins" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyType_Type +#endif +#ifndef Py_TPFLAGS_CHECKTYPES + #define Py_TPFLAGS_CHECKTYPES 0 +#endif +#ifndef Py_TPFLAGS_HAVE_INDEX + #define Py_TPFLAGS_HAVE_INDEX 0 +#endif +#ifndef Py_TPFLAGS_HAVE_NEWBUFFER + #define Py_TPFLAGS_HAVE_NEWBUFFER 0 +#endif +#ifndef Py_TPFLAGS_HAVE_FINALIZE + #define Py_TPFLAGS_HAVE_FINALIZE 0 +#endif +#ifndef METH_STACKLESS + #define METH_STACKLESS 0 +#endif +#if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) + #ifndef METH_FASTCALL + #define METH_FASTCALL 0x80 + #endif + typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs); + typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args, + Py_ssize_t nargs, PyObject *kwnames); +#else + #define __Pyx_PyCFunctionFast _PyCFunctionFast + #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords +#endif +#if CYTHON_FAST_PYCCALL +#define __Pyx_PyFastCFunction_Check(func)\ + ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS))))) +#else +#define __Pyx_PyFastCFunction_Check(func) 0 +#endif +#if CYTHON_USE_DICT_VERSIONS +#define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) +#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ + (version_var) = __PYX_GET_DICT_VERSION(dict);\ + (cache_var) = (value); +#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ + static PY_UINT64_T __pyx_dict_version = 0;\ + static PyObject *__pyx_dict_cached_value = NULL;\ + if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ + (VAR) = __pyx_dict_cached_value;\ + } else {\ + (VAR) = __pyx_dict_cached_value = (LOOKUP);\ + __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ + }\ + } +#else +#define __PYX_GET_DICT_VERSION(dict) (0) +#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) +#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) + #define PyObject_Malloc(s) PyMem_Malloc(s) + #define PyObject_Free(p) PyMem_Free(p) + #define PyObject_Realloc(p) PyMem_Realloc(p) +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1 + #define PyMem_RawMalloc(n) PyMem_Malloc(n) + #define PyMem_RawRealloc(p, n) PyMem_Realloc(p, n) + #define PyMem_RawFree(p) PyMem_Free(p) +#endif +#if CYTHON_COMPILING_IN_PYSTON + #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co) + #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno) +#else + #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) + #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) +#endif +#if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000 + #define __Pyx_PyThreadState_Current PyThreadState_GET() +#elif PY_VERSION_HEX >= 0x03060000 + #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() +#elif PY_VERSION_HEX >= 0x03000000 + #define __Pyx_PyThreadState_Current PyThreadState_GET() +#else + #define __Pyx_PyThreadState_Current _PyThreadState_Current +#endif +#if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) +#include "pythread.h" +#define Py_tss_NEEDS_INIT 0 +typedef int Py_tss_t; +static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) { + *key = PyThread_create_key(); + return 0; // PyThread_create_key reports success always +} +static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) { + Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t)); + *key = Py_tss_NEEDS_INIT; + return key; +} +static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) { + PyObject_Free(key); +} +static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) { + return *key != Py_tss_NEEDS_INIT; +} +static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) { + PyThread_delete_key(*key); + *key = Py_tss_NEEDS_INIT; +} +static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) { + return PyThread_set_key_value(*key, value); +} +static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { + return PyThread_get_key_value(*key); +} +#endif // TSS (Thread Specific Storage) API +#if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized) +#define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) +#else +#define __Pyx_PyDict_NewPresized(n) PyDict_New() +#endif +#if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION + #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) +#else + #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS +#define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) +#else +#define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name) +#endif +#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) + #define CYTHON_PEP393_ENABLED 1 + #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ + 0 : _PyUnicode_Ready((PyObject *)(op))) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) + #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) + #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) + #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) + #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) + #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch) + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) +#else + #define CYTHON_PEP393_ENABLED 0 + #define PyUnicode_1BYTE_KIND 1 + #define PyUnicode_2BYTE_KIND 2 + #define PyUnicode_4BYTE_KIND 4 + #define __Pyx_PyUnicode_READY(op) (0) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) + #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111) + #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) + #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) + #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) + #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch) + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) +#endif +#if CYTHON_COMPILING_IN_PYPY + #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) +#else + #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ + PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains) + #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check) + #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format) + #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) +#endif +#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) +#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) +#else + #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) +#endif +#if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) + #define PyObject_ASCII(o) PyObject_Repr(o) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBaseString_Type PyUnicode_Type + #define PyStringObject PyUnicodeObject + #define PyString_Type PyUnicode_Type + #define PyString_Check PyUnicode_Check + #define PyString_CheckExact PyUnicode_CheckExact + #define PyObject_Unicode PyObject_Str +#endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) + #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) +#else + #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) + #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) +#endif +#ifndef PySet_CheckExact + #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) +#endif +#if CYTHON_ASSUME_SAFE_MACROS + #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) +#else + #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyIntObject PyLongObject + #define PyInt_Type PyLong_Type + #define PyInt_Check(op) PyLong_Check(op) + #define PyInt_CheckExact(op) PyLong_CheckExact(op) + #define PyInt_FromString PyLong_FromString + #define PyInt_FromUnicode PyLong_FromUnicode + #define PyInt_FromLong PyLong_FromLong + #define PyInt_FromSize_t PyLong_FromSize_t + #define PyInt_FromSsize_t PyLong_FromSsize_t + #define PyInt_AsLong PyLong_AsLong + #define PyInt_AS_LONG PyLong_AS_LONG + #define PyInt_AsSsize_t PyLong_AsSsize_t + #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask + #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask + #define PyNumber_Int PyNumber_Long +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBoolObject PyLongObject +#endif +#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY + #ifndef PyUnicode_InternFromString + #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) + #endif +#endif +#if PY_VERSION_HEX < 0x030200A4 + typedef long Py_hash_t; + #define __Pyx_PyInt_FromHash_t PyInt_FromLong + #define __Pyx_PyInt_AsHash_t PyInt_AsLong +#else + #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t + #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t +#endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : (Py_INCREF(func), func)) +#else + #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) +#endif +#if CYTHON_USE_ASYNC_SLOTS + #if PY_VERSION_HEX >= 0x030500B1 + #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods + #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) + #else + #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) + #endif +#else + #define __Pyx_PyType_AsAsync(obj) NULL +#endif +#ifndef __Pyx_PyAsyncMethodsStruct + typedef struct { + unaryfunc am_await; + unaryfunc am_aiter; + unaryfunc am_anext; + } __Pyx_PyAsyncMethodsStruct; +#endif + +#if defined(WIN32) || defined(MS_WINDOWS) + #define _USE_MATH_DEFINES +#endif +#include +#ifdef NAN +#define __PYX_NAN() ((float) NAN) +#else +static CYTHON_INLINE float __PYX_NAN() { + float value; + memset(&value, 0xFF, sizeof(value)); + return value; +} +#endif +#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) +#define __Pyx_truncl trunc +#else +#define __Pyx_truncl truncl +#endif + + +#define __PYX_ERR(f_index, lineno, Ln_error) \ +{ \ + __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \ +} + +#ifndef __PYX_EXTERN_C + #ifdef __cplusplus + #define __PYX_EXTERN_C extern "C" + #else + #define __PYX_EXTERN_C extern + #endif +#endif + +#define __PYX_HAVE__gevent___local +#define __PYX_HAVE_API__gevent___local +/* Early includes */ +#include "greenlet/greenlet.h" +#include "frameobject.h" +#ifdef _OPENMP +#include +#endif /* _OPENMP */ + +#if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) +#define CYTHON_WITHOUT_ASSERTIONS +#endif + +typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; + const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; + +#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 +#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0 +#define __PYX_DEFAULT_STRING_ENCODING "" +#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString +#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#define __Pyx_uchar_cast(c) ((unsigned char)c) +#define __Pyx_long_cast(x) ((long)x) +#define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ + (sizeof(type) < sizeof(Py_ssize_t)) ||\ + (sizeof(type) > sizeof(Py_ssize_t) &&\ + likely(v < (type)PY_SSIZE_T_MAX ||\ + v == (type)PY_SSIZE_T_MAX) &&\ + (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ + v == (type)PY_SSIZE_T_MIN))) ||\ + (sizeof(type) == sizeof(Py_ssize_t) &&\ + (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ + v == (type)PY_SSIZE_T_MAX))) ) +static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) { + return (size_t) i < (size_t) limit; +} +#if defined (__cplusplus) && __cplusplus >= 201103L + #include + #define __Pyx_sst_abs(value) std::abs(value) +#elif SIZEOF_INT >= SIZEOF_SIZE_T + #define __Pyx_sst_abs(value) abs(value) +#elif SIZEOF_LONG >= SIZEOF_SIZE_T + #define __Pyx_sst_abs(value) labs(value) +#elif defined (_MSC_VER) + #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) +#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define __Pyx_sst_abs(value) llabs(value) +#elif defined (__GNUC__) + #define __Pyx_sst_abs(value) __builtin_llabs(value) +#else + #define __Pyx_sst_abs(value) ((value<0) ? -value : value) +#endif +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*); +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); +#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) +#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) +#define __Pyx_PyBytes_FromString PyBytes_FromString +#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); +#if PY_MAJOR_VERSION < 3 + #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#else + #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize +#endif +#define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) +#define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) +#define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) +#define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) +#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) +static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) { + const Py_UNICODE *u_end = u; + while (*u_end++) ; + return (size_t)(u_end - u - 1); +} +#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) +#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode +#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode +#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) +#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) +static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); +static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*); +static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); +#define __Pyx_PySequence_Tuple(obj)\ + (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); +#if CYTHON_ASSUME_SAFE_MACROS +#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) +#else +#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) +#endif +#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) +#if PY_MAJOR_VERSION >= 3 +#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) +#else +#define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) +#endif +#define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x)) +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII +static int __Pyx_sys_getdefaultencoding_not_ascii; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + PyObject* ascii_chars_u = NULL; + PyObject* ascii_chars_b = NULL; + const char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + if (strcmp(default_encoding_c, "ascii") == 0) { + __Pyx_sys_getdefaultencoding_not_ascii = 0; + } else { + char ascii_chars[128]; + int c; + for (c = 0; c < 128; c++) { + ascii_chars[c] = c; + } + __Pyx_sys_getdefaultencoding_not_ascii = 1; + ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); + if (!ascii_chars_u) goto bad; + ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); + if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { + PyErr_Format( + PyExc_ValueError, + "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", + default_encoding_c); + goto bad; + } + Py_DECREF(ascii_chars_u); + Py_DECREF(ascii_chars_b); + } + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + Py_XDECREF(ascii_chars_u); + Py_XDECREF(ascii_chars_b); + return -1; +} +#endif +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) +#else +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +static char* __PYX_DEFAULT_STRING_ENCODING; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1); + if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; + strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + return -1; +} +#endif +#endif + + +/* Test for GCC > 2.95 */ +#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) + #define likely(x) __builtin_expect(!!(x), 1) + #define unlikely(x) __builtin_expect(!!(x), 0) +#else /* !__GNUC__ or GCC < 2.95 */ + #define likely(x) (x) + #define unlikely(x) (x) +#endif /* __GNUC__ */ +static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } + +static PyObject *__pyx_m = NULL; +static PyObject *__pyx_d; +static PyObject *__pyx_b; +static PyObject *__pyx_cython_runtime = NULL; +static PyObject *__pyx_empty_tuple; +static PyObject *__pyx_empty_bytes; +static PyObject *__pyx_empty_unicode; +static int __pyx_lineno; +static int __pyx_clineno = 0; +static const char * __pyx_cfilenm= __FILE__; +static const char *__pyx_filename; + + +static const char *__pyx_f[] = { + "src\\gevent\\local.py", + "src\\gevent\\__greenlet_primitives.pxd", + "src\\gevent\\__waiter.pxd", + "src\\gevent\\_greenlet.pxd", + "src\\gevent\\_local.pxd", + "src\\gevent\\__ident.pxd", +}; + +/*--- Type declarations ---*/ +struct __pyx_obj_6gevent_7__ident_ValuedWeakRef; +struct __pyx_obj_6gevent_7__ident_IdentRegistry; +struct __pyx_obj_6gevent_21__greenlet_primitives_TrackedRawGreenlet; +struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop; +struct __pyx_obj_6gevent_8__waiter_Waiter; +struct __pyx_obj_6gevent_8__waiter_MultipleWaiter; +struct __pyx_obj_6gevent_9_greenlet_SpawnedLink; +struct __pyx_obj_6gevent_9_greenlet_SuccessSpawnedLink; +struct __pyx_obj_6gevent_9_greenlet_FailureSpawnedLink; +struct __pyx_obj_6gevent_9_greenlet__Frame; +struct __pyx_obj_6gevent_9_greenlet_Greenlet; +struct __pyx_obj_6gevent_9_greenlet__dummy_event; +struct __pyx_obj_6gevent_6_local__wrefdict; +struct __pyx_obj_6gevent_6_local__greenlet_deleted; +struct __pyx_obj_6gevent_6_local__local_deleted; +struct __pyx_obj_6gevent_6_local__localimpl; +struct __pyx_obj_6gevent_6_local__localimpl_dict_entry; +struct __pyx_obj_6gevent_6_local_local; +struct __pyx_opt_args_6gevent_9_greenlet_8Greenlet_join; +struct __pyx_opt_args_6gevent_9_greenlet_joinall; + +/* "gevent/_greenlet.pxd":105 + * + * cpdef bint has_links(self) + * cpdef join(self, timeout=*) # <<<<<<<<<<<<<< + * cpdef bint ready(self) + * cpdef bint successful(self) + */ +struct __pyx_opt_args_6gevent_9_greenlet_8Greenlet_join { + int __pyx_n; + PyObject *timeout; +}; + +/* "gevent/_greenlet.pxd":174 + * + * @cython.locals(done=list) + * cpdef joinall(greenlets, timeout=*, raise_error=*, count=*) # <<<<<<<<<<<<<< + * + * cdef set _spawn_callbacks + */ +struct __pyx_opt_args_6gevent_9_greenlet_joinall { + int __pyx_n; + PyObject *timeout; + PyObject *raise_error; + PyObject *count; +}; + +/* "gevent/__ident.pxd":15 + * @cython.internal + * @cython.final + * cdef class ValuedWeakRef(ref): # <<<<<<<<<<<<<< + * cdef object value + * + */ +struct __pyx_obj_6gevent_7__ident_ValuedWeakRef { + PyWeakReference __pyx_base; + PyObject *value; +}; + + +/* "gevent/__ident.pxd":19 + * + * @cython.final + * cdef class IdentRegistry: # <<<<<<<<<<<<<< + * cdef object _registry + * cdef list _available_idents + */ +struct __pyx_obj_6gevent_7__ident_IdentRegistry { + PyObject_HEAD + struct __pyx_vtabstruct_6gevent_7__ident_IdentRegistry *__pyx_vtab; + PyObject *_registry; + PyObject *_available_idents; +}; + + +/* "gevent/__greenlet_primitives.pxd":37 + * return PyGreenlet_Switch(self, NULL, NULL) + * + * cdef class TrackedRawGreenlet(greenlet): # <<<<<<<<<<<<<< + * pass + * + */ +struct __pyx_obj_6gevent_21__greenlet_primitives_TrackedRawGreenlet { + PyGreenlet __pyx_base; +}; + + +/* "gevent/__greenlet_primitives.pxd":40 + * pass + * + * cdef class SwitchOutGreenletWithLoop(TrackedRawGreenlet): # <<<<<<<<<<<<<< + * cdef public loop + * + */ +struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop { + struct __pyx_obj_6gevent_21__greenlet_primitives_TrackedRawGreenlet __pyx_base; + struct __pyx_vtabstruct_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *__pyx_vtab; + PyObject *loop; +}; + + +/* "gevent/__waiter.pxd":33 + * _greenlet_imported = True + * + * cdef class Waiter: # <<<<<<<<<<<<<< + * cdef readonly SwitchOutGreenletWithLoop hub + * cdef readonly greenlet greenlet + */ +struct __pyx_obj_6gevent_8__waiter_Waiter { + PyObject_HEAD + struct __pyx_vtabstruct_6gevent_8__waiter_Waiter *__pyx_vtab; + struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *hub; + PyGreenlet *greenlet; + PyObject *value; + PyObject *_exception; +}; + + +/* "gevent/__waiter.pxd":47 + * @cython.final + * @cython.internal + * cdef class MultipleWaiter(Waiter): # <<<<<<<<<<<<<< + * cdef list _values + */ +struct __pyx_obj_6gevent_8__waiter_MultipleWaiter { + struct __pyx_obj_6gevent_8__waiter_Waiter __pyx_base; + PyObject *_values; +}; + + +/* "gevent/_greenlet.pxd":56 + * cdef void _init() + * + * cdef class SpawnedLink: # <<<<<<<<<<<<<< + * cdef public object callback + * + */ +struct __pyx_obj_6gevent_9_greenlet_SpawnedLink { + PyObject_HEAD + PyObject *callback; +}; + + +/* "gevent/_greenlet.pxd":61 + * + * @cython.final + * cdef class SuccessSpawnedLink(SpawnedLink): # <<<<<<<<<<<<<< + * pass + * + */ +struct __pyx_obj_6gevent_9_greenlet_SuccessSpawnedLink { + struct __pyx_obj_6gevent_9_greenlet_SpawnedLink __pyx_base; +}; + + +/* "gevent/_greenlet.pxd":65 + * + * @cython.final + * cdef class FailureSpawnedLink(SpawnedLink): # <<<<<<<<<<<<<< + * pass + * + */ +struct __pyx_obj_6gevent_9_greenlet_FailureSpawnedLink { + struct __pyx_obj_6gevent_9_greenlet_SpawnedLink __pyx_base; +}; + + +/* "gevent/_greenlet.pxd":71 + * @cython.internal + * @cython.freelist(1000) + * cdef class _Frame: # <<<<<<<<<<<<<< + * cdef readonly CodeType f_code + * cdef readonly int f_lineno + */ +struct __pyx_obj_6gevent_9_greenlet__Frame { + PyObject_HEAD + PyCodeObject *f_code; + int f_lineno; + struct __pyx_obj_6gevent_9_greenlet__Frame *f_back; +}; + + +/* "gevent/_greenlet.pxd":86 + * + * + * cdef class Greenlet(greenlet): # <<<<<<<<<<<<<< + * cdef readonly object value + * cdef readonly tuple args + */ +struct __pyx_obj_6gevent_9_greenlet_Greenlet { + PyGreenlet __pyx_base; + struct __pyx_vtabstruct_6gevent_9_greenlet_Greenlet *__pyx_vtab; + PyObject *value; + PyObject *args; + PyObject *kwargs; + PyObject *spawning_greenlet; + PyObject *spawn_tree_locals; + PyObject *_spawning_stack_frames; + PyObject *_links; + PyObject *_exc_info; + PyObject *_notifier; + PyObject *_start_event; + PyObject *_formatted_info; + PyObject *_ident; +}; + + +/* "gevent/_greenlet.pxd":157 + * @cython.final + * @cython.internal + * cdef class _dummy_event: # <<<<<<<<<<<<<< + * cdef readonly bint pending + * cdef readonly bint active + */ +struct __pyx_obj_6gevent_9_greenlet__dummy_event { + PyObject_HEAD + struct __pyx_vtabstruct_6gevent_9_greenlet__dummy_event *__pyx_vtab; + int pending; + int active; +}; + + +/* "gevent/_local.pxd":40 + * @cython.final + * @cython.internal + * cdef class _wrefdict(dict): # <<<<<<<<<<<<<< + * cdef object __weakref__ + * + */ +struct __pyx_obj_6gevent_6_local__wrefdict { + PyDictObject __pyx_base; + PyObject *__weakref__; +}; + + +/* "gevent/_local.pxd":45 + * @cython.final + * @cython.internal + * cdef class _greenlet_deleted: # <<<<<<<<<<<<<< + * cdef object idt + * cdef object wrdicts + */ +struct __pyx_obj_6gevent_6_local__greenlet_deleted { + PyObject_HEAD + PyObject *idt; + PyObject *wrdicts; +}; + + +/* "gevent/_local.pxd":52 + * @cython.final + * @cython.internal + * cdef class _local_deleted: # <<<<<<<<<<<<<< + * cdef str key + * cdef object wrthread + */ +struct __pyx_obj_6gevent_6_local__local_deleted { + PyObject_HEAD + PyObject *key; + PyObject *wrthread; + struct __pyx_obj_6gevent_6_local__greenlet_deleted *greenlet_deleted; +}; + + +/* "gevent/_local.pxd":59 + * @cython.final + * @cython.internal + * cdef class _localimpl: # <<<<<<<<<<<<<< + * cdef str key + * cdef dict dicts + */ +struct __pyx_obj_6gevent_6_local__localimpl { + PyObject_HEAD + PyObject *key; + PyObject *dicts; + PyObject *localargs; + PyObject *localkwargs; + PyObject *localtypeid; + PyObject *__weakref__; +}; + + +/* "gevent/_local.pxd":70 + * @cython.final + * @cython.internal + * cdef class _localimpl_dict_entry: # <<<<<<<<<<<<<< + * cdef object wrgreenlet + * cdef dict localdict + */ +struct __pyx_obj_6gevent_6_local__localimpl_dict_entry { + PyObject_HEAD + PyObject *wrgreenlet; + PyObject *localdict; +}; + + +/* "gevent/_local.pxd":83 + * cdef set _local_attrs + * + * cdef class local: # <<<<<<<<<<<<<< + * cdef _localimpl _local__impl + * cdef set _local_type_get_descriptors + */ +struct __pyx_obj_6gevent_6_local_local { + PyObject_HEAD + struct __pyx_vtabstruct_6gevent_6_local_local *__pyx_vtab; + struct __pyx_obj_6gevent_6_local__localimpl *_local__impl; + PyObject *_local_type_get_descriptors; + PyObject *_local_type_set_or_del_descriptors; + PyObject *_local_type_del_descriptors; + PyObject *_local_type_set_descriptors; + PyObject *_local_type_vars; + PyTypeObject *_local_type; +}; + + + +/* "gevent/__ident.pxd":19 + * + * @cython.final + * cdef class IdentRegistry: # <<<<<<<<<<<<<< + * cdef object _registry + * cdef list _available_idents + */ + +struct __pyx_vtabstruct_6gevent_7__ident_IdentRegistry { + PyObject *(*get_ident)(struct __pyx_obj_6gevent_7__ident_IdentRegistry *, PyObject *, int __pyx_skip_dispatch); + PyObject *(*_return_ident)(struct __pyx_obj_6gevent_7__ident_IdentRegistry *, struct __pyx_obj_6gevent_7__ident_ValuedWeakRef *, int __pyx_skip_dispatch); +}; +static struct __pyx_vtabstruct_6gevent_7__ident_IdentRegistry *__pyx_vtabptr_6gevent_7__ident_IdentRegistry; + + +/* "gevent/__greenlet_primitives.pxd":40 + * pass + * + * cdef class SwitchOutGreenletWithLoop(TrackedRawGreenlet): # <<<<<<<<<<<<<< + * cdef public loop + * + */ + +struct __pyx_vtabstruct_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop { + PyObject *(*__pyx_switch)(struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *, int __pyx_skip_dispatch); + PyObject *(*switch_out)(struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *, int __pyx_skip_dispatch); +}; +static struct __pyx_vtabstruct_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *__pyx_vtabptr_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop; + + +/* "gevent/__waiter.pxd":33 + * _greenlet_imported = True + * + * cdef class Waiter: # <<<<<<<<<<<<<< + * cdef readonly SwitchOutGreenletWithLoop hub + * cdef readonly greenlet greenlet + */ + +struct __pyx_vtabstruct_6gevent_8__waiter_Waiter { + PyObject *(*get)(struct __pyx_obj_6gevent_8__waiter_Waiter *, int __pyx_skip_dispatch); + PyObject *(*clear)(struct __pyx_obj_6gevent_8__waiter_Waiter *, int __pyx_skip_dispatch); +}; +static struct __pyx_vtabstruct_6gevent_8__waiter_Waiter *__pyx_vtabptr_6gevent_8__waiter_Waiter; + + +/* "gevent/__waiter.pxd":47 + * @cython.final + * @cython.internal + * cdef class MultipleWaiter(Waiter): # <<<<<<<<<<<<<< + * cdef list _values + */ + +struct __pyx_vtabstruct_6gevent_8__waiter_MultipleWaiter { + struct __pyx_vtabstruct_6gevent_8__waiter_Waiter __pyx_base; +}; +static struct __pyx_vtabstruct_6gevent_8__waiter_MultipleWaiter *__pyx_vtabptr_6gevent_8__waiter_MultipleWaiter; + + +/* "gevent/_greenlet.pxd":86 + * + * + * cdef class Greenlet(greenlet): # <<<<<<<<<<<<<< + * cdef readonly object value + * cdef readonly tuple args + */ + +struct __pyx_vtabstruct_6gevent_9_greenlet_Greenlet { + int (*has_links)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *, int __pyx_skip_dispatch); + PyObject *(*join)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_9_greenlet_8Greenlet_join *__pyx_optional_args); + int (*ready)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *, int __pyx_skip_dispatch); + int (*successful)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *, int __pyx_skip_dispatch); + PyObject *(*rawlink)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *, PyObject *, int __pyx_skip_dispatch); + PyObject *(*_formatinfo)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *, int __pyx_skip_dispatch); + PyObject *(*_get_minimal_ident)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *); + int (*__pyx___started_but_aborted)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *); + int (*__pyx___start_cancelled_by_kill)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *); + int (*__pyx___start_pending)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *); + int (*__pyx___never_started_or_killed)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *); + int (*__pyx___start_completed)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *); + PyObject *(*__pyx___handle_death_before_start)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *, PyObject *); + PyObject *(*__pyx___cancel_start)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *); + PyObject *(*_report_result)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *, PyObject *); + PyObject *(*_report_error)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *, PyObject *); + PyObject *(*_notify_links)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *, int __pyx_skip_dispatch); +}; +static struct __pyx_vtabstruct_6gevent_9_greenlet_Greenlet *__pyx_vtabptr_6gevent_9_greenlet_Greenlet; + + +/* "gevent/_greenlet.pxd":157 + * @cython.final + * @cython.internal + * cdef class _dummy_event: # <<<<<<<<<<<<<< + * cdef readonly bint pending + * cdef readonly bint active + */ + +struct __pyx_vtabstruct_6gevent_9_greenlet__dummy_event { + PyObject *(*stop)(struct __pyx_obj_6gevent_9_greenlet__dummy_event *, int __pyx_skip_dispatch); + PyObject *(*start)(struct __pyx_obj_6gevent_9_greenlet__dummy_event *, PyObject *, int __pyx_skip_dispatch); + PyObject *(*close)(struct __pyx_obj_6gevent_9_greenlet__dummy_event *, int __pyx_skip_dispatch); +}; +static struct __pyx_vtabstruct_6gevent_9_greenlet__dummy_event *__pyx_vtabptr_6gevent_9_greenlet__dummy_event; + + +/* "src/gevent/local.py":361 + * } + * + * class local(object): # <<<<<<<<<<<<<< + * """ + * An object whose attributes are greenlet-local. + */ + +struct __pyx_vtabstruct_6gevent_6_local_local { + struct __pyx_obj_6gevent_6_local_local *(*__pyx___copy__)(struct __pyx_obj_6gevent_6_local_local *, int __pyx_skip_dispatch); +}; +static struct __pyx_vtabstruct_6gevent_6_local_local *__pyx_vtabptr_6gevent_6_local_local; + +/* --- Runtime support code (head) --- */ +/* Refnanny.proto */ +#ifndef CYTHON_REFNANNY + #define CYTHON_REFNANNY 0 +#endif +#if CYTHON_REFNANNY + typedef struct { + void (*INCREF)(void*, PyObject*, int); + void (*DECREF)(void*, PyObject*, int); + void (*GOTREF)(void*, PyObject*, int); + void (*GIVEREF)(void*, PyObject*, int); + void* (*SetupContext)(const char*, int, const char*); + void (*FinishContext)(void**); + } __Pyx_RefNannyAPIStruct; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); + #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; +#ifdef WITH_THREAD + #define __Pyx_RefNannySetupContext(name, acquire_gil)\ + if (acquire_gil) {\ + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ + PyGILState_Release(__pyx_gilstate_save);\ + } else {\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ + } +#else + #define __Pyx_RefNannySetupContext(name, acquire_gil)\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) +#endif + #define __Pyx_RefNannyFinishContext()\ + __Pyx_RefNanny->FinishContext(&__pyx_refnanny) + #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0) + #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) + #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) + #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) +#else + #define __Pyx_RefNannyDeclarations + #define __Pyx_RefNannySetupContext(name, acquire_gil) + #define __Pyx_RefNannyFinishContext() + #define __Pyx_INCREF(r) Py_INCREF(r) + #define __Pyx_DECREF(r) Py_DECREF(r) + #define __Pyx_GOTREF(r) + #define __Pyx_GIVEREF(r) + #define __Pyx_XINCREF(r) Py_XINCREF(r) + #define __Pyx_XDECREF(r) Py_XDECREF(r) + #define __Pyx_XGOTREF(r) + #define __Pyx_XGIVEREF(r) +#endif +#define __Pyx_XDECREF_SET(r, v) do {\ + PyObject *tmp = (PyObject *) r;\ + r = v; __Pyx_XDECREF(tmp);\ + } while (0) +#define __Pyx_DECREF_SET(r, v) do {\ + PyObject *tmp = (PyObject *) r;\ + r = v; __Pyx_DECREF(tmp);\ + } while (0) +#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) +#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) + +/* PyObjectGetAttrStr.proto */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); +#else +#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) +#endif + +/* GetBuiltinName.proto */ +static PyObject *__Pyx_GetBuiltinName(PyObject *name); + +/* PyCFunctionFastCall.proto */ +#if CYTHON_FAST_PYCCALL +static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs); +#else +#define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL) +#endif + +/* PyFunctionFastCall.proto */ +#if CYTHON_FAST_PYCALL +#define __Pyx_PyFunction_FastCall(func, args, nargs)\ + __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) +#if 1 || PY_VERSION_HEX < 0x030600B1 +static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs); +#else +#define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs) +#endif +#define __Pyx_BUILD_ASSERT_EXPR(cond)\ + (sizeof(char [1 - 2*!(cond)]) - 1) +#ifndef Py_MEMBER_SIZE +#define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member) +#endif + static size_t __pyx_pyframe_localsplus_offset = 0; + #include "frameobject.h" + #define __Pxy_PyFrame_Initialize_Offsets()\ + ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\ + (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus))) + #define __Pyx_PyFrame_GetLocalsplus(frame)\ + (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset)) +#endif + +/* PyObjectCall.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); +#else +#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) +#endif + +/* PyObjectCallMethO.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); +#endif + +/* PyObjectCallOneArg.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); + +/* IterFinish.proto */ +static CYTHON_INLINE int __Pyx_IterFinish(void); + +/* PyObjectCallNoArg.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); +#else +#define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL) +#endif + +/* PyObjectGetMethod.proto */ +static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method); + +/* PyObjectCallMethod0.proto */ +static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name); + +/* RaiseNeedMoreValuesToUnpack.proto */ +static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); + +/* RaiseTooManyValuesToUnpack.proto */ +static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); + +/* UnpackItemEndCheck.proto */ +static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); + +/* RaiseNoneIterError.proto */ +static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void); + +/* UnpackTupleError.proto */ +static void __Pyx_UnpackTupleError(PyObject *, Py_ssize_t index); + +/* UnpackTuple2.proto */ +#define __Pyx_unpack_tuple2(tuple, value1, value2, is_tuple, has_known_size, decref_tuple)\ + (likely(is_tuple || PyTuple_Check(tuple)) ?\ + (likely(has_known_size || PyTuple_GET_SIZE(tuple) == 2) ?\ + __Pyx_unpack_tuple2_exact(tuple, value1, value2, decref_tuple) :\ + (__Pyx_UnpackTupleError(tuple, 2), -1)) :\ + __Pyx_unpack_tuple2_generic(tuple, value1, value2, has_known_size, decref_tuple)) +static CYTHON_INLINE int __Pyx_unpack_tuple2_exact( + PyObject* tuple, PyObject** value1, PyObject** value2, int decref_tuple); +static int __Pyx_unpack_tuple2_generic( + PyObject* tuple, PyObject** value1, PyObject** value2, int has_known_size, int decref_tuple); + +/* dict_iter.proto */ +static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* dict, int is_dict, PyObject* method_name, + Py_ssize_t* p_orig_length, int* p_is_dict); +static CYTHON_INLINE int __Pyx_dict_iter_next(PyObject* dict_or_iter, Py_ssize_t orig_length, Py_ssize_t* ppos, + PyObject** pkey, PyObject** pvalue, PyObject** pitem, int is_dict); + +/* bytes_tailmatch.proto */ +static int __Pyx_PyBytes_SingleTailmatch(PyObject* self, PyObject* arg, + Py_ssize_t start, Py_ssize_t end, int direction); +static int __Pyx_PyBytes_Tailmatch(PyObject* self, PyObject* substr, + Py_ssize_t start, Py_ssize_t end, int direction); + +/* unicode_tailmatch.proto */ +static int __Pyx_PyUnicode_Tailmatch( + PyObject* s, PyObject* substr, Py_ssize_t start, Py_ssize_t end, int direction); + +/* str_tailmatch.proto */ +static CYTHON_INLINE int __Pyx_PyStr_Tailmatch(PyObject* self, PyObject* arg, Py_ssize_t start, + Py_ssize_t end, int direction); + +/* ExtTypeTest.proto */ +static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); + +/* dict_getitem_default.proto */ +static PyObject* __Pyx_PyDict_GetItemDefault(PyObject* d, PyObject* key, PyObject* default_value); + +/* UnpackUnboundCMethod.proto */ +typedef struct { + PyObject *type; + PyObject **method_name; + PyCFunction func; + PyObject *method; + int flag; +} __Pyx_CachedCFunction; + +/* CallUnboundCMethod1.proto */ +static PyObject* __Pyx__CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg); +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg); +#else +#define __Pyx_CallUnboundCMethod1(cfunc, self, arg) __Pyx__CallUnboundCMethod1(cfunc, self, arg) +#endif + +/* CallUnboundCMethod2.proto */ +static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2); +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030600B1 +static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2); +#else +#define __Pyx_CallUnboundCMethod2(cfunc, self, arg1, arg2) __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2) +#endif + +/* ListAppend.proto */ +#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS +static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) { + PyListObject* L = (PyListObject*) list; + Py_ssize_t len = Py_SIZE(list); + if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) { + Py_INCREF(x); + PyList_SET_ITEM(list, len, x); + Py_SIZE(list) = len+1; + return 0; + } + return PyList_Append(list, x); +} +#else +#define __Pyx_PyList_Append(L,x) PyList_Append(L,x) +#endif + +/* ArgTypeTest.proto */ +#define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\ + ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\ + __Pyx__ArgTypeTest(obj, type, name, exact)) +static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact); + +/* RaiseArgTupleInvalid.proto */ +static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, + Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); + +/* RaiseDoubleKeywords.proto */ +static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); + +/* ParseKeywords.proto */ +static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\ + PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\ + const char* function_name); + +/* GetTopmostException.proto */ +#if CYTHON_USE_EXC_INFO_STACK +static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate); +#endif + +/* PyThreadStateGet.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; +#define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; +#define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type +#else +#define __Pyx_PyThreadState_declare +#define __Pyx_PyThreadState_assign +#define __Pyx_PyErr_Occurred() PyErr_Occurred() +#endif + +/* SaveResetException.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); +#else +#define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb) +#define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb) +#endif + +/* PyObjectCall2Args.proto */ +static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2); + +/* PyErrExceptionMatches.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) +static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); +#else +#define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) +#endif + +/* PyErrFetchRestore.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) +#define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) +#define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) +#define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) +#define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); +static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) +#else +#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) +#endif +#else +#define __Pyx_PyErr_Clear() PyErr_Clear() +#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) +#define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) +#define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb) +#define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) +#endif + +/* GetAttr.proto */ +static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *); + +/* GetAttr3.proto */ +static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *); + +/* DictGetItem.proto */ +#if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY +static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key); +#define __Pyx_PyObject_Dict_GetItem(obj, name)\ + (likely(PyDict_CheckExact(obj)) ?\ + __Pyx_PyDict_GetItem(obj, name) : PyObject_GetItem(obj, name)) +#else +#define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key) +#define __Pyx_PyObject_Dict_GetItem(obj, name) PyObject_GetItem(obj, name) +#endif + +/* GetException.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb) +static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#else +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); +#endif + +/* KeywordStringCheck.proto */ +static int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* function_name, int kw_allowed); + +/* RaiseException.proto */ +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); + +/* pyfrozenset_new.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyFrozenSet_New(PyObject* it); + +/* PySetContains.proto */ +static CYTHON_INLINE int __Pyx_PySet_ContainsTF(PyObject* key, PyObject* set, int eq); + +/* IncludeStringH.proto */ +#include + +/* BytesEquals.proto */ +static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); + +/* UnicodeEquals.proto */ +static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); + +/* StrEquals.proto */ +#if PY_MAJOR_VERSION >= 3 +#define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals +#else +#define __Pyx_PyString_Equals __Pyx_PyBytes_Equals +#endif + +/* PyDictContains.proto */ +static CYTHON_INLINE int __Pyx_PyDict_ContainsTF(PyObject* item, PyObject* dict, int eq) { + int result = PyDict_Contains(dict, item); + return unlikely(result < 0) ? result : (result == (eq == Py_EQ)); +} + +/* PySequenceContains.proto */ +static CYTHON_INLINE int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* seq, int eq) { + int result = PySequence_Contains(seq, item); + return unlikely(result < 0) ? result : (result == (eq == Py_EQ)); +} + +/* GetItemInt.proto */ +#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ + __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\ + (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\ + __Pyx_GetItemInt_Generic(o, to_py_func(i)))) +#define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ + __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ + (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL)) +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, + int wraparound, int boundscheck); +#define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ + __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ + (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL)) +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, + int wraparound, int boundscheck); +static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j); +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, + int is_list, int wraparound, int boundscheck); + +/* ObjectGetItem.proto */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key); +#else +#define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key) +#endif + +/* HasAttr.proto */ +static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *); + +/* SliceTupleAndList.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyList_GetSlice(PyObject* src, Py_ssize_t start, Py_ssize_t stop); +static CYTHON_INLINE PyObject* __Pyx_PyTuple_GetSlice(PyObject* src, Py_ssize_t start, Py_ssize_t stop); +#else +#define __Pyx_PyList_GetSlice(seq, start, stop) PySequence_GetSlice(seq, start, stop) +#define __Pyx_PyTuple_GetSlice(seq, start, stop) PySequence_GetSlice(seq, start, stop) +#endif + +/* TypeImport.proto */ +#ifndef __PYX_HAVE_RT_ImportType_proto +#define __PYX_HAVE_RT_ImportType_proto +enum __Pyx_ImportType_CheckSize { + __Pyx_ImportType_CheckSize_Error = 0, + __Pyx_ImportType_CheckSize_Warn = 1, + __Pyx_ImportType_CheckSize_Ignore = 2 +}; +static PyTypeObject *__Pyx_ImportType(PyObject* module, const char *module_name, const char *class_name, size_t size, enum __Pyx_ImportType_CheckSize check_size); +#endif + +/* PyObject_GenericGetAttrNoDict.proto */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name); +#else +#define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr +#endif + +/* SetVTable.proto */ +static int __Pyx_SetVtable(PyObject *dict, void *vtable); + +/* GetVTable.proto */ +static void* __Pyx_GetVtable(PyObject *dict); + +/* Import.proto */ +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); + +/* ImportFrom.proto */ +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); + +/* FetchCommonType.proto */ +static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); + +/* CythonFunction.proto */ +#define __Pyx_CyFunction_USED 1 +#define __Pyx_CYFUNCTION_STATICMETHOD 0x01 +#define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 +#define __Pyx_CYFUNCTION_CCLASS 0x04 +#define __Pyx_CyFunction_GetClosure(f)\ + (((__pyx_CyFunctionObject *) (f))->func_closure) +#define __Pyx_CyFunction_GetClassObj(f)\ + (((__pyx_CyFunctionObject *) (f))->func_classobj) +#define __Pyx_CyFunction_Defaults(type, f)\ + ((type *)(((__pyx_CyFunctionObject *) (f))->defaults)) +#define __Pyx_CyFunction_SetDefaultsGetter(f, g)\ + ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g) +typedef struct { + PyCFunctionObject func; +#if PY_VERSION_HEX < 0x030500A0 + PyObject *func_weakreflist; +#endif + PyObject *func_dict; + PyObject *func_name; + PyObject *func_qualname; + PyObject *func_doc; + PyObject *func_globals; + PyObject *func_code; + PyObject *func_closure; + PyObject *func_classobj; + void *defaults; + int defaults_pyobjects; + int flags; + PyObject *defaults_tuple; + PyObject *defaults_kwdict; + PyObject *(*defaults_getter)(PyObject *); + PyObject *func_annotations; +} __pyx_CyFunctionObject; +static PyTypeObject *__pyx_CyFunctionType = 0; +#define __Pyx_CyFunction_Check(obj) (__Pyx_TypeCheck(obj, __pyx_CyFunctionType)) +#define __Pyx_CyFunction_NewEx(ml, flags, qualname, self, module, globals, code)\ + __Pyx_CyFunction_New(__pyx_CyFunctionType, ml, flags, qualname, self, module, globals, code) +static PyObject *__Pyx_CyFunction_New(PyTypeObject *, PyMethodDef *ml, + int flags, PyObject* qualname, + PyObject *self, + PyObject *module, PyObject *globals, + PyObject* code); +static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, + size_t size, + int pyobjects); +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, + PyObject *tuple); +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, + PyObject *dict); +static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m, + PyObject *dict); +static int __pyx_CyFunction_init(void); + +/* PyObjectSetAttrStr.proto */ +#if CYTHON_USE_TYPE_SLOTS +#define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o, n, NULL) +static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value); +#else +#define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n) +#define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v) +#endif + +/* GetModuleGlobalName.proto */ +#if CYTHON_USE_DICT_VERSIONS +#define __Pyx_GetModuleGlobalName(var, name) {\ + static PY_UINT64_T __pyx_dict_version = 0;\ + static PyObject *__pyx_dict_cached_value = NULL;\ + (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\ + (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\ + __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ +} +#define __Pyx_GetModuleGlobalNameUncached(var, name) {\ + PY_UINT64_T __pyx_dict_version;\ + PyObject *__pyx_dict_cached_value;\ + (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ +} +static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value); +#else +#define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name) +#define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name) +static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name); +#endif + +/* Globals.proto */ +static PyObject* __Pyx_Globals(void); + +/* CLineInTraceback.proto */ +#ifdef CYTHON_CLINE_IN_TRACEBACK +#define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) +#else +static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line); +#endif + +/* CodeObjectCache.proto */ +typedef struct { + PyCodeObject* code_object; + int code_line; +} __Pyx_CodeObjectCacheEntry; +struct __Pyx_CodeObjectCache { + int count; + int max_count; + __Pyx_CodeObjectCacheEntry* entries; +}; +static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); +static PyCodeObject *__pyx_find_code_object(int code_line); +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); + +/* AddTraceback.proto */ +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename); + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); + +/* CIntFromPy.proto */ +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); + +/* CIntFromPy.proto */ +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); + +/* FastTypeChecks.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) +static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b); +static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type); +static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2); +#else +#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) +#define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) +#define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) +#endif +#define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) + +/* CheckBinaryVersion.proto */ +static int __Pyx_check_binary_version(void); + +/* VoidPtrExport.proto */ +static int __Pyx_ExportVoidPtr(PyObject *name, void *p, const char *sig); + +/* FunctionExport.proto */ +static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig); + +/* VoidPtrImport.proto */ +static int __Pyx_ImportVoidPtr(PyObject *module, const char *name, void **p, const char *sig); + +/* FunctionImport.proto */ +static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig); + +/* InitStrings.proto */ +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); + +static struct __pyx_obj_6gevent_6_local_local *__pyx_f_6gevent_6_local_5local___copy__(struct __pyx_obj_6gevent_6_local_local *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/ + +/* Module declarations from 'cython' */ + +/* Module declarations from 'weakref' */ + +/* Module declarations from 'gevent.__ident' */ +static PyTypeObject *__pyx_ptype_6gevent_7__ident_ref = 0; +static PyTypeObject *__pyx_ptype_6gevent_7__ident_ValuedWeakRef = 0; +static PyTypeObject *__pyx_ptype_6gevent_7__ident_IdentRegistry = 0; +static PyObject **__pyx_vp_6gevent_7__ident_heappop = 0; +#define __pyx_v_6gevent_7__ident_heappop (*__pyx_vp_6gevent_7__ident_heappop) +static PyObject **__pyx_vp_6gevent_7__ident_heappush = 0; +#define __pyx_v_6gevent_7__ident_heappush (*__pyx_vp_6gevent_7__ident_heappush) +static PyObject **__pyx_vp_6gevent_7__ident_WeakKeyDictionary = 0; +#define __pyx_v_6gevent_7__ident_WeakKeyDictionary (*__pyx_vp_6gevent_7__ident_WeakKeyDictionary) + +/* Module declarations from 'greenlet' */ + +/* Module declarations from 'gevent.__greenlet_primitives' */ +static PyTypeObject *__pyx_ptype_6gevent_21__greenlet_primitives_greenlet = 0; +static PyTypeObject *__pyx_ptype_6gevent_21__greenlet_primitives_TrackedRawGreenlet = 0; +static PyTypeObject *__pyx_ptype_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop = 0; +static PyObject **__pyx_vp_6gevent_21__greenlet_primitives_get_objects = 0; +#define __pyx_v_6gevent_21__greenlet_primitives_get_objects (*__pyx_vp_6gevent_21__greenlet_primitives_get_objects) +static PyObject **__pyx_vp_6gevent_21__greenlet_primitives_wref = 0; +#define __pyx_v_6gevent_21__greenlet_primitives_wref (*__pyx_vp_6gevent_21__greenlet_primitives_wref) +static PyObject **__pyx_vp_6gevent_21__greenlet_primitives_BlockingSwitchOutError = 0; +#define __pyx_v_6gevent_21__greenlet_primitives_BlockingSwitchOutError (*__pyx_vp_6gevent_21__greenlet_primitives_BlockingSwitchOutError) +static int *__pyx_vp_6gevent_21__greenlet_primitives__greenlet_imported = 0; +#define __pyx_v_6gevent_21__greenlet_primitives__greenlet_imported (*__pyx_vp_6gevent_21__greenlet_primitives__greenlet_imported) + +/* Module declarations from 'gevent.__hub_local' */ +static PyObject **__pyx_vp_6gevent_11__hub_local__threadlocal = 0; +#define __pyx_v_6gevent_11__hub_local__threadlocal (*__pyx_vp_6gevent_11__hub_local__threadlocal) +static struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *(*__pyx_f_6gevent_11__hub_local_get_hub_noargs)(int __pyx_skip_dispatch); /*proto*/ + +/* Module declarations from 'gevent.__waiter' */ +static PyTypeObject *__pyx_ptype_6gevent_8__waiter_greenlet = 0; +static PyTypeObject *__pyx_ptype_6gevent_8__waiter_Waiter = 0; +static PyTypeObject *__pyx_ptype_6gevent_8__waiter_MultipleWaiter = 0; +static PyObject **__pyx_vp_6gevent_8__waiter_sys = 0; +#define __pyx_v_6gevent_8__waiter_sys (*__pyx_vp_6gevent_8__waiter_sys) +static PyObject **__pyx_vp_6gevent_8__waiter_ConcurrentObjectUseError = 0; +#define __pyx_v_6gevent_8__waiter_ConcurrentObjectUseError (*__pyx_vp_6gevent_8__waiter_ConcurrentObjectUseError) +static int *__pyx_vp_6gevent_8__waiter__greenlet_imported = 0; +#define __pyx_v_6gevent_8__waiter__greenlet_imported (*__pyx_vp_6gevent_8__waiter__greenlet_imported) +static PyObject **__pyx_vp_6gevent_8__waiter__NONE = 0; +#define __pyx_v_6gevent_8__waiter__NONE (*__pyx_vp_6gevent_8__waiter__NONE) + +/* Module declarations from 'types' */ + +/* Module declarations from 'gevent._greenlet' */ +static PyTypeObject *__pyx_ptype_6gevent_9_greenlet_greenlet = 0; +static PyTypeObject *__pyx_ptype_6gevent_9_greenlet_CodeType = 0; +static PyTypeObject *__pyx_ptype_6gevent_9_greenlet_FrameType = 0; +static PyTypeObject *__pyx_ptype_6gevent_9_greenlet_SpawnedLink = 0; +static PyTypeObject *__pyx_ptype_6gevent_9_greenlet_SuccessSpawnedLink = 0; +static PyTypeObject *__pyx_ptype_6gevent_9_greenlet_FailureSpawnedLink = 0; +static PyTypeObject *__pyx_ptype_6gevent_9_greenlet__Frame = 0; +static PyTypeObject *__pyx_ptype_6gevent_9_greenlet_Greenlet = 0; +static PyTypeObject *__pyx_ptype_6gevent_9_greenlet__dummy_event = 0; +static int *__pyx_vp_6gevent_9_greenlet__PYPY = 0; +#define __pyx_v_6gevent_9_greenlet__PYPY (*__pyx_vp_6gevent_9_greenlet__PYPY) +static PyObject **__pyx_vp_6gevent_9_greenlet_sys_getframe = 0; +#define __pyx_v_6gevent_9_greenlet_sys_getframe (*__pyx_vp_6gevent_9_greenlet_sys_getframe) +static PyObject **__pyx_vp_6gevent_9_greenlet_sys_exc_info = 0; +#define __pyx_v_6gevent_9_greenlet_sys_exc_info (*__pyx_vp_6gevent_9_greenlet_sys_exc_info) +static PyObject **__pyx_vp_6gevent_9_greenlet_Timeout = 0; +#define __pyx_v_6gevent_9_greenlet_Timeout (*__pyx_vp_6gevent_9_greenlet_Timeout) +static PyObject **__pyx_vp_6gevent_9_greenlet_GreenletExit = 0; +#define __pyx_v_6gevent_9_greenlet_GreenletExit (*__pyx_vp_6gevent_9_greenlet_GreenletExit) +static PyObject **__pyx_vp_6gevent_9_greenlet_InvalidSwitchError = 0; +#define __pyx_v_6gevent_9_greenlet_InvalidSwitchError (*__pyx_vp_6gevent_9_greenlet_InvalidSwitchError) +static int *__pyx_vp_6gevent_9_greenlet__greenlet_imported = 0; +#define __pyx_v_6gevent_9_greenlet__greenlet_imported (*__pyx_vp_6gevent_9_greenlet__greenlet_imported) +static PyObject **__pyx_vp_6gevent_9_greenlet__greenlet__init__ = 0; +#define __pyx_v_6gevent_9_greenlet__greenlet__init__ (*__pyx_vp_6gevent_9_greenlet__greenlet__init__) +static PyObject **__pyx_vp_6gevent_9_greenlet__threadlocal = 0; +#define __pyx_v_6gevent_9_greenlet__threadlocal (*__pyx_vp_6gevent_9_greenlet__threadlocal) +static PyObject **__pyx_vp_6gevent_9_greenlet_get_hub_class = 0; +#define __pyx_v_6gevent_9_greenlet_get_hub_class (*__pyx_vp_6gevent_9_greenlet_get_hub_class) +static PyObject **__pyx_vp_6gevent_9_greenlet_wref = 0; +#define __pyx_v_6gevent_9_greenlet_wref (*__pyx_vp_6gevent_9_greenlet_wref) +static PyObject **__pyx_vp_6gevent_9_greenlet_dump_traceback = 0; +#define __pyx_v_6gevent_9_greenlet_dump_traceback (*__pyx_vp_6gevent_9_greenlet_dump_traceback) +static PyObject **__pyx_vp_6gevent_9_greenlet_load_traceback = 0; +#define __pyx_v_6gevent_9_greenlet_load_traceback (*__pyx_vp_6gevent_9_greenlet_load_traceback) +static PyObject **__pyx_vp_6gevent_9_greenlet_wait = 0; +#define __pyx_v_6gevent_9_greenlet_wait (*__pyx_vp_6gevent_9_greenlet_wait) +static PyObject **__pyx_vp_6gevent_9_greenlet_iwait = 0; +#define __pyx_v_6gevent_9_greenlet_iwait (*__pyx_vp_6gevent_9_greenlet_iwait) +static PyObject **__pyx_vp_6gevent_9_greenlet_reraise = 0; +#define __pyx_v_6gevent_9_greenlet_reraise (*__pyx_vp_6gevent_9_greenlet_reraise) +static PyObject **__pyx_vp_6gevent_9_greenlet_GEVENT_CONFIG = 0; +#define __pyx_v_6gevent_9_greenlet_GEVENT_CONFIG (*__pyx_vp_6gevent_9_greenlet_GEVENT_CONFIG) +static struct __pyx_obj_6gevent_9_greenlet__dummy_event **__pyx_vp_6gevent_9_greenlet__cancelled_start_event = 0; +#define __pyx_v_6gevent_9_greenlet__cancelled_start_event (*__pyx_vp_6gevent_9_greenlet__cancelled_start_event) +static struct __pyx_obj_6gevent_9_greenlet__dummy_event **__pyx_vp_6gevent_9_greenlet__start_completed_event = 0; +#define __pyx_v_6gevent_9_greenlet__start_completed_event (*__pyx_vp_6gevent_9_greenlet__start_completed_event) +static PyObject **__pyx_vp_6gevent_9_greenlet__spawn_callbacks = 0; +#define __pyx_v_6gevent_9_greenlet__spawn_callbacks (*__pyx_vp_6gevent_9_greenlet__spawn_callbacks) + +/* Module declarations from 'gevent._local' */ +static PyTypeObject *__pyx_ptype_6gevent_6_local_greenlet = 0; +static PyTypeObject *__pyx_ptype_6gevent_6_local__wrefdict = 0; +static PyTypeObject *__pyx_ptype_6gevent_6_local__greenlet_deleted = 0; +static PyTypeObject *__pyx_ptype_6gevent_6_local__local_deleted = 0; +static PyTypeObject *__pyx_ptype_6gevent_6_local__localimpl = 0; +static PyTypeObject *__pyx_ptype_6gevent_6_local__localimpl_dict_entry = 0; +static PyTypeObject *__pyx_ptype_6gevent_6_local_local = 0; +static int __pyx_v_6gevent_6_local__PYPY; +static PyObject *__pyx_v_6gevent_6_local_ref = 0; +static PyObject *__pyx_v_6gevent_6_local_copy = 0; +static PyObject *__pyx_v_6gevent_6_local__marker = 0; +static PyObject *__pyx_v_6gevent_6_local_key_prefix = 0; +static int __pyx_v_6gevent_6_local__greenlet_imported; +static PyObject *__pyx_v_6gevent_6_local__local_attrs = 0; +static CYTHON_INLINE PyGreenlet *__pyx_f_6gevent_6_local_getcurrent(void); /*proto*/ +static CYTHON_INLINE void __pyx_f_6gevent_6_local_greenlet_init(void); /*proto*/ +static void __pyx_f_6gevent_6_local__init(void); /*proto*/ +static PyObject *__pyx_f_6gevent_6_local__localimpl_create_dict(struct __pyx_obj_6gevent_6_local__localimpl *, PyGreenlet *, PyObject *); /*proto*/ +static CYTHON_INLINE PyObject *__pyx_f_6gevent_6_local__local_get_dict(struct __pyx_obj_6gevent_6_local_local *); /*proto*/ +static PyObject *__pyx_f_6gevent_6_local__local__copy_dict_from(struct __pyx_obj_6gevent_6_local_local *, struct __pyx_obj_6gevent_6_local__localimpl *, PyObject *); /*proto*/ +static PyObject *__pyx_f_6gevent_6_local__local_find_descriptors(struct __pyx_obj_6gevent_6_local_local *); /*proto*/ +static PyObject *__pyx_f_6gevent_6_local_all_local_dicts_for_greenlet(PyGreenlet *, int __pyx_skip_dispatch); /*proto*/ +#define __Pyx_MODULE_NAME "gevent._local" +extern int __pyx_module_is_main_gevent___local; +int __pyx_module_is_main_gevent___local = 0; + +/* Implementation of 'gevent._local' */ +static PyObject *__pyx_builtin___import__; +static PyObject *__pyx_builtin_object; +static PyObject *__pyx_builtin_TypeError; +static PyObject *__pyx_builtin_classmethod; +static PyObject *__pyx_builtin_id; +static PyObject *__pyx_builtin_AttributeError; +static PyObject *__pyx_builtin_KeyError; +static PyObject *__pyx_builtin_super; +static const char __pyx_k_id[] = "id"; +static const char __pyx_k_kw[] = "kw"; +static const char __pyx_k_PY2[] = "PY2"; +static const char __pyx_k_all[] = "__all__"; +static const char __pyx_k_cls[] = "cls"; +static const char __pyx_k_get[] = "__get__"; +static const char __pyx_k_idt[] = "idt"; +static const char __pyx_k_key[] = "key"; +static const char __pyx_k_mro[] = "mro"; +static const char __pyx_k_new[] = "__new__"; +static const char __pyx_k_pop[] = "pop"; +static const char __pyx_k_ref[] = "ref"; +static const char __pyx_k_set[] = "__set__"; +static const char __pyx_k_None[] = "None"; +static const char __pyx_k_PYPY[] = "_PYPY"; +static const char __pyx_k_args[] = "args"; +static const char __pyx_k_copy[] = "__copy__"; +static const char __pyx_k_dict[] = "__dict__"; +static const char __pyx_k_init[] = "__init__"; +static const char __pyx_k_main[] = "__main__"; +static const char __pyx_k_name[] = "__name__"; +static const char __pyx_k_self[] = "self"; +static const char __pyx_k_test[] = "__test__"; +static const char __pyx_k_cinit[] = "__cinit__"; +static const char __pyx_k_class[] = "__class__"; +static const char __pyx_k_dicts[] = "dicts"; +static const char __pyx_k_get_2[] = "get"; +static const char __pyx_k_items[] = "items"; +static const char __pyx_k_local[] = "local"; +static const char __pyx_k_slots[] = "__slots__"; +static const char __pyx_k_super[] = "super"; +static const char __pyx_k_PYPY_2[] = "PYPY"; +static const char __pyx_k_copy_2[] = "copy"; +static const char __pyx_k_delete[] = "__delete__"; +static const char __pyx_k_import[] = "__import__"; +static const char __pyx_k_kwargs[] = "kwargs"; +static const char __pyx_k_lambda[] = ""; +static const char __pyx_k_marker[] = "_marker"; +static const char __pyx_k_object[] = "object"; +static const char __pyx_k_unlink[] = "unlink"; +static const char __pyx_k_unused[] = "_unused"; +static const char __pyx_k_getattr[] = "__getattr__"; +static const char __pyx_k_rawlink[] = "rawlink"; +static const char __pyx_k_setattr[] = "__setattr__"; +static const char __pyx_k_weakref[] = "weakref"; +static const char __pyx_k_wrdicts[] = "wrdicts"; +static const char __pyx_k_KeyError[] = "KeyError"; +static const char __pyx_k_greenlet[] = "greenlet"; +static const char __pyx_k_id_local[] = "id_local"; +static const char __pyx_k_pyx_capi[] = "__pyx_capi__"; +static const char __pyx_k_wrefdict[] = "_wrefdict"; +static const char __pyx_k_wrthread[] = "wrthread"; +static const char __pyx_k_TypeError[] = "TypeError"; +static const char __pyx_k_localargs[] = "localargs"; +static const char __pyx_k_localdict[] = "localdict"; +static const char __pyx_k_localimpl[] = "_localimpl"; +static const char __pyx_k_weakref_2[] = "__weakref__"; +static const char __pyx_k_getcurrent[] = "getcurrent"; +static const char __pyx_k_key_prefix[] = "key_prefix"; +static const char __pyx_k_local_type[] = "local_type"; +static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__"; +static const char __pyx_k_wrgreenlet[] = "wrgreenlet"; +static const char __pyx_k_classmethod[] = "classmethod"; +static const char __pyx_k_local__impl[] = "_local__impl"; +static const char __pyx_k_local_attrs[] = "_local_attrs"; +static const char __pyx_k_localkwargs[] = "localkwargs"; +static const char __pyx_k_localtypeid[] = "localtypeid"; +static const char __pyx_k_getattribute[] = "__getattribute__"; +static const char __pyx_k_gevent__util[] = "gevent._util"; +static const char __pyx_k_local___copy[] = "local.__copy__"; +static const char __pyx_k_local_type_2[] = "_local_type"; +static const char __pyx_k_gevent__local[] = "gevent._local"; +static const char __pyx_k_greenlet_init[] = "greenlet_init"; +static const char __pyx_k_local_deleted[] = "_local_deleted"; +static const char __pyx_k_AttributeError[] = "AttributeError"; +static const char __pyx_k_gevent__compat[] = "gevent._compat"; +static const char __pyx_k_import_c_accel[] = "import_c_accel"; +static const char __pyx_k_local_type_vars[] = "_local_type_vars"; +static const char __pyx_k_greenlet_deleted[] = "greenlet_deleted"; +static const char __pyx_k_greenlet_imported[] = "_greenlet_imported"; +static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; +static const char __pyx_k_greenlet_deleted_2[] = "_greenlet_deleted"; +static const char __pyx_k_src_gevent_local_py[] = "src\\gevent\\local.py"; +static const char __pyx_k_localimpl_dict_entry[] = "_localimpl_dict_entry"; +static const char __pyx_k_gevent_local_localimpl[] = "_gevent_local_localimpl_"; +static const char __pyx_k_local_type_del_descriptors[] = "_local_type_del_descriptors"; +static const char __pyx_k_local_type_get_descriptors[] = "_local_type_get_descriptors"; +static const char __pyx_k_local_type_set_descriptors[] = "_local_type_set_descriptors"; +static const char __pyx_k_r_object_has_no_attribute_s[] = "%r object has no attribute '%s'"; +static const char __pyx_k_all_local_dicts_for_greenlet[] = "all_local_dicts_for_greenlet"; +static const char __pyx_k_r_object_attribute___dict___is[] = "%r object attribute '__dict__' is read-only"; +static const char __pyx_k_Greenlet_local_objects_This_mod[] = "\nGreenlet-local objects.\n\nThis module is based on `_threading_local.py`__ from the standard\nlibrary of Python 3.4.\n\n__ https://github.com/python/cpython/blob/3.4/Lib/_threading_local.py\n\nGreenlet-local objects support the management of greenlet-local data.\nIf you have data that you want to be local to a greenlet, simply create\na greenlet-local object and use its attributes:\n\n >>> mydata = local()\n >>> mydata.number = 42\n >>> mydata.number\n 42\n\nYou can also access the local-object's dictionary:\n\n >>> mydata.__dict__\n {'number': 42}\n >>> mydata.__dict__.setdefault('widgets', [])\n []\n >>> mydata.widgets\n []\n\nWhat's important about greenlet-local objects is that their data are\nlocal to a greenlet. If we access the data in a different greenlet:\n\n >>> log = []\n >>> def f():\n ... items = list(mydata.__dict__.items())\n ... items.sort()\n ... log.append(items)\n ... mydata.number = 11\n ... log.append(mydata.number)\n >>> greenlet = gevent.spawn(f)\n >>> greenlet.join()\n >>> log\n [[], 11]\n\nwe get different data. Furthermore, changes made in the other greenlet\ndon't affect data seen in this greenlet:\n\n >>> mydata.number\n 42\n\nOf course, values you get from a local object, including a __dict__\nattribute, are for whatever greenlet was current at the time the\nattribute was read. For that reason, you generally don't want to save\nthese values across greenlets, as they apply only to the greenlet they\ncame from.\n\nYou can create custom local objects by subclassing the local class:\n\n >>> class MyLocal(local):\n ... number = 2\n ... initialized = False\n ... def __init__(self, **kw):\n ... if self.initialized:\n ... raise SystemError('__init__ called too many times')\n ... self.initialized = True\n ... self.__dict__.update(kw)\n ... def squared(self):\n ... return self.number ** 2\n\nThis can be useful to support default val""ues, methods and\ninitialization. Note that if you define an __init__ method, it will be\ncalled each time the local object is used in a separate greenlet. This\nis necessary to initialize each greenlet's dictionary.\n\nNow if we create a local object:\n\n >>> mydata = MyLocal(color='red')\n\nNow we have a default number:\n\n >>> mydata.number\n 2\n\nan initial color:\n\n >>> mydata.color\n 'red'\n >>> del mydata.color\n\nAnd a method that operates on the data:\n\n >>> mydata.squared()\n 4\n\nAs before, we can access the data in a separate greenlet:\n\n >>> log = []\n >>> greenlet = gevent.spawn(f)\n >>> greenlet.join()\n >>> log\n [[('color', 'red'), ('initialized', True)], 11]\n\nwithout affecting this greenlet's data:\n\n >>> mydata.number\n 2\n >>> mydata.color\n Traceback (most recent call last):\n ...\n AttributeError: 'MyLocal' object has no attribute 'color'\n\nNote that subclasses can define slots, but they are not greenlet\nlocal. They are shared across greenlets::\n\n >>> class MyLocal(local):\n ... __slots__ = 'number'\n\n >>> mydata = MyLocal()\n >>> mydata.number = 42\n >>> mydata.color = 'red'\n\nSo, the separate greenlet:\n\n >>> greenlet = gevent.spawn(f)\n >>> greenlet.join()\n\naffects what we see:\n\n >>> mydata.number\n 11\n\n>>> del mydata\n\n.. versionchanged:: 1.1a2\n Update the implementation to match Python 3.4 instead of Python 2.5.\n This results in locals being eligible for garbage collection as soon\n as their greenlet exits.\n\n.. versionchanged:: 1.2.3\n Use a weak-reference to clear the greenlet link we establish in case\n the local object dies before the greenlet does.\n\n.. versionchanged:: 1.3a1\n Implement the methods for attribute access directly, handling\n descriptors directly here. This allows removing the use of a lock\n and facilitates greatly improved performance.\n\n.. versionchanged:: 1.3a1\n The ``__init__`` method of subclasses of ``local`` is no longer\n called wit""h a lock held. CPython does not use such a lock in its\n native implementation. This could potentially show as a difference\n if code that uses multiple dependent attributes in ``__slots__``\n (which are shared across all greenlets) switches during ``__init__``.\n\n"; +static const char __pyx_k_local_type_set_or_del_descripto[] = "_local_type_set_or_del_descriptors"; +static const char __pyx_k_Initialization_arguments_are_not[] = "Initialization arguments are not supported"; +static PyObject *__pyx_n_s_AttributeError; +static PyObject *__pyx_kp_s_Initialization_arguments_are_not; +static PyObject *__pyx_n_s_KeyError; +static PyObject *__pyx_n_s_None; +static PyObject *__pyx_n_s_PY2; +static PyObject *__pyx_n_s_PYPY; +static PyObject *__pyx_n_s_PYPY_2; +static PyObject *__pyx_n_s_TypeError; +static PyObject *__pyx_n_s_all; +static PyObject *__pyx_n_s_all_local_dicts_for_greenlet; +static PyObject *__pyx_n_s_args; +static PyObject *__pyx_n_s_cinit; +static PyObject *__pyx_n_s_class; +static PyObject *__pyx_n_s_classmethod; +static PyObject *__pyx_n_s_cline_in_traceback; +static PyObject *__pyx_n_s_cls; +static PyObject *__pyx_n_s_copy; +static PyObject *__pyx_n_s_copy_2; +static PyObject *__pyx_n_s_delete; +static PyObject *__pyx_n_s_dict; +static PyObject *__pyx_n_s_dicts; +static PyObject *__pyx_n_s_get; +static PyObject *__pyx_n_s_get_2; +static PyObject *__pyx_n_s_getattr; +static PyObject *__pyx_n_s_getattribute; +static PyObject *__pyx_n_s_getcurrent; +static PyObject *__pyx_n_s_gevent__compat; +static PyObject *__pyx_n_s_gevent__local; +static PyObject *__pyx_n_s_gevent__util; +static PyObject *__pyx_n_s_gevent_local_localimpl; +static PyObject *__pyx_n_s_greenlet; +static PyObject *__pyx_n_s_greenlet_deleted; +static PyObject *__pyx_n_s_greenlet_deleted_2; +static PyObject *__pyx_n_s_greenlet_imported; +static PyObject *__pyx_n_s_greenlet_init; +static PyObject *__pyx_n_s_id; +static PyObject *__pyx_n_s_id_local; +static PyObject *__pyx_n_s_idt; +static PyObject *__pyx_n_s_import; +static PyObject *__pyx_n_s_import_c_accel; +static PyObject *__pyx_n_s_init; +static PyObject *__pyx_n_s_items; +static PyObject *__pyx_n_s_key; +static PyObject *__pyx_n_s_key_prefix; +static PyObject *__pyx_n_s_kw; +static PyObject *__pyx_n_s_kwargs; +static PyObject *__pyx_n_s_lambda; +static PyObject *__pyx_n_s_local; +static PyObject *__pyx_n_s_local___copy; +static PyObject *__pyx_n_s_local__impl; +static PyObject *__pyx_n_s_local_attrs; +static PyObject *__pyx_n_s_local_deleted; +static PyObject *__pyx_n_s_local_type; +static PyObject *__pyx_n_s_local_type_2; +static PyObject *__pyx_n_s_local_type_del_descriptors; +static PyObject *__pyx_n_s_local_type_get_descriptors; +static PyObject *__pyx_n_s_local_type_set_descriptors; +static PyObject *__pyx_n_s_local_type_set_or_del_descripto; +static PyObject *__pyx_n_s_local_type_vars; +static PyObject *__pyx_n_s_localargs; +static PyObject *__pyx_n_s_localdict; +static PyObject *__pyx_n_s_localimpl; +static PyObject *__pyx_n_s_localimpl_dict_entry; +static PyObject *__pyx_n_s_localkwargs; +static PyObject *__pyx_n_s_localtypeid; +static PyObject *__pyx_n_s_main; +static PyObject *__pyx_n_s_marker; +static PyObject *__pyx_n_s_mro; +static PyObject *__pyx_n_s_name; +static PyObject *__pyx_n_s_new; +static PyObject *__pyx_n_s_object; +static PyObject *__pyx_n_s_pop; +static PyObject *__pyx_n_s_pyx_capi; +static PyObject *__pyx_n_s_pyx_vtable; +static PyObject *__pyx_kp_s_r_object_attribute___dict___is; +static PyObject *__pyx_kp_s_r_object_has_no_attribute_s; +static PyObject *__pyx_n_s_rawlink; +static PyObject *__pyx_n_s_ref; +static PyObject *__pyx_n_s_self; +static PyObject *__pyx_n_s_set; +static PyObject *__pyx_n_s_setattr; +static PyObject *__pyx_n_s_slots; +static PyObject *__pyx_kp_s_src_gevent_local_py; +static PyObject *__pyx_n_s_super; +static PyObject *__pyx_n_s_test; +static PyObject *__pyx_n_s_unlink; +static PyObject *__pyx_n_s_unused; +static PyObject *__pyx_n_s_weakref; +static PyObject *__pyx_n_s_weakref_2; +static PyObject *__pyx_n_s_wrdicts; +static PyObject *__pyx_n_s_wrefdict; +static PyObject *__pyx_n_s_wrgreenlet; +static PyObject *__pyx_n_s_wrthread; +static PyObject *__pyx_lambda_funcdef_6gevent_6_local_lambda(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_6gevent_6_local_all_local_dicts_for_greenlet(CYTHON_UNUSED PyObject *__pyx_self, PyGreenlet *__pyx_v_greenlet); /* proto */ +static int __pyx_pf_6gevent_6_local_17_greenlet_deleted___init__(struct __pyx_obj_6gevent_6_local__greenlet_deleted *__pyx_v_self, PyObject *__pyx_v_idt, PyObject *__pyx_v_wrdicts); /* proto */ +static PyObject *__pyx_pf_6gevent_6_local_17_greenlet_deleted_2__call__(struct __pyx_obj_6gevent_6_local__greenlet_deleted *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v__unused); /* proto */ +static int __pyx_pf_6gevent_6_local_14_local_deleted___init__(struct __pyx_obj_6gevent_6_local__local_deleted *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_wrthread, PyObject *__pyx_v_greenlet_deleted); /* proto */ +static PyObject *__pyx_pf_6gevent_6_local_14_local_deleted_2__call__(struct __pyx_obj_6gevent_6_local__local_deleted *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v__unused); /* proto */ +static int __pyx_pf_6gevent_6_local_10_localimpl___init__(struct __pyx_obj_6gevent_6_local__localimpl *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs, PyObject *__pyx_v_local_type, PyObject *__pyx_v_id_local); /* proto */ +static int __pyx_pf_6gevent_6_local_21_localimpl_dict_entry___init__(struct __pyx_obj_6gevent_6_local__localimpl_dict_entry *__pyx_v_self, PyObject *__pyx_v_wrgreenlet, PyObject *__pyx_v_localdict); /* proto */ +static int __pyx_pf_6gevent_6_local_5local___cinit__(struct __pyx_obj_6gevent_6_local_local *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kw); /* proto */ +static PyObject *__pyx_pf_6gevent_6_local_5local_2__getattribute__(struct __pyx_obj_6gevent_6_local_local *__pyx_v_self, PyObject *__pyx_v_name); /* proto */ +static int __pyx_pf_6gevent_6_local_5local_4__setattr__(struct __pyx_obj_6gevent_6_local_local *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6gevent_6_local_5local_6__delattr__(struct __pyx_obj_6gevent_6_local_local *__pyx_v_self, PyObject *__pyx_v_name); /* proto */ +static PyObject *__pyx_pf_6gevent_6_local_5local_8__copy__(struct __pyx_obj_6gevent_6_local_local *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_6_local_2__new__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_cls, PyObject *__pyx_v_args, PyObject *__pyx_v_kw); /* proto */ +static PyObject *__pyx_tp_new_6gevent_6_local__wrefdict(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6gevent_6_local__greenlet_deleted(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6gevent_6_local__local_deleted(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6gevent_6_local__localimpl(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6gevent_6_local__localimpl_dict_entry(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6gevent_6_local_local(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_get = {0, &__pyx_n_s_get_2, 0, 0, 0}; +static PyObject *__pyx_tuple_; +static PyObject *__pyx_tuple__2; +static PyObject *__pyx_tuple__4; +static PyObject *__pyx_tuple__5; +static PyObject *__pyx_tuple__6; +static PyObject *__pyx_tuple__7; +static PyObject *__pyx_tuple__8; +static PyObject *__pyx_tuple__10; +static PyObject *__pyx_codeobj__3; +static PyObject *__pyx_codeobj__9; +static PyObject *__pyx_codeobj__11; +/* Late includes */ + +/* "src/gevent/local.py":161 + * + * locals()['getcurrent'] = __import__('greenlet').getcurrent + * locals()['greenlet_init'] = lambda: None # <<<<<<<<<<<<<< + * + * __all__ = [ + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_local_4lambda(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyMethodDef __pyx_mdef_6gevent_6_local_4lambda = {"lambda", (PyCFunction)__pyx_pw_6gevent_6_local_4lambda, METH_NOARGS, 0}; +static PyObject *__pyx_pw_6gevent_6_local_4lambda(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("lambda (wrapper)", 0); + __pyx_r = __pyx_lambda_funcdef_6gevent_6_local_lambda(__pyx_self); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_lambda_funcdef_6gevent_6_local_lambda(CYTHON_UNUSED PyObject *__pyx_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("lambda", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/local.py":179 + * # That final tuple is actually a localimpl_dict_entry object. + * + * def all_local_dicts_for_greenlet(greenlet): # <<<<<<<<<<<<<< + * """ + * Internal debug helper for getting the local values associated + */ + +static PyObject *__pyx_pw_6gevent_6_local_1all_local_dicts_for_greenlet(PyObject *__pyx_self, PyObject *__pyx_v_greenlet); /*proto*/ +static PyObject *__pyx_f_6gevent_6_local_all_local_dicts_for_greenlet(PyGreenlet *__pyx_v_greenlet, CYTHON_UNUSED int __pyx_skip_dispatch) { + PyObject *__pyx_v_result = 0; + struct __pyx_obj_6gevent_6_local__localimpl *__pyx_v_local_impl = 0; + struct __pyx_obj_6gevent_6_local__localimpl_dict_entry *__pyx_v_entry = 0; + PyObject *__pyx_v_k = 0; + PyObject *__pyx_v_greenlet_dict = 0; + PyObject *__pyx_v_id_greenlet = NULL; + PyObject *__pyx_v_v = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + int __pyx_t_8; + int __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + int __pyx_t_11; + __Pyx_RefNannySetupContext("all_local_dicts_for_greenlet", 0); + + /* "src/gevent/local.py":191 + * """ + * + * result = [] # <<<<<<<<<<<<<< + * id_greenlet = id(greenlet) + * greenlet_dict = greenlet.__dict__ + */ + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 191, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_result = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "src/gevent/local.py":192 + * + * result = [] + * id_greenlet = id(greenlet) # <<<<<<<<<<<<<< + * greenlet_dict = greenlet.__dict__ + * for k, v in greenlet_dict.items(): + */ + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_greenlet)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 192, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_id_greenlet = __pyx_t_1; + __pyx_t_1 = 0; + + /* "src/gevent/local.py":193 + * result = [] + * id_greenlet = id(greenlet) + * greenlet_dict = greenlet.__dict__ # <<<<<<<<<<<<<< + * for k, v in greenlet_dict.items(): + * if not k.startswith(key_prefix): + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_greenlet), __pyx_n_s_dict); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 193, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(PyDict_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 193, __pyx_L1_error) + __pyx_v_greenlet_dict = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "src/gevent/local.py":194 + * id_greenlet = id(greenlet) + * greenlet_dict = greenlet.__dict__ + * for k, v in greenlet_dict.items(): # <<<<<<<<<<<<<< + * if not k.startswith(key_prefix): + * continue + */ + __pyx_t_2 = 0; + if (unlikely(__pyx_v_greenlet_dict == Py_None)) { + PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items"); + __PYX_ERR(0, 194, __pyx_L1_error) + } + __pyx_t_5 = __Pyx_dict_iterator(__pyx_v_greenlet_dict, 1, __pyx_n_s_items, (&__pyx_t_3), (&__pyx_t_4)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 194, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_1); + __pyx_t_1 = __pyx_t_5; + __pyx_t_5 = 0; + while (1) { + __pyx_t_7 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_3, &__pyx_t_2, &__pyx_t_5, &__pyx_t_6, NULL, __pyx_t_4); + if (unlikely(__pyx_t_7 == 0)) break; + if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(0, 194, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_6); + if (!(likely(PyString_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_5)->tp_name), 0))) __PYX_ERR(0, 194, __pyx_L1_error) + __Pyx_XDECREF_SET(__pyx_v_k, ((PyObject*)__pyx_t_5)); + __pyx_t_5 = 0; + __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_6); + __pyx_t_6 = 0; + + /* "src/gevent/local.py":195 + * greenlet_dict = greenlet.__dict__ + * for k, v in greenlet_dict.items(): + * if not k.startswith(key_prefix): # <<<<<<<<<<<<<< + * continue + * local_impl = v() + */ + if (unlikely(__pyx_v_k == Py_None)) { + PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "startswith"); + __PYX_ERR(0, 195, __pyx_L1_error) + } + __pyx_t_8 = __Pyx_PyStr_Tailmatch(__pyx_v_k, __pyx_v_6gevent_6_local_key_prefix, 0, PY_SSIZE_T_MAX, -1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 195, __pyx_L1_error) + __pyx_t_9 = ((!(__pyx_t_8 != 0)) != 0); + if (__pyx_t_9) { + + /* "src/gevent/local.py":196 + * for k, v in greenlet_dict.items(): + * if not k.startswith(key_prefix): + * continue # <<<<<<<<<<<<<< + * local_impl = v() + * if local_impl is None: + */ + goto __pyx_L3_continue; + + /* "src/gevent/local.py":195 + * greenlet_dict = greenlet.__dict__ + * for k, v in greenlet_dict.items(): + * if not k.startswith(key_prefix): # <<<<<<<<<<<<<< + * continue + * local_impl = v() + */ + } + + /* "src/gevent/local.py":197 + * if not k.startswith(key_prefix): + * continue + * local_impl = v() # <<<<<<<<<<<<<< + * if local_impl is None: + * continue + */ + __Pyx_INCREF(__pyx_v_v); + __pyx_t_5 = __pyx_v_v; __pyx_t_10 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_5); + if (likely(__pyx_t_10)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_10); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_5, function); + } + } + __pyx_t_6 = (__pyx_t_10) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_10) : __Pyx_PyObject_CallNoArg(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 197, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_6gevent_6_local__localimpl))))) __PYX_ERR(0, 197, __pyx_L1_error) + __Pyx_XDECREF_SET(__pyx_v_local_impl, ((struct __pyx_obj_6gevent_6_local__localimpl *)__pyx_t_6)); + __pyx_t_6 = 0; + + /* "src/gevent/local.py":198 + * continue + * local_impl = v() + * if local_impl is None: # <<<<<<<<<<<<<< + * continue + * entry = local_impl.dicts.get(id_greenlet) + */ + __pyx_t_9 = (((PyObject *)__pyx_v_local_impl) == Py_None); + __pyx_t_8 = (__pyx_t_9 != 0); + if (__pyx_t_8) { + + /* "src/gevent/local.py":199 + * local_impl = v() + * if local_impl is None: + * continue # <<<<<<<<<<<<<< + * entry = local_impl.dicts.get(id_greenlet) + * if entry is None: + */ + goto __pyx_L3_continue; + + /* "src/gevent/local.py":198 + * continue + * local_impl = v() + * if local_impl is None: # <<<<<<<<<<<<<< + * continue + * entry = local_impl.dicts.get(id_greenlet) + */ + } + + /* "src/gevent/local.py":200 + * if local_impl is None: + * continue + * entry = local_impl.dicts.get(id_greenlet) # <<<<<<<<<<<<<< + * if entry is None: + * # Not yet used in this greenlet. + */ + if (unlikely(__pyx_v_local_impl->dicts == Py_None)) { + PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get"); + __PYX_ERR(0, 200, __pyx_L1_error) + } + __pyx_t_6 = __Pyx_PyDict_GetItemDefault(__pyx_v_local_impl->dicts, __pyx_v_id_greenlet, Py_None); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 200, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_6gevent_6_local__localimpl_dict_entry))))) __PYX_ERR(0, 200, __pyx_L1_error) + __Pyx_XDECREF_SET(__pyx_v_entry, ((struct __pyx_obj_6gevent_6_local__localimpl_dict_entry *)__pyx_t_6)); + __pyx_t_6 = 0; + + /* "src/gevent/local.py":201 + * continue + * entry = local_impl.dicts.get(id_greenlet) + * if entry is None: # <<<<<<<<<<<<<< + * # Not yet used in this greenlet. + * continue + */ + __pyx_t_8 = (((PyObject *)__pyx_v_entry) == Py_None); + __pyx_t_9 = (__pyx_t_8 != 0); + if (__pyx_t_9) { + + /* "src/gevent/local.py":203 + * if entry is None: + * # Not yet used in this greenlet. + * continue # <<<<<<<<<<<<<< + * assert entry.wrgreenlet() is greenlet + * result.append((local_impl.localtypeid, entry.localdict)) + */ + goto __pyx_L3_continue; + + /* "src/gevent/local.py":201 + * continue + * entry = local_impl.dicts.get(id_greenlet) + * if entry is None: # <<<<<<<<<<<<<< + * # Not yet used in this greenlet. + * continue + */ + } + + /* "src/gevent/local.py":204 + * # Not yet used in this greenlet. + * continue + * assert entry.wrgreenlet() is greenlet # <<<<<<<<<<<<<< + * result.append((local_impl.localtypeid, entry.localdict)) + * + */ + #ifndef CYTHON_WITHOUT_ASSERTIONS + if (unlikely(!Py_OptimizeFlag)) { + __Pyx_INCREF(__pyx_v_entry->wrgreenlet); + __pyx_t_5 = __pyx_v_entry->wrgreenlet; __pyx_t_10 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_5); + if (likely(__pyx_t_10)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_10); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_5, function); + } + } + __pyx_t_6 = (__pyx_t_10) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_10) : __Pyx_PyObject_CallNoArg(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 204, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_9 = (__pyx_t_6 == ((PyObject *)__pyx_v_greenlet)); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (unlikely(!(__pyx_t_9 != 0))) { + PyErr_SetNone(PyExc_AssertionError); + __PYX_ERR(0, 204, __pyx_L1_error) + } + } + #endif + + /* "src/gevent/local.py":205 + * continue + * assert entry.wrgreenlet() is greenlet + * result.append((local_impl.localtypeid, entry.localdict)) # <<<<<<<<<<<<<< + * + * return result + */ + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 205, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(__pyx_v_local_impl->localtypeid); + __Pyx_GIVEREF(__pyx_v_local_impl->localtypeid); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_local_impl->localtypeid); + __Pyx_INCREF(__pyx_v_entry->localdict); + __Pyx_GIVEREF(__pyx_v_entry->localdict); + PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_entry->localdict); + __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_6); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 205, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_L3_continue:; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/local.py":207 + * result.append((local_impl.localtypeid, entry.localdict)) + * + * return result # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; + goto __pyx_L0; + + /* "src/gevent/local.py":179 + * # That final tuple is actually a localimpl_dict_entry object. + * + * def all_local_dicts_for_greenlet(greenlet): # <<<<<<<<<<<<<< + * """ + * Internal debug helper for getting the local values associated + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_AddTraceback("gevent._local.all_local_dicts_for_greenlet", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XDECREF((PyObject *)__pyx_v_local_impl); + __Pyx_XDECREF((PyObject *)__pyx_v_entry); + __Pyx_XDECREF(__pyx_v_k); + __Pyx_XDECREF(__pyx_v_greenlet_dict); + __Pyx_XDECREF(__pyx_v_id_greenlet); + __Pyx_XDECREF(__pyx_v_v); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_local_1all_local_dicts_for_greenlet(PyObject *__pyx_self, PyObject *__pyx_v_greenlet); /*proto*/ +static char __pyx_doc_6gevent_6_local_all_local_dicts_for_greenlet[] = "all_local_dicts_for_greenlet(greenlet greenlet)\n\n Internal debug helper for getting the local values associated\n with a greenlet. This is subject to change or removal at any time.\n\n :return: A list of ((type, id), {}) pairs, where the first element\n is the type and id of the local object and the second object is its\n instance dictionary, as seen from this greenlet.\n\n .. versionadded:: 1.3a2\n "; +static PyMethodDef __pyx_mdef_6gevent_6_local_1all_local_dicts_for_greenlet = {"all_local_dicts_for_greenlet", (PyCFunction)__pyx_pw_6gevent_6_local_1all_local_dicts_for_greenlet, METH_O, __pyx_doc_6gevent_6_local_all_local_dicts_for_greenlet}; +static PyObject *__pyx_pw_6gevent_6_local_1all_local_dicts_for_greenlet(PyObject *__pyx_self, PyObject *__pyx_v_greenlet) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("all_local_dicts_for_greenlet (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_greenlet), __pyx_ptype_6gevent_6_local_greenlet, 1, "greenlet", 0))) __PYX_ERR(0, 179, __pyx_L1_error) + __pyx_r = __pyx_pf_6gevent_6_local_all_local_dicts_for_greenlet(__pyx_self, ((PyGreenlet *)__pyx_v_greenlet)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_local_all_local_dicts_for_greenlet(CYTHON_UNUSED PyObject *__pyx_self, PyGreenlet *__pyx_v_greenlet) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("all_local_dicts_for_greenlet", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6gevent_6_local_all_local_dicts_for_greenlet(__pyx_v_greenlet, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 179, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent._local.all_local_dicts_for_greenlet", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/local.py":224 + * __slots__ = ('idt', 'wrdicts') + * + * def __init__(self, idt, wrdicts): # <<<<<<<<<<<<<< + * self.idt = idt + * self.wrdicts = wrdicts + */ + +/* Python wrapper */ +static int __pyx_pw_6gevent_6_local_17_greenlet_deleted_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6gevent_6_local_17_greenlet_deleted_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_idt = 0; + PyObject *__pyx_v_wrdicts = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_idt,&__pyx_n_s_wrdicts,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_idt)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_wrdicts)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(0, 224, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 224, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_idt = values[0]; + __pyx_v_wrdicts = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 224, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent._local._greenlet_deleted.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_6_local_17_greenlet_deleted___init__(((struct __pyx_obj_6gevent_6_local__greenlet_deleted *)__pyx_v_self), __pyx_v_idt, __pyx_v_wrdicts); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_6_local_17_greenlet_deleted___init__(struct __pyx_obj_6gevent_6_local__greenlet_deleted *__pyx_v_self, PyObject *__pyx_v_idt, PyObject *__pyx_v_wrdicts) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__", 0); + + /* "src/gevent/local.py":225 + * + * def __init__(self, idt, wrdicts): + * self.idt = idt # <<<<<<<<<<<<<< + * self.wrdicts = wrdicts + * + */ + __Pyx_INCREF(__pyx_v_idt); + __Pyx_GIVEREF(__pyx_v_idt); + __Pyx_GOTREF(__pyx_v_self->idt); + __Pyx_DECREF(__pyx_v_self->idt); + __pyx_v_self->idt = __pyx_v_idt; + + /* "src/gevent/local.py":226 + * def __init__(self, idt, wrdicts): + * self.idt = idt + * self.wrdicts = wrdicts # <<<<<<<<<<<<<< + * + * def __call__(self, _unused): + */ + __Pyx_INCREF(__pyx_v_wrdicts); + __Pyx_GIVEREF(__pyx_v_wrdicts); + __Pyx_GOTREF(__pyx_v_self->wrdicts); + __Pyx_DECREF(__pyx_v_self->wrdicts); + __pyx_v_self->wrdicts = __pyx_v_wrdicts; + + /* "src/gevent/local.py":224 + * __slots__ = ('idt', 'wrdicts') + * + * def __init__(self, idt, wrdicts): # <<<<<<<<<<<<<< + * self.idt = idt + * self.wrdicts = wrdicts + */ + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/local.py":228 + * self.wrdicts = wrdicts + * + * def __call__(self, _unused): # <<<<<<<<<<<<<< + * dicts = self.wrdicts() + * if dicts: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_local_17_greenlet_deleted_3__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6gevent_6_local_17_greenlet_deleted_3__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + CYTHON_UNUSED PyObject *__pyx_v__unused = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__call__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_unused,0}; + PyObject* values[1] = {0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_unused)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__call__") < 0)) __PYX_ERR(0, 228, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + } + __pyx_v__unused = values[0]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__call__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 228, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent._local._greenlet_deleted.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_6_local_17_greenlet_deleted_2__call__(((struct __pyx_obj_6gevent_6_local__greenlet_deleted *)__pyx_v_self), __pyx_v__unused); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_local_17_greenlet_deleted_2__call__(struct __pyx_obj_6gevent_6_local__greenlet_deleted *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v__unused) { + PyObject *__pyx_v_dicts = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + __Pyx_RefNannySetupContext("__call__", 0); + + /* "src/gevent/local.py":229 + * + * def __call__(self, _unused): + * dicts = self.wrdicts() # <<<<<<<<<<<<<< + * if dicts: + * dicts.pop(self.idt, None) + */ + __Pyx_INCREF(__pyx_v_self->wrdicts); + __pyx_t_2 = __pyx_v_self->wrdicts; __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 229, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_dicts = __pyx_t_1; + __pyx_t_1 = 0; + + /* "src/gevent/local.py":230 + * def __call__(self, _unused): + * dicts = self.wrdicts() + * if dicts: # <<<<<<<<<<<<<< + * dicts.pop(self.idt, None) + * + */ + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_dicts); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 230, __pyx_L1_error) + if (__pyx_t_4) { + + /* "src/gevent/local.py":231 + * dicts = self.wrdicts() + * if dicts: + * dicts.pop(self.idt, None) # <<<<<<<<<<<<<< + * + * class _local_deleted(object): + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_dicts, __pyx_n_s_pop); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 231, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + __pyx_t_5 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_5 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_self->idt, Py_None}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 231, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_self->idt, Py_None}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 231, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else + #endif + { + __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 231, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (__pyx_t_3) { + __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); __pyx_t_3 = NULL; + } + __Pyx_INCREF(__pyx_v_self->idt); + __Pyx_GIVEREF(__pyx_v_self->idt); + PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_self->idt); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, Py_None); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 231, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/local.py":230 + * def __call__(self, _unused): + * dicts = self.wrdicts() + * if dicts: # <<<<<<<<<<<<<< + * dicts.pop(self.idt, None) + * + */ + } + + /* "src/gevent/local.py":228 + * self.wrdicts = wrdicts + * + * def __call__(self, _unused): # <<<<<<<<<<<<<< + * dicts = self.wrdicts() + * if dicts: + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("gevent._local._greenlet_deleted.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_dicts); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/local.py":236 + * __slots__ = ('key', 'wrthread', 'greenlet_deleted') + * + * def __init__(self, key, wrthread, greenlet_deleted): # <<<<<<<<<<<<<< + * self.key = key + * self.wrthread = wrthread + */ + +/* Python wrapper */ +static int __pyx_pw_6gevent_6_local_14_local_deleted_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6gevent_6_local_14_local_deleted_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_key = 0; + PyObject *__pyx_v_wrthread = 0; + PyObject *__pyx_v_greenlet_deleted = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_key,&__pyx_n_s_wrthread,&__pyx_n_s_greenlet_deleted,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_wrthread)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 1); __PYX_ERR(0, 236, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_greenlet_deleted)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 2); __PYX_ERR(0, 236, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 236, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + } + __pyx_v_key = values[0]; + __pyx_v_wrthread = values[1]; + __pyx_v_greenlet_deleted = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 236, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent._local._local_deleted.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_6_local_14_local_deleted___init__(((struct __pyx_obj_6gevent_6_local__local_deleted *)__pyx_v_self), __pyx_v_key, __pyx_v_wrthread, __pyx_v_greenlet_deleted); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_6_local_14_local_deleted___init__(struct __pyx_obj_6gevent_6_local__local_deleted *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_wrthread, PyObject *__pyx_v_greenlet_deleted) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "src/gevent/local.py":237 + * + * def __init__(self, key, wrthread, greenlet_deleted): + * self.key = key # <<<<<<<<<<<<<< + * self.wrthread = wrthread + * self.greenlet_deleted = greenlet_deleted + */ + if (!(likely(PyString_CheckExact(__pyx_v_key))||((__pyx_v_key) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_v_key)->tp_name), 0))) __PYX_ERR(0, 237, __pyx_L1_error) + __pyx_t_1 = __pyx_v_key; + __Pyx_INCREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_self->key); + __Pyx_DECREF(__pyx_v_self->key); + __pyx_v_self->key = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "src/gevent/local.py":238 + * def __init__(self, key, wrthread, greenlet_deleted): + * self.key = key + * self.wrthread = wrthread # <<<<<<<<<<<<<< + * self.greenlet_deleted = greenlet_deleted + * + */ + __Pyx_INCREF(__pyx_v_wrthread); + __Pyx_GIVEREF(__pyx_v_wrthread); + __Pyx_GOTREF(__pyx_v_self->wrthread); + __Pyx_DECREF(__pyx_v_self->wrthread); + __pyx_v_self->wrthread = __pyx_v_wrthread; + + /* "src/gevent/local.py":239 + * self.key = key + * self.wrthread = wrthread + * self.greenlet_deleted = greenlet_deleted # <<<<<<<<<<<<<< + * + * def __call__(self, _unused): + */ + if (!(likely(((__pyx_v_greenlet_deleted) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_greenlet_deleted, __pyx_ptype_6gevent_6_local__greenlet_deleted))))) __PYX_ERR(0, 239, __pyx_L1_error) + __pyx_t_1 = __pyx_v_greenlet_deleted; + __Pyx_INCREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_self->greenlet_deleted); + __Pyx_DECREF(((PyObject *)__pyx_v_self->greenlet_deleted)); + __pyx_v_self->greenlet_deleted = ((struct __pyx_obj_6gevent_6_local__greenlet_deleted *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "src/gevent/local.py":236 + * __slots__ = ('key', 'wrthread', 'greenlet_deleted') + * + * def __init__(self, key, wrthread, greenlet_deleted): # <<<<<<<<<<<<<< + * self.key = key + * self.wrthread = wrthread + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent._local._local_deleted.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/local.py":241 + * self.greenlet_deleted = greenlet_deleted + * + * def __call__(self, _unused): # <<<<<<<<<<<<<< + * thread = self.wrthread() + * if thread is not None: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_local_14_local_deleted_3__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6gevent_6_local_14_local_deleted_3__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + CYTHON_UNUSED PyObject *__pyx_v__unused = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__call__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_unused,0}; + PyObject* values[1] = {0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_unused)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__call__") < 0)) __PYX_ERR(0, 241, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + } + __pyx_v__unused = values[0]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__call__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 241, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent._local._local_deleted.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_6_local_14_local_deleted_2__call__(((struct __pyx_obj_6gevent_6_local__local_deleted *)__pyx_v_self), __pyx_v__unused); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_local_14_local_deleted_2__call__(struct __pyx_obj_6gevent_6_local__local_deleted *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v__unused) { + PyObject *__pyx_v_thread = NULL; + PyObject *__pyx_v_unlink = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + int __pyx_t_9; + __Pyx_RefNannySetupContext("__call__", 0); + + /* "src/gevent/local.py":242 + * + * def __call__(self, _unused): + * thread = self.wrthread() # <<<<<<<<<<<<<< + * if thread is not None: + * try: + */ + __Pyx_INCREF(__pyx_v_self->wrthread); + __pyx_t_2 = __pyx_v_self->wrthread; __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 242, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_thread = __pyx_t_1; + __pyx_t_1 = 0; + + /* "src/gevent/local.py":243 + * def __call__(self, _unused): + * thread = self.wrthread() + * if thread is not None: # <<<<<<<<<<<<<< + * try: + * unlink = thread.unlink + */ + __pyx_t_4 = (__pyx_v_thread != Py_None); + __pyx_t_5 = (__pyx_t_4 != 0); + if (__pyx_t_5) { + + /* "src/gevent/local.py":244 + * thread = self.wrthread() + * if thread is not None: + * try: # <<<<<<<<<<<<<< + * unlink = thread.unlink + * except AttributeError: + */ + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); + __Pyx_XGOTREF(__pyx_t_6); + __Pyx_XGOTREF(__pyx_t_7); + __Pyx_XGOTREF(__pyx_t_8); + /*try:*/ { + + /* "src/gevent/local.py":245 + * if thread is not None: + * try: + * unlink = thread.unlink # <<<<<<<<<<<<<< + * except AttributeError: + * pass + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_thread, __pyx_n_s_unlink); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 245, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_unlink = __pyx_t_1; + __pyx_t_1 = 0; + + /* "src/gevent/local.py":244 + * thread = self.wrthread() + * if thread is not None: + * try: # <<<<<<<<<<<<<< + * unlink = thread.unlink + * except AttributeError: + */ + } + + /* "src/gevent/local.py":249 + * pass + * else: + * unlink(self.greenlet_deleted) # <<<<<<<<<<<<<< + * del thread.__dict__[self.key] + * + */ + /*else:*/ { + __Pyx_INCREF(__pyx_v_unlink); + __pyx_t_2 = __pyx_v_unlink; __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, ((PyObject *)__pyx_v_self->greenlet_deleted)) : __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_v_self->greenlet_deleted)); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 249, __pyx_L6_except_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + goto __pyx_L9_try_end; + __pyx_L4_error:; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/local.py":246 + * try: + * unlink = thread.unlink + * except AttributeError: # <<<<<<<<<<<<<< + * pass + * else: + */ + __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_AttributeError); + if (__pyx_t_9) { + __Pyx_ErrRestore(0,0,0); + goto __pyx_L5_exception_handled; + } + goto __pyx_L6_except_error; + __pyx_L6_except_error:; + + /* "src/gevent/local.py":244 + * thread = self.wrthread() + * if thread is not None: + * try: # <<<<<<<<<<<<<< + * unlink = thread.unlink + * except AttributeError: + */ + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); + goto __pyx_L1_error; + __pyx_L5_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); + __pyx_L9_try_end:; + } + + /* "src/gevent/local.py":250 + * else: + * unlink(self.greenlet_deleted) + * del thread.__dict__[self.key] # <<<<<<<<<<<<<< + * + * class _localimpl(object): + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_thread, __pyx_n_s_dict); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 250, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (unlikely(PyObject_DelItem(__pyx_t_1, __pyx_v_self->key) < 0)) __PYX_ERR(0, 250, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/local.py":243 + * def __call__(self, _unused): + * thread = self.wrthread() + * if thread is not None: # <<<<<<<<<<<<<< + * try: + * unlink = thread.unlink + */ + } + + /* "src/gevent/local.py":241 + * self.greenlet_deleted = greenlet_deleted + * + * def __call__(self, _unused): # <<<<<<<<<<<<<< + * thread = self.wrthread() + * if thread is not None: + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("gevent._local._local_deleted.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_thread); + __Pyx_XDECREF(__pyx_v_unlink); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/local.py":259 + * '__weakref__',) + * + * def __init__(self, args, kwargs, local_type, id_local): # <<<<<<<<<<<<<< + * self.key = key_prefix + str(id(self)) + * # { id(greenlet) -> _localimpl_dict_entry(ref(greenlet), greenlet-local dict) } + */ + +/* Python wrapper */ +static int __pyx_pw_6gevent_6_local_10_localimpl_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6gevent_6_local_10_localimpl_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_args = 0; + PyObject *__pyx_v_kwargs = 0; + PyObject *__pyx_v_local_type = 0; + PyObject *__pyx_v_id_local = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_args,&__pyx_n_s_kwargs,&__pyx_n_s_local_type,&__pyx_n_s_id_local,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kwargs)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, 1); __PYX_ERR(0, 259, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_local_type)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, 2); __PYX_ERR(0, 259, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 3: + if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_id_local)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, 3); __PYX_ERR(0, 259, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 259, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_args = values[0]; + __pyx_v_kwargs = values[1]; + __pyx_v_local_type = values[2]; + __pyx_v_id_local = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 259, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent._local._localimpl.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_6_local_10_localimpl___init__(((struct __pyx_obj_6gevent_6_local__localimpl *)__pyx_v_self), __pyx_v_args, __pyx_v_kwargs, __pyx_v_local_type, __pyx_v_id_local); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_6_local_10_localimpl___init__(struct __pyx_obj_6gevent_6_local__localimpl *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs, PyObject *__pyx_v_local_type, PyObject *__pyx_v_id_local) { + PyGreenlet *__pyx_v_greenlet = NULL; + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "src/gevent/local.py":260 + * + * def __init__(self, args, kwargs, local_type, id_local): + * self.key = key_prefix + str(id(self)) # <<<<<<<<<<<<<< + * # { id(greenlet) -> _localimpl_dict_entry(ref(greenlet), greenlet-local dict) } + * self.dicts = _wrefdict() + */ + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 260, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyString_Type)), __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 260, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyNumber_Add(__pyx_v_6gevent_6_local_key_prefix, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 260, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(PyString_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 260, __pyx_L1_error) + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_self->key); + __Pyx_DECREF(__pyx_v_self->key); + __pyx_v_self->key = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "src/gevent/local.py":262 + * self.key = key_prefix + str(id(self)) + * # { id(greenlet) -> _localimpl_dict_entry(ref(greenlet), greenlet-local dict) } + * self.dicts = _wrefdict() # <<<<<<<<<<<<<< + * self.localargs = args + * self.localkwargs = kwargs + */ + __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_6gevent_6_local__wrefdict)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 262, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_self->dicts); + __Pyx_DECREF(__pyx_v_self->dicts); + __pyx_v_self->dicts = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "src/gevent/local.py":263 + * # { id(greenlet) -> _localimpl_dict_entry(ref(greenlet), greenlet-local dict) } + * self.dicts = _wrefdict() + * self.localargs = args # <<<<<<<<<<<<<< + * self.localkwargs = kwargs + * self.localtypeid = local_type, id_local + */ + if (!(likely(PyTuple_CheckExact(__pyx_v_args))||((__pyx_v_args) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v_args)->tp_name), 0))) __PYX_ERR(0, 263, __pyx_L1_error) + __pyx_t_1 = __pyx_v_args; + __Pyx_INCREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_self->localargs); + __Pyx_DECREF(__pyx_v_self->localargs); + __pyx_v_self->localargs = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "src/gevent/local.py":264 + * self.dicts = _wrefdict() + * self.localargs = args + * self.localkwargs = kwargs # <<<<<<<<<<<<<< + * self.localtypeid = local_type, id_local + * + */ + if (!(likely(PyDict_CheckExact(__pyx_v_kwargs))||((__pyx_v_kwargs) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_v_kwargs)->tp_name), 0))) __PYX_ERR(0, 264, __pyx_L1_error) + __pyx_t_1 = __pyx_v_kwargs; + __Pyx_INCREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_self->localkwargs); + __Pyx_DECREF(__pyx_v_self->localkwargs); + __pyx_v_self->localkwargs = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "src/gevent/local.py":265 + * self.localargs = args + * self.localkwargs = kwargs + * self.localtypeid = local_type, id_local # <<<<<<<<<<<<<< + * + * # We need to create the thread dict in anticipation of + */ + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 265, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_local_type); + __Pyx_GIVEREF(__pyx_v_local_type); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_local_type); + __Pyx_INCREF(__pyx_v_id_local); + __Pyx_GIVEREF(__pyx_v_id_local); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_id_local); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_self->localtypeid); + __Pyx_DECREF(__pyx_v_self->localtypeid); + __pyx_v_self->localtypeid = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "src/gevent/local.py":270 + * # __init__ being called, to make sure we don't call it + * # again ourselves. MUST do this before setting any attributes. + * greenlet = getcurrent() # pylint:disable=undefined-variable # <<<<<<<<<<<<<< + * _localimpl_create_dict(self, greenlet, id(greenlet)) + * + */ + __pyx_t_1 = ((PyObject *)__pyx_f_6gevent_6_local_getcurrent()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 270, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_greenlet = ((PyGreenlet *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "src/gevent/local.py":271 + * # again ourselves. MUST do this before setting any attributes. + * greenlet = getcurrent() # pylint:disable=undefined-variable + * _localimpl_create_dict(self, greenlet, id(greenlet)) # <<<<<<<<<<<<<< + * + * class _localimpl_dict_entry(object): + */ + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_greenlet)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 271, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __pyx_f_6gevent_6_local__localimpl_create_dict(__pyx_v_self, __pyx_v_greenlet, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 271, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/local.py":259 + * '__weakref__',) + * + * def __init__(self, args, kwargs, local_type, id_local): # <<<<<<<<<<<<<< + * self.key = key_prefix + str(id(self)) + * # { id(greenlet) -> _localimpl_dict_entry(ref(greenlet), greenlet-local dict) } + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent._local._localimpl.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_greenlet); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/local.py":282 + * __slots__ = ('wrgreenlet', 'localdict') + * + * def __init__(self, wrgreenlet, localdict): # <<<<<<<<<<<<<< + * self.wrgreenlet = wrgreenlet + * self.localdict = localdict + */ + +/* Python wrapper */ +static int __pyx_pw_6gevent_6_local_21_localimpl_dict_entry_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6gevent_6_local_21_localimpl_dict_entry_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_wrgreenlet = 0; + PyObject *__pyx_v_localdict = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_wrgreenlet,&__pyx_n_s_localdict,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_wrgreenlet)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_localdict)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(0, 282, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 282, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_wrgreenlet = values[0]; + __pyx_v_localdict = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 282, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent._local._localimpl_dict_entry.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_6_local_21_localimpl_dict_entry___init__(((struct __pyx_obj_6gevent_6_local__localimpl_dict_entry *)__pyx_v_self), __pyx_v_wrgreenlet, __pyx_v_localdict); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_6_local_21_localimpl_dict_entry___init__(struct __pyx_obj_6gevent_6_local__localimpl_dict_entry *__pyx_v_self, PyObject *__pyx_v_wrgreenlet, PyObject *__pyx_v_localdict) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "src/gevent/local.py":283 + * + * def __init__(self, wrgreenlet, localdict): + * self.wrgreenlet = wrgreenlet # <<<<<<<<<<<<<< + * self.localdict = localdict + * + */ + __Pyx_INCREF(__pyx_v_wrgreenlet); + __Pyx_GIVEREF(__pyx_v_wrgreenlet); + __Pyx_GOTREF(__pyx_v_self->wrgreenlet); + __Pyx_DECREF(__pyx_v_self->wrgreenlet); + __pyx_v_self->wrgreenlet = __pyx_v_wrgreenlet; + + /* "src/gevent/local.py":284 + * def __init__(self, wrgreenlet, localdict): + * self.wrgreenlet = wrgreenlet + * self.localdict = localdict # <<<<<<<<<<<<<< + * + * # We use functions instead of methods so that they can be cdef'd in + */ + if (!(likely(PyDict_CheckExact(__pyx_v_localdict))||((__pyx_v_localdict) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_v_localdict)->tp_name), 0))) __PYX_ERR(0, 284, __pyx_L1_error) + __pyx_t_1 = __pyx_v_localdict; + __Pyx_INCREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_self->localdict); + __Pyx_DECREF(__pyx_v_self->localdict); + __pyx_v_self->localdict = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "src/gevent/local.py":282 + * __slots__ = ('wrgreenlet', 'localdict') + * + * def __init__(self, wrgreenlet, localdict): # <<<<<<<<<<<<<< + * self.wrgreenlet = wrgreenlet + * self.localdict = localdict + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent._local._localimpl_dict_entry.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/local.py":294 + * + * + * def _localimpl_create_dict(self, greenlet, id_greenlet): # <<<<<<<<<<<<<< + * """Create a new dict for the current thread, and return it.""" + * localdict = {} + */ + +static PyObject *__pyx_f_6gevent_6_local__localimpl_create_dict(struct __pyx_obj_6gevent_6_local__localimpl *__pyx_v_self, PyGreenlet *__pyx_v_greenlet, PyObject *__pyx_v_id_greenlet) { + PyObject *__pyx_v_localdict = 0; + PyObject *__pyx_v_key = 0; + struct __pyx_obj_6gevent_6_local__greenlet_deleted *__pyx_v_greenlet_deleted = 0; + struct __pyx_obj_6gevent_6_local__local_deleted *__pyx_v_local_deleted = 0; + PyObject *__pyx_v_wrdicts = NULL; + PyObject *__pyx_v_rawlink = NULL; + PyObject *__pyx_v_wrthread = NULL; + PyObject *__pyx_v_wrlocal = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_t_5; + int __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + __Pyx_RefNannySetupContext("_localimpl_create_dict", 0); + + /* "src/gevent/local.py":296 + * def _localimpl_create_dict(self, greenlet, id_greenlet): + * """Create a new dict for the current thread, and return it.""" + * localdict = {} # <<<<<<<<<<<<<< + * key = self.key + * + */ + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 296, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_localdict = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "src/gevent/local.py":297 + * """Create a new dict for the current thread, and return it.""" + * localdict = {} + * key = self.key # <<<<<<<<<<<<<< + * + * wrdicts = ref(self.dicts) + */ + __pyx_t_1 = __pyx_v_self->key; + __Pyx_INCREF(__pyx_t_1); + __pyx_v_key = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "src/gevent/local.py":299 + * key = self.key + * + * wrdicts = ref(self.dicts) # <<<<<<<<<<<<<< + * + * # When the greenlet is deleted, remove the local dict. + */ + __Pyx_INCREF(__pyx_v_6gevent_6_local_ref); + __pyx_t_2 = __pyx_v_6gevent_6_local_ref; __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_self->dicts) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_self->dicts); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 299, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_wrdicts = __pyx_t_1; + __pyx_t_1 = 0; + + /* "src/gevent/local.py":310 + * # issue described above. Use rawlink to avoid spawning any + * # more greenlets. + * greenlet_deleted = _greenlet_deleted(id_greenlet, wrdicts) # <<<<<<<<<<<<<< + * + * rawlink = getattr(greenlet, 'rawlink', None) + */ + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 310, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_id_greenlet); + __Pyx_GIVEREF(__pyx_v_id_greenlet); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_id_greenlet); + __Pyx_INCREF(__pyx_v_wrdicts); + __Pyx_GIVEREF(__pyx_v_wrdicts); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_wrdicts); + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6gevent_6_local__greenlet_deleted), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 310, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_greenlet_deleted = ((struct __pyx_obj_6gevent_6_local__greenlet_deleted *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "src/gevent/local.py":312 + * greenlet_deleted = _greenlet_deleted(id_greenlet, wrdicts) + * + * rawlink = getattr(greenlet, 'rawlink', None) # <<<<<<<<<<<<<< + * if rawlink is not None: + * rawlink(greenlet_deleted) + */ + __pyx_t_2 = __Pyx_GetAttr3(((PyObject *)__pyx_v_greenlet), __pyx_n_s_rawlink, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 312, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_rawlink = __pyx_t_2; + __pyx_t_2 = 0; + + /* "src/gevent/local.py":313 + * + * rawlink = getattr(greenlet, 'rawlink', None) + * if rawlink is not None: # <<<<<<<<<<<<<< + * rawlink(greenlet_deleted) + * wrthread = ref(greenlet) + */ + __pyx_t_4 = (__pyx_v_rawlink != Py_None); + __pyx_t_5 = (__pyx_t_4 != 0); + if (__pyx_t_5) { + + /* "src/gevent/local.py":314 + * rawlink = getattr(greenlet, 'rawlink', None) + * if rawlink is not None: + * rawlink(greenlet_deleted) # <<<<<<<<<<<<<< + * wrthread = ref(greenlet) + * else: + */ + __Pyx_INCREF(__pyx_v_rawlink); + __pyx_t_1 = __pyx_v_rawlink; __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_1, function); + } + } + __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_3, ((PyObject *)__pyx_v_greenlet_deleted)) : __Pyx_PyObject_CallOneArg(__pyx_t_1, ((PyObject *)__pyx_v_greenlet_deleted)); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 314, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/local.py":315 + * if rawlink is not None: + * rawlink(greenlet_deleted) + * wrthread = ref(greenlet) # <<<<<<<<<<<<<< + * else: + * wrthread = ref(greenlet, greenlet_deleted) + */ + __Pyx_INCREF(__pyx_v_6gevent_6_local_ref); + __pyx_t_1 = __pyx_v_6gevent_6_local_ref; __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_1, function); + } + } + __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_3, ((PyObject *)__pyx_v_greenlet)) : __Pyx_PyObject_CallOneArg(__pyx_t_1, ((PyObject *)__pyx_v_greenlet)); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 315, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_wrthread = __pyx_t_2; + __pyx_t_2 = 0; + + /* "src/gevent/local.py":313 + * + * rawlink = getattr(greenlet, 'rawlink', None) + * if rawlink is not None: # <<<<<<<<<<<<<< + * rawlink(greenlet_deleted) + * wrthread = ref(greenlet) + */ + goto __pyx_L3; + } + + /* "src/gevent/local.py":317 + * wrthread = ref(greenlet) + * else: + * wrthread = ref(greenlet, greenlet_deleted) # <<<<<<<<<<<<<< + * + * + */ + /*else*/ { + __Pyx_INCREF(__pyx_v_6gevent_6_local_ref); + __pyx_t_1 = __pyx_v_6gevent_6_local_ref; __pyx_t_3 = NULL; + __pyx_t_6 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_1, function); + __pyx_t_6 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_1)) { + PyObject *__pyx_temp[3] = {__pyx_t_3, ((PyObject *)__pyx_v_greenlet), ((PyObject *)__pyx_v_greenlet_deleted)}; + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 317, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_t_2); + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) { + PyObject *__pyx_temp[3] = {__pyx_t_3, ((PyObject *)__pyx_v_greenlet), ((PyObject *)__pyx_v_greenlet_deleted)}; + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 317, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_t_2); + } else + #endif + { + __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 317, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + if (__pyx_t_3) { + __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3); __pyx_t_3 = NULL; + } + __Pyx_INCREF(((PyObject *)__pyx_v_greenlet)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_greenlet)); + PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, ((PyObject *)__pyx_v_greenlet)); + __Pyx_INCREF(((PyObject *)__pyx_v_greenlet_deleted)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_greenlet_deleted)); + PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, ((PyObject *)__pyx_v_greenlet_deleted)); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 317, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_wrthread = __pyx_t_2; + __pyx_t_2 = 0; + } + __pyx_L3:; + + /* "src/gevent/local.py":321 + * + * # When the localimpl is deleted, remove the thread attribute. + * local_deleted = _local_deleted(key, wrthread, greenlet_deleted) # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 321, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_key); + __Pyx_GIVEREF(__pyx_v_key); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_key); + __Pyx_INCREF(__pyx_v_wrthread); + __Pyx_GIVEREF(__pyx_v_wrthread); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_wrthread); + __Pyx_INCREF(((PyObject *)__pyx_v_greenlet_deleted)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_greenlet_deleted)); + PyTuple_SET_ITEM(__pyx_t_2, 2, ((PyObject *)__pyx_v_greenlet_deleted)); + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6gevent_6_local__local_deleted), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 321, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_local_deleted = ((struct __pyx_obj_6gevent_6_local__local_deleted *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "src/gevent/local.py":324 + * + * + * wrlocal = ref(self, local_deleted) # <<<<<<<<<<<<<< + * greenlet.__dict__[key] = wrlocal + * + */ + __Pyx_INCREF(__pyx_v_6gevent_6_local_ref); + __pyx_t_2 = __pyx_v_6gevent_6_local_ref; __pyx_t_7 = NULL; + __pyx_t_6 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_7)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_7); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_6 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[3] = {__pyx_t_7, ((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_local_deleted)}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 324, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[3] = {__pyx_t_7, ((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_local_deleted)}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 324, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else + #endif + { + __pyx_t_3 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 324, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (__pyx_t_7) { + __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_7); __pyx_t_7 = NULL; + } + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_6, ((PyObject *)__pyx_v_self)); + __Pyx_INCREF(((PyObject *)__pyx_v_local_deleted)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_local_deleted)); + PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_6, ((PyObject *)__pyx_v_local_deleted)); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 324, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_wrlocal = __pyx_t_1; + __pyx_t_1 = 0; + + /* "src/gevent/local.py":325 + * + * wrlocal = ref(self, local_deleted) + * greenlet.__dict__[key] = wrlocal # <<<<<<<<<<<<<< + * + * self.dicts[id_greenlet] = _localimpl_dict_entry(wrthread, localdict) + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_greenlet), __pyx_n_s_dict); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 325, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_key, __pyx_v_wrlocal) < 0)) __PYX_ERR(0, 325, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/local.py":327 + * greenlet.__dict__[key] = wrlocal + * + * self.dicts[id_greenlet] = _localimpl_dict_entry(wrthread, localdict) # <<<<<<<<<<<<<< + * return localdict + * + */ + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 327, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_wrthread); + __Pyx_GIVEREF(__pyx_v_wrthread); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_wrthread); + __Pyx_INCREF(__pyx_v_localdict); + __Pyx_GIVEREF(__pyx_v_localdict); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_localdict); + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6gevent_6_local__localimpl_dict_entry), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 327, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(__pyx_v_self->dicts == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 327, __pyx_L1_error) + } + if (unlikely(PyDict_SetItem(__pyx_v_self->dicts, __pyx_v_id_greenlet, __pyx_t_2) < 0)) __PYX_ERR(0, 327, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/local.py":328 + * + * self.dicts[id_greenlet] = _localimpl_dict_entry(wrthread, localdict) + * return localdict # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_localdict); + __pyx_r = __pyx_v_localdict; + goto __pyx_L0; + + /* "src/gevent/local.py":294 + * + * + * def _localimpl_create_dict(self, greenlet, id_greenlet): # <<<<<<<<<<<<<< + * """Create a new dict for the current thread, and return it.""" + * localdict = {} + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("gevent._local._localimpl_create_dict", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_localdict); + __Pyx_XDECREF(__pyx_v_key); + __Pyx_XDECREF((PyObject *)__pyx_v_greenlet_deleted); + __Pyx_XDECREF((PyObject *)__pyx_v_local_deleted); + __Pyx_XDECREF(__pyx_v_wrdicts); + __Pyx_XDECREF(__pyx_v_rawlink); + __Pyx_XDECREF(__pyx_v_wrthread); + __Pyx_XDECREF(__pyx_v_wrlocal); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/local.py":333 + * _marker = object() + * + * def _local_get_dict(self): # <<<<<<<<<<<<<< + * impl = self._local__impl + * # Cython can optimize dict[], but not dict.get() + */ + +static CYTHON_INLINE PyObject *__pyx_f_6gevent_6_local__local_get_dict(struct __pyx_obj_6gevent_6_local_local *__pyx_v_self) { + struct __pyx_obj_6gevent_6_local__localimpl *__pyx_v_impl = 0; + PyObject *__pyx_v_dct = 0; + struct __pyx_obj_6gevent_6_local__localimpl_dict_entry *__pyx_v_entry = 0; + PyGreenlet *__pyx_v_greenlet = NULL; + PyObject *__pyx_v_idg = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + __Pyx_RefNannySetupContext("_local_get_dict", 0); + + /* "src/gevent/local.py":334 + * + * def _local_get_dict(self): + * impl = self._local__impl # <<<<<<<<<<<<<< + * # Cython can optimize dict[], but not dict.get() + * greenlet = getcurrent() # pylint:disable=undefined-variable + */ + __pyx_t_1 = ((PyObject *)__pyx_v_self->_local__impl); + __Pyx_INCREF(__pyx_t_1); + __pyx_v_impl = ((struct __pyx_obj_6gevent_6_local__localimpl *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "src/gevent/local.py":336 + * impl = self._local__impl + * # Cython can optimize dict[], but not dict.get() + * greenlet = getcurrent() # pylint:disable=undefined-variable # <<<<<<<<<<<<<< + * idg = id(greenlet) + * try: + */ + __pyx_t_1 = ((PyObject *)__pyx_f_6gevent_6_local_getcurrent()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 336, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_greenlet = ((PyGreenlet *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "src/gevent/local.py":337 + * # Cython can optimize dict[], but not dict.get() + * greenlet = getcurrent() # pylint:disable=undefined-variable + * idg = id(greenlet) # <<<<<<<<<<<<<< + * try: + * entry = impl.dicts[idg] + */ + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_greenlet)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 337, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_idg = __pyx_t_1; + __pyx_t_1 = 0; + + /* "src/gevent/local.py":338 + * greenlet = getcurrent() # pylint:disable=undefined-variable + * idg = id(greenlet) + * try: # <<<<<<<<<<<<<< + * entry = impl.dicts[idg] + * dct = entry.localdict + */ + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_4); + /*try:*/ { + + /* "src/gevent/local.py":339 + * idg = id(greenlet) + * try: + * entry = impl.dicts[idg] # <<<<<<<<<<<<<< + * dct = entry.localdict + * except KeyError: + */ + if (unlikely(__pyx_v_impl->dicts == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 339, __pyx_L3_error) + } + __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_impl->dicts, __pyx_v_idg); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 339, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_6gevent_6_local__localimpl_dict_entry))))) __PYX_ERR(0, 339, __pyx_L3_error) + __pyx_v_entry = ((struct __pyx_obj_6gevent_6_local__localimpl_dict_entry *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "src/gevent/local.py":340 + * try: + * entry = impl.dicts[idg] + * dct = entry.localdict # <<<<<<<<<<<<<< + * except KeyError: + * dct = _localimpl_create_dict(impl, greenlet, idg) + */ + __pyx_t_1 = __pyx_v_entry->localdict; + __Pyx_INCREF(__pyx_t_1); + __pyx_v_dct = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "src/gevent/local.py":338 + * greenlet = getcurrent() # pylint:disable=undefined-variable + * idg = id(greenlet) + * try: # <<<<<<<<<<<<<< + * entry = impl.dicts[idg] + * dct = entry.localdict + */ + } + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L8_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/local.py":341 + * entry = impl.dicts[idg] + * dct = entry.localdict + * except KeyError: # <<<<<<<<<<<<<< + * dct = _localimpl_create_dict(impl, greenlet, idg) + * self.__init__(*impl.localargs, **impl.localkwargs) + */ + __pyx_t_5 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError); + if (__pyx_t_5) { + __Pyx_AddTraceback("gevent._local._local_get_dict", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 341, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_7); + + /* "src/gevent/local.py":342 + * dct = entry.localdict + * except KeyError: + * dct = _localimpl_create_dict(impl, greenlet, idg) # <<<<<<<<<<<<<< + * self.__init__(*impl.localargs, **impl.localkwargs) + * return dct + */ + __pyx_t_8 = __pyx_f_6gevent_6_local__localimpl_create_dict(__pyx_v_impl, __pyx_v_greenlet, __pyx_v_idg); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 342, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_XDECREF_SET(__pyx_v_dct, ((PyObject*)__pyx_t_8)); + __pyx_t_8 = 0; + + /* "src/gevent/local.py":343 + * except KeyError: + * dct = _localimpl_create_dict(impl, greenlet, idg) + * self.__init__(*impl.localargs, **impl.localkwargs) # <<<<<<<<<<<<<< + * return dct + * + */ + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_init); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 343, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_8); + if (unlikely(__pyx_v_impl->localargs == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); + __PYX_ERR(0, 343, __pyx_L5_except_error) + } + if (unlikely(__pyx_v_impl->localkwargs == Py_None)) { + PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); + __PYX_ERR(0, 343, __pyx_L5_except_error) + } + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_v_impl->localargs, __pyx_v_impl->localkwargs); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 343, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + + /* "src/gevent/local.py":338 + * greenlet = getcurrent() # pylint:disable=undefined-variable + * idg = id(greenlet) + * try: # <<<<<<<<<<<<<< + * entry = impl.dicts[idg] + * dct = entry.localdict + */ + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4); + goto __pyx_L1_error; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4); + __pyx_L8_try_end:; + } + + /* "src/gevent/local.py":344 + * dct = _localimpl_create_dict(impl, greenlet, idg) + * self.__init__(*impl.localargs, **impl.localkwargs) + * return dct # <<<<<<<<<<<<<< + * + * def _init(): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_dct); + __pyx_r = __pyx_v_dct; + goto __pyx_L0; + + /* "src/gevent/local.py":333 + * _marker = object() + * + * def _local_get_dict(self): # <<<<<<<<<<<<<< + * impl = self._local__impl + * # Cython can optimize dict[], but not dict.get() + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_AddTraceback("gevent._local._local_get_dict", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_impl); + __Pyx_XDECREF(__pyx_v_dct); + __Pyx_XDECREF((PyObject *)__pyx_v_entry); + __Pyx_XDECREF((PyObject *)__pyx_v_greenlet); + __Pyx_XDECREF(__pyx_v_idg); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/local.py":346 + * return dct + * + * def _init(): # <<<<<<<<<<<<<< + * greenlet_init() # pylint:disable=undefined-variable + * + */ + +static void __pyx_f_6gevent_6_local__init(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_init", 0); + + /* "src/gevent/local.py":347 + * + * def _init(): + * greenlet_init() # pylint:disable=undefined-variable # <<<<<<<<<<<<<< + * + * _local_attrs = { + */ + __pyx_f_6gevent_6_local_greenlet_init(); + + /* "src/gevent/local.py":346 + * return dct + * + * def _init(): # <<<<<<<<<<<<<< + * greenlet_init() # pylint:disable=undefined-variable + * + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "src/gevent/local.py":367 + * __slots__ = tuple(_local_attrs - {'__class__', '__cinit__'}) + * + * def __cinit__(self, *args, **kw): # <<<<<<<<<<<<<< + * if args or kw: + * if type(self).__init__ == object.__init__: + */ + +/* Python wrapper */ +static int __pyx_pw_6gevent_6_local_5local_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6gevent_6_local_5local_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_args = 0; + PyObject *__pyx_v_kw = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); + if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 1))) return -1; + __pyx_v_kw = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New(); if (unlikely(!__pyx_v_kw)) return -1; + __Pyx_GOTREF(__pyx_v_kw); + __Pyx_INCREF(__pyx_args); + __pyx_v_args = __pyx_args; + __pyx_r = __pyx_pf_6gevent_6_local_5local___cinit__(((struct __pyx_obj_6gevent_6_local_local *)__pyx_v_self), __pyx_v_args, __pyx_v_kw); + + /* function exit code */ + __Pyx_XDECREF(__pyx_v_args); + __Pyx_XDECREF(__pyx_v_kw); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_6_local_5local___cinit__(struct __pyx_obj_6gevent_6_local_local *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kw) { + struct __pyx_obj_6gevent_6_local__localimpl *__pyx_v_impl = NULL; + PyObject *__pyx_v_get = NULL; + PyObject *__pyx_v_dels = NULL; + PyObject *__pyx_v_sets_or_dels = NULL; + PyObject *__pyx_v_sets = NULL; + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + __Pyx_RefNannySetupContext("__cinit__", 0); + + /* "src/gevent/local.py":368 + * + * def __cinit__(self, *args, **kw): + * if args or kw: # <<<<<<<<<<<<<< + * if type(self).__init__ == object.__init__: + * raise TypeError("Initialization arguments are not supported", args, kw) + */ + __pyx_t_2 = (PyTuple_GET_SIZE(__pyx_v_args) != 0); + if (!__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_kw); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 368, __pyx_L1_error) + __pyx_t_1 = __pyx_t_2; + __pyx_L4_bool_binop_done:; + if (__pyx_t_1) { + + /* "src/gevent/local.py":369 + * def __cinit__(self, *args, **kw): + * if args or kw: + * if type(self).__init__ == object.__init__: # <<<<<<<<<<<<<< + * raise TypeError("Initialization arguments are not supported", args, kw) + * impl = _localimpl(args, kw, type(self), id(self)) + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))), __pyx_n_s_init); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 369, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_builtin_object, __pyx_n_s_init); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 369, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 369, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 369, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(__pyx_t_1)) { + + /* "src/gevent/local.py":370 + * if args or kw: + * if type(self).__init__ == object.__init__: + * raise TypeError("Initialization arguments are not supported", args, kw) # <<<<<<<<<<<<<< + * impl = _localimpl(args, kw, type(self), id(self)) + * # pylint:disable=attribute-defined-outside-init + */ + __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 370, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_kp_s_Initialization_arguments_are_not); + __Pyx_GIVEREF(__pyx_kp_s_Initialization_arguments_are_not); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_kp_s_Initialization_arguments_are_not); + __Pyx_INCREF(__pyx_v_args); + __Pyx_GIVEREF(__pyx_v_args); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_args); + __Pyx_INCREF(__pyx_v_kw); + __Pyx_GIVEREF(__pyx_v_kw); + PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_kw); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 370, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __PYX_ERR(0, 370, __pyx_L1_error) + + /* "src/gevent/local.py":369 + * def __cinit__(self, *args, **kw): + * if args or kw: + * if type(self).__init__ == object.__init__: # <<<<<<<<<<<<<< + * raise TypeError("Initialization arguments are not supported", args, kw) + * impl = _localimpl(args, kw, type(self), id(self)) + */ + } + + /* "src/gevent/local.py":368 + * + * def __cinit__(self, *args, **kw): + * if args or kw: # <<<<<<<<<<<<<< + * if type(self).__init__ == object.__init__: + * raise TypeError("Initialization arguments are not supported", args, kw) + */ + } + + /* "src/gevent/local.py":371 + * if type(self).__init__ == object.__init__: + * raise TypeError("Initialization arguments are not supported", args, kw) + * impl = _localimpl(args, kw, type(self), id(self)) # <<<<<<<<<<<<<< + * # pylint:disable=attribute-defined-outside-init + * self._local__impl = impl + */ + __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 371, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 371, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_args); + __Pyx_GIVEREF(__pyx_v_args); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_args); + __Pyx_INCREF(__pyx_v_kw); + __Pyx_GIVEREF(__pyx_v_kw); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_kw); + __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + PyTuple_SET_ITEM(__pyx_t_5, 2, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6gevent_6_local__localimpl), __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 371, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_impl = ((struct __pyx_obj_6gevent_6_local__localimpl *)__pyx_t_4); + __pyx_t_4 = 0; + + /* "src/gevent/local.py":373 + * impl = _localimpl(args, kw, type(self), id(self)) + * # pylint:disable=attribute-defined-outside-init + * self._local__impl = impl # <<<<<<<<<<<<<< + * get, dels, sets_or_dels, sets = _local_find_descriptors(self) + * self._local_type_get_descriptors = get + */ + __Pyx_INCREF(((PyObject *)__pyx_v_impl)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_impl)); + __Pyx_GOTREF(__pyx_v_self->_local__impl); + __Pyx_DECREF(((PyObject *)__pyx_v_self->_local__impl)); + __pyx_v_self->_local__impl = __pyx_v_impl; + + /* "src/gevent/local.py":374 + * # pylint:disable=attribute-defined-outside-init + * self._local__impl = impl + * get, dels, sets_or_dels, sets = _local_find_descriptors(self) # <<<<<<<<<<<<<< + * self._local_type_get_descriptors = get + * self._local_type_set_or_del_descriptors = sets_or_dels + */ + __pyx_t_4 = __pyx_f_6gevent_6_local__local_find_descriptors(__pyx_v_self); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 374, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (likely(__pyx_t_4 != Py_None)) { + PyObject* sequence = __pyx_t_4; + Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); + if (unlikely(size != 4)) { + if (size > 4) __Pyx_RaiseTooManyValuesError(4); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + __PYX_ERR(0, 374, __pyx_L1_error) + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); + __pyx_t_6 = PyTuple_GET_ITEM(sequence, 2); + __pyx_t_7 = PyTuple_GET_ITEM(sequence, 3); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(__pyx_t_7); + #else + { + Py_ssize_t i; + PyObject** temps[4] = {&__pyx_t_5,&__pyx_t_3,&__pyx_t_6,&__pyx_t_7}; + for (i=0; i < 4; i++) { + PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(0, 374, __pyx_L1_error) + __Pyx_GOTREF(item); + *(temps[i]) = item; + } + } + #endif + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } else { + __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(0, 374, __pyx_L1_error) + } + __pyx_v_get = __pyx_t_5; + __pyx_t_5 = 0; + __pyx_v_dels = __pyx_t_3; + __pyx_t_3 = 0; + __pyx_v_sets_or_dels = __pyx_t_6; + __pyx_t_6 = 0; + __pyx_v_sets = __pyx_t_7; + __pyx_t_7 = 0; + + /* "src/gevent/local.py":375 + * self._local__impl = impl + * get, dels, sets_or_dels, sets = _local_find_descriptors(self) + * self._local_type_get_descriptors = get # <<<<<<<<<<<<<< + * self._local_type_set_or_del_descriptors = sets_or_dels + * self._local_type_del_descriptors = dels + */ + if (!(likely(PySet_CheckExact(__pyx_v_get))||((__pyx_v_get) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "set", Py_TYPE(__pyx_v_get)->tp_name), 0))) __PYX_ERR(0, 375, __pyx_L1_error) + __pyx_t_4 = __pyx_v_get; + __Pyx_INCREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_v_self->_local_type_get_descriptors); + __Pyx_DECREF(__pyx_v_self->_local_type_get_descriptors); + __pyx_v_self->_local_type_get_descriptors = ((PyObject*)__pyx_t_4); + __pyx_t_4 = 0; + + /* "src/gevent/local.py":376 + * get, dels, sets_or_dels, sets = _local_find_descriptors(self) + * self._local_type_get_descriptors = get + * self._local_type_set_or_del_descriptors = sets_or_dels # <<<<<<<<<<<<<< + * self._local_type_del_descriptors = dels + * self._local_type_set_descriptors = sets + */ + if (!(likely(PySet_CheckExact(__pyx_v_sets_or_dels))||((__pyx_v_sets_or_dels) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "set", Py_TYPE(__pyx_v_sets_or_dels)->tp_name), 0))) __PYX_ERR(0, 376, __pyx_L1_error) + __pyx_t_4 = __pyx_v_sets_or_dels; + __Pyx_INCREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_v_self->_local_type_set_or_del_descriptors); + __Pyx_DECREF(__pyx_v_self->_local_type_set_or_del_descriptors); + __pyx_v_self->_local_type_set_or_del_descriptors = ((PyObject*)__pyx_t_4); + __pyx_t_4 = 0; + + /* "src/gevent/local.py":377 + * self._local_type_get_descriptors = get + * self._local_type_set_or_del_descriptors = sets_or_dels + * self._local_type_del_descriptors = dels # <<<<<<<<<<<<<< + * self._local_type_set_descriptors = sets + * self._local_type = type(self) + */ + if (!(likely(PySet_CheckExact(__pyx_v_dels))||((__pyx_v_dels) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "set", Py_TYPE(__pyx_v_dels)->tp_name), 0))) __PYX_ERR(0, 377, __pyx_L1_error) + __pyx_t_4 = __pyx_v_dels; + __Pyx_INCREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_v_self->_local_type_del_descriptors); + __Pyx_DECREF(__pyx_v_self->_local_type_del_descriptors); + __pyx_v_self->_local_type_del_descriptors = ((PyObject*)__pyx_t_4); + __pyx_t_4 = 0; + + /* "src/gevent/local.py":378 + * self._local_type_set_or_del_descriptors = sets_or_dels + * self._local_type_del_descriptors = dels + * self._local_type_set_descriptors = sets # <<<<<<<<<<<<<< + * self._local_type = type(self) + * self._local_type_vars = set(dir(self._local_type)) + */ + if (!(likely(PySet_CheckExact(__pyx_v_sets))||((__pyx_v_sets) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "set", Py_TYPE(__pyx_v_sets)->tp_name), 0))) __PYX_ERR(0, 378, __pyx_L1_error) + __pyx_t_4 = __pyx_v_sets; + __Pyx_INCREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_v_self->_local_type_set_descriptors); + __Pyx_DECREF(__pyx_v_self->_local_type_set_descriptors); + __pyx_v_self->_local_type_set_descriptors = ((PyObject*)__pyx_t_4); + __pyx_t_4 = 0; + + /* "src/gevent/local.py":379 + * self._local_type_del_descriptors = dels + * self._local_type_set_descriptors = sets + * self._local_type = type(self) # <<<<<<<<<<<<<< + * self._local_type_vars = set(dir(self._local_type)) + * + */ + __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_GOTREF(__pyx_v_self->_local_type); + __Pyx_DECREF(((PyObject *)__pyx_v_self->_local_type)); + __pyx_v_self->_local_type = ((PyTypeObject*)((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + + /* "src/gevent/local.py":380 + * self._local_type_set_descriptors = sets + * self._local_type = type(self) + * self._local_type_vars = set(dir(self._local_type)) # <<<<<<<<<<<<<< + * + * def __getattribute__(self, name): # pylint:disable=too-many-return-statements + */ + __pyx_t_4 = ((PyObject *)__pyx_v_self->_local_type); + __Pyx_INCREF(__pyx_t_4); + __pyx_t_7 = PyObject_Dir(__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 380, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PySet_New(__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 380, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_GIVEREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_v_self->_local_type_vars); + __Pyx_DECREF(__pyx_v_self->_local_type_vars); + __pyx_v_self->_local_type_vars = ((PyObject*)__pyx_t_4); + __pyx_t_4 = 0; + + /* "src/gevent/local.py":367 + * __slots__ = tuple(_local_attrs - {'__class__', '__cinit__'}) + * + * def __cinit__(self, *args, **kw): # <<<<<<<<<<<<<< + * if args or kw: + * if type(self).__init__ == object.__init__: + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("gevent._local.local.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_impl); + __Pyx_XDECREF(__pyx_v_get); + __Pyx_XDECREF(__pyx_v_dels); + __Pyx_XDECREF(__pyx_v_sets_or_dels); + __Pyx_XDECREF(__pyx_v_sets); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/local.py":382 + * self._local_type_vars = set(dir(self._local_type)) + * + * def __getattribute__(self, name): # pylint:disable=too-many-return-statements # <<<<<<<<<<<<<< + * if name in _local_attrs: + * # The _local__impl, __cinit__, etc, won't be hit by the + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_local_5local_3__getattribute__(PyObject *__pyx_v_self, PyObject *__pyx_v_name); /*proto*/ +static PyObject *__pyx_pw_6gevent_6_local_5local_3__getattribute__(PyObject *__pyx_v_self, PyObject *__pyx_v_name) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__getattribute__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6_local_5local_2__getattribute__(((struct __pyx_obj_6gevent_6_local_local *)__pyx_v_self), ((PyObject *)__pyx_v_name)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_local_5local_2__getattribute__(struct __pyx_obj_6gevent_6_local_local *__pyx_v_self, PyObject *__pyx_v_name) { + PyObject *__pyx_v_dct = NULL; + PyObject *__pyx_v_type_attr = NULL; + PyObject *__pyx_v_base = NULL; + PyObject *__pyx_v_bd = NULL; + PyObject *__pyx_v_attr_on_type = NULL; + PyObject *__pyx_v_result = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + Py_ssize_t __pyx_t_9; + PyObject *(*__pyx_t_10)(PyObject *); + __Pyx_RefNannySetupContext("__getattribute__", 0); + + /* "src/gevent/local.py":383 + * + * def __getattribute__(self, name): # pylint:disable=too-many-return-statements + * if name in _local_attrs: # <<<<<<<<<<<<<< + * # The _local__impl, __cinit__, etc, won't be hit by the + * # Cython version, if we've done things right. If we haven't, + */ + if (unlikely(__pyx_v_6gevent_6_local__local_attrs == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); + __PYX_ERR(0, 383, __pyx_L1_error) + } + __pyx_t_1 = (__Pyx_PySet_ContainsTF(__pyx_v_name, __pyx_v_6gevent_6_local__local_attrs, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 383, __pyx_L1_error) + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "src/gevent/local.py":387 + * # Cython version, if we've done things right. If we haven't, + * # they will be, and this will produce an error. + * return object.__getattribute__(self, name) # <<<<<<<<<<<<<< + * + * dct = _local_get_dict(self) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_builtin_object, __pyx_n_s_getattribute); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 387, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = NULL; + __pyx_t_6 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + __pyx_t_6 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_4)) { + PyObject *__pyx_temp[3] = {__pyx_t_5, ((PyObject *)__pyx_v_self), __pyx_v_name}; + __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 387, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_t_3); + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { + PyObject *__pyx_temp[3] = {__pyx_t_5, ((PyObject *)__pyx_v_self), __pyx_v_name}; + __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 387, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_t_3); + } else + #endif + { + __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 387, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + if (__pyx_t_5) { + __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL; + } + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, ((PyObject *)__pyx_v_self)); + __Pyx_INCREF(__pyx_v_name); + __Pyx_GIVEREF(__pyx_v_name); + PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_name); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 387, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "src/gevent/local.py":383 + * + * def __getattribute__(self, name): # pylint:disable=too-many-return-statements + * if name in _local_attrs: # <<<<<<<<<<<<<< + * # The _local__impl, __cinit__, etc, won't be hit by the + * # Cython version, if we've done things right. If we haven't, + */ + } + + /* "src/gevent/local.py":389 + * return object.__getattribute__(self, name) + * + * dct = _local_get_dict(self) # <<<<<<<<<<<<<< + * + * if name == '__dict__': + */ + __pyx_t_3 = __pyx_f_6gevent_6_local__local_get_dict(__pyx_v_self); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 389, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_v_dct = ((PyObject*)__pyx_t_3); + __pyx_t_3 = 0; + + /* "src/gevent/local.py":391 + * dct = _local_get_dict(self) + * + * if name == '__dict__': # <<<<<<<<<<<<<< + * return dct + * # If there's no possible way we can switch, because this + */ + __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_name, __pyx_n_s_dict, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 391, __pyx_L1_error) + if (__pyx_t_2) { + + /* "src/gevent/local.py":392 + * + * if name == '__dict__': + * return dct # <<<<<<<<<<<<<< + * # If there's no possible way we can switch, because this + * # attribute is *not* found in the class where it might be a + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_dct); + __pyx_r = __pyx_v_dct; + goto __pyx_L0; + + /* "src/gevent/local.py":391 + * dct = _local_get_dict(self) + * + * if name == '__dict__': # <<<<<<<<<<<<<< + * return dct + * # If there's no possible way we can switch, because this + */ + } + + /* "src/gevent/local.py":407 + * # there can be no descriptors except for methods, which will + * # never need to use __dict__. + * if self._local_type is local: # <<<<<<<<<<<<<< + * return dct[name] if name in dct else object.__getattribute__(self, name) + * + */ + __pyx_t_2 = (__pyx_v_self->_local_type == __pyx_ptype_6gevent_6_local_local); + __pyx_t_1 = (__pyx_t_2 != 0); + if (__pyx_t_1) { + + /* "src/gevent/local.py":408 + * # never need to use __dict__. + * if self._local_type is local: + * return dct[name] if name in dct else object.__getattribute__(self, name) # <<<<<<<<<<<<<< + * + * # NOTE: If this is a descriptor, this will invoke its __get__. + */ + __Pyx_XDECREF(__pyx_r); + if (unlikely(__pyx_v_dct == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); + __PYX_ERR(0, 408, __pyx_L1_error) + } + __pyx_t_1 = (__Pyx_PyDict_ContainsTF(__pyx_v_name, __pyx_v_dct, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 408, __pyx_L1_error) + if ((__pyx_t_1 != 0)) { + if (unlikely(__pyx_v_dct == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 408, __pyx_L1_error) + } + __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_dct, __pyx_v_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 408, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __pyx_t_4; + __pyx_t_4 = 0; + } else { + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_builtin_object, __pyx_n_s_getattribute); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 408, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_5 = NULL; + __pyx_t_6 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_7, function); + __pyx_t_6 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_7)) { + PyObject *__pyx_temp[3] = {__pyx_t_5, ((PyObject *)__pyx_v_self), __pyx_v_name}; + __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 408, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_t_4); + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) { + PyObject *__pyx_temp[3] = {__pyx_t_5, ((PyObject *)__pyx_v_self), __pyx_v_name}; + __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 408, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_t_4); + } else + #endif + { + __pyx_t_8 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 408, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + if (__pyx_t_5) { + __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL; + } + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_6, ((PyObject *)__pyx_v_self)); + __Pyx_INCREF(__pyx_v_name); + __Pyx_GIVEREF(__pyx_v_name); + PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_6, __pyx_v_name); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 408, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + } + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_3 = __pyx_t_4; + __pyx_t_4 = 0; + } + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "src/gevent/local.py":407 + * # there can be no descriptors except for methods, which will + * # never need to use __dict__. + * if self._local_type is local: # <<<<<<<<<<<<<< + * return dct[name] if name in dct else object.__getattribute__(self, name) + * + */ + } + + /* "src/gevent/local.py":415 + * # But this is faster than a loop over mro() checking each class __dict__ + * # manually. + * if name in dct: # <<<<<<<<<<<<<< + * if name not in self._local_type_vars: + * # If there is a dict value, and nothing in the type, + */ + if (unlikely(__pyx_v_dct == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); + __PYX_ERR(0, 415, __pyx_L1_error) + } + __pyx_t_1 = (__Pyx_PyDict_ContainsTF(__pyx_v_name, __pyx_v_dct, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 415, __pyx_L1_error) + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "src/gevent/local.py":416 + * # manually. + * if name in dct: + * if name not in self._local_type_vars: # <<<<<<<<<<<<<< + * # If there is a dict value, and nothing in the type, + * # it can't possibly be a descriptor, so it is just returned. + */ + if (unlikely(__pyx_v_self->_local_type_vars == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); + __PYX_ERR(0, 416, __pyx_L1_error) + } + __pyx_t_2 = (__Pyx_PySet_ContainsTF(__pyx_v_name, __pyx_v_self->_local_type_vars, Py_NE)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 416, __pyx_L1_error) + __pyx_t_1 = (__pyx_t_2 != 0); + if (__pyx_t_1) { + + /* "src/gevent/local.py":419 + * # If there is a dict value, and nothing in the type, + * # it can't possibly be a descriptor, so it is just returned. + * return dct[name] # <<<<<<<<<<<<<< + * + * # It's in the type *and* in the dict. If the type value is + */ + __Pyx_XDECREF(__pyx_r); + if (unlikely(__pyx_v_dct == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 419, __pyx_L1_error) + } + __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_dct, __pyx_v_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 419, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "src/gevent/local.py":416 + * # manually. + * if name in dct: + * if name not in self._local_type_vars: # <<<<<<<<<<<<<< + * # If there is a dict value, and nothing in the type, + * # it can't possibly be a descriptor, so it is just returned. + */ + } + + /* "src/gevent/local.py":428 + * # NOTE that the docs for descriptors say that these methods must be + * # defined on the *class* of the object in the type. + * if name not in self._local_type_get_descriptors: # <<<<<<<<<<<<<< + * # Entirely not a descriptor. Instance wins. + * return dct[name] + */ + if (unlikely(__pyx_v_self->_local_type_get_descriptors == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); + __PYX_ERR(0, 428, __pyx_L1_error) + } + __pyx_t_1 = (__Pyx_PySet_ContainsTF(__pyx_v_name, __pyx_v_self->_local_type_get_descriptors, Py_NE)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 428, __pyx_L1_error) + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "src/gevent/local.py":430 + * if name not in self._local_type_get_descriptors: + * # Entirely not a descriptor. Instance wins. + * return dct[name] # <<<<<<<<<<<<<< + * if name in self._local_type_set_or_del_descriptors: + * # A data descriptor. + */ + __Pyx_XDECREF(__pyx_r); + if (unlikely(__pyx_v_dct == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 430, __pyx_L1_error) + } + __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_dct, __pyx_v_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 430, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "src/gevent/local.py":428 + * # NOTE that the docs for descriptors say that these methods must be + * # defined on the *class* of the object in the type. + * if name not in self._local_type_get_descriptors: # <<<<<<<<<<<<<< + * # Entirely not a descriptor. Instance wins. + * return dct[name] + */ + } + + /* "src/gevent/local.py":431 + * # Entirely not a descriptor. Instance wins. + * return dct[name] + * if name in self._local_type_set_or_del_descriptors: # <<<<<<<<<<<<<< + * # A data descriptor. + * # arbitrary code execution while these run. If they touch self again, + */ + if (unlikely(__pyx_v_self->_local_type_set_or_del_descriptors == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); + __PYX_ERR(0, 431, __pyx_L1_error) + } + __pyx_t_2 = (__Pyx_PySet_ContainsTF(__pyx_v_name, __pyx_v_self->_local_type_set_or_del_descriptors, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 431, __pyx_L1_error) + __pyx_t_1 = (__pyx_t_2 != 0); + if (__pyx_t_1) { + + /* "src/gevent/local.py":435 + * # arbitrary code execution while these run. If they touch self again, + * # they'll call back into us and we'll repeat the dance. + * type_attr = getattr(self._local_type, name) # <<<<<<<<<<<<<< + * return type(type_attr).__get__(type_attr, self, self._local_type) + * # Last case is a non-data descriptor. Instance wins. + */ + __pyx_t_3 = ((PyObject *)__pyx_v_self->_local_type); + __Pyx_INCREF(__pyx_t_3); + __pyx_t_4 = __Pyx_GetAttr(__pyx_t_3, __pyx_v_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 435, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_type_attr = __pyx_t_4; + __pyx_t_4 = 0; + + /* "src/gevent/local.py":436 + * # they'll call back into us and we'll repeat the dance. + * type_attr = getattr(self._local_type, name) + * return type(type_attr).__get__(type_attr, self, self._local_type) # <<<<<<<<<<<<<< + * # Last case is a non-data descriptor. Instance wins. + * return dct[name] + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)Py_TYPE(__pyx_v_type_attr)), __pyx_n_s_get); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 436, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_7 = NULL; + __pyx_t_6 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_7)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_7); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_6 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_3)) { + PyObject *__pyx_temp[4] = {__pyx_t_7, __pyx_v_type_attr, ((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_self->_local_type)}; + __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 436, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_GOTREF(__pyx_t_4); + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { + PyObject *__pyx_temp[4] = {__pyx_t_7, __pyx_v_type_attr, ((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_self->_local_type)}; + __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 436, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_GOTREF(__pyx_t_4); + } else + #endif + { + __pyx_t_8 = PyTuple_New(3+__pyx_t_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 436, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + if (__pyx_t_7) { + __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7); __pyx_t_7 = NULL; + } + __Pyx_INCREF(__pyx_v_type_attr); + __Pyx_GIVEREF(__pyx_v_type_attr); + PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_6, __pyx_v_type_attr); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_6, ((PyObject *)__pyx_v_self)); + __Pyx_INCREF(((PyObject *)__pyx_v_self->_local_type)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self->_local_type)); + PyTuple_SET_ITEM(__pyx_t_8, 2+__pyx_t_6, ((PyObject *)__pyx_v_self->_local_type)); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 436, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + + /* "src/gevent/local.py":431 + * # Entirely not a descriptor. Instance wins. + * return dct[name] + * if name in self._local_type_set_or_del_descriptors: # <<<<<<<<<<<<<< + * # A data descriptor. + * # arbitrary code execution while these run. If they touch self again, + */ + } + + /* "src/gevent/local.py":438 + * return type(type_attr).__get__(type_attr, self, self._local_type) + * # Last case is a non-data descriptor. Instance wins. + * return dct[name] # <<<<<<<<<<<<<< + * + * if name in self._local_type_vars: + */ + __Pyx_XDECREF(__pyx_r); + if (unlikely(__pyx_v_dct == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 438, __pyx_L1_error) + } + __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_dct, __pyx_v_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 438, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + + /* "src/gevent/local.py":415 + * # But this is faster than a loop over mro() checking each class __dict__ + * # manually. + * if name in dct: # <<<<<<<<<<<<<< + * if name not in self._local_type_vars: + * # If there is a dict value, and nothing in the type, + */ + } + + /* "src/gevent/local.py":440 + * return dct[name] + * + * if name in self._local_type_vars: # <<<<<<<<<<<<<< + * # Not in the dictionary, but is found in the type. It could be + * # a non-data descriptor still. Some descriptors, like @staticmethod, + */ + if (unlikely(__pyx_v_self->_local_type_vars == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); + __PYX_ERR(0, 440, __pyx_L1_error) + } + __pyx_t_1 = (__Pyx_PySet_ContainsTF(__pyx_v_name, __pyx_v_self->_local_type_vars, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 440, __pyx_L1_error) + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "src/gevent/local.py":447 + * # So we can't rely on getattr() on the type for them, we have to + * # look through the MRO dicts ourself. + * if name not in self._local_type_get_descriptors: # <<<<<<<<<<<<<< + * # Not a descriptor, can't execute code. So all we need is + * # the return value of getattr() on our type. + */ + if (unlikely(__pyx_v_self->_local_type_get_descriptors == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); + __PYX_ERR(0, 447, __pyx_L1_error) + } + __pyx_t_2 = (__Pyx_PySet_ContainsTF(__pyx_v_name, __pyx_v_self->_local_type_get_descriptors, Py_NE)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 447, __pyx_L1_error) + __pyx_t_1 = (__pyx_t_2 != 0); + if (__pyx_t_1) { + + /* "src/gevent/local.py":450 + * # Not a descriptor, can't execute code. So all we need is + * # the return value of getattr() on our type. + * return getattr(self._local_type, name) # <<<<<<<<<<<<<< + * + * for base in self._local_type.mro(): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = ((PyObject *)__pyx_v_self->_local_type); + __Pyx_INCREF(__pyx_t_4); + __pyx_t_3 = __Pyx_GetAttr(__pyx_t_4, __pyx_v_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 450, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "src/gevent/local.py":447 + * # So we can't rely on getattr() on the type for them, we have to + * # look through the MRO dicts ourself. + * if name not in self._local_type_get_descriptors: # <<<<<<<<<<<<<< + * # Not a descriptor, can't execute code. So all we need is + * # the return value of getattr() on our type. + */ + } + + /* "src/gevent/local.py":452 + * return getattr(self._local_type, name) + * + * for base in self._local_type.mro(): # <<<<<<<<<<<<<< + * bd = base.__dict__ + * if name in bd: + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->_local_type), __pyx_n_s_mro); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 452, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_8 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_8)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_8); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + } + } + __pyx_t_3 = (__pyx_t_8) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_8) : __Pyx_PyObject_CallNoArg(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 452, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) { + __pyx_t_4 = __pyx_t_3; __Pyx_INCREF(__pyx_t_4); __pyx_t_9 = 0; + __pyx_t_10 = NULL; + } else { + __pyx_t_9 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 452, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_10 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 452, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + for (;;) { + if (likely(!__pyx_t_10)) { + if (likely(PyList_CheckExact(__pyx_t_4))) { + if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_3 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_9); __Pyx_INCREF(__pyx_t_3); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 452, __pyx_L1_error) + #else + __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 452, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + #endif + } else { + if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_9); __Pyx_INCREF(__pyx_t_3); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 452, __pyx_L1_error) + #else + __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 452, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + #endif + } + } else { + __pyx_t_3 = __pyx_t_10(__pyx_t_4); + if (unlikely(!__pyx_t_3)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(0, 452, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_3); + } + __Pyx_XDECREF_SET(__pyx_v_base, __pyx_t_3); + __pyx_t_3 = 0; + + /* "src/gevent/local.py":453 + * + * for base in self._local_type.mro(): + * bd = base.__dict__ # <<<<<<<<<<<<<< + * if name in bd: + * attr_on_type = bd[name] + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_dict); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 453, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_XDECREF_SET(__pyx_v_bd, __pyx_t_3); + __pyx_t_3 = 0; + + /* "src/gevent/local.py":454 + * for base in self._local_type.mro(): + * bd = base.__dict__ + * if name in bd: # <<<<<<<<<<<<<< + * attr_on_type = bd[name] + * result = type(attr_on_type).__get__(attr_on_type, self, self._local_type) + */ + __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_v_name, __pyx_v_bd, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 454, __pyx_L1_error) + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "src/gevent/local.py":455 + * bd = base.__dict__ + * if name in bd: + * attr_on_type = bd[name] # <<<<<<<<<<<<<< + * result = type(attr_on_type).__get__(attr_on_type, self, self._local_type) + * return result + */ + __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_bd, __pyx_v_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 455, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_v_attr_on_type = __pyx_t_3; + __pyx_t_3 = 0; + + /* "src/gevent/local.py":456 + * if name in bd: + * attr_on_type = bd[name] + * result = type(attr_on_type).__get__(attr_on_type, self, self._local_type) # <<<<<<<<<<<<<< + * return result + * + */ + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)Py_TYPE(__pyx_v_attr_on_type)), __pyx_n_s_get); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 456, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_7 = NULL; + __pyx_t_6 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) { + __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_8); + if (likely(__pyx_t_7)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); + __Pyx_INCREF(__pyx_t_7); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_8, function); + __pyx_t_6 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_8)) { + PyObject *__pyx_temp[4] = {__pyx_t_7, __pyx_v_attr_on_type, ((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_self->_local_type)}; + __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 456, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_GOTREF(__pyx_t_3); + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_8)) { + PyObject *__pyx_temp[4] = {__pyx_t_7, __pyx_v_attr_on_type, ((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_self->_local_type)}; + __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 456, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_GOTREF(__pyx_t_3); + } else + #endif + { + __pyx_t_5 = PyTuple_New(3+__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 456, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (__pyx_t_7) { + __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7); __pyx_t_7 = NULL; + } + __Pyx_INCREF(__pyx_v_attr_on_type); + __Pyx_GIVEREF(__pyx_v_attr_on_type); + PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_6, __pyx_v_attr_on_type); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_6, ((PyObject *)__pyx_v_self)); + __Pyx_INCREF(((PyObject *)__pyx_v_self->_local_type)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self->_local_type)); + PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_6, ((PyObject *)__pyx_v_self->_local_type)); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 456, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_v_result = __pyx_t_3; + __pyx_t_3 = 0; + + /* "src/gevent/local.py":457 + * attr_on_type = bd[name] + * result = type(attr_on_type).__get__(attr_on_type, self, self._local_type) + * return result # <<<<<<<<<<<<<< + * + * # It wasn't in the dict and it wasn't in the type. + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L0; + + /* "src/gevent/local.py":454 + * for base in self._local_type.mro(): + * bd = base.__dict__ + * if name in bd: # <<<<<<<<<<<<<< + * attr_on_type = bd[name] + * result = type(attr_on_type).__get__(attr_on_type, self, self._local_type) + */ + } + + /* "src/gevent/local.py":452 + * return getattr(self._local_type, name) + * + * for base in self._local_type.mro(): # <<<<<<<<<<<<<< + * bd = base.__dict__ + * if name in bd: + */ + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "src/gevent/local.py":440 + * return dct[name] + * + * if name in self._local_type_vars: # <<<<<<<<<<<<<< + * # Not in the dictionary, but is found in the type. It could be + * # a non-data descriptor still. Some descriptors, like @staticmethod, + */ + } + + /* "src/gevent/local.py":463 + * # exists, otherwise raise an AttributeError. + * # we will invoke type(self).__getattr__ or raise an attribute error. + * if hasattr(self._local_type, '__getattr__'): # <<<<<<<<<<<<<< + * return self._local_type.__getattr__(self, name) + * raise AttributeError("%r object has no attribute '%s'" + */ + __pyx_t_4 = ((PyObject *)__pyx_v_self->_local_type); + __Pyx_INCREF(__pyx_t_4); + __pyx_t_2 = __Pyx_HasAttr(__pyx_t_4, __pyx_n_s_getattr); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 463, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_1 = (__pyx_t_2 != 0); + if (__pyx_t_1) { + + /* "src/gevent/local.py":464 + * # we will invoke type(self).__getattr__ or raise an attribute error. + * if hasattr(self._local_type, '__getattr__'): + * return self._local_type.__getattr__(self, name) # <<<<<<<<<<<<<< + * raise AttributeError("%r object has no attribute '%s'" + * % (self._local_type.__name__, name)) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->_local_type), __pyx_n_s_getattr); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 464, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_8 = NULL; + __pyx_t_6 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_8)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_8); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_6 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_3)) { + PyObject *__pyx_temp[3] = {__pyx_t_8, ((PyObject *)__pyx_v_self), __pyx_v_name}; + __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 464, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_GOTREF(__pyx_t_4); + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { + PyObject *__pyx_temp[3] = {__pyx_t_8, ((PyObject *)__pyx_v_self), __pyx_v_name}; + __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 464, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_GOTREF(__pyx_t_4); + } else + #endif + { + __pyx_t_5 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 464, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (__pyx_t_8) { + __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_8); __pyx_t_8 = NULL; + } + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_6, ((PyObject *)__pyx_v_self)); + __Pyx_INCREF(__pyx_v_name); + __Pyx_GIVEREF(__pyx_v_name); + PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_6, __pyx_v_name); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 464, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + + /* "src/gevent/local.py":463 + * # exists, otherwise raise an AttributeError. + * # we will invoke type(self).__getattr__ or raise an attribute error. + * if hasattr(self._local_type, '__getattr__'): # <<<<<<<<<<<<<< + * return self._local_type.__getattr__(self, name) + * raise AttributeError("%r object has no attribute '%s'" + */ + } + + /* "src/gevent/local.py":466 + * return self._local_type.__getattr__(self, name) + * raise AttributeError("%r object has no attribute '%s'" + * % (self._local_type.__name__, name)) # <<<<<<<<<<<<<< + * + * def __setattr__(self, name, value): + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->_local_type), __pyx_n_s_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 466, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 466, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); + __Pyx_INCREF(__pyx_v_name); + __Pyx_GIVEREF(__pyx_v_name); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_name); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_r_object_has_no_attribute_s, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 466, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "src/gevent/local.py":465 + * if hasattr(self._local_type, '__getattr__'): + * return self._local_type.__getattr__(self, name) + * raise AttributeError("%r object has no attribute '%s'" # <<<<<<<<<<<<<< + * % (self._local_type.__name__, name)) + * + */ + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_AttributeError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 465, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(0, 465, __pyx_L1_error) + + /* "src/gevent/local.py":382 + * self._local_type_vars = set(dir(self._local_type)) + * + * def __getattribute__(self, name): # pylint:disable=too-many-return-statements # <<<<<<<<<<<<<< + * if name in _local_attrs: + * # The _local__impl, __cinit__, etc, won't be hit by the + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("gevent._local.local.__getattribute__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_dct); + __Pyx_XDECREF(__pyx_v_type_attr); + __Pyx_XDECREF(__pyx_v_base); + __Pyx_XDECREF(__pyx_v_bd); + __Pyx_XDECREF(__pyx_v_attr_on_type); + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/local.py":468 + * % (self._local_type.__name__, name)) + * + * def __setattr__(self, name, value): # <<<<<<<<<<<<<< + * if name == '__dict__': + * raise AttributeError( + */ + +/* Python wrapper */ +static int __pyx_pw_6gevent_6_local_5local_5__setattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6gevent_6_local_5local_5__setattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__setattr__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6_local_5local_4__setattr__(((struct __pyx_obj_6gevent_6_local_local *)__pyx_v_self), ((PyObject *)__pyx_v_name), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_6_local_5local_4__setattr__(struct __pyx_obj_6gevent_6_local_local *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_value) { + PyObject *__pyx_v_dct = NULL; + PyObject *__pyx_v_type_attr = NULL; + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + __Pyx_RefNannySetupContext("__setattr__", 0); + + /* "src/gevent/local.py":469 + * + * def __setattr__(self, name, value): + * if name == '__dict__': # <<<<<<<<<<<<<< + * raise AttributeError( + * "%r object attribute '__dict__' is read-only" + */ + __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_name, __pyx_n_s_dict, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 469, __pyx_L1_error) + if (unlikely(__pyx_t_1)) { + + /* "src/gevent/local.py":472 + * raise AttributeError( + * "%r object attribute '__dict__' is read-only" + * % type(self)) # <<<<<<<<<<<<<< + * + * if name in _local_attrs: + */ + __pyx_t_2 = __Pyx_PyString_FormatSafe(__pyx_kp_s_r_object_attribute___dict___is, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 472, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + + /* "src/gevent/local.py":470 + * def __setattr__(self, name, value): + * if name == '__dict__': + * raise AttributeError( # <<<<<<<<<<<<<< + * "%r object attribute '__dict__' is read-only" + * % type(self)) + */ + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_AttributeError, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 470, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(0, 470, __pyx_L1_error) + + /* "src/gevent/local.py":469 + * + * def __setattr__(self, name, value): + * if name == '__dict__': # <<<<<<<<<<<<<< + * raise AttributeError( + * "%r object attribute '__dict__' is read-only" + */ + } + + /* "src/gevent/local.py":474 + * % type(self)) + * + * if name in _local_attrs: # <<<<<<<<<<<<<< + * object.__setattr__(self, name, value) + * return + */ + if (unlikely(__pyx_v_6gevent_6_local__local_attrs == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); + __PYX_ERR(0, 474, __pyx_L1_error) + } + __pyx_t_1 = (__Pyx_PySet_ContainsTF(__pyx_v_name, __pyx_v_6gevent_6_local__local_attrs, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 474, __pyx_L1_error) + __pyx_t_4 = (__pyx_t_1 != 0); + if (__pyx_t_4) { + + /* "src/gevent/local.py":475 + * + * if name in _local_attrs: + * object.__setattr__(self, name, value) # <<<<<<<<<<<<<< + * return + * + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_builtin_object, __pyx_n_s_setattr); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 475, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = NULL; + __pyx_t_6 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_6 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[4] = {__pyx_t_5, ((PyObject *)__pyx_v_self), __pyx_v_name, __pyx_v_value}; + __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 475, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_t_3); + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[4] = {__pyx_t_5, ((PyObject *)__pyx_v_self), __pyx_v_name, __pyx_v_value}; + __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 475, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_t_3); + } else + #endif + { + __pyx_t_7 = PyTuple_New(3+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 475, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + if (__pyx_t_5) { + __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL; + } + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, ((PyObject *)__pyx_v_self)); + __Pyx_INCREF(__pyx_v_name); + __Pyx_GIVEREF(__pyx_v_name); + PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_name); + __Pyx_INCREF(__pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_6, __pyx_v_value); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 475, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "src/gevent/local.py":476 + * if name in _local_attrs: + * object.__setattr__(self, name, value) + * return # <<<<<<<<<<<<<< + * + * dct = _local_get_dict(self) + */ + __pyx_r = 0; + goto __pyx_L0; + + /* "src/gevent/local.py":474 + * % type(self)) + * + * if name in _local_attrs: # <<<<<<<<<<<<<< + * object.__setattr__(self, name, value) + * return + */ + } + + /* "src/gevent/local.py":478 + * return + * + * dct = _local_get_dict(self) # <<<<<<<<<<<<<< + * + * if self._local_type is local: + */ + __pyx_t_3 = __pyx_f_6gevent_6_local__local_get_dict(__pyx_v_self); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 478, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_v_dct = ((PyObject*)__pyx_t_3); + __pyx_t_3 = 0; + + /* "src/gevent/local.py":480 + * dct = _local_get_dict(self) + * + * if self._local_type is local: # <<<<<<<<<<<<<< + * # Optimization: If we're not subclassed, we can't + * # have data descriptors, so this goes right in the dict. + */ + __pyx_t_4 = (__pyx_v_self->_local_type == __pyx_ptype_6gevent_6_local_local); + __pyx_t_1 = (__pyx_t_4 != 0); + if (__pyx_t_1) { + + /* "src/gevent/local.py":483 + * # Optimization: If we're not subclassed, we can't + * # have data descriptors, so this goes right in the dict. + * dct[name] = value # <<<<<<<<<<<<<< + * return + * + */ + if (unlikely(__pyx_v_dct == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 483, __pyx_L1_error) + } + if (unlikely(PyDict_SetItem(__pyx_v_dct, __pyx_v_name, __pyx_v_value) < 0)) __PYX_ERR(0, 483, __pyx_L1_error) + + /* "src/gevent/local.py":484 + * # have data descriptors, so this goes right in the dict. + * dct[name] = value + * return # <<<<<<<<<<<<<< + * + * if name in self._local_type_vars: + */ + __pyx_r = 0; + goto __pyx_L0; + + /* "src/gevent/local.py":480 + * dct = _local_get_dict(self) + * + * if self._local_type is local: # <<<<<<<<<<<<<< + * # Optimization: If we're not subclassed, we can't + * # have data descriptors, so this goes right in the dict. + */ + } + + /* "src/gevent/local.py":486 + * return + * + * if name in self._local_type_vars: # <<<<<<<<<<<<<< + * if name in self._local_type_set_descriptors: + * type_attr = getattr(self._local_type, name, _marker) + */ + if (unlikely(__pyx_v_self->_local_type_vars == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); + __PYX_ERR(0, 486, __pyx_L1_error) + } + __pyx_t_1 = (__Pyx_PySet_ContainsTF(__pyx_v_name, __pyx_v_self->_local_type_vars, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 486, __pyx_L1_error) + __pyx_t_4 = (__pyx_t_1 != 0); + if (__pyx_t_4) { + + /* "src/gevent/local.py":487 + * + * if name in self._local_type_vars: + * if name in self._local_type_set_descriptors: # <<<<<<<<<<<<<< + * type_attr = getattr(self._local_type, name, _marker) + * # A data descriptor, like a property or a slot. + */ + if (unlikely(__pyx_v_self->_local_type_set_descriptors == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); + __PYX_ERR(0, 487, __pyx_L1_error) + } + __pyx_t_4 = (__Pyx_PySet_ContainsTF(__pyx_v_name, __pyx_v_self->_local_type_set_descriptors, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 487, __pyx_L1_error) + __pyx_t_1 = (__pyx_t_4 != 0); + if (__pyx_t_1) { + + /* "src/gevent/local.py":488 + * if name in self._local_type_vars: + * if name in self._local_type_set_descriptors: + * type_attr = getattr(self._local_type, name, _marker) # <<<<<<<<<<<<<< + * # A data descriptor, like a property or a slot. + * type(type_attr).__set__(type_attr, self, value) + */ + __pyx_t_3 = ((PyObject *)__pyx_v_self->_local_type); + __Pyx_INCREF(__pyx_t_3); + __pyx_t_2 = __pyx_v_6gevent_6_local__marker; + __Pyx_INCREF(__pyx_t_2); + __pyx_t_7 = __Pyx_GetAttr3(__pyx_t_3, __pyx_v_name, __pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 488, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_type_attr = __pyx_t_7; + __pyx_t_7 = 0; + + /* "src/gevent/local.py":490 + * type_attr = getattr(self._local_type, name, _marker) + * # A data descriptor, like a property or a slot. + * type(type_attr).__set__(type_attr, self, value) # <<<<<<<<<<<<<< + * return + * # Otherwise it goes directly in the dict + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)Py_TYPE(__pyx_v_type_attr)), __pyx_n_s_set); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 490, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + __pyx_t_6 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_6 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[4] = {__pyx_t_3, __pyx_v_type_attr, ((PyObject *)__pyx_v_self), __pyx_v_value}; + __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 490, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_t_7); + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[4] = {__pyx_t_3, __pyx_v_type_attr, ((PyObject *)__pyx_v_self), __pyx_v_value}; + __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 490, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_t_7); + } else + #endif + { + __pyx_t_5 = PyTuple_New(3+__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 490, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (__pyx_t_3) { + __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL; + } + __Pyx_INCREF(__pyx_v_type_attr); + __Pyx_GIVEREF(__pyx_v_type_attr); + PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_6, __pyx_v_type_attr); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_6, ((PyObject *)__pyx_v_self)); + __Pyx_INCREF(__pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_6, __pyx_v_value); + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 490, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "src/gevent/local.py":491 + * # A data descriptor, like a property or a slot. + * type(type_attr).__set__(type_attr, self, value) + * return # <<<<<<<<<<<<<< + * # Otherwise it goes directly in the dict + * dct[name] = value + */ + __pyx_r = 0; + goto __pyx_L0; + + /* "src/gevent/local.py":487 + * + * if name in self._local_type_vars: + * if name in self._local_type_set_descriptors: # <<<<<<<<<<<<<< + * type_attr = getattr(self._local_type, name, _marker) + * # A data descriptor, like a property or a slot. + */ + } + + /* "src/gevent/local.py":486 + * return + * + * if name in self._local_type_vars: # <<<<<<<<<<<<<< + * if name in self._local_type_set_descriptors: + * type_attr = getattr(self._local_type, name, _marker) + */ + } + + /* "src/gevent/local.py":493 + * return + * # Otherwise it goes directly in the dict + * dct[name] = value # <<<<<<<<<<<<<< + * + * def __delattr__(self, name): + */ + if (unlikely(__pyx_v_dct == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 493, __pyx_L1_error) + } + if (unlikely(PyDict_SetItem(__pyx_v_dct, __pyx_v_name, __pyx_v_value) < 0)) __PYX_ERR(0, 493, __pyx_L1_error) + + /* "src/gevent/local.py":468 + * % (self._local_type.__name__, name)) + * + * def __setattr__(self, name, value): # <<<<<<<<<<<<<< + * if name == '__dict__': + * raise AttributeError( + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("gevent._local.local.__setattr__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_dct); + __Pyx_XDECREF(__pyx_v_type_attr); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/local.py":495 + * dct[name] = value + * + * def __delattr__(self, name): # <<<<<<<<<<<<<< + * if name == '__dict__': + * raise AttributeError( + */ + +/* Python wrapper */ +static int __pyx_pw_6gevent_6_local_5local_7__delattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_name); /*proto*/ +static int __pyx_pw_6gevent_6_local_5local_7__delattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_name) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__delattr__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6_local_5local_6__delattr__(((struct __pyx_obj_6gevent_6_local_local *)__pyx_v_self), ((PyObject *)__pyx_v_name)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_6_local_5local_6__delattr__(struct __pyx_obj_6gevent_6_local_local *__pyx_v_self, PyObject *__pyx_v_name) { + PyObject *__pyx_v_type_attr = NULL; + PyObject *__pyx_v_dct = NULL; + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + __Pyx_RefNannySetupContext("__delattr__", 0); + + /* "src/gevent/local.py":496 + * + * def __delattr__(self, name): + * if name == '__dict__': # <<<<<<<<<<<<<< + * raise AttributeError( + * "%r object attribute '__dict__' is read-only" + */ + __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_name, __pyx_n_s_dict, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 496, __pyx_L1_error) + if (unlikely(__pyx_t_1)) { + + /* "src/gevent/local.py":499 + * raise AttributeError( + * "%r object attribute '__dict__' is read-only" + * % self.__class__.__name__) # <<<<<<<<<<<<<< + * + * if name in self._local_type_vars: + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 499, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 499, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyString_FormatSafe(__pyx_kp_s_r_object_attribute___dict___is, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 499, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "src/gevent/local.py":497 + * def __delattr__(self, name): + * if name == '__dict__': + * raise AttributeError( # <<<<<<<<<<<<<< + * "%r object attribute '__dict__' is read-only" + * % self.__class__.__name__) + */ + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_AttributeError, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 497, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(0, 497, __pyx_L1_error) + + /* "src/gevent/local.py":496 + * + * def __delattr__(self, name): + * if name == '__dict__': # <<<<<<<<<<<<<< + * raise AttributeError( + * "%r object attribute '__dict__' is read-only" + */ + } + + /* "src/gevent/local.py":501 + * % self.__class__.__name__) + * + * if name in self._local_type_vars: # <<<<<<<<<<<<<< + * if name in self._local_type_del_descriptors: + * # A data descriptor, like a property or a slot. + */ + if (unlikely(__pyx_v_self->_local_type_vars == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); + __PYX_ERR(0, 501, __pyx_L1_error) + } + __pyx_t_1 = (__Pyx_PySet_ContainsTF(__pyx_v_name, __pyx_v_self->_local_type_vars, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 501, __pyx_L1_error) + __pyx_t_4 = (__pyx_t_1 != 0); + if (__pyx_t_4) { + + /* "src/gevent/local.py":502 + * + * if name in self._local_type_vars: + * if name in self._local_type_del_descriptors: # <<<<<<<<<<<<<< + * # A data descriptor, like a property or a slot. + * type_attr = getattr(self._local_type, name, _marker) + */ + if (unlikely(__pyx_v_self->_local_type_del_descriptors == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); + __PYX_ERR(0, 502, __pyx_L1_error) + } + __pyx_t_4 = (__Pyx_PySet_ContainsTF(__pyx_v_name, __pyx_v_self->_local_type_del_descriptors, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 502, __pyx_L1_error) + __pyx_t_1 = (__pyx_t_4 != 0); + if (__pyx_t_1) { + + /* "src/gevent/local.py":504 + * if name in self._local_type_del_descriptors: + * # A data descriptor, like a property or a slot. + * type_attr = getattr(self._local_type, name, _marker) # <<<<<<<<<<<<<< + * type(type_attr).__delete__(type_attr, self) + * return + */ + __pyx_t_3 = ((PyObject *)__pyx_v_self->_local_type); + __Pyx_INCREF(__pyx_t_3); + __pyx_t_2 = __pyx_v_6gevent_6_local__marker; + __Pyx_INCREF(__pyx_t_2); + __pyx_t_5 = __Pyx_GetAttr3(__pyx_t_3, __pyx_v_name, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 504, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_type_attr = __pyx_t_5; + __pyx_t_5 = 0; + + /* "src/gevent/local.py":505 + * # A data descriptor, like a property or a slot. + * type_attr = getattr(self._local_type, name, _marker) + * type(type_attr).__delete__(type_attr, self) # <<<<<<<<<<<<<< + * return + * # Otherwise it goes directly in the dict + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)Py_TYPE(__pyx_v_type_attr)), __pyx_n_s_delete); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 505, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + __pyx_t_6 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_6 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_type_attr, ((PyObject *)__pyx_v_self)}; + __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 505, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_t_5); + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_type_attr, ((PyObject *)__pyx_v_self)}; + __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 505, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_t_5); + } else + #endif + { + __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 505, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + if (__pyx_t_3) { + __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3); __pyx_t_3 = NULL; + } + __Pyx_INCREF(__pyx_v_type_attr); + __Pyx_GIVEREF(__pyx_v_type_attr); + PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_v_type_attr); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, ((PyObject *)__pyx_v_self)); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 505, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "src/gevent/local.py":506 + * type_attr = getattr(self._local_type, name, _marker) + * type(type_attr).__delete__(type_attr, self) + * return # <<<<<<<<<<<<<< + * # Otherwise it goes directly in the dict + * + */ + __pyx_r = 0; + goto __pyx_L0; + + /* "src/gevent/local.py":502 + * + * if name in self._local_type_vars: + * if name in self._local_type_del_descriptors: # <<<<<<<<<<<<<< + * # A data descriptor, like a property or a slot. + * type_attr = getattr(self._local_type, name, _marker) + */ + } + + /* "src/gevent/local.py":501 + * % self.__class__.__name__) + * + * if name in self._local_type_vars: # <<<<<<<<<<<<<< + * if name in self._local_type_del_descriptors: + * # A data descriptor, like a property or a slot. + */ + } + + /* "src/gevent/local.py":510 + * + * # Begin inlined function _get_dict() + * dct = _local_get_dict(self) # <<<<<<<<<<<<<< + * + * try: + */ + __pyx_t_5 = __pyx_f_6gevent_6_local__local_get_dict(__pyx_v_self); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 510, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_v_dct = ((PyObject*)__pyx_t_5); + __pyx_t_5 = 0; + + /* "src/gevent/local.py":512 + * dct = _local_get_dict(self) + * + * try: # <<<<<<<<<<<<<< + * del dct[name] + * except KeyError: + */ + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); + __Pyx_XGOTREF(__pyx_t_8); + __Pyx_XGOTREF(__pyx_t_9); + __Pyx_XGOTREF(__pyx_t_10); + /*try:*/ { + + /* "src/gevent/local.py":513 + * + * try: + * del dct[name] # <<<<<<<<<<<<<< + * except KeyError: + * raise AttributeError(name) + */ + if (unlikely(__pyx_v_dct == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 513, __pyx_L6_error) + } + if (unlikely(PyDict_DelItem(__pyx_v_dct, __pyx_v_name) < 0)) __PYX_ERR(0, 513, __pyx_L6_error) + + /* "src/gevent/local.py":512 + * dct = _local_get_dict(self) + * + * try: # <<<<<<<<<<<<<< + * del dct[name] + * except KeyError: + */ + } + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + goto __pyx_L11_try_end; + __pyx_L6_error:; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "src/gevent/local.py":514 + * try: + * del dct[name] + * except KeyError: # <<<<<<<<<<<<<< + * raise AttributeError(name) + * + */ + __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError); + if (__pyx_t_6) { + __Pyx_AddTraceback("gevent._local.local.__delattr__", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_2, &__pyx_t_7) < 0) __PYX_ERR(0, 514, __pyx_L8_except_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_t_7); + + /* "src/gevent/local.py":515 + * del dct[name] + * except KeyError: + * raise AttributeError(name) # <<<<<<<<<<<<<< + * + * def __copy__(self): + */ + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_AttributeError, __pyx_v_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 515, __pyx_L8_except_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(0, 515, __pyx_L8_except_error) + } + goto __pyx_L8_except_error; + __pyx_L8_except_error:; + + /* "src/gevent/local.py":512 + * dct = _local_get_dict(self) + * + * try: # <<<<<<<<<<<<<< + * del dct[name] + * except KeyError: + */ + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10); + goto __pyx_L1_error; + __pyx_L11_try_end:; + } + + /* "src/gevent/local.py":495 + * dct[name] = value + * + * def __delattr__(self, name): # <<<<<<<<<<<<<< + * if name == '__dict__': + * raise AttributeError( + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("gevent._local.local.__delattr__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_type_attr); + __Pyx_XDECREF(__pyx_v_dct); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/local.py":517 + * raise AttributeError(name) + * + * def __copy__(self): # <<<<<<<<<<<<<< + * impl = self._local__impl + * entry = impl.dicts[id(getcurrent())] # pylint:disable=undefined-variable + */ + +static PyObject *__pyx_pw_6gevent_6_local_5local_9__copy__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static struct __pyx_obj_6gevent_6_local_local *__pyx_f_6gevent_6_local_5local___copy__(struct __pyx_obj_6gevent_6_local_local *__pyx_v_self, int __pyx_skip_dispatch) { + struct __pyx_obj_6gevent_6_local__localimpl_dict_entry *__pyx_v_entry = 0; + PyObject *__pyx_v_dct = 0; + PyObject *__pyx_v_duplicate = 0; + struct __pyx_obj_6gevent_6_local_local *__pyx_v_instance = 0; + struct __pyx_obj_6gevent_6_local__localimpl *__pyx_v_impl = NULL; + PyTypeObject *__pyx_v_cls = NULL; + struct __pyx_obj_6gevent_6_local_local *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + __Pyx_RefNannySetupContext("__copy__", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0; + if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self)))))); + else { + PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + #endif + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_copy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 517, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_6_local_5local_9__copy__)) { + __Pyx_XDECREF(((PyObject *)__pyx_r)); + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 517, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_6gevent_6_local_local))))) __PYX_ERR(0, 517, __pyx_L1_error) + __pyx_r = ((struct __pyx_obj_6gevent_6_local_local *)__pyx_t_2); + __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0; + if (unlikely(type_dict_guard != tp_dict_version)) { + tp_dict_version = obj_dict_version = 0; + } + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + } + #endif + } + + /* "src/gevent/local.py":518 + * + * def __copy__(self): + * impl = self._local__impl # <<<<<<<<<<<<<< + * entry = impl.dicts[id(getcurrent())] # pylint:disable=undefined-variable + * + */ + __pyx_t_1 = ((PyObject *)__pyx_v_self->_local__impl); + __Pyx_INCREF(__pyx_t_1); + __pyx_v_impl = ((struct __pyx_obj_6gevent_6_local__localimpl *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "src/gevent/local.py":519 + * def __copy__(self): + * impl = self._local__impl + * entry = impl.dicts[id(getcurrent())] # pylint:disable=undefined-variable # <<<<<<<<<<<<<< + * + * dct = entry.localdict + */ + if (unlikely(__pyx_v_impl->dicts == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 519, __pyx_L1_error) + } + __pyx_t_1 = ((PyObject *)__pyx_f_6gevent_6_local_getcurrent()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 519, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 519, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_impl->dicts, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 519, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_6gevent_6_local__localimpl_dict_entry))))) __PYX_ERR(0, 519, __pyx_L1_error) + __pyx_v_entry = ((struct __pyx_obj_6gevent_6_local__localimpl_dict_entry *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "src/gevent/local.py":521 + * entry = impl.dicts[id(getcurrent())] # pylint:disable=undefined-variable + * + * dct = entry.localdict # <<<<<<<<<<<<<< + * duplicate = copy(dct) + * + */ + __pyx_t_1 = __pyx_v_entry->localdict; + __Pyx_INCREF(__pyx_t_1); + __pyx_v_dct = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "src/gevent/local.py":522 + * + * dct = entry.localdict + * duplicate = copy(dct) # <<<<<<<<<<<<<< + * + * cls = type(self) + */ + __Pyx_INCREF(__pyx_v_6gevent_6_local_copy); + __pyx_t_2 = __pyx_v_6gevent_6_local_copy; __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_dct) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_dct); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 522, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(PyDict_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 522, __pyx_L1_error) + __pyx_v_duplicate = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "src/gevent/local.py":524 + * duplicate = copy(dct) + * + * cls = type(self) # <<<<<<<<<<<<<< + * instance = cls(*impl.localargs, **impl.localkwargs) + * _local__copy_dict_from(instance, impl, duplicate) + */ + __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __pyx_v_cls = ((PyTypeObject*)((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + + /* "src/gevent/local.py":525 + * + * cls = type(self) + * instance = cls(*impl.localargs, **impl.localkwargs) # <<<<<<<<<<<<<< + * _local__copy_dict_from(instance, impl, duplicate) + * return instance + */ + if (unlikely(__pyx_v_impl->localargs == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); + __PYX_ERR(0, 525, __pyx_L1_error) + } + if (unlikely(__pyx_v_impl->localkwargs == Py_None)) { + PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); + __PYX_ERR(0, 525, __pyx_L1_error) + } + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_v_cls), __pyx_v_impl->localargs, __pyx_v_impl->localkwargs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 525, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_6gevent_6_local_local))))) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_v_instance = ((struct __pyx_obj_6gevent_6_local_local *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "src/gevent/local.py":526 + * cls = type(self) + * instance = cls(*impl.localargs, **impl.localkwargs) + * _local__copy_dict_from(instance, impl, duplicate) # <<<<<<<<<<<<<< + * return instance + * + */ + __pyx_t_1 = __pyx_f_6gevent_6_local__local__copy_dict_from(__pyx_v_instance, __pyx_v_impl, __pyx_v_duplicate); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 526, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/local.py":527 + * instance = cls(*impl.localargs, **impl.localkwargs) + * _local__copy_dict_from(instance, impl, duplicate) + * return instance # <<<<<<<<<<<<<< + * + * def _local__copy_dict_from(self, impl, duplicate): + */ + __Pyx_XDECREF(((PyObject *)__pyx_r)); + __Pyx_INCREF(((PyObject *)__pyx_v_instance)); + __pyx_r = __pyx_v_instance; + goto __pyx_L0; + + /* "src/gevent/local.py":517 + * raise AttributeError(name) + * + * def __copy__(self): # <<<<<<<<<<<<<< + * impl = self._local__impl + * entry = impl.dicts[id(getcurrent())] # pylint:disable=undefined-variable + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("gevent._local.local.__copy__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_entry); + __Pyx_XDECREF(__pyx_v_dct); + __Pyx_XDECREF(__pyx_v_duplicate); + __Pyx_XDECREF((PyObject *)__pyx_v_instance); + __Pyx_XDECREF((PyObject *)__pyx_v_impl); + __Pyx_XDECREF(__pyx_v_cls); + __Pyx_XGIVEREF((PyObject *)__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_local_5local_9__copy__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6gevent_6_local_5local_8__copy__[] = "local.__copy__(self) -> local"; +static PyMethodDef __pyx_mdef_6gevent_6_local_5local_9__copy__ = {"__copy__", (PyCFunction)__pyx_pw_6gevent_6_local_5local_9__copy__, METH_NOARGS, __pyx_doc_6gevent_6_local_5local_8__copy__}; +static PyObject *__pyx_pw_6gevent_6_local_5local_9__copy__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__copy__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6_local_5local_8__copy__(((struct __pyx_obj_6gevent_6_local_local *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_local_5local_8__copy__(struct __pyx_obj_6gevent_6_local_local *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__copy__", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = ((PyObject *)__pyx_f_6gevent_6_local_5local___copy__(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 517, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent._local.local.__copy__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/local.py":529 + * return instance + * + * def _local__copy_dict_from(self, impl, duplicate): # <<<<<<<<<<<<<< + * current = getcurrent() # pylint:disable=undefined-variable + * currentId = id(current) + */ + +static PyObject *__pyx_f_6gevent_6_local__local__copy_dict_from(struct __pyx_obj_6gevent_6_local_local *__pyx_v_self, struct __pyx_obj_6gevent_6_local__localimpl *__pyx_v_impl, PyObject *__pyx_v_duplicate) { + struct __pyx_obj_6gevent_6_local__localimpl_dict_entry *__pyx_v_entry = 0; + PyGreenlet *__pyx_v_current = NULL; + PyObject *__pyx_v_currentId = NULL; + struct __pyx_obj_6gevent_6_local__localimpl *__pyx_v_new_impl = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("_local__copy_dict_from", 0); + + /* "src/gevent/local.py":530 + * + * def _local__copy_dict_from(self, impl, duplicate): + * current = getcurrent() # pylint:disable=undefined-variable # <<<<<<<<<<<<<< + * currentId = id(current) + * new_impl = self._local__impl + */ + __pyx_t_1 = ((PyObject *)__pyx_f_6gevent_6_local_getcurrent()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 530, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_current = ((PyGreenlet *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "src/gevent/local.py":531 + * def _local__copy_dict_from(self, impl, duplicate): + * current = getcurrent() # pylint:disable=undefined-variable + * currentId = id(current) # <<<<<<<<<<<<<< + * new_impl = self._local__impl + * assert new_impl is not impl + */ + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_current)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 531, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_currentId = __pyx_t_1; + __pyx_t_1 = 0; + + /* "src/gevent/local.py":532 + * current = getcurrent() # pylint:disable=undefined-variable + * currentId = id(current) + * new_impl = self._local__impl # <<<<<<<<<<<<<< + * assert new_impl is not impl + * entry = new_impl.dicts[currentId] + */ + __pyx_t_1 = ((PyObject *)__pyx_v_self->_local__impl); + __Pyx_INCREF(__pyx_t_1); + __pyx_v_new_impl = ((struct __pyx_obj_6gevent_6_local__localimpl *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "src/gevent/local.py":533 + * currentId = id(current) + * new_impl = self._local__impl + * assert new_impl is not impl # <<<<<<<<<<<<<< + * entry = new_impl.dicts[currentId] + * new_impl.dicts[currentId] = _localimpl_dict_entry(entry.wrgreenlet, duplicate) + */ + #ifndef CYTHON_WITHOUT_ASSERTIONS + if (unlikely(!Py_OptimizeFlag)) { + __pyx_t_2 = (__pyx_v_new_impl != __pyx_v_impl); + if (unlikely(!(__pyx_t_2 != 0))) { + PyErr_SetNone(PyExc_AssertionError); + __PYX_ERR(0, 533, __pyx_L1_error) + } + } + #endif + + /* "src/gevent/local.py":534 + * new_impl = self._local__impl + * assert new_impl is not impl + * entry = new_impl.dicts[currentId] # <<<<<<<<<<<<<< + * new_impl.dicts[currentId] = _localimpl_dict_entry(entry.wrgreenlet, duplicate) + * + */ + if (unlikely(__pyx_v_new_impl->dicts == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 534, __pyx_L1_error) + } + __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_new_impl->dicts, __pyx_v_currentId); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 534, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_6gevent_6_local__localimpl_dict_entry))))) __PYX_ERR(0, 534, __pyx_L1_error) + __pyx_v_entry = ((struct __pyx_obj_6gevent_6_local__localimpl_dict_entry *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "src/gevent/local.py":535 + * assert new_impl is not impl + * entry = new_impl.dicts[currentId] + * new_impl.dicts[currentId] = _localimpl_dict_entry(entry.wrgreenlet, duplicate) # <<<<<<<<<<<<<< + * + * def _local_find_descriptors(self): + */ + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 535, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_entry->wrgreenlet); + __Pyx_GIVEREF(__pyx_v_entry->wrgreenlet); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_entry->wrgreenlet); + __Pyx_INCREF(__pyx_v_duplicate); + __Pyx_GIVEREF(__pyx_v_duplicate); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_duplicate); + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6gevent_6_local__localimpl_dict_entry), __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 535, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(__pyx_v_new_impl->dicts == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 535, __pyx_L1_error) + } + if (unlikely(PyDict_SetItem(__pyx_v_new_impl->dicts, __pyx_v_currentId, __pyx_t_3) < 0)) __PYX_ERR(0, 535, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "src/gevent/local.py":529 + * return instance + * + * def _local__copy_dict_from(self, impl, duplicate): # <<<<<<<<<<<<<< + * current = getcurrent() # pylint:disable=undefined-variable + * currentId = id(current) + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("gevent._local._local__copy_dict_from", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_entry); + __Pyx_XDECREF((PyObject *)__pyx_v_current); + __Pyx_XDECREF(__pyx_v_currentId); + __Pyx_XDECREF((PyObject *)__pyx_v_new_impl); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/local.py":537 + * new_impl.dicts[currentId] = _localimpl_dict_entry(entry.wrgreenlet, duplicate) + * + * def _local_find_descriptors(self): # <<<<<<<<<<<<<< + * type_self = type(self) + * gets = set() + */ + +static PyObject *__pyx_f_6gevent_6_local__local_find_descriptors(struct __pyx_obj_6gevent_6_local_local *__pyx_v_self) { + PyObject *__pyx_v_mro = 0; + PyObject *__pyx_v_gets = 0; + PyObject *__pyx_v_dels = 0; + PyObject *__pyx_v_set_or_del = 0; + PyTypeObject *__pyx_v_type_self = 0; + PyTypeObject *__pyx_v_type_attr = 0; + PyObject *__pyx_v_sets = 0; + PyObject *__pyx_v_attr_name = NULL; + PyObject *__pyx_v_base = NULL; + PyObject *__pyx_v_bd = NULL; + PyObject *__pyx_v_attr = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + Py_ssize_t __pyx_t_4; + PyObject *(*__pyx_t_5)(PyObject *); + Py_ssize_t __pyx_t_6; + int __pyx_t_7; + int __pyx_t_8; + int __pyx_t_9; + __Pyx_RefNannySetupContext("_local_find_descriptors", 0); + + /* "src/gevent/local.py":538 + * + * def _local_find_descriptors(self): + * type_self = type(self) # <<<<<<<<<<<<<< + * gets = set() + * dels = set() + */ + __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __pyx_v_type_self = ((PyTypeObject*)((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + + /* "src/gevent/local.py":539 + * def _local_find_descriptors(self): + * type_self = type(self) + * gets = set() # <<<<<<<<<<<<<< + * dels = set() + * set_or_del = set() + */ + __pyx_t_1 = PySet_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 539, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_gets = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "src/gevent/local.py":540 + * type_self = type(self) + * gets = set() + * dels = set() # <<<<<<<<<<<<<< + * set_or_del = set() + * sets = set() + */ + __pyx_t_1 = PySet_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 540, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_dels = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "src/gevent/local.py":541 + * gets = set() + * dels = set() + * set_or_del = set() # <<<<<<<<<<<<<< + * sets = set() + * mro = list(type_self.mro()) + */ + __pyx_t_1 = PySet_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 541, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_set_or_del = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "src/gevent/local.py":542 + * dels = set() + * set_or_del = set() + * sets = set() # <<<<<<<<<<<<<< + * mro = list(type_self.mro()) + * + */ + __pyx_t_1 = PySet_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 542, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_sets = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "src/gevent/local.py":543 + * set_or_del = set() + * sets = set() + * mro = list(type_self.mro()) # <<<<<<<<<<<<<< + * + * for attr_name in dir(type_self): + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_type_self), __pyx_n_s_mro); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 543, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 543, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PySequence_List(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 543, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_mro = ((PyObject*)__pyx_t_2); + __pyx_t_2 = 0; + + /* "src/gevent/local.py":545 + * mro = list(type_self.mro()) + * + * for attr_name in dir(type_self): # <<<<<<<<<<<<<< + * # Conventionally, descriptors when called on a class + * # return themself, but not all do. Notable exceptions are + */ + __pyx_t_2 = PyObject_Dir(((PyObject *)__pyx_v_type_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 545, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) { + __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1); __pyx_t_4 = 0; + __pyx_t_5 = NULL; + } else { + __pyx_t_4 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 545, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 545, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + for (;;) { + if (likely(!__pyx_t_5)) { + if (likely(PyList_CheckExact(__pyx_t_1))) { + if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 545, __pyx_L1_error) + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 545, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + #endif + } else { + if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 545, __pyx_L1_error) + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 545, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + #endif + } + } else { + __pyx_t_2 = __pyx_t_5(__pyx_t_1); + if (unlikely(!__pyx_t_2)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(0, 545, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_2); + } + __Pyx_XDECREF_SET(__pyx_v_attr_name, __pyx_t_2); + __pyx_t_2 = 0; + + /* "src/gevent/local.py":551 + * # return other class attributes. So we can't use getattr, and instead + * # walk up the dicts + * for base in mro: # <<<<<<<<<<<<<< + * bd = base.__dict__ + * if attr_name in bd: + */ + __pyx_t_2 = __pyx_v_mro; __Pyx_INCREF(__pyx_t_2); __pyx_t_6 = 0; + for (;;) { + if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_3); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 551, __pyx_L1_error) + #else + __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 551, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + #endif + __Pyx_XDECREF_SET(__pyx_v_base, __pyx_t_3); + __pyx_t_3 = 0; + + /* "src/gevent/local.py":552 + * # walk up the dicts + * for base in mro: + * bd = base.__dict__ # <<<<<<<<<<<<<< + * if attr_name in bd: + * attr = bd[attr_name] + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_dict); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 552, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_XDECREF_SET(__pyx_v_bd, __pyx_t_3); + __pyx_t_3 = 0; + + /* "src/gevent/local.py":553 + * for base in mro: + * bd = base.__dict__ + * if attr_name in bd: # <<<<<<<<<<<<<< + * attr = bd[attr_name] + * break + */ + __pyx_t_7 = (__Pyx_PySequence_ContainsTF(__pyx_v_attr_name, __pyx_v_bd, Py_EQ)); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 553, __pyx_L1_error) + __pyx_t_8 = (__pyx_t_7 != 0); + if (__pyx_t_8) { + + /* "src/gevent/local.py":554 + * bd = base.__dict__ + * if attr_name in bd: + * attr = bd[attr_name] # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_bd, __pyx_v_attr_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 554, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_XDECREF_SET(__pyx_v_attr, __pyx_t_3); + __pyx_t_3 = 0; + + /* "src/gevent/local.py":555 + * if attr_name in bd: + * attr = bd[attr_name] + * break # <<<<<<<<<<<<<< + * else: + * raise AttributeError(attr_name) + */ + goto __pyx_L6_break; + + /* "src/gevent/local.py":553 + * for base in mro: + * bd = base.__dict__ + * if attr_name in bd: # <<<<<<<<<<<<<< + * attr = bd[attr_name] + * break + */ + } + + /* "src/gevent/local.py":551 + * # return other class attributes. So we can't use getattr, and instead + * # walk up the dicts + * for base in mro: # <<<<<<<<<<<<<< + * bd = base.__dict__ + * if attr_name in bd: + */ + } + /*else*/ { + + /* "src/gevent/local.py":557 + * break + * else: + * raise AttributeError(attr_name) # <<<<<<<<<<<<<< + * + * type_attr = type(attr) + */ + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_AttributeError, __pyx_v_attr_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 557, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(0, 557, __pyx_L1_error) + } + + /* "src/gevent/local.py":551 + * # return other class attributes. So we can't use getattr, and instead + * # walk up the dicts + * for base in mro: # <<<<<<<<<<<<<< + * bd = base.__dict__ + * if attr_name in bd: + */ + __pyx_L6_break:; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/local.py":559 + * raise AttributeError(attr_name) + * + * type_attr = type(attr) # <<<<<<<<<<<<<< + * if hasattr(type_attr, '__get__'): + * gets.add(attr_name) + */ + __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_attr))); + __Pyx_XDECREF_SET(__pyx_v_type_attr, ((PyTypeObject*)((PyObject *)Py_TYPE(__pyx_v_attr)))); + + /* "src/gevent/local.py":560 + * + * type_attr = type(attr) + * if hasattr(type_attr, '__get__'): # <<<<<<<<<<<<<< + * gets.add(attr_name) + * if hasattr(type_attr, '__delete__'): + */ + __pyx_t_8 = __Pyx_HasAttr(((PyObject *)__pyx_v_type_attr), __pyx_n_s_get); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 560, __pyx_L1_error) + __pyx_t_7 = (__pyx_t_8 != 0); + if (__pyx_t_7) { + + /* "src/gevent/local.py":561 + * type_attr = type(attr) + * if hasattr(type_attr, '__get__'): + * gets.add(attr_name) # <<<<<<<<<<<<<< + * if hasattr(type_attr, '__delete__'): + * dels.add(attr_name) + */ + __pyx_t_9 = PySet_Add(__pyx_v_gets, __pyx_v_attr_name); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 561, __pyx_L1_error) + + /* "src/gevent/local.py":560 + * + * type_attr = type(attr) + * if hasattr(type_attr, '__get__'): # <<<<<<<<<<<<<< + * gets.add(attr_name) + * if hasattr(type_attr, '__delete__'): + */ + } + + /* "src/gevent/local.py":562 + * if hasattr(type_attr, '__get__'): + * gets.add(attr_name) + * if hasattr(type_attr, '__delete__'): # <<<<<<<<<<<<<< + * dels.add(attr_name) + * set_or_del.add(attr_name) + */ + __pyx_t_7 = __Pyx_HasAttr(((PyObject *)__pyx_v_type_attr), __pyx_n_s_delete); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 562, __pyx_L1_error) + __pyx_t_8 = (__pyx_t_7 != 0); + if (__pyx_t_8) { + + /* "src/gevent/local.py":563 + * gets.add(attr_name) + * if hasattr(type_attr, '__delete__'): + * dels.add(attr_name) # <<<<<<<<<<<<<< + * set_or_del.add(attr_name) + * if hasattr(type_attr, '__set__'): + */ + __pyx_t_9 = PySet_Add(__pyx_v_dels, __pyx_v_attr_name); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 563, __pyx_L1_error) + + /* "src/gevent/local.py":564 + * if hasattr(type_attr, '__delete__'): + * dels.add(attr_name) + * set_or_del.add(attr_name) # <<<<<<<<<<<<<< + * if hasattr(type_attr, '__set__'): + * sets.add(attr_name) + */ + __pyx_t_9 = PySet_Add(__pyx_v_set_or_del, __pyx_v_attr_name); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 564, __pyx_L1_error) + + /* "src/gevent/local.py":562 + * if hasattr(type_attr, '__get__'): + * gets.add(attr_name) + * if hasattr(type_attr, '__delete__'): # <<<<<<<<<<<<<< + * dels.add(attr_name) + * set_or_del.add(attr_name) + */ + } + + /* "src/gevent/local.py":565 + * dels.add(attr_name) + * set_or_del.add(attr_name) + * if hasattr(type_attr, '__set__'): # <<<<<<<<<<<<<< + * sets.add(attr_name) + * + */ + __pyx_t_8 = __Pyx_HasAttr(((PyObject *)__pyx_v_type_attr), __pyx_n_s_set); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 565, __pyx_L1_error) + __pyx_t_7 = (__pyx_t_8 != 0); + if (__pyx_t_7) { + + /* "src/gevent/local.py":566 + * set_or_del.add(attr_name) + * if hasattr(type_attr, '__set__'): + * sets.add(attr_name) # <<<<<<<<<<<<<< + * + * return (gets, dels, set_or_del, sets) + */ + __pyx_t_9 = PySet_Add(__pyx_v_sets, __pyx_v_attr_name); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 566, __pyx_L1_error) + + /* "src/gevent/local.py":565 + * dels.add(attr_name) + * set_or_del.add(attr_name) + * if hasattr(type_attr, '__set__'): # <<<<<<<<<<<<<< + * sets.add(attr_name) + * + */ + } + + /* "src/gevent/local.py":545 + * mro = list(type_self.mro()) + * + * for attr_name in dir(type_self): # <<<<<<<<<<<<<< + * # Conventionally, descriptors when called on a class + * # return themself, but not all do. Notable exceptions are + */ + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/local.py":568 + * sets.add(attr_name) + * + * return (gets, dels, set_or_del, sets) # <<<<<<<<<<<<<< + * + * # Cython doesn't let us use __new__, it requires + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 568, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_gets); + __Pyx_GIVEREF(__pyx_v_gets); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_gets); + __Pyx_INCREF(__pyx_v_dels); + __Pyx_GIVEREF(__pyx_v_dels); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_dels); + __Pyx_INCREF(__pyx_v_set_or_del); + __Pyx_GIVEREF(__pyx_v_set_or_del); + PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_set_or_del); + __Pyx_INCREF(__pyx_v_sets); + __Pyx_GIVEREF(__pyx_v_sets); + PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_v_sets); + __pyx_r = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "src/gevent/local.py":537 + * new_impl.dicts[currentId] = _localimpl_dict_entry(entry.wrgreenlet, duplicate) + * + * def _local_find_descriptors(self): # <<<<<<<<<<<<<< + * type_self = type(self) + * gets = set() + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("gevent._local._local_find_descriptors", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_mro); + __Pyx_XDECREF(__pyx_v_gets); + __Pyx_XDECREF(__pyx_v_dels); + __Pyx_XDECREF(__pyx_v_set_or_del); + __Pyx_XDECREF(__pyx_v_type_self); + __Pyx_XDECREF(__pyx_v_type_attr); + __Pyx_XDECREF(__pyx_v_sets); + __Pyx_XDECREF(__pyx_v_attr_name); + __Pyx_XDECREF(__pyx_v_base); + __Pyx_XDECREF(__pyx_v_bd); + __Pyx_XDECREF(__pyx_v_attr); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/local.py":574 + * # (e.g., on PyPy). So we set it at runtime. Cython + * # will raise an error if we're compiled. + * def __new__(cls, *args, **kw): # <<<<<<<<<<<<<< + * self = super(local, cls).__new__(cls) + * # We get the cls in *args for some reason + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_local_3__new__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6gevent_6_local_2__new__[] = "__new__(cls, *args, **kw)"; +static PyMethodDef __pyx_mdef_6gevent_6_local_3__new__ = {"__new__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_6_local_3__new__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_6_local_2__new__}; +static PyObject *__pyx_pw_6gevent_6_local_3__new__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_cls = 0; + PyObject *__pyx_v_args = 0; + PyObject *__pyx_v_kw = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__new__ (wrapper)", 0); + __pyx_v_kw = PyDict_New(); if (unlikely(!__pyx_v_kw)) return NULL; + __Pyx_GOTREF(__pyx_v_kw); + if (PyTuple_GET_SIZE(__pyx_args) > 1) { + __pyx_v_args = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args)); + if (unlikely(!__pyx_v_args)) { + __Pyx_DECREF(__pyx_v_kw); __pyx_v_kw = 0; + __Pyx_RefNannyFinishContext(); + return NULL; + } + __Pyx_GOTREF(__pyx_v_args); + } else { + __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple); + } + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_cls,0}; + PyObject* values[1] = {0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + default: + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cls)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kw, values, used_pos_args, "__new__") < 0)) __PYX_ERR(0, 574, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) < 1) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + } + __pyx_v_cls = values[0]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__new__", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 574, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0; + __Pyx_DECREF(__pyx_v_kw); __pyx_v_kw = 0; + __Pyx_AddTraceback("gevent._local.__new__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_6_local_2__new__(__pyx_self, __pyx_v_cls, __pyx_v_args, __pyx_v_kw); + + /* function exit code */ + __Pyx_XDECREF(__pyx_v_args); + __Pyx_XDECREF(__pyx_v_kw); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_local_2__new__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_cls, PyObject *__pyx_v_args, PyObject *__pyx_v_kw) { + PyObject *__pyx_v_self = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("__new__", 0); + + /* "src/gevent/local.py":575 + * # will raise an error if we're compiled. + * def __new__(cls, *args, **kw): + * self = super(local, cls).__new__(cls) # <<<<<<<<<<<<<< + * # We get the cls in *args for some reason + * # too when we do it this way....except on PyPy3, which does + */ + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 575, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_ptype_6gevent_6_local_local)); + __Pyx_GIVEREF(((PyObject *)__pyx_ptype_6gevent_6_local_local)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_ptype_6gevent_6_local_local)); + __Pyx_INCREF(__pyx_v_cls); + __Pyx_GIVEREF(__pyx_v_cls); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_cls); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 575, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 575, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_cls) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_cls); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 575, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_self = __pyx_t_1; + __pyx_t_1 = 0; + + /* "src/gevent/local.py":579 + * # too when we do it this way....except on PyPy3, which does + * # not *unless* it's wrapped in a classmethod (which it is) + * self.__cinit__(*args[1:], **kw) # <<<<<<<<<<<<<< + * return self + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cinit); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 579, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyTuple_GetSlice(__pyx_v_args, 1, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 579, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_v_kw); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 579, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "src/gevent/local.py":580 + * # not *unless* it's wrapped in a classmethod (which it is) + * self.__cinit__(*args[1:], **kw) + * return self # <<<<<<<<<<<<<< + * + * try: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self); + __pyx_r = __pyx_v_self; + goto __pyx_L0; + + /* "src/gevent/local.py":574 + * # (e.g., on PyPy). So we set it at runtime. Cython + * # will raise an error if we're compiled. + * def __new__(cls, *args, **kw): # <<<<<<<<<<<<<< + * self = super(local, cls).__new__(cls) + * # We get the cls in *args for some reason + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("gevent._local.__new__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_self); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/__greenlet_primitives.pxd":23 + * + * @cython.final + * cdef inline greenlet getcurrent(): # <<<<<<<<<<<<<< + * return PyGreenlet_GetCurrent() + * + */ + +static CYTHON_INLINE PyGreenlet *__pyx_f_6gevent_21__greenlet_primitives_getcurrent(void) { + PyGreenlet *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("getcurrent", 0); + + /* "gevent/__greenlet_primitives.pxd":24 + * @cython.final + * cdef inline greenlet getcurrent(): + * return PyGreenlet_GetCurrent() # <<<<<<<<<<<<<< + * + * cdef bint _greenlet_imported + */ + __Pyx_XDECREF(((PyObject *)__pyx_r)); + __pyx_t_1 = ((PyObject *)PyGreenlet_GetCurrent()); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 24, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = ((PyGreenlet *)__pyx_t_1); + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "gevent/__greenlet_primitives.pxd":23 + * + * @cython.final + * cdef inline greenlet getcurrent(): # <<<<<<<<<<<<<< + * return PyGreenlet_GetCurrent() + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__greenlet_primitives.getcurrent", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF((PyObject *)__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/__greenlet_primitives.pxd":28 + * cdef bint _greenlet_imported + * + * cdef inline void greenlet_init(): # <<<<<<<<<<<<<< + * global _greenlet_imported + * if not _greenlet_imported: + */ + +static CYTHON_INLINE void __pyx_f_6gevent_21__greenlet_primitives_greenlet_init(void) { + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("greenlet_init", 0); + + /* "gevent/__greenlet_primitives.pxd":30 + * cdef inline void greenlet_init(): + * global _greenlet_imported + * if not _greenlet_imported: # <<<<<<<<<<<<<< + * PyGreenlet_Import() + * _greenlet_imported = True + */ + __pyx_t_1 = ((!(__pyx_v_6gevent_21__greenlet_primitives__greenlet_imported != 0)) != 0); + if (__pyx_t_1) { + + /* "gevent/__greenlet_primitives.pxd":31 + * global _greenlet_imported + * if not _greenlet_imported: + * PyGreenlet_Import() # <<<<<<<<<<<<<< + * _greenlet_imported = True + * + */ + PyGreenlet_Import(); + + /* "gevent/__greenlet_primitives.pxd":32 + * if not _greenlet_imported: + * PyGreenlet_Import() + * _greenlet_imported = True # <<<<<<<<<<<<<< + * + * cdef inline object _greenlet_switch(greenlet self): + */ + __pyx_v_6gevent_21__greenlet_primitives__greenlet_imported = 1; + + /* "gevent/__greenlet_primitives.pxd":30 + * cdef inline void greenlet_init(): + * global _greenlet_imported + * if not _greenlet_imported: # <<<<<<<<<<<<<< + * PyGreenlet_Import() + * _greenlet_imported = True + */ + } + + /* "gevent/__greenlet_primitives.pxd":28 + * cdef bint _greenlet_imported + * + * cdef inline void greenlet_init(): # <<<<<<<<<<<<<< + * global _greenlet_imported + * if not _greenlet_imported: + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "gevent/__greenlet_primitives.pxd":34 + * _greenlet_imported = True + * + * cdef inline object _greenlet_switch(greenlet self): # <<<<<<<<<<<<<< + * return PyGreenlet_Switch(self, NULL, NULL) + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_6gevent_21__greenlet_primitives__greenlet_switch(PyGreenlet *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("_greenlet_switch", 0); + + /* "gevent/__greenlet_primitives.pxd":35 + * + * cdef inline object _greenlet_switch(greenlet self): + * return PyGreenlet_Switch(self, NULL, NULL) # <<<<<<<<<<<<<< + * + * cdef class TrackedRawGreenlet(greenlet): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyGreenlet_Switch(__pyx_v_self, NULL, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 35, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "gevent/__greenlet_primitives.pxd":34 + * _greenlet_imported = True + * + * cdef inline object _greenlet_switch(greenlet self): # <<<<<<<<<<<<<< + * return PyGreenlet_Switch(self, NULL, NULL) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__greenlet_primitives._greenlet_switch", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/__waiter.pxd":24 + * void PyGreenlet_Import() + * + * cdef inline greenlet getcurrent(): # <<<<<<<<<<<<<< + * return PyGreenlet_GetCurrent() + * + */ + +static CYTHON_INLINE PyGreenlet *__pyx_f_6gevent_8__waiter_getcurrent(void) { + PyGreenlet *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("getcurrent", 0); + + /* "gevent/__waiter.pxd":25 + * + * cdef inline greenlet getcurrent(): + * return PyGreenlet_GetCurrent() # <<<<<<<<<<<<<< + * + * cdef inline void greenlet_init(): + */ + __Pyx_XDECREF(((PyObject *)__pyx_r)); + __pyx_t_1 = ((PyObject *)PyGreenlet_GetCurrent()); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 25, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = ((PyGreenlet *)__pyx_t_1); + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "gevent/__waiter.pxd":24 + * void PyGreenlet_Import() + * + * cdef inline greenlet getcurrent(): # <<<<<<<<<<<<<< + * return PyGreenlet_GetCurrent() + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__waiter.getcurrent", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF((PyObject *)__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/__waiter.pxd":27 + * return PyGreenlet_GetCurrent() + * + * cdef inline void greenlet_init(): # <<<<<<<<<<<<<< + * global _greenlet_imported + * if not _greenlet_imported: + */ + +static CYTHON_INLINE void __pyx_f_6gevent_8__waiter_greenlet_init(void) { + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("greenlet_init", 0); + + /* "gevent/__waiter.pxd":29 + * cdef inline void greenlet_init(): + * global _greenlet_imported + * if not _greenlet_imported: # <<<<<<<<<<<<<< + * PyGreenlet_Import() + * _greenlet_imported = True + */ + __pyx_t_1 = ((!(__pyx_v_6gevent_8__waiter__greenlet_imported != 0)) != 0); + if (__pyx_t_1) { + + /* "gevent/__waiter.pxd":30 + * global _greenlet_imported + * if not _greenlet_imported: + * PyGreenlet_Import() # <<<<<<<<<<<<<< + * _greenlet_imported = True + * + */ + PyGreenlet_Import(); + + /* "gevent/__waiter.pxd":31 + * if not _greenlet_imported: + * PyGreenlet_Import() + * _greenlet_imported = True # <<<<<<<<<<<<<< + * + * cdef class Waiter: + */ + __pyx_v_6gevent_8__waiter__greenlet_imported = 1; + + /* "gevent/__waiter.pxd":29 + * cdef inline void greenlet_init(): + * global _greenlet_imported + * if not _greenlet_imported: # <<<<<<<<<<<<<< + * PyGreenlet_Import() + * _greenlet_imported = True + */ + } + + /* "gevent/__waiter.pxd":27 + * return PyGreenlet_GetCurrent() + * + * cdef inline void greenlet_init(): # <<<<<<<<<<<<<< + * global _greenlet_imported + * if not _greenlet_imported: + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "gevent/_greenlet.pxd":27 + * + * @cython.final + * cdef inline greenlet getcurrent(): # <<<<<<<<<<<<<< + * return PyGreenlet_GetCurrent() + * + */ + +static CYTHON_INLINE PyGreenlet *__pyx_f_6gevent_9_greenlet_getcurrent(void) { + PyGreenlet *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("getcurrent", 0); + + /* "gevent/_greenlet.pxd":28 + * @cython.final + * cdef inline greenlet getcurrent(): + * return PyGreenlet_GetCurrent() # <<<<<<<<<<<<<< + * + * cdef bint _greenlet_imported + */ + __Pyx_XDECREF(((PyObject *)__pyx_r)); + __pyx_t_1 = ((PyObject *)PyGreenlet_GetCurrent()); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 28, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = ((PyGreenlet *)__pyx_t_1); + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "gevent/_greenlet.pxd":27 + * + * @cython.final + * cdef inline greenlet getcurrent(): # <<<<<<<<<<<<<< + * return PyGreenlet_GetCurrent() + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent._greenlet.getcurrent", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF((PyObject *)__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/_greenlet.pxd":32 + * cdef bint _greenlet_imported + * + * cdef inline void greenlet_init(): # <<<<<<<<<<<<<< + * global _greenlet_imported + * if not _greenlet_imported: + */ + +static CYTHON_INLINE void __pyx_f_6gevent_9_greenlet_greenlet_init(void) { + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("greenlet_init", 0); + + /* "gevent/_greenlet.pxd":34 + * cdef inline void greenlet_init(): + * global _greenlet_imported + * if not _greenlet_imported: # <<<<<<<<<<<<<< + * PyGreenlet_Import() + * _greenlet_imported = True + */ + __pyx_t_1 = ((!(__pyx_v_6gevent_9_greenlet__greenlet_imported != 0)) != 0); + if (__pyx_t_1) { + + /* "gevent/_greenlet.pxd":35 + * global _greenlet_imported + * if not _greenlet_imported: + * PyGreenlet_Import() # <<<<<<<<<<<<<< + * _greenlet_imported = True + * + */ + PyGreenlet_Import(); + + /* "gevent/_greenlet.pxd":36 + * if not _greenlet_imported: + * PyGreenlet_Import() + * _greenlet_imported = True # <<<<<<<<<<<<<< + * + * cdef extern from "Python.h": + */ + __pyx_v_6gevent_9_greenlet__greenlet_imported = 1; + + /* "gevent/_greenlet.pxd":34 + * cdef inline void greenlet_init(): + * global _greenlet_imported + * if not _greenlet_imported: # <<<<<<<<<<<<<< + * PyGreenlet_Import() + * _greenlet_imported = True + */ + } + + /* "gevent/_greenlet.pxd":32 + * cdef bint _greenlet_imported + * + * cdef inline void greenlet_init(): # <<<<<<<<<<<<<< + * global _greenlet_imported + * if not _greenlet_imported: + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "gevent/_local.pxd":26 + * void PyGreenlet_Import() + * + * cdef inline greenlet getcurrent(): # <<<<<<<<<<<<<< + * return PyGreenlet_GetCurrent() + * + */ + +static CYTHON_INLINE PyGreenlet *__pyx_f_6gevent_6_local_getcurrent(void) { + PyGreenlet *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("getcurrent", 0); + + /* "gevent/_local.pxd":27 + * + * cdef inline greenlet getcurrent(): + * return PyGreenlet_GetCurrent() # <<<<<<<<<<<<<< + * + * cdef inline void greenlet_init(): + */ + __Pyx_XDECREF(((PyObject *)__pyx_r)); + __pyx_t_1 = ((PyObject *)PyGreenlet_GetCurrent()); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 27, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = ((PyGreenlet *)__pyx_t_1); + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "gevent/_local.pxd":26 + * void PyGreenlet_Import() + * + * cdef inline greenlet getcurrent(): # <<<<<<<<<<<<<< + * return PyGreenlet_GetCurrent() + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent._local.getcurrent", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF((PyObject *)__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/_local.pxd":29 + * return PyGreenlet_GetCurrent() + * + * cdef inline void greenlet_init(): # <<<<<<<<<<<<<< + * global _greenlet_imported + * if not _greenlet_imported: + */ + +static CYTHON_INLINE void __pyx_f_6gevent_6_local_greenlet_init(void) { + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("greenlet_init", 0); + + /* "gevent/_local.pxd":31 + * cdef inline void greenlet_init(): + * global _greenlet_imported + * if not _greenlet_imported: # <<<<<<<<<<<<<< + * PyGreenlet_Import() + * _greenlet_imported = True + */ + __pyx_t_1 = ((!(__pyx_v_6gevent_6_local__greenlet_imported != 0)) != 0); + if (__pyx_t_1) { + + /* "gevent/_local.pxd":32 + * global _greenlet_imported + * if not _greenlet_imported: + * PyGreenlet_Import() # <<<<<<<<<<<<<< + * _greenlet_imported = True + * + */ + PyGreenlet_Import(); + + /* "gevent/_local.pxd":33 + * if not _greenlet_imported: + * PyGreenlet_Import() + * _greenlet_imported = True # <<<<<<<<<<<<<< + * + * + */ + __pyx_v_6gevent_6_local__greenlet_imported = 1; + + /* "gevent/_local.pxd":31 + * cdef inline void greenlet_init(): + * global _greenlet_imported + * if not _greenlet_imported: # <<<<<<<<<<<<<< + * PyGreenlet_Import() + * _greenlet_imported = True + */ + } + + /* "gevent/_local.pxd":29 + * return PyGreenlet_GetCurrent() + * + * cdef inline void greenlet_init(): # <<<<<<<<<<<<<< + * global _greenlet_imported + * if not _greenlet_imported: + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +static PyObject *__pyx_tp_new_6gevent_6_local__wrefdict(PyTypeObject *t, PyObject *a, PyObject *k) { + PyObject *o = (&PyDict_Type)->tp_new(t, a, k); + if (unlikely(!o)) return 0; + return o; +} + +static void __pyx_tp_dealloc_6gevent_6_local__wrefdict(PyObject *o) { + struct __pyx_obj_6gevent_6_local__wrefdict *p = (struct __pyx_obj_6gevent_6_local__wrefdict *)o; + PyObject_GC_UnTrack(o); + if (p->__weakref__) PyObject_ClearWeakRefs(o); + PyObject_GC_Track(o); + (&PyDict_Type)->tp_dealloc(o); +} + +static int __pyx_tp_traverse_6gevent_6_local__wrefdict(PyObject *o, visitproc v, void *a) { + int e; + if (!(&PyDict_Type)->tp_traverse); else { e = (&PyDict_Type)->tp_traverse(o,v,a); if (e) return e; } + return 0; +} + +static int __pyx_tp_clear_6gevent_6_local__wrefdict(PyObject *o) { + if (!(&PyDict_Type)->tp_clear); else (&PyDict_Type)->tp_clear(o); + return 0; +} + +static PyTypeObject __pyx_type_6gevent_6_local__wrefdict = { + PyVarObject_HEAD_INIT(0, 0) + "gevent._local._wrefdict", /*tp_name*/ + sizeof(struct __pyx_obj_6gevent_6_local__wrefdict), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6gevent_6_local__wrefdict, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + "A dict that can be weak referenced", /*tp_doc*/ + __pyx_tp_traverse_6gevent_6_local__wrefdict, /*tp_traverse*/ + __pyx_tp_clear_6gevent_6_local__wrefdict, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + 0, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6gevent_6_local__wrefdict, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static PyObject *__pyx_tp_new_6gevent_6_local__greenlet_deleted(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + struct __pyx_obj_6gevent_6_local__greenlet_deleted *p; + PyObject *o; + o = (*t->tp_alloc)(t, 0); + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_6gevent_6_local__greenlet_deleted *)o); + p->idt = Py_None; Py_INCREF(Py_None); + p->wrdicts = Py_None; Py_INCREF(Py_None); + return o; +} + +static void __pyx_tp_dealloc_6gevent_6_local__greenlet_deleted(PyObject *o) { + struct __pyx_obj_6gevent_6_local__greenlet_deleted *p = (struct __pyx_obj_6gevent_6_local__greenlet_deleted *)o; + PyObject_GC_UnTrack(o); + Py_CLEAR(p->idt); + Py_CLEAR(p->wrdicts); + (*Py_TYPE(o)->tp_free)(o); +} + +static int __pyx_tp_traverse_6gevent_6_local__greenlet_deleted(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_6gevent_6_local__greenlet_deleted *p = (struct __pyx_obj_6gevent_6_local__greenlet_deleted *)o; + if (p->idt) { + e = (*v)(p->idt, a); if (e) return e; + } + if (p->wrdicts) { + e = (*v)(p->wrdicts, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_6gevent_6_local__greenlet_deleted(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_6gevent_6_local__greenlet_deleted *p = (struct __pyx_obj_6gevent_6_local__greenlet_deleted *)o; + tmp = ((PyObject*)p->idt); + p->idt = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->wrdicts); + p->wrdicts = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyMethodDef __pyx_methods_6gevent_6_local__greenlet_deleted[] = { + {0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_6gevent_6_local__greenlet_deleted = { + PyVarObject_HEAD_INIT(0, 0) + "gevent._local._greenlet_deleted", /*tp_name*/ + sizeof(struct __pyx_obj_6gevent_6_local__greenlet_deleted), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6gevent_6_local__greenlet_deleted, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + __pyx_pw_6gevent_6_local_17_greenlet_deleted_3__call__, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + "_greenlet_deleted(idt, wrdicts)\n\n A weakref callback for when the greenlet\n is deleted.\n\n If the greenlet is a `gevent.greenlet.Greenlet` and\n supplies ``rawlink``, that will be used instead of a\n weakref.\n ", /*tp_doc*/ + __pyx_tp_traverse_6gevent_6_local__greenlet_deleted, /*tp_traverse*/ + __pyx_tp_clear_6gevent_6_local__greenlet_deleted, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6gevent_6_local__greenlet_deleted, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_pw_6gevent_6_local_17_greenlet_deleted_1__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6gevent_6_local__greenlet_deleted, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static PyObject *__pyx_tp_new_6gevent_6_local__local_deleted(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + struct __pyx_obj_6gevent_6_local__local_deleted *p; + PyObject *o; + o = (*t->tp_alloc)(t, 0); + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_6gevent_6_local__local_deleted *)o); + p->key = ((PyObject*)Py_None); Py_INCREF(Py_None); + p->wrthread = Py_None; Py_INCREF(Py_None); + p->greenlet_deleted = ((struct __pyx_obj_6gevent_6_local__greenlet_deleted *)Py_None); Py_INCREF(Py_None); + return o; +} + +static void __pyx_tp_dealloc_6gevent_6_local__local_deleted(PyObject *o) { + struct __pyx_obj_6gevent_6_local__local_deleted *p = (struct __pyx_obj_6gevent_6_local__local_deleted *)o; + PyObject_GC_UnTrack(o); + Py_CLEAR(p->key); + Py_CLEAR(p->wrthread); + Py_CLEAR(p->greenlet_deleted); + (*Py_TYPE(o)->tp_free)(o); +} + +static int __pyx_tp_traverse_6gevent_6_local__local_deleted(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_6gevent_6_local__local_deleted *p = (struct __pyx_obj_6gevent_6_local__local_deleted *)o; + if (p->wrthread) { + e = (*v)(p->wrthread, a); if (e) return e; + } + if (p->greenlet_deleted) { + e = (*v)(((PyObject *)p->greenlet_deleted), a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_6gevent_6_local__local_deleted(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_6gevent_6_local__local_deleted *p = (struct __pyx_obj_6gevent_6_local__local_deleted *)o; + tmp = ((PyObject*)p->wrthread); + p->wrthread = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->greenlet_deleted); + p->greenlet_deleted = ((struct __pyx_obj_6gevent_6_local__greenlet_deleted *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyMethodDef __pyx_methods_6gevent_6_local__local_deleted[] = { + {0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_6gevent_6_local__local_deleted = { + PyVarObject_HEAD_INIT(0, 0) + "gevent._local._local_deleted", /*tp_name*/ + sizeof(struct __pyx_obj_6gevent_6_local__local_deleted), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6gevent_6_local__local_deleted, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + __pyx_pw_6gevent_6_local_14_local_deleted_3__call__, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + "_local_deleted(key, wrthread, greenlet_deleted)", /*tp_doc*/ + __pyx_tp_traverse_6gevent_6_local__local_deleted, /*tp_traverse*/ + __pyx_tp_clear_6gevent_6_local__local_deleted, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6gevent_6_local__local_deleted, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_pw_6gevent_6_local_14_local_deleted_1__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6gevent_6_local__local_deleted, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static PyObject *__pyx_tp_new_6gevent_6_local__localimpl(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + struct __pyx_obj_6gevent_6_local__localimpl *p; + PyObject *o; + o = (*t->tp_alloc)(t, 0); + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_6gevent_6_local__localimpl *)o); + p->key = ((PyObject*)Py_None); Py_INCREF(Py_None); + p->dicts = ((PyObject*)Py_None); Py_INCREF(Py_None); + p->localargs = ((PyObject*)Py_None); Py_INCREF(Py_None); + p->localkwargs = ((PyObject*)Py_None); Py_INCREF(Py_None); + p->localtypeid = ((PyObject*)Py_None); Py_INCREF(Py_None); + return o; +} + +static void __pyx_tp_dealloc_6gevent_6_local__localimpl(PyObject *o) { + struct __pyx_obj_6gevent_6_local__localimpl *p = (struct __pyx_obj_6gevent_6_local__localimpl *)o; + PyObject_GC_UnTrack(o); + if (p->__weakref__) PyObject_ClearWeakRefs(o); + Py_CLEAR(p->key); + Py_CLEAR(p->dicts); + Py_CLEAR(p->localargs); + Py_CLEAR(p->localkwargs); + Py_CLEAR(p->localtypeid); + (*Py_TYPE(o)->tp_free)(o); +} + +static int __pyx_tp_traverse_6gevent_6_local__localimpl(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_6gevent_6_local__localimpl *p = (struct __pyx_obj_6gevent_6_local__localimpl *)o; + if (p->dicts) { + e = (*v)(p->dicts, a); if (e) return e; + } + if (p->localargs) { + e = (*v)(p->localargs, a); if (e) return e; + } + if (p->localkwargs) { + e = (*v)(p->localkwargs, a); if (e) return e; + } + if (p->localtypeid) { + e = (*v)(p->localtypeid, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_6gevent_6_local__localimpl(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_6gevent_6_local__localimpl *p = (struct __pyx_obj_6gevent_6_local__localimpl *)o; + tmp = ((PyObject*)p->dicts); + p->dicts = ((PyObject*)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->localargs); + p->localargs = ((PyObject*)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->localkwargs); + p->localkwargs = ((PyObject*)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->localtypeid); + p->localtypeid = ((PyObject*)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyMethodDef __pyx_methods_6gevent_6_local__localimpl[] = { + {0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_6gevent_6_local__localimpl = { + PyVarObject_HEAD_INIT(0, 0) + "gevent._local._localimpl", /*tp_name*/ + sizeof(struct __pyx_obj_6gevent_6_local__localimpl), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6gevent_6_local__localimpl, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + "_localimpl(args, kwargs, local_type, id_local)\nA class managing thread-local dicts", /*tp_doc*/ + __pyx_tp_traverse_6gevent_6_local__localimpl, /*tp_traverse*/ + __pyx_tp_clear_6gevent_6_local__localimpl, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6gevent_6_local__localimpl, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_pw_6gevent_6_local_10_localimpl_1__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6gevent_6_local__localimpl, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static PyObject *__pyx_tp_new_6gevent_6_local__localimpl_dict_entry(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + struct __pyx_obj_6gevent_6_local__localimpl_dict_entry *p; + PyObject *o; + o = (*t->tp_alloc)(t, 0); + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_6gevent_6_local__localimpl_dict_entry *)o); + p->wrgreenlet = Py_None; Py_INCREF(Py_None); + p->localdict = ((PyObject*)Py_None); Py_INCREF(Py_None); + return o; +} + +static void __pyx_tp_dealloc_6gevent_6_local__localimpl_dict_entry(PyObject *o) { + struct __pyx_obj_6gevent_6_local__localimpl_dict_entry *p = (struct __pyx_obj_6gevent_6_local__localimpl_dict_entry *)o; + PyObject_GC_UnTrack(o); + Py_CLEAR(p->wrgreenlet); + Py_CLEAR(p->localdict); + (*Py_TYPE(o)->tp_free)(o); +} + +static int __pyx_tp_traverse_6gevent_6_local__localimpl_dict_entry(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_6gevent_6_local__localimpl_dict_entry *p = (struct __pyx_obj_6gevent_6_local__localimpl_dict_entry *)o; + if (p->wrgreenlet) { + e = (*v)(p->wrgreenlet, a); if (e) return e; + } + if (p->localdict) { + e = (*v)(p->localdict, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_6gevent_6_local__localimpl_dict_entry(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_6gevent_6_local__localimpl_dict_entry *p = (struct __pyx_obj_6gevent_6_local__localimpl_dict_entry *)o; + tmp = ((PyObject*)p->wrgreenlet); + p->wrgreenlet = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->localdict); + p->localdict = ((PyObject*)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyMethodDef __pyx_methods_6gevent_6_local__localimpl_dict_entry[] = { + {0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_6gevent_6_local__localimpl_dict_entry = { + PyVarObject_HEAD_INIT(0, 0) + "gevent._local._localimpl_dict_entry", /*tp_name*/ + sizeof(struct __pyx_obj_6gevent_6_local__localimpl_dict_entry), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6gevent_6_local__localimpl_dict_entry, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + "_localimpl_dict_entry(wrgreenlet, localdict)\n\n The object that goes in the ``dicts`` of ``_localimpl``\n object for each thread.\n ", /*tp_doc*/ + __pyx_tp_traverse_6gevent_6_local__localimpl_dict_entry, /*tp_traverse*/ + __pyx_tp_clear_6gevent_6_local__localimpl_dict_entry, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6gevent_6_local__localimpl_dict_entry, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_pw_6gevent_6_local_21_localimpl_dict_entry_1__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6gevent_6_local__localimpl_dict_entry, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; +static struct __pyx_vtabstruct_6gevent_6_local_local __pyx_vtable_6gevent_6_local_local; + +static PyObject *__pyx_tp_new_6gevent_6_local_local(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_6gevent_6_local_local *p; + PyObject *o; + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_6gevent_6_local_local *)o); + p->__pyx_vtab = __pyx_vtabptr_6gevent_6_local_local; + p->_local__impl = ((struct __pyx_obj_6gevent_6_local__localimpl *)Py_None); Py_INCREF(Py_None); + p->_local_type_get_descriptors = ((PyObject*)Py_None); Py_INCREF(Py_None); + p->_local_type_set_or_del_descriptors = ((PyObject*)Py_None); Py_INCREF(Py_None); + p->_local_type_del_descriptors = ((PyObject*)Py_None); Py_INCREF(Py_None); + p->_local_type_set_descriptors = ((PyObject*)Py_None); Py_INCREF(Py_None); + p->_local_type_vars = ((PyObject*)Py_None); Py_INCREF(Py_None); + p->_local_type = ((PyTypeObject*)Py_None); Py_INCREF(Py_None); + if (unlikely(__pyx_pw_6gevent_6_local_5local_1__cinit__(o, a, k) < 0)) goto bad; + return o; + bad: + Py_DECREF(o); o = 0; + return NULL; +} + +static void __pyx_tp_dealloc_6gevent_6_local_local(PyObject *o) { + struct __pyx_obj_6gevent_6_local_local *p = (struct __pyx_obj_6gevent_6_local_local *)o; + #if CYTHON_USE_TP_FINALIZE + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + PyObject_GC_UnTrack(o); + Py_CLEAR(p->_local__impl); + Py_CLEAR(p->_local_type_get_descriptors); + Py_CLEAR(p->_local_type_set_or_del_descriptors); + Py_CLEAR(p->_local_type_del_descriptors); + Py_CLEAR(p->_local_type_set_descriptors); + Py_CLEAR(p->_local_type_vars); + Py_CLEAR(p->_local_type); + (*Py_TYPE(o)->tp_free)(o); +} + +static int __pyx_tp_traverse_6gevent_6_local_local(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_6gevent_6_local_local *p = (struct __pyx_obj_6gevent_6_local_local *)o; + if (p->_local__impl) { + e = (*v)(((PyObject *)p->_local__impl), a); if (e) return e; + } + if (p->_local_type_get_descriptors) { + e = (*v)(p->_local_type_get_descriptors, a); if (e) return e; + } + if (p->_local_type_set_or_del_descriptors) { + e = (*v)(p->_local_type_set_or_del_descriptors, a); if (e) return e; + } + if (p->_local_type_del_descriptors) { + e = (*v)(p->_local_type_del_descriptors, a); if (e) return e; + } + if (p->_local_type_set_descriptors) { + e = (*v)(p->_local_type_set_descriptors, a); if (e) return e; + } + if (p->_local_type_vars) { + e = (*v)(p->_local_type_vars, a); if (e) return e; + } + if (p->_local_type) { + e = (*v)(((PyObject *)p->_local_type), a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_6gevent_6_local_local(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_6gevent_6_local_local *p = (struct __pyx_obj_6gevent_6_local_local *)o; + tmp = ((PyObject*)p->_local__impl); + p->_local__impl = ((struct __pyx_obj_6gevent_6_local__localimpl *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->_local_type_get_descriptors); + p->_local_type_get_descriptors = ((PyObject*)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->_local_type_set_or_del_descriptors); + p->_local_type_set_or_del_descriptors = ((PyObject*)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->_local_type_del_descriptors); + p->_local_type_del_descriptors = ((PyObject*)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->_local_type_set_descriptors); + p->_local_type_set_descriptors = ((PyObject*)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->_local_type_vars); + p->_local_type_vars = ((PyObject*)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->_local_type); + p->_local_type = ((PyTypeObject*)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyObject *__pyx_tp_getattro_6gevent_6_local_local(PyObject *o, PyObject *n) { + PyObject *v = __pyx_pw_6gevent_6_local_5local_3__getattribute__(o, n); + return v; +} + +static int __pyx_tp_setattro_6gevent_6_local_local(PyObject *o, PyObject *n, PyObject *v) { + if (v) { + return __pyx_pw_6gevent_6_local_5local_5__setattr__(o, n, v); + } + else { + return __pyx_pw_6gevent_6_local_5local_7__delattr__(o, n); + } +} + +static PyMethodDef __pyx_methods_6gevent_6_local_local[] = { + {0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_6gevent_6_local_local = { + PyVarObject_HEAD_INIT(0, 0) + "gevent._local.local", /*tp_name*/ + sizeof(struct __pyx_obj_6gevent_6_local_local), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6gevent_6_local_local, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + __pyx_tp_getattro_6gevent_6_local_local, /*tp_getattro*/ + __pyx_tp_setattro_6gevent_6_local_local, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + "\n An object whose attributes are greenlet-local.\n ", /*tp_doc*/ + __pyx_tp_traverse_6gevent_6_local_local, /*tp_traverse*/ + __pyx_tp_clear_6gevent_6_local_local, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6gevent_6_local_local, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6gevent_6_local_local, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static PyMethodDef __pyx_methods[] = { + {0, 0, 0, 0} +}; + +#if PY_MAJOR_VERSION >= 3 +#if CYTHON_PEP489_MULTI_PHASE_INIT +static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ +static int __pyx_pymod_exec__local(PyObject* module); /*proto*/ +static PyModuleDef_Slot __pyx_moduledef_slots[] = { + {Py_mod_create, (void*)__pyx_pymod_create}, + {Py_mod_exec, (void*)__pyx_pymod_exec__local}, + {0, NULL} +}; +#endif + +static struct PyModuleDef __pyx_moduledef = { + PyModuleDef_HEAD_INIT, + "_local", + __pyx_k_Greenlet_local_objects_This_mod, /* m_doc */ + #if CYTHON_PEP489_MULTI_PHASE_INIT + 0, /* m_size */ + #else + -1, /* m_size */ + #endif + __pyx_methods /* m_methods */, + #if CYTHON_PEP489_MULTI_PHASE_INIT + __pyx_moduledef_slots, /* m_slots */ + #else + NULL, /* m_reload */ + #endif + NULL, /* m_traverse */ + NULL, /* m_clear */ + NULL /* m_free */ +}; +#endif +#ifndef CYTHON_SMALL_CODE +#if defined(__clang__) + #define CYTHON_SMALL_CODE +#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) + #define CYTHON_SMALL_CODE __attribute__((cold)) +#else + #define CYTHON_SMALL_CODE +#endif +#endif + +static __Pyx_StringTabEntry __pyx_string_tab[] = { + {&__pyx_n_s_AttributeError, __pyx_k_AttributeError, sizeof(__pyx_k_AttributeError), 0, 0, 1, 1}, + {&__pyx_kp_s_Initialization_arguments_are_not, __pyx_k_Initialization_arguments_are_not, sizeof(__pyx_k_Initialization_arguments_are_not), 0, 0, 1, 0}, + {&__pyx_n_s_KeyError, __pyx_k_KeyError, sizeof(__pyx_k_KeyError), 0, 0, 1, 1}, + {&__pyx_n_s_None, __pyx_k_None, sizeof(__pyx_k_None), 0, 0, 1, 1}, + {&__pyx_n_s_PY2, __pyx_k_PY2, sizeof(__pyx_k_PY2), 0, 0, 1, 1}, + {&__pyx_n_s_PYPY, __pyx_k_PYPY, sizeof(__pyx_k_PYPY), 0, 0, 1, 1}, + {&__pyx_n_s_PYPY_2, __pyx_k_PYPY_2, sizeof(__pyx_k_PYPY_2), 0, 0, 1, 1}, + {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1}, + {&__pyx_n_s_all, __pyx_k_all, sizeof(__pyx_k_all), 0, 0, 1, 1}, + {&__pyx_n_s_all_local_dicts_for_greenlet, __pyx_k_all_local_dicts_for_greenlet, sizeof(__pyx_k_all_local_dicts_for_greenlet), 0, 0, 1, 1}, + {&__pyx_n_s_args, __pyx_k_args, sizeof(__pyx_k_args), 0, 0, 1, 1}, + {&__pyx_n_s_cinit, __pyx_k_cinit, sizeof(__pyx_k_cinit), 0, 0, 1, 1}, + {&__pyx_n_s_class, __pyx_k_class, sizeof(__pyx_k_class), 0, 0, 1, 1}, + {&__pyx_n_s_classmethod, __pyx_k_classmethod, sizeof(__pyx_k_classmethod), 0, 0, 1, 1}, + {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, + {&__pyx_n_s_cls, __pyx_k_cls, sizeof(__pyx_k_cls), 0, 0, 1, 1}, + {&__pyx_n_s_copy, __pyx_k_copy, sizeof(__pyx_k_copy), 0, 0, 1, 1}, + {&__pyx_n_s_copy_2, __pyx_k_copy_2, sizeof(__pyx_k_copy_2), 0, 0, 1, 1}, + {&__pyx_n_s_delete, __pyx_k_delete, sizeof(__pyx_k_delete), 0, 0, 1, 1}, + {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1}, + {&__pyx_n_s_dicts, __pyx_k_dicts, sizeof(__pyx_k_dicts), 0, 0, 1, 1}, + {&__pyx_n_s_get, __pyx_k_get, sizeof(__pyx_k_get), 0, 0, 1, 1}, + {&__pyx_n_s_get_2, __pyx_k_get_2, sizeof(__pyx_k_get_2), 0, 0, 1, 1}, + {&__pyx_n_s_getattr, __pyx_k_getattr, sizeof(__pyx_k_getattr), 0, 0, 1, 1}, + {&__pyx_n_s_getattribute, __pyx_k_getattribute, sizeof(__pyx_k_getattribute), 0, 0, 1, 1}, + {&__pyx_n_s_getcurrent, __pyx_k_getcurrent, sizeof(__pyx_k_getcurrent), 0, 0, 1, 1}, + {&__pyx_n_s_gevent__compat, __pyx_k_gevent__compat, sizeof(__pyx_k_gevent__compat), 0, 0, 1, 1}, + {&__pyx_n_s_gevent__local, __pyx_k_gevent__local, sizeof(__pyx_k_gevent__local), 0, 0, 1, 1}, + {&__pyx_n_s_gevent__util, __pyx_k_gevent__util, sizeof(__pyx_k_gevent__util), 0, 0, 1, 1}, + {&__pyx_n_s_gevent_local_localimpl, __pyx_k_gevent_local_localimpl, sizeof(__pyx_k_gevent_local_localimpl), 0, 0, 1, 1}, + {&__pyx_n_s_greenlet, __pyx_k_greenlet, sizeof(__pyx_k_greenlet), 0, 0, 1, 1}, + {&__pyx_n_s_greenlet_deleted, __pyx_k_greenlet_deleted, sizeof(__pyx_k_greenlet_deleted), 0, 0, 1, 1}, + {&__pyx_n_s_greenlet_deleted_2, __pyx_k_greenlet_deleted_2, sizeof(__pyx_k_greenlet_deleted_2), 0, 0, 1, 1}, + {&__pyx_n_s_greenlet_imported, __pyx_k_greenlet_imported, sizeof(__pyx_k_greenlet_imported), 0, 0, 1, 1}, + {&__pyx_n_s_greenlet_init, __pyx_k_greenlet_init, sizeof(__pyx_k_greenlet_init), 0, 0, 1, 1}, + {&__pyx_n_s_id, __pyx_k_id, sizeof(__pyx_k_id), 0, 0, 1, 1}, + {&__pyx_n_s_id_local, __pyx_k_id_local, sizeof(__pyx_k_id_local), 0, 0, 1, 1}, + {&__pyx_n_s_idt, __pyx_k_idt, sizeof(__pyx_k_idt), 0, 0, 1, 1}, + {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, + {&__pyx_n_s_import_c_accel, __pyx_k_import_c_accel, sizeof(__pyx_k_import_c_accel), 0, 0, 1, 1}, + {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1}, + {&__pyx_n_s_items, __pyx_k_items, sizeof(__pyx_k_items), 0, 0, 1, 1}, + {&__pyx_n_s_key, __pyx_k_key, sizeof(__pyx_k_key), 0, 0, 1, 1}, + {&__pyx_n_s_key_prefix, __pyx_k_key_prefix, sizeof(__pyx_k_key_prefix), 0, 0, 1, 1}, + {&__pyx_n_s_kw, __pyx_k_kw, sizeof(__pyx_k_kw), 0, 0, 1, 1}, + {&__pyx_n_s_kwargs, __pyx_k_kwargs, sizeof(__pyx_k_kwargs), 0, 0, 1, 1}, + {&__pyx_n_s_lambda, __pyx_k_lambda, sizeof(__pyx_k_lambda), 0, 0, 1, 1}, + {&__pyx_n_s_local, __pyx_k_local, sizeof(__pyx_k_local), 0, 0, 1, 1}, + {&__pyx_n_s_local___copy, __pyx_k_local___copy, sizeof(__pyx_k_local___copy), 0, 0, 1, 1}, + {&__pyx_n_s_local__impl, __pyx_k_local__impl, sizeof(__pyx_k_local__impl), 0, 0, 1, 1}, + {&__pyx_n_s_local_attrs, __pyx_k_local_attrs, sizeof(__pyx_k_local_attrs), 0, 0, 1, 1}, + {&__pyx_n_s_local_deleted, __pyx_k_local_deleted, sizeof(__pyx_k_local_deleted), 0, 0, 1, 1}, + {&__pyx_n_s_local_type, __pyx_k_local_type, sizeof(__pyx_k_local_type), 0, 0, 1, 1}, + {&__pyx_n_s_local_type_2, __pyx_k_local_type_2, sizeof(__pyx_k_local_type_2), 0, 0, 1, 1}, + {&__pyx_n_s_local_type_del_descriptors, __pyx_k_local_type_del_descriptors, sizeof(__pyx_k_local_type_del_descriptors), 0, 0, 1, 1}, + {&__pyx_n_s_local_type_get_descriptors, __pyx_k_local_type_get_descriptors, sizeof(__pyx_k_local_type_get_descriptors), 0, 0, 1, 1}, + {&__pyx_n_s_local_type_set_descriptors, __pyx_k_local_type_set_descriptors, sizeof(__pyx_k_local_type_set_descriptors), 0, 0, 1, 1}, + {&__pyx_n_s_local_type_set_or_del_descripto, __pyx_k_local_type_set_or_del_descripto, sizeof(__pyx_k_local_type_set_or_del_descripto), 0, 0, 1, 1}, + {&__pyx_n_s_local_type_vars, __pyx_k_local_type_vars, sizeof(__pyx_k_local_type_vars), 0, 0, 1, 1}, + {&__pyx_n_s_localargs, __pyx_k_localargs, sizeof(__pyx_k_localargs), 0, 0, 1, 1}, + {&__pyx_n_s_localdict, __pyx_k_localdict, sizeof(__pyx_k_localdict), 0, 0, 1, 1}, + {&__pyx_n_s_localimpl, __pyx_k_localimpl, sizeof(__pyx_k_localimpl), 0, 0, 1, 1}, + {&__pyx_n_s_localimpl_dict_entry, __pyx_k_localimpl_dict_entry, sizeof(__pyx_k_localimpl_dict_entry), 0, 0, 1, 1}, + {&__pyx_n_s_localkwargs, __pyx_k_localkwargs, sizeof(__pyx_k_localkwargs), 0, 0, 1, 1}, + {&__pyx_n_s_localtypeid, __pyx_k_localtypeid, sizeof(__pyx_k_localtypeid), 0, 0, 1, 1}, + {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, + {&__pyx_n_s_marker, __pyx_k_marker, sizeof(__pyx_k_marker), 0, 0, 1, 1}, + {&__pyx_n_s_mro, __pyx_k_mro, sizeof(__pyx_k_mro), 0, 0, 1, 1}, + {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, + {&__pyx_n_s_new, __pyx_k_new, sizeof(__pyx_k_new), 0, 0, 1, 1}, + {&__pyx_n_s_object, __pyx_k_object, sizeof(__pyx_k_object), 0, 0, 1, 1}, + {&__pyx_n_s_pop, __pyx_k_pop, sizeof(__pyx_k_pop), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_capi, __pyx_k_pyx_capi, sizeof(__pyx_k_pyx_capi), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1}, + {&__pyx_kp_s_r_object_attribute___dict___is, __pyx_k_r_object_attribute___dict___is, sizeof(__pyx_k_r_object_attribute___dict___is), 0, 0, 1, 0}, + {&__pyx_kp_s_r_object_has_no_attribute_s, __pyx_k_r_object_has_no_attribute_s, sizeof(__pyx_k_r_object_has_no_attribute_s), 0, 0, 1, 0}, + {&__pyx_n_s_rawlink, __pyx_k_rawlink, sizeof(__pyx_k_rawlink), 0, 0, 1, 1}, + {&__pyx_n_s_ref, __pyx_k_ref, sizeof(__pyx_k_ref), 0, 0, 1, 1}, + {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1}, + {&__pyx_n_s_set, __pyx_k_set, sizeof(__pyx_k_set), 0, 0, 1, 1}, + {&__pyx_n_s_setattr, __pyx_k_setattr, sizeof(__pyx_k_setattr), 0, 0, 1, 1}, + {&__pyx_n_s_slots, __pyx_k_slots, sizeof(__pyx_k_slots), 0, 0, 1, 1}, + {&__pyx_kp_s_src_gevent_local_py, __pyx_k_src_gevent_local_py, sizeof(__pyx_k_src_gevent_local_py), 0, 0, 1, 0}, + {&__pyx_n_s_super, __pyx_k_super, sizeof(__pyx_k_super), 0, 0, 1, 1}, + {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, + {&__pyx_n_s_unlink, __pyx_k_unlink, sizeof(__pyx_k_unlink), 0, 0, 1, 1}, + {&__pyx_n_s_unused, __pyx_k_unused, sizeof(__pyx_k_unused), 0, 0, 1, 1}, + {&__pyx_n_s_weakref, __pyx_k_weakref, sizeof(__pyx_k_weakref), 0, 0, 1, 1}, + {&__pyx_n_s_weakref_2, __pyx_k_weakref_2, sizeof(__pyx_k_weakref_2), 0, 0, 1, 1}, + {&__pyx_n_s_wrdicts, __pyx_k_wrdicts, sizeof(__pyx_k_wrdicts), 0, 0, 1, 1}, + {&__pyx_n_s_wrefdict, __pyx_k_wrefdict, sizeof(__pyx_k_wrefdict), 0, 0, 1, 1}, + {&__pyx_n_s_wrgreenlet, __pyx_k_wrgreenlet, sizeof(__pyx_k_wrgreenlet), 0, 0, 1, 1}, + {&__pyx_n_s_wrthread, __pyx_k_wrthread, sizeof(__pyx_k_wrthread), 0, 0, 1, 1}, + {0, 0, 0, 0, 0, 0, 0} +}; +static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { + __pyx_builtin___import__ = __Pyx_GetBuiltinName(__pyx_n_s_import); if (!__pyx_builtin___import__) __PYX_ERR(0, 160, __pyx_L1_error) + __pyx_builtin_object = __Pyx_GetBuiltinName(__pyx_n_s_object); if (!__pyx_builtin_object) __PYX_ERR(0, 331, __pyx_L1_error) + __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(0, 588, __pyx_L1_error) + __pyx_builtin_classmethod = __Pyx_GetBuiltinName(__pyx_n_s_classmethod); if (!__pyx_builtin_classmethod) __PYX_ERR(0, 597, __pyx_L1_error) + __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(0, 192, __pyx_L1_error) + __pyx_builtin_AttributeError = __Pyx_GetBuiltinName(__pyx_n_s_AttributeError); if (!__pyx_builtin_AttributeError) __PYX_ERR(0, 246, __pyx_L1_error) + __pyx_builtin_KeyError = __Pyx_GetBuiltinName(__pyx_n_s_KeyError); if (!__pyx_builtin_KeyError) __PYX_ERR(0, 341, __pyx_L1_error) + __pyx_builtin_super = __Pyx_GetBuiltinName(__pyx_n_s_super); if (!__pyx_builtin_super) __PYX_ERR(0, 575, __pyx_L1_error) + return 0; + __pyx_L1_error:; + return -1; +} + +static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); + + /* "src/gevent/local.py":160 + * + * + * locals()['getcurrent'] = __import__('greenlet').getcurrent # <<<<<<<<<<<<<< + * locals()['greenlet_init'] = lambda: None + * + */ + __pyx_tuple_ = PyTuple_Pack(1, __pyx_n_s_greenlet); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 160, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple_); + __Pyx_GIVEREF(__pyx_tuple_); + + /* "src/gevent/local.py":179 + * # That final tuple is actually a localimpl_dict_entry object. + * + * def all_local_dicts_for_greenlet(greenlet): # <<<<<<<<<<<<<< + * """ + * Internal debug helper for getting the local values associated + */ + __pyx_tuple__2 = PyTuple_Pack(1, __pyx_n_s_greenlet); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 179, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2); + __Pyx_GIVEREF(__pyx_tuple__2); + __pyx_codeobj__3 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_local_py, __pyx_n_s_all_local_dicts_for_greenlet, 179, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__3)) __PYX_ERR(0, 179, __pyx_L1_error) + + /* "src/gevent/local.py":222 + * weakref. + * """ + * __slots__ = ('idt', 'wrdicts') # <<<<<<<<<<<<<< + * + * def __init__(self, idt, wrdicts): + */ + __pyx_tuple__4 = PyTuple_Pack(2, __pyx_n_s_idt, __pyx_n_s_wrdicts); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 222, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__4); + __Pyx_GIVEREF(__pyx_tuple__4); + + /* "src/gevent/local.py":234 + * + * class _local_deleted(object): + * __slots__ = ('key', 'wrthread', 'greenlet_deleted') # <<<<<<<<<<<<<< + * + * def __init__(self, key, wrthread, greenlet_deleted): + */ + __pyx_tuple__5 = PyTuple_Pack(3, __pyx_n_s_key, __pyx_n_s_wrthread, __pyx_n_s_greenlet_deleted); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 234, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__5); + __Pyx_GIVEREF(__pyx_tuple__5); + + /* "src/gevent/local.py":254 + * class _localimpl(object): + * """A class managing thread-local dicts""" + * __slots__ = ('key', 'dicts', # <<<<<<<<<<<<<< + * 'localargs', 'localkwargs', + * 'localtypeid', + */ + __pyx_tuple__6 = PyTuple_Pack(6, __pyx_n_s_key, __pyx_n_s_dicts, __pyx_n_s_localargs, __pyx_n_s_localkwargs, __pyx_n_s_localtypeid, __pyx_n_s_weakref_2); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 254, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__6); + __Pyx_GIVEREF(__pyx_tuple__6); + + /* "src/gevent/local.py":280 + * # This is a class, not just a tuple, so that cython can optimize + * # attribute access + * __slots__ = ('wrgreenlet', 'localdict') # <<<<<<<<<<<<<< + * + * def __init__(self, wrgreenlet, localdict): + */ + __pyx_tuple__7 = PyTuple_Pack(2, __pyx_n_s_wrgreenlet, __pyx_n_s_localdict); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 280, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__7); + __Pyx_GIVEREF(__pyx_tuple__7); + + /* "src/gevent/local.py":517 + * raise AttributeError(name) + * + * def __copy__(self): # <<<<<<<<<<<<<< + * impl = self._local__impl + * entry = impl.dicts[id(getcurrent())] # pylint:disable=undefined-variable + */ + __pyx_tuple__8 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 517, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__8); + __Pyx_GIVEREF(__pyx_tuple__8); + __pyx_codeobj__9 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__8, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_local_py, __pyx_n_s_copy, 517, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__9)) __PYX_ERR(0, 517, __pyx_L1_error) + + /* "src/gevent/local.py":574 + * # (e.g., on PyPy). So we set it at runtime. Cython + * # will raise an error if we're compiled. + * def __new__(cls, *args, **kw): # <<<<<<<<<<<<<< + * self = super(local, cls).__new__(cls) + * # We get the cls in *args for some reason + */ + __pyx_tuple__10 = PyTuple_Pack(4, __pyx_n_s_cls, __pyx_n_s_args, __pyx_n_s_kw, __pyx_n_s_self); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 574, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__10); + __Pyx_GIVEREF(__pyx_tuple__10); + __pyx_codeobj__11 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__10, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_local_py, __pyx_n_s_new, 574, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__11)) __PYX_ERR(0, 574, __pyx_L1_error) + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} + +static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { + __pyx_umethod_PyDict_Type_get.type = (PyObject*)&PyDict_Type; + if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + return 0; + __pyx_L1_error:; + return -1; +} + +static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/ + +static int __Pyx_modinit_global_init_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); + /*--- Global init code ---*/ + __pyx_v_6gevent_6_local_ref = Py_None; Py_INCREF(Py_None); + __pyx_v_6gevent_6_local_copy = Py_None; Py_INCREF(Py_None); + __pyx_v_6gevent_6_local__marker = Py_None; Py_INCREF(Py_None); + __pyx_v_6gevent_6_local_key_prefix = ((PyObject*)Py_None); Py_INCREF(Py_None); + __pyx_v_6gevent_6_local__local_attrs = ((PyObject*)Py_None); Py_INCREF(Py_None); + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_variable_export_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); + /*--- Variable export code ---*/ + if (__Pyx_ExportVoidPtr(__pyx_n_s_PYPY, (void *)&__pyx_v_6gevent_6_local__PYPY, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportVoidPtr(__pyx_n_s_ref, (void *)&__pyx_v_6gevent_6_local_ref, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportVoidPtr(__pyx_n_s_copy_2, (void *)&__pyx_v_6gevent_6_local_copy, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportVoidPtr(__pyx_n_s_marker, (void *)&__pyx_v_6gevent_6_local__marker, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportVoidPtr(__pyx_n_s_key_prefix, (void *)&__pyx_v_6gevent_6_local_key_prefix, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportVoidPtr(__pyx_n_s_greenlet_imported, (void *)&__pyx_v_6gevent_6_local__greenlet_imported, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportVoidPtr(__pyx_n_s_local_attrs, (void *)&__pyx_v_6gevent_6_local__local_attrs, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_modinit_function_export_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); + /*--- Function export code ---*/ + if (__Pyx_ExportFunction("_init", (void (*)(void))__pyx_f_6gevent_6_local__init, "void (void)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportFunction("_localimpl_create_dict", (void (*)(void))__pyx_f_6gevent_6_local__localimpl_create_dict, "PyObject *(struct __pyx_obj_6gevent_6_local__localimpl *, PyGreenlet *, PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportFunction("_local_get_dict", (void (*)(void))__pyx_f_6gevent_6_local__local_get_dict, "PyObject *(struct __pyx_obj_6gevent_6_local_local *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportFunction("_local__copy_dict_from", (void (*)(void))__pyx_f_6gevent_6_local__local__copy_dict_from, "PyObject *(struct __pyx_obj_6gevent_6_local_local *, struct __pyx_obj_6gevent_6_local__localimpl *, PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportFunction("_local_find_descriptors", (void (*)(void))__pyx_f_6gevent_6_local__local_find_descriptors, "PyObject *(struct __pyx_obj_6gevent_6_local_local *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportFunction("all_local_dicts_for_greenlet", (void (*)(void))__pyx_f_6gevent_6_local_all_local_dicts_for_greenlet, "PyObject *(PyGreenlet *, int __pyx_skip_dispatch)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_modinit_type_init_code(void) { + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); + /*--- Type init code ---*/ + __pyx_t_1 = PyImport_ImportModule("greenlet"); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 17, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_ptype_6gevent_6_local_greenlet = __Pyx_ImportType(__pyx_t_1, "greenlet", "greenlet", sizeof(PyGreenlet), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_6_local_greenlet) __PYX_ERR(4, 17, __pyx_L1_error) + __pyx_type_6gevent_6_local__wrefdict.tp_base = (&PyDict_Type); + if (PyType_Ready(&__pyx_type_6gevent_6_local__wrefdict) < 0) __PYX_ERR(0, 210, __pyx_L1_error) + __pyx_type_6gevent_6_local__wrefdict.tp_print = 0; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6gevent_6_local__wrefdict.tp_dictoffset && __pyx_type_6gevent_6_local__wrefdict.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_type_6gevent_6_local__wrefdict.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + } + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_wrefdict, (PyObject *)&__pyx_type_6gevent_6_local__wrefdict) < 0) __PYX_ERR(0, 210, __pyx_L1_error) + if (__pyx_type_6gevent_6_local__wrefdict.tp_weaklistoffset == 0) __pyx_type_6gevent_6_local__wrefdict.tp_weaklistoffset = offsetof(struct __pyx_obj_6gevent_6_local__wrefdict, __weakref__); + __pyx_ptype_6gevent_6_local__wrefdict = &__pyx_type_6gevent_6_local__wrefdict; + if (PyType_Ready(&__pyx_type_6gevent_6_local__greenlet_deleted) < 0) __PYX_ERR(0, 213, __pyx_L1_error) + __pyx_type_6gevent_6_local__greenlet_deleted.tp_print = 0; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6gevent_6_local__greenlet_deleted.tp_dictoffset && __pyx_type_6gevent_6_local__greenlet_deleted.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_type_6gevent_6_local__greenlet_deleted.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + } + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_greenlet_deleted_2, (PyObject *)&__pyx_type_6gevent_6_local__greenlet_deleted) < 0) __PYX_ERR(0, 213, __pyx_L1_error) + __pyx_ptype_6gevent_6_local__greenlet_deleted = &__pyx_type_6gevent_6_local__greenlet_deleted; + if (PyType_Ready(&__pyx_type_6gevent_6_local__local_deleted) < 0) __PYX_ERR(0, 233, __pyx_L1_error) + __pyx_type_6gevent_6_local__local_deleted.tp_print = 0; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6gevent_6_local__local_deleted.tp_dictoffset && __pyx_type_6gevent_6_local__local_deleted.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_type_6gevent_6_local__local_deleted.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + } + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_local_deleted, (PyObject *)&__pyx_type_6gevent_6_local__local_deleted) < 0) __PYX_ERR(0, 233, __pyx_L1_error) + __pyx_ptype_6gevent_6_local__local_deleted = &__pyx_type_6gevent_6_local__local_deleted; + if (PyType_Ready(&__pyx_type_6gevent_6_local__localimpl) < 0) __PYX_ERR(0, 252, __pyx_L1_error) + __pyx_type_6gevent_6_local__localimpl.tp_print = 0; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6gevent_6_local__localimpl.tp_dictoffset && __pyx_type_6gevent_6_local__localimpl.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_type_6gevent_6_local__localimpl.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + } + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_localimpl, (PyObject *)&__pyx_type_6gevent_6_local__localimpl) < 0) __PYX_ERR(0, 252, __pyx_L1_error) + if (__pyx_type_6gevent_6_local__localimpl.tp_weaklistoffset == 0) __pyx_type_6gevent_6_local__localimpl.tp_weaklistoffset = offsetof(struct __pyx_obj_6gevent_6_local__localimpl, __weakref__); + __pyx_ptype_6gevent_6_local__localimpl = &__pyx_type_6gevent_6_local__localimpl; + if (PyType_Ready(&__pyx_type_6gevent_6_local__localimpl_dict_entry) < 0) __PYX_ERR(0, 273, __pyx_L1_error) + __pyx_type_6gevent_6_local__localimpl_dict_entry.tp_print = 0; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6gevent_6_local__localimpl_dict_entry.tp_dictoffset && __pyx_type_6gevent_6_local__localimpl_dict_entry.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_type_6gevent_6_local__localimpl_dict_entry.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + } + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_localimpl_dict_entry, (PyObject *)&__pyx_type_6gevent_6_local__localimpl_dict_entry) < 0) __PYX_ERR(0, 273, __pyx_L1_error) + __pyx_ptype_6gevent_6_local__localimpl_dict_entry = &__pyx_type_6gevent_6_local__localimpl_dict_entry; + __pyx_vtabptr_6gevent_6_local_local = &__pyx_vtable_6gevent_6_local_local; + __pyx_vtable_6gevent_6_local_local.__pyx___copy__ = (struct __pyx_obj_6gevent_6_local_local *(*)(struct __pyx_obj_6gevent_6_local_local *, int __pyx_skip_dispatch))__pyx_f_6gevent_6_local_5local___copy__; + if (PyType_Ready(&__pyx_type_6gevent_6_local_local) < 0) __PYX_ERR(0, 361, __pyx_L1_error) + __pyx_type_6gevent_6_local_local.tp_print = 0; + if (__Pyx_SetVtable(__pyx_type_6gevent_6_local_local.tp_dict, __pyx_vtabptr_6gevent_6_local_local) < 0) __PYX_ERR(0, 361, __pyx_L1_error) + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_local, (PyObject *)&__pyx_type_6gevent_6_local_local) < 0) __PYX_ERR(0, 361, __pyx_L1_error) + __pyx_ptype_6gevent_6_local_local = &__pyx_type_6gevent_6_local_local; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_modinit_type_import_code(void) { + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); + /*--- Type import code ---*/ + __pyx_t_1 = PyImport_ImportModule("weakref"); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 5, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_ptype_6gevent_7__ident_ref = __Pyx_ImportType(__pyx_t_1, "weakref", "ref", sizeof(PyWeakReference), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_7__ident_ref) __PYX_ERR(5, 5, __pyx_L1_error) + __pyx_t_2 = PyImport_ImportModule("gevent.__ident"); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 15, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_ptype_6gevent_7__ident_ValuedWeakRef = __Pyx_ImportType(__pyx_t_2, "gevent.__ident", "ValuedWeakRef", sizeof(struct __pyx_obj_6gevent_7__ident_ValuedWeakRef), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_7__ident_ValuedWeakRef) __PYX_ERR(5, 15, __pyx_L1_error) + __pyx_ptype_6gevent_7__ident_IdentRegistry = __Pyx_ImportType(__pyx_t_2, "gevent.__ident", "IdentRegistry", sizeof(struct __pyx_obj_6gevent_7__ident_IdentRegistry), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_7__ident_IdentRegistry) __PYX_ERR(5, 19, __pyx_L1_error) + __pyx_vtabptr_6gevent_7__ident_IdentRegistry = (struct __pyx_vtabstruct_6gevent_7__ident_IdentRegistry*)__Pyx_GetVtable(__pyx_ptype_6gevent_7__ident_IdentRegistry->tp_dict); if (unlikely(!__pyx_vtabptr_6gevent_7__ident_IdentRegistry)) __PYX_ERR(5, 19, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyImport_ImportModule("greenlet"); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_ptype_6gevent_21__greenlet_primitives_greenlet = __Pyx_ImportType(__pyx_t_2, "greenlet", "greenlet", sizeof(PyGreenlet), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_21__greenlet_primitives_greenlet) __PYX_ERR(1, 12, __pyx_L1_error) + __pyx_t_1 = PyImport_ImportModule("gevent.__greenlet_primitives"); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 37, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_ptype_6gevent_21__greenlet_primitives_TrackedRawGreenlet = __Pyx_ImportType(__pyx_t_1, "gevent.__greenlet_primitives", "TrackedRawGreenlet", sizeof(struct __pyx_obj_6gevent_21__greenlet_primitives_TrackedRawGreenlet), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_21__greenlet_primitives_TrackedRawGreenlet) __PYX_ERR(1, 37, __pyx_L1_error) + __pyx_ptype_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop = __Pyx_ImportType(__pyx_t_1, "gevent.__greenlet_primitives", "SwitchOutGreenletWithLoop", sizeof(struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop) __PYX_ERR(1, 40, __pyx_L1_error) + __pyx_vtabptr_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop = (struct __pyx_vtabstruct_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop*)__Pyx_GetVtable(__pyx_ptype_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop->tp_dict); if (unlikely(!__pyx_vtabptr_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop)) __PYX_ERR(1, 40, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyImport_ImportModule("greenlet"); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 15, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_ptype_6gevent_8__waiter_greenlet = __Pyx_ImportType(__pyx_t_1, "greenlet", "greenlet", sizeof(PyGreenlet), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_8__waiter_greenlet) __PYX_ERR(2, 15, __pyx_L1_error) + __pyx_t_2 = PyImport_ImportModule("gevent.__waiter"); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 33, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_ptype_6gevent_8__waiter_Waiter = __Pyx_ImportType(__pyx_t_2, "gevent.__waiter", "Waiter", sizeof(struct __pyx_obj_6gevent_8__waiter_Waiter), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_8__waiter_Waiter) __PYX_ERR(2, 33, __pyx_L1_error) + __pyx_vtabptr_6gevent_8__waiter_Waiter = (struct __pyx_vtabstruct_6gevent_8__waiter_Waiter*)__Pyx_GetVtable(__pyx_ptype_6gevent_8__waiter_Waiter->tp_dict); if (unlikely(!__pyx_vtabptr_6gevent_8__waiter_Waiter)) __PYX_ERR(2, 33, __pyx_L1_error) + __pyx_ptype_6gevent_8__waiter_MultipleWaiter = __Pyx_ImportType(__pyx_t_2, "gevent.__waiter", "MultipleWaiter", sizeof(struct __pyx_obj_6gevent_8__waiter_MultipleWaiter), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_8__waiter_MultipleWaiter) __PYX_ERR(2, 47, __pyx_L1_error) + __pyx_vtabptr_6gevent_8__waiter_MultipleWaiter = (struct __pyx_vtabstruct_6gevent_8__waiter_MultipleWaiter*)__Pyx_GetVtable(__pyx_ptype_6gevent_8__waiter_MultipleWaiter->tp_dict); if (unlikely(!__pyx_vtabptr_6gevent_8__waiter_MultipleWaiter)) __PYX_ERR(2, 47, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyImport_ImportModule("greenlet"); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 17, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_ptype_6gevent_9_greenlet_greenlet = __Pyx_ImportType(__pyx_t_2, "greenlet", "greenlet", sizeof(PyGreenlet), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_9_greenlet_greenlet) __PYX_ERR(3, 17, __pyx_L1_error) + __pyx_t_1 = PyImport_ImportModule("types"); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 40, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_ptype_6gevent_9_greenlet_CodeType = __Pyx_ImportType(__pyx_t_1, "types", "CodeType", sizeof(PyCodeObject), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_9_greenlet_CodeType) __PYX_ERR(3, 40, __pyx_L1_error) + __pyx_ptype_6gevent_9_greenlet_FrameType = __Pyx_ImportType(__pyx_t_1, "types", "FrameType", sizeof(PyFrameObject), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_9_greenlet_FrameType) __PYX_ERR(3, 45, __pyx_L1_error) + __pyx_t_3 = PyImport_ImportModule("gevent._greenlet"); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 56, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_ptype_6gevent_9_greenlet_SpawnedLink = __Pyx_ImportType(__pyx_t_3, "gevent._greenlet", "SpawnedLink", sizeof(struct __pyx_obj_6gevent_9_greenlet_SpawnedLink), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_9_greenlet_SpawnedLink) __PYX_ERR(3, 56, __pyx_L1_error) + __pyx_ptype_6gevent_9_greenlet_SuccessSpawnedLink = __Pyx_ImportType(__pyx_t_3, "gevent._greenlet", "SuccessSpawnedLink", sizeof(struct __pyx_obj_6gevent_9_greenlet_SuccessSpawnedLink), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_9_greenlet_SuccessSpawnedLink) __PYX_ERR(3, 61, __pyx_L1_error) + __pyx_ptype_6gevent_9_greenlet_FailureSpawnedLink = __Pyx_ImportType(__pyx_t_3, "gevent._greenlet", "FailureSpawnedLink", sizeof(struct __pyx_obj_6gevent_9_greenlet_FailureSpawnedLink), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_9_greenlet_FailureSpawnedLink) __PYX_ERR(3, 65, __pyx_L1_error) + __pyx_ptype_6gevent_9_greenlet__Frame = __Pyx_ImportType(__pyx_t_3, "gevent._greenlet", "_Frame", sizeof(struct __pyx_obj_6gevent_9_greenlet__Frame), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_9_greenlet__Frame) __PYX_ERR(3, 71, __pyx_L1_error) + __pyx_ptype_6gevent_9_greenlet_Greenlet = __Pyx_ImportType(__pyx_t_3, "gevent._greenlet", "Greenlet", sizeof(struct __pyx_obj_6gevent_9_greenlet_Greenlet), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_9_greenlet_Greenlet) __PYX_ERR(3, 86, __pyx_L1_error) + __pyx_vtabptr_6gevent_9_greenlet_Greenlet = (struct __pyx_vtabstruct_6gevent_9_greenlet_Greenlet*)__Pyx_GetVtable(__pyx_ptype_6gevent_9_greenlet_Greenlet->tp_dict); if (unlikely(!__pyx_vtabptr_6gevent_9_greenlet_Greenlet)) __PYX_ERR(3, 86, __pyx_L1_error) + __pyx_ptype_6gevent_9_greenlet__dummy_event = __Pyx_ImportType(__pyx_t_3, "gevent._greenlet", "_dummy_event", sizeof(struct __pyx_obj_6gevent_9_greenlet__dummy_event), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_9_greenlet__dummy_event) __PYX_ERR(3, 157, __pyx_L1_error) + __pyx_vtabptr_6gevent_9_greenlet__dummy_event = (struct __pyx_vtabstruct_6gevent_9_greenlet__dummy_event*)__Pyx_GetVtable(__pyx_ptype_6gevent_9_greenlet__dummy_event->tp_dict); if (unlikely(!__pyx_vtabptr_6gevent_9_greenlet__dummy_event)) __PYX_ERR(3, 157, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_modinit_variable_import_code(void) { + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); + /*--- Variable import code ---*/ + __pyx_t_1 = PyImport_ImportModule("gevent.__ident"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_1, "heappop", (void **)&__pyx_vp_6gevent_7__ident_heappop, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_1, "heappush", (void **)&__pyx_vp_6gevent_7__ident_heappush, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_1, "WeakKeyDictionary", (void **)&__pyx_vp_6gevent_7__ident_WeakKeyDictionary, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + Py_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_2 = PyImport_ImportModule("gevent.__greenlet_primitives"); if (!__pyx_t_2) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_2, "get_objects", (void **)&__pyx_vp_6gevent_21__greenlet_primitives_get_objects, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_2, "wref", (void **)&__pyx_vp_6gevent_21__greenlet_primitives_wref, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_2, "BlockingSwitchOutError", (void **)&__pyx_vp_6gevent_21__greenlet_primitives_BlockingSwitchOutError, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_2, "_greenlet_imported", (void **)&__pyx_vp_6gevent_21__greenlet_primitives__greenlet_imported, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + Py_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_3 = PyImport_ImportModule("gevent.__hub_local"); if (!__pyx_t_3) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_3, "_threadlocal", (void **)&__pyx_vp_6gevent_11__hub_local__threadlocal, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + Py_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_4 = PyImport_ImportModule("gevent.__waiter"); if (!__pyx_t_4) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_4, "sys", (void **)&__pyx_vp_6gevent_8__waiter_sys, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_4, "ConcurrentObjectUseError", (void **)&__pyx_vp_6gevent_8__waiter_ConcurrentObjectUseError, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_4, "_greenlet_imported", (void **)&__pyx_vp_6gevent_8__waiter__greenlet_imported, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_4, "_NONE", (void **)&__pyx_vp_6gevent_8__waiter__NONE, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + Py_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = PyImport_ImportModule("gevent._greenlet"); if (!__pyx_t_5) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_5, "_PYPY", (void **)&__pyx_vp_6gevent_9_greenlet__PYPY, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_5, "sys_getframe", (void **)&__pyx_vp_6gevent_9_greenlet_sys_getframe, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_5, "sys_exc_info", (void **)&__pyx_vp_6gevent_9_greenlet_sys_exc_info, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_5, "Timeout", (void **)&__pyx_vp_6gevent_9_greenlet_Timeout, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_5, "GreenletExit", (void **)&__pyx_vp_6gevent_9_greenlet_GreenletExit, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_5, "InvalidSwitchError", (void **)&__pyx_vp_6gevent_9_greenlet_InvalidSwitchError, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_5, "_greenlet_imported", (void **)&__pyx_vp_6gevent_9_greenlet__greenlet_imported, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_5, "_greenlet__init__", (void **)&__pyx_vp_6gevent_9_greenlet__greenlet__init__, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_5, "_threadlocal", (void **)&__pyx_vp_6gevent_9_greenlet__threadlocal, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_5, "get_hub_class", (void **)&__pyx_vp_6gevent_9_greenlet_get_hub_class, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_5, "wref", (void **)&__pyx_vp_6gevent_9_greenlet_wref, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_5, "dump_traceback", (void **)&__pyx_vp_6gevent_9_greenlet_dump_traceback, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_5, "load_traceback", (void **)&__pyx_vp_6gevent_9_greenlet_load_traceback, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_5, "wait", (void **)&__pyx_vp_6gevent_9_greenlet_wait, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_5, "iwait", (void **)&__pyx_vp_6gevent_9_greenlet_iwait, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_5, "reraise", (void **)&__pyx_vp_6gevent_9_greenlet_reraise, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_5, "GEVENT_CONFIG", (void **)&__pyx_vp_6gevent_9_greenlet_GEVENT_CONFIG, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_5, "_cancelled_start_event", (void **)&__pyx_vp_6gevent_9_greenlet__cancelled_start_event, "struct __pyx_obj_6gevent_9_greenlet__dummy_event *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_5, "_start_completed_event", (void **)&__pyx_vp_6gevent_9_greenlet__start_completed_event, "struct __pyx_obj_6gevent_9_greenlet__dummy_event *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_5, "_spawn_callbacks", (void **)&__pyx_vp_6gevent_9_greenlet__spawn_callbacks, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + Py_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_modinit_function_import_code(void) { + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); + /*--- Function import code ---*/ + __pyx_t_1 = PyImport_ImportModule("gevent.__hub_local"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportFunction(__pyx_t_1, "get_hub_noargs", (void (**)(void))&__pyx_f_6gevent_11__hub_local_get_hub_noargs, "struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *(int __pyx_skip_dispatch)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + Py_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_RefNannyFinishContext(); + return -1; +} + + +#if PY_MAJOR_VERSION < 3 +#ifdef CYTHON_NO_PYINIT_EXPORT +#define __Pyx_PyMODINIT_FUNC void +#else +#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC +#endif +#else +#ifdef CYTHON_NO_PYINIT_EXPORT +#define __Pyx_PyMODINIT_FUNC PyObject * +#else +#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC +#endif +#endif + + +#if PY_MAJOR_VERSION < 3 +__Pyx_PyMODINIT_FUNC init_local(void) CYTHON_SMALL_CODE; /*proto*/ +__Pyx_PyMODINIT_FUNC init_local(void) +#else +__Pyx_PyMODINIT_FUNC PyInit__local(void) CYTHON_SMALL_CODE; /*proto*/ +__Pyx_PyMODINIT_FUNC PyInit__local(void) +#if CYTHON_PEP489_MULTI_PHASE_INIT +{ + return PyModuleDef_Init(&__pyx_moduledef); +} +static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { + #if PY_VERSION_HEX >= 0x030700A1 + static PY_INT64_T main_interpreter_id = -1; + PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); + if (main_interpreter_id == -1) { + main_interpreter_id = current_id; + return (unlikely(current_id == -1)) ? -1 : 0; + } else if (unlikely(main_interpreter_id != current_id)) + #else + static PyInterpreterState *main_interpreter = NULL; + PyInterpreterState *current_interpreter = PyThreadState_Get()->interp; + if (!main_interpreter) { + main_interpreter = current_interpreter; + } else if (unlikely(main_interpreter != current_interpreter)) + #endif + { + PyErr_SetString( + PyExc_ImportError, + "Interpreter change detected - this module can only be loaded into one interpreter per process."); + return -1; + } + return 0; +} +static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) { + PyObject *value = PyObject_GetAttrString(spec, from_name); + int result = 0; + if (likely(value)) { + if (allow_none || value != Py_None) { + result = PyDict_SetItemString(moddict, to_name, value); + } + Py_DECREF(value); + } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_Clear(); + } else { + result = -1; + } + return result; +} +static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) { + PyObject *module = NULL, *moddict, *modname; + if (__Pyx_check_single_interpreter()) + return NULL; + if (__pyx_m) + return __Pyx_NewRef(__pyx_m); + modname = PyObject_GetAttrString(spec, "name"); + if (unlikely(!modname)) goto bad; + module = PyModule_NewObject(modname); + Py_DECREF(modname); + if (unlikely(!module)) goto bad; + moddict = PyModule_GetDict(module); + if (unlikely(!moddict)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad; + return module; +bad: + Py_XDECREF(module); + return NULL; +} + + +static CYTHON_SMALL_CODE int __pyx_pymod_exec__local(PyObject *__pyx_pyinit_module) +#endif +#endif +{ + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + int __pyx_t_7; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + __Pyx_RefNannyDeclarations + #if CYTHON_PEP489_MULTI_PHASE_INIT + if (__pyx_m) { + if (__pyx_m == __pyx_pyinit_module) return 0; + PyErr_SetString(PyExc_RuntimeError, "Module '_local' has already been imported. Re-initialisation is not supported."); + return -1; + } + #elif PY_MAJOR_VERSION >= 3 + if (__pyx_m) return __Pyx_NewRef(__pyx_m); + #endif + #if CYTHON_REFNANNY +__Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); +if (!__Pyx_RefNanny) { + PyErr_Clear(); + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); + if (!__Pyx_RefNanny) + Py_FatalError("failed to import 'refnanny' module"); +} +#endif + __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit__local(void)", 0); + if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #ifdef __Pxy_PyFrame_Initialize_Offsets + __Pxy_PyFrame_Initialize_Offsets(); + #endif + __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) + #ifdef __Pyx_CyFunction_USED + if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_FusedFunction_USED + if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_Coroutine_USED + if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_Generator_USED + if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_AsyncGen_USED + if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_StopAsyncIteration_USED + if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + /*--- Library function declarations ---*/ + /*--- Threads initialization code ---*/ + #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS + #ifdef WITH_THREAD /* Python build with threading support? */ + PyEval_InitThreads(); + #endif + #endif + /*--- Module creation code ---*/ + #if CYTHON_PEP489_MULTI_PHASE_INIT + __pyx_m = __pyx_pyinit_module; + Py_INCREF(__pyx_m); + #else + #if PY_MAJOR_VERSION < 3 + __pyx_m = Py_InitModule4("_local", __pyx_methods, __pyx_k_Greenlet_local_objects_This_mod, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); + #else + __pyx_m = PyModule_Create(&__pyx_moduledef); + #endif + if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) + Py_INCREF(__pyx_d); + __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) + #if CYTHON_COMPILING_IN_PYPY + Py_INCREF(__pyx_b); + #endif + if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + /*--- Initialize various global constants etc. ---*/ + if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) + if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + if (__pyx_module_is_main_gevent___local) { + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + } + #if PY_MAJOR_VERSION >= 3 + { + PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) + if (!PyDict_GetItemString(modules, "gevent._local")) { + if (unlikely(PyDict_SetItemString(modules, "gevent._local", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error) + } + } + #endif + /*--- Builtin init code ---*/ + if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + /*--- Constants init code ---*/ + if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + /*--- Global type/function init code ---*/ + (void)__Pyx_modinit_global_init_code(); + if (unlikely(__Pyx_modinit_variable_export_code() != 0)) goto __pyx_L1_error; + if (unlikely(__Pyx_modinit_function_export_code() != 0)) goto __pyx_L1_error; + if (unlikely(__Pyx_modinit_type_init_code() != 0)) goto __pyx_L1_error; + if (unlikely(__Pyx_modinit_type_import_code() != 0)) goto __pyx_L1_error; + if (unlikely(__Pyx_modinit_variable_import_code() != 0)) goto __pyx_L1_error; + if (unlikely(__Pyx_modinit_function_import_code() != 0)) goto __pyx_L1_error; + /*--- Execution code ---*/ + #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) + if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + + /* "src/gevent/local.py":156 + * from __future__ import print_function + * + * from copy import copy # <<<<<<<<<<<<<< + * from weakref import ref + * + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 156, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_copy_2); + __Pyx_GIVEREF(__pyx_n_s_copy_2); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_copy_2); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_copy_2, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 156, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_copy_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 156, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_v_6gevent_6_local_copy); + __Pyx_DECREF_SET(__pyx_v_6gevent_6_local_copy, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/local.py":157 + * + * from copy import copy + * from weakref import ref # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 157, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_ref); + __Pyx_GIVEREF(__pyx_n_s_ref); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_ref); + __pyx_t_1 = __Pyx_Import(__pyx_n_s_weakref, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 157, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_ref); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 157, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_v_6gevent_6_local_ref); + __Pyx_DECREF_SET(__pyx_v_6gevent_6_local_ref, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/local.py":160 + * + * + * locals()['getcurrent'] = __import__('greenlet').getcurrent # <<<<<<<<<<<<<< + * locals()['greenlet_init'] = lambda: None + * + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin___import__, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 160, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_getcurrent); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 160, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_Globals(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 160, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (unlikely(PyDict_SetItem(__pyx_t_1, __pyx_n_s_getcurrent, __pyx_t_2) < 0)) __PYX_ERR(0, 160, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/local.py":161 + * + * locals()['getcurrent'] = __import__('greenlet').getcurrent + * locals()['greenlet_init'] = lambda: None # <<<<<<<<<<<<<< + * + * __all__ = [ + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_local_4lambda, 0, __pyx_n_s_lambda, NULL, __pyx_n_s_gevent__local, __pyx_d, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 161, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_Globals(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 161, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (unlikely(PyDict_SetItem(__pyx_t_1, __pyx_n_s_greenlet_init, __pyx_t_2) < 0)) __PYX_ERR(0, 161, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/local.py":163 + * locals()['greenlet_init'] = lambda: None + * + * __all__ = [ # <<<<<<<<<<<<<< + * "local", + * ] + */ + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 163, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_local); + __Pyx_GIVEREF(__pyx_n_s_local); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_local); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_all, __pyx_t_2) < 0) __PYX_ERR(0, 163, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/local.py":170 + * # We keep it a string for speed but make it unlikely to clash with + * # a "real" attribute. + * key_prefix = '_gevent_local_localimpl_' # <<<<<<<<<<<<<< + * + * # The overall structure is as follows: + */ + __Pyx_INCREF(__pyx_n_s_gevent_local_localimpl); + __Pyx_XGOTREF(__pyx_v_6gevent_6_local_key_prefix); + __Pyx_DECREF_SET(__pyx_v_6gevent_6_local_key_prefix, __pyx_n_s_gevent_local_localimpl); + __Pyx_GIVEREF(__pyx_n_s_gevent_local_localimpl); + + /* "src/gevent/local.py":179 + * # That final tuple is actually a localimpl_dict_entry object. + * + * def all_local_dicts_for_greenlet(greenlet): # <<<<<<<<<<<<<< + * """ + * Internal debug helper for getting the local values associated + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_local_1all_local_dicts_for_greenlet, 0, __pyx_n_s_all_local_dicts_for_greenlet, NULL, __pyx_n_s_gevent__local, __pyx_d, ((PyObject *)__pyx_codeobj__3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 179, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_all_local_dicts_for_greenlet, __pyx_t_2) < 0) __PYX_ERR(0, 179, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/local.py":222 + * weakref. + * """ + * __slots__ = ('idt', 'wrdicts') # <<<<<<<<<<<<<< + * + * def __init__(self, idt, wrdicts): + */ + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_local__greenlet_deleted->tp_dict, __pyx_n_s_slots, __pyx_tuple__4) < 0) __PYX_ERR(0, 222, __pyx_L1_error) + PyType_Modified(__pyx_ptype_6gevent_6_local__greenlet_deleted); + + /* "src/gevent/local.py":234 + * + * class _local_deleted(object): + * __slots__ = ('key', 'wrthread', 'greenlet_deleted') # <<<<<<<<<<<<<< + * + * def __init__(self, key, wrthread, greenlet_deleted): + */ + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_local__local_deleted->tp_dict, __pyx_n_s_slots, __pyx_tuple__5) < 0) __PYX_ERR(0, 234, __pyx_L1_error) + PyType_Modified(__pyx_ptype_6gevent_6_local__local_deleted); + + /* "src/gevent/local.py":254 + * class _localimpl(object): + * """A class managing thread-local dicts""" + * __slots__ = ('key', 'dicts', # <<<<<<<<<<<<<< + * 'localargs', 'localkwargs', + * 'localtypeid', + */ + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_local__localimpl->tp_dict, __pyx_n_s_slots, __pyx_tuple__6) < 0) __PYX_ERR(0, 254, __pyx_L1_error) + PyType_Modified(__pyx_ptype_6gevent_6_local__localimpl); + + /* "src/gevent/local.py":280 + * # This is a class, not just a tuple, so that cython can optimize + * # attribute access + * __slots__ = ('wrgreenlet', 'localdict') # <<<<<<<<<<<<<< + * + * def __init__(self, wrgreenlet, localdict): + */ + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_local__localimpl_dict_entry->tp_dict, __pyx_n_s_slots, __pyx_tuple__7) < 0) __PYX_ERR(0, 280, __pyx_L1_error) + PyType_Modified(__pyx_ptype_6gevent_6_local__localimpl_dict_entry); + + /* "src/gevent/local.py":331 + * + * + * _marker = object() # <<<<<<<<<<<<<< + * + * def _local_get_dict(self): + */ + __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_builtin_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 331, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_v_6gevent_6_local__marker); + __Pyx_DECREF_SET(__pyx_v_6gevent_6_local__marker, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + + /* "src/gevent/local.py":350 + * + * _local_attrs = { + * '_local__impl', # <<<<<<<<<<<<<< + * '_local_type_get_descriptors', + * '_local_type_set_or_del_descriptors', + */ + __pyx_t_2 = PySet_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 350, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PySet_Add(__pyx_t_2, __pyx_n_s_local__impl) < 0) __PYX_ERR(0, 350, __pyx_L1_error) + if (PySet_Add(__pyx_t_2, __pyx_n_s_local_type_get_descriptors) < 0) __PYX_ERR(0, 350, __pyx_L1_error) + if (PySet_Add(__pyx_t_2, __pyx_n_s_local_type_set_or_del_descripto) < 0) __PYX_ERR(0, 350, __pyx_L1_error) + if (PySet_Add(__pyx_t_2, __pyx_n_s_local_type_del_descriptors) < 0) __PYX_ERR(0, 350, __pyx_L1_error) + if (PySet_Add(__pyx_t_2, __pyx_n_s_local_type_set_descriptors) < 0) __PYX_ERR(0, 350, __pyx_L1_error) + if (PySet_Add(__pyx_t_2, __pyx_n_s_local_type_2) < 0) __PYX_ERR(0, 350, __pyx_L1_error) + if (PySet_Add(__pyx_t_2, __pyx_n_s_local_type_vars) < 0) __PYX_ERR(0, 350, __pyx_L1_error) + if (PySet_Add(__pyx_t_2, __pyx_n_s_class) < 0) __PYX_ERR(0, 350, __pyx_L1_error) + if (PySet_Add(__pyx_t_2, __pyx_n_s_cinit) < 0) __PYX_ERR(0, 350, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_v_6gevent_6_local__local_attrs); + __Pyx_DECREF_SET(__pyx_v_6gevent_6_local__local_attrs, ((PyObject*)__pyx_t_2)); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + + /* "src/gevent/local.py":365 + * An object whose attributes are greenlet-local. + * """ + * __slots__ = tuple(_local_attrs - {'__class__', '__cinit__'}) # <<<<<<<<<<<<<< + * + * def __cinit__(self, *args, **kw): + */ + __pyx_t_2 = PySet_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 365, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PySet_Add(__pyx_t_2, __pyx_n_s_class) < 0) __PYX_ERR(0, 365, __pyx_L1_error) + if (PySet_Add(__pyx_t_2, __pyx_n_s_cinit) < 0) __PYX_ERR(0, 365, __pyx_L1_error) + __pyx_t_1 = PyNumber_Subtract(__pyx_v_6gevent_6_local__local_attrs, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 365, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PySequence_Tuple(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 365, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_local_local->tp_dict, __pyx_n_s_slots, __pyx_t_2) < 0) __PYX_ERR(0, 365, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_6_local_local); + + /* "src/gevent/local.py":517 + * raise AttributeError(name) + * + * def __copy__(self): # <<<<<<<<<<<<<< + * impl = self._local__impl + * entry = impl.dicts[id(getcurrent())] # pylint:disable=undefined-variable + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_local_5local_9__copy__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_local___copy, NULL, __pyx_n_s_gevent__local, __pyx_d, ((PyObject *)__pyx_codeobj__9)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 517, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_local_local->tp_dict, __pyx_n_s_copy, __pyx_t_2) < 0) __PYX_ERR(0, 517, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_6_local_local); + + /* "src/gevent/local.py":574 + * # (e.g., on PyPy). So we set it at runtime. Cython + * # will raise an error if we're compiled. + * def __new__(cls, *args, **kw): # <<<<<<<<<<<<<< + * self = super(local, cls).__new__(cls) + * # We get the cls in *args for some reason + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_local_3__new__, 0, __pyx_n_s_new, NULL, __pyx_n_s_gevent__local, __pyx_d, ((PyObject *)__pyx_codeobj__11)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 574, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_new, __pyx_t_2) < 0) __PYX_ERR(0, 574, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/local.py":582 + * return self + * + * try: # <<<<<<<<<<<<<< + * # PyPy2/3 and CPython handle adding a __new__ to the class + * # in different ways. In CPython and PyPy3, it must be wrapped with classmethod; + */ + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5); + __Pyx_XGOTREF(__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_4); + __Pyx_XGOTREF(__pyx_t_5); + /*try:*/ { + + /* "src/gevent/local.py":587 + * # in PyPy2, it must not. In either case, the args that get passed to + * # it are stil wrong. + * local.__new__ = 'None' # <<<<<<<<<<<<<< + * except TypeError: # pragma: no cover + * # Must be compiled + */ + if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_ptype_6gevent_6_local_local), __pyx_n_s_new, __pyx_n_s_None) < 0) __PYX_ERR(0, 587, __pyx_L2_error) + + /* "src/gevent/local.py":582 + * return self + * + * try: # <<<<<<<<<<<<<< + * # PyPy2/3 and CPython handle adding a __new__ to the class + * # in different ways. In CPython and PyPy3, it must be wrapped with classmethod; + */ + } + + /* "src/gevent/local.py":592 + * pass + * else: + * from gevent._compat import PYPY # <<<<<<<<<<<<<< + * from gevent._compat import PY2 + * if PYPY and PY2: + */ + /*else:*/ { + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 592, __pyx_L4_except_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_PYPY_2); + __Pyx_GIVEREF(__pyx_n_s_PYPY_2); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PYPY_2); + __pyx_t_1 = __Pyx_Import(__pyx_n_s_gevent__compat, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 592, __pyx_L4_except_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_PYPY_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 592, __pyx_L4_except_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_PYPY_2, __pyx_t_2) < 0) __PYX_ERR(0, 592, __pyx_L4_except_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/local.py":593 + * else: + * from gevent._compat import PYPY + * from gevent._compat import PY2 # <<<<<<<<<<<<<< + * if PYPY and PY2: + * local.__new__ = __new__ + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 593, __pyx_L4_except_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_PY2); + __Pyx_GIVEREF(__pyx_n_s_PY2); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_PY2); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_gevent__compat, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 593, __pyx_L4_except_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_PY2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 593, __pyx_L4_except_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_PY2, __pyx_t_1) < 0) __PYX_ERR(0, 593, __pyx_L4_except_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/local.py":594 + * from gevent._compat import PYPY + * from gevent._compat import PY2 + * if PYPY and PY2: # <<<<<<<<<<<<<< + * local.__new__ = __new__ + * else: + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_PYPY_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 594, __pyx_L4_except_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 594, __pyx_L4_except_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_7) { + } else { + __pyx_t_6 = __pyx_t_7; + goto __pyx_L9_bool_binop_done; + } + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_PY2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 594, __pyx_L4_except_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 594, __pyx_L4_except_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_6 = __pyx_t_7; + __pyx_L9_bool_binop_done:; + if (__pyx_t_6) { + + /* "src/gevent/local.py":595 + * from gevent._compat import PY2 + * if PYPY and PY2: + * local.__new__ = __new__ # <<<<<<<<<<<<<< + * else: + * local.__new__ = classmethod(__new__) + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 595, __pyx_L4_except_error) + __Pyx_GOTREF(__pyx_t_2); + if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_ptype_6gevent_6_local_local), __pyx_n_s_new, __pyx_t_2) < 0) __PYX_ERR(0, 595, __pyx_L4_except_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/local.py":594 + * from gevent._compat import PYPY + * from gevent._compat import PY2 + * if PYPY and PY2: # <<<<<<<<<<<<<< + * local.__new__ = __new__ + * else: + */ + goto __pyx_L8; + } + + /* "src/gevent/local.py":597 + * local.__new__ = __new__ + * else: + * local.__new__ = classmethod(__new__) # <<<<<<<<<<<<<< + * + * del PYPY + */ + /*else*/ { + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 597, __pyx_L4_except_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_classmethod, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 597, __pyx_L4_except_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_ptype_6gevent_6_local_local), __pyx_n_s_new, __pyx_t_1) < 0) __PYX_ERR(0, 597, __pyx_L4_except_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + __pyx_L8:; + + /* "src/gevent/local.py":599 + * local.__new__ = classmethod(__new__) + * + * del PYPY # <<<<<<<<<<<<<< + * del PY2 + * + */ + if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_PYPY_2) < 0) __PYX_ERR(0, 599, __pyx_L4_except_error) + + /* "src/gevent/local.py":600 + * + * del PYPY + * del PY2 # <<<<<<<<<<<<<< + * + * _init() + */ + if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_PY2) < 0) __PYX_ERR(0, 600, __pyx_L4_except_error) + } + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + goto __pyx_L7_try_end; + __pyx_L2_error:; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/local.py":588 + * # it are stil wrong. + * local.__new__ = 'None' + * except TypeError: # pragma: no cover # <<<<<<<<<<<<<< + * # Must be compiled + * pass + */ + __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError); + if (__pyx_t_8) { + __Pyx_ErrRestore(0,0,0); + goto __pyx_L3_exception_handled; + } + goto __pyx_L4_except_error; + __pyx_L4_except_error:; + + /* "src/gevent/local.py":582 + * return self + * + * try: # <<<<<<<<<<<<<< + * # PyPy2/3 and CPython handle adding a __new__ to the class + * # in different ways. In CPython and PyPy3, it must be wrapped with classmethod; + */ + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); + goto __pyx_L1_error; + __pyx_L3_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); + __pyx_L7_try_end:; + } + + /* "src/gevent/local.py":602 + * del PY2 + * + * _init() # <<<<<<<<<<<<<< + * + * from gevent._util import import_c_accel + */ + __pyx_f_6gevent_6_local__init(); + + /* "src/gevent/local.py":604 + * _init() + * + * from gevent._util import import_c_accel # <<<<<<<<<<<<<< + * import_c_accel(globals(), 'gevent._local') + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 604, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_import_c_accel); + __Pyx_GIVEREF(__pyx_n_s_import_c_accel); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_import_c_accel); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_gevent__util, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 604, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_import_c_accel); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 604, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_import_c_accel, __pyx_t_1) < 0) __PYX_ERR(0, 604, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/local.py":605 + * + * from gevent._util import import_c_accel + * import_c_accel(globals(), 'gevent._local') # <<<<<<<<<<<<<< + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_import_c_accel); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 605, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_Globals(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 605, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 605, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_1); + __Pyx_INCREF(__pyx_n_s_gevent__local); + __Pyx_GIVEREF(__pyx_n_s_gevent__local); + PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_n_s_gevent__local); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 605, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/local.py":1 + * # cython: auto_pickle=False,embedsignature=True,always_allow_keywords=False # <<<<<<<<<<<<<< + * """ + * Greenlet-local objects. + */ + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "gevent/_local.pxd":29 + * return PyGreenlet_GetCurrent() + * + * cdef inline void greenlet_init(): # <<<<<<<<<<<<<< + * global _greenlet_imported + * if not _greenlet_imported: + */ + + /*--- Wrapped vars code ---*/ + + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_9); + if (__pyx_m) { + if (__pyx_d) { + __Pyx_AddTraceback("init gevent._local", __pyx_clineno, __pyx_lineno, __pyx_filename); + } + Py_CLEAR(__pyx_m); + } else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_ImportError, "init gevent._local"); + } + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + #if CYTHON_PEP489_MULTI_PHASE_INIT + return (__pyx_m != NULL) ? 0 : -1; + #elif PY_MAJOR_VERSION >= 3 + return __pyx_m; + #else + return; + #endif +} + +/* --- Runtime support code --- */ +/* Refnanny */ +#if CYTHON_REFNANNY +static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { + PyObject *m = NULL, *p = NULL; + void *r = NULL; + m = PyImport_ImportModule(modname); + if (!m) goto end; + p = PyObject_GetAttrString(m, "RefNannyAPI"); + if (!p) goto end; + r = PyLong_AsVoidPtr(p); +end: + Py_XDECREF(p); + Py_XDECREF(m); + return (__Pyx_RefNannyAPIStruct *)r; +} +#endif + +/* PyObjectGetAttrStr */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_getattro)) + return tp->tp_getattro(obj, attr_name); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_getattr)) + return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); +#endif + return PyObject_GetAttr(obj, attr_name); +} +#endif + +/* GetBuiltinName */ +static PyObject *__Pyx_GetBuiltinName(PyObject *name) { + PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name); + if (unlikely(!result)) { + PyErr_Format(PyExc_NameError, +#if PY_MAJOR_VERSION >= 3 + "name '%U' is not defined", name); +#else + "name '%.200s' is not defined", PyString_AS_STRING(name)); +#endif + } + return result; +} + +/* PyCFunctionFastCall */ +#if CYTHON_FAST_PYCCALL +static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) { + PyCFunctionObject *func = (PyCFunctionObject*)func_obj; + PyCFunction meth = PyCFunction_GET_FUNCTION(func); + PyObject *self = PyCFunction_GET_SELF(func); + int flags = PyCFunction_GET_FLAGS(func); + assert(PyCFunction_Check(func)); + assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS))); + assert(nargs >= 0); + assert(nargs == 0 || args != NULL); + /* _PyCFunction_FastCallDict() must not be called with an exception set, + because it may clear it (directly or indirectly) and so the + caller loses its exception */ + assert(!PyErr_Occurred()); + if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) { + return (*((__Pyx_PyCFunctionFastWithKeywords)(void*)meth)) (self, args, nargs, NULL); + } else { + return (*((__Pyx_PyCFunctionFast)(void*)meth)) (self, args, nargs); + } +} +#endif + +/* PyFunctionFastCall */ +#if CYTHON_FAST_PYCALL +static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, + PyObject *globals) { + PyFrameObject *f; + PyThreadState *tstate = __Pyx_PyThreadState_Current; + PyObject **fastlocals; + Py_ssize_t i; + PyObject *result; + assert(globals != NULL); + /* XXX Perhaps we should create a specialized + PyFrame_New() that doesn't take locals, but does + take builtins without sanity checking them. + */ + assert(tstate != NULL); + f = PyFrame_New(tstate, co, globals, NULL); + if (f == NULL) { + return NULL; + } + fastlocals = __Pyx_PyFrame_GetLocalsplus(f); + for (i = 0; i < na; i++) { + Py_INCREF(*args); + fastlocals[i] = *args++; + } + result = PyEval_EvalFrameEx(f,0); + ++tstate->recursion_depth; + Py_DECREF(f); + --tstate->recursion_depth; + return result; +} +#if 1 || PY_VERSION_HEX < 0x030600B1 +static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs) { + PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); + PyObject *globals = PyFunction_GET_GLOBALS(func); + PyObject *argdefs = PyFunction_GET_DEFAULTS(func); + PyObject *closure; +#if PY_MAJOR_VERSION >= 3 + PyObject *kwdefs; +#endif + PyObject *kwtuple, **k; + PyObject **d; + Py_ssize_t nd; + Py_ssize_t nk; + PyObject *result; + assert(kwargs == NULL || PyDict_Check(kwargs)); + nk = kwargs ? PyDict_Size(kwargs) : 0; + if (Py_EnterRecursiveCall((char*)" while calling a Python object")) { + return NULL; + } + if ( +#if PY_MAJOR_VERSION >= 3 + co->co_kwonlyargcount == 0 && +#endif + likely(kwargs == NULL || nk == 0) && + co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { + if (argdefs == NULL && co->co_argcount == nargs) { + result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); + goto done; + } + else if (nargs == 0 && argdefs != NULL + && co->co_argcount == Py_SIZE(argdefs)) { + /* function called with no arguments, but all parameters have + a default value: use default values as arguments .*/ + args = &PyTuple_GET_ITEM(argdefs, 0); + result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); + goto done; + } + } + if (kwargs != NULL) { + Py_ssize_t pos, i; + kwtuple = PyTuple_New(2 * nk); + if (kwtuple == NULL) { + result = NULL; + goto done; + } + k = &PyTuple_GET_ITEM(kwtuple, 0); + pos = i = 0; + while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { + Py_INCREF(k[i]); + Py_INCREF(k[i+1]); + i += 2; + } + nk = i / 2; + } + else { + kwtuple = NULL; + k = NULL; + } + closure = PyFunction_GET_CLOSURE(func); +#if PY_MAJOR_VERSION >= 3 + kwdefs = PyFunction_GET_KW_DEFAULTS(func); +#endif + if (argdefs != NULL) { + d = &PyTuple_GET_ITEM(argdefs, 0); + nd = Py_SIZE(argdefs); + } + else { + d = NULL; + nd = 0; + } +#if PY_MAJOR_VERSION >= 3 + result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, + args, nargs, + k, (int)nk, + d, (int)nd, kwdefs, closure); +#else + result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, + args, nargs, + k, (int)nk, + d, (int)nd, closure); +#endif + Py_XDECREF(kwtuple); +done: + Py_LeaveRecursiveCall(); + return result; +} +#endif +#endif + +/* PyObjectCall */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { + PyObject *result; + ternaryfunc call = func->ob_type->tp_call; + if (unlikely(!call)) + return PyObject_Call(func, arg, kw); + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; + result = (*call)(func, arg, kw); + Py_LeaveRecursiveCall(); + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +/* PyObjectCallMethO */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { + PyObject *self, *result; + PyCFunction cfunc; + cfunc = PyCFunction_GET_FUNCTION(func); + self = PyCFunction_GET_SELF(func); + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; + result = cfunc(self, arg); + Py_LeaveRecursiveCall(); + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +/* PyObjectCallOneArg */ +#if CYTHON_COMPILING_IN_CPYTHON +static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) { + PyObject *result; + PyObject *args = PyTuple_New(1); + if (unlikely(!args)) return NULL; + Py_INCREF(arg); + PyTuple_SET_ITEM(args, 0, arg); + result = __Pyx_PyObject_Call(func, args, NULL); + Py_DECREF(args); + return result; +} +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { +#if CYTHON_FAST_PYCALL + if (PyFunction_Check(func)) { + return __Pyx_PyFunction_FastCall(func, &arg, 1); + } +#endif + if (likely(PyCFunction_Check(func))) { + if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) { + return __Pyx_PyObject_CallMethO(func, arg); +#if CYTHON_FAST_PYCCALL + } else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) { + return __Pyx_PyCFunction_FastCall(func, &arg, 1); +#endif + } + } + return __Pyx__PyObject_CallOneArg(func, arg); +} +#else +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { + PyObject *result; + PyObject *args = PyTuple_Pack(1, arg); + if (unlikely(!args)) return NULL; + result = __Pyx_PyObject_Call(func, args, NULL); + Py_DECREF(args); + return result; +} +#endif + +/* IterFinish */ +static CYTHON_INLINE int __Pyx_IterFinish(void) { +#if CYTHON_FAST_THREAD_STATE + PyThreadState *tstate = __Pyx_PyThreadState_Current; + PyObject* exc_type = tstate->curexc_type; + if (unlikely(exc_type)) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) { + PyObject *exc_value, *exc_tb; + exc_value = tstate->curexc_value; + exc_tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; + Py_DECREF(exc_type); + Py_XDECREF(exc_value); + Py_XDECREF(exc_tb); + return 0; + } else { + return -1; + } + } + return 0; +#else + if (unlikely(PyErr_Occurred())) { + if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) { + PyErr_Clear(); + return 0; + } else { + return -1; + } + } + return 0; +#endif +} + +/* PyObjectCallNoArg */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { +#if CYTHON_FAST_PYCALL + if (PyFunction_Check(func)) { + return __Pyx_PyFunction_FastCall(func, NULL, 0); + } +#endif +#ifdef __Pyx_CyFunction_USED + if (likely(PyCFunction_Check(func) || __Pyx_CyFunction_Check(func))) +#else + if (likely(PyCFunction_Check(func))) +#endif + { + if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) { + return __Pyx_PyObject_CallMethO(func, NULL); + } + } + return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL); +} +#endif + +/* PyObjectGetMethod */ +static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method) { + PyObject *attr; +#if CYTHON_UNPACK_METHODS && CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_PYTYPE_LOOKUP + PyTypeObject *tp = Py_TYPE(obj); + PyObject *descr; + descrgetfunc f = NULL; + PyObject **dictptr, *dict; + int meth_found = 0; + assert (*method == NULL); + if (unlikely(tp->tp_getattro != PyObject_GenericGetAttr)) { + attr = __Pyx_PyObject_GetAttrStr(obj, name); + goto try_unpack; + } + if (unlikely(tp->tp_dict == NULL) && unlikely(PyType_Ready(tp) < 0)) { + return 0; + } + descr = _PyType_Lookup(tp, name); + if (likely(descr != NULL)) { + Py_INCREF(descr); +#if PY_MAJOR_VERSION >= 3 + #ifdef __Pyx_CyFunction_USED + if (likely(PyFunction_Check(descr) || (Py_TYPE(descr) == &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr))) + #else + if (likely(PyFunction_Check(descr) || (Py_TYPE(descr) == &PyMethodDescr_Type))) + #endif +#else + #ifdef __Pyx_CyFunction_USED + if (likely(PyFunction_Check(descr) || __Pyx_CyFunction_Check(descr))) + #else + if (likely(PyFunction_Check(descr))) + #endif +#endif + { + meth_found = 1; + } else { + f = Py_TYPE(descr)->tp_descr_get; + if (f != NULL && PyDescr_IsData(descr)) { + attr = f(descr, obj, (PyObject *)Py_TYPE(obj)); + Py_DECREF(descr); + goto try_unpack; + } + } + } + dictptr = _PyObject_GetDictPtr(obj); + if (dictptr != NULL && (dict = *dictptr) != NULL) { + Py_INCREF(dict); + attr = __Pyx_PyDict_GetItemStr(dict, name); + if (attr != NULL) { + Py_INCREF(attr); + Py_DECREF(dict); + Py_XDECREF(descr); + goto try_unpack; + } + Py_DECREF(dict); + } + if (meth_found) { + *method = descr; + return 1; + } + if (f != NULL) { + attr = f(descr, obj, (PyObject *)Py_TYPE(obj)); + Py_DECREF(descr); + goto try_unpack; + } + if (descr != NULL) { + *method = descr; + return 0; + } + PyErr_Format(PyExc_AttributeError, +#if PY_MAJOR_VERSION >= 3 + "'%.50s' object has no attribute '%U'", + tp->tp_name, name); +#else + "'%.50s' object has no attribute '%.400s'", + tp->tp_name, PyString_AS_STRING(name)); +#endif + return 0; +#else + attr = __Pyx_PyObject_GetAttrStr(obj, name); + goto try_unpack; +#endif +try_unpack: +#if CYTHON_UNPACK_METHODS + if (likely(attr) && PyMethod_Check(attr) && likely(PyMethod_GET_SELF(attr) == obj)) { + PyObject *function = PyMethod_GET_FUNCTION(attr); + Py_INCREF(function); + Py_DECREF(attr); + *method = function; + return 1; + } +#endif + *method = attr; + return 0; +} + +/* PyObjectCallMethod0 */ +static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) { + PyObject *method = NULL, *result = NULL; + int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method); + if (likely(is_method)) { + result = __Pyx_PyObject_CallOneArg(method, obj); + Py_DECREF(method); + return result; + } + if (unlikely(!method)) goto bad; + result = __Pyx_PyObject_CallNoArg(method); + Py_DECREF(method); +bad: + return result; +} + +/* RaiseNeedMoreValuesToUnpack */ +static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { + PyErr_Format(PyExc_ValueError, + "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack", + index, (index == 1) ? "" : "s"); +} + +/* RaiseTooManyValuesToUnpack */ +static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { + PyErr_Format(PyExc_ValueError, + "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected); +} + +/* UnpackItemEndCheck */ +static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { + if (unlikely(retval)) { + Py_DECREF(retval); + __Pyx_RaiseTooManyValuesError(expected); + return -1; + } else { + return __Pyx_IterFinish(); + } + return 0; +} + +/* RaiseNoneIterError */ +static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); +} + +/* UnpackTupleError */ +static void __Pyx_UnpackTupleError(PyObject *t, Py_ssize_t index) { + if (t == Py_None) { + __Pyx_RaiseNoneNotIterableError(); + } else if (PyTuple_GET_SIZE(t) < index) { + __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(t)); + } else { + __Pyx_RaiseTooManyValuesError(index); + } +} + +/* UnpackTuple2 */ +static CYTHON_INLINE int __Pyx_unpack_tuple2_exact( + PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2, int decref_tuple) { + PyObject *value1 = NULL, *value2 = NULL; +#if CYTHON_COMPILING_IN_PYPY + value1 = PySequence_ITEM(tuple, 0); if (unlikely(!value1)) goto bad; + value2 = PySequence_ITEM(tuple, 1); if (unlikely(!value2)) goto bad; +#else + value1 = PyTuple_GET_ITEM(tuple, 0); Py_INCREF(value1); + value2 = PyTuple_GET_ITEM(tuple, 1); Py_INCREF(value2); +#endif + if (decref_tuple) { + Py_DECREF(tuple); + } + *pvalue1 = value1; + *pvalue2 = value2; + return 0; +#if CYTHON_COMPILING_IN_PYPY +bad: + Py_XDECREF(value1); + Py_XDECREF(value2); + if (decref_tuple) { Py_XDECREF(tuple); } + return -1; +#endif +} +static int __Pyx_unpack_tuple2_generic(PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2, + int has_known_size, int decref_tuple) { + Py_ssize_t index; + PyObject *value1 = NULL, *value2 = NULL, *iter = NULL; + iternextfunc iternext; + iter = PyObject_GetIter(tuple); + if (unlikely(!iter)) goto bad; + if (decref_tuple) { Py_DECREF(tuple); tuple = NULL; } + iternext = Py_TYPE(iter)->tp_iternext; + value1 = iternext(iter); if (unlikely(!value1)) { index = 0; goto unpacking_failed; } + value2 = iternext(iter); if (unlikely(!value2)) { index = 1; goto unpacking_failed; } + if (!has_known_size && unlikely(__Pyx_IternextUnpackEndCheck(iternext(iter), 2))) goto bad; + Py_DECREF(iter); + *pvalue1 = value1; + *pvalue2 = value2; + return 0; +unpacking_failed: + if (!has_known_size && __Pyx_IterFinish() == 0) + __Pyx_RaiseNeedMoreValuesError(index); +bad: + Py_XDECREF(iter); + Py_XDECREF(value1); + Py_XDECREF(value2); + if (decref_tuple) { Py_XDECREF(tuple); } + return -1; +} + +/* dict_iter */ +static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* iterable, int is_dict, PyObject* method_name, + Py_ssize_t* p_orig_length, int* p_source_is_dict) { + is_dict = is_dict || likely(PyDict_CheckExact(iterable)); + *p_source_is_dict = is_dict; + if (is_dict) { +#if !CYTHON_COMPILING_IN_PYPY + *p_orig_length = PyDict_Size(iterable); + Py_INCREF(iterable); + return iterable; +#elif PY_MAJOR_VERSION >= 3 + static PyObject *py_items = NULL, *py_keys = NULL, *py_values = NULL; + PyObject **pp = NULL; + if (method_name) { + const char *name = PyUnicode_AsUTF8(method_name); + if (strcmp(name, "iteritems") == 0) pp = &py_items; + else if (strcmp(name, "iterkeys") == 0) pp = &py_keys; + else if (strcmp(name, "itervalues") == 0) pp = &py_values; + if (pp) { + if (!*pp) { + *pp = PyUnicode_FromString(name + 4); + if (!*pp) + return NULL; + } + method_name = *pp; + } + } +#endif + } + *p_orig_length = 0; + if (method_name) { + PyObject* iter; + iterable = __Pyx_PyObject_CallMethod0(iterable, method_name); + if (!iterable) + return NULL; +#if !CYTHON_COMPILING_IN_PYPY + if (PyTuple_CheckExact(iterable) || PyList_CheckExact(iterable)) + return iterable; +#endif + iter = PyObject_GetIter(iterable); + Py_DECREF(iterable); + return iter; + } + return PyObject_GetIter(iterable); +} +static CYTHON_INLINE int __Pyx_dict_iter_next( + PyObject* iter_obj, CYTHON_NCP_UNUSED Py_ssize_t orig_length, CYTHON_NCP_UNUSED Py_ssize_t* ppos, + PyObject** pkey, PyObject** pvalue, PyObject** pitem, int source_is_dict) { + PyObject* next_item; +#if !CYTHON_COMPILING_IN_PYPY + if (source_is_dict) { + PyObject *key, *value; + if (unlikely(orig_length != PyDict_Size(iter_obj))) { + PyErr_SetString(PyExc_RuntimeError, "dictionary changed size during iteration"); + return -1; + } + if (unlikely(!PyDict_Next(iter_obj, ppos, &key, &value))) { + return 0; + } + if (pitem) { + PyObject* tuple = PyTuple_New(2); + if (unlikely(!tuple)) { + return -1; + } + Py_INCREF(key); + Py_INCREF(value); + PyTuple_SET_ITEM(tuple, 0, key); + PyTuple_SET_ITEM(tuple, 1, value); + *pitem = tuple; + } else { + if (pkey) { + Py_INCREF(key); + *pkey = key; + } + if (pvalue) { + Py_INCREF(value); + *pvalue = value; + } + } + return 1; + } else if (PyTuple_CheckExact(iter_obj)) { + Py_ssize_t pos = *ppos; + if (unlikely(pos >= PyTuple_GET_SIZE(iter_obj))) return 0; + *ppos = pos + 1; + next_item = PyTuple_GET_ITEM(iter_obj, pos); + Py_INCREF(next_item); + } else if (PyList_CheckExact(iter_obj)) { + Py_ssize_t pos = *ppos; + if (unlikely(pos >= PyList_GET_SIZE(iter_obj))) return 0; + *ppos = pos + 1; + next_item = PyList_GET_ITEM(iter_obj, pos); + Py_INCREF(next_item); + } else +#endif + { + next_item = PyIter_Next(iter_obj); + if (unlikely(!next_item)) { + return __Pyx_IterFinish(); + } + } + if (pitem) { + *pitem = next_item; + } else if (pkey && pvalue) { + if (__Pyx_unpack_tuple2(next_item, pkey, pvalue, source_is_dict, source_is_dict, 1)) + return -1; + } else if (pkey) { + *pkey = next_item; + } else { + *pvalue = next_item; + } + return 1; +} + +/* bytes_tailmatch */ +static int __Pyx_PyBytes_SingleTailmatch(PyObject* self, PyObject* arg, + Py_ssize_t start, Py_ssize_t end, int direction) { + const char* self_ptr = PyBytes_AS_STRING(self); + Py_ssize_t self_len = PyBytes_GET_SIZE(self); + const char* sub_ptr; + Py_ssize_t sub_len; + int retval; + Py_buffer view; + view.obj = NULL; + if ( PyBytes_Check(arg) ) { + sub_ptr = PyBytes_AS_STRING(arg); + sub_len = PyBytes_GET_SIZE(arg); + } +#if PY_MAJOR_VERSION < 3 + else if ( PyUnicode_Check(arg) ) { + return (int) PyUnicode_Tailmatch(self, arg, start, end, direction); + } +#endif + else { + if (unlikely(PyObject_GetBuffer(self, &view, PyBUF_SIMPLE) == -1)) + return -1; + sub_ptr = (const char*) view.buf; + sub_len = view.len; + } + if (end > self_len) + end = self_len; + else if (end < 0) + end += self_len; + if (end < 0) + end = 0; + if (start < 0) + start += self_len; + if (start < 0) + start = 0; + if (direction > 0) { + if (end-sub_len > start) + start = end - sub_len; + } + if (start + sub_len <= end) + retval = !memcmp(self_ptr+start, sub_ptr, (size_t)sub_len); + else + retval = 0; + if (view.obj) + PyBuffer_Release(&view); + return retval; +} +static int __Pyx_PyBytes_TailmatchTuple(PyObject* self, PyObject* substrings, + Py_ssize_t start, Py_ssize_t end, int direction) { + Py_ssize_t i, count = PyTuple_GET_SIZE(substrings); + for (i = 0; i < count; i++) { + int result; +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + result = __Pyx_PyBytes_SingleTailmatch(self, PyTuple_GET_ITEM(substrings, i), + start, end, direction); +#else + PyObject* sub = PySequence_ITEM(substrings, i); + if (unlikely(!sub)) return -1; + result = __Pyx_PyBytes_SingleTailmatch(self, sub, start, end, direction); + Py_DECREF(sub); +#endif + if (result) { + return result; + } + } + return 0; +} +static int __Pyx_PyBytes_Tailmatch(PyObject* self, PyObject* substr, + Py_ssize_t start, Py_ssize_t end, int direction) { + if (unlikely(PyTuple_Check(substr))) { + return __Pyx_PyBytes_TailmatchTuple(self, substr, start, end, direction); + } + return __Pyx_PyBytes_SingleTailmatch(self, substr, start, end, direction); +} + +/* unicode_tailmatch */ +static int __Pyx_PyUnicode_TailmatchTuple(PyObject* s, PyObject* substrings, + Py_ssize_t start, Py_ssize_t end, int direction) { + Py_ssize_t i, count = PyTuple_GET_SIZE(substrings); + for (i = 0; i < count; i++) { + Py_ssize_t result; +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + result = PyUnicode_Tailmatch(s, PyTuple_GET_ITEM(substrings, i), + start, end, direction); +#else + PyObject* sub = PySequence_ITEM(substrings, i); + if (unlikely(!sub)) return -1; + result = PyUnicode_Tailmatch(s, sub, start, end, direction); + Py_DECREF(sub); +#endif + if (result) { + return (int) result; + } + } + return 0; +} +static int __Pyx_PyUnicode_Tailmatch(PyObject* s, PyObject* substr, + Py_ssize_t start, Py_ssize_t end, int direction) { + if (unlikely(PyTuple_Check(substr))) { + return __Pyx_PyUnicode_TailmatchTuple(s, substr, start, end, direction); + } + return (int) PyUnicode_Tailmatch(s, substr, start, end, direction); +} + +/* str_tailmatch */ +static CYTHON_INLINE int __Pyx_PyStr_Tailmatch(PyObject* self, PyObject* arg, Py_ssize_t start, + Py_ssize_t end, int direction) +{ + if (PY_MAJOR_VERSION < 3) + return __Pyx_PyBytes_Tailmatch(self, arg, start, end, direction); + else + return __Pyx_PyUnicode_Tailmatch(self, arg, start, end, direction); +} + +/* ExtTypeTest */ +static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { + if (unlikely(!type)) { + PyErr_SetString(PyExc_SystemError, "Missing type object"); + return 0; + } + if (likely(__Pyx_TypeCheck(obj, type))) + return 1; + PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s", + Py_TYPE(obj)->tp_name, type->tp_name); + return 0; +} + +/* UnpackUnboundCMethod */ +static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target) { + PyObject *method; + method = __Pyx_PyObject_GetAttrStr(target->type, *target->method_name); + if (unlikely(!method)) + return -1; + target->method = method; +#if CYTHON_COMPILING_IN_CPYTHON + #if PY_MAJOR_VERSION >= 3 + if (likely(__Pyx_TypeCheck(method, &PyMethodDescr_Type))) + #endif + { + PyMethodDescrObject *descr = (PyMethodDescrObject*) method; + target->func = descr->d_method->ml_meth; + target->flag = descr->d_method->ml_flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_STACKLESS); + } +#endif + return 0; +} + +/* CallUnboundCMethod1 */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg) { + if (likely(cfunc->func)) { + int flag = cfunc->flag; + if (flag == METH_O) { + return (*(cfunc->func))(self, arg); + } else if (PY_VERSION_HEX >= 0x030600B1 && flag == METH_FASTCALL) { + if (PY_VERSION_HEX >= 0x030700A0) { + return (*(__Pyx_PyCFunctionFast)(void*)(PyCFunction)cfunc->func)(self, &arg, 1); + } else { + return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, &arg, 1, NULL); + } + } else if (PY_VERSION_HEX >= 0x030700A0 && flag == (METH_FASTCALL | METH_KEYWORDS)) { + return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, &arg, 1, NULL); + } + } + return __Pyx__CallUnboundCMethod1(cfunc, self, arg); +} +#endif +static PyObject* __Pyx__CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg){ + PyObject *args, *result = NULL; + if (unlikely(!cfunc->func && !cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL; +#if CYTHON_COMPILING_IN_CPYTHON + if (cfunc->func && (cfunc->flag & METH_VARARGS)) { + args = PyTuple_New(1); + if (unlikely(!args)) goto bad; + Py_INCREF(arg); + PyTuple_SET_ITEM(args, 0, arg); + if (cfunc->flag & METH_KEYWORDS) + result = (*(PyCFunctionWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, NULL); + else + result = (*cfunc->func)(self, args); + } else { + args = PyTuple_New(2); + if (unlikely(!args)) goto bad; + Py_INCREF(self); + PyTuple_SET_ITEM(args, 0, self); + Py_INCREF(arg); + PyTuple_SET_ITEM(args, 1, arg); + result = __Pyx_PyObject_Call(cfunc->method, args, NULL); + } +#else + args = PyTuple_Pack(2, self, arg); + if (unlikely(!args)) goto bad; + result = __Pyx_PyObject_Call(cfunc->method, args, NULL); +#endif +bad: + Py_XDECREF(args); + return result; +} + +/* CallUnboundCMethod2 */ +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030600B1 +static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2) { + if (likely(cfunc->func)) { + PyObject *args[2] = {arg1, arg2}; + if (cfunc->flag == METH_FASTCALL) { + #if PY_VERSION_HEX >= 0x030700A0 + return (*(__Pyx_PyCFunctionFast)(void*)(PyCFunction)cfunc->func)(self, args, 2); + #else + return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, 2, NULL); + #endif + } + #if PY_VERSION_HEX >= 0x030700A0 + if (cfunc->flag == (METH_FASTCALL | METH_KEYWORDS)) + return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, 2, NULL); + #endif + } + return __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2); +} +#endif +static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2){ + PyObject *args, *result = NULL; + if (unlikely(!cfunc->func && !cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL; +#if CYTHON_COMPILING_IN_CPYTHON + if (cfunc->func && (cfunc->flag & METH_VARARGS)) { + args = PyTuple_New(2); + if (unlikely(!args)) goto bad; + Py_INCREF(arg1); + PyTuple_SET_ITEM(args, 0, arg1); + Py_INCREF(arg2); + PyTuple_SET_ITEM(args, 1, arg2); + if (cfunc->flag & METH_KEYWORDS) + result = (*(PyCFunctionWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, NULL); + else + result = (*cfunc->func)(self, args); + } else { + args = PyTuple_New(3); + if (unlikely(!args)) goto bad; + Py_INCREF(self); + PyTuple_SET_ITEM(args, 0, self); + Py_INCREF(arg1); + PyTuple_SET_ITEM(args, 1, arg1); + Py_INCREF(arg2); + PyTuple_SET_ITEM(args, 2, arg2); + result = __Pyx_PyObject_Call(cfunc->method, args, NULL); + } +#else + args = PyTuple_Pack(3, self, arg1, arg2); + if (unlikely(!args)) goto bad; + result = __Pyx_PyObject_Call(cfunc->method, args, NULL); +#endif +bad: + Py_XDECREF(args); + return result; +} + +/* dict_getitem_default */ +static PyObject* __Pyx_PyDict_GetItemDefault(PyObject* d, PyObject* key, PyObject* default_value) { + PyObject* value; +#if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY + value = PyDict_GetItemWithError(d, key); + if (unlikely(!value)) { + if (unlikely(PyErr_Occurred())) + return NULL; + value = default_value; + } + Py_INCREF(value); + if ((1)); +#else + if (PyString_CheckExact(key) || PyUnicode_CheckExact(key) || PyInt_CheckExact(key)) { + value = PyDict_GetItem(d, key); + if (unlikely(!value)) { + value = default_value; + } + Py_INCREF(value); + } +#endif + else { + if (default_value == Py_None) + value = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PyDict_Type_get, d, key); + else + value = __Pyx_CallUnboundCMethod2(&__pyx_umethod_PyDict_Type_get, d, key, default_value); + } + return value; +} + +/* ArgTypeTest */ +static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact) +{ + if (unlikely(!type)) { + PyErr_SetString(PyExc_SystemError, "Missing type object"); + return 0; + } + else if (exact) { + #if PY_MAJOR_VERSION == 2 + if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1; + #endif + } + else { + if (likely(__Pyx_TypeCheck(obj, type))) return 1; + } + PyErr_Format(PyExc_TypeError, + "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)", + name, type->tp_name, Py_TYPE(obj)->tp_name); + return 0; +} + +/* RaiseArgTupleInvalid */ +static void __Pyx_RaiseArgtupleInvalid( + const char* func_name, + int exact, + Py_ssize_t num_min, + Py_ssize_t num_max, + Py_ssize_t num_found) +{ + Py_ssize_t num_expected; + const char *more_or_less; + if (num_found < num_min) { + num_expected = num_min; + more_or_less = "at least"; + } else { + num_expected = num_max; + more_or_less = "at most"; + } + if (exact) { + more_or_less = "exactly"; + } + PyErr_Format(PyExc_TypeError, + "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", + func_name, more_or_less, num_expected, + (num_expected == 1) ? "" : "s", num_found); +} + +/* RaiseDoubleKeywords */ +static void __Pyx_RaiseDoubleKeywordsError( + const char* func_name, + PyObject* kw_name) +{ + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION >= 3 + "%s() got multiple values for keyword argument '%U'", func_name, kw_name); + #else + "%s() got multiple values for keyword argument '%s'", func_name, + PyString_AsString(kw_name)); + #endif +} + +/* ParseKeywords */ +static int __Pyx_ParseOptionalKeywords( + PyObject *kwds, + PyObject **argnames[], + PyObject *kwds2, + PyObject *values[], + Py_ssize_t num_pos_args, + const char* function_name) +{ + PyObject *key = 0, *value = 0; + Py_ssize_t pos = 0; + PyObject*** name; + PyObject*** first_kw_arg = argnames + num_pos_args; + while (PyDict_Next(kwds, &pos, &key, &value)) { + name = first_kw_arg; + while (*name && (**name != key)) name++; + if (*name) { + values[name-argnames] = value; + continue; + } + name = first_kw_arg; + #if PY_MAJOR_VERSION < 3 + if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) { + while (*name) { + if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) + && _PyString_Eq(**name, key)) { + values[name-argnames] = value; + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + if ((**argname == key) || ( + (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) + && _PyString_Eq(**argname, key))) { + goto arg_passed_twice; + } + argname++; + } + } + } else + #endif + if (likely(PyUnicode_Check(key))) { + while (*name) { + int cmp = (**name == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 : + #endif + PyUnicode_Compare(**name, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) { + values[name-argnames] = value; + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + int cmp = (**argname == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 : + #endif + PyUnicode_Compare(**argname, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) goto arg_passed_twice; + argname++; + } + } + } else + goto invalid_keyword_type; + if (kwds2) { + if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; + } else { + goto invalid_keyword; + } + } + return 0; +arg_passed_twice: + __Pyx_RaiseDoubleKeywordsError(function_name, key); + goto bad; +invalid_keyword_type: + PyErr_Format(PyExc_TypeError, + "%.200s() keywords must be strings", function_name); + goto bad; +invalid_keyword: + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION < 3 + "%.200s() got an unexpected keyword argument '%.200s'", + function_name, PyString_AsString(key)); + #else + "%s() got an unexpected keyword argument '%U'", + function_name, key); + #endif +bad: + return -1; +} + +/* GetTopmostException */ +#if CYTHON_USE_EXC_INFO_STACK +static _PyErr_StackItem * +__Pyx_PyErr_GetTopmostException(PyThreadState *tstate) +{ + _PyErr_StackItem *exc_info = tstate->exc_info; + while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) && + exc_info->previous_item != NULL) + { + exc_info = exc_info->previous_item; + } + return exc_info; +} +#endif + +/* SaveResetException */ +#if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { + #if CYTHON_USE_EXC_INFO_STACK + _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate); + *type = exc_info->exc_type; + *value = exc_info->exc_value; + *tb = exc_info->exc_traceback; + #else + *type = tstate->exc_type; + *value = tstate->exc_value; + *tb = tstate->exc_traceback; + #endif + Py_XINCREF(*type); + Py_XINCREF(*value); + Py_XINCREF(*tb); +} +static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + #if CYTHON_USE_EXC_INFO_STACK + _PyErr_StackItem *exc_info = tstate->exc_info; + tmp_type = exc_info->exc_type; + tmp_value = exc_info->exc_value; + tmp_tb = exc_info->exc_traceback; + exc_info->exc_type = type; + exc_info->exc_value = value; + exc_info->exc_traceback = tb; + #else + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = type; + tstate->exc_value = value; + tstate->exc_traceback = tb; + #endif + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +} +#endif + +/* PyObjectCall2Args */ +static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) { + PyObject *args, *result = NULL; + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(function)) { + PyObject *args[2] = {arg1, arg2}; + return __Pyx_PyFunction_FastCall(function, args, 2); + } + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(function)) { + PyObject *args[2] = {arg1, arg2}; + return __Pyx_PyCFunction_FastCall(function, args, 2); + } + #endif + args = PyTuple_New(2); + if (unlikely(!args)) goto done; + Py_INCREF(arg1); + PyTuple_SET_ITEM(args, 0, arg1); + Py_INCREF(arg2); + PyTuple_SET_ITEM(args, 1, arg2); + Py_INCREF(function); + result = __Pyx_PyObject_Call(function, args, NULL); + Py_DECREF(args); + Py_DECREF(function); +done: + return result; +} + +/* PyErrExceptionMatches */ +#if CYTHON_FAST_THREAD_STATE +static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { + Py_ssize_t i, n; + n = PyTuple_GET_SIZE(tuple); +#if PY_MAJOR_VERSION >= 3 + for (i=0; icurexc_type; + if (exc_type == err) return 1; + if (unlikely(!exc_type)) return 0; + if (unlikely(PyTuple_Check(err))) + return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err); + return __Pyx_PyErr_GivenExceptionMatches(exc_type, err); +} +#endif + +/* PyErrFetchRestore */ +#if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + tmp_type = tstate->curexc_type; + tmp_value = tstate->curexc_value; + tmp_tb = tstate->curexc_traceback; + tstate->curexc_type = type; + tstate->curexc_value = value; + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +} +static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { + *type = tstate->curexc_type; + *value = tstate->curexc_value; + *tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +} +#endif + +/* GetAttr */ +static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) { +#if CYTHON_USE_TYPE_SLOTS +#if PY_MAJOR_VERSION >= 3 + if (likely(PyUnicode_Check(n))) +#else + if (likely(PyString_Check(n))) +#endif + return __Pyx_PyObject_GetAttrStr(o, n); +#endif + return PyObject_GetAttr(o, n); +} + +/* GetAttr3 */ +static PyObject *__Pyx_GetAttr3Default(PyObject *d) { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) + return NULL; + __Pyx_PyErr_Clear(); + Py_INCREF(d); + return d; +} +static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) { + PyObject *r = __Pyx_GetAttr(o, n); + return (likely(r)) ? r : __Pyx_GetAttr3Default(d); +} + +/* DictGetItem */ +#if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY +static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) { + PyObject *value; + value = PyDict_GetItemWithError(d, key); + if (unlikely(!value)) { + if (!PyErr_Occurred()) { + if (unlikely(PyTuple_Check(key))) { + PyObject* args = PyTuple_Pack(1, key); + if (likely(args)) { + PyErr_SetObject(PyExc_KeyError, args); + Py_DECREF(args); + } + } else { + PyErr_SetObject(PyExc_KeyError, key); + } + } + return NULL; + } + Py_INCREF(value); + return value; +} +#endif + +/* GetException */ +#if CYTHON_FAST_THREAD_STATE +static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) +#else +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) +#endif +{ + PyObject *local_type, *local_value, *local_tb; +#if CYTHON_FAST_THREAD_STATE + PyObject *tmp_type, *tmp_value, *tmp_tb; + local_type = tstate->curexc_type; + local_value = tstate->curexc_value; + local_tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +#else + PyErr_Fetch(&local_type, &local_value, &local_tb); +#endif + PyErr_NormalizeException(&local_type, &local_value, &local_tb); +#if CYTHON_FAST_THREAD_STATE + if (unlikely(tstate->curexc_type)) +#else + if (unlikely(PyErr_Occurred())) +#endif + goto bad; + #if PY_MAJOR_VERSION >= 3 + if (local_tb) { + if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) + goto bad; + } + #endif + Py_XINCREF(local_tb); + Py_XINCREF(local_type); + Py_XINCREF(local_value); + *type = local_type; + *value = local_value; + *tb = local_tb; +#if CYTHON_FAST_THREAD_STATE + #if CYTHON_USE_EXC_INFO_STACK + { + _PyErr_StackItem *exc_info = tstate->exc_info; + tmp_type = exc_info->exc_type; + tmp_value = exc_info->exc_value; + tmp_tb = exc_info->exc_traceback; + exc_info->exc_type = local_type; + exc_info->exc_value = local_value; + exc_info->exc_traceback = local_tb; + } + #else + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = local_type; + tstate->exc_value = local_value; + tstate->exc_traceback = local_tb; + #endif + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#else + PyErr_SetExcInfo(local_type, local_value, local_tb); +#endif + return 0; +bad: + *type = 0; + *value = 0; + *tb = 0; + Py_XDECREF(local_type); + Py_XDECREF(local_value); + Py_XDECREF(local_tb); + return -1; +} + +/* KeywordStringCheck */ +static int __Pyx_CheckKeywordStrings( + PyObject *kwdict, + const char* function_name, + int kw_allowed) +{ + PyObject* key = 0; + Py_ssize_t pos = 0; +#if CYTHON_COMPILING_IN_PYPY + if (!kw_allowed && PyDict_Next(kwdict, &pos, &key, 0)) + goto invalid_keyword; + return 1; +#else + while (PyDict_Next(kwdict, &pos, &key, 0)) { + #if PY_MAJOR_VERSION < 3 + if (unlikely(!PyString_Check(key))) + #endif + if (unlikely(!PyUnicode_Check(key))) + goto invalid_keyword_type; + } + if ((!kw_allowed) && unlikely(key)) + goto invalid_keyword; + return 1; +invalid_keyword_type: + PyErr_Format(PyExc_TypeError, + "%.200s() keywords must be strings", function_name); + return 0; +#endif +invalid_keyword: + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION < 3 + "%.200s() got an unexpected keyword argument '%.200s'", + function_name, PyString_AsString(key)); + #else + "%s() got an unexpected keyword argument '%U'", + function_name, key); + #endif + return 0; +} + +/* RaiseException */ +#if PY_MAJOR_VERSION < 3 +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, + CYTHON_UNUSED PyObject *cause) { + __Pyx_PyThreadState_declare + Py_XINCREF(type); + if (!value || value == Py_None) + value = NULL; + else + Py_INCREF(value); + if (!tb || tb == Py_None) + tb = NULL; + else { + Py_INCREF(tb); + if (!PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto raise_error; + } + } + if (PyType_Check(type)) { +#if CYTHON_COMPILING_IN_PYPY + if (!value) { + Py_INCREF(Py_None); + value = Py_None; + } +#endif + PyErr_NormalizeException(&type, &value, &tb); + } else { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto raise_error; + } + value = type; + type = (PyObject*) Py_TYPE(type); + Py_INCREF(type); + if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto raise_error; + } + } + __Pyx_PyThreadState_assign + __Pyx_ErrRestore(type, value, tb); + return; +raise_error: + Py_XDECREF(value); + Py_XDECREF(type); + Py_XDECREF(tb); + return; +} +#else +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { + PyObject* owned_instance = NULL; + if (tb == Py_None) { + tb = 0; + } else if (tb && !PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto bad; + } + if (value == Py_None) + value = 0; + if (PyExceptionInstance_Check(type)) { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto bad; + } + value = type; + type = (PyObject*) Py_TYPE(value); + } else if (PyExceptionClass_Check(type)) { + PyObject *instance_class = NULL; + if (value && PyExceptionInstance_Check(value)) { + instance_class = (PyObject*) Py_TYPE(value); + if (instance_class != type) { + int is_subclass = PyObject_IsSubclass(instance_class, type); + if (!is_subclass) { + instance_class = NULL; + } else if (unlikely(is_subclass == -1)) { + goto bad; + } else { + type = instance_class; + } + } + } + if (!instance_class) { + PyObject *args; + if (!value) + args = PyTuple_New(0); + else if (PyTuple_Check(value)) { + Py_INCREF(value); + args = value; + } else + args = PyTuple_Pack(1, value); + if (!args) + goto bad; + owned_instance = PyObject_Call(type, args, NULL); + Py_DECREF(args); + if (!owned_instance) + goto bad; + value = owned_instance; + if (!PyExceptionInstance_Check(value)) { + PyErr_Format(PyExc_TypeError, + "calling %R should have returned an instance of " + "BaseException, not %R", + type, Py_TYPE(value)); + goto bad; + } + } + } else { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto bad; + } + if (cause) { + PyObject *fixed_cause; + if (cause == Py_None) { + fixed_cause = NULL; + } else if (PyExceptionClass_Check(cause)) { + fixed_cause = PyObject_CallObject(cause, NULL); + if (fixed_cause == NULL) + goto bad; + } else if (PyExceptionInstance_Check(cause)) { + fixed_cause = cause; + Py_INCREF(fixed_cause); + } else { + PyErr_SetString(PyExc_TypeError, + "exception causes must derive from " + "BaseException"); + goto bad; + } + PyException_SetCause(value, fixed_cause); + } + PyErr_SetObject(type, value); + if (tb) { +#if CYTHON_COMPILING_IN_PYPY + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); + Py_INCREF(tb); + PyErr_Restore(tmp_type, tmp_value, tb); + Py_XDECREF(tmp_tb); +#else + PyThreadState *tstate = __Pyx_PyThreadState_Current; + PyObject* tmp_tb = tstate->curexc_traceback; + if (tb != tmp_tb) { + Py_INCREF(tb); + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_tb); + } +#endif + } +bad: + Py_XDECREF(owned_instance); + return; +} +#endif + +/* pyfrozenset_new */ +static CYTHON_INLINE PyObject* __Pyx_PyFrozenSet_New(PyObject* it) { + if (it) { + PyObject* result; +#if CYTHON_COMPILING_IN_PYPY + PyObject* args; + args = PyTuple_Pack(1, it); + if (unlikely(!args)) + return NULL; + result = PyObject_Call((PyObject*)&PyFrozenSet_Type, args, NULL); + Py_DECREF(args); + return result; +#else + if (PyFrozenSet_CheckExact(it)) { + Py_INCREF(it); + return it; + } + result = PyFrozenSet_New(it); + if (unlikely(!result)) + return NULL; + if (likely(PySet_GET_SIZE(result))) + return result; + Py_DECREF(result); +#endif + } +#if CYTHON_USE_TYPE_SLOTS + return PyFrozenSet_Type.tp_new(&PyFrozenSet_Type, __pyx_empty_tuple, NULL); +#else + return PyObject_Call((PyObject*)&PyFrozenSet_Type, __pyx_empty_tuple, NULL); +#endif +} + +/* PySetContains */ +static int __Pyx_PySet_ContainsUnhashable(PyObject *set, PyObject *key) { + int result = -1; + if (PySet_Check(key) && PyErr_ExceptionMatches(PyExc_TypeError)) { + PyObject *tmpkey; + PyErr_Clear(); + tmpkey = __Pyx_PyFrozenSet_New(key); + if (tmpkey != NULL) { + result = PySet_Contains(set, tmpkey); + Py_DECREF(tmpkey); + } + } + return result; +} +static CYTHON_INLINE int __Pyx_PySet_ContainsTF(PyObject* key, PyObject* set, int eq) { + int result = PySet_Contains(set, key); + if (unlikely(result < 0)) { + result = __Pyx_PySet_ContainsUnhashable(set, key); + } + return unlikely(result < 0) ? result : (result == (eq == Py_EQ)); +} + +/* BytesEquals */ +static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { +#if CYTHON_COMPILING_IN_PYPY + return PyObject_RichCompareBool(s1, s2, equals); +#else + if (s1 == s2) { + return (equals == Py_EQ); + } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) { + const char *ps1, *ps2; + Py_ssize_t length = PyBytes_GET_SIZE(s1); + if (length != PyBytes_GET_SIZE(s2)) + return (equals == Py_NE); + ps1 = PyBytes_AS_STRING(s1); + ps2 = PyBytes_AS_STRING(s2); + if (ps1[0] != ps2[0]) { + return (equals == Py_NE); + } else if (length == 1) { + return (equals == Py_EQ); + } else { + int result; +#if CYTHON_USE_UNICODE_INTERNALS + Py_hash_t hash1, hash2; + hash1 = ((PyBytesObject*)s1)->ob_shash; + hash2 = ((PyBytesObject*)s2)->ob_shash; + if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { + return (equals == Py_NE); + } +#endif + result = memcmp(ps1, ps2, (size_t)length); + return (equals == Py_EQ) ? (result == 0) : (result != 0); + } + } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) { + return (equals == Py_NE); + } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) { + return (equals == Py_NE); + } else { + int result; + PyObject* py_result = PyObject_RichCompare(s1, s2, equals); + if (!py_result) + return -1; + result = __Pyx_PyObject_IsTrue(py_result); + Py_DECREF(py_result); + return result; + } +#endif +} + +/* UnicodeEquals */ +static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { +#if CYTHON_COMPILING_IN_PYPY + return PyObject_RichCompareBool(s1, s2, equals); +#else +#if PY_MAJOR_VERSION < 3 + PyObject* owned_ref = NULL; +#endif + int s1_is_unicode, s2_is_unicode; + if (s1 == s2) { + goto return_eq; + } + s1_is_unicode = PyUnicode_CheckExact(s1); + s2_is_unicode = PyUnicode_CheckExact(s2); +#if PY_MAJOR_VERSION < 3 + if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) { + owned_ref = PyUnicode_FromObject(s2); + if (unlikely(!owned_ref)) + return -1; + s2 = owned_ref; + s2_is_unicode = 1; + } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) { + owned_ref = PyUnicode_FromObject(s1); + if (unlikely(!owned_ref)) + return -1; + s1 = owned_ref; + s1_is_unicode = 1; + } else if (((!s2_is_unicode) & (!s1_is_unicode))) { + return __Pyx_PyBytes_Equals(s1, s2, equals); + } +#endif + if (s1_is_unicode & s2_is_unicode) { + Py_ssize_t length; + int kind; + void *data1, *data2; + if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0)) + return -1; + length = __Pyx_PyUnicode_GET_LENGTH(s1); + if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) { + goto return_ne; + } +#if CYTHON_USE_UNICODE_INTERNALS + { + Py_hash_t hash1, hash2; + #if CYTHON_PEP393_ENABLED + hash1 = ((PyASCIIObject*)s1)->hash; + hash2 = ((PyASCIIObject*)s2)->hash; + #else + hash1 = ((PyUnicodeObject*)s1)->hash; + hash2 = ((PyUnicodeObject*)s2)->hash; + #endif + if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { + goto return_ne; + } + } +#endif + kind = __Pyx_PyUnicode_KIND(s1); + if (kind != __Pyx_PyUnicode_KIND(s2)) { + goto return_ne; + } + data1 = __Pyx_PyUnicode_DATA(s1); + data2 = __Pyx_PyUnicode_DATA(s2); + if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) { + goto return_ne; + } else if (length == 1) { + goto return_eq; + } else { + int result = memcmp(data1, data2, (size_t)(length * kind)); + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_EQ) ? (result == 0) : (result != 0); + } + } else if ((s1 == Py_None) & s2_is_unicode) { + goto return_ne; + } else if ((s2 == Py_None) & s1_is_unicode) { + goto return_ne; + } else { + int result; + PyObject* py_result = PyObject_RichCompare(s1, s2, equals); + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + if (!py_result) + return -1; + result = __Pyx_PyObject_IsTrue(py_result); + Py_DECREF(py_result); + return result; + } +return_eq: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_EQ); +return_ne: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_NE); +#endif +} + +/* GetItemInt */ +static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { + PyObject *r; + if (!j) return NULL; + r = PyObject_GetItem(o, j); + Py_DECREF(j); + return r; +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, + CYTHON_NCP_UNUSED int wraparound, + CYTHON_NCP_UNUSED int boundscheck) { +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + Py_ssize_t wrapped_i = i; + if (wraparound & unlikely(i < 0)) { + wrapped_i += PyList_GET_SIZE(o); + } + if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) { + PyObject *r = PyList_GET_ITEM(o, wrapped_i); + Py_INCREF(r); + return r; + } + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +#else + return PySequence_GetItem(o, i); +#endif +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, + CYTHON_NCP_UNUSED int wraparound, + CYTHON_NCP_UNUSED int boundscheck) { +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + Py_ssize_t wrapped_i = i; + if (wraparound & unlikely(i < 0)) { + wrapped_i += PyTuple_GET_SIZE(o); + } + if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) { + PyObject *r = PyTuple_GET_ITEM(o, wrapped_i); + Py_INCREF(r); + return r; + } + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +#else + return PySequence_GetItem(o, i); +#endif +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, + CYTHON_NCP_UNUSED int wraparound, + CYTHON_NCP_UNUSED int boundscheck) { +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS + if (is_list || PyList_CheckExact(o)) { + Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); + if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) { + PyObject *r = PyList_GET_ITEM(o, n); + Py_INCREF(r); + return r; + } + } + else if (PyTuple_CheckExact(o)) { + Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o); + if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) { + PyObject *r = PyTuple_GET_ITEM(o, n); + Py_INCREF(r); + return r; + } + } else { + PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence; + if (likely(m && m->sq_item)) { + if (wraparound && unlikely(i < 0) && likely(m->sq_length)) { + Py_ssize_t l = m->sq_length(o); + if (likely(l >= 0)) { + i += l; + } else { + if (!PyErr_ExceptionMatches(PyExc_OverflowError)) + return NULL; + PyErr_Clear(); + } + } + return m->sq_item(o, i); + } + } +#else + if (is_list || PySequence_Check(o)) { + return PySequence_GetItem(o, i); + } +#endif + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +} + +/* ObjectGetItem */ +#if CYTHON_USE_TYPE_SLOTS +static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject* index) { + PyObject *runerr; + Py_ssize_t key_value; + PySequenceMethods *m = Py_TYPE(obj)->tp_as_sequence; + if (unlikely(!(m && m->sq_item))) { + PyErr_Format(PyExc_TypeError, "'%.200s' object is not subscriptable", Py_TYPE(obj)->tp_name); + return NULL; + } + key_value = __Pyx_PyIndex_AsSsize_t(index); + if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) { + return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1); + } + if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) { + PyErr_Clear(); + PyErr_Format(PyExc_IndexError, "cannot fit '%.200s' into an index-sized integer", Py_TYPE(index)->tp_name); + } + return NULL; +} +static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key) { + PyMappingMethods *m = Py_TYPE(obj)->tp_as_mapping; + if (likely(m && m->mp_subscript)) { + return m->mp_subscript(obj, key); + } + return __Pyx_PyObject_GetIndex(obj, key); +} +#endif + +/* HasAttr */ +static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) { + PyObject *r; + if (unlikely(!__Pyx_PyBaseString_Check(n))) { + PyErr_SetString(PyExc_TypeError, + "hasattr(): attribute name must be string"); + return -1; + } + r = __Pyx_GetAttr(o, n); + if (unlikely(!r)) { + PyErr_Clear(); + return 0; + } else { + Py_DECREF(r); + return 1; + } +} + +/* SliceTupleAndList */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE void __Pyx_crop_slice(Py_ssize_t* _start, Py_ssize_t* _stop, Py_ssize_t* _length) { + Py_ssize_t start = *_start, stop = *_stop, length = *_length; + if (start < 0) { + start += length; + if (start < 0) + start = 0; + } + if (stop < 0) + stop += length; + else if (stop > length) + stop = length; + *_length = stop - start; + *_start = start; + *_stop = stop; +} +static CYTHON_INLINE void __Pyx_copy_object_array(PyObject** CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length) { + PyObject *v; + Py_ssize_t i; + for (i = 0; i < length; i++) { + v = dest[i] = src[i]; + Py_INCREF(v); + } +} +static CYTHON_INLINE PyObject* __Pyx_PyList_GetSlice( + PyObject* src, Py_ssize_t start, Py_ssize_t stop) { + PyObject* dest; + Py_ssize_t length = PyList_GET_SIZE(src); + __Pyx_crop_slice(&start, &stop, &length); + if (unlikely(length <= 0)) + return PyList_New(0); + dest = PyList_New(length); + if (unlikely(!dest)) + return NULL; + __Pyx_copy_object_array( + ((PyListObject*)src)->ob_item + start, + ((PyListObject*)dest)->ob_item, + length); + return dest; +} +static CYTHON_INLINE PyObject* __Pyx_PyTuple_GetSlice( + PyObject* src, Py_ssize_t start, Py_ssize_t stop) { + PyObject* dest; + Py_ssize_t length = PyTuple_GET_SIZE(src); + __Pyx_crop_slice(&start, &stop, &length); + if (unlikely(length <= 0)) + return PyTuple_New(0); + dest = PyTuple_New(length); + if (unlikely(!dest)) + return NULL; + __Pyx_copy_object_array( + ((PyTupleObject*)src)->ob_item + start, + ((PyTupleObject*)dest)->ob_item, + length); + return dest; +} +#endif + +/* TypeImport */ +#ifndef __PYX_HAVE_RT_ImportType +#define __PYX_HAVE_RT_ImportType +static PyTypeObject *__Pyx_ImportType(PyObject *module, const char *module_name, const char *class_name, + size_t size, enum __Pyx_ImportType_CheckSize check_size) +{ + PyObject *result = 0; + char warning[200]; + Py_ssize_t basicsize; +#ifdef Py_LIMITED_API + PyObject *py_basicsize; +#endif + result = PyObject_GetAttrString(module, class_name); + if (!result) + goto bad; + if (!PyType_Check(result)) { + PyErr_Format(PyExc_TypeError, + "%.200s.%.200s is not a type object", + module_name, class_name); + goto bad; + } +#ifndef Py_LIMITED_API + basicsize = ((PyTypeObject *)result)->tp_basicsize; +#else + py_basicsize = PyObject_GetAttrString(result, "__basicsize__"); + if (!py_basicsize) + goto bad; + basicsize = PyLong_AsSsize_t(py_basicsize); + Py_DECREF(py_basicsize); + py_basicsize = 0; + if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred()) + goto bad; +#endif + if ((size_t)basicsize < size) { + PyErr_Format(PyExc_ValueError, + "%.200s.%.200s size changed, may indicate binary incompatibility. " + "Expected %zd from C header, got %zd from PyObject", + module_name, class_name, size, basicsize); + goto bad; + } + if (check_size == __Pyx_ImportType_CheckSize_Error && (size_t)basicsize != size) { + PyErr_Format(PyExc_ValueError, + "%.200s.%.200s size changed, may indicate binary incompatibility. " + "Expected %zd from C header, got %zd from PyObject", + module_name, class_name, size, basicsize); + goto bad; + } + else if (check_size == __Pyx_ImportType_CheckSize_Warn && (size_t)basicsize > size) { + PyOS_snprintf(warning, sizeof(warning), + "%s.%s size changed, may indicate binary incompatibility. " + "Expected %zd from C header, got %zd from PyObject", + module_name, class_name, size, basicsize); + if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad; + } + return (PyTypeObject *)result; +bad: + Py_XDECREF(result); + return NULL; +} +#endif + +/* PyObject_GenericGetAttrNoDict */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) { + PyErr_Format(PyExc_AttributeError, +#if PY_MAJOR_VERSION >= 3 + "'%.50s' object has no attribute '%U'", + tp->tp_name, attr_name); +#else + "'%.50s' object has no attribute '%.400s'", + tp->tp_name, PyString_AS_STRING(attr_name)); +#endif + return NULL; +} +static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) { + PyObject *descr; + PyTypeObject *tp = Py_TYPE(obj); + if (unlikely(!PyString_Check(attr_name))) { + return PyObject_GenericGetAttr(obj, attr_name); + } + assert(!tp->tp_dictoffset); + descr = _PyType_Lookup(tp, attr_name); + if (unlikely(!descr)) { + return __Pyx_RaiseGenericGetAttributeError(tp, attr_name); + } + Py_INCREF(descr); + #if PY_MAJOR_VERSION < 3 + if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS))) + #endif + { + descrgetfunc f = Py_TYPE(descr)->tp_descr_get; + if (unlikely(f)) { + PyObject *res = f(descr, obj, (PyObject *)tp); + Py_DECREF(descr); + return res; + } + } + return descr; +} +#endif + +/* SetVTable */ +static int __Pyx_SetVtable(PyObject *dict, void *vtable) { +#if PY_VERSION_HEX >= 0x02070000 + PyObject *ob = PyCapsule_New(vtable, 0, 0); +#else + PyObject *ob = PyCObject_FromVoidPtr(vtable, 0); +#endif + if (!ob) + goto bad; + if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0) + goto bad; + Py_DECREF(ob); + return 0; +bad: + Py_XDECREF(ob); + return -1; +} + +/* GetVTable */ +static void* __Pyx_GetVtable(PyObject *dict) { + void* ptr; + PyObject *ob = PyObject_GetItem(dict, __pyx_n_s_pyx_vtable); + if (!ob) + goto bad; +#if PY_VERSION_HEX >= 0x02070000 + ptr = PyCapsule_GetPointer(ob, 0); +#else + ptr = PyCObject_AsVoidPtr(ob); +#endif + if (!ptr && !PyErr_Occurred()) + PyErr_SetString(PyExc_RuntimeError, "invalid vtable found for imported type"); + Py_DECREF(ob); + return ptr; +bad: + Py_XDECREF(ob); + return NULL; +} + +/* Import */ +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { + PyObject *empty_list = 0; + PyObject *module = 0; + PyObject *global_dict = 0; + PyObject *empty_dict = 0; + PyObject *list; + #if PY_MAJOR_VERSION < 3 + PyObject *py_import; + py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); + if (!py_import) + goto bad; + #endif + if (from_list) + list = from_list; + else { + empty_list = PyList_New(0); + if (!empty_list) + goto bad; + list = empty_list; + } + global_dict = PyModule_GetDict(__pyx_m); + if (!global_dict) + goto bad; + empty_dict = PyDict_New(); + if (!empty_dict) + goto bad; + { + #if PY_MAJOR_VERSION >= 3 + if (level == -1) { + if (strchr(__Pyx_MODULE_NAME, '.')) { + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, 1); + if (!module) { + if (!PyErr_ExceptionMatches(PyExc_ImportError)) + goto bad; + PyErr_Clear(); + } + } + level = 0; + } + #endif + if (!module) { + #if PY_MAJOR_VERSION < 3 + PyObject *py_level = PyInt_FromLong(level); + if (!py_level) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, py_level, (PyObject *)NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, level); + #endif + } + } +bad: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(py_import); + #endif + Py_XDECREF(empty_list); + Py_XDECREF(empty_dict); + return module; +} + +/* ImportFrom */ +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { + PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); + if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_Format(PyExc_ImportError, + #if PY_MAJOR_VERSION < 3 + "cannot import name %.230s", PyString_AS_STRING(name)); + #else + "cannot import name %S", name); + #endif + } + return value; +} + +/* FetchCommonType */ +static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { + PyObject* fake_module; + PyTypeObject* cached_type = NULL; + fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI); + if (!fake_module) return NULL; + Py_INCREF(fake_module); + cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name); + if (cached_type) { + if (!PyType_Check((PyObject*)cached_type)) { + PyErr_Format(PyExc_TypeError, + "Shared Cython type %.200s is not a type object", + type->tp_name); + goto bad; + } + if (cached_type->tp_basicsize != type->tp_basicsize) { + PyErr_Format(PyExc_TypeError, + "Shared Cython type %.200s has the wrong size, try recompiling", + type->tp_name); + goto bad; + } + } else { + if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; + PyErr_Clear(); + if (PyType_Ready(type) < 0) goto bad; + if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0) + goto bad; + Py_INCREF(type); + cached_type = type; + } +done: + Py_DECREF(fake_module); + return cached_type; +bad: + Py_XDECREF(cached_type); + cached_type = NULL; + goto done; +} + +/* CythonFunction */ +#include +static PyObject * +__Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure) +{ + if (unlikely(op->func_doc == NULL)) { + if (op->func.m_ml->ml_doc) { +#if PY_MAJOR_VERSION >= 3 + op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc); +#else + op->func_doc = PyString_FromString(op->func.m_ml->ml_doc); +#endif + if (unlikely(op->func_doc == NULL)) + return NULL; + } else { + Py_INCREF(Py_None); + return Py_None; + } + } + Py_INCREF(op->func_doc); + return op->func_doc; +} +static int +__Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context) +{ + PyObject *tmp = op->func_doc; + if (value == NULL) { + value = Py_None; + } + Py_INCREF(value); + op->func_doc = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + if (unlikely(op->func_name == NULL)) { +#if PY_MAJOR_VERSION >= 3 + op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name); +#else + op->func_name = PyString_InternFromString(op->func.m_ml->ml_name); +#endif + if (unlikely(op->func_name == NULL)) + return NULL; + } + Py_INCREF(op->func_name); + return op->func_name; +} +static int +__Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context) +{ + PyObject *tmp; +#if PY_MAJOR_VERSION >= 3 + if (unlikely(value == NULL || !PyUnicode_Check(value))) +#else + if (unlikely(value == NULL || !PyString_Check(value))) +#endif + { + PyErr_SetString(PyExc_TypeError, + "__name__ must be set to a string object"); + return -1; + } + tmp = op->func_name; + Py_INCREF(value); + op->func_name = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + Py_INCREF(op->func_qualname); + return op->func_qualname; +} +static int +__Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context) +{ + PyObject *tmp; +#if PY_MAJOR_VERSION >= 3 + if (unlikely(value == NULL || !PyUnicode_Check(value))) +#else + if (unlikely(value == NULL || !PyString_Check(value))) +#endif + { + PyErr_SetString(PyExc_TypeError, + "__qualname__ must be set to a string object"); + return -1; + } + tmp = op->func_qualname; + Py_INCREF(value); + op->func_qualname = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED void *closure) +{ + PyObject *self; + self = m->func_closure; + if (self == NULL) + self = Py_None; + Py_INCREF(self); + return self; +} +static PyObject * +__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + if (unlikely(op->func_dict == NULL)) { + op->func_dict = PyDict_New(); + if (unlikely(op->func_dict == NULL)) + return NULL; + } + Py_INCREF(op->func_dict); + return op->func_dict; +} +static int +__Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context) +{ + PyObject *tmp; + if (unlikely(value == NULL)) { + PyErr_SetString(PyExc_TypeError, + "function's dictionary may not be deleted"); + return -1; + } + if (unlikely(!PyDict_Check(value))) { + PyErr_SetString(PyExc_TypeError, + "setting function's dictionary to a non-dict"); + return -1; + } + tmp = op->func_dict; + Py_INCREF(value); + op->func_dict = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + Py_INCREF(op->func_globals); + return op->func_globals; +} +static PyObject * +__Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + Py_INCREF(Py_None); + return Py_None; +} +static PyObject * +__Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + PyObject* result = (op->func_code) ? op->func_code : Py_None; + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { + int result = 0; + PyObject *res = op->defaults_getter((PyObject *) op); + if (unlikely(!res)) + return -1; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + op->defaults_tuple = PyTuple_GET_ITEM(res, 0); + Py_INCREF(op->defaults_tuple); + op->defaults_kwdict = PyTuple_GET_ITEM(res, 1); + Py_INCREF(op->defaults_kwdict); + #else + op->defaults_tuple = PySequence_ITEM(res, 0); + if (unlikely(!op->defaults_tuple)) result = -1; + else { + op->defaults_kwdict = PySequence_ITEM(res, 1); + if (unlikely(!op->defaults_kwdict)) result = -1; + } + #endif + Py_DECREF(res); + return result; +} +static int +__Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) { + PyObject* tmp; + if (!value) { + value = Py_None; + } else if (value != Py_None && !PyTuple_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__defaults__ must be set to a tuple object"); + return -1; + } + Py_INCREF(value); + tmp = op->defaults_tuple; + op->defaults_tuple = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) { + PyObject* result = op->defaults_tuple; + if (unlikely(!result)) { + if (op->defaults_getter) { + if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL; + result = op->defaults_tuple; + } else { + result = Py_None; + } + } + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) { + PyObject* tmp; + if (!value) { + value = Py_None; + } else if (value != Py_None && !PyDict_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__kwdefaults__ must be set to a dict object"); + return -1; + } + Py_INCREF(value); + tmp = op->defaults_kwdict; + op->defaults_kwdict = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) { + PyObject* result = op->defaults_kwdict; + if (unlikely(!result)) { + if (op->defaults_getter) { + if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL; + result = op->defaults_kwdict; + } else { + result = Py_None; + } + } + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) { + PyObject* tmp; + if (!value || value == Py_None) { + value = NULL; + } else if (!PyDict_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__annotations__ must be set to a dict object"); + return -1; + } + Py_XINCREF(value); + tmp = op->func_annotations; + op->func_annotations = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) { + PyObject* result = op->func_annotations; + if (unlikely(!result)) { + result = PyDict_New(); + if (unlikely(!result)) return NULL; + op->func_annotations = result; + } + Py_INCREF(result); + return result; +} +static PyGetSetDef __pyx_CyFunction_getsets[] = { + {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, + {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, + {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, + {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, + {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, + {(char *) "__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0}, + {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, + {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, + {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, + {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, + {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, + {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, + {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, + {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, + {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, + {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, + {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, + {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, + {0, 0, 0, 0, 0} +}; +static PyMemberDef __pyx_CyFunction_members[] = { + {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), PY_WRITE_RESTRICTED, 0}, + {0, 0, 0, 0, 0} +}; +static PyObject * +__Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args) +{ +#if PY_MAJOR_VERSION >= 3 + return PyUnicode_FromString(m->func.m_ml->ml_name); +#else + return PyString_FromString(m->func.m_ml->ml_name); +#endif +} +static PyMethodDef __pyx_CyFunction_methods[] = { + {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, + {0, 0, 0, 0} +}; +#if PY_VERSION_HEX < 0x030500A0 +#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist) +#else +#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func.m_weakreflist) +#endif +static PyObject *__Pyx_CyFunction_New(PyTypeObject *type, PyMethodDef *ml, int flags, PyObject* qualname, + PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { + __pyx_CyFunctionObject *op = PyObject_GC_New(__pyx_CyFunctionObject, type); + if (op == NULL) + return NULL; + op->flags = flags; + __Pyx_CyFunction_weakreflist(op) = NULL; + op->func.m_ml = ml; + op->func.m_self = (PyObject *) op; + Py_XINCREF(closure); + op->func_closure = closure; + Py_XINCREF(module); + op->func.m_module = module; + op->func_dict = NULL; + op->func_name = NULL; + Py_INCREF(qualname); + op->func_qualname = qualname; + op->func_doc = NULL; + op->func_classobj = NULL; + op->func_globals = globals; + Py_INCREF(op->func_globals); + Py_XINCREF(code); + op->func_code = code; + op->defaults_pyobjects = 0; + op->defaults = NULL; + op->defaults_tuple = NULL; + op->defaults_kwdict = NULL; + op->defaults_getter = NULL; + op->func_annotations = NULL; + PyObject_GC_Track(op); + return (PyObject *) op; +} +static int +__Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) +{ + Py_CLEAR(m->func_closure); + Py_CLEAR(m->func.m_module); + Py_CLEAR(m->func_dict); + Py_CLEAR(m->func_name); + Py_CLEAR(m->func_qualname); + Py_CLEAR(m->func_doc); + Py_CLEAR(m->func_globals); + Py_CLEAR(m->func_code); + Py_CLEAR(m->func_classobj); + Py_CLEAR(m->defaults_tuple); + Py_CLEAR(m->defaults_kwdict); + Py_CLEAR(m->func_annotations); + if (m->defaults) { + PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); + int i; + for (i = 0; i < m->defaults_pyobjects; i++) + Py_XDECREF(pydefaults[i]); + PyObject_Free(m->defaults); + m->defaults = NULL; + } + return 0; +} +static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m) +{ + if (__Pyx_CyFunction_weakreflist(m) != NULL) + PyObject_ClearWeakRefs((PyObject *) m); + __Pyx_CyFunction_clear(m); + PyObject_GC_Del(m); +} +static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) +{ + PyObject_GC_UnTrack(m); + __Pyx__CyFunction_dealloc(m); +} +static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) +{ + Py_VISIT(m->func_closure); + Py_VISIT(m->func.m_module); + Py_VISIT(m->func_dict); + Py_VISIT(m->func_name); + Py_VISIT(m->func_qualname); + Py_VISIT(m->func_doc); + Py_VISIT(m->func_globals); + Py_VISIT(m->func_code); + Py_VISIT(m->func_classobj); + Py_VISIT(m->defaults_tuple); + Py_VISIT(m->defaults_kwdict); + if (m->defaults) { + PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); + int i; + for (i = 0; i < m->defaults_pyobjects; i++) + Py_VISIT(pydefaults[i]); + } + return 0; +} +static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type) +{ + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) { + Py_INCREF(func); + return func; + } + if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) { + if (type == NULL) + type = (PyObject *)(Py_TYPE(obj)); + return __Pyx_PyMethod_New(func, type, (PyObject *)(Py_TYPE(type))); + } + if (obj == Py_None) + obj = NULL; + return __Pyx_PyMethod_New(func, obj, type); +} +static PyObject* +__Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) +{ +#if PY_MAJOR_VERSION >= 3 + return PyUnicode_FromFormat("", + op->func_qualname, (void *)op); +#else + return PyString_FromFormat("", + PyString_AsString(op->func_qualname), (void *)op); +#endif +} +static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) { + PyCFunctionObject* f = (PyCFunctionObject*)func; + PyCFunction meth = f->m_ml->ml_meth; + Py_ssize_t size; + switch (f->m_ml->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) { + case METH_VARARGS: + if (likely(kw == NULL || PyDict_Size(kw) == 0)) + return (*meth)(self, arg); + break; + case METH_VARARGS | METH_KEYWORDS: + return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw); + case METH_NOARGS: + if (likely(kw == NULL || PyDict_Size(kw) == 0)) { + size = PyTuple_GET_SIZE(arg); + if (likely(size == 0)) + return (*meth)(self, NULL); + PyErr_Format(PyExc_TypeError, + "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", + f->m_ml->ml_name, size); + return NULL; + } + break; + case METH_O: + if (likely(kw == NULL || PyDict_Size(kw) == 0)) { + size = PyTuple_GET_SIZE(arg); + if (likely(size == 1)) { + PyObject *result, *arg0; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + arg0 = PyTuple_GET_ITEM(arg, 0); + #else + arg0 = PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL; + #endif + result = (*meth)(self, arg0); + #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) + Py_DECREF(arg0); + #endif + return result; + } + PyErr_Format(PyExc_TypeError, + "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", + f->m_ml->ml_name, size); + return NULL; + } + break; + default: + PyErr_SetString(PyExc_SystemError, "Bad call flags in " + "__Pyx_CyFunction_Call. METH_OLDARGS is no " + "longer supported!"); + return NULL; + } + PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", + f->m_ml->ml_name); + return NULL; +} +static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { + return __Pyx_CyFunction_CallMethod(func, ((PyCFunctionObject*)func)->m_self, arg, kw); +} +static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) { + PyObject *result; + __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func; + if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { + Py_ssize_t argc; + PyObject *new_args; + PyObject *self; + argc = PyTuple_GET_SIZE(args); + new_args = PyTuple_GetSlice(args, 1, argc); + if (unlikely(!new_args)) + return NULL; + self = PyTuple_GetItem(args, 0); + if (unlikely(!self)) { + Py_DECREF(new_args); + return NULL; + } + result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw); + Py_DECREF(new_args); + } else { + result = __Pyx_CyFunction_Call(func, args, kw); + } + return result; +} +static PyTypeObject __pyx_CyFunctionType_type = { + PyVarObject_HEAD_INIT(0, 0) + "cython_function_or_method", + sizeof(__pyx_CyFunctionObject), + 0, + (destructor) __Pyx_CyFunction_dealloc, + 0, + 0, + 0, +#if PY_MAJOR_VERSION < 3 + 0, +#else + 0, +#endif + (reprfunc) __Pyx_CyFunction_repr, + 0, + 0, + 0, + 0, + __Pyx_CyFunction_CallAsMethod, + 0, + 0, + 0, + 0, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, + 0, + (traverseproc) __Pyx_CyFunction_traverse, + (inquiry) __Pyx_CyFunction_clear, + 0, +#if PY_VERSION_HEX < 0x030500A0 + offsetof(__pyx_CyFunctionObject, func_weakreflist), +#else + offsetof(PyCFunctionObject, m_weakreflist), +#endif + 0, + 0, + __pyx_CyFunction_methods, + __pyx_CyFunction_members, + __pyx_CyFunction_getsets, + 0, + 0, + __Pyx_CyFunction_descr_get, + 0, + offsetof(__pyx_CyFunctionObject, func_dict), + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, +#if PY_VERSION_HEX >= 0x030400a1 + 0, +#endif +}; +static int __pyx_CyFunction_init(void) { + __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); + if (unlikely(__pyx_CyFunctionType == NULL)) { + return -1; + } + return 0; +} +static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults = PyObject_Malloc(size); + if (unlikely(!m->defaults)) + return PyErr_NoMemory(); + memset(m->defaults, 0, size); + m->defaults_pyobjects = pyobjects; + return m->defaults; +} +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults_tuple = tuple; + Py_INCREF(tuple); +} +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults_kwdict = dict; + Py_INCREF(dict); +} +static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->func_annotations = dict; + Py_INCREF(dict); +} + +/* PyObjectSetAttrStr */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) { + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_setattro)) + return tp->tp_setattro(obj, attr_name, value); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_setattr)) + return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value); +#endif + return PyObject_SetAttr(obj, attr_name, value); +} +#endif + +/* GetModuleGlobalName */ +#if CYTHON_USE_DICT_VERSIONS +static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value) +#else +static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) +#endif +{ + PyObject *result; +#if !CYTHON_AVOID_BORROWED_REFS +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 + result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } else if (unlikely(PyErr_Occurred())) { + return NULL; + } +#else + result = PyDict_GetItem(__pyx_d, name); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } +#endif +#else + result = PyObject_GetItem(__pyx_d, name); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } + PyErr_Clear(); +#endif + return __Pyx_GetBuiltinName(name); +} + +/* Globals */ +static PyObject* __Pyx_Globals(void) { + Py_ssize_t i; + PyObject *names; + PyObject *globals = __pyx_d; + Py_INCREF(globals); + names = PyObject_Dir(__pyx_m); + if (!names) + goto bad; + for (i = PyList_GET_SIZE(names)-1; i >= 0; i--) { +#if CYTHON_COMPILING_IN_PYPY + PyObject* name = PySequence_ITEM(names, i); + if (!name) + goto bad; +#else + PyObject* name = PyList_GET_ITEM(names, i); +#endif + if (!PyDict_Contains(globals, name)) { + PyObject* value = __Pyx_GetAttr(__pyx_m, name); + if (!value) { +#if CYTHON_COMPILING_IN_PYPY + Py_DECREF(name); +#endif + goto bad; + } + if (PyDict_SetItem(globals, name, value) < 0) { +#if CYTHON_COMPILING_IN_PYPY + Py_DECREF(name); +#endif + Py_DECREF(value); + goto bad; + } + } +#if CYTHON_COMPILING_IN_PYPY + Py_DECREF(name); +#endif + } + Py_DECREF(names); + return globals; +bad: + Py_XDECREF(names); + Py_XDECREF(globals); + return NULL; +} + +/* CLineInTraceback */ +#ifndef CYTHON_CLINE_IN_TRACEBACK +static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { + PyObject *use_cline; + PyObject *ptype, *pvalue, *ptraceback; +#if CYTHON_COMPILING_IN_CPYTHON + PyObject **cython_runtime_dict; +#endif + if (unlikely(!__pyx_cython_runtime)) { + return c_line; + } + __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); +#if CYTHON_COMPILING_IN_CPYTHON + cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); + if (likely(cython_runtime_dict)) { + __PYX_PY_DICT_LOOKUP_IF_MODIFIED( + use_cline, *cython_runtime_dict, + __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback)) + } else +#endif + { + PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback); + if (use_cline_obj) { + use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; + Py_DECREF(use_cline_obj); + } else { + PyErr_Clear(); + use_cline = NULL; + } + } + if (!use_cline) { + c_line = 0; + PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); + } + else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { + c_line = 0; + } + __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); + return c_line; +} +#endif + +/* CodeObjectCache */ +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { + int start = 0, mid = 0, end = count - 1; + if (end >= 0 && code_line > entries[end].code_line) { + return count; + } + while (start < end) { + mid = start + (end - start) / 2; + if (code_line < entries[mid].code_line) { + end = mid; + } else if (code_line > entries[mid].code_line) { + start = mid + 1; + } else { + return mid; + } + } + if (code_line <= entries[mid].code_line) { + return mid; + } else { + return mid + 1; + } +} +static PyCodeObject *__pyx_find_code_object(int code_line) { + PyCodeObject* code_object; + int pos; + if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { + return NULL; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { + return NULL; + } + code_object = __pyx_code_cache.entries[pos].code_object; + Py_INCREF(code_object); + return code_object; +} +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { + int pos, i; + __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; + if (unlikely(!code_line)) { + return; + } + if (unlikely(!entries)) { + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); + if (likely(entries)) { + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = 64; + __pyx_code_cache.count = 1; + entries[0].code_line = code_line; + entries[0].code_object = code_object; + Py_INCREF(code_object); + } + return; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { + PyCodeObject* tmp = entries[pos].code_object; + entries[pos].code_object = code_object; + Py_DECREF(tmp); + return; + } + if (__pyx_code_cache.count == __pyx_code_cache.max_count) { + int new_max = __pyx_code_cache.max_count + 64; + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( + __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry)); + if (unlikely(!entries)) { + return; + } + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = new_max; + } + for (i=__pyx_code_cache.count; i>pos; i--) { + entries[i] = entries[i-1]; + } + entries[pos].code_line = code_line; + entries[pos].code_object = code_object; + __pyx_code_cache.count++; + Py_INCREF(code_object); +} + +/* AddTraceback */ +#include "compile.h" +#include "frameobject.h" +#include "traceback.h" +static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( + const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyObject *py_srcfile = 0; + PyObject *py_funcname = 0; + #if PY_MAJOR_VERSION < 3 + py_srcfile = PyString_FromString(filename); + #else + py_srcfile = PyUnicode_FromString(filename); + #endif + if (!py_srcfile) goto bad; + if (c_line) { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + #else + py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + #endif + } + else { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromString(funcname); + #else + py_funcname = PyUnicode_FromString(funcname); + #endif + } + if (!py_funcname) goto bad; + py_code = __Pyx_PyCode_New( + 0, + 0, + 0, + 0, + 0, + __pyx_empty_bytes, /*PyObject *code,*/ + __pyx_empty_tuple, /*PyObject *consts,*/ + __pyx_empty_tuple, /*PyObject *names,*/ + __pyx_empty_tuple, /*PyObject *varnames,*/ + __pyx_empty_tuple, /*PyObject *freevars,*/ + __pyx_empty_tuple, /*PyObject *cellvars,*/ + py_srcfile, /*PyObject *filename,*/ + py_funcname, /*PyObject *name,*/ + py_line, + __pyx_empty_bytes /*PyObject *lnotab*/ + ); + Py_DECREF(py_srcfile); + Py_DECREF(py_funcname); + return py_code; +bad: + Py_XDECREF(py_srcfile); + Py_XDECREF(py_funcname); + return NULL; +} +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyFrameObject *py_frame = 0; + PyThreadState *tstate = __Pyx_PyThreadState_Current; + if (c_line) { + c_line = __Pyx_CLineForTraceback(tstate, c_line); + } + py_code = __pyx_find_code_object(c_line ? -c_line : py_line); + if (!py_code) { + py_code = __Pyx_CreateCodeObjectForTraceback( + funcname, c_line, py_line, filename); + if (!py_code) goto bad; + __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); + } + py_frame = PyFrame_New( + tstate, /*PyThreadState *tstate,*/ + py_code, /*PyCodeObject *code,*/ + __pyx_d, /*PyObject *globals,*/ + 0 /*PyObject *locals*/ + ); + if (!py_frame) goto bad; + __Pyx_PyFrame_SetLineNumber(py_frame, py_line); + PyTraceBack_Here(py_frame); +bad: + Py_XDECREF(py_code); + Py_XDECREF(py_frame); +} + +/* CIntToPy */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { + const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(long) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(long) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(long) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(long), + little, !is_unsigned); + } +} + +/* CIntFromPyVerify */ +#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ + __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) +#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ + __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) +#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ + {\ + func_type value = func_value;\ + if (sizeof(target_type) < sizeof(func_type)) {\ + if (unlikely(value != (func_type) (target_type) value)) {\ + func_type zero = 0;\ + if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ + return (target_type) -1;\ + if (is_unsigned && unlikely(value < zero))\ + goto raise_neg_overflow;\ + else\ + goto raise_overflow;\ + }\ + }\ + return (target_type) value;\ + } + +/* CIntFromPy */ +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { + const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(long) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (long) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (long) 0; + case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0]) + case 2: + if (8 * sizeof(long) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) { + return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + case 3: + if (8 * sizeof(long) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) { + return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + case 4: + if (8 * sizeof(long) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) { + return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (long) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if (sizeof(long) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (long) 0; + case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0])) + case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0]) + case -2: + if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 2: + if (8 * sizeof(long) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case -3: + if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 3: + if (8 * sizeof(long) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case -4: + if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 4: + if (8 * sizeof(long) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + } +#endif + if (sizeof(long) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + long val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (long) -1; + } + } else { + long val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (long) -1; + val = __Pyx_PyInt_As_long(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to long"); + return (long) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to long"); + return (long) -1; +} + +/* CIntFromPy */ +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { + const int neg_one = (int) ((int) 0 - (int) 1), const_zero = (int) 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(int) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (int) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (int) 0; + case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0]) + case 2: + if (8 * sizeof(int) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) { + return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + case 3: + if (8 * sizeof(int) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) { + return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + case 4: + if (8 * sizeof(int) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) { + return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (int) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if (sizeof(int) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (int) 0; + case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0])) + case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0]) + case -2: + if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { + return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 2: + if (8 * sizeof(int) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { + return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case -3: + if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { + return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 3: + if (8 * sizeof(int) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { + return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case -4: + if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { + return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 4: + if (8 * sizeof(int) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { + return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + } +#endif + if (sizeof(int) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + int val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (int) -1; + } + } else { + int val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (int) -1; + val = __Pyx_PyInt_As_int(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to int"); + return (int) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to int"); + return (int) -1; +} + +/* FastTypeChecks */ +#if CYTHON_COMPILING_IN_CPYTHON +static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) { + while (a) { + a = a->tp_base; + if (a == b) + return 1; + } + return b == &PyBaseObject_Type; +} +static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) { + PyObject *mro; + if (a == b) return 1; + mro = a->tp_mro; + if (likely(mro)) { + Py_ssize_t i, n; + n = PyTuple_GET_SIZE(mro); + for (i = 0; i < n; i++) { + if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b) + return 1; + } + return 0; + } + return __Pyx_InBases(a, b); +} +#if PY_MAJOR_VERSION == 2 +static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { + PyObject *exception, *value, *tb; + int res; + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ErrFetch(&exception, &value, &tb); + res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; + if (unlikely(res == -1)) { + PyErr_WriteUnraisable(err); + res = 0; + } + if (!res) { + res = PyObject_IsSubclass(err, exc_type2); + if (unlikely(res == -1)) { + PyErr_WriteUnraisable(err); + res = 0; + } + } + __Pyx_ErrRestore(exception, value, tb); + return res; +} +#else +static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { + int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0; + if (!res) { + res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); + } + return res; +} +#endif +static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { + Py_ssize_t i, n; + assert(PyExceptionClass_Check(exc_type)); + n = PyTuple_GET_SIZE(tuple); +#if PY_MAJOR_VERSION >= 3 + for (i=0; i= 0x02070000 + cobj = PyCapsule_New(p, sig, 0); +#else + cobj = PyCObject_FromVoidPtrAndDesc(p, (void *)sig, 0); +#endif + if (!cobj) + goto bad; + if (PyDict_SetItem(d, name, cobj) < 0) + goto bad; + Py_DECREF(cobj); + Py_DECREF(d); + return 0; +bad: + Py_XDECREF(cobj); + Py_XDECREF(d); + return -1; +} + +/* FunctionExport */ +static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig) { + PyObject *d = 0; + PyObject *cobj = 0; + union { + void (*fp)(void); + void *p; + } tmp; + d = PyObject_GetAttrString(__pyx_m, (char *)"__pyx_capi__"); + if (!d) { + PyErr_Clear(); + d = PyDict_New(); + if (!d) + goto bad; + Py_INCREF(d); + if (PyModule_AddObject(__pyx_m, (char *)"__pyx_capi__", d) < 0) + goto bad; + } + tmp.fp = f; +#if PY_VERSION_HEX >= 0x02070000 + cobj = PyCapsule_New(tmp.p, sig, 0); +#else + cobj = PyCObject_FromVoidPtrAndDesc(tmp.p, (void *)sig, 0); +#endif + if (!cobj) + goto bad; + if (PyDict_SetItemString(d, name, cobj) < 0) + goto bad; + Py_DECREF(cobj); + Py_DECREF(d); + return 0; +bad: + Py_XDECREF(cobj); + Py_XDECREF(d); + return -1; +} + +/* VoidPtrImport */ +#ifndef __PYX_HAVE_RT_ImportVoidPtr +#define __PYX_HAVE_RT_ImportVoidPtr +static int __Pyx_ImportVoidPtr(PyObject *module, const char *name, void **p, const char *sig) { + PyObject *d = 0; + PyObject *cobj = 0; + d = PyObject_GetAttrString(module, (char *)"__pyx_capi__"); + if (!d) + goto bad; + cobj = PyDict_GetItemString(d, name); + if (!cobj) { + PyErr_Format(PyExc_ImportError, + "%.200s does not export expected C variable %.200s", + PyModule_GetName(module), name); + goto bad; + } +#if PY_VERSION_HEX >= 0x02070000 + if (!PyCapsule_IsValid(cobj, sig)) { + PyErr_Format(PyExc_TypeError, + "C variable %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", + PyModule_GetName(module), name, sig, PyCapsule_GetName(cobj)); + goto bad; + } + *p = PyCapsule_GetPointer(cobj, sig); +#else + {const char *desc, *s1, *s2; + desc = (const char *)PyCObject_GetDesc(cobj); + if (!desc) + goto bad; + s1 = desc; s2 = sig; + while (*s1 != '\0' && *s1 == *s2) { s1++; s2++; } + if (*s1 != *s2) { + PyErr_Format(PyExc_TypeError, + "C variable %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", + PyModule_GetName(module), name, sig, desc); + goto bad; + } + *p = PyCObject_AsVoidPtr(cobj);} +#endif + if (!(*p)) + goto bad; + Py_DECREF(d); + return 0; +bad: + Py_XDECREF(d); + return -1; +} +#endif + +/* FunctionImport */ +#ifndef __PYX_HAVE_RT_ImportFunction +#define __PYX_HAVE_RT_ImportFunction +static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig) { + PyObject *d = 0; + PyObject *cobj = 0; + union { + void (*fp)(void); + void *p; + } tmp; + d = PyObject_GetAttrString(module, (char *)"__pyx_capi__"); + if (!d) + goto bad; + cobj = PyDict_GetItemString(d, funcname); + if (!cobj) { + PyErr_Format(PyExc_ImportError, + "%.200s does not export expected C function %.200s", + PyModule_GetName(module), funcname); + goto bad; + } +#if PY_VERSION_HEX >= 0x02070000 + if (!PyCapsule_IsValid(cobj, sig)) { + PyErr_Format(PyExc_TypeError, + "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", + PyModule_GetName(module), funcname, sig, PyCapsule_GetName(cobj)); + goto bad; + } + tmp.p = PyCapsule_GetPointer(cobj, sig); +#else + {const char *desc, *s1, *s2; + desc = (const char *)PyCObject_GetDesc(cobj); + if (!desc) + goto bad; + s1 = desc; s2 = sig; + while (*s1 != '\0' && *s1 == *s2) { s1++; s2++; } + if (*s1 != *s2) { + PyErr_Format(PyExc_TypeError, + "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", + PyModule_GetName(module), funcname, sig, desc); + goto bad; + } + tmp.p = PyCObject_AsVoidPtr(cobj);} +#endif + *f = tmp.fp; + if (!(*f)) + goto bad; + Py_DECREF(d); + return 0; +bad: + Py_XDECREF(d); + return -1; +} +#endif + +/* InitStrings */ +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { + while (t->p) { + #if PY_MAJOR_VERSION < 3 + if (t->is_unicode) { + *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); + } else if (t->intern) { + *t->p = PyString_InternFromString(t->s); + } else { + *t->p = PyString_FromStringAndSize(t->s, t->n - 1); + } + #else + if (t->is_unicode | t->is_str) { + if (t->intern) { + *t->p = PyUnicode_InternFromString(t->s); + } else if (t->encoding) { + *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); + } else { + *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); + } + } else { + *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); + } + #endif + if (!*t->p) + return -1; + if (PyObject_Hash(*t->p) == -1) + return -1; + ++t; + } + return 0; +} + +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { + return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); +} +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { + Py_ssize_t ignore; + return __Pyx_PyObject_AsStringAndSize(o, &ignore); +} +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +#if !CYTHON_PEP393_ENABLED +static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { + char* defenc_c; + PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); + if (!defenc) return NULL; + defenc_c = PyBytes_AS_STRING(defenc); +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + { + char* end = defenc_c + PyBytes_GET_SIZE(defenc); + char* c; + for (c = defenc_c; c < end; c++) { + if ((unsigned char) (*c) >= 128) { + PyUnicode_AsASCIIString(o); + return NULL; + } + } + } +#endif + *length = PyBytes_GET_SIZE(defenc); + return defenc_c; +} +#else +static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { + if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + if (likely(PyUnicode_IS_ASCII(o))) { + *length = PyUnicode_GET_LENGTH(o); + return PyUnicode_AsUTF8(o); + } else { + PyUnicode_AsASCIIString(o); + return NULL; + } +#else + return PyUnicode_AsUTF8AndSize(o, length); +#endif +} +#endif +#endif +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT + if ( +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + __Pyx_sys_getdefaultencoding_not_ascii && +#endif + PyUnicode_Check(o)) { + return __Pyx_PyUnicode_AsStringAndSize(o, length); + } else +#endif +#if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) + if (PyByteArray_Check(o)) { + *length = PyByteArray_GET_SIZE(o); + return PyByteArray_AS_STRING(o); + } else +#endif + { + char* result; + int r = PyBytes_AsStringAndSize(o, &result, length); + if (unlikely(r < 0)) { + return NULL; + } else { + return result; + } + } +} +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { + int is_true = x == Py_True; + if (is_true | (x == Py_False) | (x == Py_None)) return is_true; + else return PyObject_IsTrue(x); +} +static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) { + int retval; + if (unlikely(!x)) return -1; + retval = __Pyx_PyObject_IsTrue(x); + Py_DECREF(x); + return retval; +} +static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) { +#if PY_MAJOR_VERSION >= 3 + if (PyLong_Check(result)) { + if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, + "__int__ returned non-int (type %.200s). " + "The ability to return an instance of a strict subclass of int " + "is deprecated, and may be removed in a future version of Python.", + Py_TYPE(result)->tp_name)) { + Py_DECREF(result); + return NULL; + } + return result; + } +#endif + PyErr_Format(PyExc_TypeError, + "__%.4s__ returned non-%.4s (type %.200s)", + type_name, type_name, Py_TYPE(result)->tp_name); + Py_DECREF(result); + return NULL; +} +static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { +#if CYTHON_USE_TYPE_SLOTS + PyNumberMethods *m; +#endif + const char *name = NULL; + PyObject *res = NULL; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x) || PyLong_Check(x))) +#else + if (likely(PyLong_Check(x))) +#endif + return __Pyx_NewRef(x); +#if CYTHON_USE_TYPE_SLOTS + m = Py_TYPE(x)->tp_as_number; + #if PY_MAJOR_VERSION < 3 + if (m && m->nb_int) { + name = "int"; + res = m->nb_int(x); + } + else if (m && m->nb_long) { + name = "long"; + res = m->nb_long(x); + } + #else + if (likely(m && m->nb_int)) { + name = "int"; + res = m->nb_int(x); + } + #endif +#else + if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { + res = PyNumber_Int(x); + } +#endif + if (likely(res)) { +#if PY_MAJOR_VERSION < 3 + if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) { +#else + if (unlikely(!PyLong_CheckExact(res))) { +#endif + return __Pyx_PyNumber_IntOrLongWrongResultType(res, name); + } + } + else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_TypeError, + "an integer is required"); + } + return res; +} +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { + Py_ssize_t ival; + PyObject *x; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_CheckExact(b))) { + if (sizeof(Py_ssize_t) >= sizeof(long)) + return PyInt_AS_LONG(b); + else + return PyInt_AsSsize_t(b); + } +#endif + if (likely(PyLong_CheckExact(b))) { + #if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)b)->ob_digit; + const Py_ssize_t size = Py_SIZE(b); + if (likely(__Pyx_sst_abs(size) <= 1)) { + ival = likely(size) ? digits[0] : 0; + if (size == -1) ival = -ival; + return ival; + } else { + switch (size) { + case 2: + if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { + return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -2: + if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case 3: + if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { + return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -3: + if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case 4: + if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { + return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -4: + if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + } + } + #endif + return PyLong_AsSsize_t(b); + } + x = PyNumber_Index(b); + if (!x) return -1; + ival = PyInt_AsSsize_t(x); + Py_DECREF(x); + return ival; +} +static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) { + return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False); +} +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { + return PyInt_FromSize_t(ival); +} + + +#endif /* Py_PYTHON_H */ diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/local.html b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/local.html new file mode 100644 index 00000000..6bf32d55 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/local.html @@ -0,0 +1,4282 @@ + + + + + + Cython: local.py + + + +

Generated by Cython 0.29.2

+

+ Yellow lines hint at Python interaction.
+ Click on a line that starts with a "+" to see the C code that Cython generated for it. +

+

Raw output: local.c

+
+001: # cython: auto_pickle=False,embedsignature=True,always_allow_keywords=False
+
  __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 002: """
+
 003: Greenlet-local objects.
+
 004: 
+
 005: This module is based on `_threading_local.py`__ from the standard
+
 006: library of Python 3.4.
+
 007: 
+
 008: __ https://github.com/python/cpython/blob/3.4/Lib/_threading_local.py
+
 009: 
+
 010: Greenlet-local objects support the management of greenlet-local data.
+
 011: If you have data that you want to be local to a greenlet, simply create
+
 012: a greenlet-local object and use its attributes:
+
 013: 
+
 014:   >>> mydata = local()
+
 015:   >>> mydata.number = 42
+
 016:   >>> mydata.number
+
 017:   42
+
 018: 
+
 019: You can also access the local-object's dictionary:
+
 020: 
+
 021:   >>> mydata.__dict__
+
 022:   {'number': 42}
+
 023:   >>> mydata.__dict__.setdefault('widgets', [])
+
 024:   []
+
 025:   >>> mydata.widgets
+
 026:   []
+
 027: 
+
 028: What's important about greenlet-local objects is that their data are
+
 029: local to a greenlet. If we access the data in a different greenlet:
+
 030: 
+
 031:   >>> log = []
+
 032:   >>> def f():
+
 033:   ...     items = list(mydata.__dict__.items())
+
 034:   ...     items.sort()
+
 035:   ...     log.append(items)
+
 036:   ...     mydata.number = 11
+
 037:   ...     log.append(mydata.number)
+
 038:   >>> greenlet = gevent.spawn(f)
+
 039:   >>> greenlet.join()
+
 040:   >>> log
+
 041:   [[], 11]
+
 042: 
+
 043: we get different data.  Furthermore, changes made in the other greenlet
+
 044: don't affect data seen in this greenlet:
+
 045: 
+
 046:   >>> mydata.number
+
 047:   42
+
 048: 
+
 049: Of course, values you get from a local object, including a __dict__
+
 050: attribute, are for whatever greenlet was current at the time the
+
 051: attribute was read.  For that reason, you generally don't want to save
+
 052: these values across greenlets, as they apply only to the greenlet they
+
 053: came from.
+
 054: 
+
 055: You can create custom local objects by subclassing the local class:
+
 056: 
+
 057:   >>> class MyLocal(local):
+
 058:   ...     number = 2
+
 059:   ...     initialized = False
+
 060:   ...     def __init__(self, **kw):
+
 061:   ...         if self.initialized:
+
 062:   ...             raise SystemError('__init__ called too many times')
+
 063:   ...         self.initialized = True
+
 064:   ...         self.__dict__.update(kw)
+
 065:   ...     def squared(self):
+
 066:   ...         return self.number ** 2
+
 067: 
+
 068: This can be useful to support default values, methods and
+
 069: initialization.  Note that if you define an __init__ method, it will be
+
 070: called each time the local object is used in a separate greenlet.  This
+
 071: is necessary to initialize each greenlet's dictionary.
+
 072: 
+
 073: Now if we create a local object:
+
 074: 
+
 075:   >>> mydata = MyLocal(color='red')
+
 076: 
+
 077: Now we have a default number:
+
 078: 
+
 079:   >>> mydata.number
+
 080:   2
+
 081: 
+
 082: an initial color:
+
 083: 
+
 084:   >>> mydata.color
+
 085:   'red'
+
 086:   >>> del mydata.color
+
 087: 
+
 088: And a method that operates on the data:
+
 089: 
+
 090:   >>> mydata.squared()
+
 091:   4
+
 092: 
+
 093: As before, we can access the data in a separate greenlet:
+
 094: 
+
 095:   >>> log = []
+
 096:   >>> greenlet = gevent.spawn(f)
+
 097:   >>> greenlet.join()
+
 098:   >>> log
+
 099:   [[('color', 'red'), ('initialized', True)], 11]
+
 100: 
+
 101: without affecting this greenlet's data:
+
 102: 
+
 103:   >>> mydata.number
+
 104:   2
+
 105:   >>> mydata.color
+
 106:   Traceback (most recent call last):
+
 107:   ...
+
 108:   AttributeError: 'MyLocal' object has no attribute 'color'
+
 109: 
+
 110: Note that subclasses can define slots, but they are not greenlet
+
 111: local. They are shared across greenlets::
+
 112: 
+
 113:   >>> class MyLocal(local):
+
 114:   ...     __slots__ = 'number'
+
 115: 
+
 116:   >>> mydata = MyLocal()
+
 117:   >>> mydata.number = 42
+
 118:   >>> mydata.color = 'red'
+
 119: 
+
 120: So, the separate greenlet:
+
 121: 
+
 122:   >>> greenlet = gevent.spawn(f)
+
 123:   >>> greenlet.join()
+
 124: 
+
 125: affects what we see:
+
 126: 
+
 127:   >>> mydata.number
+
 128:   11
+
 129: 
+
 130: >>> del mydata
+
 131: 
+
 132: .. versionchanged:: 1.1a2
+
 133:    Update the implementation to match Python 3.4 instead of Python 2.5.
+
 134:    This results in locals being eligible for garbage collection as soon
+
 135:    as their greenlet exits.
+
 136: 
+
 137: .. versionchanged:: 1.2.3
+
 138:    Use a weak-reference to clear the greenlet link we establish in case
+
 139:    the local object dies before the greenlet does.
+
 140: 
+
 141: .. versionchanged:: 1.3a1
+
 142:    Implement the methods for attribute access directly, handling
+
 143:    descriptors directly here. This allows removing the use of a lock
+
 144:    and facilitates greatly improved performance.
+
 145: 
+
 146: .. versionchanged:: 1.3a1
+
 147:    The ``__init__`` method of subclasses of ``local`` is no longer
+
 148:    called with a lock held. CPython does not use such a lock in its
+
 149:    native implementation. This could potentially show as a difference
+
 150:    if code that uses multiple dependent attributes in ``__slots__``
+
 151:    (which are shared across all greenlets) switches during ``__init__``.
+
 152: 
+
 153: """
+
 154: from __future__ import print_function
+
 155: 
+
+156: from copy import copy
+
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 156, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(__pyx_n_s_copy_2);
+  __Pyx_GIVEREF(__pyx_n_s_copy_2);
+  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_copy_2);
+  __pyx_t_2 = __Pyx_Import(__pyx_n_s_copy_2, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 156, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_copy_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 156, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(__pyx_t_1);
+  __Pyx_XGOTREF(__pyx_v_6gevent_6_local_copy);
+  __Pyx_DECREF_SET(__pyx_v_6gevent_6_local_copy, __pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+157: from weakref import ref
+
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 157, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_ref);
+  __Pyx_GIVEREF(__pyx_n_s_ref);
+  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_ref);
+  __pyx_t_1 = __Pyx_Import(__pyx_n_s_weakref, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 157, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_ref); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 157, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(__pyx_t_2);
+  __Pyx_XGOTREF(__pyx_v_6gevent_6_local_ref);
+  __Pyx_DECREF_SET(__pyx_v_6gevent_6_local_ref, __pyx_t_2);
+  __Pyx_GIVEREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 158: 
+
 159: 
+
+160: locals()['getcurrent'] = __import__('greenlet').getcurrent
+
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin___import__, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 160, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_getcurrent); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 160, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_1 = __Pyx_Globals(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 160, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (unlikely(PyDict_SetItem(__pyx_t_1, __pyx_n_s_getcurrent, __pyx_t_2) < 0)) __PYX_ERR(0, 160, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+/* … */
+  __pyx_tuple_ = PyTuple_Pack(1, __pyx_n_s_greenlet); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 160, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple_);
+  __Pyx_GIVEREF(__pyx_tuple_);
+
+161: locals()['greenlet_init'] = lambda: None
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_local_4lambda(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyMethodDef __pyx_mdef_6gevent_6_local_4lambda = {"lambda", (PyCFunction)__pyx_pw_6gevent_6_local_4lambda, METH_NOARGS, 0};
+static PyObject *__pyx_pw_6gevent_6_local_4lambda(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("lambda (wrapper)", 0);
+  __pyx_r = __pyx_lambda_funcdef_6gevent_6_local_lambda(__pyx_self);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_lambda_funcdef_6gevent_6_local_lambda(CYTHON_UNUSED PyObject *__pyx_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("lambda", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_local_4lambda, 0, __pyx_n_s_lambda, NULL, __pyx_n_s_gevent__local, __pyx_d, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 161, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_1 = __Pyx_Globals(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 161, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (unlikely(PyDict_SetItem(__pyx_t_1, __pyx_n_s_greenlet_init, __pyx_t_2) < 0)) __PYX_ERR(0, 161, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
 162: 
+
+163: __all__ = [
+
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 163, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_local);
+  __Pyx_GIVEREF(__pyx_n_s_local);
+  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_local);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_all, __pyx_t_2) < 0) __PYX_ERR(0, 163, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
 164:     "local",
+
 165: ]
+
 166: 
+
 167: # The key used in the Thread objects' attribute dicts.
+
 168: # We keep it a string for speed but make it unlikely to clash with
+
 169: # a "real" attribute.
+
+170: key_prefix = '_gevent_local_localimpl_'
+
  __Pyx_INCREF(__pyx_n_s_gevent_local_localimpl);
+  __Pyx_XGOTREF(__pyx_v_6gevent_6_local_key_prefix);
+  __Pyx_DECREF_SET(__pyx_v_6gevent_6_local_key_prefix, __pyx_n_s_gevent_local_localimpl);
+  __Pyx_GIVEREF(__pyx_n_s_gevent_local_localimpl);
+
 171: 
+
 172: # The overall structure is as follows:
+
 173: # For each local() object:
+
 174: # greenlet.__dict__[key_prefix + str(id(local))]
+
 175: #    => _localimpl.dicts[id(greenlet)] => (ref(greenlet), {})
+
 176: 
+
 177: # That final tuple is actually a localimpl_dict_entry object.
+
 178: 
+
+179: def all_local_dicts_for_greenlet(greenlet):
+
static PyObject *__pyx_pw_6gevent_6_local_1all_local_dicts_for_greenlet(PyObject *__pyx_self, PyObject *__pyx_v_greenlet); /*proto*/
+static PyObject *__pyx_f_6gevent_6_local_all_local_dicts_for_greenlet(PyGreenlet *__pyx_v_greenlet, CYTHON_UNUSED int __pyx_skip_dispatch) {
+  PyObject *__pyx_v_result = 0;
+  struct __pyx_obj_6gevent_6_local__localimpl *__pyx_v_local_impl = 0;
+  struct __pyx_obj_6gevent_6_local__localimpl_dict_entry *__pyx_v_entry = 0;
+  PyObject *__pyx_v_k = 0;
+  PyObject *__pyx_v_greenlet_dict = 0;
+  PyObject *__pyx_v_id_greenlet = NULL;
+  PyObject *__pyx_v_v = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("all_local_dicts_for_greenlet", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_XDECREF(__pyx_t_6);
+  __Pyx_XDECREF(__pyx_t_10);
+  __Pyx_AddTraceback("gevent._local.all_local_dicts_for_greenlet", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_result);
+  __Pyx_XDECREF((PyObject *)__pyx_v_local_impl);
+  __Pyx_XDECREF((PyObject *)__pyx_v_entry);
+  __Pyx_XDECREF(__pyx_v_k);
+  __Pyx_XDECREF(__pyx_v_greenlet_dict);
+  __Pyx_XDECREF(__pyx_v_id_greenlet);
+  __Pyx_XDECREF(__pyx_v_v);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_local_1all_local_dicts_for_greenlet(PyObject *__pyx_self, PyObject *__pyx_v_greenlet); /*proto*/
+static char __pyx_doc_6gevent_6_local_all_local_dicts_for_greenlet[] = "all_local_dicts_for_greenlet(greenlet greenlet)\n\n    Internal debug helper for getting the local values associated\n    with a greenlet. This is subject to change or removal at any time.\n\n    :return: A list of ((type, id), {}) pairs, where the first element\n      is the type and id of the local object and the second object is its\n      instance dictionary, as seen from this greenlet.\n\n    .. versionadded:: 1.3a2\n    ";
+static PyMethodDef __pyx_mdef_6gevent_6_local_1all_local_dicts_for_greenlet = {"all_local_dicts_for_greenlet", (PyCFunction)__pyx_pw_6gevent_6_local_1all_local_dicts_for_greenlet, METH_O, __pyx_doc_6gevent_6_local_all_local_dicts_for_greenlet};
+static PyObject *__pyx_pw_6gevent_6_local_1all_local_dicts_for_greenlet(PyObject *__pyx_self, PyObject *__pyx_v_greenlet) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("all_local_dicts_for_greenlet (wrapper)", 0);
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_greenlet), __pyx_ptype_6gevent_6_local_greenlet, 1, "greenlet", 0))) __PYX_ERR(0, 179, __pyx_L1_error)
+  __pyx_r = __pyx_pf_6gevent_6_local_all_local_dicts_for_greenlet(__pyx_self, ((PyGreenlet *)__pyx_v_greenlet));
+
+  /* function exit code */
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_local_all_local_dicts_for_greenlet(CYTHON_UNUSED PyObject *__pyx_self, PyGreenlet *__pyx_v_greenlet) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("all_local_dicts_for_greenlet", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __pyx_f_6gevent_6_local_all_local_dicts_for_greenlet(__pyx_v_greenlet, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 179, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent._local.all_local_dicts_for_greenlet", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__2 = PyTuple_Pack(1, __pyx_n_s_greenlet); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 179, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__2);
+  __Pyx_GIVEREF(__pyx_tuple__2);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_local_1all_local_dicts_for_greenlet, 0, __pyx_n_s_all_local_dicts_for_greenlet, NULL, __pyx_n_s_gevent__local, __pyx_d, ((PyObject *)__pyx_codeobj__3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 179, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_all_local_dicts_for_greenlet, __pyx_t_2) < 0) __PYX_ERR(0, 179, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_codeobj__3 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_local_py, __pyx_n_s_all_local_dicts_for_greenlet, 179, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__3)) __PYX_ERR(0, 179, __pyx_L1_error)
+
 180:     """
+
 181:     Internal debug helper for getting the local values associated
+
 182:     with a greenlet. This is subject to change or removal at any time.
+
 183: 
+
 184:     :return: A list of ((type, id), {}) pairs, where the first element
+
 185:       is the type and id of the local object and the second object is its
+
 186:       instance dictionary, as seen from this greenlet.
+
 187: 
+
 188:     .. versionadded:: 1.3a2
+
 189:     """
+
 190: 
+
+191:     result = []
+
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 191, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_v_result = ((PyObject*)__pyx_t_1);
+  __pyx_t_1 = 0;
+
+192:     id_greenlet = id(greenlet)
+
  __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_greenlet)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 192, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_v_id_greenlet = __pyx_t_1;
+  __pyx_t_1 = 0;
+
+193:     greenlet_dict = greenlet.__dict__
+
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_greenlet), __pyx_n_s_dict); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 193, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (!(likely(PyDict_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 193, __pyx_L1_error)
+  __pyx_v_greenlet_dict = ((PyObject*)__pyx_t_1);
+  __pyx_t_1 = 0;
+
+194:     for k, v in greenlet_dict.items():
+
  __pyx_t_2 = 0;
+  if (unlikely(__pyx_v_greenlet_dict == Py_None)) {
+    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items");
+    __PYX_ERR(0, 194, __pyx_L1_error)
+  }
+  __pyx_t_5 = __Pyx_dict_iterator(__pyx_v_greenlet_dict, 1, __pyx_n_s_items, (&__pyx_t_3), (&__pyx_t_4)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 194, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_5);
+  __Pyx_XDECREF(__pyx_t_1);
+  __pyx_t_1 = __pyx_t_5;
+  __pyx_t_5 = 0;
+  while (1) {
+    __pyx_t_7 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_3, &__pyx_t_2, &__pyx_t_5, &__pyx_t_6, NULL, __pyx_t_4);
+    if (unlikely(__pyx_t_7 == 0)) break;
+    if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(0, 194, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_5);
+    __Pyx_GOTREF(__pyx_t_6);
+    if (!(likely(PyString_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_5)->tp_name), 0))) __PYX_ERR(0, 194, __pyx_L1_error)
+    __Pyx_XDECREF_SET(__pyx_v_k, ((PyObject*)__pyx_t_5));
+    __pyx_t_5 = 0;
+    __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_6);
+    __pyx_t_6 = 0;
+
+195:         if not k.startswith(key_prefix):
+
    if (unlikely(__pyx_v_k == Py_None)) {
+      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "startswith");
+      __PYX_ERR(0, 195, __pyx_L1_error)
+    }
+    __pyx_t_8 = __Pyx_PyStr_Tailmatch(__pyx_v_k, __pyx_v_6gevent_6_local_key_prefix, 0, PY_SSIZE_T_MAX, -1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 195, __pyx_L1_error)
+    __pyx_t_9 = ((!(__pyx_t_8 != 0)) != 0);
+    if (__pyx_t_9) {
+/* … */
+    }
+
+196:             continue
+
      goto __pyx_L3_continue;
+
+197:         local_impl = v()
+
    __Pyx_INCREF(__pyx_v_v);
+    __pyx_t_5 = __pyx_v_v; __pyx_t_10 = NULL;
+    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
+      __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_5);
+      if (likely(__pyx_t_10)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
+        __Pyx_INCREF(__pyx_t_10);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_5, function);
+      }
+    }
+    __pyx_t_6 = (__pyx_t_10) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_10) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
+    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
+    if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 197, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_6);
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_6gevent_6_local__localimpl))))) __PYX_ERR(0, 197, __pyx_L1_error)
+    __Pyx_XDECREF_SET(__pyx_v_local_impl, ((struct __pyx_obj_6gevent_6_local__localimpl *)__pyx_t_6));
+    __pyx_t_6 = 0;
+
+198:         if local_impl is None:
+
    __pyx_t_9 = (((PyObject *)__pyx_v_local_impl) == Py_None);
+    __pyx_t_8 = (__pyx_t_9 != 0);
+    if (__pyx_t_8) {
+/* … */
+    }
+
+199:             continue
+
      goto __pyx_L3_continue;
+
+200:         entry = local_impl.dicts.get(id_greenlet)
+
    if (unlikely(__pyx_v_local_impl->dicts == Py_None)) {
+      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get");
+      __PYX_ERR(0, 200, __pyx_L1_error)
+    }
+    __pyx_t_6 = __Pyx_PyDict_GetItemDefault(__pyx_v_local_impl->dicts, __pyx_v_id_greenlet, Py_None); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 200, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_6);
+    if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_6gevent_6_local__localimpl_dict_entry))))) __PYX_ERR(0, 200, __pyx_L1_error)
+    __Pyx_XDECREF_SET(__pyx_v_entry, ((struct __pyx_obj_6gevent_6_local__localimpl_dict_entry *)__pyx_t_6));
+    __pyx_t_6 = 0;
+
+201:         if entry is None:
+
    __pyx_t_8 = (((PyObject *)__pyx_v_entry) == Py_None);
+    __pyx_t_9 = (__pyx_t_8 != 0);
+    if (__pyx_t_9) {
+/* … */
+    }
+
 202:             # Not yet used in this greenlet.
+
+203:             continue
+
      goto __pyx_L3_continue;
+
+204:         assert entry.wrgreenlet() is greenlet
+
    #ifndef CYTHON_WITHOUT_ASSERTIONS
+    if (unlikely(!Py_OptimizeFlag)) {
+      __Pyx_INCREF(__pyx_v_entry->wrgreenlet);
+      __pyx_t_5 = __pyx_v_entry->wrgreenlet; __pyx_t_10 = NULL;
+      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
+        __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_5);
+        if (likely(__pyx_t_10)) {
+          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
+          __Pyx_INCREF(__pyx_t_10);
+          __Pyx_INCREF(function);
+          __Pyx_DECREF_SET(__pyx_t_5, function);
+        }
+      }
+      __pyx_t_6 = (__pyx_t_10) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_10) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
+      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
+      if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 204, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_6);
+      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+      __pyx_t_9 = (__pyx_t_6 == ((PyObject *)__pyx_v_greenlet));
+      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+      if (unlikely(!(__pyx_t_9 != 0))) {
+        PyErr_SetNone(PyExc_AssertionError);
+        __PYX_ERR(0, 204, __pyx_L1_error)
+      }
+    }
+    #endif
+
+205:         result.append((local_impl.localtypeid, entry.localdict))
+
    __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 205, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_6);
+    __Pyx_INCREF(__pyx_v_local_impl->localtypeid);
+    __Pyx_GIVEREF(__pyx_v_local_impl->localtypeid);
+    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_local_impl->localtypeid);
+    __Pyx_INCREF(__pyx_v_entry->localdict);
+    __Pyx_GIVEREF(__pyx_v_entry->localdict);
+    PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_entry->localdict);
+    __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_6); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 205, __pyx_L1_error)
+    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+    __pyx_L3_continue:;
+  }
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 206: 
+
+207:     return result
+
  __Pyx_XDECREF(__pyx_r);
+  __Pyx_INCREF(__pyx_v_result);
+  __pyx_r = __pyx_v_result;
+  goto __pyx_L0;
+
 208: 
+
 209: 
+
 210: class _wrefdict(dict):
+
 211:     """A dict that can be weak referenced"""
+
 212: 
+
 213: class _greenlet_deleted(object):
+
 214:     """
+
 215:     A weakref callback for when the greenlet
+
 216:     is deleted.
+
 217: 
+
 218:     If the greenlet is a `gevent.greenlet.Greenlet` and
+
 219:     supplies ``rawlink``, that will be used instead of a
+
 220:     weakref.
+
 221:     """
+
+222:     __slots__ = ('idt', 'wrdicts')
+
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_local__greenlet_deleted->tp_dict, __pyx_n_s_slots, __pyx_tuple__4) < 0) __PYX_ERR(0, 222, __pyx_L1_error)
+  PyType_Modified(__pyx_ptype_6gevent_6_local__greenlet_deleted);
+/* … */
+  __pyx_tuple__4 = PyTuple_Pack(2, __pyx_n_s_idt, __pyx_n_s_wrdicts); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 222, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__4);
+  __Pyx_GIVEREF(__pyx_tuple__4);
+
 223: 
+
+224:     def __init__(self, idt, wrdicts):
+
/* Python wrapper */
+static int __pyx_pw_6gevent_6_local_17_greenlet_deleted_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static int __pyx_pw_6gevent_6_local_17_greenlet_deleted_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_idt = 0;
+  PyObject *__pyx_v_wrdicts = 0;
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_idt,&__pyx_n_s_wrdicts,0};
+    PyObject* values[2] = {0,0};
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_idt)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_wrdicts)) != 0)) kw_args--;
+        else {
+          __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(0, 224, __pyx_L3_error)
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 224, __pyx_L3_error)
+      }
+    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
+      goto __pyx_L5_argtuple_error;
+    } else {
+      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+    }
+    __pyx_v_idt = values[0];
+    __pyx_v_wrdicts = values[1];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 224, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent._local._greenlet_deleted.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return -1;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_6_local_17_greenlet_deleted___init__(((struct __pyx_obj_6gevent_6_local__greenlet_deleted *)__pyx_v_self), __pyx_v_idt, __pyx_v_wrdicts);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_6_local_17_greenlet_deleted___init__(struct __pyx_obj_6gevent_6_local__greenlet_deleted *__pyx_v_self, PyObject *__pyx_v_idt, PyObject *__pyx_v_wrdicts) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = 0;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+225:         self.idt = idt
+
  __Pyx_INCREF(__pyx_v_idt);
+  __Pyx_GIVEREF(__pyx_v_idt);
+  __Pyx_GOTREF(__pyx_v_self->idt);
+  __Pyx_DECREF(__pyx_v_self->idt);
+  __pyx_v_self->idt = __pyx_v_idt;
+
+226:         self.wrdicts = wrdicts
+
  __Pyx_INCREF(__pyx_v_wrdicts);
+  __Pyx_GIVEREF(__pyx_v_wrdicts);
+  __Pyx_GOTREF(__pyx_v_self->wrdicts);
+  __Pyx_DECREF(__pyx_v_self->wrdicts);
+  __pyx_v_self->wrdicts = __pyx_v_wrdicts;
+
 227: 
+
+228:     def __call__(self, _unused):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_local_17_greenlet_deleted_3__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_pw_6gevent_6_local_17_greenlet_deleted_3__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  CYTHON_UNUSED PyObject *__pyx_v__unused = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__call__ (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_unused,0};
+    PyObject* values[1] = {0};
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_unused)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__call__") < 0)) __PYX_ERR(0, 228, __pyx_L3_error)
+      }
+    } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
+      goto __pyx_L5_argtuple_error;
+    } else {
+      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+    }
+    __pyx_v__unused = values[0];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("__call__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 228, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent._local._greenlet_deleted.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_6_local_17_greenlet_deleted_2__call__(((struct __pyx_obj_6gevent_6_local__greenlet_deleted *)__pyx_v_self), __pyx_v__unused);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_local_17_greenlet_deleted_2__call__(struct __pyx_obj_6gevent_6_local__greenlet_deleted *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v__unused) {
+  PyObject *__pyx_v_dicts = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__call__", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_6);
+  __Pyx_AddTraceback("gevent._local._greenlet_deleted.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_dicts);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+229:         dicts = self.wrdicts()
+
  __Pyx_INCREF(__pyx_v_self->wrdicts);
+  __pyx_t_2 = __pyx_v_self->wrdicts; __pyx_t_3 = NULL;
+  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+    if (likely(__pyx_t_3)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+      __Pyx_INCREF(__pyx_t_3);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_2, function);
+    }
+  }
+  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 229, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_v_dicts = __pyx_t_1;
+  __pyx_t_1 = 0;
+
+230:         if dicts:
+
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_dicts); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 230, __pyx_L1_error)
+  if (__pyx_t_4) {
+/* … */
+  }
+
+231:             dicts.pop(self.idt, None)
+
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_dicts, __pyx_n_s_pop); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 231, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_3 = NULL;
+    __pyx_t_5 = 0;
+    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+      if (likely(__pyx_t_3)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+        __Pyx_INCREF(__pyx_t_3);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_2, function);
+        __pyx_t_5 = 1;
+      }
+    }
+    #if CYTHON_FAST_PYCALL
+    if (PyFunction_Check(__pyx_t_2)) {
+      PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_self->idt, Py_None};
+      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 231, __pyx_L1_error)
+      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __Pyx_GOTREF(__pyx_t_1);
+    } else
+    #endif
+    #if CYTHON_FAST_PYCCALL
+    if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
+      PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_self->idt, Py_None};
+      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 231, __pyx_L1_error)
+      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __Pyx_GOTREF(__pyx_t_1);
+    } else
+    #endif
+    {
+      __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 231, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_6);
+      if (__pyx_t_3) {
+        __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); __pyx_t_3 = NULL;
+      }
+      __Pyx_INCREF(__pyx_v_self->idt);
+      __Pyx_GIVEREF(__pyx_v_self->idt);
+      PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_self->idt);
+      __Pyx_INCREF(Py_None);
+      __Pyx_GIVEREF(Py_None);
+      PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, Py_None);
+      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 231, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+    }
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 232: 
+
 233: class _local_deleted(object):
+
+234:     __slots__ = ('key', 'wrthread', 'greenlet_deleted')
+
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_local__local_deleted->tp_dict, __pyx_n_s_slots, __pyx_tuple__5) < 0) __PYX_ERR(0, 234, __pyx_L1_error)
+  PyType_Modified(__pyx_ptype_6gevent_6_local__local_deleted);
+/* … */
+  __pyx_tuple__5 = PyTuple_Pack(3, __pyx_n_s_key, __pyx_n_s_wrthread, __pyx_n_s_greenlet_deleted); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 234, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__5);
+  __Pyx_GIVEREF(__pyx_tuple__5);
+
 235: 
+
+236:     def __init__(self, key, wrthread, greenlet_deleted):
+
/* Python wrapper */
+static int __pyx_pw_6gevent_6_local_14_local_deleted_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static int __pyx_pw_6gevent_6_local_14_local_deleted_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_key = 0;
+  PyObject *__pyx_v_wrthread = 0;
+  PyObject *__pyx_v_greenlet_deleted = 0;
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_key,&__pyx_n_s_wrthread,&__pyx_n_s_greenlet_deleted,0};
+    PyObject* values[3] = {0,0,0};
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_wrthread)) != 0)) kw_args--;
+        else {
+          __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 1); __PYX_ERR(0, 236, __pyx_L3_error)
+        }
+        CYTHON_FALLTHROUGH;
+        case  2:
+        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_greenlet_deleted)) != 0)) kw_args--;
+        else {
+          __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 2); __PYX_ERR(0, 236, __pyx_L3_error)
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 236, __pyx_L3_error)
+      }
+    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
+      goto __pyx_L5_argtuple_error;
+    } else {
+      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+    }
+    __pyx_v_key = values[0];
+    __pyx_v_wrthread = values[1];
+    __pyx_v_greenlet_deleted = values[2];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 236, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent._local._local_deleted.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return -1;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_6_local_14_local_deleted___init__(((struct __pyx_obj_6gevent_6_local__local_deleted *)__pyx_v_self), __pyx_v_key, __pyx_v_wrthread, __pyx_v_greenlet_deleted);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_6_local_14_local_deleted___init__(struct __pyx_obj_6gevent_6_local__local_deleted *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_wrthread, PyObject *__pyx_v_greenlet_deleted) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = 0;
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent._local._local_deleted.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = -1;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+237:         self.key = key
+
  if (!(likely(PyString_CheckExact(__pyx_v_key))||((__pyx_v_key) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_v_key)->tp_name), 0))) __PYX_ERR(0, 237, __pyx_L1_error)
+  __pyx_t_1 = __pyx_v_key;
+  __Pyx_INCREF(__pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_1);
+  __Pyx_GOTREF(__pyx_v_self->key);
+  __Pyx_DECREF(__pyx_v_self->key);
+  __pyx_v_self->key = ((PyObject*)__pyx_t_1);
+  __pyx_t_1 = 0;
+
+238:         self.wrthread = wrthread
+
  __Pyx_INCREF(__pyx_v_wrthread);
+  __Pyx_GIVEREF(__pyx_v_wrthread);
+  __Pyx_GOTREF(__pyx_v_self->wrthread);
+  __Pyx_DECREF(__pyx_v_self->wrthread);
+  __pyx_v_self->wrthread = __pyx_v_wrthread;
+
+239:         self.greenlet_deleted = greenlet_deleted
+
  if (!(likely(((__pyx_v_greenlet_deleted) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_greenlet_deleted, __pyx_ptype_6gevent_6_local__greenlet_deleted))))) __PYX_ERR(0, 239, __pyx_L1_error)
+  __pyx_t_1 = __pyx_v_greenlet_deleted;
+  __Pyx_INCREF(__pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_1);
+  __Pyx_GOTREF(__pyx_v_self->greenlet_deleted);
+  __Pyx_DECREF(((PyObject *)__pyx_v_self->greenlet_deleted));
+  __pyx_v_self->greenlet_deleted = ((struct __pyx_obj_6gevent_6_local__greenlet_deleted *)__pyx_t_1);
+  __pyx_t_1 = 0;
+
 240: 
+
+241:     def __call__(self, _unused):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_local_14_local_deleted_3__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_pw_6gevent_6_local_14_local_deleted_3__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  CYTHON_UNUSED PyObject *__pyx_v__unused = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__call__ (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_unused,0};
+    PyObject* values[1] = {0};
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_unused)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__call__") < 0)) __PYX_ERR(0, 241, __pyx_L3_error)
+      }
+    } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
+      goto __pyx_L5_argtuple_error;
+    } else {
+      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+    }
+    __pyx_v__unused = values[0];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("__call__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 241, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent._local._local_deleted.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_6_local_14_local_deleted_2__call__(((struct __pyx_obj_6gevent_6_local__local_deleted *)__pyx_v_self), __pyx_v__unused);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_local_14_local_deleted_2__call__(struct __pyx_obj_6gevent_6_local__local_deleted *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v__unused) {
+  PyObject *__pyx_v_thread = NULL;
+  PyObject *__pyx_v_unlink = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__call__", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_AddTraceback("gevent._local._local_deleted.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_thread);
+  __Pyx_XDECREF(__pyx_v_unlink);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+242:         thread = self.wrthread()
+
  __Pyx_INCREF(__pyx_v_self->wrthread);
+  __pyx_t_2 = __pyx_v_self->wrthread; __pyx_t_3 = NULL;
+  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+    if (likely(__pyx_t_3)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+      __Pyx_INCREF(__pyx_t_3);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_2, function);
+    }
+  }
+  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 242, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_v_thread = __pyx_t_1;
+  __pyx_t_1 = 0;
+
+243:         if thread is not None:
+
  __pyx_t_4 = (__pyx_v_thread != Py_None);
+  __pyx_t_5 = (__pyx_t_4 != 0);
+  if (__pyx_t_5) {
+/* … */
+  }
+
+244:             try:
+
    {
+      /*try:*/ {
+/* … */
+      }
+/* … */
+      __Pyx_XGIVEREF(__pyx_t_6);
+      __Pyx_XGIVEREF(__pyx_t_7);
+      __Pyx_XGIVEREF(__pyx_t_8);
+      __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
+      goto __pyx_L1_error;
+      __pyx_L5_exception_handled:;
+      __Pyx_XGIVEREF(__pyx_t_6);
+      __Pyx_XGIVEREF(__pyx_t_7);
+      __Pyx_XGIVEREF(__pyx_t_8);
+      __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
+      __pyx_L9_try_end:;
+    }
+
+245:                 unlink = thread.unlink
+
        __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_thread, __pyx_n_s_unlink); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 245, __pyx_L4_error)
+        __Pyx_GOTREF(__pyx_t_1);
+        __pyx_v_unlink = __pyx_t_1;
+        __pyx_t_1 = 0;
+
+246:             except AttributeError:
+
      __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_AttributeError);
+      if (__pyx_t_9) {
+        __Pyx_ErrRestore(0,0,0);
+        goto __pyx_L5_exception_handled;
+      }
+      goto __pyx_L6_except_error;
+      __pyx_L6_except_error:;
+
 247:                 pass
+
 248:             else:
+
+249:                 unlink(self.greenlet_deleted)
+
      /*else:*/ {
+        __Pyx_INCREF(__pyx_v_unlink);
+        __pyx_t_2 = __pyx_v_unlink; __pyx_t_3 = NULL;
+        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+          if (likely(__pyx_t_3)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+            __Pyx_INCREF(__pyx_t_3);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_2, function);
+          }
+        }
+        __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, ((PyObject *)__pyx_v_self->greenlet_deleted)) : __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_v_self->greenlet_deleted));
+        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+        if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 249, __pyx_L6_except_error)
+        __Pyx_GOTREF(__pyx_t_1);
+        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      }
+      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
+      goto __pyx_L9_try_end;
+      __pyx_L4_error:;
+      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+250:             del thread.__dict__[self.key]
+
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_thread, __pyx_n_s_dict); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 250, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    if (unlikely(PyObject_DelItem(__pyx_t_1, __pyx_v_self->key) < 0)) __PYX_ERR(0, 250, __pyx_L1_error)
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 251: 
+
 252: class _localimpl(object):
+
 253:     """A class managing thread-local dicts"""
+
+254:     __slots__ = ('key', 'dicts',
+
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_local__localimpl->tp_dict, __pyx_n_s_slots, __pyx_tuple__6) < 0) __PYX_ERR(0, 254, __pyx_L1_error)
+  PyType_Modified(__pyx_ptype_6gevent_6_local__localimpl);
+/* … */
+  __pyx_tuple__6 = PyTuple_Pack(6, __pyx_n_s_key, __pyx_n_s_dicts, __pyx_n_s_localargs, __pyx_n_s_localkwargs, __pyx_n_s_localtypeid, __pyx_n_s_weakref_2); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 254, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__6);
+  __Pyx_GIVEREF(__pyx_tuple__6);
+
 255:                  'localargs', 'localkwargs',
+
 256:                  'localtypeid',
+
 257:                  '__weakref__',)
+
 258: 
+
+259:     def __init__(self, args, kwargs, local_type, id_local):
+
/* Python wrapper */
+static int __pyx_pw_6gevent_6_local_10_localimpl_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static int __pyx_pw_6gevent_6_local_10_localimpl_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_args = 0;
+  PyObject *__pyx_v_kwargs = 0;
+  PyObject *__pyx_v_local_type = 0;
+  PyObject *__pyx_v_id_local = 0;
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_args,&__pyx_n_s_kwargs,&__pyx_n_s_local_type,&__pyx_n_s_id_local,0};
+    PyObject* values[4] = {0,0,0,0};
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
+        CYTHON_FALLTHROUGH;
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kwargs)) != 0)) kw_args--;
+        else {
+          __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, 1); __PYX_ERR(0, 259, __pyx_L3_error)
+        }
+        CYTHON_FALLTHROUGH;
+        case  2:
+        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_local_type)) != 0)) kw_args--;
+        else {
+          __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, 2); __PYX_ERR(0, 259, __pyx_L3_error)
+        }
+        CYTHON_FALLTHROUGH;
+        case  3:
+        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_id_local)) != 0)) kw_args--;
+        else {
+          __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, 3); __PYX_ERR(0, 259, __pyx_L3_error)
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 259, __pyx_L3_error)
+      }
+    } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
+      goto __pyx_L5_argtuple_error;
+    } else {
+      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
+    }
+    __pyx_v_args = values[0];
+    __pyx_v_kwargs = values[1];
+    __pyx_v_local_type = values[2];
+    __pyx_v_id_local = values[3];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 259, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent._local._localimpl.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return -1;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_6_local_10_localimpl___init__(((struct __pyx_obj_6gevent_6_local__localimpl *)__pyx_v_self), __pyx_v_args, __pyx_v_kwargs, __pyx_v_local_type, __pyx_v_id_local);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_6_local_10_localimpl___init__(struct __pyx_obj_6gevent_6_local__localimpl *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs, PyObject *__pyx_v_local_type, PyObject *__pyx_v_id_local) {
+  PyGreenlet *__pyx_v_greenlet = NULL;
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = 0;
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_AddTraceback("gevent._local._localimpl.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = -1;
+  __pyx_L0:;
+  __Pyx_XDECREF((PyObject *)__pyx_v_greenlet);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+260:         self.key = key_prefix + str(id(self))
+
  __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 260, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyString_Type)), __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 260, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_1 = PyNumber_Add(__pyx_v_6gevent_6_local_key_prefix, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 260, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  if (!(likely(PyString_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 260, __pyx_L1_error)
+  __Pyx_GIVEREF(__pyx_t_1);
+  __Pyx_GOTREF(__pyx_v_self->key);
+  __Pyx_DECREF(__pyx_v_self->key);
+  __pyx_v_self->key = ((PyObject*)__pyx_t_1);
+  __pyx_t_1 = 0;
+
 261:         # { id(greenlet) -> _localimpl_dict_entry(ref(greenlet), greenlet-local dict) }
+
+262:         self.dicts = _wrefdict()
+
  __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_6gevent_6_local__wrefdict)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 262, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_1);
+  __Pyx_GOTREF(__pyx_v_self->dicts);
+  __Pyx_DECREF(__pyx_v_self->dicts);
+  __pyx_v_self->dicts = ((PyObject*)__pyx_t_1);
+  __pyx_t_1 = 0;
+
+263:         self.localargs = args
+
  if (!(likely(PyTuple_CheckExact(__pyx_v_args))||((__pyx_v_args) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v_args)->tp_name), 0))) __PYX_ERR(0, 263, __pyx_L1_error)
+  __pyx_t_1 = __pyx_v_args;
+  __Pyx_INCREF(__pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_1);
+  __Pyx_GOTREF(__pyx_v_self->localargs);
+  __Pyx_DECREF(__pyx_v_self->localargs);
+  __pyx_v_self->localargs = ((PyObject*)__pyx_t_1);
+  __pyx_t_1 = 0;
+
+264:         self.localkwargs = kwargs
+
  if (!(likely(PyDict_CheckExact(__pyx_v_kwargs))||((__pyx_v_kwargs) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_v_kwargs)->tp_name), 0))) __PYX_ERR(0, 264, __pyx_L1_error)
+  __pyx_t_1 = __pyx_v_kwargs;
+  __Pyx_INCREF(__pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_1);
+  __Pyx_GOTREF(__pyx_v_self->localkwargs);
+  __Pyx_DECREF(__pyx_v_self->localkwargs);
+  __pyx_v_self->localkwargs = ((PyObject*)__pyx_t_1);
+  __pyx_t_1 = 0;
+
+265:         self.localtypeid = local_type, id_local
+
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 265, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(__pyx_v_local_type);
+  __Pyx_GIVEREF(__pyx_v_local_type);
+  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_local_type);
+  __Pyx_INCREF(__pyx_v_id_local);
+  __Pyx_GIVEREF(__pyx_v_id_local);
+  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_id_local);
+  __Pyx_GIVEREF(__pyx_t_1);
+  __Pyx_GOTREF(__pyx_v_self->localtypeid);
+  __Pyx_DECREF(__pyx_v_self->localtypeid);
+  __pyx_v_self->localtypeid = ((PyObject*)__pyx_t_1);
+  __pyx_t_1 = 0;
+
 266: 
+
 267:         # We need to create the thread dict in anticipation of
+
 268:         # __init__ being called, to make sure we don't call it
+
 269:         # again ourselves. MUST do this before setting any attributes.
+
+270:         greenlet = getcurrent() # pylint:disable=undefined-variable
+
  __pyx_t_1 = ((PyObject *)__pyx_f_6gevent_6_local_getcurrent()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 270, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_v_greenlet = ((PyGreenlet *)__pyx_t_1);
+  __pyx_t_1 = 0;
+
+271:         _localimpl_create_dict(self, greenlet, id(greenlet))
+
  __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_greenlet)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 271, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = __pyx_f_6gevent_6_local__localimpl_create_dict(__pyx_v_self, __pyx_v_greenlet, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 271, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
 272: 
+
 273: class _localimpl_dict_entry(object):
+
 274:     """
+
 275:     The object that goes in the ``dicts`` of ``_localimpl``
+
 276:     object for each thread.
+
 277:     """
+
 278:     # This is a class, not just a tuple, so that cython can optimize
+
 279:     # attribute access
+
+280:     __slots__ = ('wrgreenlet', 'localdict')
+
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_local__localimpl_dict_entry->tp_dict, __pyx_n_s_slots, __pyx_tuple__7) < 0) __PYX_ERR(0, 280, __pyx_L1_error)
+  PyType_Modified(__pyx_ptype_6gevent_6_local__localimpl_dict_entry);
+/* … */
+  __pyx_tuple__7 = PyTuple_Pack(2, __pyx_n_s_wrgreenlet, __pyx_n_s_localdict); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 280, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__7);
+  __Pyx_GIVEREF(__pyx_tuple__7);
+
 281: 
+
+282:     def __init__(self, wrgreenlet, localdict):
+
/* Python wrapper */
+static int __pyx_pw_6gevent_6_local_21_localimpl_dict_entry_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static int __pyx_pw_6gevent_6_local_21_localimpl_dict_entry_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_wrgreenlet = 0;
+  PyObject *__pyx_v_localdict = 0;
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_wrgreenlet,&__pyx_n_s_localdict,0};
+    PyObject* values[2] = {0,0};
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_wrgreenlet)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_localdict)) != 0)) kw_args--;
+        else {
+          __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(0, 282, __pyx_L3_error)
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 282, __pyx_L3_error)
+      }
+    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
+      goto __pyx_L5_argtuple_error;
+    } else {
+      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+    }
+    __pyx_v_wrgreenlet = values[0];
+    __pyx_v_localdict = values[1];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 282, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent._local._localimpl_dict_entry.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return -1;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_6_local_21_localimpl_dict_entry___init__(((struct __pyx_obj_6gevent_6_local__localimpl_dict_entry *)__pyx_v_self), __pyx_v_wrgreenlet, __pyx_v_localdict);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_6_local_21_localimpl_dict_entry___init__(struct __pyx_obj_6gevent_6_local__localimpl_dict_entry *__pyx_v_self, PyObject *__pyx_v_wrgreenlet, PyObject *__pyx_v_localdict) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = 0;
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent._local._localimpl_dict_entry.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = -1;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+283:         self.wrgreenlet = wrgreenlet
+
  __Pyx_INCREF(__pyx_v_wrgreenlet);
+  __Pyx_GIVEREF(__pyx_v_wrgreenlet);
+  __Pyx_GOTREF(__pyx_v_self->wrgreenlet);
+  __Pyx_DECREF(__pyx_v_self->wrgreenlet);
+  __pyx_v_self->wrgreenlet = __pyx_v_wrgreenlet;
+
+284:         self.localdict = localdict
+
  if (!(likely(PyDict_CheckExact(__pyx_v_localdict))||((__pyx_v_localdict) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_v_localdict)->tp_name), 0))) __PYX_ERR(0, 284, __pyx_L1_error)
+  __pyx_t_1 = __pyx_v_localdict;
+  __Pyx_INCREF(__pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_1);
+  __Pyx_GOTREF(__pyx_v_self->localdict);
+  __Pyx_DECREF(__pyx_v_self->localdict);
+  __pyx_v_self->localdict = ((PyObject*)__pyx_t_1);
+  __pyx_t_1 = 0;
+
 285: 
+
 286: # We use functions instead of methods so that they can be cdef'd in
+
 287: # local.pxd; if they were cdef'd as methods, they would cause
+
 288: # the creation of a pointer and a vtable. This happens
+
 289: # even if we declare the class @cython.final. functions thus save memory overhead
+
 290: # (but not pointer chasing overhead; the vtable isn't used when we declare
+
 291: # the class final).
+
 292: 
+
 293: 
+
+294: def _localimpl_create_dict(self, greenlet, id_greenlet):
+
static PyObject *__pyx_f_6gevent_6_local__localimpl_create_dict(struct __pyx_obj_6gevent_6_local__localimpl *__pyx_v_self, PyGreenlet *__pyx_v_greenlet, PyObject *__pyx_v_id_greenlet) {
+  PyObject *__pyx_v_localdict = 0;
+  PyObject *__pyx_v_key = 0;
+  struct __pyx_obj_6gevent_6_local__greenlet_deleted *__pyx_v_greenlet_deleted = 0;
+  struct __pyx_obj_6gevent_6_local__local_deleted *__pyx_v_local_deleted = 0;
+  PyObject *__pyx_v_wrdicts = NULL;
+  PyObject *__pyx_v_rawlink = NULL;
+  PyObject *__pyx_v_wrthread = NULL;
+  PyObject *__pyx_v_wrlocal = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_localimpl_create_dict", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_7);
+  __Pyx_AddTraceback("gevent._local._localimpl_create_dict", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_localdict);
+  __Pyx_XDECREF(__pyx_v_key);
+  __Pyx_XDECREF((PyObject *)__pyx_v_greenlet_deleted);
+  __Pyx_XDECREF((PyObject *)__pyx_v_local_deleted);
+  __Pyx_XDECREF(__pyx_v_wrdicts);
+  __Pyx_XDECREF(__pyx_v_rawlink);
+  __Pyx_XDECREF(__pyx_v_wrthread);
+  __Pyx_XDECREF(__pyx_v_wrlocal);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
 295:     """Create a new dict for the current thread, and return it."""
+
+296:     localdict = {}
+
  __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 296, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_v_localdict = ((PyObject*)__pyx_t_1);
+  __pyx_t_1 = 0;
+
+297:     key = self.key
+
  __pyx_t_1 = __pyx_v_self->key;
+  __Pyx_INCREF(__pyx_t_1);
+  __pyx_v_key = ((PyObject*)__pyx_t_1);
+  __pyx_t_1 = 0;
+
 298: 
+
+299:     wrdicts = ref(self.dicts)
+
  __Pyx_INCREF(__pyx_v_6gevent_6_local_ref);
+  __pyx_t_2 = __pyx_v_6gevent_6_local_ref; __pyx_t_3 = NULL;
+  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
+    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+    if (likely(__pyx_t_3)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+      __Pyx_INCREF(__pyx_t_3);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_2, function);
+    }
+  }
+  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_self->dicts) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_self->dicts);
+  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 299, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_v_wrdicts = __pyx_t_1;
+  __pyx_t_1 = 0;
+
 300: 
+
 301:     # When the greenlet is deleted, remove the local dict.
+
 302:     # Note that this is suboptimal if the greenlet object gets
+
 303:     # caught in a reference loop. We would like to be called
+
 304:     # as soon as the OS-level greenlet ends instead.
+
 305: 
+
 306:     # If we are working with a gevent.greenlet.Greenlet, we
+
 307:     # can pro-actively clear out with a link, avoiding the
+
 308:     # issue described above. Use rawlink to avoid spawning any
+
 309:     # more greenlets.
+
+310:     greenlet_deleted = _greenlet_deleted(id_greenlet, wrdicts)
+
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 310, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(__pyx_v_id_greenlet);
+  __Pyx_GIVEREF(__pyx_v_id_greenlet);
+  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_id_greenlet);
+  __Pyx_INCREF(__pyx_v_wrdicts);
+  __Pyx_GIVEREF(__pyx_v_wrdicts);
+  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_wrdicts);
+  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6gevent_6_local__greenlet_deleted), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 310, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_v_greenlet_deleted = ((struct __pyx_obj_6gevent_6_local__greenlet_deleted *)__pyx_t_2);
+  __pyx_t_2 = 0;
+
 311: 
+
+312:     rawlink = getattr(greenlet, 'rawlink', None)
+
  __pyx_t_2 = __Pyx_GetAttr3(((PyObject *)__pyx_v_greenlet), __pyx_n_s_rawlink, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 312, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_v_rawlink = __pyx_t_2;
+  __pyx_t_2 = 0;
+
+313:     if rawlink is not None:
+
  __pyx_t_4 = (__pyx_v_rawlink != Py_None);
+  __pyx_t_5 = (__pyx_t_4 != 0);
+  if (__pyx_t_5) {
+/* … */
+    goto __pyx_L3;
+  }
+
+314:         rawlink(greenlet_deleted)
+
    __Pyx_INCREF(__pyx_v_rawlink);
+    __pyx_t_1 = __pyx_v_rawlink; __pyx_t_3 = NULL;
+    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
+      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
+      if (likely(__pyx_t_3)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
+        __Pyx_INCREF(__pyx_t_3);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_1, function);
+      }
+    }
+    __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_3, ((PyObject *)__pyx_v_greenlet_deleted)) : __Pyx_PyObject_CallOneArg(__pyx_t_1, ((PyObject *)__pyx_v_greenlet_deleted));
+    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 314, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+315:         wrthread = ref(greenlet)
+
    __Pyx_INCREF(__pyx_v_6gevent_6_local_ref);
+    __pyx_t_1 = __pyx_v_6gevent_6_local_ref; __pyx_t_3 = NULL;
+    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
+      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
+      if (likely(__pyx_t_3)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
+        __Pyx_INCREF(__pyx_t_3);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_1, function);
+      }
+    }
+    __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_3, ((PyObject *)__pyx_v_greenlet)) : __Pyx_PyObject_CallOneArg(__pyx_t_1, ((PyObject *)__pyx_v_greenlet));
+    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 315, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __pyx_v_wrthread = __pyx_t_2;
+    __pyx_t_2 = 0;
+
 316:     else:
+
+317:         wrthread = ref(greenlet, greenlet_deleted)
+
  /*else*/ {
+    __Pyx_INCREF(__pyx_v_6gevent_6_local_ref);
+    __pyx_t_1 = __pyx_v_6gevent_6_local_ref; __pyx_t_3 = NULL;
+    __pyx_t_6 = 0;
+    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
+      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
+      if (likely(__pyx_t_3)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
+        __Pyx_INCREF(__pyx_t_3);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_1, function);
+        __pyx_t_6 = 1;
+      }
+    }
+    #if CYTHON_FAST_PYCALL
+    if (PyFunction_Check(__pyx_t_1)) {
+      PyObject *__pyx_temp[3] = {__pyx_t_3, ((PyObject *)__pyx_v_greenlet), ((PyObject *)__pyx_v_greenlet_deleted)};
+      __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 317, __pyx_L1_error)
+      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __Pyx_GOTREF(__pyx_t_2);
+    } else
+    #endif
+    #if CYTHON_FAST_PYCCALL
+    if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
+      PyObject *__pyx_temp[3] = {__pyx_t_3, ((PyObject *)__pyx_v_greenlet), ((PyObject *)__pyx_v_greenlet_deleted)};
+      __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 317, __pyx_L1_error)
+      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __Pyx_GOTREF(__pyx_t_2);
+    } else
+    #endif
+    {
+      __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 317, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_7);
+      if (__pyx_t_3) {
+        __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3); __pyx_t_3 = NULL;
+      }
+      __Pyx_INCREF(((PyObject *)__pyx_v_greenlet));
+      __Pyx_GIVEREF(((PyObject *)__pyx_v_greenlet));
+      PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, ((PyObject *)__pyx_v_greenlet));
+      __Pyx_INCREF(((PyObject *)__pyx_v_greenlet_deleted));
+      __Pyx_GIVEREF(((PyObject *)__pyx_v_greenlet_deleted));
+      PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, ((PyObject *)__pyx_v_greenlet_deleted));
+      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 317, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_2);
+      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+    }
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __pyx_v_wrthread = __pyx_t_2;
+    __pyx_t_2 = 0;
+  }
+  __pyx_L3:;
+
 318: 
+
 319: 
+
 320:     # When the localimpl is deleted, remove the thread attribute.
+
+321:     local_deleted = _local_deleted(key, wrthread, greenlet_deleted)
+
  __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 321, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(__pyx_v_key);
+  __Pyx_GIVEREF(__pyx_v_key);
+  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_key);
+  __Pyx_INCREF(__pyx_v_wrthread);
+  __Pyx_GIVEREF(__pyx_v_wrthread);
+  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_wrthread);
+  __Pyx_INCREF(((PyObject *)__pyx_v_greenlet_deleted));
+  __Pyx_GIVEREF(((PyObject *)__pyx_v_greenlet_deleted));
+  PyTuple_SET_ITEM(__pyx_t_2, 2, ((PyObject *)__pyx_v_greenlet_deleted));
+  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6gevent_6_local__local_deleted), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 321, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_v_local_deleted = ((struct __pyx_obj_6gevent_6_local__local_deleted *)__pyx_t_1);
+  __pyx_t_1 = 0;
+
 322: 
+
 323: 
+
+324:     wrlocal = ref(self, local_deleted)
+
  __Pyx_INCREF(__pyx_v_6gevent_6_local_ref);
+  __pyx_t_2 = __pyx_v_6gevent_6_local_ref; __pyx_t_7 = NULL;
+  __pyx_t_6 = 0;
+  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
+    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2);
+    if (likely(__pyx_t_7)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+      __Pyx_INCREF(__pyx_t_7);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_2, function);
+      __pyx_t_6 = 1;
+    }
+  }
+  #if CYTHON_FAST_PYCALL
+  if (PyFunction_Check(__pyx_t_2)) {
+    PyObject *__pyx_temp[3] = {__pyx_t_7, ((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_local_deleted)};
+    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 324, __pyx_L1_error)
+    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+    __Pyx_GOTREF(__pyx_t_1);
+  } else
+  #endif
+  #if CYTHON_FAST_PYCCALL
+  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
+    PyObject *__pyx_temp[3] = {__pyx_t_7, ((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_local_deleted)};
+    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 324, __pyx_L1_error)
+    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+    __Pyx_GOTREF(__pyx_t_1);
+  } else
+  #endif
+  {
+    __pyx_t_3 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 324, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    if (__pyx_t_7) {
+      __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_7); __pyx_t_7 = NULL;
+    }
+    __Pyx_INCREF(((PyObject *)__pyx_v_self));
+    __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
+    PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_6, ((PyObject *)__pyx_v_self));
+    __Pyx_INCREF(((PyObject *)__pyx_v_local_deleted));
+    __Pyx_GIVEREF(((PyObject *)__pyx_v_local_deleted));
+    PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_6, ((PyObject *)__pyx_v_local_deleted));
+    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 324, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  }
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_v_wrlocal = __pyx_t_1;
+  __pyx_t_1 = 0;
+
+325:     greenlet.__dict__[key] = wrlocal
+
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_greenlet), __pyx_n_s_dict); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 325, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_key, __pyx_v_wrlocal) < 0)) __PYX_ERR(0, 325, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 326: 
+
+327:     self.dicts[id_greenlet] = _localimpl_dict_entry(wrthread, localdict)
+
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 327, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(__pyx_v_wrthread);
+  __Pyx_GIVEREF(__pyx_v_wrthread);
+  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_wrthread);
+  __Pyx_INCREF(__pyx_v_localdict);
+  __Pyx_GIVEREF(__pyx_v_localdict);
+  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_localdict);
+  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6gevent_6_local__localimpl_dict_entry), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 327, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  if (unlikely(__pyx_v_self->dicts == Py_None)) {
+    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
+    __PYX_ERR(0, 327, __pyx_L1_error)
+  }
+  if (unlikely(PyDict_SetItem(__pyx_v_self->dicts, __pyx_v_id_greenlet, __pyx_t_2) < 0)) __PYX_ERR(0, 327, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+328:     return localdict
+
  __Pyx_XDECREF(__pyx_r);
+  __Pyx_INCREF(__pyx_v_localdict);
+  __pyx_r = __pyx_v_localdict;
+  goto __pyx_L0;
+
 329: 
+
 330: 
+
+331: _marker = object()
+
  __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_builtin_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 331, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_XGOTREF(__pyx_v_6gevent_6_local__marker);
+  __Pyx_DECREF_SET(__pyx_v_6gevent_6_local__marker, __pyx_t_2);
+  __Pyx_GIVEREF(__pyx_t_2);
+  __pyx_t_2 = 0;
+
 332: 
+
+333: def _local_get_dict(self):
+
static CYTHON_INLINE PyObject *__pyx_f_6gevent_6_local__local_get_dict(struct __pyx_obj_6gevent_6_local_local *__pyx_v_self) {
+  struct __pyx_obj_6gevent_6_local__localimpl *__pyx_v_impl = 0;
+  PyObject *__pyx_v_dct = 0;
+  struct __pyx_obj_6gevent_6_local__localimpl_dict_entry *__pyx_v_entry = 0;
+  PyGreenlet *__pyx_v_greenlet = NULL;
+  PyObject *__pyx_v_idg = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_local_get_dict", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_6);
+  __Pyx_XDECREF(__pyx_t_7);
+  __Pyx_XDECREF(__pyx_t_8);
+  __Pyx_XDECREF(__pyx_t_9);
+  __Pyx_AddTraceback("gevent._local._local_get_dict", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XDECREF((PyObject *)__pyx_v_impl);
+  __Pyx_XDECREF(__pyx_v_dct);
+  __Pyx_XDECREF((PyObject *)__pyx_v_entry);
+  __Pyx_XDECREF((PyObject *)__pyx_v_greenlet);
+  __Pyx_XDECREF(__pyx_v_idg);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+334:     impl = self._local__impl
+
  __pyx_t_1 = ((PyObject *)__pyx_v_self->_local__impl);
+  __Pyx_INCREF(__pyx_t_1);
+  __pyx_v_impl = ((struct __pyx_obj_6gevent_6_local__localimpl *)__pyx_t_1);
+  __pyx_t_1 = 0;
+
 335:     # Cython can optimize dict[], but not dict.get()
+
+336:     greenlet = getcurrent() # pylint:disable=undefined-variable
+
  __pyx_t_1 = ((PyObject *)__pyx_f_6gevent_6_local_getcurrent()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 336, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_v_greenlet = ((PyGreenlet *)__pyx_t_1);
+  __pyx_t_1 = 0;
+
+337:     idg = id(greenlet)
+
  __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_greenlet)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 337, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_v_idg = __pyx_t_1;
+  __pyx_t_1 = 0;
+
+338:     try:
+
  {
+    /*try:*/ {
+/* … */
+    }
+    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+    goto __pyx_L8_try_end;
+    __pyx_L3_error:;
+    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+/* … */
+    __Pyx_XGIVEREF(__pyx_t_2);
+    __Pyx_XGIVEREF(__pyx_t_3);
+    __Pyx_XGIVEREF(__pyx_t_4);
+    __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
+    goto __pyx_L1_error;
+    __pyx_L4_exception_handled:;
+    __Pyx_XGIVEREF(__pyx_t_2);
+    __Pyx_XGIVEREF(__pyx_t_3);
+    __Pyx_XGIVEREF(__pyx_t_4);
+    __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
+    __pyx_L8_try_end:;
+  }
+
+339:         entry = impl.dicts[idg]
+
      if (unlikely(__pyx_v_impl->dicts == Py_None)) {
+        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
+        __PYX_ERR(0, 339, __pyx_L3_error)
+      }
+      __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_impl->dicts, __pyx_v_idg); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 339, __pyx_L3_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_6gevent_6_local__localimpl_dict_entry))))) __PYX_ERR(0, 339, __pyx_L3_error)
+      __pyx_v_entry = ((struct __pyx_obj_6gevent_6_local__localimpl_dict_entry *)__pyx_t_1);
+      __pyx_t_1 = 0;
+
+340:         dct = entry.localdict
+
      __pyx_t_1 = __pyx_v_entry->localdict;
+      __Pyx_INCREF(__pyx_t_1);
+      __pyx_v_dct = ((PyObject*)__pyx_t_1);
+      __pyx_t_1 = 0;
+
+341:     except KeyError:
+
    __pyx_t_5 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
+    if (__pyx_t_5) {
+      __Pyx_AddTraceback("gevent._local._local_get_dict", __pyx_clineno, __pyx_lineno, __pyx_filename);
+      if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 341, __pyx_L5_except_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      __Pyx_GOTREF(__pyx_t_6);
+      __Pyx_GOTREF(__pyx_t_7);
+
+342:         dct = _localimpl_create_dict(impl, greenlet, idg)
+
      __pyx_t_8 = __pyx_f_6gevent_6_local__localimpl_create_dict(__pyx_v_impl, __pyx_v_greenlet, __pyx_v_idg); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 342, __pyx_L5_except_error)
+      __Pyx_GOTREF(__pyx_t_8);
+      __Pyx_XDECREF_SET(__pyx_v_dct, ((PyObject*)__pyx_t_8));
+      __pyx_t_8 = 0;
+
+343:         self.__init__(*impl.localargs, **impl.localkwargs)
+
      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_init); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 343, __pyx_L5_except_error)
+      __Pyx_GOTREF(__pyx_t_8);
+      if (unlikely(__pyx_v_impl->localargs == Py_None)) {
+        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
+        __PYX_ERR(0, 343, __pyx_L5_except_error)
+      }
+      if (unlikely(__pyx_v_impl->localkwargs == Py_None)) {
+        PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType");
+        __PYX_ERR(0, 343, __pyx_L5_except_error)
+      }
+      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_v_impl->localargs, __pyx_v_impl->localkwargs); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 343, __pyx_L5_except_error)
+      __Pyx_GOTREF(__pyx_t_9);
+      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+      goto __pyx_L4_exception_handled;
+    }
+    goto __pyx_L5_except_error;
+    __pyx_L5_except_error:;
+
+344:     return dct
+
  __Pyx_XDECREF(__pyx_r);
+  __Pyx_INCREF(__pyx_v_dct);
+  __pyx_r = __pyx_v_dct;
+  goto __pyx_L0;
+
 345: 
+
+346: def _init():
+
static void __pyx_f_6gevent_6_local__init(void) {
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_init", 0);
+/* … */
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+}
+
+347:     greenlet_init() # pylint:disable=undefined-variable
+
  __pyx_f_6gevent_6_local_greenlet_init();
+
 348: 
+
 349: _local_attrs = {
+
+350:     '_local__impl',
+
  __pyx_t_2 = PySet_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 350, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PySet_Add(__pyx_t_2, __pyx_n_s_local__impl) < 0) __PYX_ERR(0, 350, __pyx_L1_error)
+  if (PySet_Add(__pyx_t_2, __pyx_n_s_local_type_get_descriptors) < 0) __PYX_ERR(0, 350, __pyx_L1_error)
+  if (PySet_Add(__pyx_t_2, __pyx_n_s_local_type_set_or_del_descripto) < 0) __PYX_ERR(0, 350, __pyx_L1_error)
+  if (PySet_Add(__pyx_t_2, __pyx_n_s_local_type_del_descriptors) < 0) __PYX_ERR(0, 350, __pyx_L1_error)
+  if (PySet_Add(__pyx_t_2, __pyx_n_s_local_type_set_descriptors) < 0) __PYX_ERR(0, 350, __pyx_L1_error)
+  if (PySet_Add(__pyx_t_2, __pyx_n_s_local_type_2) < 0) __PYX_ERR(0, 350, __pyx_L1_error)
+  if (PySet_Add(__pyx_t_2, __pyx_n_s_local_type_vars) < 0) __PYX_ERR(0, 350, __pyx_L1_error)
+  if (PySet_Add(__pyx_t_2, __pyx_n_s_class) < 0) __PYX_ERR(0, 350, __pyx_L1_error)
+  if (PySet_Add(__pyx_t_2, __pyx_n_s_cinit) < 0) __PYX_ERR(0, 350, __pyx_L1_error)
+  __Pyx_XGOTREF(__pyx_v_6gevent_6_local__local_attrs);
+  __Pyx_DECREF_SET(__pyx_v_6gevent_6_local__local_attrs, ((PyObject*)__pyx_t_2));
+  __Pyx_GIVEREF(__pyx_t_2);
+  __pyx_t_2 = 0;
+
 351:     '_local_type_get_descriptors',
+
 352:     '_local_type_set_or_del_descriptors',
+
 353:     '_local_type_del_descriptors',
+
 354:     '_local_type_set_descriptors',
+
 355:     '_local_type',
+
 356:     '_local_type_vars',
+
 357:     '__class__',
+
 358:     '__cinit__',
+
 359: }
+
 360: 
+
+361: class local(object):
+
struct __pyx_vtabstruct_6gevent_6_local_local {
+  struct __pyx_obj_6gevent_6_local_local *(*__pyx___copy__)(struct __pyx_obj_6gevent_6_local_local *, int __pyx_skip_dispatch);
+};
+static struct __pyx_vtabstruct_6gevent_6_local_local *__pyx_vtabptr_6gevent_6_local_local;
+
 362:     """
+
 363:     An object whose attributes are greenlet-local.
+
 364:     """
+
+365:     __slots__ = tuple(_local_attrs - {'__class__', '__cinit__'})
+
  __pyx_t_2 = PySet_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 365, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PySet_Add(__pyx_t_2, __pyx_n_s_class) < 0) __PYX_ERR(0, 365, __pyx_L1_error)
+  if (PySet_Add(__pyx_t_2, __pyx_n_s_cinit) < 0) __PYX_ERR(0, 365, __pyx_L1_error)
+  __pyx_t_1 = PyNumber_Subtract(__pyx_v_6gevent_6_local__local_attrs, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 365, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_2 = __Pyx_PySequence_Tuple(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 365, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_local_local->tp_dict, __pyx_n_s_slots, __pyx_t_2) < 0) __PYX_ERR(0, 365, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_6_local_local);
+
 366: 
+
+367:     def __cinit__(self, *args, **kw):
+
/* Python wrapper */
+static int __pyx_pw_6gevent_6_local_5local_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static int __pyx_pw_6gevent_6_local_5local_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_args = 0;
+  PyObject *__pyx_v_kw = 0;
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
+  if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 1))) return -1;
+  __pyx_v_kw = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New(); if (unlikely(!__pyx_v_kw)) return -1;
+  __Pyx_GOTREF(__pyx_v_kw);
+  __Pyx_INCREF(__pyx_args);
+  __pyx_v_args = __pyx_args;
+  __pyx_r = __pyx_pf_6gevent_6_local_5local___cinit__(((struct __pyx_obj_6gevent_6_local_local *)__pyx_v_self), __pyx_v_args, __pyx_v_kw);
+
+  /* function exit code */
+  __Pyx_XDECREF(__pyx_v_args);
+  __Pyx_XDECREF(__pyx_v_kw);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_6_local_5local___cinit__(struct __pyx_obj_6gevent_6_local_local *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kw) {
+  struct __pyx_obj_6gevent_6_local__localimpl *__pyx_v_impl = NULL;
+  PyObject *__pyx_v_get = NULL;
+  PyObject *__pyx_v_dels = NULL;
+  PyObject *__pyx_v_sets_or_dels = NULL;
+  PyObject *__pyx_v_sets = NULL;
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__cinit__", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = 0;
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_XDECREF(__pyx_t_6);
+  __Pyx_XDECREF(__pyx_t_7);
+  __Pyx_AddTraceback("gevent._local.local.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = -1;
+  __pyx_L0:;
+  __Pyx_XDECREF((PyObject *)__pyx_v_impl);
+  __Pyx_XDECREF(__pyx_v_get);
+  __Pyx_XDECREF(__pyx_v_dels);
+  __Pyx_XDECREF(__pyx_v_sets_or_dels);
+  __Pyx_XDECREF(__pyx_v_sets);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+368:         if args or kw:
+
  __pyx_t_2 = (PyTuple_GET_SIZE(__pyx_v_args) != 0);
+  if (!__pyx_t_2) {
+  } else {
+    __pyx_t_1 = __pyx_t_2;
+    goto __pyx_L4_bool_binop_done;
+  }
+  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_kw); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 368, __pyx_L1_error)
+  __pyx_t_1 = __pyx_t_2;
+  __pyx_L4_bool_binop_done:;
+  if (__pyx_t_1) {
+/* … */
+  }
+
+369:             if type(self).__init__ == object.__init__:
+
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))), __pyx_n_s_init); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 369, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_builtin_object, __pyx_n_s_init); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 369, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 369, __pyx_L1_error)
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 369, __pyx_L1_error)
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    if (unlikely(__pyx_t_1)) {
+/* … */
+    }
+
+370:                 raise TypeError("Initialization arguments are not supported", args, kw)
+
      __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 370, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_5);
+      __Pyx_INCREF(__pyx_kp_s_Initialization_arguments_are_not);
+      __Pyx_GIVEREF(__pyx_kp_s_Initialization_arguments_are_not);
+      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_kp_s_Initialization_arguments_are_not);
+      __Pyx_INCREF(__pyx_v_args);
+      __Pyx_GIVEREF(__pyx_v_args);
+      PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_args);
+      __Pyx_INCREF(__pyx_v_kw);
+      __Pyx_GIVEREF(__pyx_v_kw);
+      PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_kw);
+      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 370, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_4);
+      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+      __Pyx_Raise(__pyx_t_4, 0, 0, 0);
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __PYX_ERR(0, 370, __pyx_L1_error)
+
+371:         impl = _localimpl(args, kw, type(self), id(self))
+
  __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 371, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_4);
+  __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 371, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_5);
+  __Pyx_INCREF(__pyx_v_args);
+  __Pyx_GIVEREF(__pyx_v_args);
+  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_args);
+  __Pyx_INCREF(__pyx_v_kw);
+  __Pyx_GIVEREF(__pyx_v_kw);
+  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_kw);
+  __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
+  __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
+  PyTuple_SET_ITEM(__pyx_t_5, 2, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
+  __Pyx_GIVEREF(__pyx_t_4);
+  PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4);
+  __pyx_t_4 = 0;
+  __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6gevent_6_local__localimpl), __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 371, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_4);
+  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+  __pyx_v_impl = ((struct __pyx_obj_6gevent_6_local__localimpl *)__pyx_t_4);
+  __pyx_t_4 = 0;
+
 372:         # pylint:disable=attribute-defined-outside-init
+
+373:         self._local__impl = impl
+
  __Pyx_INCREF(((PyObject *)__pyx_v_impl));
+  __Pyx_GIVEREF(((PyObject *)__pyx_v_impl));
+  __Pyx_GOTREF(__pyx_v_self->_local__impl);
+  __Pyx_DECREF(((PyObject *)__pyx_v_self->_local__impl));
+  __pyx_v_self->_local__impl = __pyx_v_impl;
+
+374:         get, dels, sets_or_dels, sets = _local_find_descriptors(self)
+
  __pyx_t_4 = __pyx_f_6gevent_6_local__local_find_descriptors(__pyx_v_self); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 374, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_4);
+  if (likely(__pyx_t_4 != Py_None)) {
+    PyObject* sequence = __pyx_t_4;
+    Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
+    if (unlikely(size != 4)) {
+      if (size > 4) __Pyx_RaiseTooManyValuesError(4);
+      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
+      __PYX_ERR(0, 374, __pyx_L1_error)
+    }
+    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+    __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); 
+    __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); 
+    __pyx_t_6 = PyTuple_GET_ITEM(sequence, 2); 
+    __pyx_t_7 = PyTuple_GET_ITEM(sequence, 3); 
+    __Pyx_INCREF(__pyx_t_5);
+    __Pyx_INCREF(__pyx_t_3);
+    __Pyx_INCREF(__pyx_t_6);
+    __Pyx_INCREF(__pyx_t_7);
+    #else
+    {
+      Py_ssize_t i;
+      PyObject** temps[4] = {&__pyx_t_5,&__pyx_t_3,&__pyx_t_6,&__pyx_t_7};
+      for (i=0; i < 4; i++) {
+        PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(0, 374, __pyx_L1_error)
+        __Pyx_GOTREF(item);
+        *(temps[i]) = item;
+      }
+    }
+    #endif
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  } else {
+    __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(0, 374, __pyx_L1_error)
+  }
+  __pyx_v_get = __pyx_t_5;
+  __pyx_t_5 = 0;
+  __pyx_v_dels = __pyx_t_3;
+  __pyx_t_3 = 0;
+  __pyx_v_sets_or_dels = __pyx_t_6;
+  __pyx_t_6 = 0;
+  __pyx_v_sets = __pyx_t_7;
+  __pyx_t_7 = 0;
+
+375:         self._local_type_get_descriptors = get
+
  if (!(likely(PySet_CheckExact(__pyx_v_get))||((__pyx_v_get) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "set", Py_TYPE(__pyx_v_get)->tp_name), 0))) __PYX_ERR(0, 375, __pyx_L1_error)
+  __pyx_t_4 = __pyx_v_get;
+  __Pyx_INCREF(__pyx_t_4);
+  __Pyx_GIVEREF(__pyx_t_4);
+  __Pyx_GOTREF(__pyx_v_self->_local_type_get_descriptors);
+  __Pyx_DECREF(__pyx_v_self->_local_type_get_descriptors);
+  __pyx_v_self->_local_type_get_descriptors = ((PyObject*)__pyx_t_4);
+  __pyx_t_4 = 0;
+
+376:         self._local_type_set_or_del_descriptors = sets_or_dels
+
  if (!(likely(PySet_CheckExact(__pyx_v_sets_or_dels))||((__pyx_v_sets_or_dels) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "set", Py_TYPE(__pyx_v_sets_or_dels)->tp_name), 0))) __PYX_ERR(0, 376, __pyx_L1_error)
+  __pyx_t_4 = __pyx_v_sets_or_dels;
+  __Pyx_INCREF(__pyx_t_4);
+  __Pyx_GIVEREF(__pyx_t_4);
+  __Pyx_GOTREF(__pyx_v_self->_local_type_set_or_del_descriptors);
+  __Pyx_DECREF(__pyx_v_self->_local_type_set_or_del_descriptors);
+  __pyx_v_self->_local_type_set_or_del_descriptors = ((PyObject*)__pyx_t_4);
+  __pyx_t_4 = 0;
+
+377:         self._local_type_del_descriptors = dels
+
  if (!(likely(PySet_CheckExact(__pyx_v_dels))||((__pyx_v_dels) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "set", Py_TYPE(__pyx_v_dels)->tp_name), 0))) __PYX_ERR(0, 377, __pyx_L1_error)
+  __pyx_t_4 = __pyx_v_dels;
+  __Pyx_INCREF(__pyx_t_4);
+  __Pyx_GIVEREF(__pyx_t_4);
+  __Pyx_GOTREF(__pyx_v_self->_local_type_del_descriptors);
+  __Pyx_DECREF(__pyx_v_self->_local_type_del_descriptors);
+  __pyx_v_self->_local_type_del_descriptors = ((PyObject*)__pyx_t_4);
+  __pyx_t_4 = 0;
+
+378:         self._local_type_set_descriptors = sets
+
  if (!(likely(PySet_CheckExact(__pyx_v_sets))||((__pyx_v_sets) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "set", Py_TYPE(__pyx_v_sets)->tp_name), 0))) __PYX_ERR(0, 378, __pyx_L1_error)
+  __pyx_t_4 = __pyx_v_sets;
+  __Pyx_INCREF(__pyx_t_4);
+  __Pyx_GIVEREF(__pyx_t_4);
+  __Pyx_GOTREF(__pyx_v_self->_local_type_set_descriptors);
+  __Pyx_DECREF(__pyx_v_self->_local_type_set_descriptors);
+  __pyx_v_self->_local_type_set_descriptors = ((PyObject*)__pyx_t_4);
+  __pyx_t_4 = 0;
+
+379:         self._local_type = type(self)
+
  __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
+  __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
+  __Pyx_GOTREF(__pyx_v_self->_local_type);
+  __Pyx_DECREF(((PyObject *)__pyx_v_self->_local_type));
+  __pyx_v_self->_local_type = ((PyTypeObject*)((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
+
+380:         self._local_type_vars = set(dir(self._local_type))
+
  __pyx_t_4 = ((PyObject *)__pyx_v_self->_local_type);
+  __Pyx_INCREF(__pyx_t_4);
+  __pyx_t_7 = PyObject_Dir(__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 380, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_7);
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __pyx_t_4 = PySet_New(__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 380, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_4);
+  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __Pyx_GIVEREF(__pyx_t_4);
+  __Pyx_GOTREF(__pyx_v_self->_local_type_vars);
+  __Pyx_DECREF(__pyx_v_self->_local_type_vars);
+  __pyx_v_self->_local_type_vars = ((PyObject*)__pyx_t_4);
+  __pyx_t_4 = 0;
+
 381: 
+
+382:     def __getattribute__(self, name): # pylint:disable=too-many-return-statements
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_local_5local_3__getattribute__(PyObject *__pyx_v_self, PyObject *__pyx_v_name); /*proto*/
+static PyObject *__pyx_pw_6gevent_6_local_5local_3__getattribute__(PyObject *__pyx_v_self, PyObject *__pyx_v_name) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__getattribute__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_6_local_5local_2__getattribute__(((struct __pyx_obj_6gevent_6_local_local *)__pyx_v_self), ((PyObject *)__pyx_v_name));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_local_5local_2__getattribute__(struct __pyx_obj_6gevent_6_local_local *__pyx_v_self, PyObject *__pyx_v_name) {
+  PyObject *__pyx_v_dct = NULL;
+  PyObject *__pyx_v_type_attr = NULL;
+  PyObject *__pyx_v_base = NULL;
+  PyObject *__pyx_v_bd = NULL;
+  PyObject *__pyx_v_attr_on_type = NULL;
+  PyObject *__pyx_v_result = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__getattribute__", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_XDECREF(__pyx_t_7);
+  __Pyx_XDECREF(__pyx_t_8);
+  __Pyx_AddTraceback("gevent._local.local.__getattribute__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_dct);
+  __Pyx_XDECREF(__pyx_v_type_attr);
+  __Pyx_XDECREF(__pyx_v_base);
+  __Pyx_XDECREF(__pyx_v_bd);
+  __Pyx_XDECREF(__pyx_v_attr_on_type);
+  __Pyx_XDECREF(__pyx_v_result);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+383:         if name in _local_attrs:
+
  if (unlikely(__pyx_v_6gevent_6_local__local_attrs == Py_None)) {
+    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
+    __PYX_ERR(0, 383, __pyx_L1_error)
+  }
+  __pyx_t_1 = (__Pyx_PySet_ContainsTF(__pyx_v_name, __pyx_v_6gevent_6_local__local_attrs, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 383, __pyx_L1_error)
+  __pyx_t_2 = (__pyx_t_1 != 0);
+  if (__pyx_t_2) {
+/* … */
+  }
+
 384:             # The _local__impl,  __cinit__, etc, won't be hit by the
+
 385:             # Cython version, if we've done things right. If we haven't,
+
 386:             # they will be, and this will produce an error.
+
+387:             return object.__getattribute__(self, name)
+
    __Pyx_XDECREF(__pyx_r);
+    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_builtin_object, __pyx_n_s_getattribute); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 387, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    __pyx_t_5 = NULL;
+    __pyx_t_6 = 0;
+    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
+      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
+      if (likely(__pyx_t_5)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
+        __Pyx_INCREF(__pyx_t_5);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_4, function);
+        __pyx_t_6 = 1;
+      }
+    }
+    #if CYTHON_FAST_PYCALL
+    if (PyFunction_Check(__pyx_t_4)) {
+      PyObject *__pyx_temp[3] = {__pyx_t_5, ((PyObject *)__pyx_v_self), __pyx_v_name};
+      __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 387, __pyx_L1_error)
+      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+      __Pyx_GOTREF(__pyx_t_3);
+    } else
+    #endif
+    #if CYTHON_FAST_PYCCALL
+    if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
+      PyObject *__pyx_temp[3] = {__pyx_t_5, ((PyObject *)__pyx_v_self), __pyx_v_name};
+      __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 387, __pyx_L1_error)
+      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+      __Pyx_GOTREF(__pyx_t_3);
+    } else
+    #endif
+    {
+      __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 387, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_7);
+      if (__pyx_t_5) {
+        __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
+      }
+      __Pyx_INCREF(((PyObject *)__pyx_v_self));
+      __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
+      PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, ((PyObject *)__pyx_v_self));
+      __Pyx_INCREF(__pyx_v_name);
+      __Pyx_GIVEREF(__pyx_v_name);
+      PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_name);
+      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 387, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_3);
+      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+    }
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __pyx_r = __pyx_t_3;
+    __pyx_t_3 = 0;
+    goto __pyx_L0;
+
 388: 
+
+389:         dct = _local_get_dict(self)
+
  __pyx_t_3 = __pyx_f_6gevent_6_local__local_get_dict(__pyx_v_self); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 389, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __pyx_v_dct = ((PyObject*)__pyx_t_3);
+  __pyx_t_3 = 0;
+
 390: 
+
+391:         if name == '__dict__':
+
  __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_name, __pyx_n_s_dict, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 391, __pyx_L1_error)
+  if (__pyx_t_2) {
+/* … */
+  }
+
+392:             return dct
+
    __Pyx_XDECREF(__pyx_r);
+    __Pyx_INCREF(__pyx_v_dct);
+    __pyx_r = __pyx_v_dct;
+    goto __pyx_L0;
+
 393:         # If there's no possible way we can switch, because this
+
 394:         # attribute is *not* found in the class where it might be a
+
 395:         # data descriptor (property), and it *is* in the dict
+
 396:         # then we don't need to swizzle the dict and take the lock.
+
 397: 
+
 398:         # We don't have to worry about people overriding __getattribute__
+
 399:         # because if they did, the dict-swizzling would only last as
+
 400:         # long as we were in here anyway.
+
 401:         # Similarly, a __getattr__ will still be called by _oga() if needed
+
 402:         # if it's not in the dict.
+
 403: 
+
 404:         # Optimization: If we're not subclassed, then
+
 405:         # there can be no descriptors except for methods, which will
+
 406:         # never need to use __dict__.
+
+407:         if self._local_type is local:
+
  __pyx_t_2 = (__pyx_v_self->_local_type == __pyx_ptype_6gevent_6_local_local);
+  __pyx_t_1 = (__pyx_t_2 != 0);
+  if (__pyx_t_1) {
+/* … */
+  }
+
+408:             return dct[name] if name in dct else object.__getattribute__(self, name)
+
    __Pyx_XDECREF(__pyx_r);
+    if (unlikely(__pyx_v_dct == Py_None)) {
+      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
+      __PYX_ERR(0, 408, __pyx_L1_error)
+    }
+    __pyx_t_1 = (__Pyx_PyDict_ContainsTF(__pyx_v_name, __pyx_v_dct, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 408, __pyx_L1_error)
+    if ((__pyx_t_1 != 0)) {
+      if (unlikely(__pyx_v_dct == Py_None)) {
+        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
+        __PYX_ERR(0, 408, __pyx_L1_error)
+      }
+      __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_dct, __pyx_v_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 408, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_4);
+      __pyx_t_3 = __pyx_t_4;
+      __pyx_t_4 = 0;
+    } else {
+      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_builtin_object, __pyx_n_s_getattribute); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 408, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_7);
+      __pyx_t_5 = NULL;
+      __pyx_t_6 = 0;
+      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
+        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
+        if (likely(__pyx_t_5)) {
+          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
+          __Pyx_INCREF(__pyx_t_5);
+          __Pyx_INCREF(function);
+          __Pyx_DECREF_SET(__pyx_t_7, function);
+          __pyx_t_6 = 1;
+        }
+      }
+      #if CYTHON_FAST_PYCALL
+      if (PyFunction_Check(__pyx_t_7)) {
+        PyObject *__pyx_temp[3] = {__pyx_t_5, ((PyObject *)__pyx_v_self), __pyx_v_name};
+        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 408, __pyx_L1_error)
+        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+        __Pyx_GOTREF(__pyx_t_4);
+      } else
+      #endif
+      #if CYTHON_FAST_PYCCALL
+      if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
+        PyObject *__pyx_temp[3] = {__pyx_t_5, ((PyObject *)__pyx_v_self), __pyx_v_name};
+        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 408, __pyx_L1_error)
+        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+        __Pyx_GOTREF(__pyx_t_4);
+      } else
+      #endif
+      {
+        __pyx_t_8 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 408, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_8);
+        if (__pyx_t_5) {
+          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL;
+        }
+        __Pyx_INCREF(((PyObject *)__pyx_v_self));
+        __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
+        PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_6, ((PyObject *)__pyx_v_self));
+        __Pyx_INCREF(__pyx_v_name);
+        __Pyx_GIVEREF(__pyx_v_name);
+        PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_6, __pyx_v_name);
+        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 408, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_4);
+        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+      }
+      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+      __pyx_t_3 = __pyx_t_4;
+      __pyx_t_4 = 0;
+    }
+    __pyx_r = __pyx_t_3;
+    __pyx_t_3 = 0;
+    goto __pyx_L0;
+
 409: 
+
 410:         # NOTE: If this is a descriptor, this will invoke its __get__.
+
 411:         # A broken descriptor that doesn't return itself when called with
+
 412:         # a None for the instance argument could mess us up here.
+
 413:         # But this is faster than a loop over mro() checking each class __dict__
+
 414:         # manually.
+
+415:         if name in dct:
+
  if (unlikely(__pyx_v_dct == Py_None)) {
+    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
+    __PYX_ERR(0, 415, __pyx_L1_error)
+  }
+  __pyx_t_1 = (__Pyx_PyDict_ContainsTF(__pyx_v_name, __pyx_v_dct, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 415, __pyx_L1_error)
+  __pyx_t_2 = (__pyx_t_1 != 0);
+  if (__pyx_t_2) {
+/* … */
+  }
+
+416:             if name not in self._local_type_vars:
+
    if (unlikely(__pyx_v_self->_local_type_vars == Py_None)) {
+      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
+      __PYX_ERR(0, 416, __pyx_L1_error)
+    }
+    __pyx_t_2 = (__Pyx_PySet_ContainsTF(__pyx_v_name, __pyx_v_self->_local_type_vars, Py_NE)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 416, __pyx_L1_error)
+    __pyx_t_1 = (__pyx_t_2 != 0);
+    if (__pyx_t_1) {
+/* … */
+    }
+
 417:                 # If there is a dict value, and nothing in the type,
+
 418:                 # it can't possibly be a descriptor, so it is just returned.
+
+419:                 return dct[name]
+
      __Pyx_XDECREF(__pyx_r);
+      if (unlikely(__pyx_v_dct == Py_None)) {
+        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
+        __PYX_ERR(0, 419, __pyx_L1_error)
+      }
+      __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_dct, __pyx_v_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 419, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_3);
+      __pyx_r = __pyx_t_3;
+      __pyx_t_3 = 0;
+      goto __pyx_L0;
+
 420: 
+
 421:             # It's in the type *and* in the dict. If the type value is
+
 422:             # a data descriptor (defines __get__ *and* either __set__ or
+
 423:             # __delete__), then the type wins. If it's a non-data descriptor
+
 424:             # (defines just __get__), then the instance wins. If it's not a
+
 425:             # descriptor at all (doesn't have __get__), the instance wins.
+
 426:             # NOTE that the docs for descriptors say that these methods must be
+
 427:             # defined on the *class* of the object in the type.
+
+428:             if name not in self._local_type_get_descriptors:
+
    if (unlikely(__pyx_v_self->_local_type_get_descriptors == Py_None)) {
+      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
+      __PYX_ERR(0, 428, __pyx_L1_error)
+    }
+    __pyx_t_1 = (__Pyx_PySet_ContainsTF(__pyx_v_name, __pyx_v_self->_local_type_get_descriptors, Py_NE)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 428, __pyx_L1_error)
+    __pyx_t_2 = (__pyx_t_1 != 0);
+    if (__pyx_t_2) {
+/* … */
+    }
+
 429:                 # Entirely not a descriptor. Instance wins.
+
+430:                 return dct[name]
+
      __Pyx_XDECREF(__pyx_r);
+      if (unlikely(__pyx_v_dct == Py_None)) {
+        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
+        __PYX_ERR(0, 430, __pyx_L1_error)
+      }
+      __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_dct, __pyx_v_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 430, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_3);
+      __pyx_r = __pyx_t_3;
+      __pyx_t_3 = 0;
+      goto __pyx_L0;
+
+431:             if name in self._local_type_set_or_del_descriptors:
+
    if (unlikely(__pyx_v_self->_local_type_set_or_del_descriptors == Py_None)) {
+      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
+      __PYX_ERR(0, 431, __pyx_L1_error)
+    }
+    __pyx_t_2 = (__Pyx_PySet_ContainsTF(__pyx_v_name, __pyx_v_self->_local_type_set_or_del_descriptors, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 431, __pyx_L1_error)
+    __pyx_t_1 = (__pyx_t_2 != 0);
+    if (__pyx_t_1) {
+/* … */
+    }
+
 432:                 # A data descriptor.
+
 433:                 # arbitrary code execution while these run. If they touch self again,
+
 434:                 # they'll call back into us and we'll repeat the dance.
+
+435:                 type_attr = getattr(self._local_type, name)
+
      __pyx_t_3 = ((PyObject *)__pyx_v_self->_local_type);
+      __Pyx_INCREF(__pyx_t_3);
+      __pyx_t_4 = __Pyx_GetAttr(__pyx_t_3, __pyx_v_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 435, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_4);
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __pyx_v_type_attr = __pyx_t_4;
+      __pyx_t_4 = 0;
+
+436:                 return type(type_attr).__get__(type_attr, self, self._local_type)
+
      __Pyx_XDECREF(__pyx_r);
+      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)Py_TYPE(__pyx_v_type_attr)), __pyx_n_s_get); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 436, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_3);
+      __pyx_t_7 = NULL;
+      __pyx_t_6 = 0;
+      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
+        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3);
+        if (likely(__pyx_t_7)) {
+          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+          __Pyx_INCREF(__pyx_t_7);
+          __Pyx_INCREF(function);
+          __Pyx_DECREF_SET(__pyx_t_3, function);
+          __pyx_t_6 = 1;
+        }
+      }
+      #if CYTHON_FAST_PYCALL
+      if (PyFunction_Check(__pyx_t_3)) {
+        PyObject *__pyx_temp[4] = {__pyx_t_7, __pyx_v_type_attr, ((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_self->_local_type)};
+        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 436, __pyx_L1_error)
+        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+        __Pyx_GOTREF(__pyx_t_4);
+      } else
+      #endif
+      #if CYTHON_FAST_PYCCALL
+      if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
+        PyObject *__pyx_temp[4] = {__pyx_t_7, __pyx_v_type_attr, ((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_self->_local_type)};
+        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 436, __pyx_L1_error)
+        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+        __Pyx_GOTREF(__pyx_t_4);
+      } else
+      #endif
+      {
+        __pyx_t_8 = PyTuple_New(3+__pyx_t_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 436, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_8);
+        if (__pyx_t_7) {
+          __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7); __pyx_t_7 = NULL;
+        }
+        __Pyx_INCREF(__pyx_v_type_attr);
+        __Pyx_GIVEREF(__pyx_v_type_attr);
+        PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_6, __pyx_v_type_attr);
+        __Pyx_INCREF(((PyObject *)__pyx_v_self));
+        __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
+        PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_6, ((PyObject *)__pyx_v_self));
+        __Pyx_INCREF(((PyObject *)__pyx_v_self->_local_type));
+        __Pyx_GIVEREF(((PyObject *)__pyx_v_self->_local_type));
+        PyTuple_SET_ITEM(__pyx_t_8, 2+__pyx_t_6, ((PyObject *)__pyx_v_self->_local_type));
+        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 436, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_4);
+        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+      }
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __pyx_r = __pyx_t_4;
+      __pyx_t_4 = 0;
+      goto __pyx_L0;
+
 437:             # Last case is a non-data descriptor. Instance wins.
+
+438:             return dct[name]
+
    __Pyx_XDECREF(__pyx_r);
+    if (unlikely(__pyx_v_dct == Py_None)) {
+      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
+      __PYX_ERR(0, 438, __pyx_L1_error)
+    }
+    __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_dct, __pyx_v_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 438, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    __pyx_r = __pyx_t_4;
+    __pyx_t_4 = 0;
+    goto __pyx_L0;
+
 439: 
+
+440:         if name in self._local_type_vars:
+
  if (unlikely(__pyx_v_self->_local_type_vars == Py_None)) {
+    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
+    __PYX_ERR(0, 440, __pyx_L1_error)
+  }
+  __pyx_t_1 = (__Pyx_PySet_ContainsTF(__pyx_v_name, __pyx_v_self->_local_type_vars, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 440, __pyx_L1_error)
+  __pyx_t_2 = (__pyx_t_1 != 0);
+  if (__pyx_t_2) {
+/* … */
+  }
+
 441:             # Not in the dictionary, but is found in the type. It could be
+
 442:             # a non-data descriptor still. Some descriptors, like @staticmethod,
+
 443:             # return objects (functions, in this case), that are *themselves*
+
 444:             # descriptors, which when invoked, again, would do the wrong thing.
+
 445:             # So we can't rely on getattr() on the type for them, we have to
+
 446:             # look through the MRO dicts ourself.
+
+447:             if name not in self._local_type_get_descriptors:
+
    if (unlikely(__pyx_v_self->_local_type_get_descriptors == Py_None)) {
+      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
+      __PYX_ERR(0, 447, __pyx_L1_error)
+    }
+    __pyx_t_2 = (__Pyx_PySet_ContainsTF(__pyx_v_name, __pyx_v_self->_local_type_get_descriptors, Py_NE)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 447, __pyx_L1_error)
+    __pyx_t_1 = (__pyx_t_2 != 0);
+    if (__pyx_t_1) {
+/* … */
+    }
+
 448:                 # Not a descriptor, can't execute code. So all we need is
+
 449:                 # the return value of getattr() on our type.
+
+450:                 return getattr(self._local_type, name)
+
      __Pyx_XDECREF(__pyx_r);
+      __pyx_t_4 = ((PyObject *)__pyx_v_self->_local_type);
+      __Pyx_INCREF(__pyx_t_4);
+      __pyx_t_3 = __Pyx_GetAttr(__pyx_t_4, __pyx_v_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 450, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_3);
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __pyx_r = __pyx_t_3;
+      __pyx_t_3 = 0;
+      goto __pyx_L0;
+
 451: 
+
+452:             for base in self._local_type.mro():
+
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->_local_type), __pyx_n_s_mro); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 452, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    __pyx_t_8 = NULL;
+    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
+      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_4);
+      if (likely(__pyx_t_8)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
+        __Pyx_INCREF(__pyx_t_8);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_4, function);
+      }
+    }
+    __pyx_t_3 = (__pyx_t_8) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_8) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
+    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
+    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 452, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
+      __pyx_t_4 = __pyx_t_3; __Pyx_INCREF(__pyx_t_4); __pyx_t_9 = 0;
+      __pyx_t_10 = NULL;
+    } else {
+      __pyx_t_9 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 452, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_4);
+      __pyx_t_10 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 452, __pyx_L1_error)
+    }
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    for (;;) {
+      if (likely(!__pyx_t_10)) {
+        if (likely(PyList_CheckExact(__pyx_t_4))) {
+          if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_4)) break;
+          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+          __pyx_t_3 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_9); __Pyx_INCREF(__pyx_t_3); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 452, __pyx_L1_error)
+          #else
+          __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 452, __pyx_L1_error)
+          __Pyx_GOTREF(__pyx_t_3);
+          #endif
+        } else {
+          if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
+          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+          __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_9); __Pyx_INCREF(__pyx_t_3); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 452, __pyx_L1_error)
+          #else
+          __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 452, __pyx_L1_error)
+          __Pyx_GOTREF(__pyx_t_3);
+          #endif
+        }
+      } else {
+        __pyx_t_3 = __pyx_t_10(__pyx_t_4);
+        if (unlikely(!__pyx_t_3)) {
+          PyObject* exc_type = PyErr_Occurred();
+          if (exc_type) {
+            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+            else __PYX_ERR(0, 452, __pyx_L1_error)
+          }
+          break;
+        }
+        __Pyx_GOTREF(__pyx_t_3);
+      }
+      __Pyx_XDECREF_SET(__pyx_v_base, __pyx_t_3);
+      __pyx_t_3 = 0;
+/* … */
+    }
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+
+453:                 bd = base.__dict__
+
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_dict); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 453, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_3);
+      __Pyx_XDECREF_SET(__pyx_v_bd, __pyx_t_3);
+      __pyx_t_3 = 0;
+
+454:                 if name in bd:
+
      __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_v_name, __pyx_v_bd, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 454, __pyx_L1_error)
+      __pyx_t_2 = (__pyx_t_1 != 0);
+      if (__pyx_t_2) {
+/* … */
+      }
+
+455:                     attr_on_type = bd[name]
+
        __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_bd, __pyx_v_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 455, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_3);
+        __pyx_v_attr_on_type = __pyx_t_3;
+        __pyx_t_3 = 0;
+
+456:                     result = type(attr_on_type).__get__(attr_on_type, self, self._local_type)
+
        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)Py_TYPE(__pyx_v_attr_on_type)), __pyx_n_s_get); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 456, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_8);
+        __pyx_t_7 = NULL;
+        __pyx_t_6 = 0;
+        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
+          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_8);
+          if (likely(__pyx_t_7)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
+            __Pyx_INCREF(__pyx_t_7);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_8, function);
+            __pyx_t_6 = 1;
+          }
+        }
+        #if CYTHON_FAST_PYCALL
+        if (PyFunction_Check(__pyx_t_8)) {
+          PyObject *__pyx_temp[4] = {__pyx_t_7, __pyx_v_attr_on_type, ((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_self->_local_type)};
+          __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 456, __pyx_L1_error)
+          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+          __Pyx_GOTREF(__pyx_t_3);
+        } else
+        #endif
+        #if CYTHON_FAST_PYCCALL
+        if (__Pyx_PyFastCFunction_Check(__pyx_t_8)) {
+          PyObject *__pyx_temp[4] = {__pyx_t_7, __pyx_v_attr_on_type, ((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_self->_local_type)};
+          __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 456, __pyx_L1_error)
+          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+          __Pyx_GOTREF(__pyx_t_3);
+        } else
+        #endif
+        {
+          __pyx_t_5 = PyTuple_New(3+__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 456, __pyx_L1_error)
+          __Pyx_GOTREF(__pyx_t_5);
+          if (__pyx_t_7) {
+            __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7); __pyx_t_7 = NULL;
+          }
+          __Pyx_INCREF(__pyx_v_attr_on_type);
+          __Pyx_GIVEREF(__pyx_v_attr_on_type);
+          PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_6, __pyx_v_attr_on_type);
+          __Pyx_INCREF(((PyObject *)__pyx_v_self));
+          __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
+          PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_6, ((PyObject *)__pyx_v_self));
+          __Pyx_INCREF(((PyObject *)__pyx_v_self->_local_type));
+          __Pyx_GIVEREF(((PyObject *)__pyx_v_self->_local_type));
+          PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_6, ((PyObject *)__pyx_v_self->_local_type));
+          __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 456, __pyx_L1_error)
+          __Pyx_GOTREF(__pyx_t_3);
+          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+        }
+        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+        __pyx_v_result = __pyx_t_3;
+        __pyx_t_3 = 0;
+
+457:                     return result
+
        __Pyx_XDECREF(__pyx_r);
+        __Pyx_INCREF(__pyx_v_result);
+        __pyx_r = __pyx_v_result;
+        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+        goto __pyx_L0;
+
 458: 
+
 459:         # It wasn't in the dict and it wasn't in the type.
+
 460:         # So the next step is to invoke type(self)__getattr__, if it
+
 461:         # exists, otherwise raise an AttributeError.
+
 462:         # we will invoke type(self).__getattr__ or raise an attribute error.
+
+463:         if hasattr(self._local_type, '__getattr__'):
+
  __pyx_t_4 = ((PyObject *)__pyx_v_self->_local_type);
+  __Pyx_INCREF(__pyx_t_4);
+  __pyx_t_2 = __Pyx_HasAttr(__pyx_t_4, __pyx_n_s_getattr); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 463, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __pyx_t_1 = (__pyx_t_2 != 0);
+  if (__pyx_t_1) {
+/* … */
+  }
+
+464:             return self._local_type.__getattr__(self, name)
+
    __Pyx_XDECREF(__pyx_r);
+    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->_local_type), __pyx_n_s_getattr); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 464, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __pyx_t_8 = NULL;
+    __pyx_t_6 = 0;
+    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
+      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_3);
+      if (likely(__pyx_t_8)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+        __Pyx_INCREF(__pyx_t_8);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_3, function);
+        __pyx_t_6 = 1;
+      }
+    }
+    #if CYTHON_FAST_PYCALL
+    if (PyFunction_Check(__pyx_t_3)) {
+      PyObject *__pyx_temp[3] = {__pyx_t_8, ((PyObject *)__pyx_v_self), __pyx_v_name};
+      __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 464, __pyx_L1_error)
+      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
+      __Pyx_GOTREF(__pyx_t_4);
+    } else
+    #endif
+    #if CYTHON_FAST_PYCCALL
+    if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
+      PyObject *__pyx_temp[3] = {__pyx_t_8, ((PyObject *)__pyx_v_self), __pyx_v_name};
+      __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 464, __pyx_L1_error)
+      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
+      __Pyx_GOTREF(__pyx_t_4);
+    } else
+    #endif
+    {
+      __pyx_t_5 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 464, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_5);
+      if (__pyx_t_8) {
+        __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_8); __pyx_t_8 = NULL;
+      }
+      __Pyx_INCREF(((PyObject *)__pyx_v_self));
+      __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
+      PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_6, ((PyObject *)__pyx_v_self));
+      __Pyx_INCREF(__pyx_v_name);
+      __Pyx_GIVEREF(__pyx_v_name);
+      PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_6, __pyx_v_name);
+      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 464, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_4);
+      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    }
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __pyx_r = __pyx_t_4;
+    __pyx_t_4 = 0;
+    goto __pyx_L0;
+
+465:         raise AttributeError("%r object has no attribute '%s'"
+
  __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_AttributeError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 465, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __PYX_ERR(0, 465, __pyx_L1_error)
+
+466:                              % (self._local_type.__name__, name))
+
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->_local_type), __pyx_n_s_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 466, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_4);
+  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 466, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_GIVEREF(__pyx_t_4);
+  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
+  __Pyx_INCREF(__pyx_v_name);
+  __Pyx_GIVEREF(__pyx_v_name);
+  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_name);
+  __pyx_t_4 = 0;
+  __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_r_object_has_no_attribute_s, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 466, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_4);
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+
 467: 
+
+468:     def __setattr__(self, name, value):
+
/* Python wrapper */
+static int __pyx_pw_6gevent_6_local_5local_5__setattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_value); /*proto*/
+static int __pyx_pw_6gevent_6_local_5local_5__setattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_value) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__setattr__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_6_local_5local_4__setattr__(((struct __pyx_obj_6gevent_6_local_local *)__pyx_v_self), ((PyObject *)__pyx_v_name), ((PyObject *)__pyx_v_value));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_6_local_5local_4__setattr__(struct __pyx_obj_6gevent_6_local_local *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_value) {
+  PyObject *__pyx_v_dct = NULL;
+  PyObject *__pyx_v_type_attr = NULL;
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__setattr__", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = 0;
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_XDECREF(__pyx_t_7);
+  __Pyx_AddTraceback("gevent._local.local.__setattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = -1;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_dct);
+  __Pyx_XDECREF(__pyx_v_type_attr);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+469:         if name == '__dict__':
+
  __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_name, __pyx_n_s_dict, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 469, __pyx_L1_error)
+  if (unlikely(__pyx_t_1)) {
+/* … */
+  }
+
+470:             raise AttributeError(
+
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_AttributeError, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 470, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __PYX_ERR(0, 470, __pyx_L1_error)
+
 471:                 "%r object attribute '__dict__' is read-only"
+
+472:                 % type(self))
+
    __pyx_t_2 = __Pyx_PyString_FormatSafe(__pyx_kp_s_r_object_attribute___dict___is, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 472, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+
 473: 
+
+474:         if name in _local_attrs:
+
  if (unlikely(__pyx_v_6gevent_6_local__local_attrs == Py_None)) {
+    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
+    __PYX_ERR(0, 474, __pyx_L1_error)
+  }
+  __pyx_t_1 = (__Pyx_PySet_ContainsTF(__pyx_v_name, __pyx_v_6gevent_6_local__local_attrs, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 474, __pyx_L1_error)
+  __pyx_t_4 = (__pyx_t_1 != 0);
+  if (__pyx_t_4) {
+/* … */
+  }
+
+475:             object.__setattr__(self, name, value)
+
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_builtin_object, __pyx_n_s_setattr); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 475, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_5 = NULL;
+    __pyx_t_6 = 0;
+    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
+      if (likely(__pyx_t_5)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+        __Pyx_INCREF(__pyx_t_5);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_2, function);
+        __pyx_t_6 = 1;
+      }
+    }
+    #if CYTHON_FAST_PYCALL
+    if (PyFunction_Check(__pyx_t_2)) {
+      PyObject *__pyx_temp[4] = {__pyx_t_5, ((PyObject *)__pyx_v_self), __pyx_v_name, __pyx_v_value};
+      __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 475, __pyx_L1_error)
+      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+      __Pyx_GOTREF(__pyx_t_3);
+    } else
+    #endif
+    #if CYTHON_FAST_PYCCALL
+    if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
+      PyObject *__pyx_temp[4] = {__pyx_t_5, ((PyObject *)__pyx_v_self), __pyx_v_name, __pyx_v_value};
+      __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 475, __pyx_L1_error)
+      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+      __Pyx_GOTREF(__pyx_t_3);
+    } else
+    #endif
+    {
+      __pyx_t_7 = PyTuple_New(3+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 475, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_7);
+      if (__pyx_t_5) {
+        __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
+      }
+      __Pyx_INCREF(((PyObject *)__pyx_v_self));
+      __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
+      PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, ((PyObject *)__pyx_v_self));
+      __Pyx_INCREF(__pyx_v_name);
+      __Pyx_GIVEREF(__pyx_v_name);
+      PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_name);
+      __Pyx_INCREF(__pyx_v_value);
+      __Pyx_GIVEREF(__pyx_v_value);
+      PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_6, __pyx_v_value);
+      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 475, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_3);
+      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+    }
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+
+476:             return
+
    __pyx_r = 0;
+    goto __pyx_L0;
+
 477: 
+
+478:         dct = _local_get_dict(self)
+
  __pyx_t_3 = __pyx_f_6gevent_6_local__local_get_dict(__pyx_v_self); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 478, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __pyx_v_dct = ((PyObject*)__pyx_t_3);
+  __pyx_t_3 = 0;
+
 479: 
+
+480:         if self._local_type is local:
+
  __pyx_t_4 = (__pyx_v_self->_local_type == __pyx_ptype_6gevent_6_local_local);
+  __pyx_t_1 = (__pyx_t_4 != 0);
+  if (__pyx_t_1) {
+/* … */
+  }
+
 481:             # Optimization: If we're not subclassed, we can't
+
 482:             # have data descriptors, so this goes right in the dict.
+
+483:             dct[name] = value
+
    if (unlikely(__pyx_v_dct == Py_None)) {
+      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
+      __PYX_ERR(0, 483, __pyx_L1_error)
+    }
+    if (unlikely(PyDict_SetItem(__pyx_v_dct, __pyx_v_name, __pyx_v_value) < 0)) __PYX_ERR(0, 483, __pyx_L1_error)
+
+484:             return
+
    __pyx_r = 0;
+    goto __pyx_L0;
+
 485: 
+
+486:         if name in self._local_type_vars:
+
  if (unlikely(__pyx_v_self->_local_type_vars == Py_None)) {
+    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
+    __PYX_ERR(0, 486, __pyx_L1_error)
+  }
+  __pyx_t_1 = (__Pyx_PySet_ContainsTF(__pyx_v_name, __pyx_v_self->_local_type_vars, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 486, __pyx_L1_error)
+  __pyx_t_4 = (__pyx_t_1 != 0);
+  if (__pyx_t_4) {
+/* … */
+  }
+
+487:             if name in self._local_type_set_descriptors:
+
    if (unlikely(__pyx_v_self->_local_type_set_descriptors == Py_None)) {
+      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
+      __PYX_ERR(0, 487, __pyx_L1_error)
+    }
+    __pyx_t_4 = (__Pyx_PySet_ContainsTF(__pyx_v_name, __pyx_v_self->_local_type_set_descriptors, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 487, __pyx_L1_error)
+    __pyx_t_1 = (__pyx_t_4 != 0);
+    if (__pyx_t_1) {
+/* … */
+    }
+
+488:                 type_attr = getattr(self._local_type, name, _marker)
+
      __pyx_t_3 = ((PyObject *)__pyx_v_self->_local_type);
+      __Pyx_INCREF(__pyx_t_3);
+      __pyx_t_2 = __pyx_v_6gevent_6_local__marker;
+      __Pyx_INCREF(__pyx_t_2);
+      __pyx_t_7 = __Pyx_GetAttr3(__pyx_t_3, __pyx_v_name, __pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 488, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_7);
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+      __pyx_v_type_attr = __pyx_t_7;
+      __pyx_t_7 = 0;
+
 489:                 # A data descriptor, like a property or a slot.
+
+490:                 type(type_attr).__set__(type_attr, self, value)
+
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)Py_TYPE(__pyx_v_type_attr)), __pyx_n_s_set); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 490, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_2);
+      __pyx_t_3 = NULL;
+      __pyx_t_6 = 0;
+      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+        if (likely(__pyx_t_3)) {
+          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+          __Pyx_INCREF(__pyx_t_3);
+          __Pyx_INCREF(function);
+          __Pyx_DECREF_SET(__pyx_t_2, function);
+          __pyx_t_6 = 1;
+        }
+      }
+      #if CYTHON_FAST_PYCALL
+      if (PyFunction_Check(__pyx_t_2)) {
+        PyObject *__pyx_temp[4] = {__pyx_t_3, __pyx_v_type_attr, ((PyObject *)__pyx_v_self), __pyx_v_value};
+        __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 490, __pyx_L1_error)
+        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __Pyx_GOTREF(__pyx_t_7);
+      } else
+      #endif
+      #if CYTHON_FAST_PYCCALL
+      if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
+        PyObject *__pyx_temp[4] = {__pyx_t_3, __pyx_v_type_attr, ((PyObject *)__pyx_v_self), __pyx_v_value};
+        __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 490, __pyx_L1_error)
+        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __Pyx_GOTREF(__pyx_t_7);
+      } else
+      #endif
+      {
+        __pyx_t_5 = PyTuple_New(3+__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 490, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_5);
+        if (__pyx_t_3) {
+          __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
+        }
+        __Pyx_INCREF(__pyx_v_type_attr);
+        __Pyx_GIVEREF(__pyx_v_type_attr);
+        PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_6, __pyx_v_type_attr);
+        __Pyx_INCREF(((PyObject *)__pyx_v_self));
+        __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
+        PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_6, ((PyObject *)__pyx_v_self));
+        __Pyx_INCREF(__pyx_v_value);
+        __Pyx_GIVEREF(__pyx_v_value);
+        PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_6, __pyx_v_value);
+        __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 490, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_7);
+        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+      }
+      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+
+491:                 return
+
      __pyx_r = 0;
+      goto __pyx_L0;
+
 492:         # Otherwise it goes directly in the dict
+
+493:         dct[name] = value
+
  if (unlikely(__pyx_v_dct == Py_None)) {
+    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
+    __PYX_ERR(0, 493, __pyx_L1_error)
+  }
+  if (unlikely(PyDict_SetItem(__pyx_v_dct, __pyx_v_name, __pyx_v_value) < 0)) __PYX_ERR(0, 493, __pyx_L1_error)
+
 494: 
+
+495:     def __delattr__(self, name):
+
/* Python wrapper */
+static int __pyx_pw_6gevent_6_local_5local_7__delattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_name); /*proto*/
+static int __pyx_pw_6gevent_6_local_5local_7__delattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_name) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__delattr__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_6_local_5local_6__delattr__(((struct __pyx_obj_6gevent_6_local_local *)__pyx_v_self), ((PyObject *)__pyx_v_name));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_6_local_5local_6__delattr__(struct __pyx_obj_6gevent_6_local_local *__pyx_v_self, PyObject *__pyx_v_name) {
+  PyObject *__pyx_v_type_attr = NULL;
+  PyObject *__pyx_v_dct = NULL;
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__delattr__", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = 0;
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_XDECREF(__pyx_t_7);
+  __Pyx_AddTraceback("gevent._local.local.__delattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = -1;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_type_attr);
+  __Pyx_XDECREF(__pyx_v_dct);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+496:         if name == '__dict__':
+
  __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_name, __pyx_n_s_dict, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 496, __pyx_L1_error)
+  if (unlikely(__pyx_t_1)) {
+/* … */
+  }
+
+497:             raise AttributeError(
+
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_AttributeError, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 497, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __PYX_ERR(0, 497, __pyx_L1_error)
+
 498:                 "%r object attribute '__dict__' is read-only"
+
+499:                 % self.__class__.__name__)
+
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 499, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 499, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __pyx_t_2 = __Pyx_PyString_FormatSafe(__pyx_kp_s_r_object_attribute___dict___is, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 499, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+
 500: 
+
+501:         if name in self._local_type_vars:
+
  if (unlikely(__pyx_v_self->_local_type_vars == Py_None)) {
+    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
+    __PYX_ERR(0, 501, __pyx_L1_error)
+  }
+  __pyx_t_1 = (__Pyx_PySet_ContainsTF(__pyx_v_name, __pyx_v_self->_local_type_vars, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 501, __pyx_L1_error)
+  __pyx_t_4 = (__pyx_t_1 != 0);
+  if (__pyx_t_4) {
+/* … */
+  }
+
+502:             if name in self._local_type_del_descriptors:
+
    if (unlikely(__pyx_v_self->_local_type_del_descriptors == Py_None)) {
+      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
+      __PYX_ERR(0, 502, __pyx_L1_error)
+    }
+    __pyx_t_4 = (__Pyx_PySet_ContainsTF(__pyx_v_name, __pyx_v_self->_local_type_del_descriptors, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 502, __pyx_L1_error)
+    __pyx_t_1 = (__pyx_t_4 != 0);
+    if (__pyx_t_1) {
+/* … */
+    }
+
 503:                 # A data descriptor, like a property or a slot.
+
+504:                 type_attr = getattr(self._local_type, name, _marker)
+
      __pyx_t_3 = ((PyObject *)__pyx_v_self->_local_type);
+      __Pyx_INCREF(__pyx_t_3);
+      __pyx_t_2 = __pyx_v_6gevent_6_local__marker;
+      __Pyx_INCREF(__pyx_t_2);
+      __pyx_t_5 = __Pyx_GetAttr3(__pyx_t_3, __pyx_v_name, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 504, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_5);
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+      __pyx_v_type_attr = __pyx_t_5;
+      __pyx_t_5 = 0;
+
+505:                 type(type_attr).__delete__(type_attr, self)
+
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)Py_TYPE(__pyx_v_type_attr)), __pyx_n_s_delete); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 505, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_2);
+      __pyx_t_3 = NULL;
+      __pyx_t_6 = 0;
+      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+        if (likely(__pyx_t_3)) {
+          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+          __Pyx_INCREF(__pyx_t_3);
+          __Pyx_INCREF(function);
+          __Pyx_DECREF_SET(__pyx_t_2, function);
+          __pyx_t_6 = 1;
+        }
+      }
+      #if CYTHON_FAST_PYCALL
+      if (PyFunction_Check(__pyx_t_2)) {
+        PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_type_attr, ((PyObject *)__pyx_v_self)};
+        __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 505, __pyx_L1_error)
+        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __Pyx_GOTREF(__pyx_t_5);
+      } else
+      #endif
+      #if CYTHON_FAST_PYCCALL
+      if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
+        PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_type_attr, ((PyObject *)__pyx_v_self)};
+        __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 505, __pyx_L1_error)
+        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __Pyx_GOTREF(__pyx_t_5);
+      } else
+      #endif
+      {
+        __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 505, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_7);
+        if (__pyx_t_3) {
+          __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3); __pyx_t_3 = NULL;
+        }
+        __Pyx_INCREF(__pyx_v_type_attr);
+        __Pyx_GIVEREF(__pyx_v_type_attr);
+        PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_v_type_attr);
+        __Pyx_INCREF(((PyObject *)__pyx_v_self));
+        __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
+        PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, ((PyObject *)__pyx_v_self));
+        __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 505, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_5);
+        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+      }
+      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+
+506:                 return
+
      __pyx_r = 0;
+      goto __pyx_L0;
+
 507:         # Otherwise it goes directly in the dict
+
 508: 
+
 509:         # Begin inlined function _get_dict()
+
+510:         dct = _local_get_dict(self)
+
  __pyx_t_5 = __pyx_f_6gevent_6_local__local_get_dict(__pyx_v_self); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 510, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_5);
+  __pyx_v_dct = ((PyObject*)__pyx_t_5);
+  __pyx_t_5 = 0;
+
 511: 
+
+512:         try:
+
  {
+    /*try:*/ {
+/* … */
+    }
+    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
+    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
+    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
+    goto __pyx_L11_try_end;
+    __pyx_L6_error:;
+    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+/* … */
+    __Pyx_XGIVEREF(__pyx_t_8);
+    __Pyx_XGIVEREF(__pyx_t_9);
+    __Pyx_XGIVEREF(__pyx_t_10);
+    __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
+    goto __pyx_L1_error;
+    __pyx_L11_try_end:;
+  }
+
+513:             del dct[name]
+
      if (unlikely(__pyx_v_dct == Py_None)) {
+        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
+        __PYX_ERR(0, 513, __pyx_L6_error)
+      }
+      if (unlikely(PyDict_DelItem(__pyx_v_dct, __pyx_v_name) < 0)) __PYX_ERR(0, 513, __pyx_L6_error)
+
+514:         except KeyError:
+
    __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
+    if (__pyx_t_6) {
+      __Pyx_AddTraceback("gevent._local.local.__delattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_2, &__pyx_t_7) < 0) __PYX_ERR(0, 514, __pyx_L8_except_error)
+      __Pyx_GOTREF(__pyx_t_5);
+      __Pyx_GOTREF(__pyx_t_2);
+      __Pyx_GOTREF(__pyx_t_7);
+
+515:             raise AttributeError(name)
+
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_AttributeError, __pyx_v_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 515, __pyx_L8_except_error)
+      __Pyx_GOTREF(__pyx_t_3);
+      __Pyx_Raise(__pyx_t_3, 0, 0, 0);
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __PYX_ERR(0, 515, __pyx_L8_except_error)
+    }
+    goto __pyx_L8_except_error;
+    __pyx_L8_except_error:;
+
 516: 
+
+517:     def __copy__(self):
+
static PyObject *__pyx_pw_6gevent_6_local_5local_9__copy__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static struct __pyx_obj_6gevent_6_local_local *__pyx_f_6gevent_6_local_5local___copy__(struct __pyx_obj_6gevent_6_local_local *__pyx_v_self, int __pyx_skip_dispatch) {
+  struct __pyx_obj_6gevent_6_local__localimpl_dict_entry *__pyx_v_entry = 0;
+  PyObject *__pyx_v_dct = 0;
+  PyObject *__pyx_v_duplicate = 0;
+  struct __pyx_obj_6gevent_6_local_local *__pyx_v_instance = 0;
+  struct __pyx_obj_6gevent_6_local__localimpl *__pyx_v_impl = NULL;
+  PyTypeObject *__pyx_v_cls = NULL;
+  struct __pyx_obj_6gevent_6_local_local *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__copy__", 0);
+  /* Check if called by wrapper */
+  if (unlikely(__pyx_skip_dispatch)) ;
+  /* Check if overridden in Python */
+  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
+    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
+    if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
+    else {
+      PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      #endif
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_copy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 517, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_6_local_5local_9__copy__)) {
+        __Pyx_XDECREF(((PyObject *)__pyx_r));
+        __Pyx_INCREF(__pyx_t_1);
+        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+          if (likely(__pyx_t_4)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+            __Pyx_INCREF(__pyx_t_4);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_3, function);
+          }
+        }
+        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
+        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 517, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_6gevent_6_local_local))))) __PYX_ERR(0, 517, __pyx_L1_error)
+        __pyx_r = ((struct __pyx_obj_6gevent_6_local_local *)__pyx_t_2);
+        __pyx_t_2 = 0;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        goto __pyx_L0;
+      }
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+      tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
+      if (unlikely(type_dict_guard != tp_dict_version)) {
+        tp_dict_version = obj_dict_version = 0;
+      }
+      #endif
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    }
+    #endif
+  }
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_AddTraceback("gevent._local.local.__copy__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XDECREF((PyObject *)__pyx_v_entry);
+  __Pyx_XDECREF(__pyx_v_dct);
+  __Pyx_XDECREF(__pyx_v_duplicate);
+  __Pyx_XDECREF((PyObject *)__pyx_v_instance);
+  __Pyx_XDECREF((PyObject *)__pyx_v_impl);
+  __Pyx_XDECREF(__pyx_v_cls);
+  __Pyx_XGIVEREF((PyObject *)__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_local_5local_9__copy__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6gevent_6_local_5local_8__copy__[] = "local.__copy__(self) -> local";
+static PyMethodDef __pyx_mdef_6gevent_6_local_5local_9__copy__ = {"__copy__", (PyCFunction)__pyx_pw_6gevent_6_local_5local_9__copy__, METH_NOARGS, __pyx_doc_6gevent_6_local_5local_8__copy__};
+static PyObject *__pyx_pw_6gevent_6_local_5local_9__copy__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__copy__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_6_local_5local_8__copy__(((struct __pyx_obj_6gevent_6_local_local *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_local_5local_8__copy__(struct __pyx_obj_6gevent_6_local_local *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__copy__", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = ((PyObject *)__pyx_f_6gevent_6_local_5local___copy__(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 517, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent._local.local.__copy__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__8 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 517, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__8);
+  __Pyx_GIVEREF(__pyx_tuple__8);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_local_5local_9__copy__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_local___copy, NULL, __pyx_n_s_gevent__local, __pyx_d, ((PyObject *)__pyx_codeobj__9)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 517, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_local_local->tp_dict, __pyx_n_s_copy, __pyx_t_2) < 0) __PYX_ERR(0, 517, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_6_local_local);
+  __pyx_codeobj__9 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__8, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_local_py, __pyx_n_s_copy, 517, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__9)) __PYX_ERR(0, 517, __pyx_L1_error)
+
+518:         impl = self._local__impl
+
  __pyx_t_1 = ((PyObject *)__pyx_v_self->_local__impl);
+  __Pyx_INCREF(__pyx_t_1);
+  __pyx_v_impl = ((struct __pyx_obj_6gevent_6_local__localimpl *)__pyx_t_1);
+  __pyx_t_1 = 0;
+
+519:         entry = impl.dicts[id(getcurrent())]  # pylint:disable=undefined-variable
+
  if (unlikely(__pyx_v_impl->dicts == Py_None)) {
+    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
+    __PYX_ERR(0, 519, __pyx_L1_error)
+  }
+  __pyx_t_1 = ((PyObject *)__pyx_f_6gevent_6_local_getcurrent()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 519, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 519, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_impl->dicts, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 519, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_6gevent_6_local__localimpl_dict_entry))))) __PYX_ERR(0, 519, __pyx_L1_error)
+  __pyx_v_entry = ((struct __pyx_obj_6gevent_6_local__localimpl_dict_entry *)__pyx_t_1);
+  __pyx_t_1 = 0;
+
 520: 
+
+521:         dct = entry.localdict
+
  __pyx_t_1 = __pyx_v_entry->localdict;
+  __Pyx_INCREF(__pyx_t_1);
+  __pyx_v_dct = ((PyObject*)__pyx_t_1);
+  __pyx_t_1 = 0;
+
+522:         duplicate = copy(dct)
+
  __Pyx_INCREF(__pyx_v_6gevent_6_local_copy);
+  __pyx_t_2 = __pyx_v_6gevent_6_local_copy; __pyx_t_3 = NULL;
+  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
+    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+    if (likely(__pyx_t_3)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+      __Pyx_INCREF(__pyx_t_3);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_2, function);
+    }
+  }
+  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_dct) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_dct);
+  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 522, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  if (!(likely(PyDict_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 522, __pyx_L1_error)
+  __pyx_v_duplicate = ((PyObject*)__pyx_t_1);
+  __pyx_t_1 = 0;
+
 523: 
+
+524:         cls = type(self)
+
  __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
+  __pyx_v_cls = ((PyTypeObject*)((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
+
+525:         instance = cls(*impl.localargs, **impl.localkwargs)
+
  if (unlikely(__pyx_v_impl->localargs == Py_None)) {
+    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
+    __PYX_ERR(0, 525, __pyx_L1_error)
+  }
+  if (unlikely(__pyx_v_impl->localkwargs == Py_None)) {
+    PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType");
+    __PYX_ERR(0, 525, __pyx_L1_error)
+  }
+  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_v_cls), __pyx_v_impl->localargs, __pyx_v_impl->localkwargs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 525, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_6gevent_6_local_local))))) __PYX_ERR(0, 525, __pyx_L1_error)
+  __pyx_v_instance = ((struct __pyx_obj_6gevent_6_local_local *)__pyx_t_1);
+  __pyx_t_1 = 0;
+
+526:         _local__copy_dict_from(instance, impl, duplicate)
+
  __pyx_t_1 = __pyx_f_6gevent_6_local__local__copy_dict_from(__pyx_v_instance, __pyx_v_impl, __pyx_v_duplicate); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 526, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+527:         return instance
+
  __Pyx_XDECREF(((PyObject *)__pyx_r));
+  __Pyx_INCREF(((PyObject *)__pyx_v_instance));
+  __pyx_r = __pyx_v_instance;
+  goto __pyx_L0;
+
 528: 
+
+529: def _local__copy_dict_from(self, impl, duplicate):
+
static PyObject *__pyx_f_6gevent_6_local__local__copy_dict_from(struct __pyx_obj_6gevent_6_local_local *__pyx_v_self, struct __pyx_obj_6gevent_6_local__localimpl *__pyx_v_impl, PyObject *__pyx_v_duplicate) {
+  struct __pyx_obj_6gevent_6_local__localimpl_dict_entry *__pyx_v_entry = 0;
+  PyGreenlet *__pyx_v_current = NULL;
+  PyObject *__pyx_v_currentId = NULL;
+  struct __pyx_obj_6gevent_6_local__localimpl *__pyx_v_new_impl = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_local__copy_dict_from", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_AddTraceback("gevent._local._local__copy_dict_from", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XDECREF((PyObject *)__pyx_v_entry);
+  __Pyx_XDECREF((PyObject *)__pyx_v_current);
+  __Pyx_XDECREF(__pyx_v_currentId);
+  __Pyx_XDECREF((PyObject *)__pyx_v_new_impl);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+530:     current = getcurrent() # pylint:disable=undefined-variable
+
  __pyx_t_1 = ((PyObject *)__pyx_f_6gevent_6_local_getcurrent()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 530, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_v_current = ((PyGreenlet *)__pyx_t_1);
+  __pyx_t_1 = 0;
+
+531:     currentId = id(current)
+
  __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_current)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 531, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_v_currentId = __pyx_t_1;
+  __pyx_t_1 = 0;
+
+532:     new_impl = self._local__impl
+
  __pyx_t_1 = ((PyObject *)__pyx_v_self->_local__impl);
+  __Pyx_INCREF(__pyx_t_1);
+  __pyx_v_new_impl = ((struct __pyx_obj_6gevent_6_local__localimpl *)__pyx_t_1);
+  __pyx_t_1 = 0;
+
+533:     assert new_impl is not impl
+
  #ifndef CYTHON_WITHOUT_ASSERTIONS
+  if (unlikely(!Py_OptimizeFlag)) {
+    __pyx_t_2 = (__pyx_v_new_impl != __pyx_v_impl);
+    if (unlikely(!(__pyx_t_2 != 0))) {
+      PyErr_SetNone(PyExc_AssertionError);
+      __PYX_ERR(0, 533, __pyx_L1_error)
+    }
+  }
+  #endif
+
+534:     entry = new_impl.dicts[currentId]
+
  if (unlikely(__pyx_v_new_impl->dicts == Py_None)) {
+    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
+    __PYX_ERR(0, 534, __pyx_L1_error)
+  }
+  __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_new_impl->dicts, __pyx_v_currentId); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 534, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_6gevent_6_local__localimpl_dict_entry))))) __PYX_ERR(0, 534, __pyx_L1_error)
+  __pyx_v_entry = ((struct __pyx_obj_6gevent_6_local__localimpl_dict_entry *)__pyx_t_1);
+  __pyx_t_1 = 0;
+
+535:     new_impl.dicts[currentId] = _localimpl_dict_entry(entry.wrgreenlet, duplicate)
+
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 535, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(__pyx_v_entry->wrgreenlet);
+  __Pyx_GIVEREF(__pyx_v_entry->wrgreenlet);
+  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_entry->wrgreenlet);
+  __Pyx_INCREF(__pyx_v_duplicate);
+  __Pyx_GIVEREF(__pyx_v_duplicate);
+  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_duplicate);
+  __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6gevent_6_local__localimpl_dict_entry), __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 535, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  if (unlikely(__pyx_v_new_impl->dicts == Py_None)) {
+    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
+    __PYX_ERR(0, 535, __pyx_L1_error)
+  }
+  if (unlikely(PyDict_SetItem(__pyx_v_new_impl->dicts, __pyx_v_currentId, __pyx_t_3) < 0)) __PYX_ERR(0, 535, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+
 536: 
+
+537: def _local_find_descriptors(self):
+
static PyObject *__pyx_f_6gevent_6_local__local_find_descriptors(struct __pyx_obj_6gevent_6_local_local *__pyx_v_self) {
+  PyObject *__pyx_v_mro = 0;
+  PyObject *__pyx_v_gets = 0;
+  PyObject *__pyx_v_dels = 0;
+  PyObject *__pyx_v_set_or_del = 0;
+  PyTypeObject *__pyx_v_type_self = 0;
+  PyTypeObject *__pyx_v_type_attr = 0;
+  PyObject *__pyx_v_sets = 0;
+  PyObject *__pyx_v_attr_name = NULL;
+  PyObject *__pyx_v_base = NULL;
+  PyObject *__pyx_v_bd = NULL;
+  PyObject *__pyx_v_attr = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_local_find_descriptors", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_AddTraceback("gevent._local._local_find_descriptors", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_mro);
+  __Pyx_XDECREF(__pyx_v_gets);
+  __Pyx_XDECREF(__pyx_v_dels);
+  __Pyx_XDECREF(__pyx_v_set_or_del);
+  __Pyx_XDECREF(__pyx_v_type_self);
+  __Pyx_XDECREF(__pyx_v_type_attr);
+  __Pyx_XDECREF(__pyx_v_sets);
+  __Pyx_XDECREF(__pyx_v_attr_name);
+  __Pyx_XDECREF(__pyx_v_base);
+  __Pyx_XDECREF(__pyx_v_bd);
+  __Pyx_XDECREF(__pyx_v_attr);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+538:     type_self = type(self)
+
  __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
+  __pyx_v_type_self = ((PyTypeObject*)((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
+
+539:     gets = set()
+
  __pyx_t_1 = PySet_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 539, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_v_gets = ((PyObject*)__pyx_t_1);
+  __pyx_t_1 = 0;
+
+540:     dels = set()
+
  __pyx_t_1 = PySet_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 540, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_v_dels = ((PyObject*)__pyx_t_1);
+  __pyx_t_1 = 0;
+
+541:     set_or_del = set()
+
  __pyx_t_1 = PySet_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 541, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_v_set_or_del = ((PyObject*)__pyx_t_1);
+  __pyx_t_1 = 0;
+
+542:     sets = set()
+
  __pyx_t_1 = PySet_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 542, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_v_sets = ((PyObject*)__pyx_t_1);
+  __pyx_t_1 = 0;
+
+543:     mro = list(type_self.mro())
+
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_type_self), __pyx_n_s_mro); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 543, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = NULL;
+  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+    if (likely(__pyx_t_3)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+      __Pyx_INCREF(__pyx_t_3);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_2, function);
+    }
+  }
+  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 543, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_2 = PySequence_List(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 543, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_v_mro = ((PyObject*)__pyx_t_2);
+  __pyx_t_2 = 0;
+
 544: 
+
+545:     for attr_name in dir(type_self):
+
  __pyx_t_2 = PyObject_Dir(((PyObject *)__pyx_v_type_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 545, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
+    __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1); __pyx_t_4 = 0;
+    __pyx_t_5 = NULL;
+  } else {
+    __pyx_t_4 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 545, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __pyx_t_5 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 545, __pyx_L1_error)
+  }
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  for (;;) {
+    if (likely(!__pyx_t_5)) {
+      if (likely(PyList_CheckExact(__pyx_t_1))) {
+        if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_1)) break;
+        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+        __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 545, __pyx_L1_error)
+        #else
+        __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 545, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        #endif
+      } else {
+        if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
+        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+        __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 545, __pyx_L1_error)
+        #else
+        __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 545, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        #endif
+      }
+    } else {
+      __pyx_t_2 = __pyx_t_5(__pyx_t_1);
+      if (unlikely(!__pyx_t_2)) {
+        PyObject* exc_type = PyErr_Occurred();
+        if (exc_type) {
+          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+          else __PYX_ERR(0, 545, __pyx_L1_error)
+        }
+        break;
+      }
+      __Pyx_GOTREF(__pyx_t_2);
+    }
+    __Pyx_XDECREF_SET(__pyx_v_attr_name, __pyx_t_2);
+    __pyx_t_2 = 0;
+/* … */
+  }
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 546:         # Conventionally, descriptors when called on a class
+
 547:         # return themself, but not all do. Notable exceptions are
+
 548:         # in the zope.interface package, where things like __provides__
+
 549:         # return other class attributes. So we can't use getattr, and instead
+
 550:         # walk up the dicts
+
+551:         for base in mro:
+
    __pyx_t_2 = __pyx_v_mro; __Pyx_INCREF(__pyx_t_2); __pyx_t_6 = 0;
+    for (;;) {
+      if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_2)) break;
+      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+      __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_3); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 551, __pyx_L1_error)
+      #else
+      __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 551, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_3);
+      #endif
+      __Pyx_XDECREF_SET(__pyx_v_base, __pyx_t_3);
+      __pyx_t_3 = 0;
+/* … */
+    }
+    /*else*/ {
+/* … */
+    __pyx_L6_break:;
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+552:             bd = base.__dict__
+
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_dict); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 552, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_3);
+      __Pyx_XDECREF_SET(__pyx_v_bd, __pyx_t_3);
+      __pyx_t_3 = 0;
+
+553:             if attr_name in bd:
+
      __pyx_t_7 = (__Pyx_PySequence_ContainsTF(__pyx_v_attr_name, __pyx_v_bd, Py_EQ)); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 553, __pyx_L1_error)
+      __pyx_t_8 = (__pyx_t_7 != 0);
+      if (__pyx_t_8) {
+/* … */
+      }
+
+554:                 attr = bd[attr_name]
+
        __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_bd, __pyx_v_attr_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 554, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_3);
+        __Pyx_XDECREF_SET(__pyx_v_attr, __pyx_t_3);
+        __pyx_t_3 = 0;
+
+555:                 break
+
        goto __pyx_L6_break;
+
 556:         else:
+
+557:             raise AttributeError(attr_name)
+
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_AttributeError, __pyx_v_attr_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 557, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_3);
+      __Pyx_Raise(__pyx_t_3, 0, 0, 0);
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __PYX_ERR(0, 557, __pyx_L1_error)
+    }
+
 558: 
+
+559:         type_attr = type(attr)
+
    __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_attr)));
+    __Pyx_XDECREF_SET(__pyx_v_type_attr, ((PyTypeObject*)((PyObject *)Py_TYPE(__pyx_v_attr))));
+
+560:         if hasattr(type_attr, '__get__'):
+
    __pyx_t_8 = __Pyx_HasAttr(((PyObject *)__pyx_v_type_attr), __pyx_n_s_get); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 560, __pyx_L1_error)
+    __pyx_t_7 = (__pyx_t_8 != 0);
+    if (__pyx_t_7) {
+/* … */
+    }
+
+561:             gets.add(attr_name)
+
      __pyx_t_9 = PySet_Add(__pyx_v_gets, __pyx_v_attr_name); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 561, __pyx_L1_error)
+
+562:         if hasattr(type_attr, '__delete__'):
+
    __pyx_t_7 = __Pyx_HasAttr(((PyObject *)__pyx_v_type_attr), __pyx_n_s_delete); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 562, __pyx_L1_error)
+    __pyx_t_8 = (__pyx_t_7 != 0);
+    if (__pyx_t_8) {
+/* … */
+    }
+
+563:             dels.add(attr_name)
+
      __pyx_t_9 = PySet_Add(__pyx_v_dels, __pyx_v_attr_name); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 563, __pyx_L1_error)
+
+564:             set_or_del.add(attr_name)
+
      __pyx_t_9 = PySet_Add(__pyx_v_set_or_del, __pyx_v_attr_name); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 564, __pyx_L1_error)
+
+565:         if hasattr(type_attr, '__set__'):
+
    __pyx_t_8 = __Pyx_HasAttr(((PyObject *)__pyx_v_type_attr), __pyx_n_s_set); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 565, __pyx_L1_error)
+    __pyx_t_7 = (__pyx_t_8 != 0);
+    if (__pyx_t_7) {
+/* … */
+    }
+
+566:             sets.add(attr_name)
+
      __pyx_t_9 = PySet_Add(__pyx_v_sets, __pyx_v_attr_name); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 566, __pyx_L1_error)
+
 567: 
+
+568:     return (gets, dels, set_or_del, sets)
+
  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 568, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(__pyx_v_gets);
+  __Pyx_GIVEREF(__pyx_v_gets);
+  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_gets);
+  __Pyx_INCREF(__pyx_v_dels);
+  __Pyx_GIVEREF(__pyx_v_dels);
+  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_dels);
+  __Pyx_INCREF(__pyx_v_set_or_del);
+  __Pyx_GIVEREF(__pyx_v_set_or_del);
+  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_set_or_del);
+  __Pyx_INCREF(__pyx_v_sets);
+  __Pyx_GIVEREF(__pyx_v_sets);
+  PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_v_sets);
+  __pyx_r = ((PyObject*)__pyx_t_1);
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
 569: 
+
 570: # Cython doesn't let us use __new__, it requires
+
 571: # __cinit__. But we need __new__ if we're not compiled
+
 572: # (e.g., on PyPy). So we set it at runtime. Cython
+
 573: # will raise an error if we're compiled.
+
+574: def __new__(cls, *args, **kw):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_local_3__new__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_6gevent_6_local_2__new__[] = "__new__(cls, *args, **kw)";
+static PyMethodDef __pyx_mdef_6gevent_6_local_3__new__ = {"__new__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_6_local_3__new__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_6_local_2__new__};
+static PyObject *__pyx_pw_6gevent_6_local_3__new__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_cls = 0;
+  PyObject *__pyx_v_args = 0;
+  PyObject *__pyx_v_kw = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__new__ (wrapper)", 0);
+  __pyx_v_kw = PyDict_New(); if (unlikely(!__pyx_v_kw)) return NULL;
+  __Pyx_GOTREF(__pyx_v_kw);
+  if (PyTuple_GET_SIZE(__pyx_args) > 1) {
+    __pyx_v_args = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args));
+    if (unlikely(!__pyx_v_args)) {
+      __Pyx_DECREF(__pyx_v_kw); __pyx_v_kw = 0;
+      __Pyx_RefNannyFinishContext();
+      return NULL;
+    }
+    __Pyx_GOTREF(__pyx_v_args);
+  } else {
+    __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple);
+  }
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_cls,0};
+    PyObject* values[1] = {0};
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        default:
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cls)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+      }
+      if (unlikely(kw_args > 0)) {
+        const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1;
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kw, values, used_pos_args, "__new__") < 0)) __PYX_ERR(0, 574, __pyx_L3_error)
+      }
+    } else if (PyTuple_GET_SIZE(__pyx_args) < 1) {
+      goto __pyx_L5_argtuple_error;
+    } else {
+      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+    }
+    __pyx_v_cls = values[0];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("__new__", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 574, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0;
+  __Pyx_DECREF(__pyx_v_kw); __pyx_v_kw = 0;
+  __Pyx_AddTraceback("gevent._local.__new__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_6_local_2__new__(__pyx_self, __pyx_v_cls, __pyx_v_args, __pyx_v_kw);
+
+  /* function exit code */
+  __Pyx_XDECREF(__pyx_v_args);
+  __Pyx_XDECREF(__pyx_v_kw);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_local_2__new__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_cls, PyObject *__pyx_v_args, PyObject *__pyx_v_kw) {
+  PyObject *__pyx_v_self = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__new__", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_AddTraceback("gevent._local.__new__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_self);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__10 = PyTuple_Pack(4, __pyx_n_s_cls, __pyx_n_s_args, __pyx_n_s_kw, __pyx_n_s_self); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 574, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__10);
+  __Pyx_GIVEREF(__pyx_tuple__10);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_local_3__new__, 0, __pyx_n_s_new, NULL, __pyx_n_s_gevent__local, __pyx_d, ((PyObject *)__pyx_codeobj__11)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 574, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_new, __pyx_t_2) < 0) __PYX_ERR(0, 574, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+575:     self = super(local, cls).__new__(cls)
+
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 575, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(((PyObject *)__pyx_ptype_6gevent_6_local_local));
+  __Pyx_GIVEREF(((PyObject *)__pyx_ptype_6gevent_6_local_local));
+  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_ptype_6gevent_6_local_local));
+  __Pyx_INCREF(__pyx_v_cls);
+  __Pyx_GIVEREF(__pyx_v_cls);
+  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_cls);
+  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 575, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 575, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __pyx_t_3 = NULL;
+  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+    if (likely(__pyx_t_3)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+      __Pyx_INCREF(__pyx_t_3);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_2, function);
+    }
+  }
+  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_cls) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_cls);
+  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 575, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_v_self = __pyx_t_1;
+  __pyx_t_1 = 0;
+
 576:     # We get the cls in *args for some reason
+
 577:     # too when we do it this way....except on PyPy3, which does
+
 578:     # not *unless* it's wrapped in a classmethod (which it is)
+
+579:     self.__cinit__(*args[1:], **kw)
+
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cinit); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 579, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = __Pyx_PyTuple_GetSlice(__pyx_v_args, 1, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 579, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_v_kw); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 579, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+
+580:     return self
+
  __Pyx_XDECREF(__pyx_r);
+  __Pyx_INCREF(__pyx_v_self);
+  __pyx_r = __pyx_v_self;
+  goto __pyx_L0;
+
 581: 
+
+582: try:
+
  {
+    /*try:*/ {
+/* … */
+    }
+/* … */
+    __Pyx_XGIVEREF(__pyx_t_3);
+    __Pyx_XGIVEREF(__pyx_t_4);
+    __Pyx_XGIVEREF(__pyx_t_5);
+    __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
+    goto __pyx_L1_error;
+    __pyx_L3_exception_handled:;
+    __Pyx_XGIVEREF(__pyx_t_3);
+    __Pyx_XGIVEREF(__pyx_t_4);
+    __Pyx_XGIVEREF(__pyx_t_5);
+    __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
+    __pyx_L7_try_end:;
+  }
+
 583:     # PyPy2/3 and CPython handle adding a __new__ to the class
+
 584:     # in different ways. In CPython and PyPy3, it must be wrapped with classmethod;
+
 585:     # in PyPy2, it must not. In either case, the args that get passed to
+
 586:     # it are stil wrong.
+
+587:     local.__new__ = 'None'
+
      if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_ptype_6gevent_6_local_local), __pyx_n_s_new, __pyx_n_s_None) < 0) __PYX_ERR(0, 587, __pyx_L2_error)
+
+588: except TypeError: # pragma: no cover
+
    __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
+    if (__pyx_t_8) {
+      __Pyx_ErrRestore(0,0,0);
+      goto __pyx_L3_exception_handled;
+    }
+    goto __pyx_L4_except_error;
+    __pyx_L4_except_error:;
+
 589:     # Must be compiled
+
 590:     pass
+
 591: else:
+
+592:     from gevent._compat import PYPY
+
    /*else:*/ {
+      __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 592, __pyx_L4_except_error)
+      __Pyx_GOTREF(__pyx_t_2);
+      __Pyx_INCREF(__pyx_n_s_PYPY_2);
+      __Pyx_GIVEREF(__pyx_n_s_PYPY_2);
+      PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PYPY_2);
+      __pyx_t_1 = __Pyx_Import(__pyx_n_s_gevent__compat, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 592, __pyx_L4_except_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+      __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_PYPY_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 592, __pyx_L4_except_error)
+      __Pyx_GOTREF(__pyx_t_2);
+      if (PyDict_SetItem(__pyx_d, __pyx_n_s_PYPY_2, __pyx_t_2) < 0) __PYX_ERR(0, 592, __pyx_L4_except_error)
+      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+593:     from gevent._compat import PY2
+
      __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 593, __pyx_L4_except_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      __Pyx_INCREF(__pyx_n_s_PY2);
+      __Pyx_GIVEREF(__pyx_n_s_PY2);
+      PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_PY2);
+      __pyx_t_2 = __Pyx_Import(__pyx_n_s_gevent__compat, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 593, __pyx_L4_except_error)
+      __Pyx_GOTREF(__pyx_t_2);
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_PY2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 593, __pyx_L4_except_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      if (PyDict_SetItem(__pyx_d, __pyx_n_s_PY2, __pyx_t_1) < 0) __PYX_ERR(0, 593, __pyx_L4_except_error)
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+594:     if PYPY and PY2:
+
      __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_PYPY_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 594, __pyx_L4_except_error)
+      __Pyx_GOTREF(__pyx_t_2);
+      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 594, __pyx_L4_except_error)
+      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+      if (__pyx_t_7) {
+      } else {
+        __pyx_t_6 = __pyx_t_7;
+        goto __pyx_L9_bool_binop_done;
+      }
+      __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_PY2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 594, __pyx_L4_except_error)
+      __Pyx_GOTREF(__pyx_t_2);
+      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 594, __pyx_L4_except_error)
+      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+      __pyx_t_6 = __pyx_t_7;
+      __pyx_L9_bool_binop_done:;
+      if (__pyx_t_6) {
+/* … */
+        goto __pyx_L8;
+      }
+
+595:         local.__new__ = __new__
+
        __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 595, __pyx_L4_except_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_ptype_6gevent_6_local_local), __pyx_n_s_new, __pyx_t_2) < 0) __PYX_ERR(0, 595, __pyx_L4_except_error)
+        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
 596:     else:
+
+597:         local.__new__ = classmethod(__new__)
+
      /*else*/ {
+        __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 597, __pyx_L4_except_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_classmethod, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 597, __pyx_L4_except_error)
+        __Pyx_GOTREF(__pyx_t_1);
+        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+        if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_ptype_6gevent_6_local_local), __pyx_n_s_new, __pyx_t_1) < 0) __PYX_ERR(0, 597, __pyx_L4_except_error)
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      }
+      __pyx_L8:;
+
 598: 
+
+599:     del PYPY
+
      if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_PYPY_2) < 0) __PYX_ERR(0, 599, __pyx_L4_except_error)
+
+600:     del PY2
+
      if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_PY2) < 0) __PYX_ERR(0, 600, __pyx_L4_except_error)
+    }
+    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+    goto __pyx_L7_try_end;
+    __pyx_L2_error:;
+    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+
 601: 
+
+602: _init()
+
  __pyx_f_6gevent_6_local__init();
+
 603: 
+
+604: from gevent._util import import_c_accel
+
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 604, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(__pyx_n_s_import_c_accel);
+  __Pyx_GIVEREF(__pyx_n_s_import_c_accel);
+  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_import_c_accel);
+  __pyx_t_2 = __Pyx_Import(__pyx_n_s_gevent__util, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 604, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_import_c_accel); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 604, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_import_c_accel, __pyx_t_1) < 0) __PYX_ERR(0, 604, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+605: import_c_accel(globals(), 'gevent._local')
+
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_import_c_accel); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 605, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_1 = __Pyx_Globals(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 605, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 605, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_9);
+  __Pyx_GIVEREF(__pyx_t_1);
+  PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_1);
+  __Pyx_INCREF(__pyx_n_s_gevent__local);
+  __Pyx_GIVEREF(__pyx_n_s_gevent__local);
+  PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_n_s_gevent__local);
+  __pyx_t_1 = 0;
+  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 605, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/local.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/local.py new file mode 100644 index 00000000..f29bb235 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/local.py @@ -0,0 +1,605 @@ +# cython: auto_pickle=False,embedsignature=True,always_allow_keywords=False +""" +Greenlet-local objects. + +This module is based on `_threading_local.py`__ from the standard +library of Python 3.4. + +__ https://github.com/python/cpython/blob/3.4/Lib/_threading_local.py + +Greenlet-local objects support the management of greenlet-local data. +If you have data that you want to be local to a greenlet, simply create +a greenlet-local object and use its attributes: + + >>> mydata = local() + >>> mydata.number = 42 + >>> mydata.number + 42 + +You can also access the local-object's dictionary: + + >>> mydata.__dict__ + {'number': 42} + >>> mydata.__dict__.setdefault('widgets', []) + [] + >>> mydata.widgets + [] + +What's important about greenlet-local objects is that their data are +local to a greenlet. If we access the data in a different greenlet: + + >>> log = [] + >>> def f(): + ... items = list(mydata.__dict__.items()) + ... items.sort() + ... log.append(items) + ... mydata.number = 11 + ... log.append(mydata.number) + >>> greenlet = gevent.spawn(f) + >>> greenlet.join() + >>> log + [[], 11] + +we get different data. Furthermore, changes made in the other greenlet +don't affect data seen in this greenlet: + + >>> mydata.number + 42 + +Of course, values you get from a local object, including a __dict__ +attribute, are for whatever greenlet was current at the time the +attribute was read. For that reason, you generally don't want to save +these values across greenlets, as they apply only to the greenlet they +came from. + +You can create custom local objects by subclassing the local class: + + >>> class MyLocal(local): + ... number = 2 + ... initialized = False + ... def __init__(self, **kw): + ... if self.initialized: + ... raise SystemError('__init__ called too many times') + ... self.initialized = True + ... self.__dict__.update(kw) + ... def squared(self): + ... return self.number ** 2 + +This can be useful to support default values, methods and +initialization. Note that if you define an __init__ method, it will be +called each time the local object is used in a separate greenlet. This +is necessary to initialize each greenlet's dictionary. + +Now if we create a local object: + + >>> mydata = MyLocal(color='red') + +Now we have a default number: + + >>> mydata.number + 2 + +an initial color: + + >>> mydata.color + 'red' + >>> del mydata.color + +And a method that operates on the data: + + >>> mydata.squared() + 4 + +As before, we can access the data in a separate greenlet: + + >>> log = [] + >>> greenlet = gevent.spawn(f) + >>> greenlet.join() + >>> log + [[('color', 'red'), ('initialized', True)], 11] + +without affecting this greenlet's data: + + >>> mydata.number + 2 + >>> mydata.color + Traceback (most recent call last): + ... + AttributeError: 'MyLocal' object has no attribute 'color' + +Note that subclasses can define slots, but they are not greenlet +local. They are shared across greenlets:: + + >>> class MyLocal(local): + ... __slots__ = 'number' + + >>> mydata = MyLocal() + >>> mydata.number = 42 + >>> mydata.color = 'red' + +So, the separate greenlet: + + >>> greenlet = gevent.spawn(f) + >>> greenlet.join() + +affects what we see: + + >>> mydata.number + 11 + +>>> del mydata + +.. versionchanged:: 1.1a2 + Update the implementation to match Python 3.4 instead of Python 2.5. + This results in locals being eligible for garbage collection as soon + as their greenlet exits. + +.. versionchanged:: 1.2.3 + Use a weak-reference to clear the greenlet link we establish in case + the local object dies before the greenlet does. + +.. versionchanged:: 1.3a1 + Implement the methods for attribute access directly, handling + descriptors directly here. This allows removing the use of a lock + and facilitates greatly improved performance. + +.. versionchanged:: 1.3a1 + The ``__init__`` method of subclasses of ``local`` is no longer + called with a lock held. CPython does not use such a lock in its + native implementation. This could potentially show as a difference + if code that uses multiple dependent attributes in ``__slots__`` + (which are shared across all greenlets) switches during ``__init__``. + +""" +from __future__ import print_function + +from copy import copy +from weakref import ref + + +locals()['getcurrent'] = __import__('greenlet').getcurrent +locals()['greenlet_init'] = lambda: None + +__all__ = [ + "local", +] + +# The key used in the Thread objects' attribute dicts. +# We keep it a string for speed but make it unlikely to clash with +# a "real" attribute. +key_prefix = '_gevent_local_localimpl_' + +# The overall structure is as follows: +# For each local() object: +# greenlet.__dict__[key_prefix + str(id(local))] +# => _localimpl.dicts[id(greenlet)] => (ref(greenlet), {}) + +# That final tuple is actually a localimpl_dict_entry object. + +def all_local_dicts_for_greenlet(greenlet): + """ + Internal debug helper for getting the local values associated + with a greenlet. This is subject to change or removal at any time. + + :return: A list of ((type, id), {}) pairs, where the first element + is the type and id of the local object and the second object is its + instance dictionary, as seen from this greenlet. + + .. versionadded:: 1.3a2 + """ + + result = [] + id_greenlet = id(greenlet) + greenlet_dict = greenlet.__dict__ + for k, v in greenlet_dict.items(): + if not k.startswith(key_prefix): + continue + local_impl = v() + if local_impl is None: + continue + entry = local_impl.dicts.get(id_greenlet) + if entry is None: + # Not yet used in this greenlet. + continue + assert entry.wrgreenlet() is greenlet + result.append((local_impl.localtypeid, entry.localdict)) + + return result + + +class _wrefdict(dict): + """A dict that can be weak referenced""" + +class _greenlet_deleted(object): + """ + A weakref callback for when the greenlet + is deleted. + + If the greenlet is a `gevent.greenlet.Greenlet` and + supplies ``rawlink``, that will be used instead of a + weakref. + """ + __slots__ = ('idt', 'wrdicts') + + def __init__(self, idt, wrdicts): + self.idt = idt + self.wrdicts = wrdicts + + def __call__(self, _unused): + dicts = self.wrdicts() + if dicts: + dicts.pop(self.idt, None) + +class _local_deleted(object): + __slots__ = ('key', 'wrthread', 'greenlet_deleted') + + def __init__(self, key, wrthread, greenlet_deleted): + self.key = key + self.wrthread = wrthread + self.greenlet_deleted = greenlet_deleted + + def __call__(self, _unused): + thread = self.wrthread() + if thread is not None: + try: + unlink = thread.unlink + except AttributeError: + pass + else: + unlink(self.greenlet_deleted) + del thread.__dict__[self.key] + +class _localimpl(object): + """A class managing thread-local dicts""" + __slots__ = ('key', 'dicts', + 'localargs', 'localkwargs', + 'localtypeid', + '__weakref__',) + + def __init__(self, args, kwargs, local_type, id_local): + self.key = key_prefix + str(id(self)) + # { id(greenlet) -> _localimpl_dict_entry(ref(greenlet), greenlet-local dict) } + self.dicts = _wrefdict() + self.localargs = args + self.localkwargs = kwargs + self.localtypeid = local_type, id_local + + # We need to create the thread dict in anticipation of + # __init__ being called, to make sure we don't call it + # again ourselves. MUST do this before setting any attributes. + greenlet = getcurrent() # pylint:disable=undefined-variable + _localimpl_create_dict(self, greenlet, id(greenlet)) + +class _localimpl_dict_entry(object): + """ + The object that goes in the ``dicts`` of ``_localimpl`` + object for each thread. + """ + # This is a class, not just a tuple, so that cython can optimize + # attribute access + __slots__ = ('wrgreenlet', 'localdict') + + def __init__(self, wrgreenlet, localdict): + self.wrgreenlet = wrgreenlet + self.localdict = localdict + +# We use functions instead of methods so that they can be cdef'd in +# local.pxd; if they were cdef'd as methods, they would cause +# the creation of a pointer and a vtable. This happens +# even if we declare the class @cython.final. functions thus save memory overhead +# (but not pointer chasing overhead; the vtable isn't used when we declare +# the class final). + + +def _localimpl_create_dict(self, greenlet, id_greenlet): + """Create a new dict for the current thread, and return it.""" + localdict = {} + key = self.key + + wrdicts = ref(self.dicts) + + # When the greenlet is deleted, remove the local dict. + # Note that this is suboptimal if the greenlet object gets + # caught in a reference loop. We would like to be called + # as soon as the OS-level greenlet ends instead. + + # If we are working with a gevent.greenlet.Greenlet, we + # can pro-actively clear out with a link, avoiding the + # issue described above. Use rawlink to avoid spawning any + # more greenlets. + greenlet_deleted = _greenlet_deleted(id_greenlet, wrdicts) + + rawlink = getattr(greenlet, 'rawlink', None) + if rawlink is not None: + rawlink(greenlet_deleted) + wrthread = ref(greenlet) + else: + wrthread = ref(greenlet, greenlet_deleted) + + + # When the localimpl is deleted, remove the thread attribute. + local_deleted = _local_deleted(key, wrthread, greenlet_deleted) + + + wrlocal = ref(self, local_deleted) + greenlet.__dict__[key] = wrlocal + + self.dicts[id_greenlet] = _localimpl_dict_entry(wrthread, localdict) + return localdict + + +_marker = object() + +def _local_get_dict(self): + impl = self._local__impl + # Cython can optimize dict[], but not dict.get() + greenlet = getcurrent() # pylint:disable=undefined-variable + idg = id(greenlet) + try: + entry = impl.dicts[idg] + dct = entry.localdict + except KeyError: + dct = _localimpl_create_dict(impl, greenlet, idg) + self.__init__(*impl.localargs, **impl.localkwargs) + return dct + +def _init(): + greenlet_init() # pylint:disable=undefined-variable + +_local_attrs = { + '_local__impl', + '_local_type_get_descriptors', + '_local_type_set_or_del_descriptors', + '_local_type_del_descriptors', + '_local_type_set_descriptors', + '_local_type', + '_local_type_vars', + '__class__', + '__cinit__', +} + +class local(object): + """ + An object whose attributes are greenlet-local. + """ + __slots__ = tuple(_local_attrs - {'__class__', '__cinit__'}) + + def __cinit__(self, *args, **kw): + if args or kw: + if type(self).__init__ == object.__init__: + raise TypeError("Initialization arguments are not supported", args, kw) + impl = _localimpl(args, kw, type(self), id(self)) + # pylint:disable=attribute-defined-outside-init + self._local__impl = impl + get, dels, sets_or_dels, sets = _local_find_descriptors(self) + self._local_type_get_descriptors = get + self._local_type_set_or_del_descriptors = sets_or_dels + self._local_type_del_descriptors = dels + self._local_type_set_descriptors = sets + self._local_type = type(self) + self._local_type_vars = set(dir(self._local_type)) + + def __getattribute__(self, name): # pylint:disable=too-many-return-statements + if name in _local_attrs: + # The _local__impl, __cinit__, etc, won't be hit by the + # Cython version, if we've done things right. If we haven't, + # they will be, and this will produce an error. + return object.__getattribute__(self, name) + + dct = _local_get_dict(self) + + if name == '__dict__': + return dct + # If there's no possible way we can switch, because this + # attribute is *not* found in the class where it might be a + # data descriptor (property), and it *is* in the dict + # then we don't need to swizzle the dict and take the lock. + + # We don't have to worry about people overriding __getattribute__ + # because if they did, the dict-swizzling would only last as + # long as we were in here anyway. + # Similarly, a __getattr__ will still be called by _oga() if needed + # if it's not in the dict. + + # Optimization: If we're not subclassed, then + # there can be no descriptors except for methods, which will + # never need to use __dict__. + if self._local_type is local: + return dct[name] if name in dct else object.__getattribute__(self, name) + + # NOTE: If this is a descriptor, this will invoke its __get__. + # A broken descriptor that doesn't return itself when called with + # a None for the instance argument could mess us up here. + # But this is faster than a loop over mro() checking each class __dict__ + # manually. + if name in dct: + if name not in self._local_type_vars: + # If there is a dict value, and nothing in the type, + # it can't possibly be a descriptor, so it is just returned. + return dct[name] + + # It's in the type *and* in the dict. If the type value is + # a data descriptor (defines __get__ *and* either __set__ or + # __delete__), then the type wins. If it's a non-data descriptor + # (defines just __get__), then the instance wins. If it's not a + # descriptor at all (doesn't have __get__), the instance wins. + # NOTE that the docs for descriptors say that these methods must be + # defined on the *class* of the object in the type. + if name not in self._local_type_get_descriptors: + # Entirely not a descriptor. Instance wins. + return dct[name] + if name in self._local_type_set_or_del_descriptors: + # A data descriptor. + # arbitrary code execution while these run. If they touch self again, + # they'll call back into us and we'll repeat the dance. + type_attr = getattr(self._local_type, name) + return type(type_attr).__get__(type_attr, self, self._local_type) + # Last case is a non-data descriptor. Instance wins. + return dct[name] + + if name in self._local_type_vars: + # Not in the dictionary, but is found in the type. It could be + # a non-data descriptor still. Some descriptors, like @staticmethod, + # return objects (functions, in this case), that are *themselves* + # descriptors, which when invoked, again, would do the wrong thing. + # So we can't rely on getattr() on the type for them, we have to + # look through the MRO dicts ourself. + if name not in self._local_type_get_descriptors: + # Not a descriptor, can't execute code. So all we need is + # the return value of getattr() on our type. + return getattr(self._local_type, name) + + for base in self._local_type.mro(): + bd = base.__dict__ + if name in bd: + attr_on_type = bd[name] + result = type(attr_on_type).__get__(attr_on_type, self, self._local_type) + return result + + # It wasn't in the dict and it wasn't in the type. + # So the next step is to invoke type(self)__getattr__, if it + # exists, otherwise raise an AttributeError. + # we will invoke type(self).__getattr__ or raise an attribute error. + if hasattr(self._local_type, '__getattr__'): + return self._local_type.__getattr__(self, name) + raise AttributeError("%r object has no attribute '%s'" + % (self._local_type.__name__, name)) + + def __setattr__(self, name, value): + if name == '__dict__': + raise AttributeError( + "%r object attribute '__dict__' is read-only" + % type(self)) + + if name in _local_attrs: + object.__setattr__(self, name, value) + return + + dct = _local_get_dict(self) + + if self._local_type is local: + # Optimization: If we're not subclassed, we can't + # have data descriptors, so this goes right in the dict. + dct[name] = value + return + + if name in self._local_type_vars: + if name in self._local_type_set_descriptors: + type_attr = getattr(self._local_type, name, _marker) + # A data descriptor, like a property or a slot. + type(type_attr).__set__(type_attr, self, value) + return + # Otherwise it goes directly in the dict + dct[name] = value + + def __delattr__(self, name): + if name == '__dict__': + raise AttributeError( + "%r object attribute '__dict__' is read-only" + % self.__class__.__name__) + + if name in self._local_type_vars: + if name in self._local_type_del_descriptors: + # A data descriptor, like a property or a slot. + type_attr = getattr(self._local_type, name, _marker) + type(type_attr).__delete__(type_attr, self) + return + # Otherwise it goes directly in the dict + + # Begin inlined function _get_dict() + dct = _local_get_dict(self) + + try: + del dct[name] + except KeyError: + raise AttributeError(name) + + def __copy__(self): + impl = self._local__impl + entry = impl.dicts[id(getcurrent())] # pylint:disable=undefined-variable + + dct = entry.localdict + duplicate = copy(dct) + + cls = type(self) + instance = cls(*impl.localargs, **impl.localkwargs) + _local__copy_dict_from(instance, impl, duplicate) + return instance + +def _local__copy_dict_from(self, impl, duplicate): + current = getcurrent() # pylint:disable=undefined-variable + currentId = id(current) + new_impl = self._local__impl + assert new_impl is not impl + entry = new_impl.dicts[currentId] + new_impl.dicts[currentId] = _localimpl_dict_entry(entry.wrgreenlet, duplicate) + +def _local_find_descriptors(self): + type_self = type(self) + gets = set() + dels = set() + set_or_del = set() + sets = set() + mro = list(type_self.mro()) + + for attr_name in dir(type_self): + # Conventionally, descriptors when called on a class + # return themself, but not all do. Notable exceptions are + # in the zope.interface package, where things like __provides__ + # return other class attributes. So we can't use getattr, and instead + # walk up the dicts + for base in mro: + bd = base.__dict__ + if attr_name in bd: + attr = bd[attr_name] + break + else: + raise AttributeError(attr_name) + + type_attr = type(attr) + if hasattr(type_attr, '__get__'): + gets.add(attr_name) + if hasattr(type_attr, '__delete__'): + dels.add(attr_name) + set_or_del.add(attr_name) + if hasattr(type_attr, '__set__'): + sets.add(attr_name) + + return (gets, dels, set_or_del, sets) + +# Cython doesn't let us use __new__, it requires +# __cinit__. But we need __new__ if we're not compiled +# (e.g., on PyPy). So we set it at runtime. Cython +# will raise an error if we're compiled. +def __new__(cls, *args, **kw): + self = super(local, cls).__new__(cls) + # We get the cls in *args for some reason + # too when we do it this way....except on PyPy3, which does + # not *unless* it's wrapped in a classmethod (which it is) + self.__cinit__(*args[1:], **kw) + return self + +try: + # PyPy2/3 and CPython handle adding a __new__ to the class + # in different ways. In CPython and PyPy3, it must be wrapped with classmethod; + # in PyPy2, it must not. In either case, the args that get passed to + # it are stil wrong. + local.__new__ = 'None' +except TypeError: # pragma: no cover + # Must be compiled + pass +else: + from gevent._compat import PYPY + from gevent._compat import PY2 + if PYPY and PY2: + local.__new__ = __new__ + else: + local.__new__ = classmethod(__new__) + + del PYPY + del PY2 + +_init() + +from gevent._util import import_c_accel +import_c_accel(globals(), 'gevent._local') diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/lock.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/lock.py new file mode 100644 index 00000000..dc60d190 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/lock.py @@ -0,0 +1,260 @@ +# Copyright (c) 2009-2012 Denis Bilenko. See LICENSE for details. +"""Locking primitives""" +from __future__ import absolute_import + +from gevent.hub import getcurrent +from gevent._compat import PYPY +from gevent._semaphore import Semaphore, BoundedSemaphore # pylint:disable=no-name-in-module,import-error + + +__all__ = [ + 'Semaphore', + 'DummySemaphore', + 'BoundedSemaphore', + 'RLock', +] + +# On PyPy, we don't compile the Semaphore class with Cython. Under +# Cython, each individual method holds the GIL for its entire +# duration, ensuring that no other thread can interrupt us in an +# unsafe state (only when we _do_wait do we call back into Python and +# allow switching threads). Simulate that here through the use of a manual +# lock. (We use a separate lock for each semaphore to allow sys.settrace functions +# to use locks *other* than the one being traced.) +if PYPY: + # TODO: Need to use monkey.get_original? + try: + from _thread import allocate_lock as _allocate_lock # pylint:disable=import-error,useless-suppression + from _thread import get_ident as _get_ident # pylint:disable=import-error,useless-suppression + except ImportError: + # Python 2 + from thread import allocate_lock as _allocate_lock # pylint:disable=import-error,useless-suppression + from thread import get_ident as _get_ident # pylint:disable=import-error,useless-suppression + _sem_lock = _allocate_lock() + + def untraceable(f): + # Don't allow re-entry to these functions in a single thread, as can + # happen if a sys.settrace is used + def wrapper(self): + me = _get_ident() + try: + count = self._locking[me] + except KeyError: + count = self._locking[me] = 1 + else: + count = self._locking[me] = count + 1 + if count: + return + + try: + return f(self) + finally: + count = count - 1 + if not count: + del self._locking[me] + else: + self._locking[me] = count + return wrapper + + class _OwnedLock(object): + + def __init__(self): + self._owner = None + self._block = _allocate_lock() + self._locking = {} + self._count = 0 + + @untraceable + def acquire(self): + me = _get_ident() + if self._owner == me: + self._count += 1 + return + + self._owner = me + self._block.acquire() + self._count = 1 + + @untraceable + def release(self): + self._count = count = self._count - 1 + if not count: + self._block.release() + self._owner = None + + # acquire, wait, and release all acquire the lock on entry and release it + # on exit. acquire and wait can call _do_wait, which must release it on entry + # and re-acquire it for them on exit. + class _around(object): + __slots__ = ('before', 'after') + + def __init__(self, before, after): + self.before = before + self.after = after + + def __enter__(self): + self.before() + + def __exit__(self, t, v, tb): + self.after() + + def _decorate(func, cmname): + # functools.wrap? + def wrapped(self, *args, **kwargs): + with getattr(self, cmname): + return func(self, *args, **kwargs) + return wrapped + + Semaphore._py3k_acquire = Semaphore.acquire = _decorate(Semaphore.acquire, '_lock_locked') + Semaphore.release = _decorate(Semaphore.release, '_lock_locked') + Semaphore.wait = _decorate(Semaphore.wait, '_lock_locked') + Semaphore._wait = _decorate(Semaphore._wait, '_lock_unlocked') + + _Sem_init = Semaphore.__init__ + + def __init__(self, *args, **kwargs): + l = self._lock_lock = _OwnedLock() + self._lock_locked = _around(l.acquire, l.release) + self._lock_unlocked = _around(l.release, l.acquire) + + _Sem_init(self, *args, **kwargs) + + Semaphore.__init__ = __init__ + + del _decorate + del untraceable + + +class DummySemaphore(object): + """ + DummySemaphore(value=None) -> DummySemaphore + + A Semaphore initialized with "infinite" initial value. None of its + methods ever block. + + This can be used to parameterize on whether or not to actually + guard access to a potentially limited resource. If the resource is + actually limited, such as a fixed-size thread pool, use a real + :class:`Semaphore`, but if the resource is unbounded, use an + instance of this class. In that way none of the supporting code + needs to change. + + Similarly, it can be used to parameterize on whether or not to + enforce mutual exclusion to some underlying object. If the + underlying object is known to be thread-safe itself mutual + exclusion is not needed and a ``DummySemaphore`` can be used, but + if that's not true, use a real ``Semaphore``. + """ + + # Internally this is used for exactly the purpose described in the + # documentation. gevent.pool.Pool uses it instead of a Semaphore + # when the pool size is unlimited, and + # gevent.fileobject.FileObjectThread takes a parameter that + # determines whether it should lock around IO to the underlying + # file object. + + def __init__(self, value=None): + """ + .. versionchanged:: 1.1rc3 + Accept and ignore a *value* argument for compatibility with Semaphore. + """ + + def __str__(self): + return '<%s>' % self.__class__.__name__ + + def locked(self): + """A DummySemaphore is never locked so this always returns False.""" + return False + + def release(self): + """Releasing a dummy semaphore does nothing.""" + + def rawlink(self, callback): + # XXX should still work and notify? + pass + + def unlink(self, callback): + pass + + def wait(self, timeout=None): + """Waiting for a DummySemaphore returns immediately.""" + + def acquire(self, blocking=True, timeout=None): + """ + A DummySemaphore can always be acquired immediately so this always + returns True and ignores its arguments. + + .. versionchanged:: 1.1a1 + Always return *true*. + """ + # pylint:disable=unused-argument + return True + + def __enter__(self): + pass + + def __exit__(self, typ, val, tb): + pass + + +class RLock(object): + """ + A mutex that can be acquired more than once by the same greenlet. + """ + + def __init__(self): + self._block = Semaphore(1) + self._owner = None + self._count = 0 + + def __repr__(self): + return "<%s at 0x%x _block=%s _count=%r _owner=%r)>" % ( + self.__class__.__name__, + id(self), + self._block, + self._count, + self._owner) + + def acquire(self, blocking=1): + me = getcurrent() + if self._owner is me: + self._count = self._count + 1 + return 1 + rc = self._block.acquire(blocking) + if rc: + self._owner = me + self._count = 1 + return rc + + def __enter__(self): + return self.acquire() + + def release(self): + if self._owner is not getcurrent(): + raise RuntimeError("cannot release un-acquired lock") + self._count = count = self._count - 1 + if not count: + self._owner = None + self._block.release() + + def __exit__(self, typ, value, tb): + self.release() + + # Internal methods used by condition variables + + def _acquire_restore(self, count_owner): + count, owner = count_owner + self._block.acquire() + self._count = count + self._owner = owner + + def _release_save(self): + count = self._count + self._count = 0 + owner = self._owner + self._owner = None + self._block.release() + return (count, owner) + + def _is_owned(self): + return self._owner is getcurrent() diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/monkey.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/monkey.py new file mode 100644 index 00000000..6c1fa00b --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/monkey.py @@ -0,0 +1,1079 @@ +# Copyright (c) 2009-2012 Denis Bilenko. See LICENSE for details. +# pylint: disable=redefined-outer-name +""" +Make the standard library cooperative. + +The primary purpose of this module is to carefully patch, in place, +portions of the standard library with gevent-friendly functions that +behave in the same way as the original (at least as closely as possible). + +The primary interface to this is the :func:`patch_all` function, which +performs all the available patches. It accepts arguments to limit the +patching to certain modules, but most programs **should** use the +default values as they receive the most wide-spread testing, and some monkey +patches have dependencies on others. + +Patching **should be done as early as possible** in the lifecycle of the +program. For example, the main module (the one that tests against +``__main__`` or is otherwise the first imported) should begin with +this code, ideally before any other imports:: + + from gevent import monkey + monkey.patch_all() + +A corollary of the above is that patching **should be done on the main +thread** and **should be done while the program is single-threaded**. + +.. tip:: + + Some frameworks, such as gunicorn, handle monkey-patching for you. + Check their documentation to be sure. + +.. warning:: + + Patching too late can lead to unreliable behaviour (for example, some + modules may still use blocking sockets) or even errors. + +Querying +======== + +Sometimes it is helpful to know if objects have been monkey-patched, and in +advanced cases even to have access to the original standard library functions. This +module provides functions for that purpose. + +- :func:`is_module_patched` +- :func:`is_object_patched` +- :func:`get_original` + +Plugins +======= + +Beginning in gevent 1.3, events are emitted during the monkey patching process. +These events are delivered first to :mod:`gevent.events` subscribers, and then +to `setuptools entry points`_. + +The following events are defined. They are listed in (roughly) the order +that a call to :func:`patch_all` will emit them. + +- :class:`gevent.events.GeventWillPatchAllEvent` +- :class:`gevent.events.GeventWillPatchModuleEvent` +- :class:`gevent.events.GeventDidPatchModuleEvent` +- :class:`gevent.events.GeventDidPatchBuiltinModulesEvent` +- :class:`gevent.events.GeventDidPatchAllEvent` + +Each event class documents the corresponding setuptools entry point name. The +entry points will be called with a single argument, the same instance of +the class that was sent to the subscribers. + +You can subscribe to the events to monitor the monkey-patching process and +to manipulate it, for example by raising :exc:`gevent.events.DoNotPatch`. + +You can also subscribe to the events to provide additional patching beyond what +gevent distributes, either for additional standard library modules, or +for third-party packages. The suggested time to do this patching is in +the subscriber for :class:`gevent.events.GeventDidPatchBuiltinModulesEvent`. +For example, to automatically patch `psycopg2`_ using `psycogreen`_ +when the call to :func:`patch_all` is made, you could write code like this:: + + # mypackage.py + def patch_psycopg(event): + from psycogreen.gevent import patch_psycopg + patch_psycopg() + +In your ``setup.py`` you would register it like this:: + + from setuptools import setup + setup( + ... + entry_points={ + 'gevent.plugins.monkey.did_patch_builtins': [ + 'psycopg2 = mypackage:patch_psycopg', + ], + }, + ... + ) + +For more complex patching, gevent provides a helper method +that you can call to replace attributes of modules with attributes of your +own modules. This function also takes care of emitting the appropriate events. + +- :func:`patch_module` + +.. _setuptools entry points: http://setuptools.readthedocs.io/en/latest/setuptools.html#dynamic-discovery-of-services-and-plugins +.. _psycopg2: https://pypi.python.org/pypi/psycopg2 +.. _psycogreen: https://pypi.python.org/pypi/psycogreen + +Use as a module +=============== + +Sometimes it is useful to run existing python scripts or modules that +were not built to be gevent aware under gevent. To do so, this module +can be run as the main module, passing the script and its arguments. +For details, see the :func:`main` function. + +.. versionchanged:: 1.3b1 + Added support for plugins and began emitting will/did patch events. +""" +from __future__ import absolute_import +from __future__ import print_function +import sys + +__all__ = [ + 'patch_all', + 'patch_builtins', + 'patch_dns', + 'patch_os', + 'patch_queue', + 'patch_select', + 'patch_signal', + 'patch_socket', + 'patch_ssl', + 'patch_subprocess', + 'patch_sys', + 'patch_thread', + 'patch_time', + # query functions + 'get_original', + 'is_module_patched', + 'is_object_patched', + # plugin API + 'patch_module', + # module functions + 'main', +] + + +if sys.version_info[0] >= 3: + string_types = (str,) + PY3 = True +else: + import __builtin__ # pylint:disable=import-error + string_types = (__builtin__.basestring,) + PY3 = False + +WIN = sys.platform.startswith("win") + +class MonkeyPatchWarning(RuntimeWarning): + """ + The type of warnings we issue. + + .. versionadded:: 1.3a2 + """ + +def _notify_patch(event, _warnings=None): + # Raises DoNotPatch if we're not supposed to patch + from gevent.events import notify_and_call_entry_points + + event._warnings = _warnings + notify_and_call_entry_points(event) + +def _ignores_DoNotPatch(func): + + from functools import wraps + + @wraps(func) + def ignores(*args, **kwargs): + from gevent.events import DoNotPatch + try: + return func(*args, **kwargs) + except DoNotPatch: + return False + + return ignores + + +# maps module name -> {attribute name: original item} +# e.g. "time" -> {"sleep": built-in function sleep} +saved = {} + + +def is_module_patched(mod_name): + """ + Check if a module has been replaced with a cooperative version. + + :param str mod_name: The name of the standard library module, + e.g., ``'socket'``. + + """ + return mod_name in saved + + +def is_object_patched(mod_name, item_name): + """ + Check if an object in a module has been replaced with a + cooperative version. + + :param str mod_name: The name of the standard library module, + e.g., ``'socket'``. + :param str item_name: The name of the attribute in the module, + e.g., ``'create_connection'``. + + """ + return is_module_patched(mod_name) and item_name in saved[mod_name] + + +def _get_original(name, items): + d = saved.get(name, {}) + values = [] + module = None + for item in items: + if item in d: + values.append(d[item]) + else: + if module is None: + module = __import__(name) + values.append(getattr(module, item)) + return values + + +def get_original(mod_name, item_name): + """ + Retrieve the original object from a module. + + If the object has not been patched, then that object will still be + retrieved. + + :param str mod_name: The name of the standard library module, + e.g., ``'socket'``. + :param item_name: A string or sequence of strings naming the + attribute(s) on the module ``mod_name`` to return. + + :return: The original value if a string was given for + ``item_name`` or a sequence of original values if a + sequence was passed. + """ + if isinstance(item_name, string_types): + return _get_original(mod_name, [item_name])[0] + return _get_original(mod_name, item_name) + + +_NONE = object() + + +def patch_item(module, attr, newitem): + olditem = getattr(module, attr, _NONE) + if olditem is not _NONE: + saved.setdefault(module.__name__, {}).setdefault(attr, olditem) + setattr(module, attr, newitem) + + +def remove_item(module, attr): + olditem = getattr(module, attr, _NONE) + if olditem is _NONE: + return + saved.setdefault(module.__name__, {}).setdefault(attr, olditem) + delattr(module, attr) + + +def __call_module_hook(gevent_module, name, module, items, _warnings): + # This function can raise DoNotPatch on 'will' + + def warn(message): + _queue_warning(message, _warnings) + + func_name = '_gevent_' + name + '_monkey_patch' + try: + func = getattr(gevent_module, func_name) + except AttributeError: + func = lambda *args: None + + + func(module, items, warn) + + +def patch_module(target_module, source_module, items=None, + _warnings=None, + _notify_did_subscribers=True): + """ + patch_module(target_module, source_module, items=None) + + Replace attributes in *target_module* with the attributes of the + same name in *source_module*. + + The *source_module* can provide some attributes to customize the process: + + * ``__implements__`` is a list of attribute names to copy; if not present, + the *items* keyword argument is mandatory. + * ``_gevent_will_monkey_patch(target_module, items, warn, **kwargs)`` + * ``_gevent_did_monkey_patch(target_module, items, warn, **kwargs)`` + These two functions in the *source_module* are called *if* they exist, + before and after copying attributes, respectively. The "will" function + may modify *items*. The value of *warn* is a function that should be called + with a single string argument to issue a warning to the user. If the "will" + function raises :exc:`gevent.events.DoNotPatch`, no patching will be done. These functions + are called before any event subscribers or plugins. + + :keyword list items: A list of attribute names to replace. If + not given, this will be taken from the *source_module* ``__implements__`` + attribute. + :return: A true value if patching was done, a false value if patching was canceled. + + .. versionadded:: 1.3b1 + """ + from gevent import events + + if items is None: + items = getattr(source_module, '__implements__', None) + if items is None: + raise AttributeError('%r does not have __implements__' % source_module) + + try: + __call_module_hook(source_module, 'will', target_module, items, _warnings) + _notify_patch( + events.GeventWillPatchModuleEvent(target_module.__name__, source_module, + target_module, items), + _warnings) + except events.DoNotPatch: + return False + + for attr in items: + patch_item(target_module, attr, getattr(source_module, attr)) + + __call_module_hook(source_module, 'did', target_module, items, _warnings) + + if _notify_did_subscribers: + # We allow turning off the broadcast of the 'did' event for the benefit + # of our internal functions which need to do additional work (besides copying + # attributes) before their patch can be considered complete. + _notify_patch( + events.GeventDidPatchModuleEvent(target_module.__name__, source_module, + target_module) + ) + + return True + +def _patch_module(name, items=None, _warnings=None, _notify_did_subscribers=True): + + gevent_module = getattr(__import__('gevent.' + name), name) + module_name = getattr(gevent_module, '__target__', name) + target_module = __import__(module_name) + + patch_module(target_module, gevent_module, items=items, + _warnings=_warnings, + _notify_did_subscribers=_notify_did_subscribers) + + return gevent_module, target_module + + +def _queue_warning(message, _warnings): + # Queues a warning to show after the monkey-patching process is all done. + # Done this way to avoid extra imports during the process itself, just + # in case. If we're calling a function one-off (unusual) go ahead and do it + if _warnings is None: + _process_warnings([message]) + else: + _warnings.append(message) + + +def _process_warnings(_warnings): + import warnings + for warning in _warnings: + warnings.warn(warning, MonkeyPatchWarning, stacklevel=3) + + +def _patch_sys_std(name): + from gevent.fileobject import FileObjectThread + orig = getattr(sys, name) + if not isinstance(orig, FileObjectThread): + patch_item(sys, name, FileObjectThread(orig)) + +@_ignores_DoNotPatch +def patch_sys(stdin=True, stdout=True, stderr=True): + """ + Patch sys.std[in,out,err] to use a cooperative IO via a + threadpool. + + This is relatively dangerous and can have unintended consequences + such as hanging the process or `misinterpreting control keys`_ + when :func:`input` and :func:`raw_input` are used. :func:`patch_all` + does *not* call this function by default. + + This method does nothing on Python 3. The Python 3 interpreter + wants to flush the TextIOWrapper objects that make up + stderr/stdout at shutdown time, but using a threadpool at that + time leads to a hang. + + .. _`misinterpreting control keys`: https://github.com/gevent/gevent/issues/274 + """ + # test__issue6.py demonstrates the hang if these lines are removed; + # strangely enough that test passes even without monkey-patching sys + if PY3: + items = None + else: + items = set([('stdin' if stdin else None), + ('stdout' if stdout else None), + ('stderr' if stderr else None)]) + items.discard(None) + items = list(items) + + if not items: + return + + from gevent import events + _notify_patch(events.GeventWillPatchModuleEvent('sys', None, sys, + items)) + + for item in items: + _patch_sys_std(item) + + _notify_patch(events.GeventDidPatchModuleEvent('sys', None, sys)) + +@_ignores_DoNotPatch +def patch_os(): + """ + Replace :func:`os.fork` with :func:`gevent.fork`, and, on POSIX, + :func:`os.waitpid` with :func:`gevent.os.waitpid` (if the + environment variable ``GEVENT_NOWAITPID`` is not defined). Does + nothing if fork is not available. + + .. caution:: This method must be used with :func:`patch_signal` to have proper `SIGCHLD` + handling and thus correct results from ``waitpid``. + :func:`patch_all` calls both by default. + + .. caution:: For `SIGCHLD` handling to work correctly, the event loop must run. + The easiest way to help ensure this is to use :func:`patch_all`. + """ + _patch_module('os') + + +@_ignores_DoNotPatch +def patch_queue(): + """ + On Python 3.7 and above, replace :class:`queue.SimpleQueue` (implemented + in C) with its Python counterpart. + + .. versionadded:: 1.3.5 + """ + + import gevent.queue + if 'SimpleQueue' in gevent.queue.__all__: + _patch_module('queue', items=['SimpleQueue']) + + +@_ignores_DoNotPatch +def patch_time(): + """ + Replace :func:`time.sleep` with :func:`gevent.sleep`. + """ + _patch_module('time') + + +def _patch_existing_locks(threading): + if len(list(threading.enumerate())) != 1: + return + try: + tid = threading.get_ident() + except AttributeError: + tid = threading._get_ident() + rlock_type = type(threading.RLock()) + try: + import importlib._bootstrap + except ImportError: + class _ModuleLock(object): + pass + else: + _ModuleLock = importlib._bootstrap._ModuleLock # python 2 pylint: disable=no-member + # It might be possible to walk up all the existing stack frames to find + # locked objects...at least if they use `with`. To be sure, we look at every object + # Since we're supposed to be done very early in the process, there shouldn't be + # too many. + + # By definition there's only one thread running, so the various + # owner attributes were the old (native) thread id. Make it our + # current greenlet id so that when it wants to unlock and compare + # self.__owner with _get_ident(), they match. + gc = __import__('gc') + for o in gc.get_objects(): + if isinstance(o, rlock_type): + if hasattr(o, '_owner'): # Py3 + if o._owner is not None: + o._owner = tid + else: + if o._RLock__owner is not None: + o._RLock__owner = tid + elif isinstance(o, _ModuleLock): + if o.owner is not None: + o.owner = tid + +@_ignores_DoNotPatch +def patch_thread(threading=True, _threading_local=True, Event=True, logging=True, + existing_locks=True, + _warnings=None): + """ + patch_thread(threading=True, _threading_local=True, Event=True, logging=True, existing_locks=True) -> None + + Replace the standard :mod:`thread` module to make it greenlet-based. + + :keyword bool threading: When True (the default), + also patch :mod:`threading`. + :keyword bool _threading_local: When True (the default), + also patch :class:`_threading_local.local`. + :keyword bool logging: When True (the default), also patch locks + taken if the logging module has been configured. + + :keyword bool existing_locks: When True (the default), and the + process is still single threaded, make sure that any + :class:`threading.RLock` (and, under Python 3, :class:`importlib._bootstrap._ModuleLock`) + instances that are currently locked can be properly unlocked. + + .. caution:: + Monkey-patching :mod:`thread` and using + :class:`multiprocessing.Queue` or + :class:`concurrent.futures.ProcessPoolExecutor` (which uses a + ``Queue``) will hang the process. + + .. versionchanged:: 1.1b1 + Add *logging* and *existing_locks* params. + .. versionchanged:: 1.3a2 + ``Event`` defaults to True. + """ + # XXX: Simplify + # pylint:disable=too-many-branches,too-many-locals,too-many-statements + + # Description of the hang: + # There is an incompatibility with patching 'thread' and the 'multiprocessing' module: + # The problem is that multiprocessing.queues.Queue uses a half-duplex multiprocessing.Pipe, + # which is implemented with os.pipe() and _multiprocessing.Connection. os.pipe isn't patched + # by gevent, as it returns just a fileno. _multiprocessing.Connection is an internal implementation + # class implemented in C, which exposes a 'poll(timeout)' method; under the covers, this issues a + # (blocking) select() call: hence the need for a real thread. Except for that method, we could + # almost replace Connection with gevent.fileobject.SocketAdapter, plus a trivial + # patch to os.pipe (below). Sigh, so close. (With a little work, we could replicate that method) + + # import os + # import fcntl + # os_pipe = os.pipe + # def _pipe(): + # r, w = os_pipe() + # fcntl.fcntl(r, fcntl.F_SETFL, os.O_NONBLOCK) + # fcntl.fcntl(w, fcntl.F_SETFL, os.O_NONBLOCK) + # return r, w + # os.pipe = _pipe + + # The 'threading' module copies some attributes from the + # thread module the first time it is imported. If we patch 'thread' + # before that happens, then we store the wrong values in 'saved', + # So if we're going to patch threading, we either need to import it + # before we patch thread, or manually clean up the attributes that + # are in trouble. The latter is tricky because of the different names + # on different versions. + if threading: + threading_mod = __import__('threading') + # Capture the *real* current thread object before + # we start returning DummyThread objects, for comparison + # to the main thread. + orig_current_thread = threading_mod.current_thread() + else: + threading_mod = None + gevent_threading_mod = None + orig_current_thread = None + + gevent_thread_mod, thread_mod = _patch_module('thread', + _warnings=_warnings, _notify_did_subscribers=False) + + if threading: + gevent_threading_mod, _ = _patch_module('threading', + _warnings=_warnings, _notify_did_subscribers=False) + + if Event: + from gevent.event import Event + patch_item(threading_mod, 'Event', Event) + # Python 2 had `Event` as a function returning + # the private class `_Event`. Some code may be relying + # on that. + if hasattr(threading_mod, '_Event'): + patch_item(threading_mod, '_Event', Event) + + if existing_locks: + _patch_existing_locks(threading_mod) + + if logging and 'logging' in sys.modules: + logging = __import__('logging') + patch_item(logging, '_lock', threading_mod.RLock()) + for wr in logging._handlerList: + # In py26, these are actual handlers, not weakrefs + handler = wr() if callable(wr) else wr + if handler is None: + continue + if not hasattr(handler, 'lock'): + raise TypeError("Unknown/unsupported handler %r" % handler) + handler.lock = threading_mod.RLock() + + if _threading_local: + _threading_local = __import__('_threading_local') + from gevent.local import local + patch_item(_threading_local, 'local', local) + + def make_join_func(thread, thread_greenlet): + from gevent.hub import sleep + from time import time + + def join(timeout=None): + end = None + if threading_mod.current_thread() is thread: + raise RuntimeError("Cannot join current thread") + if thread_greenlet is not None and thread_greenlet.dead: + return + if not thread.is_alive(): + return + + if timeout: + end = time() + timeout + + while thread.is_alive(): + if end is not None and time() > end: + return + sleep(0.01) + return join + + if threading: + from gevent.threading import main_native_thread + + for thread in threading_mod._active.values(): + if thread == main_native_thread(): + continue + thread.join = make_join_func(thread, None) + + if sys.version_info[:2] >= (3, 4): + + # Issue 18808 changes the nature of Thread.join() to use + # locks. This means that a greenlet spawned in the main thread + # (which is already running) cannot wait for the main thread---it + # hangs forever. We patch around this if possible. See also + # gevent.threading. + greenlet = __import__('greenlet') + + if orig_current_thread == threading_mod.main_thread(): + main_thread = threading_mod.main_thread() + _greenlet = main_thread._greenlet = greenlet.getcurrent() + + main_thread.join = make_join_func(main_thread, _greenlet) + + # Patch up the ident of the main thread to match. This + # matters if threading was imported before monkey-patching + # thread + oldid = main_thread.ident + main_thread._ident = threading_mod.get_ident() + if oldid in threading_mod._active: + threading_mod._active[main_thread.ident] = threading_mod._active[oldid] + if oldid != main_thread.ident: + del threading_mod._active[oldid] + else: + _queue_warning("Monkey-patching not on the main thread; " + "threading.main_thread().join() will hang from a greenlet", + _warnings) + + from gevent import events + _notify_patch(events.GeventDidPatchModuleEvent('thread', gevent_thread_mod, thread_mod)) + _notify_patch(events.GeventDidPatchModuleEvent('threading', gevent_threading_mod, threading_mod)) + +@_ignores_DoNotPatch +def patch_socket(dns=True, aggressive=True): + """ + Replace the standard socket object with gevent's cooperative + sockets. + + :keyword bool dns: When true (the default), also patch address + resolution functions in :mod:`socket`. See :doc:`/dns` for details. + """ + from gevent import socket + # Note: although it seems like it's not strictly necessary to monkey patch 'create_connection', + # it's better to do it. If 'create_connection' was not monkey patched, but the rest of socket module + # was, create_connection would still use "green" getaddrinfo and "green" socket. + # However, because gevent.socket.socket.connect is a Python function, the exception raised by it causes + # _socket object to be referenced by the frame, thus causing the next invocation of bind(source_address) to fail. + if dns: + items = socket.__implements__ # pylint:disable=no-member + else: + items = set(socket.__implements__) - set(socket.__dns__) # pylint:disable=no-member + _patch_module('socket', items=items) + if aggressive: + if 'ssl' not in socket.__implements__: # pylint:disable=no-member + remove_item(socket, 'ssl') + +@_ignores_DoNotPatch +def patch_dns(): + """ + Replace :doc:`DNS functions ` in :mod:`socket` with + cooperative versions. + + This is only useful if :func:`patch_socket` has been called and is + done automatically by that method if requested. + """ + from gevent import socket + _patch_module('socket', items=socket.__dns__) # pylint:disable=no-member + + +def _find_module_refs(to, excluding_names=()): + # Looks specifically for module-level references, + # i.e., 'from foo import Bar'. We define a module reference + # as a dict (subclass) that also has a __name__ attribute. + # This does not handle subclasses, but it does find them. + # Returns two sets. The first is modules (name, file) that were + # found. The second is subclasses that were found. + gc = __import__('gc') + direct_ref_modules = set() + subclass_modules = set() + + def report(mod): + return mod['__name__'], mod.get('__file__', '') + + for r in gc.get_referrers(to): + if isinstance(r, dict) and '__name__' in r: + if r['__name__'] in excluding_names: + continue + + for v in r.values(): + if v is to: + direct_ref_modules.add(report(r)) + elif isinstance(r, type) and to in r.__bases__ and 'gevent.' not in r.__module__: + subclass_modules.add(r) + + return direct_ref_modules, subclass_modules + +@_ignores_DoNotPatch +def patch_ssl(_warnings=None, _first_time=True): + """ + patch_ssl() -> None + + Replace :class:`ssl.SSLSocket` object and socket wrapping functions in + :mod:`ssl` with cooperative versions. + + This is only useful if :func:`patch_socket` has been called. + """ + may_need_warning = ( + _first_time + and sys.version_info[:2] >= (3, 6) + and 'ssl' in sys.modules + and hasattr(sys.modules['ssl'], 'SSLContext')) + # Previously, we didn't warn on Python 2 if pkg_resources has been imported + # because that imports ssl and it's commonly used for namespace packages, + # which typically means we're still in some early part of the import cycle. + # However, with our new more discriminating check, that no longer seems to be a problem. + # Prior to 3.6, we don't have the RecursionError problem, and prior to 3.7 we don't have the + # SSLContext.sslsocket_class/SSLContext.sslobject_class problem. + + gevent_mod, _ = _patch_module('ssl', _warnings=_warnings) + if may_need_warning: + direct_ref_modules, subclass_modules = _find_module_refs( + gevent_mod.orig_SSLContext, + excluding_names=('ssl', 'gevent.ssl', 'gevent._ssl3', 'gevent._sslgte279')) + if direct_ref_modules or subclass_modules: + # Normally you don't want to have dynamic warning strings, because + # the cache in the warning module is based on the string. But we + # specifically only do this the first time we patch ourself, so it's + # ok. + direct_ref_mod_str = subclass_str = '' + if direct_ref_modules: + direct_ref_mod_str = 'Modules that had direct imports (NOT patched): %s. ' % ([ + "%s (%s)" % (name, fname) + for name, fname in direct_ref_modules + ]) + if subclass_modules: + subclass_str = 'Subclasses (NOT patched): %s. ' % ([ + str(t) for t in subclass_modules + ]) + _queue_warning( + 'Monkey-patching ssl after ssl has already been imported ' + 'may lead to errors, including RecursionError on Python 3.6. ' + 'It may also silently lead to incorrect behaviour on Python 3.7. ' + 'Please monkey-patch earlier. ' + 'See https://github.com/gevent/gevent/issues/1016. ' + + direct_ref_mod_str + subclass_str, + _warnings) + + +@_ignores_DoNotPatch +def patch_select(aggressive=True): + """ + Replace :func:`select.select` with :func:`gevent.select.select` + and :func:`select.poll` with :class:`gevent.select.poll` (where available). + + If ``aggressive`` is true (the default), also remove other + blocking functions from :mod:`select` and (on Python 3.4 and + above) :mod:`selectors`: + + - :func:`select.epoll` + - :func:`select.kqueue` + - :func:`select.kevent` + - :func:`select.devpoll` (Python 3.5+) + - :class:`selectors.EpollSelector` + - :class:`selectors.KqueueSelector` + - :class:`selectors.DevpollSelector` (Python 3.5+) + """ + + source_mod, target_mod = _patch_module('select', _notify_did_subscribers=False) + if aggressive: + select = target_mod + # since these are blocking we're removing them here. This makes some other + # modules (e.g. asyncore) non-blocking, as they use select that we provide + # when none of these are available. + remove_item(select, 'epoll') + remove_item(select, 'kqueue') + remove_item(select, 'kevent') + remove_item(select, 'devpoll') + + if sys.version_info[:2] >= (3, 4): + # Python 3 wants to use `select.select` as a member function, + # leading to this error in selectors.py (because gevent.select.select is + # not a builtin and doesn't get the magic auto-static that they do) + # r, w, _ = self._select(self._readers, self._writers, [], timeout) + # TypeError: select() takes from 3 to 4 positional arguments but 5 were given + # Note that this obviously only happens if selectors was imported after we had patched + # select; but there is a code path that leads to it being imported first (but now we've + # patched select---so we can't compare them identically) + select = target_mod # Should be gevent-patched now + orig_select_select = get_original('select', 'select') + assert select.select is not orig_select_select + selectors = __import__('selectors') + if selectors.SelectSelector._select in (select.select, orig_select_select): + def _select(self, *args, **kwargs): # pylint:disable=unused-argument + return select.select(*args, **kwargs) + selectors.SelectSelector._select = _select + _select._gevent_monkey = True + + # Python 3.7 refactors the poll-like selectors to use a common + # base class and capture a reference to select.poll, etc, at + # import time. selectors tends to get imported early + # (importing 'platform' does it: platform -> subprocess -> selectors), + # so we need to clean that up. + if hasattr(selectors, 'PollSelector') and hasattr(selectors.PollSelector, '_selector_cls'): + selectors.PollSelector._selector_cls = select.poll + + if aggressive: + # If `selectors` had already been imported before we removed + # select.epoll|kqueue|devpoll, these may have been defined in terms + # of those functions. They'll fail at runtime. + remove_item(selectors, 'EpollSelector') + remove_item(selectors, 'KqueueSelector') + remove_item(selectors, 'DevpollSelector') + selectors.DefaultSelector = selectors.SelectSelector + + from gevent import events + _notify_patch(events.GeventDidPatchModuleEvent('select', source_mod, target_mod)) + +@_ignores_DoNotPatch +def patch_subprocess(): + """ + Replace :func:`subprocess.call`, :func:`subprocess.check_call`, + :func:`subprocess.check_output` and :class:`subprocess.Popen` with + :mod:`cooperative versions `. + + .. note:: + On Windows under Python 3, the API support may not completely match + the standard library. + + """ + _patch_module('subprocess') + +@_ignores_DoNotPatch +def patch_builtins(): + """ + Make the builtin :func:`__import__` function `greenlet safe`_ under Python 2. + + .. note:: + This does nothing under Python 3 as it is not necessary. Python 3 features + improved import locks that are per-module, not global. + + .. _greenlet safe: https://github.com/gevent/gevent/issues/108 + + """ + if sys.version_info[:2] < (3, 3): + _patch_module('builtins') + +@_ignores_DoNotPatch +def patch_signal(): + """ + Make the :func:`signal.signal` function work with a :func:`monkey-patched os `. + + .. caution:: This method must be used with :func:`patch_os` to have proper ``SIGCHLD`` + handling. :func:`patch_all` calls both by default. + + .. caution:: For proper ``SIGCHLD`` handling, you must yield to the event loop. + Using :func:`patch_all` is the easiest way to ensure this. + + .. seealso:: :mod:`gevent.signal` + """ + _patch_module("signal") + + +def _check_repatching(**module_settings): + _warnings = [] + key = '_gevent_saved_patch_all' + del module_settings['kwargs'] + if saved.get(key, module_settings) != module_settings: + _queue_warning("Patching more than once will result in the union of all True" + " parameters being patched", + _warnings) + + first_time = key not in saved + saved[key] = module_settings + return _warnings, first_time, module_settings + + +def _subscribe_signal_os(will_patch_all): + if will_patch_all.will_patch_module('signal') and not will_patch_all.will_patch_module('os'): + warnings = will_patch_all._warnings # Internal + _queue_warning('Patching signal but not os will result in SIGCHLD handlers' + ' installed after this not being called and os.waitpid may not' + ' function correctly if gevent.subprocess is used. This may raise an' + ' error in the future.', + warnings) + +def patch_all(socket=True, dns=True, time=True, select=True, thread=True, os=True, ssl=True, + httplib=False, # Deprecated, to be removed. + subprocess=True, sys=False, aggressive=True, Event=True, + builtins=True, signal=True, + queue=True, + **kwargs): + """ + Do all of the default monkey patching (calls every other applicable + function in this module). + + :return: A true value if patching all modules wasn't cancelled, a false + value if it was. + + .. versionchanged:: 1.1 + Issue a :mod:`warning ` if this function is called multiple times + with different arguments. The second and subsequent calls will only add more + patches, they can never remove existing patches by setting an argument to ``False``. + .. versionchanged:: 1.1 + Issue a :mod:`warning ` if this function is called with ``os=False`` + and ``signal=True``. This will cause SIGCHLD handlers to not be called. This may + be an error in the future. + .. versionchanged:: 1.3a2 + ``Event`` defaults to True. + .. versionchanged:: 1.3b1 + Defined the return values. + .. versionchanged:: 1.3b1 + Add ``**kwargs`` for the benefit of event subscribers. CAUTION: gevent may add + and interpret additional arguments in the future, so it is suggested to use prefixes + for kwarg values to be interpreted by plugins, for example, `patch_all(mylib_futures=True)`. + .. versionchanged:: 1.3.5 + Add *queue*, defaulting to True, for Python 3.7. + """ + # pylint:disable=too-many-locals,too-many-branches + + # Check to see if they're changing the patched list + _warnings, first_time, modules_to_patch = _check_repatching(**locals()) + if not _warnings and not first_time: + # Nothing to do, identical args to what we just + # did + return + + from gevent import events + try: + _notify_patch(events.GeventWillPatchAllEvent(modules_to_patch, kwargs), _warnings) + except events.DoNotPatch: + return False + + # order is important + if os: + patch_os() + if time: + patch_time() + if thread: + patch_thread(Event=Event, _warnings=_warnings) + # sys must be patched after thread. in other cases threading._shutdown will be + # initiated to _MainThread with real thread ident + if sys: + patch_sys() + if socket: + patch_socket(dns=dns, aggressive=aggressive) + if select: + patch_select(aggressive=aggressive) + if ssl: + patch_ssl(_warnings=_warnings, _first_time=first_time) + if httplib: + raise ValueError('gevent.httplib is no longer provided, httplib must be False') + if subprocess: + patch_subprocess() + if builtins: + patch_builtins() + if signal: + patch_signal() + if queue: + patch_queue() + + _notify_patch(events.GeventDidPatchBuiltinModulesEvent(modules_to_patch, kwargs), _warnings) + _notify_patch(events.GeventDidPatchAllEvent(modules_to_patch, kwargs), _warnings) + + _process_warnings(_warnings) + return True + + +def main(): + args = {} + argv = sys.argv[1:] + verbose = False + script_help, patch_all_args, modules = _get_script_help() + while argv and argv[0].startswith('--'): + option = argv[0][2:] + if option == 'verbose': + verbose = True + elif option.startswith('no-') and option.replace('no-', '') in patch_all_args: + args[option[3:]] = False + elif option in patch_all_args: + args[option] = True + if option in modules: + for module in modules: + args.setdefault(module, False) + else: + sys.exit(script_help + '\n\n' + 'Cannot patch %r' % option) + del argv[0] + # TODO: break on -- + if verbose: + import pprint + import os + print('gevent.monkey.patch_all(%s)' % ', '.join('%s=%s' % item for item in args.items())) + print('sys.version=%s' % (sys.version.strip().replace('\n', ' '), )) + print('sys.path=%s' % pprint.pformat(sys.path)) + print('sys.modules=%s' % pprint.pformat(sorted(sys.modules.keys()))) + print('cwd=%s' % os.getcwd()) + + patch_all(**args) + if argv: + sys.argv = argv + import runpy + # Use runpy.run_path to closely (exactly) match what the + # interpreter does given 'python '. This includes allowing + # passing .pyc/.pyo files and packages with a __main__ and + # potentially even zip files. Previously we used exec, which only + # worked if we directly read a python source file. + runpy.run_path(sys.argv[0], + run_name='__main__') + else: + print(script_help) + + +def _get_script_help(): + # pylint:disable=deprecated-method + import inspect + try: + getter = inspect.getfullargspec # deprecated in 3.5, un-deprecated in 3.6 + except AttributeError: + getter = inspect.getargspec + patch_all_args = getter(patch_all)[0] + modules = [x for x in patch_all_args if 'patch_' + x in globals()] + script_help = """gevent.monkey - monkey patch the standard modules to use gevent. + +USAGE: ``python -m gevent.monkey [MONKEY OPTIONS] script [SCRIPT OPTIONS]`` + +If no OPTIONS present, monkey patches all the modules it can patch. +You can exclude a module with --no-module, e.g. --no-thread. You can +specify a module to patch with --module, e.g. --socket. In the latter +case only the modules specified on the command line will be patched. + +.. versionchanged:: 1.3b1 + The *script* argument can now be any argument that can be passed to `runpy.run_path`, + just like the interpreter itself does, for example a package directory containing ``__main__.py``. + Previously it had to be the path to + a .py source file. + +MONKEY OPTIONS: ``--verbose %s``""" % ', '.join('--[no-]%s' % m for m in modules) + return script_help, patch_all_args, modules + +main.__doc__ = _get_script_help()[0] + +if __name__ == '__main__': + main() diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/os.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/os.py new file mode 100644 index 00000000..3980f320 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/os.py @@ -0,0 +1,510 @@ +""" +Low-level operating system functions from :mod:`os`. + +Cooperative I/O +=============== + +This module provides cooperative versions of :func:`os.read` and +:func:`os.write`. These functions are *not* monkey-patched; you +must explicitly call them or monkey patch them yourself. + +POSIX functions +--------------- + +On POSIX, non-blocking IO is available. + +- :func:`nb_read` +- :func:`nb_write` +- :func:`make_nonblocking` + +All Platforms +------------- + +On non-POSIX platforms (e.g., Windows), non-blocking IO is not +available. On those platforms (and on POSIX), cooperative IO can +be done with the threadpool. + +- :func:`tp_read` +- :func:`tp_write` + +Child Processes +=============== + +The functions :func:`fork` and (on POSIX) :func:`forkpty` and :func:`waitpid` can be used +to manage child processes. + +.. warning:: + + Forking a process that uses greenlets does not eliminate all non-running + greenlets. Any that were scheduled in the hub of the forking thread in the parent + remain scheduled in the child; compare this to how normal threads operate. (This behaviour + may change is a subsequent major release.) +""" + +from __future__ import absolute_import + +import os +import sys +from gevent.hub import _get_hub_noargs as get_hub +from gevent.hub import reinit +from gevent._config import config +from gevent._compat import PY3 +from gevent._util import copy_globals +import errno + +EAGAIN = getattr(errno, 'EAGAIN', 11) + +try: + import fcntl +except ImportError: + fcntl = None + +__implements__ = ['fork'] +__extensions__ = ['tp_read', 'tp_write'] + +_read = os.read +_write = os.write + + +ignored_errors = [EAGAIN, errno.EINTR] + + +if fcntl: + + __extensions__ += ['make_nonblocking', 'nb_read', 'nb_write'] + + def make_nonblocking(fd): + """Put the file descriptor *fd* into non-blocking mode if + possible. + + :return: A boolean value that evaluates to True if successful. + """ + flags = fcntl.fcntl(fd, fcntl.F_GETFL, 0) + if not bool(flags & os.O_NONBLOCK): + fcntl.fcntl(fd, fcntl.F_SETFL, flags | os.O_NONBLOCK) + return True + + def nb_read(fd, n): + """ + Read up to *n* bytes from file descriptor *fd*. Return a + byte string containing the bytes read, which may be shorter than + *n*. If end-of-file is reached, an empty string is returned. + + The descriptor must be in non-blocking mode. + """ + hub = None + event = None + try: + while 1: + try: + result = _read(fd, n) + return result + except OSError as e: + if e.errno not in ignored_errors: + raise + if not PY3: + sys.exc_clear() + if hub is None: + hub = get_hub() + event = hub.loop.io(fd, 1) + hub.wait(event) + finally: + if event is not None: + event.close() + event = None + hub = None + + + def nb_write(fd, buf): + """ + Write some number of bytes from buffer *buf* to file + descriptor *fd*. Return the number of bytes written, which may + be less than the length of *buf*. + + The file descriptor must be in non-blocking mode. + """ + hub = None + event = None + try: + while 1: + try: + result = _write(fd, buf) + return result + except OSError as e: + if e.errno not in ignored_errors: + raise + if not PY3: + sys.exc_clear() + if hub is None: + hub = get_hub() + event = hub.loop.io(fd, 2) + hub.wait(event) + finally: + if event is not None: + event.close() + event = None + hub = None + + +def tp_read(fd, n): + """Read up to *n* bytes from file descriptor *fd*. Return a string + containing the bytes read. If end-of-file is reached, an empty string + is returned. + + Reading is done using the threadpool. + """ + return get_hub().threadpool.apply(_read, (fd, n)) + + +def tp_write(fd, buf): + """Write bytes from buffer *buf* to file descriptor *fd*. Return the + number of bytes written. + + Writing is done using the threadpool. + """ + return get_hub().threadpool.apply(_write, (fd, buf)) + + +if hasattr(os, 'fork'): + # pylint:disable=function-redefined,redefined-outer-name + + _raw_fork = os.fork + + def fork_gevent(): + """ + Forks the process using :func:`os.fork` and prepares the + child process to continue using gevent before returning. + + .. note:: + + The PID returned by this function may not be waitable with + either the original :func:`os.waitpid` or this module's + :func:`waitpid` and it may not generate SIGCHLD signals if + libev child watchers are or ever have been in use. For + example, the :mod:`gevent.subprocess` module uses libev + child watchers (which parts of gevent use libev child + watchers is subject to change at any time). Most + applications should use :func:`fork_and_watch`, which is + monkey-patched as the default replacement for + :func:`os.fork` and implements the ``fork`` function of + this module by default, unless the environment variable + ``GEVENT_NOWAITPID`` is defined before this module is + imported. + + .. versionadded:: 1.1b2 + """ + result = _raw_fork() + if not result: + reinit() + return result + + def fork(): + """ + A wrapper for :func:`fork_gevent` for non-POSIX platforms. + """ + return fork_gevent() + + if hasattr(os, 'forkpty'): + _raw_forkpty = os.forkpty + + def forkpty_gevent(): + """ + Forks the process using :func:`os.forkpty` and prepares the + child process to continue using gevent before returning. + + Returns a tuple (pid, master_fd). The `master_fd` is *not* put into + non-blocking mode. + + Availability: Some Unix systems. + + .. seealso:: This function has the same limitations as :func:`fork_gevent`. + + .. versionadded:: 1.1b5 + """ + pid, master_fd = _raw_forkpty() + if not pid: + reinit() + return pid, master_fd + + forkpty = forkpty_gevent + + __implements__.append('forkpty') + __extensions__.append("forkpty_gevent") + + if hasattr(os, 'WNOWAIT') or hasattr(os, 'WNOHANG'): + # We can only do this on POSIX + import time + + _waitpid = os.waitpid + _WNOHANG = os.WNOHANG + + # replaced by the signal module. + _on_child_hook = lambda: None + + # {pid -> watcher or tuple(pid, rstatus, timestamp)} + _watched_children = {} + + def _on_child(watcher, callback): + # XXX: Could handle tracing here by not stopping + # until the pid is terminated + watcher.stop() + try: + _watched_children[watcher.pid] = (watcher.pid, watcher.rstatus, time.time()) + if callback: + callback(watcher) + # dispatch an "event"; used by gevent.signal.signal + _on_child_hook() + # now is as good a time as any to reap children + _reap_children() + finally: + watcher.close() + + def _reap_children(timeout=60): + # Remove all the dead children that haven't been waited on + # for the *timeout* seconds. + # Some platforms queue delivery of SIGCHLD for all children that die; + # in that case, a well-behaved application should call waitpid() for each + # signal. + # Some platforms (linux) only guarantee one delivery if multiple children + # die. On that platform, the well-behave application calls waitpid() in a loop + # until it gets back -1, indicating no more dead children need to be waited for. + # In either case, waitpid should be called the same number of times as dead children, + # thus removing all the watchers when a SIGCHLD arrives. The (generous) timeout + # is to work with applications that neglect to call waitpid and prevent "unlimited" + # growth. + # Note that we don't watch for the case of pid wraparound. That is, we fork a new + # child with the same pid as an existing watcher, but the child is already dead, + # just not waited on yet. + now = time.time() + oldest_allowed = now - timeout + dead = [pid for pid, val + in _watched_children.items() + if isinstance(val, tuple) and val[2] < oldest_allowed] + for pid in dead: + del _watched_children[pid] + + def waitpid(pid, options): + """ + Wait for a child process to finish. + + If the child process was spawned using + :func:`fork_and_watch`, then this function behaves + cooperatively. If not, it *may* have race conditions; see + :func:`fork_gevent` for more information. + + The arguments are as for the underlying + :func:`os.waitpid`. Some combinations of *options* may not + be supported cooperatively (as of 1.1 that includes + WUNTRACED). Using a *pid* of 0 to request waiting on only processes + from the current process group is not cooperative. + + Availability: POSIX. + + .. versionadded:: 1.1b1 + .. versionchanged:: 1.2a1 + More cases are handled in a cooperative manner. + """ + # pylint: disable=too-many-return-statements + # XXX Does not handle tracing children + + # So long as libev's loop doesn't run, it's OK to add + # child watchers. The SIGCHLD handler only feeds events + # for the next iteration of the loop to handle. (And the + # signal handler itself is only called from the next loop + # iteration.) + + if pid <= 0: + # magic functions for multiple children. + if pid == -1: + # Any child. If we have one that we're watching and that finished, + # we will use that one. Otherwise, let the OS take care of it. + for k, v in _watched_children.items(): + if isinstance(v, tuple): + pid = k + break + if pid <= 0: + # We didn't have one that was ready. If there are + # no funky options set, and the pid was -1 + # (meaning any process, not 0, which means process + # group--- libev doesn't know about process + # groups) then we can use a child watcher of pid 0; otherwise, + # pass through to the OS. + if pid == -1 and options == 0: + hub = get_hub() + with hub.loop.child(0, False) as watcher: + hub.wait(watcher) + return watcher.rpid, watcher.rstatus + # There were funky options/pid, so we must go to the OS. + return _waitpid(pid, options) + + if pid in _watched_children: + # yes, we're watching it + + # Note that the remainder of this code must be careful to NOT + # yield to the event loop except at well known times, or + # we have a race condition between the _on_child callback and the + # code here that could lead to a process to hang. + if options & _WNOHANG or isinstance(_watched_children[pid], tuple): + # We're either asked not to block, or it already finished, in which + # case blocking doesn't matter + result = _watched_children[pid] + if isinstance(result, tuple): + # it finished. libev child watchers + # are one-shot + del _watched_children[pid] + return result[:2] + # it's not finished + return (0, 0) + + # Ok, we need to "block". Do so via a watcher so that we're + # cooperative. We know it's our child, etc, so this should work. + watcher = _watched_children[pid] + # We can't start a watcher that's already started, + # so we can't reuse the existing watcher. Notice that the + # old watcher must not have fired already, or during this time, but + # only after we successfully `start()` the watcher. So this must + # not yield to the event loop. + with watcher.loop.child(pid, False) as new_watcher: + get_hub().wait(new_watcher) + # Ok, so now the new watcher is done. That means + # the old watcher's callback (_on_child) should + # have fired, potentially taking this child out of + # _watched_children (but that could depend on how + # many callbacks there were to run, so use the + # watcher object directly; libev sets all the + # watchers at the same time). + return watcher.rpid, watcher.rstatus + + # we're not watching it and it may not even be our child, + # so we must go to the OS to be sure to get the right semantics (exception) + # XXX + # libuv has a race condition because the signal + # handler is a Python function, so the InterruptedError + # is raised before the signal handler runs and calls the + # child watcher + # we're not watching it + return _waitpid(pid, options) + + def fork_and_watch(callback=None, loop=None, ref=False, fork=fork_gevent): + """ + Fork a child process and start a child watcher for it in the parent process. + + This call cooperates with :func:`waitpid` to enable cooperatively waiting + for children to finish. When monkey-patching, these functions are patched in as + :func:`os.fork` and :func:`os.waitpid`, respectively. + + In the child process, this function calls :func:`gevent.hub.reinit` before returning. + + Availability: POSIX. + + :keyword callback: If given, a callable that will be called with the child watcher + when the child finishes. + :keyword loop: The loop to start the watcher in. Defaults to the + loop of the current hub. + :keyword fork: The fork function. Defaults to :func:`the one defined in this + module ` (which automatically calls :func:`gevent.hub.reinit`). + Pass the builtin :func:`os.fork` function if you do not need to + initialize gevent in the child process. + + .. versionadded:: 1.1b1 + .. seealso:: + :func:`gevent.monkey.get_original` To access the builtin :func:`os.fork`. + """ + pid = fork() + if pid: + # parent + loop = loop or get_hub().loop + watcher = loop.child(pid, ref=ref) + _watched_children[pid] = watcher + watcher.start(_on_child, watcher, callback) + return pid + + __extensions__.append('fork_and_watch') + __extensions__.append('fork_gevent') + + if 'forkpty' in __implements__: + def forkpty_and_watch(callback=None, loop=None, ref=False, forkpty=forkpty_gevent): + """ + Like :func:`fork_and_watch`, except using :func:`forkpty_gevent`. + + Availability: Some Unix systems. + + .. versionadded:: 1.1b5 + """ + result = [] + + def _fork(): + pid_and_fd = forkpty() + result.append(pid_and_fd) + return pid_and_fd[0] + fork_and_watch(callback, loop, ref, _fork) + return result[0] + + __extensions__.append('forkpty_and_watch') + + # Watch children by default + if not config.disable_watch_children: + # Broken out into separate functions instead of simple name aliases + # for documentation purposes. + def fork(*args, **kwargs): + """ + Forks a child process and starts a child watcher for it in the + parent process so that ``waitpid`` and SIGCHLD work as expected. + + This implementation of ``fork`` is a wrapper for :func:`fork_and_watch` + when the environment variable ``GEVENT_NOWAITPID`` is *not* defined. + This is the default and should be used by most applications. + + .. versionchanged:: 1.1b2 + """ + # take any args to match fork_and_watch + return fork_and_watch(*args, **kwargs) + + if 'forkpty' in __implements__: + def forkpty(*args, **kwargs): + """ + Like :func:`fork`, but using :func:`forkpty_gevent`. + + This implementation of ``forkpty`` is a wrapper for :func:`forkpty_and_watch` + when the environment variable ``GEVENT_NOWAITPID`` is *not* defined. + This is the default and should be used by most applications. + + .. versionadded:: 1.1b5 + """ + # take any args to match fork_and_watch + return forkpty_and_watch(*args, **kwargs) + __implements__.append("waitpid") + else: + def fork(): + """ + Forks a child process, initializes gevent in the child, + but *does not* prepare the parent to wait for the child or receive SIGCHLD. + + This implementation of ``fork`` is a wrapper for :func:`fork_gevent` + when the environment variable ``GEVENT_NOWAITPID`` *is* defined. + This is not recommended for most applications. + """ + return fork_gevent() + + if 'forkpty' in __implements__: + def forkpty(): + """ + Like :func:`fork`, but using :func:`os.forkpty` + + This implementation of ``forkpty`` is a wrapper for :func:`forkpty_gevent` + when the environment variable ``GEVENT_NOWAITPID`` *is* defined. + This is not recommended for most applications. + + .. versionadded:: 1.1b5 + """ + return forkpty_gevent() + __extensions__.append("waitpid") + +else: + __implements__.remove('fork') + +__imports__ = copy_globals(os, globals(), + names_to_ignore=__implements__ + __extensions__, + dunder_names_to_keep=()) + +__all__ = list(set(__implements__ + __extensions__)) diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/pool.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/pool.py new file mode 100644 index 00000000..bed3ff40 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/pool.py @@ -0,0 +1,675 @@ +# Copyright (c) 2009-2011 Denis Bilenko. See LICENSE for details. +""" +Managing greenlets in a group. + +The :class:`Group` class in this module abstracts a group of running +greenlets. When a greenlet dies, it's automatically removed from the +group. All running greenlets in a group can be waited on with +:meth:`Group.join`, or all running greenlets can be killed with +:meth:`Group.kill`. + +The :class:`Pool` class, which is a subclass of :class:`Group`, +provides a way to limit concurrency: its :meth:`spawn ` +method blocks if the number of greenlets in the pool has already +reached the limit, until there is a free slot. +""" +from __future__ import print_function, absolute_import, division + + +from gevent.hub import GreenletExit, getcurrent, kill as _kill +from gevent.greenlet import joinall, Greenlet +from gevent.queue import Full as QueueFull +from gevent.timeout import Timeout +from gevent.event import Event +from gevent.lock import Semaphore, DummySemaphore + +from gevent._compat import izip +from gevent._imap import IMap +from gevent._imap import IMapUnordered + +__all__ = [ + 'Group', + 'Pool', + 'PoolFull', +] + + + + +class GroupMappingMixin(object): + # Internal, non-public API class. + # Provides mixin methods for implementing mapping pools. Subclasses must define: + + def spawn(self, func, *args, **kwargs): + """ + A function that runs *func* with *args* and *kwargs*, potentially + asynchronously. Return a value with a ``get`` method that blocks + until the results of func are available, and a ``rawlink`` method + that calls a callback when the results are available. + + If this object has an upper bound on how many asyncronously executing + tasks can exist, this method may block until a slot becomes available. + """ + raise NotImplementedError() + + def _apply_immediately(self): + """ + should the function passed to apply be called immediately, + synchronously? + """ + raise NotImplementedError() + + def _apply_async_use_greenlet(self): + """ + Should apply_async directly call Greenlet.spawn(), bypassing + `spawn`? + + Return true when self.spawn would block. + """ + raise NotImplementedError() + + def _apply_async_cb_spawn(self, callback, result): + """ + Run the given callback function, possibly + asynchronously, possibly synchronously. + """ + raise NotImplementedError() + + def apply_cb(self, func, args=None, kwds=None, callback=None): + """ + :meth:`apply` the given *func(\\*args, \\*\\*kwds)*, and, if a *callback* is given, run it with the + results of *func* (unless an exception was raised.) + + The *callback* may be called synchronously or asynchronously. If called + asynchronously, it will not be tracked by this group. (:class:`Group` and :class:`Pool` + call it asynchronously in a new greenlet; :class:`~gevent.threadpool.ThreadPool` calls + it synchronously in the current greenlet.) + """ + result = self.apply(func, args, kwds) + if callback is not None: + self._apply_async_cb_spawn(callback, result) + return result + + def apply_async(self, func, args=None, kwds=None, callback=None): + """ + A variant of the :meth:`apply` method which returns a :class:`~.Greenlet` object. + + When the returned greenlet gets to run, it *will* call :meth:`apply`, + passing in *func*, *args* and *kwds*. + + If *callback* is specified, then it should be a callable which + accepts a single argument. When the result becomes ready + callback is applied to it (unless the call failed). + + This method will never block, even if this group is full (that is, + even if :meth:`spawn` would block, this method will not). + + .. caution:: The returned greenlet may or may not be tracked + as part of this group, so :meth:`joining ` this group is + not a reliable way to wait for the results to be available or + for the returned greenlet to run; instead, join the returned + greenlet. + + .. tip:: Because :class:`~.ThreadPool` objects do not track greenlets, the returned + greenlet will never be a part of it. To reduce overhead and improve performance, + :class:`Group` and :class:`Pool` may choose to track the returned + greenlet. These are implementation details that may change. + """ + if args is None: + args = () + if kwds is None: + kwds = {} + if self._apply_async_use_greenlet(): + # cannot call self.spawn() directly because it will block + # XXX: This is always the case for ThreadPool, but for Group/Pool + # of greenlets, this is only the case when they are full...hence + # the weasely language about "may or may not be tracked". Should we make + # Group/Pool always return true as well so it's never tracked by any + # implementation? That would simplify that logic, but could increase + # the total number of greenlets in the system and add a layer of + # overhead for the simple cases when the pool isn't full. + return Greenlet.spawn(self.apply_cb, func, args, kwds, callback) + + greenlet = self.spawn(func, *args, **kwds) + if callback is not None: + greenlet.link(pass_value(callback)) + return greenlet + + def apply(self, func, args=None, kwds=None): + """ + Rough quivalent of the :func:`apply()` builtin function blocking until + the result is ready and returning it. + + The ``func`` will *usually*, but not *always*, be run in a way + that allows the current greenlet to switch out (for example, + in a new greenlet or thread, depending on implementation). But + if the current greenlet or thread is already one that was + spawned by this pool, the pool may choose to immediately run + the `func` synchronously. + + Any exception ``func`` raises will be propagated to the caller of ``apply`` (that is, + this method will raise the exception that ``func`` raised). + """ + if args is None: + args = () + if kwds is None: + kwds = {} + if self._apply_immediately(): + return func(*args, **kwds) + return self.spawn(func, *args, **kwds).get() + + def __map(self, func, iterable): + return [g.get() for g in + [self.spawn(func, i) for i in iterable]] + + def map(self, func, iterable): + """Return a list made by applying the *func* to each element of + the iterable. + + .. seealso:: :meth:`imap` + """ + # We can't return until they're all done and in order. It + # wouldn't seem to much matter what order we wait on them in, + # so the simple, fast (50% faster than imap) solution would be: + + # return [g.get() for g in + # [self.spawn(func, i) for i in iterable]] + + # If the pool size is unlimited (or more than the len(iterable)), this + # is equivalent to imap (spawn() will never block, all of them run concurrently, + # we call get() in the order the iterable was given). + + # Now lets imagine the pool if is limited size. Suppose the + # func is time.sleep, our pool is limited to 3 threads, and + # our input is [10, 1, 10, 1, 1] We would start three threads, + # one to sleep for 10, one to sleep for 1, and the last to + # sleep for 10. We would block starting the fourth thread. At + # time 1, we would finish the second thread and start another + # one for time 1. At time 2, we would finish that one and + # start the last thread, and then begin executing get() on the first + # thread. + + # Because it's spawn that blocks, this is *also* equivalent to what + # imap would do. + + # The one remaining difference is that imap runs in its own + # greenlet, potentially changing the way the event loop runs. + # That's easy enough to do. + + g = Greenlet.spawn(self.__map, func, iterable) + return g.get() + + def map_cb(self, func, iterable, callback=None): + result = self.map(func, iterable) + if callback is not None: + callback(result) + return result + + def map_async(self, func, iterable, callback=None): + """ + A variant of the map() method which returns a Greenlet object that is executing + the map function. + + If callback is specified then it should be a callable which accepts a + single argument. + """ + return Greenlet.spawn(self.map_cb, func, iterable, callback) + + def __imap(self, cls, func, *iterables, **kwargs): + # Python 2 doesn't support the syntax that lets us mix varargs and + # a named kwarg, so we have to unpack manually + maxsize = kwargs.pop('maxsize', None) + if kwargs: + raise TypeError("Unsupported keyword arguments") + return cls.spawn(func, izip(*iterables), spawn=self.spawn, + _zipped=True, maxsize=maxsize) + + def imap(self, func, *iterables, **kwargs): + """ + imap(func, *iterables, maxsize=None) -> iterable + + An equivalent of :func:`itertools.imap`, operating in parallel. + The *func* is applied to each element yielded from each + iterable in *iterables* in turn, collecting the result. + + If this object has a bound on the number of active greenlets it can + contain (such as :class:`Pool`), then at most that number of tasks will operate + in parallel. + + :keyword int maxsize: If given and not-None, specifies the maximum number of + finished results that will be allowed to accumulate awaiting the reader; + more than that number of results will cause map function greenlets to begin + to block. This is most useful if there is a great disparity in the speed of + the mapping code and the consumer and the results consume a great deal of resources. + + .. note:: This is separate from any bound on the number of active parallel + tasks, though they may have some interaction (for example, limiting the + number of parallel tasks to the smallest bound). + + .. note:: Using a bound is slightly more computationally expensive than not using a bound. + + .. tip:: The :meth:`imap_unordered` method makes much better + use of this parameter. Some additional, unspecified, + number of objects may be required to be kept in memory + to maintain order by this function. + + :return: An iterable object. + + .. versionchanged:: 1.1b3 + Added the *maxsize* keyword parameter. + .. versionchanged:: 1.1a1 + Accept multiple *iterables* to iterate in parallel. + """ + return self.__imap(IMap, func, *iterables, **kwargs) + + def imap_unordered(self, func, *iterables, **kwargs): + """ + imap_unordered(func, *iterables, maxsize=None) -> iterable + + The same as :meth:`imap` except that the ordering of the results + from the returned iterator should be considered in arbitrary + order. + + This is lighter weight than :meth:`imap` and should be preferred if order + doesn't matter. + + .. seealso:: :meth:`imap` for more details. + """ + return self.__imap(IMapUnordered, func, *iterables, **kwargs) + + +class Group(GroupMappingMixin): + """ + Maintain a group of greenlets that are still running, without + limiting their number. + + Links to each item and removes it upon notification. + + Groups can be iterated to discover what greenlets they are tracking, + they can be tested to see if they contain a greenlet, and they know the + number (len) of greenlets they are tracking. If they are not tracking any + greenlets, they are False in a boolean context. + + .. attribute:: greenlet_class + + Either :class:`gevent.Greenlet` (the default) or a subclass. + These are the type of + object we will :meth:`spawn`. This can be + changed on an instance or in a subclass. + """ + + greenlet_class = Greenlet + + def __init__(self, *args): + assert len(args) <= 1, args + self.greenlets = set(*args) + if args: + for greenlet in args[0]: + greenlet.rawlink(self._discard) + # each item we kill we place in dying, to avoid killing the same greenlet twice + self.dying = set() + self._empty_event = Event() + self._empty_event.set() + + def __repr__(self): + return '<%s at 0x%x %s>' % (self.__class__.__name__, id(self), self.greenlets) + + def __len__(self): + """ + Answer how many greenlets we are tracking. Note that if we are empty, + we are False in a boolean context. + """ + return len(self.greenlets) + + def __contains__(self, item): + """ + Answer if we are tracking the given greenlet. + """ + return item in self.greenlets + + def __iter__(self): + """ + Iterate across all the greenlets we are tracking, in no particular order. + """ + return iter(self.greenlets) + + def add(self, greenlet): + """ + Begin tracking the *greenlet*. + + If this group is :meth:`full`, then this method may block + until it is possible to track the greenlet. + + Typically the *greenlet* should **not** be started when + it is added because if this object blocks in this method, + then the *greenlet* may run to completion before it is tracked. + """ + try: + rawlink = greenlet.rawlink + except AttributeError: + pass # non-Greenlet greenlet, like MAIN + else: + rawlink(self._discard) + self.greenlets.add(greenlet) + self._empty_event.clear() + + def _discard(self, greenlet): + self.greenlets.discard(greenlet) + self.dying.discard(greenlet) + if not self.greenlets: + self._empty_event.set() + + def discard(self, greenlet): + """ + Stop tracking the greenlet. + """ + self._discard(greenlet) + try: + unlink = greenlet.unlink + except AttributeError: + pass # non-Greenlet greenlet, like MAIN + else: + unlink(self._discard) + + def start(self, greenlet): + """ + Add the **unstarted** *greenlet* to the collection of greenlets + this group is monitoring, and then start it. + """ + self.add(greenlet) + greenlet.start() + + def spawn(self, *args, **kwargs): # pylint:disable=arguments-differ + """ + Begin a new greenlet with the given arguments (which are passed + to the greenlet constructor) and add it to the collection of greenlets + this group is monitoring. + + :return: The newly started greenlet. + """ + greenlet = self.greenlet_class(*args, **kwargs) + self.start(greenlet) + return greenlet + +# def close(self): +# """Prevents any more tasks from being submitted to the pool""" +# self.add = RaiseException("This %s has been closed" % self.__class__.__name__) + + def join(self, timeout=None, raise_error=False): + """ + Wait for this group to become empty *at least once*. + + If there are no greenlets in the group, returns immediately. + + .. note:: By the time the waiting code (the caller of this + method) regains control, a greenlet may have been added to + this group, and so this object may no longer be empty. (That + is, ``group.join(); assert len(group) == 0`` is not + guaranteed to hold.) This method only guarantees that the group + reached a ``len`` of 0 at some point. + + :keyword bool raise_error: If True (*not* the default), if any + greenlet that finished while the join was in progress raised + an exception, that exception will be raised to the caller of + this method. If multiple greenlets raised exceptions, which + one gets re-raised is not determined. Only greenlets currently + in the group when this method is called are guaranteed to + be checked for exceptions. + + :return bool: A value indicating whether this group became empty. + If the timeout is specified and the group did not become empty + during that timeout, then this will be a false value. Otherwise + it will be a true value. + + .. versionchanged:: 1.2a1 + Add the return value. + """ + greenlets = list(self.greenlets) if raise_error else () + result = self._empty_event.wait(timeout=timeout) + + for greenlet in greenlets: + if greenlet.exception is not None: + if hasattr(greenlet, '_raise_exception'): + greenlet._raise_exception() + raise greenlet.exception + + return result + + def kill(self, exception=GreenletExit, block=True, timeout=None): + """ + Kill all greenlets being tracked by this group. + """ + timer = Timeout._start_new_or_dummy(timeout) + try: + while self.greenlets: + for greenlet in list(self.greenlets): + if greenlet in self.dying: + continue + try: + kill = greenlet.kill + except AttributeError: + _kill(greenlet, exception) + else: + kill(exception, block=False) + self.dying.add(greenlet) + if not block: + break + joinall(self.greenlets) + except Timeout as ex: + if ex is not timer: + raise + finally: + timer.cancel() + + def killone(self, greenlet, exception=GreenletExit, block=True, timeout=None): + """ + If the given *greenlet* is running and being tracked by this group, + kill it. + """ + if greenlet not in self.dying and greenlet in self.greenlets: + greenlet.kill(exception, block=False) + self.dying.add(greenlet) + if block: + greenlet.join(timeout) + + def full(self): + """ + Return a value indicating whether this group can track more greenlets. + + In this implementation, because there are no limits on the number of + tracked greenlets, this will always return a ``False`` value. + """ + return False + + def wait_available(self, timeout=None): + """ + Block until it is possible to :meth:`spawn` a new greenlet. + + In this implementation, because there are no limits on the number + of tracked greenlets, this will always return immediately. + """ + + # MappingMixin methods + + def _apply_immediately(self): + # If apply() is called from one of our own + # worker greenlets, don't spawn a new one---if we're full, that + # could deadlock. + return getcurrent() in self + + def _apply_async_cb_spawn(self, callback, result): + Greenlet.spawn(callback, result) + + def _apply_async_use_greenlet(self): + # cannot call self.spawn() because it will block, so + # use a fresh, untracked greenlet that when run will + # (indirectly) call self.spawn() for us. + return self.full() + + + +class PoolFull(QueueFull): + """ + Raised when a Pool is full and an attempt was made to + add a new greenlet to it in non-blocking mode. + """ + + +class Pool(Group): + + def __init__(self, size=None, greenlet_class=None): + """ + Create a new pool. + + A pool is like a group, but the maximum number of members + is governed by the *size* parameter. + + :keyword int size: If given, this non-negative integer is the + maximum count of active greenlets that will be allowed in + this pool. A few values have special significance: + + * `None` (the default) places no limit on the number of + greenlets. This is useful when you want to track, but not limit, + greenlets. In general, a :class:`Group` + may be a more efficient way to achieve the same effect, but some things + need the additional abilities of this class (one example being the *spawn* + parameter of :class:`gevent.baseserver.BaseServer` and + its subclass :class:`gevent.pywsgi.WSGIServer`). + + * ``0`` creates a pool that can never have any active greenlets. Attempting + to spawn in this pool will block forever. This is only useful + if an application uses :meth:`wait_available` with a timeout and checks + :meth:`free_count` before attempting to spawn. + """ + if size is not None and size < 0: + raise ValueError('size must not be negative: %r' % (size, )) + Group.__init__(self) + self.size = size + if greenlet_class is not None: + self.greenlet_class = greenlet_class + if size is None: + factory = DummySemaphore + else: + factory = Semaphore + self._semaphore = factory(size) + + def wait_available(self, timeout=None): + """ + Wait until it's possible to spawn a greenlet in this pool. + + :param float timeout: If given, only wait the specified number + of seconds. + + .. warning:: If the pool was initialized with a size of 0, this + method will block forever unless a timeout is given. + + :return: A number indicating how many new greenlets can be put into + the pool without blocking. + + .. versionchanged:: 1.1a3 + Added the ``timeout`` parameter. + """ + return self._semaphore.wait(timeout=timeout) + + def full(self): + """ + Return a boolean indicating whether this pool is full, e.g. if + :meth:`add` would block. + + :return: False if there is room for new members, True if there isn't. + """ + return self.free_count() <= 0 + + def free_count(self): + """ + Return a number indicating *approximately* how many more members + can be added to this pool. + """ + if self.size is None: + return 1 + return max(0, self.size - len(self)) + + def start(self, greenlet, *args, **kwargs): # pylint:disable=arguments-differ + """ + start(greenlet, blocking=True, timeout=None) -> None + + Add the **unstarted** *greenlet* to the collection of greenlets + this group is monitoring and then start it. + + Parameters are as for :meth:`add`. + """ + self.add(greenlet, *args, **kwargs) + greenlet.start() + + def add(self, greenlet, blocking=True, timeout=None): # pylint:disable=arguments-differ + """ + Begin tracking the given **unstarted** greenlet, possibly blocking + until space is available. + + Usually you should call :meth:`start` to track and start the greenlet + instead of using this lower-level method, or :meth:`spawn` to + also create the greenlet. + + :keyword bool blocking: If True (the default), this function + will block until the pool has space or a timeout occurs. If + False, this function will immediately raise a Timeout if the + pool is currently full. + :keyword float timeout: The maximum number of seconds this + method will block, if ``blocking`` is True. (Ignored if + ``blocking`` is False.) + :raises PoolFull: if either ``blocking`` is False and the pool + was full, or if ``blocking`` is True and ``timeout`` was + exceeded. + + .. caution:: If the *greenlet* has already been started and + *blocking* is true, then the greenlet may run to completion + while the current greenlet blocks waiting to track it. This would + enable higher concurrency than desired. + + .. seealso:: :meth:`Group.add` + + .. versionchanged:: 1.3.0 Added the ``blocking`` and + ``timeout`` parameters. + """ + if not self._semaphore.acquire(blocking=blocking, timeout=timeout): + # We failed to acquire the semaphore. + # If blocking was True, then there was a timeout. If blocking was + # False, then there was no capacity. Either way, raise PoolFull. + raise PoolFull() + + try: + Group.add(self, greenlet) + except: + self._semaphore.release() + raise + + def _discard(self, greenlet): + Group._discard(self, greenlet) + self._semaphore.release() + + +class pass_value(object): + __slots__ = ['callback'] + + def __init__(self, callback): + self.callback = callback + + def __call__(self, source): + if source.successful(): + self.callback(source.value) + + def __hash__(self): + return hash(self.callback) + + def __eq__(self, other): + return self.callback == getattr(other, 'callback', other) + + def __str__(self): + return str(self.callback) + + def __repr__(self): + return repr(self.callback) + + def __getattr__(self, item): + assert item != 'callback' + return getattr(self.callback, item) diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/pywsgi.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/pywsgi.py new file mode 100644 index 00000000..5276eb5b --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/pywsgi.py @@ -0,0 +1,1549 @@ +# Copyright (c) 2005-2009, eventlet contributors +# Copyright (c) 2009-2018, gevent contributors +""" +A pure-Python, gevent-friendly WSGI server. + +The server is provided in :class:`WSGIServer`, but most of the actual +WSGI work is handled by :class:`WSGIHandler` --- a new instance is +created for each request. The server can be customized to use +different subclasses of :class:`WSGIHandler`. + +""" +from __future__ import absolute_import + +# FIXME: Can we refactor to make smallor? +# pylint:disable=too-many-lines + +import errno +from io import BytesIO +import string +import sys +import time +import traceback +from datetime import datetime + +try: + from urllib import unquote +except ImportError: + from urllib.parse import unquote # python 2 pylint:disable=import-error,no-name-in-module + +from gevent import socket +import gevent +from gevent.server import StreamServer +from gevent.hub import GreenletExit +from gevent._compat import PY3, reraise + +from functools import partial +if PY3: + unquote_latin1 = partial(unquote, encoding='latin-1') +else: + unquote_latin1 = unquote + +_no_undoc_members = True # Don't put undocumented things into sphinx + +__all__ = [ + 'WSGIServer', + 'WSGIHandler', + 'LoggingLogAdapter', + 'Environ', + 'SecureEnviron', + 'WSGISecureEnviron', +] + + +MAX_REQUEST_LINE = 8192 +# Weekday and month names for HTTP date/time formatting; always English! +_WEEKDAYNAME = ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"] +_MONTHNAME = [None, # Dummy so we can use 1-based month numbers + "Jan", "Feb", "Mar", "Apr", "May", "Jun", + "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"] + +# The contents of the "HEX" grammar rule for HTTP, upper and lowercase A-F plus digits, +# in byte form for comparing to the network. +_HEX = string.hexdigits.encode('ascii') + +# Errors +_ERRORS = dict() +_INTERNAL_ERROR_STATUS = '500 Internal Server Error' +_INTERNAL_ERROR_BODY = b'Internal Server Error' +_INTERNAL_ERROR_HEADERS = [('Content-Type', 'text/plain'), + ('Connection', 'close'), + ('Content-Length', str(len(_INTERNAL_ERROR_BODY)))] +_ERRORS[500] = (_INTERNAL_ERROR_STATUS, _INTERNAL_ERROR_HEADERS, _INTERNAL_ERROR_BODY) + +_BAD_REQUEST_STATUS = '400 Bad Request' +_BAD_REQUEST_BODY = '' +_BAD_REQUEST_HEADERS = [('Content-Type', 'text/plain'), + ('Connection', 'close'), + ('Content-Length', str(len(_BAD_REQUEST_BODY)))] +_ERRORS[400] = (_BAD_REQUEST_STATUS, _BAD_REQUEST_HEADERS, _BAD_REQUEST_BODY) + +_REQUEST_TOO_LONG_RESPONSE = b"HTTP/1.1 414 Request URI Too Long\r\nConnection: close\r\nContent-length: 0\r\n\r\n" +_BAD_REQUEST_RESPONSE = b"HTTP/1.1 400 Bad Request\r\nConnection: close\r\nContent-length: 0\r\n\r\n" +_CONTINUE_RESPONSE = b"HTTP/1.1 100 Continue\r\n\r\n" + + +def format_date_time(timestamp): + # Return a byte-string of the date and time in HTTP format + # .. versionchanged:: 1.1b5 + # Return a byte string, not a native string + year, month, day, hh, mm, ss, wd, _y, _z = time.gmtime(timestamp) + value = "%s, %02d %3s %4d %02d:%02d:%02d GMT" % (_WEEKDAYNAME[wd], day, _MONTHNAME[month], year, hh, mm, ss) + if PY3: + value = value.encode("latin-1") + return value + + +class _InvalidClientInput(IOError): + # Internal exception raised by Input indicating that the client + # sent invalid data at the lowest level of the stream. The result + # *should* be a HTTP 400 error. + pass + + +class _InvalidClientRequest(ValueError): + # Internal exception raised by WSGIHandler.read_request + # indicating that the client sent an HTTP request that cannot + # be parsed (e.g., invalid grammar). The result *should* be an + # HTTP 400 error + pass + + +class Input(object): + + __slots__ = ('rfile', 'content_length', 'socket', 'position', + 'chunked_input', 'chunk_length', '_chunked_input_error') + + def __init__(self, rfile, content_length, socket=None, chunked_input=False): + # pylint:disable=redefined-outer-name + self.rfile = rfile + self.content_length = content_length + self.socket = socket + self.position = 0 + self.chunked_input = chunked_input + self.chunk_length = -1 + self._chunked_input_error = False + + def _discard(self): + if self._chunked_input_error: + # We are in an unknown state, so we can't necessarily discard + # the body (e.g., if the client keeps the socket open, we could hang + # here forever). + # In this case, we've raised an exception and the user of this object + # is going to close the socket, so we don't have to discard + return + + if self.socket is None and (self.position < (self.content_length or 0) or self.chunked_input): + # ## Read and discard body + while 1: + d = self.read(16384) + if not d: + break + + def _send_100_continue(self): + if self.socket is not None: + self.socket.sendall(_CONTINUE_RESPONSE) + self.socket = None + + def _do_read(self, length=None, use_readline=False): + if use_readline: + reader = self.rfile.readline + else: + reader = self.rfile.read + content_length = self.content_length + if content_length is None: + # Either Content-Length or "Transfer-Encoding: chunked" must be present in a request with a body + # if it was chunked, then this function would have not been called + return b'' + + self._send_100_continue() + left = content_length - self.position + if length is None: + length = left + elif length > left: + length = left + if not length: + return b'' + + # On Python 2, self.rfile is usually socket.makefile(), which + # uses cStringIO.StringIO. If *length* is greater than the C + # sizeof(int) (typically 32 bits signed), parsing the argument to + # readline raises OverflowError. StringIO.read(), OTOH, uses + # PySize_t, typically a long (64 bits). In a bare readline() + # case, because the header lines we're trying to read with + # readline are typically expected to be small, we can correct + # that failure by simply doing a smaller call to readline and + # appending; failures in read we let propagate. + try: + read = reader(length) + except OverflowError: + if not use_readline: + # Expecting to read more than 64 bits of data. Ouch! + raise + # We could loop on calls to smaller readline(), appending them + # until we actually get a newline. For uses in this module, + # we expect the actual length to be small, but WSGI applications + # are allowed to pass in an arbitrary length. (This loop isn't optimal, + # but even client applications *probably* have short lines.) + read = b'' + while len(read) < length and not read.endswith(b'\n'): + read += reader(MAX_REQUEST_LINE) + + self.position += len(read) + if len(read) < length: + if (use_readline and not read.endswith(b"\n")) or not use_readline: + raise IOError("unexpected end of file while reading request at position %s" % (self.position,)) + + return read + + def __read_chunk_length(self, rfile): + # Read and return the next integer chunk length. If no + # chunk length can be read, raises _InvalidClientInput. + + # Here's the production for a chunk: + # (http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html) + # chunk = chunk-size [ chunk-extension ] CRLF + # chunk-data CRLF + # chunk-size = 1*HEX + # chunk-extension= *( ";" chunk-ext-name [ "=" chunk-ext-val ] ) + # chunk-ext-name = token + # chunk-ext-val = token | quoted-string + + # To cope with malicious or broken clients that fail to send valid + # chunk lines, the strategy is to read character by character until we either reach + # a ; or newline. If at any time we read a non-HEX digit, we bail. If we hit a + # ;, indicating an chunk-extension, we'll read up to the next + # MAX_REQUEST_LINE characters + # looking for the CRLF, and if we don't find it, we bail. If we read more than 16 hex characters, + # (the number needed to represent a 64-bit chunk size), we bail (this protects us from + # a client that sends an infinite stream of `F`, for example). + + buf = BytesIO() + while 1: + char = rfile.read(1) + if not char: + self._chunked_input_error = True + raise _InvalidClientInput("EOF before chunk end reached") + if char == b'\r': + break + if char == b';': + break + + if char not in _HEX: + self._chunked_input_error = True + raise _InvalidClientInput("Non-hex data", char) + buf.write(char) + if buf.tell() > 16: + self._chunked_input_error = True + raise _InvalidClientInput("Chunk-size too large.") + + if char == b';': + i = 0 + while i < MAX_REQUEST_LINE: + char = rfile.read(1) + if char == b'\r': + break + i += 1 + else: + # we read more than MAX_REQUEST_LINE without + # hitting CR + self._chunked_input_error = True + raise _InvalidClientInput("Too large chunk extension") + + if char == b'\r': + # We either got here from the main loop or from the + # end of an extension + char = rfile.read(1) + if char != b'\n': + self._chunked_input_error = True + raise _InvalidClientInput("Line didn't end in CRLF") + return int(buf.getvalue(), 16) + + def _chunked_read(self, length=None, use_readline=False): + # pylint:disable=too-many-branches + rfile = self.rfile + self._send_100_continue() + + if length == 0: + return b"" + + if use_readline: + reader = self.rfile.readline + else: + reader = self.rfile.read + + response = [] + while self.chunk_length != 0: + maxreadlen = self.chunk_length - self.position + if length is not None and length < maxreadlen: + maxreadlen = length + + if maxreadlen > 0: + data = reader(maxreadlen) + if not data: + self.chunk_length = 0 + self._chunked_input_error = True + raise IOError("unexpected end of file while parsing chunked data") + + datalen = len(data) + response.append(data) + + self.position += datalen + if self.chunk_length == self.position: + rfile.readline() + + if length is not None: + length -= datalen + if length == 0: + break + if use_readline and data[-1] == b"\n"[0]: + break + else: + # We're at the beginning of a chunk, so we need to + # determine the next size to read + self.chunk_length = self.__read_chunk_length(rfile) + self.position = 0 + if self.chunk_length == 0: + # Last chunk. Terminates with a CRLF. + rfile.readline() + return b''.join(response) + + def read(self, length=None): + if length is not None and length < 0: + length = None + if self.chunked_input: + return self._chunked_read(length) + return self._do_read(length) + + def readline(self, size=None): + if size is not None and size < 0: + size = None + if self.chunked_input: + return self._chunked_read(size, True) + return self._do_read(size, use_readline=True) + + def readlines(self, hint=None): + # pylint:disable=unused-argument + return list(self) + + def __iter__(self): + return self + + def next(self): + line = self.readline() + if not line: + raise StopIteration + return line + __next__ = next + + +try: + import mimetools + headers_factory = mimetools.Message +except ImportError: + # adapt Python 3 HTTP headers to old API + from http import client # pylint:disable=import-error + + class OldMessage(client.HTTPMessage): + def __init__(self, **kwargs): + super(client.HTTPMessage, self).__init__(**kwargs) # pylint:disable=bad-super-call + self.status = '' + + def getheader(self, name, default=None): + return self.get(name, default) + + @property + def headers(self): + for key, value in self._headers: + yield '%s: %s\r\n' % (key, value) + + @property + def typeheader(self): + return self.get('content-type') + + def headers_factory(fp, *args): # pylint:disable=unused-argument + try: + ret = client.parse_headers(fp, _class=OldMessage) + except client.LineTooLong: + ret = OldMessage() + ret.status = 'Line too long' + return ret + + +class WSGIHandler(object): + """ + Handles HTTP requests from a socket, creates the WSGI environment, and + interacts with the WSGI application. + + This is the default value of :attr:`WSGIServer.handler_class`. + This class may be subclassed carefully, and that class set on a + :class:`WSGIServer` instance through a keyword argument at + construction time. + + Instances are constructed with the same arguments as passed to the + server's :meth:`WSGIServer.handle` method followed by the server + itself. The application and environment are obtained from the server. + + """ + # pylint:disable=too-many-instance-attributes + + protocol_version = 'HTTP/1.1' + if PY3: + # if we do like Py2, then headers_factory unconditionally + # becomes a bound method, meaning the fp argument becomes WSGIHandler + def MessageClass(self, *args): + return headers_factory(*args) + else: + MessageClass = headers_factory + + # Attributes reset at various times for each request; not public + # documented. Class attributes to keep the constructor fast + # (but not make lint tools complain) + + status = None # byte string: b'200 OK' + _orig_status = None # native string: '200 OK' + response_headers = None # list of tuples (b'name', b'value') + code = None # Integer parsed from status + provided_date = None + provided_content_length = None + close_connection = False + time_start = 0 # time.time() when begin handling request + time_finish = 0 # time.time() when done handling request + headers_sent = False # Have we already sent headers? + response_use_chunked = False # Write with transfer-encoding chunked + environ = None # Dict from self.get_environ + application = None # application callable from self.server.application + requestline = None # native str 'GET / HTTP/1.1' + response_length = 0 # How much data we sent + result = None # The return value of the WSGI application + wsgi_input = None # Instance of Input() + content_length = 0 # From application-provided headers Incoming + # request headers, instance of MessageClass (gunicorn uses hasattr + # on this so the default value needs to be compatible with the + # API) + headers = headers_factory(BytesIO()) + request_version = None # str: 'HTTP 1.1' + command = None # str: 'GET' + path = None # str: '/' + + def __init__(self, sock, address, server, rfile=None): + # Deprecation: The rfile kwarg was introduced in 1.0a1 as part + # of a refactoring. It was never documented or used. It is + # considered DEPRECATED and may be removed in the future. Its + # use is not supported. + + self.socket = sock + self.client_address = address + self.server = server + if rfile is None: + self.rfile = sock.makefile('rb', -1) + else: + self.rfile = rfile + + def handle(self): + """ + The main request handling method, called by the server. + + This method runs a request handling loop, calling + :meth:`handle_one_request` until all requests on the + connection have been handled (that is, it implements + keep-alive). + """ + try: + while self.socket is not None: + self.time_start = time.time() + self.time_finish = 0 + + result = self.handle_one_request() + if result is None: + break + if result is True: + continue + + self.status, response_body = result + self.socket.sendall(response_body) + if self.time_finish == 0: + self.time_finish = time.time() + self.log_request() + break + finally: + if self.socket is not None: + _sock = getattr(self.socket, '_sock', None) # Python 3 + try: + # read out request data to prevent error: [Errno 104] Connection reset by peer + if _sock: + try: + # socket.recv would hang + _sock.recv(16384) + finally: + _sock.close() + self.socket.close() + except socket.error: + pass + self.__dict__.pop('socket', None) + self.__dict__.pop('rfile', None) + + def _check_http_version(self): + version_str = self.request_version + if not version_str.startswith("HTTP/"): + return False + version = tuple(int(x) for x in version_str[5:].split(".")) # "HTTP/" + if version[1] < 0 or version < (0, 9) or version >= (2, 0): + return False + return True + + def read_request(self, raw_requestline): + """ + Parse the incoming request. + + Parses various headers into ``self.headers`` using + :attr:`MessageClass`. Other attributes that are set upon a successful + return of this method include ``self.content_length`` and ``self.close_connection``. + + :param str raw_requestline: A native :class:`str` representing + the request line. A processed version of this will be stored + into ``self.requestline``. + + :raises ValueError: If the request is invalid. This error will + not be logged as a traceback (because it's a client issue, not a server problem). + :return: A boolean value indicating whether the request was successfully parsed. + This method should either return a true value or have raised a ValueError + with details about the parsing error. + + .. versionchanged:: 1.1b6 + Raise the previously documented :exc:`ValueError` in more cases instead of returning a + false value; this allows subclasses more opportunity to customize behaviour. + """ + # pylint:disable=too-many-branches + self.requestline = raw_requestline.rstrip() + words = self.requestline.split() + if len(words) == 3: + self.command, self.path, self.request_version = words + if not self._check_http_version(): + raise _InvalidClientRequest('Invalid http version: %r' % (raw_requestline,)) + elif len(words) == 2: + self.command, self.path = words + if self.command != "GET": + raise _InvalidClientRequest('Expected GET method: %r' % (raw_requestline,)) + self.request_version = "HTTP/0.9" + # QQQ I'm pretty sure we can drop support for HTTP/0.9 + else: + raise _InvalidClientRequest('Invalid HTTP method: %r' % (raw_requestline,)) + + self.headers = self.MessageClass(self.rfile, 0) + + if self.headers.status: + raise _InvalidClientRequest('Invalid headers status: %r' % (self.headers.status,)) + + if self.headers.get("transfer-encoding", "").lower() == "chunked": + try: + del self.headers["content-length"] + except KeyError: + pass + + content_length = self.headers.get("content-length") + if content_length is not None: + content_length = int(content_length) + if content_length < 0: + raise _InvalidClientRequest('Invalid Content-Length: %r' % (content_length,)) + + if content_length and self.command in ('HEAD', ): + raise _InvalidClientRequest('Unexpected Content-Length') + + self.content_length = content_length + + if self.request_version == "HTTP/1.1": + conntype = self.headers.get("Connection", "").lower() + self.close_connection = (conntype == 'close') + else: + self.close_connection = True + + return True + + def log_error(self, msg, *args): + try: + message = msg % args + except Exception: # pylint:disable=broad-except + traceback.print_exc() + message = '%r %r' % (msg, args) + try: + message = '%s: %s' % (self.socket, message) + except Exception: # pylint:disable=broad-except + pass + + try: + self.server.error_log.write(message + '\n') + except Exception: # pylint:disable=broad-except + traceback.print_exc() + + def read_requestline(self): + """ + Read and return the HTTP request line. + + Under both Python 2 and 3, this should return the native + ``str`` type; under Python 3, this probably means the bytes read + from the network need to be decoded (using the ISO-8859-1 charset, aka + latin-1). + """ + line = self.rfile.readline(MAX_REQUEST_LINE) + if PY3: + line = line.decode('latin-1') + return line + + def handle_one_request(self): + """ + Handles one HTTP request using ``self.socket`` and ``self.rfile``. + + Each invocation of this method will do several things, including (but not limited to): + + - Read the request line using :meth:`read_requestline`; + - Read the rest of the request, including headers, with :meth:`read_request`; + - Construct a new WSGI environment in ``self.environ`` using :meth:`get_environ`; + - Store the application in ``self.application``, retrieving it from the server; + - Handle the remainder of the request, including invoking the application, + with :meth:`handle_one_response` + + There are several possible return values to indicate the state + of the client connection: + + - ``None`` + The client connection is already closed or should + be closed because the WSGI application or client set the + ``Connection: close`` header. The request handling + loop should terminate and perform cleanup steps. + - (status, body) + An HTTP status and body tuple. The request was in error, + as detailed by the status and body. The request handling + loop should terminate, close the connection, and perform + cleanup steps. Note that the ``body`` is the complete contents + to send to the client, including all headers and the initial + status line. + - ``True`` + The literal ``True`` value. The request was successfully handled + and the response sent to the client by :meth:`handle_one_response`. + The connection remains open to process more requests and the connection + handling loop should call this method again. This is the typical return + value. + + .. seealso:: :meth:`handle` + + .. versionchanged:: 1.1b6 + Funnel exceptions having to do with invalid HTTP requests through + :meth:`_handle_client_error` to allow subclasses to customize. Note that + this is experimental and may change in the future. + """ + # pylint:disable=too-many-return-statements + if self.rfile.closed: + return + + try: + self.requestline = self.read_requestline() + # Account for old subclasses that haven't done this + if PY3 and isinstance(self.requestline, bytes): + self.requestline = self.requestline.decode('latin-1') + except socket.error: + # "Connection reset by peer" or other socket errors aren't interesting here + return + + if not self.requestline: + return + + self.response_length = 0 + + if len(self.requestline) >= MAX_REQUEST_LINE: + return ('414', _REQUEST_TOO_LONG_RESPONSE) + + try: + # for compatibility with older versions of pywsgi, we pass self.requestline as an argument there + # NOTE: read_request is supposed to raise ValueError on invalid input; allow old + # subclasses that return a False value instead. + # NOTE: This can mutate the value of self.headers, so self.get_environ() must not be + # called until AFTER this call is done. + if not self.read_request(self.requestline): + return ('400', _BAD_REQUEST_RESPONSE) + except Exception as ex: # pylint:disable=broad-except + # Notice we don't use self.handle_error because it reports + # a 500 error to the client, and this is almost certainly + # a client error. + # Provide a hook for subclasses. + return self._handle_client_error(ex) + + self.environ = self.get_environ() + self.application = self.server.application + + self.handle_one_response() + + if self.close_connection: + return + + if self.rfile.closed: + return + + return True # read more requests + + def finalize_headers(self): + if self.provided_date is None: + self.response_headers.append((b'Date', format_date_time(time.time()))) + + if self.code not in (304, 204): + # the reply will include message-body; make sure we have either Content-Length or chunked + if self.provided_content_length is None: + if hasattr(self.result, '__len__'): + total_len = sum(len(chunk) for chunk in self.result) + total_len_str = str(total_len) + if PY3: + total_len_str = total_len_str.encode("latin-1") + self.response_headers.append((b'Content-Length', total_len_str)) + else: + if self.request_version != 'HTTP/1.0': + self.response_use_chunked = True + self.response_headers.append((b'Transfer-Encoding', b'chunked')) + + def _sendall(self, data): + try: + self.socket.sendall(data) + except socket.error as ex: + self.status = 'socket error: %s' % ex + if self.code > 0: + self.code = -self.code + raise + self.response_length += len(data) + + def _write(self, data, + _PY34_EXACTLY=(sys.version_info[:2] == (3, 4)), + _bytearray=bytearray): + if not data: + # The application/middleware are allowed to yield + # empty bytestrings. + return + + if self.response_use_chunked: + ## Write the chunked encoding + # header + if _PY34_EXACTLY: + # This is the only version we support that doesn't + # allow % to be used with bytes. Passing a bytestring + # directly in to bytearray() is faster than passing a + # (unicode) str with encoding, which naturally is faster still + # than encoding first. Interestingly, byte formatting on Python 3 + # is faster than str formatting. + header_str = '%x\r\n' % len(data) + towrite = _bytearray(header_str, 'ascii') + else: + header_str = b'%x\r\n' % len(data) + towrite = _bytearray(header_str) + + # data + towrite += data + # trailer + towrite += b'\r\n' + self._sendall(towrite) + else: + self._sendall(data) + + def write(self, data): + # The write() callable we return from start_response. + # https://www.python.org/dev/peps/pep-3333/#the-write-callable + # Supposed to do pretty much the same thing as yielding values + # from the application's return. + if self.code in (304, 204) and data: + raise AssertionError('The %s response must have no body' % self.code) + + if self.headers_sent: + self._write(data) + else: + if not self.status: + raise AssertionError("The application did not call start_response()") + self._write_with_headers(data) + + def _write_with_headers(self, data): + self.headers_sent = True + self.finalize_headers() + + # self.response_headers and self.status are already in latin-1, as encoded by self.start_response + towrite = bytearray(b'HTTP/1.1 ') + towrite += self.status + towrite += b'\r\n' + for header, value in self.response_headers: + towrite += header + towrite += b': ' + towrite += value + towrite += b"\r\n" + + towrite += b'\r\n' + self._sendall(towrite) + # No need to copy the data into towrite; we may make an extra syscall + # but the copy time could be substantial too, and it reduces the chances + # of sendall being able to send everything in one go + self._write(data) + + def start_response(self, status, headers, exc_info=None): + """ + .. versionchanged:: 1.2a1 + Avoid HTTP header injection by raising a :exc:`ValueError` + if *status* or any *header* name or value contains a carriage + return or newline. + .. versionchanged:: 1.1b5 + Pro-actively handle checking the encoding of the status line + and headers during this method. On Python 2, avoid some + extra encodings. + """ + # pylint:disable=too-many-branches,too-many-statements + if exc_info: + try: + if self.headers_sent: + # Re-raise original exception if headers sent + reraise(*exc_info) + finally: + # Avoid dangling circular ref + exc_info = None + + # Pep 3333, "The start_response callable": + # https://www.python.org/dev/peps/pep-3333/#the-start-response-callable + # "Servers should check for errors in the headers at the time + # start_response is called, so that an error can be raised + # while the application is still running." Here, we check the encoding. + # This aids debugging: headers especially are generated programmatically + # and an encoding error in a loop or list comprehension yields an opaque + # UnicodeError without any clue which header was wrong. + # Note that this results in copying the header list at this point, not modifying it, + # although we are allowed to do so if needed. This slightly increases memory usage. + # We also check for HTTP Response Splitting vulnerabilities + response_headers = [] + header = None + value = None + try: + for header, value in headers: + if not isinstance(header, str): + raise UnicodeError("The header must be a native string", header, value) + if not isinstance(value, str): + raise UnicodeError("The value must be a native string", header, value) + if '\r' in header or '\n' in header: + raise ValueError('carriage return or newline in header name', header) + if '\r' in value or '\n' in value: + raise ValueError('carriage return or newline in header value', value) + # Either we're on Python 2, in which case bytes is correct, or + # we're on Python 3 and the user screwed up (because it should be a native + # string). In either case, make sure that this is latin-1 compatible. Under + # Python 2, bytes.encode() will take a round-trip through the system encoding, + # which may be ascii, which is not really what we want. However, the latin-1 encoding + # can encode everything except control characters and the block from 0x7F to 0x9F, so + # explicitly round-tripping bytes through the encoding is unlikely to be of much + # benefit, so we go for speed (the WSGI spec specifically calls out allowing the range + # from 0x00 to 0xFF, although the HTTP spec forbids the control characters). + # Note: Some Python 2 implementations, like Jython, may allow non-octet (above 255) values + # in their str implementation; this is mentioned in the WSGI spec, but we don't + # run on any platform like that so we can assume that a str value is pure bytes. + response_headers.append((header if not PY3 else header.encode("latin-1"), + value if not PY3 else value.encode("latin-1"))) + except UnicodeEncodeError: + # If we get here, we're guaranteed to have a header and value + raise UnicodeError("Non-latin1 header", repr(header), repr(value)) + + # Same as above + if not isinstance(status, str): + raise UnicodeError("The status string must be a native string") + if '\r' in status or '\n' in status: + raise ValueError("carriage return or newline in status", status) + # don't assign to anything until the validation is complete, including parsing the + # code + code = int(status.split(' ', 1)[0]) + + self.status = status if not PY3 else status.encode("latin-1") + self._orig_status = status # Preserve the native string for logging + self.response_headers = response_headers + self.code = code + + provided_connection = None + self.provided_date = None + self.provided_content_length = None + + for header, value in headers: + header = header.lower() + if header == 'connection': + provided_connection = value + elif header == 'date': + self.provided_date = value + elif header == 'content-length': + self.provided_content_length = value + + if self.request_version == 'HTTP/1.0' and provided_connection is None: + response_headers.append((b'Connection', b'close')) + self.close_connection = True + elif provided_connection == 'close': + self.close_connection = True + + if self.code in (304, 204): + if self.provided_content_length is not None and self.provided_content_length != '0': + msg = 'Invalid Content-Length for %s response: %r (must be absent or zero)' % (self.code, self.provided_content_length) + if PY3: + msg = msg.encode('latin-1') + raise AssertionError(msg) + + return self.write + + def log_request(self): + self.server.log.write(self.format_request() + '\n') + + def format_request(self): + now = datetime.now().replace(microsecond=0) + length = self.response_length or '-' + if self.time_finish: + delta = '%.6f' % (self.time_finish - self.time_start) + else: + delta = '-' + client_address = self.client_address[0] if isinstance(self.client_address, tuple) else self.client_address + return '%s - - [%s] "%s" %s %s %s' % ( + client_address or '-', + now, + self.requestline or '', + # Use the native string version of the status, saved so we don't have to + # decode. But fallback to the encoded 'status' in case of subclasses + # (Is that really necessary? At least there's no overhead.) + (self._orig_status or self.status or '000').split()[0], + length, + delta) + + def process_result(self): + for data in self.result: + if data: + self.write(data) + if self.status and not self.headers_sent: + # In other words, the application returned an empty + # result iterable (and did not use the write callable) + # Trigger the flush of the headers. + self.write(b'') + if self.response_use_chunked: + self._sendall(b'0\r\n\r\n') + + + def run_application(self): + assert self.result is None + try: + self.result = self.application(self.environ, self.start_response) + self.process_result() + finally: + close = getattr(self.result, 'close', None) + try: + if close is not None: + close() + finally: + # Discard the result. If it's a generator this can + # free a lot of hidden resources (if we failed to iterate + # all the way through it---the frames are automatically + # cleaned up when StopIteration is raised); but other cases + # could still free up resources sooner than otherwise. + close = None + self.result = None + + #: These errors are silently ignored by :meth:`handle_one_response` to avoid producing + #: excess log entries on normal operating conditions. They indicate + #: a remote client has disconnected and there is little or nothing + #: this process can be expected to do about it. You may change this + #: value in a subclass. + #: + #: The default value includes :data:`errno.EPIPE` and :data:`errno.ECONNRESET`. + #: On Windows this also includes :data:`errno.WSAECONNABORTED`. + #: + #: This is a provisional API, subject to change. See :pr:`377`, :pr:`999` + #: and :issue:`136`. + #: + #: .. versionadded:: 1.3 + ignored_socket_errors = (errno.EPIPE, errno.ECONNRESET) + try: + ignored_socket_errors += (errno.WSAECONNABORTED,) + except AttributeError: + pass # Not windows + + def handle_one_response(self): + """ + Invoke the application to produce one response. + + This is called by :meth:`handle_one_request` after all the + state for the request has been established. It is responsible + for error handling. + """ + self.time_start = time.time() + self.status = None + self.headers_sent = False + + self.result = None + self.response_use_chunked = False + self.response_length = 0 + + try: + try: + self.run_application() + finally: + try: + self.wsgi_input._discard() + except (socket.error, IOError): + # Don't let exceptions during discarding + # input override any exception that may have been + # raised by the application, such as our own _InvalidClientInput. + # In the general case, these aren't even worth logging (see the comment + # just below) + pass + except _InvalidClientInput: + self._send_error_response_if_possible(400) + except socket.error as ex: + if ex.args[0] in self.ignored_socket_errors: + # See description of self.ignored_socket_errors. + if not PY3: + sys.exc_clear() + self.close_connection = True + else: + self.handle_error(*sys.exc_info()) + except: # pylint:disable=bare-except + self.handle_error(*sys.exc_info()) + finally: + self.time_finish = time.time() + self.log_request() + + def _send_error_response_if_possible(self, error_code): + if self.response_length: + self.close_connection = True + else: + status, headers, body = _ERRORS[error_code] + try: + self.start_response(status, headers[:]) + self.write(body) + except socket.error: + if not PY3: + sys.exc_clear() + self.close_connection = True + + def _log_error(self, t, v, tb): + # TODO: Shouldn't we dump this to wsgi.errors? If we did that now, it would + # wind up getting logged twice + if not issubclass(t, GreenletExit): + context = self.environ + if not isinstance(context, self.server.secure_environ_class): + context = self.server.secure_environ_class(context) + self.server.loop.handle_error(context, t, v, tb) + + def handle_error(self, t, v, tb): + # Called for internal, unexpected errors, NOT invalid client input + self._log_error(t, v, tb) + del tb + self._send_error_response_if_possible(500) + + def _handle_client_error(self, ex): + # Called for invalid client input + # Returns the appropriate error response. + if not isinstance(ex, ValueError): + # XXX: Why not self._log_error to send it through the loop's + # handle_error method? + traceback.print_exc() + if isinstance(ex, _InvalidClientRequest): + # These come with good error messages, and we want to let + # log_error deal with the formatting, especially to handle encoding + self.log_error(*ex.args) + else: + self.log_error('Invalid request: %s', str(ex) or ex.__class__.__name__) + return ('400', _BAD_REQUEST_RESPONSE) + + def _headers(self): + key = None + value = None + IGNORED_KEYS = (None, 'CONTENT_TYPE', 'CONTENT_LENGTH') + for header in self.headers.headers: + if key is not None and header[:1] in " \t": + value += header + continue + + if key not in IGNORED_KEYS: + yield 'HTTP_' + key, value.strip() + + key, value = header.split(':', 1) + if '_' in key: + # strip incoming bad veaders + key = None + else: + key = key.replace('-', '_').upper() + + if key not in IGNORED_KEYS: + yield 'HTTP_' + key, value.strip() + + def get_environ(self): + """ + Construct and return a new WSGI environment dictionary for a specific request. + + This should begin with asking the server for the base environment + using :meth:`WSGIServer.get_environ`, and then proceed to add the + request specific values. + + By the time this method is invoked the request line and request shall have + been parsed and ``self.headers`` shall be populated. + """ + env = self.server.get_environ() + env['REQUEST_METHOD'] = self.command + env['SCRIPT_NAME'] = '' + + if '?' in self.path: + path, query = self.path.split('?', 1) + else: + path, query = self.path, '' + # Note that self.path contains the original str object; if it contains + # encoded escapes, it will NOT match PATH_INFO. + env['PATH_INFO'] = unquote_latin1(path) + env['QUERY_STRING'] = query + + if self.headers.typeheader is not None: + env['CONTENT_TYPE'] = self.headers.typeheader + + length = self.headers.getheader('content-length') + if length: + env['CONTENT_LENGTH'] = length + env['SERVER_PROTOCOL'] = self.request_version + + client_address = self.client_address + if isinstance(client_address, tuple): + env['REMOTE_ADDR'] = str(client_address[0]) + env['REMOTE_PORT'] = str(client_address[1]) + + for key, value in self._headers(): + if key in env: + if 'COOKIE' in key: + env[key] += '; ' + value + else: + env[key] += ',' + value + else: + env[key] = value + + if env.get('HTTP_EXPECT') == '100-continue': + sock = self.socket + else: + sock = None + + chunked = env.get('HTTP_TRANSFER_ENCODING', '').lower() == 'chunked' + self.wsgi_input = Input(self.rfile, self.content_length, socket=sock, chunked_input=chunked) + env['wsgi.input'] = self.wsgi_input + # This is a non-standard flag indicating that our input stream is + # self-terminated (returns EOF when consumed). + # See https://github.com/gevent/gevent/issues/1308 + env['wsgi.input_terminated'] = True + return env + + +class _NoopLog(object): + # Does nothing; implements just enough file-like methods + # to pass the WSGI validator + + def write(self, *args, **kwargs): + # pylint:disable=unused-argument + return + + def flush(self): + pass + + def writelines(self, *args, **kwargs): + pass + + +class LoggingLogAdapter(object): + """ + An adapter for :class:`logging.Logger` instances + to let them be used with :class:`WSGIServer`. + + .. warning:: Unless the entire process is monkey-patched at a very + early part of the lifecycle (before logging is configured), + loggers are likely to not be gevent-cooperative. For example, + the socket and syslog handlers use the socket module in a way + that can block, and most handlers acquire threading locks. + + .. warning:: It *may* be possible for the logging functions to be + called in the :class:`gevent.Hub` greenlet. Code running in the + hub greenlet cannot use any gevent blocking functions without triggering + a ``LoopExit``. + + .. versionadded:: 1.1a3 + + .. versionchanged:: 1.1b6 + Attributes not present on this object are proxied to the underlying + logger instance. This permits using custom :class:`~logging.Logger` + subclasses (or indeed, even duck-typed objects). + + .. versionchanged:: 1.1 + Strip trailing newline characters on the message passed to :meth:`write` + because log handlers will usually add one themselves. + """ + + # gevent avoids importing and using logging because importing it and + # creating loggers creates native locks unless monkey-patched. + + __slots__ = ('_logger', '_level') + + def __init__(self, logger, level=20): + """ + Write information to the *logger* at the given *level* (default to INFO). + """ + self._logger = logger + self._level = level + + def write(self, msg): + if msg and msg.endswith('\n'): + msg = msg[:-1] + self._logger.log(self._level, msg) + + def flush(self): + "No-op; required to be a file-like object" + + def writelines(self, lines): + for line in lines: + self.write(line) + + def __getattr__(self, name): + return getattr(self._logger, name) + + def __setattr__(self, name, value): + if name not in LoggingLogAdapter.__slots__: + setattr(self._logger, name, value) + else: + object.__setattr__(self, name, value) + + def __delattr__(self, name): + delattr(self._logger, name) + +#### +## Environ classes. +# These subclass dict. They could subclass collections.UserDict on +# 3.3+ and proxy to the underlying real dict to avoid a copy if we +# have to print them (on 2.7 it's slightly more complicated to be an +# instance of collections.MutableMapping; UserDict.UserDict isn't.) +# Then we could have either the WSGIHandler.get_environ or the +# WSGIServer.get_environ return one of these proxies, and +# WSGIHandler.run_application would know to access the `environ.data` +# attribute to be able to pass the *real* dict to the application +# (because PEP3333 requires no subclasses, only actual dict objects; +# wsgiref.validator and webob.Request both enforce this). This has the +# advantage of not being fragile if anybody else tries to print/log +# self.environ (and not requiring a copy). However, if there are any +# subclasses of Handler or Server, this could break if they don't know +# to return this type. +#### + +class Environ(dict): + """ + A base class that can be used for WSGI environment objects. + + Provisional API. + + .. versionadded:: 1.2a1 + """ + + __slots__ = () # add no ivars or weakref ability + + def copy(self): + return self.__class__(self) + + if not hasattr(dict, 'iteritems'): + # Python 3 + def iteritems(self): + return self.items() + + def __reduce_ex__(self, proto): + return (dict, (), None, None, iter(self.iteritems())) + +class SecureEnviron(Environ): + """ + An environment that does not print its keys and values + by default. + + Provisional API. + + This is intended to keep potentially sensitive information like + HTTP authorization and cookies from being inadvertently printed + or logged. + + For debugging, each instance can have its *secure_repr* attribute + set to ``False``, which will cause it to print like a normal dict. + + When *secure_repr* is ``True`` (the default), then the value of + the *whitelist_keys* attribute is consulted; if this value is + true-ish, it should be a container (something that responds to + ``in``) of key names (typically a list or set). Keys and values in + this dictionary that are in *whitelist_keys* will then be printed, + while all other values will be masked. These values may be + customized on the class by setting the *default_secure_repr* and + *default_whitelist_keys*, respectively:: + + >>> environ = SecureEnviron(key='value') + >>> environ # doctest: +ELLIPSIS + >> environ.whitelist_keys = {'key'} + >>> environ + {'key': 'value'} + + A non-whitelisted key (*only*, to avoid doctest issues) is masked:: + + >>> environ['secure'] = 'secret'; del environ['key'] + >>> environ + {'secure': ''} + + We can turn it off entirely for the instance:: + + >>> environ.secure_repr = False + >>> environ + {'secure': 'secret'} + + We can also customize it at the class level (here we use a new + class to be explicit and to avoid polluting the true default + values; we would set this class to be the ``environ_class`` of the + server):: + + >>> class MyEnviron(SecureEnviron): + ... default_whitelist_keys = ('key',) + ... + >>> environ = MyEnviron({'key': 'value'}) + >>> environ + {'key': 'value'} + + .. versionadded:: 1.2a1 + """ + + default_secure_repr = True + default_whitelist_keys = () + default_print_masked_keys = True + + # Allow instances to override the class values, + # but inherit from the class if not present. Keeps instances + # small since we can't combine __slots__ with class attributes + # of the same name. + __slots__ = ('secure_repr', 'whitelist_keys', 'print_masked_keys') + + def __getattr__(self, name): + if name in SecureEnviron.__slots__: + return getattr(type(self), 'default_' + name) + raise AttributeError(name) + + def __repr__(self): + if self.secure_repr: + whitelist = self.whitelist_keys + print_masked = self.print_masked_keys + if whitelist: + safe = {k: self[k] if k in whitelist else "" + for k in self + if k in whitelist or print_masked} + safe_repr = repr(safe) + if not print_masked and len(safe) != len(self): + safe_repr = safe_repr[:-1] + ", (hidden keys: %d)}" % (len(self) - len(safe)) + return safe_repr + return "" % (len(self), id(self)) + return Environ.__repr__(self) + __str__ = __repr__ + + +class WSGISecureEnviron(SecureEnviron): + """ + Specializes the default list of whitelisted keys to a few + common WSGI variables. + + Example:: + + >>> environ = WSGISecureEnviron(REMOTE_ADDR='::1', HTTP_AUTHORIZATION='secret') + >>> environ + {'REMOTE_ADDR': '::1', (hidden keys: 1)} + >>> import pprint + >>> pprint.pprint(environ) + {'REMOTE_ADDR': '::1', (hidden keys: 1)} + >>> print(pprint.pformat(environ)) + {'REMOTE_ADDR': '::1', (hidden keys: 1)} + """ + default_whitelist_keys = ('REMOTE_ADDR', 'REMOTE_PORT', 'HTTP_HOST') + default_print_masked_keys = False + + +class WSGIServer(StreamServer): + """ + A WSGI server based on :class:`StreamServer` that supports HTTPS. + + + :keyword log: If given, an object with a ``write`` method to which + request (access) logs will be written. If not given, defaults + to :obj:`sys.stderr`. You may pass ``None`` to disable request + logging. You may use a wrapper, around e.g., :mod:`logging`, + to support objects that don't implement a ``write`` method. + (If you pass a :class:`~logging.Logger` instance, or in + general something that provides a ``log`` method but not a + ``write`` method, such a wrapper will automatically be created + and it will be logged to at the :data:`~logging.INFO` level.) + + :keyword error_log: If given, a file-like object with ``write``, + ``writelines`` and ``flush`` methods to which error logs will + be written. If not given, defaults to :obj:`sys.stderr`. You + may pass ``None`` to disable error logging (not recommended). + You may use a wrapper, around e.g., :mod:`logging`, to support + objects that don't implement the proper methods. This + parameter will become the value for ``wsgi.errors`` in the + WSGI environment (if not already set). (As with *log*, + wrappers for :class:`~logging.Logger` instances and the like + will be created automatically and logged to at the :data:`~logging.ERROR` + level.) + + .. seealso:: + + :class:`LoggingLogAdapter` + See important warnings before attempting to use :mod:`logging`. + + .. versionchanged:: 1.1a3 + Added the ``error_log`` parameter, and set ``wsgi.errors`` in the WSGI + environment to this value. + .. versionchanged:: 1.1a3 + Add support for passing :class:`logging.Logger` objects to the ``log`` and + ``error_log`` arguments. + """ + + #: A callable taking three arguments: (socket, address, server) and returning + #: an object with a ``handle()`` method. The callable is called once for + #: each incoming socket request, as is its handle method. The handle method should not + #: return until all use of the socket is complete. + #: + #: This class uses the :class:`WSGIHandler` object as the default value. You may + #: subclass this class and set a different default value, or you may pass + #: a value to use in the ``handler_class`` keyword constructor argument. + handler_class = WSGIHandler + + #: The object to which request logs will be written. + #: It must never be None. Initialized from the ``log`` constructor + #: parameter. + log = None + + #: The object to which error logs will be written. + #: It must never be None. Initialized from the ``error_log`` constructor + #: parameter. + error_log = None + + #: The class of environ objects passed to the handlers. + #: Must be a dict subclass. For compliance with :pep:`3333` + #: and libraries like WebOb, this is simply :class:`dict` + #: but this can be customized in a subclass or per-instance + #: (probably to :class:`WSGISecureEnviron`). + #: + #: .. versionadded:: 1.2a1 + environ_class = dict + + # Undocumented internal detail: the class that WSGIHandler._log_error + # will cast to before passing to the loop. + secure_environ_class = WSGISecureEnviron + + base_env = {'GATEWAY_INTERFACE': 'CGI/1.1', + 'SERVER_SOFTWARE': 'gevent/%d.%d Python/%d.%d' % (gevent.version_info[:2] + sys.version_info[:2]), + 'SCRIPT_NAME': '', + 'wsgi.version': (1, 0), + 'wsgi.multithread': False, # XXX: Aren't we really, though? + 'wsgi.multiprocess': False, + 'wsgi.run_once': False} + + def __init__(self, listener, application=None, backlog=None, spawn='default', + log='default', error_log='default', + handler_class=None, + environ=None, **ssl_args): + StreamServer.__init__(self, listener, backlog=backlog, spawn=spawn, **ssl_args) + if application is not None: + self.application = application + if handler_class is not None: + self.handler_class = handler_class + + # Note that we can't initialize these as class variables: + # sys.stderr might get monkey patched at runtime. + def _make_log(l, level=20): + if l == 'default': + return sys.stderr + if l is None: + return _NoopLog() + if not hasattr(l, 'write') and hasattr(l, 'log'): + return LoggingLogAdapter(l, level) + return l + self.log = _make_log(log) + self.error_log = _make_log(error_log, 40) # logging.ERROR + + self.set_environ(environ) + self.set_max_accept() + + def set_environ(self, environ=None): + if environ is not None: + self.environ = environ + environ_update = getattr(self, 'environ', None) + + self.environ = self.environ_class(self.base_env) + if self.ssl_enabled: + self.environ['wsgi.url_scheme'] = 'https' + else: + self.environ['wsgi.url_scheme'] = 'http' + if environ_update is not None: + self.environ.update(environ_update) + if self.environ.get('wsgi.errors') is None: + self.environ['wsgi.errors'] = self.error_log + + def set_max_accept(self): + if self.environ.get('wsgi.multiprocess'): + self.max_accept = 1 + + def get_environ(self): + return self.environ_class(self.environ) + + def init_socket(self): + StreamServer.init_socket(self) + self.update_environ() + + def update_environ(self): + """ + Called before the first request is handled to fill in WSGI environment values. + + This includes getting the correct server name and port. + """ + address = self.address + if isinstance(address, tuple): + if 'SERVER_NAME' not in self.environ: + try: + name = socket.getfqdn(address[0]) + except socket.error: + name = str(address[0]) + if PY3 and not isinstance(name, str): + name = name.decode('ascii') + self.environ['SERVER_NAME'] = name + self.environ.setdefault('SERVER_PORT', str(address[1])) + else: + self.environ.setdefault('SERVER_NAME', '') + self.environ.setdefault('SERVER_PORT', '') + + def handle(self, sock, address): + """ + Create an instance of :attr:`handler_class` to handle the request. + + This method blocks until the handler returns. + """ + # pylint:disable=method-hidden + handler = self.handler_class(sock, address, self) + handler.handle() + +def _main(): + # Provisional main handler, for quick tests, not production + # usage. + from gevent import monkey; monkey.patch_all() + + import argparse + import importlib + + parser = argparse.ArgumentParser() + parser.add_argument("app", help="dotted name of WSGI app callable [module:callable]") + parser.add_argument("-b", "--bind", + help="The socket to bind", + default=":8080") + + args = parser.parse_args() + + module_name, app_name = args.app.split(':') + module = importlib.import_module(module_name) + app = getattr(module, app_name) + bind = args.bind + + server = WSGIServer(bind, app) + server.serve_forever() + +if __name__ == '__main__': + _main() diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/queue.c b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/queue.c new file mode 100644 index 00000000..e90de19d --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/queue.c @@ -0,0 +1,21853 @@ +/* Generated by Cython 0.29.2 */ + +/* BEGIN: Cython Metadata +{ + "distutils": { + "depends": [ + "src/gevent/_queue.pxd", + "src\\gevent\\_queue.pxd" + ], + "include_dirs": [ + "C:\\Python37\\Include", + "deps" + ], + "name": "gevent._queue", + "sources": [ + "src/gevent/queue.py" + ] + }, + "module_name": "gevent._queue" +} +END: Cython Metadata */ + +#define PY_SSIZE_T_CLEAN +#include "Python.h" +#ifndef Py_PYTHON_H + #error Python headers needed to compile C extensions, please install development version of Python. +#elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) + #error Cython requires Python 2.6+ or Python 3.3+. +#else +#define CYTHON_ABI "0_29_2" +#define CYTHON_HEX_VERSION 0x001D02F0 +#define CYTHON_FUTURE_DIVISION 1 +#include +#ifndef offsetof + #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) +#endif +#if !defined(WIN32) && !defined(MS_WINDOWS) + #ifndef __stdcall + #define __stdcall + #endif + #ifndef __cdecl + #define __cdecl + #endif + #ifndef __fastcall + #define __fastcall + #endif +#endif +#ifndef DL_IMPORT + #define DL_IMPORT(t) t +#endif +#ifndef DL_EXPORT + #define DL_EXPORT(t) t +#endif +#define __PYX_COMMA , +#ifndef HAVE_LONG_LONG + #if PY_VERSION_HEX >= 0x02070000 + #define HAVE_LONG_LONG + #endif +#endif +#ifndef PY_LONG_LONG + #define PY_LONG_LONG LONG_LONG +#endif +#ifndef Py_HUGE_VAL + #define Py_HUGE_VAL HUGE_VAL +#endif +#ifdef PYPY_VERSION + #define CYTHON_COMPILING_IN_PYPY 1 + #define CYTHON_COMPILING_IN_PYSTON 0 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #undef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 0 + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #if PY_VERSION_HEX < 0x03050000 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #elif !defined(CYTHON_USE_ASYNC_SLOTS) + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #undef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 0 + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #undef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 1 + #undef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 0 + #undef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 0 + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #undef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE 0 + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 +#elif defined(PYSTON_VERSION) + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_PYSTON 1 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #ifndef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 1 + #endif + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #ifndef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 1 + #endif + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #ifndef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 0 + #endif + #ifndef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 1 + #endif + #ifndef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 1 + #endif + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #undef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE 0 + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 +#else + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_PYSTON 0 + #define CYTHON_COMPILING_IN_CPYTHON 1 + #ifndef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 1 + #endif + #if PY_VERSION_HEX < 0x02070000 + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #elif !defined(CYTHON_USE_PYTYPE_LOOKUP) + #define CYTHON_USE_PYTYPE_LOOKUP 1 + #endif + #if PY_MAJOR_VERSION < 3 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #elif !defined(CYTHON_USE_ASYNC_SLOTS) + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #if PY_VERSION_HEX < 0x02070000 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #elif !defined(CYTHON_USE_PYLONG_INTERNALS) + #define CYTHON_USE_PYLONG_INTERNALS 1 + #endif + #ifndef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 1 + #endif + #ifndef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 1 + #endif + #if PY_VERSION_HEX < 0x030300F0 + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #elif !defined(CYTHON_USE_UNICODE_WRITER) + #define CYTHON_USE_UNICODE_WRITER 1 + #endif + #ifndef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 0 + #endif + #ifndef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 1 + #endif + #ifndef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 1 + #endif + #ifndef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 1 + #endif + #ifndef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 1 + #endif + #ifndef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000) + #endif + #ifndef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1) + #endif + #ifndef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1) + #endif + #ifndef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3) + #endif +#endif +#if !defined(CYTHON_FAST_PYCCALL) +#define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) +#endif +#if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #undef SHIFT + #undef BASE + #undef MASK + #ifdef SIZEOF_VOID_P + enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) }; + #endif +#endif +#ifndef __has_attribute + #define __has_attribute(x) 0 +#endif +#ifndef __has_cpp_attribute + #define __has_cpp_attribute(x) 0 +#endif +#ifndef CYTHON_RESTRICT + #if defined(__GNUC__) + #define CYTHON_RESTRICT __restrict__ + #elif defined(_MSC_VER) && _MSC_VER >= 1400 + #define CYTHON_RESTRICT __restrict + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_RESTRICT restrict + #else + #define CYTHON_RESTRICT + #endif +#endif +#ifndef CYTHON_UNUSED +# if defined(__GNUC__) +# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +#endif +#ifndef CYTHON_MAYBE_UNUSED_VAR +# if defined(__cplusplus) + template void CYTHON_MAYBE_UNUSED_VAR( const T& ) { } +# else +# define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x) +# endif +#endif +#ifndef CYTHON_NCP_UNUSED +# if CYTHON_COMPILING_IN_CPYTHON +# define CYTHON_NCP_UNUSED +# else +# define CYTHON_NCP_UNUSED CYTHON_UNUSED +# endif +#endif +#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) +#ifdef _MSC_VER + #ifndef _MSC_STDINT_H_ + #if _MSC_VER < 1300 + typedef unsigned char uint8_t; + typedef unsigned int uint32_t; + #else + typedef unsigned __int8 uint8_t; + typedef unsigned __int32 uint32_t; + #endif + #endif +#else + #include +#endif +#ifndef CYTHON_FALLTHROUGH + #if defined(__cplusplus) && __cplusplus >= 201103L + #if __has_cpp_attribute(fallthrough) + #define CYTHON_FALLTHROUGH [[fallthrough]] + #elif __has_cpp_attribute(clang::fallthrough) + #define CYTHON_FALLTHROUGH [[clang::fallthrough]] + #elif __has_cpp_attribute(gnu::fallthrough) + #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] + #endif + #endif + #ifndef CYTHON_FALLTHROUGH + #if __has_attribute(fallthrough) + #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) + #else + #define CYTHON_FALLTHROUGH + #endif + #endif + #if defined(__clang__ ) && defined(__apple_build_version__) + #if __apple_build_version__ < 7000000 + #undef CYTHON_FALLTHROUGH + #define CYTHON_FALLTHROUGH + #endif + #endif +#endif + +#ifndef CYTHON_INLINE + #if defined(__clang__) + #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) + #elif defined(__GNUC__) + #define CYTHON_INLINE __inline__ + #elif defined(_MSC_VER) + #define CYTHON_INLINE __inline + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_INLINE inline + #else + #define CYTHON_INLINE + #endif +#endif + +#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) + #define Py_OptimizeFlag 0 +#endif +#define __PYX_BUILD_PY_SSIZE_T "n" +#define CYTHON_FORMAT_SSIZE_T "z" +#if PY_MAJOR_VERSION < 3 + #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyClass_Type +#else + #define __Pyx_BUILTIN_MODULE_NAME "builtins" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyType_Type +#endif +#ifndef Py_TPFLAGS_CHECKTYPES + #define Py_TPFLAGS_CHECKTYPES 0 +#endif +#ifndef Py_TPFLAGS_HAVE_INDEX + #define Py_TPFLAGS_HAVE_INDEX 0 +#endif +#ifndef Py_TPFLAGS_HAVE_NEWBUFFER + #define Py_TPFLAGS_HAVE_NEWBUFFER 0 +#endif +#ifndef Py_TPFLAGS_HAVE_FINALIZE + #define Py_TPFLAGS_HAVE_FINALIZE 0 +#endif +#ifndef METH_STACKLESS + #define METH_STACKLESS 0 +#endif +#if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) + #ifndef METH_FASTCALL + #define METH_FASTCALL 0x80 + #endif + typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs); + typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args, + Py_ssize_t nargs, PyObject *kwnames); +#else + #define __Pyx_PyCFunctionFast _PyCFunctionFast + #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords +#endif +#if CYTHON_FAST_PYCCALL +#define __Pyx_PyFastCFunction_Check(func)\ + ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS))))) +#else +#define __Pyx_PyFastCFunction_Check(func) 0 +#endif +#if CYTHON_USE_DICT_VERSIONS +#define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) +#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ + (version_var) = __PYX_GET_DICT_VERSION(dict);\ + (cache_var) = (value); +#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ + static PY_UINT64_T __pyx_dict_version = 0;\ + static PyObject *__pyx_dict_cached_value = NULL;\ + if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ + (VAR) = __pyx_dict_cached_value;\ + } else {\ + (VAR) = __pyx_dict_cached_value = (LOOKUP);\ + __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ + }\ + } +#else +#define __PYX_GET_DICT_VERSION(dict) (0) +#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) +#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) + #define PyObject_Malloc(s) PyMem_Malloc(s) + #define PyObject_Free(p) PyMem_Free(p) + #define PyObject_Realloc(p) PyMem_Realloc(p) +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1 + #define PyMem_RawMalloc(n) PyMem_Malloc(n) + #define PyMem_RawRealloc(p, n) PyMem_Realloc(p, n) + #define PyMem_RawFree(p) PyMem_Free(p) +#endif +#if CYTHON_COMPILING_IN_PYSTON + #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co) + #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno) +#else + #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) + #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) +#endif +#if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000 + #define __Pyx_PyThreadState_Current PyThreadState_GET() +#elif PY_VERSION_HEX >= 0x03060000 + #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() +#elif PY_VERSION_HEX >= 0x03000000 + #define __Pyx_PyThreadState_Current PyThreadState_GET() +#else + #define __Pyx_PyThreadState_Current _PyThreadState_Current +#endif +#if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) +#include "pythread.h" +#define Py_tss_NEEDS_INIT 0 +typedef int Py_tss_t; +static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) { + *key = PyThread_create_key(); + return 0; // PyThread_create_key reports success always +} +static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) { + Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t)); + *key = Py_tss_NEEDS_INIT; + return key; +} +static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) { + PyObject_Free(key); +} +static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) { + return *key != Py_tss_NEEDS_INIT; +} +static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) { + PyThread_delete_key(*key); + *key = Py_tss_NEEDS_INIT; +} +static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) { + return PyThread_set_key_value(*key, value); +} +static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { + return PyThread_get_key_value(*key); +} +#endif // TSS (Thread Specific Storage) API +#if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized) +#define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) +#else +#define __Pyx_PyDict_NewPresized(n) PyDict_New() +#endif +#if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION + #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) +#else + #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS +#define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) +#else +#define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name) +#endif +#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) + #define CYTHON_PEP393_ENABLED 1 + #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ + 0 : _PyUnicode_Ready((PyObject *)(op))) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) + #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) + #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) + #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) + #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) + #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch) + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) +#else + #define CYTHON_PEP393_ENABLED 0 + #define PyUnicode_1BYTE_KIND 1 + #define PyUnicode_2BYTE_KIND 2 + #define PyUnicode_4BYTE_KIND 4 + #define __Pyx_PyUnicode_READY(op) (0) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) + #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111) + #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) + #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) + #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) + #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch) + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) +#endif +#if CYTHON_COMPILING_IN_PYPY + #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) +#else + #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ + PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains) + #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check) + #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format) + #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) +#endif +#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) +#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) +#else + #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) +#endif +#if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) + #define PyObject_ASCII(o) PyObject_Repr(o) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBaseString_Type PyUnicode_Type + #define PyStringObject PyUnicodeObject + #define PyString_Type PyUnicode_Type + #define PyString_Check PyUnicode_Check + #define PyString_CheckExact PyUnicode_CheckExact + #define PyObject_Unicode PyObject_Str +#endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) + #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) +#else + #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) + #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) +#endif +#ifndef PySet_CheckExact + #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) +#endif +#if CYTHON_ASSUME_SAFE_MACROS + #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) +#else + #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyIntObject PyLongObject + #define PyInt_Type PyLong_Type + #define PyInt_Check(op) PyLong_Check(op) + #define PyInt_CheckExact(op) PyLong_CheckExact(op) + #define PyInt_FromString PyLong_FromString + #define PyInt_FromUnicode PyLong_FromUnicode + #define PyInt_FromLong PyLong_FromLong + #define PyInt_FromSize_t PyLong_FromSize_t + #define PyInt_FromSsize_t PyLong_FromSsize_t + #define PyInt_AsLong PyLong_AsLong + #define PyInt_AS_LONG PyLong_AS_LONG + #define PyInt_AsSsize_t PyLong_AsSsize_t + #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask + #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask + #define PyNumber_Int PyNumber_Long +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBoolObject PyLongObject +#endif +#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY + #ifndef PyUnicode_InternFromString + #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) + #endif +#endif +#if PY_VERSION_HEX < 0x030200A4 + typedef long Py_hash_t; + #define __Pyx_PyInt_FromHash_t PyInt_FromLong + #define __Pyx_PyInt_AsHash_t PyInt_AsLong +#else + #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t + #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t +#endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : (Py_INCREF(func), func)) +#else + #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) +#endif +#if CYTHON_USE_ASYNC_SLOTS + #if PY_VERSION_HEX >= 0x030500B1 + #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods + #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) + #else + #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) + #endif +#else + #define __Pyx_PyType_AsAsync(obj) NULL +#endif +#ifndef __Pyx_PyAsyncMethodsStruct + typedef struct { + unaryfunc am_await; + unaryfunc am_aiter; + unaryfunc am_anext; + } __Pyx_PyAsyncMethodsStruct; +#endif + +#if defined(WIN32) || defined(MS_WINDOWS) + #define _USE_MATH_DEFINES +#endif +#include +#ifdef NAN +#define __PYX_NAN() ((float) NAN) +#else +static CYTHON_INLINE float __PYX_NAN() { + float value; + memset(&value, 0xFF, sizeof(value)); + return value; +} +#endif +#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) +#define __Pyx_truncl trunc +#else +#define __Pyx_truncl truncl +#endif + + +#define __PYX_ERR(f_index, lineno, Ln_error) \ +{ \ + __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \ +} + +#ifndef __PYX_EXTERN_C + #ifdef __cplusplus + #define __PYX_EXTERN_C extern "C" + #else + #define __PYX_EXTERN_C extern + #endif +#endif + +#define __PYX_HAVE__gevent___queue +#define __PYX_HAVE_API__gevent___queue +/* Early includes */ +#include "greenlet/greenlet.h" +#ifdef _OPENMP +#include +#endif /* _OPENMP */ + +#if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) +#define CYTHON_WITHOUT_ASSERTIONS +#endif + +typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; + const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; + +#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 +#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0 +#define __PYX_DEFAULT_STRING_ENCODING "" +#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString +#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#define __Pyx_uchar_cast(c) ((unsigned char)c) +#define __Pyx_long_cast(x) ((long)x) +#define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ + (sizeof(type) < sizeof(Py_ssize_t)) ||\ + (sizeof(type) > sizeof(Py_ssize_t) &&\ + likely(v < (type)PY_SSIZE_T_MAX ||\ + v == (type)PY_SSIZE_T_MAX) &&\ + (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ + v == (type)PY_SSIZE_T_MIN))) ||\ + (sizeof(type) == sizeof(Py_ssize_t) &&\ + (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ + v == (type)PY_SSIZE_T_MAX))) ) +static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) { + return (size_t) i < (size_t) limit; +} +#if defined (__cplusplus) && __cplusplus >= 201103L + #include + #define __Pyx_sst_abs(value) std::abs(value) +#elif SIZEOF_INT >= SIZEOF_SIZE_T + #define __Pyx_sst_abs(value) abs(value) +#elif SIZEOF_LONG >= SIZEOF_SIZE_T + #define __Pyx_sst_abs(value) labs(value) +#elif defined (_MSC_VER) + #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) +#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define __Pyx_sst_abs(value) llabs(value) +#elif defined (__GNUC__) + #define __Pyx_sst_abs(value) __builtin_llabs(value) +#else + #define __Pyx_sst_abs(value) ((value<0) ? -value : value) +#endif +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*); +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); +#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) +#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) +#define __Pyx_PyBytes_FromString PyBytes_FromString +#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); +#if PY_MAJOR_VERSION < 3 + #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#else + #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize +#endif +#define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) +#define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) +#define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) +#define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) +#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) +static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) { + const Py_UNICODE *u_end = u; + while (*u_end++) ; + return (size_t)(u_end - u - 1); +} +#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) +#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode +#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode +#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) +#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) +static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); +static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*); +static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); +#define __Pyx_PySequence_Tuple(obj)\ + (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); +#if CYTHON_ASSUME_SAFE_MACROS +#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) +#else +#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) +#endif +#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) +#if PY_MAJOR_VERSION >= 3 +#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) +#else +#define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) +#endif +#define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x)) +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII +static int __Pyx_sys_getdefaultencoding_not_ascii; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + PyObject* ascii_chars_u = NULL; + PyObject* ascii_chars_b = NULL; + const char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + if (strcmp(default_encoding_c, "ascii") == 0) { + __Pyx_sys_getdefaultencoding_not_ascii = 0; + } else { + char ascii_chars[128]; + int c; + for (c = 0; c < 128; c++) { + ascii_chars[c] = c; + } + __Pyx_sys_getdefaultencoding_not_ascii = 1; + ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); + if (!ascii_chars_u) goto bad; + ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); + if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { + PyErr_Format( + PyExc_ValueError, + "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", + default_encoding_c); + goto bad; + } + Py_DECREF(ascii_chars_u); + Py_DECREF(ascii_chars_b); + } + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + Py_XDECREF(ascii_chars_u); + Py_XDECREF(ascii_chars_b); + return -1; +} +#endif +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) +#else +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +static char* __PYX_DEFAULT_STRING_ENCODING; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1); + if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; + strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + return -1; +} +#endif +#endif + + +/* Test for GCC > 2.95 */ +#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) + #define likely(x) __builtin_expect(!!(x), 1) + #define unlikely(x) __builtin_expect(!!(x), 0) +#else /* !__GNUC__ or GCC < 2.95 */ + #define likely(x) (x) + #define unlikely(x) (x) +#endif /* __GNUC__ */ +static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } + +static PyObject *__pyx_m = NULL; +static PyObject *__pyx_d; +static PyObject *__pyx_b; +static PyObject *__pyx_cython_runtime = NULL; +static PyObject *__pyx_empty_tuple; +static PyObject *__pyx_empty_bytes; +static PyObject *__pyx_empty_unicode; +static int __pyx_lineno; +static int __pyx_clineno = 0; +static const char * __pyx_cfilenm= __FILE__; +static const char *__pyx_filename; + + +static const char *__pyx_f[] = { + "src\\gevent\\queue.py", + "src\\gevent\\_queue.pxd", + "src\\gevent\\__greenlet_primitives.pxd", + "src\\gevent\\__waiter.pxd", + "src\\gevent\\__abstract_linkable.pxd", + "src\\gevent\\_event.pxd", +}; + +/*--- Type declarations ---*/ +struct __pyx_obj_6gevent_21__greenlet_primitives_TrackedRawGreenlet; +struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop; +struct __pyx_obj_6gevent_8__waiter_Waiter; +struct __pyx_obj_6gevent_8__waiter_MultipleWaiter; +struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable; +struct __pyx_obj_6gevent_6_event_Event; +struct __pyx_obj_6gevent_6_event_AsyncResult; +struct __pyx_obj_6gevent_6_queue_ItemWaiter; +struct __pyx_obj_6gevent_6_queue_Queue; +struct __pyx_obj_6gevent_6_queue_UnboundQueue; +struct __pyx_obj_6gevent_6_queue_PriorityQueue; +struct __pyx_obj_6gevent_6_queue_LifoQueue; +struct __pyx_obj_6gevent_6_queue_JoinableQueue; +struct __pyx_obj_6gevent_6_queue_Channel; +struct __pyx_opt_args_6gevent_19__abstract_linkable_16AbstractLinkable__wait_core; +struct __pyx_opt_args_6gevent_19__abstract_linkable_16AbstractLinkable__wait; + +/* "gevent/__abstract_linkable.pxd":51 + * cdef _check_and_notify(self) + * cpdef _notify_links(self) + * cdef _wait_core(self, timeout, catch=*) # <<<<<<<<<<<<<< + * cdef _wait_return_value(self, waited, wait_success) + * cdef _wait(self, timeout=*) + */ +struct __pyx_opt_args_6gevent_19__abstract_linkable_16AbstractLinkable__wait_core { + int __pyx_n; + PyObject *catch; +}; + +/* "gevent/__abstract_linkable.pxd":53 + * cdef _wait_core(self, timeout, catch=*) + * cdef _wait_return_value(self, waited, wait_success) + * cdef _wait(self, timeout=*) # <<<<<<<<<<<<<< + */ +struct __pyx_opt_args_6gevent_19__abstract_linkable_16AbstractLinkable__wait { + int __pyx_n; + PyObject *timeout; +}; +struct __pyx_opt_args_6gevent_6_event_11AsyncResult_get; +struct __pyx_opt_args_6gevent_6_event_11AsyncResult_wait; + +/* "gevent/_event.pxd":23 + * cdef public int _imap_task_index + * + * cpdef get(self, block=*, timeout=*) # <<<<<<<<<<<<<< + * cpdef bint successful(self) + * + */ +struct __pyx_opt_args_6gevent_6_event_11AsyncResult_get { + int __pyx_n; + PyObject *block; + PyObject *timeout; +}; + +/* "gevent/_event.pxd":26 + * cpdef bint successful(self) + * + * cpdef wait(self, timeout=*) # <<<<<<<<<<<<<< + * cpdef bint done(self) + * + */ +struct __pyx_opt_args_6gevent_6_event_11AsyncResult_wait { + int __pyx_n; + PyObject *timeout; +}; +struct __pyx_opt_args_6gevent_6_queue_5Queue_put; +struct __pyx_opt_args_6gevent_6_queue_5Queue_get; +struct __pyx_opt_args_6gevent_6_queue_5Queue_peek; +struct __pyx_opt_args_6gevent_6_queue_7Channel_get; +struct __pyx_opt_args_6gevent_6_queue_12UnboundQueue_put; + +/* "gevent/_queue.pxd":37 + * cpdef bint full(self) + * + * cpdef put(self, item, block=*, timeout=*) # <<<<<<<<<<<<<< + * cpdef put_nowait(self, item) + * + */ +struct __pyx_opt_args_6gevent_6_queue_5Queue_put { + int __pyx_n; + PyObject *block; + PyObject *timeout; +}; + +/* "gevent/_queue.pxd":42 + * cdef __get_or_peek(self, method, block, timeout) + * + * cpdef get(self, block=*, timeout=*) # <<<<<<<<<<<<<< + * cpdef get_nowait(self) + * cpdef peek(self, block=*, timeout=*) + */ +struct __pyx_opt_args_6gevent_6_queue_5Queue_get { + int __pyx_n; + PyObject *block; + PyObject *timeout; +}; + +/* "gevent/_queue.pxd":44 + * cpdef get(self, block=*, timeout=*) + * cpdef get_nowait(self) + * cpdef peek(self, block=*, timeout=*) # <<<<<<<<<<<<<< + * cpdef peek_nowait(self) + * + */ +struct __pyx_opt_args_6gevent_6_queue_5Queue_peek { + int __pyx_n; + PyObject *block; + PyObject *timeout; +}; + +/* "gevent/_queue.pxd":71 + * cdef _event_unlock + * + * cpdef get(self, block=*, timeout=*) # <<<<<<<<<<<<<< + * cpdef get_nowait(self) + * + */ +struct __pyx_opt_args_6gevent_6_queue_7Channel_get { + int __pyx_n; + PyObject *block; + PyObject *timeout; +}; + +/* "src/gevent/queue.py":425 + * self.putters = None # Will never be used. + * + * def put(self, item, block=True, timeout=None): # <<<<<<<<<<<<<< + * self._put(item) + * if self.getters: + */ +struct __pyx_opt_args_6gevent_6_queue_12UnboundQueue_put { + int __pyx_n; + PyObject *block; + PyObject *timeout; +}; + +/* "gevent/__greenlet_primitives.pxd":37 + * return PyGreenlet_Switch(self, NULL, NULL) + * + * cdef class TrackedRawGreenlet(greenlet): # <<<<<<<<<<<<<< + * pass + * + */ +struct __pyx_obj_6gevent_21__greenlet_primitives_TrackedRawGreenlet { + PyGreenlet __pyx_base; +}; + + +/* "gevent/__greenlet_primitives.pxd":40 + * pass + * + * cdef class SwitchOutGreenletWithLoop(TrackedRawGreenlet): # <<<<<<<<<<<<<< + * cdef public loop + * + */ +struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop { + struct __pyx_obj_6gevent_21__greenlet_primitives_TrackedRawGreenlet __pyx_base; + struct __pyx_vtabstruct_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *__pyx_vtab; + PyObject *loop; +}; + + +/* "gevent/__waiter.pxd":33 + * _greenlet_imported = True + * + * cdef class Waiter: # <<<<<<<<<<<<<< + * cdef readonly SwitchOutGreenletWithLoop hub + * cdef readonly greenlet greenlet + */ +struct __pyx_obj_6gevent_8__waiter_Waiter { + PyObject_HEAD + struct __pyx_vtabstruct_6gevent_8__waiter_Waiter *__pyx_vtab; + struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *hub; + PyGreenlet *greenlet; + PyObject *value; + PyObject *_exception; +}; + + +/* "gevent/__waiter.pxd":47 + * @cython.final + * @cython.internal + * cdef class MultipleWaiter(Waiter): # <<<<<<<<<<<<<< + * cdef list _values + */ +struct __pyx_obj_6gevent_8__waiter_MultipleWaiter { + struct __pyx_obj_6gevent_8__waiter_Waiter __pyx_base; + PyObject *_values; +}; + + +/* "gevent/__abstract_linkable.pxd":32 + * cdef void _init() + * + * cdef class AbstractLinkable(object): # <<<<<<<<<<<<<< + * # We declare the __weakref__ here in the base (even though + * # that's not really what we want) as a workaround for a Cython + */ +struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable { + PyObject_HEAD + struct __pyx_vtabstruct_6gevent_19__abstract_linkable_AbstractLinkable *__pyx_vtab; + PyObject *__weakref__; + struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *hub; + PyObject *_notifier; + PyObject *_links; + int _notify_all; +}; + + +/* "gevent/_event.pxd":13 + * cdef Timeout + * + * cdef class Event(AbstractLinkable): # <<<<<<<<<<<<<< + * cdef bint _flag + * + */ +struct __pyx_obj_6gevent_6_event_Event { + struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable __pyx_base; + int _flag; +}; + + +/* "gevent/_event.pxd":16 + * cdef bint _flag + * + * cdef class AsyncResult(AbstractLinkable): # <<<<<<<<<<<<<< + * cdef readonly _value + * cdef readonly tuple _exc_info + */ +struct __pyx_obj_6gevent_6_event_AsyncResult { + struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable __pyx_base; + PyObject *_value; + PyObject *_exc_info; + int _imap_task_index; +}; + + +/* "gevent/_queue.pxd":14 + * @cython.final + * @cython.internal + * cdef class ItemWaiter(Waiter): # <<<<<<<<<<<<<< + * cdef readonly item + * cdef readonly queue + */ +struct __pyx_obj_6gevent_6_queue_ItemWaiter { + struct __pyx_obj_6gevent_8__waiter_Waiter __pyx_base; + PyObject *item; + PyObject *queue; +}; + + +/* "gevent/_queue.pxd":18 + * cdef readonly queue + * + * cdef class Queue: # <<<<<<<<<<<<<< + * cdef __weakref__ + * cdef readonly hub + */ +struct __pyx_obj_6gevent_6_queue_Queue { + PyObject_HEAD + struct __pyx_vtabstruct_6gevent_6_queue_Queue *__pyx_vtab; + PyObject *__weakref__; + PyObject *hub; + PyObject *queue; + PyObject *getters; + PyObject *putters; + PyObject *_event_unlock; + Py_ssize_t _maxsize; +}; + + +/* "gevent/_queue.pxd":50 + * + * @cython.final + * cdef class UnboundQueue(Queue): # <<<<<<<<<<<<<< + * pass + * + */ +struct __pyx_obj_6gevent_6_queue_UnboundQueue { + struct __pyx_obj_6gevent_6_queue_Queue __pyx_base; +}; + + +/* "gevent/_queue.pxd":53 + * pass + * + * cdef class PriorityQueue(Queue): # <<<<<<<<<<<<<< + * pass + * + */ +struct __pyx_obj_6gevent_6_queue_PriorityQueue { + struct __pyx_obj_6gevent_6_queue_Queue __pyx_base; +}; + + +/* "gevent/_queue.pxd":56 + * pass + * + * cdef class LifoQueue(Queue): # <<<<<<<<<<<<<< + * pass + * + */ +struct __pyx_obj_6gevent_6_queue_LifoQueue { + struct __pyx_obj_6gevent_6_queue_Queue __pyx_base; +}; + + +/* "gevent/_queue.pxd":59 + * pass + * + * cdef class JoinableQueue(Queue): # <<<<<<<<<<<<<< + * cdef Event _cond + * cdef readonly int unfinished_tasks + */ +struct __pyx_obj_6gevent_6_queue_JoinableQueue { + struct __pyx_obj_6gevent_6_queue_Queue __pyx_base; + struct __pyx_obj_6gevent_6_event_Event *_cond; + int unfinished_tasks; +}; + + +/* "gevent/_queue.pxd":64 + * + * + * cdef class Channel: # <<<<<<<<<<<<<< + * cdef __weakref__ + * cdef readonly getters + */ +struct __pyx_obj_6gevent_6_queue_Channel { + PyObject_HEAD + struct __pyx_vtabstruct_6gevent_6_queue_Channel *__pyx_vtab; + PyObject *__weakref__; + PyObject *getters; + PyObject *putters; + PyObject *hub; + PyObject *_event_unlock; +}; + + + +/* "gevent/__greenlet_primitives.pxd":40 + * pass + * + * cdef class SwitchOutGreenletWithLoop(TrackedRawGreenlet): # <<<<<<<<<<<<<< + * cdef public loop + * + */ + +struct __pyx_vtabstruct_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop { + PyObject *(*__pyx_switch)(struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *, int __pyx_skip_dispatch); + PyObject *(*switch_out)(struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *, int __pyx_skip_dispatch); +}; +static struct __pyx_vtabstruct_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *__pyx_vtabptr_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop; + + +/* "gevent/__waiter.pxd":33 + * _greenlet_imported = True + * + * cdef class Waiter: # <<<<<<<<<<<<<< + * cdef readonly SwitchOutGreenletWithLoop hub + * cdef readonly greenlet greenlet + */ + +struct __pyx_vtabstruct_6gevent_8__waiter_Waiter { + PyObject *(*get)(struct __pyx_obj_6gevent_8__waiter_Waiter *, int __pyx_skip_dispatch); + PyObject *(*clear)(struct __pyx_obj_6gevent_8__waiter_Waiter *, int __pyx_skip_dispatch); +}; +static struct __pyx_vtabstruct_6gevent_8__waiter_Waiter *__pyx_vtabptr_6gevent_8__waiter_Waiter; + + +/* "gevent/__waiter.pxd":47 + * @cython.final + * @cython.internal + * cdef class MultipleWaiter(Waiter): # <<<<<<<<<<<<<< + * cdef list _values + */ + +struct __pyx_vtabstruct_6gevent_8__waiter_MultipleWaiter { + struct __pyx_vtabstruct_6gevent_8__waiter_Waiter __pyx_base; +}; +static struct __pyx_vtabstruct_6gevent_8__waiter_MultipleWaiter *__pyx_vtabptr_6gevent_8__waiter_MultipleWaiter; + + +/* "gevent/__abstract_linkable.pxd":32 + * cdef void _init() + * + * cdef class AbstractLinkable(object): # <<<<<<<<<<<<<< + * # We declare the __weakref__ here in the base (even though + * # that's not really what we want) as a workaround for a Cython + */ + +struct __pyx_vtabstruct_6gevent_19__abstract_linkable_AbstractLinkable { + PyObject *(*rawlink)(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *, PyObject *, int __pyx_skip_dispatch); + int (*ready)(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *, int __pyx_skip_dispatch); + PyObject *(*unlink)(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *, PyObject *, int __pyx_skip_dispatch); + PyObject *(*_check_and_notify)(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *); + PyObject *(*_notify_links)(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *, int __pyx_skip_dispatch); + PyObject *(*_wait_core)(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *, PyObject *, struct __pyx_opt_args_6gevent_19__abstract_linkable_16AbstractLinkable__wait_core *__pyx_optional_args); + PyObject *(*_wait_return_value)(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *, PyObject *, PyObject *); + PyObject *(*_wait)(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *, struct __pyx_opt_args_6gevent_19__abstract_linkable_16AbstractLinkable__wait *__pyx_optional_args); +}; +static struct __pyx_vtabstruct_6gevent_19__abstract_linkable_AbstractLinkable *__pyx_vtabptr_6gevent_19__abstract_linkable_AbstractLinkable; + + +/* "gevent/_event.pxd":13 + * cdef Timeout + * + * cdef class Event(AbstractLinkable): # <<<<<<<<<<<<<< + * cdef bint _flag + * + */ + +struct __pyx_vtabstruct_6gevent_6_event_Event { + struct __pyx_vtabstruct_6gevent_19__abstract_linkable_AbstractLinkable __pyx_base; +}; +static struct __pyx_vtabstruct_6gevent_6_event_Event *__pyx_vtabptr_6gevent_6_event_Event; + + +/* "gevent/_event.pxd":16 + * cdef bint _flag + * + * cdef class AsyncResult(AbstractLinkable): # <<<<<<<<<<<<<< + * cdef readonly _value + * cdef readonly tuple _exc_info + */ + +struct __pyx_vtabstruct_6gevent_6_event_AsyncResult { + struct __pyx_vtabstruct_6gevent_19__abstract_linkable_AbstractLinkable __pyx_base; + PyObject *(*get)(struct __pyx_obj_6gevent_6_event_AsyncResult *, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_6_event_11AsyncResult_get *__pyx_optional_args); + int (*successful)(struct __pyx_obj_6gevent_6_event_AsyncResult *, int __pyx_skip_dispatch); + PyObject *(*wait)(struct __pyx_obj_6gevent_6_event_AsyncResult *, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_6_event_11AsyncResult_wait *__pyx_optional_args); + int (*done)(struct __pyx_obj_6gevent_6_event_AsyncResult *, int __pyx_skip_dispatch); + int (*cancel)(struct __pyx_obj_6gevent_6_event_AsyncResult *, int __pyx_skip_dispatch); + int (*cancelled)(struct __pyx_obj_6gevent_6_event_AsyncResult *, int __pyx_skip_dispatch); +}; +static struct __pyx_vtabstruct_6gevent_6_event_AsyncResult *__pyx_vtabptr_6gevent_6_event_AsyncResult; + + +/* "src/gevent/queue.py":75 + * locals()['Waiter'] = gevent._waiter.Waiter + * + * class ItemWaiter(Waiter): # pylint:disable=undefined-variable # <<<<<<<<<<<<<< + * # pylint:disable=assigning-non-slot + * __slots__ = ( + */ + +struct __pyx_vtabstruct_6gevent_6_queue_ItemWaiter { + struct __pyx_vtabstruct_6gevent_8__waiter_Waiter __pyx_base; +}; +static struct __pyx_vtabstruct_6gevent_6_queue_ItemWaiter *__pyx_vtabptr_6gevent_6_queue_ItemWaiter; + + +/* "src/gevent/queue.py":93 + * return self.switch(self) + * + * class Queue(object): # <<<<<<<<<<<<<< + * """ + * Create a queue object with a given maximum size. + */ + +struct __pyx_vtabstruct_6gevent_6_queue_Queue { + PyObject *(*_get)(struct __pyx_obj_6gevent_6_queue_Queue *, int __pyx_skip_dispatch); + PyObject *(*_put)(struct __pyx_obj_6gevent_6_queue_Queue *, PyObject *, int __pyx_skip_dispatch); + PyObject *(*_peek)(struct __pyx_obj_6gevent_6_queue_Queue *, int __pyx_skip_dispatch); + Py_ssize_t (*qsize)(struct __pyx_obj_6gevent_6_queue_Queue *, int __pyx_skip_dispatch); + int (*empty)(struct __pyx_obj_6gevent_6_queue_Queue *, int __pyx_skip_dispatch); + int (*full)(struct __pyx_obj_6gevent_6_queue_Queue *, int __pyx_skip_dispatch); + PyObject *(*put)(struct __pyx_obj_6gevent_6_queue_Queue *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_6_queue_5Queue_put *__pyx_optional_args); + PyObject *(*put_nowait)(struct __pyx_obj_6gevent_6_queue_Queue *, PyObject *, int __pyx_skip_dispatch); + PyObject *(*__pyx___get_or_peek)(struct __pyx_obj_6gevent_6_queue_Queue *, PyObject *, PyObject *, PyObject *); + PyObject *(*get)(struct __pyx_obj_6gevent_6_queue_Queue *, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_6_queue_5Queue_get *__pyx_optional_args); + PyObject *(*get_nowait)(struct __pyx_obj_6gevent_6_queue_Queue *, int __pyx_skip_dispatch); + PyObject *(*peek)(struct __pyx_obj_6gevent_6_queue_Queue *, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_6_queue_5Queue_peek *__pyx_optional_args); + PyObject *(*peek_nowait)(struct __pyx_obj_6gevent_6_queue_Queue *, int __pyx_skip_dispatch); + PyObject *(*_schedule_unlock)(struct __pyx_obj_6gevent_6_queue_Queue *); +}; +static struct __pyx_vtabstruct_6gevent_6_queue_Queue *__pyx_vtabptr_6gevent_6_queue_Queue; + + +/* "src/gevent/queue.py":413 + * + * + * class UnboundQueue(Queue): # <<<<<<<<<<<<<< + * # A specialization of Queue that knows it can never + * # be bound. Changing its maxsize has no effect. + */ + +struct __pyx_vtabstruct_6gevent_6_queue_UnboundQueue { + struct __pyx_vtabstruct_6gevent_6_queue_Queue __pyx_base; +}; +static struct __pyx_vtabstruct_6gevent_6_queue_UnboundQueue *__pyx_vtabptr_6gevent_6_queue_UnboundQueue; + + +/* "src/gevent/queue.py":431 + * + * + * class PriorityQueue(Queue): # <<<<<<<<<<<<<< + * '''A subclass of :class:`Queue` that retrieves entries in priority order (lowest first). + * + */ + +struct __pyx_vtabstruct_6gevent_6_queue_PriorityQueue { + struct __pyx_vtabstruct_6gevent_6_queue_Queue __pyx_base; +}; +static struct __pyx_vtabstruct_6gevent_6_queue_PriorityQueue *__pyx_vtabptr_6gevent_6_queue_PriorityQueue; + + +/* "src/gevent/queue.py":456 + * + * + * class LifoQueue(Queue): # <<<<<<<<<<<<<< + * '''A subclass of :class:`Queue` that retrieves most recently added entries first.''' + * + */ + +struct __pyx_vtabstruct_6gevent_6_queue_LifoQueue { + struct __pyx_vtabstruct_6gevent_6_queue_Queue __pyx_base; +}; +static struct __pyx_vtabstruct_6gevent_6_queue_LifoQueue *__pyx_vtabptr_6gevent_6_queue_LifoQueue; + + +/* "src/gevent/queue.py":474 + * + * + * class JoinableQueue(Queue): # <<<<<<<<<<<<<< + * """ + * A subclass of :class:`Queue` that additionally has + */ + +struct __pyx_vtabstruct_6gevent_6_queue_JoinableQueue { + struct __pyx_vtabstruct_6gevent_6_queue_Queue __pyx_base; +}; +static struct __pyx_vtabstruct_6gevent_6_queue_JoinableQueue *__pyx_vtabptr_6gevent_6_queue_JoinableQueue; + + +/* "src/gevent/queue.py":560 + * + * + * class Channel(object): # <<<<<<<<<<<<<< + * + * __slots__ = ( + */ + +struct __pyx_vtabstruct_6gevent_6_queue_Channel { + PyObject *(*get)(struct __pyx_obj_6gevent_6_queue_Channel *, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_6_queue_7Channel_get *__pyx_optional_args); + PyObject *(*get_nowait)(struct __pyx_obj_6gevent_6_queue_Channel *, int __pyx_skip_dispatch); + PyObject *(*_schedule_unlock)(struct __pyx_obj_6gevent_6_queue_Channel *); +}; +static struct __pyx_vtabstruct_6gevent_6_queue_Channel *__pyx_vtabptr_6gevent_6_queue_Channel; + +/* --- Runtime support code (head) --- */ +/* Refnanny.proto */ +#ifndef CYTHON_REFNANNY + #define CYTHON_REFNANNY 0 +#endif +#if CYTHON_REFNANNY + typedef struct { + void (*INCREF)(void*, PyObject*, int); + void (*DECREF)(void*, PyObject*, int); + void (*GOTREF)(void*, PyObject*, int); + void (*GIVEREF)(void*, PyObject*, int); + void* (*SetupContext)(const char*, int, const char*); + void (*FinishContext)(void**); + } __Pyx_RefNannyAPIStruct; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); + #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; +#ifdef WITH_THREAD + #define __Pyx_RefNannySetupContext(name, acquire_gil)\ + if (acquire_gil) {\ + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ + PyGILState_Release(__pyx_gilstate_save);\ + } else {\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ + } +#else + #define __Pyx_RefNannySetupContext(name, acquire_gil)\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) +#endif + #define __Pyx_RefNannyFinishContext()\ + __Pyx_RefNanny->FinishContext(&__pyx_refnanny) + #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0) + #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) + #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) + #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) +#else + #define __Pyx_RefNannyDeclarations + #define __Pyx_RefNannySetupContext(name, acquire_gil) + #define __Pyx_RefNannyFinishContext() + #define __Pyx_INCREF(r) Py_INCREF(r) + #define __Pyx_DECREF(r) Py_DECREF(r) + #define __Pyx_GOTREF(r) + #define __Pyx_GIVEREF(r) + #define __Pyx_XINCREF(r) Py_XINCREF(r) + #define __Pyx_XDECREF(r) Py_XDECREF(r) + #define __Pyx_XGOTREF(r) + #define __Pyx_XGIVEREF(r) +#endif +#define __Pyx_XDECREF_SET(r, v) do {\ + PyObject *tmp = (PyObject *) r;\ + r = v; __Pyx_XDECREF(tmp);\ + } while (0) +#define __Pyx_DECREF_SET(r, v) do {\ + PyObject *tmp = (PyObject *) r;\ + r = v; __Pyx_DECREF(tmp);\ + } while (0) +#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) +#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) + +/* PyObjectGetAttrStr.proto */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); +#else +#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) +#endif + +/* GetBuiltinName.proto */ +static PyObject *__Pyx_GetBuiltinName(PyObject *name); + +/* PyCFunctionFastCall.proto */ +#if CYTHON_FAST_PYCCALL +static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs); +#else +#define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL) +#endif + +/* PyFunctionFastCall.proto */ +#if CYTHON_FAST_PYCALL +#define __Pyx_PyFunction_FastCall(func, args, nargs)\ + __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) +#if 1 || PY_VERSION_HEX < 0x030600B1 +static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs); +#else +#define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs) +#endif +#define __Pyx_BUILD_ASSERT_EXPR(cond)\ + (sizeof(char [1 - 2*!(cond)]) - 1) +#ifndef Py_MEMBER_SIZE +#define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member) +#endif + static size_t __pyx_pyframe_localsplus_offset = 0; + #include "frameobject.h" + #define __Pxy_PyFrame_Initialize_Offsets()\ + ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\ + (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus))) + #define __Pyx_PyFrame_GetLocalsplus(frame)\ + (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset)) +#endif + +/* PyObjectCall.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); +#else +#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) +#endif + +/* PyObjectCall2Args.proto */ +static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2); + +/* PyObjectCallMethO.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); +#endif + +/* PyObjectCallOneArg.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); + +/* GetTopmostException.proto */ +#if CYTHON_USE_EXC_INFO_STACK +static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate); +#endif + +/* PyThreadStateGet.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; +#define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; +#define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type +#else +#define __Pyx_PyThreadState_declare +#define __Pyx_PyThreadState_assign +#define __Pyx_PyErr_Occurred() PyErr_Occurred() +#endif + +/* SaveResetException.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); +#else +#define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb) +#define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb) +#endif + +/* PyErrExceptionMatches.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) +static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); +#else +#define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) +#endif + +/* PyErrFetchRestore.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) +#define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) +#define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) +#define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) +#define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); +static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) +#else +#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) +#endif +#else +#define __Pyx_PyErr_Clear() PyErr_Clear() +#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) +#define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) +#define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb) +#define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) +#endif + +/* RaiseArgTupleInvalid.proto */ +static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, + Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); + +/* RaiseDoubleKeywords.proto */ +static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); + +/* ParseKeywords.proto */ +static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\ + PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\ + const char* function_name); + +/* PyIntCompare.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, long intval, long inplace); + +/* Import.proto */ +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); + +/* GetModuleGlobalName.proto */ +#if CYTHON_USE_DICT_VERSIONS +#define __Pyx_GetModuleGlobalName(var, name) {\ + static PY_UINT64_T __pyx_dict_version = 0;\ + static PyObject *__pyx_dict_cached_value = NULL;\ + (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\ + (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\ + __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ +} +#define __Pyx_GetModuleGlobalNameUncached(var, name) {\ + PY_UINT64_T __pyx_dict_version;\ + PyObject *__pyx_dict_cached_value;\ + (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ +} +static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value); +#else +#define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name) +#define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name) +static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name); +#endif + +/* PyObjectCallNoArg.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); +#else +#define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL) +#endif + +/* GetItemInt.proto */ +#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ + __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\ + (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\ + __Pyx_GetItemInt_Generic(o, to_py_func(i)))) +#define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ + __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ + (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL)) +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, + int wraparound, int boundscheck); +#define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ + __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ + (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL)) +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, + int wraparound, int boundscheck); +static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j); +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, + int is_list, int wraparound, int boundscheck); + +/* ListAppend.proto */ +#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS +static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) { + PyListObject* L = (PyListObject*) list; + Py_ssize_t len = Py_SIZE(list); + if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) { + Py_INCREF(x); + PyList_SET_ITEM(list, len, x); + Py_SIZE(list) = len+1; + return 0; + } + return PyList_Append(list, x); +} +#else +#define __Pyx_PyList_Append(L,x) PyList_Append(L,x) +#endif + +/* PyObjectGetMethod.proto */ +static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method); + +/* PyObjectCallMethod1.proto */ +static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg); + +/* append.proto */ +static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x); + +/* GetAttr.proto */ +static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *); + +/* GetAttr3.proto */ +static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *); + +/* StringJoin.proto */ +#if PY_MAJOR_VERSION < 3 +#define __Pyx_PyString_Join __Pyx_PyBytes_Join +#define __Pyx_PyBaseString_Join(s, v) (PyUnicode_CheckExact(s) ? PyUnicode_Join(s, v) : __Pyx_PyBytes_Join(s, v)) +#else +#define __Pyx_PyString_Join PyUnicode_Join +#define __Pyx_PyBaseString_Join PyUnicode_Join +#endif +#if CYTHON_COMPILING_IN_CPYTHON + #if PY_MAJOR_VERSION < 3 + #define __Pyx_PyBytes_Join _PyString_Join + #else + #define __Pyx_PyBytes_Join _PyBytes_Join + #endif +#else +static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values); +#endif + +/* WriteUnraisableException.proto */ +static void __Pyx_WriteUnraisable(const char *name, int clineno, + int lineno, const char *filename, + int full_traceback, int nogil); + +/* RaiseException.proto */ +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); + +/* GetException.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb) +static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#else +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); +#endif + +/* SwapException.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#else +static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb); +#endif + +/* None.proto */ +static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname); + +/* PyObjectCallMethod0.proto */ +static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name); + +/* pop.proto */ +static CYTHON_INLINE PyObject* __Pyx__PyObject_Pop(PyObject* L); +#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS +static CYTHON_INLINE PyObject* __Pyx_PyList_Pop(PyObject* L); +#define __Pyx_PyObject_Pop(L) (likely(PyList_CheckExact(L)) ?\ + __Pyx_PyList_Pop(L) : __Pyx__PyObject_Pop(L)) +#else +#define __Pyx_PyList_Pop(L) __Pyx__PyObject_Pop(L) +#define __Pyx_PyObject_Pop(L) __Pyx__PyObject_Pop(L) +#endif + +/* UnpackUnboundCMethod.proto */ +typedef struct { + PyObject *type; + PyObject **method_name; + PyCFunction func; + PyObject *method; + int flag; +} __Pyx_CachedCFunction; + +/* CallUnboundCMethod0.proto */ +static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self); +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_CallUnboundCMethod0(cfunc, self)\ + (likely((cfunc)->func) ?\ + (likely((cfunc)->flag == METH_NOARGS) ? (*((cfunc)->func))(self, NULL) :\ + (PY_VERSION_HEX >= 0x030600B1 && likely((cfunc)->flag == METH_FASTCALL) ?\ + (PY_VERSION_HEX >= 0x030700A0 ?\ + (*(__Pyx_PyCFunctionFast)(void*)(PyCFunction)(cfunc)->func)(self, &__pyx_empty_tuple, 0) :\ + (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)(cfunc)->func)(self, &__pyx_empty_tuple, 0, NULL)) :\ + (PY_VERSION_HEX >= 0x030700A0 && (cfunc)->flag == (METH_FASTCALL | METH_KEYWORDS) ?\ + (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)(cfunc)->func)(self, &__pyx_empty_tuple, 0, NULL) :\ + (likely((cfunc)->flag == (METH_VARARGS | METH_KEYWORDS)) ? ((*(PyCFunctionWithKeywords)(void*)(PyCFunction)(cfunc)->func)(self, __pyx_empty_tuple, NULL)) :\ + ((cfunc)->flag == METH_VARARGS ? (*((cfunc)->func))(self, __pyx_empty_tuple) :\ + __Pyx__CallUnboundCMethod0(cfunc, self)))))) :\ + __Pyx__CallUnboundCMethod0(cfunc, self)) +#else +#define __Pyx_CallUnboundCMethod0(cfunc, self) __Pyx__CallUnboundCMethod0(cfunc, self) +#endif + +/* ImportFrom.proto */ +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); + +/* ExtTypeTest.proto */ +static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); + +/* PyIntCompare.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_NeObjC(PyObject *op1, PyObject *op2, long intval, long inplace); + +/* RaiseTooManyValuesToUnpack.proto */ +static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); + +/* RaiseNeedMoreValuesToUnpack.proto */ +static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); + +/* IterFinish.proto */ +static CYTHON_INLINE int __Pyx_IterFinish(void); + +/* UnpackItemEndCheck.proto */ +static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); + +/* CallNextTpDealloc.proto */ +static void __Pyx_call_next_tp_dealloc(PyObject* obj, destructor current_tp_dealloc); + +/* CallNextTpTraverse.proto */ +static int __Pyx_call_next_tp_traverse(PyObject* obj, visitproc v, void *a, traverseproc current_tp_traverse); + +/* CallNextTpClear.proto */ +static void __Pyx_call_next_tp_clear(PyObject* obj, inquiry current_tp_dealloc); + +/* TypeImport.proto */ +#ifndef __PYX_HAVE_RT_ImportType_proto +#define __PYX_HAVE_RT_ImportType_proto +enum __Pyx_ImportType_CheckSize { + __Pyx_ImportType_CheckSize_Error = 0, + __Pyx_ImportType_CheckSize_Warn = 1, + __Pyx_ImportType_CheckSize_Ignore = 2 +}; +static PyTypeObject *__Pyx_ImportType(PyObject* module, const char *module_name, const char *class_name, size_t size, enum __Pyx_ImportType_CheckSize check_size); +#endif + +/* GetVTable.proto */ +static void* __Pyx_GetVtable(PyObject *dict); + +/* PyObject_GenericGetAttrNoDict.proto */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name); +#else +#define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr +#endif + +/* SetVTable.proto */ +static int __Pyx_SetVtable(PyObject *dict, void *vtable); + +/* PyObject_GenericGetAttr.proto */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name); +#else +#define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr +#endif + +/* HasAttr.proto */ +static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *); + +/* FetchCommonType.proto */ +static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); + +/* CythonFunction.proto */ +#define __Pyx_CyFunction_USED 1 +#define __Pyx_CYFUNCTION_STATICMETHOD 0x01 +#define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 +#define __Pyx_CYFUNCTION_CCLASS 0x04 +#define __Pyx_CyFunction_GetClosure(f)\ + (((__pyx_CyFunctionObject *) (f))->func_closure) +#define __Pyx_CyFunction_GetClassObj(f)\ + (((__pyx_CyFunctionObject *) (f))->func_classobj) +#define __Pyx_CyFunction_Defaults(type, f)\ + ((type *)(((__pyx_CyFunctionObject *) (f))->defaults)) +#define __Pyx_CyFunction_SetDefaultsGetter(f, g)\ + ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g) +typedef struct { + PyCFunctionObject func; +#if PY_VERSION_HEX < 0x030500A0 + PyObject *func_weakreflist; +#endif + PyObject *func_dict; + PyObject *func_name; + PyObject *func_qualname; + PyObject *func_doc; + PyObject *func_globals; + PyObject *func_code; + PyObject *func_closure; + PyObject *func_classobj; + void *defaults; + int defaults_pyobjects; + int flags; + PyObject *defaults_tuple; + PyObject *defaults_kwdict; + PyObject *(*defaults_getter)(PyObject *); + PyObject *func_annotations; +} __pyx_CyFunctionObject; +static PyTypeObject *__pyx_CyFunctionType = 0; +#define __Pyx_CyFunction_Check(obj) (__Pyx_TypeCheck(obj, __pyx_CyFunctionType)) +#define __Pyx_CyFunction_NewEx(ml, flags, qualname, self, module, globals, code)\ + __Pyx_CyFunction_New(__pyx_CyFunctionType, ml, flags, qualname, self, module, globals, code) +static PyObject *__Pyx_CyFunction_New(PyTypeObject *, PyMethodDef *ml, + int flags, PyObject* qualname, + PyObject *self, + PyObject *module, PyObject *globals, + PyObject* code); +static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, + size_t size, + int pyobjects); +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, + PyObject *tuple); +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, + PyObject *dict); +static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m, + PyObject *dict); +static int __pyx_CyFunction_init(void); + +/* GetNameInClass.proto */ +#define __Pyx_GetNameInClass(var, nmspace, name) (var) = __Pyx__GetNameInClass(nmspace, name) +static PyObject *__Pyx__GetNameInClass(PyObject *nmspace, PyObject *name); + +/* Globals.proto */ +static PyObject* __Pyx_Globals(void); + +/* CLineInTraceback.proto */ +#ifdef CYTHON_CLINE_IN_TRACEBACK +#define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) +#else +static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line); +#endif + +/* CodeObjectCache.proto */ +typedef struct { + PyCodeObject* code_object; + int code_line; +} __Pyx_CodeObjectCacheEntry; +struct __Pyx_CodeObjectCache { + int count; + int max_count; + __Pyx_CodeObjectCacheEntry* entries; +}; +static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); +static PyCodeObject *__pyx_find_code_object(int code_line); +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); + +/* AddTraceback.proto */ +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename); + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); + +/* CIntFromPy.proto */ +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); + +/* CIntFromPy.proto */ +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); + +/* FastTypeChecks.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) +static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b); +static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type); +static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2); +#else +#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) +#define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) +#define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) +#endif +#define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) + +/* CheckBinaryVersion.proto */ +static int __Pyx_check_binary_version(void); + +/* PyObjectSetAttrStr.proto */ +#if CYTHON_USE_TYPE_SLOTS +#define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o, n, NULL) +static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value); +#else +#define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n) +#define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v) +#endif + +/* VoidPtrExport.proto */ +static int __Pyx_ExportVoidPtr(PyObject *name, void *p, const char *sig); + +/* FunctionExport.proto */ +static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig); + +/* VoidPtrImport.proto */ +static int __Pyx_ImportVoidPtr(PyObject *module, const char *name, void **p, const char *sig); + +/* FunctionImport.proto */ +static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig); + +/* InitStrings.proto */ +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); + +static PyObject *__pyx_f_6gevent_6_queue_5Queue__get(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/ +static PyObject *__pyx_f_6gevent_6_queue_5Queue__peek(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/ +static PyObject *__pyx_f_6gevent_6_queue_5Queue__put(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self, PyObject *__pyx_v_item, int __pyx_skip_dispatch); /* proto*/ +static Py_ssize_t __pyx_f_6gevent_6_queue_5Queue_qsize(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/ +static int __pyx_f_6gevent_6_queue_5Queue_empty(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/ +static int __pyx_f_6gevent_6_queue_5Queue_full(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/ +static PyObject *__pyx_f_6gevent_6_queue_5Queue_put(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self, PyObject *__pyx_v_item, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_6_queue_5Queue_put *__pyx_optional_args); /* proto*/ +static PyObject *__pyx_f_6gevent_6_queue_5Queue_put_nowait(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self, PyObject *__pyx_v_item, int __pyx_skip_dispatch); /* proto*/ +static PyObject *__pyx_f_6gevent_6_queue_5Queue___get_or_peek(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self, PyObject *__pyx_v_method, PyObject *__pyx_v_block, PyObject *__pyx_v_timeout); /* proto*/ +static PyObject *__pyx_f_6gevent_6_queue_5Queue_get(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_6_queue_5Queue_get *__pyx_optional_args); /* proto*/ +static PyObject *__pyx_f_6gevent_6_queue_5Queue_get_nowait(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/ +static PyObject *__pyx_f_6gevent_6_queue_5Queue_peek(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_6_queue_5Queue_peek *__pyx_optional_args); /* proto*/ +static PyObject *__pyx_f_6gevent_6_queue_5Queue_peek_nowait(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/ +static PyObject *__pyx_f_6gevent_6_queue_5Queue__schedule_unlock(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self); /* proto*/ +static PyObject *__pyx_f_6gevent_6_queue_12UnboundQueue_put(struct __pyx_obj_6gevent_6_queue_UnboundQueue *__pyx_v_self, PyObject *__pyx_v_item, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_6_queue_12UnboundQueue_put *__pyx_optional_args); /* proto*/ +static PyObject *__pyx_f_6gevent_6_queue_13PriorityQueue__put(struct __pyx_obj_6gevent_6_queue_PriorityQueue *__pyx_v_self, PyObject *__pyx_v_item, int __pyx_skip_dispatch); /* proto*/ +static PyObject *__pyx_f_6gevent_6_queue_13PriorityQueue__get(struct __pyx_obj_6gevent_6_queue_PriorityQueue *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/ +static PyObject *__pyx_f_6gevent_6_queue_9LifoQueue__put(struct __pyx_obj_6gevent_6_queue_LifoQueue *__pyx_v_self, PyObject *__pyx_v_item, int __pyx_skip_dispatch); /* proto*/ +static PyObject *__pyx_f_6gevent_6_queue_9LifoQueue__get(struct __pyx_obj_6gevent_6_queue_LifoQueue *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/ +static PyObject *__pyx_f_6gevent_6_queue_9LifoQueue__peek(struct __pyx_obj_6gevent_6_queue_LifoQueue *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/ +static PyObject *__pyx_f_6gevent_6_queue_13JoinableQueue__put(struct __pyx_obj_6gevent_6_queue_JoinableQueue *__pyx_v_self, PyObject *__pyx_v_item, int __pyx_skip_dispatch); /* proto*/ +static PyObject *__pyx_f_6gevent_6_queue_7Channel_get(struct __pyx_obj_6gevent_6_queue_Channel *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_6_queue_7Channel_get *__pyx_optional_args); /* proto*/ +static PyObject *__pyx_f_6gevent_6_queue_7Channel_get_nowait(struct __pyx_obj_6gevent_6_queue_Channel *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/ +static PyObject *__pyx_f_6gevent_6_queue_7Channel__schedule_unlock(struct __pyx_obj_6gevent_6_queue_Channel *__pyx_v_self); /* proto*/ + +/* Module declarations from 'cython' */ + +/* Module declarations from 'greenlet' */ + +/* Module declarations from 'gevent.__greenlet_primitives' */ +static PyTypeObject *__pyx_ptype_6gevent_21__greenlet_primitives_greenlet = 0; +static PyTypeObject *__pyx_ptype_6gevent_21__greenlet_primitives_TrackedRawGreenlet = 0; +static PyTypeObject *__pyx_ptype_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop = 0; +static PyObject **__pyx_vp_6gevent_21__greenlet_primitives_get_objects = 0; +#define __pyx_v_6gevent_21__greenlet_primitives_get_objects (*__pyx_vp_6gevent_21__greenlet_primitives_get_objects) +static PyObject **__pyx_vp_6gevent_21__greenlet_primitives_wref = 0; +#define __pyx_v_6gevent_21__greenlet_primitives_wref (*__pyx_vp_6gevent_21__greenlet_primitives_wref) +static PyObject **__pyx_vp_6gevent_21__greenlet_primitives_BlockingSwitchOutError = 0; +#define __pyx_v_6gevent_21__greenlet_primitives_BlockingSwitchOutError (*__pyx_vp_6gevent_21__greenlet_primitives_BlockingSwitchOutError) +static int *__pyx_vp_6gevent_21__greenlet_primitives__greenlet_imported = 0; +#define __pyx_v_6gevent_21__greenlet_primitives__greenlet_imported (*__pyx_vp_6gevent_21__greenlet_primitives__greenlet_imported) + +/* Module declarations from 'gevent.__hub_local' */ +static PyObject **__pyx_vp_6gevent_11__hub_local__threadlocal = 0; +#define __pyx_v_6gevent_11__hub_local__threadlocal (*__pyx_vp_6gevent_11__hub_local__threadlocal) +static struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *(*__pyx_f_6gevent_11__hub_local_get_hub_noargs)(int __pyx_skip_dispatch); /*proto*/ + +/* Module declarations from 'gevent.__waiter' */ +static PyTypeObject *__pyx_ptype_6gevent_8__waiter_greenlet = 0; +static PyTypeObject *__pyx_ptype_6gevent_8__waiter_Waiter = 0; +static PyTypeObject *__pyx_ptype_6gevent_8__waiter_MultipleWaiter = 0; +static PyObject **__pyx_vp_6gevent_8__waiter_sys = 0; +#define __pyx_v_6gevent_8__waiter_sys (*__pyx_vp_6gevent_8__waiter_sys) +static PyObject **__pyx_vp_6gevent_8__waiter_ConcurrentObjectUseError = 0; +#define __pyx_v_6gevent_8__waiter_ConcurrentObjectUseError (*__pyx_vp_6gevent_8__waiter_ConcurrentObjectUseError) +static int *__pyx_vp_6gevent_8__waiter__greenlet_imported = 0; +#define __pyx_v_6gevent_8__waiter__greenlet_imported (*__pyx_vp_6gevent_8__waiter__greenlet_imported) +static PyObject **__pyx_vp_6gevent_8__waiter__NONE = 0; +#define __pyx_v_6gevent_8__waiter__NONE (*__pyx_vp_6gevent_8__waiter__NONE) + +/* Module declarations from 'gevent.__abstract_linkable' */ +static PyTypeObject *__pyx_ptype_6gevent_19__abstract_linkable_greenlet = 0; +static PyTypeObject *__pyx_ptype_6gevent_19__abstract_linkable_AbstractLinkable = 0; +static PyObject **__pyx_vp_6gevent_19__abstract_linkable_InvalidSwitchError = 0; +#define __pyx_v_6gevent_19__abstract_linkable_InvalidSwitchError (*__pyx_vp_6gevent_19__abstract_linkable_InvalidSwitchError) +static PyObject **__pyx_vp_6gevent_19__abstract_linkable_Timeout = 0; +#define __pyx_v_6gevent_19__abstract_linkable_Timeout (*__pyx_vp_6gevent_19__abstract_linkable_Timeout) +static int *__pyx_vp_6gevent_19__abstract_linkable__greenlet_imported = 0; +#define __pyx_v_6gevent_19__abstract_linkable__greenlet_imported (*__pyx_vp_6gevent_19__abstract_linkable__greenlet_imported) + +/* Module declarations from 'gevent._event' */ +static PyTypeObject *__pyx_ptype_6gevent_6_event_Event = 0; +static PyTypeObject *__pyx_ptype_6gevent_6_event_AsyncResult = 0; +static PyObject **__pyx_vp_6gevent_6_event__None = 0; +#define __pyx_v_6gevent_6_event__None (*__pyx_vp_6gevent_6_event__None) +static PyObject **__pyx_vp_6gevent_6_event_reraise = 0; +#define __pyx_v_6gevent_6_event_reraise (*__pyx_vp_6gevent_6_event_reraise) +static PyObject **__pyx_vp_6gevent_6_event_dump_traceback = 0; +#define __pyx_v_6gevent_6_event_dump_traceback (*__pyx_vp_6gevent_6_event_dump_traceback) +static PyObject **__pyx_vp_6gevent_6_event_load_traceback = 0; +#define __pyx_v_6gevent_6_event_load_traceback (*__pyx_vp_6gevent_6_event_load_traceback) +static PyObject **__pyx_vp_6gevent_6_event_Timeout = 0; +#define __pyx_v_6gevent_6_event_Timeout (*__pyx_vp_6gevent_6_event_Timeout) + +/* Module declarations from 'gevent._queue' */ +static PyTypeObject *__pyx_ptype_6gevent_6_queue_ItemWaiter = 0; +static PyTypeObject *__pyx_ptype_6gevent_6_queue_Queue = 0; +static PyTypeObject *__pyx_ptype_6gevent_6_queue_UnboundQueue = 0; +static PyTypeObject *__pyx_ptype_6gevent_6_queue_PriorityQueue = 0; +static PyTypeObject *__pyx_ptype_6gevent_6_queue_LifoQueue = 0; +static PyTypeObject *__pyx_ptype_6gevent_6_queue_JoinableQueue = 0; +static PyTypeObject *__pyx_ptype_6gevent_6_queue_Channel = 0; +static PyObject *__pyx_v_6gevent_6_queue__heappush = 0; +static PyObject *__pyx_v_6gevent_6_queue__heappop = 0; +static PyObject *__pyx_v_6gevent_6_queue__heapify = 0; +static PyObject *__pyx_f_6gevent_6_queue__safe_remove(PyObject *, PyObject *); /*proto*/ +#define __Pyx_MODULE_NAME "gevent._queue" +extern int __pyx_module_is_main_gevent___queue; +int __pyx_module_is_main_gevent___queue = 0; + +/* Implementation of 'gevent._queue' */ +static PyObject *__pyx_builtin_ValueError; +static PyObject *__pyx_builtin_DeprecationWarning; +static PyObject *__pyx_builtin_hex; +static PyObject *__pyx_builtin_id; +static PyObject *__pyx_builtin_StopIteration; +static const char __pyx_k_q[] = "q"; +static const char __pyx_k__2[] = " "; +static const char __pyx_k__3[] = ""; +static const char __pyx_k_id[] = "id"; +static const char __pyx_k_all[] = "__all__"; +static const char __pyx_k_get[] = "_get"; +static const char __pyx_k_hex[] = "hex"; +static const char __pyx_k_hub[] = "hub"; +static const char __pyx_k_pop[] = "pop"; +static const char __pyx_k_put[] = "_put"; +static const char __pyx_k_s_s[] = "<%s%s>"; +static const char __pyx_k_set[] = "set"; +static const char __pyx_k_sys[] = "sys"; +static const char __pyx_k_Full[] = "Full"; +static const char __pyx_k_cond[] = "_cond"; +static const char __pyx_k_copy[] = "copy"; +static const char __pyx_k_full[] = "full"; +static const char __pyx_k_init[] = "__init__"; +static const char __pyx_k_item[] = "item"; +static const char __pyx_k_join[] = "join"; +static const char __pyx_k_loop[] = "loop"; +static const char __pyx_k_main[] = "__main__"; +static const char __pyx_k_name[] = "__name__"; +static const char __pyx_k_next[] = "__next__"; +static const char __pyx_k_peek[] = "_peek"; +static const char __pyx_k_self[] = "self"; +static const char __pyx_k_test[] = "__test__"; +static const char __pyx_k_wait[] = "wait"; +static const char __pyx_k_warn[] = "warn"; +static const char __pyx_k_Empty[] = "Empty"; +static const char __pyx_k_Event[] = "Event"; +static const char __pyx_k_Queue[] = "Queue"; +static const char __pyx_k_block[] = "block"; +static const char __pyx_k_clear[] = "clear"; +static const char __pyx_k_close[] = "close"; +static const char __pyx_k_deque[] = "deque"; +static const char __pyx_k_empty[] = "empty"; +static const char __pyx_k_get_2[] = "get"; +static const char __pyx_k_heapq[] = "heapq"; +static const char __pyx_k_items[] = "items"; +static const char __pyx_k_put_2[] = "put"; +static const char __pyx_k_qsize[] = "qsize"; +static const char __pyx_k_queue[] = "queue"; +static const char __pyx_k_s_s_2[] = "<%s %s>"; +static const char __pyx_k_slots[] = "__slots__"; +static const char __pyx_k_throw[] = "throw"; +static const char __pyx_k_Waiter[] = "Waiter"; +static const char __pyx_k_append[] = "append"; +static const char __pyx_k_cancel[] = "cancel"; +static const char __pyx_k_format[] = "_format"; +static const char __pyx_k_getter[] = "getter"; +static const char __pyx_k_gevent[] = "gevent"; +static const char __pyx_k_import[] = "__import__"; +static const char __pyx_k_next_2[] = "next"; +static const char __pyx_k_peek_2[] = "peek"; +static const char __pyx_k_putter[] = "putter"; +static const char __pyx_k_remove[] = "remove"; +static const char __pyx_k_repeat[] = "repeat"; +static const char __pyx_k_result[] = "result"; +static const char __pyx_k_switch[] = "switch"; +static const char __pyx_k_unlock[] = "_unlock"; +static const char __pyx_k_waiter[] = "_waiter"; +static const char __pyx_k_Channel[] = "Channel"; +static const char __pyx_k_Timeout[] = "Timeout"; +static const char __pyx_k_get_hub[] = "get_hub"; +static const char __pyx_k_getters[] = "getters"; +static const char __pyx_k_heapify[] = "_heapify"; +static const char __pyx_k_heappop[] = "_heappop"; +static const char __pyx_k_imports[] = "__imports__"; +static const char __pyx_k_maxsize[] = "maxsize"; +static const char __pyx_k_popleft[] = "popleft"; +static const char __pyx_k_putters[] = "putters"; +static const char __pyx_k_queue_2[] = "__queue__"; +static const char __pyx_k_queue_r[] = "queue=%r"; +static const char __pyx_k_timeout[] = "timeout"; +static const char __pyx_k_weakref[] = "__weakref__"; +static const char __pyx_k_exc_info[] = "exc_info"; +static const char __pyx_k_greenlet[] = "greenlet"; +static const char __pyx_k_heappush[] = "_heappush"; +static const char __pyx_k_pyx_capi[] = "__pyx_capi__"; +static const char __pyx_k_s_at_s_s[] = "<%s at %s%s>"; +static const char __pyx_k_waiter_2[] = "waiter"; +static const char __pyx_k_warnings[] = "warnings"; +static const char __pyx_k_LifoQueue[] = "LifoQueue"; +static const char __pyx_k_Queue_get[] = "Queue.get"; +static const char __pyx_k_Queue_put[] = "Queue.put"; +static const char __pyx_k_getters_s[] = "getters[%s]"; +static const char __pyx_k_heapify_2[] = "heapify"; +static const char __pyx_k_heappop_2[] = "heappop"; +static const char __pyx_k_maxsize_2[] = "_maxsize"; +static const char __pyx_k_maxsize_r[] = "maxsize=%r"; +static const char __pyx_k_putters_s[] = "putters[%s]"; +static const char __pyx_k_task_done[] = "task_done"; +static const char __pyx_k_ItemWaiter[] = "ItemWaiter"; +static const char __pyx_k_Queue__get[] = "Queue._get"; +static const char __pyx_k_Queue__put[] = "Queue._put"; +static const char __pyx_k_Queue_copy[] = "Queue.copy"; +static const char __pyx_k_Queue_full[] = "Queue.full"; +static const char __pyx_k_Queue_peek[] = "Queue.peek"; +static const char __pyx_k_ValueError[] = "ValueError"; +static const char __pyx_k_extensions[] = "__extensions__"; +static const char __pyx_k_get_nowait[] = "get_nowait"; +static const char __pyx_k_getcurrent[] = "getcurrent"; +static const char __pyx_k_heappush_2[] = "heappush"; +static const char __pyx_k_implements[] = "__implements__"; +static const char __pyx_k_put_nowait[] = "put_nowait"; +static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__"; +static const char __pyx_k_s_at_s_s_2[] = "<%s at %s %s>"; +static const char __pyx_k_stacklevel[] = "stacklevel"; +static const char __pyx_k_warn_depth[] = "_warn_depth"; +static const char __pyx_k_Channel_get[] = "Channel.get"; +static const char __pyx_k_Channel_put[] = "Channel.put"; +static const char __pyx_k_Queue__peek[] = "Queue._peek"; +static const char __pyx_k_Queue_empty[] = "Queue.empty"; +static const char __pyx_k_Queue_qsize[] = "Queue.qsize"; +static const char __pyx_k_SimpleQueue[] = "SimpleQueue"; +static const char __pyx_k_collections[] = "collections"; +static const char __pyx_k_getters_s_2[] = " getters[%s]"; +static const char __pyx_k_peek_nowait[] = "peek_nowait"; +static const char __pyx_k_putters_s_2[] = " putters[%s]"; +static const char __pyx_k_Channel_full[] = "Channel.full"; +static const char __pyx_k_UnboundQueue[] = "UnboundQueue"; +static const char __pyx_k_create_queue[] = "_create_queue"; +static const char __pyx_k_event_unlock[] = "_event_unlock"; +static const char __pyx_k_gevent__util[] = "gevent._util"; +static const char __pyx_k_gevent_event[] = "gevent.event"; +static const char __pyx_k_run_callback[] = "run_callback"; +static const char __pyx_k_version_info[] = "version_info"; +static const char __pyx_k_Channel_empty[] = "Channel.empty"; +static const char __pyx_k_Channel_qsize[] = "Channel.qsize"; +static const char __pyx_k_JoinableQueue[] = "JoinableQueue"; +static const char __pyx_k_PriorityQueue[] = "PriorityQueue"; +static const char __pyx_k_PySimpleQueue[] = "_PySimpleQueue"; +static const char __pyx_k_Queue__format[] = "Queue._format"; +static const char __pyx_k_Queue__unlock[] = "Queue._unlock"; +static const char __pyx_k_StopIteration[] = "StopIteration"; +static const char __pyx_k_gevent__queue[] = "gevent._queue"; +static const char __pyx_k_LifoQueue__get[] = "LifoQueue._get"; +static const char __pyx_k_LifoQueue__put[] = "LifoQueue._put"; +static const char __pyx_k_get_hub_noargs[] = "get_hub_noargs"; +static const char __pyx_k_gevent__waiter[] = "gevent._waiter"; +static const char __pyx_k_gevent_timeout[] = "gevent.timeout"; +static const char __pyx_k_import_c_accel[] = "import_c_accel"; +static const char __pyx_k_put_and_switch[] = "put_and_switch"; +static const char __pyx_k_Channel__format[] = "Channel._format"; +static const char __pyx_k_Channel__unlock[] = "Channel._unlock"; +static const char __pyx_k_LifoQueue__peek[] = "LifoQueue._peek"; +static const char __pyx_k_tasks_s__cond_s[] = " tasks=%s _cond=%s"; +static const char __pyx_k_Queue_get_nowait[] = "Queue.get_nowait"; +static const char __pyx_k_Queue_put_nowait[] = "Queue.put_nowait"; +static const char __pyx_k_UnboundQueue_put[] = "UnboundQueue.put"; +static const char __pyx_k_unfinished_tasks[] = "unfinished_tasks"; +static const char __pyx_k_Queue_peek_nowait[] = "Queue.peek_nowait"; +static const char __pyx_k_gevent__hub_local[] = "gevent._hub_local"; +static const char __pyx_k_gevent_exceptions[] = "gevent.exceptions"; +static const char __pyx_k_Channel_get_nowait[] = "Channel.get_nowait"; +static const char __pyx_k_Channel_put_nowait[] = "Channel.put_nowait"; +static const char __pyx_k_DeprecationWarning[] = "DeprecationWarning"; +static const char __pyx_k_InvalidSwitchError[] = "InvalidSwitchError"; +static const char __pyx_k_JoinableQueue__put[] = "JoinableQueue._put"; +static const char __pyx_k_JoinableQueue_copy[] = "JoinableQueue.copy"; +static const char __pyx_k_JoinableQueue_join[] = "JoinableQueue.join"; +static const char __pyx_k_PriorityQueue__get[] = "PriorityQueue._get"; +static const char __pyx_k_PriorityQueue__put[] = "PriorityQueue._put"; +static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; +static const char __pyx_k_start_new_or_dummy[] = "_start_new_or_dummy"; +static const char __pyx_k_Queue__create_queue[] = "Queue._create_queue"; +static const char __pyx_k_src_gevent_queue_py[] = "src\\gevent\\queue.py"; +static const char __pyx_k_JoinableQueue__format[] = "JoinableQueue._format"; +static const char __pyx_k_JoinableQueue_task_done[] = "JoinableQueue.task_done"; +static const char __pyx_k_LifoQueue__create_queue[] = "LifoQueue._create_queue"; +static const char __pyx_k_ItemWaiter_put_and_switch[] = "ItemWaiter.put_and_switch"; +static const char __pyx_k_PriorityQueue__create_queue[] = "PriorityQueue._create_queue"; +static const char __pyx_k_UnboundQueue_has_no_maxsize[] = "UnboundQueue has no maxsize"; +static const char __pyx_k_Channels_have_a_maxsize_of_1[] = "Channels have a maxsize of 1"; +static const char __pyx_k_Invalid_switch_into_Channel_put[] = "Invalid switch into Channel.put: %r"; +static const char __pyx_k_Invalid_switch_into_Queue_get_r[] = "Invalid switch into Queue.get: %r"; +static const char __pyx_k_Invalid_switch_into_Queue_put_r[] = "Invalid switch into Queue.put: %r"; +static const char __pyx_k_Queue_0_now_equivalent_to_Queue[] = "Queue(0) now equivalent to Queue(None); if you want a channel, use Channel"; +static const char __pyx_k_Synchronized_queues_The_mod_gev[] = "\nSynchronized queues.\n\nThe :mod:`gevent.queue` module implements multi-producer, multi-consumer queues\nthat work across greenlets, with the API similar to the classes found in the\nstandard :mod:`Queue` and :class:`multiprocessing ` modules.\n\nThe classes in this module implement the iterator protocol. Iterating\nover a queue means repeatedly calling :meth:`get ` until\n:meth:`get ` returns ``StopIteration`` (specifically that\nclass, not an instance or subclass).\n\n >>> queue = gevent.queue.Queue()\n >>> queue.put(1)\n >>> queue.put(2)\n >>> queue.put(StopIteration)\n >>> for item in queue:\n ... print(item)\n 1\n 2\n\n.. versionchanged:: 1.0\n ``Queue(0)`` now means queue of infinite size, not a channel. A :exc:`DeprecationWarning`\n will be issued with this argument.\n"; +static const char __pyx_k_task_done_called_too_many_times[] = "task_done() called too many times"; +static PyObject *__pyx_n_s_Channel; +static PyObject *__pyx_n_s_Channel__format; +static PyObject *__pyx_n_s_Channel__unlock; +static PyObject *__pyx_n_s_Channel_empty; +static PyObject *__pyx_n_s_Channel_full; +static PyObject *__pyx_n_s_Channel_get; +static PyObject *__pyx_n_s_Channel_get_nowait; +static PyObject *__pyx_n_s_Channel_put; +static PyObject *__pyx_n_s_Channel_put_nowait; +static PyObject *__pyx_n_s_Channel_qsize; +static PyObject *__pyx_kp_s_Channels_have_a_maxsize_of_1; +static PyObject *__pyx_n_s_DeprecationWarning; +static PyObject *__pyx_n_s_Empty; +static PyObject *__pyx_n_s_Event; +static PyObject *__pyx_n_s_Full; +static PyObject *__pyx_n_s_InvalidSwitchError; +static PyObject *__pyx_kp_s_Invalid_switch_into_Channel_put; +static PyObject *__pyx_kp_s_Invalid_switch_into_Queue_get_r; +static PyObject *__pyx_kp_s_Invalid_switch_into_Queue_put_r; +static PyObject *__pyx_n_s_ItemWaiter; +static PyObject *__pyx_n_s_ItemWaiter_put_and_switch; +static PyObject *__pyx_n_s_JoinableQueue; +static PyObject *__pyx_n_s_JoinableQueue__format; +static PyObject *__pyx_n_s_JoinableQueue__put; +static PyObject *__pyx_n_s_JoinableQueue_copy; +static PyObject *__pyx_n_s_JoinableQueue_join; +static PyObject *__pyx_n_s_JoinableQueue_task_done; +static PyObject *__pyx_n_s_LifoQueue; +static PyObject *__pyx_n_s_LifoQueue__create_queue; +static PyObject *__pyx_n_s_LifoQueue__get; +static PyObject *__pyx_n_s_LifoQueue__peek; +static PyObject *__pyx_n_s_LifoQueue__put; +static PyObject *__pyx_n_s_PriorityQueue; +static PyObject *__pyx_n_s_PriorityQueue__create_queue; +static PyObject *__pyx_n_s_PriorityQueue__get; +static PyObject *__pyx_n_s_PriorityQueue__put; +static PyObject *__pyx_n_s_PySimpleQueue; +static PyObject *__pyx_n_s_Queue; +static PyObject *__pyx_kp_s_Queue_0_now_equivalent_to_Queue; +static PyObject *__pyx_n_s_Queue__create_queue; +static PyObject *__pyx_n_s_Queue__format; +static PyObject *__pyx_n_s_Queue__get; +static PyObject *__pyx_n_s_Queue__peek; +static PyObject *__pyx_n_s_Queue__put; +static PyObject *__pyx_n_s_Queue__unlock; +static PyObject *__pyx_n_s_Queue_copy; +static PyObject *__pyx_n_s_Queue_empty; +static PyObject *__pyx_n_s_Queue_full; +static PyObject *__pyx_n_s_Queue_get; +static PyObject *__pyx_n_s_Queue_get_nowait; +static PyObject *__pyx_n_s_Queue_peek; +static PyObject *__pyx_n_s_Queue_peek_nowait; +static PyObject *__pyx_n_s_Queue_put; +static PyObject *__pyx_n_s_Queue_put_nowait; +static PyObject *__pyx_n_s_Queue_qsize; +static PyObject *__pyx_n_s_SimpleQueue; +static PyObject *__pyx_n_s_StopIteration; +static PyObject *__pyx_n_s_Timeout; +static PyObject *__pyx_n_s_UnboundQueue; +static PyObject *__pyx_kp_s_UnboundQueue_has_no_maxsize; +static PyObject *__pyx_n_s_UnboundQueue_put; +static PyObject *__pyx_n_s_ValueError; +static PyObject *__pyx_n_s_Waiter; +static PyObject *__pyx_kp_s__2; +static PyObject *__pyx_kp_s__3; +static PyObject *__pyx_n_s_all; +static PyObject *__pyx_n_s_append; +static PyObject *__pyx_n_s_block; +static PyObject *__pyx_n_s_cancel; +static PyObject *__pyx_n_s_clear; +static PyObject *__pyx_n_s_cline_in_traceback; +static PyObject *__pyx_n_s_close; +static PyObject *__pyx_n_s_collections; +static PyObject *__pyx_n_s_cond; +static PyObject *__pyx_n_s_copy; +static PyObject *__pyx_n_s_create_queue; +static PyObject *__pyx_n_s_deque; +static PyObject *__pyx_n_s_empty; +static PyObject *__pyx_n_s_event_unlock; +static PyObject *__pyx_n_s_exc_info; +static PyObject *__pyx_n_s_extensions; +static PyObject *__pyx_n_s_format; +static PyObject *__pyx_n_s_full; +static PyObject *__pyx_n_s_get; +static PyObject *__pyx_n_s_get_2; +static PyObject *__pyx_n_s_get_hub; +static PyObject *__pyx_n_s_get_hub_noargs; +static PyObject *__pyx_n_s_get_nowait; +static PyObject *__pyx_n_s_getcurrent; +static PyObject *__pyx_n_s_getter; +static PyObject *__pyx_n_s_getters; +static PyObject *__pyx_kp_s_getters_s; +static PyObject *__pyx_kp_s_getters_s_2; +static PyObject *__pyx_n_s_gevent; +static PyObject *__pyx_n_s_gevent__hub_local; +static PyObject *__pyx_n_s_gevent__queue; +static PyObject *__pyx_n_s_gevent__util; +static PyObject *__pyx_n_s_gevent__waiter; +static PyObject *__pyx_n_s_gevent_event; +static PyObject *__pyx_n_s_gevent_exceptions; +static PyObject *__pyx_n_s_gevent_timeout; +static PyObject *__pyx_n_s_greenlet; +static PyObject *__pyx_n_s_heapify; +static PyObject *__pyx_n_s_heapify_2; +static PyObject *__pyx_n_s_heappop; +static PyObject *__pyx_n_s_heappop_2; +static PyObject *__pyx_n_s_heappush; +static PyObject *__pyx_n_s_heappush_2; +static PyObject *__pyx_n_s_heapq; +static PyObject *__pyx_n_s_hex; +static PyObject *__pyx_n_s_hub; +static PyObject *__pyx_n_s_id; +static PyObject *__pyx_n_s_implements; +static PyObject *__pyx_n_s_import; +static PyObject *__pyx_n_s_import_c_accel; +static PyObject *__pyx_n_s_imports; +static PyObject *__pyx_n_s_init; +static PyObject *__pyx_n_s_item; +static PyObject *__pyx_n_s_items; +static PyObject *__pyx_n_s_join; +static PyObject *__pyx_n_s_loop; +static PyObject *__pyx_n_s_main; +static PyObject *__pyx_n_s_maxsize; +static PyObject *__pyx_n_s_maxsize_2; +static PyObject *__pyx_kp_s_maxsize_r; +static PyObject *__pyx_n_s_name; +static PyObject *__pyx_n_s_next; +static PyObject *__pyx_n_s_next_2; +static PyObject *__pyx_n_s_peek; +static PyObject *__pyx_n_s_peek_2; +static PyObject *__pyx_n_s_peek_nowait; +static PyObject *__pyx_n_s_pop; +static PyObject *__pyx_n_s_popleft; +static PyObject *__pyx_n_s_put; +static PyObject *__pyx_n_s_put_2; +static PyObject *__pyx_n_s_put_and_switch; +static PyObject *__pyx_n_s_put_nowait; +static PyObject *__pyx_n_s_putter; +static PyObject *__pyx_n_s_putters; +static PyObject *__pyx_kp_s_putters_s; +static PyObject *__pyx_kp_s_putters_s_2; +static PyObject *__pyx_n_s_pyx_capi; +static PyObject *__pyx_n_s_pyx_vtable; +static PyObject *__pyx_n_s_q; +static PyObject *__pyx_n_s_qsize; +static PyObject *__pyx_n_s_queue; +static PyObject *__pyx_n_s_queue_2; +static PyObject *__pyx_kp_s_queue_r; +static PyObject *__pyx_n_s_remove; +static PyObject *__pyx_n_s_repeat; +static PyObject *__pyx_n_s_result; +static PyObject *__pyx_n_s_run_callback; +static PyObject *__pyx_kp_s_s_at_s_s; +static PyObject *__pyx_kp_s_s_at_s_s_2; +static PyObject *__pyx_kp_s_s_s; +static PyObject *__pyx_kp_s_s_s_2; +static PyObject *__pyx_n_s_self; +static PyObject *__pyx_n_s_set; +static PyObject *__pyx_n_s_slots; +static PyObject *__pyx_kp_s_src_gevent_queue_py; +static PyObject *__pyx_n_s_stacklevel; +static PyObject *__pyx_n_s_start_new_or_dummy; +static PyObject *__pyx_n_s_switch; +static PyObject *__pyx_n_s_sys; +static PyObject *__pyx_n_s_task_done; +static PyObject *__pyx_kp_s_task_done_called_too_many_times; +static PyObject *__pyx_kp_s_tasks_s__cond_s; +static PyObject *__pyx_n_s_test; +static PyObject *__pyx_n_s_throw; +static PyObject *__pyx_n_s_timeout; +static PyObject *__pyx_n_s_unfinished_tasks; +static PyObject *__pyx_n_s_unlock; +static PyObject *__pyx_n_s_version_info; +static PyObject *__pyx_n_s_wait; +static PyObject *__pyx_n_s_waiter; +static PyObject *__pyx_n_s_waiter_2; +static PyObject *__pyx_n_s_warn; +static PyObject *__pyx_n_s_warn_depth; +static PyObject *__pyx_n_s_warnings; +static PyObject *__pyx_n_s_weakref; +static int __pyx_pf_6gevent_6_queue_10ItemWaiter___init__(struct __pyx_obj_6gevent_6_queue_ItemWaiter *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_queue); /* proto */ +static PyObject *__pyx_pf_6gevent_6_queue_10ItemWaiter_2put_and_switch(struct __pyx_obj_6gevent_6_queue_ItemWaiter *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_6_queue_10ItemWaiter_4item___get__(struct __pyx_obj_6gevent_6_queue_ItemWaiter *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_6_queue_10ItemWaiter_5queue___get__(struct __pyx_obj_6gevent_6_queue_ItemWaiter *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_6_queue_5Queue___init__(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self, PyObject *__pyx_v_maxsize, PyObject *__pyx_v_items, PyObject *__pyx_v__warn_depth); /* proto */ +static PyObject *__pyx_pf_6gevent_6_queue_5Queue_7maxsize___get__(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_6_queue_5Queue_7maxsize_2__set__(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self, PyObject *__pyx_v_nv); /* proto */ +static PyObject *__pyx_pf_6gevent_6_queue_5Queue_2copy(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_6_queue_5Queue_4_create_queue(CYTHON_UNUSED struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self, PyObject *__pyx_v_items); /* proto */ +static PyObject *__pyx_pf_6gevent_6_queue_5Queue_6_get(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_6_queue_5Queue_8_peek(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_6_queue_5Queue_10_put(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self, PyObject *__pyx_v_item); /* proto */ +static PyObject *__pyx_pf_6gevent_6_queue_5Queue_12__repr__(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_6_queue_5Queue_14__str__(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_6_queue_5Queue_16_format(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_6_queue_5Queue_18qsize(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self); /* proto */ +static Py_ssize_t __pyx_pf_6gevent_6_queue_5Queue_20__len__(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_6_queue_5Queue_22__bool__(CYTHON_UNUSED struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_6_queue_5Queue_24__nonzero__(CYTHON_UNUSED struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_6_queue_5Queue_26empty(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_6_queue_5Queue_28full(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_6_queue_5Queue_30put(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_block, PyObject *__pyx_v_timeout); /* proto */ +static PyObject *__pyx_pf_6gevent_6_queue_5Queue_32put_nowait(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self, PyObject *__pyx_v_item); /* proto */ +static PyObject *__pyx_pf_6gevent_6_queue_5Queue_34get(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self, PyObject *__pyx_v_block, PyObject *__pyx_v_timeout); /* proto */ +static PyObject *__pyx_pf_6gevent_6_queue_5Queue_36get_nowait(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_6_queue_5Queue_38peek(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self, PyObject *__pyx_v_block, PyObject *__pyx_v_timeout); /* proto */ +static PyObject *__pyx_pf_6gevent_6_queue_5Queue_40peek_nowait(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_6_queue_5Queue_42_unlock(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_6_queue_5Queue_44__iter__(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_6_queue_5Queue_46__next__(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_6_queue_5Queue_3hub___get__(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_6_queue_5Queue_5queue___get__(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_6_queue_12UnboundQueue___init__(struct __pyx_obj_6gevent_6_queue_UnboundQueue *__pyx_v_self, PyObject *__pyx_v_maxsize, PyObject *__pyx_v_items); /* proto */ +static PyObject *__pyx_pf_6gevent_6_queue_12UnboundQueue_2put(struct __pyx_obj_6gevent_6_queue_UnboundQueue *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_block, PyObject *__pyx_v_timeout); /* proto */ +static PyObject *__pyx_pf_6gevent_6_queue_13PriorityQueue__create_queue(CYTHON_UNUSED struct __pyx_obj_6gevent_6_queue_PriorityQueue *__pyx_v_self, PyObject *__pyx_v_items); /* proto */ +static PyObject *__pyx_pf_6gevent_6_queue_13PriorityQueue_2_put(struct __pyx_obj_6gevent_6_queue_PriorityQueue *__pyx_v_self, PyObject *__pyx_v_item); /* proto */ +static PyObject *__pyx_pf_6gevent_6_queue_13PriorityQueue_4_get(struct __pyx_obj_6gevent_6_queue_PriorityQueue *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_6_queue_9LifoQueue__create_queue(CYTHON_UNUSED struct __pyx_obj_6gevent_6_queue_LifoQueue *__pyx_v_self, PyObject *__pyx_v_items); /* proto */ +static PyObject *__pyx_pf_6gevent_6_queue_9LifoQueue_2_put(struct __pyx_obj_6gevent_6_queue_LifoQueue *__pyx_v_self, PyObject *__pyx_v_item); /* proto */ +static PyObject *__pyx_pf_6gevent_6_queue_9LifoQueue_4_get(struct __pyx_obj_6gevent_6_queue_LifoQueue *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_6_queue_9LifoQueue_6_peek(struct __pyx_obj_6gevent_6_queue_LifoQueue *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_6_queue_13JoinableQueue___init__(struct __pyx_obj_6gevent_6_queue_JoinableQueue *__pyx_v_self, PyObject *__pyx_v_maxsize, PyObject *__pyx_v_items, PyObject *__pyx_v_unfinished_tasks); /* proto */ +static PyObject *__pyx_pf_6gevent_6_queue_13JoinableQueue_2copy(struct __pyx_obj_6gevent_6_queue_JoinableQueue *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_6_queue_13JoinableQueue_4_format(struct __pyx_obj_6gevent_6_queue_JoinableQueue *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_6_queue_13JoinableQueue_6_put(struct __pyx_obj_6gevent_6_queue_JoinableQueue *__pyx_v_self, PyObject *__pyx_v_item); /* proto */ +static PyObject *__pyx_pf_6gevent_6_queue_13JoinableQueue_8task_done(struct __pyx_obj_6gevent_6_queue_JoinableQueue *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_6_queue_13JoinableQueue_10join(struct __pyx_obj_6gevent_6_queue_JoinableQueue *__pyx_v_self, PyObject *__pyx_v_timeout); /* proto */ +static PyObject *__pyx_pf_6gevent_6_queue_13JoinableQueue_16unfinished_tasks___get__(struct __pyx_obj_6gevent_6_queue_JoinableQueue *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_6_queue_7Channel___init__(struct __pyx_obj_6gevent_6_queue_Channel *__pyx_v_self, PyObject *__pyx_v_maxsize); /* proto */ +static PyObject *__pyx_pf_6gevent_6_queue_7Channel_2__repr__(struct __pyx_obj_6gevent_6_queue_Channel *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_6_queue_7Channel_4__str__(struct __pyx_obj_6gevent_6_queue_Channel *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_6_queue_7Channel_6_format(struct __pyx_obj_6gevent_6_queue_Channel *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_6_queue_7Channel_7balance___get__(struct __pyx_obj_6gevent_6_queue_Channel *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_6_queue_7Channel_8qsize(CYTHON_UNUSED struct __pyx_obj_6gevent_6_queue_Channel *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_6_queue_7Channel_10empty(CYTHON_UNUSED struct __pyx_obj_6gevent_6_queue_Channel *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_6_queue_7Channel_12full(CYTHON_UNUSED struct __pyx_obj_6gevent_6_queue_Channel *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_6_queue_7Channel_14put(struct __pyx_obj_6gevent_6_queue_Channel *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_block, PyObject *__pyx_v_timeout); /* proto */ +static PyObject *__pyx_pf_6gevent_6_queue_7Channel_16put_nowait(struct __pyx_obj_6gevent_6_queue_Channel *__pyx_v_self, PyObject *__pyx_v_item); /* proto */ +static PyObject *__pyx_pf_6gevent_6_queue_7Channel_18get(struct __pyx_obj_6gevent_6_queue_Channel *__pyx_v_self, PyObject *__pyx_v_block, PyObject *__pyx_v_timeout); /* proto */ +static PyObject *__pyx_pf_6gevent_6_queue_7Channel_20get_nowait(struct __pyx_obj_6gevent_6_queue_Channel *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_6_queue_7Channel_22_unlock(struct __pyx_obj_6gevent_6_queue_Channel *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_6_queue_7Channel_24__iter__(struct __pyx_obj_6gevent_6_queue_Channel *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_6_queue_7Channel_26__next__(struct __pyx_obj_6gevent_6_queue_Channel *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_6_queue_7Channel_7getters___get__(struct __pyx_obj_6gevent_6_queue_Channel *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_6_queue_7Channel_7putters___get__(struct __pyx_obj_6gevent_6_queue_Channel *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_6_queue_7Channel_3hub___get__(struct __pyx_obj_6gevent_6_queue_Channel *__pyx_v_self); /* proto */ +static PyObject *__pyx_tp_new_6gevent_6_queue_ItemWaiter(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6gevent_6_queue_Queue(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6gevent_6_queue_UnboundQueue(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6gevent_6_queue_PriorityQueue(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6gevent_6_queue_LifoQueue(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6gevent_6_queue_JoinableQueue(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6gevent_6_queue_Channel(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static __Pyx_CachedCFunction __pyx_umethod_PyList_Type_pop = {0, &__pyx_n_s_pop, 0, 0, 0}; +static PyObject *__pyx_int_0; +static PyObject *__pyx_int_1; +static PyObject *__pyx_int_2; +static PyObject *__pyx_int_3; +static PyObject *__pyx_tuple_; +static PyObject *__pyx_tuple__4; +static PyObject *__pyx_tuple__5; +static PyObject *__pyx_tuple__6; +static PyObject *__pyx_tuple__7; +static PyObject *__pyx_tuple__8; +static PyObject *__pyx_tuple__10; +static PyObject *__pyx_tuple__11; +static PyObject *__pyx_tuple__13; +static PyObject *__pyx_tuple__15; +static PyObject *__pyx_tuple__17; +static PyObject *__pyx_tuple__19; +static PyObject *__pyx_tuple__21; +static PyObject *__pyx_tuple__23; +static PyObject *__pyx_tuple__25; +static PyObject *__pyx_tuple__27; +static PyObject *__pyx_tuple__29; +static PyObject *__pyx_tuple__31; +static PyObject *__pyx_tuple__33; +static PyObject *__pyx_tuple__35; +static PyObject *__pyx_tuple__37; +static PyObject *__pyx_tuple__39; +static PyObject *__pyx_tuple__41; +static PyObject *__pyx_tuple__43; +static PyObject *__pyx_tuple__45; +static PyObject *__pyx_tuple__47; +static PyObject *__pyx_tuple__49; +static PyObject *__pyx_tuple__51; +static PyObject *__pyx_tuple__53; +static PyObject *__pyx_tuple__55; +static PyObject *__pyx_tuple__57; +static PyObject *__pyx_tuple__59; +static PyObject *__pyx_tuple__60; +static PyObject *__pyx_tuple__62; +static PyObject *__pyx_tuple__64; +static PyObject *__pyx_tuple__66; +static PyObject *__pyx_tuple__68; +static PyObject *__pyx_tuple__70; +static PyObject *__pyx_tuple__71; +static PyObject *__pyx_tuple__73; +static PyObject *__pyx_tuple__75; +static PyObject *__pyx_tuple__77; +static PyObject *__pyx_tuple__79; +static PyObject *__pyx_tuple__81; +static PyObject *__pyx_tuple__83; +static PyObject *__pyx_tuple__85; +static PyObject *__pyx_tuple__87; +static PyObject *__pyx_codeobj__9; +static PyObject *__pyx_codeobj__12; +static PyObject *__pyx_codeobj__14; +static PyObject *__pyx_codeobj__16; +static PyObject *__pyx_codeobj__18; +static PyObject *__pyx_codeobj__20; +static PyObject *__pyx_codeobj__22; +static PyObject *__pyx_codeobj__24; +static PyObject *__pyx_codeobj__26; +static PyObject *__pyx_codeobj__28; +static PyObject *__pyx_codeobj__30; +static PyObject *__pyx_codeobj__32; +static PyObject *__pyx_codeobj__34; +static PyObject *__pyx_codeobj__36; +static PyObject *__pyx_codeobj__38; +static PyObject *__pyx_codeobj__40; +static PyObject *__pyx_codeobj__42; +static PyObject *__pyx_codeobj__44; +static PyObject *__pyx_codeobj__46; +static PyObject *__pyx_codeobj__48; +static PyObject *__pyx_codeobj__50; +static PyObject *__pyx_codeobj__52; +static PyObject *__pyx_codeobj__54; +static PyObject *__pyx_codeobj__56; +static PyObject *__pyx_codeobj__58; +static PyObject *__pyx_codeobj__61; +static PyObject *__pyx_codeobj__63; +static PyObject *__pyx_codeobj__65; +static PyObject *__pyx_codeobj__67; +static PyObject *__pyx_codeobj__69; +static PyObject *__pyx_codeobj__72; +static PyObject *__pyx_codeobj__74; +static PyObject *__pyx_codeobj__76; +static PyObject *__pyx_codeobj__78; +static PyObject *__pyx_codeobj__80; +static PyObject *__pyx_codeobj__82; +static PyObject *__pyx_codeobj__84; +static PyObject *__pyx_codeobj__86; +static PyObject *__pyx_codeobj__88; +/* Late includes */ + +/* "src/gevent/queue.py":64 + * # pylint:disable=assignment-from-no-return + * + * def _safe_remove(deq, item): # <<<<<<<<<<<<<< + * # For when the item may have been removed by + * # Queue._unlock + */ + +static PyObject *__pyx_f_6gevent_6_queue__safe_remove(PyObject *__pyx_v_deq, PyObject *__pyx_v_item) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + __Pyx_RefNannySetupContext("_safe_remove", 0); + + /* "src/gevent/queue.py":67 + * # For when the item may have been removed by + * # Queue._unlock + * try: # <<<<<<<<<<<<<< + * deq.remove(item) + * except ValueError: + */ + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "src/gevent/queue.py":68 + * # Queue._unlock + * try: + * deq.remove(item) # <<<<<<<<<<<<<< + * except ValueError: + * pass + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_deq, __pyx_n_s_remove); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 68, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); + if (likely(__pyx_t_6)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_5, function); + } + } + __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_v_item) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_item); + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 68, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "src/gevent/queue.py":67 + * # For when the item may have been removed by + * # Queue._unlock + * try: # <<<<<<<<<<<<<< + * deq.remove(item) + * except ValueError: + */ + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L8_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "src/gevent/queue.py":69 + * try: + * deq.remove(item) + * except ValueError: # <<<<<<<<<<<<<< + * pass + * + */ + __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ValueError); + if (__pyx_t_7) { + __Pyx_ErrRestore(0,0,0); + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + + /* "src/gevent/queue.py":67 + * # For when the item may have been removed by + * # Queue._unlock + * try: # <<<<<<<<<<<<<< + * deq.remove(item) + * except ValueError: + */ + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L8_try_end:; + } + + /* "src/gevent/queue.py":64 + * # pylint:disable=assignment-from-no-return + * + * def _safe_remove(deq, item): # <<<<<<<<<<<<<< + * # For when the item may have been removed by + * # Queue._unlock + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("gevent._queue._safe_remove", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/queue.py":82 + * ) + * + * def __init__(self, item, queue): # <<<<<<<<<<<<<< + * Waiter.__init__(self) # pylint:disable=undefined-variable + * self.item = item + */ + +/* Python wrapper */ +static int __pyx_pw_6gevent_6_queue_10ItemWaiter_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6gevent_6_queue_10ItemWaiter_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_item = 0; + PyObject *__pyx_v_queue = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_item,&__pyx_n_s_queue,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_item)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_queue)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(0, 82, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 82, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_item = values[0]; + __pyx_v_queue = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 82, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent._queue.ItemWaiter.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_6_queue_10ItemWaiter___init__(((struct __pyx_obj_6gevent_6_queue_ItemWaiter *)__pyx_v_self), __pyx_v_item, __pyx_v_queue); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_6_queue_10ItemWaiter___init__(struct __pyx_obj_6gevent_6_queue_ItemWaiter *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_queue) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "src/gevent/queue.py":83 + * + * def __init__(self, item, queue): + * Waiter.__init__(self) # pylint:disable=undefined-variable # <<<<<<<<<<<<<< + * self.item = item + * self.queue = queue + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_6gevent_8__waiter_Waiter), __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 83, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, ((PyObject *)__pyx_v_self)) : __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_v_self)); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 83, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/queue.py":84 + * def __init__(self, item, queue): + * Waiter.__init__(self) # pylint:disable=undefined-variable + * self.item = item # <<<<<<<<<<<<<< + * self.queue = queue + * + */ + __Pyx_INCREF(__pyx_v_item); + __Pyx_GIVEREF(__pyx_v_item); + __Pyx_GOTREF(__pyx_v_self->item); + __Pyx_DECREF(__pyx_v_self->item); + __pyx_v_self->item = __pyx_v_item; + + /* "src/gevent/queue.py":85 + * Waiter.__init__(self) # pylint:disable=undefined-variable + * self.item = item + * self.queue = queue # <<<<<<<<<<<<<< + * + * def put_and_switch(self): + */ + __Pyx_INCREF(__pyx_v_queue); + __Pyx_GIVEREF(__pyx_v_queue); + __Pyx_GOTREF(__pyx_v_self->queue); + __Pyx_DECREF(__pyx_v_self->queue); + __pyx_v_self->queue = __pyx_v_queue; + + /* "src/gevent/queue.py":82 + * ) + * + * def __init__(self, item, queue): # <<<<<<<<<<<<<< + * Waiter.__init__(self) # pylint:disable=undefined-variable + * self.item = item + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("gevent._queue.ItemWaiter.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/queue.py":87 + * self.queue = queue + * + * def put_and_switch(self): # <<<<<<<<<<<<<< + * self.queue._put(self.item) + * self.queue = None + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_queue_10ItemWaiter_3put_and_switch(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6gevent_6_queue_10ItemWaiter_2put_and_switch[] = "ItemWaiter.put_and_switch(self)"; +static PyMethodDef __pyx_mdef_6gevent_6_queue_10ItemWaiter_3put_and_switch = {"put_and_switch", (PyCFunction)__pyx_pw_6gevent_6_queue_10ItemWaiter_3put_and_switch, METH_NOARGS, __pyx_doc_6gevent_6_queue_10ItemWaiter_2put_and_switch}; +static PyObject *__pyx_pw_6gevent_6_queue_10ItemWaiter_3put_and_switch(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("put_and_switch (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6_queue_10ItemWaiter_2put_and_switch(((struct __pyx_obj_6gevent_6_queue_ItemWaiter *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_queue_10ItemWaiter_2put_and_switch(struct __pyx_obj_6gevent_6_queue_ItemWaiter *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("put_and_switch", 0); + + /* "src/gevent/queue.py":88 + * + * def put_and_switch(self): + * self.queue._put(self.item) # <<<<<<<<<<<<<< + * self.queue = None + * self.item = None + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->queue, __pyx_n_s_put); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 88, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_self->item) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_self->item); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 88, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/queue.py":89 + * def put_and_switch(self): + * self.queue._put(self.item) + * self.queue = None # <<<<<<<<<<<<<< + * self.item = None + * return self.switch(self) + */ + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->queue); + __Pyx_DECREF(__pyx_v_self->queue); + __pyx_v_self->queue = Py_None; + + /* "src/gevent/queue.py":90 + * self.queue._put(self.item) + * self.queue = None + * self.item = None # <<<<<<<<<<<<<< + * return self.switch(self) + * + */ + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->item); + __Pyx_DECREF(__pyx_v_self->item); + __pyx_v_self->item = Py_None; + + /* "src/gevent/queue.py":91 + * self.queue = None + * self.item = None + * return self.switch(self) # <<<<<<<<<<<<<< + * + * class Queue(object): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_switch); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 91, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, ((PyObject *)__pyx_v_self)) : __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_v_self)); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 91, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "src/gevent/queue.py":87 + * self.queue = queue + * + * def put_and_switch(self): # <<<<<<<<<<<<<< + * self.queue._put(self.item) + * self.queue = None + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("gevent._queue.ItemWaiter.put_and_switch", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/_queue.pxd":15 + * @cython.internal + * cdef class ItemWaiter(Waiter): + * cdef readonly item # <<<<<<<<<<<<<< + * cdef readonly queue + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_queue_10ItemWaiter_4item_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_6_queue_10ItemWaiter_4item_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6_queue_10ItemWaiter_4item___get__(((struct __pyx_obj_6gevent_6_queue_ItemWaiter *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_queue_10ItemWaiter_4item___get__(struct __pyx_obj_6gevent_6_queue_ItemWaiter *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->item); + __pyx_r = __pyx_v_self->item; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/_queue.pxd":16 + * cdef class ItemWaiter(Waiter): + * cdef readonly item + * cdef readonly queue # <<<<<<<<<<<<<< + * + * cdef class Queue: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_queue_10ItemWaiter_5queue_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_6_queue_10ItemWaiter_5queue_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6_queue_10ItemWaiter_5queue___get__(((struct __pyx_obj_6gevent_6_queue_ItemWaiter *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_queue_10ItemWaiter_5queue___get__(struct __pyx_obj_6gevent_6_queue_ItemWaiter *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->queue); + __pyx_r = __pyx_v_self->queue; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/queue.py":124 + * ) + * + * def __init__(self, maxsize=None, items=(), _warn_depth=2): # <<<<<<<<<<<<<< + * if maxsize is not None and maxsize <= 0: + * if maxsize == 0: + */ + +/* Python wrapper */ +static int __pyx_pw_6gevent_6_queue_5Queue_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6gevent_6_queue_5Queue_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_maxsize = 0; + PyObject *__pyx_v_items = 0; + PyObject *__pyx_v__warn_depth = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_maxsize,&__pyx_n_s_items,&__pyx_n_s_warn_depth,0}; + PyObject* values[3] = {0,0,0}; + values[0] = ((PyObject *)Py_None); + values[1] = ((PyObject *)__pyx_empty_tuple); + values[2] = ((PyObject *)__pyx_int_2); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_maxsize); + if (value) { values[0] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 1: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_items); + if (value) { values[1] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 2: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_warn_depth); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 124, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_maxsize = values[0]; + __pyx_v_items = values[1]; + __pyx_v__warn_depth = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 124, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent._queue.Queue.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_6_queue_5Queue___init__(((struct __pyx_obj_6gevent_6_queue_Queue *)__pyx_v_self), __pyx_v_maxsize, __pyx_v_items, __pyx_v__warn_depth); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_6_queue_5Queue___init__(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self, PyObject *__pyx_v_maxsize, PyObject *__pyx_v_items, PyObject *__pyx_v__warn_depth) { + PyObject *__pyx_v_warnings = NULL; + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + __Pyx_RefNannySetupContext("__init__", 0); + __Pyx_INCREF(__pyx_v_maxsize); + + /* "src/gevent/queue.py":125 + * + * def __init__(self, maxsize=None, items=(), _warn_depth=2): + * if maxsize is not None and maxsize <= 0: # <<<<<<<<<<<<<< + * if maxsize == 0: + * import warnings + */ + __pyx_t_2 = (__pyx_v_maxsize != Py_None); + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + } else { + __pyx_t_1 = __pyx_t_3; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_4 = PyObject_RichCompare(__pyx_v_maxsize, __pyx_int_0, Py_LE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 125, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 125, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_1 = __pyx_t_3; + __pyx_L4_bool_binop_done:; + if (__pyx_t_1) { + + /* "src/gevent/queue.py":126 + * def __init__(self, maxsize=None, items=(), _warn_depth=2): + * if maxsize is not None and maxsize <= 0: + * if maxsize == 0: # <<<<<<<<<<<<<< + * import warnings + * warnings.warn( + */ + __pyx_t_4 = __Pyx_PyInt_EqObjC(__pyx_v_maxsize, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 126, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 126, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_1) { + + /* "src/gevent/queue.py":127 + * if maxsize is not None and maxsize <= 0: + * if maxsize == 0: + * import warnings # <<<<<<<<<<<<<< + * warnings.warn( + * 'Queue(0) now equivalent to Queue(None); if you want a channel, use Channel', + */ + __pyx_t_4 = __Pyx_Import(__pyx_n_s_warnings, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 127, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_v_warnings = __pyx_t_4; + __pyx_t_4 = 0; + + /* "src/gevent/queue.py":128 + * if maxsize == 0: + * import warnings + * warnings.warn( # <<<<<<<<<<<<<< + * 'Queue(0) now equivalent to Queue(None); if you want a channel, use Channel', + * DeprecationWarning, + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_warnings, __pyx_n_s_warn); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 128, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + + /* "src/gevent/queue.py":131 + * 'Queue(0) now equivalent to Queue(None); if you want a channel, use Channel', + * DeprecationWarning, + * stacklevel=_warn_depth) # <<<<<<<<<<<<<< + * maxsize = None + * + */ + __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 131, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_stacklevel, __pyx_v__warn_depth) < 0) __PYX_ERR(0, 131, __pyx_L1_error) + + /* "src/gevent/queue.py":128 + * if maxsize == 0: + * import warnings + * warnings.warn( # <<<<<<<<<<<<<< + * 'Queue(0) now equivalent to Queue(None); if you want a channel, use Channel', + * DeprecationWarning, + */ + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple_, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 128, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "src/gevent/queue.py":126 + * def __init__(self, maxsize=None, items=(), _warn_depth=2): + * if maxsize is not None and maxsize <= 0: + * if maxsize == 0: # <<<<<<<<<<<<<< + * import warnings + * warnings.warn( + */ + } + + /* "src/gevent/queue.py":132 + * DeprecationWarning, + * stacklevel=_warn_depth) + * maxsize = None # <<<<<<<<<<<<<< + * + * self._maxsize = maxsize if maxsize is not None else -1 + */ + __Pyx_INCREF(Py_None); + __Pyx_DECREF_SET(__pyx_v_maxsize, Py_None); + + /* "src/gevent/queue.py":125 + * + * def __init__(self, maxsize=None, items=(), _warn_depth=2): + * if maxsize is not None and maxsize <= 0: # <<<<<<<<<<<<<< + * if maxsize == 0: + * import warnings + */ + } + + /* "src/gevent/queue.py":134 + * maxsize = None + * + * self._maxsize = maxsize if maxsize is not None else -1 # <<<<<<<<<<<<<< + * # Explicitly maintain order for getters and putters that block + * # so that callers can consistently rely on getting things out + */ + __pyx_t_1 = (__pyx_v_maxsize != Py_None); + if ((__pyx_t_1 != 0)) { + __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_v_maxsize); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 134, __pyx_L1_error) + __pyx_t_7 = __pyx_t_8; + } else { + __pyx_t_7 = -1L; + } + __pyx_v_self->_maxsize = __pyx_t_7; + + /* "src/gevent/queue.py":147 + * # many waiters that removing an arbitrary element is a + * # bottleneck, though. + * self.getters = collections.deque() # <<<<<<<<<<<<<< + * self.putters = collections.deque() + * self.hub = get_hub() + */ + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_collections); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 147, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_deque); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 147, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + } + } + __pyx_t_6 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 147, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GIVEREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_v_self->getters); + __Pyx_DECREF(__pyx_v_self->getters); + __pyx_v_self->getters = __pyx_t_6; + __pyx_t_6 = 0; + + /* "src/gevent/queue.py":148 + * # bottleneck, though. + * self.getters = collections.deque() + * self.putters = collections.deque() # <<<<<<<<<<<<<< + * self.hub = get_hub() + * self._event_unlock = None + */ + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_collections); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 148, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_deque); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 148, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_5, function); + } + } + __pyx_t_6 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 148, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GIVEREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_v_self->putters); + __Pyx_DECREF(__pyx_v_self->putters); + __pyx_v_self->putters = __pyx_t_6; + __pyx_t_6 = 0; + + /* "src/gevent/queue.py":149 + * self.getters = collections.deque() + * self.putters = collections.deque() + * self.hub = get_hub() # <<<<<<<<<<<<<< + * self._event_unlock = None + * self.queue = self._create_queue(items) + */ + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_get_hub); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 149, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_5, function); + } + } + __pyx_t_6 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 149, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GIVEREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_v_self->hub); + __Pyx_DECREF(__pyx_v_self->hub); + __pyx_v_self->hub = __pyx_t_6; + __pyx_t_6 = 0; + + /* "src/gevent/queue.py":150 + * self.putters = collections.deque() + * self.hub = get_hub() + * self._event_unlock = None # <<<<<<<<<<<<<< + * self.queue = self._create_queue(items) + * + */ + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->_event_unlock); + __Pyx_DECREF(__pyx_v_self->_event_unlock); + __pyx_v_self->_event_unlock = Py_None; + + /* "src/gevent/queue.py":151 + * self.hub = get_hub() + * self._event_unlock = None + * self.queue = self._create_queue(items) # <<<<<<<<<<<<<< + * + * @property + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_create_queue); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 151, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_5, function); + } + } + __pyx_t_6 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_4, __pyx_v_items) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_items); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 151, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GIVEREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_v_self->queue); + __Pyx_DECREF(__pyx_v_self->queue); + __pyx_v_self->queue = __pyx_t_6; + __pyx_t_6 = 0; + + /* "src/gevent/queue.py":124 + * ) + * + * def __init__(self, maxsize=None, items=(), _warn_depth=2): # <<<<<<<<<<<<<< + * if maxsize is not None and maxsize <= 0: + * if maxsize == 0: + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("gevent._queue.Queue.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_warnings); + __Pyx_XDECREF(__pyx_v_maxsize); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/queue.py":154 + * + * @property + * def maxsize(self): # <<<<<<<<<<<<<< + * return self._maxsize if self._maxsize > 0 else None + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_queue_5Queue_7maxsize_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_6_queue_5Queue_7maxsize_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6_queue_5Queue_7maxsize___get__(((struct __pyx_obj_6gevent_6_queue_Queue *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_queue_5Queue_7maxsize___get__(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "src/gevent/queue.py":155 + * @property + * def maxsize(self): + * return self._maxsize if self._maxsize > 0 else None # <<<<<<<<<<<<<< + * + * @maxsize.setter + */ + __Pyx_XDECREF(__pyx_r); + if (((__pyx_v_self->_maxsize > 0) != 0)) { + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->_maxsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 155, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __pyx_t_2; + __pyx_t_2 = 0; + } else { + __Pyx_INCREF(Py_None); + __pyx_t_1 = Py_None; + } + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "src/gevent/queue.py":154 + * + * @property + * def maxsize(self): # <<<<<<<<<<<<<< + * return self._maxsize if self._maxsize > 0 else None + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent._queue.Queue.maxsize.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/queue.py":158 + * + * @maxsize.setter + * def maxsize(self, nv): # <<<<<<<<<<<<<< + * # QQQ make maxsize into a property with setter that schedules unlock if necessary + * if nv is None or nv <= 0: + */ + +/* Python wrapper */ +static int __pyx_pw_6gevent_6_queue_5Queue_7maxsize_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_nv); /*proto*/ +static int __pyx_pw_6gevent_6_queue_5Queue_7maxsize_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_nv) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6_queue_5Queue_7maxsize_2__set__(((struct __pyx_obj_6gevent_6_queue_Queue *)__pyx_v_self), ((PyObject *)__pyx_v_nv)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_6_queue_5Queue_7maxsize_2__set__(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self, PyObject *__pyx_v_nv) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + Py_ssize_t __pyx_t_5; + __Pyx_RefNannySetupContext("__set__", 0); + + /* "src/gevent/queue.py":160 + * def maxsize(self, nv): + * # QQQ make maxsize into a property with setter that schedules unlock if necessary + * if nv is None or nv <= 0: # <<<<<<<<<<<<<< + * self._maxsize = -1 + * else: + */ + __pyx_t_2 = (__pyx_v_nv == Py_None); + __pyx_t_3 = (__pyx_t_2 != 0); + if (!__pyx_t_3) { + } else { + __pyx_t_1 = __pyx_t_3; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_4 = PyObject_RichCompare(__pyx_v_nv, __pyx_int_0, Py_LE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 160, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 160, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_1 = __pyx_t_3; + __pyx_L4_bool_binop_done:; + if (__pyx_t_1) { + + /* "src/gevent/queue.py":161 + * # QQQ make maxsize into a property with setter that schedules unlock if necessary + * if nv is None or nv <= 0: + * self._maxsize = -1 # <<<<<<<<<<<<<< + * else: + * self._maxsize = nv + */ + __pyx_v_self->_maxsize = -1L; + + /* "src/gevent/queue.py":160 + * def maxsize(self, nv): + * # QQQ make maxsize into a property with setter that schedules unlock if necessary + * if nv is None or nv <= 0: # <<<<<<<<<<<<<< + * self._maxsize = -1 + * else: + */ + goto __pyx_L3; + } + + /* "src/gevent/queue.py":163 + * self._maxsize = -1 + * else: + * self._maxsize = nv # <<<<<<<<<<<<<< + * + * def copy(self): + */ + /*else*/ { + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_v_nv); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 163, __pyx_L1_error) + __pyx_v_self->_maxsize = __pyx_t_5; + } + __pyx_L3:; + + /* "src/gevent/queue.py":158 + * + * @maxsize.setter + * def maxsize(self, nv): # <<<<<<<<<<<<<< + * # QQQ make maxsize into a property with setter that schedules unlock if necessary + * if nv is None or nv <= 0: + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("gevent._queue.Queue.maxsize.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/queue.py":165 + * self._maxsize = nv + * + * def copy(self): # <<<<<<<<<<<<<< + * return type(self)(self.maxsize, self.queue) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_queue_5Queue_3copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6gevent_6_queue_5Queue_2copy[] = "Queue.copy(self)"; +static PyMethodDef __pyx_mdef_6gevent_6_queue_5Queue_3copy = {"copy", (PyCFunction)__pyx_pw_6gevent_6_queue_5Queue_3copy, METH_NOARGS, __pyx_doc_6gevent_6_queue_5Queue_2copy}; +static PyObject *__pyx_pw_6gevent_6_queue_5Queue_3copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("copy (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6_queue_5Queue_2copy(((struct __pyx_obj_6gevent_6_queue_Queue *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_queue_5Queue_2copy(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + __Pyx_RefNannySetupContext("copy", 0); + + /* "src/gevent/queue.py":166 + * + * def copy(self): + * return type(self)(self.maxsize, self.queue) # <<<<<<<<<<<<<< + * + * def _create_queue(self, items=()): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_maxsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 166, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __pyx_t_3 = ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))); __pyx_t_4 = NULL; + __pyx_t_5 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_5 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_3)) { + PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_2, __pyx_v_self->queue}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 166, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { + PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_2, __pyx_v_self->queue}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 166, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } else + #endif + { + __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 166, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (__pyx_t_4) { + __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL; + } + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_t_2); + __Pyx_INCREF(__pyx_v_self->queue); + __Pyx_GIVEREF(__pyx_v_self->queue); + PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_self->queue); + __pyx_t_2 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 166, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "src/gevent/queue.py":165 + * self._maxsize = nv + * + * def copy(self): # <<<<<<<<<<<<<< + * return type(self)(self.maxsize, self.queue) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("gevent._queue.Queue.copy", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/queue.py":168 + * return type(self)(self.maxsize, self.queue) + * + * def _create_queue(self, items=()): # <<<<<<<<<<<<<< + * return collections.deque(items) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_queue_5Queue_5_create_queue(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6gevent_6_queue_5Queue_4_create_queue[] = "Queue._create_queue(self, items=())"; +static PyMethodDef __pyx_mdef_6gevent_6_queue_5Queue_5_create_queue = {"_create_queue", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_6_queue_5Queue_5_create_queue, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_6_queue_5Queue_4_create_queue}; +static PyObject *__pyx_pw_6gevent_6_queue_5Queue_5_create_queue(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_items = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_create_queue (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_items,0}; + PyObject* values[1] = {0}; + values[0] = ((PyObject *)__pyx_empty_tuple); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_items); + if (value) { values[0] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_create_queue") < 0)) __PYX_ERR(0, 168, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_items = values[0]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("_create_queue", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 168, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent._queue.Queue._create_queue", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_6_queue_5Queue_4_create_queue(((struct __pyx_obj_6gevent_6_queue_Queue *)__pyx_v_self), __pyx_v_items); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_queue_5Queue_4_create_queue(CYTHON_UNUSED struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self, PyObject *__pyx_v_items) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("_create_queue", 0); + + /* "src/gevent/queue.py":169 + * + * def _create_queue(self, items=()): + * return collections.deque(items) # <<<<<<<<<<<<<< + * + * def _get(self): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_collections); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 169, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_deque); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 169, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_2)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_v_items) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_items); + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 169, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "src/gevent/queue.py":168 + * return type(self)(self.maxsize, self.queue) + * + * def _create_queue(self, items=()): # <<<<<<<<<<<<<< + * return collections.deque(items) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("gevent._queue.Queue._create_queue", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/queue.py":171 + * return collections.deque(items) + * + * def _get(self): # <<<<<<<<<<<<<< + * return self.queue.popleft() + * + */ + +static PyObject *__pyx_pw_6gevent_6_queue_5Queue_7_get(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_f_6gevent_6_queue_5Queue__get(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self, int __pyx_skip_dispatch) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + __Pyx_RefNannySetupContext("_get", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0; + if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self)))))); + else { + PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + #endif + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 171, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_6_queue_5Queue_7_get)) { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 171, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0; + if (unlikely(type_dict_guard != tp_dict_version)) { + tp_dict_version = obj_dict_version = 0; + } + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + } + #endif + } + + /* "src/gevent/queue.py":172 + * + * def _get(self): + * return self.queue.popleft() # <<<<<<<<<<<<<< + * + * def _peek(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->queue, __pyx_n_s_popleft); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 172, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 172, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "src/gevent/queue.py":171 + * return collections.deque(items) + * + * def _get(self): # <<<<<<<<<<<<<< + * return self.queue.popleft() + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("gevent._queue.Queue._get", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_queue_5Queue_7_get(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6gevent_6_queue_5Queue_6_get[] = "Queue._get(self)"; +static PyMethodDef __pyx_mdef_6gevent_6_queue_5Queue_7_get = {"_get", (PyCFunction)__pyx_pw_6gevent_6_queue_5Queue_7_get, METH_NOARGS, __pyx_doc_6gevent_6_queue_5Queue_6_get}; +static PyObject *__pyx_pw_6gevent_6_queue_5Queue_7_get(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_get (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6_queue_5Queue_6_get(((struct __pyx_obj_6gevent_6_queue_Queue *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_queue_5Queue_6_get(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("_get", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6gevent_6_queue_5Queue__get(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 171, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent._queue.Queue._get", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/queue.py":174 + * return self.queue.popleft() + * + * def _peek(self): # <<<<<<<<<<<<<< + * return self.queue[0] + * + */ + +static PyObject *__pyx_pw_6gevent_6_queue_5Queue_9_peek(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_f_6gevent_6_queue_5Queue__peek(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self, int __pyx_skip_dispatch) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + __Pyx_RefNannySetupContext("_peek", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0; + if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self)))))); + else { + PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + #endif + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_peek); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 174, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_6_queue_5Queue_9_peek)) { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 174, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0; + if (unlikely(type_dict_guard != tp_dict_version)) { + tp_dict_version = obj_dict_version = 0; + } + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + } + #endif + } + + /* "src/gevent/queue.py":175 + * + * def _peek(self): + * return self.queue[0] # <<<<<<<<<<<<<< + * + * def _put(self, item): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_self->queue, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 175, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "src/gevent/queue.py":174 + * return self.queue.popleft() + * + * def _peek(self): # <<<<<<<<<<<<<< + * return self.queue[0] + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("gevent._queue.Queue._peek", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_queue_5Queue_9_peek(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6gevent_6_queue_5Queue_8_peek[] = "Queue._peek(self)"; +static PyMethodDef __pyx_mdef_6gevent_6_queue_5Queue_9_peek = {"_peek", (PyCFunction)__pyx_pw_6gevent_6_queue_5Queue_9_peek, METH_NOARGS, __pyx_doc_6gevent_6_queue_5Queue_8_peek}; +static PyObject *__pyx_pw_6gevent_6_queue_5Queue_9_peek(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_peek (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6_queue_5Queue_8_peek(((struct __pyx_obj_6gevent_6_queue_Queue *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_queue_5Queue_8_peek(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("_peek", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6gevent_6_queue_5Queue__peek(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 174, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent._queue.Queue._peek", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/queue.py":177 + * return self.queue[0] + * + * def _put(self, item): # <<<<<<<<<<<<<< + * self.queue.append(item) + * + */ + +static PyObject *__pyx_pw_6gevent_6_queue_5Queue_11_put(PyObject *__pyx_v_self, PyObject *__pyx_v_item); /*proto*/ +static PyObject *__pyx_f_6gevent_6_queue_5Queue__put(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self, PyObject *__pyx_v_item, int __pyx_skip_dispatch) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + __Pyx_RefNannySetupContext("_put", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0; + if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self)))))); + else { + PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + #endif + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_put); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 177, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_6_queue_5Queue_11_put)) { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_item) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_item); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 177, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0; + if (unlikely(type_dict_guard != tp_dict_version)) { + tp_dict_version = obj_dict_version = 0; + } + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + } + #endif + } + + /* "src/gevent/queue.py":178 + * + * def _put(self, item): + * self.queue.append(item) # <<<<<<<<<<<<<< + * + * def __repr__(self): + */ + __pyx_t_5 = __Pyx_PyObject_Append(__pyx_v_self->queue, __pyx_v_item); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 178, __pyx_L1_error) + + /* "src/gevent/queue.py":177 + * return self.queue[0] + * + * def _put(self, item): # <<<<<<<<<<<<<< + * self.queue.append(item) + * + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("gevent._queue.Queue._put", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_queue_5Queue_11_put(PyObject *__pyx_v_self, PyObject *__pyx_v_item); /*proto*/ +static char __pyx_doc_6gevent_6_queue_5Queue_10_put[] = "Queue._put(self, item)"; +static PyMethodDef __pyx_mdef_6gevent_6_queue_5Queue_11_put = {"_put", (PyCFunction)__pyx_pw_6gevent_6_queue_5Queue_11_put, METH_O, __pyx_doc_6gevent_6_queue_5Queue_10_put}; +static PyObject *__pyx_pw_6gevent_6_queue_5Queue_11_put(PyObject *__pyx_v_self, PyObject *__pyx_v_item) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_put (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6_queue_5Queue_10_put(((struct __pyx_obj_6gevent_6_queue_Queue *)__pyx_v_self), ((PyObject *)__pyx_v_item)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_queue_5Queue_10_put(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self, PyObject *__pyx_v_item) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("_put", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6gevent_6_queue_5Queue__put(__pyx_v_self, __pyx_v_item, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 177, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent._queue.Queue._put", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/queue.py":180 + * self.queue.append(item) + * + * def __repr__(self): # <<<<<<<<<<<<<< + * return '<%s at %s%s>' % (type(self).__name__, hex(id(self)), self._format()) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_queue_5Queue_13__repr__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_6_queue_5Queue_13__repr__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6_queue_5Queue_12__repr__(((struct __pyx_obj_6gevent_6_queue_Queue *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_queue_5Queue_12__repr__(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + __Pyx_RefNannySetupContext("__repr__", 0); + + /* "src/gevent/queue.py":181 + * + * def __repr__(self): + * return '<%s at %s%s>' % (type(self).__name__, hex(id(self)), self._format()) # <<<<<<<<<<<<<< + * + * def __str__(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))), __pyx_n_s_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 181, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 181, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_hex, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 181, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 181, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + } + } + __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 181, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 181, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_2); + __pyx_t_1 = 0; + __pyx_t_3 = 0; + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_s_at_s_s, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 181, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "src/gevent/queue.py":180 + * self.queue.append(item) + * + * def __repr__(self): # <<<<<<<<<<<<<< + * return '<%s at %s%s>' % (type(self).__name__, hex(id(self)), self._format()) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("gevent._queue.Queue.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/queue.py":183 + * return '<%s at %s%s>' % (type(self).__name__, hex(id(self)), self._format()) + * + * def __str__(self): # <<<<<<<<<<<<<< + * return '<%s%s>' % (type(self).__name__, self._format()) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_queue_5Queue_15__str__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_6_queue_5Queue_15__str__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__str__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6_queue_5Queue_14__str__(((struct __pyx_obj_6gevent_6_queue_Queue *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_queue_5Queue_14__str__(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + __Pyx_RefNannySetupContext("__str__", 0); + + /* "src/gevent/queue.py":184 + * + * def __str__(self): + * return '<%s%s>' % (type(self).__name__, self._format()) # <<<<<<<<<<<<<< + * + * def _format(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))), __pyx_n_s_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 184, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 184, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 184, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 184, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); + __pyx_t_1 = 0; + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_s_s, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 184, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "src/gevent/queue.py":183 + * return '<%s at %s%s>' % (type(self).__name__, hex(id(self)), self._format()) + * + * def __str__(self): # <<<<<<<<<<<<<< + * return '<%s%s>' % (type(self).__name__, self._format()) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("gevent._queue.Queue.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/queue.py":186 + * return '<%s%s>' % (type(self).__name__, self._format()) + * + * def _format(self): # <<<<<<<<<<<<<< + * result = [] + * if self.maxsize is not None: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_queue_5Queue_17_format(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6gevent_6_queue_5Queue_16_format[] = "Queue._format(self)"; +static PyMethodDef __pyx_mdef_6gevent_6_queue_5Queue_17_format = {"_format", (PyCFunction)__pyx_pw_6gevent_6_queue_5Queue_17_format, METH_NOARGS, __pyx_doc_6gevent_6_queue_5Queue_16_format}; +static PyObject *__pyx_pw_6gevent_6_queue_5Queue_17_format(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_format (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6_queue_5Queue_16_format(((struct __pyx_obj_6gevent_6_queue_Queue *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_queue_5Queue_16_format(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self) { + PyObject *__pyx_v_result = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + Py_ssize_t __pyx_t_6; + __Pyx_RefNannySetupContext("_format", 0); + + /* "src/gevent/queue.py":187 + * + * def _format(self): + * result = [] # <<<<<<<<<<<<<< + * if self.maxsize is not None: + * result.append('maxsize=%r' % (self.maxsize, )) + */ + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 187, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_result = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "src/gevent/queue.py":188 + * def _format(self): + * result = [] + * if self.maxsize is not None: # <<<<<<<<<<<<<< + * result.append('maxsize=%r' % (self.maxsize, )) + * if getattr(self, 'queue', None): + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_maxsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 188, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = (__pyx_t_1 != Py_None); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "src/gevent/queue.py":189 + * result = [] + * if self.maxsize is not None: + * result.append('maxsize=%r' % (self.maxsize, )) # <<<<<<<<<<<<<< + * if getattr(self, 'queue', None): + * result.append('queue=%r' % (self.queue, )) + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_maxsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 189, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 189, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_maxsize_r, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 189, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_1); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 189, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/queue.py":188 + * def _format(self): + * result = [] + * if self.maxsize is not None: # <<<<<<<<<<<<<< + * result.append('maxsize=%r' % (self.maxsize, )) + * if getattr(self, 'queue', None): + */ + } + + /* "src/gevent/queue.py":190 + * if self.maxsize is not None: + * result.append('maxsize=%r' % (self.maxsize, )) + * if getattr(self, 'queue', None): # <<<<<<<<<<<<<< + * result.append('queue=%r' % (self.queue, )) + * if self.getters: + */ + __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_queue, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 190, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 190, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_3) { + + /* "src/gevent/queue.py":191 + * result.append('maxsize=%r' % (self.maxsize, )) + * if getattr(self, 'queue', None): + * result.append('queue=%r' % (self.queue, )) # <<<<<<<<<<<<<< + * if self.getters: + * result.append('getters[%s]' % len(self.getters)) + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 191, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_self->queue); + __Pyx_GIVEREF(__pyx_v_self->queue); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->queue); + __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_queue_r, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 191, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_5 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_4); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 191, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "src/gevent/queue.py":190 + * if self.maxsize is not None: + * result.append('maxsize=%r' % (self.maxsize, )) + * if getattr(self, 'queue', None): # <<<<<<<<<<<<<< + * result.append('queue=%r' % (self.queue, )) + * if self.getters: + */ + } + + /* "src/gevent/queue.py":192 + * if getattr(self, 'queue', None): + * result.append('queue=%r' % (self.queue, )) + * if self.getters: # <<<<<<<<<<<<<< + * result.append('getters[%s]' % len(self.getters)) + * if self.putters: + */ + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_self->getters); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 192, __pyx_L1_error) + if (__pyx_t_3) { + + /* "src/gevent/queue.py":193 + * result.append('queue=%r' % (self.queue, )) + * if self.getters: + * result.append('getters[%s]' % len(self.getters)) # <<<<<<<<<<<<<< + * if self.putters: + * result.append('putters[%s]' % len(self.putters)) + */ + __pyx_t_4 = __pyx_v_self->getters; + __Pyx_INCREF(__pyx_t_4); + __pyx_t_6 = PyObject_Length(__pyx_t_4); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 193, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyInt_FromSsize_t(__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 193, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_getters_s, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 193, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_1); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 193, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/queue.py":192 + * if getattr(self, 'queue', None): + * result.append('queue=%r' % (self.queue, )) + * if self.getters: # <<<<<<<<<<<<<< + * result.append('getters[%s]' % len(self.getters)) + * if self.putters: + */ + } + + /* "src/gevent/queue.py":194 + * if self.getters: + * result.append('getters[%s]' % len(self.getters)) + * if self.putters: # <<<<<<<<<<<<<< + * result.append('putters[%s]' % len(self.putters)) + * if result: + */ + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_self->putters); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 194, __pyx_L1_error) + if (__pyx_t_3) { + + /* "src/gevent/queue.py":195 + * result.append('getters[%s]' % len(self.getters)) + * if self.putters: + * result.append('putters[%s]' % len(self.putters)) # <<<<<<<<<<<<<< + * if result: + * return ' ' + ' '.join(result) + */ + __pyx_t_1 = __pyx_v_self->putters; + __Pyx_INCREF(__pyx_t_1); + __pyx_t_6 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 195, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 195, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_putters_s, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 195, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_5 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_4); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 195, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "src/gevent/queue.py":194 + * if self.getters: + * result.append('getters[%s]' % len(self.getters)) + * if self.putters: # <<<<<<<<<<<<<< + * result.append('putters[%s]' % len(self.putters)) + * if result: + */ + } + + /* "src/gevent/queue.py":196 + * if self.putters: + * result.append('putters[%s]' % len(self.putters)) + * if result: # <<<<<<<<<<<<<< + * return ' ' + ' '.join(result) + * return '' + */ + __pyx_t_3 = (PyList_GET_SIZE(__pyx_v_result) != 0); + if (__pyx_t_3) { + + /* "src/gevent/queue.py":197 + * result.append('putters[%s]' % len(self.putters)) + * if result: + * return ' ' + ' '.join(result) # <<<<<<<<<<<<<< + * return '' + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = __Pyx_PyString_Join(__pyx_kp_s__2, __pyx_v_result); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 197, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = PyNumber_Add(__pyx_kp_s__2, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 197, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "src/gevent/queue.py":196 + * if self.putters: + * result.append('putters[%s]' % len(self.putters)) + * if result: # <<<<<<<<<<<<<< + * return ' ' + ' '.join(result) + * return '' + */ + } + + /* "src/gevent/queue.py":198 + * if result: + * return ' ' + ' '.join(result) + * return '' # <<<<<<<<<<<<<< + * + * def qsize(self): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_kp_s__3); + __pyx_r = __pyx_kp_s__3; + goto __pyx_L0; + + /* "src/gevent/queue.py":186 + * return '<%s%s>' % (type(self).__name__, self._format()) + * + * def _format(self): # <<<<<<<<<<<<<< + * result = [] + * if self.maxsize is not None: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("gevent._queue.Queue._format", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/queue.py":200 + * return '' + * + * def qsize(self): # <<<<<<<<<<<<<< + * """Return the size of the queue.""" + * return len(self.queue) + */ + +static PyObject *__pyx_pw_6gevent_6_queue_5Queue_19qsize(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static Py_ssize_t __pyx_f_6gevent_6_queue_5Queue_qsize(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self, int __pyx_skip_dispatch) { + Py_ssize_t __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + Py_ssize_t __pyx_t_5; + __Pyx_RefNannySetupContext("qsize", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0; + if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self)))))); + else { + PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + #endif + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_qsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 200, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_6_queue_5Queue_19qsize)) { + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 200, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 200, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_5; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0; + if (unlikely(type_dict_guard != tp_dict_version)) { + tp_dict_version = obj_dict_version = 0; + } + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + } + #endif + } + + /* "src/gevent/queue.py":202 + * def qsize(self): + * """Return the size of the queue.""" + * return len(self.queue) # <<<<<<<<<<<<<< + * + * def __len__(self): + */ + __pyx_t_1 = __pyx_v_self->queue; + __Pyx_INCREF(__pyx_t_1); + __pyx_t_5 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 202, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_5; + goto __pyx_L0; + + /* "src/gevent/queue.py":200 + * return '' + * + * def qsize(self): # <<<<<<<<<<<<<< + * """Return the size of the queue.""" + * return len(self.queue) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_WriteUnraisable("gevent._queue.Queue.qsize", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_queue_5Queue_19qsize(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6gevent_6_queue_5Queue_18qsize[] = "Queue.qsize(self) -> Py_ssize_t\nReturn the size of the queue."; +static PyMethodDef __pyx_mdef_6gevent_6_queue_5Queue_19qsize = {"qsize", (PyCFunction)__pyx_pw_6gevent_6_queue_5Queue_19qsize, METH_NOARGS, __pyx_doc_6gevent_6_queue_5Queue_18qsize}; +static PyObject *__pyx_pw_6gevent_6_queue_5Queue_19qsize(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("qsize (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6_queue_5Queue_18qsize(((struct __pyx_obj_6gevent_6_queue_Queue *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_queue_5Queue_18qsize(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("qsize", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyInt_FromSsize_t(__pyx_f_6gevent_6_queue_5Queue_qsize(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 200, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent._queue.Queue.qsize", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/queue.py":204 + * return len(self.queue) + * + * def __len__(self): # <<<<<<<<<<<<<< + * """ + * Return the size of the queue. This is the same as :meth:`qsize`. + */ + +/* Python wrapper */ +static Py_ssize_t __pyx_pw_6gevent_6_queue_5Queue_21__len__(PyObject *__pyx_v_self); /*proto*/ +static char __pyx_doc_6gevent_6_queue_5Queue_20__len__[] = "\n Return the size of the queue. This is the same as :meth:`qsize`.\n\n .. versionadded: 1.1b3\n\n Previously, getting len() of a queue would raise a TypeError.\n "; +#if CYTHON_COMPILING_IN_CPYTHON +struct wrapperbase __pyx_wrapperbase_6gevent_6_queue_5Queue_20__len__; +#endif +static Py_ssize_t __pyx_pw_6gevent_6_queue_5Queue_21__len__(PyObject *__pyx_v_self) { + Py_ssize_t __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__len__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6_queue_5Queue_20__len__(((struct __pyx_obj_6gevent_6_queue_Queue *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static Py_ssize_t __pyx_pf_6gevent_6_queue_5Queue_20__len__(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self) { + Py_ssize_t __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__len__", 0); + + /* "src/gevent/queue.py":213 + * """ + * + * return self.qsize() # <<<<<<<<<<<<<< + * + * def __bool__(self): + */ + __pyx_r = ((struct __pyx_vtabstruct_6gevent_6_queue_Queue *)__pyx_v_self->__pyx_vtab)->qsize(__pyx_v_self, 0); + goto __pyx_L0; + + /* "src/gevent/queue.py":204 + * return len(self.queue) + * + * def __len__(self): # <<<<<<<<<<<<<< + * """ + * Return the size of the queue. This is the same as :meth:`qsize`. + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/queue.py":215 + * return self.qsize() + * + * def __bool__(self): # <<<<<<<<<<<<<< + * """ + * A queue object is always True. + */ + +/* Python wrapper */ +static int __pyx_pw_6gevent_6_queue_5Queue_23__bool__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6gevent_6_queue_5Queue_23__bool__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__bool__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6_queue_5Queue_22__bool__(((struct __pyx_obj_6gevent_6_queue_Queue *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_6_queue_5Queue_22__bool__(CYTHON_UNUSED struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__bool__", 0); + + /* "src/gevent/queue.py":224 + * to return True for backwards compatibility. + * """ + * return True # <<<<<<<<<<<<<< + * + * def __nonzero__(self): + */ + __pyx_r = 1; + goto __pyx_L0; + + /* "src/gevent/queue.py":215 + * return self.qsize() + * + * def __bool__(self): # <<<<<<<<<<<<<< + * """ + * A queue object is always True. + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/queue.py":226 + * return True + * + * def __nonzero__(self): # <<<<<<<<<<<<<< + * # Py2. + * # For Cython; __bool__ becomes a special method that we can't + */ + +/* Python wrapper */ +static int __pyx_pw_6gevent_6_queue_5Queue_25__nonzero__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6gevent_6_queue_5Queue_25__nonzero__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__nonzero__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6_queue_5Queue_24__nonzero__(((struct __pyx_obj_6gevent_6_queue_Queue *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_6_queue_5Queue_24__nonzero__(CYTHON_UNUSED struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__nonzero__", 0); + + /* "src/gevent/queue.py":230 + * # For Cython; __bool__ becomes a special method that we can't + * # get by name. + * return True # <<<<<<<<<<<<<< + * + * def empty(self): + */ + __pyx_r = 1; + goto __pyx_L0; + + /* "src/gevent/queue.py":226 + * return True + * + * def __nonzero__(self): # <<<<<<<<<<<<<< + * # Py2. + * # For Cython; __bool__ becomes a special method that we can't + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/queue.py":232 + * return True + * + * def empty(self): # <<<<<<<<<<<<<< + * """Return ``True`` if the queue is empty, ``False`` otherwise.""" + * return not self.qsize() + */ + +static PyObject *__pyx_pw_6gevent_6_queue_5Queue_27empty(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static int __pyx_f_6gevent_6_queue_5Queue_empty(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self, int __pyx_skip_dispatch) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + __Pyx_RefNannySetupContext("empty", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0; + if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self)))))); + else { + PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + #endif + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_empty); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 232, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_6_queue_5Queue_27empty)) { + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 232, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 232, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_5; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0; + if (unlikely(type_dict_guard != tp_dict_version)) { + tp_dict_version = obj_dict_version = 0; + } + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + } + #endif + } + + /* "src/gevent/queue.py":234 + * def empty(self): + * """Return ``True`` if the queue is empty, ``False`` otherwise.""" + * return not self.qsize() # <<<<<<<<<<<<<< + * + * def full(self): + */ + __pyx_r = (!(((struct __pyx_vtabstruct_6gevent_6_queue_Queue *)__pyx_v_self->__pyx_vtab)->qsize(__pyx_v_self, 0) != 0)); + goto __pyx_L0; + + /* "src/gevent/queue.py":232 + * return True + * + * def empty(self): # <<<<<<<<<<<<<< + * """Return ``True`` if the queue is empty, ``False`` otherwise.""" + * return not self.qsize() + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_WriteUnraisable("gevent._queue.Queue.empty", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_queue_5Queue_27empty(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6gevent_6_queue_5Queue_26empty[] = "Queue.empty(self) -> bool\nReturn ``True`` if the queue is empty, ``False`` otherwise."; +static PyMethodDef __pyx_mdef_6gevent_6_queue_5Queue_27empty = {"empty", (PyCFunction)__pyx_pw_6gevent_6_queue_5Queue_27empty, METH_NOARGS, __pyx_doc_6gevent_6_queue_5Queue_26empty}; +static PyObject *__pyx_pw_6gevent_6_queue_5Queue_27empty(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("empty (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6_queue_5Queue_26empty(((struct __pyx_obj_6gevent_6_queue_Queue *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_queue_5Queue_26empty(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("empty", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_f_6gevent_6_queue_5Queue_empty(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 232, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent._queue.Queue.empty", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/queue.py":236 + * return not self.qsize() + * + * def full(self): # <<<<<<<<<<<<<< + * """Return ``True`` if the queue is full, ``False`` otherwise. + * + */ + +static PyObject *__pyx_pw_6gevent_6_queue_5Queue_29full(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static int __pyx_f_6gevent_6_queue_5Queue_full(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self, int __pyx_skip_dispatch) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + int __pyx_t_6; + __Pyx_RefNannySetupContext("full", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0; + if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self)))))); + else { + PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + #endif + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_full); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 236, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_6_queue_5Queue_29full)) { + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 236, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 236, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_5; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0; + if (unlikely(type_dict_guard != tp_dict_version)) { + tp_dict_version = obj_dict_version = 0; + } + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + } + #endif + } + + /* "src/gevent/queue.py":241 + * ``Queue(None)`` is never full. + * """ + * return self._maxsize > 0 and self.qsize() >= self._maxsize # <<<<<<<<<<<<<< + * + * def put(self, item, block=True, timeout=None): + */ + __pyx_t_6 = ((__pyx_v_self->_maxsize > 0) != 0); + if (__pyx_t_6) { + } else { + __pyx_t_5 = __pyx_t_6; + goto __pyx_L3_bool_binop_done; + } + __pyx_t_6 = ((((struct __pyx_vtabstruct_6gevent_6_queue_Queue *)__pyx_v_self->__pyx_vtab)->qsize(__pyx_v_self, 0) >= __pyx_v_self->_maxsize) != 0); + __pyx_t_5 = __pyx_t_6; + __pyx_L3_bool_binop_done:; + __pyx_r = __pyx_t_5; + goto __pyx_L0; + + /* "src/gevent/queue.py":236 + * return not self.qsize() + * + * def full(self): # <<<<<<<<<<<<<< + * """Return ``True`` if the queue is full, ``False`` otherwise. + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_WriteUnraisable("gevent._queue.Queue.full", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_queue_5Queue_29full(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6gevent_6_queue_5Queue_28full[] = "Queue.full(self) -> bool\nReturn ``True`` if the queue is full, ``False`` otherwise.\n\n ``Queue(None)`` is never full.\n "; +static PyMethodDef __pyx_mdef_6gevent_6_queue_5Queue_29full = {"full", (PyCFunction)__pyx_pw_6gevent_6_queue_5Queue_29full, METH_NOARGS, __pyx_doc_6gevent_6_queue_5Queue_28full}; +static PyObject *__pyx_pw_6gevent_6_queue_5Queue_29full(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("full (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6_queue_5Queue_28full(((struct __pyx_obj_6gevent_6_queue_Queue *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_queue_5Queue_28full(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("full", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_f_6gevent_6_queue_5Queue_full(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 236, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent._queue.Queue.full", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/queue.py":243 + * return self._maxsize > 0 and self.qsize() >= self._maxsize + * + * def put(self, item, block=True, timeout=None): # <<<<<<<<<<<<<< + * """Put an item into the queue. + * + */ + +static PyObject *__pyx_pw_6gevent_6_queue_5Queue_31put(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_6gevent_6_queue_5Queue_put(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self, PyObject *__pyx_v_item, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_6_queue_5Queue_put *__pyx_optional_args) { + PyObject *__pyx_v_block = ((PyObject *)Py_True); + PyObject *__pyx_v_timeout = ((PyObject *)Py_None); + PyObject *__pyx_v_getter = NULL; + struct __pyx_obj_6gevent_6_queue_ItemWaiter *__pyx_v_waiter = NULL; + PyObject *__pyx_v_result = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + int __pyx_t_8; + int __pyx_t_9; + int __pyx_t_10; + char const *__pyx_t_11; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + PyObject *__pyx_t_14 = NULL; + PyObject *__pyx_t_15 = NULL; + PyObject *__pyx_t_16 = NULL; + PyObject *__pyx_t_17 = NULL; + __Pyx_RefNannySetupContext("put", 0); + if (__pyx_optional_args) { + if (__pyx_optional_args->__pyx_n > 0) { + __pyx_v_block = __pyx_optional_args->block; + if (__pyx_optional_args->__pyx_n > 1) { + __pyx_v_timeout = __pyx_optional_args->timeout; + } + } + } + __Pyx_INCREF(__pyx_v_timeout); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0; + if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self)))))); + else { + PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + #endif + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_put_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 243, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_6_queue_5Queue_31put)) { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; + __pyx_t_5 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_5 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_3)) { + PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_item, __pyx_v_block, __pyx_v_timeout}; + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 243, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GOTREF(__pyx_t_2); + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { + PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_item, __pyx_v_block, __pyx_v_timeout}; + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 243, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GOTREF(__pyx_t_2); + } else + #endif + { + __pyx_t_6 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 243, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (__pyx_t_4) { + __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL; + } + __Pyx_INCREF(__pyx_v_item); + __Pyx_GIVEREF(__pyx_v_item); + PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_item); + __Pyx_INCREF(__pyx_v_block); + __Pyx_GIVEREF(__pyx_v_block); + PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_block); + __Pyx_INCREF(__pyx_v_timeout); + __Pyx_GIVEREF(__pyx_v_timeout); + PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_v_timeout); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 243, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0; + if (unlikely(type_dict_guard != tp_dict_version)) { + tp_dict_version = obj_dict_version = 0; + } + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + } + #endif + } + + /* "src/gevent/queue.py":254 + * is ignored in that case). + * """ + * if self._maxsize == -1 or self.qsize() < self._maxsize: # <<<<<<<<<<<<<< + * # there's a free slot, put an item right away + * self._put(item) + */ + __pyx_t_8 = ((__pyx_v_self->_maxsize == -1L) != 0); + if (!__pyx_t_8) { + } else { + __pyx_t_7 = __pyx_t_8; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_8 = ((((struct __pyx_vtabstruct_6gevent_6_queue_Queue *)__pyx_v_self->__pyx_vtab)->qsize(__pyx_v_self, 0) < __pyx_v_self->_maxsize) != 0); + __pyx_t_7 = __pyx_t_8; + __pyx_L4_bool_binop_done:; + if (__pyx_t_7) { + + /* "src/gevent/queue.py":256 + * if self._maxsize == -1 or self.qsize() < self._maxsize: + * # there's a free slot, put an item right away + * self._put(item) # <<<<<<<<<<<<<< + * if self.getters: + * self._schedule_unlock() + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_6_queue_Queue *)__pyx_v_self->__pyx_vtab)->_put(__pyx_v_self, __pyx_v_item, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 256, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/queue.py":257 + * # there's a free slot, put an item right away + * self._put(item) + * if self.getters: # <<<<<<<<<<<<<< + * self._schedule_unlock() + * elif self.hub is getcurrent(): + */ + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_self->getters); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 257, __pyx_L1_error) + if (__pyx_t_7) { + + /* "src/gevent/queue.py":258 + * self._put(item) + * if self.getters: + * self._schedule_unlock() # <<<<<<<<<<<<<< + * elif self.hub is getcurrent(): + * # We're in the mainloop, so we cannot wait; we can switch to other greenlets though. + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_6_queue_Queue *)__pyx_v_self->__pyx_vtab)->_schedule_unlock(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 258, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/queue.py":257 + * # there's a free slot, put an item right away + * self._put(item) + * if self.getters: # <<<<<<<<<<<<<< + * self._schedule_unlock() + * elif self.hub is getcurrent(): + */ + } + + /* "src/gevent/queue.py":254 + * is ignored in that case). + * """ + * if self._maxsize == -1 or self.qsize() < self._maxsize: # <<<<<<<<<<<<<< + * # there's a free slot, put an item right away + * self._put(item) + */ + goto __pyx_L3; + } + + /* "src/gevent/queue.py":259 + * if self.getters: + * self._schedule_unlock() + * elif self.hub is getcurrent(): # <<<<<<<<<<<<<< + * # We're in the mainloop, so we cannot wait; we can switch to other greenlets though. + * # Check if possible to get a free slot in the queue. + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_getcurrent); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 259, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 259, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_7 = (__pyx_v_self->hub == __pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_8 = (__pyx_t_7 != 0); + if (__pyx_t_8) { + + /* "src/gevent/queue.py":262 + * # We're in the mainloop, so we cannot wait; we can switch to other greenlets though. + * # Check if possible to get a free slot in the queue. + * while self.getters and self.qsize() and self.qsize() >= self._maxsize: # <<<<<<<<<<<<<< + * getter = self.getters.popleft() + * getter.switch(getter) + */ + while (1) { + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_self->getters); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 262, __pyx_L1_error) + if (__pyx_t_7) { + } else { + __pyx_t_8 = __pyx_t_7; + goto __pyx_L9_bool_binop_done; + } + __pyx_t_7 = (((struct __pyx_vtabstruct_6gevent_6_queue_Queue *)__pyx_v_self->__pyx_vtab)->qsize(__pyx_v_self, 0) != 0); + if (__pyx_t_7) { + } else { + __pyx_t_8 = __pyx_t_7; + goto __pyx_L9_bool_binop_done; + } + __pyx_t_7 = ((((struct __pyx_vtabstruct_6gevent_6_queue_Queue *)__pyx_v_self->__pyx_vtab)->qsize(__pyx_v_self, 0) >= __pyx_v_self->_maxsize) != 0); + __pyx_t_8 = __pyx_t_7; + __pyx_L9_bool_binop_done:; + if (!__pyx_t_8) break; + + /* "src/gevent/queue.py":263 + * # Check if possible to get a free slot in the queue. + * while self.getters and self.qsize() and self.qsize() >= self._maxsize: + * getter = self.getters.popleft() # <<<<<<<<<<<<<< + * getter.switch(getter) + * if self.qsize() < self._maxsize: + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->getters, __pyx_n_s_popleft); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 263, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 263, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF_SET(__pyx_v_getter, __pyx_t_1); + __pyx_t_1 = 0; + + /* "src/gevent/queue.py":264 + * while self.getters and self.qsize() and self.qsize() >= self._maxsize: + * getter = self.getters.popleft() + * getter.switch(getter) # <<<<<<<<<<<<<< + * if self.qsize() < self._maxsize: + * self._put(item) + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_getter, __pyx_n_s_switch); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 264, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_getter) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_getter); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 264, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + + /* "src/gevent/queue.py":265 + * getter = self.getters.popleft() + * getter.switch(getter) + * if self.qsize() < self._maxsize: # <<<<<<<<<<<<<< + * self._put(item) + * return + */ + __pyx_t_8 = ((((struct __pyx_vtabstruct_6gevent_6_queue_Queue *)__pyx_v_self->__pyx_vtab)->qsize(__pyx_v_self, 0) < __pyx_v_self->_maxsize) != 0); + if (__pyx_t_8) { + + /* "src/gevent/queue.py":266 + * getter.switch(getter) + * if self.qsize() < self._maxsize: + * self._put(item) # <<<<<<<<<<<<<< + * return + * raise Full + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_6_queue_Queue *)__pyx_v_self->__pyx_vtab)->_put(__pyx_v_self, __pyx_v_item, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 266, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/queue.py":267 + * if self.qsize() < self._maxsize: + * self._put(item) + * return # <<<<<<<<<<<<<< + * raise Full + * elif block: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + + /* "src/gevent/queue.py":265 + * getter = self.getters.popleft() + * getter.switch(getter) + * if self.qsize() < self._maxsize: # <<<<<<<<<<<<<< + * self._put(item) + * return + */ + } + + /* "src/gevent/queue.py":268 + * self._put(item) + * return + * raise Full # <<<<<<<<<<<<<< + * elif block: + * waiter = ItemWaiter(item, self) + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Full); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 268, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 268, __pyx_L1_error) + + /* "src/gevent/queue.py":259 + * if self.getters: + * self._schedule_unlock() + * elif self.hub is getcurrent(): # <<<<<<<<<<<<<< + * # We're in the mainloop, so we cannot wait; we can switch to other greenlets though. + * # Check if possible to get a free slot in the queue. + */ + } + + /* "src/gevent/queue.py":269 + * return + * raise Full + * elif block: # <<<<<<<<<<<<<< + * waiter = ItemWaiter(item, self) + * self.putters.append(waiter) + */ + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_block); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 269, __pyx_L1_error) + if (likely(__pyx_t_8)) { + + /* "src/gevent/queue.py":270 + * raise Full + * elif block: + * waiter = ItemWaiter(item, self) # <<<<<<<<<<<<<< + * self.putters.append(waiter) + * timeout = Timeout._start_new_or_dummy(timeout, Full) + */ + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 270, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_item); + __Pyx_GIVEREF(__pyx_v_item); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_item); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_self)); + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6gevent_6_queue_ItemWaiter), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 270, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_waiter = ((struct __pyx_obj_6gevent_6_queue_ItemWaiter *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "src/gevent/queue.py":271 + * elif block: + * waiter = ItemWaiter(item, self) + * self.putters.append(waiter) # <<<<<<<<<<<<<< + * timeout = Timeout._start_new_or_dummy(timeout, Full) + * try: + */ + __pyx_t_9 = __Pyx_PyObject_Append(__pyx_v_self->putters, ((PyObject *)__pyx_v_waiter)); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 271, __pyx_L1_error) + + /* "src/gevent/queue.py":272 + * waiter = ItemWaiter(item, self) + * self.putters.append(waiter) + * timeout = Timeout._start_new_or_dummy(timeout, Full) # <<<<<<<<<<<<<< + * try: + * if self.getters: + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Timeout); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 272, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_start_new_or_dummy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 272, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Full); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 272, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = NULL; + __pyx_t_5 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_6)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_5 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_3)) { + PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_timeout, __pyx_t_1}; + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 272, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { + PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_timeout, __pyx_t_1}; + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 272, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else + #endif + { + __pyx_t_4 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 272, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (__pyx_t_6) { + __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6); __pyx_t_6 = NULL; + } + __Pyx_INCREF(__pyx_v_timeout); + __Pyx_GIVEREF(__pyx_v_timeout); + PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_5, __pyx_v_timeout); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_5, __pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 272, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF_SET(__pyx_v_timeout, __pyx_t_2); + __pyx_t_2 = 0; + + /* "src/gevent/queue.py":273 + * self.putters.append(waiter) + * timeout = Timeout._start_new_or_dummy(timeout, Full) + * try: # <<<<<<<<<<<<<< + * if self.getters: + * self._schedule_unlock() + */ + /*try:*/ { + + /* "src/gevent/queue.py":274 + * timeout = Timeout._start_new_or_dummy(timeout, Full) + * try: + * if self.getters: # <<<<<<<<<<<<<< + * self._schedule_unlock() + * result = waiter.get() + */ + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_self->getters); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 274, __pyx_L14_error) + if (__pyx_t_8) { + + /* "src/gevent/queue.py":275 + * try: + * if self.getters: + * self._schedule_unlock() # <<<<<<<<<<<<<< + * result = waiter.get() + * if result is not waiter: + */ + __pyx_t_2 = ((struct __pyx_vtabstruct_6gevent_6_queue_Queue *)__pyx_v_self->__pyx_vtab)->_schedule_unlock(__pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 275, __pyx_L14_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/queue.py":274 + * timeout = Timeout._start_new_or_dummy(timeout, Full) + * try: + * if self.getters: # <<<<<<<<<<<<<< + * self._schedule_unlock() + * result = waiter.get() + */ + } + + /* "src/gevent/queue.py":276 + * if self.getters: + * self._schedule_unlock() + * result = waiter.get() # <<<<<<<<<<<<<< + * if result is not waiter: + * raise InvalidSwitchError("Invalid switch into Queue.put: %r" % (result, )) + */ + __pyx_t_2 = ((struct __pyx_vtabstruct_6gevent_6_queue_ItemWaiter *)__pyx_v_waiter->__pyx_base.__pyx_vtab)->__pyx_base.get(((struct __pyx_obj_6gevent_8__waiter_Waiter *)__pyx_v_waiter), 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 276, __pyx_L14_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_result = __pyx_t_2; + __pyx_t_2 = 0; + + /* "src/gevent/queue.py":277 + * self._schedule_unlock() + * result = waiter.get() + * if result is not waiter: # <<<<<<<<<<<<<< + * raise InvalidSwitchError("Invalid switch into Queue.put: %r" % (result, )) + * finally: + */ + __pyx_t_8 = (__pyx_v_result != ((PyObject *)__pyx_v_waiter)); + __pyx_t_7 = (__pyx_t_8 != 0); + if (unlikely(__pyx_t_7)) { + + /* "src/gevent/queue.py":278 + * result = waiter.get() + * if result is not waiter: + * raise InvalidSwitchError("Invalid switch into Queue.put: %r" % (result, )) # <<<<<<<<<<<<<< + * finally: + * timeout.cancel() + */ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_InvalidSwitchError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 278, __pyx_L14_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 278, __pyx_L14_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_result); + __Pyx_GIVEREF(__pyx_v_result); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_result); + __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_switch_into_Queue_put_r, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 278, __pyx_L14_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_t_1) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 278, __pyx_L14_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 278, __pyx_L14_error) + + /* "src/gevent/queue.py":277 + * self._schedule_unlock() + * result = waiter.get() + * if result is not waiter: # <<<<<<<<<<<<<< + * raise InvalidSwitchError("Invalid switch into Queue.put: %r" % (result, )) + * finally: + */ + } + } + + /* "src/gevent/queue.py":280 + * raise InvalidSwitchError("Invalid switch into Queue.put: %r" % (result, )) + * finally: + * timeout.cancel() # <<<<<<<<<<<<<< + * _safe_remove(self.putters, waiter) + * else: + */ + /*finally:*/ { + /*normal exit:*/{ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_timeout, __pyx_n_s_cancel); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 280, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_1)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_1); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_1) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1) : __Pyx_PyObject_CallNoArg(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 280, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/queue.py":281 + * finally: + * timeout.cancel() + * _safe_remove(self.putters, waiter) # <<<<<<<<<<<<<< + * else: + * raise Full + */ + __pyx_t_2 = __pyx_v_self->putters; + __Pyx_INCREF(__pyx_t_2); + __pyx_t_3 = __pyx_f_6gevent_6_queue__safe_remove(__pyx_t_2, ((PyObject *)__pyx_v_waiter)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 281, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L15; + } + __pyx_L14_error:; + /*exception exit:*/{ + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17); + if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14) < 0)) __Pyx_ErrFetch(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14); + __Pyx_XGOTREF(__pyx_t_12); + __Pyx_XGOTREF(__pyx_t_13); + __Pyx_XGOTREF(__pyx_t_14); + __Pyx_XGOTREF(__pyx_t_15); + __Pyx_XGOTREF(__pyx_t_16); + __Pyx_XGOTREF(__pyx_t_17); + __pyx_t_5 = __pyx_lineno; __pyx_t_10 = __pyx_clineno; __pyx_t_11 = __pyx_filename; + { + + /* "src/gevent/queue.py":280 + * raise InvalidSwitchError("Invalid switch into Queue.put: %r" % (result, )) + * finally: + * timeout.cancel() # <<<<<<<<<<<<<< + * _safe_remove(self.putters, waiter) + * else: + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_timeout, __pyx_n_s_cancel); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 280, __pyx_L19_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_1)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_1); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_3 = (__pyx_t_1) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_1) : __Pyx_PyObject_CallNoArg(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 280, __pyx_L19_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "src/gevent/queue.py":281 + * finally: + * timeout.cancel() + * _safe_remove(self.putters, waiter) # <<<<<<<<<<<<<< + * else: + * raise Full + */ + __pyx_t_3 = __pyx_v_self->putters; + __Pyx_INCREF(__pyx_t_3); + __pyx_t_2 = __pyx_f_6gevent_6_queue__safe_remove(__pyx_t_3, ((PyObject *)__pyx_v_waiter)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 281, __pyx_L19_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + if (PY_MAJOR_VERSION >= 3) { + __Pyx_XGIVEREF(__pyx_t_15); + __Pyx_XGIVEREF(__pyx_t_16); + __Pyx_XGIVEREF(__pyx_t_17); + __Pyx_ExceptionReset(__pyx_t_15, __pyx_t_16, __pyx_t_17); + } + __Pyx_XGIVEREF(__pyx_t_12); + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_ErrRestore(__pyx_t_12, __pyx_t_13, __pyx_t_14); + __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; + __pyx_lineno = __pyx_t_5; __pyx_clineno = __pyx_t_10; __pyx_filename = __pyx_t_11; + goto __pyx_L1_error; + __pyx_L19_error:; + if (PY_MAJOR_VERSION >= 3) { + __Pyx_XGIVEREF(__pyx_t_15); + __Pyx_XGIVEREF(__pyx_t_16); + __Pyx_XGIVEREF(__pyx_t_17); + __Pyx_ExceptionReset(__pyx_t_15, __pyx_t_16, __pyx_t_17); + } + __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; + __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; + goto __pyx_L1_error; + } + __pyx_L15:; + } + + /* "src/gevent/queue.py":269 + * return + * raise Full + * elif block: # <<<<<<<<<<<<<< + * waiter = ItemWaiter(item, self) + * self.putters.append(waiter) + */ + goto __pyx_L3; + } + + /* "src/gevent/queue.py":283 + * _safe_remove(self.putters, waiter) + * else: + * raise Full # <<<<<<<<<<<<<< + * + * def put_nowait(self, item): + */ + /*else*/ { + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Full); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 283, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 283, __pyx_L1_error) + } + __pyx_L3:; + + /* "src/gevent/queue.py":243 + * return self._maxsize > 0 and self.qsize() >= self._maxsize + * + * def put(self, item, block=True, timeout=None): # <<<<<<<<<<<<<< + * """Put an item into the queue. + * + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("gevent._queue.Queue.put", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_getter); + __Pyx_XDECREF((PyObject *)__pyx_v_waiter); + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XDECREF(__pyx_v_timeout); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_queue_5Queue_31put(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6gevent_6_queue_5Queue_30put[] = "Queue.put(self, item, block=True, timeout=None)\nPut an item into the queue.\n\n If optional arg *block* is true and *timeout* is ``None`` (the default),\n block if necessary until a free slot is available. If *timeout* is\n a positive number, it blocks at most *timeout* seconds and raises\n the :class:`Full` exception if no free slot was available within that time.\n Otherwise (*block* is false), put an item on the queue if a free slot\n is immediately available, else raise the :class:`Full` exception (*timeout*\n is ignored in that case).\n "; +static PyMethodDef __pyx_mdef_6gevent_6_queue_5Queue_31put = {"put", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_6_queue_5Queue_31put, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_6_queue_5Queue_30put}; +static PyObject *__pyx_pw_6gevent_6_queue_5Queue_31put(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_item = 0; + PyObject *__pyx_v_block = 0; + PyObject *__pyx_v_timeout = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("put (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_item,&__pyx_n_s_block,&__pyx_n_s_timeout,0}; + PyObject* values[3] = {0,0,0}; + values[1] = ((PyObject *)Py_True); + values[2] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_item)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_block); + if (value) { values[1] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 2: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_timeout); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "put") < 0)) __PYX_ERR(0, 243, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_item = values[0]; + __pyx_v_block = values[1]; + __pyx_v_timeout = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("put", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 243, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent._queue.Queue.put", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_6_queue_5Queue_30put(((struct __pyx_obj_6gevent_6_queue_Queue *)__pyx_v_self), __pyx_v_item, __pyx_v_block, __pyx_v_timeout); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_queue_5Queue_30put(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_block, PyObject *__pyx_v_timeout) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + struct __pyx_opt_args_6gevent_6_queue_5Queue_put __pyx_t_2; + __Pyx_RefNannySetupContext("put", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_2.__pyx_n = 2; + __pyx_t_2.block = __pyx_v_block; + __pyx_t_2.timeout = __pyx_v_timeout; + __pyx_t_1 = __pyx_vtabptr_6gevent_6_queue_Queue->put(__pyx_v_self, __pyx_v_item, 1, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 243, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent._queue.Queue.put", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/queue.py":285 + * raise Full + * + * def put_nowait(self, item): # <<<<<<<<<<<<<< + * """Put an item into the queue without blocking. + * + */ + +static PyObject *__pyx_pw_6gevent_6_queue_5Queue_33put_nowait(PyObject *__pyx_v_self, PyObject *__pyx_v_item); /*proto*/ +static PyObject *__pyx_f_6gevent_6_queue_5Queue_put_nowait(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self, PyObject *__pyx_v_item, int __pyx_skip_dispatch) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + struct __pyx_opt_args_6gevent_6_queue_5Queue_put __pyx_t_5; + __Pyx_RefNannySetupContext("put_nowait", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0; + if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self)))))); + else { + PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + #endif + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_put_nowait); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 285, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_6_queue_5Queue_33put_nowait)) { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_item) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_item); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 285, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0; + if (unlikely(type_dict_guard != tp_dict_version)) { + tp_dict_version = obj_dict_version = 0; + } + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + } + #endif + } + + /* "src/gevent/queue.py":291 + * Otherwise raise the :class:`Full` exception. + * """ + * self.put(item, False) # <<<<<<<<<<<<<< + * + * def __get_or_peek(self, method, block, timeout): + */ + __pyx_t_5.__pyx_n = 1; + __pyx_t_5.block = Py_False; + __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_6_queue_Queue *)__pyx_v_self->__pyx_vtab)->put(__pyx_v_self, __pyx_v_item, 0, &__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 291, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/queue.py":285 + * raise Full + * + * def put_nowait(self, item): # <<<<<<<<<<<<<< + * """Put an item into the queue without blocking. + * + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("gevent._queue.Queue.put_nowait", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_queue_5Queue_33put_nowait(PyObject *__pyx_v_self, PyObject *__pyx_v_item); /*proto*/ +static char __pyx_doc_6gevent_6_queue_5Queue_32put_nowait[] = "Queue.put_nowait(self, item)\nPut an item into the queue without blocking.\n\n Only enqueue the item if a free slot is immediately available.\n Otherwise raise the :class:`Full` exception.\n "; +static PyMethodDef __pyx_mdef_6gevent_6_queue_5Queue_33put_nowait = {"put_nowait", (PyCFunction)__pyx_pw_6gevent_6_queue_5Queue_33put_nowait, METH_O, __pyx_doc_6gevent_6_queue_5Queue_32put_nowait}; +static PyObject *__pyx_pw_6gevent_6_queue_5Queue_33put_nowait(PyObject *__pyx_v_self, PyObject *__pyx_v_item) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("put_nowait (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6_queue_5Queue_32put_nowait(((struct __pyx_obj_6gevent_6_queue_Queue *)__pyx_v_self), ((PyObject *)__pyx_v_item)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_queue_5Queue_32put_nowait(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self, PyObject *__pyx_v_item) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("put_nowait", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6gevent_6_queue_5Queue_put_nowait(__pyx_v_self, __pyx_v_item, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 285, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent._queue.Queue.put_nowait", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/queue.py":293 + * self.put(item, False) + * + * def __get_or_peek(self, method, block, timeout): # <<<<<<<<<<<<<< + * # Internal helper method. The `method` should be either + * # self._get when called from self.get() or self._peek when + */ + +static PyObject *__pyx_f_6gevent_6_queue_5Queue___get_or_peek(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self, PyObject *__pyx_v_method, PyObject *__pyx_v_block, PyObject *__pyx_v_timeout) { + struct __pyx_obj_6gevent_8__waiter_Waiter *__pyx_v_waiter = NULL; + PyObject *__pyx_v_result = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + int __pyx_t_9; + int __pyx_t_10; + char const *__pyx_t_11; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + PyObject *__pyx_t_14 = NULL; + PyObject *__pyx_t_15 = NULL; + PyObject *__pyx_t_16 = NULL; + PyObject *__pyx_t_17 = NULL; + __Pyx_RefNannySetupContext("__get_or_peek", 0); + __Pyx_INCREF(__pyx_v_timeout); + + /* "src/gevent/queue.py":299 + * # to see if there are items in the queue. + * + * if self.hub is getcurrent(): # <<<<<<<<<<<<<< + * # special case to make get_nowait() or peek_nowait() runnable in the mainloop greenlet + * # there are no items in the queue; try to fix the situation by unlocking putters + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_getcurrent); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 299, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 299, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_4 = (__pyx_v_self->hub == __pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_5 = (__pyx_t_4 != 0); + if (__pyx_t_5) { + + /* "src/gevent/queue.py":302 + * # special case to make get_nowait() or peek_nowait() runnable in the mainloop greenlet + * # there are no items in the queue; try to fix the situation by unlocking putters + * while self.putters: # <<<<<<<<<<<<<< + * # Note: get() used popleft(), peek used pop(); popleft + * # is almost certainly correct. + */ + while (1) { + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_self->putters); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 302, __pyx_L1_error) + if (!__pyx_t_5) break; + + /* "src/gevent/queue.py":305 + * # Note: get() used popleft(), peek used pop(); popleft + * # is almost certainly correct. + * self.putters.popleft().put_and_switch() # <<<<<<<<<<<<<< + * if self.qsize(): + * return method() + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->putters, __pyx_n_s_popleft); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 305, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_6 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_6)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 305, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_put_and_switch); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 305, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_2)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 305, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/queue.py":306 + * # is almost certainly correct. + * self.putters.popleft().put_and_switch() + * if self.qsize(): # <<<<<<<<<<<<<< + * return method() + * raise Empty() + */ + __pyx_t_5 = (((struct __pyx_vtabstruct_6gevent_6_queue_Queue *)__pyx_v_self->__pyx_vtab)->qsize(__pyx_v_self, 0) != 0); + if (__pyx_t_5) { + + /* "src/gevent/queue.py":307 + * self.putters.popleft().put_and_switch() + * if self.qsize(): + * return method() # <<<<<<<<<<<<<< + * raise Empty() + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_method); + __pyx_t_3 = __pyx_v_method; __pyx_t_2 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_2)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 307, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "src/gevent/queue.py":306 + * # is almost certainly correct. + * self.putters.popleft().put_and_switch() + * if self.qsize(): # <<<<<<<<<<<<<< + * return method() + * raise Empty() + */ + } + } + + /* "src/gevent/queue.py":308 + * if self.qsize(): + * return method() + * raise Empty() # <<<<<<<<<<<<<< + * + * if not block: + */ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Empty); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 308, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_2)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 308, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 308, __pyx_L1_error) + + /* "src/gevent/queue.py":299 + * # to see if there are items in the queue. + * + * if self.hub is getcurrent(): # <<<<<<<<<<<<<< + * # special case to make get_nowait() or peek_nowait() runnable in the mainloop greenlet + * # there are no items in the queue; try to fix the situation by unlocking putters + */ + } + + /* "src/gevent/queue.py":310 + * raise Empty() + * + * if not block: # <<<<<<<<<<<<<< + * # We can't block, we're not the hub, and we have nothing + * # to return. No choice... + */ + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_block); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 310, __pyx_L1_error) + __pyx_t_4 = ((!__pyx_t_5) != 0); + if (unlikely(__pyx_t_4)) { + + /* "src/gevent/queue.py":313 + * # We can't block, we're not the hub, and we have nothing + * # to return. No choice... + * raise Empty() # <<<<<<<<<<<<<< + * + * waiter = Waiter() # pylint:disable=undefined-variable + */ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Empty); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 313, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_2)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 313, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 313, __pyx_L1_error) + + /* "src/gevent/queue.py":310 + * raise Empty() + * + * if not block: # <<<<<<<<<<<<<< + * # We can't block, we're not the hub, and we have nothing + * # to return. No choice... + */ + } + + /* "src/gevent/queue.py":315 + * raise Empty() + * + * waiter = Waiter() # pylint:disable=undefined-variable # <<<<<<<<<<<<<< + * timeout = Timeout._start_new_or_dummy(timeout, Empty) + * try: + */ + __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_6gevent_8__waiter_Waiter)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 315, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_waiter = ((struct __pyx_obj_6gevent_8__waiter_Waiter *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "src/gevent/queue.py":316 + * + * waiter = Waiter() # pylint:disable=undefined-variable + * timeout = Timeout._start_new_or_dummy(timeout, Empty) # <<<<<<<<<<<<<< + * try: + * self.getters.append(waiter) + */ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Timeout); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 316, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_start_new_or_dummy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 316, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Empty); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 316, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_6 = NULL; + __pyx_t_7 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_6)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_7 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_timeout, __pyx_t_3}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 316, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_timeout, __pyx_t_3}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 316, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } else + #endif + { + __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 316, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + if (__pyx_t_6) { + __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL; + } + __Pyx_INCREF(__pyx_v_timeout); + __Pyx_GIVEREF(__pyx_v_timeout); + PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_v_timeout); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 316, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF_SET(__pyx_v_timeout, __pyx_t_1); + __pyx_t_1 = 0; + + /* "src/gevent/queue.py":317 + * waiter = Waiter() # pylint:disable=undefined-variable + * timeout = Timeout._start_new_or_dummy(timeout, Empty) + * try: # <<<<<<<<<<<<<< + * self.getters.append(waiter) + * if self.putters: + */ + /*try:*/ { + + /* "src/gevent/queue.py":318 + * timeout = Timeout._start_new_or_dummy(timeout, Empty) + * try: + * self.getters.append(waiter) # <<<<<<<<<<<<<< + * if self.putters: + * self._schedule_unlock() + */ + __pyx_t_9 = __Pyx_PyObject_Append(__pyx_v_self->getters, ((PyObject *)__pyx_v_waiter)); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 318, __pyx_L9_error) + + /* "src/gevent/queue.py":319 + * try: + * self.getters.append(waiter) + * if self.putters: # <<<<<<<<<<<<<< + * self._schedule_unlock() + * result = waiter.get() + */ + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_self->putters); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 319, __pyx_L9_error) + if (__pyx_t_4) { + + /* "src/gevent/queue.py":320 + * self.getters.append(waiter) + * if self.putters: + * self._schedule_unlock() # <<<<<<<<<<<<<< + * result = waiter.get() + * if result is not waiter: + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_6_queue_Queue *)__pyx_v_self->__pyx_vtab)->_schedule_unlock(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 320, __pyx_L9_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/queue.py":319 + * try: + * self.getters.append(waiter) + * if self.putters: # <<<<<<<<<<<<<< + * self._schedule_unlock() + * result = waiter.get() + */ + } + + /* "src/gevent/queue.py":321 + * if self.putters: + * self._schedule_unlock() + * result = waiter.get() # <<<<<<<<<<<<<< + * if result is not waiter: + * raise InvalidSwitchError('Invalid switch into Queue.get: %r' % (result, )) + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_8__waiter_Waiter *)__pyx_v_waiter->__pyx_vtab)->get(__pyx_v_waiter, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 321, __pyx_L9_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_result = __pyx_t_1; + __pyx_t_1 = 0; + + /* "src/gevent/queue.py":322 + * self._schedule_unlock() + * result = waiter.get() + * if result is not waiter: # <<<<<<<<<<<<<< + * raise InvalidSwitchError('Invalid switch into Queue.get: %r' % (result, )) + * return method() + */ + __pyx_t_4 = (__pyx_v_result != ((PyObject *)__pyx_v_waiter)); + __pyx_t_5 = (__pyx_t_4 != 0); + if (unlikely(__pyx_t_5)) { + + /* "src/gevent/queue.py":323 + * result = waiter.get() + * if result is not waiter: + * raise InvalidSwitchError('Invalid switch into Queue.get: %r' % (result, )) # <<<<<<<<<<<<<< + * return method() + * finally: + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_InvalidSwitchError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 323, __pyx_L9_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 323, __pyx_L9_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(__pyx_v_result); + __Pyx_GIVEREF(__pyx_v_result); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_result); + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_switch_into_Queue_get_r, __pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 323, __pyx_L9_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_8)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_8); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_8, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 323, __pyx_L9_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 323, __pyx_L9_error) + + /* "src/gevent/queue.py":322 + * self._schedule_unlock() + * result = waiter.get() + * if result is not waiter: # <<<<<<<<<<<<<< + * raise InvalidSwitchError('Invalid switch into Queue.get: %r' % (result, )) + * return method() + */ + } + + /* "src/gevent/queue.py":324 + * if result is not waiter: + * raise InvalidSwitchError('Invalid switch into Queue.get: %r' % (result, )) + * return method() # <<<<<<<<<<<<<< + * finally: + * timeout.cancel() + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_method); + __pyx_t_2 = __pyx_v_method; __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 324, __pyx_L9_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L8_return; + } + + /* "src/gevent/queue.py":326 + * return method() + * finally: + * timeout.cancel() # <<<<<<<<<<<<<< + * _safe_remove(self.getters, waiter) + * + */ + /*finally:*/ { + __pyx_L9_error:; + /*exception exit:*/{ + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17); + if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14) < 0)) __Pyx_ErrFetch(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14); + __Pyx_XGOTREF(__pyx_t_12); + __Pyx_XGOTREF(__pyx_t_13); + __Pyx_XGOTREF(__pyx_t_14); + __Pyx_XGOTREF(__pyx_t_15); + __Pyx_XGOTREF(__pyx_t_16); + __Pyx_XGOTREF(__pyx_t_17); + __pyx_t_7 = __pyx_lineno; __pyx_t_10 = __pyx_clineno; __pyx_t_11 = __pyx_filename; + { + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_timeout, __pyx_n_s_cancel); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 326, __pyx_L14_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 326, __pyx_L14_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/queue.py":327 + * finally: + * timeout.cancel() + * _safe_remove(self.getters, waiter) # <<<<<<<<<<<<<< + * + * def get(self, block=True, timeout=None): + */ + __pyx_t_1 = __pyx_v_self->getters; + __Pyx_INCREF(__pyx_t_1); + __pyx_t_2 = __pyx_f_6gevent_6_queue__safe_remove(__pyx_t_1, ((PyObject *)__pyx_v_waiter)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 327, __pyx_L14_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + if (PY_MAJOR_VERSION >= 3) { + __Pyx_XGIVEREF(__pyx_t_15); + __Pyx_XGIVEREF(__pyx_t_16); + __Pyx_XGIVEREF(__pyx_t_17); + __Pyx_ExceptionReset(__pyx_t_15, __pyx_t_16, __pyx_t_17); + } + __Pyx_XGIVEREF(__pyx_t_12); + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_ErrRestore(__pyx_t_12, __pyx_t_13, __pyx_t_14); + __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; + __pyx_lineno = __pyx_t_7; __pyx_clineno = __pyx_t_10; __pyx_filename = __pyx_t_11; + goto __pyx_L1_error; + __pyx_L14_error:; + if (PY_MAJOR_VERSION >= 3) { + __Pyx_XGIVEREF(__pyx_t_15); + __Pyx_XGIVEREF(__pyx_t_16); + __Pyx_XGIVEREF(__pyx_t_17); + __Pyx_ExceptionReset(__pyx_t_15, __pyx_t_16, __pyx_t_17); + } + __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; + __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; + goto __pyx_L1_error; + } + __pyx_L8_return: { + __pyx_t_17 = __pyx_r; + __pyx_r = 0; + + /* "src/gevent/queue.py":326 + * return method() + * finally: + * timeout.cancel() # <<<<<<<<<<<<<< + * _safe_remove(self.getters, waiter) + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_timeout, __pyx_n_s_cancel); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 326, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_1, function); + } + } + __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 326, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/queue.py":327 + * finally: + * timeout.cancel() + * _safe_remove(self.getters, waiter) # <<<<<<<<<<<<<< + * + * def get(self, block=True, timeout=None): + */ + __pyx_t_2 = __pyx_v_self->getters; + __Pyx_INCREF(__pyx_t_2); + __pyx_t_1 = __pyx_f_6gevent_6_queue__safe_remove(__pyx_t_2, ((PyObject *)__pyx_v_waiter)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 327, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_17; + __pyx_t_17 = 0; + goto __pyx_L0; + } + } + + /* "src/gevent/queue.py":293 + * self.put(item, False) + * + * def __get_or_peek(self, method, block, timeout): # <<<<<<<<<<<<<< + * # Internal helper method. The `method` should be either + * # self._get when called from self.get() or self._peek when + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("gevent._queue.Queue.__get_or_peek", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_waiter); + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XDECREF(__pyx_v_timeout); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/queue.py":329 + * _safe_remove(self.getters, waiter) + * + * def get(self, block=True, timeout=None): # <<<<<<<<<<<<<< + * """Remove and return an item from the queue. + * + */ + +static PyObject *__pyx_pw_6gevent_6_queue_5Queue_35get(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_6gevent_6_queue_5Queue_get(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_6_queue_5Queue_get *__pyx_optional_args) { + PyObject *__pyx_v_block = ((PyObject *)Py_True); + PyObject *__pyx_v_timeout = ((PyObject *)Py_None); + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + __Pyx_RefNannySetupContext("get", 0); + if (__pyx_optional_args) { + if (__pyx_optional_args->__pyx_n > 0) { + __pyx_v_block = __pyx_optional_args->block; + if (__pyx_optional_args->__pyx_n > 1) { + __pyx_v_timeout = __pyx_optional_args->timeout; + } + } + } + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0; + if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self)))))); + else { + PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + #endif + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 329, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_6_queue_5Queue_35get)) { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; + __pyx_t_5 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_5 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_3)) { + PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_block, __pyx_v_timeout}; + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 329, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GOTREF(__pyx_t_2); + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { + PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_block, __pyx_v_timeout}; + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 329, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GOTREF(__pyx_t_2); + } else + #endif + { + __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 329, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (__pyx_t_4) { + __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL; + } + __Pyx_INCREF(__pyx_v_block); + __Pyx_GIVEREF(__pyx_v_block); + PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_block); + __Pyx_INCREF(__pyx_v_timeout); + __Pyx_GIVEREF(__pyx_v_timeout); + PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_timeout); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 329, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0; + if (unlikely(type_dict_guard != tp_dict_version)) { + tp_dict_version = obj_dict_version = 0; + } + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + } + #endif + } + + /* "src/gevent/queue.py":339 + * (*timeout* is ignored in that case). + * """ + * if self.qsize(): # <<<<<<<<<<<<<< + * if self.putters: + * self._schedule_unlock() + */ + __pyx_t_7 = (((struct __pyx_vtabstruct_6gevent_6_queue_Queue *)__pyx_v_self->__pyx_vtab)->qsize(__pyx_v_self, 0) != 0); + if (__pyx_t_7) { + + /* "src/gevent/queue.py":340 + * """ + * if self.qsize(): + * if self.putters: # <<<<<<<<<<<<<< + * self._schedule_unlock() + * return self._get() + */ + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_self->putters); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 340, __pyx_L1_error) + if (__pyx_t_7) { + + /* "src/gevent/queue.py":341 + * if self.qsize(): + * if self.putters: + * self._schedule_unlock() # <<<<<<<<<<<<<< + * return self._get() + * + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_6_queue_Queue *)__pyx_v_self->__pyx_vtab)->_schedule_unlock(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 341, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/queue.py":340 + * """ + * if self.qsize(): + * if self.putters: # <<<<<<<<<<<<<< + * self._schedule_unlock() + * return self._get() + */ + } + + /* "src/gevent/queue.py":342 + * if self.putters: + * self._schedule_unlock() + * return self._get() # <<<<<<<<<<<<<< + * + * return self.__get_or_peek(self._get, block, timeout) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_6_queue_Queue *)__pyx_v_self->__pyx_vtab)->_get(__pyx_v_self, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 342, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "src/gevent/queue.py":339 + * (*timeout* is ignored in that case). + * """ + * if self.qsize(): # <<<<<<<<<<<<<< + * if self.putters: + * self._schedule_unlock() + */ + } + + /* "src/gevent/queue.py":344 + * return self._get() + * + * return self.__get_or_peek(self._get, block, timeout) # <<<<<<<<<<<<<< + * + * def get_nowait(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 344, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = ((struct __pyx_vtabstruct_6gevent_6_queue_Queue *)__pyx_v_self->__pyx_vtab)->__pyx___get_or_peek(__pyx_v_self, __pyx_t_1, __pyx_v_block, __pyx_v_timeout); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 344, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "src/gevent/queue.py":329 + * _safe_remove(self.getters, waiter) + * + * def get(self, block=True, timeout=None): # <<<<<<<<<<<<<< + * """Remove and return an item from the queue. + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("gevent._queue.Queue.get", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_queue_5Queue_35get(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6gevent_6_queue_5Queue_34get[] = "Queue.get(self, block=True, timeout=None)\nRemove and return an item from the queue.\n\n If optional args *block* is true and *timeout* is ``None`` (the default),\n block if necessary until an item is available. If *timeout* is a positive number,\n it blocks at most *timeout* seconds and raises the :class:`Empty` exception\n if no item was available within that time. Otherwise (*block* is false), return\n an item if one is immediately available, else raise the :class:`Empty` exception\n (*timeout* is ignored in that case).\n "; +static PyMethodDef __pyx_mdef_6gevent_6_queue_5Queue_35get = {"get", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_6_queue_5Queue_35get, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_6_queue_5Queue_34get}; +static PyObject *__pyx_pw_6gevent_6_queue_5Queue_35get(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_block = 0; + PyObject *__pyx_v_timeout = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_block,&__pyx_n_s_timeout,0}; + PyObject* values[2] = {0,0}; + values[0] = ((PyObject *)Py_True); + values[1] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_block); + if (value) { values[0] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 1: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_timeout); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get") < 0)) __PYX_ERR(0, 329, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_block = values[0]; + __pyx_v_timeout = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("get", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 329, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent._queue.Queue.get", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_6_queue_5Queue_34get(((struct __pyx_obj_6gevent_6_queue_Queue *)__pyx_v_self), __pyx_v_block, __pyx_v_timeout); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_queue_5Queue_34get(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self, PyObject *__pyx_v_block, PyObject *__pyx_v_timeout) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + struct __pyx_opt_args_6gevent_6_queue_5Queue_get __pyx_t_2; + __Pyx_RefNannySetupContext("get", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_2.__pyx_n = 2; + __pyx_t_2.block = __pyx_v_block; + __pyx_t_2.timeout = __pyx_v_timeout; + __pyx_t_1 = __pyx_vtabptr_6gevent_6_queue_Queue->get(__pyx_v_self, 1, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 329, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent._queue.Queue.get", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/queue.py":346 + * return self.__get_or_peek(self._get, block, timeout) + * + * def get_nowait(self): # <<<<<<<<<<<<<< + * """Remove and return an item from the queue without blocking. + * + */ + +static PyObject *__pyx_pw_6gevent_6_queue_5Queue_37get_nowait(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_f_6gevent_6_queue_5Queue_get_nowait(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self, int __pyx_skip_dispatch) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + struct __pyx_opt_args_6gevent_6_queue_5Queue_get __pyx_t_5; + __Pyx_RefNannySetupContext("get_nowait", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0; + if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self)))))); + else { + PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + #endif + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_nowait); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 346, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_6_queue_5Queue_37get_nowait)) { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 346, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0; + if (unlikely(type_dict_guard != tp_dict_version)) { + tp_dict_version = obj_dict_version = 0; + } + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + } + #endif + } + + /* "src/gevent/queue.py":352 + * raise the :class:`Empty` exception. + * """ + * return self.get(False) # <<<<<<<<<<<<<< + * + * def peek(self, block=True, timeout=None): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_5.__pyx_n = 1; + __pyx_t_5.block = Py_False; + __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_6_queue_Queue *)__pyx_v_self->__pyx_vtab)->get(__pyx_v_self, 0, &__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 352, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "src/gevent/queue.py":346 + * return self.__get_or_peek(self._get, block, timeout) + * + * def get_nowait(self): # <<<<<<<<<<<<<< + * """Remove and return an item from the queue without blocking. + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("gevent._queue.Queue.get_nowait", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_queue_5Queue_37get_nowait(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6gevent_6_queue_5Queue_36get_nowait[] = "Queue.get_nowait(self)\nRemove and return an item from the queue without blocking.\n\n Only get an item if one is immediately available. Otherwise\n raise the :class:`Empty` exception.\n "; +static PyMethodDef __pyx_mdef_6gevent_6_queue_5Queue_37get_nowait = {"get_nowait", (PyCFunction)__pyx_pw_6gevent_6_queue_5Queue_37get_nowait, METH_NOARGS, __pyx_doc_6gevent_6_queue_5Queue_36get_nowait}; +static PyObject *__pyx_pw_6gevent_6_queue_5Queue_37get_nowait(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get_nowait (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6_queue_5Queue_36get_nowait(((struct __pyx_obj_6gevent_6_queue_Queue *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_queue_5Queue_36get_nowait(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("get_nowait", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6gevent_6_queue_5Queue_get_nowait(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 346, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent._queue.Queue.get_nowait", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/queue.py":354 + * return self.get(False) + * + * def peek(self, block=True, timeout=None): # <<<<<<<<<<<<<< + * """Return an item from the queue without removing it. + * + */ + +static PyObject *__pyx_pw_6gevent_6_queue_5Queue_39peek(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_6gevent_6_queue_5Queue_peek(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_6_queue_5Queue_peek *__pyx_optional_args) { + PyObject *__pyx_v_block = ((PyObject *)Py_True); + PyObject *__pyx_v_timeout = ((PyObject *)Py_None); + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + __Pyx_RefNannySetupContext("peek", 0); + if (__pyx_optional_args) { + if (__pyx_optional_args->__pyx_n > 0) { + __pyx_v_block = __pyx_optional_args->block; + if (__pyx_optional_args->__pyx_n > 1) { + __pyx_v_timeout = __pyx_optional_args->timeout; + } + } + } + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0; + if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self)))))); + else { + PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + #endif + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_peek_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 354, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_6_queue_5Queue_39peek)) { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; + __pyx_t_5 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_5 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_3)) { + PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_block, __pyx_v_timeout}; + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 354, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GOTREF(__pyx_t_2); + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { + PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_block, __pyx_v_timeout}; + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 354, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GOTREF(__pyx_t_2); + } else + #endif + { + __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 354, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (__pyx_t_4) { + __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL; + } + __Pyx_INCREF(__pyx_v_block); + __Pyx_GIVEREF(__pyx_v_block); + PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_block); + __Pyx_INCREF(__pyx_v_timeout); + __Pyx_GIVEREF(__pyx_v_timeout); + PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_timeout); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 354, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0; + if (unlikely(type_dict_guard != tp_dict_version)) { + tp_dict_version = obj_dict_version = 0; + } + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + } + #endif + } + + /* "src/gevent/queue.py":364 + * (*timeout* is ignored in that case). + * """ + * if self.qsize(): # <<<<<<<<<<<<<< + * # XXX: Why doesn't this schedule an unlock like get() does? + * return self._peek() + */ + __pyx_t_7 = (((struct __pyx_vtabstruct_6gevent_6_queue_Queue *)__pyx_v_self->__pyx_vtab)->qsize(__pyx_v_self, 0) != 0); + if (__pyx_t_7) { + + /* "src/gevent/queue.py":366 + * if self.qsize(): + * # XXX: Why doesn't this schedule an unlock like get() does? + * return self._peek() # <<<<<<<<<<<<<< + * + * return self.__get_or_peek(self._peek, block, timeout) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_6_queue_Queue *)__pyx_v_self->__pyx_vtab)->_peek(__pyx_v_self, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 366, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "src/gevent/queue.py":364 + * (*timeout* is ignored in that case). + * """ + * if self.qsize(): # <<<<<<<<<<<<<< + * # XXX: Why doesn't this schedule an unlock like get() does? + * return self._peek() + */ + } + + /* "src/gevent/queue.py":368 + * return self._peek() + * + * return self.__get_or_peek(self._peek, block, timeout) # <<<<<<<<<<<<<< + * + * def peek_nowait(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_peek); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 368, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = ((struct __pyx_vtabstruct_6gevent_6_queue_Queue *)__pyx_v_self->__pyx_vtab)->__pyx___get_or_peek(__pyx_v_self, __pyx_t_1, __pyx_v_block, __pyx_v_timeout); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 368, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "src/gevent/queue.py":354 + * return self.get(False) + * + * def peek(self, block=True, timeout=None): # <<<<<<<<<<<<<< + * """Return an item from the queue without removing it. + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("gevent._queue.Queue.peek", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_queue_5Queue_39peek(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6gevent_6_queue_5Queue_38peek[] = "Queue.peek(self, block=True, timeout=None)\nReturn an item from the queue without removing it.\n\n If optional args *block* is true and *timeout* is ``None`` (the default),\n block if necessary until an item is available. If *timeout* is a positive number,\n it blocks at most *timeout* seconds and raises the :class:`Empty` exception\n if no item was available within that time. Otherwise (*block* is false), return\n an item if one is immediately available, else raise the :class:`Empty` exception\n (*timeout* is ignored in that case).\n "; +static PyMethodDef __pyx_mdef_6gevent_6_queue_5Queue_39peek = {"peek", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_6_queue_5Queue_39peek, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_6_queue_5Queue_38peek}; +static PyObject *__pyx_pw_6gevent_6_queue_5Queue_39peek(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_block = 0; + PyObject *__pyx_v_timeout = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("peek (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_block,&__pyx_n_s_timeout,0}; + PyObject* values[2] = {0,0}; + values[0] = ((PyObject *)Py_True); + values[1] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_block); + if (value) { values[0] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 1: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_timeout); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "peek") < 0)) __PYX_ERR(0, 354, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_block = values[0]; + __pyx_v_timeout = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("peek", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 354, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent._queue.Queue.peek", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_6_queue_5Queue_38peek(((struct __pyx_obj_6gevent_6_queue_Queue *)__pyx_v_self), __pyx_v_block, __pyx_v_timeout); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_queue_5Queue_38peek(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self, PyObject *__pyx_v_block, PyObject *__pyx_v_timeout) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + struct __pyx_opt_args_6gevent_6_queue_5Queue_peek __pyx_t_2; + __Pyx_RefNannySetupContext("peek", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_2.__pyx_n = 2; + __pyx_t_2.block = __pyx_v_block; + __pyx_t_2.timeout = __pyx_v_timeout; + __pyx_t_1 = __pyx_vtabptr_6gevent_6_queue_Queue->peek(__pyx_v_self, 1, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 354, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent._queue.Queue.peek", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/queue.py":370 + * return self.__get_or_peek(self._peek, block, timeout) + * + * def peek_nowait(self): # <<<<<<<<<<<<<< + * """Return an item from the queue without blocking. + * + */ + +static PyObject *__pyx_pw_6gevent_6_queue_5Queue_41peek_nowait(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_f_6gevent_6_queue_5Queue_peek_nowait(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self, int __pyx_skip_dispatch) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + struct __pyx_opt_args_6gevent_6_queue_5Queue_peek __pyx_t_5; + __Pyx_RefNannySetupContext("peek_nowait", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0; + if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self)))))); + else { + PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + #endif + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_peek_nowait); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 370, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_6_queue_5Queue_41peek_nowait)) { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 370, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0; + if (unlikely(type_dict_guard != tp_dict_version)) { + tp_dict_version = obj_dict_version = 0; + } + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + } + #endif + } + + /* "src/gevent/queue.py":376 + * raise the :class:`Empty` exception. + * """ + * return self.peek(False) # <<<<<<<<<<<<<< + * + * def _unlock(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_5.__pyx_n = 1; + __pyx_t_5.block = Py_False; + __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_6_queue_Queue *)__pyx_v_self->__pyx_vtab)->peek(__pyx_v_self, 0, &__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 376, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "src/gevent/queue.py":370 + * return self.__get_or_peek(self._peek, block, timeout) + * + * def peek_nowait(self): # <<<<<<<<<<<<<< + * """Return an item from the queue without blocking. + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("gevent._queue.Queue.peek_nowait", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_queue_5Queue_41peek_nowait(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6gevent_6_queue_5Queue_40peek_nowait[] = "Queue.peek_nowait(self)\nReturn an item from the queue without blocking.\n\n Only return an item if one is immediately available. Otherwise\n raise the :class:`Empty` exception.\n "; +static PyMethodDef __pyx_mdef_6gevent_6_queue_5Queue_41peek_nowait = {"peek_nowait", (PyCFunction)__pyx_pw_6gevent_6_queue_5Queue_41peek_nowait, METH_NOARGS, __pyx_doc_6gevent_6_queue_5Queue_40peek_nowait}; +static PyObject *__pyx_pw_6gevent_6_queue_5Queue_41peek_nowait(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("peek_nowait (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6_queue_5Queue_40peek_nowait(((struct __pyx_obj_6gevent_6_queue_Queue *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_queue_5Queue_40peek_nowait(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("peek_nowait", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6gevent_6_queue_5Queue_peek_nowait(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 370, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent._queue.Queue.peek_nowait", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/queue.py":378 + * return self.peek(False) + * + * def _unlock(self): # <<<<<<<<<<<<<< + * while True: + * repeat = False + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_queue_5Queue_43_unlock(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6gevent_6_queue_5Queue_42_unlock[] = "Queue._unlock(self)"; +static PyMethodDef __pyx_mdef_6gevent_6_queue_5Queue_43_unlock = {"_unlock", (PyCFunction)__pyx_pw_6gevent_6_queue_5Queue_43_unlock, METH_NOARGS, __pyx_doc_6gevent_6_queue_5Queue_42_unlock}; +static PyObject *__pyx_pw_6gevent_6_queue_5Queue_43_unlock(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_unlock (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6_queue_5Queue_42_unlock(((struct __pyx_obj_6gevent_6_queue_Queue *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_queue_5Queue_42_unlock(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self) { + int __pyx_v_repeat; + PyObject *__pyx_v_putter = NULL; + PyObject *__pyx_v_getter = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + __Pyx_RefNannySetupContext("_unlock", 0); + + /* "src/gevent/queue.py":379 + * + * def _unlock(self): + * while True: # <<<<<<<<<<<<<< + * repeat = False + * if self.putters and (self._maxsize == -1 or self.qsize() < self._maxsize): + */ + while (1) { + + /* "src/gevent/queue.py":380 + * def _unlock(self): + * while True: + * repeat = False # <<<<<<<<<<<<<< + * if self.putters and (self._maxsize == -1 or self.qsize() < self._maxsize): + * repeat = True + */ + __pyx_v_repeat = 0; + + /* "src/gevent/queue.py":381 + * while True: + * repeat = False + * if self.putters and (self._maxsize == -1 or self.qsize() < self._maxsize): # <<<<<<<<<<<<<< + * repeat = True + * try: + */ + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_self->putters); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 381, __pyx_L1_error) + if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L6_bool_binop_done; + } + __pyx_t_2 = ((__pyx_v_self->_maxsize == -1L) != 0); + if (!__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L6_bool_binop_done; + } + __pyx_t_2 = ((((struct __pyx_vtabstruct_6gevent_6_queue_Queue *)__pyx_v_self->__pyx_vtab)->qsize(__pyx_v_self, 0) < __pyx_v_self->_maxsize) != 0); + __pyx_t_1 = __pyx_t_2; + __pyx_L6_bool_binop_done:; + if (__pyx_t_1) { + + /* "src/gevent/queue.py":382 + * repeat = False + * if self.putters and (self._maxsize == -1 or self.qsize() < self._maxsize): + * repeat = True # <<<<<<<<<<<<<< + * try: + * putter = self.putters.popleft() + */ + __pyx_v_repeat = 1; + + /* "src/gevent/queue.py":383 + * if self.putters and (self._maxsize == -1 or self.qsize() < self._maxsize): + * repeat = True + * try: # <<<<<<<<<<<<<< + * putter = self.putters.popleft() + * self._put(putter.item) + */ + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5); + __Pyx_XGOTREF(__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_4); + __Pyx_XGOTREF(__pyx_t_5); + /*try:*/ { + + /* "src/gevent/queue.py":384 + * repeat = True + * try: + * putter = self.putters.popleft() # <<<<<<<<<<<<<< + * self._put(putter.item) + * except: # pylint:disable=bare-except + */ + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->putters, __pyx_n_s_popleft); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 384, __pyx_L9_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) { + __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); + if (likely(__pyx_t_8)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); + __Pyx_INCREF(__pyx_t_8); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_7, function); + } + } + __pyx_t_6 = (__pyx_t_8) ? __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_8) : __Pyx_PyObject_CallNoArg(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 384, __pyx_L9_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF_SET(__pyx_v_putter, __pyx_t_6); + __pyx_t_6 = 0; + + /* "src/gevent/queue.py":385 + * try: + * putter = self.putters.popleft() + * self._put(putter.item) # <<<<<<<<<<<<<< + * except: # pylint:disable=bare-except + * putter.throw(*sys.exc_info()) + */ + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_putter, __pyx_n_s_item); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 385, __pyx_L9_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = ((struct __pyx_vtabstruct_6gevent_6_queue_Queue *)__pyx_v_self->__pyx_vtab)->_put(__pyx_v_self, __pyx_t_6, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 385, __pyx_L9_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "src/gevent/queue.py":383 + * if self.putters and (self._maxsize == -1 or self.qsize() < self._maxsize): + * repeat = True + * try: # <<<<<<<<<<<<<< + * putter = self.putters.popleft() + * self._put(putter.item) + */ + } + + /* "src/gevent/queue.py":389 + * putter.throw(*sys.exc_info()) + * else: + * putter.switch(putter) # <<<<<<<<<<<<<< + * if self.getters and self.qsize(): + * repeat = True + */ + /*else:*/ { + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_putter, __pyx_n_s_switch); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 389, __pyx_L11_except_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_8 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { + __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_6); + if (likely(__pyx_t_8)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); + __Pyx_INCREF(__pyx_t_8); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_6, function); + } + } + __pyx_t_7 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_8, __pyx_v_putter) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_putter); + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 389, __pyx_L11_except_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + goto __pyx_L16_try_end; + __pyx_L9_error:; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "src/gevent/queue.py":386 + * putter = self.putters.popleft() + * self._put(putter.item) + * except: # pylint:disable=bare-except # <<<<<<<<<<<<<< + * putter.throw(*sys.exc_info()) + * else: + */ + /*except:*/ { + __Pyx_AddTraceback("gevent._queue.Queue._unlock", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_6, &__pyx_t_8) < 0) __PYX_ERR(0, 386, __pyx_L11_except_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_8); + + /* "src/gevent/queue.py":387 + * self._put(putter.item) + * except: # pylint:disable=bare-except + * putter.throw(*sys.exc_info()) # <<<<<<<<<<<<<< + * else: + * putter.switch(putter) + */ + if (unlikely(!__pyx_v_putter)) { __Pyx_RaiseUnboundLocalError("putter"); __PYX_ERR(0, 387, __pyx_L11_except_error) } + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_putter, __pyx_n_s_throw); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 387, __pyx_L11_except_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_sys); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 387, __pyx_L11_except_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_exc_info); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 387, __pyx_L11_except_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_11 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_12))) { + __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_12); + if (likely(__pyx_t_11)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12); + __Pyx_INCREF(__pyx_t_11); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_12, function); + } + } + __pyx_t_10 = (__pyx_t_11) ? __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_11) : __Pyx_PyObject_CallNoArg(__pyx_t_12); + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 387, __pyx_L11_except_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_12 = __Pyx_PySequence_Tuple(__pyx_t_10); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 387, __pyx_L11_except_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_12, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 387, __pyx_L11_except_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + goto __pyx_L10_exception_handled; + } + __pyx_L11_except_error:; + + /* "src/gevent/queue.py":383 + * if self.putters and (self._maxsize == -1 or self.qsize() < self._maxsize): + * repeat = True + * try: # <<<<<<<<<<<<<< + * putter = self.putters.popleft() + * self._put(putter.item) + */ + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); + goto __pyx_L1_error; + __pyx_L10_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); + __pyx_L16_try_end:; + } + + /* "src/gevent/queue.py":381 + * while True: + * repeat = False + * if self.putters and (self._maxsize == -1 or self.qsize() < self._maxsize): # <<<<<<<<<<<<<< + * repeat = True + * try: + */ + } + + /* "src/gevent/queue.py":390 + * else: + * putter.switch(putter) + * if self.getters and self.qsize(): # <<<<<<<<<<<<<< + * repeat = True + * getter = self.getters.popleft() + */ + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_self->getters); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 390, __pyx_L1_error) + if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L20_bool_binop_done; + } + __pyx_t_2 = (((struct __pyx_vtabstruct_6gevent_6_queue_Queue *)__pyx_v_self->__pyx_vtab)->qsize(__pyx_v_self, 0) != 0); + __pyx_t_1 = __pyx_t_2; + __pyx_L20_bool_binop_done:; + if (__pyx_t_1) { + + /* "src/gevent/queue.py":391 + * putter.switch(putter) + * if self.getters and self.qsize(): + * repeat = True # <<<<<<<<<<<<<< + * getter = self.getters.popleft() + * getter.switch(getter) + */ + __pyx_v_repeat = 1; + + /* "src/gevent/queue.py":392 + * if self.getters and self.qsize(): + * repeat = True + * getter = self.getters.popleft() # <<<<<<<<<<<<<< + * getter.switch(getter) + * if not repeat: + */ + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->getters, __pyx_n_s_popleft); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 392, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { + __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); + if (likely(__pyx_t_7)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); + __Pyx_INCREF(__pyx_t_7); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_6, function); + } + } + __pyx_t_8 = (__pyx_t_7) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7) : __Pyx_PyObject_CallNoArg(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 392, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF_SET(__pyx_v_getter, __pyx_t_8); + __pyx_t_8 = 0; + + /* "src/gevent/queue.py":393 + * repeat = True + * getter = self.getters.popleft() + * getter.switch(getter) # <<<<<<<<<<<<<< + * if not repeat: + * return + */ + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_getter, __pyx_n_s_switch); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 393, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { + __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); + if (likely(__pyx_t_7)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); + __Pyx_INCREF(__pyx_t_7); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_6, function); + } + } + __pyx_t_8 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_v_getter) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_getter); + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 393, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + + /* "src/gevent/queue.py":390 + * else: + * putter.switch(putter) + * if self.getters and self.qsize(): # <<<<<<<<<<<<<< + * repeat = True + * getter = self.getters.popleft() + */ + } + + /* "src/gevent/queue.py":394 + * getter = self.getters.popleft() + * getter.switch(getter) + * if not repeat: # <<<<<<<<<<<<<< + * return + * + */ + __pyx_t_1 = ((!(__pyx_v_repeat != 0)) != 0); + if (__pyx_t_1) { + + /* "src/gevent/queue.py":395 + * getter.switch(getter) + * if not repeat: + * return # <<<<<<<<<<<<<< + * + * def _schedule_unlock(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + + /* "src/gevent/queue.py":394 + * getter = self.getters.popleft() + * getter.switch(getter) + * if not repeat: # <<<<<<<<<<<<<< + * return + * + */ + } + } + + /* "src/gevent/queue.py":378 + * return self.peek(False) + * + * def _unlock(self): # <<<<<<<<<<<<<< + * while True: + * repeat = False + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_AddTraceback("gevent._queue.Queue._unlock", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_putter); + __Pyx_XDECREF(__pyx_v_getter); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/queue.py":397 + * return + * + * def _schedule_unlock(self): # <<<<<<<<<<<<<< + * if not self._event_unlock: + * self._event_unlock = self.hub.loop.run_callback(self._unlock) + */ + +static PyObject *__pyx_f_6gevent_6_queue_5Queue__schedule_unlock(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + __Pyx_RefNannySetupContext("_schedule_unlock", 0); + + /* "src/gevent/queue.py":398 + * + * def _schedule_unlock(self): + * if not self._event_unlock: # <<<<<<<<<<<<<< + * self._event_unlock = self.hub.loop.run_callback(self._unlock) + * + */ + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_self->_event_unlock); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 398, __pyx_L1_error) + __pyx_t_2 = ((!__pyx_t_1) != 0); + if (__pyx_t_2) { + + /* "src/gevent/queue.py":399 + * def _schedule_unlock(self): + * if not self._event_unlock: + * self._event_unlock = self.hub.loop.run_callback(self._unlock) # <<<<<<<<<<<<<< + * + * def __iter__(self): + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->hub, __pyx_n_s_loop); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 399, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_run_callback); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 399, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_unlock); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 399, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); + if (likely(__pyx_t_6)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_5, function); + } + } + __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4); + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 399, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GIVEREF(__pyx_t_3); + __Pyx_GOTREF(__pyx_v_self->_event_unlock); + __Pyx_DECREF(__pyx_v_self->_event_unlock); + __pyx_v_self->_event_unlock = __pyx_t_3; + __pyx_t_3 = 0; + + /* "src/gevent/queue.py":398 + * + * def _schedule_unlock(self): + * if not self._event_unlock: # <<<<<<<<<<<<<< + * self._event_unlock = self.hub.loop.run_callback(self._unlock) + * + */ + } + + /* "src/gevent/queue.py":397 + * return + * + * def _schedule_unlock(self): # <<<<<<<<<<<<<< + * if not self._event_unlock: + * self._event_unlock = self.hub.loop.run_callback(self._unlock) + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("gevent._queue.Queue._schedule_unlock", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/queue.py":401 + * self._event_unlock = self.hub.loop.run_callback(self._unlock) + * + * def __iter__(self): # <<<<<<<<<<<<<< + * return self + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_queue_5Queue_45__iter__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_6_queue_5Queue_45__iter__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6_queue_5Queue_44__iter__(((struct __pyx_obj_6gevent_6_queue_Queue *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_queue_5Queue_44__iter__(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__iter__", 0); + + /* "src/gevent/queue.py":402 + * + * def __iter__(self): + * return self # <<<<<<<<<<<<<< + * + * def __next__(self): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __pyx_r = ((PyObject *)__pyx_v_self); + goto __pyx_L0; + + /* "src/gevent/queue.py":401 + * self._event_unlock = self.hub.loop.run_callback(self._unlock) + * + * def __iter__(self): # <<<<<<<<<<<<<< + * return self + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/queue.py":404 + * return self + * + * def __next__(self): # <<<<<<<<<<<<<< + * result = self.get() + * if result is StopIteration: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_queue_5Queue_47__next__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_6_queue_5Queue_47__next__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__next__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6_queue_5Queue_46__next__(((struct __pyx_obj_6gevent_6_queue_Queue *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_queue_5Queue_46__next__(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self) { + PyObject *__pyx_v_result = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + __Pyx_RefNannySetupContext("__next__", 0); + + /* "src/gevent/queue.py":405 + * + * def __next__(self): + * result = self.get() # <<<<<<<<<<<<<< + * if result is StopIteration: + * raise result + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_6_queue_Queue *)__pyx_v_self->__pyx_vtab)->get(__pyx_v_self, 0, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 405, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_result = __pyx_t_1; + __pyx_t_1 = 0; + + /* "src/gevent/queue.py":406 + * def __next__(self): + * result = self.get() + * if result is StopIteration: # <<<<<<<<<<<<<< + * raise result + * return result + */ + __pyx_t_2 = (__pyx_v_result == __pyx_builtin_StopIteration); + __pyx_t_3 = (__pyx_t_2 != 0); + if (unlikely(__pyx_t_3)) { + + /* "src/gevent/queue.py":407 + * result = self.get() + * if result is StopIteration: + * raise result # <<<<<<<<<<<<<< + * return result + * + */ + __Pyx_Raise(__pyx_v_result, 0, 0, 0); + __PYX_ERR(0, 407, __pyx_L1_error) + + /* "src/gevent/queue.py":406 + * def __next__(self): + * result = self.get() + * if result is StopIteration: # <<<<<<<<<<<<<< + * raise result + * return result + */ + } + + /* "src/gevent/queue.py":408 + * if result is StopIteration: + * raise result + * return result # <<<<<<<<<<<<<< + * + * next = __next__ # Py2 + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; + goto __pyx_L0; + + /* "src/gevent/queue.py":404 + * return self + * + * def __next__(self): # <<<<<<<<<<<<<< + * result = self.get() + * if result is StopIteration: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent._queue.Queue.__next__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/_queue.pxd":20 + * cdef class Queue: + * cdef __weakref__ + * cdef readonly hub # <<<<<<<<<<<<<< + * cdef readonly queue + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_queue_5Queue_3hub_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_6_queue_5Queue_3hub_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6_queue_5Queue_3hub___get__(((struct __pyx_obj_6gevent_6_queue_Queue *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_queue_5Queue_3hub___get__(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->hub); + __pyx_r = __pyx_v_self->hub; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/_queue.pxd":21 + * cdef __weakref__ + * cdef readonly hub + * cdef readonly queue # <<<<<<<<<<<<<< + * + * cdef getters + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_queue_5Queue_5queue_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_6_queue_5Queue_5queue_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6_queue_5Queue_5queue___get__(((struct __pyx_obj_6gevent_6_queue_Queue *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_queue_5Queue_5queue___get__(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->queue); + __pyx_r = __pyx_v_self->queue; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/queue.py":419 + * __slots__ = () + * + * def __init__(self, maxsize=None, items=()): # <<<<<<<<<<<<<< + * if maxsize is not None: + * raise ValueError("UnboundQueue has no maxsize") + */ + +/* Python wrapper */ +static int __pyx_pw_6gevent_6_queue_12UnboundQueue_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6gevent_6_queue_12UnboundQueue_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_maxsize = 0; + PyObject *__pyx_v_items = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_maxsize,&__pyx_n_s_items,0}; + PyObject* values[2] = {0,0}; + values[0] = ((PyObject *)Py_None); + values[1] = ((PyObject *)__pyx_empty_tuple); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_maxsize); + if (value) { values[0] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 1: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_items); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 419, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_maxsize = values[0]; + __pyx_v_items = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 419, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent._queue.UnboundQueue.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_6_queue_12UnboundQueue___init__(((struct __pyx_obj_6gevent_6_queue_UnboundQueue *)__pyx_v_self), __pyx_v_maxsize, __pyx_v_items); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_6_queue_12UnboundQueue___init__(struct __pyx_obj_6gevent_6_queue_UnboundQueue *__pyx_v_self, PyObject *__pyx_v_maxsize, PyObject *__pyx_v_items) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "src/gevent/queue.py":420 + * + * def __init__(self, maxsize=None, items=()): + * if maxsize is not None: # <<<<<<<<<<<<<< + * raise ValueError("UnboundQueue has no maxsize") + * Queue.__init__(self, maxsize, items) + */ + __pyx_t_1 = (__pyx_v_maxsize != Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (unlikely(__pyx_t_2)) { + + /* "src/gevent/queue.py":421 + * def __init__(self, maxsize=None, items=()): + * if maxsize is not None: + * raise ValueError("UnboundQueue has no maxsize") # <<<<<<<<<<<<<< + * Queue.__init__(self, maxsize, items) + * self.putters = None # Will never be used. + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 421, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(0, 421, __pyx_L1_error) + + /* "src/gevent/queue.py":420 + * + * def __init__(self, maxsize=None, items=()): + * if maxsize is not None: # <<<<<<<<<<<<<< + * raise ValueError("UnboundQueue has no maxsize") + * Queue.__init__(self, maxsize, items) + */ + } + + /* "src/gevent/queue.py":422 + * if maxsize is not None: + * raise ValueError("UnboundQueue has no maxsize") + * Queue.__init__(self, maxsize, items) # <<<<<<<<<<<<<< + * self.putters = None # Will never be used. + * + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_6gevent_6_queue_Queue), __pyx_n_s_init); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 422, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = NULL; + __pyx_t_6 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + __pyx_t_6 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_4)) { + PyObject *__pyx_temp[4] = {__pyx_t_5, ((PyObject *)__pyx_v_self), __pyx_v_maxsize, __pyx_v_items}; + __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 422, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_t_3); + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { + PyObject *__pyx_temp[4] = {__pyx_t_5, ((PyObject *)__pyx_v_self), __pyx_v_maxsize, __pyx_v_items}; + __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 422, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_t_3); + } else + #endif + { + __pyx_t_7 = PyTuple_New(3+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 422, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + if (__pyx_t_5) { + __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL; + } + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, ((PyObject *)__pyx_v_self)); + __Pyx_INCREF(__pyx_v_maxsize); + __Pyx_GIVEREF(__pyx_v_maxsize); + PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_maxsize); + __Pyx_INCREF(__pyx_v_items); + __Pyx_GIVEREF(__pyx_v_items); + PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_6, __pyx_v_items); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 422, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "src/gevent/queue.py":423 + * raise ValueError("UnboundQueue has no maxsize") + * Queue.__init__(self, maxsize, items) + * self.putters = None # Will never be used. # <<<<<<<<<<<<<< + * + * def put(self, item, block=True, timeout=None): + */ + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->__pyx_base.putters); + __Pyx_DECREF(__pyx_v_self->__pyx_base.putters); + __pyx_v_self->__pyx_base.putters = Py_None; + + /* "src/gevent/queue.py":419 + * __slots__ = () + * + * def __init__(self, maxsize=None, items=()): # <<<<<<<<<<<<<< + * if maxsize is not None: + * raise ValueError("UnboundQueue has no maxsize") + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("gevent._queue.UnboundQueue.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/queue.py":425 + * self.putters = None # Will never be used. + * + * def put(self, item, block=True, timeout=None): # <<<<<<<<<<<<<< + * self._put(item) + * if self.getters: + */ + +static PyObject *__pyx_pw_6gevent_6_queue_12UnboundQueue_3put(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_6gevent_6_queue_12UnboundQueue_put(struct __pyx_obj_6gevent_6_queue_UnboundQueue *__pyx_v_self, PyObject *__pyx_v_item, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_6_queue_12UnboundQueue_put *__pyx_optional_args) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + __Pyx_RefNannySetupContext("put", 0); + if (__pyx_optional_args) { + } + + /* "src/gevent/queue.py":426 + * + * def put(self, item, block=True, timeout=None): + * self._put(item) # <<<<<<<<<<<<<< + * if self.getters: + * self._schedule_unlock() + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_6_queue_UnboundQueue *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._put(((struct __pyx_obj_6gevent_6_queue_Queue *)__pyx_v_self), __pyx_v_item, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 426, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/queue.py":427 + * def put(self, item, block=True, timeout=None): + * self._put(item) + * if self.getters: # <<<<<<<<<<<<<< + * self._schedule_unlock() + * + */ + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_self->__pyx_base.getters); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 427, __pyx_L1_error) + if (__pyx_t_2) { + + /* "src/gevent/queue.py":428 + * self._put(item) + * if self.getters: + * self._schedule_unlock() # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_6_queue_UnboundQueue *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._schedule_unlock(((struct __pyx_obj_6gevent_6_queue_Queue *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 428, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/queue.py":427 + * def put(self, item, block=True, timeout=None): + * self._put(item) + * if self.getters: # <<<<<<<<<<<<<< + * self._schedule_unlock() + * + */ + } + + /* "src/gevent/queue.py":425 + * self.putters = None # Will never be used. + * + * def put(self, item, block=True, timeout=None): # <<<<<<<<<<<<<< + * self._put(item) + * if self.getters: + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent._queue.UnboundQueue.put", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_queue_12UnboundQueue_3put(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6gevent_6_queue_12UnboundQueue_2put[] = "UnboundQueue.put(self, item, block=True, timeout=None)"; +static PyMethodDef __pyx_mdef_6gevent_6_queue_12UnboundQueue_3put = {"put", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_6_queue_12UnboundQueue_3put, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_6_queue_12UnboundQueue_2put}; +static PyObject *__pyx_pw_6gevent_6_queue_12UnboundQueue_3put(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_item = 0; + PyObject *__pyx_v_block = 0; + PyObject *__pyx_v_timeout = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("put (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_item,&__pyx_n_s_block,&__pyx_n_s_timeout,0}; + PyObject* values[3] = {0,0,0}; + values[1] = ((PyObject *)Py_True); + values[2] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_item)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_block); + if (value) { values[1] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 2: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_timeout); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "put") < 0)) __PYX_ERR(0, 425, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_item = values[0]; + __pyx_v_block = values[1]; + __pyx_v_timeout = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("put", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 425, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent._queue.UnboundQueue.put", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_6_queue_12UnboundQueue_2put(((struct __pyx_obj_6gevent_6_queue_UnboundQueue *)__pyx_v_self), __pyx_v_item, __pyx_v_block, __pyx_v_timeout); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_queue_12UnboundQueue_2put(struct __pyx_obj_6gevent_6_queue_UnboundQueue *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_block, PyObject *__pyx_v_timeout) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + struct __pyx_opt_args_6gevent_6_queue_5Queue_put __pyx_t_2; + __Pyx_RefNannySetupContext("put", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_2.__pyx_n = 2; + __pyx_t_2.block = __pyx_v_block; + __pyx_t_2.timeout = __pyx_v_timeout; + __pyx_t_1 = __pyx_vtabptr_6gevent_6_queue_UnboundQueue->__pyx_base.put(((struct __pyx_obj_6gevent_6_queue_Queue *)__pyx_v_self), __pyx_v_item, 1, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 425, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent._queue.UnboundQueue.put", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/queue.py":444 + * __slots__ = () + * + * def _create_queue(self, items=()): # <<<<<<<<<<<<<< + * q = list(items) + * _heapify(q) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_queue_13PriorityQueue_1_create_queue(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6gevent_6_queue_13PriorityQueue__create_queue[] = "PriorityQueue._create_queue(self, items=())"; +static PyMethodDef __pyx_mdef_6gevent_6_queue_13PriorityQueue_1_create_queue = {"_create_queue", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_6_queue_13PriorityQueue_1_create_queue, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_6_queue_13PriorityQueue__create_queue}; +static PyObject *__pyx_pw_6gevent_6_queue_13PriorityQueue_1_create_queue(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_items = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_create_queue (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_items,0}; + PyObject* values[1] = {0}; + values[0] = ((PyObject *)__pyx_empty_tuple); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_items); + if (value) { values[0] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_create_queue") < 0)) __PYX_ERR(0, 444, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_items = values[0]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("_create_queue", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 444, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent._queue.PriorityQueue._create_queue", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_6_queue_13PriorityQueue__create_queue(((struct __pyx_obj_6gevent_6_queue_PriorityQueue *)__pyx_v_self), __pyx_v_items); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_queue_13PriorityQueue__create_queue(CYTHON_UNUSED struct __pyx_obj_6gevent_6_queue_PriorityQueue *__pyx_v_self, PyObject *__pyx_v_items) { + PyObject *__pyx_v_q = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("_create_queue", 0); + + /* "src/gevent/queue.py":445 + * + * def _create_queue(self, items=()): + * q = list(items) # <<<<<<<<<<<<<< + * _heapify(q) + * return q + */ + __pyx_t_1 = PySequence_List(__pyx_v_items); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 445, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_q = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "src/gevent/queue.py":446 + * def _create_queue(self, items=()): + * q = list(items) + * _heapify(q) # <<<<<<<<<<<<<< + * return q + * + */ + __Pyx_INCREF(__pyx_v_6gevent_6_queue__heapify); + __pyx_t_2 = __pyx_v_6gevent_6_queue__heapify; __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_q) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_q); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 446, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/queue.py":447 + * q = list(items) + * _heapify(q) + * return q # <<<<<<<<<<<<<< + * + * def _put(self, item): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_q); + __pyx_r = __pyx_v_q; + goto __pyx_L0; + + /* "src/gevent/queue.py":444 + * __slots__ = () + * + * def _create_queue(self, items=()): # <<<<<<<<<<<<<< + * q = list(items) + * _heapify(q) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("gevent._queue.PriorityQueue._create_queue", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_q); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/queue.py":449 + * return q + * + * def _put(self, item): # <<<<<<<<<<<<<< + * _heappush(self.queue, item) + * + */ + +static PyObject *__pyx_pw_6gevent_6_queue_13PriorityQueue_3_put(PyObject *__pyx_v_self, PyObject *__pyx_v_item); /*proto*/ +static PyObject *__pyx_f_6gevent_6_queue_13PriorityQueue__put(struct __pyx_obj_6gevent_6_queue_PriorityQueue *__pyx_v_self, PyObject *__pyx_v_item, int __pyx_skip_dispatch) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + __Pyx_RefNannySetupContext("_put", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0; + if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self)))))); + else { + PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + #endif + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_put); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 449, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_6_queue_13PriorityQueue_3_put)) { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_item) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_item); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 449, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0; + if (unlikely(type_dict_guard != tp_dict_version)) { + tp_dict_version = obj_dict_version = 0; + } + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + } + #endif + } + + /* "src/gevent/queue.py":450 + * + * def _put(self, item): + * _heappush(self.queue, item) # <<<<<<<<<<<<<< + * + * def _get(self): + */ + __Pyx_INCREF(__pyx_v_6gevent_6_queue__heappush); + __pyx_t_2 = __pyx_v_6gevent_6_queue__heappush; __pyx_t_3 = NULL; + __pyx_t_5 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_5 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_self->__pyx_base.queue, __pyx_v_item}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 450, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_self->__pyx_base.queue, __pyx_v_item}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 450, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else + #endif + { + __pyx_t_4 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 450, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (__pyx_t_3) { + __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = NULL; + } + __Pyx_INCREF(__pyx_v_self->__pyx_base.queue); + __Pyx_GIVEREF(__pyx_v_self->__pyx_base.queue); + PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_5, __pyx_v_self->__pyx_base.queue); + __Pyx_INCREF(__pyx_v_item); + __Pyx_GIVEREF(__pyx_v_item); + PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_5, __pyx_v_item); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 450, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/queue.py":449 + * return q + * + * def _put(self, item): # <<<<<<<<<<<<<< + * _heappush(self.queue, item) + * + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("gevent._queue.PriorityQueue._put", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_queue_13PriorityQueue_3_put(PyObject *__pyx_v_self, PyObject *__pyx_v_item); /*proto*/ +static char __pyx_doc_6gevent_6_queue_13PriorityQueue_2_put[] = "PriorityQueue._put(self, item)"; +static PyMethodDef __pyx_mdef_6gevent_6_queue_13PriorityQueue_3_put = {"_put", (PyCFunction)__pyx_pw_6gevent_6_queue_13PriorityQueue_3_put, METH_O, __pyx_doc_6gevent_6_queue_13PriorityQueue_2_put}; +static PyObject *__pyx_pw_6gevent_6_queue_13PriorityQueue_3_put(PyObject *__pyx_v_self, PyObject *__pyx_v_item) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_put (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6_queue_13PriorityQueue_2_put(((struct __pyx_obj_6gevent_6_queue_PriorityQueue *)__pyx_v_self), ((PyObject *)__pyx_v_item)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_queue_13PriorityQueue_2_put(struct __pyx_obj_6gevent_6_queue_PriorityQueue *__pyx_v_self, PyObject *__pyx_v_item) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("_put", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6gevent_6_queue_13PriorityQueue__put(__pyx_v_self, __pyx_v_item, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 449, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent._queue.PriorityQueue._put", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/queue.py":452 + * _heappush(self.queue, item) + * + * def _get(self): # <<<<<<<<<<<<<< + * return _heappop(self.queue) + * + */ + +static PyObject *__pyx_pw_6gevent_6_queue_13PriorityQueue_5_get(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_f_6gevent_6_queue_13PriorityQueue__get(struct __pyx_obj_6gevent_6_queue_PriorityQueue *__pyx_v_self, int __pyx_skip_dispatch) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + __Pyx_RefNannySetupContext("_get", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0; + if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self)))))); + else { + PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + #endif + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 452, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_6_queue_13PriorityQueue_5_get)) { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 452, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0; + if (unlikely(type_dict_guard != tp_dict_version)) { + tp_dict_version = obj_dict_version = 0; + } + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + } + #endif + } + + /* "src/gevent/queue.py":453 + * + * def _get(self): + * return _heappop(self.queue) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_6gevent_6_queue__heappop); + __pyx_t_2 = __pyx_v_6gevent_6_queue__heappop; __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_self->__pyx_base.queue) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_self->__pyx_base.queue); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 453, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "src/gevent/queue.py":452 + * _heappush(self.queue, item) + * + * def _get(self): # <<<<<<<<<<<<<< + * return _heappop(self.queue) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("gevent._queue.PriorityQueue._get", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_queue_13PriorityQueue_5_get(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6gevent_6_queue_13PriorityQueue_4_get[] = "PriorityQueue._get(self)"; +static PyMethodDef __pyx_mdef_6gevent_6_queue_13PriorityQueue_5_get = {"_get", (PyCFunction)__pyx_pw_6gevent_6_queue_13PriorityQueue_5_get, METH_NOARGS, __pyx_doc_6gevent_6_queue_13PriorityQueue_4_get}; +static PyObject *__pyx_pw_6gevent_6_queue_13PriorityQueue_5_get(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_get (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6_queue_13PriorityQueue_4_get(((struct __pyx_obj_6gevent_6_queue_PriorityQueue *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_queue_13PriorityQueue_4_get(struct __pyx_obj_6gevent_6_queue_PriorityQueue *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("_get", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6gevent_6_queue_13PriorityQueue__get(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 452, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent._queue.PriorityQueue._get", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/queue.py":461 + * __slots__ = () + * + * def _create_queue(self, items=()): # <<<<<<<<<<<<<< + * return list(items) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_queue_9LifoQueue_1_create_queue(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6gevent_6_queue_9LifoQueue__create_queue[] = "LifoQueue._create_queue(self, items=())"; +static PyMethodDef __pyx_mdef_6gevent_6_queue_9LifoQueue_1_create_queue = {"_create_queue", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_6_queue_9LifoQueue_1_create_queue, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_6_queue_9LifoQueue__create_queue}; +static PyObject *__pyx_pw_6gevent_6_queue_9LifoQueue_1_create_queue(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_items = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_create_queue (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_items,0}; + PyObject* values[1] = {0}; + values[0] = ((PyObject *)__pyx_empty_tuple); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_items); + if (value) { values[0] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_create_queue") < 0)) __PYX_ERR(0, 461, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_items = values[0]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("_create_queue", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 461, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent._queue.LifoQueue._create_queue", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_6_queue_9LifoQueue__create_queue(((struct __pyx_obj_6gevent_6_queue_LifoQueue *)__pyx_v_self), __pyx_v_items); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_queue_9LifoQueue__create_queue(CYTHON_UNUSED struct __pyx_obj_6gevent_6_queue_LifoQueue *__pyx_v_self, PyObject *__pyx_v_items) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("_create_queue", 0); + + /* "src/gevent/queue.py":462 + * + * def _create_queue(self, items=()): + * return list(items) # <<<<<<<<<<<<<< + * + * def _put(self, item): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PySequence_List(__pyx_v_items); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "src/gevent/queue.py":461 + * __slots__ = () + * + * def _create_queue(self, items=()): # <<<<<<<<<<<<<< + * return list(items) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent._queue.LifoQueue._create_queue", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/queue.py":464 + * return list(items) + * + * def _put(self, item): # <<<<<<<<<<<<<< + * self.queue.append(item) + * + */ + +static PyObject *__pyx_pw_6gevent_6_queue_9LifoQueue_3_put(PyObject *__pyx_v_self, PyObject *__pyx_v_item); /*proto*/ +static PyObject *__pyx_f_6gevent_6_queue_9LifoQueue__put(struct __pyx_obj_6gevent_6_queue_LifoQueue *__pyx_v_self, PyObject *__pyx_v_item, int __pyx_skip_dispatch) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + __Pyx_RefNannySetupContext("_put", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0; + if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self)))))); + else { + PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + #endif + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_put); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_6_queue_9LifoQueue_3_put)) { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_item) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_item); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 464, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0; + if (unlikely(type_dict_guard != tp_dict_version)) { + tp_dict_version = obj_dict_version = 0; + } + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + } + #endif + } + + /* "src/gevent/queue.py":465 + * + * def _put(self, item): + * self.queue.append(item) # <<<<<<<<<<<<<< + * + * def _get(self): + */ + __pyx_t_5 = __Pyx_PyObject_Append(__pyx_v_self->__pyx_base.queue, __pyx_v_item); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 465, __pyx_L1_error) + + /* "src/gevent/queue.py":464 + * return list(items) + * + * def _put(self, item): # <<<<<<<<<<<<<< + * self.queue.append(item) + * + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("gevent._queue.LifoQueue._put", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_queue_9LifoQueue_3_put(PyObject *__pyx_v_self, PyObject *__pyx_v_item); /*proto*/ +static char __pyx_doc_6gevent_6_queue_9LifoQueue_2_put[] = "LifoQueue._put(self, item)"; +static PyMethodDef __pyx_mdef_6gevent_6_queue_9LifoQueue_3_put = {"_put", (PyCFunction)__pyx_pw_6gevent_6_queue_9LifoQueue_3_put, METH_O, __pyx_doc_6gevent_6_queue_9LifoQueue_2_put}; +static PyObject *__pyx_pw_6gevent_6_queue_9LifoQueue_3_put(PyObject *__pyx_v_self, PyObject *__pyx_v_item) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_put (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6_queue_9LifoQueue_2_put(((struct __pyx_obj_6gevent_6_queue_LifoQueue *)__pyx_v_self), ((PyObject *)__pyx_v_item)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_queue_9LifoQueue_2_put(struct __pyx_obj_6gevent_6_queue_LifoQueue *__pyx_v_self, PyObject *__pyx_v_item) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("_put", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6gevent_6_queue_9LifoQueue__put(__pyx_v_self, __pyx_v_item, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent._queue.LifoQueue._put", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/queue.py":467 + * self.queue.append(item) + * + * def _get(self): # <<<<<<<<<<<<<< + * return self.queue.pop() + * + */ + +static PyObject *__pyx_pw_6gevent_6_queue_9LifoQueue_5_get(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_f_6gevent_6_queue_9LifoQueue__get(struct __pyx_obj_6gevent_6_queue_LifoQueue *__pyx_v_self, int __pyx_skip_dispatch) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + __Pyx_RefNannySetupContext("_get", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0; + if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self)))))); + else { + PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + #endif + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 467, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_6_queue_9LifoQueue_5_get)) { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 467, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0; + if (unlikely(type_dict_guard != tp_dict_version)) { + tp_dict_version = obj_dict_version = 0; + } + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + } + #endif + } + + /* "src/gevent/queue.py":468 + * + * def _get(self): + * return self.queue.pop() # <<<<<<<<<<<<<< + * + * def _peek(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_Pop(__pyx_v_self->__pyx_base.queue); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 468, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "src/gevent/queue.py":467 + * self.queue.append(item) + * + * def _get(self): # <<<<<<<<<<<<<< + * return self.queue.pop() + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("gevent._queue.LifoQueue._get", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_queue_9LifoQueue_5_get(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6gevent_6_queue_9LifoQueue_4_get[] = "LifoQueue._get(self)"; +static PyMethodDef __pyx_mdef_6gevent_6_queue_9LifoQueue_5_get = {"_get", (PyCFunction)__pyx_pw_6gevent_6_queue_9LifoQueue_5_get, METH_NOARGS, __pyx_doc_6gevent_6_queue_9LifoQueue_4_get}; +static PyObject *__pyx_pw_6gevent_6_queue_9LifoQueue_5_get(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_get (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6_queue_9LifoQueue_4_get(((struct __pyx_obj_6gevent_6_queue_LifoQueue *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_queue_9LifoQueue_4_get(struct __pyx_obj_6gevent_6_queue_LifoQueue *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("_get", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6gevent_6_queue_9LifoQueue__get(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 467, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent._queue.LifoQueue._get", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/queue.py":470 + * return self.queue.pop() + * + * def _peek(self): # <<<<<<<<<<<<<< + * return self.queue[-1] + * + */ + +static PyObject *__pyx_pw_6gevent_6_queue_9LifoQueue_7_peek(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_f_6gevent_6_queue_9LifoQueue__peek(struct __pyx_obj_6gevent_6_queue_LifoQueue *__pyx_v_self, int __pyx_skip_dispatch) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + __Pyx_RefNannySetupContext("_peek", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0; + if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self)))))); + else { + PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + #endif + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_peek); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 470, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_6_queue_9LifoQueue_7_peek)) { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 470, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0; + if (unlikely(type_dict_guard != tp_dict_version)) { + tp_dict_version = obj_dict_version = 0; + } + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + } + #endif + } + + /* "src/gevent/queue.py":471 + * + * def _peek(self): + * return self.queue[-1] # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_self->__pyx_base.queue, -1L, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 471, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "src/gevent/queue.py":470 + * return self.queue.pop() + * + * def _peek(self): # <<<<<<<<<<<<<< + * return self.queue[-1] + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("gevent._queue.LifoQueue._peek", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_queue_9LifoQueue_7_peek(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6gevent_6_queue_9LifoQueue_6_peek[] = "LifoQueue._peek(self)"; +static PyMethodDef __pyx_mdef_6gevent_6_queue_9LifoQueue_7_peek = {"_peek", (PyCFunction)__pyx_pw_6gevent_6_queue_9LifoQueue_7_peek, METH_NOARGS, __pyx_doc_6gevent_6_queue_9LifoQueue_6_peek}; +static PyObject *__pyx_pw_6gevent_6_queue_9LifoQueue_7_peek(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_peek (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6_queue_9LifoQueue_6_peek(((struct __pyx_obj_6gevent_6_queue_LifoQueue *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_queue_9LifoQueue_6_peek(struct __pyx_obj_6gevent_6_queue_LifoQueue *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("_peek", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6gevent_6_queue_9LifoQueue__peek(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 470, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent._queue.LifoQueue._peek", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/queue.py":485 + * ) + * + * def __init__(self, maxsize=None, items=(), unfinished_tasks=None): # <<<<<<<<<<<<<< + * """ + * + */ + +/* Python wrapper */ +static int __pyx_pw_6gevent_6_queue_13JoinableQueue_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6gevent_6_queue_13JoinableQueue___init__[] = "\n\n .. versionchanged:: 1.1a1\n If *unfinished_tasks* is not given, then all the given *items*\n (if any) will be considered unfinished.\n\n "; +#if CYTHON_COMPILING_IN_CPYTHON +struct wrapperbase __pyx_wrapperbase_6gevent_6_queue_13JoinableQueue___init__; +#endif +static int __pyx_pw_6gevent_6_queue_13JoinableQueue_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_maxsize = 0; + PyObject *__pyx_v_items = 0; + PyObject *__pyx_v_unfinished_tasks = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_maxsize,&__pyx_n_s_items,&__pyx_n_s_unfinished_tasks,0}; + PyObject* values[3] = {0,0,0}; + values[0] = ((PyObject *)Py_None); + values[1] = ((PyObject *)__pyx_empty_tuple); + values[2] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_maxsize); + if (value) { values[0] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 1: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_items); + if (value) { values[1] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 2: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_unfinished_tasks); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 485, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_maxsize = values[0]; + __pyx_v_items = values[1]; + __pyx_v_unfinished_tasks = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 485, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent._queue.JoinableQueue.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_6_queue_13JoinableQueue___init__(((struct __pyx_obj_6gevent_6_queue_JoinableQueue *)__pyx_v_self), __pyx_v_maxsize, __pyx_v_items, __pyx_v_unfinished_tasks); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_6_queue_13JoinableQueue___init__(struct __pyx_obj_6gevent_6_queue_JoinableQueue *__pyx_v_self, PyObject *__pyx_v_maxsize, PyObject *__pyx_v_items, PyObject *__pyx_v_unfinished_tasks) { + PyObject *__pyx_v_Event = NULL; + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + int __pyx_t_6; + Py_ssize_t __pyx_t_7; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "src/gevent/queue.py":493 + * + * """ + * Queue.__init__(self, maxsize, items, _warn_depth=3) # <<<<<<<<<<<<<< + * + * from gevent.event import Event + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_6gevent_6_queue_Queue), __pyx_n_s_init); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 493, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 493, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self)); + __Pyx_INCREF(__pyx_v_maxsize); + __Pyx_GIVEREF(__pyx_v_maxsize); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_maxsize); + __Pyx_INCREF(__pyx_v_items); + __Pyx_GIVEREF(__pyx_v_items); + PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_items); + __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 493, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_warn_depth, __pyx_int_3) < 0) __PYX_ERR(0, 493, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 493, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "src/gevent/queue.py":495 + * Queue.__init__(self, maxsize, items, _warn_depth=3) + * + * from gevent.event import Event # <<<<<<<<<<<<<< + * self._cond = Event() + * self._cond.set() + */ + __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 495, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_n_s_Event); + __Pyx_GIVEREF(__pyx_n_s_Event); + PyList_SET_ITEM(__pyx_t_4, 0, __pyx_n_s_Event); + __pyx_t_3 = __Pyx_Import(__pyx_n_s_gevent_event, __pyx_t_4, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 495, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_Event); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 495, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_t_4); + __pyx_v_Event = __pyx_t_4; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "src/gevent/queue.py":496 + * + * from gevent.event import Event + * self._cond = Event() # <<<<<<<<<<<<<< + * self._cond.set() + * + */ + __Pyx_INCREF(__pyx_v_Event); + __pyx_t_4 = __pyx_v_Event; __pyx_t_2 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_2)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + } + } + __pyx_t_3 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 496, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_6gevent_6_event_Event))))) __PYX_ERR(0, 496, __pyx_L1_error) + __Pyx_GIVEREF(__pyx_t_3); + __Pyx_GOTREF(__pyx_v_self->_cond); + __Pyx_DECREF(((PyObject *)__pyx_v_self->_cond)); + __pyx_v_self->_cond = ((struct __pyx_obj_6gevent_6_event_Event *)__pyx_t_3); + __pyx_t_3 = 0; + + /* "src/gevent/queue.py":497 + * from gevent.event import Event + * self._cond = Event() + * self._cond.set() # <<<<<<<<<<<<<< + * + * if unfinished_tasks: + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->_cond), __pyx_n_s_set); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 497, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_2)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + } + } + __pyx_t_3 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 497, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "src/gevent/queue.py":499 + * self._cond.set() + * + * if unfinished_tasks: # <<<<<<<<<<<<<< + * self.unfinished_tasks = unfinished_tasks + * elif items: + */ + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_unfinished_tasks); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 499, __pyx_L1_error) + if (__pyx_t_5) { + + /* "src/gevent/queue.py":500 + * + * if unfinished_tasks: + * self.unfinished_tasks = unfinished_tasks # <<<<<<<<<<<<<< + * elif items: + * self.unfinished_tasks = len(items) + */ + __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_v_unfinished_tasks); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 500, __pyx_L1_error) + __pyx_v_self->unfinished_tasks = __pyx_t_6; + + /* "src/gevent/queue.py":499 + * self._cond.set() + * + * if unfinished_tasks: # <<<<<<<<<<<<<< + * self.unfinished_tasks = unfinished_tasks + * elif items: + */ + goto __pyx_L3; + } + + /* "src/gevent/queue.py":501 + * if unfinished_tasks: + * self.unfinished_tasks = unfinished_tasks + * elif items: # <<<<<<<<<<<<<< + * self.unfinished_tasks = len(items) + * else: + */ + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_items); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 501, __pyx_L1_error) + if (__pyx_t_5) { + + /* "src/gevent/queue.py":502 + * self.unfinished_tasks = unfinished_tasks + * elif items: + * self.unfinished_tasks = len(items) # <<<<<<<<<<<<<< + * else: + * self.unfinished_tasks = 0 + */ + __pyx_t_7 = PyObject_Length(__pyx_v_items); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 502, __pyx_L1_error) + __pyx_v_self->unfinished_tasks = __pyx_t_7; + + /* "src/gevent/queue.py":501 + * if unfinished_tasks: + * self.unfinished_tasks = unfinished_tasks + * elif items: # <<<<<<<<<<<<<< + * self.unfinished_tasks = len(items) + * else: + */ + goto __pyx_L3; + } + + /* "src/gevent/queue.py":504 + * self.unfinished_tasks = len(items) + * else: + * self.unfinished_tasks = 0 # <<<<<<<<<<<<<< + * + * if self.unfinished_tasks: + */ + /*else*/ { + __pyx_v_self->unfinished_tasks = 0; + } + __pyx_L3:; + + /* "src/gevent/queue.py":506 + * self.unfinished_tasks = 0 + * + * if self.unfinished_tasks: # <<<<<<<<<<<<<< + * self._cond.clear() + * + */ + __pyx_t_5 = (__pyx_v_self->unfinished_tasks != 0); + if (__pyx_t_5) { + + /* "src/gevent/queue.py":507 + * + * if self.unfinished_tasks: + * self._cond.clear() # <<<<<<<<<<<<<< + * + * def copy(self): + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->_cond), __pyx_n_s_clear); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 507, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_2)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + } + } + __pyx_t_3 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 507, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "src/gevent/queue.py":506 + * self.unfinished_tasks = 0 + * + * if self.unfinished_tasks: # <<<<<<<<<<<<<< + * self._cond.clear() + * + */ + } + + /* "src/gevent/queue.py":485 + * ) + * + * def __init__(self, maxsize=None, items=(), unfinished_tasks=None): # <<<<<<<<<<<<<< + * """ + * + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("gevent._queue.JoinableQueue.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_Event); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/queue.py":509 + * self._cond.clear() + * + * def copy(self): # <<<<<<<<<<<<<< + * return type(self)(self.maxsize, self.queue, self.unfinished_tasks) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_queue_13JoinableQueue_3copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6gevent_6_queue_13JoinableQueue_2copy[] = "JoinableQueue.copy(self)"; +static PyMethodDef __pyx_mdef_6gevent_6_queue_13JoinableQueue_3copy = {"copy", (PyCFunction)__pyx_pw_6gevent_6_queue_13JoinableQueue_3copy, METH_NOARGS, __pyx_doc_6gevent_6_queue_13JoinableQueue_2copy}; +static PyObject *__pyx_pw_6gevent_6_queue_13JoinableQueue_3copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("copy (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6_queue_13JoinableQueue_2copy(((struct __pyx_obj_6gevent_6_queue_JoinableQueue *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_queue_13JoinableQueue_2copy(struct __pyx_obj_6gevent_6_queue_JoinableQueue *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + __Pyx_RefNannySetupContext("copy", 0); + + /* "src/gevent/queue.py":510 + * + * def copy(self): + * return type(self)(self.maxsize, self.queue, self.unfinished_tasks) # <<<<<<<<<<<<<< + * + * def _format(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_maxsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 510, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->unfinished_tasks); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 510, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __pyx_t_4 = ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))); __pyx_t_5 = NULL; + __pyx_t_6 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + __pyx_t_6 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_4)) { + PyObject *__pyx_temp[4] = {__pyx_t_5, __pyx_t_2, __pyx_v_self->__pyx_base.queue, __pyx_t_3}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 510, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { + PyObject *__pyx_temp[4] = {__pyx_t_5, __pyx_t_2, __pyx_v_self->__pyx_base.queue, __pyx_t_3}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 510, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } else + #endif + { + __pyx_t_7 = PyTuple_New(3+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 510, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + if (__pyx_t_5) { + __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL; + } + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_t_2); + __Pyx_INCREF(__pyx_v_self->__pyx_base.queue); + __Pyx_GIVEREF(__pyx_v_self->__pyx_base.queue); + PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_self->__pyx_base.queue); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_6, __pyx_t_3); + __pyx_t_2 = 0; + __pyx_t_3 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 510, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "src/gevent/queue.py":509 + * self._cond.clear() + * + * def copy(self): # <<<<<<<<<<<<<< + * return type(self)(self.maxsize, self.queue, self.unfinished_tasks) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("gevent._queue.JoinableQueue.copy", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/queue.py":512 + * return type(self)(self.maxsize, self.queue, self.unfinished_tasks) + * + * def _format(self): # <<<<<<<<<<<<<< + * result = Queue._format(self) + * if self.unfinished_tasks: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_queue_13JoinableQueue_5_format(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6gevent_6_queue_13JoinableQueue_4_format[] = "JoinableQueue._format(self)"; +static PyMethodDef __pyx_mdef_6gevent_6_queue_13JoinableQueue_5_format = {"_format", (PyCFunction)__pyx_pw_6gevent_6_queue_13JoinableQueue_5_format, METH_NOARGS, __pyx_doc_6gevent_6_queue_13JoinableQueue_4_format}; +static PyObject *__pyx_pw_6gevent_6_queue_13JoinableQueue_5_format(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_format (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6_queue_13JoinableQueue_4_format(((struct __pyx_obj_6gevent_6_queue_JoinableQueue *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_queue_13JoinableQueue_4_format(struct __pyx_obj_6gevent_6_queue_JoinableQueue *__pyx_v_self) { + PyObject *__pyx_v_result = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + __Pyx_RefNannySetupContext("_format", 0); + + /* "src/gevent/queue.py":513 + * + * def _format(self): + * result = Queue._format(self) # <<<<<<<<<<<<<< + * if self.unfinished_tasks: + * result += ' tasks=%s _cond=%s' % (self.unfinished_tasks, self._cond) + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_6gevent_6_queue_Queue), __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 513, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, ((PyObject *)__pyx_v_self)) : __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_v_self)); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 513, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_result = __pyx_t_1; + __pyx_t_1 = 0; + + /* "src/gevent/queue.py":514 + * def _format(self): + * result = Queue._format(self) + * if self.unfinished_tasks: # <<<<<<<<<<<<<< + * result += ' tasks=%s _cond=%s' % (self.unfinished_tasks, self._cond) + * return result + */ + __pyx_t_4 = (__pyx_v_self->unfinished_tasks != 0); + if (__pyx_t_4) { + + /* "src/gevent/queue.py":515 + * result = Queue._format(self) + * if self.unfinished_tasks: + * result += ' tasks=%s _cond=%s' % (self.unfinished_tasks, self._cond) # <<<<<<<<<<<<<< + * return result + * + */ + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->unfinished_tasks); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 515, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 515, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_self->_cond)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self->_cond)); + PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_self->_cond)); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_tasks_s__cond_s, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 515, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 515, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_2); + __pyx_t_2 = 0; + + /* "src/gevent/queue.py":514 + * def _format(self): + * result = Queue._format(self) + * if self.unfinished_tasks: # <<<<<<<<<<<<<< + * result += ' tasks=%s _cond=%s' % (self.unfinished_tasks, self._cond) + * return result + */ + } + + /* "src/gevent/queue.py":516 + * if self.unfinished_tasks: + * result += ' tasks=%s _cond=%s' % (self.unfinished_tasks, self._cond) + * return result # <<<<<<<<<<<<<< + * + * def _put(self, item): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; + goto __pyx_L0; + + /* "src/gevent/queue.py":512 + * return type(self)(self.maxsize, self.queue, self.unfinished_tasks) + * + * def _format(self): # <<<<<<<<<<<<<< + * result = Queue._format(self) + * if self.unfinished_tasks: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("gevent._queue.JoinableQueue._format", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/queue.py":518 + * return result + * + * def _put(self, item): # <<<<<<<<<<<<<< + * Queue._put(self, item) + * self.unfinished_tasks += 1 + */ + +static PyObject *__pyx_pw_6gevent_6_queue_13JoinableQueue_7_put(PyObject *__pyx_v_self, PyObject *__pyx_v_item); /*proto*/ +static PyObject *__pyx_f_6gevent_6_queue_13JoinableQueue__put(struct __pyx_obj_6gevent_6_queue_JoinableQueue *__pyx_v_self, PyObject *__pyx_v_item, int __pyx_skip_dispatch) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + __Pyx_RefNannySetupContext("_put", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0; + if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self)))))); + else { + PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + #endif + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_put); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 518, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_6_queue_13JoinableQueue_7_put)) { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_item) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_item); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 518, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0; + if (unlikely(type_dict_guard != tp_dict_version)) { + tp_dict_version = obj_dict_version = 0; + } + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + } + #endif + } + + /* "src/gevent/queue.py":519 + * + * def _put(self, item): + * Queue._put(self, item) # <<<<<<<<<<<<<< + * self.unfinished_tasks += 1 + * self._cond.clear() + */ + __pyx_t_1 = __pyx_f_6gevent_6_queue_5Queue__put(((struct __pyx_obj_6gevent_6_queue_Queue *)__pyx_v_self), __pyx_v_item, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 519, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/queue.py":520 + * def _put(self, item): + * Queue._put(self, item) + * self.unfinished_tasks += 1 # <<<<<<<<<<<<<< + * self._cond.clear() + * + */ + __pyx_v_self->unfinished_tasks = (__pyx_v_self->unfinished_tasks + 1); + + /* "src/gevent/queue.py":521 + * Queue._put(self, item) + * self.unfinished_tasks += 1 + * self._cond.clear() # <<<<<<<<<<<<<< + * + * def task_done(self): + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->_cond), __pyx_n_s_clear); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 521, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 521, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/queue.py":518 + * return result + * + * def _put(self, item): # <<<<<<<<<<<<<< + * Queue._put(self, item) + * self.unfinished_tasks += 1 + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("gevent._queue.JoinableQueue._put", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_queue_13JoinableQueue_7_put(PyObject *__pyx_v_self, PyObject *__pyx_v_item); /*proto*/ +static char __pyx_doc_6gevent_6_queue_13JoinableQueue_6_put[] = "JoinableQueue._put(self, item)"; +static PyMethodDef __pyx_mdef_6gevent_6_queue_13JoinableQueue_7_put = {"_put", (PyCFunction)__pyx_pw_6gevent_6_queue_13JoinableQueue_7_put, METH_O, __pyx_doc_6gevent_6_queue_13JoinableQueue_6_put}; +static PyObject *__pyx_pw_6gevent_6_queue_13JoinableQueue_7_put(PyObject *__pyx_v_self, PyObject *__pyx_v_item) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_put (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6_queue_13JoinableQueue_6_put(((struct __pyx_obj_6gevent_6_queue_JoinableQueue *)__pyx_v_self), ((PyObject *)__pyx_v_item)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_queue_13JoinableQueue_6_put(struct __pyx_obj_6gevent_6_queue_JoinableQueue *__pyx_v_self, PyObject *__pyx_v_item) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("_put", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6gevent_6_queue_13JoinableQueue__put(__pyx_v_self, __pyx_v_item, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 518, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent._queue.JoinableQueue._put", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/queue.py":523 + * self._cond.clear() + * + * def task_done(self): # <<<<<<<<<<<<<< + * '''Indicate that a formerly enqueued task is complete. Used by queue consumer threads. + * For each :meth:`get ` used to fetch a task, a subsequent call to :meth:`task_done` tells the queue + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_queue_13JoinableQueue_9task_done(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6gevent_6_queue_13JoinableQueue_8task_done[] = "JoinableQueue.task_done(self)\nIndicate that a formerly enqueued task is complete. Used by queue consumer threads.\n For each :meth:`get ` used to fetch a task, a subsequent call to :meth:`task_done` tells the queue\n that the processing on the task is complete.\n\n If a :meth:`join` is currently blocking, it will resume when all items have been processed\n (meaning that a :meth:`task_done` call was received for every item that had been\n :meth:`put ` into the queue).\n\n Raises a :exc:`ValueError` if called more times than there were items placed in the queue.\n "; +static PyMethodDef __pyx_mdef_6gevent_6_queue_13JoinableQueue_9task_done = {"task_done", (PyCFunction)__pyx_pw_6gevent_6_queue_13JoinableQueue_9task_done, METH_NOARGS, __pyx_doc_6gevent_6_queue_13JoinableQueue_8task_done}; +static PyObject *__pyx_pw_6gevent_6_queue_13JoinableQueue_9task_done(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("task_done (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6_queue_13JoinableQueue_8task_done(((struct __pyx_obj_6gevent_6_queue_JoinableQueue *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_queue_13JoinableQueue_8task_done(struct __pyx_obj_6gevent_6_queue_JoinableQueue *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + __Pyx_RefNannySetupContext("task_done", 0); + + /* "src/gevent/queue.py":534 + * Raises a :exc:`ValueError` if called more times than there were items placed in the queue. + * ''' + * if self.unfinished_tasks <= 0: # <<<<<<<<<<<<<< + * raise ValueError('task_done() called too many times') + * self.unfinished_tasks -= 1 + */ + __pyx_t_1 = ((__pyx_v_self->unfinished_tasks <= 0) != 0); + if (unlikely(__pyx_t_1)) { + + /* "src/gevent/queue.py":535 + * ''' + * if self.unfinished_tasks <= 0: + * raise ValueError('task_done() called too many times') # <<<<<<<<<<<<<< + * self.unfinished_tasks -= 1 + * if self.unfinished_tasks == 0: + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 535, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 535, __pyx_L1_error) + + /* "src/gevent/queue.py":534 + * Raises a :exc:`ValueError` if called more times than there were items placed in the queue. + * ''' + * if self.unfinished_tasks <= 0: # <<<<<<<<<<<<<< + * raise ValueError('task_done() called too many times') + * self.unfinished_tasks -= 1 + */ + } + + /* "src/gevent/queue.py":536 + * if self.unfinished_tasks <= 0: + * raise ValueError('task_done() called too many times') + * self.unfinished_tasks -= 1 # <<<<<<<<<<<<<< + * if self.unfinished_tasks == 0: + * self._cond.set() + */ + __pyx_v_self->unfinished_tasks = (__pyx_v_self->unfinished_tasks - 1); + + /* "src/gevent/queue.py":537 + * raise ValueError('task_done() called too many times') + * self.unfinished_tasks -= 1 + * if self.unfinished_tasks == 0: # <<<<<<<<<<<<<< + * self._cond.set() + * + */ + __pyx_t_1 = ((__pyx_v_self->unfinished_tasks == 0) != 0); + if (__pyx_t_1) { + + /* "src/gevent/queue.py":538 + * self.unfinished_tasks -= 1 + * if self.unfinished_tasks == 0: + * self._cond.set() # <<<<<<<<<<<<<< + * + * def join(self, timeout=None): + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->_cond), __pyx_n_s_set); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 538, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 538, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/queue.py":537 + * raise ValueError('task_done() called too many times') + * self.unfinished_tasks -= 1 + * if self.unfinished_tasks == 0: # <<<<<<<<<<<<<< + * self._cond.set() + * + */ + } + + /* "src/gevent/queue.py":523 + * self._cond.clear() + * + * def task_done(self): # <<<<<<<<<<<<<< + * '''Indicate that a formerly enqueued task is complete. Used by queue consumer threads. + * For each :meth:`get ` used to fetch a task, a subsequent call to :meth:`task_done` tells the queue + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("gevent._queue.JoinableQueue.task_done", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/queue.py":540 + * self._cond.set() + * + * def join(self, timeout=None): # <<<<<<<<<<<<<< + * ''' + * Block until all items in the queue have been gotten and processed. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_queue_13JoinableQueue_11join(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6gevent_6_queue_13JoinableQueue_10join[] = "JoinableQueue.join(self, timeout=None)\n\n Block until all items in the queue have been gotten and processed.\n\n The count of unfinished tasks goes up whenever an item is added to the queue.\n The count goes down whenever a consumer thread calls :meth:`task_done` to indicate\n that the item was retrieved and all work on it is complete. When the count of\n unfinished tasks drops to zero, :meth:`join` unblocks.\n\n :param float timeout: If not ``None``, then wait no more than this time in seconds\n for all tasks to finish.\n :return: ``True`` if all tasks have finished; if ``timeout`` was given and expired before\n all tasks finished, ``False``.\n\n .. versionchanged:: 1.1a1\n Add the *timeout* parameter.\n "; +static PyMethodDef __pyx_mdef_6gevent_6_queue_13JoinableQueue_11join = {"join", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_6_queue_13JoinableQueue_11join, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_6_queue_13JoinableQueue_10join}; +static PyObject *__pyx_pw_6gevent_6_queue_13JoinableQueue_11join(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_timeout = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("join (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_timeout,0}; + PyObject* values[1] = {0}; + values[0] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_timeout); + if (value) { values[0] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "join") < 0)) __PYX_ERR(0, 540, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_timeout = values[0]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("join", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 540, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent._queue.JoinableQueue.join", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_6_queue_13JoinableQueue_10join(((struct __pyx_obj_6gevent_6_queue_JoinableQueue *)__pyx_v_self), __pyx_v_timeout); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_queue_13JoinableQueue_10join(struct __pyx_obj_6gevent_6_queue_JoinableQueue *__pyx_v_self, PyObject *__pyx_v_timeout) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("join", 0); + + /* "src/gevent/queue.py":557 + * Add the *timeout* parameter. + * ''' + * return self._cond.wait(timeout=timeout) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->_cond), __pyx_n_s_wait); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 557, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 557, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_timeout, __pyx_v_timeout) < 0) __PYX_ERR(0, 557, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 557, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "src/gevent/queue.py":540 + * self._cond.set() + * + * def join(self, timeout=None): # <<<<<<<<<<<<<< + * ''' + * Block until all items in the queue have been gotten and processed. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("gevent._queue.JoinableQueue.join", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/_queue.pxd":61 + * cdef class JoinableQueue(Queue): + * cdef Event _cond + * cdef readonly int unfinished_tasks # <<<<<<<<<<<<<< + * + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_queue_13JoinableQueue_16unfinished_tasks_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_6_queue_13JoinableQueue_16unfinished_tasks_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6_queue_13JoinableQueue_16unfinished_tasks___get__(((struct __pyx_obj_6gevent_6_queue_JoinableQueue *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_queue_13JoinableQueue_16unfinished_tasks___get__(struct __pyx_obj_6gevent_6_queue_JoinableQueue *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->unfinished_tasks); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 61, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent._queue.JoinableQueue.unfinished_tasks.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/queue.py":570 + * ) + * + * def __init__(self, maxsize=1): # <<<<<<<<<<<<<< + * # We take maxsize to simplify certain kinds of code + * if maxsize != 1: + */ + +/* Python wrapper */ +static int __pyx_pw_6gevent_6_queue_7Channel_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6gevent_6_queue_7Channel_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_maxsize = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_maxsize,0}; + PyObject* values[1] = {0}; + values[0] = ((PyObject *)__pyx_int_1); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_maxsize); + if (value) { values[0] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 570, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_maxsize = values[0]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 570, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent._queue.Channel.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_6_queue_7Channel___init__(((struct __pyx_obj_6gevent_6_queue_Channel *)__pyx_v_self), __pyx_v_maxsize); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_6_queue_7Channel___init__(struct __pyx_obj_6gevent_6_queue_Channel *__pyx_v_self, PyObject *__pyx_v_maxsize) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "src/gevent/queue.py":572 + * def __init__(self, maxsize=1): + * # We take maxsize to simplify certain kinds of code + * if maxsize != 1: # <<<<<<<<<<<<<< + * raise ValueError("Channels have a maxsize of 1") + * self.getters = collections.deque() + */ + __pyx_t_1 = __Pyx_PyInt_NeObjC(__pyx_v_maxsize, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 572, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 572, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(__pyx_t_2)) { + + /* "src/gevent/queue.py":573 + * # We take maxsize to simplify certain kinds of code + * if maxsize != 1: + * raise ValueError("Channels have a maxsize of 1") # <<<<<<<<<<<<<< + * self.getters = collections.deque() + * self.putters = collections.deque() + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 573, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 573, __pyx_L1_error) + + /* "src/gevent/queue.py":572 + * def __init__(self, maxsize=1): + * # We take maxsize to simplify certain kinds of code + * if maxsize != 1: # <<<<<<<<<<<<<< + * raise ValueError("Channels have a maxsize of 1") + * self.getters = collections.deque() + */ + } + + /* "src/gevent/queue.py":574 + * if maxsize != 1: + * raise ValueError("Channels have a maxsize of 1") + * self.getters = collections.deque() # <<<<<<<<<<<<<< + * self.putters = collections.deque() + * self.hub = get_hub() + */ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_collections); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 574, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_deque); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 574, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + } + } + __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 574, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_self->getters); + __Pyx_DECREF(__pyx_v_self->getters); + __pyx_v_self->getters = __pyx_t_1; + __pyx_t_1 = 0; + + /* "src/gevent/queue.py":575 + * raise ValueError("Channels have a maxsize of 1") + * self.getters = collections.deque() + * self.putters = collections.deque() # <<<<<<<<<<<<<< + * self.hub = get_hub() + * self._event_unlock = None + */ + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_collections); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 575, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_deque); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 575, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 575, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_self->putters); + __Pyx_DECREF(__pyx_v_self->putters); + __pyx_v_self->putters = __pyx_t_1; + __pyx_t_1 = 0; + + /* "src/gevent/queue.py":576 + * self.getters = collections.deque() + * self.putters = collections.deque() + * self.hub = get_hub() # <<<<<<<<<<<<<< + * self._event_unlock = None + * + */ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_get_hub); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 576, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 576, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_self->hub); + __Pyx_DECREF(__pyx_v_self->hub); + __pyx_v_self->hub = __pyx_t_1; + __pyx_t_1 = 0; + + /* "src/gevent/queue.py":577 + * self.putters = collections.deque() + * self.hub = get_hub() + * self._event_unlock = None # <<<<<<<<<<<<<< + * + * def __repr__(self): + */ + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->_event_unlock); + __Pyx_DECREF(__pyx_v_self->_event_unlock); + __pyx_v_self->_event_unlock = Py_None; + + /* "src/gevent/queue.py":570 + * ) + * + * def __init__(self, maxsize=1): # <<<<<<<<<<<<<< + * # We take maxsize to simplify certain kinds of code + * if maxsize != 1: + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("gevent._queue.Channel.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/queue.py":579 + * self._event_unlock = None + * + * def __repr__(self): # <<<<<<<<<<<<<< + * return '<%s at %s %s>' % (type(self).__name__, hex(id(self)), self._format()) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_queue_7Channel_3__repr__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_6_queue_7Channel_3__repr__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6_queue_7Channel_2__repr__(((struct __pyx_obj_6gevent_6_queue_Channel *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_queue_7Channel_2__repr__(struct __pyx_obj_6gevent_6_queue_Channel *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + __Pyx_RefNannySetupContext("__repr__", 0); + + /* "src/gevent/queue.py":580 + * + * def __repr__(self): + * return '<%s at %s %s>' % (type(self).__name__, hex(id(self)), self._format()) # <<<<<<<<<<<<<< + * + * def __str__(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))), __pyx_n_s_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 580, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 580, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_hex, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 580, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 580, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + } + } + __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 580, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 580, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_2); + __pyx_t_1 = 0; + __pyx_t_3 = 0; + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_s_at_s_s_2, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 580, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "src/gevent/queue.py":579 + * self._event_unlock = None + * + * def __repr__(self): # <<<<<<<<<<<<<< + * return '<%s at %s %s>' % (type(self).__name__, hex(id(self)), self._format()) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("gevent._queue.Channel.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/queue.py":582 + * return '<%s at %s %s>' % (type(self).__name__, hex(id(self)), self._format()) + * + * def __str__(self): # <<<<<<<<<<<<<< + * return '<%s %s>' % (type(self).__name__, self._format()) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_queue_7Channel_5__str__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_6_queue_7Channel_5__str__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__str__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6_queue_7Channel_4__str__(((struct __pyx_obj_6gevent_6_queue_Channel *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_queue_7Channel_4__str__(struct __pyx_obj_6gevent_6_queue_Channel *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + __Pyx_RefNannySetupContext("__str__", 0); + + /* "src/gevent/queue.py":583 + * + * def __str__(self): + * return '<%s %s>' % (type(self).__name__, self._format()) # <<<<<<<<<<<<<< + * + * def _format(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))), __pyx_n_s_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 583, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 583, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 583, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 583, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); + __pyx_t_1 = 0; + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_s_s_2, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 583, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "src/gevent/queue.py":582 + * return '<%s at %s %s>' % (type(self).__name__, hex(id(self)), self._format()) + * + * def __str__(self): # <<<<<<<<<<<<<< + * return '<%s %s>' % (type(self).__name__, self._format()) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("gevent._queue.Channel.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/queue.py":585 + * return '<%s %s>' % (type(self).__name__, self._format()) + * + * def _format(self): # <<<<<<<<<<<<<< + * result = '' + * if self.getters: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_queue_7Channel_7_format(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6gevent_6_queue_7Channel_6_format[] = "Channel._format(self)"; +static PyMethodDef __pyx_mdef_6gevent_6_queue_7Channel_7_format = {"_format", (PyCFunction)__pyx_pw_6gevent_6_queue_7Channel_7_format, METH_NOARGS, __pyx_doc_6gevent_6_queue_7Channel_6_format}; +static PyObject *__pyx_pw_6gevent_6_queue_7Channel_7_format(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_format (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6_queue_7Channel_6_format(((struct __pyx_obj_6gevent_6_queue_Channel *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_queue_7Channel_6_format(struct __pyx_obj_6gevent_6_queue_Channel *__pyx_v_self) { + PyObject *__pyx_v_result = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + __Pyx_RefNannySetupContext("_format", 0); + + /* "src/gevent/queue.py":586 + * + * def _format(self): + * result = '' # <<<<<<<<<<<<<< + * if self.getters: + * result += ' getters[%s]' % len(self.getters) + */ + __Pyx_INCREF(__pyx_kp_s__3); + __pyx_v_result = __pyx_kp_s__3; + + /* "src/gevent/queue.py":587 + * def _format(self): + * result = '' + * if self.getters: # <<<<<<<<<<<<<< + * result += ' getters[%s]' % len(self.getters) + * if self.putters: + */ + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_self->getters); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 587, __pyx_L1_error) + if (__pyx_t_1) { + + /* "src/gevent/queue.py":588 + * result = '' + * if self.getters: + * result += ' getters[%s]' % len(self.getters) # <<<<<<<<<<<<<< + * if self.putters: + * result += ' putters[%s]' % len(self.putters) + */ + __pyx_t_2 = __pyx_v_self->getters; + __Pyx_INCREF(__pyx_t_2); + __pyx_t_3 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 588, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 588, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_getters_s_2, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 588, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 588, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (!(likely(PyString_CheckExact(__pyx_t_2))||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(0, 588, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "src/gevent/queue.py":587 + * def _format(self): + * result = '' + * if self.getters: # <<<<<<<<<<<<<< + * result += ' getters[%s]' % len(self.getters) + * if self.putters: + */ + } + + /* "src/gevent/queue.py":589 + * if self.getters: + * result += ' getters[%s]' % len(self.getters) + * if self.putters: # <<<<<<<<<<<<<< + * result += ' putters[%s]' % len(self.putters) + * return result + */ + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_self->putters); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 589, __pyx_L1_error) + if (__pyx_t_1) { + + /* "src/gevent/queue.py":590 + * result += ' getters[%s]' % len(self.getters) + * if self.putters: + * result += ' putters[%s]' % len(self.putters) # <<<<<<<<<<<<<< + * return result + * + */ + __pyx_t_2 = __pyx_v_self->putters; + __Pyx_INCREF(__pyx_t_2); + __pyx_t_3 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 590, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 590, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_putters_s_2, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 590, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 590, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (!(likely(PyString_CheckExact(__pyx_t_2))||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(0, 590, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "src/gevent/queue.py":589 + * if self.getters: + * result += ' getters[%s]' % len(self.getters) + * if self.putters: # <<<<<<<<<<<<<< + * result += ' putters[%s]' % len(self.putters) + * return result + */ + } + + /* "src/gevent/queue.py":591 + * if self.putters: + * result += ' putters[%s]' % len(self.putters) + * return result # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; + goto __pyx_L0; + + /* "src/gevent/queue.py":585 + * return '<%s %s>' % (type(self).__name__, self._format()) + * + * def _format(self): # <<<<<<<<<<<<<< + * result = '' + * if self.getters: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("gevent._queue.Channel._format", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/queue.py":594 + * + * @property + * def balance(self): # <<<<<<<<<<<<<< + * return len(self.putters) - len(self.getters) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_queue_7Channel_7balance_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_6_queue_7Channel_7balance_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6_queue_7Channel_7balance___get__(((struct __pyx_obj_6gevent_6_queue_Channel *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_queue_7Channel_7balance___get__(struct __pyx_obj_6gevent_6_queue_Channel *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + Py_ssize_t __pyx_t_3; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "src/gevent/queue.py":595 + * @property + * def balance(self): + * return len(self.putters) - len(self.getters) # <<<<<<<<<<<<<< + * + * def qsize(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_v_self->putters; + __Pyx_INCREF(__pyx_t_1); + __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 595, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __pyx_v_self->getters; + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 595, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyInt_FromSsize_t((__pyx_t_2 - __pyx_t_3)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 595, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "src/gevent/queue.py":594 + * + * @property + * def balance(self): # <<<<<<<<<<<<<< + * return len(self.putters) - len(self.getters) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent._queue.Channel.balance.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/queue.py":597 + * return len(self.putters) - len(self.getters) + * + * def qsize(self): # <<<<<<<<<<<<<< + * return 0 + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_queue_7Channel_9qsize(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6gevent_6_queue_7Channel_8qsize[] = "Channel.qsize(self)"; +static PyMethodDef __pyx_mdef_6gevent_6_queue_7Channel_9qsize = {"qsize", (PyCFunction)__pyx_pw_6gevent_6_queue_7Channel_9qsize, METH_NOARGS, __pyx_doc_6gevent_6_queue_7Channel_8qsize}; +static PyObject *__pyx_pw_6gevent_6_queue_7Channel_9qsize(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("qsize (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6_queue_7Channel_8qsize(((struct __pyx_obj_6gevent_6_queue_Channel *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_queue_7Channel_8qsize(CYTHON_UNUSED struct __pyx_obj_6gevent_6_queue_Channel *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("qsize", 0); + + /* "src/gevent/queue.py":598 + * + * def qsize(self): + * return 0 # <<<<<<<<<<<<<< + * + * def empty(self): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_int_0); + __pyx_r = __pyx_int_0; + goto __pyx_L0; + + /* "src/gevent/queue.py":597 + * return len(self.putters) - len(self.getters) + * + * def qsize(self): # <<<<<<<<<<<<<< + * return 0 + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/queue.py":600 + * return 0 + * + * def empty(self): # <<<<<<<<<<<<<< + * return True + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_queue_7Channel_11empty(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6gevent_6_queue_7Channel_10empty[] = "Channel.empty(self)"; +static PyMethodDef __pyx_mdef_6gevent_6_queue_7Channel_11empty = {"empty", (PyCFunction)__pyx_pw_6gevent_6_queue_7Channel_11empty, METH_NOARGS, __pyx_doc_6gevent_6_queue_7Channel_10empty}; +static PyObject *__pyx_pw_6gevent_6_queue_7Channel_11empty(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("empty (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6_queue_7Channel_10empty(((struct __pyx_obj_6gevent_6_queue_Channel *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_queue_7Channel_10empty(CYTHON_UNUSED struct __pyx_obj_6gevent_6_queue_Channel *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("empty", 0); + + /* "src/gevent/queue.py":601 + * + * def empty(self): + * return True # <<<<<<<<<<<<<< + * + * def full(self): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; + goto __pyx_L0; + + /* "src/gevent/queue.py":600 + * return 0 + * + * def empty(self): # <<<<<<<<<<<<<< + * return True + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/queue.py":603 + * return True + * + * def full(self): # <<<<<<<<<<<<<< + * return True + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_queue_7Channel_13full(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6gevent_6_queue_7Channel_12full[] = "Channel.full(self)"; +static PyMethodDef __pyx_mdef_6gevent_6_queue_7Channel_13full = {"full", (PyCFunction)__pyx_pw_6gevent_6_queue_7Channel_13full, METH_NOARGS, __pyx_doc_6gevent_6_queue_7Channel_12full}; +static PyObject *__pyx_pw_6gevent_6_queue_7Channel_13full(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("full (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6_queue_7Channel_12full(((struct __pyx_obj_6gevent_6_queue_Channel *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_queue_7Channel_12full(CYTHON_UNUSED struct __pyx_obj_6gevent_6_queue_Channel *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("full", 0); + + /* "src/gevent/queue.py":604 + * + * def full(self): + * return True # <<<<<<<<<<<<<< + * + * def put(self, item, block=True, timeout=None): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; + goto __pyx_L0; + + /* "src/gevent/queue.py":603 + * return True + * + * def full(self): # <<<<<<<<<<<<<< + * return True + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/queue.py":606 + * return True + * + * def put(self, item, block=True, timeout=None): # <<<<<<<<<<<<<< + * if self.hub is getcurrent(): + * if self.getters: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_queue_7Channel_15put(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6gevent_6_queue_7Channel_14put[] = "Channel.put(self, item, block=True, timeout=None)"; +static PyMethodDef __pyx_mdef_6gevent_6_queue_7Channel_15put = {"put", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_6_queue_7Channel_15put, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_6_queue_7Channel_14put}; +static PyObject *__pyx_pw_6gevent_6_queue_7Channel_15put(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_item = 0; + PyObject *__pyx_v_block = 0; + PyObject *__pyx_v_timeout = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("put (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_item,&__pyx_n_s_block,&__pyx_n_s_timeout,0}; + PyObject* values[3] = {0,0,0}; + values[1] = ((PyObject *)Py_True); + values[2] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_item)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_block); + if (value) { values[1] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 2: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_timeout); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "put") < 0)) __PYX_ERR(0, 606, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_item = values[0]; + __pyx_v_block = values[1]; + __pyx_v_timeout = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("put", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 606, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent._queue.Channel.put", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_6_queue_7Channel_14put(((struct __pyx_obj_6gevent_6_queue_Channel *)__pyx_v_self), __pyx_v_item, __pyx_v_block, __pyx_v_timeout); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_queue_7Channel_14put(struct __pyx_obj_6gevent_6_queue_Channel *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_block, PyObject *__pyx_v_timeout) { + PyObject *__pyx_v_getter = NULL; + struct __pyx_obj_6gevent_8__waiter_Waiter *__pyx_v_waiter = NULL; + PyObject *__pyx_v_result = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_t_5; + int __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + int __pyx_t_13; + char const *__pyx_t_14; + PyObject *__pyx_t_15 = NULL; + PyObject *__pyx_t_16 = NULL; + PyObject *__pyx_t_17 = NULL; + __Pyx_RefNannySetupContext("put", 0); + __Pyx_INCREF(__pyx_v_item); + __Pyx_INCREF(__pyx_v_timeout); + + /* "src/gevent/queue.py":607 + * + * def put(self, item, block=True, timeout=None): + * if self.hub is getcurrent(): # <<<<<<<<<<<<<< + * if self.getters: + * getter = self.getters.popleft() + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_getcurrent); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 607, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 607, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_4 = (__pyx_v_self->hub == __pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_5 = (__pyx_t_4 != 0); + if (__pyx_t_5) { + + /* "src/gevent/queue.py":608 + * def put(self, item, block=True, timeout=None): + * if self.hub is getcurrent(): + * if self.getters: # <<<<<<<<<<<<<< + * getter = self.getters.popleft() + * getter.switch(item) + */ + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_self->getters); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 608, __pyx_L1_error) + if (__pyx_t_5) { + + /* "src/gevent/queue.py":609 + * if self.hub is getcurrent(): + * if self.getters: + * getter = self.getters.popleft() # <<<<<<<<<<<<<< + * getter.switch(item) + * return + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->getters, __pyx_n_s_popleft); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 609, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 609, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_getter = __pyx_t_1; + __pyx_t_1 = 0; + + /* "src/gevent/queue.py":610 + * if self.getters: + * getter = self.getters.popleft() + * getter.switch(item) # <<<<<<<<<<<<<< + * return + * raise Full + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_getter, __pyx_n_s_switch); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 610, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_item) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_item); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 610, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/queue.py":611 + * getter = self.getters.popleft() + * getter.switch(item) + * return # <<<<<<<<<<<<<< + * raise Full + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + + /* "src/gevent/queue.py":608 + * def put(self, item, block=True, timeout=None): + * if self.hub is getcurrent(): + * if self.getters: # <<<<<<<<<<<<<< + * getter = self.getters.popleft() + * getter.switch(item) + */ + } + + /* "src/gevent/queue.py":612 + * getter.switch(item) + * return + * raise Full # <<<<<<<<<<<<<< + * + * if not block: + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Full); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 612, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 612, __pyx_L1_error) + + /* "src/gevent/queue.py":607 + * + * def put(self, item, block=True, timeout=None): + * if self.hub is getcurrent(): # <<<<<<<<<<<<<< + * if self.getters: + * getter = self.getters.popleft() + */ + } + + /* "src/gevent/queue.py":614 + * raise Full + * + * if not block: # <<<<<<<<<<<<<< + * timeout = 0 + * + */ + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_block); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 614, __pyx_L1_error) + __pyx_t_4 = ((!__pyx_t_5) != 0); + if (__pyx_t_4) { + + /* "src/gevent/queue.py":615 + * + * if not block: + * timeout = 0 # <<<<<<<<<<<<<< + * + * waiter = Waiter() # pylint:disable=undefined-variable + */ + __Pyx_INCREF(__pyx_int_0); + __Pyx_DECREF_SET(__pyx_v_timeout, __pyx_int_0); + + /* "src/gevent/queue.py":614 + * raise Full + * + * if not block: # <<<<<<<<<<<<<< + * timeout = 0 + * + */ + } + + /* "src/gevent/queue.py":617 + * timeout = 0 + * + * waiter = Waiter() # pylint:disable=undefined-variable # <<<<<<<<<<<<<< + * item = (item, waiter) + * self.putters.append(item) + */ + __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_6gevent_8__waiter_Waiter)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 617, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_waiter = ((struct __pyx_obj_6gevent_8__waiter_Waiter *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "src/gevent/queue.py":618 + * + * waiter = Waiter() # pylint:disable=undefined-variable + * item = (item, waiter) # <<<<<<<<<<<<<< + * self.putters.append(item) + * timeout = Timeout._start_new_or_dummy(timeout, Full) + */ + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 618, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_item); + __Pyx_GIVEREF(__pyx_v_item); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_item); + __Pyx_INCREF(((PyObject *)__pyx_v_waiter)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_waiter)); + PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_waiter)); + __Pyx_DECREF_SET(__pyx_v_item, __pyx_t_1); + __pyx_t_1 = 0; + + /* "src/gevent/queue.py":619 + * waiter = Waiter() # pylint:disable=undefined-variable + * item = (item, waiter) + * self.putters.append(item) # <<<<<<<<<<<<<< + * timeout = Timeout._start_new_or_dummy(timeout, Full) + * try: + */ + __pyx_t_6 = __Pyx_PyObject_Append(__pyx_v_self->putters, __pyx_v_item); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 619, __pyx_L1_error) + + /* "src/gevent/queue.py":620 + * item = (item, waiter) + * self.putters.append(item) + * timeout = Timeout._start_new_or_dummy(timeout, Full) # <<<<<<<<<<<<<< + * try: + * if self.getters: + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Timeout); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 620, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_start_new_or_dummy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 620, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Full); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 620, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_7 = NULL; + __pyx_t_8 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_7)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_7); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_8 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_3)) { + PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_v_timeout, __pyx_t_2}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 620, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { + PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_v_timeout, __pyx_t_2}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 620, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } else + #endif + { + __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 620, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + if (__pyx_t_7) { + __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL; + } + __Pyx_INCREF(__pyx_v_timeout); + __Pyx_GIVEREF(__pyx_v_timeout); + PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_v_timeout); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 620, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF_SET(__pyx_v_timeout, __pyx_t_1); + __pyx_t_1 = 0; + + /* "src/gevent/queue.py":621 + * self.putters.append(item) + * timeout = Timeout._start_new_or_dummy(timeout, Full) + * try: # <<<<<<<<<<<<<< + * if self.getters: + * self._schedule_unlock() + */ + /*try:*/ { + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12); + __Pyx_XGOTREF(__pyx_t_10); + __Pyx_XGOTREF(__pyx_t_11); + __Pyx_XGOTREF(__pyx_t_12); + /*try:*/ { + + /* "src/gevent/queue.py":622 + * timeout = Timeout._start_new_or_dummy(timeout, Full) + * try: + * if self.getters: # <<<<<<<<<<<<<< + * self._schedule_unlock() + * result = waiter.get() + */ + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_self->getters); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 622, __pyx_L9_error) + if (__pyx_t_4) { + + /* "src/gevent/queue.py":623 + * try: + * if self.getters: + * self._schedule_unlock() # <<<<<<<<<<<<<< + * result = waiter.get() + * if result is not waiter: + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_6_queue_Channel *)__pyx_v_self->__pyx_vtab)->_schedule_unlock(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 623, __pyx_L9_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/queue.py":622 + * timeout = Timeout._start_new_or_dummy(timeout, Full) + * try: + * if self.getters: # <<<<<<<<<<<<<< + * self._schedule_unlock() + * result = waiter.get() + */ + } + + /* "src/gevent/queue.py":624 + * if self.getters: + * self._schedule_unlock() + * result = waiter.get() # <<<<<<<<<<<<<< + * if result is not waiter: + * raise InvalidSwitchError("Invalid switch into Channel.put: %r" % (result, )) + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_8__waiter_Waiter *)__pyx_v_waiter->__pyx_vtab)->get(__pyx_v_waiter, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 624, __pyx_L9_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_result = __pyx_t_1; + __pyx_t_1 = 0; + + /* "src/gevent/queue.py":625 + * self._schedule_unlock() + * result = waiter.get() + * if result is not waiter: # <<<<<<<<<<<<<< + * raise InvalidSwitchError("Invalid switch into Channel.put: %r" % (result, )) + * except: + */ + __pyx_t_4 = (__pyx_v_result != ((PyObject *)__pyx_v_waiter)); + __pyx_t_5 = (__pyx_t_4 != 0); + if (unlikely(__pyx_t_5)) { + + /* "src/gevent/queue.py":626 + * result = waiter.get() + * if result is not waiter: + * raise InvalidSwitchError("Invalid switch into Channel.put: %r" % (result, )) # <<<<<<<<<<<<<< + * except: + * _safe_remove(self.putters, item) + */ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_InvalidSwitchError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 626, __pyx_L9_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 626, __pyx_L9_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_INCREF(__pyx_v_result); + __Pyx_GIVEREF(__pyx_v_result); + PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_result); + __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_switch_into_Channel_put, __pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 626, __pyx_L9_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_9)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_9); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_1 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_9, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 626, __pyx_L9_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 626, __pyx_L9_error) + + /* "src/gevent/queue.py":625 + * self._schedule_unlock() + * result = waiter.get() + * if result is not waiter: # <<<<<<<<<<<<<< + * raise InvalidSwitchError("Invalid switch into Channel.put: %r" % (result, )) + * except: + */ + } + + /* "src/gevent/queue.py":621 + * self.putters.append(item) + * timeout = Timeout._start_new_or_dummy(timeout, Full) + * try: # <<<<<<<<<<<<<< + * if self.getters: + * self._schedule_unlock() + */ + } + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; + goto __pyx_L14_try_end; + __pyx_L9_error:; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/queue.py":627 + * if result is not waiter: + * raise InvalidSwitchError("Invalid switch into Channel.put: %r" % (result, )) + * except: # <<<<<<<<<<<<<< + * _safe_remove(self.putters, item) + * raise + */ + /*except:*/ { + __Pyx_AddTraceback("gevent._queue.Channel.put", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_3, &__pyx_t_2) < 0) __PYX_ERR(0, 627, __pyx_L11_except_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GOTREF(__pyx_t_2); + + /* "src/gevent/queue.py":628 + * raise InvalidSwitchError("Invalid switch into Channel.put: %r" % (result, )) + * except: + * _safe_remove(self.putters, item) # <<<<<<<<<<<<<< + * raise + * finally: + */ + __pyx_t_9 = __pyx_v_self->putters; + __Pyx_INCREF(__pyx_t_9); + __pyx_t_7 = __pyx_f_6gevent_6_queue__safe_remove(__pyx_t_9, __pyx_v_item); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 628, __pyx_L11_except_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "src/gevent/queue.py":629 + * except: + * _safe_remove(self.putters, item) + * raise # <<<<<<<<<<<<<< + * finally: + * timeout.cancel() + */ + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_ErrRestoreWithState(__pyx_t_1, __pyx_t_3, __pyx_t_2); + __pyx_t_1 = 0; __pyx_t_3 = 0; __pyx_t_2 = 0; + __PYX_ERR(0, 629, __pyx_L11_except_error) + } + __pyx_L11_except_error:; + + /* "src/gevent/queue.py":621 + * self.putters.append(item) + * timeout = Timeout._start_new_or_dummy(timeout, Full) + * try: # <<<<<<<<<<<<<< + * if self.getters: + * self._schedule_unlock() + */ + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_XGIVEREF(__pyx_t_12); + __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12); + goto __pyx_L7_error; + __pyx_L14_try_end:; + } + } + + /* "src/gevent/queue.py":631 + * raise + * finally: + * timeout.cancel() # <<<<<<<<<<<<<< + * + * def put_nowait(self, item): + */ + /*finally:*/ { + /*normal exit:*/{ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_timeout, __pyx_n_s_cancel); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 631, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_1)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_1); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_1) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1) : __Pyx_PyObject_CallNoArg(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 631, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + goto __pyx_L8; + } + __pyx_L7_error:; + /*exception exit:*/{ + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __pyx_t_12 = 0; __pyx_t_11 = 0; __pyx_t_10 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17); + if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_12, &__pyx_t_11, &__pyx_t_10) < 0)) __Pyx_ErrFetch(&__pyx_t_12, &__pyx_t_11, &__pyx_t_10); + __Pyx_XGOTREF(__pyx_t_12); + __Pyx_XGOTREF(__pyx_t_11); + __Pyx_XGOTREF(__pyx_t_10); + __Pyx_XGOTREF(__pyx_t_15); + __Pyx_XGOTREF(__pyx_t_16); + __Pyx_XGOTREF(__pyx_t_17); + __pyx_t_8 = __pyx_lineno; __pyx_t_13 = __pyx_clineno; __pyx_t_14 = __pyx_filename; + { + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_timeout, __pyx_n_s_cancel); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 631, __pyx_L20_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_1)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_1); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_1) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1) : __Pyx_PyObject_CallNoArg(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 631, __pyx_L20_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + if (PY_MAJOR_VERSION >= 3) { + __Pyx_XGIVEREF(__pyx_t_15); + __Pyx_XGIVEREF(__pyx_t_16); + __Pyx_XGIVEREF(__pyx_t_17); + __Pyx_ExceptionReset(__pyx_t_15, __pyx_t_16, __pyx_t_17); + } + __Pyx_XGIVEREF(__pyx_t_12); + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_ErrRestore(__pyx_t_12, __pyx_t_11, __pyx_t_10); + __pyx_t_12 = 0; __pyx_t_11 = 0; __pyx_t_10 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; + __pyx_lineno = __pyx_t_8; __pyx_clineno = __pyx_t_13; __pyx_filename = __pyx_t_14; + goto __pyx_L1_error; + __pyx_L20_error:; + if (PY_MAJOR_VERSION >= 3) { + __Pyx_XGIVEREF(__pyx_t_15); + __Pyx_XGIVEREF(__pyx_t_16); + __Pyx_XGIVEREF(__pyx_t_17); + __Pyx_ExceptionReset(__pyx_t_15, __pyx_t_16, __pyx_t_17); + } + __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; + goto __pyx_L1_error; + } + __pyx_L8:; + } + + /* "src/gevent/queue.py":606 + * return True + * + * def put(self, item, block=True, timeout=None): # <<<<<<<<<<<<<< + * if self.hub is getcurrent(): + * if self.getters: + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_AddTraceback("gevent._queue.Channel.put", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_getter); + __Pyx_XDECREF((PyObject *)__pyx_v_waiter); + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XDECREF(__pyx_v_item); + __Pyx_XDECREF(__pyx_v_timeout); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/queue.py":633 + * timeout.cancel() + * + * def put_nowait(self, item): # <<<<<<<<<<<<<< + * self.put(item, False) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_queue_7Channel_17put_nowait(PyObject *__pyx_v_self, PyObject *__pyx_v_item); /*proto*/ +static char __pyx_doc_6gevent_6_queue_7Channel_16put_nowait[] = "Channel.put_nowait(self, item)"; +static PyMethodDef __pyx_mdef_6gevent_6_queue_7Channel_17put_nowait = {"put_nowait", (PyCFunction)__pyx_pw_6gevent_6_queue_7Channel_17put_nowait, METH_O, __pyx_doc_6gevent_6_queue_7Channel_16put_nowait}; +static PyObject *__pyx_pw_6gevent_6_queue_7Channel_17put_nowait(PyObject *__pyx_v_self, PyObject *__pyx_v_item) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("put_nowait (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6_queue_7Channel_16put_nowait(((struct __pyx_obj_6gevent_6_queue_Channel *)__pyx_v_self), ((PyObject *)__pyx_v_item)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_queue_7Channel_16put_nowait(struct __pyx_obj_6gevent_6_queue_Channel *__pyx_v_self, PyObject *__pyx_v_item) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + __Pyx_RefNannySetupContext("put_nowait", 0); + + /* "src/gevent/queue.py":634 + * + * def put_nowait(self, item): + * self.put(item, False) # <<<<<<<<<<<<<< + * + * def get(self, block=True, timeout=None): + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_put_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 634, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + __pyx_t_4 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_4 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_item, Py_False}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 634, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_item, Py_False}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 634, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else + #endif + { + __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 634, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (__pyx_t_3) { + __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL; + } + __Pyx_INCREF(__pyx_v_item); + __Pyx_GIVEREF(__pyx_v_item); + PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_item); + __Pyx_INCREF(Py_False); + __Pyx_GIVEREF(Py_False); + PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, Py_False); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 634, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/queue.py":633 + * timeout.cancel() + * + * def put_nowait(self, item): # <<<<<<<<<<<<<< + * self.put(item, False) + * + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("gevent._queue.Channel.put_nowait", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/queue.py":636 + * self.put(item, False) + * + * def get(self, block=True, timeout=None): # <<<<<<<<<<<<<< + * if self.hub is getcurrent(): + * if self.putters: + */ + +static PyObject *__pyx_pw_6gevent_6_queue_7Channel_19get(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_6gevent_6_queue_7Channel_get(struct __pyx_obj_6gevent_6_queue_Channel *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_6_queue_7Channel_get *__pyx_optional_args) { + PyObject *__pyx_v_block = ((PyObject *)Py_True); + PyObject *__pyx_v_timeout = ((PyObject *)Py_None); + PyObject *__pyx_v_item = NULL; + PyObject *__pyx_v_putter = NULL; + struct __pyx_obj_6gevent_8__waiter_Waiter *__pyx_v_waiter = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + int __pyx_t_8; + PyObject *(*__pyx_t_9)(PyObject *); + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + int __pyx_t_13; + PyObject *__pyx_t_14 = NULL; + int __pyx_t_15; + char const *__pyx_t_16; + PyObject *__pyx_t_17 = NULL; + PyObject *__pyx_t_18 = NULL; + PyObject *__pyx_t_19 = NULL; + __Pyx_RefNannySetupContext("get", 0); + if (__pyx_optional_args) { + if (__pyx_optional_args->__pyx_n > 0) { + __pyx_v_block = __pyx_optional_args->block; + if (__pyx_optional_args->__pyx_n > 1) { + __pyx_v_timeout = __pyx_optional_args->timeout; + } + } + } + __Pyx_INCREF(__pyx_v_timeout); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0; + if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self)))))); + else { + PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + #endif + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 636, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_6_queue_7Channel_19get)) { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; + __pyx_t_5 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_5 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_3)) { + PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_block, __pyx_v_timeout}; + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 636, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GOTREF(__pyx_t_2); + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { + PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_block, __pyx_v_timeout}; + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 636, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GOTREF(__pyx_t_2); + } else + #endif + { + __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 636, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (__pyx_t_4) { + __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL; + } + __Pyx_INCREF(__pyx_v_block); + __Pyx_GIVEREF(__pyx_v_block); + PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_block); + __Pyx_INCREF(__pyx_v_timeout); + __Pyx_GIVEREF(__pyx_v_timeout); + PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_timeout); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 636, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0; + if (unlikely(type_dict_guard != tp_dict_version)) { + tp_dict_version = obj_dict_version = 0; + } + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + } + #endif + } + + /* "src/gevent/queue.py":637 + * + * def get(self, block=True, timeout=None): + * if self.hub is getcurrent(): # <<<<<<<<<<<<<< + * if self.putters: + * item, putter = self.putters.popleft() + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_getcurrent); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 637, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 637, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_7 = (__pyx_v_self->hub == __pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_8 = (__pyx_t_7 != 0); + if (__pyx_t_8) { + + /* "src/gevent/queue.py":638 + * def get(self, block=True, timeout=None): + * if self.hub is getcurrent(): + * if self.putters: # <<<<<<<<<<<<<< + * item, putter = self.putters.popleft() + * self.hub.loop.run_callback(putter.switch, putter) + */ + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_self->putters); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 638, __pyx_L1_error) + if (__pyx_t_8) { + + /* "src/gevent/queue.py":639 + * if self.hub is getcurrent(): + * if self.putters: + * item, putter = self.putters.popleft() # <<<<<<<<<<<<<< + * self.hub.loop.run_callback(putter.switch, putter) + * return item + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->putters, __pyx_n_s_popleft); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 639, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 639, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { + PyObject* sequence = __pyx_t_1; + Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + __PYX_ERR(0, 639, __pyx_L1_error) + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_2 = PyList_GET_ITEM(sequence, 0); + __pyx_t_3 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + #else + __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 639, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 639, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_6 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 639, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_9 = Py_TYPE(__pyx_t_6)->tp_iternext; + index = 0; __pyx_t_2 = __pyx_t_9(__pyx_t_6); if (unlikely(!__pyx_t_2)) goto __pyx_L5_unpacking_failed; + __Pyx_GOTREF(__pyx_t_2); + index = 1; __pyx_t_3 = __pyx_t_9(__pyx_t_6); if (unlikely(!__pyx_t_3)) goto __pyx_L5_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_6), 2) < 0) __PYX_ERR(0, 639, __pyx_L1_error) + __pyx_t_9 = NULL; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L6_unpacking_done; + __pyx_L5_unpacking_failed:; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_9 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + __PYX_ERR(0, 639, __pyx_L1_error) + __pyx_L6_unpacking_done:; + } + __pyx_v_item = __pyx_t_2; + __pyx_t_2 = 0; + __pyx_v_putter = __pyx_t_3; + __pyx_t_3 = 0; + + /* "src/gevent/queue.py":640 + * if self.putters: + * item, putter = self.putters.popleft() + * self.hub.loop.run_callback(putter.switch, putter) # <<<<<<<<<<<<<< + * return item + * + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->hub, __pyx_n_s_loop); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 640, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_run_callback); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 640, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_putter, __pyx_n_s_switch); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 640, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_6 = NULL; + __pyx_t_5 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_6)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_5 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_3, __pyx_v_putter}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 640, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_3, __pyx_v_putter}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 640, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } else + #endif + { + __pyx_t_4 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 640, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (__pyx_t_6) { + __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6); __pyx_t_6 = NULL; + } + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_5, __pyx_t_3); + __Pyx_INCREF(__pyx_v_putter); + __Pyx_GIVEREF(__pyx_v_putter); + PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_5, __pyx_v_putter); + __pyx_t_3 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 640, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/queue.py":641 + * item, putter = self.putters.popleft() + * self.hub.loop.run_callback(putter.switch, putter) + * return item # <<<<<<<<<<<<<< + * + * if not block: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_item); + __pyx_r = __pyx_v_item; + goto __pyx_L0; + + /* "src/gevent/queue.py":638 + * def get(self, block=True, timeout=None): + * if self.hub is getcurrent(): + * if self.putters: # <<<<<<<<<<<<<< + * item, putter = self.putters.popleft() + * self.hub.loop.run_callback(putter.switch, putter) + */ + } + + /* "src/gevent/queue.py":637 + * + * def get(self, block=True, timeout=None): + * if self.hub is getcurrent(): # <<<<<<<<<<<<<< + * if self.putters: + * item, putter = self.putters.popleft() + */ + } + + /* "src/gevent/queue.py":643 + * return item + * + * if not block: # <<<<<<<<<<<<<< + * timeout = 0 + * + */ + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_block); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 643, __pyx_L1_error) + __pyx_t_7 = ((!__pyx_t_8) != 0); + if (__pyx_t_7) { + + /* "src/gevent/queue.py":644 + * + * if not block: + * timeout = 0 # <<<<<<<<<<<<<< + * + * waiter = Waiter() # pylint:disable=undefined-variable + */ + __Pyx_INCREF(__pyx_int_0); + __Pyx_DECREF_SET(__pyx_v_timeout, __pyx_int_0); + + /* "src/gevent/queue.py":643 + * return item + * + * if not block: # <<<<<<<<<<<<<< + * timeout = 0 + * + */ + } + + /* "src/gevent/queue.py":646 + * timeout = 0 + * + * waiter = Waiter() # pylint:disable=undefined-variable # <<<<<<<<<<<<<< + * timeout = Timeout._start_new_or_dummy(timeout, Empty) + * try: + */ + __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_6gevent_8__waiter_Waiter)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 646, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_waiter = ((struct __pyx_obj_6gevent_8__waiter_Waiter *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "src/gevent/queue.py":647 + * + * waiter = Waiter() # pylint:disable=undefined-variable + * timeout = Timeout._start_new_or_dummy(timeout, Empty) # <<<<<<<<<<<<<< + * try: + * self.getters.append(waiter) + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Timeout); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 647, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_start_new_or_dummy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 647, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 647, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + __pyx_t_5 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + __pyx_t_5 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_4)) { + PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_timeout, __pyx_t_2}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 647, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { + PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_timeout, __pyx_t_2}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 647, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } else + #endif + { + __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 647, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (__pyx_t_3) { + __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); __pyx_t_3 = NULL; + } + __Pyx_INCREF(__pyx_v_timeout); + __Pyx_GIVEREF(__pyx_v_timeout); + PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_timeout); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 647, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF_SET(__pyx_v_timeout, __pyx_t_1); + __pyx_t_1 = 0; + + /* "src/gevent/queue.py":648 + * waiter = Waiter() # pylint:disable=undefined-variable + * timeout = Timeout._start_new_or_dummy(timeout, Empty) + * try: # <<<<<<<<<<<<<< + * self.getters.append(waiter) + * if self.putters: + */ + /*try:*/ { + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12); + __Pyx_XGOTREF(__pyx_t_10); + __Pyx_XGOTREF(__pyx_t_11); + __Pyx_XGOTREF(__pyx_t_12); + /*try:*/ { + + /* "src/gevent/queue.py":649 + * timeout = Timeout._start_new_or_dummy(timeout, Empty) + * try: + * self.getters.append(waiter) # <<<<<<<<<<<<<< + * if self.putters: + * self._schedule_unlock() + */ + __pyx_t_13 = __Pyx_PyObject_Append(__pyx_v_self->getters, ((PyObject *)__pyx_v_waiter)); if (unlikely(__pyx_t_13 == ((int)-1))) __PYX_ERR(0, 649, __pyx_L11_error) + + /* "src/gevent/queue.py":650 + * try: + * self.getters.append(waiter) + * if self.putters: # <<<<<<<<<<<<<< + * self._schedule_unlock() + * return waiter.get() + */ + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_self->putters); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 650, __pyx_L11_error) + if (__pyx_t_7) { + + /* "src/gevent/queue.py":651 + * self.getters.append(waiter) + * if self.putters: + * self._schedule_unlock() # <<<<<<<<<<<<<< + * return waiter.get() + * except: + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_6_queue_Channel *)__pyx_v_self->__pyx_vtab)->_schedule_unlock(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 651, __pyx_L11_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/queue.py":650 + * try: + * self.getters.append(waiter) + * if self.putters: # <<<<<<<<<<<<<< + * self._schedule_unlock() + * return waiter.get() + */ + } + + /* "src/gevent/queue.py":652 + * if self.putters: + * self._schedule_unlock() + * return waiter.get() # <<<<<<<<<<<<<< + * except: + * self.getters.remove(waiter) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_8__waiter_Waiter *)__pyx_v_waiter->__pyx_vtab)->get(__pyx_v_waiter, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 652, __pyx_L11_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L15_try_return; + + /* "src/gevent/queue.py":648 + * waiter = Waiter() # pylint:disable=undefined-variable + * timeout = Timeout._start_new_or_dummy(timeout, Empty) + * try: # <<<<<<<<<<<<<< + * self.getters.append(waiter) + * if self.putters: + */ + } + __pyx_L11_error:; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/queue.py":653 + * self._schedule_unlock() + * return waiter.get() + * except: # <<<<<<<<<<<<<< + * self.getters.remove(waiter) + * raise + */ + /*except:*/ { + __Pyx_AddTraceback("gevent._queue.Channel.get", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_4, &__pyx_t_6) < 0) __PYX_ERR(0, 653, __pyx_L13_except_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_6); + + /* "src/gevent/queue.py":654 + * return waiter.get() + * except: + * self.getters.remove(waiter) # <<<<<<<<<<<<<< + * raise + * finally: + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->getters, __pyx_n_s_remove); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 654, __pyx_L13_except_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_14 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_14)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_14); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_14) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_14, ((PyObject *)__pyx_v_waiter)) : __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_waiter)); + __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 654, __pyx_L13_except_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/queue.py":655 + * except: + * self.getters.remove(waiter) + * raise # <<<<<<<<<<<<<< + * finally: + * timeout.close() + */ + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_ErrRestoreWithState(__pyx_t_1, __pyx_t_4, __pyx_t_6); + __pyx_t_1 = 0; __pyx_t_4 = 0; __pyx_t_6 = 0; + __PYX_ERR(0, 655, __pyx_L13_except_error) + } + __pyx_L13_except_error:; + + /* "src/gevent/queue.py":648 + * waiter = Waiter() # pylint:disable=undefined-variable + * timeout = Timeout._start_new_or_dummy(timeout, Empty) + * try: # <<<<<<<<<<<<<< + * self.getters.append(waiter) + * if self.putters: + */ + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_XGIVEREF(__pyx_t_12); + __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12); + goto __pyx_L9_error; + __pyx_L15_try_return:; + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_XGIVEREF(__pyx_t_12); + __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12); + goto __pyx_L8_return; + } + } + + /* "src/gevent/queue.py":657 + * raise + * finally: + * timeout.close() # <<<<<<<<<<<<<< + * + * def get_nowait(self): + */ + /*finally:*/ { + __pyx_L9_error:; + /*exception exit:*/{ + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __pyx_t_12 = 0; __pyx_t_11 = 0; __pyx_t_10 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; + __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19); + if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_12, &__pyx_t_11, &__pyx_t_10) < 0)) __Pyx_ErrFetch(&__pyx_t_12, &__pyx_t_11, &__pyx_t_10); + __Pyx_XGOTREF(__pyx_t_12); + __Pyx_XGOTREF(__pyx_t_11); + __Pyx_XGOTREF(__pyx_t_10); + __Pyx_XGOTREF(__pyx_t_17); + __Pyx_XGOTREF(__pyx_t_18); + __Pyx_XGOTREF(__pyx_t_19); + __pyx_t_5 = __pyx_lineno; __pyx_t_15 = __pyx_clineno; __pyx_t_16 = __pyx_filename; + { + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_timeout, __pyx_n_s_close); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 657, __pyx_L21_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_1)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_1); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + } + } + __pyx_t_6 = (__pyx_t_1) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_1) : __Pyx_PyObject_CallNoArg(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 657, __pyx_L21_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + if (PY_MAJOR_VERSION >= 3) { + __Pyx_XGIVEREF(__pyx_t_17); + __Pyx_XGIVEREF(__pyx_t_18); + __Pyx_XGIVEREF(__pyx_t_19); + __Pyx_ExceptionReset(__pyx_t_17, __pyx_t_18, __pyx_t_19); + } + __Pyx_XGIVEREF(__pyx_t_12); + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_ErrRestore(__pyx_t_12, __pyx_t_11, __pyx_t_10); + __pyx_t_12 = 0; __pyx_t_11 = 0; __pyx_t_10 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; + __pyx_lineno = __pyx_t_5; __pyx_clineno = __pyx_t_15; __pyx_filename = __pyx_t_16; + goto __pyx_L1_error; + __pyx_L21_error:; + if (PY_MAJOR_VERSION >= 3) { + __Pyx_XGIVEREF(__pyx_t_17); + __Pyx_XGIVEREF(__pyx_t_18); + __Pyx_XGIVEREF(__pyx_t_19); + __Pyx_ExceptionReset(__pyx_t_17, __pyx_t_18, __pyx_t_19); + } + __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; + goto __pyx_L1_error; + } + __pyx_L8_return: { + __pyx_t_19 = __pyx_r; + __pyx_r = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_timeout, __pyx_n_s_close); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 657, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_1)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_1); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + } + } + __pyx_t_6 = (__pyx_t_1) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_1) : __Pyx_PyObject_CallNoArg(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 657, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_r = __pyx_t_19; + __pyx_t_19 = 0; + goto __pyx_L0; + } + } + + /* "src/gevent/queue.py":636 + * self.put(item, False) + * + * def get(self, block=True, timeout=None): # <<<<<<<<<<<<<< + * if self.hub is getcurrent(): + * if self.putters: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_14); + __Pyx_AddTraceback("gevent._queue.Channel.get", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_item); + __Pyx_XDECREF(__pyx_v_putter); + __Pyx_XDECREF((PyObject *)__pyx_v_waiter); + __Pyx_XDECREF(__pyx_v_timeout); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_queue_7Channel_19get(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6gevent_6_queue_7Channel_18get[] = "Channel.get(self, block=True, timeout=None)"; +static PyMethodDef __pyx_mdef_6gevent_6_queue_7Channel_19get = {"get", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_6_queue_7Channel_19get, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_6_queue_7Channel_18get}; +static PyObject *__pyx_pw_6gevent_6_queue_7Channel_19get(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_block = 0; + PyObject *__pyx_v_timeout = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_block,&__pyx_n_s_timeout,0}; + PyObject* values[2] = {0,0}; + values[0] = ((PyObject *)Py_True); + values[1] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_block); + if (value) { values[0] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 1: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_timeout); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get") < 0)) __PYX_ERR(0, 636, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_block = values[0]; + __pyx_v_timeout = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("get", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 636, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent._queue.Channel.get", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_6_queue_7Channel_18get(((struct __pyx_obj_6gevent_6_queue_Channel *)__pyx_v_self), __pyx_v_block, __pyx_v_timeout); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_queue_7Channel_18get(struct __pyx_obj_6gevent_6_queue_Channel *__pyx_v_self, PyObject *__pyx_v_block, PyObject *__pyx_v_timeout) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + struct __pyx_opt_args_6gevent_6_queue_7Channel_get __pyx_t_2; + __Pyx_RefNannySetupContext("get", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_2.__pyx_n = 2; + __pyx_t_2.block = __pyx_v_block; + __pyx_t_2.timeout = __pyx_v_timeout; + __pyx_t_1 = __pyx_vtabptr_6gevent_6_queue_Channel->get(__pyx_v_self, 1, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 636, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent._queue.Channel.get", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/queue.py":659 + * timeout.close() + * + * def get_nowait(self): # <<<<<<<<<<<<<< + * return self.get(False) + * + */ + +static PyObject *__pyx_pw_6gevent_6_queue_7Channel_21get_nowait(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_f_6gevent_6_queue_7Channel_get_nowait(struct __pyx_obj_6gevent_6_queue_Channel *__pyx_v_self, int __pyx_skip_dispatch) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + struct __pyx_opt_args_6gevent_6_queue_7Channel_get __pyx_t_5; + __Pyx_RefNannySetupContext("get_nowait", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0; + if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self)))))); + else { + PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + #endif + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_nowait); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 659, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_6_queue_7Channel_21get_nowait)) { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 659, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0; + if (unlikely(type_dict_guard != tp_dict_version)) { + tp_dict_version = obj_dict_version = 0; + } + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + } + #endif + } + + /* "src/gevent/queue.py":660 + * + * def get_nowait(self): + * return self.get(False) # <<<<<<<<<<<<<< + * + * def _unlock(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_5.__pyx_n = 1; + __pyx_t_5.block = Py_False; + __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_6_queue_Channel *)__pyx_v_self->__pyx_vtab)->get(__pyx_v_self, 0, &__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 660, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "src/gevent/queue.py":659 + * timeout.close() + * + * def get_nowait(self): # <<<<<<<<<<<<<< + * return self.get(False) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("gevent._queue.Channel.get_nowait", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_queue_7Channel_21get_nowait(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6gevent_6_queue_7Channel_20get_nowait[] = "Channel.get_nowait(self)"; +static PyMethodDef __pyx_mdef_6gevent_6_queue_7Channel_21get_nowait = {"get_nowait", (PyCFunction)__pyx_pw_6gevent_6_queue_7Channel_21get_nowait, METH_NOARGS, __pyx_doc_6gevent_6_queue_7Channel_20get_nowait}; +static PyObject *__pyx_pw_6gevent_6_queue_7Channel_21get_nowait(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get_nowait (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6_queue_7Channel_20get_nowait(((struct __pyx_obj_6gevent_6_queue_Channel *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_queue_7Channel_20get_nowait(struct __pyx_obj_6gevent_6_queue_Channel *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("get_nowait", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6gevent_6_queue_7Channel_get_nowait(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 659, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent._queue.Channel.get_nowait", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/queue.py":662 + * return self.get(False) + * + * def _unlock(self): # <<<<<<<<<<<<<< + * while self.putters and self.getters: + * getter = self.getters.popleft() + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_queue_7Channel_23_unlock(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6gevent_6_queue_7Channel_22_unlock[] = "Channel._unlock(self)"; +static PyMethodDef __pyx_mdef_6gevent_6_queue_7Channel_23_unlock = {"_unlock", (PyCFunction)__pyx_pw_6gevent_6_queue_7Channel_23_unlock, METH_NOARGS, __pyx_doc_6gevent_6_queue_7Channel_22_unlock}; +static PyObject *__pyx_pw_6gevent_6_queue_7Channel_23_unlock(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_unlock (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6_queue_7Channel_22_unlock(((struct __pyx_obj_6gevent_6_queue_Channel *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_queue_7Channel_22_unlock(struct __pyx_obj_6gevent_6_queue_Channel *__pyx_v_self) { + PyObject *__pyx_v_getter = NULL; + PyObject *__pyx_v_item = NULL; + PyObject *__pyx_v_putter = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *(*__pyx_t_7)(PyObject *); + __Pyx_RefNannySetupContext("_unlock", 0); + + /* "src/gevent/queue.py":663 + * + * def _unlock(self): + * while self.putters and self.getters: # <<<<<<<<<<<<<< + * getter = self.getters.popleft() + * item, putter = self.putters.popleft() + */ + while (1) { + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_self->putters); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 663, __pyx_L1_error) + if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L5_bool_binop_done; + } + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_self->getters); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 663, __pyx_L1_error) + __pyx_t_1 = __pyx_t_2; + __pyx_L5_bool_binop_done:; + if (!__pyx_t_1) break; + + /* "src/gevent/queue.py":664 + * def _unlock(self): + * while self.putters and self.getters: + * getter = self.getters.popleft() # <<<<<<<<<<<<<< + * item, putter = self.putters.popleft() + * getter.switch(item) + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->getters, __pyx_n_s_popleft); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 664, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + } + } + __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 664, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF_SET(__pyx_v_getter, __pyx_t_3); + __pyx_t_3 = 0; + + /* "src/gevent/queue.py":665 + * while self.putters and self.getters: + * getter = self.getters.popleft() + * item, putter = self.putters.popleft() # <<<<<<<<<<<<<< + * getter.switch(item) + * putter.switch(putter) + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->putters, __pyx_n_s_popleft); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 665, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + } + } + __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 665, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) { + PyObject* sequence = __pyx_t_3; + Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + __PYX_ERR(0, 665, __pyx_L1_error) + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_4 = PyList_GET_ITEM(sequence, 0); + __pyx_t_5 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + #else + __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 665, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 665, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + #endif + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_6 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 665, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_7 = Py_TYPE(__pyx_t_6)->tp_iternext; + index = 0; __pyx_t_4 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_4)) goto __pyx_L7_unpacking_failed; + __Pyx_GOTREF(__pyx_t_4); + index = 1; __pyx_t_5 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_5)) goto __pyx_L7_unpacking_failed; + __Pyx_GOTREF(__pyx_t_5); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 2) < 0) __PYX_ERR(0, 665, __pyx_L1_error) + __pyx_t_7 = NULL; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L8_unpacking_done; + __pyx_L7_unpacking_failed:; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_7 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + __PYX_ERR(0, 665, __pyx_L1_error) + __pyx_L8_unpacking_done:; + } + __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_4); + __pyx_t_4 = 0; + __Pyx_XDECREF_SET(__pyx_v_putter, __pyx_t_5); + __pyx_t_5 = 0; + + /* "src/gevent/queue.py":666 + * getter = self.getters.popleft() + * item, putter = self.putters.popleft() + * getter.switch(item) # <<<<<<<<<<<<<< + * putter.switch(putter) + * + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_getter, __pyx_n_s_switch); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 666, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_5, function); + } + } + __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_4, __pyx_v_item) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_item); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 666, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "src/gevent/queue.py":667 + * item, putter = self.putters.popleft() + * getter.switch(item) + * putter.switch(putter) # <<<<<<<<<<<<<< + * + * def _schedule_unlock(self): + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_putter, __pyx_n_s_switch); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 667, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_5, function); + } + } + __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_4, __pyx_v_putter) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_putter); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 667, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + + /* "src/gevent/queue.py":662 + * return self.get(False) + * + * def _unlock(self): # <<<<<<<<<<<<<< + * while self.putters and self.getters: + * getter = self.getters.popleft() + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("gevent._queue.Channel._unlock", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_getter); + __Pyx_XDECREF(__pyx_v_item); + __Pyx_XDECREF(__pyx_v_putter); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/queue.py":669 + * putter.switch(putter) + * + * def _schedule_unlock(self): # <<<<<<<<<<<<<< + * if not self._event_unlock: + * self._event_unlock = self.hub.loop.run_callback(self._unlock) + */ + +static PyObject *__pyx_f_6gevent_6_queue_7Channel__schedule_unlock(struct __pyx_obj_6gevent_6_queue_Channel *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + __Pyx_RefNannySetupContext("_schedule_unlock", 0); + + /* "src/gevent/queue.py":670 + * + * def _schedule_unlock(self): + * if not self._event_unlock: # <<<<<<<<<<<<<< + * self._event_unlock = self.hub.loop.run_callback(self._unlock) + * + */ + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_self->_event_unlock); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 670, __pyx_L1_error) + __pyx_t_2 = ((!__pyx_t_1) != 0); + if (__pyx_t_2) { + + /* "src/gevent/queue.py":671 + * def _schedule_unlock(self): + * if not self._event_unlock: + * self._event_unlock = self.hub.loop.run_callback(self._unlock) # <<<<<<<<<<<<<< + * + * def __iter__(self): + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->hub, __pyx_n_s_loop); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 671, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_run_callback); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 671, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_unlock); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 671, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); + if (likely(__pyx_t_6)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_5, function); + } + } + __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4); + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 671, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GIVEREF(__pyx_t_3); + __Pyx_GOTREF(__pyx_v_self->_event_unlock); + __Pyx_DECREF(__pyx_v_self->_event_unlock); + __pyx_v_self->_event_unlock = __pyx_t_3; + __pyx_t_3 = 0; + + /* "src/gevent/queue.py":670 + * + * def _schedule_unlock(self): + * if not self._event_unlock: # <<<<<<<<<<<<<< + * self._event_unlock = self.hub.loop.run_callback(self._unlock) + * + */ + } + + /* "src/gevent/queue.py":669 + * putter.switch(putter) + * + * def _schedule_unlock(self): # <<<<<<<<<<<<<< + * if not self._event_unlock: + * self._event_unlock = self.hub.loop.run_callback(self._unlock) + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("gevent._queue.Channel._schedule_unlock", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/queue.py":673 + * self._event_unlock = self.hub.loop.run_callback(self._unlock) + * + * def __iter__(self): # <<<<<<<<<<<<<< + * return self + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_queue_7Channel_25__iter__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_6_queue_7Channel_25__iter__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6_queue_7Channel_24__iter__(((struct __pyx_obj_6gevent_6_queue_Channel *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_queue_7Channel_24__iter__(struct __pyx_obj_6gevent_6_queue_Channel *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__iter__", 0); + + /* "src/gevent/queue.py":674 + * + * def __iter__(self): + * return self # <<<<<<<<<<<<<< + * + * def __next__(self): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __pyx_r = ((PyObject *)__pyx_v_self); + goto __pyx_L0; + + /* "src/gevent/queue.py":673 + * self._event_unlock = self.hub.loop.run_callback(self._unlock) + * + * def __iter__(self): # <<<<<<<<<<<<<< + * return self + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/queue.py":676 + * return self + * + * def __next__(self): # <<<<<<<<<<<<<< + * result = self.get() + * if result is StopIteration: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_queue_7Channel_27__next__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_6_queue_7Channel_27__next__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__next__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6_queue_7Channel_26__next__(((struct __pyx_obj_6gevent_6_queue_Channel *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_queue_7Channel_26__next__(struct __pyx_obj_6gevent_6_queue_Channel *__pyx_v_self) { + PyObject *__pyx_v_result = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + __Pyx_RefNannySetupContext("__next__", 0); + + /* "src/gevent/queue.py":677 + * + * def __next__(self): + * result = self.get() # <<<<<<<<<<<<<< + * if result is StopIteration: + * raise result + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_6_queue_Channel *)__pyx_v_self->__pyx_vtab)->get(__pyx_v_self, 0, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 677, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_result = __pyx_t_1; + __pyx_t_1 = 0; + + /* "src/gevent/queue.py":678 + * def __next__(self): + * result = self.get() + * if result is StopIteration: # <<<<<<<<<<<<<< + * raise result + * return result + */ + __pyx_t_2 = (__pyx_v_result == __pyx_builtin_StopIteration); + __pyx_t_3 = (__pyx_t_2 != 0); + if (unlikely(__pyx_t_3)) { + + /* "src/gevent/queue.py":679 + * result = self.get() + * if result is StopIteration: + * raise result # <<<<<<<<<<<<<< + * return result + * + */ + __Pyx_Raise(__pyx_v_result, 0, 0, 0); + __PYX_ERR(0, 679, __pyx_L1_error) + + /* "src/gevent/queue.py":678 + * def __next__(self): + * result = self.get() + * if result is StopIteration: # <<<<<<<<<<<<<< + * raise result + * return result + */ + } + + /* "src/gevent/queue.py":680 + * if result is StopIteration: + * raise result + * return result # <<<<<<<<<<<<<< + * + * next = __next__ # Py2 + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; + goto __pyx_L0; + + /* "src/gevent/queue.py":676 + * return self + * + * def __next__(self): # <<<<<<<<<<<<<< + * result = self.get() + * if result is StopIteration: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent._queue.Channel.__next__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/_queue.pxd":66 + * cdef class Channel: + * cdef __weakref__ + * cdef readonly getters # <<<<<<<<<<<<<< + * cdef readonly putters + * cdef readonly hub + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_queue_7Channel_7getters_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_6_queue_7Channel_7getters_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6_queue_7Channel_7getters___get__(((struct __pyx_obj_6gevent_6_queue_Channel *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_queue_7Channel_7getters___get__(struct __pyx_obj_6gevent_6_queue_Channel *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->getters); + __pyx_r = __pyx_v_self->getters; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/_queue.pxd":67 + * cdef __weakref__ + * cdef readonly getters + * cdef readonly putters # <<<<<<<<<<<<<< + * cdef readonly hub + * cdef _event_unlock + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_queue_7Channel_7putters_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_6_queue_7Channel_7putters_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6_queue_7Channel_7putters___get__(((struct __pyx_obj_6gevent_6_queue_Channel *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_queue_7Channel_7putters___get__(struct __pyx_obj_6gevent_6_queue_Channel *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->putters); + __pyx_r = __pyx_v_self->putters; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/_queue.pxd":68 + * cdef readonly getters + * cdef readonly putters + * cdef readonly hub # <<<<<<<<<<<<<< + * cdef _event_unlock + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_queue_7Channel_3hub_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_6_queue_7Channel_3hub_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6_queue_7Channel_3hub___get__(((struct __pyx_obj_6gevent_6_queue_Channel *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_queue_7Channel_3hub___get__(struct __pyx_obj_6gevent_6_queue_Channel *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->hub); + __pyx_r = __pyx_v_self->hub; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/__greenlet_primitives.pxd":23 + * + * @cython.final + * cdef inline greenlet getcurrent(): # <<<<<<<<<<<<<< + * return PyGreenlet_GetCurrent() + * + */ + +static CYTHON_INLINE PyGreenlet *__pyx_f_6gevent_21__greenlet_primitives_getcurrent(void) { + PyGreenlet *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("getcurrent", 0); + + /* "gevent/__greenlet_primitives.pxd":24 + * @cython.final + * cdef inline greenlet getcurrent(): + * return PyGreenlet_GetCurrent() # <<<<<<<<<<<<<< + * + * cdef bint _greenlet_imported + */ + __Pyx_XDECREF(((PyObject *)__pyx_r)); + __pyx_t_1 = ((PyObject *)PyGreenlet_GetCurrent()); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 24, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = ((PyGreenlet *)__pyx_t_1); + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "gevent/__greenlet_primitives.pxd":23 + * + * @cython.final + * cdef inline greenlet getcurrent(): # <<<<<<<<<<<<<< + * return PyGreenlet_GetCurrent() + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__greenlet_primitives.getcurrent", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF((PyObject *)__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/__greenlet_primitives.pxd":28 + * cdef bint _greenlet_imported + * + * cdef inline void greenlet_init(): # <<<<<<<<<<<<<< + * global _greenlet_imported + * if not _greenlet_imported: + */ + +static CYTHON_INLINE void __pyx_f_6gevent_21__greenlet_primitives_greenlet_init(void) { + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("greenlet_init", 0); + + /* "gevent/__greenlet_primitives.pxd":30 + * cdef inline void greenlet_init(): + * global _greenlet_imported + * if not _greenlet_imported: # <<<<<<<<<<<<<< + * PyGreenlet_Import() + * _greenlet_imported = True + */ + __pyx_t_1 = ((!(__pyx_v_6gevent_21__greenlet_primitives__greenlet_imported != 0)) != 0); + if (__pyx_t_1) { + + /* "gevent/__greenlet_primitives.pxd":31 + * global _greenlet_imported + * if not _greenlet_imported: + * PyGreenlet_Import() # <<<<<<<<<<<<<< + * _greenlet_imported = True + * + */ + PyGreenlet_Import(); + + /* "gevent/__greenlet_primitives.pxd":32 + * if not _greenlet_imported: + * PyGreenlet_Import() + * _greenlet_imported = True # <<<<<<<<<<<<<< + * + * cdef inline object _greenlet_switch(greenlet self): + */ + __pyx_v_6gevent_21__greenlet_primitives__greenlet_imported = 1; + + /* "gevent/__greenlet_primitives.pxd":30 + * cdef inline void greenlet_init(): + * global _greenlet_imported + * if not _greenlet_imported: # <<<<<<<<<<<<<< + * PyGreenlet_Import() + * _greenlet_imported = True + */ + } + + /* "gevent/__greenlet_primitives.pxd":28 + * cdef bint _greenlet_imported + * + * cdef inline void greenlet_init(): # <<<<<<<<<<<<<< + * global _greenlet_imported + * if not _greenlet_imported: + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "gevent/__greenlet_primitives.pxd":34 + * _greenlet_imported = True + * + * cdef inline object _greenlet_switch(greenlet self): # <<<<<<<<<<<<<< + * return PyGreenlet_Switch(self, NULL, NULL) + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_6gevent_21__greenlet_primitives__greenlet_switch(PyGreenlet *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("_greenlet_switch", 0); + + /* "gevent/__greenlet_primitives.pxd":35 + * + * cdef inline object _greenlet_switch(greenlet self): + * return PyGreenlet_Switch(self, NULL, NULL) # <<<<<<<<<<<<<< + * + * cdef class TrackedRawGreenlet(greenlet): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyGreenlet_Switch(__pyx_v_self, NULL, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 35, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "gevent/__greenlet_primitives.pxd":34 + * _greenlet_imported = True + * + * cdef inline object _greenlet_switch(greenlet self): # <<<<<<<<<<<<<< + * return PyGreenlet_Switch(self, NULL, NULL) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__greenlet_primitives._greenlet_switch", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/__waiter.pxd":24 + * void PyGreenlet_Import() + * + * cdef inline greenlet getcurrent(): # <<<<<<<<<<<<<< + * return PyGreenlet_GetCurrent() + * + */ + +static CYTHON_INLINE PyGreenlet *__pyx_f_6gevent_8__waiter_getcurrent(void) { + PyGreenlet *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("getcurrent", 0); + + /* "gevent/__waiter.pxd":25 + * + * cdef inline greenlet getcurrent(): + * return PyGreenlet_GetCurrent() # <<<<<<<<<<<<<< + * + * cdef inline void greenlet_init(): + */ + __Pyx_XDECREF(((PyObject *)__pyx_r)); + __pyx_t_1 = ((PyObject *)PyGreenlet_GetCurrent()); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 25, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = ((PyGreenlet *)__pyx_t_1); + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "gevent/__waiter.pxd":24 + * void PyGreenlet_Import() + * + * cdef inline greenlet getcurrent(): # <<<<<<<<<<<<<< + * return PyGreenlet_GetCurrent() + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__waiter.getcurrent", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF((PyObject *)__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/__waiter.pxd":27 + * return PyGreenlet_GetCurrent() + * + * cdef inline void greenlet_init(): # <<<<<<<<<<<<<< + * global _greenlet_imported + * if not _greenlet_imported: + */ + +static CYTHON_INLINE void __pyx_f_6gevent_8__waiter_greenlet_init(void) { + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("greenlet_init", 0); + + /* "gevent/__waiter.pxd":29 + * cdef inline void greenlet_init(): + * global _greenlet_imported + * if not _greenlet_imported: # <<<<<<<<<<<<<< + * PyGreenlet_Import() + * _greenlet_imported = True + */ + __pyx_t_1 = ((!(__pyx_v_6gevent_8__waiter__greenlet_imported != 0)) != 0); + if (__pyx_t_1) { + + /* "gevent/__waiter.pxd":30 + * global _greenlet_imported + * if not _greenlet_imported: + * PyGreenlet_Import() # <<<<<<<<<<<<<< + * _greenlet_imported = True + * + */ + PyGreenlet_Import(); + + /* "gevent/__waiter.pxd":31 + * if not _greenlet_imported: + * PyGreenlet_Import() + * _greenlet_imported = True # <<<<<<<<<<<<<< + * + * cdef class Waiter: + */ + __pyx_v_6gevent_8__waiter__greenlet_imported = 1; + + /* "gevent/__waiter.pxd":29 + * cdef inline void greenlet_init(): + * global _greenlet_imported + * if not _greenlet_imported: # <<<<<<<<<<<<<< + * PyGreenlet_Import() + * _greenlet_imported = True + */ + } + + /* "gevent/__waiter.pxd":27 + * return PyGreenlet_GetCurrent() + * + * cdef inline void greenlet_init(): # <<<<<<<<<<<<<< + * global _greenlet_imported + * if not _greenlet_imported: + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "gevent/__abstract_linkable.pxd":21 + * void PyGreenlet_Import() + * + * cdef inline greenlet getcurrent(): # <<<<<<<<<<<<<< + * return PyGreenlet_GetCurrent() + * + */ + +static CYTHON_INLINE PyGreenlet *__pyx_f_6gevent_19__abstract_linkable_getcurrent(void) { + PyGreenlet *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("getcurrent", 0); + + /* "gevent/__abstract_linkable.pxd":22 + * + * cdef inline greenlet getcurrent(): + * return PyGreenlet_GetCurrent() # <<<<<<<<<<<<<< + * + * cdef inline void greenlet_init(): + */ + __Pyx_XDECREF(((PyObject *)__pyx_r)); + __pyx_t_1 = ((PyObject *)PyGreenlet_GetCurrent()); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 22, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = ((PyGreenlet *)__pyx_t_1); + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "gevent/__abstract_linkable.pxd":21 + * void PyGreenlet_Import() + * + * cdef inline greenlet getcurrent(): # <<<<<<<<<<<<<< + * return PyGreenlet_GetCurrent() + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__abstract_linkable.getcurrent", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF((PyObject *)__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/__abstract_linkable.pxd":24 + * return PyGreenlet_GetCurrent() + * + * cdef inline void greenlet_init(): # <<<<<<<<<<<<<< + * global _greenlet_imported + * if not _greenlet_imported: + */ + +static CYTHON_INLINE void __pyx_f_6gevent_19__abstract_linkable_greenlet_init(void) { + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("greenlet_init", 0); + + /* "gevent/__abstract_linkable.pxd":26 + * cdef inline void greenlet_init(): + * global _greenlet_imported + * if not _greenlet_imported: # <<<<<<<<<<<<<< + * PyGreenlet_Import() + * _greenlet_imported = True + */ + __pyx_t_1 = ((!(__pyx_v_6gevent_19__abstract_linkable__greenlet_imported != 0)) != 0); + if (__pyx_t_1) { + + /* "gevent/__abstract_linkable.pxd":27 + * global _greenlet_imported + * if not _greenlet_imported: + * PyGreenlet_Import() # <<<<<<<<<<<<<< + * _greenlet_imported = True + * + */ + PyGreenlet_Import(); + + /* "gevent/__abstract_linkable.pxd":28 + * if not _greenlet_imported: + * PyGreenlet_Import() + * _greenlet_imported = True # <<<<<<<<<<<<<< + * + * cdef void _init() + */ + __pyx_v_6gevent_19__abstract_linkable__greenlet_imported = 1; + + /* "gevent/__abstract_linkable.pxd":26 + * cdef inline void greenlet_init(): + * global _greenlet_imported + * if not _greenlet_imported: # <<<<<<<<<<<<<< + * PyGreenlet_Import() + * _greenlet_imported = True + */ + } + + /* "gevent/__abstract_linkable.pxd":24 + * return PyGreenlet_GetCurrent() + * + * cdef inline void greenlet_init(): # <<<<<<<<<<<<<< + * global _greenlet_imported + * if not _greenlet_imported: + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} +static struct __pyx_vtabstruct_6gevent_6_queue_ItemWaiter __pyx_vtable_6gevent_6_queue_ItemWaiter; + +static PyObject *__pyx_tp_new_6gevent_6_queue_ItemWaiter(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_6gevent_6_queue_ItemWaiter *p; + PyObject *o = __pyx_ptype_6gevent_8__waiter_Waiter->tp_new(t, a, k); + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_6gevent_6_queue_ItemWaiter *)o); + p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_6gevent_8__waiter_Waiter*)__pyx_vtabptr_6gevent_6_queue_ItemWaiter; + p->item = Py_None; Py_INCREF(Py_None); + p->queue = Py_None; Py_INCREF(Py_None); + return o; +} + +static void __pyx_tp_dealloc_6gevent_6_queue_ItemWaiter(PyObject *o) { + struct __pyx_obj_6gevent_6_queue_ItemWaiter *p = (struct __pyx_obj_6gevent_6_queue_ItemWaiter *)o; + PyObject_GC_UnTrack(o); + Py_CLEAR(p->item); + Py_CLEAR(p->queue); + PyObject_GC_Track(o); + if (likely(__pyx_ptype_6gevent_8__waiter_Waiter)) __pyx_ptype_6gevent_8__waiter_Waiter->tp_dealloc(o); else __Pyx_call_next_tp_dealloc(o, __pyx_tp_dealloc_6gevent_6_queue_ItemWaiter); +} + +static int __pyx_tp_traverse_6gevent_6_queue_ItemWaiter(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_6gevent_6_queue_ItemWaiter *p = (struct __pyx_obj_6gevent_6_queue_ItemWaiter *)o; + e = ((likely(__pyx_ptype_6gevent_8__waiter_Waiter)) ? ((__pyx_ptype_6gevent_8__waiter_Waiter->tp_traverse) ? __pyx_ptype_6gevent_8__waiter_Waiter->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_6gevent_6_queue_ItemWaiter)); if (e) return e; + if (p->item) { + e = (*v)(p->item, a); if (e) return e; + } + if (p->queue) { + e = (*v)(p->queue, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_6gevent_6_queue_ItemWaiter(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_6gevent_6_queue_ItemWaiter *p = (struct __pyx_obj_6gevent_6_queue_ItemWaiter *)o; + if (likely(__pyx_ptype_6gevent_8__waiter_Waiter)) { if (__pyx_ptype_6gevent_8__waiter_Waiter->tp_clear) __pyx_ptype_6gevent_8__waiter_Waiter->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_6gevent_6_queue_ItemWaiter); + tmp = ((PyObject*)p->item); + p->item = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->queue); + p->queue = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyObject *__pyx_getprop_6gevent_6_queue_10ItemWaiter_item(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_6_queue_10ItemWaiter_4item_1__get__(o); +} + +static PyObject *__pyx_getprop_6gevent_6_queue_10ItemWaiter_queue(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_6_queue_10ItemWaiter_5queue_1__get__(o); +} + +static PyMethodDef __pyx_methods_6gevent_6_queue_ItemWaiter[] = { + {"put_and_switch", (PyCFunction)__pyx_pw_6gevent_6_queue_10ItemWaiter_3put_and_switch, METH_NOARGS, __pyx_doc_6gevent_6_queue_10ItemWaiter_2put_and_switch}, + {0, 0, 0, 0} +}; + +static struct PyGetSetDef __pyx_getsets_6gevent_6_queue_ItemWaiter[] = { + {(char *)"item", __pyx_getprop_6gevent_6_queue_10ItemWaiter_item, 0, (char *)0, 0}, + {(char *)"queue", __pyx_getprop_6gevent_6_queue_10ItemWaiter_queue, 0, (char *)0, 0}, + {0, 0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_6gevent_6_queue_ItemWaiter = { + PyVarObject_HEAD_INIT(0, 0) + "gevent._queue.ItemWaiter", /*tp_name*/ + sizeof(struct __pyx_obj_6gevent_6_queue_ItemWaiter), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6gevent_6_queue_ItemWaiter, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + "ItemWaiter(item, queue)", /*tp_doc*/ + __pyx_tp_traverse_6gevent_6_queue_ItemWaiter, /*tp_traverse*/ + __pyx_tp_clear_6gevent_6_queue_ItemWaiter, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6gevent_6_queue_ItemWaiter, /*tp_methods*/ + 0, /*tp_members*/ + __pyx_getsets_6gevent_6_queue_ItemWaiter, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_pw_6gevent_6_queue_10ItemWaiter_1__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6gevent_6_queue_ItemWaiter, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; +static struct __pyx_vtabstruct_6gevent_6_queue_Queue __pyx_vtable_6gevent_6_queue_Queue; + +static PyObject *__pyx_tp_new_6gevent_6_queue_Queue(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + struct __pyx_obj_6gevent_6_queue_Queue *p; + PyObject *o; + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_6gevent_6_queue_Queue *)o); + p->__pyx_vtab = __pyx_vtabptr_6gevent_6_queue_Queue; + p->hub = Py_None; Py_INCREF(Py_None); + p->queue = Py_None; Py_INCREF(Py_None); + p->getters = Py_None; Py_INCREF(Py_None); + p->putters = Py_None; Py_INCREF(Py_None); + p->_event_unlock = Py_None; Py_INCREF(Py_None); + return o; +} + +static void __pyx_tp_dealloc_6gevent_6_queue_Queue(PyObject *o) { + struct __pyx_obj_6gevent_6_queue_Queue *p = (struct __pyx_obj_6gevent_6_queue_Queue *)o; + #if CYTHON_USE_TP_FINALIZE + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + PyObject_GC_UnTrack(o); + if (p->__weakref__) PyObject_ClearWeakRefs(o); + Py_CLEAR(p->hub); + Py_CLEAR(p->queue); + Py_CLEAR(p->getters); + Py_CLEAR(p->putters); + Py_CLEAR(p->_event_unlock); + (*Py_TYPE(o)->tp_free)(o); +} + +static int __pyx_tp_traverse_6gevent_6_queue_Queue(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_6gevent_6_queue_Queue *p = (struct __pyx_obj_6gevent_6_queue_Queue *)o; + if (p->hub) { + e = (*v)(p->hub, a); if (e) return e; + } + if (p->queue) { + e = (*v)(p->queue, a); if (e) return e; + } + if (p->getters) { + e = (*v)(p->getters, a); if (e) return e; + } + if (p->putters) { + e = (*v)(p->putters, a); if (e) return e; + } + if (p->_event_unlock) { + e = (*v)(p->_event_unlock, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_6gevent_6_queue_Queue(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_6gevent_6_queue_Queue *p = (struct __pyx_obj_6gevent_6_queue_Queue *)o; + tmp = ((PyObject*)p->hub); + p->hub = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->queue); + p->queue = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->getters); + p->getters = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->putters); + p->putters = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->_event_unlock); + p->_event_unlock = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyObject *__pyx_getprop_6gevent_6_queue_5Queue_maxsize(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_6_queue_5Queue_7maxsize_1__get__(o); +} + +static int __pyx_setprop_6gevent_6_queue_5Queue_maxsize(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6gevent_6_queue_5Queue_7maxsize_3__set__(o, v); + } + else { + PyErr_SetString(PyExc_NotImplementedError, "__del__"); + return -1; + } +} + +static PyObject *__pyx_getprop_6gevent_6_queue_5Queue_hub(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_6_queue_5Queue_3hub_1__get__(o); +} + +static PyObject *__pyx_getprop_6gevent_6_queue_5Queue_queue(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_6_queue_5Queue_5queue_1__get__(o); +} + +static PyObject *__pyx_specialmethod___pyx_pw_6gevent_6_queue_5Queue_47__next__(PyObject *self, CYTHON_UNUSED PyObject *arg) {return __pyx_pw_6gevent_6_queue_5Queue_47__next__(self);} + +static PyMethodDef __pyx_methods_6gevent_6_queue_Queue[] = { + {"copy", (PyCFunction)__pyx_pw_6gevent_6_queue_5Queue_3copy, METH_NOARGS, __pyx_doc_6gevent_6_queue_5Queue_2copy}, + {"_create_queue", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_6_queue_5Queue_5_create_queue, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_6_queue_5Queue_4_create_queue}, + {"_format", (PyCFunction)__pyx_pw_6gevent_6_queue_5Queue_17_format, METH_NOARGS, __pyx_doc_6gevent_6_queue_5Queue_16_format}, + {"_unlock", (PyCFunction)__pyx_pw_6gevent_6_queue_5Queue_43_unlock, METH_NOARGS, __pyx_doc_6gevent_6_queue_5Queue_42_unlock}, + {"__next__", (PyCFunction)__pyx_specialmethod___pyx_pw_6gevent_6_queue_5Queue_47__next__, METH_NOARGS|METH_COEXIST, 0}, + {0, 0, 0, 0} +}; + +static struct PyGetSetDef __pyx_getsets_6gevent_6_queue_Queue[] = { + {(char *)"maxsize", __pyx_getprop_6gevent_6_queue_5Queue_maxsize, __pyx_setprop_6gevent_6_queue_5Queue_maxsize, (char *)0, 0}, + {(char *)"hub", __pyx_getprop_6gevent_6_queue_5Queue_hub, 0, (char *)0, 0}, + {(char *)"queue", __pyx_getprop_6gevent_6_queue_5Queue_queue, 0, (char *)0, 0}, + {0, 0, 0, 0, 0} +}; + +static PyNumberMethods __pyx_tp_as_number_Queue = { + 0, /*nb_add*/ + 0, /*nb_subtract*/ + 0, /*nb_multiply*/ + #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) + 0, /*nb_divide*/ + #endif + 0, /*nb_remainder*/ + 0, /*nb_divmod*/ + 0, /*nb_power*/ + 0, /*nb_negative*/ + 0, /*nb_positive*/ + 0, /*nb_absolute*/ + __pyx_pw_6gevent_6_queue_5Queue_25__nonzero__, /*nb_nonzero*/ + 0, /*nb_invert*/ + 0, /*nb_lshift*/ + 0, /*nb_rshift*/ + 0, /*nb_and*/ + 0, /*nb_xor*/ + 0, /*nb_or*/ + #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) + 0, /*nb_coerce*/ + #endif + 0, /*nb_int*/ + #if PY_MAJOR_VERSION < 3 + 0, /*nb_long*/ + #else + 0, /*reserved*/ + #endif + 0, /*nb_float*/ + #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) + 0, /*nb_oct*/ + #endif + #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) + 0, /*nb_hex*/ + #endif + 0, /*nb_inplace_add*/ + 0, /*nb_inplace_subtract*/ + 0, /*nb_inplace_multiply*/ + #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) + 0, /*nb_inplace_divide*/ + #endif + 0, /*nb_inplace_remainder*/ + 0, /*nb_inplace_power*/ + 0, /*nb_inplace_lshift*/ + 0, /*nb_inplace_rshift*/ + 0, /*nb_inplace_and*/ + 0, /*nb_inplace_xor*/ + 0, /*nb_inplace_or*/ + 0, /*nb_floor_divide*/ + 0, /*nb_true_divide*/ + 0, /*nb_inplace_floor_divide*/ + 0, /*nb_inplace_true_divide*/ + 0, /*nb_index*/ + #if PY_VERSION_HEX >= 0x03050000 + 0, /*nb_matrix_multiply*/ + #endif + #if PY_VERSION_HEX >= 0x03050000 + 0, /*nb_inplace_matrix_multiply*/ + #endif +}; + +static PySequenceMethods __pyx_tp_as_sequence_Queue = { + __pyx_pw_6gevent_6_queue_5Queue_21__len__, /*sq_length*/ + 0, /*sq_concat*/ + 0, /*sq_repeat*/ + 0, /*sq_item*/ + 0, /*sq_slice*/ + 0, /*sq_ass_item*/ + 0, /*sq_ass_slice*/ + 0, /*sq_contains*/ + 0, /*sq_inplace_concat*/ + 0, /*sq_inplace_repeat*/ +}; + +static PyMappingMethods __pyx_tp_as_mapping_Queue = { + __pyx_pw_6gevent_6_queue_5Queue_21__len__, /*mp_length*/ + 0, /*mp_subscript*/ + 0, /*mp_ass_subscript*/ +}; + +static PyTypeObject __pyx_type_6gevent_6_queue_Queue = { + PyVarObject_HEAD_INIT(0, 0) + "gevent._queue.Queue", /*tp_name*/ + sizeof(struct __pyx_obj_6gevent_6_queue_Queue), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6gevent_6_queue_Queue, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + __pyx_pw_6gevent_6_queue_5Queue_13__repr__, /*tp_repr*/ + &__pyx_tp_as_number_Queue, /*tp_as_number*/ + &__pyx_tp_as_sequence_Queue, /*tp_as_sequence*/ + &__pyx_tp_as_mapping_Queue, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + __pyx_pw_6gevent_6_queue_5Queue_15__str__, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + "Queue(maxsize=None, items=(), _warn_depth=2)\n\n Create a queue object with a given maximum size.\n\n If *maxsize* is less than or equal to zero or ``None``, the queue\n size is infinite.\n\n Queues have a ``len`` equal to the number of items in them (the :meth:`qsize`),\n but in a boolean context they are always True.\n\n .. versionchanged:: 1.1b3\n Queues now support :func:`len`; it behaves the same as :meth:`qsize`.\n .. versionchanged:: 1.1b3\n Multiple greenlets that block on a call to :meth:`put` for a full queue\n will now be awakened to put their items into the queue in the order in which\n they arrived. Likewise, multiple greenlets that block on a call to :meth:`get` for\n an empty queue will now receive items in the order in which they blocked. An\n implementation quirk under CPython *usually* ensured this was roughly the case\n previously anyway, but that wasn't the case for PyPy.\n ", /*tp_doc*/ + __pyx_tp_traverse_6gevent_6_queue_Queue, /*tp_traverse*/ + __pyx_tp_clear_6gevent_6_queue_Queue, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + __pyx_pw_6gevent_6_queue_5Queue_45__iter__, /*tp_iter*/ + __pyx_pw_6gevent_6_queue_5Queue_47__next__, /*tp_iternext*/ + __pyx_methods_6gevent_6_queue_Queue, /*tp_methods*/ + 0, /*tp_members*/ + __pyx_getsets_6gevent_6_queue_Queue, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_pw_6gevent_6_queue_5Queue_1__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6gevent_6_queue_Queue, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; +static struct __pyx_vtabstruct_6gevent_6_queue_UnboundQueue __pyx_vtable_6gevent_6_queue_UnboundQueue; + +static PyObject *__pyx_tp_new_6gevent_6_queue_UnboundQueue(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_6gevent_6_queue_UnboundQueue *p; + PyObject *o = __pyx_tp_new_6gevent_6_queue_Queue(t, a, k); + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_6gevent_6_queue_UnboundQueue *)o); + p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_6gevent_6_queue_Queue*)__pyx_vtabptr_6gevent_6_queue_UnboundQueue; + return o; +} + +static PyMethodDef __pyx_methods_6gevent_6_queue_UnboundQueue[] = { + {0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_6gevent_6_queue_UnboundQueue = { + PyVarObject_HEAD_INIT(0, 0) + "gevent._queue.UnboundQueue", /*tp_name*/ + sizeof(struct __pyx_obj_6gevent_6_queue_UnboundQueue), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6gevent_6_queue_Queue, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_6gevent_6_queue_5Queue_13__repr__, /*tp_repr*/ + #else + 0, /*tp_repr*/ + #endif + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_6gevent_6_queue_5Queue_15__str__, /*tp_str*/ + #else + 0, /*tp_str*/ + #endif + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + "UnboundQueue(maxsize=None, items=())", /*tp_doc*/ + __pyx_tp_traverse_6gevent_6_queue_Queue, /*tp_traverse*/ + __pyx_tp_clear_6gevent_6_queue_Queue, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_6gevent_6_queue_5Queue_45__iter__, /*tp_iter*/ + #else + 0, /*tp_iter*/ + #endif + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_6gevent_6_queue_5Queue_47__next__, /*tp_iternext*/ + #else + 0, /*tp_iternext*/ + #endif + __pyx_methods_6gevent_6_queue_UnboundQueue, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_pw_6gevent_6_queue_12UnboundQueue_1__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6gevent_6_queue_UnboundQueue, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; +static struct __pyx_vtabstruct_6gevent_6_queue_PriorityQueue __pyx_vtable_6gevent_6_queue_PriorityQueue; + +static PyObject *__pyx_tp_new_6gevent_6_queue_PriorityQueue(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_6gevent_6_queue_PriorityQueue *p; + PyObject *o = __pyx_tp_new_6gevent_6_queue_Queue(t, a, k); + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_6gevent_6_queue_PriorityQueue *)o); + p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_6gevent_6_queue_Queue*)__pyx_vtabptr_6gevent_6_queue_PriorityQueue; + return o; +} + +static PyMethodDef __pyx_methods_6gevent_6_queue_PriorityQueue[] = { + {"_create_queue", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_6_queue_13PriorityQueue_1_create_queue, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_6_queue_13PriorityQueue__create_queue}, + {0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_6gevent_6_queue_PriorityQueue = { + PyVarObject_HEAD_INIT(0, 0) + "gevent._queue.PriorityQueue", /*tp_name*/ + sizeof(struct __pyx_obj_6gevent_6_queue_PriorityQueue), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6gevent_6_queue_Queue, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_6gevent_6_queue_5Queue_13__repr__, /*tp_repr*/ + #else + 0, /*tp_repr*/ + #endif + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_6gevent_6_queue_5Queue_15__str__, /*tp_str*/ + #else + 0, /*tp_str*/ + #endif + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + "A subclass of :class:`Queue` that retrieves entries in priority order (lowest first).\n\n Entries are typically tuples of the form: ``(priority number, data)``.\n\n .. versionchanged:: 1.2a1\n Any *items* given to the constructor will now be passed through\n :func:`heapq.heapify` to ensure the invariants of this class hold.\n Previously it was just assumed that they were already a heap.\n ", /*tp_doc*/ + __pyx_tp_traverse_6gevent_6_queue_Queue, /*tp_traverse*/ + __pyx_tp_clear_6gevent_6_queue_Queue, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_6gevent_6_queue_5Queue_45__iter__, /*tp_iter*/ + #else + 0, /*tp_iter*/ + #endif + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_6gevent_6_queue_5Queue_47__next__, /*tp_iternext*/ + #else + 0, /*tp_iternext*/ + #endif + __pyx_methods_6gevent_6_queue_PriorityQueue, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_6gevent_6_queue_5Queue_1__init__, /*tp_init*/ + #else + 0, /*tp_init*/ + #endif + 0, /*tp_alloc*/ + __pyx_tp_new_6gevent_6_queue_PriorityQueue, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; +static struct __pyx_vtabstruct_6gevent_6_queue_LifoQueue __pyx_vtable_6gevent_6_queue_LifoQueue; + +static PyObject *__pyx_tp_new_6gevent_6_queue_LifoQueue(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_6gevent_6_queue_LifoQueue *p; + PyObject *o = __pyx_tp_new_6gevent_6_queue_Queue(t, a, k); + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_6gevent_6_queue_LifoQueue *)o); + p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_6gevent_6_queue_Queue*)__pyx_vtabptr_6gevent_6_queue_LifoQueue; + return o; +} + +static PyMethodDef __pyx_methods_6gevent_6_queue_LifoQueue[] = { + {"_create_queue", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_6_queue_9LifoQueue_1_create_queue, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_6_queue_9LifoQueue__create_queue}, + {0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_6gevent_6_queue_LifoQueue = { + PyVarObject_HEAD_INIT(0, 0) + "gevent._queue.LifoQueue", /*tp_name*/ + sizeof(struct __pyx_obj_6gevent_6_queue_LifoQueue), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6gevent_6_queue_Queue, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_6gevent_6_queue_5Queue_13__repr__, /*tp_repr*/ + #else + 0, /*tp_repr*/ + #endif + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_6gevent_6_queue_5Queue_15__str__, /*tp_str*/ + #else + 0, /*tp_str*/ + #endif + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + "A subclass of :class:`Queue` that retrieves most recently added entries first.", /*tp_doc*/ + __pyx_tp_traverse_6gevent_6_queue_Queue, /*tp_traverse*/ + __pyx_tp_clear_6gevent_6_queue_Queue, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_6gevent_6_queue_5Queue_45__iter__, /*tp_iter*/ + #else + 0, /*tp_iter*/ + #endif + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_6gevent_6_queue_5Queue_47__next__, /*tp_iternext*/ + #else + 0, /*tp_iternext*/ + #endif + __pyx_methods_6gevent_6_queue_LifoQueue, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_6gevent_6_queue_5Queue_1__init__, /*tp_init*/ + #else + 0, /*tp_init*/ + #endif + 0, /*tp_alloc*/ + __pyx_tp_new_6gevent_6_queue_LifoQueue, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; +static struct __pyx_vtabstruct_6gevent_6_queue_JoinableQueue __pyx_vtable_6gevent_6_queue_JoinableQueue; + +static PyObject *__pyx_tp_new_6gevent_6_queue_JoinableQueue(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_6gevent_6_queue_JoinableQueue *p; + PyObject *o = __pyx_tp_new_6gevent_6_queue_Queue(t, a, k); + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_6gevent_6_queue_JoinableQueue *)o); + p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_6gevent_6_queue_Queue*)__pyx_vtabptr_6gevent_6_queue_JoinableQueue; + p->_cond = ((struct __pyx_obj_6gevent_6_event_Event *)Py_None); Py_INCREF(Py_None); + return o; +} + +static void __pyx_tp_dealloc_6gevent_6_queue_JoinableQueue(PyObject *o) { + struct __pyx_obj_6gevent_6_queue_JoinableQueue *p = (struct __pyx_obj_6gevent_6_queue_JoinableQueue *)o; + #if CYTHON_USE_TP_FINALIZE + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + PyObject_GC_UnTrack(o); + Py_CLEAR(p->_cond); + PyObject_GC_Track(o); + __pyx_tp_dealloc_6gevent_6_queue_Queue(o); +} + +static int __pyx_tp_traverse_6gevent_6_queue_JoinableQueue(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_6gevent_6_queue_JoinableQueue *p = (struct __pyx_obj_6gevent_6_queue_JoinableQueue *)o; + e = __pyx_tp_traverse_6gevent_6_queue_Queue(o, v, a); if (e) return e; + if (p->_cond) { + e = (*v)(((PyObject *)p->_cond), a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_6gevent_6_queue_JoinableQueue(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_6gevent_6_queue_JoinableQueue *p = (struct __pyx_obj_6gevent_6_queue_JoinableQueue *)o; + __pyx_tp_clear_6gevent_6_queue_Queue(o); + tmp = ((PyObject*)p->_cond); + p->_cond = ((struct __pyx_obj_6gevent_6_event_Event *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyObject *__pyx_getprop_6gevent_6_queue_13JoinableQueue_unfinished_tasks(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_6_queue_13JoinableQueue_16unfinished_tasks_1__get__(o); +} + +static PyMethodDef __pyx_methods_6gevent_6_queue_JoinableQueue[] = { + {"copy", (PyCFunction)__pyx_pw_6gevent_6_queue_13JoinableQueue_3copy, METH_NOARGS, __pyx_doc_6gevent_6_queue_13JoinableQueue_2copy}, + {"_format", (PyCFunction)__pyx_pw_6gevent_6_queue_13JoinableQueue_5_format, METH_NOARGS, __pyx_doc_6gevent_6_queue_13JoinableQueue_4_format}, + {"task_done", (PyCFunction)__pyx_pw_6gevent_6_queue_13JoinableQueue_9task_done, METH_NOARGS, __pyx_doc_6gevent_6_queue_13JoinableQueue_8task_done}, + {"join", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_6_queue_13JoinableQueue_11join, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_6_queue_13JoinableQueue_10join}, + {0, 0, 0, 0} +}; + +static struct PyGetSetDef __pyx_getsets_6gevent_6_queue_JoinableQueue[] = { + {(char *)"unfinished_tasks", __pyx_getprop_6gevent_6_queue_13JoinableQueue_unfinished_tasks, 0, (char *)0, 0}, + {0, 0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_6gevent_6_queue_JoinableQueue = { + PyVarObject_HEAD_INIT(0, 0) + "gevent._queue.JoinableQueue", /*tp_name*/ + sizeof(struct __pyx_obj_6gevent_6_queue_JoinableQueue), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6gevent_6_queue_JoinableQueue, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_6gevent_6_queue_5Queue_13__repr__, /*tp_repr*/ + #else + 0, /*tp_repr*/ + #endif + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_6gevent_6_queue_5Queue_15__str__, /*tp_str*/ + #else + 0, /*tp_str*/ + #endif + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + "JoinableQueue(maxsize=None, items=(), unfinished_tasks=None)\n\n A subclass of :class:`Queue` that additionally has\n :meth:`task_done` and :meth:`join` methods.\n ", /*tp_doc*/ + __pyx_tp_traverse_6gevent_6_queue_JoinableQueue, /*tp_traverse*/ + __pyx_tp_clear_6gevent_6_queue_JoinableQueue, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_6gevent_6_queue_5Queue_45__iter__, /*tp_iter*/ + #else + 0, /*tp_iter*/ + #endif + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_6gevent_6_queue_5Queue_47__next__, /*tp_iternext*/ + #else + 0, /*tp_iternext*/ + #endif + __pyx_methods_6gevent_6_queue_JoinableQueue, /*tp_methods*/ + 0, /*tp_members*/ + __pyx_getsets_6gevent_6_queue_JoinableQueue, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_pw_6gevent_6_queue_13JoinableQueue_1__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6gevent_6_queue_JoinableQueue, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; +static struct __pyx_vtabstruct_6gevent_6_queue_Channel __pyx_vtable_6gevent_6_queue_Channel; + +static PyObject *__pyx_tp_new_6gevent_6_queue_Channel(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + struct __pyx_obj_6gevent_6_queue_Channel *p; + PyObject *o; + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_6gevent_6_queue_Channel *)o); + p->__pyx_vtab = __pyx_vtabptr_6gevent_6_queue_Channel; + p->getters = Py_None; Py_INCREF(Py_None); + p->putters = Py_None; Py_INCREF(Py_None); + p->hub = Py_None; Py_INCREF(Py_None); + p->_event_unlock = Py_None; Py_INCREF(Py_None); + return o; +} + +static void __pyx_tp_dealloc_6gevent_6_queue_Channel(PyObject *o) { + struct __pyx_obj_6gevent_6_queue_Channel *p = (struct __pyx_obj_6gevent_6_queue_Channel *)o; + #if CYTHON_USE_TP_FINALIZE + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + PyObject_GC_UnTrack(o); + if (p->__weakref__) PyObject_ClearWeakRefs(o); + Py_CLEAR(p->getters); + Py_CLEAR(p->putters); + Py_CLEAR(p->hub); + Py_CLEAR(p->_event_unlock); + (*Py_TYPE(o)->tp_free)(o); +} + +static int __pyx_tp_traverse_6gevent_6_queue_Channel(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_6gevent_6_queue_Channel *p = (struct __pyx_obj_6gevent_6_queue_Channel *)o; + if (p->getters) { + e = (*v)(p->getters, a); if (e) return e; + } + if (p->putters) { + e = (*v)(p->putters, a); if (e) return e; + } + if (p->hub) { + e = (*v)(p->hub, a); if (e) return e; + } + if (p->_event_unlock) { + e = (*v)(p->_event_unlock, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_6gevent_6_queue_Channel(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_6gevent_6_queue_Channel *p = (struct __pyx_obj_6gevent_6_queue_Channel *)o; + tmp = ((PyObject*)p->getters); + p->getters = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->putters); + p->putters = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->hub); + p->hub = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->_event_unlock); + p->_event_unlock = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyObject *__pyx_getprop_6gevent_6_queue_7Channel_balance(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_6_queue_7Channel_7balance_1__get__(o); +} + +static PyObject *__pyx_getprop_6gevent_6_queue_7Channel_getters(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_6_queue_7Channel_7getters_1__get__(o); +} + +static PyObject *__pyx_getprop_6gevent_6_queue_7Channel_putters(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_6_queue_7Channel_7putters_1__get__(o); +} + +static PyObject *__pyx_getprop_6gevent_6_queue_7Channel_hub(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_6_queue_7Channel_3hub_1__get__(o); +} + +static PyObject *__pyx_specialmethod___pyx_pw_6gevent_6_queue_7Channel_27__next__(PyObject *self, CYTHON_UNUSED PyObject *arg) {return __pyx_pw_6gevent_6_queue_7Channel_27__next__(self);} + +static PyMethodDef __pyx_methods_6gevent_6_queue_Channel[] = { + {"_format", (PyCFunction)__pyx_pw_6gevent_6_queue_7Channel_7_format, METH_NOARGS, __pyx_doc_6gevent_6_queue_7Channel_6_format}, + {"qsize", (PyCFunction)__pyx_pw_6gevent_6_queue_7Channel_9qsize, METH_NOARGS, __pyx_doc_6gevent_6_queue_7Channel_8qsize}, + {"empty", (PyCFunction)__pyx_pw_6gevent_6_queue_7Channel_11empty, METH_NOARGS, __pyx_doc_6gevent_6_queue_7Channel_10empty}, + {"full", (PyCFunction)__pyx_pw_6gevent_6_queue_7Channel_13full, METH_NOARGS, __pyx_doc_6gevent_6_queue_7Channel_12full}, + {"put", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_6_queue_7Channel_15put, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_6_queue_7Channel_14put}, + {"put_nowait", (PyCFunction)__pyx_pw_6gevent_6_queue_7Channel_17put_nowait, METH_O, __pyx_doc_6gevent_6_queue_7Channel_16put_nowait}, + {"_unlock", (PyCFunction)__pyx_pw_6gevent_6_queue_7Channel_23_unlock, METH_NOARGS, __pyx_doc_6gevent_6_queue_7Channel_22_unlock}, + {"__next__", (PyCFunction)__pyx_specialmethod___pyx_pw_6gevent_6_queue_7Channel_27__next__, METH_NOARGS|METH_COEXIST, 0}, + {0, 0, 0, 0} +}; + +static struct PyGetSetDef __pyx_getsets_6gevent_6_queue_Channel[] = { + {(char *)"balance", __pyx_getprop_6gevent_6_queue_7Channel_balance, 0, (char *)0, 0}, + {(char *)"getters", __pyx_getprop_6gevent_6_queue_7Channel_getters, 0, (char *)0, 0}, + {(char *)"putters", __pyx_getprop_6gevent_6_queue_7Channel_putters, 0, (char *)0, 0}, + {(char *)"hub", __pyx_getprop_6gevent_6_queue_7Channel_hub, 0, (char *)0, 0}, + {0, 0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_6gevent_6_queue_Channel = { + PyVarObject_HEAD_INIT(0, 0) + "gevent._queue.Channel", /*tp_name*/ + sizeof(struct __pyx_obj_6gevent_6_queue_Channel), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6gevent_6_queue_Channel, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + __pyx_pw_6gevent_6_queue_7Channel_3__repr__, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + __pyx_pw_6gevent_6_queue_7Channel_5__str__, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + "Channel(maxsize=1)", /*tp_doc*/ + __pyx_tp_traverse_6gevent_6_queue_Channel, /*tp_traverse*/ + __pyx_tp_clear_6gevent_6_queue_Channel, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + __pyx_pw_6gevent_6_queue_7Channel_25__iter__, /*tp_iter*/ + __pyx_pw_6gevent_6_queue_7Channel_27__next__, /*tp_iternext*/ + __pyx_methods_6gevent_6_queue_Channel, /*tp_methods*/ + 0, /*tp_members*/ + __pyx_getsets_6gevent_6_queue_Channel, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_pw_6gevent_6_queue_7Channel_1__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6gevent_6_queue_Channel, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static PyMethodDef __pyx_methods[] = { + {0, 0, 0, 0} +}; + +#if PY_MAJOR_VERSION >= 3 +#if CYTHON_PEP489_MULTI_PHASE_INIT +static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ +static int __pyx_pymod_exec__queue(PyObject* module); /*proto*/ +static PyModuleDef_Slot __pyx_moduledef_slots[] = { + {Py_mod_create, (void*)__pyx_pymod_create}, + {Py_mod_exec, (void*)__pyx_pymod_exec__queue}, + {0, NULL} +}; +#endif + +static struct PyModuleDef __pyx_moduledef = { + PyModuleDef_HEAD_INIT, + "_queue", + __pyx_k_Synchronized_queues_The_mod_gev, /* m_doc */ + #if CYTHON_PEP489_MULTI_PHASE_INIT + 0, /* m_size */ + #else + -1, /* m_size */ + #endif + __pyx_methods /* m_methods */, + #if CYTHON_PEP489_MULTI_PHASE_INIT + __pyx_moduledef_slots, /* m_slots */ + #else + NULL, /* m_reload */ + #endif + NULL, /* m_traverse */ + NULL, /* m_clear */ + NULL /* m_free */ +}; +#endif +#ifndef CYTHON_SMALL_CODE +#if defined(__clang__) + #define CYTHON_SMALL_CODE +#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) + #define CYTHON_SMALL_CODE __attribute__((cold)) +#else + #define CYTHON_SMALL_CODE +#endif +#endif + +static __Pyx_StringTabEntry __pyx_string_tab[] = { + {&__pyx_n_s_Channel, __pyx_k_Channel, sizeof(__pyx_k_Channel), 0, 0, 1, 1}, + {&__pyx_n_s_Channel__format, __pyx_k_Channel__format, sizeof(__pyx_k_Channel__format), 0, 0, 1, 1}, + {&__pyx_n_s_Channel__unlock, __pyx_k_Channel__unlock, sizeof(__pyx_k_Channel__unlock), 0, 0, 1, 1}, + {&__pyx_n_s_Channel_empty, __pyx_k_Channel_empty, sizeof(__pyx_k_Channel_empty), 0, 0, 1, 1}, + {&__pyx_n_s_Channel_full, __pyx_k_Channel_full, sizeof(__pyx_k_Channel_full), 0, 0, 1, 1}, + {&__pyx_n_s_Channel_get, __pyx_k_Channel_get, sizeof(__pyx_k_Channel_get), 0, 0, 1, 1}, + {&__pyx_n_s_Channel_get_nowait, __pyx_k_Channel_get_nowait, sizeof(__pyx_k_Channel_get_nowait), 0, 0, 1, 1}, + {&__pyx_n_s_Channel_put, __pyx_k_Channel_put, sizeof(__pyx_k_Channel_put), 0, 0, 1, 1}, + {&__pyx_n_s_Channel_put_nowait, __pyx_k_Channel_put_nowait, sizeof(__pyx_k_Channel_put_nowait), 0, 0, 1, 1}, + {&__pyx_n_s_Channel_qsize, __pyx_k_Channel_qsize, sizeof(__pyx_k_Channel_qsize), 0, 0, 1, 1}, + {&__pyx_kp_s_Channels_have_a_maxsize_of_1, __pyx_k_Channels_have_a_maxsize_of_1, sizeof(__pyx_k_Channels_have_a_maxsize_of_1), 0, 0, 1, 0}, + {&__pyx_n_s_DeprecationWarning, __pyx_k_DeprecationWarning, sizeof(__pyx_k_DeprecationWarning), 0, 0, 1, 1}, + {&__pyx_n_s_Empty, __pyx_k_Empty, sizeof(__pyx_k_Empty), 0, 0, 1, 1}, + {&__pyx_n_s_Event, __pyx_k_Event, sizeof(__pyx_k_Event), 0, 0, 1, 1}, + {&__pyx_n_s_Full, __pyx_k_Full, sizeof(__pyx_k_Full), 0, 0, 1, 1}, + {&__pyx_n_s_InvalidSwitchError, __pyx_k_InvalidSwitchError, sizeof(__pyx_k_InvalidSwitchError), 0, 0, 1, 1}, + {&__pyx_kp_s_Invalid_switch_into_Channel_put, __pyx_k_Invalid_switch_into_Channel_put, sizeof(__pyx_k_Invalid_switch_into_Channel_put), 0, 0, 1, 0}, + {&__pyx_kp_s_Invalid_switch_into_Queue_get_r, __pyx_k_Invalid_switch_into_Queue_get_r, sizeof(__pyx_k_Invalid_switch_into_Queue_get_r), 0, 0, 1, 0}, + {&__pyx_kp_s_Invalid_switch_into_Queue_put_r, __pyx_k_Invalid_switch_into_Queue_put_r, sizeof(__pyx_k_Invalid_switch_into_Queue_put_r), 0, 0, 1, 0}, + {&__pyx_n_s_ItemWaiter, __pyx_k_ItemWaiter, sizeof(__pyx_k_ItemWaiter), 0, 0, 1, 1}, + {&__pyx_n_s_ItemWaiter_put_and_switch, __pyx_k_ItemWaiter_put_and_switch, sizeof(__pyx_k_ItemWaiter_put_and_switch), 0, 0, 1, 1}, + {&__pyx_n_s_JoinableQueue, __pyx_k_JoinableQueue, sizeof(__pyx_k_JoinableQueue), 0, 0, 1, 1}, + {&__pyx_n_s_JoinableQueue__format, __pyx_k_JoinableQueue__format, sizeof(__pyx_k_JoinableQueue__format), 0, 0, 1, 1}, + {&__pyx_n_s_JoinableQueue__put, __pyx_k_JoinableQueue__put, sizeof(__pyx_k_JoinableQueue__put), 0, 0, 1, 1}, + {&__pyx_n_s_JoinableQueue_copy, __pyx_k_JoinableQueue_copy, sizeof(__pyx_k_JoinableQueue_copy), 0, 0, 1, 1}, + {&__pyx_n_s_JoinableQueue_join, __pyx_k_JoinableQueue_join, sizeof(__pyx_k_JoinableQueue_join), 0, 0, 1, 1}, + {&__pyx_n_s_JoinableQueue_task_done, __pyx_k_JoinableQueue_task_done, sizeof(__pyx_k_JoinableQueue_task_done), 0, 0, 1, 1}, + {&__pyx_n_s_LifoQueue, __pyx_k_LifoQueue, sizeof(__pyx_k_LifoQueue), 0, 0, 1, 1}, + {&__pyx_n_s_LifoQueue__create_queue, __pyx_k_LifoQueue__create_queue, sizeof(__pyx_k_LifoQueue__create_queue), 0, 0, 1, 1}, + {&__pyx_n_s_LifoQueue__get, __pyx_k_LifoQueue__get, sizeof(__pyx_k_LifoQueue__get), 0, 0, 1, 1}, + {&__pyx_n_s_LifoQueue__peek, __pyx_k_LifoQueue__peek, sizeof(__pyx_k_LifoQueue__peek), 0, 0, 1, 1}, + {&__pyx_n_s_LifoQueue__put, __pyx_k_LifoQueue__put, sizeof(__pyx_k_LifoQueue__put), 0, 0, 1, 1}, + {&__pyx_n_s_PriorityQueue, __pyx_k_PriorityQueue, sizeof(__pyx_k_PriorityQueue), 0, 0, 1, 1}, + {&__pyx_n_s_PriorityQueue__create_queue, __pyx_k_PriorityQueue__create_queue, sizeof(__pyx_k_PriorityQueue__create_queue), 0, 0, 1, 1}, + {&__pyx_n_s_PriorityQueue__get, __pyx_k_PriorityQueue__get, sizeof(__pyx_k_PriorityQueue__get), 0, 0, 1, 1}, + {&__pyx_n_s_PriorityQueue__put, __pyx_k_PriorityQueue__put, sizeof(__pyx_k_PriorityQueue__put), 0, 0, 1, 1}, + {&__pyx_n_s_PySimpleQueue, __pyx_k_PySimpleQueue, sizeof(__pyx_k_PySimpleQueue), 0, 0, 1, 1}, + {&__pyx_n_s_Queue, __pyx_k_Queue, sizeof(__pyx_k_Queue), 0, 0, 1, 1}, + {&__pyx_kp_s_Queue_0_now_equivalent_to_Queue, __pyx_k_Queue_0_now_equivalent_to_Queue, sizeof(__pyx_k_Queue_0_now_equivalent_to_Queue), 0, 0, 1, 0}, + {&__pyx_n_s_Queue__create_queue, __pyx_k_Queue__create_queue, sizeof(__pyx_k_Queue__create_queue), 0, 0, 1, 1}, + {&__pyx_n_s_Queue__format, __pyx_k_Queue__format, sizeof(__pyx_k_Queue__format), 0, 0, 1, 1}, + {&__pyx_n_s_Queue__get, __pyx_k_Queue__get, sizeof(__pyx_k_Queue__get), 0, 0, 1, 1}, + {&__pyx_n_s_Queue__peek, __pyx_k_Queue__peek, sizeof(__pyx_k_Queue__peek), 0, 0, 1, 1}, + {&__pyx_n_s_Queue__put, __pyx_k_Queue__put, sizeof(__pyx_k_Queue__put), 0, 0, 1, 1}, + {&__pyx_n_s_Queue__unlock, __pyx_k_Queue__unlock, sizeof(__pyx_k_Queue__unlock), 0, 0, 1, 1}, + {&__pyx_n_s_Queue_copy, __pyx_k_Queue_copy, sizeof(__pyx_k_Queue_copy), 0, 0, 1, 1}, + {&__pyx_n_s_Queue_empty, __pyx_k_Queue_empty, sizeof(__pyx_k_Queue_empty), 0, 0, 1, 1}, + {&__pyx_n_s_Queue_full, __pyx_k_Queue_full, sizeof(__pyx_k_Queue_full), 0, 0, 1, 1}, + {&__pyx_n_s_Queue_get, __pyx_k_Queue_get, sizeof(__pyx_k_Queue_get), 0, 0, 1, 1}, + {&__pyx_n_s_Queue_get_nowait, __pyx_k_Queue_get_nowait, sizeof(__pyx_k_Queue_get_nowait), 0, 0, 1, 1}, + {&__pyx_n_s_Queue_peek, __pyx_k_Queue_peek, sizeof(__pyx_k_Queue_peek), 0, 0, 1, 1}, + {&__pyx_n_s_Queue_peek_nowait, __pyx_k_Queue_peek_nowait, sizeof(__pyx_k_Queue_peek_nowait), 0, 0, 1, 1}, + {&__pyx_n_s_Queue_put, __pyx_k_Queue_put, sizeof(__pyx_k_Queue_put), 0, 0, 1, 1}, + {&__pyx_n_s_Queue_put_nowait, __pyx_k_Queue_put_nowait, sizeof(__pyx_k_Queue_put_nowait), 0, 0, 1, 1}, + {&__pyx_n_s_Queue_qsize, __pyx_k_Queue_qsize, sizeof(__pyx_k_Queue_qsize), 0, 0, 1, 1}, + {&__pyx_n_s_SimpleQueue, __pyx_k_SimpleQueue, sizeof(__pyx_k_SimpleQueue), 0, 0, 1, 1}, + {&__pyx_n_s_StopIteration, __pyx_k_StopIteration, sizeof(__pyx_k_StopIteration), 0, 0, 1, 1}, + {&__pyx_n_s_Timeout, __pyx_k_Timeout, sizeof(__pyx_k_Timeout), 0, 0, 1, 1}, + {&__pyx_n_s_UnboundQueue, __pyx_k_UnboundQueue, sizeof(__pyx_k_UnboundQueue), 0, 0, 1, 1}, + {&__pyx_kp_s_UnboundQueue_has_no_maxsize, __pyx_k_UnboundQueue_has_no_maxsize, sizeof(__pyx_k_UnboundQueue_has_no_maxsize), 0, 0, 1, 0}, + {&__pyx_n_s_UnboundQueue_put, __pyx_k_UnboundQueue_put, sizeof(__pyx_k_UnboundQueue_put), 0, 0, 1, 1}, + {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1}, + {&__pyx_n_s_Waiter, __pyx_k_Waiter, sizeof(__pyx_k_Waiter), 0, 0, 1, 1}, + {&__pyx_kp_s__2, __pyx_k__2, sizeof(__pyx_k__2), 0, 0, 1, 0}, + {&__pyx_kp_s__3, __pyx_k__3, sizeof(__pyx_k__3), 0, 0, 1, 0}, + {&__pyx_n_s_all, __pyx_k_all, sizeof(__pyx_k_all), 0, 0, 1, 1}, + {&__pyx_n_s_append, __pyx_k_append, sizeof(__pyx_k_append), 0, 0, 1, 1}, + {&__pyx_n_s_block, __pyx_k_block, sizeof(__pyx_k_block), 0, 0, 1, 1}, + {&__pyx_n_s_cancel, __pyx_k_cancel, sizeof(__pyx_k_cancel), 0, 0, 1, 1}, + {&__pyx_n_s_clear, __pyx_k_clear, sizeof(__pyx_k_clear), 0, 0, 1, 1}, + {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, + {&__pyx_n_s_close, __pyx_k_close, sizeof(__pyx_k_close), 0, 0, 1, 1}, + {&__pyx_n_s_collections, __pyx_k_collections, sizeof(__pyx_k_collections), 0, 0, 1, 1}, + {&__pyx_n_s_cond, __pyx_k_cond, sizeof(__pyx_k_cond), 0, 0, 1, 1}, + {&__pyx_n_s_copy, __pyx_k_copy, sizeof(__pyx_k_copy), 0, 0, 1, 1}, + {&__pyx_n_s_create_queue, __pyx_k_create_queue, sizeof(__pyx_k_create_queue), 0, 0, 1, 1}, + {&__pyx_n_s_deque, __pyx_k_deque, sizeof(__pyx_k_deque), 0, 0, 1, 1}, + {&__pyx_n_s_empty, __pyx_k_empty, sizeof(__pyx_k_empty), 0, 0, 1, 1}, + {&__pyx_n_s_event_unlock, __pyx_k_event_unlock, sizeof(__pyx_k_event_unlock), 0, 0, 1, 1}, + {&__pyx_n_s_exc_info, __pyx_k_exc_info, sizeof(__pyx_k_exc_info), 0, 0, 1, 1}, + {&__pyx_n_s_extensions, __pyx_k_extensions, sizeof(__pyx_k_extensions), 0, 0, 1, 1}, + {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1}, + {&__pyx_n_s_full, __pyx_k_full, sizeof(__pyx_k_full), 0, 0, 1, 1}, + {&__pyx_n_s_get, __pyx_k_get, sizeof(__pyx_k_get), 0, 0, 1, 1}, + {&__pyx_n_s_get_2, __pyx_k_get_2, sizeof(__pyx_k_get_2), 0, 0, 1, 1}, + {&__pyx_n_s_get_hub, __pyx_k_get_hub, sizeof(__pyx_k_get_hub), 0, 0, 1, 1}, + {&__pyx_n_s_get_hub_noargs, __pyx_k_get_hub_noargs, sizeof(__pyx_k_get_hub_noargs), 0, 0, 1, 1}, + {&__pyx_n_s_get_nowait, __pyx_k_get_nowait, sizeof(__pyx_k_get_nowait), 0, 0, 1, 1}, + {&__pyx_n_s_getcurrent, __pyx_k_getcurrent, sizeof(__pyx_k_getcurrent), 0, 0, 1, 1}, + {&__pyx_n_s_getter, __pyx_k_getter, sizeof(__pyx_k_getter), 0, 0, 1, 1}, + {&__pyx_n_s_getters, __pyx_k_getters, sizeof(__pyx_k_getters), 0, 0, 1, 1}, + {&__pyx_kp_s_getters_s, __pyx_k_getters_s, sizeof(__pyx_k_getters_s), 0, 0, 1, 0}, + {&__pyx_kp_s_getters_s_2, __pyx_k_getters_s_2, sizeof(__pyx_k_getters_s_2), 0, 0, 1, 0}, + {&__pyx_n_s_gevent, __pyx_k_gevent, sizeof(__pyx_k_gevent), 0, 0, 1, 1}, + {&__pyx_n_s_gevent__hub_local, __pyx_k_gevent__hub_local, sizeof(__pyx_k_gevent__hub_local), 0, 0, 1, 1}, + {&__pyx_n_s_gevent__queue, __pyx_k_gevent__queue, sizeof(__pyx_k_gevent__queue), 0, 0, 1, 1}, + {&__pyx_n_s_gevent__util, __pyx_k_gevent__util, sizeof(__pyx_k_gevent__util), 0, 0, 1, 1}, + {&__pyx_n_s_gevent__waiter, __pyx_k_gevent__waiter, sizeof(__pyx_k_gevent__waiter), 0, 0, 1, 1}, + {&__pyx_n_s_gevent_event, __pyx_k_gevent_event, sizeof(__pyx_k_gevent_event), 0, 0, 1, 1}, + {&__pyx_n_s_gevent_exceptions, __pyx_k_gevent_exceptions, sizeof(__pyx_k_gevent_exceptions), 0, 0, 1, 1}, + {&__pyx_n_s_gevent_timeout, __pyx_k_gevent_timeout, sizeof(__pyx_k_gevent_timeout), 0, 0, 1, 1}, + {&__pyx_n_s_greenlet, __pyx_k_greenlet, sizeof(__pyx_k_greenlet), 0, 0, 1, 1}, + {&__pyx_n_s_heapify, __pyx_k_heapify, sizeof(__pyx_k_heapify), 0, 0, 1, 1}, + {&__pyx_n_s_heapify_2, __pyx_k_heapify_2, sizeof(__pyx_k_heapify_2), 0, 0, 1, 1}, + {&__pyx_n_s_heappop, __pyx_k_heappop, sizeof(__pyx_k_heappop), 0, 0, 1, 1}, + {&__pyx_n_s_heappop_2, __pyx_k_heappop_2, sizeof(__pyx_k_heappop_2), 0, 0, 1, 1}, + {&__pyx_n_s_heappush, __pyx_k_heappush, sizeof(__pyx_k_heappush), 0, 0, 1, 1}, + {&__pyx_n_s_heappush_2, __pyx_k_heappush_2, sizeof(__pyx_k_heappush_2), 0, 0, 1, 1}, + {&__pyx_n_s_heapq, __pyx_k_heapq, sizeof(__pyx_k_heapq), 0, 0, 1, 1}, + {&__pyx_n_s_hex, __pyx_k_hex, sizeof(__pyx_k_hex), 0, 0, 1, 1}, + {&__pyx_n_s_hub, __pyx_k_hub, sizeof(__pyx_k_hub), 0, 0, 1, 1}, + {&__pyx_n_s_id, __pyx_k_id, sizeof(__pyx_k_id), 0, 0, 1, 1}, + {&__pyx_n_s_implements, __pyx_k_implements, sizeof(__pyx_k_implements), 0, 0, 1, 1}, + {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, + {&__pyx_n_s_import_c_accel, __pyx_k_import_c_accel, sizeof(__pyx_k_import_c_accel), 0, 0, 1, 1}, + {&__pyx_n_s_imports, __pyx_k_imports, sizeof(__pyx_k_imports), 0, 0, 1, 1}, + {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1}, + {&__pyx_n_s_item, __pyx_k_item, sizeof(__pyx_k_item), 0, 0, 1, 1}, + {&__pyx_n_s_items, __pyx_k_items, sizeof(__pyx_k_items), 0, 0, 1, 1}, + {&__pyx_n_s_join, __pyx_k_join, sizeof(__pyx_k_join), 0, 0, 1, 1}, + {&__pyx_n_s_loop, __pyx_k_loop, sizeof(__pyx_k_loop), 0, 0, 1, 1}, + {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, + {&__pyx_n_s_maxsize, __pyx_k_maxsize, sizeof(__pyx_k_maxsize), 0, 0, 1, 1}, + {&__pyx_n_s_maxsize_2, __pyx_k_maxsize_2, sizeof(__pyx_k_maxsize_2), 0, 0, 1, 1}, + {&__pyx_kp_s_maxsize_r, __pyx_k_maxsize_r, sizeof(__pyx_k_maxsize_r), 0, 0, 1, 0}, + {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, + {&__pyx_n_s_next, __pyx_k_next, sizeof(__pyx_k_next), 0, 0, 1, 1}, + {&__pyx_n_s_next_2, __pyx_k_next_2, sizeof(__pyx_k_next_2), 0, 0, 1, 1}, + {&__pyx_n_s_peek, __pyx_k_peek, sizeof(__pyx_k_peek), 0, 0, 1, 1}, + {&__pyx_n_s_peek_2, __pyx_k_peek_2, sizeof(__pyx_k_peek_2), 0, 0, 1, 1}, + {&__pyx_n_s_peek_nowait, __pyx_k_peek_nowait, sizeof(__pyx_k_peek_nowait), 0, 0, 1, 1}, + {&__pyx_n_s_pop, __pyx_k_pop, sizeof(__pyx_k_pop), 0, 0, 1, 1}, + {&__pyx_n_s_popleft, __pyx_k_popleft, sizeof(__pyx_k_popleft), 0, 0, 1, 1}, + {&__pyx_n_s_put, __pyx_k_put, sizeof(__pyx_k_put), 0, 0, 1, 1}, + {&__pyx_n_s_put_2, __pyx_k_put_2, sizeof(__pyx_k_put_2), 0, 0, 1, 1}, + {&__pyx_n_s_put_and_switch, __pyx_k_put_and_switch, sizeof(__pyx_k_put_and_switch), 0, 0, 1, 1}, + {&__pyx_n_s_put_nowait, __pyx_k_put_nowait, sizeof(__pyx_k_put_nowait), 0, 0, 1, 1}, + {&__pyx_n_s_putter, __pyx_k_putter, sizeof(__pyx_k_putter), 0, 0, 1, 1}, + {&__pyx_n_s_putters, __pyx_k_putters, sizeof(__pyx_k_putters), 0, 0, 1, 1}, + {&__pyx_kp_s_putters_s, __pyx_k_putters_s, sizeof(__pyx_k_putters_s), 0, 0, 1, 0}, + {&__pyx_kp_s_putters_s_2, __pyx_k_putters_s_2, sizeof(__pyx_k_putters_s_2), 0, 0, 1, 0}, + {&__pyx_n_s_pyx_capi, __pyx_k_pyx_capi, sizeof(__pyx_k_pyx_capi), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1}, + {&__pyx_n_s_q, __pyx_k_q, sizeof(__pyx_k_q), 0, 0, 1, 1}, + {&__pyx_n_s_qsize, __pyx_k_qsize, sizeof(__pyx_k_qsize), 0, 0, 1, 1}, + {&__pyx_n_s_queue, __pyx_k_queue, sizeof(__pyx_k_queue), 0, 0, 1, 1}, + {&__pyx_n_s_queue_2, __pyx_k_queue_2, sizeof(__pyx_k_queue_2), 0, 0, 1, 1}, + {&__pyx_kp_s_queue_r, __pyx_k_queue_r, sizeof(__pyx_k_queue_r), 0, 0, 1, 0}, + {&__pyx_n_s_remove, __pyx_k_remove, sizeof(__pyx_k_remove), 0, 0, 1, 1}, + {&__pyx_n_s_repeat, __pyx_k_repeat, sizeof(__pyx_k_repeat), 0, 0, 1, 1}, + {&__pyx_n_s_result, __pyx_k_result, sizeof(__pyx_k_result), 0, 0, 1, 1}, + {&__pyx_n_s_run_callback, __pyx_k_run_callback, sizeof(__pyx_k_run_callback), 0, 0, 1, 1}, + {&__pyx_kp_s_s_at_s_s, __pyx_k_s_at_s_s, sizeof(__pyx_k_s_at_s_s), 0, 0, 1, 0}, + {&__pyx_kp_s_s_at_s_s_2, __pyx_k_s_at_s_s_2, sizeof(__pyx_k_s_at_s_s_2), 0, 0, 1, 0}, + {&__pyx_kp_s_s_s, __pyx_k_s_s, sizeof(__pyx_k_s_s), 0, 0, 1, 0}, + {&__pyx_kp_s_s_s_2, __pyx_k_s_s_2, sizeof(__pyx_k_s_s_2), 0, 0, 1, 0}, + {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1}, + {&__pyx_n_s_set, __pyx_k_set, sizeof(__pyx_k_set), 0, 0, 1, 1}, + {&__pyx_n_s_slots, __pyx_k_slots, sizeof(__pyx_k_slots), 0, 0, 1, 1}, + {&__pyx_kp_s_src_gevent_queue_py, __pyx_k_src_gevent_queue_py, sizeof(__pyx_k_src_gevent_queue_py), 0, 0, 1, 0}, + {&__pyx_n_s_stacklevel, __pyx_k_stacklevel, sizeof(__pyx_k_stacklevel), 0, 0, 1, 1}, + {&__pyx_n_s_start_new_or_dummy, __pyx_k_start_new_or_dummy, sizeof(__pyx_k_start_new_or_dummy), 0, 0, 1, 1}, + {&__pyx_n_s_switch, __pyx_k_switch, sizeof(__pyx_k_switch), 0, 0, 1, 1}, + {&__pyx_n_s_sys, __pyx_k_sys, sizeof(__pyx_k_sys), 0, 0, 1, 1}, + {&__pyx_n_s_task_done, __pyx_k_task_done, sizeof(__pyx_k_task_done), 0, 0, 1, 1}, + {&__pyx_kp_s_task_done_called_too_many_times, __pyx_k_task_done_called_too_many_times, sizeof(__pyx_k_task_done_called_too_many_times), 0, 0, 1, 0}, + {&__pyx_kp_s_tasks_s__cond_s, __pyx_k_tasks_s__cond_s, sizeof(__pyx_k_tasks_s__cond_s), 0, 0, 1, 0}, + {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, + {&__pyx_n_s_throw, __pyx_k_throw, sizeof(__pyx_k_throw), 0, 0, 1, 1}, + {&__pyx_n_s_timeout, __pyx_k_timeout, sizeof(__pyx_k_timeout), 0, 0, 1, 1}, + {&__pyx_n_s_unfinished_tasks, __pyx_k_unfinished_tasks, sizeof(__pyx_k_unfinished_tasks), 0, 0, 1, 1}, + {&__pyx_n_s_unlock, __pyx_k_unlock, sizeof(__pyx_k_unlock), 0, 0, 1, 1}, + {&__pyx_n_s_version_info, __pyx_k_version_info, sizeof(__pyx_k_version_info), 0, 0, 1, 1}, + {&__pyx_n_s_wait, __pyx_k_wait, sizeof(__pyx_k_wait), 0, 0, 1, 1}, + {&__pyx_n_s_waiter, __pyx_k_waiter, sizeof(__pyx_k_waiter), 0, 0, 1, 1}, + {&__pyx_n_s_waiter_2, __pyx_k_waiter_2, sizeof(__pyx_k_waiter_2), 0, 0, 1, 1}, + {&__pyx_n_s_warn, __pyx_k_warn, sizeof(__pyx_k_warn), 0, 0, 1, 1}, + {&__pyx_n_s_warn_depth, __pyx_k_warn_depth, sizeof(__pyx_k_warn_depth), 0, 0, 1, 1}, + {&__pyx_n_s_warnings, __pyx_k_warnings, sizeof(__pyx_k_warnings), 0, 0, 1, 1}, + {&__pyx_n_s_weakref, __pyx_k_weakref, sizeof(__pyx_k_weakref), 0, 0, 1, 1}, + {0, 0, 0, 0, 0, 0, 0} +}; +static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { + __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 69, __pyx_L1_error) + __pyx_builtin_DeprecationWarning = __Pyx_GetBuiltinName(__pyx_n_s_DeprecationWarning); if (!__pyx_builtin_DeprecationWarning) __PYX_ERR(0, 130, __pyx_L1_error) + __pyx_builtin_hex = __Pyx_GetBuiltinName(__pyx_n_s_hex); if (!__pyx_builtin_hex) __PYX_ERR(0, 181, __pyx_L1_error) + __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(0, 181, __pyx_L1_error) + __pyx_builtin_StopIteration = __Pyx_GetBuiltinName(__pyx_n_s_StopIteration); if (!__pyx_builtin_StopIteration) __PYX_ERR(0, 406, __pyx_L1_error) + return 0; + __pyx_L1_error:; + return -1; +} + +static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); + + /* "src/gevent/queue.py":128 + * if maxsize == 0: + * import warnings + * warnings.warn( # <<<<<<<<<<<<<< + * 'Queue(0) now equivalent to Queue(None); if you want a channel, use Channel', + * DeprecationWarning, + */ + __pyx_tuple_ = PyTuple_Pack(2, __pyx_kp_s_Queue_0_now_equivalent_to_Queue, __pyx_builtin_DeprecationWarning); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 128, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple_); + __Pyx_GIVEREF(__pyx_tuple_); + + /* "src/gevent/queue.py":421 + * def __init__(self, maxsize=None, items=()): + * if maxsize is not None: + * raise ValueError("UnboundQueue has no maxsize") # <<<<<<<<<<<<<< + * Queue.__init__(self, maxsize, items) + * self.putters = None # Will never be used. + */ + __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s_UnboundQueue_has_no_maxsize); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 421, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__4); + __Pyx_GIVEREF(__pyx_tuple__4); + + /* "src/gevent/queue.py":535 + * ''' + * if self.unfinished_tasks <= 0: + * raise ValueError('task_done() called too many times') # <<<<<<<<<<<<<< + * self.unfinished_tasks -= 1 + * if self.unfinished_tasks == 0: + */ + __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_s_task_done_called_too_many_times); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 535, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__5); + __Pyx_GIVEREF(__pyx_tuple__5); + + /* "src/gevent/queue.py":573 + * # We take maxsize to simplify certain kinds of code + * if maxsize != 1: + * raise ValueError("Channels have a maxsize of 1") # <<<<<<<<<<<<<< + * self.getters = collections.deque() + * self.putters = collections.deque() + */ + __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_s_Channels_have_a_maxsize_of_1); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 573, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__6); + __Pyx_GIVEREF(__pyx_tuple__6); + + /* "src/gevent/queue.py":78 + * # pylint:disable=assigning-non-slot + * __slots__ = ( + * 'item', # <<<<<<<<<<<<<< + * 'queue', + * ) + */ + __pyx_tuple__7 = PyTuple_Pack(2, __pyx_n_s_item, __pyx_n_s_queue); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 78, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__7); + __Pyx_GIVEREF(__pyx_tuple__7); + + /* "src/gevent/queue.py":87 + * self.queue = queue + * + * def put_and_switch(self): # <<<<<<<<<<<<<< + * self.queue._put(self.item) + * self.queue = None + */ + __pyx_tuple__8 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 87, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__8); + __Pyx_GIVEREF(__pyx_tuple__8); + __pyx_codeobj__9 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__8, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_queue_py, __pyx_n_s_put_and_switch, 87, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__9)) __PYX_ERR(0, 87, __pyx_L1_error) + + /* "src/gevent/queue.py":115 + * + * __slots__ = ( + * '_maxsize', # <<<<<<<<<<<<<< + * 'getters', + * 'putters', + */ + __pyx_tuple__10 = PyTuple_Pack(7, __pyx_n_s_maxsize_2, __pyx_n_s_getters, __pyx_n_s_putters, __pyx_n_s_hub, __pyx_n_s_event_unlock, __pyx_n_s_queue, __pyx_n_s_weakref); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 115, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__10); + __Pyx_GIVEREF(__pyx_tuple__10); + + /* "src/gevent/queue.py":165 + * self._maxsize = nv + * + * def copy(self): # <<<<<<<<<<<<<< + * return type(self)(self.maxsize, self.queue) + * + */ + __pyx_tuple__11 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 165, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__11); + __Pyx_GIVEREF(__pyx_tuple__11); + __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__11, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_queue_py, __pyx_n_s_copy, 165, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(0, 165, __pyx_L1_error) + + /* "src/gevent/queue.py":168 + * return type(self)(self.maxsize, self.queue) + * + * def _create_queue(self, items=()): # <<<<<<<<<<<<<< + * return collections.deque(items) + * + */ + __pyx_tuple__13 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_items); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 168, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__13); + __Pyx_GIVEREF(__pyx_tuple__13); + __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__13, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_queue_py, __pyx_n_s_create_queue, 168, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__14)) __PYX_ERR(0, 168, __pyx_L1_error) + + /* "src/gevent/queue.py":171 + * return collections.deque(items) + * + * def _get(self): # <<<<<<<<<<<<<< + * return self.queue.popleft() + * + */ + __pyx_tuple__15 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(0, 171, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__15); + __Pyx_GIVEREF(__pyx_tuple__15); + __pyx_codeobj__16 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__15, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_queue_py, __pyx_n_s_get, 171, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__16)) __PYX_ERR(0, 171, __pyx_L1_error) + + /* "src/gevent/queue.py":174 + * return self.queue.popleft() + * + * def _peek(self): # <<<<<<<<<<<<<< + * return self.queue[0] + * + */ + __pyx_tuple__17 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(0, 174, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__17); + __Pyx_GIVEREF(__pyx_tuple__17); + __pyx_codeobj__18 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__17, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_queue_py, __pyx_n_s_peek, 174, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__18)) __PYX_ERR(0, 174, __pyx_L1_error) + + /* "src/gevent/queue.py":177 + * return self.queue[0] + * + * def _put(self, item): # <<<<<<<<<<<<<< + * self.queue.append(item) + * + */ + __pyx_tuple__19 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_item); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(0, 177, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__19); + __Pyx_GIVEREF(__pyx_tuple__19); + __pyx_codeobj__20 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__19, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_queue_py, __pyx_n_s_put, 177, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__20)) __PYX_ERR(0, 177, __pyx_L1_error) + + /* "src/gevent/queue.py":186 + * return '<%s%s>' % (type(self).__name__, self._format()) + * + * def _format(self): # <<<<<<<<<<<<<< + * result = [] + * if self.maxsize is not None: + */ + __pyx_tuple__21 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_result); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(0, 186, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__21); + __Pyx_GIVEREF(__pyx_tuple__21); + __pyx_codeobj__22 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__21, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_queue_py, __pyx_n_s_format, 186, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__22)) __PYX_ERR(0, 186, __pyx_L1_error) + + /* "src/gevent/queue.py":200 + * return '' + * + * def qsize(self): # <<<<<<<<<<<<<< + * """Return the size of the queue.""" + * return len(self.queue) + */ + __pyx_tuple__23 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(0, 200, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__23); + __Pyx_GIVEREF(__pyx_tuple__23); + __pyx_codeobj__24 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__23, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_queue_py, __pyx_n_s_qsize, 200, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__24)) __PYX_ERR(0, 200, __pyx_L1_error) + + /* "src/gevent/queue.py":232 + * return True + * + * def empty(self): # <<<<<<<<<<<<<< + * """Return ``True`` if the queue is empty, ``False`` otherwise.""" + * return not self.qsize() + */ + __pyx_tuple__25 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(0, 232, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__25); + __Pyx_GIVEREF(__pyx_tuple__25); + __pyx_codeobj__26 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__25, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_queue_py, __pyx_n_s_empty, 232, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__26)) __PYX_ERR(0, 232, __pyx_L1_error) + + /* "src/gevent/queue.py":236 + * return not self.qsize() + * + * def full(self): # <<<<<<<<<<<<<< + * """Return ``True`` if the queue is full, ``False`` otherwise. + * + */ + __pyx_tuple__27 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(0, 236, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__27); + __Pyx_GIVEREF(__pyx_tuple__27); + __pyx_codeobj__28 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__27, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_queue_py, __pyx_n_s_full, 236, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__28)) __PYX_ERR(0, 236, __pyx_L1_error) + + /* "src/gevent/queue.py":243 + * return self._maxsize > 0 and self.qsize() >= self._maxsize + * + * def put(self, item, block=True, timeout=None): # <<<<<<<<<<<<<< + * """Put an item into the queue. + * + */ + __pyx_tuple__29 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_item, __pyx_n_s_block, __pyx_n_s_timeout); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(0, 243, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__29); + __Pyx_GIVEREF(__pyx_tuple__29); + __pyx_codeobj__30 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__29, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_queue_py, __pyx_n_s_put_2, 243, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__30)) __PYX_ERR(0, 243, __pyx_L1_error) + + /* "src/gevent/queue.py":285 + * raise Full + * + * def put_nowait(self, item): # <<<<<<<<<<<<<< + * """Put an item into the queue without blocking. + * + */ + __pyx_tuple__31 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_item); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(0, 285, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__31); + __Pyx_GIVEREF(__pyx_tuple__31); + __pyx_codeobj__32 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__31, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_queue_py, __pyx_n_s_put_nowait, 285, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__32)) __PYX_ERR(0, 285, __pyx_L1_error) + + /* "src/gevent/queue.py":329 + * _safe_remove(self.getters, waiter) + * + * def get(self, block=True, timeout=None): # <<<<<<<<<<<<<< + * """Remove and return an item from the queue. + * + */ + __pyx_tuple__33 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_block, __pyx_n_s_timeout); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(0, 329, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__33); + __Pyx_GIVEREF(__pyx_tuple__33); + __pyx_codeobj__34 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__33, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_queue_py, __pyx_n_s_get_2, 329, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__34)) __PYX_ERR(0, 329, __pyx_L1_error) + + /* "src/gevent/queue.py":346 + * return self.__get_or_peek(self._get, block, timeout) + * + * def get_nowait(self): # <<<<<<<<<<<<<< + * """Remove and return an item from the queue without blocking. + * + */ + __pyx_tuple__35 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(0, 346, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__35); + __Pyx_GIVEREF(__pyx_tuple__35); + __pyx_codeobj__36 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__35, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_queue_py, __pyx_n_s_get_nowait, 346, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__36)) __PYX_ERR(0, 346, __pyx_L1_error) + + /* "src/gevent/queue.py":354 + * return self.get(False) + * + * def peek(self, block=True, timeout=None): # <<<<<<<<<<<<<< + * """Return an item from the queue without removing it. + * + */ + __pyx_tuple__37 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_block, __pyx_n_s_timeout); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(0, 354, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__37); + __Pyx_GIVEREF(__pyx_tuple__37); + __pyx_codeobj__38 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__37, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_queue_py, __pyx_n_s_peek_2, 354, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__38)) __PYX_ERR(0, 354, __pyx_L1_error) + + /* "src/gevent/queue.py":370 + * return self.__get_or_peek(self._peek, block, timeout) + * + * def peek_nowait(self): # <<<<<<<<<<<<<< + * """Return an item from the queue without blocking. + * + */ + __pyx_tuple__39 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__39)) __PYX_ERR(0, 370, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__39); + __Pyx_GIVEREF(__pyx_tuple__39); + __pyx_codeobj__40 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__39, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_queue_py, __pyx_n_s_peek_nowait, 370, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__40)) __PYX_ERR(0, 370, __pyx_L1_error) + + /* "src/gevent/queue.py":378 + * return self.peek(False) + * + * def _unlock(self): # <<<<<<<<<<<<<< + * while True: + * repeat = False + */ + __pyx_tuple__41 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_repeat, __pyx_n_s_putter, __pyx_n_s_getter); if (unlikely(!__pyx_tuple__41)) __PYX_ERR(0, 378, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__41); + __Pyx_GIVEREF(__pyx_tuple__41); + __pyx_codeobj__42 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__41, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_queue_py, __pyx_n_s_unlock, 378, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__42)) __PYX_ERR(0, 378, __pyx_L1_error) + + /* "src/gevent/queue.py":425 + * self.putters = None # Will never be used. + * + * def put(self, item, block=True, timeout=None): # <<<<<<<<<<<<<< + * self._put(item) + * if self.getters: + */ + __pyx_tuple__43 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_item, __pyx_n_s_block, __pyx_n_s_timeout); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(0, 425, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__43); + __Pyx_GIVEREF(__pyx_tuple__43); + __pyx_codeobj__44 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__43, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_queue_py, __pyx_n_s_put_2, 425, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__44)) __PYX_ERR(0, 425, __pyx_L1_error) + + /* "src/gevent/queue.py":444 + * __slots__ = () + * + * def _create_queue(self, items=()): # <<<<<<<<<<<<<< + * q = list(items) + * _heapify(q) + */ + __pyx_tuple__45 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_items, __pyx_n_s_q); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(0, 444, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__45); + __Pyx_GIVEREF(__pyx_tuple__45); + __pyx_codeobj__46 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__45, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_queue_py, __pyx_n_s_create_queue, 444, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__46)) __PYX_ERR(0, 444, __pyx_L1_error) + + /* "src/gevent/queue.py":449 + * return q + * + * def _put(self, item): # <<<<<<<<<<<<<< + * _heappush(self.queue, item) + * + */ + __pyx_tuple__47 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_item); if (unlikely(!__pyx_tuple__47)) __PYX_ERR(0, 449, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__47); + __Pyx_GIVEREF(__pyx_tuple__47); + __pyx_codeobj__48 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__47, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_queue_py, __pyx_n_s_put, 449, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__48)) __PYX_ERR(0, 449, __pyx_L1_error) + + /* "src/gevent/queue.py":452 + * _heappush(self.queue, item) + * + * def _get(self): # <<<<<<<<<<<<<< + * return _heappop(self.queue) + * + */ + __pyx_tuple__49 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__49)) __PYX_ERR(0, 452, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__49); + __Pyx_GIVEREF(__pyx_tuple__49); + __pyx_codeobj__50 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__49, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_queue_py, __pyx_n_s_get, 452, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__50)) __PYX_ERR(0, 452, __pyx_L1_error) + + /* "src/gevent/queue.py":461 + * __slots__ = () + * + * def _create_queue(self, items=()): # <<<<<<<<<<<<<< + * return list(items) + * + */ + __pyx_tuple__51 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_items); if (unlikely(!__pyx_tuple__51)) __PYX_ERR(0, 461, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__51); + __Pyx_GIVEREF(__pyx_tuple__51); + __pyx_codeobj__52 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__51, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_queue_py, __pyx_n_s_create_queue, 461, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__52)) __PYX_ERR(0, 461, __pyx_L1_error) + + /* "src/gevent/queue.py":464 + * return list(items) + * + * def _put(self, item): # <<<<<<<<<<<<<< + * self.queue.append(item) + * + */ + __pyx_tuple__53 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_item); if (unlikely(!__pyx_tuple__53)) __PYX_ERR(0, 464, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__53); + __Pyx_GIVEREF(__pyx_tuple__53); + __pyx_codeobj__54 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__53, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_queue_py, __pyx_n_s_put, 464, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__54)) __PYX_ERR(0, 464, __pyx_L1_error) + + /* "src/gevent/queue.py":467 + * self.queue.append(item) + * + * def _get(self): # <<<<<<<<<<<<<< + * return self.queue.pop() + * + */ + __pyx_tuple__55 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__55)) __PYX_ERR(0, 467, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__55); + __Pyx_GIVEREF(__pyx_tuple__55); + __pyx_codeobj__56 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__55, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_queue_py, __pyx_n_s_get, 467, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__56)) __PYX_ERR(0, 467, __pyx_L1_error) + + /* "src/gevent/queue.py":470 + * return self.queue.pop() + * + * def _peek(self): # <<<<<<<<<<<<<< + * return self.queue[-1] + * + */ + __pyx_tuple__57 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__57)) __PYX_ERR(0, 470, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__57); + __Pyx_GIVEREF(__pyx_tuple__57); + __pyx_codeobj__58 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__57, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_queue_py, __pyx_n_s_peek, 470, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__58)) __PYX_ERR(0, 470, __pyx_L1_error) + + /* "src/gevent/queue.py":481 + * + * __slots__ = ( + * '_cond', # <<<<<<<<<<<<<< + * 'unfinished_tasks', + * ) + */ + __pyx_tuple__59 = PyTuple_Pack(2, __pyx_n_s_cond, __pyx_n_s_unfinished_tasks); if (unlikely(!__pyx_tuple__59)) __PYX_ERR(0, 481, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__59); + __Pyx_GIVEREF(__pyx_tuple__59); + + /* "src/gevent/queue.py":509 + * self._cond.clear() + * + * def copy(self): # <<<<<<<<<<<<<< + * return type(self)(self.maxsize, self.queue, self.unfinished_tasks) + * + */ + __pyx_tuple__60 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__60)) __PYX_ERR(0, 509, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__60); + __Pyx_GIVEREF(__pyx_tuple__60); + __pyx_codeobj__61 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__60, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_queue_py, __pyx_n_s_copy, 509, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__61)) __PYX_ERR(0, 509, __pyx_L1_error) + + /* "src/gevent/queue.py":512 + * return type(self)(self.maxsize, self.queue, self.unfinished_tasks) + * + * def _format(self): # <<<<<<<<<<<<<< + * result = Queue._format(self) + * if self.unfinished_tasks: + */ + __pyx_tuple__62 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_result); if (unlikely(!__pyx_tuple__62)) __PYX_ERR(0, 512, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__62); + __Pyx_GIVEREF(__pyx_tuple__62); + __pyx_codeobj__63 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__62, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_queue_py, __pyx_n_s_format, 512, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__63)) __PYX_ERR(0, 512, __pyx_L1_error) + + /* "src/gevent/queue.py":518 + * return result + * + * def _put(self, item): # <<<<<<<<<<<<<< + * Queue._put(self, item) + * self.unfinished_tasks += 1 + */ + __pyx_tuple__64 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_item); if (unlikely(!__pyx_tuple__64)) __PYX_ERR(0, 518, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__64); + __Pyx_GIVEREF(__pyx_tuple__64); + __pyx_codeobj__65 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__64, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_queue_py, __pyx_n_s_put, 518, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__65)) __PYX_ERR(0, 518, __pyx_L1_error) + + /* "src/gevent/queue.py":523 + * self._cond.clear() + * + * def task_done(self): # <<<<<<<<<<<<<< + * '''Indicate that a formerly enqueued task is complete. Used by queue consumer threads. + * For each :meth:`get ` used to fetch a task, a subsequent call to :meth:`task_done` tells the queue + */ + __pyx_tuple__66 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__66)) __PYX_ERR(0, 523, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__66); + __Pyx_GIVEREF(__pyx_tuple__66); + __pyx_codeobj__67 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__66, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_queue_py, __pyx_n_s_task_done, 523, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__67)) __PYX_ERR(0, 523, __pyx_L1_error) + + /* "src/gevent/queue.py":540 + * self._cond.set() + * + * def join(self, timeout=None): # <<<<<<<<<<<<<< + * ''' + * Block until all items in the queue have been gotten and processed. + */ + __pyx_tuple__68 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_timeout); if (unlikely(!__pyx_tuple__68)) __PYX_ERR(0, 540, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__68); + __Pyx_GIVEREF(__pyx_tuple__68); + __pyx_codeobj__69 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__68, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_queue_py, __pyx_n_s_join, 540, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__69)) __PYX_ERR(0, 540, __pyx_L1_error) + + /* "src/gevent/queue.py":563 + * + * __slots__ = ( + * 'getters', # <<<<<<<<<<<<<< + * 'putters', + * 'hub', + */ + __pyx_tuple__70 = PyTuple_Pack(5, __pyx_n_s_getters, __pyx_n_s_putters, __pyx_n_s_hub, __pyx_n_s_event_unlock, __pyx_n_s_weakref); if (unlikely(!__pyx_tuple__70)) __PYX_ERR(0, 563, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__70); + __Pyx_GIVEREF(__pyx_tuple__70); + + /* "src/gevent/queue.py":585 + * return '<%s %s>' % (type(self).__name__, self._format()) + * + * def _format(self): # <<<<<<<<<<<<<< + * result = '' + * if self.getters: + */ + __pyx_tuple__71 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_result); if (unlikely(!__pyx_tuple__71)) __PYX_ERR(0, 585, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__71); + __Pyx_GIVEREF(__pyx_tuple__71); + __pyx_codeobj__72 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__71, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_queue_py, __pyx_n_s_format, 585, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__72)) __PYX_ERR(0, 585, __pyx_L1_error) + + /* "src/gevent/queue.py":597 + * return len(self.putters) - len(self.getters) + * + * def qsize(self): # <<<<<<<<<<<<<< + * return 0 + * + */ + __pyx_tuple__73 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__73)) __PYX_ERR(0, 597, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__73); + __Pyx_GIVEREF(__pyx_tuple__73); + __pyx_codeobj__74 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__73, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_queue_py, __pyx_n_s_qsize, 597, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__74)) __PYX_ERR(0, 597, __pyx_L1_error) + + /* "src/gevent/queue.py":600 + * return 0 + * + * def empty(self): # <<<<<<<<<<<<<< + * return True + * + */ + __pyx_tuple__75 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__75)) __PYX_ERR(0, 600, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__75); + __Pyx_GIVEREF(__pyx_tuple__75); + __pyx_codeobj__76 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__75, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_queue_py, __pyx_n_s_empty, 600, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__76)) __PYX_ERR(0, 600, __pyx_L1_error) + + /* "src/gevent/queue.py":603 + * return True + * + * def full(self): # <<<<<<<<<<<<<< + * return True + * + */ + __pyx_tuple__77 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__77)) __PYX_ERR(0, 603, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__77); + __Pyx_GIVEREF(__pyx_tuple__77); + __pyx_codeobj__78 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__77, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_queue_py, __pyx_n_s_full, 603, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__78)) __PYX_ERR(0, 603, __pyx_L1_error) + + /* "src/gevent/queue.py":606 + * return True + * + * def put(self, item, block=True, timeout=None): # <<<<<<<<<<<<<< + * if self.hub is getcurrent(): + * if self.getters: + */ + __pyx_tuple__79 = PyTuple_Pack(7, __pyx_n_s_self, __pyx_n_s_item, __pyx_n_s_block, __pyx_n_s_timeout, __pyx_n_s_getter, __pyx_n_s_waiter_2, __pyx_n_s_result); if (unlikely(!__pyx_tuple__79)) __PYX_ERR(0, 606, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__79); + __Pyx_GIVEREF(__pyx_tuple__79); + __pyx_codeobj__80 = (PyObject*)__Pyx_PyCode_New(4, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__79, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_queue_py, __pyx_n_s_put_2, 606, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__80)) __PYX_ERR(0, 606, __pyx_L1_error) + + /* "src/gevent/queue.py":633 + * timeout.cancel() + * + * def put_nowait(self, item): # <<<<<<<<<<<<<< + * self.put(item, False) + * + */ + __pyx_tuple__81 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_item); if (unlikely(!__pyx_tuple__81)) __PYX_ERR(0, 633, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__81); + __Pyx_GIVEREF(__pyx_tuple__81); + __pyx_codeobj__82 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__81, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_queue_py, __pyx_n_s_put_nowait, 633, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__82)) __PYX_ERR(0, 633, __pyx_L1_error) + + /* "src/gevent/queue.py":636 + * self.put(item, False) + * + * def get(self, block=True, timeout=None): # <<<<<<<<<<<<<< + * if self.hub is getcurrent(): + * if self.putters: + */ + __pyx_tuple__83 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_block, __pyx_n_s_timeout); if (unlikely(!__pyx_tuple__83)) __PYX_ERR(0, 636, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__83); + __Pyx_GIVEREF(__pyx_tuple__83); + __pyx_codeobj__84 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__83, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_queue_py, __pyx_n_s_get_2, 636, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__84)) __PYX_ERR(0, 636, __pyx_L1_error) + + /* "src/gevent/queue.py":659 + * timeout.close() + * + * def get_nowait(self): # <<<<<<<<<<<<<< + * return self.get(False) + * + */ + __pyx_tuple__85 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__85)) __PYX_ERR(0, 659, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__85); + __Pyx_GIVEREF(__pyx_tuple__85); + __pyx_codeobj__86 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__85, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_queue_py, __pyx_n_s_get_nowait, 659, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__86)) __PYX_ERR(0, 659, __pyx_L1_error) + + /* "src/gevent/queue.py":662 + * return self.get(False) + * + * def _unlock(self): # <<<<<<<<<<<<<< + * while self.putters and self.getters: + * getter = self.getters.popleft() + */ + __pyx_tuple__87 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_getter, __pyx_n_s_item, __pyx_n_s_putter); if (unlikely(!__pyx_tuple__87)) __PYX_ERR(0, 662, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__87); + __Pyx_GIVEREF(__pyx_tuple__87); + __pyx_codeobj__88 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__87, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_queue_py, __pyx_n_s_unlock, 662, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__88)) __PYX_ERR(0, 662, __pyx_L1_error) + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} + +static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { + __pyx_umethod_PyList_Type_pop.type = (PyObject*)&PyList_Type; + if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) __PYX_ERR(0, 1, __pyx_L1_error) + return 0; + __pyx_L1_error:; + return -1; +} + +static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/ + +static int __Pyx_modinit_global_init_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); + /*--- Global init code ---*/ + __pyx_v_6gevent_6_queue__heappush = Py_None; Py_INCREF(Py_None); + __pyx_v_6gevent_6_queue__heappop = Py_None; Py_INCREF(Py_None); + __pyx_v_6gevent_6_queue__heapify = Py_None; Py_INCREF(Py_None); + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_variable_export_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); + /*--- Variable export code ---*/ + if (__Pyx_ExportVoidPtr(__pyx_n_s_heappush, (void *)&__pyx_v_6gevent_6_queue__heappush, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportVoidPtr(__pyx_n_s_heappop, (void *)&__pyx_v_6gevent_6_queue__heappop, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportVoidPtr(__pyx_n_s_heapify, (void *)&__pyx_v_6gevent_6_queue__heapify, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_modinit_function_export_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); + /*--- Function export code ---*/ + if (__Pyx_ExportFunction("_safe_remove", (void (*)(void))__pyx_f_6gevent_6_queue__safe_remove, "PyObject *(PyObject *, PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_modinit_type_init_code(void) { + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); + /*--- Type init code ---*/ + __pyx_t_1 = PyImport_ImportModule("gevent.__waiter"); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_ptype_6gevent_8__waiter_Waiter = __Pyx_ImportType(__pyx_t_1, "gevent.__waiter", "Waiter", sizeof(struct __pyx_obj_6gevent_8__waiter_Waiter), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_8__waiter_Waiter) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_vtabptr_6gevent_8__waiter_Waiter = (struct __pyx_vtabstruct_6gevent_8__waiter_Waiter*)__Pyx_GetVtable(__pyx_ptype_6gevent_8__waiter_Waiter->tp_dict); if (unlikely(!__pyx_vtabptr_6gevent_8__waiter_Waiter)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_vtabptr_6gevent_6_queue_ItemWaiter = &__pyx_vtable_6gevent_6_queue_ItemWaiter; + __pyx_vtable_6gevent_6_queue_ItemWaiter.__pyx_base = *__pyx_vtabptr_6gevent_8__waiter_Waiter; + __pyx_type_6gevent_6_queue_ItemWaiter.tp_base = __pyx_ptype_6gevent_8__waiter_Waiter; + if (PyType_Ready(&__pyx_type_6gevent_6_queue_ItemWaiter) < 0) __PYX_ERR(0, 75, __pyx_L1_error) + __pyx_type_6gevent_6_queue_ItemWaiter.tp_print = 0; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6gevent_6_queue_ItemWaiter.tp_dictoffset && __pyx_type_6gevent_6_queue_ItemWaiter.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_type_6gevent_6_queue_ItemWaiter.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + } + if (__Pyx_SetVtable(__pyx_type_6gevent_6_queue_ItemWaiter.tp_dict, __pyx_vtabptr_6gevent_6_queue_ItemWaiter) < 0) __PYX_ERR(0, 75, __pyx_L1_error) + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_ItemWaiter, (PyObject *)&__pyx_type_6gevent_6_queue_ItemWaiter) < 0) __PYX_ERR(0, 75, __pyx_L1_error) + __pyx_ptype_6gevent_6_queue_ItemWaiter = &__pyx_type_6gevent_6_queue_ItemWaiter; + __pyx_vtabptr_6gevent_6_queue_Queue = &__pyx_vtable_6gevent_6_queue_Queue; + __pyx_vtable_6gevent_6_queue_Queue._get = (PyObject *(*)(struct __pyx_obj_6gevent_6_queue_Queue *, int __pyx_skip_dispatch))__pyx_f_6gevent_6_queue_5Queue__get; + __pyx_vtable_6gevent_6_queue_Queue._put = (PyObject *(*)(struct __pyx_obj_6gevent_6_queue_Queue *, PyObject *, int __pyx_skip_dispatch))__pyx_f_6gevent_6_queue_5Queue__put; + __pyx_vtable_6gevent_6_queue_Queue._peek = (PyObject *(*)(struct __pyx_obj_6gevent_6_queue_Queue *, int __pyx_skip_dispatch))__pyx_f_6gevent_6_queue_5Queue__peek; + __pyx_vtable_6gevent_6_queue_Queue.qsize = (Py_ssize_t (*)(struct __pyx_obj_6gevent_6_queue_Queue *, int __pyx_skip_dispatch))__pyx_f_6gevent_6_queue_5Queue_qsize; + __pyx_vtable_6gevent_6_queue_Queue.empty = (int (*)(struct __pyx_obj_6gevent_6_queue_Queue *, int __pyx_skip_dispatch))__pyx_f_6gevent_6_queue_5Queue_empty; + __pyx_vtable_6gevent_6_queue_Queue.full = (int (*)(struct __pyx_obj_6gevent_6_queue_Queue *, int __pyx_skip_dispatch))__pyx_f_6gevent_6_queue_5Queue_full; + __pyx_vtable_6gevent_6_queue_Queue.put = (PyObject *(*)(struct __pyx_obj_6gevent_6_queue_Queue *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_6_queue_5Queue_put *__pyx_optional_args))__pyx_f_6gevent_6_queue_5Queue_put; + __pyx_vtable_6gevent_6_queue_Queue.put_nowait = (PyObject *(*)(struct __pyx_obj_6gevent_6_queue_Queue *, PyObject *, int __pyx_skip_dispatch))__pyx_f_6gevent_6_queue_5Queue_put_nowait; + __pyx_vtable_6gevent_6_queue_Queue.__pyx___get_or_peek = (PyObject *(*)(struct __pyx_obj_6gevent_6_queue_Queue *, PyObject *, PyObject *, PyObject *))__pyx_f_6gevent_6_queue_5Queue___get_or_peek; + __pyx_vtable_6gevent_6_queue_Queue.get = (PyObject *(*)(struct __pyx_obj_6gevent_6_queue_Queue *, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_6_queue_5Queue_get *__pyx_optional_args))__pyx_f_6gevent_6_queue_5Queue_get; + __pyx_vtable_6gevent_6_queue_Queue.get_nowait = (PyObject *(*)(struct __pyx_obj_6gevent_6_queue_Queue *, int __pyx_skip_dispatch))__pyx_f_6gevent_6_queue_5Queue_get_nowait; + __pyx_vtable_6gevent_6_queue_Queue.peek = (PyObject *(*)(struct __pyx_obj_6gevent_6_queue_Queue *, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_6_queue_5Queue_peek *__pyx_optional_args))__pyx_f_6gevent_6_queue_5Queue_peek; + __pyx_vtable_6gevent_6_queue_Queue.peek_nowait = (PyObject *(*)(struct __pyx_obj_6gevent_6_queue_Queue *, int __pyx_skip_dispatch))__pyx_f_6gevent_6_queue_5Queue_peek_nowait; + __pyx_vtable_6gevent_6_queue_Queue._schedule_unlock = (PyObject *(*)(struct __pyx_obj_6gevent_6_queue_Queue *))__pyx_f_6gevent_6_queue_5Queue__schedule_unlock; + if (PyType_Ready(&__pyx_type_6gevent_6_queue_Queue) < 0) __PYX_ERR(0, 93, __pyx_L1_error) + __pyx_type_6gevent_6_queue_Queue.tp_print = 0; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6gevent_6_queue_Queue.tp_dictoffset && __pyx_type_6gevent_6_queue_Queue.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_type_6gevent_6_queue_Queue.tp_getattro = __Pyx_PyObject_GenericGetAttr; + } + #if CYTHON_COMPILING_IN_CPYTHON + { + PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_6gevent_6_queue_Queue, "__len__"); if (unlikely(!wrapper)) __PYX_ERR(0, 93, __pyx_L1_error) + if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) { + __pyx_wrapperbase_6gevent_6_queue_5Queue_20__len__ = *((PyWrapperDescrObject *)wrapper)->d_base; + __pyx_wrapperbase_6gevent_6_queue_5Queue_20__len__.doc = __pyx_doc_6gevent_6_queue_5Queue_20__len__; + ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_6gevent_6_queue_5Queue_20__len__; + } + } + #endif + if (__Pyx_SetVtable(__pyx_type_6gevent_6_queue_Queue.tp_dict, __pyx_vtabptr_6gevent_6_queue_Queue) < 0) __PYX_ERR(0, 93, __pyx_L1_error) + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Queue, (PyObject *)&__pyx_type_6gevent_6_queue_Queue) < 0) __PYX_ERR(0, 93, __pyx_L1_error) + if (__pyx_type_6gevent_6_queue_Queue.tp_weaklistoffset == 0) __pyx_type_6gevent_6_queue_Queue.tp_weaklistoffset = offsetof(struct __pyx_obj_6gevent_6_queue_Queue, __weakref__); + __pyx_ptype_6gevent_6_queue_Queue = &__pyx_type_6gevent_6_queue_Queue; + __pyx_vtabptr_6gevent_6_queue_UnboundQueue = &__pyx_vtable_6gevent_6_queue_UnboundQueue; + __pyx_vtable_6gevent_6_queue_UnboundQueue.__pyx_base = *__pyx_vtabptr_6gevent_6_queue_Queue; + __pyx_vtable_6gevent_6_queue_UnboundQueue.__pyx_base.put = (PyObject *(*)(struct __pyx_obj_6gevent_6_queue_Queue *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_6_queue_5Queue_put *__pyx_optional_args))__pyx_f_6gevent_6_queue_12UnboundQueue_put; + __pyx_type_6gevent_6_queue_UnboundQueue.tp_base = __pyx_ptype_6gevent_6_queue_Queue; + if (PyType_Ready(&__pyx_type_6gevent_6_queue_UnboundQueue) < 0) __PYX_ERR(0, 413, __pyx_L1_error) + __pyx_type_6gevent_6_queue_UnboundQueue.tp_print = 0; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6gevent_6_queue_UnboundQueue.tp_dictoffset && __pyx_type_6gevent_6_queue_UnboundQueue.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_type_6gevent_6_queue_UnboundQueue.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + } + if (__Pyx_SetVtable(__pyx_type_6gevent_6_queue_UnboundQueue.tp_dict, __pyx_vtabptr_6gevent_6_queue_UnboundQueue) < 0) __PYX_ERR(0, 413, __pyx_L1_error) + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_UnboundQueue, (PyObject *)&__pyx_type_6gevent_6_queue_UnboundQueue) < 0) __PYX_ERR(0, 413, __pyx_L1_error) + if (__pyx_type_6gevent_6_queue_UnboundQueue.tp_weaklistoffset == 0) __pyx_type_6gevent_6_queue_UnboundQueue.tp_weaklistoffset = offsetof(struct __pyx_obj_6gevent_6_queue_UnboundQueue, __pyx_base.__weakref__); + __pyx_ptype_6gevent_6_queue_UnboundQueue = &__pyx_type_6gevent_6_queue_UnboundQueue; + __pyx_vtabptr_6gevent_6_queue_PriorityQueue = &__pyx_vtable_6gevent_6_queue_PriorityQueue; + __pyx_vtable_6gevent_6_queue_PriorityQueue.__pyx_base = *__pyx_vtabptr_6gevent_6_queue_Queue; + __pyx_vtable_6gevent_6_queue_PriorityQueue.__pyx_base._get = (PyObject *(*)(struct __pyx_obj_6gevent_6_queue_Queue *, int __pyx_skip_dispatch))__pyx_f_6gevent_6_queue_13PriorityQueue__get; + __pyx_vtable_6gevent_6_queue_PriorityQueue.__pyx_base._put = (PyObject *(*)(struct __pyx_obj_6gevent_6_queue_Queue *, PyObject *, int __pyx_skip_dispatch))__pyx_f_6gevent_6_queue_13PriorityQueue__put; + __pyx_type_6gevent_6_queue_PriorityQueue.tp_base = __pyx_ptype_6gevent_6_queue_Queue; + if (PyType_Ready(&__pyx_type_6gevent_6_queue_PriorityQueue) < 0) __PYX_ERR(0, 431, __pyx_L1_error) + __pyx_type_6gevent_6_queue_PriorityQueue.tp_print = 0; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6gevent_6_queue_PriorityQueue.tp_dictoffset && __pyx_type_6gevent_6_queue_PriorityQueue.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_type_6gevent_6_queue_PriorityQueue.tp_getattro = __Pyx_PyObject_GenericGetAttr; + } + if (__Pyx_SetVtable(__pyx_type_6gevent_6_queue_PriorityQueue.tp_dict, __pyx_vtabptr_6gevent_6_queue_PriorityQueue) < 0) __PYX_ERR(0, 431, __pyx_L1_error) + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_PriorityQueue, (PyObject *)&__pyx_type_6gevent_6_queue_PriorityQueue) < 0) __PYX_ERR(0, 431, __pyx_L1_error) + if (__pyx_type_6gevent_6_queue_PriorityQueue.tp_weaklistoffset == 0) __pyx_type_6gevent_6_queue_PriorityQueue.tp_weaklistoffset = offsetof(struct __pyx_obj_6gevent_6_queue_PriorityQueue, __pyx_base.__weakref__); + __pyx_ptype_6gevent_6_queue_PriorityQueue = &__pyx_type_6gevent_6_queue_PriorityQueue; + __pyx_vtabptr_6gevent_6_queue_LifoQueue = &__pyx_vtable_6gevent_6_queue_LifoQueue; + __pyx_vtable_6gevent_6_queue_LifoQueue.__pyx_base = *__pyx_vtabptr_6gevent_6_queue_Queue; + __pyx_vtable_6gevent_6_queue_LifoQueue.__pyx_base._get = (PyObject *(*)(struct __pyx_obj_6gevent_6_queue_Queue *, int __pyx_skip_dispatch))__pyx_f_6gevent_6_queue_9LifoQueue__get; + __pyx_vtable_6gevent_6_queue_LifoQueue.__pyx_base._put = (PyObject *(*)(struct __pyx_obj_6gevent_6_queue_Queue *, PyObject *, int __pyx_skip_dispatch))__pyx_f_6gevent_6_queue_9LifoQueue__put; + __pyx_vtable_6gevent_6_queue_LifoQueue.__pyx_base._peek = (PyObject *(*)(struct __pyx_obj_6gevent_6_queue_Queue *, int __pyx_skip_dispatch))__pyx_f_6gevent_6_queue_9LifoQueue__peek; + __pyx_type_6gevent_6_queue_LifoQueue.tp_base = __pyx_ptype_6gevent_6_queue_Queue; + if (PyType_Ready(&__pyx_type_6gevent_6_queue_LifoQueue) < 0) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_type_6gevent_6_queue_LifoQueue.tp_print = 0; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6gevent_6_queue_LifoQueue.tp_dictoffset && __pyx_type_6gevent_6_queue_LifoQueue.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_type_6gevent_6_queue_LifoQueue.tp_getattro = __Pyx_PyObject_GenericGetAttr; + } + if (__Pyx_SetVtable(__pyx_type_6gevent_6_queue_LifoQueue.tp_dict, __pyx_vtabptr_6gevent_6_queue_LifoQueue) < 0) __PYX_ERR(0, 456, __pyx_L1_error) + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_LifoQueue, (PyObject *)&__pyx_type_6gevent_6_queue_LifoQueue) < 0) __PYX_ERR(0, 456, __pyx_L1_error) + if (__pyx_type_6gevent_6_queue_LifoQueue.tp_weaklistoffset == 0) __pyx_type_6gevent_6_queue_LifoQueue.tp_weaklistoffset = offsetof(struct __pyx_obj_6gevent_6_queue_LifoQueue, __pyx_base.__weakref__); + __pyx_ptype_6gevent_6_queue_LifoQueue = &__pyx_type_6gevent_6_queue_LifoQueue; + __pyx_vtabptr_6gevent_6_queue_JoinableQueue = &__pyx_vtable_6gevent_6_queue_JoinableQueue; + __pyx_vtable_6gevent_6_queue_JoinableQueue.__pyx_base = *__pyx_vtabptr_6gevent_6_queue_Queue; + __pyx_vtable_6gevent_6_queue_JoinableQueue.__pyx_base._put = (PyObject *(*)(struct __pyx_obj_6gevent_6_queue_Queue *, PyObject *, int __pyx_skip_dispatch))__pyx_f_6gevent_6_queue_13JoinableQueue__put; + __pyx_type_6gevent_6_queue_JoinableQueue.tp_base = __pyx_ptype_6gevent_6_queue_Queue; + if (PyType_Ready(&__pyx_type_6gevent_6_queue_JoinableQueue) < 0) __PYX_ERR(0, 474, __pyx_L1_error) + __pyx_type_6gevent_6_queue_JoinableQueue.tp_print = 0; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6gevent_6_queue_JoinableQueue.tp_dictoffset && __pyx_type_6gevent_6_queue_JoinableQueue.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_type_6gevent_6_queue_JoinableQueue.tp_getattro = __Pyx_PyObject_GenericGetAttr; + } + #if CYTHON_COMPILING_IN_CPYTHON + { + PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_6gevent_6_queue_JoinableQueue, "__init__"); if (unlikely(!wrapper)) __PYX_ERR(0, 474, __pyx_L1_error) + if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) { + __pyx_wrapperbase_6gevent_6_queue_13JoinableQueue___init__ = *((PyWrapperDescrObject *)wrapper)->d_base; + __pyx_wrapperbase_6gevent_6_queue_13JoinableQueue___init__.doc = __pyx_doc_6gevent_6_queue_13JoinableQueue___init__; + ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_6gevent_6_queue_13JoinableQueue___init__; + } + } + #endif + if (__Pyx_SetVtable(__pyx_type_6gevent_6_queue_JoinableQueue.tp_dict, __pyx_vtabptr_6gevent_6_queue_JoinableQueue) < 0) __PYX_ERR(0, 474, __pyx_L1_error) + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_JoinableQueue, (PyObject *)&__pyx_type_6gevent_6_queue_JoinableQueue) < 0) __PYX_ERR(0, 474, __pyx_L1_error) + if (__pyx_type_6gevent_6_queue_JoinableQueue.tp_weaklistoffset == 0) __pyx_type_6gevent_6_queue_JoinableQueue.tp_weaklistoffset = offsetof(struct __pyx_obj_6gevent_6_queue_JoinableQueue, __pyx_base.__weakref__); + __pyx_ptype_6gevent_6_queue_JoinableQueue = &__pyx_type_6gevent_6_queue_JoinableQueue; + __pyx_vtabptr_6gevent_6_queue_Channel = &__pyx_vtable_6gevent_6_queue_Channel; + __pyx_vtable_6gevent_6_queue_Channel.get = (PyObject *(*)(struct __pyx_obj_6gevent_6_queue_Channel *, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_6_queue_7Channel_get *__pyx_optional_args))__pyx_f_6gevent_6_queue_7Channel_get; + __pyx_vtable_6gevent_6_queue_Channel.get_nowait = (PyObject *(*)(struct __pyx_obj_6gevent_6_queue_Channel *, int __pyx_skip_dispatch))__pyx_f_6gevent_6_queue_7Channel_get_nowait; + __pyx_vtable_6gevent_6_queue_Channel._schedule_unlock = (PyObject *(*)(struct __pyx_obj_6gevent_6_queue_Channel *))__pyx_f_6gevent_6_queue_7Channel__schedule_unlock; + if (PyType_Ready(&__pyx_type_6gevent_6_queue_Channel) < 0) __PYX_ERR(0, 560, __pyx_L1_error) + __pyx_type_6gevent_6_queue_Channel.tp_print = 0; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6gevent_6_queue_Channel.tp_dictoffset && __pyx_type_6gevent_6_queue_Channel.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_type_6gevent_6_queue_Channel.tp_getattro = __Pyx_PyObject_GenericGetAttr; + } + if (__Pyx_SetVtable(__pyx_type_6gevent_6_queue_Channel.tp_dict, __pyx_vtabptr_6gevent_6_queue_Channel) < 0) __PYX_ERR(0, 560, __pyx_L1_error) + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Channel, (PyObject *)&__pyx_type_6gevent_6_queue_Channel) < 0) __PYX_ERR(0, 560, __pyx_L1_error) + if (__pyx_type_6gevent_6_queue_Channel.tp_weaklistoffset == 0) __pyx_type_6gevent_6_queue_Channel.tp_weaklistoffset = offsetof(struct __pyx_obj_6gevent_6_queue_Channel, __weakref__); + __pyx_ptype_6gevent_6_queue_Channel = &__pyx_type_6gevent_6_queue_Channel; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_modinit_type_import_code(void) { + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); + /*--- Type import code ---*/ + __pyx_t_1 = PyImport_ImportModule("greenlet"); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_ptype_6gevent_21__greenlet_primitives_greenlet = __Pyx_ImportType(__pyx_t_1, "greenlet", "greenlet", sizeof(PyGreenlet), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_21__greenlet_primitives_greenlet) __PYX_ERR(2, 12, __pyx_L1_error) + __pyx_t_2 = PyImport_ImportModule("gevent.__greenlet_primitives"); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 37, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_ptype_6gevent_21__greenlet_primitives_TrackedRawGreenlet = __Pyx_ImportType(__pyx_t_2, "gevent.__greenlet_primitives", "TrackedRawGreenlet", sizeof(struct __pyx_obj_6gevent_21__greenlet_primitives_TrackedRawGreenlet), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_21__greenlet_primitives_TrackedRawGreenlet) __PYX_ERR(2, 37, __pyx_L1_error) + __pyx_ptype_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop = __Pyx_ImportType(__pyx_t_2, "gevent.__greenlet_primitives", "SwitchOutGreenletWithLoop", sizeof(struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop) __PYX_ERR(2, 40, __pyx_L1_error) + __pyx_vtabptr_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop = (struct __pyx_vtabstruct_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop*)__Pyx_GetVtable(__pyx_ptype_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop->tp_dict); if (unlikely(!__pyx_vtabptr_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop)) __PYX_ERR(2, 40, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyImport_ImportModule("greenlet"); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 15, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_ptype_6gevent_8__waiter_greenlet = __Pyx_ImportType(__pyx_t_2, "greenlet", "greenlet", sizeof(PyGreenlet), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_8__waiter_greenlet) __PYX_ERR(3, 15, __pyx_L1_error) + __pyx_t_1 = PyImport_ImportModule("gevent.__waiter"); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 47, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_ptype_6gevent_8__waiter_MultipleWaiter = __Pyx_ImportType(__pyx_t_1, "gevent.__waiter", "MultipleWaiter", sizeof(struct __pyx_obj_6gevent_8__waiter_MultipleWaiter), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_8__waiter_MultipleWaiter) __PYX_ERR(3, 47, __pyx_L1_error) + __pyx_vtabptr_6gevent_8__waiter_MultipleWaiter = (struct __pyx_vtabstruct_6gevent_8__waiter_MultipleWaiter*)__Pyx_GetVtable(__pyx_ptype_6gevent_8__waiter_MultipleWaiter->tp_dict); if (unlikely(!__pyx_vtabptr_6gevent_8__waiter_MultipleWaiter)) __PYX_ERR(3, 47, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyImport_ImportModule("greenlet"); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_ptype_6gevent_19__abstract_linkable_greenlet = __Pyx_ImportType(__pyx_t_1, "greenlet", "greenlet", sizeof(PyGreenlet), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_19__abstract_linkable_greenlet) __PYX_ERR(4, 12, __pyx_L1_error) + __pyx_t_2 = PyImport_ImportModule("gevent.__abstract_linkable"); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 32, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_ptype_6gevent_19__abstract_linkable_AbstractLinkable = __Pyx_ImportType(__pyx_t_2, "gevent.__abstract_linkable", "AbstractLinkable", sizeof(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_19__abstract_linkable_AbstractLinkable) __PYX_ERR(4, 32, __pyx_L1_error) + __pyx_vtabptr_6gevent_19__abstract_linkable_AbstractLinkable = (struct __pyx_vtabstruct_6gevent_19__abstract_linkable_AbstractLinkable*)__Pyx_GetVtable(__pyx_ptype_6gevent_19__abstract_linkable_AbstractLinkable->tp_dict); if (unlikely(!__pyx_vtabptr_6gevent_19__abstract_linkable_AbstractLinkable)) __PYX_ERR(4, 32, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyImport_ImportModule("gevent._event"); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_ptype_6gevent_6_event_Event = __Pyx_ImportType(__pyx_t_2, "gevent._event", "Event", sizeof(struct __pyx_obj_6gevent_6_event_Event), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_6_event_Event) __PYX_ERR(5, 13, __pyx_L1_error) + __pyx_vtabptr_6gevent_6_event_Event = (struct __pyx_vtabstruct_6gevent_6_event_Event*)__Pyx_GetVtable(__pyx_ptype_6gevent_6_event_Event->tp_dict); if (unlikely(!__pyx_vtabptr_6gevent_6_event_Event)) __PYX_ERR(5, 13, __pyx_L1_error) + __pyx_ptype_6gevent_6_event_AsyncResult = __Pyx_ImportType(__pyx_t_2, "gevent._event", "AsyncResult", sizeof(struct __pyx_obj_6gevent_6_event_AsyncResult), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_6_event_AsyncResult) __PYX_ERR(5, 16, __pyx_L1_error) + __pyx_vtabptr_6gevent_6_event_AsyncResult = (struct __pyx_vtabstruct_6gevent_6_event_AsyncResult*)__Pyx_GetVtable(__pyx_ptype_6gevent_6_event_AsyncResult->tp_dict); if (unlikely(!__pyx_vtabptr_6gevent_6_event_AsyncResult)) __PYX_ERR(5, 16, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_modinit_variable_import_code(void) { + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); + /*--- Variable import code ---*/ + __pyx_t_1 = PyImport_ImportModule("gevent.__greenlet_primitives"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_1, "get_objects", (void **)&__pyx_vp_6gevent_21__greenlet_primitives_get_objects, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_1, "wref", (void **)&__pyx_vp_6gevent_21__greenlet_primitives_wref, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_1, "BlockingSwitchOutError", (void **)&__pyx_vp_6gevent_21__greenlet_primitives_BlockingSwitchOutError, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_1, "_greenlet_imported", (void **)&__pyx_vp_6gevent_21__greenlet_primitives__greenlet_imported, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + Py_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_2 = PyImport_ImportModule("gevent.__hub_local"); if (!__pyx_t_2) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_2, "_threadlocal", (void **)&__pyx_vp_6gevent_11__hub_local__threadlocal, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + Py_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_3 = PyImport_ImportModule("gevent.__waiter"); if (!__pyx_t_3) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_3, "sys", (void **)&__pyx_vp_6gevent_8__waiter_sys, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_3, "ConcurrentObjectUseError", (void **)&__pyx_vp_6gevent_8__waiter_ConcurrentObjectUseError, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_3, "_greenlet_imported", (void **)&__pyx_vp_6gevent_8__waiter__greenlet_imported, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_3, "_NONE", (void **)&__pyx_vp_6gevent_8__waiter__NONE, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + Py_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_4 = PyImport_ImportModule("gevent.__abstract_linkable"); if (!__pyx_t_4) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_4, "InvalidSwitchError", (void **)&__pyx_vp_6gevent_19__abstract_linkable_InvalidSwitchError, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_4, "Timeout", (void **)&__pyx_vp_6gevent_19__abstract_linkable_Timeout, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_4, "_greenlet_imported", (void **)&__pyx_vp_6gevent_19__abstract_linkable__greenlet_imported, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + Py_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = PyImport_ImportModule("gevent._event"); if (!__pyx_t_5) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_5, "_None", (void **)&__pyx_vp_6gevent_6_event__None, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_5, "reraise", (void **)&__pyx_vp_6gevent_6_event_reraise, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_5, "dump_traceback", (void **)&__pyx_vp_6gevent_6_event_dump_traceback, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_5, "load_traceback", (void **)&__pyx_vp_6gevent_6_event_load_traceback, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_5, "Timeout", (void **)&__pyx_vp_6gevent_6_event_Timeout, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + Py_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_modinit_function_import_code(void) { + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); + /*--- Function import code ---*/ + __pyx_t_1 = PyImport_ImportModule("gevent.__hub_local"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportFunction(__pyx_t_1, "get_hub_noargs", (void (**)(void))&__pyx_f_6gevent_11__hub_local_get_hub_noargs, "struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *(int __pyx_skip_dispatch)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + Py_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_RefNannyFinishContext(); + return -1; +} + + +#if PY_MAJOR_VERSION < 3 +#ifdef CYTHON_NO_PYINIT_EXPORT +#define __Pyx_PyMODINIT_FUNC void +#else +#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC +#endif +#else +#ifdef CYTHON_NO_PYINIT_EXPORT +#define __Pyx_PyMODINIT_FUNC PyObject * +#else +#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC +#endif +#endif + + +#if PY_MAJOR_VERSION < 3 +__Pyx_PyMODINIT_FUNC init_queue(void) CYTHON_SMALL_CODE; /*proto*/ +__Pyx_PyMODINIT_FUNC init_queue(void) +#else +__Pyx_PyMODINIT_FUNC PyInit__queue(void) CYTHON_SMALL_CODE; /*proto*/ +__Pyx_PyMODINIT_FUNC PyInit__queue(void) +#if CYTHON_PEP489_MULTI_PHASE_INIT +{ + return PyModuleDef_Init(&__pyx_moduledef); +} +static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { + #if PY_VERSION_HEX >= 0x030700A1 + static PY_INT64_T main_interpreter_id = -1; + PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); + if (main_interpreter_id == -1) { + main_interpreter_id = current_id; + return (unlikely(current_id == -1)) ? -1 : 0; + } else if (unlikely(main_interpreter_id != current_id)) + #else + static PyInterpreterState *main_interpreter = NULL; + PyInterpreterState *current_interpreter = PyThreadState_Get()->interp; + if (!main_interpreter) { + main_interpreter = current_interpreter; + } else if (unlikely(main_interpreter != current_interpreter)) + #endif + { + PyErr_SetString( + PyExc_ImportError, + "Interpreter change detected - this module can only be loaded into one interpreter per process."); + return -1; + } + return 0; +} +static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) { + PyObject *value = PyObject_GetAttrString(spec, from_name); + int result = 0; + if (likely(value)) { + if (allow_none || value != Py_None) { + result = PyDict_SetItemString(moddict, to_name, value); + } + Py_DECREF(value); + } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_Clear(); + } else { + result = -1; + } + return result; +} +static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) { + PyObject *module = NULL, *moddict, *modname; + if (__Pyx_check_single_interpreter()) + return NULL; + if (__pyx_m) + return __Pyx_NewRef(__pyx_m); + modname = PyObject_GetAttrString(spec, "name"); + if (unlikely(!modname)) goto bad; + module = PyModule_NewObject(modname); + Py_DECREF(modname); + if (unlikely(!module)) goto bad; + moddict = PyModule_GetDict(module); + if (unlikely(!moddict)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad; + return module; +bad: + Py_XDECREF(module); + return NULL; +} + + +static CYTHON_SMALL_CODE int __pyx_pymod_exec__queue(PyObject *__pyx_pyinit_module) +#endif +#endif +{ + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + __Pyx_RefNannyDeclarations + #if CYTHON_PEP489_MULTI_PHASE_INIT + if (__pyx_m) { + if (__pyx_m == __pyx_pyinit_module) return 0; + PyErr_SetString(PyExc_RuntimeError, "Module '_queue' has already been imported. Re-initialisation is not supported."); + return -1; + } + #elif PY_MAJOR_VERSION >= 3 + if (__pyx_m) return __Pyx_NewRef(__pyx_m); + #endif + #if CYTHON_REFNANNY +__Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); +if (!__Pyx_RefNanny) { + PyErr_Clear(); + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); + if (!__Pyx_RefNanny) + Py_FatalError("failed to import 'refnanny' module"); +} +#endif + __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit__queue(void)", 0); + if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #ifdef __Pxy_PyFrame_Initialize_Offsets + __Pxy_PyFrame_Initialize_Offsets(); + #endif + __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) + #ifdef __Pyx_CyFunction_USED + if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_FusedFunction_USED + if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_Coroutine_USED + if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_Generator_USED + if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_AsyncGen_USED + if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_StopAsyncIteration_USED + if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + /*--- Library function declarations ---*/ + /*--- Threads initialization code ---*/ + #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS + #ifdef WITH_THREAD /* Python build with threading support? */ + PyEval_InitThreads(); + #endif + #endif + /*--- Module creation code ---*/ + #if CYTHON_PEP489_MULTI_PHASE_INIT + __pyx_m = __pyx_pyinit_module; + Py_INCREF(__pyx_m); + #else + #if PY_MAJOR_VERSION < 3 + __pyx_m = Py_InitModule4("_queue", __pyx_methods, __pyx_k_Synchronized_queues_The_mod_gev, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); + #else + __pyx_m = PyModule_Create(&__pyx_moduledef); + #endif + if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) + Py_INCREF(__pyx_d); + __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) + #if CYTHON_COMPILING_IN_PYPY + Py_INCREF(__pyx_b); + #endif + if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + /*--- Initialize various global constants etc. ---*/ + if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) + if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + if (__pyx_module_is_main_gevent___queue) { + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + } + #if PY_MAJOR_VERSION >= 3 + { + PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) + if (!PyDict_GetItemString(modules, "gevent._queue")) { + if (unlikely(PyDict_SetItemString(modules, "gevent._queue", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error) + } + } + #endif + /*--- Builtin init code ---*/ + if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + /*--- Constants init code ---*/ + if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + /*--- Global type/function init code ---*/ + (void)__Pyx_modinit_global_init_code(); + if (unlikely(__Pyx_modinit_variable_export_code() != 0)) goto __pyx_L1_error; + if (unlikely(__Pyx_modinit_function_export_code() != 0)) goto __pyx_L1_error; + if (unlikely(__Pyx_modinit_type_init_code() != 0)) goto __pyx_L1_error; + if (unlikely(__Pyx_modinit_type_import_code() != 0)) goto __pyx_L1_error; + if (unlikely(__Pyx_modinit_variable_import_code() != 0)) goto __pyx_L1_error; + if (unlikely(__Pyx_modinit_function_import_code() != 0)) goto __pyx_L1_error; + /*--- Execution code ---*/ + #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) + if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + + /* "src/gevent/queue.py":31 + * + * from __future__ import absolute_import + * import sys # <<<<<<<<<<<<<< + * from heapq import heappush as _heappush + * from heapq import heappop as _heappop + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_sys, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 31, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_sys, __pyx_t_1) < 0) __PYX_ERR(0, 31, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/queue.py":32 + * from __future__ import absolute_import + * import sys + * from heapq import heappush as _heappush # <<<<<<<<<<<<<< + * from heapq import heappop as _heappop + * from heapq import heapify as _heapify + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 32, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_heappush_2); + __Pyx_GIVEREF(__pyx_n_s_heappush_2); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_heappush_2); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_heapq, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 32, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_heappush_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 32, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_v_6gevent_6_queue__heappush); + __Pyx_DECREF_SET(__pyx_v_6gevent_6_queue__heappush, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/queue.py":33 + * import sys + * from heapq import heappush as _heappush + * from heapq import heappop as _heappop # <<<<<<<<<<<<<< + * from heapq import heapify as _heapify + * import collections + */ + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 33, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_heappop_2); + __Pyx_GIVEREF(__pyx_n_s_heappop_2); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_heappop_2); + __pyx_t_1 = __Pyx_Import(__pyx_n_s_heapq, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 33, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_heappop_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 33, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_v_6gevent_6_queue__heappop); + __Pyx_DECREF_SET(__pyx_v_6gevent_6_queue__heappop, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/queue.py":34 + * from heapq import heappush as _heappush + * from heapq import heappop as _heappop + * from heapq import heapify as _heapify # <<<<<<<<<<<<<< + * import collections + * + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 34, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_heapify_2); + __Pyx_GIVEREF(__pyx_n_s_heapify_2); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_heapify_2); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_heapq, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 34, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_heapify_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 34, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_v_6gevent_6_queue__heapify); + __Pyx_DECREF_SET(__pyx_v_6gevent_6_queue__heapify, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/queue.py":35 + * from heapq import heappop as _heappop + * from heapq import heapify as _heapify + * import collections # <<<<<<<<<<<<<< + * + * if sys.version_info[0] == 2: + */ + __pyx_t_2 = __Pyx_Import(__pyx_n_s_collections, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 35, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_collections, __pyx_t_2) < 0) __PYX_ERR(0, 35, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/queue.py":37 + * import collections + * + * if sys.version_info[0] == 2: # <<<<<<<<<<<<<< + * import Queue as __queue__ # python 3: pylint:disable=import-error + * else: + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_sys); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 37, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_version_info); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 37, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 37, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyInt_EqObjC(__pyx_t_2, __pyx_int_2, 2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 37, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 37, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_3) { + + /* "src/gevent/queue.py":38 + * + * if sys.version_info[0] == 2: + * import Queue as __queue__ # python 3: pylint:disable=import-error # <<<<<<<<<<<<<< + * else: + * import queue as __queue__ # python 2: pylint:disable=import-error + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_Queue, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 38, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_queue_2, __pyx_t_1) < 0) __PYX_ERR(0, 38, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/queue.py":37 + * import collections + * + * if sys.version_info[0] == 2: # <<<<<<<<<<<<<< + * import Queue as __queue__ # python 3: pylint:disable=import-error + * else: + */ + goto __pyx_L2; + } + + /* "src/gevent/queue.py":40 + * import Queue as __queue__ # python 3: pylint:disable=import-error + * else: + * import queue as __queue__ # python 2: pylint:disable=import-error # <<<<<<<<<<<<<< + * Full = __queue__.Full + * Empty = __queue__.Empty + */ + /*else*/ { + __pyx_t_1 = __Pyx_Import(__pyx_n_s_queue, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 40, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_queue_2, __pyx_t_1) < 0) __PYX_ERR(0, 40, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + __pyx_L2:; + + /* "src/gevent/queue.py":41 + * else: + * import queue as __queue__ # python 2: pylint:disable=import-error + * Full = __queue__.Full # <<<<<<<<<<<<<< + * Empty = __queue__.Empty + * + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_queue_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 41, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_Full); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 41, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_Full, __pyx_t_2) < 0) __PYX_ERR(0, 41, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/queue.py":42 + * import queue as __queue__ # python 2: pylint:disable=import-error + * Full = __queue__.Full + * Empty = __queue__.Empty # <<<<<<<<<<<<<< + * + * from gevent.timeout import Timeout + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_queue_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 42, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_Empty); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 42, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_Empty, __pyx_t_1) < 0) __PYX_ERR(0, 42, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/queue.py":44 + * Empty = __queue__.Empty + * + * from gevent.timeout import Timeout # <<<<<<<<<<<<<< + * from gevent._hub_local import get_hub_noargs as get_hub + * from greenlet import getcurrent + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 44, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_Timeout); + __Pyx_GIVEREF(__pyx_n_s_Timeout); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_Timeout); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_gevent_timeout, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 44, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_Timeout); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 44, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_Timeout, __pyx_t_1) < 0) __PYX_ERR(0, 44, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/queue.py":45 + * + * from gevent.timeout import Timeout + * from gevent._hub_local import get_hub_noargs as get_hub # <<<<<<<<<<<<<< + * from greenlet import getcurrent + * from gevent.exceptions import InvalidSwitchError + */ + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 45, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_get_hub_noargs); + __Pyx_GIVEREF(__pyx_n_s_get_hub_noargs); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_get_hub_noargs); + __pyx_t_1 = __Pyx_Import(__pyx_n_s_gevent__hub_local, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 45, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_get_hub_noargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 45, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_hub, __pyx_t_2) < 0) __PYX_ERR(0, 45, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/queue.py":46 + * from gevent.timeout import Timeout + * from gevent._hub_local import get_hub_noargs as get_hub + * from greenlet import getcurrent # <<<<<<<<<<<<<< + * from gevent.exceptions import InvalidSwitchError + * + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 46, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_getcurrent); + __Pyx_GIVEREF(__pyx_n_s_getcurrent); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_getcurrent); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_greenlet, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 46, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_getcurrent); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 46, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_getcurrent, __pyx_t_1) < 0) __PYX_ERR(0, 46, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/queue.py":47 + * from gevent._hub_local import get_hub_noargs as get_hub + * from greenlet import getcurrent + * from gevent.exceptions import InvalidSwitchError # <<<<<<<<<<<<<< + * + * __all__ = [] + */ + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 47, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_InvalidSwitchError); + __Pyx_GIVEREF(__pyx_n_s_InvalidSwitchError); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_InvalidSwitchError); + __pyx_t_1 = __Pyx_Import(__pyx_n_s_gevent_exceptions, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 47, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_InvalidSwitchError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 47, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_InvalidSwitchError, __pyx_t_2) < 0) __PYX_ERR(0, 47, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/queue.py":49 + * from gevent.exceptions import InvalidSwitchError + * + * __all__ = [] # <<<<<<<<<<<<<< + * __implements__ = ['Queue', 'PriorityQueue', 'LifoQueue'] + * __extensions__ = ['JoinableQueue', 'Channel'] + */ + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 49, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_all, __pyx_t_1) < 0) __PYX_ERR(0, 49, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/queue.py":50 + * + * __all__ = [] + * __implements__ = ['Queue', 'PriorityQueue', 'LifoQueue'] # <<<<<<<<<<<<<< + * __extensions__ = ['JoinableQueue', 'Channel'] + * __imports__ = ['Empty', 'Full'] + */ + __pyx_t_1 = PyList_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 50, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_Queue); + __Pyx_GIVEREF(__pyx_n_s_Queue); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_Queue); + __Pyx_INCREF(__pyx_n_s_PriorityQueue); + __Pyx_GIVEREF(__pyx_n_s_PriorityQueue); + PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_PriorityQueue); + __Pyx_INCREF(__pyx_n_s_LifoQueue); + __Pyx_GIVEREF(__pyx_n_s_LifoQueue); + PyList_SET_ITEM(__pyx_t_1, 2, __pyx_n_s_LifoQueue); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_implements, __pyx_t_1) < 0) __PYX_ERR(0, 50, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/queue.py":51 + * __all__ = [] + * __implements__ = ['Queue', 'PriorityQueue', 'LifoQueue'] + * __extensions__ = ['JoinableQueue', 'Channel'] # <<<<<<<<<<<<<< + * __imports__ = ['Empty', 'Full'] + * if hasattr(__queue__, 'SimpleQueue'): + */ + __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 51, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_JoinableQueue); + __Pyx_GIVEREF(__pyx_n_s_JoinableQueue); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_JoinableQueue); + __Pyx_INCREF(__pyx_n_s_Channel); + __Pyx_GIVEREF(__pyx_n_s_Channel); + PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_Channel); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_extensions, __pyx_t_1) < 0) __PYX_ERR(0, 51, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/queue.py":52 + * __implements__ = ['Queue', 'PriorityQueue', 'LifoQueue'] + * __extensions__ = ['JoinableQueue', 'Channel'] + * __imports__ = ['Empty', 'Full'] # <<<<<<<<<<<<<< + * if hasattr(__queue__, 'SimpleQueue'): + * __all__.append('SimpleQueue') # New in 3.7 + */ + __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 52, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_Empty); + __Pyx_GIVEREF(__pyx_n_s_Empty); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_Empty); + __Pyx_INCREF(__pyx_n_s_Full); + __Pyx_GIVEREF(__pyx_n_s_Full); + PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_Full); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_imports, __pyx_t_1) < 0) __PYX_ERR(0, 52, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/queue.py":53 + * __extensions__ = ['JoinableQueue', 'Channel'] + * __imports__ = ['Empty', 'Full'] + * if hasattr(__queue__, 'SimpleQueue'): # <<<<<<<<<<<<<< + * __all__.append('SimpleQueue') # New in 3.7 + * # SimpleQueue is implemented in C and directly allocates locks + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_queue_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 53, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_HasAttr(__pyx_t_1, __pyx_n_s_SimpleQueue); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 53, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_4 = (__pyx_t_3 != 0); + if (__pyx_t_4) { + + /* "src/gevent/queue.py":54 + * __imports__ = ['Empty', 'Full'] + * if hasattr(__queue__, 'SimpleQueue'): + * __all__.append('SimpleQueue') # New in 3.7 # <<<<<<<<<<<<<< + * # SimpleQueue is implemented in C and directly allocates locks + * # unaffected by monkey patching. We need the Python version. + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_all); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 54, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_n_s_SimpleQueue); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 54, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/queue.py":57 + * # SimpleQueue is implemented in C and directly allocates locks + * # unaffected by monkey patching. We need the Python version. + * SimpleQueue = __queue__._PySimpleQueue # pylint:disable=no-member # <<<<<<<<<<<<<< + * __all__ += (__implements__ + __extensions__ + __imports__) + * + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_queue_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 57, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_PySimpleQueue); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 57, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_SimpleQueue, __pyx_t_2) < 0) __PYX_ERR(0, 57, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/queue.py":53 + * __extensions__ = ['JoinableQueue', 'Channel'] + * __imports__ = ['Empty', 'Full'] + * if hasattr(__queue__, 'SimpleQueue'): # <<<<<<<<<<<<<< + * __all__.append('SimpleQueue') # New in 3.7 + * # SimpleQueue is implemented in C and directly allocates locks + */ + } + + /* "src/gevent/queue.py":58 + * # unaffected by monkey patching. We need the Python version. + * SimpleQueue = __queue__._PySimpleQueue # pylint:disable=no-member + * __all__ += (__implements__ + __extensions__ + __imports__) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_all); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 58, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_implements); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 58, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_extensions); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 58, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = PyNumber_Add(__pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 58, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_imports); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 58, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_1 = PyNumber_Add(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 58, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyNumber_InPlaceAdd(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 58, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_all, __pyx_t_6) < 0) __PYX_ERR(0, 58, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "src/gevent/queue.py":72 + * pass + * + * import gevent._waiter # <<<<<<<<<<<<<< + * locals()['Waiter'] = gevent._waiter.Waiter + * + */ + __pyx_t_6 = __Pyx_Import(__pyx_n_s_gevent__waiter, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 72, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_gevent, __pyx_t_6) < 0) __PYX_ERR(0, 72, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "src/gevent/queue.py":73 + * + * import gevent._waiter + * locals()['Waiter'] = gevent._waiter.Waiter # <<<<<<<<<<<<<< + * + * class ItemWaiter(Waiter): # pylint:disable=undefined-variable + */ + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_gevent); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 73, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_waiter); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 73, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_Waiter); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 73, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_Globals(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 73, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (unlikely(PyDict_SetItem(__pyx_t_1, __pyx_n_s_Waiter, __pyx_t_6) < 0)) __PYX_ERR(0, 73, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "src/gevent/queue.py":78 + * # pylint:disable=assigning-non-slot + * __slots__ = ( + * 'item', # <<<<<<<<<<<<<< + * 'queue', + * ) + */ + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_ItemWaiter->tp_dict, __pyx_n_s_slots, __pyx_tuple__7) < 0) __PYX_ERR(0, 77, __pyx_L1_error) + PyType_Modified(__pyx_ptype_6gevent_6_queue_ItemWaiter); + + /* "src/gevent/queue.py":87 + * self.queue = queue + * + * def put_and_switch(self): # <<<<<<<<<<<<<< + * self.queue._put(self.item) + * self.queue = None + */ + __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_queue_10ItemWaiter_3put_and_switch, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ItemWaiter_put_and_switch, NULL, __pyx_n_s_gevent__queue, __pyx_d, ((PyObject *)__pyx_codeobj__9)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 87, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_ItemWaiter->tp_dict, __pyx_n_s_put_and_switch, __pyx_t_6) < 0) __PYX_ERR(0, 87, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + PyType_Modified(__pyx_ptype_6gevent_6_queue_ItemWaiter); + + /* "src/gevent/queue.py":115 + * + * __slots__ = ( + * '_maxsize', # <<<<<<<<<<<<<< + * 'getters', + * 'putters', + */ + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_Queue->tp_dict, __pyx_n_s_slots, __pyx_tuple__10) < 0) __PYX_ERR(0, 114, __pyx_L1_error) + PyType_Modified(__pyx_ptype_6gevent_6_queue_Queue); + + /* "src/gevent/queue.py":165 + * self._maxsize = nv + * + * def copy(self): # <<<<<<<<<<<<<< + * return type(self)(self.maxsize, self.queue) + * + */ + __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_queue_5Queue_3copy, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Queue_copy, NULL, __pyx_n_s_gevent__queue, __pyx_d, ((PyObject *)__pyx_codeobj__12)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 165, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_Queue->tp_dict, __pyx_n_s_copy, __pyx_t_6) < 0) __PYX_ERR(0, 165, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + PyType_Modified(__pyx_ptype_6gevent_6_queue_Queue); + + /* "src/gevent/queue.py":168 + * return type(self)(self.maxsize, self.queue) + * + * def _create_queue(self, items=()): # <<<<<<<<<<<<<< + * return collections.deque(items) + * + */ + __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_queue_5Queue_5_create_queue, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Queue__create_queue, NULL, __pyx_n_s_gevent__queue, __pyx_d, ((PyObject *)__pyx_codeobj__14)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 168, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_Queue->tp_dict, __pyx_n_s_create_queue, __pyx_t_6) < 0) __PYX_ERR(0, 168, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + PyType_Modified(__pyx_ptype_6gevent_6_queue_Queue); + + /* "src/gevent/queue.py":171 + * return collections.deque(items) + * + * def _get(self): # <<<<<<<<<<<<<< + * return self.queue.popleft() + * + */ + __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_queue_5Queue_7_get, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Queue__get, NULL, __pyx_n_s_gevent__queue, __pyx_d, ((PyObject *)__pyx_codeobj__16)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 171, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_Queue->tp_dict, __pyx_n_s_get, __pyx_t_6) < 0) __PYX_ERR(0, 171, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + PyType_Modified(__pyx_ptype_6gevent_6_queue_Queue); + + /* "src/gevent/queue.py":174 + * return self.queue.popleft() + * + * def _peek(self): # <<<<<<<<<<<<<< + * return self.queue[0] + * + */ + __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_queue_5Queue_9_peek, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Queue__peek, NULL, __pyx_n_s_gevent__queue, __pyx_d, ((PyObject *)__pyx_codeobj__18)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 174, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_Queue->tp_dict, __pyx_n_s_peek, __pyx_t_6) < 0) __PYX_ERR(0, 174, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + PyType_Modified(__pyx_ptype_6gevent_6_queue_Queue); + + /* "src/gevent/queue.py":177 + * return self.queue[0] + * + * def _put(self, item): # <<<<<<<<<<<<<< + * self.queue.append(item) + * + */ + __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_queue_5Queue_11_put, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Queue__put, NULL, __pyx_n_s_gevent__queue, __pyx_d, ((PyObject *)__pyx_codeobj__20)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 177, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_Queue->tp_dict, __pyx_n_s_put, __pyx_t_6) < 0) __PYX_ERR(0, 177, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + PyType_Modified(__pyx_ptype_6gevent_6_queue_Queue); + + /* "src/gevent/queue.py":186 + * return '<%s%s>' % (type(self).__name__, self._format()) + * + * def _format(self): # <<<<<<<<<<<<<< + * result = [] + * if self.maxsize is not None: + */ + __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_queue_5Queue_17_format, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Queue__format, NULL, __pyx_n_s_gevent__queue, __pyx_d, ((PyObject *)__pyx_codeobj__22)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 186, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_Queue->tp_dict, __pyx_n_s_format, __pyx_t_6) < 0) __PYX_ERR(0, 186, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + PyType_Modified(__pyx_ptype_6gevent_6_queue_Queue); + + /* "src/gevent/queue.py":200 + * return '' + * + * def qsize(self): # <<<<<<<<<<<<<< + * """Return the size of the queue.""" + * return len(self.queue) + */ + __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_queue_5Queue_19qsize, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Queue_qsize, NULL, __pyx_n_s_gevent__queue, __pyx_d, ((PyObject *)__pyx_codeobj__24)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 200, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_Queue->tp_dict, __pyx_n_s_qsize, __pyx_t_6) < 0) __PYX_ERR(0, 200, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + PyType_Modified(__pyx_ptype_6gevent_6_queue_Queue); + + /* "src/gevent/queue.py":232 + * return True + * + * def empty(self): # <<<<<<<<<<<<<< + * """Return ``True`` if the queue is empty, ``False`` otherwise.""" + * return not self.qsize() + */ + __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_queue_5Queue_27empty, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Queue_empty, NULL, __pyx_n_s_gevent__queue, __pyx_d, ((PyObject *)__pyx_codeobj__26)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 232, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_Queue->tp_dict, __pyx_n_s_empty, __pyx_t_6) < 0) __PYX_ERR(0, 232, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + PyType_Modified(__pyx_ptype_6gevent_6_queue_Queue); + + /* "src/gevent/queue.py":236 + * return not self.qsize() + * + * def full(self): # <<<<<<<<<<<<<< + * """Return ``True`` if the queue is full, ``False`` otherwise. + * + */ + __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_queue_5Queue_29full, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Queue_full, NULL, __pyx_n_s_gevent__queue, __pyx_d, ((PyObject *)__pyx_codeobj__28)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 236, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_Queue->tp_dict, __pyx_n_s_full, __pyx_t_6) < 0) __PYX_ERR(0, 236, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + PyType_Modified(__pyx_ptype_6gevent_6_queue_Queue); + + /* "src/gevent/queue.py":243 + * return self._maxsize > 0 and self.qsize() >= self._maxsize + * + * def put(self, item, block=True, timeout=None): # <<<<<<<<<<<<<< + * """Put an item into the queue. + * + */ + __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_queue_5Queue_31put, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Queue_put, NULL, __pyx_n_s_gevent__queue, __pyx_d, ((PyObject *)__pyx_codeobj__30)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 243, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_Queue->tp_dict, __pyx_n_s_put_2, __pyx_t_6) < 0) __PYX_ERR(0, 243, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + PyType_Modified(__pyx_ptype_6gevent_6_queue_Queue); + + /* "src/gevent/queue.py":285 + * raise Full + * + * def put_nowait(self, item): # <<<<<<<<<<<<<< + * """Put an item into the queue without blocking. + * + */ + __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_queue_5Queue_33put_nowait, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Queue_put_nowait, NULL, __pyx_n_s_gevent__queue, __pyx_d, ((PyObject *)__pyx_codeobj__32)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 285, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_Queue->tp_dict, __pyx_n_s_put_nowait, __pyx_t_6) < 0) __PYX_ERR(0, 285, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + PyType_Modified(__pyx_ptype_6gevent_6_queue_Queue); + + /* "src/gevent/queue.py":329 + * _safe_remove(self.getters, waiter) + * + * def get(self, block=True, timeout=None): # <<<<<<<<<<<<<< + * """Remove and return an item from the queue. + * + */ + __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_queue_5Queue_35get, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Queue_get, NULL, __pyx_n_s_gevent__queue, __pyx_d, ((PyObject *)__pyx_codeobj__34)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 329, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_Queue->tp_dict, __pyx_n_s_get_2, __pyx_t_6) < 0) __PYX_ERR(0, 329, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + PyType_Modified(__pyx_ptype_6gevent_6_queue_Queue); + + /* "src/gevent/queue.py":346 + * return self.__get_or_peek(self._get, block, timeout) + * + * def get_nowait(self): # <<<<<<<<<<<<<< + * """Remove and return an item from the queue without blocking. + * + */ + __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_queue_5Queue_37get_nowait, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Queue_get_nowait, NULL, __pyx_n_s_gevent__queue, __pyx_d, ((PyObject *)__pyx_codeobj__36)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 346, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_Queue->tp_dict, __pyx_n_s_get_nowait, __pyx_t_6) < 0) __PYX_ERR(0, 346, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + PyType_Modified(__pyx_ptype_6gevent_6_queue_Queue); + + /* "src/gevent/queue.py":354 + * return self.get(False) + * + * def peek(self, block=True, timeout=None): # <<<<<<<<<<<<<< + * """Return an item from the queue without removing it. + * + */ + __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_queue_5Queue_39peek, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Queue_peek, NULL, __pyx_n_s_gevent__queue, __pyx_d, ((PyObject *)__pyx_codeobj__38)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 354, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_Queue->tp_dict, __pyx_n_s_peek_2, __pyx_t_6) < 0) __PYX_ERR(0, 354, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + PyType_Modified(__pyx_ptype_6gevent_6_queue_Queue); + + /* "src/gevent/queue.py":370 + * return self.__get_or_peek(self._peek, block, timeout) + * + * def peek_nowait(self): # <<<<<<<<<<<<<< + * """Return an item from the queue without blocking. + * + */ + __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_queue_5Queue_41peek_nowait, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Queue_peek_nowait, NULL, __pyx_n_s_gevent__queue, __pyx_d, ((PyObject *)__pyx_codeobj__40)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 370, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_Queue->tp_dict, __pyx_n_s_peek_nowait, __pyx_t_6) < 0) __PYX_ERR(0, 370, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + PyType_Modified(__pyx_ptype_6gevent_6_queue_Queue); + + /* "src/gevent/queue.py":378 + * return self.peek(False) + * + * def _unlock(self): # <<<<<<<<<<<<<< + * while True: + * repeat = False + */ + __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_queue_5Queue_43_unlock, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Queue__unlock, NULL, __pyx_n_s_gevent__queue, __pyx_d, ((PyObject *)__pyx_codeobj__42)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 378, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_Queue->tp_dict, __pyx_n_s_unlock, __pyx_t_6) < 0) __PYX_ERR(0, 378, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + PyType_Modified(__pyx_ptype_6gevent_6_queue_Queue); + + /* "src/gevent/queue.py":410 + * return result + * + * next = __next__ # Py2 # <<<<<<<<<<<<<< + * + * + */ + __Pyx_GetNameInClass(__pyx_t_6, (PyObject *)__pyx_ptype_6gevent_6_queue_Queue, __pyx_n_s_next); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 410, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_Queue->tp_dict, __pyx_n_s_next_2, __pyx_t_6) < 0) __PYX_ERR(0, 410, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + PyType_Modified(__pyx_ptype_6gevent_6_queue_Queue); + + /* "src/gevent/queue.py":417 + * # be bound. Changing its maxsize has no effect. + * + * __slots__ = () # <<<<<<<<<<<<<< + * + * def __init__(self, maxsize=None, items=()): + */ + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_UnboundQueue->tp_dict, __pyx_n_s_slots, __pyx_empty_tuple) < 0) __PYX_ERR(0, 417, __pyx_L1_error) + PyType_Modified(__pyx_ptype_6gevent_6_queue_UnboundQueue); + + /* "src/gevent/queue.py":425 + * self.putters = None # Will never be used. + * + * def put(self, item, block=True, timeout=None): # <<<<<<<<<<<<<< + * self._put(item) + * if self.getters: + */ + __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_queue_12UnboundQueue_3put, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_UnboundQueue_put, NULL, __pyx_n_s_gevent__queue, __pyx_d, ((PyObject *)__pyx_codeobj__44)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 425, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_UnboundQueue->tp_dict, __pyx_n_s_put_2, __pyx_t_6) < 0) __PYX_ERR(0, 425, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + PyType_Modified(__pyx_ptype_6gevent_6_queue_UnboundQueue); + + /* "src/gevent/queue.py":442 + * ''' + * + * __slots__ = () # <<<<<<<<<<<<<< + * + * def _create_queue(self, items=()): + */ + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_PriorityQueue->tp_dict, __pyx_n_s_slots, __pyx_empty_tuple) < 0) __PYX_ERR(0, 442, __pyx_L1_error) + PyType_Modified(__pyx_ptype_6gevent_6_queue_PriorityQueue); + + /* "src/gevent/queue.py":444 + * __slots__ = () + * + * def _create_queue(self, items=()): # <<<<<<<<<<<<<< + * q = list(items) + * _heapify(q) + */ + __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_queue_13PriorityQueue_1_create_queue, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_PriorityQueue__create_queue, NULL, __pyx_n_s_gevent__queue, __pyx_d, ((PyObject *)__pyx_codeobj__46)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 444, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_PriorityQueue->tp_dict, __pyx_n_s_create_queue, __pyx_t_6) < 0) __PYX_ERR(0, 444, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + PyType_Modified(__pyx_ptype_6gevent_6_queue_PriorityQueue); + + /* "src/gevent/queue.py":449 + * return q + * + * def _put(self, item): # <<<<<<<<<<<<<< + * _heappush(self.queue, item) + * + */ + __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_queue_13PriorityQueue_3_put, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_PriorityQueue__put, NULL, __pyx_n_s_gevent__queue, __pyx_d, ((PyObject *)__pyx_codeobj__48)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 449, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_PriorityQueue->tp_dict, __pyx_n_s_put, __pyx_t_6) < 0) __PYX_ERR(0, 449, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + PyType_Modified(__pyx_ptype_6gevent_6_queue_PriorityQueue); + + /* "src/gevent/queue.py":452 + * _heappush(self.queue, item) + * + * def _get(self): # <<<<<<<<<<<<<< + * return _heappop(self.queue) + * + */ + __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_queue_13PriorityQueue_5_get, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_PriorityQueue__get, NULL, __pyx_n_s_gevent__queue, __pyx_d, ((PyObject *)__pyx_codeobj__50)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 452, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_PriorityQueue->tp_dict, __pyx_n_s_get, __pyx_t_6) < 0) __PYX_ERR(0, 452, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + PyType_Modified(__pyx_ptype_6gevent_6_queue_PriorityQueue); + + /* "src/gevent/queue.py":459 + * '''A subclass of :class:`Queue` that retrieves most recently added entries first.''' + * + * __slots__ = () # <<<<<<<<<<<<<< + * + * def _create_queue(self, items=()): + */ + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_LifoQueue->tp_dict, __pyx_n_s_slots, __pyx_empty_tuple) < 0) __PYX_ERR(0, 459, __pyx_L1_error) + PyType_Modified(__pyx_ptype_6gevent_6_queue_LifoQueue); + + /* "src/gevent/queue.py":461 + * __slots__ = () + * + * def _create_queue(self, items=()): # <<<<<<<<<<<<<< + * return list(items) + * + */ + __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_queue_9LifoQueue_1_create_queue, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_LifoQueue__create_queue, NULL, __pyx_n_s_gevent__queue, __pyx_d, ((PyObject *)__pyx_codeobj__52)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 461, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_LifoQueue->tp_dict, __pyx_n_s_create_queue, __pyx_t_6) < 0) __PYX_ERR(0, 461, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + PyType_Modified(__pyx_ptype_6gevent_6_queue_LifoQueue); + + /* "src/gevent/queue.py":464 + * return list(items) + * + * def _put(self, item): # <<<<<<<<<<<<<< + * self.queue.append(item) + * + */ + __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_queue_9LifoQueue_3_put, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_LifoQueue__put, NULL, __pyx_n_s_gevent__queue, __pyx_d, ((PyObject *)__pyx_codeobj__54)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 464, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_LifoQueue->tp_dict, __pyx_n_s_put, __pyx_t_6) < 0) __PYX_ERR(0, 464, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + PyType_Modified(__pyx_ptype_6gevent_6_queue_LifoQueue); + + /* "src/gevent/queue.py":467 + * self.queue.append(item) + * + * def _get(self): # <<<<<<<<<<<<<< + * return self.queue.pop() + * + */ + __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_queue_9LifoQueue_5_get, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_LifoQueue__get, NULL, __pyx_n_s_gevent__queue, __pyx_d, ((PyObject *)__pyx_codeobj__56)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 467, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_LifoQueue->tp_dict, __pyx_n_s_get, __pyx_t_6) < 0) __PYX_ERR(0, 467, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + PyType_Modified(__pyx_ptype_6gevent_6_queue_LifoQueue); + + /* "src/gevent/queue.py":470 + * return self.queue.pop() + * + * def _peek(self): # <<<<<<<<<<<<<< + * return self.queue[-1] + * + */ + __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_queue_9LifoQueue_7_peek, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_LifoQueue__peek, NULL, __pyx_n_s_gevent__queue, __pyx_d, ((PyObject *)__pyx_codeobj__58)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 470, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_LifoQueue->tp_dict, __pyx_n_s_peek, __pyx_t_6) < 0) __PYX_ERR(0, 470, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + PyType_Modified(__pyx_ptype_6gevent_6_queue_LifoQueue); + + /* "src/gevent/queue.py":481 + * + * __slots__ = ( + * '_cond', # <<<<<<<<<<<<<< + * 'unfinished_tasks', + * ) + */ + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_JoinableQueue->tp_dict, __pyx_n_s_slots, __pyx_tuple__59) < 0) __PYX_ERR(0, 480, __pyx_L1_error) + PyType_Modified(__pyx_ptype_6gevent_6_queue_JoinableQueue); + + /* "src/gevent/queue.py":509 + * self._cond.clear() + * + * def copy(self): # <<<<<<<<<<<<<< + * return type(self)(self.maxsize, self.queue, self.unfinished_tasks) + * + */ + __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_queue_13JoinableQueue_3copy, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_JoinableQueue_copy, NULL, __pyx_n_s_gevent__queue, __pyx_d, ((PyObject *)__pyx_codeobj__61)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 509, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_JoinableQueue->tp_dict, __pyx_n_s_copy, __pyx_t_6) < 0) __PYX_ERR(0, 509, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + PyType_Modified(__pyx_ptype_6gevent_6_queue_JoinableQueue); + + /* "src/gevent/queue.py":512 + * return type(self)(self.maxsize, self.queue, self.unfinished_tasks) + * + * def _format(self): # <<<<<<<<<<<<<< + * result = Queue._format(self) + * if self.unfinished_tasks: + */ + __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_queue_13JoinableQueue_5_format, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_JoinableQueue__format, NULL, __pyx_n_s_gevent__queue, __pyx_d, ((PyObject *)__pyx_codeobj__63)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 512, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_JoinableQueue->tp_dict, __pyx_n_s_format, __pyx_t_6) < 0) __PYX_ERR(0, 512, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + PyType_Modified(__pyx_ptype_6gevent_6_queue_JoinableQueue); + + /* "src/gevent/queue.py":518 + * return result + * + * def _put(self, item): # <<<<<<<<<<<<<< + * Queue._put(self, item) + * self.unfinished_tasks += 1 + */ + __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_queue_13JoinableQueue_7_put, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_JoinableQueue__put, NULL, __pyx_n_s_gevent__queue, __pyx_d, ((PyObject *)__pyx_codeobj__65)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 518, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_JoinableQueue->tp_dict, __pyx_n_s_put, __pyx_t_6) < 0) __PYX_ERR(0, 518, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + PyType_Modified(__pyx_ptype_6gevent_6_queue_JoinableQueue); + + /* "src/gevent/queue.py":523 + * self._cond.clear() + * + * def task_done(self): # <<<<<<<<<<<<<< + * '''Indicate that a formerly enqueued task is complete. Used by queue consumer threads. + * For each :meth:`get ` used to fetch a task, a subsequent call to :meth:`task_done` tells the queue + */ + __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_queue_13JoinableQueue_9task_done, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_JoinableQueue_task_done, NULL, __pyx_n_s_gevent__queue, __pyx_d, ((PyObject *)__pyx_codeobj__67)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 523, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_JoinableQueue->tp_dict, __pyx_n_s_task_done, __pyx_t_6) < 0) __PYX_ERR(0, 523, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + PyType_Modified(__pyx_ptype_6gevent_6_queue_JoinableQueue); + + /* "src/gevent/queue.py":540 + * self._cond.set() + * + * def join(self, timeout=None): # <<<<<<<<<<<<<< + * ''' + * Block until all items in the queue have been gotten and processed. + */ + __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_queue_13JoinableQueue_11join, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_JoinableQueue_join, NULL, __pyx_n_s_gevent__queue, __pyx_d, ((PyObject *)__pyx_codeobj__69)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 540, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_JoinableQueue->tp_dict, __pyx_n_s_join, __pyx_t_6) < 0) __PYX_ERR(0, 540, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + PyType_Modified(__pyx_ptype_6gevent_6_queue_JoinableQueue); + + /* "src/gevent/queue.py":563 + * + * __slots__ = ( + * 'getters', # <<<<<<<<<<<<<< + * 'putters', + * 'hub', + */ + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_Channel->tp_dict, __pyx_n_s_slots, __pyx_tuple__70) < 0) __PYX_ERR(0, 562, __pyx_L1_error) + PyType_Modified(__pyx_ptype_6gevent_6_queue_Channel); + + /* "src/gevent/queue.py":585 + * return '<%s %s>' % (type(self).__name__, self._format()) + * + * def _format(self): # <<<<<<<<<<<<<< + * result = '' + * if self.getters: + */ + __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_queue_7Channel_7_format, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Channel__format, NULL, __pyx_n_s_gevent__queue, __pyx_d, ((PyObject *)__pyx_codeobj__72)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 585, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_Channel->tp_dict, __pyx_n_s_format, __pyx_t_6) < 0) __PYX_ERR(0, 585, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + PyType_Modified(__pyx_ptype_6gevent_6_queue_Channel); + + /* "src/gevent/queue.py":597 + * return len(self.putters) - len(self.getters) + * + * def qsize(self): # <<<<<<<<<<<<<< + * return 0 + * + */ + __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_queue_7Channel_9qsize, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Channel_qsize, NULL, __pyx_n_s_gevent__queue, __pyx_d, ((PyObject *)__pyx_codeobj__74)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 597, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_Channel->tp_dict, __pyx_n_s_qsize, __pyx_t_6) < 0) __PYX_ERR(0, 597, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + PyType_Modified(__pyx_ptype_6gevent_6_queue_Channel); + + /* "src/gevent/queue.py":600 + * return 0 + * + * def empty(self): # <<<<<<<<<<<<<< + * return True + * + */ + __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_queue_7Channel_11empty, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Channel_empty, NULL, __pyx_n_s_gevent__queue, __pyx_d, ((PyObject *)__pyx_codeobj__76)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 600, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_Channel->tp_dict, __pyx_n_s_empty, __pyx_t_6) < 0) __PYX_ERR(0, 600, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + PyType_Modified(__pyx_ptype_6gevent_6_queue_Channel); + + /* "src/gevent/queue.py":603 + * return True + * + * def full(self): # <<<<<<<<<<<<<< + * return True + * + */ + __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_queue_7Channel_13full, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Channel_full, NULL, __pyx_n_s_gevent__queue, __pyx_d, ((PyObject *)__pyx_codeobj__78)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 603, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_Channel->tp_dict, __pyx_n_s_full, __pyx_t_6) < 0) __PYX_ERR(0, 603, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + PyType_Modified(__pyx_ptype_6gevent_6_queue_Channel); + + /* "src/gevent/queue.py":606 + * return True + * + * def put(self, item, block=True, timeout=None): # <<<<<<<<<<<<<< + * if self.hub is getcurrent(): + * if self.getters: + */ + __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_queue_7Channel_15put, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Channel_put, NULL, __pyx_n_s_gevent__queue, __pyx_d, ((PyObject *)__pyx_codeobj__80)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 606, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_Channel->tp_dict, __pyx_n_s_put_2, __pyx_t_6) < 0) __PYX_ERR(0, 606, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + PyType_Modified(__pyx_ptype_6gevent_6_queue_Channel); + + /* "src/gevent/queue.py":633 + * timeout.cancel() + * + * def put_nowait(self, item): # <<<<<<<<<<<<<< + * self.put(item, False) + * + */ + __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_queue_7Channel_17put_nowait, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Channel_put_nowait, NULL, __pyx_n_s_gevent__queue, __pyx_d, ((PyObject *)__pyx_codeobj__82)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 633, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_Channel->tp_dict, __pyx_n_s_put_nowait, __pyx_t_6) < 0) __PYX_ERR(0, 633, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + PyType_Modified(__pyx_ptype_6gevent_6_queue_Channel); + + /* "src/gevent/queue.py":636 + * self.put(item, False) + * + * def get(self, block=True, timeout=None): # <<<<<<<<<<<<<< + * if self.hub is getcurrent(): + * if self.putters: + */ + __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_queue_7Channel_19get, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Channel_get, NULL, __pyx_n_s_gevent__queue, __pyx_d, ((PyObject *)__pyx_codeobj__84)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 636, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_Channel->tp_dict, __pyx_n_s_get_2, __pyx_t_6) < 0) __PYX_ERR(0, 636, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + PyType_Modified(__pyx_ptype_6gevent_6_queue_Channel); + + /* "src/gevent/queue.py":659 + * timeout.close() + * + * def get_nowait(self): # <<<<<<<<<<<<<< + * return self.get(False) + * + */ + __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_queue_7Channel_21get_nowait, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Channel_get_nowait, NULL, __pyx_n_s_gevent__queue, __pyx_d, ((PyObject *)__pyx_codeobj__86)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 659, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_Channel->tp_dict, __pyx_n_s_get_nowait, __pyx_t_6) < 0) __PYX_ERR(0, 659, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + PyType_Modified(__pyx_ptype_6gevent_6_queue_Channel); + + /* "src/gevent/queue.py":662 + * return self.get(False) + * + * def _unlock(self): # <<<<<<<<<<<<<< + * while self.putters and self.getters: + * getter = self.getters.popleft() + */ + __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_queue_7Channel_23_unlock, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Channel__unlock, NULL, __pyx_n_s_gevent__queue, __pyx_d, ((PyObject *)__pyx_codeobj__88)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 662, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_Channel->tp_dict, __pyx_n_s_unlock, __pyx_t_6) < 0) __PYX_ERR(0, 662, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + PyType_Modified(__pyx_ptype_6gevent_6_queue_Channel); + + /* "src/gevent/queue.py":682 + * return result + * + * next = __next__ # Py2 # <<<<<<<<<<<<<< + * + * from gevent._util import import_c_accel + */ + __Pyx_GetNameInClass(__pyx_t_6, (PyObject *)__pyx_ptype_6gevent_6_queue_Channel, __pyx_n_s_next); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 682, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_Channel->tp_dict, __pyx_n_s_next_2, __pyx_t_6) < 0) __PYX_ERR(0, 682, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + PyType_Modified(__pyx_ptype_6gevent_6_queue_Channel); + + /* "src/gevent/queue.py":684 + * next = __next__ # Py2 + * + * from gevent._util import import_c_accel # <<<<<<<<<<<<<< + * import_c_accel(globals(), 'gevent._queue') + */ + __pyx_t_6 = PyList_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 684, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(__pyx_n_s_import_c_accel); + __Pyx_GIVEREF(__pyx_n_s_import_c_accel); + PyList_SET_ITEM(__pyx_t_6, 0, __pyx_n_s_import_c_accel); + __pyx_t_1 = __Pyx_Import(__pyx_n_s_gevent__util, __pyx_t_6, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 684, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_import_c_accel); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 684, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_import_c_accel, __pyx_t_6) < 0) __PYX_ERR(0, 684, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/queue.py":685 + * + * from gevent._util import import_c_accel + * import_c_accel(globals(), 'gevent._queue') # <<<<<<<<<<<<<< + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_import_c_accel); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 685, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = __Pyx_Globals(); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 685, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 685, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_6); + __Pyx_INCREF(__pyx_n_s_gevent__queue); + __Pyx_GIVEREF(__pyx_n_s_gevent__queue); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_gevent__queue); + __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 685, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "src/gevent/queue.py":1 + * # Copyright (c) 2009-2012 Denis Bilenko. See LICENSE for details. # <<<<<<<<<<<<<< + * # copyright (c) 2018 gevent + * # cython: auto_pickle=False,embedsignature=True,always_allow_keywords=False + */ + __pyx_t_6 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_6) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "gevent/__abstract_linkable.pxd":24 + * return PyGreenlet_GetCurrent() + * + * cdef inline void greenlet_init(): # <<<<<<<<<<<<<< + * global _greenlet_imported + * if not _greenlet_imported: + */ + + /*--- Wrapped vars code ---*/ + + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + if (__pyx_m) { + if (__pyx_d) { + __Pyx_AddTraceback("init gevent._queue", __pyx_clineno, __pyx_lineno, __pyx_filename); + } + Py_CLEAR(__pyx_m); + } else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_ImportError, "init gevent._queue"); + } + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + #if CYTHON_PEP489_MULTI_PHASE_INIT + return (__pyx_m != NULL) ? 0 : -1; + #elif PY_MAJOR_VERSION >= 3 + return __pyx_m; + #else + return; + #endif +} + +/* --- Runtime support code --- */ +/* Refnanny */ +#if CYTHON_REFNANNY +static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { + PyObject *m = NULL, *p = NULL; + void *r = NULL; + m = PyImport_ImportModule(modname); + if (!m) goto end; + p = PyObject_GetAttrString(m, "RefNannyAPI"); + if (!p) goto end; + r = PyLong_AsVoidPtr(p); +end: + Py_XDECREF(p); + Py_XDECREF(m); + return (__Pyx_RefNannyAPIStruct *)r; +} +#endif + +/* PyObjectGetAttrStr */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_getattro)) + return tp->tp_getattro(obj, attr_name); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_getattr)) + return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); +#endif + return PyObject_GetAttr(obj, attr_name); +} +#endif + +/* GetBuiltinName */ +static PyObject *__Pyx_GetBuiltinName(PyObject *name) { + PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name); + if (unlikely(!result)) { + PyErr_Format(PyExc_NameError, +#if PY_MAJOR_VERSION >= 3 + "name '%U' is not defined", name); +#else + "name '%.200s' is not defined", PyString_AS_STRING(name)); +#endif + } + return result; +} + +/* PyCFunctionFastCall */ +#if CYTHON_FAST_PYCCALL +static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) { + PyCFunctionObject *func = (PyCFunctionObject*)func_obj; + PyCFunction meth = PyCFunction_GET_FUNCTION(func); + PyObject *self = PyCFunction_GET_SELF(func); + int flags = PyCFunction_GET_FLAGS(func); + assert(PyCFunction_Check(func)); + assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS))); + assert(nargs >= 0); + assert(nargs == 0 || args != NULL); + /* _PyCFunction_FastCallDict() must not be called with an exception set, + because it may clear it (directly or indirectly) and so the + caller loses its exception */ + assert(!PyErr_Occurred()); + if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) { + return (*((__Pyx_PyCFunctionFastWithKeywords)(void*)meth)) (self, args, nargs, NULL); + } else { + return (*((__Pyx_PyCFunctionFast)(void*)meth)) (self, args, nargs); + } +} +#endif + +/* PyFunctionFastCall */ +#if CYTHON_FAST_PYCALL +static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, + PyObject *globals) { + PyFrameObject *f; + PyThreadState *tstate = __Pyx_PyThreadState_Current; + PyObject **fastlocals; + Py_ssize_t i; + PyObject *result; + assert(globals != NULL); + /* XXX Perhaps we should create a specialized + PyFrame_New() that doesn't take locals, but does + take builtins without sanity checking them. + */ + assert(tstate != NULL); + f = PyFrame_New(tstate, co, globals, NULL); + if (f == NULL) { + return NULL; + } + fastlocals = __Pyx_PyFrame_GetLocalsplus(f); + for (i = 0; i < na; i++) { + Py_INCREF(*args); + fastlocals[i] = *args++; + } + result = PyEval_EvalFrameEx(f,0); + ++tstate->recursion_depth; + Py_DECREF(f); + --tstate->recursion_depth; + return result; +} +#if 1 || PY_VERSION_HEX < 0x030600B1 +static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs) { + PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); + PyObject *globals = PyFunction_GET_GLOBALS(func); + PyObject *argdefs = PyFunction_GET_DEFAULTS(func); + PyObject *closure; +#if PY_MAJOR_VERSION >= 3 + PyObject *kwdefs; +#endif + PyObject *kwtuple, **k; + PyObject **d; + Py_ssize_t nd; + Py_ssize_t nk; + PyObject *result; + assert(kwargs == NULL || PyDict_Check(kwargs)); + nk = kwargs ? PyDict_Size(kwargs) : 0; + if (Py_EnterRecursiveCall((char*)" while calling a Python object")) { + return NULL; + } + if ( +#if PY_MAJOR_VERSION >= 3 + co->co_kwonlyargcount == 0 && +#endif + likely(kwargs == NULL || nk == 0) && + co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { + if (argdefs == NULL && co->co_argcount == nargs) { + result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); + goto done; + } + else if (nargs == 0 && argdefs != NULL + && co->co_argcount == Py_SIZE(argdefs)) { + /* function called with no arguments, but all parameters have + a default value: use default values as arguments .*/ + args = &PyTuple_GET_ITEM(argdefs, 0); + result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); + goto done; + } + } + if (kwargs != NULL) { + Py_ssize_t pos, i; + kwtuple = PyTuple_New(2 * nk); + if (kwtuple == NULL) { + result = NULL; + goto done; + } + k = &PyTuple_GET_ITEM(kwtuple, 0); + pos = i = 0; + while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { + Py_INCREF(k[i]); + Py_INCREF(k[i+1]); + i += 2; + } + nk = i / 2; + } + else { + kwtuple = NULL; + k = NULL; + } + closure = PyFunction_GET_CLOSURE(func); +#if PY_MAJOR_VERSION >= 3 + kwdefs = PyFunction_GET_KW_DEFAULTS(func); +#endif + if (argdefs != NULL) { + d = &PyTuple_GET_ITEM(argdefs, 0); + nd = Py_SIZE(argdefs); + } + else { + d = NULL; + nd = 0; + } +#if PY_MAJOR_VERSION >= 3 + result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, + args, nargs, + k, (int)nk, + d, (int)nd, kwdefs, closure); +#else + result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, + args, nargs, + k, (int)nk, + d, (int)nd, closure); +#endif + Py_XDECREF(kwtuple); +done: + Py_LeaveRecursiveCall(); + return result; +} +#endif +#endif + +/* PyObjectCall */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { + PyObject *result; + ternaryfunc call = func->ob_type->tp_call; + if (unlikely(!call)) + return PyObject_Call(func, arg, kw); + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; + result = (*call)(func, arg, kw); + Py_LeaveRecursiveCall(); + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +/* PyObjectCall2Args */ +static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) { + PyObject *args, *result = NULL; + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(function)) { + PyObject *args[2] = {arg1, arg2}; + return __Pyx_PyFunction_FastCall(function, args, 2); + } + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(function)) { + PyObject *args[2] = {arg1, arg2}; + return __Pyx_PyCFunction_FastCall(function, args, 2); + } + #endif + args = PyTuple_New(2); + if (unlikely(!args)) goto done; + Py_INCREF(arg1); + PyTuple_SET_ITEM(args, 0, arg1); + Py_INCREF(arg2); + PyTuple_SET_ITEM(args, 1, arg2); + Py_INCREF(function); + result = __Pyx_PyObject_Call(function, args, NULL); + Py_DECREF(args); + Py_DECREF(function); +done: + return result; +} + +/* PyObjectCallMethO */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { + PyObject *self, *result; + PyCFunction cfunc; + cfunc = PyCFunction_GET_FUNCTION(func); + self = PyCFunction_GET_SELF(func); + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; + result = cfunc(self, arg); + Py_LeaveRecursiveCall(); + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +/* PyObjectCallOneArg */ +#if CYTHON_COMPILING_IN_CPYTHON +static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) { + PyObject *result; + PyObject *args = PyTuple_New(1); + if (unlikely(!args)) return NULL; + Py_INCREF(arg); + PyTuple_SET_ITEM(args, 0, arg); + result = __Pyx_PyObject_Call(func, args, NULL); + Py_DECREF(args); + return result; +} +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { +#if CYTHON_FAST_PYCALL + if (PyFunction_Check(func)) { + return __Pyx_PyFunction_FastCall(func, &arg, 1); + } +#endif + if (likely(PyCFunction_Check(func))) { + if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) { + return __Pyx_PyObject_CallMethO(func, arg); +#if CYTHON_FAST_PYCCALL + } else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) { + return __Pyx_PyCFunction_FastCall(func, &arg, 1); +#endif + } + } + return __Pyx__PyObject_CallOneArg(func, arg); +} +#else +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { + PyObject *result; + PyObject *args = PyTuple_Pack(1, arg); + if (unlikely(!args)) return NULL; + result = __Pyx_PyObject_Call(func, args, NULL); + Py_DECREF(args); + return result; +} +#endif + +/* GetTopmostException */ +#if CYTHON_USE_EXC_INFO_STACK +static _PyErr_StackItem * +__Pyx_PyErr_GetTopmostException(PyThreadState *tstate) +{ + _PyErr_StackItem *exc_info = tstate->exc_info; + while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) && + exc_info->previous_item != NULL) + { + exc_info = exc_info->previous_item; + } + return exc_info; +} +#endif + +/* SaveResetException */ +#if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { + #if CYTHON_USE_EXC_INFO_STACK + _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate); + *type = exc_info->exc_type; + *value = exc_info->exc_value; + *tb = exc_info->exc_traceback; + #else + *type = tstate->exc_type; + *value = tstate->exc_value; + *tb = tstate->exc_traceback; + #endif + Py_XINCREF(*type); + Py_XINCREF(*value); + Py_XINCREF(*tb); +} +static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + #if CYTHON_USE_EXC_INFO_STACK + _PyErr_StackItem *exc_info = tstate->exc_info; + tmp_type = exc_info->exc_type; + tmp_value = exc_info->exc_value; + tmp_tb = exc_info->exc_traceback; + exc_info->exc_type = type; + exc_info->exc_value = value; + exc_info->exc_traceback = tb; + #else + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = type; + tstate->exc_value = value; + tstate->exc_traceback = tb; + #endif + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +} +#endif + +/* PyErrExceptionMatches */ +#if CYTHON_FAST_THREAD_STATE +static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { + Py_ssize_t i, n; + n = PyTuple_GET_SIZE(tuple); +#if PY_MAJOR_VERSION >= 3 + for (i=0; icurexc_type; + if (exc_type == err) return 1; + if (unlikely(!exc_type)) return 0; + if (unlikely(PyTuple_Check(err))) + return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err); + return __Pyx_PyErr_GivenExceptionMatches(exc_type, err); +} +#endif + +/* PyErrFetchRestore */ +#if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + tmp_type = tstate->curexc_type; + tmp_value = tstate->curexc_value; + tmp_tb = tstate->curexc_traceback; + tstate->curexc_type = type; + tstate->curexc_value = value; + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +} +static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { + *type = tstate->curexc_type; + *value = tstate->curexc_value; + *tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +} +#endif + +/* RaiseArgTupleInvalid */ +static void __Pyx_RaiseArgtupleInvalid( + const char* func_name, + int exact, + Py_ssize_t num_min, + Py_ssize_t num_max, + Py_ssize_t num_found) +{ + Py_ssize_t num_expected; + const char *more_or_less; + if (num_found < num_min) { + num_expected = num_min; + more_or_less = "at least"; + } else { + num_expected = num_max; + more_or_less = "at most"; + } + if (exact) { + more_or_less = "exactly"; + } + PyErr_Format(PyExc_TypeError, + "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", + func_name, more_or_less, num_expected, + (num_expected == 1) ? "" : "s", num_found); +} + +/* RaiseDoubleKeywords */ +static void __Pyx_RaiseDoubleKeywordsError( + const char* func_name, + PyObject* kw_name) +{ + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION >= 3 + "%s() got multiple values for keyword argument '%U'", func_name, kw_name); + #else + "%s() got multiple values for keyword argument '%s'", func_name, + PyString_AsString(kw_name)); + #endif +} + +/* ParseKeywords */ +static int __Pyx_ParseOptionalKeywords( + PyObject *kwds, + PyObject **argnames[], + PyObject *kwds2, + PyObject *values[], + Py_ssize_t num_pos_args, + const char* function_name) +{ + PyObject *key = 0, *value = 0; + Py_ssize_t pos = 0; + PyObject*** name; + PyObject*** first_kw_arg = argnames + num_pos_args; + while (PyDict_Next(kwds, &pos, &key, &value)) { + name = first_kw_arg; + while (*name && (**name != key)) name++; + if (*name) { + values[name-argnames] = value; + continue; + } + name = first_kw_arg; + #if PY_MAJOR_VERSION < 3 + if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) { + while (*name) { + if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) + && _PyString_Eq(**name, key)) { + values[name-argnames] = value; + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + if ((**argname == key) || ( + (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) + && _PyString_Eq(**argname, key))) { + goto arg_passed_twice; + } + argname++; + } + } + } else + #endif + if (likely(PyUnicode_Check(key))) { + while (*name) { + int cmp = (**name == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 : + #endif + PyUnicode_Compare(**name, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) { + values[name-argnames] = value; + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + int cmp = (**argname == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 : + #endif + PyUnicode_Compare(**argname, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) goto arg_passed_twice; + argname++; + } + } + } else + goto invalid_keyword_type; + if (kwds2) { + if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; + } else { + goto invalid_keyword; + } + } + return 0; +arg_passed_twice: + __Pyx_RaiseDoubleKeywordsError(function_name, key); + goto bad; +invalid_keyword_type: + PyErr_Format(PyExc_TypeError, + "%.200s() keywords must be strings", function_name); + goto bad; +invalid_keyword: + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION < 3 + "%.200s() got an unexpected keyword argument '%.200s'", + function_name, PyString_AsString(key)); + #else + "%s() got an unexpected keyword argument '%U'", + function_name, key); + #endif +bad: + return -1; +} + +/* PyIntCompare */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED long inplace) { + if (op1 == op2) { + Py_RETURN_TRUE; + } + #if PY_MAJOR_VERSION < 3 + if (likely(PyInt_CheckExact(op1))) { + const long b = intval; + long a = PyInt_AS_LONG(op1); + if (a == b) Py_RETURN_TRUE; else Py_RETURN_FALSE; + } + #endif + #if CYTHON_USE_PYLONG_INTERNALS + if (likely(PyLong_CheckExact(op1))) { + int unequal; + unsigned long uintval; + Py_ssize_t size = Py_SIZE(op1); + const digit* digits = ((PyLongObject*)op1)->ob_digit; + if (intval == 0) { + if (size == 0) Py_RETURN_TRUE; else Py_RETURN_FALSE; + } else if (intval < 0) { + if (size >= 0) + Py_RETURN_FALSE; + intval = -intval; + size = -size; + } else { + if (size <= 0) + Py_RETURN_FALSE; + } + uintval = (unsigned long) intval; +#if PyLong_SHIFT * 4 < SIZEOF_LONG*8 + if (uintval >> (PyLong_SHIFT * 4)) { + unequal = (size != 5) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) + | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[4] != ((uintval >> (4 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); + } else +#endif +#if PyLong_SHIFT * 3 < SIZEOF_LONG*8 + if (uintval >> (PyLong_SHIFT * 3)) { + unequal = (size != 4) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) + | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); + } else +#endif +#if PyLong_SHIFT * 2 < SIZEOF_LONG*8 + if (uintval >> (PyLong_SHIFT * 2)) { + unequal = (size != 3) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) + | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); + } else +#endif +#if PyLong_SHIFT * 1 < SIZEOF_LONG*8 + if (uintval >> (PyLong_SHIFT * 1)) { + unequal = (size != 2) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) + | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); + } else +#endif + unequal = (size != 1) || (((unsigned long) digits[0]) != (uintval & (unsigned long) PyLong_MASK)); + if (unequal == 0) Py_RETURN_TRUE; else Py_RETURN_FALSE; + } + #endif + if (PyFloat_CheckExact(op1)) { + const long b = intval; + double a = PyFloat_AS_DOUBLE(op1); + if ((double)a == (double)b) Py_RETURN_TRUE; else Py_RETURN_FALSE; + } + return ( + PyObject_RichCompare(op1, op2, Py_EQ)); +} + +/* Import */ +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { + PyObject *empty_list = 0; + PyObject *module = 0; + PyObject *global_dict = 0; + PyObject *empty_dict = 0; + PyObject *list; + #if PY_MAJOR_VERSION < 3 + PyObject *py_import; + py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); + if (!py_import) + goto bad; + #endif + if (from_list) + list = from_list; + else { + empty_list = PyList_New(0); + if (!empty_list) + goto bad; + list = empty_list; + } + global_dict = PyModule_GetDict(__pyx_m); + if (!global_dict) + goto bad; + empty_dict = PyDict_New(); + if (!empty_dict) + goto bad; + { + #if PY_MAJOR_VERSION >= 3 + if (level == -1) { + if (strchr(__Pyx_MODULE_NAME, '.')) { + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, 1); + if (!module) { + if (!PyErr_ExceptionMatches(PyExc_ImportError)) + goto bad; + PyErr_Clear(); + } + } + level = 0; + } + #endif + if (!module) { + #if PY_MAJOR_VERSION < 3 + PyObject *py_level = PyInt_FromLong(level); + if (!py_level) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, py_level, (PyObject *)NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, level); + #endif + } + } +bad: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(py_import); + #endif + Py_XDECREF(empty_list); + Py_XDECREF(empty_dict); + return module; +} + +/* GetModuleGlobalName */ +#if CYTHON_USE_DICT_VERSIONS +static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value) +#else +static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) +#endif +{ + PyObject *result; +#if !CYTHON_AVOID_BORROWED_REFS +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 + result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } else if (unlikely(PyErr_Occurred())) { + return NULL; + } +#else + result = PyDict_GetItem(__pyx_d, name); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } +#endif +#else + result = PyObject_GetItem(__pyx_d, name); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } + PyErr_Clear(); +#endif + return __Pyx_GetBuiltinName(name); +} + +/* PyObjectCallNoArg */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { +#if CYTHON_FAST_PYCALL + if (PyFunction_Check(func)) { + return __Pyx_PyFunction_FastCall(func, NULL, 0); + } +#endif +#ifdef __Pyx_CyFunction_USED + if (likely(PyCFunction_Check(func) || __Pyx_CyFunction_Check(func))) +#else + if (likely(PyCFunction_Check(func))) +#endif + { + if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) { + return __Pyx_PyObject_CallMethO(func, NULL); + } + } + return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL); +} +#endif + +/* GetItemInt */ +static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { + PyObject *r; + if (!j) return NULL; + r = PyObject_GetItem(o, j); + Py_DECREF(j); + return r; +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, + CYTHON_NCP_UNUSED int wraparound, + CYTHON_NCP_UNUSED int boundscheck) { +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + Py_ssize_t wrapped_i = i; + if (wraparound & unlikely(i < 0)) { + wrapped_i += PyList_GET_SIZE(o); + } + if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) { + PyObject *r = PyList_GET_ITEM(o, wrapped_i); + Py_INCREF(r); + return r; + } + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +#else + return PySequence_GetItem(o, i); +#endif +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, + CYTHON_NCP_UNUSED int wraparound, + CYTHON_NCP_UNUSED int boundscheck) { +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + Py_ssize_t wrapped_i = i; + if (wraparound & unlikely(i < 0)) { + wrapped_i += PyTuple_GET_SIZE(o); + } + if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) { + PyObject *r = PyTuple_GET_ITEM(o, wrapped_i); + Py_INCREF(r); + return r; + } + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +#else + return PySequence_GetItem(o, i); +#endif +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, + CYTHON_NCP_UNUSED int wraparound, + CYTHON_NCP_UNUSED int boundscheck) { +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS + if (is_list || PyList_CheckExact(o)) { + Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); + if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) { + PyObject *r = PyList_GET_ITEM(o, n); + Py_INCREF(r); + return r; + } + } + else if (PyTuple_CheckExact(o)) { + Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o); + if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) { + PyObject *r = PyTuple_GET_ITEM(o, n); + Py_INCREF(r); + return r; + } + } else { + PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence; + if (likely(m && m->sq_item)) { + if (wraparound && unlikely(i < 0) && likely(m->sq_length)) { + Py_ssize_t l = m->sq_length(o); + if (likely(l >= 0)) { + i += l; + } else { + if (!PyErr_ExceptionMatches(PyExc_OverflowError)) + return NULL; + PyErr_Clear(); + } + } + return m->sq_item(o, i); + } + } +#else + if (is_list || PySequence_Check(o)) { + return PySequence_GetItem(o, i); + } +#endif + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +} + +/* PyObjectGetMethod */ +static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method) { + PyObject *attr; +#if CYTHON_UNPACK_METHODS && CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_PYTYPE_LOOKUP + PyTypeObject *tp = Py_TYPE(obj); + PyObject *descr; + descrgetfunc f = NULL; + PyObject **dictptr, *dict; + int meth_found = 0; + assert (*method == NULL); + if (unlikely(tp->tp_getattro != PyObject_GenericGetAttr)) { + attr = __Pyx_PyObject_GetAttrStr(obj, name); + goto try_unpack; + } + if (unlikely(tp->tp_dict == NULL) && unlikely(PyType_Ready(tp) < 0)) { + return 0; + } + descr = _PyType_Lookup(tp, name); + if (likely(descr != NULL)) { + Py_INCREF(descr); +#if PY_MAJOR_VERSION >= 3 + #ifdef __Pyx_CyFunction_USED + if (likely(PyFunction_Check(descr) || (Py_TYPE(descr) == &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr))) + #else + if (likely(PyFunction_Check(descr) || (Py_TYPE(descr) == &PyMethodDescr_Type))) + #endif +#else + #ifdef __Pyx_CyFunction_USED + if (likely(PyFunction_Check(descr) || __Pyx_CyFunction_Check(descr))) + #else + if (likely(PyFunction_Check(descr))) + #endif +#endif + { + meth_found = 1; + } else { + f = Py_TYPE(descr)->tp_descr_get; + if (f != NULL && PyDescr_IsData(descr)) { + attr = f(descr, obj, (PyObject *)Py_TYPE(obj)); + Py_DECREF(descr); + goto try_unpack; + } + } + } + dictptr = _PyObject_GetDictPtr(obj); + if (dictptr != NULL && (dict = *dictptr) != NULL) { + Py_INCREF(dict); + attr = __Pyx_PyDict_GetItemStr(dict, name); + if (attr != NULL) { + Py_INCREF(attr); + Py_DECREF(dict); + Py_XDECREF(descr); + goto try_unpack; + } + Py_DECREF(dict); + } + if (meth_found) { + *method = descr; + return 1; + } + if (f != NULL) { + attr = f(descr, obj, (PyObject *)Py_TYPE(obj)); + Py_DECREF(descr); + goto try_unpack; + } + if (descr != NULL) { + *method = descr; + return 0; + } + PyErr_Format(PyExc_AttributeError, +#if PY_MAJOR_VERSION >= 3 + "'%.50s' object has no attribute '%U'", + tp->tp_name, name); +#else + "'%.50s' object has no attribute '%.400s'", + tp->tp_name, PyString_AS_STRING(name)); +#endif + return 0; +#else + attr = __Pyx_PyObject_GetAttrStr(obj, name); + goto try_unpack; +#endif +try_unpack: +#if CYTHON_UNPACK_METHODS + if (likely(attr) && PyMethod_Check(attr) && likely(PyMethod_GET_SELF(attr) == obj)) { + PyObject *function = PyMethod_GET_FUNCTION(attr); + Py_INCREF(function); + Py_DECREF(attr); + *method = function; + return 1; + } +#endif + *method = attr; + return 0; +} + +/* PyObjectCallMethod1 */ +static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg) { + PyObject *result = __Pyx_PyObject_CallOneArg(method, arg); + Py_DECREF(method); + return result; +} +static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) { + PyObject *method = NULL, *result; + int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method); + if (likely(is_method)) { + result = __Pyx_PyObject_Call2Args(method, obj, arg); + Py_DECREF(method); + return result; + } + if (unlikely(!method)) return NULL; + return __Pyx__PyObject_CallMethod1(method, arg); +} + +/* append */ +static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x) { + if (likely(PyList_CheckExact(L))) { + if (unlikely(__Pyx_PyList_Append(L, x) < 0)) return -1; + } else { + PyObject* retval = __Pyx_PyObject_CallMethod1(L, __pyx_n_s_append, x); + if (unlikely(!retval)) + return -1; + Py_DECREF(retval); + } + return 0; +} + +/* GetAttr */ +static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) { +#if CYTHON_USE_TYPE_SLOTS +#if PY_MAJOR_VERSION >= 3 + if (likely(PyUnicode_Check(n))) +#else + if (likely(PyString_Check(n))) +#endif + return __Pyx_PyObject_GetAttrStr(o, n); +#endif + return PyObject_GetAttr(o, n); +} + +/* GetAttr3 */ +static PyObject *__Pyx_GetAttr3Default(PyObject *d) { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) + return NULL; + __Pyx_PyErr_Clear(); + Py_INCREF(d); + return d; +} +static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) { + PyObject *r = __Pyx_GetAttr(o, n); + return (likely(r)) ? r : __Pyx_GetAttr3Default(d); +} + +/* StringJoin */ +#if !CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values) { + return PyObject_CallMethodObjArgs(sep, __pyx_n_s_join, values, NULL); +} +#endif + +/* WriteUnraisableException */ +static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno, + CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename, + int full_traceback, CYTHON_UNUSED int nogil) { + PyObject *old_exc, *old_val, *old_tb; + PyObject *ctx; + __Pyx_PyThreadState_declare +#ifdef WITH_THREAD + PyGILState_STATE state; + if (nogil) + state = PyGILState_Ensure(); +#ifdef _MSC_VER + else state = (PyGILState_STATE)-1; +#endif +#endif + __Pyx_PyThreadState_assign + __Pyx_ErrFetch(&old_exc, &old_val, &old_tb); + if (full_traceback) { + Py_XINCREF(old_exc); + Py_XINCREF(old_val); + Py_XINCREF(old_tb); + __Pyx_ErrRestore(old_exc, old_val, old_tb); + PyErr_PrintEx(1); + } + #if PY_MAJOR_VERSION < 3 + ctx = PyString_FromString(name); + #else + ctx = PyUnicode_FromString(name); + #endif + __Pyx_ErrRestore(old_exc, old_val, old_tb); + if (!ctx) { + PyErr_WriteUnraisable(Py_None); + } else { + PyErr_WriteUnraisable(ctx); + Py_DECREF(ctx); + } +#ifdef WITH_THREAD + if (nogil) + PyGILState_Release(state); +#endif +} + +/* RaiseException */ +#if PY_MAJOR_VERSION < 3 +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, + CYTHON_UNUSED PyObject *cause) { + __Pyx_PyThreadState_declare + Py_XINCREF(type); + if (!value || value == Py_None) + value = NULL; + else + Py_INCREF(value); + if (!tb || tb == Py_None) + tb = NULL; + else { + Py_INCREF(tb); + if (!PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto raise_error; + } + } + if (PyType_Check(type)) { +#if CYTHON_COMPILING_IN_PYPY + if (!value) { + Py_INCREF(Py_None); + value = Py_None; + } +#endif + PyErr_NormalizeException(&type, &value, &tb); + } else { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto raise_error; + } + value = type; + type = (PyObject*) Py_TYPE(type); + Py_INCREF(type); + if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto raise_error; + } + } + __Pyx_PyThreadState_assign + __Pyx_ErrRestore(type, value, tb); + return; +raise_error: + Py_XDECREF(value); + Py_XDECREF(type); + Py_XDECREF(tb); + return; +} +#else +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { + PyObject* owned_instance = NULL; + if (tb == Py_None) { + tb = 0; + } else if (tb && !PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto bad; + } + if (value == Py_None) + value = 0; + if (PyExceptionInstance_Check(type)) { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto bad; + } + value = type; + type = (PyObject*) Py_TYPE(value); + } else if (PyExceptionClass_Check(type)) { + PyObject *instance_class = NULL; + if (value && PyExceptionInstance_Check(value)) { + instance_class = (PyObject*) Py_TYPE(value); + if (instance_class != type) { + int is_subclass = PyObject_IsSubclass(instance_class, type); + if (!is_subclass) { + instance_class = NULL; + } else if (unlikely(is_subclass == -1)) { + goto bad; + } else { + type = instance_class; + } + } + } + if (!instance_class) { + PyObject *args; + if (!value) + args = PyTuple_New(0); + else if (PyTuple_Check(value)) { + Py_INCREF(value); + args = value; + } else + args = PyTuple_Pack(1, value); + if (!args) + goto bad; + owned_instance = PyObject_Call(type, args, NULL); + Py_DECREF(args); + if (!owned_instance) + goto bad; + value = owned_instance; + if (!PyExceptionInstance_Check(value)) { + PyErr_Format(PyExc_TypeError, + "calling %R should have returned an instance of " + "BaseException, not %R", + type, Py_TYPE(value)); + goto bad; + } + } + } else { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto bad; + } + if (cause) { + PyObject *fixed_cause; + if (cause == Py_None) { + fixed_cause = NULL; + } else if (PyExceptionClass_Check(cause)) { + fixed_cause = PyObject_CallObject(cause, NULL); + if (fixed_cause == NULL) + goto bad; + } else if (PyExceptionInstance_Check(cause)) { + fixed_cause = cause; + Py_INCREF(fixed_cause); + } else { + PyErr_SetString(PyExc_TypeError, + "exception causes must derive from " + "BaseException"); + goto bad; + } + PyException_SetCause(value, fixed_cause); + } + PyErr_SetObject(type, value); + if (tb) { +#if CYTHON_COMPILING_IN_PYPY + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); + Py_INCREF(tb); + PyErr_Restore(tmp_type, tmp_value, tb); + Py_XDECREF(tmp_tb); +#else + PyThreadState *tstate = __Pyx_PyThreadState_Current; + PyObject* tmp_tb = tstate->curexc_traceback; + if (tb != tmp_tb) { + Py_INCREF(tb); + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_tb); + } +#endif + } +bad: + Py_XDECREF(owned_instance); + return; +} +#endif + +/* GetException */ +#if CYTHON_FAST_THREAD_STATE +static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) +#else +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) +#endif +{ + PyObject *local_type, *local_value, *local_tb; +#if CYTHON_FAST_THREAD_STATE + PyObject *tmp_type, *tmp_value, *tmp_tb; + local_type = tstate->curexc_type; + local_value = tstate->curexc_value; + local_tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +#else + PyErr_Fetch(&local_type, &local_value, &local_tb); +#endif + PyErr_NormalizeException(&local_type, &local_value, &local_tb); +#if CYTHON_FAST_THREAD_STATE + if (unlikely(tstate->curexc_type)) +#else + if (unlikely(PyErr_Occurred())) +#endif + goto bad; + #if PY_MAJOR_VERSION >= 3 + if (local_tb) { + if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) + goto bad; + } + #endif + Py_XINCREF(local_tb); + Py_XINCREF(local_type); + Py_XINCREF(local_value); + *type = local_type; + *value = local_value; + *tb = local_tb; +#if CYTHON_FAST_THREAD_STATE + #if CYTHON_USE_EXC_INFO_STACK + { + _PyErr_StackItem *exc_info = tstate->exc_info; + tmp_type = exc_info->exc_type; + tmp_value = exc_info->exc_value; + tmp_tb = exc_info->exc_traceback; + exc_info->exc_type = local_type; + exc_info->exc_value = local_value; + exc_info->exc_traceback = local_tb; + } + #else + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = local_type; + tstate->exc_value = local_value; + tstate->exc_traceback = local_tb; + #endif + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#else + PyErr_SetExcInfo(local_type, local_value, local_tb); +#endif + return 0; +bad: + *type = 0; + *value = 0; + *tb = 0; + Py_XDECREF(local_type); + Py_XDECREF(local_value); + Py_XDECREF(local_tb); + return -1; +} + +/* SwapException */ +#if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + #if CYTHON_USE_EXC_INFO_STACK + _PyErr_StackItem *exc_info = tstate->exc_info; + tmp_type = exc_info->exc_type; + tmp_value = exc_info->exc_value; + tmp_tb = exc_info->exc_traceback; + exc_info->exc_type = *type; + exc_info->exc_value = *value; + exc_info->exc_traceback = *tb; + #else + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = *type; + tstate->exc_value = *value; + tstate->exc_traceback = *tb; + #endif + *type = tmp_type; + *value = tmp_value; + *tb = tmp_tb; +} +#else +static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb); + PyErr_SetExcInfo(*type, *value, *tb); + *type = tmp_type; + *value = tmp_value; + *tb = tmp_tb; +} +#endif + +/* None */ +static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) { + PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname); +} + +/* PyObjectCallMethod0 */ +static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) { + PyObject *method = NULL, *result = NULL; + int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method); + if (likely(is_method)) { + result = __Pyx_PyObject_CallOneArg(method, obj); + Py_DECREF(method); + return result; + } + if (unlikely(!method)) goto bad; + result = __Pyx_PyObject_CallNoArg(method); + Py_DECREF(method); +bad: + return result; +} + +/* UnpackUnboundCMethod */ +static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target) { + PyObject *method; + method = __Pyx_PyObject_GetAttrStr(target->type, *target->method_name); + if (unlikely(!method)) + return -1; + target->method = method; +#if CYTHON_COMPILING_IN_CPYTHON + #if PY_MAJOR_VERSION >= 3 + if (likely(__Pyx_TypeCheck(method, &PyMethodDescr_Type))) + #endif + { + PyMethodDescrObject *descr = (PyMethodDescrObject*) method; + target->func = descr->d_method->ml_meth; + target->flag = descr->d_method->ml_flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_STACKLESS); + } +#endif + return 0; +} + +/* CallUnboundCMethod0 */ +static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self) { + PyObject *args, *result = NULL; + if (unlikely(!cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL; +#if CYTHON_ASSUME_SAFE_MACROS + args = PyTuple_New(1); + if (unlikely(!args)) goto bad; + Py_INCREF(self); + PyTuple_SET_ITEM(args, 0, self); +#else + args = PyTuple_Pack(1, self); + if (unlikely(!args)) goto bad; +#endif + result = __Pyx_PyObject_Call(cfunc->method, args, NULL); + Py_DECREF(args); +bad: + return result; +} + +/* pop */ +static CYTHON_INLINE PyObject* __Pyx__PyObject_Pop(PyObject* L) { + if (Py_TYPE(L) == &PySet_Type) { + return PySet_Pop(L); + } + return __Pyx_PyObject_CallMethod0(L, __pyx_n_s_pop); +} +#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS +static CYTHON_INLINE PyObject* __Pyx_PyList_Pop(PyObject* L) { + if (likely(PyList_GET_SIZE(L) > (((PyListObject*)L)->allocated >> 1))) { + Py_SIZE(L) -= 1; + return PyList_GET_ITEM(L, PyList_GET_SIZE(L)); + } + return __Pyx_CallUnboundCMethod0(&__pyx_umethod_PyList_Type_pop, L); +} +#endif + +/* ImportFrom */ +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { + PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); + if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_Format(PyExc_ImportError, + #if PY_MAJOR_VERSION < 3 + "cannot import name %.230s", PyString_AS_STRING(name)); + #else + "cannot import name %S", name); + #endif + } + return value; +} + +/* ExtTypeTest */ +static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { + if (unlikely(!type)) { + PyErr_SetString(PyExc_SystemError, "Missing type object"); + return 0; + } + if (likely(__Pyx_TypeCheck(obj, type))) + return 1; + PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s", + Py_TYPE(obj)->tp_name, type->tp_name); + return 0; +} + +/* PyIntCompare */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_NeObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED long inplace) { + if (op1 == op2) { + Py_RETURN_FALSE; + } + #if PY_MAJOR_VERSION < 3 + if (likely(PyInt_CheckExact(op1))) { + const long b = intval; + long a = PyInt_AS_LONG(op1); + if (a != b) Py_RETURN_TRUE; else Py_RETURN_FALSE; + } + #endif + #if CYTHON_USE_PYLONG_INTERNALS + if (likely(PyLong_CheckExact(op1))) { + int unequal; + unsigned long uintval; + Py_ssize_t size = Py_SIZE(op1); + const digit* digits = ((PyLongObject*)op1)->ob_digit; + if (intval == 0) { + if (size != 0) Py_RETURN_TRUE; else Py_RETURN_FALSE; + } else if (intval < 0) { + if (size >= 0) + Py_RETURN_TRUE; + intval = -intval; + size = -size; + } else { + if (size <= 0) + Py_RETURN_TRUE; + } + uintval = (unsigned long) intval; +#if PyLong_SHIFT * 4 < SIZEOF_LONG*8 + if (uintval >> (PyLong_SHIFT * 4)) { + unequal = (size != 5) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) + | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[4] != ((uintval >> (4 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); + } else +#endif +#if PyLong_SHIFT * 3 < SIZEOF_LONG*8 + if (uintval >> (PyLong_SHIFT * 3)) { + unequal = (size != 4) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) + | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); + } else +#endif +#if PyLong_SHIFT * 2 < SIZEOF_LONG*8 + if (uintval >> (PyLong_SHIFT * 2)) { + unequal = (size != 3) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) + | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); + } else +#endif +#if PyLong_SHIFT * 1 < SIZEOF_LONG*8 + if (uintval >> (PyLong_SHIFT * 1)) { + unequal = (size != 2) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) + | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); + } else +#endif + unequal = (size != 1) || (((unsigned long) digits[0]) != (uintval & (unsigned long) PyLong_MASK)); + if (unequal != 0) Py_RETURN_TRUE; else Py_RETURN_FALSE; + } + #endif + if (PyFloat_CheckExact(op1)) { + const long b = intval; + double a = PyFloat_AS_DOUBLE(op1); + if ((double)a != (double)b) Py_RETURN_TRUE; else Py_RETURN_FALSE; + } + return ( + PyObject_RichCompare(op1, op2, Py_NE)); +} + +/* RaiseTooManyValuesToUnpack */ +static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { + PyErr_Format(PyExc_ValueError, + "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected); +} + +/* RaiseNeedMoreValuesToUnpack */ +static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { + PyErr_Format(PyExc_ValueError, + "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack", + index, (index == 1) ? "" : "s"); +} + +/* IterFinish */ +static CYTHON_INLINE int __Pyx_IterFinish(void) { +#if CYTHON_FAST_THREAD_STATE + PyThreadState *tstate = __Pyx_PyThreadState_Current; + PyObject* exc_type = tstate->curexc_type; + if (unlikely(exc_type)) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) { + PyObject *exc_value, *exc_tb; + exc_value = tstate->curexc_value; + exc_tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; + Py_DECREF(exc_type); + Py_XDECREF(exc_value); + Py_XDECREF(exc_tb); + return 0; + } else { + return -1; + } + } + return 0; +#else + if (unlikely(PyErr_Occurred())) { + if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) { + PyErr_Clear(); + return 0; + } else { + return -1; + } + } + return 0; +#endif +} + +/* UnpackItemEndCheck */ +static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { + if (unlikely(retval)) { + Py_DECREF(retval); + __Pyx_RaiseTooManyValuesError(expected); + return -1; + } else { + return __Pyx_IterFinish(); + } + return 0; +} + +/* CallNextTpDealloc */ +static void __Pyx_call_next_tp_dealloc(PyObject* obj, destructor current_tp_dealloc) { + PyTypeObject* type = Py_TYPE(obj); + while (type && type->tp_dealloc != current_tp_dealloc) + type = type->tp_base; + while (type && type->tp_dealloc == current_tp_dealloc) + type = type->tp_base; + if (type) + type->tp_dealloc(obj); +} + +/* CallNextTpTraverse */ +static int __Pyx_call_next_tp_traverse(PyObject* obj, visitproc v, void *a, traverseproc current_tp_traverse) { + PyTypeObject* type = Py_TYPE(obj); + while (type && type->tp_traverse != current_tp_traverse) + type = type->tp_base; + while (type && type->tp_traverse == current_tp_traverse) + type = type->tp_base; + if (type && type->tp_traverse) + return type->tp_traverse(obj, v, a); + return 0; +} + +/* CallNextTpClear */ +static void __Pyx_call_next_tp_clear(PyObject* obj, inquiry current_tp_clear) { + PyTypeObject* type = Py_TYPE(obj); + while (type && type->tp_clear != current_tp_clear) + type = type->tp_base; + while (type && type->tp_clear == current_tp_clear) + type = type->tp_base; + if (type && type->tp_clear) + type->tp_clear(obj); +} + +/* TypeImport */ +#ifndef __PYX_HAVE_RT_ImportType +#define __PYX_HAVE_RT_ImportType +static PyTypeObject *__Pyx_ImportType(PyObject *module, const char *module_name, const char *class_name, + size_t size, enum __Pyx_ImportType_CheckSize check_size) +{ + PyObject *result = 0; + char warning[200]; + Py_ssize_t basicsize; +#ifdef Py_LIMITED_API + PyObject *py_basicsize; +#endif + result = PyObject_GetAttrString(module, class_name); + if (!result) + goto bad; + if (!PyType_Check(result)) { + PyErr_Format(PyExc_TypeError, + "%.200s.%.200s is not a type object", + module_name, class_name); + goto bad; + } +#ifndef Py_LIMITED_API + basicsize = ((PyTypeObject *)result)->tp_basicsize; +#else + py_basicsize = PyObject_GetAttrString(result, "__basicsize__"); + if (!py_basicsize) + goto bad; + basicsize = PyLong_AsSsize_t(py_basicsize); + Py_DECREF(py_basicsize); + py_basicsize = 0; + if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred()) + goto bad; +#endif + if ((size_t)basicsize < size) { + PyErr_Format(PyExc_ValueError, + "%.200s.%.200s size changed, may indicate binary incompatibility. " + "Expected %zd from C header, got %zd from PyObject", + module_name, class_name, size, basicsize); + goto bad; + } + if (check_size == __Pyx_ImportType_CheckSize_Error && (size_t)basicsize != size) { + PyErr_Format(PyExc_ValueError, + "%.200s.%.200s size changed, may indicate binary incompatibility. " + "Expected %zd from C header, got %zd from PyObject", + module_name, class_name, size, basicsize); + goto bad; + } + else if (check_size == __Pyx_ImportType_CheckSize_Warn && (size_t)basicsize > size) { + PyOS_snprintf(warning, sizeof(warning), + "%s.%s size changed, may indicate binary incompatibility. " + "Expected %zd from C header, got %zd from PyObject", + module_name, class_name, size, basicsize); + if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad; + } + return (PyTypeObject *)result; +bad: + Py_XDECREF(result); + return NULL; +} +#endif + +/* GetVTable */ +static void* __Pyx_GetVtable(PyObject *dict) { + void* ptr; + PyObject *ob = PyObject_GetItem(dict, __pyx_n_s_pyx_vtable); + if (!ob) + goto bad; +#if PY_VERSION_HEX >= 0x02070000 + ptr = PyCapsule_GetPointer(ob, 0); +#else + ptr = PyCObject_AsVoidPtr(ob); +#endif + if (!ptr && !PyErr_Occurred()) + PyErr_SetString(PyExc_RuntimeError, "invalid vtable found for imported type"); + Py_DECREF(ob); + return ptr; +bad: + Py_XDECREF(ob); + return NULL; +} + +/* PyObject_GenericGetAttrNoDict */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) { + PyErr_Format(PyExc_AttributeError, +#if PY_MAJOR_VERSION >= 3 + "'%.50s' object has no attribute '%U'", + tp->tp_name, attr_name); +#else + "'%.50s' object has no attribute '%.400s'", + tp->tp_name, PyString_AS_STRING(attr_name)); +#endif + return NULL; +} +static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) { + PyObject *descr; + PyTypeObject *tp = Py_TYPE(obj); + if (unlikely(!PyString_Check(attr_name))) { + return PyObject_GenericGetAttr(obj, attr_name); + } + assert(!tp->tp_dictoffset); + descr = _PyType_Lookup(tp, attr_name); + if (unlikely(!descr)) { + return __Pyx_RaiseGenericGetAttributeError(tp, attr_name); + } + Py_INCREF(descr); + #if PY_MAJOR_VERSION < 3 + if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS))) + #endif + { + descrgetfunc f = Py_TYPE(descr)->tp_descr_get; + if (unlikely(f)) { + PyObject *res = f(descr, obj, (PyObject *)tp); + Py_DECREF(descr); + return res; + } + } + return descr; +} +#endif + +/* SetVTable */ +static int __Pyx_SetVtable(PyObject *dict, void *vtable) { +#if PY_VERSION_HEX >= 0x02070000 + PyObject *ob = PyCapsule_New(vtable, 0, 0); +#else + PyObject *ob = PyCObject_FromVoidPtr(vtable, 0); +#endif + if (!ob) + goto bad; + if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0) + goto bad; + Py_DECREF(ob); + return 0; +bad: + Py_XDECREF(ob); + return -1; +} + +/* PyObject_GenericGetAttr */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) { + if (unlikely(Py_TYPE(obj)->tp_dictoffset)) { + return PyObject_GenericGetAttr(obj, attr_name); + } + return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name); +} +#endif + +/* HasAttr */ +static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) { + PyObject *r; + if (unlikely(!__Pyx_PyBaseString_Check(n))) { + PyErr_SetString(PyExc_TypeError, + "hasattr(): attribute name must be string"); + return -1; + } + r = __Pyx_GetAttr(o, n); + if (unlikely(!r)) { + PyErr_Clear(); + return 0; + } else { + Py_DECREF(r); + return 1; + } +} + +/* FetchCommonType */ +static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { + PyObject* fake_module; + PyTypeObject* cached_type = NULL; + fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI); + if (!fake_module) return NULL; + Py_INCREF(fake_module); + cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name); + if (cached_type) { + if (!PyType_Check((PyObject*)cached_type)) { + PyErr_Format(PyExc_TypeError, + "Shared Cython type %.200s is not a type object", + type->tp_name); + goto bad; + } + if (cached_type->tp_basicsize != type->tp_basicsize) { + PyErr_Format(PyExc_TypeError, + "Shared Cython type %.200s has the wrong size, try recompiling", + type->tp_name); + goto bad; + } + } else { + if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; + PyErr_Clear(); + if (PyType_Ready(type) < 0) goto bad; + if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0) + goto bad; + Py_INCREF(type); + cached_type = type; + } +done: + Py_DECREF(fake_module); + return cached_type; +bad: + Py_XDECREF(cached_type); + cached_type = NULL; + goto done; +} + +/* CythonFunction */ +#include +static PyObject * +__Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure) +{ + if (unlikely(op->func_doc == NULL)) { + if (op->func.m_ml->ml_doc) { +#if PY_MAJOR_VERSION >= 3 + op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc); +#else + op->func_doc = PyString_FromString(op->func.m_ml->ml_doc); +#endif + if (unlikely(op->func_doc == NULL)) + return NULL; + } else { + Py_INCREF(Py_None); + return Py_None; + } + } + Py_INCREF(op->func_doc); + return op->func_doc; +} +static int +__Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context) +{ + PyObject *tmp = op->func_doc; + if (value == NULL) { + value = Py_None; + } + Py_INCREF(value); + op->func_doc = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + if (unlikely(op->func_name == NULL)) { +#if PY_MAJOR_VERSION >= 3 + op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name); +#else + op->func_name = PyString_InternFromString(op->func.m_ml->ml_name); +#endif + if (unlikely(op->func_name == NULL)) + return NULL; + } + Py_INCREF(op->func_name); + return op->func_name; +} +static int +__Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context) +{ + PyObject *tmp; +#if PY_MAJOR_VERSION >= 3 + if (unlikely(value == NULL || !PyUnicode_Check(value))) +#else + if (unlikely(value == NULL || !PyString_Check(value))) +#endif + { + PyErr_SetString(PyExc_TypeError, + "__name__ must be set to a string object"); + return -1; + } + tmp = op->func_name; + Py_INCREF(value); + op->func_name = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + Py_INCREF(op->func_qualname); + return op->func_qualname; +} +static int +__Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context) +{ + PyObject *tmp; +#if PY_MAJOR_VERSION >= 3 + if (unlikely(value == NULL || !PyUnicode_Check(value))) +#else + if (unlikely(value == NULL || !PyString_Check(value))) +#endif + { + PyErr_SetString(PyExc_TypeError, + "__qualname__ must be set to a string object"); + return -1; + } + tmp = op->func_qualname; + Py_INCREF(value); + op->func_qualname = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED void *closure) +{ + PyObject *self; + self = m->func_closure; + if (self == NULL) + self = Py_None; + Py_INCREF(self); + return self; +} +static PyObject * +__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + if (unlikely(op->func_dict == NULL)) { + op->func_dict = PyDict_New(); + if (unlikely(op->func_dict == NULL)) + return NULL; + } + Py_INCREF(op->func_dict); + return op->func_dict; +} +static int +__Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context) +{ + PyObject *tmp; + if (unlikely(value == NULL)) { + PyErr_SetString(PyExc_TypeError, + "function's dictionary may not be deleted"); + return -1; + } + if (unlikely(!PyDict_Check(value))) { + PyErr_SetString(PyExc_TypeError, + "setting function's dictionary to a non-dict"); + return -1; + } + tmp = op->func_dict; + Py_INCREF(value); + op->func_dict = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + Py_INCREF(op->func_globals); + return op->func_globals; +} +static PyObject * +__Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + Py_INCREF(Py_None); + return Py_None; +} +static PyObject * +__Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + PyObject* result = (op->func_code) ? op->func_code : Py_None; + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { + int result = 0; + PyObject *res = op->defaults_getter((PyObject *) op); + if (unlikely(!res)) + return -1; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + op->defaults_tuple = PyTuple_GET_ITEM(res, 0); + Py_INCREF(op->defaults_tuple); + op->defaults_kwdict = PyTuple_GET_ITEM(res, 1); + Py_INCREF(op->defaults_kwdict); + #else + op->defaults_tuple = PySequence_ITEM(res, 0); + if (unlikely(!op->defaults_tuple)) result = -1; + else { + op->defaults_kwdict = PySequence_ITEM(res, 1); + if (unlikely(!op->defaults_kwdict)) result = -1; + } + #endif + Py_DECREF(res); + return result; +} +static int +__Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) { + PyObject* tmp; + if (!value) { + value = Py_None; + } else if (value != Py_None && !PyTuple_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__defaults__ must be set to a tuple object"); + return -1; + } + Py_INCREF(value); + tmp = op->defaults_tuple; + op->defaults_tuple = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) { + PyObject* result = op->defaults_tuple; + if (unlikely(!result)) { + if (op->defaults_getter) { + if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL; + result = op->defaults_tuple; + } else { + result = Py_None; + } + } + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) { + PyObject* tmp; + if (!value) { + value = Py_None; + } else if (value != Py_None && !PyDict_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__kwdefaults__ must be set to a dict object"); + return -1; + } + Py_INCREF(value); + tmp = op->defaults_kwdict; + op->defaults_kwdict = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) { + PyObject* result = op->defaults_kwdict; + if (unlikely(!result)) { + if (op->defaults_getter) { + if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL; + result = op->defaults_kwdict; + } else { + result = Py_None; + } + } + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) { + PyObject* tmp; + if (!value || value == Py_None) { + value = NULL; + } else if (!PyDict_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__annotations__ must be set to a dict object"); + return -1; + } + Py_XINCREF(value); + tmp = op->func_annotations; + op->func_annotations = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) { + PyObject* result = op->func_annotations; + if (unlikely(!result)) { + result = PyDict_New(); + if (unlikely(!result)) return NULL; + op->func_annotations = result; + } + Py_INCREF(result); + return result; +} +static PyGetSetDef __pyx_CyFunction_getsets[] = { + {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, + {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, + {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, + {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, + {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, + {(char *) "__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0}, + {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, + {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, + {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, + {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, + {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, + {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, + {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, + {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, + {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, + {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, + {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, + {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, + {0, 0, 0, 0, 0} +}; +static PyMemberDef __pyx_CyFunction_members[] = { + {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), PY_WRITE_RESTRICTED, 0}, + {0, 0, 0, 0, 0} +}; +static PyObject * +__Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args) +{ +#if PY_MAJOR_VERSION >= 3 + return PyUnicode_FromString(m->func.m_ml->ml_name); +#else + return PyString_FromString(m->func.m_ml->ml_name); +#endif +} +static PyMethodDef __pyx_CyFunction_methods[] = { + {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, + {0, 0, 0, 0} +}; +#if PY_VERSION_HEX < 0x030500A0 +#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist) +#else +#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func.m_weakreflist) +#endif +static PyObject *__Pyx_CyFunction_New(PyTypeObject *type, PyMethodDef *ml, int flags, PyObject* qualname, + PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { + __pyx_CyFunctionObject *op = PyObject_GC_New(__pyx_CyFunctionObject, type); + if (op == NULL) + return NULL; + op->flags = flags; + __Pyx_CyFunction_weakreflist(op) = NULL; + op->func.m_ml = ml; + op->func.m_self = (PyObject *) op; + Py_XINCREF(closure); + op->func_closure = closure; + Py_XINCREF(module); + op->func.m_module = module; + op->func_dict = NULL; + op->func_name = NULL; + Py_INCREF(qualname); + op->func_qualname = qualname; + op->func_doc = NULL; + op->func_classobj = NULL; + op->func_globals = globals; + Py_INCREF(op->func_globals); + Py_XINCREF(code); + op->func_code = code; + op->defaults_pyobjects = 0; + op->defaults = NULL; + op->defaults_tuple = NULL; + op->defaults_kwdict = NULL; + op->defaults_getter = NULL; + op->func_annotations = NULL; + PyObject_GC_Track(op); + return (PyObject *) op; +} +static int +__Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) +{ + Py_CLEAR(m->func_closure); + Py_CLEAR(m->func.m_module); + Py_CLEAR(m->func_dict); + Py_CLEAR(m->func_name); + Py_CLEAR(m->func_qualname); + Py_CLEAR(m->func_doc); + Py_CLEAR(m->func_globals); + Py_CLEAR(m->func_code); + Py_CLEAR(m->func_classobj); + Py_CLEAR(m->defaults_tuple); + Py_CLEAR(m->defaults_kwdict); + Py_CLEAR(m->func_annotations); + if (m->defaults) { + PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); + int i; + for (i = 0; i < m->defaults_pyobjects; i++) + Py_XDECREF(pydefaults[i]); + PyObject_Free(m->defaults); + m->defaults = NULL; + } + return 0; +} +static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m) +{ + if (__Pyx_CyFunction_weakreflist(m) != NULL) + PyObject_ClearWeakRefs((PyObject *) m); + __Pyx_CyFunction_clear(m); + PyObject_GC_Del(m); +} +static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) +{ + PyObject_GC_UnTrack(m); + __Pyx__CyFunction_dealloc(m); +} +static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) +{ + Py_VISIT(m->func_closure); + Py_VISIT(m->func.m_module); + Py_VISIT(m->func_dict); + Py_VISIT(m->func_name); + Py_VISIT(m->func_qualname); + Py_VISIT(m->func_doc); + Py_VISIT(m->func_globals); + Py_VISIT(m->func_code); + Py_VISIT(m->func_classobj); + Py_VISIT(m->defaults_tuple); + Py_VISIT(m->defaults_kwdict); + if (m->defaults) { + PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); + int i; + for (i = 0; i < m->defaults_pyobjects; i++) + Py_VISIT(pydefaults[i]); + } + return 0; +} +static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type) +{ + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) { + Py_INCREF(func); + return func; + } + if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) { + if (type == NULL) + type = (PyObject *)(Py_TYPE(obj)); + return __Pyx_PyMethod_New(func, type, (PyObject *)(Py_TYPE(type))); + } + if (obj == Py_None) + obj = NULL; + return __Pyx_PyMethod_New(func, obj, type); +} +static PyObject* +__Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) +{ +#if PY_MAJOR_VERSION >= 3 + return PyUnicode_FromFormat("", + op->func_qualname, (void *)op); +#else + return PyString_FromFormat("", + PyString_AsString(op->func_qualname), (void *)op); +#endif +} +static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) { + PyCFunctionObject* f = (PyCFunctionObject*)func; + PyCFunction meth = f->m_ml->ml_meth; + Py_ssize_t size; + switch (f->m_ml->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) { + case METH_VARARGS: + if (likely(kw == NULL || PyDict_Size(kw) == 0)) + return (*meth)(self, arg); + break; + case METH_VARARGS | METH_KEYWORDS: + return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw); + case METH_NOARGS: + if (likely(kw == NULL || PyDict_Size(kw) == 0)) { + size = PyTuple_GET_SIZE(arg); + if (likely(size == 0)) + return (*meth)(self, NULL); + PyErr_Format(PyExc_TypeError, + "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", + f->m_ml->ml_name, size); + return NULL; + } + break; + case METH_O: + if (likely(kw == NULL || PyDict_Size(kw) == 0)) { + size = PyTuple_GET_SIZE(arg); + if (likely(size == 1)) { + PyObject *result, *arg0; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + arg0 = PyTuple_GET_ITEM(arg, 0); + #else + arg0 = PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL; + #endif + result = (*meth)(self, arg0); + #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) + Py_DECREF(arg0); + #endif + return result; + } + PyErr_Format(PyExc_TypeError, + "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", + f->m_ml->ml_name, size); + return NULL; + } + break; + default: + PyErr_SetString(PyExc_SystemError, "Bad call flags in " + "__Pyx_CyFunction_Call. METH_OLDARGS is no " + "longer supported!"); + return NULL; + } + PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", + f->m_ml->ml_name); + return NULL; +} +static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { + return __Pyx_CyFunction_CallMethod(func, ((PyCFunctionObject*)func)->m_self, arg, kw); +} +static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) { + PyObject *result; + __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func; + if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { + Py_ssize_t argc; + PyObject *new_args; + PyObject *self; + argc = PyTuple_GET_SIZE(args); + new_args = PyTuple_GetSlice(args, 1, argc); + if (unlikely(!new_args)) + return NULL; + self = PyTuple_GetItem(args, 0); + if (unlikely(!self)) { + Py_DECREF(new_args); + return NULL; + } + result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw); + Py_DECREF(new_args); + } else { + result = __Pyx_CyFunction_Call(func, args, kw); + } + return result; +} +static PyTypeObject __pyx_CyFunctionType_type = { + PyVarObject_HEAD_INIT(0, 0) + "cython_function_or_method", + sizeof(__pyx_CyFunctionObject), + 0, + (destructor) __Pyx_CyFunction_dealloc, + 0, + 0, + 0, +#if PY_MAJOR_VERSION < 3 + 0, +#else + 0, +#endif + (reprfunc) __Pyx_CyFunction_repr, + 0, + 0, + 0, + 0, + __Pyx_CyFunction_CallAsMethod, + 0, + 0, + 0, + 0, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, + 0, + (traverseproc) __Pyx_CyFunction_traverse, + (inquiry) __Pyx_CyFunction_clear, + 0, +#if PY_VERSION_HEX < 0x030500A0 + offsetof(__pyx_CyFunctionObject, func_weakreflist), +#else + offsetof(PyCFunctionObject, m_weakreflist), +#endif + 0, + 0, + __pyx_CyFunction_methods, + __pyx_CyFunction_members, + __pyx_CyFunction_getsets, + 0, + 0, + __Pyx_CyFunction_descr_get, + 0, + offsetof(__pyx_CyFunctionObject, func_dict), + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, +#if PY_VERSION_HEX >= 0x030400a1 + 0, +#endif +}; +static int __pyx_CyFunction_init(void) { + __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); + if (unlikely(__pyx_CyFunctionType == NULL)) { + return -1; + } + return 0; +} +static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults = PyObject_Malloc(size); + if (unlikely(!m->defaults)) + return PyErr_NoMemory(); + memset(m->defaults, 0, size); + m->defaults_pyobjects = pyobjects; + return m->defaults; +} +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults_tuple = tuple; + Py_INCREF(tuple); +} +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults_kwdict = dict; + Py_INCREF(dict); +} +static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->func_annotations = dict; + Py_INCREF(dict); +} + +/* GetNameInClass */ +static PyObject *__Pyx_GetGlobalNameAfterAttributeLookup(PyObject *name) { + PyObject *result; + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) + return NULL; + __Pyx_PyErr_Clear(); + __Pyx_GetModuleGlobalNameUncached(result, name); + return result; +} +static PyObject *__Pyx__GetNameInClass(PyObject *nmspace, PyObject *name) { + PyObject *result; + result = __Pyx_PyObject_GetAttrStr(nmspace, name); + if (!result) { + result = __Pyx_GetGlobalNameAfterAttributeLookup(name); + } + return result; +} + +/* Globals */ +static PyObject* __Pyx_Globals(void) { + Py_ssize_t i; + PyObject *names; + PyObject *globals = __pyx_d; + Py_INCREF(globals); + names = PyObject_Dir(__pyx_m); + if (!names) + goto bad; + for (i = PyList_GET_SIZE(names)-1; i >= 0; i--) { +#if CYTHON_COMPILING_IN_PYPY + PyObject* name = PySequence_ITEM(names, i); + if (!name) + goto bad; +#else + PyObject* name = PyList_GET_ITEM(names, i); +#endif + if (!PyDict_Contains(globals, name)) { + PyObject* value = __Pyx_GetAttr(__pyx_m, name); + if (!value) { +#if CYTHON_COMPILING_IN_PYPY + Py_DECREF(name); +#endif + goto bad; + } + if (PyDict_SetItem(globals, name, value) < 0) { +#if CYTHON_COMPILING_IN_PYPY + Py_DECREF(name); +#endif + Py_DECREF(value); + goto bad; + } + } +#if CYTHON_COMPILING_IN_PYPY + Py_DECREF(name); +#endif + } + Py_DECREF(names); + return globals; +bad: + Py_XDECREF(names); + Py_XDECREF(globals); + return NULL; +} + +/* CLineInTraceback */ +#ifndef CYTHON_CLINE_IN_TRACEBACK +static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { + PyObject *use_cline; + PyObject *ptype, *pvalue, *ptraceback; +#if CYTHON_COMPILING_IN_CPYTHON + PyObject **cython_runtime_dict; +#endif + if (unlikely(!__pyx_cython_runtime)) { + return c_line; + } + __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); +#if CYTHON_COMPILING_IN_CPYTHON + cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); + if (likely(cython_runtime_dict)) { + __PYX_PY_DICT_LOOKUP_IF_MODIFIED( + use_cline, *cython_runtime_dict, + __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback)) + } else +#endif + { + PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback); + if (use_cline_obj) { + use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; + Py_DECREF(use_cline_obj); + } else { + PyErr_Clear(); + use_cline = NULL; + } + } + if (!use_cline) { + c_line = 0; + PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); + } + else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { + c_line = 0; + } + __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); + return c_line; +} +#endif + +/* CodeObjectCache */ +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { + int start = 0, mid = 0, end = count - 1; + if (end >= 0 && code_line > entries[end].code_line) { + return count; + } + while (start < end) { + mid = start + (end - start) / 2; + if (code_line < entries[mid].code_line) { + end = mid; + } else if (code_line > entries[mid].code_line) { + start = mid + 1; + } else { + return mid; + } + } + if (code_line <= entries[mid].code_line) { + return mid; + } else { + return mid + 1; + } +} +static PyCodeObject *__pyx_find_code_object(int code_line) { + PyCodeObject* code_object; + int pos; + if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { + return NULL; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { + return NULL; + } + code_object = __pyx_code_cache.entries[pos].code_object; + Py_INCREF(code_object); + return code_object; +} +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { + int pos, i; + __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; + if (unlikely(!code_line)) { + return; + } + if (unlikely(!entries)) { + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); + if (likely(entries)) { + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = 64; + __pyx_code_cache.count = 1; + entries[0].code_line = code_line; + entries[0].code_object = code_object; + Py_INCREF(code_object); + } + return; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { + PyCodeObject* tmp = entries[pos].code_object; + entries[pos].code_object = code_object; + Py_DECREF(tmp); + return; + } + if (__pyx_code_cache.count == __pyx_code_cache.max_count) { + int new_max = __pyx_code_cache.max_count + 64; + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( + __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry)); + if (unlikely(!entries)) { + return; + } + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = new_max; + } + for (i=__pyx_code_cache.count; i>pos; i--) { + entries[i] = entries[i-1]; + } + entries[pos].code_line = code_line; + entries[pos].code_object = code_object; + __pyx_code_cache.count++; + Py_INCREF(code_object); +} + +/* AddTraceback */ +#include "compile.h" +#include "frameobject.h" +#include "traceback.h" +static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( + const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyObject *py_srcfile = 0; + PyObject *py_funcname = 0; + #if PY_MAJOR_VERSION < 3 + py_srcfile = PyString_FromString(filename); + #else + py_srcfile = PyUnicode_FromString(filename); + #endif + if (!py_srcfile) goto bad; + if (c_line) { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + #else + py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + #endif + } + else { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromString(funcname); + #else + py_funcname = PyUnicode_FromString(funcname); + #endif + } + if (!py_funcname) goto bad; + py_code = __Pyx_PyCode_New( + 0, + 0, + 0, + 0, + 0, + __pyx_empty_bytes, /*PyObject *code,*/ + __pyx_empty_tuple, /*PyObject *consts,*/ + __pyx_empty_tuple, /*PyObject *names,*/ + __pyx_empty_tuple, /*PyObject *varnames,*/ + __pyx_empty_tuple, /*PyObject *freevars,*/ + __pyx_empty_tuple, /*PyObject *cellvars,*/ + py_srcfile, /*PyObject *filename,*/ + py_funcname, /*PyObject *name,*/ + py_line, + __pyx_empty_bytes /*PyObject *lnotab*/ + ); + Py_DECREF(py_srcfile); + Py_DECREF(py_funcname); + return py_code; +bad: + Py_XDECREF(py_srcfile); + Py_XDECREF(py_funcname); + return NULL; +} +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyFrameObject *py_frame = 0; + PyThreadState *tstate = __Pyx_PyThreadState_Current; + if (c_line) { + c_line = __Pyx_CLineForTraceback(tstate, c_line); + } + py_code = __pyx_find_code_object(c_line ? -c_line : py_line); + if (!py_code) { + py_code = __Pyx_CreateCodeObjectForTraceback( + funcname, c_line, py_line, filename); + if (!py_code) goto bad; + __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); + } + py_frame = PyFrame_New( + tstate, /*PyThreadState *tstate,*/ + py_code, /*PyCodeObject *code,*/ + __pyx_d, /*PyObject *globals,*/ + 0 /*PyObject *locals*/ + ); + if (!py_frame) goto bad; + __Pyx_PyFrame_SetLineNumber(py_frame, py_line); + PyTraceBack_Here(py_frame); +bad: + Py_XDECREF(py_code); + Py_XDECREF(py_frame); +} + +/* CIntToPy */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { + const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(long) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(long) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(long) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(long), + little, !is_unsigned); + } +} + +/* CIntFromPyVerify */ +#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ + __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) +#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ + __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) +#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ + {\ + func_type value = func_value;\ + if (sizeof(target_type) < sizeof(func_type)) {\ + if (unlikely(value != (func_type) (target_type) value)) {\ + func_type zero = 0;\ + if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ + return (target_type) -1;\ + if (is_unsigned && unlikely(value < zero))\ + goto raise_neg_overflow;\ + else\ + goto raise_overflow;\ + }\ + }\ + return (target_type) value;\ + } + +/* CIntToPy */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { + const int neg_one = (int) ((int) 0 - (int) 1), const_zero = (int) 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(int) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(int) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(int) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(int), + little, !is_unsigned); + } +} + +/* CIntFromPy */ +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { + const int neg_one = (int) ((int) 0 - (int) 1), const_zero = (int) 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(int) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (int) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (int) 0; + case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0]) + case 2: + if (8 * sizeof(int) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) { + return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + case 3: + if (8 * sizeof(int) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) { + return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + case 4: + if (8 * sizeof(int) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) { + return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (int) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if (sizeof(int) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (int) 0; + case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0])) + case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0]) + case -2: + if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { + return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 2: + if (8 * sizeof(int) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { + return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case -3: + if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { + return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 3: + if (8 * sizeof(int) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { + return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case -4: + if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { + return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 4: + if (8 * sizeof(int) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { + return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + } +#endif + if (sizeof(int) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + int val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (int) -1; + } + } else { + int val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (int) -1; + val = __Pyx_PyInt_As_int(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to int"); + return (int) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to int"); + return (int) -1; +} + +/* CIntFromPy */ +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { + const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(long) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (long) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (long) 0; + case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0]) + case 2: + if (8 * sizeof(long) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) { + return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + case 3: + if (8 * sizeof(long) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) { + return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + case 4: + if (8 * sizeof(long) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) { + return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (long) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if (sizeof(long) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (long) 0; + case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0])) + case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0]) + case -2: + if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 2: + if (8 * sizeof(long) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case -3: + if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 3: + if (8 * sizeof(long) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case -4: + if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 4: + if (8 * sizeof(long) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + } +#endif + if (sizeof(long) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + long val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (long) -1; + } + } else { + long val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (long) -1; + val = __Pyx_PyInt_As_long(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to long"); + return (long) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to long"); + return (long) -1; +} + +/* FastTypeChecks */ +#if CYTHON_COMPILING_IN_CPYTHON +static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) { + while (a) { + a = a->tp_base; + if (a == b) + return 1; + } + return b == &PyBaseObject_Type; +} +static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) { + PyObject *mro; + if (a == b) return 1; + mro = a->tp_mro; + if (likely(mro)) { + Py_ssize_t i, n; + n = PyTuple_GET_SIZE(mro); + for (i = 0; i < n; i++) { + if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b) + return 1; + } + return 0; + } + return __Pyx_InBases(a, b); +} +#if PY_MAJOR_VERSION == 2 +static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { + PyObject *exception, *value, *tb; + int res; + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ErrFetch(&exception, &value, &tb); + res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; + if (unlikely(res == -1)) { + PyErr_WriteUnraisable(err); + res = 0; + } + if (!res) { + res = PyObject_IsSubclass(err, exc_type2); + if (unlikely(res == -1)) { + PyErr_WriteUnraisable(err); + res = 0; + } + } + __Pyx_ErrRestore(exception, value, tb); + return res; +} +#else +static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { + int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0; + if (!res) { + res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); + } + return res; +} +#endif +static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { + Py_ssize_t i, n; + assert(PyExceptionClass_Check(exc_type)); + n = PyTuple_GET_SIZE(tuple); +#if PY_MAJOR_VERSION >= 3 + for (i=0; itp_setattro)) + return tp->tp_setattro(obj, attr_name, value); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_setattr)) + return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value); +#endif + return PyObject_SetAttr(obj, attr_name, value); +} +#endif + +/* VoidPtrExport */ +static int __Pyx_ExportVoidPtr(PyObject *name, void *p, const char *sig) { + PyObject *d; + PyObject *cobj = 0; + d = PyDict_GetItem(__pyx_d, __pyx_n_s_pyx_capi); + Py_XINCREF(d); + if (!d) { + d = PyDict_New(); + if (!d) + goto bad; + if (__Pyx_PyObject_SetAttrStr(__pyx_m, __pyx_n_s_pyx_capi, d) < 0) + goto bad; + } +#if PY_VERSION_HEX >= 0x02070000 + cobj = PyCapsule_New(p, sig, 0); +#else + cobj = PyCObject_FromVoidPtrAndDesc(p, (void *)sig, 0); +#endif + if (!cobj) + goto bad; + if (PyDict_SetItem(d, name, cobj) < 0) + goto bad; + Py_DECREF(cobj); + Py_DECREF(d); + return 0; +bad: + Py_XDECREF(cobj); + Py_XDECREF(d); + return -1; +} + +/* FunctionExport */ +static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig) { + PyObject *d = 0; + PyObject *cobj = 0; + union { + void (*fp)(void); + void *p; + } tmp; + d = PyObject_GetAttrString(__pyx_m, (char *)"__pyx_capi__"); + if (!d) { + PyErr_Clear(); + d = PyDict_New(); + if (!d) + goto bad; + Py_INCREF(d); + if (PyModule_AddObject(__pyx_m, (char *)"__pyx_capi__", d) < 0) + goto bad; + } + tmp.fp = f; +#if PY_VERSION_HEX >= 0x02070000 + cobj = PyCapsule_New(tmp.p, sig, 0); +#else + cobj = PyCObject_FromVoidPtrAndDesc(tmp.p, (void *)sig, 0); +#endif + if (!cobj) + goto bad; + if (PyDict_SetItemString(d, name, cobj) < 0) + goto bad; + Py_DECREF(cobj); + Py_DECREF(d); + return 0; +bad: + Py_XDECREF(cobj); + Py_XDECREF(d); + return -1; +} + +/* VoidPtrImport */ +#ifndef __PYX_HAVE_RT_ImportVoidPtr +#define __PYX_HAVE_RT_ImportVoidPtr +static int __Pyx_ImportVoidPtr(PyObject *module, const char *name, void **p, const char *sig) { + PyObject *d = 0; + PyObject *cobj = 0; + d = PyObject_GetAttrString(module, (char *)"__pyx_capi__"); + if (!d) + goto bad; + cobj = PyDict_GetItemString(d, name); + if (!cobj) { + PyErr_Format(PyExc_ImportError, + "%.200s does not export expected C variable %.200s", + PyModule_GetName(module), name); + goto bad; + } +#if PY_VERSION_HEX >= 0x02070000 + if (!PyCapsule_IsValid(cobj, sig)) { + PyErr_Format(PyExc_TypeError, + "C variable %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", + PyModule_GetName(module), name, sig, PyCapsule_GetName(cobj)); + goto bad; + } + *p = PyCapsule_GetPointer(cobj, sig); +#else + {const char *desc, *s1, *s2; + desc = (const char *)PyCObject_GetDesc(cobj); + if (!desc) + goto bad; + s1 = desc; s2 = sig; + while (*s1 != '\0' && *s1 == *s2) { s1++; s2++; } + if (*s1 != *s2) { + PyErr_Format(PyExc_TypeError, + "C variable %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", + PyModule_GetName(module), name, sig, desc); + goto bad; + } + *p = PyCObject_AsVoidPtr(cobj);} +#endif + if (!(*p)) + goto bad; + Py_DECREF(d); + return 0; +bad: + Py_XDECREF(d); + return -1; +} +#endif + +/* FunctionImport */ +#ifndef __PYX_HAVE_RT_ImportFunction +#define __PYX_HAVE_RT_ImportFunction +static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig) { + PyObject *d = 0; + PyObject *cobj = 0; + union { + void (*fp)(void); + void *p; + } tmp; + d = PyObject_GetAttrString(module, (char *)"__pyx_capi__"); + if (!d) + goto bad; + cobj = PyDict_GetItemString(d, funcname); + if (!cobj) { + PyErr_Format(PyExc_ImportError, + "%.200s does not export expected C function %.200s", + PyModule_GetName(module), funcname); + goto bad; + } +#if PY_VERSION_HEX >= 0x02070000 + if (!PyCapsule_IsValid(cobj, sig)) { + PyErr_Format(PyExc_TypeError, + "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", + PyModule_GetName(module), funcname, sig, PyCapsule_GetName(cobj)); + goto bad; + } + tmp.p = PyCapsule_GetPointer(cobj, sig); +#else + {const char *desc, *s1, *s2; + desc = (const char *)PyCObject_GetDesc(cobj); + if (!desc) + goto bad; + s1 = desc; s2 = sig; + while (*s1 != '\0' && *s1 == *s2) { s1++; s2++; } + if (*s1 != *s2) { + PyErr_Format(PyExc_TypeError, + "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", + PyModule_GetName(module), funcname, sig, desc); + goto bad; + } + tmp.p = PyCObject_AsVoidPtr(cobj);} +#endif + *f = tmp.fp; + if (!(*f)) + goto bad; + Py_DECREF(d); + return 0; +bad: + Py_XDECREF(d); + return -1; +} +#endif + +/* InitStrings */ +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { + while (t->p) { + #if PY_MAJOR_VERSION < 3 + if (t->is_unicode) { + *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); + } else if (t->intern) { + *t->p = PyString_InternFromString(t->s); + } else { + *t->p = PyString_FromStringAndSize(t->s, t->n - 1); + } + #else + if (t->is_unicode | t->is_str) { + if (t->intern) { + *t->p = PyUnicode_InternFromString(t->s); + } else if (t->encoding) { + *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); + } else { + *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); + } + } else { + *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); + } + #endif + if (!*t->p) + return -1; + if (PyObject_Hash(*t->p) == -1) + return -1; + ++t; + } + return 0; +} + +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { + return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); +} +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { + Py_ssize_t ignore; + return __Pyx_PyObject_AsStringAndSize(o, &ignore); +} +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +#if !CYTHON_PEP393_ENABLED +static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { + char* defenc_c; + PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); + if (!defenc) return NULL; + defenc_c = PyBytes_AS_STRING(defenc); +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + { + char* end = defenc_c + PyBytes_GET_SIZE(defenc); + char* c; + for (c = defenc_c; c < end; c++) { + if ((unsigned char) (*c) >= 128) { + PyUnicode_AsASCIIString(o); + return NULL; + } + } + } +#endif + *length = PyBytes_GET_SIZE(defenc); + return defenc_c; +} +#else +static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { + if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + if (likely(PyUnicode_IS_ASCII(o))) { + *length = PyUnicode_GET_LENGTH(o); + return PyUnicode_AsUTF8(o); + } else { + PyUnicode_AsASCIIString(o); + return NULL; + } +#else + return PyUnicode_AsUTF8AndSize(o, length); +#endif +} +#endif +#endif +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT + if ( +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + __Pyx_sys_getdefaultencoding_not_ascii && +#endif + PyUnicode_Check(o)) { + return __Pyx_PyUnicode_AsStringAndSize(o, length); + } else +#endif +#if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) + if (PyByteArray_Check(o)) { + *length = PyByteArray_GET_SIZE(o); + return PyByteArray_AS_STRING(o); + } else +#endif + { + char* result; + int r = PyBytes_AsStringAndSize(o, &result, length); + if (unlikely(r < 0)) { + return NULL; + } else { + return result; + } + } +} +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { + int is_true = x == Py_True; + if (is_true | (x == Py_False) | (x == Py_None)) return is_true; + else return PyObject_IsTrue(x); +} +static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) { + int retval; + if (unlikely(!x)) return -1; + retval = __Pyx_PyObject_IsTrue(x); + Py_DECREF(x); + return retval; +} +static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) { +#if PY_MAJOR_VERSION >= 3 + if (PyLong_Check(result)) { + if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, + "__int__ returned non-int (type %.200s). " + "The ability to return an instance of a strict subclass of int " + "is deprecated, and may be removed in a future version of Python.", + Py_TYPE(result)->tp_name)) { + Py_DECREF(result); + return NULL; + } + return result; + } +#endif + PyErr_Format(PyExc_TypeError, + "__%.4s__ returned non-%.4s (type %.200s)", + type_name, type_name, Py_TYPE(result)->tp_name); + Py_DECREF(result); + return NULL; +} +static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { +#if CYTHON_USE_TYPE_SLOTS + PyNumberMethods *m; +#endif + const char *name = NULL; + PyObject *res = NULL; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x) || PyLong_Check(x))) +#else + if (likely(PyLong_Check(x))) +#endif + return __Pyx_NewRef(x); +#if CYTHON_USE_TYPE_SLOTS + m = Py_TYPE(x)->tp_as_number; + #if PY_MAJOR_VERSION < 3 + if (m && m->nb_int) { + name = "int"; + res = m->nb_int(x); + } + else if (m && m->nb_long) { + name = "long"; + res = m->nb_long(x); + } + #else + if (likely(m && m->nb_int)) { + name = "int"; + res = m->nb_int(x); + } + #endif +#else + if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { + res = PyNumber_Int(x); + } +#endif + if (likely(res)) { +#if PY_MAJOR_VERSION < 3 + if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) { +#else + if (unlikely(!PyLong_CheckExact(res))) { +#endif + return __Pyx_PyNumber_IntOrLongWrongResultType(res, name); + } + } + else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_TypeError, + "an integer is required"); + } + return res; +} +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { + Py_ssize_t ival; + PyObject *x; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_CheckExact(b))) { + if (sizeof(Py_ssize_t) >= sizeof(long)) + return PyInt_AS_LONG(b); + else + return PyInt_AsSsize_t(b); + } +#endif + if (likely(PyLong_CheckExact(b))) { + #if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)b)->ob_digit; + const Py_ssize_t size = Py_SIZE(b); + if (likely(__Pyx_sst_abs(size) <= 1)) { + ival = likely(size) ? digits[0] : 0; + if (size == -1) ival = -ival; + return ival; + } else { + switch (size) { + case 2: + if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { + return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -2: + if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case 3: + if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { + return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -3: + if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case 4: + if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { + return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -4: + if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + } + } + #endif + return PyLong_AsSsize_t(b); + } + x = PyNumber_Index(b); + if (!x) return -1; + ival = PyInt_AsSsize_t(x); + Py_DECREF(x); + return ival; +} +static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) { + return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False); +} +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { + return PyInt_FromSize_t(ival); +} + + +#endif /* Py_PYTHON_H */ diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/queue.html b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/queue.html new file mode 100644 index 00000000..294d2c87 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/queue.html @@ -0,0 +1,9489 @@ + + + + + + Cython: queue.py + + + +

Generated by Cython 0.29.2

+

+ Yellow lines hint at Python interaction.
+ Click on a line that starts with a "+" to see the C code that Cython generated for it. +

+

Raw output: queue.c

+
+001: # Copyright (c) 2009-2012 Denis Bilenko. See LICENSE for details.
+
  __pyx_t_6 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_6) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+
 002: # copyright (c) 2018 gevent
+
 003: # cython: auto_pickle=False,embedsignature=True,always_allow_keywords=False
+
 004: """
+
 005: Synchronized queues.
+
 006: 
+
 007: The :mod:`gevent.queue` module implements multi-producer, multi-consumer queues
+
 008: that work across greenlets, with the API similar to the classes found in the
+
 009: standard :mod:`Queue` and :class:`multiprocessing <multiprocessing.Queue>` modules.
+
 010: 
+
 011: The classes in this module implement the iterator protocol. Iterating
+
 012: over a queue means repeatedly calling :meth:`get <Queue.get>` until
+
 013: :meth:`get <Queue.get>` returns ``StopIteration`` (specifically that
+
 014: class, not an instance or subclass).
+
 015: 
+
 016:     >>> queue = gevent.queue.Queue()
+
 017:     >>> queue.put(1)
+
 018:     >>> queue.put(2)
+
 019:     >>> queue.put(StopIteration)
+
 020:     >>> for item in queue:
+
 021:     ...    print(item)
+
 022:     1
+
 023:     2
+
 024: 
+
 025: .. versionchanged:: 1.0
+
 026:        ``Queue(0)`` now means queue of infinite size, not a channel. A :exc:`DeprecationWarning`
+
 027:        will be issued with this argument.
+
 028: """
+
 029: 
+
 030: from __future__ import absolute_import
+
+031: import sys
+
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_sys, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 31, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_sys, __pyx_t_1) < 0) __PYX_ERR(0, 31, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+032: from heapq import heappush as _heappush
+
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 32, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(__pyx_n_s_heappush_2);
+  __Pyx_GIVEREF(__pyx_n_s_heappush_2);
+  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_heappush_2);
+  __pyx_t_2 = __Pyx_Import(__pyx_n_s_heapq, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 32, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_heappush_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 32, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(__pyx_t_1);
+  __Pyx_XGOTREF(__pyx_v_6gevent_6_queue__heappush);
+  __Pyx_DECREF_SET(__pyx_v_6gevent_6_queue__heappush, __pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+033: from heapq import heappop as _heappop
+
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 33, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_heappop_2);
+  __Pyx_GIVEREF(__pyx_n_s_heappop_2);
+  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_heappop_2);
+  __pyx_t_1 = __Pyx_Import(__pyx_n_s_heapq, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 33, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_heappop_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 33, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(__pyx_t_2);
+  __Pyx_XGOTREF(__pyx_v_6gevent_6_queue__heappop);
+  __Pyx_DECREF_SET(__pyx_v_6gevent_6_queue__heappop, __pyx_t_2);
+  __Pyx_GIVEREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+034: from heapq import heapify as _heapify
+
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 34, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(__pyx_n_s_heapify_2);
+  __Pyx_GIVEREF(__pyx_n_s_heapify_2);
+  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_heapify_2);
+  __pyx_t_2 = __Pyx_Import(__pyx_n_s_heapq, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 34, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_heapify_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 34, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(__pyx_t_1);
+  __Pyx_XGOTREF(__pyx_v_6gevent_6_queue__heapify);
+  __Pyx_DECREF_SET(__pyx_v_6gevent_6_queue__heapify, __pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+035: import collections
+
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_collections, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 35, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_collections, __pyx_t_2) < 0) __PYX_ERR(0, 35, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
 036: 
+
+037: if sys.version_info[0] == 2:
+
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_sys); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 37, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_version_info); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 37, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 37, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_1 = __Pyx_PyInt_EqObjC(__pyx_t_2, __pyx_int_2, 2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 37, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 37, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  if (__pyx_t_3) {
+/* … */
+    goto __pyx_L2;
+  }
+
+038:     import Queue as __queue__ # python 3: pylint:disable=import-error
+
    __pyx_t_1 = __Pyx_Import(__pyx_n_s_Queue, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 38, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    if (PyDict_SetItem(__pyx_d, __pyx_n_s_queue_2, __pyx_t_1) < 0) __PYX_ERR(0, 38, __pyx_L1_error)
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 039: else:
+
+040:     import queue as __queue__ # python 2: pylint:disable=import-error
+
  /*else*/ {
+    __pyx_t_1 = __Pyx_Import(__pyx_n_s_queue, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 40, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    if (PyDict_SetItem(__pyx_d, __pyx_n_s_queue_2, __pyx_t_1) < 0) __PYX_ERR(0, 40, __pyx_L1_error)
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  }
+  __pyx_L2:;
+
+041: Full = __queue__.Full
+
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_queue_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 41, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_Full); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 41, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Full, __pyx_t_2) < 0) __PYX_ERR(0, 41, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+042: Empty = __queue__.Empty
+
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_queue_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 42, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_Empty); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 42, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Empty, __pyx_t_1) < 0) __PYX_ERR(0, 42, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 043: 
+
+044: from gevent.timeout import Timeout
+
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 44, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(__pyx_n_s_Timeout);
+  __Pyx_GIVEREF(__pyx_n_s_Timeout);
+  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_Timeout);
+  __pyx_t_2 = __Pyx_Import(__pyx_n_s_gevent_timeout, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 44, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_Timeout); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 44, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Timeout, __pyx_t_1) < 0) __PYX_ERR(0, 44, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+045: from gevent._hub_local import get_hub_noargs as get_hub
+
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 45, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_get_hub_noargs);
+  __Pyx_GIVEREF(__pyx_n_s_get_hub_noargs);
+  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_get_hub_noargs);
+  __pyx_t_1 = __Pyx_Import(__pyx_n_s_gevent__hub_local, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 45, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_get_hub_noargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 45, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_hub, __pyx_t_2) < 0) __PYX_ERR(0, 45, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+046: from greenlet import getcurrent
+
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 46, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(__pyx_n_s_getcurrent);
+  __Pyx_GIVEREF(__pyx_n_s_getcurrent);
+  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_getcurrent);
+  __pyx_t_2 = __Pyx_Import(__pyx_n_s_greenlet, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 46, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_getcurrent); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 46, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_getcurrent, __pyx_t_1) < 0) __PYX_ERR(0, 46, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+047: from gevent.exceptions import InvalidSwitchError
+
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 47, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_InvalidSwitchError);
+  __Pyx_GIVEREF(__pyx_n_s_InvalidSwitchError);
+  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_InvalidSwitchError);
+  __pyx_t_1 = __Pyx_Import(__pyx_n_s_gevent_exceptions, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 47, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_InvalidSwitchError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 47, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_InvalidSwitchError, __pyx_t_2) < 0) __PYX_ERR(0, 47, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 048: 
+
+049: __all__ = []
+
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 49, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_all, __pyx_t_1) < 0) __PYX_ERR(0, 49, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+050: __implements__ = ['Queue', 'PriorityQueue', 'LifoQueue']
+
  __pyx_t_1 = PyList_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 50, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(__pyx_n_s_Queue);
+  __Pyx_GIVEREF(__pyx_n_s_Queue);
+  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_Queue);
+  __Pyx_INCREF(__pyx_n_s_PriorityQueue);
+  __Pyx_GIVEREF(__pyx_n_s_PriorityQueue);
+  PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_PriorityQueue);
+  __Pyx_INCREF(__pyx_n_s_LifoQueue);
+  __Pyx_GIVEREF(__pyx_n_s_LifoQueue);
+  PyList_SET_ITEM(__pyx_t_1, 2, __pyx_n_s_LifoQueue);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_implements, __pyx_t_1) < 0) __PYX_ERR(0, 50, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+051: __extensions__ = ['JoinableQueue', 'Channel']
+
  __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 51, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(__pyx_n_s_JoinableQueue);
+  __Pyx_GIVEREF(__pyx_n_s_JoinableQueue);
+  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_JoinableQueue);
+  __Pyx_INCREF(__pyx_n_s_Channel);
+  __Pyx_GIVEREF(__pyx_n_s_Channel);
+  PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_Channel);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_extensions, __pyx_t_1) < 0) __PYX_ERR(0, 51, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+052: __imports__ = ['Empty', 'Full']
+
  __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 52, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(__pyx_n_s_Empty);
+  __Pyx_GIVEREF(__pyx_n_s_Empty);
+  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_Empty);
+  __Pyx_INCREF(__pyx_n_s_Full);
+  __Pyx_GIVEREF(__pyx_n_s_Full);
+  PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_Full);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_imports, __pyx_t_1) < 0) __PYX_ERR(0, 52, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+053: if hasattr(__queue__, 'SimpleQueue'):
+
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_queue_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 53, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_3 = __Pyx_HasAttr(__pyx_t_1, __pyx_n_s_SimpleQueue); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 53, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_4 = (__pyx_t_3 != 0);
+  if (__pyx_t_4) {
+/* … */
+  }
+
+054:     __all__.append('SimpleQueue') # New in 3.7
+
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_all); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 54, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __pyx_t_5 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_n_s_SimpleQueue); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 54, __pyx_L1_error)
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 055:     # SimpleQueue is implemented in C and directly allocates locks
+
 056:     # unaffected by monkey patching. We need the Python version.
+
+057:     SimpleQueue = __queue__._PySimpleQueue # pylint:disable=no-member
+
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_queue_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 57, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_PySimpleQueue); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 57, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    if (PyDict_SetItem(__pyx_d, __pyx_n_s_SimpleQueue, __pyx_t_2) < 0) __PYX_ERR(0, 57, __pyx_L1_error)
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+058: __all__ += (__implements__ + __extensions__ + __imports__)
+
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_all); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 58, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_implements); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 58, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_extensions); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 58, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  __pyx_t_7 = PyNumber_Add(__pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 58, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_7);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_imports); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 58, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  __pyx_t_1 = PyNumber_Add(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 58, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  __pyx_t_6 = PyNumber_InPlaceAdd(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 58, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_all, __pyx_t_6) < 0) __PYX_ERR(0, 58, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+
 059: 
+
 060: 
+
 061: # pylint 2.0.dev2 things collections.dequeue.popleft() doesn't return
+
 062: # pylint:disable=assignment-from-no-return
+
 063: 
+
+064: def _safe_remove(deq, item):
+
static PyObject *__pyx_f_6gevent_6_queue__safe_remove(PyObject *__pyx_v_deq, PyObject *__pyx_v_item) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_safe_remove", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_XDECREF(__pyx_t_6);
+  __Pyx_AddTraceback("gevent._queue._safe_remove", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
 065:     # For when the item may have been removed by
+
 066:     # Queue._unlock
+
+067:     try:
+
  {
+    /*try:*/ {
+/* … */
+    }
+    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+    goto __pyx_L8_try_end;
+    __pyx_L3_error:;
+    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+/* … */
+    __Pyx_XGIVEREF(__pyx_t_1);
+    __Pyx_XGIVEREF(__pyx_t_2);
+    __Pyx_XGIVEREF(__pyx_t_3);
+    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
+    goto __pyx_L1_error;
+    __pyx_L4_exception_handled:;
+    __Pyx_XGIVEREF(__pyx_t_1);
+    __Pyx_XGIVEREF(__pyx_t_2);
+    __Pyx_XGIVEREF(__pyx_t_3);
+    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
+    __pyx_L8_try_end:;
+  }
+
+068:         deq.remove(item)
+
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_deq, __pyx_n_s_remove); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 68, __pyx_L3_error)
+      __Pyx_GOTREF(__pyx_t_5);
+      __pyx_t_6 = NULL;
+      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
+        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
+        if (likely(__pyx_t_6)) {
+          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
+          __Pyx_INCREF(__pyx_t_6);
+          __Pyx_INCREF(function);
+          __Pyx_DECREF_SET(__pyx_t_5, function);
+        }
+      }
+      __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_v_item) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_item);
+      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 68, __pyx_L3_error)
+      __Pyx_GOTREF(__pyx_t_4);
+      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+
+069:     except ValueError:
+
    __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ValueError);
+    if (__pyx_t_7) {
+      __Pyx_ErrRestore(0,0,0);
+      goto __pyx_L4_exception_handled;
+    }
+    goto __pyx_L5_except_error;
+    __pyx_L5_except_error:;
+
 070:         pass
+
 071: 
+
+072: import gevent._waiter
+
  __pyx_t_6 = __Pyx_Import(__pyx_n_s_gevent__waiter, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 72, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_gevent, __pyx_t_6) < 0) __PYX_ERR(0, 72, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+
+073: locals()['Waiter'] = gevent._waiter.Waiter
+
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_gevent); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 73, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_waiter); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 73, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_Waiter); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 73, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_1 = __Pyx_Globals(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 73, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (unlikely(PyDict_SetItem(__pyx_t_1, __pyx_n_s_Waiter, __pyx_t_6) < 0)) __PYX_ERR(0, 73, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+
 074: 
+
+075: class ItemWaiter(Waiter): # pylint:disable=undefined-variable
+
struct __pyx_vtabstruct_6gevent_6_queue_ItemWaiter {
+  struct __pyx_vtabstruct_6gevent_8__waiter_Waiter __pyx_base;
+};
+static struct __pyx_vtabstruct_6gevent_6_queue_ItemWaiter *__pyx_vtabptr_6gevent_6_queue_ItemWaiter;
+
+
 076:     # pylint:disable=assigning-non-slot
+
 077:     __slots__ = (
+
+078:         'item',
+
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_ItemWaiter->tp_dict, __pyx_n_s_slots, __pyx_tuple__7) < 0) __PYX_ERR(0, 77, __pyx_L1_error)
+  PyType_Modified(__pyx_ptype_6gevent_6_queue_ItemWaiter);
+/* … */
+  __pyx_tuple__7 = PyTuple_Pack(2, __pyx_n_s_item, __pyx_n_s_queue); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 78, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__7);
+  __Pyx_GIVEREF(__pyx_tuple__7);
+
 079:         'queue',
+
 080:     )
+
 081: 
+
+082:     def __init__(self, item, queue):
+
/* Python wrapper */
+static int __pyx_pw_6gevent_6_queue_10ItemWaiter_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static int __pyx_pw_6gevent_6_queue_10ItemWaiter_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_item = 0;
+  PyObject *__pyx_v_queue = 0;
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_item,&__pyx_n_s_queue,0};
+    PyObject* values[2] = {0,0};
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_item)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_queue)) != 0)) kw_args--;
+        else {
+          __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(0, 82, __pyx_L3_error)
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 82, __pyx_L3_error)
+      }
+    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
+      goto __pyx_L5_argtuple_error;
+    } else {
+      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+    }
+    __pyx_v_item = values[0];
+    __pyx_v_queue = values[1];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 82, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent._queue.ItemWaiter.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return -1;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_6_queue_10ItemWaiter___init__(((struct __pyx_obj_6gevent_6_queue_ItemWaiter *)__pyx_v_self), __pyx_v_item, __pyx_v_queue);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_6_queue_10ItemWaiter___init__(struct __pyx_obj_6gevent_6_queue_ItemWaiter *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_queue) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = 0;
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_AddTraceback("gevent._queue.ItemWaiter.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = -1;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+083:         Waiter.__init__(self) # pylint:disable=undefined-variable
+
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_6gevent_8__waiter_Waiter), __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 83, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = NULL;
+  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+    if (likely(__pyx_t_3)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+      __Pyx_INCREF(__pyx_t_3);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_2, function);
+    }
+  }
+  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, ((PyObject *)__pyx_v_self)) : __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_v_self));
+  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 83, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+084:         self.item = item
+
  __Pyx_INCREF(__pyx_v_item);
+  __Pyx_GIVEREF(__pyx_v_item);
+  __Pyx_GOTREF(__pyx_v_self->item);
+  __Pyx_DECREF(__pyx_v_self->item);
+  __pyx_v_self->item = __pyx_v_item;
+
+085:         self.queue = queue
+
  __Pyx_INCREF(__pyx_v_queue);
+  __Pyx_GIVEREF(__pyx_v_queue);
+  __Pyx_GOTREF(__pyx_v_self->queue);
+  __Pyx_DECREF(__pyx_v_self->queue);
+  __pyx_v_self->queue = __pyx_v_queue;
+
 086: 
+
+087:     def put_and_switch(self):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_queue_10ItemWaiter_3put_and_switch(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6gevent_6_queue_10ItemWaiter_2put_and_switch[] = "ItemWaiter.put_and_switch(self)";
+static PyMethodDef __pyx_mdef_6gevent_6_queue_10ItemWaiter_3put_and_switch = {"put_and_switch", (PyCFunction)__pyx_pw_6gevent_6_queue_10ItemWaiter_3put_and_switch, METH_NOARGS, __pyx_doc_6gevent_6_queue_10ItemWaiter_2put_and_switch};
+static PyObject *__pyx_pw_6gevent_6_queue_10ItemWaiter_3put_and_switch(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("put_and_switch (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_6_queue_10ItemWaiter_2put_and_switch(((struct __pyx_obj_6gevent_6_queue_ItemWaiter *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_queue_10ItemWaiter_2put_and_switch(struct __pyx_obj_6gevent_6_queue_ItemWaiter *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("put_and_switch", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_AddTraceback("gevent._queue.ItemWaiter.put_and_switch", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__8 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 87, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__8);
+  __Pyx_GIVEREF(__pyx_tuple__8);
+/* … */
+  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_queue_10ItemWaiter_3put_and_switch, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ItemWaiter_put_and_switch, NULL, __pyx_n_s_gevent__queue, __pyx_d, ((PyObject *)__pyx_codeobj__9)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 87, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_ItemWaiter->tp_dict, __pyx_n_s_put_and_switch, __pyx_t_6) < 0) __PYX_ERR(0, 87, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_6_queue_ItemWaiter);
+  __pyx_codeobj__9 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__8, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_queue_py, __pyx_n_s_put_and_switch, 87, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__9)) __PYX_ERR(0, 87, __pyx_L1_error)
+
+088:         self.queue._put(self.item)
+
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->queue, __pyx_n_s_put); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 88, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = NULL;
+  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+    if (likely(__pyx_t_3)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+      __Pyx_INCREF(__pyx_t_3);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_2, function);
+    }
+  }
+  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_self->item) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_self->item);
+  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 88, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+089:         self.queue = None
+
  __Pyx_INCREF(Py_None);
+  __Pyx_GIVEREF(Py_None);
+  __Pyx_GOTREF(__pyx_v_self->queue);
+  __Pyx_DECREF(__pyx_v_self->queue);
+  __pyx_v_self->queue = Py_None;
+
+090:         self.item = None
+
  __Pyx_INCREF(Py_None);
+  __Pyx_GIVEREF(Py_None);
+  __Pyx_GOTREF(__pyx_v_self->item);
+  __Pyx_DECREF(__pyx_v_self->item);
+  __pyx_v_self->item = Py_None;
+
+091:         return self.switch(self)
+
  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_switch); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 91, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = NULL;
+  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+    if (likely(__pyx_t_3)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+      __Pyx_INCREF(__pyx_t_3);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_2, function);
+    }
+  }
+  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, ((PyObject *)__pyx_v_self)) : __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_v_self));
+  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 91, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
 092: 
+
+093: class Queue(object):
+
struct __pyx_vtabstruct_6gevent_6_queue_Queue {
+  PyObject *(*_get)(struct __pyx_obj_6gevent_6_queue_Queue *, int __pyx_skip_dispatch);
+  PyObject *(*_put)(struct __pyx_obj_6gevent_6_queue_Queue *, PyObject *, int __pyx_skip_dispatch);
+  PyObject *(*_peek)(struct __pyx_obj_6gevent_6_queue_Queue *, int __pyx_skip_dispatch);
+  Py_ssize_t (*qsize)(struct __pyx_obj_6gevent_6_queue_Queue *, int __pyx_skip_dispatch);
+  int (*empty)(struct __pyx_obj_6gevent_6_queue_Queue *, int __pyx_skip_dispatch);
+  int (*full)(struct __pyx_obj_6gevent_6_queue_Queue *, int __pyx_skip_dispatch);
+  PyObject *(*put)(struct __pyx_obj_6gevent_6_queue_Queue *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_6_queue_5Queue_put *__pyx_optional_args);
+  PyObject *(*put_nowait)(struct __pyx_obj_6gevent_6_queue_Queue *, PyObject *, int __pyx_skip_dispatch);
+  PyObject *(*__pyx___get_or_peek)(struct __pyx_obj_6gevent_6_queue_Queue *, PyObject *, PyObject *, PyObject *);
+  PyObject *(*get)(struct __pyx_obj_6gevent_6_queue_Queue *, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_6_queue_5Queue_get *__pyx_optional_args);
+  PyObject *(*get_nowait)(struct __pyx_obj_6gevent_6_queue_Queue *, int __pyx_skip_dispatch);
+  PyObject *(*peek)(struct __pyx_obj_6gevent_6_queue_Queue *, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_6_queue_5Queue_peek *__pyx_optional_args);
+  PyObject *(*peek_nowait)(struct __pyx_obj_6gevent_6_queue_Queue *, int __pyx_skip_dispatch);
+  PyObject *(*_schedule_unlock)(struct __pyx_obj_6gevent_6_queue_Queue *);
+};
+static struct __pyx_vtabstruct_6gevent_6_queue_Queue *__pyx_vtabptr_6gevent_6_queue_Queue;
+
+
 094:     """
+
 095:     Create a queue object with a given maximum size.
+
 096: 
+
 097:     If *maxsize* is less than or equal to zero or ``None``, the queue
+
 098:     size is infinite.
+
 099: 
+
 100:     Queues have a ``len`` equal to the number of items in them (the :meth:`qsize`),
+
 101:     but in a boolean context they are always True.
+
 102: 
+
 103:     .. versionchanged:: 1.1b3
+
 104:        Queues now support :func:`len`; it behaves the same as :meth:`qsize`.
+
 105:     .. versionchanged:: 1.1b3
+
 106:        Multiple greenlets that block on a call to :meth:`put` for a full queue
+
 107:        will now be awakened to put their items into the queue in the order in which
+
 108:        they arrived. Likewise, multiple greenlets that block on a call to :meth:`get` for
+
 109:        an empty queue will now receive items in the order in which they blocked. An
+
 110:        implementation quirk under CPython *usually* ensured this was roughly the case
+
 111:        previously anyway, but that wasn't the case for PyPy.
+
 112:     """
+
 113: 
+
 114:     __slots__ = (
+
+115:         '_maxsize',
+
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_Queue->tp_dict, __pyx_n_s_slots, __pyx_tuple__10) < 0) __PYX_ERR(0, 114, __pyx_L1_error)
+  PyType_Modified(__pyx_ptype_6gevent_6_queue_Queue);
+/* … */
+  __pyx_tuple__10 = PyTuple_Pack(7, __pyx_n_s_maxsize_2, __pyx_n_s_getters, __pyx_n_s_putters, __pyx_n_s_hub, __pyx_n_s_event_unlock, __pyx_n_s_queue, __pyx_n_s_weakref); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 115, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__10);
+  __Pyx_GIVEREF(__pyx_tuple__10);
+
 116:         'getters',
+
 117:         'putters',
+
 118:         'hub',
+
 119:         '_event_unlock',
+
 120:         'queue',
+
 121:         '__weakref__',
+
 122:     )
+
 123: 
+
+124:     def __init__(self, maxsize=None, items=(), _warn_depth=2):
+
/* Python wrapper */
+static int __pyx_pw_6gevent_6_queue_5Queue_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static int __pyx_pw_6gevent_6_queue_5Queue_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_maxsize = 0;
+  PyObject *__pyx_v_items = 0;
+  PyObject *__pyx_v__warn_depth = 0;
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_maxsize,&__pyx_n_s_items,&__pyx_n_s_warn_depth,0};
+    PyObject* values[3] = {0,0,0};
+    values[0] = ((PyObject *)Py_None);
+    values[1] = ((PyObject *)__pyx_empty_tuple);
+    values[2] = ((PyObject *)__pyx_int_2);
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_maxsize);
+          if (value) { values[0] = value; kw_args--; }
+        }
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_items);
+          if (value) { values[1] = value; kw_args--; }
+        }
+        CYTHON_FALLTHROUGH;
+        case  2:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_warn_depth);
+          if (value) { values[2] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 124, __pyx_L3_error)
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    __pyx_v_maxsize = values[0];
+    __pyx_v_items = values[1];
+    __pyx_v__warn_depth = values[2];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 124, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent._queue.Queue.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return -1;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_6_queue_5Queue___init__(((struct __pyx_obj_6gevent_6_queue_Queue *)__pyx_v_self), __pyx_v_maxsize, __pyx_v_items, __pyx_v__warn_depth);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_6_queue_5Queue___init__(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self, PyObject *__pyx_v_maxsize, PyObject *__pyx_v_items, PyObject *__pyx_v__warn_depth) {
+  PyObject *__pyx_v_warnings = NULL;
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__", 0);
+  __Pyx_INCREF(__pyx_v_maxsize);
+/* … */
+  /* function exit code */
+  __pyx_r = 0;
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_XDECREF(__pyx_t_6);
+  __Pyx_AddTraceback("gevent._queue.Queue.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = -1;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_warnings);
+  __Pyx_XDECREF(__pyx_v_maxsize);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+125:         if maxsize is not None and maxsize <= 0:
+
  __pyx_t_2 = (__pyx_v_maxsize != Py_None);
+  __pyx_t_3 = (__pyx_t_2 != 0);
+  if (__pyx_t_3) {
+  } else {
+    __pyx_t_1 = __pyx_t_3;
+    goto __pyx_L4_bool_binop_done;
+  }
+  __pyx_t_4 = PyObject_RichCompare(__pyx_v_maxsize, __pyx_int_0, Py_LE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 125, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 125, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __pyx_t_1 = __pyx_t_3;
+  __pyx_L4_bool_binop_done:;
+  if (__pyx_t_1) {
+/* … */
+  }
+
+126:             if maxsize == 0:
+
    __pyx_t_4 = __Pyx_PyInt_EqObjC(__pyx_v_maxsize, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 126, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 126, __pyx_L1_error)
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    if (__pyx_t_1) {
+/* … */
+    }
+
+127:                 import warnings
+
      __pyx_t_4 = __Pyx_Import(__pyx_n_s_warnings, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 127, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_4);
+      __pyx_v_warnings = __pyx_t_4;
+      __pyx_t_4 = 0;
+
+128:                 warnings.warn(
+
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_warnings, __pyx_n_s_warn); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 128, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_4);
+/* … */
+      __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple_, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 128, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_6);
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+/* … */
+  __pyx_tuple_ = PyTuple_Pack(2, __pyx_kp_s_Queue_0_now_equivalent_to_Queue, __pyx_builtin_DeprecationWarning); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 128, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple_);
+  __Pyx_GIVEREF(__pyx_tuple_);
+
 129:                     'Queue(0) now equivalent to Queue(None); if you want a channel, use Channel',
+
 130:                     DeprecationWarning,
+
+131:                     stacklevel=_warn_depth)
+
      __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 131, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_5);
+      if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_stacklevel, __pyx_v__warn_depth) < 0) __PYX_ERR(0, 131, __pyx_L1_error)
+
+132:             maxsize = None
+
    __Pyx_INCREF(Py_None);
+    __Pyx_DECREF_SET(__pyx_v_maxsize, Py_None);
+
 133: 
+
+134:         self._maxsize = maxsize if maxsize is not None else -1
+
  __pyx_t_1 = (__pyx_v_maxsize != Py_None);
+  if ((__pyx_t_1 != 0)) {
+    __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_v_maxsize); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 134, __pyx_L1_error)
+    __pyx_t_7 = __pyx_t_8;
+  } else {
+    __pyx_t_7 = -1L;
+  }
+  __pyx_v_self->_maxsize = __pyx_t_7;
+
 135:         # Explicitly maintain order for getters and putters that block
+
 136:         # so that callers can consistently rely on getting things out
+
 137:         # in the apparent order they went in. This was once required by
+
 138:         # imap_unordered. Previously these were set() objects, and the
+
 139:         # items put in the set have default hash() and eq() methods;
+
 140:         # under CPython, since new objects tend to have increasing
+
 141:         # hash values, this tended to roughly maintain order anyway,
+
 142:         # but that's not true under PyPy. An alternative to a deque
+
 143:         # (to avoid the linear scan of remove()) might be an
+
 144:         # OrderedDict, but it's 2.7 only; we don't expect to have so
+
 145:         # many waiters that removing an arbitrary element is a
+
 146:         # bottleneck, though.
+
+147:         self.getters = collections.deque()
+
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_collections); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 147, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_5);
+  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_deque); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 147, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_4);
+  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+  __pyx_t_5 = NULL;
+  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
+    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
+    if (likely(__pyx_t_5)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
+      __Pyx_INCREF(__pyx_t_5);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_4, function);
+    }
+  }
+  __pyx_t_6 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+  if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 147, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __Pyx_GIVEREF(__pyx_t_6);
+  __Pyx_GOTREF(__pyx_v_self->getters);
+  __Pyx_DECREF(__pyx_v_self->getters);
+  __pyx_v_self->getters = __pyx_t_6;
+  __pyx_t_6 = 0;
+
+148:         self.putters = collections.deque()
+
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_collections); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 148, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_4);
+  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_deque); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 148, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_5);
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __pyx_t_4 = NULL;
+  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
+    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
+    if (likely(__pyx_t_4)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
+      __Pyx_INCREF(__pyx_t_4);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_5, function);
+    }
+  }
+  __pyx_t_6 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
+  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+  if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 148, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+  __Pyx_GIVEREF(__pyx_t_6);
+  __Pyx_GOTREF(__pyx_v_self->putters);
+  __Pyx_DECREF(__pyx_v_self->putters);
+  __pyx_v_self->putters = __pyx_t_6;
+  __pyx_t_6 = 0;
+
+149:         self.hub = get_hub()
+
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_get_hub); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 149, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_5);
+  __pyx_t_4 = NULL;
+  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
+    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
+    if (likely(__pyx_t_4)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
+      __Pyx_INCREF(__pyx_t_4);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_5, function);
+    }
+  }
+  __pyx_t_6 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
+  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+  if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 149, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+  __Pyx_GIVEREF(__pyx_t_6);
+  __Pyx_GOTREF(__pyx_v_self->hub);
+  __Pyx_DECREF(__pyx_v_self->hub);
+  __pyx_v_self->hub = __pyx_t_6;
+  __pyx_t_6 = 0;
+
+150:         self._event_unlock = None
+
  __Pyx_INCREF(Py_None);
+  __Pyx_GIVEREF(Py_None);
+  __Pyx_GOTREF(__pyx_v_self->_event_unlock);
+  __Pyx_DECREF(__pyx_v_self->_event_unlock);
+  __pyx_v_self->_event_unlock = Py_None;
+
+151:         self.queue = self._create_queue(items)
+
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_create_queue); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 151, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_5);
+  __pyx_t_4 = NULL;
+  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
+    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
+    if (likely(__pyx_t_4)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
+      __Pyx_INCREF(__pyx_t_4);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_5, function);
+    }
+  }
+  __pyx_t_6 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_4, __pyx_v_items) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_items);
+  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+  if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 151, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+  __Pyx_GIVEREF(__pyx_t_6);
+  __Pyx_GOTREF(__pyx_v_self->queue);
+  __Pyx_DECREF(__pyx_v_self->queue);
+  __pyx_v_self->queue = __pyx_t_6;
+  __pyx_t_6 = 0;
+
 152: 
+
 153:     @property
+
+154:     def maxsize(self):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_queue_5Queue_7maxsize_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_6_queue_5Queue_7maxsize_1__get__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_6_queue_5Queue_7maxsize___get__(((struct __pyx_obj_6gevent_6_queue_Queue *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_queue_5Queue_7maxsize___get__(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_AddTraceback("gevent._queue.Queue.maxsize.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+155:         return self._maxsize if self._maxsize > 0 else None
+
  __Pyx_XDECREF(__pyx_r);
+  if (((__pyx_v_self->_maxsize > 0) != 0)) {
+    __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->_maxsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 155, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_1 = __pyx_t_2;
+    __pyx_t_2 = 0;
+  } else {
+    __Pyx_INCREF(Py_None);
+    __pyx_t_1 = Py_None;
+  }
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
 156: 
+
 157:     @maxsize.setter
+
+158:     def maxsize(self, nv):
+
/* Python wrapper */
+static int __pyx_pw_6gevent_6_queue_5Queue_7maxsize_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_nv); /*proto*/
+static int __pyx_pw_6gevent_6_queue_5Queue_7maxsize_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_nv) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_6_queue_5Queue_7maxsize_2__set__(((struct __pyx_obj_6gevent_6_queue_Queue *)__pyx_v_self), ((PyObject *)__pyx_v_nv));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_6_queue_5Queue_7maxsize_2__set__(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self, PyObject *__pyx_v_nv) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__set__", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = 0;
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_AddTraceback("gevent._queue.Queue.maxsize.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = -1;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
 159:         # QQQ make maxsize into a property with setter that schedules unlock if necessary
+
+160:         if nv is None or nv <= 0:
+
  __pyx_t_2 = (__pyx_v_nv == Py_None);
+  __pyx_t_3 = (__pyx_t_2 != 0);
+  if (!__pyx_t_3) {
+  } else {
+    __pyx_t_1 = __pyx_t_3;
+    goto __pyx_L4_bool_binop_done;
+  }
+  __pyx_t_4 = PyObject_RichCompare(__pyx_v_nv, __pyx_int_0, Py_LE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 160, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 160, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __pyx_t_1 = __pyx_t_3;
+  __pyx_L4_bool_binop_done:;
+  if (__pyx_t_1) {
+/* … */
+    goto __pyx_L3;
+  }
+
+161:             self._maxsize = -1
+
    __pyx_v_self->_maxsize = -1L;
+
 162:         else:
+
+163:             self._maxsize = nv
+
  /*else*/ {
+    __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_v_nv); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 163, __pyx_L1_error)
+    __pyx_v_self->_maxsize = __pyx_t_5;
+  }
+  __pyx_L3:;
+
 164: 
+
+165:     def copy(self):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_queue_5Queue_3copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6gevent_6_queue_5Queue_2copy[] = "Queue.copy(self)";
+static PyMethodDef __pyx_mdef_6gevent_6_queue_5Queue_3copy = {"copy", (PyCFunction)__pyx_pw_6gevent_6_queue_5Queue_3copy, METH_NOARGS, __pyx_doc_6gevent_6_queue_5Queue_2copy};
+static PyObject *__pyx_pw_6gevent_6_queue_5Queue_3copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("copy (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_6_queue_5Queue_2copy(((struct __pyx_obj_6gevent_6_queue_Queue *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_queue_5Queue_2copy(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("copy", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_6);
+  __Pyx_AddTraceback("gevent._queue.Queue.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__11 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 165, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__11);
+  __Pyx_GIVEREF(__pyx_tuple__11);
+/* … */
+  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_queue_5Queue_3copy, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Queue_copy, NULL, __pyx_n_s_gevent__queue, __pyx_d, ((PyObject *)__pyx_codeobj__12)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 165, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_Queue->tp_dict, __pyx_n_s_copy, __pyx_t_6) < 0) __PYX_ERR(0, 165, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_6_queue_Queue);
+  __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__11, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_queue_py, __pyx_n_s_copy, 165, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(0, 165, __pyx_L1_error)
+
+166:         return type(self)(self.maxsize, self.queue)
+
  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_maxsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 166, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
+  __pyx_t_3 = ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))); __pyx_t_4 = NULL;
+  __pyx_t_5 = 0;
+  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+    if (likely(__pyx_t_4)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+      __Pyx_INCREF(__pyx_t_4);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_3, function);
+      __pyx_t_5 = 1;
+    }
+  }
+  #if CYTHON_FAST_PYCALL
+  if (PyFunction_Check(__pyx_t_3)) {
+    PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_2, __pyx_v_self->queue};
+    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 166, __pyx_L1_error)
+    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  } else
+  #endif
+  #if CYTHON_FAST_PYCCALL
+  if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
+    PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_2, __pyx_v_self->queue};
+    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 166, __pyx_L1_error)
+    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  } else
+  #endif
+  {
+    __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 166, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_6);
+    if (__pyx_t_4) {
+      __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
+    }
+    __Pyx_GIVEREF(__pyx_t_2);
+    PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_t_2);
+    __Pyx_INCREF(__pyx_v_self->queue);
+    __Pyx_GIVEREF(__pyx_v_self->queue);
+    PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_self->queue);
+    __pyx_t_2 = 0;
+    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 166, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  }
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
 167: 
+
+168:     def _create_queue(self, items=()):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_queue_5Queue_5_create_queue(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_6gevent_6_queue_5Queue_4_create_queue[] = "Queue._create_queue(self, items=())";
+static PyMethodDef __pyx_mdef_6gevent_6_queue_5Queue_5_create_queue = {"_create_queue", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_6_queue_5Queue_5_create_queue, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_6_queue_5Queue_4_create_queue};
+static PyObject *__pyx_pw_6gevent_6_queue_5Queue_5_create_queue(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_items = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_create_queue (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_items,0};
+    PyObject* values[1] = {0};
+    values[0] = ((PyObject *)__pyx_empty_tuple);
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_items);
+          if (value) { values[0] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_create_queue") < 0)) __PYX_ERR(0, 168, __pyx_L3_error)
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    __pyx_v_items = values[0];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("_create_queue", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 168, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent._queue.Queue._create_queue", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_6_queue_5Queue_4_create_queue(((struct __pyx_obj_6gevent_6_queue_Queue *)__pyx_v_self), __pyx_v_items);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_queue_5Queue_4_create_queue(CYTHON_UNUSED struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self, PyObject *__pyx_v_items) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_create_queue", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_AddTraceback("gevent._queue.Queue._create_queue", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__13 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_items); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 168, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__13);
+  __Pyx_GIVEREF(__pyx_tuple__13);
+/* … */
+  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_queue_5Queue_5_create_queue, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Queue__create_queue, NULL, __pyx_n_s_gevent__queue, __pyx_d, ((PyObject *)__pyx_codeobj__14)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 168, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_Queue->tp_dict, __pyx_n_s_create_queue, __pyx_t_6) < 0) __PYX_ERR(0, 168, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_6_queue_Queue);
+  __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__13, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_queue_py, __pyx_n_s_create_queue, 168, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__14)) __PYX_ERR(0, 168, __pyx_L1_error)
+
+169:         return collections.deque(items)
+
  __Pyx_XDECREF(__pyx_r);
+  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_collections); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 169, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_deque); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 169, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_2 = NULL;
+  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
+    if (likely(__pyx_t_2)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+      __Pyx_INCREF(__pyx_t_2);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_3, function);
+    }
+  }
+  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_v_items) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_items);
+  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 169, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
 170: 
+
+171:     def _get(self):
+
static PyObject *__pyx_pw_6gevent_6_queue_5Queue_7_get(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyObject *__pyx_f_6gevent_6_queue_5Queue__get(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self, int __pyx_skip_dispatch) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_get", 0);
+  /* Check if called by wrapper */
+  if (unlikely(__pyx_skip_dispatch)) ;
+  /* Check if overridden in Python */
+  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
+    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
+    if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
+    else {
+      PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      #endif
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 171, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_6_queue_5Queue_7_get)) {
+        __Pyx_XDECREF(__pyx_r);
+        __Pyx_INCREF(__pyx_t_1);
+        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+          if (likely(__pyx_t_4)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+            __Pyx_INCREF(__pyx_t_4);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_3, function);
+          }
+        }
+        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
+        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 171, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __pyx_r = __pyx_t_2;
+        __pyx_t_2 = 0;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        goto __pyx_L0;
+      }
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+      tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
+      if (unlikely(type_dict_guard != tp_dict_version)) {
+        tp_dict_version = obj_dict_version = 0;
+      }
+      #endif
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    }
+    #endif
+  }
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_AddTraceback("gevent._queue.Queue._get", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_queue_5Queue_7_get(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6gevent_6_queue_5Queue_6_get[] = "Queue._get(self)";
+static PyMethodDef __pyx_mdef_6gevent_6_queue_5Queue_7_get = {"_get", (PyCFunction)__pyx_pw_6gevent_6_queue_5Queue_7_get, METH_NOARGS, __pyx_doc_6gevent_6_queue_5Queue_6_get};
+static PyObject *__pyx_pw_6gevent_6_queue_5Queue_7_get(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_get (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_6_queue_5Queue_6_get(((struct __pyx_obj_6gevent_6_queue_Queue *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_queue_5Queue_6_get(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_get", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __pyx_f_6gevent_6_queue_5Queue__get(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 171, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent._queue.Queue._get", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__15 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(0, 171, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__15);
+  __Pyx_GIVEREF(__pyx_tuple__15);
+/* … */
+  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_queue_5Queue_7_get, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Queue__get, NULL, __pyx_n_s_gevent__queue, __pyx_d, ((PyObject *)__pyx_codeobj__16)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 171, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_Queue->tp_dict, __pyx_n_s_get, __pyx_t_6) < 0) __PYX_ERR(0, 171, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_6_queue_Queue);
+  __pyx_codeobj__16 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__15, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_queue_py, __pyx_n_s_get, 171, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__16)) __PYX_ERR(0, 171, __pyx_L1_error)
+
+172:         return self.queue.popleft()
+
  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->queue, __pyx_n_s_popleft); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 172, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = NULL;
+  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+    if (likely(__pyx_t_3)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+      __Pyx_INCREF(__pyx_t_3);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_2, function);
+    }
+  }
+  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 172, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
 173: 
+
+174:     def _peek(self):
+
static PyObject *__pyx_pw_6gevent_6_queue_5Queue_9_peek(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyObject *__pyx_f_6gevent_6_queue_5Queue__peek(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self, int __pyx_skip_dispatch) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_peek", 0);
+  /* Check if called by wrapper */
+  if (unlikely(__pyx_skip_dispatch)) ;
+  /* Check if overridden in Python */
+  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
+    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
+    if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
+    else {
+      PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      #endif
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_peek); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 174, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_6_queue_5Queue_9_peek)) {
+        __Pyx_XDECREF(__pyx_r);
+        __Pyx_INCREF(__pyx_t_1);
+        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+          if (likely(__pyx_t_4)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+            __Pyx_INCREF(__pyx_t_4);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_3, function);
+          }
+        }
+        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
+        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 174, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __pyx_r = __pyx_t_2;
+        __pyx_t_2 = 0;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        goto __pyx_L0;
+      }
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+      tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
+      if (unlikely(type_dict_guard != tp_dict_version)) {
+        tp_dict_version = obj_dict_version = 0;
+      }
+      #endif
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    }
+    #endif
+  }
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_AddTraceback("gevent._queue.Queue._peek", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_queue_5Queue_9_peek(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6gevent_6_queue_5Queue_8_peek[] = "Queue._peek(self)";
+static PyMethodDef __pyx_mdef_6gevent_6_queue_5Queue_9_peek = {"_peek", (PyCFunction)__pyx_pw_6gevent_6_queue_5Queue_9_peek, METH_NOARGS, __pyx_doc_6gevent_6_queue_5Queue_8_peek};
+static PyObject *__pyx_pw_6gevent_6_queue_5Queue_9_peek(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_peek (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_6_queue_5Queue_8_peek(((struct __pyx_obj_6gevent_6_queue_Queue *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_queue_5Queue_8_peek(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_peek", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __pyx_f_6gevent_6_queue_5Queue__peek(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 174, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent._queue.Queue._peek", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__17 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(0, 174, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__17);
+  __Pyx_GIVEREF(__pyx_tuple__17);
+/* … */
+  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_queue_5Queue_9_peek, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Queue__peek, NULL, __pyx_n_s_gevent__queue, __pyx_d, ((PyObject *)__pyx_codeobj__18)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 174, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_Queue->tp_dict, __pyx_n_s_peek, __pyx_t_6) < 0) __PYX_ERR(0, 174, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_6_queue_Queue);
+  __pyx_codeobj__18 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__17, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_queue_py, __pyx_n_s_peek, 174, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__18)) __PYX_ERR(0, 174, __pyx_L1_error)
+
+175:         return self.queue[0]
+
  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_self->queue, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 175, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
 176: 
+
+177:     def _put(self, item):
+
static PyObject *__pyx_pw_6gevent_6_queue_5Queue_11_put(PyObject *__pyx_v_self, PyObject *__pyx_v_item); /*proto*/
+static PyObject *__pyx_f_6gevent_6_queue_5Queue__put(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self, PyObject *__pyx_v_item, int __pyx_skip_dispatch) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_put", 0);
+  /* Check if called by wrapper */
+  if (unlikely(__pyx_skip_dispatch)) ;
+  /* Check if overridden in Python */
+  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
+    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
+    if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
+    else {
+      PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      #endif
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_put); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 177, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_6_queue_5Queue_11_put)) {
+        __Pyx_XDECREF(__pyx_r);
+        __Pyx_INCREF(__pyx_t_1);
+        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+          if (likely(__pyx_t_4)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+            __Pyx_INCREF(__pyx_t_4);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_3, function);
+          }
+        }
+        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_item) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_item);
+        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 177, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __pyx_r = __pyx_t_2;
+        __pyx_t_2 = 0;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        goto __pyx_L0;
+      }
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+      tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
+      if (unlikely(type_dict_guard != tp_dict_version)) {
+        tp_dict_version = obj_dict_version = 0;
+      }
+      #endif
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    }
+    #endif
+  }
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_AddTraceback("gevent._queue.Queue._put", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_queue_5Queue_11_put(PyObject *__pyx_v_self, PyObject *__pyx_v_item); /*proto*/
+static char __pyx_doc_6gevent_6_queue_5Queue_10_put[] = "Queue._put(self, item)";
+static PyMethodDef __pyx_mdef_6gevent_6_queue_5Queue_11_put = {"_put", (PyCFunction)__pyx_pw_6gevent_6_queue_5Queue_11_put, METH_O, __pyx_doc_6gevent_6_queue_5Queue_10_put};
+static PyObject *__pyx_pw_6gevent_6_queue_5Queue_11_put(PyObject *__pyx_v_self, PyObject *__pyx_v_item) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_put (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_6_queue_5Queue_10_put(((struct __pyx_obj_6gevent_6_queue_Queue *)__pyx_v_self), ((PyObject *)__pyx_v_item));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_queue_5Queue_10_put(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self, PyObject *__pyx_v_item) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_put", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __pyx_f_6gevent_6_queue_5Queue__put(__pyx_v_self, __pyx_v_item, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 177, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent._queue.Queue._put", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__19 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_item); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(0, 177, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__19);
+  __Pyx_GIVEREF(__pyx_tuple__19);
+/* … */
+  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_queue_5Queue_11_put, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Queue__put, NULL, __pyx_n_s_gevent__queue, __pyx_d, ((PyObject *)__pyx_codeobj__20)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 177, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_Queue->tp_dict, __pyx_n_s_put, __pyx_t_6) < 0) __PYX_ERR(0, 177, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_6_queue_Queue);
+  __pyx_codeobj__20 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__19, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_queue_py, __pyx_n_s_put, 177, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__20)) __PYX_ERR(0, 177, __pyx_L1_error)
+
+178:         self.queue.append(item)
+
  __pyx_t_5 = __Pyx_PyObject_Append(__pyx_v_self->queue, __pyx_v_item); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 178, __pyx_L1_error)
+
 179: 
+
+180:     def __repr__(self):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_queue_5Queue_13__repr__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_6_queue_5Queue_13__repr__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_6_queue_5Queue_12__repr__(((struct __pyx_obj_6gevent_6_queue_Queue *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_queue_5Queue_12__repr__(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__repr__", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_AddTraceback("gevent._queue.Queue.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+181:         return '<%s at %s%s>' % (type(self).__name__, hex(id(self)), self._format())
+
  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))), __pyx_n_s_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 181, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 181, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_hex, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 181, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 181, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_4);
+  __pyx_t_5 = NULL;
+  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
+    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
+    if (likely(__pyx_t_5)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
+      __Pyx_INCREF(__pyx_t_5);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_4, function);
+    }
+  }
+  __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 181, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 181, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_4);
+  __Pyx_GIVEREF(__pyx_t_1);
+  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_3);
+  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
+  __Pyx_GIVEREF(__pyx_t_2);
+  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_2);
+  __pyx_t_1 = 0;
+  __pyx_t_3 = 0;
+  __pyx_t_2 = 0;
+  __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_s_at_s_s, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 181, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __pyx_r = __pyx_t_2;
+  __pyx_t_2 = 0;
+  goto __pyx_L0;
+
 182: 
+
+183:     def __str__(self):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_queue_5Queue_15__str__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_6_queue_5Queue_15__str__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_6_queue_5Queue_14__str__(((struct __pyx_obj_6gevent_6_queue_Queue *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_queue_5Queue_14__str__(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__str__", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_AddTraceback("gevent._queue.Queue.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+184:         return '<%s%s>' % (type(self).__name__, self._format())
+
  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))), __pyx_n_s_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 184, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 184, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __pyx_t_4 = NULL;
+  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
+    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+    if (likely(__pyx_t_4)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+      __Pyx_INCREF(__pyx_t_4);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_3, function);
+    }
+  }
+  __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 184, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 184, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_GIVEREF(__pyx_t_1);
+  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_2);
+  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
+  __pyx_t_1 = 0;
+  __pyx_t_2 = 0;
+  __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_s_s, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 184, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __pyx_r = __pyx_t_2;
+  __pyx_t_2 = 0;
+  goto __pyx_L0;
+
 185: 
+
+186:     def _format(self):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_queue_5Queue_17_format(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6gevent_6_queue_5Queue_16_format[] = "Queue._format(self)";
+static PyMethodDef __pyx_mdef_6gevent_6_queue_5Queue_17_format = {"_format", (PyCFunction)__pyx_pw_6gevent_6_queue_5Queue_17_format, METH_NOARGS, __pyx_doc_6gevent_6_queue_5Queue_16_format};
+static PyObject *__pyx_pw_6gevent_6_queue_5Queue_17_format(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_format (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_6_queue_5Queue_16_format(((struct __pyx_obj_6gevent_6_queue_Queue *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_queue_5Queue_16_format(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self) {
+  PyObject *__pyx_v_result = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_format", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_AddTraceback("gevent._queue.Queue._format", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_result);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__21 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_result); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(0, 186, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__21);
+  __Pyx_GIVEREF(__pyx_tuple__21);
+/* … */
+  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_queue_5Queue_17_format, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Queue__format, NULL, __pyx_n_s_gevent__queue, __pyx_d, ((PyObject *)__pyx_codeobj__22)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 186, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_Queue->tp_dict, __pyx_n_s_format, __pyx_t_6) < 0) __PYX_ERR(0, 186, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_6_queue_Queue);
+  __pyx_codeobj__22 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__21, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_queue_py, __pyx_n_s_format, 186, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__22)) __PYX_ERR(0, 186, __pyx_L1_error)
+
+187:         result = []
+
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 187, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_v_result = ((PyObject*)__pyx_t_1);
+  __pyx_t_1 = 0;
+
+188:         if self.maxsize is not None:
+
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_maxsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 188, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = (__pyx_t_1 != Py_None);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_3 = (__pyx_t_2 != 0);
+  if (__pyx_t_3) {
+/* … */
+  }
+
+189:             result.append('maxsize=%r' % (self.maxsize, ))
+
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_maxsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 189, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 189, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_GIVEREF(__pyx_t_1);
+    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
+    __pyx_t_1 = 0;
+    __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_maxsize_r, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 189, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __pyx_t_5 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_1); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 189, __pyx_L1_error)
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+190:         if getattr(self, 'queue', None):
+
  __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_queue, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 190, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 190, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  if (__pyx_t_3) {
+/* … */
+  }
+
+191:             result.append('queue=%r' % (self.queue, ))
+
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 191, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_INCREF(__pyx_v_self->queue);
+    __Pyx_GIVEREF(__pyx_v_self->queue);
+    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->queue);
+    __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_queue_r, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 191, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __pyx_t_5 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_4); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 191, __pyx_L1_error)
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+
+192:         if self.getters:
+
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_self->getters); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 192, __pyx_L1_error)
+  if (__pyx_t_3) {
+/* … */
+  }
+
+193:             result.append('getters[%s]' % len(self.getters))
+
    __pyx_t_4 = __pyx_v_self->getters;
+    __Pyx_INCREF(__pyx_t_4);
+    __pyx_t_6 = PyObject_Length(__pyx_t_4); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 193, __pyx_L1_error)
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __pyx_t_4 = PyInt_FromSsize_t(__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 193, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_getters_s, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 193, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __pyx_t_5 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_1); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 193, __pyx_L1_error)
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+194:         if self.putters:
+
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_self->putters); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 194, __pyx_L1_error)
+  if (__pyx_t_3) {
+/* … */
+  }
+
+195:             result.append('putters[%s]' % len(self.putters))
+
    __pyx_t_1 = __pyx_v_self->putters;
+    __Pyx_INCREF(__pyx_t_1);
+    __pyx_t_6 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 195, __pyx_L1_error)
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 195, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_putters_s, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 195, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __pyx_t_5 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_4); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 195, __pyx_L1_error)
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+
+196:         if result:
+
  __pyx_t_3 = (PyList_GET_SIZE(__pyx_v_result) != 0);
+  if (__pyx_t_3) {
+/* … */
+  }
+
+197:             return ' ' + ' '.join(result)
+
    __Pyx_XDECREF(__pyx_r);
+    __pyx_t_4 = __Pyx_PyString_Join(__pyx_kp_s__2, __pyx_v_result); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 197, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    __pyx_t_1 = PyNumber_Add(__pyx_kp_s__2, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 197, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __pyx_r = __pyx_t_1;
+    __pyx_t_1 = 0;
+    goto __pyx_L0;
+
+198:         return ''
+
  __Pyx_XDECREF(__pyx_r);
+  __Pyx_INCREF(__pyx_kp_s__3);
+  __pyx_r = __pyx_kp_s__3;
+  goto __pyx_L0;
+
 199: 
+
+200:     def qsize(self):
+
static PyObject *__pyx_pw_6gevent_6_queue_5Queue_19qsize(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static Py_ssize_t __pyx_f_6gevent_6_queue_5Queue_qsize(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self, int __pyx_skip_dispatch) {
+  Py_ssize_t __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("qsize", 0);
+  /* Check if called by wrapper */
+  if (unlikely(__pyx_skip_dispatch)) ;
+  /* Check if overridden in Python */
+  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
+    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
+    if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
+    else {
+      PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      #endif
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_qsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 200, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_6_queue_5Queue_19qsize)) {
+        __Pyx_INCREF(__pyx_t_1);
+        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+          if (likely(__pyx_t_4)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+            __Pyx_INCREF(__pyx_t_4);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_3, function);
+          }
+        }
+        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
+        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 200, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 200, __pyx_L1_error)
+        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+        __pyx_r = __pyx_t_5;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        goto __pyx_L0;
+      }
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+      tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
+      if (unlikely(type_dict_guard != tp_dict_version)) {
+        tp_dict_version = obj_dict_version = 0;
+      }
+      #endif
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    }
+    #endif
+  }
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_WriteUnraisable("gevent._queue.Queue.qsize", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_queue_5Queue_19qsize(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6gevent_6_queue_5Queue_18qsize[] = "Queue.qsize(self) -> Py_ssize_t\nReturn the size of the queue.";
+static PyMethodDef __pyx_mdef_6gevent_6_queue_5Queue_19qsize = {"qsize", (PyCFunction)__pyx_pw_6gevent_6_queue_5Queue_19qsize, METH_NOARGS, __pyx_doc_6gevent_6_queue_5Queue_18qsize};
+static PyObject *__pyx_pw_6gevent_6_queue_5Queue_19qsize(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("qsize (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_6_queue_5Queue_18qsize(((struct __pyx_obj_6gevent_6_queue_Queue *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_queue_5Queue_18qsize(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("qsize", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = PyInt_FromSsize_t(__pyx_f_6gevent_6_queue_5Queue_qsize(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 200, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent._queue.Queue.qsize", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__23 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(0, 200, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__23);
+  __Pyx_GIVEREF(__pyx_tuple__23);
+/* … */
+  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_queue_5Queue_19qsize, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Queue_qsize, NULL, __pyx_n_s_gevent__queue, __pyx_d, ((PyObject *)__pyx_codeobj__24)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 200, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_Queue->tp_dict, __pyx_n_s_qsize, __pyx_t_6) < 0) __PYX_ERR(0, 200, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_6_queue_Queue);
+  __pyx_codeobj__24 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__23, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_queue_py, __pyx_n_s_qsize, 200, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__24)) __PYX_ERR(0, 200, __pyx_L1_error)
+
 201:         """Return the size of the queue."""
+
+202:         return len(self.queue)
+
  __pyx_t_1 = __pyx_v_self->queue;
+  __Pyx_INCREF(__pyx_t_1);
+  __pyx_t_5 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 202, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_r = __pyx_t_5;
+  goto __pyx_L0;
+
 203: 
+
+204:     def __len__(self):
+
/* Python wrapper */
+static Py_ssize_t __pyx_pw_6gevent_6_queue_5Queue_21__len__(PyObject *__pyx_v_self); /*proto*/
+static char __pyx_doc_6gevent_6_queue_5Queue_20__len__[] = "\n        Return the size of the queue. This is the same as :meth:`qsize`.\n\n        .. versionadded: 1.1b3\n\n            Previously, getting len() of a queue would raise a TypeError.\n        ";
+#if CYTHON_COMPILING_IN_CPYTHON
+struct wrapperbase __pyx_wrapperbase_6gevent_6_queue_5Queue_20__len__;
+#endif
+static Py_ssize_t __pyx_pw_6gevent_6_queue_5Queue_21__len__(PyObject *__pyx_v_self) {
+  Py_ssize_t __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_6_queue_5Queue_20__len__(((struct __pyx_obj_6gevent_6_queue_Queue *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static Py_ssize_t __pyx_pf_6gevent_6_queue_5Queue_20__len__(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self) {
+  Py_ssize_t __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__len__", 0);
+/* … */
+  /* function exit code */
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
 205:         """
+
 206:         Return the size of the queue. This is the same as :meth:`qsize`.
+
 207: 
+
 208:         .. versionadded: 1.1b3
+
 209: 
+
 210:             Previously, getting len() of a queue would raise a TypeError.
+
 211:         """
+
 212: 
+
+213:         return self.qsize()
+
  __pyx_r = ((struct __pyx_vtabstruct_6gevent_6_queue_Queue *)__pyx_v_self->__pyx_vtab)->qsize(__pyx_v_self, 0);
+  goto __pyx_L0;
+
 214: 
+
+215:     def __bool__(self):
+
/* Python wrapper */
+static int __pyx_pw_6gevent_6_queue_5Queue_23__bool__(PyObject *__pyx_v_self); /*proto*/
+static int __pyx_pw_6gevent_6_queue_5Queue_23__bool__(PyObject *__pyx_v_self) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__bool__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_6_queue_5Queue_22__bool__(((struct __pyx_obj_6gevent_6_queue_Queue *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_6_queue_5Queue_22__bool__(CYTHON_UNUSED struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__bool__", 0);
+/* … */
+  /* function exit code */
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
 216:         """
+
 217:         A queue object is always True.
+
 218: 
+
 219:         .. versionadded: 1.1b3
+
 220: 
+
 221:            Now that queues support len(), they need to implement ``__bool__``
+
 222:            to return True for backwards compatibility.
+
 223:         """
+
+224:         return True
+
  __pyx_r = 1;
+  goto __pyx_L0;
+
 225: 
+
+226:     def __nonzero__(self):
+
/* Python wrapper */
+static int __pyx_pw_6gevent_6_queue_5Queue_25__nonzero__(PyObject *__pyx_v_self); /*proto*/
+static int __pyx_pw_6gevent_6_queue_5Queue_25__nonzero__(PyObject *__pyx_v_self) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__nonzero__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_6_queue_5Queue_24__nonzero__(((struct __pyx_obj_6gevent_6_queue_Queue *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_6_queue_5Queue_24__nonzero__(CYTHON_UNUSED struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__nonzero__", 0);
+/* … */
+  /* function exit code */
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
 227:         # Py2.
+
 228:         # For Cython; __bool__ becomes a special method that we can't
+
 229:         # get by name.
+
+230:         return True
+
  __pyx_r = 1;
+  goto __pyx_L0;
+
 231: 
+
+232:     def empty(self):
+
static PyObject *__pyx_pw_6gevent_6_queue_5Queue_27empty(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static int __pyx_f_6gevent_6_queue_5Queue_empty(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self, int __pyx_skip_dispatch) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("empty", 0);
+  /* Check if called by wrapper */
+  if (unlikely(__pyx_skip_dispatch)) ;
+  /* Check if overridden in Python */
+  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
+    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
+    if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
+    else {
+      PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      #endif
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_empty); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 232, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_6_queue_5Queue_27empty)) {
+        __Pyx_INCREF(__pyx_t_1);
+        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+          if (likely(__pyx_t_4)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+            __Pyx_INCREF(__pyx_t_4);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_3, function);
+          }
+        }
+        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
+        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 232, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 232, __pyx_L1_error)
+        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+        __pyx_r = __pyx_t_5;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        goto __pyx_L0;
+      }
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+      tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
+      if (unlikely(type_dict_guard != tp_dict_version)) {
+        tp_dict_version = obj_dict_version = 0;
+      }
+      #endif
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    }
+    #endif
+  }
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_WriteUnraisable("gevent._queue.Queue.empty", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_queue_5Queue_27empty(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6gevent_6_queue_5Queue_26empty[] = "Queue.empty(self) -> bool\nReturn ``True`` if the queue is empty, ``False`` otherwise.";
+static PyMethodDef __pyx_mdef_6gevent_6_queue_5Queue_27empty = {"empty", (PyCFunction)__pyx_pw_6gevent_6_queue_5Queue_27empty, METH_NOARGS, __pyx_doc_6gevent_6_queue_5Queue_26empty};
+static PyObject *__pyx_pw_6gevent_6_queue_5Queue_27empty(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("empty (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_6_queue_5Queue_26empty(((struct __pyx_obj_6gevent_6_queue_Queue *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_queue_5Queue_26empty(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("empty", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_f_6gevent_6_queue_5Queue_empty(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 232, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent._queue.Queue.empty", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__25 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(0, 232, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__25);
+  __Pyx_GIVEREF(__pyx_tuple__25);
+/* … */
+  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_queue_5Queue_27empty, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Queue_empty, NULL, __pyx_n_s_gevent__queue, __pyx_d, ((PyObject *)__pyx_codeobj__26)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 232, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_Queue->tp_dict, __pyx_n_s_empty, __pyx_t_6) < 0) __PYX_ERR(0, 232, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_6_queue_Queue);
+  __pyx_codeobj__26 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__25, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_queue_py, __pyx_n_s_empty, 232, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__26)) __PYX_ERR(0, 232, __pyx_L1_error)
+
 233:         """Return ``True`` if the queue is empty, ``False`` otherwise."""
+
+234:         return not self.qsize()
+
  __pyx_r = (!(((struct __pyx_vtabstruct_6gevent_6_queue_Queue *)__pyx_v_self->__pyx_vtab)->qsize(__pyx_v_self, 0) != 0));
+  goto __pyx_L0;
+
 235: 
+
+236:     def full(self):
+
static PyObject *__pyx_pw_6gevent_6_queue_5Queue_29full(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static int __pyx_f_6gevent_6_queue_5Queue_full(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self, int __pyx_skip_dispatch) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("full", 0);
+  /* Check if called by wrapper */
+  if (unlikely(__pyx_skip_dispatch)) ;
+  /* Check if overridden in Python */
+  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
+    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
+    if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
+    else {
+      PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      #endif
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_full); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 236, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_6_queue_5Queue_29full)) {
+        __Pyx_INCREF(__pyx_t_1);
+        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+          if (likely(__pyx_t_4)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+            __Pyx_INCREF(__pyx_t_4);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_3, function);
+          }
+        }
+        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
+        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 236, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 236, __pyx_L1_error)
+        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+        __pyx_r = __pyx_t_5;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        goto __pyx_L0;
+      }
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+      tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
+      if (unlikely(type_dict_guard != tp_dict_version)) {
+        tp_dict_version = obj_dict_version = 0;
+      }
+      #endif
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    }
+    #endif
+  }
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_WriteUnraisable("gevent._queue.Queue.full", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_queue_5Queue_29full(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6gevent_6_queue_5Queue_28full[] = "Queue.full(self) -> bool\nReturn ``True`` if the queue is full, ``False`` otherwise.\n\n        ``Queue(None)`` is never full.\n        ";
+static PyMethodDef __pyx_mdef_6gevent_6_queue_5Queue_29full = {"full", (PyCFunction)__pyx_pw_6gevent_6_queue_5Queue_29full, METH_NOARGS, __pyx_doc_6gevent_6_queue_5Queue_28full};
+static PyObject *__pyx_pw_6gevent_6_queue_5Queue_29full(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("full (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_6_queue_5Queue_28full(((struct __pyx_obj_6gevent_6_queue_Queue *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_queue_5Queue_28full(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("full", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_f_6gevent_6_queue_5Queue_full(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 236, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent._queue.Queue.full", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__27 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(0, 236, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__27);
+  __Pyx_GIVEREF(__pyx_tuple__27);
+/* … */
+  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_queue_5Queue_29full, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Queue_full, NULL, __pyx_n_s_gevent__queue, __pyx_d, ((PyObject *)__pyx_codeobj__28)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 236, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_Queue->tp_dict, __pyx_n_s_full, __pyx_t_6) < 0) __PYX_ERR(0, 236, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_6_queue_Queue);
+  __pyx_codeobj__28 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__27, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_queue_py, __pyx_n_s_full, 236, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__28)) __PYX_ERR(0, 236, __pyx_L1_error)
+
 237:         """Return ``True`` if the queue is full, ``False`` otherwise.
+
 238: 
+
 239:         ``Queue(None)`` is never full.
+
 240:         """
+
+241:         return self._maxsize > 0 and self.qsize() >= self._maxsize
+
  __pyx_t_6 = ((__pyx_v_self->_maxsize > 0) != 0);
+  if (__pyx_t_6) {
+  } else {
+    __pyx_t_5 = __pyx_t_6;
+    goto __pyx_L3_bool_binop_done;
+  }
+  __pyx_t_6 = ((((struct __pyx_vtabstruct_6gevent_6_queue_Queue *)__pyx_v_self->__pyx_vtab)->qsize(__pyx_v_self, 0) >= __pyx_v_self->_maxsize) != 0);
+  __pyx_t_5 = __pyx_t_6;
+  __pyx_L3_bool_binop_done:;
+  __pyx_r = __pyx_t_5;
+  goto __pyx_L0;
+
 242: 
+
+243:     def put(self, item, block=True, timeout=None):
+
static PyObject *__pyx_pw_6gevent_6_queue_5Queue_31put(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_f_6gevent_6_queue_5Queue_put(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self, PyObject *__pyx_v_item, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_6_queue_5Queue_put *__pyx_optional_args) {
+  PyObject *__pyx_v_block = ((PyObject *)Py_True);
+  PyObject *__pyx_v_timeout = ((PyObject *)Py_None);
+  PyObject *__pyx_v_getter = NULL;
+  struct __pyx_obj_6gevent_6_queue_ItemWaiter *__pyx_v_waiter = NULL;
+  PyObject *__pyx_v_result = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("put", 0);
+  if (__pyx_optional_args) {
+    if (__pyx_optional_args->__pyx_n > 0) {
+      __pyx_v_block = __pyx_optional_args->block;
+      if (__pyx_optional_args->__pyx_n > 1) {
+        __pyx_v_timeout = __pyx_optional_args->timeout;
+      }
+    }
+  }
+  __Pyx_INCREF(__pyx_v_timeout);
+  /* Check if called by wrapper */
+  if (unlikely(__pyx_skip_dispatch)) ;
+  /* Check if overridden in Python */
+  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
+    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
+    if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
+    else {
+      PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      #endif
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_put_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 243, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_6_queue_5Queue_31put)) {
+        __Pyx_XDECREF(__pyx_r);
+        __Pyx_INCREF(__pyx_t_1);
+        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
+        __pyx_t_5 = 0;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+          if (likely(__pyx_t_4)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+            __Pyx_INCREF(__pyx_t_4);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_3, function);
+            __pyx_t_5 = 1;
+          }
+        }
+        #if CYTHON_FAST_PYCALL
+        if (PyFunction_Check(__pyx_t_3)) {
+          PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_item, __pyx_v_block, __pyx_v_timeout};
+          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 243, __pyx_L1_error)
+          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+          __Pyx_GOTREF(__pyx_t_2);
+        } else
+        #endif
+        #if CYTHON_FAST_PYCCALL
+        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
+          PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_item, __pyx_v_block, __pyx_v_timeout};
+          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 243, __pyx_L1_error)
+          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+          __Pyx_GOTREF(__pyx_t_2);
+        } else
+        #endif
+        {
+          __pyx_t_6 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 243, __pyx_L1_error)
+          __Pyx_GOTREF(__pyx_t_6);
+          if (__pyx_t_4) {
+            __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
+          }
+          __Pyx_INCREF(__pyx_v_item);
+          __Pyx_GIVEREF(__pyx_v_item);
+          PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_item);
+          __Pyx_INCREF(__pyx_v_block);
+          __Pyx_GIVEREF(__pyx_v_block);
+          PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_block);
+          __Pyx_INCREF(__pyx_v_timeout);
+          __Pyx_GIVEREF(__pyx_v_timeout);
+          PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_v_timeout);
+          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 243, __pyx_L1_error)
+          __Pyx_GOTREF(__pyx_t_2);
+          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+        }
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __pyx_r = __pyx_t_2;
+        __pyx_t_2 = 0;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        goto __pyx_L0;
+      }
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+      tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
+      if (unlikely(type_dict_guard != tp_dict_version)) {
+        tp_dict_version = obj_dict_version = 0;
+      }
+      #endif
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    }
+    #endif
+  }
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_6);
+  __Pyx_AddTraceback("gevent._queue.Queue.put", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_getter);
+  __Pyx_XDECREF((PyObject *)__pyx_v_waiter);
+  __Pyx_XDECREF(__pyx_v_result);
+  __Pyx_XDECREF(__pyx_v_timeout);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_queue_5Queue_31put(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_6gevent_6_queue_5Queue_30put[] = "Queue.put(self, item, block=True, timeout=None)\nPut an item into the queue.\n\n        If optional arg *block* is true and *timeout* is ``None`` (the default),\n        block if necessary until a free slot is available. If *timeout* is\n        a positive number, it blocks at most *timeout* seconds and raises\n        the :class:`Full` exception if no free slot was available within that time.\n        Otherwise (*block* is false), put an item on the queue if a free slot\n        is immediately available, else raise the :class:`Full` exception (*timeout*\n        is ignored in that case).\n        ";
+static PyMethodDef __pyx_mdef_6gevent_6_queue_5Queue_31put = {"put", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_6_queue_5Queue_31put, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_6_queue_5Queue_30put};
+static PyObject *__pyx_pw_6gevent_6_queue_5Queue_31put(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_item = 0;
+  PyObject *__pyx_v_block = 0;
+  PyObject *__pyx_v_timeout = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("put (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_item,&__pyx_n_s_block,&__pyx_n_s_timeout,0};
+    PyObject* values[3] = {0,0,0};
+    values[1] = ((PyObject *)Py_True);
+    values[2] = ((PyObject *)Py_None);
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_item)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_block);
+          if (value) { values[1] = value; kw_args--; }
+        }
+        CYTHON_FALLTHROUGH;
+        case  2:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_timeout);
+          if (value) { values[2] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "put") < 0)) __PYX_ERR(0, 243, __pyx_L3_error)
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    __pyx_v_item = values[0];
+    __pyx_v_block = values[1];
+    __pyx_v_timeout = values[2];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("put", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 243, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent._queue.Queue.put", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_6_queue_5Queue_30put(((struct __pyx_obj_6gevent_6_queue_Queue *)__pyx_v_self), __pyx_v_item, __pyx_v_block, __pyx_v_timeout);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_queue_5Queue_30put(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_block, PyObject *__pyx_v_timeout) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("put", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_2.__pyx_n = 2;
+  __pyx_t_2.block = __pyx_v_block;
+  __pyx_t_2.timeout = __pyx_v_timeout;
+  __pyx_t_1 = __pyx_vtabptr_6gevent_6_queue_Queue->put(__pyx_v_self, __pyx_v_item, 1, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 243, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent._queue.Queue.put", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__29 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_item, __pyx_n_s_block, __pyx_n_s_timeout); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(0, 243, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__29);
+  __Pyx_GIVEREF(__pyx_tuple__29);
+/* … */
+  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_queue_5Queue_31put, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Queue_put, NULL, __pyx_n_s_gevent__queue, __pyx_d, ((PyObject *)__pyx_codeobj__30)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 243, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_Queue->tp_dict, __pyx_n_s_put_2, __pyx_t_6) < 0) __PYX_ERR(0, 243, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_6_queue_Queue);
+  __pyx_codeobj__30 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__29, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_queue_py, __pyx_n_s_put_2, 243, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__30)) __PYX_ERR(0, 243, __pyx_L1_error)
+
 244:         """Put an item into the queue.
+
 245: 
+
 246:         If optional arg *block* is true and *timeout* is ``None`` (the default),
+
 247:         block if necessary until a free slot is available. If *timeout* is
+
 248:         a positive number, it blocks at most *timeout* seconds and raises
+
 249:         the :class:`Full` exception if no free slot was available within that time.
+
 250:         Otherwise (*block* is false), put an item on the queue if a free slot
+
 251:         is immediately available, else raise the :class:`Full` exception (*timeout*
+
 252:         is ignored in that case).
+
 253:         """
+
+254:         if self._maxsize == -1 or self.qsize() < self._maxsize:
+
  __pyx_t_8 = ((__pyx_v_self->_maxsize == -1L) != 0);
+  if (!__pyx_t_8) {
+  } else {
+    __pyx_t_7 = __pyx_t_8;
+    goto __pyx_L4_bool_binop_done;
+  }
+  __pyx_t_8 = ((((struct __pyx_vtabstruct_6gevent_6_queue_Queue *)__pyx_v_self->__pyx_vtab)->qsize(__pyx_v_self, 0) < __pyx_v_self->_maxsize) != 0);
+  __pyx_t_7 = __pyx_t_8;
+  __pyx_L4_bool_binop_done:;
+  if (__pyx_t_7) {
+/* … */
+    goto __pyx_L3;
+  }
+
 255:             # there's a free slot, put an item right away
+
+256:             self._put(item)
+
    __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_6_queue_Queue *)__pyx_v_self->__pyx_vtab)->_put(__pyx_v_self, __pyx_v_item, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 256, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+257:             if self.getters:
+
    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_self->getters); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 257, __pyx_L1_error)
+    if (__pyx_t_7) {
+/* … */
+    }
+
+258:                 self._schedule_unlock()
+
      __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_6_queue_Queue *)__pyx_v_self->__pyx_vtab)->_schedule_unlock(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 258, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+259:         elif self.hub is getcurrent():
+
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_getcurrent); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 259, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = NULL;
+  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
+    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+    if (likely(__pyx_t_3)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+      __Pyx_INCREF(__pyx_t_3);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_2, function);
+    }
+  }
+  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 259, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_7 = (__pyx_v_self->hub == __pyx_t_1);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_8 = (__pyx_t_7 != 0);
+  if (__pyx_t_8) {
+/* … */
+  }
+
 260:             # We're in the mainloop, so we cannot wait; we can switch to other greenlets though.
+
 261:             # Check if possible to get a free slot in the queue.
+
+262:             while self.getters and self.qsize() and self.qsize() >= self._maxsize:
+
    while (1) {
+      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_self->getters); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 262, __pyx_L1_error)
+      if (__pyx_t_7) {
+      } else {
+        __pyx_t_8 = __pyx_t_7;
+        goto __pyx_L9_bool_binop_done;
+      }
+      __pyx_t_7 = (((struct __pyx_vtabstruct_6gevent_6_queue_Queue *)__pyx_v_self->__pyx_vtab)->qsize(__pyx_v_self, 0) != 0);
+      if (__pyx_t_7) {
+      } else {
+        __pyx_t_8 = __pyx_t_7;
+        goto __pyx_L9_bool_binop_done;
+      }
+      __pyx_t_7 = ((((struct __pyx_vtabstruct_6gevent_6_queue_Queue *)__pyx_v_self->__pyx_vtab)->qsize(__pyx_v_self, 0) >= __pyx_v_self->_maxsize) != 0);
+      __pyx_t_8 = __pyx_t_7;
+      __pyx_L9_bool_binop_done:;
+      if (!__pyx_t_8) break;
+
+263:                 getter = self.getters.popleft()
+
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->getters, __pyx_n_s_popleft); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 263, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_2);
+      __pyx_t_3 = NULL;
+      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+        if (likely(__pyx_t_3)) {
+          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+          __Pyx_INCREF(__pyx_t_3);
+          __Pyx_INCREF(function);
+          __Pyx_DECREF_SET(__pyx_t_2, function);
+        }
+      }
+      __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
+      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 263, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+      __Pyx_XDECREF_SET(__pyx_v_getter, __pyx_t_1);
+      __pyx_t_1 = 0;
+
+264:                 getter.switch(getter)
+
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_getter, __pyx_n_s_switch); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 264, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_2);
+      __pyx_t_3 = NULL;
+      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+        if (likely(__pyx_t_3)) {
+          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+          __Pyx_INCREF(__pyx_t_3);
+          __Pyx_INCREF(function);
+          __Pyx_DECREF_SET(__pyx_t_2, function);
+        }
+      }
+      __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_getter) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_getter);
+      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 264, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    }
+
+265:             if self.qsize() < self._maxsize:
+
    __pyx_t_8 = ((((struct __pyx_vtabstruct_6gevent_6_queue_Queue *)__pyx_v_self->__pyx_vtab)->qsize(__pyx_v_self, 0) < __pyx_v_self->_maxsize) != 0);
+    if (__pyx_t_8) {
+/* … */
+    }
+
+266:                 self._put(item)
+
      __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_6_queue_Queue *)__pyx_v_self->__pyx_vtab)->_put(__pyx_v_self, __pyx_v_item, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 266, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+267:                 return
+
      __Pyx_XDECREF(__pyx_r);
+      __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+      goto __pyx_L0;
+
+268:             raise Full
+
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Full); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 268, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __PYX_ERR(0, 268, __pyx_L1_error)
+
+269:         elif block:
+
  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_block); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 269, __pyx_L1_error)
+  if (likely(__pyx_t_8)) {
+/* … */
+    goto __pyx_L3;
+  }
+
+270:             waiter = ItemWaiter(item, self)
+
    __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 270, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_INCREF(__pyx_v_item);
+    __Pyx_GIVEREF(__pyx_v_item);
+    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_item);
+    __Pyx_INCREF(((PyObject *)__pyx_v_self));
+    __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
+    PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_self));
+    __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6gevent_6_queue_ItemWaiter), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 270, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __pyx_v_waiter = ((struct __pyx_obj_6gevent_6_queue_ItemWaiter *)__pyx_t_2);
+    __pyx_t_2 = 0;
+
+271:             self.putters.append(waiter)
+
    __pyx_t_9 = __Pyx_PyObject_Append(__pyx_v_self->putters, ((PyObject *)__pyx_v_waiter)); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 271, __pyx_L1_error)
+
+272:             timeout = Timeout._start_new_or_dummy(timeout, Full)
+
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Timeout); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 272, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_start_new_or_dummy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 272, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Full); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 272, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __pyx_t_6 = NULL;
+    __pyx_t_5 = 0;
+    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
+      if (likely(__pyx_t_6)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+        __Pyx_INCREF(__pyx_t_6);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_3, function);
+        __pyx_t_5 = 1;
+      }
+    }
+    #if CYTHON_FAST_PYCALL
+    if (PyFunction_Check(__pyx_t_3)) {
+      PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_timeout, __pyx_t_1};
+      __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 272, __pyx_L1_error)
+      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+      __Pyx_GOTREF(__pyx_t_2);
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    } else
+    #endif
+    #if CYTHON_FAST_PYCCALL
+    if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
+      PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_timeout, __pyx_t_1};
+      __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 272, __pyx_L1_error)
+      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+      __Pyx_GOTREF(__pyx_t_2);
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    } else
+    #endif
+    {
+      __pyx_t_4 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 272, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_4);
+      if (__pyx_t_6) {
+        __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6); __pyx_t_6 = NULL;
+      }
+      __Pyx_INCREF(__pyx_v_timeout);
+      __Pyx_GIVEREF(__pyx_v_timeout);
+      PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_5, __pyx_v_timeout);
+      __Pyx_GIVEREF(__pyx_t_1);
+      PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_5, __pyx_t_1);
+      __pyx_t_1 = 0;
+      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 272, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_2);
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    }
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __Pyx_DECREF_SET(__pyx_v_timeout, __pyx_t_2);
+    __pyx_t_2 = 0;
+
+273:             try:
+
    /*try:*/ {
+
+274:                 if self.getters:
+
      __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_self->getters); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 274, __pyx_L14_error)
+      if (__pyx_t_8) {
+/* … */
+      }
+
+275:                     self._schedule_unlock()
+
        __pyx_t_2 = ((struct __pyx_vtabstruct_6gevent_6_queue_Queue *)__pyx_v_self->__pyx_vtab)->_schedule_unlock(__pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 275, __pyx_L14_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+276:                 result = waiter.get()
+
      __pyx_t_2 = ((struct __pyx_vtabstruct_6gevent_6_queue_ItemWaiter *)__pyx_v_waiter->__pyx_base.__pyx_vtab)->__pyx_base.get(((struct __pyx_obj_6gevent_8__waiter_Waiter *)__pyx_v_waiter), 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 276, __pyx_L14_error)
+      __Pyx_GOTREF(__pyx_t_2);
+      __pyx_v_result = __pyx_t_2;
+      __pyx_t_2 = 0;
+
+277:                 if result is not waiter:
+
      __pyx_t_8 = (__pyx_v_result != ((PyObject *)__pyx_v_waiter));
+      __pyx_t_7 = (__pyx_t_8 != 0);
+      if (unlikely(__pyx_t_7)) {
+/* … */
+      }
+    }
+
+278:                     raise InvalidSwitchError("Invalid switch into Queue.put: %r" % (result, ))
+
        __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_InvalidSwitchError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 278, __pyx_L14_error)
+        __Pyx_GOTREF(__pyx_t_3);
+        __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 278, __pyx_L14_error)
+        __Pyx_GOTREF(__pyx_t_4);
+        __Pyx_INCREF(__pyx_v_result);
+        __Pyx_GIVEREF(__pyx_v_result);
+        PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_result);
+        __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_switch_into_Queue_put_r, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 278, __pyx_L14_error)
+        __Pyx_GOTREF(__pyx_t_1);
+        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+        __pyx_t_4 = NULL;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+          if (likely(__pyx_t_4)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+            __Pyx_INCREF(__pyx_t_4);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_3, function);
+          }
+        }
+        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_t_1) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1);
+        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 278, __pyx_L14_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __Pyx_Raise(__pyx_t_2, 0, 0, 0);
+        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+        __PYX_ERR(0, 278, __pyx_L14_error)
+
 279:             finally:
+
+280:                 timeout.cancel()
+
    /*finally:*/ {
+      /*normal exit:*/{
+        __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_timeout, __pyx_n_s_cancel); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 280, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_3);
+        __pyx_t_1 = NULL;
+        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
+          __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
+          if (likely(__pyx_t_1)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+            __Pyx_INCREF(__pyx_t_1);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_3, function);
+          }
+        }
+        __pyx_t_2 = (__pyx_t_1) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
+        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 280, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+/* … */
+          __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_timeout, __pyx_n_s_cancel); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 280, __pyx_L19_error)
+          __Pyx_GOTREF(__pyx_t_2);
+          __pyx_t_1 = NULL;
+          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+            __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
+            if (likely(__pyx_t_1)) {
+              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+              __Pyx_INCREF(__pyx_t_1);
+              __Pyx_INCREF(function);
+              __Pyx_DECREF_SET(__pyx_t_2, function);
+            }
+          }
+          __pyx_t_3 = (__pyx_t_1) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_1) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
+          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+          if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 280, __pyx_L19_error)
+          __Pyx_GOTREF(__pyx_t_3);
+          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+
+281:                 _safe_remove(self.putters, waiter)
+
        __pyx_t_2 = __pyx_v_self->putters;
+        __Pyx_INCREF(__pyx_t_2);
+        __pyx_t_3 = __pyx_f_6gevent_6_queue__safe_remove(__pyx_t_2, ((PyObject *)__pyx_v_waiter)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 281, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_3);
+        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        goto __pyx_L15;
+      }
+      __pyx_L14_error:;
+      /*exception exit:*/{
+        __Pyx_PyThreadState_declare
+        __Pyx_PyThreadState_assign
+        __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0;
+        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+        if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
+        if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14) < 0)) __Pyx_ErrFetch(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14);
+        __Pyx_XGOTREF(__pyx_t_12);
+        __Pyx_XGOTREF(__pyx_t_13);
+        __Pyx_XGOTREF(__pyx_t_14);
+        __Pyx_XGOTREF(__pyx_t_15);
+        __Pyx_XGOTREF(__pyx_t_16);
+        __Pyx_XGOTREF(__pyx_t_17);
+        __pyx_t_5 = __pyx_lineno; __pyx_t_10 = __pyx_clineno; __pyx_t_11 = __pyx_filename;
+        {
+/* … */
+          __pyx_t_3 = __pyx_v_self->putters;
+          __Pyx_INCREF(__pyx_t_3);
+          __pyx_t_2 = __pyx_f_6gevent_6_queue__safe_remove(__pyx_t_3, ((PyObject *)__pyx_v_waiter)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 281, __pyx_L19_error)
+          __Pyx_GOTREF(__pyx_t_2);
+          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+        }
+        if (PY_MAJOR_VERSION >= 3) {
+          __Pyx_XGIVEREF(__pyx_t_15);
+          __Pyx_XGIVEREF(__pyx_t_16);
+          __Pyx_XGIVEREF(__pyx_t_17);
+          __Pyx_ExceptionReset(__pyx_t_15, __pyx_t_16, __pyx_t_17);
+        }
+        __Pyx_XGIVEREF(__pyx_t_12);
+        __Pyx_XGIVEREF(__pyx_t_13);
+        __Pyx_XGIVEREF(__pyx_t_14);
+        __Pyx_ErrRestore(__pyx_t_12, __pyx_t_13, __pyx_t_14);
+        __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0;
+        __pyx_lineno = __pyx_t_5; __pyx_clineno = __pyx_t_10; __pyx_filename = __pyx_t_11;
+        goto __pyx_L1_error;
+        __pyx_L19_error:;
+        if (PY_MAJOR_VERSION >= 3) {
+          __Pyx_XGIVEREF(__pyx_t_15);
+          __Pyx_XGIVEREF(__pyx_t_16);
+          __Pyx_XGIVEREF(__pyx_t_17);
+          __Pyx_ExceptionReset(__pyx_t_15, __pyx_t_16, __pyx_t_17);
+        }
+        __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
+        __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
+        __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
+        __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0;
+        goto __pyx_L1_error;
+      }
+      __pyx_L15:;
+    }
+
 282:         else:
+
+283:             raise Full
+
  /*else*/ {
+    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Full); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 283, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __PYX_ERR(0, 283, __pyx_L1_error)
+  }
+  __pyx_L3:;
+
 284: 
+
+285:     def put_nowait(self, item):
+
static PyObject *__pyx_pw_6gevent_6_queue_5Queue_33put_nowait(PyObject *__pyx_v_self, PyObject *__pyx_v_item); /*proto*/
+static PyObject *__pyx_f_6gevent_6_queue_5Queue_put_nowait(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self, PyObject *__pyx_v_item, int __pyx_skip_dispatch) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("put_nowait", 0);
+  /* Check if called by wrapper */
+  if (unlikely(__pyx_skip_dispatch)) ;
+  /* Check if overridden in Python */
+  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
+    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
+    if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
+    else {
+      PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      #endif
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_put_nowait); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 285, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_6_queue_5Queue_33put_nowait)) {
+        __Pyx_XDECREF(__pyx_r);
+        __Pyx_INCREF(__pyx_t_1);
+        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+          if (likely(__pyx_t_4)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+            __Pyx_INCREF(__pyx_t_4);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_3, function);
+          }
+        }
+        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_item) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_item);
+        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 285, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __pyx_r = __pyx_t_2;
+        __pyx_t_2 = 0;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        goto __pyx_L0;
+      }
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+      tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
+      if (unlikely(type_dict_guard != tp_dict_version)) {
+        tp_dict_version = obj_dict_version = 0;
+      }
+      #endif
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    }
+    #endif
+  }
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_AddTraceback("gevent._queue.Queue.put_nowait", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_queue_5Queue_33put_nowait(PyObject *__pyx_v_self, PyObject *__pyx_v_item); /*proto*/
+static char __pyx_doc_6gevent_6_queue_5Queue_32put_nowait[] = "Queue.put_nowait(self, item)\nPut an item into the queue without blocking.\n\n        Only enqueue the item if a free slot is immediately available.\n        Otherwise raise the :class:`Full` exception.\n        ";
+static PyMethodDef __pyx_mdef_6gevent_6_queue_5Queue_33put_nowait = {"put_nowait", (PyCFunction)__pyx_pw_6gevent_6_queue_5Queue_33put_nowait, METH_O, __pyx_doc_6gevent_6_queue_5Queue_32put_nowait};
+static PyObject *__pyx_pw_6gevent_6_queue_5Queue_33put_nowait(PyObject *__pyx_v_self, PyObject *__pyx_v_item) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("put_nowait (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_6_queue_5Queue_32put_nowait(((struct __pyx_obj_6gevent_6_queue_Queue *)__pyx_v_self), ((PyObject *)__pyx_v_item));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_queue_5Queue_32put_nowait(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self, PyObject *__pyx_v_item) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("put_nowait", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __pyx_f_6gevent_6_queue_5Queue_put_nowait(__pyx_v_self, __pyx_v_item, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 285, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent._queue.Queue.put_nowait", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__31 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_item); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(0, 285, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__31);
+  __Pyx_GIVEREF(__pyx_tuple__31);
+/* … */
+  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_queue_5Queue_33put_nowait, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Queue_put_nowait, NULL, __pyx_n_s_gevent__queue, __pyx_d, ((PyObject *)__pyx_codeobj__32)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 285, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_Queue->tp_dict, __pyx_n_s_put_nowait, __pyx_t_6) < 0) __PYX_ERR(0, 285, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_6_queue_Queue);
+  __pyx_codeobj__32 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__31, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_queue_py, __pyx_n_s_put_nowait, 285, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__32)) __PYX_ERR(0, 285, __pyx_L1_error)
+
 286:         """Put an item into the queue without blocking.
+
 287: 
+
 288:         Only enqueue the item if a free slot is immediately available.
+
 289:         Otherwise raise the :class:`Full` exception.
+
 290:         """
+
+291:         self.put(item, False)
+
  __pyx_t_5.__pyx_n = 1;
+  __pyx_t_5.block = Py_False;
+  __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_6_queue_Queue *)__pyx_v_self->__pyx_vtab)->put(__pyx_v_self, __pyx_v_item, 0, &__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 291, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 292: 
+
+293:     def __get_or_peek(self, method, block, timeout):
+
static PyObject *__pyx_f_6gevent_6_queue_5Queue___get_or_peek(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self, PyObject *__pyx_v_method, PyObject *__pyx_v_block, PyObject *__pyx_v_timeout) {
+  struct __pyx_obj_6gevent_8__waiter_Waiter *__pyx_v_waiter = NULL;
+  PyObject *__pyx_v_result = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get_or_peek", 0);
+  __Pyx_INCREF(__pyx_v_timeout);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_6);
+  __Pyx_XDECREF(__pyx_t_8);
+  __Pyx_AddTraceback("gevent._queue.Queue.__get_or_peek", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XDECREF((PyObject *)__pyx_v_waiter);
+  __Pyx_XDECREF(__pyx_v_result);
+  __Pyx_XDECREF(__pyx_v_timeout);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
 294:         # Internal helper method. The `method` should be either
+
 295:         # self._get when called from self.get() or self._peek when
+
 296:         # called from self.peek(). Call this after the initial check
+
 297:         # to see if there are items in the queue.
+
 298: 
+
+299:         if self.hub is getcurrent():
+
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_getcurrent); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 299, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = NULL;
+  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
+    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+    if (likely(__pyx_t_3)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+      __Pyx_INCREF(__pyx_t_3);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_2, function);
+    }
+  }
+  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 299, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_4 = (__pyx_v_self->hub == __pyx_t_1);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_5 = (__pyx_t_4 != 0);
+  if (__pyx_t_5) {
+/* … */
+  }
+
 300:             # special case to make get_nowait() or peek_nowait() runnable in the mainloop greenlet
+
 301:             # there are no items in the queue; try to fix the situation by unlocking putters
+
+302:             while self.putters:
+
    while (1) {
+      __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_self->putters); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 302, __pyx_L1_error)
+      if (!__pyx_t_5) break;
+
 303:                 # Note: get() used popleft(), peek used pop(); popleft
+
 304:                 # is almost certainly correct.
+
+305:                 self.putters.popleft().put_and_switch()
+
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->putters, __pyx_n_s_popleft); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 305, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_3);
+      __pyx_t_6 = NULL;
+      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
+        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
+        if (likely(__pyx_t_6)) {
+          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+          __Pyx_INCREF(__pyx_t_6);
+          __Pyx_INCREF(function);
+          __Pyx_DECREF_SET(__pyx_t_3, function);
+        }
+      }
+      __pyx_t_2 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
+      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 305, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_2);
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_put_and_switch); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 305, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_3);
+      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+      __pyx_t_2 = NULL;
+      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
+        __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
+        if (likely(__pyx_t_2)) {
+          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+          __Pyx_INCREF(__pyx_t_2);
+          __Pyx_INCREF(function);
+          __Pyx_DECREF_SET(__pyx_t_3, function);
+        }
+      }
+      __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
+      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 305, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+306:                 if self.qsize():
+
      __pyx_t_5 = (((struct __pyx_vtabstruct_6gevent_6_queue_Queue *)__pyx_v_self->__pyx_vtab)->qsize(__pyx_v_self, 0) != 0);
+      if (__pyx_t_5) {
+/* … */
+      }
+    }
+
+307:                     return method()
+
        __Pyx_XDECREF(__pyx_r);
+        __Pyx_INCREF(__pyx_v_method);
+        __pyx_t_3 = __pyx_v_method; __pyx_t_2 = NULL;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+          __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
+          if (likely(__pyx_t_2)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+            __Pyx_INCREF(__pyx_t_2);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_3, function);
+          }
+        }
+        __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
+        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+        if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 307, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_1);
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __pyx_r = __pyx_t_1;
+        __pyx_t_1 = 0;
+        goto __pyx_L0;
+
+308:             raise Empty()
+
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Empty); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 308, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __pyx_t_2 = NULL;
+    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
+      if (likely(__pyx_t_2)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+        __Pyx_INCREF(__pyx_t_2);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_3, function);
+      }
+    }
+    __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
+    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 308, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __PYX_ERR(0, 308, __pyx_L1_error)
+
 309: 
+
+310:         if not block:
+
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_block); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 310, __pyx_L1_error)
+  __pyx_t_4 = ((!__pyx_t_5) != 0);
+  if (unlikely(__pyx_t_4)) {
+/* … */
+  }
+
 311:             # We can't block, we're not the hub, and we have nothing
+
 312:             # to return. No choice...
+
+313:             raise Empty()
+
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Empty); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 313, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __pyx_t_2 = NULL;
+    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
+      if (likely(__pyx_t_2)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+        __Pyx_INCREF(__pyx_t_2);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_3, function);
+      }
+    }
+    __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
+    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 313, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __PYX_ERR(0, 313, __pyx_L1_error)
+
 314: 
+
+315:         waiter = Waiter() # pylint:disable=undefined-variable
+
  __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_6gevent_8__waiter_Waiter)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 315, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_v_waiter = ((struct __pyx_obj_6gevent_8__waiter_Waiter *)__pyx_t_1);
+  __pyx_t_1 = 0;
+
+316:         timeout = Timeout._start_new_or_dummy(timeout, Empty)
+
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Timeout); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 316, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_start_new_or_dummy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 316, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Empty); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 316, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __pyx_t_6 = NULL;
+  __pyx_t_7 = 0;
+  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
+    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
+    if (likely(__pyx_t_6)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+      __Pyx_INCREF(__pyx_t_6);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_2, function);
+      __pyx_t_7 = 1;
+    }
+  }
+  #if CYTHON_FAST_PYCALL
+  if (PyFunction_Check(__pyx_t_2)) {
+    PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_timeout, __pyx_t_3};
+    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 316, __pyx_L1_error)
+    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  } else
+  #endif
+  #if CYTHON_FAST_PYCCALL
+  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
+    PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_timeout, __pyx_t_3};
+    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 316, __pyx_L1_error)
+    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  } else
+  #endif
+  {
+    __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 316, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_8);
+    if (__pyx_t_6) {
+      __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL;
+    }
+    __Pyx_INCREF(__pyx_v_timeout);
+    __Pyx_GIVEREF(__pyx_v_timeout);
+    PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_v_timeout);
+    __Pyx_GIVEREF(__pyx_t_3);
+    PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_t_3);
+    __pyx_t_3 = 0;
+    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 316, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+  }
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF_SET(__pyx_v_timeout, __pyx_t_1);
+  __pyx_t_1 = 0;
+
+317:         try:
+
  /*try:*/ {
+
+318:             self.getters.append(waiter)
+
    __pyx_t_9 = __Pyx_PyObject_Append(__pyx_v_self->getters, ((PyObject *)__pyx_v_waiter)); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 318, __pyx_L9_error)
+
+319:             if self.putters:
+
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_self->putters); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 319, __pyx_L9_error)
+    if (__pyx_t_4) {
+/* … */
+    }
+
+320:                 self._schedule_unlock()
+
      __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_6_queue_Queue *)__pyx_v_self->__pyx_vtab)->_schedule_unlock(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 320, __pyx_L9_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+321:             result = waiter.get()
+
    __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_8__waiter_Waiter *)__pyx_v_waiter->__pyx_vtab)->get(__pyx_v_waiter, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 321, __pyx_L9_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __pyx_v_result = __pyx_t_1;
+    __pyx_t_1 = 0;
+
+322:             if result is not waiter:
+
    __pyx_t_4 = (__pyx_v_result != ((PyObject *)__pyx_v_waiter));
+    __pyx_t_5 = (__pyx_t_4 != 0);
+    if (unlikely(__pyx_t_5)) {
+/* … */
+    }
+
+323:                 raise InvalidSwitchError('Invalid switch into Queue.get: %r' % (result, ))
+
      __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_InvalidSwitchError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 323, __pyx_L9_error)
+      __Pyx_GOTREF(__pyx_t_2);
+      __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 323, __pyx_L9_error)
+      __Pyx_GOTREF(__pyx_t_8);
+      __Pyx_INCREF(__pyx_v_result);
+      __Pyx_GIVEREF(__pyx_v_result);
+      PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_result);
+      __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_switch_into_Queue_get_r, __pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 323, __pyx_L9_error)
+      __Pyx_GOTREF(__pyx_t_3);
+      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+      __pyx_t_8 = NULL;
+      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
+        __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_2);
+        if (likely(__pyx_t_8)) {
+          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+          __Pyx_INCREF(__pyx_t_8);
+          __Pyx_INCREF(function);
+          __Pyx_DECREF_SET(__pyx_t_2, function);
+        }
+      }
+      __pyx_t_1 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_8, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
+      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 323, __pyx_L9_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+      __Pyx_Raise(__pyx_t_1, 0, 0, 0);
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      __PYX_ERR(0, 323, __pyx_L9_error)
+
+324:             return method()
+
    __Pyx_XDECREF(__pyx_r);
+    __Pyx_INCREF(__pyx_v_method);
+    __pyx_t_2 = __pyx_v_method; __pyx_t_3 = NULL;
+    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
+      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+      if (likely(__pyx_t_3)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+        __Pyx_INCREF(__pyx_t_3);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_2, function);
+      }
+    }
+    __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
+    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 324, __pyx_L9_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __pyx_r = __pyx_t_1;
+    __pyx_t_1 = 0;
+    goto __pyx_L8_return;
+  }
+
 325:         finally:
+
+326:             timeout.cancel()
+
  /*finally:*/ {
+    __pyx_L9_error:;
+    /*exception exit:*/{
+      __Pyx_PyThreadState_declare
+      __Pyx_PyThreadState_assign
+      __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0;
+      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
+      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+      if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
+      if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14) < 0)) __Pyx_ErrFetch(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14);
+      __Pyx_XGOTREF(__pyx_t_12);
+      __Pyx_XGOTREF(__pyx_t_13);
+      __Pyx_XGOTREF(__pyx_t_14);
+      __Pyx_XGOTREF(__pyx_t_15);
+      __Pyx_XGOTREF(__pyx_t_16);
+      __Pyx_XGOTREF(__pyx_t_17);
+      __pyx_t_7 = __pyx_lineno; __pyx_t_10 = __pyx_clineno; __pyx_t_11 = __pyx_filename;
+      {
+        __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_timeout, __pyx_n_s_cancel); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 326, __pyx_L14_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        __pyx_t_3 = NULL;
+        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+          if (likely(__pyx_t_3)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+            __Pyx_INCREF(__pyx_t_3);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_2, function);
+          }
+        }
+        __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
+        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+        if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 326, __pyx_L14_error)
+        __Pyx_GOTREF(__pyx_t_1);
+        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+/* … */
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_timeout, __pyx_n_s_cancel); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 326, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      __pyx_t_3 = NULL;
+      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
+        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
+        if (likely(__pyx_t_3)) {
+          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
+          __Pyx_INCREF(__pyx_t_3);
+          __Pyx_INCREF(function);
+          __Pyx_DECREF_SET(__pyx_t_1, function);
+        }
+      }
+      __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_1);
+      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 326, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_2);
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+327:             _safe_remove(self.getters, waiter)
+
        __pyx_t_1 = __pyx_v_self->getters;
+        __Pyx_INCREF(__pyx_t_1);
+        __pyx_t_2 = __pyx_f_6gevent_6_queue__safe_remove(__pyx_t_1, ((PyObject *)__pyx_v_waiter)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 327, __pyx_L14_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+      }
+      if (PY_MAJOR_VERSION >= 3) {
+        __Pyx_XGIVEREF(__pyx_t_15);
+        __Pyx_XGIVEREF(__pyx_t_16);
+        __Pyx_XGIVEREF(__pyx_t_17);
+        __Pyx_ExceptionReset(__pyx_t_15, __pyx_t_16, __pyx_t_17);
+      }
+      __Pyx_XGIVEREF(__pyx_t_12);
+      __Pyx_XGIVEREF(__pyx_t_13);
+      __Pyx_XGIVEREF(__pyx_t_14);
+      __Pyx_ErrRestore(__pyx_t_12, __pyx_t_13, __pyx_t_14);
+      __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0;
+      __pyx_lineno = __pyx_t_7; __pyx_clineno = __pyx_t_10; __pyx_filename = __pyx_t_11;
+      goto __pyx_L1_error;
+      __pyx_L14_error:;
+      if (PY_MAJOR_VERSION >= 3) {
+        __Pyx_XGIVEREF(__pyx_t_15);
+        __Pyx_XGIVEREF(__pyx_t_16);
+        __Pyx_XGIVEREF(__pyx_t_17);
+        __Pyx_ExceptionReset(__pyx_t_15, __pyx_t_16, __pyx_t_17);
+      }
+      __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
+      __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
+      __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
+      __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0;
+      goto __pyx_L1_error;
+    }
+    __pyx_L8_return: {
+      __pyx_t_17 = __pyx_r;
+      __pyx_r = 0;
+/* … */
+      __pyx_t_2 = __pyx_v_self->getters;
+      __Pyx_INCREF(__pyx_t_2);
+      __pyx_t_1 = __pyx_f_6gevent_6_queue__safe_remove(__pyx_t_2, ((PyObject *)__pyx_v_waiter)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 327, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      __pyx_r = __pyx_t_17;
+      __pyx_t_17 = 0;
+      goto __pyx_L0;
+    }
+  }
+
 328: 
+
+329:     def get(self, block=True, timeout=None):
+
static PyObject *__pyx_pw_6gevent_6_queue_5Queue_35get(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_f_6gevent_6_queue_5Queue_get(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_6_queue_5Queue_get *__pyx_optional_args) {
+  PyObject *__pyx_v_block = ((PyObject *)Py_True);
+  PyObject *__pyx_v_timeout = ((PyObject *)Py_None);
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("get", 0);
+  if (__pyx_optional_args) {
+    if (__pyx_optional_args->__pyx_n > 0) {
+      __pyx_v_block = __pyx_optional_args->block;
+      if (__pyx_optional_args->__pyx_n > 1) {
+        __pyx_v_timeout = __pyx_optional_args->timeout;
+      }
+    }
+  }
+  /* Check if called by wrapper */
+  if (unlikely(__pyx_skip_dispatch)) ;
+  /* Check if overridden in Python */
+  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
+    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
+    if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
+    else {
+      PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      #endif
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 329, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_6_queue_5Queue_35get)) {
+        __Pyx_XDECREF(__pyx_r);
+        __Pyx_INCREF(__pyx_t_1);
+        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
+        __pyx_t_5 = 0;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+          if (likely(__pyx_t_4)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+            __Pyx_INCREF(__pyx_t_4);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_3, function);
+            __pyx_t_5 = 1;
+          }
+        }
+        #if CYTHON_FAST_PYCALL
+        if (PyFunction_Check(__pyx_t_3)) {
+          PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_block, __pyx_v_timeout};
+          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 329, __pyx_L1_error)
+          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+          __Pyx_GOTREF(__pyx_t_2);
+        } else
+        #endif
+        #if CYTHON_FAST_PYCCALL
+        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
+          PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_block, __pyx_v_timeout};
+          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 329, __pyx_L1_error)
+          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+          __Pyx_GOTREF(__pyx_t_2);
+        } else
+        #endif
+        {
+          __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 329, __pyx_L1_error)
+          __Pyx_GOTREF(__pyx_t_6);
+          if (__pyx_t_4) {
+            __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
+          }
+          __Pyx_INCREF(__pyx_v_block);
+          __Pyx_GIVEREF(__pyx_v_block);
+          PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_block);
+          __Pyx_INCREF(__pyx_v_timeout);
+          __Pyx_GIVEREF(__pyx_v_timeout);
+          PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_timeout);
+          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 329, __pyx_L1_error)
+          __Pyx_GOTREF(__pyx_t_2);
+          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+        }
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __pyx_r = __pyx_t_2;
+        __pyx_t_2 = 0;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        goto __pyx_L0;
+      }
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+      tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
+      if (unlikely(type_dict_guard != tp_dict_version)) {
+        tp_dict_version = obj_dict_version = 0;
+      }
+      #endif
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    }
+    #endif
+  }
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_6);
+  __Pyx_AddTraceback("gevent._queue.Queue.get", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_queue_5Queue_35get(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_6gevent_6_queue_5Queue_34get[] = "Queue.get(self, block=True, timeout=None)\nRemove and return an item from the queue.\n\n        If optional args *block* is true and *timeout* is ``None`` (the default),\n        block if necessary until an item is available. If *timeout* is a positive number,\n        it blocks at most *timeout* seconds and raises the :class:`Empty` exception\n        if no item was available within that time. Otherwise (*block* is false), return\n        an item if one is immediately available, else raise the :class:`Empty` exception\n        (*timeout* is ignored in that case).\n        ";
+static PyMethodDef __pyx_mdef_6gevent_6_queue_5Queue_35get = {"get", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_6_queue_5Queue_35get, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_6_queue_5Queue_34get};
+static PyObject *__pyx_pw_6gevent_6_queue_5Queue_35get(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_block = 0;
+  PyObject *__pyx_v_timeout = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("get (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_block,&__pyx_n_s_timeout,0};
+    PyObject* values[2] = {0,0};
+    values[0] = ((PyObject *)Py_True);
+    values[1] = ((PyObject *)Py_None);
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_block);
+          if (value) { values[0] = value; kw_args--; }
+        }
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_timeout);
+          if (value) { values[1] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get") < 0)) __PYX_ERR(0, 329, __pyx_L3_error)
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    __pyx_v_block = values[0];
+    __pyx_v_timeout = values[1];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("get", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 329, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent._queue.Queue.get", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_6_queue_5Queue_34get(((struct __pyx_obj_6gevent_6_queue_Queue *)__pyx_v_self), __pyx_v_block, __pyx_v_timeout);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_queue_5Queue_34get(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self, PyObject *__pyx_v_block, PyObject *__pyx_v_timeout) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("get", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_2.__pyx_n = 2;
+  __pyx_t_2.block = __pyx_v_block;
+  __pyx_t_2.timeout = __pyx_v_timeout;
+  __pyx_t_1 = __pyx_vtabptr_6gevent_6_queue_Queue->get(__pyx_v_self, 1, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 329, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent._queue.Queue.get", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__33 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_block, __pyx_n_s_timeout); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(0, 329, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__33);
+  __Pyx_GIVEREF(__pyx_tuple__33);
+/* … */
+  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_queue_5Queue_35get, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Queue_get, NULL, __pyx_n_s_gevent__queue, __pyx_d, ((PyObject *)__pyx_codeobj__34)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 329, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_Queue->tp_dict, __pyx_n_s_get_2, __pyx_t_6) < 0) __PYX_ERR(0, 329, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_6_queue_Queue);
+  __pyx_codeobj__34 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__33, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_queue_py, __pyx_n_s_get_2, 329, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__34)) __PYX_ERR(0, 329, __pyx_L1_error)
+
 330:         """Remove and return an item from the queue.
+
 331: 
+
 332:         If optional args *block* is true and *timeout* is ``None`` (the default),
+
 333:         block if necessary until an item is available. If *timeout* is a positive number,
+
 334:         it blocks at most *timeout* seconds and raises the :class:`Empty` exception
+
 335:         if no item was available within that time. Otherwise (*block* is false), return
+
 336:         an item if one is immediately available, else raise the :class:`Empty` exception
+
 337:         (*timeout* is ignored in that case).
+
 338:         """
+
+339:         if self.qsize():
+
  __pyx_t_7 = (((struct __pyx_vtabstruct_6gevent_6_queue_Queue *)__pyx_v_self->__pyx_vtab)->qsize(__pyx_v_self, 0) != 0);
+  if (__pyx_t_7) {
+/* … */
+  }
+
+340:             if self.putters:
+
    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_self->putters); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 340, __pyx_L1_error)
+    if (__pyx_t_7) {
+/* … */
+    }
+
+341:                 self._schedule_unlock()
+
      __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_6_queue_Queue *)__pyx_v_self->__pyx_vtab)->_schedule_unlock(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 341, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+342:             return self._get()
+
    __Pyx_XDECREF(__pyx_r);
+    __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_6_queue_Queue *)__pyx_v_self->__pyx_vtab)->_get(__pyx_v_self, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 342, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __pyx_r = __pyx_t_1;
+    __pyx_t_1 = 0;
+    goto __pyx_L0;
+
 343: 
+
+344:         return self.__get_or_peek(self._get, block, timeout)
+
  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 344, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = ((struct __pyx_vtabstruct_6gevent_6_queue_Queue *)__pyx_v_self->__pyx_vtab)->__pyx___get_or_peek(__pyx_v_self, __pyx_t_1, __pyx_v_block, __pyx_v_timeout); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 344, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_r = __pyx_t_2;
+  __pyx_t_2 = 0;
+  goto __pyx_L0;
+
 345: 
+
+346:     def get_nowait(self):
+
static PyObject *__pyx_pw_6gevent_6_queue_5Queue_37get_nowait(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyObject *__pyx_f_6gevent_6_queue_5Queue_get_nowait(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self, int __pyx_skip_dispatch) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("get_nowait", 0);
+  /* Check if called by wrapper */
+  if (unlikely(__pyx_skip_dispatch)) ;
+  /* Check if overridden in Python */
+  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
+    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
+    if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
+    else {
+      PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      #endif
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_nowait); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 346, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_6_queue_5Queue_37get_nowait)) {
+        __Pyx_XDECREF(__pyx_r);
+        __Pyx_INCREF(__pyx_t_1);
+        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+          if (likely(__pyx_t_4)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+            __Pyx_INCREF(__pyx_t_4);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_3, function);
+          }
+        }
+        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
+        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 346, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __pyx_r = __pyx_t_2;
+        __pyx_t_2 = 0;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        goto __pyx_L0;
+      }
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+      tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
+      if (unlikely(type_dict_guard != tp_dict_version)) {
+        tp_dict_version = obj_dict_version = 0;
+      }
+      #endif
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    }
+    #endif
+  }
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_AddTraceback("gevent._queue.Queue.get_nowait", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_queue_5Queue_37get_nowait(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6gevent_6_queue_5Queue_36get_nowait[] = "Queue.get_nowait(self)\nRemove and return an item from the queue without blocking.\n\n        Only get an item if one is immediately available. Otherwise\n        raise the :class:`Empty` exception.\n        ";
+static PyMethodDef __pyx_mdef_6gevent_6_queue_5Queue_37get_nowait = {"get_nowait", (PyCFunction)__pyx_pw_6gevent_6_queue_5Queue_37get_nowait, METH_NOARGS, __pyx_doc_6gevent_6_queue_5Queue_36get_nowait};
+static PyObject *__pyx_pw_6gevent_6_queue_5Queue_37get_nowait(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("get_nowait (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_6_queue_5Queue_36get_nowait(((struct __pyx_obj_6gevent_6_queue_Queue *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_queue_5Queue_36get_nowait(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("get_nowait", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __pyx_f_6gevent_6_queue_5Queue_get_nowait(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 346, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent._queue.Queue.get_nowait", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__35 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(0, 346, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__35);
+  __Pyx_GIVEREF(__pyx_tuple__35);
+/* … */
+  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_queue_5Queue_37get_nowait, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Queue_get_nowait, NULL, __pyx_n_s_gevent__queue, __pyx_d, ((PyObject *)__pyx_codeobj__36)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 346, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_Queue->tp_dict, __pyx_n_s_get_nowait, __pyx_t_6) < 0) __PYX_ERR(0, 346, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_6_queue_Queue);
+  __pyx_codeobj__36 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__35, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_queue_py, __pyx_n_s_get_nowait, 346, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__36)) __PYX_ERR(0, 346, __pyx_L1_error)
+
 347:         """Remove and return an item from the queue without blocking.
+
 348: 
+
 349:         Only get an item if one is immediately available. Otherwise
+
 350:         raise the :class:`Empty` exception.
+
 351:         """
+
+352:         return self.get(False)
+
  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_5.__pyx_n = 1;
+  __pyx_t_5.block = Py_False;
+  __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_6_queue_Queue *)__pyx_v_self->__pyx_vtab)->get(__pyx_v_self, 0, &__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 352, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
 353: 
+
+354:     def peek(self, block=True, timeout=None):
+
static PyObject *__pyx_pw_6gevent_6_queue_5Queue_39peek(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_f_6gevent_6_queue_5Queue_peek(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_6_queue_5Queue_peek *__pyx_optional_args) {
+  PyObject *__pyx_v_block = ((PyObject *)Py_True);
+  PyObject *__pyx_v_timeout = ((PyObject *)Py_None);
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("peek", 0);
+  if (__pyx_optional_args) {
+    if (__pyx_optional_args->__pyx_n > 0) {
+      __pyx_v_block = __pyx_optional_args->block;
+      if (__pyx_optional_args->__pyx_n > 1) {
+        __pyx_v_timeout = __pyx_optional_args->timeout;
+      }
+    }
+  }
+  /* Check if called by wrapper */
+  if (unlikely(__pyx_skip_dispatch)) ;
+  /* Check if overridden in Python */
+  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
+    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
+    if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
+    else {
+      PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      #endif
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_peek_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 354, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_6_queue_5Queue_39peek)) {
+        __Pyx_XDECREF(__pyx_r);
+        __Pyx_INCREF(__pyx_t_1);
+        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
+        __pyx_t_5 = 0;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+          if (likely(__pyx_t_4)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+            __Pyx_INCREF(__pyx_t_4);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_3, function);
+            __pyx_t_5 = 1;
+          }
+        }
+        #if CYTHON_FAST_PYCALL
+        if (PyFunction_Check(__pyx_t_3)) {
+          PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_block, __pyx_v_timeout};
+          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 354, __pyx_L1_error)
+          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+          __Pyx_GOTREF(__pyx_t_2);
+        } else
+        #endif
+        #if CYTHON_FAST_PYCCALL
+        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
+          PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_block, __pyx_v_timeout};
+          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 354, __pyx_L1_error)
+          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+          __Pyx_GOTREF(__pyx_t_2);
+        } else
+        #endif
+        {
+          __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 354, __pyx_L1_error)
+          __Pyx_GOTREF(__pyx_t_6);
+          if (__pyx_t_4) {
+            __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
+          }
+          __Pyx_INCREF(__pyx_v_block);
+          __Pyx_GIVEREF(__pyx_v_block);
+          PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_block);
+          __Pyx_INCREF(__pyx_v_timeout);
+          __Pyx_GIVEREF(__pyx_v_timeout);
+          PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_timeout);
+          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 354, __pyx_L1_error)
+          __Pyx_GOTREF(__pyx_t_2);
+          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+        }
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __pyx_r = __pyx_t_2;
+        __pyx_t_2 = 0;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        goto __pyx_L0;
+      }
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+      tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
+      if (unlikely(type_dict_guard != tp_dict_version)) {
+        tp_dict_version = obj_dict_version = 0;
+      }
+      #endif
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    }
+    #endif
+  }
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_6);
+  __Pyx_AddTraceback("gevent._queue.Queue.peek", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_queue_5Queue_39peek(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_6gevent_6_queue_5Queue_38peek[] = "Queue.peek(self, block=True, timeout=None)\nReturn an item from the queue without removing it.\n\n        If optional args *block* is true and *timeout* is ``None`` (the default),\n        block if necessary until an item is available. If *timeout* is a positive number,\n        it blocks at most *timeout* seconds and raises the :class:`Empty` exception\n        if no item was available within that time. Otherwise (*block* is false), return\n        an item if one is immediately available, else raise the :class:`Empty` exception\n        (*timeout* is ignored in that case).\n        ";
+static PyMethodDef __pyx_mdef_6gevent_6_queue_5Queue_39peek = {"peek", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_6_queue_5Queue_39peek, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_6_queue_5Queue_38peek};
+static PyObject *__pyx_pw_6gevent_6_queue_5Queue_39peek(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_block = 0;
+  PyObject *__pyx_v_timeout = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("peek (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_block,&__pyx_n_s_timeout,0};
+    PyObject* values[2] = {0,0};
+    values[0] = ((PyObject *)Py_True);
+    values[1] = ((PyObject *)Py_None);
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_block);
+          if (value) { values[0] = value; kw_args--; }
+        }
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_timeout);
+          if (value) { values[1] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "peek") < 0)) __PYX_ERR(0, 354, __pyx_L3_error)
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    __pyx_v_block = values[0];
+    __pyx_v_timeout = values[1];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("peek", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 354, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent._queue.Queue.peek", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_6_queue_5Queue_38peek(((struct __pyx_obj_6gevent_6_queue_Queue *)__pyx_v_self), __pyx_v_block, __pyx_v_timeout);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_queue_5Queue_38peek(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self, PyObject *__pyx_v_block, PyObject *__pyx_v_timeout) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("peek", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_2.__pyx_n = 2;
+  __pyx_t_2.block = __pyx_v_block;
+  __pyx_t_2.timeout = __pyx_v_timeout;
+  __pyx_t_1 = __pyx_vtabptr_6gevent_6_queue_Queue->peek(__pyx_v_self, 1, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 354, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent._queue.Queue.peek", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__37 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_block, __pyx_n_s_timeout); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(0, 354, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__37);
+  __Pyx_GIVEREF(__pyx_tuple__37);
+/* … */
+  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_queue_5Queue_39peek, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Queue_peek, NULL, __pyx_n_s_gevent__queue, __pyx_d, ((PyObject *)__pyx_codeobj__38)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 354, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_Queue->tp_dict, __pyx_n_s_peek_2, __pyx_t_6) < 0) __PYX_ERR(0, 354, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_6_queue_Queue);
+  __pyx_codeobj__38 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__37, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_queue_py, __pyx_n_s_peek_2, 354, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__38)) __PYX_ERR(0, 354, __pyx_L1_error)
+
 355:         """Return an item from the queue without removing it.
+
 356: 
+
 357:         If optional args *block* is true and *timeout* is ``None`` (the default),
+
 358:         block if necessary until an item is available. If *timeout* is a positive number,
+
 359:         it blocks at most *timeout* seconds and raises the :class:`Empty` exception
+
 360:         if no item was available within that time. Otherwise (*block* is false), return
+
 361:         an item if one is immediately available, else raise the :class:`Empty` exception
+
 362:         (*timeout* is ignored in that case).
+
 363:         """
+
+364:         if self.qsize():
+
  __pyx_t_7 = (((struct __pyx_vtabstruct_6gevent_6_queue_Queue *)__pyx_v_self->__pyx_vtab)->qsize(__pyx_v_self, 0) != 0);
+  if (__pyx_t_7) {
+/* … */
+  }
+
 365:             # XXX: Why doesn't this schedule an unlock like get() does?
+
+366:             return self._peek()
+
    __Pyx_XDECREF(__pyx_r);
+    __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_6_queue_Queue *)__pyx_v_self->__pyx_vtab)->_peek(__pyx_v_self, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 366, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __pyx_r = __pyx_t_1;
+    __pyx_t_1 = 0;
+    goto __pyx_L0;
+
 367: 
+
+368:         return self.__get_or_peek(self._peek, block, timeout)
+
  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_peek); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 368, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = ((struct __pyx_vtabstruct_6gevent_6_queue_Queue *)__pyx_v_self->__pyx_vtab)->__pyx___get_or_peek(__pyx_v_self, __pyx_t_1, __pyx_v_block, __pyx_v_timeout); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 368, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_r = __pyx_t_2;
+  __pyx_t_2 = 0;
+  goto __pyx_L0;
+
 369: 
+
+370:     def peek_nowait(self):
+
static PyObject *__pyx_pw_6gevent_6_queue_5Queue_41peek_nowait(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyObject *__pyx_f_6gevent_6_queue_5Queue_peek_nowait(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self, int __pyx_skip_dispatch) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("peek_nowait", 0);
+  /* Check if called by wrapper */
+  if (unlikely(__pyx_skip_dispatch)) ;
+  /* Check if overridden in Python */
+  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
+    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
+    if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
+    else {
+      PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      #endif
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_peek_nowait); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 370, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_6_queue_5Queue_41peek_nowait)) {
+        __Pyx_XDECREF(__pyx_r);
+        __Pyx_INCREF(__pyx_t_1);
+        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+          if (likely(__pyx_t_4)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+            __Pyx_INCREF(__pyx_t_4);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_3, function);
+          }
+        }
+        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
+        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 370, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __pyx_r = __pyx_t_2;
+        __pyx_t_2 = 0;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        goto __pyx_L0;
+      }
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+      tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
+      if (unlikely(type_dict_guard != tp_dict_version)) {
+        tp_dict_version = obj_dict_version = 0;
+      }
+      #endif
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    }
+    #endif
+  }
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_AddTraceback("gevent._queue.Queue.peek_nowait", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_queue_5Queue_41peek_nowait(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6gevent_6_queue_5Queue_40peek_nowait[] = "Queue.peek_nowait(self)\nReturn an item from the queue without blocking.\n\n        Only return an item if one is immediately available. Otherwise\n        raise the :class:`Empty` exception.\n        ";
+static PyMethodDef __pyx_mdef_6gevent_6_queue_5Queue_41peek_nowait = {"peek_nowait", (PyCFunction)__pyx_pw_6gevent_6_queue_5Queue_41peek_nowait, METH_NOARGS, __pyx_doc_6gevent_6_queue_5Queue_40peek_nowait};
+static PyObject *__pyx_pw_6gevent_6_queue_5Queue_41peek_nowait(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("peek_nowait (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_6_queue_5Queue_40peek_nowait(((struct __pyx_obj_6gevent_6_queue_Queue *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_queue_5Queue_40peek_nowait(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("peek_nowait", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __pyx_f_6gevent_6_queue_5Queue_peek_nowait(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 370, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent._queue.Queue.peek_nowait", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__39 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__39)) __PYX_ERR(0, 370, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__39);
+  __Pyx_GIVEREF(__pyx_tuple__39);
+/* … */
+  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_queue_5Queue_41peek_nowait, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Queue_peek_nowait, NULL, __pyx_n_s_gevent__queue, __pyx_d, ((PyObject *)__pyx_codeobj__40)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 370, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_Queue->tp_dict, __pyx_n_s_peek_nowait, __pyx_t_6) < 0) __PYX_ERR(0, 370, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_6_queue_Queue);
+  __pyx_codeobj__40 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__39, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_queue_py, __pyx_n_s_peek_nowait, 370, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__40)) __PYX_ERR(0, 370, __pyx_L1_error)
+
 371:         """Return an item from the queue without blocking.
+
 372: 
+
 373:         Only return an item if one is immediately available. Otherwise
+
 374:         raise the :class:`Empty` exception.
+
 375:         """
+
+376:         return self.peek(False)
+
  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_5.__pyx_n = 1;
+  __pyx_t_5.block = Py_False;
+  __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_6_queue_Queue *)__pyx_v_self->__pyx_vtab)->peek(__pyx_v_self, 0, &__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 376, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
 377: 
+
+378:     def _unlock(self):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_queue_5Queue_43_unlock(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6gevent_6_queue_5Queue_42_unlock[] = "Queue._unlock(self)";
+static PyMethodDef __pyx_mdef_6gevent_6_queue_5Queue_43_unlock = {"_unlock", (PyCFunction)__pyx_pw_6gevent_6_queue_5Queue_43_unlock, METH_NOARGS, __pyx_doc_6gevent_6_queue_5Queue_42_unlock};
+static PyObject *__pyx_pw_6gevent_6_queue_5Queue_43_unlock(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_unlock (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_6_queue_5Queue_42_unlock(((struct __pyx_obj_6gevent_6_queue_Queue *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_queue_5Queue_42_unlock(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self) {
+  int __pyx_v_repeat;
+  PyObject *__pyx_v_putter = NULL;
+  PyObject *__pyx_v_getter = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_unlock", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_6);
+  __Pyx_XDECREF(__pyx_t_7);
+  __Pyx_XDECREF(__pyx_t_8);
+  __Pyx_XDECREF(__pyx_t_9);
+  __Pyx_XDECREF(__pyx_t_10);
+  __Pyx_XDECREF(__pyx_t_11);
+  __Pyx_XDECREF(__pyx_t_12);
+  __Pyx_AddTraceback("gevent._queue.Queue._unlock", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_putter);
+  __Pyx_XDECREF(__pyx_v_getter);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__41 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_repeat, __pyx_n_s_putter, __pyx_n_s_getter); if (unlikely(!__pyx_tuple__41)) __PYX_ERR(0, 378, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__41);
+  __Pyx_GIVEREF(__pyx_tuple__41);
+/* … */
+  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_queue_5Queue_43_unlock, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Queue__unlock, NULL, __pyx_n_s_gevent__queue, __pyx_d, ((PyObject *)__pyx_codeobj__42)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 378, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_Queue->tp_dict, __pyx_n_s_unlock, __pyx_t_6) < 0) __PYX_ERR(0, 378, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_6_queue_Queue);
+  __pyx_codeobj__42 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__41, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_queue_py, __pyx_n_s_unlock, 378, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__42)) __PYX_ERR(0, 378, __pyx_L1_error)
+
+379:         while True:
+
  while (1) {
+
+380:             repeat = False
+
    __pyx_v_repeat = 0;
+
+381:             if self.putters and (self._maxsize == -1 or self.qsize() < self._maxsize):
+
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_self->putters); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 381, __pyx_L1_error)
+    if (__pyx_t_2) {
+    } else {
+      __pyx_t_1 = __pyx_t_2;
+      goto __pyx_L6_bool_binop_done;
+    }
+    __pyx_t_2 = ((__pyx_v_self->_maxsize == -1L) != 0);
+    if (!__pyx_t_2) {
+    } else {
+      __pyx_t_1 = __pyx_t_2;
+      goto __pyx_L6_bool_binop_done;
+    }
+    __pyx_t_2 = ((((struct __pyx_vtabstruct_6gevent_6_queue_Queue *)__pyx_v_self->__pyx_vtab)->qsize(__pyx_v_self, 0) < __pyx_v_self->_maxsize) != 0);
+    __pyx_t_1 = __pyx_t_2;
+    __pyx_L6_bool_binop_done:;
+    if (__pyx_t_1) {
+/* … */
+    }
+
+382:                 repeat = True
+
      __pyx_v_repeat = 1;
+
+383:                 try:
+
      {
+        /*try:*/ {
+/* … */
+        }
+/* … */
+        __Pyx_XGIVEREF(__pyx_t_3);
+        __Pyx_XGIVEREF(__pyx_t_4);
+        __Pyx_XGIVEREF(__pyx_t_5);
+        __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
+        goto __pyx_L1_error;
+        __pyx_L10_exception_handled:;
+        __Pyx_XGIVEREF(__pyx_t_3);
+        __Pyx_XGIVEREF(__pyx_t_4);
+        __Pyx_XGIVEREF(__pyx_t_5);
+        __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
+        __pyx_L16_try_end:;
+      }
+
+384:                     putter = self.putters.popleft()
+
          __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->putters, __pyx_n_s_popleft); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 384, __pyx_L9_error)
+          __Pyx_GOTREF(__pyx_t_7);
+          __pyx_t_8 = NULL;
+          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
+            __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
+            if (likely(__pyx_t_8)) {
+              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
+              __Pyx_INCREF(__pyx_t_8);
+              __Pyx_INCREF(function);
+              __Pyx_DECREF_SET(__pyx_t_7, function);
+            }
+          }
+          __pyx_t_6 = (__pyx_t_8) ? __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_8) : __Pyx_PyObject_CallNoArg(__pyx_t_7);
+          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
+          if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 384, __pyx_L9_error)
+          __Pyx_GOTREF(__pyx_t_6);
+          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+          __Pyx_XDECREF_SET(__pyx_v_putter, __pyx_t_6);
+          __pyx_t_6 = 0;
+
+385:                     self._put(putter.item)
+
          __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_putter, __pyx_n_s_item); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 385, __pyx_L9_error)
+          __Pyx_GOTREF(__pyx_t_6);
+          __pyx_t_7 = ((struct __pyx_vtabstruct_6gevent_6_queue_Queue *)__pyx_v_self->__pyx_vtab)->_put(__pyx_v_self, __pyx_t_6, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 385, __pyx_L9_error)
+          __Pyx_GOTREF(__pyx_t_7);
+          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+
+386:                 except: # pylint:disable=bare-except
+
        /*except:*/ {
+          __Pyx_AddTraceback("gevent._queue.Queue._unlock", __pyx_clineno, __pyx_lineno, __pyx_filename);
+          if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_6, &__pyx_t_8) < 0) __PYX_ERR(0, 386, __pyx_L11_except_error)
+          __Pyx_GOTREF(__pyx_t_7);
+          __Pyx_GOTREF(__pyx_t_6);
+          __Pyx_GOTREF(__pyx_t_8);
+
+387:                     putter.throw(*sys.exc_info())
+
          if (unlikely(!__pyx_v_putter)) { __Pyx_RaiseUnboundLocalError("putter"); __PYX_ERR(0, 387, __pyx_L11_except_error) }
+          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_putter, __pyx_n_s_throw); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 387, __pyx_L11_except_error)
+          __Pyx_GOTREF(__pyx_t_9);
+          __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_sys); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 387, __pyx_L11_except_error)
+          __Pyx_GOTREF(__pyx_t_11);
+          __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_exc_info); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 387, __pyx_L11_except_error)
+          __Pyx_GOTREF(__pyx_t_12);
+          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+          __pyx_t_11 = NULL;
+          if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_12))) {
+            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_12);
+            if (likely(__pyx_t_11)) {
+              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
+              __Pyx_INCREF(__pyx_t_11);
+              __Pyx_INCREF(function);
+              __Pyx_DECREF_SET(__pyx_t_12, function);
+            }
+          }
+          __pyx_t_10 = (__pyx_t_11) ? __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_11) : __Pyx_PyObject_CallNoArg(__pyx_t_12);
+          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
+          if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 387, __pyx_L11_except_error)
+          __Pyx_GOTREF(__pyx_t_10);
+          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
+          __pyx_t_12 = __Pyx_PySequence_Tuple(__pyx_t_10); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 387, __pyx_L11_except_error)
+          __Pyx_GOTREF(__pyx_t_12);
+          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+          __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_12, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 387, __pyx_L11_except_error)
+          __Pyx_GOTREF(__pyx_t_10);
+          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
+          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+          __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
+          goto __pyx_L10_exception_handled;
+        }
+        __pyx_L11_except_error:;
+
 388:                 else:
+
+389:                     putter.switch(putter)
+
        /*else:*/ {
+          __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_putter, __pyx_n_s_switch); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 389, __pyx_L11_except_error)
+          __Pyx_GOTREF(__pyx_t_6);
+          __pyx_t_8 = NULL;
+          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
+            __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_6);
+            if (likely(__pyx_t_8)) {
+              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
+              __Pyx_INCREF(__pyx_t_8);
+              __Pyx_INCREF(function);
+              __Pyx_DECREF_SET(__pyx_t_6, function);
+            }
+          }
+          __pyx_t_7 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_8, __pyx_v_putter) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_putter);
+          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
+          if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 389, __pyx_L11_except_error)
+          __Pyx_GOTREF(__pyx_t_7);
+          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+        }
+        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+        goto __pyx_L16_try_end;
+        __pyx_L9_error:;
+        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
+        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+
+390:             if self.getters and self.qsize():
+
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_self->getters); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 390, __pyx_L1_error)
+    if (__pyx_t_2) {
+    } else {
+      __pyx_t_1 = __pyx_t_2;
+      goto __pyx_L20_bool_binop_done;
+    }
+    __pyx_t_2 = (((struct __pyx_vtabstruct_6gevent_6_queue_Queue *)__pyx_v_self->__pyx_vtab)->qsize(__pyx_v_self, 0) != 0);
+    __pyx_t_1 = __pyx_t_2;
+    __pyx_L20_bool_binop_done:;
+    if (__pyx_t_1) {
+/* … */
+    }
+
+391:                 repeat = True
+
      __pyx_v_repeat = 1;
+
+392:                 getter = self.getters.popleft()
+
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->getters, __pyx_n_s_popleft); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 392, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_6);
+      __pyx_t_7 = NULL;
+      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
+        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
+        if (likely(__pyx_t_7)) {
+          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
+          __Pyx_INCREF(__pyx_t_7);
+          __Pyx_INCREF(function);
+          __Pyx_DECREF_SET(__pyx_t_6, function);
+        }
+      }
+      __pyx_t_8 = (__pyx_t_7) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7) : __Pyx_PyObject_CallNoArg(__pyx_t_6);
+      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+      if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 392, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_8);
+      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+      __Pyx_XDECREF_SET(__pyx_v_getter, __pyx_t_8);
+      __pyx_t_8 = 0;
+
+393:                 getter.switch(getter)
+
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_getter, __pyx_n_s_switch); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 393, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_6);
+      __pyx_t_7 = NULL;
+      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
+        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
+        if (likely(__pyx_t_7)) {
+          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
+          __Pyx_INCREF(__pyx_t_7);
+          __Pyx_INCREF(function);
+          __Pyx_DECREF_SET(__pyx_t_6, function);
+        }
+      }
+      __pyx_t_8 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_v_getter) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_getter);
+      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+      if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 393, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_8);
+      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+
+394:             if not repeat:
+
    __pyx_t_1 = ((!(__pyx_v_repeat != 0)) != 0);
+    if (__pyx_t_1) {
+/* … */
+    }
+  }
+
+395:                 return
+
      __Pyx_XDECREF(__pyx_r);
+      __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+      goto __pyx_L0;
+
 396: 
+
+397:     def _schedule_unlock(self):
+
static PyObject *__pyx_f_6gevent_6_queue_5Queue__schedule_unlock(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_schedule_unlock", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_XDECREF(__pyx_t_6);
+  __Pyx_AddTraceback("gevent._queue.Queue._schedule_unlock", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+398:         if not self._event_unlock:
+
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_self->_event_unlock); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 398, __pyx_L1_error)
+  __pyx_t_2 = ((!__pyx_t_1) != 0);
+  if (__pyx_t_2) {
+/* … */
+  }
+
+399:             self._event_unlock = self.hub.loop.run_callback(self._unlock)
+
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->hub, __pyx_n_s_loop); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 399, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_run_callback); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 399, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_5);
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_unlock); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 399, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    __pyx_t_6 = NULL;
+    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
+      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
+      if (likely(__pyx_t_6)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
+        __Pyx_INCREF(__pyx_t_6);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_5, function);
+      }
+    }
+    __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4);
+    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 399, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __Pyx_GIVEREF(__pyx_t_3);
+    __Pyx_GOTREF(__pyx_v_self->_event_unlock);
+    __Pyx_DECREF(__pyx_v_self->_event_unlock);
+    __pyx_v_self->_event_unlock = __pyx_t_3;
+    __pyx_t_3 = 0;
+
 400: 
+
+401:     def __iter__(self):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_queue_5Queue_45__iter__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_6_queue_5Queue_45__iter__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_6_queue_5Queue_44__iter__(((struct __pyx_obj_6gevent_6_queue_Queue *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_queue_5Queue_44__iter__(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__iter__", 0);
+/* … */
+  /* function exit code */
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+402:         return self
+
  __Pyx_XDECREF(__pyx_r);
+  __Pyx_INCREF(((PyObject *)__pyx_v_self));
+  __pyx_r = ((PyObject *)__pyx_v_self);
+  goto __pyx_L0;
+
 403: 
+
+404:     def __next__(self):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_queue_5Queue_47__next__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_6_queue_5Queue_47__next__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__next__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_6_queue_5Queue_46__next__(((struct __pyx_obj_6gevent_6_queue_Queue *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_queue_5Queue_46__next__(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self) {
+  PyObject *__pyx_v_result = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__next__", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent._queue.Queue.__next__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_result);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+405:         result = self.get()
+
  __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_6_queue_Queue *)__pyx_v_self->__pyx_vtab)->get(__pyx_v_self, 0, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 405, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_v_result = __pyx_t_1;
+  __pyx_t_1 = 0;
+
+406:         if result is StopIteration:
+
  __pyx_t_2 = (__pyx_v_result == __pyx_builtin_StopIteration);
+  __pyx_t_3 = (__pyx_t_2 != 0);
+  if (unlikely(__pyx_t_3)) {
+/* … */
+  }
+
+407:             raise result
+
    __Pyx_Raise(__pyx_v_result, 0, 0, 0);
+    __PYX_ERR(0, 407, __pyx_L1_error)
+
+408:         return result
+
  __Pyx_XDECREF(__pyx_r);
+  __Pyx_INCREF(__pyx_v_result);
+  __pyx_r = __pyx_v_result;
+  goto __pyx_L0;
+
 409: 
+
+410:     next = __next__ # Py2
+
  __Pyx_GetNameInClass(__pyx_t_6, (PyObject *)__pyx_ptype_6gevent_6_queue_Queue, __pyx_n_s_next); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 410, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_Queue->tp_dict, __pyx_n_s_next_2, __pyx_t_6) < 0) __PYX_ERR(0, 410, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_6_queue_Queue);
+
 411: 
+
 412: 
+
+413: class UnboundQueue(Queue):
+
struct __pyx_vtabstruct_6gevent_6_queue_UnboundQueue {
+  struct __pyx_vtabstruct_6gevent_6_queue_Queue __pyx_base;
+};
+static struct __pyx_vtabstruct_6gevent_6_queue_UnboundQueue *__pyx_vtabptr_6gevent_6_queue_UnboundQueue;
+
+
 414:     # A specialization of Queue that knows it can never
+
 415:     # be bound. Changing its maxsize has no effect.
+
 416: 
+
+417:     __slots__ = ()
+
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_UnboundQueue->tp_dict, __pyx_n_s_slots, __pyx_empty_tuple) < 0) __PYX_ERR(0, 417, __pyx_L1_error)
+  PyType_Modified(__pyx_ptype_6gevent_6_queue_UnboundQueue);
+
 418: 
+
+419:     def __init__(self, maxsize=None, items=()):
+
/* Python wrapper */
+static int __pyx_pw_6gevent_6_queue_12UnboundQueue_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static int __pyx_pw_6gevent_6_queue_12UnboundQueue_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_maxsize = 0;
+  PyObject *__pyx_v_items = 0;
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_maxsize,&__pyx_n_s_items,0};
+    PyObject* values[2] = {0,0};
+    values[0] = ((PyObject *)Py_None);
+    values[1] = ((PyObject *)__pyx_empty_tuple);
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_maxsize);
+          if (value) { values[0] = value; kw_args--; }
+        }
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_items);
+          if (value) { values[1] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 419, __pyx_L3_error)
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    __pyx_v_maxsize = values[0];
+    __pyx_v_items = values[1];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 419, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent._queue.UnboundQueue.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return -1;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_6_queue_12UnboundQueue___init__(((struct __pyx_obj_6gevent_6_queue_UnboundQueue *)__pyx_v_self), __pyx_v_maxsize, __pyx_v_items);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_6_queue_12UnboundQueue___init__(struct __pyx_obj_6gevent_6_queue_UnboundQueue *__pyx_v_self, PyObject *__pyx_v_maxsize, PyObject *__pyx_v_items) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = 0;
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_XDECREF(__pyx_t_7);
+  __Pyx_AddTraceback("gevent._queue.UnboundQueue.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = -1;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+420:         if maxsize is not None:
+
  __pyx_t_1 = (__pyx_v_maxsize != Py_None);
+  __pyx_t_2 = (__pyx_t_1 != 0);
+  if (unlikely(__pyx_t_2)) {
+/* … */
+  }
+
+421:             raise ValueError("UnboundQueue has no maxsize")
+
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 421, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __PYX_ERR(0, 421, __pyx_L1_error)
+/* … */
+  __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s_UnboundQueue_has_no_maxsize); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 421, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__4);
+  __Pyx_GIVEREF(__pyx_tuple__4);
+
+422:         Queue.__init__(self, maxsize, items)
+
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_6gevent_6_queue_Queue), __pyx_n_s_init); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 422, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_4);
+  __pyx_t_5 = NULL;
+  __pyx_t_6 = 0;
+  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
+    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
+    if (likely(__pyx_t_5)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
+      __Pyx_INCREF(__pyx_t_5);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_4, function);
+      __pyx_t_6 = 1;
+    }
+  }
+  #if CYTHON_FAST_PYCALL
+  if (PyFunction_Check(__pyx_t_4)) {
+    PyObject *__pyx_temp[4] = {__pyx_t_5, ((PyObject *)__pyx_v_self), __pyx_v_maxsize, __pyx_v_items};
+    __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 422, __pyx_L1_error)
+    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __Pyx_GOTREF(__pyx_t_3);
+  } else
+  #endif
+  #if CYTHON_FAST_PYCCALL
+  if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
+    PyObject *__pyx_temp[4] = {__pyx_t_5, ((PyObject *)__pyx_v_self), __pyx_v_maxsize, __pyx_v_items};
+    __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 422, __pyx_L1_error)
+    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __Pyx_GOTREF(__pyx_t_3);
+  } else
+  #endif
+  {
+    __pyx_t_7 = PyTuple_New(3+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 422, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_7);
+    if (__pyx_t_5) {
+      __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
+    }
+    __Pyx_INCREF(((PyObject *)__pyx_v_self));
+    __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
+    PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, ((PyObject *)__pyx_v_self));
+    __Pyx_INCREF(__pyx_v_maxsize);
+    __Pyx_GIVEREF(__pyx_v_maxsize);
+    PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_maxsize);
+    __Pyx_INCREF(__pyx_v_items);
+    __Pyx_GIVEREF(__pyx_v_items);
+    PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_6, __pyx_v_items);
+    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 422, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  }
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+
+423:         self.putters = None # Will never be used.
+
  __Pyx_INCREF(Py_None);
+  __Pyx_GIVEREF(Py_None);
+  __Pyx_GOTREF(__pyx_v_self->__pyx_base.putters);
+  __Pyx_DECREF(__pyx_v_self->__pyx_base.putters);
+  __pyx_v_self->__pyx_base.putters = Py_None;
+
 424: 
+
+425:     def put(self, item, block=True, timeout=None):
+
static PyObject *__pyx_pw_6gevent_6_queue_12UnboundQueue_3put(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_f_6gevent_6_queue_12UnboundQueue_put(struct __pyx_obj_6gevent_6_queue_UnboundQueue *__pyx_v_self, PyObject *__pyx_v_item, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_6_queue_12UnboundQueue_put *__pyx_optional_args) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("put", 0);
+  if (__pyx_optional_args) {
+  }
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent._queue.UnboundQueue.put", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_queue_12UnboundQueue_3put(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_6gevent_6_queue_12UnboundQueue_2put[] = "UnboundQueue.put(self, item, block=True, timeout=None)";
+static PyMethodDef __pyx_mdef_6gevent_6_queue_12UnboundQueue_3put = {"put", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_6_queue_12UnboundQueue_3put, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_6_queue_12UnboundQueue_2put};
+static PyObject *__pyx_pw_6gevent_6_queue_12UnboundQueue_3put(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_item = 0;
+  PyObject *__pyx_v_block = 0;
+  PyObject *__pyx_v_timeout = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("put (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_item,&__pyx_n_s_block,&__pyx_n_s_timeout,0};
+    PyObject* values[3] = {0,0,0};
+    values[1] = ((PyObject *)Py_True);
+    values[2] = ((PyObject *)Py_None);
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_item)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_block);
+          if (value) { values[1] = value; kw_args--; }
+        }
+        CYTHON_FALLTHROUGH;
+        case  2:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_timeout);
+          if (value) { values[2] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "put") < 0)) __PYX_ERR(0, 425, __pyx_L3_error)
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    __pyx_v_item = values[0];
+    __pyx_v_block = values[1];
+    __pyx_v_timeout = values[2];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("put", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 425, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent._queue.UnboundQueue.put", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_6_queue_12UnboundQueue_2put(((struct __pyx_obj_6gevent_6_queue_UnboundQueue *)__pyx_v_self), __pyx_v_item, __pyx_v_block, __pyx_v_timeout);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_queue_12UnboundQueue_2put(struct __pyx_obj_6gevent_6_queue_UnboundQueue *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_block, PyObject *__pyx_v_timeout) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("put", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_2.__pyx_n = 2;
+  __pyx_t_2.block = __pyx_v_block;
+  __pyx_t_2.timeout = __pyx_v_timeout;
+  __pyx_t_1 = __pyx_vtabptr_6gevent_6_queue_UnboundQueue->__pyx_base.put(((struct __pyx_obj_6gevent_6_queue_Queue *)__pyx_v_self), __pyx_v_item, 1, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 425, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent._queue.UnboundQueue.put", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__43 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_item, __pyx_n_s_block, __pyx_n_s_timeout); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(0, 425, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__43);
+  __Pyx_GIVEREF(__pyx_tuple__43);
+/* … */
+  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_queue_12UnboundQueue_3put, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_UnboundQueue_put, NULL, __pyx_n_s_gevent__queue, __pyx_d, ((PyObject *)__pyx_codeobj__44)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 425, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_UnboundQueue->tp_dict, __pyx_n_s_put_2, __pyx_t_6) < 0) __PYX_ERR(0, 425, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_6_queue_UnboundQueue);
+  __pyx_codeobj__44 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__43, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_queue_py, __pyx_n_s_put_2, 425, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__44)) __PYX_ERR(0, 425, __pyx_L1_error)
+/* … */
+struct __pyx_opt_args_6gevent_6_queue_12UnboundQueue_put {
+  int __pyx_n;
+  PyObject *block;
+  PyObject *timeout;
+};
+
+426:         self._put(item)
+
  __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_6_queue_UnboundQueue *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._put(((struct __pyx_obj_6gevent_6_queue_Queue *)__pyx_v_self), __pyx_v_item, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 426, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+427:         if self.getters:
+
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_self->__pyx_base.getters); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 427, __pyx_L1_error)
+  if (__pyx_t_2) {
+/* … */
+  }
+
+428:             self._schedule_unlock()
+
    __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_6_queue_UnboundQueue *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._schedule_unlock(((struct __pyx_obj_6gevent_6_queue_Queue *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 428, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 429: 
+
 430: 
+
+431: class PriorityQueue(Queue):
+
struct __pyx_vtabstruct_6gevent_6_queue_PriorityQueue {
+  struct __pyx_vtabstruct_6gevent_6_queue_Queue __pyx_base;
+};
+static struct __pyx_vtabstruct_6gevent_6_queue_PriorityQueue *__pyx_vtabptr_6gevent_6_queue_PriorityQueue;
+
+
 432:     '''A subclass of :class:`Queue` that retrieves entries in priority order (lowest first).
+
 433: 
+
 434:     Entries are typically tuples of the form: ``(priority number, data)``.
+
 435: 
+
 436:     .. versionchanged:: 1.2a1
+
 437:        Any *items* given to the constructor will now be passed through
+
 438:        :func:`heapq.heapify` to ensure the invariants of this class hold.
+
 439:        Previously it was just assumed that they were already a heap.
+
 440:     '''
+
 441: 
+
+442:     __slots__ = ()
+
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_PriorityQueue->tp_dict, __pyx_n_s_slots, __pyx_empty_tuple) < 0) __PYX_ERR(0, 442, __pyx_L1_error)
+  PyType_Modified(__pyx_ptype_6gevent_6_queue_PriorityQueue);
+
 443: 
+
+444:     def _create_queue(self, items=()):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_queue_13PriorityQueue_1_create_queue(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_6gevent_6_queue_13PriorityQueue__create_queue[] = "PriorityQueue._create_queue(self, items=())";
+static PyMethodDef __pyx_mdef_6gevent_6_queue_13PriorityQueue_1_create_queue = {"_create_queue", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_6_queue_13PriorityQueue_1_create_queue, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_6_queue_13PriorityQueue__create_queue};
+static PyObject *__pyx_pw_6gevent_6_queue_13PriorityQueue_1_create_queue(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_items = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_create_queue (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_items,0};
+    PyObject* values[1] = {0};
+    values[0] = ((PyObject *)__pyx_empty_tuple);
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_items);
+          if (value) { values[0] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_create_queue") < 0)) __PYX_ERR(0, 444, __pyx_L3_error)
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    __pyx_v_items = values[0];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("_create_queue", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 444, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent._queue.PriorityQueue._create_queue", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_6_queue_13PriorityQueue__create_queue(((struct __pyx_obj_6gevent_6_queue_PriorityQueue *)__pyx_v_self), __pyx_v_items);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_queue_13PriorityQueue__create_queue(CYTHON_UNUSED struct __pyx_obj_6gevent_6_queue_PriorityQueue *__pyx_v_self, PyObject *__pyx_v_items) {
+  PyObject *__pyx_v_q = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_create_queue", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_AddTraceback("gevent._queue.PriorityQueue._create_queue", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_q);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__45 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_items, __pyx_n_s_q); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(0, 444, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__45);
+  __Pyx_GIVEREF(__pyx_tuple__45);
+/* … */
+  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_queue_13PriorityQueue_1_create_queue, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_PriorityQueue__create_queue, NULL, __pyx_n_s_gevent__queue, __pyx_d, ((PyObject *)__pyx_codeobj__46)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 444, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_PriorityQueue->tp_dict, __pyx_n_s_create_queue, __pyx_t_6) < 0) __PYX_ERR(0, 444, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_6_queue_PriorityQueue);
+  __pyx_codeobj__46 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__45, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_queue_py, __pyx_n_s_create_queue, 444, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__46)) __PYX_ERR(0, 444, __pyx_L1_error)
+
+445:         q = list(items)
+
  __pyx_t_1 = PySequence_List(__pyx_v_items); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 445, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_v_q = ((PyObject*)__pyx_t_1);
+  __pyx_t_1 = 0;
+
+446:         _heapify(q)
+
  __Pyx_INCREF(__pyx_v_6gevent_6_queue__heapify);
+  __pyx_t_2 = __pyx_v_6gevent_6_queue__heapify; __pyx_t_3 = NULL;
+  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
+    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+    if (likely(__pyx_t_3)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+      __Pyx_INCREF(__pyx_t_3);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_2, function);
+    }
+  }
+  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_q) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_q);
+  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 446, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+447:         return q
+
  __Pyx_XDECREF(__pyx_r);
+  __Pyx_INCREF(__pyx_v_q);
+  __pyx_r = __pyx_v_q;
+  goto __pyx_L0;
+
 448: 
+
+449:     def _put(self, item):
+
static PyObject *__pyx_pw_6gevent_6_queue_13PriorityQueue_3_put(PyObject *__pyx_v_self, PyObject *__pyx_v_item); /*proto*/
+static PyObject *__pyx_f_6gevent_6_queue_13PriorityQueue__put(struct __pyx_obj_6gevent_6_queue_PriorityQueue *__pyx_v_self, PyObject *__pyx_v_item, int __pyx_skip_dispatch) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_put", 0);
+  /* Check if called by wrapper */
+  if (unlikely(__pyx_skip_dispatch)) ;
+  /* Check if overridden in Python */
+  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
+    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
+    if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
+    else {
+      PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      #endif
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_put); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 449, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_6_queue_13PriorityQueue_3_put)) {
+        __Pyx_XDECREF(__pyx_r);
+        __Pyx_INCREF(__pyx_t_1);
+        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+          if (likely(__pyx_t_4)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+            __Pyx_INCREF(__pyx_t_4);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_3, function);
+          }
+        }
+        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_item) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_item);
+        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 449, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __pyx_r = __pyx_t_2;
+        __pyx_t_2 = 0;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        goto __pyx_L0;
+      }
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+      tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
+      if (unlikely(type_dict_guard != tp_dict_version)) {
+        tp_dict_version = obj_dict_version = 0;
+      }
+      #endif
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    }
+    #endif
+  }
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_AddTraceback("gevent._queue.PriorityQueue._put", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_queue_13PriorityQueue_3_put(PyObject *__pyx_v_self, PyObject *__pyx_v_item); /*proto*/
+static char __pyx_doc_6gevent_6_queue_13PriorityQueue_2_put[] = "PriorityQueue._put(self, item)";
+static PyMethodDef __pyx_mdef_6gevent_6_queue_13PriorityQueue_3_put = {"_put", (PyCFunction)__pyx_pw_6gevent_6_queue_13PriorityQueue_3_put, METH_O, __pyx_doc_6gevent_6_queue_13PriorityQueue_2_put};
+static PyObject *__pyx_pw_6gevent_6_queue_13PriorityQueue_3_put(PyObject *__pyx_v_self, PyObject *__pyx_v_item) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_put (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_6_queue_13PriorityQueue_2_put(((struct __pyx_obj_6gevent_6_queue_PriorityQueue *)__pyx_v_self), ((PyObject *)__pyx_v_item));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_queue_13PriorityQueue_2_put(struct __pyx_obj_6gevent_6_queue_PriorityQueue *__pyx_v_self, PyObject *__pyx_v_item) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_put", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __pyx_f_6gevent_6_queue_13PriorityQueue__put(__pyx_v_self, __pyx_v_item, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 449, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent._queue.PriorityQueue._put", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__47 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_item); if (unlikely(!__pyx_tuple__47)) __PYX_ERR(0, 449, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__47);
+  __Pyx_GIVEREF(__pyx_tuple__47);
+/* … */
+  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_queue_13PriorityQueue_3_put, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_PriorityQueue__put, NULL, __pyx_n_s_gevent__queue, __pyx_d, ((PyObject *)__pyx_codeobj__48)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 449, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_PriorityQueue->tp_dict, __pyx_n_s_put, __pyx_t_6) < 0) __PYX_ERR(0, 449, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_6_queue_PriorityQueue);
+  __pyx_codeobj__48 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__47, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_queue_py, __pyx_n_s_put, 449, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__48)) __PYX_ERR(0, 449, __pyx_L1_error)
+
+450:         _heappush(self.queue, item)
+
  __Pyx_INCREF(__pyx_v_6gevent_6_queue__heappush);
+  __pyx_t_2 = __pyx_v_6gevent_6_queue__heappush; __pyx_t_3 = NULL;
+  __pyx_t_5 = 0;
+  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
+    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+    if (likely(__pyx_t_3)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+      __Pyx_INCREF(__pyx_t_3);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_2, function);
+      __pyx_t_5 = 1;
+    }
+  }
+  #if CYTHON_FAST_PYCALL
+  if (PyFunction_Check(__pyx_t_2)) {
+    PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_self->__pyx_base.queue, __pyx_v_item};
+    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 450, __pyx_L1_error)
+    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __Pyx_GOTREF(__pyx_t_1);
+  } else
+  #endif
+  #if CYTHON_FAST_PYCCALL
+  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
+    PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_self->__pyx_base.queue, __pyx_v_item};
+    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 450, __pyx_L1_error)
+    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __Pyx_GOTREF(__pyx_t_1);
+  } else
+  #endif
+  {
+    __pyx_t_4 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 450, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    if (__pyx_t_3) {
+      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = NULL;
+    }
+    __Pyx_INCREF(__pyx_v_self->__pyx_base.queue);
+    __Pyx_GIVEREF(__pyx_v_self->__pyx_base.queue);
+    PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_5, __pyx_v_self->__pyx_base.queue);
+    __Pyx_INCREF(__pyx_v_item);
+    __Pyx_GIVEREF(__pyx_v_item);
+    PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_5, __pyx_v_item);
+    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 450, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  }
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 451: 
+
+452:     def _get(self):
+
static PyObject *__pyx_pw_6gevent_6_queue_13PriorityQueue_5_get(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyObject *__pyx_f_6gevent_6_queue_13PriorityQueue__get(struct __pyx_obj_6gevent_6_queue_PriorityQueue *__pyx_v_self, int __pyx_skip_dispatch) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_get", 0);
+  /* Check if called by wrapper */
+  if (unlikely(__pyx_skip_dispatch)) ;
+  /* Check if overridden in Python */
+  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
+    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
+    if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
+    else {
+      PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      #endif
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 452, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_6_queue_13PriorityQueue_5_get)) {
+        __Pyx_XDECREF(__pyx_r);
+        __Pyx_INCREF(__pyx_t_1);
+        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+          if (likely(__pyx_t_4)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+            __Pyx_INCREF(__pyx_t_4);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_3, function);
+          }
+        }
+        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
+        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 452, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __pyx_r = __pyx_t_2;
+        __pyx_t_2 = 0;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        goto __pyx_L0;
+      }
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+      tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
+      if (unlikely(type_dict_guard != tp_dict_version)) {
+        tp_dict_version = obj_dict_version = 0;
+      }
+      #endif
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    }
+    #endif
+  }
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_AddTraceback("gevent._queue.PriorityQueue._get", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_queue_13PriorityQueue_5_get(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6gevent_6_queue_13PriorityQueue_4_get[] = "PriorityQueue._get(self)";
+static PyMethodDef __pyx_mdef_6gevent_6_queue_13PriorityQueue_5_get = {"_get", (PyCFunction)__pyx_pw_6gevent_6_queue_13PriorityQueue_5_get, METH_NOARGS, __pyx_doc_6gevent_6_queue_13PriorityQueue_4_get};
+static PyObject *__pyx_pw_6gevent_6_queue_13PriorityQueue_5_get(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_get (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_6_queue_13PriorityQueue_4_get(((struct __pyx_obj_6gevent_6_queue_PriorityQueue *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_queue_13PriorityQueue_4_get(struct __pyx_obj_6gevent_6_queue_PriorityQueue *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_get", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __pyx_f_6gevent_6_queue_13PriorityQueue__get(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 452, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent._queue.PriorityQueue._get", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__49 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__49)) __PYX_ERR(0, 452, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__49);
+  __Pyx_GIVEREF(__pyx_tuple__49);
+/* … */
+  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_queue_13PriorityQueue_5_get, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_PriorityQueue__get, NULL, __pyx_n_s_gevent__queue, __pyx_d, ((PyObject *)__pyx_codeobj__50)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 452, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_PriorityQueue->tp_dict, __pyx_n_s_get, __pyx_t_6) < 0) __PYX_ERR(0, 452, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_6_queue_PriorityQueue);
+  __pyx_codeobj__50 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__49, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_queue_py, __pyx_n_s_get, 452, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__50)) __PYX_ERR(0, 452, __pyx_L1_error)
+
+453:         return _heappop(self.queue)
+
  __Pyx_XDECREF(__pyx_r);
+  __Pyx_INCREF(__pyx_v_6gevent_6_queue__heappop);
+  __pyx_t_2 = __pyx_v_6gevent_6_queue__heappop; __pyx_t_3 = NULL;
+  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
+    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+    if (likely(__pyx_t_3)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+      __Pyx_INCREF(__pyx_t_3);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_2, function);
+    }
+  }
+  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_self->__pyx_base.queue) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_self->__pyx_base.queue);
+  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 453, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
 454: 
+
 455: 
+
+456: class LifoQueue(Queue):
+
struct __pyx_vtabstruct_6gevent_6_queue_LifoQueue {
+  struct __pyx_vtabstruct_6gevent_6_queue_Queue __pyx_base;
+};
+static struct __pyx_vtabstruct_6gevent_6_queue_LifoQueue *__pyx_vtabptr_6gevent_6_queue_LifoQueue;
+
+
 457:     '''A subclass of :class:`Queue` that retrieves most recently added entries first.'''
+
 458: 
+
+459:     __slots__ = ()
+
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_LifoQueue->tp_dict, __pyx_n_s_slots, __pyx_empty_tuple) < 0) __PYX_ERR(0, 459, __pyx_L1_error)
+  PyType_Modified(__pyx_ptype_6gevent_6_queue_LifoQueue);
+
 460: 
+
+461:     def _create_queue(self, items=()):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_queue_9LifoQueue_1_create_queue(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_6gevent_6_queue_9LifoQueue__create_queue[] = "LifoQueue._create_queue(self, items=())";
+static PyMethodDef __pyx_mdef_6gevent_6_queue_9LifoQueue_1_create_queue = {"_create_queue", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_6_queue_9LifoQueue_1_create_queue, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_6_queue_9LifoQueue__create_queue};
+static PyObject *__pyx_pw_6gevent_6_queue_9LifoQueue_1_create_queue(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_items = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_create_queue (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_items,0};
+    PyObject* values[1] = {0};
+    values[0] = ((PyObject *)__pyx_empty_tuple);
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_items);
+          if (value) { values[0] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_create_queue") < 0)) __PYX_ERR(0, 461, __pyx_L3_error)
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    __pyx_v_items = values[0];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("_create_queue", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 461, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent._queue.LifoQueue._create_queue", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_6_queue_9LifoQueue__create_queue(((struct __pyx_obj_6gevent_6_queue_LifoQueue *)__pyx_v_self), __pyx_v_items);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_queue_9LifoQueue__create_queue(CYTHON_UNUSED struct __pyx_obj_6gevent_6_queue_LifoQueue *__pyx_v_self, PyObject *__pyx_v_items) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_create_queue", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent._queue.LifoQueue._create_queue", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__51 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_items); if (unlikely(!__pyx_tuple__51)) __PYX_ERR(0, 461, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__51);
+  __Pyx_GIVEREF(__pyx_tuple__51);
+/* … */
+  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_queue_9LifoQueue_1_create_queue, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_LifoQueue__create_queue, NULL, __pyx_n_s_gevent__queue, __pyx_d, ((PyObject *)__pyx_codeobj__52)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 461, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_LifoQueue->tp_dict, __pyx_n_s_create_queue, __pyx_t_6) < 0) __PYX_ERR(0, 461, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_6_queue_LifoQueue);
+  __pyx_codeobj__52 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__51, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_queue_py, __pyx_n_s_create_queue, 461, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__52)) __PYX_ERR(0, 461, __pyx_L1_error)
+
+462:         return list(items)
+
  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = PySequence_List(__pyx_v_items); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
 463: 
+
+464:     def _put(self, item):
+
static PyObject *__pyx_pw_6gevent_6_queue_9LifoQueue_3_put(PyObject *__pyx_v_self, PyObject *__pyx_v_item); /*proto*/
+static PyObject *__pyx_f_6gevent_6_queue_9LifoQueue__put(struct __pyx_obj_6gevent_6_queue_LifoQueue *__pyx_v_self, PyObject *__pyx_v_item, int __pyx_skip_dispatch) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_put", 0);
+  /* Check if called by wrapper */
+  if (unlikely(__pyx_skip_dispatch)) ;
+  /* Check if overridden in Python */
+  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
+    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
+    if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
+    else {
+      PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      #endif
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_put); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_6_queue_9LifoQueue_3_put)) {
+        __Pyx_XDECREF(__pyx_r);
+        __Pyx_INCREF(__pyx_t_1);
+        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+          if (likely(__pyx_t_4)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+            __Pyx_INCREF(__pyx_t_4);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_3, function);
+          }
+        }
+        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_item) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_item);
+        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 464, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __pyx_r = __pyx_t_2;
+        __pyx_t_2 = 0;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        goto __pyx_L0;
+      }
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+      tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
+      if (unlikely(type_dict_guard != tp_dict_version)) {
+        tp_dict_version = obj_dict_version = 0;
+      }
+      #endif
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    }
+    #endif
+  }
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_AddTraceback("gevent._queue.LifoQueue._put", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_queue_9LifoQueue_3_put(PyObject *__pyx_v_self, PyObject *__pyx_v_item); /*proto*/
+static char __pyx_doc_6gevent_6_queue_9LifoQueue_2_put[] = "LifoQueue._put(self, item)";
+static PyMethodDef __pyx_mdef_6gevent_6_queue_9LifoQueue_3_put = {"_put", (PyCFunction)__pyx_pw_6gevent_6_queue_9LifoQueue_3_put, METH_O, __pyx_doc_6gevent_6_queue_9LifoQueue_2_put};
+static PyObject *__pyx_pw_6gevent_6_queue_9LifoQueue_3_put(PyObject *__pyx_v_self, PyObject *__pyx_v_item) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_put (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_6_queue_9LifoQueue_2_put(((struct __pyx_obj_6gevent_6_queue_LifoQueue *)__pyx_v_self), ((PyObject *)__pyx_v_item));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_queue_9LifoQueue_2_put(struct __pyx_obj_6gevent_6_queue_LifoQueue *__pyx_v_self, PyObject *__pyx_v_item) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_put", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __pyx_f_6gevent_6_queue_9LifoQueue__put(__pyx_v_self, __pyx_v_item, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent._queue.LifoQueue._put", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__53 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_item); if (unlikely(!__pyx_tuple__53)) __PYX_ERR(0, 464, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__53);
+  __Pyx_GIVEREF(__pyx_tuple__53);
+/* … */
+  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_queue_9LifoQueue_3_put, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_LifoQueue__put, NULL, __pyx_n_s_gevent__queue, __pyx_d, ((PyObject *)__pyx_codeobj__54)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 464, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_LifoQueue->tp_dict, __pyx_n_s_put, __pyx_t_6) < 0) __PYX_ERR(0, 464, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_6_queue_LifoQueue);
+  __pyx_codeobj__54 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__53, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_queue_py, __pyx_n_s_put, 464, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__54)) __PYX_ERR(0, 464, __pyx_L1_error)
+
+465:         self.queue.append(item)
+
  __pyx_t_5 = __Pyx_PyObject_Append(__pyx_v_self->__pyx_base.queue, __pyx_v_item); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 465, __pyx_L1_error)
+
 466: 
+
+467:     def _get(self):
+
static PyObject *__pyx_pw_6gevent_6_queue_9LifoQueue_5_get(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyObject *__pyx_f_6gevent_6_queue_9LifoQueue__get(struct __pyx_obj_6gevent_6_queue_LifoQueue *__pyx_v_self, int __pyx_skip_dispatch) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_get", 0);
+  /* Check if called by wrapper */
+  if (unlikely(__pyx_skip_dispatch)) ;
+  /* Check if overridden in Python */
+  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
+    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
+    if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
+    else {
+      PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      #endif
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 467, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_6_queue_9LifoQueue_5_get)) {
+        __Pyx_XDECREF(__pyx_r);
+        __Pyx_INCREF(__pyx_t_1);
+        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+          if (likely(__pyx_t_4)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+            __Pyx_INCREF(__pyx_t_4);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_3, function);
+          }
+        }
+        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
+        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 467, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __pyx_r = __pyx_t_2;
+        __pyx_t_2 = 0;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        goto __pyx_L0;
+      }
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+      tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
+      if (unlikely(type_dict_guard != tp_dict_version)) {
+        tp_dict_version = obj_dict_version = 0;
+      }
+      #endif
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    }
+    #endif
+  }
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_AddTraceback("gevent._queue.LifoQueue._get", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_queue_9LifoQueue_5_get(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6gevent_6_queue_9LifoQueue_4_get[] = "LifoQueue._get(self)";
+static PyMethodDef __pyx_mdef_6gevent_6_queue_9LifoQueue_5_get = {"_get", (PyCFunction)__pyx_pw_6gevent_6_queue_9LifoQueue_5_get, METH_NOARGS, __pyx_doc_6gevent_6_queue_9LifoQueue_4_get};
+static PyObject *__pyx_pw_6gevent_6_queue_9LifoQueue_5_get(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_get (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_6_queue_9LifoQueue_4_get(((struct __pyx_obj_6gevent_6_queue_LifoQueue *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_queue_9LifoQueue_4_get(struct __pyx_obj_6gevent_6_queue_LifoQueue *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_get", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __pyx_f_6gevent_6_queue_9LifoQueue__get(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 467, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent._queue.LifoQueue._get", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__55 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__55)) __PYX_ERR(0, 467, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__55);
+  __Pyx_GIVEREF(__pyx_tuple__55);
+/* … */
+  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_queue_9LifoQueue_5_get, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_LifoQueue__get, NULL, __pyx_n_s_gevent__queue, __pyx_d, ((PyObject *)__pyx_codeobj__56)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 467, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_LifoQueue->tp_dict, __pyx_n_s_get, __pyx_t_6) < 0) __PYX_ERR(0, 467, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_6_queue_LifoQueue);
+  __pyx_codeobj__56 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__55, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_queue_py, __pyx_n_s_get, 467, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__56)) __PYX_ERR(0, 467, __pyx_L1_error)
+
+468:         return self.queue.pop()
+
  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __Pyx_PyObject_Pop(__pyx_v_self->__pyx_base.queue); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 468, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
 469: 
+
+470:     def _peek(self):
+
static PyObject *__pyx_pw_6gevent_6_queue_9LifoQueue_7_peek(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyObject *__pyx_f_6gevent_6_queue_9LifoQueue__peek(struct __pyx_obj_6gevent_6_queue_LifoQueue *__pyx_v_self, int __pyx_skip_dispatch) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_peek", 0);
+  /* Check if called by wrapper */
+  if (unlikely(__pyx_skip_dispatch)) ;
+  /* Check if overridden in Python */
+  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
+    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
+    if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
+    else {
+      PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      #endif
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_peek); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 470, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_6_queue_9LifoQueue_7_peek)) {
+        __Pyx_XDECREF(__pyx_r);
+        __Pyx_INCREF(__pyx_t_1);
+        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+          if (likely(__pyx_t_4)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+            __Pyx_INCREF(__pyx_t_4);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_3, function);
+          }
+        }
+        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
+        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 470, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __pyx_r = __pyx_t_2;
+        __pyx_t_2 = 0;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        goto __pyx_L0;
+      }
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+      tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
+      if (unlikely(type_dict_guard != tp_dict_version)) {
+        tp_dict_version = obj_dict_version = 0;
+      }
+      #endif
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    }
+    #endif
+  }
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_AddTraceback("gevent._queue.LifoQueue._peek", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_queue_9LifoQueue_7_peek(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6gevent_6_queue_9LifoQueue_6_peek[] = "LifoQueue._peek(self)";
+static PyMethodDef __pyx_mdef_6gevent_6_queue_9LifoQueue_7_peek = {"_peek", (PyCFunction)__pyx_pw_6gevent_6_queue_9LifoQueue_7_peek, METH_NOARGS, __pyx_doc_6gevent_6_queue_9LifoQueue_6_peek};
+static PyObject *__pyx_pw_6gevent_6_queue_9LifoQueue_7_peek(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_peek (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_6_queue_9LifoQueue_6_peek(((struct __pyx_obj_6gevent_6_queue_LifoQueue *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_queue_9LifoQueue_6_peek(struct __pyx_obj_6gevent_6_queue_LifoQueue *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_peek", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __pyx_f_6gevent_6_queue_9LifoQueue__peek(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 470, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent._queue.LifoQueue._peek", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__57 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__57)) __PYX_ERR(0, 470, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__57);
+  __Pyx_GIVEREF(__pyx_tuple__57);
+/* … */
+  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_queue_9LifoQueue_7_peek, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_LifoQueue__peek, NULL, __pyx_n_s_gevent__queue, __pyx_d, ((PyObject *)__pyx_codeobj__58)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 470, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_LifoQueue->tp_dict, __pyx_n_s_peek, __pyx_t_6) < 0) __PYX_ERR(0, 470, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_6_queue_LifoQueue);
+  __pyx_codeobj__58 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__57, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_queue_py, __pyx_n_s_peek, 470, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__58)) __PYX_ERR(0, 470, __pyx_L1_error)
+
+471:         return self.queue[-1]
+
  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_self->__pyx_base.queue, -1L, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 471, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
 472: 
+
 473: 
+
+474: class JoinableQueue(Queue):
+
struct __pyx_vtabstruct_6gevent_6_queue_JoinableQueue {
+  struct __pyx_vtabstruct_6gevent_6_queue_Queue __pyx_base;
+};
+static struct __pyx_vtabstruct_6gevent_6_queue_JoinableQueue *__pyx_vtabptr_6gevent_6_queue_JoinableQueue;
+
+
 475:     """
+
 476:     A subclass of :class:`Queue` that additionally has
+
 477:     :meth:`task_done` and :meth:`join` methods.
+
 478:     """
+
 479: 
+
 480:     __slots__ = (
+
+481:         '_cond',
+
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_JoinableQueue->tp_dict, __pyx_n_s_slots, __pyx_tuple__59) < 0) __PYX_ERR(0, 480, __pyx_L1_error)
+  PyType_Modified(__pyx_ptype_6gevent_6_queue_JoinableQueue);
+/* … */
+  __pyx_tuple__59 = PyTuple_Pack(2, __pyx_n_s_cond, __pyx_n_s_unfinished_tasks); if (unlikely(!__pyx_tuple__59)) __PYX_ERR(0, 481, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__59);
+  __Pyx_GIVEREF(__pyx_tuple__59);
+
 482:         'unfinished_tasks',
+
 483:     )
+
 484: 
+
+485:     def __init__(self, maxsize=None, items=(), unfinished_tasks=None):
+
/* Python wrapper */
+static int __pyx_pw_6gevent_6_queue_13JoinableQueue_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_6gevent_6_queue_13JoinableQueue___init__[] = "\n\n        .. versionchanged:: 1.1a1\n           If *unfinished_tasks* is not given, then all the given *items*\n           (if any) will be considered unfinished.\n\n        ";
+#if CYTHON_COMPILING_IN_CPYTHON
+struct wrapperbase __pyx_wrapperbase_6gevent_6_queue_13JoinableQueue___init__;
+#endif
+static int __pyx_pw_6gevent_6_queue_13JoinableQueue_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_maxsize = 0;
+  PyObject *__pyx_v_items = 0;
+  PyObject *__pyx_v_unfinished_tasks = 0;
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_maxsize,&__pyx_n_s_items,&__pyx_n_s_unfinished_tasks,0};
+    PyObject* values[3] = {0,0,0};
+    values[0] = ((PyObject *)Py_None);
+    values[1] = ((PyObject *)__pyx_empty_tuple);
+    values[2] = ((PyObject *)Py_None);
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_maxsize);
+          if (value) { values[0] = value; kw_args--; }
+        }
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_items);
+          if (value) { values[1] = value; kw_args--; }
+        }
+        CYTHON_FALLTHROUGH;
+        case  2:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_unfinished_tasks);
+          if (value) { values[2] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 485, __pyx_L3_error)
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    __pyx_v_maxsize = values[0];
+    __pyx_v_items = values[1];
+    __pyx_v_unfinished_tasks = values[2];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 485, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent._queue.JoinableQueue.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return -1;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_6_queue_13JoinableQueue___init__(((struct __pyx_obj_6gevent_6_queue_JoinableQueue *)__pyx_v_self), __pyx_v_maxsize, __pyx_v_items, __pyx_v_unfinished_tasks);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_6_queue_13JoinableQueue___init__(struct __pyx_obj_6gevent_6_queue_JoinableQueue *__pyx_v_self, PyObject *__pyx_v_maxsize, PyObject *__pyx_v_items, PyObject *__pyx_v_unfinished_tasks) {
+  PyObject *__pyx_v_Event = NULL;
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = 0;
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_AddTraceback("gevent._queue.JoinableQueue.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = -1;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_Event);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
 486:         """
+
 487: 
+
 488:         .. versionchanged:: 1.1a1
+
 489:            If *unfinished_tasks* is not given, then all the given *items*
+
 490:            (if any) will be considered unfinished.
+
 491: 
+
 492:         """
+
+493:         Queue.__init__(self, maxsize, items, _warn_depth=3)
+
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_6gevent_6_queue_Queue), __pyx_n_s_init); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 493, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 493, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(((PyObject *)__pyx_v_self));
+  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
+  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self));
+  __Pyx_INCREF(__pyx_v_maxsize);
+  __Pyx_GIVEREF(__pyx_v_maxsize);
+  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_maxsize);
+  __Pyx_INCREF(__pyx_v_items);
+  __Pyx_GIVEREF(__pyx_v_items);
+  PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_items);
+  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 493, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_warn_depth, __pyx_int_3) < 0) __PYX_ERR(0, 493, __pyx_L1_error)
+  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 493, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_4);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+
 494: 
+
+495:         from gevent.event import Event
+
  __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 495, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_4);
+  __Pyx_INCREF(__pyx_n_s_Event);
+  __Pyx_GIVEREF(__pyx_n_s_Event);
+  PyList_SET_ITEM(__pyx_t_4, 0, __pyx_n_s_Event);
+  __pyx_t_3 = __Pyx_Import(__pyx_n_s_gevent_event, __pyx_t_4, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 495, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_Event); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 495, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_4);
+  __Pyx_INCREF(__pyx_t_4);
+  __pyx_v_Event = __pyx_t_4;
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+
+496:         self._cond = Event()
+
  __Pyx_INCREF(__pyx_v_Event);
+  __pyx_t_4 = __pyx_v_Event; __pyx_t_2 = NULL;
+  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
+    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
+    if (likely(__pyx_t_2)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
+      __Pyx_INCREF(__pyx_t_2);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_4, function);
+    }
+  }
+  __pyx_t_3 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 496, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_6gevent_6_event_Event))))) __PYX_ERR(0, 496, __pyx_L1_error)
+  __Pyx_GIVEREF(__pyx_t_3);
+  __Pyx_GOTREF(__pyx_v_self->_cond);
+  __Pyx_DECREF(((PyObject *)__pyx_v_self->_cond));
+  __pyx_v_self->_cond = ((struct __pyx_obj_6gevent_6_event_Event *)__pyx_t_3);
+  __pyx_t_3 = 0;
+
+497:         self._cond.set()
+
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->_cond), __pyx_n_s_set); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 497, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_4);
+  __pyx_t_2 = NULL;
+  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
+    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
+    if (likely(__pyx_t_2)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
+      __Pyx_INCREF(__pyx_t_2);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_4, function);
+    }
+  }
+  __pyx_t_3 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 497, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+
 498: 
+
+499:         if unfinished_tasks:
+
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_unfinished_tasks); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 499, __pyx_L1_error)
+  if (__pyx_t_5) {
+/* … */
+    goto __pyx_L3;
+  }
+
+500:             self.unfinished_tasks = unfinished_tasks
+
    __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_v_unfinished_tasks); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 500, __pyx_L1_error)
+    __pyx_v_self->unfinished_tasks = __pyx_t_6;
+
+501:         elif items:
+
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_items); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 501, __pyx_L1_error)
+  if (__pyx_t_5) {
+/* … */
+    goto __pyx_L3;
+  }
+
+502:             self.unfinished_tasks = len(items)
+
    __pyx_t_7 = PyObject_Length(__pyx_v_items); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 502, __pyx_L1_error)
+    __pyx_v_self->unfinished_tasks = __pyx_t_7;
+
 503:         else:
+
+504:             self.unfinished_tasks = 0
+
  /*else*/ {
+    __pyx_v_self->unfinished_tasks = 0;
+  }
+  __pyx_L3:;
+
 505: 
+
+506:         if self.unfinished_tasks:
+
  __pyx_t_5 = (__pyx_v_self->unfinished_tasks != 0);
+  if (__pyx_t_5) {
+/* … */
+  }
+
+507:             self._cond.clear()
+
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->_cond), __pyx_n_s_clear); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 507, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    __pyx_t_2 = NULL;
+    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
+      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
+      if (likely(__pyx_t_2)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
+        __Pyx_INCREF(__pyx_t_2);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_4, function);
+      }
+    }
+    __pyx_t_3 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
+    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 507, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+
 508: 
+
+509:     def copy(self):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_queue_13JoinableQueue_3copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6gevent_6_queue_13JoinableQueue_2copy[] = "JoinableQueue.copy(self)";
+static PyMethodDef __pyx_mdef_6gevent_6_queue_13JoinableQueue_3copy = {"copy", (PyCFunction)__pyx_pw_6gevent_6_queue_13JoinableQueue_3copy, METH_NOARGS, __pyx_doc_6gevent_6_queue_13JoinableQueue_2copy};
+static PyObject *__pyx_pw_6gevent_6_queue_13JoinableQueue_3copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("copy (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_6_queue_13JoinableQueue_2copy(((struct __pyx_obj_6gevent_6_queue_JoinableQueue *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_queue_13JoinableQueue_2copy(struct __pyx_obj_6gevent_6_queue_JoinableQueue *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("copy", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_XDECREF(__pyx_t_7);
+  __Pyx_AddTraceback("gevent._queue.JoinableQueue.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__60 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__60)) __PYX_ERR(0, 509, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__60);
+  __Pyx_GIVEREF(__pyx_tuple__60);
+/* … */
+  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_queue_13JoinableQueue_3copy, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_JoinableQueue_copy, NULL, __pyx_n_s_gevent__queue, __pyx_d, ((PyObject *)__pyx_codeobj__61)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 509, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_JoinableQueue->tp_dict, __pyx_n_s_copy, __pyx_t_6) < 0) __PYX_ERR(0, 509, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_6_queue_JoinableQueue);
+  __pyx_codeobj__61 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__60, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_queue_py, __pyx_n_s_copy, 509, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__61)) __PYX_ERR(0, 509, __pyx_L1_error)
+
+510:         return type(self)(self.maxsize, self.queue, self.unfinished_tasks)
+
  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_maxsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 510, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->unfinished_tasks); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 510, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
+  __pyx_t_4 = ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))); __pyx_t_5 = NULL;
+  __pyx_t_6 = 0;
+  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
+    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
+    if (likely(__pyx_t_5)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
+      __Pyx_INCREF(__pyx_t_5);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_4, function);
+      __pyx_t_6 = 1;
+    }
+  }
+  #if CYTHON_FAST_PYCALL
+  if (PyFunction_Check(__pyx_t_4)) {
+    PyObject *__pyx_temp[4] = {__pyx_t_5, __pyx_t_2, __pyx_v_self->__pyx_base.queue, __pyx_t_3};
+    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 510, __pyx_L1_error)
+    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  } else
+  #endif
+  #if CYTHON_FAST_PYCCALL
+  if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
+    PyObject *__pyx_temp[4] = {__pyx_t_5, __pyx_t_2, __pyx_v_self->__pyx_base.queue, __pyx_t_3};
+    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 510, __pyx_L1_error)
+    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  } else
+  #endif
+  {
+    __pyx_t_7 = PyTuple_New(3+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 510, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_7);
+    if (__pyx_t_5) {
+      __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
+    }
+    __Pyx_GIVEREF(__pyx_t_2);
+    PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_t_2);
+    __Pyx_INCREF(__pyx_v_self->__pyx_base.queue);
+    __Pyx_GIVEREF(__pyx_v_self->__pyx_base.queue);
+    PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_self->__pyx_base.queue);
+    __Pyx_GIVEREF(__pyx_t_3);
+    PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_6, __pyx_t_3);
+    __pyx_t_2 = 0;
+    __pyx_t_3 = 0;
+    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 510, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  }
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
 511: 
+
+512:     def _format(self):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_queue_13JoinableQueue_5_format(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6gevent_6_queue_13JoinableQueue_4_format[] = "JoinableQueue._format(self)";
+static PyMethodDef __pyx_mdef_6gevent_6_queue_13JoinableQueue_5_format = {"_format", (PyCFunction)__pyx_pw_6gevent_6_queue_13JoinableQueue_5_format, METH_NOARGS, __pyx_doc_6gevent_6_queue_13JoinableQueue_4_format};
+static PyObject *__pyx_pw_6gevent_6_queue_13JoinableQueue_5_format(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_format (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_6_queue_13JoinableQueue_4_format(((struct __pyx_obj_6gevent_6_queue_JoinableQueue *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_queue_13JoinableQueue_4_format(struct __pyx_obj_6gevent_6_queue_JoinableQueue *__pyx_v_self) {
+  PyObject *__pyx_v_result = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_format", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_AddTraceback("gevent._queue.JoinableQueue._format", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_result);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__62 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_result); if (unlikely(!__pyx_tuple__62)) __PYX_ERR(0, 512, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__62);
+  __Pyx_GIVEREF(__pyx_tuple__62);
+/* … */
+  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_queue_13JoinableQueue_5_format, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_JoinableQueue__format, NULL, __pyx_n_s_gevent__queue, __pyx_d, ((PyObject *)__pyx_codeobj__63)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 512, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_JoinableQueue->tp_dict, __pyx_n_s_format, __pyx_t_6) < 0) __PYX_ERR(0, 512, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_6_queue_JoinableQueue);
+  __pyx_codeobj__63 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__62, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_queue_py, __pyx_n_s_format, 512, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__63)) __PYX_ERR(0, 512, __pyx_L1_error)
+
+513:         result = Queue._format(self)
+
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_6gevent_6_queue_Queue), __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 513, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = NULL;
+  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+    if (likely(__pyx_t_3)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+      __Pyx_INCREF(__pyx_t_3);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_2, function);
+    }
+  }
+  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, ((PyObject *)__pyx_v_self)) : __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_v_self));
+  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 513, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_v_result = __pyx_t_1;
+  __pyx_t_1 = 0;
+
+514:         if self.unfinished_tasks:
+
  __pyx_t_4 = (__pyx_v_self->unfinished_tasks != 0);
+  if (__pyx_t_4) {
+/* … */
+  }
+
+515:             result += ' tasks=%s _cond=%s' % (self.unfinished_tasks, self._cond)
+
    __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->unfinished_tasks); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 515, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 515, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_GIVEREF(__pyx_t_1);
+    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
+    __Pyx_INCREF(((PyObject *)__pyx_v_self->_cond));
+    __Pyx_GIVEREF(((PyObject *)__pyx_v_self->_cond));
+    PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_self->_cond));
+    __pyx_t_1 = 0;
+    __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_tasks_s__cond_s, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 515, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 515, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_2);
+    __pyx_t_2 = 0;
+
+516:         return result
+
  __Pyx_XDECREF(__pyx_r);
+  __Pyx_INCREF(__pyx_v_result);
+  __pyx_r = __pyx_v_result;
+  goto __pyx_L0;
+
 517: 
+
+518:     def _put(self, item):
+
static PyObject *__pyx_pw_6gevent_6_queue_13JoinableQueue_7_put(PyObject *__pyx_v_self, PyObject *__pyx_v_item); /*proto*/
+static PyObject *__pyx_f_6gevent_6_queue_13JoinableQueue__put(struct __pyx_obj_6gevent_6_queue_JoinableQueue *__pyx_v_self, PyObject *__pyx_v_item, int __pyx_skip_dispatch) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_put", 0);
+  /* Check if called by wrapper */
+  if (unlikely(__pyx_skip_dispatch)) ;
+  /* Check if overridden in Python */
+  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
+    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
+    if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
+    else {
+      PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      #endif
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_put); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 518, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_6_queue_13JoinableQueue_7_put)) {
+        __Pyx_XDECREF(__pyx_r);
+        __Pyx_INCREF(__pyx_t_1);
+        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+          if (likely(__pyx_t_4)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+            __Pyx_INCREF(__pyx_t_4);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_3, function);
+          }
+        }
+        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_item) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_item);
+        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 518, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __pyx_r = __pyx_t_2;
+        __pyx_t_2 = 0;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        goto __pyx_L0;
+      }
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+      tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
+      if (unlikely(type_dict_guard != tp_dict_version)) {
+        tp_dict_version = obj_dict_version = 0;
+      }
+      #endif
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    }
+    #endif
+  }
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_AddTraceback("gevent._queue.JoinableQueue._put", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_queue_13JoinableQueue_7_put(PyObject *__pyx_v_self, PyObject *__pyx_v_item); /*proto*/
+static char __pyx_doc_6gevent_6_queue_13JoinableQueue_6_put[] = "JoinableQueue._put(self, item)";
+static PyMethodDef __pyx_mdef_6gevent_6_queue_13JoinableQueue_7_put = {"_put", (PyCFunction)__pyx_pw_6gevent_6_queue_13JoinableQueue_7_put, METH_O, __pyx_doc_6gevent_6_queue_13JoinableQueue_6_put};
+static PyObject *__pyx_pw_6gevent_6_queue_13JoinableQueue_7_put(PyObject *__pyx_v_self, PyObject *__pyx_v_item) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_put (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_6_queue_13JoinableQueue_6_put(((struct __pyx_obj_6gevent_6_queue_JoinableQueue *)__pyx_v_self), ((PyObject *)__pyx_v_item));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_queue_13JoinableQueue_6_put(struct __pyx_obj_6gevent_6_queue_JoinableQueue *__pyx_v_self, PyObject *__pyx_v_item) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_put", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __pyx_f_6gevent_6_queue_13JoinableQueue__put(__pyx_v_self, __pyx_v_item, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 518, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent._queue.JoinableQueue._put", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__64 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_item); if (unlikely(!__pyx_tuple__64)) __PYX_ERR(0, 518, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__64);
+  __Pyx_GIVEREF(__pyx_tuple__64);
+/* … */
+  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_queue_13JoinableQueue_7_put, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_JoinableQueue__put, NULL, __pyx_n_s_gevent__queue, __pyx_d, ((PyObject *)__pyx_codeobj__65)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 518, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_JoinableQueue->tp_dict, __pyx_n_s_put, __pyx_t_6) < 0) __PYX_ERR(0, 518, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_6_queue_JoinableQueue);
+  __pyx_codeobj__65 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__64, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_queue_py, __pyx_n_s_put, 518, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__65)) __PYX_ERR(0, 518, __pyx_L1_error)
+
+519:         Queue._put(self, item)
+
  __pyx_t_1 = __pyx_f_6gevent_6_queue_5Queue__put(((struct __pyx_obj_6gevent_6_queue_Queue *)__pyx_v_self), __pyx_v_item, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 519, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+520:         self.unfinished_tasks += 1
+
  __pyx_v_self->unfinished_tasks = (__pyx_v_self->unfinished_tasks + 1);
+
+521:         self._cond.clear()
+
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->_cond), __pyx_n_s_clear); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 521, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = NULL;
+  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+    if (likely(__pyx_t_3)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+      __Pyx_INCREF(__pyx_t_3);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_2, function);
+    }
+  }
+  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 521, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 522: 
+
+523:     def task_done(self):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_queue_13JoinableQueue_9task_done(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6gevent_6_queue_13JoinableQueue_8task_done[] = "JoinableQueue.task_done(self)\nIndicate that a formerly enqueued task is complete. Used by queue consumer threads.\n        For each :meth:`get <Queue.get>` used to fetch a task, a subsequent call to :meth:`task_done` tells the queue\n        that the processing on the task is complete.\n\n        If a :meth:`join` is currently blocking, it will resume when all items have been processed\n        (meaning that a :meth:`task_done` call was received for every item that had been\n        :meth:`put <Queue.put>` into the queue).\n\n        Raises a :exc:`ValueError` if called more times than there were items placed in the queue.\n        ";
+static PyMethodDef __pyx_mdef_6gevent_6_queue_13JoinableQueue_9task_done = {"task_done", (PyCFunction)__pyx_pw_6gevent_6_queue_13JoinableQueue_9task_done, METH_NOARGS, __pyx_doc_6gevent_6_queue_13JoinableQueue_8task_done};
+static PyObject *__pyx_pw_6gevent_6_queue_13JoinableQueue_9task_done(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("task_done (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_6_queue_13JoinableQueue_8task_done(((struct __pyx_obj_6gevent_6_queue_JoinableQueue *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_queue_13JoinableQueue_8task_done(struct __pyx_obj_6gevent_6_queue_JoinableQueue *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("task_done", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_AddTraceback("gevent._queue.JoinableQueue.task_done", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__66 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__66)) __PYX_ERR(0, 523, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__66);
+  __Pyx_GIVEREF(__pyx_tuple__66);
+/* … */
+  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_queue_13JoinableQueue_9task_done, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_JoinableQueue_task_done, NULL, __pyx_n_s_gevent__queue, __pyx_d, ((PyObject *)__pyx_codeobj__67)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 523, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_JoinableQueue->tp_dict, __pyx_n_s_task_done, __pyx_t_6) < 0) __PYX_ERR(0, 523, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_6_queue_JoinableQueue);
+  __pyx_codeobj__67 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__66, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_queue_py, __pyx_n_s_task_done, 523, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__67)) __PYX_ERR(0, 523, __pyx_L1_error)
+
 524:         '''Indicate that a formerly enqueued task is complete. Used by queue consumer threads.
+
 525:         For each :meth:`get <Queue.get>` used to fetch a task, a subsequent call to :meth:`task_done` tells the queue
+
 526:         that the processing on the task is complete.
+
 527: 
+
 528:         If a :meth:`join` is currently blocking, it will resume when all items have been processed
+
 529:         (meaning that a :meth:`task_done` call was received for every item that had been
+
 530:         :meth:`put <Queue.put>` into the queue).
+
 531: 
+
 532:         Raises a :exc:`ValueError` if called more times than there were items placed in the queue.
+
 533:         '''
+
+534:         if self.unfinished_tasks <= 0:
+
  __pyx_t_1 = ((__pyx_v_self->unfinished_tasks <= 0) != 0);
+  if (unlikely(__pyx_t_1)) {
+/* … */
+  }
+
+535:             raise ValueError('task_done() called too many times')
+
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 535, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __PYX_ERR(0, 535, __pyx_L1_error)
+/* … */
+  __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_s_task_done_called_too_many_times); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 535, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__5);
+  __Pyx_GIVEREF(__pyx_tuple__5);
+
+536:         self.unfinished_tasks -= 1
+
  __pyx_v_self->unfinished_tasks = (__pyx_v_self->unfinished_tasks - 1);
+
+537:         if self.unfinished_tasks == 0:
+
  __pyx_t_1 = ((__pyx_v_self->unfinished_tasks == 0) != 0);
+  if (__pyx_t_1) {
+/* … */
+  }
+
+538:             self._cond.set()
+
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->_cond), __pyx_n_s_set); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 538, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __pyx_t_4 = NULL;
+    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
+      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+      if (likely(__pyx_t_4)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+        __Pyx_INCREF(__pyx_t_4);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_3, function);
+      }
+    }
+    __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
+    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 538, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
 539: 
+
+540:     def join(self, timeout=None):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_queue_13JoinableQueue_11join(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_6gevent_6_queue_13JoinableQueue_10join[] = "JoinableQueue.join(self, timeout=None)\n\n        Block until all items in the queue have been gotten and processed.\n\n        The count of unfinished tasks goes up whenever an item is added to the queue.\n        The count goes down whenever a consumer thread calls :meth:`task_done` to indicate\n        that the item was retrieved and all work on it is complete. When the count of\n        unfinished tasks drops to zero, :meth:`join` unblocks.\n\n        :param float timeout: If not ``None``, then wait no more than this time in seconds\n            for all tasks to finish.\n        :return: ``True`` if all tasks have finished; if ``timeout`` was given and expired before\n            all tasks finished, ``False``.\n\n        .. versionchanged:: 1.1a1\n           Add the *timeout* parameter.\n        ";
+static PyMethodDef __pyx_mdef_6gevent_6_queue_13JoinableQueue_11join = {"join", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_6_queue_13JoinableQueue_11join, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_6_queue_13JoinableQueue_10join};
+static PyObject *__pyx_pw_6gevent_6_queue_13JoinableQueue_11join(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_timeout = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("join (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_timeout,0};
+    PyObject* values[1] = {0};
+    values[0] = ((PyObject *)Py_None);
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_timeout);
+          if (value) { values[0] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "join") < 0)) __PYX_ERR(0, 540, __pyx_L3_error)
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    __pyx_v_timeout = values[0];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("join", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 540, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent._queue.JoinableQueue.join", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_6_queue_13JoinableQueue_10join(((struct __pyx_obj_6gevent_6_queue_JoinableQueue *)__pyx_v_self), __pyx_v_timeout);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_queue_13JoinableQueue_10join(struct __pyx_obj_6gevent_6_queue_JoinableQueue *__pyx_v_self, PyObject *__pyx_v_timeout) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("join", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_AddTraceback("gevent._queue.JoinableQueue.join", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__68 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_timeout); if (unlikely(!__pyx_tuple__68)) __PYX_ERR(0, 540, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__68);
+  __Pyx_GIVEREF(__pyx_tuple__68);
+/* … */
+  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_queue_13JoinableQueue_11join, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_JoinableQueue_join, NULL, __pyx_n_s_gevent__queue, __pyx_d, ((PyObject *)__pyx_codeobj__69)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 540, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_JoinableQueue->tp_dict, __pyx_n_s_join, __pyx_t_6) < 0) __PYX_ERR(0, 540, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_6_queue_JoinableQueue);
+  __pyx_codeobj__69 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__68, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_queue_py, __pyx_n_s_join, 540, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__69)) __PYX_ERR(0, 540, __pyx_L1_error)
+
 541:         '''
+
 542:         Block until all items in the queue have been gotten and processed.
+
 543: 
+
 544:         The count of unfinished tasks goes up whenever an item is added to the queue.
+
 545:         The count goes down whenever a consumer thread calls :meth:`task_done` to indicate
+
 546:         that the item was retrieved and all work on it is complete. When the count of
+
 547:         unfinished tasks drops to zero, :meth:`join` unblocks.
+
 548: 
+
 549:         :param float timeout: If not ``None``, then wait no more than this time in seconds
+
 550:             for all tasks to finish.
+
 551:         :return: ``True`` if all tasks have finished; if ``timeout`` was given and expired before
+
 552:             all tasks finished, ``False``.
+
 553: 
+
 554:         .. versionchanged:: 1.1a1
+
 555:            Add the *timeout* parameter.
+
 556:         '''
+
+557:         return self._cond.wait(timeout=timeout)
+
  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->_cond), __pyx_n_s_wait); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 557, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 557, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_timeout, __pyx_v_timeout) < 0) __PYX_ERR(0, 557, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 557, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_r = __pyx_t_3;
+  __pyx_t_3 = 0;
+  goto __pyx_L0;
+
 558: 
+
 559: 
+
+560: class Channel(object):
+
struct __pyx_vtabstruct_6gevent_6_queue_Channel {
+  PyObject *(*get)(struct __pyx_obj_6gevent_6_queue_Channel *, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_6_queue_7Channel_get *__pyx_optional_args);
+  PyObject *(*get_nowait)(struct __pyx_obj_6gevent_6_queue_Channel *, int __pyx_skip_dispatch);
+  PyObject *(*_schedule_unlock)(struct __pyx_obj_6gevent_6_queue_Channel *);
+};
+static struct __pyx_vtabstruct_6gevent_6_queue_Channel *__pyx_vtabptr_6gevent_6_queue_Channel;
+
 561: 
+
 562:     __slots__ = (
+
+563:         'getters',
+
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_Channel->tp_dict, __pyx_n_s_slots, __pyx_tuple__70) < 0) __PYX_ERR(0, 562, __pyx_L1_error)
+  PyType_Modified(__pyx_ptype_6gevent_6_queue_Channel);
+/* … */
+  __pyx_tuple__70 = PyTuple_Pack(5, __pyx_n_s_getters, __pyx_n_s_putters, __pyx_n_s_hub, __pyx_n_s_event_unlock, __pyx_n_s_weakref); if (unlikely(!__pyx_tuple__70)) __PYX_ERR(0, 563, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__70);
+  __Pyx_GIVEREF(__pyx_tuple__70);
+
 564:         'putters',
+
 565:         'hub',
+
 566:         '_event_unlock',
+
 567:         '__weakref__',
+
 568:     )
+
 569: 
+
+570:     def __init__(self, maxsize=1):
+
/* Python wrapper */
+static int __pyx_pw_6gevent_6_queue_7Channel_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static int __pyx_pw_6gevent_6_queue_7Channel_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_maxsize = 0;
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_maxsize,0};
+    PyObject* values[1] = {0};
+    values[0] = ((PyObject *)__pyx_int_1);
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_maxsize);
+          if (value) { values[0] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 570, __pyx_L3_error)
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    __pyx_v_maxsize = values[0];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 570, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent._queue.Channel.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return -1;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_6_queue_7Channel___init__(((struct __pyx_obj_6gevent_6_queue_Channel *)__pyx_v_self), __pyx_v_maxsize);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_6_queue_7Channel___init__(struct __pyx_obj_6gevent_6_queue_Channel *__pyx_v_self, PyObject *__pyx_v_maxsize) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = 0;
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_AddTraceback("gevent._queue.Channel.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = -1;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
 571:         # We take maxsize to simplify certain kinds of code
+
+572:         if maxsize != 1:
+
  __pyx_t_1 = __Pyx_PyInt_NeObjC(__pyx_v_maxsize, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 572, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 572, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  if (unlikely(__pyx_t_2)) {
+/* … */
+  }
+
+573:             raise ValueError("Channels have a maxsize of 1")
+
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 573, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __PYX_ERR(0, 573, __pyx_L1_error)
+/* … */
+  __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_s_Channels_have_a_maxsize_of_1); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 573, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__6);
+  __Pyx_GIVEREF(__pyx_tuple__6);
+
+574:         self.getters = collections.deque()
+
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_collections); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 574, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_deque); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 574, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_4);
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __pyx_t_3 = NULL;
+  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
+    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
+    if (likely(__pyx_t_3)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
+      __Pyx_INCREF(__pyx_t_3);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_4, function);
+    }
+  }
+  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 574, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __Pyx_GIVEREF(__pyx_t_1);
+  __Pyx_GOTREF(__pyx_v_self->getters);
+  __Pyx_DECREF(__pyx_v_self->getters);
+  __pyx_v_self->getters = __pyx_t_1;
+  __pyx_t_1 = 0;
+
+575:         self.putters = collections.deque()
+
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_collections); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 575, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_4);
+  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_deque); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 575, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __pyx_t_4 = NULL;
+  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+    if (likely(__pyx_t_4)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+      __Pyx_INCREF(__pyx_t_4);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_3, function);
+    }
+  }
+  __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 575, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __Pyx_GIVEREF(__pyx_t_1);
+  __Pyx_GOTREF(__pyx_v_self->putters);
+  __Pyx_DECREF(__pyx_v_self->putters);
+  __pyx_v_self->putters = __pyx_t_1;
+  __pyx_t_1 = 0;
+
+576:         self.hub = get_hub()
+
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_get_hub); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 576, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __pyx_t_4 = NULL;
+  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+    if (likely(__pyx_t_4)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+      __Pyx_INCREF(__pyx_t_4);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_3, function);
+    }
+  }
+  __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 576, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __Pyx_GIVEREF(__pyx_t_1);
+  __Pyx_GOTREF(__pyx_v_self->hub);
+  __Pyx_DECREF(__pyx_v_self->hub);
+  __pyx_v_self->hub = __pyx_t_1;
+  __pyx_t_1 = 0;
+
+577:         self._event_unlock = None
+
  __Pyx_INCREF(Py_None);
+  __Pyx_GIVEREF(Py_None);
+  __Pyx_GOTREF(__pyx_v_self->_event_unlock);
+  __Pyx_DECREF(__pyx_v_self->_event_unlock);
+  __pyx_v_self->_event_unlock = Py_None;
+
 578: 
+
+579:     def __repr__(self):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_queue_7Channel_3__repr__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_6_queue_7Channel_3__repr__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_6_queue_7Channel_2__repr__(((struct __pyx_obj_6gevent_6_queue_Channel *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_queue_7Channel_2__repr__(struct __pyx_obj_6gevent_6_queue_Channel *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__repr__", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_AddTraceback("gevent._queue.Channel.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+580:         return '<%s at %s %s>' % (type(self).__name__, hex(id(self)), self._format())
+
  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))), __pyx_n_s_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 580, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 580, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_hex, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 580, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 580, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_4);
+  __pyx_t_5 = NULL;
+  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
+    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
+    if (likely(__pyx_t_5)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
+      __Pyx_INCREF(__pyx_t_5);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_4, function);
+    }
+  }
+  __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 580, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 580, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_4);
+  __Pyx_GIVEREF(__pyx_t_1);
+  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_3);
+  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
+  __Pyx_GIVEREF(__pyx_t_2);
+  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_2);
+  __pyx_t_1 = 0;
+  __pyx_t_3 = 0;
+  __pyx_t_2 = 0;
+  __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_s_at_s_s_2, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 580, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __pyx_r = __pyx_t_2;
+  __pyx_t_2 = 0;
+  goto __pyx_L0;
+
 581: 
+
+582:     def __str__(self):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_queue_7Channel_5__str__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_6_queue_7Channel_5__str__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_6_queue_7Channel_4__str__(((struct __pyx_obj_6gevent_6_queue_Channel *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_queue_7Channel_4__str__(struct __pyx_obj_6gevent_6_queue_Channel *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__str__", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_AddTraceback("gevent._queue.Channel.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+583:         return '<%s %s>' % (type(self).__name__, self._format())
+
  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))), __pyx_n_s_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 583, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 583, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __pyx_t_4 = NULL;
+  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
+    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+    if (likely(__pyx_t_4)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+      __Pyx_INCREF(__pyx_t_4);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_3, function);
+    }
+  }
+  __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 583, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 583, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_GIVEREF(__pyx_t_1);
+  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_2);
+  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
+  __pyx_t_1 = 0;
+  __pyx_t_2 = 0;
+  __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_s_s_2, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 583, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __pyx_r = __pyx_t_2;
+  __pyx_t_2 = 0;
+  goto __pyx_L0;
+
 584: 
+
+585:     def _format(self):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_queue_7Channel_7_format(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6gevent_6_queue_7Channel_6_format[] = "Channel._format(self)";
+static PyMethodDef __pyx_mdef_6gevent_6_queue_7Channel_7_format = {"_format", (PyCFunction)__pyx_pw_6gevent_6_queue_7Channel_7_format, METH_NOARGS, __pyx_doc_6gevent_6_queue_7Channel_6_format};
+static PyObject *__pyx_pw_6gevent_6_queue_7Channel_7_format(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_format (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_6_queue_7Channel_6_format(((struct __pyx_obj_6gevent_6_queue_Channel *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_queue_7Channel_6_format(struct __pyx_obj_6gevent_6_queue_Channel *__pyx_v_self) {
+  PyObject *__pyx_v_result = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_format", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_AddTraceback("gevent._queue.Channel._format", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_result);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__71 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_result); if (unlikely(!__pyx_tuple__71)) __PYX_ERR(0, 585, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__71);
+  __Pyx_GIVEREF(__pyx_tuple__71);
+/* … */
+  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_queue_7Channel_7_format, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Channel__format, NULL, __pyx_n_s_gevent__queue, __pyx_d, ((PyObject *)__pyx_codeobj__72)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 585, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_Channel->tp_dict, __pyx_n_s_format, __pyx_t_6) < 0) __PYX_ERR(0, 585, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_6_queue_Channel);
+  __pyx_codeobj__72 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__71, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_queue_py, __pyx_n_s_format, 585, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__72)) __PYX_ERR(0, 585, __pyx_L1_error)
+
+586:         result = ''
+
  __Pyx_INCREF(__pyx_kp_s__3);
+  __pyx_v_result = __pyx_kp_s__3;
+
+587:         if self.getters:
+
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_self->getters); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 587, __pyx_L1_error)
+  if (__pyx_t_1) {
+/* … */
+  }
+
+588:             result += ' getters[%s]' % len(self.getters)
+
    __pyx_t_2 = __pyx_v_self->getters;
+    __Pyx_INCREF(__pyx_t_2);
+    __pyx_t_3 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 588, __pyx_L1_error)
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 588, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_getters_s_2, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 588, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 588, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    if (!(likely(PyString_CheckExact(__pyx_t_2))||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(0, 588, __pyx_L1_error)
+    __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_2));
+    __pyx_t_2 = 0;
+
+589:         if self.putters:
+
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_self->putters); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 589, __pyx_L1_error)
+  if (__pyx_t_1) {
+/* … */
+  }
+
+590:             result += ' putters[%s]' % len(self.putters)
+
    __pyx_t_2 = __pyx_v_self->putters;
+    __Pyx_INCREF(__pyx_t_2);
+    __pyx_t_3 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 590, __pyx_L1_error)
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 590, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_putters_s_2, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 590, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 590, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    if (!(likely(PyString_CheckExact(__pyx_t_2))||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(0, 590, __pyx_L1_error)
+    __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_2));
+    __pyx_t_2 = 0;
+
+591:         return result
+
  __Pyx_XDECREF(__pyx_r);
+  __Pyx_INCREF(__pyx_v_result);
+  __pyx_r = __pyx_v_result;
+  goto __pyx_L0;
+
 592: 
+
 593:     @property
+
+594:     def balance(self):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_queue_7Channel_7balance_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_6_queue_7Channel_7balance_1__get__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_6_queue_7Channel_7balance___get__(((struct __pyx_obj_6gevent_6_queue_Channel *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_queue_7Channel_7balance___get__(struct __pyx_obj_6gevent_6_queue_Channel *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent._queue.Channel.balance.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+595:         return len(self.putters) - len(self.getters)
+
  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __pyx_v_self->putters;
+  __Pyx_INCREF(__pyx_t_1);
+  __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 595, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_1 = __pyx_v_self->getters;
+  __Pyx_INCREF(__pyx_t_1);
+  __pyx_t_3 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 595, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_1 = PyInt_FromSsize_t((__pyx_t_2 - __pyx_t_3)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 595, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
 596: 
+
+597:     def qsize(self):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_queue_7Channel_9qsize(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6gevent_6_queue_7Channel_8qsize[] = "Channel.qsize(self)";
+static PyMethodDef __pyx_mdef_6gevent_6_queue_7Channel_9qsize = {"qsize", (PyCFunction)__pyx_pw_6gevent_6_queue_7Channel_9qsize, METH_NOARGS, __pyx_doc_6gevent_6_queue_7Channel_8qsize};
+static PyObject *__pyx_pw_6gevent_6_queue_7Channel_9qsize(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("qsize (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_6_queue_7Channel_8qsize(((struct __pyx_obj_6gevent_6_queue_Channel *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_queue_7Channel_8qsize(CYTHON_UNUSED struct __pyx_obj_6gevent_6_queue_Channel *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("qsize", 0);
+/* … */
+  /* function exit code */
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__73 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__73)) __PYX_ERR(0, 597, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__73);
+  __Pyx_GIVEREF(__pyx_tuple__73);
+/* … */
+  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_queue_7Channel_9qsize, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Channel_qsize, NULL, __pyx_n_s_gevent__queue, __pyx_d, ((PyObject *)__pyx_codeobj__74)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 597, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_Channel->tp_dict, __pyx_n_s_qsize, __pyx_t_6) < 0) __PYX_ERR(0, 597, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_6_queue_Channel);
+  __pyx_codeobj__74 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__73, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_queue_py, __pyx_n_s_qsize, 597, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__74)) __PYX_ERR(0, 597, __pyx_L1_error)
+
+598:         return 0
+
  __Pyx_XDECREF(__pyx_r);
+  __Pyx_INCREF(__pyx_int_0);
+  __pyx_r = __pyx_int_0;
+  goto __pyx_L0;
+
 599: 
+
+600:     def empty(self):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_queue_7Channel_11empty(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6gevent_6_queue_7Channel_10empty[] = "Channel.empty(self)";
+static PyMethodDef __pyx_mdef_6gevent_6_queue_7Channel_11empty = {"empty", (PyCFunction)__pyx_pw_6gevent_6_queue_7Channel_11empty, METH_NOARGS, __pyx_doc_6gevent_6_queue_7Channel_10empty};
+static PyObject *__pyx_pw_6gevent_6_queue_7Channel_11empty(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("empty (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_6_queue_7Channel_10empty(((struct __pyx_obj_6gevent_6_queue_Channel *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_queue_7Channel_10empty(CYTHON_UNUSED struct __pyx_obj_6gevent_6_queue_Channel *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("empty", 0);
+/* … */
+  /* function exit code */
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__75 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__75)) __PYX_ERR(0, 600, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__75);
+  __Pyx_GIVEREF(__pyx_tuple__75);
+/* … */
+  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_queue_7Channel_11empty, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Channel_empty, NULL, __pyx_n_s_gevent__queue, __pyx_d, ((PyObject *)__pyx_codeobj__76)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 600, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_Channel->tp_dict, __pyx_n_s_empty, __pyx_t_6) < 0) __PYX_ERR(0, 600, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_6_queue_Channel);
+  __pyx_codeobj__76 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__75, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_queue_py, __pyx_n_s_empty, 600, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__76)) __PYX_ERR(0, 600, __pyx_L1_error)
+
+601:         return True
+
  __Pyx_XDECREF(__pyx_r);
+  __Pyx_INCREF(Py_True);
+  __pyx_r = Py_True;
+  goto __pyx_L0;
+
 602: 
+
+603:     def full(self):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_queue_7Channel_13full(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6gevent_6_queue_7Channel_12full[] = "Channel.full(self)";
+static PyMethodDef __pyx_mdef_6gevent_6_queue_7Channel_13full = {"full", (PyCFunction)__pyx_pw_6gevent_6_queue_7Channel_13full, METH_NOARGS, __pyx_doc_6gevent_6_queue_7Channel_12full};
+static PyObject *__pyx_pw_6gevent_6_queue_7Channel_13full(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("full (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_6_queue_7Channel_12full(((struct __pyx_obj_6gevent_6_queue_Channel *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_queue_7Channel_12full(CYTHON_UNUSED struct __pyx_obj_6gevent_6_queue_Channel *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("full", 0);
+/* … */
+  /* function exit code */
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__77 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__77)) __PYX_ERR(0, 603, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__77);
+  __Pyx_GIVEREF(__pyx_tuple__77);
+/* … */
+  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_queue_7Channel_13full, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Channel_full, NULL, __pyx_n_s_gevent__queue, __pyx_d, ((PyObject *)__pyx_codeobj__78)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 603, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_Channel->tp_dict, __pyx_n_s_full, __pyx_t_6) < 0) __PYX_ERR(0, 603, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_6_queue_Channel);
+  __pyx_codeobj__78 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__77, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_queue_py, __pyx_n_s_full, 603, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__78)) __PYX_ERR(0, 603, __pyx_L1_error)
+
+604:         return True
+
  __Pyx_XDECREF(__pyx_r);
+  __Pyx_INCREF(Py_True);
+  __pyx_r = Py_True;
+  goto __pyx_L0;
+
 605: 
+
+606:     def put(self, item, block=True, timeout=None):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_queue_7Channel_15put(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_6gevent_6_queue_7Channel_14put[] = "Channel.put(self, item, block=True, timeout=None)";
+static PyMethodDef __pyx_mdef_6gevent_6_queue_7Channel_15put = {"put", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_6_queue_7Channel_15put, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_6_queue_7Channel_14put};
+static PyObject *__pyx_pw_6gevent_6_queue_7Channel_15put(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_item = 0;
+  PyObject *__pyx_v_block = 0;
+  PyObject *__pyx_v_timeout = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("put (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_item,&__pyx_n_s_block,&__pyx_n_s_timeout,0};
+    PyObject* values[3] = {0,0,0};
+    values[1] = ((PyObject *)Py_True);
+    values[2] = ((PyObject *)Py_None);
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_item)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_block);
+          if (value) { values[1] = value; kw_args--; }
+        }
+        CYTHON_FALLTHROUGH;
+        case  2:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_timeout);
+          if (value) { values[2] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "put") < 0)) __PYX_ERR(0, 606, __pyx_L3_error)
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    __pyx_v_item = values[0];
+    __pyx_v_block = values[1];
+    __pyx_v_timeout = values[2];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("put", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 606, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent._queue.Channel.put", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_6_queue_7Channel_14put(((struct __pyx_obj_6gevent_6_queue_Channel *)__pyx_v_self), __pyx_v_item, __pyx_v_block, __pyx_v_timeout);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_queue_7Channel_14put(struct __pyx_obj_6gevent_6_queue_Channel *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_block, PyObject *__pyx_v_timeout) {
+  PyObject *__pyx_v_getter = NULL;
+  struct __pyx_obj_6gevent_8__waiter_Waiter *__pyx_v_waiter = NULL;
+  PyObject *__pyx_v_result = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("put", 0);
+  __Pyx_INCREF(__pyx_v_item);
+  __Pyx_INCREF(__pyx_v_timeout);
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_7);
+  __Pyx_XDECREF(__pyx_t_9);
+  __Pyx_AddTraceback("gevent._queue.Channel.put", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_getter);
+  __Pyx_XDECREF((PyObject *)__pyx_v_waiter);
+  __Pyx_XDECREF(__pyx_v_result);
+  __Pyx_XDECREF(__pyx_v_item);
+  __Pyx_XDECREF(__pyx_v_timeout);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__79 = PyTuple_Pack(7, __pyx_n_s_self, __pyx_n_s_item, __pyx_n_s_block, __pyx_n_s_timeout, __pyx_n_s_getter, __pyx_n_s_waiter_2, __pyx_n_s_result); if (unlikely(!__pyx_tuple__79)) __PYX_ERR(0, 606, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__79);
+  __Pyx_GIVEREF(__pyx_tuple__79);
+/* … */
+  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_queue_7Channel_15put, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Channel_put, NULL, __pyx_n_s_gevent__queue, __pyx_d, ((PyObject *)__pyx_codeobj__80)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 606, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_Channel->tp_dict, __pyx_n_s_put_2, __pyx_t_6) < 0) __PYX_ERR(0, 606, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_6_queue_Channel);
+  __pyx_codeobj__80 = (PyObject*)__Pyx_PyCode_New(4, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__79, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_queue_py, __pyx_n_s_put_2, 606, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__80)) __PYX_ERR(0, 606, __pyx_L1_error)
+
+607:         if self.hub is getcurrent():
+
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_getcurrent); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 607, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = NULL;
+  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
+    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+    if (likely(__pyx_t_3)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+      __Pyx_INCREF(__pyx_t_3);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_2, function);
+    }
+  }
+  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 607, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_4 = (__pyx_v_self->hub == __pyx_t_1);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_5 = (__pyx_t_4 != 0);
+  if (__pyx_t_5) {
+/* … */
+  }
+
+608:             if self.getters:
+
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_self->getters); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 608, __pyx_L1_error)
+    if (__pyx_t_5) {
+/* … */
+    }
+
+609:                 getter = self.getters.popleft()
+
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->getters, __pyx_n_s_popleft); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 609, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_2);
+      __pyx_t_3 = NULL;
+      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+        if (likely(__pyx_t_3)) {
+          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+          __Pyx_INCREF(__pyx_t_3);
+          __Pyx_INCREF(function);
+          __Pyx_DECREF_SET(__pyx_t_2, function);
+        }
+      }
+      __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
+      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 609, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+      __pyx_v_getter = __pyx_t_1;
+      __pyx_t_1 = 0;
+
+610:                 getter.switch(item)
+
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_getter, __pyx_n_s_switch); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 610, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_2);
+      __pyx_t_3 = NULL;
+      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+        if (likely(__pyx_t_3)) {
+          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+          __Pyx_INCREF(__pyx_t_3);
+          __Pyx_INCREF(function);
+          __Pyx_DECREF_SET(__pyx_t_2, function);
+        }
+      }
+      __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_item) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_item);
+      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 610, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+611:                 return
+
      __Pyx_XDECREF(__pyx_r);
+      __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+      goto __pyx_L0;
+
+612:             raise Full
+
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Full); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 612, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __PYX_ERR(0, 612, __pyx_L1_error)
+
 613: 
+
+614:         if not block:
+
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_block); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 614, __pyx_L1_error)
+  __pyx_t_4 = ((!__pyx_t_5) != 0);
+  if (__pyx_t_4) {
+/* … */
+  }
+
+615:             timeout = 0
+
    __Pyx_INCREF(__pyx_int_0);
+    __Pyx_DECREF_SET(__pyx_v_timeout, __pyx_int_0);
+
 616: 
+
+617:         waiter = Waiter() # pylint:disable=undefined-variable
+
  __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_6gevent_8__waiter_Waiter)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 617, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_v_waiter = ((struct __pyx_obj_6gevent_8__waiter_Waiter *)__pyx_t_1);
+  __pyx_t_1 = 0;
+
+618:         item = (item, waiter)
+
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 618, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(__pyx_v_item);
+  __Pyx_GIVEREF(__pyx_v_item);
+  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_item);
+  __Pyx_INCREF(((PyObject *)__pyx_v_waiter));
+  __Pyx_GIVEREF(((PyObject *)__pyx_v_waiter));
+  PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_waiter));
+  __Pyx_DECREF_SET(__pyx_v_item, __pyx_t_1);
+  __pyx_t_1 = 0;
+
+619:         self.putters.append(item)
+
  __pyx_t_6 = __Pyx_PyObject_Append(__pyx_v_self->putters, __pyx_v_item); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 619, __pyx_L1_error)
+
+620:         timeout = Timeout._start_new_or_dummy(timeout, Full)
+
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Timeout); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 620, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_start_new_or_dummy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 620, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Full); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 620, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_7 = NULL;
+  __pyx_t_8 = 0;
+  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3);
+    if (likely(__pyx_t_7)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+      __Pyx_INCREF(__pyx_t_7);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_3, function);
+      __pyx_t_8 = 1;
+    }
+  }
+  #if CYTHON_FAST_PYCALL
+  if (PyFunction_Check(__pyx_t_3)) {
+    PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_v_timeout, __pyx_t_2};
+    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 620, __pyx_L1_error)
+    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  } else
+  #endif
+  #if CYTHON_FAST_PYCCALL
+  if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
+    PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_v_timeout, __pyx_t_2};
+    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 620, __pyx_L1_error)
+    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  } else
+  #endif
+  {
+    __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 620, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_9);
+    if (__pyx_t_7) {
+      __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
+    }
+    __Pyx_INCREF(__pyx_v_timeout);
+    __Pyx_GIVEREF(__pyx_v_timeout);
+    PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_v_timeout);
+    __Pyx_GIVEREF(__pyx_t_2);
+    PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_t_2);
+    __pyx_t_2 = 0;
+    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 620, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+  }
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __Pyx_DECREF_SET(__pyx_v_timeout, __pyx_t_1);
+  __pyx_t_1 = 0;
+
+621:         try:
+
  /*try:*/ {
+    {
+      /*try:*/ {
+/* … */
+      }
+      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
+      __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
+      __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
+      goto __pyx_L14_try_end;
+      __pyx_L9_error:;
+      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
+      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+/* … */
+      __Pyx_XGIVEREF(__pyx_t_10);
+      __Pyx_XGIVEREF(__pyx_t_11);
+      __Pyx_XGIVEREF(__pyx_t_12);
+      __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
+      goto __pyx_L7_error;
+      __pyx_L14_try_end:;
+    }
+  }
+
+622:             if self.getters:
+
        __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_self->getters); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 622, __pyx_L9_error)
+        if (__pyx_t_4) {
+/* … */
+        }
+
+623:                 self._schedule_unlock()
+
          __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_6_queue_Channel *)__pyx_v_self->__pyx_vtab)->_schedule_unlock(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 623, __pyx_L9_error)
+          __Pyx_GOTREF(__pyx_t_1);
+          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+624:             result = waiter.get()
+
        __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_8__waiter_Waiter *)__pyx_v_waiter->__pyx_vtab)->get(__pyx_v_waiter, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 624, __pyx_L9_error)
+        __Pyx_GOTREF(__pyx_t_1);
+        __pyx_v_result = __pyx_t_1;
+        __pyx_t_1 = 0;
+
+625:             if result is not waiter:
+
        __pyx_t_4 = (__pyx_v_result != ((PyObject *)__pyx_v_waiter));
+        __pyx_t_5 = (__pyx_t_4 != 0);
+        if (unlikely(__pyx_t_5)) {
+/* … */
+        }
+
+626:                 raise InvalidSwitchError("Invalid switch into Channel.put: %r" % (result, ))
+
          __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_InvalidSwitchError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 626, __pyx_L9_error)
+          __Pyx_GOTREF(__pyx_t_3);
+          __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 626, __pyx_L9_error)
+          __Pyx_GOTREF(__pyx_t_9);
+          __Pyx_INCREF(__pyx_v_result);
+          __Pyx_GIVEREF(__pyx_v_result);
+          PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_result);
+          __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_switch_into_Channel_put, __pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 626, __pyx_L9_error)
+          __Pyx_GOTREF(__pyx_t_2);
+          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+          __pyx_t_9 = NULL;
+          if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+            __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_3);
+            if (likely(__pyx_t_9)) {
+              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+              __Pyx_INCREF(__pyx_t_9);
+              __Pyx_INCREF(function);
+              __Pyx_DECREF_SET(__pyx_t_3, function);
+            }
+          }
+          __pyx_t_1 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_9, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2);
+          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
+          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+          if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 626, __pyx_L9_error)
+          __Pyx_GOTREF(__pyx_t_1);
+          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+          __Pyx_Raise(__pyx_t_1, 0, 0, 0);
+          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+          __PYX_ERR(0, 626, __pyx_L9_error)
+
+627:         except:
+
      /*except:*/ {
+        __Pyx_AddTraceback("gevent._queue.Channel.put", __pyx_clineno, __pyx_lineno, __pyx_filename);
+        if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_3, &__pyx_t_2) < 0) __PYX_ERR(0, 627, __pyx_L11_except_error)
+        __Pyx_GOTREF(__pyx_t_1);
+        __Pyx_GOTREF(__pyx_t_3);
+        __Pyx_GOTREF(__pyx_t_2);
+
+628:             _safe_remove(self.putters, item)
+
        __pyx_t_9 = __pyx_v_self->putters;
+        __Pyx_INCREF(__pyx_t_9);
+        __pyx_t_7 = __pyx_f_6gevent_6_queue__safe_remove(__pyx_t_9, __pyx_v_item); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 628, __pyx_L11_except_error)
+        __Pyx_GOTREF(__pyx_t_7);
+        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+
+629:             raise
+
        __Pyx_GIVEREF(__pyx_t_1);
+        __Pyx_GIVEREF(__pyx_t_3);
+        __Pyx_XGIVEREF(__pyx_t_2);
+        __Pyx_ErrRestoreWithState(__pyx_t_1, __pyx_t_3, __pyx_t_2);
+        __pyx_t_1 = 0; __pyx_t_3 = 0; __pyx_t_2 = 0; 
+        __PYX_ERR(0, 629, __pyx_L11_except_error)
+      }
+      __pyx_L11_except_error:;
+
 630:         finally:
+
+631:             timeout.cancel()
+
  /*finally:*/ {
+    /*normal exit:*/{
+      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_timeout, __pyx_n_s_cancel); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 631, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_3);
+      __pyx_t_1 = NULL;
+      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
+        __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
+        if (likely(__pyx_t_1)) {
+          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+          __Pyx_INCREF(__pyx_t_1);
+          __Pyx_INCREF(function);
+          __Pyx_DECREF_SET(__pyx_t_3, function);
+        }
+      }
+      __pyx_t_2 = (__pyx_t_1) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
+      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 631, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_2);
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+      goto __pyx_L8;
+    }
+    __pyx_L7_error:;
+    /*exception exit:*/{
+      __Pyx_PyThreadState_declare
+      __Pyx_PyThreadState_assign
+      __pyx_t_12 = 0; __pyx_t_11 = 0; __pyx_t_10 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0;
+      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
+      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+      if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
+      if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_12, &__pyx_t_11, &__pyx_t_10) < 0)) __Pyx_ErrFetch(&__pyx_t_12, &__pyx_t_11, &__pyx_t_10);
+      __Pyx_XGOTREF(__pyx_t_12);
+      __Pyx_XGOTREF(__pyx_t_11);
+      __Pyx_XGOTREF(__pyx_t_10);
+      __Pyx_XGOTREF(__pyx_t_15);
+      __Pyx_XGOTREF(__pyx_t_16);
+      __Pyx_XGOTREF(__pyx_t_17);
+      __pyx_t_8 = __pyx_lineno; __pyx_t_13 = __pyx_clineno; __pyx_t_14 = __pyx_filename;
+      {
+        __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_timeout, __pyx_n_s_cancel); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 631, __pyx_L20_error)
+        __Pyx_GOTREF(__pyx_t_3);
+        __pyx_t_1 = NULL;
+        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
+          __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
+          if (likely(__pyx_t_1)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+            __Pyx_INCREF(__pyx_t_1);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_3, function);
+          }
+        }
+        __pyx_t_2 = (__pyx_t_1) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
+        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 631, __pyx_L20_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+      }
+      if (PY_MAJOR_VERSION >= 3) {
+        __Pyx_XGIVEREF(__pyx_t_15);
+        __Pyx_XGIVEREF(__pyx_t_16);
+        __Pyx_XGIVEREF(__pyx_t_17);
+        __Pyx_ExceptionReset(__pyx_t_15, __pyx_t_16, __pyx_t_17);
+      }
+      __Pyx_XGIVEREF(__pyx_t_12);
+      __Pyx_XGIVEREF(__pyx_t_11);
+      __Pyx_XGIVEREF(__pyx_t_10);
+      __Pyx_ErrRestore(__pyx_t_12, __pyx_t_11, __pyx_t_10);
+      __pyx_t_12 = 0; __pyx_t_11 = 0; __pyx_t_10 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0;
+      __pyx_lineno = __pyx_t_8; __pyx_clineno = __pyx_t_13; __pyx_filename = __pyx_t_14;
+      goto __pyx_L1_error;
+      __pyx_L20_error:;
+      if (PY_MAJOR_VERSION >= 3) {
+        __Pyx_XGIVEREF(__pyx_t_15);
+        __Pyx_XGIVEREF(__pyx_t_16);
+        __Pyx_XGIVEREF(__pyx_t_17);
+        __Pyx_ExceptionReset(__pyx_t_15, __pyx_t_16, __pyx_t_17);
+      }
+      __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
+      __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
+      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
+      __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0;
+      goto __pyx_L1_error;
+    }
+    __pyx_L8:;
+  }
+
 632: 
+
+633:     def put_nowait(self, item):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_queue_7Channel_17put_nowait(PyObject *__pyx_v_self, PyObject *__pyx_v_item); /*proto*/
+static char __pyx_doc_6gevent_6_queue_7Channel_16put_nowait[] = "Channel.put_nowait(self, item)";
+static PyMethodDef __pyx_mdef_6gevent_6_queue_7Channel_17put_nowait = {"put_nowait", (PyCFunction)__pyx_pw_6gevent_6_queue_7Channel_17put_nowait, METH_O, __pyx_doc_6gevent_6_queue_7Channel_16put_nowait};
+static PyObject *__pyx_pw_6gevent_6_queue_7Channel_17put_nowait(PyObject *__pyx_v_self, PyObject *__pyx_v_item) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("put_nowait (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_6_queue_7Channel_16put_nowait(((struct __pyx_obj_6gevent_6_queue_Channel *)__pyx_v_self), ((PyObject *)__pyx_v_item));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_queue_7Channel_16put_nowait(struct __pyx_obj_6gevent_6_queue_Channel *__pyx_v_self, PyObject *__pyx_v_item) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("put_nowait", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_AddTraceback("gevent._queue.Channel.put_nowait", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__81 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_item); if (unlikely(!__pyx_tuple__81)) __PYX_ERR(0, 633, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__81);
+  __Pyx_GIVEREF(__pyx_tuple__81);
+/* … */
+  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_queue_7Channel_17put_nowait, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Channel_put_nowait, NULL, __pyx_n_s_gevent__queue, __pyx_d, ((PyObject *)__pyx_codeobj__82)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 633, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_Channel->tp_dict, __pyx_n_s_put_nowait, __pyx_t_6) < 0) __PYX_ERR(0, 633, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_6_queue_Channel);
+  __pyx_codeobj__82 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__81, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_queue_py, __pyx_n_s_put_nowait, 633, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__82)) __PYX_ERR(0, 633, __pyx_L1_error)
+
+634:         self.put(item, False)
+
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_put_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 634, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = NULL;
+  __pyx_t_4 = 0;
+  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+    if (likely(__pyx_t_3)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+      __Pyx_INCREF(__pyx_t_3);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_2, function);
+      __pyx_t_4 = 1;
+    }
+  }
+  #if CYTHON_FAST_PYCALL
+  if (PyFunction_Check(__pyx_t_2)) {
+    PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_item, Py_False};
+    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 634, __pyx_L1_error)
+    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __Pyx_GOTREF(__pyx_t_1);
+  } else
+  #endif
+  #if CYTHON_FAST_PYCCALL
+  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
+    PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_item, Py_False};
+    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 634, __pyx_L1_error)
+    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __Pyx_GOTREF(__pyx_t_1);
+  } else
+  #endif
+  {
+    __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 634, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_5);
+    if (__pyx_t_3) {
+      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
+    }
+    __Pyx_INCREF(__pyx_v_item);
+    __Pyx_GIVEREF(__pyx_v_item);
+    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_item);
+    __Pyx_INCREF(Py_False);
+    __Pyx_GIVEREF(Py_False);
+    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, Py_False);
+    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 634, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+  }
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 635: 
+
+636:     def get(self, block=True, timeout=None):
+
static PyObject *__pyx_pw_6gevent_6_queue_7Channel_19get(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_f_6gevent_6_queue_7Channel_get(struct __pyx_obj_6gevent_6_queue_Channel *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_6_queue_7Channel_get *__pyx_optional_args) {
+  PyObject *__pyx_v_block = ((PyObject *)Py_True);
+  PyObject *__pyx_v_timeout = ((PyObject *)Py_None);
+  PyObject *__pyx_v_item = NULL;
+  PyObject *__pyx_v_putter = NULL;
+  struct __pyx_obj_6gevent_8__waiter_Waiter *__pyx_v_waiter = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("get", 0);
+  if (__pyx_optional_args) {
+    if (__pyx_optional_args->__pyx_n > 0) {
+      __pyx_v_block = __pyx_optional_args->block;
+      if (__pyx_optional_args->__pyx_n > 1) {
+        __pyx_v_timeout = __pyx_optional_args->timeout;
+      }
+    }
+  }
+  __Pyx_INCREF(__pyx_v_timeout);
+  /* Check if called by wrapper */
+  if (unlikely(__pyx_skip_dispatch)) ;
+  /* Check if overridden in Python */
+  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
+    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
+    if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
+    else {
+      PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      #endif
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 636, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_6_queue_7Channel_19get)) {
+        __Pyx_XDECREF(__pyx_r);
+        __Pyx_INCREF(__pyx_t_1);
+        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
+        __pyx_t_5 = 0;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+          if (likely(__pyx_t_4)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+            __Pyx_INCREF(__pyx_t_4);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_3, function);
+            __pyx_t_5 = 1;
+          }
+        }
+        #if CYTHON_FAST_PYCALL
+        if (PyFunction_Check(__pyx_t_3)) {
+          PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_block, __pyx_v_timeout};
+          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 636, __pyx_L1_error)
+          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+          __Pyx_GOTREF(__pyx_t_2);
+        } else
+        #endif
+        #if CYTHON_FAST_PYCCALL
+        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
+          PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_block, __pyx_v_timeout};
+          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 636, __pyx_L1_error)
+          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+          __Pyx_GOTREF(__pyx_t_2);
+        } else
+        #endif
+        {
+          __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 636, __pyx_L1_error)
+          __Pyx_GOTREF(__pyx_t_6);
+          if (__pyx_t_4) {
+            __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
+          }
+          __Pyx_INCREF(__pyx_v_block);
+          __Pyx_GIVEREF(__pyx_v_block);
+          PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_block);
+          __Pyx_INCREF(__pyx_v_timeout);
+          __Pyx_GIVEREF(__pyx_v_timeout);
+          PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_timeout);
+          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 636, __pyx_L1_error)
+          __Pyx_GOTREF(__pyx_t_2);
+          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+        }
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __pyx_r = __pyx_t_2;
+        __pyx_t_2 = 0;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        goto __pyx_L0;
+      }
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+      tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
+      if (unlikely(type_dict_guard != tp_dict_version)) {
+        tp_dict_version = obj_dict_version = 0;
+      }
+      #endif
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    }
+    #endif
+  }
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_6);
+  __Pyx_XDECREF(__pyx_t_14);
+  __Pyx_AddTraceback("gevent._queue.Channel.get", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_item);
+  __Pyx_XDECREF(__pyx_v_putter);
+  __Pyx_XDECREF((PyObject *)__pyx_v_waiter);
+  __Pyx_XDECREF(__pyx_v_timeout);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_queue_7Channel_19get(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_6gevent_6_queue_7Channel_18get[] = "Channel.get(self, block=True, timeout=None)";
+static PyMethodDef __pyx_mdef_6gevent_6_queue_7Channel_19get = {"get", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_6_queue_7Channel_19get, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_6_queue_7Channel_18get};
+static PyObject *__pyx_pw_6gevent_6_queue_7Channel_19get(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_block = 0;
+  PyObject *__pyx_v_timeout = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("get (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_block,&__pyx_n_s_timeout,0};
+    PyObject* values[2] = {0,0};
+    values[0] = ((PyObject *)Py_True);
+    values[1] = ((PyObject *)Py_None);
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_block);
+          if (value) { values[0] = value; kw_args--; }
+        }
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_timeout);
+          if (value) { values[1] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get") < 0)) __PYX_ERR(0, 636, __pyx_L3_error)
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    __pyx_v_block = values[0];
+    __pyx_v_timeout = values[1];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("get", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 636, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent._queue.Channel.get", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_6_queue_7Channel_18get(((struct __pyx_obj_6gevent_6_queue_Channel *)__pyx_v_self), __pyx_v_block, __pyx_v_timeout);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_queue_7Channel_18get(struct __pyx_obj_6gevent_6_queue_Channel *__pyx_v_self, PyObject *__pyx_v_block, PyObject *__pyx_v_timeout) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("get", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_2.__pyx_n = 2;
+  __pyx_t_2.block = __pyx_v_block;
+  __pyx_t_2.timeout = __pyx_v_timeout;
+  __pyx_t_1 = __pyx_vtabptr_6gevent_6_queue_Channel->get(__pyx_v_self, 1, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 636, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent._queue.Channel.get", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__83 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_block, __pyx_n_s_timeout); if (unlikely(!__pyx_tuple__83)) __PYX_ERR(0, 636, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__83);
+  __Pyx_GIVEREF(__pyx_tuple__83);
+/* … */
+  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_queue_7Channel_19get, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Channel_get, NULL, __pyx_n_s_gevent__queue, __pyx_d, ((PyObject *)__pyx_codeobj__84)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 636, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_Channel->tp_dict, __pyx_n_s_get_2, __pyx_t_6) < 0) __PYX_ERR(0, 636, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_6_queue_Channel);
+  __pyx_codeobj__84 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__83, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_queue_py, __pyx_n_s_get_2, 636, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__84)) __PYX_ERR(0, 636, __pyx_L1_error)
+
+637:         if self.hub is getcurrent():
+
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_getcurrent); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 637, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = NULL;
+  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
+    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+    if (likely(__pyx_t_3)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+      __Pyx_INCREF(__pyx_t_3);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_2, function);
+    }
+  }
+  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 637, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_7 = (__pyx_v_self->hub == __pyx_t_1);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_8 = (__pyx_t_7 != 0);
+  if (__pyx_t_8) {
+/* … */
+  }
+
+638:             if self.putters:
+
    __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_self->putters); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 638, __pyx_L1_error)
+    if (__pyx_t_8) {
+/* … */
+    }
+
+639:                 item, putter = self.putters.popleft()
+
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->putters, __pyx_n_s_popleft); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 639, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_2);
+      __pyx_t_3 = NULL;
+      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+        if (likely(__pyx_t_3)) {
+          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+          __Pyx_INCREF(__pyx_t_3);
+          __Pyx_INCREF(function);
+          __Pyx_DECREF_SET(__pyx_t_2, function);
+        }
+      }
+      __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
+      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 639, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+      if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
+        PyObject* sequence = __pyx_t_1;
+        Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
+        if (unlikely(size != 2)) {
+          if (size > 2) __Pyx_RaiseTooManyValuesError(2);
+          else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
+          __PYX_ERR(0, 639, __pyx_L1_error)
+        }
+        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+        if (likely(PyTuple_CheckExact(sequence))) {
+          __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); 
+          __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); 
+        } else {
+          __pyx_t_2 = PyList_GET_ITEM(sequence, 0); 
+          __pyx_t_3 = PyList_GET_ITEM(sequence, 1); 
+        }
+        __Pyx_INCREF(__pyx_t_2);
+        __Pyx_INCREF(__pyx_t_3);
+        #else
+        __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 639, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 639, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_3);
+        #endif
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      } else {
+        Py_ssize_t index = -1;
+        __pyx_t_6 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 639, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_6);
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        __pyx_t_9 = Py_TYPE(__pyx_t_6)->tp_iternext;
+        index = 0; __pyx_t_2 = __pyx_t_9(__pyx_t_6); if (unlikely(!__pyx_t_2)) goto __pyx_L5_unpacking_failed;
+        __Pyx_GOTREF(__pyx_t_2);
+        index = 1; __pyx_t_3 = __pyx_t_9(__pyx_t_6); if (unlikely(!__pyx_t_3)) goto __pyx_L5_unpacking_failed;
+        __Pyx_GOTREF(__pyx_t_3);
+        if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_6), 2) < 0) __PYX_ERR(0, 639, __pyx_L1_error)
+        __pyx_t_9 = NULL;
+        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+        goto __pyx_L6_unpacking_done;
+        __pyx_L5_unpacking_failed:;
+        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+        __pyx_t_9 = NULL;
+        if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
+        __PYX_ERR(0, 639, __pyx_L1_error)
+        __pyx_L6_unpacking_done:;
+      }
+      __pyx_v_item = __pyx_t_2;
+      __pyx_t_2 = 0;
+      __pyx_v_putter = __pyx_t_3;
+      __pyx_t_3 = 0;
+
+640:                 self.hub.loop.run_callback(putter.switch, putter)
+
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->hub, __pyx_n_s_loop); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 640, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_3);
+      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_run_callback); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 640, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_2);
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_putter, __pyx_n_s_switch); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 640, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_3);
+      __pyx_t_6 = NULL;
+      __pyx_t_5 = 0;
+      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
+        if (likely(__pyx_t_6)) {
+          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+          __Pyx_INCREF(__pyx_t_6);
+          __Pyx_INCREF(function);
+          __Pyx_DECREF_SET(__pyx_t_2, function);
+          __pyx_t_5 = 1;
+        }
+      }
+      #if CYTHON_FAST_PYCALL
+      if (PyFunction_Check(__pyx_t_2)) {
+        PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_3, __pyx_v_putter};
+        __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 640, __pyx_L1_error)
+        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+        __Pyx_GOTREF(__pyx_t_1);
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+      } else
+      #endif
+      #if CYTHON_FAST_PYCCALL
+      if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
+        PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_3, __pyx_v_putter};
+        __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 640, __pyx_L1_error)
+        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+        __Pyx_GOTREF(__pyx_t_1);
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+      } else
+      #endif
+      {
+        __pyx_t_4 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 640, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_4);
+        if (__pyx_t_6) {
+          __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6); __pyx_t_6 = NULL;
+        }
+        __Pyx_GIVEREF(__pyx_t_3);
+        PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_5, __pyx_t_3);
+        __Pyx_INCREF(__pyx_v_putter);
+        __Pyx_GIVEREF(__pyx_v_putter);
+        PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_5, __pyx_v_putter);
+        __pyx_t_3 = 0;
+        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 640, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_1);
+        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      }
+      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+641:                 return item
+
      __Pyx_XDECREF(__pyx_r);
+      __Pyx_INCREF(__pyx_v_item);
+      __pyx_r = __pyx_v_item;
+      goto __pyx_L0;
+
 642: 
+
+643:         if not block:
+
  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_block); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 643, __pyx_L1_error)
+  __pyx_t_7 = ((!__pyx_t_8) != 0);
+  if (__pyx_t_7) {
+/* … */
+  }
+
+644:             timeout = 0
+
    __Pyx_INCREF(__pyx_int_0);
+    __Pyx_DECREF_SET(__pyx_v_timeout, __pyx_int_0);
+
 645: 
+
+646:         waiter = Waiter() # pylint:disable=undefined-variable
+
  __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_6gevent_8__waiter_Waiter)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 646, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_v_waiter = ((struct __pyx_obj_6gevent_8__waiter_Waiter *)__pyx_t_1);
+  __pyx_t_1 = 0;
+
+647:         timeout = Timeout._start_new_or_dummy(timeout, Empty)
+
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Timeout); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 647, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_start_new_or_dummy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 647, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_4);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 647, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = NULL;
+  __pyx_t_5 = 0;
+  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
+    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
+    if (likely(__pyx_t_3)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
+      __Pyx_INCREF(__pyx_t_3);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_4, function);
+      __pyx_t_5 = 1;
+    }
+  }
+  #if CYTHON_FAST_PYCALL
+  if (PyFunction_Check(__pyx_t_4)) {
+    PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_timeout, __pyx_t_2};
+    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 647, __pyx_L1_error)
+    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  } else
+  #endif
+  #if CYTHON_FAST_PYCCALL
+  if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
+    PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_timeout, __pyx_t_2};
+    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 647, __pyx_L1_error)
+    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  } else
+  #endif
+  {
+    __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 647, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_6);
+    if (__pyx_t_3) {
+      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); __pyx_t_3 = NULL;
+    }
+    __Pyx_INCREF(__pyx_v_timeout);
+    __Pyx_GIVEREF(__pyx_v_timeout);
+    PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_timeout);
+    __Pyx_GIVEREF(__pyx_t_2);
+    PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_t_2);
+    __pyx_t_2 = 0;
+    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 647, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  }
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __Pyx_DECREF_SET(__pyx_v_timeout, __pyx_t_1);
+  __pyx_t_1 = 0;
+
+648:         try:
+
  /*try:*/ {
+    {
+      /*try:*/ {
+/* … */
+      }
+      __pyx_L11_error:;
+      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+/* … */
+      __Pyx_XGIVEREF(__pyx_t_10);
+      __Pyx_XGIVEREF(__pyx_t_11);
+      __Pyx_XGIVEREF(__pyx_t_12);
+      __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
+      goto __pyx_L9_error;
+      __pyx_L15_try_return:;
+      __Pyx_XGIVEREF(__pyx_t_10);
+      __Pyx_XGIVEREF(__pyx_t_11);
+      __Pyx_XGIVEREF(__pyx_t_12);
+      __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
+      goto __pyx_L8_return;
+    }
+  }
+
+649:             self.getters.append(waiter)
+
        __pyx_t_13 = __Pyx_PyObject_Append(__pyx_v_self->getters, ((PyObject *)__pyx_v_waiter)); if (unlikely(__pyx_t_13 == ((int)-1))) __PYX_ERR(0, 649, __pyx_L11_error)
+
+650:             if self.putters:
+
        __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_self->putters); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 650, __pyx_L11_error)
+        if (__pyx_t_7) {
+/* … */
+        }
+
+651:                 self._schedule_unlock()
+
          __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_6_queue_Channel *)__pyx_v_self->__pyx_vtab)->_schedule_unlock(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 651, __pyx_L11_error)
+          __Pyx_GOTREF(__pyx_t_1);
+          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+652:             return waiter.get()
+
        __Pyx_XDECREF(__pyx_r);
+        __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_8__waiter_Waiter *)__pyx_v_waiter->__pyx_vtab)->get(__pyx_v_waiter, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 652, __pyx_L11_error)
+        __Pyx_GOTREF(__pyx_t_1);
+        __pyx_r = __pyx_t_1;
+        __pyx_t_1 = 0;
+        goto __pyx_L15_try_return;
+
+653:         except:
+
      /*except:*/ {
+        __Pyx_AddTraceback("gevent._queue.Channel.get", __pyx_clineno, __pyx_lineno, __pyx_filename);
+        if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_4, &__pyx_t_6) < 0) __PYX_ERR(0, 653, __pyx_L13_except_error)
+        __Pyx_GOTREF(__pyx_t_1);
+        __Pyx_GOTREF(__pyx_t_4);
+        __Pyx_GOTREF(__pyx_t_6);
+
+654:             self.getters.remove(waiter)
+
        __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->getters, __pyx_n_s_remove); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 654, __pyx_L13_except_error)
+        __Pyx_GOTREF(__pyx_t_3);
+        __pyx_t_14 = NULL;
+        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
+          __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_3);
+          if (likely(__pyx_t_14)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+            __Pyx_INCREF(__pyx_t_14);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_3, function);
+          }
+        }
+        __pyx_t_2 = (__pyx_t_14) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_14, ((PyObject *)__pyx_v_waiter)) : __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_waiter));
+        __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
+        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 654, __pyx_L13_except_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+655:             raise
+
        __Pyx_GIVEREF(__pyx_t_1);
+        __Pyx_GIVEREF(__pyx_t_4);
+        __Pyx_XGIVEREF(__pyx_t_6);
+        __Pyx_ErrRestoreWithState(__pyx_t_1, __pyx_t_4, __pyx_t_6);
+        __pyx_t_1 = 0; __pyx_t_4 = 0; __pyx_t_6 = 0; 
+        __PYX_ERR(0, 655, __pyx_L13_except_error)
+      }
+      __pyx_L13_except_error:;
+
 656:         finally:
+
+657:             timeout.close()
+
  /*finally:*/ {
+    __pyx_L9_error:;
+    /*exception exit:*/{
+      __Pyx_PyThreadState_declare
+      __Pyx_PyThreadState_assign
+      __pyx_t_12 = 0; __pyx_t_11 = 0; __pyx_t_10 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0;
+      __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
+      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+      if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19);
+      if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_12, &__pyx_t_11, &__pyx_t_10) < 0)) __Pyx_ErrFetch(&__pyx_t_12, &__pyx_t_11, &__pyx_t_10);
+      __Pyx_XGOTREF(__pyx_t_12);
+      __Pyx_XGOTREF(__pyx_t_11);
+      __Pyx_XGOTREF(__pyx_t_10);
+      __Pyx_XGOTREF(__pyx_t_17);
+      __Pyx_XGOTREF(__pyx_t_18);
+      __Pyx_XGOTREF(__pyx_t_19);
+      __pyx_t_5 = __pyx_lineno; __pyx_t_15 = __pyx_clineno; __pyx_t_16 = __pyx_filename;
+      {
+        __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_timeout, __pyx_n_s_close); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 657, __pyx_L21_error)
+        __Pyx_GOTREF(__pyx_t_4);
+        __pyx_t_1 = NULL;
+        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
+          __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4);
+          if (likely(__pyx_t_1)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
+            __Pyx_INCREF(__pyx_t_1);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_4, function);
+          }
+        }
+        __pyx_t_6 = (__pyx_t_1) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_1) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
+        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+        if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 657, __pyx_L21_error)
+        __Pyx_GOTREF(__pyx_t_6);
+        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+      }
+      if (PY_MAJOR_VERSION >= 3) {
+        __Pyx_XGIVEREF(__pyx_t_17);
+        __Pyx_XGIVEREF(__pyx_t_18);
+        __Pyx_XGIVEREF(__pyx_t_19);
+        __Pyx_ExceptionReset(__pyx_t_17, __pyx_t_18, __pyx_t_19);
+      }
+      __Pyx_XGIVEREF(__pyx_t_12);
+      __Pyx_XGIVEREF(__pyx_t_11);
+      __Pyx_XGIVEREF(__pyx_t_10);
+      __Pyx_ErrRestore(__pyx_t_12, __pyx_t_11, __pyx_t_10);
+      __pyx_t_12 = 0; __pyx_t_11 = 0; __pyx_t_10 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0;
+      __pyx_lineno = __pyx_t_5; __pyx_clineno = __pyx_t_15; __pyx_filename = __pyx_t_16;
+      goto __pyx_L1_error;
+      __pyx_L21_error:;
+      if (PY_MAJOR_VERSION >= 3) {
+        __Pyx_XGIVEREF(__pyx_t_17);
+        __Pyx_XGIVEREF(__pyx_t_18);
+        __Pyx_XGIVEREF(__pyx_t_19);
+        __Pyx_ExceptionReset(__pyx_t_17, __pyx_t_18, __pyx_t_19);
+      }
+      __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
+      __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
+      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
+      __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0;
+      goto __pyx_L1_error;
+    }
+    __pyx_L8_return: {
+      __pyx_t_19 = __pyx_r;
+      __pyx_r = 0;
+      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_timeout, __pyx_n_s_close); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 657, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_4);
+      __pyx_t_1 = NULL;
+      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
+        __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4);
+        if (likely(__pyx_t_1)) {
+          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
+          __Pyx_INCREF(__pyx_t_1);
+          __Pyx_INCREF(function);
+          __Pyx_DECREF_SET(__pyx_t_4, function);
+        }
+      }
+      __pyx_t_6 = (__pyx_t_1) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_1) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
+      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+      if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 657, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_6);
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+      __pyx_r = __pyx_t_19;
+      __pyx_t_19 = 0;
+      goto __pyx_L0;
+    }
+  }
+
 658: 
+
+659:     def get_nowait(self):
+
static PyObject *__pyx_pw_6gevent_6_queue_7Channel_21get_nowait(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyObject *__pyx_f_6gevent_6_queue_7Channel_get_nowait(struct __pyx_obj_6gevent_6_queue_Channel *__pyx_v_self, int __pyx_skip_dispatch) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("get_nowait", 0);
+  /* Check if called by wrapper */
+  if (unlikely(__pyx_skip_dispatch)) ;
+  /* Check if overridden in Python */
+  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
+    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
+    if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
+    else {
+      PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      #endif
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_nowait); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 659, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_6_queue_7Channel_21get_nowait)) {
+        __Pyx_XDECREF(__pyx_r);
+        __Pyx_INCREF(__pyx_t_1);
+        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+          if (likely(__pyx_t_4)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+            __Pyx_INCREF(__pyx_t_4);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_3, function);
+          }
+        }
+        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
+        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 659, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __pyx_r = __pyx_t_2;
+        __pyx_t_2 = 0;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        goto __pyx_L0;
+      }
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+      tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
+      if (unlikely(type_dict_guard != tp_dict_version)) {
+        tp_dict_version = obj_dict_version = 0;
+      }
+      #endif
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    }
+    #endif
+  }
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_AddTraceback("gevent._queue.Channel.get_nowait", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_queue_7Channel_21get_nowait(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6gevent_6_queue_7Channel_20get_nowait[] = "Channel.get_nowait(self)";
+static PyMethodDef __pyx_mdef_6gevent_6_queue_7Channel_21get_nowait = {"get_nowait", (PyCFunction)__pyx_pw_6gevent_6_queue_7Channel_21get_nowait, METH_NOARGS, __pyx_doc_6gevent_6_queue_7Channel_20get_nowait};
+static PyObject *__pyx_pw_6gevent_6_queue_7Channel_21get_nowait(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("get_nowait (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_6_queue_7Channel_20get_nowait(((struct __pyx_obj_6gevent_6_queue_Channel *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_queue_7Channel_20get_nowait(struct __pyx_obj_6gevent_6_queue_Channel *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("get_nowait", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __pyx_f_6gevent_6_queue_7Channel_get_nowait(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 659, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent._queue.Channel.get_nowait", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__85 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__85)) __PYX_ERR(0, 659, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__85);
+  __Pyx_GIVEREF(__pyx_tuple__85);
+/* … */
+  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_queue_7Channel_21get_nowait, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Channel_get_nowait, NULL, __pyx_n_s_gevent__queue, __pyx_d, ((PyObject *)__pyx_codeobj__86)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 659, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_Channel->tp_dict, __pyx_n_s_get_nowait, __pyx_t_6) < 0) __PYX_ERR(0, 659, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_6_queue_Channel);
+  __pyx_codeobj__86 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__85, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_queue_py, __pyx_n_s_get_nowait, 659, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__86)) __PYX_ERR(0, 659, __pyx_L1_error)
+
+660:         return self.get(False)
+
  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_5.__pyx_n = 1;
+  __pyx_t_5.block = Py_False;
+  __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_6_queue_Channel *)__pyx_v_self->__pyx_vtab)->get(__pyx_v_self, 0, &__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 660, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
 661: 
+
+662:     def _unlock(self):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_queue_7Channel_23_unlock(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6gevent_6_queue_7Channel_22_unlock[] = "Channel._unlock(self)";
+static PyMethodDef __pyx_mdef_6gevent_6_queue_7Channel_23_unlock = {"_unlock", (PyCFunction)__pyx_pw_6gevent_6_queue_7Channel_23_unlock, METH_NOARGS, __pyx_doc_6gevent_6_queue_7Channel_22_unlock};
+static PyObject *__pyx_pw_6gevent_6_queue_7Channel_23_unlock(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_unlock (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_6_queue_7Channel_22_unlock(((struct __pyx_obj_6gevent_6_queue_Channel *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_queue_7Channel_22_unlock(struct __pyx_obj_6gevent_6_queue_Channel *__pyx_v_self) {
+  PyObject *__pyx_v_getter = NULL;
+  PyObject *__pyx_v_item = NULL;
+  PyObject *__pyx_v_putter = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_unlock", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_XDECREF(__pyx_t_6);
+  __Pyx_AddTraceback("gevent._queue.Channel._unlock", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_getter);
+  __Pyx_XDECREF(__pyx_v_item);
+  __Pyx_XDECREF(__pyx_v_putter);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__87 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_getter, __pyx_n_s_item, __pyx_n_s_putter); if (unlikely(!__pyx_tuple__87)) __PYX_ERR(0, 662, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__87);
+  __Pyx_GIVEREF(__pyx_tuple__87);
+/* … */
+  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_queue_7Channel_23_unlock, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Channel__unlock, NULL, __pyx_n_s_gevent__queue, __pyx_d, ((PyObject *)__pyx_codeobj__88)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 662, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_Channel->tp_dict, __pyx_n_s_unlock, __pyx_t_6) < 0) __PYX_ERR(0, 662, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_6_queue_Channel);
+
+663:         while self.putters and self.getters:
+
  while (1) {
+    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_self->putters); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 663, __pyx_L1_error)
+    if (__pyx_t_2) {
+    } else {
+      __pyx_t_1 = __pyx_t_2;
+      goto __pyx_L5_bool_binop_done;
+    }
+    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_self->getters); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 663, __pyx_L1_error)
+    __pyx_t_1 = __pyx_t_2;
+    __pyx_L5_bool_binop_done:;
+    if (!__pyx_t_1) break;
+
+664:             getter = self.getters.popleft()
+
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->getters, __pyx_n_s_popleft); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 664, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    __pyx_t_5 = NULL;
+    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
+      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
+      if (likely(__pyx_t_5)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
+        __Pyx_INCREF(__pyx_t_5);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_4, function);
+      }
+    }
+    __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
+    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 664, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __Pyx_XDECREF_SET(__pyx_v_getter, __pyx_t_3);
+    __pyx_t_3 = 0;
+
+665:             item, putter = self.putters.popleft()
+
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->putters, __pyx_n_s_popleft); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 665, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    __pyx_t_5 = NULL;
+    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
+      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
+      if (likely(__pyx_t_5)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
+        __Pyx_INCREF(__pyx_t_5);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_4, function);
+      }
+    }
+    __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
+    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 665, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
+      PyObject* sequence = __pyx_t_3;
+      Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
+      if (unlikely(size != 2)) {
+        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
+        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
+        __PYX_ERR(0, 665, __pyx_L1_error)
+      }
+      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+      if (likely(PyTuple_CheckExact(sequence))) {
+        __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); 
+        __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); 
+      } else {
+        __pyx_t_4 = PyList_GET_ITEM(sequence, 0); 
+        __pyx_t_5 = PyList_GET_ITEM(sequence, 1); 
+      }
+      __Pyx_INCREF(__pyx_t_4);
+      __Pyx_INCREF(__pyx_t_5);
+      #else
+      __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 665, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_4);
+      __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 665, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_5);
+      #endif
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    } else {
+      Py_ssize_t index = -1;
+      __pyx_t_6 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 665, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_6);
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __pyx_t_7 = Py_TYPE(__pyx_t_6)->tp_iternext;
+      index = 0; __pyx_t_4 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_4)) goto __pyx_L7_unpacking_failed;
+      __Pyx_GOTREF(__pyx_t_4);
+      index = 1; __pyx_t_5 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_5)) goto __pyx_L7_unpacking_failed;
+      __Pyx_GOTREF(__pyx_t_5);
+      if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 2) < 0) __PYX_ERR(0, 665, __pyx_L1_error)
+      __pyx_t_7 = NULL;
+      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+      goto __pyx_L8_unpacking_done;
+      __pyx_L7_unpacking_failed:;
+      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+      __pyx_t_7 = NULL;
+      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
+      __PYX_ERR(0, 665, __pyx_L1_error)
+      __pyx_L8_unpacking_done:;
+    }
+    __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_4);
+    __pyx_t_4 = 0;
+    __Pyx_XDECREF_SET(__pyx_v_putter, __pyx_t_5);
+    __pyx_t_5 = 0;
+
+666:             getter.switch(item)
+
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_getter, __pyx_n_s_switch); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 666, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_5);
+    __pyx_t_4 = NULL;
+    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
+      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
+      if (likely(__pyx_t_4)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
+        __Pyx_INCREF(__pyx_t_4);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_5, function);
+      }
+    }
+    __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_4, __pyx_v_item) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_item);
+    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 666, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+
+667:             putter.switch(putter)
+
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_putter, __pyx_n_s_switch); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 667, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_5);
+    __pyx_t_4 = NULL;
+    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
+      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
+      if (likely(__pyx_t_4)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
+        __Pyx_INCREF(__pyx_t_4);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_5, function);
+      }
+    }
+    __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_4, __pyx_v_putter) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_putter);
+    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 667, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  }
+
 668: 
+
+669:     def _schedule_unlock(self):
+
static PyObject *__pyx_f_6gevent_6_queue_7Channel__schedule_unlock(struct __pyx_obj_6gevent_6_queue_Channel *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_schedule_unlock", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_XDECREF(__pyx_t_6);
+  __Pyx_AddTraceback("gevent._queue.Channel._schedule_unlock", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+670:         if not self._event_unlock:
+
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_self->_event_unlock); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 670, __pyx_L1_error)
+  __pyx_t_2 = ((!__pyx_t_1) != 0);
+  if (__pyx_t_2) {
+/* … */
+  }
+
+671:             self._event_unlock = self.hub.loop.run_callback(self._unlock)
+
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->hub, __pyx_n_s_loop); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 671, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_run_callback); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 671, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_5);
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_unlock); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 671, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    __pyx_t_6 = NULL;
+    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
+      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
+      if (likely(__pyx_t_6)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
+        __Pyx_INCREF(__pyx_t_6);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_5, function);
+      }
+    }
+    __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4);
+    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 671, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __Pyx_GIVEREF(__pyx_t_3);
+    __Pyx_GOTREF(__pyx_v_self->_event_unlock);
+    __Pyx_DECREF(__pyx_v_self->_event_unlock);
+    __pyx_v_self->_event_unlock = __pyx_t_3;
+    __pyx_t_3 = 0;
+
 672: 
+
+673:     def __iter__(self):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_queue_7Channel_25__iter__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_6_queue_7Channel_25__iter__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_6_queue_7Channel_24__iter__(((struct __pyx_obj_6gevent_6_queue_Channel *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_queue_7Channel_24__iter__(struct __pyx_obj_6gevent_6_queue_Channel *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__iter__", 0);
+/* … */
+  /* function exit code */
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+674:         return self
+
  __Pyx_XDECREF(__pyx_r);
+  __Pyx_INCREF(((PyObject *)__pyx_v_self));
+  __pyx_r = ((PyObject *)__pyx_v_self);
+  goto __pyx_L0;
+
 675: 
+
+676:     def __next__(self):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_queue_7Channel_27__next__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_6_queue_7Channel_27__next__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__next__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_6_queue_7Channel_26__next__(((struct __pyx_obj_6gevent_6_queue_Channel *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_queue_7Channel_26__next__(struct __pyx_obj_6gevent_6_queue_Channel *__pyx_v_self) {
+  PyObject *__pyx_v_result = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__next__", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent._queue.Channel.__next__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_result);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+677:         result = self.get()
+
  __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_6_queue_Channel *)__pyx_v_self->__pyx_vtab)->get(__pyx_v_self, 0, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 677, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_v_result = __pyx_t_1;
+  __pyx_t_1 = 0;
+
+678:         if result is StopIteration:
+
  __pyx_t_2 = (__pyx_v_result == __pyx_builtin_StopIteration);
+  __pyx_t_3 = (__pyx_t_2 != 0);
+  if (unlikely(__pyx_t_3)) {
+/* … */
+  }
+
+679:             raise result
+
    __Pyx_Raise(__pyx_v_result, 0, 0, 0);
+    __PYX_ERR(0, 679, __pyx_L1_error)
+
+680:         return result
+
  __Pyx_XDECREF(__pyx_r);
+  __Pyx_INCREF(__pyx_v_result);
+  __pyx_r = __pyx_v_result;
+  goto __pyx_L0;
+
 681: 
+
+682:     next = __next__ # Py2
+
  __Pyx_GetNameInClass(__pyx_t_6, (PyObject *)__pyx_ptype_6gevent_6_queue_Channel, __pyx_n_s_next); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 682, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_Channel->tp_dict, __pyx_n_s_next_2, __pyx_t_6) < 0) __PYX_ERR(0, 682, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_6_queue_Channel);
+
 683: 
+
+684: from gevent._util import import_c_accel
+
  __pyx_t_6 = PyList_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 684, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  __Pyx_INCREF(__pyx_n_s_import_c_accel);
+  __Pyx_GIVEREF(__pyx_n_s_import_c_accel);
+  PyList_SET_ITEM(__pyx_t_6, 0, __pyx_n_s_import_c_accel);
+  __pyx_t_1 = __Pyx_Import(__pyx_n_s_gevent__util, __pyx_t_6, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 684, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  __pyx_t_6 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_import_c_accel); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 684, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_import_c_accel, __pyx_t_6) < 0) __PYX_ERR(0, 684, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+685: import_c_accel(globals(), 'gevent._queue')
+
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_import_c_accel); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 685, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_6 = __Pyx_Globals(); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 685, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 685, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_GIVEREF(__pyx_t_6);
+  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_6);
+  __Pyx_INCREF(__pyx_n_s_gevent__queue);
+  __Pyx_GIVEREF(__pyx_n_s_gevent__queue);
+  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_gevent__queue);
+  __pyx_t_6 = 0;
+  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 685, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+
diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/queue.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/queue.py new file mode 100644 index 00000000..57b937b1 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/queue.py @@ -0,0 +1,685 @@ +# Copyright (c) 2009-2012 Denis Bilenko. See LICENSE for details. +# copyright (c) 2018 gevent +# cython: auto_pickle=False,embedsignature=True,always_allow_keywords=False +""" +Synchronized queues. + +The :mod:`gevent.queue` module implements multi-producer, multi-consumer queues +that work across greenlets, with the API similar to the classes found in the +standard :mod:`Queue` and :class:`multiprocessing ` modules. + +The classes in this module implement the iterator protocol. Iterating +over a queue means repeatedly calling :meth:`get ` until +:meth:`get ` returns ``StopIteration`` (specifically that +class, not an instance or subclass). + + >>> queue = gevent.queue.Queue() + >>> queue.put(1) + >>> queue.put(2) + >>> queue.put(StopIteration) + >>> for item in queue: + ... print(item) + 1 + 2 + +.. versionchanged:: 1.0 + ``Queue(0)`` now means queue of infinite size, not a channel. A :exc:`DeprecationWarning` + will be issued with this argument. +""" + +from __future__ import absolute_import +import sys +from heapq import heappush as _heappush +from heapq import heappop as _heappop +from heapq import heapify as _heapify +import collections + +if sys.version_info[0] == 2: + import Queue as __queue__ # python 3: pylint:disable=import-error +else: + import queue as __queue__ # python 2: pylint:disable=import-error +Full = __queue__.Full +Empty = __queue__.Empty + +from gevent.timeout import Timeout +from gevent._hub_local import get_hub_noargs as get_hub +from greenlet import getcurrent +from gevent.exceptions import InvalidSwitchError + +__all__ = [] +__implements__ = ['Queue', 'PriorityQueue', 'LifoQueue'] +__extensions__ = ['JoinableQueue', 'Channel'] +__imports__ = ['Empty', 'Full'] +if hasattr(__queue__, 'SimpleQueue'): + __all__.append('SimpleQueue') # New in 3.7 + # SimpleQueue is implemented in C and directly allocates locks + # unaffected by monkey patching. We need the Python version. + SimpleQueue = __queue__._PySimpleQueue # pylint:disable=no-member +__all__ += (__implements__ + __extensions__ + __imports__) + + +# pylint 2.0.dev2 things collections.dequeue.popleft() doesn't return +# pylint:disable=assignment-from-no-return + +def _safe_remove(deq, item): + # For when the item may have been removed by + # Queue._unlock + try: + deq.remove(item) + except ValueError: + pass + +import gevent._waiter +locals()['Waiter'] = gevent._waiter.Waiter + +class ItemWaiter(Waiter): # pylint:disable=undefined-variable + # pylint:disable=assigning-non-slot + __slots__ = ( + 'item', + 'queue', + ) + + def __init__(self, item, queue): + Waiter.__init__(self) # pylint:disable=undefined-variable + self.item = item + self.queue = queue + + def put_and_switch(self): + self.queue._put(self.item) + self.queue = None + self.item = None + return self.switch(self) + +class Queue(object): + """ + Create a queue object with a given maximum size. + + If *maxsize* is less than or equal to zero or ``None``, the queue + size is infinite. + + Queues have a ``len`` equal to the number of items in them (the :meth:`qsize`), + but in a boolean context they are always True. + + .. versionchanged:: 1.1b3 + Queues now support :func:`len`; it behaves the same as :meth:`qsize`. + .. versionchanged:: 1.1b3 + Multiple greenlets that block on a call to :meth:`put` for a full queue + will now be awakened to put their items into the queue in the order in which + they arrived. Likewise, multiple greenlets that block on a call to :meth:`get` for + an empty queue will now receive items in the order in which they blocked. An + implementation quirk under CPython *usually* ensured this was roughly the case + previously anyway, but that wasn't the case for PyPy. + """ + + __slots__ = ( + '_maxsize', + 'getters', + 'putters', + 'hub', + '_event_unlock', + 'queue', + '__weakref__', + ) + + def __init__(self, maxsize=None, items=(), _warn_depth=2): + if maxsize is not None and maxsize <= 0: + if maxsize == 0: + import warnings + warnings.warn( + 'Queue(0) now equivalent to Queue(None); if you want a channel, use Channel', + DeprecationWarning, + stacklevel=_warn_depth) + maxsize = None + + self._maxsize = maxsize if maxsize is not None else -1 + # Explicitly maintain order for getters and putters that block + # so that callers can consistently rely on getting things out + # in the apparent order they went in. This was once required by + # imap_unordered. Previously these were set() objects, and the + # items put in the set have default hash() and eq() methods; + # under CPython, since new objects tend to have increasing + # hash values, this tended to roughly maintain order anyway, + # but that's not true under PyPy. An alternative to a deque + # (to avoid the linear scan of remove()) might be an + # OrderedDict, but it's 2.7 only; we don't expect to have so + # many waiters that removing an arbitrary element is a + # bottleneck, though. + self.getters = collections.deque() + self.putters = collections.deque() + self.hub = get_hub() + self._event_unlock = None + self.queue = self._create_queue(items) + + @property + def maxsize(self): + return self._maxsize if self._maxsize > 0 else None + + @maxsize.setter + def maxsize(self, nv): + # QQQ make maxsize into a property with setter that schedules unlock if necessary + if nv is None or nv <= 0: + self._maxsize = -1 + else: + self._maxsize = nv + + def copy(self): + return type(self)(self.maxsize, self.queue) + + def _create_queue(self, items=()): + return collections.deque(items) + + def _get(self): + return self.queue.popleft() + + def _peek(self): + return self.queue[0] + + def _put(self, item): + self.queue.append(item) + + def __repr__(self): + return '<%s at %s%s>' % (type(self).__name__, hex(id(self)), self._format()) + + def __str__(self): + return '<%s%s>' % (type(self).__name__, self._format()) + + def _format(self): + result = [] + if self.maxsize is not None: + result.append('maxsize=%r' % (self.maxsize, )) + if getattr(self, 'queue', None): + result.append('queue=%r' % (self.queue, )) + if self.getters: + result.append('getters[%s]' % len(self.getters)) + if self.putters: + result.append('putters[%s]' % len(self.putters)) + if result: + return ' ' + ' '.join(result) + return '' + + def qsize(self): + """Return the size of the queue.""" + return len(self.queue) + + def __len__(self): + """ + Return the size of the queue. This is the same as :meth:`qsize`. + + .. versionadded: 1.1b3 + + Previously, getting len() of a queue would raise a TypeError. + """ + + return self.qsize() + + def __bool__(self): + """ + A queue object is always True. + + .. versionadded: 1.1b3 + + Now that queues support len(), they need to implement ``__bool__`` + to return True for backwards compatibility. + """ + return True + + def __nonzero__(self): + # Py2. + # For Cython; __bool__ becomes a special method that we can't + # get by name. + return True + + def empty(self): + """Return ``True`` if the queue is empty, ``False`` otherwise.""" + return not self.qsize() + + def full(self): + """Return ``True`` if the queue is full, ``False`` otherwise. + + ``Queue(None)`` is never full. + """ + return self._maxsize > 0 and self.qsize() >= self._maxsize + + def put(self, item, block=True, timeout=None): + """Put an item into the queue. + + If optional arg *block* is true and *timeout* is ``None`` (the default), + block if necessary until a free slot is available. If *timeout* is + a positive number, it blocks at most *timeout* seconds and raises + the :class:`Full` exception if no free slot was available within that time. + Otherwise (*block* is false), put an item on the queue if a free slot + is immediately available, else raise the :class:`Full` exception (*timeout* + is ignored in that case). + """ + if self._maxsize == -1 or self.qsize() < self._maxsize: + # there's a free slot, put an item right away + self._put(item) + if self.getters: + self._schedule_unlock() + elif self.hub is getcurrent(): + # We're in the mainloop, so we cannot wait; we can switch to other greenlets though. + # Check if possible to get a free slot in the queue. + while self.getters and self.qsize() and self.qsize() >= self._maxsize: + getter = self.getters.popleft() + getter.switch(getter) + if self.qsize() < self._maxsize: + self._put(item) + return + raise Full + elif block: + waiter = ItemWaiter(item, self) + self.putters.append(waiter) + timeout = Timeout._start_new_or_dummy(timeout, Full) + try: + if self.getters: + self._schedule_unlock() + result = waiter.get() + if result is not waiter: + raise InvalidSwitchError("Invalid switch into Queue.put: %r" % (result, )) + finally: + timeout.cancel() + _safe_remove(self.putters, waiter) + else: + raise Full + + def put_nowait(self, item): + """Put an item into the queue without blocking. + + Only enqueue the item if a free slot is immediately available. + Otherwise raise the :class:`Full` exception. + """ + self.put(item, False) + + def __get_or_peek(self, method, block, timeout): + # Internal helper method. The `method` should be either + # self._get when called from self.get() or self._peek when + # called from self.peek(). Call this after the initial check + # to see if there are items in the queue. + + if self.hub is getcurrent(): + # special case to make get_nowait() or peek_nowait() runnable in the mainloop greenlet + # there are no items in the queue; try to fix the situation by unlocking putters + while self.putters: + # Note: get() used popleft(), peek used pop(); popleft + # is almost certainly correct. + self.putters.popleft().put_and_switch() + if self.qsize(): + return method() + raise Empty() + + if not block: + # We can't block, we're not the hub, and we have nothing + # to return. No choice... + raise Empty() + + waiter = Waiter() # pylint:disable=undefined-variable + timeout = Timeout._start_new_or_dummy(timeout, Empty) + try: + self.getters.append(waiter) + if self.putters: + self._schedule_unlock() + result = waiter.get() + if result is not waiter: + raise InvalidSwitchError('Invalid switch into Queue.get: %r' % (result, )) + return method() + finally: + timeout.cancel() + _safe_remove(self.getters, waiter) + + def get(self, block=True, timeout=None): + """Remove and return an item from the queue. + + If optional args *block* is true and *timeout* is ``None`` (the default), + block if necessary until an item is available. If *timeout* is a positive number, + it blocks at most *timeout* seconds and raises the :class:`Empty` exception + if no item was available within that time. Otherwise (*block* is false), return + an item if one is immediately available, else raise the :class:`Empty` exception + (*timeout* is ignored in that case). + """ + if self.qsize(): + if self.putters: + self._schedule_unlock() + return self._get() + + return self.__get_or_peek(self._get, block, timeout) + + def get_nowait(self): + """Remove and return an item from the queue without blocking. + + Only get an item if one is immediately available. Otherwise + raise the :class:`Empty` exception. + """ + return self.get(False) + + def peek(self, block=True, timeout=None): + """Return an item from the queue without removing it. + + If optional args *block* is true and *timeout* is ``None`` (the default), + block if necessary until an item is available. If *timeout* is a positive number, + it blocks at most *timeout* seconds and raises the :class:`Empty` exception + if no item was available within that time. Otherwise (*block* is false), return + an item if one is immediately available, else raise the :class:`Empty` exception + (*timeout* is ignored in that case). + """ + if self.qsize(): + # XXX: Why doesn't this schedule an unlock like get() does? + return self._peek() + + return self.__get_or_peek(self._peek, block, timeout) + + def peek_nowait(self): + """Return an item from the queue without blocking. + + Only return an item if one is immediately available. Otherwise + raise the :class:`Empty` exception. + """ + return self.peek(False) + + def _unlock(self): + while True: + repeat = False + if self.putters and (self._maxsize == -1 or self.qsize() < self._maxsize): + repeat = True + try: + putter = self.putters.popleft() + self._put(putter.item) + except: # pylint:disable=bare-except + putter.throw(*sys.exc_info()) + else: + putter.switch(putter) + if self.getters and self.qsize(): + repeat = True + getter = self.getters.popleft() + getter.switch(getter) + if not repeat: + return + + def _schedule_unlock(self): + if not self._event_unlock: + self._event_unlock = self.hub.loop.run_callback(self._unlock) + + def __iter__(self): + return self + + def __next__(self): + result = self.get() + if result is StopIteration: + raise result + return result + + next = __next__ # Py2 + + +class UnboundQueue(Queue): + # A specialization of Queue that knows it can never + # be bound. Changing its maxsize has no effect. + + __slots__ = () + + def __init__(self, maxsize=None, items=()): + if maxsize is not None: + raise ValueError("UnboundQueue has no maxsize") + Queue.__init__(self, maxsize, items) + self.putters = None # Will never be used. + + def put(self, item, block=True, timeout=None): + self._put(item) + if self.getters: + self._schedule_unlock() + + +class PriorityQueue(Queue): + '''A subclass of :class:`Queue` that retrieves entries in priority order (lowest first). + + Entries are typically tuples of the form: ``(priority number, data)``. + + .. versionchanged:: 1.2a1 + Any *items* given to the constructor will now be passed through + :func:`heapq.heapify` to ensure the invariants of this class hold. + Previously it was just assumed that they were already a heap. + ''' + + __slots__ = () + + def _create_queue(self, items=()): + q = list(items) + _heapify(q) + return q + + def _put(self, item): + _heappush(self.queue, item) + + def _get(self): + return _heappop(self.queue) + + +class LifoQueue(Queue): + '''A subclass of :class:`Queue` that retrieves most recently added entries first.''' + + __slots__ = () + + def _create_queue(self, items=()): + return list(items) + + def _put(self, item): + self.queue.append(item) + + def _get(self): + return self.queue.pop() + + def _peek(self): + return self.queue[-1] + + +class JoinableQueue(Queue): + """ + A subclass of :class:`Queue` that additionally has + :meth:`task_done` and :meth:`join` methods. + """ + + __slots__ = ( + '_cond', + 'unfinished_tasks', + ) + + def __init__(self, maxsize=None, items=(), unfinished_tasks=None): + """ + + .. versionchanged:: 1.1a1 + If *unfinished_tasks* is not given, then all the given *items* + (if any) will be considered unfinished. + + """ + Queue.__init__(self, maxsize, items, _warn_depth=3) + + from gevent.event import Event + self._cond = Event() + self._cond.set() + + if unfinished_tasks: + self.unfinished_tasks = unfinished_tasks + elif items: + self.unfinished_tasks = len(items) + else: + self.unfinished_tasks = 0 + + if self.unfinished_tasks: + self._cond.clear() + + def copy(self): + return type(self)(self.maxsize, self.queue, self.unfinished_tasks) + + def _format(self): + result = Queue._format(self) + if self.unfinished_tasks: + result += ' tasks=%s _cond=%s' % (self.unfinished_tasks, self._cond) + return result + + def _put(self, item): + Queue._put(self, item) + self.unfinished_tasks += 1 + self._cond.clear() + + def task_done(self): + '''Indicate that a formerly enqueued task is complete. Used by queue consumer threads. + For each :meth:`get ` used to fetch a task, a subsequent call to :meth:`task_done` tells the queue + that the processing on the task is complete. + + If a :meth:`join` is currently blocking, it will resume when all items have been processed + (meaning that a :meth:`task_done` call was received for every item that had been + :meth:`put ` into the queue). + + Raises a :exc:`ValueError` if called more times than there were items placed in the queue. + ''' + if self.unfinished_tasks <= 0: + raise ValueError('task_done() called too many times') + self.unfinished_tasks -= 1 + if self.unfinished_tasks == 0: + self._cond.set() + + def join(self, timeout=None): + ''' + Block until all items in the queue have been gotten and processed. + + The count of unfinished tasks goes up whenever an item is added to the queue. + The count goes down whenever a consumer thread calls :meth:`task_done` to indicate + that the item was retrieved and all work on it is complete. When the count of + unfinished tasks drops to zero, :meth:`join` unblocks. + + :param float timeout: If not ``None``, then wait no more than this time in seconds + for all tasks to finish. + :return: ``True`` if all tasks have finished; if ``timeout`` was given and expired before + all tasks finished, ``False``. + + .. versionchanged:: 1.1a1 + Add the *timeout* parameter. + ''' + return self._cond.wait(timeout=timeout) + + +class Channel(object): + + __slots__ = ( + 'getters', + 'putters', + 'hub', + '_event_unlock', + '__weakref__', + ) + + def __init__(self, maxsize=1): + # We take maxsize to simplify certain kinds of code + if maxsize != 1: + raise ValueError("Channels have a maxsize of 1") + self.getters = collections.deque() + self.putters = collections.deque() + self.hub = get_hub() + self._event_unlock = None + + def __repr__(self): + return '<%s at %s %s>' % (type(self).__name__, hex(id(self)), self._format()) + + def __str__(self): + return '<%s %s>' % (type(self).__name__, self._format()) + + def _format(self): + result = '' + if self.getters: + result += ' getters[%s]' % len(self.getters) + if self.putters: + result += ' putters[%s]' % len(self.putters) + return result + + @property + def balance(self): + return len(self.putters) - len(self.getters) + + def qsize(self): + return 0 + + def empty(self): + return True + + def full(self): + return True + + def put(self, item, block=True, timeout=None): + if self.hub is getcurrent(): + if self.getters: + getter = self.getters.popleft() + getter.switch(item) + return + raise Full + + if not block: + timeout = 0 + + waiter = Waiter() # pylint:disable=undefined-variable + item = (item, waiter) + self.putters.append(item) + timeout = Timeout._start_new_or_dummy(timeout, Full) + try: + if self.getters: + self._schedule_unlock() + result = waiter.get() + if result is not waiter: + raise InvalidSwitchError("Invalid switch into Channel.put: %r" % (result, )) + except: + _safe_remove(self.putters, item) + raise + finally: + timeout.cancel() + + def put_nowait(self, item): + self.put(item, False) + + def get(self, block=True, timeout=None): + if self.hub is getcurrent(): + if self.putters: + item, putter = self.putters.popleft() + self.hub.loop.run_callback(putter.switch, putter) + return item + + if not block: + timeout = 0 + + waiter = Waiter() # pylint:disable=undefined-variable + timeout = Timeout._start_new_or_dummy(timeout, Empty) + try: + self.getters.append(waiter) + if self.putters: + self._schedule_unlock() + return waiter.get() + except: + self.getters.remove(waiter) + raise + finally: + timeout.close() + + def get_nowait(self): + return self.get(False) + + def _unlock(self): + while self.putters and self.getters: + getter = self.getters.popleft() + item, putter = self.putters.popleft() + getter.switch(item) + putter.switch(putter) + + def _schedule_unlock(self): + if not self._event_unlock: + self._event_unlock = self.hub.loop.run_callback(self._unlock) + + def __iter__(self): + return self + + def __next__(self): + result = self.get() + if result is StopIteration: + raise result + return result + + next = __next__ # Py2 + +from gevent._util import import_c_accel +import_c_accel(globals(), 'gevent._queue') diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/resolver/__init__.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/resolver/__init__.py new file mode 100644 index 00000000..bffa292f --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/resolver/__init__.py @@ -0,0 +1,105 @@ +# Copyright (c) 2018 gevent contributors. See LICENSE for details. + +from _socket import gaierror +from _socket import error +from _socket import getservbyname +from _socket import getaddrinfo +from _socket import SOCK_STREAM +from _socket import SOCK_DGRAM +from _socket import SOL_TCP +from _socket import AI_CANONNAME +from _socket import EAI_SERVICE +from _socket import AF_INET +from _socket import AI_PASSIVE + + +from gevent._compat import string_types +from gevent._compat import integer_types + +# Nothing public here. +__all__ = [] + +def _lookup_port(port, socktype): + # pylint:disable=too-many-branches + socktypes = [] + if isinstance(port, string_types): + try: + port = int(port) + except ValueError: + try: + if socktype == 0: + origport = port + try: + port = getservbyname(port, 'tcp') + socktypes.append(SOCK_STREAM) + except error: + port = getservbyname(port, 'udp') + socktypes.append(SOCK_DGRAM) + else: + try: + if port == getservbyname(origport, 'udp'): + socktypes.append(SOCK_DGRAM) + except error: + pass + elif socktype == SOCK_STREAM: + port = getservbyname(port, 'tcp') + elif socktype == SOCK_DGRAM: + port = getservbyname(port, 'udp') + else: + raise gaierror(EAI_SERVICE, 'Servname not supported for ai_socktype') + except error as ex: + if 'not found' in str(ex): + raise gaierror(EAI_SERVICE, 'Servname not supported for ai_socktype') + else: + raise gaierror(str(ex)) + except UnicodeEncodeError: + raise error('Int or String expected', port) + elif port is None: + port = 0 + elif isinstance(port, integer_types): + pass + else: + raise error('Int or String expected', port, type(port)) + port = int(port % 65536) + if not socktypes and socktype: + socktypes.append(socktype) + return port, socktypes + +hostname_types = tuple(set(string_types + (bytearray, bytes))) + +def _resolve_special(hostname, family): + if not isinstance(hostname, hostname_types): + raise TypeError("argument 1 must be str, bytes or bytearray, not %s" % (type(hostname),)) + + if hostname == '': + result = getaddrinfo(None, 0, family, SOCK_DGRAM, 0, AI_PASSIVE) + if len(result) != 1: + raise error('wildcard resolved to multiple address') + return result[0][4][0] + return hostname + + +class AbstractResolver(object): + + def gethostbyname(self, hostname, family=AF_INET): + hostname = _resolve_special(hostname, family) + return self.gethostbyname_ex(hostname, family)[-1][0] + + def gethostbyname_ex(self, hostname, family=AF_INET): + aliases = self._getaliases(hostname, family) + addresses = [] + tuples = self.getaddrinfo(hostname, 0, family, + SOCK_STREAM, + SOL_TCP, AI_CANONNAME) + canonical = tuples[0][3] + for item in tuples: + addresses.append(item[4][0]) + # XXX we just ignore aliases + return (canonical, aliases, addresses) + + def getaddrinfo(self, host, port, family=0, socktype=0, proto=0, flags=0): + raise NotImplementedError() + + def _getaliases(self, hostname, family): + # pylint:disable=unused-argument + return [] diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/resolver/ares.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/resolver/ares.py new file mode 100644 index 00000000..ea6e919f --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/resolver/ares.py @@ -0,0 +1,357 @@ +# Copyright (c) 2011-2015 Denis Bilenko. See LICENSE for details. +""" +c-ares based hostname resolver. +""" +from __future__ import absolute_import, print_function, division +import os +import sys + +from _socket import getaddrinfo +from _socket import gaierror +from _socket import error + +from gevent._compat import string_types +from gevent._compat import text_type + +from gevent._compat import reraise +from gevent._compat import PY3 + +from gevent.hub import Waiter +from gevent.hub import get_hub + +from gevent.socket import AF_UNSPEC +from gevent.socket import AF_INET +from gevent.socket import AF_INET6 +from gevent.socket import SOCK_STREAM +from gevent.socket import SOCK_DGRAM +from gevent.socket import SOCK_RAW +from gevent.socket import AI_NUMERICHOST + +from gevent._config import config +from gevent._config import AresSettingMixin + +from .cares import channel, InvalidIP # pylint:disable=import-error,no-name-in-module +from . import _lookup_port as lookup_port +from . import _resolve_special +from . import AbstractResolver + +__all__ = ['Resolver'] + + +class Resolver(AbstractResolver): + """ + Implementation of the resolver API using the `c-ares`_ library. + + This implementation uses the c-ares library to handle name + resolution. c-ares is natively asynchronous at the socket level + and so integrates well into gevent's event loop. + + In comparison to :class:`gevent.resolver_thread.Resolver` (which + delegates to the native system resolver), the implementation is + much more complex. In addition, there have been reports of it not + properly honoring certain system configurations (for example, the + order in which IPv4 and IPv6 results are returned may not match + the threaded resolver). However, because it does not use threads, + it may scale better for applications that make many lookups. + + There are some known differences from the system resolver: + + - ``gethostbyname_ex`` and ``gethostbyaddr`` may return different + for the ``aliaslist`` tuple member. (Sometimes the same, + sometimes in a different order, sometimes a different alias + altogether.) + - ``gethostbyname_ex`` may return the ``ipaddrlist`` in a different order. + - ``getaddrinfo`` does not return ``SOCK_RAW`` results. + - ``getaddrinfo`` may return results in a different order. + - Handling of ``.local`` (mDNS) names may be different, even if they are listed in + the hosts file. + - c-ares will not resolve ``broadcasthost``, even if listed in the hosts file. + - This implementation may raise ``gaierror(4)`` where the system implementation would raise + ``herror(1)``. + - The results for ``localhost`` may be different. In particular, some system + resolvers will return more results from ``getaddrinfo`` than c-ares does, + such as SOCK_DGRAM results, and c-ares may report more ips on a multi-homed + host. + + .. caution:: This module is considered extremely experimental on PyPy, and + due to its implementation in cython, it may be slower. It may also lead to + interpreter crashes. + + .. _c-ares: http://c-ares.haxx.se + """ + + ares_class = channel + + def __init__(self, hub=None, use_environ=True, **kwargs): + if hub is None: + hub = get_hub() + self.hub = hub + if use_environ: + for setting in config.settings.values(): + if isinstance(setting, AresSettingMixin): + value = setting.get() + if value is not None: + kwargs.setdefault(setting.kwarg_name, value) + self.ares = self.ares_class(hub.loop, **kwargs) + self.pid = os.getpid() + self.params = kwargs + self.fork_watcher = hub.loop.fork(ref=False) + self.fork_watcher.start(self._on_fork) + + def __repr__(self): + return '' % (id(self), self.ares) + + def _on_fork(self): + # NOTE: See comment in gevent.hub.reinit. + pid = os.getpid() + if pid != self.pid: + self.hub.loop.run_callback(self.ares.destroy) + self.ares = self.ares_class(self.hub.loop, **self.params) + self.pid = pid + + def close(self): + if self.ares is not None: + self.hub.loop.run_callback(self.ares.destroy) + self.ares = None + self.fork_watcher.stop() + + def gethostbyname(self, hostname, family=AF_INET): + hostname = _resolve_special(hostname, family) + return self.gethostbyname_ex(hostname, family)[-1][0] + + def gethostbyname_ex(self, hostname, family=AF_INET): + if PY3: + if isinstance(hostname, str): + hostname = hostname.encode('idna') + elif not isinstance(hostname, (bytes, bytearray)): + raise TypeError('Expected es(idna), not %s' % type(hostname).__name__) + else: + if isinstance(hostname, text_type): + hostname = hostname.encode('ascii') + elif not isinstance(hostname, str): + raise TypeError('Expected string, not %s' % type(hostname).__name__) + + while True: + ares = self.ares + try: + waiter = Waiter(self.hub) + ares.gethostbyname(waiter, hostname, family) + result = waiter.get() + if not result[-1]: + raise gaierror(-5, 'No address associated with hostname') + return result + except gaierror: + if ares is self.ares: + if hostname == b'255.255.255.255': + # The stdlib handles this case in 2.7 and 3.x, but ares does not. + # It is tested by test_socket.py in 3.4. + # HACK: So hardcode the expected return. + return ('255.255.255.255', [], ['255.255.255.255']) + raise + # "self.ares is not ares" means channel was destroyed (because we were forked) + + def _lookup_port(self, port, socktype): + return lookup_port(port, socktype) + + def _getaddrinfo(self, host, port, family=0, socktype=0, proto=0, flags=0): + # pylint:disable=too-many-locals,too-many-branches + if isinstance(host, text_type): + host = host.encode('idna') + elif not isinstance(host, str) or (flags & AI_NUMERICHOST): + # this handles cases which do not require network access + # 1) host is None + # 2) host is of an invalid type + # 3) AI_NUMERICHOST flag is set + return getaddrinfo(host, port, family, socktype, proto, flags) + # we also call _socket.getaddrinfo below if family is not one of AF_* + + port, socktypes = self._lookup_port(port, socktype) + + socktype_proto = [(SOCK_STREAM, 6), (SOCK_DGRAM, 17), (SOCK_RAW, 0)] + if socktypes: + socktype_proto = [(x, y) for (x, y) in socktype_proto if x in socktypes] + if proto: + socktype_proto = [(x, y) for (x, y) in socktype_proto if proto == y] + + ares = self.ares + + if family == AF_UNSPEC: + ares_values = Values(self.hub, 2) + ares.gethostbyname(ares_values, host, AF_INET) + ares.gethostbyname(ares_values, host, AF_INET6) + elif family == AF_INET: + ares_values = Values(self.hub, 1) + ares.gethostbyname(ares_values, host, AF_INET) + elif family == AF_INET6: + ares_values = Values(self.hub, 1) + ares.gethostbyname(ares_values, host, AF_INET6) + else: + raise gaierror(5, 'ai_family not supported: %r' % (family, )) + + values = ares_values.get() + if len(values) == 2 and values[0] == values[1]: + values.pop() + + result = [] + result4 = [] + result6 = [] + + for addrs in values: + if addrs.family == AF_INET: + for addr in addrs[-1]: + sockaddr = (addr, port) + for socktype4, proto4 in socktype_proto: + result4.append((AF_INET, socktype4, proto4, '', sockaddr)) + elif addrs.family == AF_INET6: + for addr in addrs[-1]: + if addr == '::1': + dest = result + else: + dest = result6 + sockaddr = (addr, port, 0, 0) + for socktype6, proto6 in socktype_proto: + dest.append((AF_INET6, socktype6, proto6, '', sockaddr)) + + # As of 2016, some platforms return IPV6 first and some do IPV4 first, + # and some might even allow configuration of which is which. For backwards + # compatibility with earlier releases (but not necessarily resolver_thread!) + # we return 4 first. See https://github.com/gevent/gevent/issues/815 for more. + result += result4 + result6 + + if not result: + raise gaierror(-5, 'No address associated with hostname') + + return result + + def getaddrinfo(self, host, port, family=0, socktype=0, proto=0, flags=0): + while True: + ares = self.ares + try: + return self._getaddrinfo(host, port, family, socktype, proto, flags) + except gaierror: + if ares is self.ares: + raise + + def _gethostbyaddr(self, ip_address): + if PY3: + if isinstance(ip_address, str): + ip_address = ip_address.encode('idna') + elif not isinstance(ip_address, (bytes, bytearray)): + raise TypeError('Expected es(idna), not %s' % type(ip_address).__name__) + else: + if isinstance(ip_address, text_type): + ip_address = ip_address.encode('ascii') + elif not isinstance(ip_address, str): + raise TypeError('Expected string, not %s' % type(ip_address).__name__) + + waiter = Waiter(self.hub) + try: + self.ares.gethostbyaddr(waiter, ip_address) + return waiter.get() + except InvalidIP: + result = self._getaddrinfo(ip_address, None, family=AF_UNSPEC, socktype=SOCK_DGRAM) + if not result: + raise + _ip_address = result[0][-1][0] + if isinstance(_ip_address, text_type): + _ip_address = _ip_address.encode('ascii') + if _ip_address == ip_address: + raise + waiter.clear() + self.ares.gethostbyaddr(waiter, _ip_address) + return waiter.get() + + def gethostbyaddr(self, ip_address): + ip_address = _resolve_special(ip_address, AF_UNSPEC) + while True: + ares = self.ares + try: + return self._gethostbyaddr(ip_address) + except gaierror: + if ares is self.ares: + raise + + def _getnameinfo(self, sockaddr, flags): + if not isinstance(flags, int): + raise TypeError('an integer is required') + if not isinstance(sockaddr, tuple): + raise TypeError('getnameinfo() argument 1 must be a tuple') + + address = sockaddr[0] + if not PY3 and isinstance(address, text_type): + address = address.encode('ascii') + + if not isinstance(address, string_types): + raise TypeError('sockaddr[0] must be a string, not %s' % type(address).__name__) + + port = sockaddr[1] + if not isinstance(port, int): + raise TypeError('port must be an integer, not %s' % type(port)) + + waiter = Waiter(self.hub) + result = self._getaddrinfo(address, str(sockaddr[1]), family=AF_UNSPEC, socktype=SOCK_DGRAM) + if not result: + reraise(*sys.exc_info()) + elif len(result) != 1: + raise error('sockaddr resolved to multiple addresses') + family, _socktype, _proto, _name, address = result[0] + + if family == AF_INET: + if len(sockaddr) != 2: + raise error("IPv4 sockaddr must be 2 tuple") + elif family == AF_INET6: + address = address[:2] + sockaddr[2:] + + self.ares.getnameinfo(waiter, address, flags) + node, service = waiter.get() + + if service is None: + if PY3: + # ares docs: "If the query did not complete + # successfully, or one of the values was not + # requested, node or service will be NULL ". Python 2 + # allows that for the service, but Python 3 raises + # an error. This is tested by test_socket in py 3.4 + err = gaierror('nodename nor servname provided, or not known') + err.errno = 8 + raise err + service = '0' + return node, service + + def getnameinfo(self, sockaddr, flags): + while True: + ares = self.ares + try: + return self._getnameinfo(sockaddr, flags) + except gaierror: + if ares is self.ares: + raise + + +class Values(object): + # helper to collect multiple values; ignore errors unless nothing has succeeded + # QQQ could probably be moved somewhere - hub.py? + + __slots__ = ['count', 'values', 'error', 'waiter'] + + def __init__(self, hub, count): + self.count = count + self.values = [] + self.error = None + self.waiter = Waiter(hub) + + def __call__(self, source): + self.count -= 1 + if source.exception is None: + self.values.append(source.value) + else: + self.error = source.exception + if self.count <= 0: + self.waiter.switch(None) + + def get(self): + self.waiter.get() + if self.values: + return self.values + assert error is not None + raise self.error # pylint:disable=raising-bad-type diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/resolver/blocking.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/resolver/blocking.py new file mode 100644 index 00000000..4a26a764 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/resolver/blocking.py @@ -0,0 +1,45 @@ +# Copyright (c) 2018 gevent contributors. See LICENSE for details. + +import _socket + +__all__ = [ + 'Resolver', +] + +class Resolver(object): + """ + A resolver that directly uses the system's resolver functions. + + .. caution:: + + This resolver is *not* cooperative. + + This resolver has the lowest overhead of any resolver and + typically approaches the speed of the unmodified :mod:`socket` + functions. However, it is not cooperative, so if name resolution + blocks, the entire thread and all its greenlets will be blocked. + + This can be useful during debugging, or it may be a good choice if + your operating system provides a good caching resolver (such as + macOS's Directory Services) that is usually very fast and + functionally non-blocking. + + .. versionchanged:: 1.3a2 + This was previously undocumented and existed in :mod:`gevent.socket`. + + """ + + def __init__(self, hub=None): + pass + + def close(self): + pass + + for method in ( + 'gethostbyname', + 'gethostbyname_ex', + 'getaddrinfo', + 'gethostbyaddr', + 'getnameinfo' + ): + locals()[method] = staticmethod(getattr(_socket, method)) diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/resolver/cares.c b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/resolver/cares.c new file mode 100644 index 00000000..e2bae110 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/resolver/cares.c @@ -0,0 +1,15082 @@ +/* Generated by Cython 0.29.2 */ + +/* BEGIN: Cython Metadata +{ + "distutils": { + "define_macros": [ + [ + "FD_SETSIZE", + "1024" + ], + [ + "_WIN32", + "1" + ], + [ + "CARES_STATICLIB", + "" + ], + [ + "CARES_EMBED", + "1" + ] + ], + "depends": [ + "C:\\Users\\appveyor\\AppData\\Local\\Temp\\1\\pip-req-build-4mw8a1z7\\deps\\c-ares\\ares.h", + "src/gevent/resolver/dnshelper.c", + "src/gevent/resolver\\cares_ntop.h", + "src/gevent/resolver\\cares_pton.h", + "src\\gevent\\resolver\\cares_ntop.h", + "src\\gevent\\resolver\\cares_pton.h", + "src\\gevent\\resolver\\dnshelper.c" + ], + "include_dirs": [ + "src/gevent/resolver", + "C:\\Users\\appveyor\\AppData\\Local\\Temp\\1\\pip-req-build-4mw8a1z7\\deps\\c-ares" + ], + "libraries": [ + "ws2_32", + "advapi32" + ], + "name": "gevent.resolver.cares", + "sources": [ + "src/gevent/resolver/cares.pyx", + "deps/c-ares\\ares__close_sockets.c", + "deps/c-ares\\ares__get_hostent.c", + "deps/c-ares\\ares__read_line.c", + "deps/c-ares\\ares__timeval.c", + "deps/c-ares\\ares_android.c", + "deps/c-ares\\ares_cancel.c", + "deps/c-ares\\ares_create_query.c", + "deps/c-ares\\ares_data.c", + "deps/c-ares\\ares_destroy.c", + "deps/c-ares\\ares_expand_name.c", + "deps/c-ares\\ares_expand_string.c", + "deps/c-ares\\ares_fds.c", + "deps/c-ares\\ares_free_hostent.c", + "deps/c-ares\\ares_free_string.c", + "deps/c-ares\\ares_getenv.c", + "deps/c-ares\\ares_gethostbyaddr.c", + "deps/c-ares\\ares_gethostbyname.c", + "deps/c-ares\\ares_getnameinfo.c", + "deps/c-ares\\ares_getopt.c", + "deps/c-ares\\ares_getsock.c", + "deps/c-ares\\ares_init.c", + "deps/c-ares\\ares_library_init.c", + "deps/c-ares\\ares_llist.c", + "deps/c-ares\\ares_mkquery.c", + "deps/c-ares\\ares_nowarn.c", + "deps/c-ares\\ares_options.c", + "deps/c-ares\\ares_parse_a_reply.c", + "deps/c-ares\\ares_parse_aaaa_reply.c", + "deps/c-ares\\ares_parse_mx_reply.c", + "deps/c-ares\\ares_parse_naptr_reply.c", + "deps/c-ares\\ares_parse_ns_reply.c", + "deps/c-ares\\ares_parse_ptr_reply.c", + "deps/c-ares\\ares_parse_soa_reply.c", + "deps/c-ares\\ares_parse_srv_reply.c", + "deps/c-ares\\ares_parse_txt_reply.c", + "deps/c-ares\\ares_platform.c", + "deps/c-ares\\ares_process.c", + "deps/c-ares\\ares_query.c", + "deps/c-ares\\ares_search.c", + "deps/c-ares\\ares_send.c", + "deps/c-ares\\ares_strcasecmp.c", + "deps/c-ares\\ares_strdup.c", + "deps/c-ares\\ares_strerror.c", + "deps/c-ares\\ares_timeout.c", + "deps/c-ares\\ares_version.c", + "deps/c-ares\\ares_writev.c", + "deps/c-ares\\bitncmp.c", + "deps/c-ares\\inet_net_pton.c", + "deps/c-ares\\inet_ntop.c", + "deps/c-ares\\windows_port.c" + ] + }, + "module_name": "gevent.resolver.cares" +} +END: Cython Metadata */ + +#define PY_SSIZE_T_CLEAN +#include "Python.h" +#ifndef Py_PYTHON_H + #error Python headers needed to compile C extensions, please install development version of Python. +#elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) + #error Cython requires Python 2.6+ or Python 3.3+. +#else +#define CYTHON_ABI "0_29_2" +#define CYTHON_HEX_VERSION 0x001D02F0 +#define CYTHON_FUTURE_DIVISION 1 +#include +#ifndef offsetof + #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) +#endif +#if !defined(WIN32) && !defined(MS_WINDOWS) + #ifndef __stdcall + #define __stdcall + #endif + #ifndef __cdecl + #define __cdecl + #endif + #ifndef __fastcall + #define __fastcall + #endif +#endif +#ifndef DL_IMPORT + #define DL_IMPORT(t) t +#endif +#ifndef DL_EXPORT + #define DL_EXPORT(t) t +#endif +#define __PYX_COMMA , +#ifndef HAVE_LONG_LONG + #if PY_VERSION_HEX >= 0x02070000 + #define HAVE_LONG_LONG + #endif +#endif +#ifndef PY_LONG_LONG + #define PY_LONG_LONG LONG_LONG +#endif +#ifndef Py_HUGE_VAL + #define Py_HUGE_VAL HUGE_VAL +#endif +#ifdef PYPY_VERSION + #define CYTHON_COMPILING_IN_PYPY 1 + #define CYTHON_COMPILING_IN_PYSTON 0 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #undef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 0 + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #if PY_VERSION_HEX < 0x03050000 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #elif !defined(CYTHON_USE_ASYNC_SLOTS) + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #undef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 0 + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #undef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 1 + #undef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 0 + #undef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 0 + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #undef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE 0 + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 +#elif defined(PYSTON_VERSION) + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_PYSTON 1 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #ifndef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 1 + #endif + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #ifndef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 1 + #endif + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #ifndef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 0 + #endif + #ifndef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 1 + #endif + #ifndef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 1 + #endif + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #undef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE 0 + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 +#else + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_PYSTON 0 + #define CYTHON_COMPILING_IN_CPYTHON 1 + #ifndef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 1 + #endif + #if PY_VERSION_HEX < 0x02070000 + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #elif !defined(CYTHON_USE_PYTYPE_LOOKUP) + #define CYTHON_USE_PYTYPE_LOOKUP 1 + #endif + #if PY_MAJOR_VERSION < 3 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #elif !defined(CYTHON_USE_ASYNC_SLOTS) + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #if PY_VERSION_HEX < 0x02070000 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #elif !defined(CYTHON_USE_PYLONG_INTERNALS) + #define CYTHON_USE_PYLONG_INTERNALS 1 + #endif + #ifndef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 1 + #endif + #ifndef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 1 + #endif + #if PY_VERSION_HEX < 0x030300F0 + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #elif !defined(CYTHON_USE_UNICODE_WRITER) + #define CYTHON_USE_UNICODE_WRITER 1 + #endif + #ifndef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 0 + #endif + #ifndef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 1 + #endif + #ifndef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 1 + #endif + #ifndef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 1 + #endif + #ifndef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 1 + #endif + #ifndef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000) + #endif + #ifndef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1) + #endif + #ifndef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1) + #endif + #ifndef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3) + #endif +#endif +#if !defined(CYTHON_FAST_PYCCALL) +#define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) +#endif +#if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #undef SHIFT + #undef BASE + #undef MASK + #ifdef SIZEOF_VOID_P + enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) }; + #endif +#endif +#ifndef __has_attribute + #define __has_attribute(x) 0 +#endif +#ifndef __has_cpp_attribute + #define __has_cpp_attribute(x) 0 +#endif +#ifndef CYTHON_RESTRICT + #if defined(__GNUC__) + #define CYTHON_RESTRICT __restrict__ + #elif defined(_MSC_VER) && _MSC_VER >= 1400 + #define CYTHON_RESTRICT __restrict + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_RESTRICT restrict + #else + #define CYTHON_RESTRICT + #endif +#endif +#ifndef CYTHON_UNUSED +# if defined(__GNUC__) +# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +#endif +#ifndef CYTHON_MAYBE_UNUSED_VAR +# if defined(__cplusplus) + template void CYTHON_MAYBE_UNUSED_VAR( const T& ) { } +# else +# define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x) +# endif +#endif +#ifndef CYTHON_NCP_UNUSED +# if CYTHON_COMPILING_IN_CPYTHON +# define CYTHON_NCP_UNUSED +# else +# define CYTHON_NCP_UNUSED CYTHON_UNUSED +# endif +#endif +#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) +#ifdef _MSC_VER + #ifndef _MSC_STDINT_H_ + #if _MSC_VER < 1300 + typedef unsigned char uint8_t; + typedef unsigned int uint32_t; + #else + typedef unsigned __int8 uint8_t; + typedef unsigned __int32 uint32_t; + #endif + #endif +#else + #include +#endif +#ifndef CYTHON_FALLTHROUGH + #if defined(__cplusplus) && __cplusplus >= 201103L + #if __has_cpp_attribute(fallthrough) + #define CYTHON_FALLTHROUGH [[fallthrough]] + #elif __has_cpp_attribute(clang::fallthrough) + #define CYTHON_FALLTHROUGH [[clang::fallthrough]] + #elif __has_cpp_attribute(gnu::fallthrough) + #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] + #endif + #endif + #ifndef CYTHON_FALLTHROUGH + #if __has_attribute(fallthrough) + #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) + #else + #define CYTHON_FALLTHROUGH + #endif + #endif + #if defined(__clang__ ) && defined(__apple_build_version__) + #if __apple_build_version__ < 7000000 + #undef CYTHON_FALLTHROUGH + #define CYTHON_FALLTHROUGH + #endif + #endif +#endif + +#ifndef CYTHON_INLINE + #if defined(__clang__) + #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) + #elif defined(__GNUC__) + #define CYTHON_INLINE __inline__ + #elif defined(_MSC_VER) + #define CYTHON_INLINE __inline + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_INLINE inline + #else + #define CYTHON_INLINE + #endif +#endif + +#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) + #define Py_OptimizeFlag 0 +#endif +#define __PYX_BUILD_PY_SSIZE_T "n" +#define CYTHON_FORMAT_SSIZE_T "z" +#if PY_MAJOR_VERSION < 3 + #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyClass_Type +#else + #define __Pyx_BUILTIN_MODULE_NAME "builtins" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyType_Type +#endif +#ifndef Py_TPFLAGS_CHECKTYPES + #define Py_TPFLAGS_CHECKTYPES 0 +#endif +#ifndef Py_TPFLAGS_HAVE_INDEX + #define Py_TPFLAGS_HAVE_INDEX 0 +#endif +#ifndef Py_TPFLAGS_HAVE_NEWBUFFER + #define Py_TPFLAGS_HAVE_NEWBUFFER 0 +#endif +#ifndef Py_TPFLAGS_HAVE_FINALIZE + #define Py_TPFLAGS_HAVE_FINALIZE 0 +#endif +#ifndef METH_STACKLESS + #define METH_STACKLESS 0 +#endif +#if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) + #ifndef METH_FASTCALL + #define METH_FASTCALL 0x80 + #endif + typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs); + typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args, + Py_ssize_t nargs, PyObject *kwnames); +#else + #define __Pyx_PyCFunctionFast _PyCFunctionFast + #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords +#endif +#if CYTHON_FAST_PYCCALL +#define __Pyx_PyFastCFunction_Check(func)\ + ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS))))) +#else +#define __Pyx_PyFastCFunction_Check(func) 0 +#endif +#if CYTHON_USE_DICT_VERSIONS +#define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) +#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ + (version_var) = __PYX_GET_DICT_VERSION(dict);\ + (cache_var) = (value); +#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ + static PY_UINT64_T __pyx_dict_version = 0;\ + static PyObject *__pyx_dict_cached_value = NULL;\ + if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ + (VAR) = __pyx_dict_cached_value;\ + } else {\ + (VAR) = __pyx_dict_cached_value = (LOOKUP);\ + __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ + }\ + } +#else +#define __PYX_GET_DICT_VERSION(dict) (0) +#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) +#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) + #define PyObject_Malloc(s) PyMem_Malloc(s) + #define PyObject_Free(p) PyMem_Free(p) + #define PyObject_Realloc(p) PyMem_Realloc(p) +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1 + #define PyMem_RawMalloc(n) PyMem_Malloc(n) + #define PyMem_RawRealloc(p, n) PyMem_Realloc(p, n) + #define PyMem_RawFree(p) PyMem_Free(p) +#endif +#if CYTHON_COMPILING_IN_PYSTON + #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co) + #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno) +#else + #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) + #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) +#endif +#if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000 + #define __Pyx_PyThreadState_Current PyThreadState_GET() +#elif PY_VERSION_HEX >= 0x03060000 + #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() +#elif PY_VERSION_HEX >= 0x03000000 + #define __Pyx_PyThreadState_Current PyThreadState_GET() +#else + #define __Pyx_PyThreadState_Current _PyThreadState_Current +#endif +#if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) +#include "pythread.h" +#define Py_tss_NEEDS_INIT 0 +typedef int Py_tss_t; +static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) { + *key = PyThread_create_key(); + return 0; // PyThread_create_key reports success always +} +static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) { + Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t)); + *key = Py_tss_NEEDS_INIT; + return key; +} +static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) { + PyObject_Free(key); +} +static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) { + return *key != Py_tss_NEEDS_INIT; +} +static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) { + PyThread_delete_key(*key); + *key = Py_tss_NEEDS_INIT; +} +static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) { + return PyThread_set_key_value(*key, value); +} +static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { + return PyThread_get_key_value(*key); +} +#endif // TSS (Thread Specific Storage) API +#if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized) +#define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) +#else +#define __Pyx_PyDict_NewPresized(n) PyDict_New() +#endif +#if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION + #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) +#else + #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS +#define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) +#else +#define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name) +#endif +#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) + #define CYTHON_PEP393_ENABLED 1 + #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ + 0 : _PyUnicode_Ready((PyObject *)(op))) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) + #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) + #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) + #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) + #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) + #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch) + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) +#else + #define CYTHON_PEP393_ENABLED 0 + #define PyUnicode_1BYTE_KIND 1 + #define PyUnicode_2BYTE_KIND 2 + #define PyUnicode_4BYTE_KIND 4 + #define __Pyx_PyUnicode_READY(op) (0) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) + #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111) + #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) + #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) + #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) + #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch) + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) +#endif +#if CYTHON_COMPILING_IN_PYPY + #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) +#else + #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ + PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains) + #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check) + #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format) + #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) +#endif +#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) +#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) +#else + #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) +#endif +#if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) + #define PyObject_ASCII(o) PyObject_Repr(o) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBaseString_Type PyUnicode_Type + #define PyStringObject PyUnicodeObject + #define PyString_Type PyUnicode_Type + #define PyString_Check PyUnicode_Check + #define PyString_CheckExact PyUnicode_CheckExact + #define PyObject_Unicode PyObject_Str +#endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) + #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) +#else + #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) + #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) +#endif +#ifndef PySet_CheckExact + #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) +#endif +#if CYTHON_ASSUME_SAFE_MACROS + #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) +#else + #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyIntObject PyLongObject + #define PyInt_Type PyLong_Type + #define PyInt_Check(op) PyLong_Check(op) + #define PyInt_CheckExact(op) PyLong_CheckExact(op) + #define PyInt_FromString PyLong_FromString + #define PyInt_FromUnicode PyLong_FromUnicode + #define PyInt_FromLong PyLong_FromLong + #define PyInt_FromSize_t PyLong_FromSize_t + #define PyInt_FromSsize_t PyLong_FromSsize_t + #define PyInt_AsLong PyLong_AsLong + #define PyInt_AS_LONG PyLong_AS_LONG + #define PyInt_AsSsize_t PyLong_AsSsize_t + #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask + #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask + #define PyNumber_Int PyNumber_Long +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBoolObject PyLongObject +#endif +#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY + #ifndef PyUnicode_InternFromString + #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) + #endif +#endif +#if PY_VERSION_HEX < 0x030200A4 + typedef long Py_hash_t; + #define __Pyx_PyInt_FromHash_t PyInt_FromLong + #define __Pyx_PyInt_AsHash_t PyInt_AsLong +#else + #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t + #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t +#endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : (Py_INCREF(func), func)) +#else + #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) +#endif +#if CYTHON_USE_ASYNC_SLOTS + #if PY_VERSION_HEX >= 0x030500B1 + #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods + #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) + #else + #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) + #endif +#else + #define __Pyx_PyType_AsAsync(obj) NULL +#endif +#ifndef __Pyx_PyAsyncMethodsStruct + typedef struct { + unaryfunc am_await; + unaryfunc am_aiter; + unaryfunc am_anext; + } __Pyx_PyAsyncMethodsStruct; +#endif + +#if defined(WIN32) || defined(MS_WINDOWS) + #define _USE_MATH_DEFINES +#endif +#include +#ifdef NAN +#define __PYX_NAN() ((float) NAN) +#else +static CYTHON_INLINE float __PYX_NAN() { + float value; + memset(&value, 0xFF, sizeof(value)); + return value; +} +#endif +#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) +#define __Pyx_truncl trunc +#else +#define __Pyx_truncl truncl +#endif + + +#define __PYX_ERR(f_index, lineno, Ln_error) \ +{ \ + __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \ +} + +#ifndef __PYX_EXTERN_C + #ifdef __cplusplus + #define __PYX_EXTERN_C extern "C" + #else + #define __PYX_EXTERN_C extern + #endif +#endif + +#define __PYX_HAVE__gevent__resolver__cares +#define __PYX_HAVE_API__gevent__resolver__cares +/* Early includes */ +#include "ares.h" +#include "cares_pton.h" +#include +#include +#include "dnshelper.c" +#ifdef _OPENMP +#include +#endif /* _OPENMP */ + +#if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) +#define CYTHON_WITHOUT_ASSERTIONS +#endif + +typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; + const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; + +#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 +#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0 +#define __PYX_DEFAULT_STRING_ENCODING "" +#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString +#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#define __Pyx_uchar_cast(c) ((unsigned char)c) +#define __Pyx_long_cast(x) ((long)x) +#define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ + (sizeof(type) < sizeof(Py_ssize_t)) ||\ + (sizeof(type) > sizeof(Py_ssize_t) &&\ + likely(v < (type)PY_SSIZE_T_MAX ||\ + v == (type)PY_SSIZE_T_MAX) &&\ + (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ + v == (type)PY_SSIZE_T_MIN))) ||\ + (sizeof(type) == sizeof(Py_ssize_t) &&\ + (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ + v == (type)PY_SSIZE_T_MAX))) ) +static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) { + return (size_t) i < (size_t) limit; +} +#if defined (__cplusplus) && __cplusplus >= 201103L + #include + #define __Pyx_sst_abs(value) std::abs(value) +#elif SIZEOF_INT >= SIZEOF_SIZE_T + #define __Pyx_sst_abs(value) abs(value) +#elif SIZEOF_LONG >= SIZEOF_SIZE_T + #define __Pyx_sst_abs(value) labs(value) +#elif defined (_MSC_VER) + #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) +#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define __Pyx_sst_abs(value) llabs(value) +#elif defined (__GNUC__) + #define __Pyx_sst_abs(value) __builtin_llabs(value) +#else + #define __Pyx_sst_abs(value) ((value<0) ? -value : value) +#endif +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*); +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); +#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) +#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) +#define __Pyx_PyBytes_FromString PyBytes_FromString +#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); +#if PY_MAJOR_VERSION < 3 + #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#else + #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize +#endif +#define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) +#define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) +#define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) +#define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) +#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) +static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) { + const Py_UNICODE *u_end = u; + while (*u_end++) ; + return (size_t)(u_end - u - 1); +} +#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) +#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode +#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode +#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) +#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) +static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); +static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*); +static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); +#define __Pyx_PySequence_Tuple(obj)\ + (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); +#if CYTHON_ASSUME_SAFE_MACROS +#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) +#else +#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) +#endif +#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) +#if PY_MAJOR_VERSION >= 3 +#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) +#else +#define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) +#endif +#define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x)) +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII +static int __Pyx_sys_getdefaultencoding_not_ascii; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + PyObject* ascii_chars_u = NULL; + PyObject* ascii_chars_b = NULL; + const char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + if (strcmp(default_encoding_c, "ascii") == 0) { + __Pyx_sys_getdefaultencoding_not_ascii = 0; + } else { + char ascii_chars[128]; + int c; + for (c = 0; c < 128; c++) { + ascii_chars[c] = c; + } + __Pyx_sys_getdefaultencoding_not_ascii = 1; + ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); + if (!ascii_chars_u) goto bad; + ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); + if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { + PyErr_Format( + PyExc_ValueError, + "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", + default_encoding_c); + goto bad; + } + Py_DECREF(ascii_chars_u); + Py_DECREF(ascii_chars_b); + } + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + Py_XDECREF(ascii_chars_u); + Py_XDECREF(ascii_chars_b); + return -1; +} +#endif +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) +#else +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +static char* __PYX_DEFAULT_STRING_ENCODING; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1); + if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; + strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + return -1; +} +#endif +#endif + + +/* Test for GCC > 2.95 */ +#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) + #define likely(x) __builtin_expect(!!(x), 1) + #define unlikely(x) __builtin_expect(!!(x), 0) +#else /* !__GNUC__ or GCC < 2.95 */ + #define likely(x) (x) + #define unlikely(x) (x) +#endif /* __GNUC__ */ +static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } + +static PyObject *__pyx_m = NULL; +static PyObject *__pyx_d; +static PyObject *__pyx_b; +static PyObject *__pyx_cython_runtime = NULL; +static PyObject *__pyx_empty_tuple; +static PyObject *__pyx_empty_bytes; +static PyObject *__pyx_empty_unicode; +static int __pyx_lineno; +static int __pyx_clineno = 0; +static const char * __pyx_cfilenm= __FILE__; +static const char *__pyx_filename; + + +static const char *__pyx_f[] = { + "src\\gevent\\resolver\\cares.pyx", + "type.pxd", +}; + +/*--- Type declarations ---*/ +struct __pyx_obj_6gevent_8resolver_5cares_result; +struct __pyx_obj_6gevent_8resolver_5cares_channel; +struct __pyx_opt_args_6gevent_8resolver_5cares__convert_cares_flags; +struct __pyx_opt_args_6gevent_8resolver_5cares_7channel_set_servers; + +/* "gevent/resolver/cares.pyx":146 + * + * + * cpdef _convert_cares_flags(int flags, int default=cares.ARES_NI_LOOKUPHOST|cares.ARES_NI_LOOKUPSERVICE): # <<<<<<<<<<<<<< + * if _cares_flag_map is None: + * _prepare_cares_flag_map() + */ +struct __pyx_opt_args_6gevent_8resolver_5cares__convert_cares_flags { + int __pyx_n; + int __pyx_default; +}; + +/* "gevent/resolver/cares.pyx":323 + * self.channel = NULL + * + * cpdef set_servers(self, servers=None): # <<<<<<<<<<<<<< + * if not self.channel: + * raise gaierror(cares.ARES_EDESTRUCTION, 'this ares channel has been destroyed') + */ +struct __pyx_opt_args_6gevent_8resolver_5cares_7channel_set_servers { + int __pyx_n; + PyObject *servers; +}; + +/* "gevent/resolver/cares.pyx":173 + * + * + * cdef class result: # <<<<<<<<<<<<<< + * cdef public object value + * cdef public object exception + */ +struct __pyx_obj_6gevent_8resolver_5cares_result { + PyObject_HEAD + PyObject *value; + PyObject *exception; +}; + + +/* "gevent/resolver/cares.pyx":254 + * + * + * cdef class channel: # <<<<<<<<<<<<<< + * + * cdef public object loop + */ +struct __pyx_obj_6gevent_8resolver_5cares_channel { + PyObject_HEAD + struct __pyx_vtabstruct_6gevent_8resolver_5cares_channel *__pyx_vtab; + PyObject *loop; + struct ares_channeldata *channel; + PyObject *_watchers; + PyObject *_timer; +}; + + + +struct __pyx_vtabstruct_6gevent_8resolver_5cares_channel { + PyObject *(*set_servers)(struct __pyx_obj_6gevent_8resolver_5cares_channel *, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_8resolver_5cares_7channel_set_servers *__pyx_optional_args); + PyObject *(*_sock_state_callback)(struct __pyx_obj_6gevent_8resolver_5cares_channel *, int, int, int); + PyObject *(*_getnameinfo)(struct __pyx_obj_6gevent_8resolver_5cares_channel *, PyObject *, PyObject *, int, int __pyx_skip_dispatch); +}; +static struct __pyx_vtabstruct_6gevent_8resolver_5cares_channel *__pyx_vtabptr_6gevent_8resolver_5cares_channel; + +/* --- Runtime support code (head) --- */ +/* Refnanny.proto */ +#ifndef CYTHON_REFNANNY + #define CYTHON_REFNANNY 0 +#endif +#if CYTHON_REFNANNY + typedef struct { + void (*INCREF)(void*, PyObject*, int); + void (*DECREF)(void*, PyObject*, int); + void (*GOTREF)(void*, PyObject*, int); + void (*GIVEREF)(void*, PyObject*, int); + void* (*SetupContext)(const char*, int, const char*); + void (*FinishContext)(void**); + } __Pyx_RefNannyAPIStruct; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); + #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; +#ifdef WITH_THREAD + #define __Pyx_RefNannySetupContext(name, acquire_gil)\ + if (acquire_gil) {\ + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ + PyGILState_Release(__pyx_gilstate_save);\ + } else {\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ + } +#else + #define __Pyx_RefNannySetupContext(name, acquire_gil)\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) +#endif + #define __Pyx_RefNannyFinishContext()\ + __Pyx_RefNanny->FinishContext(&__pyx_refnanny) + #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0) + #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) + #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) + #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) +#else + #define __Pyx_RefNannyDeclarations + #define __Pyx_RefNannySetupContext(name, acquire_gil) + #define __Pyx_RefNannyFinishContext() + #define __Pyx_INCREF(r) Py_INCREF(r) + #define __Pyx_DECREF(r) Py_DECREF(r) + #define __Pyx_GOTREF(r) + #define __Pyx_GIVEREF(r) + #define __Pyx_XINCREF(r) Py_XINCREF(r) + #define __Pyx_XDECREF(r) Py_XDECREF(r) + #define __Pyx_XGOTREF(r) + #define __Pyx_XGIVEREF(r) +#endif +#define __Pyx_XDECREF_SET(r, v) do {\ + PyObject *tmp = (PyObject *) r;\ + r = v; __Pyx_XDECREF(tmp);\ + } while (0) +#define __Pyx_DECREF_SET(r, v) do {\ + PyObject *tmp = (PyObject *) r;\ + r = v; __Pyx_DECREF(tmp);\ + } while (0) +#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) +#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) + +/* PyObjectGetAttrStr.proto */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); +#else +#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) +#endif + +/* GetBuiltinName.proto */ +static PyObject *__Pyx_GetBuiltinName(PyObject *name); + +/* Import.proto */ +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); + +/* PyErrExceptionMatches.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) +static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); +#else +#define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) +#endif + +/* PyThreadStateGet.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; +#define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; +#define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type +#else +#define __Pyx_PyThreadState_declare +#define __Pyx_PyThreadState_assign +#define __Pyx_PyErr_Occurred() PyErr_Occurred() +#endif + +/* PyErrFetchRestore.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) +#define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) +#define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) +#define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) +#define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); +static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) +#else +#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) +#endif +#else +#define __Pyx_PyErr_Clear() PyErr_Clear() +#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) +#define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) +#define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb) +#define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) +#endif + +/* GetAttr.proto */ +static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *); + +/* GetAttr3.proto */ +static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *); + +/* GetModuleGlobalName.proto */ +#if CYTHON_USE_DICT_VERSIONS +#define __Pyx_GetModuleGlobalName(var, name) {\ + static PY_UINT64_T __pyx_dict_version = 0;\ + static PyObject *__pyx_dict_cached_value = NULL;\ + (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\ + (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\ + __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ +} +#define __Pyx_GetModuleGlobalNameUncached(var, name) {\ + PY_UINT64_T __pyx_dict_version;\ + PyObject *__pyx_dict_cached_value;\ + (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ +} +static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value); +#else +#define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name) +#define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name) +static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name); +#endif + +/* RaiseTooManyValuesToUnpack.proto */ +static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); + +/* RaiseNeedMoreValuesToUnpack.proto */ +static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); + +/* IterFinish.proto */ +static CYTHON_INLINE int __Pyx_IterFinish(void); + +/* UnpackItemEndCheck.proto */ +static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); + +/* PyFunctionFastCall.proto */ +#if CYTHON_FAST_PYCALL +#define __Pyx_PyFunction_FastCall(func, args, nargs)\ + __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) +#if 1 || PY_VERSION_HEX < 0x030600B1 +static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs); +#else +#define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs) +#endif +#define __Pyx_BUILD_ASSERT_EXPR(cond)\ + (sizeof(char [1 - 2*!(cond)]) - 1) +#ifndef Py_MEMBER_SIZE +#define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member) +#endif + static size_t __pyx_pyframe_localsplus_offset = 0; + #include "frameobject.h" + #define __Pxy_PyFrame_Initialize_Offsets()\ + ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\ + (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus))) + #define __Pyx_PyFrame_GetLocalsplus(frame)\ + (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset)) +#endif + +/* PyCFunctionFastCall.proto */ +#if CYTHON_FAST_PYCCALL +static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs); +#else +#define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL) +#endif + +/* PyObjectCall.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); +#else +#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) +#endif + +/* RaiseException.proto */ +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); + +/* RaiseDoubleKeywords.proto */ +static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); + +/* ParseKeywords.proto */ +static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\ + PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\ + const char* function_name); + +/* RaiseArgTupleInvalid.proto */ +static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, + Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); + +/* PyObjectCall2Args.proto */ +static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2); + +/* PyObjectCallMethO.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); +#endif + +/* PyObjectCallOneArg.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); + +/* WriteUnraisableException.proto */ +static void __Pyx_WriteUnraisable(const char *name, int clineno, + int lineno, const char *filename, + int full_traceback, int nogil); + +/* PyObjectSetAttrStr.proto */ +#if CYTHON_USE_TYPE_SLOTS +#define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o, n, NULL) +static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value); +#else +#define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n) +#define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v) +#endif + +/* RaiseNoneIterError.proto */ +static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void); + +/* ExtTypeTest.proto */ +static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); + +/* GetTopmostException.proto */ +#if CYTHON_USE_EXC_INFO_STACK +static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate); +#endif + +/* SaveResetException.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); +#else +#define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb) +#define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb) +#endif + +/* GetException.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb) +static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#else +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); +#endif + +/* PyObjectCallNoArg.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); +#else +#define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL) +#endif + +/* GetItemInt.proto */ +#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ + __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\ + (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\ + __Pyx_GetItemInt_Generic(o, to_py_func(i)))) +#define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ + __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ + (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL)) +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, + int wraparound, int boundscheck); +#define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ + __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ + (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL)) +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, + int wraparound, int boundscheck); +static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j); +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, + int is_list, int wraparound, int boundscheck); + +/* pyobject_as_double.proto */ +static double __Pyx__PyObject_AsDouble(PyObject* obj); +#if CYTHON_COMPILING_IN_PYPY +#define __Pyx_PyObject_AsDouble(obj)\ +(likely(PyFloat_CheckExact(obj)) ? PyFloat_AS_DOUBLE(obj) :\ + likely(PyInt_CheckExact(obj)) ?\ + PyFloat_AsDouble(obj) : __Pyx__PyObject_AsDouble(obj)) +#else +#define __Pyx_PyObject_AsDouble(obj)\ +((likely(PyFloat_CheckExact(obj))) ?\ + PyFloat_AS_DOUBLE(obj) : __Pyx__PyObject_AsDouble(obj)) +#endif + +/* py_dict_clear.proto */ +#define __Pyx_PyDict_Clear(d) (PyDict_Clear(d), 0) + +/* SwapException.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#else +static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb); +#endif + +/* dict_getitem_default.proto */ +static PyObject* __Pyx_PyDict_GetItemDefault(PyObject* d, PyObject* key, PyObject* default_value); + +/* UnpackUnboundCMethod.proto */ +typedef struct { + PyObject *type; + PyObject **method_name; + PyCFunction func; + PyObject *method; + int flag; +} __Pyx_CachedCFunction; + +/* CallUnboundCMethod1.proto */ +static PyObject* __Pyx__CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg); +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg); +#else +#define __Pyx_CallUnboundCMethod1(cfunc, self, arg) __Pyx__CallUnboundCMethod1(cfunc, self, arg) +#endif + +/* CallUnboundCMethod2.proto */ +static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2); +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030600B1 +static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2); +#else +#define __Pyx_CallUnboundCMethod2(cfunc, self, arg1, arg2) __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2) +#endif + +/* py_dict_pop.proto */ +static CYTHON_INLINE PyObject *__Pyx_PyDict_Pop(PyObject *d, PyObject *key, PyObject *default_value); + +/* ArgTypeTest.proto */ +#define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\ + ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\ + __Pyx__ArgTypeTest(obj, type, name, exact)) +static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact); + +/* FastTypeChecks.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) +static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b); +static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type); +static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2); +#else +#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) +#define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) +#define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) +#endif +#define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) + +/* PyObject_GenericGetAttrNoDict.proto */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name); +#else +#define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr +#endif + +/* PyObject_GenericGetAttr.proto */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name); +#else +#define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr +#endif + +/* SetVTable.proto */ +static int __Pyx_SetVtable(PyObject *dict, void *vtable); + +/* TypeImport.proto */ +#ifndef __PYX_HAVE_RT_ImportType_proto +#define __PYX_HAVE_RT_ImportType_proto +enum __Pyx_ImportType_CheckSize { + __Pyx_ImportType_CheckSize_Error = 0, + __Pyx_ImportType_CheckSize_Warn = 1, + __Pyx_ImportType_CheckSize_Ignore = 2 +}; +static PyTypeObject *__Pyx_ImportType(PyObject* module, const char *module_name, const char *class_name, size_t size, enum __Pyx_ImportType_CheckSize check_size); +#endif + +/* ImportFrom.proto */ +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); + +/* CalculateMetaclass.proto */ +static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases); + +/* Py3ClassCreate.proto */ +static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname, + PyObject *mkw, PyObject *modname, PyObject *doc); +static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict, + PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass); + +/* FetchCommonType.proto */ +static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); + +/* CythonFunction.proto */ +#define __Pyx_CyFunction_USED 1 +#define __Pyx_CYFUNCTION_STATICMETHOD 0x01 +#define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 +#define __Pyx_CYFUNCTION_CCLASS 0x04 +#define __Pyx_CyFunction_GetClosure(f)\ + (((__pyx_CyFunctionObject *) (f))->func_closure) +#define __Pyx_CyFunction_GetClassObj(f)\ + (((__pyx_CyFunctionObject *) (f))->func_classobj) +#define __Pyx_CyFunction_Defaults(type, f)\ + ((type *)(((__pyx_CyFunctionObject *) (f))->defaults)) +#define __Pyx_CyFunction_SetDefaultsGetter(f, g)\ + ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g) +typedef struct { + PyCFunctionObject func; +#if PY_VERSION_HEX < 0x030500A0 + PyObject *func_weakreflist; +#endif + PyObject *func_dict; + PyObject *func_name; + PyObject *func_qualname; + PyObject *func_doc; + PyObject *func_globals; + PyObject *func_code; + PyObject *func_closure; + PyObject *func_classobj; + void *defaults; + int defaults_pyobjects; + int flags; + PyObject *defaults_tuple; + PyObject *defaults_kwdict; + PyObject *(*defaults_getter)(PyObject *); + PyObject *func_annotations; +} __pyx_CyFunctionObject; +static PyTypeObject *__pyx_CyFunctionType = 0; +#define __Pyx_CyFunction_Check(obj) (__Pyx_TypeCheck(obj, __pyx_CyFunctionType)) +#define __Pyx_CyFunction_NewEx(ml, flags, qualname, self, module, globals, code)\ + __Pyx_CyFunction_New(__pyx_CyFunctionType, ml, flags, qualname, self, module, globals, code) +static PyObject *__Pyx_CyFunction_New(PyTypeObject *, PyMethodDef *ml, + int flags, PyObject* qualname, + PyObject *self, + PyObject *module, PyObject *globals, + PyObject* code); +static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, + size_t size, + int pyobjects); +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, + PyObject *tuple); +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, + PyObject *dict); +static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m, + PyObject *dict); +static int __pyx_CyFunction_init(void); + +/* SetNameInClass.proto */ +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 +#define __Pyx_SetNameInClass(ns, name, value)\ + (likely(PyDict_CheckExact(ns)) ? _PyDict_SetItem_KnownHash(ns, name, value, ((PyASCIIObject *) name)->hash) : PyObject_SetItem(ns, name, value)) +#elif CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_SetNameInClass(ns, name, value)\ + (likely(PyDict_CheckExact(ns)) ? PyDict_SetItem(ns, name, value) : PyObject_SetItem(ns, name, value)) +#else +#define __Pyx_SetNameInClass(ns, name, value) PyObject_SetItem(ns, name, value) +#endif + +/* CLineInTraceback.proto */ +#ifdef CYTHON_CLINE_IN_TRACEBACK +#define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) +#else +static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line); +#endif + +/* CodeObjectCache.proto */ +typedef struct { + PyCodeObject* code_object; + int code_line; +} __Pyx_CodeObjectCacheEntry; +struct __Pyx_CodeObjectCache { + int count; + int max_count; + __Pyx_CodeObjectCacheEntry* entries; +}; +static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); +static PyCodeObject *__pyx_find_code_object(int code_line); +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); + +/* AddTraceback.proto */ +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename); + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); + +/* CIntFromPy.proto */ +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); + +/* CIntFromPy.proto */ +static CYTHON_INLINE unsigned short __Pyx_PyInt_As_unsigned_short(PyObject *); + +/* CIntFromPy.proto */ +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); + +/* CheckBinaryVersion.proto */ +static int __Pyx_check_binary_version(void); + +/* InitStrings.proto */ +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); + +static PyObject *__pyx_f_6gevent_8resolver_5cares_7channel_set_servers(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_8resolver_5cares_7channel_set_servers *__pyx_optional_args); /* proto*/ +static PyObject *__pyx_f_6gevent_8resolver_5cares_7channel__sock_state_callback(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self, int __pyx_v_socket, int __pyx_v_read, int __pyx_v_write); /* proto*/ +static PyObject *__pyx_f_6gevent_8resolver_5cares_7channel__getnameinfo(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self, PyObject *__pyx_v_callback, PyObject *__pyx_v_sockaddr, int __pyx_v_flags, int __pyx_skip_dispatch); /* proto*/ + +/* Module declarations from 'libcares' */ + +/* Module declarations from 'libc.string' */ + +/* Module declarations from 'libc.stdio' */ + +/* Module declarations from '__builtin__' */ + +/* Module declarations from 'cpython.type' */ +static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0; + +/* Module declarations from 'cpython' */ + +/* Module declarations from 'cpython.object' */ + +/* Module declarations from 'cpython.ref' */ + +/* Module declarations from 'cpython.mem' */ + +/* Module declarations from 'gevent.resolver.cares' */ +static PyTypeObject *__pyx_ptype_6gevent_8resolver_5cares_result = 0; +static PyTypeObject *__pyx_ptype_6gevent_8resolver_5cares_channel = 0; +static PyObject *__pyx_v_6gevent_8resolver_5cares_string_types = 0; +static PyObject *__pyx_v_6gevent_8resolver_5cares_text_type = 0; +static PyObject *__pyx_f_6gevent_8resolver_5cares__prepare_cares_flag_map(void); /*proto*/ +static PyObject *__pyx_f_6gevent_8resolver_5cares__convert_cares_flags(int, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_8resolver_5cares__convert_cares_flags *__pyx_optional_args); /*proto*/ +static PyObject *__pyx_f_6gevent_8resolver_5cares_strerror(PyObject *, int __pyx_skip_dispatch); /*proto*/ +static void __pyx_f_6gevent_8resolver_5cares_gevent_sock_state_callback(void *, int, int, int); /*proto*/ +static void __pyx_f_6gevent_8resolver_5cares_gevent_ares_host_callback(void *, int, int, struct hostent *); /*proto*/ +static void __pyx_f_6gevent_8resolver_5cares_gevent_ares_nameinfo_callback(void *, int, int, char *, char *); /*proto*/ +#define __Pyx_MODULE_NAME "gevent.resolver.cares" +extern int __pyx_module_is_main_gevent__resolver__cares; +int __pyx_module_is_main_gevent__resolver__cares = 0; + +/* Implementation of 'gevent.resolver.cares' */ +static PyObject *__pyx_builtin_ValueError; +static PyObject *__pyx_builtin_id; +static PyObject *__pyx_builtin_MemoryError; +static PyObject *__pyx_builtin_TypeError; +static const char __pyx_k__2[] = ","; +static const char __pyx_k_fd[] = "fd"; +static const char __pyx_k_id[] = "id"; +static const char __pyx_k_io[] = "io"; +static const char __pyx_k_all[] = "__all__"; +static const char __pyx_k_cls[] = "cls"; +static const char __pyx_k_doc[] = "__doc__"; +static const char __pyx_k_get[] = "get"; +static const char __pyx_k_new[] = "__new__"; +static const char __pyx_k_pop[] = "pop"; +static const char __pyx_k_s_r[] = "%s(%r)"; +static const char __pyx_k_s_s[] = "%s: %s"; +static const char __pyx_k_sys[] = "sys"; +static const char __pyx_k_addr[] = "addr"; +static const char __pyx_k_loop[] = "loop"; +static const char __pyx_k_main[] = "__main__"; +static const char __pyx_k_name[] = "__name__"; +static const char __pyx_k_self[] = "self"; +static const char __pyx_k_stop[] = "stop"; +static const char __pyx_k_test[] = "__test__"; +static const char __pyx_k_again[] = "again"; +static const char __pyx_k_ascii[] = "ascii"; +static const char __pyx_k_class[] = "__class__"; +static const char __pyx_k_close[] = "close"; +static const char __pyx_k_flags[] = "flags"; +static const char __pyx_k_ndots[] = "ndots"; +static const char __pyx_k_split[] = "split"; +static const char __pyx_k_start[] = "start"; +static const char __pyx_k_timer[] = "timer"; +static const char __pyx_k_tries[] = "tries"; +static const char __pyx_k_value[] = "value"; +static const char __pyx_k_encode[] = "encode"; +static const char __pyx_k_events[] = "events"; +static const char __pyx_k_family[] = "family"; +static const char __pyx_k_import[] = "__import__"; +static const char __pyx_k_module[] = "__module__"; +static const char __pyx_k_name_2[] = "name"; +static const char __pyx_k_result[] = "result"; +static const char __pyx_k_socket[] = "_socket"; +static const char __pyx_k_TIMEOUT[] = "TIMEOUT"; +static const char __pyx_k_channel[] = "channel"; +static const char __pyx_k_default[] = "default"; +static const char __pyx_k_destroy[] = "destroy"; +static const char __pyx_k_prepare[] = "__prepare__"; +static const char __pyx_k_servers[] = "servers"; +static const char __pyx_k_timeout[] = "timeout"; +static const char __pyx_k_unicode[] = "unicode"; +static const char __pyx_k_watcher[] = "watcher"; +static const char __pyx_k_ARES_EOF[] = "ARES_EOF"; +static const char __pyx_k_NI_DGRAM[] = "NI_DGRAM"; +static const char __pyx_k_builtins[] = "__builtins__"; +static const char __pyx_k_callback[] = "callback"; +static const char __pyx_k_exc_info[] = "exc_info"; +static const char __pyx_k_gaierror[] = "gaierror"; +static const char __pyx_k_iterable[] = "iterable"; +static const char __pyx_k_on_timer[] = "_on_timer"; +static const char __pyx_k_qualname[] = "__qualname__"; +static const char __pyx_k_sockaddr[] = "sockaddr"; +static const char __pyx_k_tcp_port[] = "tcp_port"; +static const char __pyx_k_udp_port[] = "udp_port"; +static const char __pyx_k_InvalidIP[] = "InvalidIP"; +static const char __pyx_k_NI_NOFQDN[] = "NI_NOFQDN"; +static const char __pyx_k_TypeError[] = "TypeError"; +static const char __pyx_k_exception[] = "exception"; +static const char __pyx_k_metaclass[] = "__metaclass__"; +static const char __pyx_k_ARES_EFILE[] = "ARES_EFILE"; +static const char __pyx_k_ValueError[] = "ValueError"; +static const char __pyx_k_basestring[] = "basestring"; +static const char __pyx_k_getnewargs[] = "__getnewargs__"; +static const char __pyx_k_process_fd[] = "_process_fd"; +static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__"; +static const char __pyx_k_ARES_ENOMEM[] = "ARES_ENOMEM"; +static const char __pyx_k_MemoryError[] = "MemoryError"; +static const char __pyx_k_NI_NAMEREQD[] = "NI_NAMEREQD"; +static const char __pyx_k_ares_errors[] = "_ares_errors"; +static const char __pyx_k_getnameinfo[] = "_getnameinfo"; +static const char __pyx_k_pass_events[] = "pass_events"; +static const char __pyx_k_set_servers[] = "set_servers"; +static const char __pyx_k_ARES_EBADSTR[] = "ARES_EBADSTR"; +static const char __pyx_k_ARES_ENODATA[] = "ARES_ENODATA"; +static const char __pyx_k_ARES_ENONAME[] = "ARES_ENONAME"; +static const char __pyx_k_ARES_ENOTIMP[] = "ARES_ENOTIMP"; +static const char __pyx_k_ARES_SUCCESS[] = "ARES_SUCCESS"; +static const char __pyx_k_handle_error[] = "handle_error"; +static const char __pyx_k_version_info[] = "version_info"; +static const char __pyx_k_ARES_EBADNAME[] = "ARES_EBADNAME"; +static const char __pyx_k_ARES_EBADRESP[] = "ARES_EBADRESP"; +static const char __pyx_k_ARES_EFORMERR[] = "ARES_EFORMERR"; +static const char __pyx_k_ARES_EREFUSED[] = "ARES_EREFUSED"; +static const char __pyx_k_ARES_ETIMEOUT[] = "ARES_ETIMEOUT"; +static const char __pyx_k_s_exception_r[] = "%s(exception=%r)"; +static const char __pyx_k_ARES_EBADFLAGS[] = "ARES_EBADFLAGS"; +static const char __pyx_k_ARES_EBADHINTS[] = "ARES_EBADHINTS"; +static const char __pyx_k_ARES_EBADQUERY[] = "ARES_EBADQUERY"; +static const char __pyx_k_ARES_ENOTFOUND[] = "ARES_ENOTFOUND"; +static const char __pyx_k_ARES_ESERVFAIL[] = "ARES_ESERVFAIL"; +static const char __pyx_k_NI_NUMERICHOST[] = "NI_NUMERICHOST"; +static const char __pyx_k_NI_NUMERICSERV[] = "NI_NUMERICSERV"; +static const char __pyx_k_cares_flag_map[] = "_cares_flag_map"; +static const char __pyx_k_ARES_EBADFAMILY[] = "ARES_EBADFAMILY"; +static const char __pyx_k_ARES_ECANCELLED[] = "ARES_ECANCELLED"; +static const char __pyx_k_ARES_FLAG_IGNTC[] = "ARES_FLAG_IGNTC"; +static const char __pyx_k_ARES_FLAG_USEVC[] = "ARES_FLAG_USEVC"; +static const char __pyx_k_ares_host_result[] = "ares_host_result"; +static const char __pyx_k_ARES_ECONNREFUSED[] = "ARES_ECONNREFUSED"; +static const char __pyx_k_ARES_EDESTRUCTION[] = "ARES_EDESTRUCTION"; +static const char __pyx_k_ARES_FLAG_PRIMARY[] = "ARES_FLAG_PRIMARY"; +static const char __pyx_k_ARES_ELOADIPHLPAPI[] = "ARES_ELOADIPHLPAPI"; +static const char __pyx_k_ARES_FLAG_NOSEARCH[] = "ARES_FLAG_NOSEARCH"; +static const char __pyx_k_ARES_FLAG_STAYOPEN[] = "ARES_FLAG_STAYOPEN"; +static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; +static const char __pyx_k_ARES_FLAG_NOALIASES[] = "ARES_FLAG_NOALIASES"; +static const char __pyx_k_ARES_FLAG_NORECURSE[] = "ARES_FLAG_NORECURSE"; +static const char __pyx_k_ARES_ENOTINITIALIZED[] = "ARES_ENOTINITIALIZED"; +static const char __pyx_k_ARES_FLAG_NOCHECKRESP[] = "ARES_FLAG_NOCHECKRESP"; +static const char __pyx_k_gevent_resolver_cares[] = "gevent.resolver.cares"; +static const char __pyx_k_s_value_r_exception_r[] = "%s(value=%r, exception=%r)"; +static const char __pyx_k_ares_host_result___new[] = "ares_host_result.__new__"; +static const char __pyx_k_expected_a_tuple_got_r[] = "expected a tuple, got %r"; +static const char __pyx_k_Invalid_value_for_port_r[] = "Invalid value for port: %r"; +static const char __pyx_k_ARES_EADDRGETNETWORKPARAMS[] = "ARES_EADDRGETNETWORKPARAMS"; +static const char __pyx_k_Bad_value_for_ai_flags_0x_x[] = "Bad value for ai_flags: 0x%x"; +static const char __pyx_k_ares_host_result___getnewargs[] = "ares_host_result.__getnewargs__"; +static const char __pyx_k_src_gevent_resolver_cares_pyx[] = "src\\gevent\\resolver\\cares.pyx"; +static const char __pyx_k_s_at_0x_x__timer_r__watchers_s[] = "<%s at 0x%x _timer=%r _watchers[%s]>"; +static const char __pyx_k_this_ares_channel_has_been_destr[] = "this ares channel has been destroyed"; +static PyObject *__pyx_n_s_ARES_EADDRGETNETWORKPARAMS; +static PyObject *__pyx_n_s_ARES_EBADFAMILY; +static PyObject *__pyx_n_s_ARES_EBADFLAGS; +static PyObject *__pyx_n_s_ARES_EBADHINTS; +static PyObject *__pyx_n_s_ARES_EBADNAME; +static PyObject *__pyx_n_s_ARES_EBADQUERY; +static PyObject *__pyx_n_s_ARES_EBADRESP; +static PyObject *__pyx_n_s_ARES_EBADSTR; +static PyObject *__pyx_n_s_ARES_ECANCELLED; +static PyObject *__pyx_n_s_ARES_ECONNREFUSED; +static PyObject *__pyx_n_s_ARES_EDESTRUCTION; +static PyObject *__pyx_n_s_ARES_EFILE; +static PyObject *__pyx_n_s_ARES_EFORMERR; +static PyObject *__pyx_n_s_ARES_ELOADIPHLPAPI; +static PyObject *__pyx_n_s_ARES_ENODATA; +static PyObject *__pyx_n_s_ARES_ENOMEM; +static PyObject *__pyx_n_s_ARES_ENONAME; +static PyObject *__pyx_n_s_ARES_ENOTFOUND; +static PyObject *__pyx_n_s_ARES_ENOTIMP; +static PyObject *__pyx_n_s_ARES_ENOTINITIALIZED; +static PyObject *__pyx_n_s_ARES_EOF; +static PyObject *__pyx_n_s_ARES_EREFUSED; +static PyObject *__pyx_n_s_ARES_ESERVFAIL; +static PyObject *__pyx_n_s_ARES_ETIMEOUT; +static PyObject *__pyx_n_s_ARES_FLAG_IGNTC; +static PyObject *__pyx_n_s_ARES_FLAG_NOALIASES; +static PyObject *__pyx_n_s_ARES_FLAG_NOCHECKRESP; +static PyObject *__pyx_n_s_ARES_FLAG_NORECURSE; +static PyObject *__pyx_n_s_ARES_FLAG_NOSEARCH; +static PyObject *__pyx_n_s_ARES_FLAG_PRIMARY; +static PyObject *__pyx_n_s_ARES_FLAG_STAYOPEN; +static PyObject *__pyx_n_s_ARES_FLAG_USEVC; +static PyObject *__pyx_n_s_ARES_SUCCESS; +static PyObject *__pyx_kp_s_Bad_value_for_ai_flags_0x_x; +static PyObject *__pyx_n_s_InvalidIP; +static PyObject *__pyx_kp_s_Invalid_value_for_port_r; +static PyObject *__pyx_n_s_MemoryError; +static PyObject *__pyx_n_s_NI_DGRAM; +static PyObject *__pyx_n_s_NI_NAMEREQD; +static PyObject *__pyx_n_s_NI_NOFQDN; +static PyObject *__pyx_n_s_NI_NUMERICHOST; +static PyObject *__pyx_n_s_NI_NUMERICSERV; +static PyObject *__pyx_n_s_TIMEOUT; +static PyObject *__pyx_n_s_TypeError; +static PyObject *__pyx_n_s_ValueError; +static PyObject *__pyx_kp_s__2; +static PyObject *__pyx_n_s_addr; +static PyObject *__pyx_n_s_again; +static PyObject *__pyx_n_s_all; +static PyObject *__pyx_n_s_ares_errors; +static PyObject *__pyx_n_s_ares_host_result; +static PyObject *__pyx_n_s_ares_host_result___getnewargs; +static PyObject *__pyx_n_s_ares_host_result___new; +static PyObject *__pyx_n_s_ascii; +static PyObject *__pyx_n_s_basestring; +static PyObject *__pyx_n_s_builtins; +static PyObject *__pyx_n_s_callback; +static PyObject *__pyx_n_s_cares_flag_map; +static PyObject *__pyx_n_s_channel; +static PyObject *__pyx_n_s_class; +static PyObject *__pyx_n_s_cline_in_traceback; +static PyObject *__pyx_n_s_close; +static PyObject *__pyx_n_s_cls; +static PyObject *__pyx_n_s_default; +static PyObject *__pyx_n_s_destroy; +static PyObject *__pyx_n_s_doc; +static PyObject *__pyx_n_s_encode; +static PyObject *__pyx_n_s_events; +static PyObject *__pyx_n_s_exc_info; +static PyObject *__pyx_n_s_exception; +static PyObject *__pyx_kp_s_expected_a_tuple_got_r; +static PyObject *__pyx_n_s_family; +static PyObject *__pyx_n_s_fd; +static PyObject *__pyx_n_s_flags; +static PyObject *__pyx_n_s_gaierror; +static PyObject *__pyx_n_s_get; +static PyObject *__pyx_n_s_getnameinfo; +static PyObject *__pyx_n_s_getnewargs; +static PyObject *__pyx_n_s_gevent_resolver_cares; +static PyObject *__pyx_n_s_handle_error; +static PyObject *__pyx_n_s_id; +static PyObject *__pyx_n_s_import; +static PyObject *__pyx_n_s_io; +static PyObject *__pyx_n_s_iterable; +static PyObject *__pyx_n_s_loop; +static PyObject *__pyx_n_s_main; +static PyObject *__pyx_n_s_metaclass; +static PyObject *__pyx_n_s_module; +static PyObject *__pyx_n_s_name; +static PyObject *__pyx_n_s_name_2; +static PyObject *__pyx_n_s_ndots; +static PyObject *__pyx_n_s_new; +static PyObject *__pyx_n_s_on_timer; +static PyObject *__pyx_n_s_pass_events; +static PyObject *__pyx_n_s_pop; +static PyObject *__pyx_n_s_prepare; +static PyObject *__pyx_n_s_process_fd; +static PyObject *__pyx_n_s_pyx_vtable; +static PyObject *__pyx_n_s_qualname; +static PyObject *__pyx_n_s_result; +static PyObject *__pyx_kp_s_s_at_0x_x__timer_r__watchers_s; +static PyObject *__pyx_kp_s_s_exception_r; +static PyObject *__pyx_kp_s_s_r; +static PyObject *__pyx_kp_s_s_s; +static PyObject *__pyx_kp_s_s_value_r_exception_r; +static PyObject *__pyx_n_s_self; +static PyObject *__pyx_n_s_servers; +static PyObject *__pyx_n_s_set_servers; +static PyObject *__pyx_n_s_sockaddr; +static PyObject *__pyx_n_s_socket; +static PyObject *__pyx_n_s_split; +static PyObject *__pyx_kp_s_src_gevent_resolver_cares_pyx; +static PyObject *__pyx_n_s_start; +static PyObject *__pyx_n_s_stop; +static PyObject *__pyx_n_s_sys; +static PyObject *__pyx_n_s_tcp_port; +static PyObject *__pyx_n_s_test; +static PyObject *__pyx_kp_s_this_ares_channel_has_been_destr; +static PyObject *__pyx_n_s_timeout; +static PyObject *__pyx_n_s_timer; +static PyObject *__pyx_n_s_tries; +static PyObject *__pyx_n_s_udp_port; +static PyObject *__pyx_n_s_unicode; +static PyObject *__pyx_n_s_value; +static PyObject *__pyx_n_s_version_info; +static PyObject *__pyx_n_s_watcher; +static PyObject *__pyx_pf_6gevent_8resolver_5cares__convert_cares_flags(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_flags, int __pyx_v_default); /* proto */ +static PyObject *__pyx_pf_6gevent_8resolver_5cares_2strerror(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_code); /* proto */ +static int __pyx_pf_6gevent_8resolver_5cares_6result___init__(struct __pyx_obj_6gevent_8resolver_5cares_result *__pyx_v_self, PyObject *__pyx_v_value, PyObject *__pyx_v_exception); /* proto */ +static PyObject *__pyx_pf_6gevent_8resolver_5cares_6result_2__repr__(struct __pyx_obj_6gevent_8resolver_5cares_result *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_8resolver_5cares_6result_4successful(struct __pyx_obj_6gevent_8resolver_5cares_result *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_8resolver_5cares_6result_6get(struct __pyx_obj_6gevent_8resolver_5cares_result *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_8resolver_5cares_6result_5value___get__(struct __pyx_obj_6gevent_8resolver_5cares_result *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_8resolver_5cares_6result_5value_2__set__(struct __pyx_obj_6gevent_8resolver_5cares_result *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6gevent_8resolver_5cares_6result_5value_4__del__(struct __pyx_obj_6gevent_8resolver_5cares_result *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_8resolver_5cares_6result_9exception___get__(struct __pyx_obj_6gevent_8resolver_5cares_result *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_8resolver_5cares_6result_9exception_2__set__(struct __pyx_obj_6gevent_8resolver_5cares_result *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6gevent_8resolver_5cares_6result_9exception_4__del__(struct __pyx_obj_6gevent_8resolver_5cares_result *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_8resolver_5cares_16ares_host_result___new__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_cls, PyObject *__pyx_v_family, PyObject *__pyx_v_iterable); /* proto */ +static PyObject *__pyx_pf_6gevent_8resolver_5cares_16ares_host_result_2__getnewargs__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_8resolver_5cares_7channel___init__(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self, PyObject *__pyx_v_loop, PyObject *__pyx_v_flags, PyObject *__pyx_v_timeout, PyObject *__pyx_v_tries, PyObject *__pyx_v_ndots, PyObject *__pyx_v_udp_port, PyObject *__pyx_v_tcp_port, PyObject *__pyx_v_servers); /* proto */ +static PyObject *__pyx_pf_6gevent_8resolver_5cares_7channel_2__repr__(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_8resolver_5cares_7channel_4destroy(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self); /* proto */ +static void __pyx_pf_6gevent_8resolver_5cares_7channel_6__dealloc__(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_8resolver_5cares_7channel_8set_servers(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self, PyObject *__pyx_v_servers); /* proto */ +static PyObject *__pyx_pf_6gevent_8resolver_5cares_7channel_10_on_timer(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_8resolver_5cares_7channel_12_process_fd(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self, int __pyx_v_events, PyObject *__pyx_v_watcher); /* proto */ +static PyObject *__pyx_pf_6gevent_8resolver_5cares_7channel_14gethostbyname(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self, PyObject *__pyx_v_callback, char *__pyx_v_name, int __pyx_v_family); /* proto */ +static PyObject *__pyx_pf_6gevent_8resolver_5cares_7channel_16gethostbyaddr(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self, PyObject *__pyx_v_callback, char *__pyx_v_addr); /* proto */ +static PyObject *__pyx_pf_6gevent_8resolver_5cares_7channel_18_getnameinfo(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self, PyObject *__pyx_v_callback, PyObject *__pyx_v_sockaddr, int __pyx_v_flags); /* proto */ +static PyObject *__pyx_pf_6gevent_8resolver_5cares_7channel_20getnameinfo(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self, PyObject *__pyx_v_callback, PyObject *__pyx_v_sockaddr, int __pyx_v_flags); /* proto */ +static PyObject *__pyx_pf_6gevent_8resolver_5cares_7channel_4loop___get__(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_8resolver_5cares_7channel_4loop_2__set__(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6gevent_8resolver_5cares_7channel_4loop_4__del__(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_8resolver_5cares_7channel_9_watchers___get__(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_8resolver_5cares_7channel_9_watchers_2__set__(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6gevent_8resolver_5cares_7channel_9_watchers_4__del__(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_8resolver_5cares_7channel_6_timer___get__(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_8resolver_5cares_7channel_6_timer_2__set__(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6gevent_8resolver_5cares_7channel_6_timer_4__del__(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self); /* proto */ +static PyObject *__pyx_tp_new_6gevent_8resolver_5cares_result(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6gevent_8resolver_5cares_channel(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_get = {0, &__pyx_n_s_get, 0, 0, 0}; +static __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_pop = {0, &__pyx_n_s_pop, 0, 0, 0}; +static PyObject *__pyx_int_1; +static PyObject *__pyx_int_2; +static PyObject *__pyx_int_3; +static PyObject *__pyx_int_4; +static PyObject *__pyx_int_8; +static PyObject *__pyx_int_16; +static PyObject *__pyx_int_neg_1; +static PyObject *__pyx_int_neg_8; +static int __pyx_k_; +static int __pyx_k__3; +static PyObject *__pyx_tuple__4; +static PyObject *__pyx_tuple__5; +static PyObject *__pyx_tuple__7; +static PyObject *__pyx_codeobj__6; +static PyObject *__pyx_codeobj__8; +/* Late includes */ + +/* "gevent/resolver/cares.pyx":135 + * + * + * cdef _prepare_cares_flag_map(): # <<<<<<<<<<<<<< + * global _cares_flag_map + * import _socket + */ + +static PyObject *__pyx_f_6gevent_8resolver_5cares__prepare_cares_flag_map(void) { + PyObject *__pyx_v__socket = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + __Pyx_RefNannySetupContext("_prepare_cares_flag_map", 0); + + /* "gevent/resolver/cares.pyx":137 + * cdef _prepare_cares_flag_map(): + * global _cares_flag_map + * import _socket # <<<<<<<<<<<<<< + * _cares_flag_map = [ + * (getattr(_socket, 'NI_NUMERICHOST', 1), cares.ARES_NI_NUMERICHOST), + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_socket, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 137, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v__socket = __pyx_t_1; + __pyx_t_1 = 0; + + /* "gevent/resolver/cares.pyx":139 + * import _socket + * _cares_flag_map = [ + * (getattr(_socket, 'NI_NUMERICHOST', 1), cares.ARES_NI_NUMERICHOST), # <<<<<<<<<<<<<< + * (getattr(_socket, 'NI_NUMERICSERV', 2), cares.ARES_NI_NUMERICSERV), + * (getattr(_socket, 'NI_NOFQDN', 4), cares.ARES_NI_NOFQDN), + */ + __pyx_t_1 = __Pyx_GetAttr3(__pyx_v__socket, __pyx_n_s_NI_NUMERICHOST, __pyx_int_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 139, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyInt_From_int(ARES_NI_NUMERICHOST); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 139, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 139, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); + __pyx_t_1 = 0; + __pyx_t_2 = 0; + + /* "gevent/resolver/cares.pyx":140 + * _cares_flag_map = [ + * (getattr(_socket, 'NI_NUMERICHOST', 1), cares.ARES_NI_NUMERICHOST), + * (getattr(_socket, 'NI_NUMERICSERV', 2), cares.ARES_NI_NUMERICSERV), # <<<<<<<<<<<<<< + * (getattr(_socket, 'NI_NOFQDN', 4), cares.ARES_NI_NOFQDN), + * (getattr(_socket, 'NI_NAMEREQD', 8), cares.ARES_NI_NAMEREQD), + */ + __pyx_t_2 = __Pyx_GetAttr3(__pyx_v__socket, __pyx_n_s_NI_NUMERICSERV, __pyx_int_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 140, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyInt_From_int(ARES_NI_NUMERICSERV); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 140, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 140, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1); + __pyx_t_2 = 0; + __pyx_t_1 = 0; + + /* "gevent/resolver/cares.pyx":141 + * (getattr(_socket, 'NI_NUMERICHOST', 1), cares.ARES_NI_NUMERICHOST), + * (getattr(_socket, 'NI_NUMERICSERV', 2), cares.ARES_NI_NUMERICSERV), + * (getattr(_socket, 'NI_NOFQDN', 4), cares.ARES_NI_NOFQDN), # <<<<<<<<<<<<<< + * (getattr(_socket, 'NI_NAMEREQD', 8), cares.ARES_NI_NAMEREQD), + * (getattr(_socket, 'NI_DGRAM', 16), cares.ARES_NI_DGRAM)] + */ + __pyx_t_1 = __Pyx_GetAttr3(__pyx_v__socket, __pyx_n_s_NI_NOFQDN, __pyx_int_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 141, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyInt_From_int(ARES_NI_NOFQDN); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 141, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 141, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2); + __pyx_t_1 = 0; + __pyx_t_2 = 0; + + /* "gevent/resolver/cares.pyx":142 + * (getattr(_socket, 'NI_NUMERICSERV', 2), cares.ARES_NI_NUMERICSERV), + * (getattr(_socket, 'NI_NOFQDN', 4), cares.ARES_NI_NOFQDN), + * (getattr(_socket, 'NI_NAMEREQD', 8), cares.ARES_NI_NAMEREQD), # <<<<<<<<<<<<<< + * (getattr(_socket, 'NI_DGRAM', 16), cares.ARES_NI_DGRAM)] + * + */ + __pyx_t_2 = __Pyx_GetAttr3(__pyx_v__socket, __pyx_n_s_NI_NAMEREQD, __pyx_int_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 142, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyInt_From_int(ARES_NI_NAMEREQD); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 142, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 142, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_1); + __pyx_t_2 = 0; + __pyx_t_1 = 0; + + /* "gevent/resolver/cares.pyx":143 + * (getattr(_socket, 'NI_NOFQDN', 4), cares.ARES_NI_NOFQDN), + * (getattr(_socket, 'NI_NAMEREQD', 8), cares.ARES_NI_NAMEREQD), + * (getattr(_socket, 'NI_DGRAM', 16), cares.ARES_NI_DGRAM)] # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_1 = __Pyx_GetAttr3(__pyx_v__socket, __pyx_n_s_NI_DGRAM, __pyx_int_16); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 143, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyInt_From_int(ARES_NI_DGRAM); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 143, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 143, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_2); + __pyx_t_1 = 0; + __pyx_t_2 = 0; + + /* "gevent/resolver/cares.pyx":138 + * global _cares_flag_map + * import _socket + * _cares_flag_map = [ # <<<<<<<<<<<<<< + * (getattr(_socket, 'NI_NUMERICHOST', 1), cares.ARES_NI_NUMERICHOST), + * (getattr(_socket, 'NI_NUMERICSERV', 2), cares.ARES_NI_NUMERICSERV), + */ + __pyx_t_2 = PyList_New(5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 138, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_3); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_4); + PyList_SET_ITEM(__pyx_t_2, 1, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_5); + PyList_SET_ITEM(__pyx_t_2, 2, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_6); + PyList_SET_ITEM(__pyx_t_2, 3, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_7); + PyList_SET_ITEM(__pyx_t_2, 4, __pyx_t_7); + __pyx_t_3 = 0; + __pyx_t_4 = 0; + __pyx_t_5 = 0; + __pyx_t_6 = 0; + __pyx_t_7 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_cares_flag_map, __pyx_t_2) < 0) __PYX_ERR(0, 138, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "gevent/resolver/cares.pyx":135 + * + * + * cdef _prepare_cares_flag_map(): # <<<<<<<<<<<<<< + * global _cares_flag_map + * import _socket + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("gevent.resolver.cares._prepare_cares_flag_map", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v__socket); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/resolver/cares.pyx":146 + * + * + * cpdef _convert_cares_flags(int flags, int default=cares.ARES_NI_LOOKUPHOST|cares.ARES_NI_LOOKUPSERVICE): # <<<<<<<<<<<<<< + * if _cares_flag_map is None: + * _prepare_cares_flag_map() + */ + +static PyObject *__pyx_pw_6gevent_8resolver_5cares_1_convert_cares_flags(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_6gevent_8resolver_5cares__convert_cares_flags(int __pyx_v_flags, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_8resolver_5cares__convert_cares_flags *__pyx_optional_args) { + int __pyx_v_default = __pyx_k_; + PyObject *__pyx_v_socket_flag = NULL; + PyObject *__pyx_v_cares_flag = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + Py_ssize_t __pyx_t_5; + PyObject *(*__pyx_t_6)(PyObject *); + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *(*__pyx_t_10)(PyObject *); + int __pyx_t_11; + __Pyx_RefNannySetupContext("_convert_cares_flags", 0); + if (__pyx_optional_args) { + if (__pyx_optional_args->__pyx_n > 0) { + __pyx_v_default = __pyx_optional_args->__pyx_default; + } + } + + /* "gevent/resolver/cares.pyx":147 + * + * cpdef _convert_cares_flags(int flags, int default=cares.ARES_NI_LOOKUPHOST|cares.ARES_NI_LOOKUPSERVICE): + * if _cares_flag_map is None: # <<<<<<<<<<<<<< + * _prepare_cares_flag_map() + * for socket_flag, cares_flag in _cares_flag_map: + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_cares_flag_map); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 147, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = (__pyx_t_1 == Py_None); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "gevent/resolver/cares.pyx":148 + * cpdef _convert_cares_flags(int flags, int default=cares.ARES_NI_LOOKUPHOST|cares.ARES_NI_LOOKUPSERVICE): + * if _cares_flag_map is None: + * _prepare_cares_flag_map() # <<<<<<<<<<<<<< + * for socket_flag, cares_flag in _cares_flag_map: + * if socket_flag & flags: + */ + __pyx_t_1 = __pyx_f_6gevent_8resolver_5cares__prepare_cares_flag_map(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 148, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "gevent/resolver/cares.pyx":147 + * + * cpdef _convert_cares_flags(int flags, int default=cares.ARES_NI_LOOKUPHOST|cares.ARES_NI_LOOKUPSERVICE): + * if _cares_flag_map is None: # <<<<<<<<<<<<<< + * _prepare_cares_flag_map() + * for socket_flag, cares_flag in _cares_flag_map: + */ + } + + /* "gevent/resolver/cares.pyx":149 + * if _cares_flag_map is None: + * _prepare_cares_flag_map() + * for socket_flag, cares_flag in _cares_flag_map: # <<<<<<<<<<<<<< + * if socket_flag & flags: + * default |= cares_flag + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_cares_flag_map); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 149, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { + __pyx_t_4 = __pyx_t_1; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0; + __pyx_t_6 = NULL; + } else { + __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 149, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 149, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + for (;;) { + if (likely(!__pyx_t_6)) { + if (likely(PyList_CheckExact(__pyx_t_4))) { + if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_1 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 149, __pyx_L1_error) + #else + __pyx_t_1 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 149, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + #endif + } else { + if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 149, __pyx_L1_error) + #else + __pyx_t_1 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 149, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + #endif + } + } else { + __pyx_t_1 = __pyx_t_6(__pyx_t_4); + if (unlikely(!__pyx_t_1)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(0, 149, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_1); + } + if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { + PyObject* sequence = __pyx_t_1; + Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + __PYX_ERR(0, 149, __pyx_L1_error) + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_7 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_8 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_7 = PyList_GET_ITEM(sequence, 0); + __pyx_t_8 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_7); + __Pyx_INCREF(__pyx_t_8); + #else + __pyx_t_7 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 149, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 149, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_9 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 149, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_10 = Py_TYPE(__pyx_t_9)->tp_iternext; + index = 0; __pyx_t_7 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_7)) goto __pyx_L6_unpacking_failed; + __Pyx_GOTREF(__pyx_t_7); + index = 1; __pyx_t_8 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_8)) goto __pyx_L6_unpacking_failed; + __Pyx_GOTREF(__pyx_t_8); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) __PYX_ERR(0, 149, __pyx_L1_error) + __pyx_t_10 = NULL; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L7_unpacking_done; + __pyx_L6_unpacking_failed:; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_10 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + __PYX_ERR(0, 149, __pyx_L1_error) + __pyx_L7_unpacking_done:; + } + __Pyx_XDECREF_SET(__pyx_v_socket_flag, __pyx_t_7); + __pyx_t_7 = 0; + __Pyx_XDECREF_SET(__pyx_v_cares_flag, __pyx_t_8); + __pyx_t_8 = 0; + + /* "gevent/resolver/cares.pyx":150 + * _prepare_cares_flag_map() + * for socket_flag, cares_flag in _cares_flag_map: + * if socket_flag & flags: # <<<<<<<<<<<<<< + * default |= cares_flag + * flags &= ~socket_flag + */ + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 150, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_8 = PyNumber_And(__pyx_v_socket_flag, __pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 150, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 150, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__pyx_t_3) { + + /* "gevent/resolver/cares.pyx":151 + * for socket_flag, cares_flag in _cares_flag_map: + * if socket_flag & flags: + * default |= cares_flag # <<<<<<<<<<<<<< + * flags &= ~socket_flag + * if not flags: + */ + __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_default); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 151, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_1 = PyNumber_InPlaceOr(__pyx_t_8, __pyx_v_cares_flag); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 151, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_11 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 151, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_default = __pyx_t_11; + + /* "gevent/resolver/cares.pyx":152 + * if socket_flag & flags: + * default |= cares_flag + * flags &= ~socket_flag # <<<<<<<<<<<<<< + * if not flags: + * return default + */ + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 152, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_8 = PyNumber_Invert(__pyx_v_socket_flag); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 152, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_7 = PyNumber_InPlaceAnd(__pyx_t_1, __pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 152, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_11 = __Pyx_PyInt_As_int(__pyx_t_7); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 152, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_v_flags = __pyx_t_11; + + /* "gevent/resolver/cares.pyx":150 + * _prepare_cares_flag_map() + * for socket_flag, cares_flag in _cares_flag_map: + * if socket_flag & flags: # <<<<<<<<<<<<<< + * default |= cares_flag + * flags &= ~socket_flag + */ + } + + /* "gevent/resolver/cares.pyx":153 + * default |= cares_flag + * flags &= ~socket_flag + * if not flags: # <<<<<<<<<<<<<< + * return default + * raise gaierror(-1, "Bad value for ai_flags: 0x%x" % flags) + */ + __pyx_t_3 = ((!(__pyx_v_flags != 0)) != 0); + if (__pyx_t_3) { + + /* "gevent/resolver/cares.pyx":154 + * flags &= ~socket_flag + * if not flags: + * return default # <<<<<<<<<<<<<< + * raise gaierror(-1, "Bad value for ai_flags: 0x%x" % flags) + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_default); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 154, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_r = __pyx_t_7; + __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L0; + + /* "gevent/resolver/cares.pyx":153 + * default |= cares_flag + * flags &= ~socket_flag + * if not flags: # <<<<<<<<<<<<<< + * return default + * raise gaierror(-1, "Bad value for ai_flags: 0x%x" % flags) + */ + } + + /* "gevent/resolver/cares.pyx":149 + * if _cares_flag_map is None: + * _prepare_cares_flag_map() + * for socket_flag, cares_flag in _cares_flag_map: # <<<<<<<<<<<<<< + * if socket_flag & flags: + * default |= cares_flag + */ + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "gevent/resolver/cares.pyx":155 + * if not flags: + * return default + * raise gaierror(-1, "Bad value for ai_flags: 0x%x" % flags) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_gaierror); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 155, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 155, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_Bad_value_for_ai_flags_0x_x, __pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 155, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = NULL; + __pyx_t_11 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) { + __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); + if (likely(__pyx_t_8)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); + __Pyx_INCREF(__pyx_t_8); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_7, function); + __pyx_t_11 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_7)) { + PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_int_neg_1, __pyx_t_1}; + __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 155, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) { + PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_int_neg_1, __pyx_t_1}; + __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 155, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else + #endif + { + __pyx_t_9 = PyTuple_New(2+__pyx_t_11); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 155, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + if (__pyx_t_8) { + __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = NULL; + } + __Pyx_INCREF(__pyx_int_neg_1); + __Pyx_GIVEREF(__pyx_int_neg_1); + PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_11, __pyx_int_neg_1); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_11, __pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_9, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 155, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __PYX_ERR(0, 155, __pyx_L1_error) + + /* "gevent/resolver/cares.pyx":146 + * + * + * cpdef _convert_cares_flags(int flags, int default=cares.ARES_NI_LOOKUPHOST|cares.ARES_NI_LOOKUPSERVICE): # <<<<<<<<<<<<<< + * if _cares_flag_map is None: + * _prepare_cares_flag_map() + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_AddTraceback("gevent.resolver.cares._convert_cares_flags", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_socket_flag); + __Pyx_XDECREF(__pyx_v_cares_flag); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_8resolver_5cares_1_convert_cares_flags(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6gevent_8resolver_5cares_1_convert_cares_flags(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + int __pyx_v_flags; + int __pyx_v_default; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_convert_cares_flags (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_flags,&__pyx_n_s_default,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flags)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_default); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_convert_cares_flags") < 0)) __PYX_ERR(0, 146, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_flags = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 146, __pyx_L3_error) + if (values[1]) { + __pyx_v_default = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_default == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 146, __pyx_L3_error) + } else { + __pyx_v_default = __pyx_k_; + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("_convert_cares_flags", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 146, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.resolver.cares._convert_cares_flags", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_8resolver_5cares__convert_cares_flags(__pyx_self, __pyx_v_flags, __pyx_v_default); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_8resolver_5cares__convert_cares_flags(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_flags, int __pyx_v_default) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + struct __pyx_opt_args_6gevent_8resolver_5cares__convert_cares_flags __pyx_t_2; + __Pyx_RefNannySetupContext("_convert_cares_flags", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_2.__pyx_n = 1; + __pyx_t_2.__pyx_default = __pyx_v_default; + __pyx_t_1 = __pyx_f_6gevent_8resolver_5cares__convert_cares_flags(__pyx_v_flags, 0, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 146, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.resolver.cares._convert_cares_flags", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/resolver/cares.pyx":158 + * + * + * cpdef strerror(code): # <<<<<<<<<<<<<< + * return '%s: %s' % (_ares_errors.get(code) or code, cares.ares_strerror(code)) + * + */ + +static PyObject *__pyx_pw_6gevent_8resolver_5cares_3strerror(PyObject *__pyx_self, PyObject *__pyx_v_code); /*proto*/ +static PyObject *__pyx_f_6gevent_8resolver_5cares_strerror(PyObject *__pyx_v_code, CYTHON_UNUSED int __pyx_skip_dispatch) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + int __pyx_t_6; + __Pyx_RefNannySetupContext("strerror", 0); + + /* "gevent/resolver/cares.pyx":159 + * + * cpdef strerror(code): + * return '%s: %s' % (_ares_errors.get(code) or code, cares.ares_strerror(code)) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ares_errors); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 159, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_get); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 159, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + } + } + __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_3, __pyx_v_code) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_code); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 159, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 159, __pyx_L1_error) + if (!__pyx_t_5) { + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } else { + __Pyx_INCREF(__pyx_t_2); + __pyx_t_1 = __pyx_t_2; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + goto __pyx_L3_bool_binop_done; + } + __Pyx_INCREF(__pyx_v_code); + __pyx_t_1 = __pyx_v_code; + __pyx_L3_bool_binop_done:; + __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_v_code); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 159, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBytes_FromString(ares_strerror(__pyx_t_6)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 159, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 159, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2); + __pyx_t_1 = 0; + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_s_s, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 159, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "gevent/resolver/cares.pyx":158 + * + * + * cpdef strerror(code): # <<<<<<<<<<<<<< + * return '%s: %s' % (_ares_errors.get(code) or code, cares.ares_strerror(code)) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("gevent.resolver.cares.strerror", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_8resolver_5cares_3strerror(PyObject *__pyx_self, PyObject *__pyx_v_code); /*proto*/ +static PyObject *__pyx_pw_6gevent_8resolver_5cares_3strerror(PyObject *__pyx_self, PyObject *__pyx_v_code) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("strerror (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_8resolver_5cares_2strerror(__pyx_self, ((PyObject *)__pyx_v_code)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_8resolver_5cares_2strerror(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_code) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("strerror", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6gevent_8resolver_5cares_strerror(__pyx_v_code, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 158, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.resolver.cares.strerror", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/resolver/cares.pyx":166 + * + * + * cdef void gevent_sock_state_callback(void *data, int s, int read, int write): # <<<<<<<<<<<<<< + * if not data: + * return + */ + +static void __pyx_f_6gevent_8resolver_5cares_gevent_sock_state_callback(void *__pyx_v_data, int __pyx_v_s, int __pyx_v_read, int __pyx_v_write) { + struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_ch = 0; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("gevent_sock_state_callback", 0); + + /* "gevent/resolver/cares.pyx":167 + * + * cdef void gevent_sock_state_callback(void *data, int s, int read, int write): + * if not data: # <<<<<<<<<<<<<< + * return + * cdef channel ch = data + */ + __pyx_t_1 = ((!(__pyx_v_data != 0)) != 0); + if (__pyx_t_1) { + + /* "gevent/resolver/cares.pyx":168 + * cdef void gevent_sock_state_callback(void *data, int s, int read, int write): + * if not data: + * return # <<<<<<<<<<<<<< + * cdef channel ch = data + * ch._sock_state_callback(s, read, write) + */ + goto __pyx_L0; + + /* "gevent/resolver/cares.pyx":167 + * + * cdef void gevent_sock_state_callback(void *data, int s, int read, int write): + * if not data: # <<<<<<<<<<<<<< + * return + * cdef channel ch = data + */ + } + + /* "gevent/resolver/cares.pyx":169 + * if not data: + * return + * cdef channel ch = data # <<<<<<<<<<<<<< + * ch._sock_state_callback(s, read, write) + * + */ + __pyx_t_2 = ((PyObject *)__pyx_v_data); + __Pyx_INCREF(__pyx_t_2); + __pyx_v_ch = ((struct __pyx_obj_6gevent_8resolver_5cares_channel *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "gevent/resolver/cares.pyx":170 + * return + * cdef channel ch = data + * ch._sock_state_callback(s, read, write) # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_2 = ((struct __pyx_vtabstruct_6gevent_8resolver_5cares_channel *)__pyx_v_ch->__pyx_vtab)->_sock_state_callback(__pyx_v_ch, __pyx_v_s, __pyx_v_read, __pyx_v_write); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 170, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "gevent/resolver/cares.pyx":166 + * + * + * cdef void gevent_sock_state_callback(void *data, int s, int read, int write): # <<<<<<<<<<<<<< + * if not data: + * return + */ + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_WriteUnraisable("gevent.resolver.cares.gevent_sock_state_callback", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_ch); + __Pyx_RefNannyFinishContext(); +} + +/* "gevent/resolver/cares.pyx":177 + * cdef public object exception + * + * def __init__(self, object value=None, object exception=None): # <<<<<<<<<<<<<< + * self.value = value + * self.exception = exception + */ + +/* Python wrapper */ +static int __pyx_pw_6gevent_8resolver_5cares_6result_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6gevent_8resolver_5cares_6result_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_value = 0; + PyObject *__pyx_v_exception = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_value,&__pyx_n_s_exception,0}; + PyObject* values[2] = {0,0}; + values[0] = ((PyObject *)Py_None); + values[1] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value); + if (value) { values[0] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 1: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_exception); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 177, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_value = values[0]; + __pyx_v_exception = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 177, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.resolver.cares.result.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_8resolver_5cares_6result___init__(((struct __pyx_obj_6gevent_8resolver_5cares_result *)__pyx_v_self), __pyx_v_value, __pyx_v_exception); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_8resolver_5cares_6result___init__(struct __pyx_obj_6gevent_8resolver_5cares_result *__pyx_v_self, PyObject *__pyx_v_value, PyObject *__pyx_v_exception) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__", 0); + + /* "gevent/resolver/cares.pyx":178 + * + * def __init__(self, object value=None, object exception=None): + * self.value = value # <<<<<<<<<<<<<< + * self.exception = exception + * + */ + __Pyx_INCREF(__pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + __Pyx_GOTREF(__pyx_v_self->value); + __Pyx_DECREF(__pyx_v_self->value); + __pyx_v_self->value = __pyx_v_value; + + /* "gevent/resolver/cares.pyx":179 + * def __init__(self, object value=None, object exception=None): + * self.value = value + * self.exception = exception # <<<<<<<<<<<<<< + * + * def __repr__(self): + */ + __Pyx_INCREF(__pyx_v_exception); + __Pyx_GIVEREF(__pyx_v_exception); + __Pyx_GOTREF(__pyx_v_self->exception); + __Pyx_DECREF(__pyx_v_self->exception); + __pyx_v_self->exception = __pyx_v_exception; + + /* "gevent/resolver/cares.pyx":177 + * cdef public object exception + * + * def __init__(self, object value=None, object exception=None): # <<<<<<<<<<<<<< + * self.value = value + * self.exception = exception + */ + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/resolver/cares.pyx":181 + * self.exception = exception + * + * def __repr__(self): # <<<<<<<<<<<<<< + * if self.exception is None: + * return '%s(%r)' % (self.__class__.__name__, self.value) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_8resolver_5cares_6result_3__repr__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_8resolver_5cares_6result_3__repr__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_8resolver_5cares_6result_2__repr__(((struct __pyx_obj_6gevent_8resolver_5cares_result *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_8resolver_5cares_6result_2__repr__(struct __pyx_obj_6gevent_8resolver_5cares_result *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + __Pyx_RefNannySetupContext("__repr__", 0); + + /* "gevent/resolver/cares.pyx":182 + * + * def __repr__(self): + * if self.exception is None: # <<<<<<<<<<<<<< + * return '%s(%r)' % (self.__class__.__name__, self.value) + * elif self.value is None: + */ + __pyx_t_1 = (__pyx_v_self->exception == Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "gevent/resolver/cares.pyx":183 + * def __repr__(self): + * if self.exception is None: + * return '%s(%r)' % (self.__class__.__name__, self.value) # <<<<<<<<<<<<<< + * elif self.value is None: + * return '%s(exception=%r)' % (self.__class__.__name__, self.exception) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 183, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 183, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 183, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); + __Pyx_INCREF(__pyx_v_self->value); + __Pyx_GIVEREF(__pyx_v_self->value); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_self->value); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_s_r, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 183, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + + /* "gevent/resolver/cares.pyx":182 + * + * def __repr__(self): + * if self.exception is None: # <<<<<<<<<<<<<< + * return '%s(%r)' % (self.__class__.__name__, self.value) + * elif self.value is None: + */ + } + + /* "gevent/resolver/cares.pyx":184 + * if self.exception is None: + * return '%s(%r)' % (self.__class__.__name__, self.value) + * elif self.value is None: # <<<<<<<<<<<<<< + * return '%s(exception=%r)' % (self.__class__.__name__, self.exception) + * else: + */ + __pyx_t_2 = (__pyx_v_self->value == Py_None); + __pyx_t_1 = (__pyx_t_2 != 0); + if (__pyx_t_1) { + + /* "gevent/resolver/cares.pyx":185 + * return '%s(%r)' % (self.__class__.__name__, self.value) + * elif self.value is None: + * return '%s(exception=%r)' % (self.__class__.__name__, self.exception) # <<<<<<<<<<<<<< + * else: + * return '%s(value=%r, exception=%r)' % (self.__class__.__name__, self.value, self.exception) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 185, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 185, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 185, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); + __Pyx_INCREF(__pyx_v_self->exception); + __Pyx_GIVEREF(__pyx_v_self->exception); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_self->exception); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_s_exception_r, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 185, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "gevent/resolver/cares.pyx":184 + * if self.exception is None: + * return '%s(%r)' % (self.__class__.__name__, self.value) + * elif self.value is None: # <<<<<<<<<<<<<< + * return '%s(exception=%r)' % (self.__class__.__name__, self.exception) + * else: + */ + } + + /* "gevent/resolver/cares.pyx":187 + * return '%s(exception=%r)' % (self.__class__.__name__, self.exception) + * else: + * return '%s(value=%r, exception=%r)' % (self.__class__.__name__, self.value, self.exception) # <<<<<<<<<<<<<< + * # add repr_recursive precaution + * + */ + /*else*/ { + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 187, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 187, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 187, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); + __Pyx_INCREF(__pyx_v_self->value); + __Pyx_GIVEREF(__pyx_v_self->value); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_self->value); + __Pyx_INCREF(__pyx_v_self->exception); + __Pyx_GIVEREF(__pyx_v_self->exception); + PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_self->exception); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_s_value_r_exception_r, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 187, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + } + + /* "gevent/resolver/cares.pyx":181 + * self.exception = exception + * + * def __repr__(self): # <<<<<<<<<<<<<< + * if self.exception is None: + * return '%s(%r)' % (self.__class__.__name__, self.value) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("gevent.resolver.cares.result.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/resolver/cares.pyx":190 + * # add repr_recursive precaution + * + * def successful(self): # <<<<<<<<<<<<<< + * return self.exception is None + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_8resolver_5cares_6result_5successful(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6gevent_8resolver_5cares_6result_5successful(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("successful (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_8resolver_5cares_6result_4successful(((struct __pyx_obj_6gevent_8resolver_5cares_result *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_8resolver_5cares_6result_4successful(struct __pyx_obj_6gevent_8resolver_5cares_result *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("successful", 0); + + /* "gevent/resolver/cares.pyx":191 + * + * def successful(self): + * return self.exception is None # <<<<<<<<<<<<<< + * + * def get(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = (__pyx_v_self->exception == Py_None); + __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 191, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "gevent/resolver/cares.pyx":190 + * # add repr_recursive precaution + * + * def successful(self): # <<<<<<<<<<<<<< + * return self.exception is None + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent.resolver.cares.result.successful", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/resolver/cares.pyx":193 + * return self.exception is None + * + * def get(self): # <<<<<<<<<<<<<< + * if self.exception is not None: + * raise self.exception + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_8resolver_5cares_6result_7get(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6gevent_8resolver_5cares_6result_7get(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_8resolver_5cares_6result_6get(((struct __pyx_obj_6gevent_8resolver_5cares_result *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_8resolver_5cares_6result_6get(struct __pyx_obj_6gevent_8resolver_5cares_result *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + __Pyx_RefNannySetupContext("get", 0); + + /* "gevent/resolver/cares.pyx":194 + * + * def get(self): + * if self.exception is not None: # <<<<<<<<<<<<<< + * raise self.exception + * return self.value + */ + __pyx_t_1 = (__pyx_v_self->exception != Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (unlikely(__pyx_t_2)) { + + /* "gevent/resolver/cares.pyx":195 + * def get(self): + * if self.exception is not None: + * raise self.exception # <<<<<<<<<<<<<< + * return self.value + * + */ + __Pyx_Raise(__pyx_v_self->exception, 0, 0, 0); + __PYX_ERR(0, 195, __pyx_L1_error) + + /* "gevent/resolver/cares.pyx":194 + * + * def get(self): + * if self.exception is not None: # <<<<<<<<<<<<<< + * raise self.exception + * return self.value + */ + } + + /* "gevent/resolver/cares.pyx":196 + * if self.exception is not None: + * raise self.exception + * return self.value # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->value); + __pyx_r = __pyx_v_self->value; + goto __pyx_L0; + + /* "gevent/resolver/cares.pyx":193 + * return self.exception is None + * + * def get(self): # <<<<<<<<<<<<<< + * if self.exception is not None: + * raise self.exception + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_AddTraceback("gevent.resolver.cares.result.get", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/resolver/cares.pyx":174 + * + * cdef class result: + * cdef public object value # <<<<<<<<<<<<<< + * cdef public object exception + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_8resolver_5cares_6result_5value_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_8resolver_5cares_6result_5value_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_8resolver_5cares_6result_5value___get__(((struct __pyx_obj_6gevent_8resolver_5cares_result *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_8resolver_5cares_6result_5value___get__(struct __pyx_obj_6gevent_8resolver_5cares_result *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->value); + __pyx_r = __pyx_v_self->value; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6gevent_8resolver_5cares_6result_5value_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6gevent_8resolver_5cares_6result_5value_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_8resolver_5cares_6result_5value_2__set__(((struct __pyx_obj_6gevent_8resolver_5cares_result *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_8resolver_5cares_6result_5value_2__set__(struct __pyx_obj_6gevent_8resolver_5cares_result *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__", 0); + __Pyx_INCREF(__pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + __Pyx_GOTREF(__pyx_v_self->value); + __Pyx_DECREF(__pyx_v_self->value); + __pyx_v_self->value = __pyx_v_value; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6gevent_8resolver_5cares_6result_5value_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6gevent_8resolver_5cares_6result_5value_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_8resolver_5cares_6result_5value_4__del__(((struct __pyx_obj_6gevent_8resolver_5cares_result *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_8resolver_5cares_6result_5value_4__del__(struct __pyx_obj_6gevent_8resolver_5cares_result *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->value); + __Pyx_DECREF(__pyx_v_self->value); + __pyx_v_self->value = Py_None; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/resolver/cares.pyx":175 + * cdef class result: + * cdef public object value + * cdef public object exception # <<<<<<<<<<<<<< + * + * def __init__(self, object value=None, object exception=None): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_8resolver_5cares_6result_9exception_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_8resolver_5cares_6result_9exception_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_8resolver_5cares_6result_9exception___get__(((struct __pyx_obj_6gevent_8resolver_5cares_result *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_8resolver_5cares_6result_9exception___get__(struct __pyx_obj_6gevent_8resolver_5cares_result *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->exception); + __pyx_r = __pyx_v_self->exception; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6gevent_8resolver_5cares_6result_9exception_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6gevent_8resolver_5cares_6result_9exception_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_8resolver_5cares_6result_9exception_2__set__(((struct __pyx_obj_6gevent_8resolver_5cares_result *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_8resolver_5cares_6result_9exception_2__set__(struct __pyx_obj_6gevent_8resolver_5cares_result *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__", 0); + __Pyx_INCREF(__pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + __Pyx_GOTREF(__pyx_v_self->exception); + __Pyx_DECREF(__pyx_v_self->exception); + __pyx_v_self->exception = __pyx_v_value; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6gevent_8resolver_5cares_6result_9exception_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6gevent_8resolver_5cares_6result_9exception_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_8resolver_5cares_6result_9exception_4__del__(((struct __pyx_obj_6gevent_8resolver_5cares_result *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_8resolver_5cares_6result_9exception_4__del__(struct __pyx_obj_6gevent_8resolver_5cares_result *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->exception); + __Pyx_DECREF(__pyx_v_self->exception); + __pyx_v_self->exception = Py_None; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/resolver/cares.pyx":201 + * class ares_host_result(tuple): + * + * def __new__(cls, family, iterable): # <<<<<<<<<<<<<< + * cdef object self = tuple.__new__(cls, iterable) + * self.family = family + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_8resolver_5cares_16ares_host_result_1__new__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6gevent_8resolver_5cares_16ares_host_result_1__new__ = {"__new__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_8resolver_5cares_16ares_host_result_1__new__, METH_VARARGS|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_6gevent_8resolver_5cares_16ares_host_result_1__new__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_cls = 0; + PyObject *__pyx_v_family = 0; + PyObject *__pyx_v_iterable = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__new__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_cls,&__pyx_n_s_family,&__pyx_n_s_iterable,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cls)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_family)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__new__", 1, 3, 3, 1); __PYX_ERR(0, 201, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_iterable)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__new__", 1, 3, 3, 2); __PYX_ERR(0, 201, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__new__") < 0)) __PYX_ERR(0, 201, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + } + __pyx_v_cls = values[0]; + __pyx_v_family = values[1]; + __pyx_v_iterable = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__new__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 201, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.resolver.cares.ares_host_result.__new__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_8resolver_5cares_16ares_host_result___new__(__pyx_self, __pyx_v_cls, __pyx_v_family, __pyx_v_iterable); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_8resolver_5cares_16ares_host_result___new__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_cls, PyObject *__pyx_v_family, PyObject *__pyx_v_iterable) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + __Pyx_RefNannySetupContext("__new__", 0); + + /* "gevent/resolver/cares.pyx":202 + * + * def __new__(cls, family, iterable): + * cdef object self = tuple.__new__(cls, iterable) # <<<<<<<<<<<<<< + * self.family = family + * return self + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)(&PyTuple_Type)), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 202, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + __pyx_t_4 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_4 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_cls, __pyx_v_iterable}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 202, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_cls, __pyx_v_iterable}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 202, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else + #endif + { + __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 202, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (__pyx_t_3) { + __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL; + } + __Pyx_INCREF(__pyx_v_cls); + __Pyx_GIVEREF(__pyx_v_cls); + PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_cls); + __Pyx_INCREF(__pyx_v_iterable); + __Pyx_GIVEREF(__pyx_v_iterable); + PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_iterable); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 202, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_self = __pyx_t_1; + __pyx_t_1 = 0; + + /* "gevent/resolver/cares.pyx":203 + * def __new__(cls, family, iterable): + * cdef object self = tuple.__new__(cls, iterable) + * self.family = family # <<<<<<<<<<<<<< + * return self + * + */ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_family, __pyx_v_family) < 0) __PYX_ERR(0, 203, __pyx_L1_error) + + /* "gevent/resolver/cares.pyx":204 + * cdef object self = tuple.__new__(cls, iterable) + * self.family = family + * return self # <<<<<<<<<<<<<< + * + * def __getnewargs__(self): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self); + __pyx_r = __pyx_v_self; + goto __pyx_L0; + + /* "gevent/resolver/cares.pyx":201 + * class ares_host_result(tuple): + * + * def __new__(cls, family, iterable): # <<<<<<<<<<<<<< + * cdef object self = tuple.__new__(cls, iterable) + * self.family = family + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("gevent.resolver.cares.ares_host_result.__new__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_self); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/resolver/cares.pyx":206 + * return self + * + * def __getnewargs__(self): # <<<<<<<<<<<<<< + * return (self.family, tuple(self)) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_8resolver_5cares_16ares_host_result_3__getnewargs__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_6gevent_8resolver_5cares_16ares_host_result_3__getnewargs__ = {"__getnewargs__", (PyCFunction)__pyx_pw_6gevent_8resolver_5cares_16ares_host_result_3__getnewargs__, METH_O, 0}; +static PyObject *__pyx_pw_6gevent_8resolver_5cares_16ares_host_result_3__getnewargs__(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__getnewargs__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_8resolver_5cares_16ares_host_result_2__getnewargs__(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_8resolver_5cares_16ares_host_result_2__getnewargs__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("__getnewargs__", 0); + + /* "gevent/resolver/cares.pyx":207 + * + * def __getnewargs__(self): + * return (self.family, tuple(self)) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_family); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 207, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PySequence_Tuple(__pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 207, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 207, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); + __pyx_t_1 = 0; + __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "gevent/resolver/cares.pyx":206 + * return self + * + * def __getnewargs__(self): # <<<<<<<<<<<<<< + * return (self.family, tuple(self)) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("gevent.resolver.cares.ares_host_result.__getnewargs__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/resolver/cares.pyx":210 + * + * + * cdef void gevent_ares_host_callback(void *arg, int status, int timeouts, hostent* host): # <<<<<<<<<<<<<< + * cdef channel channel + * cdef object callback + */ + +static void __pyx_f_6gevent_8resolver_5cares_gevent_ares_host_callback(void *__pyx_v_arg, int __pyx_v_status, CYTHON_UNUSED int __pyx_v_timeouts, struct hostent *__pyx_v_host) { + struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_channel = 0; + PyObject *__pyx_v_callback = 0; + PyObject *__pyx_v_host_result = 0; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + int __pyx_t_12; + PyObject *__pyx_t_13 = NULL; + PyObject *__pyx_t_14 = NULL; + PyObject *__pyx_t_15 = NULL; + PyObject *__pyx_t_16 = NULL; + PyObject *__pyx_t_17 = NULL; + __Pyx_RefNannySetupContext("gevent_ares_host_callback", 0); + + /* "gevent/resolver/cares.pyx":213 + * cdef channel channel + * cdef object callback + * channel, callback = arg # <<<<<<<<<<<<<< + * Py_DECREF(arg) + * cdef object host_result + */ + __pyx_t_1 = ((PyObject *)__pyx_v_arg); + __Pyx_INCREF(__pyx_t_1); + if (likely(__pyx_t_1 != Py_None)) { + PyObject* sequence = __pyx_t_1; + Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + __PYX_ERR(0, 213, __pyx_L1_error) + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + #else + __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 213, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 213, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else { + __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(0, 213, __pyx_L1_error) + } + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_6gevent_8resolver_5cares_channel))))) __PYX_ERR(0, 213, __pyx_L1_error) + __pyx_v_channel = ((struct __pyx_obj_6gevent_8resolver_5cares_channel *)__pyx_t_2); + __pyx_t_2 = 0; + __pyx_v_callback = __pyx_t_3; + __pyx_t_3 = 0; + + /* "gevent/resolver/cares.pyx":214 + * cdef object callback + * channel, callback = arg + * Py_DECREF(arg) # <<<<<<<<<<<<<< + * cdef object host_result + * try: + */ + Py_DECREF(((PyObject *)__pyx_v_arg)); + + /* "gevent/resolver/cares.pyx":216 + * Py_DECREF(arg) + * cdef object host_result + * try: # <<<<<<<<<<<<<< + * if status or not host: + * callback(result(None, gaierror(status, strerror(status)))) + */ + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6); + __Pyx_XGOTREF(__pyx_t_4); + __Pyx_XGOTREF(__pyx_t_5); + __Pyx_XGOTREF(__pyx_t_6); + /*try:*/ { + + /* "gevent/resolver/cares.pyx":217 + * cdef object host_result + * try: + * if status or not host: # <<<<<<<<<<<<<< + * callback(result(None, gaierror(status, strerror(status)))) + * else: + */ + __pyx_t_8 = (__pyx_v_status != 0); + if (!__pyx_t_8) { + } else { + __pyx_t_7 = __pyx_t_8; + goto __pyx_L10_bool_binop_done; + } + __pyx_t_8 = ((!(__pyx_v_host != 0)) != 0); + __pyx_t_7 = __pyx_t_8; + __pyx_L10_bool_binop_done:; + if (__pyx_t_7) { + + /* "gevent/resolver/cares.pyx":218 + * try: + * if status or not host: + * callback(result(None, gaierror(status, strerror(status)))) # <<<<<<<<<<<<<< + * else: + * try: + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_gaierror); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 218, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_status); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 218, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = __Pyx_PyInt_From_int(__pyx_v_status); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 218, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_11 = __pyx_f_6gevent_8resolver_5cares_strerror(__pyx_t_10, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 218, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = NULL; + __pyx_t_12 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_10)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_10); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_12 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[3] = {__pyx_t_10, __pyx_t_9, __pyx_t_11}; + __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_12, 2+__pyx_t_12); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 218, __pyx_L3_error) + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[3] = {__pyx_t_10, __pyx_t_9, __pyx_t_11}; + __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_12, 2+__pyx_t_12); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 218, __pyx_L3_error) + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + } else + #endif + { + __pyx_t_13 = PyTuple_New(2+__pyx_t_12); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 218, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_13); + if (__pyx_t_10) { + __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_10); __pyx_t_10 = NULL; + } + __Pyx_GIVEREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_13, 0+__pyx_t_12, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_13, 1+__pyx_t_12, __pyx_t_11); + __pyx_t_9 = 0; + __pyx_t_11 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_13, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 218, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 218, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + PyTuple_SET_ITEM(__pyx_t_2, 0, Py_None); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6gevent_8resolver_5cares_result), __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 218, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_INCREF(__pyx_v_callback); + __pyx_t_2 = __pyx_v_callback; __pyx_t_13 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_13)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_13); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_13) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_13, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); + __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 218, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "gevent/resolver/cares.pyx":217 + * cdef object host_result + * try: + * if status or not host: # <<<<<<<<<<<<<< + * callback(result(None, gaierror(status, strerror(status)))) + * else: + */ + goto __pyx_L9; + } + + /* "gevent/resolver/cares.pyx":220 + * callback(result(None, gaierror(status, strerror(status)))) + * else: + * try: # <<<<<<<<<<<<<< + * host_result = ares_host_result(host.h_addrtype, (parse_h_name(host), parse_h_aliases(host), parse_h_addr_list(host))) + * except: + */ + /*else*/ { + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_14, &__pyx_t_15, &__pyx_t_16); + __Pyx_XGOTREF(__pyx_t_14); + __Pyx_XGOTREF(__pyx_t_15); + __Pyx_XGOTREF(__pyx_t_16); + /*try:*/ { + + /* "gevent/resolver/cares.pyx":221 + * else: + * try: + * host_result = ares_host_result(host.h_addrtype, (parse_h_name(host), parse_h_aliases(host), parse_h_addr_list(host))) # <<<<<<<<<<<<<< + * except: + * callback(result(None, sys.exc_info()[1])) + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ares_host_result); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 221, __pyx_L12_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_host->h_addrtype); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 221, __pyx_L12_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_13 = parse_h_name(__pyx_v_host); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 221, __pyx_L12_error) + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_11 = parse_h_aliases(__pyx_v_host); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 221, __pyx_L12_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_9 = parse_h_addr_list(__pyx_v_host); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 221, __pyx_L12_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = PyTuple_New(3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 221, __pyx_L12_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_GIVEREF(__pyx_t_13); + PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_13); + __Pyx_GIVEREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_11); + __Pyx_GIVEREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_t_9); + __pyx_t_13 = 0; + __pyx_t_11 = 0; + __pyx_t_9 = 0; + __pyx_t_9 = NULL; + __pyx_t_12 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_9)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_9); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_12 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_t_3, __pyx_t_10}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_12, 2+__pyx_t_12); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 221, __pyx_L12_error) + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_t_3, __pyx_t_10}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_12, 2+__pyx_t_12); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 221, __pyx_L12_error) + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + } else + #endif + { + __pyx_t_11 = PyTuple_New(2+__pyx_t_12); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 221, __pyx_L12_error) + __Pyx_GOTREF(__pyx_t_11); + if (__pyx_t_9) { + __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_9); __pyx_t_9 = NULL; + } + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_12, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_10); + PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_12, __pyx_t_10); + __pyx_t_3 = 0; + __pyx_t_10 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_11, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 221, __pyx_L12_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_host_result = __pyx_t_1; + __pyx_t_1 = 0; + + /* "gevent/resolver/cares.pyx":220 + * callback(result(None, gaierror(status, strerror(status)))) + * else: + * try: # <<<<<<<<<<<<<< + * host_result = ares_host_result(host.h_addrtype, (parse_h_name(host), parse_h_aliases(host), parse_h_addr_list(host))) + * except: + */ + } + + /* "gevent/resolver/cares.pyx":225 + * callback(result(None, sys.exc_info()[1])) + * else: + * callback(result(host_result)) # <<<<<<<<<<<<<< + * except: + * channel.loop.handle_error(callback, *sys.exc_info()) + */ + /*else:*/ { + __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_6gevent_8resolver_5cares_result), __pyx_v_host_result); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 225, __pyx_L14_except_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_callback); + __pyx_t_11 = __pyx_v_callback; __pyx_t_10 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_11))) { + __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_11); + if (likely(__pyx_t_10)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11); + __Pyx_INCREF(__pyx_t_10); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_11, function); + } + } + __pyx_t_1 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_11, __pyx_t_10, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_t_2); + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 225, __pyx_L14_except_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; + __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; + goto __pyx_L17_try_end; + __pyx_L12_error:; + __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "gevent/resolver/cares.pyx":222 + * try: + * host_result = ares_host_result(host.h_addrtype, (parse_h_name(host), parse_h_aliases(host), parse_h_addr_list(host))) + * except: # <<<<<<<<<<<<<< + * callback(result(None, sys.exc_info()[1])) + * else: + */ + /*except:*/ { + __Pyx_AddTraceback("gevent.resolver.cares.gevent_ares_host_callback", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_11, &__pyx_t_2) < 0) __PYX_ERR(0, 222, __pyx_L14_except_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_t_11); + __Pyx_GOTREF(__pyx_t_2); + + /* "gevent/resolver/cares.pyx":223 + * host_result = ares_host_result(host.h_addrtype, (parse_h_name(host), parse_h_aliases(host), parse_h_addr_list(host))) + * except: + * callback(result(None, sys.exc_info()[1])) # <<<<<<<<<<<<<< + * else: + * callback(result(host_result)) + */ + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_sys); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 223, __pyx_L14_except_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_exc_info); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 223, __pyx_L14_except_error) + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_13))) { + __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_13); + if (likely(__pyx_t_9)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13); + __Pyx_INCREF(__pyx_t_9); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_13, function); + } + } + __pyx_t_3 = (__pyx_t_9) ? __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_t_9) : __Pyx_PyObject_CallNoArg(__pyx_t_13); + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 223, __pyx_L14_except_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_13 = __Pyx_GetItemInt(__pyx_t_3, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 223, __pyx_L14_except_error) + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 223, __pyx_L14_except_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + PyTuple_SET_ITEM(__pyx_t_3, 0, Py_None); + __Pyx_GIVEREF(__pyx_t_13); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_13); + __pyx_t_13 = 0; + __pyx_t_13 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6gevent_8resolver_5cares_result), __pyx_t_3, NULL); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 223, __pyx_L14_except_error) + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_INCREF(__pyx_v_callback); + __pyx_t_3 = __pyx_v_callback; __pyx_t_9 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_9)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_9); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_10 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_9, __pyx_t_13) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_13); + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 223, __pyx_L14_except_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + goto __pyx_L13_exception_handled; + } + __pyx_L14_except_error:; + + /* "gevent/resolver/cares.pyx":220 + * callback(result(None, gaierror(status, strerror(status)))) + * else: + * try: # <<<<<<<<<<<<<< + * host_result = ares_host_result(host.h_addrtype, (parse_h_name(host), parse_h_aliases(host), parse_h_addr_list(host))) + * except: + */ + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_XGIVEREF(__pyx_t_15); + __Pyx_XGIVEREF(__pyx_t_16); + __Pyx_ExceptionReset(__pyx_t_14, __pyx_t_15, __pyx_t_16); + goto __pyx_L3_error; + __pyx_L13_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_XGIVEREF(__pyx_t_15); + __Pyx_XGIVEREF(__pyx_t_16); + __Pyx_ExceptionReset(__pyx_t_14, __pyx_t_15, __pyx_t_16); + __pyx_L17_try_end:; + } + } + __pyx_L9:; + + /* "gevent/resolver/cares.pyx":216 + * Py_DECREF(arg) + * cdef object host_result + * try: # <<<<<<<<<<<<<< + * if status or not host: + * callback(result(None, gaierror(status, strerror(status)))) + */ + } + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L8_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "gevent/resolver/cares.pyx":226 + * else: + * callback(result(host_result)) + * except: # <<<<<<<<<<<<<< + * channel.loop.handle_error(callback, *sys.exc_info()) + * + */ + /*except:*/ { + __Pyx_AddTraceback("gevent.resolver.cares.gevent_ares_host_callback", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_11, &__pyx_t_1) < 0) __PYX_ERR(0, 226, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_t_11); + __Pyx_GOTREF(__pyx_t_1); + + /* "gevent/resolver/cares.pyx":227 + * callback(result(host_result)) + * except: + * channel.loop.handle_error(callback, *sys.exc_info()) # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_channel->loop, __pyx_n_s_handle_error); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 227, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 227, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_callback); + __Pyx_GIVEREF(__pyx_v_callback); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_callback); + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_sys); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 227, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_exc_info); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 227, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_17); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_17))) { + __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_17); + if (likely(__pyx_t_9)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_17); + __Pyx_INCREF(__pyx_t_9); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_17, function); + } + } + __pyx_t_13 = (__pyx_t_9) ? __Pyx_PyObject_CallOneArg(__pyx_t_17, __pyx_t_9) : __Pyx_PyObject_CallNoArg(__pyx_t_17); + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 227, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + __pyx_t_17 = __Pyx_PySequence_Tuple(__pyx_t_13); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 227, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_17); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_13 = PyNumber_Add(__pyx_t_3, __pyx_t_17); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 227, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + __pyx_t_17 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_13, NULL); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 227, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_17); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L4_exception_handled; + } + __pyx_L5_except_error:; + + /* "gevent/resolver/cares.pyx":216 + * Py_DECREF(arg) + * cdef object host_result + * try: # <<<<<<<<<<<<<< + * if status or not host: + * callback(result(None, gaierror(status, strerror(status)))) + */ + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6); + goto __pyx_L1_error; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6); + __pyx_L8_try_end:; + } + + /* "gevent/resolver/cares.pyx":210 + * + * + * cdef void gevent_ares_host_callback(void *arg, int status, int timeouts, hostent* host): # <<<<<<<<<<<<<< + * cdef channel channel + * cdef object callback + */ + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_XDECREF(__pyx_t_13); + __Pyx_XDECREF(__pyx_t_17); + __Pyx_WriteUnraisable("gevent.resolver.cares.gevent_ares_host_callback", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_channel); + __Pyx_XDECREF(__pyx_v_callback); + __Pyx_XDECREF(__pyx_v_host_result); + __Pyx_RefNannyFinishContext(); +} + +/* "gevent/resolver/cares.pyx":230 + * + * + * cdef void gevent_ares_nameinfo_callback(void *arg, int status, int timeouts, char *c_node, char *c_service): # <<<<<<<<<<<<<< + * cdef channel channel + * cdef object callback + */ + +static void __pyx_f_6gevent_8resolver_5cares_gevent_ares_nameinfo_callback(void *__pyx_v_arg, int __pyx_v_status, CYTHON_UNUSED int __pyx_v_timeouts, char *__pyx_v_c_node, char *__pyx_v_c_service) { + struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_channel = 0; + PyObject *__pyx_v_callback = 0; + PyObject *__pyx_v_node = 0; + PyObject *__pyx_v_service = 0; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + int __pyx_t_11; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + __Pyx_RefNannySetupContext("gevent_ares_nameinfo_callback", 0); + + /* "gevent/resolver/cares.pyx":233 + * cdef channel channel + * cdef object callback + * channel, callback = arg # <<<<<<<<<<<<<< + * Py_DECREF(arg) + * cdef object node + */ + __pyx_t_1 = ((PyObject *)__pyx_v_arg); + __Pyx_INCREF(__pyx_t_1); + if (likely(__pyx_t_1 != Py_None)) { + PyObject* sequence = __pyx_t_1; + Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + __PYX_ERR(0, 233, __pyx_L1_error) + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + #else + __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 233, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 233, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else { + __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(0, 233, __pyx_L1_error) + } + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_6gevent_8resolver_5cares_channel))))) __PYX_ERR(0, 233, __pyx_L1_error) + __pyx_v_channel = ((struct __pyx_obj_6gevent_8resolver_5cares_channel *)__pyx_t_2); + __pyx_t_2 = 0; + __pyx_v_callback = __pyx_t_3; + __pyx_t_3 = 0; + + /* "gevent/resolver/cares.pyx":234 + * cdef object callback + * channel, callback = arg + * Py_DECREF(arg) # <<<<<<<<<<<<<< + * cdef object node + * cdef object service + */ + Py_DECREF(((PyObject *)__pyx_v_arg)); + + /* "gevent/resolver/cares.pyx":237 + * cdef object node + * cdef object service + * try: # <<<<<<<<<<<<<< + * if status: + * callback(result(None, gaierror(status, strerror(status)))) + */ + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6); + __Pyx_XGOTREF(__pyx_t_4); + __Pyx_XGOTREF(__pyx_t_5); + __Pyx_XGOTREF(__pyx_t_6); + /*try:*/ { + + /* "gevent/resolver/cares.pyx":238 + * cdef object service + * try: + * if status: # <<<<<<<<<<<<<< + * callback(result(None, gaierror(status, strerror(status)))) + * else: + */ + __pyx_t_7 = (__pyx_v_status != 0); + if (__pyx_t_7) { + + /* "gevent/resolver/cares.pyx":239 + * try: + * if status: + * callback(result(None, gaierror(status, strerror(status)))) # <<<<<<<<<<<<<< + * else: + * if c_node: + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_gaierror); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 239, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_status); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 239, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_status); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 239, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = __pyx_f_6gevent_8resolver_5cares_strerror(__pyx_t_9, 0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 239, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = NULL; + __pyx_t_11 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_9)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_9); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_11 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_t_8, __pyx_t_10}; + __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 239, __pyx_L3_error) + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_t_8, __pyx_t_10}; + __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 239, __pyx_L3_error) + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + } else + #endif + { + __pyx_t_12 = PyTuple_New(2+__pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 239, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_12); + if (__pyx_t_9) { + __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_9); __pyx_t_9 = NULL; + } + __Pyx_GIVEREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_12, 0+__pyx_t_11, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_10); + PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_11, __pyx_t_10); + __pyx_t_8 = 0; + __pyx_t_10 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_12, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 239, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 239, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + PyTuple_SET_ITEM(__pyx_t_2, 0, Py_None); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6gevent_8resolver_5cares_result), __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 239, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_INCREF(__pyx_v_callback); + __pyx_t_2 = __pyx_v_callback; __pyx_t_12 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_12)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_12); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_12) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_12, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); + __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 239, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "gevent/resolver/cares.pyx":238 + * cdef object service + * try: + * if status: # <<<<<<<<<<<<<< + * callback(result(None, gaierror(status, strerror(status)))) + * else: + */ + goto __pyx_L9; + } + + /* "gevent/resolver/cares.pyx":241 + * callback(result(None, gaierror(status, strerror(status)))) + * else: + * if c_node: # <<<<<<<<<<<<<< + * node = PyUnicode_FromString(c_node) + * else: + */ + /*else*/ { + __pyx_t_7 = (__pyx_v_c_node != 0); + if (__pyx_t_7) { + + /* "gevent/resolver/cares.pyx":242 + * else: + * if c_node: + * node = PyUnicode_FromString(c_node) # <<<<<<<<<<<<<< + * else: + * node = None + */ + __pyx_t_1 = PyUnicode_FromString(__pyx_v_c_node); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 242, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_node = __pyx_t_1; + __pyx_t_1 = 0; + + /* "gevent/resolver/cares.pyx":241 + * callback(result(None, gaierror(status, strerror(status)))) + * else: + * if c_node: # <<<<<<<<<<<<<< + * node = PyUnicode_FromString(c_node) + * else: + */ + goto __pyx_L10; + } + + /* "gevent/resolver/cares.pyx":244 + * node = PyUnicode_FromString(c_node) + * else: + * node = None # <<<<<<<<<<<<<< + * if c_service: + * service = PyUnicode_FromString(c_service) + */ + /*else*/ { + __Pyx_INCREF(Py_None); + __pyx_v_node = Py_None; + } + __pyx_L10:; + + /* "gevent/resolver/cares.pyx":245 + * else: + * node = None + * if c_service: # <<<<<<<<<<<<<< + * service = PyUnicode_FromString(c_service) + * else: + */ + __pyx_t_7 = (__pyx_v_c_service != 0); + if (__pyx_t_7) { + + /* "gevent/resolver/cares.pyx":246 + * node = None + * if c_service: + * service = PyUnicode_FromString(c_service) # <<<<<<<<<<<<<< + * else: + * service = None + */ + __pyx_t_1 = PyUnicode_FromString(__pyx_v_c_service); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 246, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_service = __pyx_t_1; + __pyx_t_1 = 0; + + /* "gevent/resolver/cares.pyx":245 + * else: + * node = None + * if c_service: # <<<<<<<<<<<<<< + * service = PyUnicode_FromString(c_service) + * else: + */ + goto __pyx_L11; + } + + /* "gevent/resolver/cares.pyx":248 + * service = PyUnicode_FromString(c_service) + * else: + * service = None # <<<<<<<<<<<<<< + * callback(result((node, service))) + * except: + */ + /*else*/ { + __Pyx_INCREF(Py_None); + __pyx_v_service = Py_None; + } + __pyx_L11:; + + /* "gevent/resolver/cares.pyx":249 + * else: + * service = None + * callback(result((node, service))) # <<<<<<<<<<<<<< + * except: + * channel.loop.handle_error(callback, *sys.exc_info()) + */ + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 249, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_node); + __Pyx_GIVEREF(__pyx_v_node); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_node); + __Pyx_INCREF(__pyx_v_service); + __Pyx_GIVEREF(__pyx_v_service); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_service); + __pyx_t_3 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_6gevent_8resolver_5cares_result), __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 249, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_INCREF(__pyx_v_callback); + __pyx_t_2 = __pyx_v_callback; __pyx_t_12 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_12)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_12); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_12) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_12, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); + __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 249, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + __pyx_L9:; + + /* "gevent/resolver/cares.pyx":237 + * cdef object node + * cdef object service + * try: # <<<<<<<<<<<<<< + * if status: + * callback(result(None, gaierror(status, strerror(status)))) + */ + } + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L8_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "gevent/resolver/cares.pyx":250 + * service = None + * callback(result((node, service))) + * except: # <<<<<<<<<<<<<< + * channel.loop.handle_error(callback, *sys.exc_info()) + * + */ + /*except:*/ { + __Pyx_AddTraceback("gevent.resolver.cares.gevent_ares_nameinfo_callback", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3) < 0) __PYX_ERR(0, 250, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_t_3); + + /* "gevent/resolver/cares.pyx":251 + * callback(result((node, service))) + * except: + * channel.loop.handle_error(callback, *sys.exc_info()) # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_channel->loop, __pyx_n_s_handle_error); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 251, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 251, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_INCREF(__pyx_v_callback); + __Pyx_GIVEREF(__pyx_v_callback); + PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v_callback); + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_sys); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 251, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_exc_info); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 251, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_13))) { + __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_13); + if (likely(__pyx_t_9)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13); + __Pyx_INCREF(__pyx_t_9); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_13, function); + } + } + __pyx_t_8 = (__pyx_t_9) ? __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_t_9) : __Pyx_PyObject_CallNoArg(__pyx_t_13); + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 251, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_13 = __Pyx_PySequence_Tuple(__pyx_t_8); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 251, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyNumber_Add(__pyx_t_10, __pyx_t_13); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 251, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_8, NULL); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 251, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L4_exception_handled; + } + __pyx_L5_except_error:; + + /* "gevent/resolver/cares.pyx":237 + * cdef object node + * cdef object service + * try: # <<<<<<<<<<<<<< + * if status: + * callback(result(None, gaierror(status, strerror(status)))) + */ + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6); + goto __pyx_L1_error; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6); + __pyx_L8_try_end:; + } + + /* "gevent/resolver/cares.pyx":230 + * + * + * cdef void gevent_ares_nameinfo_callback(void *arg, int status, int timeouts, char *c_node, char *c_service): # <<<<<<<<<<<<<< + * cdef channel channel + * cdef object callback + */ + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_XDECREF(__pyx_t_13); + __Pyx_WriteUnraisable("gevent.resolver.cares.gevent_ares_nameinfo_callback", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_channel); + __Pyx_XDECREF(__pyx_v_callback); + __Pyx_XDECREF(__pyx_v_node); + __Pyx_XDECREF(__pyx_v_service); + __Pyx_RefNannyFinishContext(); +} + +/* "gevent/resolver/cares.pyx":261 + * cdef public object _timer + * + * def __init__(self, object loop, flags=None, timeout=None, tries=None, ndots=None, # <<<<<<<<<<<<<< + * udp_port=None, tcp_port=None, servers=None): + * cdef ares_channeldata* channel = NULL + */ + +/* Python wrapper */ +static int __pyx_pw_6gevent_8resolver_5cares_7channel_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6gevent_8resolver_5cares_7channel_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_loop = 0; + PyObject *__pyx_v_flags = 0; + PyObject *__pyx_v_timeout = 0; + PyObject *__pyx_v_tries = 0; + PyObject *__pyx_v_ndots = 0; + PyObject *__pyx_v_udp_port = 0; + PyObject *__pyx_v_tcp_port = 0; + PyObject *__pyx_v_servers = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_loop,&__pyx_n_s_flags,&__pyx_n_s_timeout,&__pyx_n_s_tries,&__pyx_n_s_ndots,&__pyx_n_s_udp_port,&__pyx_n_s_tcp_port,&__pyx_n_s_servers,0}; + PyObject* values[8] = {0,0,0,0,0,0,0,0}; + values[1] = ((PyObject *)Py_None); + values[2] = ((PyObject *)Py_None); + values[3] = ((PyObject *)Py_None); + values[4] = ((PyObject *)Py_None); + + /* "gevent/resolver/cares.pyx":262 + * + * def __init__(self, object loop, flags=None, timeout=None, tries=None, ndots=None, + * udp_port=None, tcp_port=None, servers=None): # <<<<<<<<<<<<<< + * cdef ares_channeldata* channel = NULL + * cdef cares.ares_options options + */ + values[5] = ((PyObject *)Py_None); + values[6] = ((PyObject *)Py_None); + values[7] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); + CYTHON_FALLTHROUGH; + case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); + CYTHON_FALLTHROUGH; + case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + CYTHON_FALLTHROUGH; + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + CYTHON_FALLTHROUGH; + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_loop)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flags); + if (value) { values[1] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 2: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_timeout); + if (value) { values[2] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 3: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tries); + if (value) { values[3] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 4: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ndots); + if (value) { values[4] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 5: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_udp_port); + if (value) { values[5] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 6: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tcp_port); + if (value) { values[6] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 7: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_servers); + if (value) { values[7] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 261, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); + CYTHON_FALLTHROUGH; + case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); + CYTHON_FALLTHROUGH; + case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + CYTHON_FALLTHROUGH; + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + CYTHON_FALLTHROUGH; + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_loop = values[0]; + __pyx_v_flags = values[1]; + __pyx_v_timeout = values[2]; + __pyx_v_tries = values[3]; + __pyx_v_ndots = values[4]; + __pyx_v_udp_port = values[5]; + __pyx_v_tcp_port = values[6]; + __pyx_v_servers = values[7]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 8, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 261, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.resolver.cares.channel.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_8resolver_5cares_7channel___init__(((struct __pyx_obj_6gevent_8resolver_5cares_channel *)__pyx_v_self), __pyx_v_loop, __pyx_v_flags, __pyx_v_timeout, __pyx_v_tries, __pyx_v_ndots, __pyx_v_udp_port, __pyx_v_tcp_port, __pyx_v_servers); + + /* "gevent/resolver/cares.pyx":261 + * cdef public object _timer + * + * def __init__(self, object loop, flags=None, timeout=None, tries=None, ndots=None, # <<<<<<<<<<<<<< + * udp_port=None, tcp_port=None, servers=None): + * cdef ares_channeldata* channel = NULL + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_8resolver_5cares_7channel___init__(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self, PyObject *__pyx_v_loop, PyObject *__pyx_v_flags, PyObject *__pyx_v_timeout, PyObject *__pyx_v_tries, PyObject *__pyx_v_ndots, PyObject *__pyx_v_udp_port, PyObject *__pyx_v_tcp_port, PyObject *__pyx_v_servers) { + struct ares_channeldata *__pyx_v_channel; + struct ares_options __pyx_v_options; + int __pyx_v_optmask; + int __pyx_v_result; + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + double __pyx_t_5; + unsigned short __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + PyObject *__pyx_t_14 = NULL; + struct __pyx_opt_args_6gevent_8resolver_5cares_7channel_set_servers __pyx_t_15; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "gevent/resolver/cares.pyx":263 + * def __init__(self, object loop, flags=None, timeout=None, tries=None, ndots=None, + * udp_port=None, tcp_port=None, servers=None): + * cdef ares_channeldata* channel = NULL # <<<<<<<<<<<<<< + * cdef cares.ares_options options + * memset(&options, 0, sizeof(cares.ares_options)) + */ + __pyx_v_channel = NULL; + + /* "gevent/resolver/cares.pyx":265 + * cdef ares_channeldata* channel = NULL + * cdef cares.ares_options options + * memset(&options, 0, sizeof(cares.ares_options)) # <<<<<<<<<<<<<< + * cdef int optmask = cares.ARES_OPT_SOCK_STATE_CB + * options.sock_state_cb = gevent_sock_state_callback + */ + memset((&__pyx_v_options), 0, (sizeof(struct ares_options))); + + /* "gevent/resolver/cares.pyx":266 + * cdef cares.ares_options options + * memset(&options, 0, sizeof(cares.ares_options)) + * cdef int optmask = cares.ARES_OPT_SOCK_STATE_CB # <<<<<<<<<<<<<< + * options.sock_state_cb = gevent_sock_state_callback + * options.sock_state_cb_data = self + */ + __pyx_v_optmask = ARES_OPT_SOCK_STATE_CB; + + /* "gevent/resolver/cares.pyx":267 + * memset(&options, 0, sizeof(cares.ares_options)) + * cdef int optmask = cares.ARES_OPT_SOCK_STATE_CB + * options.sock_state_cb = gevent_sock_state_callback # <<<<<<<<<<<<<< + * options.sock_state_cb_data = self + * if flags is not None: + */ + __pyx_v_options.sock_state_cb = ((void *)__pyx_f_6gevent_8resolver_5cares_gevent_sock_state_callback); + + /* "gevent/resolver/cares.pyx":268 + * cdef int optmask = cares.ARES_OPT_SOCK_STATE_CB + * options.sock_state_cb = gevent_sock_state_callback + * options.sock_state_cb_data = self # <<<<<<<<<<<<<< + * if flags is not None: + * options.flags = int(flags) + */ + __pyx_v_options.sock_state_cb_data = ((void *)__pyx_v_self); + + /* "gevent/resolver/cares.pyx":269 + * options.sock_state_cb = gevent_sock_state_callback + * options.sock_state_cb_data = self + * if flags is not None: # <<<<<<<<<<<<<< + * options.flags = int(flags) + * optmask |= cares.ARES_OPT_FLAGS + */ + __pyx_t_1 = (__pyx_v_flags != Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "gevent/resolver/cares.pyx":270 + * options.sock_state_cb_data = self + * if flags is not None: + * options.flags = int(flags) # <<<<<<<<<<<<<< + * optmask |= cares.ARES_OPT_FLAGS + * if timeout is not None: + */ + __pyx_t_3 = __Pyx_PyNumber_Int(__pyx_v_flags); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 270, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 270, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_options.flags = __pyx_t_4; + + /* "gevent/resolver/cares.pyx":271 + * if flags is not None: + * options.flags = int(flags) + * optmask |= cares.ARES_OPT_FLAGS # <<<<<<<<<<<<<< + * if timeout is not None: + * options.timeout = int(float(timeout) * 1000) + */ + __pyx_v_optmask = (__pyx_v_optmask | ARES_OPT_FLAGS); + + /* "gevent/resolver/cares.pyx":269 + * options.sock_state_cb = gevent_sock_state_callback + * options.sock_state_cb_data = self + * if flags is not None: # <<<<<<<<<<<<<< + * options.flags = int(flags) + * optmask |= cares.ARES_OPT_FLAGS + */ + } + + /* "gevent/resolver/cares.pyx":272 + * options.flags = int(flags) + * optmask |= cares.ARES_OPT_FLAGS + * if timeout is not None: # <<<<<<<<<<<<<< + * options.timeout = int(float(timeout) * 1000) + * optmask |= cares.ARES_OPT_TIMEOUTMS + */ + __pyx_t_2 = (__pyx_v_timeout != Py_None); + __pyx_t_1 = (__pyx_t_2 != 0); + if (__pyx_t_1) { + + /* "gevent/resolver/cares.pyx":273 + * optmask |= cares.ARES_OPT_FLAGS + * if timeout is not None: + * options.timeout = int(float(timeout) * 1000) # <<<<<<<<<<<<<< + * optmask |= cares.ARES_OPT_TIMEOUTMS + * if tries is not None: + */ + __pyx_t_5 = __Pyx_PyObject_AsDouble(__pyx_v_timeout); if (unlikely(__pyx_t_5 == ((double)((double)-1)) && PyErr_Occurred())) __PYX_ERR(0, 273, __pyx_L1_error) + __pyx_v_options.timeout = ((int)(__pyx_t_5 * 1000.0)); + + /* "gevent/resolver/cares.pyx":274 + * if timeout is not None: + * options.timeout = int(float(timeout) * 1000) + * optmask |= cares.ARES_OPT_TIMEOUTMS # <<<<<<<<<<<<<< + * if tries is not None: + * options.tries = int(tries) + */ + __pyx_v_optmask = (__pyx_v_optmask | ARES_OPT_TIMEOUTMS); + + /* "gevent/resolver/cares.pyx":272 + * options.flags = int(flags) + * optmask |= cares.ARES_OPT_FLAGS + * if timeout is not None: # <<<<<<<<<<<<<< + * options.timeout = int(float(timeout) * 1000) + * optmask |= cares.ARES_OPT_TIMEOUTMS + */ + } + + /* "gevent/resolver/cares.pyx":275 + * options.timeout = int(float(timeout) * 1000) + * optmask |= cares.ARES_OPT_TIMEOUTMS + * if tries is not None: # <<<<<<<<<<<<<< + * options.tries = int(tries) + * optmask |= cares.ARES_OPT_TRIES + */ + __pyx_t_1 = (__pyx_v_tries != Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "gevent/resolver/cares.pyx":276 + * optmask |= cares.ARES_OPT_TIMEOUTMS + * if tries is not None: + * options.tries = int(tries) # <<<<<<<<<<<<<< + * optmask |= cares.ARES_OPT_TRIES + * if ndots is not None: + */ + __pyx_t_3 = __Pyx_PyNumber_Int(__pyx_v_tries); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 276, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 276, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_options.tries = __pyx_t_4; + + /* "gevent/resolver/cares.pyx":277 + * if tries is not None: + * options.tries = int(tries) + * optmask |= cares.ARES_OPT_TRIES # <<<<<<<<<<<<<< + * if ndots is not None: + * options.ndots = int(ndots) + */ + __pyx_v_optmask = (__pyx_v_optmask | ARES_OPT_TRIES); + + /* "gevent/resolver/cares.pyx":275 + * options.timeout = int(float(timeout) * 1000) + * optmask |= cares.ARES_OPT_TIMEOUTMS + * if tries is not None: # <<<<<<<<<<<<<< + * options.tries = int(tries) + * optmask |= cares.ARES_OPT_TRIES + */ + } + + /* "gevent/resolver/cares.pyx":278 + * options.tries = int(tries) + * optmask |= cares.ARES_OPT_TRIES + * if ndots is not None: # <<<<<<<<<<<<<< + * options.ndots = int(ndots) + * optmask |= cares.ARES_OPT_NDOTS + */ + __pyx_t_2 = (__pyx_v_ndots != Py_None); + __pyx_t_1 = (__pyx_t_2 != 0); + if (__pyx_t_1) { + + /* "gevent/resolver/cares.pyx":279 + * optmask |= cares.ARES_OPT_TRIES + * if ndots is not None: + * options.ndots = int(ndots) # <<<<<<<<<<<<<< + * optmask |= cares.ARES_OPT_NDOTS + * if udp_port is not None: + */ + __pyx_t_3 = __Pyx_PyNumber_Int(__pyx_v_ndots); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 279, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 279, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_options.ndots = __pyx_t_4; + + /* "gevent/resolver/cares.pyx":280 + * if ndots is not None: + * options.ndots = int(ndots) + * optmask |= cares.ARES_OPT_NDOTS # <<<<<<<<<<<<<< + * if udp_port is not None: + * options.udp_port = int(udp_port) + */ + __pyx_v_optmask = (__pyx_v_optmask | ARES_OPT_NDOTS); + + /* "gevent/resolver/cares.pyx":278 + * options.tries = int(tries) + * optmask |= cares.ARES_OPT_TRIES + * if ndots is not None: # <<<<<<<<<<<<<< + * options.ndots = int(ndots) + * optmask |= cares.ARES_OPT_NDOTS + */ + } + + /* "gevent/resolver/cares.pyx":281 + * options.ndots = int(ndots) + * optmask |= cares.ARES_OPT_NDOTS + * if udp_port is not None: # <<<<<<<<<<<<<< + * options.udp_port = int(udp_port) + * optmask |= cares.ARES_OPT_UDP_PORT + */ + __pyx_t_1 = (__pyx_v_udp_port != Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "gevent/resolver/cares.pyx":282 + * optmask |= cares.ARES_OPT_NDOTS + * if udp_port is not None: + * options.udp_port = int(udp_port) # <<<<<<<<<<<<<< + * optmask |= cares.ARES_OPT_UDP_PORT + * if tcp_port is not None: + */ + __pyx_t_3 = __Pyx_PyNumber_Int(__pyx_v_udp_port); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 282, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_6 = __Pyx_PyInt_As_unsigned_short(__pyx_t_3); if (unlikely((__pyx_t_6 == (unsigned short)-1) && PyErr_Occurred())) __PYX_ERR(0, 282, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_options.udp_port = __pyx_t_6; + + /* "gevent/resolver/cares.pyx":283 + * if udp_port is not None: + * options.udp_port = int(udp_port) + * optmask |= cares.ARES_OPT_UDP_PORT # <<<<<<<<<<<<<< + * if tcp_port is not None: + * options.tcp_port = int(tcp_port) + */ + __pyx_v_optmask = (__pyx_v_optmask | ARES_OPT_UDP_PORT); + + /* "gevent/resolver/cares.pyx":281 + * options.ndots = int(ndots) + * optmask |= cares.ARES_OPT_NDOTS + * if udp_port is not None: # <<<<<<<<<<<<<< + * options.udp_port = int(udp_port) + * optmask |= cares.ARES_OPT_UDP_PORT + */ + } + + /* "gevent/resolver/cares.pyx":284 + * options.udp_port = int(udp_port) + * optmask |= cares.ARES_OPT_UDP_PORT + * if tcp_port is not None: # <<<<<<<<<<<<<< + * options.tcp_port = int(tcp_port) + * optmask |= cares.ARES_OPT_TCP_PORT + */ + __pyx_t_2 = (__pyx_v_tcp_port != Py_None); + __pyx_t_1 = (__pyx_t_2 != 0); + if (__pyx_t_1) { + + /* "gevent/resolver/cares.pyx":285 + * optmask |= cares.ARES_OPT_UDP_PORT + * if tcp_port is not None: + * options.tcp_port = int(tcp_port) # <<<<<<<<<<<<<< + * optmask |= cares.ARES_OPT_TCP_PORT + * cdef int result = cares.ares_library_init(cares.ARES_LIB_INIT_ALL) # ARES_LIB_INIT_WIN32 -DUSE_WINSOCK? + */ + __pyx_t_3 = __Pyx_PyNumber_Int(__pyx_v_tcp_port); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 285, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_6 = __Pyx_PyInt_As_unsigned_short(__pyx_t_3); if (unlikely((__pyx_t_6 == (unsigned short)-1) && PyErr_Occurred())) __PYX_ERR(0, 285, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_options.tcp_port = __pyx_t_6; + + /* "gevent/resolver/cares.pyx":286 + * if tcp_port is not None: + * options.tcp_port = int(tcp_port) + * optmask |= cares.ARES_OPT_TCP_PORT # <<<<<<<<<<<<<< + * cdef int result = cares.ares_library_init(cares.ARES_LIB_INIT_ALL) # ARES_LIB_INIT_WIN32 -DUSE_WINSOCK? + * if result: + */ + __pyx_v_optmask = (__pyx_v_optmask | ARES_OPT_TCP_PORT); + + /* "gevent/resolver/cares.pyx":284 + * options.udp_port = int(udp_port) + * optmask |= cares.ARES_OPT_UDP_PORT + * if tcp_port is not None: # <<<<<<<<<<<<<< + * options.tcp_port = int(tcp_port) + * optmask |= cares.ARES_OPT_TCP_PORT + */ + } + + /* "gevent/resolver/cares.pyx":287 + * options.tcp_port = int(tcp_port) + * optmask |= cares.ARES_OPT_TCP_PORT + * cdef int result = cares.ares_library_init(cares.ARES_LIB_INIT_ALL) # ARES_LIB_INIT_WIN32 -DUSE_WINSOCK? # <<<<<<<<<<<<<< + * if result: + * raise gaierror(result, strerror(result)) + */ + __pyx_v_result = ares_library_init(ARES_LIB_INIT_ALL); + + /* "gevent/resolver/cares.pyx":288 + * optmask |= cares.ARES_OPT_TCP_PORT + * cdef int result = cares.ares_library_init(cares.ARES_LIB_INIT_ALL) # ARES_LIB_INIT_WIN32 -DUSE_WINSOCK? + * if result: # <<<<<<<<<<<<<< + * raise gaierror(result, strerror(result)) + * result = cares.ares_init_options(&channel, &options, optmask) + */ + __pyx_t_1 = (__pyx_v_result != 0); + if (unlikely(__pyx_t_1)) { + + /* "gevent/resolver/cares.pyx":289 + * cdef int result = cares.ares_library_init(cares.ARES_LIB_INIT_ALL) # ARES_LIB_INIT_WIN32 -DUSE_WINSOCK? + * if result: + * raise gaierror(result, strerror(result)) # <<<<<<<<<<<<<< + * result = cares.ares_init_options(&channel, &options, optmask) + * if result: + */ + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_gaierror); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 289, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_result); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 289, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_result); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 289, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = __pyx_f_6gevent_8resolver_5cares_strerror(__pyx_t_9, 0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 289, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = NULL; + __pyx_t_4 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) { + __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_7); + if (likely(__pyx_t_9)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); + __Pyx_INCREF(__pyx_t_9); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_7, function); + __pyx_t_4 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_7)) { + PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_t_8, __pyx_t_10}; + __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 289, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) { + PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_t_8, __pyx_t_10}; + __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 289, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + } else + #endif + { + __pyx_t_11 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 289, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + if (__pyx_t_9) { + __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_9); __pyx_t_9 = NULL; + } + __Pyx_GIVEREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_4, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_10); + PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_4, __pyx_t_10); + __pyx_t_8 = 0; + __pyx_t_10 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_11, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 289, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + } + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(0, 289, __pyx_L1_error) + + /* "gevent/resolver/cares.pyx":288 + * optmask |= cares.ARES_OPT_TCP_PORT + * cdef int result = cares.ares_library_init(cares.ARES_LIB_INIT_ALL) # ARES_LIB_INIT_WIN32 -DUSE_WINSOCK? + * if result: # <<<<<<<<<<<<<< + * raise gaierror(result, strerror(result)) + * result = cares.ares_init_options(&channel, &options, optmask) + */ + } + + /* "gevent/resolver/cares.pyx":290 + * if result: + * raise gaierror(result, strerror(result)) + * result = cares.ares_init_options(&channel, &options, optmask) # <<<<<<<<<<<<<< + * if result: + * raise gaierror(result, strerror(result)) + */ + __pyx_v_result = ares_init_options((&__pyx_v_channel), (&__pyx_v_options), __pyx_v_optmask); + + /* "gevent/resolver/cares.pyx":291 + * raise gaierror(result, strerror(result)) + * result = cares.ares_init_options(&channel, &options, optmask) + * if result: # <<<<<<<<<<<<<< + * raise gaierror(result, strerror(result)) + * self._timer = loop.timer(TIMEOUT, TIMEOUT) + */ + __pyx_t_1 = (__pyx_v_result != 0); + if (unlikely(__pyx_t_1)) { + + /* "gevent/resolver/cares.pyx":292 + * result = cares.ares_init_options(&channel, &options, optmask) + * if result: + * raise gaierror(result, strerror(result)) # <<<<<<<<<<<<<< + * self._timer = loop.timer(TIMEOUT, TIMEOUT) + * self._watchers = {} + */ + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_gaierror); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 292, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_11 = __Pyx_PyInt_From_int(__pyx_v_result); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 292, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_10 = __Pyx_PyInt_From_int(__pyx_v_result); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 292, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_8 = __pyx_f_6gevent_8resolver_5cares_strerror(__pyx_t_10, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 292, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = NULL; + __pyx_t_4 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) { + __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_7); + if (likely(__pyx_t_10)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); + __Pyx_INCREF(__pyx_t_10); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_7, function); + __pyx_t_4 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_7)) { + PyObject *__pyx_temp[3] = {__pyx_t_10, __pyx_t_11, __pyx_t_8}; + __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 292, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) { + PyObject *__pyx_temp[3] = {__pyx_t_10, __pyx_t_11, __pyx_t_8}; + __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 292, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + } else + #endif + { + __pyx_t_9 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 292, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + if (__pyx_t_10) { + __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_10); __pyx_t_10 = NULL; + } + __Pyx_GIVEREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_4, __pyx_t_11); + __Pyx_GIVEREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_4, __pyx_t_8); + __pyx_t_11 = 0; + __pyx_t_8 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 292, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(0, 292, __pyx_L1_error) + + /* "gevent/resolver/cares.pyx":291 + * raise gaierror(result, strerror(result)) + * result = cares.ares_init_options(&channel, &options, optmask) + * if result: # <<<<<<<<<<<<<< + * raise gaierror(result, strerror(result)) + * self._timer = loop.timer(TIMEOUT, TIMEOUT) + */ + } + + /* "gevent/resolver/cares.pyx":293 + * if result: + * raise gaierror(result, strerror(result)) + * self._timer = loop.timer(TIMEOUT, TIMEOUT) # <<<<<<<<<<<<<< + * self._watchers = {} + * self.channel = channel + */ + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_loop, __pyx_n_s_timer); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 293, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_TIMEOUT); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 293, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_TIMEOUT); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 293, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_11 = NULL; + __pyx_t_4 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) { + __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_7); + if (likely(__pyx_t_11)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); + __Pyx_INCREF(__pyx_t_11); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_7, function); + __pyx_t_4 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_7)) { + PyObject *__pyx_temp[3] = {__pyx_t_11, __pyx_t_9, __pyx_t_8}; + __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 293, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) { + PyObject *__pyx_temp[3] = {__pyx_t_11, __pyx_t_9, __pyx_t_8}; + __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 293, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + } else + #endif + { + __pyx_t_10 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 293, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + if (__pyx_t_11) { + __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_11); __pyx_t_11 = NULL; + } + __Pyx_GIVEREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_4, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_4, __pyx_t_8); + __pyx_t_9 = 0; + __pyx_t_8 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_10, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 293, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + } + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_GIVEREF(__pyx_t_3); + __Pyx_GOTREF(__pyx_v_self->_timer); + __Pyx_DECREF(__pyx_v_self->_timer); + __pyx_v_self->_timer = __pyx_t_3; + __pyx_t_3 = 0; + + /* "gevent/resolver/cares.pyx":294 + * raise gaierror(result, strerror(result)) + * self._timer = loop.timer(TIMEOUT, TIMEOUT) + * self._watchers = {} # <<<<<<<<<<<<<< + * self.channel = channel + * try: + */ + __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 294, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __Pyx_GOTREF(__pyx_v_self->_watchers); + __Pyx_DECREF(__pyx_v_self->_watchers); + __pyx_v_self->_watchers = ((PyObject*)__pyx_t_3); + __pyx_t_3 = 0; + + /* "gevent/resolver/cares.pyx":295 + * self._timer = loop.timer(TIMEOUT, TIMEOUT) + * self._watchers = {} + * self.channel = channel # <<<<<<<<<<<<<< + * try: + * if servers is not None: + */ + __pyx_v_self->channel = __pyx_v_channel; + + /* "gevent/resolver/cares.pyx":296 + * self._watchers = {} + * self.channel = channel + * try: # <<<<<<<<<<<<<< + * if servers is not None: + * self.set_servers(servers) + */ + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14); + __Pyx_XGOTREF(__pyx_t_12); + __Pyx_XGOTREF(__pyx_t_13); + __Pyx_XGOTREF(__pyx_t_14); + /*try:*/ { + + /* "gevent/resolver/cares.pyx":297 + * self.channel = channel + * try: + * if servers is not None: # <<<<<<<<<<<<<< + * self.set_servers(servers) + * self.loop = loop + */ + __pyx_t_1 = (__pyx_v_servers != Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "gevent/resolver/cares.pyx":298 + * try: + * if servers is not None: + * self.set_servers(servers) # <<<<<<<<<<<<<< + * self.loop = loop + * except: + */ + __pyx_t_15.__pyx_n = 1; + __pyx_t_15.servers = __pyx_v_servers; + __pyx_t_3 = ((struct __pyx_vtabstruct_6gevent_8resolver_5cares_channel *)__pyx_v_self->__pyx_vtab)->set_servers(__pyx_v_self, 0, &__pyx_t_15); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 298, __pyx_L11_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "gevent/resolver/cares.pyx":297 + * self.channel = channel + * try: + * if servers is not None: # <<<<<<<<<<<<<< + * self.set_servers(servers) + * self.loop = loop + */ + } + + /* "gevent/resolver/cares.pyx":299 + * if servers is not None: + * self.set_servers(servers) + * self.loop = loop # <<<<<<<<<<<<<< + * except: + * self.destroy() + */ + __Pyx_INCREF(__pyx_v_loop); + __Pyx_GIVEREF(__pyx_v_loop); + __Pyx_GOTREF(__pyx_v_self->loop); + __Pyx_DECREF(__pyx_v_self->loop); + __pyx_v_self->loop = __pyx_v_loop; + + /* "gevent/resolver/cares.pyx":296 + * self._watchers = {} + * self.channel = channel + * try: # <<<<<<<<<<<<<< + * if servers is not None: + * self.set_servers(servers) + */ + } + __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; + goto __pyx_L16_try_end; + __pyx_L11_error:; + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "gevent/resolver/cares.pyx":300 + * self.set_servers(servers) + * self.loop = loop + * except: # <<<<<<<<<<<<<< + * self.destroy() + * raise + */ + /*except:*/ { + __Pyx_AddTraceback("gevent.resolver.cares.channel.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_7, &__pyx_t_10) < 0) __PYX_ERR(0, 300, __pyx_L13_except_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GOTREF(__pyx_t_10); + + /* "gevent/resolver/cares.pyx":301 + * self.loop = loop + * except: + * self.destroy() # <<<<<<<<<<<<<< + * raise + * + */ + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_destroy); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 301, __pyx_L13_except_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_11 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) { + __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_9); + if (likely(__pyx_t_11)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); + __Pyx_INCREF(__pyx_t_11); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_9, function); + } + } + __pyx_t_8 = (__pyx_t_11) ? __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_11) : __Pyx_PyObject_CallNoArg(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 301, __pyx_L13_except_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + + /* "gevent/resolver/cares.pyx":302 + * except: + * self.destroy() + * raise # <<<<<<<<<<<<<< + * + * def __repr__(self): + */ + __Pyx_GIVEREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_7); + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_ErrRestoreWithState(__pyx_t_3, __pyx_t_7, __pyx_t_10); + __pyx_t_3 = 0; __pyx_t_7 = 0; __pyx_t_10 = 0; + __PYX_ERR(0, 302, __pyx_L13_except_error) + } + __pyx_L13_except_error:; + + /* "gevent/resolver/cares.pyx":296 + * self._watchers = {} + * self.channel = channel + * try: # <<<<<<<<<<<<<< + * if servers is not None: + * self.set_servers(servers) + */ + __Pyx_XGIVEREF(__pyx_t_12); + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14); + goto __pyx_L1_error; + __pyx_L16_try_end:; + } + + /* "gevent/resolver/cares.pyx":261 + * cdef public object _timer + * + * def __init__(self, object loop, flags=None, timeout=None, tries=None, ndots=None, # <<<<<<<<<<<<<< + * udp_port=None, tcp_port=None, servers=None): + * cdef ares_channeldata* channel = NULL + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_AddTraceback("gevent.resolver.cares.channel.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/resolver/cares.pyx":304 + * raise + * + * def __repr__(self): # <<<<<<<<<<<<<< + * args = (self.__class__.__name__, id(self), self._timer, len(self._watchers)) + * return '<%s at 0x%x _timer=%r _watchers[%s]>' % args + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_3__repr__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_3__repr__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_8resolver_5cares_7channel_2__repr__(((struct __pyx_obj_6gevent_8resolver_5cares_channel *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_8resolver_5cares_7channel_2__repr__(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self) { + PyObject *__pyx_v_args = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + Py_ssize_t __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + __Pyx_RefNannySetupContext("__repr__", 0); + + /* "gevent/resolver/cares.pyx":305 + * + * def __repr__(self): + * args = (self.__class__.__name__, id(self), self._timer, len(self._watchers)) # <<<<<<<<<<<<<< + * return '<%s at 0x%x _timer=%r _watchers[%s]>' % args + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 305, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 305, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 305, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __pyx_v_self->_watchers; + __Pyx_INCREF(__pyx_t_3); + if (unlikely(__pyx_t_3 == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + __PYX_ERR(0, 305, __pyx_L1_error) + } + __pyx_t_4 = PyDict_Size(__pyx_t_3); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 305, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 305, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 305, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1); + __Pyx_INCREF(__pyx_v_self->_timer); + __Pyx_GIVEREF(__pyx_v_self->_timer); + PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_self->_timer); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_3); + __pyx_t_2 = 0; + __pyx_t_1 = 0; + __pyx_t_3 = 0; + __pyx_v_args = ((PyObject*)__pyx_t_5); + __pyx_t_5 = 0; + + /* "gevent/resolver/cares.pyx":306 + * def __repr__(self): + * args = (self.__class__.__name__, id(self), self._timer, len(self._watchers)) + * return '<%s at 0x%x _timer=%r _watchers[%s]>' % args # <<<<<<<<<<<<<< + * + * def destroy(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_s_at_0x_x__timer_r__watchers_s, __pyx_v_args); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 306, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L0; + + /* "gevent/resolver/cares.pyx":304 + * raise + * + * def __repr__(self): # <<<<<<<<<<<<<< + * args = (self.__class__.__name__, id(self), self._timer, len(self._watchers)) + * return '<%s at 0x%x _timer=%r _watchers[%s]>' % args + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("gevent.resolver.cares.channel.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_args); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/resolver/cares.pyx":308 + * return '<%s at 0x%x _timer=%r _watchers[%s]>' % args + * + * def destroy(self): # <<<<<<<<<<<<<< + * if self.channel: + * # XXX ares_library_cleanup? + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_5destroy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_5destroy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("destroy (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_8resolver_5cares_7channel_4destroy(((struct __pyx_obj_6gevent_8resolver_5cares_channel *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_8resolver_5cares_7channel_4destroy(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + __Pyx_RefNannySetupContext("destroy", 0); + + /* "gevent/resolver/cares.pyx":309 + * + * def destroy(self): + * if self.channel: # <<<<<<<<<<<<<< + * # XXX ares_library_cleanup? + * cares.ares_destroy(self.channel) + */ + __pyx_t_1 = (__pyx_v_self->channel != 0); + if (__pyx_t_1) { + + /* "gevent/resolver/cares.pyx":311 + * if self.channel: + * # XXX ares_library_cleanup? + * cares.ares_destroy(self.channel) # <<<<<<<<<<<<<< + * self.channel = NULL + * self._watchers.clear() + */ + ares_destroy(__pyx_v_self->channel); + + /* "gevent/resolver/cares.pyx":312 + * # XXX ares_library_cleanup? + * cares.ares_destroy(self.channel) + * self.channel = NULL # <<<<<<<<<<<<<< + * self._watchers.clear() + * self._timer.stop() + */ + __pyx_v_self->channel = NULL; + + /* "gevent/resolver/cares.pyx":313 + * cares.ares_destroy(self.channel) + * self.channel = NULL + * self._watchers.clear() # <<<<<<<<<<<<<< + * self._timer.stop() + * self.loop = None + */ + if (unlikely(__pyx_v_self->_watchers == Py_None)) { + PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "clear"); + __PYX_ERR(0, 313, __pyx_L1_error) + } + __pyx_t_2 = __Pyx_PyDict_Clear(__pyx_v_self->_watchers); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 313, __pyx_L1_error) + + /* "gevent/resolver/cares.pyx":314 + * self.channel = NULL + * self._watchers.clear() + * self._timer.stop() # <<<<<<<<<<<<<< + * self.loop = None + * + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_timer, __pyx_n_s_stop); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 314, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + } + } + __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 314, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "gevent/resolver/cares.pyx":315 + * self._watchers.clear() + * self._timer.stop() + * self.loop = None # <<<<<<<<<<<<<< + * + * def __dealloc__(self): + */ + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->loop); + __Pyx_DECREF(__pyx_v_self->loop); + __pyx_v_self->loop = Py_None; + + /* "gevent/resolver/cares.pyx":309 + * + * def destroy(self): + * if self.channel: # <<<<<<<<<<<<<< + * # XXX ares_library_cleanup? + * cares.ares_destroy(self.channel) + */ + } + + /* "gevent/resolver/cares.pyx":308 + * return '<%s at 0x%x _timer=%r _watchers[%s]>' % args + * + * def destroy(self): # <<<<<<<<<<<<<< + * if self.channel: + * # XXX ares_library_cleanup? + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("gevent.resolver.cares.channel.destroy", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/resolver/cares.pyx":317 + * self.loop = None + * + * def __dealloc__(self): # <<<<<<<<<<<<<< + * if self.channel: + * # XXX ares_library_cleanup? + */ + +/* Python wrapper */ +static void __pyx_pw_6gevent_8resolver_5cares_7channel_7__dealloc__(PyObject *__pyx_v_self); /*proto*/ +static void __pyx_pw_6gevent_8resolver_5cares_7channel_7__dealloc__(PyObject *__pyx_v_self) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); + __pyx_pf_6gevent_8resolver_5cares_7channel_6__dealloc__(((struct __pyx_obj_6gevent_8resolver_5cares_channel *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +static void __pyx_pf_6gevent_8resolver_5cares_7channel_6__dealloc__(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self) { + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("__dealloc__", 0); + + /* "gevent/resolver/cares.pyx":318 + * + * def __dealloc__(self): + * if self.channel: # <<<<<<<<<<<<<< + * # XXX ares_library_cleanup? + * cares.ares_destroy(self.channel) + */ + __pyx_t_1 = (__pyx_v_self->channel != 0); + if (__pyx_t_1) { + + /* "gevent/resolver/cares.pyx":320 + * if self.channel: + * # XXX ares_library_cleanup? + * cares.ares_destroy(self.channel) # <<<<<<<<<<<<<< + * self.channel = NULL + * + */ + ares_destroy(__pyx_v_self->channel); + + /* "gevent/resolver/cares.pyx":321 + * # XXX ares_library_cleanup? + * cares.ares_destroy(self.channel) + * self.channel = NULL # <<<<<<<<<<<<<< + * + * cpdef set_servers(self, servers=None): + */ + __pyx_v_self->channel = NULL; + + /* "gevent/resolver/cares.pyx":318 + * + * def __dealloc__(self): + * if self.channel: # <<<<<<<<<<<<<< + * # XXX ares_library_cleanup? + * cares.ares_destroy(self.channel) + */ + } + + /* "gevent/resolver/cares.pyx":317 + * self.loop = None + * + * def __dealloc__(self): # <<<<<<<<<<<<<< + * if self.channel: + * # XXX ares_library_cleanup? + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "gevent/resolver/cares.pyx":323 + * self.channel = NULL + * + * cpdef set_servers(self, servers=None): # <<<<<<<<<<<<<< + * if not self.channel: + * raise gaierror(cares.ARES_EDESTRUCTION, 'this ares channel has been destroyed') + */ + +static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_9set_servers(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_6gevent_8resolver_5cares_7channel_set_servers(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_8resolver_5cares_7channel_set_servers *__pyx_optional_args) { + PyObject *__pyx_v_servers = ((PyObject *)Py_None); + int __pyx_v_length; + CYTHON_UNUSED int __pyx_v_result; + int __pyx_v_index; + char *__pyx_v_string; + struct ares_addr_node *__pyx_v_c_servers; + PyObject *__pyx_v_server = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + int __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + int __pyx_t_8; + Py_ssize_t __pyx_t_9; + PyObject *(*__pyx_t_10)(PyObject *); + char *__pyx_t_11; + int __pyx_t_12; + char const *__pyx_t_13; + PyObject *__pyx_t_14 = NULL; + PyObject *__pyx_t_15 = NULL; + PyObject *__pyx_t_16 = NULL; + PyObject *__pyx_t_17 = NULL; + PyObject *__pyx_t_18 = NULL; + PyObject *__pyx_t_19 = NULL; + __Pyx_RefNannySetupContext("set_servers", 0); + if (__pyx_optional_args) { + if (__pyx_optional_args->__pyx_n > 0) { + __pyx_v_servers = __pyx_optional_args->servers; + } + } + __Pyx_INCREF(__pyx_v_servers); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0; + if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self)))))); + else { + PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + #endif + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_servers); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 323, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_8resolver_5cares_7channel_9set_servers)) { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_servers) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_servers); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 323, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0; + if (unlikely(type_dict_guard != tp_dict_version)) { + tp_dict_version = obj_dict_version = 0; + } + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + } + #endif + } + + /* "gevent/resolver/cares.pyx":324 + * + * cpdef set_servers(self, servers=None): + * if not self.channel: # <<<<<<<<<<<<<< + * raise gaierror(cares.ARES_EDESTRUCTION, 'this ares channel has been destroyed') + * if not servers: + */ + __pyx_t_5 = ((!(__pyx_v_self->channel != 0)) != 0); + if (unlikely(__pyx_t_5)) { + + /* "gevent/resolver/cares.pyx":325 + * cpdef set_servers(self, servers=None): + * if not self.channel: + * raise gaierror(cares.ARES_EDESTRUCTION, 'this ares channel has been destroyed') # <<<<<<<<<<<<<< + * if not servers: + * servers = [] + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_gaierror); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 325, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyInt_From_int(ARES_EDESTRUCTION); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 325, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = NULL; + __pyx_t_6 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_6 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_3, __pyx_kp_s_this_ares_channel_has_been_destr}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 325, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_3, __pyx_kp_s_this_ares_channel_has_been_destr}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 325, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } else + #endif + { + __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 325, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + if (__pyx_t_4) { + __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4); __pyx_t_4 = NULL; + } + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_t_3); + __Pyx_INCREF(__pyx_kp_s_this_ares_channel_has_been_destr); + __Pyx_GIVEREF(__pyx_kp_s_this_ares_channel_has_been_destr); + PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_kp_s_this_ares_channel_has_been_destr); + __pyx_t_3 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 325, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 325, __pyx_L1_error) + + /* "gevent/resolver/cares.pyx":324 + * + * cpdef set_servers(self, servers=None): + * if not self.channel: # <<<<<<<<<<<<<< + * raise gaierror(cares.ARES_EDESTRUCTION, 'this ares channel has been destroyed') + * if not servers: + */ + } + + /* "gevent/resolver/cares.pyx":326 + * if not self.channel: + * raise gaierror(cares.ARES_EDESTRUCTION, 'this ares channel has been destroyed') + * if not servers: # <<<<<<<<<<<<<< + * servers = [] + * if isinstance(servers, string_types): + */ + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_servers); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 326, __pyx_L1_error) + __pyx_t_8 = ((!__pyx_t_5) != 0); + if (__pyx_t_8) { + + /* "gevent/resolver/cares.pyx":327 + * raise gaierror(cares.ARES_EDESTRUCTION, 'this ares channel has been destroyed') + * if not servers: + * servers = [] # <<<<<<<<<<<<<< + * if isinstance(servers, string_types): + * servers = servers.split(',') + */ + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 327, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF_SET(__pyx_v_servers, __pyx_t_1); + __pyx_t_1 = 0; + + /* "gevent/resolver/cares.pyx":326 + * if not self.channel: + * raise gaierror(cares.ARES_EDESTRUCTION, 'this ares channel has been destroyed') + * if not servers: # <<<<<<<<<<<<<< + * servers = [] + * if isinstance(servers, string_types): + */ + } + + /* "gevent/resolver/cares.pyx":328 + * if not servers: + * servers = [] + * if isinstance(servers, string_types): # <<<<<<<<<<<<<< + * servers = servers.split(',') + * cdef int length = len(servers) + */ + __pyx_t_1 = __pyx_v_6gevent_8resolver_5cares_string_types; + __Pyx_INCREF(__pyx_t_1); + __pyx_t_8 = PyObject_IsInstance(__pyx_v_servers, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 328, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_5 = (__pyx_t_8 != 0); + if (__pyx_t_5) { + + /* "gevent/resolver/cares.pyx":329 + * servers = [] + * if isinstance(servers, string_types): + * servers = servers.split(',') # <<<<<<<<<<<<<< + * cdef int length = len(servers) + * cdef int result, index + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_servers, __pyx_n_s_split); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 329, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_7 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_7)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_7); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_7, __pyx_kp_s__2) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_kp_s__2); + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 329, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF_SET(__pyx_v_servers, __pyx_t_1); + __pyx_t_1 = 0; + + /* "gevent/resolver/cares.pyx":328 + * if not servers: + * servers = [] + * if isinstance(servers, string_types): # <<<<<<<<<<<<<< + * servers = servers.split(',') + * cdef int length = len(servers) + */ + } + + /* "gevent/resolver/cares.pyx":330 + * if isinstance(servers, string_types): + * servers = servers.split(',') + * cdef int length = len(servers) # <<<<<<<<<<<<<< + * cdef int result, index + * cdef char* string + */ + __pyx_t_9 = PyObject_Length(__pyx_v_servers); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 330, __pyx_L1_error) + __pyx_v_length = __pyx_t_9; + + /* "gevent/resolver/cares.pyx":334 + * cdef char* string + * cdef cares.ares_addr_node* c_servers + * if length <= 0: # <<<<<<<<<<<<<< + * result = cares.ares_set_servers(self.channel, NULL) + * else: + */ + __pyx_t_5 = ((__pyx_v_length <= 0) != 0); + if (__pyx_t_5) { + + /* "gevent/resolver/cares.pyx":335 + * cdef cares.ares_addr_node* c_servers + * if length <= 0: + * result = cares.ares_set_servers(self.channel, NULL) # <<<<<<<<<<<<<< + * else: + * c_servers = PyMem_Malloc(sizeof(cares.ares_addr_node) * length) + */ + __pyx_v_result = ares_set_servers(__pyx_v_self->channel, NULL); + + /* "gevent/resolver/cares.pyx":334 + * cdef char* string + * cdef cares.ares_addr_node* c_servers + * if length <= 0: # <<<<<<<<<<<<<< + * result = cares.ares_set_servers(self.channel, NULL) + * else: + */ + goto __pyx_L6; + } + + /* "gevent/resolver/cares.pyx":337 + * result = cares.ares_set_servers(self.channel, NULL) + * else: + * c_servers = PyMem_Malloc(sizeof(cares.ares_addr_node) * length) # <<<<<<<<<<<<<< + * if not c_servers: + * raise MemoryError + */ + /*else*/ { + __pyx_v_c_servers = ((struct ares_addr_node *)PyMem_Malloc(((sizeof(struct ares_addr_node)) * __pyx_v_length))); + + /* "gevent/resolver/cares.pyx":338 + * else: + * c_servers = PyMem_Malloc(sizeof(cares.ares_addr_node) * length) + * if not c_servers: # <<<<<<<<<<<<<< + * raise MemoryError + * try: + */ + __pyx_t_5 = ((!(__pyx_v_c_servers != 0)) != 0); + if (unlikely(__pyx_t_5)) { + + /* "gevent/resolver/cares.pyx":339 + * c_servers = PyMem_Malloc(sizeof(cares.ares_addr_node) * length) + * if not c_servers: + * raise MemoryError # <<<<<<<<<<<<<< + * try: + * index = 0 + */ + PyErr_NoMemory(); __PYX_ERR(0, 339, __pyx_L1_error) + + /* "gevent/resolver/cares.pyx":338 + * else: + * c_servers = PyMem_Malloc(sizeof(cares.ares_addr_node) * length) + * if not c_servers: # <<<<<<<<<<<<<< + * raise MemoryError + * try: + */ + } + + /* "gevent/resolver/cares.pyx":340 + * if not c_servers: + * raise MemoryError + * try: # <<<<<<<<<<<<<< + * index = 0 + * for server in servers: + */ + /*try:*/ { + + /* "gevent/resolver/cares.pyx":341 + * raise MemoryError + * try: + * index = 0 # <<<<<<<<<<<<<< + * for server in servers: + * if isinstance(server, unicode): + */ + __pyx_v_index = 0; + + /* "gevent/resolver/cares.pyx":342 + * try: + * index = 0 + * for server in servers: # <<<<<<<<<<<<<< + * if isinstance(server, unicode): + * server = server.encode('ascii') + */ + if (likely(PyList_CheckExact(__pyx_v_servers)) || PyTuple_CheckExact(__pyx_v_servers)) { + __pyx_t_1 = __pyx_v_servers; __Pyx_INCREF(__pyx_t_1); __pyx_t_9 = 0; + __pyx_t_10 = NULL; + } else { + __pyx_t_9 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_servers); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 342, __pyx_L9_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_10 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 342, __pyx_L9_error) + } + for (;;) { + if (likely(!__pyx_t_10)) { + if (likely(PyList_CheckExact(__pyx_t_1))) { + if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_9); __Pyx_INCREF(__pyx_t_2); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 342, __pyx_L9_error) + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 342, __pyx_L9_error) + __Pyx_GOTREF(__pyx_t_2); + #endif + } else { + if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_9); __Pyx_INCREF(__pyx_t_2); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 342, __pyx_L9_error) + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 342, __pyx_L9_error) + __Pyx_GOTREF(__pyx_t_2); + #endif + } + } else { + __pyx_t_2 = __pyx_t_10(__pyx_t_1); + if (unlikely(!__pyx_t_2)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(0, 342, __pyx_L9_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_2); + } + __Pyx_XDECREF_SET(__pyx_v_server, __pyx_t_2); + __pyx_t_2 = 0; + + /* "gevent/resolver/cares.pyx":343 + * index = 0 + * for server in servers: + * if isinstance(server, unicode): # <<<<<<<<<<<<<< + * server = server.encode('ascii') + * string = server + */ + __pyx_t_5 = PyUnicode_Check(__pyx_v_server); + __pyx_t_8 = (__pyx_t_5 != 0); + if (__pyx_t_8) { + + /* "gevent/resolver/cares.pyx":344 + * for server in servers: + * if isinstance(server, unicode): + * server = server.encode('ascii') # <<<<<<<<<<<<<< + * string = server + * if cares.ares_inet_pton(AF_INET, string, &c_servers[index].addr) > 0: + */ + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_server, __pyx_n_s_encode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 344, __pyx_L9_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_7); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_7, function); + } + } + __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_3, __pyx_n_s_ascii) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_n_s_ascii); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 344, __pyx_L9_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF_SET(__pyx_v_server, __pyx_t_2); + __pyx_t_2 = 0; + + /* "gevent/resolver/cares.pyx":343 + * index = 0 + * for server in servers: + * if isinstance(server, unicode): # <<<<<<<<<<<<<< + * server = server.encode('ascii') + * string = server + */ + } + + /* "gevent/resolver/cares.pyx":345 + * if isinstance(server, unicode): + * server = server.encode('ascii') + * string = server # <<<<<<<<<<<<<< + * if cares.ares_inet_pton(AF_INET, string, &c_servers[index].addr) > 0: + * c_servers[index].family = AF_INET + */ + __pyx_t_11 = __Pyx_PyObject_AsWritableString(__pyx_v_server); if (unlikely((!__pyx_t_11) && PyErr_Occurred())) __PYX_ERR(0, 345, __pyx_L9_error) + __pyx_v_string = ((char *)__pyx_t_11); + + /* "gevent/resolver/cares.pyx":346 + * server = server.encode('ascii') + * string = server + * if cares.ares_inet_pton(AF_INET, string, &c_servers[index].addr) > 0: # <<<<<<<<<<<<<< + * c_servers[index].family = AF_INET + * elif cares.ares_inet_pton(AF_INET6, string, &c_servers[index].addr) > 0: + */ + __pyx_t_8 = ((ares_inet_pton(AF_INET, __pyx_v_string, (&(__pyx_v_c_servers[__pyx_v_index]).addr)) > 0) != 0); + if (__pyx_t_8) { + + /* "gevent/resolver/cares.pyx":347 + * string = server + * if cares.ares_inet_pton(AF_INET, string, &c_servers[index].addr) > 0: + * c_servers[index].family = AF_INET # <<<<<<<<<<<<<< + * elif cares.ares_inet_pton(AF_INET6, string, &c_servers[index].addr) > 0: + * c_servers[index].family = AF_INET6 + */ + (__pyx_v_c_servers[__pyx_v_index]).family = AF_INET; + + /* "gevent/resolver/cares.pyx":346 + * server = server.encode('ascii') + * string = server + * if cares.ares_inet_pton(AF_INET, string, &c_servers[index].addr) > 0: # <<<<<<<<<<<<<< + * c_servers[index].family = AF_INET + * elif cares.ares_inet_pton(AF_INET6, string, &c_servers[index].addr) > 0: + */ + goto __pyx_L14; + } + + /* "gevent/resolver/cares.pyx":348 + * if cares.ares_inet_pton(AF_INET, string, &c_servers[index].addr) > 0: + * c_servers[index].family = AF_INET + * elif cares.ares_inet_pton(AF_INET6, string, &c_servers[index].addr) > 0: # <<<<<<<<<<<<<< + * c_servers[index].family = AF_INET6 + * else: + */ + __pyx_t_8 = ((ares_inet_pton(AF_INET6, __pyx_v_string, (&(__pyx_v_c_servers[__pyx_v_index]).addr)) > 0) != 0); + if (likely(__pyx_t_8)) { + + /* "gevent/resolver/cares.pyx":349 + * c_servers[index].family = AF_INET + * elif cares.ares_inet_pton(AF_INET6, string, &c_servers[index].addr) > 0: + * c_servers[index].family = AF_INET6 # <<<<<<<<<<<<<< + * else: + * raise InvalidIP(repr(string)) + */ + (__pyx_v_c_servers[__pyx_v_index]).family = AF_INET6; + + /* "gevent/resolver/cares.pyx":348 + * if cares.ares_inet_pton(AF_INET, string, &c_servers[index].addr) > 0: + * c_servers[index].family = AF_INET + * elif cares.ares_inet_pton(AF_INET6, string, &c_servers[index].addr) > 0: # <<<<<<<<<<<<<< + * c_servers[index].family = AF_INET6 + * else: + */ + goto __pyx_L14; + } + + /* "gevent/resolver/cares.pyx":351 + * c_servers[index].family = AF_INET6 + * else: + * raise InvalidIP(repr(string)) # <<<<<<<<<<<<<< + * c_servers[index].next = &c_servers[index] + 1 + * index += 1 + */ + /*else*/ { + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_InvalidIP); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 351, __pyx_L9_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_string); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 351, __pyx_L9_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_Repr(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 351, __pyx_L9_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_7); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_7, function); + } + } + __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_4); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 351, __pyx_L9_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 351, __pyx_L9_error) + } + __pyx_L14:; + + /* "gevent/resolver/cares.pyx":352 + * else: + * raise InvalidIP(repr(string)) + * c_servers[index].next = &c_servers[index] + 1 # <<<<<<<<<<<<<< + * index += 1 + * if index >= length: + */ + (__pyx_v_c_servers[__pyx_v_index]).next = ((&(__pyx_v_c_servers[__pyx_v_index])) + 1); + + /* "gevent/resolver/cares.pyx":353 + * raise InvalidIP(repr(string)) + * c_servers[index].next = &c_servers[index] + 1 + * index += 1 # <<<<<<<<<<<<<< + * if index >= length: + * break + */ + __pyx_v_index = (__pyx_v_index + 1); + + /* "gevent/resolver/cares.pyx":354 + * c_servers[index].next = &c_servers[index] + 1 + * index += 1 + * if index >= length: # <<<<<<<<<<<<<< + * break + * c_servers[length - 1].next = NULL + */ + __pyx_t_8 = ((__pyx_v_index >= __pyx_v_length) != 0); + if (__pyx_t_8) { + + /* "gevent/resolver/cares.pyx":355 + * index += 1 + * if index >= length: + * break # <<<<<<<<<<<<<< + * c_servers[length - 1].next = NULL + * index = cares.ares_set_servers(self.channel, c_servers) + */ + goto __pyx_L12_break; + + /* "gevent/resolver/cares.pyx":354 + * c_servers[index].next = &c_servers[index] + 1 + * index += 1 + * if index >= length: # <<<<<<<<<<<<<< + * break + * c_servers[length - 1].next = NULL + */ + } + + /* "gevent/resolver/cares.pyx":342 + * try: + * index = 0 + * for server in servers: # <<<<<<<<<<<<<< + * if isinstance(server, unicode): + * server = server.encode('ascii') + */ + } + __pyx_L12_break:; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "gevent/resolver/cares.pyx":356 + * if index >= length: + * break + * c_servers[length - 1].next = NULL # <<<<<<<<<<<<<< + * index = cares.ares_set_servers(self.channel, c_servers) + * if index: + */ + (__pyx_v_c_servers[(__pyx_v_length - 1)]).next = NULL; + + /* "gevent/resolver/cares.pyx":357 + * break + * c_servers[length - 1].next = NULL + * index = cares.ares_set_servers(self.channel, c_servers) # <<<<<<<<<<<<<< + * if index: + * raise ValueError(strerror(index)) + */ + __pyx_v_index = ares_set_servers(__pyx_v_self->channel, __pyx_v_c_servers); + + /* "gevent/resolver/cares.pyx":358 + * c_servers[length - 1].next = NULL + * index = cares.ares_set_servers(self.channel, c_servers) + * if index: # <<<<<<<<<<<<<< + * raise ValueError(strerror(index)) + * finally: + */ + __pyx_t_8 = (__pyx_v_index != 0); + if (unlikely(__pyx_t_8)) { + + /* "gevent/resolver/cares.pyx":359 + * index = cares.ares_set_servers(self.channel, c_servers) + * if index: + * raise ValueError(strerror(index)) # <<<<<<<<<<<<<< + * finally: + * PyMem_Free(c_servers) + */ + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 359, __pyx_L9_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __pyx_f_6gevent_8resolver_5cares_strerror(__pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 359, __pyx_L9_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 359, __pyx_L9_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 359, __pyx_L9_error) + + /* "gevent/resolver/cares.pyx":358 + * c_servers[length - 1].next = NULL + * index = cares.ares_set_servers(self.channel, c_servers) + * if index: # <<<<<<<<<<<<<< + * raise ValueError(strerror(index)) + * finally: + */ + } + } + + /* "gevent/resolver/cares.pyx":361 + * raise ValueError(strerror(index)) + * finally: + * PyMem_Free(c_servers) # <<<<<<<<<<<<<< + * + * # this crashes c-ares + */ + /*finally:*/ { + /*normal exit:*/{ + PyMem_Free(__pyx_v_c_servers); + goto __pyx_L10; + } + __pyx_L9_error:; + /*exception exit:*/{ + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19); + if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_14, &__pyx_t_15, &__pyx_t_16) < 0)) __Pyx_ErrFetch(&__pyx_t_14, &__pyx_t_15, &__pyx_t_16); + __Pyx_XGOTREF(__pyx_t_14); + __Pyx_XGOTREF(__pyx_t_15); + __Pyx_XGOTREF(__pyx_t_16); + __Pyx_XGOTREF(__pyx_t_17); + __Pyx_XGOTREF(__pyx_t_18); + __Pyx_XGOTREF(__pyx_t_19); + __pyx_t_6 = __pyx_lineno; __pyx_t_12 = __pyx_clineno; __pyx_t_13 = __pyx_filename; + { + PyMem_Free(__pyx_v_c_servers); + } + if (PY_MAJOR_VERSION >= 3) { + __Pyx_XGIVEREF(__pyx_t_17); + __Pyx_XGIVEREF(__pyx_t_18); + __Pyx_XGIVEREF(__pyx_t_19); + __Pyx_ExceptionReset(__pyx_t_17, __pyx_t_18, __pyx_t_19); + } + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_XGIVEREF(__pyx_t_15); + __Pyx_XGIVEREF(__pyx_t_16); + __Pyx_ErrRestore(__pyx_t_14, __pyx_t_15, __pyx_t_16); + __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; + __pyx_lineno = __pyx_t_6; __pyx_clineno = __pyx_t_12; __pyx_filename = __pyx_t_13; + goto __pyx_L1_error; + } + __pyx_L10:; + } + } + __pyx_L6:; + + /* "gevent/resolver/cares.pyx":323 + * self.channel = NULL + * + * cpdef set_servers(self, servers=None): # <<<<<<<<<<<<<< + * if not self.channel: + * raise gaierror(cares.ARES_EDESTRUCTION, 'this ares channel has been destroyed') + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("gevent.resolver.cares.channel.set_servers", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_server); + __Pyx_XDECREF(__pyx_v_servers); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_9set_servers(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_9set_servers(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_servers = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("set_servers (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_servers,0}; + PyObject* values[1] = {0}; + values[0] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_servers); + if (value) { values[0] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_servers") < 0)) __PYX_ERR(0, 323, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_servers = values[0]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("set_servers", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 323, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.resolver.cares.channel.set_servers", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_8resolver_5cares_7channel_8set_servers(((struct __pyx_obj_6gevent_8resolver_5cares_channel *)__pyx_v_self), __pyx_v_servers); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_8resolver_5cares_7channel_8set_servers(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self, PyObject *__pyx_v_servers) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + struct __pyx_opt_args_6gevent_8resolver_5cares_7channel_set_servers __pyx_t_2; + __Pyx_RefNannySetupContext("set_servers", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_2.__pyx_n = 1; + __pyx_t_2.servers = __pyx_v_servers; + __pyx_t_1 = __pyx_vtabptr_6gevent_8resolver_5cares_channel->set_servers(__pyx_v_self, 1, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 323, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.resolver.cares.channel.set_servers", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/resolver/cares.pyx":367 + * # cares.ares_cancel(self.channel) + * + * cdef _sock_state_callback(self, int socket, int read, int write): # <<<<<<<<<<<<<< + * if not self.channel: + * return + */ + +static PyObject *__pyx_f_6gevent_8resolver_5cares_7channel__sock_state_callback(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self, int __pyx_v_socket, int __pyx_v_read, int __pyx_v_write) { + PyObject *__pyx_v_watcher = 0; + int __pyx_v_events; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + __Pyx_RefNannySetupContext("_sock_state_callback", 0); + + /* "gevent/resolver/cares.pyx":368 + * + * cdef _sock_state_callback(self, int socket, int read, int write): + * if not self.channel: # <<<<<<<<<<<<<< + * return + * cdef object watcher = self._watchers.get(socket) + */ + __pyx_t_1 = ((!(__pyx_v_self->channel != 0)) != 0); + if (__pyx_t_1) { + + /* "gevent/resolver/cares.pyx":369 + * cdef _sock_state_callback(self, int socket, int read, int write): + * if not self.channel: + * return # <<<<<<<<<<<<<< + * cdef object watcher = self._watchers.get(socket) + * cdef int events = 0 + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + + /* "gevent/resolver/cares.pyx":368 + * + * cdef _sock_state_callback(self, int socket, int read, int write): + * if not self.channel: # <<<<<<<<<<<<<< + * return + * cdef object watcher = self._watchers.get(socket) + */ + } + + /* "gevent/resolver/cares.pyx":370 + * if not self.channel: + * return + * cdef object watcher = self._watchers.get(socket) # <<<<<<<<<<<<<< + * cdef int events = 0 + * if read: + */ + if (unlikely(__pyx_v_self->_watchers == Py_None)) { + PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get"); + __PYX_ERR(0, 370, __pyx_L1_error) + } + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_socket); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 370, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyDict_GetItemDefault(__pyx_v_self->_watchers, __pyx_t_2, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 370, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_watcher = __pyx_t_3; + __pyx_t_3 = 0; + + /* "gevent/resolver/cares.pyx":371 + * return + * cdef object watcher = self._watchers.get(socket) + * cdef int events = 0 # <<<<<<<<<<<<<< + * if read: + * events |= EV_READ + */ + __pyx_v_events = 0; + + /* "gevent/resolver/cares.pyx":372 + * cdef object watcher = self._watchers.get(socket) + * cdef int events = 0 + * if read: # <<<<<<<<<<<<<< + * events |= EV_READ + * if write: + */ + __pyx_t_1 = (__pyx_v_read != 0); + if (__pyx_t_1) { + + /* "gevent/resolver/cares.pyx":373 + * cdef int events = 0 + * if read: + * events |= EV_READ # <<<<<<<<<<<<<< + * if write: + * events |= EV_WRITE + */ + __pyx_v_events = (__pyx_v_events | 1); + + /* "gevent/resolver/cares.pyx":372 + * cdef object watcher = self._watchers.get(socket) + * cdef int events = 0 + * if read: # <<<<<<<<<<<<<< + * events |= EV_READ + * if write: + */ + } + + /* "gevent/resolver/cares.pyx":374 + * if read: + * events |= EV_READ + * if write: # <<<<<<<<<<<<<< + * events |= EV_WRITE + * if watcher is None: + */ + __pyx_t_1 = (__pyx_v_write != 0); + if (__pyx_t_1) { + + /* "gevent/resolver/cares.pyx":375 + * events |= EV_READ + * if write: + * events |= EV_WRITE # <<<<<<<<<<<<<< + * if watcher is None: + * if not events: + */ + __pyx_v_events = (__pyx_v_events | 2); + + /* "gevent/resolver/cares.pyx":374 + * if read: + * events |= EV_READ + * if write: # <<<<<<<<<<<<<< + * events |= EV_WRITE + * if watcher is None: + */ + } + + /* "gevent/resolver/cares.pyx":376 + * if write: + * events |= EV_WRITE + * if watcher is None: # <<<<<<<<<<<<<< + * if not events: + * return + */ + __pyx_t_1 = (__pyx_v_watcher == Py_None); + __pyx_t_4 = (__pyx_t_1 != 0); + if (__pyx_t_4) { + + /* "gevent/resolver/cares.pyx":377 + * events |= EV_WRITE + * if watcher is None: + * if not events: # <<<<<<<<<<<<<< + * return + * watcher = self.loop.io(socket, events) + */ + __pyx_t_4 = ((!(__pyx_v_events != 0)) != 0); + if (__pyx_t_4) { + + /* "gevent/resolver/cares.pyx":378 + * if watcher is None: + * if not events: + * return # <<<<<<<<<<<<<< + * watcher = self.loop.io(socket, events) + * self._watchers[socket] = watcher + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + + /* "gevent/resolver/cares.pyx":377 + * events |= EV_WRITE + * if watcher is None: + * if not events: # <<<<<<<<<<<<<< + * return + * watcher = self.loop.io(socket, events) + */ + } + + /* "gevent/resolver/cares.pyx":379 + * if not events: + * return + * watcher = self.loop.io(socket, events) # <<<<<<<<<<<<<< + * self._watchers[socket] = watcher + * elif events: + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->loop, __pyx_n_s_io); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 379, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_socket); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 379, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_events); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 379, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = NULL; + __pyx_t_8 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_7)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_7); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_8 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_5, __pyx_t_6}; + __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 379, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_5, __pyx_t_6}; + __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 379, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } else + #endif + { + __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 379, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + if (__pyx_t_7) { + __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL; + } + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_t_6); + __pyx_t_5 = 0; + __pyx_t_6 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 379, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF_SET(__pyx_v_watcher, __pyx_t_3); + __pyx_t_3 = 0; + + /* "gevent/resolver/cares.pyx":380 + * return + * watcher = self.loop.io(socket, events) + * self._watchers[socket] = watcher # <<<<<<<<<<<<<< + * elif events: + * if watcher.events == events: + */ + if (unlikely(__pyx_v_self->_watchers == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 380, __pyx_L1_error) + } + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_socket); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 380, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (unlikely(PyDict_SetItem(__pyx_v_self->_watchers, __pyx_t_3, __pyx_v_watcher) < 0)) __PYX_ERR(0, 380, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "gevent/resolver/cares.pyx":376 + * if write: + * events |= EV_WRITE + * if watcher is None: # <<<<<<<<<<<<<< + * if not events: + * return + */ + goto __pyx_L6; + } + + /* "gevent/resolver/cares.pyx":381 + * watcher = self.loop.io(socket, events) + * self._watchers[socket] = watcher + * elif events: # <<<<<<<<<<<<<< + * if watcher.events == events: + * return + */ + __pyx_t_4 = (__pyx_v_events != 0); + if (__pyx_t_4) { + + /* "gevent/resolver/cares.pyx":382 + * self._watchers[socket] = watcher + * elif events: + * if watcher.events == events: # <<<<<<<<<<<<<< + * return + * watcher.stop() + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_watcher, __pyx_n_s_events); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 382, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_events); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 382, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_9 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 382, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 382, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (__pyx_t_4) { + + /* "gevent/resolver/cares.pyx":383 + * elif events: + * if watcher.events == events: + * return # <<<<<<<<<<<<<< + * watcher.stop() + * watcher.events = events + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + + /* "gevent/resolver/cares.pyx":382 + * self._watchers[socket] = watcher + * elif events: + * if watcher.events == events: # <<<<<<<<<<<<<< + * return + * watcher.stop() + */ + } + + /* "gevent/resolver/cares.pyx":384 + * if watcher.events == events: + * return + * watcher.stop() # <<<<<<<<<<<<<< + * watcher.events = events + * else: + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_watcher, __pyx_n_s_stop); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 384, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_9 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 384, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "gevent/resolver/cares.pyx":385 + * return + * watcher.stop() + * watcher.events = events # <<<<<<<<<<<<<< + * else: + * watcher.stop() + */ + __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_events); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 385, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + if (__Pyx_PyObject_SetAttrStr(__pyx_v_watcher, __pyx_n_s_events, __pyx_t_9) < 0) __PYX_ERR(0, 385, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "gevent/resolver/cares.pyx":381 + * watcher = self.loop.io(socket, events) + * self._watchers[socket] = watcher + * elif events: # <<<<<<<<<<<<<< + * if watcher.events == events: + * return + */ + goto __pyx_L6; + } + + /* "gevent/resolver/cares.pyx":387 + * watcher.events = events + * else: + * watcher.stop() # <<<<<<<<<<<<<< + * watcher.close() + * self._watchers.pop(socket, None) + */ + /*else*/ { + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_watcher, __pyx_n_s_stop); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 387, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_9 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 387, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "gevent/resolver/cares.pyx":388 + * else: + * watcher.stop() + * watcher.close() # <<<<<<<<<<<<<< + * self._watchers.pop(socket, None) + * if not self._watchers: + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_watcher, __pyx_n_s_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 388, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_9 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 388, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "gevent/resolver/cares.pyx":389 + * watcher.stop() + * watcher.close() + * self._watchers.pop(socket, None) # <<<<<<<<<<<<<< + * if not self._watchers: + * self._timer.stop() + */ + if (unlikely(__pyx_v_self->_watchers == Py_None)) { + PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "pop"); + __PYX_ERR(0, 389, __pyx_L1_error) + } + __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_socket); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 389, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_2 = __Pyx_PyDict_Pop(__pyx_v_self->_watchers, __pyx_t_9, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 389, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "gevent/resolver/cares.pyx":390 + * watcher.close() + * self._watchers.pop(socket, None) + * if not self._watchers: # <<<<<<<<<<<<<< + * self._timer.stop() + * return + */ + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_self->_watchers); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 390, __pyx_L1_error) + __pyx_t_1 = ((!__pyx_t_4) != 0); + if (__pyx_t_1) { + + /* "gevent/resolver/cares.pyx":391 + * self._watchers.pop(socket, None) + * if not self._watchers: + * self._timer.stop() # <<<<<<<<<<<<<< + * return + * watcher.start(self._process_fd, watcher, pass_events=True) + */ + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_timer, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 391, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_9, function); + } + } + __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 391, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "gevent/resolver/cares.pyx":390 + * watcher.close() + * self._watchers.pop(socket, None) + * if not self._watchers: # <<<<<<<<<<<<<< + * self._timer.stop() + * return + */ + } + + /* "gevent/resolver/cares.pyx":392 + * if not self._watchers: + * self._timer.stop() + * return # <<<<<<<<<<<<<< + * watcher.start(self._process_fd, watcher, pass_events=True) + * self._timer.again(self._on_timer) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + } + __pyx_L6:; + + /* "gevent/resolver/cares.pyx":393 + * self._timer.stop() + * return + * watcher.start(self._process_fd, watcher, pass_events=True) # <<<<<<<<<<<<<< + * self._timer.again(self._on_timer) + * + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_watcher, __pyx_n_s_start); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 393, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_process_fd); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 393, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 393, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_9); + __Pyx_INCREF(__pyx_v_watcher); + __Pyx_GIVEREF(__pyx_v_watcher); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_watcher); + __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 393, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_pass_events, Py_True) < 0) __PYX_ERR(0, 393, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_9); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 393, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "gevent/resolver/cares.pyx":394 + * return + * watcher.start(self._process_fd, watcher, pass_events=True) + * self._timer.again(self._on_timer) # <<<<<<<<<<<<<< + * + * def _on_timer(self): + */ + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_timer, __pyx_n_s_again); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 394, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_on_timer); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 394, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) { + __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_9); + if (likely(__pyx_t_2)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_9, function); + } + } + __pyx_t_6 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_3); + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 394, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "gevent/resolver/cares.pyx":367 + * # cares.ares_cancel(self.channel) + * + * cdef _sock_state_callback(self, int socket, int read, int write): # <<<<<<<<<<<<<< + * if not self.channel: + * return + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_AddTraceback("gevent.resolver.cares.channel._sock_state_callback", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_watcher); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/resolver/cares.pyx":396 + * self._timer.again(self._on_timer) + * + * def _on_timer(self): # <<<<<<<<<<<<<< + * cares.ares_process_fd(self.channel, cares.ARES_SOCKET_BAD, cares.ARES_SOCKET_BAD) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_11_on_timer(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_11_on_timer(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_on_timer (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_8resolver_5cares_7channel_10_on_timer(((struct __pyx_obj_6gevent_8resolver_5cares_channel *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_8resolver_5cares_7channel_10_on_timer(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_on_timer", 0); + + /* "gevent/resolver/cares.pyx":397 + * + * def _on_timer(self): + * cares.ares_process_fd(self.channel, cares.ARES_SOCKET_BAD, cares.ARES_SOCKET_BAD) # <<<<<<<<<<<<<< + * + * def _process_fd(self, int events, object watcher): + */ + ares_process_fd(__pyx_v_self->channel, ARES_SOCKET_BAD, ARES_SOCKET_BAD); + + /* "gevent/resolver/cares.pyx":396 + * self._timer.again(self._on_timer) + * + * def _on_timer(self): # <<<<<<<<<<<<<< + * cares.ares_process_fd(self.channel, cares.ARES_SOCKET_BAD, cares.ARES_SOCKET_BAD) + * + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/resolver/cares.pyx":399 + * cares.ares_process_fd(self.channel, cares.ARES_SOCKET_BAD, cares.ARES_SOCKET_BAD) + * + * def _process_fd(self, int events, object watcher): # <<<<<<<<<<<<<< + * if not self.channel: + * return + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_13_process_fd(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_13_process_fd(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + int __pyx_v_events; + PyObject *__pyx_v_watcher = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_process_fd (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_events,&__pyx_n_s_watcher,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_events)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_watcher)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("_process_fd", 1, 2, 2, 1); __PYX_ERR(0, 399, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_process_fd") < 0)) __PYX_ERR(0, 399, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_events = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_events == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 399, __pyx_L3_error) + __pyx_v_watcher = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("_process_fd", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 399, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.resolver.cares.channel._process_fd", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_8resolver_5cares_7channel_12_process_fd(((struct __pyx_obj_6gevent_8resolver_5cares_channel *)__pyx_v_self), __pyx_v_events, __pyx_v_watcher); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_8resolver_5cares_7channel_12_process_fd(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self, int __pyx_v_events, PyObject *__pyx_v_watcher) { + int __pyx_v_read_fd; + int __pyx_v_write_fd; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + __Pyx_RefNannySetupContext("_process_fd", 0); + + /* "gevent/resolver/cares.pyx":400 + * + * def _process_fd(self, int events, object watcher): + * if not self.channel: # <<<<<<<<<<<<<< + * return + * cdef int read_fd = watcher.fd + */ + __pyx_t_1 = ((!(__pyx_v_self->channel != 0)) != 0); + if (__pyx_t_1) { + + /* "gevent/resolver/cares.pyx":401 + * def _process_fd(self, int events, object watcher): + * if not self.channel: + * return # <<<<<<<<<<<<<< + * cdef int read_fd = watcher.fd + * cdef int write_fd = read_fd + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + + /* "gevent/resolver/cares.pyx":400 + * + * def _process_fd(self, int events, object watcher): + * if not self.channel: # <<<<<<<<<<<<<< + * return + * cdef int read_fd = watcher.fd + */ + } + + /* "gevent/resolver/cares.pyx":402 + * if not self.channel: + * return + * cdef int read_fd = watcher.fd # <<<<<<<<<<<<<< + * cdef int write_fd = read_fd + * if not (events & EV_READ): + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_watcher, __pyx_n_s_fd); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 402, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 402, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_read_fd = __pyx_t_3; + + /* "gevent/resolver/cares.pyx":403 + * return + * cdef int read_fd = watcher.fd + * cdef int write_fd = read_fd # <<<<<<<<<<<<<< + * if not (events & EV_READ): + * read_fd = cares.ARES_SOCKET_BAD + */ + __pyx_v_write_fd = __pyx_v_read_fd; + + /* "gevent/resolver/cares.pyx":404 + * cdef int read_fd = watcher.fd + * cdef int write_fd = read_fd + * if not (events & EV_READ): # <<<<<<<<<<<<<< + * read_fd = cares.ARES_SOCKET_BAD + * if not (events & EV_WRITE): + */ + __pyx_t_1 = ((!((__pyx_v_events & 1) != 0)) != 0); + if (__pyx_t_1) { + + /* "gevent/resolver/cares.pyx":405 + * cdef int write_fd = read_fd + * if not (events & EV_READ): + * read_fd = cares.ARES_SOCKET_BAD # <<<<<<<<<<<<<< + * if not (events & EV_WRITE): + * write_fd = cares.ARES_SOCKET_BAD + */ + __pyx_v_read_fd = ARES_SOCKET_BAD; + + /* "gevent/resolver/cares.pyx":404 + * cdef int read_fd = watcher.fd + * cdef int write_fd = read_fd + * if not (events & EV_READ): # <<<<<<<<<<<<<< + * read_fd = cares.ARES_SOCKET_BAD + * if not (events & EV_WRITE): + */ + } + + /* "gevent/resolver/cares.pyx":406 + * if not (events & EV_READ): + * read_fd = cares.ARES_SOCKET_BAD + * if not (events & EV_WRITE): # <<<<<<<<<<<<<< + * write_fd = cares.ARES_SOCKET_BAD + * cares.ares_process_fd(self.channel, read_fd, write_fd) + */ + __pyx_t_1 = ((!((__pyx_v_events & 2) != 0)) != 0); + if (__pyx_t_1) { + + /* "gevent/resolver/cares.pyx":407 + * read_fd = cares.ARES_SOCKET_BAD + * if not (events & EV_WRITE): + * write_fd = cares.ARES_SOCKET_BAD # <<<<<<<<<<<<<< + * cares.ares_process_fd(self.channel, read_fd, write_fd) + * + */ + __pyx_v_write_fd = ARES_SOCKET_BAD; + + /* "gevent/resolver/cares.pyx":406 + * if not (events & EV_READ): + * read_fd = cares.ARES_SOCKET_BAD + * if not (events & EV_WRITE): # <<<<<<<<<<<<<< + * write_fd = cares.ARES_SOCKET_BAD + * cares.ares_process_fd(self.channel, read_fd, write_fd) + */ + } + + /* "gevent/resolver/cares.pyx":408 + * if not (events & EV_WRITE): + * write_fd = cares.ARES_SOCKET_BAD + * cares.ares_process_fd(self.channel, read_fd, write_fd) # <<<<<<<<<<<<<< + * + * def gethostbyname(self, object callback, char* name, int family=AF_INET): + */ + ares_process_fd(__pyx_v_self->channel, __pyx_v_read_fd, __pyx_v_write_fd); + + /* "gevent/resolver/cares.pyx":399 + * cares.ares_process_fd(self.channel, cares.ARES_SOCKET_BAD, cares.ARES_SOCKET_BAD) + * + * def _process_fd(self, int events, object watcher): # <<<<<<<<<<<<<< + * if not self.channel: + * return + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent.resolver.cares.channel._process_fd", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/resolver/cares.pyx":410 + * cares.ares_process_fd(self.channel, read_fd, write_fd) + * + * def gethostbyname(self, object callback, char* name, int family=AF_INET): # <<<<<<<<<<<<<< + * if not self.channel: + * raise gaierror(cares.ARES_EDESTRUCTION, 'this ares channel has been destroyed') + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_15gethostbyname(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_15gethostbyname(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_callback = 0; + char *__pyx_v_name; + int __pyx_v_family; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("gethostbyname (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_callback,&__pyx_n_s_name_2,&__pyx_n_s_family,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_callback)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name_2)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("gethostbyname", 0, 2, 3, 1); __PYX_ERR(0, 410, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_family); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "gethostbyname") < 0)) __PYX_ERR(0, 410, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_callback = values[0]; + __pyx_v_name = __Pyx_PyObject_AsWritableString(values[1]); if (unlikely((!__pyx_v_name) && PyErr_Occurred())) __PYX_ERR(0, 410, __pyx_L3_error) + if (values[2]) { + __pyx_v_family = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_family == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 410, __pyx_L3_error) + } else { + __pyx_v_family = __pyx_k__3; + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("gethostbyname", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 410, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.resolver.cares.channel.gethostbyname", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_8resolver_5cares_7channel_14gethostbyname(((struct __pyx_obj_6gevent_8resolver_5cares_channel *)__pyx_v_self), __pyx_v_callback, __pyx_v_name, __pyx_v_family); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_8resolver_5cares_7channel_14gethostbyname(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self, PyObject *__pyx_v_callback, char *__pyx_v_name, int __pyx_v_family) { + PyObject *__pyx_v_arg = 0; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + __Pyx_RefNannySetupContext("gethostbyname", 0); + + /* "gevent/resolver/cares.pyx":411 + * + * def gethostbyname(self, object callback, char* name, int family=AF_INET): + * if not self.channel: # <<<<<<<<<<<<<< + * raise gaierror(cares.ARES_EDESTRUCTION, 'this ares channel has been destroyed') + * # note that for file lookups still AF_INET can be returned for AF_INET6 request + */ + __pyx_t_1 = ((!(__pyx_v_self->channel != 0)) != 0); + if (unlikely(__pyx_t_1)) { + + /* "gevent/resolver/cares.pyx":412 + * def gethostbyname(self, object callback, char* name, int family=AF_INET): + * if not self.channel: + * raise gaierror(cares.ARES_EDESTRUCTION, 'this ares channel has been destroyed') # <<<<<<<<<<<<<< + * # note that for file lookups still AF_INET can be returned for AF_INET6 request + * cdef object arg = (self, callback) + */ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_gaierror); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 412, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyInt_From_int(ARES_EDESTRUCTION); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 412, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = NULL; + __pyx_t_6 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_6 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_3)) { + PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_4, __pyx_kp_s_this_ares_channel_has_been_destr}; + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 412, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { + PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_4, __pyx_kp_s_this_ares_channel_has_been_destr}; + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 412, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } else + #endif + { + __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 412, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + if (__pyx_t_5) { + __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL; + } + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_t_4); + __Pyx_INCREF(__pyx_kp_s_this_ares_channel_has_been_destr); + __Pyx_GIVEREF(__pyx_kp_s_this_ares_channel_has_been_destr); + PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_kp_s_this_ares_channel_has_been_destr); + __pyx_t_4 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 412, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 412, __pyx_L1_error) + + /* "gevent/resolver/cares.pyx":411 + * + * def gethostbyname(self, object callback, char* name, int family=AF_INET): + * if not self.channel: # <<<<<<<<<<<<<< + * raise gaierror(cares.ARES_EDESTRUCTION, 'this ares channel has been destroyed') + * # note that for file lookups still AF_INET can be returned for AF_INET6 request + */ + } + + /* "gevent/resolver/cares.pyx":414 + * raise gaierror(cares.ARES_EDESTRUCTION, 'this ares channel has been destroyed') + * # note that for file lookups still AF_INET can be returned for AF_INET6 request + * cdef object arg = (self, callback) # <<<<<<<<<<<<<< + * Py_INCREF(arg) + * cares.ares_gethostbyname(self.channel, name, family, gevent_ares_host_callback, arg) + */ + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 414, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self)); + __Pyx_INCREF(__pyx_v_callback); + __Pyx_GIVEREF(__pyx_v_callback); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_callback); + __pyx_v_arg = __pyx_t_2; + __pyx_t_2 = 0; + + /* "gevent/resolver/cares.pyx":415 + * # note that for file lookups still AF_INET can be returned for AF_INET6 request + * cdef object arg = (self, callback) + * Py_INCREF(arg) # <<<<<<<<<<<<<< + * cares.ares_gethostbyname(self.channel, name, family, gevent_ares_host_callback, arg) + * + */ + Py_INCREF(__pyx_v_arg); + + /* "gevent/resolver/cares.pyx":416 + * cdef object arg = (self, callback) + * Py_INCREF(arg) + * cares.ares_gethostbyname(self.channel, name, family, gevent_ares_host_callback, arg) # <<<<<<<<<<<<<< + * + * def gethostbyaddr(self, object callback, char* addr): + */ + ares_gethostbyname(__pyx_v_self->channel, __pyx_v_name, __pyx_v_family, ((void *)__pyx_f_6gevent_8resolver_5cares_gevent_ares_host_callback), ((void *)__pyx_v_arg)); + + /* "gevent/resolver/cares.pyx":410 + * cares.ares_process_fd(self.channel, read_fd, write_fd) + * + * def gethostbyname(self, object callback, char* name, int family=AF_INET): # <<<<<<<<<<<<<< + * if not self.channel: + * raise gaierror(cares.ARES_EDESTRUCTION, 'this ares channel has been destroyed') + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("gevent.resolver.cares.channel.gethostbyname", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_arg); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/resolver/cares.pyx":418 + * cares.ares_gethostbyname(self.channel, name, family, gevent_ares_host_callback, arg) + * + * def gethostbyaddr(self, object callback, char* addr): # <<<<<<<<<<<<<< + * if not self.channel: + * raise gaierror(cares.ARES_EDESTRUCTION, 'this ares channel has been destroyed') + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_17gethostbyaddr(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_17gethostbyaddr(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_callback = 0; + char *__pyx_v_addr; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("gethostbyaddr (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_callback,&__pyx_n_s_addr,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_callback)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_addr)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("gethostbyaddr", 1, 2, 2, 1); __PYX_ERR(0, 418, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "gethostbyaddr") < 0)) __PYX_ERR(0, 418, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_callback = values[0]; + __pyx_v_addr = __Pyx_PyObject_AsWritableString(values[1]); if (unlikely((!__pyx_v_addr) && PyErr_Occurred())) __PYX_ERR(0, 418, __pyx_L3_error) + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("gethostbyaddr", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 418, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.resolver.cares.channel.gethostbyaddr", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_8resolver_5cares_7channel_16gethostbyaddr(((struct __pyx_obj_6gevent_8resolver_5cares_channel *)__pyx_v_self), __pyx_v_callback, __pyx_v_addr); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_8resolver_5cares_7channel_16gethostbyaddr(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self, PyObject *__pyx_v_callback, char *__pyx_v_addr) { + char __pyx_v_addr_packed[16]; + int __pyx_v_family; + int __pyx_v_length; + PyObject *__pyx_v_arg = 0; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + __Pyx_RefNannySetupContext("gethostbyaddr", 0); + + /* "gevent/resolver/cares.pyx":419 + * + * def gethostbyaddr(self, object callback, char* addr): + * if not self.channel: # <<<<<<<<<<<<<< + * raise gaierror(cares.ARES_EDESTRUCTION, 'this ares channel has been destroyed') + * # will guess the family + */ + __pyx_t_1 = ((!(__pyx_v_self->channel != 0)) != 0); + if (unlikely(__pyx_t_1)) { + + /* "gevent/resolver/cares.pyx":420 + * def gethostbyaddr(self, object callback, char* addr): + * if not self.channel: + * raise gaierror(cares.ARES_EDESTRUCTION, 'this ares channel has been destroyed') # <<<<<<<<<<<<<< + * # will guess the family + * cdef char addr_packed[16] + */ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_gaierror); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 420, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyInt_From_int(ARES_EDESTRUCTION); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 420, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = NULL; + __pyx_t_6 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_6 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_3)) { + PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_4, __pyx_kp_s_this_ares_channel_has_been_destr}; + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 420, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { + PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_4, __pyx_kp_s_this_ares_channel_has_been_destr}; + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 420, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } else + #endif + { + __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 420, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + if (__pyx_t_5) { + __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL; + } + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_t_4); + __Pyx_INCREF(__pyx_kp_s_this_ares_channel_has_been_destr); + __Pyx_GIVEREF(__pyx_kp_s_this_ares_channel_has_been_destr); + PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_kp_s_this_ares_channel_has_been_destr); + __pyx_t_4 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 420, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 420, __pyx_L1_error) + + /* "gevent/resolver/cares.pyx":419 + * + * def gethostbyaddr(self, object callback, char* addr): + * if not self.channel: # <<<<<<<<<<<<<< + * raise gaierror(cares.ARES_EDESTRUCTION, 'this ares channel has been destroyed') + * # will guess the family + */ + } + + /* "gevent/resolver/cares.pyx":425 + * cdef int family + * cdef int length + * if cares.ares_inet_pton(AF_INET, addr, addr_packed) > 0: # <<<<<<<<<<<<<< + * family = AF_INET + * length = 4 + */ + __pyx_t_1 = ((ares_inet_pton(AF_INET, __pyx_v_addr, __pyx_v_addr_packed) > 0) != 0); + if (__pyx_t_1) { + + /* "gevent/resolver/cares.pyx":426 + * cdef int length + * if cares.ares_inet_pton(AF_INET, addr, addr_packed) > 0: + * family = AF_INET # <<<<<<<<<<<<<< + * length = 4 + * elif cares.ares_inet_pton(AF_INET6, addr, addr_packed) > 0: + */ + __pyx_v_family = AF_INET; + + /* "gevent/resolver/cares.pyx":427 + * if cares.ares_inet_pton(AF_INET, addr, addr_packed) > 0: + * family = AF_INET + * length = 4 # <<<<<<<<<<<<<< + * elif cares.ares_inet_pton(AF_INET6, addr, addr_packed) > 0: + * family = AF_INET6 + */ + __pyx_v_length = 4; + + /* "gevent/resolver/cares.pyx":425 + * cdef int family + * cdef int length + * if cares.ares_inet_pton(AF_INET, addr, addr_packed) > 0: # <<<<<<<<<<<<<< + * family = AF_INET + * length = 4 + */ + goto __pyx_L4; + } + + /* "gevent/resolver/cares.pyx":428 + * family = AF_INET + * length = 4 + * elif cares.ares_inet_pton(AF_INET6, addr, addr_packed) > 0: # <<<<<<<<<<<<<< + * family = AF_INET6 + * length = 16 + */ + __pyx_t_1 = ((ares_inet_pton(AF_INET6, __pyx_v_addr, __pyx_v_addr_packed) > 0) != 0); + if (likely(__pyx_t_1)) { + + /* "gevent/resolver/cares.pyx":429 + * length = 4 + * elif cares.ares_inet_pton(AF_INET6, addr, addr_packed) > 0: + * family = AF_INET6 # <<<<<<<<<<<<<< + * length = 16 + * else: + */ + __pyx_v_family = AF_INET6; + + /* "gevent/resolver/cares.pyx":430 + * elif cares.ares_inet_pton(AF_INET6, addr, addr_packed) > 0: + * family = AF_INET6 + * length = 16 # <<<<<<<<<<<<<< + * else: + * raise InvalidIP(repr(addr)) + */ + __pyx_v_length = 16; + + /* "gevent/resolver/cares.pyx":428 + * family = AF_INET + * length = 4 + * elif cares.ares_inet_pton(AF_INET6, addr, addr_packed) > 0: # <<<<<<<<<<<<<< + * family = AF_INET6 + * length = 16 + */ + goto __pyx_L4; + } + + /* "gevent/resolver/cares.pyx":432 + * length = 16 + * else: + * raise InvalidIP(repr(addr)) # <<<<<<<<<<<<<< + * cdef object arg = (self, callback) + * Py_INCREF(arg) + */ + /*else*/ { + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_InvalidIP); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 432, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_7 = __Pyx_PyBytes_FromString(__pyx_v_addr); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 432, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_4 = PyObject_Repr(__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 432, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_7)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_7); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_7, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 432, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 432, __pyx_L1_error) + } + __pyx_L4:; + + /* "gevent/resolver/cares.pyx":433 + * else: + * raise InvalidIP(repr(addr)) + * cdef object arg = (self, callback) # <<<<<<<<<<<<<< + * Py_INCREF(arg) + * cares.ares_gethostbyaddr(self.channel, addr_packed, length, family, gevent_ares_host_callback, arg) + */ + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 433, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self)); + __Pyx_INCREF(__pyx_v_callback); + __Pyx_GIVEREF(__pyx_v_callback); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_callback); + __pyx_v_arg = __pyx_t_2; + __pyx_t_2 = 0; + + /* "gevent/resolver/cares.pyx":434 + * raise InvalidIP(repr(addr)) + * cdef object arg = (self, callback) + * Py_INCREF(arg) # <<<<<<<<<<<<<< + * cares.ares_gethostbyaddr(self.channel, addr_packed, length, family, gevent_ares_host_callback, arg) + * + */ + Py_INCREF(__pyx_v_arg); + + /* "gevent/resolver/cares.pyx":435 + * cdef object arg = (self, callback) + * Py_INCREF(arg) + * cares.ares_gethostbyaddr(self.channel, addr_packed, length, family, gevent_ares_host_callback, arg) # <<<<<<<<<<<<<< + * + * cpdef _getnameinfo(self, object callback, tuple sockaddr, int flags): + */ + ares_gethostbyaddr(__pyx_v_self->channel, __pyx_v_addr_packed, __pyx_v_length, __pyx_v_family, ((void *)__pyx_f_6gevent_8resolver_5cares_gevent_ares_host_callback), ((void *)__pyx_v_arg)); + + /* "gevent/resolver/cares.pyx":418 + * cares.ares_gethostbyname(self.channel, name, family, gevent_ares_host_callback, arg) + * + * def gethostbyaddr(self, object callback, char* addr): # <<<<<<<<<<<<<< + * if not self.channel: + * raise gaierror(cares.ARES_EDESTRUCTION, 'this ares channel has been destroyed') + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("gevent.resolver.cares.channel.gethostbyaddr", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_arg); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/resolver/cares.pyx":437 + * cares.ares_gethostbyaddr(self.channel, addr_packed, length, family, gevent_ares_host_callback, arg) + * + * cpdef _getnameinfo(self, object callback, tuple sockaddr, int flags): # <<<<<<<<<<<<<< + * if not self.channel: + * raise gaierror(cares.ARES_EDESTRUCTION, 'this ares channel has been destroyed') + */ + +static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_19_getnameinfo(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_6gevent_8resolver_5cares_7channel__getnameinfo(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self, PyObject *__pyx_v_callback, PyObject *__pyx_v_sockaddr, int __pyx_v_flags, int __pyx_skip_dispatch) { + char *__pyx_v_hostp; + int __pyx_v_port; + int __pyx_v_flowinfo; + int __pyx_v_scope_id; + struct sockaddr_in6 __pyx_v_sa6; + int __pyx_v_length; + PyObject *__pyx_v_arg = 0; + struct sockaddr *__pyx_v_x; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + int __pyx_t_8; + int __pyx_t_9; + __Pyx_RefNannySetupContext("_getnameinfo", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0; + if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self)))))); + else { + PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + #endif + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getnameinfo); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 437, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_8resolver_5cares_7channel_19_getnameinfo)) { + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 437, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_t_1); + __pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL; + __pyx_t_6 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + __pyx_t_6 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_4)) { + PyObject *__pyx_temp[4] = {__pyx_t_5, __pyx_v_callback, __pyx_v_sockaddr, __pyx_t_3}; + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 437, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { + PyObject *__pyx_temp[4] = {__pyx_t_5, __pyx_v_callback, __pyx_v_sockaddr, __pyx_t_3}; + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 437, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } else + #endif + { + __pyx_t_7 = PyTuple_New(3+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 437, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + if (__pyx_t_5) { + __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL; + } + __Pyx_INCREF(__pyx_v_callback); + __Pyx_GIVEREF(__pyx_v_callback); + PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_v_callback); + __Pyx_INCREF(__pyx_v_sockaddr); + __Pyx_GIVEREF(__pyx_v_sockaddr); + PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_sockaddr); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_6, __pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 437, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0; + if (unlikely(type_dict_guard != tp_dict_version)) { + tp_dict_version = obj_dict_version = 0; + } + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + } + #endif + } + + /* "gevent/resolver/cares.pyx":438 + * + * cpdef _getnameinfo(self, object callback, tuple sockaddr, int flags): + * if not self.channel: # <<<<<<<<<<<<<< + * raise gaierror(cares.ARES_EDESTRUCTION, 'this ares channel has been destroyed') + * cdef char* hostp = NULL + */ + __pyx_t_8 = ((!(__pyx_v_self->channel != 0)) != 0); + if (unlikely(__pyx_t_8)) { + + /* "gevent/resolver/cares.pyx":439 + * cpdef _getnameinfo(self, object callback, tuple sockaddr, int flags): + * if not self.channel: + * raise gaierror(cares.ARES_EDESTRUCTION, 'this ares channel has been destroyed') # <<<<<<<<<<<<<< + * cdef char* hostp = NULL + * cdef int port = 0 + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_gaierror); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 439, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyInt_From_int(ARES_EDESTRUCTION); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 439, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_7 = NULL; + __pyx_t_6 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_7)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_7); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_6 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_4, __pyx_kp_s_this_ares_channel_has_been_destr}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 439, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_4, __pyx_kp_s_this_ares_channel_has_been_destr}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 439, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } else + #endif + { + __pyx_t_3 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 439, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (__pyx_t_7) { + __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_7); __pyx_t_7 = NULL; + } + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_6, __pyx_t_4); + __Pyx_INCREF(__pyx_kp_s_this_ares_channel_has_been_destr); + __Pyx_GIVEREF(__pyx_kp_s_this_ares_channel_has_been_destr); + PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_6, __pyx_kp_s_this_ares_channel_has_been_destr); + __pyx_t_4 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 439, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 439, __pyx_L1_error) + + /* "gevent/resolver/cares.pyx":438 + * + * cpdef _getnameinfo(self, object callback, tuple sockaddr, int flags): + * if not self.channel: # <<<<<<<<<<<<<< + * raise gaierror(cares.ARES_EDESTRUCTION, 'this ares channel has been destroyed') + * cdef char* hostp = NULL + */ + } + + /* "gevent/resolver/cares.pyx":440 + * if not self.channel: + * raise gaierror(cares.ARES_EDESTRUCTION, 'this ares channel has been destroyed') + * cdef char* hostp = NULL # <<<<<<<<<<<<<< + * cdef int port = 0 + * cdef int flowinfo = 0 + */ + __pyx_v_hostp = NULL; + + /* "gevent/resolver/cares.pyx":441 + * raise gaierror(cares.ARES_EDESTRUCTION, 'this ares channel has been destroyed') + * cdef char* hostp = NULL + * cdef int port = 0 # <<<<<<<<<<<<<< + * cdef int flowinfo = 0 + * cdef int scope_id = 0 + */ + __pyx_v_port = 0; + + /* "gevent/resolver/cares.pyx":442 + * cdef char* hostp = NULL + * cdef int port = 0 + * cdef int flowinfo = 0 # <<<<<<<<<<<<<< + * cdef int scope_id = 0 + * cdef sockaddr_in6 sa6 + */ + __pyx_v_flowinfo = 0; + + /* "gevent/resolver/cares.pyx":443 + * cdef int port = 0 + * cdef int flowinfo = 0 + * cdef int scope_id = 0 # <<<<<<<<<<<<<< + * cdef sockaddr_in6 sa6 + * if not PyTuple_Check(sockaddr): + */ + __pyx_v_scope_id = 0; + + /* "gevent/resolver/cares.pyx":445 + * cdef int scope_id = 0 + * cdef sockaddr_in6 sa6 + * if not PyTuple_Check(sockaddr): # <<<<<<<<<<<<<< + * raise TypeError('expected a tuple, got %r' % (sockaddr, )) + * PyArg_ParseTuple(sockaddr, "si|ii", &hostp, &port, &flowinfo, &scope_id) + */ + __pyx_t_8 = ((!(PyTuple_Check(__pyx_v_sockaddr) != 0)) != 0); + if (unlikely(__pyx_t_8)) { + + /* "gevent/resolver/cares.pyx":446 + * cdef sockaddr_in6 sa6 + * if not PyTuple_Check(sockaddr): + * raise TypeError('expected a tuple, got %r' % (sockaddr, )) # <<<<<<<<<<<<<< + * PyArg_ParseTuple(sockaddr, "si|ii", &hostp, &port, &flowinfo, &scope_id) + * if port < 0 or port > 65535: + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 446, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_sockaddr); + __Pyx_GIVEREF(__pyx_v_sockaddr); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_sockaddr); + __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_expected_a_tuple_got_r, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 446, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 446, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 446, __pyx_L1_error) + + /* "gevent/resolver/cares.pyx":445 + * cdef int scope_id = 0 + * cdef sockaddr_in6 sa6 + * if not PyTuple_Check(sockaddr): # <<<<<<<<<<<<<< + * raise TypeError('expected a tuple, got %r' % (sockaddr, )) + * PyArg_ParseTuple(sockaddr, "si|ii", &hostp, &port, &flowinfo, &scope_id) + */ + } + + /* "gevent/resolver/cares.pyx":447 + * if not PyTuple_Check(sockaddr): + * raise TypeError('expected a tuple, got %r' % (sockaddr, )) + * PyArg_ParseTuple(sockaddr, "si|ii", &hostp, &port, &flowinfo, &scope_id) # <<<<<<<<<<<<<< + * if port < 0 or port > 65535: + * raise gaierror(-8, 'Invalid value for port: %r' % port) + */ + __pyx_t_6 = PyArg_ParseTuple(__pyx_v_sockaddr, ((char *)"si|ii"), (&__pyx_v_hostp), (&__pyx_v_port), (&__pyx_v_flowinfo), (&__pyx_v_scope_id)); if (unlikely(__pyx_t_6 == ((int)0))) __PYX_ERR(0, 447, __pyx_L1_error) + + /* "gevent/resolver/cares.pyx":448 + * raise TypeError('expected a tuple, got %r' % (sockaddr, )) + * PyArg_ParseTuple(sockaddr, "si|ii", &hostp, &port, &flowinfo, &scope_id) + * if port < 0 or port > 65535: # <<<<<<<<<<<<<< + * raise gaierror(-8, 'Invalid value for port: %r' % port) + * cdef int length = gevent_make_sockaddr(hostp, port, flowinfo, scope_id, &sa6) + */ + __pyx_t_9 = ((__pyx_v_port < 0) != 0); + if (!__pyx_t_9) { + } else { + __pyx_t_8 = __pyx_t_9; + goto __pyx_L6_bool_binop_done; + } + __pyx_t_9 = ((__pyx_v_port > 0xFFFF) != 0); + __pyx_t_8 = __pyx_t_9; + __pyx_L6_bool_binop_done:; + if (unlikely(__pyx_t_8)) { + + /* "gevent/resolver/cares.pyx":449 + * PyArg_ParseTuple(sockaddr, "si|ii", &hostp, &port, &flowinfo, &scope_id) + * if port < 0 or port > 65535: + * raise gaierror(-8, 'Invalid value for port: %r' % port) # <<<<<<<<<<<<<< + * cdef int length = gevent_make_sockaddr(hostp, port, flowinfo, scope_id, &sa6) + * if length <= 0: + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_gaierror); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 449, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_port); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 449, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_value_for_port_r, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 449, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = NULL; + __pyx_t_6 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_6 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_int_neg_8, __pyx_t_4}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 449, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_int_neg_8, __pyx_t_4}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 449, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } else + #endif + { + __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 449, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + if (__pyx_t_3) { + __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3); __pyx_t_3 = NULL; + } + __Pyx_INCREF(__pyx_int_neg_8); + __Pyx_GIVEREF(__pyx_int_neg_8); + PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_int_neg_8); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 449, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 449, __pyx_L1_error) + + /* "gevent/resolver/cares.pyx":448 + * raise TypeError('expected a tuple, got %r' % (sockaddr, )) + * PyArg_ParseTuple(sockaddr, "si|ii", &hostp, &port, &flowinfo, &scope_id) + * if port < 0 or port > 65535: # <<<<<<<<<<<<<< + * raise gaierror(-8, 'Invalid value for port: %r' % port) + * cdef int length = gevent_make_sockaddr(hostp, port, flowinfo, scope_id, &sa6) + */ + } + + /* "gevent/resolver/cares.pyx":450 + * if port < 0 or port > 65535: + * raise gaierror(-8, 'Invalid value for port: %r' % port) + * cdef int length = gevent_make_sockaddr(hostp, port, flowinfo, scope_id, &sa6) # <<<<<<<<<<<<<< + * if length <= 0: + * raise InvalidIP(repr(hostp)) + */ + __pyx_v_length = gevent_make_sockaddr(__pyx_v_hostp, __pyx_v_port, __pyx_v_flowinfo, __pyx_v_scope_id, (&__pyx_v_sa6)); + + /* "gevent/resolver/cares.pyx":451 + * raise gaierror(-8, 'Invalid value for port: %r' % port) + * cdef int length = gevent_make_sockaddr(hostp, port, flowinfo, scope_id, &sa6) + * if length <= 0: # <<<<<<<<<<<<<< + * raise InvalidIP(repr(hostp)) + * cdef object arg = (self, callback) + */ + __pyx_t_8 = ((__pyx_v_length <= 0) != 0); + if (unlikely(__pyx_t_8)) { + + /* "gevent/resolver/cares.pyx":452 + * cdef int length = gevent_make_sockaddr(hostp, port, flowinfo, scope_id, &sa6) + * if length <= 0: + * raise InvalidIP(repr(hostp)) # <<<<<<<<<<<<<< + * cdef object arg = (self, callback) + * Py_INCREF(arg) + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_InvalidIP); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 452, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_7 = __Pyx_PyBytes_FromString(__pyx_v_hostp); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 452, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_4 = PyObject_Repr(__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 452, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_7)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_7); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_7, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 452, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 452, __pyx_L1_error) + + /* "gevent/resolver/cares.pyx":451 + * raise gaierror(-8, 'Invalid value for port: %r' % port) + * cdef int length = gevent_make_sockaddr(hostp, port, flowinfo, scope_id, &sa6) + * if length <= 0: # <<<<<<<<<<<<<< + * raise InvalidIP(repr(hostp)) + * cdef object arg = (self, callback) + */ + } + + /* "gevent/resolver/cares.pyx":453 + * if length <= 0: + * raise InvalidIP(repr(hostp)) + * cdef object arg = (self, callback) # <<<<<<<<<<<<<< + * Py_INCREF(arg) + * cdef sockaddr_t* x = &sa6 + */ + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 453, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self)); + __Pyx_INCREF(__pyx_v_callback); + __Pyx_GIVEREF(__pyx_v_callback); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_callback); + __pyx_v_arg = __pyx_t_1; + __pyx_t_1 = 0; + + /* "gevent/resolver/cares.pyx":454 + * raise InvalidIP(repr(hostp)) + * cdef object arg = (self, callback) + * Py_INCREF(arg) # <<<<<<<<<<<<<< + * cdef sockaddr_t* x = &sa6 + * cares.ares_getnameinfo(self.channel, x, length, flags, gevent_ares_nameinfo_callback, arg) + */ + Py_INCREF(__pyx_v_arg); + + /* "gevent/resolver/cares.pyx":455 + * cdef object arg = (self, callback) + * Py_INCREF(arg) + * cdef sockaddr_t* x = &sa6 # <<<<<<<<<<<<<< + * cares.ares_getnameinfo(self.channel, x, length, flags, gevent_ares_nameinfo_callback, arg) + * + */ + __pyx_v_x = ((struct sockaddr *)(&__pyx_v_sa6)); + + /* "gevent/resolver/cares.pyx":456 + * Py_INCREF(arg) + * cdef sockaddr_t* x = &sa6 + * cares.ares_getnameinfo(self.channel, x, length, flags, gevent_ares_nameinfo_callback, arg) # <<<<<<<<<<<<<< + * + * def getnameinfo(self, object callback, tuple sockaddr, int flags): + */ + ares_getnameinfo(__pyx_v_self->channel, __pyx_v_x, __pyx_v_length, __pyx_v_flags, ((void *)__pyx_f_6gevent_8resolver_5cares_gevent_ares_nameinfo_callback), ((void *)__pyx_v_arg)); + + /* "gevent/resolver/cares.pyx":437 + * cares.ares_gethostbyaddr(self.channel, addr_packed, length, family, gevent_ares_host_callback, arg) + * + * cpdef _getnameinfo(self, object callback, tuple sockaddr, int flags): # <<<<<<<<<<<<<< + * if not self.channel: + * raise gaierror(cares.ARES_EDESTRUCTION, 'this ares channel has been destroyed') + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("gevent.resolver.cares.channel._getnameinfo", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_arg); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_19_getnameinfo(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_19_getnameinfo(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_callback = 0; + PyObject *__pyx_v_sockaddr = 0; + int __pyx_v_flags; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_getnameinfo (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_callback,&__pyx_n_s_sockaddr,&__pyx_n_s_flags,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_callback)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_sockaddr)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("_getnameinfo", 1, 3, 3, 1); __PYX_ERR(0, 437, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flags)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("_getnameinfo", 1, 3, 3, 2); __PYX_ERR(0, 437, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_getnameinfo") < 0)) __PYX_ERR(0, 437, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + } + __pyx_v_callback = values[0]; + __pyx_v_sockaddr = ((PyObject*)values[1]); + __pyx_v_flags = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 437, __pyx_L3_error) + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("_getnameinfo", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 437, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.resolver.cares.channel._getnameinfo", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sockaddr), (&PyTuple_Type), 1, "sockaddr", 1))) __PYX_ERR(0, 437, __pyx_L1_error) + __pyx_r = __pyx_pf_6gevent_8resolver_5cares_7channel_18_getnameinfo(((struct __pyx_obj_6gevent_8resolver_5cares_channel *)__pyx_v_self), __pyx_v_callback, __pyx_v_sockaddr, __pyx_v_flags); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_8resolver_5cares_7channel_18_getnameinfo(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self, PyObject *__pyx_v_callback, PyObject *__pyx_v_sockaddr, int __pyx_v_flags) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("_getnameinfo", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6gevent_8resolver_5cares_7channel__getnameinfo(__pyx_v_self, __pyx_v_callback, __pyx_v_sockaddr, __pyx_v_flags, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 437, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.resolver.cares.channel._getnameinfo", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/resolver/cares.pyx":458 + * cares.ares_getnameinfo(self.channel, x, length, flags, gevent_ares_nameinfo_callback, arg) + * + * def getnameinfo(self, object callback, tuple sockaddr, int flags): # <<<<<<<<<<<<<< + * try: + * flags = _convert_cares_flags(flags) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_21getnameinfo(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_21getnameinfo(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_callback = 0; + PyObject *__pyx_v_sockaddr = 0; + int __pyx_v_flags; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("getnameinfo (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_callback,&__pyx_n_s_sockaddr,&__pyx_n_s_flags,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_callback)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_sockaddr)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("getnameinfo", 1, 3, 3, 1); __PYX_ERR(0, 458, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flags)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("getnameinfo", 1, 3, 3, 2); __PYX_ERR(0, 458, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getnameinfo") < 0)) __PYX_ERR(0, 458, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + } + __pyx_v_callback = values[0]; + __pyx_v_sockaddr = ((PyObject*)values[1]); + __pyx_v_flags = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 458, __pyx_L3_error) + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("getnameinfo", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 458, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.resolver.cares.channel.getnameinfo", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sockaddr), (&PyTuple_Type), 1, "sockaddr", 1))) __PYX_ERR(0, 458, __pyx_L1_error) + __pyx_r = __pyx_pf_6gevent_8resolver_5cares_7channel_20getnameinfo(((struct __pyx_obj_6gevent_8resolver_5cares_channel *)__pyx_v_self), __pyx_v_callback, __pyx_v_sockaddr, __pyx_v_flags); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_8resolver_5cares_7channel_20getnameinfo(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self, PyObject *__pyx_v_callback, PyObject *__pyx_v_sockaddr, int __pyx_v_flags) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + __Pyx_RefNannySetupContext("getnameinfo", 0); + + /* "gevent/resolver/cares.pyx":459 + * + * def getnameinfo(self, object callback, tuple sockaddr, int flags): + * try: # <<<<<<<<<<<<<< + * flags = _convert_cares_flags(flags) + * except gaierror: + */ + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "gevent/resolver/cares.pyx":460 + * def getnameinfo(self, object callback, tuple sockaddr, int flags): + * try: + * flags = _convert_cares_flags(flags) # <<<<<<<<<<<<<< + * except gaierror: + * # The stdlib just ignores bad flags + */ + __pyx_t_4 = __pyx_f_6gevent_8resolver_5cares__convert_cares_flags(__pyx_v_flags, 0, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 460, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 460, __pyx_L3_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_flags = __pyx_t_5; + + /* "gevent/resolver/cares.pyx":459 + * + * def getnameinfo(self, object callback, tuple sockaddr, int flags): + * try: # <<<<<<<<<<<<<< + * flags = _convert_cares_flags(flags) + * except gaierror: + */ + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L8_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "gevent/resolver/cares.pyx":461 + * try: + * flags = _convert_cares_flags(flags) + * except gaierror: # <<<<<<<<<<<<<< + * # The stdlib just ignores bad flags + * flags = 0 + */ + __Pyx_ErrFetch(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7); + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_gaierror); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 461, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_5 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_4, __pyx_t_8); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_ErrRestore(__pyx_t_4, __pyx_t_6, __pyx_t_7); + __pyx_t_4 = 0; __pyx_t_6 = 0; __pyx_t_7 = 0; + if (__pyx_t_5) { + __Pyx_AddTraceback("gevent.resolver.cares.channel.getnameinfo", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_6, &__pyx_t_4) < 0) __PYX_ERR(0, 461, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_4); + + /* "gevent/resolver/cares.pyx":463 + * except gaierror: + * # The stdlib just ignores bad flags + * flags = 0 # <<<<<<<<<<<<<< + * return self._getnameinfo(callback, sockaddr, flags) + */ + __pyx_v_flags = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + + /* "gevent/resolver/cares.pyx":459 + * + * def getnameinfo(self, object callback, tuple sockaddr, int flags): + * try: # <<<<<<<<<<<<<< + * flags = _convert_cares_flags(flags) + * except gaierror: + */ + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L8_try_end:; + } + + /* "gevent/resolver/cares.pyx":464 + * # The stdlib just ignores bad flags + * flags = 0 + * return self._getnameinfo(callback, sockaddr, flags) # <<<<<<<<<<<<<< + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = ((struct __pyx_vtabstruct_6gevent_8resolver_5cares_channel *)__pyx_v_self->__pyx_vtab)->_getnameinfo(__pyx_v_self, __pyx_v_callback, __pyx_v_sockaddr, __pyx_v_flags, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 464, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + + /* "gevent/resolver/cares.pyx":458 + * cares.ares_getnameinfo(self.channel, x, length, flags, gevent_ares_nameinfo_callback, arg) + * + * def getnameinfo(self, object callback, tuple sockaddr, int flags): # <<<<<<<<<<<<<< + * try: + * flags = _convert_cares_flags(flags) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("gevent.resolver.cares.channel.getnameinfo", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/resolver/cares.pyx":256 + * cdef class channel: + * + * cdef public object loop # <<<<<<<<<<<<<< + * cdef ares_channeldata* channel + * cdef public dict _watchers + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_4loop_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_4loop_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_8resolver_5cares_7channel_4loop___get__(((struct __pyx_obj_6gevent_8resolver_5cares_channel *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_8resolver_5cares_7channel_4loop___get__(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->loop); + __pyx_r = __pyx_v_self->loop; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6gevent_8resolver_5cares_7channel_4loop_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6gevent_8resolver_5cares_7channel_4loop_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_8resolver_5cares_7channel_4loop_2__set__(((struct __pyx_obj_6gevent_8resolver_5cares_channel *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_8resolver_5cares_7channel_4loop_2__set__(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__", 0); + __Pyx_INCREF(__pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + __Pyx_GOTREF(__pyx_v_self->loop); + __Pyx_DECREF(__pyx_v_self->loop); + __pyx_v_self->loop = __pyx_v_value; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6gevent_8resolver_5cares_7channel_4loop_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6gevent_8resolver_5cares_7channel_4loop_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_8resolver_5cares_7channel_4loop_4__del__(((struct __pyx_obj_6gevent_8resolver_5cares_channel *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_8resolver_5cares_7channel_4loop_4__del__(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->loop); + __Pyx_DECREF(__pyx_v_self->loop); + __pyx_v_self->loop = Py_None; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/resolver/cares.pyx":258 + * cdef public object loop + * cdef ares_channeldata* channel + * cdef public dict _watchers # <<<<<<<<<<<<<< + * cdef public object _timer + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_9_watchers_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_9_watchers_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_8resolver_5cares_7channel_9_watchers___get__(((struct __pyx_obj_6gevent_8resolver_5cares_channel *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_8resolver_5cares_7channel_9_watchers___get__(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->_watchers); + __pyx_r = __pyx_v_self->_watchers; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6gevent_8resolver_5cares_7channel_9_watchers_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6gevent_8resolver_5cares_7channel_9_watchers_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_8resolver_5cares_7channel_9_watchers_2__set__(((struct __pyx_obj_6gevent_8resolver_5cares_channel *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_8resolver_5cares_7channel_9_watchers_2__set__(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__set__", 0); + if (!(likely(PyDict_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_v_value)->tp_name), 0))) __PYX_ERR(0, 258, __pyx_L1_error) + __pyx_t_1 = __pyx_v_value; + __Pyx_INCREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_self->_watchers); + __Pyx_DECREF(__pyx_v_self->_watchers); + __pyx_v_self->_watchers = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.resolver.cares.channel._watchers.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6gevent_8resolver_5cares_7channel_9_watchers_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6gevent_8resolver_5cares_7channel_9_watchers_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_8resolver_5cares_7channel_9_watchers_4__del__(((struct __pyx_obj_6gevent_8resolver_5cares_channel *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_8resolver_5cares_7channel_9_watchers_4__del__(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->_watchers); + __Pyx_DECREF(__pyx_v_self->_watchers); + __pyx_v_self->_watchers = ((PyObject*)Py_None); + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/resolver/cares.pyx":259 + * cdef ares_channeldata* channel + * cdef public dict _watchers + * cdef public object _timer # <<<<<<<<<<<<<< + * + * def __init__(self, object loop, flags=None, timeout=None, tries=None, ndots=None, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_6_timer_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_6_timer_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_8resolver_5cares_7channel_6_timer___get__(((struct __pyx_obj_6gevent_8resolver_5cares_channel *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_8resolver_5cares_7channel_6_timer___get__(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->_timer); + __pyx_r = __pyx_v_self->_timer; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6gevent_8resolver_5cares_7channel_6_timer_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6gevent_8resolver_5cares_7channel_6_timer_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_8resolver_5cares_7channel_6_timer_2__set__(((struct __pyx_obj_6gevent_8resolver_5cares_channel *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_8resolver_5cares_7channel_6_timer_2__set__(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__", 0); + __Pyx_INCREF(__pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + __Pyx_GOTREF(__pyx_v_self->_timer); + __Pyx_DECREF(__pyx_v_self->_timer); + __pyx_v_self->_timer = __pyx_v_value; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6gevent_8resolver_5cares_7channel_6_timer_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6gevent_8resolver_5cares_7channel_6_timer_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_8resolver_5cares_7channel_6_timer_4__del__(((struct __pyx_obj_6gevent_8resolver_5cares_channel *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_8resolver_5cares_7channel_6_timer_4__del__(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->_timer); + __Pyx_DECREF(__pyx_v_self->_timer); + __pyx_v_self->_timer = Py_None; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_tp_new_6gevent_8resolver_5cares_result(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + struct __pyx_obj_6gevent_8resolver_5cares_result *p; + PyObject *o; + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_6gevent_8resolver_5cares_result *)o); + p->value = Py_None; Py_INCREF(Py_None); + p->exception = Py_None; Py_INCREF(Py_None); + return o; +} + +static void __pyx_tp_dealloc_6gevent_8resolver_5cares_result(PyObject *o) { + struct __pyx_obj_6gevent_8resolver_5cares_result *p = (struct __pyx_obj_6gevent_8resolver_5cares_result *)o; + #if CYTHON_USE_TP_FINALIZE + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + PyObject_GC_UnTrack(o); + Py_CLEAR(p->value); + Py_CLEAR(p->exception); + (*Py_TYPE(o)->tp_free)(o); +} + +static int __pyx_tp_traverse_6gevent_8resolver_5cares_result(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_6gevent_8resolver_5cares_result *p = (struct __pyx_obj_6gevent_8resolver_5cares_result *)o; + if (p->value) { + e = (*v)(p->value, a); if (e) return e; + } + if (p->exception) { + e = (*v)(p->exception, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_6gevent_8resolver_5cares_result(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_6gevent_8resolver_5cares_result *p = (struct __pyx_obj_6gevent_8resolver_5cares_result *)o; + tmp = ((PyObject*)p->value); + p->value = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->exception); + p->exception = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyObject *__pyx_getprop_6gevent_8resolver_5cares_6result_value(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_8resolver_5cares_6result_5value_1__get__(o); +} + +static int __pyx_setprop_6gevent_8resolver_5cares_6result_value(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6gevent_8resolver_5cares_6result_5value_3__set__(o, v); + } + else { + return __pyx_pw_6gevent_8resolver_5cares_6result_5value_5__del__(o); + } +} + +static PyObject *__pyx_getprop_6gevent_8resolver_5cares_6result_exception(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_8resolver_5cares_6result_9exception_1__get__(o); +} + +static int __pyx_setprop_6gevent_8resolver_5cares_6result_exception(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6gevent_8resolver_5cares_6result_9exception_3__set__(o, v); + } + else { + return __pyx_pw_6gevent_8resolver_5cares_6result_9exception_5__del__(o); + } +} + +static PyMethodDef __pyx_methods_6gevent_8resolver_5cares_result[] = { + {"successful", (PyCFunction)__pyx_pw_6gevent_8resolver_5cares_6result_5successful, METH_NOARGS, 0}, + {"get", (PyCFunction)__pyx_pw_6gevent_8resolver_5cares_6result_7get, METH_NOARGS, 0}, + {0, 0, 0, 0} +}; + +static struct PyGetSetDef __pyx_getsets_6gevent_8resolver_5cares_result[] = { + {(char *)"value", __pyx_getprop_6gevent_8resolver_5cares_6result_value, __pyx_setprop_6gevent_8resolver_5cares_6result_value, (char *)0, 0}, + {(char *)"exception", __pyx_getprop_6gevent_8resolver_5cares_6result_exception, __pyx_setprop_6gevent_8resolver_5cares_6result_exception, (char *)0, 0}, + {0, 0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_6gevent_8resolver_5cares_result = { + PyVarObject_HEAD_INIT(0, 0) + "gevent.resolver.cares.result", /*tp_name*/ + sizeof(struct __pyx_obj_6gevent_8resolver_5cares_result), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6gevent_8resolver_5cares_result, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + __pyx_pw_6gevent_8resolver_5cares_6result_3__repr__, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_6gevent_8resolver_5cares_result, /*tp_traverse*/ + __pyx_tp_clear_6gevent_8resolver_5cares_result, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6gevent_8resolver_5cares_result, /*tp_methods*/ + 0, /*tp_members*/ + __pyx_getsets_6gevent_8resolver_5cares_result, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_pw_6gevent_8resolver_5cares_6result_1__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6gevent_8resolver_5cares_result, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; +static struct __pyx_vtabstruct_6gevent_8resolver_5cares_channel __pyx_vtable_6gevent_8resolver_5cares_channel; + +static PyObject *__pyx_tp_new_6gevent_8resolver_5cares_channel(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + struct __pyx_obj_6gevent_8resolver_5cares_channel *p; + PyObject *o; + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_6gevent_8resolver_5cares_channel *)o); + p->__pyx_vtab = __pyx_vtabptr_6gevent_8resolver_5cares_channel; + p->loop = Py_None; Py_INCREF(Py_None); + p->_watchers = ((PyObject*)Py_None); Py_INCREF(Py_None); + p->_timer = Py_None; Py_INCREF(Py_None); + return o; +} + +static void __pyx_tp_dealloc_6gevent_8resolver_5cares_channel(PyObject *o) { + struct __pyx_obj_6gevent_8resolver_5cares_channel *p = (struct __pyx_obj_6gevent_8resolver_5cares_channel *)o; + #if CYTHON_USE_TP_FINALIZE + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + PyObject_GC_UnTrack(o); + { + PyObject *etype, *eval, *etb; + PyErr_Fetch(&etype, &eval, &etb); + ++Py_REFCNT(o); + __pyx_pw_6gevent_8resolver_5cares_7channel_7__dealloc__(o); + --Py_REFCNT(o); + PyErr_Restore(etype, eval, etb); + } + Py_CLEAR(p->loop); + Py_CLEAR(p->_watchers); + Py_CLEAR(p->_timer); + (*Py_TYPE(o)->tp_free)(o); +} + +static int __pyx_tp_traverse_6gevent_8resolver_5cares_channel(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_6gevent_8resolver_5cares_channel *p = (struct __pyx_obj_6gevent_8resolver_5cares_channel *)o; + if (p->loop) { + e = (*v)(p->loop, a); if (e) return e; + } + if (p->_watchers) { + e = (*v)(p->_watchers, a); if (e) return e; + } + if (p->_timer) { + e = (*v)(p->_timer, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_6gevent_8resolver_5cares_channel(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_6gevent_8resolver_5cares_channel *p = (struct __pyx_obj_6gevent_8resolver_5cares_channel *)o; + tmp = ((PyObject*)p->loop); + p->loop = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->_watchers); + p->_watchers = ((PyObject*)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->_timer); + p->_timer = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyObject *__pyx_getprop_6gevent_8resolver_5cares_7channel_loop(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_8resolver_5cares_7channel_4loop_1__get__(o); +} + +static int __pyx_setprop_6gevent_8resolver_5cares_7channel_loop(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6gevent_8resolver_5cares_7channel_4loop_3__set__(o, v); + } + else { + return __pyx_pw_6gevent_8resolver_5cares_7channel_4loop_5__del__(o); + } +} + +static PyObject *__pyx_getprop_6gevent_8resolver_5cares_7channel__watchers(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_8resolver_5cares_7channel_9_watchers_1__get__(o); +} + +static int __pyx_setprop_6gevent_8resolver_5cares_7channel__watchers(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6gevent_8resolver_5cares_7channel_9_watchers_3__set__(o, v); + } + else { + return __pyx_pw_6gevent_8resolver_5cares_7channel_9_watchers_5__del__(o); + } +} + +static PyObject *__pyx_getprop_6gevent_8resolver_5cares_7channel__timer(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_8resolver_5cares_7channel_6_timer_1__get__(o); +} + +static int __pyx_setprop_6gevent_8resolver_5cares_7channel__timer(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6gevent_8resolver_5cares_7channel_6_timer_3__set__(o, v); + } + else { + return __pyx_pw_6gevent_8resolver_5cares_7channel_6_timer_5__del__(o); + } +} + +static PyMethodDef __pyx_methods_6gevent_8resolver_5cares_channel[] = { + {"destroy", (PyCFunction)__pyx_pw_6gevent_8resolver_5cares_7channel_5destroy, METH_NOARGS, 0}, + {"set_servers", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_8resolver_5cares_7channel_9set_servers, METH_VARARGS|METH_KEYWORDS, 0}, + {"_on_timer", (PyCFunction)__pyx_pw_6gevent_8resolver_5cares_7channel_11_on_timer, METH_NOARGS, 0}, + {"_process_fd", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_8resolver_5cares_7channel_13_process_fd, METH_VARARGS|METH_KEYWORDS, 0}, + {"gethostbyname", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_8resolver_5cares_7channel_15gethostbyname, METH_VARARGS|METH_KEYWORDS, 0}, + {"gethostbyaddr", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_8resolver_5cares_7channel_17gethostbyaddr, METH_VARARGS|METH_KEYWORDS, 0}, + {"_getnameinfo", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_8resolver_5cares_7channel_19_getnameinfo, METH_VARARGS|METH_KEYWORDS, 0}, + {"getnameinfo", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_8resolver_5cares_7channel_21getnameinfo, METH_VARARGS|METH_KEYWORDS, 0}, + {0, 0, 0, 0} +}; + +static struct PyGetSetDef __pyx_getsets_6gevent_8resolver_5cares_channel[] = { + {(char *)"loop", __pyx_getprop_6gevent_8resolver_5cares_7channel_loop, __pyx_setprop_6gevent_8resolver_5cares_7channel_loop, (char *)0, 0}, + {(char *)"_watchers", __pyx_getprop_6gevent_8resolver_5cares_7channel__watchers, __pyx_setprop_6gevent_8resolver_5cares_7channel__watchers, (char *)0, 0}, + {(char *)"_timer", __pyx_getprop_6gevent_8resolver_5cares_7channel__timer, __pyx_setprop_6gevent_8resolver_5cares_7channel__timer, (char *)0, 0}, + {0, 0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_6gevent_8resolver_5cares_channel = { + PyVarObject_HEAD_INIT(0, 0) + "gevent.resolver.cares.channel", /*tp_name*/ + sizeof(struct __pyx_obj_6gevent_8resolver_5cares_channel), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6gevent_8resolver_5cares_channel, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + __pyx_pw_6gevent_8resolver_5cares_7channel_3__repr__, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_6gevent_8resolver_5cares_channel, /*tp_traverse*/ + __pyx_tp_clear_6gevent_8resolver_5cares_channel, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6gevent_8resolver_5cares_channel, /*tp_methods*/ + 0, /*tp_members*/ + __pyx_getsets_6gevent_8resolver_5cares_channel, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_pw_6gevent_8resolver_5cares_7channel_1__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6gevent_8resolver_5cares_channel, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static PyMethodDef __pyx_methods[] = { + {"_convert_cares_flags", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_8resolver_5cares_1_convert_cares_flags, METH_VARARGS|METH_KEYWORDS, 0}, + {"strerror", (PyCFunction)__pyx_pw_6gevent_8resolver_5cares_3strerror, METH_O, 0}, + {0, 0, 0, 0} +}; + +#if PY_MAJOR_VERSION >= 3 +#if CYTHON_PEP489_MULTI_PHASE_INIT +static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ +static int __pyx_pymod_exec_cares(PyObject* module); /*proto*/ +static PyModuleDef_Slot __pyx_moduledef_slots[] = { + {Py_mod_create, (void*)__pyx_pymod_create}, + {Py_mod_exec, (void*)__pyx_pymod_exec_cares}, + {0, NULL} +}; +#endif + +static struct PyModuleDef __pyx_moduledef = { + PyModuleDef_HEAD_INIT, + "cares", + 0, /* m_doc */ + #if CYTHON_PEP489_MULTI_PHASE_INIT + 0, /* m_size */ + #else + -1, /* m_size */ + #endif + __pyx_methods /* m_methods */, + #if CYTHON_PEP489_MULTI_PHASE_INIT + __pyx_moduledef_slots, /* m_slots */ + #else + NULL, /* m_reload */ + #endif + NULL, /* m_traverse */ + NULL, /* m_clear */ + NULL /* m_free */ +}; +#endif +#ifndef CYTHON_SMALL_CODE +#if defined(__clang__) + #define CYTHON_SMALL_CODE +#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) + #define CYTHON_SMALL_CODE __attribute__((cold)) +#else + #define CYTHON_SMALL_CODE +#endif +#endif + +static __Pyx_StringTabEntry __pyx_string_tab[] = { + {&__pyx_n_s_ARES_EADDRGETNETWORKPARAMS, __pyx_k_ARES_EADDRGETNETWORKPARAMS, sizeof(__pyx_k_ARES_EADDRGETNETWORKPARAMS), 0, 0, 1, 1}, + {&__pyx_n_s_ARES_EBADFAMILY, __pyx_k_ARES_EBADFAMILY, sizeof(__pyx_k_ARES_EBADFAMILY), 0, 0, 1, 1}, + {&__pyx_n_s_ARES_EBADFLAGS, __pyx_k_ARES_EBADFLAGS, sizeof(__pyx_k_ARES_EBADFLAGS), 0, 0, 1, 1}, + {&__pyx_n_s_ARES_EBADHINTS, __pyx_k_ARES_EBADHINTS, sizeof(__pyx_k_ARES_EBADHINTS), 0, 0, 1, 1}, + {&__pyx_n_s_ARES_EBADNAME, __pyx_k_ARES_EBADNAME, sizeof(__pyx_k_ARES_EBADNAME), 0, 0, 1, 1}, + {&__pyx_n_s_ARES_EBADQUERY, __pyx_k_ARES_EBADQUERY, sizeof(__pyx_k_ARES_EBADQUERY), 0, 0, 1, 1}, + {&__pyx_n_s_ARES_EBADRESP, __pyx_k_ARES_EBADRESP, sizeof(__pyx_k_ARES_EBADRESP), 0, 0, 1, 1}, + {&__pyx_n_s_ARES_EBADSTR, __pyx_k_ARES_EBADSTR, sizeof(__pyx_k_ARES_EBADSTR), 0, 0, 1, 1}, + {&__pyx_n_s_ARES_ECANCELLED, __pyx_k_ARES_ECANCELLED, sizeof(__pyx_k_ARES_ECANCELLED), 0, 0, 1, 1}, + {&__pyx_n_s_ARES_ECONNREFUSED, __pyx_k_ARES_ECONNREFUSED, sizeof(__pyx_k_ARES_ECONNREFUSED), 0, 0, 1, 1}, + {&__pyx_n_s_ARES_EDESTRUCTION, __pyx_k_ARES_EDESTRUCTION, sizeof(__pyx_k_ARES_EDESTRUCTION), 0, 0, 1, 1}, + {&__pyx_n_s_ARES_EFILE, __pyx_k_ARES_EFILE, sizeof(__pyx_k_ARES_EFILE), 0, 0, 1, 1}, + {&__pyx_n_s_ARES_EFORMERR, __pyx_k_ARES_EFORMERR, sizeof(__pyx_k_ARES_EFORMERR), 0, 0, 1, 1}, + {&__pyx_n_s_ARES_ELOADIPHLPAPI, __pyx_k_ARES_ELOADIPHLPAPI, sizeof(__pyx_k_ARES_ELOADIPHLPAPI), 0, 0, 1, 1}, + {&__pyx_n_s_ARES_ENODATA, __pyx_k_ARES_ENODATA, sizeof(__pyx_k_ARES_ENODATA), 0, 0, 1, 1}, + {&__pyx_n_s_ARES_ENOMEM, __pyx_k_ARES_ENOMEM, sizeof(__pyx_k_ARES_ENOMEM), 0, 0, 1, 1}, + {&__pyx_n_s_ARES_ENONAME, __pyx_k_ARES_ENONAME, sizeof(__pyx_k_ARES_ENONAME), 0, 0, 1, 1}, + {&__pyx_n_s_ARES_ENOTFOUND, __pyx_k_ARES_ENOTFOUND, sizeof(__pyx_k_ARES_ENOTFOUND), 0, 0, 1, 1}, + {&__pyx_n_s_ARES_ENOTIMP, __pyx_k_ARES_ENOTIMP, sizeof(__pyx_k_ARES_ENOTIMP), 0, 0, 1, 1}, + {&__pyx_n_s_ARES_ENOTINITIALIZED, __pyx_k_ARES_ENOTINITIALIZED, sizeof(__pyx_k_ARES_ENOTINITIALIZED), 0, 0, 1, 1}, + {&__pyx_n_s_ARES_EOF, __pyx_k_ARES_EOF, sizeof(__pyx_k_ARES_EOF), 0, 0, 1, 1}, + {&__pyx_n_s_ARES_EREFUSED, __pyx_k_ARES_EREFUSED, sizeof(__pyx_k_ARES_EREFUSED), 0, 0, 1, 1}, + {&__pyx_n_s_ARES_ESERVFAIL, __pyx_k_ARES_ESERVFAIL, sizeof(__pyx_k_ARES_ESERVFAIL), 0, 0, 1, 1}, + {&__pyx_n_s_ARES_ETIMEOUT, __pyx_k_ARES_ETIMEOUT, sizeof(__pyx_k_ARES_ETIMEOUT), 0, 0, 1, 1}, + {&__pyx_n_s_ARES_FLAG_IGNTC, __pyx_k_ARES_FLAG_IGNTC, sizeof(__pyx_k_ARES_FLAG_IGNTC), 0, 0, 1, 1}, + {&__pyx_n_s_ARES_FLAG_NOALIASES, __pyx_k_ARES_FLAG_NOALIASES, sizeof(__pyx_k_ARES_FLAG_NOALIASES), 0, 0, 1, 1}, + {&__pyx_n_s_ARES_FLAG_NOCHECKRESP, __pyx_k_ARES_FLAG_NOCHECKRESP, sizeof(__pyx_k_ARES_FLAG_NOCHECKRESP), 0, 0, 1, 1}, + {&__pyx_n_s_ARES_FLAG_NORECURSE, __pyx_k_ARES_FLAG_NORECURSE, sizeof(__pyx_k_ARES_FLAG_NORECURSE), 0, 0, 1, 1}, + {&__pyx_n_s_ARES_FLAG_NOSEARCH, __pyx_k_ARES_FLAG_NOSEARCH, sizeof(__pyx_k_ARES_FLAG_NOSEARCH), 0, 0, 1, 1}, + {&__pyx_n_s_ARES_FLAG_PRIMARY, __pyx_k_ARES_FLAG_PRIMARY, sizeof(__pyx_k_ARES_FLAG_PRIMARY), 0, 0, 1, 1}, + {&__pyx_n_s_ARES_FLAG_STAYOPEN, __pyx_k_ARES_FLAG_STAYOPEN, sizeof(__pyx_k_ARES_FLAG_STAYOPEN), 0, 0, 1, 1}, + {&__pyx_n_s_ARES_FLAG_USEVC, __pyx_k_ARES_FLAG_USEVC, sizeof(__pyx_k_ARES_FLAG_USEVC), 0, 0, 1, 1}, + {&__pyx_n_s_ARES_SUCCESS, __pyx_k_ARES_SUCCESS, sizeof(__pyx_k_ARES_SUCCESS), 0, 0, 1, 1}, + {&__pyx_kp_s_Bad_value_for_ai_flags_0x_x, __pyx_k_Bad_value_for_ai_flags_0x_x, sizeof(__pyx_k_Bad_value_for_ai_flags_0x_x), 0, 0, 1, 0}, + {&__pyx_n_s_InvalidIP, __pyx_k_InvalidIP, sizeof(__pyx_k_InvalidIP), 0, 0, 1, 1}, + {&__pyx_kp_s_Invalid_value_for_port_r, __pyx_k_Invalid_value_for_port_r, sizeof(__pyx_k_Invalid_value_for_port_r), 0, 0, 1, 0}, + {&__pyx_n_s_MemoryError, __pyx_k_MemoryError, sizeof(__pyx_k_MemoryError), 0, 0, 1, 1}, + {&__pyx_n_s_NI_DGRAM, __pyx_k_NI_DGRAM, sizeof(__pyx_k_NI_DGRAM), 0, 0, 1, 1}, + {&__pyx_n_s_NI_NAMEREQD, __pyx_k_NI_NAMEREQD, sizeof(__pyx_k_NI_NAMEREQD), 0, 0, 1, 1}, + {&__pyx_n_s_NI_NOFQDN, __pyx_k_NI_NOFQDN, sizeof(__pyx_k_NI_NOFQDN), 0, 0, 1, 1}, + {&__pyx_n_s_NI_NUMERICHOST, __pyx_k_NI_NUMERICHOST, sizeof(__pyx_k_NI_NUMERICHOST), 0, 0, 1, 1}, + {&__pyx_n_s_NI_NUMERICSERV, __pyx_k_NI_NUMERICSERV, sizeof(__pyx_k_NI_NUMERICSERV), 0, 0, 1, 1}, + {&__pyx_n_s_TIMEOUT, __pyx_k_TIMEOUT, sizeof(__pyx_k_TIMEOUT), 0, 0, 1, 1}, + {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1}, + {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1}, + {&__pyx_kp_s__2, __pyx_k__2, sizeof(__pyx_k__2), 0, 0, 1, 0}, + {&__pyx_n_s_addr, __pyx_k_addr, sizeof(__pyx_k_addr), 0, 0, 1, 1}, + {&__pyx_n_s_again, __pyx_k_again, sizeof(__pyx_k_again), 0, 0, 1, 1}, + {&__pyx_n_s_all, __pyx_k_all, sizeof(__pyx_k_all), 0, 0, 1, 1}, + {&__pyx_n_s_ares_errors, __pyx_k_ares_errors, sizeof(__pyx_k_ares_errors), 0, 0, 1, 1}, + {&__pyx_n_s_ares_host_result, __pyx_k_ares_host_result, sizeof(__pyx_k_ares_host_result), 0, 0, 1, 1}, + {&__pyx_n_s_ares_host_result___getnewargs, __pyx_k_ares_host_result___getnewargs, sizeof(__pyx_k_ares_host_result___getnewargs), 0, 0, 1, 1}, + {&__pyx_n_s_ares_host_result___new, __pyx_k_ares_host_result___new, sizeof(__pyx_k_ares_host_result___new), 0, 0, 1, 1}, + {&__pyx_n_s_ascii, __pyx_k_ascii, sizeof(__pyx_k_ascii), 0, 0, 1, 1}, + {&__pyx_n_s_basestring, __pyx_k_basestring, sizeof(__pyx_k_basestring), 0, 0, 1, 1}, + {&__pyx_n_s_builtins, __pyx_k_builtins, sizeof(__pyx_k_builtins), 0, 0, 1, 1}, + {&__pyx_n_s_callback, __pyx_k_callback, sizeof(__pyx_k_callback), 0, 0, 1, 1}, + {&__pyx_n_s_cares_flag_map, __pyx_k_cares_flag_map, sizeof(__pyx_k_cares_flag_map), 0, 0, 1, 1}, + {&__pyx_n_s_channel, __pyx_k_channel, sizeof(__pyx_k_channel), 0, 0, 1, 1}, + {&__pyx_n_s_class, __pyx_k_class, sizeof(__pyx_k_class), 0, 0, 1, 1}, + {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, + {&__pyx_n_s_close, __pyx_k_close, sizeof(__pyx_k_close), 0, 0, 1, 1}, + {&__pyx_n_s_cls, __pyx_k_cls, sizeof(__pyx_k_cls), 0, 0, 1, 1}, + {&__pyx_n_s_default, __pyx_k_default, sizeof(__pyx_k_default), 0, 0, 1, 1}, + {&__pyx_n_s_destroy, __pyx_k_destroy, sizeof(__pyx_k_destroy), 0, 0, 1, 1}, + {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1}, + {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1}, + {&__pyx_n_s_events, __pyx_k_events, sizeof(__pyx_k_events), 0, 0, 1, 1}, + {&__pyx_n_s_exc_info, __pyx_k_exc_info, sizeof(__pyx_k_exc_info), 0, 0, 1, 1}, + {&__pyx_n_s_exception, __pyx_k_exception, sizeof(__pyx_k_exception), 0, 0, 1, 1}, + {&__pyx_kp_s_expected_a_tuple_got_r, __pyx_k_expected_a_tuple_got_r, sizeof(__pyx_k_expected_a_tuple_got_r), 0, 0, 1, 0}, + {&__pyx_n_s_family, __pyx_k_family, sizeof(__pyx_k_family), 0, 0, 1, 1}, + {&__pyx_n_s_fd, __pyx_k_fd, sizeof(__pyx_k_fd), 0, 0, 1, 1}, + {&__pyx_n_s_flags, __pyx_k_flags, sizeof(__pyx_k_flags), 0, 0, 1, 1}, + {&__pyx_n_s_gaierror, __pyx_k_gaierror, sizeof(__pyx_k_gaierror), 0, 0, 1, 1}, + {&__pyx_n_s_get, __pyx_k_get, sizeof(__pyx_k_get), 0, 0, 1, 1}, + {&__pyx_n_s_getnameinfo, __pyx_k_getnameinfo, sizeof(__pyx_k_getnameinfo), 0, 0, 1, 1}, + {&__pyx_n_s_getnewargs, __pyx_k_getnewargs, sizeof(__pyx_k_getnewargs), 0, 0, 1, 1}, + {&__pyx_n_s_gevent_resolver_cares, __pyx_k_gevent_resolver_cares, sizeof(__pyx_k_gevent_resolver_cares), 0, 0, 1, 1}, + {&__pyx_n_s_handle_error, __pyx_k_handle_error, sizeof(__pyx_k_handle_error), 0, 0, 1, 1}, + {&__pyx_n_s_id, __pyx_k_id, sizeof(__pyx_k_id), 0, 0, 1, 1}, + {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, + {&__pyx_n_s_io, __pyx_k_io, sizeof(__pyx_k_io), 0, 0, 1, 1}, + {&__pyx_n_s_iterable, __pyx_k_iterable, sizeof(__pyx_k_iterable), 0, 0, 1, 1}, + {&__pyx_n_s_loop, __pyx_k_loop, sizeof(__pyx_k_loop), 0, 0, 1, 1}, + {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, + {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1}, + {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1}, + {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, + {&__pyx_n_s_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 0, 1, 1}, + {&__pyx_n_s_ndots, __pyx_k_ndots, sizeof(__pyx_k_ndots), 0, 0, 1, 1}, + {&__pyx_n_s_new, __pyx_k_new, sizeof(__pyx_k_new), 0, 0, 1, 1}, + {&__pyx_n_s_on_timer, __pyx_k_on_timer, sizeof(__pyx_k_on_timer), 0, 0, 1, 1}, + {&__pyx_n_s_pass_events, __pyx_k_pass_events, sizeof(__pyx_k_pass_events), 0, 0, 1, 1}, + {&__pyx_n_s_pop, __pyx_k_pop, sizeof(__pyx_k_pop), 0, 0, 1, 1}, + {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1}, + {&__pyx_n_s_process_fd, __pyx_k_process_fd, sizeof(__pyx_k_process_fd), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1}, + {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1}, + {&__pyx_n_s_result, __pyx_k_result, sizeof(__pyx_k_result), 0, 0, 1, 1}, + {&__pyx_kp_s_s_at_0x_x__timer_r__watchers_s, __pyx_k_s_at_0x_x__timer_r__watchers_s, sizeof(__pyx_k_s_at_0x_x__timer_r__watchers_s), 0, 0, 1, 0}, + {&__pyx_kp_s_s_exception_r, __pyx_k_s_exception_r, sizeof(__pyx_k_s_exception_r), 0, 0, 1, 0}, + {&__pyx_kp_s_s_r, __pyx_k_s_r, sizeof(__pyx_k_s_r), 0, 0, 1, 0}, + {&__pyx_kp_s_s_s, __pyx_k_s_s, sizeof(__pyx_k_s_s), 0, 0, 1, 0}, + {&__pyx_kp_s_s_value_r_exception_r, __pyx_k_s_value_r_exception_r, sizeof(__pyx_k_s_value_r_exception_r), 0, 0, 1, 0}, + {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1}, + {&__pyx_n_s_servers, __pyx_k_servers, sizeof(__pyx_k_servers), 0, 0, 1, 1}, + {&__pyx_n_s_set_servers, __pyx_k_set_servers, sizeof(__pyx_k_set_servers), 0, 0, 1, 1}, + {&__pyx_n_s_sockaddr, __pyx_k_sockaddr, sizeof(__pyx_k_sockaddr), 0, 0, 1, 1}, + {&__pyx_n_s_socket, __pyx_k_socket, sizeof(__pyx_k_socket), 0, 0, 1, 1}, + {&__pyx_n_s_split, __pyx_k_split, sizeof(__pyx_k_split), 0, 0, 1, 1}, + {&__pyx_kp_s_src_gevent_resolver_cares_pyx, __pyx_k_src_gevent_resolver_cares_pyx, sizeof(__pyx_k_src_gevent_resolver_cares_pyx), 0, 0, 1, 0}, + {&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1}, + {&__pyx_n_s_stop, __pyx_k_stop, sizeof(__pyx_k_stop), 0, 0, 1, 1}, + {&__pyx_n_s_sys, __pyx_k_sys, sizeof(__pyx_k_sys), 0, 0, 1, 1}, + {&__pyx_n_s_tcp_port, __pyx_k_tcp_port, sizeof(__pyx_k_tcp_port), 0, 0, 1, 1}, + {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, + {&__pyx_kp_s_this_ares_channel_has_been_destr, __pyx_k_this_ares_channel_has_been_destr, sizeof(__pyx_k_this_ares_channel_has_been_destr), 0, 0, 1, 0}, + {&__pyx_n_s_timeout, __pyx_k_timeout, sizeof(__pyx_k_timeout), 0, 0, 1, 1}, + {&__pyx_n_s_timer, __pyx_k_timer, sizeof(__pyx_k_timer), 0, 0, 1, 1}, + {&__pyx_n_s_tries, __pyx_k_tries, sizeof(__pyx_k_tries), 0, 0, 1, 1}, + {&__pyx_n_s_udp_port, __pyx_k_udp_port, sizeof(__pyx_k_udp_port), 0, 0, 1, 1}, + {&__pyx_n_s_unicode, __pyx_k_unicode, sizeof(__pyx_k_unicode), 0, 0, 1, 1}, + {&__pyx_n_s_value, __pyx_k_value, sizeof(__pyx_k_value), 0, 0, 1, 1}, + {&__pyx_n_s_version_info, __pyx_k_version_info, sizeof(__pyx_k_version_info), 0, 0, 1, 1}, + {&__pyx_n_s_watcher, __pyx_k_watcher, sizeof(__pyx_k_watcher), 0, 0, 1, 1}, + {0, 0, 0, 0, 0, 0, 0} +}; +static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { + __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 162, __pyx_L1_error) + __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(0, 305, __pyx_L1_error) + __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(0, 339, __pyx_L1_error) + __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(0, 446, __pyx_L1_error) + return 0; + __pyx_L1_error:; + return -1; +} + +static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); + + /* "gevent/resolver/cares.pyx":162 + * + * + * class InvalidIP(ValueError): # <<<<<<<<<<<<<< + * pass + * + */ + __pyx_tuple__4 = PyTuple_Pack(1, __pyx_builtin_ValueError); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 162, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__4); + __Pyx_GIVEREF(__pyx_tuple__4); + + /* "gevent/resolver/cares.pyx":201 + * class ares_host_result(tuple): + * + * def __new__(cls, family, iterable): # <<<<<<<<<<<<<< + * cdef object self = tuple.__new__(cls, iterable) + * self.family = family + */ + __pyx_tuple__5 = PyTuple_Pack(4, __pyx_n_s_cls, __pyx_n_s_family, __pyx_n_s_iterable, __pyx_n_s_self); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 201, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__5); + __Pyx_GIVEREF(__pyx_tuple__5); + __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__5, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_resolver_cares_pyx, __pyx_n_s_new, 201, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__6)) __PYX_ERR(0, 201, __pyx_L1_error) + + /* "gevent/resolver/cares.pyx":206 + * return self + * + * def __getnewargs__(self): # <<<<<<<<<<<<<< + * return (self.family, tuple(self)) + * + */ + __pyx_tuple__7 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 206, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__7); + __Pyx_GIVEREF(__pyx_tuple__7); + __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_resolver_cares_pyx, __pyx_n_s_getnewargs, 206, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) __PYX_ERR(0, 206, __pyx_L1_error) + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} + +static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { + __pyx_umethod_PyDict_Type_get.type = (PyObject*)&PyDict_Type; + __pyx_umethod_PyDict_Type_pop.type = (PyObject*)&PyDict_Type; + if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_4 = PyInt_FromLong(4); if (unlikely(!__pyx_int_4)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_8 = PyInt_FromLong(8); if (unlikely(!__pyx_int_8)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_16 = PyInt_FromLong(16); if (unlikely(!__pyx_int_16)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_neg_8 = PyInt_FromLong(-8); if (unlikely(!__pyx_int_neg_8)) __PYX_ERR(0, 1, __pyx_L1_error) + return 0; + __pyx_L1_error:; + return -1; +} + +static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/ + +static int __Pyx_modinit_global_init_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); + /*--- Global init code ---*/ + __pyx_v_6gevent_8resolver_5cares_string_types = Py_None; Py_INCREF(Py_None); + __pyx_v_6gevent_8resolver_5cares_text_type = Py_None; Py_INCREF(Py_None); + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_variable_export_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); + /*--- Variable export code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_function_export_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); + /*--- Function export code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_type_init_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); + /*--- Type init code ---*/ + if (PyType_Ready(&__pyx_type_6gevent_8resolver_5cares_result) < 0) __PYX_ERR(0, 173, __pyx_L1_error) + __pyx_type_6gevent_8resolver_5cares_result.tp_print = 0; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6gevent_8resolver_5cares_result.tp_dictoffset && __pyx_type_6gevent_8resolver_5cares_result.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_type_6gevent_8resolver_5cares_result.tp_getattro = __Pyx_PyObject_GenericGetAttr; + } + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_result, (PyObject *)&__pyx_type_6gevent_8resolver_5cares_result) < 0) __PYX_ERR(0, 173, __pyx_L1_error) + __pyx_ptype_6gevent_8resolver_5cares_result = &__pyx_type_6gevent_8resolver_5cares_result; + __pyx_vtabptr_6gevent_8resolver_5cares_channel = &__pyx_vtable_6gevent_8resolver_5cares_channel; + __pyx_vtable_6gevent_8resolver_5cares_channel.set_servers = (PyObject *(*)(struct __pyx_obj_6gevent_8resolver_5cares_channel *, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_8resolver_5cares_7channel_set_servers *__pyx_optional_args))__pyx_f_6gevent_8resolver_5cares_7channel_set_servers; + __pyx_vtable_6gevent_8resolver_5cares_channel._sock_state_callback = (PyObject *(*)(struct __pyx_obj_6gevent_8resolver_5cares_channel *, int, int, int))__pyx_f_6gevent_8resolver_5cares_7channel__sock_state_callback; + __pyx_vtable_6gevent_8resolver_5cares_channel._getnameinfo = (PyObject *(*)(struct __pyx_obj_6gevent_8resolver_5cares_channel *, PyObject *, PyObject *, int, int __pyx_skip_dispatch))__pyx_f_6gevent_8resolver_5cares_7channel__getnameinfo; + if (PyType_Ready(&__pyx_type_6gevent_8resolver_5cares_channel) < 0) __PYX_ERR(0, 254, __pyx_L1_error) + __pyx_type_6gevent_8resolver_5cares_channel.tp_print = 0; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6gevent_8resolver_5cares_channel.tp_dictoffset && __pyx_type_6gevent_8resolver_5cares_channel.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_type_6gevent_8resolver_5cares_channel.tp_getattro = __Pyx_PyObject_GenericGetAttr; + } + if (__Pyx_SetVtable(__pyx_type_6gevent_8resolver_5cares_channel.tp_dict, __pyx_vtabptr_6gevent_8resolver_5cares_channel) < 0) __PYX_ERR(0, 254, __pyx_L1_error) + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_channel, (PyObject *)&__pyx_type_6gevent_8resolver_5cares_channel) < 0) __PYX_ERR(0, 254, __pyx_L1_error) + __pyx_ptype_6gevent_8resolver_5cares_channel = &__pyx_type_6gevent_8resolver_5cares_channel; + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_modinit_type_import_code(void) { + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); + /*--- Type import code ---*/ + __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 9, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type", + #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000 + sizeof(PyTypeObject), + #else + sizeof(PyHeapTypeObject), + #endif + __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(1, 9, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_modinit_variable_import_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); + /*--- Variable import code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_function_import_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); + /*--- Function import code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + + +#if PY_MAJOR_VERSION < 3 +#ifdef CYTHON_NO_PYINIT_EXPORT +#define __Pyx_PyMODINIT_FUNC void +#else +#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC +#endif +#else +#ifdef CYTHON_NO_PYINIT_EXPORT +#define __Pyx_PyMODINIT_FUNC PyObject * +#else +#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC +#endif +#endif + + +#if PY_MAJOR_VERSION < 3 +__Pyx_PyMODINIT_FUNC initcares(void) CYTHON_SMALL_CODE; /*proto*/ +__Pyx_PyMODINIT_FUNC initcares(void) +#else +__Pyx_PyMODINIT_FUNC PyInit_cares(void) CYTHON_SMALL_CODE; /*proto*/ +__Pyx_PyMODINIT_FUNC PyInit_cares(void) +#if CYTHON_PEP489_MULTI_PHASE_INIT +{ + return PyModuleDef_Init(&__pyx_moduledef); +} +static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { + #if PY_VERSION_HEX >= 0x030700A1 + static PY_INT64_T main_interpreter_id = -1; + PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); + if (main_interpreter_id == -1) { + main_interpreter_id = current_id; + return (unlikely(current_id == -1)) ? -1 : 0; + } else if (unlikely(main_interpreter_id != current_id)) + #else + static PyInterpreterState *main_interpreter = NULL; + PyInterpreterState *current_interpreter = PyThreadState_Get()->interp; + if (!main_interpreter) { + main_interpreter = current_interpreter; + } else if (unlikely(main_interpreter != current_interpreter)) + #endif + { + PyErr_SetString( + PyExc_ImportError, + "Interpreter change detected - this module can only be loaded into one interpreter per process."); + return -1; + } + return 0; +} +static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) { + PyObject *value = PyObject_GetAttrString(spec, from_name); + int result = 0; + if (likely(value)) { + if (allow_none || value != Py_None) { + result = PyDict_SetItemString(moddict, to_name, value); + } + Py_DECREF(value); + } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_Clear(); + } else { + result = -1; + } + return result; +} +static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) { + PyObject *module = NULL, *moddict, *modname; + if (__Pyx_check_single_interpreter()) + return NULL; + if (__pyx_m) + return __Pyx_NewRef(__pyx_m); + modname = PyObject_GetAttrString(spec, "name"); + if (unlikely(!modname)) goto bad; + module = PyModule_NewObject(modname); + Py_DECREF(modname); + if (unlikely(!module)) goto bad; + moddict = PyModule_GetDict(module); + if (unlikely(!moddict)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad; + return module; +bad: + Py_XDECREF(module); + return NULL; +} + + +static CYTHON_SMALL_CODE int __pyx_pymod_exec_cares(PyObject *__pyx_pyinit_module) +#endif +#endif +{ + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + PyObject *__pyx_t_14 = NULL; + PyObject *__pyx_t_15 = NULL; + PyObject *__pyx_t_16 = NULL; + PyObject *__pyx_t_17 = NULL; + PyObject *__pyx_t_18 = NULL; + PyObject *__pyx_t_19 = NULL; + PyObject *__pyx_t_20 = NULL; + PyObject *__pyx_t_21 = NULL; + PyObject *__pyx_t_22 = NULL; + PyObject *__pyx_t_23 = NULL; + PyObject *__pyx_t_24 = NULL; + PyObject *__pyx_t_25 = NULL; + PyObject *__pyx_t_26 = NULL; + PyObject *__pyx_t_27 = NULL; + __Pyx_RefNannyDeclarations + #if CYTHON_PEP489_MULTI_PHASE_INIT + if (__pyx_m) { + if (__pyx_m == __pyx_pyinit_module) return 0; + PyErr_SetString(PyExc_RuntimeError, "Module 'cares' has already been imported. Re-initialisation is not supported."); + return -1; + } + #elif PY_MAJOR_VERSION >= 3 + if (__pyx_m) return __Pyx_NewRef(__pyx_m); + #endif + #if CYTHON_REFNANNY +__Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); +if (!__Pyx_RefNanny) { + PyErr_Clear(); + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); + if (!__Pyx_RefNanny) + Py_FatalError("failed to import 'refnanny' module"); +} +#endif + __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_cares(void)", 0); + if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #ifdef __Pxy_PyFrame_Initialize_Offsets + __Pxy_PyFrame_Initialize_Offsets(); + #endif + __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) + #ifdef __Pyx_CyFunction_USED + if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_FusedFunction_USED + if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_Coroutine_USED + if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_Generator_USED + if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_AsyncGen_USED + if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_StopAsyncIteration_USED + if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + /*--- Library function declarations ---*/ + /*--- Threads initialization code ---*/ + #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS + #ifdef WITH_THREAD /* Python build with threading support? */ + PyEval_InitThreads(); + #endif + #endif + /*--- Module creation code ---*/ + #if CYTHON_PEP489_MULTI_PHASE_INIT + __pyx_m = __pyx_pyinit_module; + Py_INCREF(__pyx_m); + #else + #if PY_MAJOR_VERSION < 3 + __pyx_m = Py_InitModule4("cares", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); + #else + __pyx_m = PyModule_Create(&__pyx_moduledef); + #endif + if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) + Py_INCREF(__pyx_d); + __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) + #if CYTHON_COMPILING_IN_PYPY + Py_INCREF(__pyx_b); + #endif + if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + /*--- Initialize various global constants etc. ---*/ + if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) + if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + if (__pyx_module_is_main_gevent__resolver__cares) { + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + } + #if PY_MAJOR_VERSION >= 3 + { + PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) + if (!PyDict_GetItemString(modules, "gevent.resolver.cares")) { + if (unlikely(PyDict_SetItemString(modules, "gevent.resolver.cares", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error) + } + } + #endif + /*--- Builtin init code ---*/ + if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + /*--- Constants init code ---*/ + if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + /*--- Global type/function init code ---*/ + (void)__Pyx_modinit_global_init_code(); + (void)__Pyx_modinit_variable_export_code(); + (void)__Pyx_modinit_function_export_code(); + if (unlikely(__Pyx_modinit_type_init_code() != 0)) goto __pyx_L1_error; + if (unlikely(__Pyx_modinit_type_import_code() != 0)) goto __pyx_L1_error; + (void)__Pyx_modinit_variable_import_code(); + (void)__Pyx_modinit_function_import_code(); + /*--- Execution code ---*/ + #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) + if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + + /* "gevent/resolver/cares.pyx":8 + * # cython: auto_pickle=False + * cimport libcares as cares + * import sys # <<<<<<<<<<<<<< + * + * from cpython.ref cimport Py_INCREF + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_sys, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 8, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_sys, __pyx_t_1) < 0) __PYX_ERR(0, 8, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "gevent/resolver/cares.pyx":15 + * from cpython.mem cimport PyMem_Free + * + * from _socket import gaierror # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 15, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_gaierror); + __Pyx_GIVEREF(__pyx_n_s_gaierror); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_gaierror); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_socket, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 15, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_gaierror); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 15, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_gaierror, __pyx_t_1) < 0) __PYX_ERR(0, 15, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "gevent/resolver/cares.pyx":18 + * + * + * __all__ = ['channel'] # <<<<<<<<<<<<<< + * + * cdef object string_types + */ + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 18, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_channel); + __Pyx_GIVEREF(__pyx_n_s_channel); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_channel); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_all, __pyx_t_2) < 0) __PYX_ERR(0, 18, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "gevent/resolver/cares.pyx":23 + * cdef object text_type + * + * if sys.version_info[0] >= 3: # <<<<<<<<<<<<<< + * string_types = str, + * text_type = str + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_sys); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 23, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_version_info); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 23, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 23, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_int_3, Py_GE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 23, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 23, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_3) { + + /* "gevent/resolver/cares.pyx":24 + * + * if sys.version_info[0] >= 3: + * string_types = str, # <<<<<<<<<<<<<< + * text_type = str + * else: + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 24, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)(&PyString_Type))); + __Pyx_GIVEREF(((PyObject *)(&PyString_Type))); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)(&PyString_Type))); + __Pyx_XGOTREF(__pyx_v_6gevent_8resolver_5cares_string_types); + __Pyx_DECREF_SET(__pyx_v_6gevent_8resolver_5cares_string_types, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + + /* "gevent/resolver/cares.pyx":25 + * if sys.version_info[0] >= 3: + * string_types = str, + * text_type = str # <<<<<<<<<<<<<< + * else: + * string_types = __builtins__.basestring, + */ + __Pyx_INCREF(((PyObject *)(&PyString_Type))); + __Pyx_XGOTREF(__pyx_v_6gevent_8resolver_5cares_text_type); + __Pyx_DECREF_SET(__pyx_v_6gevent_8resolver_5cares_text_type, ((PyObject *)(&PyString_Type))); + __Pyx_GIVEREF(((PyObject *)(&PyString_Type))); + + /* "gevent/resolver/cares.pyx":23 + * cdef object text_type + * + * if sys.version_info[0] >= 3: # <<<<<<<<<<<<<< + * string_types = str, + * text_type = str + */ + goto __pyx_L2; + } + + /* "gevent/resolver/cares.pyx":27 + * text_type = str + * else: + * string_types = __builtins__.basestring, # <<<<<<<<<<<<<< + * text_type = __builtins__.unicode + * + */ + /*else*/ { + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_builtins); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 27, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_basestring); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 27, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 27, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); + __pyx_t_2 = 0; + __Pyx_XGOTREF(__pyx_v_6gevent_8resolver_5cares_string_types); + __Pyx_DECREF_SET(__pyx_v_6gevent_8resolver_5cares_string_types, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + + /* "gevent/resolver/cares.pyx":28 + * else: + * string_types = __builtins__.basestring, + * text_type = __builtins__.unicode # <<<<<<<<<<<<<< + * + * TIMEOUT = 1 + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_builtins); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 28, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 28, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XGOTREF(__pyx_v_6gevent_8resolver_5cares_text_type); + __Pyx_DECREF_SET(__pyx_v_6gevent_8resolver_5cares_text_type, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + } + __pyx_L2:; + + /* "gevent/resolver/cares.pyx":30 + * text_type = __builtins__.unicode + * + * TIMEOUT = 1 # <<<<<<<<<<<<<< + * + * DEF EV_READ = 1 + */ + if (PyDict_SetItem(__pyx_d, __pyx_n_s_TIMEOUT, __pyx_int_1) < 0) __PYX_ERR(0, 30, __pyx_L1_error) + + /* "gevent/resolver/cares.pyx":67 + * + * + * ARES_SUCCESS = cares.ARES_SUCCESS # <<<<<<<<<<<<<< + * ARES_ENODATA = cares.ARES_ENODATA + * ARES_EFORMERR = cares.ARES_EFORMERR + */ + __pyx_t_2 = __Pyx_PyInt_From_int(ARES_SUCCESS); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 67, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARES_SUCCESS, __pyx_t_2) < 0) __PYX_ERR(0, 67, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "gevent/resolver/cares.pyx":68 + * + * ARES_SUCCESS = cares.ARES_SUCCESS + * ARES_ENODATA = cares.ARES_ENODATA # <<<<<<<<<<<<<< + * ARES_EFORMERR = cares.ARES_EFORMERR + * ARES_ESERVFAIL = cares.ARES_ESERVFAIL + */ + __pyx_t_2 = __Pyx_PyInt_From_int(ARES_ENODATA); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 68, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARES_ENODATA, __pyx_t_2) < 0) __PYX_ERR(0, 68, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "gevent/resolver/cares.pyx":69 + * ARES_SUCCESS = cares.ARES_SUCCESS + * ARES_ENODATA = cares.ARES_ENODATA + * ARES_EFORMERR = cares.ARES_EFORMERR # <<<<<<<<<<<<<< + * ARES_ESERVFAIL = cares.ARES_ESERVFAIL + * ARES_ENOTFOUND = cares.ARES_ENOTFOUND + */ + __pyx_t_2 = __Pyx_PyInt_From_int(ARES_EFORMERR); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 69, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARES_EFORMERR, __pyx_t_2) < 0) __PYX_ERR(0, 69, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "gevent/resolver/cares.pyx":70 + * ARES_ENODATA = cares.ARES_ENODATA + * ARES_EFORMERR = cares.ARES_EFORMERR + * ARES_ESERVFAIL = cares.ARES_ESERVFAIL # <<<<<<<<<<<<<< + * ARES_ENOTFOUND = cares.ARES_ENOTFOUND + * ARES_ENOTIMP = cares.ARES_ENOTIMP + */ + __pyx_t_2 = __Pyx_PyInt_From_int(ARES_ESERVFAIL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 70, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARES_ESERVFAIL, __pyx_t_2) < 0) __PYX_ERR(0, 70, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "gevent/resolver/cares.pyx":71 + * ARES_EFORMERR = cares.ARES_EFORMERR + * ARES_ESERVFAIL = cares.ARES_ESERVFAIL + * ARES_ENOTFOUND = cares.ARES_ENOTFOUND # <<<<<<<<<<<<<< + * ARES_ENOTIMP = cares.ARES_ENOTIMP + * ARES_EREFUSED = cares.ARES_EREFUSED + */ + __pyx_t_2 = __Pyx_PyInt_From_int(ARES_ENOTFOUND); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 71, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARES_ENOTFOUND, __pyx_t_2) < 0) __PYX_ERR(0, 71, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "gevent/resolver/cares.pyx":72 + * ARES_ESERVFAIL = cares.ARES_ESERVFAIL + * ARES_ENOTFOUND = cares.ARES_ENOTFOUND + * ARES_ENOTIMP = cares.ARES_ENOTIMP # <<<<<<<<<<<<<< + * ARES_EREFUSED = cares.ARES_EREFUSED + * ARES_EBADQUERY = cares.ARES_EBADQUERY + */ + __pyx_t_2 = __Pyx_PyInt_From_int(ARES_ENOTIMP); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 72, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARES_ENOTIMP, __pyx_t_2) < 0) __PYX_ERR(0, 72, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "gevent/resolver/cares.pyx":73 + * ARES_ENOTFOUND = cares.ARES_ENOTFOUND + * ARES_ENOTIMP = cares.ARES_ENOTIMP + * ARES_EREFUSED = cares.ARES_EREFUSED # <<<<<<<<<<<<<< + * ARES_EBADQUERY = cares.ARES_EBADQUERY + * ARES_EBADNAME = cares.ARES_EBADNAME + */ + __pyx_t_2 = __Pyx_PyInt_From_int(ARES_EREFUSED); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 73, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARES_EREFUSED, __pyx_t_2) < 0) __PYX_ERR(0, 73, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "gevent/resolver/cares.pyx":74 + * ARES_ENOTIMP = cares.ARES_ENOTIMP + * ARES_EREFUSED = cares.ARES_EREFUSED + * ARES_EBADQUERY = cares.ARES_EBADQUERY # <<<<<<<<<<<<<< + * ARES_EBADNAME = cares.ARES_EBADNAME + * ARES_EBADFAMILY = cares.ARES_EBADFAMILY + */ + __pyx_t_2 = __Pyx_PyInt_From_int(ARES_EBADQUERY); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 74, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARES_EBADQUERY, __pyx_t_2) < 0) __PYX_ERR(0, 74, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "gevent/resolver/cares.pyx":75 + * ARES_EREFUSED = cares.ARES_EREFUSED + * ARES_EBADQUERY = cares.ARES_EBADQUERY + * ARES_EBADNAME = cares.ARES_EBADNAME # <<<<<<<<<<<<<< + * ARES_EBADFAMILY = cares.ARES_EBADFAMILY + * ARES_EBADRESP = cares.ARES_EBADRESP + */ + __pyx_t_2 = __Pyx_PyInt_From_int(ARES_EBADNAME); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 75, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARES_EBADNAME, __pyx_t_2) < 0) __PYX_ERR(0, 75, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "gevent/resolver/cares.pyx":76 + * ARES_EBADQUERY = cares.ARES_EBADQUERY + * ARES_EBADNAME = cares.ARES_EBADNAME + * ARES_EBADFAMILY = cares.ARES_EBADFAMILY # <<<<<<<<<<<<<< + * ARES_EBADRESP = cares.ARES_EBADRESP + * ARES_ECONNREFUSED = cares.ARES_ECONNREFUSED + */ + __pyx_t_2 = __Pyx_PyInt_From_int(ARES_EBADFAMILY); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 76, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARES_EBADFAMILY, __pyx_t_2) < 0) __PYX_ERR(0, 76, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "gevent/resolver/cares.pyx":77 + * ARES_EBADNAME = cares.ARES_EBADNAME + * ARES_EBADFAMILY = cares.ARES_EBADFAMILY + * ARES_EBADRESP = cares.ARES_EBADRESP # <<<<<<<<<<<<<< + * ARES_ECONNREFUSED = cares.ARES_ECONNREFUSED + * ARES_ETIMEOUT = cares.ARES_ETIMEOUT + */ + __pyx_t_2 = __Pyx_PyInt_From_int(ARES_EBADRESP); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 77, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARES_EBADRESP, __pyx_t_2) < 0) __PYX_ERR(0, 77, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "gevent/resolver/cares.pyx":78 + * ARES_EBADFAMILY = cares.ARES_EBADFAMILY + * ARES_EBADRESP = cares.ARES_EBADRESP + * ARES_ECONNREFUSED = cares.ARES_ECONNREFUSED # <<<<<<<<<<<<<< + * ARES_ETIMEOUT = cares.ARES_ETIMEOUT + * ARES_EOF = cares.ARES_EOF + */ + __pyx_t_2 = __Pyx_PyInt_From_int(ARES_ECONNREFUSED); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 78, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARES_ECONNREFUSED, __pyx_t_2) < 0) __PYX_ERR(0, 78, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "gevent/resolver/cares.pyx":79 + * ARES_EBADRESP = cares.ARES_EBADRESP + * ARES_ECONNREFUSED = cares.ARES_ECONNREFUSED + * ARES_ETIMEOUT = cares.ARES_ETIMEOUT # <<<<<<<<<<<<<< + * ARES_EOF = cares.ARES_EOF + * ARES_EFILE = cares.ARES_EFILE + */ + __pyx_t_2 = __Pyx_PyInt_From_int(ARES_ETIMEOUT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 79, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARES_ETIMEOUT, __pyx_t_2) < 0) __PYX_ERR(0, 79, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "gevent/resolver/cares.pyx":80 + * ARES_ECONNREFUSED = cares.ARES_ECONNREFUSED + * ARES_ETIMEOUT = cares.ARES_ETIMEOUT + * ARES_EOF = cares.ARES_EOF # <<<<<<<<<<<<<< + * ARES_EFILE = cares.ARES_EFILE + * ARES_ENOMEM = cares.ARES_ENOMEM + */ + __pyx_t_2 = __Pyx_PyInt_From_int(ARES_EOF); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 80, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARES_EOF, __pyx_t_2) < 0) __PYX_ERR(0, 80, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "gevent/resolver/cares.pyx":81 + * ARES_ETIMEOUT = cares.ARES_ETIMEOUT + * ARES_EOF = cares.ARES_EOF + * ARES_EFILE = cares.ARES_EFILE # <<<<<<<<<<<<<< + * ARES_ENOMEM = cares.ARES_ENOMEM + * ARES_EDESTRUCTION = cares.ARES_EDESTRUCTION + */ + __pyx_t_2 = __Pyx_PyInt_From_int(ARES_EFILE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 81, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARES_EFILE, __pyx_t_2) < 0) __PYX_ERR(0, 81, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "gevent/resolver/cares.pyx":82 + * ARES_EOF = cares.ARES_EOF + * ARES_EFILE = cares.ARES_EFILE + * ARES_ENOMEM = cares.ARES_ENOMEM # <<<<<<<<<<<<<< + * ARES_EDESTRUCTION = cares.ARES_EDESTRUCTION + * ARES_EBADSTR = cares.ARES_EBADSTR + */ + __pyx_t_2 = __Pyx_PyInt_From_int(ARES_ENOMEM); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 82, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARES_ENOMEM, __pyx_t_2) < 0) __PYX_ERR(0, 82, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "gevent/resolver/cares.pyx":83 + * ARES_EFILE = cares.ARES_EFILE + * ARES_ENOMEM = cares.ARES_ENOMEM + * ARES_EDESTRUCTION = cares.ARES_EDESTRUCTION # <<<<<<<<<<<<<< + * ARES_EBADSTR = cares.ARES_EBADSTR + * ARES_EBADFLAGS = cares.ARES_EBADFLAGS + */ + __pyx_t_2 = __Pyx_PyInt_From_int(ARES_EDESTRUCTION); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 83, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARES_EDESTRUCTION, __pyx_t_2) < 0) __PYX_ERR(0, 83, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "gevent/resolver/cares.pyx":84 + * ARES_ENOMEM = cares.ARES_ENOMEM + * ARES_EDESTRUCTION = cares.ARES_EDESTRUCTION + * ARES_EBADSTR = cares.ARES_EBADSTR # <<<<<<<<<<<<<< + * ARES_EBADFLAGS = cares.ARES_EBADFLAGS + * ARES_ENONAME = cares.ARES_ENONAME + */ + __pyx_t_2 = __Pyx_PyInt_From_int(ARES_EBADSTR); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 84, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARES_EBADSTR, __pyx_t_2) < 0) __PYX_ERR(0, 84, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "gevent/resolver/cares.pyx":85 + * ARES_EDESTRUCTION = cares.ARES_EDESTRUCTION + * ARES_EBADSTR = cares.ARES_EBADSTR + * ARES_EBADFLAGS = cares.ARES_EBADFLAGS # <<<<<<<<<<<<<< + * ARES_ENONAME = cares.ARES_ENONAME + * ARES_EBADHINTS = cares.ARES_EBADHINTS + */ + __pyx_t_2 = __Pyx_PyInt_From_int(ARES_EBADFLAGS); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 85, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARES_EBADFLAGS, __pyx_t_2) < 0) __PYX_ERR(0, 85, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "gevent/resolver/cares.pyx":86 + * ARES_EBADSTR = cares.ARES_EBADSTR + * ARES_EBADFLAGS = cares.ARES_EBADFLAGS + * ARES_ENONAME = cares.ARES_ENONAME # <<<<<<<<<<<<<< + * ARES_EBADHINTS = cares.ARES_EBADHINTS + * ARES_ENOTINITIALIZED = cares.ARES_ENOTINITIALIZED + */ + __pyx_t_2 = __Pyx_PyInt_From_int(ARES_ENONAME); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 86, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARES_ENONAME, __pyx_t_2) < 0) __PYX_ERR(0, 86, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "gevent/resolver/cares.pyx":87 + * ARES_EBADFLAGS = cares.ARES_EBADFLAGS + * ARES_ENONAME = cares.ARES_ENONAME + * ARES_EBADHINTS = cares.ARES_EBADHINTS # <<<<<<<<<<<<<< + * ARES_ENOTINITIALIZED = cares.ARES_ENOTINITIALIZED + * ARES_ELOADIPHLPAPI = cares.ARES_ELOADIPHLPAPI + */ + __pyx_t_2 = __Pyx_PyInt_From_int(ARES_EBADHINTS); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 87, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARES_EBADHINTS, __pyx_t_2) < 0) __PYX_ERR(0, 87, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "gevent/resolver/cares.pyx":88 + * ARES_ENONAME = cares.ARES_ENONAME + * ARES_EBADHINTS = cares.ARES_EBADHINTS + * ARES_ENOTINITIALIZED = cares.ARES_ENOTINITIALIZED # <<<<<<<<<<<<<< + * ARES_ELOADIPHLPAPI = cares.ARES_ELOADIPHLPAPI + * ARES_EADDRGETNETWORKPARAMS = cares.ARES_EADDRGETNETWORKPARAMS + */ + __pyx_t_2 = __Pyx_PyInt_From_int(ARES_ENOTINITIALIZED); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 88, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARES_ENOTINITIALIZED, __pyx_t_2) < 0) __PYX_ERR(0, 88, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "gevent/resolver/cares.pyx":89 + * ARES_EBADHINTS = cares.ARES_EBADHINTS + * ARES_ENOTINITIALIZED = cares.ARES_ENOTINITIALIZED + * ARES_ELOADIPHLPAPI = cares.ARES_ELOADIPHLPAPI # <<<<<<<<<<<<<< + * ARES_EADDRGETNETWORKPARAMS = cares.ARES_EADDRGETNETWORKPARAMS + * ARES_ECANCELLED = cares.ARES_ECANCELLED + */ + __pyx_t_2 = __Pyx_PyInt_From_int(ARES_ELOADIPHLPAPI); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 89, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARES_ELOADIPHLPAPI, __pyx_t_2) < 0) __PYX_ERR(0, 89, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "gevent/resolver/cares.pyx":90 + * ARES_ENOTINITIALIZED = cares.ARES_ENOTINITIALIZED + * ARES_ELOADIPHLPAPI = cares.ARES_ELOADIPHLPAPI + * ARES_EADDRGETNETWORKPARAMS = cares.ARES_EADDRGETNETWORKPARAMS # <<<<<<<<<<<<<< + * ARES_ECANCELLED = cares.ARES_ECANCELLED + * + */ + __pyx_t_2 = __Pyx_PyInt_From_int(ARES_EADDRGETNETWORKPARAMS); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 90, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARES_EADDRGETNETWORKPARAMS, __pyx_t_2) < 0) __PYX_ERR(0, 90, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "gevent/resolver/cares.pyx":91 + * ARES_ELOADIPHLPAPI = cares.ARES_ELOADIPHLPAPI + * ARES_EADDRGETNETWORKPARAMS = cares.ARES_EADDRGETNETWORKPARAMS + * ARES_ECANCELLED = cares.ARES_ECANCELLED # <<<<<<<<<<<<<< + * + * ARES_FLAG_USEVC = cares.ARES_FLAG_USEVC + */ + __pyx_t_2 = __Pyx_PyInt_From_int(ARES_ECANCELLED); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 91, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARES_ECANCELLED, __pyx_t_2) < 0) __PYX_ERR(0, 91, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "gevent/resolver/cares.pyx":93 + * ARES_ECANCELLED = cares.ARES_ECANCELLED + * + * ARES_FLAG_USEVC = cares.ARES_FLAG_USEVC # <<<<<<<<<<<<<< + * ARES_FLAG_PRIMARY = cares.ARES_FLAG_PRIMARY + * ARES_FLAG_IGNTC = cares.ARES_FLAG_IGNTC + */ + __pyx_t_2 = __Pyx_PyInt_From_int(ARES_FLAG_USEVC); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 93, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARES_FLAG_USEVC, __pyx_t_2) < 0) __PYX_ERR(0, 93, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "gevent/resolver/cares.pyx":94 + * + * ARES_FLAG_USEVC = cares.ARES_FLAG_USEVC + * ARES_FLAG_PRIMARY = cares.ARES_FLAG_PRIMARY # <<<<<<<<<<<<<< + * ARES_FLAG_IGNTC = cares.ARES_FLAG_IGNTC + * ARES_FLAG_NORECURSE = cares.ARES_FLAG_NORECURSE + */ + __pyx_t_2 = __Pyx_PyInt_From_int(ARES_FLAG_PRIMARY); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 94, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARES_FLAG_PRIMARY, __pyx_t_2) < 0) __PYX_ERR(0, 94, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "gevent/resolver/cares.pyx":95 + * ARES_FLAG_USEVC = cares.ARES_FLAG_USEVC + * ARES_FLAG_PRIMARY = cares.ARES_FLAG_PRIMARY + * ARES_FLAG_IGNTC = cares.ARES_FLAG_IGNTC # <<<<<<<<<<<<<< + * ARES_FLAG_NORECURSE = cares.ARES_FLAG_NORECURSE + * ARES_FLAG_STAYOPEN = cares.ARES_FLAG_STAYOPEN + */ + __pyx_t_2 = __Pyx_PyInt_From_int(ARES_FLAG_IGNTC); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 95, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARES_FLAG_IGNTC, __pyx_t_2) < 0) __PYX_ERR(0, 95, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "gevent/resolver/cares.pyx":96 + * ARES_FLAG_PRIMARY = cares.ARES_FLAG_PRIMARY + * ARES_FLAG_IGNTC = cares.ARES_FLAG_IGNTC + * ARES_FLAG_NORECURSE = cares.ARES_FLAG_NORECURSE # <<<<<<<<<<<<<< + * ARES_FLAG_STAYOPEN = cares.ARES_FLAG_STAYOPEN + * ARES_FLAG_NOSEARCH = cares.ARES_FLAG_NOSEARCH + */ + __pyx_t_2 = __Pyx_PyInt_From_int(ARES_FLAG_NORECURSE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 96, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARES_FLAG_NORECURSE, __pyx_t_2) < 0) __PYX_ERR(0, 96, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "gevent/resolver/cares.pyx":97 + * ARES_FLAG_IGNTC = cares.ARES_FLAG_IGNTC + * ARES_FLAG_NORECURSE = cares.ARES_FLAG_NORECURSE + * ARES_FLAG_STAYOPEN = cares.ARES_FLAG_STAYOPEN # <<<<<<<<<<<<<< + * ARES_FLAG_NOSEARCH = cares.ARES_FLAG_NOSEARCH + * ARES_FLAG_NOALIASES = cares.ARES_FLAG_NOALIASES + */ + __pyx_t_2 = __Pyx_PyInt_From_int(ARES_FLAG_STAYOPEN); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 97, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARES_FLAG_STAYOPEN, __pyx_t_2) < 0) __PYX_ERR(0, 97, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "gevent/resolver/cares.pyx":98 + * ARES_FLAG_NORECURSE = cares.ARES_FLAG_NORECURSE + * ARES_FLAG_STAYOPEN = cares.ARES_FLAG_STAYOPEN + * ARES_FLAG_NOSEARCH = cares.ARES_FLAG_NOSEARCH # <<<<<<<<<<<<<< + * ARES_FLAG_NOALIASES = cares.ARES_FLAG_NOALIASES + * ARES_FLAG_NOCHECKRESP = cares.ARES_FLAG_NOCHECKRESP + */ + __pyx_t_2 = __Pyx_PyInt_From_int(ARES_FLAG_NOSEARCH); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 98, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARES_FLAG_NOSEARCH, __pyx_t_2) < 0) __PYX_ERR(0, 98, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "gevent/resolver/cares.pyx":99 + * ARES_FLAG_STAYOPEN = cares.ARES_FLAG_STAYOPEN + * ARES_FLAG_NOSEARCH = cares.ARES_FLAG_NOSEARCH + * ARES_FLAG_NOALIASES = cares.ARES_FLAG_NOALIASES # <<<<<<<<<<<<<< + * ARES_FLAG_NOCHECKRESP = cares.ARES_FLAG_NOCHECKRESP + * + */ + __pyx_t_2 = __Pyx_PyInt_From_int(ARES_FLAG_NOALIASES); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 99, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARES_FLAG_NOALIASES, __pyx_t_2) < 0) __PYX_ERR(0, 99, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "gevent/resolver/cares.pyx":100 + * ARES_FLAG_NOSEARCH = cares.ARES_FLAG_NOSEARCH + * ARES_FLAG_NOALIASES = cares.ARES_FLAG_NOALIASES + * ARES_FLAG_NOCHECKRESP = cares.ARES_FLAG_NOCHECKRESP # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_2 = __Pyx_PyInt_From_int(ARES_FLAG_NOCHECKRESP); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 100, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARES_FLAG_NOCHECKRESP, __pyx_t_2) < 0) __PYX_ERR(0, 100, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "gevent/resolver/cares.pyx":104 + * + * _ares_errors = dict([ + * (cares.ARES_SUCCESS, 'ARES_SUCCESS'), # <<<<<<<<<<<<<< + * (cares.ARES_ENODATA, 'ARES_ENODATA'), + * (cares.ARES_EFORMERR, 'ARES_EFORMERR'), + */ + __pyx_t_2 = __Pyx_PyInt_From_int(ARES_SUCCESS); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 104, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 104, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); + __Pyx_INCREF(__pyx_n_s_ARES_SUCCESS); + __Pyx_GIVEREF(__pyx_n_s_ARES_SUCCESS); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_ARES_SUCCESS); + __pyx_t_2 = 0; + + /* "gevent/resolver/cares.pyx":105 + * _ares_errors = dict([ + * (cares.ARES_SUCCESS, 'ARES_SUCCESS'), + * (cares.ARES_ENODATA, 'ARES_ENODATA'), # <<<<<<<<<<<<<< + * (cares.ARES_EFORMERR, 'ARES_EFORMERR'), + * (cares.ARES_ESERVFAIL, 'ARES_ESERVFAIL'), + */ + __pyx_t_2 = __Pyx_PyInt_From_int(ARES_ENODATA); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 105, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 105, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_INCREF(__pyx_n_s_ARES_ENODATA); + __Pyx_GIVEREF(__pyx_n_s_ARES_ENODATA); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_n_s_ARES_ENODATA); + __pyx_t_2 = 0; + + /* "gevent/resolver/cares.pyx":106 + * (cares.ARES_SUCCESS, 'ARES_SUCCESS'), + * (cares.ARES_ENODATA, 'ARES_ENODATA'), + * (cares.ARES_EFORMERR, 'ARES_EFORMERR'), # <<<<<<<<<<<<<< + * (cares.ARES_ESERVFAIL, 'ARES_ESERVFAIL'), + * (cares.ARES_ENOTFOUND, 'ARES_ENOTFOUND'), + */ + __pyx_t_2 = __Pyx_PyInt_From_int(ARES_EFORMERR); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 106, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 106, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); + __Pyx_INCREF(__pyx_n_s_ARES_EFORMERR); + __Pyx_GIVEREF(__pyx_n_s_ARES_EFORMERR); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_n_s_ARES_EFORMERR); + __pyx_t_2 = 0; + + /* "gevent/resolver/cares.pyx":107 + * (cares.ARES_ENODATA, 'ARES_ENODATA'), + * (cares.ARES_EFORMERR, 'ARES_EFORMERR'), + * (cares.ARES_ESERVFAIL, 'ARES_ESERVFAIL'), # <<<<<<<<<<<<<< + * (cares.ARES_ENOTFOUND, 'ARES_ENOTFOUND'), + * (cares.ARES_ENOTIMP, 'ARES_ENOTIMP'), + */ + __pyx_t_2 = __Pyx_PyInt_From_int(ARES_ESERVFAIL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 107, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 107, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); + __Pyx_INCREF(__pyx_n_s_ARES_ESERVFAIL); + __Pyx_GIVEREF(__pyx_n_s_ARES_ESERVFAIL); + PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_n_s_ARES_ESERVFAIL); + __pyx_t_2 = 0; + + /* "gevent/resolver/cares.pyx":108 + * (cares.ARES_EFORMERR, 'ARES_EFORMERR'), + * (cares.ARES_ESERVFAIL, 'ARES_ESERVFAIL'), + * (cares.ARES_ENOTFOUND, 'ARES_ENOTFOUND'), # <<<<<<<<<<<<<< + * (cares.ARES_ENOTIMP, 'ARES_ENOTIMP'), + * (cares.ARES_EREFUSED, 'ARES_EREFUSED'), + */ + __pyx_t_2 = __Pyx_PyInt_From_int(ARES_ENOTFOUND); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 108, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 108, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2); + __Pyx_INCREF(__pyx_n_s_ARES_ENOTFOUND); + __Pyx_GIVEREF(__pyx_n_s_ARES_ENOTFOUND); + PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_n_s_ARES_ENOTFOUND); + __pyx_t_2 = 0; + + /* "gevent/resolver/cares.pyx":109 + * (cares.ARES_ESERVFAIL, 'ARES_ESERVFAIL'), + * (cares.ARES_ENOTFOUND, 'ARES_ENOTFOUND'), + * (cares.ARES_ENOTIMP, 'ARES_ENOTIMP'), # <<<<<<<<<<<<<< + * (cares.ARES_EREFUSED, 'ARES_EREFUSED'), + * (cares.ARES_EBADQUERY, 'ARES_EBADQUERY'), + */ + __pyx_t_2 = __Pyx_PyInt_From_int(ARES_ENOTIMP); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 109, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 109, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_2); + __Pyx_INCREF(__pyx_n_s_ARES_ENOTIMP); + __Pyx_GIVEREF(__pyx_n_s_ARES_ENOTIMP); + PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_n_s_ARES_ENOTIMP); + __pyx_t_2 = 0; + + /* "gevent/resolver/cares.pyx":110 + * (cares.ARES_ENOTFOUND, 'ARES_ENOTFOUND'), + * (cares.ARES_ENOTIMP, 'ARES_ENOTIMP'), + * (cares.ARES_EREFUSED, 'ARES_EREFUSED'), # <<<<<<<<<<<<<< + * (cares.ARES_EBADQUERY, 'ARES_EBADQUERY'), + * (cares.ARES_EBADNAME, 'ARES_EBADNAME'), + */ + __pyx_t_2 = __Pyx_PyInt_From_int(ARES_EREFUSED); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 110, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 110, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_2); + __Pyx_INCREF(__pyx_n_s_ARES_EREFUSED); + __Pyx_GIVEREF(__pyx_n_s_ARES_EREFUSED); + PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_n_s_ARES_EREFUSED); + __pyx_t_2 = 0; + + /* "gevent/resolver/cares.pyx":111 + * (cares.ARES_ENOTIMP, 'ARES_ENOTIMP'), + * (cares.ARES_EREFUSED, 'ARES_EREFUSED'), + * (cares.ARES_EBADQUERY, 'ARES_EBADQUERY'), # <<<<<<<<<<<<<< + * (cares.ARES_EBADNAME, 'ARES_EBADNAME'), + * (cares.ARES_EBADFAMILY, 'ARES_EBADFAMILY'), + */ + __pyx_t_2 = __Pyx_PyInt_From_int(ARES_EBADQUERY); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 111, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 111, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_2); + __Pyx_INCREF(__pyx_n_s_ARES_EBADQUERY); + __Pyx_GIVEREF(__pyx_n_s_ARES_EBADQUERY); + PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_n_s_ARES_EBADQUERY); + __pyx_t_2 = 0; + + /* "gevent/resolver/cares.pyx":112 + * (cares.ARES_EREFUSED, 'ARES_EREFUSED'), + * (cares.ARES_EBADQUERY, 'ARES_EBADQUERY'), + * (cares.ARES_EBADNAME, 'ARES_EBADNAME'), # <<<<<<<<<<<<<< + * (cares.ARES_EBADFAMILY, 'ARES_EBADFAMILY'), + * (cares.ARES_EBADRESP, 'ARES_EBADRESP'), + */ + __pyx_t_2 = __Pyx_PyInt_From_int(ARES_EBADNAME); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 112, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 112, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_2); + __Pyx_INCREF(__pyx_n_s_ARES_EBADNAME); + __Pyx_GIVEREF(__pyx_n_s_ARES_EBADNAME); + PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_n_s_ARES_EBADNAME); + __pyx_t_2 = 0; + + /* "gevent/resolver/cares.pyx":113 + * (cares.ARES_EBADQUERY, 'ARES_EBADQUERY'), + * (cares.ARES_EBADNAME, 'ARES_EBADNAME'), + * (cares.ARES_EBADFAMILY, 'ARES_EBADFAMILY'), # <<<<<<<<<<<<<< + * (cares.ARES_EBADRESP, 'ARES_EBADRESP'), + * (cares.ARES_ECONNREFUSED, 'ARES_ECONNREFUSED'), + */ + __pyx_t_2 = __Pyx_PyInt_From_int(ARES_EBADFAMILY); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 113, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 113, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_2); + __Pyx_INCREF(__pyx_n_s_ARES_EBADFAMILY); + __Pyx_GIVEREF(__pyx_n_s_ARES_EBADFAMILY); + PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_n_s_ARES_EBADFAMILY); + __pyx_t_2 = 0; + + /* "gevent/resolver/cares.pyx":114 + * (cares.ARES_EBADNAME, 'ARES_EBADNAME'), + * (cares.ARES_EBADFAMILY, 'ARES_EBADFAMILY'), + * (cares.ARES_EBADRESP, 'ARES_EBADRESP'), # <<<<<<<<<<<<<< + * (cares.ARES_ECONNREFUSED, 'ARES_ECONNREFUSED'), + * (cares.ARES_ETIMEOUT, 'ARES_ETIMEOUT'), + */ + __pyx_t_2 = __Pyx_PyInt_From_int(ARES_EBADRESP); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 114, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_13 = PyTuple_New(2); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 114, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_2); + __Pyx_INCREF(__pyx_n_s_ARES_EBADRESP); + __Pyx_GIVEREF(__pyx_n_s_ARES_EBADRESP); + PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_n_s_ARES_EBADRESP); + __pyx_t_2 = 0; + + /* "gevent/resolver/cares.pyx":115 + * (cares.ARES_EBADFAMILY, 'ARES_EBADFAMILY'), + * (cares.ARES_EBADRESP, 'ARES_EBADRESP'), + * (cares.ARES_ECONNREFUSED, 'ARES_ECONNREFUSED'), # <<<<<<<<<<<<<< + * (cares.ARES_ETIMEOUT, 'ARES_ETIMEOUT'), + * (cares.ARES_EOF, 'ARES_EOF'), + */ + __pyx_t_2 = __Pyx_PyInt_From_int(ARES_ECONNREFUSED); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 115, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_14 = PyTuple_New(2); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 115, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_14); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_2); + __Pyx_INCREF(__pyx_n_s_ARES_ECONNREFUSED); + __Pyx_GIVEREF(__pyx_n_s_ARES_ECONNREFUSED); + PyTuple_SET_ITEM(__pyx_t_14, 1, __pyx_n_s_ARES_ECONNREFUSED); + __pyx_t_2 = 0; + + /* "gevent/resolver/cares.pyx":116 + * (cares.ARES_EBADRESP, 'ARES_EBADRESP'), + * (cares.ARES_ECONNREFUSED, 'ARES_ECONNREFUSED'), + * (cares.ARES_ETIMEOUT, 'ARES_ETIMEOUT'), # <<<<<<<<<<<<<< + * (cares.ARES_EOF, 'ARES_EOF'), + * (cares.ARES_EFILE, 'ARES_EFILE'), + */ + __pyx_t_2 = __Pyx_PyInt_From_int(ARES_ETIMEOUT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 116, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_15 = PyTuple_New(2); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 116, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_15); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_2); + __Pyx_INCREF(__pyx_n_s_ARES_ETIMEOUT); + __Pyx_GIVEREF(__pyx_n_s_ARES_ETIMEOUT); + PyTuple_SET_ITEM(__pyx_t_15, 1, __pyx_n_s_ARES_ETIMEOUT); + __pyx_t_2 = 0; + + /* "gevent/resolver/cares.pyx":117 + * (cares.ARES_ECONNREFUSED, 'ARES_ECONNREFUSED'), + * (cares.ARES_ETIMEOUT, 'ARES_ETIMEOUT'), + * (cares.ARES_EOF, 'ARES_EOF'), # <<<<<<<<<<<<<< + * (cares.ARES_EFILE, 'ARES_EFILE'), + * (cares.ARES_ENOMEM, 'ARES_ENOMEM'), + */ + __pyx_t_2 = __Pyx_PyInt_From_int(ARES_EOF); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 117, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_16 = PyTuple_New(2); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 117, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_16); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_2); + __Pyx_INCREF(__pyx_n_s_ARES_EOF); + __Pyx_GIVEREF(__pyx_n_s_ARES_EOF); + PyTuple_SET_ITEM(__pyx_t_16, 1, __pyx_n_s_ARES_EOF); + __pyx_t_2 = 0; + + /* "gevent/resolver/cares.pyx":118 + * (cares.ARES_ETIMEOUT, 'ARES_ETIMEOUT'), + * (cares.ARES_EOF, 'ARES_EOF'), + * (cares.ARES_EFILE, 'ARES_EFILE'), # <<<<<<<<<<<<<< + * (cares.ARES_ENOMEM, 'ARES_ENOMEM'), + * (cares.ARES_EDESTRUCTION, 'ARES_EDESTRUCTION'), + */ + __pyx_t_2 = __Pyx_PyInt_From_int(ARES_EFILE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 118, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_17 = PyTuple_New(2); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 118, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_17); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_2); + __Pyx_INCREF(__pyx_n_s_ARES_EFILE); + __Pyx_GIVEREF(__pyx_n_s_ARES_EFILE); + PyTuple_SET_ITEM(__pyx_t_17, 1, __pyx_n_s_ARES_EFILE); + __pyx_t_2 = 0; + + /* "gevent/resolver/cares.pyx":119 + * (cares.ARES_EOF, 'ARES_EOF'), + * (cares.ARES_EFILE, 'ARES_EFILE'), + * (cares.ARES_ENOMEM, 'ARES_ENOMEM'), # <<<<<<<<<<<<<< + * (cares.ARES_EDESTRUCTION, 'ARES_EDESTRUCTION'), + * (cares.ARES_EBADSTR, 'ARES_EBADSTR'), + */ + __pyx_t_2 = __Pyx_PyInt_From_int(ARES_ENOMEM); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 119, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_18 = PyTuple_New(2); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 119, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_18); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_18, 0, __pyx_t_2); + __Pyx_INCREF(__pyx_n_s_ARES_ENOMEM); + __Pyx_GIVEREF(__pyx_n_s_ARES_ENOMEM); + PyTuple_SET_ITEM(__pyx_t_18, 1, __pyx_n_s_ARES_ENOMEM); + __pyx_t_2 = 0; + + /* "gevent/resolver/cares.pyx":120 + * (cares.ARES_EFILE, 'ARES_EFILE'), + * (cares.ARES_ENOMEM, 'ARES_ENOMEM'), + * (cares.ARES_EDESTRUCTION, 'ARES_EDESTRUCTION'), # <<<<<<<<<<<<<< + * (cares.ARES_EBADSTR, 'ARES_EBADSTR'), + * (cares.ARES_EBADFLAGS, 'ARES_EBADFLAGS'), + */ + __pyx_t_2 = __Pyx_PyInt_From_int(ARES_EDESTRUCTION); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 120, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_19 = PyTuple_New(2); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 120, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_19); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_t_2); + __Pyx_INCREF(__pyx_n_s_ARES_EDESTRUCTION); + __Pyx_GIVEREF(__pyx_n_s_ARES_EDESTRUCTION); + PyTuple_SET_ITEM(__pyx_t_19, 1, __pyx_n_s_ARES_EDESTRUCTION); + __pyx_t_2 = 0; + + /* "gevent/resolver/cares.pyx":121 + * (cares.ARES_ENOMEM, 'ARES_ENOMEM'), + * (cares.ARES_EDESTRUCTION, 'ARES_EDESTRUCTION'), + * (cares.ARES_EBADSTR, 'ARES_EBADSTR'), # <<<<<<<<<<<<<< + * (cares.ARES_EBADFLAGS, 'ARES_EBADFLAGS'), + * (cares.ARES_ENONAME, 'ARES_ENONAME'), + */ + __pyx_t_2 = __Pyx_PyInt_From_int(ARES_EBADSTR); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 121, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_20 = PyTuple_New(2); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 121, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_20); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_t_2); + __Pyx_INCREF(__pyx_n_s_ARES_EBADSTR); + __Pyx_GIVEREF(__pyx_n_s_ARES_EBADSTR); + PyTuple_SET_ITEM(__pyx_t_20, 1, __pyx_n_s_ARES_EBADSTR); + __pyx_t_2 = 0; + + /* "gevent/resolver/cares.pyx":122 + * (cares.ARES_EDESTRUCTION, 'ARES_EDESTRUCTION'), + * (cares.ARES_EBADSTR, 'ARES_EBADSTR'), + * (cares.ARES_EBADFLAGS, 'ARES_EBADFLAGS'), # <<<<<<<<<<<<<< + * (cares.ARES_ENONAME, 'ARES_ENONAME'), + * (cares.ARES_EBADHINTS, 'ARES_EBADHINTS'), + */ + __pyx_t_2 = __Pyx_PyInt_From_int(ARES_EBADFLAGS); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 122, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_21 = PyTuple_New(2); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 122, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_21); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_21, 0, __pyx_t_2); + __Pyx_INCREF(__pyx_n_s_ARES_EBADFLAGS); + __Pyx_GIVEREF(__pyx_n_s_ARES_EBADFLAGS); + PyTuple_SET_ITEM(__pyx_t_21, 1, __pyx_n_s_ARES_EBADFLAGS); + __pyx_t_2 = 0; + + /* "gevent/resolver/cares.pyx":123 + * (cares.ARES_EBADSTR, 'ARES_EBADSTR'), + * (cares.ARES_EBADFLAGS, 'ARES_EBADFLAGS'), + * (cares.ARES_ENONAME, 'ARES_ENONAME'), # <<<<<<<<<<<<<< + * (cares.ARES_EBADHINTS, 'ARES_EBADHINTS'), + * (cares.ARES_ENOTINITIALIZED, 'ARES_ENOTINITIALIZED'), + */ + __pyx_t_2 = __Pyx_PyInt_From_int(ARES_ENONAME); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 123, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_22 = PyTuple_New(2); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 123, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_22); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_22, 0, __pyx_t_2); + __Pyx_INCREF(__pyx_n_s_ARES_ENONAME); + __Pyx_GIVEREF(__pyx_n_s_ARES_ENONAME); + PyTuple_SET_ITEM(__pyx_t_22, 1, __pyx_n_s_ARES_ENONAME); + __pyx_t_2 = 0; + + /* "gevent/resolver/cares.pyx":124 + * (cares.ARES_EBADFLAGS, 'ARES_EBADFLAGS'), + * (cares.ARES_ENONAME, 'ARES_ENONAME'), + * (cares.ARES_EBADHINTS, 'ARES_EBADHINTS'), # <<<<<<<<<<<<<< + * (cares.ARES_ENOTINITIALIZED, 'ARES_ENOTINITIALIZED'), + * (cares.ARES_ELOADIPHLPAPI, 'ARES_ELOADIPHLPAPI'), + */ + __pyx_t_2 = __Pyx_PyInt_From_int(ARES_EBADHINTS); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 124, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_23 = PyTuple_New(2); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 124, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_23); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_23, 0, __pyx_t_2); + __Pyx_INCREF(__pyx_n_s_ARES_EBADHINTS); + __Pyx_GIVEREF(__pyx_n_s_ARES_EBADHINTS); + PyTuple_SET_ITEM(__pyx_t_23, 1, __pyx_n_s_ARES_EBADHINTS); + __pyx_t_2 = 0; + + /* "gevent/resolver/cares.pyx":125 + * (cares.ARES_ENONAME, 'ARES_ENONAME'), + * (cares.ARES_EBADHINTS, 'ARES_EBADHINTS'), + * (cares.ARES_ENOTINITIALIZED, 'ARES_ENOTINITIALIZED'), # <<<<<<<<<<<<<< + * (cares.ARES_ELOADIPHLPAPI, 'ARES_ELOADIPHLPAPI'), + * (cares.ARES_EADDRGETNETWORKPARAMS, 'ARES_EADDRGETNETWORKPARAMS'), + */ + __pyx_t_2 = __Pyx_PyInt_From_int(ARES_ENOTINITIALIZED); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 125, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_24 = PyTuple_New(2); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 125, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_24); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_24, 0, __pyx_t_2); + __Pyx_INCREF(__pyx_n_s_ARES_ENOTINITIALIZED); + __Pyx_GIVEREF(__pyx_n_s_ARES_ENOTINITIALIZED); + PyTuple_SET_ITEM(__pyx_t_24, 1, __pyx_n_s_ARES_ENOTINITIALIZED); + __pyx_t_2 = 0; + + /* "gevent/resolver/cares.pyx":126 + * (cares.ARES_EBADHINTS, 'ARES_EBADHINTS'), + * (cares.ARES_ENOTINITIALIZED, 'ARES_ENOTINITIALIZED'), + * (cares.ARES_ELOADIPHLPAPI, 'ARES_ELOADIPHLPAPI'), # <<<<<<<<<<<<<< + * (cares.ARES_EADDRGETNETWORKPARAMS, 'ARES_EADDRGETNETWORKPARAMS'), + * (cares.ARES_ECANCELLED, 'ARES_ECANCELLED')]) + */ + __pyx_t_2 = __Pyx_PyInt_From_int(ARES_ELOADIPHLPAPI); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 126, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_25 = PyTuple_New(2); if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 126, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_25); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_25, 0, __pyx_t_2); + __Pyx_INCREF(__pyx_n_s_ARES_ELOADIPHLPAPI); + __Pyx_GIVEREF(__pyx_n_s_ARES_ELOADIPHLPAPI); + PyTuple_SET_ITEM(__pyx_t_25, 1, __pyx_n_s_ARES_ELOADIPHLPAPI); + __pyx_t_2 = 0; + + /* "gevent/resolver/cares.pyx":127 + * (cares.ARES_ENOTINITIALIZED, 'ARES_ENOTINITIALIZED'), + * (cares.ARES_ELOADIPHLPAPI, 'ARES_ELOADIPHLPAPI'), + * (cares.ARES_EADDRGETNETWORKPARAMS, 'ARES_EADDRGETNETWORKPARAMS'), # <<<<<<<<<<<<<< + * (cares.ARES_ECANCELLED, 'ARES_ECANCELLED')]) + * + */ + __pyx_t_2 = __Pyx_PyInt_From_int(ARES_EADDRGETNETWORKPARAMS); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 127, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_26 = PyTuple_New(2); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 127, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_26); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_26, 0, __pyx_t_2); + __Pyx_INCREF(__pyx_n_s_ARES_EADDRGETNETWORKPARAMS); + __Pyx_GIVEREF(__pyx_n_s_ARES_EADDRGETNETWORKPARAMS); + PyTuple_SET_ITEM(__pyx_t_26, 1, __pyx_n_s_ARES_EADDRGETNETWORKPARAMS); + __pyx_t_2 = 0; + + /* "gevent/resolver/cares.pyx":128 + * (cares.ARES_ELOADIPHLPAPI, 'ARES_ELOADIPHLPAPI'), + * (cares.ARES_EADDRGETNETWORKPARAMS, 'ARES_EADDRGETNETWORKPARAMS'), + * (cares.ARES_ECANCELLED, 'ARES_ECANCELLED')]) # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_2 = __Pyx_PyInt_From_int(ARES_ECANCELLED); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 128, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_27 = PyTuple_New(2); if (unlikely(!__pyx_t_27)) __PYX_ERR(0, 128, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_27); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_27, 0, __pyx_t_2); + __Pyx_INCREF(__pyx_n_s_ARES_ECANCELLED); + __Pyx_GIVEREF(__pyx_n_s_ARES_ECANCELLED); + PyTuple_SET_ITEM(__pyx_t_27, 1, __pyx_n_s_ARES_ECANCELLED); + __pyx_t_2 = 0; + + /* "gevent/resolver/cares.pyx":103 + * + * + * _ares_errors = dict([ # <<<<<<<<<<<<<< + * (cares.ARES_SUCCESS, 'ARES_SUCCESS'), + * (cares.ARES_ENODATA, 'ARES_ENODATA'), + */ + __pyx_t_2 = PyList_New(25); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 103, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_1); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_4); + PyList_SET_ITEM(__pyx_t_2, 1, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_5); + PyList_SET_ITEM(__pyx_t_2, 2, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_6); + PyList_SET_ITEM(__pyx_t_2, 3, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_7); + PyList_SET_ITEM(__pyx_t_2, 4, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_8); + PyList_SET_ITEM(__pyx_t_2, 5, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_9); + PyList_SET_ITEM(__pyx_t_2, 6, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_10); + PyList_SET_ITEM(__pyx_t_2, 7, __pyx_t_10); + __Pyx_GIVEREF(__pyx_t_11); + PyList_SET_ITEM(__pyx_t_2, 8, __pyx_t_11); + __Pyx_GIVEREF(__pyx_t_12); + PyList_SET_ITEM(__pyx_t_2, 9, __pyx_t_12); + __Pyx_GIVEREF(__pyx_t_13); + PyList_SET_ITEM(__pyx_t_2, 10, __pyx_t_13); + __Pyx_GIVEREF(__pyx_t_14); + PyList_SET_ITEM(__pyx_t_2, 11, __pyx_t_14); + __Pyx_GIVEREF(__pyx_t_15); + PyList_SET_ITEM(__pyx_t_2, 12, __pyx_t_15); + __Pyx_GIVEREF(__pyx_t_16); + PyList_SET_ITEM(__pyx_t_2, 13, __pyx_t_16); + __Pyx_GIVEREF(__pyx_t_17); + PyList_SET_ITEM(__pyx_t_2, 14, __pyx_t_17); + __Pyx_GIVEREF(__pyx_t_18); + PyList_SET_ITEM(__pyx_t_2, 15, __pyx_t_18); + __Pyx_GIVEREF(__pyx_t_19); + PyList_SET_ITEM(__pyx_t_2, 16, __pyx_t_19); + __Pyx_GIVEREF(__pyx_t_20); + PyList_SET_ITEM(__pyx_t_2, 17, __pyx_t_20); + __Pyx_GIVEREF(__pyx_t_21); + PyList_SET_ITEM(__pyx_t_2, 18, __pyx_t_21); + __Pyx_GIVEREF(__pyx_t_22); + PyList_SET_ITEM(__pyx_t_2, 19, __pyx_t_22); + __Pyx_GIVEREF(__pyx_t_23); + PyList_SET_ITEM(__pyx_t_2, 20, __pyx_t_23); + __Pyx_GIVEREF(__pyx_t_24); + PyList_SET_ITEM(__pyx_t_2, 21, __pyx_t_24); + __Pyx_GIVEREF(__pyx_t_25); + PyList_SET_ITEM(__pyx_t_2, 22, __pyx_t_25); + __Pyx_GIVEREF(__pyx_t_26); + PyList_SET_ITEM(__pyx_t_2, 23, __pyx_t_26); + __Pyx_GIVEREF(__pyx_t_27); + PyList_SET_ITEM(__pyx_t_2, 24, __pyx_t_27); + __pyx_t_1 = 0; + __pyx_t_4 = 0; + __pyx_t_5 = 0; + __pyx_t_6 = 0; + __pyx_t_7 = 0; + __pyx_t_8 = 0; + __pyx_t_9 = 0; + __pyx_t_10 = 0; + __pyx_t_11 = 0; + __pyx_t_12 = 0; + __pyx_t_13 = 0; + __pyx_t_14 = 0; + __pyx_t_15 = 0; + __pyx_t_16 = 0; + __pyx_t_17 = 0; + __pyx_t_18 = 0; + __pyx_t_19 = 0; + __pyx_t_20 = 0; + __pyx_t_21 = 0; + __pyx_t_22 = 0; + __pyx_t_23 = 0; + __pyx_t_24 = 0; + __pyx_t_25 = 0; + __pyx_t_26 = 0; + __pyx_t_27 = 0; + __pyx_t_27 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyDict_Type)), __pyx_t_2); if (unlikely(!__pyx_t_27)) __PYX_ERR(0, 103, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_27); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ares_errors, __pyx_t_27) < 0) __PYX_ERR(0, 103, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0; + + /* "gevent/resolver/cares.pyx":132 + * + * # maps c-ares flag to _socket module flag + * _cares_flag_map = None # <<<<<<<<<<<<<< + * + * + */ + if (PyDict_SetItem(__pyx_d, __pyx_n_s_cares_flag_map, Py_None) < 0) __PYX_ERR(0, 132, __pyx_L1_error) + + /* "gevent/resolver/cares.pyx":146 + * + * + * cpdef _convert_cares_flags(int flags, int default=cares.ARES_NI_LOOKUPHOST|cares.ARES_NI_LOOKUPSERVICE): # <<<<<<<<<<<<<< + * if _cares_flag_map is None: + * _prepare_cares_flag_map() + */ + __pyx_k_ = (ARES_NI_LOOKUPHOST | ARES_NI_LOOKUPSERVICE); + __pyx_k_ = (ARES_NI_LOOKUPHOST | ARES_NI_LOOKUPSERVICE); + + /* "gevent/resolver/cares.pyx":162 + * + * + * class InvalidIP(ValueError): # <<<<<<<<<<<<<< + * pass + * + */ + __pyx_t_27 = __Pyx_CalculateMetaclass(NULL, __pyx_tuple__4); if (unlikely(!__pyx_t_27)) __PYX_ERR(0, 162, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_27); + __pyx_t_2 = __Pyx_Py3MetaclassPrepare(__pyx_t_27, __pyx_tuple__4, __pyx_n_s_InvalidIP, __pyx_n_s_InvalidIP, (PyObject *) NULL, __pyx_n_s_gevent_resolver_cares, (PyObject *) NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 162, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_26 = __Pyx_Py3ClassCreate(__pyx_t_27, __pyx_n_s_InvalidIP, __pyx_tuple__4, __pyx_t_2, NULL, 0, 0); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 162, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_26); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_InvalidIP, __pyx_t_26) < 0) __PYX_ERR(0, 162, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0; + + /* "gevent/resolver/cares.pyx":199 + * + * + * class ares_host_result(tuple): # <<<<<<<<<<<<<< + * + * def __new__(cls, family, iterable): + */ + __pyx_t_27 = PyTuple_New(1); if (unlikely(!__pyx_t_27)) __PYX_ERR(0, 199, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_27); + __Pyx_INCREF(((PyObject *)(&PyTuple_Type))); + __Pyx_GIVEREF(((PyObject *)(&PyTuple_Type))); + PyTuple_SET_ITEM(__pyx_t_27, 0, ((PyObject *)(&PyTuple_Type))); + __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_27); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 199, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_26 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_27, __pyx_n_s_ares_host_result, __pyx_n_s_ares_host_result, (PyObject *) NULL, __pyx_n_s_gevent_resolver_cares, (PyObject *) NULL); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 199, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_26); + + /* "gevent/resolver/cares.pyx":201 + * class ares_host_result(tuple): + * + * def __new__(cls, family, iterable): # <<<<<<<<<<<<<< + * cdef object self = tuple.__new__(cls, iterable) + * self.family = family + */ + __pyx_t_25 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_8resolver_5cares_16ares_host_result_1__new__, __Pyx_CYFUNCTION_STATICMETHOD, __pyx_n_s_ares_host_result___new, NULL, __pyx_n_s_gevent_resolver_cares, __pyx_d, ((PyObject *)__pyx_codeobj__6)); if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 201, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_25); + if (__Pyx_SetNameInClass(__pyx_t_26, __pyx_n_s_new, __pyx_t_25) < 0) __PYX_ERR(0, 201, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0; + + /* "gevent/resolver/cares.pyx":206 + * return self + * + * def __getnewargs__(self): # <<<<<<<<<<<<<< + * return (self.family, tuple(self)) + * + */ + __pyx_t_25 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_8resolver_5cares_16ares_host_result_3__getnewargs__, 0, __pyx_n_s_ares_host_result___getnewargs, NULL, __pyx_n_s_gevent_resolver_cares, __pyx_d, ((PyObject *)__pyx_codeobj__8)); if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 206, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_25); + if (__Pyx_SetNameInClass(__pyx_t_26, __pyx_n_s_getnewargs, __pyx_t_25) < 0) __PYX_ERR(0, 206, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0; + + /* "gevent/resolver/cares.pyx":199 + * + * + * class ares_host_result(tuple): # <<<<<<<<<<<<<< + * + * def __new__(cls, family, iterable): + */ + __pyx_t_25 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_ares_host_result, __pyx_t_27, __pyx_t_26, NULL, 0, 0); if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 199, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_25); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ares_host_result, __pyx_t_25) < 0) __PYX_ERR(0, 199, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0; + __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0; + + /* "gevent/resolver/cares.pyx":410 + * cares.ares_process_fd(self.channel, read_fd, write_fd) + * + * def gethostbyname(self, object callback, char* name, int family=AF_INET): # <<<<<<<<<<<<<< + * if not self.channel: + * raise gaierror(cares.ARES_EDESTRUCTION, 'this ares channel has been destroyed') + */ + __pyx_k__3 = AF_INET; + + /* "gevent/resolver/cares.pyx":1 + * # Copyright (c) 2011-2012 Denis Bilenko. See LICENSE for details. # <<<<<<<<<<<<<< + * # Automatic pickling of cdef classes was added in 0.26. Unfortunately it + * # seems to be buggy (at least for the `result` class) and produces code that + */ + __pyx_t_27 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_27)) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_27); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_27) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0; + + /*--- Wrapped vars code ---*/ + + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_XDECREF(__pyx_t_13); + __Pyx_XDECREF(__pyx_t_14); + __Pyx_XDECREF(__pyx_t_15); + __Pyx_XDECREF(__pyx_t_16); + __Pyx_XDECREF(__pyx_t_17); + __Pyx_XDECREF(__pyx_t_18); + __Pyx_XDECREF(__pyx_t_19); + __Pyx_XDECREF(__pyx_t_20); + __Pyx_XDECREF(__pyx_t_21); + __Pyx_XDECREF(__pyx_t_22); + __Pyx_XDECREF(__pyx_t_23); + __Pyx_XDECREF(__pyx_t_24); + __Pyx_XDECREF(__pyx_t_25); + __Pyx_XDECREF(__pyx_t_26); + __Pyx_XDECREF(__pyx_t_27); + if (__pyx_m) { + if (__pyx_d) { + __Pyx_AddTraceback("init gevent.resolver.cares", __pyx_clineno, __pyx_lineno, __pyx_filename); + } + Py_CLEAR(__pyx_m); + } else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_ImportError, "init gevent.resolver.cares"); + } + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + #if CYTHON_PEP489_MULTI_PHASE_INIT + return (__pyx_m != NULL) ? 0 : -1; + #elif PY_MAJOR_VERSION >= 3 + return __pyx_m; + #else + return; + #endif +} + +/* --- Runtime support code --- */ +/* Refnanny */ +#if CYTHON_REFNANNY +static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { + PyObject *m = NULL, *p = NULL; + void *r = NULL; + m = PyImport_ImportModule(modname); + if (!m) goto end; + p = PyObject_GetAttrString(m, "RefNannyAPI"); + if (!p) goto end; + r = PyLong_AsVoidPtr(p); +end: + Py_XDECREF(p); + Py_XDECREF(m); + return (__Pyx_RefNannyAPIStruct *)r; +} +#endif + +/* PyObjectGetAttrStr */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_getattro)) + return tp->tp_getattro(obj, attr_name); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_getattr)) + return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); +#endif + return PyObject_GetAttr(obj, attr_name); +} +#endif + +/* GetBuiltinName */ +static PyObject *__Pyx_GetBuiltinName(PyObject *name) { + PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name); + if (unlikely(!result)) { + PyErr_Format(PyExc_NameError, +#if PY_MAJOR_VERSION >= 3 + "name '%U' is not defined", name); +#else + "name '%.200s' is not defined", PyString_AS_STRING(name)); +#endif + } + return result; +} + +/* Import */ +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { + PyObject *empty_list = 0; + PyObject *module = 0; + PyObject *global_dict = 0; + PyObject *empty_dict = 0; + PyObject *list; + #if PY_MAJOR_VERSION < 3 + PyObject *py_import; + py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); + if (!py_import) + goto bad; + #endif + if (from_list) + list = from_list; + else { + empty_list = PyList_New(0); + if (!empty_list) + goto bad; + list = empty_list; + } + global_dict = PyModule_GetDict(__pyx_m); + if (!global_dict) + goto bad; + empty_dict = PyDict_New(); + if (!empty_dict) + goto bad; + { + #if PY_MAJOR_VERSION >= 3 + if (level == -1) { + if (strchr(__Pyx_MODULE_NAME, '.')) { + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, 1); + if (!module) { + if (!PyErr_ExceptionMatches(PyExc_ImportError)) + goto bad; + PyErr_Clear(); + } + } + level = 0; + } + #endif + if (!module) { + #if PY_MAJOR_VERSION < 3 + PyObject *py_level = PyInt_FromLong(level); + if (!py_level) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, py_level, (PyObject *)NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, level); + #endif + } + } +bad: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(py_import); + #endif + Py_XDECREF(empty_list); + Py_XDECREF(empty_dict); + return module; +} + +/* PyErrExceptionMatches */ +#if CYTHON_FAST_THREAD_STATE +static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { + Py_ssize_t i, n; + n = PyTuple_GET_SIZE(tuple); +#if PY_MAJOR_VERSION >= 3 + for (i=0; icurexc_type; + if (exc_type == err) return 1; + if (unlikely(!exc_type)) return 0; + if (unlikely(PyTuple_Check(err))) + return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err); + return __Pyx_PyErr_GivenExceptionMatches(exc_type, err); +} +#endif + +/* PyErrFetchRestore */ +#if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + tmp_type = tstate->curexc_type; + tmp_value = tstate->curexc_value; + tmp_tb = tstate->curexc_traceback; + tstate->curexc_type = type; + tstate->curexc_value = value; + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +} +static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { + *type = tstate->curexc_type; + *value = tstate->curexc_value; + *tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +} +#endif + +/* GetAttr */ +static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) { +#if CYTHON_USE_TYPE_SLOTS +#if PY_MAJOR_VERSION >= 3 + if (likely(PyUnicode_Check(n))) +#else + if (likely(PyString_Check(n))) +#endif + return __Pyx_PyObject_GetAttrStr(o, n); +#endif + return PyObject_GetAttr(o, n); +} + +/* GetAttr3 */ +static PyObject *__Pyx_GetAttr3Default(PyObject *d) { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) + return NULL; + __Pyx_PyErr_Clear(); + Py_INCREF(d); + return d; +} +static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) { + PyObject *r = __Pyx_GetAttr(o, n); + return (likely(r)) ? r : __Pyx_GetAttr3Default(d); +} + +/* GetModuleGlobalName */ +#if CYTHON_USE_DICT_VERSIONS +static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value) +#else +static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) +#endif +{ + PyObject *result; +#if !CYTHON_AVOID_BORROWED_REFS +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 + result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } else if (unlikely(PyErr_Occurred())) { + return NULL; + } +#else + result = PyDict_GetItem(__pyx_d, name); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } +#endif +#else + result = PyObject_GetItem(__pyx_d, name); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } + PyErr_Clear(); +#endif + return __Pyx_GetBuiltinName(name); +} + +/* RaiseTooManyValuesToUnpack */ +static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { + PyErr_Format(PyExc_ValueError, + "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected); +} + +/* RaiseNeedMoreValuesToUnpack */ +static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { + PyErr_Format(PyExc_ValueError, + "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack", + index, (index == 1) ? "" : "s"); +} + +/* IterFinish */ +static CYTHON_INLINE int __Pyx_IterFinish(void) { +#if CYTHON_FAST_THREAD_STATE + PyThreadState *tstate = __Pyx_PyThreadState_Current; + PyObject* exc_type = tstate->curexc_type; + if (unlikely(exc_type)) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) { + PyObject *exc_value, *exc_tb; + exc_value = tstate->curexc_value; + exc_tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; + Py_DECREF(exc_type); + Py_XDECREF(exc_value); + Py_XDECREF(exc_tb); + return 0; + } else { + return -1; + } + } + return 0; +#else + if (unlikely(PyErr_Occurred())) { + if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) { + PyErr_Clear(); + return 0; + } else { + return -1; + } + } + return 0; +#endif +} + +/* UnpackItemEndCheck */ +static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { + if (unlikely(retval)) { + Py_DECREF(retval); + __Pyx_RaiseTooManyValuesError(expected); + return -1; + } else { + return __Pyx_IterFinish(); + } + return 0; +} + +/* PyFunctionFastCall */ +#if CYTHON_FAST_PYCALL +static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, + PyObject *globals) { + PyFrameObject *f; + PyThreadState *tstate = __Pyx_PyThreadState_Current; + PyObject **fastlocals; + Py_ssize_t i; + PyObject *result; + assert(globals != NULL); + /* XXX Perhaps we should create a specialized + PyFrame_New() that doesn't take locals, but does + take builtins without sanity checking them. + */ + assert(tstate != NULL); + f = PyFrame_New(tstate, co, globals, NULL); + if (f == NULL) { + return NULL; + } + fastlocals = __Pyx_PyFrame_GetLocalsplus(f); + for (i = 0; i < na; i++) { + Py_INCREF(*args); + fastlocals[i] = *args++; + } + result = PyEval_EvalFrameEx(f,0); + ++tstate->recursion_depth; + Py_DECREF(f); + --tstate->recursion_depth; + return result; +} +#if 1 || PY_VERSION_HEX < 0x030600B1 +static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs) { + PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); + PyObject *globals = PyFunction_GET_GLOBALS(func); + PyObject *argdefs = PyFunction_GET_DEFAULTS(func); + PyObject *closure; +#if PY_MAJOR_VERSION >= 3 + PyObject *kwdefs; +#endif + PyObject *kwtuple, **k; + PyObject **d; + Py_ssize_t nd; + Py_ssize_t nk; + PyObject *result; + assert(kwargs == NULL || PyDict_Check(kwargs)); + nk = kwargs ? PyDict_Size(kwargs) : 0; + if (Py_EnterRecursiveCall((char*)" while calling a Python object")) { + return NULL; + } + if ( +#if PY_MAJOR_VERSION >= 3 + co->co_kwonlyargcount == 0 && +#endif + likely(kwargs == NULL || nk == 0) && + co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { + if (argdefs == NULL && co->co_argcount == nargs) { + result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); + goto done; + } + else if (nargs == 0 && argdefs != NULL + && co->co_argcount == Py_SIZE(argdefs)) { + /* function called with no arguments, but all parameters have + a default value: use default values as arguments .*/ + args = &PyTuple_GET_ITEM(argdefs, 0); + result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); + goto done; + } + } + if (kwargs != NULL) { + Py_ssize_t pos, i; + kwtuple = PyTuple_New(2 * nk); + if (kwtuple == NULL) { + result = NULL; + goto done; + } + k = &PyTuple_GET_ITEM(kwtuple, 0); + pos = i = 0; + while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { + Py_INCREF(k[i]); + Py_INCREF(k[i+1]); + i += 2; + } + nk = i / 2; + } + else { + kwtuple = NULL; + k = NULL; + } + closure = PyFunction_GET_CLOSURE(func); +#if PY_MAJOR_VERSION >= 3 + kwdefs = PyFunction_GET_KW_DEFAULTS(func); +#endif + if (argdefs != NULL) { + d = &PyTuple_GET_ITEM(argdefs, 0); + nd = Py_SIZE(argdefs); + } + else { + d = NULL; + nd = 0; + } +#if PY_MAJOR_VERSION >= 3 + result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, + args, nargs, + k, (int)nk, + d, (int)nd, kwdefs, closure); +#else + result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, + args, nargs, + k, (int)nk, + d, (int)nd, closure); +#endif + Py_XDECREF(kwtuple); +done: + Py_LeaveRecursiveCall(); + return result; +} +#endif +#endif + +/* PyCFunctionFastCall */ +#if CYTHON_FAST_PYCCALL +static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) { + PyCFunctionObject *func = (PyCFunctionObject*)func_obj; + PyCFunction meth = PyCFunction_GET_FUNCTION(func); + PyObject *self = PyCFunction_GET_SELF(func); + int flags = PyCFunction_GET_FLAGS(func); + assert(PyCFunction_Check(func)); + assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS))); + assert(nargs >= 0); + assert(nargs == 0 || args != NULL); + /* _PyCFunction_FastCallDict() must not be called with an exception set, + because it may clear it (directly or indirectly) and so the + caller loses its exception */ + assert(!PyErr_Occurred()); + if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) { + return (*((__Pyx_PyCFunctionFastWithKeywords)(void*)meth)) (self, args, nargs, NULL); + } else { + return (*((__Pyx_PyCFunctionFast)(void*)meth)) (self, args, nargs); + } +} +#endif + +/* PyObjectCall */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { + PyObject *result; + ternaryfunc call = func->ob_type->tp_call; + if (unlikely(!call)) + return PyObject_Call(func, arg, kw); + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; + result = (*call)(func, arg, kw); + Py_LeaveRecursiveCall(); + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +/* RaiseException */ +#if PY_MAJOR_VERSION < 3 +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, + CYTHON_UNUSED PyObject *cause) { + __Pyx_PyThreadState_declare + Py_XINCREF(type); + if (!value || value == Py_None) + value = NULL; + else + Py_INCREF(value); + if (!tb || tb == Py_None) + tb = NULL; + else { + Py_INCREF(tb); + if (!PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto raise_error; + } + } + if (PyType_Check(type)) { +#if CYTHON_COMPILING_IN_PYPY + if (!value) { + Py_INCREF(Py_None); + value = Py_None; + } +#endif + PyErr_NormalizeException(&type, &value, &tb); + } else { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto raise_error; + } + value = type; + type = (PyObject*) Py_TYPE(type); + Py_INCREF(type); + if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto raise_error; + } + } + __Pyx_PyThreadState_assign + __Pyx_ErrRestore(type, value, tb); + return; +raise_error: + Py_XDECREF(value); + Py_XDECREF(type); + Py_XDECREF(tb); + return; +} +#else +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { + PyObject* owned_instance = NULL; + if (tb == Py_None) { + tb = 0; + } else if (tb && !PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto bad; + } + if (value == Py_None) + value = 0; + if (PyExceptionInstance_Check(type)) { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto bad; + } + value = type; + type = (PyObject*) Py_TYPE(value); + } else if (PyExceptionClass_Check(type)) { + PyObject *instance_class = NULL; + if (value && PyExceptionInstance_Check(value)) { + instance_class = (PyObject*) Py_TYPE(value); + if (instance_class != type) { + int is_subclass = PyObject_IsSubclass(instance_class, type); + if (!is_subclass) { + instance_class = NULL; + } else if (unlikely(is_subclass == -1)) { + goto bad; + } else { + type = instance_class; + } + } + } + if (!instance_class) { + PyObject *args; + if (!value) + args = PyTuple_New(0); + else if (PyTuple_Check(value)) { + Py_INCREF(value); + args = value; + } else + args = PyTuple_Pack(1, value); + if (!args) + goto bad; + owned_instance = PyObject_Call(type, args, NULL); + Py_DECREF(args); + if (!owned_instance) + goto bad; + value = owned_instance; + if (!PyExceptionInstance_Check(value)) { + PyErr_Format(PyExc_TypeError, + "calling %R should have returned an instance of " + "BaseException, not %R", + type, Py_TYPE(value)); + goto bad; + } + } + } else { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto bad; + } + if (cause) { + PyObject *fixed_cause; + if (cause == Py_None) { + fixed_cause = NULL; + } else if (PyExceptionClass_Check(cause)) { + fixed_cause = PyObject_CallObject(cause, NULL); + if (fixed_cause == NULL) + goto bad; + } else if (PyExceptionInstance_Check(cause)) { + fixed_cause = cause; + Py_INCREF(fixed_cause); + } else { + PyErr_SetString(PyExc_TypeError, + "exception causes must derive from " + "BaseException"); + goto bad; + } + PyException_SetCause(value, fixed_cause); + } + PyErr_SetObject(type, value); + if (tb) { +#if CYTHON_COMPILING_IN_PYPY + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); + Py_INCREF(tb); + PyErr_Restore(tmp_type, tmp_value, tb); + Py_XDECREF(tmp_tb); +#else + PyThreadState *tstate = __Pyx_PyThreadState_Current; + PyObject* tmp_tb = tstate->curexc_traceback; + if (tb != tmp_tb) { + Py_INCREF(tb); + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_tb); + } +#endif + } +bad: + Py_XDECREF(owned_instance); + return; +} +#endif + +/* RaiseDoubleKeywords */ +static void __Pyx_RaiseDoubleKeywordsError( + const char* func_name, + PyObject* kw_name) +{ + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION >= 3 + "%s() got multiple values for keyword argument '%U'", func_name, kw_name); + #else + "%s() got multiple values for keyword argument '%s'", func_name, + PyString_AsString(kw_name)); + #endif +} + +/* ParseKeywords */ +static int __Pyx_ParseOptionalKeywords( + PyObject *kwds, + PyObject **argnames[], + PyObject *kwds2, + PyObject *values[], + Py_ssize_t num_pos_args, + const char* function_name) +{ + PyObject *key = 0, *value = 0; + Py_ssize_t pos = 0; + PyObject*** name; + PyObject*** first_kw_arg = argnames + num_pos_args; + while (PyDict_Next(kwds, &pos, &key, &value)) { + name = first_kw_arg; + while (*name && (**name != key)) name++; + if (*name) { + values[name-argnames] = value; + continue; + } + name = first_kw_arg; + #if PY_MAJOR_VERSION < 3 + if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) { + while (*name) { + if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) + && _PyString_Eq(**name, key)) { + values[name-argnames] = value; + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + if ((**argname == key) || ( + (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) + && _PyString_Eq(**argname, key))) { + goto arg_passed_twice; + } + argname++; + } + } + } else + #endif + if (likely(PyUnicode_Check(key))) { + while (*name) { + int cmp = (**name == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 : + #endif + PyUnicode_Compare(**name, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) { + values[name-argnames] = value; + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + int cmp = (**argname == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 : + #endif + PyUnicode_Compare(**argname, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) goto arg_passed_twice; + argname++; + } + } + } else + goto invalid_keyword_type; + if (kwds2) { + if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; + } else { + goto invalid_keyword; + } + } + return 0; +arg_passed_twice: + __Pyx_RaiseDoubleKeywordsError(function_name, key); + goto bad; +invalid_keyword_type: + PyErr_Format(PyExc_TypeError, + "%.200s() keywords must be strings", function_name); + goto bad; +invalid_keyword: + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION < 3 + "%.200s() got an unexpected keyword argument '%.200s'", + function_name, PyString_AsString(key)); + #else + "%s() got an unexpected keyword argument '%U'", + function_name, key); + #endif +bad: + return -1; +} + +/* RaiseArgTupleInvalid */ +static void __Pyx_RaiseArgtupleInvalid( + const char* func_name, + int exact, + Py_ssize_t num_min, + Py_ssize_t num_max, + Py_ssize_t num_found) +{ + Py_ssize_t num_expected; + const char *more_or_less; + if (num_found < num_min) { + num_expected = num_min; + more_or_less = "at least"; + } else { + num_expected = num_max; + more_or_less = "at most"; + } + if (exact) { + more_or_less = "exactly"; + } + PyErr_Format(PyExc_TypeError, + "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", + func_name, more_or_less, num_expected, + (num_expected == 1) ? "" : "s", num_found); +} + +/* PyObjectCall2Args */ +static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) { + PyObject *args, *result = NULL; + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(function)) { + PyObject *args[2] = {arg1, arg2}; + return __Pyx_PyFunction_FastCall(function, args, 2); + } + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(function)) { + PyObject *args[2] = {arg1, arg2}; + return __Pyx_PyCFunction_FastCall(function, args, 2); + } + #endif + args = PyTuple_New(2); + if (unlikely(!args)) goto done; + Py_INCREF(arg1); + PyTuple_SET_ITEM(args, 0, arg1); + Py_INCREF(arg2); + PyTuple_SET_ITEM(args, 1, arg2); + Py_INCREF(function); + result = __Pyx_PyObject_Call(function, args, NULL); + Py_DECREF(args); + Py_DECREF(function); +done: + return result; +} + +/* PyObjectCallMethO */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { + PyObject *self, *result; + PyCFunction cfunc; + cfunc = PyCFunction_GET_FUNCTION(func); + self = PyCFunction_GET_SELF(func); + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; + result = cfunc(self, arg); + Py_LeaveRecursiveCall(); + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +/* PyObjectCallOneArg */ +#if CYTHON_COMPILING_IN_CPYTHON +static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) { + PyObject *result; + PyObject *args = PyTuple_New(1); + if (unlikely(!args)) return NULL; + Py_INCREF(arg); + PyTuple_SET_ITEM(args, 0, arg); + result = __Pyx_PyObject_Call(func, args, NULL); + Py_DECREF(args); + return result; +} +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { +#if CYTHON_FAST_PYCALL + if (PyFunction_Check(func)) { + return __Pyx_PyFunction_FastCall(func, &arg, 1); + } +#endif + if (likely(PyCFunction_Check(func))) { + if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) { + return __Pyx_PyObject_CallMethO(func, arg); +#if CYTHON_FAST_PYCCALL + } else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) { + return __Pyx_PyCFunction_FastCall(func, &arg, 1); +#endif + } + } + return __Pyx__PyObject_CallOneArg(func, arg); +} +#else +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { + PyObject *result; + PyObject *args = PyTuple_Pack(1, arg); + if (unlikely(!args)) return NULL; + result = __Pyx_PyObject_Call(func, args, NULL); + Py_DECREF(args); + return result; +} +#endif + +/* WriteUnraisableException */ +static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno, + CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename, + int full_traceback, CYTHON_UNUSED int nogil) { + PyObject *old_exc, *old_val, *old_tb; + PyObject *ctx; + __Pyx_PyThreadState_declare +#ifdef WITH_THREAD + PyGILState_STATE state; + if (nogil) + state = PyGILState_Ensure(); +#ifdef _MSC_VER + else state = (PyGILState_STATE)-1; +#endif +#endif + __Pyx_PyThreadState_assign + __Pyx_ErrFetch(&old_exc, &old_val, &old_tb); + if (full_traceback) { + Py_XINCREF(old_exc); + Py_XINCREF(old_val); + Py_XINCREF(old_tb); + __Pyx_ErrRestore(old_exc, old_val, old_tb); + PyErr_PrintEx(1); + } + #if PY_MAJOR_VERSION < 3 + ctx = PyString_FromString(name); + #else + ctx = PyUnicode_FromString(name); + #endif + __Pyx_ErrRestore(old_exc, old_val, old_tb); + if (!ctx) { + PyErr_WriteUnraisable(Py_None); + } else { + PyErr_WriteUnraisable(ctx); + Py_DECREF(ctx); + } +#ifdef WITH_THREAD + if (nogil) + PyGILState_Release(state); +#endif +} + +/* PyObjectSetAttrStr */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) { + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_setattro)) + return tp->tp_setattro(obj, attr_name, value); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_setattr)) + return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value); +#endif + return PyObject_SetAttr(obj, attr_name, value); +} +#endif + +/* RaiseNoneIterError */ +static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); +} + +/* ExtTypeTest */ +static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { + if (unlikely(!type)) { + PyErr_SetString(PyExc_SystemError, "Missing type object"); + return 0; + } + if (likely(__Pyx_TypeCheck(obj, type))) + return 1; + PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s", + Py_TYPE(obj)->tp_name, type->tp_name); + return 0; +} + +/* GetTopmostException */ +#if CYTHON_USE_EXC_INFO_STACK +static _PyErr_StackItem * +__Pyx_PyErr_GetTopmostException(PyThreadState *tstate) +{ + _PyErr_StackItem *exc_info = tstate->exc_info; + while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) && + exc_info->previous_item != NULL) + { + exc_info = exc_info->previous_item; + } + return exc_info; +} +#endif + +/* SaveResetException */ +#if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { + #if CYTHON_USE_EXC_INFO_STACK + _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate); + *type = exc_info->exc_type; + *value = exc_info->exc_value; + *tb = exc_info->exc_traceback; + #else + *type = tstate->exc_type; + *value = tstate->exc_value; + *tb = tstate->exc_traceback; + #endif + Py_XINCREF(*type); + Py_XINCREF(*value); + Py_XINCREF(*tb); +} +static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + #if CYTHON_USE_EXC_INFO_STACK + _PyErr_StackItem *exc_info = tstate->exc_info; + tmp_type = exc_info->exc_type; + tmp_value = exc_info->exc_value; + tmp_tb = exc_info->exc_traceback; + exc_info->exc_type = type; + exc_info->exc_value = value; + exc_info->exc_traceback = tb; + #else + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = type; + tstate->exc_value = value; + tstate->exc_traceback = tb; + #endif + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +} +#endif + +/* GetException */ +#if CYTHON_FAST_THREAD_STATE +static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) +#else +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) +#endif +{ + PyObject *local_type, *local_value, *local_tb; +#if CYTHON_FAST_THREAD_STATE + PyObject *tmp_type, *tmp_value, *tmp_tb; + local_type = tstate->curexc_type; + local_value = tstate->curexc_value; + local_tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +#else + PyErr_Fetch(&local_type, &local_value, &local_tb); +#endif + PyErr_NormalizeException(&local_type, &local_value, &local_tb); +#if CYTHON_FAST_THREAD_STATE + if (unlikely(tstate->curexc_type)) +#else + if (unlikely(PyErr_Occurred())) +#endif + goto bad; + #if PY_MAJOR_VERSION >= 3 + if (local_tb) { + if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) + goto bad; + } + #endif + Py_XINCREF(local_tb); + Py_XINCREF(local_type); + Py_XINCREF(local_value); + *type = local_type; + *value = local_value; + *tb = local_tb; +#if CYTHON_FAST_THREAD_STATE + #if CYTHON_USE_EXC_INFO_STACK + { + _PyErr_StackItem *exc_info = tstate->exc_info; + tmp_type = exc_info->exc_type; + tmp_value = exc_info->exc_value; + tmp_tb = exc_info->exc_traceback; + exc_info->exc_type = local_type; + exc_info->exc_value = local_value; + exc_info->exc_traceback = local_tb; + } + #else + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = local_type; + tstate->exc_value = local_value; + tstate->exc_traceback = local_tb; + #endif + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#else + PyErr_SetExcInfo(local_type, local_value, local_tb); +#endif + return 0; +bad: + *type = 0; + *value = 0; + *tb = 0; + Py_XDECREF(local_type); + Py_XDECREF(local_value); + Py_XDECREF(local_tb); + return -1; +} + +/* PyObjectCallNoArg */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { +#if CYTHON_FAST_PYCALL + if (PyFunction_Check(func)) { + return __Pyx_PyFunction_FastCall(func, NULL, 0); + } +#endif +#ifdef __Pyx_CyFunction_USED + if (likely(PyCFunction_Check(func) || __Pyx_CyFunction_Check(func))) +#else + if (likely(PyCFunction_Check(func))) +#endif + { + if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) { + return __Pyx_PyObject_CallMethO(func, NULL); + } + } + return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL); +} +#endif + +/* GetItemInt */ +static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { + PyObject *r; + if (!j) return NULL; + r = PyObject_GetItem(o, j); + Py_DECREF(j); + return r; +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, + CYTHON_NCP_UNUSED int wraparound, + CYTHON_NCP_UNUSED int boundscheck) { +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + Py_ssize_t wrapped_i = i; + if (wraparound & unlikely(i < 0)) { + wrapped_i += PyList_GET_SIZE(o); + } + if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) { + PyObject *r = PyList_GET_ITEM(o, wrapped_i); + Py_INCREF(r); + return r; + } + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +#else + return PySequence_GetItem(o, i); +#endif +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, + CYTHON_NCP_UNUSED int wraparound, + CYTHON_NCP_UNUSED int boundscheck) { +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + Py_ssize_t wrapped_i = i; + if (wraparound & unlikely(i < 0)) { + wrapped_i += PyTuple_GET_SIZE(o); + } + if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) { + PyObject *r = PyTuple_GET_ITEM(o, wrapped_i); + Py_INCREF(r); + return r; + } + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +#else + return PySequence_GetItem(o, i); +#endif +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, + CYTHON_NCP_UNUSED int wraparound, + CYTHON_NCP_UNUSED int boundscheck) { +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS + if (is_list || PyList_CheckExact(o)) { + Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); + if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) { + PyObject *r = PyList_GET_ITEM(o, n); + Py_INCREF(r); + return r; + } + } + else if (PyTuple_CheckExact(o)) { + Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o); + if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) { + PyObject *r = PyTuple_GET_ITEM(o, n); + Py_INCREF(r); + return r; + } + } else { + PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence; + if (likely(m && m->sq_item)) { + if (wraparound && unlikely(i < 0) && likely(m->sq_length)) { + Py_ssize_t l = m->sq_length(o); + if (likely(l >= 0)) { + i += l; + } else { + if (!PyErr_ExceptionMatches(PyExc_OverflowError)) + return NULL; + PyErr_Clear(); + } + } + return m->sq_item(o, i); + } + } +#else + if (is_list || PySequence_Check(o)) { + return PySequence_GetItem(o, i); + } +#endif + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +} + +/* pyobject_as_double */ +static double __Pyx__PyObject_AsDouble(PyObject* obj) { + PyObject* float_value; +#if !CYTHON_USE_TYPE_SLOTS + float_value = PyNumber_Float(obj); if ((0)) goto bad; +#else + PyNumberMethods *nb = Py_TYPE(obj)->tp_as_number; + if (likely(nb) && likely(nb->nb_float)) { + float_value = nb->nb_float(obj); + if (likely(float_value) && unlikely(!PyFloat_Check(float_value))) { + PyErr_Format(PyExc_TypeError, + "__float__ returned non-float (type %.200s)", + Py_TYPE(float_value)->tp_name); + Py_DECREF(float_value); + goto bad; + } + } else if (PyUnicode_CheckExact(obj) || PyBytes_CheckExact(obj)) { +#if PY_MAJOR_VERSION >= 3 + float_value = PyFloat_FromString(obj); +#else + float_value = PyFloat_FromString(obj, 0); +#endif + } else { + PyObject* args = PyTuple_New(1); + if (unlikely(!args)) goto bad; + PyTuple_SET_ITEM(args, 0, obj); + float_value = PyObject_Call((PyObject*)&PyFloat_Type, args, 0); + PyTuple_SET_ITEM(args, 0, 0); + Py_DECREF(args); + } +#endif + if (likely(float_value)) { + double value = PyFloat_AS_DOUBLE(float_value); + Py_DECREF(float_value); + return value; + } +bad: + return (double)-1; +} + +/* SwapException */ +#if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + #if CYTHON_USE_EXC_INFO_STACK + _PyErr_StackItem *exc_info = tstate->exc_info; + tmp_type = exc_info->exc_type; + tmp_value = exc_info->exc_value; + tmp_tb = exc_info->exc_traceback; + exc_info->exc_type = *type; + exc_info->exc_value = *value; + exc_info->exc_traceback = *tb; + #else + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = *type; + tstate->exc_value = *value; + tstate->exc_traceback = *tb; + #endif + *type = tmp_type; + *value = tmp_value; + *tb = tmp_tb; +} +#else +static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb); + PyErr_SetExcInfo(*type, *value, *tb); + *type = tmp_type; + *value = tmp_value; + *tb = tmp_tb; +} +#endif + +/* UnpackUnboundCMethod */ +static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target) { + PyObject *method; + method = __Pyx_PyObject_GetAttrStr(target->type, *target->method_name); + if (unlikely(!method)) + return -1; + target->method = method; +#if CYTHON_COMPILING_IN_CPYTHON + #if PY_MAJOR_VERSION >= 3 + if (likely(__Pyx_TypeCheck(method, &PyMethodDescr_Type))) + #endif + { + PyMethodDescrObject *descr = (PyMethodDescrObject*) method; + target->func = descr->d_method->ml_meth; + target->flag = descr->d_method->ml_flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_STACKLESS); + } +#endif + return 0; +} + +/* CallUnboundCMethod1 */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg) { + if (likely(cfunc->func)) { + int flag = cfunc->flag; + if (flag == METH_O) { + return (*(cfunc->func))(self, arg); + } else if (PY_VERSION_HEX >= 0x030600B1 && flag == METH_FASTCALL) { + if (PY_VERSION_HEX >= 0x030700A0) { + return (*(__Pyx_PyCFunctionFast)(void*)(PyCFunction)cfunc->func)(self, &arg, 1); + } else { + return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, &arg, 1, NULL); + } + } else if (PY_VERSION_HEX >= 0x030700A0 && flag == (METH_FASTCALL | METH_KEYWORDS)) { + return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, &arg, 1, NULL); + } + } + return __Pyx__CallUnboundCMethod1(cfunc, self, arg); +} +#endif +static PyObject* __Pyx__CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg){ + PyObject *args, *result = NULL; + if (unlikely(!cfunc->func && !cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL; +#if CYTHON_COMPILING_IN_CPYTHON + if (cfunc->func && (cfunc->flag & METH_VARARGS)) { + args = PyTuple_New(1); + if (unlikely(!args)) goto bad; + Py_INCREF(arg); + PyTuple_SET_ITEM(args, 0, arg); + if (cfunc->flag & METH_KEYWORDS) + result = (*(PyCFunctionWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, NULL); + else + result = (*cfunc->func)(self, args); + } else { + args = PyTuple_New(2); + if (unlikely(!args)) goto bad; + Py_INCREF(self); + PyTuple_SET_ITEM(args, 0, self); + Py_INCREF(arg); + PyTuple_SET_ITEM(args, 1, arg); + result = __Pyx_PyObject_Call(cfunc->method, args, NULL); + } +#else + args = PyTuple_Pack(2, self, arg); + if (unlikely(!args)) goto bad; + result = __Pyx_PyObject_Call(cfunc->method, args, NULL); +#endif +bad: + Py_XDECREF(args); + return result; +} + +/* CallUnboundCMethod2 */ +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030600B1 +static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2) { + if (likely(cfunc->func)) { + PyObject *args[2] = {arg1, arg2}; + if (cfunc->flag == METH_FASTCALL) { + #if PY_VERSION_HEX >= 0x030700A0 + return (*(__Pyx_PyCFunctionFast)(void*)(PyCFunction)cfunc->func)(self, args, 2); + #else + return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, 2, NULL); + #endif + } + #if PY_VERSION_HEX >= 0x030700A0 + if (cfunc->flag == (METH_FASTCALL | METH_KEYWORDS)) + return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, 2, NULL); + #endif + } + return __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2); +} +#endif +static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2){ + PyObject *args, *result = NULL; + if (unlikely(!cfunc->func && !cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL; +#if CYTHON_COMPILING_IN_CPYTHON + if (cfunc->func && (cfunc->flag & METH_VARARGS)) { + args = PyTuple_New(2); + if (unlikely(!args)) goto bad; + Py_INCREF(arg1); + PyTuple_SET_ITEM(args, 0, arg1); + Py_INCREF(arg2); + PyTuple_SET_ITEM(args, 1, arg2); + if (cfunc->flag & METH_KEYWORDS) + result = (*(PyCFunctionWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, NULL); + else + result = (*cfunc->func)(self, args); + } else { + args = PyTuple_New(3); + if (unlikely(!args)) goto bad; + Py_INCREF(self); + PyTuple_SET_ITEM(args, 0, self); + Py_INCREF(arg1); + PyTuple_SET_ITEM(args, 1, arg1); + Py_INCREF(arg2); + PyTuple_SET_ITEM(args, 2, arg2); + result = __Pyx_PyObject_Call(cfunc->method, args, NULL); + } +#else + args = PyTuple_Pack(3, self, arg1, arg2); + if (unlikely(!args)) goto bad; + result = __Pyx_PyObject_Call(cfunc->method, args, NULL); +#endif +bad: + Py_XDECREF(args); + return result; +} + +/* dict_getitem_default */ +static PyObject* __Pyx_PyDict_GetItemDefault(PyObject* d, PyObject* key, PyObject* default_value) { + PyObject* value; +#if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY + value = PyDict_GetItemWithError(d, key); + if (unlikely(!value)) { + if (unlikely(PyErr_Occurred())) + return NULL; + value = default_value; + } + Py_INCREF(value); + if ((1)); +#else + if (PyString_CheckExact(key) || PyUnicode_CheckExact(key) || PyInt_CheckExact(key)) { + value = PyDict_GetItem(d, key); + if (unlikely(!value)) { + value = default_value; + } + Py_INCREF(value); + } +#endif + else { + if (default_value == Py_None) + value = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PyDict_Type_get, d, key); + else + value = __Pyx_CallUnboundCMethod2(&__pyx_umethod_PyDict_Type_get, d, key, default_value); + } + return value; +} + +/* py_dict_pop */ +static CYTHON_INLINE PyObject *__Pyx_PyDict_Pop(PyObject *d, PyObject *key, PyObject *default_value) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX > 0x030600B3 + if ((1)) { + return _PyDict_Pop(d, key, default_value); + } else +#endif + if (default_value) { + return __Pyx_CallUnboundCMethod2(&__pyx_umethod_PyDict_Type_pop, d, key, default_value); + } else { + return __Pyx_CallUnboundCMethod1(&__pyx_umethod_PyDict_Type_pop, d, key); + } +} + +/* ArgTypeTest */ +static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact) +{ + if (unlikely(!type)) { + PyErr_SetString(PyExc_SystemError, "Missing type object"); + return 0; + } + else if (exact) { + #if PY_MAJOR_VERSION == 2 + if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1; + #endif + } + else { + if (likely(__Pyx_TypeCheck(obj, type))) return 1; + } + PyErr_Format(PyExc_TypeError, + "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)", + name, type->tp_name, Py_TYPE(obj)->tp_name); + return 0; +} + +/* FastTypeChecks */ +#if CYTHON_COMPILING_IN_CPYTHON +static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) { + while (a) { + a = a->tp_base; + if (a == b) + return 1; + } + return b == &PyBaseObject_Type; +} +static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) { + PyObject *mro; + if (a == b) return 1; + mro = a->tp_mro; + if (likely(mro)) { + Py_ssize_t i, n; + n = PyTuple_GET_SIZE(mro); + for (i = 0; i < n; i++) { + if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b) + return 1; + } + return 0; + } + return __Pyx_InBases(a, b); +} +#if PY_MAJOR_VERSION == 2 +static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { + PyObject *exception, *value, *tb; + int res; + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ErrFetch(&exception, &value, &tb); + res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; + if (unlikely(res == -1)) { + PyErr_WriteUnraisable(err); + res = 0; + } + if (!res) { + res = PyObject_IsSubclass(err, exc_type2); + if (unlikely(res == -1)) { + PyErr_WriteUnraisable(err); + res = 0; + } + } + __Pyx_ErrRestore(exception, value, tb); + return res; +} +#else +static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { + int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0; + if (!res) { + res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); + } + return res; +} +#endif +static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { + Py_ssize_t i, n; + assert(PyExceptionClass_Check(exc_type)); + n = PyTuple_GET_SIZE(tuple); +#if PY_MAJOR_VERSION >= 3 + for (i=0; i= 3 + "'%.50s' object has no attribute '%U'", + tp->tp_name, attr_name); +#else + "'%.50s' object has no attribute '%.400s'", + tp->tp_name, PyString_AS_STRING(attr_name)); +#endif + return NULL; +} +static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) { + PyObject *descr; + PyTypeObject *tp = Py_TYPE(obj); + if (unlikely(!PyString_Check(attr_name))) { + return PyObject_GenericGetAttr(obj, attr_name); + } + assert(!tp->tp_dictoffset); + descr = _PyType_Lookup(tp, attr_name); + if (unlikely(!descr)) { + return __Pyx_RaiseGenericGetAttributeError(tp, attr_name); + } + Py_INCREF(descr); + #if PY_MAJOR_VERSION < 3 + if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS))) + #endif + { + descrgetfunc f = Py_TYPE(descr)->tp_descr_get; + if (unlikely(f)) { + PyObject *res = f(descr, obj, (PyObject *)tp); + Py_DECREF(descr); + return res; + } + } + return descr; +} +#endif + +/* PyObject_GenericGetAttr */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) { + if (unlikely(Py_TYPE(obj)->tp_dictoffset)) { + return PyObject_GenericGetAttr(obj, attr_name); + } + return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name); +} +#endif + +/* SetVTable */ +static int __Pyx_SetVtable(PyObject *dict, void *vtable) { +#if PY_VERSION_HEX >= 0x02070000 + PyObject *ob = PyCapsule_New(vtable, 0, 0); +#else + PyObject *ob = PyCObject_FromVoidPtr(vtable, 0); +#endif + if (!ob) + goto bad; + if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0) + goto bad; + Py_DECREF(ob); + return 0; +bad: + Py_XDECREF(ob); + return -1; +} + +/* TypeImport */ +#ifndef __PYX_HAVE_RT_ImportType +#define __PYX_HAVE_RT_ImportType +static PyTypeObject *__Pyx_ImportType(PyObject *module, const char *module_name, const char *class_name, + size_t size, enum __Pyx_ImportType_CheckSize check_size) +{ + PyObject *result = 0; + char warning[200]; + Py_ssize_t basicsize; +#ifdef Py_LIMITED_API + PyObject *py_basicsize; +#endif + result = PyObject_GetAttrString(module, class_name); + if (!result) + goto bad; + if (!PyType_Check(result)) { + PyErr_Format(PyExc_TypeError, + "%.200s.%.200s is not a type object", + module_name, class_name); + goto bad; + } +#ifndef Py_LIMITED_API + basicsize = ((PyTypeObject *)result)->tp_basicsize; +#else + py_basicsize = PyObject_GetAttrString(result, "__basicsize__"); + if (!py_basicsize) + goto bad; + basicsize = PyLong_AsSsize_t(py_basicsize); + Py_DECREF(py_basicsize); + py_basicsize = 0; + if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred()) + goto bad; +#endif + if ((size_t)basicsize < size) { + PyErr_Format(PyExc_ValueError, + "%.200s.%.200s size changed, may indicate binary incompatibility. " + "Expected %zd from C header, got %zd from PyObject", + module_name, class_name, size, basicsize); + goto bad; + } + if (check_size == __Pyx_ImportType_CheckSize_Error && (size_t)basicsize != size) { + PyErr_Format(PyExc_ValueError, + "%.200s.%.200s size changed, may indicate binary incompatibility. " + "Expected %zd from C header, got %zd from PyObject", + module_name, class_name, size, basicsize); + goto bad; + } + else if (check_size == __Pyx_ImportType_CheckSize_Warn && (size_t)basicsize > size) { + PyOS_snprintf(warning, sizeof(warning), + "%s.%s size changed, may indicate binary incompatibility. " + "Expected %zd from C header, got %zd from PyObject", + module_name, class_name, size, basicsize); + if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad; + } + return (PyTypeObject *)result; +bad: + Py_XDECREF(result); + return NULL; +} +#endif + +/* ImportFrom */ +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { + PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); + if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_Format(PyExc_ImportError, + #if PY_MAJOR_VERSION < 3 + "cannot import name %.230s", PyString_AS_STRING(name)); + #else + "cannot import name %S", name); + #endif + } + return value; +} + +/* CalculateMetaclass */ +static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) { + Py_ssize_t i, nbases = PyTuple_GET_SIZE(bases); + for (i=0; i < nbases; i++) { + PyTypeObject *tmptype; + PyObject *tmp = PyTuple_GET_ITEM(bases, i); + tmptype = Py_TYPE(tmp); +#if PY_MAJOR_VERSION < 3 + if (tmptype == &PyClass_Type) + continue; +#endif + if (!metaclass) { + metaclass = tmptype; + continue; + } + if (PyType_IsSubtype(metaclass, tmptype)) + continue; + if (PyType_IsSubtype(tmptype, metaclass)) { + metaclass = tmptype; + continue; + } + PyErr_SetString(PyExc_TypeError, + "metaclass conflict: " + "the metaclass of a derived class " + "must be a (non-strict) subclass " + "of the metaclasses of all its bases"); + return NULL; + } + if (!metaclass) { +#if PY_MAJOR_VERSION < 3 + metaclass = &PyClass_Type; +#else + metaclass = &PyType_Type; +#endif + } + Py_INCREF((PyObject*) metaclass); + return (PyObject*) metaclass; +} + +/* Py3ClassCreate */ +static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, + PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) { + PyObject *ns; + if (metaclass) { + PyObject *prep = __Pyx_PyObject_GetAttrStr(metaclass, __pyx_n_s_prepare); + if (prep) { + PyObject *pargs = PyTuple_Pack(2, name, bases); + if (unlikely(!pargs)) { + Py_DECREF(prep); + return NULL; + } + ns = PyObject_Call(prep, pargs, mkw); + Py_DECREF(prep); + Py_DECREF(pargs); + } else { + if (unlikely(!PyErr_ExceptionMatches(PyExc_AttributeError))) + return NULL; + PyErr_Clear(); + ns = PyDict_New(); + } + } else { + ns = PyDict_New(); + } + if (unlikely(!ns)) + return NULL; + if (unlikely(PyObject_SetItem(ns, __pyx_n_s_module, modname) < 0)) goto bad; + if (unlikely(PyObject_SetItem(ns, __pyx_n_s_qualname, qualname) < 0)) goto bad; + if (unlikely(doc && PyObject_SetItem(ns, __pyx_n_s_doc, doc) < 0)) goto bad; + return ns; +bad: + Py_DECREF(ns); + return NULL; +} +static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, + PyObject *dict, PyObject *mkw, + int calculate_metaclass, int allow_py2_metaclass) { + PyObject *result, *margs; + PyObject *owned_metaclass = NULL; + if (allow_py2_metaclass) { + owned_metaclass = PyObject_GetItem(dict, __pyx_n_s_metaclass); + if (owned_metaclass) { + metaclass = owned_metaclass; + } else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) { + PyErr_Clear(); + } else { + return NULL; + } + } + if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) { + metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases); + Py_XDECREF(owned_metaclass); + if (unlikely(!metaclass)) + return NULL; + owned_metaclass = metaclass; + } + margs = PyTuple_Pack(3, name, bases, dict); + if (unlikely(!margs)) { + result = NULL; + } else { + result = PyObject_Call(metaclass, margs, mkw); + Py_DECREF(margs); + } + Py_XDECREF(owned_metaclass); + return result; +} + +/* FetchCommonType */ +static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { + PyObject* fake_module; + PyTypeObject* cached_type = NULL; + fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI); + if (!fake_module) return NULL; + Py_INCREF(fake_module); + cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name); + if (cached_type) { + if (!PyType_Check((PyObject*)cached_type)) { + PyErr_Format(PyExc_TypeError, + "Shared Cython type %.200s is not a type object", + type->tp_name); + goto bad; + } + if (cached_type->tp_basicsize != type->tp_basicsize) { + PyErr_Format(PyExc_TypeError, + "Shared Cython type %.200s has the wrong size, try recompiling", + type->tp_name); + goto bad; + } + } else { + if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; + PyErr_Clear(); + if (PyType_Ready(type) < 0) goto bad; + if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0) + goto bad; + Py_INCREF(type); + cached_type = type; + } +done: + Py_DECREF(fake_module); + return cached_type; +bad: + Py_XDECREF(cached_type); + cached_type = NULL; + goto done; +} + +/* CythonFunction */ +#include +static PyObject * +__Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure) +{ + if (unlikely(op->func_doc == NULL)) { + if (op->func.m_ml->ml_doc) { +#if PY_MAJOR_VERSION >= 3 + op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc); +#else + op->func_doc = PyString_FromString(op->func.m_ml->ml_doc); +#endif + if (unlikely(op->func_doc == NULL)) + return NULL; + } else { + Py_INCREF(Py_None); + return Py_None; + } + } + Py_INCREF(op->func_doc); + return op->func_doc; +} +static int +__Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context) +{ + PyObject *tmp = op->func_doc; + if (value == NULL) { + value = Py_None; + } + Py_INCREF(value); + op->func_doc = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + if (unlikely(op->func_name == NULL)) { +#if PY_MAJOR_VERSION >= 3 + op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name); +#else + op->func_name = PyString_InternFromString(op->func.m_ml->ml_name); +#endif + if (unlikely(op->func_name == NULL)) + return NULL; + } + Py_INCREF(op->func_name); + return op->func_name; +} +static int +__Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context) +{ + PyObject *tmp; +#if PY_MAJOR_VERSION >= 3 + if (unlikely(value == NULL || !PyUnicode_Check(value))) +#else + if (unlikely(value == NULL || !PyString_Check(value))) +#endif + { + PyErr_SetString(PyExc_TypeError, + "__name__ must be set to a string object"); + return -1; + } + tmp = op->func_name; + Py_INCREF(value); + op->func_name = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + Py_INCREF(op->func_qualname); + return op->func_qualname; +} +static int +__Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context) +{ + PyObject *tmp; +#if PY_MAJOR_VERSION >= 3 + if (unlikely(value == NULL || !PyUnicode_Check(value))) +#else + if (unlikely(value == NULL || !PyString_Check(value))) +#endif + { + PyErr_SetString(PyExc_TypeError, + "__qualname__ must be set to a string object"); + return -1; + } + tmp = op->func_qualname; + Py_INCREF(value); + op->func_qualname = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED void *closure) +{ + PyObject *self; + self = m->func_closure; + if (self == NULL) + self = Py_None; + Py_INCREF(self); + return self; +} +static PyObject * +__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + if (unlikely(op->func_dict == NULL)) { + op->func_dict = PyDict_New(); + if (unlikely(op->func_dict == NULL)) + return NULL; + } + Py_INCREF(op->func_dict); + return op->func_dict; +} +static int +__Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context) +{ + PyObject *tmp; + if (unlikely(value == NULL)) { + PyErr_SetString(PyExc_TypeError, + "function's dictionary may not be deleted"); + return -1; + } + if (unlikely(!PyDict_Check(value))) { + PyErr_SetString(PyExc_TypeError, + "setting function's dictionary to a non-dict"); + return -1; + } + tmp = op->func_dict; + Py_INCREF(value); + op->func_dict = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + Py_INCREF(op->func_globals); + return op->func_globals; +} +static PyObject * +__Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + Py_INCREF(Py_None); + return Py_None; +} +static PyObject * +__Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + PyObject* result = (op->func_code) ? op->func_code : Py_None; + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { + int result = 0; + PyObject *res = op->defaults_getter((PyObject *) op); + if (unlikely(!res)) + return -1; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + op->defaults_tuple = PyTuple_GET_ITEM(res, 0); + Py_INCREF(op->defaults_tuple); + op->defaults_kwdict = PyTuple_GET_ITEM(res, 1); + Py_INCREF(op->defaults_kwdict); + #else + op->defaults_tuple = PySequence_ITEM(res, 0); + if (unlikely(!op->defaults_tuple)) result = -1; + else { + op->defaults_kwdict = PySequence_ITEM(res, 1); + if (unlikely(!op->defaults_kwdict)) result = -1; + } + #endif + Py_DECREF(res); + return result; +} +static int +__Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) { + PyObject* tmp; + if (!value) { + value = Py_None; + } else if (value != Py_None && !PyTuple_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__defaults__ must be set to a tuple object"); + return -1; + } + Py_INCREF(value); + tmp = op->defaults_tuple; + op->defaults_tuple = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) { + PyObject* result = op->defaults_tuple; + if (unlikely(!result)) { + if (op->defaults_getter) { + if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL; + result = op->defaults_tuple; + } else { + result = Py_None; + } + } + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) { + PyObject* tmp; + if (!value) { + value = Py_None; + } else if (value != Py_None && !PyDict_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__kwdefaults__ must be set to a dict object"); + return -1; + } + Py_INCREF(value); + tmp = op->defaults_kwdict; + op->defaults_kwdict = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) { + PyObject* result = op->defaults_kwdict; + if (unlikely(!result)) { + if (op->defaults_getter) { + if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL; + result = op->defaults_kwdict; + } else { + result = Py_None; + } + } + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) { + PyObject* tmp; + if (!value || value == Py_None) { + value = NULL; + } else if (!PyDict_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__annotations__ must be set to a dict object"); + return -1; + } + Py_XINCREF(value); + tmp = op->func_annotations; + op->func_annotations = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) { + PyObject* result = op->func_annotations; + if (unlikely(!result)) { + result = PyDict_New(); + if (unlikely(!result)) return NULL; + op->func_annotations = result; + } + Py_INCREF(result); + return result; +} +static PyGetSetDef __pyx_CyFunction_getsets[] = { + {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, + {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, + {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, + {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, + {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, + {(char *) "__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0}, + {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, + {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, + {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, + {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, + {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, + {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, + {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, + {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, + {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, + {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, + {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, + {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, + {0, 0, 0, 0, 0} +}; +static PyMemberDef __pyx_CyFunction_members[] = { + {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), PY_WRITE_RESTRICTED, 0}, + {0, 0, 0, 0, 0} +}; +static PyObject * +__Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args) +{ +#if PY_MAJOR_VERSION >= 3 + return PyUnicode_FromString(m->func.m_ml->ml_name); +#else + return PyString_FromString(m->func.m_ml->ml_name); +#endif +} +static PyMethodDef __pyx_CyFunction_methods[] = { + {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, + {0, 0, 0, 0} +}; +#if PY_VERSION_HEX < 0x030500A0 +#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist) +#else +#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func.m_weakreflist) +#endif +static PyObject *__Pyx_CyFunction_New(PyTypeObject *type, PyMethodDef *ml, int flags, PyObject* qualname, + PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { + __pyx_CyFunctionObject *op = PyObject_GC_New(__pyx_CyFunctionObject, type); + if (op == NULL) + return NULL; + op->flags = flags; + __Pyx_CyFunction_weakreflist(op) = NULL; + op->func.m_ml = ml; + op->func.m_self = (PyObject *) op; + Py_XINCREF(closure); + op->func_closure = closure; + Py_XINCREF(module); + op->func.m_module = module; + op->func_dict = NULL; + op->func_name = NULL; + Py_INCREF(qualname); + op->func_qualname = qualname; + op->func_doc = NULL; + op->func_classobj = NULL; + op->func_globals = globals; + Py_INCREF(op->func_globals); + Py_XINCREF(code); + op->func_code = code; + op->defaults_pyobjects = 0; + op->defaults = NULL; + op->defaults_tuple = NULL; + op->defaults_kwdict = NULL; + op->defaults_getter = NULL; + op->func_annotations = NULL; + PyObject_GC_Track(op); + return (PyObject *) op; +} +static int +__Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) +{ + Py_CLEAR(m->func_closure); + Py_CLEAR(m->func.m_module); + Py_CLEAR(m->func_dict); + Py_CLEAR(m->func_name); + Py_CLEAR(m->func_qualname); + Py_CLEAR(m->func_doc); + Py_CLEAR(m->func_globals); + Py_CLEAR(m->func_code); + Py_CLEAR(m->func_classobj); + Py_CLEAR(m->defaults_tuple); + Py_CLEAR(m->defaults_kwdict); + Py_CLEAR(m->func_annotations); + if (m->defaults) { + PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); + int i; + for (i = 0; i < m->defaults_pyobjects; i++) + Py_XDECREF(pydefaults[i]); + PyObject_Free(m->defaults); + m->defaults = NULL; + } + return 0; +} +static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m) +{ + if (__Pyx_CyFunction_weakreflist(m) != NULL) + PyObject_ClearWeakRefs((PyObject *) m); + __Pyx_CyFunction_clear(m); + PyObject_GC_Del(m); +} +static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) +{ + PyObject_GC_UnTrack(m); + __Pyx__CyFunction_dealloc(m); +} +static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) +{ + Py_VISIT(m->func_closure); + Py_VISIT(m->func.m_module); + Py_VISIT(m->func_dict); + Py_VISIT(m->func_name); + Py_VISIT(m->func_qualname); + Py_VISIT(m->func_doc); + Py_VISIT(m->func_globals); + Py_VISIT(m->func_code); + Py_VISIT(m->func_classobj); + Py_VISIT(m->defaults_tuple); + Py_VISIT(m->defaults_kwdict); + if (m->defaults) { + PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); + int i; + for (i = 0; i < m->defaults_pyobjects; i++) + Py_VISIT(pydefaults[i]); + } + return 0; +} +static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type) +{ + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) { + Py_INCREF(func); + return func; + } + if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) { + if (type == NULL) + type = (PyObject *)(Py_TYPE(obj)); + return __Pyx_PyMethod_New(func, type, (PyObject *)(Py_TYPE(type))); + } + if (obj == Py_None) + obj = NULL; + return __Pyx_PyMethod_New(func, obj, type); +} +static PyObject* +__Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) +{ +#if PY_MAJOR_VERSION >= 3 + return PyUnicode_FromFormat("", + op->func_qualname, (void *)op); +#else + return PyString_FromFormat("", + PyString_AsString(op->func_qualname), (void *)op); +#endif +} +static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) { + PyCFunctionObject* f = (PyCFunctionObject*)func; + PyCFunction meth = f->m_ml->ml_meth; + Py_ssize_t size; + switch (f->m_ml->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) { + case METH_VARARGS: + if (likely(kw == NULL || PyDict_Size(kw) == 0)) + return (*meth)(self, arg); + break; + case METH_VARARGS | METH_KEYWORDS: + return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw); + case METH_NOARGS: + if (likely(kw == NULL || PyDict_Size(kw) == 0)) { + size = PyTuple_GET_SIZE(arg); + if (likely(size == 0)) + return (*meth)(self, NULL); + PyErr_Format(PyExc_TypeError, + "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", + f->m_ml->ml_name, size); + return NULL; + } + break; + case METH_O: + if (likely(kw == NULL || PyDict_Size(kw) == 0)) { + size = PyTuple_GET_SIZE(arg); + if (likely(size == 1)) { + PyObject *result, *arg0; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + arg0 = PyTuple_GET_ITEM(arg, 0); + #else + arg0 = PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL; + #endif + result = (*meth)(self, arg0); + #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) + Py_DECREF(arg0); + #endif + return result; + } + PyErr_Format(PyExc_TypeError, + "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", + f->m_ml->ml_name, size); + return NULL; + } + break; + default: + PyErr_SetString(PyExc_SystemError, "Bad call flags in " + "__Pyx_CyFunction_Call. METH_OLDARGS is no " + "longer supported!"); + return NULL; + } + PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", + f->m_ml->ml_name); + return NULL; +} +static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { + return __Pyx_CyFunction_CallMethod(func, ((PyCFunctionObject*)func)->m_self, arg, kw); +} +static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) { + PyObject *result; + __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func; + if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { + Py_ssize_t argc; + PyObject *new_args; + PyObject *self; + argc = PyTuple_GET_SIZE(args); + new_args = PyTuple_GetSlice(args, 1, argc); + if (unlikely(!new_args)) + return NULL; + self = PyTuple_GetItem(args, 0); + if (unlikely(!self)) { + Py_DECREF(new_args); + return NULL; + } + result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw); + Py_DECREF(new_args); + } else { + result = __Pyx_CyFunction_Call(func, args, kw); + } + return result; +} +static PyTypeObject __pyx_CyFunctionType_type = { + PyVarObject_HEAD_INIT(0, 0) + "cython_function_or_method", + sizeof(__pyx_CyFunctionObject), + 0, + (destructor) __Pyx_CyFunction_dealloc, + 0, + 0, + 0, +#if PY_MAJOR_VERSION < 3 + 0, +#else + 0, +#endif + (reprfunc) __Pyx_CyFunction_repr, + 0, + 0, + 0, + 0, + __Pyx_CyFunction_CallAsMethod, + 0, + 0, + 0, + 0, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, + 0, + (traverseproc) __Pyx_CyFunction_traverse, + (inquiry) __Pyx_CyFunction_clear, + 0, +#if PY_VERSION_HEX < 0x030500A0 + offsetof(__pyx_CyFunctionObject, func_weakreflist), +#else + offsetof(PyCFunctionObject, m_weakreflist), +#endif + 0, + 0, + __pyx_CyFunction_methods, + __pyx_CyFunction_members, + __pyx_CyFunction_getsets, + 0, + 0, + __Pyx_CyFunction_descr_get, + 0, + offsetof(__pyx_CyFunctionObject, func_dict), + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, +#if PY_VERSION_HEX >= 0x030400a1 + 0, +#endif +}; +static int __pyx_CyFunction_init(void) { + __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); + if (unlikely(__pyx_CyFunctionType == NULL)) { + return -1; + } + return 0; +} +static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults = PyObject_Malloc(size); + if (unlikely(!m->defaults)) + return PyErr_NoMemory(); + memset(m->defaults, 0, size); + m->defaults_pyobjects = pyobjects; + return m->defaults; +} +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults_tuple = tuple; + Py_INCREF(tuple); +} +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults_kwdict = dict; + Py_INCREF(dict); +} +static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->func_annotations = dict; + Py_INCREF(dict); +} + +/* CLineInTraceback */ +#ifndef CYTHON_CLINE_IN_TRACEBACK +static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { + PyObject *use_cline; + PyObject *ptype, *pvalue, *ptraceback; +#if CYTHON_COMPILING_IN_CPYTHON + PyObject **cython_runtime_dict; +#endif + if (unlikely(!__pyx_cython_runtime)) { + return c_line; + } + __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); +#if CYTHON_COMPILING_IN_CPYTHON + cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); + if (likely(cython_runtime_dict)) { + __PYX_PY_DICT_LOOKUP_IF_MODIFIED( + use_cline, *cython_runtime_dict, + __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback)) + } else +#endif + { + PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback); + if (use_cline_obj) { + use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; + Py_DECREF(use_cline_obj); + } else { + PyErr_Clear(); + use_cline = NULL; + } + } + if (!use_cline) { + c_line = 0; + PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); + } + else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { + c_line = 0; + } + __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); + return c_line; +} +#endif + +/* CodeObjectCache */ +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { + int start = 0, mid = 0, end = count - 1; + if (end >= 0 && code_line > entries[end].code_line) { + return count; + } + while (start < end) { + mid = start + (end - start) / 2; + if (code_line < entries[mid].code_line) { + end = mid; + } else if (code_line > entries[mid].code_line) { + start = mid + 1; + } else { + return mid; + } + } + if (code_line <= entries[mid].code_line) { + return mid; + } else { + return mid + 1; + } +} +static PyCodeObject *__pyx_find_code_object(int code_line) { + PyCodeObject* code_object; + int pos; + if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { + return NULL; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { + return NULL; + } + code_object = __pyx_code_cache.entries[pos].code_object; + Py_INCREF(code_object); + return code_object; +} +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { + int pos, i; + __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; + if (unlikely(!code_line)) { + return; + } + if (unlikely(!entries)) { + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); + if (likely(entries)) { + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = 64; + __pyx_code_cache.count = 1; + entries[0].code_line = code_line; + entries[0].code_object = code_object; + Py_INCREF(code_object); + } + return; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { + PyCodeObject* tmp = entries[pos].code_object; + entries[pos].code_object = code_object; + Py_DECREF(tmp); + return; + } + if (__pyx_code_cache.count == __pyx_code_cache.max_count) { + int new_max = __pyx_code_cache.max_count + 64; + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( + __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry)); + if (unlikely(!entries)) { + return; + } + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = new_max; + } + for (i=__pyx_code_cache.count; i>pos; i--) { + entries[i] = entries[i-1]; + } + entries[pos].code_line = code_line; + entries[pos].code_object = code_object; + __pyx_code_cache.count++; + Py_INCREF(code_object); +} + +/* AddTraceback */ +#include "compile.h" +#include "frameobject.h" +#include "traceback.h" +static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( + const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyObject *py_srcfile = 0; + PyObject *py_funcname = 0; + #if PY_MAJOR_VERSION < 3 + py_srcfile = PyString_FromString(filename); + #else + py_srcfile = PyUnicode_FromString(filename); + #endif + if (!py_srcfile) goto bad; + if (c_line) { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + #else + py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + #endif + } + else { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromString(funcname); + #else + py_funcname = PyUnicode_FromString(funcname); + #endif + } + if (!py_funcname) goto bad; + py_code = __Pyx_PyCode_New( + 0, + 0, + 0, + 0, + 0, + __pyx_empty_bytes, /*PyObject *code,*/ + __pyx_empty_tuple, /*PyObject *consts,*/ + __pyx_empty_tuple, /*PyObject *names,*/ + __pyx_empty_tuple, /*PyObject *varnames,*/ + __pyx_empty_tuple, /*PyObject *freevars,*/ + __pyx_empty_tuple, /*PyObject *cellvars,*/ + py_srcfile, /*PyObject *filename,*/ + py_funcname, /*PyObject *name,*/ + py_line, + __pyx_empty_bytes /*PyObject *lnotab*/ + ); + Py_DECREF(py_srcfile); + Py_DECREF(py_funcname); + return py_code; +bad: + Py_XDECREF(py_srcfile); + Py_XDECREF(py_funcname); + return NULL; +} +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyFrameObject *py_frame = 0; + PyThreadState *tstate = __Pyx_PyThreadState_Current; + if (c_line) { + c_line = __Pyx_CLineForTraceback(tstate, c_line); + } + py_code = __pyx_find_code_object(c_line ? -c_line : py_line); + if (!py_code) { + py_code = __Pyx_CreateCodeObjectForTraceback( + funcname, c_line, py_line, filename); + if (!py_code) goto bad; + __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); + } + py_frame = PyFrame_New( + tstate, /*PyThreadState *tstate,*/ + py_code, /*PyCodeObject *code,*/ + __pyx_d, /*PyObject *globals,*/ + 0 /*PyObject *locals*/ + ); + if (!py_frame) goto bad; + __Pyx_PyFrame_SetLineNumber(py_frame, py_line); + PyTraceBack_Here(py_frame); +bad: + Py_XDECREF(py_code); + Py_XDECREF(py_frame); +} + +/* CIntToPy */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { + const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(long) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(long) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(long) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(long), + little, !is_unsigned); + } +} + +/* CIntToPy */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { + const int neg_one = (int) ((int) 0 - (int) 1), const_zero = (int) 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(int) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(int) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(int) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(int), + little, !is_unsigned); + } +} + +/* CIntFromPyVerify */ +#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ + __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) +#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ + __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) +#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ + {\ + func_type value = func_value;\ + if (sizeof(target_type) < sizeof(func_type)) {\ + if (unlikely(value != (func_type) (target_type) value)) {\ + func_type zero = 0;\ + if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ + return (target_type) -1;\ + if (is_unsigned && unlikely(value < zero))\ + goto raise_neg_overflow;\ + else\ + goto raise_overflow;\ + }\ + }\ + return (target_type) value;\ + } + +/* CIntFromPy */ +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { + const int neg_one = (int) ((int) 0 - (int) 1), const_zero = (int) 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(int) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (int) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (int) 0; + case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0]) + case 2: + if (8 * sizeof(int) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) { + return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + case 3: + if (8 * sizeof(int) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) { + return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + case 4: + if (8 * sizeof(int) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) { + return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (int) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if (sizeof(int) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (int) 0; + case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0])) + case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0]) + case -2: + if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { + return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 2: + if (8 * sizeof(int) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { + return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case -3: + if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { + return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 3: + if (8 * sizeof(int) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { + return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case -4: + if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { + return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 4: + if (8 * sizeof(int) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { + return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + } +#endif + if (sizeof(int) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + int val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (int) -1; + } + } else { + int val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (int) -1; + val = __Pyx_PyInt_As_int(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to int"); + return (int) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to int"); + return (int) -1; +} + +/* CIntFromPy */ +static CYTHON_INLINE unsigned short __Pyx_PyInt_As_unsigned_short(PyObject *x) { + const unsigned short neg_one = (unsigned short) ((unsigned short) 0 - (unsigned short) 1), const_zero = (unsigned short) 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(unsigned short) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(unsigned short, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (unsigned short) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (unsigned short) 0; + case 1: __PYX_VERIFY_RETURN_INT(unsigned short, digit, digits[0]) + case 2: + if (8 * sizeof(unsigned short) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(unsigned short, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(unsigned short) >= 2 * PyLong_SHIFT) { + return (unsigned short) (((((unsigned short)digits[1]) << PyLong_SHIFT) | (unsigned short)digits[0])); + } + } + break; + case 3: + if (8 * sizeof(unsigned short) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(unsigned short, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(unsigned short) >= 3 * PyLong_SHIFT) { + return (unsigned short) (((((((unsigned short)digits[2]) << PyLong_SHIFT) | (unsigned short)digits[1]) << PyLong_SHIFT) | (unsigned short)digits[0])); + } + } + break; + case 4: + if (8 * sizeof(unsigned short) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(unsigned short, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(unsigned short) >= 4 * PyLong_SHIFT) { + return (unsigned short) (((((((((unsigned short)digits[3]) << PyLong_SHIFT) | (unsigned short)digits[2]) << PyLong_SHIFT) | (unsigned short)digits[1]) << PyLong_SHIFT) | (unsigned short)digits[0])); + } + } + break; + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (unsigned short) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if (sizeof(unsigned short) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(unsigned short, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(unsigned short) <= sizeof(unsigned PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(unsigned short, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (unsigned short) 0; + case -1: __PYX_VERIFY_RETURN_INT(unsigned short, sdigit, (sdigit) (-(sdigit)digits[0])) + case 1: __PYX_VERIFY_RETURN_INT(unsigned short, digit, +digits[0]) + case -2: + if (8 * sizeof(unsigned short) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(unsigned short, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(unsigned short) - 1 > 2 * PyLong_SHIFT) { + return (unsigned short) (((unsigned short)-1)*(((((unsigned short)digits[1]) << PyLong_SHIFT) | (unsigned short)digits[0]))); + } + } + break; + case 2: + if (8 * sizeof(unsigned short) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(unsigned short, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(unsigned short) - 1 > 2 * PyLong_SHIFT) { + return (unsigned short) ((((((unsigned short)digits[1]) << PyLong_SHIFT) | (unsigned short)digits[0]))); + } + } + break; + case -3: + if (8 * sizeof(unsigned short) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(unsigned short, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(unsigned short) - 1 > 3 * PyLong_SHIFT) { + return (unsigned short) (((unsigned short)-1)*(((((((unsigned short)digits[2]) << PyLong_SHIFT) | (unsigned short)digits[1]) << PyLong_SHIFT) | (unsigned short)digits[0]))); + } + } + break; + case 3: + if (8 * sizeof(unsigned short) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(unsigned short, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(unsigned short) - 1 > 3 * PyLong_SHIFT) { + return (unsigned short) ((((((((unsigned short)digits[2]) << PyLong_SHIFT) | (unsigned short)digits[1]) << PyLong_SHIFT) | (unsigned short)digits[0]))); + } + } + break; + case -4: + if (8 * sizeof(unsigned short) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(unsigned short, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(unsigned short) - 1 > 4 * PyLong_SHIFT) { + return (unsigned short) (((unsigned short)-1)*(((((((((unsigned short)digits[3]) << PyLong_SHIFT) | (unsigned short)digits[2]) << PyLong_SHIFT) | (unsigned short)digits[1]) << PyLong_SHIFT) | (unsigned short)digits[0]))); + } + } + break; + case 4: + if (8 * sizeof(unsigned short) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(unsigned short, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(unsigned short) - 1 > 4 * PyLong_SHIFT) { + return (unsigned short) ((((((((((unsigned short)digits[3]) << PyLong_SHIFT) | (unsigned short)digits[2]) << PyLong_SHIFT) | (unsigned short)digits[1]) << PyLong_SHIFT) | (unsigned short)digits[0]))); + } + } + break; + } +#endif + if (sizeof(unsigned short) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(unsigned short, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(unsigned short) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(unsigned short, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + unsigned short val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (unsigned short) -1; + } + } else { + unsigned short val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (unsigned short) -1; + val = __Pyx_PyInt_As_unsigned_short(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to unsigned short"); + return (unsigned short) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to unsigned short"); + return (unsigned short) -1; +} + +/* CIntFromPy */ +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { + const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(long) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (long) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (long) 0; + case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0]) + case 2: + if (8 * sizeof(long) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) { + return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + case 3: + if (8 * sizeof(long) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) { + return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + case 4: + if (8 * sizeof(long) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) { + return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (long) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if (sizeof(long) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (long) 0; + case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0])) + case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0]) + case -2: + if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 2: + if (8 * sizeof(long) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case -3: + if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 3: + if (8 * sizeof(long) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case -4: + if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 4: + if (8 * sizeof(long) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + } +#endif + if (sizeof(long) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + long val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (long) -1; + } + } else { + long val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (long) -1; + val = __Pyx_PyInt_As_long(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to long"); + return (long) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to long"); + return (long) -1; +} + +/* CheckBinaryVersion */ +static int __Pyx_check_binary_version(void) { + char ctversion[4], rtversion[4]; + PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION); + PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion()); + if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) { + char message[200]; + PyOS_snprintf(message, sizeof(message), + "compiletime version %s of module '%.100s' " + "does not match runtime version %s", + ctversion, __Pyx_MODULE_NAME, rtversion); + return PyErr_WarnEx(NULL, message, 1); + } + return 0; +} + +/* InitStrings */ +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { + while (t->p) { + #if PY_MAJOR_VERSION < 3 + if (t->is_unicode) { + *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); + } else if (t->intern) { + *t->p = PyString_InternFromString(t->s); + } else { + *t->p = PyString_FromStringAndSize(t->s, t->n - 1); + } + #else + if (t->is_unicode | t->is_str) { + if (t->intern) { + *t->p = PyUnicode_InternFromString(t->s); + } else if (t->encoding) { + *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); + } else { + *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); + } + } else { + *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); + } + #endif + if (!*t->p) + return -1; + if (PyObject_Hash(*t->p) == -1) + return -1; + ++t; + } + return 0; +} + +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { + return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); +} +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { + Py_ssize_t ignore; + return __Pyx_PyObject_AsStringAndSize(o, &ignore); +} +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +#if !CYTHON_PEP393_ENABLED +static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { + char* defenc_c; + PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); + if (!defenc) return NULL; + defenc_c = PyBytes_AS_STRING(defenc); +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + { + char* end = defenc_c + PyBytes_GET_SIZE(defenc); + char* c; + for (c = defenc_c; c < end; c++) { + if ((unsigned char) (*c) >= 128) { + PyUnicode_AsASCIIString(o); + return NULL; + } + } + } +#endif + *length = PyBytes_GET_SIZE(defenc); + return defenc_c; +} +#else +static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { + if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + if (likely(PyUnicode_IS_ASCII(o))) { + *length = PyUnicode_GET_LENGTH(o); + return PyUnicode_AsUTF8(o); + } else { + PyUnicode_AsASCIIString(o); + return NULL; + } +#else + return PyUnicode_AsUTF8AndSize(o, length); +#endif +} +#endif +#endif +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT + if ( +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + __Pyx_sys_getdefaultencoding_not_ascii && +#endif + PyUnicode_Check(o)) { + return __Pyx_PyUnicode_AsStringAndSize(o, length); + } else +#endif +#if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) + if (PyByteArray_Check(o)) { + *length = PyByteArray_GET_SIZE(o); + return PyByteArray_AS_STRING(o); + } else +#endif + { + char* result; + int r = PyBytes_AsStringAndSize(o, &result, length); + if (unlikely(r < 0)) { + return NULL; + } else { + return result; + } + } +} +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { + int is_true = x == Py_True; + if (is_true | (x == Py_False) | (x == Py_None)) return is_true; + else return PyObject_IsTrue(x); +} +static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) { + int retval; + if (unlikely(!x)) return -1; + retval = __Pyx_PyObject_IsTrue(x); + Py_DECREF(x); + return retval; +} +static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) { +#if PY_MAJOR_VERSION >= 3 + if (PyLong_Check(result)) { + if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, + "__int__ returned non-int (type %.200s). " + "The ability to return an instance of a strict subclass of int " + "is deprecated, and may be removed in a future version of Python.", + Py_TYPE(result)->tp_name)) { + Py_DECREF(result); + return NULL; + } + return result; + } +#endif + PyErr_Format(PyExc_TypeError, + "__%.4s__ returned non-%.4s (type %.200s)", + type_name, type_name, Py_TYPE(result)->tp_name); + Py_DECREF(result); + return NULL; +} +static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { +#if CYTHON_USE_TYPE_SLOTS + PyNumberMethods *m; +#endif + const char *name = NULL; + PyObject *res = NULL; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x) || PyLong_Check(x))) +#else + if (likely(PyLong_Check(x))) +#endif + return __Pyx_NewRef(x); +#if CYTHON_USE_TYPE_SLOTS + m = Py_TYPE(x)->tp_as_number; + #if PY_MAJOR_VERSION < 3 + if (m && m->nb_int) { + name = "int"; + res = m->nb_int(x); + } + else if (m && m->nb_long) { + name = "long"; + res = m->nb_long(x); + } + #else + if (likely(m && m->nb_int)) { + name = "int"; + res = m->nb_int(x); + } + #endif +#else + if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { + res = PyNumber_Int(x); + } +#endif + if (likely(res)) { +#if PY_MAJOR_VERSION < 3 + if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) { +#else + if (unlikely(!PyLong_CheckExact(res))) { +#endif + return __Pyx_PyNumber_IntOrLongWrongResultType(res, name); + } + } + else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_TypeError, + "an integer is required"); + } + return res; +} +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { + Py_ssize_t ival; + PyObject *x; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_CheckExact(b))) { + if (sizeof(Py_ssize_t) >= sizeof(long)) + return PyInt_AS_LONG(b); + else + return PyInt_AsSsize_t(b); + } +#endif + if (likely(PyLong_CheckExact(b))) { + #if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)b)->ob_digit; + const Py_ssize_t size = Py_SIZE(b); + if (likely(__Pyx_sst_abs(size) <= 1)) { + ival = likely(size) ? digits[0] : 0; + if (size == -1) ival = -ival; + return ival; + } else { + switch (size) { + case 2: + if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { + return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -2: + if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case 3: + if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { + return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -3: + if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case 4: + if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { + return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -4: + if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + } + } + #endif + return PyLong_AsSsize_t(b); + } + x = PyNumber_Index(b); + if (!x) return -1; + ival = PyInt_AsSsize_t(x); + Py_DECREF(x); + return ival; +} +static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) { + return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False); +} +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { + return PyInt_FromSize_t(ival); +} + + +#endif /* Py_PYTHON_H */ diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/resolver/cares.cp37-win32.pyd b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/resolver/cares.cp37-win32.pyd new file mode 100644 index 0000000000000000000000000000000000000000..9e1580ff31123ab63464a5b462df2f085d545179 GIT binary patch literal 154624 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 literal 0 HcmV?d00001 diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/resolver/cares.html b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/resolver/cares.html new file mode 100644 index 00000000..bf9fc11d --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/resolver/cares.html @@ -0,0 +1,6049 @@ + + + + + + Cython: cares.pyx + + + +

Generated by Cython 0.29.2

+

+ Yellow lines hint at Python interaction.
+ Click on a line that starts with a "+" to see the C code that Cython generated for it. +

+

Raw output: cares.c

+
 001: # Copyright (c) 2011-2012 Denis Bilenko. See LICENSE for details.
+
 002: # Automatic pickling of cdef classes was added in 0.26. Unfortunately it
+
 003: # seems to be buggy (at least for the `result` class) and produces code that
+
 004: # can't compile ("local variable 'result' referenced before assignment").
+
 005: # See https://github.com/cython/cython/issues/1786
+
 006: # cython: auto_pickle=False
+
 007: cimport libcares as cares
+
+008: import sys
+
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_sys, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 8, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_sys, __pyx_t_1) < 0) __PYX_ERR(0, 8, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 009: 
+
 010: from cpython.ref cimport Py_INCREF
+
 011: from cpython.ref cimport Py_DECREF
+
 012: from cpython.mem cimport PyMem_Malloc
+
 013: from cpython.mem cimport PyMem_Free
+
 014: 
+
+015: from _socket import gaierror
+
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 15, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(__pyx_n_s_gaierror);
+  __Pyx_GIVEREF(__pyx_n_s_gaierror);
+  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_gaierror);
+  __pyx_t_2 = __Pyx_Import(__pyx_n_s_socket, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 15, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_gaierror); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 15, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_gaierror, __pyx_t_1) < 0) __PYX_ERR(0, 15, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
 016: 
+
 017: 
+
+018: __all__ = ['channel']
+
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 18, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_channel);
+  __Pyx_GIVEREF(__pyx_n_s_channel);
+  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_channel);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_all, __pyx_t_2) < 0) __PYX_ERR(0, 18, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
 019: 
+
 020: cdef object string_types
+
 021: cdef object text_type
+
 022: 
+
+023: if sys.version_info[0] >= 3:
+
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_sys); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 23, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_version_info); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 23, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 23, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_int_3, Py_GE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 23, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 23, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  if (__pyx_t_3) {
+/* … */
+    goto __pyx_L2;
+  }
+
+024:     string_types = str,
+
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 24, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_INCREF(((PyObject *)(&PyString_Type)));
+    __Pyx_GIVEREF(((PyObject *)(&PyString_Type)));
+    PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)(&PyString_Type)));
+    __Pyx_XGOTREF(__pyx_v_6gevent_8resolver_5cares_string_types);
+    __Pyx_DECREF_SET(__pyx_v_6gevent_8resolver_5cares_string_types, __pyx_t_1);
+    __Pyx_GIVEREF(__pyx_t_1);
+    __pyx_t_1 = 0;
+
+025:     text_type = str
+
    __Pyx_INCREF(((PyObject *)(&PyString_Type)));
+    __Pyx_XGOTREF(__pyx_v_6gevent_8resolver_5cares_text_type);
+    __Pyx_DECREF_SET(__pyx_v_6gevent_8resolver_5cares_text_type, ((PyObject *)(&PyString_Type)));
+    __Pyx_GIVEREF(((PyObject *)(&PyString_Type)));
+
 026: else:
+
+027:     string_types = __builtins__.basestring,
+
  /*else*/ {
+    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_builtins); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 27, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_basestring); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 27, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 27, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_GIVEREF(__pyx_t_2);
+    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
+    __pyx_t_2 = 0;
+    __Pyx_XGOTREF(__pyx_v_6gevent_8resolver_5cares_string_types);
+    __Pyx_DECREF_SET(__pyx_v_6gevent_8resolver_5cares_string_types, __pyx_t_1);
+    __Pyx_GIVEREF(__pyx_t_1);
+    __pyx_t_1 = 0;
+
+028:     text_type = __builtins__.unicode
+
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_builtins); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 28, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 28, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __Pyx_XGOTREF(__pyx_v_6gevent_8resolver_5cares_text_type);
+    __Pyx_DECREF_SET(__pyx_v_6gevent_8resolver_5cares_text_type, __pyx_t_2);
+    __Pyx_GIVEREF(__pyx_t_2);
+    __pyx_t_2 = 0;
+  }
+  __pyx_L2:;
+
 029: 
+
+030: TIMEOUT = 1
+
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_TIMEOUT, __pyx_int_1) < 0) __PYX_ERR(0, 30, __pyx_L1_error)
+
 031: 
+
 032: DEF EV_READ = 1
+
 033: DEF EV_WRITE = 2
+
 034: 
+
 035: 
+
 036: cdef extern from "dnshelper.c":
+
 037:     int AF_INET
+
 038:     int AF_INET6
+
 039: 
+
 040:     struct hostent:
+
 041:         char* h_name
+
 042:         int h_addrtype
+
 043: 
+
 044:     struct sockaddr_t "sockaddr":
+
 045:         pass
+
 046: 
+
 047:     struct ares_channeldata:
+
 048:         pass
+
 049: 
+
 050:     object parse_h_name(hostent*)
+
 051:     object parse_h_aliases(hostent*)
+
 052:     object parse_h_addr_list(hostent*)
+
 053:     void* create_object_from_hostent(void*)
+
 054: 
+
 055:     # this imports _socket lazily
+
 056:     object PyUnicode_FromString(char*)
+
 057:     int PyTuple_Check(object)
+
 058:     int PyArg_ParseTuple(object, char*, ...) except 0
+
 059:     struct sockaddr_in6:
+
 060:         pass
+
 061:     int gevent_make_sockaddr(char* hostp, int port, int flowinfo, int scope_id, sockaddr_in6* sa6)
+
 062: 
+
 063: 
+
 064:     void memset(void*, int, int)
+
 065: 
+
 066: 
+
+067: ARES_SUCCESS = cares.ARES_SUCCESS
+
  __pyx_t_2 = __Pyx_PyInt_From_int(ARES_SUCCESS); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 67, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARES_SUCCESS, __pyx_t_2) < 0) __PYX_ERR(0, 67, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+068: ARES_ENODATA = cares.ARES_ENODATA
+
  __pyx_t_2 = __Pyx_PyInt_From_int(ARES_ENODATA); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 68, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARES_ENODATA, __pyx_t_2) < 0) __PYX_ERR(0, 68, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+069: ARES_EFORMERR = cares.ARES_EFORMERR
+
  __pyx_t_2 = __Pyx_PyInt_From_int(ARES_EFORMERR); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 69, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARES_EFORMERR, __pyx_t_2) < 0) __PYX_ERR(0, 69, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+070: ARES_ESERVFAIL = cares.ARES_ESERVFAIL
+
  __pyx_t_2 = __Pyx_PyInt_From_int(ARES_ESERVFAIL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 70, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARES_ESERVFAIL, __pyx_t_2) < 0) __PYX_ERR(0, 70, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+071: ARES_ENOTFOUND = cares.ARES_ENOTFOUND
+
  __pyx_t_2 = __Pyx_PyInt_From_int(ARES_ENOTFOUND); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 71, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARES_ENOTFOUND, __pyx_t_2) < 0) __PYX_ERR(0, 71, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+072: ARES_ENOTIMP = cares.ARES_ENOTIMP
+
  __pyx_t_2 = __Pyx_PyInt_From_int(ARES_ENOTIMP); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 72, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARES_ENOTIMP, __pyx_t_2) < 0) __PYX_ERR(0, 72, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+073: ARES_EREFUSED = cares.ARES_EREFUSED
+
  __pyx_t_2 = __Pyx_PyInt_From_int(ARES_EREFUSED); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 73, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARES_EREFUSED, __pyx_t_2) < 0) __PYX_ERR(0, 73, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+074: ARES_EBADQUERY = cares.ARES_EBADQUERY
+
  __pyx_t_2 = __Pyx_PyInt_From_int(ARES_EBADQUERY); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 74, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARES_EBADQUERY, __pyx_t_2) < 0) __PYX_ERR(0, 74, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+075: ARES_EBADNAME = cares.ARES_EBADNAME
+
  __pyx_t_2 = __Pyx_PyInt_From_int(ARES_EBADNAME); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 75, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARES_EBADNAME, __pyx_t_2) < 0) __PYX_ERR(0, 75, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+076: ARES_EBADFAMILY = cares.ARES_EBADFAMILY
+
  __pyx_t_2 = __Pyx_PyInt_From_int(ARES_EBADFAMILY); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 76, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARES_EBADFAMILY, __pyx_t_2) < 0) __PYX_ERR(0, 76, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+077: ARES_EBADRESP = cares.ARES_EBADRESP
+
  __pyx_t_2 = __Pyx_PyInt_From_int(ARES_EBADRESP); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 77, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARES_EBADRESP, __pyx_t_2) < 0) __PYX_ERR(0, 77, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+078: ARES_ECONNREFUSED = cares.ARES_ECONNREFUSED
+
  __pyx_t_2 = __Pyx_PyInt_From_int(ARES_ECONNREFUSED); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 78, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARES_ECONNREFUSED, __pyx_t_2) < 0) __PYX_ERR(0, 78, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+079: ARES_ETIMEOUT = cares.ARES_ETIMEOUT
+
  __pyx_t_2 = __Pyx_PyInt_From_int(ARES_ETIMEOUT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 79, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARES_ETIMEOUT, __pyx_t_2) < 0) __PYX_ERR(0, 79, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+080: ARES_EOF = cares.ARES_EOF
+
  __pyx_t_2 = __Pyx_PyInt_From_int(ARES_EOF); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 80, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARES_EOF, __pyx_t_2) < 0) __PYX_ERR(0, 80, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+081: ARES_EFILE = cares.ARES_EFILE
+
  __pyx_t_2 = __Pyx_PyInt_From_int(ARES_EFILE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 81, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARES_EFILE, __pyx_t_2) < 0) __PYX_ERR(0, 81, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+082: ARES_ENOMEM = cares.ARES_ENOMEM
+
  __pyx_t_2 = __Pyx_PyInt_From_int(ARES_ENOMEM); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 82, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARES_ENOMEM, __pyx_t_2) < 0) __PYX_ERR(0, 82, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+083: ARES_EDESTRUCTION = cares.ARES_EDESTRUCTION
+
  __pyx_t_2 = __Pyx_PyInt_From_int(ARES_EDESTRUCTION); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 83, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARES_EDESTRUCTION, __pyx_t_2) < 0) __PYX_ERR(0, 83, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+084: ARES_EBADSTR = cares.ARES_EBADSTR
+
  __pyx_t_2 = __Pyx_PyInt_From_int(ARES_EBADSTR); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 84, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARES_EBADSTR, __pyx_t_2) < 0) __PYX_ERR(0, 84, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+085: ARES_EBADFLAGS = cares.ARES_EBADFLAGS
+
  __pyx_t_2 = __Pyx_PyInt_From_int(ARES_EBADFLAGS); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 85, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARES_EBADFLAGS, __pyx_t_2) < 0) __PYX_ERR(0, 85, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+086: ARES_ENONAME = cares.ARES_ENONAME
+
  __pyx_t_2 = __Pyx_PyInt_From_int(ARES_ENONAME); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 86, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARES_ENONAME, __pyx_t_2) < 0) __PYX_ERR(0, 86, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+087: ARES_EBADHINTS = cares.ARES_EBADHINTS
+
  __pyx_t_2 = __Pyx_PyInt_From_int(ARES_EBADHINTS); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 87, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARES_EBADHINTS, __pyx_t_2) < 0) __PYX_ERR(0, 87, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+088: ARES_ENOTINITIALIZED = cares.ARES_ENOTINITIALIZED
+
  __pyx_t_2 = __Pyx_PyInt_From_int(ARES_ENOTINITIALIZED); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 88, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARES_ENOTINITIALIZED, __pyx_t_2) < 0) __PYX_ERR(0, 88, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+089: ARES_ELOADIPHLPAPI = cares.ARES_ELOADIPHLPAPI
+
  __pyx_t_2 = __Pyx_PyInt_From_int(ARES_ELOADIPHLPAPI); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 89, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARES_ELOADIPHLPAPI, __pyx_t_2) < 0) __PYX_ERR(0, 89, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+090: ARES_EADDRGETNETWORKPARAMS = cares.ARES_EADDRGETNETWORKPARAMS
+
  __pyx_t_2 = __Pyx_PyInt_From_int(ARES_EADDRGETNETWORKPARAMS); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 90, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARES_EADDRGETNETWORKPARAMS, __pyx_t_2) < 0) __PYX_ERR(0, 90, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+091: ARES_ECANCELLED = cares.ARES_ECANCELLED
+
  __pyx_t_2 = __Pyx_PyInt_From_int(ARES_ECANCELLED); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 91, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARES_ECANCELLED, __pyx_t_2) < 0) __PYX_ERR(0, 91, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
 092: 
+
+093: ARES_FLAG_USEVC = cares.ARES_FLAG_USEVC
+
  __pyx_t_2 = __Pyx_PyInt_From_int(ARES_FLAG_USEVC); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 93, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARES_FLAG_USEVC, __pyx_t_2) < 0) __PYX_ERR(0, 93, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+094: ARES_FLAG_PRIMARY = cares.ARES_FLAG_PRIMARY
+
  __pyx_t_2 = __Pyx_PyInt_From_int(ARES_FLAG_PRIMARY); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 94, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARES_FLAG_PRIMARY, __pyx_t_2) < 0) __PYX_ERR(0, 94, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+095: ARES_FLAG_IGNTC = cares.ARES_FLAG_IGNTC
+
  __pyx_t_2 = __Pyx_PyInt_From_int(ARES_FLAG_IGNTC); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 95, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARES_FLAG_IGNTC, __pyx_t_2) < 0) __PYX_ERR(0, 95, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+096: ARES_FLAG_NORECURSE = cares.ARES_FLAG_NORECURSE
+
  __pyx_t_2 = __Pyx_PyInt_From_int(ARES_FLAG_NORECURSE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 96, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARES_FLAG_NORECURSE, __pyx_t_2) < 0) __PYX_ERR(0, 96, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+097: ARES_FLAG_STAYOPEN = cares.ARES_FLAG_STAYOPEN
+
  __pyx_t_2 = __Pyx_PyInt_From_int(ARES_FLAG_STAYOPEN); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 97, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARES_FLAG_STAYOPEN, __pyx_t_2) < 0) __PYX_ERR(0, 97, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+098: ARES_FLAG_NOSEARCH = cares.ARES_FLAG_NOSEARCH
+
  __pyx_t_2 = __Pyx_PyInt_From_int(ARES_FLAG_NOSEARCH); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 98, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARES_FLAG_NOSEARCH, __pyx_t_2) < 0) __PYX_ERR(0, 98, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+099: ARES_FLAG_NOALIASES = cares.ARES_FLAG_NOALIASES
+
  __pyx_t_2 = __Pyx_PyInt_From_int(ARES_FLAG_NOALIASES); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 99, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARES_FLAG_NOALIASES, __pyx_t_2) < 0) __PYX_ERR(0, 99, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+100: ARES_FLAG_NOCHECKRESP = cares.ARES_FLAG_NOCHECKRESP
+
  __pyx_t_2 = __Pyx_PyInt_From_int(ARES_FLAG_NOCHECKRESP); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 100, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARES_FLAG_NOCHECKRESP, __pyx_t_2) < 0) __PYX_ERR(0, 100, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
 101: 
+
 102: 
+
+103: _ares_errors = dict([
+
  __pyx_t_2 = PyList_New(25); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 103, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_GIVEREF(__pyx_t_1);
+  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_4);
+  PyList_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
+  __Pyx_GIVEREF(__pyx_t_5);
+  PyList_SET_ITEM(__pyx_t_2, 2, __pyx_t_5);
+  __Pyx_GIVEREF(__pyx_t_6);
+  PyList_SET_ITEM(__pyx_t_2, 3, __pyx_t_6);
+  __Pyx_GIVEREF(__pyx_t_7);
+  PyList_SET_ITEM(__pyx_t_2, 4, __pyx_t_7);
+  __Pyx_GIVEREF(__pyx_t_8);
+  PyList_SET_ITEM(__pyx_t_2, 5, __pyx_t_8);
+  __Pyx_GIVEREF(__pyx_t_9);
+  PyList_SET_ITEM(__pyx_t_2, 6, __pyx_t_9);
+  __Pyx_GIVEREF(__pyx_t_10);
+  PyList_SET_ITEM(__pyx_t_2, 7, __pyx_t_10);
+  __Pyx_GIVEREF(__pyx_t_11);
+  PyList_SET_ITEM(__pyx_t_2, 8, __pyx_t_11);
+  __Pyx_GIVEREF(__pyx_t_12);
+  PyList_SET_ITEM(__pyx_t_2, 9, __pyx_t_12);
+  __Pyx_GIVEREF(__pyx_t_13);
+  PyList_SET_ITEM(__pyx_t_2, 10, __pyx_t_13);
+  __Pyx_GIVEREF(__pyx_t_14);
+  PyList_SET_ITEM(__pyx_t_2, 11, __pyx_t_14);
+  __Pyx_GIVEREF(__pyx_t_15);
+  PyList_SET_ITEM(__pyx_t_2, 12, __pyx_t_15);
+  __Pyx_GIVEREF(__pyx_t_16);
+  PyList_SET_ITEM(__pyx_t_2, 13, __pyx_t_16);
+  __Pyx_GIVEREF(__pyx_t_17);
+  PyList_SET_ITEM(__pyx_t_2, 14, __pyx_t_17);
+  __Pyx_GIVEREF(__pyx_t_18);
+  PyList_SET_ITEM(__pyx_t_2, 15, __pyx_t_18);
+  __Pyx_GIVEREF(__pyx_t_19);
+  PyList_SET_ITEM(__pyx_t_2, 16, __pyx_t_19);
+  __Pyx_GIVEREF(__pyx_t_20);
+  PyList_SET_ITEM(__pyx_t_2, 17, __pyx_t_20);
+  __Pyx_GIVEREF(__pyx_t_21);
+  PyList_SET_ITEM(__pyx_t_2, 18, __pyx_t_21);
+  __Pyx_GIVEREF(__pyx_t_22);
+  PyList_SET_ITEM(__pyx_t_2, 19, __pyx_t_22);
+  __Pyx_GIVEREF(__pyx_t_23);
+  PyList_SET_ITEM(__pyx_t_2, 20, __pyx_t_23);
+  __Pyx_GIVEREF(__pyx_t_24);
+  PyList_SET_ITEM(__pyx_t_2, 21, __pyx_t_24);
+  __Pyx_GIVEREF(__pyx_t_25);
+  PyList_SET_ITEM(__pyx_t_2, 22, __pyx_t_25);
+  __Pyx_GIVEREF(__pyx_t_26);
+  PyList_SET_ITEM(__pyx_t_2, 23, __pyx_t_26);
+  __Pyx_GIVEREF(__pyx_t_27);
+  PyList_SET_ITEM(__pyx_t_2, 24, __pyx_t_27);
+  __pyx_t_1 = 0;
+  __pyx_t_4 = 0;
+  __pyx_t_5 = 0;
+  __pyx_t_6 = 0;
+  __pyx_t_7 = 0;
+  __pyx_t_8 = 0;
+  __pyx_t_9 = 0;
+  __pyx_t_10 = 0;
+  __pyx_t_11 = 0;
+  __pyx_t_12 = 0;
+  __pyx_t_13 = 0;
+  __pyx_t_14 = 0;
+  __pyx_t_15 = 0;
+  __pyx_t_16 = 0;
+  __pyx_t_17 = 0;
+  __pyx_t_18 = 0;
+  __pyx_t_19 = 0;
+  __pyx_t_20 = 0;
+  __pyx_t_21 = 0;
+  __pyx_t_22 = 0;
+  __pyx_t_23 = 0;
+  __pyx_t_24 = 0;
+  __pyx_t_25 = 0;
+  __pyx_t_26 = 0;
+  __pyx_t_27 = 0;
+  __pyx_t_27 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyDict_Type)), __pyx_t_2); if (unlikely(!__pyx_t_27)) __PYX_ERR(0, 103, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_27);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ares_errors, __pyx_t_27) < 0) __PYX_ERR(0, 103, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0;
+
+104:                 (cares.ARES_SUCCESS, 'ARES_SUCCESS'),
+
  __pyx_t_2 = __Pyx_PyInt_From_int(ARES_SUCCESS); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 104, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 104, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_2);
+  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_ARES_SUCCESS);
+  __Pyx_GIVEREF(__pyx_n_s_ARES_SUCCESS);
+  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_ARES_SUCCESS);
+  __pyx_t_2 = 0;
+
+105:                 (cares.ARES_ENODATA, 'ARES_ENODATA'),
+
  __pyx_t_2 = __Pyx_PyInt_From_int(ARES_ENODATA); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 105, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 105, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_4);
+  __Pyx_GIVEREF(__pyx_t_2);
+  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_ARES_ENODATA);
+  __Pyx_GIVEREF(__pyx_n_s_ARES_ENODATA);
+  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_n_s_ARES_ENODATA);
+  __pyx_t_2 = 0;
+
+106:                 (cares.ARES_EFORMERR, 'ARES_EFORMERR'),
+
  __pyx_t_2 = __Pyx_PyInt_From_int(ARES_EFORMERR); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 106, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 106, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_5);
+  __Pyx_GIVEREF(__pyx_t_2);
+  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_ARES_EFORMERR);
+  __Pyx_GIVEREF(__pyx_n_s_ARES_EFORMERR);
+  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_n_s_ARES_EFORMERR);
+  __pyx_t_2 = 0;
+
+107:                 (cares.ARES_ESERVFAIL, 'ARES_ESERVFAIL'),
+
  __pyx_t_2 = __Pyx_PyInt_From_int(ARES_ESERVFAIL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 107, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 107, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  __Pyx_GIVEREF(__pyx_t_2);
+  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_ARES_ESERVFAIL);
+  __Pyx_GIVEREF(__pyx_n_s_ARES_ESERVFAIL);
+  PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_n_s_ARES_ESERVFAIL);
+  __pyx_t_2 = 0;
+
+108:                 (cares.ARES_ENOTFOUND, 'ARES_ENOTFOUND'),
+
  __pyx_t_2 = __Pyx_PyInt_From_int(ARES_ENOTFOUND); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 108, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 108, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_7);
+  __Pyx_GIVEREF(__pyx_t_2);
+  PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_ARES_ENOTFOUND);
+  __Pyx_GIVEREF(__pyx_n_s_ARES_ENOTFOUND);
+  PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_n_s_ARES_ENOTFOUND);
+  __pyx_t_2 = 0;
+
+109:                 (cares.ARES_ENOTIMP, 'ARES_ENOTIMP'),
+
  __pyx_t_2 = __Pyx_PyInt_From_int(ARES_ENOTIMP); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 109, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 109, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_8);
+  __Pyx_GIVEREF(__pyx_t_2);
+  PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_ARES_ENOTIMP);
+  __Pyx_GIVEREF(__pyx_n_s_ARES_ENOTIMP);
+  PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_n_s_ARES_ENOTIMP);
+  __pyx_t_2 = 0;
+
+110:                 (cares.ARES_EREFUSED, 'ARES_EREFUSED'),
+
  __pyx_t_2 = __Pyx_PyInt_From_int(ARES_EREFUSED); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 110, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 110, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_9);
+  __Pyx_GIVEREF(__pyx_t_2);
+  PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_ARES_EREFUSED);
+  __Pyx_GIVEREF(__pyx_n_s_ARES_EREFUSED);
+  PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_n_s_ARES_EREFUSED);
+  __pyx_t_2 = 0;
+
+111:                 (cares.ARES_EBADQUERY, 'ARES_EBADQUERY'),
+
  __pyx_t_2 = __Pyx_PyInt_From_int(ARES_EBADQUERY); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 111, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 111, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_10);
+  __Pyx_GIVEREF(__pyx_t_2);
+  PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_ARES_EBADQUERY);
+  __Pyx_GIVEREF(__pyx_n_s_ARES_EBADQUERY);
+  PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_n_s_ARES_EBADQUERY);
+  __pyx_t_2 = 0;
+
+112:                 (cares.ARES_EBADNAME, 'ARES_EBADNAME'),
+
  __pyx_t_2 = __Pyx_PyInt_From_int(ARES_EBADNAME); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 112, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 112, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_11);
+  __Pyx_GIVEREF(__pyx_t_2);
+  PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_ARES_EBADNAME);
+  __Pyx_GIVEREF(__pyx_n_s_ARES_EBADNAME);
+  PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_n_s_ARES_EBADNAME);
+  __pyx_t_2 = 0;
+
+113:                 (cares.ARES_EBADFAMILY, 'ARES_EBADFAMILY'),
+
  __pyx_t_2 = __Pyx_PyInt_From_int(ARES_EBADFAMILY); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 113, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 113, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_12);
+  __Pyx_GIVEREF(__pyx_t_2);
+  PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_ARES_EBADFAMILY);
+  __Pyx_GIVEREF(__pyx_n_s_ARES_EBADFAMILY);
+  PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_n_s_ARES_EBADFAMILY);
+  __pyx_t_2 = 0;
+
+114:                 (cares.ARES_EBADRESP, 'ARES_EBADRESP'),
+
  __pyx_t_2 = __Pyx_PyInt_From_int(ARES_EBADRESP); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 114, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_13 = PyTuple_New(2); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 114, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_13);
+  __Pyx_GIVEREF(__pyx_t_2);
+  PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_ARES_EBADRESP);
+  __Pyx_GIVEREF(__pyx_n_s_ARES_EBADRESP);
+  PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_n_s_ARES_EBADRESP);
+  __pyx_t_2 = 0;
+
+115:                 (cares.ARES_ECONNREFUSED, 'ARES_ECONNREFUSED'),
+
  __pyx_t_2 = __Pyx_PyInt_From_int(ARES_ECONNREFUSED); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 115, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_14 = PyTuple_New(2); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 115, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_14);
+  __Pyx_GIVEREF(__pyx_t_2);
+  PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_ARES_ECONNREFUSED);
+  __Pyx_GIVEREF(__pyx_n_s_ARES_ECONNREFUSED);
+  PyTuple_SET_ITEM(__pyx_t_14, 1, __pyx_n_s_ARES_ECONNREFUSED);
+  __pyx_t_2 = 0;
+
+116:                 (cares.ARES_ETIMEOUT, 'ARES_ETIMEOUT'),
+
  __pyx_t_2 = __Pyx_PyInt_From_int(ARES_ETIMEOUT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 116, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_15 = PyTuple_New(2); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 116, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_15);
+  __Pyx_GIVEREF(__pyx_t_2);
+  PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_ARES_ETIMEOUT);
+  __Pyx_GIVEREF(__pyx_n_s_ARES_ETIMEOUT);
+  PyTuple_SET_ITEM(__pyx_t_15, 1, __pyx_n_s_ARES_ETIMEOUT);
+  __pyx_t_2 = 0;
+
+117:                 (cares.ARES_EOF, 'ARES_EOF'),
+
  __pyx_t_2 = __Pyx_PyInt_From_int(ARES_EOF); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 117, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_16 = PyTuple_New(2); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 117, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_16);
+  __Pyx_GIVEREF(__pyx_t_2);
+  PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_ARES_EOF);
+  __Pyx_GIVEREF(__pyx_n_s_ARES_EOF);
+  PyTuple_SET_ITEM(__pyx_t_16, 1, __pyx_n_s_ARES_EOF);
+  __pyx_t_2 = 0;
+
+118:                 (cares.ARES_EFILE, 'ARES_EFILE'),
+
  __pyx_t_2 = __Pyx_PyInt_From_int(ARES_EFILE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 118, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_17 = PyTuple_New(2); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 118, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_17);
+  __Pyx_GIVEREF(__pyx_t_2);
+  PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_ARES_EFILE);
+  __Pyx_GIVEREF(__pyx_n_s_ARES_EFILE);
+  PyTuple_SET_ITEM(__pyx_t_17, 1, __pyx_n_s_ARES_EFILE);
+  __pyx_t_2 = 0;
+
+119:                 (cares.ARES_ENOMEM, 'ARES_ENOMEM'),
+
  __pyx_t_2 = __Pyx_PyInt_From_int(ARES_ENOMEM); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 119, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_18 = PyTuple_New(2); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 119, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_18);
+  __Pyx_GIVEREF(__pyx_t_2);
+  PyTuple_SET_ITEM(__pyx_t_18, 0, __pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_ARES_ENOMEM);
+  __Pyx_GIVEREF(__pyx_n_s_ARES_ENOMEM);
+  PyTuple_SET_ITEM(__pyx_t_18, 1, __pyx_n_s_ARES_ENOMEM);
+  __pyx_t_2 = 0;
+
+120:                 (cares.ARES_EDESTRUCTION, 'ARES_EDESTRUCTION'),
+
  __pyx_t_2 = __Pyx_PyInt_From_int(ARES_EDESTRUCTION); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 120, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_19 = PyTuple_New(2); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 120, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_19);
+  __Pyx_GIVEREF(__pyx_t_2);
+  PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_ARES_EDESTRUCTION);
+  __Pyx_GIVEREF(__pyx_n_s_ARES_EDESTRUCTION);
+  PyTuple_SET_ITEM(__pyx_t_19, 1, __pyx_n_s_ARES_EDESTRUCTION);
+  __pyx_t_2 = 0;
+
+121:                 (cares.ARES_EBADSTR, 'ARES_EBADSTR'),
+
  __pyx_t_2 = __Pyx_PyInt_From_int(ARES_EBADSTR); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 121, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_20 = PyTuple_New(2); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 121, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_20);
+  __Pyx_GIVEREF(__pyx_t_2);
+  PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_ARES_EBADSTR);
+  __Pyx_GIVEREF(__pyx_n_s_ARES_EBADSTR);
+  PyTuple_SET_ITEM(__pyx_t_20, 1, __pyx_n_s_ARES_EBADSTR);
+  __pyx_t_2 = 0;
+
+122:                 (cares.ARES_EBADFLAGS, 'ARES_EBADFLAGS'),
+
  __pyx_t_2 = __Pyx_PyInt_From_int(ARES_EBADFLAGS); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 122, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_21 = PyTuple_New(2); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 122, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_21);
+  __Pyx_GIVEREF(__pyx_t_2);
+  PyTuple_SET_ITEM(__pyx_t_21, 0, __pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_ARES_EBADFLAGS);
+  __Pyx_GIVEREF(__pyx_n_s_ARES_EBADFLAGS);
+  PyTuple_SET_ITEM(__pyx_t_21, 1, __pyx_n_s_ARES_EBADFLAGS);
+  __pyx_t_2 = 0;
+
+123:                 (cares.ARES_ENONAME, 'ARES_ENONAME'),
+
  __pyx_t_2 = __Pyx_PyInt_From_int(ARES_ENONAME); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 123, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_22 = PyTuple_New(2); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 123, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_22);
+  __Pyx_GIVEREF(__pyx_t_2);
+  PyTuple_SET_ITEM(__pyx_t_22, 0, __pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_ARES_ENONAME);
+  __Pyx_GIVEREF(__pyx_n_s_ARES_ENONAME);
+  PyTuple_SET_ITEM(__pyx_t_22, 1, __pyx_n_s_ARES_ENONAME);
+  __pyx_t_2 = 0;
+
+124:                 (cares.ARES_EBADHINTS, 'ARES_EBADHINTS'),
+
  __pyx_t_2 = __Pyx_PyInt_From_int(ARES_EBADHINTS); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 124, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_23 = PyTuple_New(2); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 124, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_23);
+  __Pyx_GIVEREF(__pyx_t_2);
+  PyTuple_SET_ITEM(__pyx_t_23, 0, __pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_ARES_EBADHINTS);
+  __Pyx_GIVEREF(__pyx_n_s_ARES_EBADHINTS);
+  PyTuple_SET_ITEM(__pyx_t_23, 1, __pyx_n_s_ARES_EBADHINTS);
+  __pyx_t_2 = 0;
+
+125:                 (cares.ARES_ENOTINITIALIZED, 'ARES_ENOTINITIALIZED'),
+
  __pyx_t_2 = __Pyx_PyInt_From_int(ARES_ENOTINITIALIZED); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 125, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_24 = PyTuple_New(2); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 125, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_24);
+  __Pyx_GIVEREF(__pyx_t_2);
+  PyTuple_SET_ITEM(__pyx_t_24, 0, __pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_ARES_ENOTINITIALIZED);
+  __Pyx_GIVEREF(__pyx_n_s_ARES_ENOTINITIALIZED);
+  PyTuple_SET_ITEM(__pyx_t_24, 1, __pyx_n_s_ARES_ENOTINITIALIZED);
+  __pyx_t_2 = 0;
+
+126:                 (cares.ARES_ELOADIPHLPAPI, 'ARES_ELOADIPHLPAPI'),
+
  __pyx_t_2 = __Pyx_PyInt_From_int(ARES_ELOADIPHLPAPI); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 126, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_25 = PyTuple_New(2); if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 126, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_25);
+  __Pyx_GIVEREF(__pyx_t_2);
+  PyTuple_SET_ITEM(__pyx_t_25, 0, __pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_ARES_ELOADIPHLPAPI);
+  __Pyx_GIVEREF(__pyx_n_s_ARES_ELOADIPHLPAPI);
+  PyTuple_SET_ITEM(__pyx_t_25, 1, __pyx_n_s_ARES_ELOADIPHLPAPI);
+  __pyx_t_2 = 0;
+
+127:                 (cares.ARES_EADDRGETNETWORKPARAMS, 'ARES_EADDRGETNETWORKPARAMS'),
+
  __pyx_t_2 = __Pyx_PyInt_From_int(ARES_EADDRGETNETWORKPARAMS); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 127, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_26 = PyTuple_New(2); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 127, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_26);
+  __Pyx_GIVEREF(__pyx_t_2);
+  PyTuple_SET_ITEM(__pyx_t_26, 0, __pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_ARES_EADDRGETNETWORKPARAMS);
+  __Pyx_GIVEREF(__pyx_n_s_ARES_EADDRGETNETWORKPARAMS);
+  PyTuple_SET_ITEM(__pyx_t_26, 1, __pyx_n_s_ARES_EADDRGETNETWORKPARAMS);
+  __pyx_t_2 = 0;
+
+128:                 (cares.ARES_ECANCELLED, 'ARES_ECANCELLED')])
+
  __pyx_t_2 = __Pyx_PyInt_From_int(ARES_ECANCELLED); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 128, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_27 = PyTuple_New(2); if (unlikely(!__pyx_t_27)) __PYX_ERR(0, 128, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_27);
+  __Pyx_GIVEREF(__pyx_t_2);
+  PyTuple_SET_ITEM(__pyx_t_27, 0, __pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_ARES_ECANCELLED);
+  __Pyx_GIVEREF(__pyx_n_s_ARES_ECANCELLED);
+  PyTuple_SET_ITEM(__pyx_t_27, 1, __pyx_n_s_ARES_ECANCELLED);
+  __pyx_t_2 = 0;
+
 129: 
+
 130: 
+
 131: # maps c-ares flag to _socket module flag
+
+132: _cares_flag_map = None
+
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_cares_flag_map, Py_None) < 0) __PYX_ERR(0, 132, __pyx_L1_error)
+
 133: 
+
 134: 
+
+135: cdef _prepare_cares_flag_map():
+
static PyObject *__pyx_f_6gevent_8resolver_5cares__prepare_cares_flag_map(void) {
+  PyObject *__pyx_v__socket = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_prepare_cares_flag_map", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_XDECREF(__pyx_t_6);
+  __Pyx_XDECREF(__pyx_t_7);
+  __Pyx_AddTraceback("gevent.resolver.cares._prepare_cares_flag_map", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v__socket);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
 136:     global _cares_flag_map
+
+137:     import _socket
+
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_socket, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 137, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_v__socket = __pyx_t_1;
+  __pyx_t_1 = 0;
+
+138:     _cares_flag_map = [
+
  __pyx_t_2 = PyList_New(5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 138, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_GIVEREF(__pyx_t_3);
+  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
+  __Pyx_GIVEREF(__pyx_t_4);
+  PyList_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
+  __Pyx_GIVEREF(__pyx_t_5);
+  PyList_SET_ITEM(__pyx_t_2, 2, __pyx_t_5);
+  __Pyx_GIVEREF(__pyx_t_6);
+  PyList_SET_ITEM(__pyx_t_2, 3, __pyx_t_6);
+  __Pyx_GIVEREF(__pyx_t_7);
+  PyList_SET_ITEM(__pyx_t_2, 4, __pyx_t_7);
+  __pyx_t_3 = 0;
+  __pyx_t_4 = 0;
+  __pyx_t_5 = 0;
+  __pyx_t_6 = 0;
+  __pyx_t_7 = 0;
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_cares_flag_map, __pyx_t_2) < 0) __PYX_ERR(0, 138, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+139:         (getattr(_socket, 'NI_NUMERICHOST', 1), cares.ARES_NI_NUMERICHOST),
+
  __pyx_t_1 = __Pyx_GetAttr3(__pyx_v__socket, __pyx_n_s_NI_NUMERICHOST, __pyx_int_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 139, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = __Pyx_PyInt_From_int(ARES_NI_NUMERICHOST); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 139, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 139, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_GIVEREF(__pyx_t_1);
+  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_2);
+  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
+  __pyx_t_1 = 0;
+  __pyx_t_2 = 0;
+
+140:         (getattr(_socket, 'NI_NUMERICSERV', 2), cares.ARES_NI_NUMERICSERV),
+
  __pyx_t_2 = __Pyx_GetAttr3(__pyx_v__socket, __pyx_n_s_NI_NUMERICSERV, __pyx_int_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 140, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_1 = __Pyx_PyInt_From_int(ARES_NI_NUMERICSERV); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 140, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 140, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_4);
+  __Pyx_GIVEREF(__pyx_t_2);
+  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
+  __Pyx_GIVEREF(__pyx_t_1);
+  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
+  __pyx_t_2 = 0;
+  __pyx_t_1 = 0;
+
+141:         (getattr(_socket, 'NI_NOFQDN', 4), cares.ARES_NI_NOFQDN),
+
  __pyx_t_1 = __Pyx_GetAttr3(__pyx_v__socket, __pyx_n_s_NI_NOFQDN, __pyx_int_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 141, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = __Pyx_PyInt_From_int(ARES_NI_NOFQDN); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 141, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 141, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_5);
+  __Pyx_GIVEREF(__pyx_t_1);
+  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_2);
+  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
+  __pyx_t_1 = 0;
+  __pyx_t_2 = 0;
+
+142:         (getattr(_socket, 'NI_NAMEREQD', 8), cares.ARES_NI_NAMEREQD),
+
  __pyx_t_2 = __Pyx_GetAttr3(__pyx_v__socket, __pyx_n_s_NI_NAMEREQD, __pyx_int_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 142, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_1 = __Pyx_PyInt_From_int(ARES_NI_NAMEREQD); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 142, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 142, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  __Pyx_GIVEREF(__pyx_t_2);
+  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2);
+  __Pyx_GIVEREF(__pyx_t_1);
+  PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_1);
+  __pyx_t_2 = 0;
+  __pyx_t_1 = 0;
+
+143:         (getattr(_socket, 'NI_DGRAM', 16), cares.ARES_NI_DGRAM)]
+
  __pyx_t_1 = __Pyx_GetAttr3(__pyx_v__socket, __pyx_n_s_NI_DGRAM, __pyx_int_16); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 143, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = __Pyx_PyInt_From_int(ARES_NI_DGRAM); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 143, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 143, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_7);
+  __Pyx_GIVEREF(__pyx_t_1);
+  PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_2);
+  PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_2);
+  __pyx_t_1 = 0;
+  __pyx_t_2 = 0;
+
 144: 
+
 145: 
+
+146: cpdef _convert_cares_flags(int flags, int default=cares.ARES_NI_LOOKUPHOST|cares.ARES_NI_LOOKUPSERVICE):
+
static PyObject *__pyx_pw_6gevent_8resolver_5cares_1_convert_cares_flags(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_f_6gevent_8resolver_5cares__convert_cares_flags(int __pyx_v_flags, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_8resolver_5cares__convert_cares_flags *__pyx_optional_args) {
+  int __pyx_v_default = __pyx_k_;
+  PyObject *__pyx_v_socket_flag = NULL;
+  PyObject *__pyx_v_cares_flag = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_convert_cares_flags", 0);
+  if (__pyx_optional_args) {
+    if (__pyx_optional_args->__pyx_n > 0) {
+      __pyx_v_default = __pyx_optional_args->__pyx_default;
+    }
+  }
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_7);
+  __Pyx_XDECREF(__pyx_t_8);
+  __Pyx_XDECREF(__pyx_t_9);
+  __Pyx_AddTraceback("gevent.resolver.cares._convert_cares_flags", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_socket_flag);
+  __Pyx_XDECREF(__pyx_v_cares_flag);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_8resolver_5cares_1_convert_cares_flags(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_pw_6gevent_8resolver_5cares_1_convert_cares_flags(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  int __pyx_v_flags;
+  int __pyx_v_default;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_convert_cares_flags (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_flags,&__pyx_n_s_default,0};
+    PyObject* values[2] = {0,0};
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flags)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_default);
+          if (value) { values[1] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_convert_cares_flags") < 0)) __PYX_ERR(0, 146, __pyx_L3_error)
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    __pyx_v_flags = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 146, __pyx_L3_error)
+    if (values[1]) {
+      __pyx_v_default = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_default == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 146, __pyx_L3_error)
+    } else {
+      __pyx_v_default = __pyx_k_;
+    }
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("_convert_cares_flags", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 146, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.resolver.cares._convert_cares_flags", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_8resolver_5cares__convert_cares_flags(__pyx_self, __pyx_v_flags, __pyx_v_default);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_8resolver_5cares__convert_cares_flags(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_flags, int __pyx_v_default) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_convert_cares_flags", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_2.__pyx_n = 1;
+  __pyx_t_2.__pyx_default = __pyx_v_default;
+  __pyx_t_1 = __pyx_f_6gevent_8resolver_5cares__convert_cares_flags(__pyx_v_flags, 0, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 146, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.resolver.cares._convert_cares_flags", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_k_ = (ARES_NI_LOOKUPHOST | ARES_NI_LOOKUPSERVICE);
+  __pyx_k_ = (ARES_NI_LOOKUPHOST | ARES_NI_LOOKUPSERVICE);
+/* … */
+struct __pyx_opt_args_6gevent_8resolver_5cares__convert_cares_flags {
+  int __pyx_n;
+  int __pyx_default;
+};
+
+147:     if _cares_flag_map is None:
+
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_cares_flag_map); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 147, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = (__pyx_t_1 == Py_None);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_3 = (__pyx_t_2 != 0);
+  if (__pyx_t_3) {
+/* … */
+  }
+
+148:         _prepare_cares_flag_map()
+
    __pyx_t_1 = __pyx_f_6gevent_8resolver_5cares__prepare_cares_flag_map(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 148, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+149:     for socket_flag, cares_flag in _cares_flag_map:
+
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_cares_flag_map); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 149, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
+    __pyx_t_4 = __pyx_t_1; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0;
+    __pyx_t_6 = NULL;
+  } else {
+    __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 149, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 149, __pyx_L1_error)
+  }
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  for (;;) {
+    if (likely(!__pyx_t_6)) {
+      if (likely(PyList_CheckExact(__pyx_t_4))) {
+        if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break;
+        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 149, __pyx_L1_error)
+        #else
+        __pyx_t_1 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 149, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_1);
+        #endif
+      } else {
+        if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
+        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 149, __pyx_L1_error)
+        #else
+        __pyx_t_1 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 149, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_1);
+        #endif
+      }
+    } else {
+      __pyx_t_1 = __pyx_t_6(__pyx_t_4);
+      if (unlikely(!__pyx_t_1)) {
+        PyObject* exc_type = PyErr_Occurred();
+        if (exc_type) {
+          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+          else __PYX_ERR(0, 149, __pyx_L1_error)
+        }
+        break;
+      }
+      __Pyx_GOTREF(__pyx_t_1);
+    }
+    if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
+      PyObject* sequence = __pyx_t_1;
+      Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
+      if (unlikely(size != 2)) {
+        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
+        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
+        __PYX_ERR(0, 149, __pyx_L1_error)
+      }
+      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+      if (likely(PyTuple_CheckExact(sequence))) {
+        __pyx_t_7 = PyTuple_GET_ITEM(sequence, 0); 
+        __pyx_t_8 = PyTuple_GET_ITEM(sequence, 1); 
+      } else {
+        __pyx_t_7 = PyList_GET_ITEM(sequence, 0); 
+        __pyx_t_8 = PyList_GET_ITEM(sequence, 1); 
+      }
+      __Pyx_INCREF(__pyx_t_7);
+      __Pyx_INCREF(__pyx_t_8);
+      #else
+      __pyx_t_7 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 149, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_7);
+      __pyx_t_8 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 149, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_8);
+      #endif
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    } else {
+      Py_ssize_t index = -1;
+      __pyx_t_9 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 149, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_9);
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      __pyx_t_10 = Py_TYPE(__pyx_t_9)->tp_iternext;
+      index = 0; __pyx_t_7 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_7)) goto __pyx_L6_unpacking_failed;
+      __Pyx_GOTREF(__pyx_t_7);
+      index = 1; __pyx_t_8 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_8)) goto __pyx_L6_unpacking_failed;
+      __Pyx_GOTREF(__pyx_t_8);
+      if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) __PYX_ERR(0, 149, __pyx_L1_error)
+      __pyx_t_10 = NULL;
+      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+      goto __pyx_L7_unpacking_done;
+      __pyx_L6_unpacking_failed:;
+      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+      __pyx_t_10 = NULL;
+      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
+      __PYX_ERR(0, 149, __pyx_L1_error)
+      __pyx_L7_unpacking_done:;
+    }
+    __Pyx_XDECREF_SET(__pyx_v_socket_flag, __pyx_t_7);
+    __pyx_t_7 = 0;
+    __Pyx_XDECREF_SET(__pyx_v_cares_flag, __pyx_t_8);
+    __pyx_t_8 = 0;
+/* … */
+  }
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+
+150:         if socket_flag & flags:
+
    __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 150, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __pyx_t_8 = PyNumber_And(__pyx_v_socket_flag, __pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 150, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_8);
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 150, __pyx_L1_error)
+    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+    if (__pyx_t_3) {
+/* … */
+    }
+
+151:             default |= cares_flag
+
      __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_default); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 151, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_8);
+      __pyx_t_1 = PyNumber_InPlaceOr(__pyx_t_8, __pyx_v_cares_flag); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 151, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+      __pyx_t_11 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 151, __pyx_L1_error)
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      __pyx_v_default = __pyx_t_11;
+
+152:             flags &= ~socket_flag
+
      __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 152, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      __pyx_t_8 = PyNumber_Invert(__pyx_v_socket_flag); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 152, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_8);
+      __pyx_t_7 = PyNumber_InPlaceAnd(__pyx_t_1, __pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 152, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_7);
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+      __pyx_t_11 = __Pyx_PyInt_As_int(__pyx_t_7); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 152, __pyx_L1_error)
+      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+      __pyx_v_flags = __pyx_t_11;
+
+153:         if not flags:
+
    __pyx_t_3 = ((!(__pyx_v_flags != 0)) != 0);
+    if (__pyx_t_3) {
+/* … */
+    }
+
+154:             return default
+
      __Pyx_XDECREF(__pyx_r);
+      __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_default); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 154, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_7);
+      __pyx_r = __pyx_t_7;
+      __pyx_t_7 = 0;
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      goto __pyx_L0;
+
+155:     raise gaierror(-1, "Bad value for ai_flags: 0x%x" % flags)
+
  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_gaierror); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 155, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_7);
+  __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 155, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_8);
+  __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_Bad_value_for_ai_flags_0x_x, __pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 155, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+  __pyx_t_8 = NULL;
+  __pyx_t_11 = 0;
+  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
+    __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
+    if (likely(__pyx_t_8)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
+      __Pyx_INCREF(__pyx_t_8);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_7, function);
+      __pyx_t_11 = 1;
+    }
+  }
+  #if CYTHON_FAST_PYCALL
+  if (PyFunction_Check(__pyx_t_7)) {
+    PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_int_neg_1, __pyx_t_1};
+    __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 155, __pyx_L1_error)
+    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
+    __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  } else
+  #endif
+  #if CYTHON_FAST_PYCCALL
+  if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
+    PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_int_neg_1, __pyx_t_1};
+    __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 155, __pyx_L1_error)
+    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
+    __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  } else
+  #endif
+  {
+    __pyx_t_9 = PyTuple_New(2+__pyx_t_11); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 155, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_9);
+    if (__pyx_t_8) {
+      __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = NULL;
+    }
+    __Pyx_INCREF(__pyx_int_neg_1);
+    __Pyx_GIVEREF(__pyx_int_neg_1);
+    PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_11, __pyx_int_neg_1);
+    __Pyx_GIVEREF(__pyx_t_1);
+    PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_11, __pyx_t_1);
+    __pyx_t_1 = 0;
+    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_9, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 155, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+  }
+  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __Pyx_Raise(__pyx_t_4, 0, 0, 0);
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __PYX_ERR(0, 155, __pyx_L1_error)
+
 156: 
+
 157: 
+
+158: cpdef strerror(code):
+
static PyObject *__pyx_pw_6gevent_8resolver_5cares_3strerror(PyObject *__pyx_self, PyObject *__pyx_v_code); /*proto*/
+static PyObject *__pyx_f_6gevent_8resolver_5cares_strerror(PyObject *__pyx_v_code, CYTHON_UNUSED int __pyx_skip_dispatch) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("strerror", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_AddTraceback("gevent.resolver.cares.strerror", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_8resolver_5cares_3strerror(PyObject *__pyx_self, PyObject *__pyx_v_code); /*proto*/
+static PyObject *__pyx_pw_6gevent_8resolver_5cares_3strerror(PyObject *__pyx_self, PyObject *__pyx_v_code) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("strerror (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_8resolver_5cares_2strerror(__pyx_self, ((PyObject *)__pyx_v_code));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_8resolver_5cares_2strerror(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_code) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("strerror", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __pyx_f_6gevent_8resolver_5cares_strerror(__pyx_v_code, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 158, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.resolver.cares.strerror", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+159:     return '%s: %s' % (_ares_errors.get(code) or code, cares.ares_strerror(code))
+
  __Pyx_XDECREF(__pyx_r);
+  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ares_errors); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 159, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_get); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 159, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_4);
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __pyx_t_3 = NULL;
+  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
+    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
+    if (likely(__pyx_t_3)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
+      __Pyx_INCREF(__pyx_t_3);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_4, function);
+    }
+  }
+  __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_3, __pyx_v_code) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_code);
+  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 159, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 159, __pyx_L1_error)
+  if (!__pyx_t_5) {
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  } else {
+    __Pyx_INCREF(__pyx_t_2);
+    __pyx_t_1 = __pyx_t_2;
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    goto __pyx_L3_bool_binop_done;
+  }
+  __Pyx_INCREF(__pyx_v_code);
+  __pyx_t_1 = __pyx_v_code;
+  __pyx_L3_bool_binop_done:;
+  __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_v_code); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 159, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyBytes_FromString(ares_strerror(__pyx_t_6)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 159, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 159, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_4);
+  __Pyx_GIVEREF(__pyx_t_1);
+  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_2);
+  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
+  __pyx_t_1 = 0;
+  __pyx_t_2 = 0;
+  __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_s_s, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 159, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __pyx_r = __pyx_t_2;
+  __pyx_t_2 = 0;
+  goto __pyx_L0;
+
 160: 
+
 161: 
+
+162: class InvalidIP(ValueError):
+
  __pyx_t_27 = __Pyx_CalculateMetaclass(NULL, __pyx_tuple__4); if (unlikely(!__pyx_t_27)) __PYX_ERR(0, 162, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_27);
+  __pyx_t_2 = __Pyx_Py3MetaclassPrepare(__pyx_t_27, __pyx_tuple__4, __pyx_n_s_InvalidIP, __pyx_n_s_InvalidIP, (PyObject *) NULL, __pyx_n_s_gevent_resolver_cares, (PyObject *) NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 162, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_26 = __Pyx_Py3ClassCreate(__pyx_t_27, __pyx_n_s_InvalidIP, __pyx_tuple__4, __pyx_t_2, NULL, 0, 0); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 162, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_26);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_InvalidIP, __pyx_t_26) < 0) __PYX_ERR(0, 162, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0;
+/* … */
+  __pyx_tuple__4 = PyTuple_Pack(1, __pyx_builtin_ValueError); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 162, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__4);
+  __Pyx_GIVEREF(__pyx_tuple__4);
+
 163:     pass
+
 164: 
+
 165: 
+
+166: cdef void gevent_sock_state_callback(void *data, int s, int read, int write):
+
static void __pyx_f_6gevent_8resolver_5cares_gevent_sock_state_callback(void *__pyx_v_data, int __pyx_v_s, int __pyx_v_read, int __pyx_v_write) {
+  struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_ch = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("gevent_sock_state_callback", 0);
+/* … */
+  /* function exit code */
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_WriteUnraisable("gevent.resolver.cares.gevent_sock_state_callback", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
+  __pyx_L0:;
+  __Pyx_XDECREF((PyObject *)__pyx_v_ch);
+  __Pyx_RefNannyFinishContext();
+}
+
+167:     if not data:
+
  __pyx_t_1 = ((!(__pyx_v_data != 0)) != 0);
+  if (__pyx_t_1) {
+/* … */
+  }
+
+168:         return
+
    goto __pyx_L0;
+
+169:     cdef channel ch = <channel>data
+
  __pyx_t_2 = ((PyObject *)__pyx_v_data);
+  __Pyx_INCREF(__pyx_t_2);
+  __pyx_v_ch = ((struct __pyx_obj_6gevent_8resolver_5cares_channel *)__pyx_t_2);
+  __pyx_t_2 = 0;
+
+170:     ch._sock_state_callback(s, read, write)
+
  __pyx_t_2 = ((struct __pyx_vtabstruct_6gevent_8resolver_5cares_channel *)__pyx_v_ch->__pyx_vtab)->_sock_state_callback(__pyx_v_ch, __pyx_v_s, __pyx_v_read, __pyx_v_write); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 170, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
 171: 
+
 172: 
+
+173: cdef class result:
+
struct __pyx_obj_6gevent_8resolver_5cares_result {
+  PyObject_HEAD
+  PyObject *value;
+  PyObject *exception;
+};
+
+
+174:     cdef public object value
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_8resolver_5cares_6result_5value_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_8resolver_5cares_6result_5value_1__get__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_8resolver_5cares_6result_5value___get__(((struct __pyx_obj_6gevent_8resolver_5cares_result *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_8resolver_5cares_6result_5value___get__(struct __pyx_obj_6gevent_8resolver_5cares_result *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __Pyx_INCREF(__pyx_v_self->value);
+  __pyx_r = __pyx_v_self->value;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static int __pyx_pw_6gevent_8resolver_5cares_6result_5value_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
+static int __pyx_pw_6gevent_8resolver_5cares_6result_5value_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_8resolver_5cares_6result_5value_2__set__(((struct __pyx_obj_6gevent_8resolver_5cares_result *)__pyx_v_self), ((PyObject *)__pyx_v_value));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_8resolver_5cares_6result_5value_2__set__(struct __pyx_obj_6gevent_8resolver_5cares_result *__pyx_v_self, PyObject *__pyx_v_value) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__set__", 0);
+  __Pyx_INCREF(__pyx_v_value);
+  __Pyx_GIVEREF(__pyx_v_value);
+  __Pyx_GOTREF(__pyx_v_self->value);
+  __Pyx_DECREF(__pyx_v_self->value);
+  __pyx_v_self->value = __pyx_v_value;
+
+  /* function exit code */
+  __pyx_r = 0;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static int __pyx_pw_6gevent_8resolver_5cares_6result_5value_5__del__(PyObject *__pyx_v_self); /*proto*/
+static int __pyx_pw_6gevent_8resolver_5cares_6result_5value_5__del__(PyObject *__pyx_v_self) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_8resolver_5cares_6result_5value_4__del__(((struct __pyx_obj_6gevent_8resolver_5cares_result *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_8resolver_5cares_6result_5value_4__del__(struct __pyx_obj_6gevent_8resolver_5cares_result *__pyx_v_self) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__del__", 0);
+  __Pyx_INCREF(Py_None);
+  __Pyx_GIVEREF(Py_None);
+  __Pyx_GOTREF(__pyx_v_self->value);
+  __Pyx_DECREF(__pyx_v_self->value);
+  __pyx_v_self->value = Py_None;
+
+  /* function exit code */
+  __pyx_r = 0;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+175:     cdef public object exception
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_8resolver_5cares_6result_9exception_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_8resolver_5cares_6result_9exception_1__get__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_8resolver_5cares_6result_9exception___get__(((struct __pyx_obj_6gevent_8resolver_5cares_result *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_8resolver_5cares_6result_9exception___get__(struct __pyx_obj_6gevent_8resolver_5cares_result *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __Pyx_INCREF(__pyx_v_self->exception);
+  __pyx_r = __pyx_v_self->exception;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static int __pyx_pw_6gevent_8resolver_5cares_6result_9exception_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
+static int __pyx_pw_6gevent_8resolver_5cares_6result_9exception_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_8resolver_5cares_6result_9exception_2__set__(((struct __pyx_obj_6gevent_8resolver_5cares_result *)__pyx_v_self), ((PyObject *)__pyx_v_value));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_8resolver_5cares_6result_9exception_2__set__(struct __pyx_obj_6gevent_8resolver_5cares_result *__pyx_v_self, PyObject *__pyx_v_value) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__set__", 0);
+  __Pyx_INCREF(__pyx_v_value);
+  __Pyx_GIVEREF(__pyx_v_value);
+  __Pyx_GOTREF(__pyx_v_self->exception);
+  __Pyx_DECREF(__pyx_v_self->exception);
+  __pyx_v_self->exception = __pyx_v_value;
+
+  /* function exit code */
+  __pyx_r = 0;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static int __pyx_pw_6gevent_8resolver_5cares_6result_9exception_5__del__(PyObject *__pyx_v_self); /*proto*/
+static int __pyx_pw_6gevent_8resolver_5cares_6result_9exception_5__del__(PyObject *__pyx_v_self) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_8resolver_5cares_6result_9exception_4__del__(((struct __pyx_obj_6gevent_8resolver_5cares_result *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_8resolver_5cares_6result_9exception_4__del__(struct __pyx_obj_6gevent_8resolver_5cares_result *__pyx_v_self) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__del__", 0);
+  __Pyx_INCREF(Py_None);
+  __Pyx_GIVEREF(Py_None);
+  __Pyx_GOTREF(__pyx_v_self->exception);
+  __Pyx_DECREF(__pyx_v_self->exception);
+  __pyx_v_self->exception = Py_None;
+
+  /* function exit code */
+  __pyx_r = 0;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
 176: 
+
+177:     def __init__(self, object value=None, object exception=None):
+
/* Python wrapper */
+static int __pyx_pw_6gevent_8resolver_5cares_6result_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static int __pyx_pw_6gevent_8resolver_5cares_6result_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_value = 0;
+  PyObject *__pyx_v_exception = 0;
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_value,&__pyx_n_s_exception,0};
+    PyObject* values[2] = {0,0};
+    values[0] = ((PyObject *)Py_None);
+    values[1] = ((PyObject *)Py_None);
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value);
+          if (value) { values[0] = value; kw_args--; }
+        }
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_exception);
+          if (value) { values[1] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 177, __pyx_L3_error)
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    __pyx_v_value = values[0];
+    __pyx_v_exception = values[1];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 177, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.resolver.cares.result.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return -1;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_8resolver_5cares_6result___init__(((struct __pyx_obj_6gevent_8resolver_5cares_result *)__pyx_v_self), __pyx_v_value, __pyx_v_exception);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_8resolver_5cares_6result___init__(struct __pyx_obj_6gevent_8resolver_5cares_result *__pyx_v_self, PyObject *__pyx_v_value, PyObject *__pyx_v_exception) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = 0;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+178:         self.value = value
+
  __Pyx_INCREF(__pyx_v_value);
+  __Pyx_GIVEREF(__pyx_v_value);
+  __Pyx_GOTREF(__pyx_v_self->value);
+  __Pyx_DECREF(__pyx_v_self->value);
+  __pyx_v_self->value = __pyx_v_value;
+
+179:         self.exception = exception
+
  __Pyx_INCREF(__pyx_v_exception);
+  __Pyx_GIVEREF(__pyx_v_exception);
+  __Pyx_GOTREF(__pyx_v_self->exception);
+  __Pyx_DECREF(__pyx_v_self->exception);
+  __pyx_v_self->exception = __pyx_v_exception;
+
 180: 
+
+181:     def __repr__(self):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_8resolver_5cares_6result_3__repr__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_8resolver_5cares_6result_3__repr__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_8resolver_5cares_6result_2__repr__(((struct __pyx_obj_6gevent_8resolver_5cares_result *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_8resolver_5cares_6result_2__repr__(struct __pyx_obj_6gevent_8resolver_5cares_result *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__repr__", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_AddTraceback("gevent.resolver.cares.result.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+182:         if self.exception is None:
+
  __pyx_t_1 = (__pyx_v_self->exception == Py_None);
+  __pyx_t_2 = (__pyx_t_1 != 0);
+  if (__pyx_t_2) {
+/* … */
+  }
+
+183:             return '%s(%r)' % (self.__class__.__name__, self.value)
+
    __Pyx_XDECREF(__pyx_r);
+    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 183, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 183, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 183, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_GIVEREF(__pyx_t_4);
+    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
+    __Pyx_INCREF(__pyx_v_self->value);
+    __Pyx_GIVEREF(__pyx_v_self->value);
+    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_self->value);
+    __pyx_t_4 = 0;
+    __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_s_r, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 183, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __pyx_r = __pyx_t_4;
+    __pyx_t_4 = 0;
+    goto __pyx_L0;
+
+184:         elif self.value is None:
+
  __pyx_t_2 = (__pyx_v_self->value == Py_None);
+  __pyx_t_1 = (__pyx_t_2 != 0);
+  if (__pyx_t_1) {
+/* … */
+  }
+
+185:             return '%s(exception=%r)' % (self.__class__.__name__, self.exception)
+
    __Pyx_XDECREF(__pyx_r);
+    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 185, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 185, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 185, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_GIVEREF(__pyx_t_3);
+    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
+    __Pyx_INCREF(__pyx_v_self->exception);
+    __Pyx_GIVEREF(__pyx_v_self->exception);
+    PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_self->exception);
+    __pyx_t_3 = 0;
+    __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_s_exception_r, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 185, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __pyx_r = __pyx_t_3;
+    __pyx_t_3 = 0;
+    goto __pyx_L0;
+
 186:         else:
+
+187:             return '%s(value=%r, exception=%r)' % (self.__class__.__name__, self.value, self.exception)
+
  /*else*/ {
+    __Pyx_XDECREF(__pyx_r);
+    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 187, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 187, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 187, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_GIVEREF(__pyx_t_4);
+    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
+    __Pyx_INCREF(__pyx_v_self->value);
+    __Pyx_GIVEREF(__pyx_v_self->value);
+    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_self->value);
+    __Pyx_INCREF(__pyx_v_self->exception);
+    __Pyx_GIVEREF(__pyx_v_self->exception);
+    PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_self->exception);
+    __pyx_t_4 = 0;
+    __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_s_value_r_exception_r, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 187, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __pyx_r = __pyx_t_4;
+    __pyx_t_4 = 0;
+    goto __pyx_L0;
+  }
+
 188:         # add repr_recursive precaution
+
 189: 
+
+190:     def successful(self):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_8resolver_5cares_6result_5successful(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyObject *__pyx_pw_6gevent_8resolver_5cares_6result_5successful(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("successful (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_8resolver_5cares_6result_4successful(((struct __pyx_obj_6gevent_8resolver_5cares_result *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_8resolver_5cares_6result_4successful(struct __pyx_obj_6gevent_8resolver_5cares_result *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("successful", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_AddTraceback("gevent.resolver.cares.result.successful", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+191:         return self.exception is None
+
  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = (__pyx_v_self->exception == Py_None);
+  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 191, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_r = __pyx_t_2;
+  __pyx_t_2 = 0;
+  goto __pyx_L0;
+
 192: 
+
+193:     def get(self):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_8resolver_5cares_6result_7get(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyObject *__pyx_pw_6gevent_8resolver_5cares_6result_7get(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("get (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_8resolver_5cares_6result_6get(((struct __pyx_obj_6gevent_8resolver_5cares_result *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_8resolver_5cares_6result_6get(struct __pyx_obj_6gevent_8resolver_5cares_result *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("get", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_AddTraceback("gevent.resolver.cares.result.get", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+194:         if self.exception is not None:
+
  __pyx_t_1 = (__pyx_v_self->exception != Py_None);
+  __pyx_t_2 = (__pyx_t_1 != 0);
+  if (unlikely(__pyx_t_2)) {
+/* … */
+  }
+
+195:             raise self.exception
+
    __Pyx_Raise(__pyx_v_self->exception, 0, 0, 0);
+    __PYX_ERR(0, 195, __pyx_L1_error)
+
+196:         return self.value
+
  __Pyx_XDECREF(__pyx_r);
+  __Pyx_INCREF(__pyx_v_self->value);
+  __pyx_r = __pyx_v_self->value;
+  goto __pyx_L0;
+
 197: 
+
 198: 
+
+199: class ares_host_result(tuple):
+
  __pyx_t_27 = PyTuple_New(1); if (unlikely(!__pyx_t_27)) __PYX_ERR(0, 199, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_27);
+  __Pyx_INCREF(((PyObject *)(&PyTuple_Type)));
+  __Pyx_GIVEREF(((PyObject *)(&PyTuple_Type)));
+  PyTuple_SET_ITEM(__pyx_t_27, 0, ((PyObject *)(&PyTuple_Type)));
+  __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_27); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 199, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_26 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_27, __pyx_n_s_ares_host_result, __pyx_n_s_ares_host_result, (PyObject *) NULL, __pyx_n_s_gevent_resolver_cares, (PyObject *) NULL); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 199, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_26);
+/* … */
+  __pyx_t_25 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_ares_host_result, __pyx_t_27, __pyx_t_26, NULL, 0, 0); if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 199, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_25);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ares_host_result, __pyx_t_25) < 0) __PYX_ERR(0, 199, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0;
+  __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0;
+
 200: 
+
+201:     def __new__(cls, family, iterable):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_8resolver_5cares_16ares_host_result_1__new__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyMethodDef __pyx_mdef_6gevent_8resolver_5cares_16ares_host_result_1__new__ = {"__new__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_8resolver_5cares_16ares_host_result_1__new__, METH_VARARGS|METH_KEYWORDS, 0};
+static PyObject *__pyx_pw_6gevent_8resolver_5cares_16ares_host_result_1__new__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_cls = 0;
+  PyObject *__pyx_v_family = 0;
+  PyObject *__pyx_v_iterable = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__new__ (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_cls,&__pyx_n_s_family,&__pyx_n_s_iterable,0};
+    PyObject* values[3] = {0,0,0};
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cls)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_family)) != 0)) kw_args--;
+        else {
+          __Pyx_RaiseArgtupleInvalid("__new__", 1, 3, 3, 1); __PYX_ERR(0, 201, __pyx_L3_error)
+        }
+        CYTHON_FALLTHROUGH;
+        case  2:
+        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_iterable)) != 0)) kw_args--;
+        else {
+          __Pyx_RaiseArgtupleInvalid("__new__", 1, 3, 3, 2); __PYX_ERR(0, 201, __pyx_L3_error)
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__new__") < 0)) __PYX_ERR(0, 201, __pyx_L3_error)
+      }
+    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
+      goto __pyx_L5_argtuple_error;
+    } else {
+      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+    }
+    __pyx_v_cls = values[0];
+    __pyx_v_family = values[1];
+    __pyx_v_iterable = values[2];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("__new__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 201, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.resolver.cares.ares_host_result.__new__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_8resolver_5cares_16ares_host_result___new__(__pyx_self, __pyx_v_cls, __pyx_v_family, __pyx_v_iterable);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_8resolver_5cares_16ares_host_result___new__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_cls, PyObject *__pyx_v_family, PyObject *__pyx_v_iterable) {
+  PyObject *__pyx_v_self = 0;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__new__", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_AddTraceback("gevent.resolver.cares.ares_host_result.__new__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_self);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__5 = PyTuple_Pack(4, __pyx_n_s_cls, __pyx_n_s_family, __pyx_n_s_iterable, __pyx_n_s_self); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 201, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__5);
+  __Pyx_GIVEREF(__pyx_tuple__5);
+/* … */
+  __pyx_t_25 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_8resolver_5cares_16ares_host_result_1__new__, __Pyx_CYFUNCTION_STATICMETHOD, __pyx_n_s_ares_host_result___new, NULL, __pyx_n_s_gevent_resolver_cares, __pyx_d, ((PyObject *)__pyx_codeobj__6)); if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 201, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_25);
+  if (__Pyx_SetNameInClass(__pyx_t_26, __pyx_n_s_new, __pyx_t_25) < 0) __PYX_ERR(0, 201, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0;
+  __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__5, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_resolver_cares_pyx, __pyx_n_s_new, 201, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__6)) __PYX_ERR(0, 201, __pyx_L1_error)
+
+202:         cdef object self = tuple.__new__(cls, iterable)
+
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)(&PyTuple_Type)), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 202, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = NULL;
+  __pyx_t_4 = 0;
+  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+    if (likely(__pyx_t_3)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+      __Pyx_INCREF(__pyx_t_3);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_2, function);
+      __pyx_t_4 = 1;
+    }
+  }
+  #if CYTHON_FAST_PYCALL
+  if (PyFunction_Check(__pyx_t_2)) {
+    PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_cls, __pyx_v_iterable};
+    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 202, __pyx_L1_error)
+    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __Pyx_GOTREF(__pyx_t_1);
+  } else
+  #endif
+  #if CYTHON_FAST_PYCCALL
+  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
+    PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_cls, __pyx_v_iterable};
+    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 202, __pyx_L1_error)
+    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __Pyx_GOTREF(__pyx_t_1);
+  } else
+  #endif
+  {
+    __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 202, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_5);
+    if (__pyx_t_3) {
+      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
+    }
+    __Pyx_INCREF(__pyx_v_cls);
+    __Pyx_GIVEREF(__pyx_v_cls);
+    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_cls);
+    __Pyx_INCREF(__pyx_v_iterable);
+    __Pyx_GIVEREF(__pyx_v_iterable);
+    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_iterable);
+    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 202, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+  }
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_v_self = __pyx_t_1;
+  __pyx_t_1 = 0;
+
+203:         self.family = family
+
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_family, __pyx_v_family) < 0) __PYX_ERR(0, 203, __pyx_L1_error)
+
+204:         return self
+
  __Pyx_XDECREF(__pyx_r);
+  __Pyx_INCREF(__pyx_v_self);
+  __pyx_r = __pyx_v_self;
+  goto __pyx_L0;
+
 205: 
+
+206:     def __getnewargs__(self):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_8resolver_5cares_16ares_host_result_3__getnewargs__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
+static PyMethodDef __pyx_mdef_6gevent_8resolver_5cares_16ares_host_result_3__getnewargs__ = {"__getnewargs__", (PyCFunction)__pyx_pw_6gevent_8resolver_5cares_16ares_host_result_3__getnewargs__, METH_O, 0};
+static PyObject *__pyx_pw_6gevent_8resolver_5cares_16ares_host_result_3__getnewargs__(PyObject *__pyx_self, PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__getnewargs__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_8resolver_5cares_16ares_host_result_2__getnewargs__(__pyx_self, ((PyObject *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_8resolver_5cares_16ares_host_result_2__getnewargs__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__getnewargs__", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_AddTraceback("gevent.resolver.cares.ares_host_result.__getnewargs__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__7 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 206, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__7);
+  __Pyx_GIVEREF(__pyx_tuple__7);
+/* … */
+  __pyx_t_25 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_8resolver_5cares_16ares_host_result_3__getnewargs__, 0, __pyx_n_s_ares_host_result___getnewargs, NULL, __pyx_n_s_gevent_resolver_cares, __pyx_d, ((PyObject *)__pyx_codeobj__8)); if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 206, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_25);
+  if (__Pyx_SetNameInClass(__pyx_t_26, __pyx_n_s_getnewargs, __pyx_t_25) < 0) __PYX_ERR(0, 206, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0;
+
+207:         return (self.family, tuple(self))
+
  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_family); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 207, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = __Pyx_PySequence_Tuple(__pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 207, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 207, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_GIVEREF(__pyx_t_1);
+  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_2);
+  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
+  __pyx_t_1 = 0;
+  __pyx_t_2 = 0;
+  __pyx_r = __pyx_t_3;
+  __pyx_t_3 = 0;
+  goto __pyx_L0;
+
 208: 
+
 209: 
+
+210: cdef void gevent_ares_host_callback(void *arg, int status, int timeouts, hostent* host):
+
static void __pyx_f_6gevent_8resolver_5cares_gevent_ares_host_callback(void *__pyx_v_arg, int __pyx_v_status, CYTHON_UNUSED int __pyx_v_timeouts, struct hostent *__pyx_v_host) {
+  struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_channel = 0;
+  PyObject *__pyx_v_callback = 0;
+  PyObject *__pyx_v_host_result = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("gevent_ares_host_callback", 0);
+/* … */
+  /* function exit code */
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_9);
+  __Pyx_XDECREF(__pyx_t_10);
+  __Pyx_XDECREF(__pyx_t_11);
+  __Pyx_XDECREF(__pyx_t_13);
+  __Pyx_XDECREF(__pyx_t_17);
+  __Pyx_WriteUnraisable("gevent.resolver.cares.gevent_ares_host_callback", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
+  __pyx_L0:;
+  __Pyx_XDECREF((PyObject *)__pyx_v_channel);
+  __Pyx_XDECREF(__pyx_v_callback);
+  __Pyx_XDECREF(__pyx_v_host_result);
+  __Pyx_RefNannyFinishContext();
+}
+
 211:     cdef channel channel
+
 212:     cdef object callback
+
+213:     channel, callback = <tuple>arg
+
  __pyx_t_1 = ((PyObject *)__pyx_v_arg);
+  __Pyx_INCREF(__pyx_t_1);
+  if (likely(__pyx_t_1 != Py_None)) {
+    PyObject* sequence = __pyx_t_1;
+    Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
+    if (unlikely(size != 2)) {
+      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
+      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
+      __PYX_ERR(0, 213, __pyx_L1_error)
+    }
+    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+    __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); 
+    __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); 
+    __Pyx_INCREF(__pyx_t_2);
+    __Pyx_INCREF(__pyx_t_3);
+    #else
+    __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 213, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 213, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    #endif
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  } else {
+    __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(0, 213, __pyx_L1_error)
+  }
+  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_6gevent_8resolver_5cares_channel))))) __PYX_ERR(0, 213, __pyx_L1_error)
+  __pyx_v_channel = ((struct __pyx_obj_6gevent_8resolver_5cares_channel *)__pyx_t_2);
+  __pyx_t_2 = 0;
+  __pyx_v_callback = __pyx_t_3;
+  __pyx_t_3 = 0;
+
+214:     Py_DECREF(<tuple>arg)
+
  Py_DECREF(((PyObject *)__pyx_v_arg));
+
 215:     cdef object host_result
+
+216:     try:
+
  {
+    /*try:*/ {
+/* … */
+    }
+    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+    goto __pyx_L8_try_end;
+    __pyx_L3_error:;
+    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
+    __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
+    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
+    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
+    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+/* … */
+    __Pyx_XGIVEREF(__pyx_t_4);
+    __Pyx_XGIVEREF(__pyx_t_5);
+    __Pyx_XGIVEREF(__pyx_t_6);
+    __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
+    goto __pyx_L1_error;
+    __pyx_L4_exception_handled:;
+    __Pyx_XGIVEREF(__pyx_t_4);
+    __Pyx_XGIVEREF(__pyx_t_5);
+    __Pyx_XGIVEREF(__pyx_t_6);
+    __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
+    __pyx_L8_try_end:;
+  }
+
+217:         if status or not host:
+
      __pyx_t_8 = (__pyx_v_status != 0);
+      if (!__pyx_t_8) {
+      } else {
+        __pyx_t_7 = __pyx_t_8;
+        goto __pyx_L10_bool_binop_done;
+      }
+      __pyx_t_8 = ((!(__pyx_v_host != 0)) != 0);
+      __pyx_t_7 = __pyx_t_8;
+      __pyx_L10_bool_binop_done:;
+      if (__pyx_t_7) {
+/* … */
+        goto __pyx_L9;
+      }
+
+218:             callback(result(None, gaierror(status, strerror(status))))
+
        __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_gaierror); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 218, __pyx_L3_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_status); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 218, __pyx_L3_error)
+        __Pyx_GOTREF(__pyx_t_9);
+        __pyx_t_10 = __Pyx_PyInt_From_int(__pyx_v_status); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 218, __pyx_L3_error)
+        __Pyx_GOTREF(__pyx_t_10);
+        __pyx_t_11 = __pyx_f_6gevent_8resolver_5cares_strerror(__pyx_t_10, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 218, __pyx_L3_error)
+        __Pyx_GOTREF(__pyx_t_11);
+        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+        __pyx_t_10 = NULL;
+        __pyx_t_12 = 0;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
+          __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_2);
+          if (likely(__pyx_t_10)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+            __Pyx_INCREF(__pyx_t_10);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_2, function);
+            __pyx_t_12 = 1;
+          }
+        }
+        #if CYTHON_FAST_PYCALL
+        if (PyFunction_Check(__pyx_t_2)) {
+          PyObject *__pyx_temp[3] = {__pyx_t_10, __pyx_t_9, __pyx_t_11};
+          __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_12, 2+__pyx_t_12); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 218, __pyx_L3_error)
+          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
+          __Pyx_GOTREF(__pyx_t_3);
+          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+        } else
+        #endif
+        #if CYTHON_FAST_PYCCALL
+        if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
+          PyObject *__pyx_temp[3] = {__pyx_t_10, __pyx_t_9, __pyx_t_11};
+          __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_12, 2+__pyx_t_12); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 218, __pyx_L3_error)
+          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
+          __Pyx_GOTREF(__pyx_t_3);
+          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+        } else
+        #endif
+        {
+          __pyx_t_13 = PyTuple_New(2+__pyx_t_12); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 218, __pyx_L3_error)
+          __Pyx_GOTREF(__pyx_t_13);
+          if (__pyx_t_10) {
+            __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_10); __pyx_t_10 = NULL;
+          }
+          __Pyx_GIVEREF(__pyx_t_9);
+          PyTuple_SET_ITEM(__pyx_t_13, 0+__pyx_t_12, __pyx_t_9);
+          __Pyx_GIVEREF(__pyx_t_11);
+          PyTuple_SET_ITEM(__pyx_t_13, 1+__pyx_t_12, __pyx_t_11);
+          __pyx_t_9 = 0;
+          __pyx_t_11 = 0;
+          __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_13, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 218, __pyx_L3_error)
+          __Pyx_GOTREF(__pyx_t_3);
+          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+        }
+        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+        __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 218, __pyx_L3_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        __Pyx_INCREF(Py_None);
+        __Pyx_GIVEREF(Py_None);
+        PyTuple_SET_ITEM(__pyx_t_2, 0, Py_None);
+        __Pyx_GIVEREF(__pyx_t_3);
+        PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3);
+        __pyx_t_3 = 0;
+        __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6gevent_8resolver_5cares_result), __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 218, __pyx_L3_error)
+        __Pyx_GOTREF(__pyx_t_3);
+        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+        __Pyx_INCREF(__pyx_v_callback);
+        __pyx_t_2 = __pyx_v_callback; __pyx_t_13 = NULL;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
+          __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_2);
+          if (likely(__pyx_t_13)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+            __Pyx_INCREF(__pyx_t_13);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_2, function);
+          }
+        }
+        __pyx_t_1 = (__pyx_t_13) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_13, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
+        __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 218, __pyx_L3_error)
+        __Pyx_GOTREF(__pyx_t_1);
+        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 219:         else:
+
+220:             try:
+
      /*else*/ {
+        {
+          /*try:*/ {
+/* … */
+          }
+/* … */
+          __Pyx_XGIVEREF(__pyx_t_14);
+          __Pyx_XGIVEREF(__pyx_t_15);
+          __Pyx_XGIVEREF(__pyx_t_16);
+          __Pyx_ExceptionReset(__pyx_t_14, __pyx_t_15, __pyx_t_16);
+          goto __pyx_L3_error;
+          __pyx_L13_exception_handled:;
+          __Pyx_XGIVEREF(__pyx_t_14);
+          __Pyx_XGIVEREF(__pyx_t_15);
+          __Pyx_XGIVEREF(__pyx_t_16);
+          __Pyx_ExceptionReset(__pyx_t_14, __pyx_t_15, __pyx_t_16);
+          __pyx_L17_try_end:;
+        }
+      }
+      __pyx_L9:;
+
+221:                 host_result = ares_host_result(host.h_addrtype, (parse_h_name(host), parse_h_aliases(host), parse_h_addr_list(host)))
+
            __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ares_host_result); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 221, __pyx_L12_error)
+            __Pyx_GOTREF(__pyx_t_2);
+            __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_host->h_addrtype); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 221, __pyx_L12_error)
+            __Pyx_GOTREF(__pyx_t_3);
+            __pyx_t_13 = parse_h_name(__pyx_v_host); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 221, __pyx_L12_error)
+            __Pyx_GOTREF(__pyx_t_13);
+            __pyx_t_11 = parse_h_aliases(__pyx_v_host); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 221, __pyx_L12_error)
+            __Pyx_GOTREF(__pyx_t_11);
+            __pyx_t_9 = parse_h_addr_list(__pyx_v_host); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 221, __pyx_L12_error)
+            __Pyx_GOTREF(__pyx_t_9);
+            __pyx_t_10 = PyTuple_New(3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 221, __pyx_L12_error)
+            __Pyx_GOTREF(__pyx_t_10);
+            __Pyx_GIVEREF(__pyx_t_13);
+            PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_13);
+            __Pyx_GIVEREF(__pyx_t_11);
+            PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_11);
+            __Pyx_GIVEREF(__pyx_t_9);
+            PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_t_9);
+            __pyx_t_13 = 0;
+            __pyx_t_11 = 0;
+            __pyx_t_9 = 0;
+            __pyx_t_9 = NULL;
+            __pyx_t_12 = 0;
+            if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
+              __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_2);
+              if (likely(__pyx_t_9)) {
+                PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+                __Pyx_INCREF(__pyx_t_9);
+                __Pyx_INCREF(function);
+                __Pyx_DECREF_SET(__pyx_t_2, function);
+                __pyx_t_12 = 1;
+              }
+            }
+            #if CYTHON_FAST_PYCALL
+            if (PyFunction_Check(__pyx_t_2)) {
+              PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_t_3, __pyx_t_10};
+              __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_12, 2+__pyx_t_12); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 221, __pyx_L12_error)
+              __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
+              __Pyx_GOTREF(__pyx_t_1);
+              __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+            } else
+            #endif
+            #if CYTHON_FAST_PYCCALL
+            if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
+              PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_t_3, __pyx_t_10};
+              __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_12, 2+__pyx_t_12); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 221, __pyx_L12_error)
+              __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
+              __Pyx_GOTREF(__pyx_t_1);
+              __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+            } else
+            #endif
+            {
+              __pyx_t_11 = PyTuple_New(2+__pyx_t_12); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 221, __pyx_L12_error)
+              __Pyx_GOTREF(__pyx_t_11);
+              if (__pyx_t_9) {
+                __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_9); __pyx_t_9 = NULL;
+              }
+              __Pyx_GIVEREF(__pyx_t_3);
+              PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_12, __pyx_t_3);
+              __Pyx_GIVEREF(__pyx_t_10);
+              PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_12, __pyx_t_10);
+              __pyx_t_3 = 0;
+              __pyx_t_10 = 0;
+              __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_11, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 221, __pyx_L12_error)
+              __Pyx_GOTREF(__pyx_t_1);
+              __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+            }
+            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+            __pyx_v_host_result = __pyx_t_1;
+            __pyx_t_1 = 0;
+
+222:             except:
+
          /*except:*/ {
+            __Pyx_AddTraceback("gevent.resolver.cares.gevent_ares_host_callback", __pyx_clineno, __pyx_lineno, __pyx_filename);
+            if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_11, &__pyx_t_2) < 0) __PYX_ERR(0, 222, __pyx_L14_except_error)
+            __Pyx_GOTREF(__pyx_t_1);
+            __Pyx_GOTREF(__pyx_t_11);
+            __Pyx_GOTREF(__pyx_t_2);
+
+223:                 callback(result(None, sys.exc_info()[1]))
+
            __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_sys); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 223, __pyx_L14_except_error)
+            __Pyx_GOTREF(__pyx_t_9);
+            __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_exc_info); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 223, __pyx_L14_except_error)
+            __Pyx_GOTREF(__pyx_t_13);
+            __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+            __pyx_t_9 = NULL;
+            if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_13))) {
+              __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_13);
+              if (likely(__pyx_t_9)) {
+                PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13);
+                __Pyx_INCREF(__pyx_t_9);
+                __Pyx_INCREF(function);
+                __Pyx_DECREF_SET(__pyx_t_13, function);
+              }
+            }
+            __pyx_t_3 = (__pyx_t_9) ? __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_t_9) : __Pyx_PyObject_CallNoArg(__pyx_t_13);
+            __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
+            if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 223, __pyx_L14_except_error)
+            __Pyx_GOTREF(__pyx_t_3);
+            __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+            __pyx_t_13 = __Pyx_GetItemInt(__pyx_t_3, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 223, __pyx_L14_except_error)
+            __Pyx_GOTREF(__pyx_t_13);
+            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+            __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 223, __pyx_L14_except_error)
+            __Pyx_GOTREF(__pyx_t_3);
+            __Pyx_INCREF(Py_None);
+            __Pyx_GIVEREF(Py_None);
+            PyTuple_SET_ITEM(__pyx_t_3, 0, Py_None);
+            __Pyx_GIVEREF(__pyx_t_13);
+            PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_13);
+            __pyx_t_13 = 0;
+            __pyx_t_13 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6gevent_8resolver_5cares_result), __pyx_t_3, NULL); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 223, __pyx_L14_except_error)
+            __Pyx_GOTREF(__pyx_t_13);
+            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+            __Pyx_INCREF(__pyx_v_callback);
+            __pyx_t_3 = __pyx_v_callback; __pyx_t_9 = NULL;
+            if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+              __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_3);
+              if (likely(__pyx_t_9)) {
+                PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+                __Pyx_INCREF(__pyx_t_9);
+                __Pyx_INCREF(function);
+                __Pyx_DECREF_SET(__pyx_t_3, function);
+              }
+            }
+            __pyx_t_10 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_9, __pyx_t_13) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_13);
+            __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
+            __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+            if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 223, __pyx_L14_except_error)
+            __Pyx_GOTREF(__pyx_t_10);
+            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+            __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+            __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
+            __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+            goto __pyx_L13_exception_handled;
+          }
+          __pyx_L14_except_error:;
+
 224:             else:
+
+225:                 callback(result(host_result))
+
          /*else:*/ {
+            __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_6gevent_8resolver_5cares_result), __pyx_v_host_result); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 225, __pyx_L14_except_error)
+            __Pyx_GOTREF(__pyx_t_2);
+            __Pyx_INCREF(__pyx_v_callback);
+            __pyx_t_11 = __pyx_v_callback; __pyx_t_10 = NULL;
+            if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_11))) {
+              __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_11);
+              if (likely(__pyx_t_10)) {
+                PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
+                __Pyx_INCREF(__pyx_t_10);
+                __Pyx_INCREF(function);
+                __Pyx_DECREF_SET(__pyx_t_11, function);
+              }
+            }
+            __pyx_t_1 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_11, __pyx_t_10, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_t_2);
+            __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
+            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+            if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 225, __pyx_L14_except_error)
+            __Pyx_GOTREF(__pyx_t_1);
+            __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+          }
+          __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
+          __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
+          __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
+          goto __pyx_L17_try_end;
+          __pyx_L12_error:;
+          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
+          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
+          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
+          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
+          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+226:     except:
+
    /*except:*/ {
+      __Pyx_AddTraceback("gevent.resolver.cares.gevent_ares_host_callback", __pyx_clineno, __pyx_lineno, __pyx_filename);
+      if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_11, &__pyx_t_1) < 0) __PYX_ERR(0, 226, __pyx_L5_except_error)
+      __Pyx_GOTREF(__pyx_t_2);
+      __Pyx_GOTREF(__pyx_t_11);
+      __Pyx_GOTREF(__pyx_t_1);
+
+227:         channel.loop.handle_error(callback, *sys.exc_info())
+
      __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_channel->loop, __pyx_n_s_handle_error); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 227, __pyx_L5_except_error)
+      __Pyx_GOTREF(__pyx_t_10);
+      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 227, __pyx_L5_except_error)
+      __Pyx_GOTREF(__pyx_t_3);
+      __Pyx_INCREF(__pyx_v_callback);
+      __Pyx_GIVEREF(__pyx_v_callback);
+      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_callback);
+      __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_sys); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 227, __pyx_L5_except_error)
+      __Pyx_GOTREF(__pyx_t_9);
+      __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_exc_info); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 227, __pyx_L5_except_error)
+      __Pyx_GOTREF(__pyx_t_17);
+      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+      __pyx_t_9 = NULL;
+      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_17))) {
+        __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_17);
+        if (likely(__pyx_t_9)) {
+          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_17);
+          __Pyx_INCREF(__pyx_t_9);
+          __Pyx_INCREF(function);
+          __Pyx_DECREF_SET(__pyx_t_17, function);
+        }
+      }
+      __pyx_t_13 = (__pyx_t_9) ? __Pyx_PyObject_CallOneArg(__pyx_t_17, __pyx_t_9) : __Pyx_PyObject_CallNoArg(__pyx_t_17);
+      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
+      if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 227, __pyx_L5_except_error)
+      __Pyx_GOTREF(__pyx_t_13);
+      __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
+      __pyx_t_17 = __Pyx_PySequence_Tuple(__pyx_t_13); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 227, __pyx_L5_except_error)
+      __Pyx_GOTREF(__pyx_t_17);
+      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+      __pyx_t_13 = PyNumber_Add(__pyx_t_3, __pyx_t_17); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 227, __pyx_L5_except_error)
+      __Pyx_GOTREF(__pyx_t_13);
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
+      __pyx_t_17 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_13, NULL); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 227, __pyx_L5_except_error)
+      __Pyx_GOTREF(__pyx_t_17);
+      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+      __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
+      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+      __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
+      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+      goto __pyx_L4_exception_handled;
+    }
+    __pyx_L5_except_error:;
+
 228: 
+
 229: 
+
+230: cdef void gevent_ares_nameinfo_callback(void *arg, int status, int timeouts, char *c_node, char *c_service):
+
static void __pyx_f_6gevent_8resolver_5cares_gevent_ares_nameinfo_callback(void *__pyx_v_arg, int __pyx_v_status, CYTHON_UNUSED int __pyx_v_timeouts, char *__pyx_v_c_node, char *__pyx_v_c_service) {
+  struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_channel = 0;
+  PyObject *__pyx_v_callback = 0;
+  PyObject *__pyx_v_node = 0;
+  PyObject *__pyx_v_service = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("gevent_ares_nameinfo_callback", 0);
+/* … */
+  /* function exit code */
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_8);
+  __Pyx_XDECREF(__pyx_t_9);
+  __Pyx_XDECREF(__pyx_t_10);
+  __Pyx_XDECREF(__pyx_t_12);
+  __Pyx_XDECREF(__pyx_t_13);
+  __Pyx_WriteUnraisable("gevent.resolver.cares.gevent_ares_nameinfo_callback", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
+  __pyx_L0:;
+  __Pyx_XDECREF((PyObject *)__pyx_v_channel);
+  __Pyx_XDECREF(__pyx_v_callback);
+  __Pyx_XDECREF(__pyx_v_node);
+  __Pyx_XDECREF(__pyx_v_service);
+  __Pyx_RefNannyFinishContext();
+}
+
 231:     cdef channel channel
+
 232:     cdef object callback
+
+233:     channel, callback = <tuple>arg
+
  __pyx_t_1 = ((PyObject *)__pyx_v_arg);
+  __Pyx_INCREF(__pyx_t_1);
+  if (likely(__pyx_t_1 != Py_None)) {
+    PyObject* sequence = __pyx_t_1;
+    Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
+    if (unlikely(size != 2)) {
+      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
+      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
+      __PYX_ERR(0, 233, __pyx_L1_error)
+    }
+    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+    __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); 
+    __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); 
+    __Pyx_INCREF(__pyx_t_2);
+    __Pyx_INCREF(__pyx_t_3);
+    #else
+    __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 233, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 233, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    #endif
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  } else {
+    __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(0, 233, __pyx_L1_error)
+  }
+  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_6gevent_8resolver_5cares_channel))))) __PYX_ERR(0, 233, __pyx_L1_error)
+  __pyx_v_channel = ((struct __pyx_obj_6gevent_8resolver_5cares_channel *)__pyx_t_2);
+  __pyx_t_2 = 0;
+  __pyx_v_callback = __pyx_t_3;
+  __pyx_t_3 = 0;
+
+234:     Py_DECREF(<tuple>arg)
+
  Py_DECREF(((PyObject *)__pyx_v_arg));
+
 235:     cdef object node
+
 236:     cdef object service
+
+237:     try:
+
  {
+    /*try:*/ {
+/* … */
+    }
+    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+    goto __pyx_L8_try_end;
+    __pyx_L3_error:;
+    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
+    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
+    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
+    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
+    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+/* … */
+    __Pyx_XGIVEREF(__pyx_t_4);
+    __Pyx_XGIVEREF(__pyx_t_5);
+    __Pyx_XGIVEREF(__pyx_t_6);
+    __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
+    goto __pyx_L1_error;
+    __pyx_L4_exception_handled:;
+    __Pyx_XGIVEREF(__pyx_t_4);
+    __Pyx_XGIVEREF(__pyx_t_5);
+    __Pyx_XGIVEREF(__pyx_t_6);
+    __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
+    __pyx_L8_try_end:;
+  }
+
+238:         if status:
+
      __pyx_t_7 = (__pyx_v_status != 0);
+      if (__pyx_t_7) {
+/* … */
+        goto __pyx_L9;
+      }
+
+239:             callback(result(None, gaierror(status, strerror(status))))
+
        __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_gaierror); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 239, __pyx_L3_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_status); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 239, __pyx_L3_error)
+        __Pyx_GOTREF(__pyx_t_8);
+        __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_status); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 239, __pyx_L3_error)
+        __Pyx_GOTREF(__pyx_t_9);
+        __pyx_t_10 = __pyx_f_6gevent_8resolver_5cares_strerror(__pyx_t_9, 0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 239, __pyx_L3_error)
+        __Pyx_GOTREF(__pyx_t_10);
+        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+        __pyx_t_9 = NULL;
+        __pyx_t_11 = 0;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
+          __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_2);
+          if (likely(__pyx_t_9)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+            __Pyx_INCREF(__pyx_t_9);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_2, function);
+            __pyx_t_11 = 1;
+          }
+        }
+        #if CYTHON_FAST_PYCALL
+        if (PyFunction_Check(__pyx_t_2)) {
+          PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_t_8, __pyx_t_10};
+          __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 239, __pyx_L3_error)
+          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
+          __Pyx_GOTREF(__pyx_t_3);
+          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+        } else
+        #endif
+        #if CYTHON_FAST_PYCCALL
+        if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
+          PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_t_8, __pyx_t_10};
+          __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 239, __pyx_L3_error)
+          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
+          __Pyx_GOTREF(__pyx_t_3);
+          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+        } else
+        #endif
+        {
+          __pyx_t_12 = PyTuple_New(2+__pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 239, __pyx_L3_error)
+          __Pyx_GOTREF(__pyx_t_12);
+          if (__pyx_t_9) {
+            __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_9); __pyx_t_9 = NULL;
+          }
+          __Pyx_GIVEREF(__pyx_t_8);
+          PyTuple_SET_ITEM(__pyx_t_12, 0+__pyx_t_11, __pyx_t_8);
+          __Pyx_GIVEREF(__pyx_t_10);
+          PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_11, __pyx_t_10);
+          __pyx_t_8 = 0;
+          __pyx_t_10 = 0;
+          __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_12, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 239, __pyx_L3_error)
+          __Pyx_GOTREF(__pyx_t_3);
+          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
+        }
+        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+        __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 239, __pyx_L3_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        __Pyx_INCREF(Py_None);
+        __Pyx_GIVEREF(Py_None);
+        PyTuple_SET_ITEM(__pyx_t_2, 0, Py_None);
+        __Pyx_GIVEREF(__pyx_t_3);
+        PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3);
+        __pyx_t_3 = 0;
+        __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6gevent_8resolver_5cares_result), __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 239, __pyx_L3_error)
+        __Pyx_GOTREF(__pyx_t_3);
+        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+        __Pyx_INCREF(__pyx_v_callback);
+        __pyx_t_2 = __pyx_v_callback; __pyx_t_12 = NULL;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
+          __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_2);
+          if (likely(__pyx_t_12)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+            __Pyx_INCREF(__pyx_t_12);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_2, function);
+          }
+        }
+        __pyx_t_1 = (__pyx_t_12) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_12, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
+        __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 239, __pyx_L3_error)
+        __Pyx_GOTREF(__pyx_t_1);
+        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 240:         else:
+
+241:             if c_node:
+
      /*else*/ {
+        __pyx_t_7 = (__pyx_v_c_node != 0);
+        if (__pyx_t_7) {
+/* … */
+          goto __pyx_L10;
+        }
+
+242:                 node = PyUnicode_FromString(c_node)
+
          __pyx_t_1 = PyUnicode_FromString(__pyx_v_c_node); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 242, __pyx_L3_error)
+          __Pyx_GOTREF(__pyx_t_1);
+          __pyx_v_node = __pyx_t_1;
+          __pyx_t_1 = 0;
+
 243:             else:
+
+244:                 node = None
+
        /*else*/ {
+          __Pyx_INCREF(Py_None);
+          __pyx_v_node = Py_None;
+        }
+        __pyx_L10:;
+
+245:             if c_service:
+
        __pyx_t_7 = (__pyx_v_c_service != 0);
+        if (__pyx_t_7) {
+/* … */
+          goto __pyx_L11;
+        }
+
+246:                 service = PyUnicode_FromString(c_service)
+
          __pyx_t_1 = PyUnicode_FromString(__pyx_v_c_service); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 246, __pyx_L3_error)
+          __Pyx_GOTREF(__pyx_t_1);
+          __pyx_v_service = __pyx_t_1;
+          __pyx_t_1 = 0;
+
 247:             else:
+
+248:                 service = None
+
        /*else*/ {
+          __Pyx_INCREF(Py_None);
+          __pyx_v_service = Py_None;
+        }
+        __pyx_L11:;
+
+249:             callback(result((node, service)))
+
        __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 249, __pyx_L3_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        __Pyx_INCREF(__pyx_v_node);
+        __Pyx_GIVEREF(__pyx_v_node);
+        PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_node);
+        __Pyx_INCREF(__pyx_v_service);
+        __Pyx_GIVEREF(__pyx_v_service);
+        PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_service);
+        __pyx_t_3 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_6gevent_8resolver_5cares_result), __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 249, __pyx_L3_error)
+        __Pyx_GOTREF(__pyx_t_3);
+        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+        __Pyx_INCREF(__pyx_v_callback);
+        __pyx_t_2 = __pyx_v_callback; __pyx_t_12 = NULL;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
+          __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_2);
+          if (likely(__pyx_t_12)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+            __Pyx_INCREF(__pyx_t_12);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_2, function);
+          }
+        }
+        __pyx_t_1 = (__pyx_t_12) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_12, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
+        __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 249, __pyx_L3_error)
+        __Pyx_GOTREF(__pyx_t_1);
+        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      }
+      __pyx_L9:;
+
+250:     except:
+
    /*except:*/ {
+      __Pyx_AddTraceback("gevent.resolver.cares.gevent_ares_nameinfo_callback", __pyx_clineno, __pyx_lineno, __pyx_filename);
+      if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3) < 0) __PYX_ERR(0, 250, __pyx_L5_except_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      __Pyx_GOTREF(__pyx_t_2);
+      __Pyx_GOTREF(__pyx_t_3);
+
+251:         channel.loop.handle_error(callback, *sys.exc_info())
+
      __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_channel->loop, __pyx_n_s_handle_error); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 251, __pyx_L5_except_error)
+      __Pyx_GOTREF(__pyx_t_12);
+      __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 251, __pyx_L5_except_error)
+      __Pyx_GOTREF(__pyx_t_10);
+      __Pyx_INCREF(__pyx_v_callback);
+      __Pyx_GIVEREF(__pyx_v_callback);
+      PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v_callback);
+      __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_sys); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 251, __pyx_L5_except_error)
+      __Pyx_GOTREF(__pyx_t_9);
+      __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_exc_info); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 251, __pyx_L5_except_error)
+      __Pyx_GOTREF(__pyx_t_13);
+      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+      __pyx_t_9 = NULL;
+      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_13))) {
+        __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_13);
+        if (likely(__pyx_t_9)) {
+          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13);
+          __Pyx_INCREF(__pyx_t_9);
+          __Pyx_INCREF(function);
+          __Pyx_DECREF_SET(__pyx_t_13, function);
+        }
+      }
+      __pyx_t_8 = (__pyx_t_9) ? __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_t_9) : __Pyx_PyObject_CallNoArg(__pyx_t_13);
+      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
+      if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 251, __pyx_L5_except_error)
+      __Pyx_GOTREF(__pyx_t_8);
+      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+      __pyx_t_13 = __Pyx_PySequence_Tuple(__pyx_t_8); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 251, __pyx_L5_except_error)
+      __Pyx_GOTREF(__pyx_t_13);
+      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+      __pyx_t_8 = PyNumber_Add(__pyx_t_10, __pyx_t_13); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 251, __pyx_L5_except_error)
+      __Pyx_GOTREF(__pyx_t_8);
+      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+      __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_8, NULL); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 251, __pyx_L5_except_error)
+      __Pyx_GOTREF(__pyx_t_13);
+      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
+      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+      goto __pyx_L4_exception_handled;
+    }
+    __pyx_L5_except_error:;
+
 252: 
+
 253: 
+
+254: cdef class channel:
+
struct __pyx_obj_6gevent_8resolver_5cares_channel {
+  PyObject_HEAD
+  struct __pyx_vtabstruct_6gevent_8resolver_5cares_channel *__pyx_vtab;
+  PyObject *loop;
+  struct ares_channeldata *channel;
+  PyObject *_watchers;
+  PyObject *_timer;
+};
+
+
+
+struct __pyx_vtabstruct_6gevent_8resolver_5cares_channel {
+  PyObject *(*set_servers)(struct __pyx_obj_6gevent_8resolver_5cares_channel *, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_8resolver_5cares_7channel_set_servers *__pyx_optional_args);
+  PyObject *(*_sock_state_callback)(struct __pyx_obj_6gevent_8resolver_5cares_channel *, int, int, int);
+  PyObject *(*_getnameinfo)(struct __pyx_obj_6gevent_8resolver_5cares_channel *, PyObject *, PyObject *, int, int __pyx_skip_dispatch);
+};
+static struct __pyx_vtabstruct_6gevent_8resolver_5cares_channel *__pyx_vtabptr_6gevent_8resolver_5cares_channel;
+
 255: 
+
+256:     cdef public object loop
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_4loop_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_4loop_1__get__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_8resolver_5cares_7channel_4loop___get__(((struct __pyx_obj_6gevent_8resolver_5cares_channel *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_8resolver_5cares_7channel_4loop___get__(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __Pyx_INCREF(__pyx_v_self->loop);
+  __pyx_r = __pyx_v_self->loop;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static int __pyx_pw_6gevent_8resolver_5cares_7channel_4loop_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
+static int __pyx_pw_6gevent_8resolver_5cares_7channel_4loop_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_8resolver_5cares_7channel_4loop_2__set__(((struct __pyx_obj_6gevent_8resolver_5cares_channel *)__pyx_v_self), ((PyObject *)__pyx_v_value));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_8resolver_5cares_7channel_4loop_2__set__(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self, PyObject *__pyx_v_value) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__set__", 0);
+  __Pyx_INCREF(__pyx_v_value);
+  __Pyx_GIVEREF(__pyx_v_value);
+  __Pyx_GOTREF(__pyx_v_self->loop);
+  __Pyx_DECREF(__pyx_v_self->loop);
+  __pyx_v_self->loop = __pyx_v_value;
+
+  /* function exit code */
+  __pyx_r = 0;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static int __pyx_pw_6gevent_8resolver_5cares_7channel_4loop_5__del__(PyObject *__pyx_v_self); /*proto*/
+static int __pyx_pw_6gevent_8resolver_5cares_7channel_4loop_5__del__(PyObject *__pyx_v_self) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_8resolver_5cares_7channel_4loop_4__del__(((struct __pyx_obj_6gevent_8resolver_5cares_channel *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_8resolver_5cares_7channel_4loop_4__del__(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__del__", 0);
+  __Pyx_INCREF(Py_None);
+  __Pyx_GIVEREF(Py_None);
+  __Pyx_GOTREF(__pyx_v_self->loop);
+  __Pyx_DECREF(__pyx_v_self->loop);
+  __pyx_v_self->loop = Py_None;
+
+  /* function exit code */
+  __pyx_r = 0;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
 257:     cdef ares_channeldata* channel
+
+258:     cdef public dict _watchers
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_9_watchers_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_9_watchers_1__get__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_8resolver_5cares_7channel_9_watchers___get__(((struct __pyx_obj_6gevent_8resolver_5cares_channel *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_8resolver_5cares_7channel_9_watchers___get__(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __Pyx_INCREF(__pyx_v_self->_watchers);
+  __pyx_r = __pyx_v_self->_watchers;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static int __pyx_pw_6gevent_8resolver_5cares_7channel_9_watchers_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
+static int __pyx_pw_6gevent_8resolver_5cares_7channel_9_watchers_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_8resolver_5cares_7channel_9_watchers_2__set__(((struct __pyx_obj_6gevent_8resolver_5cares_channel *)__pyx_v_self), ((PyObject *)__pyx_v_value));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_8resolver_5cares_7channel_9_watchers_2__set__(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self, PyObject *__pyx_v_value) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__set__", 0);
+  if (!(likely(PyDict_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_v_value)->tp_name), 0))) __PYX_ERR(0, 258, __pyx_L1_error)
+  __pyx_t_1 = __pyx_v_value;
+  __Pyx_INCREF(__pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_1);
+  __Pyx_GOTREF(__pyx_v_self->_watchers);
+  __Pyx_DECREF(__pyx_v_self->_watchers);
+  __pyx_v_self->_watchers = ((PyObject*)__pyx_t_1);
+  __pyx_t_1 = 0;
+
+  /* function exit code */
+  __pyx_r = 0;
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.resolver.cares.channel._watchers.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = -1;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static int __pyx_pw_6gevent_8resolver_5cares_7channel_9_watchers_5__del__(PyObject *__pyx_v_self); /*proto*/
+static int __pyx_pw_6gevent_8resolver_5cares_7channel_9_watchers_5__del__(PyObject *__pyx_v_self) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_8resolver_5cares_7channel_9_watchers_4__del__(((struct __pyx_obj_6gevent_8resolver_5cares_channel *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_8resolver_5cares_7channel_9_watchers_4__del__(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__del__", 0);
+  __Pyx_INCREF(Py_None);
+  __Pyx_GIVEREF(Py_None);
+  __Pyx_GOTREF(__pyx_v_self->_watchers);
+  __Pyx_DECREF(__pyx_v_self->_watchers);
+  __pyx_v_self->_watchers = ((PyObject*)Py_None);
+
+  /* function exit code */
+  __pyx_r = 0;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+259:     cdef public object _timer
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_6_timer_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_6_timer_1__get__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_8resolver_5cares_7channel_6_timer___get__(((struct __pyx_obj_6gevent_8resolver_5cares_channel *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_8resolver_5cares_7channel_6_timer___get__(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __Pyx_INCREF(__pyx_v_self->_timer);
+  __pyx_r = __pyx_v_self->_timer;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static int __pyx_pw_6gevent_8resolver_5cares_7channel_6_timer_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
+static int __pyx_pw_6gevent_8resolver_5cares_7channel_6_timer_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_8resolver_5cares_7channel_6_timer_2__set__(((struct __pyx_obj_6gevent_8resolver_5cares_channel *)__pyx_v_self), ((PyObject *)__pyx_v_value));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_8resolver_5cares_7channel_6_timer_2__set__(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self, PyObject *__pyx_v_value) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__set__", 0);
+  __Pyx_INCREF(__pyx_v_value);
+  __Pyx_GIVEREF(__pyx_v_value);
+  __Pyx_GOTREF(__pyx_v_self->_timer);
+  __Pyx_DECREF(__pyx_v_self->_timer);
+  __pyx_v_self->_timer = __pyx_v_value;
+
+  /* function exit code */
+  __pyx_r = 0;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static int __pyx_pw_6gevent_8resolver_5cares_7channel_6_timer_5__del__(PyObject *__pyx_v_self); /*proto*/
+static int __pyx_pw_6gevent_8resolver_5cares_7channel_6_timer_5__del__(PyObject *__pyx_v_self) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_8resolver_5cares_7channel_6_timer_4__del__(((struct __pyx_obj_6gevent_8resolver_5cares_channel *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_8resolver_5cares_7channel_6_timer_4__del__(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__del__", 0);
+  __Pyx_INCREF(Py_None);
+  __Pyx_GIVEREF(Py_None);
+  __Pyx_GOTREF(__pyx_v_self->_timer);
+  __Pyx_DECREF(__pyx_v_self->_timer);
+  __pyx_v_self->_timer = Py_None;
+
+  /* function exit code */
+  __pyx_r = 0;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
 260: 
+
+261:     def __init__(self, object loop, flags=None, timeout=None, tries=None, ndots=None,
+
/* Python wrapper */
+static int __pyx_pw_6gevent_8resolver_5cares_7channel_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static int __pyx_pw_6gevent_8resolver_5cares_7channel_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_loop = 0;
+  PyObject *__pyx_v_flags = 0;
+  PyObject *__pyx_v_timeout = 0;
+  PyObject *__pyx_v_tries = 0;
+  PyObject *__pyx_v_ndots = 0;
+  PyObject *__pyx_v_udp_port = 0;
+  PyObject *__pyx_v_tcp_port = 0;
+  PyObject *__pyx_v_servers = 0;
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_loop,&__pyx_n_s_flags,&__pyx_n_s_timeout,&__pyx_n_s_tries,&__pyx_n_s_ndots,&__pyx_n_s_udp_port,&__pyx_n_s_tcp_port,&__pyx_n_s_servers,0};
+    PyObject* values[8] = {0,0,0,0,0,0,0,0};
+    values[1] = ((PyObject *)Py_None);
+    values[2] = ((PyObject *)Py_None);
+    values[3] = ((PyObject *)Py_None);
+    values[4] = ((PyObject *)Py_None);
+/* … */
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_8resolver_5cares_7channel___init__(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self, PyObject *__pyx_v_loop, PyObject *__pyx_v_flags, PyObject *__pyx_v_timeout, PyObject *__pyx_v_tries, PyObject *__pyx_v_ndots, PyObject *__pyx_v_udp_port, PyObject *__pyx_v_tcp_port, PyObject *__pyx_v_servers) {
+  struct ares_channeldata *__pyx_v_channel;
+  struct ares_options __pyx_v_options;
+  int __pyx_v_optmask;
+  int __pyx_v_result;
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = 0;
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_7);
+  __Pyx_XDECREF(__pyx_t_8);
+  __Pyx_XDECREF(__pyx_t_9);
+  __Pyx_XDECREF(__pyx_t_10);
+  __Pyx_XDECREF(__pyx_t_11);
+  __Pyx_AddTraceback("gevent.resolver.cares.channel.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = -1;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+262:                  udp_port=None, tcp_port=None, servers=None):
+
    values[5] = ((PyObject *)Py_None);
+    values[6] = ((PyObject *)Py_None);
+    values[7] = ((PyObject *)Py_None);
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
+        CYTHON_FALLTHROUGH;
+        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
+        CYTHON_FALLTHROUGH;
+        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
+        CYTHON_FALLTHROUGH;
+        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
+        CYTHON_FALLTHROUGH;
+        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
+        CYTHON_FALLTHROUGH;
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_loop)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flags);
+          if (value) { values[1] = value; kw_args--; }
+        }
+        CYTHON_FALLTHROUGH;
+        case  2:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_timeout);
+          if (value) { values[2] = value; kw_args--; }
+        }
+        CYTHON_FALLTHROUGH;
+        case  3:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tries);
+          if (value) { values[3] = value; kw_args--; }
+        }
+        CYTHON_FALLTHROUGH;
+        case  4:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ndots);
+          if (value) { values[4] = value; kw_args--; }
+        }
+        CYTHON_FALLTHROUGH;
+        case  5:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_udp_port);
+          if (value) { values[5] = value; kw_args--; }
+        }
+        CYTHON_FALLTHROUGH;
+        case  6:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tcp_port);
+          if (value) { values[6] = value; kw_args--; }
+        }
+        CYTHON_FALLTHROUGH;
+        case  7:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_servers);
+          if (value) { values[7] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 261, __pyx_L3_error)
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
+        CYTHON_FALLTHROUGH;
+        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
+        CYTHON_FALLTHROUGH;
+        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
+        CYTHON_FALLTHROUGH;
+        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
+        CYTHON_FALLTHROUGH;
+        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
+        CYTHON_FALLTHROUGH;
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    __pyx_v_loop = values[0];
+    __pyx_v_flags = values[1];
+    __pyx_v_timeout = values[2];
+    __pyx_v_tries = values[3];
+    __pyx_v_ndots = values[4];
+    __pyx_v_udp_port = values[5];
+    __pyx_v_tcp_port = values[6];
+    __pyx_v_servers = values[7];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 8, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 261, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.resolver.cares.channel.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return -1;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_8resolver_5cares_7channel___init__(((struct __pyx_obj_6gevent_8resolver_5cares_channel *)__pyx_v_self), __pyx_v_loop, __pyx_v_flags, __pyx_v_timeout, __pyx_v_tries, __pyx_v_ndots, __pyx_v_udp_port, __pyx_v_tcp_port, __pyx_v_servers);
+
+263:         cdef ares_channeldata* channel = NULL
+
  __pyx_v_channel = NULL;
+
 264:         cdef cares.ares_options options
+
+265:         memset(&options, 0, sizeof(cares.ares_options))
+
  memset((&__pyx_v_options), 0, (sizeof(struct ares_options)));
+
+266:         cdef int optmask = cares.ARES_OPT_SOCK_STATE_CB
+
  __pyx_v_optmask = ARES_OPT_SOCK_STATE_CB;
+
+267:         options.sock_state_cb = <void*>gevent_sock_state_callback
+
  __pyx_v_options.sock_state_cb = ((void *)__pyx_f_6gevent_8resolver_5cares_gevent_sock_state_callback);
+
+268:         options.sock_state_cb_data = <void*>self
+
  __pyx_v_options.sock_state_cb_data = ((void *)__pyx_v_self);
+
+269:         if flags is not None:
+
  __pyx_t_1 = (__pyx_v_flags != Py_None);
+  __pyx_t_2 = (__pyx_t_1 != 0);
+  if (__pyx_t_2) {
+/* … */
+  }
+
+270:             options.flags = int(flags)
+
    __pyx_t_3 = __Pyx_PyNumber_Int(__pyx_v_flags); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 270, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 270, __pyx_L1_error)
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __pyx_v_options.flags = __pyx_t_4;
+
+271:             optmask |= cares.ARES_OPT_FLAGS
+
    __pyx_v_optmask = (__pyx_v_optmask | ARES_OPT_FLAGS);
+
+272:         if timeout is not None:
+
  __pyx_t_2 = (__pyx_v_timeout != Py_None);
+  __pyx_t_1 = (__pyx_t_2 != 0);
+  if (__pyx_t_1) {
+/* … */
+  }
+
+273:             options.timeout = int(float(timeout) * 1000)
+
    __pyx_t_5 = __Pyx_PyObject_AsDouble(__pyx_v_timeout); if (unlikely(__pyx_t_5 == ((double)((double)-1)) && PyErr_Occurred())) __PYX_ERR(0, 273, __pyx_L1_error)
+    __pyx_v_options.timeout = ((int)(__pyx_t_5 * 1000.0));
+
+274:             optmask |= cares.ARES_OPT_TIMEOUTMS
+
    __pyx_v_optmask = (__pyx_v_optmask | ARES_OPT_TIMEOUTMS);
+
+275:         if tries is not None:
+
  __pyx_t_1 = (__pyx_v_tries != Py_None);
+  __pyx_t_2 = (__pyx_t_1 != 0);
+  if (__pyx_t_2) {
+/* … */
+  }
+
+276:             options.tries = int(tries)
+
    __pyx_t_3 = __Pyx_PyNumber_Int(__pyx_v_tries); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 276, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 276, __pyx_L1_error)
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __pyx_v_options.tries = __pyx_t_4;
+
+277:             optmask |= cares.ARES_OPT_TRIES
+
    __pyx_v_optmask = (__pyx_v_optmask | ARES_OPT_TRIES);
+
+278:         if ndots is not None:
+
  __pyx_t_2 = (__pyx_v_ndots != Py_None);
+  __pyx_t_1 = (__pyx_t_2 != 0);
+  if (__pyx_t_1) {
+/* … */
+  }
+
+279:             options.ndots = int(ndots)
+
    __pyx_t_3 = __Pyx_PyNumber_Int(__pyx_v_ndots); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 279, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 279, __pyx_L1_error)
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __pyx_v_options.ndots = __pyx_t_4;
+
+280:             optmask |= cares.ARES_OPT_NDOTS
+
    __pyx_v_optmask = (__pyx_v_optmask | ARES_OPT_NDOTS);
+
+281:         if udp_port is not None:
+
  __pyx_t_1 = (__pyx_v_udp_port != Py_None);
+  __pyx_t_2 = (__pyx_t_1 != 0);
+  if (__pyx_t_2) {
+/* … */
+  }
+
+282:             options.udp_port = int(udp_port)
+
    __pyx_t_3 = __Pyx_PyNumber_Int(__pyx_v_udp_port); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 282, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __pyx_t_6 = __Pyx_PyInt_As_unsigned_short(__pyx_t_3); if (unlikely((__pyx_t_6 == (unsigned short)-1) && PyErr_Occurred())) __PYX_ERR(0, 282, __pyx_L1_error)
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __pyx_v_options.udp_port = __pyx_t_6;
+
+283:             optmask |= cares.ARES_OPT_UDP_PORT
+
    __pyx_v_optmask = (__pyx_v_optmask | ARES_OPT_UDP_PORT);
+
+284:         if tcp_port is not None:
+
  __pyx_t_2 = (__pyx_v_tcp_port != Py_None);
+  __pyx_t_1 = (__pyx_t_2 != 0);
+  if (__pyx_t_1) {
+/* … */
+  }
+
+285:             options.tcp_port = int(tcp_port)
+
    __pyx_t_3 = __Pyx_PyNumber_Int(__pyx_v_tcp_port); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 285, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __pyx_t_6 = __Pyx_PyInt_As_unsigned_short(__pyx_t_3); if (unlikely((__pyx_t_6 == (unsigned short)-1) && PyErr_Occurred())) __PYX_ERR(0, 285, __pyx_L1_error)
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __pyx_v_options.tcp_port = __pyx_t_6;
+
+286:             optmask |= cares.ARES_OPT_TCP_PORT
+
    __pyx_v_optmask = (__pyx_v_optmask | ARES_OPT_TCP_PORT);
+
+287:         cdef int result = cares.ares_library_init(cares.ARES_LIB_INIT_ALL)  # ARES_LIB_INIT_WIN32 -DUSE_WINSOCK?
+
  __pyx_v_result = ares_library_init(ARES_LIB_INIT_ALL);
+
+288:         if result:
+
  __pyx_t_1 = (__pyx_v_result != 0);
+  if (unlikely(__pyx_t_1)) {
+/* … */
+  }
+
+289:             raise gaierror(result, strerror(result))
+
    __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_gaierror); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 289, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_7);
+    __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_result); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 289, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_8);
+    __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_result); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 289, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_9);
+    __pyx_t_10 = __pyx_f_6gevent_8resolver_5cares_strerror(__pyx_t_9, 0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 289, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_10);
+    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+    __pyx_t_9 = NULL;
+    __pyx_t_4 = 0;
+    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
+      __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_7);
+      if (likely(__pyx_t_9)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
+        __Pyx_INCREF(__pyx_t_9);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_7, function);
+        __pyx_t_4 = 1;
+      }
+    }
+    #if CYTHON_FAST_PYCALL
+    if (PyFunction_Check(__pyx_t_7)) {
+      PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_t_8, __pyx_t_10};
+      __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 289, __pyx_L1_error)
+      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
+      __Pyx_GOTREF(__pyx_t_3);
+      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+    } else
+    #endif
+    #if CYTHON_FAST_PYCCALL
+    if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
+      PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_t_8, __pyx_t_10};
+      __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 289, __pyx_L1_error)
+      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
+      __Pyx_GOTREF(__pyx_t_3);
+      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+    } else
+    #endif
+    {
+      __pyx_t_11 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 289, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_11);
+      if (__pyx_t_9) {
+        __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_9); __pyx_t_9 = NULL;
+      }
+      __Pyx_GIVEREF(__pyx_t_8);
+      PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_4, __pyx_t_8);
+      __Pyx_GIVEREF(__pyx_t_10);
+      PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_4, __pyx_t_10);
+      __pyx_t_8 = 0;
+      __pyx_t_10 = 0;
+      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_11, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 289, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_3);
+      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+    }
+    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __PYX_ERR(0, 289, __pyx_L1_error)
+
+290:         result = cares.ares_init_options(&channel, &options, optmask)
+
  __pyx_v_result = ares_init_options((&__pyx_v_channel), (&__pyx_v_options), __pyx_v_optmask);
+
+291:         if result:
+
  __pyx_t_1 = (__pyx_v_result != 0);
+  if (unlikely(__pyx_t_1)) {
+/* … */
+  }
+
+292:             raise gaierror(result, strerror(result))
+
    __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_gaierror); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 292, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_7);
+    __pyx_t_11 = __Pyx_PyInt_From_int(__pyx_v_result); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 292, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_11);
+    __pyx_t_10 = __Pyx_PyInt_From_int(__pyx_v_result); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 292, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_10);
+    __pyx_t_8 = __pyx_f_6gevent_8resolver_5cares_strerror(__pyx_t_10, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 292, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_8);
+    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+    __pyx_t_10 = NULL;
+    __pyx_t_4 = 0;
+    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
+      __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_7);
+      if (likely(__pyx_t_10)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
+        __Pyx_INCREF(__pyx_t_10);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_7, function);
+        __pyx_t_4 = 1;
+      }
+    }
+    #if CYTHON_FAST_PYCALL
+    if (PyFunction_Check(__pyx_t_7)) {
+      PyObject *__pyx_temp[3] = {__pyx_t_10, __pyx_t_11, __pyx_t_8};
+      __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 292, __pyx_L1_error)
+      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
+      __Pyx_GOTREF(__pyx_t_3);
+      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+    } else
+    #endif
+    #if CYTHON_FAST_PYCCALL
+    if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
+      PyObject *__pyx_temp[3] = {__pyx_t_10, __pyx_t_11, __pyx_t_8};
+      __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 292, __pyx_L1_error)
+      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
+      __Pyx_GOTREF(__pyx_t_3);
+      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+    } else
+    #endif
+    {
+      __pyx_t_9 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 292, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_9);
+      if (__pyx_t_10) {
+        __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_10); __pyx_t_10 = NULL;
+      }
+      __Pyx_GIVEREF(__pyx_t_11);
+      PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_4, __pyx_t_11);
+      __Pyx_GIVEREF(__pyx_t_8);
+      PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_4, __pyx_t_8);
+      __pyx_t_11 = 0;
+      __pyx_t_8 = 0;
+      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 292, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_3);
+      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+    }
+    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __PYX_ERR(0, 292, __pyx_L1_error)
+
+293:         self._timer = loop.timer(TIMEOUT, TIMEOUT)
+
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_loop, __pyx_n_s_timer); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 293, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_7);
+  __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_TIMEOUT); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 293, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_9);
+  __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_TIMEOUT); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 293, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_8);
+  __pyx_t_11 = NULL;
+  __pyx_t_4 = 0;
+  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
+    __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_7);
+    if (likely(__pyx_t_11)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
+      __Pyx_INCREF(__pyx_t_11);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_7, function);
+      __pyx_t_4 = 1;
+    }
+  }
+  #if CYTHON_FAST_PYCALL
+  if (PyFunction_Check(__pyx_t_7)) {
+    PyObject *__pyx_temp[3] = {__pyx_t_11, __pyx_t_9, __pyx_t_8};
+    __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 293, __pyx_L1_error)
+    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+  } else
+  #endif
+  #if CYTHON_FAST_PYCCALL
+  if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
+    PyObject *__pyx_temp[3] = {__pyx_t_11, __pyx_t_9, __pyx_t_8};
+    __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 293, __pyx_L1_error)
+    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+  } else
+  #endif
+  {
+    __pyx_t_10 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 293, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_10);
+    if (__pyx_t_11) {
+      __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_11); __pyx_t_11 = NULL;
+    }
+    __Pyx_GIVEREF(__pyx_t_9);
+    PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_4, __pyx_t_9);
+    __Pyx_GIVEREF(__pyx_t_8);
+    PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_4, __pyx_t_8);
+    __pyx_t_9 = 0;
+    __pyx_t_8 = 0;
+    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_10, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 293, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+  }
+  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __Pyx_GIVEREF(__pyx_t_3);
+  __Pyx_GOTREF(__pyx_v_self->_timer);
+  __Pyx_DECREF(__pyx_v_self->_timer);
+  __pyx_v_self->_timer = __pyx_t_3;
+  __pyx_t_3 = 0;
+
+294:         self._watchers = {}
+
  __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 294, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_GIVEREF(__pyx_t_3);
+  __Pyx_GOTREF(__pyx_v_self->_watchers);
+  __Pyx_DECREF(__pyx_v_self->_watchers);
+  __pyx_v_self->_watchers = ((PyObject*)__pyx_t_3);
+  __pyx_t_3 = 0;
+
+295:         self.channel = channel
+
  __pyx_v_self->channel = __pyx_v_channel;
+
+296:         try:
+
  {
+    /*try:*/ {
+/* … */
+    }
+    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
+    __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
+    __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
+    goto __pyx_L16_try_end;
+    __pyx_L11_error:;
+    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
+    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
+    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
+    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
+    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+/* … */
+    __Pyx_XGIVEREF(__pyx_t_12);
+    __Pyx_XGIVEREF(__pyx_t_13);
+    __Pyx_XGIVEREF(__pyx_t_14);
+    __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14);
+    goto __pyx_L1_error;
+    __pyx_L16_try_end:;
+  }
+
+297:             if servers is not None:
+
      __pyx_t_1 = (__pyx_v_servers != Py_None);
+      __pyx_t_2 = (__pyx_t_1 != 0);
+      if (__pyx_t_2) {
+/* … */
+      }
+
+298:                 self.set_servers(servers)
+
        __pyx_t_15.__pyx_n = 1;
+        __pyx_t_15.servers = __pyx_v_servers;
+        __pyx_t_3 = ((struct __pyx_vtabstruct_6gevent_8resolver_5cares_channel *)__pyx_v_self->__pyx_vtab)->set_servers(__pyx_v_self, 0, &__pyx_t_15); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 298, __pyx_L11_error)
+        __Pyx_GOTREF(__pyx_t_3);
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+
+299:             self.loop = loop
+
      __Pyx_INCREF(__pyx_v_loop);
+      __Pyx_GIVEREF(__pyx_v_loop);
+      __Pyx_GOTREF(__pyx_v_self->loop);
+      __Pyx_DECREF(__pyx_v_self->loop);
+      __pyx_v_self->loop = __pyx_v_loop;
+
+300:         except:
+
    /*except:*/ {
+      __Pyx_AddTraceback("gevent.resolver.cares.channel.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+      if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_7, &__pyx_t_10) < 0) __PYX_ERR(0, 300, __pyx_L13_except_error)
+      __Pyx_GOTREF(__pyx_t_3);
+      __Pyx_GOTREF(__pyx_t_7);
+      __Pyx_GOTREF(__pyx_t_10);
+
+301:             self.destroy()
+
      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_destroy); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 301, __pyx_L13_except_error)
+      __Pyx_GOTREF(__pyx_t_9);
+      __pyx_t_11 = NULL;
+      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
+        __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_9);
+        if (likely(__pyx_t_11)) {
+          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
+          __Pyx_INCREF(__pyx_t_11);
+          __Pyx_INCREF(function);
+          __Pyx_DECREF_SET(__pyx_t_9, function);
+        }
+      }
+      __pyx_t_8 = (__pyx_t_11) ? __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_11) : __Pyx_PyObject_CallNoArg(__pyx_t_9);
+      __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
+      if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 301, __pyx_L13_except_error)
+      __Pyx_GOTREF(__pyx_t_8);
+      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+
+302:             raise
+
      __Pyx_GIVEREF(__pyx_t_3);
+      __Pyx_GIVEREF(__pyx_t_7);
+      __Pyx_XGIVEREF(__pyx_t_10);
+      __Pyx_ErrRestoreWithState(__pyx_t_3, __pyx_t_7, __pyx_t_10);
+      __pyx_t_3 = 0; __pyx_t_7 = 0; __pyx_t_10 = 0; 
+      __PYX_ERR(0, 302, __pyx_L13_except_error)
+    }
+    __pyx_L13_except_error:;
+
 303: 
+
+304:     def __repr__(self):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_3__repr__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_3__repr__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_8resolver_5cares_7channel_2__repr__(((struct __pyx_obj_6gevent_8resolver_5cares_channel *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_8resolver_5cares_7channel_2__repr__(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self) {
+  PyObject *__pyx_v_args = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__repr__", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_AddTraceback("gevent.resolver.cares.channel.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_args);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+305:         args = (self.__class__.__name__, id(self), self._timer, len(self._watchers))
+
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 305, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 305, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 305, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_3 = __pyx_v_self->_watchers;
+  __Pyx_INCREF(__pyx_t_3);
+  if (unlikely(__pyx_t_3 == Py_None)) {
+    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
+    __PYX_ERR(0, 305, __pyx_L1_error)
+  }
+  __pyx_t_4 = PyDict_Size(__pyx_t_3); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 305, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 305, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 305, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_5);
+  __Pyx_GIVEREF(__pyx_t_2);
+  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2);
+  __Pyx_GIVEREF(__pyx_t_1);
+  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1);
+  __Pyx_INCREF(__pyx_v_self->_timer);
+  __Pyx_GIVEREF(__pyx_v_self->_timer);
+  PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_self->_timer);
+  __Pyx_GIVEREF(__pyx_t_3);
+  PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_3);
+  __pyx_t_2 = 0;
+  __pyx_t_1 = 0;
+  __pyx_t_3 = 0;
+  __pyx_v_args = ((PyObject*)__pyx_t_5);
+  __pyx_t_5 = 0;
+
+306:         return '<%s at 0x%x _timer=%r _watchers[%s]>' % args
+
  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_s_at_0x_x__timer_r__watchers_s, __pyx_v_args); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 306, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_5);
+  __pyx_r = __pyx_t_5;
+  __pyx_t_5 = 0;
+  goto __pyx_L0;
+
 307: 
+
+308:     def destroy(self):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_5destroy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_5destroy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("destroy (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_8resolver_5cares_7channel_4destroy(((struct __pyx_obj_6gevent_8resolver_5cares_channel *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_8resolver_5cares_7channel_4destroy(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("destroy", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_AddTraceback("gevent.resolver.cares.channel.destroy", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+309:         if self.channel:
+
  __pyx_t_1 = (__pyx_v_self->channel != 0);
+  if (__pyx_t_1) {
+/* … */
+  }
+
 310:             # XXX ares_library_cleanup?
+
+311:             cares.ares_destroy(self.channel)
+
    ares_destroy(__pyx_v_self->channel);
+
+312:             self.channel = NULL
+
    __pyx_v_self->channel = NULL;
+
+313:             self._watchers.clear()
+
    if (unlikely(__pyx_v_self->_watchers == Py_None)) {
+      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "clear");
+      __PYX_ERR(0, 313, __pyx_L1_error)
+    }
+    __pyx_t_2 = __Pyx_PyDict_Clear(__pyx_v_self->_watchers); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 313, __pyx_L1_error)
+
+314:             self._timer.stop()
+
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_timer, __pyx_n_s_stop); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 314, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    __pyx_t_5 = NULL;
+    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
+      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
+      if (likely(__pyx_t_5)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
+        __Pyx_INCREF(__pyx_t_5);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_4, function);
+      }
+    }
+    __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
+    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 314, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+
+315:             self.loop = None
+
    __Pyx_INCREF(Py_None);
+    __Pyx_GIVEREF(Py_None);
+    __Pyx_GOTREF(__pyx_v_self->loop);
+    __Pyx_DECREF(__pyx_v_self->loop);
+    __pyx_v_self->loop = Py_None;
+
 316: 
+
+317:     def __dealloc__(self):
+
/* Python wrapper */
+static void __pyx_pw_6gevent_8resolver_5cares_7channel_7__dealloc__(PyObject *__pyx_v_self); /*proto*/
+static void __pyx_pw_6gevent_8resolver_5cares_7channel_7__dealloc__(PyObject *__pyx_v_self) {
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
+  __pyx_pf_6gevent_8resolver_5cares_7channel_6__dealloc__(((struct __pyx_obj_6gevent_8resolver_5cares_channel *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+}
+
+static void __pyx_pf_6gevent_8resolver_5cares_7channel_6__dealloc__(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self) {
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__dealloc__", 0);
+/* … */
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+}
+
+318:         if self.channel:
+
  __pyx_t_1 = (__pyx_v_self->channel != 0);
+  if (__pyx_t_1) {
+/* … */
+  }
+
 319:             # XXX ares_library_cleanup?
+
+320:             cares.ares_destroy(self.channel)
+
    ares_destroy(__pyx_v_self->channel);
+
+321:             self.channel = NULL
+
    __pyx_v_self->channel = NULL;
+
 322: 
+
+323:     cpdef set_servers(self, servers=None):
+
static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_9set_servers(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_f_6gevent_8resolver_5cares_7channel_set_servers(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_8resolver_5cares_7channel_set_servers *__pyx_optional_args) {
+  PyObject *__pyx_v_servers = ((PyObject *)Py_None);
+  int __pyx_v_length;
+  CYTHON_UNUSED int __pyx_v_result;
+  int __pyx_v_index;
+  char *__pyx_v_string;
+  struct ares_addr_node *__pyx_v_c_servers;
+  PyObject *__pyx_v_server = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("set_servers", 0);
+  if (__pyx_optional_args) {
+    if (__pyx_optional_args->__pyx_n > 0) {
+      __pyx_v_servers = __pyx_optional_args->servers;
+    }
+  }
+  __Pyx_INCREF(__pyx_v_servers);
+  /* Check if called by wrapper */
+  if (unlikely(__pyx_skip_dispatch)) ;
+  /* Check if overridden in Python */
+  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
+    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
+    if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
+    else {
+      PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      #endif
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_servers); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 323, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_8resolver_5cares_7channel_9set_servers)) {
+        __Pyx_XDECREF(__pyx_r);
+        __Pyx_INCREF(__pyx_t_1);
+        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+          if (likely(__pyx_t_4)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+            __Pyx_INCREF(__pyx_t_4);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_3, function);
+          }
+        }
+        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_servers) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_servers);
+        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 323, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __pyx_r = __pyx_t_2;
+        __pyx_t_2 = 0;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        goto __pyx_L0;
+      }
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+      tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
+      if (unlikely(type_dict_guard != tp_dict_version)) {
+        tp_dict_version = obj_dict_version = 0;
+      }
+      #endif
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    }
+    #endif
+  }
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_7);
+  __Pyx_AddTraceback("gevent.resolver.cares.channel.set_servers", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_server);
+  __Pyx_XDECREF(__pyx_v_servers);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_9set_servers(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_9set_servers(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_servers = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("set_servers (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_servers,0};
+    PyObject* values[1] = {0};
+    values[0] = ((PyObject *)Py_None);
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_servers);
+          if (value) { values[0] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_servers") < 0)) __PYX_ERR(0, 323, __pyx_L3_error)
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    __pyx_v_servers = values[0];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("set_servers", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 323, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.resolver.cares.channel.set_servers", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_8resolver_5cares_7channel_8set_servers(((struct __pyx_obj_6gevent_8resolver_5cares_channel *)__pyx_v_self), __pyx_v_servers);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_8resolver_5cares_7channel_8set_servers(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self, PyObject *__pyx_v_servers) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("set_servers", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_2.__pyx_n = 1;
+  __pyx_t_2.servers = __pyx_v_servers;
+  __pyx_t_1 = __pyx_vtabptr_6gevent_8resolver_5cares_channel->set_servers(__pyx_v_self, 1, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 323, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.resolver.cares.channel.set_servers", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+struct __pyx_opt_args_6gevent_8resolver_5cares_7channel_set_servers {
+  int __pyx_n;
+  PyObject *servers;
+};
+
+324:         if not self.channel:
+
  __pyx_t_5 = ((!(__pyx_v_self->channel != 0)) != 0);
+  if (unlikely(__pyx_t_5)) {
+/* … */
+  }
+
+325:             raise gaierror(cares.ARES_EDESTRUCTION, 'this ares channel has been destroyed')
+
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_gaierror); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 325, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_3 = __Pyx_PyInt_From_int(ARES_EDESTRUCTION); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 325, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __pyx_t_4 = NULL;
+    __pyx_t_6 = 0;
+    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
+      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
+      if (likely(__pyx_t_4)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+        __Pyx_INCREF(__pyx_t_4);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_2, function);
+        __pyx_t_6 = 1;
+      }
+    }
+    #if CYTHON_FAST_PYCALL
+    if (PyFunction_Check(__pyx_t_2)) {
+      PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_3, __pyx_kp_s_this_ares_channel_has_been_destr};
+      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 325, __pyx_L1_error)
+      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __Pyx_GOTREF(__pyx_t_1);
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    } else
+    #endif
+    #if CYTHON_FAST_PYCCALL
+    if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
+      PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_3, __pyx_kp_s_this_ares_channel_has_been_destr};
+      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 325, __pyx_L1_error)
+      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __Pyx_GOTREF(__pyx_t_1);
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    } else
+    #endif
+    {
+      __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 325, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_7);
+      if (__pyx_t_4) {
+        __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4); __pyx_t_4 = NULL;
+      }
+      __Pyx_GIVEREF(__pyx_t_3);
+      PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_t_3);
+      __Pyx_INCREF(__pyx_kp_s_this_ares_channel_has_been_destr);
+      __Pyx_GIVEREF(__pyx_kp_s_this_ares_channel_has_been_destr);
+      PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_kp_s_this_ares_channel_has_been_destr);
+      __pyx_t_3 = 0;
+      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 325, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+    }
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __PYX_ERR(0, 325, __pyx_L1_error)
+
+326:         if not servers:
+
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_servers); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 326, __pyx_L1_error)
+  __pyx_t_8 = ((!__pyx_t_5) != 0);
+  if (__pyx_t_8) {
+/* … */
+  }
+
+327:             servers = []
+
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 327, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF_SET(__pyx_v_servers, __pyx_t_1);
+    __pyx_t_1 = 0;
+
+328:         if isinstance(servers, string_types):
+
  __pyx_t_1 = __pyx_v_6gevent_8resolver_5cares_string_types;
+  __Pyx_INCREF(__pyx_t_1);
+  __pyx_t_8 = PyObject_IsInstance(__pyx_v_servers, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 328, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_5 = (__pyx_t_8 != 0);
+  if (__pyx_t_5) {
+/* … */
+  }
+
+329:             servers = servers.split(',')
+
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_servers, __pyx_n_s_split); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 329, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_7 = NULL;
+    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2);
+      if (likely(__pyx_t_7)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+        __Pyx_INCREF(__pyx_t_7);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_2, function);
+      }
+    }
+    __pyx_t_1 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_7, __pyx_kp_s__2) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_kp_s__2);
+    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 329, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __Pyx_DECREF_SET(__pyx_v_servers, __pyx_t_1);
+    __pyx_t_1 = 0;
+
+330:         cdef int length = len(servers)
+
  __pyx_t_9 = PyObject_Length(__pyx_v_servers); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 330, __pyx_L1_error)
+  __pyx_v_length = __pyx_t_9;
+
 331:         cdef int result, index
+
 332:         cdef char* string
+
 333:         cdef cares.ares_addr_node* c_servers
+
+334:         if length <= 0:
+
  __pyx_t_5 = ((__pyx_v_length <= 0) != 0);
+  if (__pyx_t_5) {
+/* … */
+    goto __pyx_L6;
+  }
+
+335:             result = cares.ares_set_servers(self.channel, NULL)
+
    __pyx_v_result = ares_set_servers(__pyx_v_self->channel, NULL);
+
 336:         else:
+
+337:             c_servers = <cares.ares_addr_node*>PyMem_Malloc(sizeof(cares.ares_addr_node) * length)
+
  /*else*/ {
+    __pyx_v_c_servers = ((struct ares_addr_node *)PyMem_Malloc(((sizeof(struct ares_addr_node)) * __pyx_v_length)));
+
+338:             if not c_servers:
+
    __pyx_t_5 = ((!(__pyx_v_c_servers != 0)) != 0);
+    if (unlikely(__pyx_t_5)) {
+/* … */
+    }
+
+339:                 raise MemoryError
+
      PyErr_NoMemory(); __PYX_ERR(0, 339, __pyx_L1_error)
+
+340:             try:
+
    /*try:*/ {
+
+341:                 index = 0
+
      __pyx_v_index = 0;
+
+342:                 for server in servers:
+
      if (likely(PyList_CheckExact(__pyx_v_servers)) || PyTuple_CheckExact(__pyx_v_servers)) {
+        __pyx_t_1 = __pyx_v_servers; __Pyx_INCREF(__pyx_t_1); __pyx_t_9 = 0;
+        __pyx_t_10 = NULL;
+      } else {
+        __pyx_t_9 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_servers); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 342, __pyx_L9_error)
+        __Pyx_GOTREF(__pyx_t_1);
+        __pyx_t_10 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 342, __pyx_L9_error)
+      }
+      for (;;) {
+        if (likely(!__pyx_t_10)) {
+          if (likely(PyList_CheckExact(__pyx_t_1))) {
+            if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_1)) break;
+            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+            __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_9); __Pyx_INCREF(__pyx_t_2); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 342, __pyx_L9_error)
+            #else
+            __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 342, __pyx_L9_error)
+            __Pyx_GOTREF(__pyx_t_2);
+            #endif
+          } else {
+            if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
+            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+            __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_9); __Pyx_INCREF(__pyx_t_2); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 342, __pyx_L9_error)
+            #else
+            __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 342, __pyx_L9_error)
+            __Pyx_GOTREF(__pyx_t_2);
+            #endif
+          }
+        } else {
+          __pyx_t_2 = __pyx_t_10(__pyx_t_1);
+          if (unlikely(!__pyx_t_2)) {
+            PyObject* exc_type = PyErr_Occurred();
+            if (exc_type) {
+              if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+              else __PYX_ERR(0, 342, __pyx_L9_error)
+            }
+            break;
+          }
+          __Pyx_GOTREF(__pyx_t_2);
+        }
+        __Pyx_XDECREF_SET(__pyx_v_server, __pyx_t_2);
+        __pyx_t_2 = 0;
+/* … */
+      }
+      __pyx_L12_break:;
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+343:                     if isinstance(server, unicode):
+
        __pyx_t_5 = PyUnicode_Check(__pyx_v_server); 
+        __pyx_t_8 = (__pyx_t_5 != 0);
+        if (__pyx_t_8) {
+/* … */
+        }
+
+344:                         server = server.encode('ascii')
+
          __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_server, __pyx_n_s_encode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 344, __pyx_L9_error)
+          __Pyx_GOTREF(__pyx_t_7);
+          __pyx_t_3 = NULL;
+          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
+            __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_7);
+            if (likely(__pyx_t_3)) {
+              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
+              __Pyx_INCREF(__pyx_t_3);
+              __Pyx_INCREF(function);
+              __Pyx_DECREF_SET(__pyx_t_7, function);
+            }
+          }
+          __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_3, __pyx_n_s_ascii) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_n_s_ascii);
+          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 344, __pyx_L9_error)
+          __Pyx_GOTREF(__pyx_t_2);
+          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+          __Pyx_DECREF_SET(__pyx_v_server, __pyx_t_2);
+          __pyx_t_2 = 0;
+
+345:                     string = <char*?>server
+
        __pyx_t_11 = __Pyx_PyObject_AsWritableString(__pyx_v_server); if (unlikely((!__pyx_t_11) && PyErr_Occurred())) __PYX_ERR(0, 345, __pyx_L9_error)
+        __pyx_v_string = ((char *)__pyx_t_11);
+
+346:                     if cares.ares_inet_pton(AF_INET, string, &c_servers[index].addr) > 0:
+
        __pyx_t_8 = ((ares_inet_pton(AF_INET, __pyx_v_string, (&(__pyx_v_c_servers[__pyx_v_index]).addr)) > 0) != 0);
+        if (__pyx_t_8) {
+/* … */
+          goto __pyx_L14;
+        }
+
+347:                         c_servers[index].family = AF_INET
+
          (__pyx_v_c_servers[__pyx_v_index]).family = AF_INET;
+
+348:                     elif cares.ares_inet_pton(AF_INET6, string, &c_servers[index].addr) > 0:
+
        __pyx_t_8 = ((ares_inet_pton(AF_INET6, __pyx_v_string, (&(__pyx_v_c_servers[__pyx_v_index]).addr)) > 0) != 0);
+        if (likely(__pyx_t_8)) {
+/* … */
+          goto __pyx_L14;
+        }
+
+349:                         c_servers[index].family = AF_INET6
+
          (__pyx_v_c_servers[__pyx_v_index]).family = AF_INET6;
+
 350:                     else:
+
+351:                         raise InvalidIP(repr(string))
+
        /*else*/ {
+          __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_InvalidIP); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 351, __pyx_L9_error)
+          __Pyx_GOTREF(__pyx_t_7);
+          __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_string); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 351, __pyx_L9_error)
+          __Pyx_GOTREF(__pyx_t_3);
+          __pyx_t_4 = PyObject_Repr(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 351, __pyx_L9_error)
+          __Pyx_GOTREF(__pyx_t_4);
+          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+          __pyx_t_3 = NULL;
+          if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
+            __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_7);
+            if (likely(__pyx_t_3)) {
+              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
+              __Pyx_INCREF(__pyx_t_3);
+              __Pyx_INCREF(function);
+              __Pyx_DECREF_SET(__pyx_t_7, function);
+            }
+          }
+          __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_4);
+          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 351, __pyx_L9_error)
+          __Pyx_GOTREF(__pyx_t_2);
+          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+          __Pyx_Raise(__pyx_t_2, 0, 0, 0);
+          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+          __PYX_ERR(0, 351, __pyx_L9_error)
+        }
+        __pyx_L14:;
+
+352:                     c_servers[index].next = &c_servers[index] + 1
+
        (__pyx_v_c_servers[__pyx_v_index]).next = ((&(__pyx_v_c_servers[__pyx_v_index])) + 1);
+
+353:                     index += 1
+
        __pyx_v_index = (__pyx_v_index + 1);
+
+354:                     if index >= length:
+
        __pyx_t_8 = ((__pyx_v_index >= __pyx_v_length) != 0);
+        if (__pyx_t_8) {
+/* … */
+        }
+
+355:                         break
+
          goto __pyx_L12_break;
+
+356:                 c_servers[length - 1].next = NULL
+
      (__pyx_v_c_servers[(__pyx_v_length - 1)]).next = NULL;
+
+357:                 index = cares.ares_set_servers(self.channel, c_servers)
+
      __pyx_v_index = ares_set_servers(__pyx_v_self->channel, __pyx_v_c_servers);
+
+358:                 if index:
+
      __pyx_t_8 = (__pyx_v_index != 0);
+      if (unlikely(__pyx_t_8)) {
+/* … */
+      }
+    }
+
+359:                     raise ValueError(strerror(index))
+
        __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 359, __pyx_L9_error)
+        __Pyx_GOTREF(__pyx_t_1);
+        __pyx_t_2 = __pyx_f_6gevent_8resolver_5cares_strerror(__pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 359, __pyx_L9_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 359, __pyx_L9_error)
+        __Pyx_GOTREF(__pyx_t_1);
+        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+        __Pyx_Raise(__pyx_t_1, 0, 0, 0);
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        __PYX_ERR(0, 359, __pyx_L9_error)
+
 360:             finally:
+
+361:                 PyMem_Free(c_servers)
+
    /*finally:*/ {
+      /*normal exit:*/{
+        PyMem_Free(__pyx_v_c_servers);
+        goto __pyx_L10;
+      }
+      __pyx_L9_error:;
+      /*exception exit:*/{
+        __Pyx_PyThreadState_declare
+        __Pyx_PyThreadState_assign
+        __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0;
+        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+        if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19);
+        if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_14, &__pyx_t_15, &__pyx_t_16) < 0)) __Pyx_ErrFetch(&__pyx_t_14, &__pyx_t_15, &__pyx_t_16);
+        __Pyx_XGOTREF(__pyx_t_14);
+        __Pyx_XGOTREF(__pyx_t_15);
+        __Pyx_XGOTREF(__pyx_t_16);
+        __Pyx_XGOTREF(__pyx_t_17);
+        __Pyx_XGOTREF(__pyx_t_18);
+        __Pyx_XGOTREF(__pyx_t_19);
+        __pyx_t_6 = __pyx_lineno; __pyx_t_12 = __pyx_clineno; __pyx_t_13 = __pyx_filename;
+        {
+          PyMem_Free(__pyx_v_c_servers);
+        }
+        if (PY_MAJOR_VERSION >= 3) {
+          __Pyx_XGIVEREF(__pyx_t_17);
+          __Pyx_XGIVEREF(__pyx_t_18);
+          __Pyx_XGIVEREF(__pyx_t_19);
+          __Pyx_ExceptionReset(__pyx_t_17, __pyx_t_18, __pyx_t_19);
+        }
+        __Pyx_XGIVEREF(__pyx_t_14);
+        __Pyx_XGIVEREF(__pyx_t_15);
+        __Pyx_XGIVEREF(__pyx_t_16);
+        __Pyx_ErrRestore(__pyx_t_14, __pyx_t_15, __pyx_t_16);
+        __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0;
+        __pyx_lineno = __pyx_t_6; __pyx_clineno = __pyx_t_12; __pyx_filename = __pyx_t_13;
+        goto __pyx_L1_error;
+      }
+      __pyx_L10:;
+    }
+  }
+  __pyx_L6:;
+
 362: 
+
 363:     # this crashes c-ares
+
 364:     #def cancel(self):
+
 365:     #    cares.ares_cancel(self.channel)
+
 366: 
+
+367:     cdef _sock_state_callback(self, int socket, int read, int write):
+
static PyObject *__pyx_f_6gevent_8resolver_5cares_7channel__sock_state_callback(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self, int __pyx_v_socket, int __pyx_v_read, int __pyx_v_write) {
+  PyObject *__pyx_v_watcher = 0;
+  int __pyx_v_events;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_sock_state_callback", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_XDECREF(__pyx_t_6);
+  __Pyx_XDECREF(__pyx_t_7);
+  __Pyx_XDECREF(__pyx_t_9);
+  __Pyx_AddTraceback("gevent.resolver.cares.channel._sock_state_callback", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_watcher);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+368:         if not self.channel:
+
  __pyx_t_1 = ((!(__pyx_v_self->channel != 0)) != 0);
+  if (__pyx_t_1) {
+/* … */
+  }
+
+369:             return
+
    __Pyx_XDECREF(__pyx_r);
+    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+    goto __pyx_L0;
+
+370:         cdef object watcher = self._watchers.get(socket)
+
  if (unlikely(__pyx_v_self->_watchers == Py_None)) {
+    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get");
+    __PYX_ERR(0, 370, __pyx_L1_error)
+  }
+  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_socket); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 370, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = __Pyx_PyDict_GetItemDefault(__pyx_v_self->_watchers, __pyx_t_2, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 370, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_v_watcher = __pyx_t_3;
+  __pyx_t_3 = 0;
+
+371:         cdef int events = 0
+
  __pyx_v_events = 0;
+
+372:         if read:
+
  __pyx_t_1 = (__pyx_v_read != 0);
+  if (__pyx_t_1) {
+/* … */
+  }
+
+373:             events |= EV_READ
+
    __pyx_v_events = (__pyx_v_events | 1);
+
+374:         if write:
+
  __pyx_t_1 = (__pyx_v_write != 0);
+  if (__pyx_t_1) {
+/* … */
+  }
+
+375:             events |= EV_WRITE
+
    __pyx_v_events = (__pyx_v_events | 2);
+
+376:         if watcher is None:
+
  __pyx_t_1 = (__pyx_v_watcher == Py_None);
+  __pyx_t_4 = (__pyx_t_1 != 0);
+  if (__pyx_t_4) {
+/* … */
+    goto __pyx_L6;
+  }
+
+377:             if not events:
+
    __pyx_t_4 = ((!(__pyx_v_events != 0)) != 0);
+    if (__pyx_t_4) {
+/* … */
+    }
+
+378:                 return
+
      __Pyx_XDECREF(__pyx_r);
+      __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+      goto __pyx_L0;
+
+379:             watcher = self.loop.io(socket, events)
+
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->loop, __pyx_n_s_io); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 379, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_socket); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 379, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_5);
+    __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_events); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 379, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_6);
+    __pyx_t_7 = NULL;
+    __pyx_t_8 = 0;
+    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2);
+      if (likely(__pyx_t_7)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+        __Pyx_INCREF(__pyx_t_7);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_2, function);
+        __pyx_t_8 = 1;
+      }
+    }
+    #if CYTHON_FAST_PYCALL
+    if (PyFunction_Check(__pyx_t_2)) {
+      PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_5, __pyx_t_6};
+      __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 379, __pyx_L1_error)
+      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+      __Pyx_GOTREF(__pyx_t_3);
+      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+    } else
+    #endif
+    #if CYTHON_FAST_PYCCALL
+    if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
+      PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_5, __pyx_t_6};
+      __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 379, __pyx_L1_error)
+      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+      __Pyx_GOTREF(__pyx_t_3);
+      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+    } else
+    #endif
+    {
+      __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 379, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_9);
+      if (__pyx_t_7) {
+        __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
+      }
+      __Pyx_GIVEREF(__pyx_t_5);
+      PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_5);
+      __Pyx_GIVEREF(__pyx_t_6);
+      PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_t_6);
+      __pyx_t_5 = 0;
+      __pyx_t_6 = 0;
+      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 379, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_3);
+      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+    }
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __Pyx_DECREF_SET(__pyx_v_watcher, __pyx_t_3);
+    __pyx_t_3 = 0;
+
+380:             self._watchers[socket] = watcher
+
    if (unlikely(__pyx_v_self->_watchers == Py_None)) {
+      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
+      __PYX_ERR(0, 380, __pyx_L1_error)
+    }
+    __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_socket); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 380, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    if (unlikely(PyDict_SetItem(__pyx_v_self->_watchers, __pyx_t_3, __pyx_v_watcher) < 0)) __PYX_ERR(0, 380, __pyx_L1_error)
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+
+381:         elif events:
+
  __pyx_t_4 = (__pyx_v_events != 0);
+  if (__pyx_t_4) {
+/* … */
+    goto __pyx_L6;
+  }
+
+382:             if watcher.events == events:
+
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_watcher, __pyx_n_s_events); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 382, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_events); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 382, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_9 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 382, __pyx_L1_error)
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 382, __pyx_L1_error)
+    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+    if (__pyx_t_4) {
+/* … */
+    }
+
+383:                 return
+
      __Pyx_XDECREF(__pyx_r);
+      __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+      goto __pyx_L0;
+
+384:             watcher.stop()
+
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_watcher, __pyx_n_s_stop); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 384, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_3 = NULL;
+    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+      if (likely(__pyx_t_3)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+        __Pyx_INCREF(__pyx_t_3);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_2, function);
+      }
+    }
+    __pyx_t_9 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
+    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+    if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 384, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_9);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+
+385:             watcher.events = events
+
    __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_events); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 385, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_9);
+    if (__Pyx_PyObject_SetAttrStr(__pyx_v_watcher, __pyx_n_s_events, __pyx_t_9) < 0) __PYX_ERR(0, 385, __pyx_L1_error)
+    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+
 386:         else:
+
+387:             watcher.stop()
+
  /*else*/ {
+    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_watcher, __pyx_n_s_stop); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 387, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_3 = NULL;
+    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+      if (likely(__pyx_t_3)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+        __Pyx_INCREF(__pyx_t_3);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_2, function);
+      }
+    }
+    __pyx_t_9 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
+    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+    if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 387, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_9);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+
+388:             watcher.close()
+
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_watcher, __pyx_n_s_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 388, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_3 = NULL;
+    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+      if (likely(__pyx_t_3)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+        __Pyx_INCREF(__pyx_t_3);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_2, function);
+      }
+    }
+    __pyx_t_9 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
+    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+    if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 388, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_9);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+
+389:             self._watchers.pop(socket, None)
+
    if (unlikely(__pyx_v_self->_watchers == Py_None)) {
+      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "pop");
+      __PYX_ERR(0, 389, __pyx_L1_error)
+    }
+    __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_socket); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 389, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_9);
+    __pyx_t_2 = __Pyx_PyDict_Pop(__pyx_v_self->_watchers, __pyx_t_9, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 389, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+390:             if not self._watchers:
+
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_self->_watchers); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 390, __pyx_L1_error)
+    __pyx_t_1 = ((!__pyx_t_4) != 0);
+    if (__pyx_t_1) {
+/* … */
+    }
+
+391:                 self._timer.stop()
+
      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_timer, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 391, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_9);
+      __pyx_t_3 = NULL;
+      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
+        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9);
+        if (likely(__pyx_t_3)) {
+          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
+          __Pyx_INCREF(__pyx_t_3);
+          __Pyx_INCREF(function);
+          __Pyx_DECREF_SET(__pyx_t_9, function);
+        }
+      }
+      __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_9);
+      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 391, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_2);
+      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+392:             return
+
    __Pyx_XDECREF(__pyx_r);
+    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+    goto __pyx_L0;
+  }
+  __pyx_L6:;
+
+393:         watcher.start(self._process_fd, watcher, pass_events=True)
+
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_watcher, __pyx_n_s_start); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 393, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_process_fd); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 393, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_9);
+  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 393, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_GIVEREF(__pyx_t_9);
+  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_9);
+  __Pyx_INCREF(__pyx_v_watcher);
+  __Pyx_GIVEREF(__pyx_v_watcher);
+  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_watcher);
+  __pyx_t_9 = 0;
+  __pyx_t_9 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 393, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_9);
+  if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_pass_events, Py_True) < 0) __PYX_ERR(0, 393, __pyx_L1_error)
+  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_9); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 393, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+
+394:         self._timer.again(self._on_timer)
+
  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_timer, __pyx_n_s_again); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 394, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_9);
+  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_on_timer); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 394, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __pyx_t_2 = NULL;
+  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
+    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_9);
+    if (likely(__pyx_t_2)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
+      __Pyx_INCREF(__pyx_t_2);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_9, function);
+    }
+  }
+  __pyx_t_6 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 394, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+
 395: 
+
+396:     def _on_timer(self):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_11_on_timer(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_11_on_timer(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_on_timer (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_8resolver_5cares_7channel_10_on_timer(((struct __pyx_obj_6gevent_8resolver_5cares_channel *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_8resolver_5cares_7channel_10_on_timer(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_on_timer", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+397:         cares.ares_process_fd(self.channel, cares.ARES_SOCKET_BAD, cares.ARES_SOCKET_BAD)
+
  ares_process_fd(__pyx_v_self->channel, ARES_SOCKET_BAD, ARES_SOCKET_BAD);
+
 398: 
+
+399:     def _process_fd(self, int events, object watcher):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_13_process_fd(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_13_process_fd(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  int __pyx_v_events;
+  PyObject *__pyx_v_watcher = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_process_fd (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_events,&__pyx_n_s_watcher,0};
+    PyObject* values[2] = {0,0};
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_events)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_watcher)) != 0)) kw_args--;
+        else {
+          __Pyx_RaiseArgtupleInvalid("_process_fd", 1, 2, 2, 1); __PYX_ERR(0, 399, __pyx_L3_error)
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_process_fd") < 0)) __PYX_ERR(0, 399, __pyx_L3_error)
+      }
+    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
+      goto __pyx_L5_argtuple_error;
+    } else {
+      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+    }
+    __pyx_v_events = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_events == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 399, __pyx_L3_error)
+    __pyx_v_watcher = values[1];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("_process_fd", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 399, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.resolver.cares.channel._process_fd", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_8resolver_5cares_7channel_12_process_fd(((struct __pyx_obj_6gevent_8resolver_5cares_channel *)__pyx_v_self), __pyx_v_events, __pyx_v_watcher);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_8resolver_5cares_7channel_12_process_fd(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self, int __pyx_v_events, PyObject *__pyx_v_watcher) {
+  int __pyx_v_read_fd;
+  int __pyx_v_write_fd;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_process_fd", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_AddTraceback("gevent.resolver.cares.channel._process_fd", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+400:         if not self.channel:
+
  __pyx_t_1 = ((!(__pyx_v_self->channel != 0)) != 0);
+  if (__pyx_t_1) {
+/* … */
+  }
+
+401:             return
+
    __Pyx_XDECREF(__pyx_r);
+    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+    goto __pyx_L0;
+
+402:         cdef int read_fd = watcher.fd
+
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_watcher, __pyx_n_s_fd); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 402, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 402, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_v_read_fd = __pyx_t_3;
+
+403:         cdef int write_fd = read_fd
+
  __pyx_v_write_fd = __pyx_v_read_fd;
+
+404:         if not (events & EV_READ):
+
  __pyx_t_1 = ((!((__pyx_v_events & 1) != 0)) != 0);
+  if (__pyx_t_1) {
+/* … */
+  }
+
+405:             read_fd = cares.ARES_SOCKET_BAD
+
    __pyx_v_read_fd = ARES_SOCKET_BAD;
+
+406:         if not (events & EV_WRITE):
+
  __pyx_t_1 = ((!((__pyx_v_events & 2) != 0)) != 0);
+  if (__pyx_t_1) {
+/* … */
+  }
+
+407:             write_fd = cares.ARES_SOCKET_BAD
+
    __pyx_v_write_fd = ARES_SOCKET_BAD;
+
+408:         cares.ares_process_fd(self.channel, read_fd, write_fd)
+
  ares_process_fd(__pyx_v_self->channel, __pyx_v_read_fd, __pyx_v_write_fd);
+
 409: 
+
+410:     def gethostbyname(self, object callback, char* name, int family=AF_INET):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_15gethostbyname(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_15gethostbyname(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_callback = 0;
+  char *__pyx_v_name;
+  int __pyx_v_family;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("gethostbyname (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_callback,&__pyx_n_s_name_2,&__pyx_n_s_family,0};
+    PyObject* values[3] = {0,0,0};
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_callback)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name_2)) != 0)) kw_args--;
+        else {
+          __Pyx_RaiseArgtupleInvalid("gethostbyname", 0, 2, 3, 1); __PYX_ERR(0, 410, __pyx_L3_error)
+        }
+        CYTHON_FALLTHROUGH;
+        case  2:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_family);
+          if (value) { values[2] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "gethostbyname") < 0)) __PYX_ERR(0, 410, __pyx_L3_error)
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    __pyx_v_callback = values[0];
+    __pyx_v_name = __Pyx_PyObject_AsWritableString(values[1]); if (unlikely((!__pyx_v_name) && PyErr_Occurred())) __PYX_ERR(0, 410, __pyx_L3_error)
+    if (values[2]) {
+      __pyx_v_family = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_family == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 410, __pyx_L3_error)
+    } else {
+      __pyx_v_family = __pyx_k__3;
+    }
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("gethostbyname", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 410, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.resolver.cares.channel.gethostbyname", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_8resolver_5cares_7channel_14gethostbyname(((struct __pyx_obj_6gevent_8resolver_5cares_channel *)__pyx_v_self), __pyx_v_callback, __pyx_v_name, __pyx_v_family);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_8resolver_5cares_7channel_14gethostbyname(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self, PyObject *__pyx_v_callback, char *__pyx_v_name, int __pyx_v_family) {
+  PyObject *__pyx_v_arg = 0;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("gethostbyname", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_XDECREF(__pyx_t_7);
+  __Pyx_AddTraceback("gevent.resolver.cares.channel.gethostbyname", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_arg);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_k__3 = AF_INET;
+
+411:         if not self.channel:
+
  __pyx_t_1 = ((!(__pyx_v_self->channel != 0)) != 0);
+  if (unlikely(__pyx_t_1)) {
+/* … */
+  }
+
+412:             raise gaierror(cares.ARES_EDESTRUCTION, 'this ares channel has been destroyed')
+
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_gaierror); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 412, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __pyx_t_4 = __Pyx_PyInt_From_int(ARES_EDESTRUCTION); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 412, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    __pyx_t_5 = NULL;
+    __pyx_t_6 = 0;
+    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
+      if (likely(__pyx_t_5)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+        __Pyx_INCREF(__pyx_t_5);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_3, function);
+        __pyx_t_6 = 1;
+      }
+    }
+    #if CYTHON_FAST_PYCALL
+    if (PyFunction_Check(__pyx_t_3)) {
+      PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_4, __pyx_kp_s_this_ares_channel_has_been_destr};
+      __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 412, __pyx_L1_error)
+      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+      __Pyx_GOTREF(__pyx_t_2);
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    } else
+    #endif
+    #if CYTHON_FAST_PYCCALL
+    if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
+      PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_4, __pyx_kp_s_this_ares_channel_has_been_destr};
+      __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 412, __pyx_L1_error)
+      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+      __Pyx_GOTREF(__pyx_t_2);
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    } else
+    #endif
+    {
+      __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 412, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_7);
+      if (__pyx_t_5) {
+        __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
+      }
+      __Pyx_GIVEREF(__pyx_t_4);
+      PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_t_4);
+      __Pyx_INCREF(__pyx_kp_s_this_ares_channel_has_been_destr);
+      __Pyx_GIVEREF(__pyx_kp_s_this_ares_channel_has_been_destr);
+      PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_kp_s_this_ares_channel_has_been_destr);
+      __pyx_t_4 = 0;
+      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 412, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_2);
+      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+    }
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __PYX_ERR(0, 412, __pyx_L1_error)
+
 413:         # note that for file lookups still AF_INET can be returned for AF_INET6 request
+
+414:         cdef object arg = (self, callback)
+
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 414, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(((PyObject *)__pyx_v_self));
+  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
+  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self));
+  __Pyx_INCREF(__pyx_v_callback);
+  __Pyx_GIVEREF(__pyx_v_callback);
+  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_callback);
+  __pyx_v_arg = __pyx_t_2;
+  __pyx_t_2 = 0;
+
+415:         Py_INCREF(arg)
+
  Py_INCREF(__pyx_v_arg);
+
+416:         cares.ares_gethostbyname(self.channel, name, family, <void*>gevent_ares_host_callback, <void*>arg)
+
  ares_gethostbyname(__pyx_v_self->channel, __pyx_v_name, __pyx_v_family, ((void *)__pyx_f_6gevent_8resolver_5cares_gevent_ares_host_callback), ((void *)__pyx_v_arg));
+
 417: 
+
+418:     def gethostbyaddr(self, object callback, char* addr):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_17gethostbyaddr(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_17gethostbyaddr(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_callback = 0;
+  char *__pyx_v_addr;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("gethostbyaddr (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_callback,&__pyx_n_s_addr,0};
+    PyObject* values[2] = {0,0};
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_callback)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_addr)) != 0)) kw_args--;
+        else {
+          __Pyx_RaiseArgtupleInvalid("gethostbyaddr", 1, 2, 2, 1); __PYX_ERR(0, 418, __pyx_L3_error)
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "gethostbyaddr") < 0)) __PYX_ERR(0, 418, __pyx_L3_error)
+      }
+    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
+      goto __pyx_L5_argtuple_error;
+    } else {
+      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+    }
+    __pyx_v_callback = values[0];
+    __pyx_v_addr = __Pyx_PyObject_AsWritableString(values[1]); if (unlikely((!__pyx_v_addr) && PyErr_Occurred())) __PYX_ERR(0, 418, __pyx_L3_error)
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("gethostbyaddr", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 418, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.resolver.cares.channel.gethostbyaddr", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_8resolver_5cares_7channel_16gethostbyaddr(((struct __pyx_obj_6gevent_8resolver_5cares_channel *)__pyx_v_self), __pyx_v_callback, __pyx_v_addr);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_8resolver_5cares_7channel_16gethostbyaddr(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self, PyObject *__pyx_v_callback, char *__pyx_v_addr) {
+  char __pyx_v_addr_packed[16];
+  int __pyx_v_family;
+  int __pyx_v_length;
+  PyObject *__pyx_v_arg = 0;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("gethostbyaddr", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_XDECREF(__pyx_t_7);
+  __Pyx_AddTraceback("gevent.resolver.cares.channel.gethostbyaddr", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_arg);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+419:         if not self.channel:
+
  __pyx_t_1 = ((!(__pyx_v_self->channel != 0)) != 0);
+  if (unlikely(__pyx_t_1)) {
+/* … */
+  }
+
+420:             raise gaierror(cares.ARES_EDESTRUCTION, 'this ares channel has been destroyed')
+
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_gaierror); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 420, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __pyx_t_4 = __Pyx_PyInt_From_int(ARES_EDESTRUCTION); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 420, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    __pyx_t_5 = NULL;
+    __pyx_t_6 = 0;
+    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
+      if (likely(__pyx_t_5)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+        __Pyx_INCREF(__pyx_t_5);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_3, function);
+        __pyx_t_6 = 1;
+      }
+    }
+    #if CYTHON_FAST_PYCALL
+    if (PyFunction_Check(__pyx_t_3)) {
+      PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_4, __pyx_kp_s_this_ares_channel_has_been_destr};
+      __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 420, __pyx_L1_error)
+      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+      __Pyx_GOTREF(__pyx_t_2);
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    } else
+    #endif
+    #if CYTHON_FAST_PYCCALL
+    if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
+      PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_4, __pyx_kp_s_this_ares_channel_has_been_destr};
+      __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 420, __pyx_L1_error)
+      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+      __Pyx_GOTREF(__pyx_t_2);
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    } else
+    #endif
+    {
+      __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 420, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_7);
+      if (__pyx_t_5) {
+        __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
+      }
+      __Pyx_GIVEREF(__pyx_t_4);
+      PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_t_4);
+      __Pyx_INCREF(__pyx_kp_s_this_ares_channel_has_been_destr);
+      __Pyx_GIVEREF(__pyx_kp_s_this_ares_channel_has_been_destr);
+      PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_kp_s_this_ares_channel_has_been_destr);
+      __pyx_t_4 = 0;
+      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 420, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_2);
+      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+    }
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __PYX_ERR(0, 420, __pyx_L1_error)
+
 421:         # will guess the family
+
 422:         cdef char addr_packed[16]
+
 423:         cdef int family
+
 424:         cdef int length
+
+425:         if cares.ares_inet_pton(AF_INET, addr, addr_packed) > 0:
+
  __pyx_t_1 = ((ares_inet_pton(AF_INET, __pyx_v_addr, __pyx_v_addr_packed) > 0) != 0);
+  if (__pyx_t_1) {
+/* … */
+    goto __pyx_L4;
+  }
+
+426:             family = AF_INET
+
    __pyx_v_family = AF_INET;
+
+427:             length = 4
+
    __pyx_v_length = 4;
+
+428:         elif cares.ares_inet_pton(AF_INET6, addr, addr_packed) > 0:
+
  __pyx_t_1 = ((ares_inet_pton(AF_INET6, __pyx_v_addr, __pyx_v_addr_packed) > 0) != 0);
+  if (likely(__pyx_t_1)) {
+/* … */
+    goto __pyx_L4;
+  }
+
+429:             family = AF_INET6
+
    __pyx_v_family = AF_INET6;
+
+430:             length = 16
+
    __pyx_v_length = 16;
+
 431:         else:
+
+432:             raise InvalidIP(repr(addr))
+
  /*else*/ {
+    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_InvalidIP); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 432, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __pyx_t_7 = __Pyx_PyBytes_FromString(__pyx_v_addr); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 432, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_7);
+    __pyx_t_4 = PyObject_Repr(__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 432, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+    __pyx_t_7 = NULL;
+    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3);
+      if (likely(__pyx_t_7)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+        __Pyx_INCREF(__pyx_t_7);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_3, function);
+      }
+    }
+    __pyx_t_2 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_7, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4);
+    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 432, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __PYX_ERR(0, 432, __pyx_L1_error)
+  }
+  __pyx_L4:;
+
+433:         cdef object arg = (self, callback)
+
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 433, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(((PyObject *)__pyx_v_self));
+  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
+  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self));
+  __Pyx_INCREF(__pyx_v_callback);
+  __Pyx_GIVEREF(__pyx_v_callback);
+  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_callback);
+  __pyx_v_arg = __pyx_t_2;
+  __pyx_t_2 = 0;
+
+434:         Py_INCREF(arg)
+
  Py_INCREF(__pyx_v_arg);
+
+435:         cares.ares_gethostbyaddr(self.channel, addr_packed, length, family, <void*>gevent_ares_host_callback, <void*>arg)
+
  ares_gethostbyaddr(__pyx_v_self->channel, __pyx_v_addr_packed, __pyx_v_length, __pyx_v_family, ((void *)__pyx_f_6gevent_8resolver_5cares_gevent_ares_host_callback), ((void *)__pyx_v_arg));
+
 436: 
+
+437:     cpdef _getnameinfo(self, object callback, tuple sockaddr, int flags):
+
static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_19_getnameinfo(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_f_6gevent_8resolver_5cares_7channel__getnameinfo(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self, PyObject *__pyx_v_callback, PyObject *__pyx_v_sockaddr, int __pyx_v_flags, int __pyx_skip_dispatch) {
+  char *__pyx_v_hostp;
+  int __pyx_v_port;
+  int __pyx_v_flowinfo;
+  int __pyx_v_scope_id;
+  struct sockaddr_in6 __pyx_v_sa6;
+  int __pyx_v_length;
+  PyObject *__pyx_v_arg = 0;
+  struct sockaddr *__pyx_v_x;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_getnameinfo", 0);
+  /* Check if called by wrapper */
+  if (unlikely(__pyx_skip_dispatch)) ;
+  /* Check if overridden in Python */
+  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
+    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
+    if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
+    else {
+      PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      #endif
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getnameinfo); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 437, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_8resolver_5cares_7channel_19_getnameinfo)) {
+        __Pyx_XDECREF(__pyx_r);
+        __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 437, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_3);
+        __Pyx_INCREF(__pyx_t_1);
+        __pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL;
+        __pyx_t_6 = 0;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
+          __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
+          if (likely(__pyx_t_5)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
+            __Pyx_INCREF(__pyx_t_5);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_4, function);
+            __pyx_t_6 = 1;
+          }
+        }
+        #if CYTHON_FAST_PYCALL
+        if (PyFunction_Check(__pyx_t_4)) {
+          PyObject *__pyx_temp[4] = {__pyx_t_5, __pyx_v_callback, __pyx_v_sockaddr, __pyx_t_3};
+          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 437, __pyx_L1_error)
+          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+          __Pyx_GOTREF(__pyx_t_2);
+          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        } else
+        #endif
+        #if CYTHON_FAST_PYCCALL
+        if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
+          PyObject *__pyx_temp[4] = {__pyx_t_5, __pyx_v_callback, __pyx_v_sockaddr, __pyx_t_3};
+          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 437, __pyx_L1_error)
+          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+          __Pyx_GOTREF(__pyx_t_2);
+          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        } else
+        #endif
+        {
+          __pyx_t_7 = PyTuple_New(3+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 437, __pyx_L1_error)
+          __Pyx_GOTREF(__pyx_t_7);
+          if (__pyx_t_5) {
+            __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
+          }
+          __Pyx_INCREF(__pyx_v_callback);
+          __Pyx_GIVEREF(__pyx_v_callback);
+          PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_v_callback);
+          __Pyx_INCREF(__pyx_v_sockaddr);
+          __Pyx_GIVEREF(__pyx_v_sockaddr);
+          PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_sockaddr);
+          __Pyx_GIVEREF(__pyx_t_3);
+          PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_6, __pyx_t_3);
+          __pyx_t_3 = 0;
+          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 437, __pyx_L1_error)
+          __Pyx_GOTREF(__pyx_t_2);
+          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+        }
+        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+        __pyx_r = __pyx_t_2;
+        __pyx_t_2 = 0;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        goto __pyx_L0;
+      }
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+      tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
+      if (unlikely(type_dict_guard != tp_dict_version)) {
+        tp_dict_version = obj_dict_version = 0;
+      }
+      #endif
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    }
+    #endif
+  }
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_XDECREF(__pyx_t_7);
+  __Pyx_AddTraceback("gevent.resolver.cares.channel._getnameinfo", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_arg);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_19_getnameinfo(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_19_getnameinfo(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_callback = 0;
+  PyObject *__pyx_v_sockaddr = 0;
+  int __pyx_v_flags;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_getnameinfo (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_callback,&__pyx_n_s_sockaddr,&__pyx_n_s_flags,0};
+    PyObject* values[3] = {0,0,0};
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_callback)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_sockaddr)) != 0)) kw_args--;
+        else {
+          __Pyx_RaiseArgtupleInvalid("_getnameinfo", 1, 3, 3, 1); __PYX_ERR(0, 437, __pyx_L3_error)
+        }
+        CYTHON_FALLTHROUGH;
+        case  2:
+        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flags)) != 0)) kw_args--;
+        else {
+          __Pyx_RaiseArgtupleInvalid("_getnameinfo", 1, 3, 3, 2); __PYX_ERR(0, 437, __pyx_L3_error)
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_getnameinfo") < 0)) __PYX_ERR(0, 437, __pyx_L3_error)
+      }
+    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
+      goto __pyx_L5_argtuple_error;
+    } else {
+      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+    }
+    __pyx_v_callback = values[0];
+    __pyx_v_sockaddr = ((PyObject*)values[1]);
+    __pyx_v_flags = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 437, __pyx_L3_error)
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("_getnameinfo", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 437, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.resolver.cares.channel._getnameinfo", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sockaddr), (&PyTuple_Type), 1, "sockaddr", 1))) __PYX_ERR(0, 437, __pyx_L1_error)
+  __pyx_r = __pyx_pf_6gevent_8resolver_5cares_7channel_18_getnameinfo(((struct __pyx_obj_6gevent_8resolver_5cares_channel *)__pyx_v_self), __pyx_v_callback, __pyx_v_sockaddr, __pyx_v_flags);
+
+  /* function exit code */
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_8resolver_5cares_7channel_18_getnameinfo(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self, PyObject *__pyx_v_callback, PyObject *__pyx_v_sockaddr, int __pyx_v_flags) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_getnameinfo", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __pyx_f_6gevent_8resolver_5cares_7channel__getnameinfo(__pyx_v_self, __pyx_v_callback, __pyx_v_sockaddr, __pyx_v_flags, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 437, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.resolver.cares.channel._getnameinfo", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+438:         if not self.channel:
+
  __pyx_t_8 = ((!(__pyx_v_self->channel != 0)) != 0);
+  if (unlikely(__pyx_t_8)) {
+/* … */
+  }
+
+439:             raise gaierror(cares.ARES_EDESTRUCTION, 'this ares channel has been destroyed')
+
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_gaierror); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 439, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_4 = __Pyx_PyInt_From_int(ARES_EDESTRUCTION); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 439, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    __pyx_t_7 = NULL;
+    __pyx_t_6 = 0;
+    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
+      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2);
+      if (likely(__pyx_t_7)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+        __Pyx_INCREF(__pyx_t_7);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_2, function);
+        __pyx_t_6 = 1;
+      }
+    }
+    #if CYTHON_FAST_PYCALL
+    if (PyFunction_Check(__pyx_t_2)) {
+      PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_4, __pyx_kp_s_this_ares_channel_has_been_destr};
+      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 439, __pyx_L1_error)
+      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+      __Pyx_GOTREF(__pyx_t_1);
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    } else
+    #endif
+    #if CYTHON_FAST_PYCCALL
+    if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
+      PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_4, __pyx_kp_s_this_ares_channel_has_been_destr};
+      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 439, __pyx_L1_error)
+      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+      __Pyx_GOTREF(__pyx_t_1);
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    } else
+    #endif
+    {
+      __pyx_t_3 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 439, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_3);
+      if (__pyx_t_7) {
+        __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_7); __pyx_t_7 = NULL;
+      }
+      __Pyx_GIVEREF(__pyx_t_4);
+      PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_6, __pyx_t_4);
+      __Pyx_INCREF(__pyx_kp_s_this_ares_channel_has_been_destr);
+      __Pyx_GIVEREF(__pyx_kp_s_this_ares_channel_has_been_destr);
+      PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_6, __pyx_kp_s_this_ares_channel_has_been_destr);
+      __pyx_t_4 = 0;
+      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 439, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    }
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __PYX_ERR(0, 439, __pyx_L1_error)
+
+440:         cdef char* hostp = NULL
+
  __pyx_v_hostp = NULL;
+
+441:         cdef int port = 0
+
  __pyx_v_port = 0;
+
+442:         cdef int flowinfo = 0
+
  __pyx_v_flowinfo = 0;
+
+443:         cdef int scope_id = 0
+
  __pyx_v_scope_id = 0;
+
 444:         cdef sockaddr_in6 sa6
+
+445:         if not PyTuple_Check(sockaddr):
+
  __pyx_t_8 = ((!(PyTuple_Check(__pyx_v_sockaddr) != 0)) != 0);
+  if (unlikely(__pyx_t_8)) {
+/* … */
+  }
+
+446:             raise TypeError('expected a tuple, got %r' % (sockaddr, ))
+
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 446, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_INCREF(__pyx_v_sockaddr);
+    __Pyx_GIVEREF(__pyx_v_sockaddr);
+    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_sockaddr);
+    __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_expected_a_tuple_got_r, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 446, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 446, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __PYX_ERR(0, 446, __pyx_L1_error)
+
+447:         PyArg_ParseTuple(sockaddr, "si|ii", &hostp, &port, &flowinfo, &scope_id)
+
  __pyx_t_6 = PyArg_ParseTuple(__pyx_v_sockaddr, ((char *)"si|ii"), (&__pyx_v_hostp), (&__pyx_v_port), (&__pyx_v_flowinfo), (&__pyx_v_scope_id)); if (unlikely(__pyx_t_6 == ((int)0))) __PYX_ERR(0, 447, __pyx_L1_error)
+
+448:         if port < 0 or port > 65535:
+
  __pyx_t_9 = ((__pyx_v_port < 0) != 0);
+  if (!__pyx_t_9) {
+  } else {
+    __pyx_t_8 = __pyx_t_9;
+    goto __pyx_L6_bool_binop_done;
+  }
+  __pyx_t_9 = ((__pyx_v_port > 0xFFFF) != 0);
+  __pyx_t_8 = __pyx_t_9;
+  __pyx_L6_bool_binop_done:;
+  if (unlikely(__pyx_t_8)) {
+/* … */
+  }
+
+449:             raise gaierror(-8, 'Invalid value for port: %r' % port)
+
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_gaierror); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 449, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_port); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 449, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_value_for_port_r, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 449, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __pyx_t_3 = NULL;
+    __pyx_t_6 = 0;
+    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
+      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+      if (likely(__pyx_t_3)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+        __Pyx_INCREF(__pyx_t_3);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_2, function);
+        __pyx_t_6 = 1;
+      }
+    }
+    #if CYTHON_FAST_PYCALL
+    if (PyFunction_Check(__pyx_t_2)) {
+      PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_int_neg_8, __pyx_t_4};
+      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 449, __pyx_L1_error)
+      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __Pyx_GOTREF(__pyx_t_1);
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    } else
+    #endif
+    #if CYTHON_FAST_PYCCALL
+    if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
+      PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_int_neg_8, __pyx_t_4};
+      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 449, __pyx_L1_error)
+      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __Pyx_GOTREF(__pyx_t_1);
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    } else
+    #endif
+    {
+      __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 449, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_7);
+      if (__pyx_t_3) {
+        __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3); __pyx_t_3 = NULL;
+      }
+      __Pyx_INCREF(__pyx_int_neg_8);
+      __Pyx_GIVEREF(__pyx_int_neg_8);
+      PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_int_neg_8);
+      __Pyx_GIVEREF(__pyx_t_4);
+      PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_4);
+      __pyx_t_4 = 0;
+      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 449, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+    }
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __PYX_ERR(0, 449, __pyx_L1_error)
+
+450:         cdef int length = gevent_make_sockaddr(hostp, port, flowinfo, scope_id, &sa6)
+
  __pyx_v_length = gevent_make_sockaddr(__pyx_v_hostp, __pyx_v_port, __pyx_v_flowinfo, __pyx_v_scope_id, (&__pyx_v_sa6));
+
+451:         if length <= 0:
+
  __pyx_t_8 = ((__pyx_v_length <= 0) != 0);
+  if (unlikely(__pyx_t_8)) {
+/* … */
+  }
+
+452:             raise InvalidIP(repr(hostp))
+
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_InvalidIP); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 452, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_7 = __Pyx_PyBytes_FromString(__pyx_v_hostp); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 452, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_7);
+    __pyx_t_4 = PyObject_Repr(__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 452, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+    __pyx_t_7 = NULL;
+    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
+      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2);
+      if (likely(__pyx_t_7)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+        __Pyx_INCREF(__pyx_t_7);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_2, function);
+      }
+    }
+    __pyx_t_1 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_7, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
+    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 452, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __PYX_ERR(0, 452, __pyx_L1_error)
+
+453:         cdef object arg = (self, callback)
+
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 453, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(((PyObject *)__pyx_v_self));
+  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
+  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self));
+  __Pyx_INCREF(__pyx_v_callback);
+  __Pyx_GIVEREF(__pyx_v_callback);
+  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_callback);
+  __pyx_v_arg = __pyx_t_1;
+  __pyx_t_1 = 0;
+
+454:         Py_INCREF(arg)
+
  Py_INCREF(__pyx_v_arg);
+
+455:         cdef sockaddr_t* x = <sockaddr_t*>&sa6
+
  __pyx_v_x = ((struct sockaddr *)(&__pyx_v_sa6));
+
+456:         cares.ares_getnameinfo(self.channel, x, length, flags, <void*>gevent_ares_nameinfo_callback, <void*>arg)
+
  ares_getnameinfo(__pyx_v_self->channel, __pyx_v_x, __pyx_v_length, __pyx_v_flags, ((void *)__pyx_f_6gevent_8resolver_5cares_gevent_ares_nameinfo_callback), ((void *)__pyx_v_arg));
+
 457: 
+
+458:     def getnameinfo(self, object callback, tuple sockaddr, int flags):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_21getnameinfo(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_21getnameinfo(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_callback = 0;
+  PyObject *__pyx_v_sockaddr = 0;
+  int __pyx_v_flags;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("getnameinfo (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_callback,&__pyx_n_s_sockaddr,&__pyx_n_s_flags,0};
+    PyObject* values[3] = {0,0,0};
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_callback)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_sockaddr)) != 0)) kw_args--;
+        else {
+          __Pyx_RaiseArgtupleInvalid("getnameinfo", 1, 3, 3, 1); __PYX_ERR(0, 458, __pyx_L3_error)
+        }
+        CYTHON_FALLTHROUGH;
+        case  2:
+        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flags)) != 0)) kw_args--;
+        else {
+          __Pyx_RaiseArgtupleInvalid("getnameinfo", 1, 3, 3, 2); __PYX_ERR(0, 458, __pyx_L3_error)
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getnameinfo") < 0)) __PYX_ERR(0, 458, __pyx_L3_error)
+      }
+    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
+      goto __pyx_L5_argtuple_error;
+    } else {
+      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+    }
+    __pyx_v_callback = values[0];
+    __pyx_v_sockaddr = ((PyObject*)values[1]);
+    __pyx_v_flags = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 458, __pyx_L3_error)
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("getnameinfo", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 458, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.resolver.cares.channel.getnameinfo", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sockaddr), (&PyTuple_Type), 1, "sockaddr", 1))) __PYX_ERR(0, 458, __pyx_L1_error)
+  __pyx_r = __pyx_pf_6gevent_8resolver_5cares_7channel_20getnameinfo(((struct __pyx_obj_6gevent_8resolver_5cares_channel *)__pyx_v_self), __pyx_v_callback, __pyx_v_sockaddr, __pyx_v_flags);
+
+  /* function exit code */
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_8resolver_5cares_7channel_20getnameinfo(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self, PyObject *__pyx_v_callback, PyObject *__pyx_v_sockaddr, int __pyx_v_flags) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("getnameinfo", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_6);
+  __Pyx_XDECREF(__pyx_t_7);
+  __Pyx_XDECREF(__pyx_t_8);
+  __Pyx_AddTraceback("gevent.resolver.cares.channel.getnameinfo", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+459:         try:
+
  {
+    /*try:*/ {
+/* … */
+    }
+    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+    goto __pyx_L8_try_end;
+    __pyx_L3_error:;
+    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+/* … */
+    __Pyx_XGIVEREF(__pyx_t_1);
+    __Pyx_XGIVEREF(__pyx_t_2);
+    __Pyx_XGIVEREF(__pyx_t_3);
+    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
+    goto __pyx_L1_error;
+    __pyx_L4_exception_handled:;
+    __Pyx_XGIVEREF(__pyx_t_1);
+    __Pyx_XGIVEREF(__pyx_t_2);
+    __Pyx_XGIVEREF(__pyx_t_3);
+    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
+    __pyx_L8_try_end:;
+  }
+
+460:             flags = _convert_cares_flags(flags)
+
      __pyx_t_4 = __pyx_f_6gevent_8resolver_5cares__convert_cares_flags(__pyx_v_flags, 0, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 460, __pyx_L3_error)
+      __Pyx_GOTREF(__pyx_t_4);
+      __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 460, __pyx_L3_error)
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __pyx_v_flags = __pyx_t_5;
+
+461:         except gaierror:
+
    __Pyx_ErrFetch(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7);
+    __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_gaierror); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 461, __pyx_L5_except_error)
+    __Pyx_GOTREF(__pyx_t_8);
+    __pyx_t_5 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_4, __pyx_t_8);
+    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+    __Pyx_ErrRestore(__pyx_t_4, __pyx_t_6, __pyx_t_7);
+    __pyx_t_4 = 0; __pyx_t_6 = 0; __pyx_t_7 = 0;
+    if (__pyx_t_5) {
+      __Pyx_AddTraceback("gevent.resolver.cares.channel.getnameinfo", __pyx_clineno, __pyx_lineno, __pyx_filename);
+      if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_6, &__pyx_t_4) < 0) __PYX_ERR(0, 461, __pyx_L5_except_error)
+      __Pyx_GOTREF(__pyx_t_7);
+      __Pyx_GOTREF(__pyx_t_6);
+      __Pyx_GOTREF(__pyx_t_4);
+
 462:             # The stdlib just ignores bad flags
+
+463:             flags = 0
+
      __pyx_v_flags = 0;
+      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+      goto __pyx_L4_exception_handled;
+    }
+    goto __pyx_L5_except_error;
+    __pyx_L5_except_error:;
+
+464:         return self._getnameinfo(callback, sockaddr, flags)
+
  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_4 = ((struct __pyx_vtabstruct_6gevent_8resolver_5cares_channel *)__pyx_v_self->__pyx_vtab)->_getnameinfo(__pyx_v_self, __pyx_v_callback, __pyx_v_sockaddr, __pyx_v_flags, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 464, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_4);
+  __pyx_r = __pyx_t_4;
+  __pyx_t_4 = 0;
+  goto __pyx_L0;
+
diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/resolver/cares.pyx b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/resolver/cares.pyx new file mode 100644 index 00000000..cc43c13d --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/resolver/cares.pyx @@ -0,0 +1,464 @@ +# Copyright (c) 2011-2012 Denis Bilenko. See LICENSE for details. +# Automatic pickling of cdef classes was added in 0.26. Unfortunately it +# seems to be buggy (at least for the `result` class) and produces code that +# can't compile ("local variable 'result' referenced before assignment"). +# See https://github.com/cython/cython/issues/1786 +# cython: auto_pickle=False +cimport libcares as cares +import sys + +from cpython.ref cimport Py_INCREF +from cpython.ref cimport Py_DECREF +from cpython.mem cimport PyMem_Malloc +from cpython.mem cimport PyMem_Free + +from _socket import gaierror + + +__all__ = ['channel'] + +cdef object string_types +cdef object text_type + +if sys.version_info[0] >= 3: + string_types = str, + text_type = str +else: + string_types = __builtins__.basestring, + text_type = __builtins__.unicode + +TIMEOUT = 1 + +DEF EV_READ = 1 +DEF EV_WRITE = 2 + + +cdef extern from "dnshelper.c": + int AF_INET + int AF_INET6 + + struct hostent: + char* h_name + int h_addrtype + + struct sockaddr_t "sockaddr": + pass + + struct ares_channeldata: + pass + + object parse_h_name(hostent*) + object parse_h_aliases(hostent*) + object parse_h_addr_list(hostent*) + void* create_object_from_hostent(void*) + + # this imports _socket lazily + object PyUnicode_FromString(char*) + int PyTuple_Check(object) + int PyArg_ParseTuple(object, char*, ...) except 0 + struct sockaddr_in6: + pass + int gevent_make_sockaddr(char* hostp, int port, int flowinfo, int scope_id, sockaddr_in6* sa6) + + + void memset(void*, int, int) + + +ARES_SUCCESS = cares.ARES_SUCCESS +ARES_ENODATA = cares.ARES_ENODATA +ARES_EFORMERR = cares.ARES_EFORMERR +ARES_ESERVFAIL = cares.ARES_ESERVFAIL +ARES_ENOTFOUND = cares.ARES_ENOTFOUND +ARES_ENOTIMP = cares.ARES_ENOTIMP +ARES_EREFUSED = cares.ARES_EREFUSED +ARES_EBADQUERY = cares.ARES_EBADQUERY +ARES_EBADNAME = cares.ARES_EBADNAME +ARES_EBADFAMILY = cares.ARES_EBADFAMILY +ARES_EBADRESP = cares.ARES_EBADRESP +ARES_ECONNREFUSED = cares.ARES_ECONNREFUSED +ARES_ETIMEOUT = cares.ARES_ETIMEOUT +ARES_EOF = cares.ARES_EOF +ARES_EFILE = cares.ARES_EFILE +ARES_ENOMEM = cares.ARES_ENOMEM +ARES_EDESTRUCTION = cares.ARES_EDESTRUCTION +ARES_EBADSTR = cares.ARES_EBADSTR +ARES_EBADFLAGS = cares.ARES_EBADFLAGS +ARES_ENONAME = cares.ARES_ENONAME +ARES_EBADHINTS = cares.ARES_EBADHINTS +ARES_ENOTINITIALIZED = cares.ARES_ENOTINITIALIZED +ARES_ELOADIPHLPAPI = cares.ARES_ELOADIPHLPAPI +ARES_EADDRGETNETWORKPARAMS = cares.ARES_EADDRGETNETWORKPARAMS +ARES_ECANCELLED = cares.ARES_ECANCELLED + +ARES_FLAG_USEVC = cares.ARES_FLAG_USEVC +ARES_FLAG_PRIMARY = cares.ARES_FLAG_PRIMARY +ARES_FLAG_IGNTC = cares.ARES_FLAG_IGNTC +ARES_FLAG_NORECURSE = cares.ARES_FLAG_NORECURSE +ARES_FLAG_STAYOPEN = cares.ARES_FLAG_STAYOPEN +ARES_FLAG_NOSEARCH = cares.ARES_FLAG_NOSEARCH +ARES_FLAG_NOALIASES = cares.ARES_FLAG_NOALIASES +ARES_FLAG_NOCHECKRESP = cares.ARES_FLAG_NOCHECKRESP + + +_ares_errors = dict([ + (cares.ARES_SUCCESS, 'ARES_SUCCESS'), + (cares.ARES_ENODATA, 'ARES_ENODATA'), + (cares.ARES_EFORMERR, 'ARES_EFORMERR'), + (cares.ARES_ESERVFAIL, 'ARES_ESERVFAIL'), + (cares.ARES_ENOTFOUND, 'ARES_ENOTFOUND'), + (cares.ARES_ENOTIMP, 'ARES_ENOTIMP'), + (cares.ARES_EREFUSED, 'ARES_EREFUSED'), + (cares.ARES_EBADQUERY, 'ARES_EBADQUERY'), + (cares.ARES_EBADNAME, 'ARES_EBADNAME'), + (cares.ARES_EBADFAMILY, 'ARES_EBADFAMILY'), + (cares.ARES_EBADRESP, 'ARES_EBADRESP'), + (cares.ARES_ECONNREFUSED, 'ARES_ECONNREFUSED'), + (cares.ARES_ETIMEOUT, 'ARES_ETIMEOUT'), + (cares.ARES_EOF, 'ARES_EOF'), + (cares.ARES_EFILE, 'ARES_EFILE'), + (cares.ARES_ENOMEM, 'ARES_ENOMEM'), + (cares.ARES_EDESTRUCTION, 'ARES_EDESTRUCTION'), + (cares.ARES_EBADSTR, 'ARES_EBADSTR'), + (cares.ARES_EBADFLAGS, 'ARES_EBADFLAGS'), + (cares.ARES_ENONAME, 'ARES_ENONAME'), + (cares.ARES_EBADHINTS, 'ARES_EBADHINTS'), + (cares.ARES_ENOTINITIALIZED, 'ARES_ENOTINITIALIZED'), + (cares.ARES_ELOADIPHLPAPI, 'ARES_ELOADIPHLPAPI'), + (cares.ARES_EADDRGETNETWORKPARAMS, 'ARES_EADDRGETNETWORKPARAMS'), + (cares.ARES_ECANCELLED, 'ARES_ECANCELLED')]) + + +# maps c-ares flag to _socket module flag +_cares_flag_map = None + + +cdef _prepare_cares_flag_map(): + global _cares_flag_map + import _socket + _cares_flag_map = [ + (getattr(_socket, 'NI_NUMERICHOST', 1), cares.ARES_NI_NUMERICHOST), + (getattr(_socket, 'NI_NUMERICSERV', 2), cares.ARES_NI_NUMERICSERV), + (getattr(_socket, 'NI_NOFQDN', 4), cares.ARES_NI_NOFQDN), + (getattr(_socket, 'NI_NAMEREQD', 8), cares.ARES_NI_NAMEREQD), + (getattr(_socket, 'NI_DGRAM', 16), cares.ARES_NI_DGRAM)] + + +cpdef _convert_cares_flags(int flags, int default=cares.ARES_NI_LOOKUPHOST|cares.ARES_NI_LOOKUPSERVICE): + if _cares_flag_map is None: + _prepare_cares_flag_map() + for socket_flag, cares_flag in _cares_flag_map: + if socket_flag & flags: + default |= cares_flag + flags &= ~socket_flag + if not flags: + return default + raise gaierror(-1, "Bad value for ai_flags: 0x%x" % flags) + + +cpdef strerror(code): + return '%s: %s' % (_ares_errors.get(code) or code, cares.ares_strerror(code)) + + +class InvalidIP(ValueError): + pass + + +cdef void gevent_sock_state_callback(void *data, int s, int read, int write): + if not data: + return + cdef channel ch = data + ch._sock_state_callback(s, read, write) + + +cdef class result: + cdef public object value + cdef public object exception + + def __init__(self, object value=None, object exception=None): + self.value = value + self.exception = exception + + def __repr__(self): + if self.exception is None: + return '%s(%r)' % (self.__class__.__name__, self.value) + elif self.value is None: + return '%s(exception=%r)' % (self.__class__.__name__, self.exception) + else: + return '%s(value=%r, exception=%r)' % (self.__class__.__name__, self.value, self.exception) + # add repr_recursive precaution + + def successful(self): + return self.exception is None + + def get(self): + if self.exception is not None: + raise self.exception + return self.value + + +class ares_host_result(tuple): + + def __new__(cls, family, iterable): + cdef object self = tuple.__new__(cls, iterable) + self.family = family + return self + + def __getnewargs__(self): + return (self.family, tuple(self)) + + +cdef void gevent_ares_host_callback(void *arg, int status, int timeouts, hostent* host): + cdef channel channel + cdef object callback + channel, callback = arg + Py_DECREF(arg) + cdef object host_result + try: + if status or not host: + callback(result(None, gaierror(status, strerror(status)))) + else: + try: + host_result = ares_host_result(host.h_addrtype, (parse_h_name(host), parse_h_aliases(host), parse_h_addr_list(host))) + except: + callback(result(None, sys.exc_info()[1])) + else: + callback(result(host_result)) + except: + channel.loop.handle_error(callback, *sys.exc_info()) + + +cdef void gevent_ares_nameinfo_callback(void *arg, int status, int timeouts, char *c_node, char *c_service): + cdef channel channel + cdef object callback + channel, callback = arg + Py_DECREF(arg) + cdef object node + cdef object service + try: + if status: + callback(result(None, gaierror(status, strerror(status)))) + else: + if c_node: + node = PyUnicode_FromString(c_node) + else: + node = None + if c_service: + service = PyUnicode_FromString(c_service) + else: + service = None + callback(result((node, service))) + except: + channel.loop.handle_error(callback, *sys.exc_info()) + + +cdef class channel: + + cdef public object loop + cdef ares_channeldata* channel + cdef public dict _watchers + cdef public object _timer + + def __init__(self, object loop, flags=None, timeout=None, tries=None, ndots=None, + udp_port=None, tcp_port=None, servers=None): + cdef ares_channeldata* channel = NULL + cdef cares.ares_options options + memset(&options, 0, sizeof(cares.ares_options)) + cdef int optmask = cares.ARES_OPT_SOCK_STATE_CB + options.sock_state_cb = gevent_sock_state_callback + options.sock_state_cb_data = self + if flags is not None: + options.flags = int(flags) + optmask |= cares.ARES_OPT_FLAGS + if timeout is not None: + options.timeout = int(float(timeout) * 1000) + optmask |= cares.ARES_OPT_TIMEOUTMS + if tries is not None: + options.tries = int(tries) + optmask |= cares.ARES_OPT_TRIES + if ndots is not None: + options.ndots = int(ndots) + optmask |= cares.ARES_OPT_NDOTS + if udp_port is not None: + options.udp_port = int(udp_port) + optmask |= cares.ARES_OPT_UDP_PORT + if tcp_port is not None: + options.tcp_port = int(tcp_port) + optmask |= cares.ARES_OPT_TCP_PORT + cdef int result = cares.ares_library_init(cares.ARES_LIB_INIT_ALL) # ARES_LIB_INIT_WIN32 -DUSE_WINSOCK? + if result: + raise gaierror(result, strerror(result)) + result = cares.ares_init_options(&channel, &options, optmask) + if result: + raise gaierror(result, strerror(result)) + self._timer = loop.timer(TIMEOUT, TIMEOUT) + self._watchers = {} + self.channel = channel + try: + if servers is not None: + self.set_servers(servers) + self.loop = loop + except: + self.destroy() + raise + + def __repr__(self): + args = (self.__class__.__name__, id(self), self._timer, len(self._watchers)) + return '<%s at 0x%x _timer=%r _watchers[%s]>' % args + + def destroy(self): + if self.channel: + # XXX ares_library_cleanup? + cares.ares_destroy(self.channel) + self.channel = NULL + self._watchers.clear() + self._timer.stop() + self.loop = None + + def __dealloc__(self): + if self.channel: + # XXX ares_library_cleanup? + cares.ares_destroy(self.channel) + self.channel = NULL + + cpdef set_servers(self, servers=None): + if not self.channel: + raise gaierror(cares.ARES_EDESTRUCTION, 'this ares channel has been destroyed') + if not servers: + servers = [] + if isinstance(servers, string_types): + servers = servers.split(',') + cdef int length = len(servers) + cdef int result, index + cdef char* string + cdef cares.ares_addr_node* c_servers + if length <= 0: + result = cares.ares_set_servers(self.channel, NULL) + else: + c_servers = PyMem_Malloc(sizeof(cares.ares_addr_node) * length) + if not c_servers: + raise MemoryError + try: + index = 0 + for server in servers: + if isinstance(server, unicode): + server = server.encode('ascii') + string = server + if cares.ares_inet_pton(AF_INET, string, &c_servers[index].addr) > 0: + c_servers[index].family = AF_INET + elif cares.ares_inet_pton(AF_INET6, string, &c_servers[index].addr) > 0: + c_servers[index].family = AF_INET6 + else: + raise InvalidIP(repr(string)) + c_servers[index].next = &c_servers[index] + 1 + index += 1 + if index >= length: + break + c_servers[length - 1].next = NULL + index = cares.ares_set_servers(self.channel, c_servers) + if index: + raise ValueError(strerror(index)) + finally: + PyMem_Free(c_servers) + + # this crashes c-ares + #def cancel(self): + # cares.ares_cancel(self.channel) + + cdef _sock_state_callback(self, int socket, int read, int write): + if not self.channel: + return + cdef object watcher = self._watchers.get(socket) + cdef int events = 0 + if read: + events |= EV_READ + if write: + events |= EV_WRITE + if watcher is None: + if not events: + return + watcher = self.loop.io(socket, events) + self._watchers[socket] = watcher + elif events: + if watcher.events == events: + return + watcher.stop() + watcher.events = events + else: + watcher.stop() + watcher.close() + self._watchers.pop(socket, None) + if not self._watchers: + self._timer.stop() + return + watcher.start(self._process_fd, watcher, pass_events=True) + self._timer.again(self._on_timer) + + def _on_timer(self): + cares.ares_process_fd(self.channel, cares.ARES_SOCKET_BAD, cares.ARES_SOCKET_BAD) + + def _process_fd(self, int events, object watcher): + if not self.channel: + return + cdef int read_fd = watcher.fd + cdef int write_fd = read_fd + if not (events & EV_READ): + read_fd = cares.ARES_SOCKET_BAD + if not (events & EV_WRITE): + write_fd = cares.ARES_SOCKET_BAD + cares.ares_process_fd(self.channel, read_fd, write_fd) + + def gethostbyname(self, object callback, char* name, int family=AF_INET): + if not self.channel: + raise gaierror(cares.ARES_EDESTRUCTION, 'this ares channel has been destroyed') + # note that for file lookups still AF_INET can be returned for AF_INET6 request + cdef object arg = (self, callback) + Py_INCREF(arg) + cares.ares_gethostbyname(self.channel, name, family, gevent_ares_host_callback, arg) + + def gethostbyaddr(self, object callback, char* addr): + if not self.channel: + raise gaierror(cares.ARES_EDESTRUCTION, 'this ares channel has been destroyed') + # will guess the family + cdef char addr_packed[16] + cdef int family + cdef int length + if cares.ares_inet_pton(AF_INET, addr, addr_packed) > 0: + family = AF_INET + length = 4 + elif cares.ares_inet_pton(AF_INET6, addr, addr_packed) > 0: + family = AF_INET6 + length = 16 + else: + raise InvalidIP(repr(addr)) + cdef object arg = (self, callback) + Py_INCREF(arg) + cares.ares_gethostbyaddr(self.channel, addr_packed, length, family, gevent_ares_host_callback, arg) + + cpdef _getnameinfo(self, object callback, tuple sockaddr, int flags): + if not self.channel: + raise gaierror(cares.ARES_EDESTRUCTION, 'this ares channel has been destroyed') + cdef char* hostp = NULL + cdef int port = 0 + cdef int flowinfo = 0 + cdef int scope_id = 0 + cdef sockaddr_in6 sa6 + if not PyTuple_Check(sockaddr): + raise TypeError('expected a tuple, got %r' % (sockaddr, )) + PyArg_ParseTuple(sockaddr, "si|ii", &hostp, &port, &flowinfo, &scope_id) + if port < 0 or port > 65535: + raise gaierror(-8, 'Invalid value for port: %r' % port) + cdef int length = gevent_make_sockaddr(hostp, port, flowinfo, scope_id, &sa6) + if length <= 0: + raise InvalidIP(repr(hostp)) + cdef object arg = (self, callback) + Py_INCREF(arg) + cdef sockaddr_t* x = &sa6 + cares.ares_getnameinfo(self.channel, x, length, flags, gevent_ares_nameinfo_callback, arg) + + def getnameinfo(self, object callback, tuple sockaddr, int flags): + try: + flags = _convert_cares_flags(flags) + except gaierror: + # The stdlib just ignores bad flags + flags = 0 + return self._getnameinfo(callback, sockaddr, flags) diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/resolver/cares_ntop.h b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/resolver/cares_ntop.h new file mode 100644 index 00000000..9ffc9dd9 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/resolver/cares_ntop.h @@ -0,0 +1,7 @@ +#ifdef CARES_EMBED +#include "ares_setup.h" +#include "ares.h" +#else +#include +#define ares_inet_ntop(w,x,y,z) inet_ntop(w,x,y,z) +#endif diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/resolver/cares_pton.h b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/resolver/cares_pton.h new file mode 100644 index 00000000..85af403d --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/resolver/cares_pton.h @@ -0,0 +1,8 @@ +#ifdef CARES_EMBED +#include "ares_setup.h" +#include "ares_inet_net_pton.h" +#else +#include +#define ares_inet_pton(x,y,z) inet_pton(x,y,z) +#define ares_inet_net_pton(w,x,y,z) inet_net_pton(w,x,y,z) +#endif diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/resolver/dnshelper.c b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/resolver/dnshelper.c new file mode 100644 index 00000000..3befb699 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/resolver/dnshelper.c @@ -0,0 +1,159 @@ +/* Copyright (c) 2011 Denis Bilenko. See LICENSE for details. */ +#include "Python.h" +#ifdef CARES_EMBED +#include "ares_setup.h" +#endif + +#ifdef HAVE_NETDB_H +#include +#endif + +#include "ares.h" + +#include "cares_ntop.h" +#include "cares_pton.h" + +#if PY_VERSION_HEX < 0x02060000 + #define PyUnicode_FromString PyString_FromString +#elif PY_MAJOR_VERSION < 3 + #define PyUnicode_FromString PyBytes_FromString +#endif + + +static PyObject* _socket_error = 0; + +static PyObject* +get_socket_object(PyObject** pobject, const char* name) +{ + if (!*pobject) { + PyObject* _socket; + _socket = PyImport_ImportModule("_socket"); + if (_socket) { + *pobject = PyObject_GetAttrString(_socket, name); + if (!*pobject) { + PyErr_WriteUnraisable(Py_None); + } + Py_DECREF(_socket); + } + else { + PyErr_WriteUnraisable(Py_None); + } + if (!*pobject) { + *pobject = PyExc_IOError; + } + } + return *pobject; +} + + +static int +gevent_append_addr(PyObject* list, int family, void* src, char* tmpbuf, size_t tmpsize) { + int status = -1; + PyObject* tmp; + if (ares_inet_ntop(family, src, tmpbuf, tmpsize)) { + tmp = PyUnicode_FromString(tmpbuf); + if (tmp) { + status = PyList_Append(list, tmp); + Py_DECREF(tmp); + } + } + return status; +} + + +static PyObject* +parse_h_name(struct hostent *h) +{ + return PyUnicode_FromString(h->h_name); +} + + +static PyObject* +parse_h_aliases(struct hostent *h) +{ + char **pch; + PyObject *result = NULL; + PyObject *tmp; + + result = PyList_New(0); + + if (result && h->h_aliases) { + for (pch = h->h_aliases; *pch != NULL; pch++) { + if (*pch != h->h_name && strcmp(*pch, h->h_name)) { + int status; + tmp = PyUnicode_FromString(*pch); + if (tmp == NULL) { + break; + } + + status = PyList_Append(result, tmp); + Py_DECREF(tmp); + + if (status) { + break; + } + } + } + } + + return result; +} + + +static PyObject * +parse_h_addr_list(struct hostent *h) +{ + char **pch; + PyObject *result = NULL; + + result = PyList_New(0); + + if (result) { + switch (h->h_addrtype) { + case AF_INET: + { + char tmpbuf[sizeof "255.255.255.255"]; + for (pch = h->h_addr_list; *pch != NULL; pch++) { + if (gevent_append_addr(result, AF_INET, *pch, tmpbuf, sizeof(tmpbuf))) { + break; + } + } + break; + } + case AF_INET6: + { + char tmpbuf[sizeof("ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255")]; + for (pch = h->h_addr_list; *pch != NULL; pch++) { + if (gevent_append_addr(result, AF_INET6, *pch, tmpbuf, sizeof(tmpbuf))) { + break; + } + } + break; + } + default: + PyErr_SetString(get_socket_object(&_socket_error, "error"), "unsupported address family"); + Py_DECREF(result); + result = NULL; + } + } + + return result; +} + + +static int +gevent_make_sockaddr(char* hostp, int port, int flowinfo, int scope_id, struct sockaddr_in6* sa6) { + if ( ares_inet_pton(AF_INET, hostp, &((struct sockaddr_in*)sa6)->sin_addr.s_addr) > 0 ) { + ((struct sockaddr_in*)sa6)->sin_family = AF_INET; + ((struct sockaddr_in*)sa6)->sin_port = htons(port); + return sizeof(struct sockaddr_in); + } + else if ( ares_inet_pton(AF_INET6, hostp, &sa6->sin6_addr.s6_addr) > 0 ) { + sa6->sin6_family = AF_INET6; + sa6->sin6_port = htons(port); + sa6->sin6_flowinfo = flowinfo; + sa6->sin6_scope_id = scope_id; + return sizeof(struct sockaddr_in6); + } + return -1; +} diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/resolver/dnspython.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/resolver/dnspython.py new file mode 100644 index 00000000..0b9e82f2 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/resolver/dnspython.py @@ -0,0 +1,662 @@ +# Copyright (c) 2018 gevent contributors. See LICENSE for details. + +# Portions of this code taken from the gogreen project: +# http://github.com/slideinc/gogreen +# +# Copyright (c) 2005-2010 Slide, Inc. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following +# disclaimer in the documentation and/or other materials provided +# with the distribution. +# * Neither the name of the author nor the names of other +# contributors may be used to endorse or promote products derived +# from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +# Portions of this code taken from the eventlet project: +# https://github.com/eventlet/eventlet/blob/master/eventlet/support/greendns.py + +# Unless otherwise noted, the files in Eventlet are under the following MIT license: + +# Copyright (c) 2005-2006, Bob Ippolito +# Copyright (c) 2007-2010, Linden Research, Inc. +# Copyright (c) 2008-2010, Eventlet Contributors (see AUTHORS) + +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: + +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. + +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. +from __future__ import absolute_import, print_function, division + +import time +import re +import os +import sys + +import _socket +from _socket import AI_NUMERICHOST +from _socket import error +from _socket import NI_NUMERICSERV +from _socket import AF_INET +from _socket import AF_INET6 +from _socket import AF_UNSPEC + +import socket + +from gevent.resolver import AbstractResolver +from gevent.resolver import hostname_types + +from gevent._compat import string_types +from gevent._compat import iteritems +from gevent._patcher import import_patched +from gevent._config import config + +__all__ = [ + 'Resolver', +] + +# Import the DNS packages to use the gevent modules, +# even if the system is not monkey-patched. +def _patch_dns(): + top = import_patched('dns') + for pkg in ('dns', + 'dns.rdtypes', + 'dns.rdtypes.IN', + 'dns.rdtypes.ANY'): + mod = import_patched(pkg) + for name in mod.__all__: + setattr(mod, name, import_patched(pkg + '.' + name)) + return top + +dns = _patch_dns() + +def _dns_import_patched(name): + assert name.startswith('dns') + import_patched(name) + return dns + +# This module tries to dynamically import classes +# using __import__, and it's important that they match +# the ones we just created, otherwise exceptions won't be caught +# as expected. It uses a one-arg __import__ statement and then +# tries to walk down the sub-modules using getattr, so we can't +# directly use import_patched as-is. +dns.rdata.__import__ = _dns_import_patched + +resolver = dns.resolver +dTimeout = dns.resolver.Timeout + +_exc_clear = getattr(sys, 'exc_clear', lambda: None) + +# This is a copy of resolver._getaddrinfo with the crucial change that it +# doesn't have a bare except:, because that breaks Timeout and KeyboardInterrupt +# A secondary change is that calls to sys.exc_clear() have been inserted to avoid +# failing tests in test__refcount.py (timeouts). +# See https://github.com/rthalley/dnspython/pull/300 +def _getaddrinfo(host=None, service=None, family=AF_UNSPEC, socktype=0, + proto=0, flags=0): + # pylint:disable=too-many-locals,broad-except,too-many-statements + # pylint:disable=too-many-branches + # pylint:disable=redefined-argument-from-local + # pylint:disable=consider-using-in + if flags & (socket.AI_ADDRCONFIG | socket.AI_V4MAPPED) != 0: + raise NotImplementedError + if host is None and service is None: + raise socket.gaierror(socket.EAI_NONAME) + v6addrs = [] + v4addrs = [] + canonical_name = None + try: + # Is host None or a V6 address literal? + if host is None: + canonical_name = 'localhost' + if flags & socket.AI_PASSIVE != 0: + v6addrs.append('::') + v4addrs.append('0.0.0.0') + else: + v6addrs.append('::1') + v4addrs.append('127.0.0.1') + else: + parts = host.split('%') + if len(parts) == 2: + ahost = parts[0] + else: + ahost = host + addr = dns.ipv6.inet_aton(ahost) + v6addrs.append(host) + canonical_name = host + except Exception: + _exc_clear() + try: + # Is it a V4 address literal? + addr = dns.ipv4.inet_aton(host) + v4addrs.append(host) + canonical_name = host + except Exception: + _exc_clear() + if flags & socket.AI_NUMERICHOST == 0: + try: + if family == socket.AF_INET6 or family == socket.AF_UNSPEC: + v6 = resolver._resolver.query(host, dns.rdatatype.AAAA, + raise_on_no_answer=False) + # Note that setting host ensures we query the same name + # for A as we did for AAAA. + host = v6.qname + canonical_name = v6.canonical_name.to_text(True) + if v6.rrset is not None: + for rdata in v6.rrset: + v6addrs.append(rdata.address) + if family == socket.AF_INET or family == socket.AF_UNSPEC: + v4 = resolver._resolver.query(host, dns.rdatatype.A, + raise_on_no_answer=False) + host = v4.qname + canonical_name = v4.canonical_name.to_text(True) + if v4.rrset is not None: + for rdata in v4.rrset: + v4addrs.append(rdata.address) + except dns.resolver.NXDOMAIN: + _exc_clear() + raise socket.gaierror(socket.EAI_NONAME) + except Exception: + _exc_clear() + raise socket.gaierror(socket.EAI_SYSTEM) + port = None + try: + # Is it a port literal? + if service is None: + port = 0 + else: + port = int(service) + except Exception: + _exc_clear() + if flags & socket.AI_NUMERICSERV == 0: + try: + port = socket.getservbyname(service) + except Exception: + _exc_clear() + + if port is None: + raise socket.gaierror(socket.EAI_NONAME) + tuples = [] + if socktype == 0: + socktypes = [socket.SOCK_DGRAM, socket.SOCK_STREAM] + else: + socktypes = [socktype] + if flags & socket.AI_CANONNAME != 0: + cname = canonical_name + else: + cname = '' + if family == socket.AF_INET6 or family == socket.AF_UNSPEC: + for addr in v6addrs: + for socktype in socktypes: + for proto in resolver._protocols_for_socktype[socktype]: + tuples.append((socket.AF_INET6, socktype, proto, + cname, (addr, port, 0, 0))) # XXX: gevent: this can get the scopeid wrong + if family == socket.AF_INET or family == socket.AF_UNSPEC: + for addr in v4addrs: + for socktype in socktypes: + for proto in resolver._protocols_for_socktype[socktype]: + tuples.append((socket.AF_INET, socktype, proto, + cname, (addr, port))) + if len(tuples) == 0: # pylint:disable=len-as-condition + raise socket.gaierror(socket.EAI_NONAME) + return tuples + + +resolver._getaddrinfo = _getaddrinfo + +HOSTS_TTL = 300.0 + +def _is_addr(host, parse=dns.ipv4.inet_aton): + if not host: + return False + assert isinstance(host, hostname_types), repr(host) + try: + parse(host) + except dns.exception.SyntaxError: + return False + else: + return True + +# Return True if host is a valid IPv4 address +_is_ipv4_addr = _is_addr + + +def _is_ipv6_addr(host): + # Return True if host is a valid IPv6 address + if host: + s = '%' if isinstance(host, str) else b'%' + host = host.split(s, 1)[0] + return _is_addr(host, dns.ipv6.inet_aton) + +class HostsFile(object): + """ + A class to read the contents of a hosts file (/etc/hosts). + """ + + LINES_RE = re.compile(r""" + \s* # Leading space + ([^\r\n#]+?) # The actual match, non-greedy so as not to include trailing space + \s* # Trailing space + (?:[#][^\r\n]+)? # Comments + (?:$|[\r\n]+) # EOF or newline + """, re.VERBOSE) + + def __init__(self, fname=None): + self.v4 = {} # name -> ipv4 + self.v6 = {} # name -> ipv6 + self.aliases = {} # name -> canonical_name + self.reverse = {} # ip addr -> some name + if fname is None: + if os.name == 'posix': + fname = '/etc/hosts' + elif os.name == 'nt': # pragma: no cover + fname = os.path.expandvars( + r'%SystemRoot%\system32\drivers\etc\hosts') + self.fname = fname + assert self.fname + self._last_load = 0 + + + def _readlines(self): + # Read the contents of the hosts file. + # + # Return list of lines, comment lines and empty lines are + # excluded. Note that this performs disk I/O so can be + # blocking. + with open(self.fname, 'rb') as fp: + fdata = fp.read() + + + # XXX: Using default decoding. Is that correct? + udata = fdata.decode(errors='ignore') if not isinstance(fdata, str) else fdata + + return self.LINES_RE.findall(udata) + + def load(self): # pylint:disable=too-many-locals + # Load hosts file + + # This will (re)load the data from the hosts + # file if it has changed. + + try: + load_time = os.stat(self.fname).st_mtime + needs_load = load_time > self._last_load + except (IOError, OSError): + from gevent import get_hub + get_hub().handle_error(self, *sys.exc_info()) + needs_load = False + + if not needs_load: + return + + v4 = {} + v6 = {} + aliases = {} + reverse = {} + + for line in self._readlines(): + parts = line.split() + if len(parts) < 2: + continue + ip = parts.pop(0) + if _is_ipv4_addr(ip): + ipmap = v4 + elif _is_ipv6_addr(ip): + if ip.startswith('fe80'): + # Do not use link-local addresses, OSX stores these here + continue + ipmap = v6 + else: + continue + cname = parts.pop(0).lower() + ipmap[cname] = ip + for alias in parts: + alias = alias.lower() + ipmap[alias] = ip + aliases[alias] = cname + + # XXX: This is wrong for ipv6 + if ipmap is v4: + ptr = '.'.join(reversed(ip.split('.'))) + '.in-addr.arpa' + else: + ptr = ip + '.ip6.arpa.' + if ptr not in reverse: + reverse[ptr] = cname + + self._last_load = load_time + self.v4 = v4 + self.v6 = v6 + self.aliases = aliases + self.reverse = reverse + + def iter_all_host_addr_pairs(self): + self.load() + for name, addr in iteritems(self.v4): + yield name, addr + for name, addr in iteritems(self.v6): + yield name, addr + +class _HostsAnswer(dns.resolver.Answer): + # Answer class for HostsResolver object + + def __init__(self, qname, rdtype, rdclass, rrset, raise_on_no_answer=True): + self.response = None + self.qname = qname + self.rdtype = rdtype + self.rdclass = rdclass + self.canonical_name = qname + if not rrset and raise_on_no_answer: + raise dns.resolver.NoAnswer() + self.rrset = rrset + self.expiration = (time.time() + + rrset.ttl if hasattr(rrset, 'ttl') else 0) + + +class _HostsResolver(object): + """ + Class to parse the hosts file + """ + + def __init__(self, fname=None, interval=HOSTS_TTL): + self.hosts_file = HostsFile(fname) + self.interval = interval + self._last_load = 0 + + def query(self, qname, rdtype=dns.rdatatype.A, rdclass=dns.rdataclass.IN, + tcp=False, source=None, raise_on_no_answer=True): # pylint:disable=unused-argument + # Query the hosts file + # + # The known rdtypes are dns.rdatatype.A, dns.rdatatype.AAAA and + # dns.rdatatype.CNAME. + # The ``rdclass`` parameter must be dns.rdataclass.IN while the + # ``tcp`` and ``source`` parameters are ignored. + # Return a HostAnswer instance or raise a dns.resolver.NoAnswer + # exception. + + now = time.time() + hosts_file = self.hosts_file + if self._last_load + self.interval < now: + self._last_load = now + hosts_file.load() + + rdclass = dns.rdataclass.IN # Always + if isinstance(qname, string_types): + name = qname + qname = dns.name.from_text(qname) + else: + name = str(qname) + + name = name.lower() + rrset = dns.rrset.RRset(qname, rdclass, rdtype) + rrset.ttl = self._last_load + self.interval - now + + if rdtype == dns.rdatatype.A: + mapping = hosts_file.v4 + kind = dns.rdtypes.IN.A.A + elif rdtype == dns.rdatatype.AAAA: + mapping = hosts_file.v6 + kind = dns.rdtypes.IN.AAAA.AAAA + elif rdtype == dns.rdatatype.CNAME: + mapping = hosts_file.aliases + kind = lambda c, t, addr: dns.rdtypes.ANY.CNAME.CNAME(c, t, dns.name.from_text(addr)) + elif rdtype == dns.rdatatype.PTR: + mapping = hosts_file.reverse + kind = lambda c, t, addr: dns.rdtypes.ANY.PTR.PTR(c, t, dns.name.from_text(addr)) + + + addr = mapping.get(name) + if not addr and qname.is_absolute(): + addr = mapping.get(name[:-1]) + if addr: + rrset.add(kind(rdclass, rdtype, addr)) + return _HostsAnswer(qname, rdtype, rdclass, rrset, raise_on_no_answer) + + def getaliases(self, hostname): + # Return a list of all the aliases of a given cname + + # Due to the way store aliases this is a bit inefficient, this + # clearly was an afterthought. But this is only used by + # gethostbyname_ex so it's probably fine. + aliases = self.hosts_file.aliases + result = [] + if hostname in aliases: + cannon = aliases[hostname] + else: + cannon = hostname + result.append(cannon) + for alias, cname in iteritems(aliases): + if cannon == cname: + result.append(alias) + result.remove(hostname) + return result + +class _DualResolver(object): + + def __init__(self): + self.hosts_resolver = _HostsResolver() + self.network_resolver = resolver.get_default_resolver() + self.network_resolver.cache = resolver.LRUCache() + + def query(self, qname, rdtype=dns.rdatatype.A, rdclass=dns.rdataclass.IN, + tcp=False, source=None, raise_on_no_answer=True, + _hosts_rdtypes=(dns.rdatatype.A, dns.rdatatype.AAAA, dns.rdatatype.PTR)): + # Query the resolver, using /etc/hosts + + # Behavior: + # 1. if hosts is enabled and contains answer, return it now + # 2. query nameservers for qname + if qname is None: + qname = '0.0.0.0' + + if not isinstance(qname, string_types): + if isinstance(qname, bytes): + qname = qname.decode("idna") + + if isinstance(qname, string_types): + qname = dns.name.from_text(qname, None) + + if isinstance(rdtype, string_types): + rdtype = dns.rdatatype.from_text(rdtype) + + if rdclass == dns.rdataclass.IN and rdtype in _hosts_rdtypes: + try: + answer = self.hosts_resolver.query(qname, rdtype, raise_on_no_answer=False) + except Exception: # pylint: disable=broad-except + from gevent import get_hub + get_hub().handle_error(self, *sys.exc_info()) + else: + if answer.rrset: + return answer + + return self.network_resolver.query(qname, rdtype, rdclass, + tcp, source, raise_on_no_answer=raise_on_no_answer) + +def _family_to_rdtype(family): + if family == socket.AF_INET: + rdtype = dns.rdatatype.A + elif family == socket.AF_INET6: + rdtype = dns.rdatatype.AAAA + else: + raise socket.gaierror(socket.EAI_FAMILY, + 'Address family not supported') + return rdtype + +class Resolver(AbstractResolver): + """ + An *experimental* resolver that uses `dnspython`_. + + This is typically slower than the default threaded resolver + (unless there's a cache hit, in which case it can be much faster). + It is usually much faster than the c-ares resolver. It tends to + scale well as more concurrent resolutions are attempted. + + Under Python 2, if the ``idna`` package is installed, this + resolver can resolve Unicode host names that the system resolver + cannot. + + .. note:: + + This **does not** use dnspython's default resolver object, or share any + classes with ``import dns``. A separate copy of the objects is imported to + be able to function in a non monkey-patched process. The documentation for the resolver + object still applies. + + The resolver that we use is available as the :attr:`resolver` attribute + of this object (typically ``gevent.get_hub().resolver.resolver``). + + .. caution:: + + Many of the same caveats about DNS results apply here as are documented + for :class:`gevent.resolver.ares.Resolver`. + + .. caution:: + + This resolver is experimental. It may be removed or modified in + the future. As always, feedback is welcome. + + .. versionadded:: 1.3a2 + + .. _dnspython: http://www.dnspython.org + """ + + def __init__(self, hub=None): # pylint: disable=unused-argument + if resolver._resolver is None: + _resolver = resolver._resolver = _DualResolver() + if config.resolver_nameservers: + _resolver.network_resolver.nameservers[:] = config.resolver_nameservers + if config.resolver_timeout: + _resolver.network_resolver.lifetime = config.resolver_timeout + # Different hubs in different threads could be sharing the same + # resolver. + assert isinstance(resolver._resolver, _DualResolver) + self._resolver = resolver._resolver + + @property + def resolver(self): + """ + The dnspython resolver object we use. + + This object has several useful attributes that can be used to + adjust the behaviour of the DNS system: + + * ``cache`` is a :class:`dns.resolver.LRUCache`. Its maximum size + can be configured by calling :meth:`resolver.cache.set_max_size` + * ``nameservers`` controls which nameservers to talk to + * ``lifetime`` configures a timeout for each individual query. + """ + return self._resolver.network_resolver + + def close(self): + pass + + def _getaliases(self, hostname, family): + if not isinstance(hostname, str): + if isinstance(hostname, bytes): + hostname = hostname.decode("idna") + aliases = self._resolver.hosts_resolver.getaliases(hostname) + net_resolver = self._resolver.network_resolver + rdtype = _family_to_rdtype(family) + while True: + try: + ans = net_resolver.query(hostname, dns.rdatatype.CNAME, rdtype) + except (dns.resolver.NoAnswer, dns.resolver.NXDOMAIN, dns.resolver.NoNameservers): + break + except dTimeout: + break + else: + aliases.extend(str(rr.target) for rr in ans.rrset) + hostname = ans[0].target + return aliases + + def getaddrinfo(self, host, port, family=0, socktype=0, proto=0, flags=0): + if ((host in (u'localhost', b'localhost') + or (_is_ipv6_addr(host) and host.startswith('fe80'))) + or not isinstance(host, str) or (flags & AI_NUMERICHOST)): + # this handles cases which do not require network access + # 1) host is None + # 2) host is of an invalid type + # 3) host is localhost or a link-local ipv6; dnspython returns the wrong + # scope-id for those. + # 3) AI_NUMERICHOST flag is set + + return _socket.getaddrinfo(host, port, family, socktype, proto, flags) + + if family == AF_UNSPEC: + # This tends to raise in the case that a v6 address did not exist + # but a v4 does. So we break it into two parts. + + # Note that if there is no ipv6 in the hosts file, but there *is* + # an ipv4, and there *is* an ipv6 in the nameservers, we will return + # both (from the first call). The system resolver on OS X only returns + # the results from the hosts file. doubleclick.com is one example. + + # See also https://github.com/gevent/gevent/issues/1012 + try: + return _getaddrinfo(host, port, family, socktype, proto, flags) + except socket.gaierror: + try: + return _getaddrinfo(host, port, AF_INET6, socktype, proto, flags) + except socket.gaierror: + return _getaddrinfo(host, port, AF_INET, socktype, proto, flags) + else: + return _getaddrinfo(host, port, family, socktype, proto, flags) + + def getnameinfo(self, sockaddr, flags): + if (sockaddr + and isinstance(sockaddr, (list, tuple)) + and sockaddr[0] in ('::1', '127.0.0.1', 'localhost')): + return _socket.getnameinfo(sockaddr, flags) + if isinstance(sockaddr, (list, tuple)) and not isinstance(sockaddr[0], hostname_types): + raise TypeError("getnameinfo(): illegal sockaddr argument") + try: + return resolver._getnameinfo(sockaddr, flags) + except error: + if not flags: + # dnspython doesn't like getting ports it can't resolve. + # We have one test, test__socket_dns.py:Test_getnameinfo_geventorg.test_port_zero + # that does this. We conservatively fix it here; this could be expanded later. + return resolver._getnameinfo(sockaddr, NI_NUMERICSERV) + + def gethostbyaddr(self, ip_address): + if ip_address in (u'127.0.0.1', u'::1', + b'127.0.0.1', b'::1', + 'localhost'): + return _socket.gethostbyaddr(ip_address) + + if not isinstance(ip_address, hostname_types): + raise TypeError("argument 1 must be str, bytes or bytearray, not %s" % (type(ip_address),)) + + return resolver._gethostbyaddr(ip_address) diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/resolver/libcares.pxd b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/resolver/libcares.pxd new file mode 100644 index 00000000..7b551a7d --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/resolver/libcares.pxd @@ -0,0 +1,109 @@ +cdef extern from "ares.h": + struct ares_options: + int flags + void* sock_state_cb + void* sock_state_cb_data + int timeout + int tries + int ndots + unsigned short udp_port + unsigned short tcp_port + char **domains + int ndomains + char* lookups + + int ARES_OPT_FLAGS + int ARES_OPT_SOCK_STATE_CB + int ARES_OPT_TIMEOUTMS + int ARES_OPT_TRIES + int ARES_OPT_NDOTS + int ARES_OPT_TCP_PORT + int ARES_OPT_UDP_PORT + int ARES_OPT_SERVERS + int ARES_OPT_DOMAINS + int ARES_OPT_LOOKUPS + + int ARES_FLAG_USEVC + int ARES_FLAG_PRIMARY + int ARES_FLAG_IGNTC + int ARES_FLAG_NORECURSE + int ARES_FLAG_STAYOPEN + int ARES_FLAG_NOSEARCH + int ARES_FLAG_NOALIASES + int ARES_FLAG_NOCHECKRESP + + int ARES_LIB_INIT_ALL + int ARES_SOCKET_BAD + + int ARES_SUCCESS + int ARES_ENODATA + int ARES_EFORMERR + int ARES_ESERVFAIL + int ARES_ENOTFOUND + int ARES_ENOTIMP + int ARES_EREFUSED + int ARES_EBADQUERY + int ARES_EBADNAME + int ARES_EBADFAMILY + int ARES_EBADRESP + int ARES_ECONNREFUSED + int ARES_ETIMEOUT + int ARES_EOF + int ARES_EFILE + int ARES_ENOMEM + int ARES_EDESTRUCTION + int ARES_EBADSTR + int ARES_EBADFLAGS + int ARES_ENONAME + int ARES_EBADHINTS + int ARES_ENOTINITIALIZED + int ARES_ELOADIPHLPAPI + int ARES_EADDRGETNETWORKPARAMS + int ARES_ECANCELLED + + int ARES_NI_NOFQDN + int ARES_NI_NUMERICHOST + int ARES_NI_NAMEREQD + int ARES_NI_NUMERICSERV + int ARES_NI_DGRAM + int ARES_NI_TCP + int ARES_NI_UDP + int ARES_NI_SCTP + int ARES_NI_DCCP + int ARES_NI_NUMERICSCOPE + int ARES_NI_LOOKUPHOST + int ARES_NI_LOOKUPSERVICE + + + int ares_library_init(int flags) + void ares_library_cleanup() + int ares_init_options(void *channelptr, ares_options *options, int) + int ares_init(void *channelptr) + void ares_destroy(void *channelptr) + void ares_gethostbyname(void* channel, char *name, int family, void* callback, void *arg) + void ares_gethostbyaddr(void* channel, void *addr, int addrlen, int family, void* callback, void *arg) + void ares_process_fd(void* channel, int read_fd, int write_fd) + char* ares_strerror(int code) + void ares_cancel(void* channel) + void ares_getnameinfo(void* channel, void* sa, int salen, int flags, void* callback, void *arg) + + struct in_addr: + pass + + struct ares_in6_addr: + pass + + struct addr_union: + in_addr addr4 + ares_in6_addr addr6 + + struct ares_addr_node: + ares_addr_node *next + int family + addr_union addr + + int ares_set_servers(void* channel, ares_addr_node *servers) + + +cdef extern from "cares_pton.h": + int ares_inet_pton(int af, char *src, void *dst) diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/resolver/thread.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/resolver/thread.py new file mode 100644 index 00000000..df71706a --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/resolver/thread.py @@ -0,0 +1,71 @@ +# Copyright (c) 2012-2015 Denis Bilenko. See LICENSE for details. +""" +Native thread-based hostname resolver. +""" +import _socket + +from gevent.hub import get_hub + + +__all__ = ['Resolver'] + + +# trigger import of encodings.idna to avoid https://github.com/gevent/gevent/issues/349 +u'foo'.encode('idna') + + +class Resolver(object): + """ + Implementation of the resolver API using native threads and native resolution + functions. + + Using the native resolution mechanisms ensures the highest + compatibility with what a non-gevent program would return + including good support for platform specific configuration + mechanisms. The use of native (non-greenlet) threads ensures that + a caller doesn't block other greenlets. + + This implementation also has the benefit of being very simple in comparison to + :class:`gevent.resolver_ares.Resolver`. + + .. tip:: + + Most users find this resolver to be quite reliable in a + properly monkey-patched environment. However, there have been + some reports of long delays, slow performance or even hangs, + particularly in long-lived programs that make many, many DNS + requests. If you suspect that may be happening to you, try the + dnspython or ares resolver (and submit a bug report). + """ + def __init__(self, hub=None): + if hub is None: + hub = get_hub() + self.pool = hub.threadpool + if _socket.gaierror not in hub.NOT_ERROR: + # Do not cause lookup failures to get printed by the default + # error handler. This can be very noisy. + hub.NOT_ERROR += (_socket.gaierror, _socket.herror) + + def __repr__(self): + return '' % (id(self), self.pool) + + def close(self): + pass + + # from briefly reading socketmodule.c, it seems that all of the functions + # below are thread-safe in Python, even if they are not thread-safe in C. + + def gethostbyname(self, *args): + return self.pool.apply(_socket.gethostbyname, args) + + def gethostbyname_ex(self, *args): + return self.pool.apply(_socket.gethostbyname_ex, args) + + def getaddrinfo(self, *args, **kwargs): + return self.pool.apply(_socket.getaddrinfo, args, kwargs) + + def gethostbyaddr(self, *args, **kwargs): + return self.pool.apply(_socket.gethostbyaddr, args, kwargs) + + def getnameinfo(self, *args, **kwargs): + return self.pool.apply(_socket.getnameinfo, args, kwargs) diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/resolver_ares.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/resolver_ares.py new file mode 100644 index 00000000..9f0c4491 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/resolver_ares.py @@ -0,0 +1,17 @@ +"""Backwards compatibility alias for :mod:`gevent.resolver.ares`. + +.. deprecated:: 1.3 + Use :mod:`gevent.resolver.ares` +""" +import warnings +warnings.warn( + "gevent.resolver_ares is deprecated and will be removed in 1.5. " + "Use gevent.resolver.ares instead.", + DeprecationWarning, + stacklevel=2 +) +del warnings +from gevent.resolver.ares import * # pylint:disable=wildcard-import,unused-wildcard-import +import gevent.resolver.ares as _ares +__all__ = _ares.__all__ +del _ares diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/resolver_thread.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/resolver_thread.py new file mode 100644 index 00000000..1486e422 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/resolver_thread.py @@ -0,0 +1,17 @@ +"""Backwards compatibility alias for :mod:`gevent.resolver.thread`. + +.. deprecated:: 1.3 + Use :mod:`gevent.resolver.thread` +""" +import warnings +warnings.warn( + "gevent.resolver_thread is deprecated and will be removed in 1.5. " + "Use gevent.resolver.thread instead.", + DeprecationWarning, + stacklevel=2 +) +del warnings +from gevent.resolver.thread import * # pylint:disable=wildcard-import,unused-wildcard-import +import gevent.resolver.thread as _thread +__all__ = _thread.__all__ +del _thread diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/select.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/select.py new file mode 100644 index 00000000..a4c182cf --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/select.py @@ -0,0 +1,286 @@ +# Copyright (c) 2009-2011 Denis Bilenko. See LICENSE for details. +""" +Waiting for I/O completion. +""" +from __future__ import absolute_import, division, print_function + +import sys + +from gevent.event import Event +from gevent.hub import _get_hub_noargs as get_hub +from gevent.hub import sleep as _g_sleep +from gevent._compat import integer_types +from gevent._compat import iteritems +from gevent._util import copy_globals +from gevent._util import _NONE + +from errno import EINTR +from select import select as _real_original_select +if sys.platform.startswith('win32'): + def _original_select(r, w, x, t): + # windows cant handle three empty lists, but we've always + # accepted that + if not r and not w and not x: + return ((), (), ()) + return _real_original_select(r, w, x, t) +else: + _original_select = _real_original_select + + +try: + from select import poll as original_poll + from select import POLLIN, POLLOUT, POLLNVAL + __implements__ = ['select', 'poll'] +except ImportError: + original_poll = None + __implements__ = ['select'] + +__all__ = ['error'] + __implements__ + +import select as __select__ + +error = __select__.error + +__imports__ = copy_globals(__select__, globals(), + names_to_ignore=__all__, + dunder_names_to_keep=()) + +_EV_READ = 1 +_EV_WRITE = 2 + +def get_fileno(obj): + try: + fileno_f = obj.fileno + except AttributeError: + if not isinstance(obj, integer_types): + raise TypeError('argument must be an int, or have a fileno() method: %r' % (obj,)) + return obj + else: + return fileno_f() + + +class SelectResult(object): + __slots__ = ('read', 'write', 'event') + + def __init__(self): + self.read = [] + self.write = [] + self.event = Event() + + def add_read(self, socket): + self.read.append(socket) + self.event.set() + + add_read.event = _EV_READ + + def add_write(self, socket): + self.write.append(socket) + self.event.set() + + add_write.event = _EV_WRITE + + def __add_watchers(self, watchers, fdlist, callback, io, pri): + for fd in fdlist: + watcher = io(get_fileno(fd), callback.event) + watcher.priority = pri + watchers.append(watcher) + watcher.start(callback, fd) + + def _make_watchers(self, watchers, rlist, wlist): + loop = get_hub().loop + io = loop.io + MAXPRI = loop.MAXPRI + + try: + self.__add_watchers(watchers, rlist, self.add_read, io, MAXPRI) + self.__add_watchers(watchers, wlist, self.add_write, io, MAXPRI) + except IOError as ex: + raise error(*ex.args) + + def _closeall(self, watchers): + for watcher in watchers: + watcher.stop() + watcher.close() + del watchers[:] + + def select(self, rlist, wlist, timeout): + watchers = [] + try: + self._make_watchers(watchers, rlist, wlist) + self.event.wait(timeout=timeout) + return self.read, self.write, [] + finally: + self._closeall(watchers) + + +def select(rlist, wlist, xlist, timeout=None): # pylint:disable=unused-argument + """An implementation of :meth:`select.select` that blocks only the current greenlet. + + .. caution:: *xlist* is ignored. + + .. versionchanged:: 1.2a1 + Raise a :exc:`ValueError` if timeout is negative. This matches Python 3's + behaviour (Python 2 would raise a ``select.error``). Previously gevent had + undefined behaviour. + .. versionchanged:: 1.2a1 + Raise an exception if any of the file descriptors are invalid. + """ + if timeout is not None and timeout < 0: + # Raise an error like the real implementation; which error + # depends on the version. Python 3, where select.error is OSError, + # raises a ValueError (which makes sense). Older pythons raise + # the error from the select syscall...but we don't actually get there. + # We choose to just raise the ValueError as it makes more sense and is + # forward compatible + raise ValueError("timeout must be non-negative") + + # First, do a poll with the original select system call. This + # is the most efficient way to check to see if any of the file descriptors + # have previously been closed and raise the correct corresponding exception. + # (Because libev tends to just return them as ready...) + # We accept the *xlist* here even though we can't below because this is all about + # error handling. + sel_results = ((), (), ()) + try: + sel_results = _original_select(rlist, wlist, xlist, 0) + except error as e: + enumber = getattr(e, 'errno', None) or e.args[0] + if enumber != EINTR: + # Ignore interrupted syscalls + raise + + if sel_results[0] or sel_results[1] or sel_results[2] or (timeout is not None and timeout == 0): + # If we actually had stuff ready, go ahead and return it. No need + # to go through the trouble of doing our own stuff. + + # Likewise, if the timeout is 0, we already did a 0 timeout + # select and we don't need to do it again. Note that in libuv, + # zero duration timers may be called immediately, without + # cycling the event loop at all. 2.7/test_telnetlib.py "hangs" + # calling zero-duration timers if we go to the loop here. + + # However, because this is typically a place where scheduling switches + # can occur, we need to make sure that's still the case; otherwise a single + # consumer could monopolize the thread. (shows up in test_ftplib.) + _g_sleep() + return sel_results + + result = SelectResult() + return result.select(rlist, wlist, timeout) + + +if original_poll is not None: + class PollResult(object): + __slots__ = ('events', 'event') + + def __init__(self): + self.events = set() + self.event = Event() + + def add_event(self, events, fd): + if events < 0: + result_flags = POLLNVAL + else: + result_flags = 0 + if events & _EV_READ: + result_flags = POLLIN + if events & _EV_WRITE: + result_flags |= POLLOUT + + self.events.add((fd, result_flags)) + self.event.set() + + class poll(object): + """ + An implementation of :class:`select.poll` that blocks only the current greenlet. + + .. caution:: ``POLLPRI`` data is not supported. + + .. versionadded:: 1.1b1 + """ + def __init__(self): + # {int -> flags} + # We can't keep watcher objects in here because people commonly + # just drop the poll object when they're done, without calling + # unregister(). dnspython does this. + self.fds = {} + self.loop = get_hub().loop + + def register(self, fd, eventmask=_NONE): + if eventmask is _NONE: + flags = _EV_READ | _EV_WRITE + else: + flags = 0 + if eventmask & POLLIN: + flags = _EV_READ + if eventmask & POLLOUT: + flags |= _EV_WRITE + # If they ask for POLLPRI, we can't support + # that. Should we raise an error? + + fileno = get_fileno(fd) + self.fds[fileno] = flags + + def modify(self, fd, eventmask): + self.register(fd, eventmask) + + def poll(self, timeout=None): + """ + poll the registered fds. + + .. versionchanged:: 1.2a1 + File descriptors that are closed are reported with POLLNVAL. + + .. versionchanged:: 1.3a2 + Under libuv, interpret *timeout* values less than 0 the same as *None*, + i.e., block. This was always the case with libev. + """ + result = PollResult() + watchers = [] + io = self.loop.io + MAXPRI = self.loop.MAXPRI + try: + for fd, flags in iteritems(self.fds): + watcher = io(fd, flags) + watchers.append(watcher) + watcher.priority = MAXPRI + watcher.start(result.add_event, fd, pass_events=True) + if timeout is not None: + if timeout < 0: + # The docs for python say that an omitted timeout, + # a negative timeout and a timeout of None are all + # supposed to block forever. Many, but not all + # OS's accept any negative number to mean that. Some + # OS's raise errors for anything negative but not -1. + # Python 3.7 changes to always pass exactly -1 in that + # case from selectors. + + # Our Timeout class currently does not have a defined behaviour + # for negative values. On libuv, it uses a check watcher and effectively + # doesn't block. On libev, it seems to block. In either case, we + # *want* to block, so turn this into the sure fire block request. + timeout = None + elif timeout: + # The docs for poll.poll say timeout is in + # milliseconds. Our result objects work in + # seconds, so this should be *=, shouldn't it? + timeout /= 1000.0 + result.event.wait(timeout=timeout) + return list(result.events) + finally: + for awatcher in watchers: + awatcher.stop() + awatcher.close() + + def unregister(self, fd): + """ + Unregister the *fd*. + + .. versionchanged:: 1.2a1 + Raise a `KeyError` if *fd* was not registered, like the standard + library. Previously gevent did nothing. + """ + fileno = get_fileno(fd) + del self.fds[fileno] + +del original_poll diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/server.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/server.py new file mode 100644 index 00000000..4c48bd3d --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/server.py @@ -0,0 +1,282 @@ +# Copyright (c) 2009-2012 Denis Bilenko. See LICENSE for details. +"""TCP/SSL server""" + +from contextlib import closing + +import sys + +from _socket import error as SocketError +from _socket import SOL_SOCKET +from _socket import SO_REUSEADDR +from _socket import AF_INET +from _socket import SOCK_DGRAM + +from gevent.baseserver import BaseServer +from gevent.socket import EWOULDBLOCK +from gevent.socket import socket as GeventSocket +from gevent._compat import PYPY, PY3 + +__all__ = ['StreamServer', 'DatagramServer'] + + +if sys.platform == 'win32': + # SO_REUSEADDR on Windows does not mean the same thing as on *nix (issue #217) + DEFAULT_REUSE_ADDR = None +else: + DEFAULT_REUSE_ADDR = 1 + + +if PY3: + # sockets and SSL sockets are context managers on Python 3 + def _closing_socket(sock): + return sock +else: + # but they are not guaranteed to be so on Python 2 + _closing_socket = closing + + +class StreamServer(BaseServer): + """ + A generic TCP server. + + Accepts connections on a listening socket and spawns user-provided + *handle* function for each connection with 2 arguments: the client + socket and the client address. + + Note that although the errors in a successfully spawned handler + will not affect the server or other connections, the errors raised + by :func:`accept` and *spawn* cause the server to stop accepting + for a short amount of time. The exact period depends on the values + of :attr:`min_delay` and :attr:`max_delay` attributes. + + The delay starts with :attr:`min_delay` and doubles with each + successive error until it reaches :attr:`max_delay`. A successful + :func:`accept` resets the delay to :attr:`min_delay` again. + + See :class:`~gevent.baseserver.BaseServer` for information on defining the *handle* + function and important restrictions on it. + + **SSL Support** + + The server can optionally work in SSL mode when given the correct + keyword arguments. (That is, the presence of any keyword arguments + will trigger SSL mode.) On Python 2.7.9 and later (any Python + version that supports the :class:`ssl.SSLContext`), this can be + done with a configured ``SSLContext``. On any Python version, it + can be done by passing the appropriate arguments for + :func:`ssl.wrap_socket`. + + The incoming socket will be wrapped into an SSL socket before + being passed to the *handle* function. + + If the *ssl_context* keyword argument is present, it should + contain an :class:`ssl.SSLContext`. The remaining keyword + arguments are passed to the :meth:`ssl.SSLContext.wrap_socket` + method of that object. Depending on the Python version, supported arguments + may include: + + - server_hostname + - suppress_ragged_eofs + - do_handshake_on_connect + + .. caution:: When using an SSLContext, it should either be + imported from :mod:`gevent.ssl`, or the process needs to be monkey-patched. + If the process is not monkey-patched and you pass the standard library + SSLContext, the resulting client sockets will not cooperate with gevent. + + Otherwise, keyword arguments are assumed to apply to :func:`ssl.wrap_socket`. + These keyword arguments may include: + + - keyfile + - certfile + - cert_reqs + - ssl_version + - ca_certs + - suppress_ragged_eofs + - do_handshake_on_connect + - ciphers + + .. versionchanged:: 1.2a2 + Add support for the *ssl_context* keyword argument. + + """ + # the default backlog to use if none was provided in __init__ + backlog = 256 + + reuse_addr = DEFAULT_REUSE_ADDR + + def __init__(self, listener, handle=None, backlog=None, spawn='default', **ssl_args): + BaseServer.__init__(self, listener, handle=handle, spawn=spawn) + try: + if ssl_args: + ssl_args.setdefault('server_side', True) + if 'ssl_context' in ssl_args: + ssl_context = ssl_args.pop('ssl_context') + self.wrap_socket = ssl_context.wrap_socket + self.ssl_args = ssl_args + else: + from gevent.ssl import wrap_socket + self.wrap_socket = wrap_socket + self.ssl_args = ssl_args + else: + self.ssl_args = None + if backlog is not None: + if hasattr(self, 'socket'): + raise TypeError('backlog must be None when a socket instance is passed') + self.backlog = backlog + except: + self.close() + raise + + @property + def ssl_enabled(self): + return self.ssl_args is not None + + def set_listener(self, listener): + BaseServer.set_listener(self, listener) + try: + self.socket = self.socket._sock + except AttributeError: + pass + + def init_socket(self): + if not hasattr(self, 'socket'): + # FIXME: clean up the socket lifetime + # pylint:disable=attribute-defined-outside-init + self.socket = self.get_listener(self.address, self.backlog, self.family) + self.address = self.socket.getsockname() + if self.ssl_args: + self._handle = self.wrap_socket_and_handle + else: + self._handle = self.handle + + @classmethod + def get_listener(cls, address, backlog=None, family=None): + if backlog is None: + backlog = cls.backlog + return _tcp_listener(address, backlog=backlog, reuse_addr=cls.reuse_addr, family=family) + + if PY3: + + def do_read(self): + sock = self.socket + try: + fd, address = sock._accept() + except BlockingIOError: # python 2: pylint: disable=undefined-variable + if not sock.timeout: + return + raise + + sock = GeventSocket(sock.family, sock.type, sock.proto, fileno=fd) + # XXX Python issue #7995? + return sock, address + + else: + + def do_read(self): + try: + client_socket, address = self.socket.accept() + except SocketError as err: + if err.args[0] == EWOULDBLOCK: + return + raise + # XXX: When would this not be the case? In Python 3 it makes sense + # because we're using the low-level _accept method, + # but not in Python 2. + if not isinstance(client_socket, GeventSocket): + # This leads to a leak of the watchers in client_socket + sockobj = GeventSocket(_sock=client_socket) + if PYPY: + client_socket._drop() + else: + sockobj = client_socket + return sockobj, address + + def do_close(self, sock, *args): + # pylint:disable=arguments-differ + sock.close() + + def wrap_socket_and_handle(self, client_socket, address): + # used in case of ssl sockets + with _closing_socket(self.wrap_socket(client_socket, **self.ssl_args)) as ssl_socket: + return self.handle(ssl_socket, address) + + +class DatagramServer(BaseServer): + """A UDP server""" + + reuse_addr = DEFAULT_REUSE_ADDR + + def __init__(self, *args, **kwargs): + # The raw (non-gevent) socket, if possible + self._socket = None + BaseServer.__init__(self, *args, **kwargs) + from gevent.lock import Semaphore + self._writelock = Semaphore() + + def init_socket(self): + if not hasattr(self, 'socket'): + # FIXME: clean up the socket lifetime + # pylint:disable=attribute-defined-outside-init + self.socket = self.get_listener(self.address, self.family) + self.address = self.socket.getsockname() + self._socket = self.socket + try: + self._socket = self._socket._sock + except AttributeError: + pass + + @classmethod + def get_listener(cls, address, family=None): + return _udp_socket(address, reuse_addr=cls.reuse_addr, family=family) + + def do_read(self): + try: + data, address = self._socket.recvfrom(8192) + except SocketError as err: + if err.args[0] == EWOULDBLOCK: + return + raise + return data, address + + def sendto(self, *args): + self._writelock.acquire() + try: + self.socket.sendto(*args) + finally: + self._writelock.release() + + +def _tcp_listener(address, backlog=50, reuse_addr=None, family=AF_INET): + """A shortcut to create a TCP socket, bind it and put it into listening state.""" + sock = GeventSocket(family=family) + if reuse_addr is not None: + sock.setsockopt(SOL_SOCKET, SO_REUSEADDR, reuse_addr) + try: + sock.bind(address) + except SocketError as ex: + strerror = getattr(ex, 'strerror', None) + if strerror is not None: + ex.strerror = strerror + ': ' + repr(address) + raise + sock.listen(backlog) + sock.setblocking(0) + return sock + + +def _udp_socket(address, backlog=50, reuse_addr=None, family=AF_INET): + # backlog argument for compat with tcp_listener + # pylint:disable=unused-argument + + # we want gevent.socket.socket here + sock = GeventSocket(family=family, type=SOCK_DGRAM) + if reuse_addr is not None: + sock.setsockopt(SOL_SOCKET, SO_REUSEADDR, reuse_addr) + try: + sock.bind(address) + except SocketError as ex: + strerror = getattr(ex, 'strerror', None) + if strerror is not None: + ex.strerror = strerror + ': ' + repr(address) + raise + return sock diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/signal.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/signal.py new file mode 100644 index 00000000..0954af84 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/signal.py @@ -0,0 +1,137 @@ +""" +Cooperative implementation of special cases of :func:`signal.signal`. + +This module is designed to work with libev's child watchers, as used +by default in :func:`gevent.os.fork` Note that each ``SIGCHLD`` handler +will be run in a new greenlet when the signal is delivered (just like +:class:`gevent.hub.signal`) + +The implementations in this module are only monkey patched if +:func:`gevent.os.waitpid` is being used (the default) and if +:const:`signal.SIGCHLD` is available; see :func:`gevent.os.fork` for +information on configuring this not to be the case for advanced uses. + +.. versionadded:: 1.1b4 +""" + +from __future__ import absolute_import + +from gevent._util import _NONE as _INITIAL +from gevent._util import copy_globals + +import signal as _signal + +__implements__ = [] +__extensions__ = [] + + +_child_handler = _INITIAL + +_signal_signal = _signal.signal +_signal_getsignal = _signal.getsignal + + +def getsignal(signalnum): + """ + Exactly the same as :func:`signal.getsignal` except where + :const:`signal.SIGCHLD` is concerned. + + For :const:`signal.SIGCHLD`, this cooperates with :func:`signal` + to provide consistent answers. + """ + if signalnum != _signal.SIGCHLD: + return _signal_getsignal(signalnum) + + global _child_handler + if _child_handler is _INITIAL: + _child_handler = _signal_getsignal(_signal.SIGCHLD) + + return _child_handler + + +def signal(signalnum, handler): + """ + Exactly the same as :func:`signal.signal` except where + :const:`signal.SIGCHLD` is concerned. + + .. note:: + + A :const:`signal.SIGCHLD` handler installed with this function + will only be triggered for children that are forked using + :func:`gevent.os.fork` (:func:`gevent.os.fork_and_watch`); + children forked before monkey patching, or otherwise by the raw + :func:`os.fork`, will not trigger the handler installed by this + function. (It's unlikely that a SIGCHLD handler installed with + the builtin :func:`signal.signal` would be triggered either; + libev typically overwrites such a handler at the C level. At + the very least, it's full of race conditions.) + + .. note:: + + Use of ``SIG_IGN`` and ``SIG_DFL`` may also have race conditions + with libev child watchers and the :mod:`gevent.subprocess` module. + + .. versionchanged:: 1.2a1 + If ``SIG_IGN`` or ``SIG_DFL`` are used to ignore ``SIGCHLD``, a + future use of ``gevent.subprocess`` and libev child watchers + will once again work. However, on Python 2, use of ``os.popen`` + will fail. + + .. versionchanged:: 1.1rc2 + Allow using ``SIG_IGN`` and ``SIG_DFL`` to reset and ignore ``SIGCHLD``. + However, this allows the possibility of a race condition if ``gevent.subprocess`` + had already been used. + """ + if signalnum != _signal.SIGCHLD: + return _signal_signal(signalnum, handler) + + # TODO: raise value error if not called from the main + # greenlet, just like threads + + if handler != _signal.SIG_IGN and handler != _signal.SIG_DFL and not callable(handler): + # exact same error message raised by the stdlib + raise TypeError("signal handler must be signal.SIG_IGN, signal.SIG_DFL, or a callable object") + + old_handler = getsignal(signalnum) + global _child_handler + _child_handler = handler + if handler in (_signal.SIG_IGN, _signal.SIG_DFL): + # Allow resetting/ignoring this signal at the process level. + # Note that this conflicts with gevent.subprocess and other users + # of child watchers, until the next time gevent.subprocess/loop.install_sigchld() + # is called. + from gevent.hub import get_hub # Are we always safe to import here? + _signal_signal(signalnum, handler) + get_hub().loop.reset_sigchld() + return old_handler + + +def _on_child_hook(): + # This is called in the hub greenlet. To let the function + # do more useful work, like use blocking functions, + # we run it in a new greenlet; see gevent.hub.signal + if callable(_child_handler): + # None is a valid value for the frame argument + from gevent import Greenlet + greenlet = Greenlet(_child_handler, _signal.SIGCHLD, None) + greenlet.switch() + + +import gevent.os + +if 'waitpid' in gevent.os.__implements__ and hasattr(_signal, 'SIGCHLD'): + # Tightly coupled here to gevent.os and its waitpid implementation; only use these + # if necessary. + gevent.os._on_child_hook = _on_child_hook + __implements__.append("signal") + __implements__.append("getsignal") +else: + # XXX: This breaks test__all__ on windows + __extensions__.append("signal") + __extensions__.append("getsignal") + +__imports__ = copy_globals(_signal, globals(), + names_to_ignore=__implements__ + __extensions__, + dunder_names_to_keep=()) + +__all__ = __implements__ + __extensions__ diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/socket.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/socket.py new file mode 100644 index 00000000..1bb039e3 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/socket.py @@ -0,0 +1,129 @@ +# Copyright (c) 2009-2014 Denis Bilenko and gevent contributors. See LICENSE for details. + +"""Cooperative low-level networking interface. + +This module provides socket operations and some related functions. +The API of the functions and classes matches the API of the corresponding +items in the standard :mod:`socket` module exactly, but the synchronous functions +in this module only block the current greenlet and let the others run. + +For convenience, exceptions (like :class:`error ` and :class:`timeout `) +as well as the constants from the :mod:`socket` module are imported into this module. +""" +# Our import magic sadly makes this warning useless +# pylint: disable=undefined-variable + +from gevent._compat import PY3 +from gevent._compat import exc_clear +from gevent._util import copy_globals + + +if PY3: + from gevent import _socket3 as _source # python 2: pylint:disable=no-name-in-module +else: + from gevent import _socket2 as _source + +# define some things we're expecting to overwrite; each module +# needs to define these +__implements__ = __dns__ = __all__ = __extensions__ = __imports__ = () + + +class error(Exception): + errno = None + + +def getfqdn(*args): + # pylint:disable=unused-argument + raise NotImplementedError() + +copy_globals(_source, globals(), + dunder_names_to_keep=('__implements__', '__dns__', '__all__', + '__extensions__', '__imports__', '__socket__'), + cleanup_globs=False) + +# The _socket2 and _socket3 don't import things defined in +# __extensions__, to help avoid confusing reference cycles in the +# documentation and to prevent importing from the wrong place, but we +# *do* need to expose them here. (NOTE: This may lead to some sphinx +# warnings like: +# WARNING: missing attribute mentioned in :members: or __all__: +# module gevent._socket2, attribute cancel_wait +# These can be ignored.) +from gevent import _socketcommon +copy_globals(_socketcommon, globals(), + only_names=_socketcommon.__extensions__) + +try: + _GLOBAL_DEFAULT_TIMEOUT = __socket__._GLOBAL_DEFAULT_TIMEOUT +except AttributeError: + _GLOBAL_DEFAULT_TIMEOUT = object() + + +def create_connection(address, timeout=_GLOBAL_DEFAULT_TIMEOUT, source_address=None): + """ + create_connection(address, timeout=None, source_address=None) -> socket + + Connect to *address* and return the :class:`gevent.socket.socket` + object. + + Convenience function. Connect to *address* (a 2-tuple ``(host, + port)``) and return the socket object. Passing the optional + *timeout* parameter will set the timeout on the socket instance + before attempting to connect. If no *timeout* is supplied, the + global default timeout setting returned by + :func:`getdefaulttimeout` is used. If *source_address* is set it + must be a tuple of (host, port) for the socket to bind as a source + address before making the connection. A host of '' or port 0 tells + the OS to use the default. + """ + + host, port = address + # getaddrinfo is documented as returning a list, but our interface + # is pluggable, so be sure it does. + addrs = list(getaddrinfo(host, port, 0, SOCK_STREAM)) + if not addrs: + raise error("getaddrinfo returns an empty list") + + for res in addrs: + af, socktype, proto, _, sa = res + sock = None + try: + sock = socket(af, socktype, proto) + if timeout is not _GLOBAL_DEFAULT_TIMEOUT: + sock.settimeout(timeout) + if source_address: + sock.bind(source_address) + sock.connect(sa) + except error: + if sock is not None: + sock.close() + sock = None + if res is addrs[-1]: + raise + # without exc_clear(), if connect() fails once, the socket + # is referenced by the frame in exc_info and the next + # bind() fails (see test__socket.TestCreateConnection) + # that does not happen with regular sockets though, + # because _socket.socket.connect() is a built-in. this is + # similar to "getnameinfo loses a reference" failure in + # test_socket.py + exc_clear() + except BaseException: + # Things like GreenletExit, Timeout and KeyboardInterrupt. + # These get raised immediately, being sure to + # close the socket + if sock is not None: + sock.close() + sock = None + raise + else: + try: + return sock + finally: + sock = None + + +# This is promised to be in the __all__ of the _source, but, for circularity reasons, +# we implement it in this module. Mostly for documentation purposes, put it +# in the _source too. +_source.create_connection = create_connection diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/ssl.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/ssl.py new file mode 100644 index 00000000..2418c414 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/ssl.py @@ -0,0 +1,35 @@ +""" +Secure Sockets Layer (SSL/TLS) module. +""" +from gevent._compat import PY2 +from gevent._util import copy_globals + +# things we expect to override, here for static analysis +def wrap_socket(_sock, **_kwargs): + # pylint:disable=unused-argument + raise NotImplementedError() + +if PY2: + if hasattr(__import__('ssl'), 'SSLContext'): + # It's not sufficient to check for >= 2.7.9; some distributions + # have backported most of PEP 466. Try to accommodate them. See Issue #702. + # We're just about to import ssl anyway so it's fine to import it here, just + # don't pollute the namespace + from gevent import _sslgte279 as _source + else: # pragma: no cover + from gevent import _ssl2 as _source + import warnings + warnings.warn( + "This version of Python has an insecure SSL implementation. " + "gevent is no longer tested with it, and support will be removed " + "in gevent 1.5. Please use Python 2.7.9 or newer.", + DeprecationWarning, + stacklevel=2, + ) + del warnings +else: + # Py3 + from gevent import _ssl3 as _source # pragma: no cover + + +copy_globals(_source, globals()) diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/subprocess.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/subprocess.py new file mode 100644 index 00000000..58409c2a --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/subprocess.py @@ -0,0 +1,1688 @@ +""" +Cooperative ``subprocess`` module. + +.. caution:: On POSIX platforms, this module is not usable from native + threads other than the main thread; attempting to do so will raise + a :exc:`TypeError`. This module depends on libev's fork watchers. + On POSIX systems, fork watchers are implemented using signals, and + the thread to which process-directed signals are delivered `is not + defined`_. Because each native thread has its own gevent/libev + loop, this means that a fork watcher registered with one loop + (thread) may never see the signal about a child it spawned if the + signal is sent to a different thread. + +.. note:: The interface of this module is intended to match that of + the standard library :mod:`subprocess` module (with many backwards + compatible extensions from Python 3 backported to Python 2). There + are some small differences between the Python 2 and Python 3 + versions of that module (the Python 2 ``TimeoutExpired`` exception, + notably, extends ``Timeout`` and there is no ``SubprocessError``) and between the + POSIX and Windows versions. The HTML documentation here can only + describe one version; for definitive documentation, see the + standard library or the source code. + +.. _is not defined: http://www.linuxprogrammingblog.com/all-about-linux-signals?page=11 +""" +from __future__ import absolute_import, print_function +# Can we split this up to make it cleaner? See https://github.com/gevent/gevent/issues/748 +# pylint: disable=too-many-lines +# Most of this we inherit from the standard lib +# pylint: disable=bare-except,too-many-locals,too-many-statements,attribute-defined-outside-init +# pylint: disable=too-many-branches,too-many-instance-attributes +# Most of this is cross-platform +# pylint: disable=no-member,expression-not-assigned,unused-argument,unused-variable +import errno +import gc +import os +import signal +import sys +import traceback +from gevent.event import AsyncResult +from gevent.hub import _get_hub_noargs as get_hub +from gevent.hub import linkproxy +from gevent.hub import sleep +from gevent.hub import getcurrent +from gevent._compat import integer_types, string_types, xrange +from gevent._compat import PY3 +from gevent._compat import reraise +from gevent._compat import fspath +from gevent._compat import fsencode +from gevent._util import _NONE +from gevent._util import copy_globals + +from gevent.greenlet import Greenlet, joinall +spawn = Greenlet.spawn +import subprocess as __subprocess__ + + +# Standard functions and classes that this module re-implements in a gevent-aware way. +__implements__ = [ + 'Popen', + 'call', + 'check_call', + 'check_output', +] +if PY3 and not sys.platform.startswith('win32'): + __implements__.append("_posixsubprocess") + _posixsubprocess = None + +# Some symbols we define that we expect to export; +# useful for static analysis +PIPE = "PIPE should be imported" + +# Standard functions and classes that this module re-imports. +__imports__ = [ + 'PIPE', + 'STDOUT', + 'CalledProcessError', + # Windows: + 'CREATE_NEW_CONSOLE', + 'CREATE_NEW_PROCESS_GROUP', + 'STD_INPUT_HANDLE', + 'STD_OUTPUT_HANDLE', + 'STD_ERROR_HANDLE', + 'SW_HIDE', + 'STARTF_USESTDHANDLES', + 'STARTF_USESHOWWINDOW', +] + + +__extra__ = [ + 'MAXFD', + '_eintr_retry_call', + 'STARTUPINFO', + 'pywintypes', + 'list2cmdline', + '_subprocess', + '_winapi', + # Python 2.5 does not have _subprocess, so we don't use it + # XXX We don't run on Py 2.5 anymore; can/could/should we use _subprocess? + # It's only used on mswindows + 'WAIT_OBJECT_0', + 'WaitForSingleObject', + 'GetExitCodeProcess', + 'GetStdHandle', + 'CreatePipe', + 'DuplicateHandle', + 'GetCurrentProcess', + 'DUPLICATE_SAME_ACCESS', + 'GetModuleFileName', + 'GetVersion', + 'CreateProcess', + 'INFINITE', + 'TerminateProcess', + 'STILL_ACTIVE', + + # These were added for 3.5, but we make them available everywhere. + 'run', + 'CompletedProcess', +] + +if sys.version_info[:2] >= (3, 3): + __imports__ += [ + 'DEVNULL', + 'getstatusoutput', + 'getoutput', + 'SubprocessError', + 'TimeoutExpired', + ] +else: + __extra__.append("TimeoutExpired") + + +if sys.version_info[:2] >= (3, 5): + __extra__.remove('run') + __extra__.remove('CompletedProcess') + __implements__.append('run') + __implements__.append('CompletedProcess') + + # Removed in Python 3.5; this is the exact code that was removed: + # https://hg.python.org/cpython/rev/f98b0a5e5ef5 + __extra__.remove('MAXFD') + try: + MAXFD = os.sysconf("SC_OPEN_MAX") + except: + MAXFD = 256 + +if sys.version_info[:2] >= (3, 6): + # This was added to __all__ for windows in 3.6 + __extra__.remove('STARTUPINFO') + __imports__.append('STARTUPINFO') + +if sys.version_info[:2] >= (3, 7): + __imports__.extend([ + 'ABOVE_NORMAL_PRIORITY_CLASS', 'BELOW_NORMAL_PRIORITY_CLASS', + 'HIGH_PRIORITY_CLASS', 'IDLE_PRIORITY_CLASS', + 'NORMAL_PRIORITY_CLASS', + 'REALTIME_PRIORITY_CLASS', + 'CREATE_NO_WINDOW', 'DETACHED_PROCESS', + 'CREATE_DEFAULT_ERROR_MODE', + 'CREATE_BREAKAWAY_FROM_JOB' + ]) + +actually_imported = copy_globals(__subprocess__, globals(), + only_names=__imports__, + ignore_missing_names=True) +# anything we couldn't import from here we may need to find +# elsewhere +__extra__.extend(set(__imports__).difference(set(actually_imported))) +__imports__ = actually_imported +del actually_imported + + +# In Python 3 on Windows, a lot of the functions previously +# in _subprocess moved to _winapi +_subprocess = getattr(__subprocess__, '_subprocess', _NONE) +_winapi = getattr(__subprocess__, '_winapi', _NONE) + +_attr_resolution_order = [__subprocess__, _subprocess, _winapi] + +for name in list(__extra__): + if name in globals(): + continue + value = _NONE + for place in _attr_resolution_order: + value = getattr(place, name, _NONE) + if value is not _NONE: + break + + if value is _NONE: + __extra__.remove(name) + else: + globals()[name] = value + +del _attr_resolution_order +__all__ = __implements__ + __imports__ +# Some other things we want to document +for _x in ('run', 'CompletedProcess', 'TimeoutExpired'): + if _x not in __all__: + __all__.append(_x) + + +mswindows = sys.platform == 'win32' +if mswindows: + import msvcrt # pylint: disable=import-error + if PY3: + class Handle(int): + closed = False + + def Close(self): + if not self.closed: + self.closed = True + _winapi.CloseHandle(self) + + def Detach(self): + if not self.closed: + self.closed = True + return int(self) + raise ValueError("already closed") + + def __repr__(self): + return "Handle(%d)" % int(self) + + __del__ = Close + __str__ = __repr__ +else: + import fcntl + import pickle + from gevent import monkey + fork = monkey.get_original('os', 'fork') + from gevent.os import fork_and_watch + +def call(*popenargs, **kwargs): + """ + call(args, *, stdin=None, stdout=None, stderr=None, shell=False, timeout=None) -> returncode + + Run command with arguments. Wait for command to complete or + timeout, then return the returncode attribute. + + The arguments are the same as for the Popen constructor. Example:: + + retcode = call(["ls", "-l"]) + + .. versionchanged:: 1.2a1 + The ``timeout`` keyword argument is now accepted on all supported + versions of Python (not just Python 3) and if it expires will raise a + :exc:`TimeoutExpired` exception (under Python 2 this is a subclass of :exc:`~.Timeout`). + """ + timeout = kwargs.pop('timeout', None) + with Popen(*popenargs, **kwargs) as p: + try: + return p.wait(timeout=timeout, _raise_exc=True) + except: + p.kill() + p.wait() + raise + +def check_call(*popenargs, **kwargs): + """ + check_call(args, *, stdin=None, stdout=None, stderr=None, shell=False, timeout=None) -> 0 + + Run command with arguments. Wait for command to complete. If + the exit code was zero then return, otherwise raise + :exc:`CalledProcessError`. The ``CalledProcessError`` object will have the + return code in the returncode attribute. + + The arguments are the same as for the Popen constructor. Example:: + + retcode = check_call(["ls", "-l"]) + """ + retcode = call(*popenargs, **kwargs) + if retcode: + cmd = kwargs.get("args") + if cmd is None: + cmd = popenargs[0] + raise CalledProcessError(retcode, cmd) # pylint:disable=undefined-variable + return 0 + +def check_output(*popenargs, **kwargs): + r""" + check_output(args, *, input=None, stdin=None, stderr=None, shell=False, universal_newlines=False, timeout=None) -> output + + Run command with arguments and return its output. + + If the exit code was non-zero it raises a :exc:`CalledProcessError`. The + ``CalledProcessError`` object will have the return code in the returncode + attribute and output in the output attribute. + + + The arguments are the same as for the Popen constructor. Example:: + + >>> check_output(["ls", "-1", "/dev/null"]) + '/dev/null\n' + + The ``stdout`` argument is not allowed as it is used internally. + + To capture standard error in the result, use ``stderr=STDOUT``:: + + >>> print(check_output(["/bin/sh", "-c", + ... "ls -l non_existent_file ; exit 0"], + ... stderr=STDOUT).decode('ascii').strip()) + ls: non_existent_file: No such file or directory + + There is an additional optional argument, "input", allowing you to + pass a string to the subprocess's stdin. If you use this argument + you may not also use the Popen constructor's "stdin" argument, as + it too will be used internally. Example:: + + >>> check_output(["sed", "-e", "s/foo/bar/"], + ... input=b"when in the course of fooman events\n") + 'when in the course of barman events\n' + + If ``universal_newlines=True`` is passed, the return value will be a + string rather than bytes. + + .. versionchanged:: 1.2a1 + The ``timeout`` keyword argument is now accepted on all supported + versions of Python (not just Python 3) and if it expires will raise a + :exc:`TimeoutExpired` exception (under Python 2 this is a subclass of :exc:`~.Timeout`). + .. versionchanged:: 1.2a1 + The ``input`` keyword argument is now accepted on all supported + versions of Python, not just Python 3 + """ + timeout = kwargs.pop('timeout', None) + if 'stdout' in kwargs: + raise ValueError('stdout argument not allowed, it will be overridden.') + if 'input' in kwargs: + if 'stdin' in kwargs: + raise ValueError('stdin and input arguments may not both be used.') + inputdata = kwargs['input'] + del kwargs['input'] + kwargs['stdin'] = PIPE + else: + inputdata = None + with Popen(*popenargs, stdout=PIPE, **kwargs) as process: + try: + output, unused_err = process.communicate(inputdata, timeout=timeout) + except TimeoutExpired: + process.kill() + output, unused_err = process.communicate() + raise TimeoutExpired(process.args, timeout, output=output) + except: + process.kill() + process.wait() + raise + retcode = process.poll() + if retcode: + # pylint:disable=undefined-variable + raise CalledProcessError(retcode, process.args, output=output) + return output + +_PLATFORM_DEFAULT_CLOSE_FDS = object() + +if 'TimeoutExpired' not in globals(): + # Python 2 + + # Make TimeoutExpired inherit from _Timeout so it can be caught + # the way we used to throw things (except Timeout), but make sure it doesn't + # init a timer. Note that we can't have a fake 'SubprocessError' that inherits + # from exception, because we need TimeoutExpired to just be a BaseException for + # bwc. + from gevent.timeout import Timeout as _Timeout + + class TimeoutExpired(_Timeout): + """ + This exception is raised when the timeout expires while waiting for + a child process in `communicate`. + + Under Python 2, this is a gevent extension with the same name as the + Python 3 class for source-code forward compatibility. However, it extends + :class:`gevent.timeout.Timeout` for backwards compatibility (because + we used to just raise a plain ``Timeout``); note that ``Timeout`` is a + ``BaseException``, *not* an ``Exception``. + + .. versionadded:: 1.2a1 + """ + + def __init__(self, cmd, timeout, output=None): + _Timeout.__init__(self, None) + self.cmd = cmd + self.seconds = timeout + self.output = output + + @property + def timeout(self): + return self.seconds + + def __str__(self): + return ("Command '%s' timed out after %s seconds" % + (self.cmd, self.timeout)) + + +if hasattr(os, 'set_inheritable'): + _set_inheritable = os.set_inheritable +else: + _set_inheritable = lambda i, v: True + + +def FileObject(*args): + # Defer importing FileObject until we need it + # to allow it to be configured more easily. + from gevent.fileobject import FileObject as _FileObject + globals()['FileObject'] = _FileObject + return _FileObject(*args) + +class Popen(object): + """ + The underlying process creation and management in this module is + handled by the Popen class. It offers a lot of flexibility so that + developers are able to handle the less common cases not covered by + the convenience functions. + + .. seealso:: :class:`subprocess.Popen` + This class should have the same interface as the standard library class. + + .. versionchanged:: 1.2a1 + Instances can now be used as context managers under Python 2.7. Previously + this was restricted to Python 3. + + .. versionchanged:: 1.2a1 + Instances now save the ``args`` attribute under Python 2.7. Previously this was + restricted to Python 3. + + .. versionchanged:: 1.2b1 + Add the ``encoding`` and ``errors`` parameters for Python 3. + + .. versionchanged:: 1.3a1 + Accept "path-like" objects for the *cwd* parameter on all platforms. + This was added to Python 3.6. Previously with gevent, it only worked + on POSIX platforms on 3.6. + + .. versionchanged:: 1.3a1 + Add the ``text`` argument as a synonym for ``universal_newlines``, + as added on Python 3.7. + + .. versionchanged:: 1.3a2 + Allow the same keyword arguments under Python 2 as Python 3: + ``pass_fds``, ``start_new_session``, ``restore_signals``, ``encoding`` + and ``errors``. Under Python 2, ``encoding`` and ``errors`` are ignored + because native handling of universal newlines is used. + + .. versionchanged:: 1.3a2 + Under Python 2, ``restore_signals`` defaults to ``False``. Previously it + defaulted to ``True``, the same as it did in Python 3. + """ + + # The value returned from communicate() when there was nothing to read. + # Changes if we're in text mode or universal newlines mode. + _communicate_empty_value = b'' + + def __init__(self, args, + bufsize=-1 if PY3 else 0, + executable=None, + stdin=None, stdout=None, stderr=None, + preexec_fn=None, close_fds=_PLATFORM_DEFAULT_CLOSE_FDS, shell=False, + cwd=None, env=None, universal_newlines=None, + startupinfo=None, creationflags=0, + restore_signals=PY3, start_new_session=False, + pass_fds=(), + # Added in 3.6. These are kept as ivars + encoding=None, errors=None, + # Added in 3.7. Not an ivar directly. + text=None, + # gevent additions + threadpool=None): + + self.encoding = encoding + self.errors = errors + + hub = get_hub() + + if bufsize is None: + # Python 2 doesn't allow None at all, but Python 3 treats + # it the same as the default. We do as well. + bufsize = -1 if PY3 else 0 + if not isinstance(bufsize, integer_types): + raise TypeError("bufsize must be an integer") + + if mswindows: + if preexec_fn is not None: + raise ValueError("preexec_fn is not supported on Windows " + "platforms") + if sys.version_info[:2] >= (3, 7): + if close_fds is _PLATFORM_DEFAULT_CLOSE_FDS: + close_fds = True + else: + any_stdio_set = (stdin is not None or stdout is not None or + stderr is not None) + if close_fds is _PLATFORM_DEFAULT_CLOSE_FDS: + if any_stdio_set: + close_fds = False + else: + close_fds = True + elif close_fds and any_stdio_set: + raise ValueError("close_fds is not supported on Windows " + "platforms if you redirect stdin/stdout/stderr") + if threadpool is None: + threadpool = hub.threadpool + self.threadpool = threadpool + self._waiting = False + else: + # POSIX + if close_fds is _PLATFORM_DEFAULT_CLOSE_FDS: + # close_fds has different defaults on Py3/Py2 + if PY3: # pylint: disable=simplifiable-if-statement + close_fds = True + else: + close_fds = False + + if pass_fds and not close_fds: + import warnings + warnings.warn("pass_fds overriding close_fds.", RuntimeWarning) + close_fds = True + if startupinfo is not None: + raise ValueError("startupinfo is only supported on Windows " + "platforms") + if creationflags != 0: + raise ValueError("creationflags is only supported on Windows " + "platforms") + assert threadpool is None + self._loop = hub.loop + + # Validate the combinations of text and universal_newlines + if (text is not None and universal_newlines is not None + and bool(universal_newlines) != bool(text)): + # pylint:disable=undefined-variable + raise SubprocessError('Cannot disambiguate when both text ' + 'and universal_newlines are supplied but ' + 'different. Pass one or the other.') + + self.args = args # Previously this was Py3 only. + self.stdin = None + self.stdout = None + self.stderr = None + self.pid = None + self.returncode = None + self.universal_newlines = universal_newlines + self.result = AsyncResult() + + # Input and output objects. The general principle is like + # this: + # + # Parent Child + # ------ ----- + # p2cwrite ---stdin---> p2cread + # c2pread <--stdout--- c2pwrite + # errread <--stderr--- errwrite + # + # On POSIX, the child objects are file descriptors. On + # Windows, these are Windows file handles. The parent objects + # are file descriptors on both platforms. The parent objects + # are -1 when not using PIPEs. The child objects are -1 + # when not redirecting. + + (p2cread, p2cwrite, + c2pread, c2pwrite, + errread, errwrite) = self._get_handles(stdin, stdout, stderr) + + # We wrap OS handles *before* launching the child, otherwise a + # quickly terminating child could make our fds unwrappable + # (see #8458). + if mswindows: + if p2cwrite != -1: + p2cwrite = msvcrt.open_osfhandle(p2cwrite.Detach(), 0) + if c2pread != -1: + c2pread = msvcrt.open_osfhandle(c2pread.Detach(), 0) + if errread != -1: + errread = msvcrt.open_osfhandle(errread.Detach(), 0) + + text_mode = PY3 and (self.encoding or self.errors or universal_newlines or text) + if text_mode or universal_newlines: + # Always a native str in universal_newlines mode, even when that + # str type is bytes. Additionally, text_mode is only true under + # Python 3, so it's actually a unicode str + self._communicate_empty_value = '' + + + if p2cwrite != -1: + if PY3 and text_mode: + # Under Python 3, if we left on the 'b' we'd get different results + # depending on whether we used FileObjectPosix or FileObjectThread + self.stdin = FileObject(p2cwrite, 'wb', bufsize) + self.stdin.translate_newlines(None, + write_through=True, + line_buffering=(bufsize == 1), + encoding=self.encoding, errors=self.errors) + else: + self.stdin = FileObject(p2cwrite, 'wb', bufsize) + if c2pread != -1: + if universal_newlines or text_mode: + if PY3: + # FileObjectThread doesn't support the 'U' qualifier + # with a bufsize of 0 + self.stdout = FileObject(c2pread, 'rb', bufsize) + # NOTE: Universal Newlines are broken on Windows/Py3, at least + # in some cases. This is true in the stdlib subprocess module + # as well; the following line would fix the test cases in + # test__subprocess.py that depend on python_universal_newlines, + # but would be inconsistent with the stdlib: + #msvcrt.setmode(self.stdout.fileno(), os.O_TEXT) + self.stdout.translate_newlines('r', encoding=self.encoding, errors=self.errors) + else: + self.stdout = FileObject(c2pread, 'rU', bufsize) + else: + self.stdout = FileObject(c2pread, 'rb', bufsize) + if errread != -1: + if universal_newlines or text_mode: + if PY3: + self.stderr = FileObject(errread, 'rb', bufsize) + self.stderr.translate_newlines(None, encoding=encoding, errors=errors) + else: + self.stderr = FileObject(errread, 'rU', bufsize) + else: + self.stderr = FileObject(errread, 'rb', bufsize) + + self._closed_child_pipe_fds = False + # Convert here for the sake of all platforms. os.chdir accepts + # path-like objects natively under 3.6, but CreateProcess + # doesn't. + cwd = fspath(cwd) if cwd is not None else None + try: + self._execute_child(args, executable, preexec_fn, close_fds, + pass_fds, cwd, env, universal_newlines, + startupinfo, creationflags, shell, + p2cread, p2cwrite, + c2pread, c2pwrite, + errread, errwrite, + restore_signals, start_new_session) + except: + # Cleanup if the child failed starting. + # (gevent: New in python3, but reported as gevent bug in #347. + # Note that under Py2, any error raised below will replace the + # original error so we have to use reraise) + if not PY3: + exc_info = sys.exc_info() + for f in filter(None, (self.stdin, self.stdout, self.stderr)): + try: + f.close() + except (OSError, IOError): + pass # Ignore EBADF or other errors. + + if not self._closed_child_pipe_fds: + to_close = [] + if stdin == PIPE: + to_close.append(p2cread) + if stdout == PIPE: + to_close.append(c2pwrite) + if stderr == PIPE: + to_close.append(errwrite) + if hasattr(self, '_devnull'): + to_close.append(self._devnull) + for fd in to_close: + try: + os.close(fd) + except (OSError, IOError): + pass + if not PY3: + try: + reraise(*exc_info) + finally: + del exc_info + raise + + def __repr__(self): + return '<%s at 0x%x pid=%r returncode=%r>' % (self.__class__.__name__, id(self), self.pid, self.returncode) + + def _on_child(self, watcher): + watcher.stop() + status = watcher.rstatus + if os.WIFSIGNALED(status): + self.returncode = -os.WTERMSIG(status) + else: + self.returncode = os.WEXITSTATUS(status) + self.result.set(self.returncode) + + def _get_devnull(self): + if not hasattr(self, '_devnull'): + self._devnull = os.open(os.devnull, os.O_RDWR) + return self._devnull + + _stdout_buffer = None + _stderr_buffer = None + + def communicate(self, input=None, timeout=None): + """Interact with process: Send data to stdin. Read data from + stdout and stderr, until end-of-file is reached. Wait for + process to terminate. The optional input argument should be a + string to be sent to the child process, or None, if no data + should be sent to the child. + + communicate() returns a tuple (stdout, stderr). + + :keyword timeout: Under Python 2, this is a gevent extension; if + given and it expires, we will raise :exc:`TimeoutExpired`, which + extends :exc:`gevent.timeout.Timeout` (note that this only extends :exc:`BaseException`, + *not* :exc:`Exception`) + Under Python 3, this raises the standard :exc:`TimeoutExpired` exception. + + .. versionchanged:: 1.1a2 + Under Python 2, if the *timeout* elapses, raise the :exc:`gevent.timeout.Timeout` + exception. Previously, we silently returned. + .. versionchanged:: 1.1b5 + Honor a *timeout* even if there's no way to communicate with the child + (stdin, stdout, and stderr are not pipes). + """ + greenlets = [] + if self.stdin: + greenlets.append(spawn(write_and_close, self.stdin, input)) + + # If the timeout parameter is used, and the caller calls back after + # getting a TimeoutExpired exception, we can wind up with multiple + # greenlets trying to run and read from and close stdout/stderr. + # That's bad because it can lead to 'RuntimeError: reentrant call in io.BufferedReader'. + # We can't just kill the previous greenlets when a timeout happens, + # though, because we risk losing the output collected by that greenlet + # (and Python 3, where timeout is an official parameter, explicitly says + # that no output should be lost in the event of a timeout.) Instead, we're + # watching for the exception and ignoring it. It's not elegant, + # but it works + def _make_pipe_reader(pipe_name): + pipe = getattr(self, pipe_name) + buf_name = '_' + pipe_name + '_buffer' + + def _read(): + try: + data = pipe.read() + except RuntimeError: + return + if not data: + return + the_buffer = getattr(self, buf_name) + if the_buffer: + the_buffer.append(data) + else: + setattr(self, buf_name, [data]) + return _read + + if self.stdout: + _read_out = _make_pipe_reader('stdout') + stdout = spawn(_read_out) + greenlets.append(stdout) + else: + stdout = None + + if self.stderr: + _read_err = _make_pipe_reader('stderr') + stderr = spawn(_read_err) + greenlets.append(stderr) + else: + stderr = None + + # If we were given stdin=stdout=stderr=None, we have no way to + # communicate with the child, and thus no greenlets to wait + # on. This is a nonsense case, but it comes up in the test + # case for Python 3.5 (test_subprocess.py + # RunFuncTestCase.test_timeout). Instead, we go directly to + # self.wait + if not greenlets and timeout is not None: + self.wait(timeout=timeout, _raise_exc=True) + + done = joinall(greenlets, timeout=timeout) + if timeout is not None and len(done) != len(greenlets): + raise TimeoutExpired(self.args, timeout) + + for pipe in (self.stdout, self.stderr): + if pipe: + try: + pipe.close() + except RuntimeError: + pass + + self.wait() + + def _get_output_value(pipe_name): + buf_name = '_' + pipe_name + '_buffer' + buf_value = getattr(self, buf_name) + setattr(self, buf_name, None) + if buf_value: + buf_value = self._communicate_empty_value.join(buf_value) + else: + buf_value = self._communicate_empty_value + return buf_value + + stdout_value = _get_output_value('stdout') + stderr_value = _get_output_value('stderr') + + return (None if stdout is None else stdout_value, + None if stderr is None else stderr_value) + + def poll(self): + """Check if child process has terminated. Set and return :attr:`returncode` attribute.""" + return self._internal_poll() + + def __enter__(self): + return self + + def __exit__(self, t, v, tb): + if self.stdout: + self.stdout.close() + if self.stderr: + self.stderr.close() + try: # Flushing a BufferedWriter may raise an error + if self.stdin: + self.stdin.close() + finally: + # Wait for the process to terminate, to avoid zombies. + # JAM: gevent: If the process never terminates, this + # blocks forever. + self.wait() + + def _gevent_result_wait(self, timeout=None, raise_exc=PY3): + result = self.result.wait(timeout=timeout) + if raise_exc and timeout is not None and not self.result.ready(): + raise TimeoutExpired(self.args, timeout) + return result + + + if mswindows: + # + # Windows methods + # + def _get_handles(self, stdin, stdout, stderr): + """Construct and return tuple with IO objects: + p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite + """ + # pylint:disable=undefined-variable + if stdin is None and stdout is None and stderr is None: + return (-1, -1, -1, -1, -1, -1) + + p2cread, p2cwrite = -1, -1 + c2pread, c2pwrite = -1, -1 + errread, errwrite = -1, -1 + + try: + DEVNULL + except NameError: + _devnull = object() + else: + _devnull = DEVNULL + + if stdin is None: + p2cread = GetStdHandle(STD_INPUT_HANDLE) + if p2cread is None: + p2cread, _ = CreatePipe(None, 0) + if PY3: + p2cread = Handle(p2cread) + _winapi.CloseHandle(_) + elif stdin == PIPE: + p2cread, p2cwrite = CreatePipe(None, 0) + if PY3: + p2cread, p2cwrite = Handle(p2cread), Handle(p2cwrite) + elif stdin == _devnull: + p2cread = msvcrt.get_osfhandle(self._get_devnull()) + elif isinstance(stdin, int): + p2cread = msvcrt.get_osfhandle(stdin) + else: + # Assuming file-like object + p2cread = msvcrt.get_osfhandle(stdin.fileno()) + p2cread = self._make_inheritable(p2cread) + + if stdout is None: + c2pwrite = GetStdHandle(STD_OUTPUT_HANDLE) + if c2pwrite is None: + _, c2pwrite = CreatePipe(None, 0) + if PY3: + c2pwrite = Handle(c2pwrite) + _winapi.CloseHandle(_) + elif stdout == PIPE: + c2pread, c2pwrite = CreatePipe(None, 0) + if PY3: + c2pread, c2pwrite = Handle(c2pread), Handle(c2pwrite) + elif stdout == _devnull: + c2pwrite = msvcrt.get_osfhandle(self._get_devnull()) + elif isinstance(stdout, int): + c2pwrite = msvcrt.get_osfhandle(stdout) + else: + # Assuming file-like object + c2pwrite = msvcrt.get_osfhandle(stdout.fileno()) + c2pwrite = self._make_inheritable(c2pwrite) + + if stderr is None: + errwrite = GetStdHandle(STD_ERROR_HANDLE) + if errwrite is None: + _, errwrite = CreatePipe(None, 0) + if PY3: + errwrite = Handle(errwrite) + _winapi.CloseHandle(_) + elif stderr == PIPE: + errread, errwrite = CreatePipe(None, 0) + if PY3: + errread, errwrite = Handle(errread), Handle(errwrite) + elif stderr == STDOUT: + errwrite = c2pwrite + elif stderr == _devnull: + errwrite = msvcrt.get_osfhandle(self._get_devnull()) + elif isinstance(stderr, int): + errwrite = msvcrt.get_osfhandle(stderr) + else: + # Assuming file-like object + errwrite = msvcrt.get_osfhandle(stderr.fileno()) + errwrite = self._make_inheritable(errwrite) + + return (p2cread, p2cwrite, + c2pread, c2pwrite, + errread, errwrite) + + def _make_inheritable(self, handle): + """Return a duplicate of handle, which is inheritable""" + # pylint:disable=undefined-variable + return DuplicateHandle(GetCurrentProcess(), + handle, GetCurrentProcess(), 0, 1, + DUPLICATE_SAME_ACCESS) + + def _find_w9xpopen(self): + """Find and return absolute path to w9xpopen.exe""" + # pylint:disable=undefined-variable + w9xpopen = os.path.join(os.path.dirname(GetModuleFileName(0)), + "w9xpopen.exe") + if not os.path.exists(w9xpopen): + # Eeek - file-not-found - possibly an embedding + # situation - see if we can locate it in sys.exec_prefix + w9xpopen = os.path.join(os.path.dirname(sys.exec_prefix), + "w9xpopen.exe") + if not os.path.exists(w9xpopen): + raise RuntimeError("Cannot locate w9xpopen.exe, which is " + "needed for Popen to work with your " + "shell or platform.") + return w9xpopen + + + def _filter_handle_list(self, handle_list): + """Filter out console handles that can't be used + in lpAttributeList["handle_list"] and make sure the list + isn't empty. This also removes duplicate handles.""" + # An handle with it's lowest two bits set might be a special console + # handle that if passed in lpAttributeList["handle_list"], will + # cause it to fail. + # Only works on 3.7+ + return list({handle for handle in handle_list + if handle & 0x3 != 0x3 + or _winapi.GetFileType(handle) != + _winapi.FILE_TYPE_CHAR}) + + + def _execute_child(self, args, executable, preexec_fn, close_fds, + pass_fds, cwd, env, universal_newlines, + startupinfo, creationflags, shell, + p2cread, p2cwrite, + c2pread, c2pwrite, + errread, errwrite, + unused_restore_signals, unused_start_new_session): + """Execute program (MS Windows version)""" + # pylint:disable=undefined-variable + assert not pass_fds, "pass_fds not supported on Windows." + + if not isinstance(args, string_types): + args = list2cmdline(args) + + # Process startup details + if startupinfo is None: + startupinfo = STARTUPINFO() + use_std_handles = -1 not in (p2cread, c2pwrite, errwrite) + if use_std_handles: + startupinfo.dwFlags |= STARTF_USESTDHANDLES + startupinfo.hStdInput = p2cread + startupinfo.hStdOutput = c2pwrite + startupinfo.hStdError = errwrite + + if hasattr(startupinfo, 'lpAttributeList'): + # Support for Python >= 3.7 + + attribute_list = startupinfo.lpAttributeList + have_handle_list = bool(attribute_list and + "handle_list" in attribute_list and + attribute_list["handle_list"]) + + # If we were given an handle_list or need to create one + if have_handle_list or (use_std_handles and close_fds): + if attribute_list is None: + attribute_list = startupinfo.lpAttributeList = {} + handle_list = attribute_list["handle_list"] = \ + list(attribute_list.get("handle_list", [])) + + if use_std_handles: + handle_list += [int(p2cread), int(c2pwrite), int(errwrite)] + + handle_list[:] = self._filter_handle_list(handle_list) + + if handle_list: + if not close_fds: + import warnings + warnings.warn("startupinfo.lpAttributeList['handle_list'] " + "overriding close_fds", RuntimeWarning) + + # When using the handle_list we always request to inherit + # handles but the only handles that will be inherited are + # the ones in the handle_list + close_fds = False + + if shell: + startupinfo.dwFlags |= STARTF_USESHOWWINDOW + startupinfo.wShowWindow = SW_HIDE + comspec = os.environ.get("COMSPEC", "cmd.exe") + args = '{} /c "{}"'.format(comspec, args) + if GetVersion() >= 0x80000000 or os.path.basename(comspec).lower() == "command.com": + # Win9x, or using command.com on NT. We need to + # use the w9xpopen intermediate program. For more + # information, see KB Q150956 + # (http://web.archive.org/web/20011105084002/http://support.microsoft.com/support/kb/articles/Q150/9/56.asp) + w9xpopen = self._find_w9xpopen() + args = '"%s" %s' % (w9xpopen, args) + # Not passing CREATE_NEW_CONSOLE has been known to + # cause random failures on win9x. Specifically a + # dialog: "Your program accessed mem currently in + # use at xxx" and a hopeful warning about the + # stability of your system. Cost is Ctrl+C wont + # kill children. + creationflags |= CREATE_NEW_CONSOLE + + # Start the process + try: + hp, ht, pid, tid = CreateProcess(executable, args, + # no special security + None, None, + int(not close_fds), + creationflags, + env, + cwd, + startupinfo) + except IOError as e: # From 2.6 on, pywintypes.error was defined as IOError + # Translate pywintypes.error to WindowsError, which is + # a subclass of OSError. FIXME: We should really + # translate errno using _sys_errlist (or similar), but + # how can this be done from Python? + if PY3: + raise # don't remap here + raise WindowsError(*e.args) + finally: + # Child is launched. Close the parent's copy of those pipe + # handles that only the child should have open. You need + # to make sure that no handles to the write end of the + # output pipe are maintained in this process or else the + # pipe will not close when the child process exits and the + # ReadFile will hang. + def _close(x): + if x is not None and x != -1: + if hasattr(x, 'Close'): + x.Close() + else: + _winapi.CloseHandle(x) + + _close(p2cread) + _close(c2pwrite) + _close(errwrite) + if hasattr(self, '_devnull'): + os.close(self._devnull) + + # Retain the process handle, but close the thread handle + self._child_created = True + self._handle = Handle(hp) if not hasattr(hp, 'Close') else hp + self.pid = pid + _winapi.CloseHandle(ht) if not hasattr(ht, 'Close') else ht.Close() + + def _internal_poll(self): + """Check if child process has terminated. Returns returncode + attribute. + """ + # pylint:disable=undefined-variable + if self.returncode is None: + if WaitForSingleObject(self._handle, 0) == WAIT_OBJECT_0: + self.returncode = GetExitCodeProcess(self._handle) + self.result.set(self.returncode) + return self.returncode + + def rawlink(self, callback): + if not self.result.ready() and not self._waiting: + self._waiting = True + Greenlet.spawn(self._wait) + self.result.rawlink(linkproxy(callback, self)) + # XXX unlink + + def _blocking_wait(self): + # pylint:disable=undefined-variable + WaitForSingleObject(self._handle, INFINITE) + self.returncode = GetExitCodeProcess(self._handle) + return self.returncode + + def _wait(self): + self.threadpool.spawn(self._blocking_wait).rawlink(self.result) + + def wait(self, timeout=None, _raise_exc=PY3): + """Wait for child process to terminate. Returns returncode + attribute.""" + if self.returncode is None: + if not self._waiting: + self._waiting = True + self._wait() + return self._gevent_result_wait(timeout, _raise_exc) + + def send_signal(self, sig): + """Send a signal to the process + """ + if sig == signal.SIGTERM: + self.terminate() + elif sig == signal.CTRL_C_EVENT: + os.kill(self.pid, signal.CTRL_C_EVENT) + elif sig == signal.CTRL_BREAK_EVENT: + os.kill(self.pid, signal.CTRL_BREAK_EVENT) + else: + raise ValueError("Unsupported signal: {}".format(sig)) + + def terminate(self): + """Terminates the process + """ + # pylint:disable=undefined-variable + # Don't terminate a process that we know has already died. + if self.returncode is not None: + return + try: + TerminateProcess(self._handle, 1) + except OSError as e: + # ERROR_ACCESS_DENIED (winerror 5) is received when the + # process already died. + if e.winerror != 5: + raise + rc = GetExitCodeProcess(self._handle) + if rc == STILL_ACTIVE: + raise + self.returncode = rc + self.result.set(self.returncode) + + kill = terminate + + else: + # + # POSIX methods + # + + def rawlink(self, callback): + # Not public documented, part of the link protocol + self.result.rawlink(linkproxy(callback, self)) + # XXX unlink + + def _get_handles(self, stdin, stdout, stderr): + """Construct and return tuple with IO objects: + p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite + """ + p2cread, p2cwrite = -1, -1 + c2pread, c2pwrite = -1, -1 + errread, errwrite = -1, -1 + + try: + DEVNULL + except NameError: + _devnull = object() + else: + _devnull = DEVNULL + + if stdin is None: + pass + elif stdin == PIPE: + p2cread, p2cwrite = self.pipe_cloexec() + elif stdin == _devnull: + p2cread = self._get_devnull() + elif isinstance(stdin, int): + p2cread = stdin + else: + # Assuming file-like object + p2cread = stdin.fileno() + + if stdout is None: + pass + elif stdout == PIPE: + c2pread, c2pwrite = self.pipe_cloexec() + elif stdout == _devnull: + c2pwrite = self._get_devnull() + elif isinstance(stdout, int): + c2pwrite = stdout + else: + # Assuming file-like object + c2pwrite = stdout.fileno() + + if stderr is None: + pass + elif stderr == PIPE: + errread, errwrite = self.pipe_cloexec() + elif stderr == STDOUT: # pylint:disable=undefined-variable + if c2pwrite != -1: + errwrite = c2pwrite + else: # child's stdout is not set, use parent's stdout + errwrite = sys.__stdout__.fileno() + elif stderr == _devnull: + errwrite = self._get_devnull() + elif isinstance(stderr, int): + errwrite = stderr + else: + # Assuming file-like object + errwrite = stderr.fileno() + + return (p2cread, p2cwrite, + c2pread, c2pwrite, + errread, errwrite) + + def _set_cloexec_flag(self, fd, cloexec=True): + try: + cloexec_flag = fcntl.FD_CLOEXEC + except AttributeError: + cloexec_flag = 1 + + old = fcntl.fcntl(fd, fcntl.F_GETFD) + if cloexec: + fcntl.fcntl(fd, fcntl.F_SETFD, old | cloexec_flag) + else: + fcntl.fcntl(fd, fcntl.F_SETFD, old & ~cloexec_flag) + + def _remove_nonblock_flag(self, fd): + flags = fcntl.fcntl(fd, fcntl.F_GETFL) & (~os.O_NONBLOCK) + fcntl.fcntl(fd, fcntl.F_SETFL, flags) + + def pipe_cloexec(self): + """Create a pipe with FDs set CLOEXEC.""" + # Pipes' FDs are set CLOEXEC by default because we don't want them + # to be inherited by other subprocesses: the CLOEXEC flag is removed + # from the child's FDs by _dup2(), between fork() and exec(). + # This is not atomic: we would need the pipe2() syscall for that. + r, w = os.pipe() + self._set_cloexec_flag(r) + self._set_cloexec_flag(w) + return r, w + + _POSSIBLE_FD_DIRS = ( + '/proc/self/fd', # Linux + '/dev/fd', # BSD, including macOS + ) + + @classmethod + def _close_fds(cls, keep, errpipe_write): + # From the C code: + # errpipe_write is part of keep. It must be closed at + # exec(), but kept open in the child process until exec() is + # called. + for path in cls._POSSIBLE_FD_DIRS: + if os.path.isdir(path): + return cls._close_fds_from_path(path, keep, errpipe_write) + return cls._close_fds_brute_force(keep, errpipe_write) + + @classmethod + def _close_fds_from_path(cls, path, keep, errpipe_write): + # path names a directory whose only entries have + # names that are ascii strings of integers in base10, + # corresponding to the fds the current process has open + try: + fds = [int(fname) for fname in os.listdir(path)] + except (ValueError, OSError): + cls._close_fds_brute_force(keep, errpipe_write) + else: + for i in keep: + if i == errpipe_write: + continue + _set_inheritable(i, True) + + for fd in fds: + if fd in keep or fd < 3: + continue + try: + os.close(fd) + except: + pass + + @classmethod + def _close_fds_brute_force(cls, keep, errpipe_write): + # `keep` is a set of fds, so we + # use os.closerange from 3 to min(keep) + # and then from max(keep + 1) to MAXFD and + # loop through filling in the gaps. + + # Under new python versions, we need to explicitly set + # passed fds to be inheritable or they will go away on exec + + # XXX: Bug: We implicitly rely on errpipe_write being the largest open + # FD so that we don't change its cloexec flag. + + assert hasattr(os, 'closerange') # Added in 2.7 + keep = sorted(keep) + min_keep = min(keep) + max_keep = max(keep) + os.closerange(3, min_keep) + os.closerange(max_keep + 1, MAXFD) + + for i in xrange(min_keep, max_keep): + if i in keep: + _set_inheritable(i, True) + continue + + try: + os.close(i) + except: + pass + + def _execute_child(self, args, executable, preexec_fn, close_fds, + pass_fds, cwd, env, universal_newlines, + startupinfo, creationflags, shell, + p2cread, p2cwrite, + c2pread, c2pwrite, + errread, errwrite, + restore_signals, start_new_session): + """Execute program (POSIX version)""" + + if PY3 and isinstance(args, (str, bytes)): + args = [args] + elif not PY3 and isinstance(args, string_types): + args = [args] + else: + try: + args = list(args) + except TypeError: # os.PathLike instead of a sequence? + args = [fsencode(args)] # os.PathLike -> [str] + + if shell: + args = ["/bin/sh", "-c"] + args + if executable: + args[0] = executable + + if executable is None: + executable = args[0] + + self._loop.install_sigchld() + + # For transferring possible exec failure from child to parent + # The first char specifies the exception type: 0 means + # OSError, 1 means some other error. + errpipe_read, errpipe_write = self.pipe_cloexec() + # errpipe_write must not be in the standard io 0, 1, or 2 fd range. + low_fds_to_close = [] + while errpipe_write < 3: + low_fds_to_close.append(errpipe_write) + errpipe_write = os.dup(errpipe_write) + for low_fd in low_fds_to_close: + os.close(low_fd) + try: + try: + gc_was_enabled = gc.isenabled() + # Disable gc to avoid bug where gc -> file_dealloc -> + # write to stderr -> hang. http://bugs.python.org/issue1336 + gc.disable() + try: + self.pid = fork_and_watch(self._on_child, self._loop, True, fork) + except: + if gc_was_enabled: + gc.enable() + raise + if self.pid == 0: + # Child + + # XXX: Technically we're doing a lot of stuff here that + # may not be safe to do before a exec(), depending on the OS. + # CPython 3 goes to great lengths to precompute a lot + # of this info before the fork and pass it all to C functions that + # try hard not to call things like malloc(). (Of course, + # CPython 2 pretty much did what we're doing.) + try: + # Close parent's pipe ends + if p2cwrite != -1: + os.close(p2cwrite) + if c2pread != -1: + os.close(c2pread) + if errread != -1: + os.close(errread) + os.close(errpipe_read) + + # When duping fds, if there arises a situation + # where one of the fds is either 0, 1 or 2, it + # is possible that it is overwritten (#12607). + if c2pwrite == 0: + c2pwrite = os.dup(c2pwrite) + while errwrite in (0, 1): + errwrite = os.dup(errwrite) + + # Dup fds for child + def _dup2(existing, desired): + # dup2() removes the CLOEXEC flag but + # we must do it ourselves if dup2() + # would be a no-op (issue #10806). + if existing == desired: + self._set_cloexec_flag(existing, False) + elif existing != -1: + os.dup2(existing, desired) + try: + self._remove_nonblock_flag(desired) + except OSError: + # Ignore EBADF, it may not actually be + # open yet. + # Tested beginning in 3.7.0b3 test_subprocess.py + pass + _dup2(p2cread, 0) + _dup2(c2pwrite, 1) + _dup2(errwrite, 2) + + # Close pipe fds. Make sure we don't close the + # same fd more than once, or standard fds. + closed = set([None]) + for fd in [p2cread, c2pwrite, errwrite]: + if fd not in closed and fd > 2: + os.close(fd) + closed.add(fd) + + if cwd is not None: + try: + os.chdir(cwd) + except OSError as e: + e._failed_chdir = True + raise + + if preexec_fn: + preexec_fn() + + # Close all other fds, if asked for. This must be done + # after preexec_fn runs. + if close_fds: + fds_to_keep = set(pass_fds) + fds_to_keep.add(errpipe_write) + self._close_fds(fds_to_keep, errpipe_write) + + if restore_signals: + # restore the documented signals back to sig_dfl; + # not all will be defined on every platform + for sig in 'SIGPIPE', 'SIGXFZ', 'SIGXFSZ': + sig = getattr(signal, sig, None) + if sig is not None: + signal.signal(sig, signal.SIG_DFL) + + if start_new_session: + os.setsid() + + if env is None: + os.execvp(executable, args) + else: + if PY3: + # Python 3.6 started testing for + # bytes values in the env; it also + # started encoding strs using + # fsencode and using a lower-level + # API that takes a list of keys + # and values. We don't have access + # to that API, so we go the reverse direction. + env = {os.fsdecode(k) if isinstance(k, bytes) else k: + os.fsdecode(v) if isinstance(v, bytes) else v + for k, v in env.items()} + os.execvpe(executable, args, env) + + except: + exc_type, exc_value, tb = sys.exc_info() + # Save the traceback and attach it to the exception object + exc_lines = traceback.format_exception(exc_type, + exc_value, + tb) + exc_value.child_traceback = ''.join(exc_lines) + os.write(errpipe_write, pickle.dumps(exc_value)) + + finally: + # Make sure that the process exits no matter what. + # The return code does not matter much as it won't be + # reported to the application + os._exit(1) + + # Parent + self._child_created = True + if gc_was_enabled: + gc.enable() + finally: + # be sure the FD is closed no matter what + os.close(errpipe_write) + + # self._devnull is not always defined. + devnull_fd = getattr(self, '_devnull', None) + if p2cread != -1 and p2cwrite != -1 and p2cread != devnull_fd: + os.close(p2cread) + if c2pwrite != -1 and c2pread != -1 and c2pwrite != devnull_fd: + os.close(c2pwrite) + if errwrite != -1 and errread != -1 and errwrite != devnull_fd: + os.close(errwrite) + if devnull_fd is not None: + os.close(devnull_fd) + # Prevent a double close of these fds from __init__ on error. + self._closed_child_pipe_fds = True + + # Wait for exec to fail or succeed; possibly raising exception + errpipe_read = FileObject(errpipe_read, 'rb') + data = errpipe_read.read() + finally: + if hasattr(errpipe_read, 'close'): + errpipe_read.close() + else: + os.close(errpipe_read) + + if data != b"": + self.wait() + child_exception = pickle.loads(data) + for fd in (p2cwrite, c2pread, errread): + if fd is not None and fd != -1: + os.close(fd) + if isinstance(child_exception, OSError): + child_exception.filename = executable + if hasattr(child_exception, '_failed_chdir'): + child_exception.filename = cwd + raise child_exception + + def _handle_exitstatus(self, sts): + if os.WIFSIGNALED(sts): + self.returncode = -os.WTERMSIG(sts) + elif os.WIFEXITED(sts): + self.returncode = os.WEXITSTATUS(sts) + else: + # Should never happen + raise RuntimeError("Unknown child exit status!") + + def _internal_poll(self): + """Check if child process has terminated. Returns returncode + attribute. + """ + if self.returncode is None: + if get_hub() is not getcurrent(): + sig_pending = getattr(self._loop, 'sig_pending', True) + if sig_pending: + sleep(0.00001) + return self.returncode + + def wait(self, timeout=None, _raise_exc=PY3): + """ + Wait for child process to terminate. Returns :attr:`returncode` + attribute. + + :keyword timeout: The floating point number of seconds to + wait. Under Python 2, this is a gevent extension, and + we simply return if it expires. Under Python 3, if + this time elapses without finishing the process, + :exc:`TimeoutExpired` is raised. + """ + return self._gevent_result_wait(timeout, _raise_exc) + + def send_signal(self, sig): + """Send a signal to the process + """ + # Skip signalling a process that we know has already died. + if self.returncode is None: + os.kill(self.pid, sig) + + def terminate(self): + """Terminate the process with SIGTERM + """ + self.send_signal(signal.SIGTERM) + + def kill(self): + """Kill the process with SIGKILL + """ + self.send_signal(signal.SIGKILL) + + +def write_and_close(fobj, data): + try: + if data: + fobj.write(data) + if hasattr(fobj, 'flush'): + # 3.6 started expecting flush to be called. + fobj.flush() + except (OSError, IOError) as ex: + if ex.errno != errno.EPIPE and ex.errno != errno.EINVAL: + raise + finally: + try: + fobj.close() + except EnvironmentError: + pass + +def _with_stdout_stderr(exc, stderr): + # Prior to Python 3.5, most exceptions didn't have stdout + # and stderr attributes and can't take the stderr attribute in their + # constructor + exc.stdout = exc.output + exc.stderr = stderr + return exc + +class CompletedProcess(object): + """ + A process that has finished running. + + This is returned by run(). + + Attributes: + - args: The list or str args passed to run(). + - returncode: The exit code of the process, negative for signals. + - stdout: The standard output (None if not captured). + - stderr: The standard error (None if not captured). + + .. versionadded:: 1.2a1 + This first appeared in Python 3.5 and is available to all + Python versions in gevent. + """ + def __init__(self, args, returncode, stdout=None, stderr=None): + self.args = args + self.returncode = returncode + self.stdout = stdout + self.stderr = stderr + + def __repr__(self): + args = ['args={!r}'.format(self.args), + 'returncode={!r}'.format(self.returncode)] + if self.stdout is not None: + args.append('stdout={!r}'.format(self.stdout)) + if self.stderr is not None: + args.append('stderr={!r}'.format(self.stderr)) + return "{}({})".format(type(self).__name__, ', '.join(args)) + + def check_returncode(self): + """Raise CalledProcessError if the exit code is non-zero.""" + if self.returncode: + # pylint:disable=undefined-variable + raise _with_stdout_stderr(CalledProcessError(self.returncode, self.args, self.stdout), self.stderr) + + +def run(*popenargs, **kwargs): + """ + run(args, *, stdin=None, input=None, stdout=None, stderr=None, shell=False, timeout=None, check=False) -> CompletedProcess + + Run command with arguments and return a CompletedProcess instance. + + The returned instance will have attributes args, returncode, stdout and + stderr. By default, stdout and stderr are not captured, and those attributes + will be None. Pass stdout=PIPE and/or stderr=PIPE in order to capture them. + If check is True and the exit code was non-zero, it raises a + CalledProcessError. The CalledProcessError object will have the return code + in the returncode attribute, and output & stderr attributes if those streams + were captured. + + If timeout is given, and the process takes too long, a TimeoutExpired + exception will be raised. + + There is an optional argument "input", allowing you to + pass a string to the subprocess's stdin. If you use this argument + you may not also use the Popen constructor's "stdin" argument, as + it will be used internally. + The other arguments are the same as for the Popen constructor. + If universal_newlines=True is passed, the "input" argument must be a + string and stdout/stderr in the returned object will be strings rather than + bytes. + + .. versionadded:: 1.2a1 + This function first appeared in Python 3.5. It is available on all Python + versions gevent supports. + + .. versionchanged:: 1.3a2 + Add the ``capture_output`` argument from Python 3.7. It automatically sets + ``stdout`` and ``stderr`` to ``PIPE``. It is an error to pass either + of those arguments along with ``capture_output``. + """ + input = kwargs.pop('input', None) + timeout = kwargs.pop('timeout', None) + check = kwargs.pop('check', False) + capture_output = kwargs.pop('capture_output', False) + + if input is not None: + if 'stdin' in kwargs: + raise ValueError('stdin and input arguments may not both be used.') + kwargs['stdin'] = PIPE + + if capture_output: + if ('stdout' in kwargs) or ('stderr' in kwargs): + raise ValueError('stdout and stderr arguments may not be used ' + 'with capture_output.') + kwargs['stdout'] = PIPE + kwargs['stderr'] = PIPE + + with Popen(*popenargs, **kwargs) as process: + try: + stdout, stderr = process.communicate(input, timeout=timeout) + except TimeoutExpired: + process.kill() + stdout, stderr = process.communicate() + raise _with_stdout_stderr(TimeoutExpired(process.args, timeout, output=stdout), stderr) + except: + process.kill() + process.wait() + raise + retcode = process.poll() + if check and retcode: + # pylint:disable=undefined-variable + raise _with_stdout_stderr(CalledProcessError(retcode, process.args, stdout), stderr) + + return CompletedProcess(process.args, retcode, stdout, stderr) diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/testing/__init__.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/testing/__init__.py new file mode 100644 index 00000000..462d6f8d --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/testing/__init__.py @@ -0,0 +1,137 @@ +# Copyright (c) 2008-2009 AG Projects +# Copyright 2018 gevent community +# Author: Denis Bilenko +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. + + +import unittest + +# pylint:disable=unused-import + +from .sysinfo import VERBOSE +from .sysinfo import WIN +from .sysinfo import LINUX +from .sysinfo import LIBUV +from .sysinfo import CFFI_BACKEND +from .sysinfo import DEBUG +from .sysinfo import RUN_LEAKCHECKS +from .sysinfo import RUN_COVERAGE + +from .sysinfo import PY2 +from .sysinfo import PY3 +from .sysinfo import PY34 +from .sysinfo import PY36 +from .sysinfo import PY37 + +from .sysinfo import PYPY +from .sysinfo import PYPY3 +from .sysinfo import CPYTHON + +from .sysinfo import PLATFORM_SPECIFIC_SUFFIXES +from .sysinfo import NON_APPLICABLE_SUFFIXES +from .sysinfo import SHARED_OBJECT_EXTENSION + +from .sysinfo import RUNNING_ON_TRAVIS +from .sysinfo import RUNNING_ON_APPVEYOR +from .sysinfo import RUNNING_ON_CI + +from .sysinfo import RESOLVER_NOT_SYSTEM +from .sysinfo import RESOLVER_DNSPYTHON +from .sysinfo import RESOLVER_ARES + +from .sysinfo import EXPECT_POOR_TIMER_RESOLUTION + +from .sysinfo import CONN_ABORTED_ERRORS + +from .skipping import skipOnWindows +from .skipping import skipOnAppVeyor +from .skipping import skipOnCI +from .skipping import skipOnPyPy3OnCI +from .skipping import skipOnPyPy +from .skipping import skipOnPyPyOnCI +from .skipping import skipOnPyPy3 +from .skipping import skipIf +from .skipping import skipUnless +from .skipping import skipOnLibev +from .skipping import skipOnLibuv +from .skipping import skipOnLibuvOnWin +from .skipping import skipOnLibuvOnCI +from .skipping import skipOnLibuvOnCIOnPyPy +from .skipping import skipOnLibuvOnPyPyOnWin +from .skipping import skipOnPurePython +from .skipping import skipWithCExtensions +from .skipping import skipOnLibuvOnTravisOnCPython27 +from .skipping import skipOnPy37 + +from .exception import ExpectedException + + +from .leakcheck import ignores_leakcheck + + + +from .params import LARGE_TIMEOUT + +from .params import DEFAULT_LOCAL_HOST_ADDR +from .params import DEFAULT_LOCAL_HOST_ADDR6 +from .params import DEFAULT_BIND_ADDR + + +from .params import DEFAULT_SOCKET_TIMEOUT +from .params import DEFAULT_XPC_SOCKET_TIMEOUT + +main = unittest.main + +from .hub import QuietHub + +import gevent.hub +gevent.hub.set_default_hub_class(QuietHub) + + + +from .sockets import bind_and_listen +from .sockets import tcp_listener + +from .openfiles import get_number_open_files +from .openfiles import get_open_files + +from .testcase import TestCase + +from .modules import walk_modules + +BaseTestCase = unittest.TestCase + +from .flaky import reraiseFlakyTestTimeout +from .flaky import reraiseFlakyTestRaceCondition +from .flaky import reraises_flaky_timeout +from .flaky import reraises_flaky_race_condition + +def gc_collect_if_needed(): + "Collect garbage if necessary for destructors to run" + import gc + if PYPY: # pragma: no cover + gc.collect() + +try: + from unittest import mock +except ImportError: # Python 2 + import mock + +mock = mock diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/testing/coveragesite/sitecustomize.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/testing/coveragesite/sitecustomize.py new file mode 100644 index 00000000..097dcec1 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/testing/coveragesite/sitecustomize.py @@ -0,0 +1,17 @@ +# When testrunner.py is invoked with --coverage, it puts this first +# on the path as per https://coverage.readthedocs.io/en/coverage-4.0b3/subprocess.html. +# Note that this disables other sitecustomize.py files. +import coverage +try: + coverage.process_startup() +except coverage.CoverageException as e: + if str(e) == "Can't support concurrency=greenlet with PyTracer, only threads are supported": + pass + else: + import traceback + traceback.print_exc() + raise +except: + import traceback + traceback.print_exc() + raise diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/testing/errorhandler.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/testing/errorhandler.py new file mode 100644 index 00000000..77302dc5 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/testing/errorhandler.py @@ -0,0 +1,53 @@ +# Copyright (c) 2018 gevent community +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. + +from functools import wraps + + +def wrap_error_fatal(method): + import gevent + system_error = gevent.get_hub().SYSTEM_ERROR + + @wraps(method) + def wrapper(self, *args, **kwargs): + # XXX should also be able to do gevent.SYSTEM_ERROR = object + # which is a global default to all hubs + + gevent.get_hub().SYSTEM_ERROR = object + try: + return method(self, *args, **kwargs) + finally: + gevent.get_hub().SYSTEM_ERROR = system_error + return wrapper + + +def wrap_restore_handle_error(method): + import gevent + old = gevent.get_hub().handle_error + + @wraps(method) + def wrapper(self, *args, **kwargs): + try: + return method(self, *args, **kwargs) + finally: + gevent.get_hub().handle_error = old + if self.peek_error()[0] is not None: + gevent.getcurrent().throw(*self.peek_error()[1:]) + return wrapper diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/testing/exception.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/testing/exception.py new file mode 100644 index 00000000..baa9f96a --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/testing/exception.py @@ -0,0 +1,23 @@ +# Copyright (c) 2018 gevent community +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. +from __future__ import absolute_import, print_function, division + +class ExpectedException(Exception): + """An exception whose traceback should be ignored by the hub""" diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/testing/flaky.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/testing/flaky.py new file mode 100644 index 00000000..98f9fe8c --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/testing/flaky.py @@ -0,0 +1,114 @@ +# Copyright (c) 2018 gevent community +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. +from __future__ import absolute_import, print_function, division + +import sys +import functools +import unittest + +from . import sysinfo +from . import six + +class FlakyAssertionError(AssertionError): + "Re-raised so that we know it's a known-flaky test." + +# The next exceptions allow us to raise them in a highly +# greppable way so that we can debug them later. + +class FlakyTest(unittest.SkipTest): + """ + A unittest exception that causes the test to be skipped when raised. + + Use this carefully, it is a code smell and indicates an undebugged problem. + """ + +class FlakyTestRaceCondition(FlakyTest): + """ + Use this when the flaky test is definitely caused by a race condition. + """ + +class FlakyTestTimeout(FlakyTest): + """ + Use this when the flaky test is definitely caused by an + unexpected timeout. + """ + +class FlakyTestCrashes(FlakyTest): + """ + Use this when the test sometimes crashes. + """ + +def reraiseFlakyTestRaceCondition(): + six.reraise(FlakyAssertionError, + FlakyAssertionError(sys.exc_info()[1]), + sys.exc_info()[2]) + +reraiseFlakyTestTimeout = reraiseFlakyTestRaceCondition +reraiseFlakyTestRaceConditionLibuv = reraiseFlakyTestRaceCondition +reraiseFlakyTestTimeoutLibuv = reraiseFlakyTestRaceCondition + +if sysinfo.RUNNING_ON_CI or (sysinfo.PYPY and sysinfo.WIN): + # pylint: disable=function-redefined + def reraiseFlakyTestRaceCondition(): + # Getting stack traces is incredibly expensive + # in pypy on win, at least in test virtual machines. + # It can take minutes. The traceback consistently looks like + # the following when interrupted: + + # dump_stacks -> traceback.format_stack + # -> traceback.extract_stack -> linecache.checkcache + # -> os.stat -> _structseq.structseq_new + + # Moreover, without overriding __repr__ or __str__, + # the msg doesn't get printed like we would want (its basically + # unreadable, all printed on one line). So skip that. + + #msg = '\n'.join(dump_stacks()) + msg = str(sys.exc_info()[1]) + six.reraise(FlakyTestRaceCondition, + FlakyTestRaceCondition(msg), + sys.exc_info()[2]) + + def reraiseFlakyTestTimeout(): + msg = str(sys.exc_info()[1]) + six.reraise(FlakyTestTimeout, + FlakyTestTimeout(msg), + sys.exc_info()[2]) + + if sysinfo.LIBUV: + reraiseFlakyTestRaceConditionLibuv = reraiseFlakyTestRaceCondition + reraiseFlakyTestTimeoutLibuv = reraiseFlakyTestTimeout + + +def reraises_flaky_timeout(exc_kind=AssertionError, _func=reraiseFlakyTestTimeout): + + def wrapper(f): + @functools.wraps(f) + def m(*args): + try: + f(*args) + except exc_kind: + _func() + return m + + return wrapper + +def reraises_flaky_race_condition(exc_kind=AssertionError): + return reraises_flaky_timeout(exc_kind, _func=reraiseFlakyTestRaceCondition) diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/testing/hub.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/testing/hub.py new file mode 100644 index 00000000..645c1d0d --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/testing/hub.py @@ -0,0 +1,35 @@ +# Copyright (c) 2018 gevent community +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. +from __future__ import absolute_import, print_function, division + + +from gevent.hub import Hub + +from .exception import ExpectedException + +class QuietHub(Hub): + + EXPECTED_TEST_ERROR = (ExpectedException,) + + def handle_error(self, context, type, value, tb): + if issubclass(type, self.EXPECTED_TEST_ERROR): + # Don't print these to cut down on the noise in the test logs + return + return Hub.handle_error(self, context, type, value, tb) diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/testing/leakcheck.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/testing/leakcheck.py new file mode 100644 index 00000000..5e5b7f0b --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/testing/leakcheck.py @@ -0,0 +1,206 @@ +# Copyright (c) 2018 gevent community +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. +from __future__ import print_function + +import sys +import gc +import types +from functools import wraps +import unittest + +import objgraph + +import gevent +import gevent.core + + +def ignores_leakcheck(func): + """ + Ignore the given object during leakchecks. + + Can be applied to a method, in which case the method will run, but + will not be subject to leak checks. + + If applied to a class, the entire class will be skipped during leakchecks. This + is intended to be used for classes that are very slow and cause problems such as + test timeouts; typically it will be used for classes that are subclasses of a base + class and specify variants of behaviour (such as pool sizes). + """ + func.ignore_leakcheck = True + return func + +class _RefCountChecker(object): + + # Some builtin things that we ignore + IGNORED_TYPES = (tuple, dict, types.FrameType, types.TracebackType) + try: + CALLBACK_KIND = gevent.core.callback + except AttributeError: + # Must be using FFI. + from gevent._ffi.callback import callback as CALLBACK_KIND + + + def __init__(self, testcase, function): + self.testcase = testcase + self.function = function + self.deltas = [] + self.peak_stats = {} + + # The very first time we are called, we have already been + # self.setUp() by the test runner, so we don't need to do it again. + self.needs_setUp = False + + def _ignore_object_p(self, obj): + if ( + obj is self + or obj in self.__dict__.values() + or obj == self._ignore_object_p # pylint:disable=comparison-with-callable + ): + return False + kind = type(obj) + if kind in self.IGNORED_TYPES: + return False + if kind is self.CALLBACK_KIND and obj.callback is None and obj.args is None: + # these represent callbacks that have been stopped, but + # the event loop hasn't cycled around to run them. The only + # known cause of this is killing greenlets before they get a chance + # to run for the first time. + return False + return True + + + def _growth(self): + return objgraph.growth(limit=None, peak_stats=self.peak_stats, filter=self._ignore_object_p) + + def _report_diff(self, growth): + if not growth: + return "" + + lines = [] + width = max(len(name) for name, _, _ in growth) + for name, count, delta in growth: + lines.append('%-*s%9d %+9d' % (width, name, count, delta)) + + diff = '\n'.join(lines) + return diff + + + def _run_test(self, args, kwargs): + gc_enabled = gc.isenabled() + gc.disable() + + if self.needs_setUp: + self.testcase.setUp() + self.testcase.skipTearDown = False + try: + self.function(self.testcase, *args, **kwargs) + finally: + self.testcase.tearDown() + self.testcase.skipTearDown = True + self.needs_setUp = True + if gc_enabled: + gc.enable() + + def _growth_after(self): + # Grab post snapshot + if 'urlparse' in sys.modules: + sys.modules['urlparse'].clear_cache() + if 'urllib.parse' in sys.modules: + sys.modules['urllib.parse'].clear_cache() + + return self._growth() + + def _check_deltas(self, growth): + # Return false when we have decided there is no leak, + # true if we should keep looping, raises an assertion + # if we have decided there is a leak. + + deltas = self.deltas + if not deltas: + # We haven't run yet, no data, keep looping + return True + + if gc.garbage: + raise AssertionError("Generated uncollectable garbage %r" % (gc.garbage,)) + + + # the following configurations are classified as "no leak" + # [0, 0] + # [x, 0, 0] + # [... a, b, c, d] where a+b+c+d = 0 + # + # the following configurations are classified as "leak" + # [... z, z, z] where z > 0 + + if deltas[-2:] == [0, 0] and len(deltas) in (2, 3): + return False + + if deltas[-3:] == [0, 0, 0]: + return False + + if len(deltas) >= 4 and sum(deltas[-4:]) == 0: + return False + + if len(deltas) >= 3 and deltas[-1] > 0 and deltas[-1] == deltas[-2] and deltas[-2] == deltas[-3]: + diff = self._report_diff(growth) + raise AssertionError('refcount increased by %r\n%s' % (deltas, diff)) + + # OK, we don't know for sure yet. Let's search for more + if sum(deltas[-3:]) <= 0 or sum(deltas[-4:]) <= 0 or deltas[-4:].count(0) >= 2: + # this is suspicious, so give a few more runs + limit = 11 + else: + limit = 7 + if len(deltas) >= limit: + raise AssertionError('refcount increased by %r\n%s' + % (deltas, + self._report_diff(growth))) + + # We couldn't decide yet, keep going + return True + + def __call__(self, args, kwargs): + for _ in range(3): + gc.collect() + + # Capture state before; the incremental will be + # updated by each call to _growth_after + growth = self._growth() + + while self._check_deltas(growth): + self._run_test(args, kwargs) + + growth = self._growth_after() + + self.deltas.append(sum((stat[2] for stat in growth))) + + +def wrap_refcount(method): + if getattr(method, 'ignore_leakcheck', False): + return method + + + @wraps(method) + def wrapper(self, *args, **kwargs): # pylint:disable=too-many-branches + if getattr(self, 'ignore_leakcheck', False): + raise unittest.SkipTest("This class ignored during leakchecks") + return _RefCountChecker(self, method)(args, kwargs) + + return wrapper diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/testing/modules.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/testing/modules.py new file mode 100644 index 00000000..2fb04d59 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/testing/modules.py @@ -0,0 +1,85 @@ +# Copyright (c) 2018 gevent community +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. +from __future__ import absolute_import, print_function, division + +import importlib +import os.path +import warnings + +import gevent + +from . import sysinfo + + +OPTIONAL_MODULES = [ + 'gevent.resolver_ares', + 'gevent.resolver.ares', + 'gevent.libev', + 'gevent.libev.watcher', +] + + +def walk_modules(basedir=None, modpath=None, include_so=False, recursive=False): + # pylint:disable=too-many-branches + if sysinfo.PYPY: + include_so = False + if basedir is None: + basedir = os.path.dirname(gevent.__file__) + if modpath is None: + modpath = 'gevent.' + else: + if modpath is None: + modpath = '' + for fn in sorted(os.listdir(basedir)): + path = os.path.join(basedir, fn) + if os.path.isdir(path): + if not recursive: + continue + if fn in ['testing', 'tests']: + continue + pkg_init = os.path.join(path, '__init__.py') + if os.path.exists(pkg_init): + yield pkg_init, modpath + fn + for p, m in walk_modules(path, modpath + fn + "."): + yield p, m + continue + if fn.endswith('.py'): + x = fn[:-3] + if x.endswith('_d'): + x = x[:-2] + if x in ['__init__', 'core', 'ares', '_util', '_semaphore', + 'corecffi', '_corecffi', '_corecffi_build']: + continue + modname = modpath + x + if modname in OPTIONAL_MODULES: + try: + with warnings.catch_warnings(): + warnings.simplefilter('ignore', DeprecationWarning) + importlib.import_module(modname) + except ImportError: + continue + yield path, modname + elif include_so and fn.endswith(sysinfo.SHARED_OBJECT_EXTENSION): + if '.pypy-' in fn: + continue + if fn.endswith('_d.so'): + yield path, modpath + fn[:-5] + else: + yield path, modpath + fn[:-3] diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/testing/monkey_test.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/testing/monkey_test.py new file mode 100644 index 00000000..f8076731 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/testing/monkey_test.py @@ -0,0 +1,75 @@ +import sys +import os + + +kwargs = {} + +if sys.argv[1] == '--Event': + kwargs['Event'] = True + del sys.argv[1] +else: + kwargs['Event'] = False + +test_filename = sys.argv[1] +del sys.argv[1] + +print('Running with patch_all(%s): %s' % (','.join('%s=%r' % x for x in kwargs.items()), test_filename)) + +from gevent import monkey +monkey.patch_all(**kwargs) + +from .sysinfo import RUNNING_ON_APPVEYOR +from .sysinfo import PY37 +from .patched_tests_setup import disable_tests_in_source +try: + from test import support +except ImportError: + from test import test_support as support +support.is_resource_enabled = lambda *args: True +del support.use_resources +if RUNNING_ON_APPVEYOR and PY37: + # 3.7 added a stricter mode for thread cleanup. + # It appears to be unstable on Windows (at least appveyor) + # and test_socket.py constantly fails with an extra thread + # on some random test. We disable it entirely. + import contextlib + @contextlib.contextmanager + def wait_threads_exit(timeout=None): # pylint:disable=unused-argument + yield + support.wait_threads_exit = wait_threads_exit + + +__file__ = os.path.join(os.getcwd(), test_filename) + +test_name = os.path.splitext(test_filename)[0] + +# It's important that the `module_source` be a native +# string. Passing unicode to `compile` on Python 2 can +# do bad things: it conflicts with a 'coding:' directive, +# and it can cause some TypeError with string literals +if sys.version_info[0] >= 3: + module_file = open(test_filename, encoding='utf-8') +else: + module_file = open(test_filename) +with module_file: + module_source = module_file.read() +module_source = disable_tests_in_source(module_source, test_name) + +# We write the module source to a file so that tracebacks +# show correctly, since disabling the tests changes line +# numbers. However, note that __file__ must still point to the +# real location so that data files can be found. +# See https://github.com/gevent/gevent/issues/1306 +import tempfile +temp_handle, temp_path = tempfile.mkstemp(prefix=test_name, suffix='.py', text=True) +os.write(temp_handle, + module_source.encode('utf-8') if not isinstance(module_source, bytes) else module_source) +os.close(temp_handle) +try: + module_code = compile(module_source, + temp_path, + 'exec', + dont_inherit=True) + exec(module_code, globals()) +finally: + os.remove(temp_path) diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/testing/openfiles.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/testing/openfiles.py new file mode 100644 index 00000000..fe916e74 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/testing/openfiles.py @@ -0,0 +1,125 @@ +# Copyright (c) 2018 gevent community +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. +from __future__ import absolute_import, print_function, division + +import os +import unittest +import re + +from . import sysinfo + +# Linux/OS X/BSD platforms can implement this by calling out to lsof + + +if sysinfo.WIN: + def _run_lsof(): + raise unittest.SkipTest("lsof not expected on Windows") +else: + def _run_lsof(): + import tempfile + pid = os.getpid() + fd, tmpname = tempfile.mkstemp('get_open_files') + os.close(fd) + lsof_command = 'lsof -p %s > %s' % (pid, tmpname) + if os.system(lsof_command): + # XXX: This prints to the console an annoying message: 'lsof is not recognized' + raise unittest.SkipTest("lsof failed") + with open(tmpname) as fobj: + data = fobj.read().strip() + os.remove(tmpname) + return data + +def default_get_open_files(pipes=False): + data = _run_lsof() + results = {} + for line in data.split('\n'): + line = line.strip() + if not line or line.startswith("COMMAND"): + # Skip header and blank lines + continue + split = re.split(r'\s+', line) + _command, _pid, _user, fd = split[:4] + # Pipes (on OS X, at least) get an fd like "3" while normal files get an fd like "1u" + if fd[:-1].isdigit() or fd.isdigit(): + if not pipes and fd[-1].isdigit(): + continue + fd = int(fd[:-1]) if not fd[-1].isdigit() else int(fd) + if fd in results: + params = (fd, line, split, results.get(fd), data) + raise AssertionError('error when parsing lsof output: duplicate fd=%r\nline=%r\nsplit=%r\nprevious=%r\ndata:\n%s' % params) + results[fd] = line + if not results: + raise AssertionError('failed to parse lsof:\n%s' % (data, )) + results['data'] = data + return results + +def default_get_number_open_files(): + if os.path.exists('/proc/'): + # Linux only + fd_directory = '/proc/%d/fd' % os.getpid() + return len(os.listdir(fd_directory)) + + try: + return len(get_open_files(pipes=True)) - 1 + except (OSError, AssertionError, unittest.SkipTest): + return 0 + +lsof_get_open_files = default_get_open_files + +try: + # psutil import subprocess which on Python 3 imports selectors. + # This can expose issues with monkey-patching. + import psutil +except ImportError: + get_open_files = default_get_open_files + get_number_open_files = default_get_number_open_files +else: + # If psutil is available (it is cross-platform) use that. + # It is *much* faster than shelling out to lsof each time + # (Running 14 tests takes 3.964s with lsof and 0.046 with psutil) + # However, it still doesn't completely solve the issue on Windows: fds are reported + # as -1 there, so we can't fully check those. + + def get_open_files(): + """ + Return a list of popenfile and pconn objects. + + Note that other than `fd`, they have different attributes. + + .. important:: If you want to find open sockets, on Windows + and linux, it is important that the socket at least be listening + (socket.listen(1)). Unlike the lsof implementation, this will only + return sockets in a state like that. + """ + results = dict() + process = psutil.Process() + results['data'] = process.open_files() + process.connections('all') + for x in results['data']: + results[x.fd] = x + results['data'] += ['From psutil', process] + return results + + def get_number_open_files(): + process = psutil.Process() + try: + return process.num_fds() + except AttributeError: + # num_fds is unix only. Is num_handles close enough on Windows? + return 0 diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/testing/params.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/testing/params.py new file mode 100644 index 00000000..efa54165 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/testing/params.py @@ -0,0 +1,83 @@ +# Copyright (c) 2018 gevent community +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. + + +from .sysinfo import PY3 +from .sysinfo import PYPY +from .sysinfo import WIN +from .sysinfo import LIBUV +from .sysinfo import OSX + +from .sysinfo import RUNNING_ON_TRAVIS +from .sysinfo import RUNNING_ON_APPVEYOR +from .sysinfo import EXPECT_POOR_TIMER_RESOLUTION +from .sysinfo import RESOLVER_ARES + + +# Travis is slow and overloaded; Appveyor used to be faster, but +# as of Dec 2015 it's almost always slower and/or has much worse timer +# resolution +CI_TIMEOUT = 15 +if (PY3 and PYPY) or (PYPY and WIN and LIBUV): + # pypy3 is very slow right now, + # as is PyPy2 on windows (which only has libuv) + CI_TIMEOUT = 20 +if PYPY and LIBUV: + # slow and flaky timeouts + LOCAL_TIMEOUT = CI_TIMEOUT +else: + LOCAL_TIMEOUT = 1 + +LARGE_TIMEOUT = max(LOCAL_TIMEOUT, CI_TIMEOUT) + +DEFAULT_LOCAL_HOST_ADDR = 'localhost' +DEFAULT_LOCAL_HOST_ADDR6 = DEFAULT_LOCAL_HOST_ADDR +DEFAULT_BIND_ADDR = '' + +if RUNNING_ON_TRAVIS: + # As of November 2017 (probably Sept or Oct), after a + # Travis upgrade, using "localhost" no longer works, + # producing 'OSError: [Errno 99] Cannot assign + # requested address'. This is apparently something to do with + # docker containers. Sigh. + DEFAULT_LOCAL_HOST_ADDR = '127.0.0.1' + DEFAULT_LOCAL_HOST_ADDR6 = '::1' + # Likewise, binding to '' appears to work, but it cannot be + # connected to with the same error. + DEFAULT_BIND_ADDR = '127.0.0.1' + +if RUNNING_ON_APPVEYOR: + DEFAULT_BIND_ADDR = '127.0.0.1' + DEFAULT_LOCAL_HOST_ADDR = '127.0.0.1' + + +if RESOLVER_ARES and OSX: + # Ares likes to raise "malformed domain name" on '', at least + # on OS X + DEFAULT_BIND_ADDR = '127.0.0.1' + +DEFAULT_CONNECT = DEFAULT_LOCAL_HOST_ADDR +DEFAULT_BIND_ADDR_TUPLE = (DEFAULT_BIND_ADDR, 0) + +# For in-process sockets +DEFAULT_SOCKET_TIMEOUT = 0.1 if not EXPECT_POOR_TIMER_RESOLUTION else 2.0 + +# For cross-process sockets +DEFAULT_XPC_SOCKET_TIMEOUT = 2.0 if not EXPECT_POOR_TIMER_RESOLUTION else 4.0 diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/testing/patched_tests_setup.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/testing/patched_tests_setup.py new file mode 100644 index 00000000..39c881d8 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/testing/patched_tests_setup.py @@ -0,0 +1,1139 @@ +# pylint:disable=missing-docstring,invalid-name,too-many-lines +from __future__ import print_function, absolute_import, division + +import collections +import contextlib +import functools +import sys +import os +# At least on 3.6+, importing platform +# imports subprocess, which imports selectors. That +# can expose issues with monkey patching. We don't need it +# though. +# import platform +import re + +from .sysinfo import RUNNING_ON_APPVEYOR as APPVEYOR +from .sysinfo import RUNNING_ON_TRAVIS as TRAVIS +from .sysinfo import RESOLVER_NOT_SYSTEM as ARES +from .sysinfo import RUN_COVERAGE + + +from .sysinfo import PYPY +from .sysinfo import PYPY3 +from .sysinfo import PY3 +from .sysinfo import PY2 +from .sysinfo import PY34 +from .sysinfo import PY35 +from .sysinfo import PY36 +from .sysinfo import PY37 + +from .sysinfo import WIN +from .sysinfo import OSX + +from .sysinfo import LIBUV +from .sysinfo import CFFI_BACKEND + +from . import flaky + +CPYTHON = not PYPY + +# By default, test cases are expected to switch and emit warnings if there was none +# If a test is found in this list, it's expected not to switch. +no_switch_tests = '''test_patched_select.SelectTestCase.test_error_conditions +test_patched_ftplib.*.test_all_errors +test_patched_ftplib.*.test_getwelcome +test_patched_ftplib.*.test_sanitize +test_patched_ftplib.*.test_set_pasv +#test_patched_ftplib.TestIPv6Environment.test_af +test_patched_socket.TestExceptions.testExceptionTree +test_patched_socket.Urllib2FileobjectTest.testClose +test_patched_socket.TestLinuxAbstractNamespace.testLinuxAbstractNamespace +test_patched_socket.TestLinuxAbstractNamespace.testMaxName +test_patched_socket.TestLinuxAbstractNamespace.testNameOverflow +test_patched_socket.FileObjectInterruptedTestCase.* +test_patched_urllib.* +test_patched_asyncore.HelperFunctionTests.* +test_patched_httplib.BasicTest.* +test_patched_httplib.HTTPSTimeoutTest.test_attributes +test_patched_httplib.HeaderTests.* +test_patched_httplib.OfflineTest.* +test_patched_httplib.HTTPSTimeoutTest.test_host_port +test_patched_httplib.SourceAddressTest.testHTTPSConnectionSourceAddress +test_patched_select.SelectTestCase.test_error_conditions +test_patched_smtplib.NonConnectingTests.* +test_patched_urllib2net.OtherNetworkTests.* +test_patched_wsgiref.* +test_patched_subprocess.HelperFunctionTests.* +''' + +ignore_switch_tests = ''' +test_patched_socket.GeneralModuleTests.* +test_patched_httpservers.BaseHTTPRequestHandlerTestCase.* +test_patched_queue.* +test_patched_signal.SiginterruptTest.* +test_patched_urllib2.* +test_patched_ssl.* +test_patched_signal.BasicSignalTests.* +test_patched_threading_local.* +test_patched_threading.* +''' + + +def make_re(tests): + tests = [x.strip().replace(r'\.', r'\\.').replace('*', '.*?') + for x in tests.split('\n') if x.strip()] + return re.compile('^%s$' % '|'.join(tests)) + + +no_switch_tests = make_re(no_switch_tests) +ignore_switch_tests = make_re(ignore_switch_tests) + + +def get_switch_expected(fullname): + """ + >>> get_switch_expected('test_patched_select.SelectTestCase.test_error_conditions') + False + >>> get_switch_expected('test_patched_socket.GeneralModuleTests.testCrucialConstants') + False + >>> get_switch_expected('test_patched_socket.SomeOtherTest.testHello') + True + >>> get_switch_expected("test_patched_httplib.BasicTest.test_bad_status_repr") + False + """ + # certain pylint versions mistype the globals as + # str, not re. + # pylint:disable=no-member + if ignore_switch_tests.match(fullname) is not None: + return None + if no_switch_tests.match(fullname) is not None: + return False + return True + + +disabled_tests = [ + # The server side takes awhile to shut down + 'test_httplib.HTTPSTest.test_local_bad_hostname', + + 'test_threading.ThreadTests.test_PyThreadState_SetAsyncExc', + # uses some internal C API of threads not available when threads are emulated with greenlets + + 'test_threading.ThreadTests.test_join_nondaemon_on_shutdown', + # asserts that repr(sleep) is '' + + 'test_urllib2net.TimeoutTest.test_ftp_no_timeout', + 'test_urllib2net.TimeoutTest.test_ftp_timeout', + 'test_urllib2net.TimeoutTest.test_http_no_timeout', + 'test_urllib2net.TimeoutTest.test_http_timeout', + # accesses _sock.gettimeout() which is always in non-blocking mode + + 'test_urllib2net.OtherNetworkTests.test_ftp', + # too slow + + 'test_urllib2net.OtherNetworkTests.test_urlwithfrag', + # fails dues to some changes on python.org + + 'test_urllib2net.OtherNetworkTests.test_sites_no_connection_close', + # flaky + + 'test_socket.UDPTimeoutTest.testUDPTimeout', + # has a bug which makes it fail with error: (107, 'Transport endpoint is not connected') + # (it creates a TCP socket, not UDP) + + 'test_socket.GeneralModuleTests.testRefCountGetNameInfo', + # fails with "socket.getnameinfo loses a reference" while the reference is only "lost" + # because it is referenced by the traceback - any Python function would lose a reference like that. + # the original getnameinfo does not "lose" it because it's in C. + + 'test_socket.NetworkConnectionNoServer.test_create_connection_timeout', + # replaces socket.socket with MockSocket and then calls create_connection. + # this unfortunately does not work with monkey patching, because gevent.socket.create_connection + # is bound to gevent.socket.socket and updating socket.socket does not affect it. + # this issues also manifests itself when not monkey patching DNS: http://code.google.com/p/gevent/issues/detail?id=54 + # create_connection still uses gevent.socket.getaddrinfo while it should be using socket.getaddrinfo + + 'test_asyncore.BaseTestAPI.test_handle_expt', + # sends some OOB data and expect it to be detected as such; gevent.select.select does not support that + + # This one likes to check its own filename, but we rewrite + # the file to a temp location during patching. + 'test_asyncore.HelperFunctionTests.test_compact_traceback', + + 'test_signal.WakeupSignalTests.test_wakeup_fd_early', + # expects time.sleep() to return prematurely in case of a signal; + # gevent.sleep() is better than that and does not get interrupted (unless signal handler raises an error) + + 'test_signal.WakeupSignalTests.test_wakeup_fd_during', + # expects select.select() to raise select.error(EINTR'interrupted system call') + # gevent.select.select() does not get interrupted (unless signal handler raises an error) + # maybe it should? + + 'test_signal.SiginterruptTest.test_without_siginterrupt', + 'test_signal.SiginterruptTest.test_siginterrupt_on', + # these rely on os.read raising EINTR which never happens with gevent.os.read + + 'test_subprocess.ProcessTestCase.test_leak_fast_process_del_killed', + 'test_subprocess.ProcessTestCase.test_zombie_fast_process_del', + # relies on subprocess._active which we don't use + + # Very slow, tries to open lots and lots of subprocess and files, + # tends to timeout on CI. + 'test_subprocess.ProcessTestCase.test_no_leaking', + + # This test is also very slow, and has been timing out on Travis + # since November of 2016 on Python 3, but now also seen on Python 2/Pypy. + 'test_subprocess.ProcessTestCase.test_leaking_fds_on_error', + + 'test_ssl.ThreadedTests.test_default_ciphers', + 'test_ssl.ThreadedTests.test_empty_cert', + 'test_ssl.ThreadedTests.test_malformed_cert', + 'test_ssl.ThreadedTests.test_malformed_key', + 'test_ssl.NetworkedTests.test_non_blocking_connect_ex', + # XXX needs investigating + + 'test_ssl.NetworkedTests.test_algorithms', + # The host this wants to use, sha256.tbs-internet.com, is not resolvable + # right now (2015-10-10), and we need to get Windows wheels + + # This started timing out randomly on Travis in oct/nov 2018. It appears + # to be something with random number generation taking too long. + 'test_ssl.BasicSocketTests.test_random_fork', + + # Relies on the repr of objects (Py3) + 'test_ssl.BasicSocketTests.test_dealloc_warn', + + 'test_urllib2.HandlerTests.test_cookie_redirect', + # this uses cookielib which we don't care about + + 'test_thread.ThreadRunningTests.test__count', + 'test_thread.TestForkInThread.test_forkinthread', + # XXX needs investigating + + 'test_subprocess.POSIXProcessTestCase.test_preexec_errpipe_does_not_double_close_pipes', + # Does not exist in the test suite until 2.7.4+. Subclasses Popen, and overrides + # _execute_child. But our version has a different parameter list than the + # version that comes with PyPy/CPython, so fails with a TypeError. +] + +if 'thread' in os.getenv('GEVENT_FILE', ''): + disabled_tests += [ + 'test_subprocess.ProcessTestCase.test_double_close_on_error' + # Fails with "OSError: 9 invalid file descriptor"; expect GC/lifetime issues + ] + + +if LIBUV: + # epoll appears to work with these just fine in some cases; + # kqueue (at least on OS X, the only tested kqueue system) + # never does (failing with abort()) + # (epoll on Raspbian 8.0/Debian Jessie/Linux 4.1.20 works; + # on a VirtualBox image of Ubuntu 15.10/Linux 4.2.0 both tests fail; + # Travis CI Ubuntu 12.04 precise/Linux 3.13 causes one of these tests to hang forever) + # XXX: Retry this with libuv 1.12+ + disabled_tests += [ + # A 2.7 test. Tries to fork, and libuv cannot fork + 'test_signal.InterProcessSignalTests.test_main', + # Likewise, a forking problem + 'test_signal.SiginterruptTest.test_siginterrupt_off', + ] + + if PY2: + + if TRAVIS: + + if CPYTHON: + + disabled_tests += [ + # This appears to crash the process, for some reason, + # but only on CPython 2.7.14 on Travis. Cannot reproduce in + # 2.7.14 on macOS or 2.7.12 in local Ubuntu 16.04 + 'test_subprocess.POSIXProcessTestCase.test_close_fd_0', + 'test_subprocess.POSIXProcessTestCase.test_close_fds_0_1', + 'test_subprocess.POSIXProcessTestCase.test_close_fds_0_2', + ] + + if PYPY: + disabled_tests += [ + # This seems to crash the interpreter. I cannot reproduce + # on macOS or local Linux VM. + # See https://travis-ci.org/gevent/gevent/jobs/348661604#L709 + 'test_smtplib.TooLongLineTests.testLineTooLong', + ] + if ARES: + + disabled_tests += [ + # This can timeout with a socket timeout in ssl.wrap_socket(c) + # on Travis. I can't reproduce locally. + 'test_ssl.ThreadedTests.test_handshake_timeout', + ] + + if PY3: + + disabled_tests += [ + # This test wants to pass an arbitrary fileno + # to a socket and do things with it. libuv doesn't like this, + # it raises EPERM. It is disabled on windows already. + # It depends on whether we had a fd already open and multiplexed with + 'test_socket.GeneralModuleTests.test_unknown_socket_family_repr', + # And yes, there's a typo in some versions. + 'test_socket.GeneralModuleTests.test_uknown_socket_family_repr', + ] + + if PY37: + + disabled_tests += [ + # This test sometimes fails at line 358. It's apparently + # extremely sensitive to timing. + 'test_selectors.PollSelectorTestCase.test_timeout', + ] + + if OSX: + disabled_tests += [ + # XXX: Starting when we upgraded from libuv 1.18.0 + # to 1.19.2, this sometimes (usually) started having + # a series of calls ('select.poll(0)', 'select.poll(-1)') + # take longer than the allowed 0.5 seconds. Debugging showed that + # it was the second call that took longer, for no apparent reason. + # There doesn't seem to be a change in the source code to libuv that + # would affect this. + # XXX-XXX: This actually disables too many tests :( + 'test_selectors.PollSelectorTestCase.test_timeout', + ] + + if RUN_COVERAGE: + + disabled_tests += [ + # Starting with #1145 this test (actually + # TestTLS_FTPClassMixin) becomes sensitive to timings + # under coverage. + 'test_ftplib.TestFTPClass.test_storlines', + ] + + + if sys.platform.startswith('linux'): + disabled_tests += [ + # crashes with EPERM, which aborts the epoll loop, even + # though it was allowed in in the first place. + 'test_asyncore.FileWrapperTest.test_dispatcher', + ] + + + + if WIN and PY2: + # From PyPy2-v5.9.0 and CPython 2.7.14, using its version of tests, + # which do work on darwin (and possibly linux?) + # I can't produce them in a local VM running Windows 10 + # and the same pypy version. + disabled_tests += [ + # These, which use asyncore, fail with + # 'NoneType is not iterable' on 'conn, addr = self.accept()' + # That returns None when the underlying socket raises + # EWOULDBLOCK, which it will do because it's set to non-blocking + # both by gevent and by libuv (at the level below python's knowledge) + # I can *usually* reproduce these locally; it seems to be some sort + # of race condition. + 'test_ftplib.TestFTPClass.test_acct', + 'test_ftplib.TestFTPClass.test_all_errors', + 'test_ftplib.TestFTPClass.test_cwd', + 'test_ftplib.TestFTPClass.test_delete', + 'test_ftplib.TestFTPClass.test_dir', + 'test_ftplib.TestFTPClass.test_exceptions', + 'test_ftplib.TestFTPClass.test_getwelcome', + 'test_ftplib.TestFTPClass.test_line_too_long', + 'test_ftplib.TestFTPClass.test_login', + 'test_ftplib.TestFTPClass.test_makepasv', + 'test_ftplib.TestFTPClass.test_mkd', + 'test_ftplib.TestFTPClass.test_nlst', + 'test_ftplib.TestFTPClass.test_pwd', + 'test_ftplib.TestFTPClass.test_quit', + 'test_ftplib.TestFTPClass.test_makepasv', + 'test_ftplib.TestFTPClass.test_rename', + 'test_ftplib.TestFTPClass.test_retrbinary', + 'test_ftplib.TestFTPClass.test_retrbinary_rest', + 'test_ftplib.TestFTPClass.test_retrlines', + 'test_ftplib.TestFTPClass.test_retrlines_too_long', + 'test_ftplib.TestFTPClass.test_rmd', + 'test_ftplib.TestFTPClass.test_sanitize', + 'test_ftplib.TestFTPClass.test_set_pasv', + 'test_ftplib.TestFTPClass.test_size', + 'test_ftplib.TestFTPClass.test_storbinary', + 'test_ftplib.TestFTPClass.test_storbinary_rest', + 'test_ftplib.TestFTPClass.test_storlines', + 'test_ftplib.TestFTPClass.test_storlines_too_long', + 'test_ftplib.TestFTPClass.test_voidcmd', + 'test_ftplib.TestTLS_FTPClass.test_data_connection', + 'test_ftplib.TestTLS_FTPClass.test_control_connection', + 'test_ftplib.TestTLS_FTPClass.test_context', + 'test_ftplib.TestTLS_FTPClass.test_check_hostname', + 'test_ftplib.TestTLS_FTPClass.test_auth_ssl', + 'test_ftplib.TestTLS_FTPClass.test_auth_issued_twice', + + # This one times out, but it's still a non-blocking socket + 'test_ftplib.TestFTPClass.test_makeport', + + # A timeout, possibly because of the way we handle interrupts? + 'test_socketserver.SocketServerTest.test_InterruptedServerSelectCall', + 'test_socketserver.SocketServerTest.test_InterruptServerSelectCall', + + # times out with something about threading? + # The apparent hang is just after the print of "waiting for server" + 'test_socketserver.SocketServerTest.test_ThreadingTCPServer', + 'test_socketserver.SocketServerTest.test_ThreadingUDPServer', + 'test_socketserver.SocketServerTest.test_TCPServer', + 'test_socketserver.SocketServerTest.test_UDPServer', + + # This one might be like 'test_urllib2_localnet.TestUrlopen.test_https_with_cafile'? + # XXX: Look at newer pypy and verify our usage of drop/reuse matches + # theirs. + 'test_httpservers.BaseHTTPServerTestCase.test_command', + 'test_httpservers.BaseHTTPServerTestCase.test_handler', + 'test_httpservers.BaseHTTPServerTestCase.test_head_keep_alive', + 'test_httpservers.BaseHTTPServerTestCase.test_head_via_send_error', + 'test_httpservers.BaseHTTPServerTestCase.test_header_close', + 'test_httpservers.BaseHTTPServerTestCase.test_internal_key_error', + 'test_httpservers.BaseHTTPServerTestCase.test_request_line_trimming', + 'test_httpservers.BaseHTTPServerTestCase.test_return_custom_status', + 'test_httpservers.BaseHTTPServerTestCase.test_send_blank', + 'test_httpservers.BaseHTTPServerTestCase.test_send_error', + 'test_httpservers.BaseHTTPServerTestCase.test_version_bogus', + 'test_httpservers.BaseHTTPServerTestCase.test_version_digits', + 'test_httpservers.BaseHTTPServerTestCase.test_version_invalid', + 'test_httpservers.BaseHTTPServerTestCase.test_version_none', + 'test_httpservers.SimpleHTTPServerTestCase.test_get', + 'test_httpservers.SimpleHTTPServerTestCase.test_head', + 'test_httpservers.SimpleHTTPServerTestCase.test_invalid_requests', + 'test_httpservers.SimpleHTTPServerTestCase.test_path_without_leading_slash', + 'test_httpservers.CGIHTTPServerTestCase.test_invaliduri', + 'test_httpservers.CGIHTTPServerTestCase.test_issue19435', + + # Unexpected timeouts sometimes + 'test_smtplib.TooLongLineTests.testLineTooLong', + 'test_smtplib.GeneralTests.testTimeoutValue', + + ] + + if PYPY: + disabled_tests += [ + # appears to timeout? + 'test_threading.ThreadTests.test_finalize_with_trace', + 'test_asyncore.DispatcherWithSendTests_UsePoll.test_send', + 'test_asyncore.DispatcherWithSendTests.test_send', + + # More unexpected timeouts + 'test_ssl.ContextTests.test__https_verify_envvar', + 'test_subprocess.ProcessTestCase.test_check_output', + 'test_telnetlib.ReadTests.test_read_eager_A', + + # But on Windows, our gc fix for that doesn't work anyway + # so we have to disable it. + 'test_urllib2_localnet.TestUrlopen.test_https_with_cafile', + + # These tests hang. see above. + 'test_threading.ThreadJoinOnShutdown.test_1_join_on_shutdown', + 'test_threading.ThreadingExceptionTests.test_print_exception', + + # Our copy of these in test__subprocess.py also hangs. + # Anything that uses Popen.communicate or directly uses + # Popen.stdXXX.read hangs. It's not clear why. + 'test_subprocess.ProcessTestCase.test_communicate', + 'test_subprocess.ProcessTestCase.test_cwd', + 'test_subprocess.ProcessTestCase.test_env', + 'test_subprocess.ProcessTestCase.test_stderr_pipe', + 'test_subprocess.ProcessTestCase.test_stdout_pipe', + 'test_subprocess.ProcessTestCase.test_stdout_stderr_pipe', + 'test_subprocess.ProcessTestCase.test_stderr_redirect_with_no_stdout_redirect', + 'test_subprocess.ProcessTestCase.test_stdout_filedes_of_stdout', + 'test_subprocess.ProcessTestcase.test_stdout_none', + 'test_subprocess.ProcessTestcase.test_universal_newlines', + 'test_subprocess.ProcessTestcase.test_writes_before_communicate', + 'test_subprocess.Win32ProcessTestCase._kill_process', + 'test_subprocess.Win32ProcessTestCase._kill_dead_process', + 'test_subprocess.Win32ProcessTestCase.test_shell_sequence', + 'test_subprocess.Win32ProcessTestCase.test_shell_string', + 'test_subprocess.CommandsWithSpaces.with_spaces', + ] + + + if WIN: + + disabled_tests += [ + # This test winds up hanging a long time. + # Inserting GCs doesn't fix it. + 'test_ssl.ThreadedTests.test_handshake_timeout', + + # These sometimes raise LoopExit, for no apparent reason, + # mostly but not exclusively on Python 2. + 'test_socket.BufferIOTest.testRecvFromIntoBytearray', + 'test_socket.BufferIOTest.testRecvFromIntoArray', + 'test_socket.BufferIOTest.testRecvIntoArray', + 'test_socket.BufferIOTest.testRecvFromIntoEmptyBuffer', + 'test_socket.BufferIOTest.testRecvFromIntoMemoryview', + 'test_socket.BufferIOTest.testRecvFromIntoSmallBuffer', + ] + + if PY3: + + disabled_tests += [ + ] + + if APPVEYOR: + + disabled_tests += [ + ] + + if PYPY: + + if TRAVIS: + + disabled_tests += [ + # This sometimes causes a segfault for no apparent reason. + # See https://travis-ci.org/gevent/gevent/jobs/327328704 + # Can't reproduce locally. + 'test_subprocess.ProcessTestCase.test_universal_newlines_communicate', + ] + +if RUN_COVERAGE and CFFI_BACKEND: + disabled_tests += [ + # This test hangs in this combo for some reason + 'test_socket.GeneralModuleTests.test_sendall_interrupted', + # This can get a timeout exception instead of the Alarm + 'test_socket.TCPTimeoutTest.testInterruptedTimeout', + + # This test sometimes gets the wrong answer (due to changed timing?) + 'test_socketserver.SocketServerTest.test_ForkingUDPServer', + + # Timing and signals are off, so a handler exception doesn't get raised. + # Seen under libev + 'test_signal.InterProcessSignalTests.test_main', + ] + +if PY2: + if TRAVIS: + disabled_tests += [ + # When we moved to group:travis_latest and dist:xenial, + # this started returning a value (33554432L) != 0; presumably + # because of updated SSL library? Only on CPython. + 'test_ssl.ContextTests.test_options', + # When we moved to group:travis_latest and dist:xenial, + # one of the values used started *working* when it was expected to fail. + # The list of values and systems is long and complex, so + # presumably something needs to be updated. Only on PyPy. + 'test_ssl.ThreadedTests.test_alpn_protocols', + ] + +def _make_run_with_original(mod_name, func_name): + @contextlib.contextmanager + def with_orig(): + mod = __import__(mod_name) + now = getattr(mod, func_name) + from gevent.monkey import get_original + orig = get_original(mod_name, func_name) + try: + setattr(mod, func_name, orig) + yield + finally: + setattr(mod, func_name, now) + return with_orig + +@contextlib.contextmanager +def _gc_at_end(): + try: + yield + finally: + import gc + gc.collect() + gc.collect() + +@contextlib.contextmanager +def _flaky_socket_timeout(): + import socket + try: + yield + except socket.timeout: + flaky.reraiseFlakyTestTimeout() + +# Map from FQN to a context manager that will be wrapped around +# that test. +wrapped_tests = { +} + + + +class _PatchedTest(object): + def __init__(self, test_fqn): + self._patcher = wrapped_tests[test_fqn] + + def __call__(self, orig_test_fn): + + @functools.wraps(orig_test_fn) + def test(*args, **kwargs): + with self._patcher(): + return orig_test_fn(*args, **kwargs) + return test + + + +if sys.version_info[:3] <= (2, 7, 11): + + disabled_tests += [ + # These were added/fixed in 2.7.12+ + 'test_ssl.ThreadedTests.test__https_verify_certificates', + 'test_ssl.ThreadedTests.test__https_verify_envvar', + ] + +if OSX: + disabled_tests += [ + 'test_subprocess.POSIXProcessTestCase.test_run_abort', + # causes Mac OS X to show "Python crashes" dialog box which is annoying + ] + +if WIN: + disabled_tests += [ + # Issue with Unix vs DOS newlines in the file vs from the server + 'test_ssl.ThreadedTests.test_socketserver', + ] + + # These are a problem on 3.5; on 3.6+ they wind up getting (accidentally) disabled. + wrapped_tests.update({ + 'test_socket.SendfileUsingSendTest.testWithTimeout': _flaky_socket_timeout, + 'test_socket.SendfileUsingSendTest.testOffset': _flaky_socket_timeout, + 'test_socket.SendfileUsingSendTest.testRegularFile': _flaky_socket_timeout, + 'test_socket.SendfileUsingSendTest.testCount': _flaky_socket_timeout, + }) + +if PYPY: + disabled_tests += [ + # Does not exist in the CPython test suite, tests for a specific bug + # in PyPy's forking. Only runs on linux and is specific to the PyPy + # implementation of subprocess (possibly explains the extra parameter to + # _execut_child) + 'test_subprocess.ProcessTestCase.test_failed_child_execute_fd_leak', + # On some platforms, this returns "zlib_compression", but the test is looking for + # "ZLIB" + 'test_ssl.ThreadedTests.test_compression', + ] + +# Generic Python 3 + +if PY3: + + disabled_tests += [ + # Triggers the crash reporter + 'test_threading.SubinterpThreadingTests.test_daemon_threads_fatal_error', + + # Relies on an implementation detail, Thread._tstate_lock + 'test_threading.ThreadTests.test_tstate_lock', + # Relies on an implementation detail (reprs); we have our own version + 'test_threading.ThreadTests.test_various_ops', + 'test_threading.ThreadTests.test_various_ops_large_stack', + 'test_threading.ThreadTests.test_various_ops_small_stack', + + # Relies on Event having a _cond and an _reset_internal_locks() + # XXX: These are commented out in the source code of test_threading because + # this doesn't work. + # 'lock_tests.EventTests.test_reset_internal_locks', + + # Python bug 13502. We may or may not suffer from this as its + # basically a timing race condition. + # XXX Same as above + # 'lock_tests.EventTests.test_set_and_clear', + + # These tests want to assert on the type of the class that implements + # `Popen.stdin`; we use a FileObject, but they expect different subclasses + # from the `io` module + 'test_subprocess.ProcessTestCase.test_io_buffered_by_default', + 'test_subprocess.ProcessTestCase.test_io_unbuffered_works', + + # 3.3 exposed the `endtime` argument to wait accidentally. + # It is documented as deprecated and not to be used since 3.4 + # This test in 3.6.3 wants to use it though, and we don't have it. + 'test_subprocess.ProcessTestCase.test_wait_endtime', + + # These all want to inspect the string value of an exception raised + # by the exec() call in the child. The _posixsubprocess module arranges + # for better exception handling and printing than we do. + 'test_subprocess.POSIXProcessTestCase.test_exception_bad_args_0', + 'test_subprocess.POSIXProcessTestCase.test_exception_bad_executable', + 'test_subprocess.POSIXProcessTestCase.test_exception_cwd', + # Relies on a 'fork_exec' attribute that we don't provide + 'test_subprocess.POSIXProcessTestCase.test_exception_errpipe_bad_data', + 'test_subprocess.POSIXProcessTestCase.test_exception_errpipe_normal', + + # Python 3 fixed a bug if the stdio file descriptors were closed; + # we still have that bug + 'test_subprocess.POSIXProcessTestCase.test_small_errpipe_write_fd', + + # Relies on implementation details (some of these tests were added in 3.4, + # but PyPy3 is also shipping them.) + 'test_socket.GeneralModuleTests.test_SocketType_is_socketobject', + 'test_socket.GeneralModuleTests.test_dealloc_warn', + 'test_socket.GeneralModuleTests.test_repr', + 'test_socket.GeneralModuleTests.test_str_for_enums', + 'test_socket.GeneralModuleTests.testGetaddrinfo', + + ] + if TRAVIS: + disabled_tests += [ + # test_cwd_with_relative_executable tends to fail + # on Travis...it looks like the test processes are stepping + # on each other and messing up their temp directories. We tend to get things like + # saved_dir = os.getcwd() + # FileNotFoundError: [Errno 2] No such file or directory + 'test_subprocess.ProcessTestCase.test_cwd_with_relative_arg', + 'test_subprocess.ProcessTestCaseNoPoll.test_cwd_with_relative_arg', + 'test_subprocess.ProcessTestCase.test_cwd_with_relative_executable', + + ] + + wrapped_tests.update({ + # XXX: BUG: We simply don't handle this correctly. On CPython, + # we wind up raising a BlockingIOError and then + # BrokenPipeError and then some random TypeErrors, all on the + # server. CPython 3.5 goes directly to socket.send() (via + # socket.makefile), whereas CPython 3.6 uses socket.sendall(). + # On PyPy, the behaviour is much worse: we hang indefinitely, perhaps exposing a problem + # with our signal handling. + # In actuality, though, this test doesn't fully test the EINTR it expects + # to under gevent (because if its EWOULDBLOCK retry behaviour.) + # Instead, the failures were all due to `pthread_kill` trying to send a signal + # to a greenlet instead of a real thread. The solution is to deliver the signal + # to the real thread by letting it get the correct ID. + 'test_wsgiref.IntegrationTests.test_interrupted_write': _make_run_with_original('threading', 'get_ident') + }) + +# PyPy3 3.5.5 v5.8-beta + +if PYPY3: + + + disabled_tests += [ + # This raises 'RuntimeError: reentrant call' when exiting the + # process tries to close the stdout stream; no other platform does this. + # Seen in both 3.3 and 3.5 (5.7 and 5.8) + 'test_signal.SiginterruptTest.test_siginterrupt_off', + ] + + +if PYPY and PY3: + disabled_tests += [ + # This fails to close all the FDs, at least on CI. On OS X, many of the + # POSIXProcessTestCase fd tests have issues. + 'test_subprocess.POSIXProcessTestCase.test_close_fds_when_max_fd_is_lowered', + + # This has the wrong constants in 5.8 (but worked in 5.7), at least on + # OS X. It finds "zlib compression" but expects "ZLIB". + 'test_ssl.ThreadedTests.test_compression', + + # The below are new with 5.10.1 + # This gets an EOF in violation of protocol; again, even without gevent + # (at least on OS X; it's less consistent about that on travis) + 'test_ssl.NetworkedBIOTests.test_handshake', + + ] + + if OSX: + disabled_tests += [ + # These all fail with "invalid_literal for int() with base 10: b''" + 'test_subprocess.POSIXProcessTestCase.test_close_fds', + 'test_subprocess.POSIXProcessTestCase.test_close_fds_after_preexec', + 'test_subprocess.POSIXProcessTestCase.test_pass_fds', + 'test_subprocess.POSIXProcessTestCase.test_pass_fds_inheritable', + 'test_subprocess.POSIXProcessTestCase.test_pipe_cloexec', + + # The below are new with 5.10.1 + # These fail with 'OSError: received malformed or improperly truncated ancillary data' + 'test_socket.RecvmsgSCMRightsStreamTest.testCmsgTruncLen0', + 'test_socket.RecvmsgSCMRightsStreamTest.testCmsgTruncLen0Plus1', + 'test_socket.RecvmsgSCMRightsStreamTest.testCmsgTruncLen1', + 'test_socket.RecvmsgSCMRightsStreamTest.testCmsgTruncLen2Minus1', + + # Using the provided High Sierra binary, these fail with + # 'ValueError: invalid protocol version _SSLMethod.PROTOCOL_SSLv3'. + # gevent code isn't involved and running them unpatched has the same issue. + 'test_ssl.ContextTests.test_constructor', + 'test_ssl.ContextTests.test_protocol', + 'test_ssl.ContextTests.test_session_stats', + 'test_ssl.ThreadedTests.test_echo', + 'test_ssl.ThreadedTests.test_protocol_sslv23', + 'test_ssl.ThreadedTests.test_protocol_sslv3', + 'test_ssl.ThreadedTests.test_protocol_tlsv1', + 'test_ssl.ThreadedTests.test_protocol_tlsv1_1', + + # This gets None instead of http1.1, even without gevent + 'test_ssl.ThreadedTests.test_npn_protocols', + + # This fails to decode a filename even without gevent, + # at least on High Sierarr. + 'test_httpservers.SimpleHTTPServerTestCase.test_undecodable_filename', + ] + + disabled_tests += [ + # This seems to be a buffering issue? Something isn't + # getting flushed. (The output is wrong). Under PyPy3 5.7, + # I couldn't reproduce locally in Ubuntu 16 in a VM + # or a laptop with OS X. Under 5.8.0, I can reproduce it, but only + # when run by the testrunner, not when run manually on the command line, + # so something is changing in stdout buffering in those situations. + 'test_threading.ThreadJoinOnShutdown.test_2_join_in_forked_process', + 'test_threading.ThreadJoinOnShutdown.test_1_join_in_forked_process', + ] + + if TRAVIS: + disabled_tests += [ + # Likewise, but I haven't produced it locally. + 'test_threading.ThreadJoinOnShutdown.test_1_join_on_shutdown', + ] + +if PYPY: + + wrapped_tests.update({ + # XXX: gevent: The error that was raised by that last call + # left a socket open on the server or client. The server gets + # to http/server.py(390)handle_one_request and blocks on + # self.rfile.readline which apparently is where the SSL + # handshake is done. That results in the exception being + # raised on the client above, but apparently *not* on the + # server. Consequently it sits trying to read from that + # socket. On CPython, when the client socket goes out of scope + # it is closed and the server raises an exception, closing the + # socket. On PyPy, we need a GC cycle for that to happen. + # Without the socket being closed and exception being raised, + # the server cannot be stopped (it runs each request in the + # same thread that would notice it had been stopped), and so + # the cleanup method added by start_https_server to stop the + # server blocks "forever". + + # This is an important test, so rather than skip it in patched_tests_setup, + # we do the gc before we return. + 'test_urllib2_localnet.TestUrlopen.test_https_with_cafile': _gc_at_end, + }) + + +if PY34 and sys.version_info[:3] < (3, 4, 4): + # Older versions have some issues with the SSL tests. Seen on Appveyor + disabled_tests += [ + 'test_ssl.ContextTests.test_options', + 'test_ssl.ThreadedTests.test_protocol_sslv23', + 'test_ssl.ThreadedTests.test_protocol_sslv3', + 'test_httplib.HTTPSTest.test_networked', + ] + +if PY34: + disabled_tests += [ + 'test_subprocess.ProcessTestCase.test_threadsafe_wait', + # XXX: It seems that threading.Timer is not being greened properly, possibly + # due to a similar issue to what gevent.threading documents for normal threads. + # In any event, this test hangs forever + + + 'test_subprocess.POSIXProcessTestCase.test_preexec_errpipe_does_not_double_close_pipes', + # Subclasses Popen, and overrides _execute_child. Expects things to be done + # in a particular order in an exception case, but we don't follow that + # exact order + + + 'test_selectors.PollSelectorTestCase.test_above_fd_setsize', + # This test attempts to open many many file descriptors and + # poll on them, expecting them all to be ready at once. But + # libev limits the number of events it will return at once. Specifically, + # on linux with epoll, it returns a max of 64 (ev_epoll.c). + + # XXX: Hangs (Linux only) + 'test_socket.NonBlockingTCPTests.testInitNonBlocking', + # We don't handle the Linux-only SOCK_NONBLOCK option + 'test_socket.NonblockConstantTest.test_SOCK_NONBLOCK', + + # Tries to use multiprocessing which doesn't quite work in + # monkey_test module (Windows only) + 'test_socket.TestSocketSharing.testShare', + + # Windows-only: Sockets have a 'ioctl' method in Python 3 + # implemented in the C code. This test tries to check + # for the presence of the method in the class, which we don't + # have because we don't inherit the C implementation. But + # it should be found at runtime. + 'test_socket.GeneralModuleTests.test_sock_ioctl', + + # See comments for 2.7; these hang + 'test_httplib.HTTPSTest.test_local_good_hostname', + 'test_httplib.HTTPSTest.test_local_unknown_cert', + + # XXX This fails for an unknown reason + 'test_httplib.HeaderTests.test_parse_all_octets', + ] + + if OSX: + disabled_tests += [ + # These raise "OSError: 12 Cannot allocate memory" on both + # patched and unpatched runs + 'test_socket.RecvmsgSCMRightsStreamTest.testFDPassEmpty', + ] + + if sys.version_info[:2] == (3, 4): + disabled_tests += [ + # These are all expecting that a signal (sigalarm) that + # arrives during a blocking call should raise + # InterruptedError with errno=EINTR. gevent does not do + # this, instead its loop keeps going and raises a timeout + # (which fails the test). HOWEVER: Python 3.5 fixed this + # problem and started raising a timeout, + # (https://docs.python.org/3/whatsnew/3.5.html#pep-475-retry-system-calls-failing-with-eintr) + # and removed these tests (InterruptedError is no longer + # raised). So basically, gevent was ahead of its time. + 'test_socket.InterruptedRecvTimeoutTest.testInterruptedRecvIntoTimeout', + 'test_socket.InterruptedRecvTimeoutTest.testInterruptedRecvTimeout', + 'test_socket.InterruptedRecvTimeoutTest.testInterruptedRecvfromIntoTimeout', + 'test_socket.InterruptedRecvTimeoutTest.testInterruptedRecvfromTimeout', + 'test_socket.InterruptedRecvTimeoutTest.testInterruptedSendTimeout', + 'test_socket.InterruptedRecvTimeoutTest.testInterruptedSendtoTimeout', + 'test_socket.InterruptedRecvTimeoutTest.testInterruptedRecvmsgTimeout', + 'test_socket.InterruptedRecvTimeoutTest.testInterruptedRecvmsgIntoTimeout', + 'test_socket.InterruptedSendTimeoutTest.testInterruptedSendmsgTimeout', + ] + + if TRAVIS: + # This has been seen to produce "Inconsistency detected by + # ld.so: dl-open.c: 231: dl_open_worker: Assertion + # `_dl_debug_initialize (0, args->nsid)->r_state == + # RT_CONSISTENT' failed!" and fail. + disabled_tests += [ + 'test_threading.ThreadTests.test_is_alive_after_fork', + ] + + if TRAVIS: + disabled_tests += [ + 'test_subprocess.ProcessTestCase.test_double_close_on_error', + # This test is racy or OS-dependent. It passes locally (sufficiently fast machine) + # but fails under Travis + ] + +if PY35: + disabled_tests += [ + # XXX: Hangs + 'test_ssl.ThreadedTests.test_nonblocking_send', + 'test_ssl.ThreadedTests.test_socketserver', + # Uses direct sendfile, doesn't properly check for it being enabled + 'test_socket.GeneralModuleTests.test__sendfile_use_sendfile', + + + # Relies on the regex of the repr having the locked state (TODO: it'd be nice if + # we did that). + # XXX: These are commented out in the source code of test_threading because + # this doesn't work. + # 'lock_tests.LockTests.lest_locked_repr', + # 'lock_tests.LockTests.lest_repr', + + # Added between 3.6.0 and 3.6.3, uses _testcapi and internals + # of the subprocess module. + 'test_subprocess.POSIXProcessTestCase.test_stopped', + + # This test opens a socket, creates a new socket with the same fileno, + # closes the original socket (and hence fileno) and then + # expects that the calling setblocking() on the duplicate socket + # will raise an error. Our implementation doesn't work that way because + # setblocking() doesn't actually touch the file descriptor. + # That's probably OK because this was a GIL state error in CPython + # see https://github.com/python/cpython/commit/fa22b29960b4e683f4e5d7e308f674df2620473c + 'test_socket.TestExceptions.test_setblocking_invalidfd', + ] + + if ARES: + disabled_tests += [ + # These raise different errors or can't resolve + # the IP address correctly + 'test_socket.GeneralModuleTests.test_host_resolution', + 'test_socket.GeneralModuleTests.test_getnameinfo', + ] + + if sys.version_info[1] == 5: + disabled_tests += [ + # This test tends to time out, but only under 3.5, not under + # 3.6 or 3.7. Seen with both libev and libuv + 'test_socket.SendfileUsingSendTest.testWithTimeoutTriggeredSend', + ] + +if sys.version_info[:3] <= (3, 5, 1): + # Python issue 26499 was fixed in 3.5.2 and these tests were added. + disabled_tests += [ + 'test_httplib.BasicTest.test_mixed_reads', + 'test_httplib.BasicTest.test_read1_bound_content_length', + 'test_httplib.BasicTest.test_read1_content_length', + 'test_httplib.BasicTest.test_readline_bound_content_length', + 'test_httplib.BasicTest.test_readlines_content_length', + ] + +if PY36: + disabled_tests += [ + 'test_threading.MiscTestCase.test__all__', + ] + + # We don't actually implement socket._sendfile_use_sendfile, + # so these tests, which think they're using that and os.sendfile, + # fail. + disabled_tests += [ + 'test_socket.SendfileUsingSendfileTest.testCount', + 'test_socket.SendfileUsingSendfileTest.testCountSmall', + 'test_socket.SendfileUsingSendfileTest.testCountWithOffset', + 'test_socket.SendfileUsingSendfileTest.testOffset', + 'test_socket.SendfileUsingSendfileTest.testRegularFile', + 'test_socket.SendfileUsingSendfileTest.testWithTimeout', + 'test_socket.SendfileUsingSendfileTest.testEmptyFileSend', + 'test_socket.SendfileUsingSendfileTest.testNonBlocking', + 'test_socket.SendfileUsingSendfileTest.test_errors', + ] + + # Ditto + disabled_tests += [ + 'test_socket.GeneralModuleTests.test__sendfile_use_sendfile', + ] + + disabled_tests += [ + # This test requires Linux >= 4.3. When we were running 'dist: + # trusty' on the 4.4 kernel, it passed (~July 2017). But when + # trusty became the default dist in September 2017 and updated + # the kernel to 4.11.6, it begain failing. It fails on `res = + # op.recv(assoclen + len(plain) + taglen)` (where 'op' is the + # client socket) with 'OSError: [Errno 22] Invalid argument' + # for unknown reasons. This is *after* having successfully + # called `op.sendmsg_afalg`. Post 3.6.0, what we test with, + # the test was changed to require Linux 4.9 and the data was changed, + # so this is not our fault. We should eventually update this when we + # update our 3.6 version. + # See https://bugs.python.org/issue29324 + 'test_socket.LinuxKernelCryptoAPI.test_aead_aes_gcm', + ] + +if PY37: + disabled_tests += [ + # These want to use the private '_communicate' method, which + # our Popen doesn't have. + 'test_subprocess.MiscTests.test_call_keyboardinterrupt_no_kill', + 'test_subprocess.MiscTests.test_context_manager_keyboardinterrupt_no_kill', + 'test_subprocess.MiscTests.test_run_keyboardinterrupt_no_kill', + + # This wants to check that the underlying fileno is blocking, + # but it isn't. + 'test_socket.NonBlockingTCPTests.testSetBlocking', + + # 3.7b2 made it impossible to instantiate SSLSocket objects + # directly, and this tests for that, but we don't follow that change. + 'test_ssl.BasicSocketTests.test_private_init', + + # 3.7b2 made a change to this test that on the surface looks incorrect, + # but it passes when they run it and fails when we do. It's not + # clear why. + 'test_ssl.ThreadedTests.test_check_hostname_idn', + ] + + if APPVEYOR: + disabled_tests += [ + + ] + +# if 'signalfd' in os.environ.get('GEVENT_BACKEND', ''): +# # tests that don't interact well with signalfd +# disabled_tests.extend([ +# 'test_signal.SiginterruptTest.test_siginterrupt_off', +# 'test_socketserver.SocketServerTest.test_ForkingTCPServer', +# 'test_socketserver.SocketServerTest.test_ForkingUDPServer', +# 'test_socketserver.SocketServerTest.test_ForkingUnixStreamServer']) + +# LibreSSL reports OPENSSL_VERSION_INFO (2, 0, 0, 0, 0) regardless of its version, +# so this is known to fail on some distros. We don't want to detect this because we +# don't want to trigger the side-effects of importing ssl prematurely if we will +# be monkey-patching, so we skip this test everywhere. It doesn't do much for us +# anyway. +disabled_tests += [ + 'test_ssl.BasicSocketTests.test_openssl_version' +] + +# Now build up the data structure we'll use to actually find disabled tests +# to avoid a linear scan for every file (it seems the list could get quite large) +# (First, freeze the source list to make sure it isn't modified anywhere) + +def _build_test_structure(sequence_of_tests): + + _disabled_tests = frozenset(sequence_of_tests) + + disabled_tests_by_file = collections.defaultdict(set) + for file_case_meth in _disabled_tests: + file_name, _case, _meth = file_case_meth.split('.') + + by_file = disabled_tests_by_file[file_name] + + by_file.add(file_case_meth) + + return disabled_tests_by_file + +_disabled_tests_by_file = _build_test_structure(disabled_tests) + +_wrapped_tests_by_file = _build_test_structure(wrapped_tests) + + +def disable_tests_in_source(source, filename): + # Source and filename are both native strings. + + if filename.startswith('./'): + # turn "./test_socket.py" (used for auto-complete) into "test_socket.py" + filename = filename[2:] + + if filename.endswith('.py'): + filename = filename[:-3] + + + # XXX ignoring TestCase class name (just using function name). + # Maybe we should do this with the AST, or even after the test is + # imported. + my_disabled_tests = _disabled_tests_by_file.get(filename, ()) + my_wrapped_tests = _wrapped_tests_by_file.get(filename, {}) + + + if my_disabled_tests or my_wrapped_tests: + # Insert our imports early in the file. + # If we do it on a def-by-def basis, we can break syntax + # if the function is already decorated + pattern = r'^import .*' + replacement = r'from gevent.testing import patched_tests_setup as _GEVENT_PTS;' + replacement += r'import unittest as _GEVENT_UTS;' + replacement += r'\g<0>' + source, n = re.subn(pattern, replacement, source, 1, re.MULTILINE) + + print("Added imports", n) + + # Test cases will always be indented some, + # so use [ \t]+. Without indentation, test_main, commonly used as the + # __main__ function at the top level, could get matched. \s matches + # newlines even in MULTILINE mode so it would still match that. + my_disabled_testcases = set() + for test in my_disabled_tests: + testcase = test.split('.')[-1] + my_disabled_testcases.add(testcase) + # def foo_bar(self) + # -> + # @_GEVENT_UTS.skip('Removed by patched_tests_setup') + # def foo_bar(self) + pattern = r"^([ \t]+)def " + testcase + replacement = r"\1@_GEVENT_UTS.skip('Removed by patched_tests_setup: %s')\n" % (test,) + replacement += r"\g<0>" + source, n = re.subn(pattern, replacement, source, 0, re.MULTILINE) + print('Skipped %s (%d)' % (testcase, n), file=sys.stderr) + + + for test in my_wrapped_tests: + testcase = test.split('.')[-1] + if testcase in my_disabled_testcases: + print("Not wrapping %s because it is skipped" % (test,)) + continue + + # def foo_bar(self) + # -> + # @_GEVENT_PTS._PatchedTest('file.Case.name') + # def foo_bar(self) + pattern = r"^([ \t]+)def " + testcase + replacement = r"\1@_GEVENT_PTS._PatchedTest('%s')\n" % (test,) + replacement += r"\g<0>" + + source, n = re.subn(pattern, replacement, source, 0, re.MULTILINE) + print('Wrapped %s (%d)' % (testcase, n), file=sys.stderr) + + return source diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/testing/six.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/testing/six.py new file mode 100644 index 00000000..955d14b5 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/testing/six.py @@ -0,0 +1,42 @@ +import sys +# pylint:disable=unused-argument,import-error + +PY3 = sys.version_info[0] >= 3 + +if PY3: + import builtins + exec_ = getattr(builtins, "exec") + + def reraise(tp, value, tb=None): + if value.__traceback__ is not tb: + raise value.with_traceback(tb) + raise value + + xrange = range + string_types = (str,) + text_type = str + +else: + def exec_(code, globs=None, locs=None): + """Execute code in a namespace.""" + if globs is None: + frame = sys._getframe(1) + globs = frame.f_globals + if locs is None: + locs = frame.f_locals + del frame + elif locs is None: + locs = globs + exec("""exec code in globs, locs""") + + import __builtin__ as builtins + xrange = builtins.xrange + string_types = (builtins.basestring,) + text_type = builtins.unicode + + exec_("""def reraise(tp, value, tb=None): + try: + raise tp, value, tb + finally: + tb = None +""") diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/testing/skipping.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/testing/skipping.py new file mode 100644 index 00000000..d2de2f52 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/testing/skipping.py @@ -0,0 +1,116 @@ +# Copyright (c) 2018 gevent community +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. +from __future__ import absolute_import, print_function, division + +import unittest + +from . import sysinfo + +def _identity(f): + return f + +def _do_not_skip(reason): + assert reason + return _identity + + +skipOnWindows = _do_not_skip +skipOnAppVeyor = _do_not_skip +skipOnCI = _do_not_skip + +skipOnPyPy = _do_not_skip +skipOnPyPyOnCI = _do_not_skip +skipOnPyPy3OnCI = _do_not_skip +skipOnPyPy3 = _do_not_skip +skipOnPyPyOnWindows = _do_not_skip + +skipOnPy37 = unittest.skip if sysinfo.PY37 else _do_not_skip + +skipOnPurePython = unittest.skip if sysinfo.PURE_PYTHON else _do_not_skip +skipWithCExtensions = unittest.skip if not sysinfo.PURE_PYTHON else _do_not_skip + +skipOnLibuv = _do_not_skip +skipOnLibuvOnWin = _do_not_skip +skipOnLibuvOnCI = _do_not_skip +skipOnLibuvOnCIOnPyPy = _do_not_skip +skipOnLibuvOnPyPyOnWin = _do_not_skip +skipOnLibuvOnTravisOnCPython27 = _do_not_skip + +skipOnLibev = _do_not_skip + +if sysinfo.WIN: + skipOnWindows = unittest.skip + + +if sysinfo.RUNNING_ON_APPVEYOR: + # See comments scattered around about timeouts and the timer + # resolution available on appveyor (lots of jitter). this + # seems worse with the 62-bit builds. + # Note that we skip/adjust these tests only on AppVeyor, not + # win32---we don't think there's gevent related problems but + # environment related problems. These can be tested and debugged + # separately on windows in a more stable environment. + skipOnAppVeyor = unittest.skip + + +if sysinfo.RUNNING_ON_CI: + skipOnCI = unittest.skip + + +if sysinfo.PYPY: + skipOnPyPy = unittest.skip + if sysinfo.RUNNING_ON_CI: + skipOnPyPyOnCI = unittest.skip + + if sysinfo.WIN: + skipOnPyPyOnWindows = unittest.skip + + if sysinfo.PYPY3: + skipOnPyPy3 = unittest.skip + if sysinfo.RUNNING_ON_CI: + # Same as above, for PyPy3.3-5.5-alpha and 3.5-5.7.1-beta and 3.5-5.8 + skipOnPyPy3OnCI = unittest.skip + + +skipUnderCoverage = unittest.skip if sysinfo.RUN_COVERAGE else _do_not_skip + +skipIf = unittest.skipIf +skipUnless = unittest.skipUnless + + + +if sysinfo.LIBUV: + skipOnLibuv = unittest.skip + + if sysinfo.RUNNING_ON_CI: + skipOnLibuvOnCI = unittest.skip + if sysinfo.PYPY: + skipOnLibuvOnCIOnPyPy = unittest.skip + if sysinfo.RUNNING_ON_TRAVIS: + if sysinfo.CPYTHON: + if sysinfo.PY27_ONLY: + skipOnLibuvOnTravisOnCPython27 = unittest.skip + + if sysinfo.WIN: + skipOnLibuvOnWin = unittest.skip + if sysinfo.PYPY: + skipOnLibuvOnPyPyOnWin = unittest.skip +else: + skipOnLibev = unittest.skip diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/testing/sockets.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/testing/sockets.py new file mode 100644 index 00000000..147da63b --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/testing/sockets.py @@ -0,0 +1,41 @@ +# Copyright (c) 2018 gevent community +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. +from __future__ import absolute_import, print_function, division + +from .params import DEFAULT_BIND_ADDR_TUPLE + +def bind_and_listen(sock, address=DEFAULT_BIND_ADDR_TUPLE, backlog=50, reuse_addr=True): + from socket import SOL_SOCKET, SO_REUSEADDR, error + if reuse_addr: + try: + sock.setsockopt(SOL_SOCKET, SO_REUSEADDR, + sock.getsockopt(SOL_SOCKET, SO_REUSEADDR) | 1) + except error: + pass + sock.bind(address) + sock.listen(backlog) + + +def tcp_listener(address=DEFAULT_BIND_ADDR_TUPLE, backlog=50, reuse_addr=True): + """A shortcut to create a TCP socket, bind it and put it into listening state.""" + from gevent import socket + sock = socket.socket() + bind_and_listen(sock, address, backlog=backlog, reuse_addr=reuse_addr) + return sock diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/testing/switching.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/testing/switching.py new file mode 100644 index 00000000..d846dc8c --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/testing/switching.py @@ -0,0 +1,64 @@ +# Copyright (c) 2018 gevent community +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. +from __future__ import absolute_import, print_function, division + +from functools import wraps + +from gevent.hub import _get_hub + +from .hub import QuietHub + +from .patched_tests_setup import get_switch_expected + +def wrap_switch_count_check(method): + @wraps(method) + def wrapper(self, *args, **kwargs): + initial_switch_count = getattr(_get_hub(), 'switch_count', None) + self.switch_expected = getattr(self, 'switch_expected', True) + if initial_switch_count is not None: + fullname = getattr(self, 'fullname', None) + if self.switch_expected == 'default' and fullname: + self.switch_expected = get_switch_expected(fullname) + result = method(self, *args, **kwargs) + if initial_switch_count is not None and self.switch_expected is not None: + switch_count = _get_hub().switch_count - initial_switch_count + if self.switch_expected is True: + assert switch_count >= 0 + if not switch_count: + raise AssertionError('%s did not switch' % fullname) + elif self.switch_expected is False: + if switch_count: + raise AssertionError('%s switched but not expected to' % fullname) + else: + raise AssertionError('Invalid value for switch_expected: %r' % (self.switch_expected, )) + return result + return wrapper + + + + +class CountingHub(QuietHub): + + switch_count = 0 + + def switch(self, *args): + # pylint:disable=arguments-differ + self.switch_count += 1 + return QuietHub.switch(self, *args) diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/testing/sysinfo.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/testing/sysinfo.py new file mode 100644 index 00000000..b20b595e --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/testing/sysinfo.py @@ -0,0 +1,137 @@ +# Copyright (c) 2018 gevent community +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. + +import os +import sys + +import gevent.core +from gevent import _compat as gsysinfo + +PYPY = gsysinfo.PYPY +CPYTHON = not PYPY +VERBOSE = sys.argv.count('-v') > 1 +WIN = gsysinfo.WIN +LINUX = gsysinfo.LINUX +OSX = gsysinfo.OSX + +PURE_PYTHON = gsysinfo.PURE_PYTHON + +# XXX: Formalize this better +LIBUV = 'libuv' in gevent.core.loop.__module__ # pylint:disable=no-member +CFFI_BACKEND = PYPY or LIBUV or 'cffi' in os.getenv('GEVENT_LOOP', '') + +if '--debug-greentest' in sys.argv: + sys.argv.remove('--debug-greentest') + DEBUG = True +else: + DEBUG = False + +RUN_LEAKCHECKS = os.getenv('GEVENTTEST_LEAKCHECK') +RUN_COVERAGE = os.getenv("COVERAGE_PROCESS_START") or os.getenv("GEVENTTEST_COVERAGE") + +# Generally, ignore the portions that are only implemented +# on particular platforms; they generally contain partial +# implementations completed in different modules. +PLATFORM_SPECIFIC_SUFFIXES = ('2', '279', '3') +if WIN: + PLATFORM_SPECIFIC_SUFFIXES += ('posix',) + +PY2 = None +PY3 = None +PY34 = None +PY35 = None +PY36 = None +PY37 = None + +NON_APPLICABLE_SUFFIXES = () +if sys.version_info[0] == 3: + # Python 3 + NON_APPLICABLE_SUFFIXES += ('2', '279') + PY2 = False + PY3 = True + if sys.version_info[1] >= 4: + PY34 = True + if sys.version_info[1] >= 5: + PY35 = True + if sys.version_info[1] >= 6: + PY36 = True + if sys.version_info[1] >= 7: + PY37 = True + +elif sys.version_info[0] == 2: + # Any python 2 + PY3 = False + PY2 = True + NON_APPLICABLE_SUFFIXES += ('3',) + if (sys.version_info[1] < 7 + or (sys.version_info[1] == 7 and sys.version_info[2] < 9)): + # Python 2, < 2.7.9 + NON_APPLICABLE_SUFFIXES += ('279',) + +PYPY3 = PYPY and PY3 + +PY27_ONLY = sys.version_info[0] == 2 and sys.version_info[1] == 7 + +PYGTE279 = ( + sys.version_info[0] == 2 + and sys.version_info[1] >= 7 + and sys.version_info[2] >= 9 +) + +if WIN: + NON_APPLICABLE_SUFFIXES += ("posix",) + # This is intimately tied to FileObjectPosix + NON_APPLICABLE_SUFFIXES += ("fileobject2",) + SHARED_OBJECT_EXTENSION = ".pyd" +else: + SHARED_OBJECT_EXTENSION = ".so" + + +RUNNING_ON_TRAVIS = os.environ.get('TRAVIS') +RUNNING_ON_APPVEYOR = os.environ.get('APPVEYOR') +RUNNING_ON_CI = RUNNING_ON_TRAVIS or RUNNING_ON_APPVEYOR + +if RUNNING_ON_APPVEYOR: + # We can't exec corecext on appveyor if we haven't run setup.py in + # 'develop' mode (i.e., we install) + NON_APPLICABLE_SUFFIXES += ('corecext',) + +EXPECT_POOR_TIMER_RESOLUTION = (PYPY3 + or RUNNING_ON_APPVEYOR + or (LIBUV and PYPY) + or RUN_COVERAGE) + + +CONN_ABORTED_ERRORS = [] +try: + from errno import WSAECONNABORTED + CONN_ABORTED_ERRORS.append(WSAECONNABORTED) +except ImportError: + pass + +from errno import ECONNRESET +CONN_ABORTED_ERRORS.append(ECONNRESET) + +CONN_ABORTED_ERRORS = frozenset(CONN_ABORTED_ERRORS) + +RESOLVER_ARES = os.getenv('GEVENT_RESOLVER') == 'ares' +RESOLVER_DNSPYTHON = os.getenv('GEVENT_RESOLVER') == 'dnspython' + +RESOLVER_NOT_SYSTEM = RESOLVER_ARES or RESOLVER_DNSPYTHON diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/testing/testcase.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/testing/testcase.py new file mode 100644 index 00000000..c16413b7 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/testing/testcase.py @@ -0,0 +1,340 @@ +# Copyright (c) 2018 gevent community +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. +from __future__ import absolute_import, print_function, division + +import sys +from time import time +import os.path +from contextlib import contextmanager +from unittest import TestCase as BaseTestCase +from functools import wraps + +import gevent + +from . import sysinfo +from . import params +from . import leakcheck +from . import errorhandler +from . import flaky + +from .patched_tests_setup import get_switch_expected + +class TimeAssertMixin(object): + @flaky.reraises_flaky_timeout() + def assertTimeoutAlmostEqual(self, first, second, places=None, msg=None, delta=None): + try: + self.assertAlmostEqual(first, second, places=places, msg=msg, delta=delta) + except AssertionError: + flaky.reraiseFlakyTestTimeout() + + + if sysinfo.EXPECT_POOR_TIMER_RESOLUTION: + # pylint:disable=unused-argument + def assertTimeWithinRange(self, time_taken, min_time, max_time): + return + else: + def assertTimeWithinRange(self, time_taken, min_time, max_time): + self.assertLessEqual(time_taken, max_time) + self.assertGreaterEqual(time_taken, min_time) + + @contextmanager + def runs_in_given_time(self, expected, fuzzy=None): + if fuzzy is None: + if sysinfo.EXPECT_POOR_TIMER_RESOLUTION or sysinfo.LIBUV: + # The noted timer jitter issues on appveyor/pypy3 + fuzzy = expected * 5.0 + else: + fuzzy = expected / 2.0 + start = time() + yield + elapsed = time() - start + try: + self.assertTrue( + expected - fuzzy <= elapsed <= expected + fuzzy, + 'Expected: %r; elapsed: %r; fuzzy %r' % (expected, elapsed, fuzzy)) + except AssertionError: + flaky.reraiseFlakyTestRaceCondition() + + def runs_in_no_time( + self, + fuzzy=(0.01 if not sysinfo.EXPECT_POOR_TIMER_RESOLUTION and not sysinfo.LIBUV else 1.0)): + return self.runs_in_given_time(0.0, fuzzy) + + +def _wrap_timeout(timeout, method): + if timeout is None: + return method + + @wraps(method) + def wrapper(self, *args, **kwargs): + with gevent.Timeout(timeout, 'test timed out', ref=False): + return method(self, *args, **kwargs) + + return wrapper + +def _get_class_attr(classDict, bases, attr, default=AttributeError): + NONE = object() + value = classDict.get(attr, NONE) + if value is not NONE: + return value + for base in bases: + value = getattr(base, attr, NONE) + if value is not NONE: + return value + if default is AttributeError: + raise AttributeError('Attribute %r not found\n%s\n%s\n' % (attr, classDict, bases)) + return default + + +class TestCaseMetaClass(type): + # wrap each test method with + # a) timeout check + # b) fatal error check + # c) restore the hub's error handler (see expect_one_error) + # d) totalrefcount check + def __new__(cls, classname, bases, classDict): + # pylint and pep8 fight over what this should be called (mcs or cls). + # pylint gets it right, but we cant scope disable pep8, so we go with + # its convention. + # pylint: disable=bad-mcs-classmethod-argument + timeout = classDict.get('__timeout__', 'NONE') + if timeout == 'NONE': + timeout = getattr(bases[0], '__timeout__', None) + if sysinfo.RUN_LEAKCHECKS and timeout is not None: + timeout *= 6 + check_totalrefcount = _get_class_attr(classDict, bases, 'check_totalrefcount', True) + + error_fatal = _get_class_attr(classDict, bases, 'error_fatal', True) + uses_handle_error = _get_class_attr(classDict, bases, 'uses_handle_error', True) + # Python 3: must copy, we mutate the classDict. Interestingly enough, + # it doesn't actually error out, but under 3.6 we wind up wrapping + # and re-wrapping the same items over and over and over. + for key, value in list(classDict.items()): + if key.startswith('test') and callable(value): + classDict.pop(key) + # XXX: When did we stop doing this? + #value = wrap_switch_count_check(value) + value = _wrap_timeout(timeout, value) + error_fatal = getattr(value, 'error_fatal', error_fatal) + if error_fatal: + value = errorhandler.wrap_error_fatal(value) + if uses_handle_error: + value = errorhandler.wrap_restore_handle_error(value) + if check_totalrefcount and sysinfo.RUN_LEAKCHECKS: + value = leakcheck.wrap_refcount(value) + classDict[key] = value + return type.__new__(cls, classname, bases, classDict) + +def _noop(): + return + +class SubscriberCleanupMixin(object): + + def setUp(self): + super(SubscriberCleanupMixin, self).setUp() + from gevent import events + self.__old_subscribers = events.subscribers[:] + + def tearDown(self): + from gevent import events + events.subscribers[:] = self.__old_subscribers + super(SubscriberCleanupMixin, self).tearDown() + + +class TestCase(TestCaseMetaClass("NewBase", + (SubscriberCleanupMixin, TimeAssertMixin, BaseTestCase,), + {})): + __timeout__ = params.LOCAL_TIMEOUT if not sysinfo.RUNNING_ON_CI else params.CI_TIMEOUT + + switch_expected = 'default' + error_fatal = True + uses_handle_error = True + close_on_teardown = () + __old_subscribers = () + + def run(self, *args, **kwargs): + # pylint:disable=arguments-differ + if self.switch_expected == 'default': + self.switch_expected = get_switch_expected(self.fullname) + return BaseTestCase.run(self, *args, **kwargs) + + def setUp(self): + super(TestCase, self).setUp() + # Especially if we're running in leakcheck mode, where + # the same test gets executed repeatedly, we need to update the + # current time. Tests don't always go through the full event loop, + # so that doesn't always happen. test__pool.py:TestPoolYYY.test_async + # tends to show timeouts that are too short if we don't. + # XXX: Should some core part of the loop call this? + gevent.get_hub().loop.update_now() + self.close_on_teardown = [] + + def tearDown(self): + if getattr(self, 'skipTearDown', False): + return + + cleanup = getattr(self, 'cleanup', _noop) + cleanup() + self._error = self._none + self._tearDownCloseOnTearDown() + self.close_on_teardown = [] + super(TestCase, self).tearDown() + + def _tearDownCloseOnTearDown(self): + # XXX: Should probably reverse this + for x in self.close_on_teardown: + close = getattr(x, 'close', x) + try: + close() + except Exception: # pylint:disable=broad-except + pass + + @classmethod + def setUpClass(cls): + import warnings + cls._warning_cm = warnings.catch_warnings() + cls._warning_cm.__enter__() + if not sys.warnoptions: + warnings.simplefilter('default') + super(TestCase, cls).setUpClass() + + @classmethod + def tearDownClass(cls): + cls._warning_cm.__exit__(None, None, None) + super(TestCase, cls).tearDownClass() + + def _close_on_teardown(self, resource): + """ + *resource* either has a ``close`` method, or is a + callable. + """ + self.close_on_teardown.append(resource) + return resource + + @property + def testname(self): + return getattr(self, '_testMethodName', '') or getattr(self, '_TestCase__testMethodName') + + @property + def testcasename(self): + return self.__class__.__name__ + '.' + self.testname + + @property + def modulename(self): + return os.path.basename(sys.modules[self.__class__.__module__].__file__).rsplit('.', 1)[0] + + @property + def fullname(self): + return os.path.splitext(os.path.basename(self.modulename))[0] + '.' + self.testcasename + + _none = (None, None, None) + # (context, kind, value) + _error = _none + + def expect_one_error(self): + self.assertEqual(self._error, self._none) + gevent.get_hub().handle_error = self._store_error + + def _store_error(self, where, t, value, tb): + del tb + if self._error != self._none: + gevent.get_hub().parent.throw(t, value) + else: + self._error = (where, t, value) + + def peek_error(self): + return self._error + + def get_error(self): + try: + return self._error + finally: + self._error = self._none + + def assert_error(self, kind=None, value=None, error=None, where_type=None): + if error is None: + error = self.get_error() + econtext, ekind, evalue = error + if kind is not None: + self.assertIsInstance(kind, type) + self.assertIsNotNone( + ekind, + "Error must not be none %r" % (error,)) + assert issubclass(ekind, kind), error + if value is not None: + if isinstance(value, str): + self.assertEqual(str(evalue), value) + else: + self.assertIs(evalue, value) + if where_type is not None: + self.assertIsInstance(econtext, where_type) + return error + + def assertMonkeyPatchedFuncSignatures(self, mod_name, func_names=(), exclude=()): + # We use inspect.getargspec because it's the only thing available + # in Python 2.7, but it is deprecated + # pylint:disable=deprecated-method,too-many-locals + import inspect + import warnings + from gevent.monkey import get_original + # XXX: Very similar to gevent.monkey.patch_module. Should refactor? + gevent_module = getattr(__import__('gevent.' + mod_name), mod_name) + module_name = getattr(gevent_module, '__target__', mod_name) + + funcs_given = True + if not func_names: + funcs_given = False + func_names = getattr(gevent_module, '__implements__') + + for func_name in func_names: + if func_name in exclude: + continue + gevent_func = getattr(gevent_module, func_name) + if not inspect.isfunction(gevent_func) and not funcs_given: + continue + + func = get_original(module_name, func_name) + + try: + with warnings.catch_warnings(): + warnings.simplefilter("ignore") + gevent_sig = inspect.getargspec(gevent_func) + sig = inspect.getargspec(func) + except TypeError: + if funcs_given: + raise + # Can't do this one. If they specifically asked for it, + # it's an error, otherwise it's not. + # Python 3 can check a lot more than Python 2 can. + continue + self.assertEqual(sig.args, gevent_sig.args, func_name) + # The next three might not actually matter? + self.assertEqual(sig.varargs, gevent_sig.varargs, func_name) + self.assertEqual(sig.keywords, gevent_sig.keywords, func_name) + self.assertEqual(sig.defaults, gevent_sig.defaults, func_name) + + def assertEqualFlakyRaceCondition(self, a, b): + try: + self.assertEqual(a, b) + except AssertionError: + flaky.reraiseFlakyTestRaceCondition() + + assertRaisesRegex = getattr(BaseTestCase, 'assertRaisesRegex', + getattr(BaseTestCase, 'assertRaisesRegexp')) diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/testing/testrunner.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/testing/testrunner.py new file mode 100644 index 00000000..2eb4debd --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/testing/testrunner.py @@ -0,0 +1,481 @@ +#!/usr/bin/env python +from __future__ import print_function, absolute_import, division + +import sys +import os +import glob +import traceback +import time +import importlib +from datetime import timedelta + +from multiprocessing.pool import ThreadPool +from multiprocessing import cpu_count +from . import util +from .util import log +from .sysinfo import RUNNING_ON_CI +from .sysinfo import PYPY +from .sysinfo import PY2 +from .sysinfo import RESOLVER_ARES +from .sysinfo import RUN_LEAKCHECKS +from . import six + +# Import this while we're probably single-threaded/single-processed +# to try to avoid issues with PyPy 5.10. +# See https://bitbucket.org/pypy/pypy/issues/2769/systemerror-unexpected-internal-exception +try: + __import__('_testcapi') +except (ImportError, OSError, IOError): + # This can raise a wide variety of errors + pass + +TIMEOUT = 100 +NWORKERS = int(os.environ.get('NWORKERS') or max(cpu_count() - 1, 4)) +if NWORKERS > 10: + NWORKERS = 10 + +if RUN_LEAKCHECKS: + # Capturing the stats takes time, and we run each + # test at least twice + TIMEOUT = 200 + +DEFAULT_RUN_OPTIONS = { + 'timeout': TIMEOUT +} + + +if RUNNING_ON_CI: + # Too many and we get spurious timeouts + NWORKERS = 4 + + + + +def _package_relative_filename(filename, package): + if not os.path.isfile(filename) and package: + # Ok, try to locate it as a module in the package + package_dir = _dir_from_package_name(package) + return os.path.join(package_dir, filename) + return filename + +def _dir_from_package_name(package): + package_mod = importlib.import_module(package) + package_dir = os.path.dirname(package_mod.__file__) + return package_dir + + +def run_many(tests, + configured_failing_tests=(), + failfast=False, + quiet=False, + configured_run_alone_tests=()): + # pylint:disable=too-many-locals,too-many-statements + global NWORKERS + start = time.time() + total = 0 + failed = {} + passed = {} + total_cases = [0] + total_skipped = [0] + + NWORKERS = min(len(tests), NWORKERS) or 1 + + pool = ThreadPool(NWORKERS) + util.BUFFER_OUTPUT = NWORKERS > 1 or quiet + + def run_one(cmd, **kwargs): + kwargs['quiet'] = quiet + result = util.run(cmd, **kwargs) + if result: + if failfast: + sys.exit(1) + failed[result.name] = [cmd, kwargs] + else: + passed[result.name] = True + total_cases[0] += result.run_count + total_skipped[0] += result.skipped_count + + results = [] + + def reap(): + for r in results[:]: + if not r.ready(): + continue + if r.successful(): + results.remove(r) + else: + r.get() + sys.exit('Internal error in testrunner.py: %r' % (r, )) + return len(results) + + def reap_all(): + while reap() > 0: + time.sleep(0.1) + + def spawn(cmd, options): + while True: + if reap() < NWORKERS: + r = pool.apply_async(run_one, (cmd, ), options or {}) + results.append(r) + return + + time.sleep(0.05) + + run_alone = [] + + try: + try: + log("Running tests in parallel with concurrency %s" % (NWORKERS,),) + for cmd, options in tests: + total += 1 + options = options or {} + if matches(configured_run_alone_tests, cmd): + run_alone.append((cmd, options)) + else: + spawn(cmd, options) + pool.close() + pool.join() + + log("Running tests marked standalone") + for cmd, options in run_alone: + run_one(cmd, **options) + + except KeyboardInterrupt: + try: + log('Waiting for currently running to finish...') + reap_all() + except KeyboardInterrupt: + pool.terminate() + report(total, failed, passed, exit=False, took=time.time() - start, + configured_failing_tests=configured_failing_tests, + total_cases=total_cases[0], total_skipped=total_skipped[0]) + log('(partial results)\n') + raise + except: + traceback.print_exc() + pool.terminate() + raise + + reap_all() + report(total, failed, passed, took=time.time() - start, + configured_failing_tests=configured_failing_tests, + total_cases=total_cases[0], total_skipped=total_skipped[0]) + +def discover( + tests=None, ignore_files=None, + ignored=(), coverage=False, + package=None, + configured_ignore_coverage=(), + configured_test_options=None, +): + # pylint:disable=too-many-locals,too-many-branches + configured_test_options = configured_test_options or {} + olddir = os.getcwd() + ignore = set(ignored or ()) + + if ignore_files: + ignore_files = ignore_files.split(',') + for f in ignore_files: + ignore.update(set(load_list_from_file(f, package))) + + if coverage: + ignore.update(configured_ignore_coverage) + + if package: + package_dir = _dir_from_package_name(package) + # We need to glob relative names, our config is based on filenames still + os.chdir(package_dir) + + if not tests: + tests = set(glob.glob('test_*.py')) - set(['test_support.py']) + else: + tests = set(tests) + + if ignore: + # Always ignore the designated list, even if tests were specified + # on the command line. This fixes a nasty interaction with test__threading_vs_settrace.py + # being run under coverage when 'grep -l subprocess test*py' is used to list the tests + # to run. + tests -= ignore + tests = sorted(tests) + + to_process = [] + to_import = [] + + for filename in tests: + module_name = os.path.splitext(filename)[0] + qualified_name = package + '.' + module_name if package else module_name + with open(os.path.abspath(filename), 'rb') as f: + # Some of the test files (e.g., test__socket_dns) are + # UTF8 encoded. Depending on the environment, Python 3 may + # try to decode those as ASCII, which fails with UnicodeDecodeError. + # Thus, be sure to open and compare in binary mode. + # Open the absolute path to make errors more clear, + # but we can't store the absolute path, our configuration is based on + # relative file names. + contents = f.read() + if b'TESTRUNNER' in contents: # test__monkey_patching.py + # XXX: Rework this to avoid importing. + to_import.append(qualified_name) + else: + cmd = [sys.executable, '-u'] + if PYPY and PY2: + # Doesn't seem to be an env var for this + cmd.extend(('-X', 'track-resources')) + if package: + # Using a package is the best way to work with coverage 5 + # when we specify 'source = ' + cmd.append('-m' + qualified_name) + else: + cmd.append(filename) + + options = DEFAULT_RUN_OPTIONS.copy() + options.update(configured_test_options.get(filename, {})) + to_process.append((cmd, options)) + + os.chdir(olddir) + # When we actually execute, do so from the original directory, + # this helps find setup.py + for qualified_name in to_import: + module = importlib.import_module(qualified_name) + for cmd, options in module.TESTRUNNER(): + if remove_options(cmd)[-1] in ignore: + continue + to_process.append((cmd, options)) + + return to_process + + +def remove_options(lst): + return [x for x in lst if x and not x.startswith('-')] + +def load_list_from_file(filename, package): + result = [] + if filename: + with open(_package_relative_filename(filename, package)) as f: + for x in f: + x = x.split('#', 1)[0].strip() + if x: + result.append(x) + return result + + +def matches(possibilities, command, include_flaky=True): + if isinstance(command, list): + command = ' '.join(command) + for line in possibilities: + if not include_flaky and line.startswith('FLAKY '): + continue + line = line.replace('FLAKY ', '') + # Our configs are still mostly written in terms of file names, + # but the non-monkey tests are now using package names. + # Strip off '.py' from filenames to see if we match a module. + # XXX: This could be much better. Our command needs better structure. + if command.endswith(' ' + line) or command.endswith(line.replace(".py", '')): + return True + return False + + +def format_seconds(seconds): + if seconds < 20: + return '%.1fs' % seconds + seconds = str(timedelta(seconds=round(seconds))) + if seconds.startswith('0:'): + seconds = seconds[2:] + return seconds + + +def report(total, failed, passed, exit=True, took=None, + configured_failing_tests=(), + total_cases=0, total_skipped=0): + # pylint:disable=redefined-builtin,too-many-branches,too-many-locals + runtimelog = util.runtimelog + if runtimelog: + log('\nLongest-running tests:') + runtimelog.sort() + length = len('%.1f' % -runtimelog[0][0]) + frmt = '%' + str(length) + '.1f seconds: %s' + for delta, name in runtimelog[:5]: + log(frmt, -delta, name) + if took: + took = ' in %s' % format_seconds(took) + else: + took = '' + + failed_expected = [] + failed_unexpected = [] + passed_unexpected = [] + + for name in passed: + if matches(configured_failing_tests, name, include_flaky=False): + passed_unexpected.append(name) + + if passed_unexpected: + log('\n%s/%s unexpected passes', len(passed_unexpected), total, color='error') + print_list(passed_unexpected) + + if failed: + log('\n%s/%s tests failed%s', len(failed), total, took) + + for name in failed: + if matches(configured_failing_tests, name, include_flaky=True): + failed_expected.append(name) + else: + failed_unexpected.append(name) + + if failed_expected: + log('\n%s/%s expected failures', len(failed_expected), total) + print_list(failed_expected) + + if failed_unexpected: + log('\n%s/%s unexpected failures', len(failed_unexpected), total, color='error') + print_list(failed_unexpected) + else: + log( + '\nRan %s tests%s in %s files%s', + total_cases, + util._colorize('skipped', " (skipped=%d)" % total_skipped) if total_skipped else '', + total, + took, + ) + + if exit: + if failed_unexpected: + sys.exit(min(100, len(failed_unexpected))) + if passed_unexpected: + sys.exit(101) + if total <= 0: + sys.exit('No tests found.') + + +def print_list(lst): + for name in lst: + log(' - %s', name) + +def _setup_environ(debug=False): + if 'PYTHONWARNINGS' not in os.environ and not sys.warnoptions: + + # action:message:category:module:line + os.environ['PYTHONWARNINGS'] = ','.join([ + # Enable default warnings such as ResourceWarning. + 'default', + # On Python 3[.6], the system site.py module has + # "open(fullname, 'rU')" which produces the warning that + # 'U' is deprecated, so ignore warnings from site.py + 'ignore:::site:', + # pkgutil on Python 2 complains about missing __init__.py + 'ignore:::pkgutil', + # importlib/_bootstrap.py likes to spit out "ImportWarning: + # can't resolve package from __spec__ or __package__, falling + # back on __name__ and __path__". I have no idea what that means, but it seems harmless + # and is annoying. + 'ignore:::importlib._bootstrap:', + 'ignore:::importlib._bootstrap_external:', + # importing ABCs from collections, not collections.abc + 'ignore:::pkg_resources._vendor.pyparsing:', + ]) + + if 'PYTHONFAULTHANDLER' not in os.environ: + os.environ['PYTHONFAULTHANDLER'] = 'true' + + if 'GEVENT_DEBUG' not in os.environ and debug: + os.environ['GEVENT_DEBUG'] = 'debug' + + if 'PYTHONTRACEMALLOC' not in os.environ: + os.environ['PYTHONTRACEMALLOC'] = '10' + + if 'PYTHONDEVMODE' not in os.environ: + # Python 3.7 + os.environ['PYTHONDEVMODE'] = '1' + + if 'PYTHONMALLOC' not in os.environ: + # Python 3.6 + os.environ['PYTHONMALLOC'] = 'debug' + + + +def main(): + # pylint:disable=too-many-locals,too-many-statements + import argparse + parser = argparse.ArgumentParser() + parser.add_argument('--ignore') + parser.add_argument('--discover', action='store_true') + parser.add_argument('--full', action='store_true') + parser.add_argument('--config', default='known_failures.py') + parser.add_argument('--failfast', action='store_true') + parser.add_argument("--coverage", action="store_true") + parser.add_argument("--quiet", action="store_true", default=True) + parser.add_argument("--verbose", action="store_false", dest='quiet') + parser.add_argument("--debug", action="store_true", default=False) + parser.add_argument("--package", default="gevent.tests") + parser.add_argument('tests', nargs='*') + options = parser.parse_args() + FAILING_TESTS = [] + IGNORED_TESTS = [] + RUN_ALONE = [] + TEST_FILE_OPTIONS = {} + + coverage = False + if options.coverage or os.environ.get("GEVENTTEST_COVERAGE"): + coverage = True + os.environ['COVERAGE_PROCESS_START'] = os.path.abspath(".coveragerc") + if PYPY: + os.environ['COVERAGE_PROCESS_START'] = os.path.abspath(".coveragerc-pypy") + this_dir = os.path.dirname(__file__) + site_dir = os.path.join(this_dir, 'coveragesite') + site_dir = os.path.abspath(site_dir) + os.environ['PYTHONPATH'] = site_dir + os.pathsep + os.environ.get("PYTHONPATH", "") + # We change directory often, use an absolute path to keep all the + # coverage files (which will have distinct suffixes because of parallel=true in .coveragerc + # in this directory; makes them easier to combine and use with coverage report) + os.environ['COVERAGE_FILE'] = os.path.abspath(".") + os.sep + ".coverage" + print("Enabling coverage to", os.environ['COVERAGE_FILE'], "with site", site_dir) + + _setup_environ(debug=options.debug) + + if options.config: + config = {} + options.config = _package_relative_filename(options.config, options.package) + with open(options.config) as f: + config_data = f.read() + six.exec_(config_data, config) + FAILING_TESTS = config['FAILING_TESTS'] + IGNORED_TESTS = config['IGNORED_TESTS'] + RUN_ALONE = config['RUN_ALONE'] + TEST_FILE_OPTIONS = config['TEST_FILE_OPTIONS'] + IGNORE_COVERAGE = config['IGNORE_COVERAGE'] + + + tests = discover( + options.tests, + ignore_files=options.ignore, + ignored=IGNORED_TESTS, + coverage=coverage, + package=options.package, + configured_ignore_coverage=IGNORE_COVERAGE, + configured_test_options=TEST_FILE_OPTIONS, + ) + if options.discover: + for cmd, options in tests: + print(util.getname(cmd, env=options.get('env'), setenv=options.get('setenv'))) + print('%s tests found.' % len(tests)) + else: + if PYPY and RESOLVER_ARES: + # XXX: Add a way to force these. + print("Not running tests on pypy with c-ares; not a supported configuration") + return + if options.package: + # Put this directory on the path so relative imports work. + package_dir = _dir_from_package_name(options.package) + os.environ['PYTHONPATH'] = os.environ.get('PYTHONPATH', "") + os.pathsep + package_dir + run_many( + tests, + configured_failing_tests=FAILING_TESTS, + failfast=options.failfast, + quiet=options.quiet, + configured_run_alone_tests=RUN_ALONE, + ) + + +if __name__ == '__main__': + main() diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/testing/timing.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/testing/timing.py new file mode 100644 index 00000000..bc62edf0 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/testing/timing.py @@ -0,0 +1,139 @@ +# Copyright (c) 2018 gevent community +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. + +import time + +import gevent + +from . import sysinfo +from . import leakcheck +from .testcase import TestCase + +SMALLEST_RELIABLE_DELAY = 0.001 # 1ms, because of libuv + +SMALL_TICK = 0.01 +SMALL_TICK_MIN_ADJ = SMALLEST_RELIABLE_DELAY +SMALL_TICK_MAX_ADJ = 0.11 +if sysinfo.RUNNING_ON_APPVEYOR: + # Timing resolution is extremely poor on Appveyor + # and subject to jitter. + SMALL_TICK_MAX_ADJ = 1.5 + + +LARGE_TICK = 0.2 +LARGE_TICK_MIN_ADJ = LARGE_TICK / 2.0 +LARGE_TICK_MAX_ADJ = SMALL_TICK_MAX_ADJ + + +class _DelayWaitMixin(object): + + _default_wait_timeout = SMALL_TICK + _default_delay_min_adj = SMALL_TICK_MIN_ADJ + _default_delay_max_adj = SMALL_TICK_MAX_ADJ + + def wait(self, timeout): + raise NotImplementedError('override me in subclass') + + def _check_delay_bounds(self, timeout, delay, + delay_min_adj=None, + delay_max_adj=None): + delay_min_adj = self._default_delay_min_adj if not delay_min_adj else delay_min_adj + delay_max_adj = self._default_delay_max_adj if not delay_max_adj else delay_max_adj + self.assertTimeWithinRange(delay, + timeout - delay_min_adj, + timeout + delay_max_adj) + + def _wait_and_check(self, timeout=None): + if timeout is None: + timeout = self._default_wait_timeout + + # gevent.timer instances have a 'seconds' attribute, + # otherwise it's the raw number + seconds = getattr(timeout, 'seconds', timeout) + + gevent.get_hub().loop.update_now() + start = time.time() + try: + result = self.wait(timeout) + finally: + self._check_delay_bounds(seconds, time.time() - start, + self._default_delay_min_adj, + self._default_delay_max_adj) + return result + + def test_outer_timeout_is_not_lost(self): + timeout = gevent.Timeout.start_new(SMALLEST_RELIABLE_DELAY, ref=False) + try: + with self.assertRaises(gevent.Timeout) as exc: + self.wait(timeout=1) + self.assertIs(exc.exception, timeout) + finally: + timeout.close() + + +class AbstractGenericWaitTestCase(_DelayWaitMixin, TestCase): + # pylint:disable=abstract-method + + _default_wait_timeout = LARGE_TICK + _default_delay_min_adj = LARGE_TICK_MIN_ADJ + _default_delay_max_adj = LARGE_TICK_MAX_ADJ + + @leakcheck.ignores_leakcheck # waiting checks can be very sensitive to timing + def test_returns_none_after_timeout(self): + result = self._wait_and_check() + # join and wait simply return after timeout expires + self.assertIsNone(result) + + +class AbstractGenericGetTestCase(_DelayWaitMixin, TestCase): + # pylint:disable=abstract-method + + Timeout = gevent.Timeout + + def cleanup(self): + pass + + def test_raises_timeout_number(self): + with self.assertRaises(self.Timeout): + self._wait_and_check(timeout=SMALL_TICK) + # get raises Timeout after timeout expired + self.cleanup() + + def test_raises_timeout_Timeout(self): + timeout = gevent.Timeout(self._default_wait_timeout) + try: + self._wait_and_check(timeout=timeout) + except gevent.Timeout as ex: + self.assertIs(ex, timeout) + finally: + timeout.close() + self.cleanup() + + def test_raises_timeout_Timeout_exc_customized(self): + error = RuntimeError('expected error') + timeout = gevent.Timeout(self._default_wait_timeout, exception=error) + try: + with self.assertRaises(RuntimeError) as exc: + self._wait_and_check(timeout=timeout) + + self.assertIs(exc.exception, error) + self.cleanup() + finally: + timeout.close() diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/testing/util.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/testing/util.py new file mode 100644 index 00000000..afcd83ba --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/testing/util.py @@ -0,0 +1,453 @@ +from __future__ import print_function, absolute_import, division +import re +import sys +import os +from . import six +import traceback +import unittest +import threading +import subprocess +import time + +# pylint: disable=broad-except,attribute-defined-outside-init + +runtimelog = [] +MIN_RUNTIME = 1.0 +BUFFER_OUTPUT = False +QUIET = False + + +class Popen(subprocess.Popen): + + def __enter__(self): + return self + + def __exit__(self, *args): + kill(self) + + +# Coloring code based on zope.testrunner + +# These colors are carefully chosen to have enough contrast +# on terminals with both black and white background. +_colorscheme = { + 'normal': 'normal', + 'default': 'default', + 'info': 'normal', + 'suboptimal-behaviour': 'magenta', + 'error': 'brightred', + 'number': 'green', + 'slow-test': 'brightmagenta', + 'ok-number': 'green', + 'error-number': 'brightred', + 'filename': 'lightblue', + 'lineno': 'lightred', + 'testname': 'lightcyan', + 'failed-example': 'cyan', + 'expected-output': 'green', + 'actual-output': 'red', + 'character-diffs': 'magenta', + 'diff-chunk': 'magenta', + 'exception': 'red', + 'skipped': 'brightyellow', +} + +_prefixes = [ + ('dark', '0;'), + ('light', '1;'), + ('bright', '1;'), + ('bold', '1;'), +] + +_colorcodes = { + 'default': 0, + 'normal': 0, + 'black': 30, + 'red': 31, + 'green': 32, + 'brown': 33, 'yellow': 33, + 'blue': 34, + 'magenta': 35, + 'cyan': 36, + 'grey': 37, 'gray': 37, 'white': 37 +} + +def _color_code(color): + prefix_code = '' + for prefix, code in _prefixes: + if color.startswith(prefix): + color = color[len(prefix):] + prefix_code = code + break + color_code = _colorcodes[color] + return '\033[%s%sm' % (prefix_code, color_code) + +def _color(what): + return _color_code(_colorscheme[what]) + +def _colorize(what, message, normal='normal'): + return _color(what) + message + _color(normal) + +def log(message, *args, **kwargs): + color = kwargs.pop('color', 'normal') + try: + if args: + string = message % args + else: + string = message + except Exception: + traceback.print_exc() + try: + string = '%r %% %r\n\n' % (message, args) + except Exception: + pass + try: + string = _colorize('exception', string) + sys.stderr.write(string) + except Exception: + traceback.print_exc() + else: + string = _colorize(color, string) + sys.stderr.write(string + '\n') + + +def killpg(pid): + if not hasattr(os, 'killpg'): + return + try: + return os.killpg(pid, 9) + except OSError as ex: + if ex.errno != 3: + log('killpg(%r, 9) failed: %s: %s', pid, type(ex).__name__, ex) + except Exception as ex: + log('killpg(%r, 9) failed: %s: %s', pid, type(ex).__name__, ex) + + +def kill_processtree(pid): + ignore_msg = 'ERROR: The process "%s" not found.' % pid + err = subprocess.Popen('taskkill /F /PID %s /T' % pid, stderr=subprocess.PIPE).communicate()[1] + if err and err.strip() not in [ignore_msg, '']: + log('%r', err) + + +def _kill(popen): + if hasattr(popen, 'kill'): + try: + popen.kill() + except OSError as ex: + if ex.errno == 3: # No such process + return + if ex.errno == 13: # Permission denied (translated from windows error 5: "Access is denied") + return + raise + else: + try: + os.kill(popen.pid, 9) + except EnvironmentError: + pass + + +def kill(popen): + if popen.timer is not None: + popen.timer.cancel() + if popen.poll() is not None: + return + popen.was_killed = True + try: + if getattr(popen, 'setpgrp_enabled', None): + killpg(popen.pid) + elif sys.platform.startswith('win'): + kill_processtree(popen.pid) + except Exception: + traceback.print_exc() + try: + _kill(popen) + except Exception: + traceback.print_exc() + try: + popen.wait() + except Exception: + traceback.print_exc() + + +def getname(command, env=None, setenv=None): + result = [] + + env = (env or os.environ).copy() + env.update(setenv or {}) + + for key, value in sorted(env.items()): + if key.startswith('GEVENT'): + result.append('%s=%s' % (key, value)) + + if isinstance(command, six.string_types): + result.append(command) + else: + result.extend(command) + + return ' '.join(result) + + +def start(command, quiet=False, **kwargs): + timeout = kwargs.pop('timeout', None) + preexec_fn = None + if not os.environ.get('DO_NOT_SETPGRP'): + preexec_fn = getattr(os, 'setpgrp', None) + env = kwargs.pop('env', None) + setenv = kwargs.pop('setenv', None) or {} + name = getname(command, env=env, setenv=setenv) + if preexec_fn is not None: + setenv['DO_NOT_SETPGRP'] = '1' + if setenv: + if env: + env = env.copy() + else: + env = os.environ.copy() + env.update(setenv) + + if not quiet: + log('+ %s', name) + popen = Popen(command, preexec_fn=preexec_fn, env=env, **kwargs) + popen.name = name + popen.setpgrp_enabled = preexec_fn is not None + popen.was_killed = False + popen.timer = None + if timeout is not None: + t = threading.Timer(timeout, kill, args=(popen, )) + t.setDaemon(True) + t.start() + popen.timer = t + return popen + + +class RunResult(object): + + def __init__(self, code, + output=None, name=None, + run_count=0, skipped_count=0): + self.code = code + self.output = output + self.name = name + self.run_count = run_count + self.skipped_count = skipped_count + + + def __bool__(self): + return bool(self.code) + + __nonzero__ = __bool__ + + def __int__(self): + return self.code + + +def _should_show_warning_output(out): + if 'Warning' in out: + # Strip out some patterns we specifically do not + # care about. + # from test.support for monkey-patched tests + out = out.replace('Warning -- reap_children', 'NADA') + out = out.replace("Warning -- threading_cleanup", 'NADA') + + # The below *could* be done with sophisticated enough warning + # filters passed to the children + + # collections.abc is the new home; setuptools uses the old one, + # as does dnspython + out = out.replace("DeprecationWarning: Using or importing the ABCs", 'NADA') + # libuv poor timer resolution + out = out.replace('UserWarning: libuv only supports', 'NADA') + # Packages on Python 2 + out = out.replace('ImportWarning: Not importing directory', 'NADA') + return 'Warning' in out + +output_lock = threading.Lock() + +def _find_test_status(took, out): + status = '[took %.1fs%s]' + skipped = '' + run_count = 0 + skipped_count = 0 + if out: + m = re.search(r"Ran (\d+) tests in", out) + if m: + result = out[m.start():m.end()] + status = status.replace('took', result) + run_count = int(out[m.start(1):m.end(1)]) + + m = re.search(r' \(skipped=(\d+)\)$', out) + if m: + skipped = _colorize('skipped', out[m.start():m.end()]) + skipped_count = int(out[m.start(1):m.end(1)]) + status = status % (took, skipped) + if took > 10: + status = _colorize('slow-test', status) + return status, run_count, skipped_count + + +def run(command, **kwargs): # pylint:disable=too-many-locals + buffer_output = kwargs.pop('buffer_output', BUFFER_OUTPUT) + quiet = kwargs.pop('quiet', QUIET) + verbose = not quiet + nested = kwargs.pop('nested', False) + if buffer_output: + assert 'stdout' not in kwargs and 'stderr' not in kwargs, kwargs + kwargs['stderr'] = subprocess.STDOUT + kwargs['stdout'] = subprocess.PIPE + popen = start(command, quiet=nested, **kwargs) + name = popen.name + try: + time_start = time.time() + out, err = popen.communicate() + took = time.time() - time_start + if popen.was_killed or popen.poll() is None: + result = 'TIMEOUT' + else: + result = popen.poll() + finally: + kill(popen) + assert not err + with output_lock: # pylint:disable=not-context-manager + failed = bool(result) + if out: + out = out.strip() + out = out if isinstance(out, str) else out.decode('utf-8', 'ignore') + if out and (failed or verbose or _should_show_warning_output(out)): + if out: + out = ' ' + out.replace('\n', '\n ') + out = out.rstrip() + out += '\n' + log('| %s\n%s', name, out) + status, run_count, skipped_count = _find_test_status(took, out) + if result: + log('! %s [code %s] %s', name, result, status, color='error') + elif not nested: + log('- %s %s', name, status) + if took >= MIN_RUNTIME: + runtimelog.append((-took, name)) + return RunResult(result, out, name, run_count, skipped_count) + + +class NoSetupPyFound(Exception): + "Raised by find_setup_py_above" + +def find_setup_py_above(a_file): + "Return the directory containing setup.py somewhere above *a_file*" + root = os.path.dirname(os.path.abspath(a_file)) + while not os.path.exists(os.path.join(root, 'setup.py')): + prev, root = root, os.path.dirname(root) + if root == prev: + # Let's avoid infinite loops at root + raise NoSetupPyFound('could not find my setup.py above %r' % (a_file,)) + return root + +def search_for_setup_py(a_file=None, a_module_name=None, a_class=None, climb_cwd=True): + if a_file is not None: + try: + return find_setup_py_above(a_file) + except NoSetupPyFound: + pass + + if a_class is not None: + try: + return find_setup_py_above(sys.modules[a_class.__module__].__file__) + except NoSetupPyFound: + pass + + if a_module_name is not None: + try: + return find_setup_py_above(sys.modules[a_module_name].__file__) + except NoSetupPyFound: + pass + + if climb_cwd: + return find_setup_py_above("./dne") + + raise NoSetupPyFound("After checking %r" % (locals(),)) + + +class ExampleMixin(object): + "Something that uses the examples/ directory" + + def find_setup_py(self): + "Return the directory containing setup.py" + return search_for_setup_py( + a_file=__file__, + a_class=type(self) + ) + + @property + def cwd(self): + try: + root = self.find_setup_py() + except NoSetupPyFound as e: + raise unittest.SkipTest("Unable to locate file/dir to run: %s" % (e,)) + + return os.path.join(root, 'examples') + +class TestServer(ExampleMixin, + unittest.TestCase): + args = [] + before_delay = 3 + after_delay = 0.5 + popen = None + server = None # subclasses define this to be the path to the server.py + start_kwargs = None + + def start(self): + try: + kwargs = self.start_kwargs or {} + return start([sys.executable, '-u', self.server] + self.args, cwd=self.cwd, **kwargs) + except NoSetupPyFound as e: + raise unittest.SkipTest("Unable to locate file/dir to run: %s" % (e,)) + + def running_server(self): + from contextlib import contextmanager + + @contextmanager + def running_server(): + with self.start() as popen: + self.popen = popen + self.before() + yield + self.after() + return running_server() + + def test(self): + with self.running_server(): + self._run_all_tests() + + def before(self): + if self.before_delay is not None: + time.sleep(self.before_delay) + assert self.popen.poll() is None, '%s died with code %s' % (self.server, self.popen.poll(), ) + + def after(self): + if self.after_delay is not None: + time.sleep(self.after_delay) + assert self.popen.poll() is None, '%s died with code %s' % (self.server, self.popen.poll(), ) + + def _run_all_tests(self): + ran = False + for method in sorted(dir(self)): + if method.startswith('_test'): + function = getattr(self, method) + if callable(function): + function() + ran = True + assert ran + + +class alarm(threading.Thread): + # can't use signal.alarm because of Windows + + def __init__(self, timeout): + threading.Thread.__init__(self) + self.setDaemon(True) + self.timeout = timeout + self.start() + + def run(self): + time.sleep(self.timeout) + sys.stderr.write('Timeout.\n') + os._exit(5) diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/2_7_keycert.pem b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/2_7_keycert.pem new file mode 100644 index 00000000..64318aa2 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/2_7_keycert.pem @@ -0,0 +1,31 @@ +-----BEGIN PRIVATE KEY----- +MIICdwIBADANBgkqhkiG9w0BAQEFAASCAmEwggJdAgEAAoGBANtb0+YrKuxevGpm +LrjaUhZSgz6zFAmuGFmKmUbdjmfv9zSmmdsQIksK++jK0Be9LeZy20j6ahOfuVa0 +ufEmPoP7Fy4hXegKZR9cCWcIe/A6H2xWF1IIJLRTLaU8ol/I7T+um5HD5AwAwNPP +USNU0Eegmvp+xxWu3NX2m1Veot85AgMBAAECgYA3ZdZ673X0oexFlq7AAmrutkHt +CL7LvwrpOiaBjhyTxTeSNWzvtQBkIU8DOI0bIazA4UreAFffwtvEuPmonDb3F+Iq +SMAu42XcGyVZEl+gHlTPU9XRX7nTOXVt+MlRRRxL6t9GkGfUAXI3XxJDXW3c0vBK +UL9xqD8cORXOfE06rQJBAP8mEX1ERkR64Ptsoe4281vjTlNfIbs7NMPkUnrn9N/Y +BLhjNIfQ3HFZG8BTMLfX7kCS9D593DW5tV4Z9BP/c6cCQQDcFzCcVArNh2JSywOQ +ZfTfRbJg/Z5Lt9Fkngv1meeGNPgIMLN8Sg679pAOOWmzdMO3V706rNPzSVMME7E5 +oPIfAkEA8pDddarP5tCvTTgUpmTFbakm0KoTZm2+FzHcnA4jRh+XNTjTOv98Y6Ik +eO5d1ZnKXseWvkZncQgxfdnMqqpj5wJAcNq/RVne1DbYlwWchT2Si65MYmmJ8t+F +0mcsULqjOnEMwf5e+ptq5LzwbyrHZYq5FNk7ocufPv/ZQrcSSC+cFwJBAKvOJByS +x56qyGeZLOQlWS2JS3KJo59XuLFGqcbgN9Om9xFa41Yb4N9NvplFivsvZdw3m1Q/ +SPIXQuT8RMPDVNQ= +-----END PRIVATE KEY----- +-----BEGIN CERTIFICATE----- +MIICVDCCAb2gAwIBAgIJANfHOBkZr8JOMA0GCSqGSIb3DQEBBQUAMF8xCzAJBgNV +BAYTAlhZMRcwFQYDVQQHEw5DYXN0bGUgQW50aHJheDEjMCEGA1UEChMaUHl0aG9u +IFNvZnR3YXJlIEZvdW5kYXRpb24xEjAQBgNVBAMTCWxvY2FsaG9zdDAeFw0xMDEw +MDgyMzAxNTZaFw0yMDEwMDUyMzAxNTZaMF8xCzAJBgNVBAYTAlhZMRcwFQYDVQQH +Ew5DYXN0bGUgQW50aHJheDEjMCEGA1UEChMaUHl0aG9uIFNvZnR3YXJlIEZvdW5k +YXRpb24xEjAQBgNVBAMTCWxvY2FsaG9zdDCBnzANBgkqhkiG9w0BAQEFAAOBjQAw +gYkCgYEA21vT5isq7F68amYuuNpSFlKDPrMUCa4YWYqZRt2OZ+/3NKaZ2xAiSwr7 +6MrQF70t5nLbSPpqE5+5VrS58SY+g/sXLiFd6AplH1wJZwh78DofbFYXUggktFMt +pTyiX8jtP66bkcPkDADA089RI1TQR6Ca+n7HFa7c1fabVV6i3zkCAwEAAaMYMBYw +FAYDVR0RBA0wC4IJbG9jYWxob3N0MA0GCSqGSIb3DQEBBQUAA4GBAHPctQBEQ4wd +BJ6+JcpIraopLn8BGhbjNWj40mmRqWB/NAWF6M5ne7KpGAu7tLeG4hb1zLaldK8G +lxy2GPSRF6LFS48dpEj2HbMv2nvv6xxalDMJ9+DicWgAKTQ6bcX2j3GUkCR0g/T1 +CRlNBAAlvhKzO7Clpf9l0YKBEfraJByX +-----END CERTIFICATE----- diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/__init__.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/__main__.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/__main__.py new file mode 100644 index 00000000..e43891fb --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/__main__.py @@ -0,0 +1,6 @@ +#!/usr/bin/env python +from __future__ import print_function, absolute_import, division + +if __name__ == '__main__': + from gevent.testing import testrunner + testrunner.main() diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/_blocks_at_top_level.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/_blocks_at_top_level.py new file mode 100644 index 00000000..9f907aa6 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/_blocks_at_top_level.py @@ -0,0 +1,3 @@ +from gevent import sleep +sleep(0.01) +x = "done" diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/_import_import_patch.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/_import_import_patch.py new file mode 100644 index 00000000..aa85abd6 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/_import_import_patch.py @@ -0,0 +1 @@ +__import__('_import_patch') diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/_import_patch.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/_import_patch.py new file mode 100644 index 00000000..9d7cc3c3 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/_import_patch.py @@ -0,0 +1,2 @@ +import gevent.monkey +gevent.monkey.patch_all() diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/_import_wait.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/_import_wait.py new file mode 100644 index 00000000..80850a54 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/_import_wait.py @@ -0,0 +1,26 @@ +# test__import_wait.py calls this via an import statement, +# so all of this is happening with import locks held (especially on py2) +import gevent + + +def fn2(): + return 2 + + +# A blocking function doesn't raise LoopExit +def fn(): + return gevent.wait([gevent.spawn(fn2), gevent.spawn(fn2)]) + +gevent.spawn(fn).get() + + +# Marshalling the traceback across greenlets doesn't +# raise LoopExit +def raise_name_error(): + raise NameError("ThisIsExpected") + +try: + gevent.spawn(raise_name_error).get() + raise AssertionError("Should fail") +except NameError as e: + x = e diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/_imports_at_top_level.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/_imports_at_top_level.py new file mode 100644 index 00000000..d11f66b6 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/_imports_at_top_level.py @@ -0,0 +1,2 @@ +# We simply import a stdlib module +__import__('netrc') diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/_imports_imports_at_top_level.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/_imports_imports_at_top_level.py new file mode 100644 index 00000000..00bbf513 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/_imports_imports_at_top_level.py @@ -0,0 +1,13 @@ +import gevent + +# For reproducing #728: We spawn a greenlet at import time, +# that itself wants to import, and wait on it at import time. +# If we're the only greenlet running, and locks aren't granular +# enough, this results in a LoopExit (and also a lock deadlock) + + +def f(): + __import__('_imports_at_top_level') + +g = gevent.spawn(f) +g.get() diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/badcert.pem b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/badcert.pem new file mode 100644 index 00000000..c4191460 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/badcert.pem @@ -0,0 +1,36 @@ +-----BEGIN RSA PRIVATE KEY----- +MIICXwIBAAKBgQC8ddrhm+LutBvjYcQlnH21PPIseJ1JVG2HMmN2CmZk2YukO+9L +opdJhTvbGfEj0DQs1IE8M+kTUyOmuKfVrFMKwtVeCJphrAnhoz7TYOuLBSqt7lVH +fhi/VwovESJlaBOp+WMnfhcduPEYHYx/6cnVapIkZnLt30zu2um+DzA9jQIDAQAB +AoGBAK0FZpaKj6WnJZN0RqhhK+ggtBWwBnc0U/ozgKz2j1s3fsShYeiGtW6CK5nU +D1dZ5wzhbGThI7LiOXDvRucc9n7vUgi0alqPQ/PFodPxAN/eEYkmXQ7W2k7zwsDA +IUK0KUhktQbLu8qF/m8qM86ba9y9/9YkXuQbZ3COl5ahTZrhAkEA301P08RKv3KM +oXnGU2UHTuJ1MAD2hOrPxjD4/wxA/39EWG9bZczbJyggB4RHu0I3NOSFjAm3HQm0 +ANOu5QK9owJBANgOeLfNNcF4pp+UikRFqxk5hULqRAWzVxVrWe85FlPm0VVmHbb/ +loif7mqjU8o1jTd/LM7RD9f2usZyE2psaw8CQQCNLhkpX3KO5kKJmS9N7JMZSc4j +oog58yeYO8BBqKKzpug0LXuQultYv2K4veaIO04iL9VLe5z9S/Q1jaCHBBuXAkEA +z8gjGoi1AOp6PBBLZNsncCvcV/0aC+1se4HxTNo2+duKSDnbq+ljqOM+E7odU+Nq +ewvIWOG//e8fssd0mq3HywJBAJ8l/c8GVmrpFTx8r/nZ2Pyyjt3dH1widooDXYSV +q6Gbf41Llo5sYAtmxdndTLASuHKecacTgZVhy0FryZpLKrU= +-----END RSA PRIVATE KEY----- +-----BEGIN CERTIFICATE----- +Just bad cert data +-----END CERTIFICATE----- +-----BEGIN RSA PRIVATE KEY----- +MIICXwIBAAKBgQC8ddrhm+LutBvjYcQlnH21PPIseJ1JVG2HMmN2CmZk2YukO+9L +opdJhTvbGfEj0DQs1IE8M+kTUyOmuKfVrFMKwtVeCJphrAnhoz7TYOuLBSqt7lVH +fhi/VwovESJlaBOp+WMnfhcduPEYHYx/6cnVapIkZnLt30zu2um+DzA9jQIDAQAB +AoGBAK0FZpaKj6WnJZN0RqhhK+ggtBWwBnc0U/ozgKz2j1s3fsShYeiGtW6CK5nU +D1dZ5wzhbGThI7LiOXDvRucc9n7vUgi0alqPQ/PFodPxAN/eEYkmXQ7W2k7zwsDA +IUK0KUhktQbLu8qF/m8qM86ba9y9/9YkXuQbZ3COl5ahTZrhAkEA301P08RKv3KM +oXnGU2UHTuJ1MAD2hOrPxjD4/wxA/39EWG9bZczbJyggB4RHu0I3NOSFjAm3HQm0 +ANOu5QK9owJBANgOeLfNNcF4pp+UikRFqxk5hULqRAWzVxVrWe85FlPm0VVmHbb/ +loif7mqjU8o1jTd/LM7RD9f2usZyE2psaw8CQQCNLhkpX3KO5kKJmS9N7JMZSc4j +oog58yeYO8BBqKKzpug0LXuQultYv2K4veaIO04iL9VLe5z9S/Q1jaCHBBuXAkEA +z8gjGoi1AOp6PBBLZNsncCvcV/0aC+1se4HxTNo2+duKSDnbq+ljqOM+E7odU+Nq +ewvIWOG//e8fssd0mq3HywJBAJ8l/c8GVmrpFTx8r/nZ2Pyyjt3dH1widooDXYSV +q6Gbf41Llo5sYAtmxdndTLASuHKecacTgZVhy0FryZpLKrU= +-----END RSA PRIVATE KEY----- +-----BEGIN CERTIFICATE----- +Just bad cert data +-----END CERTIFICATE----- diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/badkey.pem b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/badkey.pem new file mode 100644 index 00000000..1c8a9557 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/badkey.pem @@ -0,0 +1,40 @@ +-----BEGIN RSA PRIVATE KEY----- +Bad Key, though the cert should be OK +-----END RSA PRIVATE KEY----- +-----BEGIN CERTIFICATE----- +MIICpzCCAhCgAwIBAgIJAP+qStv1cIGNMA0GCSqGSIb3DQEBBQUAMIGJMQswCQYD +VQQGEwJVUzERMA8GA1UECBMIRGVsYXdhcmUxEzARBgNVBAcTCldpbG1pbmd0b24x +IzAhBgNVBAoTGlB5dGhvbiBTb2Z0d2FyZSBGb3VuZGF0aW9uMQwwCgYDVQQLEwNT +U0wxHzAdBgNVBAMTFnNvbWVtYWNoaW5lLnB5dGhvbi5vcmcwHhcNMDcwODI3MTY1 +NDUwWhcNMTMwMjE2MTY1NDUwWjCBiTELMAkGA1UEBhMCVVMxETAPBgNVBAgTCERl +bGF3YXJlMRMwEQYDVQQHEwpXaWxtaW5ndG9uMSMwIQYDVQQKExpQeXRob24gU29m +dHdhcmUgRm91bmRhdGlvbjEMMAoGA1UECxMDU1NMMR8wHQYDVQQDExZzb21lbWFj +aGluZS5weXRob24ub3JnMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC8ddrh +m+LutBvjYcQlnH21PPIseJ1JVG2HMmN2CmZk2YukO+9LopdJhTvbGfEj0DQs1IE8 +M+kTUyOmuKfVrFMKwtVeCJphrAnhoz7TYOuLBSqt7lVHfhi/VwovESJlaBOp+WMn +fhcduPEYHYx/6cnVapIkZnLt30zu2um+DzA9jQIDAQABoxUwEzARBglghkgBhvhC +AQEEBAMCBkAwDQYJKoZIhvcNAQEFBQADgYEAF4Q5BVqmCOLv1n8je/Jw9K669VXb +08hyGzQhkemEBYQd6fzQ9A/1ZzHkJKb1P6yreOLSEh4KcxYPyrLRC1ll8nr5OlCx +CMhKkTnR6qBsdNV0XtdU2+N25hqW+Ma4ZeqsN/iiJVCGNOZGnvQuvCAGWF8+J/f/ +iHkC6gGdBJhogs4= +-----END CERTIFICATE----- +-----BEGIN RSA PRIVATE KEY----- +Bad Key, though the cert should be OK +-----END RSA PRIVATE KEY----- +-----BEGIN CERTIFICATE----- +MIICpzCCAhCgAwIBAgIJAP+qStv1cIGNMA0GCSqGSIb3DQEBBQUAMIGJMQswCQYD +VQQGEwJVUzERMA8GA1UECBMIRGVsYXdhcmUxEzARBgNVBAcTCldpbG1pbmd0b24x +IzAhBgNVBAoTGlB5dGhvbiBTb2Z0d2FyZSBGb3VuZGF0aW9uMQwwCgYDVQQLEwNT +U0wxHzAdBgNVBAMTFnNvbWVtYWNoaW5lLnB5dGhvbi5vcmcwHhcNMDcwODI3MTY1 +NDUwWhcNMTMwMjE2MTY1NDUwWjCBiTELMAkGA1UEBhMCVVMxETAPBgNVBAgTCERl +bGF3YXJlMRMwEQYDVQQHEwpXaWxtaW5ndG9uMSMwIQYDVQQKExpQeXRob24gU29m +dHdhcmUgRm91bmRhdGlvbjEMMAoGA1UECxMDU1NMMR8wHQYDVQQDExZzb21lbWFj +aGluZS5weXRob24ub3JnMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC8ddrh +m+LutBvjYcQlnH21PPIseJ1JVG2HMmN2CmZk2YukO+9LopdJhTvbGfEj0DQs1IE8 +M+kTUyOmuKfVrFMKwtVeCJphrAnhoz7TYOuLBSqt7lVHfhi/VwovESJlaBOp+WMn +fhcduPEYHYx/6cnVapIkZnLt30zu2um+DzA9jQIDAQABoxUwEzARBglghkgBhvhC +AQEEBAMCBkAwDQYJKoZIhvcNAQEFBQADgYEAF4Q5BVqmCOLv1n8je/Jw9K669VXb +08hyGzQhkemEBYQd6fzQ9A/1ZzHkJKb1P6yreOLSEh4KcxYPyrLRC1ll8nr5OlCx +CMhKkTnR6qBsdNV0XtdU2+N25hqW+Ma4ZeqsN/iiJVCGNOZGnvQuvCAGWF8+J/f/ +iHkC6gGdBJhogs4= +-----END CERTIFICATE----- diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/getaddrinfo_module.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/getaddrinfo_module.py new file mode 100644 index 00000000..75a25dff --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/getaddrinfo_module.py @@ -0,0 +1,4 @@ +import socket +import gevent.socket as gevent_socket + +gevent_socket.getaddrinfo(u'gevent.org', None, socket.AF_INET) diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/hosts_file.txt b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/hosts_file.txt new file mode 100644 index 00000000..a33da688 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/hosts_file.txt @@ -0,0 +1,10351 @@ +## +# Host Database +# +# localhost is used to configure the loopback interface +# when the system is booting. Do not change this entry. +## +127.0.0.1 localhost Localhost localhost.localdomain testsite.mc.com mathcounts.mc.com platform.osu.edu + +255.255.255.255 broadcasthost +::1 localhost +fe80::1%lo0 localhost +172.178.0.51 excelsior excelsior.example.com +162.168.8.27 memoryprime.local memoryprime +122.168.9.64 isy.local isy + + +192.168.1.172 drivefoo.local + +172.168.15.95 aragefoo.local +172.168.15.105 livgfoo.local +172.168.16.109 upsirsfoo.local +172.168.15.140 bacorthfoo.local +172.168.15.142 bacouthfoo.local +172.168.16.144 drisfoo.local +172.168.15.152 nghborfoo.local +172.168.15.154 fntfoo.local +172.168.18.151 as.local + +# Internals +146.120.241.22 ds3 +146.120.241.23 ds4 +146.120.241.21 ds2 +146.120.241.20 ds1 + + +# Not blocked by Mar 18 2013 +0.0.0.0 h.ppjol.com +0.0.0.0 s.ppjol.net +0.0.0.0 yayfollowers.com +0.0.0.0 pagead2.googlesyndication.com +0.0.0.0 www.googletagservices.com +0.0.0.0 cdn.teads.tv +0.0.0.0 js.moatads.com +0.0.0.0 cdn2.teads.tv + + +# This hosts file is brought to you by Dan Pollock and can be found at +# http://someonewhocares.org/hosts/zero/ + +# +# For example, to block unpleasant pages, try: +0.0.0.0 goatse.cx # More information on sites such as +0.0.0.0 www.goatse.cx # these can be found in this article +0.0.0.0 oralse.cx # en.wikipedia.org/wiki/List_of_shock_sites +0.0.0.0 www.oralse.cx +0.0.0.0 goatse.ca +0.0.0.0 www.goatse.ca +0.0.0.0 oralse.ca +0.0.0.0 www.oralse.ca +0.0.0.0 goat.cx +0.0.0.0 www.goat.cx +0.0.0.0 goatse.ru +0.0.0.0 www.goatse.ru + +0.0.0.0 1girl1pitcher.com +0.0.0.0 1girl1pitcher.org +0.0.0.0 1guy1cock.com +0.0.0.0 1man1jar.org +0.0.0.0 1man2needles.com +0.0.0.0 1priest1nun.com +0.0.0.0 2girls1cup.com +0.0.0.0 2girls1cup-free.com +0.0.0.0 2girls1cup.nl +0.0.0.0 2girls1cup.ws +0.0.0.0 2girls1finger.com +0.0.0.0 2girls1finger.org +0.0.0.0 2guys1stump.org +0.0.0.0 3guys1hammer.ws +0.0.0.0 4girlsfingerpaint.com +0.0.0.0 4girlsfingerpaint.org +0.0.0.0 bagslap.com +0.0.0.0 ballsack.org +0.0.0.0 bluewaffle.biz +0.0.0.0 bottleguy.com +0.0.0.0 bowlgirl.com +0.0.0.0 cadaver.org +0.0.0.0 clownsong.com +0.0.0.0 copyright-reform.info +0.0.0.0 cshacks.partycat.us +0.0.0.0 cyberscat.com +0.0.0.0 dadparty.com +0.0.0.0 detroithardcore.com +0.0.0.0 donotwatch.org +0.0.0.0 dontwatch.us +0.0.0.0 eelsoup.net +0.0.0.0 fruitlauncher.com +0.0.0.0 fuck.org +0.0.0.0 funnelchair.com +0.0.0.0 goatse.bz +0.0.0.0 goatsegirl.org +0.0.0.0 goatse.ru +0.0.0.0 hai2u.com +0.0.0.0 homewares.org +0.0.0.0 howtotroll.org +0.0.0.0 japscat.org +0.0.0.0 jiztini.com +0.0.0.0 junecleeland.com +0.0.0.0 kids-in-sandbox.com +0.0.0.0 kidsinsandbox.info +0.0.0.0 lemonparty.biz +0.0.0.0 lemonparty.org +0.0.0.0 lolhello.com +0.0.0.0 loltrain.com +0.0.0.0 meatspin.biz +0.0.0.0 meatspin.com +0.0.0.0 merryholidays.org +0.0.0.0 milkfountain.com +0.0.0.0 mudfall.com +0.0.0.0 mudmonster.org +0.0.0.0 nimp.org +0.0.0.0 nobrain.dk +0.0.0.0 nutabuse.com +0.0.0.0 octopusgirl.com +0.0.0.0 on.nimp.org +0.0.0.0 painolympics.info +0.0.0.0 phonejapan.com +0.0.0.0 pressurespot.com +0.0.0.0 prolapseman.com +0.0.0.0 scrollbelow.com +0.0.0.0 selfpwn.org +0.0.0.0 sexitnow.com +0.0.0.0 sourmath.com +0.0.0.0 suckdude.com +0.0.0.0 thatsjustgay.com +0.0.0.0 thatsphucked.com +0.0.0.0 thehomo.org +0.0.0.0 themacuser.org +0.0.0.0 thepounder.com +0.0.0.0 tubgirl.me +0.0.0.0 tubgirl.org +0.0.0.0 turdgasm.com +0.0.0.0 vomitgirl.org +0.0.0.0 walkthedinosaur.com +0.0.0.0 whipcrack.org +0.0.0.0 wormgush.com +0.0.0.0 www.1girl1pitcher.org +0.0.0.0 www.1guy1cock.com +0.0.0.0 www.1man1jar.org +0.0.0.0 www.1man2needles.com +0.0.0.0 www.1priest1nun.com +0.0.0.0 www.2girls1cup-free.com +0.0.0.0 www.2girls1cup.nl +0.0.0.0 www.2girls1cup.ws +0.0.0.0 www.2girls1finger.org +0.0.0.0 www.2guys1stump.org +0.0.0.0 www.3guys1hammer.ws +0.0.0.0 www.4girlsfingerpaint.org +0.0.0.0 www.bagslap.com +0.0.0.0 www.ballsack.org +0.0.0.0 www.bluewaffle.biz +0.0.0.0 www.bottleguy.com +0.0.0.0 www.bowlgirl.com +0.0.0.0 www.cadaver.org +0.0.0.0 www.clownsong.com +0.0.0.0 www.copyright-reform.info +0.0.0.0 www.cshacks.partycat.us +0.0.0.0 www.cyberscat.com +0.0.0.0 www.dadparty.com +0.0.0.0 www.detroithardcore.com +0.0.0.0 www.donotwatch.org +0.0.0.0 www.dontwatch.us +0.0.0.0 www.eelsoup.net +0.0.0.0 www.fruitlauncher.com +0.0.0.0 www.fuck.org +0.0.0.0 www.funnelchair.com +0.0.0.0 www.goatse.bz +0.0.0.0 www.goatsegirl.org +0.0.0.0 www.goatse.ru +0.0.0.0 www.hai2u.com +0.0.0.0 www.homewares.org +0.0.0.0 www.howtotroll.org +0.0.0.0 www.japscat.org +0.0.0.0 www.jiztini.com +0.0.0.0 www.junecleeland.com +0.0.0.0 www.kids-in-sandbox.com +0.0.0.0 www.kidsinsandbox.info +0.0.0.0 www.lemonparty.biz +0.0.0.0 www.lemonparty.org +0.0.0.0 www.lolhello.com +0.0.0.0 www.loltrain.com +0.0.0.0 www.meatspin.biz +0.0.0.0 www.meatspin.com +0.0.0.0 www.merryholidays.org +0.0.0.0 www.milkfountain.com +0.0.0.0 www.mudfall.com +0.0.0.0 www.mudmonster.org +0.0.0.0 www.nimp.org +0.0.0.0 www.nobrain.dk +0.0.0.0 www.nutabuse.com +0.0.0.0 www.octopusgirl.com +0.0.0.0 www.on.nimp.org +0.0.0.0 www.painolympics.info +0.0.0.0 www.phonejapan.com +0.0.0.0 www.pressurespot.com +0.0.0.0 www.prolapseman.com +0.0.0.0 www.punishtube.com +0.0.0.0 www.scrollbelow.com +0.0.0.0 www.selfpwn.org +0.0.0.0 www.sourmath.com +0.0.0.0 www.suckdude.com +0.0.0.0 www.thatsjustgay.com +0.0.0.0 www.thatsphucked.com +0.0.0.0 www.theexgirlfriends.com +0.0.0.0 www.thehomo.org +0.0.0.0 www.themacuser.org +0.0.0.0 www.thepounder.com +0.0.0.0 www.tubgirl.me +0.0.0.0 www.tubgirl.org +0.0.0.0 www.turdgasm.com +0.0.0.0 www.vomitgirl.org +0.0.0.0 www.walkthedinosaur.com +0.0.0.0 www.whipcrack.org +0.0.0.0 www.wormgush.com +0.0.0.0 www.xvideoslive.com +0.0.0.0 www.y8.com +0.0.0.0 www.youaresogay.com +0.0.0.0 www.ypmate.com +0.0.0.0 www.zentastic.com +0.0.0.0 youaresogay.com +0.0.0.0 zentastic.com +# + +0.0.0.0 ads234.com +0.0.0.0 ads345.com +0.0.0.0 www.ads234.com +0.0.0.0 www.ads345.com +# + + +# + +# +0.0.0.0 auto.search.msn.com # Microsoft uses this server to redirect + # mistyped URLs to search engines. They + # log all such errors. +0.0.0.0 sitefinder.verisign.com # Verisign has joined the game +0.0.0.0 sitefinder-idn.verisign.com # of trying to hijack mistyped + # URLs to their site. + # May break iOS Game Center. + +0.0.0.0 s0.2mdn.net # This may interfere with some streaming + # video on sites such as cbc.ca +0.0.0.0 ad.doubleclick.net # This may interefere with www.sears.com + # and potentially other sites. +0.0.0.0 media.fastclick.net # Likewise, this may interfere with some +0.0.0.0 cdn.fastclick.net # sites. +0.0.0.0 ebay.doubleclick.net # may interfere with ebay +#0.0.0.0 google-analytics.com # breaks some sites +#0.0.0.0 ssl.google-analytics.com +#0.0.0.0 www.google-analytics.l.google.com +0.0.0.0 stat.livejournal.com # There are reports that this may mess + # up CSS on livejournal +0.0.0.0 stats.surfaid.ihost.com # This has been known cause + # problems with NPR.org +0.0.0.0 www.google-analytics.com # breaks some sites +0.0.0.0 ads.imeem.com # Seems to interfere with the functioning of imeem.com +# + +0.0.0.0 006.free-counter.co.uk +0.0.0.0 006.freecounters.co.uk +0.0.0.0 06272002-dbase.hitcountz.net # Web bugs in spam +0.0.0.0 123counter.mycomputer.com +0.0.0.0 123counter.superstats.com +0.0.0.0 1ca.cqcounter.com +0.0.0.0 1uk.cqcounter.com +0.0.0.0 1us.cqcounter.com +0.0.0.0 1xxx.cqcounter.com +0.0.0.0 2001-007.com +0.0.0.0 3bc3fd26-91cf-46b2-8ec6-b1559ada0079.statcamp.net +0.0.0.0 3ps.go.com +0.0.0.0 4-counter.com +0.0.0.0 a796faee-7163-4757-a34f-e5b48cada4cb.statcamp.net +0.0.0.0 abscbn.spinbox.net +0.0.0.0 activity.serving-sys.com #eyeblaster.com +0.0.0.0 adadvisor.net +0.0.0.0 adclient.rottentomatoes.com +0.0.0.0 adcodes.aim4media.com +0.0.0.0 adcounter.globeandmail.com +0.0.0.0 adcounter.theglobeandmail.com +0.0.0.0 addfreestats.com +0.0.0.0 ademails.com +0.0.0.0 adlog.com.com # Used by Ziff Davis to serve + # ads and track users across + # the com.com family of sites +0.0.0.0 ad-logics.com +0.0.0.0 admanmail.com +0.0.0.0 adopt.specificclick.net +0.0.0.0 ads.tiscali.com +0.0.0.0 ads.tiscali.it +0.0.0.0 adult.foxcounter.com +0.0.0.0 affiliate.ab1trk.com +0.0.0.0 affiliate.irotracker.com +0.0.0.0 ai062.insightexpress.com +0.0.0.0 ai078.insightexpressai.com +0.0.0.0 ai087.insightexpress.com +0.0.0.0 ai113.insightexpressai.com +0.0.0.0 ai125.insightexpressai.com +0.0.0.0 alpha.easy-hit-counters.com +0.0.0.0 amateur.xxxcounter.com +0.0.0.0 amer.hops.glbdns.microsoft.com +0.0.0.0 amer.rel.msn.com +0.0.0.0 analytics.msnbc.msn.com +0.0.0.0 analytics.prx.org +0.0.0.0 anm.intelli-direct.com +0.0.0.0 ant.conversive.nl +0.0.0.0 apac.rel.msn.com +0.0.0.0 api.bizographics.com +0.0.0.0 apprep.smartscreen.microsoft.com +0.0.0.0 app.yesware.com +0.0.0.0 arbo.hit.gemius.pl +0.0.0.0 au052.insightexpress.com +0.0.0.0 auspice.augur.io +0.0.0.0 au.track.decideinteractive.com +0.0.0.0 a.visualrevenue.com +0.0.0.0 banner.0catch.com +0.0.0.0 banners.webcounter.com +0.0.0.0 beacon-1.newrelic.com +0.0.0.0 beacon.scorecardresearch.com +0.0.0.0 beacons.hottraffic.nl +0.0.0.0 be.sitestat.com +0.0.0.0 best-search.cc #spyware +0.0.0.0 beta.easy-hit-counter.com +0.0.0.0 beta.easy-hit-counters.com +0.0.0.0 beta.easyhitcounters.com +0.0.0.0 bilbo.counted.com +0.0.0.0 bin.clearspring.com +0.0.0.0 birta.stats.is +0.0.0.0 bluekai.com +0.0.0.0 bluestreak.com +0.0.0.0 bookproplus.com +0.0.0.0 broadcastpc.tv +0.0.0.0 report.broadcastpc.tv +0.0.0.0 www.broadcastpc.tv +0.0.0.0 bserver.blick.com +0.0.0.0 bstats.adbrite.com +0.0.0.0 b.stats.paypal.com +0.0.0.0 by.optimost.com +0.0.0.0 c10.statcounter.com +0.0.0.0 c11.statcounter.com +0.0.0.0 c12.statcounter.com +0.0.0.0 c13.statcounter.com +0.0.0.0 c14.statcounter.com +0.0.0.0 c15.statcounter.com +0.0.0.0 c16.statcounter.com +0.0.0.0 c17.statcounter.com +0.0.0.0 c1.statcounter.com +0.0.0.0 c1.thecounter.com +0.0.0.0 c1.thecounter.de +0.0.0.0 c1.xxxcounter.com +0.0.0.0 c2.gostats.com +0.0.0.0 c2.thecounter.com +0.0.0.0 c2.thecounter.de +0.0.0.0 c2.xxxcounter.com +0.0.0.0 c3.gostats.com +0.0.0.0 c3.statcounter.com +0.0.0.0 c3.thecounter.com +0.0.0.0 c3.xxxcounter.com +0.0.0.0 c4.myway.com +0.0.0.0 c4.statcounter.com +0.0.0.0 c5.statcounter.com +0.0.0.0 c6.statcounter.com +0.0.0.0 c7.statcounter.com +0.0.0.0 c8.statcounter.com +0.0.0.0 c9.statcounter.com +0.0.0.0 ca.cqcounter.com +0.0.0.0 cashcounter.com +0.0.0.0 cb1.counterbot.com +0.0.0.0 cdn.krxd.net +0.0.0.0 cdn.oggifinogi.com +0.0.0.0 cdn.taboolasyndication.com +0.0.0.0 cdxbin.vulnerap.com +0.0.0.0 cf.addthis.com +0.0.0.0 cgicounter.onlinehome.de +0.0.0.0 cgicounter.puretec.de +0.0.0.0 cgi.hotstat.nl +0.0.0.0 cgi.sexlist.com +0.0.0.0 ci-mpsnare.iovation.com # See http://www.codingthewheel.com/archives/online-gambling-privacy-iesnare +0.0.0.0 citrix.tradedoubler.com +0.0.0.0 cjt1.net +0.0.0.0 click.atdmt.com +0.0.0.0 clickauditor.net +0.0.0.0 click.fivemtn.com +0.0.0.0 click.investopedia.com +0.0.0.0 click.jve.net +0.0.0.0 clickmeter.com +0.0.0.0 click.payserve.com +0.0.0.0 clicks.emarketmakers.com +0.0.0.0 click.silvercash.com +0.0.0.0 clicks.m4n.nl +0.0.0.0 clicks.natwest.com +0.0.0.0 clickspring.net #used by a spyware product called PurityScan +0.0.0.0 clicks.rbs.co.uk +0.0.0.0 clicktrack.onlineemailmarketing.com +0.0.0.0 clicktracks.webmetro.com +0.0.0.0 clit10.sextracker.com +0.0.0.0 clit13.sextracker.com +0.0.0.0 clit15.sextracker.com +0.0.0.0 clit2.sextracker.com +0.0.0.0 clit4.sextracker.com +0.0.0.0 clit6.sextracker.com +0.0.0.0 clit7.sextracker.com +0.0.0.0 clit8.sextracker.com +0.0.0.0 clit9.sextracker.com +0.0.0.0 clk.aboxdeal.com +0.0.0.0 clk.relestar.com +0.0.0.0 cnn.entertainment.printthis.clickability.com +0.0.0.0 cnt.xcounter.com +0.0.0.0 collector.deepmetrix.com +0.0.0.0 collector.newsx.cc +0.0.0.0 connectionlead.com +0.0.0.0 connexity.net +0.0.0.0 cookies.cmpnet.com +0.0.0.0 count.channeladvisor.com +0.0.0.0 counter10.bravenet.com +0.0.0.0 counter10.sextracker.be +0.0.0.0 counter10.sextracker.com +0.0.0.0 counter11.bravenet.com +0.0.0.0 counter11.sextracker.be +0.0.0.0 counter11.sextracker.com +0.0.0.0 counter.123counts.com +0.0.0.0 counter12.bravenet.com +0.0.0.0 counter12.sextracker.be +0.0.0.0 counter12.sextracker.com +0.0.0.0 counter13.bravenet.com +0.0.0.0 counter13.sextracker.be +0.0.0.0 counter13.sextracker.com +0.0.0.0 counter14.bravenet.com +0.0.0.0 counter14.sextracker.be +0.0.0.0 counter14.sextracker.com +0.0.0.0 counter15.bravenet.com +0.0.0.0 counter15.sextracker.be +0.0.0.0 counter15.sextracker.com +0.0.0.0 counter16.bravenet.com +0.0.0.0 counter16.sextracker.be +0.0.0.0 counter16.sextracker.com +0.0.0.0 counter17.bravenet.com +0.0.0.0 counter18.bravenet.com +0.0.0.0 counter19.bravenet.com +0.0.0.0 counter1.bravenet.com +0.0.0.0 counter1.sextracker.be +0.0.0.0 counter1.sextracker.com +0.0.0.0 counter.1stblaze.com +0.0.0.0 counter20.bravenet.com +0.0.0.0 counter21.bravenet.com +0.0.0.0 counter22.bravenet.com +0.0.0.0 counter23.bravenet.com +0.0.0.0 counter24.bravenet.com +0.0.0.0 counter25.bravenet.com +0.0.0.0 counter26.bravenet.com +0.0.0.0 counter27.bravenet.com +0.0.0.0 counter28.bravenet.com +0.0.0.0 counter29.bravenet.com +0.0.0.0 counter2.bravenet.com +0.0.0.0 counter2.freeware.de +0.0.0.0 counter2.hitslink.com +0.0.0.0 counter2.sextracker.be +0.0.0.0 counter2.sextracker.com +0.0.0.0 counter30.bravenet.com +0.0.0.0 counter31.bravenet.com +0.0.0.0 counter32.bravenet.com +0.0.0.0 counter33.bravenet.com +0.0.0.0 counter34.bravenet.com +0.0.0.0 counter35.bravenet.com +0.0.0.0 counter36.bravenet.com +0.0.0.0 counter37.bravenet.com +0.0.0.0 counter38.bravenet.com +0.0.0.0 counter39.bravenet.com +0.0.0.0 counter3.bravenet.com +0.0.0.0 counter3.sextracker.be +0.0.0.0 counter3.sextracker.com +0.0.0.0 counter40.bravenet.com +0.0.0.0 counter41.bravenet.com +0.0.0.0 counter42.bravenet.com +0.0.0.0 counter43.bravenet.com +0.0.0.0 counter44.bravenet.com +0.0.0.0 counter45.bravenet.com +0.0.0.0 counter46.bravenet.com +0.0.0.0 counter47.bravenet.com +0.0.0.0 counter48.bravenet.com +0.0.0.0 counter49.bravenet.com +0.0.0.0 counter4all.dk +0.0.0.0 counter4.bravenet.com +0.0.0.0 counter4.sextracker.be +0.0.0.0 counter4.sextracker.com +0.0.0.0 counter4u.de +0.0.0.0 counter50.bravenet.com +0.0.0.0 counter5.bravenet.com +0.0.0.0 counter5.sextracker.be +0.0.0.0 counter5.sextracker.com +0.0.0.0 counter6.bravenet.com +0.0.0.0 counter6.sextracker.be +0.0.0.0 counter6.sextracker.com +0.0.0.0 counter7.bravenet.com +0.0.0.0 counter7.sextracker.be +0.0.0.0 counter7.sextracker.com +0.0.0.0 counter8.bravenet.com +0.0.0.0 counter8.sextracker.be +0.0.0.0 counter8.sextracker.com +0.0.0.0 counter9.bravenet.com +0.0.0.0 counter9.sextracker.be +0.0.0.0 counter9.sextracker.com +0.0.0.0 counter.aaddzz.com +0.0.0.0 counterad.de +0.0.0.0 counter.adultcheck.com +0.0.0.0 counter.adultrevenueservice.com +0.0.0.0 counter.advancewebhosting.com +0.0.0.0 counter.aport.ru +0.0.0.0 counteraport.spylog.com +0.0.0.0 counter.asexhound.com +0.0.0.0 counter.avp2000.com +0.0.0.0 counter.bizland.com +0.0.0.0 counter.bloke.com +0.0.0.0 counterbot.com +0.0.0.0 counter.clubnet.ro +0.0.0.0 counter.cnw.cz +0.0.0.0 countercrazy.com +0.0.0.0 counter.credo.ru +0.0.0.0 counter.cz +0.0.0.0 counter.digits.com +0.0.0.0 counter.dreamhost.com +0.0.0.0 counter.e-audit.it +0.0.0.0 counter.execpc.com +0.0.0.0 counter.fateback.com +0.0.0.0 counter.gamespy.com +0.0.0.0 counter.hitslink.com +0.0.0.0 counter.hitslinks.com +0.0.0.0 counter.htmlvalidator.com +0.0.0.0 counter.impressur.com +0.0.0.0 counter.inetusa.com +0.0.0.0 counter.inti.fr +0.0.0.0 counter.kaspersky.com +0.0.0.0 counter.letssingit.com +0.0.0.0 counter.mtree.com +0.0.0.0 counter.mycomputer.com +0.0.0.0 counter.netmore.net +0.0.0.0 counter.nope.dk +0.0.0.0 counter.nowlinux.com +0.0.0.0 counter.pcgames.de +0.0.0.0 counter.rambler.ru +0.0.0.0 counters.auctionhelper.com # comment these +0.0.0.0 counters.auctionwatch.com # out to allow +0.0.0.0 counters.auctiva.com # tracking by +0.0.0.0 counters.honesty.com # ebay users +0.0.0.0 counter.search.bg +0.0.0.0 counter.sexhound.nl +0.0.0.0 counters.gigya.com +0.0.0.0 counter.sparklit.com +0.0.0.0 counter.superstats.com +0.0.0.0 counter.surfcounters.com +0.0.0.0 counters.xaraonline.com +0.0.0.0 counter.times.lv +0.0.0.0 counter.topping.com.ua +0.0.0.0 counter.tripod.com +0.0.0.0 counter.uq.edu.au +0.0.0.0 counter.w3open.com +0.0.0.0 counter.webcom.com +0.0.0.0 counter.webmedia.pl +0.0.0.0 counter.webtrends.com +0.0.0.0 counter.webtrends.net +0.0.0.0 counter.xxxcool.com +0.0.0.0 counter.yadro.ru +0.0.0.0 count.paycounter.com +0.0.0.0 count.xhit.com +0.0.0.0 cs.sexcounter.com +0.0.0.0 c.statcounter.com +0.0.0.0 c.thecounter.de +0.0.0.0 cw.nu +0.0.0.0 cyseal.cyveillance.com +0.0.0.0 cz3.clickzs.com +0.0.0.0 cz6.clickzs.com +0.0.0.0 da.ce.bd.a9.top.list.ru +0.0.0.0 da.newstogram.com +0.0.0.0 data2.perf.overture.com +0.0.0.0 data.coremetrics.com +0.0.0.0 data.webads.co.nz +0.0.0.0 dclk.haaretz.co.il +0.0.0.0 dclk.themarker.com +0.0.0.0 dclk.themarketer.com +0.0.0.0 delivery.loopingclick.com +0.0.0.0 de.sitestat.com +0.0.0.0 didtheyreadit.com # email bugs +0.0.0.0 digistats.westjet.com +0.0.0.0 dimeprice.com # "spam bugs" +0.0.0.0 directads.mcafee.com +0.0.0.0 dotcomsecrets.com +0.0.0.0 dpbolvw.net +0.0.0.0 ds.247realmedia.com +0.0.0.0 ds.amateurmatch.com +0.0.0.0 dwclick.com +0.0.0.0 e-2dj6wfk4ehd5afq.stats.esomniture.com +0.0.0.0 e-2dj6wfk4ggdzkbo.stats.esomniture.com +0.0.0.0 e-2dj6wfk4gkcpiep.stats.esomniture.com +0.0.0.0 e-2dj6wfk4skdpogo.stats.esomniture.com +0.0.0.0 e-2dj6wfkiakdjgcp.stats.esomniture.com +0.0.0.0 e-2dj6wfkiepczoeo.stats.esomniture.com +0.0.0.0 e-2dj6wfkikjd5glq.stats.esomniture.com +0.0.0.0 e-2dj6wfkiokc5odp.stats.esomniture.com +0.0.0.0 e-2dj6wfkiqjcpifp.stats.esomniture.com +0.0.0.0 e-2dj6wfkocjczedo.stats.esomniture.com +0.0.0.0 e-2dj6wfkokjajseq.stats.esomniture.com +0.0.0.0 e-2dj6wfkowkdjokp.stats.esomniture.com +0.0.0.0 e-2dj6wfkykpazskq.stats.esomniture.com +0.0.0.0 e-2dj6wflicocjklo.stats.esomniture.com +0.0.0.0 e-2dj6wfligpd5iap.stats.esomniture.com +0.0.0.0 e-2dj6wflikgdpodo.stats.esomniture.com +0.0.0.0 e-2dj6wflikiajslo.stats.esomniture.com +0.0.0.0 e-2dj6wflioldzoco.stats.esomniture.com +0.0.0.0 e-2dj6wfliwpczolp.stats.esomniture.com +0.0.0.0 e-2dj6wfloenczmkq.stats.esomniture.com +0.0.0.0 e-2dj6wflokmajedo.stats.esomniture.com +0.0.0.0 e-2dj6wfloqgc5mho.stats.esomniture.com +0.0.0.0 e-2dj6wfmysgdzobo.stats.esomniture.com +0.0.0.0 e-2dj6wgkigpcjedo.stats.esomniture.com +0.0.0.0 e-2dj6wgkisnd5abo.stats.esomniture.com +0.0.0.0 e-2dj6wgkoandzieq.stats.esomniture.com +0.0.0.0 e-2dj6wgkycpcpsgq.stats.esomniture.com +0.0.0.0 e-2dj6wgkyepajmeo.stats.esomniture.com +0.0.0.0 e-2dj6wgkyknd5sko.stats.esomniture.com +0.0.0.0 e-2dj6wgkyomdpalp.stats.esomniture.com +0.0.0.0 e-2dj6whkiandzkko.stats.esomniture.com +0.0.0.0 e-2dj6whkiepd5iho.stats.esomniture.com +0.0.0.0 e-2dj6whkiwjdjwhq.stats.esomniture.com +0.0.0.0 e-2dj6wjk4amd5mfp.stats.esomniture.com +0.0.0.0 e-2dj6wjk4kkcjalp.stats.esomniture.com +0.0.0.0 e-2dj6wjk4ukazebo.stats.esomniture.com +0.0.0.0 e-2dj6wjkosodpmaq.stats.esomniture.com +0.0.0.0 e-2dj6wjkouhd5eao.stats.esomniture.com +0.0.0.0 e-2dj6wjkowhd5ggo.stats.esomniture.com +0.0.0.0 e-2dj6wjkowjajcbo.stats.esomniture.com +0.0.0.0 e-2dj6wjkyandpogq.stats.esomniture.com +0.0.0.0 e-2dj6wjkycpdzckp.stats.esomniture.com +0.0.0.0 e-2dj6wjkyqmdzcgo.stats.esomniture.com +0.0.0.0 e-2dj6wjkysndzigp.stats.esomniture.com +0.0.0.0 e-2dj6wjl4qhd5kdo.stats.esomniture.com +0.0.0.0 e-2dj6wjlichdjoep.stats.esomniture.com +0.0.0.0 e-2dj6wjliehcjglp.stats.esomniture.com +0.0.0.0 e-2dj6wjlignajgaq.stats.esomniture.com +0.0.0.0 e-2dj6wjloagc5oco.stats.esomniture.com +0.0.0.0 e-2dj6wjlougazmao.stats.esomniture.com +0.0.0.0 e-2dj6wjlyamdpogo.stats.esomniture.com +0.0.0.0 e-2dj6wjlyckcpelq.stats.esomniture.com +0.0.0.0 e-2dj6wjlyeodjkcq.stats.esomniture.com +0.0.0.0 e-2dj6wjlygkd5ecq.stats.esomniture.com +0.0.0.0 e-2dj6wjmiekc5olo.stats.esomniture.com +0.0.0.0 e-2dj6wjmyehd5mfo.stats.esomniture.com +0.0.0.0 e-2dj6wjmyooczoeo.stats.esomniture.com +0.0.0.0 e-2dj6wjny-1idzkh.stats.esomniture.com +0.0.0.0 e-2dj6wjnyagcpkko.stats.esomniture.com +0.0.0.0 e-2dj6wjnyeocpcdo.stats.esomniture.com +0.0.0.0 e-2dj6wjnygidjskq.stats.esomniture.com +0.0.0.0 e-2dj6wjnyqkajabp.stats.esomniture.com +0.0.0.0 easy-web-stats.com +0.0.0.0 ecestats.theglobeandmail.com +0.0.0.0 economisttestcollect.insightfirst.com +0.0.0.0 ehg.fedex.com +0.0.0.0 eitbglobal.ojdinteractiva.com +0.0.0.0 emea.rel.msn.com +0.0.0.0 engine.cmmeglobal.com +0.0.0.0 enoratraffic.com +0.0.0.0 entry-stats.huffingtonpost.com +0.0.0.0 environmentalgraffiti.uk.intellitxt.com +0.0.0.0 e-n.y-1shz2prbmdj6wvny-1sez2pra2dj6wjmyepdzadpwudj6x9ny-1seq-2-2.stats.esomniture.com +0.0.0.0 e-ny.a-1shz2prbmdj6wvny-1sez2pra2dj6wjny-1jcpgbowsdj6x9ny-1seq-2-2.stats.esomniture.com +0.0.0.0 es.optimost.com +0.0.0.0 fastcounter.bcentral.com +0.0.0.0 fastcounter.com +0.0.0.0 fastcounter.linkexchange.com +0.0.0.0 fastcounter.linkexchange.net +0.0.0.0 fastcounter.linkexchange.nl +0.0.0.0 fastcounter.onlinehoster.net +0.0.0.0 fastwebcounter.com +0.0.0.0 fcstats.bcentral.com +0.0.0.0 fi.sitestat.com +0.0.0.0 fl01.ct2.comclick.com +0.0.0.0 flycast.com +0.0.0.0 forbescollect.247realmedia.com +0.0.0.0 formalyzer.com +0.0.0.0 foxcounter.com +0.0.0.0 free-counter.5u.com +0.0.0.0 freeinvisiblecounters.com +0.0.0.0 freestats.com +0.0.0.0 freewebcounter.com +0.0.0.0 free.xxxcounter.com +0.0.0.0 fs10.fusestats.com +0.0.0.0 ft2.autonomycloud.com +0.0.0.0 gapl.hit.gemius.pl +0.0.0.0 gator.com +0.0.0.0 gcounter.hosting4u.net +0.0.0.0 gd.mlb.com +0.0.0.0 geocounter.net +0.0.0.0 gkkzngresullts.com +0.0.0.0 go-in-search.net +0.0.0.0 goldstats.com +0.0.0.0 googfle.com +0.0.0.0 googletagservices.com +0.0.0.0 gostats.com +0.0.0.0 grafix.xxxcounter.com +0.0.0.0 gtcc1.acecounter.com +0.0.0.0 g-wizzads.net +0.0.0.0 hc2.humanclick.com +0.0.0.0 hit10.hotlog.ru +0.0.0.0 hit2.hotlog.ru +0.0.0.0 hit37.chark.dk +0.0.0.0 hit37.chart.dk +0.0.0.0 hit39.chart.dk +0.0.0.0 hit5.hotlog.ru +0.0.0.0 hit8.hotlog.ru +0.0.0.0 hit.clickaider.com +0.0.0.0 hit-counter.5u.com +0.0.0.0 hit-counter.udub.com +0.0.0.0 hits.guardian.co.uk +0.0.0.0 hits.gureport.co.uk +0.0.0.0 hits.nextstat.com +0.0.0.0 hits.webstat.com +0.0.0.0 hitx.statistics.ro +0.0.0.0 hst.tradedoubler.com +0.0.0.0 htm.freelogs.com +0.0.0.0 http300.edge.ru4.com +0.0.0.0 iccee.com +0.0.0.0 idm.hit.gemius.pl +0.0.0.0 ieplugin.com +0.0.0.0 iesnare.com # See http://www.codingthewheel.com/archives/online-gambling-privacy-iesnare +0.0.0.0 ig.insightgrit.com +0.0.0.0 ih.constantcontacts.com +0.0.0.0 i.kissmetrics.com # http://www.wired.com/epicenter/2011/07/undeletable-cookie/ +0.0.0.0 ilead.itrack.it +0.0.0.0 image.masterstats.com +0.0.0.0 images1.paycounter.com +0.0.0.0 images-aud.freshmeat.net +0.0.0.0 images-aud.slashdot.org +0.0.0.0 images-aud.sourceforge.net +0.0.0.0 images.dailydiscounts.com # "spam bugs" +0.0.0.0 images.itchydawg.com +0.0.0.0 impacts.alliancehub.com # "spam bugs" +0.0.0.0 impch.tradedoubler.com +0.0.0.0 imp.clickability.com +0.0.0.0 impde.tradedoubler.com +0.0.0.0 impdk.tradedoubler.com +0.0.0.0 impes.tradedoubler.com +0.0.0.0 impfr.tradedoubler.com +0.0.0.0 impgb.tradedoubler.com +0.0.0.0 impie.tradedoubler.com +0.0.0.0 impit.tradedouble.com +0.0.0.0 impit.tradedoubler.com +0.0.0.0 impnl.tradedoubler.com +0.0.0.0 impno.tradedoubler.com +0.0.0.0 impse.tradedoubler.com +0.0.0.0 in.paycounter.com +0.0.0.0 insightfirst.com +0.0.0.0 insightxe.looksmart.com +0.0.0.0 int.sitestat.com +0.0.0.0 in.webcounter.cc +0.0.0.0 iprocollect.realmedia.com +0.0.0.0 izitracking.izimailing.com +0.0.0.0 jgoyk.cjt1.net +0.0.0.0 jkearns.freestats.com +0.0.0.0 journalism.uk.smarttargetting.com +0.0.0.0 js.cybermonitor.com +0.0.0.0 jsonlinecollect.247realmedia.com +0.0.0.0 js.revsci.net +0.0.0.0 kissmetrics.com +0.0.0.0 kqzyfj.com +0.0.0.0 kt4.kliptracker.com +0.0.0.0 leadpub.com +0.0.0.0 liapentruromania.ro +0.0.0.0 lin31.metriweb.be +0.0.0.0 linkcounter.com +0.0.0.0 linkcounter.pornosite.com +0.0.0.0 link.masterstats.com +0.0.0.0 linktrack.bravenet.com +0.0.0.0 livestats.atlanta-airport.com +#0.0.0.0 ll.a.hulu.com # Uncomment to block Hulu. +0.0.0.0 loc1.hitsprocessor.com +0.0.0.0 log1.countomat.com +0.0.0.0 log4.quintelligence.com +0.0.0.0 log999.goo.ne.jp +0.0.0.0 loga.xiti.com +0.0.0.0 log.btopenworld.com +0.0.0.0 logc146.xiti.com +0.0.0.0 logc1.xiti.com +0.0.0.0 logc22.xiti.com +0.0.0.0 logc25.xiti.com +0.0.0.0 logc31.xiti.com +0.0.0.0 log.clickstream.co.za +0.0.0.0 log.hankooki.com +0.0.0.0 logi6.xiti.com +0.0.0.0 logi7.xiti.com +0.0.0.0 logi8.xiti.com +0.0.0.0 logp3.xiti.com +0.0.0.0 logs.comics.com +0.0.0.0 logs.eresmas.com +0.0.0.0 logs.eresmas.net +0.0.0.0 log.statistici.ro +0.0.0.0 logv14.xiti.com +0.0.0.0 logv17.xiti.com +0.0.0.0 logv18.xiti.com +0.0.0.0 logv21.xiti.com +0.0.0.0 logv25.xiti.com +0.0.0.0 logv27.xiti.com +0.0.0.0 logv29.xiti.com +0.0.0.0 logv32.xiti.com +0.0.0.0 logv4.xiti.com +0.0.0.0 logv.xiti.com +0.0.0.0 luycos.com +0.0.0.0 lycoscollect.247realmedia.com +0.0.0.0 lycoscollect.realmedia.com +0.0.0.0 m1.nedstatbasic.net +0.0.0.0 m1.webstats4u.com +0.0.0.0 mailcheckisp.biz # "spam bugs" +0.0.0.0 mama128.valuehost.ru +0.0.0.0 marketscore.com +0.0.0.0 mature.xxxcounter.com +0.0.0.0 mbox5.offermatica.com +0.0.0.0 media101.sitebrand.com +0.0.0.0 media.superstats.com +0.0.0.0 mediatrack.revenue.net +0.0.0.0 metric.10best.com +0.0.0.0 metric.infoworld.com +0.0.0.0 metric.nationalgeographic.com +0.0.0.0 metric.nwsource.com +0.0.0.0 metric.olivegarden.com +0.0.0.0 metrics2.pricegrabber.com +0.0.0.0 metrics.accuweather.com +0.0.0.0 metrics.al.com +0.0.0.0 metrics.boston.com +0.0.0.0 metrics.cbc.ca +0.0.0.0 metrics.cleveland.com +0.0.0.0 metrics.cnn.com +0.0.0.0 metrics.csmonitor.com +0.0.0.0 metrics.ctv.ca +0.0.0.0 metrics.dallasnews.com +0.0.0.0 metrics.elle.com +0.0.0.0 metrics.experts-exchange.com +0.0.0.0 metrics.fandome.com +0.0.0.0 metrics.foxnews.com +0.0.0.0 metrics.gap.com +0.0.0.0 metrics.health.com +0.0.0.0 metrics.hrblock.com +0.0.0.0 metrics.ioffer.com +0.0.0.0 metrics.ireport.com +0.0.0.0 metrics.kgw.com +0.0.0.0 metrics.ktvb.com +0.0.0.0 metrics.landolakes.com +0.0.0.0 metrics.lhj.com +0.0.0.0 metrics.maxim.com +0.0.0.0 metrics.mlive.com +0.0.0.0 metrics.mms.mavenapps.net +0.0.0.0 metrics.mpora.com +0.0.0.0 metrics.mysanantonio.com +0.0.0.0 metrics.nba.com +0.0.0.0 metrics.nextgov.com +0.0.0.0 metrics.nfl.com +0.0.0.0 metrics.npr.org +0.0.0.0 metrics.oclc.org +0.0.0.0 metrics.olivegarden.com +0.0.0.0 metrics.oregonlive.com +0.0.0.0 metrics.parallels.com +0.0.0.0 metrics.performancing.com +0.0.0.0 metrics.philly.com +0.0.0.0 metrics.post-gazette.com +0.0.0.0 metrics.premiere.com +0.0.0.0 metrics.rottentomatoes.com +0.0.0.0 metrics.sephora.com +0.0.0.0 metrics.soundandvision.com +0.0.0.0 metrics.soundandvisionmag.com +0.0.0.0 metrics.sun.com +0.0.0.0 metric.starz.com +0.0.0.0 metrics.technologyreview.com +0.0.0.0 metrics.theatlantic.com +0.0.0.0 metrics.thedailybeast.com +0.0.0.0 metrics.thefa.com +0.0.0.0 metrics.thefrisky.com +0.0.0.0 metrics.thenation.com +0.0.0.0 metrics.theweathernetwork.com +#0.0.0.0 metrics.ticketmaster.com # interferes with logging in to ticketmaster.com +0.0.0.0 metrics.tmz.com +0.0.0.0 metrics.toyota.com +0.0.0.0 metrics.tulsaworld.com +0.0.0.0 metrics.washingtonpost.com +0.0.0.0 metrics.whitepages.com +0.0.0.0 metrics.womansday.com +0.0.0.0 metrics.yellowpages.com +0.0.0.0 metrics.yousendit.com +0.0.0.0 metric.thenation.com +0.0.0.0 mng1.clickalyzer.com +0.0.0.0 monster.gostats.com +0.0.0.0 mpsnare.iesnare.com # See http://www.codingthewheel.com/archives/online-gambling-privacy-iesnare +0.0.0.0 msn1.com +0.0.0.0 msnm.com +0.0.0.0 mt122.mtree.com +0.0.0.0 mtcount.channeladvisor.com +0.0.0.0 mtrcs.popcap.com +0.0.0.0 mtv.247realmedia.com +0.0.0.0 multi1.rmuk.co.uk +0.0.0.0 mvs.mediavantage.de +0.0.0.0 mvtracker.com +0.0.0.0 mystats.com +0.0.0.0 nedstat.s0.nl +0.0.0.0 nethit-free.nl +0.0.0.0 net-radar.com +0.0.0.0 network.leadpub.com +0.0.0.0 nextgenstats.com +0.0.0.0 nht-2.extreme-dm.com +0.0.0.0 nl.nedstatbasic.net +0.0.0.0 nl.sitestat.com +0.0.0.0 o.addthis.com +0.0.0.0 objects.tremormedia.com +0.0.0.0 okcounter.com +0.0.0.0 omniture.theglobeandmail.com +0.0.0.0 one.123counters.com +0.0.0.0 oss-crules.marketscore.com +0.0.0.0 oss-survey.marketscore.com +0.0.0.0 ostats.mozilla.com +0.0.0.0 other.xxxcounter.com +0.0.0.0 out.true-counter.com +0.0.0.0 p.addthis.com +0.0.0.0 partner.alerts.aol.com +0.0.0.0 partners.pantheranetwork.com +0.0.0.0 passpport.com +0.0.0.0 paxito.sitetracker.com +0.0.0.0 paycounter.com +0.0.0.0 pei-ads.thesmokingjacket.com +0.0.0.0 perso.estat.com +0.0.0.0 pf.tradedoubler.com +0.0.0.0 pings.blip.tv +0.0.0.0 pix02.revsci.net +0.0.0.0 pix03.revsci.net +0.0.0.0 pix04.revsci.net +0.0.0.0 pixel.invitemedia.com +0.0.0.0 pmg.ad-logics.com +0.0.0.0 pn2.adserver.yahoo.com +0.0.0.0 pointclicktrack.com +0.0.0.0 pong.qubitproducts.com +0.0.0.0 postclick.adcentriconline.com +0.0.0.0 postgazettecollect.247realmedia.com +0.0.0.0 precisioncounter.com +0.0.0.0 p.reuters.com +0.0.0.0 printmail.biz +0.0.0.0 prof.estat.com +0.0.0.0 pro.hit.gemius.pl +0.0.0.0 proxycfg.marketscore.com +0.0.0.0 proxy.ia2.marketscore.com +0.0.0.0 proxy.ia3.marketscore.com +0.0.0.0 proxy.ia4.marketscore.com +0.0.0.0 proxy.or3.marketscore.com +0.0.0.0 proxy.or4.marketscore.com +0.0.0.0 proxy.sj3.marketscore.com +0.0.0.0 proxy.sj4.marketscore.com +0.0.0.0 quantserve.com #: Ad Tracking, JavaScript, etc. +0.0.0.0 quareclk.com +0.0.0.0 raw.oggifinogi.com +0.0.0.0 r.clickdensity.com +0.0.0.0 remotrk.com +0.0.0.0 rightmedia.net +0.0.0.0 rightstats.com +0.0.0.0 roskatrack.roskadirect.com +0.0.0.0 rr1.xxxcounter.com +0.0.0.0 rr2.xxxcounter.com +0.0.0.0 rr3.xxxcounter.com +0.0.0.0 rr4.xxxcounter.com +0.0.0.0 rr5.xxxcounter.com +0.0.0.0 rr7.xxxcounter.com +0.0.0.0 rts.pgmediaserve.com +0.0.0.0 rts.phn.doublepimp.com +0.0.0.0 s10.histats.com +0.0.0.0 s10.sitemeter.com +0.0.0.0 s11.sitemeter.com +0.0.0.0 s12.sitemeter.com +0.0.0.0 s13.sitemeter.com +0.0.0.0 s14.sitemeter.com +0.0.0.0 s15.sitemeter.com +0.0.0.0 s16.sitemeter.com +0.0.0.0 s17.sitemeter.com +0.0.0.0 s18.sitemeter.com +0.0.0.0 s19.sitemeter.com +0.0.0.0 s1.shinystat.it +0.0.0.0 s1.thecounter.com +0.0.0.0 s20.sitemeter.com +0.0.0.0 s21.sitemeter.com +0.0.0.0 s22.sitemeter.com +0.0.0.0 s23.sitemeter.com +0.0.0.0 s24.sitemeter.com +0.0.0.0 s25.sitemeter.com +0.0.0.0 s26.sitemeter.com +0.0.0.0 s27.sitemeter.com +0.0.0.0 s28.sitemeter.com +0.0.0.0 s29.sitemeter.com +0.0.0.0 s2.statcounter.com +0.0.0.0 s2.youtube.com +0.0.0.0 s30.sitemeter.com +0.0.0.0 s31.sitemeter.com +0.0.0.0 s32.sitemeter.com +0.0.0.0 s33.sitemeter.com +0.0.0.0 s34.sitemeter.com +0.0.0.0 s35.sitemeter.com +0.0.0.0 s36.sitemeter.com +0.0.0.0 s37.sitemeter.com +0.0.0.0 s38.sitemeter.com +0.0.0.0 s39.sitemeter.com +0.0.0.0 s3.hit.stat.pl +0.0.0.0 s41.sitemeter.com +0.0.0.0 s42.sitemeter.com +0.0.0.0 s43.sitemeter.com +0.0.0.0 s44.sitemeter.com +0.0.0.0 s45.sitemeter.com +0.0.0.0 s46.sitemeter.com +0.0.0.0 s47.sitemeter.com +0.0.0.0 s48.sitemeter.com +0.0.0.0 s4.histats.com +0.0.0.0 s4.shinystat.com +0.0.0.0 s.clickability.com +0.0.0.0 scorecardresearch.com +0.0.0.0 scribe.twitter.com +0.0.0.0 scrooge.channelcincinnati.com +0.0.0.0 scrooge.channeloklahoma.com +0.0.0.0 scrooge.click10.com +0.0.0.0 scrooge.clickondetroit.com +0.0.0.0 scrooge.nbc11.com +0.0.0.0 scrooge.nbc4columbus.com +0.0.0.0 scrooge.nbc4.com +0.0.0.0 scrooge.nbcsandiego.com +0.0.0.0 scrooge.newsnet5.com +0.0.0.0 scrooge.thebostonchannel.com +0.0.0.0 scrooge.thedenverchannel.com +0.0.0.0 scrooge.theindychannel.com +0.0.0.0 scrooge.thekansascitychannel.com +0.0.0.0 scrooge.themilwaukeechannel.com +0.0.0.0 scrooge.theomahachannel.com +0.0.0.0 scrooge.wesh.com +0.0.0.0 scrooge.wftv.com +0.0.0.0 scrooge.wnbc.com +0.0.0.0 scrooge.wsoctv.com +0.0.0.0 scrooge.wtov9.com +0.0.0.0 sdc.rbistats.com +0.0.0.0 searchadv.com +0.0.0.0 sekel.ch +0.0.0.0 servedby.valuead.com +0.0.0.0 server10.opentracker.net +0.0.0.0 server11.opentracker.net +0.0.0.0 server12.opentracker.net +0.0.0.0 server13.opentracker.net +0.0.0.0 server14.opentracker.net +0.0.0.0 server15.opentracker.net +0.0.0.0 server16.opentracker.net +0.0.0.0 server17.opentracker.net +0.0.0.0 server18.opentracker.net +0.0.0.0 server1.opentracker.net +0.0.0.0 server2.opentracker.net +0.0.0.0 server3.opentracker.net +0.0.0.0 server3.web-stat.com +0.0.0.0 server4.opentracker.net +0.0.0.0 server5.opentracker.net +0.0.0.0 server6.opentracker.net +0.0.0.0 server7.opentracker.net +0.0.0.0 server8.opentracker.net +0.0.0.0 server9.opentracker.net +0.0.0.0 service.bfast.com +0.0.0.0 services.krxd.net +0.0.0.0 se.sitestat.com +0.0.0.0 sexcounter.com +0.0.0.0 seznam.hit.gemius.pl +0.0.0.0 showads.pubmatic.com +0.0.0.0 showcount.honest.com +0.0.0.0 sideshow.directtrack.com +0.0.0.0 sitestat.com +0.0.0.0 sitestats.tiscali.co.uk +0.0.0.0 sm1.sitemeter.com +0.0.0.0 sm2.sitemeter.com +0.0.0.0 sm3.sitemeter.com +0.0.0.0 sm4.sitemeter.com +0.0.0.0 sm5.sitemeter.com +0.0.0.0 sm6.sitemeter.com +0.0.0.0 sm7.sitemeter.com +0.0.0.0 sm8.sitemeter.com +0.0.0.0 sm9.sitemeter.com +0.0.0.0 smartstats.com +0.0.0.0 softcore.xxxcounter.com +0.0.0.0 sostats.mozilla.com +0.0.0.0 sovereign.sitetracker.com +0.0.0.0 spinbox.maccentral.com +0.0.0.0 spinbox.versiontracker.com +0.0.0.0 spklds.com +0.0.0.0 s.statistici.ro +0.0.0.0 s.stats.wordpress.com +0.0.0.0 ss.tiscali.com +0.0.0.0 ss.tiscali.it +0.0.0.0 st1.hit.gemius.pl +0.0.0.0 stags.peer39.net +0.0.0.0 stast2.gq.com +0.0.0.0 stat1.z-stat.com +0.0.0.0 stat3.cybermonitor.com +0.0.0.0 stat.4u.pl +0.0.0.0 stat.alibaba.com +0.0.0.0 statcounter.com +0.0.0.0 stat-counter.tass-online.ru +0.0.0.0 stat.discogs.com +0.0.0.0 static.kibboko.com +0.0.0.0 static.smni.com # Santa Monica - popunders +0.0.0.0 statik.topica.com +0.0.0.0 statistics.dynamicsitestats.com +0.0.0.0 statistics.elsevier.nl +0.0.0.0 statistics.reedbusiness.nl +0.0.0.0 statistics.theonion.com +0.0.0.0 statistik-gallup.net +0.0.0.0 stat.netmonitor.fi +0.0.0.0 stat.onestat.com +0.0.0.0 stats1.clicktracks.com +0.0.0.0 stats1.corusradio.com +0.0.0.0 stats1.in +0.0.0.0 stats.24ways.org +0.0.0.0 stats2.clicktracks.com +0.0.0.0 stats2.gourmet.com +0.0.0.0 stats2.newyorker.com +0.0.0.0 stats2.rte.ie +0.0.0.0 stats2.unrulymedia.com +0.0.0.0 stats2.vanityfair.com +0.0.0.0 stats4all.com +0.0.0.0 stats5.lightningcast.com +0.0.0.0 stats6.lightningcast.net +0.0.0.0 stats.absol.co.za +0.0.0.0 stats.adbrite.com +0.0.0.0 stats.adotube.com +0.0.0.0 stats.adultswim.com +0.0.0.0 stats.airfarewatchdog.com +0.0.0.0 stats.allliquid.com +0.0.0.0 stats.askmen.com +0.0.0.0 stats.bbc.co.uk +0.0.0.0 stats.becu.org +0.0.0.0 stats.big-boards.com +0.0.0.0 stats.blogoscoop.net +0.0.0.0 stats.bonzaii.no +0.0.0.0 stats.break.com +0.0.0.0 stats.brides.com +0.0.0.0 stats.buysellads.com +0.0.0.0 stats.cafepress.com +0.0.0.0 stats.canalblog.com +0.0.0.0 stats.cartoonnetwork.com +0.0.0.0 stats.channel4.com +0.0.0.0 stats.clickability.com +0.0.0.0 stats.concierge.com +0.0.0.0 stats.cts-bv.nl +0.0.0.0 stats.darkbluesea.com +0.0.0.0 stats.datahjaelp.net +0.0.0.0 stats.directnic.com +0.0.0.0 stats.dziennik.pl +0.0.0.0 stats.economist.com +0.0.0.0 stats.epicurious.com +0.0.0.0 statse.webtrendslive.com # Fortune.com among others +0.0.0.0 stats.examiner.com +0.0.0.0 stats.fairmont.com +0.0.0.0 stats.fastcompany.com +0.0.0.0 stats.foxcounter.com +0.0.0.0 stats.free-rein.net +0.0.0.0 stats.f-secure.com +0.0.0.0 stats.ft.com +0.0.0.0 stats.gamestop.com +0.0.0.0 stats.globesports.com +0.0.0.0 stats.groupninetyfour.com +0.0.0.0 stats.idsoft.com +0.0.0.0 stats.ign.com +0.0.0.0 stats.ilsemedia.nl +0.0.0.0 stats.independent.co.uk +0.0.0.0 stats.indexstats.com +0.0.0.0 stats.indextools.com +0.0.0.0 stats.investors.com +0.0.0.0 stats.iwebtrack.com +0.0.0.0 stats.jippii.com +0.0.0.0 stats.klsoft.com +0.0.0.0 stats.ladotstats.nl +0.0.0.0 stats.macworld.com +0.0.0.0 stats.magnify.net +0.0.0.0 stats.manticoretechnology.com +0.0.0.0 stats.mbamupdates.com +0.0.0.0 stats.millanusa.com +0.0.0.0 stats.nowpublic.com +0.0.0.0 stats.paycounter.com +0.0.0.0 stats.platinumbucks.com +0.0.0.0 stats.popscreen.com +0.0.0.0 stats.reinvigorate.net +0.0.0.0 stats.resellerratings.com +0.0.0.0 stats.revenue.net +0.0.0.0 stats.searchles.com +0.0.0.0 stats.ssa.gov +0.0.0.0 stats.superstats.com +0.0.0.0 stats.telegraph.co.uk +0.0.0.0 stats.thoughtcatalog.com +0.0.0.0 stats.townnews.com +0.0.0.0 stats.ultimate-webservices.com +0.0.0.0 stats.unionleader.com +0.0.0.0 stats.video.search.yahoo.com +0.0.0.0 stats.vodpod.com +0.0.0.0 stats.wordpress.com +0.0.0.0 stats.www.ibm.com +0.0.0.0 stats.yourminis.com +0.0.0.0 stat.webmedia.pl +0.0.0.0 stat.www.fi +0.0.0.0 stat.yellowtracker.com +0.0.0.0 stat.youku.com +0.0.0.0 stl.p.a1.traceworks.com +0.0.0.0 straighttangerine.cz.cc +0.0.0.0 st.sageanalyst.net +0.0.0.0 sugoicounter.com +0.0.0.0 superstats.com +0.0.0.0 s.youtube.com +#0.0.0.0 t2.hulu.com # Uncomment to block Hulu. +0.0.0.0 tagging.outrider.com +0.0.0.0 talkcity.realtracker.com +0.0.0.0 targetnet.com +0.0.0.0 tates.freestats.com +0.0.0.0 tcookie.usatoday.com +0.0.0.0 tcr.tynt.com # See http://daringfireball.net/2010/05/tynt_copy_paste_jerks +0.0.0.0 tgpcounter.freethumbnailgalleries.com +0.0.0.0 thecounter.com +0.0.0.0 the-counter.net +0.0.0.0 themecounter.com +0.0.0.0 the.sextracker.com +0.0.0.0 tipsurf.com +0.0.0.0 toolbarpartner.com +0.0.0.0 tools.spylog.ru +0.0.0.0 top.mail.ru +0.0.0.0 topstats.com +0.0.0.0 topstats.net +0.0.0.0 torstarcollect.247realmedia.com +0.0.0.0 track2.mybloglog.com +0.0.0.0 track.adform.com +0.0.0.0 track.adform.net +0.0.0.0 track.did-it.com +0.0.0.0 track.directleads.com +0.0.0.0 track.domainsponsor.com +0.0.0.0 track.effiliation.com +0.0.0.0 tracker.bonnint.net +0.0.0.0 tracker.clicktrade.com +0.0.0.0 tracker.idg.co.uk +0.0.0.0 tracker.mattel.com +0.0.0.0 tracker.netklix.com +0.0.0.0 tracker.tradedoubler.com +0.0.0.0 track.exclusivecpa.com +0.0.0.0 track.ft.com +0.0.0.0 track.gawker.com +0.0.0.0 track.homestead.com +#0.0.0.0 track.hulu.com # Uncomment to block Hulu. +0.0.0.0 tracking.10e20.com +0.0.0.0 tracking.adjug.com +0.0.0.0 tracking.allposters.com +0.0.0.0 tracking.foxnews.com +0.0.0.0 tracking.iol.co.za +0.0.0.0 tracking.msadcenter.msn.com +0.0.0.0 tracking.oggifinogi.com +0.0.0.0 tracking.percentmobile.com +0.0.0.0 tracking.publicidees.com +0.0.0.0 tracking.quisma.com +0.0.0.0 tracking.rangeonlinemedia.com +0.0.0.0 tracking.searchmarketing.com +0.0.0.0 tracking.summitmedia.co.uk +0.0.0.0 tracking.trafficjunky.net +0.0.0.0 tracking.trutv.com +0.0.0.0 tracking.vindicosuite.com +0.0.0.0 track.lfstmedia.com +0.0.0.0 track.mybloglog.com +0.0.0.0 track.omg2.com +0.0.0.0 track.roiservice.com +0.0.0.0 track.searchignite.com +0.0.0.0 tracksurf.daooda.com +0.0.0.0 track.webgains.com +0.0.0.0 tradedoubler.com +0.0.0.0 tradedoubler.sonvideopro.com +0.0.0.0 tr.adinterax.com +0.0.0.0 traffic-stats.streamsolutions.co.uk +0.0.0.0 trax.gamespot.com +0.0.0.0 trc.taboolasyndication.com +0.0.0.0 trk.kissmetrics.com +0.0.0.0 trk.tidaltv.com +0.0.0.0 true-counter.com +0.0.0.0 truehits1.gits.net.th +0.0.0.0 t.senaluno.com +0.0.0.0 tu.connect.wunderloop.net +0.0.0.0 tynt.com +0.0.0.0 u1817.16.spylog.com +0.0.0.0 u3102.47.spylog.com +0.0.0.0 u3305.71.spylog.com +0.0.0.0 u3608.20.spylog.com +0.0.0.0 u4056.56.spylog.com +0.0.0.0 u432.77.spylog.com +0.0.0.0 u4396.79.spylog.com +0.0.0.0 u4443.84.spylog.com +0.0.0.0 u4556.11.spylog.com +0.0.0.0 u5234.87.spylog.com +0.0.0.0 u5234.98.spylog.com +0.0.0.0 u5687.48.spylog.com +0.0.0.0 u574.07.spylog.com +0.0.0.0 u604.41.spylog.com +0.0.0.0 u6762.46.spylog.com +0.0.0.0 u6905.71.spylog.com +0.0.0.0 u7748.16.spylog.com +0.0.0.0 u810.15.spylog.com +0.0.0.0 u920.31.spylog.com +0.0.0.0 u977.40.spylog.com +0.0.0.0 udc.msn.com +0.0.0.0 uk.cqcounter.com +0.0.0.0 uk.sitestat.com +0.0.0.0 ultimatecounter.com +0.0.0.0 us.2.cqcounter.com +0.0.0.0 usa.nedstat.net +0.0.0.0 us.cqcounter.com +0.0.0.0 v1.nedstatbasic.net +0.0.0.0 v7.stats.load.com +0.0.0.0 valueclick.com +0.0.0.0 valueclick.net +0.0.0.0 vertical-stats.huffpost.com +0.0.0.0 video-stats.video.google.com +0.0.0.0 vip.clickzs.com +0.0.0.0 virtualbartendertrack.beer.com +0.0.0.0 visit.theglobeandmail.com # Visits to theglobeandmail.com +0.0.0.0 vis.sexlist.com +0.0.0.0 voken.eyereturn.com +0.0.0.0 vs.dmtracker.com +0.0.0.0 vsii.spinbox.net +0.0.0.0 vsii.spindox.net +0.0.0.0 w1.tcr112.tynt.com +0.0.0.0 warlog.info +0.0.0.0 wau.tynt.com +0.0.0.0 web1.realtracker.com +0.0.0.0 web2.realtracker.com +0.0.0.0 web3.realtracker.com +0.0.0.0 web4.realtracker.com +0.0.0.0 webanalytics.globalthoughtz.com +0.0.0.0 webbug.seatreport.com # web bugs +0.0.0.0 web-counter.5u.com +0.0.0.0 webcounter.com +0.0.0.0 webcounter.goweb.de +0.0.0.0 webcounter.together.net +0.0.0.0 webhit.aftenposten.no +0.0.0.0 webhit.afterposten.no +0.0.0.0 webmasterkai.sitetracker.com +0.0.0.0 webpdp.gator.com +0.0.0.0 webstat.channel4.com +0.0.0.0 webtrends.telenet.be +0.0.0.0 webtrends.thisis.co.uk +0.0.0.0 webtrends.townhall.com +0.0.0.0 wtnj.worldnow.com +0.0.0.0 www.0stats.com +0.0.0.0 www101.coolsavings.com +0.0.0.0 www.123count.com +0.0.0.0 www.123counter.superstats.com +0.0.0.0 www.123stat.com +0.0.0.0 www1.addfreestats.com +0.0.0.0 www1.counter.bloke.com +0.0.0.0 www.1quickclickrx.com +0.0.0.0 www1.tynt.com +0.0.0.0 www.2001-007.com +0.0.0.0 www2.addfreestats.com +0.0.0.0 www2.counter.bloke.com +0.0.0.0 www2.pagecount.com +0.0.0.0 www3.addfreestats.com +0.0.0.0 www3.click-fr.com +0.0.0.0 www3.counter.bloke.com +0.0.0.0 www.3dstats.com +0.0.0.0 www4.addfreestats.com +0.0.0.0 www4.counter.bloke.com +0.0.0.0 www5.addfreestats.com +0.0.0.0 www5.counter.bloke.com +0.0.0.0 www60.valueclick.com +0.0.0.0 www6.addfreestats.com +0.0.0.0 www6.click-fr.com +0.0.0.0 www6.counter.bloke.com +0.0.0.0 www7.addfreestats.com +0.0.0.0 www7.counter.bloke.com +0.0.0.0 www8.addfreestats.com +0.0.0.0 www8.counter.bloke.com +0.0.0.0 www9.counter.bloke.com +0.0.0.0 www.addfreecounter.com +0.0.0.0 www.addfreestats.com +0.0.0.0 www.ademails.com +0.0.0.0 www.affiliatesuccess.net +0.0.0.0 www.bar.ry2002.02-ry014.snpr.hotmx.hair.zaam.net # In spam +0.0.0.0 www.belstat.nl +0.0.0.0 www.betcounter.com +0.0.0.0 www.bigbadted.com +0.0.0.0 www.bluestreak.com +0.0.0.0 www.c1.thecounter.de +0.0.0.0 www.c2.thecounter.de +0.0.0.0 www.clickclick.com +0.0.0.0 www.clickspring.net #used by a spyware product called PurityScan +0.0.0.0 www.clixgalore.com +0.0.0.0 www.connectionlead.com +0.0.0.0 www.counter10.sextracker.be +0.0.0.0 www.counter11.sextracker.be +0.0.0.0 www.counter12.sextracker.be +0.0.0.0 www.counter13.sextracker.be +0.0.0.0 www.counter14.sextracker.be +0.0.0.0 www.counter15.sextracker.be +0.0.0.0 www.counter16.sextracker.be +0.0.0.0 www.counter1.sextracker.be +0.0.0.0 www.counter2.sextracker.be +0.0.0.0 www.counter3.sextracker.be +0.0.0.0 www.counter4all.com +0.0.0.0 www.counter4all.de +0.0.0.0 www.counter4.sextracker.be +0.0.0.0 www.counter5.sextracker.be +0.0.0.0 www.counter6.sextracker.be +0.0.0.0 www.counter7.sextracker.be +0.0.0.0 www.counter8.sextracker.be +0.0.0.0 www.counter9.sextracker.be +0.0.0.0 www.counter.bloke.com +0.0.0.0 www.counterguide.com +0.0.0.0 www.counter.sexhound.nl +0.0.0.0 www.counter.superstats.com +0.0.0.0 www.c.thecounter.de +0.0.0.0 www.cw.nu +0.0.0.0 www.directgrowthhormone.com +0.0.0.0 www.dpbolvw.net +0.0.0.0 www.dwclick.com +0.0.0.0 www.easycounter.com +0.0.0.0 www.emaildeals.biz +0.0.0.0 www.estats4all.com +0.0.0.0 www.fastcounter.linkexchange.nl +0.0.0.0 www.formalyzer.com +0.0.0.0 www.foxcounter.com +0.0.0.0 www.freestats.com +0.0.0.0 www.fxcounters.com +0.0.0.0 www.gator.com +0.0.0.0 www.googkle.com +0.0.0.0 www.googletagservices.com +0.0.0.0 www.hitstats.co.uk +0.0.0.0 www.iccee.com +0.0.0.0 www.iesnare.com # See http://www.codingthewheel.com/archives/online-gambling-privacy-iesnare +0.0.0.0 www.jellycounter.com +0.0.0.0 www.kqzyfj.com +0.0.0.0 www.leadpub.com +0.0.0.0 www.linkcounter.com +0.0.0.0 www.marketscore.com +0.0.0.0 www.megacounter.de +0.0.0.0 www.metareward.com # web bugs in spam +0.0.0.0 www.naturalgrowthstore.biz +0.0.0.0 www.nedstat.com +0.0.0.0 www.nextgenstats.com +0.0.0.0 www.ntsearch.com +0.0.0.0 www.onestat.com +0.0.0.0 www.originalicons.com # installs IE extension +0.0.0.0 www.paycounter.com +0.0.0.0 www.pointclicktrack.com +0.0.0.0 www.popuptrafic.com +0.0.0.0 www.precisioncounter.com +0.0.0.0 www.premiumsmail.net +0.0.0.0 www.printmail.biz +0.0.0.0 www.quantserve.com #: Ad Tracking, JavaScript, etc. +0.0.0.0 www.quareclk.com +0.0.0.0 www.remotrk.com +0.0.0.0 www.rightmedia.net +0.0.0.0 www.rightstats.com +0.0.0.0 www.searchadv.com +0.0.0.0 www.sekel.ch +0.0.0.0 www.shockcounter.com +0.0.0.0 www.simplecounter.net +0.0.0.0 www.specificclick.com +0.0.0.0 www.specificpop.com +0.0.0.0 www.spklds.com +0.0.0.0 www.statcount.com +0.0.0.0 www.statcounter.com +0.0.0.0 www.statsession.com +0.0.0.0 www.stattrax.com +0.0.0.0 www.stiffnetwork.com +0.0.0.0 www.testracking.com +0.0.0.0 www.thecounter.com +0.0.0.0 www.the-counter.net +0.0.0.0 www.toolbarcounter.com +0.0.0.0 www.tradedoubler.com +0.0.0.0 www.tradedoubler.com.ar +0.0.0.0 www.trafficmagnet.net # web bugs in spam +0.0.0.0 www.trafic.ro +0.0.0.0 www.trendcounter.com +0.0.0.0 www.true-counter.com +0.0.0.0 www.tynt.com +0.0.0.0 www.ultimatecounter.com +0.0.0.0 www.v61.com +0.0.0.0 www.webcounter.com +0.0.0.0 www.web-stat.com +0.0.0.0 www.webstat.com +0.0.0.0 www.whereugetxxx.com +0.0.0.0 www.xxxcounter.com +0.0.0.0 x.cb.kount.com +0.0.0.0 xcnn.com +0.0.0.0 xxxcounter.com +0.0.0.0 xyz.freelogs.com +0.0.0.0 zz.cqcounter.com +# +# + +# sites with known trojans, phishing, or other malware +0.0.0.0 05tz2e9.com +0.0.0.0 09killspyware.com +0.0.0.0 11398.onceedge.ru +0.0.0.0 2006mindfreaklike.blogspot.com # Facebook trojan +0.0.0.0 20-yrs-1.info +0.0.0.0 59-106-20-39.r-bl100.sakura.ne.jp +0.0.0.0 662bd114b7c9.onceedge.ru +0.0.0.0 a15172379.alturo-server.de +0.0.0.0 aaukqiooaseseuke.org +0.0.0.0 abetterinternet.com +0.0.0.0 abruzzoinitaly.co.uk +0.0.0.0 acglgoa.com +0.0.0.0 acim.moqhixoz.cn +0.0.0.0 adshufffle.com +0.0.0.0 adwitty.com +0.0.0.0 adwords.google.lloymlincs.com +0.0.0.0 afantispy.com +0.0.0.0 afdbande.cn +0.0.0.0 allhqpics.com # Facebook trojan +0.0.0.0 alphabirdnetwork.com +0.0.0.0 antispywareexpert.com +0.0.0.0 antivirus-online-scan5.com +0.0.0.0 antivirus-scanner8.com +0.0.0.0 antivirus-scanner.com +0.0.0.0 a.oix.com +0.0.0.0 a.oix.net +0.0.0.0 armsart.com +0.0.0.0 articlefuns.cn +0.0.0.0 articleidea.cn +0.0.0.0 asianread.com +0.0.0.0 autohipnose.com +0.0.0.0 a.webwise.com +0.0.0.0 a.webwise.net +0.0.0.0 a.webwise.org +0.0.0.0 beloysoff.ru +0.0.0.0 binsservicesonline.info +0.0.0.0 blackhat.be +0.0.0.0 blenz-me.net +0.0.0.0 bnvxcfhdgf.blogspot.com.es +0.0.0.0 b.oix.com +0.0.0.0 b.oix.net +0.0.0.0 BonusCashh.com +0.0.0.0 brunga.at # Facebook phishing attempt +0.0.0.0 bt.webwise.com +0.0.0.0 bt.webwise.net +0.0.0.0 bt.webwise.org +0.0.0.0 b.webwise.com +0.0.0.0 b.webwise.net +0.0.0.0 b.webwise.org +0.0.0.0 callawaypos.com +0.0.0.0 callbling.com +0.0.0.0 cambonanza.com +0.0.0.0 ccudl.com +0.0.0.0 changduk26.com # Facebook trojan +0.0.0.0 chelick.net # Facebook trojan +0.0.0.0 cioco-froll.com +0.0.0.0 cira.login.cqr.ssl.igotmyloverback.com +0.0.0.0 cleanchain.net +0.0.0.0 click.get-answers-fast.com +0.0.0.0 clien.net +0.0.0.0 cnbc.com-article906773.us +0.0.0.0 co8vd.cn +0.0.0.0 c.oix.com +0.0.0.0 c.oix.net +0.0.0.0 conduit.com +0.0.0.0 cra-arc-gc-ca.noads.biz +0.0.0.0 custom3hurricanedigitalmedia.com +0.0.0.0 c.webwise.com +0.0.0.0 c.webwise.net +0.0.0.0 c.webwise.org +0.0.0.0 dbios.org +0.0.0.0 dhauzja511.co.cc +0.0.0.0 dietpharmacyrx.net +0.0.0.0 download.abetterinternet.com +0.0.0.0 drc-group.net +0.0.0.0 dubstep.onedumb.com +0.0.0.0 east.05tz2e9.com +0.0.0.0 e-kasa.w8w.pl +0.0.0.0 en.likefever.org # Facebook trojan +0.0.0.0 enteryouremail.net +0.0.0.0 eviboli576.o-f.com +0.0.0.0 facebook-repto1040s2.ahlamountada.com +0.0.0.0 faceboook-replyei0ki.montadalitihad.com +0.0.0.0 facemail.com +0.0.0.0 faggotry.com +0.0.0.0 familyupport1.com +0.0.0.0 feaecebook.com +0.0.0.0 fengyixin.com +0.0.0.0 filosvybfimpsv.ru.gg +0.0.0.0 froling.bee.pl +0.0.0.0 fromru.su +0.0.0.0 ftdownload.com +0.0.0.0 fu.golikeus.net # Facebook trojan +0.0.0.0 gamelights.ru +0.0.0.0 gasasthe.freehostia.com +0.0.0.0 get-answers-fast.com +0.0.0.0 gglcash4u.info # twitter worm +0.0.0.0 girlownedbypolicelike.blogspot.com # Facebook trojan +0.0.0.0 goggle.com +0.0.0.0 greatarcadehits.com +0.0.0.0 gyros.es +0.0.0.0 h1317070.stratoserver.net +0.0.0.0 hackerz.ir +0.0.0.0 hakerzy.net +0.0.0.0 hatrecord.ru # Facebook trojan +0.0.0.0 hellwert.biz +0.0.0.0 hotchix.servepics.com +0.0.0.0 hsb-canada.com # phishing site for hsbc.ca +0.0.0.0 hsbconline.ca # phishing site for hsbc.ca +0.0.0.0 icecars.com +0.0.0.0 idea21.org +0.0.0.0 Iframecash.biz +0.0.0.0 infopaypal.com +0.0.0.0 installmac.com +0.0.0.0 ipadzu.net +0.0.0.0 ircleaner.com +0.0.0.0 itwititer.com +0.0.0.0 ity.elusmedic.ru +0.0.0.0 jajajaj-thats-you-really.com +0.0.0.0 janezk.50webs.co +0.0.0.0 jujitsu-ostrava.info +0.0.0.0 jump.ewoss.net +0.0.0.0 juste.ru # Twitter trojan +0.0.0.0 kczambians.com +0.0.0.0 keybinary.com +0.0.0.0 kirgo.at # Facebook phishing attempt +0.0.0.0 klowns4phun.com +0.0.0.0 konflow.com # Facebook trojan +0.0.0.0 kplusd.far.ru +0.0.0.0 kpremium.com +0.0.0.0 lank.ru +0.0.0.0 lighthouse2k.com +0.0.0.0 like.likewut.net +0.0.0.0 likeportal.com # Facebook trojan +0.0.0.0 likespike.com # Facebook trojan +0.0.0.0 likethislist.biz # Facebook trojan +0.0.0.0 likethis.mbosoft.com # Facebook trojan +0.0.0.0 loseweight.asdjiiw.com +0.0.0.0 lucibad.home.ro +0.0.0.0 luxcart.ro +0.0.0.0 m01.oix.com +0.0.0.0 m01.oix.net +0.0.0.0 m01.webwise.com +0.0.0.0 m01.webwise.net +0.0.0.0 m01.webwise.org +0.0.0.0 m02.oix.com +0.0.0.0 m02.oix.net +0.0.0.0 m02.webwise.com +0.0.0.0 m02.webwise.net +0.0.0.0 m02.webwise.org +0.0.0.0 mail.cyberh.fr +0.0.0.0 malware-live-pro-scanv1.com +0.0.0.0 maxi4.firstvds.ru +0.0.0.0 megasurfin.com +0.0.0.0 monkeyball.osa.pl +0.0.0.0 movies.701pages.com +0.0.0.0 mplayerdownloader.com +0.0.0.0 murcia-ban.es +0.0.0.0 mylike.co.uk # Facebook trojan +0.0.0.0 nactx.com +0.0.0.0 natashyabaydesign.com +0.0.0.0 new-dating-2012.info +0.0.0.0 new-vid-zone-1.blogspot.com.au +0.0.0.0 newwayscanner.info +0.0.0.0 novemberrainx.com +0.0.0.0 ns1.oix.com +0.0.0.0 ns1.oix.net +0.0.0.0 ns1.webwise.com +0.0.0.0 ns1.webwise.net +0.0.0.0 ns1.webwise.org +0.0.0.0 ns2.oix.com +0.0.0.0 ns2.oix.net +0.0.0.0 ns2.webwise.com +0.0.0.0 ns2.webwise.net +0.0.0.0 ns2.webwise.org +0.0.0.0 nufindings.info +0.0.0.0 office.officenet.co.kr +0.0.0.0 oix.com +0.0.0.0 oix.net +0.0.0.0 oj.likewut.net +0.0.0.0 online-antispym4.com +0.0.0.0 oo-na-na-pics.com +0.0.0.0 ordersildenafil.com +0.0.0.0 otsserver.com +0.0.0.0 outerinfo.com +0.0.0.0 paincake.yoll.net +0.0.0.0 pc-scanner16.com +0.0.0.0 personalantispy.com +0.0.0.0 phatthalung.go.th +0.0.0.0 picture-uploads.com +0.0.0.0 pilltabletsrxbargain.net +0.0.0.0 powabcyfqe.com +0.0.0.0 premium-live-scan.com +0.0.0.0 products-gold.net +0.0.0.0 proflashdata.com # Facebook trojan +0.0.0.0 protectionupdatecenter.com +0.0.0.0 pv.wantsfly.com +0.0.0.0 qip.ru +0.0.0.0 qy.corrmedic.ru +0.0.0.0 rd.alphabirdnetwork.com +0.0.0.0 rickrolling.com +0.0.0.0 roifmd.info +0.0.0.0 russian-sex.com +0.0.0.0 s4d.in +0.0.0.0 scan.antispyware-free-scanner.com +0.0.0.0 scanner.best-click-av1.info +0.0.0.0 scanner.best-protect.info +0.0.0.0 scottishstuff-online.com # Canadian bank phishing site +0.0.0.0 sc-spyware.com +0.0.0.0 search.conduit.com +0.0.0.0 securedliveuploads.com +0.0.0.0 securityandroidupdate.dinamikaprinting.com +0.0.0.0 securityscan.us +0.0.0.0 sexymarissa.net +0.0.0.0 shell.xhhow4.com +0.0.0.0 shoppstop.comood.opsource.net +0.0.0.0 shop.skin-safety.com +0.0.0.0 signin-ebay-com-ws-ebayisapi-dll-signin-webscr.ocom.pl +0.0.0.0 sinera.org +0.0.0.0 sjguild.com +0.0.0.0 smarturl.it +0.0.0.0 smile-angel.com +0.0.0.0 software-updates.co +0.0.0.0 software-wenc.co.cc +0.0.0.0 someonewhocares.com +0.0.0.0 sousay.info +0.0.0.0 start.qip.ru +0.0.0.0 superegler.net +0.0.0.0 supernaturalart.com +0.0.0.0 superprotection10.com +0.0.0.0 sverd.net +0.0.0.0 tahoesup.com +0.0.0.0 tattooshaha.info # Facebook trojan +0.0.0.0 test.ishvara-yoga.com +0.0.0.0 TheBizMeet.com +0.0.0.0 thedatesafe.com # Facebook trojan +0.0.0.0 themoneyclippodcast.com +0.0.0.0 themusicnetwork.co.uk +0.0.0.0 thinstall.abetterinternet.com +0.0.0.0 tivvitter.com +0.0.0.0 tomorrownewstoday.com # I'm not sure what it does, but it seems to be associated with a phishing attempt on Facebook +0.0.0.0 toolbarbest.biz +0.0.0.0 toolbarbucks.biz +0.0.0.0 toolbarcool.biz +0.0.0.0 toolbardollars.biz +0.0.0.0 toolbarmoney.biz +0.0.0.0 toolbarnew.biz +0.0.0.0 toolbarsale.biz +0.0.0.0 toolbarweb.biz +0.0.0.0 traffic.adwitty.com +0.0.0.0 trialreg.com +0.0.0.0 tvshowslist.com +0.0.0.0 twitter.login.kevanshome.org +0.0.0.0 twitter.secure.bzpharma.net +0.0.0.0 uawj.moqhixoz.cn +0.0.0.0 ughmvqf.spitt.ru +0.0.0.0 uqz.com +0.0.0.0 users16.jabry.com +0.0.0.0 utenti.lycos.it +0.0.0.0 vcipo.info +0.0.0.0 videos.dskjkiuw.com +0.0.0.0 videos.twitter.secure-logins01.com # twitter worm (http://mashable.com/2009/09/23/twitter-worm-dms/) +0.0.0.0 vxiframe.biz +0.0.0.0 waldenfarms.com +0.0.0.0 weblover.info +0.0.0.0 webpaypal.com +0.0.0.0 webwise.com +0.0.0.0 webwise.net +0.0.0.0 webwise.org +0.0.0.0 west.05tz2e9.com +0.0.0.0 wewillrocknow.com +0.0.0.0 willysy.com +0.0.0.0 wm.maxysearch.info +0.0.0.0 womo.corrmedic.ru +0.0.0.0 www1.bmo.com.hotfrio.com.br +0.0.0.0 www1.firesavez5.com +0.0.0.0 www1.firesavez6.com +0.0.0.0 www1.realsoft34.com +0.0.0.0 www4.gy7k.net +0.0.0.0 www.abetterinternet.com +0.0.0.0 www.adshufffle.com +0.0.0.0 www.adwords.google.lloymlincs.com +0.0.0.0 www.afantispy.com +0.0.0.0 www.akoneplatit.sk +0.0.0.0 www.allhqpics.com # Facebook trojan +0.0.0.0 www.alrpost69.com +0.0.0.0 www.anatol.com +0.0.0.0 www.articlefuns.cn +0.0.0.0 www.articleidea.cn +0.0.0.0 www.asianread.com +0.0.0.0 www.backsim.ru +0.0.0.0 www.bankofamerica.com.ok.am +0.0.0.0 www.be4life.ru +0.0.0.0 www.blenz-me.net +0.0.0.0 www.cambonanza.com +0.0.0.0 www.chelick.net # Facebook trojan +0.0.0.0 www.didata.bw +0.0.0.0 www.dietsecret.ru +0.0.0.0 www.eroyear.ru +0.0.0.0 www.exbays.com +0.0.0.0 www.faggotry.com +0.0.0.0 www.feaecebook.com +0.0.0.0 www.fictioncinema.com +0.0.0.0 www.fischereszter.hu +0.0.0.0 www.froling.bee.pl +0.0.0.0 www.gns-consola.com +0.0.0.0 www.goggle.com +0.0.0.0 www.grouphappy.com +0.0.0.0 www.hakerzy.net +0.0.0.0 www.haoyunlaid.com +0.0.0.0 www.icecars.com +0.0.0.0 www.indesignstudioinfo.com +0.0.0.0 www.infopaypal.com +0.0.0.0 www.keybinary.com +0.0.0.0 www.kinomarathon.ru +0.0.0.0 www.kpremium.com +0.0.0.0 www.likeportal.com # Facebook trojan +0.0.0.0 www.likespike.com # Facebook trojan +0.0.0.0 www.likethislist.biz # Facebook trojan +0.0.0.0 www.likethis.mbosoft.com # Facebook trojan +0.0.0.0 www.lomalindasda.org # Facebook trojan +0.0.0.0 www.lovecouple.ru +0.0.0.0 www.lovetrust.ru +0.0.0.0 www.mikras.nl +0.0.0.0 www.monkeyball.osa.pl +0.0.0.0 www.monsonis.net +0.0.0.0 www.movie-port.ru +0.0.0.0 www.mplayerdownloader.com +0.0.0.0 www.mylike.co.uk # Facebook trojan +0.0.0.0 www.mylovecards.com +0.0.0.0 www.nine2rack.in +0.0.0.0 www.novemberrainx.com +0.0.0.0 www.nu26.com +0.0.0.0 www.oix.com +0.0.0.0 www.oix.net +0.0.0.0 www.onlyfreeoffersonline.com +0.0.0.0 www.oreidofitilho.com.br +0.0.0.0 www.otsserver.com +0.0.0.0 www.pay-pal.com-cgibin-canada.4mcmeta4v.cn +0.0.0.0 www.picture-uploads.com +0.0.0.0 www.portaldimensional.com +0.0.0.0 www.poxudeli.ru +0.0.0.0 www.proflashdata.com # Facebook trojan +0.0.0.0 www.rickrolling.com +0.0.0.0 www.russian-sex.com +0.0.0.0 www.scotiaonline.scotiabank.salferreras.com +0.0.0.0 www.sdlpgift.com +0.0.0.0 www.securityscan.us +0.0.0.0 www.servertasarimbu.com +0.0.0.0 www.sexytiger.ru +0.0.0.0 www.shinilchurch.net # domain was hacked and had a trojan installed +0.0.0.0 www.sinera.org +0.0.0.0 www.someonewhocares.com +0.0.0.0 www.tanger.com.br +0.0.0.0 www.tattooshaha.info # Facebook trojan +0.0.0.0 www.te81.net +0.0.0.0 www.thedatesafe.com # Facebook trojan +0.0.0.0 www.trucktirehotline.com +0.0.0.0 www.tvshowslist.com +0.0.0.0 www.upi6.pillsstore-c.com # Facebook trojan +0.0.0.0 www.uqz.com +0.0.0.0 www.via99.org +0.0.0.0 www.videolove.clanteam.com +0.0.0.0 www.videostan.ru +0.0.0.0 www.vippotexa.ru +0.0.0.0 www.wantsfly.com +0.0.0.0 www.webpaypal.com +0.0.0.0 www.webwise.com +0.0.0.0 www.webwise.net +0.0.0.0 www.webwise.org +0.0.0.0 www.wewillrocknow.com +0.0.0.0 www.willysy.com +0.0.0.0 xfotosx01.fromru.su +0.0.0.0 xponlinescanner.com +0.0.0.0 xvrxyzba253.hotmail.ru +0.0.0.0 yrwap.cn +0.0.0.0 zarozinski.info +0.0.0.0 zettapetta.com +0.0.0.0 zfotos.fromru.su +0.0.0.0 zip.er.cz +0.0.0.0 ztrf.net +0.0.0.0 zviframe.biz +# + +# + +0.0.0.0 3ad.doubleclick.net +0.0.0.0 ad2.doubleclick.net +0.0.0.0 ad.3au.doubleclick.net +0.0.0.0 ad.ae.doubleclick.net +0.0.0.0 ad.au.doubleclick.net +0.0.0.0 ad.be.doubleclick.net +0.0.0.0 ad.br.doubleclick.net +0.0.0.0 ad.de.doubleclick.net +0.0.0.0 ad.dk.doubleclick.net +0.0.0.0 ad-emea.doubleclick.net +0.0.0.0 ad.es.doubleclick.net +0.0.0.0 ad.fi.doubleclick.net +0.0.0.0 ad.fr.doubleclick.net +0.0.0.0 ad-g.doubleclick.net +0.0.0.0 ad.it.doubleclick.net +0.0.0.0 ad.jp.doubleclick.net +0.0.0.0 ad.mo.doubleclick.net +0.0.0.0 ad.n2434.doubleclick.net +0.0.0.0 ad.nl.doubleclick.net +0.0.0.0 ad.no.doubleclick.net +0.0.0.0 ad.nz.doubleclick.net +0.0.0.0 ad.pl.doubleclick.net +0.0.0.0 ad.se.doubleclick.net +0.0.0.0 ad.sg.doubleclick.net +0.0.0.0 ad.uk.doubleclick.net +0.0.0.0 ad.ve.doubleclick.net +0.0.0.0 ad-yt-bfp.doubleclick.net +0.0.0.0 ad.za.doubleclick.net +0.0.0.0 amn.doubleclick.net +0.0.0.0 creative.cc-dt.com +0.0.0.0 doubleclick.de +0.0.0.0 doubleclick.net +0.0.0.0 ebaycn.doubleclick.net +0.0.0.0 ebaytw.doubleclick.net +0.0.0.0 exnjadgda1.doubleclick.net +0.0.0.0 exnjadgda2.doubleclick.net +0.0.0.0 exnjadgds1.doubleclick.net +0.0.0.0 exnjmdgda1.doubleclick.net +0.0.0.0 exnjmdgds1.doubleclick.net +0.0.0.0 feedads.g.doubleclick.net +0.0.0.0 fls.doubleclick.net +0.0.0.0 gd10.doubleclick.net +0.0.0.0 gd11.doubleclick.net +0.0.0.0 gd12.doubleclick.net +0.0.0.0 gd13.doubleclick.net +0.0.0.0 gd14.doubleclick.net +0.0.0.0 gd15.doubleclick.net +0.0.0.0 gd16.doubleclick.net +0.0.0.0 gd17.doubleclick.net +0.0.0.0 gd18.doubleclick.net +0.0.0.0 gd19.doubleclick.net +0.0.0.0 gd1.doubleclick.net +0.0.0.0 gd20.doubleclick.net +0.0.0.0 gd21.doubleclick.net +0.0.0.0 gd22.doubleclick.net +0.0.0.0 gd23.doubleclick.net +0.0.0.0 gd24.doubleclick.net +0.0.0.0 gd25.doubleclick.net +0.0.0.0 gd26.doubleclick.net +0.0.0.0 gd27.doubleclick.net +0.0.0.0 gd28.doubleclick.net +0.0.0.0 gd29.doubleclick.net +0.0.0.0 gd2.doubleclick.net +0.0.0.0 gd30.doubleclick.net +0.0.0.0 gd31.doubleclick.net +0.0.0.0 gd3.doubleclick.net +0.0.0.0 gd4.doubleclick.net +0.0.0.0 gd5.doubleclick.net +0.0.0.0 gd7.doubleclick.net +0.0.0.0 gd8.doubleclick.net +0.0.0.0 gd9.doubleclick.net +0.0.0.0 googleads.g.doubleclick.net +0.0.0.0 iv.doubleclick.net +0.0.0.0 ln.doubleclick.net +0.0.0.0 m1.2mdn.net +0.0.0.0 m1.ae.2mdn.net +0.0.0.0 m1.au.2mdn.net +0.0.0.0 m1.be.2mdn.net +0.0.0.0 m1.br.2mdn.net +0.0.0.0 m1.ca.2mdn.net +0.0.0.0 m1.cn.2mdn.net +0.0.0.0 m1.de.2mdn.net +0.0.0.0 m1.dk.2mdn.net +0.0.0.0 m1.doubleclick.net +0.0.0.0 m1.es.2mdn.net +0.0.0.0 m1.fi.2mdn.net +0.0.0.0 m1.fr.2mdn.net +0.0.0.0 m1.it.2mdn.net +0.0.0.0 m1.jp.2mdn.net +0.0.0.0 m1.nl.2mdn.net +0.0.0.0 m1.no.2mdn.net +0.0.0.0 m1.nz.2mdn.net +0.0.0.0 m1.pl.2mdn.net +0.0.0.0 m1.se.2mdn.net +0.0.0.0 m1.sg.2mdn.net +0.0.0.0 m1.uk.2mdn.net +0.0.0.0 m1.ve.2mdn.net +0.0.0.0 m1.za.2mdn.net +0.0.0.0 m2.ae.2mdn.net +0.0.0.0 m2.au.2mdn.net +0.0.0.0 m2.be.2mdn.net +0.0.0.0 m2.br.2mdn.net +0.0.0.0 m2.ca.2mdn.net +0.0.0.0 m2.cn.2mdn.net +0.0.0.0 m2.cn.doubleclick.net +0.0.0.0 m2.de.2mdn.net +0.0.0.0 m2.dk.2mdn.net +0.0.0.0 m2.doubleclick.net +0.0.0.0 m2.es.2mdn.net +0.0.0.0 m2.fi.2mdn.net +0.0.0.0 m2.fr.2mdn.net +0.0.0.0 m2.it.2mdn.net +0.0.0.0 m2.jp.2mdn.net +0.0.0.0 m.2mdn.net +0.0.0.0 m2.nl.2mdn.net +0.0.0.0 m2.no.2mdn.net +0.0.0.0 m2.nz.2mdn.net +0.0.0.0 m2.pl.2mdn.net +0.0.0.0 m2.se.2mdn.net +0.0.0.0 m2.sg.2mdn.net +0.0.0.0 m2.uk.2mdn.net +0.0.0.0 m2.ve.2mdn.net +0.0.0.0 m2.za.2mdn.net +0.0.0.0 m3.ae.2mdn.net +0.0.0.0 m3.au.2mdn.net +0.0.0.0 m3.be.2mdn.net +0.0.0.0 m3.br.2mdn.net +0.0.0.0 m3.ca.2mdn.net +0.0.0.0 m3.cn.2mdn.net +0.0.0.0 m3.de.2mdn.net +0.0.0.0 m3.dk.2mdn.net +0.0.0.0 m3.doubleclick.net +0.0.0.0 m3.es.2mdn.net +0.0.0.0 m3.fi.2mdn.net +0.0.0.0 m3.fr.2mdn.net +0.0.0.0 m3.it.2mdn.net +0.0.0.0 m3.jp.2mdn.net +0.0.0.0 m3.nl.2mdn.net +0.0.0.0 m3.no.2mdn.net +0.0.0.0 m3.nz.2mdn.net +0.0.0.0 m3.pl.2mdn.net +0.0.0.0 m3.se.2mdn.net +0.0.0.0 m3.sg.2mdn.net +0.0.0.0 m3.uk.2mdn.net +0.0.0.0 m3.ve.2mdn.net +0.0.0.0 m3.za.2mdn.net +0.0.0.0 m4.ae.2mdn.net +0.0.0.0 m4.au.2mdn.net +0.0.0.0 m4.be.2mdn.net +0.0.0.0 m4.br.2mdn.net +0.0.0.0 m4.ca.2mdn.net +0.0.0.0 m4.cn.2mdn.net +0.0.0.0 m4.de.2mdn.net +0.0.0.0 m4.dk.2mdn.net +0.0.0.0 m4.doubleclick.net +0.0.0.0 m4.es.2mdn.net +0.0.0.0 m4.fi.2mdn.net +0.0.0.0 m4.fr.2mdn.net +0.0.0.0 m4.it.2mdn.net +0.0.0.0 m4.jp.2mdn.net +0.0.0.0 m4.nl.2mdn.net +0.0.0.0 m4.no.2mdn.net +0.0.0.0 m4.nz.2mdn.net +0.0.0.0 m4.pl.2mdn.net +0.0.0.0 m4.se.2mdn.net +0.0.0.0 m4.sg.2mdn.net +0.0.0.0 m4.uk.2mdn.net +0.0.0.0 m4.ve.2mdn.net +0.0.0.0 m4.za.2mdn.net +0.0.0.0 m5.ae.2mdn.net +0.0.0.0 m5.au.2mdn.net +0.0.0.0 m5.be.2mdn.net +0.0.0.0 m5.br.2mdn.net +0.0.0.0 m5.ca.2mdn.net +0.0.0.0 m5.cn.2mdn.net +0.0.0.0 m5.de.2mdn.net +0.0.0.0 m5.dk.2mdn.net +0.0.0.0 m5.doubleclick.net +0.0.0.0 m5.es.2mdn.net +0.0.0.0 m5.fi.2mdn.net +0.0.0.0 m5.fr.2mdn.net +0.0.0.0 m5.it.2mdn.net +0.0.0.0 m5.jp.2mdn.net +0.0.0.0 m5.nl.2mdn.net +0.0.0.0 m5.no.2mdn.net +0.0.0.0 m5.nz.2mdn.net +0.0.0.0 m5.pl.2mdn.net +0.0.0.0 m5.se.2mdn.net +0.0.0.0 m5.sg.2mdn.net +0.0.0.0 m5.uk.2mdn.net +0.0.0.0 m5.ve.2mdn.net +0.0.0.0 m5.za.2mdn.net +0.0.0.0 m6.ae.2mdn.net +0.0.0.0 m6.au.2mdn.net +0.0.0.0 m6.be.2mdn.net +0.0.0.0 m6.br.2mdn.net +0.0.0.0 m6.ca.2mdn.net +0.0.0.0 m6.cn.2mdn.net +0.0.0.0 m6.de.2mdn.net +0.0.0.0 m6.dk.2mdn.net +0.0.0.0 m6.doubleclick.net +0.0.0.0 m6.es.2mdn.net +0.0.0.0 m6.fi.2mdn.net +0.0.0.0 m6.fr.2mdn.net +0.0.0.0 m6.it.2mdn.net +0.0.0.0 m6.jp.2mdn.net +0.0.0.0 m6.nl.2mdn.net +0.0.0.0 m6.no.2mdn.net +0.0.0.0 m6.nz.2mdn.net +0.0.0.0 m6.pl.2mdn.net +0.0.0.0 m6.se.2mdn.net +0.0.0.0 m6.sg.2mdn.net +0.0.0.0 m6.uk.2mdn.net +0.0.0.0 m6.ve.2mdn.net +0.0.0.0 m6.za.2mdn.net +0.0.0.0 m7.ae.2mdn.net +0.0.0.0 m7.au.2mdn.net +0.0.0.0 m7.be.2mdn.net +0.0.0.0 m7.br.2mdn.net +0.0.0.0 m7.ca.2mdn.net +0.0.0.0 m7.cn.2mdn.net +0.0.0.0 m7.de.2mdn.net +0.0.0.0 m7.dk.2mdn.net +0.0.0.0 m7.doubleclick.net +0.0.0.0 m7.es.2mdn.net +0.0.0.0 m7.fi.2mdn.net +0.0.0.0 m7.fr.2mdn.net +0.0.0.0 m7.it.2mdn.net +0.0.0.0 m7.jp.2mdn.net +0.0.0.0 m7.nl.2mdn.net +0.0.0.0 m7.no.2mdn.net +0.0.0.0 m7.nz.2mdn.net +0.0.0.0 m7.pl.2mdn.net +0.0.0.0 m7.se.2mdn.net +0.0.0.0 m7.sg.2mdn.net +0.0.0.0 m7.uk.2mdn.net +0.0.0.0 m7.ve.2mdn.net +0.0.0.0 m7.za.2mdn.net +0.0.0.0 m8.ae.2mdn.net +0.0.0.0 m8.au.2mdn.net +0.0.0.0 m8.be.2mdn.net +0.0.0.0 m8.br.2mdn.net +0.0.0.0 m8.ca.2mdn.net +0.0.0.0 m8.cn.2mdn.net +0.0.0.0 m8.de.2mdn.net +0.0.0.0 m8.dk.2mdn.net +0.0.0.0 m8.doubleclick.net +0.0.0.0 m8.es.2mdn.net +0.0.0.0 m8.fi.2mdn.net +0.0.0.0 m8.fr.2mdn.net +0.0.0.0 m8.it.2mdn.net +0.0.0.0 m8.jp.2mdn.net +0.0.0.0 m8.nl.2mdn.net +0.0.0.0 m8.no.2mdn.net +0.0.0.0 m8.nz.2mdn.net +0.0.0.0 m8.pl.2mdn.net +0.0.0.0 m8.se.2mdn.net +0.0.0.0 m8.sg.2mdn.net +0.0.0.0 m8.uk.2mdn.net +0.0.0.0 m8.ve.2mdn.net +0.0.0.0 m8.za.2mdn.net +0.0.0.0 m9.ae.2mdn.net +0.0.0.0 m9.au.2mdn.net +0.0.0.0 m9.be.2mdn.net +0.0.0.0 m9.br.2mdn.net +0.0.0.0 m9.ca.2mdn.net +0.0.0.0 m9.cn.2mdn.net +0.0.0.0 m9.de.2mdn.net +0.0.0.0 m9.dk.2mdn.net +0.0.0.0 m9.doubleclick.net +0.0.0.0 m9.es.2mdn.net +0.0.0.0 m9.fi.2mdn.net +0.0.0.0 m9.fr.2mdn.net +0.0.0.0 m9.it.2mdn.net +0.0.0.0 m9.jp.2mdn.net +0.0.0.0 m9.nl.2mdn.net +0.0.0.0 m9.no.2mdn.net +0.0.0.0 m9.nz.2mdn.net +0.0.0.0 m9.pl.2mdn.net +0.0.0.0 m9.se.2mdn.net +0.0.0.0 m9.sg.2mdn.net +0.0.0.0 m9.uk.2mdn.net +0.0.0.0 m9.ve.2mdn.net +0.0.0.0 m9.za.2mdn.net +0.0.0.0 m.de.2mdn.net +0.0.0.0 m.doubleclick.net +0.0.0.0 n3302ad.doubleclick.net +0.0.0.0 n3349ad.doubleclick.net +0.0.0.0 n4061ad.doubleclick.net +0.0.0.0 n4403ad.doubleclick.net +0.0.0.0 n479ad.doubleclick.net +0.0.0.0 optimize.doubleclick.net +0.0.0.0 pubads.g.doubleclick.net +0.0.0.0 rd.intl.doubleclick.net +0.0.0.0 securepubads.g.doubleclick.net +0.0.0.0 stats.g.doubleclick.net +0.0.0.0 twx.2mdn.net +0.0.0.0 twx.doubleclick.net +0.0.0.0 ukrpts.net +0.0.0.0 uunyadgda1.doubleclick.net +0.0.0.0 uunyadgds1.doubleclick.net +0.0.0.0 www.ukrpts.net +# + +# + +0.0.0.0 1up.us.intellitxt.com +0.0.0.0 5starhiphop.us.intellitxt.com +0.0.0.0 askmen2.us.intellitxt.com +0.0.0.0 bargainpda.us.intellitxt.com +0.0.0.0 businesspundit.us.intellitxt.com +0.0.0.0 canadafreepress.us.intellitxt.com +0.0.0.0 contactmusic.uk.intellitxt.com +0.0.0.0 ctv.us.intellitxt.com +0.0.0.0 designtechnica.us.intellitxt.com +0.0.0.0 devshed.us.intellitxt.com +0.0.0.0 digitaltrends.us.intellitxt.com +0.0.0.0 dnps.us.intellitxt.com +0.0.0.0 doubleviking.us.intellitxt.com +0.0.0.0 drizzydrake.us.intellitxt.com +0.0.0.0 ehow.us.intellitxt.com +0.0.0.0 entertainment.msnbc.us.intellitxt.com +0.0.0.0 examnotes.us.intellitxt.com +0.0.0.0 excite.us.intellitxt.com +0.0.0.0 experts.us.intellitxt.com +0.0.0.0 extremetech.us.intellitxt.com +0.0.0.0 ferrago.uk.intellitxt.com +0.0.0.0 filmschoolrejects.us.intellitxt.com +0.0.0.0 filmwad.us.intellitxt.com +0.0.0.0 firstshowing.us.intellitxt.com +0.0.0.0 flashmagazine.us.intellitxt.com +0.0.0.0 foxnews.us.intellitxt.com +0.0.0.0 foxtv.us.intellitxt.com +0.0.0.0 freedownloadcenter.uk.intellitxt.com +0.0.0.0 gadgets.fosfor.se.intellitxt.com +0.0.0.0 gamesradar.us.intellitxt.com +0.0.0.0 gannettbroadcast.us.intellitxt.com +0.0.0.0 gonintendo.us.intellitxt.com +0.0.0.0 gorillanation.us.intellitxt.com +0.0.0.0 hackedgadgets.us.intellitxt.com +0.0.0.0 hardcoreware.us.intellitxt.com +0.0.0.0 hardocp.us.intellitxt.com +0.0.0.0 hothardware.us.intellitxt.com +0.0.0.0 hotonlinenews.us.intellitxt.com +0.0.0.0 ign.us.intellitxt.com +0.0.0.0 images.intellitxt.com +0.0.0.0 itxt2.us.intellitxt.com +0.0.0.0 joblo.us.intellitxt.com +0.0.0.0 johnchow.us.intellitxt.com +0.0.0.0 laptopmag.us.intellitxt.com +0.0.0.0 linuxforums.us.intellitxt.com +0.0.0.0 maccity.it.intellitxt.com +0.0.0.0 macnn.us.intellitxt.com +0.0.0.0 macuser.uk.intellitxt.com +0.0.0.0 macworld.uk.intellitxt.com +0.0.0.0 metro.uk.intellitxt.com +0.0.0.0 mobile9.us.intellitxt.com +0.0.0.0 monstersandcritics.uk.intellitxt.com +0.0.0.0 moviesonline.ca.intellitxt.com +0.0.0.0 mustangevolution.us.intellitxt.com +0.0.0.0 neowin.us.intellitxt.com +0.0.0.0 newcarnet.uk.intellitxt.com +0.0.0.0 newlaunches.uk.intellitxt.com +0.0.0.0 nexys404.us.intellitxt.com +0.0.0.0 ohgizmo.us.intellitxt.com +0.0.0.0 pcadvisor.uk.intellitxt.com +0.0.0.0 pcgameshardware.de.intellitxt.com +0.0.0.0 pcmag.us.intellitxt.com +0.0.0.0 pcper.us.intellitxt.com +0.0.0.0 penton.us.intellitxt.com +0.0.0.0 physorg.uk.intellitxt.com +0.0.0.0 physorg.us.intellitxt.com +0.0.0.0 playfuls.uk.intellitxt.com +0.0.0.0 pocketlint.uk.intellitxt.com +0.0.0.0 popularmechanics.us.intellitxt.com +0.0.0.0 postchronicle.us.intellitxt.com +0.0.0.0 projectorreviews.us.intellitxt.com +0.0.0.0 psp3d.us.intellitxt.com +0.0.0.0 pspcave.uk.intellitxt.com +0.0.0.0 qj.us.intellitxt.com +0.0.0.0 rasmussenreports.us.intellitxt.com +0.0.0.0 rawstory.us.intellitxt.com +0.0.0.0 savemanny.us.intellitxt.com +0.0.0.0 sc.intellitxt.com +0.0.0.0 siliconera.us.intellitxt.com +0.0.0.0 slashphone.us.intellitxt.com +0.0.0.0 soft32.us.intellitxt.com +0.0.0.0 softpedia.uk.intellitxt.com +0.0.0.0 somethingawful.us.intellitxt.com +0.0.0.0 splashnews.uk.intellitxt.com +0.0.0.0 spymac.us.intellitxt.com +0.0.0.0 techeblog.us.intellitxt.com +0.0.0.0 technewsworld.us.intellitxt.com +0.0.0.0 technologyreview.us.intellitxt.com +0.0.0.0 techspot.us.intellitxt.com +0.0.0.0 tgdaily.us.intellitxt.com +0.0.0.0 the-gadgeteer.us.intellitxt.com +0.0.0.0 thelastboss.us.intellitxt.com +0.0.0.0 thetechzone.us.intellitxt.com +0.0.0.0 thoughtsmedia.us.intellitxt.com +0.0.0.0 tmcnet.us.intellitxt.com +0.0.0.0 tomsnetworking.us.intellitxt.com +0.0.0.0 toms.us.intellitxt.com +0.0.0.0 tribal.us.intellitxt.com # vibrantmedia.com +0.0.0.0 universetoday.us.intellitxt.com +0.0.0.0 us.intellitxt.com +0.0.0.0 warp2search.us.intellitxt.com +0.0.0.0 wi-fitechnology.uk.intellitxt.com +0.0.0.0 worldnetdaily.us.intellitxt.com +# + +# + +# Red Sheriff and imrworldwide.com -- server side tracking +0.0.0.0 devfw.imrworldwide.com +0.0.0.0 fe1-au.imrworldwide.com +0.0.0.0 fe1-fi.imrworldwide.com +0.0.0.0 fe1-it.imrworldwide.com +0.0.0.0 fe2-au.imrworldwide.com +0.0.0.0 fe3-au.imrworldwide.com +0.0.0.0 fe3-gc.imrworldwide.com +0.0.0.0 fe3-uk.imrworldwide.com +0.0.0.0 fe4-uk.imrworldwide.com +0.0.0.0 fe-au.imrworldwide.com +0.0.0.0 imrworldwide.com +0.0.0.0 lycos-eu.imrworldwide.com +0.0.0.0 ninemsn.imrworldwide.com +0.0.0.0 rc-au.imrworldwide.com +0.0.0.0 redsheriff.com +#0.0.0.0 secure-au.imrworldwide.com +0.0.0.0 secure-jp.imrworldwide.com +0.0.0.0 secure-nz.imrworldwide.com +0.0.0.0 secure-uk.imrworldwide.com +0.0.0.0 secure-us.imrworldwide.com +0.0.0.0 secure-za.imrworldwide.com +0.0.0.0 server-au.imrworldwide.com +0.0.0.0 server-br.imrworldwide.com +0.0.0.0 server-by.imrworldwide.com +0.0.0.0 server-ca.imrworldwide.com +0.0.0.0 server-de.imrworldwide.com +0.0.0.0 server-dk.imrworldwide.com +0.0.0.0 server-ee.imrworldwide.com +0.0.0.0 server-fi.imrworldwide.com +0.0.0.0 server-fr.imrworldwide.com +0.0.0.0 server-hk.imrworldwide.com +0.0.0.0 server-it.imrworldwide.com +0.0.0.0 server-jp.imrworldwide.com +0.0.0.0 server-lt.imrworldwide.com +0.0.0.0 server-lv.imrworldwide.com +0.0.0.0 server-no.imrworldwide.com +0.0.0.0 server-nz.imrworldwide.com +0.0.0.0 server-oslo.imrworldwide.com +0.0.0.0 server-pl.imrworldwide.com +0.0.0.0 server-ru.imrworldwide.com +0.0.0.0 server-se.imrworldwide.com +0.0.0.0 server-sg.imrworldwide.com +0.0.0.0 server-stockh.imrworldwide.com +0.0.0.0 server-ua.imrworldwide.com +0.0.0.0 server-uk.imrworldwide.com +0.0.0.0 server-us.imrworldwide.com +0.0.0.0 server-za.imrworldwide.com +0.0.0.0 survey1-au.imrworldwide.com +0.0.0.0 telstra.imrworldwide.com +0.0.0.0 www.imrworldwide.com +0.0.0.0 www.imrworldwide.com.au +0.0.0.0 www.redsheriff.com +# + +# + +# cydoor -- server side tracking +0.0.0.0 cydoor.com +0.0.0.0 j.2004cms.com # cydoor +0.0.0.0 jbaventures.cjt1.net +0.0.0.0 jbeet.cjt1.net +0.0.0.0 jbit.cjt1.net +0.0.0.0 jcollegehumor.cjt1.net +0.0.0.0 jcontent.bns1.net +0.0.0.0 jdownloadacc.cjt1.net +0.0.0.0 jgen10.cjt1.net +0.0.0.0 jgen11.cjt1.net +0.0.0.0 jgen12.cjt1.net +0.0.0.0 jgen13.cjt1.net +0.0.0.0 jgen14.cjt1.net +0.0.0.0 jgen15.cjt1.net +0.0.0.0 jgen16.cjt1.net +0.0.0.0 jgen17.cjt1.net +0.0.0.0 jgen18.cjt1.net +0.0.0.0 jgen19.cjt1.net +0.0.0.0 jgen1.cjt1.net +0.0.0.0 jgen20.cjt1.net +0.0.0.0 jgen21.cjt1.net +0.0.0.0 jgen22.cjt1.net +0.0.0.0 jgen23.cjt1.net +0.0.0.0 jgen24.cjt1.net +0.0.0.0 jgen25.cjt1.net +0.0.0.0 jgen26.cjt1.net +0.0.0.0 jgen27.cjt1.net +0.0.0.0 jgen28.cjt1.net +0.0.0.0 jgen29.cjt1.net +0.0.0.0 jgen2.cjt1.net +0.0.0.0 jgen30.cjt1.net +0.0.0.0 jgen31.cjt1.net +0.0.0.0 jgen32.cjt1.net +0.0.0.0 jgen33.cjt1.net +0.0.0.0 jgen34.cjt1.net +0.0.0.0 jgen35.cjt1.net +0.0.0.0 jgen36.cjt1.net +0.0.0.0 jgen37.cjt1.net +0.0.0.0 jgen38.cjt1.net +0.0.0.0 jgen39.cjt1.net +0.0.0.0 jgen3.cjt1.net +0.0.0.0 jgen40.cjt1.net +0.0.0.0 jgen41.cjt1.net +0.0.0.0 jgen42.cjt1.net +0.0.0.0 jgen43.cjt1.net +0.0.0.0 jgen44.cjt1.net +0.0.0.0 jgen45.cjt1.net +0.0.0.0 jgen46.cjt1.net +0.0.0.0 jgen47.cjt1.net +0.0.0.0 jgen48.cjt1.net +0.0.0.0 jgen49.cjt1.net +0.0.0.0 jgen4.cjt1.net +0.0.0.0 jgen5.cjt1.net +0.0.0.0 jgen6.cjt1.net +0.0.0.0 jgen7.cjt1.net +0.0.0.0 jgen8.cjt1.net +0.0.0.0 jgen9.cjt1.net +0.0.0.0 jhumour.cjt1.net +0.0.0.0 jmbi58.cjt1.net +0.0.0.0 jnova.cjt1.net +0.0.0.0 jpirate.cjt1.net +0.0.0.0 jsandboxer.cjt1.net +0.0.0.0 jumcna.cjt1.net +0.0.0.0 jwebbsense.cjt1.net +0.0.0.0 www.cydoor.com +# + +#<2o7-sites> + +# 2o7.net -- server side tracking +0.0.0.0 102.112.2o7.net +0.0.0.0 102.122.2o7.net +0.0.0.0 112.2o7.net +0.0.0.0 122.2o7.net +0.0.0.0 192.168.112.2o7.net +0.0.0.0 2o7.net +0.0.0.0 actforvictory.112.2o7.net +0.0.0.0 adbrite.112.2o7.net +0.0.0.0 adbrite.122.2o7.net +0.0.0.0 aehistory.112.2o7.net +0.0.0.0 aetv.112.2o7.net +0.0.0.0 agamgreetingscom.112.2o7.net +0.0.0.0 allbritton.122.2o7.net +0.0.0.0 americanbaby.112.2o7.net +0.0.0.0 ancestrymsn.112.2o7.net +0.0.0.0 ancestryuki.112.2o7.net +0.0.0.0 angiba.112.2o7.net +0.0.0.0 angmar.112.2o7.net +0.0.0.0 angtr.112.2o7.net +0.0.0.0 angts.112.2o7.net +0.0.0.0 angvac.112.2o7.net +0.0.0.0 anm.112.2o7.net +0.0.0.0 aolcareers.122.2o7.net +0.0.0.0 aoldlama.122.2o7.net +0.0.0.0 aoljournals.122.2o7.net +0.0.0.0 aolnsnews.122.2o7.net +0.0.0.0 aolpf.122.2o7.net +0.0.0.0 aolpolls.112.2o7.net +0.0.0.0 aolpolls.122.2o7.net +0.0.0.0 aolsearch.122.2o7.net +0.0.0.0 aolsvc.122.2o7.net +0.0.0.0 aoltmz.122.2o7.net +0.0.0.0 aolturnercnnmoney.112.2o7.net +0.0.0.0 aolturnercnnmoney.122.2o7.net +0.0.0.0 aolturnersi.122.2o7.net +0.0.0.0 aolukglobal.122.2o7.net +0.0.0.0 aolwinamp.122.2o7.net +0.0.0.0 aolwpaim.112.2o7.net +0.0.0.0 aolwpicq.122.2o7.net +0.0.0.0 aolwpmq.112.2o7.net +0.0.0.0 aolwpmqnoban.112.2o7.net +0.0.0.0 apdigitalorg.112.2o7.net +0.0.0.0 apdigitalorgovn.112.2o7.net +0.0.0.0 apnonline.112.2o7.net +#0.0.0.0 appleglobal.112.2o7.net #breaks apple.com +#0.0.0.0 applestoreus.112.2o7.net #breaks apple.com +0.0.0.0 atlassian.122.2o7.net +0.0.0.0 autobytel.112.2o7.net +0.0.0.0 autoweb.112.2o7.net +0.0.0.0 bbcnewscouk.112.2o7.net +0.0.0.0 bellca.112.2o7.net +0.0.0.0 bellglobemediapublishing.122.2o7.net +0.0.0.0 bellglovemediapublishing.122.2o7.net +0.0.0.0 bellserviceeng.112.2o7.net +0.0.0.0 betterhg.112.2o7.net +0.0.0.0 bhgmarketing.112.2o7.net +0.0.0.0 bidentonrccom.122.2o7.net +0.0.0.0 biwwltvcom.112.2o7.net +0.0.0.0 biwwltvcom.122.2o7.net +0.0.0.0 blackpress.122.2o7.net +0.0.0.0 bnkr8dev.112.2o7.net +0.0.0.0 bntbcstglobal.112.2o7.net +0.0.0.0 bosecom.112.2o7.net +0.0.0.0 brightcove.112.2o7.net +0.0.0.0 bulldog.122.2o7.net +0.0.0.0 businessweekpoc.112.2o7.net +0.0.0.0 bzresults.122.2o7.net +0.0.0.0 cablevision.112.2o7.net +0.0.0.0 canwest.112.2o7.net +0.0.0.0 canwestcom.112.2o7.net +0.0.0.0 canwestglobal.112.2o7.net +0.0.0.0 capcityadvcom.112.2o7.net +0.0.0.0 capcityadvcom.122.2o7.net +0.0.0.0 careers.112.2o7.net +0.0.0.0 cartoonnetwork.122.2o7.net +0.0.0.0 cbaol.112.2o7.net +0.0.0.0 cbc.122.2o7.net +0.0.0.0 cbcca.112.2o7.net +0.0.0.0 cbcca.122.2o7.net +0.0.0.0 cbcincinnatienquirer.112.2o7.net +0.0.0.0 cbmsn.112.2o7.net +0.0.0.0 cbs.112.2o7.net +0.0.0.0 cbsncaasports.112.2o7.net +0.0.0.0 cbsnfl.112.2o7.net +0.0.0.0 cbspgatour.112.2o7.net +0.0.0.0 cbsspln.112.2o7.net +0.0.0.0 ccrbudgetca.112.2o7.net +0.0.0.0 ccrgaviscom.112.2o7.net +0.0.0.0 cfrfa.112.2o7.net +0.0.0.0 chicagosuntimes.122.2o7.net +0.0.0.0 chumtv.122.2o7.net +0.0.0.0 classifiedscanada.112.2o7.net +0.0.0.0 classmatescom.112.2o7.net +0.0.0.0 cmpglobalvista.112.2o7.net +0.0.0.0 cnetasiapacific.122.2o7.net +0.0.0.0 cnetaustralia.122.2o7.net +0.0.0.0 cneteurope.122.2o7.net +0.0.0.0 cnetnews.112.2o7.net +0.0.0.0 cnetzdnet.112.2o7.net +0.0.0.0 cnhienid.122.2o7.net +0.0.0.0 cnhimcalesternews.122.2o7.net +0.0.0.0 cnhipicayuneitemv.112.2o7.net +0.0.0.0 cnhitribunestar.122.2o7.net +0.0.0.0 cnhitribunestara.122.2o7.net +0.0.0.0 cnhregisterherald.122.2o7.net +0.0.0.0 cnn.122.2o7.net +0.0.0.0 computerworldcom.112.2o7.net +0.0.0.0 condenast.112.2o7.net +0.0.0.0 coxnetmasterglobal.112.2o7.net +0.0.0.0 coxpalmbeachpost.112.2o7.net +0.0.0.0 csoonlinecom.112.2o7.net +0.0.0.0 ctvcrimelibrary.112.2o7.net +0.0.0.0 ctvsmokinggun.112.2o7.net +0.0.0.0 cxociocom.112.2o7.net +0.0.0.0 denverpost.112.2o7.net +0.0.0.0 diginet.112.2o7.net +0.0.0.0 digitalhomediscountptyltd.122.2o7.net +0.0.0.0 disccglobal.112.2o7.net +0.0.0.0 disccstats.112.2o7.net +0.0.0.0 dischannel.112.2o7.net +0.0.0.0 divx.112.2o7.net +0.0.0.0 dixonslnkcouk.112.2o7.net +0.0.0.0 dogpile.112.2o7.net +0.0.0.0 donval.112.2o7.net +0.0.0.0 dowjones.122.2o7.net +0.0.0.0 dreammates.112.2o7.net +0.0.0.0 eaeacom.112.2o7.net +0.0.0.0 eagamesuk.112.2o7.net +0.0.0.0 earthlnkpsplive.122.2o7.net +0.0.0.0 ebay1.112.2o7.net +0.0.0.0 ebaynonreg.112.2o7.net +0.0.0.0 ebayreg.112.2o7.net +0.0.0.0 ebayus.112.2o7.net +0.0.0.0 ebcom.112.2o7.net +0.0.0.0 ectestlampsplus1.112.2o7.net +0.0.0.0 edietsmain.112.2o7.net +0.0.0.0 edmundsinsideline.112.2o7.net +0.0.0.0 edsa.112.2o7.net +0.0.0.0 ehg-moma.hitbox.com.112.2o7.net +0.0.0.0 emc.122.2o7.net +0.0.0.0 employ22.112.2o7.net +0.0.0.0 employ26.112.2o7.net +0.0.0.0 employment.112.2o7.net +0.0.0.0 enterprisenewsmedia.122.2o7.net +0.0.0.0 epost.122.2o7.net +0.0.0.0 ewsnaples.112.2o7.net +0.0.0.0 ewstcpalm.112.2o7.net +0.0.0.0 examinercom.122.2o7.net +0.0.0.0 execulink.112.2o7.net +0.0.0.0 expedia4.112.2o7.net +0.0.0.0 expedia.ca.112.2o7.net +0.0.0.0 f2ncracker.112.2o7.net +0.0.0.0 f2nsmh.112.2o7.net +0.0.0.0 f2ntheage.112.2o7.net +0.0.0.0 faceoff.112.2o7.net +0.0.0.0 fbkmnr.112.2o7.net +0.0.0.0 forbesattache.112.2o7.net +0.0.0.0 forbesauto.112.2o7.net +0.0.0.0 forbesautos.112.2o7.net +0.0.0.0 forbescom.112.2o7.net +0.0.0.0 ford.112.2o7.net +0.0.0.0 foxcom.112.2o7.net +0.0.0.0 foxsimpsons.112.2o7.net +0.0.0.0 georgewbush.112.2o7.net +0.0.0.0 georgewbushcom.112.2o7.net +0.0.0.0 gettyimages.122.2o7.net +0.0.0.0 gjfastcompanycom.112.2o7.net +0.0.0.0 gmchevyapprentice.112.2o7.net +0.0.0.0 gmhummer.112.2o7.net +0.0.0.0 gntbcstglobal.112.2o7.net +0.0.0.0 gntbcstkxtv.112.2o7.net +0.0.0.0 gntbcstwtsp.112.2o7.net +0.0.0.0 gpaper104.112.2o7.net +0.0.0.0 gpaper105.112.2o7.net +0.0.0.0 gpaper107.112.2o7.net +0.0.0.0 gpaper108.112.2o7.net +0.0.0.0 gpaper109.112.2o7.net +0.0.0.0 gpaper110.112.2o7.net +0.0.0.0 gpaper111.112.2o7.net +0.0.0.0 gpaper112.112.2o7.net +0.0.0.0 gpaper113.112.2o7.net +0.0.0.0 gpaper114.112.2o7.net +0.0.0.0 gpaper115.112.2o7.net +0.0.0.0 gpaper116.112.2o7.net +0.0.0.0 gpaper117.112.2o7.net +0.0.0.0 gpaper118.112.2o7.net +0.0.0.0 gpaper119.112.2o7.net +0.0.0.0 gpaper120.112.2o7.net +0.0.0.0 gpaper121.112.2o7.net +0.0.0.0 gpaper122.112.2o7.net +0.0.0.0 gpaper123.112.2o7.net +0.0.0.0 gpaper124.112.2o7.net +0.0.0.0 gpaper125.112.2o7.net +0.0.0.0 gpaper126.112.2o7.net +0.0.0.0 gpaper127.112.2o7.net +0.0.0.0 gpaper128.112.2o7.net +0.0.0.0 gpaper129.112.2o7.net +0.0.0.0 gpaper131.112.2o7.net +0.0.0.0 gpaper132.112.2o7.net +0.0.0.0 gpaper133.112.2o7.net +0.0.0.0 gpaper138.112.2o7.net +0.0.0.0 gpaper139.112.2o7.net +0.0.0.0 gpaper140.112.2o7.net +0.0.0.0 gpaper141.112.2o7.net +0.0.0.0 gpaper142.112.2o7.net +0.0.0.0 gpaper144.112.2o7.net +0.0.0.0 gpaper145.112.2o7.net +0.0.0.0 gpaper147.112.2o7.net +0.0.0.0 gpaper149.112.2o7.net +0.0.0.0 gpaper151.112.2o7.net +0.0.0.0 gpaper154.112.2o7.net +0.0.0.0 gpaper156.112.2o7.net +0.0.0.0 gpaper157.112.2o7.net +0.0.0.0 gpaper158.112.2o7.net +0.0.0.0 gpaper162.112.2o7.net +0.0.0.0 gpaper164.112.2o7.net +0.0.0.0 gpaper166.112.2o7.net +0.0.0.0 gpaper167.112.2o7.net +0.0.0.0 gpaper169.112.2o7.net +0.0.0.0 gpaper170.112.2o7.net +0.0.0.0 gpaper171.112.2o7.net +0.0.0.0 gpaper172.112.2o7.net +0.0.0.0 gpaper173.112.2o7.net +0.0.0.0 gpaper174.112.2o7.net +0.0.0.0 gpaper176.112.2o7.net +0.0.0.0 gpaper177.112.2o7.net +0.0.0.0 gpaper180.112.2o7.net +0.0.0.0 gpaper183.112.2o7.net +0.0.0.0 gpaper184.112.2o7.net +0.0.0.0 gpaper191.112.2o7.net +0.0.0.0 gpaper192.112.2o7.net +0.0.0.0 gpaper193.112.2o7.net +0.0.0.0 gpaper194.112.2o7.net +0.0.0.0 gpaper195.112.2o7.net +0.0.0.0 gpaper196.112.2o7.net +0.0.0.0 gpaper197.112.2o7.net +0.0.0.0 gpaper198.112.2o7.net +0.0.0.0 gpaper202.112.2o7.net +0.0.0.0 gpaper204.112.2o7.net +0.0.0.0 gpaper205.112.2o7.net +0.0.0.0 gpaper212.112.2o7.net +0.0.0.0 gpaper214.112.2o7.net +0.0.0.0 gpaper219.112.2o7.net +0.0.0.0 gpaper223.112.2o7.net +0.0.0.0 harpo.122.2o7.net +0.0.0.0 hchrmain.112.2o7.net +0.0.0.0 heavycom.112.2o7.net +0.0.0.0 heavycom.122.2o7.net +0.0.0.0 homesclick.112.2o7.net +0.0.0.0 hostdomainpeople.112.2o7.net +0.0.0.0 hostdomainpeopleca.112.2o7.net +0.0.0.0 hostpowermedium.112.2o7.net +0.0.0.0 hpglobal.112.2o7.net +0.0.0.0 hphqglobal.112.2o7.net +0.0.0.0 hphqsearch.112.2o7.net +0.0.0.0 infomart.ca.112.2o7.net +0.0.0.0 infospace.com.112.2o7.net +0.0.0.0 intelcorpcim.112.2o7.net +0.0.0.0 intelglobal.112.2o7.net +0.0.0.0 ivillageglobal.112.2o7.net +0.0.0.0 jijsonline.122.2o7.net +0.0.0.0 jitmj4.122.2o7.net +0.0.0.0 johnlewis.112.2o7.net +0.0.0.0 journalregistercompany.122.2o7.net +0.0.0.0 kddi.122.2o7.net +0.0.0.0 krafteurope.112.2o7.net +0.0.0.0 ktva.112.2o7.net +0.0.0.0 ladieshj.112.2o7.net +0.0.0.0 laptopmag.122.2o7.net +0.0.0.0 laxnws.112.2o7.net +0.0.0.0 laxprs.112.2o7.net +0.0.0.0 laxpsd.112.2o7.net +0.0.0.0 ldsfch.112.2o7.net +0.0.0.0 leeenterprises.112.2o7.net +0.0.0.0 lenovo.112.2o7.net +0.0.0.0 logoworksdev.112.2o7.net +0.0.0.0 losu.112.2o7.net +0.0.0.0 mailtribune.112.2o7.net +0.0.0.0 maxim.122.2o7.net +0.0.0.0 maxvr.112.2o7.net +0.0.0.0 mdamarillo.112.2o7.net +0.0.0.0 mdjacksonville.112.2o7.net +0.0.0.0 mdtopeka.112.2o7.net +0.0.0.0 mdwardmore.112.2o7.net +0.0.0.0 mdwsavannah.112.2o7.net +0.0.0.0 medbroadcast.112.2o7.net +0.0.0.0 mediabistrocom.112.2o7.net +0.0.0.0 mediamatters.112.2o7.net +0.0.0.0 meetupcom.112.2o7.net +0.0.0.0 metacafe.122.2o7.net +0.0.0.0 mgjournalnow.112.2o7.net +0.0.0.0 mgtbo.112.2o7.net +0.0.0.0 mgtimesdispatch.112.2o7.net +0.0.0.0 mgwsls.112.2o7.net +0.0.0.0 mgwspa.112.2o7.net +0.0.0.0 microsoftconsumermarketing.112.2o7.net +0.0.0.0 microsofteup.112.2o7.net +0.0.0.0 microsoftwindows.112.2o7.net +0.0.0.0 midala.112.2o7.net +0.0.0.0 midar.112.2o7.net +0.0.0.0 midsen.112.2o7.net +0.0.0.0 mlbastros.112.2o7.net +0.0.0.0 mlbcolorado.112.2o7.net +0.0.0.0 mlbcom.112.2o7.net +0.0.0.0 mlbglobal08.112.2o7.net +0.0.0.0 mlbglobal.112.2o7.net +0.0.0.0 mlbhouston.112.2o7.net +0.0.0.0 mlbstlouis.112.2o7.net +0.0.0.0 mlbtoronto.112.2o7.net +0.0.0.0 mmsshopcom.112.2o7.net +0.0.0.0 mnfidnahub.112.2o7.net +0.0.0.0 mngidmn.112.2o7.net +0.0.0.0 mngirockymtnnews.112.2o7.net +0.0.0.0 mngislctrib.112.2o7.net +0.0.0.0 mngiyrkdr.112.2o7.net +0.0.0.0 mseuppremain.112.2o7.net +0.0.0.0 msnmercom.112.2o7.net +0.0.0.0 msnportal.112.2o7.net +0.0.0.0 mtvn.112.2o7.net +0.0.0.0 mtvu.112.2o7.net +0.0.0.0 mxmacromedia.112.2o7.net +0.0.0.0 myfamilyancestry.112.2o7.net +0.0.0.0 nasdaq.122.2o7.net +0.0.0.0 natgeoeditco.112.2o7.net +0.0.0.0 natgeoeditcom.112.2o7.net +0.0.0.0 natgeonews.112.2o7.net +0.0.0.0 natgeongmcom.112.2o7.net +0.0.0.0 nationalpost.112.2o7.net +0.0.0.0 nba.112.2o7.net +0.0.0.0 neber.112.2o7.net +0.0.0.0 netrp.112.2o7.net +0.0.0.0 netsdartboards.122.2o7.net +0.0.0.0 newsinteractive.112.2o7.net +0.0.0.0 newstimeslivecom.112.2o7.net +0.0.0.0 nike.112.2o7.net +0.0.0.0 nikeplus.112.2o7.net +0.0.0.0 nmanchorage.112.2o7.net +0.0.0.0 nmbrampton.112.2o7.net +0.0.0.0 nmcommancomedia.112.2o7.net +0.0.0.0 nmfresno.112.2o7.net +0.0.0.0 nmhiltonhead.112.2o7.net +0.0.0.0 nmkawartha.112.2o7.net +0.0.0.0 nmminneapolis.112.2o7.net +0.0.0.0 nmmississauga.112.2o7.net +0.0.0.0 nmnandomedia.112.2o7.net +0.0.0.0 nmraleigh.112.2o7.net +0.0.0.0 nmrockhill.112.2o7.net +0.0.0.0 nmsacramento.112.2o7.net +0.0.0.0 nmtoronto.112.2o7.net +0.0.0.0 nmtricity.112.2o7.net +0.0.0.0 nmyork.112.2o7.net +0.0.0.0 novellcom.112.2o7.net +0.0.0.0 nytbglobe.112.2o7.net +0.0.0.0 nytglobe.112.2o7.net +0.0.0.0 nythglobe.112.2o7.net +0.0.0.0 nytimesglobal.112.2o7.net +0.0.0.0 nytimesnonsampled.112.2o7.net +0.0.0.0 nytimesnoonsampled.112.2o7.net +0.0.0.0 nytmembercenter.112.2o7.net +0.0.0.0 nytrflorence.112.2o7.net +0.0.0.0 nytrgadsden.112.2o7.net +0.0.0.0 nytrgainseville.112.2o7.net +0.0.0.0 nytrhendersonville.112.2o7.net +0.0.0.0 nytrhouma.112.2o7.net +0.0.0.0 nytrlakeland.112.2o7.net +0.0.0.0 nytrsantarosa.112.2o7.net +0.0.0.0 nytrsarasota.112.2o7.net +0.0.0.0 nytrwilmington.112.2o7.net +0.0.0.0 nyttechnology.112.2o7.net +0.0.0.0 omniture.112.2o7.net +0.0.0.0 omnitureglobal.112.2o7.net +0.0.0.0 onlineindigoca.112.2o7.net +0.0.0.0 oracle.112.2o7.net +0.0.0.0 oraclecom.112.2o7.net +0.0.0.0 overstock.com.112.2o7.net +0.0.0.0 overturecomvista.112.2o7.net +0.0.0.0 paypal.112.2o7.net +0.0.0.0 poacprod.122.2o7.net +0.0.0.0 poconorecordcom.112.2o7.net +0.0.0.0 projectorpeople.112.2o7.net +0.0.0.0 publicationsunbound.112.2o7.net +0.0.0.0 pulharktheherald.112.2o7.net +0.0.0.0 pulpantagraph.112.2o7.net +0.0.0.0 rckymtnnws.112.2o7.net +0.0.0.0 recordnetcom.112.2o7.net +0.0.0.0 recordonlinecom.112.2o7.net +0.0.0.0 rey3935.112.2o7.net +0.0.0.0 rezrezwhistler.112.2o7.net +0.0.0.0 riptownmedia.122.2o7.net +0.0.0.0 rncgopcom.122.2o7.net +0.0.0.0 roxio.112.2o7.net +0.0.0.0 salesforce.122.2o7.net +0.0.0.0 santacruzsentinel.112.2o7.net +0.0.0.0 sciamglobal.112.2o7.net +0.0.0.0 scrippsbathvert.112.2o7.net +0.0.0.0 scrippsfoodnet.112.2o7.net +0.0.0.0 scrippswfts.112.2o7.net +0.0.0.0 scrippswxyz.112.2o7.net +0.0.0.0 seacoastonlinecom.112.2o7.net +0.0.0.0 searscom.112.2o7.net +0.0.0.0 smibs.112.2o7.net +0.0.0.0 smwww.112.2o7.net +0.0.0.0 sonycorporate.122.2o7.net +0.0.0.0 sonyglobal.112.2o7.net +0.0.0.0 southcoasttoday.112.2o7.net +0.0.0.0 spiketv.112.2o7.net +0.0.0.0 stpetersburgtimes.122.2o7.net +0.0.0.0 suncom.112.2o7.net +0.0.0.0 sunglobal.112.2o7.net +0.0.0.0 sunonesearch.112.2o7.net +0.0.0.0 survey.112.2o7.net +0.0.0.0 sympmsnsports.112.2o7.net +0.0.0.0 techreview.112.2o7.net +0.0.0.0 thestar.122.2o7.net +0.0.0.0 thestardev.122.2o7.net +0.0.0.0 thinkgeek.112.2o7.net +0.0.0.0 timebus2.112.2o7.net +0.0.0.0 timecom.112.2o7.net +0.0.0.0 timeew.122.2o7.net +0.0.0.0 timefortune.112.2o7.net +0.0.0.0 timehealth.112.2o7.net +0.0.0.0 timeofficepirates.122.2o7.net +0.0.0.0 timepeople.122.2o7.net +0.0.0.0 timepopsci.122.2o7.net +0.0.0.0 timerealsimple.112.2o7.net +0.0.0.0 timewarner.122.2o7.net +0.0.0.0 tmsscion.112.2o7.net +0.0.0.0 tmstoyota.112.2o7.net +0.0.0.0 tnttv.112.2o7.net +0.0.0.0 torstardigital.122.2o7.net +0.0.0.0 travidiathebrick.112.2o7.net +0.0.0.0 tribuneinteractive.122.2o7.net +0.0.0.0 usatoday1.112.2o7.net +0.0.0.0 usnews.122.2o7.net +0.0.0.0 usun.112.2o7.net +0.0.0.0 vanns.112.2o7.net +0.0.0.0 verisignwildcard.112.2o7.net +0.0.0.0 verisonwildcard.112.2o7.net +0.0.0.0 vh1com.112.2o7.net +0.0.0.0 viaatomvideo.112.2o7.net +0.0.0.0 viacomedycentralrl.112.2o7.net +0.0.0.0 viagametrailers.112.2o7.net +0.0.0.0 viamtvcom.112.2o7.net +0.0.0.0 viasyndimedia.112.2o7.net +0.0.0.0 viavh1com.112.2o7.net +0.0.0.0 viay2m.112.2o7.net +0.0.0.0 vintacom.112.2o7.net +0.0.0.0 viralvideo.112.2o7.net +0.0.0.0 walmartcom.112.2o7.net +0.0.0.0 westjet.112.2o7.net +0.0.0.0 wileydumcom.112.2o7.net +0.0.0.0 wmg.112.2o7.net +0.0.0.0 wmgmulti.112.2o7.net +0.0.0.0 workopolis.122.2o7.net +0.0.0.0 wpni.112.2o7.net +0.0.0.0 xhealthmobiletools.112.2o7.net +0.0.0.0 youtube.112.2o7.net +0.0.0.0 yrkeve.112.2o7.net +0.0.0.0 ziffdavisglobal.112.2o7.net +0.0.0.0 ziffdavispennyarcade.112.2o7.net +# + + +# ads +0.0.0.0 0101011.com +0.0.0.0 0427d7.se +0.0.0.0 0d79ed.r.axf8.net +0.0.0.0 104231.dtiblog.com +0.0.0.0 10.im.cz +0.0.0.0 123.fluxads.com +0.0.0.0 123specialgifts.com +#0.0.0.0 140cc.v.fwmrm.net #interferes with Comedy Central videos +0.0.0.0 1.adbrite.com +0.0.0.0 1.forgetstore.com +0.0.0.0 1.httpads.com +0.0.0.0 1.primaryads.com +0.0.0.0 207-87-18-203.wsmg.digex.net +0.0.0.0 247support.adtech.fr +0.0.0.0 247support.adtech.us +0.0.0.0 24ratownik.hit.gemius.pl +0.0.0.0 24trk.com +0.0.0.0 25184.hittail.com +0.0.0.0 2754.btrll.com +0.0.0.0 2912a.v.fwmrm.net +0.0.0.0 2.adbrite.com +0.0.0.0 2-art-coliseum.com +0.0.0.0 312.1d27c9b8fb.com +0.0.0.0 321cba.com +0.0.0.0 32red.it +0.0.0.0 360ads.com +0.0.0.0 3.adbrite.com +0.0.0.0 3.cennter.com +0.0.0.0 3fns.com +0.0.0.0 4.adbrite.com +0.0.0.0 4c28d6.r.axf8.net +0.0.0.0 4qinvite.4q.iperceptions.com +0.0.0.0 7500.com +0.0.0.0 76.a.boom.ro +0.0.0.0 7adpower.com +0.0.0.0 7bpeople.com +0.0.0.0 7bpeople.data.7bpeople.com +0.0.0.0 7cnbcnews.com +0.0.0.0 85103.hittail.com +0.0.0.0 8574dnj3yzjace8c8io6zr9u3n.hop.clickbank.net +0.0.0.0 888casino.com +0.0.0.0 961.com +0.0.0.0 9cf9.v.fwmrm.net +0.0.0.0 a01.gestionpub.com +0.0.0.0 a.0day.kiev.ua +0.0.0.0 a1.greenadworks.net +0.0.0.0 a1.interclick.com +0.0.0.0 a200.yieldoptimizer.com +0.0.0.0 a2.mediagra.com +0.0.0.0 a2.websponsors.com +0.0.0.0 a3.suntimes.com +0.0.0.0 a3.websponsors.com +0.0.0.0 a4.websponsors.com +0.0.0.0 a5.websponsors.com +0.0.0.0 a.admaxserver.com +0.0.0.0 a.adorika.net +0.0.0.0 a.ad.playstation.net +0.0.0.0 a.adready.com +0.0.0.0 a.ads1.msn.com +0.0.0.0 a.ads2.msn.com +0.0.0.0 a.adstome.com +0.0.0.0 aads.treehugger.com +0.0.0.0 aams1.aim4media.com +0.0.0.0 aan.amazon.com +0.0.0.0 aa-nb.marketgid.com +0.0.0.0 aa.newsblock.dt00.net +0.0.0.0 aa.newsblock.marketgid.com +0.0.0.0 a.as-eu.falkag.net +0.0.0.0 a.as-us.falkag.net +0.0.0.0 aax-us-east.amazon-adsystem.com +0.0.0.0 abcnews.footprint.net +0.0.0.0 a.boom.ro +0.0.0.0 abrogatesdv.info +0.0.0.0 abseckw.adtlgc.com +0.0.0.0 a.collective-media.net +0.0.0.0 ac.rnm.ca +0.0.0.0 actiondesk.com +0.0.0.0 actionflash.com +0.0.0.0 action.ientry.net +0.0.0.0 action.mathtag.com +0.0.0.0 action.media6degrees.com +0.0.0.0 actionsplash.com +0.0.0.0 ac.tynt.com +0.0.0.0 acvs.mediaonenetwork.net +0.0.0.0 acvsrv.mediaonenetwork.net +0.0.0.0 ad01.adonspot.com +0.0.0.0 ad01.focalink.com +0.0.0.0 ad01.mediacorpsingapore.com +0.0.0.0 ad02.focalink.com +0.0.0.0 ad03.focalink.com +0.0.0.0 ad04.focalink.com +0.0.0.0 ad05.focalink.com +0.0.0.0 ad06.focalink.com +0.0.0.0 ad07.focalink.com +0.0.0.0 ad08.focalink.com +0.0.0.0 ad09.focalink.com +0.0.0.0 ad0.haynet.com +0.0.0.0 ad101com.adbureau.net +0.0.0.0 ad10.bannerbank.ru +0.0.0.0 ad10.focalink.com +0.0.0.0 ad11.bannerbank.ru +0.0.0.0 ad11.focalink.com +0.0.0.0 ad12.bannerbank.ru +0.0.0.0 ad12.focalink.com +0.0.0.0 ad13.focalink.com +0.0.0.0 ad14.focalink.com +0.0.0.0 ad15.focalink.com +0.0.0.0 ad16.focalink.com +0.0.0.0 ad17.focalink.com +0.0.0.0 ad18.focalink.com +0.0.0.0 ad19.focalink.com +0.0.0.0 ad1.adtitan.net +0.0.0.0 ad1.bannerbank.ru +0.0.0.0 ad1.clickhype.com +0.0.0.0 ad1.emediate.dk +0.0.0.0 ad1.emediate.se +0.0.0.0 ad1.gamezone.com +0.0.0.0 ad1.hotel.com +0.0.0.0 ad1.lbn.ru +0.0.0.0 ad1.peel.com +0.0.0.0 ad1.popcap.com +0.0.0.0 ad1.yomiuri.co.jp +0.0.0.0 ad1.yourmedia.com +0.0.0.0 ad234.prbn.ru +0.0.0.0 ad2.adecn.com +0.0.0.0 ad2.bal.dotandad.com +0.0.0.0 ad2.bannerbank.ru +0.0.0.0 ad2.bannerhost.ru +0.0.0.0 ad2.bbmedia.cz +0.0.0.0 ad2.cooks.com +0.0.0.0 ad2.firehousezone.com +0.0.0.0 ad2games.com +0.0.0.0 ad2.gammae.com +0.0.0.0 ad2.hotel.com +0.0.0.0 ad2.ip.ro +0.0.0.0 ad2.lbn.ru +0.0.0.0 ad2.nationalreview.com +0.0.0.0 ad2.pamedia.com +0.0.0.0 ad2.parom.hu +0.0.0.0 ad2.peel.com +0.0.0.0 ad2.pl +0.0.0.0 ad2.pl.mediainter.net +0.0.0.0 ad2.sbisec.co.jp +0.0.0.0 ad2.smni.com +0.0.0.0 ad.360yield.com +0.0.0.0 ad3.adfarm1.adition.com +0.0.0.0 ad3.bannerbank.ru +0.0.0.0 ad3.bb.ru +0.0.0.0 ad.3dnews.ru +0.0.0.0 ad3.lbn.ru +0.0.0.0 ad3.nationalreview.com +0.0.0.0 ad3.rambler.ru +0.0.0.0 ad41.atlas.cz +0.0.0.0 ad4.adfarm1.adition.com +0.0.0.0 ad4.bannerbank.ru +0.0.0.0 ad4.lbn.ru +0.0.0.0 ad4.liverail.com +0.0.0.0 ad4.speedbit.com +0.0.0.0 ad5.bannerbank.ru +0.0.0.0 ad5.lbn.ru +0.0.0.0 ad6.bannerbank.ru +0.0.0.0 ad6.horvitznewspapers.net +0.0.0.0 ad.71i.de +0.0.0.0 ad7.bannerbank.ru +0.0.0.0 ad8.bannerbank.ru +0.0.0.0 ad9.bannerbank.ru +0.0.0.0 ad.abcnews.com +0.0.0.0 ad.aboutwebservices.com +0.0.0.0 ad.adfunky.com +0.0.0.0 ad.adition.de +0.0.0.0 ad.adition.net +0.0.0.0 ad.adlegend.com +0.0.0.0 ad.admarketplace.net +0.0.0.0 ad.adnet.biz +0.0.0.0 ad.adnet.de +0.0.0.0 ad.adnetwork.com.br +0.0.0.0 ad.adnetwork.net +0.0.0.0 ad.adorika.com +0.0.0.0 ad.adperium.com +0.0.0.0 ad.adriver.ru +0.0.0.0 ad.adserve.com +0.0.0.0 ad.adserverplus.com +0.0.0.0 ad.adsmart.net +0.0.0.0 ad.adtegrity.net +0.0.0.0 ad.adtoma.com +0.0.0.0 ad.adverticum.net +0.0.0.0 ad.advertstream.com +0.0.0.0 ad.adview.pl +0.0.0.0 ad.afilo.pl +0.0.0.0 ad.aftenposten.no +0.0.0.0 ad.aftonbladet.se +0.0.0.0 ad.afy11.net +0.0.0.0 ad.agava.tbn.ru +0.0.0.0 adagiobanner.s3.amazonaws.com +0.0.0.0 ad.agkn.com +0.0.0.0 ad.amgdgt.com +0.0.0.0 adap.tv +0.0.0.0 ad.aquamediadirect.com +0.0.0.0 ad.asv.de +0.0.0.0 ad-audit.tubemogul.com +0.0.0.0 ad.auditude.com +0.0.0.0 ad.bannerbank.ru +0.0.0.0 ad.bannerconnect.net +0.0.0.0 adblade.com +0.0.0.0 ad.bnmla.com +0.0.0.0 adbnr.ru +0.0.0.0 adbot.theonion.com +0.0.0.0 adbrite.com +0.0.0.0 adbucks.brandreachsys.com +0.0.0.0 adc2.adcentriconline.com +0.0.0.0 adcache.aftenposten.no +0.0.0.0 adcanadian.com +0.0.0.0 adcash.com +0.0.0.0 adcast.deviantart.com +0.0.0.0 adcentriconline.com +0.0.0.0 adcentric.randomseed.com +0.0.0.0 ad.cibleclick.com +0.0.0.0 ad.clickdistrict.com +0.0.0.0 adclick.hit.gemius.pl +0.0.0.0 ad.clickotmedia.com +0.0.0.0 adclient-af.lp.uol.com.br +0.0.0.0 adclient.uimserv.net +0.0.0.0 adcode.adengage.com +0.0.0.0 adcontent.gamespy.com +0.0.0.0 adcontent.reedbusiness.com +0.0.0.0 adcontent.videoegg.com +0.0.0.0 adcontroller.unicast.com +0.0.0.0 adcount.ohmynews.com +0.0.0.0 adcreative.tribuneinteractive.com +0.0.0.0 adcycle.footymad.net +0.0.0.0 adcycle.icpeurope.net +0.0.0.0 ad.dc2.adtech.de +0.0.0.0 addelivery.thestreet.com +0.0.0.0 ad.designtaxi.com +0.0.0.0 ad.deviantart.com +0.0.0.0 ad.directrev.com +0.0.0.0 addthiscdn.com +0.0.0.0 addthis.com +0.0.0.0 adecn.com +0.0.0.0 ad.egloos.com +0.0.0.0 adengine.rt.ru +0.0.0.0 ad.espn.starwave.com +0.0.0.0 ad.eurosport.com +0.0.0.0 adexpansion.com +0.0.0.0 adexprt.com +0.0.0.0 adexprt.me +0.0.0.0 adexprts.com +0.0.0.0 adext.inkclub.com +0.0.0.0 adfarm1.adition.com +0.0.0.0 adfarm.mserve.ca +0.0.0.0 adfiles.pitchforkmedia.com +0.0.0.0 ad.filmweb.pl +0.0.0.0 ad.firstadsolution.com +0.0.0.0 ad.flux.com +#0.0.0.0 adf.ly +0.0.0.0 adforce.ads.imgis.com +0.0.0.0 adforce.adtech.de +0.0.0.0 adforce.adtech.fr +0.0.0.0 adforce.adtech.us +0.0.0.0 adforce.imgis.com +0.0.0.0 adform.com +0.0.0.0 adfu.blockstackers.com +0.0.0.0 ad.funpic.de +0.0.0.0 adfusion.com +0.0.0.0 ad.garantiarkadas.com +0.0.0.0 adgardener.com +0.0.0.0 ad.gazeta.pl +0.0.0.0 ad.goo.ne.jp +0.0.0.0 adgraphics.theonion.com +0.0.0.0 ad.gra.pl +0.0.0.0 ad.gr.doubleclick.net +0.0.0.0 ad.greenmarquee.com +0.0.0.0 adgroup.naver.com +0.0.0.0 ad.hankooki.com +0.0.0.0 ad.harrenmedianetwork.com +0.0.0.0 adhearus.com +0.0.0.0 adhese.be +0.0.0.0 adhese.com +0.0.0.0 adhitzads.com +0.0.0.0 ad.horvitznewspapers.net +0.0.0.0 ad.host.bannerflow.com +0.0.0.0 ad.howstuffworks.com +0.0.0.0 adhref.pl +#0.0.0.0 ad.hulu.com # Uncomment to block Hulu. +0.0.0.0 ad.iconadserver.com +0.0.0.0 adidm.idmnet.pl +0.0.0.0 adidm.supermedia.pl +0.0.0.0 adimage.asia1.com.sg +0.0.0.0 adimage.asiaone.com +0.0.0.0 adimage.asiaone.com.sg +0.0.0.0 adimage.blm.net +0.0.0.0 adimages.earthweb.com +0.0.0.0 adimages.go.com +0.0.0.0 adimages.mp3.com +0.0.0.0 adimages.watchmygf.net +0.0.0.0 adi.mainichi.co.jp +0.0.0.0 adimg.activeadv.net +0.0.0.0 adimg.com.com +0.0.0.0 adincl.gopher.com +0.0.0.0 ad.insightexpressai.com +0.0.0.0 ad.investopedia.com +0.0.0.0 adipics.com +0.0.0.0 adireland.com +0.0.0.0 ad.ir.ru +0.0.0.0 ad.isohunt.com +0.0.0.0 adition.com +0.0.0.0 ad.iwin.com +0.0.0.0 adj10.thruport.com +0.0.0.0 adj11.thruport.com +0.0.0.0 adj12.thruport.com +0.0.0.0 adj13.thruport.com +0.0.0.0 adj14.thruport.com +0.0.0.0 adj15.thruport.com +0.0.0.0 adj16r1.thruport.com +0.0.0.0 adj16.thruport.com +0.0.0.0 adj17.thruport.com +0.0.0.0 adj18.thruport.com +0.0.0.0 adj19.thruport.com +0.0.0.0 adj1.thruport.com +0.0.0.0 adj22.thruport.com +0.0.0.0 adj23.thruport.com +0.0.0.0 adj24.thruport.com +0.0.0.0 adj25.thruport.com +0.0.0.0 adj26.thruport.com +0.0.0.0 adj27.thruport.com +0.0.0.0 adj28.thruport.com +0.0.0.0 adj29.thruport.com +0.0.0.0 adj2.thruport.com +0.0.0.0 adj30.thruport.com +0.0.0.0 adj31.thruport.com +0.0.0.0 adj32.thruport.com +0.0.0.0 adj33.thruport.com +0.0.0.0 adj34.thruport.com +0.0.0.0 adj35.thruport.com +0.0.0.0 adj36.thruport.com +0.0.0.0 adj37.thruport.com +0.0.0.0 adj38.thruport.com +0.0.0.0 adj39.thruport.com +0.0.0.0 adj3.thruport.com +0.0.0.0 adj40.thruport.com +0.0.0.0 adj41.thruport.com +0.0.0.0 adj43.thruport.com +0.0.0.0 adj44.thruport.com +0.0.0.0 adj45.thruport.com +0.0.0.0 adj46.thruport.com +0.0.0.0 adj47.thruport.com +0.0.0.0 adj48.thruport.com +0.0.0.0 adj49.thruport.com +0.0.0.0 adj4.thruport.com +0.0.0.0 adj50.thruport.com +0.0.0.0 adj51.thruport.com +0.0.0.0 adj52.thruport.com +0.0.0.0 adj53.thruport.com +0.0.0.0 adj54.thruport.com +0.0.0.0 adj55.thruport.com +0.0.0.0 adj56.thruport.com +0.0.0.0 adj5.thruport.com +0.0.0.0 adj6.thruport.com +0.0.0.0 adj7.thruport.com +0.0.0.0 adj8.thruport.com +0.0.0.0 adj9.thruport.com +0.0.0.0 ad.jamba.net +0.0.0.0 ad.jamster.ca +0.0.0.0 adjmps.com +0.0.0.0 adjuggler.net +0.0.0.0 adjuggler.yourdictionary.com +0.0.0.0 ad.kataweb.it +0.0.0.0 ad.kat.ph +0.0.0.0 adkontekst.pl +0.0.0.0 ad.krutilka.ru +0.0.0.0 ad.leadcrunch.com +0.0.0.0 ad.lgappstv.com +0.0.0.0 ad.linkexchange.com +0.0.0.0 ad.linksynergy.com +0.0.0.0 admanager1.collegepublisher.com +0.0.0.0 admanager2.broadbandpublisher.com +0.0.0.0 admanager3.collegepublisher.com +0.0.0.0 admanager.adam4adam.com +0.0.0.0 admanager.beweb.com +0.0.0.0 admanager.btopenworld.com +0.0.0.0 admanager.collegepublisher.com +0.0.0.0 adman.freeze.com +0.0.0.0 adman.in.gr +0.0.0.0 ad.mastermedia.ru +0.0.0.0 admatcher.videostrip.com #http://admatcher.videostrip.com/?puid=23940627&host=www.dumpert.nl&categories=default +0.0.0.0 admatch-syndication.mochila.com +0.0.0.0 admax.quisma.com +0.0.0.0 ad.media-servers.net +0.0.0.0 admedia.xoom.com +0.0.0.0 admeld.com +0.0.0.0 admeta.vo.llnwd.net +#0.0.0.0 adm.fwmrm.net #may interfere with nhl.com +0.0.0.0 admin.digitalacre.com +0.0.0.0 admin.hotkeys.com +0.0.0.0 admin.inq.com +0.0.0.0 admonkey.dapper.net +0.0.0.0 ad.moscowtimes.ru +0.0.0.0 adm.shacknews.com +0.0.0.0 adms.physorg.com +0.0.0.0 ad.my.doubleclick.net +0.0.0.0 ad.nate.com +0.0.0.0 adn.ebay.com +0.0.0.0 adnet.asahi.com +0.0.0.0 adnet.biz +0.0.0.0 adnet.chicago.tribune.com +0.0.0.0 adnet.com +0.0.0.0 adnet.de +0.0.0.0 ad.network60.com +0.0.0.0 adnetwork.nextgen.net +0.0.0.0 adnetwork.rovicorp.com +0.0.0.0 adnetxchange.com +0.0.0.0 adng.ascii24.com +0.0.0.0 adn.kinkydollars.com +0.0.0.0 ad.nozonedata.com +0.0.0.0 adnxs.com +0.0.0.0 adnxs.revsci.net +0.0.0.0 adobee.com +0.0.0.0 adobe.tt.omtrdc.net +0.0.0.0 adocean.pl +0.0.0.0 ad.ohmynews.com +0.0.0.0 adopt.euroclick.com +0.0.0.0 adopt.precisead.com +0.0.0.0 adotube.com +0.0.0.0 ad.parom.hu +0.0.0.0 ad.partis.si +0.0.0.0 adpepper.dk +0.0.0.0 adp.gazeta.pl +0.0.0.0 ad.ph-prt.tbn.ru +0.0.0.0 adpick.switchboard.com +0.0.0.0 ad.pravda.ru +0.0.0.0 ad.preferences.com +0.0.0.0 ad.pro-advertising.com +0.0.0.0 ad.propellerads.com +0.0.0.0 ad.prv.pl +0.0.0.0 adpulse.ads.targetnet.com +0.0.0.0 adpush.dreamscape.com +0.0.0.0 adq.nextag.com +0.0.0.0 adremote.pathfinder.com +0.0.0.0 adremote.timeinc.aol.com +0.0.0.0 adremote.timeinc.net +0.0.0.0 ad.repubblica.it +0.0.0.0 adriver.ru +0.0.0.0 adroll.com +0.0.0.0 adrotate.se +0.0.0.0 adrotator.se +0.0.0.0 ad.ru.doubleclick.net +0.0.0.0 ads01.focalink.com +0.0.0.0 ads01.hyperbanner.net +0.0.0.0 ads02.focalink.com +0.0.0.0 ads02.hyperbanner.net +0.0.0.0 ads03.focalink.com +0.0.0.0 ads03.hyperbanner.net +0.0.0.0 ads04.focalink.com +0.0.0.0 ads04.hyperbanner.net +0.0.0.0 ads05.focalink.com +0.0.0.0 ads05.hyperbanner.net +0.0.0.0 ads06.focalink.com +0.0.0.0 ads06.hyperbanner.net +0.0.0.0 ads07.focalink.com +0.0.0.0 ads07.hyperbanner.net +0.0.0.0 ads08.focalink.com +0.0.0.0 ads08.hyperbanner.net +0.0.0.0 ads09.focalink.com +0.0.0.0 ads09.hyperbanner.net +0.0.0.0 ads0.okcupid.com +0.0.0.0 ads10.focalink.com +0.0.0.0 ads10.hyperbanner.net +0.0.0.0 ads10.speedbit.com +0.0.0.0 ads10.udc.advance.net +0.0.0.0 ads11.focalink.com +0.0.0.0 ads11.hyperbanner.net +0.0.0.0 ads11.udc.advance.net +0.0.0.0 ads12.focalink.com +0.0.0.0 ads12.hyperbanner.net +0.0.0.0 ads12.udc.advance.net +0.0.0.0 ads13.focalink.com +0.0.0.0 ads13.hyperbanner.net +0.0.0.0 ads13.udc.advance.net +0.0.0.0 ads14.bpath.com +0.0.0.0 ads14.focalink.com +0.0.0.0 ads14.hyperbanner.net +0.0.0.0 ads14.udc.advance.net +0.0.0.0 ads15.bpath.com +0.0.0.0 ads15.focalink.com +0.0.0.0 ads15.hyperbanner.net +0.0.0.0 ads15.udc.advance.net +0.0.0.0 ads16.advance.net +0.0.0.0 ads16.focalink.com +0.0.0.0 ads16.hyperbanner.net +0.0.0.0 ads16.udc.advance.net +0.0.0.0 ads17.focalink.com +0.0.0.0 ads17.hyperbanner.net +0.0.0.0 ads18.focalink.com +0.0.0.0 ads18.hyperbanner.net +0.0.0.0 ads19.focalink.com +0.0.0.0 ads1.activeagent.at +0.0.0.0 ads1.ad-flow.com +0.0.0.0 ads1.admedia.ro +0.0.0.0 ads1.advance.net +0.0.0.0 ads1.advertwizard.com +0.0.0.0 ads1.ami-admin.com +0.0.0.0 ads1.canoe.ca +0.0.0.0 ads1.destructoid.com +0.0.0.0 ads1.empiretheatres.com +0.0.0.0 ads1.erotism.com +0.0.0.0 ads1.eudora.com +0.0.0.0 ads1.globeandmail.com +0.0.0.0 ads1.itadnetwork.co.uk +0.0.0.0 ads1.jev.co.za +0.0.0.0 ads1.msads.net +0.0.0.0 ads1.msn.com +0.0.0.0 ads1.perfadbrite.com.akadns.net +0.0.0.0 ads1.performancingads.com +0.0.0.0 ads1.realcities.com +0.0.0.0 ads1.revenue.net +0.0.0.0 ads1.sptimes.com +0.0.0.0 ads1.theglobeandmail.com +0.0.0.0 ads1.ucomics.com +0.0.0.0 ads1.udc.advance.net +0.0.0.0 ads1.updated.com +0.0.0.0 ads1.virtumundo.com +0.0.0.0 ads1.zdnet.com +0.0.0.0 ads20.focalink.com +0.0.0.0 ads21.focalink.com +0.0.0.0 ads22.focalink.com +0.0.0.0 ads23.focalink.com +0.0.0.0 ads24.focalink.com +0.0.0.0 ads25.focalink.com +0.0.0.0 ads2.adbrite.com +0.0.0.0 ads2.ad-flow.com +0.0.0.0 ads2.advance.net +0.0.0.0 ads2.advertwizard.com +0.0.0.0 ads2.canoe.ca +0.0.0.0 ads2.clearchannel.com +0.0.0.0 ads2.clickad.com +0.0.0.0 ads2.collegclub.com +0.0.0.0 ads2.collegeclub.com +0.0.0.0 ads2.contentabc.com +0.0.0.0 ads2.drivelinemedia.com +0.0.0.0 ads2.emeraldcoast.com +0.0.0.0 ads2.exhedra.com +0.0.0.0 ads2.firingsquad.com +0.0.0.0 ads2.gamecity.net +0.0.0.0 ads2.jubii.dk +0.0.0.0 ads2.ljworld.com +0.0.0.0 ads2.msn.com +0.0.0.0 ads2.newtimes.com +0.0.0.0 ads2.osdn.com +0.0.0.0 ads2.pittsburghlive.com +0.0.0.0 ads2.realcities.com +0.0.0.0 ads2.revenue.net +0.0.0.0 ads2.rp.pl +0.0.0.0 ads2srv.com +0.0.0.0 ads2.theglobeandmail.com +0.0.0.0 ads2.udc.advance.net +0.0.0.0 ads2.virtumundo.com +0.0.0.0 ads2.weblogssl.com +0.0.0.0 ads2.zdnet.com +0.0.0.0 ads2.zeusclicks.com +0.0.0.0 ads360.com +0.0.0.0 ads36.hyperbanner.net +0.0.0.0 ads3.ad-flow.com +0.0.0.0 ads3.adman.gr +0.0.0.0 ads3.advance.net +0.0.0.0 ads3.advertwizard.com +0.0.0.0 ads3.canoe.ca +0.0.0.0 ads3.freebannertrade.com +0.0.0.0 ads3.gamecity.net +0.0.0.0 ads3.jubii.dk +0.0.0.0 ads3.realcities.com +0.0.0.0 ads3.udc.advance.net +0.0.0.0 ads3.virtumundo.com +0.0.0.0 ads3.zdnet.com +0.0.0.0 ads4.ad-flow.com +0.0.0.0 ads4.advance.net +0.0.0.0 ads4.advertwizard.com +0.0.0.0 ads4.canoe.ca +0.0.0.0 ads4.clearchannel.com +0.0.0.0 ads4.gamecity.net +0.0.0.0 ads4homes.com +0.0.0.0 ads4.realcities.com +0.0.0.0 ads4.udc.advance.net +0.0.0.0 ads4.virtumundo.com +0.0.0.0 ads5.ad-flow.com +0.0.0.0 ads5.advance.net +0.0.0.0 ads5.advertwizard.com +0.0.0.0 ads5.canoe.ca +0.0.0.0 ads.5ci.lt +0.0.0.0 ads5.fxdepo.com +0.0.0.0 ads5.mconetwork.com +0.0.0.0 ads5.udc.advance.net +0.0.0.0 ads5.virtumundo.com +0.0.0.0 ads6.ad-flow.com +0.0.0.0 ads6.advance.net +0.0.0.0 ads6.advertwizard.com +0.0.0.0 ads6.gamecity.net +0.0.0.0 ads6.udc.advance.net +0.0.0.0 ads7.ad-flow.com +0.0.0.0 ads7.advance.net +0.0.0.0 ads7.advertwizard.com +0.0.0.0 ads.7days.ae +0.0.0.0 ads7.gamecity.net +0.0.0.0 ads7.speedbit.com +0.0.0.0 ads7.udc.advance.net +0.0.0.0 ads.8833.com +0.0.0.0 ads8.ad-flow.com +0.0.0.0 ads8.advertwizard.com +0.0.0.0 ads8.com +0.0.0.0 ads8.udc.advance.net +0.0.0.0 ads9.ad-flow.com +0.0.0.0 ads9.advertwizard.com +0.0.0.0 ads9.udc.advance.net +0.0.0.0 ads.abs-cbn.com +0.0.0.0 ads.accelerator-media.com +0.0.0.0 ads.aceweb.net +0.0.0.0 ads.activeagent.at +0.0.0.0 ads.active.com +0.0.0.0 ads.ad4game.com +0.0.0.0 ads.adap.tv +0.0.0.0 ads.adbrite.com +0.0.0.0 ads.adbroker.de +0.0.0.0 ads.adcorps.com +0.0.0.0 ads.addesktop.com +0.0.0.0 ads.addynamix.com +0.0.0.0 ads.adengage.com +0.0.0.0 ads.ad-flow.com +0.0.0.0 ads.adfox.ru +0.0.0.0 ads.adgoto.com +0.0.0.0 ads.adhall.com +0.0.0.0 ads.adhearus.com +0.0.0.0 ads.adhostingsolutions.com +0.0.0.0 ads.admarvel.com +0.0.0.0 ads.admaximize.com +0.0.0.0 adsadmin.aspentimes.com +0.0.0.0 adsadmin.corusradionetwork.com +0.0.0.0 adsadmin.vaildaily.com +0.0.0.0 ads.admonitor.net +0.0.0.0 ads.adn.com +0.0.0.0 ads.adroar.com +0.0.0.0 ads.adsag.com +0.0.0.0 ads.adsbookie.com +0.0.0.0 ads.adshareware.net +0.0.0.0 ads.adsinimages.com +0.0.0.0 ads.adsonar.com +0.0.0.0 ads.adsrvmedia.com +0.0.0.0 ads.adtegrity.net +0.0.0.0 ads.adtiger.de +0.0.0.0 ads.adultfriendfinder.com +0.0.0.0 ads.adultswim.com +0.0.0.0 ads.advance.net +0.0.0.0 ads.adverline.com +0.0.0.0 ads.adviva.net +0.0.0.0 ads.advolume.com +0.0.0.0 ads.adworldnetwork.com +0.0.0.0 ads.adx.nu +0.0.0.0 ads.adxpansion.com +0.0.0.0 ads.adxpose.com +0.0.0.0 ads.adxpose.mpire.akadns.net +0.0.0.0 ads.affiliates.match.com +0.0.0.0 ads.aftonbladet.se +0.0.0.0 ads.ah-ha.com +0.0.0.0 ads.aintitcool.com +0.0.0.0 ads.airamericaradio.com +0.0.0.0 ads.ak.facebook.com +0.0.0.0 ads.albawaba.com +0.0.0.0 ads.al.com +0.0.0.0 ads.allsites.com +0.0.0.0 ads.allvertical.com +0.0.0.0 ads.amarillo.com +0.0.0.0 ads.amateurmatch.com +0.0.0.0 ads.amazingmedia.com +0.0.0.0 ads.amgdgt.com +0.0.0.0 ads.ami-admin.com +0.0.0.0 ads.anm.co.uk +0.0.0.0 ads.anvato.com +0.0.0.0 ads.aol.com +0.0.0.0 ads.apartmenttherapy.com +0.0.0.0 ads.apn.co.nz +0.0.0.0 ads.apn.co.za +0.0.0.0 ads.appleinsider.com +0.0.0.0 ads.arcadechain.com +0.0.0.0 ads.aroundtherings.com +0.0.0.0 ads.as4x.tmcs.net +0.0.0.0 ads.as4x.tmcs.ticketmaster.ca +0.0.0.0 ads.as4x.tmcs.ticketmaster.com +0.0.0.0 ads.asia1.com +0.0.0.0 ads.asia1.com.sg +0.0.0.0 ads.aspalliance.com +0.0.0.0 ads.aspentimes.com +0.0.0.0 ads.asp.net +0.0.0.0 ads.associatedcontent.com +0.0.0.0 ads.astalavista.us +0.0.0.0 ads.atlantamotorspeedway.com +0.0.0.0 adsatt.abcnews.starwave.com +0.0.0.0 adsatt.espn.go.com +0.0.0.0 adsatt.espn.starwave.com +0.0.0.0 ads.auctionads.com +0.0.0.0 ads.auctioncity.co.nz +0.0.0.0 ads.auctions.yahoo.com +0.0.0.0 ads.augusta.com +0.0.0.0 ads.aversion2.com +0.0.0.0 ads.aws.sitepoint.com +0.0.0.0 ads.azjmp.com +0.0.0.0 ads.baazee.com +0.0.0.0 ads.bangkokpost.co.th +0.0.0.0 ads.banner.t-online.de +0.0.0.0 ads.barnonedrinks.com +0.0.0.0 ads.battle.net +0.0.0.0 ads.bauerpublishing.com +0.0.0.0 ads.baventures.com +0.0.0.0 ads.bbcworld.com +0.0.0.0 ads.bcnewsgroup.com +0.0.0.0 ads.beeb.com +0.0.0.0 ads.beliefnet.com +0.0.0.0 ads.belointeractive.com +0.0.0.0 ads.beta.itravel2000.com +0.0.0.0 ads.betanews.com +0.0.0.0 ads.bfast.com +0.0.0.0 ads.bfm.valueclick.net +0.0.0.0 ads.bianca.com +0.0.0.0 ads.bidclix.com +0.0.0.0 ads.bidvertiser.com +0.0.0.0 ads.bigcitytools.com +0.0.0.0 ads.biggerboat.com +0.0.0.0 ads.bitsonthewire.com +0.0.0.0 ads.bizhut.com +0.0.0.0 ads.blixem.nl +0.0.0.0 ads.blog.com +0.0.0.0 ads.blogherads.com +0.0.0.0 ads.bloomberg.com +0.0.0.0 ads.blp.calueclick.net +0.0.0.0 ads.blp.valueclick.net +0.0.0.0 ads.bluelithium.com +0.0.0.0 ads.bluemountain.com +0.0.0.0 ads.bonnint.net +0.0.0.0 ads.box.sk +0.0.0.0 ads.brabys.com +0.0.0.0 ads.brand.net +0.0.0.0 ads.bridgetrack.com +0.0.0.0 ads.britishexpats.com +0.0.0.0 ads.buscape.com.br +0.0.0.0 ads.businessclick.com +0.0.0.0 ads.businessweek.com +0.0.0.0 ads.calgarysun.com +0.0.0.0 ads.callofdutyblackopsforum.net +0.0.0.0 ads.camrecord.com +0.0.0.0 ads.canoe.ca +0.0.0.0 ads.cardea.se +0.0.0.0 ads.cardplayer.com +0.0.0.0 ads.carltononline.com +0.0.0.0 ads.carocean.co.uk +0.0.0.0 ads.casinocity.com +0.0.0.0 ads.catholic.org +0.0.0.0 ads.cavello.com +0.0.0.0 ads.cbc.ca +0.0.0.0 ads.cdfreaks.com +0.0.0.0 ads.cdnow.com +0.0.0.0 adscendmedia.com +0.0.0.0 ads.centraliprom.com +0.0.0.0 ads.cgchannel.com +0.0.0.0 ads.chalomumbai.com +0.0.0.0 ads.champs-elysees.com +0.0.0.0 ads.channel4.com +0.0.0.0 ads.checkm8.co.za +0.0.0.0 ads.chipcenter.com +0.0.0.0 adscholar.com +0.0.0.0 ads.chumcity.com +0.0.0.0 ads.cjonline.com +0.0.0.0 ads.clamav.net +0.0.0.0 ads.clara.net +0.0.0.0 ads.clearchannel.com +0.0.0.0 ads.cleveland.com +0.0.0.0 ads.clickability.com +0.0.0.0 ads.clickad.com.pl +0.0.0.0 ads.clickagents.com +0.0.0.0 ads.clickhouse.com +0.0.0.0 ads.clicksor.com +0.0.0.0 ads.clickthru.net +0.0.0.0 ads.clicmanager.fr +0.0.0.0 ads.clubzone.com +0.0.0.0 ads.cluster01.oasis.zmh.zope.net +0.0.0.0 ads.cmediaworld.com +0.0.0.0 ads.cmg.valueclick.net +0.0.0.0 ads.cnn.com +0.0.0.0 ads.cnngo.com +0.0.0.0 ads.cobrad.com +0.0.0.0 ads.collegclub.com +0.0.0.0 ads.collegehumor.com +0.0.0.0 ads.collegemix.com +0.0.0.0 ads.com.com +0.0.0.0 ads.comediagroup.hu +0.0.0.0 ads.comicbookresources.com +0.0.0.0 ads.contactmusic.com +0.0.0.0 ads.contentabc.com +0.0.0.0 ads.coopson.com +0.0.0.0 ads.corusradionetwork.com +0.0.0.0 ads.courierpostonline.com +0.0.0.0 ads.cpsgsoftware.com +0.0.0.0 ads.crakmedia.com +0.0.0.0 ads.crapville.com +0.0.0.0 ads.creative-serving.com +0.0.0.0 ads.crosscut.com +0.0.0.0 ads.ctvdigital.net +0.0.0.0 ads.currantbun.com +0.0.0.0 ads.cyberfight.ru +0.0.0.0 ads.cybersales.cz +0.0.0.0 ads.cybertrader.com +0.0.0.0 ads.dada.it +0.0.0.0 ads.danworld.net +0.0.0.0 adsdaq.com +0.0.0.0 ads.dbforums.com +0.0.0.0 ads.ddj.com +0.0.0.0 ads.dealnews.com +0.0.0.0 ads.democratandchronicle.com +0.0.0.0 ads.dennisnet.co.uk +0.0.0.0 ads.designboom.com +0.0.0.0 ads.designtaxi.com +0.0.0.0 ads.desmoinesregister.com +0.0.0.0 ads-de.spray.net +0.0.0.0 ads.detelefoongids.nl +0.0.0.0 ads.developershed.com +0.0.0.0 ads.deviantart.com +0.0.0.0 ads-dev.youporn.com +0.0.0.0 ads.digitalacre.com +0.0.0.0 ads.digital-digest.com +0.0.0.0 ads.digitalhealthcare.com +0.0.0.0 ads.digitalmedianet.com +0.0.0.0 ads.digitalpoint.com +0.0.0.0 ads.dimcab.com +0.0.0.0 ads.directionsmag.com +0.0.0.0 ads-direct.prodigy.net +0.0.0.0 ads.discovery.com +0.0.0.0 ads.dk +0.0.0.0 ads.doclix.com +0.0.0.0 ads.domeus.com +0.0.0.0 ads.dontpanicmedia.com +0.0.0.0 ads.dothads.com +0.0.0.0 ads.doubleviking.com +0.0.0.0 ads.drf.com +0.0.0.0 ads.drivelinemedia.com +0.0.0.0 ads.drugs.com +0.0.0.0 ads.dumpalink.com +0.0.0.0 adsearch.adkontekst.pl +0.0.0.0 adsearch.pl +0.0.0.0 adsearch.wp.pl +0.0.0.0 ads.ecircles.com +0.0.0.0 ads.economist.com +0.0.0.0 ads.ecosalon.com +0.0.0.0 ads.edirectme.com +0.0.0.0 ads.einmedia.com +0.0.0.0 ads.eircom.net +0.0.0.0 ads.emeraldcoast.com +0.0.0.0 ads.enliven.com +0.0.0.0 ad.sensismediasmart.com.au +0.0.0.0 adsentnetwork.com +0.0.0.0 adserer.ihigh.com +0.0.0.0 ads.erotism.com +0.0.0.0 adserv001.adtech.de +0.0.0.0 adserv001.adtech.fr +0.0.0.0 adserv001.adtech.us +0.0.0.0 adserv002.adtech.de +0.0.0.0 adserv002.adtech.fr +0.0.0.0 adserv002.adtech.us +0.0.0.0 adserv003.adtech.de +0.0.0.0 adserv003.adtech.fr +0.0.0.0 adserv003.adtech.us +0.0.0.0 adserv004.adtech.de +0.0.0.0 adserv004.adtech.fr +0.0.0.0 adserv004.adtech.us +0.0.0.0 adserv005.adtech.de +0.0.0.0 adserv005.adtech.fr +0.0.0.0 adserv005.adtech.us +0.0.0.0 adserv006.adtech.de +0.0.0.0 adserv006.adtech.fr +0.0.0.0 adserv006.adtech.us +0.0.0.0 adserv007.adtech.de +0.0.0.0 adserv007.adtech.fr +0.0.0.0 adserv007.adtech.us +0.0.0.0 adserv008.adtech.de +0.0.0.0 adserv008.adtech.fr +0.0.0.0 adserv008.adtech.us +0.0.0.0 adserv2.bravenet.com +0.0.0.0 adserv.aip.org +0.0.0.0 adservant.guj.de +0.0.0.0 adserv.bravenet.com +0.0.0.0 adserve5.nikkeibp.co.jp +0.0.0.0 adserve.adtoll.com +0.0.0.0 adserve.canadawidemagazines.com +0.0.0.0 adserve.city-ad.com +0.0.0.0 adserve.ehpub.com +0.0.0.0 adserve.gossipgirls.com +0.0.0.0 adserve.mizzenmedia.com +0.0.0.0 adserv.entriq.net +0.0.0.0 adserve.podaddies.com +0.0.0.0 adserve.profit-smart.com +0.0.0.0 adserver01.ancestry.com +0.0.0.0 adserver.100free.com +0.0.0.0 adserver.163.com +0.0.0.0 adserver1.adserver.com.pl +0.0.0.0 adserver1.adtech.com.tr +0.0.0.0 adserver1.backbeatmedia.com +0.0.0.0 adserver1.economist.com +0.0.0.0 adserver1.eudora.com +0.0.0.0 adserver1.harvestadsdepot.com +0.0.0.0 adserver1.hookyouup.com +0.0.0.0 adserver1-images.backbeatmedia.com +0.0.0.0 adserver1.isohunt.com +0.0.0.0 adserver1.lokitorrent.com +0.0.0.0 adserver1.mediainsight.de +0.0.0.0 adserver1.ogilvy-interactive.de +0.0.0.0 adserver1.realtracker.com +0.0.0.0 adserver1.sonymusiceurope.com +0.0.0.0 adserver1.teracent.net +0.0.0.0 adserver1.wmads.com +0.0.0.0 adserver.2618.com +0.0.0.0 adserver2.adserver.com.pl +0.0.0.0 adserver2.atman.pl +0.0.0.0 adserver2.christianitytoday.com +0.0.0.0 adserver2.condenast.co.uk +0.0.0.0 adserver2.creative.com +0.0.0.0 adserver2.eudora.com +0.0.0.0 adserver-2.ig.com.br +0.0.0.0 adserver2.mediainsight.de +0.0.0.0 adserver2.news-journalonline.com +0.0.0.0 adserver2.popdata.de +0.0.0.0 adserver2.realtracker.com +0.0.0.0 adserver2.teracent.net +0.0.0.0 adserver.3digit.de +0.0.0.0 adserver3.eudora.com +0.0.0.0 adserver-3.ig.com.br +0.0.0.0 adserver4.eudora.com +0.0.0.0 adserver-4.ig.com.br +0.0.0.0 adserver-5.ig.com.br +0.0.0.0 adserver.71i.de +0.0.0.0 adserver9.contextad.com +0.0.0.0 adserver.ad-it.dk +0.0.0.0 adserver.adreactor.com +0.0.0.0 adserver.adremedy.com +0.0.0.0 adserver.ads360.com +0.0.0.0 adserver.adserver.com.pl +0.0.0.0 adserver.adsincontext.com +0.0.0.0 adserver.adtech.de +0.0.0.0 adserver.adtech.fr +0.0.0.0 adserver.adtech.us +0.0.0.0 adserver.adtechus.com +0.0.0.0 adserver.adultfriendfinder.com +0.0.0.0 adserver.advertist.com +0.0.0.0 adserver.affiliatemg.com +0.0.0.0 adserver.affiliation.com +0.0.0.0 adserver.aim4media.com +0.0.0.0 adserver.a.in.monster.com +0.0.0.0 adserver.airmiles.ca +0.0.0.0 adserver.akqa.net +0.0.0.0 adserver.allheadlinenews.com +0.0.0.0 adserver.amnews.com +0.0.0.0 adserver.ancestry.com +0.0.0.0 adserver.anemo.com +0.0.0.0 adserver.anm.co.uk +0.0.0.0 adserver.aol.fr +0.0.0.0 adserver.archant.co.uk +0.0.0.0 adserver.artempireindustries.com +0.0.0.0 adserver.arttoday.com +0.0.0.0 adserver.atari.net +0.0.0.0 adserverb.conjelco.com +0.0.0.0 adserver.betandwin.de +0.0.0.0 adserver.billiger-surfen.de +0.0.0.0 adserver.billiger-telefonieren.de +0.0.0.0 adserver.bizland-inc.net +0.0.0.0 adserver.bluereactor.com +0.0.0.0 adserver.bluereactor.net +0.0.0.0 adserver.bluewin.ch +0.0.0.0 adserver.buttonware.com +0.0.0.0 adserver.buttonware.net +0.0.0.0 adserver.cams.com +0.0.0.0 adserver.cantv.net +0.0.0.0 adserver.cebu-online.com +0.0.0.0 adserver.cheatplanet.com +0.0.0.0 adserver.chickclick.com +0.0.0.0 adserver.click4cash.de +0.0.0.0 adserver.clubic.com +0.0.0.0 adserver.clundressed.com +0.0.0.0 adserver.co.il +0.0.0.0 adserver.colleges.com +0.0.0.0 adserver.com +0.0.0.0 adserver.comparatel.fr +0.0.0.0 adserver.com-solutions.com +0.0.0.0 adserver.conjelco.com +0.0.0.0 adserver.corusradionetwork.com +0.0.0.0 adserver.creative-asia.com +0.0.0.0 adserver.creativeinspire.com +0.0.0.0 adserver.dayrates.com +0.0.0.0 adserver.dbusiness.com +0.0.0.0 adserver.developersnetwork.com +0.0.0.0 adserver.devx.com +0.0.0.0 adserver.digitalpartners.com +0.0.0.0 adserver.digitoday.com +0.0.0.0 adserver.directforce.com +0.0.0.0 adserver.directforce.net +0.0.0.0 adserver.dnps.com +0.0.0.0 adserver.dotcommedia.de +0.0.0.0 adserver.dotmusic.com +0.0.0.0 adserver.eham.net +0.0.0.0 adserver.emapadserver.com +0.0.0.0 adserver.emporis.com +0.0.0.0 adserver.emulation64.com +0.0.0.0 adserver-espnet.sportszone.net +0.0.0.0 adserver.eudora.com +0.0.0.0 adserver.eva2000.com +0.0.0.0 adserver.expatica.nxs.nl +0.0.0.0 adserver.ezzhosting.com +0.0.0.0 adserver.filefront.com +0.0.0.0 adserver.fmpub.net +0.0.0.0 adserver.fr.adtech.de +0.0.0.0 adserver.freecity.de +0.0.0.0 adserver.freenet.de +0.0.0.0 adserver.friendfinder.com +0.0.0.0 adserver.gameparty.net +0.0.0.0 adserver.gamesquad.net +0.0.0.0 adserver.garden.com +0.0.0.0 adserver.gorillanation.com +0.0.0.0 adserver.gr +0.0.0.0 adserver.gunaxin.com +0.0.0.0 adserver.hardsextube.com +0.0.0.0 adserver.hardwareanalysis.com +0.0.0.0 adserver.harktheherald.com +0.0.0.0 adserver.harvestadsdepot.com +0.0.0.0 adserver.hellasnet.gr +0.0.0.0 adserver.hg-computer.de +0.0.0.0 adserver.hi-m.de +0.0.0.0 adserver.hispavista.com +0.0.0.0 adserver.hk.outblaze.com +0.0.0.0 adserver.home.pl +0.0.0.0 adserver.hostinteractive.com +0.0.0.0 adserver.humanux.com +0.0.0.0 adserver.hwupgrade.it +0.0.0.0 adserver.ifmagazine.com +0.0.0.0 adserver.ig.com.br +0.0.0.0 adserver.ign.com +0.0.0.0 adserver.ilounge.com +0.0.0.0 adserver.infinit.net +0.0.0.0 adserver.infotiger.com +0.0.0.0 adserver.interfree.it +0.0.0.0 adserver.inwind.it +0.0.0.0 adserver.ision.de +0.0.0.0 adserver.isonews.com +0.0.0.0 adserver.ixm.co.uk +0.0.0.0 adserver.jacotei.com.br +0.0.0.0 adserver.janes.com +0.0.0.0 adserver.janes.net +0.0.0.0 adserver.janes.org +0.0.0.0 adserver.jolt.co.uk +0.0.0.0 adserver.journalinteractive.com +0.0.0.0 adserver.juicyads.com +0.0.0.0 adserver.kcilink.com +0.0.0.0 adserver.killeraces.com +0.0.0.0 adserver.kylemedia.com +0.0.0.0 adserver.lanacion.com.ar +0.0.0.0 adserver.lanepress.com +0.0.0.0 adserver.latimes.com +0.0.0.0 adserver.legacy-network.com +0.0.0.0 adserver.libero.it +0.0.0.0 adserver.linktrader.co.uk +0.0.0.0 adserver.livejournal.com +0.0.0.0 adserver.lostreality.com +0.0.0.0 adserver.lunarpages.com +0.0.0.0 adserver.lycos.co.jp +0.0.0.0 adserver.m2kcore.com +0.0.0.0 adserver.magazyn.pl +0.0.0.0 adserver.matchcraft.com +0.0.0.0 adserver.merc.com +0.0.0.0 adserver.mindshare.de +0.0.0.0 adserver.mobsmith.com +0.0.0.0 adserver.monster.com +0.0.0.0 adserver.monstersandcritics.com +0.0.0.0 adserver.motonews.pl +0.0.0.0 adserver.myownemail.com +0.0.0.0 adserver.netcreators.nl +0.0.0.0 adserver.netshelter.net +0.0.0.0 adserver.newdigitalgroup.com +0.0.0.0 adserver.newmassmedia.net +0.0.0.0 adserver.news.com +0.0.0.0 adserver.news.com.au +0.0.0.0 adserver.news-journalonline.com +0.0.0.0 adserver.newtimes.com +0.0.0.0 adserver.ngz-network.de +0.0.0.0 adserver.nydailynews.com +0.0.0.0 adserver.nzoom.com +0.0.0.0 adserver.o2.pl +0.0.0.0 adserver.onwisconsin.com +0.0.0.0 adserver.passion.com +0.0.0.0 adserver.phatmax.net +0.0.0.0 adserver.phillyburbs.com +0.0.0.0 adserver.pl +0.0.0.0 adserver.planet-multiplayer.de +0.0.0.0 adserver.plhb.com +0.0.0.0 adserver.pollstar.com +0.0.0.0 adserver.portalofevil.com +0.0.0.0 adserver.portal.pl +0.0.0.0 adserver.portugalmail.pt +0.0.0.0 adserver.prodigy.net +0.0.0.0 adserver.proteinos.com +0.0.0.0 adserver.radio-canada.ca +0.0.0.0 adserver.ratestar.net +0.0.0.0 adserver.revver.com +0.0.0.0 adserver.ro +0.0.0.0 adserver.sabc.co.za +0.0.0.0 adserver.sabcnews.co.za +0.0.0.0 adserver.sanomawsoy.fi +0.0.0.0 adserver.scmp.com +0.0.0.0 adserver.securityfocus.com +0.0.0.0 adserver.sextracker.com +0.0.0.0 adserver.sharewareonline.com +0.0.0.0 adserver.singnet.com +0.0.0.0 adserver.sl.kharkov.ua +0.0.0.0 adserver.smashtv.com +0.0.0.0 adserver.snowball.com +0.0.0.0 adserver.softonic.com +0.0.0.0 adserver.soloserver.com +0.0.0.0 adserversolutions.com +0.0.0.0 adserver.swiatobrazu.pl +0.0.0.0 adserver.synergetic.de +0.0.0.0 adserver.telalink.net +0.0.0.0 adserver.te.pt +0.0.0.0 adserver.teracent.net +0.0.0.0 adserver.terra.com.br +0.0.0.0 adserver.terra.es +0.0.0.0 adserver.theknot.com +0.0.0.0 adserver.theonering.net +0.0.0.0 adserver.thirty4.com +0.0.0.0 adserver.thisislondon.co.uk +0.0.0.0 adserver.tilted.net +0.0.0.0 adserver.tqs.ca +0.0.0.0 adserver.track-star.com +0.0.0.0 adserver.trader.ca +0.0.0.0 adserver.trafficsyndicate.com +0.0.0.0 adserver.trb.com +0.0.0.0 adserver.tribuneinteractive.com +0.0.0.0 adserver.tsgadv.com +0.0.0.0 adserver.tulsaworld.com +0.0.0.0 adserver.tweakers.net +0.0.0.0 adserver.twitpic.com +0.0.0.0 adserver.ugo.com +0.0.0.0 adserver.ugo.nl +0.0.0.0 adserver.ukplus.co.uk +0.0.0.0 adserver.uproxx.com +0.0.0.0 adserver.usermagnet.com +0.0.0.0 adserver.van.net +0.0.0.0 adserver.virginmedia.com +0.0.0.0 adserver.virgin.net +0.0.0.0 adserver.virtualminds.nl +0.0.0.0 adserver.virtuous.co.uk +0.0.0.0 adserver.voir.ca +0.0.0.0 adserver.webads.co.uk +0.0.0.0 adserver.webads.nl +0.0.0.0 adserver.wemnet.nl +0.0.0.0 adserver.x3.hu +0.0.0.0 adserver.ya.com +0.0.0.0 adserver.yahoo.com +0.0.0.0 adserver.zaz.com.br +0.0.0.0 adserver.zeads.com +0.0.0.0 adserve.shopzilla.com +0.0.0.0 adserve.splicetoday.com +0.0.0.0 adserve.viaarena.com +0.0.0.0 adserv.free6.com +0.0.0.0 adserv.geocomm.com +0.0.0.0 adserv.iafrica.com +0.0.0.0 adservices.google.com +0.0.0.0 adservices.picadmedia.com +0.0.0.0 adservingcentral.com +0.0.0.0 adserving.cpxinteractive.com +0.0.0.0 adserv.internetfuel.com +0.0.0.0 adserv.jupiter.com +0.0.0.0 adserv.lwmn.net +0.0.0.0 adserv.maineguide.com +0.0.0.0 adserv.muchosucko.com +0.0.0.0 adserv.mywebtimes.com +0.0.0.0 adserv.pitchforkmedia.com +0.0.0.0 adserv.postbulletin.com +0.0.0.0 adserv.qconline.com +0.0.0.0 adserv.quality-channel.de +0.0.0.0 adserv.usps.com +0.0.0.0 adserwer.o2.pl +0.0.0.0 ads.espn.adsonar.com +0.0.0.0 ads.eudora.com +0.0.0.0 ads.eu.msn.com +0.0.0.0 ads.euniverseads.com +0.0.0.0 adseu.novem.pl +0.0.0.0 ads.examiner.net +0.0.0.0 ads.exhedra.com +0.0.0.0 ads.expedia.com +0.0.0.0 ads.expekt.com +0.0.0.0 ads.ezboard.com +0.0.0.0 adsfac.eu +0.0.0.0 adsfac.net +0.0.0.0 adsfac.us +0.0.0.0 ads.fairfax.com.au +0.0.0.0 ads.fark.com +0.0.0.0 ads.fayettevillenc.com +0.0.0.0 ads.filecloud.com +0.0.0.0 ads.fileindexer.com +0.0.0.0 ads.filmup.com +0.0.0.0 ads.first-response.be +0.0.0.0 ads.flabber.nl +0.0.0.0 ads.flashgames247.com +0.0.0.0 ads.fling.com +0.0.0.0 ads.floridatoday.com +0.0.0.0 ads.fool.com +0.0.0.0 ads.forbes.com +0.0.0.0 ads.forbes.net +0.0.0.0 ads.fortunecity.com +0.0.0.0 ads.fredericksburg.com +0.0.0.0 ads.freebannertrade.com +0.0.0.0 ads.freshmeat.net +0.0.0.0 ads.fresnobee.com +0.0.0.0 ads.friendfinder.com +0.0.0.0 ads.ft.com +0.0.0.0 ads.gamblinghit.com +0.0.0.0 ads.gamecity.net +0.0.0.0 ads.gamecopyworld.no +0.0.0.0 ads.gameinformer.com +0.0.0.0 ads.game.net +0.0.0.0 ads.gamershell.com +0.0.0.0 ads.gamespy.com +0.0.0.0 ads.gamespyid.com +0.0.0.0 ads.gateway.com +0.0.0.0 ads.gawker.com +0.0.0.0 ads.gettools.com +0.0.0.0 ads.gigaom.com.php5-12.websitetestlink.com +0.0.0.0 ads.globeandmail.com +0.0.0.0 ads.gmg.valueclick.net +0.0.0.0 ads.gmodules.com +0.0.0.0 ads.god.co.uk +0.0.0.0 ads.gorillanation.com +0.0.0.0 ads.gplusmedia.com +0.0.0.0 ads.granadamedia.com +0.0.0.0 ads.greenbaypressgazette.com +0.0.0.0 ads.greenvilleonline.com +0.0.0.0 ads.guardian.co.uk +0.0.0.0 ads.guardianunlimited.co.uk +0.0.0.0 ads.gunaxin.com +0.0.0.0 ads.halogennetwork.com +0.0.0.0 ads.hamptonroads.com +0.0.0.0 ads.hamtonroads.com +0.0.0.0 ads.hardwarezone.com +0.0.0.0 ads.harpers.org +0.0.0.0 ads.hbv.de +0.0.0.0 ads.hearstmags.com +0.0.0.0 ads.heartlight.org +0.0.0.0 ads.herald-mail.com +0.0.0.0 ads.heraldnet.com +0.0.0.0 ads.heraldonline.com +0.0.0.0 ads.heraldsun.com +0.0.0.0 ads.heroldonline.com +0.0.0.0 ads.he.valueclick.net +0.0.0.0 ads.hitcents.com +0.0.0.0 ads.hlwd.valueclick.net +0.0.0.0 ads.hollandsentinel.com +0.0.0.0 ads.hollywood.com +0.0.0.0 ads.hooqy.com +0.0.0.0 ads.hothardware.com +0.0.0.0 ad.showbizz.net +0.0.0.0 ads.hulu.com.edgesuite.net +#0.0.0.0 ads.hulu.com # Uncomment to block Hulu. +0.0.0.0 ads.humorbua.no +0.0.0.0 ads.i12.de +0.0.0.0 ads.i33.com +0.0.0.0 ads.iafrica.com +0.0.0.0 ads.i-am-bored.com +0.0.0.0 ads.iboost.com +0.0.0.0 ads.icq.com +0.0.0.0 ads.iforex.com +0.0.0.0 ads.ign.com +0.0.0.0 ads.illuminatednation.com +0.0.0.0 ads.imdb.com +0.0.0.0 ads.imgur.com +0.0.0.0 ads.imposibil.ro +0.0.0.0 ads.indiatimes.com +0.0.0.0 ads.indya.com +0.0.0.0 ads.indystar.com +0.0.0.0 ads.inedomedia.com +0.0.0.0 ads.inetdirectories.com +0.0.0.0 ads.inetinteractive.com +0.0.0.0 ads.infi.net +0.0.0.0 ads.infospace.com +0.0.0.0 adsinimages.com +0.0.0.0 ads.injersey.com +0.0.0.0 ads.insidehighered.com +0.0.0.0 ads.intellicast.com +0.0.0.0 ads.internic.co.il +0.0.0.0 ads.inthesidebar.com +0.0.0.0 adsintl.starwave.com +0.0.0.0 ads.iol.co.il +0.0.0.0 ads.ipowerweb.com +0.0.0.0 ads.ireport.com +0.0.0.0 ads.isat-tech.com +0.0.0.0 ads.isoftmarketing.com +0.0.0.0 ads.isum.de +0.0.0.0 ads.itv.com +0.0.0.0 ads.iwon.com +0.0.0.0 ads.jacksonville.com +0.0.0.0 ads.jeneauempire.com +0.0.0.0 ads.jetpackdigital.com +0.0.0.0 ads.jetphotos.net +0.0.0.0 ads.jewcy.com +0.0.0.0 ads.jimworld.com +0.0.0.0 ads.joetec.net +0.0.0.0 ads.jokaroo.com +0.0.0.0 ads.jornadavirtual.com.mx +0.0.0.0 ads.jossip.com +0.0.0.0 ads.jpost.com +0.0.0.0 ads.jubii.dk +0.0.0.0 ads.juicyads.com +0.0.0.0 ads.juneauempire.com +0.0.0.0 ads.jwtt3.com +0.0.0.0 ads.kazaa.com +0.0.0.0 ads.keywordblocks.com +0.0.0.0 ads.kixer.com +0.0.0.0 ads.kleinman.com +0.0.0.0 ads.kmpads.com +0.0.0.0 ads.koreanfriendfinder.com +0.0.0.0 ads.ksl.com +0.0.0.0 ad.slashgear.com +0.0.0.0 ads.leo.org +0.0.0.0 ads.lfstmedia.com +0.0.0.0 ads.lilengine.com +0.0.0.0 ads.link4ads.com +0.0.0.0 ads.linksponsor.com +0.0.0.0 ads.linktracking.net +0.0.0.0 ads.linuxjournal.com +0.0.0.0 ads.linuxsecurity.com +0.0.0.0 ads.list-universe.com +0.0.0.0 ads.live365.com +0.0.0.0 ads.ljworld.com +0.0.0.0 ads.lnkworld.com +0.0.0.0 ads.localnow.com +0.0.0.0 ads-local.sixapart.com +0.0.0.0 ads.lubbockonline.com +0.0.0.0 ads.lucidmedia.com +0.0.0.0 ads.lucidmedia.com.gslb.com +0.0.0.0 ads.lycos.com +0.0.0.0 ads.lycos-europe.com +0.0.0.0 ads.lzjl.com +0.0.0.0 ads.macnews.de +0.0.0.0 ads.macupdate.com +0.0.0.0 ads.madisonavenue.com +0.0.0.0 ads.madison.com +0.0.0.0 ads.magnetic.is +0.0.0.0 ads.mail.com +0.0.0.0 ads.mambocommunities.com +0.0.0.0 ad.sma.punto.net +0.0.0.0 ads.mariuana.it +0.0.0.0 adsmart.com +0.0.0.0 adsmart.co.uk +0.0.0.0 adsmart.net +0.0.0.0 ads.mcafee.com +0.0.0.0 ads.mdchoice.com +0.0.0.0 ads.mediamayhemcorp.com +0.0.0.0 ads.mediaodyssey.com +0.0.0.0 ads.mediaturf.net +0.0.0.0 ads.mefeedia.com +0.0.0.0 ads.megaproxy.com +0.0.0.0 ads.metblogs.com +0.0.0.0 ads.mgnetwork.com +0.0.0.0 ads.mindsetnetwork.com +0.0.0.0 ads.miniclip.com +0.0.0.0 ads.mininova.org +0.0.0.0 ads.mircx.com +0.0.0.0 ads.mixtraffic.com +0.0.0.0 ads.mlive.com +0.0.0.0 ads.mm.ap.org +0.0.0.0 ads.mndaily.com +0.0.0.0 ad.smni.com +0.0.0.0 ads.mobiledia.com +0.0.0.0 ads.mobygames.com +0.0.0.0 ads.modbee.com +0.0.0.0 ads.mofos.com +0.0.0.0 ads.money.pl +0.0.0.0 ads.monster.com +0.0.0.0 ads.mouseplanet.com +0.0.0.0 ads.movieweb.com +0.0.0.0 ads.mp3searchy.com +0.0.0.0 adsm.soush.com +0.0.0.0 ads.mt.valueclick.net +0.0.0.0 ads.mtv.uol.com.br +0.0.0.0 ads.multimania.lycos.fr +0.0.0.0 ads.musiccity.com +0.0.0.0 ads.mustangworks.com +0.0.0.0 ads.mysimon.com +0.0.0.0 ads.mytelus.com +0.0.0.0 ads.nandomedia.com +0.0.0.0 ads.nationalreview.com +0.0.0.0 ads.nativeinstruments.de +0.0.0.0 ads.neoseeker.com +0.0.0.0 ads.neowin.net +0.0.0.0 ads.nerve.com +0.0.0.0 ads.netmechanic.com +0.0.0.0 ads.networkwcs.net +0.0.0.0 ads.networldmedia.net +0.0.0.0 ads.neudesicmediagroup.com +0.0.0.0 ads.newcity.com +0.0.0.0 ads.newcitynet.com +0.0.0.0 ads.newdream.net +0.0.0.0 ads.newgrounds.com +0.0.0.0 ads.newsint.co.uk +0.0.0.0 ads.newsminerextra.com +0.0.0.0 ads.newsobserver.com +0.0.0.0 ads.newsquest.co.uk +0.0.0.0 ads.newtention.net +0.0.0.0 ads.newtimes.com +0.0.0.0 adsnew.userfriendly.org +0.0.0.0 ads.ngenuity.com +0.0.0.0 ads.ninemsn.com.au +0.0.0.0 adsniper.ru +0.0.0.0 ads.nola.com +0.0.0.0 ads.northjersey.com +0.0.0.0 ads.novem.pl +0.0.0.0 ads.nowrunning.com +0.0.0.0 ads.npr.valueclick.net +0.0.0.0 ads.ntadvice.com +0.0.0.0 ads.nudecards.com +0.0.0.0 ads.nwsource.com +0.0.0.0 ads.nwsource.com.edgesuite.net +0.0.0.0 ads.nyi.net +0.0.0.0 ads.nyjournalnews.com +0.0.0.0 ads.nypost.com +0.0.0.0 ads.nytimes.com +0.0.0.0 ads.o2.pl +0.0.0.0 adsoftware.com +0.0.0.0 adsoldier.com +0.0.0.0 ads.ole.com +0.0.0.0 ads.omaha.com +0.0.0.0 adsonar.com +0.0.0.0 adson.awempire.com +0.0.0.0 ads.onlineathens.com +0.0.0.0 ads.online.ie +0.0.0.0 ads.onvertise.com +0.0.0.0 ads.ookla.com +0.0.0.0 ads.open.pl +0.0.0.0 ads.opensubtitles.org +0.0.0.0 ads.oregonlive.com +0.0.0.0 ads.orsm.net +0.0.0.0 ads.osdn.com +0.0.0.0 ad-souk.com +0.0.0.0 adspaces.ero-advertising.com +0.0.0.0 ads.parrysound.com +0.0.0.0 ads.partner2profit.com +0.0.0.0 ads.pastemagazine.com +0.0.0.0 ads.paxnet.co.kr +0.0.0.0 ads.pcper.com +0.0.0.0 ads.pdxguide.com +0.0.0.0 ads.peel.com +0.0.0.0 ads.peninsulaclarion.com +0.0.0.0 ads.penny-arcade.com +0.0.0.0 ads.pennyweb.com +0.0.0.0 ads.people.com.cn +0.0.0.0 ads.pg.valueclick.net +0.0.0.0 ads.pheedo.com +0.0.0.0 ads.phillyburbs.com +0.0.0.0 ads.phpclasses.org +0.0.0.0 ads.pilotonline.com +0.0.0.0 adspirit.net +0.0.0.0 adspiro.pl +0.0.0.0 ads.pitchforkmedia.com +0.0.0.0 ads.pittsburghlive.com +0.0.0.0 ads.pixiq.com +0.0.0.0 ads.place1.com +0.0.0.0 ads.planet-f1.com +0.0.0.0 ads.plantyours.com +0.0.0.0 ads.pni.com +0.0.0.0 ads.pno.net +0.0.0.0 ads.poconorecord.com +0.0.0.0 ads.pointroll.com +0.0.0.0 ads.portlandmercury.com +0.0.0.0 ads.premiumnetwork.com +0.0.0.0 ads.premiumnetwork.net +0.0.0.0 ads.pressdemo.com +0.0.0.0 ads.pricescan.com +0.0.0.0 ads.primaryclick.com +0.0.0.0 ads.primeinteractive.net +0.0.0.0 ads.prisacom.com +0.0.0.0 ads.profitsdeluxe.com +0.0.0.0 ads.profootballtalk.com +0.0.0.0 ads.program3.com +0.0.0.0 ads.pro-market.net +0.0.0.0 ads.pro-market.net.edgesuite.net +0.0.0.0 ads.prospect.org +0.0.0.0 ads.pubmatic.com +0.0.0.0 ads.queendom.com +0.0.0.0 ads.quicken.com +0.0.0.0 adsr3pg.com.br +0.0.0.0 ads.rackshack.net +0.0.0.0 ads.rasmussenreports.com +0.0.0.0 ads.ratemyprofessors.com +0.0.0.0 adsrc.bankrate.com +0.0.0.0 ads.rcgroups.com +0.0.0.0 ads.rdstore.com +0.0.0.0 ads.realcastmedia.com +0.0.0.0 ads.realcities.com +0.0.0.0 ads.realmedia.de +0.0.0.0 ads.realtechnetwork.net +0.0.0.0 ads.reason.com +0.0.0.0 ads.rediff.com +0.0.0.0 ads.redorbit.com +0.0.0.0 ads.register.com +0.0.0.0 adsremote.scripps.com +0.0.0.0 adsremote.scrippsnetwork.com +0.0.0.0 ads.revenews.com +0.0.0.0 ads.revenue.net +0.0.0.0 adsrevenue.net +0.0.0.0 ads.revsci.net +0.0.0.0 ads.rim.co.uk +0.0.0.0 ads-rm.looksmart.com +0.0.0.0 ads.roanoke.com +0.0.0.0 ads.rockstargames.com +0.0.0.0 ads.rodale.com +0.0.0.0 ads.roiserver.com +0.0.0.0 ads.rondomondo.com +0.0.0.0 ads.rootzoo.com +0.0.0.0 ads.rottentomatoes.com +0.0.0.0 ads.rp-online.de +0.0.0.0 ads.ruralpress.com +0.0.0.0 adsrv2.wilmingtonstar.com +0.0.0.0 adsrv.bankrate.com +0.0.0.0 adsrv.dispatch.com +0.0.0.0 adsrv.emporis.com +0.0.0.0 adsrv.heraldtribune.com +0.0.0.0 adsrv.hpg.com.br +0.0.0.0 adsrv.iol.co.za +0.0.0.0 adsrv.lua.pl +0.0.0.0 adsrv.news.com.au +0.0.0.0 adsrvr.com +0.0.0.0 adsrv.tuscaloosanews.com +0.0.0.0 adsrv.wilmingtonstar.com +0.0.0.0 ads.sacbee.com +0.0.0.0 ads.satyamonline.com +0.0.0.0 ads.savannahnow.com +0.0.0.0 ads.scabee.com +0.0.0.0 ads.schwabtrader.com +0.0.0.0 ads.scifi.com +0.0.0.0 ads.seattletimes.com +0.0.0.0 ads.sfusion.com +0.0.0.0 ads.shizmoo.com +0.0.0.0 ads.shoppingads.com +0.0.0.0 ads.shoutfile.com +0.0.0.0 ads.sify.com +0.0.0.0 ads.simtel.com +0.0.0.0 ads.simtel.net +0.0.0.0 ads.sitemeter.com +0.0.0.0 ads.sixapart.com +0.0.0.0 adssl01.adtech.de +0.0.0.0 adssl01.adtech.fr +0.0.0.0 adssl01.adtech.us +0.0.0.0 adssl02.adtech.de +0.0.0.0 adssl02.adtech.fr +0.0.0.0 adssl02.adtech.us +0.0.0.0 ads.sl.interpals.net +0.0.0.0 ads.smartclick.com +0.0.0.0 ads.smartclicks.com +0.0.0.0 ads.smartclicks.net +0.0.0.0 ads.snowball.com +0.0.0.0 ads.socialmedia.com +0.0.0.0 ads.sohh.com +0.0.0.0 ads.somethingawful.com +0.0.0.0 ads.space.com +0.0.0.0 adsspace.net +0.0.0.0 ads.specificclick.com +0.0.0.0 ads.specificmedia.com +0.0.0.0 ads.specificpop.com +0.0.0.0 ads.sptimes.com +0.0.0.0 ads.spymac.net +0.0.0.0 ads.stackoverflow.com +0.0.0.0 ads.starbanner.com +0.0.0.0 ads.stephensmedia.com +0.0.0.0 ads.stileproject.com +0.0.0.0 ads.stupid.com +0.0.0.0 ads.sunjournal.com +0.0.0.0 ads.sup.com +0.0.0.0 ads.swiftnews.com +0.0.0.0 ads.switchboard.com +0.0.0.0 ads.teamyehey.com +0.0.0.0 ads.technoratimedia.com +0.0.0.0 ads.techtv.com +0.0.0.0 ads.techvibes.com +0.0.0.0 ads.techweb.com +0.0.0.0 ads.telegraaf.nl +0.0.0.0 ads.telegraph.co.uk +0.0.0.0 ads.the15thinternet.com +0.0.0.0 ads.theawl.com +0.0.0.0 ads.thebugs.ws +0.0.0.0 ads.thecoolhunter.net +0.0.0.0 ads.thecrimson.com +0.0.0.0 ads.thefrisky.com +0.0.0.0 ads.thegauntlet.com +0.0.0.0 ads.theglobeandmail.com +0.0.0.0 ads.theindependent.com +0.0.0.0 ads.theolympian.com +0.0.0.0 ads.thesmokinggun.com +0.0.0.0 ads.thestar.com #Toronto Star +0.0.0.0 ads.thestranger.com +0.0.0.0 ads.thewebfreaks.com +0.0.0.0 adstil.indiatimes.com +0.0.0.0 ads.timesunion.com +0.0.0.0 ads.tiscali.fr +0.0.0.0 ads.tmcs.net +0.0.0.0 ads.tnt.tv +0.0.0.0 adstogo.com +0.0.0.0 adstome.com +0.0.0.0 ads.top500.org #TOP500 SuperComputer Site +0.0.0.0 ads.top-banners.com +0.0.0.0 ads.toronto.com +0.0.0.0 ads.townhall.com +0.0.0.0 ads.track.net +0.0.0.0 ads.traderonline.com +0.0.0.0 ads.traffichaus.com +0.0.0.0 ads.trafficjunky.net +0.0.0.0 ads.traffikings.com +0.0.0.0 adstream.cardboardfish.com +0.0.0.0 adstreams.org +0.0.0.0 ads.treehugger.com +0.0.0.0 ads.tricityherald.com +0.0.0.0 ads.trinitymirror.co.uk +0.0.0.0 ads.tripod.com +0.0.0.0 ads.tripod.lycos.co.uk +0.0.0.0 ads.tripod.lycos.de +0.0.0.0 ads.tripod.lycos.es +0.0.0.0 ads.tromaville.com +0.0.0.0 ads-t.ru +0.0.0.0 ads.trutv.com +0.0.0.0 ads.tucows.com +0.0.0.0 ads.tw.adsonar.com +0.0.0.0 ads.ucomics.com +0.0.0.0 ads.uigc.net +0.0.0.0 ads.undertone.com +0.0.0.0 ads.unixathome.org +0.0.0.0 ads.update.com +0.0.0.0 ad.suprnova.org +0.0.0.0 ads.uproar.com +0.0.0.0 ads.urbandictionary.com +0.0.0.0 ads.usatoday.com +0.0.0.0 ads.us.e-planning.ne +0.0.0.0 ads.us.e-planning.net +0.0.0.0 ads.userfriendly.org +0.0.0.0 ads.v3.com +0.0.0.0 ads.v3exchange.com +0.0.0.0 ads.vaildaily.com +0.0.0.0 ads.valuead.com +0.0.0.0 ads.vegas.com +0.0.0.0 ads.veloxia.com +0.0.0.0 ads.ventivmedia.com +0.0.0.0 ads.veoh.com +0.0.0.0 ads.verkata.com +0.0.0.0 ads.vesperexchange.com +0.0.0.0 ads.vg.basefarm.net +0.0.0.0 ads.viddler.com +0.0.0.0 ads.videoadvertising.com +0.0.0.0 ads.viewlondon.co.uk +0.0.0.0 ads.virginislandsdailynews.com +0.0.0.0 ads.virtualcountries.com +0.0.0.0 ads.vnuemedia.com +0.0.0.0 adsvr.adknowledge.com +0.0.0.0 ads.vs.co +0.0.0.0 ads.vs.com +0.0.0.0 ads.wanadooregie.com +0.0.0.0 ads.warcry.com +0.0.0.0 ads.watershed-publishing.com +0.0.0.0 ads.wave.si +0.0.0.0 ads.weather.ca +0.0.0.0 ads.weather.com +0.0.0.0 ads.web21.com +0.0.0.0 ads.web.alwayson-network.com +0.0.0.0 ads.web.aol.com +0.0.0.0 ads.webattack.com +0.0.0.0 ads.web.compuserve.com +0.0.0.0 ads.webcoretech.com +0.0.0.0 ads.web.cs.com +0.0.0.0 ads.web.de +0.0.0.0 ads.webfeat.com +0.0.0.0 ads.webheat.com +0.0.0.0 ads.webhosting.info +0.0.0.0 ads.webindia123.com +0.0.0.0 ads-web.mail.com +0.0.0.0 ads.webmd.com +0.0.0.0 ads.webnet.advance.net +0.0.0.0 ads.websponsors.com +0.0.0.0 adsweb.tiscali.cz +0.0.0.0 ads.weissinc.com +0.0.0.0 ads.whaleads.com +0.0.0.0 ads.whi.co.nz +0.0.0.0 ads.winsite.com +0.0.0.0 ads.wnd.com +0.0.0.0 ads.wunderground.com +0.0.0.0 ads.x10.com +0.0.0.0 ads.x10.net +0.0.0.0 ads.x17online.com +0.0.0.0 ads.xboxic.com +0.0.0.0 ads.xbox-scene.com +0.0.0.0 ads.xposed.com +0.0.0.0 ads.xtra.ca +0.0.0.0 ads.xtra.co.nz +0.0.0.0 ads.xtramsn.co.nz +0.0.0.0 ads.yahoo.com +0.0.0.0 ads.yimg.com +0.0.0.0 ads.yimg.com.edgesuite.net +0.0.0.0 ads.yldmgrimg.net +0.0.0.0 adsyndication.msn.com +0.0.0.0 adsyndication.yelldirect.com +0.0.0.0 adsynergy.com +0.0.0.0 ads.youporn.com +0.0.0.0 ads.youtube.com +0.0.0.0 adsys.townnews.com +0.0.0.0 ads.zap2it.com +0.0.0.0 ads.zdnet.com +0.0.0.0 adtag.msn.ca +0.0.0.0 adtag.sympatico.ca +0.0.0.0 adtaily.com +0.0.0.0 adtaily.pl +0.0.0.0 ad.tbn.ru +0.0.0.0 adtcp.ru +0.0.0.0 adtech.de +0.0.0.0 ad.technoramedia.com +0.0.0.0 adtech.panthercustomer.com +0.0.0.0 adtechus.com +0.0.0.0 adtegrity.spinbox.net +0.0.0.0 adtext.pl +0.0.0.0 ad.text.tbn.ru +0.0.0.0 ad.tgdaily.com +0.0.0.0 ad.thehill.com +0.0.0.0 ad.thetyee.ca +0.0.0.0 ad.thewheelof.com +0.0.0.0 adthru.com +0.0.0.0 adtigerpl.adspirit.net +0.0.0.0 ad.tiscali.com +0.0.0.0 adtlgc.com +0.0.0.0 adtology3.com +0.0.0.0 ad.tomshardware.com +0.0.0.0 adtotal.pl +0.0.0.0 adtracking.vinden.nl +0.0.0.0 adtrader.com +0.0.0.0 ad.trafficmp.com +0.0.0.0 adtrak.net +0.0.0.0 ad.turn.com +0.0.0.0 ad.tv2.no +0.0.0.0 ad.twitchguru.com +0.0.0.0 ad.ubnm.co.kr +0.0.0.0 ad.uk.tangozebra.com +0.0.0.0 ad-uk.tiscali.com +0.0.0.0 adultadworld.com +0.0.0.0 ad.usatoday.com +0.0.0.0 adv0005.247realmedia.com +0.0.0.0 adv0035.247realmedia.com +0.0.0.0 adv.440net.com +0.0.0.0 adv.adgates.com +0.0.0.0 adv.adtotal.pl +0.0.0.0 adv.adview.pl +0.0.0.0 adv.bannercity.ru +0.0.0.0 adv.bbanner.it +0.0.0.0 adv.bookclubservices.ca +0.0.0.0 adveng.hiasys.com +0.0.0.0 adveraction.pl +0.0.0.0 advert.bayarea.com +0.0.0.0 advertise.com +0.0.0.0 advertisers.federatedmedia.net +0.0.0.0 advertising.aol.com +0.0.0.0 advertisingbay.com +0.0.0.0 advertising.bbcworldwide.com +0.0.0.0 advertising.com +0.0.0.0 advertising.gfxartist.com +0.0.0.0 advertising.hiasys.com +0.0.0.0 advertising.illinimedia.com +0.0.0.0 advertising.online-media24.de +0.0.0.0 advertising.paltalk.com +0.0.0.0 advertising.wellpack.fr +0.0.0.0 advertising.zenit.org +0.0.0.0 advertlets.com +0.0.0.0 advertpro.investorvillage.com +0.0.0.0 advertpro.sitepoint.com +0.0.0.0 adverts.digitalspy.co.uk +0.0.0.0 adverts.ecn.co.uk +0.0.0.0 adverts.freeloader.com +0.0.0.0 adverts.im4ges.com +0.0.0.0 advertstream.com +0.0.0.0 advert.uloz.to +0.0.0.0 adv.federalpost.ru +0.0.0.0 adv.gazeta.pl +0.0.0.0 advicepl.adocean.pl +0.0.0.0 adview.pl +0.0.0.0 adviva.net +0.0.0.0 adv.lampsplus.com +0.0.0.0 advmaker.ru +0.0.0.0 adv.merlin.co.il +0.0.0.0 adv.netshelter.net +0.0.0.0 adv.publy.net +0.0.0.0 adv.surinter.net +0.0.0.0 advt.webindia123.com +0.0.0.0 ad.vurts.com +0.0.0.0 adv.virgilio.it +0.0.0.0 adv.webmd.com +0.0.0.0 adv.wp.pl +0.0.0.0 adv.zapal.ru +0.0.0.0 advzilla.com +0.0.0.0 adware.kogaryu.com +0.0.0.0 adweb2.hornymatches.com +0.0.0.0 ad.webprovider.com +0.0.0.0 adw.sapo.pt +0.0.0.0 ad.wsod.com +0.0.0.0 adx.adrenalinesk.sk +0.0.0.0 adx.gainesvillesun.com +0.0.0.0 adx.gainesvillsun.com +0.0.0.0 adx.groupstate.com +0.0.0.0 adx.hendersonvillenews.com +0.0.0.0 adx.heraldtribune.com +0.0.0.0 adxpose.com +0.0.0.0 adx.starnewsonline.com +0.0.0.0 ad.xtendmedia.com +0.0.0.0 adx.theledger.com +0.0.0.0 ad.yadro.ru +0.0.0.0 ad.yieldmanager.com +0.0.0.0 adz.afterdawn.net +0.0.0.0 ad.zanox.com +0.0.0.0 adzerk.net +0.0.0.0 ad.zodera.hu +0.0.0.0 adzone.ro +0.0.0.0 adzone.stltoday.com +0.0.0.0 adzservice.theday.com +0.0.0.0 ae.goodsblock.marketgid.com +0.0.0.0 afe2.specificclick.net +0.0.0.0 afe.specificclick.net +0.0.0.0 aff.foxtab.com +0.0.0.0 affiliate.a4dtracker.com +0.0.0.0 affiliate.aol.com +0.0.0.0 affiliate.baazee.com +0.0.0.0 affiliate.cfdebt.com +0.0.0.0 affiliate.exabytes.com.my +0.0.0.0 affiliate-fr.com +0.0.0.0 affiliate.fr.espotting.com +0.0.0.0 affiliate.googleusercontent.com +0.0.0.0 affiliate.hbytracker.com +0.0.0.0 affiliate.mlntracker.com +0.0.0.0 affiliates.arvixe.com +0.0.0.0 affiliates.eblastengine.com +0.0.0.0 affiliates.genealogybank.com +0.0.0.0 affiliates.globat.com +0.0.0.0 affiliation-france.com +0.0.0.0 affimg.pop6.com +0.0.0.0 afform.co.uk +0.0.0.0 affpartners.com +0.0.0.0 aff.ringtonepartner.com +0.0.0.0 afi.adocean.pl +0.0.0.0 afilo.pl +0.0.0.0 agkn.com +0.0.0.0 aj.600z.com +0.0.0.0 ajcclassifieds.com +0.0.0.0 akaads-espn.starwave.com +0.0.0.0 aka-cdn.adtechus.com +0.0.0.0 aka-cdn-ns.adtech.de +0.0.0.0 aka-cdn-ns.adtechus.com +0.0.0.0 akamai.invitemedia.com +0.0.0.0 ak.buyservices.com +0.0.0.0 a.kerg.net +0.0.0.0 ak.maxserving.com +0.0.0.0 ako.cc +0.0.0.0 ak.p.openx.net +0.0.0.0 al1.sharethis.com +0.0.0.0 alert.police-patrol-agent.com +0.0.0.0 a.ligatus.com +0.0.0.0 a.ligatus.de +0.0.0.0 alliance.adbureau.net +0.0.0.0 all.orfr.adgtw.orangeads.fr +0.0.0.0 altfarm.mediaplex.com +0.0.0.0 amch.questionmarket.com +0.0.0.0 americansingles.click-url.com +0.0.0.0 a.mktw.net +0.0.0.0 amscdn.btrll.com +0.0.0.0 analysis.fc2.com +0.0.0.0 analytics.kwebsoft.com +0.0.0.0 analytics.percentmobile.com +0.0.0.0 analyzer51.fc2.com +0.0.0.0 ankieta-online.pl +0.0.0.0 annuaire-autosurf.com +0.0.0.0 anrtx.tacoda.net +0.0.0.0 answers.us.intellitxt.com +0.0.0.0 an.tacoda.net +0.0.0.0 an.yandex.ru +0.0.0.0 apex-ad.com +0.0.0.0 api.addthis.com +0.0.0.0 api.affinesystems.com +0.0.0.0 api-public.addthis.com +0.0.0.0 apopt.hbmediapro.com +0.0.0.0 apparelncs.com +0.0.0.0 apparel-offer.com +0.0.0.0 appdev.addthis.com +0.0.0.0 appnexus.com +0.0.0.0 apps5.oingo.com +0.0.0.0 app.scanscout.com +0.0.0.0 ap.read.mediation.pns.ap.orangeads.fr +0.0.0.0 a.prisacom.com +0.0.0.0 apx.moatads.com +0.0.0.0 a.rad.live.com +0.0.0.0 a.rad.msn.com +0.0.0.0 arbomedia.pl +0.0.0.0 arbopl.bbelements.com +0.0.0.0 arsconsole.global-intermedia.com +0.0.0.0 art-music-rewardpath.com +0.0.0.0 art-offer.com +0.0.0.0 art-offer.net +0.0.0.0 art-photo-music-premiumblvd.com +0.0.0.0 art-photo-music-rewardempire.com +0.0.0.0 art-photo-music-savingblvd.com +0.0.0.0 as1.falkag.de +0.0.0.0 as1image1.adshuffle.com +0.0.0.0 as1image2.adshuffle.com +0.0.0.0 as1.inoventiv.com +0.0.0.0 as2.falkag.de +0.0.0.0 as3.falkag.de +0.0.0.0 as4.falkag.de +0.0.0.0 as.5to1.com +0.0.0.0 asa.tynt.com +0.0.0.0 asb.tynt.com +0.0.0.0 as.casalemedia.com +0.0.0.0 as.ebz.io +0.0.0.0 asg01.casalemedia.com +0.0.0.0 asg02.casalemedia.com +0.0.0.0 asg03.casalemedia.com +0.0.0.0 asg04.casalemedia.com +0.0.0.0 asg05.casalemedia.com +0.0.0.0 asg06.casalemedia.com +0.0.0.0 asg07.casalemedia.com +0.0.0.0 asg08.casalemedia.com +0.0.0.0 asg09.casalemedia.com +0.0.0.0 asg10.casalemedia.com +0.0.0.0 asg11.casalemedia.com +0.0.0.0 asg12.casalemedia.com +0.0.0.0 asg13.casalemedia.com +0.0.0.0 ask-gps.ru +0.0.0.0 asklots.com +0.0.0.0 askmen.thruport.com +0.0.0.0 asm2.z1.adserver.com +0.0.0.0 asm3.z1.adserver.com +0.0.0.0 asn.advolution.de +0.0.0.0 asn.cunda.advolution.biz +0.0.0.0 a.ss34.on9mail.com +0.0.0.0 assets.igapi.com +0.0.0.0 assets.kixer.com +0.0.0.0 assets.percentmobile.com +0.0.0.0 as.sexad.net +0.0.0.0 asv.nuggad.net +0.0.0.0 as.vs4entertainment.com +0.0.0.0 as.webmd.com +0.0.0.0 a.tadd.react2media.com +0.0.0.0 at-adserver.alltop.com +0.0.0.0 at.campaigns.f2.com.au +0.0.0.0 at.ceofreehost.com +0.0.0.0 atdmt.com +0.0.0.0 atemda.com +0.0.0.0 athena-ads.wikia.com +0.0.0.0 at.m1.nedstatbasic.net +0.0.0.0 a.total-media.net +0.0.0.0 a.tribalfusion.com +0.0.0.0 a.triggit.com +0.0.0.0 au.adserver.yahoo.com +0.0.0.0 au.ads.link4ads.com +0.0.0.0 aud.pubmatic.com +0.0.0.0 aureate.com +0.0.0.0 auslieferung.commindo-media-ressourcen.de +0.0.0.0 austria1.adverserve.net +0.0.0.0 autocontext.begun.ru +0.0.0.0 automotive-offer.com +0.0.0.0 automotive-rewardpath.com +0.0.0.0 avcounter10.com +0.0.0.0 avpa.dzone.com +0.0.0.0 avpa.javalobby.org +0.0.0.0 a.websponsors.com +0.0.0.0 awesomevipoffers.com +0.0.0.0 awrz.net +0.0.0.0 axp.zedo.com +0.0.0.0 azcentra.app.ur.gcion.com +0.0.0.0 azoogleads.com +0.0.0.0 b1.adbrite.com +0.0.0.0 b1.azjmp.com +0.0.0.0 b2b.filecloud.me +0.0.0.0 babycenter.tt.omtrdc.net +0.0.0.0 b.ads2.msn.com +0.0.0.0 badservant.guj.de +0.0.0.0 b.am15.net +0.0.0.0 bananacashback.com +0.0.0.0 banery.acr.pl +0.0.0.0 banery.netart.pl +0.0.0.0 banery.onet.pl +0.0.0.0 banki.onet.pl +0.0.0.0 bankofamerica.tt.omtrdc.net +0.0.0.0 banman.nepsecure.co.uk +0.0.0.0 banner.1and1.co.uk +0.0.0.0 banner1.pornhost.com +0.0.0.0 banner2.inet-traffic.com +0.0.0.0 bannerads.anytimenews.com +0.0.0.0 bannerads.de +0.0.0.0 bannerads.zwire.com +0.0.0.0 banner.affactive.com +0.0.0.0 banner.betroyalaffiliates.com +0.0.0.0 banner.betwwts.com +0.0.0.0 banner.cdpoker.com +0.0.0.0 banner.clubdicecasino.com +0.0.0.0 bannerconnect.net +0.0.0.0 banner.coza.com +0.0.0.0 banner.diamondclubcasino.com +0.0.0.0 bannerdriven.ru +0.0.0.0 banner.easyspace.com +0.0.0.0 bannerfarm.ace.advertising.com +0.0.0.0 banner.free6.com # www.free6.com +0.0.0.0 bannerhost.egamingonline.com +0.0.0.0 bannerimages.0catch.com +0.0.0.0 banner.joylandcasino.com +0.0.0.0 banner.media-system.de +0.0.0.0 banner.monacogoldcasino.com +0.0.0.0 banner.newyorkcasino.com +0.0.0.0 banner.northsky.com +0.0.0.0 banner.oddcast.com +0.0.0.0 banner.orb.net +0.0.0.0 banner.piratos.de +0.0.0.0 banner.playgatecasino.com +0.0.0.0 bannerpower.com +0.0.0.0 banner.prestigecasino.com +0.0.0.0 banner.publisher.to +0.0.0.0 banner.rbc.ru +0.0.0.0 banner.relcom.ru +0.0.0.0 banners1.linkbuddies.com +0.0.0.0 banners2.castles.org +0.0.0.0 banners3.spacash.com +0.0.0.0 banners.adgoto.com +0.0.0.0 banners.adultfriendfinder.com +0.0.0.0 banners.affiliatefuel.com +0.0.0.0 banners.affiliatefuture.com +0.0.0.0 banners.aftrk.com +0.0.0.0 banners.audioholics.com +0.0.0.0 banners.blogads.com +0.0.0.0 banners.bol.se +0.0.0.0 banners.broadwayworld.com +0.0.0.0 banners.celebritybling.com +0.0.0.0 banners.crisscross.com +0.0.0.0 banners.directnic.com +0.0.0.0 banners.dnastudio.com +0.0.0.0 banners.easydns.com +0.0.0.0 banners.easysolutions.be +0.0.0.0 banners.ebay.com +0.0.0.0 banners.expressindia.com +0.0.0.0 banners.flair.be +0.0.0.0 banners.free6.com # www.free6.com +0.0.0.0 banners.fuifbeest.be +0.0.0.0 banners.globovision.com +0.0.0.0 banners.img.uol.com.br +0.0.0.0 banners.ims.nl +0.0.0.0 banners.iop.org +0.0.0.0 banners.ipotd.com +0.0.0.0 banners.japantoday.com +0.0.0.0 banners.kfmb.com +0.0.0.0 banners.ksl.com +0.0.0.0 banners.linkbuddies.com +0.0.0.0 banners.looksmart.com +0.0.0.0 banners.nbcupromotes.com +0.0.0.0 banners.netcraft.com +0.0.0.0 banners.newsru.com +0.0.0.0 banners.nextcard.com +0.0.0.0 banners.passion.com +0.0.0.0 banners.pennyweb.com +0.0.0.0 banners.primaryclick.com +0.0.0.0 banners.resultonline.com +0.0.0.0 banners.rspworldwide.com +0.0.0.0 banners.sextracker.com +0.0.0.0 banners.spiceworks.com +0.0.0.0 banners.thegridwebmaster.com +0.0.0.0 banners.thestranger.com +0.0.0.0 banners.thgimages.co.uk +0.0.0.0 banners.tribute.ca +0.0.0.0 banners.tucson.com +0.0.0.0 banners.unibet.com +0.0.0.0 bannersurvey.biz +0.0.0.0 banners.valuead.com +0.0.0.0 banners.videosecrets.com +0.0.0.0 banners.webmasterplan.com +0.0.0.0 banners.wunderground.com +0.0.0.0 banners.zbs.ru +0.0.0.0 banner.tattomedia.com +0.0.0.0 banner.techarp.com +0.0.0.0 bannert.ru +0.0.0.0 bannerus1.axelsfun.com +0.0.0.0 bannerus3.axelsfun.com +0.0.0.0 banner.usacasino.com +0.0.0.0 banniere.reussissonsensemble.fr +0.0.0.0 bans.bride.ru +0.0.0.0 banstex.com +0.0.0.0 bansys.onzin.com +0.0.0.0 bargainbeautybuys.com +0.0.0.0 barnesandnoble.bfast.com +0.0.0.0 b.as-us.falkag.net +0.0.0.0 bayoubuzz.advertserve.com +0.0.0.0 bbcdn.go.adlt.bbelements.com +0.0.0.0 bbcdn.go.adnet.bbelements.com +0.0.0.0 bbcdn.go.arbo.bbelements.com +0.0.0.0 bbcdn.go.eu.bbelements.com +0.0.0.0 bbcdn.go.ihned.bbelements.com +0.0.0.0 bbcdn.go.pl.bbelements.com +0.0.0.0 bb.crwdcntrl.net +0.0.0.0 bbnaut.bbelements.com +0.0.0.0 bc685d37-266c-488e-824e-dd95d1c0e98b.statcamp.net +0.0.0.0 bcp.crwdcntrl.net +0.0.0.0 bdnad1.bangornews.com +0.0.0.0 bdv.bidvertiser.com +0.0.0.0 beacon-3.newrelic.com +0.0.0.0 beacons.helium.com +0.0.0.0 bell.adcentriconline.com +0.0.0.0 beseenad.looksmart.com +0.0.0.0 bestgift4you.cn +0.0.0.0 bestshopperrewards.com +0.0.0.0 beta.hotkeys.com +0.0.0.0 bet-at-home.com +0.0.0.0 betterperformance.goldenopps.info +0.0.0.0 bfast.com +0.0.0.0 bidclix.net +0.0.0.0 bid.openx.net +0.0.0.0 bidsystem.com +0.0.0.0 bidtraffic.com +0.0.0.0 bidvertiser.com +0.0.0.0 bigads.guj.de +0.0.0.0 bigbrandpromotions.com +0.0.0.0 bigbrandrewards.com +0.0.0.0 biggestgiftrewards.com +0.0.0.0 billing.speedboink.com +0.0.0.0 bitburg.adtech.de +0.0.0.0 bitburg.adtech.fr +0.0.0.0 bitburg.adtech.us +0.0.0.0 bitcast-d.bitgravity.com +0.0.0.0 bizad.nikkeibp.co.jp +0.0.0.0 biz-offer.com +0.0.0.0 bizopprewards.com +0.0.0.0 blabla4u.adserver.co.il +0.0.0.0 blasphemysfhs.info +0.0.0.0 blatant8jh.info +0.0.0.0 b.liquidustv.com +0.0.0.0 blog.addthis.com +0.0.0.0 blogads.com +0.0.0.0 blogads.ebanner.nl +0.0.0.0 blogvertising.pl +0.0.0.0 bluediamondoffers.com +0.0.0.0 blu.mobileads.msn.com +0.0.0.0 bl.wavecdn.de +0.0.0.0 b.myspace.com +0.0.0.0 bn.bfast.com +0.0.0.0 bnmgr.adinjector.net +0.0.0.0 bnrs.ilm.ee +0.0.0.0 boksy.dir.onet.pl +0.0.0.0 boksy.onet.pl +0.0.0.0 bookclub-offer.com +0.0.0.0 books-media-edu-premiumblvd.com +0.0.0.0 books-media-edu-rewardempire.com +0.0.0.0 books-media-rewardpath.com +0.0.0.0 bostonsubwayoffer.com +0.0.0.0 bp.specificclick.net +0.0.0.0 b.rad.live.com +0.0.0.0 b.rad.msn.com +0.0.0.0 br.adserver.yahoo.com +0.0.0.0 brandrewardcentral.com +0.0.0.0 brandsurveypanel.com +0.0.0.0 bravo.israelinfo.ru +0.0.0.0 bravospots.com +0.0.0.0 br.naked.com +0.0.0.0 broadcast.piximedia.fr +0.0.0.0 broadent.vo.llnwd.net +0.0.0.0 brokertraffic.com +0.0.0.0 bsads.looksmart.com +#0.0.0.0 b.scorecardresearch.com # interferes with Huffington Post slideshows +0.0.0.0 bs.israelinfo.ru +0.0.0.0 bs.serving-sys.com #eyeblaster.com +0.0.0.0 bt.linkpulse.com +0.0.0.0 burns.adtech.de +0.0.0.0 burns.adtech.fr +0.0.0.0 burns.adtech.us +0.0.0.0 business-rewardpath.com +0.0.0.0 bus-offer.com +0.0.0.0 buttcandy.com +0.0.0.0 buttons.googlesyndication.com +0.0.0.0 buzzbox.buzzfeed.com +0.0.0.0 bwp.lastfm.com.com +0.0.0.0 bwp.news.com +0.0.0.0 c1.popads.net +0.0.0.0 c1.teaser-goods.ru +0.0.0.0 c1.zedo.com +0.0.0.0 c2.zedo.com +0.0.0.0 c3.zedo.com +0.0.0.0 c4.maxserving.com +0.0.0.0 c4.zedo.com +0.0.0.0 c5.zedo.com +0.0.0.0 c6.zedo.com +0.0.0.0 c7.zedo.com +0.0.0.0 c8.zedo.com +0.0.0.0 ca.adserver.yahoo.com +0.0.0.0 cache.addthiscdn.com +0.0.0.0 cache.addthis.com +0.0.0.0 cache.blogads.com +0.0.0.0 cache-dev.addthis.com +0.0.0.0 cacheserve.eurogrand.com +0.0.0.0 cacheserve.prestigecasino.com +0.0.0.0 cache.unicast.com +0.0.0.0 c.actiondesk.com +0.0.0.0 c.adroll.com +0.0.0.0 califia.imaginemedia.com +0.0.0.0 c.am10.ru +0.0.0.0 camgeil.com +0.0.0.0 campaign.iitech.dk +0.0.0.0 campaign.indieclick.com +0.0.0.0 campaigns.f2.com.au +0.0.0.0 campaigns.interclick.com +0.0.0.0 capath.com +0.0.0.0 cardgamespidersolitaire.com +0.0.0.0 cards.virtuagirlhd.com +0.0.0.0 careers.canwestad.net +0.0.0.0 careers-rewardpath.com +0.0.0.0 c.ar.msn.com +0.0.0.0 carrier.bz +0.0.0.0 car-truck-boat-bonuspath.com +0.0.0.0 car-truck-boat-premiumblvd.com +0.0.0.0 casalemedia.com +0.0.0.0 cas.clickability.com +0.0.0.0 cashback.co.uk +0.0.0.0 cashbackwow.co.uk +0.0.0.0 cashflowmarketing.com +0.0.0.0 casino770.com +0.0.0.0 c.as-us.falkag.net +0.0.0.0 catalinkcashback.com +0.0.0.0 catchvid.info +0.0.0.0 c.at.msn.com +0.0.0.0 cbanners.virtuagirlhd.com +0.0.0.0 c.be.msn.com +0.0.0.0 c.blogads.com +0.0.0.0 c.br.msn.com +0.0.0.0 c.ca.msn.com +0.0.0.0 c.casalemedia.com +0.0.0.0 ccas.clearchannel.com +0.0.0.0 c.cl.msn.com +0.0.0.0 c.de.msn.com +0.0.0.0 c.dk.msn.com +0.0.0.0 cdn1.adexprt.com +0.0.0.0 cdn1.ads.mofos.com +0.0.0.0 cdn1.eyewonder.com +0.0.0.0 cdn1.rmgserving.com +0.0.0.0 cdn1.traffichaus.com +0.0.0.0 cdn1.xlightmedia.com +0.0.0.0 cdn2.adsdk.com +0.0.0.0 cdn2.amateurmatch.com +0.0.0.0 cdn2.emediate.eu +0.0.0.0 cdn3.adexprts.com +0.0.0.0 cdn3.telemetryverification.net +0.0.0.0 cdn454.telemetryverification.net +0.0.0.0 cdn5.tribalfusion.com +0.0.0.0 cdn6.emediate.eu +0.0.0.0 cdn.adigniter.org +0.0.0.0 cdn.adnxs.com +0.0.0.0 cdnads.cam4.com +0.0.0.0 cdn.ads.ookla.com +0.0.0.0 cdn.amateurmatch.com +0.0.0.0 cdn.amgdgt.com +0.0.0.0 cdn.assets.craveonline.com +0.0.0.0 cdn.banners.scubl.com +0.0.0.0 cdn.cpmstar.com +0.0.0.0 cdn.crowdignite.com +0.0.0.0 cdn.directrev.com +0.0.0.0 cdn.eyewonder.com +0.0.0.0 cdn.go.arbo.bbelements.com +0.0.0.0 cdn.go.arbopl.bbelements.com +0.0.0.0 cdn.go.cz.bbelements.com +0.0.0.0 cdn.go.idmnet.bbelements.com +0.0.0.0 cdn.go.pol.bbelements.com +0.0.0.0 cdn.hadj7.adjuggler.net +0.0.0.0 cdn.innovid.com +0.0.0.0 cdn.krxd.net +0.0.0.0 cdn.mediative.ca +0.0.0.0 cdn.merchenta.com +0.0.0.0 cdn.mobicow.com +0.0.0.0 cdn.nearbyad.com +0.0.0.0 cdn.nsimg.net +0.0.0.0 cdn.onescreen.net +#0.0.0.0 cdns.gigya.com +0.0.0.0 cdns.mydirtyhobby.com +0.0.0.0 cdns.privatamateure.com +0.0.0.0 cdn.stat.easydate.biz +0.0.0.0 cdn.syn.verticalacuity.com +0.0.0.0 cdn.tabnak.ir +0.0.0.0 cdnt.yottos.com +0.0.0.0 cdn.udmserve.net +0.0.0.0 cdn.undertone.com +0.0.0.0 cdn.wg.uproxx.com +0.0.0.0 cdnw.ringtonepartner.com +0.0.0.0 cdn.yottos.com +0.0.0.0 cdn.zeusclicks.com +0.0.0.0 cds.adecn.com +0.0.0.0 cecash.com +0.0.0.0 ced.sascdn.com +0.0.0.0 cell-phone-giveaways.com +0.0.0.0 cellphoneincentives.com +0.0.0.0 cent.adbureau.net +0.0.0.0 c.es.msn.com +0.0.0.0 c.fi.msn.com +0.0.0.0 cf.kampyle.com +0.0.0.0 c.fr.msn.com +0.0.0.0 cgirm.greatfallstribune.com +0.0.0.0 cgm.adbureau.ne +0.0.0.0 cgm.adbureau.net +0.0.0.0 c.gr.msn.com +0.0.0.0 chainsawoffer.com +0.0.0.0 chartbeat.com +0.0.0.0 checkintocash.data.7bpeople.com +0.0.0.0 cherryhi.app.ur.gcion.com +0.0.0.0 c.hk.msn.com +0.0.0.0 chkpt.zdnet.com +0.0.0.0 choicedealz.com +0.0.0.0 choicesurveypanel.com +0.0.0.0 christianbusinessadvertising.com +0.0.0.0 c.id.msn.com +0.0.0.0 c.ie.msn.com +0.0.0.0 c.il.msn.com +0.0.0.0 c.imedia.cz +0.0.0.0 c.in.msn.com +0.0.0.0 cithingy.info +0.0.0.0 citi.bridgetrack.com +0.0.0.0 c.it.msn.com +0.0.0.0 citrix.market2lead.com +0.0.0.0 cityads.telus.net +0.0.0.0 citycash2.blogspot.com +0.0.0.0 c.jp.msn.com +0.0.0.0 cl21.v4.adaction.se +0.0.0.0 cl320.v4.adaction.se +0.0.0.0 claimfreerewards.com +0.0.0.0 clashmediausa.com +0.0.0.0 classicjack.com +0.0.0.0 c.latam.msn.com +0.0.0.0 click1.mainadv.com +0.0.0.0 click1.rbc.magna.ru +0.0.0.0 click2.rbc.magna.ru +0.0.0.0 click3.rbc.magna.ru +0.0.0.0 click4.rbc.magna.ru +0.0.0.0 clickad.eo.pl +0.0.0.0 clickarrows.com +0.0.0.0 click.avenuea.com +0.0.0.0 clickbangpop.com +0.0.0.0 clickcash.webpower.com +0.0.0.0 click.go2net.com +0.0.0.0 click.israelinfo.ru +0.0.0.0 clickit.go2net.com +0.0.0.0 clickmedia.ro +0.0.0.0 click.pulse360.com +0.0.0.0 clicks2.virtuagirl.com +0.0.0.0 clicks.adultplex.com +0.0.0.0 clicks.deskbabes.com +0.0.0.0 click-see-save.com +0.0.0.0 clicksor.com +0.0.0.0 clicksotrk.com +0.0.0.0 clicks.totemcash.com +0.0.0.0 clicks.toteme.com +0.0.0.0 clicks.virtuagirl.com +0.0.0.0 clicks.virtuagirlhd.com +0.0.0.0 clicks.virtuaguyhd.com +0.0.0.0 clicks.walla.co.il +0.0.0.0 clickthru.net +0.0.0.0 clickthrunet.net +0.0.0.0 clickthruserver.com +0.0.0.0 clickthrutraffic.com +0.0.0.0 clicktorrent.info +0.0.0.0 clipserv.adclip.com +0.0.0.0 clkads.com +0.0.0.0 clk.cloudyisland.com +0.0.0.0 clk.tradedoubler.com +0.0.0.0 clkuk.tradedoubler.com +0.0.0.0 c.lomadee.com +0.0.0.0 closeoutproductsreview.com +0.0.0.0 cluster3.adultadworld.com +0.0.0.0 cluster.adultadworld.com +0.0.0.0 cm1359.com +0.0.0.0 cmads.sv.publicus.com +0.0.0.0 cmads.us.publicus.com +0.0.0.0 cmap.am.ace.advertising.com +0.0.0.0 cmap.an.ace.advertising.com +0.0.0.0 cmap.at.ace.advertising.com +0.0.0.0 cmap.dc.ace.advertising.com +0.0.0.0 cmap.ox.ace.advertising.com +0.0.0.0 cmap.pub.ace.advertising.com +0.0.0.0 cmap.rm.ace.advertising.com +0.0.0.0 cmap.rub.ace.advertising.com +0.0.0.0 cmhtml.overture.com +0.0.0.0 cmn1lsm2.beliefnet.com +0.0.0.0 cm.npc-hearst.overture.com +0.0.0.0 cmps.mt50ad.com +0.0.0.0 cm.the-n.overture.com +0.0.0.0 c.my.msn.com +0.0.0.0 cnad1.economicoutlook.net +0.0.0.0 cnad2.economicoutlook.net +0.0.0.0 cnad3.economicoutlook.net +0.0.0.0 cnad4.economicoutlook.net +0.0.0.0 cnad5.economicoutlook.net +0.0.0.0 cnad6.economicoutlook.net +0.0.0.0 cnad7.economicoutlook.net +0.0.0.0 cnad8.economicoutlook.net +0.0.0.0 cnad9.economicoutlook.net +0.0.0.0 cnad.economicoutlook.net +0.0.0.0 cn.adserver.yahoo.com +0.0.0.0 cnf.adshuffle.com +0.0.0.0 c.ninemsn.com.au +0.0.0.0 c.nl.msn.com +0.0.0.0 c.no.msn.com +0.0.0.0 c.novostimira.biz +0.0.0.0 cnt1.xhamster.com +0.0.0.0 code2.adtlgc.com +0.0.0.0 code.adtlgc.com +0.0.0.0 collectiveads.net +0.0.0.0 col.mobileads.msn.com +0.0.0.0 comadverts.bcmpweb.co.nz +0.0.0.0 comcastresidentialservices.tt.omtrdc.net +0.0.0.0 com.cool-premiums-now.com +0.0.0.0 come-see-it-all.com +0.0.0.0 com.htmlwww.youfck.com +0.0.0.0 commerce-offer.com +0.0.0.0 commerce-rewardpath.com +0.0.0.0 commerce.www.ibm.com +0.0.0.0 common.ziffdavisinternet.com +0.0.0.0 companion.adap.tv +0.0.0.0 computer-offer.com +0.0.0.0 computer-offer.net +0.0.0.0 computers-electronics-rewardpath.com +0.0.0.0 computersncs.com +0.0.0.0 com.shc-rebates.com +0.0.0.0 connect.247media.ads.link4ads.com +0.0.0.0 consumergiftcenter.com +0.0.0.0 consumerincentivenetwork.com +0.0.0.0 consumerinfo.tt.omtrdc.net +0.0.0.0 consumer-org.com +0.0.0.0 contaxe.com +0.0.0.0 content.ad-flow.com +0.0.0.0 content.clipster.ws +0.0.0.0 content.codelnet.com +0.0.0.0 content.promoisland.net +0.0.0.0 contentsearch.de.espotting.com +0.0.0.0 content.yieldmanager.edgesuite.net +0.0.0.0 context3.kanoodle.com +0.0.0.0 context5.kanoodle.com +0.0.0.0 context.adshadow.net +0.0.0.0 contextweb.com +0.0.0.0 conv.adengage.com +0.0.0.0 conversion-pixel.invitemedia.com +0.0.0.0 cookiecontainer.blox.pl +0.0.0.0 cookie.pebblemedia.be +0.0.0.0 cookingtiprewards.com +0.0.0.0 cookonsea.com +0.0.0.0 cool-premiums.com +0.0.0.0 cool-premiums-now.com +0.0.0.0 coolpremiumsnow.com +0.0.0.0 coolsavings.com +0.0.0.0 corba.adtech.de +0.0.0.0 corba.adtech.fr +0.0.0.0 corba.adtech.us +0.0.0.0 core0.node12.top.mail.ru +0.0.0.0 core2.adtlgc.com +0.0.0.0 coreg.flashtrack.net +0.0.0.0 coreglead.co.uk +0.0.0.0 core.insightexpressai.com +0.0.0.0 core.videoegg.com +0.0.0.0 cornflakes.pathfinder.com +0.0.0.0 corusads.dserv.ca +0.0.0.0 cosmeticscentre.uk.com +0.0.0.0 count6.51yes.com +0.0.0.0 count.casino-trade.com +0.0.0.0 cover.m2y.siemens.ch +0.0.0.0 c.ph.msn.com +0.0.0.0 cpmadvisors.com +0.0.0.0 cp.promoisland.net +0.0.0.0 c.prodigy.msn.com +0.0.0.0 c.pt.msn.com +0.0.0.0 cpu.firingsquad.com +0.0.0.0 creatiby1.unicast.com +0.0.0.0 creative.adshuffle.com +0.0.0.0 creative.ak.facebook.com +0.0.0.0 creatives.livejasmin.com +0.0.0.0 creatives.rgadvert.com +0.0.0.0 creatrixads.com +0.0.0.0 crediblegfj.info +0.0.0.0 creditburner.blueadvertise.com +0.0.0.0 creditsoffer.blogspot.com +0.0.0.0 creview.adbureau.net +0.0.0.0 crosspixel.demdex.net +0.0.0.0 crowdgravity.com +0.0.0.0 crowdignite.com +0.0.0.0 c.ru.msn.com +0.0.0.0 crux.songline.com +0.0.0.0 crwdcntrl.net +0.0.0.0 c.se.msn.com +0.0.0.0 cserver.mii.instacontent.net +0.0.0.0 c.sg.msn.com +0.0.0.0 csh.actiondesk.com +0.0.0.0 csm.rotator.hadj7.adjuggler.net +0.0.0.0 cspix.media6degrees.com +0.0.0.0 cs.prd.msys.playstation.net +0.0.0.0 csr.onet.pl +0.0.0.0 ctbdev.net +0.0.0.0 c.th.msn.com +0.0.0.0 c.tr.msn.com +0.0.0.0 cts.channelintelligence.com +0.0.0.0 c.tw.msn.com +0.0.0.0 ctxtad.tribalfusion.com +0.0.0.0 c.uk.msn.com +0.0.0.0 cxoadfarm.dyndns.info +0.0.0.0 cxtad.specificmedia.com +0.0.0.0 cyber-incentives.com +0.0.0.0 cz8.clickzs.com +0.0.0.0 c.za.msn.com +0.0.0.0 cz.bbelements.com +0.0.0.0 d.101m3.com +0.0.0.0 d10.zedo.com +0.0.0.0 d11.zedo.com +0.0.0.0 d12.zedo.com +0.0.0.0 d14.zedo.com +0.0.0.0 d1.openx.org +0.0.0.0 d1ros97qkrwjf5.cloudfront.net +0.0.0.0 d1.zedo.com +0.0.0.0 d2.zedo.com +0.0.0.0 d3.zedo.com +0.0.0.0 d4.zedo.com +0.0.0.0 d5phz18u4wuww.cloudfront.net +0.0.0.0 d5.zedo.com +0.0.0.0 d6.c5.b0.a2.top.mail.ru +0.0.0.0 d6.zedo.com +0.0.0.0 d7.zedo.com +0.0.0.0 d8.zedo.com +0.0.0.0 d9.zedo.com +0.0.0.0 da.2000888.com +0.0.0.0 d.adnetxchange.com +0.0.0.0 d.adserve.com +0.0.0.0 dads.new.digg.com +0.0.0.0 d.ads.readwriteweb.com +0.0.0.0 d.agkn.com +0.0.0.0 daily-saver.com +0.0.0.0 darmowe-liczniki.info +0.0.0.0 dart.chron.com +0.0.0.0 data.flurry.com +0.0.0.0 date.ventivmedia.com +0.0.0.0 datingadvertising.com +0.0.0.0 db4.net-filter.com +0.0.0.0 dbbsrv.com +0.0.0.0 dc.sabela.com.pl +0.0.0.0 dctracking.com +0.0.0.0 de.adserver.yahoo.com +0.0.0.0 del1.phillyburbs.com +0.0.0.0 delb.mspaceads.com +0.0.0.0 delivery.adyea.com +0.0.0.0 delivery.trafficjunky.net +0.0.0.0 delivery.w00tads.com +0.0.0.0 delivery.way2traffic.com +0.0.0.0 demr.mspaceads.com +0.0.0.0 demr.opt.fimserve.com +0.0.0.0 derkeiler.com +0.0.0.0 desb.mspaceads.com +0.0.0.0 descargas2.tuvideogratis.com +0.0.0.0 designbloxlive.com +0.0.0.0 desk.mspaceads.com +0.0.0.0 desk.opt.fimserve.com +0.0.0.0 dev.adforum.com +0.0.0.0 devart.adbureau.net +0.0.0.0 devlp1.linkpulse.com +0.0.0.0 dev.sfbg.com +0.0.0.0 dgm2.com +0.0.0.0 dgmaustralia.com +0.0.0.0 dg.specificclick.net +0.0.0.0 dietoftoday.ca.pn #security risk/fake news# +0.0.0.0 diff3.smartadserver.com +0.0.0.0 dinoadserver1.roka.net +0.0.0.0 dinoadserver2.roka.net +0.0.0.0 directleads.com +0.0.0.0 directpowerrewards.com +0.0.0.0 directrev.cloudapp.net +0.0.0.0 dirtyrhino.com +0.0.0.0 discount-savings-more.com +0.0.0.0 discoverecommerce.tt.omtrdc.net +0.0.0.0 display.gestionpub.com +0.0.0.0 dist.belnk.com +0.0.0.0 divx.adbureau.net +0.0.0.0 djbanners.deadjournal.com +0.0.0.0 djugoogs.com +0.0.0.0 dk.adserver.yahoo.com +0.0.0.0 dl.ncbuy.com +0.0.0.0 dl-plugin.com +0.0.0.0 dlvr.readserver.net +0.0.0.0 dnads.directnic.com +0.0.0.0 dnps.com +0.0.0.0 dnse.linkpulse.com +0.0.0.0 dosugcz.biz +0.0.0.0 dot.wp.pl +0.0.0.0 downloadcdn.com +0.0.0.0 do-wn-lo-ad.com +0.0.0.0 downloads.larivieracasino.com +0.0.0.0 downloads.mytvandmovies.com +0.0.0.0 dqs001.adtech.de +0.0.0.0 dqs001.adtech.fr +0.0.0.0 dqs001.adtech.us +0.0.0.0 dra.amazon-adsystem.com +0.0.0.0 drowle.com +0.0.0.0 ds.contextweb.com +0.0.0.0 ds.onet.pl +0.0.0.0 ds.serving-sys.com +0.0.0.0 dt.linkpulse.com +0.0.0.0 dub.mobileads.msn.com +0.0.0.0 e0.extreme-dm.com +0.0.0.0 e1.addthis.com +0.0.0.0 e2.cdn.qnsr.com +0.0.0.0 e2.emediate.se +0.0.0.0 eads-adserving.com +0.0.0.0 ead.sharethis.com +0.0.0.0 earnmygift.com +0.0.0.0 earnpointsandgifts.com +0.0.0.0 e.as-eu.falkag.net +0.0.0.0 easyadservice.com +0.0.0.0 easyweb.tdcanadatrust.secureserver.host1.customer-identification-process.b88600d8.com +0.0.0.0 eatps.web.aol.com +0.0.0.0 eb.adbureau.net +0.0.0.0 eblastengine.upickem.net +0.0.0.0 ecomadserver.com +0.0.0.0 eddamedia.linkpulse.com +0.0.0.0 edge.bnmla.com +0.0.0.0 edge.quantserve.com +0.0.0.0 edirect.hotkeys.com +0.0.0.0 education-rewardpath.com +0.0.0.0 edu-offer.com +0.0.0.0 electronics-bonuspath.com +0.0.0.0 electronics-offer.net +0.0.0.0 electronicspresent.com +0.0.0.0 electronics-rewardpath.com +0.0.0.0 emailadvantagegroup.com +0.0.0.0 emailproductreview.com +0.0.0.0 emapadserver.com +0.0.0.0 emea-bidder.mathtag.com +0.0.0.0 engage.everyone.net +0.0.0.0 engage.speedera.net +0.0.0.0 engine2.adzerk.net +0.0.0.0 engine.4chan-ads.org +0.0.0.0 engine.adland.ru +0.0.0.0 engine.adzerk.net +0.0.0.0 engine.carbonads.com +0.0.0.0 engine.espace.netavenir.com +0.0.0.0 engine.influads.com +0.0.0.0 engine.rorer.ru +0.0.0.0 enirocode.adtlgc.com +0.0.0.0 enirodk.adtlgc.com +0.0.0.0 enn.advertserve.com +0.0.0.0 entertainment-rewardpath.com +0.0.0.0 entertainment-specials.com +0.0.0.0 es.adserver.yahoo.com +0.0.0.0 escape.insites.eu +0.0.0.0 espn.footprint.net +0.0.0.0 etad.telegraph.co.uk +0.0.0.0 etrk.asus.com +0.0.0.0 etype.adbureau.net +0.0.0.0 eu2.madsone.com +0.0.0.0 euniverseads.com +0.0.0.0 eu-pn4.adserver.yahoo.com +0.0.0.0 europe.adserver.yahoo.com +0.0.0.0 eu.xtms.net +0.0.0.0 eventtracker.videostrip.com +0.0.0.0 exclusivegiftcards.com +0.0.0.0 exits1.webquest.net +0.0.0.0 exits2.webquest.net +0.0.0.0 exponential.com +0.0.0.0 eyewonder.com +0.0.0.0 ezboard.bigbangmedia.com +0.0.0.0 falkag.net +0.0.0.0 family-offer.com +0.0.0.0 farm.plista.com +0.0.0.0 f.as-eu.falkag.net +0.0.0.0 fatcatrewards.com +0.0.0.0 fbcdn-creative-a.akamaihd.net +0.0.0.0 fbfreegifts.com +0.0.0.0 fbi.gov.id402037057-8235504608.d9680.com +0.0.0.0 fcg.casino770.com +0.0.0.0 fc.webmasterpro.de +0.0.0.0 fdimages.fairfax.com.au +0.0.0.0 feedads.googleadservices.com +0.0.0.0 feeds.videosz.com +0.0.0.0 feeds.weselltraffic.com +0.0.0.0 fei.pro-market.net +0.0.0.0 fe.lea.lycos.es +0.0.0.0 fhm.valueclick.net +0.0.0.0 fif49.info +0.0.0.0 files.adbrite.com +0.0.0.0 fin.adbureau.net +0.0.0.0 finance-offer.com +0.0.0.0 finanzmeldungen.com +0.0.0.0 finder.cox.net +0.0.0.0 fixbonus.com +0.0.0.0 floatingads.madisonavenue.com +0.0.0.0 floridat.app.ur.gcion.com +0.0.0.0 flowers-offer.com +0.0.0.0 fls-na.amazon.com +0.0.0.0 flu23.com +0.0.0.0 fmads.osdn.com +0.0.0.0 focusin.ads.targetnet.com +0.0.0.0 folloyu.com +0.0.0.0 food-drink-bonuspath.com +0.0.0.0 food-drink-rewardpath.com +0.0.0.0 foodmixeroffer.com +0.0.0.0 food-offer.com +0.0.0.0 foreignpolicy.advertserve.com +0.0.0.0 fp.uclo.net +0.0.0.0 fp.valueclick.com +0.0.0.0 fr.a2dfp.net +0.0.0.0 fr.adserver.yahoo.com +0.0.0.0 fr.classic.clickintext.net +0.0.0.0 freebiegb.co.uk +0.0.0.0 freecameraonus.com +0.0.0.0 freecameraprovider.com +0.0.0.0 freecamerasource.com +0.0.0.0 freecamerauk.co.uk +0.0.0.0 freecoolgift.com +0.0.0.0 freedesignerhandbagreviews.com +0.0.0.0 freedinnersource.com +0.0.0.0 freedvddept.com +0.0.0.0 freeelectronicscenter.com +0.0.0.0 freeelectronicsdepot.com +0.0.0.0 freeelectronicsonus.com +0.0.0.0 freeelectronicssource.com +0.0.0.0 freeentertainmentsource.com +0.0.0.0 freefoodprovider.com +0.0.0.0 freefoodsource.com +0.0.0.0 freefuelcard.com +0.0.0.0 freefuelcoupon.com +0.0.0.0 freegasonus.com +0.0.0.0 freegasprovider.com +0.0.0.0 free-gift-cards-now.com +0.0.0.0 freegiftcardsource.com +0.0.0.0 freegiftreward.com +0.0.0.0 free-gifts-comp.com +0.0.0.0 free.hotsocialz.com +0.0.0.0 freeipodnanouk.co.uk +0.0.0.0 freeipoduk.com +0.0.0.0 freeipoduk.co.uk +0.0.0.0 freelaptopgift.com +0.0.0.0 freelaptopnation.com +0.0.0.0 free-laptop-reward.com +0.0.0.0 freelaptopreward.com +0.0.0.0 freelaptopwebsites.com +0.0.0.0 freenation.com +0.0.0.0 freeoffers-toys.com +0.0.0.0 freepayasyougotopupuk.co.uk +0.0.0.0 freeplasmanation.com +0.0.0.0 freerestaurantprovider.com +0.0.0.0 freerestaurantsource.com +0.0.0.0 free-rewards.com-s.tv +0.0.0.0 freeshoppingprovider.com +0.0.0.0 freeshoppingsource.com +0.0.0.0 free.thesocialsexnetwork.com +0.0.0.0 freevideodownloadforpc.com +0.0.0.0 frontend-loadbalancer.meteorsolutions.com +0.0.0.0 fwdservice.com +0.0.0.0 fwmrm.net +0.0.0.0 g1.idg.pl +0.0.0.0 g2.gumgum.com +0.0.0.0 g3t4d5.madison.com +0.0.0.0 g4p.grt02.com +0.0.0.0 gadgeteer.pdamart.com +0.0.0.0 gam.adnxs.com +0.0.0.0 gameconsolerewards.com +0.0.0.0 games-toys-bonuspath.com +0.0.0.0 games-toys-free.com +0.0.0.0 games-toys-rewardpath.com +0.0.0.0 gate.hyperpaysys.com +0.0.0.0 gavzad.keenspot.com +0.0.0.0 gazeta.hit.gemius.pl +0.0.0.0 gazetteextra.advertserve.com +0.0.0.0 gbanners.hornymatches.com +0.0.0.0 gcads.osdn.com +0.0.0.0 gcdn.2mdn.net +0.0.0.0 gc.gcl.ru +0.0.0.0 gcir.gannett-tv.com +0.0.0.0 gcirm2.indystar.com +0.0.0.0 gcirm.argusleader.com +0.0.0.0 gcirm.argusleader.gcion.com +0.0.0.0 gcirm.battlecreekenquirer.com +0.0.0.0 gcirm.burlingtonfreepress.com +0.0.0.0 gcirm.centralohio.com +0.0.0.0 gcirm.centralohio.gcion.com +0.0.0.0 gcirm.cincinnati.com +0.0.0.0 gcirm.citizen-times.com +0.0.0.0 gcirm.clarionledger.com +0.0.0.0 gcirm.coloradoan.com +0.0.0.0 gcirm.courier-journal.com +0.0.0.0 gcirm.courierpostonline.com +0.0.0.0 gcirm.customcoupon.com +0.0.0.0 gcirm.dailyrecord.com +0.0.0.0 gcirm.delawareonline.com +0.0.0.0 gcirm.democratandchronicle.com +0.0.0.0 gcirm.desmoinesregister.com +0.0.0.0 gcirm.detnews.com +0.0.0.0 gcirm.dmp.gcion.com +0.0.0.0 gcirm.dmregister.com +0.0.0.0 gcirm.dnj.com +0.0.0.0 gcirm.flatoday.com +0.0.0.0 gcirm.gannettnetwork.com +0.0.0.0 gcirm.gannett-tv.com +0.0.0.0 gcirm.greatfallstribune.com +0.0.0.0 gcirm.greenvilleonline.com +0.0.0.0 gcirm.greenvilleonline.gcion.com +0.0.0.0 gcirm.honoluluadvertiser.gcion.com +0.0.0.0 gcirm.idahostatesman.com +0.0.0.0 gcirm.idehostatesman.com +0.0.0.0 gcirm.indystar.com +0.0.0.0 gcirm.injersey.com +0.0.0.0 gcirm.jacksonsun.com +0.0.0.0 gcirm.laregionalonline.com +0.0.0.0 gcirm.lsj.com +0.0.0.0 gcirm.montgomeryadvertiser.com +0.0.0.0 gcirm.muskogeephoenix.com +0.0.0.0 gcirm.newsleader.com +0.0.0.0 gcirm.news-press.com +0.0.0.0 gcirm.ozarksnow.com +0.0.0.0 gcirm.pensacolanewsjournal.com +0.0.0.0 gcirm.press-citizen.com +0.0.0.0 gcirm.pressconnects.com +0.0.0.0 gcirm.rgj.com +0.0.0.0 gcirm.sctimes.com +0.0.0.0 gcirm.stargazette.com +0.0.0.0 gcirm.statesmanjournal.com +0.0.0.0 gcirm.tallahassee.com +0.0.0.0 gcirm.tennessean.com +0.0.0.0 gcirm.thedailyjournal.com +0.0.0.0 gcirm.thedesertsun.com +0.0.0.0 gcirm.theithacajournal.com +0.0.0.0 gcirm.thejournalnews.com +0.0.0.0 gcirm.theolympian.com +0.0.0.0 gcirm.thespectrum.com +0.0.0.0 gcirm.tucson.com +0.0.0.0 gcirm.wisinfo.com +0.0.0.0 gde.adocean.pl +0.0.0.0 gdeee.hit.gemius.pl +0.0.0.0 gdelt.hit.gemius.pl +0.0.0.0 gdelv.hit.gemius.pl +0.0.0.0 gdyn.cnngo.com +0.0.0.0 gdyn.trutv.com +0.0.0.0 gemius.pl +0.0.0.0 geoads.osdn.com +0.0.0.0 geoloc11.geovisite.com +0.0.0.0 geo.precisionclick.com +0.0.0.0 getacool100.com +0.0.0.0 getacool500.com +0.0.0.0 getacoollaptop.com +0.0.0.0 getacooltv.com +0.0.0.0 getafreeiphone.org +0.0.0.0 getagiftonline.com +0.0.0.0 getmyfreebabystuff.com +0.0.0.0 getmyfreegear.com +0.0.0.0 getmyfreegiftcard.com +0.0.0.0 getmyfreelaptop.com +0.0.0.0 getmyfreelaptophere.com +0.0.0.0 getmyfreeplasma.com +0.0.0.0 getmylaptopfree.com +0.0.0.0 getmyplasmatv.com +0.0.0.0 getspecialgifts.com +0.0.0.0 getyour5kcredits0.blogspot.com +0.0.0.0 getyourfreecomputer.com +0.0.0.0 getyourfreetv.com +0.0.0.0 getyourgiftnow2.blogspot.com +0.0.0.0 getyourgiftnow3.blogspot.com +0.0.0.0 gg.adocean.pl +0.0.0.0 giftcardchallenge.com +0.0.0.0 giftcardsurveys.us.com +0.0.0.0 giftrewardzone.com +0.0.0.0 gifts-flowers-rewardpath.com +0.0.0.0 gimmethatreward.com +0.0.0.0 gingert.net +0.0.0.0 globalwebads.com +0.0.0.0 gmads.net +0.0.0.0 gm.preferences.com +0.0.0.0 go2.hit.gemius.pl +0.0.0.0 go.adee.bbelements.com +0.0.0.0 go.adlt.bbelements.com +0.0.0.0 go.adlv.bbelements.com +0.0.0.0 go.admulti.com +0.0.0.0 go.adnet.bbelements.com +0.0.0.0 go.arbo.bbelements.com +0.0.0.0 go.arbopl.bbelements.com +0.0.0.0 go.arboru.bbelements.com +0.0.0.0 go.bb007.bbelements.com +0.0.0.0 go.evolutionmedia.bbelements.com +0.0.0.0 go-free-gifts.com +0.0.0.0 gofreegifts.com +0.0.0.0 go.ihned.bbelements.com +0.0.0.0 go.intact.bbelements.com +0.0.0.0 go.lfstmedia.com +0.0.0.0 go.lotech.bbelements.com +0.0.0.0 goodsblock.marketgid.com +0.0.0.0 goody-garage.com +0.0.0.0 go.pl.bbelements.com +0.0.0.0 got2goshop.com +0.0.0.0 goto.trafficmultiplier.com +0.0.0.0 gozing.directtrack.com +0.0.0.0 grabbit-rabbit.com +0.0.0.0 graphics.adultfriendfinder.com +0.0.0.0 graphics.pop6.com +0.0.0.0 gratkapl.adocean.pl +0.0.0.0 gravitron.chron.com +0.0.0.0 greasypalm.com +0.0.0.0 grfx.mp3.com +0.0.0.0 groupon.pl +0.0.0.0 grz67.com +0.0.0.0 gs1.idsales.co.uk +0.0.0.0 gserv.cneteu.net +0.0.0.0 gspro.hit.gemius.pl +0.0.0.0 g.thinktarget.com +0.0.0.0 guiaconsumidor.com +0.0.0.0 guide2poker.com +0.0.0.0 guptamedianetwork.com +0.0.0.0 guru.sitescout.netdna-cdn.com +0.0.0.0 gwallet.com +0.0.0.0 gx-in-f109.1e100.net +0.0.0.0 h-afnetwww.adshuffle.com +0.0.0.0 halfords.ukrpts.net +0.0.0.0 happydiscountspecials.com +0.0.0.0 harvest176.adgardener.com +0.0.0.0 harvest284.adgardener.com +0.0.0.0 harvest285.adgardener.com +0.0.0.0 harvest.adgardener.com +0.0.0.0 hathor.eztonez.com +0.0.0.0 haynet.adbureau.net +0.0.0.0 hbads.eboz.com +0.0.0.0 hbadz.eboz.com +0.0.0.0 healthbeautyncs.com +0.0.0.0 health-beauty-rewardpath.com +0.0.0.0 health-beauty-savingblvd.com +0.0.0.0 healthclicks.co.uk +0.0.0.0 hebdotop.com +0.0.0.0 help.adtech.de +0.0.0.0 help.adtech.fr +0.0.0.0 help.adtech.us +0.0.0.0 helpint.mywebsearch.com +0.0.0.0 hightrafficads.com +0.0.0.0 himediads.com +0.0.0.0 hit4.hotlog.ru +0.0.0.0 hk.adserver.yahoo.com +0.0.0.0 hlcc.ca +0.0.0.0 holiday-gift-offers.com +0.0.0.0 holidayproductpromo.com +0.0.0.0 holidayshoppingrewards.com +0.0.0.0 home4bizstart.ru +0.0.0.0 homeelectronicproducts.com +0.0.0.0 home-garden-premiumblvd.com +0.0.0.0 home-garden-rewardempire.com +0.0.0.0 home-garden-rewardpath.com +0.0.0.0 homeimprovementonus.com +0.0.0.0 honolulu.app.ur.gcion.com +0.0.0.0 hooqy.com +0.0.0.0 host207.ewtn.com +0.0.0.0 hostedaje14.thruport.com +0.0.0.0 hosting.adjug.com +0.0.0.0 hot-daily-deal.com +0.0.0.0 hotgiftzone.com +0.0.0.0 hot-product-hangout.com +0.0.0.0 hpad.www.infoseek.co.jp +0.0.0.0 h.ppjol.com +0.0.0.0 htmlads.ru +0.0.0.0 html.centralmediaserver.com +0.0.0.0 htmlwww.youfck.com +0.0.0.0 http300.content.ru4.com +0.0.0.0 httpads.com +0.0.0.0 httpwwwadserver.com +0.0.0.0 hub.com.pl +0.0.0.0 huiwiw.hit.gemius.pl +0.0.0.0 huntingtonbank.tt.omtrdc.net +0.0.0.0 huomdgde.adocean.pl +0.0.0.0 hyperion.adtech.de +0.0.0.0 hyperion.adtech.fr +0.0.0.0 hyperion.adtech.us +0.0.0.0 i1.teaser-goods.ru +0.0.0.0 iacas.adbureau.net +0.0.0.0 iad.anm.co.uk +0.0.0.0 iadc.qwapi.com +#0.0.0.0 iadsdk.apple.com #may interfere with iTunes radio +0.0.0.0 ib.adnxs.com +0.0.0.0 ibis.lgappstv.com +0.0.0.0 i.blogads.com +0.0.0.0 i.casalemedia.com +0.0.0.0 icon.clickthru.net +0.0.0.0 id11938.luxup.ru +0.0.0.0 id5576.al21.luxup.ru +0.0.0.0 idearc.tt.omtrdc.net +0.0.0.0 idpix.media6degrees.com +0.0.0.0 ieee.adbureau.net +0.0.0.0 if.bbanner.it +0.0.0.0 iftarvakitleri.net +0.0.0.0 ih2.gamecopyworld.com +0.0.0.0 i.hotkeys.com +0.0.0.0 i.interia.pl +0.0.0.0 i.laih.com +0.0.0.0 ilinks.industrybrains.com +0.0.0.0 im.adtech.de +0.0.0.0 image2.pubmatic.com +0.0.0.0 imageads.canoe.ca +0.0.0.0 imagec08.247realmedia.com +0.0.0.0 imagec12.247realmedia.com +0.0.0.0 imagec14.247realmedia.com +0.0.0.0 imagecache2.allposters.com +0.0.0.0 imageceu1.247realmedia.com +0.0.0.0 image.click.livedoor.com +0.0.0.0 image.i1img.com +0.0.0.0 image.linkexchange.com +0.0.0.0 images2.laih.com +0.0.0.0 images3.linkwithin.com +0.0.0.0 images.ads.fairfax.com.au +0.0.0.0 images.blogads.com +0.0.0.0 images.bluetime.com +0.0.0.0 images-cdn.azoogleads.com +0.0.0.0 images.clickfinders.com +0.0.0.0 images.conduit-banners.com +0.0.0.0 images.cybereps.com +0.0.0.0 images.directtrack.com +0.0.0.0 images.emapadserver.com +0.0.0.0 imageserv.adtech.de +0.0.0.0 imageserv.adtech.fr +0.0.0.0 imageserv.adtech.us +0.0.0.0 imageserver1.thruport.com +0.0.0.0 images.jambocast.com +0.0.0.0 images.linkwithin.com +0.0.0.0 images.mbuyu.nl +0.0.0.0 images.netcomvad.com +0.0.0.0 images.newsx.cc +0.0.0.0 images.people2people.com +0.0.0.0 images.primaryads.com +0.0.0.0 images.sexlist.com +0.0.0.0 images.steamray.com +0.0.0.0 images.trafficmp.com +0.0.0.0 im.banner.t-online.de +0.0.0.0 i.media.cz +0.0.0.0 img0.ru.redtram.com +0.0.0.0 img1.ru.redtram.com +0.0.0.0 img2.ru.redtram.com +0.0.0.0 img4.cdn.adjuggler.com +0.0.0.0 img-a2.ak.imagevz.net +0.0.0.0 img.blogads.com +0.0.0.0 img-cdn.mediaplex.com +0.0.0.0 img.directtrack.com +0.0.0.0 imgg.dt00.net +0.0.0.0 imgg.marketgid.com +0.0.0.0 img.layer-ads.de +0.0.0.0 img.marketgid.com +0.0.0.0 imgn.dt00.net +0.0.0.0 imgn.dt07.com +0.0.0.0 imgn.marketgid.com +0.0.0.0 imgserv.adbutler.com +0.0.0.0 img.sn00.net +0.0.0.0 img.soulmate.com +0.0.0.0 img.xnxx.com +0.0.0.0 im.of.pl +0.0.0.0 impact.cossette-webpact.com +0.0.0.0 impbe.tradedoubler.com +0.0.0.0 imp.partner2profit.com +0.0.0.0 imppl.tradedoubler.com +0.0.0.0 impressionaffiliate.com +0.0.0.0 impressionaffiliate.mobi +0.0.0.0 impressionlead.com +0.0.0.0 impressionperformance.biz +0.0.0.0 imserv001.adtech.de +0.0.0.0 imserv001.adtech.fr +0.0.0.0 imserv001.adtech.us +0.0.0.0 imserv002.adtech.de +0.0.0.0 imserv002.adtech.fr +0.0.0.0 imserv002.adtech.us +0.0.0.0 imserv003.adtech.de +0.0.0.0 imserv003.adtech.fr +0.0.0.0 imserv003.adtech.us +0.0.0.0 imserv004.adtech.de +0.0.0.0 imserv004.adtech.fr +0.0.0.0 imserv004.adtech.us +0.0.0.0 imserv005.adtech.de +0.0.0.0 imserv005.adtech.fr +0.0.0.0 imserv005.adtech.us +0.0.0.0 imserv006.adtech.de +0.0.0.0 imserv006.adtech.fr +0.0.0.0 imserv006.adtech.us +0.0.0.0 imserv00x.adtech.de +0.0.0.0 imserv00x.adtech.fr +0.0.0.0 imserv00x.adtech.us +0.0.0.0 imssl01.adtech.de +0.0.0.0 imssl01.adtech.fr +0.0.0.0 imssl01.adtech.us +0.0.0.0 im.xo.pl +0.0.0.0 in.adserver.yahoo.com +0.0.0.0 incentivegateway.com +0.0.0.0 incentiverewardcenter.com +0.0.0.0 incentive-scene.com +0.0.0.0 indexhu.adocean.pl +0.0.0.0 infinite-ads.com +0.0.0.0 inklineglobal.com +0.0.0.0 inl.adbureau.net +0.0.0.0 input.insights.gravity.com +0.0.0.0 insightxe.pittsburghlive.com +0.0.0.0 insightxe.vtsgonline.com +0.0.0.0 ins-offer.com +0.0.0.0 installer.zutrack.com +0.0.0.0 insurance-rewardpath.com +0.0.0.0 intela.com +0.0.0.0 intelliads.com +0.0.0.0 internet.billboard.cz +0.0.0.0 intnet-offer.com +0.0.0.0 intrack.pl +0.0.0.0 invitefashion.com +0.0.0.0 ipacc1.adtech.de +0.0.0.0 ipacc1.adtech.fr +0.0.0.0 ipacc1.adtech.us +0.0.0.0 ipad2free4u.com +0.0.0.0 i.pcp001.com +0.0.0.0 ipdata.adtech.de +0.0.0.0 ipdata.adtech.fr +0.0.0.0 ipdata.adtech.us +0.0.0.0 iq001.adtech.de +0.0.0.0 iq001.adtech.fr +0.0.0.0 iq001.adtech.us +0.0.0.0 i.qitrck.com +0.0.0.0 is.casalemedia.com +0.0.0.0 i.securecontactinfo.com +0.0.0.0 isg01.casalemedia.com +0.0.0.0 isg02.casalemedia.com +0.0.0.0 isg03.casalemedia.com +0.0.0.0 isg04.casalemedia.com +0.0.0.0 isg05.casalemedia.com +0.0.0.0 isg06.casalemedia.com +0.0.0.0 isg07.casalemedia.com +0.0.0.0 isg08.casalemedia.com +0.0.0.0 isg09.casalemedia.com +0.0.0.0 i.simpli.fi +0.0.0.0 it.adserver.yahoo.com +0.0.0.0 i.total-media.net +0.0.0.0 itrackerpro.com +0.0.0.0 i.trkjmp.com +0.0.0.0 itsfree123.com +0.0.0.0 itxt.vibrantmedia.com +0.0.0.0 iwantmyfreecash.com +0.0.0.0 iwantmy-freelaptop.com +0.0.0.0 iwantmyfree-laptop.com +0.0.0.0 iwantmyfreelaptop.com +0.0.0.0 iwantmygiftcard.com +0.0.0.0 jambocast.com +0.0.0.0 jb9clfifs6.s.ad6media.fr +0.0.0.0 jcarter.spinbox.net +0.0.0.0 j.clickdensity.com +0.0.0.0 jcrew.tt.omtrdc.net +0.0.0.0 jersey-offer.com +0.0.0.0 jgedads.cjt.net +0.0.0.0 jh.revolvermaps.com +0.0.0.0 jivox.com +0.0.0.0 jl29jd25sm24mc29.com +0.0.0.0 jlinks.industrybrains.com +0.0.0.0 jmn.jangonetwork.com +0.0.0.0 join1.winhundred.com +0.0.0.0 js1.bloggerads.net +0.0.0.0 js77.neodatagroup.com +0.0.0.0 js.adlink.net +0.0.0.0 js.admngr.com +0.0.0.0 js.adscale.de +0.0.0.0 js.adserverpub.com +0.0.0.0 js.adsonar.com +0.0.0.0 jsc.dt07.net +0.0.0.0 js.goods.redtram.com +0.0.0.0 js.himediads.com +0.0.0.0 js.hotkeys.com +0.0.0.0 jsn.dt07.net +0.0.0.0 js.ru.redtram.com +0.0.0.0 js.selectornews.com +0.0.0.0 js.smi2.ru +0.0.0.0 js.tongji.linezing.com +0.0.0.0 js.zevents.com +0.0.0.0 judo.salon.com +0.0.0.0 juggler.inetinteractive.com +0.0.0.0 justwebads.com +0.0.0.0 jxliu.com +0.0.0.0 k5ads.osdn.com +0.0.0.0 kaartenhuis.nl.site-id.nl +0.0.0.0 kansas.valueclick.com +0.0.0.0 katu.adbureau.net +0.0.0.0 kazaa.adserver.co.il +0.0.0.0 kermit.macnn.com +0.0.0.0 kestrel.ospreymedialp.com +0.0.0.0 keys.dmtracker.com +0.0.0.0 keywordblocks.com +0.0.0.0 keywords.adtlgc.com +0.0.0.0 kitaramarketplace.com +0.0.0.0 kitaramedia.com +0.0.0.0 kitaratrk.com +0.0.0.0 kithrup.matchlogic.com +0.0.0.0 kixer.com +0.0.0.0 klikk.linkpulse.com +0.0.0.0 klikmoney.net +0.0.0.0 kliksaya.com +0.0.0.0 klipads.dvlabs.com +0.0.0.0 klipmart.dvlabs.com +0.0.0.0 klipmart.forbes.com +0.0.0.0 kmdl101.com +0.0.0.0 knc.lv +0.0.0.0 knight.economist.com +0.0.0.0 kona2.kontera.com +0.0.0.0 kona3.kontera.com +0.0.0.0 kona4.kontera.com +0.0.0.0 kona5.kontera.com +0.0.0.0 kona6.kontera.com +0.0.0.0 kona7.kontera.com +0.0.0.0 kona8.kontera.com +0.0.0.0 kona.kontera.com +0.0.0.0 kontera.com +0.0.0.0 kreaffiliation.com +0.0.0.0 kropka.onet.pl +0.0.0.0 kuhdi.com +0.0.0.0 l.5min.com +0.0.0.0 ladyclicks.ru +0.0.0.0 lanzar.publicidadweb.com +0.0.0.0 laptopreportcard.com +0.0.0.0 laptoprewards.com +0.0.0.0 laptoprewardsgroup.com +0.0.0.0 laptoprewardszone.com +0.0.0.0 larivieracasino.com +0.0.0.0 lasthr.info +0.0.0.0 lastmeasure.zoy.org +0.0.0.0 launch.adserver.yahoo.com +0.0.0.0 layer-ads.de +0.0.0.0 lb-adserver.ig.com.br +0.0.0.0 ld1.criteo.com +0.0.0.0 ld2.criteo.com +0.0.0.0 ldglob01.adtech.de +0.0.0.0 ldglob01.adtech.fr +0.0.0.0 ldglob01.adtech.us +0.0.0.0 ldglob02.adtech.de +0.0.0.0 ldglob02.adtech.fr +0.0.0.0 ldglob02.adtech.us +0.0.0.0 ldimage01.adtech.de +0.0.0.0 ldimage01.adtech.fr +0.0.0.0 ldimage01.adtech.us +0.0.0.0 ldimage02.adtech.de +0.0.0.0 ldimage02.adtech.fr +0.0.0.0 ldimage02.adtech.us +0.0.0.0 ldserv01.adtech.de +0.0.0.0 ldserv01.adtech.fr +0.0.0.0 ldserv01.adtech.us +0.0.0.0 ldserv02.adtech.de +0.0.0.0 ldserv02.adtech.fr +0.0.0.0 ldserv02.adtech.us +0.0.0.0 le1er.net +0.0.0.0 leadback.advertising.com +0.0.0.0 leader.linkexchange.com +0.0.0.0 lead.program3.com +0.0.0.0 leadsynaptic.go2jump.org +0.0.0.0 learning-offer.com +0.0.0.0 legal-rewardpath.com +0.0.0.0 leisure-offer.com +0.0.0.0 lg.brandreachsys.com +0.0.0.0 liberty.gedads.com +0.0.0.0 link2me.ru +0.0.0.0 link4ads.com +0.0.0.0 linktracker.angelfire.com +0.0.0.0 linuxpark.adtech.de +0.0.0.0 linuxpark.adtech.fr +0.0.0.0 linuxpark.adtech.us +0.0.0.0 liquidad.narrowcastmedia.com +0.0.0.0 live-cams-1.livejasmin.com +0.0.0.0 livingnet.adtech.de +0.0.0.0 ll.atdmt.com +0.0.0.0 l.linkpulse.com +0.0.0.0 lnads.osdn.com +0.0.0.0 load.exelator.com +0.0.0.0 load.focalex.com +0.0.0.0 loading321.com +0.0.0.0 loadm.exelator.com +0.0.0.0 local.promoisland.net +0.0.0.0 logc252.xiti.com +0.0.0.0 log.feedjit.com +0.0.0.0 login.linkpulse.com +0.0.0.0 log.olark.com +0.0.0.0 looksmartcollect.247realmedia.com +0.0.0.0 louisvil.app.ur.gcion.com +0.0.0.0 louisvil.ur.gcion.com +0.0.0.0 lp1.linkpulse.com +0.0.0.0 lp4.linkpulse.com +0.0.0.0 lpcloudsvr405.com +0.0.0.0 lstats.qip.ru +0.0.0.0 lt.andomedia.com +0.0.0.0 lt.angelfire.com +0.0.0.0 lucky-day-uk.com +0.0.0.0 luxup.ru +0.0.0.0 lw1.gamecopyworld.com +0.0.0.0 lw2.gamecopyworld.com +0.0.0.0 lycos.247realmedia.com +0.0.0.0 l.yieldmanager.net +0.0.0.0 m1.emea.2mdn.net.edgesuite.net +0.0.0.0 m2.sexgarantie.nl +0.0.0.0 m3.2mdn.net +0.0.0.0 macaddictads.snv.futurenet.com +0.0.0.0 macads.net +0.0.0.0 mackeeperapp1.zeobit.com +0.0.0.0 mad2.brandreachsys.com +0.0.0.0 m.adbridge.de +0.0.0.0 mads.aol.com +0.0.0.0 mads.cnet.com +0.0.0.0 mail.radar.imgsmail.ru +0.0.0.0 manage001.adtech.de +0.0.0.0 manage001.adtech.fr +0.0.0.0 manage001.adtech.us +0.0.0.0 manager.rovion.com +0.0.0.0 manuel.theonion.com +0.0.0.0 marketgid.com +0.0.0.0 marketing.888.com +0.0.0.0 marketing-rewardpath.com +0.0.0.0 marriottinternationa.tt.omtrdc.net +0.0.0.0 mastertracks.be +0.0.0.0 matomy.adk2.co +0.0.0.0 matrix.mediavantage.de +0.0.0.0 maxadserver.corusradionetwork.com +0.0.0.0 maxads.ruralpress.com +0.0.0.0 maxbounty.com +0.0.0.0 maximumpcads.imaginemedia.com +0.0.0.0 maxmedia.sgaonline.com +0.0.0.0 maxserving.com +0.0.0.0 mb01.com +0.0.0.0 mbox2.offermatica.com +0.0.0.0 mbox9.offermatica.com +0.0.0.0 mds.centrport.net +0.0.0.0 media2021.videostrip.com +0.0.0.0 media2.adshuffle.com +0.0.0.0 media2.legacy.com +0.0.0.0 media2.travelzoo.com +0.0.0.0 media4021.videostrip.com #http://media4021.videostrip.com/dev8/0/000/449/0000449408.mp4 +0.0.0.0 media5021.videostrip.com #http://media5021.videostrip.com/dev14/0/000/363/0000363146.mp4 +0.0.0.0 media6021.videostrip.com +0.0.0.0 media6.sitebrand.com +0.0.0.0 media.888.com +0.0.0.0 media.adcentriconline.com +0.0.0.0 media.adrcdn.com +0.0.0.0 media.adrevolver.com +0.0.0.0 media.adrime.com +0.0.0.0 media.adshadow.net +0.0.0.0 media.b.lead.program3.com +0.0.0.0 media.bonnint.net +0.0.0.0 mediacharger.com +0.0.0.0 media.contextweb.com +0.0.0.0 media.elb-kind.de +0.0.0.0 media.espace-plus.net +0.0.0.0 media.fairlink.ru +0.0.0.0 mediafr.247realmedia.com +0.0.0.0 media.funpic.de +0.0.0.0 medialand.relax.ru +0.0.0.0 media.markethealth.com +0.0.0.0 media.naked.com +0.0.0.0 media.nk-net.pl +0.0.0.0 media.ontarionorth.com +0.0.0.0 media.popuptraffic.com +0.0.0.0 mediapst.adbureau.net +0.0.0.0 mediapst-images.adbureau.net +0.0.0.0 mediative.ca +0.0.0.0 mediative.com +0.0.0.0 media.trafficfactory.biz +0.0.0.0 media.trafficjunky.net +0.0.0.0 mediauk.247realmedia.com +0.0.0.0 media.ventivmedia.com +0.0.0.0 media.viwii.net +0.0.0.0 medical-offer.com +0.0.0.0 medical-rewardpath.com +0.0.0.0 medleyads.com +0.0.0.0 medrx.sensis.com.au +0.0.0.0 megapanel.gem.pl +0.0.0.0 mercury.bravenet.com +0.0.0.0 messagent.duvalguillaume.com +0.0.0.0 messagia.adcentric.proximi-t.com +0.0.0.0 meter-svc.nytimes.com +0.0.0.0 metrics.natmags.co.uk +0.0.0.0 metrics.sfr.fr +0.0.0.0 metrics.target.com +0.0.0.0 m.fr.a2dfp.net +0.0.0.0 m.friendlyduck.com +0.0.0.0 mf.sitescout.com +0.0.0.0 mg.dt00.net +0.0.0.0 mgid.com +0.0.0.0 mhlnk.com +0.0.0.0 mi.adinterax.com +0.0.0.0 microsof.wemfbox.ch +0.0.0.0 mightymagoo.com +0.0.0.0 mii-image.adjuggler.com +0.0.0.0 mini.videostrip.com +0.0.0.0 mirror.pointroll.com +0.0.0.0 mjxads.internet.com +0.0.0.0 mjx.ads.nwsource.com +0.0.0.0 mklik.gazeta.pl +0.0.0.0 mktg-offer.com +0.0.0.0 mlntracker.com +0.0.0.0 mm.admob.com +0.0.0.0 mm.chitika.net +0.0.0.0 mob.adwhirl.com +0.0.0.0 mobileads.msn.com +0.0.0.0 mobile.juicyads.com +0.0.0.0 mobularity.com +0.0.0.0 mochibot.com +0.0.0.0 mojofarm.mediaplex.com +0.0.0.0 moneyraid.com +0.0.0.0 monstersandcritics.advertserve.com +0.0.0.0 morefreecamsecrets.com +0.0.0.0 morevisits.info +0.0.0.0 motd.pinion.gg +0.0.0.0 movieads.imgs.sapo.pt +0.0.0.0 mp3playersource.com +0.0.0.0 mp.tscapeplay.com +0.0.0.0 msn.allyes.com +0.0.0.0 msnbe-hp.metriweb.be +0.0.0.0 msn-cdn.effectivemeasure.net +0.0.0.0 msn.oewabox.at +0.0.0.0 msn.tns-cs.net +0.0.0.0 msn.uvwbox.de +0.0.0.0 msn.wrating.com +0.0.0.0 mt58.mtree.com +0.0.0.0 m.tribalfusion.com +0.0.0.0 mu-in-f167.1e100.net +0.0.0.0 multi.xnxx.com +0.0.0.0 mvonline.com +0.0.0.0 mx.adserver.yahoo.com +0.0.0.0 myao.adocean.pl +0.0.0.0 my.blueadvertise.com +0.0.0.0 mycashback.co.uk +0.0.0.0 mycelloffer.com +0.0.0.0 mychoicerewards.com +0.0.0.0 myexclusiverewards.com +0.0.0.0 myfreedinner.com +0.0.0.0 myfreegifts.co.uk +0.0.0.0 myfreemp3player.com +0.0.0.0 mygiftcardcenter.com +0.0.0.0 mygiftresource.com +0.0.0.0 mygreatrewards.com +0.0.0.0 myoffertracking.com +0.0.0.0 my-reward-channel.com +0.0.0.0 my-rewardsvault.com +0.0.0.0 myseostats.com +0.0.0.0 myusersonline.com +0.0.0.0 myyearbookdigital.checkm8.com +0.0.0.0 n4g.us.intellitxt.com +0.0.0.0 n4p.ru.redtram.com +0.0.0.0 nationalissuepanel.com +0.0.0.0 nationalpost.adperfect.com +0.0.0.0 nationalsurveypanel.com +0.0.0.0 nbads.com +0.0.0.0 nbc.adbureau.net +0.0.0.0 nbimg.dt00.net +0.0.0.0 nb.netbreak.com.au +0.0.0.0 nc.ru.redtram.com +0.0.0.0 nctracking.com +0.0.0.0 nd1.gamecopyworld.com +0.0.0.0 nearbyad.com +0.0.0.0 needadvertising.com +0.0.0.0 netads.hotwired.com +0.0.0.0 netadsrv.iworld.com +0.0.0.0 netads.sohu.com +0.0.0.0 netcomm.spinbox.net +0.0.0.0 netpalnow.com +0.0.0.0 netshelter.adtrix.com +0.0.0.0 netspiderads2.indiatimes.com +0.0.0.0 netsponsors.com +0.0.0.0 networkads.net +0.0.0.0 network-ca.247realmedia.com +0.0.0.0 network.realmedia.com +0.0.0.0 network.realtechnetwork.net +0.0.0.0 newads.cmpnet.com +0.0.0.0 newadserver.interfree.it +0.0.0.0 new-ads.eurogamer.net +0.0.0.0 newbs.hutz.co.il +0.0.0.0 news6health.com +0.0.0.0 newsblock.marketgid.com +0.0.0.0 new.smartcontext.pl +0.0.0.0 newssourceoftoday.com #security risk/fake news# +0.0.0.0 newt1.adultadworld.com +0.0.0.0 newt1.adultworld.com +0.0.0.0 ng3.ads.warnerbros.com +0.0.0.0 ngads.smartage.com +0.0.0.0 nitrous.exitfuel.com +0.0.0.0 nitrous.internetfuel.com +0.0.0.0 nivendas.net +0.0.0.0 nkcache.brandreachsys.com +0.0.0.0 nl.adserver.yahoo.com +0.0.0.0 no.adserver.yahoo.com +0.0.0.0 nospartenaires.com +0.0.0.0 nothing-but-value.com +0.0.0.0 novafinanza.com +0.0.0.0 novem.onet.pl +0.0.0.0 nrads.1host.co.il +0.0.0.0 nrkno.linkpulse.com +0.0.0.0 ns1.lalibco.com +0.0.0.0 ns1.primeinteractive.net +0.0.0.0 ns2.hitbox.com +0.0.0.0 ns2.lalibco.com +0.0.0.0 ns2.primeinteractive.net +0.0.0.0 nsads4.us.publicus.com +0.0.0.0 nsads.hotwired.com +0.0.0.0 nsads.us.publicus.com +0.0.0.0 nspmotion.com +0.0.0.0 ns-vip1.hitbox.com +0.0.0.0 ns-vip2.hitbox.com +0.0.0.0 ns-vip3.hitbox.com +0.0.0.0 ntbanner.digitalriver.com +0.0.0.0 nx-adv0005.247realmedia.com +0.0.0.0 nxs.kidcolez.cn +0.0.0.0 nxtscrn.adbureau.net +0.0.0.0 nysubwayoffer.com +0.0.0.0 nytadvertising.nytimes.com +0.0.0.0 o0.winfuture.de +0.0.0.0 o1.qnsr.com +0.0.0.0 o2.eyereturn.com +0.0.0.0 oads.cracked.com +0.0.0.0 oamsrhads.us.publicus.com +0.0.0.0 oas-1.rmuk.co.uk +0.0.0.0 oasads.whitepages.com +0.0.0.0 oasc02023.247realmedia.com +0.0.0.0 oasc02.247realmedia.com +0.0.0.0 oasc03.247realmedia.com +0.0.0.0 oasc04.247.realmedia.com +0.0.0.0 oasc05050.247realmedia.com +0.0.0.0 oasc05.247realmedia.com +0.0.0.0 oasc16.247realmedia.com +0.0.0.0 oascenral.phoenixnewtimes.com +0.0.0.0 oascentral.videodome.com +0.0.0.0 oas.dn.se +0.0.0.0 oas-eu.247realmedia.com +0.0.0.0 oas.heise.de +0.0.0.0 oasis2.advfn.com +0.0.0.0 oasis.411affiliates.ca +0.0.0.0 oasis.nysun.com +0.0.0.0 oasis.promon.cz +0.0.0.0 oasis.realbeer.com +0.0.0.0 oasis.zmh.zope.com +0.0.0.0 oasis.zmh.zope.net +0.0.0.0 oasn03.247realmedia.com +0.0.0.0 oassis.zmh.zope.com +0.0.0.0 objects.abcvisiteurs.com +0.0.0.0 objects.designbloxlive.com +0.0.0.0 obozua.adocean.pl +0.0.0.0 observer.advertserve.com +0.0.0.0 obs.nnm2.ru +0.0.0.0 offers.impower.com +0.0.0.0 offerx.co.uk +0.0.0.0 oinadserve.com +0.0.0.0 old-darkroast.adknowledge.com +0.0.0.0 ometrics.warnerbros.com +0.0.0.0 onclickads.net +0.0.0.0 online1.webcams.com +0.0.0.0 onlineads.magicvalley.com +0.0.0.0 onlinebestoffers.net +0.0.0.0 onocollect.247realmedia.com +0.0.0.0 open.4info.net +0.0.0.0 openadext.tf1.fr +0.0.0.0 openad.infobel.com +0.0.0.0 openads.dimcab.com +0.0.0.0 openads.friendfinder.com +0.0.0.0 openads.nightlifemagazine.ca +0.0.0.0 openads.smithmag.net +0.0.0.0 openads.zeads.com +0.0.0.0 openad.travelnow.com +0.0.0.0 opentable.tt.omtrdc.net +0.0.0.0 openx2.fotoflexer.com +0.0.0.0 openx.adfactor.nl +0.0.0.0 openx.coolconcepts.nl +0.0.0.0 openx.shinyads.com +0.0.0.0 openxxx.viragemedia.com +0.0.0.0 optimized-by.rubiconproject.com +0.0.0.0 optimized.by.vitalads.net +0.0.0.0 optimize.indieclick.com +0.0.0.0 optimzedby.rmxads.com +0.0.0.0 orange.weborama.fr +0.0.0.0 ordie.adbureau.net +0.0.0.0 origin.chron.com +0.0.0.0 out.popads.net +0.0.0.0 overflow.adsoftware.com +0.0.0.0 overlay.ringtonematcher.com +0.0.0.0 overstock.tt.omtrdc.net +0.0.0.0 ox-d.hbr.org +0.0.0.0 ox-d.hulkshare.com +0.0.0.0 ox-d.hypeads.org +0.0.0.0 ox-d.zenoviagroup.com +0.0.0.0 ox.eurogamer.net +0.0.0.0 ox-i.zenoviagroup.com +0.0.0.0 ozonemedia.adbureau.net +0.0.0.0 oz.valueclick.com +0.0.0.0 oz.valueclick.ne.jp +0.0.0.0 p0rnuha.com +0.0.0.0 p1.adhitzads.com +0.0.0.0 pagead1.googlesyndication.com +0.0.0.0 pagead2.googlesyndication.com +0.0.0.0 pagead3.googlesyndication.com +0.0.0.0 pagead.googlesyndication.com +0.0.0.0 pages.etology.com +0.0.0.0 paime.com +0.0.0.0 panel.adtify.pl +0.0.0.0 paperg.com +0.0.0.0 partner01.oingo.com +0.0.0.0 partner02.oingo.com +0.0.0.0 partner03.oingo.com +0.0.0.0 partner.ah-ha.com +0.0.0.0 partner.ceneo.pl +0.0.0.0 partner.join.com.ua +0.0.0.0 partner.magna.ru +0.0.0.0 partner.pobieraczek.pl +0.0.0.0 partners.sprintrade.com +0.0.0.0 partners.webmasterplan.com +0.0.0.0 partner.wapacz.pl +0.0.0.0 partner.wapster.pl +0.0.0.0 pathforpoints.com +0.0.0.0 paulsnetwork.com +0.0.0.0 pbid.pro-market.net +0.0.0.0 pb.tynt.com +0.0.0.0 pcads.ru +0.0.0.0 pei-ads.playboy.com +0.0.0.0 people-choice-sites.com +0.0.0.0 personalcare-offer.com +0.0.0.0 personalcashbailout.com +0.0.0.0 pg2.solution.weborama.fr +0.0.0.0 ph-ad01.focalink.com +0.0.0.0 ph-ad02.focalink.com +0.0.0.0 ph-ad03.focalink.com +0.0.0.0 ph-ad04.focalink.com +0.0.0.0 ph-ad05.focalink.com +0.0.0.0 ph-ad06.focalink.com +0.0.0.0 ph-ad07.focalink.com +0.0.0.0 ph-ad08.focalink.com +0.0.0.0 ph-ad09.focalink.com +0.0.0.0 ph-ad10.focalink.com +0.0.0.0 ph-ad11.focalink.com +0.0.0.0 ph-ad12.focalink.com +0.0.0.0 ph-ad13.focalink.com +0.0.0.0 ph-ad14.focalink.com +0.0.0.0 ph-ad15.focalink.com +0.0.0.0 ph-ad16.focalink.com +0.0.0.0 ph-ad17.focalink.com +0.0.0.0 ph-ad18.focalink.com +0.0.0.0 ph-ad19.focalink.com +0.0.0.0 ph-ad20.focalink.com +0.0.0.0 ph-ad21.focalink.com +0.0.0.0 ph-cdn.effectivemeasure.net +0.0.0.0 phoenixads.co.in +0.0.0.0 photobucket.adnxs.com +0.0.0.0 photos0.pop6.com +0.0.0.0 photos1.pop6.com +0.0.0.0 photos2.pop6.com +0.0.0.0 photos3.pop6.com +0.0.0.0 photos4.pop6.com +0.0.0.0 photos5.pop6.com +0.0.0.0 photos6.pop6.com +0.0.0.0 photos7.pop6.com +0.0.0.0 photos8.pop6.com +0.0.0.0 photos.daily-deals.analoganalytics.com +0.0.0.0 photos.pop6.com +0.0.0.0 phpads.astalavista.us +0.0.0.0 phpads.cnpapers.com +0.0.0.0 phpads.flipcorp.com +0.0.0.0 phpads.foundrymusic.com +0.0.0.0 phpads.i-merge.net +0.0.0.0 phpads.macbidouille.com +0.0.0.0 phpadsnew.gamefolk.de +0.0.0.0 phpadsnew.wn.com +0.0.0.0 php.fark.com +0.0.0.0 pick-savings.com +0.0.0.0 p.ic.tynt.com +0.0.0.0 pink.habralab.ru +0.0.0.0 pix01.revsci.net +0.0.0.0 pix521.adtech.de +0.0.0.0 pix521.adtech.fr +0.0.0.0 pix521.adtech.us +0.0.0.0 pix522.adtech.de +0.0.0.0 pix522.adtech.fr +0.0.0.0 pix522.adtech.us +0.0.0.0 pixel.everesttech.net +0.0.0.0 pixel.mathtag.com +0.0.0.0 pixel.quantserve.com +0.0.0.0 pixel.sitescout.com +0.0.0.0 plasmatv4free.com +0.0.0.0 plasmatvreward.com +0.0.0.0 playlink.pl +0.0.0.0 playtime.tubemogul.com +0.0.0.0 pl.bbelements.com +0.0.0.0 pmstrk.mercadolivre.com.br +0.0.0.0 pntm.adbureau.net +0.0.0.0 pntm-images.adbureau.net +0.0.0.0 pol.bbelements.com +0.0.0.0 politicalopinionsurvey.com +0.0.0.0 pool.pebblemedia.adhese.com +0.0.0.0 popadscdn.net +0.0.0.0 popclick.net +0.0.0.0 poponclick.com +0.0.0.0 popunder.adsrevenue.net +0.0.0.0 popunder.paypopup.com +0.0.0.0 popupclick.ru +0.0.0.0 popupdomination.com +0.0.0.0 popup.matchmaker.com +0.0.0.0 popups.ad-logics.com +0.0.0.0 popups.infostart.com +0.0.0.0 postmasterdirect.com +0.0.0.0 post.rmbn.ru +0.0.0.0 pp.free.fr +0.0.0.0 p.profistats.net +0.0.0.0 p.publico.es +0.0.0.0 premium.ascensionweb.com +0.0.0.0 premiumholidayoffers.com +0.0.0.0 premiumproductsonline.com +0.0.0.0 premium-reward-club.com +0.0.0.0 prexyone.appspot.com +0.0.0.0 primetime.ad.primetime.net +0.0.0.0 privitize.com +0.0.0.0 prizes.co.uk +0.0.0.0 productopinionpanel.com +0.0.0.0 productresearchpanel.com +0.0.0.0 producttestpanel.com +0.0.0.0 profile.uproxx.com +0.0.0.0 promo.awempire.com +0.0.0.0 promo.easy-dating.org +0.0.0.0 promos.fling.com +0.0.0.0 promote-bz.net +0.0.0.0 promotion.partnercash.com +0.0.0.0 proximityads.flipcorp.com +0.0.0.0 proxy.blogads.com +0.0.0.0 ptrads.mp3.com +0.0.0.0 pubdirecte.com +0.0.0.0 pubimgs.sapo.pt +0.0.0.0 publiads.com +0.0.0.0 publicidades.redtotalonline.com +0.0.0.0 publicis.adcentriconline.com +0.0.0.0 publish.bonzaii.no +0.0.0.0 publishers.adscholar.com +0.0.0.0 publishers.bidtraffic.com +0.0.0.0 publishers.brokertraffic.com +0.0.0.0 publishing.kalooga.com +0.0.0.0 pub.sapo.pt +0.0.0.0 pubshop.img.uol.com.br +0.0.0.0 purgecolon.net +0.0.0.0 px10.net +0.0.0.0 q.azcentral.com +0.0.0.0 q.b.h.cltomedia.info +0.0.0.0 qip.magna.ru +0.0.0.0 qitrck.com +0.0.0.0 quickbrowsersearch.com +0.0.0.0 r1-ads.ace.advertising.com +0.0.0.0 r.ace.advertising.com +0.0.0.0 radaronline.advertserve.com +0.0.0.0 r.admob.com +0.0.0.0 rad.msn.com +0.0.0.0 rads.stackoverflow.com +0.0.0.0 ravel-rewardpath.com +0.0.0.0 rb.burstway.com +0.0.0.0 rb.newsru.com +0.0.0.0 rbqip.pochta.ru +0.0.0.0 rc.asci.freenet.de +0.0.0.0 rc.bt.ilsemedia.nl +0.0.0.0 rccl.bridgetrack.com +0.0.0.0 rcdna.gwallet.com +0.0.0.0 r.chitika.net +0.0.0.0 rc.hotkeys.com +0.0.0.0 rcm-images.amazon.com +0.0.0.0 rcm-it.amazon.it +0.0.0.0 rc.rlcdn.com +0.0.0.0 rc.wl.webads.nl +0.0.0.0 realads.realmedia.com +0.0.0.0 realgfsbucks.com +0.0.0.0 realmedia-a800.d4p.net # Scientific American +0.0.0.0 realmedia.advance.net +0.0.0.0 recreation-leisure-rewardpath.com +0.0.0.0 red01.as-eu.falkag.net +0.0.0.0 red01.as-us.falkag.net +0.0.0.0 red02.as-eu.falkag.net +0.0.0.0 red02.as-us.falkag.net +0.0.0.0 red03.as-eu.falkag.net +0.0.0.0 red03.as-us.falkag.net +0.0.0.0 red04.as-eu.falkag.net +0.0.0.0 red04.as-us.falkag.net +0.0.0.0 red.as-eu.falkag.net +0.0.0.0 red.as-us.falkag.net +0.0.0.0 redherring.ngadcenter.net +0.0.0.0 redirect.click2net.com +0.0.0.0 redirect.hotkeys.com +0.0.0.0 reduxads.valuead.com +0.0.0.0 reg.coolsavings.com +0.0.0.0 regflow.com +0.0.0.0 regie.espace-plus.net +0.0.0.0 regio.adlink.de +0.0.0.0 reklama.onet.pl +0.0.0.0 reklamy.sfd.pl +0.0.0.0 re.kontera.com +0.0.0.0 rek.www.wp.pl +0.0.0.0 relestar.com +0.0.0.0 remotead.cnet.com +0.0.0.0 report02.adtech.de +0.0.0.0 report02.adtech.fr +0.0.0.0 report02.adtech.us +0.0.0.0 reporter001.adtech.de +0.0.0.0 reporter001.adtech.fr +0.0.0.0 reporter001.adtech.us +0.0.0.0 reporter.adtech.de +0.0.0.0 reporter.adtech.fr +0.0.0.0 reporter.adtech.us +0.0.0.0 reportimage.adtech.de +0.0.0.0 reportimage.adtech.fr +0.0.0.0 reportimage.adtech.us +0.0.0.0 resolvingserver.com +0.0.0.0 resources.infolinks.com +0.0.0.0 restaurantcom.tt.omtrdc.net +0.0.0.0 reverso.refr.adgtw.orangeads.fr +0.0.0.0 revsci.net +0.0.0.0 rewardblvd.com +0.0.0.0 rewardhotspot.com +0.0.0.0 rewardsflow.com +0.0.0.0 rhads.sv.publicus.com +0.0.0.0 rh.revolvermaps.com +0.0.0.0 richmedia.yimg.com +0.0.0.0 ridepush.com +0.0.0.0 ringtonepartner.com +0.0.0.0 rmbn.ru +0.0.0.0 rmedia.boston.com +0.0.0.0 rmm1u.checkm8.com +0.0.0.0 rms.admeta.com +0.0.0.0 ro.bbelements.com +0.0.0.0 romepartners.com +0.0.0.0 roosevelt.gjbig.com +0.0.0.0 rosettastone.tt.omtrdc.net +0.0.0.0 rotabanner100.utro.ru +0.0.0.0 rotabanner468.utro.ru +0.0.0.0 rotate.infowars.com +0.0.0.0 rotator.adjuggler.com +0.0.0.0 rotator.juggler.inetinteractive.com +0.0.0.0 rotobanner468.utro.ru +0.0.0.0 rovion.com +0.0.0.0 rpc.trafficfactory.biz +0.0.0.0 rp.hit.gemius.pl +0.0.0.0 r.reklama.biz +0.0.0.0 rscounter10.com +0.0.0.0 rsense-ad.realclick.co.kr +0.0.0.0 rss.buysellads.com +0.0.0.0 rt2.infolinks.com +0.0.0.0 rt3.infolinks.com +0.0.0.0 rtb.pclick.yahoo.com +0.0.0.0 rtb.tubemogul.com +0.0.0.0 rtr.innovid.com +0.0.0.0 rts.sparkstudios.com +0.0.0.0 r.turn.com +0.0.0.0 ru.bbelements.com +0.0.0.0 ru.redtram.com +0.0.0.0 russ-shalavy.ru +0.0.0.0 rv.adcpx.v1.de.eusem.adaos-ads.net +0.0.0.0 rya.rockyou.com +0.0.0.0 s0b.bluestreak.com +0.0.0.0 s1.buysellads.com +0.0.0.0 s1.cz.adocean.pl +0.0.0.0 s1.gratkapl.adocean.pl +0.0.0.0 s2.buysellads.com +0.0.0.0 s3.buysellads.com +0.0.0.0 s5.addthis.com +0.0.0.0 s7.addthis.com +0.0.0.0 s.admulti.com +0.0.0.0 sad.sharethis.com +0.0.0.0 safe.hyperpaysys.com +0.0.0.0 safenyplanet.in +0.0.0.0 salesforcecom.tt.omtrdc.net +0.0.0.0 s.amazon-adsystem.com +0.0.0.0 samsung3.solution.weborama.fr +0.0.0.0 s.as-us.falkag.net +0.0.0.0 sat-city-ads.com +0.0.0.0 s.atemda.com +0.0.0.0 saturn.tiser.com.au +0.0.0.0 save-plan.com +0.0.0.0 savings-specials.com +0.0.0.0 savings-time.com +0.0.0.0 s.boom.ro +0.0.0.0 schoorsteen.geenstijl.nl +0.0.0.0 schumacher.adtech.de +0.0.0.0 schumacher.adtech.fr +0.0.0.0 schumacher.adtech.us +0.0.0.0 schwab.tt.omtrdc.net +0.0.0.0 s.clicktale.net +0.0.0.0 scoremygift.com +0.0.0.0 screen-mates.com +0.0.0.0 script.banstex.com +0.0.0.0 script.crsspxl.com +0.0.0.0 scripts.verticalacuity.com +0.0.0.0 scr.kliksaya.com +0.0.0.0 s.di.com.pl +0.0.0.0 se.adserver.yahoo.com +0.0.0.0 search.addthis.com +0.0.0.0 search.freeonline.com +0.0.0.0 search.keywordblocks.com +0.0.0.0 search.netseer.com +0.0.0.0 searchportal.information.com +0.0.0.0 searchwe.com +0.0.0.0 seasonalsamplerspecials.com +0.0.0.0 sec.hit.gemius.pl +0.0.0.0 secimage.adtech.de +0.0.0.0 secimage.adtech.fr +0.0.0.0 secimage.adtech.us +0.0.0.0 secserv.adtech.de +0.0.0.0 secserv.adtech.fr +0.0.0.0 secserv.adtech.us +0.0.0.0 secure.ace-tag.advertising.com +0.0.0.0 secure.addthis.com +0.0.0.0 secureads.ft.com +0.0.0.0 secure.bidvertiserr.com +0.0.0.0 securecontactinfo.com +0.0.0.0 secure.gaug.es +0.0.0.0 secure.img-cdn.mediaplex.com +0.0.0.0 securerunner.com +0.0.0.0 secure.webconnect.net +0.0.0.0 seduction-zone.com +0.0.0.0 sel.as-eu.falkag.net +0.0.0.0 sel.as-us.falkag.net +0.0.0.0 select001.adtech.de +0.0.0.0 select001.adtech.fr +0.0.0.0 select001.adtech.us +0.0.0.0 select002.adtech.de +0.0.0.0 select002.adtech.fr +0.0.0.0 select002.adtech.us +0.0.0.0 select003.adtech.de +0.0.0.0 select003.adtech.fr +0.0.0.0 select003.adtech.us +0.0.0.0 select004.adtech.de +0.0.0.0 select004.adtech.fr +0.0.0.0 select004.adtech.us +0.0.0.0 sergarius.popunder.ru +0.0.0.0 serv2.ad-rotator.com +0.0.0.0 serv.ad-rotator.com +0.0.0.0 servads.aip.org +0.0.0.0 serv.adspeed.com +0.0.0.0 servedbyadbutler.com +0.0.0.0 servedby.adcombination.com +0.0.0.0 servedby.advertising.com +0.0.0.0 servedby.flashtalking.com +0.0.0.0 servedby.netshelter.net +0.0.0.0 servedby.precisionclick.com +0.0.0.0 serve.freegaypix.com +0.0.0.0 serve.popads.net +0.0.0.0 serve.prestigecasino.com +0.0.0.0 server01.popupmoney.com +0.0.0.0 server2.as5000.com +0.0.0.0 server2.mediajmp.com +0.0.0.0 server3.yieldmanaged.com +0.0.0.0 server.as5000.com +0.0.0.0 server.bittads.com +0.0.0.0 server.cpmstar.com +0.0.0.0 server.popads.net +0.0.0.0 server-ssl.yieldmanaged.com +0.0.0.0 service001.adtech.de +0.0.0.0 service001.adtech.fr +0.0.0.0 service001.adtech.us +0.0.0.0 service002.adtech.de +0.0.0.0 service002.adtech.fr +0.0.0.0 service002.adtech.us +0.0.0.0 service003.adtech.de +0.0.0.0 service003.adtech.fr +0.0.0.0 service003.adtech.us +0.0.0.0 service004.adtech.fr +0.0.0.0 service004.adtech.us +0.0.0.0 service00x.adtech.de +0.0.0.0 service00x.adtech.fr +0.0.0.0 service00x.adtech.us +0.0.0.0 service.adtech.de +0.0.0.0 service.adtech.fr +0.0.0.0 service.adtech.us +0.0.0.0 services1.adtech.de +0.0.0.0 services1.adtech.fr +0.0.0.0 services1.adtech.us +0.0.0.0 services.adtech.de +0.0.0.0 services.adtech.fr +0.0.0.0 services.adtech.us +0.0.0.0 serving.plexop.net +0.0.0.0 sexpartnerx.com +0.0.0.0 sexsponsors.com +0.0.0.0 sexzavod.com +0.0.0.0 sfads.osdn.com +0.0.0.0 s.flite.com +0.0.0.0 sg.adserver.yahoo.com +0.0.0.0 sgs001.adtech.de +0.0.0.0 sgs001.adtech.fr +0.0.0.0 sgs001.adtech.us +0.0.0.0 sh4sure-images.adbureau.net +0.0.0.0 shareasale.com +0.0.0.0 sharebar.addthiscdn.com +0.0.0.0 share-server.com +0.0.0.0 shc-rebates.com +0.0.0.0 shinystat.shiny.it +0.0.0.0 shopperpromotions.com +0.0.0.0 shopping-offer.com +0.0.0.0 shoppingsiterewards.com +0.0.0.0 shops-malls-rewardpath.com +0.0.0.0 shoptosaveenergy.com +0.0.0.0 showads1000.pubmatic.com +0.0.0.0 showadsak.pubmatic.com +0.0.0.0 sifomedia.citypaketet.se +0.0.0.0 signup.advance.net +0.0.0.0 si.hit.gemius.pl +0.0.0.0 simg.zedo.com +0.0.0.0 simpleads.net +0.0.0.0 simpli.fi +0.0.0.0 s.innovid.com +0.0.0.0 sixapart.adbureau.net +0.0.0.0 sizzle-savings.com +0.0.0.0 skgde.adocean.pl +0.0.0.0 skill.skilljam.com +0.0.0.0 slider.plugrush.com +0.0.0.0 smartadserver +0.0.0.0 smartadserver.com +0.0.0.0 smart.besonders.ru +0.0.0.0 smartclip.com +0.0.0.0 smartclip.net +0.0.0.0 smartcontext.pl +0.0.0.0 smartinit.webads.nl +0.0.0.0 smart-scripts.com +0.0.0.0 smartshare.lgtvsdp.com +0.0.0.0 s.media-imdb.com +0.0.0.0 s.megaclick.com +0.0.0.0 smile.modchipstore.com +0.0.0.0 smm.sitescout.com +0.0.0.0 s.moatads.com +0.0.0.0 smokersopinionpoll.com +0.0.0.0 smsmovies.net +0.0.0.0 snaps.vidiemi.com +0.0.0.0 sn.baventures.com +0.0.0.0 snip.answers.com +0.0.0.0 snipjs.answcdn.com +0.0.0.0 sochr.com +0.0.0.0 social.bidsystem.com +0.0.0.0 softlinkers.popunder.ru +0.0.0.0 sokrates.adtech.de +0.0.0.0 sokrates.adtech.fr +0.0.0.0 sokrates.adtech.us +0.0.0.0 sol.adbureau.net +0.0.0.0 sol-images.adbureau.net +0.0.0.0 solitairetime.com +0.0.0.0 solution.weborama.fr +0.0.0.0 somethingawful.crwdcntrl.net +0.0.0.0 sonycomputerentertai.tt.omtrdc.net +0.0.0.0 soongu.info +0.0.0.0 spanids.dictionary.com +0.0.0.0 spanids.thesaurus.com +0.0.0.0 spc.cekfmeoejdbfcfichgbfcgjf.vast2as3.glammedia-pubnet.northamerica.telemetryverification.net +0.0.0.0 spe.atdmt.com +0.0.0.0 specialgiftrewards.com +0.0.0.0 specialoffers.aol.com +0.0.0.0 specialonlinegifts.com +0.0.0.0 specials-rewardpath.com +0.0.0.0 speedboink.com +0.0.0.0 speedclicks.ero-advertising.com +0.0.0.0 speed.pointroll.com # Microsoft +0.0.0.0 spinbox.com +0.0.0.0 spinbox.consumerreview.com +0.0.0.0 spinbox.freedom.com +0.0.0.0 spinbox.macworld.com +0.0.0.0 spinbox.techtracker.com +0.0.0.0 spin.spinbox.net +0.0.0.0 sponsor1.com +0.0.0.0 sponsors.behance.com +0.0.0.0 sponsors.ezgreen.com +0.0.0.0 sponsorships.net +0.0.0.0 sports-bonuspath.com +0.0.0.0 sports-fitness-rewardpath.com +0.0.0.0 sports-offer.com +0.0.0.0 sports-offer.net +0.0.0.0 sports-premiumblvd.com +0.0.0.0 spotxchange.com +0.0.0.0 s.ppjol.net +0.0.0.0 sq2trk2.com +0.0.0.0 srs.targetpoint.com +0.0.0.0 srv.juiceadv.com +0.0.0.0 ssads.osdn.com +0.0.0.0 s.skimresources.com +0.0.0.0 sso.canada.com +0.0.0.0 staging.snip.answers.com +0.0.0.0 stampen.adtlgc.com +0.0.0.0 stampen.linkpulse.com +0.0.0.0 stampscom.tt.omtrdc.net +0.0.0.0 stanzapub.advertserve.com +0.0.0.0 star-advertising.com +0.0.0.0 stat.blogads.com +0.0.0.0 stat.dealtime.com +0.0.0.0 stat.ebuzzing.com +0.0.0.0 static1.influads.com +0.0.0.0 static.2mdn.net +0.0.0.0 static.admaximize.com +0.0.0.0 staticads.btopenworld.com +0.0.0.0 static.adsonar.com +0.0.0.0 static.adtaily.pl +0.0.0.0 static.adzerk.net +0.0.0.0 static.aff-landing-tmp.foxtab.com +0.0.0.0 staticb.mydirtyhobby.com +0.0.0.0 static.carbonads.com +0.0.0.0 static.clicktorrent.info +0.0.0.0 static.creatives.livejasmin.com +0.0.0.0 static.doubleclick.net +0.0.0.0 static.everyone.net +0.0.0.0 static.exoclick.com +0.0.0.0 static.fastpic.ru +0.0.0.0 static.firehunt.com +0.0.0.0 static.fmpub.net +0.0.0.0 static.freenet.de +0.0.0.0 static.groupy.co.nz +0.0.0.0 static.hitfarm.com +0.0.0.0 static.ifa.camads.net +0.0.0.0 static.l3.cdn.adbucks.com +0.0.0.0 static.l3.cdn.adsucks.com +0.0.0.0 static.plista.com +0.0.0.0 static.plugrush.com +0.0.0.0 static.pulse360.com +0.0.0.0 static.scanscout.com +0.0.0.0 static.vpptechnologies.com +0.0.0.0 static.way2traffic.com +0.0.0.0 statistik-gallup.dk +0.0.0.0 stats2.dooyoo.com +0.0.0.0 stats.askmoses.com +0.0.0.0 stats.buzzparadise.com +0.0.0.0 stats.jtvnw.net +0.0.0.0 stats.shopify.com +0.0.0.0 status.addthis.com +0.0.0.0 st.blogads.com +0.0.0.0 s.tcimg.com +0.0.0.0 st.marketgid.com +0.0.0.0 stocker.bonnint.net +0.0.0.0 storage.softure.com +0.0.0.0 storage.trafic.ro +0.0.0.0 streamate.com +0.0.0.0 stts.rbc.ru +0.0.0.0 st.valueclick.com +0.0.0.0 su.addthis.com +0.0.0.0 subtracts.userplane.com +0.0.0.0 sudokuwhiz.com +0.0.0.0 sunmaker.com +0.0.0.0 superbrewards.com +0.0.0.0 support.sweepstakes.com +0.0.0.0 supremeadsonline.com +0.0.0.0 suresafe1.adsovo.com +0.0.0.0 surplus-suppliers.com +0.0.0.0 surveycentral.directinsure.info +0.0.0.0 surveymonkeycom.tt.omtrdc.net +0.0.0.0 surveypass.com +0.0.0.0 susi.adtech.fr +0.0.0.0 susi.adtech.us +0.0.0.0 svd2.adtlgc.com +0.0.0.0 svd.adtlgc.com +0.0.0.0 sview.avenuea.com +0.0.0.0 sweetsforfree.com +0.0.0.0 symbiosting.com +0.0.0.0 synad2.nuffnang.com.cn +0.0.0.0 synad.nuffnang.com.sg +0.0.0.0 syncaccess.net +0.0.0.0 sync.mathtag.com +0.0.0.0 syndicated.mondominishows.com +0.0.0.0 syndication.exoclick.com +0.0.0.0 syndication.traffichaus.com +0.0.0.0 syn.verticalacuity.com +0.0.0.0 sysadmin.map24.com +0.0.0.0 t1.adserver.com +0.0.0.0 t4.liverail.com +0.0.0.0 t-ads.adap.tv +0.0.0.0 tag1.webabacus.com +0.0.0.0 tag.admeld.com +0.0.0.0 tag.contextweb.com +0.0.0.0 tag.regieci.com +0.0.0.0 tags.bluekai.com +0.0.0.0 tags.hypeads.org +0.0.0.0 tag.webcompteur.com +0.0.0.0 tag.yieldoptimizer.com +0.0.0.0 taloussanomat.linkpulse.com +0.0.0.0 tap2-cdn.rubiconproject.com +0.0.0.0 tbtrack.zutrack.com +0.0.0.0 tcadops.ca +0.0.0.0 tcimg.com +0.0.0.0 t.cpmadvisors.com +0.0.0.0 tdameritrade.tt.omtrdc.net +0.0.0.0 tdc.advertorials.dk +0.0.0.0 tdkads.ads.dk +0.0.0.0 techreview.adbureau.net +0.0.0.0 techreview-images.adbureau.net +0.0.0.0 teeser.ru +0.0.0.0 te.kontera.com +0.0.0.0 tel.geenstijl.nl +0.0.0.0 textads.madisonavenue.com +0.0.0.0 textad.traficdublu.ro +0.0.0.0 text-link-ads.com +0.0.0.0 text-link-ads.ientry.com +0.0.0.0 text-link-ads-inventory.com +0.0.0.0 textsrv.com +0.0.0.0 tf.nexac.com +0.0.0.0 tgpmanager.com +0.0.0.0 the-binary-trader.biz +0.0.0.0 the-path-gateway.com +0.0.0.0 thepiratetrader.com +0.0.0.0 the-smart-stop.com +0.0.0.0 theuploadbusiness.com +0.0.0.0 theuseful.com +0.0.0.0 theuseful.net +0.0.0.0 thinknyc.eu-adcenter.net +0.0.0.0 thinktarget.com +0.0.0.0 thinlaptoprewards.com +0.0.0.0 this.content.served.by.adshuffle.com +0.0.0.0 thoughtfully-free.com +0.0.0.0 thruport.com +0.0.0.0 tmp3.nexac.com +0.0.0.0 tmsads.tribune.com +0.0.0.0 tmx.technoratimedia.com +0.0.0.0 tn.adserve.com +0.0.0.0 toads.osdn.com +0.0.0.0 tons-to-see.com +0.0.0.0 toolbar.adperium.com +0.0.0.0 top100-images.rambler.ru +0.0.0.0 top1site.3host.com +0.0.0.0 top5.mail.ru +0.0.0.0 topbrandrewards.com +0.0.0.0 topconsumergifts.com +0.0.0.0 topdemaroc.com +0.0.0.0 topica.advertserve.com +0.0.0.0 top.list.ru +0.0.0.0 toplist.throughput.de +0.0.0.0 topmarketcenter.com +0.0.0.0 touche.adcentric.proximi-t.com +0.0.0.0 tower.adexpedia.com +0.0.0.0 toy-offer.com +0.0.0.0 toy-offer.net +0.0.0.0 tpads.ovguide.com +0.0.0.0 tpc.googlesyndication.com +0.0.0.0 tps30.doubleverify.com +0.0.0.0 tps31.doubleverify.com +0.0.0.0 track.adbooth.net +0.0.0.0 trackadvertising.net +0.0.0.0 track-apmebf.cj.akadns.net +0.0.0.0 track.bigbrandpromotions.com +0.0.0.0 track.e7r.com.br +0.0.0.0 trackers.1st-affiliation.fr +0.0.0.0 tracking.craktraffic.com +0.0.0.0 tracking.edvisors.com +0.0.0.0 tracking.eurowebaffiliates.com +0.0.0.0 tracking.joker.com +0.0.0.0 tracking.keywordmax.com +0.0.0.0 tracking.veoxa.com +0.0.0.0 track.omgpl.com +0.0.0.0 track.the-members-section.com +0.0.0.0 track.vscash.com +0.0.0.0 tradearabia.advertserve.com +0.0.0.0 tradefx.advertserve.com +0.0.0.0 trafficbee.com +0.0.0.0 trafficrevenue.net +0.0.0.0 traffictraders.com +0.0.0.0 traffprofit.com +0.0.0.0 trafmag.com +0.0.0.0 trafsearchonline.com +0.0.0.0 traktum.com +0.0.0.0 travel-leisure-bonuspath.com +0.0.0.0 travel-leisure-premiumblvd.com +0.0.0.0 traveller-offer.com +0.0.0.0 traveller-offer.net +0.0.0.0 travelncs.com +0.0.0.0 trekmedia.net +0.0.0.0 trendnews.com +0.0.0.0 trk.alskeip.com +0.0.0.0 trk.etrigue.com +0.0.0.0 trk.yadomedia.com +0.0.0.0 trustsitesite.com +0.0.0.0 trvlnet.adbureau.net +0.0.0.0 trvlnet-images.adbureau.net +0.0.0.0 tr.wl.webads.nl +0.0.0.0 tsms-ad.tsms.com +0.0.0.0 tste.ivillage.com +0.0.0.0 tste.mcclatchyinteractive.com +0.0.0.0 tste.startribune.com +0.0.0.0 ttarget.adbureau.net +0.0.0.0 ttuk.offers4u.mobi +0.0.0.0 turnerapac.d1.sc.omtrdc.net +0.0.0.0 tv2no.linkpulse.com +0.0.0.0 tvshowsnow.tvmax.hop.clickbank.net +0.0.0.0 tw.adserver.yahoo.com +0.0.0.0 twnads.weather.ca # Canadian Weather Network +0.0.0.0 uac.advertising.com +0.0.0.0 u-ads.adap.tv +0.0.0.0 uav.tidaltv.com +0.0.0.0 uc.csc.adserver.yahoo.com +0.0.0.0 uedata.amazon.com +0.0.0.0 uelbdc74fn.s.ad6media.fr +0.0.0.0 uf2.svrni.ca +0.0.0.0 ugo.eu-adcenter.net +0.0.0.0 ui.ppjol.com +0.0.0.0 uk.adserver.yahoo.com +0.0.0.0 uleadstrk.com +0.0.0.0 ultimatefashiongifts.com +0.0.0.0 ultrabestportal.com +0.0.0.0 um.simpli.fi +0.0.0.0 undertonenetworks.com +0.0.0.0 uole.ad.uol.com.br +0.0.0.0 u.openx.net +0.0.0.0 upload.adtech.de +0.0.0.0 upload.adtech.fr +0.0.0.0 upload.adtech.us +0.0.0.0 uproar.com +0.0.0.0 uproar.fortunecity.com +0.0.0.0 upsellit.com +0.0.0.0 us.adserver.yahoo.com +0.0.0.0 usads.vibrantmedia.com +0.0.0.0 usatoday.app.ur.gcion.com +0.0.0.0 usatravel-specials.com +0.0.0.0 usatravel-specials.net +0.0.0.0 us-choicevalue.com +0.0.0.0 usemax.de +0.0.0.0 usr.marketgid.com +0.0.0.0 us-topsites.com +0.0.0.0 ut.addthis.com +0.0.0.0 utarget.ru +0.0.0.0 utils.media-general.com +0.0.0.0 utils.mediageneral.com +0.0.0.0 vad.adbasket.net +0.0.0.0 vads.adbrite.com +0.0.0.0 van.ads.link4ads.com +0.0.0.0 vast.bp3845260.btrll.com +0.0.0.0 vast.bp3846806.btrll.com +0.0.0.0 vast.bp3846885.btrll.com +0.0.0.0 vast.tubemogul.com +0.0.0.0 vclick.adbrite.com +0.0.0.0 venus.goclick.com +0.0.0.0 ve.tscapeplay.com +0.0.0.0 v.fwmrm.net +0.0.0.0 vibrantmedia.com +0.0.0.0 videocop.com +0.0.0.0 videoegg.adbureau.net +0.0.0.0 video-game-rewards-central.com +0.0.0.0 videogamerewardscentral.com +0.0.0.0 videos.fleshlight.com +0.0.0.0 videoslots.888.com +0.0.0.0 videos.video-loader.com +0.0.0.0 view.atdmt.com #This may interfere with downloading from Microsoft, MSDN and TechNet websites. +0.0.0.0 view.avenuea.com +0.0.0.0 view.binlayer.com +0.0.0.0 view.iballs.a1.avenuea.com +0.0.0.0 view.jamba.de +0.0.0.0 view.netrams.com +0.0.0.0 views.m4n.nl +0.0.0.0 viglink.com +0.0.0.0 viglink.pgpartner.com +0.0.0.0 villagevoicecollect.247realmedia.com +0.0.0.0 vip1.tw.adserver.yahoo.com +0.0.0.0 vipfastmoney.com +0.0.0.0 vk.18sexporn.ru +0.0.0.0 vmcsatellite.com +0.0.0.0 vmix.adbureau.net +0.0.0.0 vms.boldchat.com +0.0.0.0 vnu.eu-adcenter.net +0.0.0.0 vodafoneit.solution.weborama.fr +0.0.0.0 vp.tscapeplay.com +0.0.0.0 vu.veoxa.com +0.0.0.0 vzarabotke.ru +0.0.0.0 w100.am15.net +0.0.0.0 w10.am15.net +0.0.0.0 w10.centralmediaserver.com +0.0.0.0 w11.am15.net +0.0.0.0 w11.centralmediaserver.com +0.0.0.0 w12.am15.net +0.0.0.0 w13.am15.net +0.0.0.0 w14.am15.net +0.0.0.0 w15.am15.net +0.0.0.0 w16.am15.net +0.0.0.0 w17.am15.net +0.0.0.0 w18.am15.net +0.0.0.0 w19.am15.net +0.0.0.0 w1.am15.net +0.0.0.0 w1.webcompteur.com +0.0.0.0 w20.am15.net +0.0.0.0 w21.am15.net +0.0.0.0 w22.am15.net +0.0.0.0 w23.am15.net +0.0.0.0 w24.am15.net +0.0.0.0 w25.am15.net +0.0.0.0 w26.am15.net +0.0.0.0 w27.am15.net +0.0.0.0 w28.am15.net +0.0.0.0 w29.am15.net +0.0.0.0 w2.am15.net +0.0.0.0 w30.am15.net +0.0.0.0 w31.am15.net +0.0.0.0 w32.am15.net +0.0.0.0 w33.am15.net +0.0.0.0 w34.am15.net +0.0.0.0 w35.am15.net +0.0.0.0 w36.am15.net +0.0.0.0 w37.am15.net +0.0.0.0 w38.am15.net +0.0.0.0 w39.am15.net +0.0.0.0 w3.am15.net +0.0.0.0 w40.am15.net +0.0.0.0 w41.am15.net +0.0.0.0 w42.am15.net +0.0.0.0 w43.am15.net +0.0.0.0 w44.am15.net +0.0.0.0 w45.am15.net +0.0.0.0 w46.am15.net +0.0.0.0 w47.am15.net +0.0.0.0 w48.am15.net +0.0.0.0 w49.am15.net +0.0.0.0 w4.am15.net +0.0.0.0 w50.am15.net +0.0.0.0 w51.am15.net +0.0.0.0 w52.am15.net +0.0.0.0 w53.am15.net +0.0.0.0 w54.am15.net +0.0.0.0 w55.am15.net +0.0.0.0 w56.am15.net +0.0.0.0 w57.am15.net +0.0.0.0 w58.am15.net +0.0.0.0 w59.am15.net +0.0.0.0 w5.am15.net +0.0.0.0 w60.am15.net +0.0.0.0 w61.am15.net +0.0.0.0 w62.am15.net +0.0.0.0 w63.am15.net +0.0.0.0 w64.am15.net +0.0.0.0 w65.am15.net +0.0.0.0 w66.am15.net +0.0.0.0 w67.am15.net +0.0.0.0 w68.am15.net +0.0.0.0 w69.am15.net +0.0.0.0 w6.am15.net +0.0.0.0 w70.am15.net +0.0.0.0 w71.am15.net +0.0.0.0 w72.am15.net +0.0.0.0 w73.am15.net +0.0.0.0 w74.am15.net +0.0.0.0 w75.am15.net +0.0.0.0 w76.am15.net +0.0.0.0 w77.am15.net +0.0.0.0 w78.am15.net +0.0.0.0 w79.am15.net +0.0.0.0 w7.am15.net +0.0.0.0 w80.am15.net +0.0.0.0 w81.am15.net +0.0.0.0 w82.am15.net +0.0.0.0 w83.am15.net +0.0.0.0 w84.am15.net +0.0.0.0 w85.am15.net +0.0.0.0 w86.am15.net +0.0.0.0 w87.am15.net +0.0.0.0 w88.am15.net +0.0.0.0 w89.am15.net +0.0.0.0 w8.am15.net +0.0.0.0 w90.am15.net +0.0.0.0 w91.am15.net +0.0.0.0 w92.am15.net +0.0.0.0 w93.am15.net +0.0.0.0 w94.am15.net +0.0.0.0 w95.am15.net +0.0.0.0 w96.am15.net +0.0.0.0 w97.am15.net +0.0.0.0 w98.am15.net +0.0.0.0 w99.am15.net +0.0.0.0 w9.am15.net +0.0.0.0 wahoha.com +0.0.0.0 warp.crystalad.com +0.0.0.0 wdm29.com +0.0.0.0 web1b.netreflector.com +0.0.0.0 web.adblade.com +0.0.0.0 webads.bizservers.com +0.0.0.0 webads.nl +0.0.0.0 webcompteur.com +0.0.0.0 webhosting-ads.home.pl +0.0.0.0 webmdcom.tt.omtrdc.net +0.0.0.0 web.nyc.ads.juno.co +0.0.0.0 webservices-rewardpath.com +0.0.0.0 websurvey.spa-mr.com +0.0.0.0 wegetpaid.net +0.0.0.0 w.ic.tynt.com +0.0.0.0 widget3.linkwithin.com +0.0.0.0 widget5.linkwithin.com +0.0.0.0 widget.crowdignite.com +0.0.0.0 widget.plugrush.com +0.0.0.0 widgets.outbrain.com +0.0.0.0 widgets.tcimg.com +0.0.0.0 wigetmedia.com +0.0.0.0 wikiforosh.ir +0.0.0.0 williamhill.es +0.0.0.0 wmedia.rotator.hadj7.adjuggler.net +0.0.0.0 wordplaywhiz.com +0.0.0.0 work-offer.com +0.0.0.0 worry-free-savings.com +0.0.0.0 wppluginspro.com +0.0.0.0 ws.addthis.com +0.0.0.0 wtp101.com +0.0.0.0 ww251.smartadserver.com +0.0.0.0 wwbtads.com +0.0.0.0 www10.ad.tomshardware.com +0.0.0.0 www10.glam.com +0.0.0.0 www10.indiads.com +0.0.0.0 www10.paypopup.com +0.0.0.0 www11.ad.tomshardware.com +0.0.0.0 www123.glam.com +0.0.0.0 www.123specialgifts.com +0.0.0.0 www12.ad.tomshardware.com +0.0.0.0 www12.glam.com +0.0.0.0 www13.ad.tomshardware.com +0.0.0.0 www13.glam.com +0.0.0.0 www14.ad.tomshardware.com +0.0.0.0 www15.ad.tomshardware.com +0.0.0.0 www17.glam.com +0.0.0.0 www18.glam.com +0.0.0.0 www1.adireland.com +0.0.0.0 www1.ad.tomshardware.com +0.0.0.0 www1.bannerspace.com +0.0.0.0 www1.belboon.de +0.0.0.0 www1.clicktorrent.info +0.0.0.0 www1.mpnrs.com +0.0.0.0 www1.popinads.com +0.0.0.0 www1.safenyplanet.in +0.0.0.0 www210.paypopup.com +0.0.0.0 www211.paypopup.com +0.0.0.0 www212.paypopup.com +0.0.0.0 www213.paypopup.com +0.0.0.0 www.247realmedia.com +0.0.0.0 www24a.glam.com +0.0.0.0 www24.glam.com +0.0.0.0 www25a.glam.com +0.0.0.0 www25.glam.com +0.0.0.0 www2.adireland.com +0.0.0.0 www2.adserverpub.com +0.0.0.0 www2.ad.tomshardware.com +0.0.0.0 www.2-art-coliseum.com +0.0.0.0 www2.bannerspace.com +0.0.0.0 www2.glam.com +0.0.0.0 www30a1.glam.com +0.0.0.0 www30a1-orig.glam.com +0.0.0.0 www30a2-orig.glam.com +0.0.0.0 www30a3.glam.com +0.0.0.0 www30a3-orig.glam.com +0.0.0.0 www30a7.glam.com +0.0.0.0 www30.glam.com +0.0.0.0 www30l2.glam.com +0.0.0.0 www30t1-orig.glam.com +0.0.0.0 www.321cba.com +0.0.0.0 www35f.glam.com +0.0.0.0 www35jm.glam.com +0.0.0.0 www35t.glam.com +0.0.0.0 www.360ads.com +0.0.0.0 www3.addthis.com +0.0.0.0 www3.adireland.com +0.0.0.0 www3.ad.tomshardware.com +0.0.0.0 www3.bannerspace.com +0.0.0.0 www3.game-advertising-online.com +0.0.0.0 www.3qqq.net +0.0.0.0 www.3turtles.com +0.0.0.0 www.404errorpage.com +0.0.0.0 www4.ad.tomshardware.com +0.0.0.0 www4.bannerspace.com +0.0.0.0 www4.glam.com +0.0.0.0 www4.smartadserver.com +0.0.0.0 www5.ad.tomshardware.com +0.0.0.0 www5.bannerspace.com +0.0.0.0 www.5thavenue.com +0.0.0.0 www6.ad.tomshardware.com +0.0.0.0 www6.bannerspace.com +0.0.0.0 www74.valueclick.com +0.0.0.0 www.7500.com +0.0.0.0 www7.ad.tomshardware.com +0.0.0.0 www7.bannerspace.com +0.0.0.0 www.7bpeople.com +0.0.0.0 www.7cnbcnews.com +0.0.0.0 www.805m.com +0.0.0.0 www81.valueclick.com +0.0.0.0 www.888casino.com +0.0.0.0 www.888.com +0.0.0.0 www.888poker.com +0.0.0.0 www8.ad.tomshardware.com +0.0.0.0 www8.bannerspace.com +0.0.0.0 www.961.com +0.0.0.0 www9.ad.tomshardware.com +0.0.0.0 www9.paypopup.com +0.0.0.0 www.abrogatesdv.info +0.0.0.0 www.actiondesk.com +0.0.0.0 www.action.ientry.net +0.0.0.0 www.adbanner.gr +0.0.0.0 www.adbrite.com +0.0.0.0 www.adcanadian.com +0.0.0.0 www.adcash.com +0.0.0.0 www.addthiscdn.com +0.0.0.0 www.adengage.com +0.0.0.0 www.adfunkyserver.com +0.0.0.0 www.adfusion.com +0.0.0.0 www.adimages.beeb.com +0.0.0.0 www.adipics.com +0.0.0.0 www.adireland.com +0.0.0.0 www.adjmps.com +0.0.0.0 www.adjug.com +0.0.0.0 www.adloader.com +0.0.0.0 www.adlogix.com +0.0.0.0 www.admex.com +0.0.0.0 www.adnet.biz +0.0.0.0 www.adnet.com +0.0.0.0 www.adnet.de +0.0.0.0 www.adobee.com +0.0.0.0 www.adocean.pl +0.0.0.0 www.adotube.com +0.0.0.0 www.adpepper.dk +0.0.0.0 www.adpowerzone.com +0.0.0.0 www.adquest3d.com +0.0.0.0 www.adreporting.com +0.0.0.0 www.ads2srv.com +0.0.0.0 www.adsentnetwork.com +0.0.0.0 www.adserver.co.il +0.0.0.0 www.adserver.com +0.0.0.0 www.adserver.com.my +0.0.0.0 www.adserver.com.pl +0.0.0.0 www.adserver-espnet.sportszone.net +0.0.0.0 www.adserver.janes.net +0.0.0.0 www.adserver.janes.org +0.0.0.0 www.adserver.jolt.co.uk +0.0.0.0 www.adserver.net +0.0.0.0 www.adserver.ugo.nl +0.0.0.0 www.adservtech.com +0.0.0.0 www.adsinimages.com +0.0.0.0 www.ads.joetec.net +0.0.0.0 www.adsoftware.com +0.0.0.0 www.ad-souk.com +0.0.0.0 www.adspics.com +0.0.0.0 www.ads.revenue.net +0.0.0.0 www.adstogo.com +0.0.0.0 www.adstreams.org +0.0.0.0 www.adtaily.pl +0.0.0.0 www.adtechus.com +0.0.0.0 www.ad.tgdaily.com +0.0.0.0 www.adtlgc.com +0.0.0.0 www.ad.tomshardware.com +0.0.0.0 www.adtrader.com +0.0.0.0 www.adtrix.com +0.0.0.0 www.ad.twitchguru.com +0.0.0.0 www.ad-up.com +0.0.0.0 www.advaliant.com +0.0.0.0 www.advertising-department.com +0.0.0.0 www.advertlets.com +0.0.0.0 www.advertpro.com +0.0.0.0 www.adverts.dcthomson.co.uk +0.0.0.0 www.advertyz.com +0.0.0.0 www.ad-words.ru +0.0.0.0 www.afcyhf.com +0.0.0.0 www.affiliateclick.com +0.0.0.0 www.affiliate-fr.com +0.0.0.0 www.affiliation-france.com +0.0.0.0 www.afform.co.uk +0.0.0.0 www.affpartners.com +0.0.0.0 www.afterdownload.com +0.0.0.0 www.agkn.com +0.0.0.0 www.alexxe.com +0.0.0.0 www.allosponsor.com +0.0.0.0 www.annuaire-autosurf.com +0.0.0.0 www.apparelncs.com +0.0.0.0 www.apparel-offer.com +0.0.0.0 www.applelounge.com +0.0.0.0 www.appnexus.com +0.0.0.0 www.art-music-rewardpath.com +0.0.0.0 www.art-offer.com +0.0.0.0 www.art-offer.net +0.0.0.0 www.art-photo-music-premiumblvd.com +0.0.0.0 www.art-photo-music-rewardempire.com +0.0.0.0 www.art-photo-music-savingblvd.com +0.0.0.0 www.auctionshare.net +0.0.0.0 www.aureate.com +0.0.0.0 www.autohipnose.com +0.0.0.0 www.automotive-offer.com +0.0.0.0 www.automotive-rewardpath.com +0.0.0.0 www.avcounter10.com +0.0.0.0 www.avsads.com +0.0.0.0 www.a.websponsors.com +0.0.0.0 www.awesomevipoffers.com +0.0.0.0 www.awin1.com +0.0.0.0 www.awltovhc.com #qksrv +0.0.0.0 www.bananacashback.com +0.0.0.0 www.banner4all.dk +0.0.0.0 www.bannerads.de +0.0.0.0 www.bannerbackup.com +0.0.0.0 www.bannerconnect.net +0.0.0.0 www.banners.paramountzone.com +0.0.0.0 www.bannersurvey.biz +0.0.0.0 www.banstex.com +0.0.0.0 www.bargainbeautybuys.com +0.0.0.0 www.bbelements.com +0.0.0.0 www.bestshopperrewards.com +0.0.0.0 www.bet365.com +0.0.0.0 www.bidtraffic.com +0.0.0.0 www.bidvertiser.com +0.0.0.0 www.bigbrandpromotions.com +0.0.0.0 www.bigbrandrewards.com +0.0.0.0 www.biggestgiftrewards.com +0.0.0.0 www.binarysystem4u.com +0.0.0.0 www.biz-offer.com +0.0.0.0 www.bizopprewards.com +0.0.0.0 www.blasphemysfhs.info +0.0.0.0 www.blatant8jh.info +0.0.0.0 www.bluediamondoffers.com +0.0.0.0 www.bnnr.nl +0.0.0.0 www.bonzi.com +0.0.0.0 www.bookclub-offer.com +0.0.0.0 www.books-media-edu-premiumblvd.com +0.0.0.0 www.books-media-edu-rewardempire.com +0.0.0.0 www.books-media-rewardpath.com +0.0.0.0 www.boonsolutions.com +0.0.0.0 www.bostonsubwayoffer.com +0.0.0.0 www.brandrewardcentral.com +0.0.0.0 www.brandsurveypanel.com +0.0.0.0 www.brokertraffic.com +0.0.0.0 www.budsinc.com +0.0.0.0 www.bugsbanner.it +0.0.0.0 www.bulkclicks.com +0.0.0.0 www.bulletads.com +0.0.0.0 www.burstnet.com +0.0.0.0 www.business-rewardpath.com +0.0.0.0 www.bus-offer.com +0.0.0.0 www.buttcandy.com +0.0.0.0 www.buwobarun.cn +0.0.0.0 www.buycheapadvertising.com +0.0.0.0 www.buyhitscheap.com +0.0.0.0 www.capath.com +0.0.0.0 www.careers-rewardpath.com +0.0.0.0 www.car-truck-boat-bonuspath.com +0.0.0.0 www.car-truck-boat-premiumblvd.com +0.0.0.0 www.cashback.co.uk +0.0.0.0 www.cashbackwow.co.uk +0.0.0.0 www.cashcount.com +0.0.0.0 www.casino770.com +0.0.0.0 www.catalinkcashback.com +0.0.0.0 www.cell-phone-giveaways.com +0.0.0.0 www.cellphoneincentives.com +0.0.0.0 www.chainsawoffer.com +0.0.0.0 www.chartbeat.com +0.0.0.0 www.choicedealz.com +0.0.0.0 www.choicesurveypanel.com +0.0.0.0 www.christianbusinessadvertising.com +0.0.0.0 www.ciqugasox.cn +0.0.0.0 www.claimfreerewards.com +0.0.0.0 www.clashmediausa.com +0.0.0.0 www.click10.com +0.0.0.0 www.click4click.com +0.0.0.0 www.clickbank.com +0.0.0.0 www.clickdensity.com +0.0.0.0 www.click-find-save.com +0.0.0.0 www.click-see-save.com +0.0.0.0 www.clicksor.com +0.0.0.0 www.clicksotrk.com +0.0.0.0 www.clicktale.com +0.0.0.0 www.clicktale.net +0.0.0.0 www.clickthruserver.com +0.0.0.0 www.clickthrutraffic.com +0.0.0.0 www.clicktilluwin.com +0.0.0.0 www.clicktorrent.info +0.0.0.0 www.clickxchange.com +0.0.0.0 www.closeoutproductsreview.com +0.0.0.0 www.cm1359.com +0.0.0.0 www.come-see-it-all.com +0.0.0.0 www.commerce-offer.com +0.0.0.0 www.commerce-rewardpath.com +0.0.0.0 www.computer-offer.com +0.0.0.0 www.computer-offer.net +0.0.0.0 www.computers-electronics-rewardpath.com +0.0.0.0 www.computersncs.com +0.0.0.0 www.consumergiftcenter.com +0.0.0.0 www.consumerincentivenetwork.com +0.0.0.0 www.consumer-org.com +0.0.0.0 www.contaxe.com +0.0.0.0 www.contextuads.com +0.0.0.0 www.contextweb.com +0.0.0.0 www.cookingtiprewards.com +0.0.0.0 www.coolconcepts.nl +0.0.0.0 www.cool-premiums.com +0.0.0.0 www.cool-premiums-now.com +0.0.0.0 www.coolpremiumsnow.com +0.0.0.0 www.coolsavings.com +0.0.0.0 www.coreglead.co.uk +0.0.0.0 www.cosmeticscentre.uk.com +0.0.0.0 www.cpabank.com +0.0.0.0 www.cpmadvisors.com +0.0.0.0 www.crazypopups.com +0.0.0.0 www.crazywinnings.com +0.0.0.0 www.crediblegfj.info +0.0.0.0 www.crispads.com +0.0.0.0 www.crowdgravity.com +0.0.0.0 www.crowdignite.com +0.0.0.0 www.ctbdev.net +0.0.0.0 www.cyber-incentives.com +0.0.0.0 www.d03x2011.com +0.0.0.0 www.da-ads.com +0.0.0.0 www.daily-saver.com +0.0.0.0 www.datatech.es +0.0.0.0 www.datingadvertising.com +0.0.0.0 www.dctracking.com +0.0.0.0 www.depravedwhores.com +0.0.0.0 www.designbloxlive.com +0.0.0.0 www.dgmaustralia.com +0.0.0.0 www.dietoftoday.ca.pn +0.0.0.0 www.digimedia.com +0.0.0.0 www.directnetadvertising.net +0.0.0.0 www.directpowerrewards.com +0.0.0.0 www.dirtyrhino.com +0.0.0.0 www.discount-savings-more.com +0.0.0.0 www.djugoogs.com +0.0.0.0 www.dl-plugin.com +0.0.0.0 www.drowle.com +0.0.0.0 www.dutchsales.org +0.0.0.0 www.earnmygift.com +0.0.0.0 www.earnpointsandgifts.com +0.0.0.0 www.easyadservice.com +0.0.0.0 www.e-bannerx.com +0.0.0.0 www.ebaybanner.com +0.0.0.0 www.education-rewardpath.com +0.0.0.0 www.edu-offer.com +0.0.0.0 www.electronics-bonuspath.com +0.0.0.0 www.electronics-offer.net +0.0.0.0 www.electronicspresent.com +0.0.0.0 www.electronics-rewardpath.com +0.0.0.0 www.emailadvantagegroup.com +0.0.0.0 www.emailproductreview.com +0.0.0.0 www.emarketmakers.com +0.0.0.0 www.entertainment-rewardpath.com +0.0.0.0 www.entertainment-specials.com +0.0.0.0 www.eshopads2.com +0.0.0.0 www.euros4click.de +0.0.0.0 www.exclusivegiftcards.com +0.0.0.0 www.eyeblaster-bs.com +0.0.0.0 www.eyewonder.com #: Interactive Digital Advertising, Rich Media Ads, Flash Ads, Online Advertising +0.0.0.0 www.falkag.de +0.0.0.0 www.family-offer.com +0.0.0.0 www.fast-adv.it +0.0.0.0 www.fatcatrewards.com +0.0.0.0 www.feedjit.com +0.0.0.0 www.feedstermedia.com +0.0.0.0 www.fif49.info +0.0.0.0 www.finance-offer.com +0.0.0.0 www.finder.cox.net +0.0.0.0 www.fineclicks.com +0.0.0.0 www.flagcounter.com +0.0.0.0 www.flowers-offer.com +0.0.0.0 www.flu23.com +0.0.0.0 www.focalex.com +0.0.0.0 www.folloyu.com +0.0.0.0 www.food-drink-bonuspath.com +0.0.0.0 www.food-drink-rewardpath.com +0.0.0.0 www.foodmixeroffer.com +0.0.0.0 www.food-offer.com +0.0.0.0 www.fpctraffic2.com +0.0.0.0 www.freeadguru.com +0.0.0.0 www.freebiegb.co.uk +0.0.0.0 www.freecameraonus.com +0.0.0.0 www.freecameraprovider.com +0.0.0.0 www.freecamerasource.com +0.0.0.0 www.freecamerauk.co.uk +0.0.0.0 www.freecamsecrets.com +0.0.0.0 www.freecoolgift.com +0.0.0.0 www.freedesignerhandbagreviews.com +0.0.0.0 www.freedinnersource.com +0.0.0.0 www.freedvddept.com +0.0.0.0 www.freeelectronicscenter.com +0.0.0.0 www.freeelectronicsdepot.com +0.0.0.0 www.freeelectronicsonus.com +0.0.0.0 www.freeelectronicssource.com +0.0.0.0 www.freeentertainmentsource.com +0.0.0.0 www.freefoodprovider.com +0.0.0.0 www.freefoodsource.com +0.0.0.0 www.freefuelcard.com +0.0.0.0 www.freefuelcoupon.com +0.0.0.0 www.freegasonus.com +0.0.0.0 www.freegasprovider.com +0.0.0.0 www.free-gift-cards-now.com +0.0.0.0 www.freegiftcardsource.com +0.0.0.0 www.freegiftreward.com +0.0.0.0 www.free-gifts-comp.com +0.0.0.0 www.freeipodnanouk.co.uk +0.0.0.0 www.freeipoduk.com +0.0.0.0 www.freeipoduk.co.uk +0.0.0.0 www.freelaptopgift.com +0.0.0.0 www.freelaptopnation.com +0.0.0.0 www.free-laptop-reward.com +0.0.0.0 www.freelaptopreward.com +0.0.0.0 www.freelaptopwebsites.com +0.0.0.0 www.freenation.com +0.0.0.0 www.freeoffers-toys.com +0.0.0.0 www.freepayasyougotopupuk.co.uk +0.0.0.0 www.freeplasmanation.com +0.0.0.0 www.freerestaurantprovider.com +0.0.0.0 www.freerestaurantsource.com +0.0.0.0 www.freeshoppingprovider.com +0.0.0.0 www.freeshoppingsource.com +0.0.0.0 www.friendlyduck.com +0.0.0.0 www.frontpagecash.com +0.0.0.0 www.ftjcfx.com #commission junction +0.0.0.0 www.fusionbanners.com +0.0.0.0 www.gameconsolerewards.com +0.0.0.0 www.games-toys-bonuspath.com +0.0.0.0 www.games-toys-free.com +0.0.0.0 www.games-toys-rewardpath.com +0.0.0.0 www.gatoradvertisinginformationnetwork.com +0.0.0.0 www.getacool100.com +0.0.0.0 www.getacool500.com +0.0.0.0 www.getacoollaptop.com +0.0.0.0 www.getacooltv.com +0.0.0.0 www.getagiftonline.com +0.0.0.0 www.getloan.com +0.0.0.0 www.getmyfreebabystuff.com +0.0.0.0 www.getmyfreegear.com +0.0.0.0 www.getmyfreegiftcard.com +0.0.0.0 www.getmyfreelaptop.com +0.0.0.0 www.getmyfreelaptophere.com +0.0.0.0 www.getmyfreeplasma.com +0.0.0.0 www.getmylaptopfree.com +0.0.0.0 www.getmyplasmatv.com +0.0.0.0 www.getspecialgifts.com +0.0.0.0 www.getyourfreecomputer.com +0.0.0.0 www.getyourfreetv.com +0.0.0.0 www.giftcardchallenge.com +0.0.0.0 www.giftcardsurveys.us.com +0.0.0.0 www.giftrewardzone.com +0.0.0.0 www.gifts-flowers-rewardpath.com +0.0.0.0 www.gimmethatreward.com +0.0.0.0 www.gmads.net +0.0.0.0 www.go-free-gifts.com +0.0.0.0 www.gofreegifts.com +0.0.0.0 www.goody-garage.com +0.0.0.0 www.gopopup.com +0.0.0.0 www.grabbit-rabbit.com +0.0.0.0 www.greasypalm.com +0.0.0.0 www.grz67.com +0.0.0.0 www.guesstheview.com +0.0.0.0 www.guptamedianetwork.com +0.0.0.0 www.happydiscountspecials.com +0.0.0.0 www.healthbeautyncs.com +0.0.0.0 www.health-beauty-rewardpath.com +0.0.0.0 www.health-beauty-savingblvd.com +0.0.0.0 www.healthclicks.co.uk +0.0.0.0 www.hebdotop.com +0.0.0.0 www.hightrafficads.com +0.0.0.0 www.holiday-gift-offers.com +0.0.0.0 www.holidayproductpromo.com +0.0.0.0 www.holidayshoppingrewards.com +0.0.0.0 www.home4bizstart.ru +0.0.0.0 www.homeelectronicproducts.com +0.0.0.0 www.home-garden-premiumblvd.com +0.0.0.0 www.home-garden-rewardempire.com +0.0.0.0 www.home-garden-rewardpath.com +0.0.0.0 www.hooqy.com +0.0.0.0 www.hot-daily-deal.com +0.0.0.0 www.hotgiftzone.com +0.0.0.0 www.hotkeys.com +0.0.0.0 www.hot-product-hangout.com +0.0.0.0 www.idealcasino.net +0.0.0.0 www.idirect.com +0.0.0.0 www.iicdn.com +0.0.0.0 www.ijacko.net +0.0.0.0 www.ilovecheating.com +0.0.0.0 www.impressionaffiliate.com +0.0.0.0 www.impressionaffiliate.mobi +0.0.0.0 www.impressionlead.com +0.0.0.0 www.impressionperformance.biz +0.0.0.0 www.incentivegateway.com +0.0.0.0 www.incentiverewardcenter.com +0.0.0.0 www.incentive-scene.com +0.0.0.0 www.inckamedia.com +0.0.0.0 www.indiads.com +0.0.0.0 www.infinite-ads.com # www.shareactor.com +0.0.0.0 www.ins-offer.com +0.0.0.0 www.insurance-rewardpath.com +0.0.0.0 www.intela.com +0.0.0.0 www.interstitialzone.com +0.0.0.0 www.intnet-offer.com +0.0.0.0 www.invitefashion.com +0.0.0.0 www.is1.clixgalore.com +0.0.0.0 www.itrackerpro.com +0.0.0.0 www.itsfree123.com +0.0.0.0 www.iwantmyfreecash.com +0.0.0.0 www.iwantmy-freelaptop.com +0.0.0.0 www.iwantmyfree-laptop.com +0.0.0.0 www.iwantmyfreelaptop.com +0.0.0.0 www.iwantmygiftcard.com +0.0.0.0 www.jersey-offer.com +0.0.0.0 www.jetseeker.com +0.0.0.0 www.jivox.com +0.0.0.0 www.jl29jd25sm24mc29.com +0.0.0.0 www.joinfree.ro +0.0.0.0 www.jxliu.com +0.0.0.0 www.keybinary.com +0.0.0.0 www.keywordblocks.com +0.0.0.0 www.kitaramarketplace.com +0.0.0.0 www.kitaramedia.com +0.0.0.0 www.kitaratrk.com +0.0.0.0 www.kixer.com +0.0.0.0 www.kliksaya.com +0.0.0.0 www.kmdl101.com +0.0.0.0 www.kontera.com +0.0.0.0 www.konversation.com +0.0.0.0 www.kreaffiliation.com +0.0.0.0 www.kuhdi.com +0.0.0.0 www.ladyclicks.ru +0.0.0.0 www.laptopreportcard.com +0.0.0.0 www.laptoprewards.com +0.0.0.0 www.laptoprewardsgroup.com +0.0.0.0 www.laptoprewardszone.com +0.0.0.0 www.larivieracasino.com +0.0.0.0 www.lasthr.info +0.0.0.0 www.lduhtrp.net #commission junction +0.0.0.0 www.le1er.net +0.0.0.0 www.leadgreed.com +0.0.0.0 www.learning-offer.com +0.0.0.0 www.legal-rewardpath.com +0.0.0.0 www.leisure-offer.com +0.0.0.0 www.linkhut.com +0.0.0.0 www.linkpulse.com +0.0.0.0 www.linkwithin.com +0.0.0.0 www.liveinternet.ru +0.0.0.0 www.lottoforever.com +0.0.0.0 www.lpcloudsvr302.com +0.0.0.0 www.lucky-day-uk.com +0.0.0.0 www.macombdisplayads.com +0.0.0.0 www.marketing-rewardpath.com +0.0.0.0 www.mastertracks.be +0.0.0.0 www.maxbounty.com +0.0.0.0 www.mb01.com +0.0.0.0 www.media2.travelzoo.com +0.0.0.0 www.media-motor.com +0.0.0.0 www.medical-offer.com +0.0.0.0 www.medical-rewardpath.com +0.0.0.0 www.merchantapp.com +0.0.0.0 www.merlin.co.il +0.0.0.0 www.mgid.com +0.0.0.0 www.mightymagoo.com +0.0.0.0 www.mktg-offer.com +0.0.0.0 www.mlntracker.com +0.0.0.0 www.mochibot.com +0.0.0.0 www.morefreecamsecrets.com +0.0.0.0 www.morevisits.info +0.0.0.0 www.mp3playersource.com +0.0.0.0 www.mpression.net +0.0.0.0 www.myadsl.co.za +0.0.0.0 www.myaffiliateprogram.com +0.0.0.0 www.myairbridge.com +0.0.0.0 www.mycashback.co.uk +0.0.0.0 www.mycelloffer.com +0.0.0.0 www.mychoicerewards.com +0.0.0.0 www.myexclusiverewards.com +0.0.0.0 www.myfreedinner.com +0.0.0.0 www.myfreegifts.co.uk +0.0.0.0 www.myfreemp3player.com +0.0.0.0 www.mygiftcardcenter.com +0.0.0.0 www.mygreatrewards.com +0.0.0.0 www.myoffertracking.com +0.0.0.0 www.my-reward-channel.com +0.0.0.0 www.my-rewardsvault.com +0.0.0.0 www.myseostats.com +0.0.0.0 www.my-stats.com +0.0.0.0 www.myuitm.com +0.0.0.0 www.myusersonline.com +0.0.0.0 www.na47.com +0.0.0.0 www.nationalissuepanel.com +0.0.0.0 www.nationalsurveypanel.com +0.0.0.0 www.nctracking.com +0.0.0.0 www.nearbyad.com +0.0.0.0 www.needadvertising.com +0.0.0.0 www.neptuneads.com +0.0.0.0 www.netpalnow.com +0.0.0.0 www.netpaloffers.net +0.0.0.0 www.news6health.com +0.0.0.0 www.newssourceoftoday.com +0.0.0.0 www.nospartenaires.com +0.0.0.0 www.nothing-but-value.com +0.0.0.0 www.nysubwayoffer.com +0.0.0.0 www.offerx.co.uk +0.0.0.0 www.oinadserve.com +0.0.0.0 www.onlinebestoffers.net +0.0.0.0 www.ontheweb.com +0.0.0.0 www.opendownload.de +0.0.0.0 www.openload.de +0.0.0.0 www.optiad.net +0.0.0.0 www.paperg.com +0.0.0.0 www.parsads.com +0.0.0.0 www.pathforpoints.com +0.0.0.0 www.paypopup.com +0.0.0.0 www.people-choice-sites.com +0.0.0.0 www.personalcare-offer.com +0.0.0.0 www.personalcashbailout.com +0.0.0.0 www.phoenixads.co.in +0.0.0.0 www.pick-savings.com +0.0.0.0 www.plasmatv4free.com +0.0.0.0 www.plasmatvreward.com +0.0.0.0 www.politicalopinionsurvey.com +0.0.0.0 www.poponclick.com +0.0.0.0 www.popupad.net +0.0.0.0 www.popupdomination.com +0.0.0.0 www.popuptraffic.com +0.0.0.0 www.postmasterbannernet.com +0.0.0.0 www.postmasterdirect.com +0.0.0.0 www.postnewsads.com +0.0.0.0 www.premiumholidayoffers.com +0.0.0.0 www.premiumproductsonline.com +0.0.0.0 www.premium-reward-club.com +0.0.0.0 www.prizes.co.uk +0.0.0.0 www.probabilidades.net +0.0.0.0 www.productopinionpanel.com +0.0.0.0 www.productresearchpanel.com +0.0.0.0 www.producttestpanel.com +0.0.0.0 www.psclicks.com +0.0.0.0 www.pubdirecte.com +0.0.0.0 www.qitrck.com +0.0.0.0 www.quickbrowsersearch.com +0.0.0.0 www.radiate.com +0.0.0.0 www.rankyou.com +0.0.0.0 www.ravel-rewardpath.com +0.0.0.0 www.recreation-leisure-rewardpath.com +0.0.0.0 www.regflow.com +0.0.0.0 www.registrarads.com +0.0.0.0 www.resolvingserver.com +0.0.0.0 www.rewardblvd.com +0.0.0.0 www.rewardhotspot.com +0.0.0.0 www.rewardsflow.com +0.0.0.0 www.ringtonepartner.com +0.0.0.0 www.romepartners.com +0.0.0.0 www.roulettebotplus.com +0.0.0.0 www.rovion.com +0.0.0.0 www.rscounter10.com +0.0.0.0 www.rtcode.com +0.0.0.0 www.rwpads.net +0.0.0.0 www.sa44.net +0.0.0.0 www.salesonline.ie +0.0.0.0 www.save-plan.com +0.0.0.0 www.savings-specials.com +0.0.0.0 www.savings-time.com +0.0.0.0 www.scoremygift.com +0.0.0.0 www.screen-mates.com +0.0.0.0 www.searchwe.com +0.0.0.0 www.seasonalsamplerspecials.com +0.0.0.0 www.securecontactinfo.com +0.0.0.0 www.securerunner.com +0.0.0.0 www.servedby.advertising.com +0.0.0.0 www.sexpartnerx.com +0.0.0.0 www.sexsponsors.com +0.0.0.0 www.shareasale.com +0.0.0.0 www.share-server.com +0.0.0.0 www.shc-rebates.com +0.0.0.0 www.shopperpromotions.com +0.0.0.0 www.shoppingjobshere.com +0.0.0.0 www.shopping-offer.com +0.0.0.0 www.shoppingsiterewards.com +0.0.0.0 www.shops-malls-rewardpath.com +0.0.0.0 www.shoptosaveenergy.com +0.0.0.0 www.simpli.fi +0.0.0.0 www.sizzle-savings.com +0.0.0.0 www.smartadserver.com +0.0.0.0 www.smart-scripts.com +0.0.0.0 www.smarttargetting.com +0.0.0.0 www.smokersopinionpoll.com +0.0.0.0 www.smspop.com +0.0.0.0 www.sochr.com +0.0.0.0 www.sociallypublish.com +0.0.0.0 www.soongu.info +0.0.0.0 www.specialgiftrewards.com +0.0.0.0 www.specialonlinegifts.com +0.0.0.0 www.specials-rewardpath.com +0.0.0.0 www.speedboink.com +0.0.0.0 www.speedyclick.com +0.0.0.0 www.spinbox.com +0.0.0.0 www.sponsorads.de +0.0.0.0 www.sponsoradulto.com +0.0.0.0 www.sports-bonuspath.com +0.0.0.0 www.sports-fitness-rewardpath.com +0.0.0.0 www.sports-offer.com +0.0.0.0 www.sports-offer.net +0.0.0.0 www.sports-premiumblvd.com +0.0.0.0 www.sq2trk2.com +0.0.0.0 www.star-advertising.com +0.0.0.0 www.subsitesadserver.co.uk +0.0.0.0 www.sudokuwhiz.com +0.0.0.0 www.superbrewards.com +0.0.0.0 www.supremeadsonline.com +0.0.0.0 www.surplus-suppliers.com +0.0.0.0 www.sweetsforfree.com +0.0.0.0 www.symbiosting.com +0.0.0.0 www.syncaccess.net +0.0.0.0 www.system-live-media.cz +0.0.0.0 www.tcimg.com +0.0.0.0 www.textbanners.net +0.0.0.0 www.text-link-ads.com +0.0.0.0 www.textsrv.com +0.0.0.0 www.tgpmanager.com +0.0.0.0 www.thatrendsystem.com +0.0.0.0 www.the-binary-options-guide.com +0.0.0.0 www.the-binary-theorem.com +0.0.0.0 www.the-path-gateway.com +0.0.0.0 www.the-smart-stop.com +0.0.0.0 www.thetraderinpajamas.com +0.0.0.0 www.theuseful.com +0.0.0.0 www.theuseful.net +0.0.0.0 www.thinktarget.com +0.0.0.0 www.thinlaptoprewards.com +0.0.0.0 www.thoughtfully-free.com +0.0.0.0 www.thruport.com +0.0.0.0 www.tons-to-see.com +0.0.0.0 www.top20free.com +0.0.0.0 www.topbrandrewards.com +0.0.0.0 www.topconsumergifts.com +0.0.0.0 www.topdemaroc.com +0.0.0.0 www.toy-offer.com +0.0.0.0 www.toy-offer.net +0.0.0.0 www.tqlkg.com #commission junction +0.0.0.0 www.trackadvertising.net +0.0.0.0 www.tracklead.net +0.0.0.0 www.trafficrevenue.net +0.0.0.0 www.traffictrader.net +0.0.0.0 www.traffictraders.com +0.0.0.0 www.trafsearchonline.com +0.0.0.0 www.traktum.com +0.0.0.0 www.traveladvertising.com +0.0.0.0 www.travel-leisure-bonuspath.com +0.0.0.0 www.travel-leisure-premiumblvd.com +0.0.0.0 www.traveller-offer.com +0.0.0.0 www.traveller-offer.net +0.0.0.0 www.travelncs.com +0.0.0.0 www.treeloot.com +0.0.0.0 www.trendnews.com +0.0.0.0 www.trendsonline.biz +0.0.0.0 www.trendsonline.me +0.0.0.0 www.trendsonline.mobi +0.0.0.0 www.trndsys.mobi +0.0.0.0 www.tutop.com +0.0.0.0 www.tuttosessogratis.org +0.0.0.0 www.ukbanners.com +0.0.0.0 www.uleadstrk.com +0.0.0.0 www.ultimatefashiongifts.com +0.0.0.0 www.uproar.com +0.0.0.0 www.upsellit.com +0.0.0.0 www.usatravel-specials.com +0.0.0.0 www.usatravel-specials.net +0.0.0.0 www.us-choicevalue.com +0.0.0.0 www.usemax.de +0.0.0.0 www.us-topsites.com +0.0.0.0 www.utarget.co.uk +0.0.0.0 www.valueclick.com +0.0.0.0 www.via22.net +0.0.0.0 www.vibrantmedia.com +0.0.0.0 www.video-game-rewards-central.com +0.0.0.0 www.videogamerewardscentral.com +0.0.0.0 www.view4cash.de +0.0.0.0 www.virtumundo.com +0.0.0.0 www.vmcsatellite.com +0.0.0.0 www.wdm29.com +0.0.0.0 www.webcashvideos.com +0.0.0.0 www.webcompteur.com +0.0.0.0 www.webservices-rewardpath.com +0.0.0.0 www.websponsors.com +0.0.0.0 www.wegetpaid.net +0.0.0.0 www.whatuwhatuwhatuwant.com +0.0.0.0 www.widgetbucks.com +0.0.0.0 www.wigetmedia.com +0.0.0.0 www.williamhill.es +0.0.0.0 www.windaily.com +0.0.0.0 www.winnerschoiceservices.com +0.0.0.0 www.wordplaywhiz.com +0.0.0.0 www.work-offer.com +0.0.0.0 www.worry-free-savings.com +0.0.0.0 www.wppluginspro.com +0.0.0.0 www.wtp101.com +0.0.0.0 www.xbn.ru # exclusive banner network (Russian) +0.0.0.0 www.yceml.net +0.0.0.0 www.yibaruxet.cn +0.0.0.0 www.yieldmanager.net +0.0.0.0 www.youfck.com +0.0.0.0 www.yourdvdplayer.com +0.0.0.0 www.yourfreegascard.com +0.0.0.0 www.yourgascards.com +0.0.0.0 www.yourgiftrewards.com +0.0.0.0 www.your-gift-zone.com +0.0.0.0 www.yourgiftzone.com +0.0.0.0 www.yourhandytips.com +0.0.0.0 www.yourhotgiftzone.com +0.0.0.0 www.youripad4free.com +0.0.0.0 www.yourrewardzone.com +0.0.0.0 www.yoursmartrewards.com +0.0.0.0 www.zemgo.com +0.0.0.0 www.zevents.com +0.0.0.0 x86adserve006.adtech.de +0.0.0.0 xads.zedo.com +0.0.0.0 x.azjmp.com +0.0.0.0 x.iasrv.com +0.0.0.0 x.interia.pl +0.0.0.0 xlonhcld.xlontech.net +0.0.0.0 xml.adtech.de +0.0.0.0 xml.adtech.fr +0.0.0.0 xml.adtech.us +0.0.0.0 xml.click9.com +0.0.0.0 x.mochiads.com +0.0.0.0 xpantivirus.com +0.0.0.0 xpcs.ads.yahoo.com +0.0.0.0 xstatic.nk-net.pl +0.0.0.0 yadro.ru +0.0.0.0 y.cdn.adblade.com +0.0.0.0 yieldmanagement.adbooth.net +0.0.0.0 yieldmanager.net +0.0.0.0 ym.adnxs.com +0.0.0.0 yodleeinc.tt.omtrdc.net +0.0.0.0 youfck.com +0.0.0.0 yourdvdplayer.com +0.0.0.0 yourfreegascard.com +0.0.0.0 your-free-iphone.com +0.0.0.0 yourgascards.com +0.0.0.0 yourgiftrewards.com +0.0.0.0 your-gift-zone.com +0.0.0.0 yourgiftzone.com +0.0.0.0 yourhandytips.com +0.0.0.0 yourhotgiftzone.com +0.0.0.0 youripad4free.com +0.0.0.0 yourrewardzone.com +0.0.0.0 yoursmartrewards.com +0.0.0.0 ypn-js.overture.com +0.0.0.0 ysiu.freenation.com +0.0.0.0 ytaahg.vo.llnwd.net +0.0.0.0 yumenetworks.com +0.0.0.0 yx-in-f108.1e100.net +0.0.0.0 z1.adserver.com +0.0.0.0 zads.zedo.com +0.0.0.0 z.blogads.com +0.0.0.0 z.ceotrk.com +0.0.0.0 zdads.e-media.com +0.0.0.0 zeevex-online.com +0.0.0.0 zemgo.com +0.0.0.0 zevents.com +0.0.0.0 zuzzer5.com +# + +# + +# yahoo banner ads +0.0.0.0 eur.a1.yimg.com +0.0.0.0 in.yimg.com +0.0.0.0 sg.yimg.com +0.0.0.0 uk.i1.yimg.com +0.0.0.0 us.a1.yimg.com +0.0.0.0 us.b1.yimg.com +0.0.0.0 us.c1.yimg.com +0.0.0.0 us.d1.yimg.com +0.0.0.0 us.e1.yimg.com +0.0.0.0 us.f1.yimg.com +0.0.0.0 us.g1.yimg.com +0.0.0.0 us.h1.yimg.com +#0.0.0.0 us.i1.yimg.com #Uncomment this to block yahoo images +0.0.0.0 us.j1.yimg.com +0.0.0.0 us.k1.yimg.com +0.0.0.0 us.l1.yimg.com +0.0.0.0 us.m1.yimg.com +0.0.0.0 us.n1.yimg.com +0.0.0.0 us.o1.yimg.com +0.0.0.0 us.p1.yimg.com +0.0.0.0 us.q1.yimg.com +0.0.0.0 us.r1.yimg.com +0.0.0.0 us.s1.yimg.com +0.0.0.0 us.t1.yimg.com +0.0.0.0 us.u1.yimg.com +0.0.0.0 us.v1.yimg.com +0.0.0.0 us.w1.yimg.com +0.0.0.0 us.x1.yimg.com +0.0.0.0 us.y1.yimg.com +0.0.0.0 us.z1.yimg.com +# + +# + +# hitbox.com web bugs +0.0.0.0 1cgi.hitbox.com +0.0.0.0 2cgi.hitbox.com +0.0.0.0 adminec1.hitbox.com +0.0.0.0 ads.hitbox.com +0.0.0.0 ag1.hitbox.com +0.0.0.0 ahbn1.hitbox.com +0.0.0.0 ahbn2.hitbox.com +0.0.0.0 ahbn3.hitbox.com +0.0.0.0 ahbn4.hitbox.com +0.0.0.0 aibg.hitbox.com +0.0.0.0 aibl.hitbox.com +0.0.0.0 aics.hitbox.com +0.0.0.0 ai.hitbox.com +0.0.0.0 aiui.hitbox.com +0.0.0.0 bigip1.hitbox.com +0.0.0.0 bigip2.hitbox.com +0.0.0.0 blowfish.hitbox.com +0.0.0.0 cdb.hitbox.com +0.0.0.0 cgi.hitbox.com +0.0.0.0 counter2.hitbox.com +0.0.0.0 counter.hitbox.com +0.0.0.0 dev101.hitbox.com +0.0.0.0 dev102.hitbox.com +0.0.0.0 dev103.hitbox.com +0.0.0.0 dev.hitbox.com +0.0.0.0 download.hitbox.com +0.0.0.0 ec1.hitbox.com +0.0.0.0 ehg-247internet.hitbox.com +0.0.0.0 ehg-accuweather.hitbox.com +0.0.0.0 ehg-acdsystems.hitbox.com +0.0.0.0 ehg-adeptscience.hitbox.com +0.0.0.0 ehg-affinitynet.hitbox.com +0.0.0.0 ehg-aha.hitbox.com +0.0.0.0 ehg-amerix.hitbox.com +0.0.0.0 ehg-apcc.hitbox.com +0.0.0.0 ehg-associatenewmedia.hitbox.com +0.0.0.0 ehg-ati.hitbox.com +0.0.0.0 ehg-attenza.hitbox.com +0.0.0.0 ehg-autodesk.hitbox.com +0.0.0.0 ehg-baa.hitbox.com +0.0.0.0 ehg-backweb.hitbox.com +0.0.0.0 ehg-bestbuy.hitbox.com +0.0.0.0 ehg-bizjournals.hitbox.com +0.0.0.0 ehg-bmwna.hitbox.com +0.0.0.0 ehg-boschsiemens.hitbox.com +0.0.0.0 ehg-bskyb.hitbox.com +0.0.0.0 ehg-cafepress.hitbox.com +0.0.0.0 ehg-careerbuilder.hitbox.com +0.0.0.0 ehg-cbc.hitbox.com +0.0.0.0 ehg-cbs.hitbox.com +0.0.0.0 ehg-cbsradio.hitbox.com +0.0.0.0 ehg-cedarpoint.hitbox.com +0.0.0.0 ehg-clearchannel.hitbox.com +0.0.0.0 ehg-closetmaid.hitbox.com +0.0.0.0 ehg-commjun.hitbox.com +0.0.0.0 ehg.commjun.hitbox.com +0.0.0.0 ehg-communityconnect.hitbox.com +0.0.0.0 ehg-communityconnet.hitbox.com +0.0.0.0 ehg-comscore.hitbox.com +0.0.0.0 ehg-corusentertainment.hitbox.com +0.0.0.0 ehg-coverityinc.hitbox.com +0.0.0.0 ehg-crain.hitbox.com +0.0.0.0 ehg-ctv.hitbox.com +0.0.0.0 ehg-cygnusbm.hitbox.com +0.0.0.0 ehg-datamonitor.hitbox.com +0.0.0.0 ehg-digg.hitbox.com +0.0.0.0 ehg-dig.hitbox.com +0.0.0.0 ehg-eckounlimited.hitbox.com +0.0.0.0 ehg-esa.hitbox.com +0.0.0.0 ehg-espn.hitbox.com +0.0.0.0 ehg-fifa.hitbox.com +0.0.0.0 ehg-findlaw.hitbox.com +0.0.0.0 ehg-foundation.hitbox.com +0.0.0.0 ehg-foxsports.hitbox.com +0.0.0.0 ehg-futurepub.hitbox.com +0.0.0.0 ehg-gamedaily.hitbox.com +0.0.0.0 ehg-gamespot.hitbox.com +0.0.0.0 ehg-gatehousemedia.hitbox.com +0.0.0.0 ehg-gatehoussmedia.hitbox.com +0.0.0.0 ehg-glam.hitbox.com +0.0.0.0 ehg-groceryworks.hitbox.com +0.0.0.0 ehg-groupernetworks.hitbox.com +0.0.0.0 ehg-guardian.hitbox.com +0.0.0.0 ehg-hasbro.hitbox.com +0.0.0.0 ehg-hellodirect.hitbox.com +0.0.0.0 ehg-himedia.hitbox.com +0.0.0.0 ehg.hitbox.com +0.0.0.0 ehg-hitent.hitbox.com +0.0.0.0 ehg-hollywood.hitbox.com +0.0.0.0 ehg-idgentertainment.hitbox.com +0.0.0.0 ehg-idg.hitbox.com +0.0.0.0 ehg-ifilm.hitbox.com +0.0.0.0 ehg-ignitemedia.hitbox.com +0.0.0.0 ehg-intel.hitbox.com +0.0.0.0 ehg-ittoolbox.hitbox.com +0.0.0.0 ehg-itworldcanada.hitbox.com +0.0.0.0 ehg-kingstontechnology.hitbox.com +0.0.0.0 ehg-knightridder.hitbox.com +0.0.0.0 ehg-learningco.hitbox.com +0.0.0.0 ehg-legonewyorkinc.hitbox.com +0.0.0.0 ehg-liveperson.hitbox.com +0.0.0.0 ehg-macpublishingllc.hitbox.com +0.0.0.0 ehg-macromedia.hitbox.com +0.0.0.0 ehg-magicalia.hitbox.com +0.0.0.0 ehg-maplesoft.hitbox.com +0.0.0.0 ehg-mgnlimited.hitbox.com +0.0.0.0 ehg-mindshare.hitbox.com +0.0.0.0 ehg.mindshare.hitbox.com +0.0.0.0 ehg-mtv.hitbox.com +0.0.0.0 ehg-mybc.hitbox.com +0.0.0.0 ehg-newarkinone.hitbox.com.hitbox.com +0.0.0.0 ehg-newegg.hitbox.com +0.0.0.0 ehg-newscientist.hitbox.com +0.0.0.0 ehg-newsinternational.hitbox.com +0.0.0.0 ehg-nokiafin.hitbox.com +0.0.0.0 ehg-novell.hitbox.com +0.0.0.0 ehg-nvidia.hitbox.com +0.0.0.0 ehg-oreilley.hitbox.com +0.0.0.0 ehg-oreilly.hitbox.com +0.0.0.0 ehg-pacifictheatres.hitbox.com +0.0.0.0 ehg-pennwell.hitbox.com +0.0.0.0 ehg-peoplesoft.hitbox.com +0.0.0.0 ehg-philipsvheusen.hitbox.com +0.0.0.0 ehg-pizzahut.hitbox.com +0.0.0.0 ehg-playboy.hitbox.com +0.0.0.0 ehg-presentigsolutions.hitbox.com +0.0.0.0 ehg-qualcomm.hitbox.com +0.0.0.0 ehg-quantumcorp.hitbox.com +0.0.0.0 ehg-randomhouse.hitbox.com +0.0.0.0 ehg-redherring.hitbox.com +0.0.0.0 ehg-register.hitbox.com +0.0.0.0 ehg-researchinmotion.hitbox.com +0.0.0.0 ehg-rfa.hitbox.com +0.0.0.0 ehg-rodale.hitbox.com +0.0.0.0 ehg-salesforce.hitbox.com +0.0.0.0 ehg-salonmedia.hitbox.com +0.0.0.0 ehg-samsungusa.hitbox.com +0.0.0.0 ehg-seca.hitbox.com +0.0.0.0 ehg-shoppersdrugmart.hitbox.com +0.0.0.0 ehg-sonybssc.hitbox.com +0.0.0.0 ehg-sonycomputer.hitbox.com +0.0.0.0 ehg-sonyelec.hitbox.com +0.0.0.0 ehg-sonymusic.hitbox.com +0.0.0.0 ehg-sonyny.hitbox.com +0.0.0.0 ehg-space.hitbox.com +0.0.0.0 ehg-sportsline.hitbox.com +0.0.0.0 ehg-streamload.hitbox.com +0.0.0.0 ehg-superpages.hitbox.com +0.0.0.0 ehg-techtarget.hitbox.com +0.0.0.0 ehg-tfl.hitbox.com +0.0.0.0 ehg-thefirstchurchchrist.hitbox.com +0.0.0.0 ehg-tigerdirect2.hitbox.com +0.0.0.0 ehg-tigerdirect.hitbox.com +0.0.0.0 ehg-topps.hitbox.com +0.0.0.0 ehg-tribute.hitbox.com +0.0.0.0 ehg-tumbleweed.hitbox.com +0.0.0.0 ehg-ubisoft.hitbox.com +0.0.0.0 ehg-uniontrib.hitbox.com +0.0.0.0 ehg-usnewsworldreport.hitbox.com +0.0.0.0 ehg-verizoncommunications.hitbox.com +0.0.0.0 ehg-viacom.hitbox.com +0.0.0.0 ehg-vmware.hitbox.com +0.0.0.0 ehg-vonage.hitbox.com +0.0.0.0 ehg-wachovia.hitbox.com +0.0.0.0 ehg-wacomtechnology.hitbox.com +0.0.0.0 ehg-warner-brothers.hitbox.com +0.0.0.0 ehg-wizardsofthecoast.hitbox.com.hitbox.com +0.0.0.0 ehg-womanswallstreet.hitbox.com +0.0.0.0 ehg-wss.hitbox.com +0.0.0.0 ehg-xxolympicwintergames.hitbox.com +0.0.0.0 ehg-yellowpages.hitbox.com +0.0.0.0 ehg-youtube.hitbox.com +0.0.0.0 ejs.hitbox.com +0.0.0.0 enterprise-admin.hitbox.com +0.0.0.0 enterprise.hitbox.com +0.0.0.0 esg.hitbox.com +0.0.0.0 evwr.hitbox.com +0.0.0.0 get.hitbox.com +0.0.0.0 hg10.hitbox.com +0.0.0.0 hg11.hitbox.com +0.0.0.0 hg12.hitbox.com +0.0.0.0 hg13.hitbox.com +0.0.0.0 hg14.hitbox.com +0.0.0.0 hg15.hitbox.com +0.0.0.0 hg16.hitbox.com +0.0.0.0 hg17.hitbox.com +0.0.0.0 hg1.hitbox.com +0.0.0.0 hg2.hitbox.com +0.0.0.0 hg3.hitbox.com +0.0.0.0 hg4.hitbox.com +0.0.0.0 hg5.hitbox.com +0.0.0.0 hg6a.hitbox.com +0.0.0.0 hg6.hitbox.com +0.0.0.0 hg7.hitbox.com +0.0.0.0 hg8.hitbox.com +0.0.0.0 hg9.hitbox.com +0.0.0.0 hitboxbenchmarker.com +0.0.0.0 hitboxcentral.com +0.0.0.0 hitbox.com +0.0.0.0 hitboxenterprise.com +0.0.0.0 hitboxwireless.com +0.0.0.0 host6.hitbox.com +0.0.0.0 ias2.hitbox.com +0.0.0.0 ias.hitbox.com +0.0.0.0 ibg.hitbox.com +0.0.0.0 ics.hitbox.com +0.0.0.0 idb.hitbox.com +0.0.0.0 js1.hitbox.com +0.0.0.0 lb.hitbox.com +0.0.0.0 lesbian-erotica.hitbox.com +0.0.0.0 lookup2.hitbox.com +0.0.0.0 lookup.hitbox.com +0.0.0.0 mrtg.hitbox.com +0.0.0.0 myhitbox.com +0.0.0.0 na.hitbox.com +0.0.0.0 narwhal.hitbox.com +0.0.0.0 nei.hitbox.com +0.0.0.0 nocboard.hitbox.com +0.0.0.0 noc.hitbox.com +0.0.0.0 noc-request.hitbox.com +0.0.0.0 ns1.hitbox.com +0.0.0.0 oas.hitbox.com +0.0.0.0 phg.hitbox.com +0.0.0.0 pure.hitbox.com +0.0.0.0 rainbowclub.hitbox.com +0.0.0.0 rd1.hitbox.com +0.0.0.0 reseller.hitbox.com +0.0.0.0 resources.hitbox.com +0.0.0.0 sitesearch.hitbox.com +0.0.0.0 specialtyclub.hitbox.com +0.0.0.0 ss.hitbox.com +0.0.0.0 stage101.hitbox.com +0.0.0.0 stage102.hitbox.com +0.0.0.0 stage103.hitbox.com +0.0.0.0 stage104.hitbox.com +0.0.0.0 stage105.hitbox.com +0.0.0.0 stage.hitbox.com +0.0.0.0 stats2.hitbox.com +0.0.0.0 stats3.hitbox.com +0.0.0.0 stats.hitbox.com +0.0.0.0 switch10.hitbox.com +0.0.0.0 switch11.hitbox.com +0.0.0.0 switch1.hitbox.com +0.0.0.0 switch5.hitbox.com +0.0.0.0 switch6.hitbox.com +0.0.0.0 switch8.hitbox.com +0.0.0.0 switch9.hitbox.com +0.0.0.0 switch.hitbox.com +0.0.0.0 tetra.hitbox.com +0.0.0.0 tools2.hitbox.com +0.0.0.0 toolsa.hitbox.com +0.0.0.0 tools.hitbox.com +0.0.0.0 ts1.hitbox.com +0.0.0.0 ts2.hitbox.com +0.0.0.0 vwr1.hitbox.com +0.0.0.0 vwr2.hitbox.com +0.0.0.0 vwr3.hitbox.com +0.0.0.0 w100.hitbox.com +0.0.0.0 w101.hitbox.com +0.0.0.0 w102.hitbox.com +0.0.0.0 w103.hitbox.com +0.0.0.0 w104.hitbox.com +0.0.0.0 w105.hitbox.com +0.0.0.0 w106.hitbox.com +0.0.0.0 w107.hitbox.com +0.0.0.0 w108.hitbox.com +0.0.0.0 w109.hitbox.com +0.0.0.0 w10.hitbox.com +0.0.0.0 w110.hitbox.com +0.0.0.0 w111.hitbox.com +0.0.0.0 w112.hitbox.com +0.0.0.0 w113.hitbox.com +0.0.0.0 w114.hitbox.com +0.0.0.0 w115.hitbox.com +0.0.0.0 w116.hitbox.com +0.0.0.0 w117.hitbox.com +0.0.0.0 w118.hitbox.com +0.0.0.0 w119.hitbox.com +0.0.0.0 w11.hitbox.com +0.0.0.0 w120.hitbox.com +0.0.0.0 w121.hitbox.com +0.0.0.0 w122.hitbox.com +0.0.0.0 w123.hitbox.com +0.0.0.0 w124.hitbox.com +0.0.0.0 w126.hitbox.com +0.0.0.0 w128.hitbox.com +0.0.0.0 w129.hitbox.com +0.0.0.0 w12.hitbox.com +0.0.0.0 w130.hitbox.com +0.0.0.0 w131.hitbox.com +0.0.0.0 w132.hitbox.com +0.0.0.0 w133.hitbox.com +0.0.0.0 w135.hitbox.com +0.0.0.0 w136.hitbox.com +0.0.0.0 w137.hitbox.com +0.0.0.0 w138.hitbox.com +0.0.0.0 w139.hitbox.com +0.0.0.0 w13.hitbox.com +0.0.0.0 w140.hitbox.com +0.0.0.0 w141.hitbox.com +0.0.0.0 w144.hitbox.com +0.0.0.0 w147.hitbox.com +0.0.0.0 w14.hitbox.com +0.0.0.0 w153.hitbox.com +0.0.0.0 w154.hitbox.com +0.0.0.0 w155.hitbox.com +0.0.0.0 w157.hitbox.com +0.0.0.0 w159.hitbox.com +0.0.0.0 w15.hitbox.com +0.0.0.0 w161.hitbox.com +0.0.0.0 w162.hitbox.com +0.0.0.0 w167.hitbox.com +0.0.0.0 w168.hitbox.com +0.0.0.0 w16.hitbox.com +0.0.0.0 w170.hitbox.com +0.0.0.0 w175.hitbox.com +0.0.0.0 w177.hitbox.com +0.0.0.0 w179.hitbox.com +0.0.0.0 w17.hitbox.com +0.0.0.0 w18.hitbox.com +0.0.0.0 w19.hitbox.com +0.0.0.0 w1.hitbox.com +0.0.0.0 w20.hitbox.com +0.0.0.0 w21.hitbox.com +0.0.0.0 w22.hitbox.com +0.0.0.0 w23.hitbox.com +0.0.0.0 w24.hitbox.com +0.0.0.0 w25.hitbox.com +0.0.0.0 w26.hitbox.com +0.0.0.0 w27.hitbox.com +0.0.0.0 w28.hitbox.com +0.0.0.0 w29.hitbox.com +0.0.0.0 w2.hitbox.com +0.0.0.0 w30.hitbox.com +0.0.0.0 w31.hitbox.com +0.0.0.0 w32.hitbox.com +0.0.0.0 w33.hitbox.com +0.0.0.0 w34.hitbox.com +0.0.0.0 w35.hitbox.com +0.0.0.0 w36.hitbox.com +0.0.0.0 w3.hitbox.com +0.0.0.0 w4.hitbox.com +0.0.0.0 w5.hitbox.com +0.0.0.0 w6.hitbox.com +0.0.0.0 w7.hitbox.com +0.0.0.0 w8.hitbox.com +0.0.0.0 w9.hitbox.com +0.0.0.0 webload101.hitbox.com +0.0.0.0 wss-gw-1.hitbox.com +0.0.0.0 wss-gw-3.hitbox.com +0.0.0.0 wvwr1.hitbox.com +0.0.0.0 ww1.hitbox.com +0.0.0.0 ww2.hitbox.com +0.0.0.0 ww3.hitbox.com +0.0.0.0 wwa.hitbox.com +0.0.0.0 wwb.hitbox.com +0.0.0.0 wwc.hitbox.com +0.0.0.0 wwd.hitbox.com +0.0.0.0 www.ehg-rr.hitbox.com +0.0.0.0 www.hitbox.com +0.0.0.0 www.hitboxwireless.com +0.0.0.0 y2k.hitbox.com +0.0.0.0 yang.hitbox.com +0.0.0.0 ying.hitbox.com +# + +# + +# www.extreme-dm.com tracking +0.0.0.0 extreme-dm.com +0.0.0.0 reports.extreme-dm.com +0.0.0.0 t0.extreme-dm.com +0.0.0.0 t1.extreme-dm.com +0.0.0.0 t.extreme-dm.com +0.0.0.0 u0.extreme-dm.com +0.0.0.0 u1.extreme-dm.com +0.0.0.0 u.extreme-dm.com +0.0.0.0 v0.extreme-dm.com +0.0.0.0 v1.extreme-dm.com +0.0.0.0 v.extreme-dm.com +0.0.0.0 w0.extreme-dm.com +0.0.0.0 w1.extreme-dm.com +0.0.0.0 w2.extreme-dm.com +0.0.0.0 w3.extreme-dm.com +0.0.0.0 w4.extreme-dm.com +0.0.0.0 w5.extreme-dm.com +0.0.0.0 w6.extreme-dm.com +0.0.0.0 w7.extreme-dm.com +0.0.0.0 w8.extreme-dm.com +0.0.0.0 w9.extreme-dm.com +0.0.0.0 w.extreme-dm.com +0.0.0.0 www.extreme-dm.com +0.0.0.0 x3.extreme-dm.com +0.0.0.0 y0.extreme-dm.com +0.0.0.0 y1.extreme-dm.com +0.0.0.0 y.extreme-dm.com +0.0.0.0 z0.extreme-dm.com +0.0.0.0 z1.extreme-dm.com +0.0.0.0 z.extreme-dm.com +# + +# + +# realmedia.com's Open Ad Stream +0.0.0.0 ap.oasfile.aftenposten.no +0.0.0.0 imagenen1.247realmedia.com +0.0.0.0 oacentral.cepro.com +0.0.0.0 oas.adx.nu +0.0.0.0 oas.aurasports.com +0.0.0.0 oas.benchmark.fr +0.0.0.0 oasc03012.247realmedia.com +0.0.0.0 oasc03049.247realmedia.com +0.0.0.0 oasc06006.247realmedia.com +0.0.0.0 oasc08008.247realmedia.com +0.0.0.0 oasc09.247realmedia.com +0.0.0.0 oascentral.123greetings.com +0.0.0.0 oascentral.abclocal.go.com +0.0.0.0 oascentral.adage.com +0.0.0.0 oascentral.adageglobal.com +0.0.0.0 oascentral.aircanada.com +0.0.0.0 oascentral.alanicnewsnet.ca +0.0.0.0 oascentral.alanticnewsnet.ca +0.0.0.0 oascentral.americanheritage.com +0.0.0.0 oascentral.artistdirect.com +0.0.0.0 oascentral.artistirect.com +0.0.0.0 oascentral.askmen.com +0.0.0.0 oascentral.aviationnow.com +0.0.0.0 oascentral.blackenterprises.com +0.0.0.0 oascentral.blogher.org +0.0.0.0 oascentral.bostonherald.com +0.0.0.0 oascentral.bostonphoenix.com +0.0.0.0 oascentral.businessinsider.com +0.0.0.0 oascentral.businessweek.com +0.0.0.0 oascentral.businessweeks.com +0.0.0.0 oascentral.buy.com +0.0.0.0 oascentral.canadaeast.com +0.0.0.0 oascentral.canadianliving.com +0.0.0.0 oascentral.charleston.net +0.0.0.0 oascentral.chicagobusiness.com +0.0.0.0 oascentral.chron.com +0.0.0.0 oascentral.citypages.com +0.0.0.0 oascentral.clearchannel.com +0.0.0.0 oascentral.comcast.net +0.0.0.0 oascentral.comics.com +0.0.0.0 oascentral.construction.com +0.0.0.0 oascentral.consumerreports.org +0.0.0.0 oascentral.covers.com +0.0.0.0 oascentral.crainsdetroit.com +0.0.0.0 oascentral.crimelibrary.com +0.0.0.0 oascentral.cybereps.com +0.0.0.0 oascentral.dailybreeze.com +0.0.0.0 oascentral.dailyherald.com +0.0.0.0 oascentral.dilbert.com +0.0.0.0 oascentral.discovery.com +0.0.0.0 oascentral.drphil.com +0.0.0.0 oascentral.eastbayexpress.com +0.0.0.0 oas-central.east.realmedia.com +0.0.0.0 oascentral.encyclopedia.com +0.0.0.0 oascentral.fashionmagazine.com +0.0.0.0 oascentral.fayettevillenc.com +0.0.0.0 oascentral.feedroom.com +0.0.0.0 oascentral.forsythnews.com +0.0.0.0 oascentral.fortunecity.com +0.0.0.0 oascentral.foxnews.com +0.0.0.0 oascentral.freedom.com +0.0.0.0 oascentral.g4techtv.com +0.0.0.0 oascentral.ggl.com +0.0.0.0 oascentral.gigex.com +0.0.0.0 oascentral.globalpost.com +0.0.0.0 oascentral.hamptonroads.com +0.0.0.0 oascentral.hamptoroads.com +0.0.0.0 oascentral.hamtoroads.com +0.0.0.0 oascentral.herenb.com +0.0.0.0 oascentral.hollywood.com +0.0.0.0 oascentral.houstonpress.com +0.0.0.0 oascentral.inq7.net +0.0.0.0 oascentral.investors.com +0.0.0.0 oascentral.investorwords.com +0.0.0.0 oascentral.itbusiness.ca +0.0.0.0 oascentral.killsometime.com +0.0.0.0 oascentral.laptopmag.com +0.0.0.0 oascentral.law.com +0.0.0.0 oascentral.laweekly.com +0.0.0.0 oascentral.looksmart.com +0.0.0.0 oascentral.lycos.com +0.0.0.0 oascentral.mailtribune.com +0.0.0.0 oascentral.mayoclinic.com +0.0.0.0 oascentral.medbroadcast.com +0.0.0.0 oascentral.metro.us +0.0.0.0 oascentral.minnpost.com +0.0.0.0 oascentral.mochila.com +0.0.0.0 oascentral.motherjones.com +0.0.0.0 oascentral.nerve.com +0.0.0.0 oascentral.newsmax.com +0.0.0.0 oascentral.nowtoronto.com +0.0.0.0 oascentralnx.comcast.net +0.0.0.0 oascentral.onwisconsin.com +0.0.0.0 oascentral.phoenixnewtimes.com +0.0.0.0 oascentral.phoenixvillenews.com +0.0.0.0 oascentral.pitch.com +0.0.0.0 oascentral.poconorecord.com +0.0.0.0 oascentral.politico.com +0.0.0.0 oascentral.post-gazette.com +0.0.0.0 oascentral.pottsmerc.com +0.0.0.0 oascentral.princetonreview.com +0.0.0.0 oascentral.publicradio.org +0.0.0.0 oascentral.radaronline.com +0.0.0.0 oascentral.rcrnews.com +0.0.0.0 oas-central.realmedia.com +0.0.0.0 oascentral.redherring.com +0.0.0.0 oascentral.redorbit.com +0.0.0.0 oascentral.redstate.com +0.0.0.0 oascentral.reference.com +0.0.0.0 oascentral.regalinterative.com +0.0.0.0 oascentral.register.com +0.0.0.0 oascentral.registerguard.com +0.0.0.0 oascentral.registguard.com +0.0.0.0 oascentral.riverfronttimes.com +0.0.0.0 oascentral.salon.com +0.0.0.0 oascentral.santacruzsentinel.com +0.0.0.0 oascentral.sciam.com +0.0.0.0 oascentral.scientificamerican.com +0.0.0.0 oascentral.seacoastonline.com +0.0.0.0 oascentral.seattleweekly.com +0.0.0.0 oascentral.sfgate.com +0.0.0.0 oascentral.sfweekly.com +0.0.0.0 oascentral.sina.com +0.0.0.0 oascentral.sina.com.hk +0.0.0.0 oascentral.sparknotes.com +0.0.0.0 oascentral.sptimes.com +0.0.0.0 oascentral.starbulletin.com +0.0.0.0 oascentral.suntimes.com +0.0.0.0 oascentral.surfline.com +0.0.0.0 oascentral.thechronicleherald.ca +0.0.0.0 oascentral.thehockeynews.com +0.0.0.0 oascentral.thenation.com +0.0.0.0 oascentral.theonionavclub.com +0.0.0.0 oascentral.theonion.com +0.0.0.0 oascentral.thephoenix.com +0.0.0.0 oascentral.thesmokinggun.com +0.0.0.0 oascentral.thespark.com +0.0.0.0 oascentral.tmcnet.com +0.0.0.0 oascentral.tnr.com +0.0.0.0 oascentral.tourismvancouver.com +0.0.0.0 oascentral.townhall.com +0.0.0.0 oascentral.tribe.net +0.0.0.0 oascentral.trutv.com +0.0.0.0 oascentral.upi.com +0.0.0.0 oascentral.urbanspoon.com +0.0.0.0 oascentral.villagevoice.com +0.0.0.0 oascentral.virtualtourist.com +0.0.0.0 oascentral.warcry.com +0.0.0.0 oascentral.washtimes.com +0.0.0.0 oascentral.wciv.com +0.0.0.0 oascentral.westword.com +0.0.0.0 oascentral.where.ca +0.0.0.0 oascentral.wjla.com +0.0.0.0 oascentral.wkrn.com +0.0.0.0 oascentral.wwe.com +0.0.0.0 oascentral.yellowpages.com +0.0.0.0 oascentral.ywlloewpages.ca +0.0.0.0 oascentral.zwire.com +0.0.0.0 oascentreal.adcritic.com +0.0.0.0 oascetral.laweekly.com +0.0.0.0 oas.dispatch.com +0.0.0.0 oas.foxnews.com +0.0.0.0 oas.greensboro.com +0.0.0.0 oas.guardian.co.uk +0.0.0.0 oas.ibnlive.com +0.0.0.0 oas.lee.net +0.0.0.0 oas.nrjlink.fr +0.0.0.0 oas.nzz.ch +0.0.0.0 oas.portland.com +0.0.0.0 oas.publicitas.ch +0.0.0.0 oasroanoke.com +0.0.0.0 oas.salon.com +0.0.0.0 oas.sciencemag.org +0.0.0.0 oas.signonsandiego.com +0.0.0.0 oas.startribune.com +0.0.0.0 oas.toronto.com +0.0.0.0 oas.uniontrib.com +0.0.0.0 oas.villagevoice.com +0.0.0.0 oas.vtsgonline.com +# + +# + +# fastclick banner ads +0.0.0.0 media1.fastclick.net +0.0.0.0 media2.fastclick.net +0.0.0.0 media3.fastclick.net +0.0.0.0 media4.fastclick.net +0.0.0.0 media5.fastclick.net +0.0.0.0 media6.fastclick.net +0.0.0.0 media7.fastclick.net +0.0.0.0 media8.fastclick.net +0.0.0.0 media9.fastclick.net +0.0.0.0 media10.fastclick.net +0.0.0.0 media11.fastclick.net +0.0.0.0 media12.fastclick.net +0.0.0.0 media13.fastclick.net +0.0.0.0 media14.fastclick.net +0.0.0.0 media15.fastclick.net +0.0.0.0 media16.fastclick.net +0.0.0.0 media17.fastclick.net +0.0.0.0 media18.fastclick.net +0.0.0.0 media19.fastclick.net +0.0.0.0 media20.fastclick.net +0.0.0.0 media21.fastclick.net +0.0.0.0 media22.fastclick.net +0.0.0.0 media23.fastclick.net +0.0.0.0 media24.fastclick.net +0.0.0.0 media25.fastclick.net +0.0.0.0 media26.fastclick.net +0.0.0.0 media27.fastclick.net +0.0.0.0 media28.fastclick.net +0.0.0.0 media29.fastclick.net +0.0.0.0 media30.fastclick.net +0.0.0.0 media31.fastclick.net +0.0.0.0 media32.fastclick.net +0.0.0.0 media33.fastclick.net +0.0.0.0 media34.fastclick.net +0.0.0.0 media35.fastclick.net +0.0.0.0 media36.fastclick.net +0.0.0.0 media37.fastclick.net +0.0.0.0 media38.fastclick.net +0.0.0.0 media39.fastclick.net +0.0.0.0 media40.fastclick.net +0.0.0.0 media41.fastclick.net +0.0.0.0 media42.fastclick.net +0.0.0.0 media43.fastclick.net +0.0.0.0 media44.fastclick.net +0.0.0.0 media45.fastclick.net +0.0.0.0 media46.fastclick.net +0.0.0.0 media47.fastclick.net +0.0.0.0 media48.fastclick.net +0.0.0.0 media49.fastclick.net +0.0.0.0 media50.fastclick.net +0.0.0.0 media51.fastclick.net +0.0.0.0 media52.fastclick.net +0.0.0.0 media53.fastclick.net +0.0.0.0 media54.fastclick.net +0.0.0.0 media55.fastclick.net +0.0.0.0 media56.fastclick.net +0.0.0.0 media57.fastclick.net +0.0.0.0 media58.fastclick.net +0.0.0.0 media59.fastclick.net +0.0.0.0 media60.fastclick.net +0.0.0.0 media61.fastclick.net +0.0.0.0 media62.fastclick.net +0.0.0.0 media63.fastclick.net +0.0.0.0 media64.fastclick.net +0.0.0.0 media65.fastclick.net +0.0.0.0 media66.fastclick.net +0.0.0.0 media67.fastclick.net +0.0.0.0 media68.fastclick.net +0.0.0.0 media69.fastclick.net +0.0.0.0 media70.fastclick.net +0.0.0.0 media71.fastclick.net +0.0.0.0 media72.fastclick.net +0.0.0.0 media73.fastclick.net +0.0.0.0 media74.fastclick.net +0.0.0.0 media75.fastclick.net +0.0.0.0 media76.fastclick.net +0.0.0.0 media77.fastclick.net +0.0.0.0 media78.fastclick.net +0.0.0.0 media79.fastclick.net +0.0.0.0 media80.fastclick.net +0.0.0.0 media81.fastclick.net +0.0.0.0 media82.fastclick.net +0.0.0.0 media83.fastclick.net +0.0.0.0 media84.fastclick.net +0.0.0.0 media85.fastclick.net +0.0.0.0 media86.fastclick.net +0.0.0.0 media87.fastclick.net +0.0.0.0 media88.fastclick.net +0.0.0.0 media89.fastclick.net +0.0.0.0 media90.fastclick.net +0.0.0.0 media91.fastclick.net +0.0.0.0 media92.fastclick.net +0.0.0.0 media93.fastclick.net +0.0.0.0 media94.fastclick.net +0.0.0.0 media95.fastclick.net +0.0.0.0 media96.fastclick.net +0.0.0.0 media97.fastclick.net +0.0.0.0 media98.fastclick.net +0.0.0.0 media99.fastclick.net +0.0.0.0 fastclick.net +# + +# + +# belo interactive ads +0.0.0.0 te.about.com +0.0.0.0 te.adlandpro.com +0.0.0.0 te.advance.net +0.0.0.0 te.ap.org +0.0.0.0 te.astrology.com +0.0.0.0 te.audiencematch.net +0.0.0.0 te.belointeractive.com +0.0.0.0 te.boston.com +0.0.0.0 te.businessweek.com +0.0.0.0 te.chicagotribune.com +0.0.0.0 te.chron.com +0.0.0.0 te.cleveland.net +0.0.0.0 te.ctnow.com +0.0.0.0 te.dailycamera.com +0.0.0.0 te.dailypress.com +0.0.0.0 te.dentonrc.com +0.0.0.0 te.greenwichtime.com +0.0.0.0 te.idg.com +0.0.0.0 te.infoworld.com +0.0.0.0 te.ivillage.com +0.0.0.0 te.journalnow.com +0.0.0.0 te.latimes.com +0.0.0.0 te.mcall.com +0.0.0.0 te.mgnetwork.com +0.0.0.0 te.mysanantonio.com +0.0.0.0 te.newsday.com +0.0.0.0 te.nytdigital.com +0.0.0.0 te.orlandosentinel.com +0.0.0.0 te.scripps.com +0.0.0.0 te.scrippsnetworksprivacy.com +0.0.0.0 te.scrippsnewspapersprivacy.com +0.0.0.0 te.sfgate.com +0.0.0.0 te.signonsandiego.com +0.0.0.0 te.stamfordadvocate.com +0.0.0.0 te.sun-sentinel.com +0.0.0.0 te.sunspot.net +0.0.0.0 te.suntimes.com +0.0.0.0 te.tbo.com +0.0.0.0 te.thestar.ca +0.0.0.0 te.thestar.com +0.0.0.0 te.trb.com +0.0.0.0 te.versiontracker.com +0.0.0.0 te.wsls.com +# + +# + +# popup traps -- sites that bounce you around or won't let you leave +0.0.0.0 24hwebsex.com +0.0.0.0 adultfriendfinder.com +0.0.0.0 all-tgp.org +0.0.0.0 fioe.info +0.0.0.0 incestland.com +0.0.0.0 lesview.com +0.0.0.0 searchforit.com +0.0.0.0 www.asiansforu.com +0.0.0.0 www.bangbuddy.com +0.0.0.0 www.datanotary.com +0.0.0.0 www.entercasino.com +0.0.0.0 www.incestdot.com +0.0.0.0 www.incestgold.com +0.0.0.0 www.justhookup.com +0.0.0.0 www.mangayhentai.com +0.0.0.0 www.myluvcrush.ca +0.0.0.0 www.ourfuckbook.com +0.0.0.0 www.realincestvideos.com +0.0.0.0 www.searchforit.com +0.0.0.0 www.searchv.com +0.0.0.0 www.secretosx.com +0.0.0.0 www.seductiveamateurs.com +0.0.0.0 www.smsmovies.net +0.0.0.0 www.wowjs.1www.cn +0.0.0.0 www.xxxnations.com +0.0.0.0 www.xxxnightly.com +0.0.0.0 www.xxxtoolbar.com +0.0.0.0 www.yourfuckbook.com +# + +# + +# malicious e-card -- these sites send out mass quantities of spam + # and some distribute adware and spyware +0.0.0.0 123greetings.com # contains one link to distributor of adware or spyware +0.0.0.0 2000greetings.com +0.0.0.0 celebwelove.com +0.0.0.0 ecard4all.com +0.0.0.0 eforu.com +0.0.0.0 freewebcards.com +0.0.0.0 fukkad.com +0.0.0.0 fun-e-cards.com +0.0.0.0 funnyreign.com # heavy spam (Site Advisor received 1075 e-mails/week) +0.0.0.0 funsilly.com +0.0.0.0 myfuncards.com +0.0.0.0 www.cool-downloads.com +0.0.0.0 www.cool-downloads.net +0.0.0.0 www.friend-card.com +0.0.0.0 www.friend-cards.com +0.0.0.0 www.friend-cards.net +0.0.0.0 www.friend-greeting.com +0.0.0.0 www.friend-greetings.com +0.0.0.0 www.friendgreetings.com +0.0.0.0 www.friend-greetings.net +0.0.0.0 www.friendgreetings.net +0.0.0.0 www.laugh-mail.com +0.0.0.0 www.laugh-mail.net +# + +# + +# European network of tracking sites +0.0.0.0 0ivwbox.de +0.0.0.0 1ivwbox.de +0.0.0.0 1und1.ivwbox.de +0.0.0.0 2ivwbox.de +0.0.0.0 3ivwbox.de +0.0.0.0 4ivwbox.de +0.0.0.0 5ivwbox.de +0.0.0.0 6ivwbox.de +0.0.0.0 7ivwbox.de +0.0.0.0 8ivwbox.de +0.0.0.0 8vwbox.de +0.0.0.0 9ivwbox.de +0.0.0.0 9vwbox.de +0.0.0.0 aivwbox.de +0.0.0.0 avwbox.de +0.0.0.0 bild.ivwbox.de +0.0.0.0 bivwbox.de +0.0.0.0 civwbox.de +0.0.0.0 divwbox.de +0.0.0.0 eevwbox.de +0.0.0.0 eivwbox.de +0.0.0.0 evwbox.de +0.0.0.0 faz.ivwbox.de +0.0.0.0 fivwbox.de +0.0.0.0 givwbox.de +0.0.0.0 hivwbox.de +0.0.0.0 i8vwbox.de +0.0.0.0 i9vwbox.de +0.0.0.0 iavwbox.de +0.0.0.0 ibvwbox.de +0.0.0.0 ibwbox.de +0.0.0.0 icvwbox.de +0.0.0.0 icwbox.de +0.0.0.0 ievwbox.de +0.0.0.0 ifvwbox.de +0.0.0.0 ifwbox.de +0.0.0.0 igvwbox.de +0.0.0.0 igwbox.de +0.0.0.0 iivwbox.de +0.0.0.0 ijvwbox.de +0.0.0.0 ikvwbox.de +0.0.0.0 iovwbox.de +0.0.0.0 iuvwbox.de +0.0.0.0 iv2box.de +0.0.0.0 iv2wbox.de +0.0.0.0 iv3box.de +0.0.0.0 iv3wbox.de +0.0.0.0 ivabox.de +0.0.0.0 ivawbox.de +0.0.0.0 ivbox.de +0.0.0.0 ivbwbox.de +0.0.0.0 ivbwox.de +0.0.0.0 ivcwbox.de +0.0.0.0 ivebox.de +0.0.0.0 ivewbox.de +0.0.0.0 ivfwbox.de +0.0.0.0 ivgwbox.de +0.0.0.0 ivqbox.de +0.0.0.0 ivqwbox.de +0.0.0.0 ivsbox.de +0.0.0.0 ivswbox.de +0.0.0.0 ivvbox.de +0.0.0.0 ivvwbox.de +0.0.0.0 ivw2box.de +0.0.0.0 ivw3box.de +0.0.0.0 ivwabox.de +0.0.0.0 ivwb0ox.de +0.0.0.0 ivwb0x.de +0.0.0.0 ivwb9ox.de +0.0.0.0 ivwb9x.de +0.0.0.0 ivwbaox.de +0.0.0.0 ivwbax.de +0.0.0.0 ivwbbox.de +0.0.0.0 ivwbeox.de +0.0.0.0 ivwbex.de +0.0.0.0 ivwbgox.de +0.0.0.0 ivwbhox.de +0.0.0.0 ivwbiox.de +0.0.0.0 ivwbix.de +0.0.0.0 ivwbkox.de +0.0.0.0 ivwbkx.de +0.0.0.0 ivwblox.de +0.0.0.0 ivwblx.de +0.0.0.0 ivwbnox.de +0.0.0.0 ivwbo0x.de +0.0.0.0 ivwbo9x.de +0.0.0.0 ivwboax.de +0.0.0.0 ivwboc.de +0.0.0.0 ivwbock.de +0.0.0.0 ivwbocx.de +0.0.0.0 ivwbod.de +0.0.0.0 ivwbo.de +0.0.0.0 ivwbodx.de +0.0.0.0 ivwboex.de +0.0.0.0 ivwboix.de +0.0.0.0 ivwboks.de +0.0.0.0 ivwbokx.de +0.0.0.0 ivwbolx.de +0.0.0.0 ivwboox.de +0.0.0.0 ivwbopx.de +0.0.0.0 ivwbos.de +0.0.0.0 ivwbosx.de +0.0.0.0 ivwboux.de +0.0.0.0 ivwbox0.de +0.0.0.0 ivwbox1.de +0.0.0.0 ivwbox2.de +0.0.0.0 ivwbox3.de +0.0.0.0 ivwbox4.de +0.0.0.0 ivwbox5.de +0.0.0.0 ivwbox6.de +0.0.0.0 ivwbox7.de +0.0.0.0 ivwbox8.de +0.0.0.0 ivwbox9.de +0.0.0.0 ivwboxa.de +0.0.0.0 ivwboxb.de +0.0.0.0 ivwboxc.de +0.0.0.0 ivwboxd.de +0.0.0.0 ivwbox.de +0.0.0.0 ivwboxe.de +0.0.0.0 ivwboxes.de +0.0.0.0 ivwboxf.de +0.0.0.0 ivwboxg.de +0.0.0.0 ivwboxh.de +0.0.0.0 ivwboxi.de +0.0.0.0 ivwboxj.de +0.0.0.0 ivwboxk.de +0.0.0.0 ivwboxl.de +0.0.0.0 ivwboxm.de +0.0.0.0 ivwboxn.de +0.0.0.0 ivwboxo.de +0.0.0.0 ivwboxp.de +0.0.0.0 ivwboxq.de +0.0.0.0 ivwboxr.de +0.0.0.0 ivwboxs.de +0.0.0.0 ivwboxt.de +0.0.0.0 ivwboxu.de +0.0.0.0 ivwboxv.de +0.0.0.0 ivwboxw.de +0.0.0.0 ivwboxx.de +0.0.0.0 ivwboxy.de +0.0.0.0 ivwboxz.de +0.0.0.0 ivwboyx.de +0.0.0.0 ivwboz.de +0.0.0.0 ivwbozx.de +0.0.0.0 ivwbpox.de +0.0.0.0 ivwbpx.de +0.0.0.0 ivwbuox.de +0.0.0.0 ivwbux.de +0.0.0.0 ivwbvox.de +0.0.0.0 ivwbx.de +0.0.0.0 ivwbxo.de +0.0.0.0 ivwbyox.de +0.0.0.0 ivwbyx.de +0.0.0.0 ivwebox.de +0.0.0.0 ivwgbox.de +0.0.0.0 ivwgox.de +0.0.0.0 ivwhbox.de +0.0.0.0 ivwhox.de +0.0.0.0 ivwnbox.de +0.0.0.0 ivwnox.de +0.0.0.0 ivwobx.de +0.0.0.0 ivwox.de +0.0.0.0 ivwpbox.de +0.0.0.0 ivwpox.de +0.0.0.0 ivwqbox.de +0.0.0.0 ivwsbox.de +0.0.0.0 ivwvbox.de +0.0.0.0 ivwvox.de +0.0.0.0 ivwwbox.de +0.0.0.0 iwbox.de +0.0.0.0 iwvbox.de +0.0.0.0 iwvwbox.de +0.0.0.0 iwwbox.de +0.0.0.0 iyvwbox.de +0.0.0.0 jivwbox.de +0.0.0.0 jvwbox.de +0.0.0.0 kicker.ivwbox.de +0.0.0.0 kivwbox.de +0.0.0.0 kvwbox.de +0.0.0.0 livwbox.de +0.0.0.0 mivwbox.de +0.0.0.0 netzmarkt.ivwbox.de +0.0.0.0 nivwbox.de +0.0.0.0 ntv.ivwbox.de +0.0.0.0 oivwbox.de +0.0.0.0 onvis.ivwbox.de +0.0.0.0 ovwbox.de +0.0.0.0 pivwbox.de +0.0.0.0 qivwbox.de +0.0.0.0 rivwbox.de +0.0.0.0 sivwbox.de +0.0.0.0 spiegel.ivwbox.de +0.0.0.0 tivwbox.de +0.0.0.0 uivwbox.de +0.0.0.0 uvwbox.de +0.0.0.0 vivwbox.de +0.0.0.0 viwbox.de +0.0.0.0 vwbox.de +0.0.0.0 wivwbox.de +0.0.0.0 wwivwbox.de +0.0.0.0 www.0ivwbox.de +0.0.0.0 www.1ivwbox.de +0.0.0.0 www.2ivwbox.de +0.0.0.0 www.3ivwbox.de +0.0.0.0 www.4ivwbox.de +0.0.0.0 www.5ivwbox.de +0.0.0.0 www.6ivwbox.de +0.0.0.0 www.7ivwbox.de +0.0.0.0 www.8ivwbox.de +0.0.0.0 www.8vwbox.de +0.0.0.0 www.9ivwbox.de +0.0.0.0 www.9vwbox.de +0.0.0.0 www.aivwbox.de +0.0.0.0 www.avwbox.de +0.0.0.0 www.bivwbox.de +0.0.0.0 www.civwbox.de +0.0.0.0 www.divwbox.de +0.0.0.0 www.eevwbox.de +0.0.0.0 www.eivwbox.de +0.0.0.0 www.evwbox.de +0.0.0.0 www.fivwbox.de +0.0.0.0 www.givwbox.de +0.0.0.0 www.hivwbox.de +0.0.0.0 www.i8vwbox.de +0.0.0.0 www.i9vwbox.de +0.0.0.0 www.iavwbox.de +0.0.0.0 www.ibvwbox.de +0.0.0.0 www.ibwbox.de +0.0.0.0 www.icvwbox.de +0.0.0.0 www.icwbox.de +0.0.0.0 www.ievwbox.de +0.0.0.0 www.ifvwbox.de +0.0.0.0 www.ifwbox.de +0.0.0.0 www.igvwbox.de +0.0.0.0 www.igwbox.de +0.0.0.0 www.iivwbox.de +0.0.0.0 www.ijvwbox.de +0.0.0.0 www.ikvwbox.de +0.0.0.0 www.iovwbox.de +0.0.0.0 www.iuvwbox.de +0.0.0.0 www.iv2box.de +0.0.0.0 www.iv2wbox.de +0.0.0.0 www.iv3box.de +0.0.0.0 www.iv3wbox.de +0.0.0.0 www.ivabox.de +0.0.0.0 www.ivawbox.de +0.0.0.0 www.ivbox.de +0.0.0.0 www.ivbwbox.de +0.0.0.0 www.ivbwox.de +0.0.0.0 www.ivcwbox.de +0.0.0.0 www.ivebox.de +0.0.0.0 www.ivewbox.de +0.0.0.0 www.ivfwbox.de +0.0.0.0 www.ivgwbox.de +0.0.0.0 www.ivqbox.de +0.0.0.0 www.ivqwbox.de +0.0.0.0 www.ivsbox.de +0.0.0.0 www.ivswbox.de +0.0.0.0 www.ivvbox.de +0.0.0.0 www.ivvwbox.de +0.0.0.0 www.ivw2box.de +0.0.0.0 www.ivw3box.de +0.0.0.0 www.ivwabox.de +0.0.0.0 www.ivwb0ox.de +0.0.0.0 www.ivwb0x.de +0.0.0.0 www.ivwb9ox.de +0.0.0.0 www.ivwb9x.de +0.0.0.0 www.ivwbaox.de +0.0.0.0 www.ivwbax.de +0.0.0.0 www.ivwbbox.de +0.0.0.0 www.ivwbeox.de +0.0.0.0 www.ivwbex.de +0.0.0.0 www.ivwbgox.de +0.0.0.0 www.ivwbhox.de +0.0.0.0 www.ivwbiox.de +0.0.0.0 www.ivwbix.de +0.0.0.0 www.ivwbkox.de +0.0.0.0 www.ivwbkx.de +0.0.0.0 www.ivwblox.de +0.0.0.0 www.ivwblx.de +0.0.0.0 www.ivwbnox.de +0.0.0.0 www.ivwbo0x.de +0.0.0.0 www.ivwbo9x.de +0.0.0.0 www.ivwboax.de +0.0.0.0 www.ivwboc.de +0.0.0.0 www.ivwbock.de +0.0.0.0 www.ivwbocx.de +0.0.0.0 www.ivwbod.de +0.0.0.0 www.ivwbo.de +0.0.0.0 www.ivwbodx.de +0.0.0.0 www.ivwboex.de +0.0.0.0 www.ivwboix.de +0.0.0.0 www.ivwboks.de +0.0.0.0 www.ivwbokx.de +0.0.0.0 www.ivwbolx.de +0.0.0.0 www.ivwboox.de +0.0.0.0 www.ivwbopx.de +0.0.0.0 www.ivwbos.de +0.0.0.0 www.ivwbosx.de +0.0.0.0 www.ivwboux.de +0.0.0.0 www.ivwbox0.de +0.0.0.0 www.ivwbox1.de +0.0.0.0 www.ivwbox2.de +0.0.0.0 www.ivwbox3.de +0.0.0.0 www.ivwbox4.de +0.0.0.0 www.ivwbox5.de +0.0.0.0 www.ivwbox6.de +0.0.0.0 www.ivwbox7.de +0.0.0.0 www.ivwbox8.de +0.0.0.0 www.ivwbox9.de +0.0.0.0 www.ivwboxa.de +0.0.0.0 www.ivwboxb.de +0.0.0.0 www.ivwboxc.de +0.0.0.0 www.ivwboxd.de +0.0.0.0 www.ivwbox.de +0.0.0.0 wwwivwbox.de +0.0.0.0 www.ivwboxe.de +0.0.0.0 www.ivwboxes.de +0.0.0.0 www.ivwboxf.de +0.0.0.0 www.ivwboxg.de +0.0.0.0 www.ivwboxh.de +0.0.0.0 www.ivwboxi.de +0.0.0.0 www.ivwboxj.de +0.0.0.0 www.ivwboxk.de +0.0.0.0 www.ivwboxl.de +0.0.0.0 www.ivwboxm.de +0.0.0.0 www.ivwboxn.de +0.0.0.0 www.ivwboxo.de +0.0.0.0 www.ivwboxp.de +0.0.0.0 www.ivwboxq.de +0.0.0.0 www.ivwboxr.de +0.0.0.0 www.ivwboxs.de +0.0.0.0 www.ivwboxt.de +0.0.0.0 www.ivwboxu.de +0.0.0.0 www.ivwboxv.de +0.0.0.0 www.ivwboxw.de +0.0.0.0 www.ivwboxx.de +0.0.0.0 www.ivwboxy.de +0.0.0.0 www.ivwboxz.de +0.0.0.0 www.ivwboyx.de +0.0.0.0 www.ivwboz.de +0.0.0.0 www.ivwbozx.de +0.0.0.0 www.ivwbpox.de +0.0.0.0 www.ivwbpx.de +0.0.0.0 www.ivwbuox.de +0.0.0.0 www.ivwbux.de +0.0.0.0 www.ivwbvox.de +0.0.0.0 www.ivwbx.de +0.0.0.0 www.ivwbxo.de +0.0.0.0 www.ivwbyox.de +0.0.0.0 www.ivwbyx.de +0.0.0.0 www.ivwebox.de +0.0.0.0 www.ivwgbox.de +0.0.0.0 www.ivwgox.de +0.0.0.0 www.ivwhbox.de +0.0.0.0 www.ivwhox.de +0.0.0.0 www.ivwnbox.de +0.0.0.0 www.ivwnox.de +0.0.0.0 www.ivwobx.de +0.0.0.0 www.ivwox.de +0.0.0.0 www.ivwpbox.de +0.0.0.0 www.ivwpox.de +0.0.0.0 www.ivwqbox.de +0.0.0.0 www.ivwsbox.de +0.0.0.0 www.ivwvbox.de +0.0.0.0 www.ivwvox.de +0.0.0.0 www.ivwwbox.de +0.0.0.0 www.iwbox.de +0.0.0.0 www.iwvbox.de +0.0.0.0 www.iwvwbox.de +0.0.0.0 www.iwwbox.de +0.0.0.0 www.iyvwbox.de +0.0.0.0 www.jivwbox.de +0.0.0.0 www.jvwbox.de +0.0.0.0 www.kivwbox.de +0.0.0.0 www.kvwbox.de +0.0.0.0 www.livwbox.de +0.0.0.0 www.mivwbox.de +0.0.0.0 www.nivwbox.de +0.0.0.0 www.oivwbox.de +0.0.0.0 www.ovwbox.de +0.0.0.0 www.pivwbox.de +0.0.0.0 www.qivwbox.de +0.0.0.0 www.rivwbox.de +0.0.0.0 www.sivwbox.de +0.0.0.0 www.tivwbox.de +0.0.0.0 www.uivwbox.de +0.0.0.0 www.uvwbox.de +0.0.0.0 www.vivwbox.de +0.0.0.0 www.viwbox.de +0.0.0.0 www.vwbox.de +0.0.0.0 www.wivwbox.de +0.0.0.0 www.wwivwbox.de +0.0.0.0 www.wwwivwbox.de +0.0.0.0 www.xivwbox.de +0.0.0.0 www.yevwbox.de +0.0.0.0 www.yivwbox.de +0.0.0.0 www.yvwbox.de +0.0.0.0 www.zivwbox.de +0.0.0.0 xivwbox.de +0.0.0.0 yevwbox.de +0.0.0.0 yivwbox.de +0.0.0.0 yvwbox.de +0.0.0.0 zivwbox.de +# + +# + +# message board and wiki spam -- these sites are linked in + # message board spam and are unlikely to be real sites +0.0.0.0 10pg.scl5fyd.info +0.0.0.0 21jewelry.com +0.0.0.0 24x7.soliday.org +0.0.0.0 2site.com +0.0.0.0 33b.b33r.net +0.0.0.0 48.2mydns.net +0.0.0.0 4allfree.com +0.0.0.0 55.2myip.com +0.0.0.0 6165.rapidforum.com +0.0.0.0 6pg.ryf3hgf.info +0.0.0.0 7x7.ruwe.net +0.0.0.0 7x.cc +0.0.0.0 911.x24hr.com +0.0.0.0 ab.5.p2l.info +0.0.0.0 aboutharrypotter.fasthost.tv +0.0.0.0 aciphex.about-tabs.com +0.0.0.0 actonel.about-tabs.com +0.0.0.0 actos.about-tabs.com +0.0.0.0 acyclovir.1.p2l.info +0.0.0.0 adderall.ourtablets.com +0.0.0.0 adderallxr.freespaces.com +0.0.0.0 adipex.1.p2l.info +0.0.0.0 adipex.24sws.ws +0.0.0.0 adipex.3.p2l.info +0.0.0.0 adipex.4.p2l.info +0.0.0.0 adipex.hut1.ru +0.0.0.0 adipex.ourtablets.com +0.0.0.0 adipexp.3xforum.ro +0.0.0.0 adipex.shengen.ru +0.0.0.0 adipex.t-amo.net +0.0.0.0 adsearch.www1.biz +0.0.0.0 adult.shengen.ru +0.0.0.0 aguileranude.1stOK.com +0.0.0.0 ahh-teens.com +0.0.0.0 aid-golf-golfdust-training.tabrays.com +0.0.0.0 airline-ticket.gloses.net +0.0.0.0 air-plane-ticket.beesearch.info +0.0.0.0 ak.5.p2l.info +0.0.0.0 al.5.p2l.info +0.0.0.0 alcohol-treatment.gloses.net +0.0.0.0 allegra.1.p2l.info +0.0.0.0 allergy.1.p2l.info +0.0.0.0 all-sex.shengen.ru +0.0.0.0 alprazolamonline.findmenow.info +0.0.0.0 alprazolam.ourtablets.com +0.0.0.0 alyssamilano.1stOK.com +0.0.0.0 alyssamilano.ca.tt +0.0.0.0 alyssamilano.home.sapo.pt +0.0.0.0 amateur-mature-sex.adaltabaza.net +0.0.0.0 ambien.1.p2l.info +0.0.0.0 ambien.3.p2l.info +0.0.0.0 ambien.4.p2l.info +0.0.0.0 ambien.ourtablets.com +0.0.0.0 amoxicillin.ourtablets.com +0.0.0.0 angelinajolie.1stOK.com +0.0.0.0 angelinajolie.ca.tt +0.0.0.0 anklets.shengen.ru +0.0.0.0 annanicolesannanicolesmith.ca.tt +0.0.0.0 annanicolesmith.1stOK.com +0.0.0.0 antidepressants.1.p2l.info +0.0.0.0 anxiety.1.p2l.info +0.0.0.0 aol.spb.su +0.0.0.0 ar.5.p2l.info +0.0.0.0 arcade.ya.com +0.0.0.0 armanix.white.prohosting.com +0.0.0.0 arthritis.atspace.com +0.0.0.0 as.5.p2l.info +0.0.0.0 aspirin.about-tabs.com +0.0.0.0 ativan.ourtablets.com +0.0.0.0 austria-car-rental.findworm.net +0.0.0.0 auto.allewagen.de +0.0.0.0 az.5.p2l.info +0.0.0.0 azz.badazz.org +0.0.0.0 balabass.peerserver.com +0.0.0.0 balab.portx.net +0.0.0.0 bbs.ws +0.0.0.0 bc.5.p2l.info +0.0.0.0 beauty.finaltips.com +0.0.0.0 berkleynude.ca.tt +0.0.0.0 bestlolaray.com +0.0.0.0 bet-online.petrovka.info +0.0.0.0 betting-online.petrovka.info +0.0.0.0 bextra.ourtablets.com +0.0.0.0 bextra-store.shengen.ru +0.0.0.0 bingo-online.petrovka.info +0.0.0.0 birth-control.1.p2l.info +0.0.0.0 bontril.1.p2l.info +0.0.0.0 bontril.ourtablets.com +0.0.0.0 britneyspears.1stOK.com +0.0.0.0 britneyspears.ca.tt +0.0.0.0 br.rawcomm.net +0.0.0.0 bupropion-hcl.1.p2l.info +0.0.0.0 buspar.1.p2l.info +0.0.0.0 buspirone.1.p2l.info +0.0.0.0 butalbital-apap.1.p2l.info +0.0.0.0 buy-adipex.aca.ru +0.0.0.0 buy-adipex-cheap-adipex-online.com +0.0.0.0 buy-adipex.hut1.ru +0.0.0.0 buy-adipex.i-jogo.net +0.0.0.0 buy-adipex-online.md-online24.de +0.0.0.0 buy-adipex.petrovka.info +0.0.0.0 buy-carisoprodol.polybuild.ru +0.0.0.0 buy-cheap-phentermine.blogspot.com +0.0.0.0 buy-cheap-xanax.all.at +0.0.0.0 buy-cialis-cheap-cialis-online.info +0.0.0.0 buy-cialis.freewebtools.com +0.0.0.0 buycialisonline.7h.com +0.0.0.0 buycialisonline.bigsitecity.com +0.0.0.0 buy-cialis-online.iscool.nl +0.0.0.0 buy-cialis-online.meperdoe.net +0.0.0.0 buy-cialis.splinder.com +0.0.0.0 buy-diazepam.connect.to +0.0.0.0 buyfioricet.findmenow.info +0.0.0.0 buy-fioricet.hut1.ru +0.0.0.0 buyfioricetonline.7h.com +0.0.0.0 buyfioricetonline.bigsitecity.com +0.0.0.0 buyfioricetonline.freeservers.com +0.0.0.0 buy-flower.petrovka.info +0.0.0.0 buy-hydrocodone.aca.ru +0.0.0.0 buyhydrocodone.all.at +0.0.0.0 buy-hydrocodone-cheap-hydrocodone-online.com +0.0.0.0 buy-hydrocodone.este.ru +0.0.0.0 buyhydrocodoneonline.findmenow.info +0.0.0.0 buy-hydrocodone-online.tche.com +0.0.0.0 buy-hydrocodone.petrovka.info +0.0.0.0 buy-hydrocodone.polybuild.ru +0.0.0.0 buy-hydrocodone.quesaudade.net +0.0.0.0 buy-hydrocodone.scromble.com +0.0.0.0 buylevitra.3xforum.ro +0.0.0.0 buy-levitra-cheap-levitra-online.info +0.0.0.0 buylevitraonline.7h.com +0.0.0.0 buylevitraonline.bigsitecity.com +0.0.0.0 buy-lortab-cheap-lortab-online.com +0.0.0.0 buy-lortab.hut1.ru +0.0.0.0 buylortabonline.7h.com +0.0.0.0 buylortabonline.bigsitecity.com +0.0.0.0 buy-lortab-online.iscool.nl +0.0.0.0 buypaxilonline.7h.com +0.0.0.0 buypaxilonline.bigsitecity.com +0.0.0.0 buy-phentermine-cheap-phentermine-online.com +0.0.0.0 buy-phentermine.hautlynx.com +0.0.0.0 buy-phentermine-online.135.it +0.0.0.0 buyphentermineonline.7h.com +0.0.0.0 buyphentermineonline.bigsitecity.com +0.0.0.0 buy-phentermine-online.i-jogo.net +0.0.0.0 buy-phentermine-online.i-ltda.net +0.0.0.0 buy-phentermine.polybuild.ru +0.0.0.0 buy-phentermine.thepizza.net +0.0.0.0 buy-tamiflu.asian-flu-vaccine.com +0.0.0.0 buy-ultram-online.iscool.nl +0.0.0.0 buy-valium-cheap-valium-online.com +0.0.0.0 buy-valium.este.ru +0.0.0.0 buy-valium.hut1.ru +0.0.0.0 buy-valium.polybuild.ru +0.0.0.0 buyvalium.polybuild.ru +0.0.0.0 buy-viagra.aca.ru +0.0.0.0 buy-viagra.go.to +0.0.0.0 buy-viagra.polybuild.ru +0.0.0.0 buyviagra.polybuild.ru +0.0.0.0 buy-vicodin-cheap-vicodin-online.com +0.0.0.0 buy-vicodin.dd.vu +0.0.0.0 buy-vicodin.hut1.ru +0.0.0.0 buy-vicodin.iscool.nl +0.0.0.0 buy-vicodin-online.i-blog.net +0.0.0.0 buy-vicodin-online.seumala.net +0.0.0.0 buy-vicodin-online.supersite.fr +0.0.0.0 buyvicodinonline.veryweird.com +0.0.0.0 buy-xanax.aztecaonline.net +0.0.0.0 buy-xanax-cheap-xanax-online.com +0.0.0.0 buy-xanax.hut1.ru +0.0.0.0 buy-xanax-online.amovoce.net +0.0.0.0 buy-zyban.all.at +0.0.0.0 bx6.blrf.net +0.0.0.0 ca.5.p2l.info +0.0.0.0 camerondiaznude.1stOK.com +0.0.0.0 camerondiaznude.ca.tt +0.0.0.0 car-donation.shengen.ru +0.0.0.0 car-insurance.inshurance-from.com +0.0.0.0 carisoprodol.1.p2l.info +0.0.0.0 carisoprodol.hut1.ru +0.0.0.0 carisoprodol.ourtablets.com +0.0.0.0 carisoprodol.polybuild.ru +0.0.0.0 carisoprodol.shengen.ru +0.0.0.0 car-loan.shengen.ru +0.0.0.0 carmenelectra.1stOK.com +0.0.0.0 cash-advance.now-cash.com +0.0.0.0 casino-gambling-online.searchservice.info +0.0.0.0 casino-online.100gal.net +0.0.0.0 cat.onlinepeople.net +0.0.0.0 cc5f.dnyp.com +0.0.0.0 celebrex.1.p2l.info +0.0.0.0 celexa.1.p2l.info +0.0.0.0 celexa.3.p2l.info +0.0.0.0 celexa.4.p2l.info +0.0.0.0 cephalexin.ourtablets.com +0.0.0.0 charlizetheron.1stOK.com +0.0.0.0 cheap-adipex.hut1.ru +0.0.0.0 cheap-carisoprodol.polybuild.ru +0.0.0.0 cheap-hydrocodone.go.to +0.0.0.0 cheap-hydrocodone.polybuild.ru +0.0.0.0 cheap-phentermine.polybuild.ru +0.0.0.0 cheap-valium.polybuild.ru +0.0.0.0 cheap-viagra.polybuild.ru +0.0.0.0 cheap-web-hosting-here.blogspot.com +0.0.0.0 cheap-xanax-here.blogspot.com +0.0.0.0 cheapxanax.hut1.ru +0.0.0.0 cialis.1.p2l.info +0.0.0.0 cialis.3.p2l.info +0.0.0.0 cialis.4.p2l.info +0.0.0.0 cialis-finder.com +0.0.0.0 cialis-levitra-viagra.com.cn +0.0.0.0 cialis.ourtablets.com +0.0.0.0 cialis-store.shengen.ru +0.0.0.0 co.5.p2l.info +0.0.0.0 co.dcclan.co.uk +0.0.0.0 codeine.ourtablets.com +0.0.0.0 creampie.afdss.info +0.0.0.0 credit-card-application.now-cash.com +0.0.0.0 credit-cards.shengen.ru +0.0.0.0 ct.5.p2l.info +0.0.0.0 cuiland.info +0.0.0.0 cyclobenzaprine.1.p2l.info +0.0.0.0 cyclobenzaprine.ourtablets.com +0.0.0.0 dal.d.la +0.0.0.0 danger-phentermine.allforyourlife.com +0.0.0.0 darvocet.ourtablets.com +0.0.0.0 dc.5.p2l.info +0.0.0.0 de.5.p2l.info +0.0.0.0 debt.shengen.ru +0.0.0.0 def.5.p2l.info +0.0.0.0 demimoorenude.1stOK.com +0.0.0.0 deniserichards.1stOK.com +0.0.0.0 detox-kit.com +0.0.0.0 detox.shengen.ru +0.0.0.0 diazepam.ourtablets.com +0.0.0.0 diazepam.razma.net +0.0.0.0 diazepam.shengen.ru +0.0.0.0 didrex.1.p2l.info +0.0.0.0 diet-pills.hut1.ru +0.0.0.0 digital-cable-descrambler.planet-high-heels.com +0.0.0.0 dir.opank.com +0.0.0.0 dos.velek.com +0.0.0.0 drewbarrymore.ca.tt +0.0.0.0 drugdetox.shengen.ru +0.0.0.0 drug-online.petrovka.info +0.0.0.0 drug-testing.shengen.ru +0.0.0.0 eb.dd.bluelinecomputers.be +0.0.0.0 eb.prout.be +0.0.0.0 ed.at.is13.de +0.0.0.0 ed.at.thamaster.de +0.0.0.0 e-dot.hut1.ru +0.0.0.0 efam4.info +0.0.0.0 effexor-xr.1.p2l.info +0.0.0.0 e-hosting.hut1.ru +0.0.0.0 ei.imbucurator-de-prost.com +0.0.0.0 eminemticket.freespaces.com +0.0.0.0 en.dd.blueline.be +0.0.0.0 enpresse.1.p2l.info +0.0.0.0 en.ultrex.ru +0.0.0.0 epson-printer-ink.beesearch.info +0.0.0.0 erectile.byethost33.com +0.0.0.0 esgic.1.p2l.info +0.0.0.0 fahrrad.bikesshop.de +0.0.0.0 famous-pics.com +0.0.0.0 famvir.1.p2l.info +0.0.0.0 farmius.org +0.0.0.0 fee-hydrocodone.bebto.com +0.0.0.0 female-v.1.p2l.info +0.0.0.0 femaleviagra.findmenow.info +0.0.0.0 fg.softguy.com +0.0.0.0 findmenow.info +0.0.0.0 fioricet.1.p2l.info +0.0.0.0 fioricet.3.p2l.info +0.0.0.0 fioricet.4.p2l.info +0.0.0.0 fioricet-online.blogspot.com +0.0.0.0 firstfinda.info +0.0.0.0 fl.5.p2l.info +0.0.0.0 flexeril.1.p2l.info +0.0.0.0 flextra.1.p2l.info +0.0.0.0 flonase.1.p2l.info +0.0.0.0 flonase.3.p2l.info +0.0.0.0 flonase.4.p2l.info +0.0.0.0 florineff.ql.st +0.0.0.0 flower-online.petrovka.info +0.0.0.0 fluoxetine.1.p2l.info +0.0.0.0 fo4n.com +0.0.0.0 forex-broker.hut1.ru +0.0.0.0 forex-chart.hut1.ru +0.0.0.0 forex-market.hut1.ru +0.0.0.0 forex-news.hut1.ru +0.0.0.0 forex-online.hut1.ru +0.0.0.0 forex-signal.hut1.ru +0.0.0.0 forex-trade.hut1.ru +0.0.0.0 forex-trading-benefits.blogspot.com +0.0.0.0 forextrading.hut1.ru +0.0.0.0 freechat.llil.de +0.0.0.0 free.hostdepartment.com +0.0.0.0 free-money.host.sk +0.0.0.0 free-viagra.polybuild.ru +0.0.0.0 free-virus-scan.100gal.net +0.0.0.0 ga.5.p2l.info +0.0.0.0 game-online-video.petrovka.info +0.0.0.0 gaming-online.petrovka.info +0.0.0.0 gastrointestinal.1.p2l.info +0.0.0.0 gen-hydrocodone.polybuild.ru +0.0.0.0 getcarisoprodol.polybuild.ru +0.0.0.0 gocarisoprodol.polybuild.ru +0.0.0.0 gsm-mobile-phone.beesearch.info +0.0.0.0 gu.5.p2l.info +0.0.0.0 guerria-skateboard-tommy.tabrays.com +0.0.0.0 gwynethpaltrow.ca.tt +0.0.0.0 h1.ripway.com +0.0.0.0 hair-dos.resourcesarchive.com +0.0.0.0 halleberrynude.ca.tt +0.0.0.0 heathergraham.ca.tt +0.0.0.0 herpes.1.p2l.info +0.0.0.0 herpes.3.p2l.info +0.0.0.0 herpes.4.p2l.info +0.0.0.0 hf.themafia.info +0.0.0.0 hi.5.p2l.info +0.0.0.0 hi.pacehillel.org +0.0.0.0 holobumo.info +0.0.0.0 homehre.bravehost.com +0.0.0.0 homehre.ifrance.com +0.0.0.0 homehre.tripod.com +0.0.0.0 hoodia.kogaryu.com +0.0.0.0 hotel-las-vegas.gloses.net +0.0.0.0 hydrocodone-buy-online.blogspot.com +0.0.0.0 hydrocodone.irondel.swisshost.by +0.0.0.0 hydrocodone.on.to +0.0.0.0 hydrocodone.shengen.ru +0.0.0.0 hydrocodone.t-amo.net +0.0.0.0 hydrocodone.visa-usa.ru +0.0.0.0 hydro.polybuild.ru +0.0.0.0 ia.5.p2l.info +0.0.0.0 ia.warnet-thunder.net +0.0.0.0 ibm-notebook-battery.wp-club.net +0.0.0.0 id.5.p2l.info +0.0.0.0 il.5.p2l.info +0.0.0.0 imitrex.1.p2l.info +0.0.0.0 imitrex.3.p2l.info +0.0.0.0 imitrex.4.p2l.info +0.0.0.0 in.5.p2l.info +0.0.0.0 ionamin.1.p2l.info +0.0.0.0 ionamin.t35.com +0.0.0.0 irondel.swisshost.by +0.0.0.0 japanese-girl-xxx.com +0.0.0.0 java-games.bestxs.de +0.0.0.0 jg.hack-inter.net +0.0.0.0 job-online.petrovka.info +0.0.0.0 jobs-online.petrovka.info +0.0.0.0 kitchen-island.mensk.us +0.0.0.0 konstantin.freespaces.com +0.0.0.0 ks.5.p2l.info +0.0.0.0 ky.5.p2l.info +0.0.0.0 la.5.p2l.info +0.0.0.0 lamictal.about-tabs.com +0.0.0.0 lamisil.about-tabs.com +0.0.0.0 levitra.1.p2l.info +0.0.0.0 levitra.3.p2l.info +0.0.0.0 levitra.4.p2l.info +0.0.0.0 lexapro.1.p2l.info +0.0.0.0 lexapro.3.p2l.info +0.0.0.0 lexapro.4.p2l.info +0.0.0.0 loan.aol.msk.su +0.0.0.0 loan.maybachexelero.org +0.0.0.0 loestrin.1.p2l.info +0.0.0.0 lo.ljkeefeco.com +0.0.0.0 lol.to +0.0.0.0 lortab-cod.hut1.ru +0.0.0.0 lortab.hut1.ru +0.0.0.0 ma.5.p2l.info +0.0.0.0 mailforfreedom.com +0.0.0.0 make-money.shengen.ru +0.0.0.0 maps-antivert58.eksuziv.net +0.0.0.0 maps-spyware251-300.eksuziv.net +0.0.0.0 marketing.beesearch.info +0.0.0.0 mb.5.p2l.info +0.0.0.0 mba-online.petrovka.info +0.0.0.0 md.5.p2l.info +0.0.0.0 me.5.p2l.info +0.0.0.0 medical.carway.net +0.0.0.0 mens.1.p2l.info +0.0.0.0 meridia.1.p2l.info +0.0.0.0 meridia.3.p2l.info +0.0.0.0 meridia.4.p2l.info +0.0.0.0 meridiameridia.3xforum.ro +0.0.0.0 mesotherapy.jino-net.ru +0.0.0.0 mi.5.p2l.info +0.0.0.0 micardiss.ql.st +0.0.0.0 microsoft-sql-server.wp-club.net +0.0.0.0 mn.5.p2l.info +0.0.0.0 mo.5.p2l.info +0.0.0.0 moc.silk.com +0.0.0.0 mortgage-memphis.hotmail.ru +0.0.0.0 mortgage-rates.now-cash.com +0.0.0.0 mp.5.p2l.info +0.0.0.0 mrjeweller.us +0.0.0.0 ms.5.p2l.info +0.0.0.0 mt.5.p2l.info +0.0.0.0 multimedia-projector.katrina.ru +0.0.0.0 muscle-relaxers.1.p2l.info +0.0.0.0 music102.awardspace.com +0.0.0.0 mydaddy.b0x.com +0.0.0.0 myphentermine.polybuild.ru +0.0.0.0 nasacort.1.p2l.info +0.0.0.0 nasonex.1.p2l.info +0.0.0.0 nb.5.p2l.info +0.0.0.0 nc.5.p2l.info +0.0.0.0 nd.5.p2l.info +0.0.0.0 ne.5.p2l.info +0.0.0.0 nellyticket.beast-space.com +0.0.0.0 nelsongod.ca +0.0.0.0 nexium.1.p2l.info +0.0.0.0 nextel-ringtone.komi.su +0.0.0.0 nextel-ringtone.spb.su +0.0.0.0 nf.5.p2l.info +0.0.0.0 nh.5.p2l.info +0.0.0.0 nj.5.p2l.info +0.0.0.0 nm.5.p2l.info +0.0.0.0 nordette.1.p2l.info +0.0.0.0 nordette.3.p2l.info +0.0.0.0 nordette.4.p2l.info +0.0.0.0 norton-antivirus-trial.searchservice.info +0.0.0.0 notebook-memory.searchservice.info +0.0.0.0 ns.5.p2l.info +0.0.0.0 nv.5.p2l.info +0.0.0.0 ny.5.p2l.info +0.0.0.0 o8.aus.cc +0.0.0.0 ofni.al0ne.info +0.0.0.0 oh.5.p2l.info +0.0.0.0 ok.5.p2l.info +0.0.0.0 on.5.p2l.info +0.0.0.0 online-auto-insurance.petrovka.info +0.0.0.0 online-bingo.petrovka.info +0.0.0.0 online-broker.petrovka.info +0.0.0.0 online-cash.petrovka.info +0.0.0.0 online-casino.shengen.ru +0.0.0.0 online-casino.webpark.pl +0.0.0.0 online-cigarettes.hitslog.net +0.0.0.0 online-college.petrovka.info +0.0.0.0 online-degree.petrovka.info +0.0.0.0 online-florist.petrovka.info +0.0.0.0 online-forex.hut1.ru +0.0.0.0 online-forex-trading-systems.blogspot.com +0.0.0.0 online-gaming.petrovka.info +0.0.0.0 online-job.petrovka.info +0.0.0.0 online-loan.petrovka.info +0.0.0.0 online-mortgage.petrovka.info +0.0.0.0 online-personal.petrovka.info +0.0.0.0 online-personals.petrovka.info +0.0.0.0 online-pharmacy-online.blogspot.com +0.0.0.0 online-pharmacy.petrovka.info +0.0.0.0 online-phentermine.petrovka.info +0.0.0.0 online-poker-gambling.petrovka.info +0.0.0.0 online-poker-game.petrovka.info +0.0.0.0 online-poker.shengen.ru +0.0.0.0 online-prescription.petrovka.info +0.0.0.0 online-school.petrovka.info +0.0.0.0 online-schools.petrovka.info +0.0.0.0 online-single.petrovka.info +0.0.0.0 online-tarot-reading.beesearch.info +0.0.0.0 online-travel.petrovka.info +0.0.0.0 online-university.petrovka.info +0.0.0.0 online-viagra.petrovka.info +0.0.0.0 online-xanax.petrovka.info +0.0.0.0 onlypreteens.com +0.0.0.0 only-valium.go.to +0.0.0.0 only-valium.shengen.ru +0.0.0.0 or.5.p2l.info +0.0.0.0 oranla.info +0.0.0.0 orderadipex.findmenow.info +0.0.0.0 order-hydrocodone.polybuild.ru +0.0.0.0 order-phentermine.polybuild.ru +0.0.0.0 order-valium.polybuild.ru +0.0.0.0 ortho-tri-cyclen.1.p2l.info +0.0.0.0 pa.5.p2l.info +0.0.0.0 pacific-poker.e-online-poker-4u.net +0.0.0.0 pain-relief.1.p2l.info +0.0.0.0 paintball-gun.tripod.com +0.0.0.0 patio-furniture.dreamhoster.com +0.0.0.0 paxil.1.p2l.info +0.0.0.0 pay-day-loans.beesearch.info +0.0.0.0 payday-loans.now-cash.com +0.0.0.0 pctuzing.php5.cz +0.0.0.0 pd1.funnyhost.com +0.0.0.0 pe.5.p2l.info +0.0.0.0 peter-north-cum-shot.blogspot.com +0.0.0.0 pets.finaltips.com +0.0.0.0 pharmacy-canada.forsearch.net +0.0.0.0 pharmacy.hut1.ru +0.0.0.0 pharmacy-news.blogspot.com +0.0.0.0 pharmacy-online.petrovka.info +0.0.0.0 phendimetrazine.1.p2l.info +0.0.0.0 phentermine.1.p2l.info +0.0.0.0 phentermine.3.p2l.info +0.0.0.0 phentermine.4.p2l.info +0.0.0.0 phentermine.aussie7.com +0.0.0.0 phentermine-buy-online.hitslog.net +0.0.0.0 phentermine-buy.petrovka.info +0.0.0.0 phentermine-online.iscool.nl +0.0.0.0 phentermine-online.petrovka.info +0.0.0.0 phentermine.petrovka.info +0.0.0.0 phentermine.polybuild.ru +0.0.0.0 phentermine.shengen.ru +0.0.0.0 phentermine.t-amo.net +0.0.0.0 phentermine.webpark.pl +0.0.0.0 phone-calling-card.exnet.su +0.0.0.0 plavix.shengen.ru +0.0.0.0 play-poker-free.forsearch.net +0.0.0.0 poker-games.e-online-poker-4u.net +0.0.0.0 pop.egi.biz +0.0.0.0 pr.5.p2l.info +0.0.0.0 prescription-drugs.easy-find.net +0.0.0.0 prescription-drugs.shengen.ru +0.0.0.0 preteenland.com +0.0.0.0 preteensite.com +0.0.0.0 prevacid.1.p2l.info +0.0.0.0 prevent-asian-flu.com +0.0.0.0 prilosec.1.p2l.info +0.0.0.0 propecia.1.p2l.info +0.0.0.0 protonix.shengen.ru +0.0.0.0 psorias.atspace.com +0.0.0.0 purchase.hut1.ru +0.0.0.0 qc.5.p2l.info +0.0.0.0 qz.informs.com +0.0.0.0 refinance.shengen.ru +0.0.0.0 relenza.asian-flu-vaccine.com +0.0.0.0 renova.1.p2l.info +0.0.0.0 replacement-windows.gloses.net +0.0.0.0 re.rutan.org +0.0.0.0 resanium.com +0.0.0.0 retin-a.1.p2l.info +0.0.0.0 ri.5.p2l.info +0.0.0.0 rise-media.ru +0.0.0.0 root.dns.bz +0.0.0.0 roulette-online.petrovka.info +0.0.0.0 router.googlecom.biz +0.0.0.0 s32.bilsay.com +0.0.0.0 samsclub33.pochta.ru +0.0.0.0 sc10.net +0.0.0.0 sc.5.p2l.info +0.0.0.0 sd.5.p2l.info +0.0.0.0 search4you.50webs.com +0.0.0.0 search-phentermine.hpage.net +0.0.0.0 searchpill.boom.ru +0.0.0.0 seasonale.1.p2l.info +0.0.0.0 shop.kauffes.de +0.0.0.0 single-online.petrovka.info +0.0.0.0 sk.5.p2l.info +0.0.0.0 skelaxin.1.p2l.info +0.0.0.0 skelaxin.3.p2l.info +0.0.0.0 skelaxin.4.p2l.info +0.0.0.0 skin-care.1.p2l.info +0.0.0.0 skocz.pl +0.0.0.0 sleep-aids.1.p2l.info +0.0.0.0 sleeper-sofa.dreamhoster.com +0.0.0.0 slf5cyd.info +0.0.0.0 sobolev.net.ru +0.0.0.0 soma.1.p2l.info +0.0.0.0 soma.3xforum.ro +0.0.0.0 soma-store.visa-usa.ru +0.0.0.0 sonata.1.p2l.info +0.0.0.0 sport-betting-online.hitslog.net +0.0.0.0 spyware-removers.shengen.ru +0.0.0.0 spyware-scan.100gal.net +0.0.0.0 spyware.usafreespace.com +0.0.0.0 sq7.co.uk +0.0.0.0 sql-server-driver.beesearch.info +0.0.0.0 starlix.ql.st +0.0.0.0 stop-smoking.1.p2l.info +0.0.0.0 supplements.1.p2l.info +0.0.0.0 sx.nazari.org +0.0.0.0 sx.z0rz.com +0.0.0.0 ta.at.ic5mp.net +0.0.0.0 ta.at.user-mode-linux.net +0.0.0.0 tamiflu-in-canada.asian-flu-vaccine.com +0.0.0.0 tamiflu-no-prescription.asian-flu-vaccine.com +0.0.0.0 tamiflu-purchase.asian-flu-vaccine.com +0.0.0.0 tamiflu-without-prescription.asian-flu-vaccine.com +0.0.0.0 tenuate.1.p2l.info +0.0.0.0 texas-hold-em.e-online-poker-4u.net +0.0.0.0 texas-holdem.shengen.ru +0.0.0.0 ticket20.tripod.com +0.0.0.0 tizanidine.1.p2l.info +0.0.0.0 tn.5.p2l.info +0.0.0.0 topmeds10.com +0.0.0.0 top.pcanywhere.net +0.0.0.0 toyota.cyberealhosting.com +0.0.0.0 tramadol.1.p2l.info +0.0.0.0 tramadol2006.3xforum.ro +0.0.0.0 tramadol.3.p2l.info +0.0.0.0 tramadol.4.p2l.info +0.0.0.0 travel-insurance-quotes.beesearch.info +0.0.0.0 triphasil.1.p2l.info +0.0.0.0 triphasil.3.p2l.info +0.0.0.0 triphasil.4.p2l.info +0.0.0.0 tx.5.p2l.info +0.0.0.0 uf2aasn.111adfueo.us +0.0.0.0 ultracet.1.p2l.info +0.0.0.0 ultram.1.p2l.info +0.0.0.0 united-airline-fare.100pantyhose.com +0.0.0.0 university-online.petrovka.info +0.0.0.0 urlcut.net +0.0.0.0 urshort.net +0.0.0.0 us.kopuz.com +0.0.0.0 ut.5.p2l.info +0.0.0.0 utairway.com +0.0.0.0 va.5.p2l.info +0.0.0.0 vacation.toppick.info +0.0.0.0 valium.este.ru +0.0.0.0 valium.hut1.ru +0.0.0.0 valium.ourtablets.com +0.0.0.0 valium.polybuild.ru +0.0.0.0 valiumvalium.3xforum.ro +0.0.0.0 valtrex.1.p2l.info +0.0.0.0 valtrex.3.p2l.info +0.0.0.0 valtrex.4.p2l.info +0.0.0.0 valtrex.7h.com +0.0.0.0 vaniqa.1.p2l.info +0.0.0.0 vi.5.p2l.info +0.0.0.0 viagra.1.p2l.info +0.0.0.0 viagra.3.p2l.info +0.0.0.0 viagra.4.p2l.info +0.0.0.0 viagra-online.petrovka.info +0.0.0.0 viagra-pill.blogspot.com +0.0.0.0 viagra.polybuild.ru +0.0.0.0 viagra-soft-tabs.1.p2l.info +0.0.0.0 viagra-store.shengen.ru +0.0.0.0 viagraviagra.3xforum.ro +0.0.0.0 vicodin-online.petrovka.info +0.0.0.0 vicodin-store.shengen.ru +0.0.0.0 vicodin.t-amo.net +0.0.0.0 viewtools.com +0.0.0.0 vioxx.1.p2l.info +0.0.0.0 vitalitymax.1.p2l.info +0.0.0.0 vt.5.p2l.info +0.0.0.0 vxv.phre.net +0.0.0.0 w0.drag0n.org +0.0.0.0 wa.5.p2l.info +0.0.0.0 water-bed.8p.org.uk +0.0.0.0 web-hosting.hitslog.net +0.0.0.0 webhosting.hut1.ru +0.0.0.0 weborg.hut1.ru +0.0.0.0 weight-loss.1.p2l.info +0.0.0.0 weight-loss.3.p2l.info +0.0.0.0 weight-loss.4.p2l.info +0.0.0.0 weight-loss.hut1.ru +0.0.0.0 wellbutrin.1.p2l.info +0.0.0.0 wellbutrin.3.p2l.info +0.0.0.0 wellbutrin.4.p2l.info +0.0.0.0 wellnessmonitor.bravehost.com +0.0.0.0 wi.5.p2l.info +0.0.0.0 world-trade-center.hawaiicity.com +0.0.0.0 wp-club.net +0.0.0.0 ws01.do.nu +0.0.0.0 ws02.do.nu +0.0.0.0 ws03.do.nu +0.0.0.0 ws03.home.sapo.pt +0.0.0.0 ws04.do.nu +0.0.0.0 ws04.home.sapo.pt +0.0.0.0 ws05.home.sapo.pt +0.0.0.0 ws06.home.sapo.pt +0.0.0.0 wv.5.p2l.info +0.0.0.0 www.31d.net +0.0.0.0 www3.ddns.ms +0.0.0.0 www4.at.debianbase.de +0.0.0.0 www4.epac.to +0.0.0.0 www5.3-a.net +0.0.0.0 www69.bestdeals.at +0.0.0.0 www69.byinter.net +0.0.0.0 www69.dynu.com +0.0.0.0 www69.findhere.org +0.0.0.0 www69.fw.nu +0.0.0.0 www69.ugly.as +0.0.0.0 www6.ezua.com +0.0.0.0 www6.ns1.name +0.0.0.0 www7.ygto.com +0.0.0.0 www8.ns01.us +0.0.0.0 www99.bounceme.net +0.0.0.0 www99.fdns.net +0.0.0.0 www99.zapto.org +0.0.0.0 www9.compblue.com +0.0.0.0 www9.servequake.com +0.0.0.0 www9.trickip.org +0.0.0.0 www.adspoll.com +0.0.0.0 www.adult-top-list.com +0.0.0.0 www.aektschen.de +0.0.0.0 www.aeqs.com +0.0.0.0 www.alladultdirectories.com +0.0.0.0 www.alladultdirectory.net +0.0.0.0 www.arbeitssuche-web.de +0.0.0.0 www.bestrxpills.com +0.0.0.0 www.bigsister.cxa.de +0.0.0.0 www.bigsister-puff.cxa.de +0.0.0.0 www.bitlocker.net +0.0.0.0 www.cheap-laptops-notebook-computers.info +0.0.0.0 www.cheap-online-stamp.cast.cc +0.0.0.0 www.codez-knacken.de +0.0.0.0 www.computerxchange.com +0.0.0.0 www.credit-dreams.com +0.0.0.0 www.edle-stuecke.de +0.0.0.0 www.exe-file.de +0.0.0.0 www.exttrem.de +0.0.0.0 www.fetisch-pornos.cxa.de +0.0.0.0 www.ficken-ficken-ficken.cxa.de +0.0.0.0 www.ficken-xxx.cxa.de +0.0.0.0 www.financial-advice-books.com +0.0.0.0 www.finanzmarkt2004.de +0.0.0.0 www.furnitureulimited.com +0.0.0.0 www.gewinnspiele-slotmachine.de +0.0.0.0 www.hardware4freaks.de +0.0.0.0 www.healthyaltprods.com +0.0.0.0 www.heimlich-gefilmt.cxa.de +0.0.0.0 www.huberts-kochseite.de +0.0.0.0 www.huren-verzeichnis.is4all.de +0.0.0.0 www.kaaza-legal.de +0.0.0.0 www.kajahdfssa.net +0.0.0.0 www.keyofhealth.com +0.0.0.0 www.kitchentablegang.org +0.0.0.0 www.km69.de +0.0.0.0 www.koch-backrezepte.de +0.0.0.0 www.kvr-systems.de +0.0.0.0 www.lesben-pornos.cxa.de +0.0.0.0 www.links-private-krankenversicherung.de +0.0.0.0 www.littledevildoubt.com +0.0.0.0 www.mailforfreedom.com +0.0.0.0 www.masterspace.biz +0.0.0.0 www.medical-research-books.com +0.0.0.0 www.microsoft2010.com +0.0.0.0 www.nelsongod.ca +0.0.0.0 www.nextstudent.com +0.0.0.0 www.ntdesk.de +0.0.0.0 www.nutten-verzeichnis.cxa.de +0.0.0.0 www.obesitycheck.com +0.0.0.0 www.pawnauctions.net +0.0.0.0 www.pills-home.com +0.0.0.0 www.poker4spain.com +0.0.0.0 www.poker-new.com +0.0.0.0 www.poker-unique.com +0.0.0.0 www.porno-lesben.cxa.de +0.0.0.0 www.prevent-asian-flu.com +0.0.0.0 www.randppro-cuts.com +0.0.0.0 www.romanticmaui.net +0.0.0.0 www.salldo.de +0.0.0.0 www.samsclub33.pochta.ru +0.0.0.0 www.schwarz-weisses.de +0.0.0.0 www.schwule-boys-nackt.cxa.de +0.0.0.0 www.shopping-artikel.de +0.0.0.0 www.showcaserealestate.net +0.0.0.0 www.skattabrain.com +0.0.0.0 www.softcha.com +0.0.0.0 www.striemline.de +0.0.0.0 www.talentbroker.net +0.0.0.0 www.the-discount-store.com +0.0.0.0 www.topmeds10.com +0.0.0.0 www.uniqueinternettexasholdempoker.com +0.0.0.0 www.viagra-home.com +0.0.0.0 www.vthought.com +0.0.0.0 www.vtoyshop.com +0.0.0.0 www.vulcannonibird.de +0.0.0.0 www.webabrufe.de +0.0.0.0 www.wilddreams.info +0.0.0.0 www.willcommen.de +0.0.0.0 www.xcr-286.com +0.0.0.0 wy.5.p2l.info +0.0.0.0 x25.2mydns.com +0.0.0.0 x25.plorp.com +0.0.0.0 x4.lov3.net +0.0.0.0 x6x.a.la +0.0.0.0 x888x.myserver.org +0.0.0.0 x8x.dyndns.dk +0.0.0.0 x8x.trickip.net +0.0.0.0 xanax-online.dot.de +0.0.0.0 xanax-online.run.to +0.0.0.0 xanax-online.sms2.us +0.0.0.0 xanax.ourtablets.com +0.0.0.0 xanax-store.shengen.ru +0.0.0.0 xanax.t-amo.net +0.0.0.0 xanaxxanax.3xforum.ro +0.0.0.0 x-box.t35.com +0.0.0.0 xcr-286.com +0.0.0.0 xenical.1.p2l.info +0.0.0.0 xenical.3.p2l.info +0.0.0.0 xenical.4.p2l.info +0.0.0.0 x-hydrocodone.info +0.0.0.0 xoomer.alice.it +0.0.0.0 x-phentermine.info +0.0.0.0 xr.h4ck.la +0.0.0.0 yasmin.1.p2l.info +0.0.0.0 yasmin.3.p2l.info +0.0.0.0 yasmin.4.p2l.info +0.0.0.0 yt.5.p2l.info +0.0.0.0 zanaflex.1.p2l.info +0.0.0.0 zebutal.1.p2l.info +0.0.0.0 zocor.about-tabs.com +0.0.0.0 zoloft.1.p2l.info +0.0.0.0 zoloft.3.p2l.info +0.0.0.0 zoloft.4.p2l.info +0.0.0.0 zoloft.about-tabs.com +0.0.0.0 zyban.1.p2l.info +0.0.0.0 zyban.about-tabs.com +0.0.0.0 zyban-store.shengen.ru +0.0.0.0 zyprexa.about-tabs.com +0.0.0.0 zyrtec.1.p2l.info +0.0.0.0 zyrtec.3.p2l.info +0.0.0.0 zyrtec.4.p2l.info +# + +# + +# Phorm contextual advertising sites +0.0.0.0 a.oix.com +0.0.0.0 a.oix.net +0.0.0.0 a.openinternetexchange.com +0.0.0.0 a.phormlabs.com +0.0.0.0 a.webwise.com +0.0.0.0 a.webwise.net +0.0.0.0 b.oix.net +0.0.0.0 br.phorm.com +0.0.0.0 bt.phorm.com +0.0.0.0 bt.webwise.com +0.0.0.0 b.webwise.net +0.0.0.0 c.webwise.com +0.0.0.0 c.webwise.net +0.0.0.0 d.oix.com +0.0.0.0 d.phormlabs.com +0.0.0.0 ig.fp.oix.net +0.0.0.0 invite.gezinti.com +0.0.0.0 kentsucks.youcanoptout.com +0.0.0.0 kr.phorm.com +0.0.0.0 mail.youcanoptout.com +0.0.0.0 mail.youcanoptout.net +0.0.0.0 mail.youcanoptout.org +0.0.0.0 monitor.phorm.com +0.0.0.0 mx01.openinternetexchange.com +0.0.0.0 mx01.openinternetexchange.net +0.0.0.0 mx01.webwise.com +0.0.0.0 mx03.phorm.com +0.0.0.0 navegador.oi.com.br +0.0.0.0 navegador.telefonica.com.br +0.0.0.0 ns1.oix.com +0.0.0.0 ns1.openinternetexchange.com +0.0.0.0 ns1.phorm.com +0.0.0.0 ns2.oix.com +0.0.0.0 ns2.openinternetexchange.com +0.0.0.0 ns2.phorm.com +0.0.0.0 ns2.youcanoptout.com +0.0.0.0 ns3.openinternetexchange.com +0.0.0.0 oi.webnavegador.com.br +0.0.0.0 oixcrv-lab.net +0.0.0.0 oixcrv.net +0.0.0.0 oixcrv-stage.net +0.0.0.0 oix.phorm.com +0.0.0.0 oixpre.net +0.0.0.0 oixpre-stage.net +0.0.0.0 oixssp-lab.net +0.0.0.0 oixssp.net +0.0.0.0 oix-stage.net +0.0.0.0 openinternetexchange.com +0.0.0.0 openinternetexchange.net +0.0.0.0 phorm.kr +0.0.0.0 phormlabs.com +0.0.0.0 prm-ext.phorm.com +0.0.0.0 romdiscover.com +0.0.0.0 rtc.romdiscover.com +0.0.0.0 stats.oix.com +0.0.0.0 stopphoulplay.com +0.0.0.0 stopphoulplay.net +0.0.0.0 telefonica.webnavegador.com.br +0.0.0.0 webnavegador.com.br +0.0.0.0 webwise.com +0.0.0.0 webwise.net +0.0.0.0 w.oix.net +0.0.0.0 www.gezinti.com +0.0.0.0 www.gozatar.com +0.0.0.0 www.oix.com +0.0.0.0 www.openinternetexchange.com +0.0.0.0 www.phormlabs.com +0.0.0.0 www.stopphoulplay.com +0.0.0.0 www.youcanoptout.com +0.0.0.0 www.youcanoptout.net +0.0.0.0 www.youcanoptout.org +0.0.0.0 xxyyzz.youcanoptout.com +0.0.0.0 youcanoptout.com +0.0.0.0 youcanoptout.net +0.0.0.0 youcanoptout.org +# diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/https_svn_python_org_root.pem b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/https_svn_python_org_root.pem new file mode 100644 index 00000000..e7dfc829 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/https_svn_python_org_root.pem @@ -0,0 +1,41 @@ +-----BEGIN CERTIFICATE----- +MIIHPTCCBSWgAwIBAgIBADANBgkqhkiG9w0BAQQFADB5MRAwDgYDVQQKEwdSb290 +IENBMR4wHAYDVQQLExVodHRwOi8vd3d3LmNhY2VydC5vcmcxIjAgBgNVBAMTGUNB +IENlcnQgU2lnbmluZyBBdXRob3JpdHkxITAfBgkqhkiG9w0BCQEWEnN1cHBvcnRA +Y2FjZXJ0Lm9yZzAeFw0wMzAzMzAxMjI5NDlaFw0zMzAzMjkxMjI5NDlaMHkxEDAO +BgNVBAoTB1Jvb3QgQ0ExHjAcBgNVBAsTFWh0dHA6Ly93d3cuY2FjZXJ0Lm9yZzEi +MCAGA1UEAxMZQ0EgQ2VydCBTaWduaW5nIEF1dGhvcml0eTEhMB8GCSqGSIb3DQEJ +ARYSc3VwcG9ydEBjYWNlcnQub3JnMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIIC +CgKCAgEAziLA4kZ97DYoB1CW8qAzQIxL8TtmPzHlawI229Z89vGIj053NgVBlfkJ +8BLPRoZzYLdufujAWGSuzbCtRRcMY/pnCujW0r8+55jE8Ez64AO7NV1sId6eINm6 +zWYyN3L69wj1x81YyY7nDl7qPv4coRQKFWyGhFtkZip6qUtTefWIonvuLwphK42y +fk1WpRPs6tqSnqxEQR5YYGUFZvjARL3LlPdCfgv3ZWiYUQXw8wWRBB0bF4LsyFe7 +w2t6iPGwcswlWyCR7BYCEo8y6RcYSNDHBS4CMEK4JZwFaz+qOqfrU0j36NK2B5jc +G8Y0f3/JHIJ6BVgrCFvzOKKrF11myZjXnhCLotLddJr3cQxyYN/Nb5gznZY0dj4k +epKwDpUeb+agRThHqtdB7Uq3EvbXG4OKDy7YCbZZ16oE/9KTfWgu3YtLq1i6L43q +laegw1SJpfvbi1EinbLDvhG+LJGGi5Z4rSDTii8aP8bQUWWHIbEZAWV/RRyH9XzQ +QUxPKZgh/TMfdQwEUfoZd9vUFBzugcMd9Zi3aQaRIt0AUMyBMawSB3s42mhb5ivU +fslfrejrckzzAeVLIL+aplfKkQABi6F1ITe1Yw1nPkZPcCBnzsXWWdsC4PDSy826 +YreQQejdIOQpvGQpQsgi3Hia/0PsmBsJUUtaWsJx8cTLc6nloQsCAwEAAaOCAc4w +ggHKMB0GA1UdDgQWBBQWtTIb1Mfz4OaO873SsDrusjkY0TCBowYDVR0jBIGbMIGY +gBQWtTIb1Mfz4OaO873SsDrusjkY0aF9pHsweTEQMA4GA1UEChMHUm9vdCBDQTEe +MBwGA1UECxMVaHR0cDovL3d3dy5jYWNlcnQub3JnMSIwIAYDVQQDExlDQSBDZXJ0 +IFNpZ25pbmcgQXV0aG9yaXR5MSEwHwYJKoZIhvcNAQkBFhJzdXBwb3J0QGNhY2Vy +dC5vcmeCAQAwDwYDVR0TAQH/BAUwAwEB/zAyBgNVHR8EKzApMCegJaAjhiFodHRw +czovL3d3dy5jYWNlcnQub3JnL3Jldm9rZS5jcmwwMAYJYIZIAYb4QgEEBCMWIWh0 +dHBzOi8vd3d3LmNhY2VydC5vcmcvcmV2b2tlLmNybDA0BglghkgBhvhCAQgEJxYl +aHR0cDovL3d3dy5jYWNlcnQub3JnL2luZGV4LnBocD9pZD0xMDBWBglghkgBhvhC +AQ0ESRZHVG8gZ2V0IHlvdXIgb3duIGNlcnRpZmljYXRlIGZvciBGUkVFIGhlYWQg +b3ZlciB0byBodHRwOi8vd3d3LmNhY2VydC5vcmcwDQYJKoZIhvcNAQEEBQADggIB +ACjH7pyCArpcgBLKNQodgW+JapnM8mgPf6fhjViVPr3yBsOQWqy1YPaZQwGjiHCc +nWKdpIevZ1gNMDY75q1I08t0AoZxPuIrA2jxNGJARjtT6ij0rPtmlVOKTV39O9lg +18p5aTuxZZKmxoGCXJzN600BiqXfEVWqFcofN8CCmHBh22p8lqOOLlQ+TyGpkO/c +gr/c6EWtTZBzCDyUZbAEmXZ/4rzCahWqlwQ3JNgelE5tDlG+1sSPypZt90Pf6DBl +Jzt7u0NDY8RD97LsaMzhGY4i+5jhe1o+ATc7iwiwovOVThrLm82asduycPAtStvY +sONvRUgzEv/+PDIqVPfE94rwiCPCR/5kenHA0R6mY7AHfqQv0wGP3J8rtsYIqQ+T +SCX8Ev2fQtzzxD72V7DX3WnRBnc0CkvSyqD/HMaMyRa+xMwyN2hzXwj7UfdJUzYF +CpUCTPJ5GhD22Dp1nPMd8aINcGeGG7MW9S/lpOt5hvk9C8JzC6WZrG/8Z7jlLwum +GCSNe9FINSkYQKyTYOGWhlC0elnYjyELn8+CkcY7v2vcB5G5l1YjqrZslMZIBjzk +zk6q5PYvCdxTby78dOs6Y5nCpqyJvKeyRKANihDjbPIky/qbn3BHLt4Ui9SyIAmW +omTxJBzcoTWcFbLUvFUufQb1nA5V9FrWk9p2rSVzTMVD +-----END CERTIFICATE----- diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/keycert.pem b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/keycert.pem new file mode 100644 index 00000000..2f46fcf1 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/keycert.pem @@ -0,0 +1,32 @@ +-----BEGIN RSA PRIVATE KEY----- +MIICXwIBAAKBgQC8ddrhm+LutBvjYcQlnH21PPIseJ1JVG2HMmN2CmZk2YukO+9L +opdJhTvbGfEj0DQs1IE8M+kTUyOmuKfVrFMKwtVeCJphrAnhoz7TYOuLBSqt7lVH +fhi/VwovESJlaBOp+WMnfhcduPEYHYx/6cnVapIkZnLt30zu2um+DzA9jQIDAQAB +AoGBAK0FZpaKj6WnJZN0RqhhK+ggtBWwBnc0U/ozgKz2j1s3fsShYeiGtW6CK5nU +D1dZ5wzhbGThI7LiOXDvRucc9n7vUgi0alqPQ/PFodPxAN/eEYkmXQ7W2k7zwsDA +IUK0KUhktQbLu8qF/m8qM86ba9y9/9YkXuQbZ3COl5ahTZrhAkEA301P08RKv3KM +oXnGU2UHTuJ1MAD2hOrPxjD4/wxA/39EWG9bZczbJyggB4RHu0I3NOSFjAm3HQm0 +ANOu5QK9owJBANgOeLfNNcF4pp+UikRFqxk5hULqRAWzVxVrWe85FlPm0VVmHbb/ +loif7mqjU8o1jTd/LM7RD9f2usZyE2psaw8CQQCNLhkpX3KO5kKJmS9N7JMZSc4j +oog58yeYO8BBqKKzpug0LXuQultYv2K4veaIO04iL9VLe5z9S/Q1jaCHBBuXAkEA +z8gjGoi1AOp6PBBLZNsncCvcV/0aC+1se4HxTNo2+duKSDnbq+ljqOM+E7odU+Nq +ewvIWOG//e8fssd0mq3HywJBAJ8l/c8GVmrpFTx8r/nZ2Pyyjt3dH1widooDXYSV +q6Gbf41Llo5sYAtmxdndTLASuHKecacTgZVhy0FryZpLKrU= +-----END RSA PRIVATE KEY----- +-----BEGIN CERTIFICATE----- +MIICpzCCAhCgAwIBAgIJAP+qStv1cIGNMA0GCSqGSIb3DQEBBQUAMIGJMQswCQYD +VQQGEwJVUzERMA8GA1UECBMIRGVsYXdhcmUxEzARBgNVBAcTCldpbG1pbmd0b24x +IzAhBgNVBAoTGlB5dGhvbiBTb2Z0d2FyZSBGb3VuZGF0aW9uMQwwCgYDVQQLEwNT +U0wxHzAdBgNVBAMTFnNvbWVtYWNoaW5lLnB5dGhvbi5vcmcwHhcNMDcwODI3MTY1 +NDUwWhcNMTMwMjE2MTY1NDUwWjCBiTELMAkGA1UEBhMCVVMxETAPBgNVBAgTCERl +bGF3YXJlMRMwEQYDVQQHEwpXaWxtaW5ndG9uMSMwIQYDVQQKExpQeXRob24gU29m +dHdhcmUgRm91bmRhdGlvbjEMMAoGA1UECxMDU1NMMR8wHQYDVQQDExZzb21lbWFj +aGluZS5weXRob24ub3JnMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC8ddrh +m+LutBvjYcQlnH21PPIseJ1JVG2HMmN2CmZk2YukO+9LopdJhTvbGfEj0DQs1IE8 +M+kTUyOmuKfVrFMKwtVeCJphrAnhoz7TYOuLBSqt7lVHfhi/VwovESJlaBOp+WMn +fhcduPEYHYx/6cnVapIkZnLt30zu2um+DzA9jQIDAQABoxUwEzARBglghkgBhvhC +AQEEBAMCBkAwDQYJKoZIhvcNAQEFBQADgYEAF4Q5BVqmCOLv1n8je/Jw9K669VXb +08hyGzQhkemEBYQd6fzQ9A/1ZzHkJKb1P6yreOLSEh4KcxYPyrLRC1ll8nr5OlCx +CMhKkTnR6qBsdNV0XtdU2+N25hqW+Ma4ZeqsN/iiJVCGNOZGnvQuvCAGWF8+J/f/ +iHkC6gGdBJhogs4= +-----END CERTIFICATE----- diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/known_failures.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/known_failures.py new file mode 100644 index 00000000..6396c0e2 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/known_failures.py @@ -0,0 +1,398 @@ +# This is a list of known failures (=bugs). +# The tests listed there must fail (or testrunner.py will report error) unless they are prefixed with FLAKY +# in which cases the result of them is simply ignored +from __future__ import print_function +import os +import sys +import struct + +from gevent.testing.sysinfo import RUNNING_ON_APPVEYOR as APPVEYOR +from gevent.testing.sysinfo import RUNNING_ON_TRAVIS as TRAVIS +from gevent.testing.sysinfo import RUN_LEAKCHECKS as LEAKTEST +from gevent.testing.sysinfo import RUN_COVERAGE as COVERAGE +from gevent.testing.sysinfo import RESOLVER_NOT_SYSTEM + +from gevent.testing.sysinfo import PYPY +from gevent.testing.sysinfo import PY3 +from gevent.testing.sysinfo import PY35 + +from gevent.testing.sysinfo import LIBUV + +IGNORED_TESTS = [] + +FAILING_TESTS = [ + + # Sometimes fails with AssertionError: ...\nIOError: close() called during concurrent operation on the same file object.\n' + # Sometimes it contains "\nUnhandled exception in thread started by \nsys.excepthook is missing\nlost sys.stderr\n" + "FLAKY test__subprocess_interrupted.py", + # test__issue6 (see comments in test file) is really flaky on both Travis and Appveyor; + # on Travis we could just run the test again (but that gets old fast), but on appveyor + # we don't have that option without a new commit---and sometimes we really need a build + # to succeed in order to get a release wheel + 'FLAKY test__issue6.py', +] + + +if sys.platform == 'win32': + IGNORED_TESTS = [ + # fork watchers don't get called on windows + # because fork is not a concept windows has. + # See this file for a detailed explanation. + 'test__core_fork.py', + ] + # other Windows-related issues (need investigating) + FAILING_TESTS += [ + 'FLAKY test__greenletset.py', + # This has been seen to fail on Py3 and Py2 due to socket reuse + # errors, probably timing related again. + 'FLAKY test___example_servers.py', + ] + + if APPVEYOR: + FAILING_TESTS += [ + # These both run on port 9000 and can step on each other...seems like the + # appveyor containers aren't fully port safe? Or it takes longer + # for the processes to shut down? Or we run them in a different order + # in the process pool than we do other places? + 'FLAKY test__example_udp_client.py', + 'FLAKY test__example_udp_server.py', + # This one sometimes times out, often after output "The process with PID XXX could not be + # terminated. Reason: There is no running instance of the task." + 'FLAKY test__example_portforwarder.py', + # This one sometimes randomly closes connections, but no indication + # of a server crash, only a client side close. + 'FLAKY test__server_pywsgi.py', + ] + + if PYPY and LIBUV: + IGNORED_TESTS += [ + # This one seems to just stop right after + # patching is done. It passes on a local win 10 vm, and the main + # test_threading_2.py does as well. + # Based on the printouts we added, it appears to not even + # finish importing: + # https://ci.appveyor.com/project/denik/gevent/build/1.0.1277/job/tpvhesij5gldjxqw#L1190 + # Ignored because it takes two minutes to time out. + 'test_threading.py', + ] + + if PY3: + FAILING_TESTS += [ + # test_set_and_clear in Py3 relies on 5 threads all starting and + # coming to an Event wait point while a sixth thread sleeps for a half + # second. The sixth thread then does something and checks that + # the 5 threads were all at the wait point. But the timing is sometimes + # too tight for appveyor. This happens even if Event isn't + # monkey-patched + 'FLAKY test_threading.py', + + # Starting in November 2018, on Python 3.7.0, we observe this test crashing. + # I can't reproduce locally. + # | C:\Python37-x64\python.exe -u -mgevent.tests.test__greenness + # 127.0.0.1 - - [09/Nov/2018 16:34:12] code 501, message Unsupported method ('GET') + # 127.0.0.1 - - [09/Nov/2018 16:34:12] "GET / HTTP/1.1" 501 - + # . + # ---------------------------------------------------------------------- + # Ran 1 test in 0.031s + + # OK + # Windows fatal exception: access violation + + # Current thread 0x000003c8 (most recent call first): + # File "c:\projects\gevent\src\gevent\threadpool.py", line 261 in _worker + + # Thread 0x00000600 (most recent call first): + # File "c:\projects\gevent\src\gevent\libuv\watcher.py", line 577 in send + # File "c:\projects\gevent\src\gevent\threadpool.py", line 408 in set + # File "c:\projects\gevent\src\gevent\threadpool.py", line 290 in _worker + + # Thread 0x000007d4 (most recent call first): + # File "C:\Python37-x64\lib\weakref.py", line 356 in remove + + # ! C:\Python37-x64\python.exe -u -mgevent.tests.test__greenness [code 3221225477] [took 1.3s] + # We have also seen this for Python 3.6.6 Nov 13 2018: + # | C:\Python36-x64\python.exe -u -mgevent.tests.test__backdoor + # ss.s.s + # ---------------------------------------------------------------------- + # Ran 6 tests in 0.953s + + # OK (skipped=4) + # Windows fatal exception: access violation + + # Thread 0x00000aec (most recent call first): + # File "C:\Python36-x64\lib\site-packages\gevent\_threading.py", line 84 in wait + # File "C:\Python36-x64\lib\site-packages\gevent\_threading.py", line 166 in get + # File "C:\Python36-x64\lib\site-packages\gevent\threadpool.py", line 270 in _worker + + # Thread 0x00000548 (most recent call first): + + # Thread 0x000003d0 (most recent call first): + # File "C:\Python36-x64\lib\site-packages\gevent\_threading.py", line 84 in wait + # File "C:\Python36-x64\lib\site-packages\gevent\_threading.py", line 166 in get + # File "C:\Python36-x64\lib\site-packages\gevent\threadpool.py", line 270 in _worker + + # Thread 0x00000ad0 (most recent call first): + + # Thread 0x00000588 (most recent call first): + # File "C:\Python36-x64\lib\site-packages\gevent\_threading.py", line 84 in wait + # File "C:\Python36-x64\lib\site-packages\gevent\_threading.py", line 166 in get + # File "C:\Python36-x64\lib\site-packages\gevent\threadpool.py", line 270 in _worker + + # Thread 0x00000a54 (most recent call first): + + # Thread 0x00000768 (most recent call first): + # File "C:\Python36-x64\lib\site-packages\gevent\_threading.py", line 84 in wait + # File "C:\Python36-x64\lib\site-packages\gevent\_threading.py", line 166 in get + # File "C:\Python36-x64\lib\site-packages\gevent\threadpool.py", line 270 in _worker + + # Current thread 0x00000894 (most recent call first): + # File "C:\Python36-x64\lib\site-packages\gevent\threadpool.py", line 261 in _worker + + # Thread 0x00000634 (most recent call first): + # File "C:\Python36-x64\lib\site-packages\gevent\_threading.py", line 84 in wait + # File "C:\Python36-x64\lib\site-packages\gevent\_threading.py", line 166 in get + # File "C:\Python36-x64\lib\site-packages\gevent\threadpool.py", line 270 in _worker + + # Thread 0x00000538 (most recent call first): + + # Thread 0x0000049c (most recent call first): + # File "C:\Python36-x64\lib\weakref.py", line 356 in remove + + # ! C:\Python36-x64\python.exe -u -mgevent.tests.test__backdoor [code 3221225477] [Ran 6 tests in 2.1s] + + # Note the common factors: + # - The test is finished (successfully) and we're apparently exiting the VM, + # doing GC + # - A weakref is being cleaned up + + # weakref.py line 356 remove() is in WeakKeyDictionary. We only use WeakKeyDictionary + # in gevent._ident.IdentRegistry, which is only used in two places: + # gevent.hub.hub_ident_registry, which has weak references to Hub objects, + # and gevent.greenlet.Greenlet.minimal_ident, which uses its parent Hub's + # IdentRegistry to get its own identifier. So basically they have weak references + # to Hub and arbitrary Greenlets. + + # Our attempted solution: stop using a module-level IdentRegistry to get + # Hub idents, and reduce how often we auto-generate one for greenlets. + # Commenting out the tests, lets see if it works. + #'FLAKY test__greenness.py', + #'FLAKY test__backdoor.py', + ] + + if not PY35: + # Py35 added socket.socketpair, all other releases + # are missing it. No reason to even test it. + IGNORED_TESTS += [ + 'test__socketpair.py', + ] + + if struct.calcsize('P') * 8 == 64: + # could be a problem of appveyor - not sure + # ====================================================================== + # ERROR: test_af (__main__.TestIPv6Environment) + # ---------------------------------------------------------------------- + # File "C:\Python27-x64\lib\ftplib.py", line 135, in connect + # self.sock = socket.create_connection((self.host, self.port), self.timeout) + # File "c:\projects\gevent\gevent\socket.py", line 73, in create_connection + # raise err + # error: [Errno 10049] [Error 10049] The requested address is not valid in its context. + # XXX: On Jan 3 2016 this suddenly started passing on Py27/64; no idea why, the python version + # was 2.7.11 before and after. + FAILING_TESTS.append('FLAKY test_ftplib.py') + + if PY3: + pass + + +if LEAKTEST: + FAILING_TESTS += [ + 'FLAKY test__backdoor.py', + 'FLAKY test__socket_errors.py', + ] + + if os.environ.get("TRAVIS") == "true": + FAILING_TESTS += [ + # On Travis, this very frequently fails due to timing + 'FLAKY test_signal.py', + ] + + +if PYPY: + FAILING_TESTS += [ + ## Different in PyPy: + + ## Not implemented: + + ## --- + + ## BUGS: + + ## UNKNOWN: + # AssertionError: '>>> ' != '' + # test__backdoor.py:52 + 'FLAKY test__backdoor.py', + ] + + if RESOLVER_NOT_SYSTEM: + + FAILING_TESTS += [ + # A few errors and differences: + # AssertionError: ('255.255.255.255', 'http') != gaierror(4, 'ARES_ENOTFOUND: Domain name not found') + # AssertionError: OverflowError('port must be 0-65535.',) != ('readthedocs.org', '65535') + # AssertionError: Lists differ: + # (10, 1, 6, '', ('2607:f8b0:4004:810::200e', 80, 0L, 0L)) + # (10, 1, 6, '', ('2607:f8b0:4004:805::200e', 80, 0, 0)) + 'test__socket_dns.py', + ] + + if LIBUV: + IGNORED_TESTS += [ + # This hangs for no apparent reason when run by the testrunner, + # even wher maked standalone + # when run standalone from the command line, it's fine. + # Issue in pypy2 6.0? + 'test__monkey_sigchld_2.py', + ] + + if TRAVIS: + FAILING_TESTS += [ + # This fails to get the correct results, sometimes. I can't reproduce locally + 'FLAKY test__example_udp_server.py', + 'FLAKY test__example_udp_client.py', + ] + + if LIBUV: + IGNORED_TESTS += [ + # XXX: Re-enable this when we can investigate more. + # This has started crashing with a SystemError. + # I cannot reproduce with the same version on macOS + # and I cannot reproduce with the same version in a Linux vm. + # Commenting out individual tests just moves the crash around. + # https://bitbucket.org/pypy/pypy/issues/2769/systemerror-unexpected-internal-exception + 'test__pywsgi.py', + ] + + IGNORED_TESTS += [ + # XXX Re-enable these when we have more time to investigate. + # This test, which normally takes ~60s, sometimes + # hangs forever after running several tests. I cannot reproduce, + # it seems highly load dependent. Observed with both libev and libuv. + 'test__threadpool.py', + # This test, which normally takes 4-5s, sometimes + # hangs forever after running two tests. I cannot reproduce, + # it seems highly load dependent. Observed with both libev and libuv. + 'test__threading_2.py', + ] + + if PY3 and TRAVIS: + FAILING_TESTS += [ + ## --- + + ## Unknown; can't reproduce locally on OS X + 'FLAKY test_subprocess.py', # timeouts on one test. + + 'FLAKY test_ssl.py', + ] + + +if LIBUV: + if sys.platform.startswith("darwin"): + FAILING_TESTS += [ + ] + +if PY3: + # No idea / TODO + FAILING_TESTS += [ + 'FLAKY test__socket_dns.py', + ] + + + +if sys.version_info[:2] >= (3, 4) and APPVEYOR: + FAILING_TESTS += [ + # Timing issues on appveyor + 'FLAKY test_selectors.py' + ] + + +if COVERAGE: + # The gevent concurrency plugin tends to slow things + # down and get us past our default timeout value. These + # tests in particular are sensitive to it + FAILING_TESTS += [ + 'FLAKY test__issue302monkey.py', + 'FLAKY test__example_portforwarder.py', + 'FLAKY test__threading_vs_settrace.py', + ] + +FAILING_TESTS = [x.strip() for x in set(FAILING_TESTS) if x.strip()] + + +# A mapping from test file basename to a dictionary of +# options that will be applied on top of the DEFAULT_RUN_OPTIONS. +TEST_FILE_OPTIONS = { + +} + + +# tests that don't do well when run on busy box +RUN_ALONE = [ + 'test__threadpool.py', + 'test__examples.py', +] + + + +if APPVEYOR or TRAVIS: + RUN_ALONE += [ + # Partial workaround for the _testcapi issue on PyPy, + # but also because signal delivery can sometimes be slow, and this + # spawn processes of its own + 'test_signal.py', + ] + + if LEAKTEST and PY3: + # On a heavily loaded box, these can all take upwards of 200s + RUN_ALONE += [ + 'test__pool.py', + 'test__pywsgi.py', + 'test__queue.py', + ] + + if PYPY: + # This often takes much longer on PyPy on CI. + TEST_FILE_OPTIONS['test__threadpool.py'] = {'timeout': 180} + TEST_FILE_OPTIONS['test__threading_2.py'] = {'timeout': 180} + if PY3: + RUN_ALONE += [ + # Sometimes shows unexpected timeouts + 'test_socket.py', + ] + if LIBUV: + RUN_ALONE += [ + # https://bitbucket.org/pypy/pypy/issues/2769/systemerror-unexpected-internal-exception + 'test__pywsgi.py', + ] + +# tests that can't be run when coverage is enabled +IGNORE_COVERAGE = [ + # Hangs forever + 'test__threading_vs_settrace.py', + # times out + 'test_socket.py', + # Doesn't get the exceptions it expects + 'test_selectors.py', + # XXX ? + 'test__issue302monkey.py', + "test_subprocess.py", +] + +if PYPY: + IGNORE_COVERAGE += [ + # Tends to timeout + 'test__refcount.py', + 'test__greenletset.py' + ] + +if __name__ == '__main__': + print('known_failures:\n', FAILING_TESTS) diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/lock_tests.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/lock_tests.py new file mode 100644 index 00000000..2c5a91bd --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/lock_tests.py @@ -0,0 +1,767 @@ +""" +Various tests for synchronization primitives. +""" +# pylint:disable=no-member,abstract-method +import sys +import time +try: + from thread import start_new_thread, get_ident +except ImportError: + from _thread import start_new_thread, get_ident +import threading +import unittest + +try: + from test import support +except ImportError: + from test import test_support as support + +from gevent.testing.testcase import TimeAssertMixin + +def _wait(): + # A crude wait/yield function not relying on synchronization primitives. + time.sleep(0.01) + +class Bunch(object): + """ + A bunch of threads. + """ + def __init__(self, f, n, wait_before_exit=False): + """ + Construct a bunch of `n` threads running the same function `f`. + If `wait_before_exit` is True, the threads won't terminate until + do_finish() is called. + """ + self.f = f + self.n = n + self.started = [] + self.finished = [] + self._can_exit = not wait_before_exit + def task(): + tid = get_ident() + self.started.append(tid) + try: + f() + finally: + self.finished.append(tid) + while not self._can_exit: + _wait() + for _ in range(n): + start_new_thread(task, ()) + + def wait_for_started(self): + while len(self.started) < self.n: + _wait() + + def wait_for_finished(self): + while len(self.finished) < self.n: + _wait() + + def do_finish(self): + self._can_exit = True + + +class BaseTestCase(TimeAssertMixin, unittest.TestCase): + def setUp(self): + self._threads = support.threading_setup() + + def tearDown(self): + support.threading_cleanup(*self._threads) + support.reap_children() + + +class BaseLockTests(BaseTestCase): + """ + Tests for both recursive and non-recursive locks. + """ + + def locktype(self): + raise NotImplementedError() + + def test_constructor(self): + lock = self.locktype() + del lock + + def test_acquire_destroy(self): + lock = self.locktype() + lock.acquire() + del lock + + def test_acquire_release(self): + lock = self.locktype() + lock.acquire() + lock.release() + del lock + + def test_try_acquire(self): + lock = self.locktype() + self.assertTrue(lock.acquire(False)) + lock.release() + + def test_try_acquire_contended(self): + lock = self.locktype() + lock.acquire() + result = [] + def f(): + result.append(lock.acquire(False)) + Bunch(f, 1).wait_for_finished() + self.assertFalse(result[0]) + lock.release() + + def test_acquire_contended(self): + lock = self.locktype() + lock.acquire() + N = 5 + def f(): + lock.acquire() + lock.release() + + b = Bunch(f, N) + b.wait_for_started() + _wait() + self.assertEqual(len(b.finished), 0) + lock.release() + b.wait_for_finished() + self.assertEqual(len(b.finished), N) + + def test_with(self): + lock = self.locktype() + def f(): + lock.acquire() + lock.release() + def _with(err=None): + with lock: + if err is not None: + raise err # pylint:disable=raising-bad-type + _with() + # Check the lock is unacquired + Bunch(f, 1).wait_for_finished() + self.assertRaises(TypeError, _with, TypeError) + # Check the lock is unacquired + Bunch(f, 1).wait_for_finished() + + def test_thread_leak(self): + # The lock shouldn't leak a Thread instance when used from a foreign + # (non-threading) thread. + lock = self.locktype() + def f(): + lock.acquire() + lock.release() + n = len(threading.enumerate()) + # We run many threads in the hope that existing threads ids won't + # be recycled. + Bunch(f, 15).wait_for_finished() + self.assertEqual(n, len(threading.enumerate())) + + +class LockTests(BaseLockTests): # pylint:disable=abstract-method + """ + Tests for non-recursive, weak locks + (which can be acquired and released from different threads). + """ + def test_reacquire(self): + # Lock needs to be released before re-acquiring. + lock = self.locktype() + phase = [] + def f(): + lock.acquire() + phase.append(None) + lock.acquire() + phase.append(None) + start_new_thread(f, ()) + while not phase: + _wait() + _wait() + self.assertEqual(len(phase), 1) + lock.release() + while len(phase) == 1: + _wait() + self.assertEqual(len(phase), 2) + + def test_different_thread(self): + # Lock can be released from a different thread. + lock = self.locktype() + lock.acquire() + def f(): + lock.release() + b = Bunch(f, 1) + b.wait_for_finished() + lock.acquire() + lock.release() + + +class RLockTests(BaseLockTests): + """ + Tests for recursive locks. + """ + def test_reacquire(self): + lock = self.locktype() + lock.acquire() + lock.acquire() + lock.release() + lock.acquire() + lock.release() + lock.release() + + def test_release_unacquired(self): + # Cannot release an unacquired lock + lock = self.locktype() + self.assertRaises(RuntimeError, lock.release) + lock.acquire() + lock.acquire() + lock.release() + lock.acquire() + lock.release() + lock.release() + self.assertRaises(RuntimeError, lock.release) + + def test_different_thread(self): + # Cannot release from a different thread + lock = self.locktype() + def f(): + lock.acquire() + b = Bunch(f, 1, True) + try: + self.assertRaises(RuntimeError, lock.release) + finally: + b.do_finish() + + def test__is_owned(self): + lock = self.locktype() + self.assertFalse(lock._is_owned()) + lock.acquire() + self.assertTrue(lock._is_owned()) + lock.acquire() + self.assertTrue(lock._is_owned()) + result = [] + def f(): + result.append(lock._is_owned()) + Bunch(f, 1).wait_for_finished() + self.assertFalse(result[0]) + lock.release() + self.assertTrue(lock._is_owned()) + lock.release() + self.assertFalse(lock._is_owned()) + + +class EventTests(BaseTestCase): + """ + Tests for Event objects. + """ + + def eventtype(self): + raise NotImplementedError() + + def test_is_set(self): + evt = self.eventtype() + self.assertFalse(evt.is_set()) + evt.set() + self.assertTrue(evt.is_set()) + evt.set() + self.assertTrue(evt.is_set()) + evt.clear() + self.assertFalse(evt.is_set()) + evt.clear() + self.assertFalse(evt.is_set()) + + def _check_notify(self, evt): + # All threads get notified + N = 5 + results1 = [] + results2 = [] + def f(): + evt.wait() + results1.append(evt.is_set()) + evt.wait() + results2.append(evt.is_set()) + b = Bunch(f, N) + b.wait_for_started() + _wait() + self.assertEqual(len(results1), 0) + evt.set() + b.wait_for_finished() + self.assertEqual(results1, [True] * N) + self.assertEqual(results2, [True] * N) + + def test_notify(self): + evt = self.eventtype() + self._check_notify(evt) + # Another time, after an explicit clear() + evt.set() + evt.clear() + self._check_notify(evt) + + def test_timeout(self): + evt = self.eventtype() + results1 = [] + results2 = [] + N = 5 + def f(): + evt.wait(0.0) + results1.append(evt.is_set()) + t1 = time.time() + evt.wait(0.2) + r = evt.is_set() + t2 = time.time() + results2.append((r, t2 - t1)) + Bunch(f, N).wait_for_finished() + self.assertEqual(results1, [False] * N) + for r, dt in results2: + self.assertFalse(r) + self.assertTimeWithinRange(dt, 0.18, 10) + # The event is set + results1 = [] + results2 = [] + evt.set() + Bunch(f, N).wait_for_finished() + self.assertEqual(results1, [True] * N) + for r, dt in results2: + self.assertTrue(r) + + +class ConditionTests(BaseTestCase): + """ + Tests for condition variables. + """ + + def condtype(self, *args): + raise NotImplementedError() + + def test_acquire(self): + cond = self.condtype() + # Be default we have an RLock: the condition can be acquired multiple + # times. + cond.acquire() + cond.acquire() + cond.release() + cond.release() + lock = threading.Lock() + cond = self.condtype(lock) + cond.acquire() + self.assertFalse(lock.acquire(False)) + cond.release() + self.assertTrue(lock.acquire(False)) + self.assertFalse(cond.acquire(False)) + lock.release() + with cond: + self.assertFalse(lock.acquire(False)) + + def test_unacquired_wait(self): + cond = self.condtype() + self.assertRaises(RuntimeError, cond.wait) + + def test_unacquired_notify(self): + cond = self.condtype() + self.assertRaises(RuntimeError, cond.notify) + + def _check_notify(self, cond): + N = 5 + results1 = [] + results2 = [] + phase_num = 0 + def f(): + cond.acquire() + cond.wait() + cond.release() + results1.append(phase_num) + cond.acquire() + cond.wait() + cond.release() + results2.append(phase_num) + b = Bunch(f, N) + b.wait_for_started() + _wait() + self.assertEqual(results1, []) + # Notify 3 threads at first + cond.acquire() + cond.notify(3) + _wait() + phase_num = 1 + cond.release() + while len(results1) < 3: + _wait() + self.assertEqual(results1, [1] * 3) + self.assertEqual(results2, []) + # Notify 5 threads: they might be in their first or second wait + cond.acquire() + cond.notify(5) + _wait() + phase_num = 2 + cond.release() + while len(results1) + len(results2) < 8: + _wait() + self.assertEqual(results1, [1] * 3 + [2] * 2) + self.assertEqual(results2, [2] * 3) + # Notify all threads: they are all in their second wait + cond.acquire() + cond.notify_all() + _wait() + phase_num = 3 + cond.release() + while len(results2) < 5: + _wait() + self.assertEqual(results1, [1] * 3 + [2] * 2) + self.assertEqual(results2, [2] * 3 + [3] * 2) + b.wait_for_finished() + + def test_notify(self): + cond = self.condtype() + self._check_notify(cond) + # A second time, to check internal state is still ok. + self._check_notify(cond) + + def test_timeout(self): + cond = self.condtype() + results = [] + N = 5 + def f(): + cond.acquire() + t1 = time.time() + cond.wait(0.2) + t2 = time.time() + cond.release() + results.append(t2 - t1) + Bunch(f, N).wait_for_finished() + self.assertEqual(len(results), 5) + for dt in results: + # XXX: libuv sometimes produces 0.19958 + self.assertTimeWithinRange(dt, 0.19, 2.0) + + +class BaseSemaphoreTests(BaseTestCase): + """ + Common tests for {bounded, unbounded} semaphore objects. + """ + + def semtype(self, *args): + raise NotImplementedError() + + def test_constructor(self): + self.assertRaises(ValueError, self.semtype, value=-1) + # Py3 doesn't have sys.maxint + self.assertRaises(ValueError, self.semtype, + value=-getattr(sys, 'maxint', getattr(sys, 'maxsize', None))) + + def test_acquire(self): + sem = self.semtype(1) + sem.acquire() + sem.release() + sem = self.semtype(2) + sem.acquire() + sem.acquire() + sem.release() + sem.release() + + def test_acquire_destroy(self): + sem = self.semtype() + sem.acquire() + del sem + + def test_acquire_contended(self): + sem = self.semtype(7) + sem.acquire() + #N = 10 + results1 = [] + results2 = [] + phase_num = 0 + def f(): + sem.acquire() + results1.append(phase_num) + sem.acquire() + results2.append(phase_num) + b = Bunch(f, 10) + b.wait_for_started() + while len(results1) + len(results2) < 6: + _wait() + self.assertEqual(results1 + results2, [0] * 6) + phase_num = 1 + for _ in range(7): + sem.release() + while len(results1) + len(results2) < 13: + _wait() + self.assertEqual(sorted(results1 + results2), [0] * 6 + [1] * 7) + phase_num = 2 + for _ in range(6): + sem.release() + while len(results1) + len(results2) < 19: + _wait() + self.assertEqual(sorted(results1 + results2), [0] * 6 + [1] * 7 + [2] * 6) + # The semaphore is still locked + self.assertFalse(sem.acquire(False)) + # Final release, to let the last thread finish + sem.release() + b.wait_for_finished() + + def test_try_acquire(self): + sem = self.semtype(2) + self.assertTrue(sem.acquire(False)) + self.assertTrue(sem.acquire(False)) + self.assertFalse(sem.acquire(False)) + sem.release() + self.assertTrue(sem.acquire(False)) + + def test_try_acquire_contended(self): + sem = self.semtype(4) + sem.acquire() + results = [] + def f(): + results.append(sem.acquire(False)) + results.append(sem.acquire(False)) + Bunch(f, 5).wait_for_finished() + # There can be a thread switch between acquiring the semaphore and + # appending the result, therefore results will not necessarily be + # ordered. + self.assertEqual(sorted(results), [False] * 7 + [True] * 3) + + def test_default_value(self): + # The default initial value is 1. + sem = self.semtype() + sem.acquire() + def f(): + sem.acquire() + sem.release() + b = Bunch(f, 1) + b.wait_for_started() + _wait() + self.assertFalse(b.finished) + sem.release() + b.wait_for_finished() + + def test_with(self): + sem = self.semtype(2) + def _with(err=None): + with sem: + self.assertTrue(sem.acquire(False)) + sem.release() + with sem: + self.assertFalse(sem.acquire(False)) + if err: + raise err # pylint:disable=raising-bad-type + _with() + self.assertTrue(sem.acquire(False)) + sem.release() + self.assertRaises(TypeError, _with, TypeError) + self.assertTrue(sem.acquire(False)) + sem.release() + +class SemaphoreTests(BaseSemaphoreTests): + """ + Tests for unbounded semaphores. + """ + + def test_release_unacquired(self): + # Unbounded releases are allowed and increment the semaphore's value + sem = self.semtype(1) + sem.release() + sem.acquire() + sem.acquire() + sem.release() + + +class BoundedSemaphoreTests(BaseSemaphoreTests): + """ + Tests for bounded semaphores. + """ + + def test_release_unacquired(self): + # Cannot go past the initial value + sem = self.semtype() + self.assertRaises(ValueError, sem.release) + sem.acquire() + sem.release() + self.assertRaises(ValueError, sem.release) + +class BarrierTests(BaseTestCase): + """ + Tests for Barrier objects. + """ + N = 5 + defaultTimeout = 2.0 + + def setUp(self): + self.barrier = self.barriertype(self.N, timeout=self.defaultTimeout) + def tearDown(self): + self.barrier.abort() + + def run_threads(self, f): + b = Bunch(f, self.N-1) + f() + b.wait_for_finished() + + def multipass(self, results, n): + m = self.barrier.parties + self.assertEqual(m, self.N) + for i in range(n): + results[0].append(True) + self.assertEqual(len(results[1]), i * m) + self.barrier.wait() + results[1].append(True) + self.assertEqual(len(results[0]), (i + 1) * m) + self.barrier.wait() + self.assertEqual(self.barrier.n_waiting, 0) + self.assertFalse(self.barrier.broken) + + def test_barrier(self, passes=1): + """ + Test that a barrier is passed in lockstep + """ + results = [[], []] + def f(): + self.multipass(results, passes) + self.run_threads(f) + + def test_barrier_10(self): + """ + Test that a barrier works for 10 consecutive runs + """ + return self.test_barrier(10) + + def test_wait_return(self): + """ + test the return value from barrier.wait + """ + results = [] + def f(): + r = self.barrier.wait() + results.append(r) + + self.run_threads(f) + self.assertEqual(sum(results), sum(range(self.N))) + + def test_action(self): + """ + Test the 'action' callback + """ + results = [] + def action(): + results.append(True) + barrier = self.barriertype(self.N, action) + def f(): + barrier.wait() + self.assertEqual(len(results), 1) + + self.run_threads(f) + + def test_abort(self): + """ + Test that an abort will put the barrier in a broken state + """ + results1 = [] + results2 = [] + def f(): + try: + i = self.barrier.wait() + if i == self.N//2: + raise RuntimeError + self.barrier.wait() + results1.append(True) + except threading.BrokenBarrierError: + results2.append(True) + except RuntimeError: + self.barrier.abort() + + self.run_threads(f) + self.assertEqual(len(results1), 0) + self.assertEqual(len(results2), self.N-1) + self.assertTrue(self.barrier.broken) + + def test_reset(self): + """ + Test that a 'reset' on a barrier frees the waiting threads + """ + results1 = [] + results2 = [] + results3 = [] + def f(): + i = self.barrier.wait() + if i == self.N//2: + # Wait until the other threads are all in the barrier. + while self.barrier.n_waiting < self.N-1: + time.sleep(0.001) + self.barrier.reset() + else: + try: + self.barrier.wait() + results1.append(True) + except threading.BrokenBarrierError: + results2.append(True) + # Now, pass the barrier again + self.barrier.wait() + results3.append(True) + + self.run_threads(f) + self.assertEqual(len(results1), 0) + self.assertEqual(len(results2), self.N-1) + self.assertEqual(len(results3), self.N) + + + def test_abort_and_reset(self): + """ + Test that a barrier can be reset after being broken. + """ + results1 = [] + results2 = [] + results3 = [] + barrier2 = self.barriertype(self.N) + def f(): + try: + i = self.barrier.wait() + if i == self.N//2: + raise RuntimeError + self.barrier.wait() + results1.append(True) + except threading.BrokenBarrierError: + results2.append(True) + except RuntimeError: + self.barrier.abort() + + # Synchronize and reset the barrier. Must synchronize first so + # that everyone has left it when we reset, and after so that no + # one enters it before the reset. + if barrier2.wait() == self.N//2: + self.barrier.reset() + barrier2.wait() + self.barrier.wait() + results3.append(True) + + self.run_threads(f) + self.assertEqual(len(results1), 0) + self.assertEqual(len(results2), self.N-1) + self.assertEqual(len(results3), self.N) + + def test_timeout(self): + """ + Test wait(timeout) + """ + def f(): + i = self.barrier.wait() + if i == self.N // 2: + # One thread is late! + time.sleep(1.0) + # Default timeout is 2.0, so this is shorter. + self.assertRaises(threading.BrokenBarrierError, + self.barrier.wait, 0.5) + self.run_threads(f) + + def test_default_timeout(self): + """ + Test the barrier's default timeout + """ + # create a barrier with a low default timeout + barrier = self.barriertype(self.N, timeout=0.3) + def f(): + i = barrier.wait() + if i == self.N // 2: + # One thread is later than the default timeout of 0.3s. + time.sleep(1.0) + self.assertRaises(threading.BrokenBarrierError, barrier.wait) + self.run_threads(f) + + def test_single_thread(self): + b = self.barriertype(1) + b.wait() + b.wait() + + +if __name__ == '__main__': + print("This module contains no tests; it is used by other test cases like test_threading_2") diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/monkey_package/__main__.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/monkey_package/__main__.py new file mode 100644 index 00000000..316d16fc --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/monkey_package/__main__.py @@ -0,0 +1,5 @@ +from __future__ import print_function +# This file makes this directory into a package. +# it exists to test 'python -m gevent.monkey monkey_package' +print(__file__) +print(__name__) diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/monkey_package/issue302monkey.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/monkey_package/issue302monkey.py new file mode 100644 index 00000000..73b5d1ff --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/monkey_package/issue302monkey.py @@ -0,0 +1,28 @@ +from __future__ import print_function +import socket +import sys +if sys.argv[1] == 'patched': + print('gevent' in repr(socket.socket)) +else: + assert sys.argv[1] == 'stdlib' + print('gevent' not in repr(socket.socket)) +print(__file__) + +if sys.version_info[:2] == (2, 7): + # Prior to gevent 1.3, 'python -m gevent.monkey' guaranteed this to be + # None for all python versions. + print(__package__ == None) +else: + if sys.argv[1] == 'patched': + # __package__ is handled differently, for some reason, and + # runpy doesn't let us override it. When we call it, it + # becomes ''. This appears to be against the documentation for + # runpy, which says specifically "If the supplied path + # directly references a script file (whether as source or as + # precompiled byte code), then __file__ will be set to the + # supplied path, and __spec__, __cached__, __loader__ and + # __package__ will all be set to None." + print(__package__ == '') + else: + # but the interpreter sets it to None + print(__package__ == None) diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/monkey_package/script.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/monkey_package/script.py new file mode 100644 index 00000000..8584fb7d --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/monkey_package/script.py @@ -0,0 +1,19 @@ +# -*- coding: utf-8 -*- +""" +Test script file, to be used directly as a file. +""" +from __future__ import absolute_import +from __future__ import division +from __future__ import print_function + + +# We need some global imports +from textwrap import dedent + +def use_import(): + return dedent(" text") + +if __name__ == '__main__': + print(__file__) + print(__name__) + print(use_import()) diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/nullcert.pem b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/nullcert.pem new file mode 100644 index 00000000..e69de29b diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/server.crt b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/server.crt new file mode 100644 index 00000000..1379e1d1 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/server.crt @@ -0,0 +1,15 @@ +-----BEGIN CERTIFICATE----- +MIICYzCCAcwCCQD5jx1Aa0dytjANBgkqhkiG9w0BAQQFADB2MQswCQYDVQQGEwJU +UzENMAsGA1UECBMEVGVzdDENMAsGA1UEBxMEVGVzdDEWMBQGA1UEChMNVGVzdCBF +dmVudGxldDENMAsGA1UECxMEVGVzdDENMAsGA1UEAxMEVGVzdDETMBEGCSqGSIb3 +DQEJARYEVGVzdDAeFw0wODA3MDgyMTExNDJaFw0xMDAyMDgwODE1MTBaMHYxCzAJ +BgNVBAYTAlRTMQ0wCwYDVQQIEwRUZXN0MQ0wCwYDVQQHEwRUZXN0MRYwFAYDVQQK +Ew1UZXN0IEV2ZW50bGV0MQ0wCwYDVQQLEwRUZXN0MQ0wCwYDVQQDEwRUZXN0MRMw +EQYJKoZIhvcNAQkBFgRUZXN0MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDM +WcyeIiHQuEGQxgTIvu0aOW4iRFAyUEi8pLWNCxMEHglF8k6OxFVq7XWZMDnDFVnb +ZjmQh5Tc21Ae6cXzxXln578fROXHEzXo3Is8HUlq3ug1yYOGHjxw++Opjf1uoHwP +EBUKsz/flS7knuscgFM9FO05KSPn2wHnZeIDta4yTwIDAQABMA0GCSqGSIb3DQEB +BAUAA4GBAKM71aP0r26gEEEBzovfXm1IwKav6R9/xiWsJ4pFsUXVotcaIjcVBDG1 +Z7tz688hokb+GNxsTI2gNfqanqUnfP9wZxnKRmfTSOvb5aWHIiaiMXSgjiPlqBcm +6mnSeEbSMM9cw479wWhh1YqY8tf3gYJa+sxznVWLSfVLpsjRMphe +-----END CERTIFICATE----- diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/server.key b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/server.key new file mode 100644 index 00000000..24cd8e5a --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/server.key @@ -0,0 +1,15 @@ +-----BEGIN RSA PRIVATE KEY----- +MIICXgIBAAKBgQDMWcyeIiHQuEGQxgTIvu0aOW4iRFAyUEi8pLWNCxMEHglF8k6O +xFVq7XWZMDnDFVnbZjmQh5Tc21Ae6cXzxXln578fROXHEzXo3Is8HUlq3ug1yYOG +Hjxw++Opjf1uoHwPEBUKsz/flS7knuscgFM9FO05KSPn2wHnZeIDta4yTwIDAQAB +AoGBAKWfvq0IIvok7Ncm92ew/0D6/R1+2rT8xwdGQ/Nt31q98WwkqLEjxctlbKPd +J2PLIUomf0955BhhFH4JoSwjiHJQ6uishY7srjQQDX/Dxdi5wZAyxYCIVW/kAA9N +/u2s75hSD3s/rqAwOZ182DwAPIqJc4KQoYzvlKERSMDT1PJhAkEA5SUFsiSzBEMX +FyZ++ZMMs1vHrTu5oTK7WHznh9lk7dvsnp9BoUPqhiu8iJ7Q23zj0u5asz2czu11 +nnczXgU6XwJBAORM5Ib4I7nAsoUWn9wDiTwVQeE+D9P1ac9p7EHm7XXuf8o2irRZ +wYYfpXXsjk496YfyQFcQRMk0tU0gegCP7hECQFWRWqwoajUoPIInnPjjwbVki48U +I4CfqjgkBG3Fb5wnKRgezmpDK1vJD1FRRRsBay4EVhhi5KCdKfPv/V2ZxC8CQQCu +U5SxBytofJ8UhxkcTErvaR/8GYLGi//21GAGVop+YdaMlydE3cCrZODYcgCb+CSp +nS7KDG8p4KiMMz9VzJGxAkEAv85K6Sa3H8g9h7LwopBZ5tFNZUaFWo7lEP7DDMH0 +eckZTb1JVpyT/8zrDtsis4WlV9zVkVHxkIaad503BjqvEQ== +-----END RSA PRIVATE KEY----- diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/sha256.pem b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/sha256.pem new file mode 100644 index 00000000..01878e96 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/sha256.pem @@ -0,0 +1,33 @@ +-----BEGIN CERTIFICATE----- +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 +-----END CERTIFICATE----- diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__GreenletExit.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__GreenletExit.py new file mode 100644 index 00000000..acad1bb1 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__GreenletExit.py @@ -0,0 +1,4 @@ +from gevent import GreenletExit + +assert issubclass(GreenletExit, BaseException) +assert not issubclass(GreenletExit, Exception) diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test___config.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test___config.py new file mode 100644 index 00000000..316e03a8 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test___config.py @@ -0,0 +1,154 @@ +# Copyright 2018 gevent contributors. See LICENSE for details. + +import os +import unittest +import sys + +from gevent import _config + +class TestResolver(unittest.TestCase): + + old_resolver = None + + def setUp(self): + if 'GEVENT_RESOLVER' in os.environ: + self.old_resolver = os.environ['GEVENT_RESOLVER'] + del os.environ['GEVENT_RESOLVER'] + + def tearDown(self): + if self.old_resolver: + os.environ['GEVENT_RESOLVER'] = self.old_resolver + + def test_key(self): + self.assertEqual(_config.Resolver.environment_key, 'GEVENT_RESOLVER') + + def test_default(self): + from gevent.resolver.thread import Resolver + + conf = _config.Resolver() + self.assertEqual(conf.get(), Resolver) + + def test_env(self): + from gevent.resolver.blocking import Resolver + + os.environ['GEVENT_RESOLVER'] = 'foo,bar,block,dnspython' + + conf = _config.Resolver() + self.assertEqual(conf.get(), Resolver) + + os.environ['GEVENT_RESOLVER'] = 'dnspython' + + # The existing value is unchanged + self.assertEqual(conf.get(), Resolver) + + # A new object reflects it + conf = _config.Resolver() + from gevent.resolver.dnspython import Resolver as DResolver + self.assertEqual(conf.get(), DResolver) + + def test_set_str_long(self): + from gevent.resolver.blocking import Resolver + conf = _config.Resolver() + conf.set('gevent.resolver.blocking.Resolver') + + self.assertEqual(conf.get(), Resolver) + + def test_set_str_short(self): + from gevent.resolver.blocking import Resolver + conf = _config.Resolver() + conf.set('block') + + self.assertEqual(conf.get(), Resolver) + + def test_set_class(self): + from gevent.resolver.blocking import Resolver + conf = _config.Resolver() + conf.set(Resolver) + + self.assertEqual(conf.get(), Resolver) + + + def test_set_through_config(self): + from gevent.resolver.thread import Resolver as Default + from gevent.resolver.blocking import Resolver + + conf = _config.Config() + self.assertEqual(conf.resolver, Default) + + conf.resolver = 'block' + self.assertEqual(conf.resolver, Resolver) + +class TestFunctions(unittest.TestCase): + + def test_validate_bool(self): + self.assertTrue(_config.validate_bool('on')) + self.assertTrue(_config.validate_bool('1')) + self.assertFalse(_config.validate_bool('off')) + self.assertFalse(_config.validate_bool('0')) + self.assertFalse(_config.validate_bool('')) + + with self.assertRaises(ValueError): + _config.validate_bool(' hmm ') + + def test_validate_invalid(self): + with self.assertRaises(ValueError): + _config.validate_invalid(self) + +class TestConfig(unittest.TestCase): + + def test__dir__(self): + self.assertEqual(sorted(_config.config.settings), + sorted(dir(_config.config))) + + def test_getattr(self): + # Bypass the property that might be set here + self.assertIsNotNone(_config.config.__getattr__('resolver')) + + def test__getattr__invalid(self): + with self.assertRaises(AttributeError): + getattr(_config.config, 'no_such_setting') + + def test_set_invalid(self): + with self.assertRaises(AttributeError): + _config.config.set('no such setting', True) + +class TestImportableSetting(unittest.TestCase): + + assertRaisesRegex = getattr(unittest.TestCase, 'assertRaisesRegex', + unittest.TestCase.assertRaisesRegexp) + def test_empty_list(self): + i = _config.ImportableSetting() + with self.assertRaisesRegex(ImportError, + "Cannot import from empty list"): + i._import_one_of([]) + + def test_path_not_supported(self): + import warnings + i = _config.ImportableSetting() + path = list(sys.path) + with warnings.catch_warnings(record=True) as w: + warnings.simplefilter("always") + with self.assertRaisesRegex(ImportError, + "Cannot import 'foo/bar/gevent.no_such_module'"): + i._import_one('foo/bar/gevent.no_such_module') + + # We restored the path + self.assertEqual(path, sys.path) + + # We did not issue a warning + self.assertEqual(len(w), 0) + + def test_non_string(self): + i = _config.ImportableSetting() + self.assertIs(i._import_one(self), self) + + def test_get_options(self): + i = _config.ImportableSetting() + self.assertEqual({}, i.get_options()) + + i.shortname_map = {'foo': 'bad/path'} + options = i.get_options() + self.assertIn('foo', options) + +if __name__ == '__main__': + unittest.main() diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test___example_servers.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test___example_servers.py new file mode 100644 index 00000000..2b3453ce --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test___example_servers.py @@ -0,0 +1,141 @@ +import sys + +try: + from urllib import request as urllib2 +except ImportError: + import urllib2 +from unittest import SkipTest + +import socket +import ssl + +import gevent.testing as greentest +from gevent.testing import DEFAULT_XPC_SOCKET_TIMEOUT +from gevent.testing import util +from gevent.testing import params + +@greentest.skipOnCI("Timing issues sometimes lead to a connection refused") +class Test_wsgiserver(util.TestServer): + server = 'wsgiserver.py' + URL = 'http://%s:8088' % (params.DEFAULT_LOCAL_HOST_ADDR,) + PORT = 8088 + not_found_message = b'

Not Found

' + ssl_ctx = None + _use_ssl = False + + def read(self, path='/'): + url = self.URL + path + try: + kwargs = {} + if self.ssl_ctx is not None: + kwargs = {'context': self.ssl_ctx} + + response = urllib2.urlopen(url, None, + DEFAULT_XPC_SOCKET_TIMEOUT, + **kwargs) + except urllib2.HTTPError: + response = sys.exc_info()[1] + result = '%s %s' % (response.code, response.msg), response.read() + # XXX: It looks like under PyPy this isn't directly closing the socket + # when SSL is in use. It takes a GC cycle to make that true. + response.close() + return result + + def _test_hello(self): + status, data = self.read('/') + self.assertEqual(status, '200 OK') + self.assertEqual(data, b"hello world") + + def _test_not_found(self): + status, data = self.read('/xxx') + self.assertEqual(status, '404 Not Found') + self.assertEqual(data, self.not_found_message) + + def _do_test_a_blocking_client(self): + # We spawn this in a separate server because if it's broken + # the whole server hangs + with self.running_server(): + # First, make sure we can talk to it. + self._test_hello() + # Now create a connection and only partway finish + # the transaction + sock = socket.create_connection(('localhost', self.PORT)) + ssl_sock = None + if self._use_ssl: + ssl_sock = ssl.wrap_socket(sock) + sock_file = ssl_sock.makefile(mode='rwb') + else: + sock_file = sock.makefile(mode='rwb') + # write an incomplete request + sock_file.write(b'GET /xxx HTTP/1.0\r\n') + sock_file.flush() + # Leave it open and not doing anything + # while the other request runs to completion. + # This demonstrates that a blocking client + # doesn't hang the whole server + self._test_hello() + + # now finish the original request + sock_file.write(b'\r\n') + sock_file.flush() + line = sock_file.readline() + self.assertEqual(line, b'HTTP/1.1 404 Not Found\r\n') + + sock_file.close() + if ssl_sock is not None: + ssl_sock.close() + sock.close() + + def test_a_blocking_client(self): + self._do_test_a_blocking_client() + +@greentest.skipOnCI("Timing issues sometimes lead to a connection refused") +class Test_wsgiserver_ssl(Test_wsgiserver): + server = 'wsgiserver_ssl.py' + URL = 'https://%s:8443' % (params.DEFAULT_LOCAL_HOST_ADDR,) + PORT = 8443 + _use_ssl = True + + if hasattr(ssl, '_create_unverified_context'): + # Disable verification for our self-signed cert + # on Python >= 2.7.9 and 3.4 + ssl_ctx = ssl._create_unverified_context() + + +@greentest.skipOnCI("Timing issues sometimes lead to a connection refused") +class Test_webproxy(Test_wsgiserver): + server = 'webproxy.py' + + def _run_all_tests(self): + status, data = self.read('/') + self.assertEqual(status, '200 OK') + self.assertIn(b"gevent example", data) + status, data = self.read('/http://www.google.com') + self.assertEqual(status, '200 OK') + self.assertIn(b'google', data.lower()) + + def test_a_blocking_client(self): + # Not applicable + raise SkipTest("Not applicable") + + +# class Test_webpy(Test_wsgiserver): +# server = 'webpy.py' +# not_found_message = 'not found' +# +# def _test_hello(self): +# status, data = self.read('/') +# self.assertEqual(status, '200 OK') +# assert "Hello, world" in data, repr(data) +# +# def _test_long(self): +# start = time.time() +# status, data = self.read('/long') +# delay = time.time() - start +# assert 10 - 0.5 < delay < 10 + 0.5, delay +# self.assertEqual(status, '200 OK') +# self.assertEqual(data, 'Hello, 10 seconds later') + + +if __name__ == '__main__': + greentest.main() diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test___ident.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test___ident.py new file mode 100644 index 00000000..aa82d419 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test___ident.py @@ -0,0 +1,80 @@ +# -*- coding: utf-8 -*- +# copyright 2018 gevent contributors. See LICENSE for details. + +from __future__ import absolute_import +from __future__ import division +from __future__ import print_function + +import gc + + +import gevent.testing as greentest +from gevent._ident import IdentRegistry +from gevent._compat import PYPY + +class Target(object): + pass + +class TestIdent(greentest.TestCase): + + def setUp(self): + self.reg = IdentRegistry() + + def tearDown(self): + self.reg = None + + def test_basic(self): + target = Target() + self.assertEqual(0, self.reg.get_ident(target)) + self.assertEqual(1, len(self.reg)) + + self.assertEqual(0, self.reg.get_ident(target)) + self.assertEqual(1, len(self.reg)) + + target2 = Target() + self.assertEqual(1, self.reg.get_ident(target2)) + self.assertEqual(2, len(self.reg)) + + self.assertEqual(1, self.reg.get_ident(target2)) + self.assertEqual(2, len(self.reg)) + + self.assertEqual(0, self.reg.get_ident(target)) + + # When an object dies, we can re-use + # its id. Under PyPy we need to collect garbage first. + del target + if PYPY: + for _ in range(3): + gc.collect() + + self.assertEqual(1, len(self.reg)) + + target3 = Target() + self.assertEqual(1, self.reg.get_ident(target2)) + self.assertEqual(0, self.reg.get_ident(target3)) + self.assertEqual(2, len(self.reg)) + + @greentest.skipOnPyPy("This would need to GC very frequently") + def test_circle(self): + keep_count = 3 + keepalive = [None] * keep_count + + for i in range(1000): + target = Target() + # Drop an old one. + keepalive[i % keep_count] = target + self.assertLessEqual(self.reg.get_ident(target), keep_count) + + +@greentest.skipOnPurePython("Needs C extension") +class TestCExt(greentest.TestCase): + + def test_c_extension(self): + self.assertEqual(IdentRegistry.__module__, + 'gevent.__ident') + + + + +if __name__ == '__main__': + greentest.main() diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test___monitor.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test___monitor.py new file mode 100644 index 00000000..e5a003a8 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test___monitor.py @@ -0,0 +1,386 @@ +# Copyright 2018 gevent contributors. See LICENSE for details. + +import gc +import unittest + + +from greenlet import gettrace +from greenlet import settrace + +from gevent.monkey import get_original +from gevent._compat import thread_mod_name +from gevent._compat import NativeStrIO + +from gevent.testing.skipping import skipOnPyPyOnWindows + +from gevent import _monitor as monitor +from gevent import config as GEVENT_CONFIG + +get_ident = get_original(thread_mod_name, 'get_ident') + +class MockHub(object): + _threadpool = None + _resolver = None + + def __init__(self): + self.thread_ident = get_ident() + self.exception_stream = NativeStrIO() + self.dead = False + + def __bool__(self): + return not self.dead + + __nonzero__ = __bool__ + + def handle_error(self, *args): # pylint:disable=unused-argument + raise # pylint:disable=misplaced-bare-raise + + @property + def loop(self): + return self + + def reinit(self): + "mock loop.reinit" + +class _AbstractTestPeriodicMonitoringThread(object): + # Makes sure we don't actually spin up a new monitoring thread. + + # pylint:disable=no-member + + def setUp(self): + super(_AbstractTestPeriodicMonitoringThread, self).setUp() + self._orig_start_new_thread = monitor.start_new_thread + self._orig_thread_sleep = monitor.thread_sleep + monitor.thread_sleep = lambda _s: gc.collect() # For PyPy + self.tid = 0xDEADBEEF + def start_new_thread(_f, _a): + r = self.tid + self.tid += 1 + return r + + monitor.start_new_thread = start_new_thread + self.hub = MockHub() + self.pmt = monitor.PeriodicMonitoringThread(self.hub) + self.hub.periodic_monitoring_thread = self.pmt + self.pmt_default_funcs = self.pmt.monitoring_functions()[:] + self.len_pmt_default_funcs = len(self.pmt_default_funcs) + + def tearDown(self): + monitor.start_new_thread = self._orig_start_new_thread + monitor.thread_sleep = self._orig_thread_sleep + prev = self.pmt._greenlet_tracer.previous_trace_function + self.pmt.kill() + assert gettrace() is prev, (gettrace(), prev) + settrace(None) + super(_AbstractTestPeriodicMonitoringThread, self).tearDown() + + +class TestPeriodicMonitoringThread(_AbstractTestPeriodicMonitoringThread, + unittest.TestCase): + + def test_constructor(self): + self.assertEqual(0xDEADBEEF, self.pmt.monitor_thread_ident) + self.assertEqual(gettrace(), self.pmt._greenlet_tracer) + + @skipOnPyPyOnWindows("psutil doesn't install on PyPy on Win") + def test_get_process(self): + proc = self.pmt._get_process() + self.assertIsNotNone(proc) + self.assertIs(proc, self.pmt._get_process()) + + def test_hub_wref(self): + self.assertIs(self.hub, self.pmt.hub) + del self.hub + + gc.collect() + self.assertIsNone(self.pmt.hub) + + # And it killed itself. + self.assertFalse(self.pmt.should_run) + self.assertIsNone(gettrace()) + + + def test_add_monitoring_function(self): + + self.assertRaises(ValueError, self.pmt.add_monitoring_function, None, 1) + self.assertRaises(ValueError, self.pmt.add_monitoring_function, lambda: None, -1) + + def f(): + "Does nothing" + + # Add + self.pmt.add_monitoring_function(f, 1) + self.assertEqual(self.len_pmt_default_funcs + 1, len(self.pmt.monitoring_functions())) + self.assertEqual(1, self.pmt.monitoring_functions()[1].period) + + # Update + self.pmt.add_monitoring_function(f, 2) + self.assertEqual(self.len_pmt_default_funcs + 1, len(self.pmt.monitoring_functions())) + self.assertEqual(2, self.pmt.monitoring_functions()[1].period) + + # Remove + self.pmt.add_monitoring_function(f, None) + self.assertEqual(self.len_pmt_default_funcs, len(self.pmt.monitoring_functions())) + + def test_calculate_sleep_time(self): + self.assertEqual( + self.pmt.monitoring_functions()[0].period, + self.pmt.calculate_sleep_time()) + + # Pretend that GEVENT_CONFIG.max_blocking_time was set to 0, + # to disable this monitor. + self.pmt._calculated_sleep_time = 0 + self.assertEqual( + self.pmt.inactive_sleep_time, + self.pmt.calculate_sleep_time() + ) + + # Getting the list of monitoring functions will also + # do this, if it looks like it has changed + self.pmt.monitoring_functions()[0].period = -1 + self.pmt._calculated_sleep_time = 0 + self.pmt.monitoring_functions() + self.assertEqual( + self.pmt.monitoring_functions()[0].period, + self.pmt.calculate_sleep_time()) + self.assertEqual( + self.pmt.monitoring_functions()[0].period, + self.pmt._calculated_sleep_time) + + def test_call_destroyed_hub(self): + # Add a function that destroys the hub so we break out (eventually) + # This clears the wref, which eventually calls kill() + def f(_hub): + _hub = None + self.hub = None + gc.collect() + + self.pmt.add_monitoring_function(f, 0.1) + self.pmt() + self.assertFalse(self.pmt.should_run) + + def test_call_dead_hub(self): + # Add a function that makes the hub go false (e.g., it quit) + # This causes the function to kill itself. + def f(hub): + hub.dead = True + self.pmt.add_monitoring_function(f, 0.1) + self.pmt() + self.assertFalse(self.pmt.should_run) + + def test_call_SystemExit(self): + # breaks the loop + def f(_hub): + raise SystemExit() + + self.pmt.add_monitoring_function(f, 0.1) + self.pmt() + + def test_call_other_error(self): + class MyException(Exception): + pass + + def f(_hub): + raise MyException() + + self.pmt.add_monitoring_function(f, 0.1) + with self.assertRaises(MyException): + self.pmt() + + def test_hub_reinit(self): + import os + from gevent.hub import reinit + self.pmt.pid = -1 + old_tid = self.pmt.monitor_thread_ident + + reinit(self.hub) + + self.assertEqual(os.getpid(), self.pmt.pid) + self.assertEqual(old_tid + 1, self.pmt.monitor_thread_ident) + + + +class TestPeriodicMonitorBlocking(_AbstractTestPeriodicMonitoringThread, + unittest.TestCase): + + def test_previous_trace(self): + self.pmt.kill() + self.assertIsNone(gettrace()) + + called = [] + def f(*args): + called.append(args) + + settrace(f) + + self.pmt = monitor.PeriodicMonitoringThread(self.hub) + self.assertEqual(gettrace(), self.pmt._greenlet_tracer) + self.assertIs(self.pmt._greenlet_tracer.previous_trace_function, f) + + self.pmt._greenlet_tracer('event', ('args',)) + + self.assertEqual([('event', ('args',))], called) + + def test__greenlet_tracer(self): + self.assertEqual(0, self.pmt._greenlet_tracer.greenlet_switch_counter) + # Unknown event still counts as a switch (should it?) + self.pmt._greenlet_tracer('unknown', None) + self.assertEqual(1, self.pmt._greenlet_tracer.greenlet_switch_counter) + self.assertIsNone(self.pmt._greenlet_tracer.active_greenlet) + + origin = object() + target = object() + + self.pmt._greenlet_tracer('switch', (origin, target)) + self.assertEqual(2, self.pmt._greenlet_tracer.greenlet_switch_counter) + self.assertIs(target, self.pmt._greenlet_tracer.active_greenlet) + + # Unknown event removes active greenlet + self.pmt._greenlet_tracer('unknown', ()) + self.assertEqual(3, self.pmt._greenlet_tracer.greenlet_switch_counter) + self.assertIsNone(self.pmt._greenlet_tracer.active_greenlet) + + def test_monitor_blocking(self): + # Initially there's no active greenlet and no switches, + # so nothing is considered blocked + from gevent.events import subscribers + from gevent.events import IEventLoopBlocked + from zope.interface.verify import verifyObject + events = [] + subscribers.append(events.append) + + self.assertFalse(self.pmt.monitor_blocking(self.hub)) + + # Give it an active greenlet + origin = object() + target = object() + self.pmt._greenlet_tracer('switch', (origin, target)) + + # We've switched, so we're not blocked + self.assertFalse(self.pmt.monitor_blocking(self.hub)) + self.assertFalse(events) + + # Again without switching is a problem. + self.assertTrue(self.pmt.monitor_blocking(self.hub)) + self.assertTrue(events) + verifyObject(IEventLoopBlocked, events[0]) + del events[:] + + # But we can order it not to be a problem + self.pmt.ignore_current_greenlet_blocking() + self.assertFalse(self.pmt.monitor_blocking(self.hub)) + self.assertFalse(events) + + # And back again + self.pmt.monitor_current_greenlet_blocking() + self.assertTrue(self.pmt.monitor_blocking(self.hub)) + + # A bad thread_ident in the hub doesn't mess things up + self.hub.thread_ident = -1 + self.assertTrue(self.pmt.monitor_blocking(self.hub)) + + +class MockProcess(object): + + def __init__(self, rss): + self.rss = rss + + def memory_full_info(self): + return self + + +@skipOnPyPyOnWindows("psutil doesn't install on PyPy on Win") +class TestPeriodicMonitorMemory(_AbstractTestPeriodicMonitoringThread, + unittest.TestCase): + + rss = 0 + + def setUp(self): + super(TestPeriodicMonitorMemory, self).setUp() + self._old_max = GEVENT_CONFIG.max_memory_usage + GEVENT_CONFIG.max_memory_usage = None + + self.pmt._get_process = lambda: MockProcess(self.rss) + + def tearDown(self): + GEVENT_CONFIG.max_memory_usage = self._old_max + super(TestPeriodicMonitorMemory, self).tearDown() + + def test_can_monitor_and_install(self): + + # We run tests with psutil installed, and we have access to our + # process. + self.assertTrue(self.pmt.can_monitor_memory_usage()) + # No warning, adds a function + + self.pmt.install_monitor_memory_usage() + self.assertEqual(self.len_pmt_default_funcs + 1, len(self.pmt.monitoring_functions())) + + def test_cannot_monitor_and_install(self): + import warnings + self.pmt._get_process = lambda: None + self.assertFalse(self.pmt.can_monitor_memory_usage()) + + # This emits a warning, visible by default + with warnings.catch_warnings(record=True) as ws: + self.pmt.install_monitor_memory_usage() + + self.assertEqual(1, len(ws)) + self.assertIs(monitor.MonitorWarning, ws[0].category) + + def test_monitor_no_allowed(self): + self.assertEqual(-1, self.pmt.monitor_memory_usage(None)) + + def test_monitor_greater(self): + from gevent import events + + self.rss = 2 + GEVENT_CONFIG.max_memory_usage = 1 + + # Initial event + event = self.pmt.monitor_memory_usage(None) + self.assertIsInstance(event, events.MemoryUsageThresholdExceeded) + self.assertEqual(2, event.mem_usage) + self.assertEqual(1, event.max_allowed) + self.assertIsInstance(event.memory_info, MockProcess) + + # No growth, no event + event = self.pmt.monitor_memory_usage(None) + self.assertIsNone(event) + + # Growth, event + self.rss = 3 + event = self.pmt.monitor_memory_usage(None) + self.assertIsInstance(event, events.MemoryUsageThresholdExceeded) + self.assertEqual(3, event.mem_usage) + + # Shrinking below gets us back + self.rss = 1 + event = self.pmt.monitor_memory_usage(None) + self.assertIsInstance(event, events.MemoryUsageUnderThreshold) + self.assertEqual(1, event.mem_usage) + + # coverage + repr(event) + + # No change, no event + event = self.pmt.monitor_memory_usage(None) + self.assertIsNone(event) + + # Growth, event + self.rss = 3 + event = self.pmt.monitor_memory_usage(None) + self.assertIsInstance(event, events.MemoryUsageThresholdExceeded) + self.assertEqual(3, event.mem_usage) + + + def test_monitor_initial_below(self): + self.rss = 1 + GEVENT_CONFIG.max_memory_usage = 10 + + + event = self.pmt.monitor_memory_usage(None) + self.assertIsNone(event) + +if __name__ == '__main__': + unittest.main() diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test___monkey_patching.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test___monkey_patching.py new file mode 100644 index 00000000..ea82cc5c --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test___monkey_patching.py @@ -0,0 +1,113 @@ +import sys +import os +import glob + +import atexit +# subprocess: include in subprocess tests + +from gevent.testing import util + +TIMEOUT = 120 + +# XXX: Generalize this so other packages can use it. + +def find_stdlib_tests(): + setup_py = util.search_for_setup_py(a_file=__file__) + greentest = os.path.join(setup_py, 'src', 'greentest') + + + directory = '%s.%s' % sys.version_info[:2] + full_directory = '%s.%s.%s' % sys.version_info[:3] + if hasattr(sys, 'pypy_version_info'): + directory += 'pypy' + full_directory += 'pypy' + + directory = os.path.join(greentest, directory) + full_directory = os.path.join(greentest, full_directory) + + return directory, full_directory + +def get_python_version(): + version = '%s.%s.%s' % sys.version_info[:3] + if sys.version_info[3] == 'alpha': + version += 'a%s' % sys.version_info[4] + elif sys.version_info[3] == 'beta': + version += 'b%s' % sys.version_info[4] + + return version + +def get_absolute_pythonpath(): + paths = [os.path.abspath(p) for p in os.environ.get('PYTHONPATH', '').split(os.pathsep)] + return os.pathsep.join(paths) + + +def TESTRUNNER(tests=None): + try: + test_dir, version_test_dir = find_stdlib_tests() + except util.NoSetupPyFound as e: + util.log("WARNING: No setup.py and src/greentest found: %r", e, + color="suboptimal-behaviour") + return + + if not os.path.exists(test_dir): + util.log('WARNING: No test directory found at %s', test_dir, + color="suboptimal-behaviour") + return + + with open(os.path.join(test_dir, 'version')) as f: + preferred_version = f.read().strip() + + running_version = get_python_version() + if preferred_version != running_version: + util.log('WARNING: The tests in %s/ are from version %s and your Python is %s', + test_dir, preferred_version, running_version, + color="suboptimal-behaviour") + + version_tests = glob.glob('%s/test_*.py' % version_test_dir) + version_tests = sorted(version_tests) + if not tests: + tests = glob.glob('%s/test_*.py' % test_dir) + tests = sorted(tests) + + PYTHONPATH = (os.getcwd() + os.pathsep + get_absolute_pythonpath()).rstrip(':') + + tests = [os.path.basename(x) for x in tests] + version_tests = [os.path.basename(x) for x in version_tests] + + options = { + 'cwd': test_dir, + 'timeout': TIMEOUT, + 'setenv': { + 'PYTHONPATH': PYTHONPATH, + # debug produces resource tracking warnings for the + # CFFI backends. On Python 2, many of the stdlib tests + # rely on refcounting to close sockets so they produce + # lots of noise. Python 3 is not completely immune; + # test_ftplib.py tends to produce warnings---and the Python 3 + # test framework turns those into test failures! + 'GEVENT_DEBUG': 'error', + } + } + + if tests and not sys.platform.startswith("win"): + atexit.register(os.system, 'rm -f */@test*') + + basic_args = [sys.executable, '-u', '-W', 'ignore', '-m', 'gevent.testing.monkey_test'] + for filename in tests: + if filename in version_tests: + util.log("Overriding %s from %s with file from %s", filename, test_dir, version_test_dir) + continue + yield basic_args + [filename], options.copy() + + options['cwd'] = version_test_dir + for filename in version_tests: + yield basic_args + [filename], options.copy() + + +def main(): + from gevent.testing import testrunner + return testrunner.run_many(list(TESTRUNNER(sys.argv[1:]))) + + +if __name__ == '__main__': + main() diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__all__.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__all__.py new file mode 100644 index 00000000..0efbe2c8 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__all__.py @@ -0,0 +1,241 @@ +"""Check __all__, __implements__, __extensions__, __imports__ of the modules""" +from __future__ import print_function + +import sys +import unittest +import types +import importlib +import warnings + +from gevent.testing import six +from gevent.testing.modules import walk_modules +from gevent.testing.sysinfo import PLATFORM_SPECIFIC_SUFFIXES + +from gevent._patcher import MAPPING + +class ANY(object): + def __contains__(self, item): + return True + +ANY = ANY() + +NOT_IMPLEMENTED = { + 'socket': ['CAPI'], + 'thread': ['allocate', 'exit_thread', 'interrupt_main', 'start_new'], + 'select': ANY, + 'os': ANY, + 'threading': ANY, + 'builtins' if six.PY3 else '__builtin__': ANY, + 'signal': ANY, +} + +COULD_BE_MISSING = { + 'socket': ['create_connection', 'RAND_add', 'RAND_egd', 'RAND_status'], + 'subprocess': ['_posixsubprocess'], +} + +# Things without an __all__ should generally be internal implementation +# helpers +NO_ALL = { + 'gevent.threading', + 'gevent._util', + 'gevent._compat', + 'gevent._socketcommon', + 'gevent._fileobjectcommon', + 'gevent._fileobjectposix', + 'gevent._tblib', + 'gevent._corecffi', + 'gevent._patcher', + 'gevent._ffi', +} + +ALLOW_IMPLEMENTS = [ + 'gevent._queue', +] + +# A list of modules that may contain things that aren't actually, technically, +# extensions, but that need to be in __extensions__ anyway due to the way, +# for example, monkey patching, needs to work. +EXTRA_EXTENSIONS = [] +if sys.platform.startswith('win'): + EXTRA_EXTENSIONS.append('gevent.signal') + + +class Test(unittest.TestCase): + + stdlib_has_all = False + stdlib_all = () + stdlib_name = None + stdlib_module = None + module = None + __implements__ = __extensions__ = __imports__ = () + + def check_all(self): + "Check that __all__ is present and does not contain invalid entries" + if not hasattr(self.module, '__all__'): + self.assertIn(self.modname, NO_ALL) + return + names = {} + six.exec_("from %s import *" % self.modname, names) + names.pop('__builtins__', None) + self.assertEqual(sorted(names), sorted(self.module.__all__)) + + def check_all_formula(self): + "Check __all__ = __implements__ + __extensions__ + __imported__" + all_calculated = self.__implements__ + self.__imports__ + self.__extensions__ + self.assertEqual(sorted(all_calculated), sorted(self.module.__all__)) + + def check_implements_presence_justified(self): + "Check that __implements__ is present only if the module is modeled after a module from stdlib (like gevent.socket)." + if self.modname in ALLOW_IMPLEMENTS: + return + if self.__implements__ is not None and self.stdlib_module is None: + raise AssertionError('%r has __implements__ but no stdlib counterpart (%s)' + % (self.modname, self.stdlib_name)) + + def set_stdlib_all(self): + self.assertIsNotNone(self.stdlib_module) + self.stdlib_has_all = True + self.stdlib_all = getattr(self.stdlib_module, '__all__', None) + if self.stdlib_all is None: + self.stdlib_has_all = False + self.stdlib_all = dir(self.stdlib_module) + self.stdlib_all = [name for name in self.stdlib_all if not name.startswith('_')] + self.stdlib_all = [name for name in self.stdlib_all if not isinstance(getattr(self.stdlib_module, name), types.ModuleType)] + + def check_implements_subset_of_stdlib_all(self): + "Check that __implements__ + __imports__ is a subset of the corresponding standard module __all__ or dir()" + for name in self.__implements__ + self.__imports__: + if name in self.stdlib_all: + continue + if name in COULD_BE_MISSING.get(self.stdlib_name, ()): + continue + if name in dir(self.stdlib_module): # like thread._local which is not in thread.__all__ + continue + raise AssertionError('%r is not found in %r.__all__ nor in dir(%r)' % (name, self.stdlib_module, self.stdlib_module)) + + def check_implements_actually_implements(self): + """Check that the module actually implements the entries from __implements__""" + for name in self.__implements__: + item = getattr(self.module, name) + try: + stdlib_item = getattr(self.stdlib_module, name) + self.assertIsNot(item, stdlib_item) + except AttributeError: + if name not in COULD_BE_MISSING.get(self.stdlib_name, []): + raise + + def check_imports_actually_imports(self): + """Check that the module actually imports the entries from __imports__""" + for name in self.__imports__: + item = getattr(self.module, name) + stdlib_item = getattr(self.stdlib_module, name) + self.assertIs(item, stdlib_item) + + def check_extensions_actually_extend(self): + """Check that the module actually defines new entries in __extensions__""" + if self.modname in EXTRA_EXTENSIONS: + return + for name in self.__extensions__: + if hasattr(self.stdlib_module, name): + raise AssertionError("'%r' is not an extension, it is found in %r" % (name, self.stdlib_module)) + + def check_completeness(self): # pylint:disable=too-many-branches + """Check that __all__ (or dir()) of the corresponsing stdlib is a subset of __all__ of this module""" + missed = [] + for name in self.stdlib_all: + if name not in getattr(self.module, '__all__', []): + missed.append(name) + + # handle stuff like ssl.socket and ssl.socket_error which have no reason to be in gevent.ssl.__all__ + if not self.stdlib_has_all: + for name in missed[:]: + if hasattr(self.module, name): + missed.remove(name) + + # remove known misses + not_implemented = NOT_IMPLEMENTED.get(self.stdlib_name) + if not_implemented is not None: + result = [] + for name in missed: + if name in not_implemented: + # We often don't want __all__ to be set because we wind up + # documenting things that we just copy in from the stdlib. + # But if we implement it, don't print a warning + if getattr(self.module, name, self) is self: + print('IncompleteImplWarning: %s.%s' % (self.modname, name)) + else: + result.append(name) + missed = result + + if missed: + if self.stdlib_has_all: + msg = '''The following items + in %r.__all__ +are missing from %r: + %r''' % (self.stdlib_module, self.module, missed) + else: + msg = '''The following items + in dir(%r) +are missing from %r: + %r''' % (self.stdlib_module, self.module, missed) + raise AssertionError(msg) + + def _test(self, modname): + if modname.endswith(PLATFORM_SPECIFIC_SUFFIXES): + return + + self.modname = modname + with warnings.catch_warnings(): + warnings.simplefilter('ignore', DeprecationWarning) + self.module = importlib.import_module(modname) + + self.check_all() + + self.__implements__ = getattr(self.module, '__implements__', None) + self.__imports__ = getattr(self.module, '__imports__', []) + self.__extensions__ = getattr(self.module, '__extensions__', []) + + self.stdlib_name = MAPPING.get(modname) + self.stdlib_module = None + + if self.stdlib_name is not None: + try: + self.stdlib_module = __import__(self.stdlib_name) + except ImportError: + pass + + self.check_implements_presence_justified() + + if self.stdlib_module is None: + return + + # use __all__ as __implements__ + if self.__implements__ is None: + self.__implements__ = sorted(self.module.__all__) + + self.set_stdlib_all() + self.check_implements_subset_of_stdlib_all() + self.check_implements_actually_implements() + self.check_imports_actually_imports() + self.check_extensions_actually_extend() + self.check_completeness() + + path = modname = orig_modname = None + + for path, modname in walk_modules(include_so=False, recursive=True): + orig_modname = modname + modname = modname.replace('gevent.', '').split('.')[0] + if not modname: + print("WARNING: No such module '%s' at '%s'" % (orig_modname, path), + file=sys.stderr) + continue + exec( + '''def test_%s(self): self._test("%s")''' % ( + orig_modname.replace('.', '_').replace('-', '_'), orig_modname) + ) + del path, modname, orig_modname + + +if __name__ == "__main__": + unittest.main() diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__api.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__api.py new file mode 100644 index 00000000..697a3e07 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__api.py @@ -0,0 +1,132 @@ +# Copyright (c) 2008 AG Projects +# Author: Denis Bilenko +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. + +import gevent.testing as greentest +import gevent +from gevent import util, socket + +DELAY = 0.1 + + +class Test(greentest.TestCase): + + @greentest.skipOnAppVeyor("Timing causes the state to often be [start,finished]") + def test_killing_dormant(self): + state = [] + + def test(): + try: + state.append('start') + gevent.sleep(DELAY * 3.0) + except: # pylint:disable=bare-except + state.append('except') + # catching GreenletExit + + state.append('finished') + + g = gevent.spawn(test) + gevent.sleep(DELAY / 2) + assert state == ['start'], state + g.kill() + # will not get there, unless switching is explicitly scheduled by kill + self.assertEqual(state, ['start', 'except', 'finished']) + + def test_nested_with_timeout(self): + def func(): + return gevent.with_timeout(0.2, gevent.sleep, 2, timeout_value=1) + self.assertRaises(gevent.Timeout, gevent.with_timeout, 0.1, func) + + def test_sleep_invalid_switch(self): + p = gevent.spawn(util.wrap_errors(AssertionError, gevent.sleep), 2) + gevent.sleep(0) # wait for p to start, because actual order of switching is reversed + switcher = gevent.spawn(p.switch, None) + result = p.get() + assert isinstance(result, AssertionError), result + assert 'Invalid switch' in str(result), repr(str(result)) + switcher.kill() + + if hasattr(socket, 'socketpair'): + + def _test_wait_read_invalid_switch(self, sleep): + sock1, sock2 = socket.socketpair() + try: + p = gevent.spawn(util.wrap_errors(AssertionError, + socket.wait_read), # pylint:disable=no-member + sock1.fileno()) + gevent.get_hub().loop.run_callback(switch_None, p) + if sleep is not None: + gevent.sleep(sleep) + result = p.get() + assert isinstance(result, AssertionError), result + assert 'Invalid switch' in str(result), repr(str(result)) + finally: + sock1.close() + sock2.close() + + def test_invalid_switch_None(self): + self._test_wait_read_invalid_switch(None) + + def test_invalid_switch_0(self): + self._test_wait_read_invalid_switch(0) + + def test_invalid_switch_1(self): + self._test_wait_read_invalid_switch(0.001) + + # we don't test wait_write the same way, because socket is always ready to write + + +def switch_None(g): + g.switch(None) + + +class TestTimers(greentest.TestCase): + + def test_timer_fired(self): + lst = [1] + + def func(): + gevent.spawn_later(0.01, lst.pop) + gevent.sleep(0.02) + + gevent.spawn(func) + # Func has not run yet + self.assertEqual(lst, [1]) + # Run callbacks but don't yield. + gevent.sleep() + + # Let timers fire. Func should be done. + gevent.sleep(0.1) + self.assertEqual(lst, []) + + + def test_spawn_is_not_cancelled(self): + lst = [1] + + def func(): + gevent.spawn(lst.pop) + # exiting immediately, but self.lst.pop must be called + gevent.spawn(func) + gevent.sleep(0.1) + self.assertEqual(lst, []) + + +if __name__ == '__main__': + greentest.main() diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__api_timeout.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__api_timeout.py new file mode 100644 index 00000000..98eb152d --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__api_timeout.py @@ -0,0 +1,210 @@ +# Copyright (c) 2008 AG Projects +# Author: Denis Bilenko +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. + +import sys +import gevent.testing as greentest +import weakref +import time +import gc + +from gevent import sleep +from gevent import Timeout +from gevent import get_hub + + +from gevent.testing.timing import SMALL_TICK as DELAY +from gevent.testing import flaky + + +class Error(Exception): + pass + + +class _UpdateNowProxy(object): + + update_now_calls = 0 + + def __init__(self, loop): + self.loop = loop + + def __getattr__(self, name): + return getattr(self.loop, name) + + def update_now(self): + self.update_now_calls += 1 + self.loop.update_now() + +class _UpdateNowWithTimerProxy(_UpdateNowProxy): + + def timer(self, *_args, **_kwargs): + return _Timer(self) + +class _Timer(object): + + pending = False + active = False + + def __init__(self, loop): + self.loop = loop + + def start(self, *_args, **kwargs): + if kwargs.get("update"): + self.loop.update_now() + self.pending = self.active = True + + def stop(self): + self.active = self.pending = False + + def close(self): + "Does nothing" + + +class Test(greentest.TestCase): + + def test_timeout_calls_update_now(self): + hub = get_hub() + loop = hub.loop + proxy = _UpdateNowWithTimerProxy(loop) + hub.loop = proxy + + try: + with Timeout(DELAY * 2) as t: + self.assertTrue(t.pending) + finally: + hub.loop = loop + + self.assertEqual(1, proxy.update_now_calls) + + def test_sleep_calls_update_now(self): + hub = get_hub() + loop = hub.loop + proxy = _UpdateNowProxy(loop) + hub.loop = proxy + try: + sleep(0.01) + finally: + hub.loop = loop + + self.assertEqual(1, proxy.update_now_calls) + + + @greentest.skipOnAppVeyor("Timing is flaky, especially under Py 3.4/64-bit") + @greentest.skipOnPyPy3OnCI("Timing is flaky, especially under Py 3.4/64-bit") + @greentest.reraises_flaky_timeout(Timeout) + def test_api(self): + # Nothing happens if with-block finishes before the timeout expires + t = Timeout(DELAY * 2) + self.assertFalse(t.pending, t) + with t: + self.assertTrue(t.pending, t) + sleep(DELAY) + # check if timer was actually cancelled + self.assertFalse(t.pending, t) + sleep(DELAY * 2) + + # An exception will be raised if it's not + with self.assertRaises(Timeout) as exc: + with Timeout(DELAY) as t: + sleep(DELAY * 10) + + self.assertIs(exc.exception, t) + + # You can customize the exception raised: + with self.assertRaises(IOError): + with Timeout(DELAY, IOError("Operation takes way too long")): + sleep(DELAY * 10) + + # Providing classes instead of values should be possible too: + with self.assertRaises(ValueError): + with Timeout(DELAY, ValueError): + sleep(DELAY * 10) + + + try: + 1 / 0 + except ZeroDivisionError: + with self.assertRaises(ZeroDivisionError): + with Timeout(DELAY, sys.exc_info()[0]): + sleep(DELAY * 10) + raise AssertionError('should not get there') + raise AssertionError('should not get there') + else: + raise AssertionError('should not get there') + + # It's possible to cancel the timer inside the block: + with Timeout(DELAY) as timer: + timer.cancel() + sleep(DELAY * 2) + + # To silent the exception before exiting the block, pass False as second parameter. + XDELAY = 0.1 + start = time.time() + with Timeout(XDELAY, False): + sleep(XDELAY * 2) + delta = (time.time() - start) + self.assertTimeWithinRange(delta, 0, XDELAY * 2) + + # passing None as seconds disables the timer + with Timeout(None): + sleep(DELAY) + sleep(DELAY) + + def test_ref(self): + err = Error() + err_ref = weakref.ref(err) + with Timeout(DELAY * 2, err): + sleep(DELAY) + del err + gc.collect() + self.assertFalse(err_ref(), err_ref) + + @flaky.reraises_flaky_race_condition() + def test_nested_timeout(self): + with Timeout(DELAY, False): + with Timeout(DELAY * 10, False): + sleep(DELAY * 3 * 20) + raise AssertionError('should not get there') + + with Timeout(DELAY) as t1: + with Timeout(DELAY * 20) as t2: + with self.assertRaises(Timeout) as exc: + sleep(DELAY * 30) + self.assertIs(exc.exception, t1) + + self.assertFalse(t1.pending, t1) + self.assertTrue(t2.pending, t2) + + self.assertFalse(t2.pending) + + with Timeout(DELAY * 20) as t1: + with Timeout(DELAY) as t2: + with self.assertRaises(Timeout) as exc: + sleep(DELAY * 30) + self.assertIs(exc.exception, t2) + + self.assertTrue(t1.pending, t1) + self.assertFalse(t2.pending, t2) + + self.assertFalse(t1.pending) + + +if __name__ == '__main__': + greentest.main() diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__ares_host_result.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__ares_host_result.py new file mode 100644 index 00000000..2ea36c84 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__ares_host_result.py @@ -0,0 +1,31 @@ +from __future__ import print_function + +import pickle +import gevent.testing as greentest +try: + from gevent.resolver.cares import ares_host_result +except ImportError: # pragma: no cover + ares_host_result = None + + +@greentest.skipIf(ares_host_result is None, + "Must be able to import ares") +class TestPickle(greentest.TestCase): + # Issue 104: ares.ares_host_result unpickleable + + def _test(self, protocol): + r = ares_host_result('family', ('arg1', 'arg2', )) + dumped = pickle.dumps(r, protocol) + loaded = pickle.loads(dumped) + self.assertEqual(r, loaded) + self.assertEqual(r.family, loaded.family) + + +for i in range(0, pickle.HIGHEST_PROTOCOL): + def make_test(j): + return lambda self: self._test(j) + setattr(TestPickle, 'test' + str(i), make_test(i)) + + +if __name__ == '__main__': + greentest.main() diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__ares_timeout.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__ares_timeout.py new file mode 100644 index 00000000..e2c362de --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__ares_timeout.py @@ -0,0 +1,52 @@ +from __future__ import print_function + +import errno +import unittest + +import gevent +try: + from gevent.resolver.ares import Resolver +except ImportError as ex: + Resolver = None +from gevent import socket + +import gevent.testing as greentest + +@unittest.skipIf( + Resolver is None, + "Needs ares resolver" +) +class TestTimeout(greentest.TestCase): + + __timeout__ = 30 + + address = ('', 7153) + + def test(self): + listener = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) + + try: + listener.bind(self.address) + except socket.error as ex: + if ex.errno in (errno.EPERM, errno.EADDRNOTAVAIL) or 'permission denied' in str(ex).lower(): + raise unittest.SkipTest( + 'This test binds on port a port that was already in use or not allowed.\n' + ) + raise + + + def reader(): + while True: + listener.recvfrom(10000) + + gevent.spawn(reader) + + r = Resolver(servers=['127.0.0.1'], timeout=0.001, tries=1, + udp_port=self.address[-1]) + + with self.assertRaisesRegex(socket.gaierror, "ARES_ETIMEOUT"): + r.gethostbyname('www.google.com') + + +if __name__ == '__main__': + greentest.main() diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__backdoor.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__backdoor.py new file mode 100644 index 00000000..2f60ad88 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__backdoor.py @@ -0,0 +1,135 @@ +from __future__ import print_function +import gevent.testing as greentest +import gevent +from gevent import socket +from gevent import backdoor + +def read_until(conn, postfix): + read = b'' + assert isinstance(postfix, bytes) + + while not read.endswith(postfix): + result = conn.recv(1) + if not result: + raise AssertionError('Connection ended before %r. Data read:\n%r' % (postfix, read)) + read += result + + return read if isinstance(read, str) else read.decode('utf-8') + +def readline(conn): + with conn.makefile() as f: + return f.readline() + +class Test(greentest.TestCase): + + __timeout__ = 10 + + _server = None + + def tearDown(self): + if self._server is not None: + self._server.stop() + self.close_on_teardown.remove(self._server.stop) + self._server = None + gevent.sleep() # let spawned greenlets die + super(Test, self).tearDown() + + def _make_server(self, *args, **kwargs): + assert self._server is None + self._server = backdoor.BackdoorServer(('127.0.0.1', 0), *args, **kwargs) + self._close_on_teardown(self._server.stop) + self._server.start() + + def _create_connection(self): + conn = socket.socket() + self._close_on_teardown(conn) + conn.connect(('127.0.0.1', self._server.server_port)) + return conn + + def _close(self, conn, cmd=b'quit()\r\n)'): + conn.sendall(cmd) + line = readline(conn) + self.assertEqual(line, '') + conn.close() + self.close_on_teardown.remove(conn) + + @greentest.skipOnLibuvOnTravisOnCPython27( + "segfaults; " + "See https://github.com/gevent/gevent/pull/1156") + def test_multi(self): + self._make_server() + + def connect(): + conn = self._create_connection() + read_until(conn, b'>>> ') + conn.sendall(b'2+2\r\n') + line = readline(conn) + self.assertEqual(line.strip(), '4', repr(line)) + self._close(conn) + + jobs = [gevent.spawn(connect) for _ in range(10)] + done = gevent.joinall(jobs, raise_error=True) + + self.assertEqual(len(done), len(jobs), done) + + @greentest.skipOnAppVeyor("Times out") + def test_quit(self): + self._make_server() + conn = self._create_connection() + read_until(conn, b'>>> ') + self._close(conn) + + @greentest.skipOnAppVeyor("Times out") + def test_sys_exit(self): + self._make_server() + conn = self._create_connection() + read_until(conn, b'>>> ') + self._close(conn, b'import sys; sys.exit(0)\r\n') + + @greentest.skipOnAppVeyor("Times out") + def test_banner(self): + banner = "Welcome stranger!" # native string + self._make_server(banner=banner) + conn = self._create_connection() + response = read_until(conn, b'>>> ') + self.assertEqual(response[:len(banner)], banner, response) + + self._close(conn) + + @greentest.skipOnAppVeyor("Times out") + def test_builtins(self): + self._make_server() + conn = self._create_connection() + read_until(conn, b'>>> ') + conn.sendall(b'locals()["__builtins__"]\r\n') + response = read_until(conn, b'>>> ') + self.assertTrue(len(response) < 300, msg="locals() unusable: %s..." % response) + + self._close(conn) + + def test_switch_exc(self): + from gevent.queue import Queue, Empty + + def bad(): + q = Queue() + print('switching out, then throwing in') + try: + q.get(block=True, timeout=0.1) + except Empty: + print("Got Empty") + print('switching out') + gevent.sleep(0.1) + print('switched in') + + self._make_server(locals={'bad': bad}) + conn = self._create_connection() + read_until(conn, b'>>> ') + conn.sendall(b'bad()\r\n') + response = read_until(conn, b'>>> ') + response = response.replace('\r\n', '\n') + self.assertEqual('switching out, then throwing in\nGot Empty\nswitching out\nswitched in\n>>> ', response) + + self._close(conn) + +if __name__ == '__main__': + greentest.main() diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__close_backend_fd.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__close_backend_fd.py new file mode 100644 index 00000000..4ac760e8 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__close_backend_fd.py @@ -0,0 +1,63 @@ +from __future__ import print_function +import os +import unittest + +import gevent +from gevent import core + + +@unittest.skipUnless( + getattr(core, 'LIBEV_EMBED', False), + "Needs embedded libev. " + "hub.loop.fileno is only defined when " + "we embed libev for some reason. " + "Choosing specific backends is also only supported by libev " + "(not libuv), and besides, libuv has a nasty tendency to " + "abort() the process if its FD gets closed. " +) +class Test(unittest.TestCase): + # NOTE that we extend unittest.TestCase, not greentest.TestCase + # Extending the later causes the wrong hub to get used. + + assertRaisesRegex = getattr(unittest.TestCase, 'assertRaisesRegex', + getattr(unittest.TestCase, 'assertRaisesRegexp')) + + def _check_backend(self, backend): + hub = gevent.get_hub(backend, default=False) + try: + self.assertEqual(hub.loop.backend, backend) + + gevent.sleep(0.001) + fileno = hub.loop.fileno() + if fileno is None: + raise unittest.SkipTest("backend %s lacks fileno" % (backend,)) + + os.close(fileno) + with self.assertRaisesRegex(SystemError, "(libev)"): + gevent.sleep(0.001) + + hub.destroy() + self.assertIn('destroyed', repr(hub)) + finally: + if hub.loop is not None: + hub.destroy() + + def _make_test(count, backend): # pylint:disable=no-self-argument + def test(self): + self._check_backend(backend) + test.__name__ = 'test_' + backend + '_' + str(count) + return test.__name__, test + + count = backend = None + for count in range(2): + for backend in core.supported_backends(): + name, func = _make_test(count, backend) + locals()[name] = func + name = func = None + + del count + del backend + del _make_test + +if __name__ == '__main__': + unittest.main() diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__compat.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__compat.py new file mode 100644 index 00000000..76795974 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__compat.py @@ -0,0 +1,56 @@ +from __future__ import absolute_import, print_function, division + +import os +import unittest + +class TestFSPath(unittest.TestCase): + + def setUp(self): + self.__path = None + + def __fspath__(self): + if self.__path is not None: + return self.__path + raise AttributeError("Accessing path data") + + def _callFUT(self, arg): + from gevent._compat import _fspath + return _fspath(arg) + + def test_text(self): + s = u'path' + self.assertIs(s, self._callFUT(s)) + + def test_bytes(self): + s = b'path' + self.assertIs(s, self._callFUT(s)) + + def test_None(self): + with self.assertRaises(TypeError): + self._callFUT(None) + + def test_working_path(self): + self.__path = u'text' + self.assertIs(self.__path, self._callFUT(self)) + + self.__path = b'bytes' + self.assertIs(self.__path, self._callFUT(self)) + + def test_failing_path_AttributeError(self): + self.assertIsNone(self.__path) + with self.assertRaises(AttributeError): + self._callFUT(self) + + def test_fspath_non_str(self): + self.__path = object() + with self.assertRaises(TypeError): + self._callFUT(self) + +@unittest.skipUnless(hasattr(os, 'fspath'), "Tests native os.fspath") +class TestNativeFSPath(TestFSPath): + + def _callFUT(self, arg): + return os.fspath(arg) + +if __name__ == '__main__': + unittest.main() diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__core.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__core.py new file mode 100644 index 00000000..7e107ef7 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__core.py @@ -0,0 +1,170 @@ + +from __future__ import absolute_import, print_function, division +import sys +import unittest +import gevent.testing as greentest + +from gevent import core + + + +class TestCore(unittest.TestCase): + + def test_get_version(self): + version = core.get_version() # pylint: disable=no-member + self.assertIsInstance(version, str) + self.assertTrue(version) + header_version = core.get_header_version() # pylint: disable=no-member + self.assertIsInstance(header_version, str) + self.assertTrue(header_version) + self.assertEqual(version, header_version) + + +class TestWatchers(unittest.TestCase): + + def _makeOne(self): + return core.loop() # pylint:disable=no-member + + def destroyOne(self, loop): + loop.destroy() + + def setUp(self): + self.loop = self._makeOne() + + def tearDown(self): + self.destroyOne(self.loop) + del self.loop + + def test_io(self): + if sys.platform == 'win32': + # libev raises IOError, libuv raises ValueError + Error = (IOError, ValueError) + win32 = True + else: + Error = ValueError + win32 = False + + with self.assertRaises(Error): + self.loop.io(-1, 1) + + if hasattr(core, 'TIMER'): + # libev + with self.assertRaises(ValueError): + self.loop.io(1, core.TIMER) # pylint:disable=no-member + + # Test we can set events and io before it's started + if not win32: + # We can't do this with arbitrary FDs on windows; + # see libev_vfd.h + io = self.loop.io(1, core.READ) # pylint:disable=no-member + io.fd = 2 + self.assertEqual(io.fd, 2) + io.events = core.WRITE # pylint:disable=no-member + if not hasattr(core, 'libuv'): + # libev + # pylint:disable=no-member + self.assertEqual(core._events_to_str(io.events), 'WRITE|_IOFDSET') + else: + + self.assertEqual(core._events_to_str(io.events), # pylint:disable=no-member + 'WRITE') + io.start(lambda: None) + io.close() + + @greentest.skipOnLibev("libuv-specific") + @greentest.skipOnWindows("Destroying the loop somehow fails") + def test_io_multiplex_events(self): + # pylint:disable=no-member + import socket + sock = socket.socket() + fd = sock.fileno() + + read = self.loop.io(fd, core.READ) + write = self.loop.io(fd, core.WRITE) + + try: + real_watcher = read._watcher_ref + + read.start(lambda: None) + self.assertEqual(real_watcher.events, core.READ) + + write.start(lambda: None) + self.assertEqual(real_watcher.events, core.READ | core.WRITE) + + write.stop() + self.assertEqual(real_watcher.events, core.READ) + + write.start(lambda: None) + self.assertEqual(real_watcher.events, core.READ | core.WRITE) + + read.stop() + self.assertEqual(real_watcher.events, core.WRITE) + + write.stop() + self.assertEqual(real_watcher.events, 0) + finally: + read.close() + write.close() + sock.close() + + def test_timer_constructor(self): + with self.assertRaises(ValueError): + self.loop.timer(1, -1) + + def test_signal_constructor(self): + with self.assertRaises(ValueError): + self.loop.signal(1000) + +class TestWatchersDefault(TestWatchers): + + def _makeOne(self): + return core.loop(default=True) # pylint:disable=no-member + + def destroyOne(self, loop): + return + +# XXX: The crash may be fixed? The hang showed up after the crash was +# reproduced and fixed on linux and OS X. +@greentest.skipOnLibuvOnWin( + "This crashes with PyPy 5.10.0, only on Windows. " + "See https://ci.appveyor.com/project/denik/gevent/build/1.0.1380/job/lrlvid6mkjtyrhn5#L1103 " + "It has also timed out, but only on Appveyor CPython 3.6; local CPython 3.6 does not. " + "See https://ci.appveyor.com/project/denik/gevent/build/1.0.1414/job/yn7yi8b53vtqs8lw#L1523") +class TestWatchersDefaultDestroyed(TestWatchers): + + def _makeOne(self): + # pylint: disable=no-member + l = core.loop(default=True) + l.destroy() + del l + return core.loop(default=True) + +@greentest.skipOnLibuv("Tests for libev-only functions") +class TestLibev(unittest.TestCase): + + def test_flags_conversion(self): + # pylint: disable=no-member + if sys.platform != 'win32': + self.assertEqual(core.loop(2, default=False).backend_int, 2) + self.assertEqual(core.loop('select', default=False).backend, 'select') + self.assertEqual(core._flags_to_int(None), 0) + self.assertEqual(core._flags_to_int(['kqueue', 'SELECT']), core.BACKEND_KQUEUE | core.BACKEND_SELECT) + self.assertEqual(core._flags_to_list(core.BACKEND_PORT | core.BACKEND_POLL), ['port', 'poll']) + self.assertRaises(ValueError, core.loop, ['port', 'blabla']) + self.assertRaises(TypeError, core.loop, object()) + + +class TestEvents(unittest.TestCase): + + def test_events_conversion(self): + self.assertEqual(core._events_to_str(core.READ | core.WRITE), # pylint: disable=no-member + 'READ|WRITE') + + def test_EVENTS(self): + self.assertEqual(str(core.EVENTS), # pylint: disable=no-member + 'gevent.core.EVENTS') + self.assertEqual(repr(core.EVENTS), # pylint: disable=no-member + 'gevent.core.EVENTS') + +if __name__ == '__main__': + greentest.main() diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__core_async.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__core_async.py new file mode 100644 index 00000000..e1e76cda --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__core_async.py @@ -0,0 +1,24 @@ +from __future__ import print_function +import gevent +import gevent.core +import time +try: + import thread +except ImportError: + import _thread as thread + + +hub = gevent.get_hub() +watcher = hub.loop.async_() + +# BWC for <3.7: This should still be an attribute +assert hasattr(hub.loop, 'async') + +gevent.spawn_later(0.1, thread.start_new_thread, watcher.send, ()) + +start = time.time() + +with gevent.Timeout(1.0): # Large timeout for appveyor + hub.wait(watcher) + +print('Watcher %r reacted after %.6f seconds' % (watcher, time.time() - start - 0.1)) diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__core_callback.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__core_callback.py new file mode 100644 index 00000000..f2acab52 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__core_callback.py @@ -0,0 +1,31 @@ +import gevent +from gevent.hub import get_hub + +called = [] + + +def f(): + called.append(1) + + +def main(): + loop = get_hub().loop + x = loop.run_callback(f) + + assert x, x + gevent.sleep(0) + assert called == [1], called + assert not x, (x, bool(x)) + + x = loop.run_callback(f) + assert x, x + x.stop() + assert not x, x + gevent.sleep(0) + assert called == [1], called + assert not x, x + + +if __name__ == '__main__': + called[:] = [] + main() diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__core_fork.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__core_fork.py new file mode 100644 index 00000000..fee42f54 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__core_fork.py @@ -0,0 +1,58 @@ +from __future__ import print_function +import gevent.monkey +gevent.monkey.patch_all() +import gevent +import os + +import multiprocessing + +hub = gevent.get_hub() +pid = os.getpid() +newpid = None + + +def on_fork(): + global newpid + newpid = os.getpid() + +fork_watcher = hub.loop.fork(ref=False) +fork_watcher.start(on_fork) + + +def run(q): + # libev only calls fork callbacks at the beginning of + # the loop; we use callbacks extensively so it takes *two* + # calls to sleep (with a timer) to actually get wrapped + # around to the beginning of the loop. + gevent.sleep(0.01) + gevent.sleep(0.01) + q.put(newpid) + + +def test(): + # Use a thread to make us multi-threaded + hub.threadpool.apply(lambda: None) + # If the Queue is global, q.get() hangs on Windows; must pass as + # an argument. + q = multiprocessing.Queue() + p = multiprocessing.Process(target=run, args=(q,)) + p.start() + p.join() + p_val = q.get() + + assert p_val is not None, "The fork watcher didn't run" + assert p_val != pid + +if __name__ == '__main__': + # Must call for Windows to fork properly; the fork can't be in the top-level + multiprocessing.freeze_support() + # fork watchers weren't firing in multi-threading processes. + # This test is designed to prove that they are. + # However, it fails on Windows: The fork watcher never runs! + # This makes perfect sense: on Windows, our patches to os.fork() + # that call gevent.hub.reinit() don't get used; os.fork doesn't + # exist and multiprocessing.Process uses the windows-specific _subprocess.CreateProcess() + # to create a whole new process that has no relation to the current process; + # that process then calls multiprocessing.forking.main() to do its work. + # Since no state is shared, a fork watcher cannot exist in that process. + test() diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__core_loop_run.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__core_loop_run.py new file mode 100644 index 00000000..ad35e014 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__core_loop_run.py @@ -0,0 +1,25 @@ +from __future__ import print_function +import sys +# Using a direct import of signal (deprecated). +# We are also called from test__core_loop_run_sig_mod.py, +# which has already done 'import gevent.signal' to be sure we work +# when the module has been imported. +from gevent import core, signal +loop = core.loop(default=False) + + +signal = signal(2, sys.stderr.write, 'INTERRUPT!') + +print('must exit immediately...') +loop.run() # must exit immediately +print('...and once more...') +loop.run() # repeating does not fail +print('..done') + +print('must exit after 0.5 seconds.') +timer = loop.timer(0.5) +timer.start(lambda: None) +loop.run() +timer.close() +loop.destroy() +del loop diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__core_loop_run_sig_mod.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__core_loop_run_sig_mod.py new file mode 100644 index 00000000..396cbe53 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__core_loop_run_sig_mod.py @@ -0,0 +1,16 @@ +import sys +import gevent.signal +assert gevent.signal # Get gevent.signal as a module, make sure our backwards compatibility kicks in + +import test__core_loop_run # this runs main tests, fails if signal() is not callable. +assert test__core_loop_run # pyflakes + +from gevent.hub import signal as hub_signal +from gevent import signal as top_signal # pylint:disable=reimported + +assert gevent.signal is hub_signal +assert gevent.signal is top_signal +assert hasattr(gevent.signal, 'signal') +s = top_signal(2, sys.stderr.write, 'INTERRUPT') +assert isinstance(s, top_signal) +assert isinstance(s, hub_signal) diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__core_stat.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__core_stat.py new file mode 100644 index 00000000..d022d90e --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__core_stat.py @@ -0,0 +1,118 @@ +from __future__ import print_function + +import os +import tempfile +import time + +import gevent +import gevent.core + +import gevent.testing as greentest +import gevent.testing.flaky + +#pylint: disable=protected-access + + +DELAY = 0.5 + +WIN = greentest.WIN + +LIBUV = greentest.LIBUV + +class TestCoreStat(greentest.TestCase): + + __timeout__ = greentest.LARGE_TIMEOUT + + def setUp(self): + super(TestCoreStat, self).setUp() + fd, path = tempfile.mkstemp(suffix='.gevent_test_core_stat') + os.close(fd) + self.temp_path = path + self.hub = gevent.get_hub() + # If we don't specify an interval, we default to zero. + # libev interprets that as meaning to use its default interval, + # which is about 5 seconds. If we go below it's minimum check + # threshold, it bumps it up to the minimum. + self.watcher = self.hub.loop.stat(self.temp_path, interval=-1) + + def tearDown(self): + self.watcher.close() + if os.path.exists(self.temp_path): + os.unlink(self.temp_path) + super(TestCoreStat, self).tearDown() + + def _write(self): + with open(self.temp_path, 'wb', buffering=0) as f: + f.write(b'x') + + def _check_attr(self, name, none): + # Deals with the complex behaviour of the 'attr' and 'prev' + # attributes on Windows. This codifies it, rather than simply letting + # the test fail, so we know exactly when and what changes it. + try: + x = getattr(self.watcher, name) + except ImportError: + if WIN: + # the 'posix' module is not available + pass + else: + raise + else: + if WIN and not LIBUV: + # The ImportError is only raised for the first time; + # after that, the attribute starts returning None + self.assertIsNone(x, "Only None is supported on Windows") + if none: + self.assertIsNone(x, name) + else: + self.assertIsNotNone(x, name) + + def _wait_on_greenlet(self, func, *greenlet_args): + start = time.time() + + self.hub.loop.update_now() + greenlet = gevent.spawn_later(DELAY, func, *greenlet_args) + with gevent.Timeout(5 + DELAY + 0.5): + self.hub.wait(self.watcher) + now = time.time() + + self.assertGreaterEqual(now, start, "Time must move forward") + + wait_duration = now - start + reaction = wait_duration - DELAY + + if reaction <= 0.0: + # Sigh. This is especially true on PyPy on Windows + raise gevent.testing.flaky.FlakyTestRaceCondition( + "Bad timer resolution (on Windows?), test is useless. Start %s, now %s" % (start, now)) + + self.assertGreaterEqual( + reaction, 0.0, + 'Watcher %s reacted too early: %.3fs' % (self.watcher, reaction)) + + greenlet.join() + + def test_watcher_basics(self): + watcher = self.watcher + filename = self.temp_path + self.assertEqual(watcher.path, filename) + filenames = filename if isinstance(filename, bytes) else filename.encode('ascii') + self.assertEqual(watcher._paths, filenames) + self.assertEqual(watcher.interval, -1) + + def test_write(self): + self._wait_on_greenlet(self._write) + + self._check_attr('attr', False) + self._check_attr('prev', False) + # The watcher interval changed after it started; -1 is illegal + self.assertNotEqual(self.watcher.interval, -1) + + def test_unlink(self): + self._wait_on_greenlet(os.unlink, self.temp_path) + + self._check_attr('attr', True) + self._check_attr('prev', False) + +if __name__ == '__main__': + greentest.main() diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__core_timer.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__core_timer.py new file mode 100644 index 00000000..97caa754 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__core_timer.py @@ -0,0 +1,157 @@ +from __future__ import print_function +from gevent import config + +import gevent.testing as greentest +from gevent.testing import TestCase +from gevent.testing import LARGE_TIMEOUT +from gevent.testing.sysinfo import CFFI_BACKEND +from gevent.testing.flaky import reraises_flaky_timeout + + +class Test(TestCase): + __timeout__ = LARGE_TIMEOUT + + repeat = 0 + timer_duration = 0.001 + + def setUp(self): + super(Test, self).setUp() + self.called = [] + self.loop = config.loop(default=False) + self.timer = self.loop.timer(self.timer_duration, repeat=self.repeat) + assert not self.loop.default + + def cleanup(self): + # cleanup instead of tearDown to cooperate well with + # leakcheck.py + self.timer.close() + # cycle the loop so libuv close callbacks fire + self.loop.run() + self.loop.destroy() + self.loop = None + self.timer = None + + def f(self, x=None): + self.called.append(1) + if x is not None: + x.stop() + + def assertTimerInKeepalive(self): + if CFFI_BACKEND: + self.assertIn(self.timer, self.loop._keepaliveset) + + def assertTimerNotInKeepalive(self): + if CFFI_BACKEND: + self.assertNotIn(self.timer, self.loop._keepaliveset) + + def test_main(self): + loop = self.loop + x = self.timer + x.start(self.f) + self.assertTimerInKeepalive() + self.assertTrue(x.active, x) + + with self.assertRaises((AttributeError, ValueError)): + x.priority = 1 + + loop.run() + self.assertEqual(x.pending, 0) + self.assertEqual(self.called, [1]) + self.assertIsNone(x.callback) + self.assertIsNone(x.args) + + if x.priority is not None: + self.assertEqual(x.priority, 0) + x.priority = 1 + self.assertEqual(x.priority, 1) + + x.stop() + self.assertTimerNotInKeepalive() + +class TestAgain(Test): + repeat = 1 + + def test_main(self): + # Again works for a new timer + x = self.timer + x.again(self.f, x) + self.assertTimerInKeepalive() + + self.assertEqual(x.args, (x,)) + + # XXX: On libev, this takes 1 second. On libuv, + # it takes the expected time. + self.loop.run() + + self.assertEqual(self.called, [1]) + + x.stop() + self.assertTimerNotInKeepalive() + + +class TestTimerResolution(Test): + + # On CI, with *all* backends, sometimes we get timer values of + # 0.02 or higher. + @reraises_flaky_timeout(AssertionError) + def test_resolution(self): # pylint:disable=too-many-locals + # Make sure that having an active IO watcher + # doesn't badly throw off our timer resolution. + # (This was a specific problem with libuv) + + # https://github.com/gevent/gevent/pull/1194 + from gevent._compat import perf_counter + + import socket + s = socket.socket() + self._close_on_teardown(s) + fd = s.fileno() + + ran_at_least_once = False + fired_at = [] + + def timer_counter(): + fired_at.append(perf_counter()) + + loop = self.loop + + timer_multiplier = 11 + max_time = self.timer_duration * timer_multiplier + assert max_time < 0.3 + + for _ in range(150): + # in libuv, our signal timer fires every 300ms; depending on + # when this runs, we could artificially get a better + # resolution than we expect. Run it multiple times to be more sure. + io = loop.io(fd, 1) + io.start(lambda events=None: None) + + + now = perf_counter() + del fired_at[:] + timer = self.timer + timer.start(timer_counter) + + loop.run(once=True) + + io.stop() + io.close() + + timer.stop() + + if fired_at: + ran_at_least_once = True + self.assertEqual(1, len(fired_at)) + self.assertTimeWithinRange(fired_at[0] - now, + 0, + max_time) + + + if not greentest.RUNNING_ON_CI: + # Hmm, this always fires locally on mocOS but + # not an Travis? + self.assertTrue(ran_at_least_once) + + +if __name__ == '__main__': + greentest.main() diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__core_watcher.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__core_watcher.py new file mode 100644 index 00000000..bd52805c --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__core_watcher.py @@ -0,0 +1,124 @@ +from __future__ import absolute_import, print_function + +import gevent.testing as greentest +from gevent import config +from gevent.testing.sysinfo import CFFI_BACKEND + +from gevent.core import READ # pylint:disable=no-name-in-module +from gevent.core import WRITE # pylint:disable=no-name-in-module + + +class Test(greentest.TestCase): + + __timeout__ = None + + def setUp(self): + super(Test, self).setUp() + self.loop = config.loop(default=False) + self.timer = self.loop.timer(0.01) + + def tearDown(self): + if self.timer is not None: + self.timer.close() + if self.loop is not None: + self.loop.destroy() + self.loop = self.timer = None + super(Test, self).tearDown() + + def test_non_callable_to_start(self): + # test that cannot pass non-callable thing to start() + self.assertRaises(TypeError, self.timer.start, None) + self.assertRaises(TypeError, self.timer.start, 5) + + def test_non_callable_after_start(self): + # test that cannot set 'callback' to non-callable thing later either + lst = [] + timer = self.timer + timer.start(lst.append) + + + with self.assertRaises(TypeError): + timer.callback = False + + with self.assertRaises(TypeError): + timer.callback = 5 + + def test_args_can_be_changed_after_start(self): + lst = [] + timer = self.timer + self.timer.start(lst.append) + self.assertEqual(timer.args, ()) + timer.args = (1, 2, 3) + self.assertEqual(timer.args, (1, 2, 3)) + + # Only tuple can be args + with self.assertRaises(TypeError): + timer.args = 5 + with self.assertRaises(TypeError): + timer.args = [4, 5] + + self.assertEqual(timer.args, (1, 2, 3)) + + # None also works, means empty tuple + # XXX why? + timer.args = None + self.assertEqual(timer.args, None) + + + def test_run(self): + loop = self.loop + lst = [] + + self.timer.start(lambda *args: lst.append(args)) + + loop.run() + loop.update_now() + + self.assertEqual(lst, [()]) + + # Even if we lose all references to it, the ref in the callback + # keeps it alive + self.timer.start(reset, self.timer, lst) + self.timer = None + loop.run() + self.assertEqual(lst, [(), 25]) + + def test_invalid_fd(self): + loop = self.loop + + # Negative case caught everywhere. ValueError + # on POSIX, OSError on Windows Py3, IOError on Windows Py2 + with self.assertRaises((ValueError, OSError, IOError)): + loop.io(-1, READ) + + + @greentest.skipOnWindows("Stdout can't be watched on Win32") + def test_reuse_io(self): + loop = self.loop + + # Watchers aren't reused once all outstanding + # refs go away BUT THEY MUST BE CLOSED + tty_watcher = loop.io(1, WRITE) + watcher_handle = tty_watcher._watcher if CFFI_BACKEND else tty_watcher + tty_watcher.close() + del tty_watcher + # XXX: Note there is a cycle in the CFFI code + # from watcher_handle._handle -> watcher_handle. + # So it doesn't go away until a GC runs. + import gc + gc.collect() + + tty_watcher = loop.io(1, WRITE) + self.assertIsNot(tty_watcher._watcher if CFFI_BACKEND else tty_watcher, watcher_handle) + tty_watcher.close() + + +def reset(watcher, lst): + watcher.args = None + watcher.callback = lambda: None + lst.append(25) + watcher.close() + + +if __name__ == '__main__': + greentest.main() diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__destroy.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__destroy.py new file mode 100644 index 00000000..784723a3 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__destroy.py @@ -0,0 +1,51 @@ +from __future__ import absolute_import, print_function + +import gevent +import unittest + +class TestDestroyHub(unittest.TestCase): + + def test_destroy_hub(self): + # Loop of initial Hub is default loop. + hub = gevent.get_hub() + self.assertTrue(hub.loop.default) + + # Save `gevent.core.loop` object for later comparison. + initloop = hub.loop + + # Increase test complexity via threadpool creation. + # Implicitly creates fork watcher connected to the current event loop. + tp = hub.threadpool + self.assertIsNotNone(tp) + + # Destroy hub. Does not destroy libev default loop if not explicitly told to. + hub.destroy() + + # Create new hub. Must re-use existing libev default loop. + hub = gevent.get_hub() + self.assertTrue(hub.loop.default) + + # Ensure that loop object is identical to the initial one. + self.assertIs(hub.loop, initloop) + + # Destroy hub including default loop. + hub.destroy(destroy_loop=True) + + # Create new hub and explicitly request creation of a new default loop. + hub = gevent.get_hub(default=True) + self.assertTrue(hub.loop.default) + + # `gevent.core.loop` objects as well as libev loop pointers must differ. + self.assertIsNot(hub.loop, initloop) + self.assertIsNot(hub.loop.ptr, initloop.ptr) + self.assertNotEqual(hub.loop.ptr, initloop.ptr) + + # Destroy hub including default loop. The default loop regenerates. + hub.destroy(destroy_loop=True) + hub = gevent.get_hub() + self.assertTrue(hub.loop.default) + + hub.destroy() + +if __name__ == '__main__': + unittest.main() diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__destroy_default_loop.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__destroy_default_loop.py new file mode 100644 index 00000000..c655b8d3 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__destroy_default_loop.py @@ -0,0 +1,56 @@ +from __future__ import print_function +import gevent + +import unittest + +class TestDestroyDefaultLoop(unittest.TestCase): + + def test_destroy_gc(self): + # Issue 1098: destroying the default loop + # while using the C extension could crash + # the interpreter when it exits + + # Create the hub greenlet. This creates one loop + # object pointing to the default loop. + gevent.get_hub() + + # Get a new loop object, but using the default + # C loop + loop = gevent.config.loop(default=True) + self.assertTrue(loop.default) + # Destroy it + loop.destroy() + # It no longer claims to be the default + self.assertFalse(loop.default) + + # Delete it + del loop + # Delete the hub. This prompts garbage + # collection of it and its loop object. + # (making this test more repeatable; the exit + # crash only happened when that greenlet object + # was collected at exit time, which was most common + # in CPython 3.5) + from gevent._hub_local import set_hub + set_hub(None) + + + + def test_destroy_two(self): + # Get two new loop object, but using the default + # C loop + loop1 = gevent.config.loop(default=True) + loop2 = gevent.config.loop(default=True) + self.assertTrue(loop1.default) + self.assertTrue(loop2.default) + # Destroy the first + loop1.destroy() + # It no longer claims to be the default + self.assertFalse(loop1.default) + + # Destroy the second. This doesn't crash. + loop2.destroy() + + +if __name__ == '__main__': + unittest.main() diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__doctests.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__doctests.py new file mode 100644 index 00000000..731a9ee8 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__doctests.py @@ -0,0 +1,133 @@ +from __future__ import print_function + +import doctest +import functools +import os +import re +import sys +import unittest + + + +# Ignore tracebacks: ZeroDivisionError + + +def myfunction(*_args, **_kwargs): + pass + + +class RENormalizingOutputChecker(doctest.OutputChecker): + """ + Pattern-normalizing output checker. Inspired by one used in zope.testing. + """ + + def __init__(self, patterns): + self.transformers = [functools.partial(re.sub, replacement) for re, replacement in patterns] + + def check_output(self, want, got, optionflags): + if got == want: + return True + + for transformer in self.transformers: + want = transformer(want) + got = transformer(got) + + return doctest.OutputChecker.check_output(self, want, got, optionflags) + +FORBIDDEN_MODULES = set() + + +class Modules(object): + + def __init__(self, allowed_modules): + from gevent.testing import walk_modules + self.allowed_modules = allowed_modules + self.modules = set() + + for path, module in walk_modules(recursive=True): + self.add_module(module, path) + + + def add_module(self, name, path): + if self.allowed_modules and name not in self.allowed_modules: + return + if name in FORBIDDEN_MODULES: + return + self.modules.add((name, path)) + + def __bool__(self): + return bool(self.modules) + + __nonzero__ = __bool__ + + def __iter__(self): + return iter(self.modules) + + +def main(): # pylint:disable=too-many-locals + cwd = os.getcwd() + # Use pure_python to get the correct module source and docstrings + os.environ['PURE_PYTHON'] = '1' + + import gevent + from gevent import socket + + + from gevent.testing import util + from gevent.testing import sysinfo + + if sysinfo.WIN: + FORBIDDEN_MODULES.update({ + # Uses commands only found on posix + 'gevent.subprocess', + }) + + try: + allowed_modules = sys.argv[1:] + sys.path.append('.') + + globs = { + 'myfunction': myfunction, + 'gevent': gevent, + 'socket': socket, + } + + modules = Modules(allowed_modules) + + if not modules: + sys.exit('No modules found matching %s' % ' '.join(allowed_modules)) + + suite = unittest.TestSuite() + checker = RENormalizingOutputChecker(( + # Normalize subprocess.py: BSD ls is in the example, gnu ls outputs + # 'cannot access' + (re.compile( + "ls: cannot access 'non_existent_file': No such file or directory"), + "ls: non_existent_file: No such file or directory"), + # Python 3 bytes add a "b". + (re.compile(r'b(".*?")'), r"\1"), + (re.compile(r"b('.*?')"), r"\1"), + )) + + tests_count = 0 + modules_count = 0 + for m, path in sorted(modules): + with open(path, 'rb') as f: + contents = f.read() + if re.search(br'^\s*>>> ', contents, re.M): + s = doctest.DocTestSuite(m, extraglobs=globs, checker=checker) + test_count = len(s._tests) + util.log('%s (from %s): %s tests', m, path, test_count) + suite.addTest(s) + modules_count += 1 + tests_count += test_count + + util.log('Total: %s tests in %s modules', tests_count, modules_count) + # TODO: Pass this off to unittest.main() + runner = unittest.TextTestRunner(verbosity=2) + runner.run(suite) + finally: + os.chdir(cwd) + +if __name__ == '__main__': + main() diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__environ.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__environ.py new file mode 100644 index 00000000..fae25ab3 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__environ.py @@ -0,0 +1,17 @@ +import os +import sys +import gevent +import gevent.core +import subprocess + +if sys.argv[1:] == []: + os.environ['GEVENT_BACKEND'] = 'select' + popen = subprocess.Popen([sys.executable, __file__, '1']) + assert popen.wait() == 0, popen.poll() +else: # pragma: no cover + hub = gevent.get_hub() + if 'select' in gevent.core.supported_backends(): + assert hub.loop.backend == 'select', hub.loop.backend + else: + # libuv isn't configurable + assert hub.loop.backend == 'default', hub.loop.backend diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__event.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__event.py new file mode 100644 index 00000000..4c95fee3 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__event.py @@ -0,0 +1,254 @@ +from __future__ import absolute_import, print_function, division + +import weakref + +import gevent +from gevent.event import Event, AsyncResult + +import gevent.testing as greentest + +from gevent.testing.six import xrange +from gevent.testing.timing import AbstractGenericGetTestCase +from gevent.testing.timing import AbstractGenericWaitTestCase +from gevent.testing.timing import SMALL_TICK +from gevent.testing.timing import SMALL_TICK_MAX_ADJ + +DELAY = SMALL_TICK + SMALL_TICK_MAX_ADJ + + +class TestEventWait(AbstractGenericWaitTestCase): + + def wait(self, timeout): + Event().wait(timeout=timeout) + + def test_cover(self): + str(Event()) + + +class TestWaitEvent(AbstractGenericWaitTestCase): + + def wait(self, timeout): + gevent.wait([Event()], timeout=timeout) + + def test_set_during_wait(self): + # https://github.com/gevent/gevent/issues/771 + # broke in the refactoring. we must not add new links + # while we're running the callback + + event = Event() + + def setter(): + event.set() + + def waiter(): + s = gevent.spawn(setter) + # let the setter set() the event; + # when this method returns we'll be running in the Event._notify_links callback + # (that is, it switched to us) + res = event.wait() + self.assertTrue(res) + self.assertTrue(event.ready()) + s.join() # make sure it's dead + # Clear the event. Now we can't wait for the event without + # another set to happen. + event.clear() + self.assertFalse(event.ready()) + + # Before the bug fix, this would return "immediately" with + # event in the result list, because the _notify_links loop would + # immediately add the waiter and call it + o = gevent.wait((event,), timeout=0.01) + self.assertFalse(event.ready()) + self.assertNotIn(event, o) + + gevent.spawn(waiter).join() + + +class TestAsyncResultWait(AbstractGenericWaitTestCase): + + def wait(self, timeout): + AsyncResult().wait(timeout=timeout) + + +class TestWaitAsyncResult(AbstractGenericWaitTestCase): + + def wait(self, timeout): + gevent.wait([AsyncResult()], timeout=timeout) + + +class TestAsyncResultGet(AbstractGenericGetTestCase): + + def wait(self, timeout): + AsyncResult().get(timeout=timeout) + +class MyException(Exception): + pass + +class TestAsyncResult(greentest.TestCase): + + def test_link(self): + ar = AsyncResult() + self.assertRaises(TypeError, ar.rawlink, None) + ar.unlink(None) # doesn't raise + ar.unlink(None) # doesn't raise + str(ar) # cover + + def test_set_exc(self): + log = [] + e = AsyncResult() + self.assertEqual(e.exc_info, ()) + self.assertEqual(e.exception, None) + + def waiter(): + with self.assertRaises(MyException) as exc: + e.get() + log.append(('caught', exc.exception)) + gevent.spawn(waiter) + obj = MyException() + e.set_exception(obj) + gevent.sleep(0) + self.assertEqual(log, [('caught', obj)]) + + def test_set(self): + event1 = AsyncResult() + timer_exc = MyException('interrupted') + + # Notice that this test is racy: + # After DELAY, we set the event. We also try to immediately + # raise the exception with a timer of 0 --- but that depends + # on cycling the loop. Hence the fairly large value for DELAY. + g = gevent.spawn_later(DELAY, event1.set, 'hello event1') + self._close_on_teardown(g.kill) + with gevent.Timeout.start_new(0, timer_exc): + with self.assertRaises(MyException) as exc: + event1.get() + self.assertIs(timer_exc, exc.exception) + + def test_set_with_timeout(self): + event2 = AsyncResult() + + X = object() + result = gevent.with_timeout(DELAY, event2.get, timeout_value=X) + self.assertIs( + result, X, + 'Nobody sent anything to event2 yet it received %r' % (result, )) + + def test_nonblocking_get(self): + ar = AsyncResult() + self.assertRaises(gevent.Timeout, ar.get, block=False) + self.assertRaises(gevent.Timeout, ar.get_nowait) + + +class TestAsyncResultAsLinkTarget(greentest.TestCase): + error_fatal = False + + def test_set(self): + g = gevent.spawn(lambda: 1) + s1, s2, s3 = AsyncResult(), AsyncResult(), AsyncResult() + g.link(s1) + g.link_value(s2) + g.link_exception(s3) + self.assertEqual(s1.get(), 1) + self.assertEqual(s2.get(), 1) + X = object() + result = gevent.with_timeout(DELAY, s3.get, timeout_value=X) + self.assertIs(result, X) + + def test_set_exception(self): + def func(): + raise greentest.ExpectedException('TestAsyncResultAsLinkTarget.test_set_exception') + g = gevent.spawn(func) + s1, s2, s3 = AsyncResult(), AsyncResult(), AsyncResult() + g.link(s1) + g.link_value(s2) + g.link_exception(s3) + self.assertRaises(greentest.ExpectedException, s1.get) + X = object() + result = gevent.with_timeout(DELAY, s2.get, timeout_value=X) + self.assertIs(result, X) + self.assertRaises(greentest.ExpectedException, s3.get) + + +class TestEvent_SetThenClear(greentest.TestCase): + N = 1 + + def test(self): + e = Event() + waiters = [gevent.spawn(e.wait) for i in range(self.N)] + gevent.sleep(0.001) + e.set() + e.clear() + for greenlet in waiters: + greenlet.join() + + +class TestEvent_SetThenClear100(TestEvent_SetThenClear): + N = 100 + + +class TestEvent_SetThenClear1000(TestEvent_SetThenClear): + N = 1000 + + +class TestWait(greentest.TestCase): + N = 5 + count = None + timeout = 1 + period = timeout / 100.0 + + def _sender(self, events, asyncs): + while events or asyncs: + gevent.sleep(self.period) + if events: + events.pop().set() + gevent.sleep(self.period) + if asyncs: + asyncs.pop().set() + + @greentest.skipOnAppVeyor("Not all results have arrived sometimes due to timer issues") + def test(self): + events = [Event() for _ in xrange(self.N)] + asyncs = [AsyncResult() for _ in xrange(self.N)] + max_len = len(events) + len(asyncs) + sender = gevent.spawn(self._sender, events, asyncs) + results = gevent.wait(events + asyncs, count=self.count, timeout=self.timeout) + if self.timeout is None: + expected_len = max_len + else: + expected_len = min(max_len, self.timeout / self.period) + if self.count is None: + self.assertTrue(sender.ready(), sender) + else: + expected_len = min(self.count, expected_len) + self.assertFalse(sender.ready(), sender) + sender.kill() + self.assertEqual(expected_len, len(results), (expected_len, len(results), results)) + + +class TestWait_notimeout(TestWait): + timeout = None + + +class TestWait_count1(TestWait): + count = 1 + + +class TestWait_count2(TestWait): + count = 2 + +class TestEventBasics(greentest.TestCase): + + def test_weakref(self): + # Event objects should allow weakrefs + e = Event() + r = weakref.ref(e) + self.assertIs(e, r()) + del e + del r + + +del AbstractGenericGetTestCase +del AbstractGenericWaitTestCase + +if __name__ == '__main__': + greentest.main() diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__events.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__events.py new file mode 100644 index 00000000..f95da3a0 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__events.py @@ -0,0 +1,39 @@ +# -*- coding: utf-8 -*- +# Copyright 2018 gevent. See LICENSE. +from __future__ import absolute_import +from __future__ import division +from __future__ import print_function + + +import unittest + +from gevent import events +from zope.interface import verify + +class TestImplements(unittest.TestCase): + + def test_event_loop_blocked(self): + verify.verifyClass(events.IEventLoopBlocked, events.EventLoopBlocked) + + def test_mem_threshold(self): + verify.verifyClass(events.IMemoryUsageThresholdExceeded, + events.MemoryUsageThresholdExceeded) + verify.verifyObject(events.IMemoryUsageThresholdExceeded, + events.MemoryUsageThresholdExceeded(0, 0, 0)) + + def test_mem_decreased(self): + verify.verifyClass(events.IMemoryUsageUnderThreshold, + events.MemoryUsageUnderThreshold) + verify.verifyObject(events.IMemoryUsageUnderThreshold, + events.MemoryUsageUnderThreshold(0, 0, 0, 0)) + + +class TestEvents(unittest.TestCase): + + def test_is_zope(self): + from zope import event + self.assertIs(events.subscribers, event.subscribers) + self.assertIs(events.notify, event.notify) + +if __name__ == '__main__': + unittest.main() diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__example_echoserver.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__example_echoserver.py new file mode 100644 index 00000000..128678a1 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__example_echoserver.py @@ -0,0 +1,40 @@ +from gevent.socket import create_connection, timeout +import gevent.testing as greentest +import gevent + +from gevent.testing import util +from gevent.testing import params + +class Test(util.TestServer): + server = 'echoserver.py' + + def _run_all_tests(self): + def test_client(message): + if greentest.PY3: + kwargs = {'buffering': 1} + else: + kwargs = {'bufsize': 1} + kwargs['mode'] = 'rb' + conn = create_connection((params.DEFAULT_LOCAL_HOST_ADDR, 16000)) + conn.settimeout(greentest.DEFAULT_XPC_SOCKET_TIMEOUT) + rfile = conn.makefile(**kwargs) + + welcome = rfile.readline() + self.assertIn(b'Welcome', welcome) + + conn.sendall(message) + received = rfile.read(len(message)) + self.assertEqual(received, message) + + self.assertRaises(timeout, conn.recv, 1) + + rfile.close() + conn.close() + + client1 = gevent.spawn(test_client, b'hello\r\n') + client2 = gevent.spawn(test_client, b'world\r\n') + gevent.joinall([client1, client2], raise_error=True) + + +if __name__ == '__main__': + greentest.main() diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__example_portforwarder.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__example_portforwarder.py new file mode 100644 index 00000000..cd6292c6 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__example_portforwarder.py @@ -0,0 +1,66 @@ +from __future__ import print_function, absolute_import +from gevent import monkey; monkey.patch_all(subprocess=True) +import signal +import sys +import socket +from time import sleep + +import gevent +from gevent.server import StreamServer + +import gevent.testing as greentest +from gevent.testing import util + +@greentest.skipOnLibuvOnCIOnPyPy("Timing issues sometimes lead to connection refused") +class Test(util.TestServer): + server = 'portforwarder.py' + args = ['127.0.0.1:10011', '127.0.0.1:10012'] + + if sys.platform.startswith('win'): + from subprocess import CREATE_NEW_PROCESS_GROUP + # Must be in a new process group to use CTRL_C_EVENT, otherwise + # we get killed too + start_kwargs = {'creationflags': CREATE_NEW_PROCESS_GROUP} + + def after(self): + if sys.platform == 'win32': + self.assertIsNotNone(self.popen.poll()) + else: + self.assertEqual(self.popen.poll(), 0) + + def _run_all_tests(self): + log = [] + + def handle(sock, _address): + while True: + data = sock.recv(1024) + print('got %r' % data) + if not data: + break + log.append(data) + + server = StreamServer(self.args[1], handle) + server.start() + try: + conn = socket.create_connection(('127.0.0.1', 10011)) + conn.sendall(b'msg1') + sleep(0.1) + # On Windows, SIGTERM actually abruptly terminates the process; + # it can't be caught. However, CTRL_C_EVENT results in a KeyboardInterrupt + # being raised, so we can shut down properly. + self.popen.send_signal(getattr(signal, 'CTRL_C_EVENT', signal.SIGTERM)) + sleep(0.1) + + conn.sendall(b'msg2') + conn.close() + + with gevent.Timeout(2.1): + self.popen.wait() + finally: + server.close() + + self.assertEqual([b'msg1', b'msg2'], log) + + +if __name__ == '__main__': + greentest.main() diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__example_udp_client.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__example_udp_client.py new file mode 100644 index 00000000..d4dacec2 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__example_udp_client.py @@ -0,0 +1,31 @@ +from gevent import monkey +monkey.patch_all(subprocess=True) + +import sys +from gevent.server import DatagramServer + +from gevent.testing.util import run +from gevent.testing import util +from gevent.testing import main + +class Test_udp_client(util.TestServer): + + def test(self): + log = [] + + def handle(message, address): + log.append(message) + server.sendto(b'reply-from-server', address) + + server = DatagramServer('127.0.0.1:9001', handle) + server.start() + try: + run([sys.executable, '-W', 'ignore', '-u', 'udp_client.py', 'Test_udp_client'], + timeout=10, cwd=self.cwd) + finally: + server.close() + self.assertEqual(log, [b'Test_udp_client']) + + +if __name__ == '__main__': + main() diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__example_udp_server.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__example_udp_server.py new file mode 100644 index 00000000..23c40572 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__example_udp_server.py @@ -0,0 +1,22 @@ +import socket + +from gevent.testing import util +from gevent.testing import main + + +class Test(util.TestServer): + server = 'udp_server.py' + + def _run_all_tests(self): + sock = socket.socket(type=socket.SOCK_DGRAM) + try: + sock.connect(('127.0.0.1', 9000)) + sock.send(b'Test udp_server') + data, _address = sock.recvfrom(8192) + self.assertEqual(data, b'Received 15 bytes') + finally: + sock.close() + + +if __name__ == '__main__': + main() diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__examples.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__examples.py new file mode 100644 index 00000000..3310be9a --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__examples.py @@ -0,0 +1,87 @@ +import sys +import os +import glob +import time +import unittest + +import gevent.testing as greentest +from gevent.testing import util + +this_dir = os.path.dirname(__file__) + +def _find_files_to_ignore(): + old_dir = os.getcwd() + try: + os.chdir(this_dir) + + result = [ + 'wsgiserver.py', + 'wsgiserver_ssl.py', + 'webproxy.py', + 'webpy.py', + 'unixsocket_server.py', + 'unixsocket_client.py', + 'psycopg2_pool.py', + 'geventsendfile.py', + ] + result += [x[14:] for x in glob.glob('test__example_*.py')] + + finally: + os.chdir(old_dir) + + return result + +default_time_range = (2, 4) +time_ranges = { + 'concurrent_download.py': (0, 30), + 'processes.py': (0, 4) +} + +class _AbstractTestMixin(util.ExampleMixin): + time_range = (2, 4) + filename = None + + def test_runs(self): + start = time.time() + min_time, max_time = self.time_range + if util.run([sys.executable, '-u', self.filename], + timeout=max_time, + cwd=self.cwd, + quiet=True, + buffer_output=True, + nested=True, + setenv={'GEVENT_DEBUG': 'error'}): + self.fail("Failed example: " + self.filename) + else: + took = time.time() - start + self.assertGreaterEqual(took, min_time) + +def _build_test_classes(): + result = {} + try: + example_dir = util.ExampleMixin().cwd + except unittest.SkipTest: + util.log("WARNING: No examples dir found", color='suboptimal-behaviour') + return result + + ignore = _find_files_to_ignore() + for filename in glob.glob(example_dir + '/*.py'): + bn = os.path.basename(filename) + if bn in ignore: + continue + tc = type( + 'Test_' + bn, + (_AbstractTestMixin, greentest.TestCase), + { + 'filename': bn, + 'time_range': time_ranges.get(bn, _AbstractTestMixin.time_range) + } + ) + result[tc.__name__] = tc + return result + +for k, v in _build_test_classes().items(): + locals()[k] = v + +if __name__ == '__main__': + greentest.main() diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__exc_info.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__exc_info.py new file mode 100644 index 00000000..7656ab82 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__exc_info.py @@ -0,0 +1,58 @@ +import gevent +import sys +import gevent.testing as greentest +from gevent.testing import six +from gevent.testing import ExpectedException as ExpectedError + +if not six.PY3: + sys.exc_clear() + +class RawException(Exception): + pass + + +def hello(err): + assert sys.exc_info() == (None, None, None), sys.exc_info() + raise err + + +def hello2(): + try: + hello(ExpectedError('expected exception in hello')) + except ExpectedError: + pass + + +class Test(greentest.TestCase): + + def test1(self): + error = RawException('hello') + expected_error = ExpectedError('expected exception in hello') + try: + raise error + except RawException: + self.expect_one_error() + g = gevent.spawn(hello, expected_error) + g.join() + self.assert_error(ExpectedError, expected_error) + self.assertIsInstance(g.exception, ExpectedError) + + try: + raise + except: # pylint:disable=bare-except + ex = sys.exc_info()[1] + self.assertIs(ex, error) + + def test2(self): + timer = gevent.get_hub().loop.timer(0) + timer.start(hello2) + try: + gevent.sleep(0.1) + self.assertEqual(sys.exc_info(), (None, None, None)) + finally: + timer.close() + + + +if __name__ == '__main__': + greentest.main() diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__execmodules.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__execmodules.py new file mode 100644 index 00000000..1844a305 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__execmodules.py @@ -0,0 +1,39 @@ +import unittest +import warnings + +from gevent.testing.modules import walk_modules +from gevent.testing import main +from gevent.testing.sysinfo import NON_APPLICABLE_SUFFIXES + + +from gevent.testing import six + + +class TestExec(unittest.TestCase): + pass + + +def make_exec_test(path, module): + + def test(_): + with open(path, 'rb') as f: + src = f.read() + with warnings.catch_warnings(): + warnings.simplefilter('ignore', DeprecationWarning) + six.exec_(src, {'__file__': path}) + + name = "test_" + module.replace(".", "_") + test.__name__ = name + setattr(TestExec, name, test) + +def make_all_tests(): + for path, module in walk_modules(recursive=True): + if module.endswith(NON_APPLICABLE_SUFFIXES): + continue + make_exec_test(path, module) + + +make_all_tests() + +if __name__ == '__main__': + main() diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__fileobject.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__fileobject.py new file mode 100644 index 00000000..d3bdef84 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__fileobject.py @@ -0,0 +1,278 @@ +from __future__ import print_function +import os +import sys +import tempfile +import gc +import unittest + +import gevent +from gevent import fileobject + +import gevent.testing as greentest +from gevent.testing.sysinfo import PY3 +from gevent.testing.flaky import reraiseFlakyTestRaceConditionLibuv +from gevent.testing.skipping import skipOnLibuvOnCIOnPyPy + + +try: + ResourceWarning +except NameError: + class ResourceWarning(Warning): + "Python 2 fallback" + + +def writer(fobj, line): + for character in line: + fobj.write(character) + fobj.flush() + fobj.close() + + +def close_fd_quietly(fd): + try: + os.close(fd) + except (IOError, OSError): + pass + +class TestFileObjectBlock(greentest.TestCase): + + def _getTargetClass(self): + return fileobject.FileObjectBlock + + def _makeOne(self, *args, **kwargs): + return self._getTargetClass()(*args, **kwargs) + + def _test_del(self, **kwargs): + r, w = os.pipe() + self.addCleanup(close_fd_quietly, r) + self.addCleanup(close_fd_quietly, w) + + self._do_test_del((r, w), **kwargs) + + def _do_test_del(self, pipe, **kwargs): + r, w = pipe + s = self._makeOne(w, 'wb', **kwargs) + s.write(b'x') + try: + s.flush() + except IOError: + # Sometimes seen on Windows/AppVeyor + print("Failed flushing fileobject", repr(s), file=sys.stderr) + import traceback + traceback.print_exc() + + import warnings + with warnings.catch_warnings(): + warnings.simplefilter('ignore', ResourceWarning) + # Deliberately getting ResourceWarning with FileObject(Thread) under Py3 + del s + gc.collect() # PyPy + + if kwargs.get("close", True): + with self.assertRaises((OSError, IOError)): + # expected, because FileObject already closed it + os.close(w) + else: + os.close(w) + + with self._makeOne(r, 'rb') as fobj: + self.assertEqual(fobj.read(), b'x') + + def test_del(self): + # Close should be true by default + self._test_del() + + def test_del_close(self): + self._test_del(close=True) + + @skipOnLibuvOnCIOnPyPy("This appears to crash on libuv/pypy/travis.") + # No idea why, can't duplicate locally. + def test_seek(self): + fileno, path = tempfile.mkstemp('.gevent.test__fileobject.test_seek') + self.addCleanup(os.remove, path) + + s = b'a' * 1024 + os.write(fileno, b'B' * 15) + os.write(fileno, s) + os.close(fileno) + + with open(path, 'rb') as f: + f.seek(15) + native_data = f.read(1024) + + with open(path, 'rb') as f_raw: + try: + f = self._makeOne(f_raw, 'rb', close=False) + except ValueError: + # libuv on Travis can raise EPERM + # from FileObjectPosix. I can't produce it on mac os locally, + # don't know what the issue is. This started happening on Jan 19, + # in the branch that caused all watchers to be explicitly closed. + # That shouldn't have any effect on io watchers, though, which were + # already being explicitly closed. + reraiseFlakyTestRaceConditionLibuv() + + if PY3 or hasattr(f, 'seekable'): + # On Python 3, all objects should have seekable. + # On Python 2, only our custom objects do. + self.assertTrue(f.seekable()) + f.seek(15) + self.assertEqual(15, f.tell()) + + # Note that a duplicate close() of the underlying + # file descriptor can look like an OSError from this line + # as we exit the with block + fileobj_data = f.read(1024) + + self.assertEqual(native_data, s) + self.assertEqual(native_data, fileobj_data) + + def test_close_pipe(self): + # Issue #190, 203 + r, w = os.pipe() + x = self._makeOne(r) + y = self._makeOne(w, 'w') + x.close() + y.close() + + +class ConcurrentFileObjectMixin(object): + # Additional tests for fileobjects that cooperate + # and we have full control of the implementation + + def test_read1(self): + # Issue #840 + r, w = os.pipe() + x = self._makeOne(r) + y = self._makeOne(w, 'w') + self._close_on_teardown(x) + self._close_on_teardown(y) + self.assertTrue(hasattr(x, 'read1')) + + def test_bufsize_0(self): + # Issue #840 + r, w = os.pipe() + x = self._makeOne(r, 'rb', bufsize=0) + y = self._makeOne(w, 'wb', bufsize=0) + self._close_on_teardown(x) + self._close_on_teardown(y) + y.write(b'a') + b = x.read(1) + self.assertEqual(b, b'a') + + y.writelines([b'2']) + b = x.read(1) + self.assertEqual(b, b'2') + + def test_newlines(self): + import warnings + r, w = os.pipe() + lines = [b'line1\n', b'line2\r', b'line3\r\n', b'line4\r\nline5', b'\nline6'] + g = gevent.spawn(writer, self._makeOne(w, 'wb'), lines) + + try: + with warnings.catch_warnings(): + warnings.simplefilter('ignore', DeprecationWarning) + # U is deprecated in Python 3, shows up on FileObjectThread + fobj = self._makeOne(r, 'rU') + result = fobj.read() + fobj.close() + self.assertEqual('line1\nline2\nline3\nline4\nline5\nline6', result) + finally: + g.kill() + + +class TestFileObjectThread(ConcurrentFileObjectMixin, + TestFileObjectBlock): + + def _getTargetClass(self): + return fileobject.FileObjectThread + + # FileObjectThread uses os.fdopen() when passed a file-descriptor, + # which returns an object with a destructor that can't be + # bypassed, so we can't even create one that way + def test_del_noclose(self): + with self.assertRaisesRegex(TypeError, + 'FileObjectThread does not support close=False on an fd.'): + self._test_del(close=False) + + # We don't test this with FileObjectThread. Sometimes the + # visibility of the 'close' operation, which happens in a + # background thread, doesn't make it to the foreground + # thread in a timely fashion, leading to 'os.close(4) must + # not succeed' in test_del_close. We have the same thing + # with flushing and closing in test_newlines. Both of + # these are most commonly (only?) observed on Py27/64-bit. + # They also appear on 64-bit 3.6 with libuv + + def test_del(self): + raise unittest.SkipTest("Race conditions") + + def test_del_close(self): + raise unittest.SkipTest("Race conditions") + + +@unittest.skipUnless( + hasattr(fileobject, 'FileObjectPosix'), + "Needs FileObjectPosix" +) +class TestFileObjectPosix(ConcurrentFileObjectMixin, + TestFileObjectBlock): + + def _getTargetClass(self): + return fileobject.FileObjectPosix + + def test_seek_raises_ioerror(self): + # https://github.com/gevent/gevent/issues/1323 + + # Get a non-seekable file descriptor + r, w = os.pipe() + + self.addCleanup(close_fd_quietly, r) + self.addCleanup(close_fd_quietly, w) + + with self.assertRaises(OSError) as ctx: + os.lseek(r, 0, os.SEEK_SET) + os_ex = ctx.exception + + with self.assertRaises(IOError) as ctx: + f = self._makeOne(r, 'r', close=False) + # Seek directly using the underlying GreenFileDescriptorIO; + # the buffer may do different things, depending + # on the version of Python (especially 3.7+) + f.fileio.seek(0) + io_ex = ctx.exception + + self.assertEqual(io_ex.errno, os_ex.errno) + self.assertEqual(io_ex.strerror, os_ex.strerror) + self.assertEqual(io_ex.args, os_ex.args) + self.assertEqual(str(io_ex), str(os_ex)) + + +class TestTextMode(unittest.TestCase): + + def test_default_mode_writes_linesep(self): + # See https://github.com/gevent/gevent/issues/1282 + # libuv 1.x interferes with the default line mode on + # Windows. + # First, make sure we initialize gevent + gevent.get_hub() + + fileno, path = tempfile.mkstemp('.gevent.test__fileobject.test_default') + self.addCleanup(os.remove, path) + + os.close(fileno) + + with open(path, "w") as f: + f.write("\n") + + with open(path, "rb") as f: + data = f.read() + + self.assertEqual(data, os.linesep.encode('ascii')) + + + +if __name__ == '__main__': + sys.argv.append('-v') + greentest.main() diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__getaddrinfo_import.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__getaddrinfo_import.py new file mode 100644 index 00000000..098ea917 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__getaddrinfo_import.py @@ -0,0 +1,7 @@ +# a deadlock is possible if we import a module that runs Gevent's getaddrinfo +# with a unicode hostname, which starts Python's getaddrinfo on a thread, which +# attempts to import encodings.idna but blocks on the import lock. verify +# that Gevent avoids this deadlock. + +import getaddrinfo_module +del getaddrinfo_module # fix pyflakes diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__greenio.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__greenio.py new file mode 100644 index 00000000..08c4d6a5 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__greenio.py @@ -0,0 +1,128 @@ +# Copyright (c) 2006-2007, Linden Research, Inc. +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. +import sys + +import gevent +from gevent import socket + +from gevent.testing import TestCase, main, tcp_listener +from gevent.testing import skipOnPyPy +from gevent.testing import params + + + +PYPY = hasattr(sys, 'pypy_version_info') +PY3 = sys.version_info[0] >= 3 + + +def _write_to_closed(f, s): + try: + r = f.write(s) + except ValueError: + assert PY3 + else: + assert r is None, r + + +class TestGreenIo(TestCase): + + def test_close_with_makefile(self): + + def accept_close_early(listener): + # verify that the makefile and the socket are truly independent + # by closing the socket prior to using the made file + try: + conn, _ = listener.accept() + fd = conn.makefile(mode='wb') + conn.close() + fd.write(b'hello\n') + fd.close() + _write_to_closed(fd, b'a') + self.assertRaises(socket.error, conn.send, b'b') + finally: + listener.close() + + def accept_close_late(listener): + # verify that the makefile and the socket are truly independent + # by closing the made file and then sending a character + try: + conn, _ = listener.accept() + fd = conn.makefile(mode='wb') + fd.write(b'hello') + fd.close() + conn.send(b'\n') + conn.close() + _write_to_closed(fd, b'a') + self.assertRaises(socket.error, conn.send, b'b') + finally: + listener.close() + + def did_it_work(server): + client = socket.create_connection((params.DEFAULT_CONNECT, server.getsockname()[1])) + fd = client.makefile(mode='rb') + client.close() + self.assertEqual(fd.readline(), b'hello\n') + self.assertFalse(fd.read()) + fd.close() + + server = tcp_listener() + server_greenlet = gevent.spawn(accept_close_early, server) + did_it_work(server) + server_greenlet.kill() + + server = tcp_listener() + server_greenlet = gevent.spawn(accept_close_late, server) + did_it_work(server) + server_greenlet.kill() + + @skipOnPyPy("GC is different") + def test_del_closes_socket(self): + def accept_once(listener): + # delete/overwrite the original conn + # object, only keeping the file object around + # closing the file object should close everything + + # XXX: This is not exactly true on Python 3. + # This produces a ResourceWarning. + oconn = None + try: + conn, _ = listener.accept() + if PY3: + oconn = conn + conn = conn.makefile(mode='wb') + conn.write(b'hello\n') + conn.close() + _write_to_closed(conn, b'a') + finally: + listener.close() + if oconn is not None: + oconn.close() + + server = tcp_listener() + gevent.spawn(accept_once, server) + client = socket.create_connection((params.DEFAULT_CONNECT, server.getsockname()[1])) + with gevent.Timeout.start_new(0.5): + fd = client.makefile() + client.close() + self.assertEqual(fd.read(), 'hello\n') + self.assertEqual(fd.read(), '') + + +if __name__ == '__main__': + main() diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__greenlet.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__greenlet.py new file mode 100644 index 00000000..208482df --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__greenlet.py @@ -0,0 +1,831 @@ +# Copyright (c) 2008-2009 AG Projects +# Author: Denis Bilenko +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. +import re +import unittest + +import gevent.testing as greentest +import gevent + +from gevent import sleep, with_timeout, getcurrent +from gevent import greenlet +from gevent.event import AsyncResult +from gevent.queue import Queue, Channel + +from gevent.testing.timing import AbstractGenericWaitTestCase +from gevent.testing.timing import AbstractGenericGetTestCase +from gevent.testing import timing + +DELAY = timing.SMALL_TICK +greentest.TestCase.error_fatal = False + + +class ExpectedError(greentest.ExpectedException): + pass + + +class TestLink(greentest.TestCase): + + def test_link_to_asyncresult(self): + p = gevent.spawn(lambda: 100) + event = AsyncResult() + p.link(event) + self.assertEqual(event.get(), 100) + + for _ in range(3): + event2 = AsyncResult() + p.link(event2) + self.assertEqual(event2.get(), 100) + + def test_link_to_asyncresult_exception(self): + err = ExpectedError('test_link_to_asyncresult_exception') + p = gevent.spawn(lambda: getcurrent().throw(err)) + event = AsyncResult() + p.link(event) + with self.assertRaises(ExpectedError) as exc: + event.get() + + self.assertIs(exc.exception, err) + + for _ in range(3): + event2 = AsyncResult() + p.link(event2) + with self.assertRaises(ExpectedError) as exc: + event2.get() + self.assertIs(exc.exception, err) + + def test_link_to_queue(self): + p = gevent.spawn(lambda: 100) + q = Queue() + p.link(q.put) + self.assertEqual(q.get().get(), 100) + + for _ in range(3): + p.link(q.put) + self.assertEqual(q.get().get(), 100) + + def test_link_to_channel(self): + p1 = gevent.spawn(lambda: 101) + p2 = gevent.spawn(lambda: 102) + p3 = gevent.spawn(lambda: 103) + q = Channel() + p1.link(q.put) + p2.link(q.put) + p3.link(q.put) + results = [q.get().get(), q.get().get(), q.get().get()] + assert sorted(results) == [101, 102, 103], results + + +class TestUnlink(greentest.TestCase): + switch_expected = False + + def _test_func(self, p, link): + link(dummy_test_func) + self.assertEqual(1, p.has_links()) + + p.unlink(dummy_test_func) + self.assertEqual(0, p.has_links()) + + link(self.setUp) + self.assertEqual(1, p.has_links()) + + p.unlink(self.setUp) + self.assertEqual(0, p.has_links()) + + p.kill() + + def test_func_link(self): + p = gevent.spawn(dummy_test_func) + self._test_func(p, p.link) + + def test_func_link_value(self): + p = gevent.spawn(dummy_test_func) + self._test_func(p, p.link_value) + + def test_func_link_exception(self): + p = gevent.spawn(dummy_test_func) + self._test_func(p, p.link_exception) + + +class LinksTestCase(greentest.TestCase): + + link_method = None + + def link(self, p, listener=None): + getattr(p, self.link_method)(listener) + + def set_links(self, p): + event = AsyncResult() + self.link(p, event) + + queue = Queue(1) + self.link(p, queue.put) + + callback_flag = ['initial'] + self.link(p, lambda *args: callback_flag.remove('initial')) + + for _ in range(10): + self.link(p, AsyncResult()) + self.link(p, Queue(1).put) + + return event, queue, callback_flag + + def set_links_timeout(self, link): + # stuff that won't be touched + event = AsyncResult() + link(event) + + queue = Channel() + link(queue.put) + return event, queue + + def check_timed_out(self, event, queue): + assert with_timeout(DELAY, event.get, timeout_value=X) is X, repr(event.get()) + assert with_timeout(DELAY, queue.get, timeout_value=X) is X, queue.get() + + +def return25(): + return 25 + + + +class TestReturn_link(LinksTestCase): + link_method = 'link' + + p = None + + def cleanup(self): + self.p.unlink_all() + self.p = None + + def test_return(self): + self.p = gevent.spawn(return25) + for _ in range(3): + self._test_return(self.p, 25) + self.p.kill() + + def _test_return(self, p, result): + event, queue, callback_flag = self.set_links(p) + + # stuff that will time out because there's no unhandled exception: + xxxxx = self.set_links_timeout(p.link_exception) + + sleep(DELAY * 2) + self.assertFalse(p) + + self.assertEqual(event.get(), result) + self.assertEqual(queue.get().get(), result) + + sleep(DELAY) + self.assertFalse(callback_flag) + + self.check_timed_out(*xxxxx) + + def _test_kill(self, p): + event, queue, callback_flag = self.set_links(p) + xxxxx = self.set_links_timeout(p.link_exception) + + p.kill() + sleep(DELAY) + self.assertFalse(p) + + + self.assertIsInstance(event.get(), gevent.GreenletExit) + self.assertIsInstance(queue.get().get(), gevent.GreenletExit) + + sleep(DELAY) + self.assertFalse(callback_flag) + + self.check_timed_out(*xxxxx) + + def test_kill(self): + p = self.p = gevent.spawn(sleep, DELAY) + for _ in range(3): + self._test_kill(p) + + +class TestReturn_link_value(TestReturn_link): + link_method = 'link_value' + + +class TestRaise_link(LinksTestCase): + link_method = 'link' + + def _test_raise(self, p): + event, queue, callback_flag = self.set_links(p) + xxxxx = self.set_links_timeout(p.link_value) + + sleep(DELAY) + assert not p, p + + self.assertRaises(ExpectedError, event.get) + self.assertEqual(queue.get(), p) + sleep(DELAY) + assert not callback_flag, callback_flag + + self.check_timed_out(*xxxxx) + + def test_raise(self): + p = gevent.spawn(lambda: getcurrent().throw(ExpectedError('test_raise'))) + for _ in range(3): + self._test_raise(p) + + +class TestRaise_link_exception(TestRaise_link): + link_method = 'link_exception' + + +class TestStuff(greentest.TestCase): + + def test_minimal_id(self): + g = gevent.spawn(lambda: 1) + self.assertGreaterEqual(g.minimal_ident, 0) + self.assertGreaterEqual(g.parent.minimal_ident, 0) + g.join() # don't leave dangling, breaks the leak checks + + def test_wait_noerrors(self): + x = gevent.spawn(lambda: 1) + y = gevent.spawn(lambda: 2) + z = gevent.spawn(lambda: 3) + gevent.joinall([x, y, z], raise_error=True) + self.assertEqual([x.value, y.value, z.value], [1, 2, 3]) + e = AsyncResult() + x.link(e) + self.assertEqual(e.get(), 1) + x.unlink(e) + e = AsyncResult() + x.link(e) + self.assertEqual(e.get(), 1) + + def test_wait_error(self): + + def x(): + sleep(DELAY) + return 1 + x = gevent.spawn(x) + y = gevent.spawn(lambda: getcurrent().throw(ExpectedError('test_wait_error'))) + self.assertRaises(ExpectedError, gevent.joinall, [x, y], raise_error=True) + self.assertRaises(ExpectedError, gevent.joinall, [y], raise_error=True) + x.join() + test_wait_error.ignore_leakcheck = True + + def test_joinall_exception_order(self): + # if there're several exceptions raised, the earliest one must be raised by joinall + def first(): + sleep(0.1) + raise ExpectedError('first') + a = gevent.spawn(first) + b = gevent.spawn(lambda: getcurrent().throw(ExpectedError('second'))) + try: + gevent.joinall([a, b], raise_error=True) + except ExpectedError as ex: + assert 'second' in str(ex), repr(str(ex)) + gevent.joinall([a, b]) + test_joinall_exception_order.ignore_leakcheck = True + + def test_joinall_count_raise_error(self): + # When joinall is asked not to raise an error, the 'count' param still + # works. + def raises_but_ignored(): + raise ExpectedError("count") + + def sleep_forever(): + while True: + sleep(0.1) + + sleeper = gevent.spawn(sleep_forever) + raiser = gevent.spawn(raises_but_ignored) + + gevent.joinall([sleeper, raiser], raise_error=False, count=1) + assert_ready(raiser) + assert_not_ready(sleeper) + + # Clean up our mess + sleeper.kill() + assert_ready(sleeper) + + def test_multiple_listeners_error(self): + # if there was an error while calling a callback + # it should not prevent the other listeners from being called + # also, all of the errors should be logged, check the output + # manually that they are + p = gevent.spawn(lambda: 5) + results = [] + + def listener1(*_args): + results.append(10) + raise ExpectedError('listener1') + + def listener2(*_args): + results.append(20) + raise ExpectedError('listener2') + + def listener3(*_args): + raise ExpectedError('listener3') + + p.link(listener1) + p.link(listener2) + p.link(listener3) + sleep(DELAY * 10) + self.assertIn(results, [[10, 20], [20, 10]]) + + p = gevent.spawn(lambda: getcurrent().throw(ExpectedError('test_multiple_listeners_error'))) + results = [] + p.link(listener1) + p.link(listener2) + p.link(listener3) + sleep(DELAY * 10) + self.assertIn(results, [[10, 20], [20, 10]]) + + class Results(object): + + def __init__(self): + self.results = [] + + def listener1(self, p): + p.unlink(self.listener2) + self.results.append(5) + raise ExpectedError('listener1') + + def listener2(self, p): + p.unlink(self.listener1) + self.results.append(5) + raise ExpectedError('listener2') + + def listener3(self, _p): + raise ExpectedError('listener3') + + def _test_multiple_listeners_error_unlink(self, _p, link): + # notification must not happen after unlink even + # though notification process has been already started + results = self.Results() + + link(results.listener1) + link(results.listener2) + link(results.listener3) + sleep(DELAY * 10) + self.assertEqual([5], results.results) + + + def test_multiple_listeners_error_unlink_Greenlet_link(self): + p = gevent.spawn(lambda: 5) + self._test_multiple_listeners_error_unlink(p, p.link) + p.kill() + + def test_multiple_listeners_error_unlink_Greenlet_rawlink(self): + p = gevent.spawn(lambda: 5) + self._test_multiple_listeners_error_unlink(p, p.rawlink) + + def test_multiple_listeners_error_unlink_AsyncResult_rawlink(self): + e = AsyncResult() + gevent.spawn(e.set, 6) + self._test_multiple_listeners_error_unlink(e, e.rawlink) + + +def dummy_test_func(*_args): + pass + + +class A(object): + + def method(self): + pass + +hexobj = re.compile('-?0x[0123456789abcdef]+L?', re.I) + +class Subclass(gevent.Greenlet): + pass + +class TestStr(greentest.TestCase): + + def test_function(self): + g = gevent.Greenlet.spawn(dummy_test_func) + self.assertTrue(hexobj.sub('X', str(g)).endswith('at X: dummy_test_func>')) + assert_not_ready(g) + g.join() + assert_ready(g) + self.assertTrue(hexobj.sub('X', str(g)).endswith(' at X: dummy_test_func>'), str(g)) + + def test_method(self): + g = gevent.Greenlet.spawn(A().method) + str_g = hexobj.sub('X', str(g)) + str_g = str_g.replace(__name__, 'module') + self.assertTrue(str_g.startswith('>>')) + assert_not_ready(g) + g.join() + assert_ready(g) + str_g = hexobj.sub('X', str(g)) + str_g = str_g.replace(__name__, 'module') + self.assertTrue(str_g.endswith('at X: >>')) + + def test_subclass(self): + g = Subclass() + str_g = hexobj.sub('X', str(g)) + str_g = str_g.replace(__name__, 'module') + self.assertTrue(str_g.startswith('')) + + g = Subclass(None, 'question', answer=42) + str_g = hexobj.sub('X', str(g)) + str_g = str_g.replace(__name__, 'module') + self.assertTrue(str_g.endswith(" at X: _run('question', answer=42)>")) + + +class TestJoin(AbstractGenericWaitTestCase): + + def wait(self, timeout): + g = gevent.spawn(gevent.sleep, 10) + try: + return g.join(timeout=timeout) + finally: + g.kill() + + +class TestGet(AbstractGenericGetTestCase): + + def wait(self, timeout): + g = gevent.spawn(gevent.sleep, 10) + try: + return g.get(timeout=timeout) + finally: + g.kill() + + +class TestJoinAll0(AbstractGenericWaitTestCase): + + g = gevent.Greenlet() + + def wait(self, timeout): + gevent.joinall([self.g], timeout=timeout) + + +class TestJoinAll(AbstractGenericWaitTestCase): + + def wait(self, timeout): + g = gevent.spawn(gevent.sleep, 10) + try: + gevent.joinall([g], timeout=timeout) + finally: + g.kill() + + +class TestBasic(greentest.TestCase): + + def test_spawn_non_callable(self): + self.assertRaises(TypeError, gevent.spawn, 1) + self.assertRaises(TypeError, gevent.spawn_raw, 1) + + # Not passing the run argument, just the seconds argument + self.assertRaises(TypeError, gevent.spawn_later, 1) + # Passing both, but not implemented + self.assertRaises(TypeError, gevent.spawn_later, 1, 1) + + def test_spawn_raw_kwargs(self): + value = [] + + def f(*args, **kwargs): + value.append(args) + value.append(kwargs) + + g = gevent.spawn_raw(f, 1, name='value') + gevent.sleep(0.01) + assert not g + self.assertEqual(value[0], (1,)) + self.assertEqual(value[1], {'name': 'value'}) + + def test_simple_exit(self): + link_test = [] + + def func(delay, return_value=4): + gevent.sleep(delay) + return return_value + + g = gevent.Greenlet(func, 0.01, return_value=5) + g.rawlink(link_test.append) # use rawlink to avoid timing issues on Appveyor/Travis (not always successful) + assert not g, bool(g) + assert not g.dead + assert not g.started + assert not g.ready() + assert not g.successful() + assert g.value is None + assert g.exception is None + + g.start() + assert g # changed + assert not g.dead + assert g.started # changed + assert not g.ready() + assert not g.successful() + assert g.value is None + assert g.exception is None + + gevent.sleep(0.001) + self.assertTrue(g) + self.assertFalse(g.dead, g) + self.assertTrue(g.started, g) + self.assertFalse(g.ready(), g) + self.assertFalse(g.successful(), g) + self.assertIsNone(g.value, g) + self.assertIsNone(g.exception, g) + self.assertFalse(link_test) + + gevent.sleep(0.02) + assert not g + assert g.dead + assert not g.started + assert g.ready() + assert g.successful() + assert g.value == 5 + assert g.exception is None # not changed + assert link_test == [g] or greentest.RUNNING_ON_CI, link_test # changed + + def test_error_exit(self): + link_test = [] + + def func(delay, return_value=4): + gevent.sleep(delay) + error = ExpectedError('test_error_exit') + setattr(error, 'myattr', return_value) + raise error + + g = gevent.Greenlet(func, timing.SMALLEST_RELIABLE_DELAY, return_value=5) + # use rawlink to avoid timing issues on Appveyor (not always successful) + g.rawlink(link_test.append) + g.start() + gevent.sleep() + gevent.sleep(timing.LARGE_TICK) + self.assertFalse(g) + self.assertTrue(g.dead) + self.assertFalse(g.started) + self.assertTrue(g.ready()) + self.assertFalse(g.successful()) + self.assertIsNone(g.value) # not changed + self.assertEqual(g.exception.myattr, 5) + + assert link_test == [g] or greentest.RUNNING_ON_APPVEYOR, link_test + + def _assertKilled(self, g): + assert not g + assert g.dead + assert not g.started + assert g.ready() + assert g.successful(), (repr(g), g.value, g.exception) + assert isinstance(g.value, gevent.GreenletExit), (repr(g), g.value, g.exception) + assert g.exception is None + + def assertKilled(self, g): + self._assertKilled(g) + gevent.sleep(0.01) + self._assertKilled(g) + + def _test_kill(self, g, block): + g.kill(block=block) + if not block: + gevent.sleep(0.01) + self.assertKilled(g) + # kill second time must not hurt + g.kill(block=block) + self.assertKilled(g) + + def _test_kill_not_started(self, block): + link_test = [] + result = [] + g = gevent.Greenlet(lambda: result.append(1)) + g.link(link_test.append) + self._test_kill(g, block=block) + assert not result + assert link_test == [g] + + def test_kill_not_started_block(self): + self._test_kill_not_started(block=True) + + def test_kill_not_started_noblock(self): + self._test_kill_not_started(block=False) + + def _test_kill_just_started(self, block): + result = [] + link_test = [] + g = gevent.Greenlet(lambda: result.append(1)) + g.link(link_test.append) + g.start() + self._test_kill(g, block=block) + assert not result, result + assert link_test == [g] + + def test_kill_just_started_block(self): + self._test_kill_just_started(block=True) + + def test_kill_just_started_noblock(self): + self._test_kill_just_started(block=False) + + def _test_kill_just_started_later(self, block): + result = [] + link_test = [] + g = gevent.Greenlet(lambda: result.append(1)) + g.link(link_test.append) + g.start_later(1) + self._test_kill(g, block=block) + assert not result + + def test_kill_just_started_later_block(self): + self._test_kill_just_started_later(block=True) + + def test_kill_just_started_later_noblock(self): + self._test_kill_just_started_later(block=False) + + def _test_kill_running(self, block): + link_test = [] + g = gevent.spawn(gevent.sleep, 10) + g.link(link_test.append) + self._test_kill(g, block=block) + gevent.sleep(0.01) + assert link_test == [g] + + def test_kill_running_block(self): + self._test_kill_running(block=True) + + def test_kill_running_noblock(self): + self._test_kill_running(block=False) + + def test_exc_info_no_error(self): + # Before running + self.assertFalse(greenlet.Greenlet().exc_info) + g = greenlet.Greenlet(gevent.sleep) + g.start() + g.join() + self.assertFalse(g.exc_info) + + def test_tree_locals(self): + g = g2 = None + def func(): + child = greenlet.Greenlet() + self.assertIs(child.spawn_tree_locals, getcurrent().spawn_tree_locals) + self.assertIs(child.spawning_greenlet(), getcurrent()) + g = greenlet.Greenlet(func) + g2 = greenlet.Greenlet(func) + # Creating those greenlets did not give the main greenlet + # a locals dict. + self.assertFalse(hasattr(getcurrent(), 'spawn_tree_locals'), + getcurrent()) + self.assertIsNot(g.spawn_tree_locals, g2.spawn_tree_locals) + g.start() + g.join() + + raw = gevent.spawn_raw(func) + self.assertIsNotNone(raw.spawn_tree_locals) + self.assertIsNot(raw.spawn_tree_locals, g.spawn_tree_locals) + self.assertIs(raw.spawning_greenlet(), getcurrent()) + while not raw.dead: + gevent.sleep(0.01) + + def test_add_spawn_callback(self): + called = {'#': 0} + + def cb(gr): + called['#'] += 1 + gr._called_test = True + + gevent.Greenlet.add_spawn_callback(cb) + try: + g = gevent.spawn(lambda: None) + self.assertTrue(hasattr(g, '_called_test')) + g.join() + self.assertEqual(called['#'], 1) + + g = gevent.spawn_later(1e-5, lambda: None) + self.assertTrue(hasattr(g, '_called_test')) + g.join() + self.assertEqual(called['#'], 2) + + g = gevent.Greenlet(lambda: None) + g.start() + self.assertTrue(hasattr(g, '_called_test')) + g.join() + self.assertEqual(called['#'], 3) + + gevent.Greenlet.remove_spawn_callback(cb) + g = gevent.spawn(lambda: None) + self.assertFalse(hasattr(g, '_called_test')) + g.join() + self.assertEqual(called['#'], 3) + finally: + gevent.Greenlet.remove_spawn_callback(cb) + + def test_getframe_value_error(self): + def get(): + raise ValueError("call stack is not deep enough") + try: + ogf = greenlet.sys_getframe + except AttributeError: # pragma: no cover + # Must be running cython compiled + raise unittest.SkipTest("Cannot mock when Cython compiled") + greenlet.sys_getframe = get + try: + child = greenlet.Greenlet() + self.assertIsNone(child.spawning_stack) + finally: + greenlet.sys_getframe = ogf + + +class TestStart(greentest.TestCase): + + def test(self): + g = gevent.spawn(gevent.sleep, 0.01) + assert g.started + assert not g.dead + g.start() + assert g.started + assert not g.dead + g.join() + assert not g.started + assert g.dead + g.start() + assert not g.started + assert g.dead + + +def assert_ready(g): + assert g.dead, g + assert g.ready(), g + assert not bool(g), g + + +def assert_not_ready(g): + assert not g.dead, g + assert not g.ready(), g + + +class TestRef(greentest.TestCase): + + def test_init(self): + self.switch_expected = False + # in python-dbg mode this will check that Greenlet() does not create any circular refs + gevent.Greenlet() + + def test_kill_scheduled(self): + gevent.spawn(gevent.sleep, 10).kill() + + def test_kill_started(self): + g = gevent.spawn(gevent.sleep, 10) + try: + gevent.sleep(0.001) + finally: + g.kill() + + +@greentest.skipOnPurePython("Needs C extension") +class TestCExt(greentest.TestCase): # pragma: no cover (we only do coverage on pure-Python) + + def test_c_extension(self): + self.assertEqual(greenlet.Greenlet.__module__, + 'gevent._greenlet') + self.assertEqual(greenlet.SpawnedLink.__module__, + 'gevent._greenlet') + +@greentest.skipWithCExtensions("Needs pure python") +class TestPure(greentest.TestCase): + + def test_pure(self): + self.assertEqual(greenlet.Greenlet.__module__, + 'gevent.greenlet') + self.assertEqual(greenlet.SpawnedLink.__module__, + 'gevent.greenlet') + + +X = object() + +del AbstractGenericGetTestCase +del AbstractGenericWaitTestCase + + +if __name__ == '__main__': + greentest.main() diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__greenletset.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__greenletset.py new file mode 100644 index 00000000..6122857a --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__greenletset.py @@ -0,0 +1,164 @@ +from __future__ import print_function, division, absolute_import +import time +import gevent.testing as greentest + +from gevent.testing import timing +import gevent +from gevent import pool +from gevent.timeout import Timeout + +DELAY = timing.LARGE_TICK + + +class SpecialError(Exception): + pass + + +class Undead(object): + + def __init__(self): + self.shot_count = 0 + + def __call__(self): + while True: + try: + gevent.sleep(1) + except SpecialError: + break + except: # pylint:disable=bare-except + self.shot_count += 1 + + +class Test(greentest.TestCase): + + __timeout__ = greentest.LARGE_TIMEOUT + + def test_basic(self): + s = pool.Group() + s.spawn(gevent.sleep, timing.LARGE_TICK) + self.assertEqual(len(s), 1, s) + s.spawn(gevent.sleep, timing.LARGE_TICK * 5) + self.assertEqual(len(s), 2, s) + gevent.sleep() + gevent.sleep(timing.LARGE_TICK * 2 + timing.LARGE_TICK_MIN_ADJ) + self.assertEqual(len(s), 1, s) + gevent.sleep(timing.LARGE_TICK * 5 + timing.LARGE_TICK_MIN_ADJ) + self.assertFalse(s) + + def test_waitall(self): + s = pool.Group() + s.spawn(gevent.sleep, DELAY) + s.spawn(gevent.sleep, DELAY * 2) + assert len(s) == 2, s + start = time.time() + s.join(raise_error=True) + delta = time.time() - start + self.assertFalse(s) + self.assertEqual(len(s), 0) + self.assertTimeWithinRange(delta, DELAY * 1.9, DELAY * 2.5) + + def test_kill_block(self): + s = pool.Group() + s.spawn(gevent.sleep, DELAY) + s.spawn(gevent.sleep, DELAY * 2) + assert len(s) == 2, s + start = time.time() + s.kill() + self.assertFalse(s) + self.assertEqual(len(s), 0) + delta = time.time() - start + assert delta < DELAY * 0.8, delta + + def test_kill_noblock(self): + s = pool.Group() + s.spawn(gevent.sleep, DELAY) + s.spawn(gevent.sleep, DELAY * 2) + assert len(s) == 2, s + s.kill(block=False) + assert len(s) == 2, s + gevent.sleep(0.0001) + self.assertFalse(s) + self.assertEqual(len(s), 0) + + def test_kill_fires_once(self): + u1 = Undead() + u2 = Undead() + p1 = gevent.spawn(u1) + p2 = gevent.spawn(u2) + + def check(count1, count2): + self.assertTrue(p1) + self.assertTrue(p2) + self.assertFalse(p1.dead, p1) + self.assertFalse(p2.dead, p2) + self.assertEqual(u1.shot_count, count1) + self.assertEqual(u2.shot_count, count2) + + gevent.sleep(0.01) + s = pool.Group([p1, p2]) + self.assertEqual(len(s), 2, s) + check(0, 0) + s.killone(p1, block=False) + check(0, 0) + gevent.sleep(0) + check(1, 0) + s.killone(p1) + check(1, 0) + s.killone(p1) + check(1, 0) + s.kill(block=False) + s.kill(block=False) + s.kill(block=False) + check(1, 0) + gevent.sleep(DELAY) + check(1, 1) + X = object() + kill_result = gevent.with_timeout(DELAY, s.kill, block=True, timeout_value=X) + assert kill_result is X, repr(kill_result) + assert len(s) == 2, s + check(1, 1) + + p1.kill(SpecialError) + p2.kill(SpecialError) + + def test_killall_subclass(self): + p1 = GreenletSubclass.spawn(lambda: 1 / 0) + p2 = GreenletSubclass.spawn(lambda: gevent.sleep(10)) + s = pool.Group([p1, p2]) + s.kill() + + def test_killall_iterable_argument_non_block(self): + p1 = GreenletSubclass.spawn(lambda: gevent.sleep(0.5)) + p2 = GreenletSubclass.spawn(lambda: gevent.sleep(0.5)) + s = set() + s.add(p1) + s.add(p2) + gevent.killall(s, block=False) + gevent.sleep(0.5) + for g in s: + assert g.dead + + def test_killall_iterable_argument_timeout(self): + def f(): + try: + gevent.sleep(1.5) + except: # pylint:disable=bare-except + gevent.sleep(1) + p1 = GreenletSubclass.spawn(f) + p2 = GreenletSubclass.spawn(f) + s = set() + s.add(p1) + s.add(p2) + with self.assertRaises(Timeout): + gevent.killall(s, timeout=0.5) + + for g in s: + self.assertFalse(g.dead, g) + + +class GreenletSubclass(gevent.Greenlet): + pass + + +if __name__ == '__main__': + greentest.main() diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__greenness.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__greenness.py new file mode 100644 index 00000000..5da5a4c6 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__greenness.py @@ -0,0 +1,73 @@ +# Copyright (c) 2008 AG Projects +# Author: Denis Bilenko +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. + +"""Test than modules in gevent.green package are indeed green. +To do that spawn a green server and then access it using a green socket. +If either operation blocked the whole script would block and timeout. +""" +from gevent import monkey +monkey.patch_all() + +import gevent.testing as greentest + +try: + import urllib2 +except ImportError: + from urllib import request as urllib2 +try: + import BaseHTTPServer +except ImportError: + from http import server as BaseHTTPServer + +import gevent +from gevent.testing import params + + +class TestGreenness(greentest.TestCase): + check_totalrefcount = False + + def setUp(self): + server_address = params.DEFAULT_BIND_ADDR_TUPLE + BaseHTTPServer.BaseHTTPRequestHandler.protocol_version = "HTTP/1.0" + self.httpd = BaseHTTPServer.HTTPServer(server_address, BaseHTTPServer.BaseHTTPRequestHandler) + self.httpd.request_count = 0 + + def tearDown(self): + self.httpd.server_close() + self.httpd = None + + def serve(self): + self.httpd.handle_request() + self.httpd.request_count += 1 + + def test_urllib2(self): + server = gevent.spawn(self.serve) + + port = self.httpd.socket.getsockname()[1] + with self.assertRaises(urllib2.HTTPError) as exc: + urllib2.urlopen('http://127.0.0.1:%s' % port) + self.assertEqual(exc.exception.code, 501) + server.get(0.01) + self.assertEqual(self.httpd.request_count, 1) + + +if __name__ == '__main__': + greentest.main() diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__hub.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__hub.py new file mode 100644 index 00000000..44962020 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__hub.py @@ -0,0 +1,332 @@ +# Copyright (c) 2009 AG Projects +# Author: Denis Bilenko +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. + +import re +import time +import unittest + +import gevent.testing as greentest +import gevent.testing.timing + +import gevent +from gevent import socket +from gevent.hub import Waiter, get_hub +from gevent._compat import NativeStrIO + +DELAY = 0.1 + + +class TestCloseSocketWhilePolling(greentest.TestCase): + + def test(self): + sock = socket.socket() + self._close_on_teardown(sock) + t = get_hub().loop.timer(0) + t.start(sock.close) + with self.assertRaises(socket.error): + try: + sock.connect(('python.org', 81)) + finally: + t.close() + + gevent.sleep(0) + + +class TestExceptionInMainloop(greentest.TestCase): + + def test_sleep(self): + # even if there was an error in the mainloop, the hub should continue to work + start = time.time() + gevent.sleep(DELAY) + delay = time.time() - start + + delay_range = DELAY * 0.9 + self.assertTimeWithinRange(delay, DELAY - delay_range, DELAY + delay_range) + + error = greentest.ExpectedException('TestExceptionInMainloop.test_sleep/fail') + + def fail(): + raise error + + with get_hub().loop.timer(0.001) as t: + t.start(fail) + + self.expect_one_error() + + start = time.time() + gevent.sleep(DELAY) + delay = time.time() - start + + self.assert_error(value=error) + self.assertTimeWithinRange(delay, DELAY - delay_range, DELAY + delay_range) + + + +class TestSleep(gevent.testing.timing.AbstractGenericWaitTestCase): + + def wait(self, timeout): + gevent.sleep(timeout) + + def test_simple(self): + gevent.sleep(0) + + +class TestWaiterGet(gevent.testing.timing.AbstractGenericWaitTestCase): + + def setUp(self): + super(TestWaiterGet, self).setUp() + self.waiter = Waiter() + + def wait(self, timeout): + with get_hub().loop.timer(timeout) as evt: + evt.start(self.waiter.switch, None) + return self.waiter.get() + + +class TestWaiter(greentest.TestCase): + + def test(self): + waiter = Waiter() + self.assertEqual(str(waiter), '') + waiter.switch(25) + self.assertEqual(str(waiter), '') + self.assertEqual(waiter.get(), 25) + + waiter = Waiter() + waiter.throw(ZeroDivisionError) + assert re.match('^ midtime: + p.send_signal(signal_to_send) + midtime = endtime + 1 # only once + time.sleep(0.1) + else: + # Kill unresponsive child and exit with error 1 + p.terminate() + p.wait() + raise AssertionError("Failed to wait for child") + + # If we get here, it's because we caused the process to exit; it + # didn't hang. Under Windows, however, we have to use CTRL_BREAK_EVENT, + # which has an arbitrary returncode depending on versions (so does CTRL_C_EVENT + # on Python 2). We still + # count this as success. + self.assertEqual(p.returncode if not WIN else 0, 0) + p.stdout.close() + + if __name__ == '__main__': + greentest.main() diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__iwait.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__iwait.py new file mode 100644 index 00000000..0976e40a --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__iwait.py @@ -0,0 +1,42 @@ +import gevent +import gevent.testing as greentest +from gevent.lock import Semaphore + + +class Testiwait(greentest.TestCase): + + def test_noiter(self): + # Test that gevent.iwait returns objects which can be iterated upon + # without additional calls to iter() + + sem1 = Semaphore() + sem2 = Semaphore() + + gevent.spawn(sem1.release) + ready = next(gevent.iwait((sem1, sem2))) + self.assertEqual(sem1, ready) + + def test_iwait_partial(self): + # Test that the iwait context manager allows the iterator to be + # consumed partially without a memory leak. + + sem = Semaphore() + let = gevent.spawn(sem.release) + with gevent.iwait((sem,), timeout=0.01) as iterator: + self.assertEqual(sem, next(iterator)) + let.get() + + def test_iwait_nogarbage(self): + sem1 = Semaphore() + sem2 = Semaphore() + let = gevent.spawn(sem1.release) + with gevent.iwait((sem1, sem2)) as iterator: + self.assertEqual(sem1, next(iterator)) + self.assertEqual(sem2.linkcount(), 1) + + self.assertEqual(sem2.linkcount(), 0) + let.get() + + +if __name__ == '__main__': + greentest.main() diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__joinall.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__joinall.py new file mode 100644 index 00000000..5d312817 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__joinall.py @@ -0,0 +1,10 @@ +import gevent + + +def func(): + pass + + +a = gevent.spawn(func) +b = gevent.spawn(func) +gevent.joinall([a, b, a]) diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__local.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__local.py new file mode 100644 index 00000000..823b10ee --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__local.py @@ -0,0 +1,428 @@ +import gevent.testing as greentest +from copy import copy +# Comment the line below to see that the standard thread.local is working correct +from gevent import monkey; monkey.patch_all() + + +from threading import local +from threading import Thread + +try: + from collections.abc import Mapping +except ImportError: + from collections import Mapping + +class ReadProperty(object): + """A property that can be overridden""" + + # A non-data descriptor + + def __get__(self, inst, klass): + return 42 if inst is not None else self + + +class A(local): + __slots__ = ['initialized', 'obj'] + + path = '' + + type_path = 'MyPath' + + read_property = ReadProperty() + + def __init__(self, obj): + super(A, self).__init__() + if not hasattr(self, 'initialized'): + self.obj = obj + self.path = '' + + +class Obj(object): + pass + +# These next two classes have to be global to avoid the leakchecks +deleted_sentinels = [] +created_sentinels = [] + +class Sentinel(object): + def __del__(self): + deleted_sentinels.append(id(self)) + + +class MyLocal(local): + + CLASS_PROP = 42 + + def __init__(self): + local.__init__(self) + self.sentinel = Sentinel() + created_sentinels.append(id(self.sentinel)) + + @property + def desc(self): + return self + +class MyLocalSubclass(MyLocal): + pass + +class WithGetattr(local): + + def __getattr__(self, name): + if name == 'foo': + return 42 + return super(WithGetattr, self).__getattr__(name) + +class LocalWithABC(local, Mapping): + + def __getitem__(self, name): + return self.d[name] + + def __iter__(self): + return iter(self.d) + + def __len__(self): + return len(self.d) + +class LocalWithStaticMethod(local): + + @staticmethod + def a_staticmethod(): + return 42 + +class LocalWithClassMethod(local): + + @classmethod + def a_classmethod(cls): + return cls + + + + +class TestGeventLocal(greentest.TestCase): + # pylint:disable=attribute-defined-outside-init,blacklisted-name + + def setUp(self): + del deleted_sentinels[:] + del created_sentinels[:] + + tearDown = setUp + + def test_create_local_subclass_init_args(self): + with self.assertRaisesRegex(TypeError, + "Initialization arguments are not supported"): + local("foo") + + with self.assertRaisesRegex(TypeError, + "Initialization arguments are not supported"): + local(kw="foo") + + + def test_local_opts_not_subclassed(self): + l = local() + l.attr = 1 + self.assertEqual(l.attr, 1) + + def test_cannot_set_delete_dict(self): + l = local() + with self.assertRaises(AttributeError): + l.__dict__ = 1 + + with self.assertRaises(AttributeError): + del l.__dict__ + + def test_delete_with_no_dict(self): + l = local() + with self.assertRaises(AttributeError): + delattr(l, 'thing') + + def del_local(): + with self.assertRaises(AttributeError): + delattr(l, 'thing') + + t = Thread(target=del_local) + t.start() + t.join() + + def test_slot_and_type_attributes(self): + a = A(Obj()) + a.initialized = 1 + self.assertEqual(a.initialized, 1) + + # The slot is shared + def demonstrate_slots_shared(): + self.assertEqual(a.initialized, 1) + a.initialized = 2 + + greenlet = Thread(target=demonstrate_slots_shared) + greenlet.start() + greenlet.join() + + self.assertEqual(a.initialized, 2) + + # The slot overrides dict values + a.__dict__['initialized'] = 42 # pylint:disable=unsupported-assignment-operation + self.assertEqual(a.initialized, 2) + + # Deleting the slot deletes the slot, but not the dict + del a.initialized + self.assertFalse(hasattr(a, 'initialized')) + self.assertIn('initialized', a.__dict__) + + # We can delete the 'path' ivar + # and fall back to the type + del a.path + self.assertEqual(a.path, '') + + with self.assertRaises(AttributeError): + del a.path + + # A read property calls get + self.assertEqual(a.read_property, 42) + a.read_property = 1 + self.assertEqual(a.read_property, 1) + self.assertIsInstance(A.read_property, ReadProperty) + + # Type attributes can be read + self.assertEqual(a.type_path, 'MyPath') + self.assertNotIn('type_path', a.__dict__) + + # and replaced in the dict + a.type_path = 'Local' + self.assertEqual(a.type_path, 'Local') + self.assertIn('type_path', a.__dict__) + + def test_attribute_error(self): + # pylint:disable=attribute-defined-outside-init + a = A(Obj()) + with self.assertRaises(AttributeError): + getattr(a, 'fizz_buzz') + + def set_fizz_buzz(): + a.fizz_buzz = 1 + + greenlet = Thread(target=set_fizz_buzz) + greenlet.start() + greenlet.join() + + with self.assertRaises(AttributeError): + getattr(a, 'fizz_buzz') + + def test_getattr_called(self): + getter = WithGetattr() + self.assertEqual(42, getter.foo) + getter.foo = 'baz' + self.assertEqual('baz', getter.foo) + + + def test_copy(self): + a = A(Obj()) + a.path = '123' + a.obj.echo = 'test' + b = copy(a) + + # Copy makes a shallow copy. Meaning that the attribute path + # has to be independent in the original and the copied object because the + # value is a string, but the attribute obj should be just reference to + # the instance of the class Obj + + self.assertEqual(a.path, b.path, 'The values in the two objects must be equal') + self.assertEqual(a.obj, b.obj, 'The values must be equal') + + b.path = '321' + self.assertNotEqual(a.path, b.path, 'The values in the two objects must be different') + + a.obj.echo = "works" + self.assertEqual(a.obj, b.obj, 'The values must be equal') + + def test_copy_no_subclass(self): + + a = local() + setattr(a, 'thing', 42) + b = copy(a) + self.assertEqual(b.thing, 42) + self.assertIsNot(a.__dict__, b.__dict__) + + def test_objects(self): + # Test which failed in the eventlet?! + + a = A({}) + a.path = '123' + b = A({'one': 2}) + b.path = '123' + self.assertEqual(a.path, b.path, 'The values in the two objects must be equal') + + b.path = '321' + + self.assertNotEqual(a.path, b.path, 'The values in the two objects must be different') + + def test_class_attr(self, kind=MyLocal): + mylocal = kind() + self.assertEqual(42, mylocal.CLASS_PROP) + + mylocal.CLASS_PROP = 1 + self.assertEqual(1, mylocal.CLASS_PROP) + self.assertEqual(mylocal.__dict__['CLASS_PROP'], 1) + + del mylocal.CLASS_PROP + self.assertEqual(42, mylocal.CLASS_PROP) + + self.assertIs(mylocal, mylocal.desc) + + def test_class_attr_subclass(self): + self.test_class_attr(kind=MyLocalSubclass) + + def test_locals_collected_when_greenlet_dead_but_still_referenced(self): + # https://github.com/gevent/gevent/issues/387 + import gevent + + my_local = MyLocal() + my_local.sentinel = None + greentest.gc_collect_if_needed() + + del created_sentinels[:] + del deleted_sentinels[:] + + def demonstrate_my_local(): + # Get the important parts + getattr(my_local, 'sentinel') + + # Create and reference greenlets + greenlets = [Thread(target=demonstrate_my_local) for _ in range(5)] + for t in greenlets: + t.start() + gevent.sleep() + + self.assertEqual(len(created_sentinels), len(greenlets)) + + for g in greenlets: + assert not g.is_alive() + gevent.sleep() # let the callbacks run + greentest.gc_collect_if_needed() + + # The sentinels should be gone too + self.assertEqual(len(deleted_sentinels), len(greenlets)) + + @greentest.skipOnLibuvOnPyPyOnWin("GC makes this non-deterministic, especially on Windows") + def test_locals_collected_when_unreferenced_even_in_running_greenlet(self): + # In fact only on Windows do we see GC being an issue; + # pypy2 5.0 on macos and travis don't have a problem. + # https://github.com/gevent/gevent/issues/981 + import gevent + import gc + gc.collect() + + count = 1000 + + running_greenlet = None + + def demonstrate_my_local(): + for _ in range(1000): + x = MyLocal() + self.assertIsNotNone(x.sentinel) + x = None + + gc.collect() + gc.collect() + + self.assertEqual(count, len(created_sentinels)) + # They're all dead, even though this greenlet is + # still running + self.assertEqual(count, len(deleted_sentinels)) + + # The links were removed as well. + self.assertFalse(running_greenlet.has_links()) + + + running_greenlet = gevent.spawn(demonstrate_my_local) + gevent.sleep() + running_greenlet.join() + + self.assertEqual(count, len(deleted_sentinels)) + + @greentest.ignores_leakcheck + def test_local_dicts_for_greenlet(self): + import gevent + from gevent.local import all_local_dicts_for_greenlet + + class MyGreenlet(gevent.Greenlet): + results = None + id_x = None + def _run(self): # pylint:disable=method-hidden + x = local() + x.foo = 42 + self.id_x = id(x) + self.results = all_local_dicts_for_greenlet(self) + + g = MyGreenlet() + g.start() + g.join() + self.assertTrue(g.successful, g) + self.assertEqual(g.results, + [((local, g.id_x), {'foo': 42})]) + + def test_local_with_abc(self): + # an ABC (or generally any non-exact-type) in the MRO doesn't + # break things. See https://github.com/gevent/gevent/issues/1201 + + x = LocalWithABC() + x.d = {'a': 1} + self.assertEqual({'a': 1}, x.d) + # The ABC part works + self.assertIn('a', x.d) + self.assertEqual(['a'], list(x.keys())) + + def test_local_with_staticmethod(self): + x = LocalWithStaticMethod() + self.assertEqual(42, x.a_staticmethod()) + + def test_local_with_classmethod(self): + x = LocalWithClassMethod() + self.assertIs(LocalWithClassMethod, x.a_classmethod()) + +try: + from zope import interface +except ImportError: + interface = None + +@greentest.skipIf(interface is None, "Needs zope.interface") +class TestLocalInterface(greentest.TestCase): + __timeout__ = None + + @greentest.ignores_leakcheck + def test_provides(self): + # https://github.com/gevent/gevent/issues/1122 + + # pylint:disable=inherit-non-class + class IFoo(interface.Interface): + pass + + @interface.implementer(IFoo) + class Base(object): + pass + + class Derived(Base, local): + pass + + d = Derived() + p = list(interface.providedBy(d)) + self.assertEqual([IFoo], p) + + + +@greentest.skipOnPurePython("Needs C extension") +class TestCExt(greentest.TestCase): # pragma: no cover + + def test_c_extension(self): + self.assertEqual(local.__module__, + 'gevent._local') + +@greentest.skipWithCExtensions("Needs pure-python") +class TestPure(greentest.TestCase): + + def test_extension(self): + self.assertEqual(local.__module__, + 'gevent.local') + + +if __name__ == '__main__': + greentest.main() diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__loop_callback.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__loop_callback.py new file mode 100644 index 00000000..39a2f138 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__loop_callback.py @@ -0,0 +1,13 @@ +from gevent.core import loop + +count = 0 + + +def incr(): + global count + count += 1 + +loop = loop() +loop.run_callback(incr) +loop.run() +assert count == 1, count diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__makefile_ref.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__makefile_ref.py new file mode 100644 index 00000000..36ac4e8d --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__makefile_ref.py @@ -0,0 +1,516 @@ +from __future__ import print_function +import os +from gevent import monkey; monkey.patch_all() +import socket +import ssl +import threading +import unittest +import errno +import weakref + + +import gevent.testing as greentest + + +dirname = os.path.dirname(os.path.abspath(__file__)) +certfile = os.path.join(dirname, '2_7_keycert.pem') +pid = os.getpid() + +PY3 = greentest.PY3 +PYPY = greentest.PYPY +CPYTHON = not PYPY +PY2 = not PY3 +fd_types = int +if PY3: + long = int +fd_types = (int, long) +WIN = greentest.WIN + +from gevent.testing import get_open_files +try: + import psutil +except ImportError: + psutil = None + + +class Test(greentest.TestCase): + + extra_allowed_open_states = () + + def tearDown(self): + self.extra_allowed_open_states = () + super(Test, self).tearDown() + + def assert_raises_EBADF(self, func): + try: + result = func() + except (socket.error, OSError) as ex: + # Windows/Py3 raises "OSError: [WinError 10038]" + if ex.args[0] == errno.EBADF: + return + if WIN and ex.args[0] == 10038: + return + raise + raise AssertionError('NOT RAISED EBADF: %r() returned %r' % (func, result)) + + def assert_fd_open(self, fileno): + assert isinstance(fileno, fd_types) + open_files = get_open_files() + if fileno not in open_files: + raise AssertionError('%r is not open:\n%s' % (fileno, open_files['data'])) + + def assert_fd_closed(self, fileno): + assert isinstance(fileno, fd_types), repr(fileno) + assert fileno > 0, fileno + open_files = get_open_files() + if fileno in open_files: + raise AssertionError('%r is not closed:\n%s' % (fileno, open_files['data'])) + + def _assert_sock_open(self, sock): + # requires the psutil output + open_files = get_open_files() + sockname = sock.getsockname() + for x in open_files['data']: + if getattr(x, 'laddr', None) == sockname: + assert x.status in (psutil.CONN_LISTEN, psutil.CONN_ESTABLISHED) + self.extra_allowed_open_states, x.status + return + raise AssertionError("%r is not open:\n%s" % (sock, open_files['data'])) + + def assert_open(self, sock, *rest): + if isinstance(sock, fd_types): + if not WIN: + self.assert_fd_open(sock) + else: + fileno = sock.fileno() + assert isinstance(fileno, fd_types), fileno + sockname = sock.getsockname() + assert isinstance(sockname, tuple), sockname + if not WIN: + self.assert_fd_open(fileno) + else: + self._assert_sock_open(sock) + if rest: + self.assert_open(rest[0], *rest[1:]) + + def assert_closed(self, sock, *rest): + if isinstance(sock, fd_types): + self.assert_fd_closed(sock) + else: + # Under Python3, the socket module returns -1 for a fileno + # of a closed socket; under Py2 it raises + if PY3: + self.assertEqual(sock.fileno(), -1) + else: + self.assert_raises_EBADF(sock.fileno) + self.assert_raises_EBADF(sock.getsockname) + self.assert_raises_EBADF(sock.accept) + if rest: + self.assert_closed(rest[0], *rest[1:]) + + def make_open_socket(self): + s = socket.socket() + s.bind(('127.0.0.1', 0)) + self._close_on_teardown(s) + if WIN or greentest.LINUX: + # Windows and linux (with psutil) doesn't show as open until + # we call listen (linux with lsof accepts either) + s.listen(1) + self.assert_open(s, s.fileno()) + return s + + if CPYTHON and PY2: + # Keeping raw sockets alive keeps SSL sockets + # from being closed too, at least on CPython2, so we + # need to use weakrefs. + + # In contrast, on PyPy, *only* having a weakref lets the + # original socket die and leak + + def _close_on_teardown(self, resource): + self.close_on_teardown.append(weakref.ref(resource)) + return resource + + def _tearDownCloseOnTearDown(self): + self.close_on_teardown = [r() for r in self.close_on_teardown if r() is not None] + super(Test, self)._tearDownCloseOnTearDown() + +# Sometimes its this one, sometimes it's test_ssl. No clue why or how. +@greentest.skipOnAppVeyor("This sometimes times out for no apparent reason.") +class TestSocket(Test): + + def test_simple_close(self): + s = self.make_open_socket() + fileno = s.fileno() + s.close() + self.assert_closed(s, fileno) + + def test_makefile1(self): + s = self.make_open_socket() + fileno = s.fileno() + f = s.makefile() + self.assert_open(s, fileno) + s.close() + # Under python 2, this closes socket wrapper object but not the file descriptor; + # under python 3, both stay open + if PY3: + self.assert_open(s, fileno) + else: + self.assert_closed(s) + self.assert_open(fileno) + f.close() + self.assert_closed(s) + self.assert_closed(fileno) + + def test_makefile2(self): + s = self.make_open_socket() + fileno = s.fileno() + self.assert_open(s, fileno) + f = s.makefile() + self.assert_open(s) + self.assert_open(s, fileno) + f.close() + # closing fileobject does not close the socket + self.assert_open(s, fileno) + s.close() + self.assert_closed(s, fileno) + + def test_server_simple(self): + listener = socket.socket() + listener.bind(('127.0.0.1', 0)) + port = listener.getsockname()[1] + listener.listen(1) + + connector = socket.socket() + self._close_on_teardown(connector) + + def connect(): + connector.connect(('127.0.0.1', port)) + + t = threading.Thread(target=connect) + t.start() + + try: + client_socket, _addr = listener.accept() + fileno = client_socket.fileno() + self.assert_open(client_socket, fileno) + client_socket.close() + self.assert_closed(client_socket) + finally: + t.join() + listener.close() + connector.close() + + def test_server_makefile1(self): + listener = socket.socket() + listener.bind(('127.0.0.1', 0)) + port = listener.getsockname()[1] + listener.listen(1) + + connector = socket.socket() + self._close_on_teardown(connector) + + def connect(): + connector.connect(('127.0.0.1', port)) + + t = threading.Thread(target=connect) + t.start() + + try: + client_socket, _addr = listener.accept() + fileno = client_socket.fileno() + f = client_socket.makefile() + self.assert_open(client_socket, fileno) + client_socket.close() + # Under python 2, this closes socket wrapper object but not the file descriptor; + # under python 3, both stay open + if PY3: + self.assert_open(client_socket, fileno) + else: + self.assert_closed(client_socket) + self.assert_open(fileno) + f.close() + self.assert_closed(client_socket, fileno) + finally: + t.join() + listener.close() + connector.close() + + def test_server_makefile2(self): + listener = socket.socket() + listener.bind(('127.0.0.1', 0)) + port = listener.getsockname()[1] + listener.listen(1) + + connector = socket.socket() + self._close_on_teardown(connector) + + def connect(): + connector.connect(('127.0.0.1', port)) + + t = threading.Thread(target=connect) + t.start() + + try: + client_socket, _addr = listener.accept() + fileno = client_socket.fileno() + f = client_socket.makefile() + self.assert_open(client_socket, fileno) + # closing fileobject does not close the socket + f.close() + self.assert_open(client_socket, fileno) + client_socket.close() + self.assert_closed(client_socket, fileno) + finally: + t.join() + listener.close() + connector.close() + + +@greentest.skipOnAppVeyor("This sometimes times out for no apparent reason.") +class TestSSL(Test): + + def _ssl_connect_task(self, connector, port): + connector.connect(('127.0.0.1', port)) + try: + # Note: We get ResourceWarning about 'x' + # on Python 3 if we don't join the spawned thread + x = ssl.wrap_socket(connector) + except socket.error: + # Observed on Windows with PyPy2 5.9.0 and libuv: + # if we don't switch in a timely enough fashion, + # the server side runs ahead of us and closes + # our socket first, so this fails. + pass + else: + #self._close_on_teardown(x) + x.close() + + def _make_ssl_connect_task(self, connector, port): + t = threading.Thread(target=self._ssl_connect_task, args=(connector, port)) + t.daemon = True + return t + + def __cleanup(self, task, *sockets): + # workaround for test_server_makefile1, test_server_makefile2, + # test_server_simple, test_serverssl_makefile1. + + # On PyPy on Linux, it is important to join the SSL Connect + # Task FIRST, before closing the sockets. If we do it after + # (which makes more sense) we hang. It's not clear why, except + # that it has something to do with context switches. Inserting a call to + # gevent.sleep(0.1) instead of joining the task has the same + # effect. If the previous tests hang, then later tests can fail with + # SSLError: unknown alert type. + + # XXX: Why do those two things happen? + + # On PyPy on macOS, we don't have that problem and can use the + # more logical order. + + task.join() + for s in sockets: + s.close() + + del sockets + del task + + def test_simple_close(self): + s = self.make_open_socket() + fileno = s.fileno() + s = ssl.wrap_socket(s) + self._close_on_teardown(s) + fileno = s.fileno() + self.assert_open(s, fileno) + s.close() + self.assert_closed(s, fileno) + + def test_makefile1(self): + raw_s = self.make_open_socket() + s = ssl.wrap_socket(raw_s) + + self._close_on_teardown(s) + fileno = s.fileno() + self.assert_open(s, fileno) + f = s.makefile() + self.assert_open(s, fileno) + s.close() + self.assert_open(s, fileno) + f.close() + raw_s.close() + self.assert_closed(s, fileno) + + + def test_makefile2(self): + s = self.make_open_socket() + fileno = s.fileno() + + s = ssl.wrap_socket(s) + self._close_on_teardown(s) + fileno = s.fileno() + self.assert_open(s, fileno) + f = s.makefile() + self.assert_open(s, fileno) + f.close() + # closing fileobject does not close the socket + self.assert_open(s, fileno) + s.close() + self.assert_closed(s, fileno) + + def test_server_simple(self): + listener = socket.socket() + listener.bind(('127.0.0.1', 0)) + port = listener.getsockname()[1] + listener.listen(1) + + connector = socket.socket() + self._close_on_teardown(connector) + + t = self._make_ssl_connect_task(connector, port) + t.start() + + try: + client_socket, _addr = listener.accept() + self._close_on_teardown(client_socket.close) + client_socket = ssl.wrap_socket(client_socket, keyfile=certfile, certfile=certfile, server_side=True) + self._close_on_teardown(client_socket) + fileno = client_socket.fileno() + self.assert_open(client_socket, fileno) + client_socket.close() + self.assert_closed(client_socket, fileno) + finally: + self.__cleanup(t, listener, connector) + + def test_server_makefile1(self): + listener = socket.socket() + self._close_on_teardown(listener) + listener.bind(('127.0.0.1', 0)) + port = listener.getsockname()[1] + listener.listen(1) + + + connector = socket.socket() + self._close_on_teardown(connector) + + t = self._make_ssl_connect_task(connector, port) + t.start() + + try: + client_socket, _addr = listener.accept() + self._close_on_teardown(client_socket.close) # hard ref + client_socket = ssl.wrap_socket(client_socket, keyfile=certfile, certfile=certfile, server_side=True) + self._close_on_teardown(client_socket) + fileno = client_socket.fileno() + self.assert_open(client_socket, fileno) + f = client_socket.makefile() + self.assert_open(client_socket, fileno) + client_socket.close() + self.assert_open(client_socket, fileno) + f.close() + self.assert_closed(client_socket, fileno) + finally: + self.__cleanup(t, listener, connector) + + + def test_server_makefile2(self): + listener = socket.socket() + listener.bind(('127.0.0.1', 0)) + port = listener.getsockname()[1] + listener.listen(1) + + connector = socket.socket() + self._close_on_teardown(connector) + + t = self._make_ssl_connect_task(connector, port) + t.start() + + try: + client_socket, _addr = listener.accept() + self._close_on_teardown(client_socket) + client_socket = ssl.wrap_socket(client_socket, keyfile=certfile, certfile=certfile, server_side=True) + self._close_on_teardown(client_socket) + fileno = client_socket.fileno() + self.assert_open(client_socket, fileno) + f = client_socket.makefile() + self.assert_open(client_socket, fileno) + # Closing fileobject does not close SSLObject + f.close() + self.assert_open(client_socket, fileno) + client_socket.close() + self.assert_closed(client_socket, fileno) + finally: + self.__cleanup(t, connector, listener, client_socket) + + def test_serverssl_makefile1(self): + listener = socket.socket() + fileno = listener.fileno() + listener.bind(('127.0.0.1', 0)) + port = listener.getsockname()[1] + listener.listen(1) + self._close_on_teardown(listener) + listener = ssl.wrap_socket(listener, keyfile=certfile, certfile=certfile) + + connector = socket.socket() + self._close_on_teardown(connector) + + t = self._make_ssl_connect_task(connector, port) + t.start() + + try: + client_socket, _addr = listener.accept() + fileno = client_socket.fileno() + self.assert_open(client_socket, fileno) + f = client_socket.makefile() + self.assert_open(client_socket, fileno) + client_socket.close() + self.assert_open(client_socket, fileno) + f.close() + self.assert_closed(client_socket, fileno) + finally: + self.__cleanup(t, listener, connector) + + @greentest.skipIf(greentest.RUNNING_ON_TRAVIS and greentest.PY37 and greentest.LIBUV, + "Often segfaults, cannot reproduce locally. " + "Not too worried about this before Python 3.7rc1. " + "https://travis-ci.org/gevent/gevent/jobs/327357684") + def test_serverssl_makefile2(self): + listener = socket.socket() + self._close_on_teardown(listener) + listener.bind(('127.0.0.1', 0)) + port = listener.getsockname()[1] + listener.listen(1) + listener = ssl.wrap_socket(listener, keyfile=certfile, certfile=certfile) + + connector = socket.socket() + + def connect(): + connector.connect(('127.0.0.1', port)) + s = ssl.wrap_socket(connector) + s.sendall(b'test_serverssl_makefile2') + s.close() + connector.close() + + t = threading.Thread(target=connect) + t.daemon = True + t.start() + + try: + client_socket, _addr = listener.accept() + fileno = client_socket.fileno() + self.assert_open(client_socket, fileno) + f = client_socket.makefile() + self.assert_open(client_socket, fileno) + self.assertEqual(f.read(), 'test_serverssl_makefile2') + self.assertEqual(f.read(), '') + f.close() + if WIN and psutil: + # Hmm? + self.extra_allowed_open_states = (psutil.CONN_CLOSE_WAIT,) + self.assert_open(client_socket, fileno) + client_socket.close() + self.assert_closed(client_socket, fileno) + finally: + self.__cleanup(t, listener) + + +if __name__ == '__main__': + unittest.main() diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__memleak.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__memleak.py new file mode 100644 index 00000000..7a191a48 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__memleak.py @@ -0,0 +1,56 @@ +import sys +import unittest + +from gevent.testing import TestCase, main +import gevent +from gevent.timeout import Timeout + +@unittest.skipUnless( + hasattr(sys, 'gettotalrefcount'), + "Needs debug build" +) +class TestQueue(TestCase): # pragma: no cover + # pylint:disable=bare-except,no-member + + def test(self): + result = '' + try: + Timeout.start_new(0.01) + gevent.sleep(1) + raise AssertionError('must raise Timeout') + except KeyboardInterrupt: + raise + except: + pass + + result += '%s ' % sys.gettotalrefcount() + + try: + Timeout.start_new(0.01) + gevent.sleep(1) + raise AssertionError('must raise Timeout') + except KeyboardInterrupt: + raise + except: + pass + + result += '%s ' % sys.gettotalrefcount() + + try: + Timeout.start_new(0.01) + gevent.sleep(1) + raise AssertionError('must raise Timeout') + except KeyboardInterrupt: + raise + except: + pass + + result += '%s' % sys.gettotalrefcount() + + _, b, c = result.split() + assert b == c, 'total refcount mismatch: %s' % result + + + +if __name__ == '__main__': + main() diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__monkey.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__monkey.py new file mode 100644 index 00000000..9c33d7f7 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__monkey.py @@ -0,0 +1,151 @@ +from subprocess import Popen + +from gevent import monkey +monkey.patch_all() + +import sys +import unittest +from gevent.testing.testcase import SubscriberCleanupMixin + +class TestMonkey(SubscriberCleanupMixin, unittest.TestCase): + + maxDiff = None + + def test_time(self): + import time + from gevent import time as gtime + self.assertIs(time.sleep, gtime.sleep) + + def test_thread(self): + try: + import thread + except ImportError: + import _thread as thread + import threading + + from gevent import thread as gthread + self.assertIs(thread.start_new_thread, gthread.start_new_thread) + self.assertIs(threading._start_new_thread, gthread.start_new_thread) + + # Event patched by default + self.assertTrue(monkey.is_object_patched('threading', 'Event')) + + if sys.version_info[0] == 2: + from gevent import threading as gthreading + from gevent.event import Event as GEvent + self.assertIs(threading._sleep, gthreading._sleep) + self.assertTrue(monkey.is_object_patched('threading', '_Event')) + self.assertIs(threading._Event, GEvent) + + def test_socket(self): + import socket + from gevent import socket as gevent_socket + self.assertIs(socket.create_connection, gevent_socket.create_connection) + + def test_os(self): + import os + import types + from gevent import os as gos + for name in ('fork', 'forkpty'): + if hasattr(os, name): + attr = getattr(os, name) + self.assertNotIn('built-in', repr(attr)) + self.assertNotIsInstance(attr, types.BuiltinFunctionType) + self.assertIsInstance(attr, types.FunctionType) + self.assertIs(attr, getattr(gos, name)) + + def test_saved(self): + self.assertTrue(monkey.saved) + for modname in monkey.saved: + self.assertTrue(monkey.is_module_patched(modname)) + + for objname in monkey.saved[modname]: + self.assertTrue(monkey.is_object_patched(modname, objname)) + + def test_patch_subprocess_twice(self): + self.assertNotIn('gevent', repr(Popen)) + self.assertIs(Popen, monkey.get_original('subprocess', 'Popen')) + monkey.patch_subprocess() + self.assertIs(Popen, monkey.get_original('subprocess', 'Popen')) + + def test_patch_twice_warnings_events(self): + import warnings + from zope.interface import verify + + orig_saved = {} + for k, v in monkey.saved.items(): + orig_saved[k] = v.copy() + + from gevent import events + all_events = [] + events.subscribers.append(all_events.append) + + def veto(event): + if isinstance(event, events.GeventWillPatchModuleEvent) and event.module_name == 'ssl': + raise events.DoNotPatch + + events.subscribers.append(veto) + + with warnings.catch_warnings(record=True) as issued_warnings: + # Patch again, triggering three warnings, one for os=False/signal=True, + # one for repeated monkey-patching, one for patching after ssl (on python >= 2.7.9) + monkey.patch_all(os=False, extra_kwarg=42) + self.assertGreaterEqual(len(issued_warnings), 2) + self.assertIn('SIGCHLD', str(issued_warnings[-1].message)) + self.assertIn('more than once', str(issued_warnings[0].message)) + + # Patching with the exact same argument doesn't issue a second warning. + # in fact, it doesn't do anything + del issued_warnings[:] + monkey.patch_all(os=False) + orig_saved['_gevent_saved_patch_all'] = monkey.saved['_gevent_saved_patch_all'] + + self.assertFalse(issued_warnings) + + # Make sure that re-patching did not change the monkey.saved + # attribute, overwriting the original functions. + if 'logging' in monkey.saved and 'logging' not in orig_saved: + # some part of the warning or unittest machinery imports logging + orig_saved['logging'] = monkey.saved['logging'] + self.assertEqual(orig_saved, monkey.saved) + + # Make sure some problematic attributes stayed correct. + # NOTE: This was only a problem if threading was not previously imported. + for k, v in monkey.saved['threading'].items(): + self.assertNotIn('gevent', str(v)) + + self.assertIsInstance(all_events[0], events.GeventWillPatchAllEvent) + self.assertEqual({'extra_kwarg': 42}, all_events[0].patch_all_kwargs) + verify.verifyObject(events.IGeventWillPatchAllEvent, all_events[0]) + + self.assertIsInstance(all_events[1], events.GeventWillPatchModuleEvent) + verify.verifyObject(events.IGeventWillPatchModuleEvent, all_events[1]) + + self.assertIsInstance(all_events[2], events.GeventDidPatchModuleEvent) + verify.verifyObject(events.IGeventWillPatchModuleEvent, all_events[1]) + + self.assertIsInstance(all_events[-2], events.GeventDidPatchBuiltinModulesEvent) + verify.verifyObject(events.IGeventDidPatchBuiltinModulesEvent, all_events[-2]) + + self.assertIsInstance(all_events[-1], events.GeventDidPatchAllEvent) + verify.verifyObject(events.IGeventDidPatchAllEvent, all_events[-1]) + + for e in all_events: + self.assertFalse(isinstance(e, events.GeventDidPatchModuleEvent) + and e.module_name == 'ssl') + + def test_patch_queue(self): + try: + import queue + except ImportError: + # Python 2 called this Queue. Note that having + # python-future installed gives us a queue module on + # Python 2 as well. + queue = None + if not hasattr(queue, 'SimpleQueue'): + raise unittest.SkipTest("Needs SimpleQueue") + # pylint:disable=no-member + self.assertIs(queue.SimpleQueue, queue._PySimpleQueue) + +if __name__ == '__main__': + unittest.main() diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__monkey_builtins_future.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__monkey_builtins_future.py new file mode 100644 index 00000000..599253dc --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__monkey_builtins_future.py @@ -0,0 +1,16 @@ +# Under Python 2, if the `future` module is installed, we get +# a `builtins` module, which mimics the `builtins` module from +# Python 3, but does not have the __import__ and some other functions. +# Make sure we can still run in that case. +import sys +try: + # fake out a "broken" builtins module + import builtins +except ImportError: + class builtins(object): + pass + sys.modules['builtins'] = builtins() + +if not hasattr(builtins, '__import__'): + import gevent.monkey + gevent.monkey.patch_builtins() diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__monkey_hub_in_thread.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__monkey_hub_in_thread.py new file mode 100644 index 00000000..981ca6cd --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__monkey_hub_in_thread.py @@ -0,0 +1,28 @@ +from gevent.monkey import patch_all +patch_all(thread=False) +from threading import Thread +import time + +# The first time we init the hub is in the native +# thread with time.sleep(), needing multiple +# threads at the same time. Note: this is very timing +# dependent. +# See #687 + + +def func(): + time.sleep() + + +def main(): + threads = [] + for _ in range(3): + th = Thread(target=func) + th.start() + threads.append(th) + for th in threads: + th.join() + + +if __name__ == '__main__': + main() diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__monkey_logging.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__monkey_logging.py new file mode 100644 index 00000000..9244ec64 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__monkey_logging.py @@ -0,0 +1,41 @@ +# If the logging module is imported *before* monkey patching, +# the existing handlers are correctly monkey patched to use gevent locks +import logging +logging.basicConfig() + +import threading +import sys +PY2 = sys.version_info[0] == 2 + + +def _inner_lock(lock): + # The inner attribute changed between 2 and 3 + attr = getattr(lock, '_block' if not PY2 else '_RLock__block', None) + return attr + + +def checkLocks(kind, ignore_none=True): + handlers = logging._handlerList + assert handlers + + for weakref in handlers: + # In py26, these are actual handlers, not weakrefs + handler = weakref() if callable(weakref) else weakref + attr = _inner_lock(handler.lock) + if attr is None and ignore_none: + continue + assert isinstance(attr, kind), (handler.lock, attr, kind) + + attr = _inner_lock(logging._lock) + if attr is None and ignore_none: + return + assert isinstance(attr, kind) + +checkLocks(type(threading._allocate_lock())) + +import gevent.monkey +gevent.monkey.patch_all() + +import gevent.lock + +checkLocks(type(gevent.thread.allocate_lock()), ignore_none=False) diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__monkey_multiple_imports.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__monkey_multiple_imports.py new file mode 100644 index 00000000..576062e3 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__monkey_multiple_imports.py @@ -0,0 +1,6 @@ +# https://github.com/gevent/gevent/issues/615 +# Under Python 3, with its use of importlib, +# if the monkey patch is done when the importlib import lock is held +# (e.g., during recursive imports) we could fail to release the lock. +# This is surprisingly common. +__import__('_import_import_patch') diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__monkey_queue.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__monkey_queue.py new file mode 100644 index 00000000..c07a2561 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__monkey_queue.py @@ -0,0 +1,331 @@ +# Some simple queue module tests, plus some failure conditions +# to ensure the Queue locks remain stable. +from gevent import monkey +monkey.patch_all() + +from gevent import queue as Queue +import threading +import time +import unittest + + +QUEUE_SIZE = 5 + +# A thread to run a function that unclogs a blocked Queue. +class _TriggerThread(threading.Thread): + def __init__(self, fn, args): + self.fn = fn + self.args = args + #self.startedEvent = threading.Event() + from gevent.event import Event + self.startedEvent = Event() + threading.Thread.__init__(self) + + def run(self): + # The sleep isn't necessary, but is intended to give the blocking + # function in the main thread a chance at actually blocking before + # we unclog it. But if the sleep is longer than the timeout-based + # tests wait in their blocking functions, those tests will fail. + # So we give them much longer timeout values compared to the + # sleep here (I aimed at 10 seconds for blocking functions -- + # they should never actually wait that long - they should make + # progress as soon as we call self.fn()). + time.sleep(0.01) + self.startedEvent.set() + self.fn(*self.args) + + +# Execute a function that blocks, and in a separate thread, a function that +# triggers the release. Returns the result of the blocking function. Caution: +# block_func must guarantee to block until trigger_func is called, and +# trigger_func must guarantee to change queue state so that block_func can make +# enough progress to return. In particular, a block_func that just raises an +# exception regardless of whether trigger_func is called will lead to +# timing-dependent sporadic failures, and one of those went rarely seen but +# undiagnosed for years. Now block_func must be unexceptional. If block_func +# is supposed to raise an exception, call do_exceptional_blocking_test() +# instead. + +class BlockingTestMixin(object): + + def do_blocking_test(self, block_func, block_args, trigger_func, trigger_args): + self.t = _TriggerThread(trigger_func, trigger_args) + self.t.start() + self.result = block_func(*block_args) + # If block_func returned before our thread made the call, we failed! + if not self.t.startedEvent.isSet(): + self.fail("blocking function '%r' appeared not to block" % + block_func) + self.t.join(10) # make sure the thread terminates + if self.t.isAlive(): + self.fail("trigger function '%r' appeared to not return" % + trigger_func) + return self.result + + # Call this instead if block_func is supposed to raise an exception. + def do_exceptional_blocking_test(self, block_func, block_args, trigger_func, + trigger_args, expected_exception_class): + self.t = _TriggerThread(trigger_func, trigger_args) + self.t.start() + try: + with self.assertRaises(expected_exception_class): + block_func(*block_args) + finally: + self.t.join(10) # make sure the thread terminates + if self.t.isAlive(): + self.fail("trigger function '%r' appeared to not return" % + trigger_func) + if not self.t.startedEvent.isSet(): + self.fail("trigger thread ended but event never set") + + +class BaseQueueTest(unittest.TestCase, BlockingTestMixin): + type2test = Queue.Queue + + def setUp(self): + self.cum = 0 + self.cumlock = threading.Lock() + + def simple_queue_test(self, q): + if not q.empty(): + raise RuntimeError("Call this function with an empty queue") + # I guess we better check things actually queue correctly a little :) + q.put(111) + q.put(333) + q.put(222) + q.put(444) + target_first_items = dict( + Queue=111, + LifoQueue=444, + PriorityQueue=111) + actual_first_item = (q.peek(), q.get()) + self.assertEqual(actual_first_item, + (target_first_items[q.__class__.__name__], + target_first_items[q.__class__.__name__]), + "q.peek() and q.get() are not equal!") + target_order = dict(Queue=[333, 222, 444], + LifoQueue=[222, 333, 111], + PriorityQueue=[222, 333, 444]) + actual_order = [q.get(), q.get(), q.get()] + self.assertEqual(actual_order, target_order[q.__class__.__name__], + "Didn't seem to queue the correct data!") + for i in range(QUEUE_SIZE-1): + q.put(i) + self.assertFalse(q.empty(), "Queue should not be empty") + self.assertFalse(q.full(), "Queue should not be full") + q.put(999) + self.assertTrue(q.full(), "Queue should be full") + try: + q.put(888, block=0) + self.fail("Didn't appear to block with a full queue") + except Queue.Full: + pass + try: + q.put(888, timeout=0.01) + self.fail("Didn't appear to time-out with a full queue") + except Queue.Full: + pass + self.assertEqual(q.qsize(), QUEUE_SIZE) + # Test a blocking put + self.do_blocking_test(q.put, (888,), q.get, ()) + self.do_blocking_test(q.put, (888, True, 10), q.get, ()) + # Empty it + for i in range(QUEUE_SIZE): + q.get() + self.assertTrue(q.empty(), "Queue should be empty") + try: + q.get(block=0) + self.fail("Didn't appear to block with an empty queue") + except Queue.Empty: + pass + try: + q.get(timeout=0.01) + self.fail("Didn't appear to time-out with an empty queue") + except Queue.Empty: + pass + # Test a blocking get + self.do_blocking_test(q.get, (), q.put, ('empty',)) + self.do_blocking_test(q.get, (True, 10), q.put, ('empty',)) + + def worker(self, q): + while True: + x = q.get() + if x is None: + q.task_done() + return + #with self.cumlock: + self.cum += x + q.task_done() + + def queue_join_test(self, q): + self.cum = 0 + for i in (0, 1): + threading.Thread(target=self.worker, args=(q,)).start() + for i in range(100): + q.put(i) + q.join() + self.assertEqual(self.cum, sum(range(100)), + "q.join() did not block until all tasks were done") + for i in (0, 1): + q.put(None) # instruct the threads to close + q.join() # verify that you can join twice + + def test_queue_task_done(self): + # Test to make sure a queue task completed successfully. + q = Queue.JoinableQueue() # self.type2test() + # XXX the same test in subclasses + try: + q.task_done() + except ValueError: + pass + else: + self.fail("Did not detect task count going negative") + + def test_queue_join(self): + # Test that a queue join()s successfully, and before anything else + # (done twice for insurance). + q = Queue.JoinableQueue() # self.type2test() + # XXX the same test in subclass + self.queue_join_test(q) + self.queue_join_test(q) + try: + q.task_done() + except ValueError: + pass + else: + self.fail("Did not detect task count going negative") + + def test_queue_task_done_with_items(self): + # Passing items to the constructor allows for as + # many task_done calls. Joining before all the task done + # are called returns false + # XXX the same test in subclass + l = [1, 2, 3] + q = Queue.JoinableQueue(items=l) + for i in l: + self.assertFalse(q.join(timeout=0.001)) + self.assertEqual(i, q.get()) + q.task_done() + + try: + q.task_done() + except ValueError: + pass + else: + self.fail("Did not detect task count going negative") + self.assertTrue(q.join(timeout=0.001)) + + def test_simple_queue(self): + # Do it a couple of times on the same queue. + # Done twice to make sure works with same instance reused. + q = self.type2test(QUEUE_SIZE) + self.simple_queue_test(q) + self.simple_queue_test(q) + +class LifoQueueTest(BaseQueueTest): + type2test = Queue.LifoQueue + +class PriorityQueueTest(BaseQueueTest): + type2test = Queue.PriorityQueue + + def test__init(self): + item1 = (2, 'b') + item2 = (1, 'a') + q = self.type2test(items=[item1, item2]) + self.assertTupleEqual(item2, q.get_nowait()) + self.assertTupleEqual(item1, q.get_nowait()) + + +# A Queue subclass that can provoke failure at a moment's notice :) +class FailingQueueException(Exception): + pass + +class FailingQueue(Queue.Queue): + def __init__(self, *args): + self.fail_next_put = False + self.fail_next_get = False + Queue.Queue.__init__(self, *args) + def _put(self, item): + if self.fail_next_put: + self.fail_next_put = False + raise FailingQueueException("You Lose") + return Queue.Queue._put(self, item) + def _get(self): + if self.fail_next_get: + self.fail_next_get = False + raise FailingQueueException("You Lose") + return Queue.Queue._get(self) + +class FailingQueueTest(unittest.TestCase, BlockingTestMixin): + + def failing_queue_test(self, q): + if not q.empty(): + raise RuntimeError("Call this function with an empty queue") + for i in range(QUEUE_SIZE-1): + q.put(i) + # Test a failing non-blocking put. + q.fail_next_put = True + with self.assertRaises(FailingQueueException): + q.put("oops", block=0) + + q.fail_next_put = True + with self.assertRaises(FailingQueueException): + q.put("oops", timeout=0.1) + q.put(999) + self.assertTrue(q.full(), "Queue should be full") + # Test a failing blocking put + q.fail_next_put = True + with self.assertRaises(FailingQueueException): + self.do_blocking_test(q.put, (888,), q.get, ()) + + # Check the Queue isn't damaged. + # put failed, but get succeeded - re-add + q.put(999) + # Test a failing timeout put + q.fail_next_put = True + self.do_exceptional_blocking_test(q.put, (888, True, 10), q.get, (), + FailingQueueException) + # Check the Queue isn't damaged. + # put failed, but get succeeded - re-add + q.put(999) + self.assertTrue(q.full(), "Queue should be full") + q.get() + self.assertFalse(q.full(), "Queue should not be full") + q.put(999) + self.assertTrue(q.full(), "Queue should be full") + # Test a blocking put + self.do_blocking_test(q.put, (888,), q.get, ()) + # Empty it + for i in range(QUEUE_SIZE): + q.get() + self.assertTrue(q.empty(), "Queue should be empty") + q.put("first") + q.fail_next_get = True + with self.assertRaises(FailingQueueException): + q.get() + + self.assertFalse(q.empty(), "Queue should not be empty") + q.fail_next_get = True + with self.assertRaises(FailingQueueException): + q.get(timeout=0.1) + self.assertFalse(q.empty(), "Queue should not be empty") + q.get() + self.assertTrue(q.empty(), "Queue should be empty") + q.fail_next_get = True + self.do_exceptional_blocking_test(q.get, (), q.put, ('empty',), + FailingQueueException) + # put succeeded, but get failed. + self.assertFalse(q.empty(), "Queue should not be empty") + q.get() + self.assertTrue(q.empty(), "Queue should be empty") + + def test_failing_queue(self): + # Test to make sure a queue is functioning correctly. + # Done twice to the same instance. + q = FailingQueue(QUEUE_SIZE) + self.failing_queue_test(q) + self.failing_queue_test(q) + + +if __name__ == "__main__": + unittest.main() diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__monkey_scope.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__monkey_scope.py new file mode 100644 index 00000000..1a3cc67d --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__monkey_scope.py @@ -0,0 +1,61 @@ +import os +import os.path +import sys + +import unittest + +from subprocess import Popen +from subprocess import PIPE + +class TestRun(unittest.TestCase): + maxDiff = None + + def setUp(self): + self.cwd = os.getcwd() + os.chdir(os.path.dirname(__file__)) + + def tearDown(self): + os.chdir(self.cwd) + + def _run(self, script): + env = os.environ.copy() + env['PYTHONWARNINGS'] = 'ignore' + args = [sys.executable, '-m', 'gevent.monkey', script, 'patched'] + p = Popen(args, stdout=PIPE, stderr=PIPE, env=env) + gout, gerr = p.communicate() + self.assertEqual(0, p.returncode, (gout, gerr)) + + args = [sys.executable, script, 'stdlib'] + p = Popen(args, stdout=PIPE, stderr=PIPE) + + pout, perr = p.communicate() + self.assertEqual(0, p.returncode, (pout, perr)) + + glines = gout.decode("utf-8").splitlines() + plines = pout.decode('utf-8').splitlines() + self.assertEqual(glines, plines) + self.assertEqual(gerr, perr) + + return glines, gerr + + def test_run_simple(self): + self._run(os.path.join('monkey_package', 'script.py')) + + def test_run_package(self): + # Run a __main__ inside a package. + lines, _ = self._run('monkey_package') + + self.assertTrue(lines[0].endswith('__main__.py'), lines[0]) + self.assertEqual(lines[1], '__main__') + + def test_issue_302(self): + lines, _ = self._run(os.path.join('monkey_package', 'issue302monkey.py')) + + self.assertEqual(lines[0], 'True') + lines[1] = lines[1].replace('\\', '/') # windows path + self.assertEqual(lines[1], 'monkey_package/issue302monkey.py') + self.assertEqual(lines[2], 'True', lines) + + +if __name__ == '__main__': + unittest.main() diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__monkey_selectors.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__monkey_selectors.py new file mode 100644 index 00000000..08babb2a --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__monkey_selectors.py @@ -0,0 +1,22 @@ + +import sys +import gevent.testing as greentest +try: + import selectors # Do this before the patch, just to force it +except ImportError: + pass +from gevent.monkey import patch_all +patch_all() + +if sys.platform != 'win32' and sys.version_info[:2] >= (3, 4): + + class TestSelectors(greentest.TestCase): + + def test_selectors_select_is_patched(self): + # https://github.com/gevent/gevent/issues/835 + _select = selectors.SelectSelector._select + self.assertTrue(hasattr(_select, '_gevent_monkey'), dir(_select)) + + +if __name__ == '__main__': + greentest.main() diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__monkey_sigchld.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__monkey_sigchld.py new file mode 100644 index 00000000..0385fd8b --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__monkey_sigchld.py @@ -0,0 +1,69 @@ +import errno +import os +import sys +#os.environ['GEVENT_NOWAITPID'] = 'True' + +import gevent +import gevent.monkey +gevent.monkey.patch_all() + +pid = None +awaiting_child = [] + + +def handle_sigchld(*_args): + # Make sure we can do a blocking operation + gevent.sleep() + # Signal completion + awaiting_child.pop() + # Raise an ignored error + raise TypeError("This should be ignored but printed") + +import signal +if hasattr(signal, 'SIGCHLD'): + assert signal.getsignal(signal.SIGCHLD) == signal.SIG_DFL + signal.signal(signal.SIGCHLD, handle_sigchld) + handler = signal.getsignal(signal.SIGCHLD) + assert signal.getsignal(signal.SIGCHLD) is handle_sigchld, handler + + if hasattr(os, 'forkpty'): + def forkpty(): + # For printing in errors + return os.forkpty()[0] + funcs = (os.fork, forkpty) + else: + funcs = (os.fork,) + + for func in funcs: + awaiting_child = [True] + pid = func() + if not pid: + # child + gevent.sleep(0.3) + sys.exit(0) + else: + timeout = gevent.Timeout(1) + try: + while awaiting_child: + gevent.sleep(0.01) + # We should now be able to waitpid() for an arbitrary child + wpid, status = os.waitpid(-1, os.WNOHANG) + if wpid != pid: + raise AssertionError("Failed to wait on a child pid forked with a function", + wpid, pid, func) + + # And a second call should raise ECHILD + try: + wpid, status = os.waitpid(-1, os.WNOHANG) + raise AssertionError("Should not be able to wait again") + except OSError as e: + assert e.errno == errno.ECHILD + except gevent.Timeout as t: + if timeout is not t: + raise + raise AssertionError("Failed to wait using", func) + finally: + timeout.close() + sys.exit(0) +else: + print("No SIGCHLD, not testing") diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__monkey_sigchld_2.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__monkey_sigchld_2.py new file mode 100644 index 00000000..e1cab8ce --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__monkey_sigchld_2.py @@ -0,0 +1,51 @@ +# Mimics what gunicorn workers do: monkey patch in the child process +# and try to reset signal handlers to SIG_DFL. +# NOTE: This breaks again when gevent.subprocess is used, or any child +# watcher. +import os +import sys + +import signal + + +def handle(*_args): + if not pid: + # We only do this is the child so our + # parent's waitpid can get the status. + # This is the opposite of gunicorn. + os.waitpid(-1, os.WNOHANG) +# The signal watcher must be installed *before* monkey patching +if hasattr(signal, 'SIGCHLD'): + # On Python 2, the signal handler breaks the platform + # module, because it uses os.popen. pkg_resources uses the platform + # module. + # Cache that info. + import platform + platform.uname() + signal.signal(signal.SIGCHLD, handle) + + pid = os.fork() + + if pid: # parent + try: + _, stat = os.waitpid(pid, 0) + except OSError: + # Interrupted system call + _, stat = os.waitpid(pid, 0) + assert stat == 0, stat + else: + # Under Python 2, os.popen() directly uses the popen call, and + # popen's file uses the pclose() system call to + # wait for the child. If it's already waited on, + # it raises the same exception. + # Python 3 uses the subprocess module directly which doesn't + # have this problem. + import gevent.monkey + gevent.monkey.patch_all() + signal.signal(signal.SIGCHLD, signal.SIG_DFL) + f = os.popen('true') + f.close() + + sys.exit(0) +else: + print("No SIGCHLD, not testing") diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__monkey_sigchld_3.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__monkey_sigchld_3.py new file mode 100644 index 00000000..100e6ebf --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__monkey_sigchld_3.py @@ -0,0 +1,52 @@ +# Mimics what gunicorn workers do *if* the arbiter is also monkey-patched: +# After forking from the master monkey-patched process, the child +# resets signal handlers to SIG_DFL. If we then fork and watch *again*, +# we shouldn't hang. (Note that we carefully handle this so as not to break +# os.popen) +from __future__ import print_function +# Patch in the parent process. +import gevent.monkey +gevent.monkey.patch_all() + +from gevent import get_hub + +import os +import sys + +import signal +import subprocess + +def _waitpid(p): + try: + _, stat = os.waitpid(p, 0) + except OSError: + # Interrupted system call + _, stat = os.waitpid(p, 0) + assert stat == 0, stat + +if hasattr(signal, 'SIGCHLD'): + # Do what subprocess does and make sure we have the watcher + # in the parent + get_hub().loop.install_sigchld() + + + pid = os.fork() + + if pid: # parent + _waitpid(pid) + else: + # Child resets. + signal.signal(signal.SIGCHLD, signal.SIG_DFL) + + # Go through subprocess because we expect it to automatically + # set up the waiting for us. + popen = subprocess.Popen([sys.executable, '-c', 'import sys'], + stdout=subprocess.PIPE, stderr=subprocess.PIPE) + popen.stderr.read() + popen.stdout.read() + popen.wait() # This hangs if it doesn't. + popen.stderr.close() + popen.stdout.close() + sys.exit(0) +else: + print("No SIGCHLD, not testing") diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__monkey_ssl_warning.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__monkey_ssl_warning.py new file mode 100644 index 00000000..1e946679 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__monkey_ssl_warning.py @@ -0,0 +1,34 @@ +import unittest +import warnings + +# This file should only have this one test in it +# because we have to be careful about our imports +# and because we need to be careful about our patching. + +class Test(unittest.TestCase): + + def test_with_pkg_resources(self): + # Issue 1108: Python 2, importing pkg_resources, + # as is done for namespace packages, imports ssl, + # leading to an unwanted SSL warning. + __import__('pkg_resources') + + from gevent import monkey + + self.assertFalse(monkey.saved) + + with warnings.catch_warnings(record=True) as issued_warnings: + warnings.simplefilter('always') + + monkey.patch_all() + monkey.patch_all() + + issued_warnings = [x for x in issued_warnings + if isinstance(x.message, monkey.MonkeyPatchWarning)] + + self.assertFalse(issued_warnings, [str(i) for i in issued_warnings]) + self.assertEqual(0, len(issued_warnings)) + + +if __name__ == '__main__': + unittest.main() diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__monkey_ssl_warning2.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__monkey_ssl_warning2.py new file mode 100644 index 00000000..c7c12399 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__monkey_ssl_warning2.py @@ -0,0 +1,44 @@ +import unittest +import warnings +import sys + +# All supported python versions now provide SSLContext. +# We import it by name and subclass it here by name. +# compare with warning3.py +from ssl import SSLContext + +class MySubclass(SSLContext): + pass + +# This file should only have this one test in it +# because we have to be careful about our imports +# and because we need to be careful about our patching. + +class Test(unittest.TestCase): + + @unittest.skipIf(sys.version_info[:2] < (3, 6), + "Only on Python 3.6+") + def test_ssl_subclass_and_module_reference(self): + + from gevent import monkey + + self.assertFalse(monkey.saved) + + with warnings.catch_warnings(record=True) as issued_warnings: + warnings.simplefilter('always') + + monkey.patch_all() + monkey.patch_all() + + issued_warnings = [x for x in issued_warnings + if isinstance(x.message, monkey.MonkeyPatchWarning)] + + self.assertEqual(1, len(issued_warnings)) + message = issued_warnings[0].message + self.assertIn("Modules that had direct imports", str(message)) + self.assertIn("Subclasses (NOT patched)", str(message)) + + + +if __name__ == '__main__': + unittest.main() diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__monkey_ssl_warning3.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__monkey_ssl_warning3.py new file mode 100644 index 00000000..76b2a794 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__monkey_ssl_warning3.py @@ -0,0 +1,47 @@ +import unittest +import warnings +import sys + +# All supported python versions now provide SSLContext. +# We subclass without importing by name. Compare with +# warning2.py +import ssl + +class MySubclass(ssl.SSLContext): + pass + +# This file should only have this one test in it +# because we have to be careful about our imports +# and because we need to be careful about our patching. + +class Test(unittest.TestCase): + + @unittest.skipIf(sys.version_info[:2] < (3, 6), + "Only on Python 3.6+") + def test_ssl_subclass_and_module_reference(self): + + from gevent import monkey + + self.assertFalse(monkey.saved) + + with warnings.catch_warnings(record=True) as issued_warnings: + warnings.simplefilter('always') + + monkey.patch_all() + monkey.patch_all() + + issued_warnings = [x for x in issued_warnings + if isinstance(x.message, monkey.MonkeyPatchWarning)] + + self.assertEqual(1, len(issued_warnings)) + message = str(issued_warnings[0].message) + + self.assertNotIn("Modules that had direct imports", message) + self.assertIn("Subclasses (NOT patched)", message) + # the gevent subclasses should not be in here. + self.assertNotIn('gevent.', message) + + + +if __name__ == '__main__': + unittest.main() diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__nondefaultloop.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__nondefaultloop.py new file mode 100644 index 00000000..489ff526 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__nondefaultloop.py @@ -0,0 +1,12 @@ +# test for issue #210 +from gevent import core +from gevent.testing.util import alarm + + +alarm(1) + +log = [] +loop = core.loop(default=False) +loop.run_callback(log.append, 1) +loop.run() +assert log == [1], log diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__order.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__order.py new file mode 100644 index 00000000..83aa1c9e --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__order.py @@ -0,0 +1,61 @@ +import gevent +import gevent.testing as greentest +from gevent.testing.six import xrange + + +class appender(object): + + def __init__(self, lst, item): + self.lst = lst + self.item = item + + def __call__(self, *args): + self.lst.append(self.item) + + +class Test(greentest.TestCase): + + count = 2 + + def test_greenlet_link(self): + lst = [] + + # test that links are executed in the same order as they were added + g = gevent.spawn(lst.append, 0) + + for i in xrange(1, self.count): + g.link(appender(lst, i)) + g.join() + self.assertEqual(lst, list(range(self.count))) + + +class Test3(Test): + count = 3 + + +class Test4(Test): + count = 4 + + +class TestM(Test): + count = 1000 + + +class TestSleep0(greentest.TestCase): + + def test(self): + lst = [] + gevent.spawn(sleep0, lst, '1') + gevent.spawn(sleep0, lst, '2') + gevent.wait() + self.assertEqual(' '.join(lst), '1A 2A 1B 2B') + + +def sleep0(lst, param): + lst.append(param + 'A') + gevent.sleep(0) + lst.append(param + 'B') + + +if __name__ == '__main__': + greentest.main() diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__os.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__os.py new file mode 100644 index 00000000..dacf2c4a --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__os.py @@ -0,0 +1,178 @@ +from __future__ import print_function, absolute_import, division + +import sys +from os import pipe + + +import gevent +from gevent import os +from gevent import Greenlet, joinall + +from gevent import testing as greentest +from gevent.testing import mock +from gevent.testing import six +from gevent.testing.skipping import skipOnLibuvOnPyPyOnWin + + +class TestOS_tp(greentest.TestCase): + + __timeout__ = greentest.LARGE_TIMEOUT + + def pipe(self): + return pipe() + + read = staticmethod(os.tp_read) + write = staticmethod(os.tp_write) + + @skipOnLibuvOnPyPyOnWin("Sometimes times out") + def _test_if_pipe_blocks(self, buffer_class): + r, w = self.pipe() + # set nbytes such that for sure it is > maximum pipe buffer + nbytes = 1000000 + block = b'x' * 4096 + buf = buffer_class(block) + # Lack of "nonlocal" keyword in Python 2.x: + bytesread = [0] + byteswritten = [0] + + def produce(): + while byteswritten[0] != nbytes: + bytesleft = nbytes - byteswritten[0] + byteswritten[0] += self.write(w, buf[:min(bytesleft, 4096)]) + + def consume(): + while bytesread[0] != nbytes: + bytesleft = nbytes - bytesread[0] + bytesread[0] += len(self.read(r, min(bytesleft, 4096))) + + producer = Greenlet(produce) + producer.start() + consumer = Greenlet(consume) + consumer.start_later(1) + # If patching was not succesful, the producer will have filled + # the pipe before the consumer starts, and would block the entire + # process. Therefore the next line would never finish. + joinall([producer, consumer]) + self.assertEqual(bytesread[0], nbytes) + self.assertEqual(bytesread[0], byteswritten[0]) + + if sys.version_info[0] < 3: + + def test_if_pipe_blocks_buffer(self): + self._test_if_pipe_blocks(six.builtins.buffer) + + if sys.version_info[:2] >= (2, 7): + + def test_if_pipe_blocks_memoryview(self): + self._test_if_pipe_blocks(six.builtins.memoryview) + + +@greentest.skipUnless(hasattr(os, 'make_nonblocking'), + "Only on POSIX") +class TestOS_nb(TestOS_tp): + + def read(self, fd, count): + return os.nb_read(fd, count) + + def write(self, fd, count): + return os.nb_write(fd, count) + + def pipe(self): + r, w = super(TestOS_nb, self).pipe() + os.make_nonblocking(r) + os.make_nonblocking(w) + return r, w + + def _make_ignored_oserror(self): + import errno + ignored_oserror = OSError() + ignored_oserror.errno = errno.EINTR + return ignored_oserror + + + def _check_hub_event_closed(self, mock_get_hub, fd, event): + mock_get_hub.assert_called_once_with() + hub = mock_get_hub.return_value + io = hub.loop.io + io.assert_called_once_with(fd, event) + + event = io.return_value + event.close.assert_called_once_with() + + def _test_event_closed_on_normal_io(self, nb_func, nb_arg, + mock_io, mock_get_hub, event): + mock_io.side_effect = [self._make_ignored_oserror(), 42] + + fd = 100 + result = nb_func(fd, nb_arg) + self.assertEqual(result, 42) + + self._check_hub_event_closed(mock_get_hub, fd, event) + + def _test_event_closed_on_io_error(self, nb_func, nb_arg, + mock_io, mock_get_hub, event): + mock_io.side_effect = [self._make_ignored_oserror(), ValueError()] + + fd = 100 + + with self.assertRaises(ValueError): + nb_func(fd, nb_arg) + + self._check_hub_event_closed(mock_get_hub, fd, event) + + @mock.patch('gevent.os.get_hub') + @mock.patch('gevent.os._write') + def test_event_closed_on_write(self, mock_write, mock_get_hub): + self._test_event_closed_on_normal_io(os.nb_write, b'buf', + mock_write, mock_get_hub, + 2) + + @mock.patch('gevent.os.get_hub') + @mock.patch('gevent.os._write') + def test_event_closed_on_write_error(self, mock_write, mock_get_hub): + self._test_event_closed_on_io_error(os.nb_write, b'buf', + mock_write, mock_get_hub, + 2) + + @mock.patch('gevent.os.get_hub') + @mock.patch('gevent.os._read') + def test_event_closed_on_read(self, mock_read, mock_get_hub): + self._test_event_closed_on_normal_io(os.nb_read, b'buf', + mock_read, mock_get_hub, + 1) + + @mock.patch('gevent.os.get_hub') + @mock.patch('gevent.os._read') + def test_event_closed_on_read_error(self, mock_read, mock_get_hub): + self._test_event_closed_on_io_error(os.nb_read, b'buf', + mock_read, mock_get_hub, + 1) + + +@greentest.skipUnless(hasattr(os, 'fork_and_watch'), + "Only on POSIX") +class TestForkAndWatch(greentest.TestCase): + + __timeout__ = greentest.LARGE_TIMEOUT + + def test_waitpid_all(self): + # Cover this specific case. + pid = os.fork_and_watch() + if pid: + os.waitpid(-1, 0) + # Can't assert on what the pid actually was, + # our testrunner may have spawned multiple children. + os._reap_children(0) # make the leakchecker happy + else: # pragma: no cover + gevent.sleep(2) + os._exit(0) + + def test_waitpid_wrong_neg(self): + self.assertRaises(OSError, os.waitpid, -2, 0) + + def test_waitpid_wrong_pos(self): + self.assertRaises(OSError, os.waitpid, 1, 0) + + +if __name__ == '__main__': + greentest.main() diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__pool.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__pool.py new file mode 100644 index 00000000..989ee9ca --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__pool.py @@ -0,0 +1,603 @@ +from time import time +import gevent +import gevent.pool +from gevent.event import Event +from gevent.queue import Queue + +import gevent.testing as greentest +import gevent.testing.timing +import random +from gevent.testing import ExpectedException + +import unittest + + +class TestCoroutinePool(unittest.TestCase): + klass = gevent.pool.Pool + + def test_apply_async(self): + done = Event() + + def some_work(_): + done.set() + + pool = self.klass(2) + pool.apply_async(some_work, ('x', )) + done.wait() + + def test_apply(self): + value = 'return value' + + def some_work(): + return value + + pool = self.klass(2) + result = pool.apply(some_work) + self.assertEqual(value, result) + + def test_apply_raises(self): + pool = self.klass(1) + + def raiser(): + raise ExpectedException() + try: + pool.apply(raiser) + except ExpectedException: + pass + else: + self.fail("Should have raised ExpectedException") + # Don't let the metaclass automatically force any error + # that reaches the hub from a spawned greenlet to become + # fatal; that defeats the point of the test. + test_apply_raises.error_fatal = False + + def test_multiple_coros(self): + evt = Event() + results = [] + + def producer(): + gevent.sleep(0.001) + results.append('prod') + evt.set() + + def consumer(): + results.append('cons1') + evt.wait() + results.append('cons2') + + pool = self.klass(2) + done = pool.spawn(consumer) + pool.apply_async(producer) + done.get() + self.assertEqual(['cons1', 'prod', 'cons2'], results) + + def dont_test_timer_cancel(self): + timer_fired = [] + + def fire_timer(): + timer_fired.append(True) + + def some_work(): + gevent.timer(0, fire_timer) # pylint:disable=no-member + + pool = self.klass(2) + pool.apply(some_work) + gevent.sleep(0) + self.assertEqual(timer_fired, []) + + def test_reentrant(self): + pool = self.klass(1) + result = pool.apply(pool.apply, (lambda a: a + 1, (5, ))) + self.assertEqual(result, 6) + evt = Event() + pool.apply_async(evt.set) + evt.wait() + + @greentest.skipOnPyPy("Does not work on PyPy") # Why? + def test_stderr_raising(self): + # testing that really egregious errors in the error handling code + # (that prints tracebacks to stderr) don't cause the pool to lose + # any members + import sys + pool = self.klass(size=1) + + # we're going to do this by causing the traceback.print_exc in + # safe_apply to raise an exception and thus exit _main_loop + normal_err = sys.stderr + try: + sys.stderr = FakeFile() + waiter = pool.spawn(crash) + with gevent.Timeout(2): + self.assertRaises(RuntimeError, waiter.get) + # the pool should have something free at this point since the + # waiter returned + # pool.Pool change: if an exception is raised during execution of a link, + # the rest of the links are scheduled to be executed on the next hub iteration + # this introduces a delay in updating pool.sem which makes pool.free_count() report 0 + # therefore, sleep: + gevent.sleep(0) + self.assertEqual(pool.free_count(), 1) + # shouldn't block when trying to get + with gevent.Timeout.start_new(0.1): + pool.apply(gevent.sleep, (0, )) + finally: + sys.stderr = normal_err + pool.join() + + +def crash(*_args, **_kw): + raise RuntimeError("Whoa") + + +class FakeFile(object): + + def write(self, *_args): + raise RuntimeError('Whaaa') + + +class PoolBasicTests(greentest.TestCase): + klass = gevent.pool.Pool + + def test_execute_async(self): + p = self.klass(size=2) + self.assertEqual(p.free_count(), 2) + r = [] + + first = p.spawn(r.append, 1) + self.assertEqual(p.free_count(), 1) + first.get() + self.assertEqual(r, [1]) + gevent.sleep(0) + self.assertEqual(p.free_count(), 2) + + #Once the pool is exhausted, calling an execute forces a yield. + + p.apply_async(r.append, (2, )) + self.assertEqual(1, p.free_count()) + self.assertEqual(r, [1]) + + p.apply_async(r.append, (3, )) + self.assertEqual(0, p.free_count()) + self.assertEqual(r, [1]) + + p.apply_async(r.append, (4, )) + self.assertEqual(r, [1]) + gevent.sleep(0.01) + self.assertEqual(sorted(r), [1, 2, 3, 4]) + + def test_discard(self): + p = self.klass(size=1) + first = p.spawn(gevent.sleep, 1000) + p.discard(first) + first.kill() + self.assertFalse(first) + self.assertEqual(len(p), 0) + self.assertEqual(p._semaphore.counter, 1) + + def test_add_method(self): + p = self.klass(size=1) + first = gevent.spawn(gevent.sleep, 1000) + try: + second = gevent.spawn(gevent.sleep, 1000) + try: + self.assertEqual(p.free_count(), 1) + self.assertEqual(len(p), 0) + p.add(first) + self.assertEqual(p.free_count(), 0) + self.assertEqual(len(p), 1) + + with self.assertRaises(gevent.Timeout): + with gevent.Timeout(0.1): + p.add(second) + + self.assertEqual(p.free_count(), 0) + self.assertEqual(len(p), 1) + finally: + second.kill() + finally: + first.kill() + + @greentest.ignores_leakcheck + def test_add_method_non_blocking(self): + p = self.klass(size=1) + first = gevent.spawn(gevent.sleep, 1000) + try: + second = gevent.spawn(gevent.sleep, 1000) + try: + p.add(first) + with self.assertRaises(gevent.pool.PoolFull): + p.add(second, blocking=False) + finally: + second.kill() + finally: + first.kill() + + @greentest.ignores_leakcheck + def test_add_method_timeout(self): + p = self.klass(size=1) + first = gevent.spawn(gevent.sleep, 1000) + try: + second = gevent.spawn(gevent.sleep, 1000) + try: + p.add(first) + with self.assertRaises(gevent.pool.PoolFull): + p.add(second, timeout=0.100) + finally: + second.kill() + finally: + first.kill() + + @greentest.ignores_leakcheck + def test_start_method_timeout(self): + p = self.klass(size=1) + first = gevent.spawn(gevent.sleep, 1000) + try: + second = gevent.Greenlet(gevent.sleep, 1000) + try: + p.add(first) + with self.assertRaises(gevent.pool.PoolFull): + p.start(second, timeout=0.100) + finally: + second.kill() + finally: + first.kill() + + def test_apply(self): + p = self.klass() + result = p.apply(lambda a: ('foo', a), (1, )) + self.assertEqual(result, ('foo', 1)) + + def test_init_error(self): + self.switch_expected = False + self.assertRaises(ValueError, self.klass, -1) + +# +# tests from standard library test/test_multiprocessing.py + + +class TimingWrapper(object): + + def __init__(self, func): + self.func = func + self.elapsed = None + + def __call__(self, *args, **kwds): + t = time() + try: + return self.func(*args, **kwds) + finally: + self.elapsed = time() - t + + +def sqr(x, wait=0.0): + gevent.sleep(wait) + return x * x + + +def squared(x): + return x * x + + +def sqr_random_sleep(x): + gevent.sleep(random.random() * 0.1) + return x * x + + +def final_sleep(): + for i in range(3): + yield i + gevent.sleep(0.2) + + +TIMEOUT1, TIMEOUT2, TIMEOUT3 = 0.082, 0.035, 0.14 + + +SMALL_RANGE = 10 +LARGE_RANGE = 1000 + +if (greentest.PYPY and greentest.WIN) or greentest.RUN_LEAKCHECKS or greentest.RUN_COVERAGE: + # See comments in test__threadpool.py. + LARGE_RANGE = 25 +elif greentest.RUNNING_ON_CI or greentest.EXPECT_POOR_TIMER_RESOLUTION: + LARGE_RANGE = 100 + +class TestPool(greentest.TestCase): # pylint:disable=too-many-public-methods + __timeout__ = greentest.LARGE_TIMEOUT + size = 1 + + def setUp(self): + greentest.TestCase.setUp(self) + self.pool = gevent.pool.Pool(self.size) + + def cleanup(self): + self.pool.join() + + def test_apply(self): + papply = self.pool.apply + self.assertEqual(papply(sqr, (5,)), 25) + self.assertEqual(papply(sqr, (), {'x': 3}), 9) + + def test_map(self): + pmap = self.pool.map + self.assertEqual(pmap(sqr, range(SMALL_RANGE)), list(map(squared, range(SMALL_RANGE)))) + self.assertEqual(pmap(sqr, range(100)), list(map(squared, range(100)))) + + def test_async(self): + res = self.pool.apply_async(sqr, (7, TIMEOUT1,)) + get = TimingWrapper(res.get) + self.assertEqual(get(), 49) + self.assertTimeoutAlmostEqual(get.elapsed, TIMEOUT1, 1) + + def test_async_callback(self): + result = [] + res = self.pool.apply_async(sqr, (7, TIMEOUT1,), callback=result.append) + get = TimingWrapper(res.get) + self.assertEqual(get(), 49) + self.assertTimeoutAlmostEqual(get.elapsed, TIMEOUT1, 1) + gevent.sleep(0) # lets the callback run + self.assertEqual(result, [49]) + + def test_async_timeout(self): + res = self.pool.apply_async(sqr, (6, TIMEOUT2 + 0.2)) + get = TimingWrapper(res.get) + self.assertRaises(gevent.Timeout, get, timeout=TIMEOUT2) + self.assertTimeoutAlmostEqual(get.elapsed, TIMEOUT2, 1) + self.pool.join() + + def test_imap_list_small(self): + it = self.pool.imap(sqr, range(SMALL_RANGE)) + self.assertEqual(list(it), list(map(sqr, range(SMALL_RANGE)))) + + def test_imap_it_small(self): + it = self.pool.imap(sqr, range(SMALL_RANGE)) + for i in range(SMALL_RANGE): + self.assertEqual(next(it), i * i) + self.assertRaises(StopIteration, next, it) + + def test_imap_it_large(self): + it = self.pool.imap(sqr, range(LARGE_RANGE)) + for i in range(LARGE_RANGE): + self.assertEqual(next(it), i * i) + self.assertRaises(StopIteration, next, it) + + def test_imap_random(self): + it = self.pool.imap(sqr_random_sleep, range(SMALL_RANGE)) + self.assertEqual(list(it), list(map(squared, range(SMALL_RANGE)))) + + def test_imap_unordered(self): + it = self.pool.imap_unordered(sqr, range(LARGE_RANGE)) + self.assertEqual(sorted(it), list(map(squared, range(LARGE_RANGE)))) + + it = self.pool.imap_unordered(sqr, range(LARGE_RANGE)) + self.assertEqual(sorted(it), list(map(squared, range(LARGE_RANGE)))) + + def test_imap_unordered_random(self): + it = self.pool.imap_unordered(sqr_random_sleep, range(SMALL_RANGE)) + self.assertEqual(sorted(it), list(map(squared, range(SMALL_RANGE)))) + + def test_empty_imap_unordered(self): + it = self.pool.imap_unordered(sqr, []) + self.assertEqual(list(it), []) + + def test_empty_imap(self): + it = self.pool.imap(sqr, []) + self.assertEqual(list(it), []) + + def test_empty_map(self): + self.assertEqual(self.pool.map(sqr, []), []) + + def test_terminate(self): + result = self.pool.map_async(gevent.sleep, [0.1] * ((self.size or 10) * 2)) + gevent.sleep(0.1) + kill = TimingWrapper(self.pool.kill) + kill() + self.assertTimeWithinRange(kill.elapsed, 0.0, 0.5) + result.join() + + def sleep(self, x): + gevent.sleep(float(x) / 10.) + return str(x) + + def test_imap_unordered_sleep(self): + # testing that imap_unordered returns items in competion order + result = list(self.pool.imap_unordered(self.sleep, [10, 1, 2])) + if self.pool.size == 1: + expected = ['10', '1', '2'] + else: + expected = ['1', '2', '10'] + self.assertEqual(result, expected) + + # https://github.com/gevent/gevent/issues/423 + def test_imap_no_stop(self): + q = Queue() + q.put(123) + gevent.spawn_later(0.1, q.put, StopIteration) + result = list(self.pool.imap(lambda _: _, q)) + self.assertEqual(result, [123]) + + def test_imap_unordered_no_stop(self): + q = Queue() + q.put(1234) + gevent.spawn_later(0.1, q.put, StopIteration) + result = list(self.pool.imap_unordered(lambda _: _, q)) + self.assertEqual(result, [1234]) + + # same issue, but different test: https://github.com/gevent/gevent/issues/311 + def test_imap_final_sleep(self): + result = list(self.pool.imap(sqr, final_sleep())) + self.assertEqual(result, [0, 1, 4]) + + def test_imap_unordered_final_sleep(self): + result = list(self.pool.imap_unordered(sqr, final_sleep())) + self.assertEqual(result, [0, 1, 4]) + + # Issue 638 + def test_imap_unordered_bounded_queue(self): + iterable = list(range(100)) + + running = [0] + + def short_running_func(i, _j): + running[0] += 1 + return i + + def make_reader(mapping): + # Simulate a long running reader. No matter how many workers + # we have, we will never have a queue more than size 1 + def reader(): + result = [] + for i, x in enumerate(mapping): + self.assertTrue(running[0] <= i + 2, running[0]) + result.append(x) + gevent.sleep(0.01) + self.assertTrue(len(mapping.queue) <= 2, len(mapping.queue)) + return result + return reader + + # Send two iterables to make sure varargs and kwargs are handled + # correctly + for meth in self.pool.imap_unordered, self.pool.imap: + running[0] = 0 + mapping = meth(short_running_func, iterable, iterable, + maxsize=1) + + reader = make_reader(mapping) + l = reader() + self.assertEqual(sorted(l), iterable) + +@greentest.ignores_leakcheck +class TestPool2(TestPool): + size = 2 + +@greentest.ignores_leakcheck +class TestPool3(TestPool): + size = 3 + +@greentest.ignores_leakcheck +class TestPool10(TestPool): + size = 10 + + +class TestPoolUnlimit(TestPool): + size = None + + +class TestPool0(greentest.TestCase): + size = 0 + + def test_wait_full(self): + p = gevent.pool.Pool(size=0) + self.assertEqual(0, p.free_count()) + self.assertTrue(p.full()) + self.assertEqual(0, p.wait_available(timeout=0.01)) + + +class TestJoinSleep(gevent.testing.timing.AbstractGenericWaitTestCase): + + def wait(self, timeout): + p = gevent.pool.Pool() + g = p.spawn(gevent.sleep, 10) + try: + p.join(timeout=timeout) + finally: + g.kill() + + +class TestJoinSleep_raise_error(gevent.testing.timing.AbstractGenericWaitTestCase): + + def wait(self, timeout): + p = gevent.pool.Pool() + g = p.spawn(gevent.sleep, 10) + try: + p.join(timeout=timeout, raise_error=True) + finally: + g.kill() + + +class TestJoinEmpty(greentest.TestCase): + switch_expected = False + + def test(self): + p = gevent.pool.Pool() + res = p.join() + self.assertTrue(res, "empty should return true") + + +class TestSpawn(greentest.TestCase): + switch_expected = True + + def test(self): + p = gevent.pool.Pool(1) + self.assertEqual(len(p), 0) + p.spawn(gevent.sleep, 0.1) + self.assertEqual(len(p), 1) + p.spawn(gevent.sleep, 0.1) # this spawn blocks until the old one finishes + self.assertEqual(len(p), 1) + gevent.sleep(0.19 if not greentest.RUNNING_ON_APPVEYOR else 0.5) + self.assertEqual(len(p), 0) + + def testSpawnAndWait(self): + p = gevent.pool.Pool(1) + self.assertEqual(len(p), 0) + p.spawn(gevent.sleep, 0.1) + self.assertEqual(len(p), 1) + res = p.join(0.01) + self.assertFalse(res, "waiting on a full pool should return false") + res = p.join() + self.assertTrue(res, "waiting to finish should be true") + self.assertEqual(len(p), 0) + +def error_iter(): + yield 1 + yield 2 + raise ExpectedException + + +class TestErrorInIterator(greentest.TestCase): + error_fatal = False + + def test(self): + p = gevent.pool.Pool(3) + self.assertRaises(ExpectedException, p.map, lambda x: None, error_iter()) + gevent.sleep(0.001) + + def test_unordered(self): + p = gevent.pool.Pool(3) + + def unordered(): + return list(p.imap_unordered(lambda x: None, error_iter())) + + self.assertRaises(ExpectedException, unordered) + gevent.sleep(0.001) + + +def divide_by(x): + return 1.0 / x + + +class TestErrorInHandler(greentest.TestCase): + error_fatal = False + + def test_map(self): + p = gevent.pool.Pool(3) + self.assertRaises(ZeroDivisionError, p.map, divide_by, [1, 0, 2]) + + def test_imap(self): + p = gevent.pool.Pool(1) + it = p.imap(divide_by, [1, 0, 2]) + self.assertEqual(next(it), 1.0) + self.assertRaises(ZeroDivisionError, next, it) + self.assertEqual(next(it), 0.5) + self.assertRaises(StopIteration, next, it) + + def test_imap_unordered(self): + p = gevent.pool.Pool(1) + it = p.imap_unordered(divide_by, [1, 0, 2]) + self.assertEqual(next(it), 1.0) + self.assertRaises(ZeroDivisionError, next, it) + self.assertEqual(next(it), 0.5) + self.assertRaises(StopIteration, next, it) + + +if __name__ == '__main__': + greentest.main() diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__pywsgi.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__pywsgi.py new file mode 100644 index 00000000..9fe22615 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__pywsgi.py @@ -0,0 +1,1811 @@ +# Copyright (c) 2007, Linden Research, Inc. +# Copyright (c) 2009-2010 gevent contributors +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. +# pylint: disable=too-many-lines,unused-argument +from __future__ import print_function + +from gevent import monkey + +monkey.patch_all(thread=False) + +try: + from urllib.parse import parse_qs +except ImportError: + # Python 2 + from urlparse import parse_qs +import os +import sys +try: + # On Python 2, we want the C-optimized version if + # available; it has different corner-case behaviour than + # the Python implementation, and it used by socket.makefile + # by default. + from cStringIO import StringIO +except ImportError: + from io import BytesIO as StringIO +import weakref + +from wsgiref.validate import validator + +import gevent.testing as greentest +import gevent +from gevent.testing import PY3, PYPY +from gevent import socket +from gevent import pywsgi +from gevent.pywsgi import Input + + +CONTENT_LENGTH = 'Content-Length' +CONN_ABORTED_ERRORS = greentest.CONN_ABORTED_ERRORS +server_implements_chunked = True +server_implements_pipeline = True +server_implements_100continue = True +DEBUG = '-v' in sys.argv + +REASONS = {200: 'OK', + 500: 'Internal Server Error'} + + +class ConnectionClosed(Exception): + pass + + +def read_headers(fd): + response_line = fd.readline() + if not response_line: + raise ConnectionClosed + response_line = response_line.decode('latin-1') + headers = {} + while True: + line = fd.readline().strip() + if not line: + break + line = line.decode('latin-1') + try: + key, value = line.split(': ', 1) + except: + print('Failed to split: %r' % (line, )) + raise + assert key.lower() not in {x.lower() for x in headers}, 'Header %r:%r sent more than once: %r' % (key, value, headers) + headers[key] = value + return response_line, headers + + +def iread_chunks(fd): + while True: + line = fd.readline() + chunk_size = line.strip() + try: + chunk_size = int(chunk_size, 16) + except: + print('Failed to parse chunk size: %r' % line) + raise + if chunk_size == 0: + crlf = fd.read(2) + assert crlf == b'\r\n', repr(crlf) + break + data = fd.read(chunk_size) + yield data + crlf = fd.read(2) + assert crlf == b'\r\n', repr(crlf) + + +class Response(object): + + def __init__(self, status_line, headers): + self.status_line = status_line + self.headers = headers + self.body = None + self.chunks = False + try: + version, code, self.reason = status_line[:-2].split(' ', 2) + self.code = int(code) + HTTP, self.version = version.split('/') + assert HTTP == 'HTTP', repr(HTTP) + assert self.version in ('1.0', '1.1'), repr(self.version) + except Exception: + print('Error: %r' % status_line) + raise + + def __iter__(self): + yield self.status_line + yield self.headers + yield self.body + + def __str__(self): + args = (self.__class__.__name__, self.status_line, self.headers, self.body, self.chunks) + return '<%s status_line=%r headers=%r body=%r chunks=%r>' % args + + def assertCode(self, code): + if hasattr(code, '__contains__'): + assert self.code in code, 'Unexpected code: %r (expected %r)\n%s' % (self.code, code, self) + else: + assert self.code == code, 'Unexpected code: %r (expected %r)\n%s' % (self.code, code, self) + + def assertReason(self, reason): + assert self.reason == reason, 'Unexpected reason: %r (expected %r)\n%s' % (self.reason, reason, self) + + def assertVersion(self, version): + assert self.version == version, 'Unexpected version: %r (expected %r)\n%s' % (self.version, version, self) + + def assertHeader(self, header, value): + real_value = self.headers.get(header, False) + assert real_value == value, \ + 'Unexpected header %r: %r (expected %r)\n%s' % (header, real_value, value, self) + + def assertBody(self, body): + if isinstance(body, str) and PY3: + body = body.encode("ascii") + assert self.body == body, 'Unexpected body: %r (expected %r)\n%s' % (self.body, body, self) + + @classmethod + def read(cls, fd, code=200, reason='default', version='1.1', + body=None, chunks=None, content_length=None): + # pylint:disable=too-many-branches + _status_line, headers = read_headers(fd) + self = cls(_status_line, headers) + if code is not None: + self.assertCode(code) + if reason == 'default': + reason = REASONS.get(code) + if reason is not None: + self.assertReason(reason) + if version is not None: + self.assertVersion(version) + if self.code == 100: + return self + if content_length is not None: + if isinstance(content_length, int): + content_length = str(content_length) + self.assertHeader('Content-Length', content_length) + try: + if 'chunked' in headers.get('Transfer-Encoding', ''): + if CONTENT_LENGTH in headers: + print("WARNING: server used chunked transfer-encoding despite having Content-Length header (libevent 1.x's bug)") + self.chunks = list(iread_chunks(fd)) + self.body = b''.join(self.chunks) + elif CONTENT_LENGTH in headers: + num = int(headers[CONTENT_LENGTH]) + self.body = fd.read(num) + else: + self.body = fd.read() + except: + print('Response.read failed to read the body:\n%s' % self) + import traceback; traceback.print_exc() + raise + if body is not None: + self.assertBody(body) + if chunks is not None: + assert chunks == self.chunks, (chunks, self.chunks) + return self + +read_http = Response.read + + +class TestCase(greentest.TestCase): + server = None + validator = staticmethod(validator) + application = None + + # Bind to default address, which should give us ipv6 (when available) + # and ipv4. (see self.connect()) + listen_addr = '' + # connect on ipv4, even though we bound to ipv6 too + # to prove ipv4 works...except on Windows, it apparently doesn't. + # So use the hostname. + connect_addr = 'localhost' + + def init_logger(self): + import logging + logger = logging.getLogger('gevent.pywsgi') + return logger + + def init_server(self, application): + logger = self.logger = self.init_logger() + self.server = pywsgi.WSGIServer((self.listen_addr, 0), application, + log=logger, error_log=logger) + + def setUp(self): + application = self.application + if self.validator is not None: + application = self.validator(application) + self.init_server(application) + self.server.start() + self.port = self.server.server_port + greentest.TestCase.setUp(self) + + if greentest.CPYTHON and greentest.PY2: + # Keeping raw sockets alive keeps SSL sockets + # from being closed too, at least on CPython2, so we + # need to use weakrefs. + + # In contrast, on PyPy, *only* having a weakref lets the + # original socket die and leak + + def _close_on_teardown(self, resource): + self.close_on_teardown.append(weakref.ref(resource)) + return resource + + def _tearDownCloseOnTearDown(self): + self.close_on_teardown = [r() for r in self.close_on_teardown if r() is not None] + super(TestCase, self)._tearDownCloseOnTearDown() + + def tearDown(self): + greentest.TestCase.tearDown(self) + if self.server is not None: + with gevent.Timeout.start_new(0.5): + self.server.stop() + self.server = None + + + def connect(self): + conn = socket.create_connection((self.connect_addr, self.port)) + self._close_on_teardown(conn) + result = conn + if PY3: + conn_makefile = conn.makefile + + def makefile(*args, **kwargs): + if 'bufsize' in kwargs: + kwargs['buffering'] = kwargs.pop('bufsize') + + if 'mode' in kwargs: + return conn_makefile(*args, **kwargs) + + # Under Python3, you can't read and write to the same + # makefile() opened in (default) r, and r+ is not allowed + kwargs['mode'] = 'rwb' + rconn = conn_makefile(*args, **kwargs) + _rconn_write = rconn.write + + def write(data): + if isinstance(data, str): + data = data.encode('ascii') + return _rconn_write(data) + rconn.write = write + self._close_on_teardown(rconn) + return rconn + + class proxy(object): + def __getattribute__(self, name): + if name == 'makefile': + return makefile + return getattr(conn, name) + result = proxy() + return result + + def makefile(self): + return self.connect().makefile(bufsize=1) + + def urlopen(self, *args, **kwargs): + fd = self.connect().makefile(bufsize=1) + fd.write('GET / HTTP/1.1\r\nHost: localhost\r\n\r\n') + return read_http(fd, *args, **kwargs) + + +class CommonTests(TestCase): + + def test_basic(self): + fd = self.makefile() + fd.write('GET / HTTP/1.1\r\nHost: localhost\r\n\r\n') + response = read_http(fd, body='hello world') + if response.headers.get('Connection') == 'close' and not server_implements_pipeline: + return + fd.write('GET /notexist HTTP/1.1\r\nHost: localhost\r\n\r\n') + read_http(fd, code=404, reason='Not Found', body='not found') + fd.write('GET / HTTP/1.1\r\nHost: localhost\r\n\r\n') + read_http(fd, body='hello world') + fd.close() + + def test_pipeline(self): + if not server_implements_pipeline: + return + fd = self.makefile() + fd.write('GET / HTTP/1.1\r\nHost: localhost\r\n\r\n' + 'GET /notexist HTTP/1.1\r\nHost: localhost\r\n\r\n') + read_http(fd, body='hello world') + exception = AssertionError('HTTP pipelining not supported; the second request is thrown away') + try: + timeout = gevent.Timeout.start_new(0.5, exception=exception) + try: + read_http(fd, code=404, reason='Not Found', body='not found') + fd.close() + finally: + timeout.close() + except AssertionError as ex: + if ex is not exception: + raise + + def test_connection_close(self): + fd = self.makefile() + fd.write('GET / HTTP/1.1\r\nHost: localhost\r\n\r\n') + response = read_http(fd) + if response.headers.get('Connection') == 'close' and not server_implements_pipeline: + return + fd.write('GET / HTTP/1.1\r\nHost: localhost\r\nConnection: close\r\n\r\n') + read_http(fd) + fd.write('GET / HTTP/1.1\r\nHost: localhost\r\n\r\n') + # This may either raise, or it may return an empty response, + # depend on timing and the Python version. + try: + result = fd.readline() + except socket.error as ex: + if ex.args[0] not in CONN_ABORTED_ERRORS: + raise + else: + self.assertFalse( + result, + 'The remote side is expected to close the connection, but it sent %r' % (result,)) + + def SKIP_test_006_reject_long_urls(self): + fd = self.makefile() + path_parts = [] + for _ in range(3000): + path_parts.append('path') + path = '/'.join(path_parts) + request = 'GET /%s HTTP/1.0\r\nHost: localhost\r\n\r\n' % path + fd.write(request) + result = fd.readline() + status = result.split(' ')[1] + self.assertEqual(status, '414') + fd.close() + + +class TestNoChunks(CommonTests): + # when returning a list of strings a shortcut is employed by the server: + # it calculates the content-length and joins all the chunks before sending + validator = None + + def application(self, env, start_response): + self.assertTrue(env.get('wsgi.input_terminated')) + path = env['PATH_INFO'] + if path == '/': + start_response('200 OK', [('Content-Type', 'text/plain')]) + return [b'hello ', b'world'] + start_response('404 Not Found', [('Content-Type', 'text/plain')]) + return [b'not ', b'found'] + + def test(self): + fd = self.makefile() + fd.write('GET / HTTP/1.1\r\nHost: localhost\r\n\r\n') + response = read_http(fd, body='hello world') + self.assertFalse(response.chunks) + response.assertHeader('Content-Length', '11') + + if not server_implements_pipeline: + fd = self.makefile() + + fd.write('GET /not-found HTTP/1.1\r\nHost: localhost\r\n\r\n') + response = read_http(fd, code=404, reason='Not Found', body='not found') + self.assertFalse(response.chunks) + response.assertHeader('Content-Length', '9') + + +class TestExplicitContentLength(TestNoChunks): # pylint:disable=too-many-ancestors + # when returning a list of strings a shortcut is empoyed by the + # server - it caculates the content-length + + def application(self, env, start_response): + self.assertTrue(env.get('wsgi.input_terminated')) + path = env['PATH_INFO'] + if path == '/': + start_response('200 OK', [('Content-Type', 'text/plain'), ('Content-Length', '11')]) + return [b'hello ', b'world'] + + start_response('404 Not Found', [('Content-Type', 'text/plain'), ('Content-Length', '9')]) + return [b'not ', b'found'] + + +class TestYield(CommonTests): + + @staticmethod + def application(env, start_response): + path = env['PATH_INFO'] + if path == '/': + start_response('200 OK', [('Content-Type', 'text/plain')]) + yield b"hello world" + else: + start_response('404 Not Found', [('Content-Type', 'text/plain')]) + yield b"not found" + + +class TestBytearray(CommonTests): + + validator = None + + @staticmethod + def application(env, start_response): + path = env['PATH_INFO'] + if path == '/': + start_response('200 OK', [('Content-Type', 'text/plain')]) + return [bytearray(b"hello "), bytearray(b"world")] + start_response('404 Not Found', [('Content-Type', 'text/plain')]) + return [bytearray(b"not found")] + + +class MultiLineHeader(TestCase): + @staticmethod + def application(env, start_response): + assert "test.submit" in env["CONTENT_TYPE"] + start_response('200 OK', [('Content-Type', 'text/plain')]) + return [b"ok"] + + def test_multiline_116(self): + """issue #116""" + request = '\r\n'.join(( + 'POST / HTTP/1.0', + 'Host: localhost', + 'Content-Type: multipart/related; boundary="====XXXX====";', + ' type="text/xml";start="test.submit"', + 'Content-Length: 0', + '', '')) + fd = self.makefile() + fd.write(request) + read_http(fd) + + +class TestGetArg(TestCase): + + @staticmethod + def application(env, start_response): + body = env['wsgi.input'].read(3) + if PY3: + body = body.decode('ascii') + a = parse_qs(body).get('a', [1])[0] + start_response('200 OK', [('Content-Type', 'text/plain')]) + return [('a is %s, body is %s' % (a, body)).encode('ascii')] + + def test_007_get_arg(self): + # define a new handler that does a get_arg as well as a read_body + fd = self.makefile() + request = '\r\n'.join(( + 'POST / HTTP/1.0', + 'Host: localhost', + 'Content-Length: 3', + '', + 'a=a')) + fd.write(request) + + # send some junk after the actual request + fd.write('01234567890123456789') + read_http(fd, body='a is a, body is a=a') + fd.close() + +class TestCloseIter(TestCase): + + # The *Validator* closes the iterators! + validator = None + + def application(self, env, start_response): + start_response('200 OK', [('Content-Type', 'text/plain')]) + return self + + def __iter__(self): + yield bytearray(b"Hello World") + yield b"!" + + closed = False + + def close(self): + self.closed += 1 + + def test_close_is_called(self): + self.closed = False + fd = self.makefile() + fd.write('GET / HTTP/1.1\r\nHost: localhost\r\n\r\n') + read_http(fd, body=b"Hello World!", chunks=[b'Hello World', b'!']) + # We got closed exactly once. + self.assertEqual(self.closed, 1) + +class TestChunkedApp(TestCase): + + chunks = [b'this', b'is', b'chunked'] + + def body(self): + return b''.join(self.chunks) + + def application(self, env, start_response): + self.assertTrue(env.get('wsgi.input_terminated')) + start_response('200 OK', [('Content-Type', 'text/plain')]) + for chunk in self.chunks: + yield chunk + + def test_chunked_response(self): + fd = self.makefile() + fd.write('GET / HTTP/1.1\r\nHost: localhost\r\nConnection: close\r\n\r\n') + response = read_http(fd, body=self.body(), chunks=None) + if server_implements_chunked: + response.assertHeader('Transfer-Encoding', 'chunked') + self.assertEqual(response.chunks, self.chunks) + else: + response.assertHeader('Transfer-Encoding', False) + response.assertHeader('Content-Length', str(len(self.body()))) + self.assertEqual(response.chunks, False) + + def test_no_chunked_http_1_0(self): + fd = self.makefile() + fd.write('GET / HTTP/1.0\r\nHost: localhost\r\nConnection: close\r\n\r\n') + response = read_http(fd) + self.assertEqual(response.body, self.body()) + self.assertEqual(response.headers.get('Transfer-Encoding'), None) + content_length = response.headers.get('Content-Length') + if content_length is not None: + self.assertEqual(content_length, str(len(self.body()))) + + +class TestBigChunks(TestChunkedApp): + chunks = [b'a' * 8192] * 3 + + +class TestNegativeRead(TestCase): + + def application(self, env, start_response): + self.assertTrue(env.get('wsgi.input_terminated')) + start_response('200 OK', [('Content-Type', 'text/plain')]) + if env['PATH_INFO'] == '/read': + data = env['wsgi.input'].read(-1) + return [data] + + def test_negative_chunked_read(self): + fd = self.makefile() + data = (b'POST /read HTTP/1.1\r\nHost: localhost\r\nConnection: close\r\n' + b'Transfer-Encoding: chunked\r\n\r\n' + b'2\r\noh\r\n4\r\n hai\r\n0\r\n\r\n') + fd.write(data) + read_http(fd, body='oh hai') + + def test_negative_nonchunked_read(self): + fd = self.makefile() + data = (b'POST /read HTTP/1.1\r\nHost: localhost\r\nConnection: close\r\n' + b'Content-Length: 6\r\n\r\n' + b'oh hai') + fd.write(data) + read_http(fd, body='oh hai') + + +class TestNegativeReadline(TestCase): + validator = None + + @staticmethod + def application(env, start_response): + start_response('200 OK', [('Content-Type', 'text/plain')]) + if env['PATH_INFO'] == '/readline': + data = env['wsgi.input'].readline(-1) + return [data] + + def test_negative_chunked_readline(self): + fd = self.makefile() + data = (b'POST /readline HTTP/1.1\r\nHost: localhost\r\nConnection: close\r\n' + b'Transfer-Encoding: chunked\r\n\r\n' + b'2\r\noh\r\n4\r\n hai\r\n0\r\n\r\n') + fd.write(data) + read_http(fd, body='oh hai') + + def test_negative_nonchunked_readline(self): + fd = self.makefile() + data = (b'POST /readline HTTP/1.1\r\nHost: localhost\r\nConnection: close\r\n' + b'Content-Length: 6\r\n\r\n' + b'oh hai') + fd.write(data) + read_http(fd, body='oh hai') + + +class TestChunkedPost(TestCase): + + + def application(self, env, start_response): + self.assertTrue(env.get('wsgi.input_terminated')) + start_response('200 OK', [('Content-Type', 'text/plain')]) + if env['PATH_INFO'] == '/a': + data = env['wsgi.input'].read(6) + return [data] + + if env['PATH_INFO'] == '/b': + lines = [x for x in iter(lambda: env['wsgi.input'].read(6), b'')] + return lines + + if env['PATH_INFO'] == '/c': + return [x for x in iter(lambda: env['wsgi.input'].read(1), b'')] + + def test_014_chunked_post(self): + fd = self.makefile() + data = (b'POST /a HTTP/1.1\r\nHost: localhost\r\nConnection: close\r\n' + b'Transfer-Encoding: chunked\r\n\r\n' + b'2\r\noh\r\n4\r\n hai\r\n0\r\n\r\n') + fd.write(data) + read_http(fd, body='oh hai') + # self.close_opened() # XXX: Why? + + fd = self.makefile() + fd.write(data.replace(b'/a', b'/b')) + read_http(fd, body='oh hai') + + fd = self.makefile() + fd.write(data.replace(b'/a', b'/c')) + read_http(fd, body='oh hai') + + def test_229_incorrect_chunk_no_newline(self): + # Giving both a Content-Length and a Transfer-Encoding, + # TE is preferred. But if the chunking is bad from the client, + # missing its terminating newline, + # the server doesn't hang + data = (b'POST /a HTTP/1.1\r\nHost: localhost\r\nConnection: close\r\n' + b'Content-Length: 12\r\n' + b'Transfer-Encoding: chunked\r\n\r\n' + b'{"hi": "ho"}') + fd = self.makefile() + fd.write(data) + read_http(fd, code=400) + + def test_229_incorrect_chunk_non_hex(self): + # Giving both a Content-Length and a Transfer-Encoding, + # TE is preferred. But if the chunking is bad from the client, + # the server doesn't hang + data = (b'POST /a HTTP/1.1\r\nHost: localhost\r\nConnection: close\r\n' + b'Content-Length: 12\r\n' + b'Transfer-Encoding: chunked\r\n\r\n' + b'{"hi": "ho"}\r\n') + fd = self.makefile() + fd.write(data) + read_http(fd, code=400) + + def test_229_correct_chunk_quoted_ext(self): + data = (b'POST /a HTTP/1.1\r\nHost: localhost\r\nConnection: close\r\n' + b'Transfer-Encoding: chunked\r\n\r\n' + b'2;token="oh hi"\r\noh\r\n4\r\n hai\r\n0\r\n\r\n') + fd = self.makefile() + fd.write(data) + read_http(fd, body='oh hai') + + def test_229_correct_chunk_token_ext(self): + data = (b'POST /a HTTP/1.1\r\nHost: localhost\r\nConnection: close\r\n' + b'Transfer-Encoding: chunked\r\n\r\n' + b'2;token=oh_hi\r\noh\r\n4\r\n hai\r\n0\r\n\r\n') + fd = self.makefile() + fd.write(data) + read_http(fd, body='oh hai') + + def test_229_incorrect_chunk_token_ext_too_long(self): + data = (b'POST /a HTTP/1.1\r\nHost: localhost\r\nConnection: close\r\n' + b'Transfer-Encoding: chunked\r\n\r\n' + b'2;token=oh_hi\r\noh\r\n4\r\n hai\r\n0\r\n\r\n') + data = data.replace(b'oh_hi', b'_oh_hi' * 4000) + fd = self.makefile() + fd.write(data) + read_http(fd, code=400) + + +class TestUseWrite(TestCase): + + body = b'abcde' + end = b'end' + content_length = str(len(body + end)) + + def application(self, env, start_response): + if env['PATH_INFO'] == '/explicit-content-length': + write = start_response('200 OK', [('Content-Type', 'text/plain'), + ('Content-Length', self.content_length)]) + write(self.body) + elif env['PATH_INFO'] == '/no-content-length': + write = start_response('200 OK', [('Content-Type', 'text/plain')]) + write(self.body) + elif env['PATH_INFO'] == '/no-content-length-twice': + write = start_response('200 OK', [('Content-Type', 'text/plain')]) + write(self.body) + write(self.body) + else: + raise Exception('Invalid url') + return [self.end] + + def test_explicit_content_length(self): + fd = self.makefile() + fd.write('GET /explicit-content-length HTTP/1.1\r\nHost: localhost\r\nConnection: close\r\n\r\n') + response = read_http(fd, body=self.body + self.end) + response.assertHeader('Content-Length', self.content_length) + response.assertHeader('Transfer-Encoding', False) + + def test_no_content_length(self): + fd = self.makefile() + fd.write('GET /no-content-length HTTP/1.1\r\nHost: localhost\r\nConnection: close\r\n\r\n') + response = read_http(fd, body=self.body + self.end) + if server_implements_chunked: + response.assertHeader('Content-Length', False) + response.assertHeader('Transfer-Encoding', 'chunked') + else: + response.assertHeader('Content-Length', self.content_length) + + def test_no_content_length_twice(self): + fd = self.makefile() + fd.write('GET /no-content-length-twice HTTP/1.1\r\nHost: localhost\r\nConnection: close\r\n\r\n') + response = read_http(fd, body=self.body + self.body + self.end) + if server_implements_chunked: + response.assertHeader('Content-Length', False) + response.assertHeader('Transfer-Encoding', 'chunked') + assert response.chunks == [self.body, self.body, self.end], response.chunks + else: + response.assertHeader('Content-Length', str(5 + 5 + 3)) + + +class HttpsTestCase(TestCase): + + certfile = os.path.join(os.path.dirname(__file__), 'test_server.crt') + keyfile = os.path.join(os.path.dirname(__file__), 'test_server.key') + + def init_server(self, application): + self.server = pywsgi.WSGIServer((self.listen_addr, 0), application, + certfile=self.certfile, keyfile=self.keyfile) + + def urlopen(self, method='GET', post_body=None, **kwargs): # pylint:disable=arguments-differ + import ssl + raw_sock = self.connect() + sock = ssl.wrap_socket(raw_sock) + fd = sock.makefile(bufsize=1) # pylint:disable=unexpected-keyword-arg + fd.write('%s / HTTP/1.1\r\nHost: localhost\r\n' % method) + if post_body is not None: + fd.write('Content-Length: %s\r\n\r\n' % len(post_body)) + fd.write(post_body) + if kwargs.get('body') is None: + kwargs['body'] = post_body + else: + fd.write('\r\n') + fd.flush() + try: + return read_http(fd, **kwargs) + finally: + fd.close() + sock.close() + raw_sock.close() + + def application(self, environ, start_response): + assert environ['wsgi.url_scheme'] == 'https', environ['wsgi.url_scheme'] + start_response('200 OK', [('Content-Type', 'text/plain')]) + return [environ['wsgi.input'].read(10)] + + +import gevent.ssl +HAVE_SSLCONTEXT = getattr(gevent.ssl, 'create_default_context') +if HAVE_SSLCONTEXT: + + class HttpsSslContextTestCase(HttpsTestCase): + def init_server(self, application): + # On 2.7, our certs don't line up with hostname. + # If we just use create_default_context as-is, we get + # `ValueError: check_hostname requires server_hostname`. + # If we set check_hostname to False, we get + # `SSLError: [SSL: PEER_DID_NOT_RETURN_A_CERTIFICATE] peer did not return a certificate` + # (Neither of which happens in Python 3.) But the unverified context + # works both places. See also test___example_servers.py + from gevent.ssl import _create_unverified_context # pylint:disable=no-name-in-module + context = _create_unverified_context() + context.load_cert_chain(certfile=self.certfile, keyfile=self.keyfile) + self.server = pywsgi.WSGIServer((self.listen_addr, 0), + application, ssl_context=context) + +class TestHttps(HttpsTestCase): + + if hasattr(socket, 'ssl'): + + def test_012_ssl_server(self): + result = self.urlopen(method="POST", post_body='abc') + self.assertEqual(result.body, 'abc') + + def test_013_empty_return(self): + result = self.urlopen() + self.assertEqual(result.body, '') + +if HAVE_SSLCONTEXT: + class TestHttpsWithContext(HttpsSslContextTestCase, TestHttps): # pylint:disable=too-many-ancestors + pass + +class TestInternational(TestCase): + validator = None # wsgiref.validate.IteratorWrapper([]) does not have __len__ + + def application(self, environ, start_response): + path_bytes = b'/\xd0\xbf\xd1\x80\xd0\xb8\xd0\xb2\xd0\xb5\xd1\x82' + if PY3: + # Under PY3, the escapes were decoded as latin-1 + path_bytes = path_bytes.decode('latin-1') + + self.assertEqual(environ['PATH_INFO'], path_bytes) + self.assertEqual(environ['QUERY_STRING'], '%D0%B2%D0%BE%D0%BF%D1%80%D0%BE%D1%81=%D0%BE%D1%82%D0%B2%D0%B5%D1%82') + start_response("200 PASSED", [('Content-Type', 'text/plain')]) + return [] + + def test(self): + sock = self.connect() + sock.sendall(b'''GET /%D0%BF%D1%80%D0%B8%D0%B2%D0%B5%D1%82?%D0%B2%D0%BE%D0%BF%D1%80%D0%BE%D1%81=%D0%BE%D1%82%D0%B2%D0%B5%D1%82 HTTP/1.1 +Host: localhost +Connection: close + +'''.replace(b'\n', b'\r\n')) + read_http(sock.makefile(), reason='PASSED', chunks=False, body='', content_length=0) + + +class TestNonLatin1HeaderFromApplication(TestCase): + error_fatal = False # Allow sending the exception response, don't kill the greenlet + + validator = None # Don't validate the application, it's deliberately bad + header = b'\xe1\xbd\x8a3' # bomb in utf-8 bytes + should_error = PY3 # non-native string under Py3 + + def setUp(self): + super(TestNonLatin1HeaderFromApplication, self).setUp() + self.errors = [] + + def tearDown(self): + self.errors = [] + super(TestNonLatin1HeaderFromApplication, self).tearDown() + + def application(self, environ, start_response): + # We return a header that cannot be encoded in latin-1 + try: + start_response("200 PASSED", + [('Content-Type', 'text/plain'), + ('Custom-Header', self.header)]) + except: + self.errors.append(sys.exc_info()[:2]) + raise + return [] + + def test(self): + sock = self.connect() + self.expect_one_error() + sock.sendall(b'''GET / HTTP/1.1\r\n\r\n''') + if self.should_error: + read_http(sock.makefile(), code=500, reason='Internal Server Error') + self.assert_error(where_type=pywsgi.SecureEnviron) + self.assertEqual(len(self.errors), 1) + _, v = self.errors[0] + self.assertIsInstance(v, UnicodeError) + else: + read_http(sock.makefile(), code=200, reason='PASSED') + self.assertEqual(len(self.errors), 0) + + +class TestNonLatin1UnicodeHeaderFromApplication(TestNonLatin1HeaderFromApplication): + # Flip-flop of the superclass: Python 3 native string, Python 2 unicode object + header = u"\u1f4a3" # bomb in unicode + # Error both on py3 and py2. On py2, non-native string. On py3, native string + # that cannot be encoded to latin-1 + should_error = True + + +class TestInputReadline(TestCase): + # this test relies on the fact that readline() returns '' after it reached EOF + # this behaviour is not mandated by WSGI spec, it's just happens that gevent.wsgi behaves like that + # as such, this may change in the future + + validator = None + + def application(self, environ, start_response): + input = environ['wsgi.input'] + lines = [] + while True: + line = input.readline() + if not line: + break + line = line.decode('ascii') if PY3 else line + lines.append(repr(line) + ' ') + start_response('200 hello', []) + return [l.encode('ascii') for l in lines] if PY3 else lines + + def test(self): + fd = self.makefile() + content = 'hello\n\nworld\n123' + fd.write('POST / HTTP/1.1\r\nHost: localhost\r\nConnection: close\r\n' + 'Content-Length: %s\r\n\r\n%s' % (len(content), content)) + fd.flush() + read_http(fd, reason='hello', body="'hello\\n' '\\n' 'world\\n' '123' ") + + +class TestInputIter(TestInputReadline): + + def application(self, environ, start_response): + input = environ['wsgi.input'] + lines = [] + for line in input: + if not line: + break + line = line.decode('ascii') if PY3 else line + lines.append(repr(line) + ' ') + start_response('200 hello', []) + return [l.encode('ascii') for l in lines] if PY3 else lines + + +class TestInputReadlines(TestInputReadline): + + def application(self, environ, start_response): + input = environ['wsgi.input'] + lines = [l.decode('ascii') if PY3 else l for l in input.readlines()] + lines = [repr(line) + ' ' for line in lines] + start_response('200 hello', []) + return [l.encode('ascii') for l in lines] if PY3 else lines + + +class TestInputN(TestCase): + # testing for this: + # File "/home/denis/work/gevent/gevent/pywsgi.py", line 70, in _do_read + # if length and length > self.content_length - self.position: + # TypeError: unsupported operand type(s) for -: 'NoneType' and 'int' + + validator = None + + def application(self, environ, start_response): + environ['wsgi.input'].read(5) + start_response('200 OK', []) + return [] + + def test(self): + self.urlopen() + + +class TestError(TestCase): + + error = object() + error_fatal = False + + def application(self, env, start_response): + self.error = greentest.ExpectedException('TestError.application') + raise self.error + + def test(self): + self.expect_one_error() + self.urlopen(code=500) + self.assert_error(greentest.ExpectedException, self.error) + + +class TestError_after_start_response(TestError): + + def application(self, env, start_response): + self.error = greentest.ExpectedException('TestError_after_start_response.application') + start_response('200 OK', [('Content-Type', 'text/plain')]) + raise self.error + + +class TestEmptyYield(TestCase): + + @staticmethod + def application(env, start_response): + start_response('200 OK', [('Content-Type', 'text/plain')]) + yield b"" + yield b"" + + def test_err(self): + fd = self.connect().makefile(bufsize=1) + fd.write('GET / HTTP/1.1\r\nHost: localhost\r\nConnection: close\r\n\r\n') + + if server_implements_chunked: + chunks = [] + else: + chunks = False + + read_http(fd, body='', chunks=chunks) + + garbage = fd.read() + self.assertEqual(garbage, b"", "got garbage: %r" % garbage) + + +class TestFirstEmptyYield(TestCase): + + @staticmethod + def application(env, start_response): + start_response('200 OK', [('Content-Type', 'text/plain')]) + yield b"" + yield b"hello" + + def test_err(self): + fd = self.connect().makefile(bufsize=1) + fd.write('GET / HTTP/1.1\r\nHost: localhost\r\nConnection: close\r\n\r\n') + + if server_implements_chunked: + chunks = [b'hello'] + else: + chunks = False + + read_http(fd, body='hello', chunks=chunks) + + garbage = fd.read() + self.assertTrue(garbage == b"", "got garbage: %r" % garbage) + + +class TestEmptyYield304(TestCase): + + @staticmethod + def application(env, start_response): + start_response('304 Not modified', []) + yield b"" + yield b"" + + def test_err(self): + fd = self.connect().makefile(bufsize=1) + fd.write('GET / HTTP/1.1\r\nHost: localhost\r\nConnection: close\r\n\r\n') + read_http(fd, code=304, body='', chunks=False) + garbage = fd.read() + self.assertEqual(garbage, b"", "got garbage: %r" % garbage) + + +class TestContentLength304(TestCase): + validator = None + + def application(self, env, start_response): + try: + start_response('304 Not modified', [('Content-Length', '100')]) + except AssertionError as ex: + start_response('200 Raised', []) + return ex.args + else: + raise AssertionError('start_response did not fail but it should') + + def test_err(self): + fd = self.connect().makefile(bufsize=1) + fd.write('GET / HTTP/1.1\r\nHost: localhost\r\nConnection: close\r\n\r\n') + body = "Invalid Content-Length for 304 response: '100' (must be absent or zero)" + read_http(fd, code=200, reason='Raised', body=body, chunks=False) + garbage = fd.read() + self.assertEqual(garbage, b"", "got garbage: %r" % garbage) + + +class TestBody304(TestCase): + validator = None + + def application(self, env, start_response): + start_response('304 Not modified', []) + return [b'body'] + + def test_err(self): + fd = self.connect().makefile(bufsize=1) + fd.write('GET / HTTP/1.1\r\nHost: localhost\r\nConnection: close\r\n\r\n') + try: + read_http(fd) + except AssertionError as ex: + self.assertEqual(str(ex), 'The 304 response must have no body') + else: + raise AssertionError('AssertionError must be raised') + + +class TestWrite304(TestCase): + validator = None + error_raised = None + + def application(self, env, start_response): + write = start_response('304 Not modified', []) + self.error_raised = False + try: + write('body') + except AssertionError: + self.error_raised = True + raise + + def test_err(self): + fd = self.connect().makefile(bufsize=1) + fd.write(b'GET / HTTP/1.1\r\nHost: localhost\r\nConnection: close\r\n\r\n') + with self.assertRaises(AssertionError) as exc: + read_http(fd) + ex = exc.exception + self.assertEqual(str(ex), 'The 304 response must have no body') + self.assertTrue(self.error_raised, 'write() must raise') + + +class TestEmptyWrite(TestEmptyYield): + + @staticmethod + def application(env, start_response): + write = start_response('200 OK', [('Content-Type', 'text/plain')]) + write(b"") + write(b"") + return [] + + +class BadRequestTests(TestCase): + validator = None + # pywsgi checks content-length, but wsgi does not + content_length = None + + def application(self, env, start_response): + self.assertEqual(env['CONTENT_LENGTH'], self.content_length) + start_response('200 OK', [('Content-Type', 'text/plain')]) + return [b'hello'] + + def test_negative_content_length(self): + self.content_length = '-100' + fd = self.connect().makefile(bufsize=1) + fd.write('GET / HTTP/1.1\r\nHost: localhost\r\nContent-Length: %s\r\n\r\n' % self.content_length) + read_http(fd, code=(200, 400)) + + def test_illegal_content_length(self): + self.content_length = 'abc' + fd = self.connect().makefile(bufsize=1) + fd.write('GET / HTTP/1.1\r\nHost: localhost\r\nContent-Length: %s\r\n\r\n' % self.content_length) + read_http(fd, code=(200, 400)) + + +class ChunkedInputTests(TestCase): + dirt = "" + validator = None + + def application(self, env, start_response): + input = env['wsgi.input'] + response = [] + + pi = env["PATH_INFO"] + + if pi == "/short-read": + d = input.read(10) + response = [d] + elif pi == "/lines": + for x in input: + response.append(x) + elif pi == "/ping": + input.read(1) + response.append(b"pong") + else: + raise RuntimeError("bad path") + + start_response('200 OK', [('Content-Type', 'text/plain')]) + return response + + def chunk_encode(self, chunks, dirt=None): + if dirt is None: + dirt = self.dirt + + return chunk_encode(chunks, dirt=dirt) + + def body(self, dirt=None): + return self.chunk_encode(["this", " is ", "chunked", "\nline", " 2", "\n", "line3", ""], dirt=dirt) + + def ping(self, fd): + fd.write("GET /ping HTTP/1.1\r\n\r\n") + read_http(fd, body="pong") + + def ping_if_possible(self, fd): + try: + self.ping(fd) + except ConnectionClosed: + if server_implements_pipeline: + raise + fd = self.connect().makefile(bufsize=1) + self.ping(fd) + + def test_short_read_with_content_length(self): + body = self.body() + req = b"POST /short-read HTTP/1.1\r\ntransfer-encoding: Chunked\r\nContent-Length:1000\r\n\r\n" + body + conn = self.connect() + fd = conn.makefile(bufsize=1) + fd.write(req) + read_http(fd, body="this is ch") + + self.ping_if_possible(fd) + fd.close() + conn.close() + + def test_short_read_with_zero_content_length(self): + body = self.body() + req = b"POST /short-read HTTP/1.1\r\ntransfer-encoding: Chunked\r\nContent-Length:0\r\n\r\n" + body + #print("REQUEST:", repr(req)) + + fd = self.connect().makefile(bufsize=1) + fd.write(req) + read_http(fd, body="this is ch") + + self.ping_if_possible(fd) + + def test_short_read(self): + body = self.body() + req = b"POST /short-read HTTP/1.1\r\ntransfer-encoding: Chunked\r\n\r\n" + body + + fd = self.connect().makefile(bufsize=1) + fd.write(req) + read_http(fd, body="this is ch") + + self.ping_if_possible(fd) + + def test_dirt(self): + body = self.body(dirt="; here is dirt\0bla") + req = b"POST /ping HTTP/1.1\r\ntransfer-encoding: Chunked\r\n\r\n" + body + + fd = self.connect().makefile(bufsize=1) + fd.write(req) + try: + read_http(fd, body="pong") + except AssertionError as ex: + if str(ex).startswith('Unexpected code: 400'): + if not server_implements_chunked: + print('ChunkedNotImplementedWarning') + return + raise + + self.ping_if_possible(fd) + + def test_chunked_readline(self): + body = self.body() + req = "POST /lines HTTP/1.1\r\nContent-Length: %s\r\ntransfer-encoding: Chunked\r\n\r\n" % (len(body)) + req = req.encode('latin-1') + req += body + + fd = self.connect().makefile(bufsize=1) + fd.write(req) + read_http(fd, body='this is chunked\nline 2\nline3') + + def test_close_before_finished(self): + self.expect_one_error() + body = b'4\r\nthi' + req = b"POST /short-read HTTP/1.1\r\ntransfer-encoding: Chunked\r\n\r\n" + body + sock = self.connect() + fd = sock.makefile(bufsize=1, mode='wb') + fd.write(req) + fd.close() + + # Python 3 keeps the socket open even though the only + # makefile is gone; python 2 closed them both (because there were + # no outstanding references to the socket). Closing is essential for the server + # to get the message that the read will fail. It's better to be explicit + # to avoid a ResourceWarning + sock.close() + # Under Py2 it still needs to go away, which was implicit before + del fd + del sock + + gevent.get_hub().loop.update_now() + gevent.sleep(0.01) # timing needed for cpython + + if greentest.PYPY: + # XXX: Something is keeping the socket alive, + # by which I mean, the close event is not propagating to the server + # and waking up its recv() loop...we are stuck with the three bytes of + # 'thi' in the buffer and trying to read the forth. No amount of tinkering + # with the timing changes this...the only thing that does is running a + # GC and letting some object get collected. Might this be a problem in real life? + + import gc + gc.collect() + gevent.sleep(0.01) + gevent.get_hub().loop.update_now() + gc.collect() + gevent.sleep(0.01) + + # XXX2: Sometimes windows and PyPy/Travis fail to get this error, leading to a test failure. + # This would have to be due to the socket being kept around and open, + # not closed at the low levels. I haven't seen this locally. + # In the PyPy case, I've seen the IOError reported on the console, but not + # captured in the variables. + # https://travis-ci.org/gevent/gevent/jobs/329232976#L1374 + self.assert_error(IOError, 'unexpected end of file while parsing chunked data') + + +class Expect100ContinueTests(TestCase): + validator = None + + def application(self, environ, start_response): + content_length = int(environ['CONTENT_LENGTH']) + if content_length > 1024: + start_response('417 Expectation Failed', [('Content-Length', '7'), ('Content-Type', 'text/plain')]) + return [b'failure'] + + # pywsgi did sent a "100 continue" for each read + # see http://code.google.com/p/gevent/issues/detail?id=93 + text = environ['wsgi.input'].read(1) + text += environ['wsgi.input'].read(content_length - 1) + start_response('200 OK', [('Content-Length', str(len(text))), ('Content-Type', 'text/plain')]) + return [text] + + def test_continue(self): + fd = self.connect().makefile(bufsize=1) + + fd.write('PUT / HTTP/1.1\r\nHost: localhost\r\nContent-length: 1025\r\nExpect: 100-continue\r\n\r\n') + try: + read_http(fd, code=417, body="failure") + except AssertionError as ex: + if str(ex).startswith('Unexpected code: 400'): + if not server_implements_100continue: + print('100ContinueNotImplementedWarning') + return + raise + + fd.write('PUT / HTTP/1.1\r\nHost: localhost\r\nContent-length: 7\r\nExpect: 100-continue\r\n\r\ntesting') + read_http(fd, code=100) + read_http(fd, body="testing") + + +class MultipleCookieHeadersTest(TestCase): + + validator = None + + def application(self, environ, start_response): + self.assertEqual(environ['HTTP_COOKIE'], 'name1="value1"; name2="value2"') + self.assertEqual(environ['HTTP_COOKIE2'], 'nameA="valueA"; nameB="valueB"') + start_response('200 OK', []) + return [] + + def test(self): + fd = self.connect().makefile(bufsize=1) + fd.write('''GET / HTTP/1.1 +Host: localhost +Cookie: name1="value1" +Cookie2: nameA="valueA" +Cookie2: nameB="valueB" +Cookie: name2="value2"\n\n'''.replace('\n', '\r\n')) + read_http(fd) + + +class TestLeakInput(TestCase): + + _leak_wsgi_input = None + _leak_environ = None + + def tearDown(self): + TestCase.tearDown(self) + self._leak_wsgi_input = None + self._leak_environ = None + + def application(self, environ, start_response): + pi = environ["PATH_INFO"] + self._leak_wsgi_input = environ["wsgi.input"] + self._leak_environ = environ + if pi == "/leak-frame": + environ["_leak"] = sys._getframe(0) + + text = b"foobar" + start_response('200 OK', [('Content-Length', str(len(text))), ('Content-Type', 'text/plain')]) + return [text] + + def test_connection_close_leak_simple(self): + fd = self.connect().makefile(bufsize=1) + fd.write(b"GET / HTTP/1.0\r\nConnection: close\r\n\r\n") + d = fd.read() + self.assertTrue(d.startswith(b"HTTP/1.1 200 OK"), d) + + def test_connection_close_leak_frame(self): + fd = self.connect().makefile(bufsize=1) + fd.write(b"GET /leak-frame HTTP/1.0\r\nConnection: close\r\n\r\n") + d = fd.read() + self.assertTrue(d.startswith(b"HTTP/1.1 200 OK"), d) + self._leak_environ.pop('_leak') + +class TestHTTPResponseSplitting(TestCase): + # The validator would prevent the app from doing the + # bad things it needs to do + validator = None + + status = '200 OK' + headers = () + start_exc = None + + def setUp(self): + TestCase.setUp(self) + self.start_exc = None + self.status = TestHTTPResponseSplitting.status + self.headers = TestHTTPResponseSplitting.headers + + def tearDown(self): + TestCase.tearDown(self) + self.start_exc = None + + def application(self, environ, start_response): + try: + start_response(self.status, self.headers) + except Exception as e: # pylint: disable=broad-except + self.start_exc = e + else: + self.start_exc = None + return () + + def _assert_failure(self, message): + fd = self.makefile() + fd.write('GET / HTTP/1.0\r\nHost: localhost\r\n\r\n') + fd.read() + self.assertIsInstance(self.start_exc, ValueError) + self.assertEqual(self.start_exc.args[0], message) + + def test_newline_in_status(self): + self.status = '200 OK\r\nConnection: close\r\nContent-Length: 0\r\n\r\n' + self._assert_failure('carriage return or newline in status') + + def test_newline_in_header_value(self): + self.headers = [('Test', 'Hi\r\nConnection: close')] + self._assert_failure('carriage return or newline in header value') + + def test_newline_in_header_name(self): + self.headers = [('Test\r\n', 'Hi')] + self._assert_failure('carriage return or newline in header name') + + +class TestInvalidEnviron(TestCase): + validator = None + # check that WSGIServer does not insert any default values for CONTENT_LENGTH + + def application(self, environ, start_response): + for key, value in environ.items(): + if key in ('CONTENT_LENGTH', 'CONTENT_TYPE') or key.startswith('HTTP_'): + if key != 'HTTP_HOST': + raise AssertionError('Unexpected environment variable: %s=%r' % (key, value)) + start_response('200 OK', []) + return [] + + def test(self): + fd = self.makefile() + fd.write('GET / HTTP/1.0\r\nHost: localhost\r\n\r\n') + read_http(fd) + fd = self.makefile() + fd.write('GET / HTTP/1.1\r\nHost: localhost\r\n\r\n') + read_http(fd) + + +class TestInvalidHeadersDropped(TestCase): + validator = None + # check that invalid headers with a _ are dropped + + def application(self, environ, start_response): + self.assertNotIn('HTTP_X_AUTH_USER', environ) + start_response('200 OK', []) + return [] + + def test(self): + fd = self.makefile() + fd.write('GET / HTTP/1.0\r\nx-auth_user: bob\r\n\r\n') + read_http(fd) + + +class Handler(pywsgi.WSGIHandler): + + def read_requestline(self): + data = self.rfile.read(7) + if data[0] == b'<'[0]: + # Returning nothing stops handle_one_request() + # Note that closing or even deleting self.socket() here + # can lead to the read side throwing Connection Reset By Peer, + # depending on the Python version and OS + data += self.rfile.read(15) + if data.lower() == b'': + self.socket.sendall(b'HELLO') + else: + self.log_error('Invalid request: %r', data) + return None + else: + return data + self.rfile.readline() + + +class TestHandlerSubclass(TestCase): + + validator = None + + def application(self, environ, start_response): + start_response('200 OK', []) + return [] + + def init_server(self, application): + self.server = pywsgi.WSGIServer((self.listen_addr, 0), + application, + handler_class=Handler) + + def test(self): + fd = self.makefile() + fd.write(b'\x00') + fd.flush() # flush() is needed on PyPy, apparently it buffers slightly differently + self.assertEqual(fd.read(), b'HELLO') + + fd = self.makefile() + fd.write('GET / HTTP/1.1\r\nHost: localhost\r\nConnection: close\r\n\r\n') + fd.flush() + read_http(fd) + + fd = self.makefile() + # Trigger an error + fd.write('\x00') + fd.flush() + self.assertEqual(fd.read(), b'') + + +class TestErrorAfterChunk(TestCase): + validator = None + + @staticmethod + def application(env, start_response): + start_response('200 OK', [('Content-Type', 'text/plain')]) + yield b"hello" + raise greentest.ExpectedException('TestErrorAfterChunk') + + def test(self): + fd = self.connect().makefile(bufsize=1) + self.expect_one_error() + fd.write('GET / HTTP/1.1\r\nHost: localhost\r\nConnection: keep-alive\r\n\r\n') + self.assertRaises(ValueError, read_http, fd) + self.assert_error(greentest.ExpectedException) + + +def chunk_encode(chunks, dirt=None): + if dirt is None: + dirt = "" + + b = b"" + for c in chunks: + x = "%x%s\r\n%s\r\n" % (len(c), dirt, c) + b += x.encode('ascii') + return b + + +class TestInputRaw(greentest.BaseTestCase): + def make_input(self, data, content_length=None, chunked_input=False): + if isinstance(data, list): + data = chunk_encode(data) + chunked_input = True + elif isinstance(data, str) and PY3: + data = data.encode("ascii") + return Input(StringIO(data), content_length=content_length, chunked_input=chunked_input) + + if PY3: + def assertEqual(self, data, expected, *args): # pylint:disable=arguments-differ + if isinstance(expected, str): + expected = expected.encode('ascii') + super(TestInputRaw, self).assertEqual(data, expected, *args) + + def test_short_post(self): + i = self.make_input("1", content_length=2) + self.assertRaises(IOError, i.read) + + def test_short_post_read_with_length(self): + i = self.make_input("1", content_length=2) + self.assertRaises(IOError, i.read, 2) + + def test_short_post_readline(self): + i = self.make_input("1", content_length=2) + self.assertRaises(IOError, i.readline) + + def test_post(self): + i = self.make_input("12", content_length=2) + data = i.read() + self.assertEqual(data, "12") + + def test_post_read_with_length(self): + i = self.make_input("12", content_length=2) + data = i.read(10) + self.assertEqual(data, "12") + + def test_chunked(self): + i = self.make_input(["1", "2", ""]) + data = i.read() + self.assertEqual(data, "12") + + def test_chunked_read_with_length(self): + i = self.make_input(["1", "2", ""]) + data = i.read(10) + self.assertEqual(data, "12") + + def test_chunked_missing_chunk(self): + i = self.make_input(["1", "2"]) + self.assertRaises(IOError, i.read) + + def test_chunked_missing_chunk_read_with_length(self): + i = self.make_input(["1", "2"]) + self.assertRaises(IOError, i.read, 10) + + def test_chunked_missing_chunk_readline(self): + i = self.make_input(["1", "2"]) + self.assertRaises(IOError, i.readline) + + def test_chunked_short_chunk(self): + i = self.make_input("2\r\n1", chunked_input=True) + self.assertRaises(IOError, i.read) + + def test_chunked_short_chunk_read_with_length(self): + i = self.make_input("2\r\n1", chunked_input=True) + self.assertRaises(IOError, i.read, 2) + + def test_chunked_short_chunk_readline(self): + i = self.make_input("2\r\n1", chunked_input=True) + self.assertRaises(IOError, i.readline) + + def test_32bit_overflow(self): + # https://github.com/gevent/gevent/issues/289 + # Should not raise an OverflowError on Python 2 + print("BEGIN 32bit") + data = b'asdf\nghij\n' + long_data = b'a' * (pywsgi.MAX_REQUEST_LINE + 10) + long_data += b'\n' + data = data + long_data + partial_data = b'qjk\n' # Note terminating \n + n = 25 * 1000000000 + print("N", n, "Data len", len(data)) + if hasattr(n, 'bit_length'): + self.assertEqual(n.bit_length(), 35) + if not PY3 and not PYPY: + # Make sure we have the impl we think we do + self.assertRaises(OverflowError, StringIO(data).readline, n) + + i = self.make_input(data, content_length=n) + # No size hint, but we have too large a content_length to fit + self.assertEqual(i.readline(), b'asdf\n') + # Large size hint + self.assertEqual(i.readline(n), b'ghij\n') + self.assertEqual(i.readline(n), long_data) + + # Now again with the real content length, assuring we can't read past it + i = self.make_input(data + partial_data, content_length=len(data) + 1) + self.assertEqual(i.readline(), b'asdf\n') + self.assertEqual(i.readline(n), b'ghij\n') + self.assertEqual(i.readline(n), long_data) + # Now we've reached content_length so we shouldn't be able to + # read anymore except the one byte remaining + self.assertEqual(i.readline(n), b'q') + + +class Test414(TestCase): + + @staticmethod + def application(env, start_response): + raise AssertionError('should not get there') + + def test(self): + fd = self.makefile() + longline = 'x' * 20000 + fd.write(('''GET /%s HTTP/1.0\r\nHello: world\r\n\r\n''' % longline).encode('latin-1')) + read_http(fd, code=414) + + +class TestLogging(TestCase): + + # Something that gets wrapped in a LoggingLogAdapter + class Logger(object): + accessed = None + logged = None + thing = None + + def log(self, level, msg): + self.logged = (level, msg) + + def access(self, msg): + self.accessed = msg + + def get_thing(self): + return self.thing + + def init_logger(self): + return self.Logger() + + @staticmethod + def application(env, start_response): + start_response('200 OK', [('Content-Type', 'text/plain')]) + return [b'hello'] + + # Tests for issue #663 + + def test_proxy_methods_on_log(self): + # An object that looks like a logger gets wrapped + # with a proxy that + self.assertTrue(isinstance(self.server.log, pywsgi.LoggingLogAdapter)) + self.server.log.access("access") + self.server.log.write("write") + self.assertEqual(self.server.log.accessed, "access") + self.assertEqual(self.server.log.logged, (20, "write")) + + def test_set_attributes(self): + # Not defined by the wrapper, it goes to the logger + self.server.log.thing = 42 + self.assertEqual(self.server.log.get_thing(), 42) + + del self.server.log.thing + self.assertEqual(self.server.log.get_thing(), None) + + def test_status_log(self): + # Issue 664: Make sure we format the status line as a string + self.urlopen() + msg = self.server.log.logged[1] + self.assertTrue('"GET / HTTP/1.1" 200 ' in msg, msg) + + # Issue 756: Make sure we don't throw a newline on the end + self.assertTrue('\n' not in msg, msg) + +class TestEnviron(TestCase): + + # The wsgiref validator asserts type(environ) is dict. + # https://mail.python.org/pipermail/web-sig/2016-March/005455.html + validator = None + + def init_server(self, application): + super(TestEnviron, self).init_server(application) + self.server.environ_class = pywsgi.SecureEnviron + + def application(self, env, start_response): + self.assertIsInstance(env, pywsgi.SecureEnviron) + start_response('200 OK', [('Content-Type', 'text/plain')]) + return [] + + def test_environ_is_secure_by_default(self): + self.urlopen() + + def test_default_secure_repr(self): + environ = pywsgi.SecureEnviron() + self.assertIn('"}), str(environ)) + self.assertEqual(repr({'key': ""}), repr(environ)) + + environ.whitelist_keys = ('key',) + self.assertEqual(str({'key': 'value'}), str(environ)) + self.assertEqual(repr({'key': 'value'}), repr(environ)) + + del environ.whitelist_keys + + def test_override_class_defaults(self): + class EnvironClass(pywsgi.SecureEnviron): + __slots__ = () + + environ = EnvironClass() + + self.assertTrue(environ.secure_repr) + EnvironClass.default_secure_repr = False + self.assertFalse(environ.secure_repr) + + self.assertEqual(str({}), str(environ)) + self.assertEqual(repr({}), repr(environ)) + + EnvironClass.default_secure_repr = True + EnvironClass.default_whitelist_keys = ('key',) + + environ['key'] = 1 + self.assertEqual(str({'key': 1}), str(environ)) + self.assertEqual(repr({'key': 1}), repr(environ)) + + # Clean up for leaktests + del environ + del EnvironClass + import gc; gc.collect() + + + def test_copy_still_secure(self): + for cls in (pywsgi.Environ, pywsgi.SecureEnviron): + self.assertIsInstance(cls().copy(), cls) + + def test_pickle_copy_returns_dict(self): + # Anything going through copy.copy/pickle should + # return the same pickle that a dict would. + import pickle + import json + + for cls in (pywsgi.Environ, pywsgi.SecureEnviron): + bltin = {'key': 'value'} + env = cls(bltin) + self.assertIsInstance(env, cls) + self.assertEqual(bltin, env) + self.assertEqual(env, bltin) + + for protocol in range(0, pickle.HIGHEST_PROTOCOL + 1): + # It's impossible to get a subclass of dict to pickle + # identically, but it can restore identically + env_dump = pickle.dumps(env, protocol) + self.assertNotIn(b'Environ', env_dump) + loaded = pickle.loads(env_dump) + self.assertEqual(type(loaded), dict) + + self.assertEqual(json.dumps(bltin), json.dumps(env)) + +del CommonTests + +if __name__ == '__main__': + greentest.main() diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__queue.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__queue.py new file mode 100644 index 00000000..03c846fc --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__queue.py @@ -0,0 +1,465 @@ +import unittest + +import gevent.testing as greentest +from gevent.testing import TestCase, main +import gevent +from gevent.hub import get_hub, LoopExit +from gevent import util +from gevent import queue +from gevent.queue import Empty, Full +from gevent.event import AsyncResult +from gevent.testing.timing import AbstractGenericGetTestCase + +# pylint:disable=too-many-ancestors + +class TestQueue(TestCase): + + def test_send_first(self): + self.switch_expected = False + q = queue.Queue() + q.put('hi') + self.assertEqual(q.peek(), 'hi') + self.assertEqual(q.get(), 'hi') + + def test_peek_empty(self): + q = queue.Queue() + # No putters waiting, in the main loop: LoopExit + self.assertRaises(LoopExit, q.peek) + + def waiter(q): + self.assertRaises(Empty, q.peek, timeout=0.01) + g = gevent.spawn(waiter, q) + gevent.sleep(0.1) + g.join() + + def test_peek_multi_greenlet(self): + q = queue.Queue() + g = gevent.spawn(q.peek) + g.start() + gevent.sleep(0) + q.put(1) + g.join() + self.assertTrue(g.exception is None) + self.assertEqual(q.peek(), 1) + + def test_send_last(self): + q = queue.Queue() + + def waiter(q): + with gevent.Timeout(0.1 if not greentest.RUNNING_ON_APPVEYOR else 0.5): + self.assertEqual(q.get(), 'hi2') + return "OK" + + p = gevent.spawn(waiter, q) + gevent.sleep(0.01) + q.put('hi2') + gevent.sleep(0.01) + assert p.get(timeout=0) == "OK" + + def test_max_size(self): + q = queue.Queue(2) + results = [] + + def putter(q): + q.put('a') + results.append('a') + q.put('b') + results.append('b') + q.put('c') + results.append('c') + return "OK" + + p = gevent.spawn(putter, q) + gevent.sleep(0) + self.assertEqual(results, ['a', 'b']) + self.assertEqual(q.get(), 'a') + gevent.sleep(0) + self.assertEqual(results, ['a', 'b', 'c']) + self.assertEqual(q.get(), 'b') + self.assertEqual(q.get(), 'c') + assert p.get(timeout=0) == "OK" + + def test_zero_max_size(self): + q = queue.Channel() + + def sender(evt, q): + q.put('hi') + evt.set('done') + + def receiver(evt, q): + x = q.get() + evt.set(x) + + e1 = AsyncResult() + e2 = AsyncResult() + + p1 = gevent.spawn(sender, e1, q) + gevent.sleep(0.001) + self.assertTrue(not e1.ready()) + p2 = gevent.spawn(receiver, e2, q) + self.assertEqual(e2.get(), 'hi') + self.assertEqual(e1.get(), 'done') + with gevent.Timeout(0): + gevent.joinall([p1, p2]) + + def test_multiple_waiters(self): + # tests that multiple waiters get their results back + q = queue.Queue() + + def waiter(q, evt): + evt.set(q.get()) + + sendings = ['1', '2', '3', '4'] + evts = [AsyncResult() for x in sendings] + for i, _ in enumerate(sendings): + gevent.spawn(waiter, q, evts[i]) # XXX use waitall for them + + gevent.sleep(0.01) # get 'em all waiting + + results = set() + + def collect_pending_results(): + for e in evts: + with gevent.Timeout(0.001, False): + x = e.get() + results.add(x) + return len(results) + + q.put(sendings[0]) + self.assertEqual(collect_pending_results(), 1) + q.put(sendings[1]) + self.assertEqual(collect_pending_results(), 2) + q.put(sendings[2]) + q.put(sendings[3]) + self.assertEqual(collect_pending_results(), 4) + + def test_waiters_that_cancel(self): + q = queue.Queue() + + def do_receive(q, evt): + with gevent.Timeout(0, RuntimeError()): + try: + result = q.get() + evt.set(result) # pragma: no cover (should have raised) + except RuntimeError: + evt.set('timed out') + + evt = AsyncResult() + gevent.spawn(do_receive, q, evt) + self.assertEqual(evt.get(), 'timed out') + + q.put('hi') + self.assertEqual(q.get(), 'hi') + + def test_senders_that_die(self): + q = queue.Queue() + + def do_send(q): + q.put('sent') + + gevent.spawn(do_send, q) + self.assertEqual(q.get(), 'sent') + + def test_two_waiters_one_dies(self): + + def waiter(q, evt): + evt.set(q.get()) + + def do_receive(q, evt): + with gevent.Timeout(0, RuntimeError()): + try: + result = q.get() + evt.set(result) # pragma: no cover (should have raised) + except RuntimeError: + evt.set('timed out') + + q = queue.Queue() + dying_evt = AsyncResult() + waiting_evt = AsyncResult() + gevent.spawn(do_receive, q, dying_evt) + gevent.spawn(waiter, q, waiting_evt) + gevent.sleep(0.1) + q.put('hi') + self.assertEqual(dying_evt.get(), 'timed out') + self.assertEqual(waiting_evt.get(), 'hi') + + def test_two_bogus_waiters(self): + def do_receive(q, evt): + with gevent.Timeout(0, RuntimeError()): + try: + result = q.get() + evt.set(result) # pragma: no cover (should have raised) + except RuntimeError: + evt.set('timed out') + + q = queue.Queue() + e1 = AsyncResult() + e2 = AsyncResult() + gevent.spawn(do_receive, q, e1) + gevent.spawn(do_receive, q, e2) + gevent.sleep(0.1) + q.put('sent') + self.assertEqual(e1.get(), 'timed out') + self.assertEqual(e2.get(), 'timed out') + self.assertEqual(q.get(), 'sent') + + +class TestChannel(TestCase): + + def test_send(self): + channel = queue.Channel() + + events = [] + + def another_greenlet(): + events.append(channel.get()) + events.append(channel.get()) + + g = gevent.spawn(another_greenlet) + + events.append('sending') + channel.put('hello') + events.append('sent hello') + channel.put('world') + events.append('sent world') + + self.assertEqual(['sending', 'hello', 'sent hello', 'world', 'sent world'], events) + g.get() + + def test_wait(self): + channel = queue.Channel() + events = [] + + def another_greenlet(): + events.append('sending hello') + channel.put('hello') + events.append('sending world') + channel.put('world') + events.append('sent world') + + g = gevent.spawn(another_greenlet) + + events.append('waiting') + events.append(channel.get()) + events.append(channel.get()) + + self.assertEqual(['waiting', 'sending hello', 'hello', 'sending world', 'world'], events) + gevent.sleep(0) + self.assertEqual(['waiting', 'sending hello', 'hello', 'sending world', 'world', 'sent world'], events) + g.get() + + def test_iterable(self): + channel = queue.Channel() + gevent.spawn(channel.put, StopIteration) + r = list(channel) + self.assertEqual(r, []) + +class TestJoinableQueue(TestCase): + + def test_task_done(self): + channel = queue.JoinableQueue() + X = object() + gevent.spawn(channel.put, X) + result = channel.get() + self.assertIs(result, X) + self.assertEqual(1, channel.unfinished_tasks) + channel.task_done() + self.assertEqual(0, channel.unfinished_tasks) + + +class TestNoWait(TestCase): + + def test_put_nowait_simple(self): + result = [] + q = queue.Queue(1) + + def store_result(func, *args): + result.append(func(*args)) + + run_callback = get_hub().loop.run_callback + + run_callback(store_result, util.wrap_errors(Full, q.put_nowait), 2) + run_callback(store_result, util.wrap_errors(Full, q.put_nowait), 3) + gevent.sleep(0) + assert len(result) == 2, result + assert result[0] is None, result + assert isinstance(result[1], queue.Full), result + + def test_get_nowait_simple(self): + result = [] + q = queue.Queue(1) + q.put(4) + + def store_result(func, *args): + result.append(func(*args)) + + run_callback = get_hub().loop.run_callback + + run_callback(store_result, util.wrap_errors(Empty, q.get_nowait)) + run_callback(store_result, util.wrap_errors(Empty, q.get_nowait)) + gevent.sleep(0) + assert len(result) == 2, result + assert result[0] == 4, result + assert isinstance(result[1], queue.Empty), result + + # get_nowait must work from the mainloop + def test_get_nowait_unlock(self): + result = [] + q = queue.Queue(1) + p = gevent.spawn(q.put, 5) + + def store_result(func, *args): + result.append(func(*args)) + + assert q.empty(), q + gevent.sleep(0) + assert q.full(), q + get_hub().loop.run_callback(store_result, q.get_nowait) + gevent.sleep(0) + assert q.empty(), q + assert result == [5], result + assert p.ready(), p + assert p.dead, p + assert q.empty(), q + + def test_get_nowait_unlock_channel(self): + result = [] + q = queue.Channel() + p = gevent.spawn(q.put, 5) + + def store_result(func, *args): + result.append(func(*args)) + + assert q.empty(), q + assert q.full(), q + gevent.sleep(0.001) + assert q.empty(), q + assert q.full(), q + get_hub().loop.run_callback(store_result, q.get_nowait) + gevent.sleep(0.001) + assert q.empty(), q + assert q.full(), q + assert result == [5], result + assert p.ready(), p + assert p.dead, p + assert q.empty(), q + + # put_nowait must work from the mainloop + def test_put_nowait_unlock(self): + result = [] + q = queue.Queue() + p = gevent.spawn(q.get) + + def store_result(func, *args): + result.append(func(*args)) + + self.assertTrue(q.empty(), q) + self.assertFalse(q.full(), q) + gevent.sleep(0.001) + + self.assertTrue(q.empty(), q) + self.assertFalse(q.full(), q) + + get_hub().loop.run_callback(store_result, q.put_nowait, 10) + + self.assertFalse(p.ready(), p) + gevent.sleep(0.001) + + self.assertEqual(result, [None]) + self.assertTrue(p.ready(), p) + self.assertFalse(q.full(), q) + self.assertTrue(q.empty(), q) + + +class TestJoinEmpty(TestCase): + + def test_issue_45(self): + """Test that join() exits immediately if not jobs were put into the queue""" + self.switch_expected = False + q = queue.JoinableQueue() + q.join() + +class AbstractTestWeakRefMixin(object): + + def test_weak_reference(self): + import weakref + one = self._makeOne() + ref = weakref.ref(one) + self.assertIs(one, ref()) + + +class TestGetInterrupt(AbstractTestWeakRefMixin, AbstractGenericGetTestCase): + + Timeout = Empty + + kind = queue.Queue + + def wait(self, timeout): + return self._makeOne().get(timeout=timeout) + + def _makeOne(self): + return self.kind() + +class TestGetInterruptJoinableQueue(TestGetInterrupt): + kind = queue.JoinableQueue + +class TestGetInterruptLifoQueue(TestGetInterrupt): + kind = queue.LifoQueue + +class TestGetInterruptPriorityQueue(TestGetInterrupt): + kind = queue.PriorityQueue + +class TestGetInterruptChannel(TestGetInterrupt): + kind = queue.Channel + + +class TestPutInterrupt(AbstractGenericGetTestCase): + kind = queue.Queue + Timeout = Full + + def setUp(self): + super(TestPutInterrupt, self).setUp() + self.queue = self._makeOne() + + def wait(self, timeout): + while not self.queue.full(): + self.queue.put(1) + return self.queue.put(2, timeout=timeout) + + def _makeOne(self): + return self.kind(1) + + +class TestPutInterruptJoinableQueue(TestPutInterrupt): + kind = queue.JoinableQueue + +class TestPutInterruptLifoQueue(TestPutInterrupt): + kind = queue.LifoQueue + +class TestPutInterruptPriorityQueue(TestPutInterrupt): + kind = queue.PriorityQueue + +class TestPutInterruptChannel(TestPutInterrupt): + kind = queue.Channel + + def _makeOne(self): + return self.kind() + + +if hasattr(queue, 'SimpleQueue'): + + class TestGetInterruptSimpleQueue(TestGetInterrupt): + kind = queue.SimpleQueue + + def test_raises_timeout_Timeout(self): + raise unittest.SkipTest("Not supported") + + test_raises_timeout_Timeout_exc_customized = test_raises_timeout_Timeout + test_outer_timeout_is_not_lost = test_raises_timeout_Timeout + + +del AbstractGenericGetTestCase + + +if __name__ == '__main__': + main() diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__real_greenlet.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__real_greenlet.py new file mode 100644 index 00000000..9a9e5b42 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__real_greenlet.py @@ -0,0 +1,29 @@ +"""Testing that greenlet restores sys.exc_info. + +Passes with CPython + greenlet 0.4.0 + +Fails with PyPy 2.2.1 +""" +from __future__ import print_function +import sys +import greenlet + + +print('Your greenlet version: %s' % (getattr(greenlet, '__version__', None), )) + + +result = [] + + +def func(): + result.append(repr(sys.exc_info())) + + +g = greenlet.greenlet(func) +try: + 1 / 0 +except ZeroDivisionError: + g.switch() + + +assert result == ['(None, None, None)'], result diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__refcount.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__refcount.py new file mode 100644 index 00000000..e17013d6 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__refcount.py @@ -0,0 +1,162 @@ +# Copyright (c) 2008 AG Projects +# Author: Denis Bilenko +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. + +"""This test checks that underlying socket instances (gevent.socket.socket._sock) +are not leaked by the hub. +""" +from __future__ import print_function +from _socket import socket as c_socket +import sys +if sys.version_info[0] >= 3: + # Python3 enforces that __weakref__ appears only once, + # and not when a slotted class inherits from an unslotted class. + # We mess around with the class MRO below and violate that rule + # (because socket.socket defines __slots__ with __weakref__), + # so import socket.socket before that can happen. + __import__('socket') + Socket = c_socket +else: + class Socket(c_socket): + "Something we can have a weakref to" + +import _socket +_socket.socket = Socket + +import gevent.testing as greentest +from gevent import monkey; monkey.patch_all() +from gevent.testing import flaky + +from pprint import pformat +try: + from thread import start_new_thread +except ImportError: + from _thread import start_new_thread +from time import sleep +import weakref +import gc + +import socket +socket._realsocket = Socket + +SOCKET_TIMEOUT = 0.1 +if greentest.RUNNING_ON_CI: + SOCKET_TIMEOUT *= 2 + +def init_server(): + s = socket.socket() + s.settimeout(SOCKET_TIMEOUT) + s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) + s.bind(('127.0.0.1', 0)) + s.listen(5) + return s + + +def handle_request(s, raise_on_timeout): + try: + conn, _ = s.accept() + except socket.timeout: + if raise_on_timeout: + raise + else: + return + #print('handle_request - accepted') + res = conn.recv(100) + assert res == b'hello', repr(res) + #print('handle_request - recvd %r' % res) + res = conn.send(b'bye') + #print('handle_request - sent %r' % res) + #print('handle_request - conn refcount: %s' % sys.getrefcount(conn)) + conn.close() + + +def make_request(port): + #print('make_request') + s = socket.socket() + s.connect(('127.0.0.1', port)) + #print('make_request - connected') + res = s.send(b'hello') + #print('make_request - sent %s' % res) + res = s.recv(100) + assert res == b'bye', repr(res) + #print('make_request - recvd %r' % res) + s.close() + + +def run_interaction(run_client): + s = init_server() + start_new_thread(handle_request, (s, run_client)) + if run_client: + port = s.getsockname()[1] + start_new_thread(make_request, (port, )) + sleep(0.1 + SOCKET_TIMEOUT) + #print(sys.getrefcount(s._sock)) + #s.close() + w = weakref.ref(s._sock) + s.close() + if greentest.WIN: + # The background thread may not have even had a chance to run + # yet, sleep again to be sure it does. Otherwise there could be + # strong refs to the socket still around. + try: + sleep(0.1 + SOCKET_TIMEOUT) + except Exception: # pylint:disable=broad-except + pass + + return w + + +def run_and_check(run_client): + w = run_interaction(run_client=run_client) + if greentest.PYPY: + # PyPy doesn't use a strict ref counting and must + # run a gc, but the object should be gone + gc.collect() + if w(): + print(pformat(gc.get_referrers(w()))) + for x in gc.get_referrers(w()): + print(pformat(x)) + for y in gc.get_referrers(x): + print('-', pformat(y)) + raise AssertionError('server should be dead by now') + + +@greentest.skipOnCI("Often fail with timeouts or force closed connections; not sure why.") +@greentest.skipIf( + greentest.RUN_LEAKCHECKS and greentest.PY3, + "Often fail with force closed connections; not sure why. " +) +class Test(greentest.TestCase): + + __timeout__ = greentest.LARGE_TIMEOUT + + @flaky.reraises_flaky_timeout(socket.timeout) + def test_clean_exit(self): + run_and_check(True) + run_and_check(True) + + @flaky.reraises_flaky_timeout(socket.timeout) + def test_timeout_exit(self): + run_and_check(False) + run_and_check(False) + + +if __name__ == '__main__': + greentest.main() diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__refcount_core.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__refcount_core.py new file mode 100644 index 00000000..edf8f406 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__refcount_core.py @@ -0,0 +1,24 @@ +import weakref + + +class Dummy: + def __init__(self): + __import__('gevent.core') + +try: + assert weakref.ref(Dummy())() is None + + from gevent import socket + s = socket.socket() + r = weakref.ref(s) + s.close() + del s + assert r() is None +except AssertionError: # pragma: no cover + import sys + if hasattr(sys, 'pypy_version_info'): + # PyPy uses a non refcounted GC which may defer + # the collection of the weakref, unlike CPython + pass + else: + raise diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__select.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__select.py new file mode 100644 index 00000000..d2110238 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__select.py @@ -0,0 +1,114 @@ +from gevent.testing import six +import sys +import os +import errno +from gevent import select, socket +import gevent.core +import gevent.testing as greentest +import gevent.testing.timing +import unittest + + +class TestSelect(gevent.testing.timing.AbstractGenericWaitTestCase): + + def wait(self, timeout): + select.select([], [], [], timeout) + + + +@greentest.skipOnWindows("Cant select on files") +class TestSelectRead(gevent.testing.timing.AbstractGenericWaitTestCase): + + def wait(self, timeout): + r, w = os.pipe() + try: + select.select([r], [], [], timeout) + finally: + os.close(r) + os.close(w) + + # Issue #12367: http://www.freebsd.org/cgi/query-pr.cgi?pr=kern/155606 + @unittest.skipIf(sys.platform.startswith('freebsd'), + 'skip because of a FreeBSD bug: kern/155606') + def test_errno(self): + # Backported from test_select.py in 3.4 + with open(__file__, 'rb') as fp: + fd = fp.fileno() + fp.close() + try: + select.select([fd], [], [], 0) + except OSError as err: + # Python 3 + self.assertEqual(err.errno, errno.EBADF) + except select.error as err: # pylint:disable=duplicate-except + # Python 2 (select.error is OSError on py3) + self.assertEqual(err.args[0], errno.EBADF) + else: + self.fail("exception not raised") + + +@unittest.skipUnless(hasattr(select, 'poll'), "Needs poll") +@greentest.skipOnWindows("Cant poll on files") +class TestPollRead(gevent.testing.timing.AbstractGenericWaitTestCase): + def wait(self, timeout): + # On darwin, the read pipe is reported as writable + # immediately, for some reason. So we carefully register + # it only for read events (the default is read and write) + r, w = os.pipe() + try: + poll = select.poll() + poll.register(r, select.POLLIN) + poll.poll(timeout * 1000) + finally: + poll.unregister(r) + os.close(r) + os.close(w) + + def test_unregister_never_registered(self): + # "Attempting to remove a file descriptor that was + # never registered causes a KeyError exception to be + # raised." + poll = select.poll() + self.assertRaises(KeyError, poll.unregister, 5) + + @unittest.skipIf(hasattr(gevent.core, 'libuv'), + "Depending on whether the fileno is reused or not this either crashes or does nothing." + "libuv won't open a watcher for a closed file on linux.") + def test_poll_invalid(self): + with open(__file__, 'rb') as fp: + fd = fp.fileno() + + poll = select.poll() + poll.register(fd, select.POLLIN) + # Close after registering; libuv refuses to even + # create a watcher if it would get EBADF (so this turns into + # a test of whether or not we successfully initted the watcher). + fp.close() + result = poll.poll(0) + self.assertEqual(result, [(fd, select.POLLNVAL)]) # pylint:disable=no-member + +class TestSelectTypes(greentest.TestCase): + + def test_int(self): + sock = socket.socket() + try: + select.select([int(sock.fileno())], [], [], 0.001) + finally: + sock.close() + + if hasattr(six.builtins, 'long'): + def test_long(self): + sock = socket.socket() + try: + select.select( + [six.builtins.long(sock.fileno())], [], [], 0.001) + finally: + sock.close() + + def test_string(self): + self.switch_expected = False + self.assertRaises(TypeError, select.select, ['hello'], [], [], 0.001) + + +if __name__ == '__main__': + greentest.main() diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__semaphore.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__semaphore.py new file mode 100644 index 00000000..83c8f94b --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__semaphore.py @@ -0,0 +1,91 @@ +import gevent.testing as greentest +import gevent +from gevent.lock import Semaphore +from gevent.thread import allocate_lock +import weakref +try: + from _thread import allocate_lock as std_allocate_lock +except ImportError: # Py2 + from thread import allocate_lock as std_allocate_lock + +# pylint:disable=broad-except + +class TestSemaphore(greentest.TestCase): + + # issue 39 + def test_acquire_returns_false_after_timeout(self): + s = Semaphore(value=0) + result = s.acquire(timeout=0.01) + assert result is False, repr(result) + + def test_release_twice(self): + s = Semaphore() + result = [] + s.rawlink(lambda s: result.append('a')) + s.release() + s.rawlink(lambda s: result.append('b')) + s.release() + gevent.sleep(0.001) + # The order, though, is not guaranteed. + self.assertEqual(sorted(result), ['a', 'b']) + + def test_semaphore_weakref(self): + s = Semaphore() + r = weakref.ref(s) + self.assertEqual(s, r()) + + def test_semaphore_in_class_with_del(self): + # Issue #704. This used to crash the process + # under PyPy through at least 4.0.1 if the Semaphore + # was implemented with Cython. + class X(object): + def __init__(self): + self.s = Semaphore() + + def __del__(self): + self.s.acquire() + + X() + import gc + gc.collect() + gc.collect() + + test_semaphore_in_class_with_del.ignore_leakcheck = True + + def test_rawlink_on_unacquired_runs_notifiers(self): + # https://github.com/gevent/gevent/issues/1287 + + # Rawlinking a ready semaphore should fire immediately, + # not raise LoopExit + s = Semaphore() + gevent.wait([s]) + +class TestLock(greentest.TestCase): + + def test_release_unheld_lock(self): + std_lock = std_allocate_lock() + g_lock = allocate_lock() + try: + std_lock.release() + self.fail("Should have thrown an exception") + except Exception as e: + std_exc = e + + try: + g_lock.release() + self.fail("Should have thrown an exception") + except Exception as e: + g_exc = e + self.assertIsInstance(g_exc, type(std_exc)) + + +@greentest.skipOnPurePython("Needs C extension") +class TestCExt(greentest.TestCase): + + def test_c_extension(self): + self.assertEqual(Semaphore.__module__, + 'gevent.__semaphore') + + +if __name__ == '__main__': + greentest.main() diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__server.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__server.py new file mode 100644 index 00000000..2ccdc856 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__server.py @@ -0,0 +1,515 @@ +from __future__ import print_function, division +import unittest +import errno +import os + + +import gevent.testing as greentest +from gevent.testing import PY3 +from gevent.testing import DEFAULT_SOCKET_TIMEOUT as _DEFAULT_SOCKET_TIMEOUT +from gevent import socket +import gevent +from gevent.server import StreamServer + + +class SimpleStreamServer(StreamServer): + + def handle(self, client_socket, _address): # pylint:disable=method-hidden + fd = client_socket.makefile() + try: + request_line = fd.readline() + if not request_line: + return + try: + _method, path, _rest = request_line.split(' ', 3) + except Exception: + print('Failed to parse request line: %r' % (request_line, )) + raise + if path == '/ping': + client_socket.sendall(b'HTTP/1.0 200 OK\r\n\r\nPONG') + elif path in ['/long', '/short']: + client_socket.sendall(b'hello') + while True: + data = client_socket.recv(1) + if not data: + break + else: + client_socket.sendall(b'HTTP/1.0 404 WTF?\r\n\r\n') + finally: + fd.close() + + +class Settings(object): + ServerClass = StreamServer + ServerSubClass = SimpleStreamServer + restartable = True + close_socket_detected = True + + @staticmethod + def assertAcceptedConnectionError(inst): + conn = inst.makefile() + result = conn.read() + inst.assertFalse(result) + + assert500 = assertAcceptedConnectionError + + @staticmethod + def assert503(inst): + # regular reads timeout + inst.assert500() + # attempt to send anything reset the connection + try: + inst.send_request() + except socket.error as ex: + if ex.args[0] not in greentest.CONN_ABORTED_ERRORS: + raise + + @staticmethod + def assertPoolFull(inst): + with inst.assertRaises(socket.timeout): + inst.assertRequestSucceeded(timeout=0.01) + + @staticmethod + def fill_default_server_args(inst, kwargs): + kwargs.setdefault('spawn', inst.get_spawn()) + return kwargs + +class TestCase(greentest.TestCase): + # pylint: disable=too-many-public-methods + __timeout__ = greentest.LARGE_TIMEOUT + Settings = Settings + server = None + + def cleanup(self): + if getattr(self, 'server', None) is not None: + self.server.stop() + self.server = None + + def get_listener(self): + sock = socket.socket() + sock.bind(('127.0.0.1', 0)) + sock.listen(5) + self._close_on_teardown(sock) + return sock + + def get_server_host_port_family(self): + server_host = self.server.server_host + if not server_host: + server_host = greentest.DEFAULT_LOCAL_HOST_ADDR + elif server_host == '::': + server_host = greentest.DEFAULT_LOCAL_HOST_ADDR6 + + try: + family = self.server.socket.family + except AttributeError: + # server deletes socket when closed + family = socket.AF_INET + + return server_host, self.server.server_port, family + + def makefile(self, timeout=_DEFAULT_SOCKET_TIMEOUT, bufsize=1): + server_host, server_port, family = self.get_server_host_port_family() + + sock = socket.socket(family=family) + try: + sock.connect((server_host, server_port)) + except Exception: + # avoid ResourceWarning under Py3 + sock.close() + raise + + if PY3: + # Under Python3, you can't read and write to the same + # makefile() opened in r, and r+ is not allowed + kwargs = {'buffering': bufsize, 'mode': 'rwb'} + else: + kwargs = {'bufsize': bufsize} + + rconn = sock.makefile(**kwargs) + if PY3: + rconn._sock = sock + rconn._sock.settimeout(timeout) + sock.close() + return rconn + + def send_request(self, url='/', timeout=_DEFAULT_SOCKET_TIMEOUT, bufsize=1): + conn = self.makefile(timeout=timeout, bufsize=bufsize) + conn.write(('GET %s HTTP/1.0\r\n\r\n' % url).encode('latin-1')) + conn.flush() + return conn + + def assertConnectionRefused(self): + with self.assertRaises(socket.error) as exc: + conn = self.makefile() + conn.close() + + ex = exc.exception + self.assertIn(ex.args[0], (errno.ECONNREFUSED, errno.EADDRNOTAVAIL)) + + def assert500(self): + self.Settings.assert500(self) + + def assert503(self): + self.Settings.assert503(self) + + def assertAcceptedConnectionError(self): + self.Settings.assertAcceptedConnectionError(self) + + def assertPoolFull(self): + self.Settings.assertPoolFull(self) + + def assertNotAccepted(self): + conn = self.makefile() + conn.write(b'GET / HTTP/1.0\r\n\r\n') + conn.flush() + result = b'' + try: + while True: + data = conn._sock.recv(1) + if not data: + break + result += data + except socket.timeout: + self.assertFalse(result) + return + self.assertTrue(result.startswith(b'HTTP/1.0 500 Internal Server Error'), repr(result)) + conn.close() + + def assertRequestSucceeded(self, timeout=_DEFAULT_SOCKET_TIMEOUT): + conn = self.makefile(timeout=timeout) + conn.write(b'GET /ping HTTP/1.0\r\n\r\n') + result = conn.read() + conn.close() + assert result.endswith(b'\r\n\r\nPONG'), repr(result) + + def start_server(self): + self.server.start() + self.assertRequestSucceeded() + self.assertRequestSucceeded() + + def stop_server(self): + self.server.stop() + self.assertConnectionRefused() + + def report_netstat(self, _msg): + # At one point this would call 'sudo netstat -anp | grep PID' + # with os.system. We can probably do better with psutil. + return + + def _create_server(self): + return self.ServerSubClass((greentest.DEFAULT_BIND_ADDR, 0)) + + def init_server(self): + self.server = self._create_server() + self.server.start() + gevent.sleep(0.01) + + @property + def socket(self): + return self.server.socket + + def _test_invalid_callback(self): + try: + self.server = self.ServerClass((greentest.DEFAULT_BIND_ADDR, 0), lambda: None) + self.server.start() + + self.expect_one_error() + + self.assert500() + self.assert_error(TypeError) + finally: + self.server.stop() + # XXX: There's something unreachable (with a traceback?) + # We need to clear it to make the leak checks work on Travis; + # so far I can't reproduce it locally on OS X. + import gc; gc.collect() + + def fill_default_server_args(self, kwargs): + return self.Settings.fill_default_server_args(self, kwargs) + + def ServerClass(self, *args, **kwargs): + return self.Settings.ServerClass(*args, + **self.fill_default_server_args(kwargs)) + + def ServerSubClass(self, *args, **kwargs): + return self.Settings.ServerSubClass(*args, + **self.fill_default_server_args(kwargs)) + + def get_spawn(self): + return None + +class TestDefaultSpawn(TestCase): + + def get_spawn(self): + return gevent.spawn + + def _test_server_start_stop(self, restartable): + self.report_netstat('before start') + self.start_server() + self.report_netstat('after start') + if restartable and self.Settings.restartable: + self.server.stop_accepting() + self.report_netstat('after stop_accepting') + self.assertNotAccepted() + self.server.start_accepting() + self.report_netstat('after start_accepting') + self.assertRequestSucceeded() + self.stop_server() + self.report_netstat('after stop') + + def test_backlog_is_not_accepted_for_socket(self): + self.switch_expected = False + with self.assertRaises(TypeError): + self.ServerClass(self.get_listener(), backlog=25, handle=False) + + def test_backlog_is_accepted_for_address(self): + self.server = self.ServerSubClass((greentest.DEFAULT_BIND_ADDR, 0), backlog=25) + self.assertConnectionRefused() + self._test_server_start_stop(restartable=False) + + def test_subclass_just_create(self): + self.server = self.ServerSubClass(self.get_listener()) + self.assertNotAccepted() + + def test_subclass_with_socket(self): + self.server = self.ServerSubClass(self.get_listener()) + # the connection won't be refused, because there exists a + # listening socket, but it won't be handled also + self.assertNotAccepted() + self._test_server_start_stop(restartable=True) + + def test_subclass_with_address(self): + self.server = self.ServerSubClass((greentest.DEFAULT_BIND_ADDR, 0)) + self.assertConnectionRefused() + self._test_server_start_stop(restartable=True) + + def test_invalid_callback(self): + self._test_invalid_callback() + + @greentest.reraises_flaky_timeout(socket.timeout) + def _test_serve_forever(self): + g = gevent.spawn(self.server.serve_forever) + try: + gevent.sleep(0.01) + self.assertRequestSucceeded() + self.server.stop() + assert not self.server.started + self.assertConnectionRefused() + finally: + g.kill() + g.get() + + def test_serve_forever(self): + self.server = self.ServerSubClass(('127.0.0.1', 0)) + assert not self.server.started + self.assertConnectionRefused() + self._test_serve_forever() + + def test_serve_forever_after_start(self): + self.server = self.ServerSubClass((greentest.DEFAULT_BIND_ADDR, 0)) + self.assertConnectionRefused() + assert not self.server.started + self.server.start() + assert self.server.started + self._test_serve_forever() + + def test_server_closes_client_sockets(self): + self.server = self.ServerClass((greentest.DEFAULT_BIND_ADDR, 0), lambda *args: []) + self.server.start() + conn = self.send_request() + # use assert500 below? + with gevent.Timeout._start_new_or_dummy(1): + try: + result = conn.read() + if result: + assert result.startswith('HTTP/1.0 500 Internal Server Error'), repr(result) + except socket.error as ex: + if ex.args[0] == 10053: + pass # "established connection was aborted by the software in your host machine" + elif ex.args[0] == errno.ECONNRESET: + pass + else: + raise + finally: + conn.close() + + self.stop_server() + + def init_server(self): + self.server = self._create_server() + self.server.start() + gevent.sleep(0.01) + + @property + def socket(self): + return self.server.socket + + def test_error_in_spawn(self): + self.init_server() + self.assertTrue(self.server.started) + error = ExpectedError('test_error_in_spawn') + self.server._spawn = lambda *args: gevent.getcurrent().throw(error) + self.expect_one_error() + self.assertAcceptedConnectionError() + self.assert_error(ExpectedError, error) + + def test_server_repr_when_handle_is_instancemethod(self): + # PR 501 + self.init_server() + self.start_server() + self.assertIn('Server', repr(self.server)) + + self.server.set_handle(self.server.handle) + self.assertIn('handle=', repr(self.server)) + + self.server.set_handle(self.test_server_repr_when_handle_is_instancemethod) + self.assertIn('test_server_repr_when_handle_is_instancemethod', repr(self.server)) + + def handle(): + pass + self.server.set_handle(handle) + self.assertIn('handle= returned a result with an error set + + # It's not safe to continue after a SystemError, so we just skip the test there. + + # As of Jan 2018 with CFFI 1.11.2 this happens reliably on macOS 3.6 and 3.7 + # as well. + + # See https://bitbucket.org/cffi/cffi/issues/352/systemerror-returned-a-result-with-an + + # This is fixed in 1.11.3 + + import gevent.signal # make sure it's in sys.modules pylint:disable=redefined-outer-name + assert gevent.signal + import site + if greentest.PY34: + from importlib import reload as reload_module + elif greentest.PY3: + from imp import reload as reload_module + else: + # builtin on py2 + reload_module = reload # pylint:disable=undefined-variable + + try: + reload_module(site) + except TypeError: + # Non-CFFI on Travis triggers this, for some reason, + # but only on 3.6, not 3.4 or 3.5, and not yet on 3.7. + + # The only module seen to trigger this is __main__, i.e., this module. + + # This is hard to trigger in a virtualenv since it appears they + # install their own site.py, different from the one that ships with + # Python 3.6., and at least the version I have doesn't mess with + # __cached__ + assert greentest.PY36 + import sys + for m in set(sys.modules.values()): + try: + if m.__cached__ is None: + print("Module has None __cached__", m, file=sys.stderr) + except AttributeError: + continue + +if __name__ == '__main__': + greentest.main() diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__sleep0.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__sleep0.py new file mode 100644 index 00000000..d95d6776 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__sleep0.py @@ -0,0 +1,10 @@ +import gevent +from gevent.testing.util import alarm + + +alarm(3) + + +with gevent.Timeout(0.01, False): + while True: + gevent.sleep(0) diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__socket.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__socket.py new file mode 100644 index 00000000..1ee6c233 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__socket.py @@ -0,0 +1,452 @@ +from gevent import monkey; monkey.patch_all() + +import sys +import os +import array +import socket +import traceback +import time +import unittest +import gevent.testing as greentest +from functools import wraps +from gevent.testing import six +from gevent.testing import LARGE_TIMEOUT + +# we use threading on purpose so that we can test both regular and gevent sockets with the same code +from threading import Thread as _Thread + +errno_types = int + +def wrap_error(func): + + @wraps(func) + def wrapper(*args, **kwargs): + try: + return func(*args, **kwargs) + except: # pylint:disable=bare-except + traceback.print_exc() + os._exit(2) + + return wrapper + + +class Thread(_Thread): + + def __init__(self, **kwargs): + target = kwargs.pop('target') + target = wrap_error(target) + _Thread.__init__(self, target=target, **kwargs) + self.start() + + +class TestTCP(greentest.TestCase): + + __timeout__ = None + TIMEOUT_ERROR = socket.timeout + long_data = ", ".join([str(x) for x in range(20000)]) + if not isinstance(long_data, bytes): + long_data = long_data.encode('ascii') + + def setUp(self): + super(TestTCP, self).setUp() + self.listener = self._close_on_teardown(self._setup_listener()) + + # XXX: On Windows (at least with libev), if we have a cleanup/tearDown method + # that does 'del self.listener' AND we haven't sometime + # previously closed the listener (while the test body was executing) + # we tend to sometimes see hangs when tests run in succession; + # notably test_empty_send followed by test_makefile produces a hang + # in test_makefile when it tries to read from the client_file, because + # the accept() call in accept_once has not yet returned a new socket to + # write to. + + # The cause *seems* to be that the listener socket in both tests gets the + # same fileno(); or, at least, if we don't del the listener object, + # we get a different fileno, and that scenario works. + + # Perhaps our logic is wrong in libev_vfd in the way we use + # _open_osfhandle and determine we can close it? + self.port = self.listener.getsockname()[1] + + def _setup_listener(self): + listener = socket.socket() + greentest.bind_and_listen(listener, ('127.0.0.1', 0)) + return listener + + def create_connection(self, host='127.0.0.1', port=None, timeout=None, + blocking=None): + sock = socket.socket() + sock.connect((host, port or self.port)) + if timeout is not None: + sock.settimeout(timeout) + if blocking is not None: + sock.setblocking(blocking) + return self._close_on_teardown(sock) + + def _test_sendall(self, data, match_data=None, client_method='sendall', + **client_args): + + read_data = [] + server_exc_info = [] + + def accept_and_read(): + conn = None + try: + conn, _ = self.listener.accept() + r = conn.makefile(mode='rb') + read_data.append(r.read()) + r.flush() + r.close() + except: # pylint:disable=bare-except + server_exc_info.append(sys.exc_info()) + finally: + if conn: + conn.close() + self.listener.close() + + server = Thread(target=accept_and_read) + client = self.create_connection(**client_args) + + try: + getattr(client, client_method)(data) + finally: + client.shutdown(socket.SHUT_RDWR) + client.close() + + server.join() + if match_data is None: + match_data = self.long_data + self.assertEqual(read_data[0], match_data) + + if server_exc_info: + six.reraise(*server_exc_info[0]) + + def test_sendall_str(self): + self._test_sendall(self.long_data) + + if not six.PY3: + def test_sendall_unicode(self): + self._test_sendall(six.text_type(self.long_data)) + + def test_sendall_array(self): + data = array.array("B", self.long_data) + self._test_sendall(data) + + def test_sendall_empty(self): + data = b'' + self._test_sendall(data, data) + + def test_sendall_empty_with_timeout(self): + # Issue 719 + data = b'' + self._test_sendall(data, data, timeout=10) + + def test_sendall_nonblocking(self): + # https://github.com/benoitc/gunicorn/issues/1282 + # Even if the socket is non-blocking, we make at least + # one attempt to send data. Under Py2 before this fix, we + # would incorrectly immediately raise a timeout error + data = b'hi\n' + self._test_sendall(data, data, blocking=False) + + def test_empty_send(self): + # Issue 719 + data = b'' + self._test_sendall(data, data, client_method='send') + + def test_fullduplex(self): + N = 100000 + + def server(): + (remote_client, _) = self.listener.accept() + # start reading, then, while reading, start writing. the reader should not hang forever + + def sendall(): + remote_client.sendall(b't' * N) + + sender = Thread(target=sendall) + result = remote_client.recv(1000) + self.assertEqual(result, b'hello world') + sender.join() + remote_client.close() + self.listener.close() + + server_thread = Thread(target=server) + client = self.create_connection() + client_file = client.makefile() + client_reader = Thread(target=client_file.read, args=(N, )) + time.sleep(0.1) + client.sendall(b'hello world') + time.sleep(0.1) + + # close() used to hang + client_file.close() + client.close() + + # this tests "full duplex" bug; + server_thread.join() + + client_reader.join() + + def test_recv_timeout(self): + client_sock = [] + acceptor = Thread(target=lambda: client_sock.append(self.listener.accept())) + client = self.create_connection() + client.settimeout(1) + start = time.time() + self.assertRaises(self.TIMEOUT_ERROR, client.recv, 1024) + took = time.time() - start + self.assertTimeWithinRange(took, 1 - 0.1, 1 + 0.1) + acceptor.join() + client.close() + client_sock[0][0].close() + + # Subclasses can disable this + _test_sendall_timeout_check_time = True + + # Travis-CI container infrastructure is configured with + # large socket buffers, at least 2MB, as-of Jun 3, 2015, + # so we must be sure to send more data than that. + # In 2018, this needs to be increased *again* as a smaller value was + # still often being sent. + _test_sendall_data = b'hello' * 100000000 + + # This doesn't make much sense...why are we really skipping this? + @greentest.skipOnWindows("On Windows send() accepts whatever is thrown at it") + def test_sendall_timeout(self): + client_sock = [] + acceptor = Thread(target=lambda: client_sock.append(self.listener.accept())) + client = self.create_connection() + time.sleep(0.1) + assert client_sock + client.settimeout(0.1) + start = time.time() + try: + with self.assertRaises(self.TIMEOUT_ERROR): + client.sendall(self._test_sendall_data) + if self._test_sendall_timeout_check_time: + took = time.time() - start + self.assertTimeWithinRange(took, 0.09, 0.2) + finally: + acceptor.join() + client.close() + client_sock[0][0].close() + + def test_makefile(self): + def accept_once(): + conn, _ = self.listener.accept() + fd = conn.makefile(mode='wb') + fd.write(b'hello\n') + fd.flush() + fd.close() + conn.close() # for pypy + self.listener.close() + + acceptor = Thread(target=accept_once) + client = self.create_connection() + # Closing the socket doesn't close the file + client_file = client.makefile(mode='rb') + client.close() + line = client_file.readline() + self.assertEqual(line, b'hello\n') + self.assertEqual(client_file.read(), b'') + client_file.close() + acceptor.join() + + def test_makefile_timeout(self): + + def accept_once(): + conn, _ = self.listener.accept() + try: + time.sleep(0.3) + finally: + conn.close() # for pypy + + acceptor = Thread(target=accept_once) + client = self.create_connection() + client.settimeout(0.1) + fd = client.makefile(mode='rb') + self.assertRaises(self.TIMEOUT_ERROR, fd.readline) + client.close() + fd.close() + acceptor.join() + + def test_attributes(self): + s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM, 0) + self.assertEqual(socket.AF_INET, s.type) + self.assertEqual(socket.SOCK_DGRAM, s.family) + self.assertEqual(0, s.proto) + + if hasattr(socket, 'SOCK_NONBLOCK'): + s.settimeout(1) + self.assertEqual(socket.AF_INET, s.type) + + s.setblocking(0) + std_socket = monkey.get_original('socket', 'socket')(socket.AF_INET, socket.SOCK_DGRAM, 0) + try: + std_socket.setblocking(0) + self.assertEqual(std_socket.type, s.type) + finally: + std_socket.close() + + s.close() + + def test_connect_ex_nonblocking_bad_connection(self): + # Issue 841 + s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) + s.setblocking(False) + ret = s.connect_ex((greentest.DEFAULT_LOCAL_HOST_ADDR, get_port())) + self.assertIsInstance(ret, errno_types) + s.close() + + def test_connect_ex_gaierror(self): + # Issue 841 + s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) + with self.assertRaises(socket.gaierror): + s.connect_ex(('foo.bar.fizzbuzz', get_port())) + s.close() + + def test_connect_ex_nonblocking_overflow(self): + # Issue 841 + s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) + s.setblocking(False) + with self.assertRaises(OverflowError): + s.connect_ex((greentest.DEFAULT_LOCAL_HOST_ADDR, 65539)) + s.close() + + @unittest.skipUnless(hasattr(socket, 'SOCK_CLOEXEC'), + "Requires SOCK_CLOEXEC") + def test_connect_with_type_flags_ignored(self): + # Issue 944 + # If we have SOCK_CLOEXEC or similar, we shouldn't be passing + # them through to the getaddrinfo call that connect() makes + SOCK_CLOEXEC = socket.SOCK_CLOEXEC # pylint:disable=no-member + s = socket.socket(socket.AF_INET, socket.SOCK_STREAM | SOCK_CLOEXEC) + + def accept_once(): + conn, _ = self.listener.accept() + fd = conn.makefile(mode='wb') + fd.write(b'hello\n') + fd.close() + conn.close() + + acceptor = Thread(target=accept_once) + s.connect(('127.0.0.1', self.port)) + fd = s.makefile(mode='rb') + self.assertEqual(fd.readline(), b'hello\n') + + fd.close() + s.close() + + acceptor.join() + +def get_port(): + tempsock = socket.socket() + tempsock.bind(('', 0)) + port = tempsock.getsockname()[1] + tempsock.close() + return port + + +class TestCreateConnection(greentest.TestCase): + + __timeout__ = LARGE_TIMEOUT + + def test_refuses(self): + with self.assertRaises(socket.error) as cm: + socket.create_connection((greentest.DEFAULT_BIND_ADDR, get_port()), + timeout=30, + source_address=('', get_port())) + ex = cm.exception + self.assertIn('refused', str(ex).lower()) + + @greentest.ignores_leakcheck + def test_base_exception(self): + # such as a GreenletExit or a gevent.timeout.Timeout + + class E(BaseException): + pass + + class MockSocket(object): + + created = () + closed = False + + def __init__(self, *_): + MockSocket.created += (self,) + + def connect(self, _): + raise E() + + def close(self): + self.closed = True + + def mockgetaddrinfo(*_): + return [(1, 2, 3, 3, 5),] + + import gevent.socket as gsocket + # Make sure we're monkey patched + self.assertEqual(gsocket.create_connection, socket.create_connection) + orig_socket = gsocket.socket + orig_getaddrinfo = gsocket.getaddrinfo + + try: + gsocket.socket = MockSocket + gsocket.getaddrinfo = mockgetaddrinfo + + with self.assertRaises(E): + socket.create_connection(('host', 'port')) + + self.assertEqual(1, len(MockSocket.created)) + self.assertTrue(MockSocket.created[0].closed) + + finally: + MockSocket.created = () + gsocket.socket = orig_socket + gsocket.getaddrinfo = orig_getaddrinfo + +class TestFunctions(greentest.TestCase): + + @greentest.ignores_leakcheck + # Creating new types in the function takes a cycle to cleanup. + def test_wait_timeout(self): + # Issue #635 + import gevent.socket + import gevent._socketcommon + + class io(object): + callback = None + + def start(self, *_args): + gevent.sleep(10) + + with self.assertRaises(gevent.socket.timeout): + gevent.socket.wait(io(), timeout=0.01) # pylint:disable=no-member + + + def test_signatures(self): + # https://github.com/gevent/gevent/issues/960 + exclude = [] + if greentest.PYPY: + # Up through at least PyPy 5.7.1, they define these as + # gethostbyname(host), whereas the official CPython argument name + # is hostname. But cpython doesn't allow calling with keyword args. + # Likewise for gethostbyaddr: PyPy uses host, cpython uses ip_address + exclude.append('gethostbyname') + exclude.append('gethostbyname_ex') + exclude.append('gethostbyaddr') + self.assertMonkeyPatchedFuncSignatures('socket', exclude=exclude) + + +class TestSocket(greentest.TestCase): + + def test_shutdown_when_closed(self): + # https://github.com/gevent/gevent/issues/1089 + # we once raised an AttributeError. + s = socket.socket() + s.close() + with self.assertRaises(socket.error): + s.shutdown(socket.SHUT_RDWR) + +if __name__ == '__main__': + greentest.main() diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__socket_close.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__socket_close.py new file mode 100644 index 00000000..24a71689 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__socket_close.py @@ -0,0 +1,58 @@ +import gevent +from gevent import socket +from gevent import server +import gevent.testing as greentest + +# XXX also test: send, sendall, recvfrom, recvfrom_into, sendto + + +def readall(sock, _): + while sock.recv(1024): + pass # pragma: no cover we never actually send the data + sock.close() + + +class Test(greentest.TestCase): + + error_fatal = False + + def setUp(self): + self.server = server.StreamServer(('127.0.0.1', 0), readall) + self.server.start() + + def tearDown(self): + self.server.stop() + + def test_recv_closed(self): + sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) + sock.connect(('localhost', self.server.server_port)) + receiver = gevent.spawn(sock.recv, 25) + try: + gevent.sleep(0.001) + sock.close() + receiver.join(timeout=0.1) + self.assertTrue(receiver.ready(), receiver) + self.assertEqual(receiver.value, None) + self.assertIsInstance(receiver.exception, socket.error) + self.assertEqual(receiver.exception.errno, socket.EBADF) + finally: + receiver.kill() + + # XXX: This is possibly due to the bad behaviour of small sleeps? + # The timeout is the global test timeout, 10s + @greentest.skipOnLibuvOnCI("Sometimes randomly times out") + def test_recv_twice(self): + sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) + sock.connect(('localhost', self.server.server_port)) + receiver = gevent.spawn(sock.recv, 25) + try: + gevent.sleep(0.001) + self.assertRaises(AssertionError, sock.recv, 25) + self.assertRaises(AssertionError, sock.recv, 25) + finally: + receiver.kill() + sock.close() + + +if __name__ == '__main__': + greentest.main() diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__socket_dns.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__socket_dns.py new file mode 100644 index 00000000..d9986dd4 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__socket_dns.py @@ -0,0 +1,718 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- +# pylint:disable=broad-except +import gevent +from gevent import monkey + +import os +import re +import gevent.testing as greentest +import unittest +import socket +from time import time +import traceback +import gevent.socket as gevent_socket +from gevent.testing.util import log +from gevent.testing import six +from gevent.testing.six import xrange + + +resolver = gevent.get_hub().resolver +log('Resolver: %s', resolver) + +if getattr(resolver, 'pool', None) is not None: + resolver.pool.size = 1 + +from gevent.testing.sysinfo import RESOLVER_NOT_SYSTEM +from gevent.testing.sysinfo import RESOLVER_DNSPYTHON +from gevent.testing.sysinfo import PY2 +import gevent.testing.timing + + +assert gevent_socket.gaierror is socket.gaierror +assert gevent_socket.error is socket.error + +DEBUG = os.getenv('GEVENT_DEBUG', '') == 'trace' + + +def _run(function, *args): + try: + result = function(*args) + assert not isinstance(result, BaseException), repr(result) + return result + except Exception as ex: + if DEBUG: + traceback.print_exc() + return ex + + +def format_call(function, args): + args = repr(args) + if args.endswith(',)'): + args = args[:-2] + ')' + try: + module = function.__module__.replace('gevent._socketcommon', 'gevent') + name = function.__name__ + return '%s:%s%s' % (module, name, args) + except AttributeError: + return function + args + + +def log_fresult(result, seconds): + if isinstance(result, Exception): + msg = ' -=> raised %r' % (result, ) + else: + msg = ' -=> returned %r' % (result, ) + time_ms = ' %.2fms' % (seconds * 1000.0, ) + space = 80 - len(msg) - len(time_ms) + if space > 0: + space = ' ' * space + else: + space = '' + log(msg + space + time_ms) + + +def run(function, *args): + if DEBUG: + log(format_call(function, args)) + delta = time() + result = _run(function, *args) + delta = time() - delta + if DEBUG: + log_fresult(result, delta) + return result, delta + + +def log_call(result, runtime, function, *args): + log(format_call(function, args)) + log_fresult(result, runtime) + + +def compare_relaxed(a, b): + """ + >>> compare_relaxed('2a00:1450:400f:801::1010', '2a00:1450:400f:800::1011') + True + + >>> compare_relaxed('2a00:1450:400f:801::1010', '2aXX:1450:400f:900::1011') + False + + >>> compare_relaxed('2a00:1450:4016:800::1013', '2a00:1450:4008:c01::93') + True + + >>> compare_relaxed('2001:470::e852:4a38:9d7f:0', '2001:470:6d00:1c:1::d00') + True + + >>> compare_relaxed('2001:470:4147:4943:6161:6161:2e74:6573', '2001:470::') + True + + >>> compare_relaxed('2607:f8b0:6708:24af:1fd:700:60d4:4af', '2607:f8b0:2d00::f000:0') + True + + >>> compare_relaxed('a.google.com', 'b.google.com') + True + + >>> compare_relaxed('a.google.com', 'a.gevent.org') + False + """ + # IPv6 address from different requests might be different + a_segments = a.count(':') + b_segments = b.count(':') + if a_segments and b_segments: + if a_segments == b_segments and a_segments in (4, 5, 6, 7): + return True + if a.rstrip(':').startswith(b.rstrip(':')) or b.rstrip(':').startswith(a.rstrip(':')): + return True + if a_segments >= 2 and b_segments >= 2 and a.split(':')[:2] == b.split(':')[:2]: + return True + + return a.split('.', 1)[-1] == b.split('.', 1)[-1] + + +def contains_5tuples(lst): + for item in lst: + if not (isinstance(item, tuple) and len(item) == 5): + return False + return True + + +def relaxed_is_equal(a, b): + """ + >>> relaxed_is_equal([(10, 1, 6, '', ('2a00:1450:400f:801::1010', 80, 0, 0))], [(10, 1, 6, '', ('2a00:1450:400f:800::1011', 80, 0, 0))]) + True + + >>> relaxed_is_equal([1, '2'], (1, '2')) + False + + >>> relaxed_is_equal([1, '2'], [1, '2']) + True + + >>> relaxed_is_equal(('wi-in-x93.1e100.net', 'http'), ('we-in-x68.1e100.net', 'http')) + True + """ + if type(a) is not type(b): + return False + if a == b: + return True + if isinstance(a, six.string_types): + return compare_relaxed(a, b) + try: + if len(a) != len(b): + return False + except TypeError: + return False + if contains_5tuples(a) and contains_5tuples(b): + # getaddrinfo results + a = sorted(a) + b = sorted(b) + return all(relaxed_is_equal(x, y) for (x, y) in zip(a, b)) + + +def add(klass, hostname, name=None, + skip=None, skip_reason=None): + + call = callable(hostname) + + def _setattr(k, n, func): + if skip: + func = greentest.skipIf(skip, skip_reason,)(func) + if not hasattr(k, n): + setattr(k, n, func) + + if name is None: + if call: + name = hostname.__name__ + else: + name = re.sub(r'[^\w]+', '_', repr(hostname)) + assert name, repr(hostname) + + def test1(self): + x = hostname() if call else hostname + self._test('getaddrinfo', x, 'http') + test1.__name__ = 'test_%s_getaddrinfo' % name + _setattr(klass, test1.__name__, test1) + + def test2(self): + x = hostname() if call else hostname + ipaddr = self._test('gethostbyname', x) + if not isinstance(ipaddr, Exception): + self._test('gethostbyaddr', ipaddr) + test2.__name__ = 'test_%s_gethostbyname' % name + _setattr(klass, test2.__name__, test2) + + def test3(self): + x = hostname() if call else hostname + self._test('gethostbyname_ex', x) + test3.__name__ = 'test_%s_gethostbyname_ex' % name + _setattr(klass, test3.__name__, test3) + + def test4(self): + x = hostname() if call else hostname + self._test('gethostbyaddr', x) + test4.__name__ = 'test_%s_gethostbyaddr' % name + _setattr(klass, test4.__name__, test4) + + def test5(self): + x = hostname() if call else hostname + self._test('getnameinfo', (x, 80), 0) + test5.__name__ = 'test_%s_getnameinfo' % name + _setattr(klass, test5.__name__, test5) + + +class TestCase(greentest.TestCase): + + __timeout__ = 30 + switch_expected = None + verbose_dns = False + + def should_log_results(self, result1, result2): + if not self.verbose_dns: + return False + + if isinstance(result1, BaseException) and isinstance(result2, BaseException): + return type(result1) is not type(result2) + return repr(result1) != repr(result2) + + def _test(self, func, *args): + gevent_func = getattr(gevent_socket, func) + real_func = monkey.get_original('socket', func) + real_result, time_real = run(real_func, *args) + gevent_result, time_gevent = run(gevent_func, *args) + if not DEBUG and self.should_log_results(real_result, gevent_result): + log('') + log_call(real_result, time_real, real_func, *args) + log_call(gevent_result, time_gevent, gevent_func, *args) + self.assertEqualResults(real_result, gevent_result, func) + + if self.verbose_dns and time_gevent > time_real + 0.01 and time_gevent > 0.02: + msg = 'gevent:%s%s took %dms versus %dms stdlib' % (func, args, time_gevent * 1000.0, time_real * 1000.0) + + if time_gevent > time_real + 1: + word = 'VERY' + else: + word = 'quite' + + log('\nWARNING: %s slow: %s', word, msg) + + return gevent_result + + def _normalize_result(self, result, func_name): + norm_name = '_normalize_result_' + func_name + if hasattr(self, norm_name): + return getattr(self, norm_name)(result) + return result + + def _normalize_result_gethostbyname_ex(self, result): + # Often the second and third part of the tuple (hostname, aliaslist, ipaddrlist) + # can be in different orders if we're hitting different servers, + # or using the native and ares resolvers due to load-balancing techniques. + # We sort them. + if not RESOLVER_NOT_SYSTEM or isinstance(result, BaseException): + return result + # result[1].sort() # we wind up discarding this + + # On Py2 in test_russion_gethostbyname_ex, this + # is actually an integer, for some reason. In TestLocalhost.tets__ip6_localhost, + # the result isn't this long (maybe an error?). + try: + result[2].sort() + except AttributeError: + pass + except IndexError: + return result + # On some systems, a random alias is found in the aliaslist + # by the system resolver, but not by cares, and vice versa. We deem the aliaslist + # unimportant and discard it. + # On some systems (Travis CI), the ipaddrlist for 'localhost' can come back + # with two entries 127.0.0.1 (presumably two interfaces?) for c-ares + ips = result[2] + if ips == ['127.0.0.1', '127.0.0.1']: + ips = ['127.0.0.1'] + # On some systems, the hostname can get caps + return (result[0].lower(), [], ips) + + def _normalize_result_getaddrinfo(self, result): + if not RESOLVER_NOT_SYSTEM: + return result + # On Python 3, the builtin resolver can return SOCK_RAW results, but + # c-ares doesn't do that. So we remove those if we find them. + if hasattr(socket, 'SOCK_RAW') and isinstance(result, list): + result = [x for x in result if x[1] != socket.SOCK_RAW] + if isinstance(result, list): + result.sort() + return result + + def _normalize_result_gethostbyaddr(self, result): + if not RESOLVER_NOT_SYSTEM: + return result + + if isinstance(result, tuple): + # On some systems, a random alias is found in the aliaslist + # by the system resolver, but not by cares and vice versa. We deem the aliaslist + # unimportant and discard it. + return (result[0], [], result[2]) + return result + + def assertEqualResults(self, real_result, gevent_result, func): + errors = (socket.gaierror, socket.herror, TypeError) + if isinstance(real_result, errors) and isinstance(gevent_result, errors): + if type(real_result) is not type(gevent_result): + log('WARNING: error type mismatch: %r (gevent) != %r (stdlib)', gevent_result, real_result) + return + + real_result = self._normalize_result(real_result, func) + gevent_result = self._normalize_result(gevent_result, func) + + real_result_repr = repr(real_result) + gevent_result_repr = repr(gevent_result) + if real_result_repr == gevent_result_repr: + return + if relaxed_is_equal(gevent_result, real_result): + return + + # If we're using the ares resolver, allow the real resolver to generate an + # error that the ares resolver actually gets an answer to. + + if ( + RESOLVER_NOT_SYSTEM + and isinstance(real_result, errors) + and not isinstance(gevent_result, errors) + ): + return + + # From 2.7 on, assertEqual does a better job highlighting the results than we would + # because it calls assertSequenceEqual, which highlights the exact + # difference in the tuple + self.assertEqual(real_result, gevent_result) + + +class TestTypeError(TestCase): + pass + +add(TestTypeError, None) +add(TestTypeError, 25) + + +class TestHostname(TestCase): + pass + +add(TestHostname, socket.gethostname) + + +class TestLocalhost(TestCase): + # certain tests in test_patched_socket.py only work if getaddrinfo('localhost') does not switch + # (e.g. NetworkConnectionAttributesTest.testSourceAddress) + #switch_expected = False + # XXX: The above has been commented out for some time. Apparently this isn't the case + # anymore. + + def _normalize_result_getaddrinfo(self, result): + if RESOLVER_NOT_SYSTEM: + # We see that some impls (OS X) return extra results + # like DGRAM that ares does not. + return () + return super(TestLocalhost, self)._normalize_result_getaddrinfo(result) + + if greentest.RUNNING_ON_TRAVIS and greentest.PY2 and RESOLVER_NOT_SYSTEM: + def _normalize_result_gethostbyaddr(self, result): + # Beginning in November 2017 after an upgrade to Travis, + # we started seeing ares return ::1 for localhost, but + # the system resolver is still returning 127.0.0.1 under Python 2 + result = super(TestLocalhost, self)._normalize_result_gethostbyaddr(result) + if isinstance(result, tuple): + result = (result[0], result[1], ['127.0.0.1']) + return result + + +add( + TestLocalhost, 'ip6-localhost', + skip=greentest.RUNNING_ON_TRAVIS, + skip_reason="ares fails here, for some reason, presumably a badly " + "configured /etc/hosts" +) +add( + TestLocalhost, 'localhost', + skip=greentest.RUNNING_ON_TRAVIS, + skip_reason="Beginning Dec 1 2017, ares started returning ip6-localhost " + "instead of localhost" +) + + +class TestNonexistent(TestCase): + pass + +add(TestNonexistent, 'nonexistentxxxyyy') + + +class Test1234(TestCase): + pass + +add(Test1234, '1.2.3.4') + + +class Test127001(TestCase): + pass + +add( + Test127001, '127.0.0.1', + skip=greentest.RUNNING_ON_TRAVIS, + skip_reason="Beginning Dec 1 2017, ares started returning ip6-localhost " + "instead of localhost" +) + + + +class TestBroadcast(TestCase): + switch_expected = False + + if RESOLVER_NOT_SYSTEM: + # ares and dnspython raises errors for broadcasthost/255.255.255.255 + + @unittest.skip('ares raises errors for broadcasthost/255.255.255.255') + def test__broadcast__gethostbyaddr(self): + return + + test__broadcast__gethostbyname = test__broadcast__gethostbyaddr + +add(TestBroadcast, '') + + +from gevent.resolver.dnspython import HostsFile +class SanitizedHostsFile(HostsFile): + def iter_all_host_addr_pairs(self): + for name, addr in super(SanitizedHostsFile, self).iter_all_host_addr_pairs(): + if (RESOLVER_NOT_SYSTEM + and (name.endswith('local') # ignore bonjour, ares can't find them + # ignore common aliases that ares can't find + or addr == '255.255.255.255' + or name == 'broadcasthost' + # We get extra results from some impls, like OS X + # it returns DGRAM results + or name == 'localhost')): + continue # pragma: no cover + if name.endswith('local'): + # These can only be found if bonjour is running, + # and are very slow to do so with the system resolver on OS X + continue + yield name, addr + +@greentest.skipIf(greentest.RUNNING_ON_CI, + "This sometimes randomly fails on Travis with ares and on appveyor, beginning Feb 13, 2018") +# Probably due to round-robin DNS, +# since this is not actually the system's etc hosts file. +# TODO: Rethink this. We need something reliable. Go back to using +# the system's etc hosts? +class TestEtcHosts(TestCase): + + MAX_HOSTS = int(os.getenv('GEVENTTEST_MAX_ETC_HOSTS', '10')) + + @classmethod + def populate_tests(cls): + hf = SanitizedHostsFile(os.path.join(os.path.dirname(__file__), + 'hosts_file.txt')) + all_etc_hosts = sorted(hf.iter_all_host_addr_pairs()) + if len(all_etc_hosts) > cls.MAX_HOSTS and not DEBUG: + all_etc_hosts = all_etc_hosts[:cls.MAX_HOSTS] + + for host, ip in all_etc_hosts: + add(cls, host) + add(cls, ip) + + + +TestEtcHosts.populate_tests() + + + +class TestGeventOrg(TestCase): + + HOSTNAME = 'www.gevent.org' + +# For this test to work correctly, it needs to resolve to +# an address with a single A record; round-robin DNS and multiple A records +# may mess it up (subsequent requests---and we always make two---may return +# unequal results). We used to use gevent.org, but that now has multiple A records; +# trying www.gevent.org which is a CNAME to readthedocs.org. +add(TestGeventOrg, TestGeventOrg.HOSTNAME) + + +class TestFamily(TestCase): + + @classmethod + def getresult(cls): + if not hasattr(cls, '_result'): + cls._result = getattr(socket, 'getaddrinfo')(TestGeventOrg.HOSTNAME, None) + return cls._result + + def test_inet(self): + self.assertEqualResults(self.getresult(), + gevent_socket.getaddrinfo(TestGeventOrg.HOSTNAME, None, socket.AF_INET), + 'getaddrinfo') + + def test_unspec(self): + self.assertEqualResults(self.getresult(), + gevent_socket.getaddrinfo(TestGeventOrg.HOSTNAME, None, socket.AF_UNSPEC), + 'getaddrinfo') + + def test_badvalue(self): + self._test('getaddrinfo', TestGeventOrg.HOSTNAME, None, 255) + self._test('getaddrinfo', TestGeventOrg.HOSTNAME, None, 255000) + self._test('getaddrinfo', TestGeventOrg.HOSTNAME, None, -1) + + def test_badtype(self): + self._test('getaddrinfo', TestGeventOrg.HOSTNAME, 'x') + + +class Test_getaddrinfo(TestCase): + + def _test_getaddrinfo(self, *args): + self._test('getaddrinfo', *args) + + def test_80(self): + self._test_getaddrinfo(TestGeventOrg.HOSTNAME, 80) + + def test_int_string(self): + self._test_getaddrinfo(TestGeventOrg.HOSTNAME, '80') + + def test_0(self): + self._test_getaddrinfo(TestGeventOrg.HOSTNAME, 0) + + def test_http(self): + self._test_getaddrinfo(TestGeventOrg.HOSTNAME, 'http') + + def test_notexistent_tld(self): + self._test_getaddrinfo('myhost.mytld', 53) + + def test_notexistent_dot_com(self): + self._test_getaddrinfo('sdfsdfgu5e66098032453245wfdggd.com', 80) + + def test1(self): + return self._test_getaddrinfo(TestGeventOrg.HOSTNAME, 52, socket.AF_UNSPEC, socket.SOCK_STREAM, 0, 0) + + def test2(self): + return self._test_getaddrinfo(TestGeventOrg.HOSTNAME, 53, socket.AF_INET, socket.SOCK_DGRAM, 17) + + @unittest.skipIf(RESOLVER_DNSPYTHON, + "dnspython only returns some of the possibilities") + def test3(self): + return self._test_getaddrinfo('google.com', 'http', socket.AF_INET6) + + + @greentest.skipIf(PY2, "Enums only on Python 3.4+") + def test_enums(self): + # https://github.com/gevent/gevent/issues/1310 + + # On Python 3, getaddrinfo does special things to make sure that + # the fancy enums are returned. + + gai = gevent_socket.getaddrinfo('example.com', 80, + socket.AF_INET, + socket.SOCK_STREAM, socket.IPPROTO_TCP) + af, socktype, _proto, _canonname, _sa = gai[0] + self.assertIs(socktype, socket.SOCK_STREAM) + self.assertIs(af, socket.AF_INET) + +class TestInternational(TestCase): + pass + +# dns python can actually resolve these: it uses +# the 2008 version of idna encoding, whereas on Python 2, +# with the default resolver, it tries to encode to ascii and +# raises a UnicodeEncodeError. So we get different results. +add(TestInternational, u'президент.рф', 'russian', + skip=(PY2 and RESOLVER_DNSPYTHON), skip_reason="dnspython can actually resolve these") +add(TestInternational, u'президент.рф'.encode('idna'), 'idna') + + +class TestInterrupted_gethostbyname(gevent.testing.timing.AbstractGenericWaitTestCase): + + # There are refs to a Waiter in the C code that don't go + # away yet; one gc may or may not do it. + @greentest.ignores_leakcheck + def test_returns_none_after_timeout(self): + super(TestInterrupted_gethostbyname, self).test_returns_none_after_timeout() + + def wait(self, timeout): + with gevent.Timeout(timeout, False): + for index in xrange(1000000): + try: + gevent_socket.gethostbyname('www.x%s.com' % index) + except socket.error: + pass + raise AssertionError('Timeout was not raised') + + def cleanup(self): + # Depending on timing, this can raise: + # (This suddenly started happening on Apr 6 2016; www.x1000000.com + # is apparently no longer around) + + # File "test__socket_dns.py", line 538, in cleanup + # gevent.get_hub().threadpool.join() + # File "/home/travis/build/gevent/gevent/src/gevent/threadpool.py", line 108, in join + # sleep(delay) + # File "/home/travis/build/gevent/gevent/src/gevent/hub.py", line 169, in sleep + # hub.wait(loop.timer(seconds, ref=ref)) + # File "/home/travis/build/gevent/gevent/src/gevent/hub.py", line 651, in wait + # result = waiter.get() + # File "/home/travis/build/gevent/gevent/src/gevent/hub.py", line 899, in get + # return self.hub.switch() + # File "/home/travis/build/gevent/gevent/src/greentest/greentest.py", line 520, in switch + # return _original_Hub.switch(self, *args) + # File "/home/travis/build/gevent/gevent/src/gevent/hub.py", line 630, in switch + # return RawGreenlet.switch(self) + # gaierror: [Errno -2] Name or service not known + try: + gevent.get_hub().threadpool.join() + except Exception: # pragma: no cover pylint:disable=broad-except + traceback.print_exc() + + +# class TestInterrupted_getaddrinfo(greentest.GenericWaitTestCase): +# +# def wait(self, timeout): +# with gevent.Timeout(timeout, False): +# for index in range(1000): +# try: +# gevent_socket.getaddrinfo('www.a%s.com' % index, 'http') +# except socket.gaierror: +# pass + + +class TestBadName(TestCase): + pass + +add(TestBadName, 'xxxxxxxxxxxx') + + +class TestBadIP(TestCase): + pass + +add(TestBadIP, '1.2.3.400') + + +@greentest.skipIf(greentest.RUNNING_ON_TRAVIS, "Travis began returning ip6-localhost") +class Test_getnameinfo_127001(TestCase): + + def test(self): + self._test('getnameinfo', ('127.0.0.1', 80), 0) + + def test_DGRAM(self): + self._test('getnameinfo', ('127.0.0.1', 779), 0) + self._test('getnameinfo', ('127.0.0.1', 779), socket.NI_DGRAM) + + def test_NOFQDN(self): + # I get ('localhost', 'www') with _socket but ('localhost.localdomain', 'www') with gevent.socket + self._test('getnameinfo', ('127.0.0.1', 80), socket.NI_NOFQDN) + + def test_NAMEREQD(self): + self._test('getnameinfo', ('127.0.0.1', 80), socket.NI_NAMEREQD) + + +class Test_getnameinfo_geventorg(TestCase): + + def test_NUMERICHOST(self): + self._test('getnameinfo', (TestGeventOrg.HOSTNAME, 80), 0) + self._test('getnameinfo', (TestGeventOrg.HOSTNAME, 80), socket.NI_NUMERICHOST) + + def test_NUMERICSERV(self): + self._test('getnameinfo', (TestGeventOrg.HOSTNAME, 80), socket.NI_NUMERICSERV) + + def test_domain1(self): + self._test('getnameinfo', (TestGeventOrg.HOSTNAME, 80), 0) + + def test_domain2(self): + self._test('getnameinfo', ('www.gevent.org', 80), 0) + + def test_port_zero(self): + self._test('getnameinfo', ('www.gevent.org', 0), 0) + + +class Test_getnameinfo_fail(TestCase): + + def test_port_string(self): + self._test('getnameinfo', ('www.gevent.org', 'http'), 0) + + def test_bad_flags(self): + self._test('getnameinfo', ('localhost', 80), 55555555) + + +class TestInvalidPort(TestCase): + + def test1(self): + self._test('getnameinfo', ('www.gevent.org', -1), 0) + + def test2(self): + self._test('getnameinfo', ('www.gevent.org', None), 0) + + def test3(self): + self._test('getnameinfo', ('www.gevent.org', 'x'), 0) + + @unittest.skipIf(RESOLVER_DNSPYTHON, + "System resolvers do funny things with this: macOS raises gaierror, " + "Travis CI returns (readthedocs.org, '0'). It's hard to match that exactly. " + "dnspython raises OverflowError.") + def test4(self): + self._test('getnameinfo', ('www.gevent.org', 65536), 0) + + +if __name__ == '__main__': + greentest.main() diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__socket_dns6.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__socket_dns6.py new file mode 100644 index 00000000..6a706d8c --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__socket_dns6.py @@ -0,0 +1,81 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- +from __future__ import print_function, absolute_import, division + +import gevent.testing as greentest +import socket +from gevent.tests.test__socket_dns import TestCase, add + +from gevent.testing.sysinfo import RESOLVER_NOT_SYSTEM +from gevent.testing.sysinfo import RESOLVER_DNSPYTHON + +if not greentest.RUNNING_ON_CI and not RESOLVER_DNSPYTHON: + + + # We can't control the DNS servers we use there + # for the system. This works best with the google DNS servers + # The getnameinfo test can fail on CI. + + # Previously only Test6_ds failed, but as of Jan 2018, Test6 + # and Test6_google begin to fail: + + # First differing element 0: + # 'vm2.test-ipv6.com' + # 'ip119.gigo.com' + + # - ('vm2.test-ipv6.com', [], ['2001:470:1:18::125']) + # ? --------- ^^ ^^ + + # + ('ip119.gigo.com', [], ['2001:470:1:18::119']) + # ? ^^^^^^^^ ^^ + + class Test6(TestCase): + + # host that only has AAAA record + host = 'aaaa.test-ipv6.com' + + def test_empty(self): + self._test('getaddrinfo', self.host, 'http') + + def test_inet(self): + self._test('getaddrinfo', self.host, None, socket.AF_INET) + + def test_inet6(self): + self._test('getaddrinfo', self.host, None, socket.AF_INET6) + + def test_unspec(self): + self._test('getaddrinfo', self.host, None, socket.AF_UNSPEC) + + + class Test6_google(Test6): + host = 'ipv6.google.com' + + def _normalize_result_getnameinfo(self, result): + if greentest.RUNNING_ON_CI and RESOLVER_NOT_SYSTEM: + # Disabled, there are multiple possibilities + # and we can get different ones, rarely. + return () + return result + + add(Test6, Test6.host) + add(Test6_google, Test6_google.host) + + + + class Test6_ds(Test6): + # host that has both A and AAAA records + host = 'ds.test-ipv6.com' + + def _normalize_result_gethostbyaddr(self, result): + # This test is effectively disabled. There are multiple address + # that resolve and which ones you get depend on the settings + # of the system and ares. They don't match exactly. + return () + + _normalize_result_gethostbyname = _normalize_result_gethostbyaddr + + add(Test6_ds, Test6_ds.host) + + +if __name__ == '__main__': + greentest.main() diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__socket_errors.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__socket_errors.py new file mode 100644 index 00000000..fec07ddb --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__socket_errors.py @@ -0,0 +1,46 @@ +# Copyright (c) 2008-2009 AG Projects +# Author: Denis Bilenko +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. + +import gevent.testing as greentest +from gevent.socket import socket, error + +try: + from errno import WSAECONNREFUSED as ECONNREFUSED +except ImportError: + from errno import ECONNREFUSED + + +class TestSocketErrors(greentest.TestCase): + + __timeout__ = 5 + + def test_connection_refused(self): + s = socket() + self._close_on_teardown(s) + try: + s.connect(('127.0.0.1', 81)) + except error as ex: + assert ex.args[0] == ECONNREFUSED, repr(ex) + assert 'refused' in str(ex).lower(), str(ex) + + +if __name__ == '__main__': + greentest.main() diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__socket_ex.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__socket_ex.py new file mode 100644 index 00000000..0926ff69 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__socket_ex.py @@ -0,0 +1,43 @@ +import gevent.testing as greentest +from gevent import socket +import errno +import sys + + +class TestClosedSocket(greentest.TestCase): + + switch_expected = False + + def test(self): + sock = socket.socket() + sock.close() + try: + sock.send(b'a', timeout=1) + raise AssertionError("Should not get here") + except (socket.error, OSError) as ex: + if ex.args[0] != errno.EBADF: + if sys.platform.startswith('win'): + # Windows/Py3 raises "OSError: [WinError 10038] " + # which is not standard and not what it does + # on Py2. + pass + else: + raise + + +class TestRef(greentest.TestCase): + + switch_expected = False + + def test(self): + sock = socket.socket() + assert sock.ref is True, sock.ref + sock.ref = False + assert sock.ref is False, sock.ref + assert sock._read_event.ref is False, sock.ref + assert sock._write_event.ref is False, sock.ref + sock.close() + + +if __name__ == '__main__': + greentest.main() diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__socket_send_memoryview.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__socket_send_memoryview.py new file mode 100644 index 00000000..c979fe23 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__socket_send_memoryview.py @@ -0,0 +1,39 @@ +# See issue #466 +import unittest +import ctypes + + +class AnStructure(ctypes.Structure): + _fields_ = [("x", ctypes.c_int)] + + +def _send(socket): + for meth in ('sendall', 'send'): + anStructure = AnStructure() + sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) + sock.connect(('127.0.0.1', 12345)) + getattr(sock, meth)(anStructure) + sock.close() + + sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) + sock.connect(('127.0.0.1', 12345)) + sock.settimeout(1.0) + getattr(sock, meth)(anStructure) + sock.close() + +class TestSendBuiltinSocket(unittest.TestCase): + + def test_send(self): + import socket + _send(socket) + + +class TestSendGeventSocket(unittest.TestCase): + + def test_send(self): + import gevent.socket + _send(gevent.socket) + + +if __name__ == '__main__': + unittest.main() diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__socket_ssl.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__socket_ssl.py new file mode 100644 index 00000000..8f479400 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__socket_ssl.py @@ -0,0 +1,39 @@ +#!/usr/bin/python +from gevent import monkey +monkey.patch_all() + +import unittest +try: + import httplib +except ImportError: + from http import client as httplib +import socket + + +import gevent.testing as greentest + + +@unittest.skipUnless( + hasattr(socket, 'ssl'), + "Needs socket.ssl" +) +class AmazonHTTPSTests(greentest.TestCase): + + __timeout__ = 30 + + def test_amazon_response(self): + conn = httplib.HTTPSConnection('sdb.amazonaws.com') + conn.debuglevel = 1 + conn.request('GET', '/') + conn.getresponse() + + def test_str_and_repr(self): + conn = socket.socket() + conn.connect(('sdb.amazonaws.com', 443)) + ssl_conn = socket.ssl(conn) # pylint:disable=no-member + assert str(ssl_conn) + assert repr(ssl_conn) + + +if __name__ == "__main__": + greentest.main() diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__socket_timeout.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__socket_timeout.py new file mode 100644 index 00000000..f98d1bb4 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__socket_timeout.py @@ -0,0 +1,54 @@ +import gevent +from gevent import socket +import gevent.testing as greentest + + +class Test(greentest.TestCase): + + server = None + acceptor = None + server_port = None + + def _accept(self): + self.server.listen(1) + try: + conn, _ = self.server.accept() + self._close_on_teardown(conn) + except socket.error: + pass + + def setUp(self): + super(Test, self).setUp() + self.server = socket.socket() + self._close_on_teardown(self.server) + self.server.bind(('127.0.0.1', 0)) + self.server_port = self.server.getsockname()[1] + self.acceptor = gevent.spawn(self._accept) + gevent.sleep(0) + + def tearDown(self): + if self.acceptor is not None: + self.acceptor.kill() + self.acceptor = None + if self.server is not None: + self.server.close() + self.server = None + super(Test, self).tearDown() + + def test_timeout(self): + gevent.sleep(0) + sock = socket.socket() + self._close_on_teardown(sock) + sock.connect(('127.0.0.1', self.server_port)) + + sock.settimeout(0.1) + with self.assertRaises(socket.error) as cm: + sock.recv(1024) + + ex = cm.exception + self.assertEqual(ex.args, ('timed out',)) + self.assertEqual(str(ex), 'timed out') + + +if __name__ == '__main__': + greentest.main() diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__socketpair.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__socketpair.py new file mode 100644 index 00000000..308f033c --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__socketpair.py @@ -0,0 +1,35 @@ +from gevent import monkey; monkey.patch_all() +import socket +import unittest + + +class TestSocketpair(unittest.TestCase): + + def test_makefile(self): + msg = b'hello world' + x, y = socket.socketpair() + x.sendall(msg) + x.close() + with y.makefile('rb') as f: + read = f.read() + self.assertEqual(msg, read) + y.close() + + def test_fromfd(self): + msg = b'hello world' + x, y = socket.socketpair() + xx = socket.fromfd(x.fileno(), x.family, socket.SOCK_STREAM) + x.close() + yy = socket.fromfd(y.fileno(), y.family, socket.SOCK_STREAM) + y.close() + + xx.sendall(msg) + xx.close() + with yy.makefile('rb') as f: + read = f.read() + self.assertEqual(msg, read) + yy.close() + + +if __name__ == '__main__': + unittest.main() diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__ssl.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__ssl.py new file mode 100644 index 00000000..e2b4df7c --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__ssl.py @@ -0,0 +1,104 @@ +from gevent import monkey; monkey.patch_all() +import os + +import socket +import gevent.testing as greentest +# Be careful not to have TestTCP as a bare attribute in this module, +# even aliased, to avoid running duplicate tests +import test__socket +import ssl + + +import unittest +from gevent.hub import LoopExit + +class TestSSL(test__socket.TestTCP): + + certfile = os.path.join(os.path.dirname(__file__), 'test_server.crt') + privfile = os.path.join(os.path.dirname(__file__), 'test_server.key') + # Python 2.x has socket.sslerror (which is an alias for + # ssl.SSLError); That's gone in Py3 though. In Python 2, most timeouts are raised + # as SSLError, but Python 3 raises the normal socket.timeout instead. So this has + # the effect of making TIMEOUT_ERROR be SSLError on Py2 and socket.timeout on Py3 + # See https://bugs.python.org/issue10272 + TIMEOUT_ERROR = getattr(socket, 'sslerror', socket.timeout) + + def _setup_listener(self): + listener, raw_listener = ssl_listener(('127.0.0.1', 0), self.privfile, self.certfile) + self._close_on_teardown(raw_listener) + return listener + + def create_connection(self, *args, **kwargs): # pylint:disable=arguments-differ + return ssl.wrap_socket(super(TestSSL, self).create_connection(*args, **kwargs)) + + # The SSL library can take a long time to buffer the large amount of data we're trying + # to send, so we can't compare to the timeout values + _test_sendall_timeout_check_time = False + + # The SSL layer has extra buffering, so test_sendall needs + # to send a very large amount to make it timeout + _test_sendall_data = data_sent = b'hello' * 100000000 + + @greentest.skipOnWindows("Not clear why we're skipping") + def test_ssl_sendall_timeout0(self): + # Issue #317: SSL_WRITE_PENDING in some corner cases + + server_sock = [] + acceptor = test__socket.Thread(target=lambda: server_sock.append(self.listener.accept())) + client = self.create_connection() + client.setblocking(False) + try: + # Python 3 raises ssl.SSLWantWriteError; Python 2 simply *hangs* + # on non-blocking sockets because it's a simple loop around + # send(). Python 2.6 doesn't have SSLWantWriteError + expected = getattr(ssl, 'SSLWantWriteError', ssl.SSLError) + with self.assertRaises(expected): + client.sendall(self._test_sendall_data) + finally: + acceptor.join() + client.close() + server_sock[0][0].close() + + def test_fullduplex(self): + try: + super(TestSSL, self).test_fullduplex() + except LoopExit: + if greentest.LIBUV and greentest.WIN: + # XXX: Unable to duplicate locally + raise unittest.SkipTest("libuv on Windows sometimes raises LoopExit") + raise + + + @greentest.ignores_leakcheck + def test_empty_send(self): + # Issue 719 + # Sending empty bytes with the 'send' method raises + # ssl.SSLEOFError in the stdlib. PyPy 4.0 and CPython 2.6 + # both just raise the superclass, ssl.SSLError. + + # Ignored during leakchecks because the third or fourth iteration of the + # test hangs on CPython 2/posix for some reason, likely due to + # the use of _close_on_teardown keeping something alive longer than intended. + # cf test__makefile_ref + with self.assertRaises(ssl.SSLError): + super(TestSSL, self).test_empty_send() + + @greentest.ignores_leakcheck + def test_sendall_nonblocking(self): + # Override; doesn't work with SSL sockets. + pass + + @greentest.ignores_leakcheck + def test_connect_with_type_flags_ignored(self): + # Override; doesn't work with SSL sockets. + pass + +def ssl_listener(address, private_key, certificate): + raw_listener = socket.socket() + greentest.bind_and_listen(raw_listener, address) + sock = ssl.wrap_socket(raw_listener, private_key, certificate) + return sock, raw_listener + + +if __name__ == '__main__': + greentest.main() diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__subprocess.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__subprocess.py new file mode 100644 index 00000000..da5d2d52 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__subprocess.py @@ -0,0 +1,491 @@ +import sys +import os +import errno +import unittest + +import time +import gc +import tempfile + +import gevent.testing as greentest +import gevent +from gevent.testing import mock +from gevent import subprocess + +if not hasattr(subprocess, 'mswindows'): + # PyPy3, native python subprocess + subprocess.mswindows = False + + +PYPY = hasattr(sys, 'pypy_version_info') +PY3 = sys.version_info[0] >= 3 + + +if subprocess.mswindows: + SETBINARY = 'import msvcrt; msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY);' +else: + SETBINARY = '' + + +python_universal_newlines = hasattr(sys.stdout, 'newlines') +# The stdlib of Python 3 on Windows doesn't properly handle universal newlines +# (it produces broken results compared to Python 2) +# See gevent.subprocess for more details. +python_universal_newlines_broken = PY3 and subprocess.mswindows + + +class Test(greentest.TestCase): + + def setUp(self): + super(Test, self).setUp() + gc.collect() + gc.collect() + + def test_exit(self): + popen = subprocess.Popen([sys.executable, '-c', 'import sys; sys.exit(10)']) + self.assertEqual(popen.wait(), 10) + + def test_wait(self): + popen = subprocess.Popen([sys.executable, '-c', 'import sys; sys.exit(11)']) + gevent.wait([popen]) + self.assertEqual(popen.poll(), 11) + + def test_child_exception(self): + try: + subprocess.Popen(['*']).wait() + except OSError as ex: + assert ex.errno == 2, ex + else: + raise AssertionError('Expected OSError: [Errno 2] No such file or directory') + + def test_leak(self): + num_before = greentest.get_number_open_files() + p = subprocess.Popen([sys.executable, "-c", "print()"], + stdout=subprocess.PIPE) + p.wait() + p.stdout.close() + del p + if PYPY: + gc.collect() + gc.collect() + + num_after = greentest.get_number_open_files() + self.assertEqual(num_before, num_after) + + @greentest.skipOnLibuvOnPyPyOnWin("hangs") + def test_communicate(self): + p = subprocess.Popen([sys.executable, "-W", "ignore", + "-c", + 'import sys,os;' + 'sys.stderr.write("pineapple");' + 'sys.stdout.write(sys.stdin.read())'], + stdin=subprocess.PIPE, + stdout=subprocess.PIPE, + stderr=subprocess.PIPE) + (stdout, stderr) = p.communicate(b"banana") + self.assertEqual(stdout, b"banana") + if sys.executable.endswith('-dbg'): + assert stderr.startswith(b'pineapple') + else: + self.assertEqual(stderr, b"pineapple") + + @greentest.skipIf(subprocess.mswindows, + "Windows does weird things here") + @greentest.skipOnLibuvOnCIOnPyPy("Sometimes segfaults") + def test_communicate_universal(self): + # Native string all the things. See https://github.com/gevent/gevent/issues/1039 + p = subprocess.Popen( + [ + sys.executable, + "-W", "ignore", + "-c", + 'import sys,os;' + 'sys.stderr.write("pineapple\\r\\n\\xff\\xff\\xf2\\xf9\\r\\n");' + 'sys.stdout.write(sys.stdin.read())' + ], + stdin=subprocess.PIPE, + stdout=subprocess.PIPE, + stderr=subprocess.PIPE, + universal_newlines=True) + (stdout, stderr) = p.communicate('banana\r\n\xff\xff\xf2\xf9\r\n') + self.assertIsInstance(stdout, str) + self.assertIsInstance(stderr, str) + self.assertEqual(stdout, + 'banana\n\xff\xff\xf2\xf9\n') + + self.assertEqual(stderr, + 'pineapple\n\xff\xff\xf2\xf9\n') + + @greentest.skipOnLibuvOnPyPyOnWin("hangs") + def test_universal1(self): + p = subprocess.Popen([sys.executable, "-c", + 'import sys,os;' + SETBINARY + + 'sys.stdout.write("line1\\n");' + 'sys.stdout.flush();' + 'sys.stdout.write("line2\\r");' + 'sys.stdout.flush();' + 'sys.stdout.write("line3\\r\\n");' + 'sys.stdout.flush();' + 'sys.stdout.write("line4\\r");' + 'sys.stdout.flush();' + 'sys.stdout.write("\\nline5");' + 'sys.stdout.flush();' + 'sys.stdout.write("\\nline6");'], + stdout=subprocess.PIPE, + universal_newlines=1, + bufsize=1) + try: + stdout = p.stdout.read() + if python_universal_newlines: + # Interpreter with universal newline support + if not python_universal_newlines_broken: + self.assertEqual(stdout, + "line1\nline2\nline3\nline4\nline5\nline6") + else: + # Note the extra newline after line 3 + self.assertEqual(stdout, + 'line1\nline2\nline3\n\nline4\n\nline5\nline6') + else: + # Interpreter without universal newline support + self.assertEqual(stdout, + "line1\nline2\rline3\r\nline4\r\nline5\nline6") + finally: + p.stdout.close() + + @greentest.skipOnLibuvOnPyPyOnWin("hangs") + def test_universal2(self): + p = subprocess.Popen([sys.executable, "-c", + 'import sys,os;' + SETBINARY + + 'sys.stdout.write("line1\\n");' + 'sys.stdout.flush();' + 'sys.stdout.write("line2\\r");' + 'sys.stdout.flush();' + 'sys.stdout.write("line3\\r\\n");' + 'sys.stdout.flush();' + 'sys.stdout.write("line4\\r\\nline5");' + 'sys.stdout.flush();' + 'sys.stdout.write("\\nline6");'], + stdout=subprocess.PIPE, + universal_newlines=1, + bufsize=1) + try: + stdout = p.stdout.read() + if python_universal_newlines: + # Interpreter with universal newline support + if not python_universal_newlines_broken: + self.assertEqual(stdout, + "line1\nline2\nline3\nline4\nline5\nline6") + else: + # Note the extra newline after line 3 + self.assertEqual(stdout, + 'line1\nline2\nline3\n\nline4\n\nline5\nline6') + else: + # Interpreter without universal newline support + self.assertEqual(stdout, + "line1\nline2\rline3\r\nline4\r\nline5\nline6") + finally: + p.stdout.close() + + if sys.platform != 'win32': + + def test_nonblock_removed(self): + # see issue #134 + r, w = os.pipe() + stdin = subprocess.FileObject(r) + p = subprocess.Popen(['grep', 'text'], stdin=stdin) + try: + # Closing one half of the pipe causes Python 3 on OS X to terminate the + # child process; it exits with code 1 and the assert that p.poll is None + # fails. Removing the close lets it pass under both Python 3 and 2.7. + # If subprocess.Popen._remove_nonblock_flag is changed to a noop, then + # the test fails (as expected) even with the close removed + #os.close(w) + time.sleep(0.1) + self.assertEqual(p.poll(), None) + finally: + if p.poll() is None: + p.kill() + stdin.close() + os.close(w) + + def test_issue148(self): + for _ in range(7): + try: + subprocess.Popen('this_name_must_not_exist') + except OSError as ex: + if ex.errno != errno.ENOENT: + raise + else: + raise AssertionError('must fail with ENOENT') + + @greentest.skipOnLibuvOnPyPyOnWin("hangs") + def test_check_output_keyword_error(self): + try: + subprocess.check_output([sys.executable, '-c', 'import sys; sys.exit(44)']) + except subprocess.CalledProcessError as e: # pylint:disable=no-member + self.assertEqual(e.returncode, 44) + else: + raise AssertionError('must fail with CalledProcessError') + + def test_popen_bufsize(self): + # Test that subprocess has unbuffered output by default + # (as the vanilla subprocess module) + if PY3: + # The default changed under python 3. + return + p = subprocess.Popen([sys.executable, '-u', '-c', + 'import sys; sys.stdout.write(sys.stdin.readline())'], + stdin=subprocess.PIPE, stdout=subprocess.PIPE) + p.stdin.write(b'foobar\n') + r = p.stdout.readline() + self.assertEqual(r, b'foobar\n') + + @greentest.ignores_leakcheck + @greentest.skipOnWindows("Not sure why?") + def test_subprocess_in_native_thread(self): + # gevent.subprocess doesn't work from a background + # native thread. See #688 + from gevent import monkey + + # must be a native thread; defend against monkey-patching + ex = [] + Thread = monkey.get_original('threading', 'Thread') + + def fn(): + with self.assertRaises(TypeError) as exc: + gevent.subprocess.Popen('echo 123', shell=True) + raise AssertionError("Should not be able to construct Popen") + ex.append(exc.exception) + + thread = Thread(target=fn) + thread.start() + thread.join() + + self.assertEqual(len(ex), 1) + self.assertTrue(isinstance(ex[0], TypeError), ex) + self.assertEqual(ex[0].args[0], 'child watchers are only available on the default loop') + + + @greentest.skipOnLibuvOnPyPyOnWin("hangs") + def __test_no_output(self, kwargs, kind): + proc = subprocess.Popen([sys.executable, '-c', 'pass'], + stdout=subprocess.PIPE, + **kwargs) + stdout, stderr = proc.communicate() + + self.assertIsInstance(stdout, kind) + self.assertIsNone(stderr) + + @greentest.skipOnLibuvOnCIOnPyPy("Sometimes segfaults; " + "https://travis-ci.org/gevent/gevent/jobs/327357682") + def test_universal_newlines_text_mode_no_output_is_always_str(self): + # If the file is in universal_newlines mode, we should always get a str when + # there is no output. + # https://github.com/gevent/gevent/pull/939 + self.__test_no_output({'universal_newlines': True}, str) + + @greentest.skipIf(sys.version_info[:2] < (3, 6), "Need encoding argument") + def test_encoded_text_mode_no_output_is_str(self): + # If the file is in universal_newlines mode, we should always get a str when + # there is no output. + # https://github.com/gevent/gevent/pull/939 + self.__test_no_output({'encoding': 'utf-8'}, str) + + def test_default_mode_no_output_is_always_str(self): + # If the file is in default mode, we should always get a str when + # there is no output. + # https://github.com/gevent/gevent/pull/939 + self.__test_no_output({}, bytes) + +@greentest.skipOnWindows("Testing POSIX fd closing") +class TestFDs(unittest.TestCase): + + @mock.patch('os.closerange') + @mock.patch('gevent.subprocess._set_inheritable') + @mock.patch('os.close') + def test_close_fds_brute_force(self, close, set_inheritable, closerange): + keep = ( + 4, 5, + # Leave a hole + # 6, + 7, + ) + subprocess.Popen._close_fds_brute_force(keep, None) + + closerange.assert_has_calls([ + mock.call(3, 4), + mock.call(8, subprocess.MAXFD), + ]) + + set_inheritable.assert_has_calls([ + mock.call(4, True), + mock.call(5, True), + ]) + + close.assert_called_once_with(6) + + @mock.patch('gevent.subprocess.Popen._close_fds_brute_force') + @mock.patch('os.listdir') + def test_close_fds_from_path_bad_values(self, listdir, brute_force): + listdir.return_value = 'Not an Integer' + + subprocess.Popen._close_fds_from_path('path', [], 42) + brute_force.assert_called_once_with([], 42) + + @mock.patch('os.listdir') + @mock.patch('os.closerange') + @mock.patch('gevent.subprocess._set_inheritable') + @mock.patch('os.close') + def test_close_fds_from_path(self, close, set_inheritable, closerange, listdir): + keep = ( + 4, 5, + # Leave a hole + # 6, + 7, + ) + listdir.return_value = ['1', '6', '37'] + + subprocess.Popen._close_fds_from_path('path', keep, 5) + + self.assertEqual([], closerange.mock_calls) + + set_inheritable.assert_has_calls([ + mock.call(4, True), + mock.call(7, True), + ]) + + close.assert_has_calls([ + mock.call(6), + mock.call(37), + ]) + + @mock.patch('gevent.subprocess.Popen._close_fds_brute_force') + @mock.patch('os.path.isdir') + def test_close_fds_no_dir(self, isdir, brute_force): + isdir.return_value = False + + subprocess.Popen._close_fds([], 42) + brute_force.assert_called_once_with([], 42) + isdir.assert_has_calls([ + mock.call('/proc/self/fd'), + mock.call('/dev/fd'), + ]) + + @mock.patch('gevent.subprocess.Popen._close_fds_from_path') + @mock.patch('gevent.subprocess.Popen._close_fds_brute_force') + @mock.patch('os.path.isdir') + def test_close_fds_with_dir(self, isdir, brute_force, from_path): + isdir.return_value = True + + subprocess.Popen._close_fds([7], 42) + + self.assertEqual([], brute_force.mock_calls) + from_path.assert_called_once_with('/proc/self/fd', [7], 42) + +class RunFuncTestCase(greentest.TestCase): + # Based on code from python 3.6 + + __timeout__ = greentest.LARGE_TIMEOUT + + def run_python(self, code, **kwargs): + """Run Python code in a subprocess using subprocess.run""" + argv = [sys.executable, "-c", code] + return subprocess.run(argv, **kwargs) + + def test_returncode(self): + # call() function with sequence argument + cp = self.run_python("import sys; sys.exit(47)") + self.assertEqual(cp.returncode, 47) + with self.assertRaises(subprocess.CalledProcessError): # pylint:disable=no-member + cp.check_returncode() + + def test_check(self): + with self.assertRaises(subprocess.CalledProcessError) as c: # pylint:disable=no-member + self.run_python("import sys; sys.exit(47)", check=True) + self.assertEqual(c.exception.returncode, 47) + + def test_check_zero(self): + # check_returncode shouldn't raise when returncode is zero + cp = self.run_python("import sys; sys.exit(0)", check=True) + self.assertEqual(cp.returncode, 0) + + def test_timeout(self): + # run() function with timeout argument; we want to test that the child + # process gets killed when the timeout expires. If the child isn't + # killed, this call will deadlock since subprocess.run waits for the + # child. + with self.assertRaises(subprocess.TimeoutExpired): + self.run_python("while True: pass", timeout=0.0001) + + @greentest.skipOnLibuvOnPyPyOnWin("hangs") + def test_capture_stdout(self): + # capture stdout with zero return code + cp = self.run_python("print('BDFL')", stdout=subprocess.PIPE) + self.assertIn(b'BDFL', cp.stdout) + + @greentest.skipOnLibuvOnPyPyOnWin("hangs") + def test_capture_stderr(self): + cp = self.run_python("import sys; sys.stderr.write('BDFL')", + stderr=subprocess.PIPE) + self.assertIn(b'BDFL', cp.stderr) + + @greentest.skipOnLibuvOnPyPyOnWin("hangs") + def test_check_output_stdin_arg(self): + # run() can be called with stdin set to a file + with tempfile.TemporaryFile() as tf: + tf.write(b'pear') + tf.seek(0) + cp = self.run_python( + "import sys; sys.stdout.write(sys.stdin.read().upper())", + stdin=tf, stdout=subprocess.PIPE) + self.assertIn(b'PEAR', cp.stdout) + + @greentest.skipOnLibuvOnPyPyOnWin("hangs") + def test_check_output_input_arg(self): + # check_output() can be called with input set to a string + cp = self.run_python( + "import sys; sys.stdout.write(sys.stdin.read().upper())", + input=b'pear', stdout=subprocess.PIPE) + self.assertIn(b'PEAR', cp.stdout) + + @greentest.skipOnLibuvOnPyPyOnWin("hangs") + def test_check_output_stdin_with_input_arg(self): + # run() refuses to accept 'stdin' with 'input' + with tempfile.TemporaryFile() as tf: + tf.write(b'pear') + tf.seek(0) + with self.assertRaises(ValueError, + msg="Expected ValueError when stdin and input args supplied.") as c: + self.run_python("print('will not be run')", + stdin=tf, input=b'hare') + self.assertIn('stdin', c.exception.args[0]) + self.assertIn('input', c.exception.args[0]) + + @greentest.skipOnLibuvOnPyPyOnWin("hangs") + def test_check_output_timeout(self): + with self.assertRaises(subprocess.TimeoutExpired) as c: + self.run_python( + ( + "import sys, time\n" + "sys.stdout.write('BDFL')\n" + "sys.stdout.flush()\n" + "time.sleep(3600)" + ), + # Some heavily loaded buildbots (sparc Debian 3.x) require + # this much time to start and print. + timeout=3, stdout=subprocess.PIPE) + self.assertEqual(c.exception.output, b'BDFL') + # output is aliased to stdout + self.assertEqual(c.exception.stdout, b'BDFL') + + def test_run_kwargs(self): + newenv = os.environ.copy() + newenv["FRUIT"] = "banana" + cp = self.run_python(('import sys, os;' + 'sys.exit(33 if os.getenv("FRUIT")=="banana" else 31)'), + env=newenv) + self.assertEqual(cp.returncode, 33) + + +if __name__ == '__main__': + greentest.main() diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__subprocess_interrupted.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__subprocess_interrupted.py new file mode 100644 index 00000000..ec27b0e9 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__subprocess_interrupted.py @@ -0,0 +1,20 @@ +import sys + +if 'runtestcase' in sys.argv[1:]: # pragma: no cover + import gevent + import gevent.subprocess + gevent.spawn(sys.exit, 'bye') + # Look closely, this doesn't actually do anything, that's a string + # not a division + gevent.subprocess.Popen([sys.executable, '-c', '"1/0"']) + gevent.sleep(1) +else: + import subprocess + for _ in range(5): + out, err = subprocess.Popen([sys.executable, '-W', 'ignore', + __file__, 'runtestcase'], + stderr=subprocess.PIPE).communicate() + if b'refs' in err: # Something to do with debug mode python builds? + assert err.startswith(b'bye'), repr(err) # pragma: no cover + else: + assert err.strip() == b'bye', repr(err) diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__subprocess_poll.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__subprocess_poll.py new file mode 100644 index 00000000..e817dff0 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__subprocess_poll.py @@ -0,0 +1,9 @@ +import sys +from gevent.subprocess import Popen +from gevent.testing.util import alarm + +alarm(3) + +popen = Popen([sys.executable, '-c', 'pass']) +while popen.poll() is None: + pass diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__systemerror.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__systemerror.py new file mode 100644 index 00000000..7101509c --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__systemerror.py @@ -0,0 +1,108 @@ +import sys +import gevent.testing as greentest +import gevent +from gevent.hub import get_hub + +def raise_(ex): + raise ex + + +MSG = 'should be re-raised and caught' + + +class Test(greentest.TestCase): + x = None + error_fatal = False + + def start(self, *args): + raise NotImplementedError + + def setUp(self): + self.x = None + + def test_sys_exit(self): + self.start(sys.exit, MSG) + + try: + gevent.sleep(0.001) + except SystemExit as ex: + assert str(ex) == MSG, repr(str(ex)) + else: + raise AssertionError('must raise SystemExit') + + def test_keyboard_interrupt(self): + self.start(raise_, KeyboardInterrupt) + + try: + gevent.sleep(0.001) + except KeyboardInterrupt: + pass + else: + raise AssertionError('must raise KeyboardInterrupt') + + def test_keyboard_interrupt_stderr_patched(self): + from gevent import monkey + monkey.patch_sys(stdin=False, stdout=False, stderr=True) + try: + try: + self.start(raise_, KeyboardInterrupt) + while True: + gevent.sleep(0.1) + except KeyboardInterrupt: + pass # expected + finally: + sys.stderr = monkey.get_original('sys', 'stderr') + + def test_system_error(self): + self.start(raise_, SystemError(MSG)) + + with self.assertRaisesRegex(SystemError, + MSG): + gevent.sleep(0.002) + + def test_exception(self): + self.start(raise_, Exception('regular exception must not kill the program')) + gevent.sleep(0.001) + + +class TestCallback(Test): + + def tearDown(self): + if self.x is not None: + # libuv: See the notes in libuv/loop.py:loop._start_callback_timer + # If that's broken, test_exception can fail sporadically. + # If the issue is the same, then adding `gevent.sleep(0)` here + # will solve it. There's also a race condition for the first loop, + # so we sleep twice. + assert not self.x.pending, self.x + + def start(self, *args): + self.x = get_hub().loop.run_callback(*args) + + if greentest.LIBUV: + def test_exception(self): + # This call will enter the loop for the very first time (if we're running + # standalone). On libuv, where timers run first, that means that depending on the + # amount of time that elapses between the call to uv_timer_start and uv_run, + # this timer might fire before our check or prepare watchers, and hence callbacks, + # run. + # We make this call now so that the call in the super class is guaranteed to be + # somewhere in the loop and not subject to that race condition. + gevent.sleep(0.001) + super(TestCallback, self).test_exception() + +class TestSpawn(Test): + + def tearDown(self): + gevent.sleep(0.0001) + if self.x is not None: + assert self.x.dead, self.x + + def start(self, *args): + self.x = gevent.spawn(*args) + + +del Test + +if __name__ == '__main__': + greentest.main() diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__threading.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__threading.py new file mode 100644 index 00000000..0a591fc6 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__threading.py @@ -0,0 +1,50 @@ +from gevent import monkey; monkey.patch_all() +import gevent.hub + +# check that the locks initialized by 'threading' did not init the hub +assert gevent.hub._get_hub() is None, 'monkey.patch_all() should not init hub' + +import gevent +import gevent.testing as greentest +import threading + + +def helper(): + threading.currentThread() + gevent.sleep(0.2) + + +class Test(greentest.TestCase): + + def _do_test(self, spawn): + before = len(threading._active) + g = spawn(helper) + gevent.sleep(0.1) + self.assertEqual(len(threading._active), before + 1) + try: + g.join() + except AttributeError: + while not g.dead: + gevent.sleep() + # Raw greenlet has no join(), uses a weakref to cleanup. + # so the greenlet has to die. On CPython, it's enough to + # simply delete our reference. + del g + # On PyPy, it might take a GC, but for some reason, even + # running several GC's doesn't clean it up under 5.6.0. + # So we skip the test. + #import gc + #gc.collect() + + self.assertEqual(len(threading._active), before) + + + def test_cleanup_gevent(self): + self._do_test(gevent.spawn) + + @greentest.skipOnPyPy("weakref is not cleaned up in a timely fashion") + def test_cleanup_raw(self): + self._do_test(gevent.spawn_raw) + +if __name__ == '__main__': + greentest.main() diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__threading_2.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__threading_2.py new file mode 100644 index 00000000..b425c88a --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__threading_2.py @@ -0,0 +1,610 @@ +# testing gevent's Event, Lock, RLock, Semaphore, BoundedSemaphore with standard test_threading +from __future__ import print_function + +from gevent.testing.six import xrange +import gevent.testing as greentest + +setup_ = '''from gevent import monkey; monkey.patch_all() +from gevent.event import Event +from gevent.lock import RLock, Semaphore, BoundedSemaphore +from gevent.thread import allocate_lock as Lock +import threading +threading.Event = Event +threading.Lock = Lock +# NOTE: We're completely patching around the allocate_lock +# patch we try to do with RLock; our monkey patch doesn't +# behave this way, but we do it in tests to make sure that +# our RLock implementation behaves correctly by itself. +# However, we must test the patched version too, so make it +# available. +threading.NativeRLock = threading.RLock +threading.RLock = RLock +threading.Semaphore = Semaphore +threading.BoundedSemaphore = BoundedSemaphore +''' + +exec(setup_) + +setup_3 = '\n'.join(' %s' % line for line in setup_.split('\n')) +setup_4 = '\n'.join(' %s' % line for line in setup_.split('\n')) + + +try: + from test.support import verbose +except ImportError: + from test.test_support import verbose +import random +import re +import sys +import threading +try: + import thread +except ImportError: + import _thread as thread +import time +import unittest +import weakref + +from gevent.tests import lock_tests + +# A trivial mutable counter. + +def skipDueToHang(cls): + return unittest.skipIf( + greentest.PYPY3 and greentest.RUNNING_ON_CI, + "SKIPPED: Timeout on PyPy3 on Travis" + )(cls) + +class Counter(object): + def __init__(self): + self.value = 0 + + def inc(self): + self.value += 1 + + def dec(self): + self.value -= 1 + + def get(self): + return self.value + + +class TestThread(threading.Thread): + def __init__(self, name, testcase, sema, mutex, nrunning): + threading.Thread.__init__(self, name=name) + self.testcase = testcase + self.sema = sema + self.mutex = mutex + self.nrunning = nrunning + + def run(self): + delay = random.random() / 10000.0 + if verbose: + print('task %s will run for %.1f usec' % ( + self.name, delay * 1e6)) + + with self.sema: + with self.mutex: + self.nrunning.inc() + if verbose: + print(self.nrunning.get(), 'tasks are running') + self.testcase.assertLessEqual(self.nrunning.get(), 3) + + time.sleep(delay) + if verbose: + print('task', self.name, 'done') + + with self.mutex: + self.nrunning.dec() + self.testcase.assertGreaterEqual(self.nrunning.get(), 0) + if verbose: + print('%s is finished. %d tasks are running' % ( + self.name, self.nrunning.get())) + +@skipDueToHang +class ThreadTests(unittest.TestCase): + + # Create a bunch of threads, let each do some work, wait until all are + # done. + def test_various_ops(self): + # This takes about n/3 seconds to run (about n/3 clumps of tasks, + # times about 1 second per clump). + NUMTASKS = 10 + + # no more than 3 of the 10 can run at once + sema = threading.BoundedSemaphore(value=3) + mutex = threading.RLock() + numrunning = Counter() + + threads = [] + + for i in range(NUMTASKS): + t = TestThread("" % i, self, sema, mutex, numrunning) + threads.append(t) + t.daemon = False # Under PYPY we get daemon by default? + if hasattr(t, 'ident'): + self.assertIsNone(t.ident) + self.assertFalse(t.daemon) + self.assertTrue(re.match(r'', repr(t))) + t.start() + + if verbose: + print('waiting for all tasks to complete') + for t in threads: + t.join(NUMTASKS) + self.assertFalse(t.is_alive()) + if hasattr(t, 'ident'): + self.assertNotEqual(t.ident, 0) + self.assertFalse(t.ident is None) + self.assertTrue(re.match(r'', repr(t))) + if verbose: + print('all tasks done') + self.assertEqual(numrunning.get(), 0) + + def test_ident_of_no_threading_threads(self): + # The ident still must work for the main thread and dummy threads, + # as must the repr and str. + + t = threading.currentThread() + self.assertFalse(t.ident is None) + str(t) + repr(t) + + def f(): + t = threading.currentThread() + ident.append(t.ident) + str(t) + repr(t) + done.set() + + done = threading.Event() + ident = [] + thread.start_new_thread(f, ()) + done.wait() + self.assertFalse(ident[0] is None) + # Kill the "immortal" _DummyThread + del threading._active[ident[0]] + + # run with a small(ish) thread stack size (256kB) + def test_various_ops_small_stack(self): + if verbose: + print('with 256kB thread stack size...') + try: + threading.stack_size(262144) + except thread.error: + if verbose: + print('platform does not support changing thread stack size') + return + self.test_various_ops() + threading.stack_size(0) + + # run with a large thread stack size (1MB) + def test_various_ops_large_stack(self): + if verbose: + print('with 1MB thread stack size...') + try: + threading.stack_size(0x100000) + except thread.error: + if verbose: + print('platform does not support changing thread stack size') + return + self.test_various_ops() + threading.stack_size(0) + + def test_foreign_thread(self): + # Check that a "foreign" thread can use the threading module. + def f(mutex): + # Calling current_thread() forces an entry for the foreign + # thread to get made in the threading._active map. + threading.current_thread() + mutex.release() + + mutex = threading.Lock() + mutex.acquire() + tid = thread.start_new_thread(f, (mutex,)) + # Wait for the thread to finish. + mutex.acquire() + self.assertIn(tid, threading._active) + self.assertIsInstance(threading._active[tid], + threading._DummyThread) + del threading._active[tid] + # in gevent, we actually clean up threading._active, but it's not happended there yet + + # PyThreadState_SetAsyncExc() is a CPython-only gimmick, not (currently) + # exposed at the Python level. This test relies on ctypes to get at it. + def SKIP_test_PyThreadState_SetAsyncExc(self): + try: + import ctypes + except ImportError: + if verbose: + print("test_PyThreadState_SetAsyncExc can't import ctypes") + return # can't do anything + + set_async_exc = ctypes.pythonapi.PyThreadState_SetAsyncExc + + class AsyncExc(Exception): + pass + + exception = ctypes.py_object(AsyncExc) + + # `worker_started` is set by the thread when it's inside a try/except + # block waiting to catch the asynchronously set AsyncExc exception. + # `worker_saw_exception` is set by the thread upon catching that + # exception. + worker_started = threading.Event() + worker_saw_exception = threading.Event() + + class Worker(threading.Thread): + id = None + finished = False + + def run(self): + self.id = thread.get_ident() + self.finished = False + + try: + while True: + worker_started.set() + time.sleep(0.1) + except AsyncExc: + self.finished = True + worker_saw_exception.set() + + t = Worker() + t.daemon = True # so if this fails, we don't hang Python at shutdown + t.start() + if verbose: + print(" started worker thread") + + # Try a thread id that doesn't make sense. + if verbose: + print(" trying nonsensical thread id") + result = set_async_exc(ctypes.c_long(-1), exception) + self.assertEqual(result, 0) # no thread states modified + + # Now raise an exception in the worker thread. + if verbose: + print(" waiting for worker thread to get started") + worker_started.wait() + if verbose: + print(" verifying worker hasn't exited") + self.assertFalse(t.finished) + if verbose: + print(" attempting to raise asynch exception in worker") + result = set_async_exc(ctypes.c_long(t.id), exception) + self.assertEqual(result, 1) # one thread state modified + if verbose: + print(" waiting for worker to say it caught the exception") + worker_saw_exception.wait(timeout=10) + self.assertTrue(t.finished) + if verbose: + print(" all OK -- joining worker") + if t.finished: + t.join() + # else the thread is still running, and we have no way to kill it + + def test_limbo_cleanup(self): + # Issue 7481: Failure to start thread should cleanup the limbo map. + def fail_new_thread(*_args): + raise thread.error() + _start_new_thread = threading._start_new_thread + threading._start_new_thread = fail_new_thread + try: + t = threading.Thread(target=lambda: None) + self.assertRaises(thread.error, t.start) + self.assertFalse( + t in threading._limbo, + "Failed to cleanup _limbo map on failure of Thread.start().") + finally: + threading._start_new_thread = _start_new_thread + + def test_finalize_runnning_thread(self): + # Issue 1402: the PyGILState_Ensure / _Release functions may be called + # very late on python exit: on deallocation of a running thread for + # example. + try: + import ctypes + getattr(ctypes, 'pythonapi') # not available on PyPy + getattr(ctypes.pythonapi, 'PyGILState_Ensure') # not available on PyPy3 + except (ImportError, AttributeError): + if verbose: + print("test_finalize_with_runnning_thread can't import ctypes") + return # can't do anything + + del ctypes # pyflakes fix + + import subprocess + rc = subprocess.call([sys.executable, "-W", "ignore", "-c", """if 1: +%s + import ctypes, sys, time + try: + import thread + except ImportError: + import _thread as thread # Py3 + + # This lock is used as a simple event variable. + ready = thread.allocate_lock() + ready.acquire() + + # Module globals are cleared before __del__ is run + # So we save the functions in class dict + class C: + ensure = ctypes.pythonapi.PyGILState_Ensure + release = ctypes.pythonapi.PyGILState_Release + def __del__(self): + state = self.ensure() + self.release(state) + + def waitingThread(): + x = C() + ready.release() + time.sleep(100) + + thread.start_new_thread(waitingThread, ()) + ready.acquire() # Be sure the other thread is waiting. + sys.exit(42) + """ % setup_3]) + self.assertEqual(rc, 42) + + @greentest.skipOnLibuvOnPyPyOnWin("hangs") + def test_join_nondaemon_on_shutdown(self): + # Issue 1722344 + # Raising SystemExit skipped threading._shutdown + import subprocess + p = subprocess.Popen([sys.executable, "-W", "ignore", "-c", """if 1: +%s + import threading + from time import sleep + + def child(): + sleep(1) + # As a non-daemon thread we SHOULD wake up and nothing + # should be torn down yet + print("Woke up, sleep function is: %%r" %% sleep) + + threading.Thread(target=child).start() + raise SystemExit + """ % setup_4], + stdout=subprocess.PIPE, + stderr=subprocess.PIPE) + stdout, stderr = p.communicate() + stdout = stdout.strip() + stdout = stdout.decode('utf-8') + stderr = stderr.decode('utf-8') + assert re.match('^Woke up, sleep function is: <.*?sleep.*?>$', stdout), repr(stdout) + stderr = re.sub(r"^\[\d+ refs\]", "", stderr, re.MULTILINE).strip() + # On Python 2, importing pkg_resources tends to result in some 'ImportWarning' + # being printed to stderr about packages missing __init__.py; the -W ignore is... + # ignored. + # self.assertEqual(stderr, "") + + def test_enumerate_after_join(self): + # Try hard to trigger #1703448: a thread is still returned in + # threading.enumerate() after it has been join()ed. + enum = threading.enumerate + import warnings + with warnings.catch_warnings(): + warnings.simplefilter('ignore', DeprecationWarning) + # get/set checkinterval are deprecated in Python 3 + old_interval = sys.getcheckinterval() + try: + for i in xrange(1, 100): + # Try a couple times at each thread-switching interval + # to get more interleavings. + sys.setcheckinterval(i // 5) + t = threading.Thread(target=lambda: None) + t.start() + t.join() + l = enum() + self.assertFalse(t in l, + "#1703448 triggered after %d trials: %s" % (i, l)) + finally: + sys.setcheckinterval(old_interval) + + if not hasattr(sys, 'pypy_version_info'): + def test_no_refcycle_through_target(self): + class RunSelfFunction(object): + def __init__(self, should_raise): + # The links in this refcycle from Thread back to self + # should be cleaned up when the thread completes. + self.should_raise = should_raise + self.thread = threading.Thread(target=self._run, + args=(self,), + kwargs={'yet_another': self}) + self.thread.start() + + def _run(self, _other_ref, _yet_another): + if self.should_raise: + raise SystemExit + + cyclic_object = RunSelfFunction(should_raise=False) + weak_cyclic_object = weakref.ref(cyclic_object) + cyclic_object.thread.join() + del cyclic_object + self.assertIsNone(weak_cyclic_object(), + msg=('%d references still around' % + sys.getrefcount(weak_cyclic_object()))) + + raising_cyclic_object = RunSelfFunction(should_raise=True) + weak_raising_cyclic_object = weakref.ref(raising_cyclic_object) + raising_cyclic_object.thread.join() + del raising_cyclic_object + self.assertIsNone(weak_raising_cyclic_object(), + msg=('%d references still around' % + sys.getrefcount(weak_raising_cyclic_object()))) + +@skipDueToHang +class ThreadJoinOnShutdown(unittest.TestCase): + + def _run_and_join(self, script): + script = """if 1: +%s + import sys, os, time, threading + # a thread, which waits for the main program to terminate + def joiningfunc(mainthread): + mainthread.join() + print('end of thread') + \n""" % setup_3 + script + + import subprocess + p = subprocess.Popen([sys.executable, "-W", "ignore", "-c", script], stdout=subprocess.PIPE) + rc = p.wait() + data = p.stdout.read().replace(b'\r', b'') + p.stdout.close() + self.assertEqual(data, b"end of main\nend of thread\n") + self.assertNotEqual(rc, 2, b"interpreter was blocked") + self.assertEqual(rc, 0, b"Unexpected error") + + @greentest.skipOnLibuvOnPyPyOnWin("hangs") + def test_1_join_on_shutdown(self): + # The usual case: on exit, wait for a non-daemon thread + script = """if 1: + import os + t = threading.Thread(target=joiningfunc, + args=(threading.current_thread(),)) + t.start() + time.sleep(0.1) + print('end of main') + """ + self._run_and_join(script) + + @greentest.skipOnPyPy3OnCI("Sometimes randomly times out") + def test_2_join_in_forked_process(self): + # Like the test above, but from a forked interpreter + import os + if not hasattr(os, 'fork'): + return + script = """if 1: + childpid = os.fork() + if childpid != 0: + os.waitpid(childpid, 0) + sys.exit(0) + + t = threading.Thread(target=joiningfunc, + args=(threading.current_thread(),)) + t.start() + print('end of main') + """ + self._run_and_join(script) + + def test_3_join_in_forked_from_thread(self): + # Like the test above, but fork() was called from a worker thread + # In the forked process, the main Thread object must be marked as stopped. + import os + if not hasattr(os, 'fork'): + return + # Skip platforms with known problems forking from a worker thread. + # See http://bugs.python.org/issue3863. + # skip disable because I think the bug shouldn't apply to gevent -- denis + #if sys.platform in ('freebsd4', 'freebsd5', 'freebsd6', 'os2emx'): + # print(('Skipping test_3_join_in_forked_from_thread' + # ' due to known OS bugs on'), sys.platform, file=sys.stderr) + # return + + # A note on CFFI: Under Python 3, using CFFI tends to initialize the GIL, + # whether or not we spawn any actual threads. Now, os.fork() calls + # PyEval_ReInitThreads, which only does any work of the GIL has been taken. + # One of the things it does is call threading._after_fork to reset + # some thread state, which causes the main thread (threading._main_thread) + # to be reset to the current thread---which for Python >= 3.4 happens + # to be our version of thread, gevent.threading.Thread, which doesn't + # initialize the _tstate_lock ivar. This causes threading._shutdown to crash + # with an AssertionError and this test to fail. We hack around this by + # making sure _after_fork is not called in the child process. + # XXX: Figure out how to really fix that. + + script = """if 1: + main_thread = threading.current_thread() + def worker(): + threading._after_fork = lambda: None + childpid = os.fork() + if childpid != 0: + os.waitpid(childpid, 0) + sys.exit(0) + + t = threading.Thread(target=joiningfunc, + args=(main_thread,)) + print('end of main') + t.start() + t.join() # Should not block: main_thread is already stopped + + w = threading.Thread(target=worker) + w.start() + import sys + if sys.version_info[:2] >= (3, 7) or (sys.version_info[:2] >= (3, 5) and hasattr(sys, 'pypy_version_info') and sys.platform != 'darwin'): + w.join() + """ + # In PyPy3 5.8.0, if we don't wait on this top-level "thread", 'w', + # we never see "end of thread". It's not clear why, since that's being + # done in a child of this process. Yet in normal CPython 3, waiting on this + # causes the whole process to lock up (possibly because of some loop within + # the interpreter waiting on thread locks, like the issue described in threading.py + # for Python 3.4? in any case, it doesn't hang in Python 2.) This changed in + # 3.7a1 and waiting on it is again necessary and doesn't hang. + # PyPy3 5.10.1 is back to the "old" cpython behaviour, and waiting on it + # causes the whole process to hang, but apparently only on OS X---linux was fine without it + self._run_and_join(script) + + +@skipDueToHang +class ThreadingExceptionTests(unittest.TestCase): + # A RuntimeError should be raised if Thread.start() is called + # multiple times. + # pylint:disable=bad-thread-instantiation + def test_start_thread_again(self): + thread_ = threading.Thread() + thread_.start() + self.assertRaises(RuntimeError, thread_.start) + + def test_joining_current_thread(self): + current_thread = threading.current_thread() + self.assertRaises(RuntimeError, current_thread.join) + + def test_joining_inactive_thread(self): + thread_ = threading.Thread() + self.assertRaises(RuntimeError, thread_.join) + + def test_daemonize_active_thread(self): + thread_ = threading.Thread() + thread_.start() + self.assertRaises(RuntimeError, setattr, thread_, "daemon", True) + + +@skipDueToHang +class LockTests(lock_tests.LockTests): + locktype = staticmethod(threading.Lock) + +@skipDueToHang +class RLockTests(lock_tests.RLockTests): + locktype = staticmethod(threading.RLock) + +@skipDueToHang +class NativeRLockTests(lock_tests.RLockTests): + # See comments at the top of the file for the difference + # between this and RLockTests, and why they both matter + locktype = staticmethod(threading.NativeRLock) + +@skipDueToHang +class EventTests(lock_tests.EventTests): + eventtype = staticmethod(threading.Event) + +@skipDueToHang +class ConditionAsRLockTests(lock_tests.RLockTests): + # An Condition uses an RLock by default and exports its API. + locktype = staticmethod(threading.Condition) + +@skipDueToHang +class ConditionTests(lock_tests.ConditionTests): + condtype = staticmethod(threading.Condition) + +@skipDueToHang +class SemaphoreTests(lock_tests.SemaphoreTests): + semtype = staticmethod(threading.Semaphore) + +@skipDueToHang +class BoundedSemaphoreTests(lock_tests.BoundedSemaphoreTests): + semtype = staticmethod(threading.BoundedSemaphore) + + +if __name__ == "__main__": + greentest.main() diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__threading_before_monkey.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__threading_before_monkey.py new file mode 100644 index 00000000..b60fb307 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__threading_before_monkey.py @@ -0,0 +1,23 @@ +# If stdlib threading is imported *BEFORE* monkey patching, +# we can still get the current (main) thread, and it's not a DummyThread. + +import threading +from gevent import monkey +monkey.patch_all() + +import gevent.testing as greentest + + +class Test(greentest.TestCase): + + def test_main_thread(self): + current = threading.current_thread() + self.assertFalse(isinstance(current, threading._DummyThread)) + self.assertTrue(isinstance(current, monkey.get_original('threading', 'Thread'))) + # in 3.4, if the patch is incorrectly done, getting the repr + # of the thread fails + repr(current) + + +if __name__ == '__main__': + greentest.main() diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__threading_holding_lock_while_monkey.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__threading_holding_lock_while_monkey.py new file mode 100644 index 00000000..c5aed4a2 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__threading_holding_lock_while_monkey.py @@ -0,0 +1,8 @@ +from gevent import monkey +import threading +# Make sure that we can patch gevent while holding +# a threading lock. Under Python2, where RLock is implemented +# in python code, this used to throw RuntimeErro("Cannot release un-acquired lock") +# See https://github.com/gevent/gevent/issues/615 +with threading.RLock(): + monkey.patch_all() diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__threading_monkey_in_thread.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__threading_monkey_in_thread.py new file mode 100644 index 00000000..f3ff73d1 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__threading_monkey_in_thread.py @@ -0,0 +1,65 @@ +# We can monkey-patch in a thread, but things don't work as expected. +from __future__ import print_function +import sys +import threading +from gevent import monkey +import gevent.testing as greentest + + +class Test(greentest.TestCase): + + @greentest.ignores_leakcheck # can't be run multiple times + def test_patch_in_thread(self): + all_warnings = [] + try: + get_ident = threading.get_ident + except AttributeError: + get_ident = threading._get_ident + + def process_warnings(warnings): + all_warnings.extend(warnings) + monkey._process_warnings = process_warnings + + current = threading.current_thread() + current_id = get_ident() + + def target(): + tcurrent = threading.current_thread() + monkey.patch_all() + tcurrent2 = threading.current_thread() + self.assertIsNot(tcurrent, current) + # We get a dummy thread now + self.assertIsNot(tcurrent, tcurrent2) + + thread = threading.Thread(target=target) + thread.start() + try: + thread.join() + except: # pylint:disable=bare-except + # XXX: This can raise LoopExit in some cases. + greentest.reraiseFlakyTestRaceCondition() + + self.assertNotIsInstance(current, threading._DummyThread) + self.assertIsInstance(current, monkey.get_original('threading', 'Thread')) + + + # We generated some warnings + if sys.version_info >= (3, 4): + self.assertEqual(all_warnings, + ['Monkey-patching outside the main native thread. Some APIs will not be ' + 'available. Expect a KeyError to be printed at shutdown.', + 'Monkey-patching not on the main thread; threading.main_thread().join() ' + 'will hang from a greenlet']) + else: + self.assertEqual(all_warnings, + ['Monkey-patching outside the main native thread. Some APIs will not be ' + 'available. Expect a KeyError to be printed at shutdown.']) + + + # Manual clean up so we don't get a KeyError + del threading._active[current_id] + threading._active[(getattr(threading, 'get_ident', None) or threading._get_ident)()] = current + + +if __name__ == '__main__': + greentest.main() diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__threading_native_before_monkey.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__threading_native_before_monkey.py new file mode 100644 index 00000000..dd29ab6b --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__threading_native_before_monkey.py @@ -0,0 +1,57 @@ +# If stdlib threading is imported *BEFORE* monkey patching, *and* +# there is a native thread created, we can still get the current +# (main) thread, and it's not a DummyThread. +# Joining the native thread also does not fail + +import threading +from time import sleep as time_sleep + +import gevent.testing as greentest + +class NativeThread(threading.Thread): + do_run = True + + def run(self): + while self.do_run: + time_sleep(0.1) + + def stop(self, timeout=None): + self.do_run = False + self.join(timeout=timeout) + +native_thread = None + +class Test(greentest.TestCase): + + def test_main_thread(self): + current = threading.current_thread() + self.assertFalse(isinstance(current, threading._DummyThread)) + self.assertTrue(isinstance(current, monkey.get_original('threading', 'Thread'))) + # in 3.4, if the patch is incorrectly done, getting the repr + # of the thread fails + repr(current) + + if hasattr(threading, 'main_thread'): # py 3.4 + self.assertEqual(threading.current_thread(), threading.main_thread()) + + @greentest.ignores_leakcheck # because it can't be run multiple times + def test_join_native_thread(self): + self.assertTrue(native_thread.is_alive()) + + native_thread.stop(timeout=1) + self.assertFalse(native_thread.is_alive()) + + # again, idempotent + native_thread.stop() + self.assertFalse(native_thread.is_alive()) + + +if __name__ == '__main__': + native_thread = NativeThread() + native_thread.start() + + # Only patch after we're running + from gevent import monkey + monkey.patch_all() + + greentest.main() diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__threading_patched_local.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__threading_patched_local.py new file mode 100644 index 00000000..5ff33528 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__threading_patched_local.py @@ -0,0 +1,24 @@ +from gevent import monkey; monkey.patch_all() +import threading + + +localdata = threading.local() +localdata.x = "hello" +assert localdata.x == 'hello' +success = [] + + +def func(): + try: + getattr(localdata, 'x') + raise AssertionError('localdata.x must raise AttributeError') + except AttributeError: + pass + assert localdata.__dict__ == {}, localdata.__dict__ + success.append(1) + +t = threading.Thread(None, func) +t.start() +t.join() +assert success == [1], 'test failed' +assert localdata.x == 'hello' diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__threading_vs_settrace.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__threading_vs_settrace.py new file mode 100644 index 00000000..43248294 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__threading_vs_settrace.py @@ -0,0 +1,163 @@ +from __future__ import print_function +import sys +import subprocess +import unittest +from gevent.thread import allocate_lock +import gevent.testing as greentest + +script = """ +from gevent import monkey +monkey.patch_all() +import sys, os, threading, time + + +# A deadlock-killer, to prevent the +# testsuite to hang forever +def killer(): + time.sleep(0.1) + sys.stdout.write('..program blocked; aborting!') + sys.stdout.flush() + os._exit(2) +t = threading.Thread(target=killer) +t.daemon = True +t.start() + + +def trace(frame, event, arg): + if threading is not None: + threading.currentThread() + return trace + + +def doit(): + sys.stdout.write("..thread started..") + + +def test1(): + t = threading.Thread(target=doit) + t.start() + t.join() + sys.settrace(None) + +sys.settrace(trace) +if len(sys.argv) > 1: + test1() + +sys.stdout.write("..finishing..") +""" + + +class TestTrace(unittest.TestCase): + @greentest.skipOnPurePython("Locks can be traced in Pure Python") + def test_untraceable_lock(self): + # Untraceable locks were part of the solution to https://bugs.python.org/issue1733757 + # which details a deadlock that could happen if a trace function invoked + # threading.currentThread at shutdown time---the cleanup lock would be held + # by the VM, and calling currentThread would try to acquire it again. The interpreter + # changed in 2.6 to use the `with` statement (https://hg.python.org/cpython/rev/76f577a9ec03/), + # which apparently doesn't trace in quite the same way. + if hasattr(sys, 'gettrace'): + old = sys.gettrace() + else: + old = None + + lst = [] + try: + def trace(frame, ev, _arg): + lst.append((frame.f_code.co_filename, frame.f_lineno, ev)) + print("TRACE: %s:%s %s" % lst[-1]) + return trace + + with allocate_lock(): + sys.settrace(trace) + finally: + sys.settrace(old) + + self.assertEqual(lst, [], "trace not empty") + + @greentest.skipOnPurePython("Locks can be traced in Pure Python") + def test_untraceable_lock_uses_different_lock(self): + if hasattr(sys, 'gettrace'): + old = sys.gettrace() + else: + old = None + + PY3 = sys.version_info[0] > 2 + lst = [] + # we should be able to use unrelated locks from within the trace function + l = allocate_lock() + try: + def trace(frame, ev, _arg): + with l: + lst.append((frame.f_code.co_filename, frame.f_lineno, ev)) + print("TRACE: %s:%s %s" % lst[-1]) + return trace + + l2 = allocate_lock() + sys.settrace(trace) + # Separate functions, not the C-implemented `with` so the trace + # function gets a crack at them + l2.acquire() + l2.release() + finally: + sys.settrace(old) + + if not PY3: + # Py3 overrides acquire in Python to do argument checking + self.assertEqual(lst, [], "trace not empty") + else: + # Have an assert so that we know if we miscompile + self.assertTrue(lst, "should not compile on pypy") + + @greentest.skipOnPurePython("Locks can be traced in Pure Python") + def test_untraceable_lock_uses_same_lock(self): + from gevent.hub import LoopExit + if hasattr(sys, 'gettrace'): + old = sys.gettrace() + else: + old = None + PY3 = sys.version_info[0] > 2 + lst = [] + e = None + # we should not be able to use the same lock from within the trace function + # because it's over acquired but instead of deadlocking it raises an exception + l = allocate_lock() + try: + def trace(frame, ev, _arg): + with l: + lst.append((frame.f_code.co_filename, frame.f_lineno, ev)) + return trace + + sys.settrace(trace) + # Separate functions, not the C-implemented `with` so the trace + # function gets a crack at them + l.acquire() + except LoopExit as ex: + e = ex + finally: + sys.settrace(old) + + if not PY3: + # Py3 overrides acquire in Python to do argument checking + self.assertEqual(lst, [], "trace not empty") + else: + # Have an assert so that we know if we miscompile + self.assertTrue(lst, "should not compile on pypy") + self.assertTrue(isinstance(e, LoopExit)) + + def run_script(self, more_args=()): + args = [sys.executable, "-c", script] + args.extend(more_args) + rc = subprocess.call(args) + self.assertNotEqual(rc, 2, "interpreter was blocked") + self.assertEqual(rc, 0, "Unexpected error") + + def test_finalize_with_trace(self): + self.run_script() + + def test_bootstrap_inner_with_trace(self): + self.run_script(["1"]) + + +if __name__ == "__main__": + greentest.main() diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__threadpool.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__threadpool.py new file mode 100644 index 00000000..2bbcbb79 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test__threadpool.py @@ -0,0 +1,653 @@ +from __future__ import print_function + +from time import time, sleep +import contextlib +import random +import weakref +import gc + +import gevent.testing as greentest +import gevent.threadpool +from gevent.threadpool import ThreadPool +import gevent + +from gevent.testing import ExpectedException +from gevent.testing import PYPY + + + +# pylint:disable=too-many-ancestors + + +@contextlib.contextmanager +def disabled_gc(): + was_enabled = gc.isenabled() + gc.disable() + try: + yield + finally: + if was_enabled: + gc.enable() + + +class TestCase(greentest.TestCase): + # These generally need more time + __timeout__ = greentest.LARGE_TIMEOUT + pool = None + + ClassUnderTest = ThreadPool + def _FUT(self): + return self.ClassUnderTest + + def _makeOne(self, size, increase=greentest.RUN_LEAKCHECKS): + self.pool = pool = self._FUT()(size) + if increase: + # Max size to help eliminate false positives + self.pool.size = size + return pool + + def cleanup(self): + pool = self.pool + if pool is not None: + kill = getattr(pool, 'kill', None) or getattr(pool, 'shutdown') + kill() + del kill + del self.pool + + if greentest.RUN_LEAKCHECKS: + # Each worker thread created a greenlet object and switched to it. + # It's a custom subclass, but even if it's not, it appears that + # the root greenlet for the new thread sticks around until there's a + # gc. Simply calling 'getcurrent()' is enough to "leak" a greenlet.greenlet + # and a weakref. + for _ in range(3): + gc.collect() + + +class PoolBasicTests(TestCase): + + def test_execute_async(self): + pool = self._makeOne(2) + r = [] + first = pool.spawn(r.append, 1) + first.get() + self.assertEqual(r, [1]) + gevent.sleep(0) + + pool.apply_async(r.append, (2, )) + self.assertEqual(r, [1]) + + pool.apply_async(r.append, (3, )) + self.assertEqual(r, [1]) + + pool.apply_async(r.append, (4, )) + self.assertEqual(r, [1]) + gevent.sleep(0.01) + self.assertEqualFlakyRaceCondition(sorted(r), [1, 2, 3, 4]) + + def test_apply(self): + pool = self._makeOne(1) + result = pool.apply(lambda a: ('foo', a), (1, )) + self.assertEqual(result, ('foo', 1)) + + def test_apply_raises(self): + pool = self._makeOne(1) + + def raiser(): + raise ExpectedException() + + with self.assertRaises(ExpectedException): + pool.apply(raiser) + # Don't let the metaclass automatically force any error + # that reaches the hub from a spawned greenlet to become + # fatal; that defeats the point of the test. + test_apply_raises.error_fatal = False + + def test_init_valueerror(self): + self.switch_expected = False + with self.assertRaises(ValueError): + self._makeOne(-1) + +# +# tests from standard library test/test_multiprocessing.py + + +class TimingWrapper(object): + + def __init__(self, the_func): + self.func = the_func + self.elapsed = None + + def __call__(self, *args, **kwds): + t = time() + try: + return self.func(*args, **kwds) + finally: + self.elapsed = time() - t + + +def sqr(x, wait=0.0): + sleep(wait) + return x * x + + +def sqr_random_sleep(x): + sleep(random.random() * 0.1) + return x * x + + +TIMEOUT1, TIMEOUT2, TIMEOUT3 = 0.082, 0.035, 0.14 + +class _AbstractPoolTest(TestCase): + + size = 1 + + MAP_IS_GEN = False + + def setUp(self): + greentest.TestCase.setUp(self) + self._makeOne(self.size) + + @greentest.ignores_leakcheck + def test_map(self): + pmap = self.pool.map + if self.MAP_IS_GEN: + pmap = lambda f, i: list(self.pool.map(f, i)) + self.assertEqual(pmap(sqr, range(10)), list(map(sqr, range(10)))) + self.assertEqual(pmap(sqr, range(100)), list(map(sqr, range(100)))) + + self.pool.kill() + del self.pool + del pmap + +SMALL_RANGE = 10 +LARGE_RANGE = 1000 + +if (greentest.PYPY and (greentest.WIN or greentest.RUN_COVERAGE)) or greentest.RUN_LEAKCHECKS: + # PyPy 5.10 is *really* slow at spawning or switching between + # threads (especially on Windows or when coverage is enabled) Tests that happen + # instantaneously on other platforms time out due to the overhead. + + # Leakchecks also take much longer due to all the calls into the GC, + # most especially on Python 3 + LARGE_RANGE = 50 + +class TestPool(_AbstractPoolTest): + + def test_greenlet_class(self): + from greenlet import getcurrent + from gevent.threadpool import _WorkerGreenlet + worker_greenlet = self.pool.apply(getcurrent) + + self.assertIsInstance(worker_greenlet, _WorkerGreenlet) + r = repr(worker_greenlet) + self.assertIn('ThreadPoolWorker', r) + self.assertIn('thread_ident', r) + self.assertIn('hub=', r) + + from gevent.util import format_run_info + + info = '\n'.join(format_run_info()) + self.assertIn(" + : Parent: None + : Greenlet Locals: + : Local at X + : {'foo': 42} + +--- + : Parent: + +--- ; finished with value + | +--- ; finished with exception ExpectedException() + : Parent: + +--- ; finished with value + | +--- ; finished with exception ExpectedException() + : Parent: + +--- ; finished with value + : Spawn Tree Locals + : {'stl': 'STL'} + | +--- ; finished with value + | +--- ; finished with exception ExpectedException() + : Parent: + +--- >>; finished with value + """.strip() + self.assertEqual(expected, value) + + @greentest.ignores_leakcheck + def test_tree_no_track(self): + gevent.config.track_greenlet_tree = False + self._build_tree() + + + @greentest.ignores_leakcheck + def test_forest_fake_parent(self): + from greenlet import greenlet as RawGreenlet + + def t4(): + # Ignore this one, make the child the parent, + # and don't be a child of the hub. + c = RawGreenlet(util.GreenletTree.current_tree) + c.parent.greenlet_tree_is_ignored = True + c.greenlet_tree_is_root = True + return c.switch() + + + g = RawGreenlet(t4) + tree = g.switch() + + tree_format = tree.format(details={'running_stacks': False, + 'spawning_stacks': False}) + value = self._normalize_tree_format(tree_format) + + expected = """\ +; not running + : Parent: + """.strip() + + self.assertEqual(expected, value) + + +class TestAssertSwitches(unittest.TestCase): + + def test_time_sleep(self): + # A real blocking function + from time import sleep + + # No time given, we detect the failure to switch immediately + with self.assertRaises(util._FailedToSwitch) as exc: + with util.assert_switches(): + sleep(0.001) + + message = str(exc.exception) + self.assertIn('To any greenlet in', message) + + # Supply a max blocking allowed and exceed it + with self.assertRaises(util._FailedToSwitch): + with util.assert_switches(0.001): + sleep(0.1) + + + # Supply a max blocking allowed, and exit before that happens, + # but don't switch to the hub as requested + with self.assertRaises(util._FailedToSwitch) as exc: + with util.assert_switches(0.001, hub_only=True): + sleep(0) + + message = str(exc.exception) + self.assertIn('To the hub in', message) + self.assertIn('(max allowed 0.0010 seconds)', message) + + # Supply a max blocking allowed, and exit before that happens, + # and allow any switch (or no switch). + # Note that we need to use a relatively long duration; + # sleep(0) on Windows can actually take a substantial amount of time + # sometimes (more than 0.001s) + with util.assert_switches(1.0, hub_only=False): + sleep(0) + + + def test_no_switches_no_function(self): + # No blocking time given, no switch performed: exception + with self.assertRaises(util._FailedToSwitch): + with util.assert_switches(): + pass + + # blocking time given, for all greenlets, no switch performed: nothing + with util.assert_switches(max_blocking_time=1, hub_only=False): + pass + + def test_exception_not_supressed(self): + + with self.assertRaises(NameError): + with util.assert_switches(): + raise NameError() + + def test_nested(self): + from greenlet import gettrace + with util.assert_switches() as outer: + self.assertEqual(gettrace(), outer.tracer) + self.assertIsNotNone(outer.tracer.active_greenlet) + + with util.assert_switches() as inner: + self.assertEqual(gettrace(), inner.tracer) + self.assertEqual(inner.tracer.previous_trace_function, outer.tracer) + + inner.tracer('switch', (self, self)) + + self.assertIs(self, inner.tracer.active_greenlet) + self.assertIs(self, outer.tracer.active_greenlet) + + self.assertEqual(gettrace(), outer.tracer) + +if __name__ == '__main__': + greentest.main() diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test_server.crt b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test_server.crt new file mode 100644 index 00000000..1379e1d1 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test_server.crt @@ -0,0 +1,15 @@ +-----BEGIN CERTIFICATE----- +MIICYzCCAcwCCQD5jx1Aa0dytjANBgkqhkiG9w0BAQQFADB2MQswCQYDVQQGEwJU +UzENMAsGA1UECBMEVGVzdDENMAsGA1UEBxMEVGVzdDEWMBQGA1UEChMNVGVzdCBF +dmVudGxldDENMAsGA1UECxMEVGVzdDENMAsGA1UEAxMEVGVzdDETMBEGCSqGSIb3 +DQEJARYEVGVzdDAeFw0wODA3MDgyMTExNDJaFw0xMDAyMDgwODE1MTBaMHYxCzAJ +BgNVBAYTAlRTMQ0wCwYDVQQIEwRUZXN0MQ0wCwYDVQQHEwRUZXN0MRYwFAYDVQQK +Ew1UZXN0IEV2ZW50bGV0MQ0wCwYDVQQLEwRUZXN0MQ0wCwYDVQQDEwRUZXN0MRMw +EQYJKoZIhvcNAQkBFgRUZXN0MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDM +WcyeIiHQuEGQxgTIvu0aOW4iRFAyUEi8pLWNCxMEHglF8k6OxFVq7XWZMDnDFVnb +ZjmQh5Tc21Ae6cXzxXln578fROXHEzXo3Is8HUlq3ug1yYOGHjxw++Opjf1uoHwP +EBUKsz/flS7knuscgFM9FO05KSPn2wHnZeIDta4yTwIDAQABMA0GCSqGSIb3DQEB +BAUAA4GBAKM71aP0r26gEEEBzovfXm1IwKav6R9/xiWsJ4pFsUXVotcaIjcVBDG1 +Z7tz688hokb+GNxsTI2gNfqanqUnfP9wZxnKRmfTSOvb5aWHIiaiMXSgjiPlqBcm +6mnSeEbSMM9cw479wWhh1YqY8tf3gYJa+sxznVWLSfVLpsjRMphe +-----END CERTIFICATE----- diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test_server.key b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test_server.key new file mode 100644 index 00000000..24cd8e5a --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/test_server.key @@ -0,0 +1,15 @@ +-----BEGIN RSA PRIVATE KEY----- +MIICXgIBAAKBgQDMWcyeIiHQuEGQxgTIvu0aOW4iRFAyUEi8pLWNCxMEHglF8k6O +xFVq7XWZMDnDFVnbZjmQh5Tc21Ae6cXzxXln578fROXHEzXo3Is8HUlq3ug1yYOG +Hjxw++Opjf1uoHwPEBUKsz/flS7knuscgFM9FO05KSPn2wHnZeIDta4yTwIDAQAB +AoGBAKWfvq0IIvok7Ncm92ew/0D6/R1+2rT8xwdGQ/Nt31q98WwkqLEjxctlbKPd +J2PLIUomf0955BhhFH4JoSwjiHJQ6uishY7srjQQDX/Dxdi5wZAyxYCIVW/kAA9N +/u2s75hSD3s/rqAwOZ182DwAPIqJc4KQoYzvlKERSMDT1PJhAkEA5SUFsiSzBEMX +FyZ++ZMMs1vHrTu5oTK7WHznh9lk7dvsnp9BoUPqhiu8iJ7Q23zj0u5asz2czu11 +nnczXgU6XwJBAORM5Ib4I7nAsoUWn9wDiTwVQeE+D9P1ac9p7EHm7XXuf8o2irRZ +wYYfpXXsjk496YfyQFcQRMk0tU0gegCP7hECQFWRWqwoajUoPIInnPjjwbVki48U +I4CfqjgkBG3Fb5wnKRgezmpDK1vJD1FRRRsBay4EVhhi5KCdKfPv/V2ZxC8CQQCu +U5SxBytofJ8UhxkcTErvaR/8GYLGi//21GAGVop+YdaMlydE3cCrZODYcgCb+CSp +nS7KDG8p4KiMMz9VzJGxAkEAv85K6Sa3H8g9h7LwopBZ5tFNZUaFWo7lEP7DDMH0 +eckZTb1JVpyT/8zrDtsis4WlV9zVkVHxkIaad503BjqvEQ== +-----END RSA PRIVATE KEY----- diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/tests_that_dont_do_leakchecks.txt b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/tests_that_dont_do_leakchecks.txt new file mode 100644 index 00000000..55288a38 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/tests_that_dont_do_leakchecks.txt @@ -0,0 +1,9 @@ +test___monkey_patching.py +test__monkey_ssl_warning.py +test___monitor.py +test__monkey_scope.py +test__ares_timeout.py +test__close_backend_fd.py +test__hub_join.py +test__hub_join_timeout.py +test__issue112.py diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/tests_that_dont_monkeypatch.txt b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/tests_that_dont_monkeypatch.txt new file mode 100644 index 00000000..452e4291 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/tests_that_dont_monkeypatch.txt @@ -0,0 +1,26 @@ +test___example_servers.py +test__backdoor.py +test__example_echoserver.py +test__example_udp_client.py +test__getaddrinfo_import.py +test__example_portforwarder.py +test__pywsgi.py +test__server.py +test__server_pywsgi.py +test__socket_close.py +test__socket_dns6.py +test__socket_errors.py +test__socket_send_memoryview.py +test__socket_timeout.py +test__examples.py +test__issue330.py +test___ident.py +test___config.py +test___monitor.py +test__events.py +test__monkey_scope.py +test__iwait.py +test__ares_timeout.py +test__close_backend_fd.py +test__hub_join.py +test__hub_join_timeout.py diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/tests_that_dont_use_resolver.txt b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/tests_that_dont_use_resolver.txt new file mode 100644 index 00000000..654918e9 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/tests_that_dont_use_resolver.txt @@ -0,0 +1,136 @@ +test__all__.py +#uses socket test__api.py +test__api_timeout.py +test__ares_host_result.py +test__ares_timeout.py # explicitly uses ares resolver +# uses socket test__backdoor.py +test__close_backend_fd.py +test__core_async.py +test__core_callback.py +test__core_loop_run.py +test__core.py +test__core_stat.py +test__core_timer.py +test__core_watcher.py +test__destroy.py +# uses socket test__doctests.py +test__environ.py +test__event.py +# uses socket test__example_echoserver.py +# uses socket test__example_portforwarder.py +# uses socket test___example_servers.py +# uses bunch of things test__examples.py +# uses socket test__example_udp_client.py +# uses socket test__example_udp_server.py +test__exc_info.py +#test__execmodules.py +test__fileobject.py +# uses socket test__greenio.py +test__GreenletExit.py +test__greenlet.py +test__greenletset.py +# uses socket test__greenness.py +test__hub_join.py +test__hub_join_timeout.py +# uses socket test__hub.py +test__issue112.py +test__joinall.py +test__local.py +test__loop_callback.py +test__memleak.py +# uses lots of things test___monkey_patching.py +test__monkey.py +test__order.py +test__os.py +test__pool.py +# uses socket test__pywsgi.py +test__queue.py +test__monkey_queue.py +# uses socket test__refcount.py +test__select.py +test__semaphore.py +# uses socket test__server.py +# test__server_pywsgi.py +test__signal.py +# uses socket test__socket_close.py +# test__socket_dns6.py +# test__socket_dns.py +# test__socket_errors.py +# test__socket.py +# test__socket_ssl.py +# test__socket_timeout.py +test__subprocess_interrupted.py +test__subprocess.py +test__systemerror.py +test__threading_2.py +test__threading_patched_local.py +test__threading_vs_settrace.py +test__threadpool.py +test__timeout.py + +test__compat.py +test__core_fork.py +test__doctests.py +test__core_loop_run_sig_mod.py +test__execmodules.py +test__greenio.py +test__greenness.py +test__hub.py +test__import_blocking_in_greenlet.py +test__import_wait.py +test__issue230.py +test__issue330.py +test__issue467.py +test__issue6.py +test__issue600.py +test__issue607.py +test__issue461_471.py +test__monkey_builtins_future.py +test__monkey_hub_in_thread.py +test__monkey_logging.py +test__monkey_multiple_imports.py +test__monkey_scope.py +test__monkey_selectors.py +test__monkey_sigchld.py +test__monkey_sigchld_2.py +test__nondefaultloop.py +test__monkey_sigchld_3.py +test__real_greenlet.py +test__refcount.py +test__sleep0.py +test__subprocess_poll.py +test__threading.py +test__threading_before_monkey.py +test__threading_holding_lock_while_monkey.py +test__threading_monkey_in_thread.py +test__threading_native_before_monkey.py +test__threadpool_executor_patched.py + + +# monkey patched standard tests: +test_queue.py +test_select.py +test_signal.py +test_subprocess.py +test_threading_local.py +test_threading.py +test_thread.py +test_selectors.py +test_timeout.py + +# test_asyncore probably does use the resolver, but only +# implicitly for localhost, which is covered well enough +# elsewhere that we don't need to spend the 20s (*2) +test_asyncore.py + +test___config.py +test__destroy_default_loop.py +test__util.py +test___ident.py +test__issue639.py +test__issue_728.py +test__refcount_core.py +test__api.py +test__monitor.py +test__events.py +test__iwait.py diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/wrongcert.pem b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/wrongcert.pem new file mode 100644 index 00000000..5f92f9bc --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/tests/wrongcert.pem @@ -0,0 +1,32 @@ +-----BEGIN RSA PRIVATE KEY----- +MIICXAIBAAKBgQC89ZNxjTgWgq7Z1g0tJ65w+k7lNAj5IgjLb155UkUrz0XsHDnH +FlbsVUg2Xtk6+bo2UEYIzN7cIm5ImpmyW/2z0J1IDVDlvR2xJ659xrE0v5c2cB6T +f9lnNTwpSoeK24Nd7Jwq4j9vk95fLrdqsBq0/KVlsCXeixS/CaqqduXfvwIDAQAB +AoGAQFko4uyCgzfxr4Ezb4Mp5pN3Npqny5+Jey3r8EjSAX9Ogn+CNYgoBcdtFgbq +1yif/0sK7ohGBJU9FUCAwrqNBI9ZHB6rcy7dx+gULOmRBGckln1o5S1+smVdmOsW +7zUVLBVByKuNWqTYFlzfVd6s4iiXtAE2iHn3GCyYdlICwrECQQDhMQVxHd3EFbzg +SFmJBTARlZ2GKA3c1g/h9/XbkEPQ9/RwI3vnjJ2RaSnjlfoLl8TOcf0uOGbOEyFe +19RvCLXjAkEA1s+UE5ziF+YVkW3WolDCQ2kQ5WG9+ccfNebfh6b67B7Ln5iG0Sbg +ky9cjsO3jbMJQtlzAQnH1850oRD5Gi51dQJAIbHCDLDZU9Ok1TI+I2BhVuA6F666 +lEZ7TeZaJSYq34OaUYUdrwG9OdqwZ9sy9LUav4ESzu2lhEQchCJrKMn23QJAReqs +ZLHUeTjfXkVk7dHhWPWSlUZ6AhmIlA/AQ7Payg2/8wM/JkZEJEPvGVykms9iPUrv +frADRr+hAGe43IewnQJBAJWKZllPgKuEBPwoEldHNS8nRu61D7HzxEzQ2xnfj+Nk +2fgf1MAzzTRsikfGENhVsVWeqOcijWb6g5gsyCmlRpc= +-----END RSA PRIVATE KEY----- +-----BEGIN CERTIFICATE----- +MIICsDCCAhmgAwIBAgIJAOqYOYFJfEEoMA0GCSqGSIb3DQEBBQUAMEUxCzAJBgNV +BAYTAkFVMRMwEQYDVQQIEwpTb21lLVN0YXRlMSEwHwYDVQQKExhJbnRlcm5ldCBX +aWRnaXRzIFB0eSBMdGQwHhcNMDgwNjI2MTgxNTUyWhcNMDkwNjI2MTgxNTUyWjBF +MQswCQYDVQQGEwJBVTETMBEGA1UECBMKU29tZS1TdGF0ZTEhMB8GA1UEChMYSW50 +ZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKB +gQC89ZNxjTgWgq7Z1g0tJ65w+k7lNAj5IgjLb155UkUrz0XsHDnHFlbsVUg2Xtk6 ++bo2UEYIzN7cIm5ImpmyW/2z0J1IDVDlvR2xJ659xrE0v5c2cB6Tf9lnNTwpSoeK +24Nd7Jwq4j9vk95fLrdqsBq0/KVlsCXeixS/CaqqduXfvwIDAQABo4GnMIGkMB0G +A1UdDgQWBBTctMtI3EO9OjLI0x9Zo2ifkwIiNjB1BgNVHSMEbjBsgBTctMtI3EO9 +OjLI0x9Zo2ifkwIiNqFJpEcwRTELMAkGA1UEBhMCQVUxEzARBgNVBAgTClNvbWUt +U3RhdGUxITAfBgNVBAoTGEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZIIJAOqYOYFJ +fEEoMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEFBQADgYEAQwa7jya/DfhaDn7E +usPkpgIX8WCL2B1SqnRTXEZfBPPVq/cUmFGyEVRVATySRuMwi8PXbVcOhXXuocA+ +43W+iIsD9pXapCZhhOerCq18TC1dWK98vLUsoK8PMjB6e5H/O8bqojv0EeC+fyCw +eSHj5jpC8iZKjCHBn+mAi4cQ514= +-----END CERTIFICATE----- diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/thread.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/thread.py new file mode 100644 index 00000000..cceaf484 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/thread.py @@ -0,0 +1,114 @@ +""" +Implementation of the standard :mod:`thread` module that spawns greenlets. + +.. note:: + + This module is a helper for :mod:`gevent.monkey` and is not + intended to be used directly. For spawning greenlets in your + applications, prefer higher level constructs like + :class:`gevent.Greenlet` class or :func:`gevent.spawn`. +""" +from __future__ import absolute_import +import sys + +__implements__ = ['allocate_lock', + 'get_ident', + 'exit', + 'LockType', + 'stack_size', + 'start_new_thread', + '_local'] + +__imports__ = ['error'] +if sys.version_info[0] <= 2: + import thread as __thread__ # pylint:disable=import-error +else: + import _thread as __thread__ # pylint:disable=import-error + __target__ = '_thread' + __imports__ += ['RLock', + 'TIMEOUT_MAX', + 'allocate', + 'exit_thread', + 'interrupt_main', + 'start_new'] +error = __thread__.error +from gevent._compat import PY3 +from gevent._compat import PYPY +from gevent._util import copy_globals +from gevent.hub import getcurrent, GreenletExit +from gevent.greenlet import Greenlet +from gevent.lock import BoundedSemaphore +from gevent.local import local as _local + + +def get_ident(gr=None): + if gr is None: + gr = getcurrent() + return id(gr) + + +def start_new_thread(function, args=(), kwargs=None): + if kwargs is not None: + greenlet = Greenlet.spawn(function, *args, **kwargs) + else: + greenlet = Greenlet.spawn(function, *args) + return get_ident(greenlet) + + +class LockType(BoundedSemaphore): + # Change the ValueError into the appropriate thread error + # and any other API changes we need to make to match behaviour + _OVER_RELEASE_ERROR = __thread__.error + + if PYPY and PY3: + _OVER_RELEASE_ERROR = RuntimeError + + if PY3: + _TIMEOUT_MAX = __thread__.TIMEOUT_MAX # python 2: pylint:disable=no-member + + def acquire(self, blocking=True, timeout=-1): + # Transform the default -1 argument into the None that our + # semaphore implementation expects, and raise the same error + # the stdlib implementation does. + if timeout == -1: + timeout = None + if not blocking and timeout is not None: + raise ValueError("can't specify a timeout for a non-blocking call") + if timeout is not None: + if timeout < 0: + # in C: if(timeout < 0 && timeout != -1) + raise ValueError("timeout value must be strictly positive") + if timeout > self._TIMEOUT_MAX: + raise OverflowError('timeout value is too large') + + return BoundedSemaphore.acquire(self, blocking, timeout) + +allocate_lock = LockType + + +def exit(): + raise GreenletExit + + +if hasattr(__thread__, 'stack_size'): + _original_stack_size = __thread__.stack_size + + def stack_size(size=None): + if size is None: + return _original_stack_size() + if size > _original_stack_size(): + return _original_stack_size(size) + # not going to decrease stack_size, because otherwise other + # greenlets in this thread will suffer +else: + __implements__.remove('stack_size') + +__imports__ = copy_globals(__thread__, globals(), + only_names=__imports__, + ignore_missing_names=True) + +__all__ = __implements__ + __imports__ +__all__.remove('_local') + +# XXX interrupt_main +# XXX _count() diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/threading.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/threading.py new file mode 100644 index 00000000..570ccd6c --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/threading.py @@ -0,0 +1,235 @@ +""" +Implementation of the standard :mod:`threading` using greenlets. + +.. note:: + + This module is a helper for :mod:`gevent.monkey` and is not + intended to be used directly. For spawning greenlets in your + applications, prefer higher level constructs like + :class:`gevent.Greenlet` class or :func:`gevent.spawn`. Attributes + in this module like ``__threading__`` are implementation artifacts subject + to change at any time. + +.. versionchanged:: 1.2.3 + + Defer adjusting the stdlib's list of active threads until we are + monkey patched. Previously this was done at import time. We are + documented to only be used as a helper for monkey patching, so this should + functionally be the same, but some applications ignore the documentation and + directly import this module anyway. + + A positive consequence is that ``import gevent.threading, + threading; threading.current_thread()`` will no longer return a DummyThread + before monkey-patching. +""" +from __future__ import absolute_import + + +__implements__ = [ + 'local', + '_start_new_thread', + '_allocate_lock', + 'Lock', + '_get_ident', + '_sleep', + '_DummyThread', +] + + +import threading as __threading__ +_DummyThread_ = __threading__._DummyThread +from gevent.local import local +from gevent.thread import start_new_thread as _start_new_thread, allocate_lock as _allocate_lock, get_ident as _get_ident +from gevent.hub import sleep as _sleep, getcurrent + +# Exports, prevent unused import warnings +local = local +start_new_thread = _start_new_thread +allocate_lock = _allocate_lock +_get_ident = _get_ident +_sleep = _sleep +getcurrent = getcurrent + +Lock = _allocate_lock + + +def _cleanup(g): + __threading__._active.pop(_get_ident(g), None) + +def _make_cleanup_id(gid): + def _(_r): + __threading__._active.pop(gid, None) + return _ + +_weakref = None + +class _DummyThread(_DummyThread_): + # We avoid calling the superclass constructor. This makes us about + # twice as fast (1.16 vs 0.68usec on PyPy, 29.3 vs 17.7usec on + # CPython 2.7), and has the important effect of avoiding + # allocation and then immediate deletion of _Thread__block, a + # lock. This is especially important on PyPy where locks go + # through the cpyext API and Cython, which is known to be slow and + # potentially buggy (e.g., + # https://bitbucket.org/pypy/pypy/issues/2149/memory-leak-for-python-subclass-of-cpyext#comment-22347393) + + # These objects are constructed quite frequently in some cases, so + # the optimization matters: for example, in gunicorn, which uses + # pywsgi.WSGIServer, every request is handled in a new greenlet, + # and every request uses a logging.Logger to write the access log, + # and every call to a log method captures the current thread (by + # default). + # + # (Obviously we have to duplicate the effects of the constructor, + # at least for external state purposes, which is potentially + # slightly fragile.) + + # For the same reason, instances of this class will cleanup their own entry + # in ``threading._active`` + + # This class also solves a problem forking process with subprocess: after forking, + # Thread.__stop is called, which throws an exception when __block doesn't + # exist. + + # Capture the static things as class vars to save on memory/ + # construction time. + # In Py2, they're all private; in Py3, they become protected + _Thread__stopped = _is_stopped = _stopped = False + _Thread__initialized = _initialized = True + _Thread__daemonic = _daemonic = True + _Thread__args = _args = () + _Thread__kwargs = _kwargs = None + _Thread__target = _target = None + _Thread_ident = _ident = None + _Thread__started = _started = __threading__.Event() + _Thread__started.set() + _tstate_lock = None + + def __init__(self): # pylint:disable=super-init-not-called + #_DummyThread_.__init__(self) + + # It'd be nice to use a pattern like "greenlet-%d", but maybe somebody out + # there is checking thread names... + self._name = self._Thread__name = __threading__._newname("DummyThread-%d") + # All dummy threads in the same native thread share the same ident + # (that of the native thread) + self._set_ident() + + g = getcurrent() + gid = _get_ident(g) + __threading__._active[gid] = self + rawlink = getattr(g, 'rawlink', None) + if rawlink is not None: + # raw greenlet.greenlet greenlets don't + # have rawlink... + rawlink(_cleanup) + else: + # ... so for them we use weakrefs. + # See https://github.com/gevent/gevent/issues/918 + global _weakref + if _weakref is None: + _weakref = __import__('weakref') + ref = _weakref.ref(g, _make_cleanup_id(gid)) + self.__raw_ref = ref + + def _Thread__stop(self): + pass + + _stop = _Thread__stop # py3 + + def _wait_for_tstate_lock(self, *args, **kwargs): + # pylint:disable=arguments-differ + pass + +if hasattr(__threading__, 'main_thread'): # py 3.4+ + def main_native_thread(): + return __threading__.main_thread() # pylint:disable=no-member +else: + def main_native_thread(): + main_threads = [v for v in __threading__._active.values() + if isinstance(v, __threading__._MainThread)] + assert len(main_threads) == 1, "Too many main threads" + + return main_threads[0] + +import sys +if sys.version_info[:2] >= (3, 4): + # XXX: Issue 18808 breaks us on Python 3.4. + # Thread objects now expect a callback from the interpreter itself + # (threadmodule.c:release_sentinel). Because this never happens + # when a greenlet exits, join() and friends will block forever. + # The solution below involves capturing the greenlet when it is + # started and deferring the known broken methods to it. + + class Thread(__threading__.Thread): + _greenlet = None + + def is_alive(self): + return bool(self._greenlet) + + isAlive = is_alive + + def _set_tstate_lock(self): + self._greenlet = getcurrent() + + def run(self): + try: + super(Thread, self).run() + finally: + # avoid ref cycles, but keep in __dict__ so we can + # distinguish the started/never-started case + self._greenlet = None + self._stop() # mark as finished + + def join(self, timeout=None): + if '_greenlet' not in self.__dict__: + raise RuntimeError("Cannot join an inactive thread") + if self._greenlet is None: + return + self._greenlet.join(timeout=timeout) + + def _wait_for_tstate_lock(self, *args, **kwargs): + # pylint:disable=arguments-differ + raise NotImplementedError() + + __implements__.append('Thread') + + class Timer(Thread, __threading__.Timer): # pylint:disable=abstract-method,inherit-non-class + pass + + __implements__.append('Timer') + + # The main thread is patched up with more care + # in _gevent_will_monkey_patch + +if sys.version_info[:2] >= (3, 3): + __implements__.remove('_get_ident') + __implements__.append('get_ident') + get_ident = _get_ident + __implements__.remove('_sleep') + + # Python 3 changed the implementation of threading.RLock + # Previously it was a factory function around threading._RLock + # which in turn used _allocate_lock. Now, it wants to use + # threading._CRLock, which is imported from _thread.RLock and as such + # is implemented in C. So it bypasses our _allocate_lock function. + # Fortunately they left the Python fallback in place + assert hasattr(__threading__, '_CRLock'), "Unsupported Python version" + _CRLock = None + __implements__.append('_CRLock') + +def _gevent_will_monkey_patch(native_module, items, warn): # pylint:disable=unused-argument + # Make sure the MainThread can be found by our current greenlet ID, + # otherwise we get a new DummyThread, which cannot be joined. + # Fixes tests in test_threading_2 under PyPy. + main_thread = main_native_thread() + if __threading__.current_thread() != main_thread: + warn("Monkey-patching outside the main native thread. Some APIs " + "will not be available. Expect a KeyError to be printed at shutdown.") + return + + if _get_ident() not in __threading__._active: + main_id = main_thread.ident + del __threading__._active[main_id] + main_thread._ident = main_thread._Thread__ident = _get_ident() + __threading__._active[_get_ident()] = main_thread diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/threadpool.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/threadpool.py new file mode 100644 index 00000000..7108e4dc --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/threadpool.py @@ -0,0 +1,580 @@ +# Copyright (c) 2012 Denis Bilenko. See LICENSE for details. +from __future__ import absolute_import +import sys +import os + +from weakref import ref as wref + +from greenlet import greenlet as RawGreenlet + +from gevent._compat import integer_types +from gevent.hub import _get_hub_noargs as get_hub +from gevent.hub import getcurrent +from gevent.hub import sleep +from gevent.hub import _get_hub +from gevent.event import AsyncResult +from gevent.greenlet import Greenlet +from gevent.pool import GroupMappingMixin +from gevent.lock import Semaphore + +from gevent._threading import Lock +from gevent._threading import Queue +from gevent._threading import start_new_thread +from gevent._threading import get_thread_ident + + +__all__ = [ + 'ThreadPool', + 'ThreadResult', +] + + +class _WorkerGreenlet(RawGreenlet): + # Exists to produce a more useful repr for worker pool + # threads/greenlets. + + def __init__(self, threadpool): + RawGreenlet.__init__(self, threadpool._worker) + self.thread_ident = get_thread_ident() + self._threadpool_wref = wref(threadpool) + + # Inform the gevent.util.GreenletTree that this should be + # considered the root (for printing purposes) and to + # ignore the parent attribute. (We can't set parent to None.) + self.greenlet_tree_is_root = True + self.parent.greenlet_tree_is_ignored = True + + def __repr__(self): + return "" % ( + id(self), + self.thread_ident, + self._threadpool_wref()) + +class ThreadPool(GroupMappingMixin): + """ + .. note:: The method :meth:`apply_async` will always return a new + greenlet, bypassing the threadpool entirely. + .. caution:: Instances of this class are only true if they have + unfinished tasks. + """ + + def __init__(self, maxsize, hub=None): + if hub is None: + hub = get_hub() + self.hub = hub + self._maxsize = 0 + self.manager = None + self.pid = os.getpid() + self.fork_watcher = hub.loop.fork(ref=False) + try: + self._init(maxsize) + except: + self.fork_watcher.close() + raise + + def _set_maxsize(self, maxsize): + if not isinstance(maxsize, integer_types): + raise TypeError('maxsize must be integer: %r' % (maxsize, )) + if maxsize < 0: + raise ValueError('maxsize must not be negative: %r' % (maxsize, )) + difference = maxsize - self._maxsize + self._semaphore.counter += difference + self._maxsize = maxsize + self.adjust() + # make sure all currently blocking spawn() start unlocking if maxsize increased + self._semaphore._start_notify() + + def _get_maxsize(self): + return self._maxsize + + maxsize = property(_get_maxsize, _set_maxsize) + + def __repr__(self): + return '<%s at 0x%x %s/%s/%s hub=<%s at 0x%x thread_ident=0x%s>>' % ( + self.__class__.__name__, + id(self), + len(self), self.size, self.maxsize, + self.hub.__class__.__name__, id(self.hub), self.hub.thread_ident) + + def __len__(self): + # XXX just do unfinished_tasks property + # Note that this becomes the boolean value of this class, + # that's probably not what we want! + return self.task_queue.unfinished_tasks + + def _get_size(self): + return self._size + + def _set_size(self, size): + if size < 0: + raise ValueError('Size of the pool cannot be negative: %r' % (size, )) + if size > self._maxsize: + raise ValueError('Size of the pool cannot be bigger than maxsize: %r > %r' % (size, self._maxsize)) + if self.manager: + self.manager.kill() + while self._size < size: + self._add_thread() + delay = self.hub.loop.approx_timer_resolution + while self._size > size: + while self._size - size > self.task_queue.unfinished_tasks: + self.task_queue.put(None) + if getcurrent() is self.hub: + break + sleep(delay) + delay = min(delay * 2, .05) + if self._size: + self.fork_watcher.start(self._on_fork) + else: + self.fork_watcher.stop() + + size = property(_get_size, _set_size) + + def _init(self, maxsize): + self._size = 0 + self._semaphore = Semaphore(1) + self._lock = Lock() + self.task_queue = Queue() + self._set_maxsize(maxsize) + + def _on_fork(self): + # fork() only leaves one thread; also screws up locks; + # let's re-create locks and threads. + # NOTE: See comment in gevent.hub.reinit. + pid = os.getpid() + if pid != self.pid: + self.pid = pid + # Do not mix fork() and threads; since fork() only copies one thread + # all objects referenced by other threads has refcount that will never + # go down to 0. + self._init(self._maxsize) + + def join(self): + """Waits until all outstanding tasks have been completed.""" + delay = max(0.0005, self.hub.loop.approx_timer_resolution) + while self.task_queue.unfinished_tasks > 0: + sleep(delay) + delay = min(delay * 2, .05) + + def kill(self): + self.size = 0 + self.fork_watcher.close() + + def _adjust_step(self): + # if there is a possibility & necessity for adding a thread, do it + while self._size < self._maxsize and self.task_queue.unfinished_tasks > self._size: + self._add_thread() + # while the number of threads is more than maxsize, kill one + # we do not check what's already in task_queue - it could be all Nones + while self._size - self._maxsize > self.task_queue.unfinished_tasks: + self.task_queue.put(None) + if self._size: + self.fork_watcher.start(self._on_fork) + else: + self.fork_watcher.stop() + + def _adjust_wait(self): + delay = 0.0001 + while True: + self._adjust_step() + if self._size <= self._maxsize: + return + sleep(delay) + delay = min(delay * 2, .05) + + def adjust(self): + self._adjust_step() + if not self.manager and self._size > self._maxsize: + # might need to feed more Nones into the pool + self.manager = Greenlet.spawn(self._adjust_wait) + + def _add_thread(self): + with self._lock: + self._size += 1 + try: + start_new_thread(self.__trampoline, ()) + except: + with self._lock: + self._size -= 1 + raise + + def spawn(self, func, *args, **kwargs): + """ + Add a new task to the threadpool that will run ``func(*args, **kwargs)``. + + Waits until a slot is available. Creates a new thread if necessary. + + :return: A :class:`gevent.event.AsyncResult`. + """ + while 1: + semaphore = self._semaphore + semaphore.acquire() + if semaphore is self._semaphore: + break + + thread_result = None + try: + task_queue = self.task_queue + result = AsyncResult() + # XXX We're calling the semaphore release function in the hub, otherwise + # we get LoopExit (why?). Previously it was done with a rawlink on the + # AsyncResult and the comment that it is "competing for order with get(); this is not + # good, just make ThreadResult release the semaphore before doing anything else" + thread_result = ThreadResult(result, self.hub, semaphore.release) + task_queue.put((func, args, kwargs, thread_result)) + self.adjust() + except: + if thread_result is not None: + thread_result.destroy() + semaphore.release() + raise + return result + + def _decrease_size(self): + if sys is None: + return + _lock = getattr(self, '_lock', None) + if _lock is not None: + with _lock: + self._size -= 1 + + # XXX: This used to be false by default. It really seems like + # it should be true to avoid leaking resources. + _destroy_worker_hub = True + + + def __ignore_current_greenlet_blocking(self, hub): + if hub is not None and hub.periodic_monitoring_thread is not None: + hub.periodic_monitoring_thread.ignore_current_greenlet_blocking() + + def __trampoline(self): + # The target that we create new threads with. It exists + # solely to create the _WorkerGreenlet and switch to it. + # (the __class__ of a raw greenlet cannot be changed.) + g = _WorkerGreenlet(self) + g.switch() + + def _worker(self): + # pylint:disable=too-many-branches + need_decrease = True + try: + while 1: # tiny bit faster than True on Py2 + h = _get_hub() + if h is not None: + h.name = 'ThreadPool Worker Hub' + task_queue = self.task_queue + # While we block, don't let the monitoring thread, if any, + # report us as blocked. Indeed, so long as we never + # try to switch greenlets, don't report us as blocked--- + # the threadpool is *meant* to run blocking tasks + self.__ignore_current_greenlet_blocking(h) + task = task_queue.get() + try: + if task is None: + need_decrease = False + self._decrease_size() + # we want first to decrease size, then decrease unfinished_tasks + # otherwise, _adjust might think there's one more idle thread that + # needs to be killed + return + func, args, kwargs, thread_result = task + try: + value = func(*args, **kwargs) + except: # pylint:disable=bare-except + exc_info = getattr(sys, 'exc_info', None) + if exc_info is None: + return + thread_result.handle_error((self, func), exc_info()) + else: + if sys is None: + return + thread_result.set(value) + del value + finally: + del func, args, kwargs, thread_result, task + finally: + if sys is None: + return # pylint:disable=lost-exception + task_queue.task_done() + finally: + if need_decrease: + self._decrease_size() + if sys is not None and self._destroy_worker_hub: + hub = _get_hub() + if hub is not None: + hub.destroy(True) + del hub + + def apply_e(self, expected_errors, function, args=None, kwargs=None): + """ + .. deprecated:: 1.1a2 + Identical to :meth:`apply`; the ``expected_errors`` argument is ignored. + """ + # pylint:disable=unused-argument + # Deprecated but never documented. In the past, before + # self.apply() allowed all errors to be raised to the caller, + # expected_errors allowed a caller to specify a set of errors + # they wanted to be raised, through the wrap_errors function. + # In practice, it always took the value Exception or + # BaseException. + return self.apply(function, args, kwargs) + + def _apply_immediately(self): + # If we're being called from a different thread than the one that + # created us, e.g., because a worker task is trying to use apply() + # recursively, we have no choice but to run the task immediately; + # if we try to AsyncResult.get() in the worker thread, it's likely to have + # nothing to switch to and lead to a LoopExit. + return get_hub() is not self.hub + + def _apply_async_cb_spawn(self, callback, result): + callback(result) + + def _apply_async_use_greenlet(self): + # Always go to Greenlet because our self.spawn uses threads + return True + +class _FakeAsync(object): + + def send(self): + pass + close = stop = send + + def __call_(self, result): + "fake out for 'receiver'" + + def __bool__(self): + return False + + __nonzero__ = __bool__ + +_FakeAsync = _FakeAsync() + +class ThreadResult(object): + + # Using slots here helps to debug reference cycles/leaks + __slots__ = ('exc_info', 'async_watcher', '_call_when_ready', 'value', + 'context', 'hub', 'receiver') + + def __init__(self, receiver, hub, call_when_ready): + self.receiver = receiver + self.hub = hub + self.context = None + self.value = None + self.exc_info = () + self.async_watcher = hub.loop.async_() + self._call_when_ready = call_when_ready + self.async_watcher.start(self._on_async) + + @property + def exception(self): + return self.exc_info[1] if self.exc_info else None + + def _on_async(self): + self.async_watcher.stop() + self.async_watcher.close() + + # Typically this is pool.semaphore.release and we have to + # call this in the Hub; if we don't we get the dreaded + # LoopExit (XXX: Why?) + self._call_when_ready() + + try: + if self.exc_info: + self.hub.handle_error(self.context, *self.exc_info) + self.context = None + self.async_watcher = _FakeAsync + self.hub = None + self._call_when_ready = _FakeAsync + + self.receiver(self) + finally: + self.receiver = _FakeAsync + self.value = None + if self.exc_info: + self.exc_info = (self.exc_info[0], self.exc_info[1], None) + + def destroy(self): + self.async_watcher.stop() + self.async_watcher.close() + self.async_watcher = _FakeAsync + + self.context = None + self.hub = None + self._call_when_ready = _FakeAsync + self.receiver = _FakeAsync + + def set(self, value): + self.value = value + self.async_watcher.send() + + def handle_error(self, context, exc_info): + self.context = context + self.exc_info = exc_info + self.async_watcher.send() + + # link protocol: + def successful(self): + return self.exception is None + + +def wrap_errors(errors, function, args, kwargs): + """ + .. deprecated:: 1.1a2 + Previously used by ThreadPool.apply_e. + """ + try: + return True, function(*args, **kwargs) + except errors as ex: + return False, ex + +try: + import concurrent.futures +except ImportError: + pass +else: + __all__.append("ThreadPoolExecutor") + + from gevent.timeout import Timeout as GTimeout + from gevent._util import Lazy + from concurrent.futures import _base as cfb + + def _wrap_error(future, fn): + def cbwrap(_): + del _ + # we're called with the async result, but + # be sure to pass in ourself. Also automatically + # unlink ourself so that we don't get called multiple + # times. + try: + fn(future) + except Exception: # pylint: disable=broad-except + future.hub.print_exception((fn, future), *sys.exc_info()) + cbwrap.auto_unlink = True + return cbwrap + + def _wrap(future, fn): + def f(_): + fn(future) + f.auto_unlink = True + return f + + class _FutureProxy(object): + def __init__(self, asyncresult): + self.asyncresult = asyncresult + + # Internal implementation details of a c.f.Future + + @Lazy + def _condition(self): + from gevent import monkey + if monkey.is_module_patched('threading') or self.done(): + import threading + return threading.Condition() + # We can only properly work with conditions + # when we've been monkey-patched. This is necessary + # for the wait/as_completed module functions. + raise AttributeError("_condition") + + @Lazy + def _waiters(self): + self.asyncresult.rawlink(self.__when_done) + return [] + + def __when_done(self, _): + # We should only be called when _waiters has + # already been accessed. + waiters = getattr(self, '_waiters') + for w in waiters: # pylint:disable=not-an-iterable + if self.successful(): + w.add_result(self) + else: + w.add_exception(self) + + __when_done.auto_unlink = True + + @property + def _state(self): + if self.done(): + return cfb.FINISHED + return cfb.RUNNING + + def set_running_or_notify_cancel(self): + # Does nothing, not even any consistency checks. It's + # meant to be internal to the executor and we don't use it. + return + + def result(self, timeout=None): + try: + return self.asyncresult.result(timeout=timeout) + except GTimeout: + # XXX: Theoretically this could be a completely + # unrelated timeout instance. Do we care about that? + raise concurrent.futures.TimeoutError() + + def exception(self, timeout=None): + try: + self.asyncresult.get(timeout=timeout) + return self.asyncresult.exception + except GTimeout: + raise concurrent.futures.TimeoutError() + + def add_done_callback(self, fn): + if self.done(): + fn(self) + else: + self.asyncresult.rawlink(_wrap_error(self, fn)) + + def rawlink(self, fn): + self.asyncresult.rawlink(_wrap(self, fn)) + + def __str__(self): + return str(self.asyncresult) + + def __getattr__(self, name): + return getattr(self.asyncresult, name) + + class ThreadPoolExecutor(concurrent.futures.ThreadPoolExecutor): + """ + A version of :class:`concurrent.futures.ThreadPoolExecutor` that + always uses native threads, even when threading is monkey-patched. + + The ``Future`` objects returned from this object can be used + with gevent waiting primitives like :func:`gevent.wait`. + + .. caution:: If threading is *not* monkey-patched, then the ``Future`` + objects returned by this object are not guaranteed to work with + :func:`~concurrent.futures.as_completed` and :func:`~concurrent.futures.wait`. + The individual blocking methods like :meth:`~concurrent.futures.Future.result` + and :meth:`~concurrent.futures.Future.exception` will always work. + + .. versionadded:: 1.2a1 + This is a provisional API. + """ + + def __init__(self, max_workers): + super(ThreadPoolExecutor, self).__init__(max_workers) + self._threadpool = ThreadPool(max_workers) + self._threadpool._destroy_worker_hub = True + + def submit(self, fn, *args, **kwargs): + with self._shutdown_lock: # pylint:disable=not-context-manager + if self._shutdown: + raise RuntimeError('cannot schedule new futures after shutdown') + + future = self._threadpool.spawn(fn, *args, **kwargs) + return _FutureProxy(future) + + def shutdown(self, wait=True): + super(ThreadPoolExecutor, self).shutdown(wait) + # XXX: We don't implement wait properly + kill = getattr(self._threadpool, 'kill', None) + if kill: # pylint:disable=using-constant-test + self._threadpool.kill() + self._threadpool = None + + kill = shutdown # greentest compat + + def _adjust_thread_count(self): + # Does nothing. We don't want to spawn any "threads", + # let the threadpool handle that. + pass diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/time.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/time.py new file mode 100644 index 00000000..34abf85e --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/time.py @@ -0,0 +1,27 @@ +# Copyright (c) 2018 gevent. See LICENSE for details. +""" +The standard library :mod:`time` module, but :func:`sleep` is +gevent-aware. + +.. versionadded:: 1.3a2 +""" + +from __future__ import absolute_import + +__implements__ = [ + 'sleep', +] + +__all__ = __implements__ + +import time as __time__ + +from gevent._util import copy_globals + +__imports__ = copy_globals(__time__, globals(), + names_to_ignore=__implements__) + + + +from gevent.hub import sleep +sleep = sleep # pylint diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/timeout.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/timeout.py new file mode 100644 index 00000000..383d0901 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/timeout.py @@ -0,0 +1,373 @@ +# Copyright (c) 2009-2010 Denis Bilenko. See LICENSE for details. +""" +Timeouts. + +Many functions in :mod:`gevent` have a *timeout* argument that allows +limiting the time the function will block. When that is not available, +the :class:`Timeout` class and :func:`with_timeout` function in this +module add timeouts to arbitrary code. + +.. warning:: + + Timeouts can only work when the greenlet switches to the hub. + If a blocking function is called or an intense calculation is ongoing during + which no switches occur, :class:`Timeout` is powerless. +""" +from __future__ import absolute_import, print_function, division + +from gevent._compat import string_types +from gevent._util import _NONE + +from greenlet import getcurrent +from gevent._hub_local import get_hub_noargs as get_hub + +__all__ = [ + 'Timeout', + 'with_timeout', +] + + +class _FakeTimer(object): + # An object that mimics the API of get_hub().loop.timer, but + # without allocating any native resources. This is useful for timeouts + # that will never expire. + # Also partially mimics the API of Timeout itself for use in _start_new_or_dummy + + # This object is used as a singleton, so it should be + # immutable. + __slots__ = () + + @property + def pending(self): + return False + + active = pending + + @property + def seconds(self): + "Always returns None" + + timer = exception = seconds + + def start(self, *args, **kwargs): + # pylint:disable=unused-argument + raise AssertionError("non-expiring timer cannot be started") + + def stop(self): + return + + cancel = stop + + stop = close = cancel + + def __enter__(self): + return self + + def __exit__(self, _t, _v, _tb): + return + +_FakeTimer = _FakeTimer() + + +class Timeout(BaseException): + """ + Timeout(seconds=None, exception=None, ref=True, priority=-1) + + Raise *exception* in the current greenlet after *seconds* + have elapsed:: + + timeout = Timeout(seconds, exception) + timeout.start() + try: + ... # exception will be raised here, after *seconds* passed since start() call + finally: + timeout.close() + + .. note:: + + If the code that the timeout was protecting finishes + executing before the timeout elapses, be sure to ``close`` the + timeout so it is not unexpectedly raised in the future. Even if it + is raised, it is a best practice to close it. This ``try/finally`` + construct or a ``with`` statement is a recommended pattern. (If + the timeout object will be started again, use ``cancel`` instead + of ``close``; this is rare.) + + When *exception* is omitted or ``None``, the ``Timeout`` instance + itself is raised:: + + >>> import gevent + >>> gevent.Timeout(0.1).start() + >>> gevent.sleep(0.2) #doctest: +IGNORE_EXCEPTION_DETAIL + Traceback (most recent call last): + ... + Timeout: 0.1 seconds + + If the *seconds* argument is not given or is ``None`` (e.g., + ``Timeout()``), then the timeout will never expire and never raise + *exception*. This is convenient for creating functions which take + an optional timeout parameter of their own. (Note that this is **not** + the same thing as a *seconds* value of ``0``.) + + :: + + def function(args, timeout=None): + "A function with an optional timeout." + timer = Timeout(timeout) + with timer: + ... + + .. caution:: + + A *seconds* value less than ``0.0`` (e.g., ``-1``) is poorly defined. In the future, + support for negative values is likely to do the same thing as a value + of ``None`` or ``0`` + + A *seconds* value of ``0`` requests that the event loop spin and poll for I/O; + it will immediately expire as soon as control returns to the event loop. + + .. rubric:: Use As A Context Manager + + To simplify starting and canceling timeouts, the ``with`` + statement can be used:: + + with gevent.Timeout(seconds, exception) as timeout: + pass # ... code block ... + + This is equivalent to the try/finally block above with one + additional feature: if *exception* is the literal ``False``, the + timeout is still raised, but the context manager suppresses it, so + the code outside the with-block won't see it. + + This is handy for adding a timeout to the functions that don't + support a *timeout* parameter themselves:: + + data = None + with gevent.Timeout(5, False): + data = mysock.makefile().readline() + if data is None: + ... # 5 seconds passed without reading a line + else: + ... # a line was read within 5 seconds + + .. caution:: + + If ``readline()`` above catches and doesn't re-raise + :exc:`BaseException` (for example, with a bare ``except:``), then + your timeout will fail to function and control won't be returned + to you when you expect. + + .. rubric:: Catching Timeouts + + When catching timeouts, keep in mind that the one you catch may + not be the one you have set (a calling function may have set its + own timeout); if you going to silence a timeout, always check that + it's the instance you need:: + + timeout = Timeout(1) + timeout.start() + try: + ... + except Timeout as t: + if t is not timeout: + raise # not my timeout + finally: + timeout.close() + + + .. versionchanged:: 1.1b2 + + If *seconds* is not given or is ``None``, no longer allocate a + native timer object that will never be started. + + .. versionchanged:: 1.1 + + Add warning about negative *seconds* values. + + .. versionchanged:: 1.3a1 + + Timeout objects now have a :meth:`close` + method that must be called when the timeout will no longer be + used to properly clean up native resources. + The ``with`` statement does this automatically. + + """ + + # We inherit a __dict__ from BaseException, so __slots__ actually + # makes us larger. + + def __init__(self, seconds=None, exception=None, ref=True, priority=-1, + _one_shot=False): + BaseException.__init__(self) + self.seconds = seconds + self.exception = exception + self._one_shot = _one_shot + if seconds is None: + # Avoid going through the timer codepath if no timeout is + # desired; this avoids some CFFI interactions on PyPy that can lead to a + # RuntimeError if this implementation is used during an `import` statement. See + # https://bitbucket.org/pypy/pypy/issues/2089/crash-in-pypy-260-linux64-with-gevent-11b1 + # and https://github.com/gevent/gevent/issues/618. + # Plus, in general, it should be more efficient + + self.timer = _FakeTimer + else: + # XXX: A timer <= 0 could cause libuv to block the loop; we catch + # that case in libuv/loop.py + self.timer = get_hub().loop.timer(seconds or 0.0, ref=ref, priority=priority) + + def start(self): + """Schedule the timeout.""" + if self.pending: + raise AssertionError('%r is already started; to restart it, cancel it first' % self) + + if self.seconds is None: + # "fake" timeout (never expires) + return + + if self.exception is None or self.exception is False or isinstance(self.exception, string_types): + # timeout that raises self + throws = self + else: + # regular timeout with user-provided exception + throws = self.exception + + # Make sure the timer updates the current time so that we don't + # expire prematurely. + self.timer.start(getcurrent().throw, throws, update=True) + + @classmethod + def start_new(cls, timeout=None, exception=None, ref=True, _one_shot=False): + """Create a started :class:`Timeout`. + + This is a shortcut, the exact action depends on *timeout*'s type: + + * If *timeout* is a :class:`Timeout`, then call its :meth:`start` method + if it's not already begun. + * Otherwise, create a new :class:`Timeout` instance, passing (*timeout*, *exception*) as + arguments, then call its :meth:`start` method. + + Returns the :class:`Timeout` instance. + """ + if isinstance(timeout, Timeout): + if not timeout.pending: + timeout.start() + return timeout + timeout = cls(timeout, exception, ref=ref, _one_shot=_one_shot) + timeout.start() + return timeout + + @staticmethod + def _start_new_or_dummy(timeout, exception=None, ref=True): + # Internal use only in 1.1 + # Return an object with a 'cancel' method; if timeout is None, + # this will be a shared instance object that does nothing. Otherwise, + # return an actual Timeout. Because negative values are hard to reason about, + # and are often used as sentinels in Python APIs, in the future it's likely + # that a negative timeout will also return the shared instance. + # This saves the previously common idiom of 'timer = Timeout.start_new(t) if t is not None else None' + # followed by 'if timer is not None: timer.cancel()'. + # That idiom was used to avoid any object allocations. + # A staticmethod is slightly faster under CPython, compared to a classmethod; + # under PyPy in synthetic benchmarks it makes no difference. + if timeout is None: + return _FakeTimer + return Timeout.start_new(timeout, exception, ref, _one_shot=True) + + @property + def pending(self): + """True if the timeout is scheduled to be raised.""" + return self.timer.pending or self.timer.active + + def cancel(self): + """ + If the timeout is pending, cancel it. Otherwise, do nothing. + + The timeout object can be :meth:`started ` again. If + you will not start the timeout again, you should use + :meth:`close` instead. + """ + self.timer.stop() + if self._one_shot: + self.close() + + def close(self): + """ + Close the timeout and free resources. The timer cannot be started again + after this method has been used. + """ + self.timer.stop() + self.timer.close() + self.timer = _FakeTimer + + def __repr__(self): + classname = type(self).__name__ + if self.pending: + pending = ' pending' + else: + pending = '' + if self.exception is None: + exception = '' + else: + exception = ' exception=%r' % self.exception + return '<%s at %s seconds=%s%s%s>' % (classname, hex(id(self)), self.seconds, exception, pending) + + def __str__(self): + """ + >>> raise Timeout #doctest: +IGNORE_EXCEPTION_DETAIL + Traceback (most recent call last): + ... + Timeout + """ + if self.seconds is None: + return '' + + suffix = '' if self.seconds == 1 else 's' + + if self.exception is None: + return '%s second%s' % (self.seconds, suffix) + if self.exception is False: + return '%s second%s (silent)' % (self.seconds, suffix) + return '%s second%s: %s' % (self.seconds, suffix, self.exception) + + def __enter__(self): + """ + Start and return the timer. If the timer is already started, just return it. + """ + if not self.pending: + self.start() + return self + + def __exit__(self, typ, value, tb): + """ + Stop the timer. + + .. versionchanged:: 1.3a1 + The underlying native timer is also stopped. This object cannot be + used again. + """ + self.close() + if value is self and self.exception is False: + return True # Suppress the exception + + +def with_timeout(seconds, function, *args, **kwds): + """Wrap a call to *function* with a timeout; if the called + function fails to return before the timeout, cancel it and return a + flag value, provided by *timeout_value* keyword argument. + + If timeout expires but *timeout_value* is not provided, raise :class:`Timeout`. + + Keyword argument *timeout_value* is not passed to *function*. + """ + timeout_value = kwds.pop("timeout_value", _NONE) + timeout = Timeout.start_new(seconds, _one_shot=True) + try: + try: + return function(*args, **kwds) + except Timeout as ex: + if ex is timeout and timeout_value is not _NONE: + return timeout_value + raise + finally: + timeout.cancel() diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/util.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/util.py new file mode 100644 index 00000000..b24898c3 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/util.py @@ -0,0 +1,603 @@ +# Copyright (c) 2009 Denis Bilenko. See LICENSE for details. +""" +Low-level utilities. +""" + +from __future__ import absolute_import, print_function, division + +import functools +import pprint +import sys +import traceback + +from greenlet import getcurrent + +from gevent._compat import perf_counter +from gevent._compat import PYPY +from gevent._compat import thread_mod_name +from gevent._util import _NONE + +__all__ = [ + 'format_run_info', + 'print_run_info', + 'GreenletTree', + 'wrap_errors', + 'assert_switches', +] + +# PyPy is very slow at formatting stacks +# for some reason. +_STACK_LIMIT = 20 if PYPY else None + + +def _noop(): + return None + +def _ready(): + return False + +class wrap_errors(object): + """ + Helper to make function return an exception, rather than raise it. + + Because every exception that is unhandled by greenlet will be logged, + it is desirable to prevent non-error exceptions from leaving a greenlet. + This can done with a simple ``try/except`` construct:: + + def wrapped_func(*args, **kwargs): + try: + return func(*args, **kwargs) + except (TypeError, ValueError, AttributeError) as ex: + return ex + + This class provides a shortcut to write that in one line:: + + wrapped_func = wrap_errors((TypeError, ValueError, AttributeError), func) + + It also preserves ``__str__`` and ``__repr__`` of the original function. + """ + # QQQ could also support using wrap_errors as a decorator + + def __init__(self, errors, func): + """ + Calling this makes a new function from *func*, such that it catches *errors* (an + :exc:`BaseException` subclass, or a tuple of :exc:`BaseException` subclasses) and + return it as a value. + """ + self.__errors = errors + self.__func = func + # Set __doc__, __wrapped__, etc, especially useful on Python 3. + functools.update_wrapper(self, func) + + def __call__(self, *args, **kwargs): + func = self.__func + try: + return func(*args, **kwargs) + except self.__errors as ex: + return ex + + def __str__(self): + return str(self.__func) + + def __repr__(self): + return repr(self.__func) + + def __getattr__(self, name): + return getattr(self.__func, name) + + +def print_run_info(thread_stacks=True, greenlet_stacks=True, limit=_NONE, file=None): + """ + Call `format_run_info` and print the results to *file*. + + If *file* is not given, `sys.stderr` will be used. + + .. versionadded:: 1.3b1 + """ + lines = format_run_info(thread_stacks=thread_stacks, + greenlet_stacks=greenlet_stacks, + limit=limit) + file = sys.stderr if file is None else file + for l in lines: + print(l, file=file) + + +def format_run_info(thread_stacks=True, + greenlet_stacks=True, + limit=_NONE, + current_thread_ident=None): + """ + format_run_info(thread_stacks=True, greenlet_stacks=True, limit=None) -> [str] + + Request information about the running threads of the current process. + + This is a debugging utility. Its output has no guarantees other than being + intended for human consumption. + + :keyword bool thread_stacks: If true, then include the stacks for + running threads. + :keyword bool greenlet_stacks: If true, then include the stacks for + running greenlets. (Spawning stacks will always be printed.) + Setting this to False can reduce the output volume considerably + without reducing the overall information if *thread_stacks* is true + and you can associate a greenlet to a thread (using ``thread_ident`` + printed values). + :keyword int limit: If given, passed directly to `traceback.format_stack`. + If not given, this defaults to the whole stack under CPython, and a + smaller stack under PyPy. + + :return: A sequence of text lines detailing the stacks of running + threads and greenlets. (One greenlet will duplicate one thread, + the current thread and greenlet. If there are multiple running threads, + the stack for the current greenlet may be incorrectly duplicated in multiple + greenlets.) + Extra information about + :class:`gevent.Greenlet` object will also be returned. + + .. versionadded:: 1.3a1 + .. versionchanged:: 1.3a2 + Renamed from ``dump_stacks`` to reflect the fact that this + prints additional information about greenlets, including their + spawning stack, parent, locals, and any spawn tree locals. + .. versionchanged:: 1.3b1 + Added the *thread_stacks*, *greenlet_stacks*, and *limit* params. + """ + if current_thread_ident is None: + from gevent import monkey + current_thread_ident = monkey.get_original(thread_mod_name, 'get_ident')() + + lines = [] + + limit = _STACK_LIMIT if limit is _NONE else limit + _format_thread_info(lines, thread_stacks, limit, current_thread_ident) + _format_greenlet_info(lines, greenlet_stacks, limit) + return lines + + +def _format_thread_info(lines, thread_stacks, limit, current_thread_ident): + import threading + + threads = {th.ident: th for th in threading.enumerate()} + + lines.append('*' * 80) + lines.append('* Threads') + + thread = None + frame = None + for thread_ident, frame in sys._current_frames().items(): + lines.append("*" * 80) + thread = threads.get(thread_ident) + name = thread.name if thread else None + if getattr(thread, 'gevent_monitoring_thread', None): + name = repr(thread.gevent_monitoring_thread()) + if current_thread_ident == thread_ident: + name = '%s) (CURRENT' % (name,) + lines.append('Thread 0x%x (%s)\n' % (thread_ident, name)) + if thread_stacks: + lines.append(''.join(traceback.format_stack(frame, limit))) + else: + lines.append('\t...stack elided...') + + # We may have captured our own frame, creating a reference + # cycle, so clear it out. + del thread + del frame + del lines + del threads + +def _format_greenlet_info(lines, greenlet_stacks, limit): + # Use the gc module to inspect all objects to find the greenlets + # since there isn't a global registry + lines.append('*' * 80) + lines.append('* Greenlets') + lines.append('*' * 80) + for tree in GreenletTree.forest(): + lines.extend(tree.format_lines(details={ + 'running_stacks': greenlet_stacks, + 'running_stack_limit': limit, + })) + + del lines + +dump_stacks = format_run_info + +def _line(f): + @functools.wraps(f) + def w(self, *args, **kwargs): + r = f(self, *args, **kwargs) + self.lines.append(r) + + return w + +class _TreeFormatter(object): + UP_AND_RIGHT = '+' + HORIZONTAL = '-' + VERTICAL = '|' + VERTICAL_AND_RIGHT = '+' + DATA = ':' + + label_space = 1 + horiz_width = 3 + indent = 1 + + def __init__(self, details, depth=0): + self.lines = [] + self.depth = depth + self.details = details + if not details: + self.child_data = lambda *args, **kwargs: None + + def deeper(self): + return type(self)(self.details, self.depth + 1) + + @_line + def node_label(self, text): + return text + + @_line + def child_head(self, label, right=VERTICAL_AND_RIGHT): + return ( + ' ' * self.indent + + right + + self.HORIZONTAL * self.horiz_width + + ' ' * self.label_space + + label + ) + + def last_child_head(self, label): + return self.child_head(label, self.UP_AND_RIGHT) + + @_line + def child_tail(self, line, vertical=VERTICAL): + return ( + ' ' * self.indent + + vertical + + ' ' * self.horiz_width + + line + ) + + def last_child_tail(self, line): + return self.child_tail(line, vertical=' ' * len(self.VERTICAL)) + + @_line + def child_data(self, data, data_marker=DATA): # pylint:disable=method-hidden + return (( + ' ' * self.indent + + (data_marker if not self.depth else ' ') + + ' ' * self.horiz_width + + ' ' * self.label_space + + data + ),) + + def last_child_data(self, data): + return self.child_data(data, ' ') + + def child_multidata(self, data): + # Remove embedded newlines + for l in data.splitlines(): + self.child_data(l) + + +class GreenletTree(object): + """ + Represents a tree of greenlets. + + In gevent, the *parent* of a greenlet is usually the hub, so this + tree is primarily arganized along the *spawning_greenlet* dimension. + + This object has a small str form showing this hierarchy. The `format` + method can output more details. The exact output is unspecified but is + intended to be human readable. + + Use the `forest` method to get the root greenlet trees for + all threads, and the `current_tree` to get the root greenlet tree for + the current thread. + """ + + #: The greenlet this tree represents. + greenlet = None + + + def __init__(self, greenlet): + self.greenlet = greenlet + self.child_trees = [] + + def add_child(self, tree): + if tree is self: + return + self.child_trees.append(tree) + + @property + def root(self): + return self.greenlet.parent is None + + def __getattr__(self, name): + return getattr(self.greenlet, name) + + DEFAULT_DETAILS = { + 'running_stacks': True, + 'running_stack_limit': _STACK_LIMIT, + 'spawning_stacks': True, + 'locals': True, + } + + def format_lines(self, details=True): + """ + Return a sequence of lines for the greenlet tree. + + :keyword bool details: If true (the default), + then include more informative details in the output. + """ + if not isinstance(details, dict): + if not details: + details = {} + else: + details = self.DEFAULT_DETAILS.copy() + else: + params = details + details = self.DEFAULT_DETAILS.copy() + details.update(params) + tree = _TreeFormatter(details, depth=0) + lines = [l[0] if isinstance(l, tuple) else l + for l in self._render(tree)] + return lines + + def format(self, details=True): + """ + Like `format_lines` but returns a string. + """ + lines = self.format_lines(details) + return '\n'.join(lines) + + def __str__(self): + return self.format(False) + + @staticmethod + def __render_tb(tree, label, frame, limit): + tree.child_data(label) + tb = ''.join(traceback.format_stack(frame, limit)) + tree.child_multidata(tb) + + @staticmethod + def __spawning_parent(greenlet): + return (getattr(greenlet, 'spawning_greenlet', None) or _noop)() + + def __render_locals(self, tree): + # Defer the import to avoid cycles + from gevent.local import all_local_dicts_for_greenlet + + gr_locals = all_local_dicts_for_greenlet(self.greenlet) + if gr_locals: + tree.child_data("Greenlet Locals:") + for (kind, idl), vals in gr_locals: + if not vals: + continue # not set in this greenlet; ignore it. + tree.child_data(" Local %s at %s" % (kind, hex(idl))) + tree.child_multidata(" " + pprint.pformat(vals)) + + def _render(self, tree): + label = repr(self.greenlet) + if not self.greenlet: # Not running or dead + # raw greenlets do not have ready + if getattr(self.greenlet, 'ready', _ready)(): + label += '; finished' + if self.greenlet.value is not None: + label += ' with value ' + repr(self.greenlet.value)[:30] + elif getattr(self.greenlet, 'exception', None) is not None: + label += ' with exception ' + repr(self.greenlet.exception) + else: + label += '; not running' + tree.node_label(label) + + tree.child_data('Parent: ' + repr(self.greenlet.parent)) + + if getattr(self.greenlet, 'gevent_monitoring_thread', None) is not None: + tree.child_data('Monitoring Thread:' + repr(self.greenlet.gevent_monitoring_thread())) + + if self.greenlet and tree.details and tree.details['running_stacks']: + self.__render_tb(tree, 'Running:', self.greenlet.gr_frame, + tree.details['running_stack_limit']) + + + spawning_stack = getattr(self.greenlet, 'spawning_stack', None) + if spawning_stack and tree.details and tree.details['spawning_stacks']: + # We already placed a limit on the spawning stack when we captured it. + self.__render_tb(tree, 'Spawned at:', spawning_stack, None) + + spawning_parent = self.__spawning_parent(self.greenlet) + tree_locals = getattr(self.greenlet, 'spawn_tree_locals', None) + if tree_locals and tree_locals is not getattr(spawning_parent, 'spawn_tree_locals', None): + tree.child_data('Spawn Tree Locals') + tree.child_multidata(pprint.pformat(tree_locals)) + + self.__render_locals(tree) + self.__render_children(tree) + return tree.lines + + def __render_children(self, tree): + children = sorted(self.child_trees, + key=lambda c: ( + # raw greenlets first + getattr(c, 'minimal_ident', -1), + # running greenlets first + getattr(c, 'ready', _ready)(), + id(c.parent))) + for n, child in enumerate(children): + child_tree = child._render(tree.deeper()) + + head = tree.child_head + tail = tree.child_tail + data = tree.child_data + + if n == len(children) - 1: + # last child does not get the line drawn + head = tree.last_child_head + tail = tree.last_child_tail + data = tree.last_child_data + + head(child_tree.pop(0)) + for child_data in child_tree: + if isinstance(child_data, tuple): + data(child_data[0]) + else: + tail(child_data) + + return tree.lines + + + @staticmethod + def _root_greenlet(greenlet): + while greenlet.parent is not None and not getattr(greenlet, 'greenlet_tree_is_root', False): + greenlet = greenlet.parent + return greenlet + + @classmethod + def _forest(cls): + from gevent._greenlet_primitives import get_reachable_greenlets + main_greenlet = cls._root_greenlet(getcurrent()) + + trees = {} + roots = {} + current_tree = roots[main_greenlet] = trees[main_greenlet] = cls(main_greenlet) + + glets = get_reachable_greenlets() + + for ob in glets: + spawn_parent = cls.__spawning_parent(ob) + + if spawn_parent is None: + root = cls._root_greenlet(ob) + try: + tree = roots[root] + except KeyError: # pragma: no cover + tree = GreenletTree(root) + roots[root] = trees[root] = tree + else: + try: + tree = trees[spawn_parent] + except KeyError: # pragma: no cover + tree = trees[spawn_parent] = cls(spawn_parent) + + try: + child_tree = trees[ob] + except KeyError: + trees[ob] = child_tree = cls(ob) + tree.add_child(child_tree) + + return roots, current_tree + + @classmethod + def forest(cls): + """ + forest() -> sequence + + Return a sequence of `GreenletTree`, one for each running + native thread. + """ + + return list(cls._forest()[0].values()) + + @classmethod + def current_tree(cls): + """ + current_tree() -> GreenletTree + + Returns the `GreenletTree` for the current thread. + """ + return cls._forest()[1] + +class _FailedToSwitch(AssertionError): + pass + +class assert_switches(object): + """ + A context manager for ensuring a block of code switches greenlets. + + This performs a similar function as the :doc:`monitoring thread + `, but the scope is limited to the body of the with + statement. If the code within the body doesn't yield to the hub + (and doesn't raise an exception), then upon exiting the + context manager an :exc:`AssertionError` will be raised. + + This is useful in unit tests and for debugging purposes. + + :keyword float max_blocking_time: If given, the body is allowed + to block for up to this many fractional seconds before + an error is raised. + :keyword bool hub_only: If True, then *max_blocking_time* only + refers to the amount of time spent between switches into the + hub. If False, then it refers to the maximum time between + *any* switches. If *max_blocking_time* is not given, has no + effect. + + Example:: + + # This will always raise an exception: nothing switched + with assert_switches(): + pass + + # This will never raise an exception; nothing switched, + # but it happened very fast + with assert_switches(max_blocking_time=1.0): + pass + + .. versionadded:: 1.3 + + .. versionchanged:: 1.4 + If an exception is raised, it now includes information about + the duration of blocking and the parameters of this object. + """ + + hub = None + tracer = None + _entered = None + + + def __init__(self, max_blocking_time=None, hub_only=False): + self.max_blocking_time = max_blocking_time + self.hub_only = hub_only + + def __enter__(self): + from gevent import get_hub + from gevent import _tracer + + self.hub = hub = get_hub() + + # TODO: We could optimize this to use the GreenletTracer + # installed by the monitoring thread, if there is one. + # As it is, we will chain trace calls back to it. + if not self.max_blocking_time: + self.tracer = _tracer.GreenletTracer() + elif self.hub_only: + self.tracer = _tracer.HubSwitchTracer(hub, self.max_blocking_time) + else: + self.tracer = _tracer.MaxSwitchTracer(hub, self.max_blocking_time) + + self._entered = perf_counter() + self.tracer.monitor_current_greenlet_blocking() + return self + + def __exit__(self, t, v, tb): + self.tracer.kill() + hub = self.hub; self.hub = None + tracer = self.tracer; self.tracer = None + + # Only check if there was no exception raised, we + # don't want to hide anything + if t is not None: + return + + + did_block = tracer.did_block_hub(hub) + if did_block: + execution_time_s = perf_counter() - self._entered + active_greenlet = did_block[1] + report_lines = tracer.did_block_hub_report(hub, active_greenlet, {}) + + message = 'To the hub' if self.hub_only else 'To any greenlet' + message += ' in %.4f seconds' % (execution_time_s,) + max_block = self.max_blocking_time + message += ' (max allowed %.4f seconds)' % (max_block,) if max_block else '' + message += '\n' + message += '\n'.join(report_lines) + raise _FailedToSwitch(message) diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/win32util.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/win32util.py new file mode 100644 index 00000000..7158d693 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/gevent/win32util.py @@ -0,0 +1,98 @@ +# Copyright (c) 2001-2007 Twisted Matrix Laboratories. +# Permission is hereby granted, free of charge, to any person obtaining +# a copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject to +# the following conditions: +# +# The above copyright notice and this permission notice shall be +# included in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +"""Error formatting function for Windows. + +The code is taken from twisted.python.win32 module. +""" + +from __future__ import absolute_import +import os + + +__all__ = ['formatError'] + + +class _ErrorFormatter(object): + """ + Formatter for Windows error messages. + + @ivar winError: A callable which takes one integer error number argument + and returns an L{exceptions.WindowsError} instance for that error (like + L{ctypes.WinError}). + + @ivar formatMessage: A callable which takes one integer error number + argument and returns a C{str} giving the message for that error (like + L{win32api.FormatMessage}). + + @ivar errorTab: A mapping from integer error numbers to C{str} messages + which correspond to those errors (like L{socket.errorTab}). + """ + def __init__(self, WinError, FormatMessage, errorTab): + self.winError = WinError + self.formatMessage = FormatMessage + self.errorTab = errorTab + + @classmethod + def fromEnvironment(cls): + """ + Get as many of the platform-specific error translation objects as + possible and return an instance of C{cls} created with them. + """ + try: + from ctypes import WinError + except ImportError: + WinError = None + try: + from win32api import FormatMessage + except ImportError: + FormatMessage = None + try: + from socket import errorTab + except ImportError: + errorTab = None + return cls(WinError, FormatMessage, errorTab) + + def formatError(self, errorcode): + """ + Returns the string associated with a Windows error message, such as the + ones found in socket.error. + + Attempts direct lookup against the win32 API via ctypes and then + pywin32 if available), then in the error table in the socket module, + then finally defaulting to C{os.strerror}. + + @param errorcode: the Windows error code + @type errorcode: C{int} + + @return: The error message string + @rtype: C{str} + """ + if self.winError is not None: + return str(self.winError(errorcode)) + if self.formatMessage is not None: + return self.formatMessage(errorcode) + if self.errorTab is not None: + result = self.errorTab.get(errorcode) + if result is not None: + return result + return os.strerror(errorcode) + +formatError = _ErrorFormatter.fromEnvironment().formatError diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/greenlet-0.4.15.dist-info/INSTALLER b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/greenlet-0.4.15.dist-info/INSTALLER new file mode 100644 index 00000000..a1b589e3 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/greenlet-0.4.15.dist-info/INSTALLER @@ -0,0 +1 @@ +pip diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/greenlet-0.4.15.dist-info/METADATA b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/greenlet-0.4.15.dist-info/METADATA new file mode 100644 index 00000000..ed06223a --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/greenlet-0.4.15.dist-info/METADATA @@ -0,0 +1,90 @@ +Metadata-Version: 2.1 +Name: greenlet +Version: 0.4.15 +Summary: Lightweight in-process concurrent programming +Home-page: https://github.com/python-greenlet/greenlet +Maintainer: Alexey Borzenkov +Maintainer-email: snaury@gmail.com +License: MIT License +Platform: any +Classifier: Intended Audience :: Developers +Classifier: License :: OSI Approved :: MIT License +Classifier: Natural Language :: English +Classifier: Programming Language :: C +Classifier: Programming Language :: Python +Classifier: Programming Language :: Python :: 2 +Classifier: Programming Language :: Python :: 2.4 +Classifier: Programming Language :: Python :: 2.5 +Classifier: Programming Language :: Python :: 2.6 +Classifier: Programming Language :: Python :: 2.7 +Classifier: Programming Language :: Python :: 3 +Classifier: Programming Language :: Python :: 3.0 +Classifier: Programming Language :: Python :: 3.1 +Classifier: Programming Language :: Python :: 3.2 +Classifier: Programming Language :: Python :: 3.3 +Classifier: Programming Language :: Python :: 3.4 +Classifier: Programming Language :: Python :: 3.5 +Classifier: Programming Language :: Python :: 3.6 +Classifier: Programming Language :: Python :: 3.7 +Classifier: Operating System :: OS Independent +Classifier: Topic :: Software Development :: Libraries :: Python Modules + +.. image:: https://secure.travis-ci.org/python-greenlet/greenlet.png + :target: http://travis-ci.org/python-greenlet/greenlet + +The greenlet package is a spin-off of Stackless, a version of CPython +that supports micro-threads called "tasklets". Tasklets run +pseudo-concurrently (typically in a single or a few OS-level threads) +and are synchronized with data exchanges on "channels". + +A "greenlet", on the other hand, is a still more primitive notion of +micro-thread with no implicit scheduling; coroutines, in other +words. This is useful when you want to control exactly when your code +runs. You can build custom scheduled micro-threads on top of greenlet; +however, it seems that greenlets are useful on their own as a way to +make advanced control flow structures. For example, we can recreate +generators; the difference with Python's own generators is that our +generators can call nested functions and the nested functions can +yield values too. Additionally, you don't need a "yield" keyword. See +the example in tests/test_generator.py. + +Greenlets are provided as a C extension module for the regular +unmodified interpreter. + +Greenlets are lightweight coroutines for in-process concurrent +programming. + +Who is using Greenlet? +====================== + +There are several libraries that use Greenlet as a more flexible +alternative to Python's built in coroutine support: + + - `Concurrence`_ + - `Eventlet`_ + - `Gevent`_ + +.. _Concurrence: http://opensource.hyves.org/concurrence/ +.. _Eventlet: http://eventlet.net/ +.. _Gevent: http://www.gevent.org/ + +Getting Greenlet +================ + +The easiest way to get Greenlet is to install it with pip or +easy_install:: + + pip install greenlet + easy_install greenlet + + +Source code archives and windows installers are available on the +python package index at https://pypi.python.org/pypi/greenlet + +The source code repository is hosted on github: +https://github.com/python-greenlet/greenlet + +Documentation is available on readthedocs.org: +https://greenlet.readthedocs.io + + diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/greenlet-0.4.15.dist-info/RECORD b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/greenlet-0.4.15.dist-info/RECORD new file mode 100644 index 00000000..05e6495e --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/greenlet-0.4.15.dist-info/RECORD @@ -0,0 +1,7 @@ +../../Include/greenlet/greenlet.h,sha256=SlcS2utGqDJj1KnMDK745yitcJKNUIbAUaFA8rN-4sY,3972 +greenlet-0.4.15.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4 +greenlet-0.4.15.dist-info/METADATA,sha256=QAeWa2K18gQhCDt1FDxaJts5YpJZ7B8ez3wBioeUmDQ,3304 +greenlet-0.4.15.dist-info/RECORD,, +greenlet-0.4.15.dist-info/WHEEL,sha256=2zzu_YdXIu-xXZDqaBZlJhw2t5mxGHySzFgniB0mw4c,102 +greenlet-0.4.15.dist-info/top_level.txt,sha256=YSnRsCRoO61JGlP57o8iKL6rdLWDWuiyKD8ekpWUsDc,9 +greenlet.cp37-win32.pyd,sha256=LWopR7NYmB3QsJBdhWWakeF92fc-fpg0z4aenjnmcDE,22528 diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/greenlet-0.4.15.dist-info/WHEEL b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/greenlet-0.4.15.dist-info/WHEEL new file mode 100644 index 00000000..96f89d9c --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/greenlet-0.4.15.dist-info/WHEEL @@ -0,0 +1,5 @@ +Wheel-Version: 1.0 +Generator: bdist_wheel (0.31.1) +Root-Is-Purelib: false +Tag: cp37-cp37m-win32 + diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/greenlet-0.4.15.dist-info/top_level.txt b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/greenlet-0.4.15.dist-info/top_level.txt new file mode 100644 index 00000000..46725be4 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/greenlet-0.4.15.dist-info/top_level.txt @@ -0,0 +1 @@ +greenlet diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/greenlet.cp37-win32.pyd b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/greenlet.cp37-win32.pyd new file mode 100644 index 0000000000000000000000000000000000000000..efc3317179ec3af69b128a7d1721be2ee6a4d610 GIT binary patch literal 22528 zcmeHv3wTr4mF~7JKQJ;D4^N%MNlsc39>K0{$?{9GW&8pHMqp#(0+xk!Y{`)ym5u-> zgpdk1s3)|{d^D3u(-|nu9om~t$uvz!nx;-nW0R1Cq-nwwI+skD^khsrZbFIEp*{Cs z`{>v*Hl696@0;)5JC(nE&e?0Pz4m(Twb$N9^19C*WJ!!M1B$9Lb^>?$IQjJtUrY&% z&Aav4dF;tKuikbdVePB8HTnD@p+DHy74-B79iHCaK1tXv3c+x%;O`Y`);9`0eO@sy zBO~1$Bfa{amM>>KRr+(i7+(AK&ofcCDJAFW-ae+?ZA#gBBZu41r}Dewdr<2|C3^84Q?Fa4bQJ))HJ`bK|;kH)&5WUgAq)+VGd+b4gqMaQ|o z5^tNEFpsenfKb6_@j_foC{7f5qUS`$Qh0Uh&JF`W%Ec#x)(edL@os13Tb#?l^A;uOFydMQRWDQiA z`Zz%{FBl4T0K|2&7Y~F-bmKlwjwc5CfJi!G2T{l%8&TpuPR3ToRsUN*s*5i=nMqyz zIIiUx1{X7Z7*70f_`~-b5fwJcm*iSwL}8L8q9jNHUFOpz*)rrD%UAvlN*+sAeu`V> zQ$u67s$r8FPE)d>(bh3jg33Z3#j{sBvJV& z4Zi)}4WRlYtgU>3&0ClBbCxEmXtC?nLN8w#lz4 z-vMvx+iJ3F8#6&^%7>^Ae`(t<)$lKrFH(=;ZlmuYY2+`^a)i(Zhwd|2hQ`*fI!ZNV z4mjLjdvQt`iCh`KAjzIZTVyfUkj~&uV6dB!8ES}ptL4ql+58 zsLas^KTd;Zp-sNmIH-m*OC2=qePofhK#Py7CP?WKHBm~Ix0%KYaA|Cz5uQc6JRS{S z9K4db@2^qOz(4+-s!oC*m;{evL=KLq3E@u_@#nf`Zkz+sJ8w8M)V(5KdNn@VTi0o`*|BP8wq< z(0Z1ECQ~>~&0=`)%`vbcH7gB|E;Y-D+cp~X{!3=qp!-wG%TW5@kd)k=*!t?Sqnq29 zDVotl*DM!ZZ(d8+qE&Qt)Zp6rU{*iBWqA4RW+%TT+xcyA3BTo9aeMSD$v)iVT6T0R zzZ;IW<9?tv?P!4NgXgcR>PYf27&?I^up`uX)Qj3k@@8C#?~&xKyp^V$FZR@J*nHOz z8`&E`oo0qsmwDKTu1%gm{e=rm&Ol%`QQdcl=F_{-lKjtHbh$RISzcvN8qIvVYSDoW z*-2;ckaE}f(xeZ|-MkXWD}sPTw3J>{jwcKwB)txz`-WN(xrUY9fFe3^jDGDoRq4XR*atvXw&6+H zj0-9-tTG0d!NA$vS-3N;Tf|-bZ^>;oEmFfdYB*cD0<_lFZNthBIKE``?S=@-?+84s z%mux{q0D{1MV0uOAn^Mi;>z7HjfGQRNxLfN;>)tQNOYG zk0)@=M=lwg<#5{I70jvMCxmw^m1u_W%i;UCYvX^OIsgPpV=cb@#8MkTAD?Z#ap?C$ zV>L%;bvO{d+!DEP>yL=zZlU##(a5O!lTk}DwMA<$M{6gdwO1c|?6DtFe+_^xfE`Z& z)ZIpo(4DL-hWniEPV=3i;PWs=F~s^4>psU=XDMvNOyO-u?6}>3f-01hh1Wha7h%7% zbU&fp|hZGM6=f

4GNii?}duzScaY2Qqc?xWlEU!y@b(!VL0UpPE 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 IKc<2I4YBRz;s5{u literal 0 HcmV?d00001 diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/grequests-0.4.0.dist-info/AUTHORS.rst b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/grequests-0.4.0.dist-info/AUTHORS.rst new file mode 100644 index 00000000..b93507b7 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/grequests-0.4.0.dist-info/AUTHORS.rst @@ -0,0 +1,12 @@ +GRequests is written and maintained by Kenneth Reitz and +various contributors: + +Development Lead +```````````````` + +- Kenneth Reitz + +Patches and Suggestions +``````````````````````` +- Kracekumar +- Spencer Young diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/grequests-0.4.0.dist-info/INSTALLER b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/grequests-0.4.0.dist-info/INSTALLER new file mode 100644 index 00000000..a1b589e3 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/grequests-0.4.0.dist-info/INSTALLER @@ -0,0 +1 @@ +pip diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/grequests-0.4.0.dist-info/LICENSE b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/grequests-0.4.0.dist-info/LICENSE new file mode 100644 index 00000000..92b09966 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/grequests-0.4.0.dist-info/LICENSE @@ -0,0 +1,8 @@ +Copyright (c) 2012, Kenneth Reitz +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + +Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. +Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/grequests-0.4.0.dist-info/METADATA b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/grequests-0.4.0.dist-info/METADATA new file mode 100644 index 00000000..27d3476f --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/grequests-0.4.0.dist-info/METADATA @@ -0,0 +1,51 @@ +Metadata-Version: 2.1 +Name: grequests +Version: 0.4.0 +Summary: Requests + Gevent +Home-page: https://github.com/kennethreitz/grequests +Author: Kenneth Reitz +Author-email: me@kennethreitz.com +License: BSD +Platform: any +Classifier: Environment :: Web Environment +Classifier: Intended Audience :: Developers +Classifier: License :: OSI Approved :: BSD License +Classifier: Operating System :: OS Independent +Classifier: Programming Language :: Python +Classifier: Programming Language :: Python :: 2.7 +Classifier: Programming Language :: Python :: 3 +Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content +Classifier: Topic :: Software Development :: Libraries :: Python Modules +Requires-Dist: gevent +Requires-Dist: requests + + +GRequests allows you to use Requests with Gevent to make asynchronous HTTP +Requests easily. + +Usage +----- + +Usage is simple:: + + import grequests + + urls = [ + 'http://www.heroku.com', + 'http://tablib.org', + 'http://httpbin.org', + 'http://python-requests.org', + 'http://kennethreitz.com' + ] + +Create a set of unsent Requests:: + + >>> rs = (grequests.get(u) for u in urls) + +Send them all at the same time:: + + >>> grequests.map(rs) + [, , , , ] + + + diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/grequests-0.4.0.dist-info/RECORD b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/grequests-0.4.0.dist-info/RECORD new file mode 100644 index 00000000..ced81b3e --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/grequests-0.4.0.dist-info/RECORD @@ -0,0 +1,9 @@ +__pycache__/grequests.cpython-37.pyc,, +grequests-0.4.0.dist-info/AUTHORS.rst,sha256=ewdckzqaNiB22iSBKBE2FzmAGZUF2d4QZOgsjWsLLP4,279 +grequests-0.4.0.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4 +grequests-0.4.0.dist-info/LICENSE,sha256=QGOIKokT5LN0V9WP5mAL2XW6BTyNsujGshjnychXXKg,1283 +grequests-0.4.0.dist-info/METADATA,sha256=OFvAy0BijQRUVxjUgJtPlJ8tYaL1llxieBsdoDCnFZ4,1295 +grequests-0.4.0.dist-info/RECORD,, +grequests-0.4.0.dist-info/WHEEL,sha256=S8S5VL-stOTSZDYxHyf0KP7eds0J72qrK0Evu3TfyAY,92 +grequests-0.4.0.dist-info/top_level.txt,sha256=SvomK5-sUWHynE71HKM4mN2xdcHn1pjlCL3FsRYU4CI,10 +grequests.py,sha256=ROfKNTnDmVtkKRCaUy5EruF_9CWY8462urH45k74unk,4982 diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/grequests-0.4.0.dist-info/WHEEL b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/grequests-0.4.0.dist-info/WHEEL new file mode 100644 index 00000000..c57a5970 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/grequests-0.4.0.dist-info/WHEEL @@ -0,0 +1,5 @@ +Wheel-Version: 1.0 +Generator: bdist_wheel (0.33.4) +Root-Is-Purelib: true +Tag: py3-none-any + diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/grequests-0.4.0.dist-info/top_level.txt b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/grequests-0.4.0.dist-info/top_level.txt new file mode 100644 index 00000000..2276f043 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/grequests-0.4.0.dist-info/top_level.txt @@ -0,0 +1 @@ +grequests diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/grequests.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/grequests.py new file mode 100644 index 00000000..582cffbb --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/grequests.py @@ -0,0 +1,155 @@ +# -*- coding: utf-8 -*- + +""" +grequests +~~~~~~~~~ + +This module contains an asynchronous replica of ``requests.api``, powered +by gevent. All API methods return a ``Request`` instance (as opposed to +``Response``). A list of requests can be sent with ``map()``. +""" +from functools import partial +import traceback +try: + import gevent + from gevent import monkey as curious_george + from gevent.pool import Pool +except ImportError: + raise RuntimeError('Gevent is required for grequests.') + +# Monkey-patch. +curious_george.patch_all(thread=False, select=False) + +from requests import Session + + +__all__ = ( + 'map', 'imap', + 'get', 'options', 'head', 'post', 'put', 'patch', 'delete', 'request' +) + + +class AsyncRequest(object): + """ Asynchronous request. + + Accept same parameters as ``Session.request`` and some additional: + + :param session: Session which will do request + :param callback: Callback called on response. + Same as passing ``hooks={'response': callback}`` + """ + def __init__(self, method, url, **kwargs): + #: Request method + self.method = method + #: URL to request + self.url = url + #: Associated ``Session`` + self.session = kwargs.pop('session', None) + if self.session is None: + self.session = Session() + + callback = kwargs.pop('callback', None) + if callback: + kwargs['hooks'] = {'response': callback} + + #: The rest arguments for ``Session.request`` + self.kwargs = kwargs + #: Resulting ``Response`` + self.response = None + + def send(self, **kwargs): + """ + Prepares request based on parameter passed to constructor and optional ``kwargs```. + Then sends request and saves response to :attr:`response` + + :returns: ``Response`` + """ + merged_kwargs = {} + merged_kwargs.update(self.kwargs) + merged_kwargs.update(kwargs) + try: + self.response = self.session.request(self.method, + self.url, **merged_kwargs) + except Exception as e: + self.exception = e + self.traceback = traceback.format_exc() + return self + + +def send(r, pool=None, stream=False): + """Sends the request object using the specified pool. If a pool isn't + specified this method blocks. Pools are useful because you can specify size + and can hence limit concurrency.""" + if pool is not None: + return pool.spawn(r.send, stream=stream) + + return gevent.spawn(r.send, stream=stream) + + +# Shortcuts for creating AsyncRequest with appropriate HTTP method +get = partial(AsyncRequest, 'GET') +options = partial(AsyncRequest, 'OPTIONS') +head = partial(AsyncRequest, 'HEAD') +post = partial(AsyncRequest, 'POST') +put = partial(AsyncRequest, 'PUT') +patch = partial(AsyncRequest, 'PATCH') +delete = partial(AsyncRequest, 'DELETE') + +# synonym +def request(method, url, **kwargs): + return AsyncRequest(method, url, **kwargs) + + +def map(requests, stream=False, size=None, exception_handler=None, gtimeout=None): + """Concurrently converts a list of Requests to Responses. + + :param requests: a collection of Request objects. + :param stream: If True, the content will not be downloaded immediately. + :param size: Specifies the number of requests to make at a time. If None, no throttling occurs. + :param exception_handler: Callback function, called when exception occured. Params: Request, Exception + :param gtimeout: Gevent joinall timeout in seconds. (Note: unrelated to requests timeout) + """ + + requests = list(requests) + + pool = Pool(size) if size else None + jobs = [send(r, pool, stream=stream) for r in requests] + gevent.joinall(jobs, timeout=gtimeout) + + ret = [] + + for request in requests: + if request.response is not None: + ret.append(request.response) + elif exception_handler and hasattr(request, 'exception'): + ret.append(exception_handler(request, request.exception)) + else: + ret.append(None) + + return ret + + +def imap(requests, stream=False, size=2, exception_handler=None): + """Concurrently converts a generator object of Requests to + a generator of Responses. + + :param requests: a generator of Request objects. + :param stream: If True, the content will not be downloaded immediately. + :param size: Specifies the number of requests to make at a time. default is 2 + :param exception_handler: Callback function, called when exception occurred. Params: Request, Exception + """ + + pool = Pool(size) + + def send(r): + return r.send(stream=stream) + + for request in pool.imap_unordered(send, requests): + if request.response is not None: + yield request.response + elif exception_handler: + ex_result = exception_handler(request, request.exception) + if ex_result is not None: + yield ex_result + + pool.join() diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pycparser-2.19.dist-info/INSTALLER b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pycparser-2.19.dist-info/INSTALLER new file mode 100644 index 00000000..a1b589e3 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pycparser-2.19.dist-info/INSTALLER @@ -0,0 +1 @@ +pip diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pycparser-2.19.dist-info/LICENSE b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pycparser-2.19.dist-info/LICENSE new file mode 100644 index 00000000..79b7547b --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pycparser-2.19.dist-info/LICENSE @@ -0,0 +1,27 @@ +pycparser -- A C parser in Python + +Copyright (c) 2008-2017, Eli Bendersky +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. +* Neither the name of Eli Bendersky nor the names of its contributors may + be used to endorse or promote products derived from this software without + specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE +GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT +OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pycparser-2.19.dist-info/METADATA b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pycparser-2.19.dist-info/METADATA new file mode 100644 index 00000000..2d52ad35 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pycparser-2.19.dist-info/METADATA @@ -0,0 +1,27 @@ +Metadata-Version: 2.1 +Name: pycparser +Version: 2.19 +Summary: C parser in Python +Home-page: https://github.com/eliben/pycparser +Author: Eli Bendersky +Author-email: eliben@gmail.com +Maintainer: Eli Bendersky +License: BSD +Platform: Cross Platform +Classifier: Development Status :: 5 - Production/Stable +Classifier: License :: OSI Approved :: BSD License +Classifier: Programming Language :: Python :: 2 +Classifier: Programming Language :: Python :: 2.7 +Classifier: Programming Language :: Python :: 3 +Classifier: Programming Language :: Python :: 3.4 +Classifier: Programming Language :: Python :: 3.5 +Classifier: Programming Language :: Python :: 3.6 +Requires-Python: >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.* + + +pycparser is a complete parser of the C language, written in +pure Python using the PLY parsing library. +It parses C code into an AST and can serve as a front-end for +C compilers or analysis tools. + + diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pycparser-2.19.dist-info/RECORD b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pycparser-2.19.dist-info/RECORD new file mode 100644 index 00000000..3a5d3f05 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pycparser-2.19.dist-info/RECORD @@ -0,0 +1,41 @@ +pycparser-2.19.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4 +pycparser-2.19.dist-info/LICENSE,sha256=PHZimICuwvhXjtkUcBpP-eXai2CsuLfsZ1q_g8kMUWg,1536 +pycparser-2.19.dist-info/METADATA,sha256=CDPZp84-Z-e3JjYcfl1VYRqPDCb63NDFNnkYWOku4K0,907 +pycparser-2.19.dist-info/RECORD,, +pycparser-2.19.dist-info/WHEEL,sha256=05Ahrak1u2K61DpLp9CDNSbUImLTITCMom_cqTFk6pE,116 +pycparser-2.19.dist-info/top_level.txt,sha256=c-lPcS74L_8KoH7IE6PQF5ofyirRQNV4VhkbSFIPeWM,10 +pycparser/__init__.py,sha256=l19iRjKsyE_eW9SvElacCuSbVkQzqyNSFCK3wv8ineA,2815 +pycparser/__pycache__/__init__.cpython-37.pyc,, +pycparser/__pycache__/_ast_gen.cpython-37.pyc,, +pycparser/__pycache__/_build_tables.cpython-37.pyc,, +pycparser/__pycache__/ast_transforms.cpython-37.pyc,, +pycparser/__pycache__/c_ast.cpython-37.pyc,, +pycparser/__pycache__/c_generator.cpython-37.pyc,, +pycparser/__pycache__/c_lexer.cpython-37.pyc,, +pycparser/__pycache__/c_parser.cpython-37.pyc,, +pycparser/__pycache__/lextab.cpython-37.pyc,, +pycparser/__pycache__/plyparser.cpython-37.pyc,, +pycparser/__pycache__/yacctab.cpython-37.pyc,, +pycparser/_ast_gen.py,sha256=_LbRr_kKa2EHeb7y0gV525JV29nzCUbTH4oZ-9I4qIs,10607 +pycparser/_build_tables.py,sha256=e5lcS2_Y4XpQfAArDg4PeHkoGwWT6tbA_8zOiOl4Hzw,859 +pycparser/_c_ast.cfg,sha256=1W8-DHa5RqZvyhha_0b4VvKL0CEYv9W0xFs_YwiyEHY,4206 +pycparser/ast_transforms.py,sha256=K8cflFZMTgNLGg6X2jufnIuan38GTSo47G6tePMc-70,3576 +pycparser/c_ast.py,sha256=5x9bn9FMEenOJdfKdIUWLcgnZ4ib6bWpwCa8Hi5FA6M,31317 +pycparser/c_generator.py,sha256=4ZBVFnaxDXpGi7w4N87DvAj9y2rEiDYzB2gga2YBuak,14668 +pycparser/c_lexer.py,sha256=9W9CoPxy1CQQazn9kwE1Y6QPm17A_-NyUKjwiq3YS5Q,14464 +pycparser/c_parser.py,sha256=iBynfNgX_EqIAnYVByK5fu1YK1EFOvIR0pie42Hp_rY,69222 +pycparser/lextab.py,sha256=FyjRIsaq2wViDqJNYScURuc7GDW5F12VuYxOJLh1j4g,7011 +pycparser/ply/__init__.py,sha256=q4s86QwRsYRa20L9ueSxfh-hPihpftBjDOvYa2_SS2Y,102 +pycparser/ply/__pycache__/__init__.cpython-37.pyc,, +pycparser/ply/__pycache__/cpp.cpython-37.pyc,, +pycparser/ply/__pycache__/ctokens.cpython-37.pyc,, +pycparser/ply/__pycache__/lex.cpython-37.pyc,, +pycparser/ply/__pycache__/yacc.cpython-37.pyc,, +pycparser/ply/__pycache__/ygen.cpython-37.pyc,, +pycparser/ply/cpp.py,sha256=UtC3ylTWp5_1MKA-PLCuwKQR8zSOnlGuGGIdzj8xS98,33282 +pycparser/ply/ctokens.py,sha256=MKksnN40TehPhgVfxCJhjj_BjL943apreABKYz-bl0Y,3177 +pycparser/ply/lex.py,sha256=7Qol57x702HZwjA3ZLp-84CUEWq1EehW-N67Wzghi-M,42918 +pycparser/ply/yacc.py,sha256=eatSDkRLgRr6X3-hoDk_SQQv065R0BdL2K7fQ54CgVM,137323 +pycparser/ply/ygen.py,sha256=2JYNeYtrPz1JzLSLO3d4GsS8zJU8jY_I_CR1VI9gWrA,2251 +pycparser/plyparser.py,sha256=saGNjpsgncQz-hHEh45f28BLqopTxHffaJg_9BCZhi8,4873 +pycparser/yacctab.py,sha256=KOewsHNgbSYaYrLvDJr7K3jXj-7qou0ngyNEnhDmyB4,169715 diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pycparser-2.19.dist-info/WHEEL b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pycparser-2.19.dist-info/WHEEL new file mode 100644 index 00000000..c8240f03 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pycparser-2.19.dist-info/WHEEL @@ -0,0 +1,6 @@ +Wheel-Version: 1.0 +Generator: bdist_wheel (0.33.1) +Root-Is-Purelib: true +Tag: py2-none-any +Tag: py3-none-any + diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pycparser-2.19.dist-info/top_level.txt b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pycparser-2.19.dist-info/top_level.txt new file mode 100644 index 00000000..dc1c9e10 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pycparser-2.19.dist-info/top_level.txt @@ -0,0 +1 @@ +pycparser diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pycparser/__init__.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pycparser/__init__.py new file mode 100644 index 00000000..b67389f4 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pycparser/__init__.py @@ -0,0 +1,90 @@ +#----------------------------------------------------------------- +# pycparser: __init__.py +# +# This package file exports some convenience functions for +# interacting with pycparser +# +# Eli Bendersky [https://eli.thegreenplace.net/] +# License: BSD +#----------------------------------------------------------------- +__all__ = ['c_lexer', 'c_parser', 'c_ast'] +__version__ = '2.19' + +import io +from subprocess import check_output +from .c_parser import CParser + + +def preprocess_file(filename, cpp_path='cpp', cpp_args=''): + """ Preprocess a file using cpp. + + filename: + Name of the file you want to preprocess. + + cpp_path: + cpp_args: + Refer to the documentation of parse_file for the meaning of these + arguments. + + When successful, returns the preprocessed file's contents. + Errors from cpp will be printed out. + """ + path_list = [cpp_path] + if isinstance(cpp_args, list): + path_list += cpp_args + elif cpp_args != '': + path_list += [cpp_args] + path_list += [filename] + + try: + # Note the use of universal_newlines to treat all newlines + # as \n for Python's purpose + text = check_output(path_list, universal_newlines=True) + except OSError as e: + raise RuntimeError("Unable to invoke 'cpp'. " + + 'Make sure its path was passed correctly\n' + + ('Original error: %s' % e)) + + return text + + +def parse_file(filename, use_cpp=False, cpp_path='cpp', cpp_args='', + parser=None): + """ Parse a C file using pycparser. + + filename: + Name of the file you want to parse. + + use_cpp: + Set to True if you want to execute the C pre-processor + on the file prior to parsing it. + + cpp_path: + If use_cpp is True, this is the path to 'cpp' on your + system. If no path is provided, it attempts to just + execute 'cpp', so it must be in your PATH. + + cpp_args: + If use_cpp is True, set this to the command line arguments strings + to cpp. Be careful with quotes - it's best to pass a raw string + (r'') here. For example: + r'-I../utils/fake_libc_include' + If several arguments are required, pass a list of strings. + + parser: + Optional parser object to be used instead of the default CParser + + When successful, an AST is returned. ParseError can be + thrown if the file doesn't parse successfully. + + Errors from cpp will be printed out. + """ + if use_cpp: + text = preprocess_file(filename, cpp_path, cpp_args) + else: + with io.open(filename) as f: + text = f.read() + + if parser is None: + parser = CParser() + return parser.parse(text, filename) diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pycparser/_ast_gen.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pycparser/_ast_gen.py new file mode 100644 index 00000000..5ec2d3df --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pycparser/_ast_gen.py @@ -0,0 +1,338 @@ +#----------------------------------------------------------------- +# _ast_gen.py +# +# Generates the AST Node classes from a specification given in +# a configuration file +# +# The design of this module was inspired by astgen.py from the +# Python 2.5 code-base. +# +# Eli Bendersky [https://eli.thegreenplace.net/] +# License: BSD +#----------------------------------------------------------------- +import pprint +from string import Template + + +class ASTCodeGenerator(object): + def __init__(self, cfg_filename='_c_ast.cfg'): + """ Initialize the code generator from a configuration + file. + """ + self.cfg_filename = cfg_filename + self.node_cfg = [NodeCfg(name, contents) + for (name, contents) in self.parse_cfgfile(cfg_filename)] + + def generate(self, file=None): + """ Generates the code into file, an open file buffer. + """ + src = Template(_PROLOGUE_COMMENT).substitute( + cfg_filename=self.cfg_filename) + + src += _PROLOGUE_CODE + for node_cfg in self.node_cfg: + src += node_cfg.generate_source() + '\n\n' + + file.write(src) + + def parse_cfgfile(self, filename): + """ Parse the configuration file and yield pairs of + (name, contents) for each node. + """ + with open(filename, "r") as f: + for line in f: + line = line.strip() + if not line or line.startswith('#'): + continue + colon_i = line.find(':') + lbracket_i = line.find('[') + rbracket_i = line.find(']') + if colon_i < 1 or lbracket_i <= colon_i or rbracket_i <= lbracket_i: + raise RuntimeError("Invalid line in %s:\n%s\n" % (filename, line)) + + name = line[:colon_i] + val = line[lbracket_i + 1:rbracket_i] + vallist = [v.strip() for v in val.split(',')] if val else [] + yield name, vallist + + +class NodeCfg(object): + """ Node configuration. + + name: node name + contents: a list of contents - attributes and child nodes + See comment at the top of the configuration file for details. + """ + + def __init__(self, name, contents): + self.name = name + self.all_entries = [] + self.attr = [] + self.child = [] + self.seq_child = [] + + for entry in contents: + clean_entry = entry.rstrip('*') + self.all_entries.append(clean_entry) + + if entry.endswith('**'): + self.seq_child.append(clean_entry) + elif entry.endswith('*'): + self.child.append(clean_entry) + else: + self.attr.append(entry) + + def generate_source(self): + src = self._gen_init() + src += '\n' + self._gen_children() + src += '\n' + self._gen_iter() + + src += '\n' + self._gen_attr_names() + return src + + def _gen_init(self): + src = "class %s(Node):\n" % self.name + + if self.all_entries: + args = ', '.join(self.all_entries) + slots = ', '.join("'{0}'".format(e) for e in self.all_entries) + slots += ", 'coord', '__weakref__'" + arglist = '(self, %s, coord=None)' % args + else: + slots = "'coord', '__weakref__'" + arglist = '(self, coord=None)' + + src += " __slots__ = (%s)\n" % slots + src += " def __init__%s:\n" % arglist + + for name in self.all_entries + ['coord']: + src += " self.%s = %s\n" % (name, name) + + return src + + def _gen_children(self): + src = ' def children(self):\n' + + if self.all_entries: + src += ' nodelist = []\n' + + for child in self.child: + src += ( + ' if self.%(child)s is not None:' + + ' nodelist.append(("%(child)s", self.%(child)s))\n') % ( + dict(child=child)) + + for seq_child in self.seq_child: + src += ( + ' for i, child in enumerate(self.%(child)s or []):\n' + ' nodelist.append(("%(child)s[%%d]" %% i, child))\n') % ( + dict(child=seq_child)) + + src += ' return tuple(nodelist)\n' + else: + src += ' return ()\n' + + return src + + def _gen_iter(self): + src = ' def __iter__(self):\n' + + if self.all_entries: + for child in self.child: + src += ( + ' if self.%(child)s is not None:\n' + + ' yield self.%(child)s\n') % (dict(child=child)) + + for seq_child in self.seq_child: + src += ( + ' for child in (self.%(child)s or []):\n' + ' yield child\n') % (dict(child=seq_child)) + + if not (self.child or self.seq_child): + # Empty generator + src += ( + ' return\n' + + ' yield\n') + else: + # Empty generator + src += ( + ' return\n' + + ' yield\n') + + return src + + def _gen_attr_names(self): + src = " attr_names = (" + ''.join("%r, " % nm for nm in self.attr) + ')' + return src + + +_PROLOGUE_COMMENT = \ +r'''#----------------------------------------------------------------- +# ** ATTENTION ** +# This code was automatically generated from the file: +# $cfg_filename +# +# Do not modify it directly. Modify the configuration file and +# run the generator again. +# ** ** *** ** ** +# +# pycparser: c_ast.py +# +# AST Node classes. +# +# Eli Bendersky [https://eli.thegreenplace.net/] +# License: BSD +#----------------------------------------------------------------- + +''' + +_PROLOGUE_CODE = r''' +import sys + +def _repr(obj): + """ + Get the representation of an object, with dedicated pprint-like format for lists. + """ + if isinstance(obj, list): + return '[' + (',\n '.join((_repr(e).replace('\n', '\n ') for e in obj))) + '\n]' + else: + return repr(obj) + +class Node(object): + __slots__ = () + """ Abstract base class for AST nodes. + """ + def __repr__(self): + """ Generates a python representation of the current node + """ + result = self.__class__.__name__ + '(' + + indent = '' + separator = '' + for name in self.__slots__[:-2]: + result += separator + result += indent + result += name + '=' + (_repr(getattr(self, name)).replace('\n', '\n ' + (' ' * (len(name) + len(self.__class__.__name__))))) + + separator = ',' + indent = '\n ' + (' ' * len(self.__class__.__name__)) + + result += indent + ')' + + return result + + def children(self): + """ A sequence of all children that are Nodes + """ + pass + + def show(self, buf=sys.stdout, offset=0, attrnames=False, nodenames=False, showcoord=False, _my_node_name=None): + """ Pretty print the Node and all its attributes and + children (recursively) to a buffer. + + buf: + Open IO buffer into which the Node is printed. + + offset: + Initial offset (amount of leading spaces) + + attrnames: + True if you want to see the attribute names in + name=value pairs. False to only see the values. + + nodenames: + True if you want to see the actual node names + within their parents. + + showcoord: + Do you want the coordinates of each Node to be + displayed. + """ + lead = ' ' * offset + if nodenames and _my_node_name is not None: + buf.write(lead + self.__class__.__name__+ ' <' + _my_node_name + '>: ') + else: + buf.write(lead + self.__class__.__name__+ ': ') + + if self.attr_names: + if attrnames: + nvlist = [(n, getattr(self,n)) for n in self.attr_names] + attrstr = ', '.join('%s=%s' % nv for nv in nvlist) + else: + vlist = [getattr(self, n) for n in self.attr_names] + attrstr = ', '.join('%s' % v for v in vlist) + buf.write(attrstr) + + if showcoord: + buf.write(' (at %s)' % self.coord) + buf.write('\n') + + for (child_name, child) in self.children(): + child.show( + buf, + offset=offset + 2, + attrnames=attrnames, + nodenames=nodenames, + showcoord=showcoord, + _my_node_name=child_name) + + +class NodeVisitor(object): + """ A base NodeVisitor class for visiting c_ast nodes. + Subclass it and define your own visit_XXX methods, where + XXX is the class name you want to visit with these + methods. + + For example: + + class ConstantVisitor(NodeVisitor): + def __init__(self): + self.values = [] + + def visit_Constant(self, node): + self.values.append(node.value) + + Creates a list of values of all the constant nodes + encountered below the given node. To use it: + + cv = ConstantVisitor() + cv.visit(node) + + Notes: + + * generic_visit() will be called for AST nodes for which + no visit_XXX method was defined. + * The children of nodes for which a visit_XXX was + defined will not be visited - if you need this, call + generic_visit() on the node. + You can use: + NodeVisitor.generic_visit(self, node) + * Modeled after Python's own AST visiting facilities + (the ast module of Python 3.0) + """ + + _method_cache = None + + def visit(self, node): + """ Visit a node. + """ + + if self._method_cache is None: + self._method_cache = {} + + visitor = self._method_cache.get(node.__class__.__name__, None) + if visitor is None: + method = 'visit_' + node.__class__.__name__ + visitor = getattr(self, method, self.generic_visit) + self._method_cache[node.__class__.__name__] = visitor + + return visitor(node) + + def generic_visit(self, node): + """ Called if no explicit visitor function exists for a + node. Implements preorder visiting of the node. + """ + for c in node: + self.visit(c) + +''' diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pycparser/_build_tables.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pycparser/_build_tables.py new file mode 100644 index 00000000..94a38918 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pycparser/_build_tables.py @@ -0,0 +1,33 @@ +#----------------------------------------------------------------- +# pycparser: _build_tables.py +# +# A dummy for generating the lexing/parsing tables and and +# compiling them into .pyc for faster execution in optimized mode. +# Also generates AST code from the configuration file. +# Should be called from the pycparser directory. +# +# Eli Bendersky [https://eli.thegreenplace.net/] +# License: BSD +#----------------------------------------------------------------- + +# Generate c_ast.py +from _ast_gen import ASTCodeGenerator +ast_gen = ASTCodeGenerator('_c_ast.cfg') +ast_gen.generate(open('c_ast.py', 'w')) + +import sys +sys.path[0:0] = ['.', '..'] +from pycparser import c_parser + +# Generates the tables +# +c_parser.CParser( + lex_optimize=True, + yacc_debug=False, + yacc_optimize=True) + +# Load to compile into .pyc +# +import lextab +import yacctab +import c_ast diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pycparser/_c_ast.cfg b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pycparser/_c_ast.cfg new file mode 100644 index 00000000..b93d50bb --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pycparser/_c_ast.cfg @@ -0,0 +1,191 @@ +#----------------------------------------------------------------- +# pycparser: _c_ast.cfg +# +# Defines the AST Node classes used in pycparser. +# +# Each entry is a Node sub-class name, listing the attributes +# and child nodes of the class: +# * - a child node +# ** - a sequence of child nodes +# - an attribute +# +# Eli Bendersky [https://eli.thegreenplace.net/] +# License: BSD +#----------------------------------------------------------------- + +# ArrayDecl is a nested declaration of an array with the given type. +# dim: the dimension (for example, constant 42) +# dim_quals: list of dimension qualifiers, to support C99's allowing 'const' +# and 'static' within the array dimension in function declarations. +ArrayDecl: [type*, dim*, dim_quals] + +ArrayRef: [name*, subscript*] + +# op: =, +=, /= etc. +# +Assignment: [op, lvalue*, rvalue*] + +BinaryOp: [op, left*, right*] + +Break: [] + +Case: [expr*, stmts**] + +Cast: [to_type*, expr*] + +# Compound statement in C99 is a list of block items (declarations or +# statements). +# +Compound: [block_items**] + +# Compound literal (anonymous aggregate) for C99. +# (type-name) {initializer_list} +# type: the typename +# init: InitList for the initializer list +# +CompoundLiteral: [type*, init*] + +# type: int, char, float, etc. see CLexer for constant token types +# +Constant: [type, value] + +Continue: [] + +# name: the variable being declared +# quals: list of qualifiers (const, volatile) +# funcspec: list function specifiers (i.e. inline in C99) +# storage: list of storage specifiers (extern, register, etc.) +# type: declaration type (probably nested with all the modifiers) +# init: initialization value, or None +# bitsize: bit field size, or None +# +Decl: [name, quals, storage, funcspec, type*, init*, bitsize*] + +DeclList: [decls**] + +Default: [stmts**] + +DoWhile: [cond*, stmt*] + +# Represents the ellipsis (...) parameter in a function +# declaration +# +EllipsisParam: [] + +# An empty statement (a semicolon ';' on its own) +# +EmptyStatement: [] + +# Enumeration type specifier +# name: an optional ID +# values: an EnumeratorList +# +Enum: [name, values*] + +# A name/value pair for enumeration values +# +Enumerator: [name, value*] + +# A list of enumerators +# +EnumeratorList: [enumerators**] + +# A list of expressions separated by the comma operator. +# +ExprList: [exprs**] + +# This is the top of the AST, representing a single C file (a +# translation unit in K&R jargon). It contains a list of +# "external-declaration"s, which is either declarations (Decl), +# Typedef or function definitions (FuncDef). +# +FileAST: [ext**] + +# for (init; cond; next) stmt +# +For: [init*, cond*, next*, stmt*] + +# name: Id +# args: ExprList +# +FuncCall: [name*, args*] + +# type (args) +# +FuncDecl: [args*, type*] + +# Function definition: a declarator for the function name and +# a body, which is a compound statement. +# There's an optional list of parameter declarations for old +# K&R-style definitions +# +FuncDef: [decl*, param_decls**, body*] + +Goto: [name] + +ID: [name] + +# Holder for types that are a simple identifier (e.g. the built +# ins void, char etc. and typedef-defined types) +# +IdentifierType: [names] + +If: [cond*, iftrue*, iffalse*] + +# An initialization list used for compound literals. +# +InitList: [exprs**] + +Label: [name, stmt*] + +# A named initializer for C99. +# The name of a NamedInitializer is a sequence of Nodes, because +# names can be hierarchical and contain constant expressions. +# +NamedInitializer: [name**, expr*] + +# a list of comma separated function parameter declarations +# +ParamList: [params**] + +PtrDecl: [quals, type*] + +Return: [expr*] + +# name: struct tag name +# decls: declaration of members +# +Struct: [name, decls**] + +# type: . or -> +# name.field or name->field +# +StructRef: [name*, type, field*] + +Switch: [cond*, stmt*] + +# cond ? iftrue : iffalse +# +TernaryOp: [cond*, iftrue*, iffalse*] + +# A base type declaration +# +TypeDecl: [declname, quals, type*] + +# A typedef declaration. +# Very similar to Decl, but without some attributes +# +Typedef: [name, quals, storage, type*] + +Typename: [name, quals, type*] + +UnaryOp: [op, expr*] + +# name: union tag name +# decls: declaration of members +# +Union: [name, decls**] + +While: [cond*, stmt*] + +Pragma: [string] diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pycparser/ast_transforms.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pycparser/ast_transforms.py new file mode 100644 index 00000000..ba509669 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pycparser/ast_transforms.py @@ -0,0 +1,105 @@ +#------------------------------------------------------------------------------ +# pycparser: ast_transforms.py +# +# Some utilities used by the parser to create a friendlier AST. +# +# Eli Bendersky [https://eli.thegreenplace.net/] +# License: BSD +#------------------------------------------------------------------------------ + +from . import c_ast + + +def fix_switch_cases(switch_node): + """ The 'case' statements in a 'switch' come out of parsing with one + child node, so subsequent statements are just tucked to the parent + Compound. Additionally, consecutive (fall-through) case statements + come out messy. This is a peculiarity of the C grammar. The following: + + switch (myvar) { + case 10: + k = 10; + p = k + 1; + return 10; + case 20: + case 30: + return 20; + default: + break; + } + + Creates this tree (pseudo-dump): + + Switch + ID: myvar + Compound: + Case 10: + k = 10 + p = k + 1 + return 10 + Case 20: + Case 30: + return 20 + Default: + break + + The goal of this transform is to fix this mess, turning it into the + following: + + Switch + ID: myvar + Compound: + Case 10: + k = 10 + p = k + 1 + return 10 + Case 20: + Case 30: + return 20 + Default: + break + + A fixed AST node is returned. The argument may be modified. + """ + assert isinstance(switch_node, c_ast.Switch) + if not isinstance(switch_node.stmt, c_ast.Compound): + return switch_node + + # The new Compound child for the Switch, which will collect children in the + # correct order + new_compound = c_ast.Compound([], switch_node.stmt.coord) + + # The last Case/Default node + last_case = None + + # Goes over the children of the Compound below the Switch, adding them + # either directly below new_compound or below the last Case as appropriate + for child in switch_node.stmt.block_items: + if isinstance(child, (c_ast.Case, c_ast.Default)): + # If it's a Case/Default: + # 1. Add it to the Compound and mark as "last case" + # 2. If its immediate child is also a Case or Default, promote it + # to a sibling. + new_compound.block_items.append(child) + _extract_nested_case(child, new_compound.block_items) + last_case = new_compound.block_items[-1] + else: + # Other statements are added as children to the last case, if it + # exists. + if last_case is None: + new_compound.block_items.append(child) + else: + last_case.stmts.append(child) + + switch_node.stmt = new_compound + return switch_node + + +def _extract_nested_case(case_node, stmts_list): + """ Recursively extract consecutive Case statements that are made nested + by the parser and add them to the stmts_list. + """ + if isinstance(case_node.stmts[0], (c_ast.Case, c_ast.Default)): + stmts_list.append(case_node.stmts.pop()) + _extract_nested_case(stmts_list[-1], stmts_list) + diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pycparser/c_ast.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pycparser/c_ast.py new file mode 100644 index 00000000..b7bbbeed --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pycparser/c_ast.py @@ -0,0 +1,1084 @@ +#----------------------------------------------------------------- +# ** ATTENTION ** +# This code was automatically generated from the file: +# _c_ast.cfg +# +# Do not modify it directly. Modify the configuration file and +# run the generator again. +# ** ** *** ** ** +# +# pycparser: c_ast.py +# +# AST Node classes. +# +# Eli Bendersky [https://eli.thegreenplace.net/] +# License: BSD +#----------------------------------------------------------------- + + +import sys + +def _repr(obj): + """ + Get the representation of an object, with dedicated pprint-like format for lists. + """ + if isinstance(obj, list): + return '[' + (',\n '.join((_repr(e).replace('\n', '\n ') for e in obj))) + '\n]' + else: + return repr(obj) + +class Node(object): + __slots__ = () + """ Abstract base class for AST nodes. + """ + def __repr__(self): + """ Generates a python representation of the current node + """ + result = self.__class__.__name__ + '(' + + indent = '' + separator = '' + for name in self.__slots__[:-2]: + result += separator + result += indent + result += name + '=' + (_repr(getattr(self, name)).replace('\n', '\n ' + (' ' * (len(name) + len(self.__class__.__name__))))) + + separator = ',' + indent = '\n ' + (' ' * len(self.__class__.__name__)) + + result += indent + ')' + + return result + + def children(self): + """ A sequence of all children that are Nodes + """ + pass + + def show(self, buf=sys.stdout, offset=0, attrnames=False, nodenames=False, showcoord=False, _my_node_name=None): + """ Pretty print the Node and all its attributes and + children (recursively) to a buffer. + + buf: + Open IO buffer into which the Node is printed. + + offset: + Initial offset (amount of leading spaces) + + attrnames: + True if you want to see the attribute names in + name=value pairs. False to only see the values. + + nodenames: + True if you want to see the actual node names + within their parents. + + showcoord: + Do you want the coordinates of each Node to be + displayed. + """ + lead = ' ' * offset + if nodenames and _my_node_name is not None: + buf.write(lead + self.__class__.__name__+ ' <' + _my_node_name + '>: ') + else: + buf.write(lead + self.__class__.__name__+ ': ') + + if self.attr_names: + if attrnames: + nvlist = [(n, getattr(self,n)) for n in self.attr_names] + attrstr = ', '.join('%s=%s' % nv for nv in nvlist) + else: + vlist = [getattr(self, n) for n in self.attr_names] + attrstr = ', '.join('%s' % v for v in vlist) + buf.write(attrstr) + + if showcoord: + buf.write(' (at %s)' % self.coord) + buf.write('\n') + + for (child_name, child) in self.children(): + child.show( + buf, + offset=offset + 2, + attrnames=attrnames, + nodenames=nodenames, + showcoord=showcoord, + _my_node_name=child_name) + + +class NodeVisitor(object): + """ A base NodeVisitor class for visiting c_ast nodes. + Subclass it and define your own visit_XXX methods, where + XXX is the class name you want to visit with these + methods. + + For example: + + class ConstantVisitor(NodeVisitor): + def __init__(self): + self.values = [] + + def visit_Constant(self, node): + self.values.append(node.value) + + Creates a list of values of all the constant nodes + encountered below the given node. To use it: + + cv = ConstantVisitor() + cv.visit(node) + + Notes: + + * generic_visit() will be called for AST nodes for which + no visit_XXX method was defined. + * The children of nodes for which a visit_XXX was + defined will not be visited - if you need this, call + generic_visit() on the node. + You can use: + NodeVisitor.generic_visit(self, node) + * Modeled after Python's own AST visiting facilities + (the ast module of Python 3.0) + """ + + _method_cache = None + + def visit(self, node): + """ Visit a node. + """ + + if self._method_cache is None: + self._method_cache = {} + + visitor = self._method_cache.get(node.__class__.__name__, None) + if visitor is None: + method = 'visit_' + node.__class__.__name__ + visitor = getattr(self, method, self.generic_visit) + self._method_cache[node.__class__.__name__] = visitor + + return visitor(node) + + def generic_visit(self, node): + """ Called if no explicit visitor function exists for a + node. Implements preorder visiting of the node. + """ + for c in node: + self.visit(c) + +class ArrayDecl(Node): + __slots__ = ('type', 'dim', 'dim_quals', 'coord', '__weakref__') + def __init__(self, type, dim, dim_quals, coord=None): + self.type = type + self.dim = dim + self.dim_quals = dim_quals + self.coord = coord + + def children(self): + nodelist = [] + if self.type is not None: nodelist.append(("type", self.type)) + if self.dim is not None: nodelist.append(("dim", self.dim)) + return tuple(nodelist) + + def __iter__(self): + if self.type is not None: + yield self.type + if self.dim is not None: + yield self.dim + + attr_names = ('dim_quals', ) + +class ArrayRef(Node): + __slots__ = ('name', 'subscript', 'coord', '__weakref__') + def __init__(self, name, subscript, coord=None): + self.name = name + self.subscript = subscript + self.coord = coord + + def children(self): + nodelist = [] + if self.name is not None: nodelist.append(("name", self.name)) + if self.subscript is not None: nodelist.append(("subscript", self.subscript)) + return tuple(nodelist) + + def __iter__(self): + if self.name is not None: + yield self.name + if self.subscript is not None: + yield self.subscript + + attr_names = () + +class Assignment(Node): + __slots__ = ('op', 'lvalue', 'rvalue', 'coord', '__weakref__') + def __init__(self, op, lvalue, rvalue, coord=None): + self.op = op + self.lvalue = lvalue + self.rvalue = rvalue + self.coord = coord + + def children(self): + nodelist = [] + if self.lvalue is not None: nodelist.append(("lvalue", self.lvalue)) + if self.rvalue is not None: nodelist.append(("rvalue", self.rvalue)) + return tuple(nodelist) + + def __iter__(self): + if self.lvalue is not None: + yield self.lvalue + if self.rvalue is not None: + yield self.rvalue + + attr_names = ('op', ) + +class BinaryOp(Node): + __slots__ = ('op', 'left', 'right', 'coord', '__weakref__') + def __init__(self, op, left, right, coord=None): + self.op = op + self.left = left + self.right = right + self.coord = coord + + def children(self): + nodelist = [] + if self.left is not None: nodelist.append(("left", self.left)) + if self.right is not None: nodelist.append(("right", self.right)) + return tuple(nodelist) + + def __iter__(self): + if self.left is not None: + yield self.left + if self.right is not None: + yield self.right + + attr_names = ('op', ) + +class Break(Node): + __slots__ = ('coord', '__weakref__') + def __init__(self, coord=None): + self.coord = coord + + def children(self): + return () + + def __iter__(self): + return + yield + + attr_names = () + +class Case(Node): + __slots__ = ('expr', 'stmts', 'coord', '__weakref__') + def __init__(self, expr, stmts, coord=None): + self.expr = expr + self.stmts = stmts + self.coord = coord + + def children(self): + nodelist = [] + if self.expr is not None: nodelist.append(("expr", self.expr)) + for i, child in enumerate(self.stmts or []): + nodelist.append(("stmts[%d]" % i, child)) + return tuple(nodelist) + + def __iter__(self): + if self.expr is not None: + yield self.expr + for child in (self.stmts or []): + yield child + + attr_names = () + +class Cast(Node): + __slots__ = ('to_type', 'expr', 'coord', '__weakref__') + def __init__(self, to_type, expr, coord=None): + self.to_type = to_type + self.expr = expr + self.coord = coord + + def children(self): + nodelist = [] + if self.to_type is not None: nodelist.append(("to_type", self.to_type)) + if self.expr is not None: nodelist.append(("expr", self.expr)) + return tuple(nodelist) + + def __iter__(self): + if self.to_type is not None: + yield self.to_type + if self.expr is not None: + yield self.expr + + attr_names = () + +class Compound(Node): + __slots__ = ('block_items', 'coord', '__weakref__') + def __init__(self, block_items, coord=None): + self.block_items = block_items + self.coord = coord + + def children(self): + nodelist = [] + for i, child in enumerate(self.block_items or []): + nodelist.append(("block_items[%d]" % i, child)) + return tuple(nodelist) + + def __iter__(self): + for child in (self.block_items or []): + yield child + + attr_names = () + +class CompoundLiteral(Node): + __slots__ = ('type', 'init', 'coord', '__weakref__') + def __init__(self, type, init, coord=None): + self.type = type + self.init = init + self.coord = coord + + def children(self): + nodelist = [] + if self.type is not None: nodelist.append(("type", self.type)) + if self.init is not None: nodelist.append(("init", self.init)) + return tuple(nodelist) + + def __iter__(self): + if self.type is not None: + yield self.type + if self.init is not None: + yield self.init + + attr_names = () + +class Constant(Node): + __slots__ = ('type', 'value', 'coord', '__weakref__') + def __init__(self, type, value, coord=None): + self.type = type + self.value = value + self.coord = coord + + def children(self): + nodelist = [] + return tuple(nodelist) + + def __iter__(self): + return + yield + + attr_names = ('type', 'value', ) + +class Continue(Node): + __slots__ = ('coord', '__weakref__') + def __init__(self, coord=None): + self.coord = coord + + def children(self): + return () + + def __iter__(self): + return + yield + + attr_names = () + +class Decl(Node): + __slots__ = ('name', 'quals', 'storage', 'funcspec', 'type', 'init', 'bitsize', 'coord', '__weakref__') + def __init__(self, name, quals, storage, funcspec, type, init, bitsize, coord=None): + self.name = name + self.quals = quals + self.storage = storage + self.funcspec = funcspec + self.type = type + self.init = init + self.bitsize = bitsize + self.coord = coord + + def children(self): + nodelist = [] + if self.type is not None: nodelist.append(("type", self.type)) + if self.init is not None: nodelist.append(("init", self.init)) + if self.bitsize is not None: nodelist.append(("bitsize", self.bitsize)) + return tuple(nodelist) + + def __iter__(self): + if self.type is not None: + yield self.type + if self.init is not None: + yield self.init + if self.bitsize is not None: + yield self.bitsize + + attr_names = ('name', 'quals', 'storage', 'funcspec', ) + +class DeclList(Node): + __slots__ = ('decls', 'coord', '__weakref__') + def __init__(self, decls, coord=None): + self.decls = decls + self.coord = coord + + def children(self): + nodelist = [] + for i, child in enumerate(self.decls or []): + nodelist.append(("decls[%d]" % i, child)) + return tuple(nodelist) + + def __iter__(self): + for child in (self.decls or []): + yield child + + attr_names = () + +class Default(Node): + __slots__ = ('stmts', 'coord', '__weakref__') + def __init__(self, stmts, coord=None): + self.stmts = stmts + self.coord = coord + + def children(self): + nodelist = [] + for i, child in enumerate(self.stmts or []): + nodelist.append(("stmts[%d]" % i, child)) + return tuple(nodelist) + + def __iter__(self): + for child in (self.stmts or []): + yield child + + attr_names = () + +class DoWhile(Node): + __slots__ = ('cond', 'stmt', 'coord', '__weakref__') + def __init__(self, cond, stmt, coord=None): + self.cond = cond + self.stmt = stmt + self.coord = coord + + def children(self): + nodelist = [] + if self.cond is not None: nodelist.append(("cond", self.cond)) + if self.stmt is not None: nodelist.append(("stmt", self.stmt)) + return tuple(nodelist) + + def __iter__(self): + if self.cond is not None: + yield self.cond + if self.stmt is not None: + yield self.stmt + + attr_names = () + +class EllipsisParam(Node): + __slots__ = ('coord', '__weakref__') + def __init__(self, coord=None): + self.coord = coord + + def children(self): + return () + + def __iter__(self): + return + yield + + attr_names = () + +class EmptyStatement(Node): + __slots__ = ('coord', '__weakref__') + def __init__(self, coord=None): + self.coord = coord + + def children(self): + return () + + def __iter__(self): + return + yield + + attr_names = () + +class Enum(Node): + __slots__ = ('name', 'values', 'coord', '__weakref__') + def __init__(self, name, values, coord=None): + self.name = name + self.values = values + self.coord = coord + + def children(self): + nodelist = [] + if self.values is not None: nodelist.append(("values", self.values)) + return tuple(nodelist) + + def __iter__(self): + if self.values is not None: + yield self.values + + attr_names = ('name', ) + +class Enumerator(Node): + __slots__ = ('name', 'value', 'coord', '__weakref__') + def __init__(self, name, value, coord=None): + self.name = name + self.value = value + self.coord = coord + + def children(self): + nodelist = [] + if self.value is not None: nodelist.append(("value", self.value)) + return tuple(nodelist) + + def __iter__(self): + if self.value is not None: + yield self.value + + attr_names = ('name', ) + +class EnumeratorList(Node): + __slots__ = ('enumerators', 'coord', '__weakref__') + def __init__(self, enumerators, coord=None): + self.enumerators = enumerators + self.coord = coord + + def children(self): + nodelist = [] + for i, child in enumerate(self.enumerators or []): + nodelist.append(("enumerators[%d]" % i, child)) + return tuple(nodelist) + + def __iter__(self): + for child in (self.enumerators or []): + yield child + + attr_names = () + +class ExprList(Node): + __slots__ = ('exprs', 'coord', '__weakref__') + def __init__(self, exprs, coord=None): + self.exprs = exprs + self.coord = coord + + def children(self): + nodelist = [] + for i, child in enumerate(self.exprs or []): + nodelist.append(("exprs[%d]" % i, child)) + return tuple(nodelist) + + def __iter__(self): + for child in (self.exprs or []): + yield child + + attr_names = () + +class FileAST(Node): + __slots__ = ('ext', 'coord', '__weakref__') + def __init__(self, ext, coord=None): + self.ext = ext + self.coord = coord + + def children(self): + nodelist = [] + for i, child in enumerate(self.ext or []): + nodelist.append(("ext[%d]" % i, child)) + return tuple(nodelist) + + def __iter__(self): + for child in (self.ext or []): + yield child + + attr_names = () + +class For(Node): + __slots__ = ('init', 'cond', 'next', 'stmt', 'coord', '__weakref__') + def __init__(self, init, cond, next, stmt, coord=None): + self.init = init + self.cond = cond + self.next = next + self.stmt = stmt + self.coord = coord + + def children(self): + nodelist = [] + if self.init is not None: nodelist.append(("init", self.init)) + if self.cond is not None: nodelist.append(("cond", self.cond)) + if self.next is not None: nodelist.append(("next", self.next)) + if self.stmt is not None: nodelist.append(("stmt", self.stmt)) + return tuple(nodelist) + + def __iter__(self): + if self.init is not None: + yield self.init + if self.cond is not None: + yield self.cond + if self.next is not None: + yield self.next + if self.stmt is not None: + yield self.stmt + + attr_names = () + +class FuncCall(Node): + __slots__ = ('name', 'args', 'coord', '__weakref__') + def __init__(self, name, args, coord=None): + self.name = name + self.args = args + self.coord = coord + + def children(self): + nodelist = [] + if self.name is not None: nodelist.append(("name", self.name)) + if self.args is not None: nodelist.append(("args", self.args)) + return tuple(nodelist) + + def __iter__(self): + if self.name is not None: + yield self.name + if self.args is not None: + yield self.args + + attr_names = () + +class FuncDecl(Node): + __slots__ = ('args', 'type', 'coord', '__weakref__') + def __init__(self, args, type, coord=None): + self.args = args + self.type = type + self.coord = coord + + def children(self): + nodelist = [] + if self.args is not None: nodelist.append(("args", self.args)) + if self.type is not None: nodelist.append(("type", self.type)) + return tuple(nodelist) + + def __iter__(self): + if self.args is not None: + yield self.args + if self.type is not None: + yield self.type + + attr_names = () + +class FuncDef(Node): + __slots__ = ('decl', 'param_decls', 'body', 'coord', '__weakref__') + def __init__(self, decl, param_decls, body, coord=None): + self.decl = decl + self.param_decls = param_decls + self.body = body + self.coord = coord + + def children(self): + nodelist = [] + if self.decl is not None: nodelist.append(("decl", self.decl)) + if self.body is not None: nodelist.append(("body", self.body)) + for i, child in enumerate(self.param_decls or []): + nodelist.append(("param_decls[%d]" % i, child)) + return tuple(nodelist) + + def __iter__(self): + if self.decl is not None: + yield self.decl + if self.body is not None: + yield self.body + for child in (self.param_decls or []): + yield child + + attr_names = () + +class Goto(Node): + __slots__ = ('name', 'coord', '__weakref__') + def __init__(self, name, coord=None): + self.name = name + self.coord = coord + + def children(self): + nodelist = [] + return tuple(nodelist) + + def __iter__(self): + return + yield + + attr_names = ('name', ) + +class ID(Node): + __slots__ = ('name', 'coord', '__weakref__') + def __init__(self, name, coord=None): + self.name = name + self.coord = coord + + def children(self): + nodelist = [] + return tuple(nodelist) + + def __iter__(self): + return + yield + + attr_names = ('name', ) + +class IdentifierType(Node): + __slots__ = ('names', 'coord', '__weakref__') + def __init__(self, names, coord=None): + self.names = names + self.coord = coord + + def children(self): + nodelist = [] + return tuple(nodelist) + + def __iter__(self): + return + yield + + attr_names = ('names', ) + +class If(Node): + __slots__ = ('cond', 'iftrue', 'iffalse', 'coord', '__weakref__') + def __init__(self, cond, iftrue, iffalse, coord=None): + self.cond = cond + self.iftrue = iftrue + self.iffalse = iffalse + self.coord = coord + + def children(self): + nodelist = [] + if self.cond is not None: nodelist.append(("cond", self.cond)) + if self.iftrue is not None: nodelist.append(("iftrue", self.iftrue)) + if self.iffalse is not None: nodelist.append(("iffalse", self.iffalse)) + return tuple(nodelist) + + def __iter__(self): + if self.cond is not None: + yield self.cond + if self.iftrue is not None: + yield self.iftrue + if self.iffalse is not None: + yield self.iffalse + + attr_names = () + +class InitList(Node): + __slots__ = ('exprs', 'coord', '__weakref__') + def __init__(self, exprs, coord=None): + self.exprs = exprs + self.coord = coord + + def children(self): + nodelist = [] + for i, child in enumerate(self.exprs or []): + nodelist.append(("exprs[%d]" % i, child)) + return tuple(nodelist) + + def __iter__(self): + for child in (self.exprs or []): + yield child + + attr_names = () + +class Label(Node): + __slots__ = ('name', 'stmt', 'coord', '__weakref__') + def __init__(self, name, stmt, coord=None): + self.name = name + self.stmt = stmt + self.coord = coord + + def children(self): + nodelist = [] + if self.stmt is not None: nodelist.append(("stmt", self.stmt)) + return tuple(nodelist) + + def __iter__(self): + if self.stmt is not None: + yield self.stmt + + attr_names = ('name', ) + +class NamedInitializer(Node): + __slots__ = ('name', 'expr', 'coord', '__weakref__') + def __init__(self, name, expr, coord=None): + self.name = name + self.expr = expr + self.coord = coord + + def children(self): + nodelist = [] + if self.expr is not None: nodelist.append(("expr", self.expr)) + for i, child in enumerate(self.name or []): + nodelist.append(("name[%d]" % i, child)) + return tuple(nodelist) + + def __iter__(self): + if self.expr is not None: + yield self.expr + for child in (self.name or []): + yield child + + attr_names = () + +class ParamList(Node): + __slots__ = ('params', 'coord', '__weakref__') + def __init__(self, params, coord=None): + self.params = params + self.coord = coord + + def children(self): + nodelist = [] + for i, child in enumerate(self.params or []): + nodelist.append(("params[%d]" % i, child)) + return tuple(nodelist) + + def __iter__(self): + for child in (self.params or []): + yield child + + attr_names = () + +class PtrDecl(Node): + __slots__ = ('quals', 'type', 'coord', '__weakref__') + def __init__(self, quals, type, coord=None): + self.quals = quals + self.type = type + self.coord = coord + + def children(self): + nodelist = [] + if self.type is not None: nodelist.append(("type", self.type)) + return tuple(nodelist) + + def __iter__(self): + if self.type is not None: + yield self.type + + attr_names = ('quals', ) + +class Return(Node): + __slots__ = ('expr', 'coord', '__weakref__') + def __init__(self, expr, coord=None): + self.expr = expr + self.coord = coord + + def children(self): + nodelist = [] + if self.expr is not None: nodelist.append(("expr", self.expr)) + return tuple(nodelist) + + def __iter__(self): + if self.expr is not None: + yield self.expr + + attr_names = () + +class Struct(Node): + __slots__ = ('name', 'decls', 'coord', '__weakref__') + def __init__(self, name, decls, coord=None): + self.name = name + self.decls = decls + self.coord = coord + + def children(self): + nodelist = [] + for i, child in enumerate(self.decls or []): + nodelist.append(("decls[%d]" % i, child)) + return tuple(nodelist) + + def __iter__(self): + for child in (self.decls or []): + yield child + + attr_names = ('name', ) + +class StructRef(Node): + __slots__ = ('name', 'type', 'field', 'coord', '__weakref__') + def __init__(self, name, type, field, coord=None): + self.name = name + self.type = type + self.field = field + self.coord = coord + + def children(self): + nodelist = [] + if self.name is not None: nodelist.append(("name", self.name)) + if self.field is not None: nodelist.append(("field", self.field)) + return tuple(nodelist) + + def __iter__(self): + if self.name is not None: + yield self.name + if self.field is not None: + yield self.field + + attr_names = ('type', ) + +class Switch(Node): + __slots__ = ('cond', 'stmt', 'coord', '__weakref__') + def __init__(self, cond, stmt, coord=None): + self.cond = cond + self.stmt = stmt + self.coord = coord + + def children(self): + nodelist = [] + if self.cond is not None: nodelist.append(("cond", self.cond)) + if self.stmt is not None: nodelist.append(("stmt", self.stmt)) + return tuple(nodelist) + + def __iter__(self): + if self.cond is not None: + yield self.cond + if self.stmt is not None: + yield self.stmt + + attr_names = () + +class TernaryOp(Node): + __slots__ = ('cond', 'iftrue', 'iffalse', 'coord', '__weakref__') + def __init__(self, cond, iftrue, iffalse, coord=None): + self.cond = cond + self.iftrue = iftrue + self.iffalse = iffalse + self.coord = coord + + def children(self): + nodelist = [] + if self.cond is not None: nodelist.append(("cond", self.cond)) + if self.iftrue is not None: nodelist.append(("iftrue", self.iftrue)) + if self.iffalse is not None: nodelist.append(("iffalse", self.iffalse)) + return tuple(nodelist) + + def __iter__(self): + if self.cond is not None: + yield self.cond + if self.iftrue is not None: + yield self.iftrue + if self.iffalse is not None: + yield self.iffalse + + attr_names = () + +class TypeDecl(Node): + __slots__ = ('declname', 'quals', 'type', 'coord', '__weakref__') + def __init__(self, declname, quals, type, coord=None): + self.declname = declname + self.quals = quals + self.type = type + self.coord = coord + + def children(self): + nodelist = [] + if self.type is not None: nodelist.append(("type", self.type)) + return tuple(nodelist) + + def __iter__(self): + if self.type is not None: + yield self.type + + attr_names = ('declname', 'quals', ) + +class Typedef(Node): + __slots__ = ('name', 'quals', 'storage', 'type', 'coord', '__weakref__') + def __init__(self, name, quals, storage, type, coord=None): + self.name = name + self.quals = quals + self.storage = storage + self.type = type + self.coord = coord + + def children(self): + nodelist = [] + if self.type is not None: nodelist.append(("type", self.type)) + return tuple(nodelist) + + def __iter__(self): + if self.type is not None: + yield self.type + + attr_names = ('name', 'quals', 'storage', ) + +class Typename(Node): + __slots__ = ('name', 'quals', 'type', 'coord', '__weakref__') + def __init__(self, name, quals, type, coord=None): + self.name = name + self.quals = quals + self.type = type + self.coord = coord + + def children(self): + nodelist = [] + if self.type is not None: nodelist.append(("type", self.type)) + return tuple(nodelist) + + def __iter__(self): + if self.type is not None: + yield self.type + + attr_names = ('name', 'quals', ) + +class UnaryOp(Node): + __slots__ = ('op', 'expr', 'coord', '__weakref__') + def __init__(self, op, expr, coord=None): + self.op = op + self.expr = expr + self.coord = coord + + def children(self): + nodelist = [] + if self.expr is not None: nodelist.append(("expr", self.expr)) + return tuple(nodelist) + + def __iter__(self): + if self.expr is not None: + yield self.expr + + attr_names = ('op', ) + +class Union(Node): + __slots__ = ('name', 'decls', 'coord', '__weakref__') + def __init__(self, name, decls, coord=None): + self.name = name + self.decls = decls + self.coord = coord + + def children(self): + nodelist = [] + for i, child in enumerate(self.decls or []): + nodelist.append(("decls[%d]" % i, child)) + return tuple(nodelist) + + def __iter__(self): + for child in (self.decls or []): + yield child + + attr_names = ('name', ) + +class While(Node): + __slots__ = ('cond', 'stmt', 'coord', '__weakref__') + def __init__(self, cond, stmt, coord=None): + self.cond = cond + self.stmt = stmt + self.coord = coord + + def children(self): + nodelist = [] + if self.cond is not None: nodelist.append(("cond", self.cond)) + if self.stmt is not None: nodelist.append(("stmt", self.stmt)) + return tuple(nodelist) + + def __iter__(self): + if self.cond is not None: + yield self.cond + if self.stmt is not None: + yield self.stmt + + attr_names = () + +class Pragma(Node): + __slots__ = ('string', 'coord', '__weakref__') + def __init__(self, string, coord=None): + self.string = string + self.coord = coord + + def children(self): + nodelist = [] + return tuple(nodelist) + + def __iter__(self): + return + yield + + attr_names = ('string', ) + diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pycparser/c_generator.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pycparser/c_generator.py new file mode 100644 index 00000000..f789742f --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pycparser/c_generator.py @@ -0,0 +1,428 @@ +#------------------------------------------------------------------------------ +# pycparser: c_generator.py +# +# C code generator from pycparser AST nodes. +# +# Eli Bendersky [https://eli.thegreenplace.net/] +# License: BSD +#------------------------------------------------------------------------------ +from . import c_ast + + +class CGenerator(object): + """ Uses the same visitor pattern as c_ast.NodeVisitor, but modified to + return a value from each visit method, using string accumulation in + generic_visit. + """ + def __init__(self): + # Statements start with indentation of self.indent_level spaces, using + # the _make_indent method + # + self.indent_level = 0 + + def _make_indent(self): + return ' ' * self.indent_level + + def visit(self, node): + method = 'visit_' + node.__class__.__name__ + return getattr(self, method, self.generic_visit)(node) + + def generic_visit(self, node): + #~ print('generic:', type(node)) + if node is None: + return '' + else: + return ''.join(self.visit(c) for c_name, c in node.children()) + + def visit_Constant(self, n): + return n.value + + def visit_ID(self, n): + return n.name + + def visit_Pragma(self, n): + ret = '#pragma' + if n.string: + ret += ' ' + n.string + return ret + + def visit_ArrayRef(self, n): + arrref = self._parenthesize_unless_simple(n.name) + return arrref + '[' + self.visit(n.subscript) + ']' + + def visit_StructRef(self, n): + sref = self._parenthesize_unless_simple(n.name) + return sref + n.type + self.visit(n.field) + + def visit_FuncCall(self, n): + fref = self._parenthesize_unless_simple(n.name) + return fref + '(' + self.visit(n.args) + ')' + + def visit_UnaryOp(self, n): + operand = self._parenthesize_unless_simple(n.expr) + if n.op == 'p++': + return '%s++' % operand + elif n.op == 'p--': + return '%s--' % operand + elif n.op == 'sizeof': + # Always parenthesize the argument of sizeof since it can be + # a name. + return 'sizeof(%s)' % self.visit(n.expr) + else: + return '%s%s' % (n.op, operand) + + def visit_BinaryOp(self, n): + lval_str = self._parenthesize_if(n.left, + lambda d: not self._is_simple_node(d)) + rval_str = self._parenthesize_if(n.right, + lambda d: not self._is_simple_node(d)) + return '%s %s %s' % (lval_str, n.op, rval_str) + + def visit_Assignment(self, n): + rval_str = self._parenthesize_if( + n.rvalue, + lambda n: isinstance(n, c_ast.Assignment)) + return '%s %s %s' % (self.visit(n.lvalue), n.op, rval_str) + + def visit_IdentifierType(self, n): + return ' '.join(n.names) + + def _visit_expr(self, n): + if isinstance(n, c_ast.InitList): + return '{' + self.visit(n) + '}' + elif isinstance(n, c_ast.ExprList): + return '(' + self.visit(n) + ')' + else: + return self.visit(n) + + def visit_Decl(self, n, no_type=False): + # no_type is used when a Decl is part of a DeclList, where the type is + # explicitly only for the first declaration in a list. + # + s = n.name if no_type else self._generate_decl(n) + if n.bitsize: s += ' : ' + self.visit(n.bitsize) + if n.init: + s += ' = ' + self._visit_expr(n.init) + return s + + def visit_DeclList(self, n): + s = self.visit(n.decls[0]) + if len(n.decls) > 1: + s += ', ' + ', '.join(self.visit_Decl(decl, no_type=True) + for decl in n.decls[1:]) + return s + + def visit_Typedef(self, n): + s = '' + if n.storage: s += ' '.join(n.storage) + ' ' + s += self._generate_type(n.type) + return s + + def visit_Cast(self, n): + s = '(' + self._generate_type(n.to_type) + ')' + return s + ' ' + self._parenthesize_unless_simple(n.expr) + + def visit_ExprList(self, n): + visited_subexprs = [] + for expr in n.exprs: + visited_subexprs.append(self._visit_expr(expr)) + return ', '.join(visited_subexprs) + + def visit_InitList(self, n): + visited_subexprs = [] + for expr in n.exprs: + visited_subexprs.append(self._visit_expr(expr)) + return ', '.join(visited_subexprs) + + def visit_Enum(self, n): + return self._generate_struct_union_enum(n, name='enum') + + def visit_Enumerator(self, n): + if not n.value: + return '{indent}{name},\n'.format( + indent=self._make_indent(), + name=n.name, + ) + else: + return '{indent}{name} = {value},\n'.format( + indent=self._make_indent(), + name=n.name, + value=self.visit(n.value), + ) + + def visit_FuncDef(self, n): + decl = self.visit(n.decl) + self.indent_level = 0 + body = self.visit(n.body) + if n.param_decls: + knrdecls = ';\n'.join(self.visit(p) for p in n.param_decls) + return decl + '\n' + knrdecls + ';\n' + body + '\n' + else: + return decl + '\n' + body + '\n' + + def visit_FileAST(self, n): + s = '' + for ext in n.ext: + if isinstance(ext, c_ast.FuncDef): + s += self.visit(ext) + elif isinstance(ext, c_ast.Pragma): + s += self.visit(ext) + '\n' + else: + s += self.visit(ext) + ';\n' + return s + + def visit_Compound(self, n): + s = self._make_indent() + '{\n' + self.indent_level += 2 + if n.block_items: + s += ''.join(self._generate_stmt(stmt) for stmt in n.block_items) + self.indent_level -= 2 + s += self._make_indent() + '}\n' + return s + + def visit_CompoundLiteral(self, n): + return '(' + self.visit(n.type) + '){' + self.visit(n.init) + '}' + + + def visit_EmptyStatement(self, n): + return ';' + + def visit_ParamList(self, n): + return ', '.join(self.visit(param) for param in n.params) + + def visit_Return(self, n): + s = 'return' + if n.expr: s += ' ' + self.visit(n.expr) + return s + ';' + + def visit_Break(self, n): + return 'break;' + + def visit_Continue(self, n): + return 'continue;' + + def visit_TernaryOp(self, n): + s = '(' + self._visit_expr(n.cond) + ') ? ' + s += '(' + self._visit_expr(n.iftrue) + ') : ' + s += '(' + self._visit_expr(n.iffalse) + ')' + return s + + def visit_If(self, n): + s = 'if (' + if n.cond: s += self.visit(n.cond) + s += ')\n' + s += self._generate_stmt(n.iftrue, add_indent=True) + if n.iffalse: + s += self._make_indent() + 'else\n' + s += self._generate_stmt(n.iffalse, add_indent=True) + return s + + def visit_For(self, n): + s = 'for (' + if n.init: s += self.visit(n.init) + s += ';' + if n.cond: s += ' ' + self.visit(n.cond) + s += ';' + if n.next: s += ' ' + self.visit(n.next) + s += ')\n' + s += self._generate_stmt(n.stmt, add_indent=True) + return s + + def visit_While(self, n): + s = 'while (' + if n.cond: s += self.visit(n.cond) + s += ')\n' + s += self._generate_stmt(n.stmt, add_indent=True) + return s + + def visit_DoWhile(self, n): + s = 'do\n' + s += self._generate_stmt(n.stmt, add_indent=True) + s += self._make_indent() + 'while (' + if n.cond: s += self.visit(n.cond) + s += ');' + return s + + def visit_Switch(self, n): + s = 'switch (' + self.visit(n.cond) + ')\n' + s += self._generate_stmt(n.stmt, add_indent=True) + return s + + def visit_Case(self, n): + s = 'case ' + self.visit(n.expr) + ':\n' + for stmt in n.stmts: + s += self._generate_stmt(stmt, add_indent=True) + return s + + def visit_Default(self, n): + s = 'default:\n' + for stmt in n.stmts: + s += self._generate_stmt(stmt, add_indent=True) + return s + + def visit_Label(self, n): + return n.name + ':\n' + self._generate_stmt(n.stmt) + + def visit_Goto(self, n): + return 'goto ' + n.name + ';' + + def visit_EllipsisParam(self, n): + return '...' + + def visit_Struct(self, n): + return self._generate_struct_union_enum(n, 'struct') + + def visit_Typename(self, n): + return self._generate_type(n.type) + + def visit_Union(self, n): + return self._generate_struct_union_enum(n, 'union') + + def visit_NamedInitializer(self, n): + s = '' + for name in n.name: + if isinstance(name, c_ast.ID): + s += '.' + name.name + else: + s += '[' + self.visit(name) + ']' + s += ' = ' + self._visit_expr(n.expr) + return s + + def visit_FuncDecl(self, n): + return self._generate_type(n) + + def _generate_struct_union_enum(self, n, name): + """ Generates code for structs, unions, and enums. name should be + 'struct', 'union', or 'enum'. + """ + if name in ('struct', 'union'): + members = n.decls + body_function = self._generate_struct_union_body + else: + assert name == 'enum' + members = None if n.values is None else n.values.enumerators + body_function = self._generate_enum_body + s = name + ' ' + (n.name or '') + if members is not None: + # None means no members + # Empty sequence means an empty list of members + s += '\n' + s += self._make_indent() + self.indent_level += 2 + s += '{\n' + s += body_function(members) + self.indent_level -= 2 + s += self._make_indent() + '}' + return s + + def _generate_struct_union_body(self, members): + return ''.join(self._generate_stmt(decl) for decl in members) + + def _generate_enum_body(self, members): + # `[:-2] + '\n'` removes the final `,` from the enumerator list + return ''.join(self.visit(value) for value in members)[:-2] + '\n' + + def _generate_stmt(self, n, add_indent=False): + """ Generation from a statement node. This method exists as a wrapper + for individual visit_* methods to handle different treatment of + some statements in this context. + """ + typ = type(n) + if add_indent: self.indent_level += 2 + indent = self._make_indent() + if add_indent: self.indent_level -= 2 + + if typ in ( + c_ast.Decl, c_ast.Assignment, c_ast.Cast, c_ast.UnaryOp, + c_ast.BinaryOp, c_ast.TernaryOp, c_ast.FuncCall, c_ast.ArrayRef, + c_ast.StructRef, c_ast.Constant, c_ast.ID, c_ast.Typedef, + c_ast.ExprList): + # These can also appear in an expression context so no semicolon + # is added to them automatically + # + return indent + self.visit(n) + ';\n' + elif typ in (c_ast.Compound,): + # No extra indentation required before the opening brace of a + # compound - because it consists of multiple lines it has to + # compute its own indentation. + # + return self.visit(n) + else: + return indent + self.visit(n) + '\n' + + def _generate_decl(self, n): + """ Generation from a Decl node. + """ + s = '' + if n.funcspec: s = ' '.join(n.funcspec) + ' ' + if n.storage: s += ' '.join(n.storage) + ' ' + s += self._generate_type(n.type) + return s + + def _generate_type(self, n, modifiers=[]): + """ Recursive generation from a type node. n is the type node. + modifiers collects the PtrDecl, ArrayDecl and FuncDecl modifiers + encountered on the way down to a TypeDecl, to allow proper + generation from it. + """ + typ = type(n) + #~ print(n, modifiers) + + if typ == c_ast.TypeDecl: + s = '' + if n.quals: s += ' '.join(n.quals) + ' ' + s += self.visit(n.type) + + nstr = n.declname if n.declname else '' + # Resolve modifiers. + # Wrap in parens to distinguish pointer to array and pointer to + # function syntax. + # + for i, modifier in enumerate(modifiers): + if isinstance(modifier, c_ast.ArrayDecl): + if (i != 0 and isinstance(modifiers[i - 1], c_ast.PtrDecl)): + nstr = '(' + nstr + ')' + nstr += '[' + self.visit(modifier.dim) + ']' + elif isinstance(modifier, c_ast.FuncDecl): + if (i != 0 and isinstance(modifiers[i - 1], c_ast.PtrDecl)): + nstr = '(' + nstr + ')' + nstr += '(' + self.visit(modifier.args) + ')' + elif isinstance(modifier, c_ast.PtrDecl): + if modifier.quals: + nstr = '* %s %s' % (' '.join(modifier.quals), nstr) + else: + nstr = '*' + nstr + if nstr: s += ' ' + nstr + return s + elif typ == c_ast.Decl: + return self._generate_decl(n.type) + elif typ == c_ast.Typename: + return self._generate_type(n.type) + elif typ == c_ast.IdentifierType: + return ' '.join(n.names) + ' ' + elif typ in (c_ast.ArrayDecl, c_ast.PtrDecl, c_ast.FuncDecl): + return self._generate_type(n.type, modifiers + [n]) + else: + return self.visit(n) + + def _parenthesize_if(self, n, condition): + """ Visits 'n' and returns its string representation, parenthesized + if the condition function applied to the node returns True. + """ + s = self._visit_expr(n) + if condition(n): + return '(' + s + ')' + else: + return s + + def _parenthesize_unless_simple(self, n): + """ Common use case for _parenthesize_if + """ + return self._parenthesize_if(n, lambda d: not self._is_simple_node(d)) + + def _is_simple_node(self, n): + """ Returns True for nodes that are "simple" - i.e. nodes that always + have higher precedence than operators. + """ + return isinstance(n, (c_ast.Constant, c_ast.ID, c_ast.ArrayRef, + c_ast.StructRef, c_ast.FuncCall)) diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pycparser/c_lexer.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pycparser/c_lexer.py new file mode 100644 index 00000000..de8445e9 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pycparser/c_lexer.py @@ -0,0 +1,484 @@ +#------------------------------------------------------------------------------ +# pycparser: c_lexer.py +# +# CLexer class: lexer for the C language +# +# Eli Bendersky [https://eli.thegreenplace.net/] +# License: BSD +#------------------------------------------------------------------------------ +import re +import sys + +from .ply import lex +from .ply.lex import TOKEN + + +class CLexer(object): + """ A lexer for the C language. After building it, set the + input text with input(), and call token() to get new + tokens. + + The public attribute filename can be set to an initial + filaneme, but the lexer will update it upon #line + directives. + """ + def __init__(self, error_func, on_lbrace_func, on_rbrace_func, + type_lookup_func): + """ Create a new Lexer. + + error_func: + An error function. Will be called with an error + message, line and column as arguments, in case of + an error during lexing. + + on_lbrace_func, on_rbrace_func: + Called when an LBRACE or RBRACE is encountered + (likely to push/pop type_lookup_func's scope) + + type_lookup_func: + A type lookup function. Given a string, it must + return True IFF this string is a name of a type + that was defined with a typedef earlier. + """ + self.error_func = error_func + self.on_lbrace_func = on_lbrace_func + self.on_rbrace_func = on_rbrace_func + self.type_lookup_func = type_lookup_func + self.filename = '' + + # Keeps track of the last token returned from self.token() + self.last_token = None + + # Allow either "# line" or "# " to support GCC's + # cpp output + # + self.line_pattern = re.compile(r'([ \t]*line\W)|([ \t]*\d+)') + self.pragma_pattern = re.compile(r'[ \t]*pragma\W') + + def build(self, **kwargs): + """ Builds the lexer from the specification. Must be + called after the lexer object is created. + + This method exists separately, because the PLY + manual warns against calling lex.lex inside + __init__ + """ + self.lexer = lex.lex(object=self, **kwargs) + + def reset_lineno(self): + """ Resets the internal line number counter of the lexer. + """ + self.lexer.lineno = 1 + + def input(self, text): + self.lexer.input(text) + + def token(self): + self.last_token = self.lexer.token() + return self.last_token + + def find_tok_column(self, token): + """ Find the column of the token in its line. + """ + last_cr = self.lexer.lexdata.rfind('\n', 0, token.lexpos) + return token.lexpos - last_cr + + ######################-- PRIVATE --###################### + + ## + ## Internal auxiliary methods + ## + def _error(self, msg, token): + location = self._make_tok_location(token) + self.error_func(msg, location[0], location[1]) + self.lexer.skip(1) + + def _make_tok_location(self, token): + return (token.lineno, self.find_tok_column(token)) + + ## + ## Reserved keywords + ## + keywords = ( + '_BOOL', '_COMPLEX', 'AUTO', 'BREAK', 'CASE', 'CHAR', 'CONST', + 'CONTINUE', 'DEFAULT', 'DO', 'DOUBLE', 'ELSE', 'ENUM', 'EXTERN', + 'FLOAT', 'FOR', 'GOTO', 'IF', 'INLINE', 'INT', 'LONG', + 'REGISTER', 'OFFSETOF', + 'RESTRICT', 'RETURN', 'SHORT', 'SIGNED', 'SIZEOF', 'STATIC', 'STRUCT', + 'SWITCH', 'TYPEDEF', 'UNION', 'UNSIGNED', 'VOID', + 'VOLATILE', 'WHILE', '__INT128', + ) + + keyword_map = {} + for keyword in keywords: + if keyword == '_BOOL': + keyword_map['_Bool'] = keyword + elif keyword == '_COMPLEX': + keyword_map['_Complex'] = keyword + else: + keyword_map[keyword.lower()] = keyword + + ## + ## All the tokens recognized by the lexer + ## + tokens = keywords + ( + # Identifiers + 'ID', + + # Type identifiers (identifiers previously defined as + # types with typedef) + 'TYPEID', + + # constants + 'INT_CONST_DEC', 'INT_CONST_OCT', 'INT_CONST_HEX', 'INT_CONST_BIN', + 'FLOAT_CONST', 'HEX_FLOAT_CONST', + 'CHAR_CONST', + 'WCHAR_CONST', + + # String literals + 'STRING_LITERAL', + 'WSTRING_LITERAL', + + # Operators + 'PLUS', 'MINUS', 'TIMES', 'DIVIDE', 'MOD', + 'OR', 'AND', 'NOT', 'XOR', 'LSHIFT', 'RSHIFT', + 'LOR', 'LAND', 'LNOT', + 'LT', 'LE', 'GT', 'GE', 'EQ', 'NE', + + # Assignment + 'EQUALS', 'TIMESEQUAL', 'DIVEQUAL', 'MODEQUAL', + 'PLUSEQUAL', 'MINUSEQUAL', + 'LSHIFTEQUAL','RSHIFTEQUAL', 'ANDEQUAL', 'XOREQUAL', + 'OREQUAL', + + # Increment/decrement + 'PLUSPLUS', 'MINUSMINUS', + + # Structure dereference (->) + 'ARROW', + + # Conditional operator (?) + 'CONDOP', + + # Delimeters + 'LPAREN', 'RPAREN', # ( ) + 'LBRACKET', 'RBRACKET', # [ ] + 'LBRACE', 'RBRACE', # { } + 'COMMA', 'PERIOD', # . , + 'SEMI', 'COLON', # ; : + + # Ellipsis (...) + 'ELLIPSIS', + + # pre-processor + 'PPHASH', # '#' + 'PPPRAGMA', # 'pragma' + 'PPPRAGMASTR', + ) + + ## + ## Regexes for use in tokens + ## + ## + + # valid C identifiers (K&R2: A.2.3), plus '$' (supported by some compilers) + identifier = r'[a-zA-Z_$][0-9a-zA-Z_$]*' + + hex_prefix = '0[xX]' + hex_digits = '[0-9a-fA-F]+' + bin_prefix = '0[bB]' + bin_digits = '[01]+' + + # integer constants (K&R2: A.2.5.1) + integer_suffix_opt = r'(([uU]ll)|([uU]LL)|(ll[uU]?)|(LL[uU]?)|([uU][lL])|([lL][uU]?)|[uU])?' + decimal_constant = '(0'+integer_suffix_opt+')|([1-9][0-9]*'+integer_suffix_opt+')' + octal_constant = '0[0-7]*'+integer_suffix_opt + hex_constant = hex_prefix+hex_digits+integer_suffix_opt + bin_constant = bin_prefix+bin_digits+integer_suffix_opt + + bad_octal_constant = '0[0-7]*[89]' + + # character constants (K&R2: A.2.5.2) + # Note: a-zA-Z and '.-~^_!=&;,' are allowed as escape chars to support #line + # directives with Windows paths as filenames (..\..\dir\file) + # For the same reason, decimal_escape allows all digit sequences. We want to + # parse all correct code, even if it means to sometimes parse incorrect + # code. + # + simple_escape = r"""([a-zA-Z._~!=&\^\-\\?'"])""" + decimal_escape = r"""(\d+)""" + hex_escape = r"""(x[0-9a-fA-F]+)""" + bad_escape = r"""([\\][^a-zA-Z._~^!=&\^\-\\?'"x0-7])""" + + escape_sequence = r"""(\\("""+simple_escape+'|'+decimal_escape+'|'+hex_escape+'))' + cconst_char = r"""([^'\\\n]|"""+escape_sequence+')' + char_const = "'"+cconst_char+"'" + wchar_const = 'L'+char_const + unmatched_quote = "('"+cconst_char+"*\\n)|('"+cconst_char+"*$)" + bad_char_const = r"""('"""+cconst_char+"""[^'\n]+')|('')|('"""+bad_escape+r"""[^'\n]*')""" + + # string literals (K&R2: A.2.6) + string_char = r"""([^"\\\n]|"""+escape_sequence+')' + string_literal = '"'+string_char+'*"' + wstring_literal = 'L'+string_literal + bad_string_literal = '"'+string_char+'*?'+bad_escape+string_char+'*"' + + # floating constants (K&R2: A.2.5.3) + exponent_part = r"""([eE][-+]?[0-9]+)""" + fractional_constant = r"""([0-9]*\.[0-9]+)|([0-9]+\.)""" + floating_constant = '(((('+fractional_constant+')'+exponent_part+'?)|([0-9]+'+exponent_part+'))[FfLl]?)' + binary_exponent_part = r'''([pP][+-]?[0-9]+)''' + hex_fractional_constant = '((('+hex_digits+r""")?\."""+hex_digits+')|('+hex_digits+r"""\.))""" + hex_floating_constant = '('+hex_prefix+'('+hex_digits+'|'+hex_fractional_constant+')'+binary_exponent_part+'[FfLl]?)' + + ## + ## Lexer states: used for preprocessor \n-terminated directives + ## + states = ( + # ppline: preprocessor line directives + # + ('ppline', 'exclusive'), + + # pppragma: pragma + # + ('pppragma', 'exclusive'), + ) + + def t_PPHASH(self, t): + r'[ \t]*\#' + if self.line_pattern.match(t.lexer.lexdata, pos=t.lexer.lexpos): + t.lexer.begin('ppline') + self.pp_line = self.pp_filename = None + elif self.pragma_pattern.match(t.lexer.lexdata, pos=t.lexer.lexpos): + t.lexer.begin('pppragma') + else: + t.type = 'PPHASH' + return t + + ## + ## Rules for the ppline state + ## + @TOKEN(string_literal) + def t_ppline_FILENAME(self, t): + if self.pp_line is None: + self._error('filename before line number in #line', t) + else: + self.pp_filename = t.value.lstrip('"').rstrip('"') + + @TOKEN(decimal_constant) + def t_ppline_LINE_NUMBER(self, t): + if self.pp_line is None: + self.pp_line = t.value + else: + # Ignore: GCC's cpp sometimes inserts a numeric flag + # after the file name + pass + + def t_ppline_NEWLINE(self, t): + r'\n' + if self.pp_line is None: + self._error('line number missing in #line', t) + else: + self.lexer.lineno = int(self.pp_line) + + if self.pp_filename is not None: + self.filename = self.pp_filename + + t.lexer.begin('INITIAL') + + def t_ppline_PPLINE(self, t): + r'line' + pass + + t_ppline_ignore = ' \t' + + def t_ppline_error(self, t): + self._error('invalid #line directive', t) + + ## + ## Rules for the pppragma state + ## + def t_pppragma_NEWLINE(self, t): + r'\n' + t.lexer.lineno += 1 + t.lexer.begin('INITIAL') + + def t_pppragma_PPPRAGMA(self, t): + r'pragma' + return t + + t_pppragma_ignore = ' \t' + + def t_pppragma_STR(self, t): + '.+' + t.type = 'PPPRAGMASTR' + return t + + def t_pppragma_error(self, t): + self._error('invalid #pragma directive', t) + + ## + ## Rules for the normal state + ## + t_ignore = ' \t' + + # Newlines + def t_NEWLINE(self, t): + r'\n+' + t.lexer.lineno += t.value.count("\n") + + # Operators + t_PLUS = r'\+' + t_MINUS = r'-' + t_TIMES = r'\*' + t_DIVIDE = r'/' + t_MOD = r'%' + t_OR = r'\|' + t_AND = r'&' + t_NOT = r'~' + t_XOR = r'\^' + t_LSHIFT = r'<<' + t_RSHIFT = r'>>' + t_LOR = r'\|\|' + t_LAND = r'&&' + t_LNOT = r'!' + t_LT = r'<' + t_GT = r'>' + t_LE = r'<=' + t_GE = r'>=' + t_EQ = r'==' + t_NE = r'!=' + + # Assignment operators + t_EQUALS = r'=' + t_TIMESEQUAL = r'\*=' + t_DIVEQUAL = r'/=' + t_MODEQUAL = r'%=' + t_PLUSEQUAL = r'\+=' + t_MINUSEQUAL = r'-=' + t_LSHIFTEQUAL = r'<<=' + t_RSHIFTEQUAL = r'>>=' + t_ANDEQUAL = r'&=' + t_OREQUAL = r'\|=' + t_XOREQUAL = r'\^=' + + # Increment/decrement + t_PLUSPLUS = r'\+\+' + t_MINUSMINUS = r'--' + + # -> + t_ARROW = r'->' + + # ? + t_CONDOP = r'\?' + + # Delimeters + t_LPAREN = r'\(' + t_RPAREN = r'\)' + t_LBRACKET = r'\[' + t_RBRACKET = r'\]' + t_COMMA = r',' + t_PERIOD = r'\.' + t_SEMI = r';' + t_COLON = r':' + t_ELLIPSIS = r'\.\.\.' + + # Scope delimiters + # To see why on_lbrace_func is needed, consider: + # typedef char TT; + # void foo(int TT) { TT = 10; } + # TT x = 5; + # Outside the function, TT is a typedef, but inside (starting and ending + # with the braces) it's a parameter. The trouble begins with yacc's + # lookahead token. If we open a new scope in brace_open, then TT has + # already been read and incorrectly interpreted as TYPEID. So, we need + # to open and close scopes from within the lexer. + # Similar for the TT immediately outside the end of the function. + # + @TOKEN(r'\{') + def t_LBRACE(self, t): + self.on_lbrace_func() + return t + @TOKEN(r'\}') + def t_RBRACE(self, t): + self.on_rbrace_func() + return t + + t_STRING_LITERAL = string_literal + + # The following floating and integer constants are defined as + # functions to impose a strict order (otherwise, decimal + # is placed before the others because its regex is longer, + # and this is bad) + # + @TOKEN(floating_constant) + def t_FLOAT_CONST(self, t): + return t + + @TOKEN(hex_floating_constant) + def t_HEX_FLOAT_CONST(self, t): + return t + + @TOKEN(hex_constant) + def t_INT_CONST_HEX(self, t): + return t + + @TOKEN(bin_constant) + def t_INT_CONST_BIN(self, t): + return t + + @TOKEN(bad_octal_constant) + def t_BAD_CONST_OCT(self, t): + msg = "Invalid octal constant" + self._error(msg, t) + + @TOKEN(octal_constant) + def t_INT_CONST_OCT(self, t): + return t + + @TOKEN(decimal_constant) + def t_INT_CONST_DEC(self, t): + return t + + # Must come before bad_char_const, to prevent it from + # catching valid char constants as invalid + # + @TOKEN(char_const) + def t_CHAR_CONST(self, t): + return t + + @TOKEN(wchar_const) + def t_WCHAR_CONST(self, t): + return t + + @TOKEN(unmatched_quote) + def t_UNMATCHED_QUOTE(self, t): + msg = "Unmatched '" + self._error(msg, t) + + @TOKEN(bad_char_const) + def t_BAD_CHAR_CONST(self, t): + msg = "Invalid char constant %s" % t.value + self._error(msg, t) + + @TOKEN(wstring_literal) + def t_WSTRING_LITERAL(self, t): + return t + + # unmatched string literals are caught by the preprocessor + + @TOKEN(bad_string_literal) + def t_BAD_STRING_LITERAL(self, t): + msg = "String contains invalid escape code" + self._error(msg, t) + + @TOKEN(identifier) + def t_ID(self, t): + t.type = self.keyword_map.get(t.value, "ID") + if t.type == 'ID' and self.type_lookup_func(t.value): + t.type = "TYPEID" + return t + + def t_error(self, t): + msg = 'Illegal character %s' % repr(t.value[0]) + self._error(msg, t) diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pycparser/c_parser.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pycparser/c_parser.py new file mode 100644 index 00000000..0e6e7556 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pycparser/c_parser.py @@ -0,0 +1,1850 @@ +#------------------------------------------------------------------------------ +# pycparser: c_parser.py +# +# CParser class: Parser and AST builder for the C language +# +# Eli Bendersky [https://eli.thegreenplace.net/] +# License: BSD +#------------------------------------------------------------------------------ +import re + +from .ply import yacc + +from . import c_ast +from .c_lexer import CLexer +from .plyparser import PLYParser, Coord, ParseError, parameterized, template +from .ast_transforms import fix_switch_cases + + +@template +class CParser(PLYParser): + def __init__( + self, + lex_optimize=True, + lexer=CLexer, + lextab='pycparser.lextab', + yacc_optimize=True, + yacctab='pycparser.yacctab', + yacc_debug=False, + taboutputdir=''): + """ Create a new CParser. + + Some arguments for controlling the debug/optimization + level of the parser are provided. The defaults are + tuned for release/performance mode. + The simple rules for using them are: + *) When tweaking CParser/CLexer, set these to False + *) When releasing a stable parser, set to True + + lex_optimize: + Set to False when you're modifying the lexer. + Otherwise, changes in the lexer won't be used, if + some lextab.py file exists. + When releasing with a stable lexer, set to True + to save the re-generation of the lexer table on + each run. + + lexer: + Set this parameter to define the lexer to use if + you're not using the default CLexer. + + lextab: + Points to the lex table that's used for optimized + mode. Only if you're modifying the lexer and want + some tests to avoid re-generating the table, make + this point to a local lex table file (that's been + earlier generated with lex_optimize=True) + + yacc_optimize: + Set to False when you're modifying the parser. + Otherwise, changes in the parser won't be used, if + some parsetab.py file exists. + When releasing with a stable parser, set to True + to save the re-generation of the parser table on + each run. + + yacctab: + Points to the yacc table that's used for optimized + mode. Only if you're modifying the parser, make + this point to a local yacc table file + + yacc_debug: + Generate a parser.out file that explains how yacc + built the parsing table from the grammar. + + taboutputdir: + Set this parameter to control the location of generated + lextab and yacctab files. + """ + self.clex = lexer( + error_func=self._lex_error_func, + on_lbrace_func=self._lex_on_lbrace_func, + on_rbrace_func=self._lex_on_rbrace_func, + type_lookup_func=self._lex_type_lookup_func) + + self.clex.build( + optimize=lex_optimize, + lextab=lextab, + outputdir=taboutputdir) + self.tokens = self.clex.tokens + + rules_with_opt = [ + 'abstract_declarator', + 'assignment_expression', + 'declaration_list', + 'declaration_specifiers_no_type', + 'designation', + 'expression', + 'identifier_list', + 'init_declarator_list', + 'id_init_declarator_list', + 'initializer_list', + 'parameter_type_list', + 'block_item_list', + 'type_qualifier_list', + 'struct_declarator_list' + ] + + for rule in rules_with_opt: + self._create_opt_rule(rule) + + self.cparser = yacc.yacc( + module=self, + start='translation_unit_or_empty', + debug=yacc_debug, + optimize=yacc_optimize, + tabmodule=yacctab, + outputdir=taboutputdir) + + # Stack of scopes for keeping track of symbols. _scope_stack[-1] is + # the current (topmost) scope. Each scope is a dictionary that + # specifies whether a name is a type. If _scope_stack[n][name] is + # True, 'name' is currently a type in the scope. If it's False, + # 'name' is used in the scope but not as a type (for instance, if we + # saw: int name; + # If 'name' is not a key in _scope_stack[n] then 'name' was not defined + # in this scope at all. + self._scope_stack = [dict()] + + # Keeps track of the last token given to yacc (the lookahead token) + self._last_yielded_token = None + + def parse(self, text, filename='', debuglevel=0): + """ Parses C code and returns an AST. + + text: + A string containing the C source code + + filename: + Name of the file being parsed (for meaningful + error messages) + + debuglevel: + Debug level to yacc + """ + self.clex.filename = filename + self.clex.reset_lineno() + self._scope_stack = [dict()] + self._last_yielded_token = None + return self.cparser.parse( + input=text, + lexer=self.clex, + debug=debuglevel) + + ######################-- PRIVATE --###################### + + def _push_scope(self): + self._scope_stack.append(dict()) + + def _pop_scope(self): + assert len(self._scope_stack) > 1 + self._scope_stack.pop() + + def _add_typedef_name(self, name, coord): + """ Add a new typedef name (ie a TYPEID) to the current scope + """ + if not self._scope_stack[-1].get(name, True): + self._parse_error( + "Typedef %r previously declared as non-typedef " + "in this scope" % name, coord) + self._scope_stack[-1][name] = True + + def _add_identifier(self, name, coord): + """ Add a new object, function, or enum member name (ie an ID) to the + current scope + """ + if self._scope_stack[-1].get(name, False): + self._parse_error( + "Non-typedef %r previously declared as typedef " + "in this scope" % name, coord) + self._scope_stack[-1][name] = False + + def _is_type_in_scope(self, name): + """ Is *name* a typedef-name in the current scope? + """ + for scope in reversed(self._scope_stack): + # If name is an identifier in this scope it shadows typedefs in + # higher scopes. + in_scope = scope.get(name) + if in_scope is not None: return in_scope + return False + + def _lex_error_func(self, msg, line, column): + self._parse_error(msg, self._coord(line, column)) + + def _lex_on_lbrace_func(self): + self._push_scope() + + def _lex_on_rbrace_func(self): + self._pop_scope() + + def _lex_type_lookup_func(self, name): + """ Looks up types that were previously defined with + typedef. + Passed to the lexer for recognizing identifiers that + are types. + """ + is_type = self._is_type_in_scope(name) + return is_type + + def _get_yacc_lookahead_token(self): + """ We need access to yacc's lookahead token in certain cases. + This is the last token yacc requested from the lexer, so we + ask the lexer. + """ + return self.clex.last_token + + # To understand what's going on here, read sections A.8.5 and + # A.8.6 of K&R2 very carefully. + # + # A C type consists of a basic type declaration, with a list + # of modifiers. For example: + # + # int *c[5]; + # + # The basic declaration here is 'int c', and the pointer and + # the array are the modifiers. + # + # Basic declarations are represented by TypeDecl (from module c_ast) and the + # modifiers are FuncDecl, PtrDecl and ArrayDecl. + # + # The standard states that whenever a new modifier is parsed, it should be + # added to the end of the list of modifiers. For example: + # + # K&R2 A.8.6.2: Array Declarators + # + # In a declaration T D where D has the form + # D1 [constant-expression-opt] + # and the type of the identifier in the declaration T D1 is + # "type-modifier T", the type of the + # identifier of D is "type-modifier array of T" + # + # This is what this method does. The declarator it receives + # can be a list of declarators ending with TypeDecl. It + # tacks the modifier to the end of this list, just before + # the TypeDecl. + # + # Additionally, the modifier may be a list itself. This is + # useful for pointers, that can come as a chain from the rule + # p_pointer. In this case, the whole modifier list is spliced + # into the new location. + def _type_modify_decl(self, decl, modifier): + """ Tacks a type modifier on a declarator, and returns + the modified declarator. + + Note: the declarator and modifier may be modified + """ + #~ print '****' + #~ decl.show(offset=3) + #~ modifier.show(offset=3) + #~ print '****' + + modifier_head = modifier + modifier_tail = modifier + + # The modifier may be a nested list. Reach its tail. + # + while modifier_tail.type: + modifier_tail = modifier_tail.type + + # If the decl is a basic type, just tack the modifier onto + # it + # + if isinstance(decl, c_ast.TypeDecl): + modifier_tail.type = decl + return modifier + else: + # Otherwise, the decl is a list of modifiers. Reach + # its tail and splice the modifier onto the tail, + # pointing to the underlying basic type. + # + decl_tail = decl + + while not isinstance(decl_tail.type, c_ast.TypeDecl): + decl_tail = decl_tail.type + + modifier_tail.type = decl_tail.type + decl_tail.type = modifier_head + return decl + + # Due to the order in which declarators are constructed, + # they have to be fixed in order to look like a normal AST. + # + # When a declaration arrives from syntax construction, it has + # these problems: + # * The innermost TypeDecl has no type (because the basic + # type is only known at the uppermost declaration level) + # * The declaration has no variable name, since that is saved + # in the innermost TypeDecl + # * The typename of the declaration is a list of type + # specifiers, and not a node. Here, basic identifier types + # should be separated from more complex types like enums + # and structs. + # + # This method fixes these problems. + # + def _fix_decl_name_type(self, decl, typename): + """ Fixes a declaration. Modifies decl. + """ + # Reach the underlying basic type + # + type = decl + while not isinstance(type, c_ast.TypeDecl): + type = type.type + + decl.name = type.declname + type.quals = decl.quals + + # The typename is a list of types. If any type in this + # list isn't an IdentifierType, it must be the only + # type in the list (it's illegal to declare "int enum ..") + # If all the types are basic, they're collected in the + # IdentifierType holder. + # + for tn in typename: + if not isinstance(tn, c_ast.IdentifierType): + if len(typename) > 1: + self._parse_error( + "Invalid multiple types specified", tn.coord) + else: + type.type = tn + return decl + + if not typename: + # Functions default to returning int + # + if not isinstance(decl.type, c_ast.FuncDecl): + self._parse_error( + "Missing type in declaration", decl.coord) + type.type = c_ast.IdentifierType( + ['int'], + coord=decl.coord) + else: + # At this point, we know that typename is a list of IdentifierType + # nodes. Concatenate all the names into a single list. + # + type.type = c_ast.IdentifierType( + [name for id in typename for name in id.names], + coord=typename[0].coord) + return decl + + def _add_declaration_specifier(self, declspec, newspec, kind, append=False): + """ Declaration specifiers are represented by a dictionary + with the entries: + * qual: a list of type qualifiers + * storage: a list of storage type qualifiers + * type: a list of type specifiers + * function: a list of function specifiers + + This method is given a declaration specifier, and a + new specifier of a given kind. + If `append` is True, the new specifier is added to the end of + the specifiers list, otherwise it's added at the beginning. + Returns the declaration specifier, with the new + specifier incorporated. + """ + spec = declspec or dict(qual=[], storage=[], type=[], function=[]) + + if append: + spec[kind].append(newspec) + else: + spec[kind].insert(0, newspec) + + return spec + + def _build_declarations(self, spec, decls, typedef_namespace=False): + """ Builds a list of declarations all sharing the given specifiers. + If typedef_namespace is true, each declared name is added + to the "typedef namespace", which also includes objects, + functions, and enum constants. + """ + is_typedef = 'typedef' in spec['storage'] + declarations = [] + + # Bit-fields are allowed to be unnamed. + # + if decls[0].get('bitsize') is not None: + pass + + # When redeclaring typedef names as identifiers in inner scopes, a + # problem can occur where the identifier gets grouped into + # spec['type'], leaving decl as None. This can only occur for the + # first declarator. + # + elif decls[0]['decl'] is None: + if len(spec['type']) < 2 or len(spec['type'][-1].names) != 1 or \ + not self._is_type_in_scope(spec['type'][-1].names[0]): + coord = '?' + for t in spec['type']: + if hasattr(t, 'coord'): + coord = t.coord + break + self._parse_error('Invalid declaration', coord) + + # Make this look as if it came from "direct_declarator:ID" + decls[0]['decl'] = c_ast.TypeDecl( + declname=spec['type'][-1].names[0], + type=None, + quals=None, + coord=spec['type'][-1].coord) + # Remove the "new" type's name from the end of spec['type'] + del spec['type'][-1] + + # A similar problem can occur where the declaration ends up looking + # like an abstract declarator. Give it a name if this is the case. + # + elif not isinstance(decls[0]['decl'], + (c_ast.Struct, c_ast.Union, c_ast.IdentifierType)): + decls_0_tail = decls[0]['decl'] + while not isinstance(decls_0_tail, c_ast.TypeDecl): + decls_0_tail = decls_0_tail.type + if decls_0_tail.declname is None: + decls_0_tail.declname = spec['type'][-1].names[0] + del spec['type'][-1] + + for decl in decls: + assert decl['decl'] is not None + if is_typedef: + declaration = c_ast.Typedef( + name=None, + quals=spec['qual'], + storage=spec['storage'], + type=decl['decl'], + coord=decl['decl'].coord) + else: + declaration = c_ast.Decl( + name=None, + quals=spec['qual'], + storage=spec['storage'], + funcspec=spec['function'], + type=decl['decl'], + init=decl.get('init'), + bitsize=decl.get('bitsize'), + coord=decl['decl'].coord) + + if isinstance(declaration.type, + (c_ast.Struct, c_ast.Union, c_ast.IdentifierType)): + fixed_decl = declaration + else: + fixed_decl = self._fix_decl_name_type(declaration, spec['type']) + + # Add the type name defined by typedef to a + # symbol table (for usage in the lexer) + # + if typedef_namespace: + if is_typedef: + self._add_typedef_name(fixed_decl.name, fixed_decl.coord) + else: + self._add_identifier(fixed_decl.name, fixed_decl.coord) + + declarations.append(fixed_decl) + + return declarations + + def _build_function_definition(self, spec, decl, param_decls, body): + """ Builds a function definition. + """ + assert 'typedef' not in spec['storage'] + + declaration = self._build_declarations( + spec=spec, + decls=[dict(decl=decl, init=None)], + typedef_namespace=True)[0] + + return c_ast.FuncDef( + decl=declaration, + param_decls=param_decls, + body=body, + coord=decl.coord) + + def _select_struct_union_class(self, token): + """ Given a token (either STRUCT or UNION), selects the + appropriate AST class. + """ + if token == 'struct': + return c_ast.Struct + else: + return c_ast.Union + + ## + ## Precedence and associativity of operators + ## + precedence = ( + ('left', 'LOR'), + ('left', 'LAND'), + ('left', 'OR'), + ('left', 'XOR'), + ('left', 'AND'), + ('left', 'EQ', 'NE'), + ('left', 'GT', 'GE', 'LT', 'LE'), + ('left', 'RSHIFT', 'LSHIFT'), + ('left', 'PLUS', 'MINUS'), + ('left', 'TIMES', 'DIVIDE', 'MOD') + ) + + ## + ## Grammar productions + ## Implementation of the BNF defined in K&R2 A.13 + ## + + # Wrapper around a translation unit, to allow for empty input. + # Not strictly part of the C99 Grammar, but useful in practice. + # + def p_translation_unit_or_empty(self, p): + """ translation_unit_or_empty : translation_unit + | empty + """ + if p[1] is None: + p[0] = c_ast.FileAST([]) + else: + p[0] = c_ast.FileAST(p[1]) + + def p_translation_unit_1(self, p): + """ translation_unit : external_declaration + """ + # Note: external_declaration is already a list + # + p[0] = p[1] + + def p_translation_unit_2(self, p): + """ translation_unit : translation_unit external_declaration + """ + if p[2] is not None: + p[1].extend(p[2]) + p[0] = p[1] + + # Declarations always come as lists (because they can be + # several in one line), so we wrap the function definition + # into a list as well, to make the return value of + # external_declaration homogenous. + # + def p_external_declaration_1(self, p): + """ external_declaration : function_definition + """ + p[0] = [p[1]] + + def p_external_declaration_2(self, p): + """ external_declaration : declaration + """ + p[0] = p[1] + + def p_external_declaration_3(self, p): + """ external_declaration : pp_directive + | pppragma_directive + """ + p[0] = [p[1]] + + def p_external_declaration_4(self, p): + """ external_declaration : SEMI + """ + p[0] = None + + def p_pp_directive(self, p): + """ pp_directive : PPHASH + """ + self._parse_error('Directives not supported yet', + self._token_coord(p, 1)) + + def p_pppragma_directive(self, p): + """ pppragma_directive : PPPRAGMA + | PPPRAGMA PPPRAGMASTR + """ + if len(p) == 3: + p[0] = c_ast.Pragma(p[2], self._token_coord(p, 2)) + else: + p[0] = c_ast.Pragma("", self._token_coord(p, 1)) + + # In function definitions, the declarator can be followed by + # a declaration list, for old "K&R style" function definitios. + # + def p_function_definition_1(self, p): + """ function_definition : id_declarator declaration_list_opt compound_statement + """ + # no declaration specifiers - 'int' becomes the default type + spec = dict( + qual=[], + storage=[], + type=[c_ast.IdentifierType(['int'], + coord=self._token_coord(p, 1))], + function=[]) + + p[0] = self._build_function_definition( + spec=spec, + decl=p[1], + param_decls=p[2], + body=p[3]) + + def p_function_definition_2(self, p): + """ function_definition : declaration_specifiers id_declarator declaration_list_opt compound_statement + """ + spec = p[1] + + p[0] = self._build_function_definition( + spec=spec, + decl=p[2], + param_decls=p[3], + body=p[4]) + + def p_statement(self, p): + """ statement : labeled_statement + | expression_statement + | compound_statement + | selection_statement + | iteration_statement + | jump_statement + | pppragma_directive + """ + p[0] = p[1] + + # A pragma is generally considered a decorator rather than an actual statement. + # Still, for the purposes of analyzing an abstract syntax tree of C code, + # pragma's should not be ignored and were previously treated as a statement. + # This presents a problem for constructs that take a statement such as labeled_statements, + # selection_statements, and iteration_statements, causing a misleading structure + # in the AST. For example, consider the following C code. + # + # for (int i = 0; i < 3; i++) + # #pragma omp critical + # sum += 1; + # + # This code will compile and execute "sum += 1;" as the body of the for loop. + # Previous implementations of PyCParser would render the AST for this + # block of code as follows: + # + # For: + # DeclList: + # Decl: i, [], [], [] + # TypeDecl: i, [] + # IdentifierType: ['int'] + # Constant: int, 0 + # BinaryOp: < + # ID: i + # Constant: int, 3 + # UnaryOp: p++ + # ID: i + # Pragma: omp critical + # Assignment: += + # ID: sum + # Constant: int, 1 + # + # This AST misleadingly takes the Pragma as the body of the loop and the + # assignment then becomes a sibling of the loop. + # + # To solve edge cases like these, the pragmacomp_or_statement rule groups + # a pragma and its following statement (which would otherwise be orphaned) + # using a compound block, effectively turning the above code into: + # + # for (int i = 0; i < 3; i++) { + # #pragma omp critical + # sum += 1; + # } + def p_pragmacomp_or_statement(self, p): + """ pragmacomp_or_statement : pppragma_directive statement + | statement + """ + if isinstance(p[1], c_ast.Pragma) and len(p) == 3: + p[0] = c_ast.Compound( + block_items=[p[1], p[2]], + coord=self._token_coord(p, 1)) + else: + p[0] = p[1] + + # In C, declarations can come several in a line: + # int x, *px, romulo = 5; + # + # However, for the AST, we will split them to separate Decl + # nodes. + # + # This rule splits its declarations and always returns a list + # of Decl nodes, even if it's one element long. + # + def p_decl_body(self, p): + """ decl_body : declaration_specifiers init_declarator_list_opt + | declaration_specifiers_no_type id_init_declarator_list_opt + """ + spec = p[1] + + # p[2] (init_declarator_list_opt) is either a list or None + # + if p[2] is None: + # By the standard, you must have at least one declarator unless + # declaring a structure tag, a union tag, or the members of an + # enumeration. + # + ty = spec['type'] + s_u_or_e = (c_ast.Struct, c_ast.Union, c_ast.Enum) + if len(ty) == 1 and isinstance(ty[0], s_u_or_e): + decls = [c_ast.Decl( + name=None, + quals=spec['qual'], + storage=spec['storage'], + funcspec=spec['function'], + type=ty[0], + init=None, + bitsize=None, + coord=ty[0].coord)] + + # However, this case can also occur on redeclared identifiers in + # an inner scope. The trouble is that the redeclared type's name + # gets grouped into declaration_specifiers; _build_declarations + # compensates for this. + # + else: + decls = self._build_declarations( + spec=spec, + decls=[dict(decl=None, init=None)], + typedef_namespace=True) + + else: + decls = self._build_declarations( + spec=spec, + decls=p[2], + typedef_namespace=True) + + p[0] = decls + + # The declaration has been split to a decl_body sub-rule and + # SEMI, because having them in a single rule created a problem + # for defining typedefs. + # + # If a typedef line was directly followed by a line using the + # type defined with the typedef, the type would not be + # recognized. This is because to reduce the declaration rule, + # the parser's lookahead asked for the token after SEMI, which + # was the type from the next line, and the lexer had no chance + # to see the updated type symbol table. + # + # Splitting solves this problem, because after seeing SEMI, + # the parser reduces decl_body, which actually adds the new + # type into the table to be seen by the lexer before the next + # line is reached. + def p_declaration(self, p): + """ declaration : decl_body SEMI + """ + p[0] = p[1] + + # Since each declaration is a list of declarations, this + # rule will combine all the declarations and return a single + # list + # + def p_declaration_list(self, p): + """ declaration_list : declaration + | declaration_list declaration + """ + p[0] = p[1] if len(p) == 2 else p[1] + p[2] + + # To know when declaration-specifiers end and declarators begin, + # we require declaration-specifiers to have at least one + # type-specifier, and disallow typedef-names after we've seen any + # type-specifier. These are both required by the spec. + # + def p_declaration_specifiers_no_type_1(self, p): + """ declaration_specifiers_no_type : type_qualifier declaration_specifiers_no_type_opt + """ + p[0] = self._add_declaration_specifier(p[2], p[1], 'qual') + + def p_declaration_specifiers_no_type_2(self, p): + """ declaration_specifiers_no_type : storage_class_specifier declaration_specifiers_no_type_opt + """ + p[0] = self._add_declaration_specifier(p[2], p[1], 'storage') + + def p_declaration_specifiers_no_type_3(self, p): + """ declaration_specifiers_no_type : function_specifier declaration_specifiers_no_type_opt + """ + p[0] = self._add_declaration_specifier(p[2], p[1], 'function') + + + def p_declaration_specifiers_1(self, p): + """ declaration_specifiers : declaration_specifiers type_qualifier + """ + p[0] = self._add_declaration_specifier(p[1], p[2], 'qual', append=True) + + def p_declaration_specifiers_2(self, p): + """ declaration_specifiers : declaration_specifiers storage_class_specifier + """ + p[0] = self._add_declaration_specifier(p[1], p[2], 'storage', append=True) + + def p_declaration_specifiers_3(self, p): + """ declaration_specifiers : declaration_specifiers function_specifier + """ + p[0] = self._add_declaration_specifier(p[1], p[2], 'function', append=True) + + def p_declaration_specifiers_4(self, p): + """ declaration_specifiers : declaration_specifiers type_specifier_no_typeid + """ + p[0] = self._add_declaration_specifier(p[1], p[2], 'type', append=True) + + def p_declaration_specifiers_5(self, p): + """ declaration_specifiers : type_specifier + """ + p[0] = self._add_declaration_specifier(None, p[1], 'type') + + def p_declaration_specifiers_6(self, p): + """ declaration_specifiers : declaration_specifiers_no_type type_specifier + """ + p[0] = self._add_declaration_specifier(p[1], p[2], 'type', append=True) + + + def p_storage_class_specifier(self, p): + """ storage_class_specifier : AUTO + | REGISTER + | STATIC + | EXTERN + | TYPEDEF + """ + p[0] = p[1] + + def p_function_specifier(self, p): + """ function_specifier : INLINE + """ + p[0] = p[1] + + def p_type_specifier_no_typeid(self, p): + """ type_specifier_no_typeid : VOID + | _BOOL + | CHAR + | SHORT + | INT + | LONG + | FLOAT + | DOUBLE + | _COMPLEX + | SIGNED + | UNSIGNED + | __INT128 + """ + p[0] = c_ast.IdentifierType([p[1]], coord=self._token_coord(p, 1)) + + def p_type_specifier(self, p): + """ type_specifier : typedef_name + | enum_specifier + | struct_or_union_specifier + | type_specifier_no_typeid + """ + p[0] = p[1] + + def p_type_qualifier(self, p): + """ type_qualifier : CONST + | RESTRICT + | VOLATILE + """ + p[0] = p[1] + + def p_init_declarator_list(self, p): + """ init_declarator_list : init_declarator + | init_declarator_list COMMA init_declarator + """ + p[0] = p[1] + [p[3]] if len(p) == 4 else [p[1]] + + # Returns a {decl= : init=} dictionary + # If there's no initializer, uses None + # + def p_init_declarator(self, p): + """ init_declarator : declarator + | declarator EQUALS initializer + """ + p[0] = dict(decl=p[1], init=(p[3] if len(p) > 2 else None)) + + def p_id_init_declarator_list(self, p): + """ id_init_declarator_list : id_init_declarator + | id_init_declarator_list COMMA init_declarator + """ + p[0] = p[1] + [p[3]] if len(p) == 4 else [p[1]] + + def p_id_init_declarator(self, p): + """ id_init_declarator : id_declarator + | id_declarator EQUALS initializer + """ + p[0] = dict(decl=p[1], init=(p[3] if len(p) > 2 else None)) + + # Require at least one type specifier in a specifier-qualifier-list + # + def p_specifier_qualifier_list_1(self, p): + """ specifier_qualifier_list : specifier_qualifier_list type_specifier_no_typeid + """ + p[0] = self._add_declaration_specifier(p[1], p[2], 'type', append=True) + + def p_specifier_qualifier_list_2(self, p): + """ specifier_qualifier_list : specifier_qualifier_list type_qualifier + """ + p[0] = self._add_declaration_specifier(p[1], p[2], 'qual', append=True) + + def p_specifier_qualifier_list_3(self, p): + """ specifier_qualifier_list : type_specifier + """ + p[0] = self._add_declaration_specifier(None, p[1], 'type') + + def p_specifier_qualifier_list_4(self, p): + """ specifier_qualifier_list : type_qualifier_list type_specifier + """ + spec = dict(qual=p[1], storage=[], type=[], function=[]) + p[0] = self._add_declaration_specifier(spec, p[2], 'type', append=True) + + # TYPEID is allowed here (and in other struct/enum related tag names), because + # struct/enum tags reside in their own namespace and can be named the same as types + # + def p_struct_or_union_specifier_1(self, p): + """ struct_or_union_specifier : struct_or_union ID + | struct_or_union TYPEID + """ + klass = self._select_struct_union_class(p[1]) + # None means no list of members + p[0] = klass( + name=p[2], + decls=None, + coord=self._token_coord(p, 2)) + + def p_struct_or_union_specifier_2(self, p): + """ struct_or_union_specifier : struct_or_union brace_open struct_declaration_list brace_close + | struct_or_union brace_open brace_close + """ + klass = self._select_struct_union_class(p[1]) + if len(p) == 4: + # Empty sequence means an empty list of members + p[0] = klass( + name=None, + decls=[], + coord=self._token_coord(p, 2)) + else: + p[0] = klass( + name=None, + decls=p[3], + coord=self._token_coord(p, 2)) + + + def p_struct_or_union_specifier_3(self, p): + """ struct_or_union_specifier : struct_or_union ID brace_open struct_declaration_list brace_close + | struct_or_union ID brace_open brace_close + | struct_or_union TYPEID brace_open struct_declaration_list brace_close + | struct_or_union TYPEID brace_open brace_close + """ + klass = self._select_struct_union_class(p[1]) + if len(p) == 5: + # Empty sequence means an empty list of members + p[0] = klass( + name=p[2], + decls=[], + coord=self._token_coord(p, 2)) + else: + p[0] = klass( + name=p[2], + decls=p[4], + coord=self._token_coord(p, 2)) + + def p_struct_or_union(self, p): + """ struct_or_union : STRUCT + | UNION + """ + p[0] = p[1] + + # Combine all declarations into a single list + # + def p_struct_declaration_list(self, p): + """ struct_declaration_list : struct_declaration + | struct_declaration_list struct_declaration + """ + if len(p) == 2: + p[0] = p[1] or [] + else: + p[0] = p[1] + (p[2] or []) + + def p_struct_declaration_1(self, p): + """ struct_declaration : specifier_qualifier_list struct_declarator_list_opt SEMI + """ + spec = p[1] + assert 'typedef' not in spec['storage'] + + if p[2] is not None: + decls = self._build_declarations( + spec=spec, + decls=p[2]) + + elif len(spec['type']) == 1: + # Anonymous struct/union, gcc extension, C1x feature. + # Although the standard only allows structs/unions here, I see no + # reason to disallow other types since some compilers have typedefs + # here, and pycparser isn't about rejecting all invalid code. + # + node = spec['type'][0] + if isinstance(node, c_ast.Node): + decl_type = node + else: + decl_type = c_ast.IdentifierType(node) + + decls = self._build_declarations( + spec=spec, + decls=[dict(decl=decl_type)]) + + else: + # Structure/union members can have the same names as typedefs. + # The trouble is that the member's name gets grouped into + # specifier_qualifier_list; _build_declarations compensates. + # + decls = self._build_declarations( + spec=spec, + decls=[dict(decl=None, init=None)]) + + p[0] = decls + + def p_struct_declaration_2(self, p): + """ struct_declaration : SEMI + """ + p[0] = None + + def p_struct_declaration_3(self, p): + """ struct_declaration : pppragma_directive + """ + p[0] = [p[1]] + + def p_struct_declarator_list(self, p): + """ struct_declarator_list : struct_declarator + | struct_declarator_list COMMA struct_declarator + """ + p[0] = p[1] + [p[3]] if len(p) == 4 else [p[1]] + + # struct_declarator passes up a dict with the keys: decl (for + # the underlying declarator) and bitsize (for the bitsize) + # + def p_struct_declarator_1(self, p): + """ struct_declarator : declarator + """ + p[0] = {'decl': p[1], 'bitsize': None} + + def p_struct_declarator_2(self, p): + """ struct_declarator : declarator COLON constant_expression + | COLON constant_expression + """ + if len(p) > 3: + p[0] = {'decl': p[1], 'bitsize': p[3]} + else: + p[0] = {'decl': c_ast.TypeDecl(None, None, None), 'bitsize': p[2]} + + def p_enum_specifier_1(self, p): + """ enum_specifier : ENUM ID + | ENUM TYPEID + """ + p[0] = c_ast.Enum(p[2], None, self._token_coord(p, 1)) + + def p_enum_specifier_2(self, p): + """ enum_specifier : ENUM brace_open enumerator_list brace_close + """ + p[0] = c_ast.Enum(None, p[3], self._token_coord(p, 1)) + + def p_enum_specifier_3(self, p): + """ enum_specifier : ENUM ID brace_open enumerator_list brace_close + | ENUM TYPEID brace_open enumerator_list brace_close + """ + p[0] = c_ast.Enum(p[2], p[4], self._token_coord(p, 1)) + + def p_enumerator_list(self, p): + """ enumerator_list : enumerator + | enumerator_list COMMA + | enumerator_list COMMA enumerator + """ + if len(p) == 2: + p[0] = c_ast.EnumeratorList([p[1]], p[1].coord) + elif len(p) == 3: + p[0] = p[1] + else: + p[1].enumerators.append(p[3]) + p[0] = p[1] + + def p_enumerator(self, p): + """ enumerator : ID + | ID EQUALS constant_expression + """ + if len(p) == 2: + enumerator = c_ast.Enumerator( + p[1], None, + self._token_coord(p, 1)) + else: + enumerator = c_ast.Enumerator( + p[1], p[3], + self._token_coord(p, 1)) + self._add_identifier(enumerator.name, enumerator.coord) + + p[0] = enumerator + + def p_declarator(self, p): + """ declarator : id_declarator + | typeid_declarator + """ + p[0] = p[1] + + @parameterized(('id', 'ID'), ('typeid', 'TYPEID'), ('typeid_noparen', 'TYPEID')) + def p_xxx_declarator_1(self, p): + """ xxx_declarator : direct_xxx_declarator + """ + p[0] = p[1] + + @parameterized(('id', 'ID'), ('typeid', 'TYPEID'), ('typeid_noparen', 'TYPEID')) + def p_xxx_declarator_2(self, p): + """ xxx_declarator : pointer direct_xxx_declarator + """ + p[0] = self._type_modify_decl(p[2], p[1]) + + @parameterized(('id', 'ID'), ('typeid', 'TYPEID'), ('typeid_noparen', 'TYPEID')) + def p_direct_xxx_declarator_1(self, p): + """ direct_xxx_declarator : yyy + """ + p[0] = c_ast.TypeDecl( + declname=p[1], + type=None, + quals=None, + coord=self._token_coord(p, 1)) + + @parameterized(('id', 'ID'), ('typeid', 'TYPEID')) + def p_direct_xxx_declarator_2(self, p): + """ direct_xxx_declarator : LPAREN xxx_declarator RPAREN + """ + p[0] = p[2] + + @parameterized(('id', 'ID'), ('typeid', 'TYPEID'), ('typeid_noparen', 'TYPEID')) + def p_direct_xxx_declarator_3(self, p): + """ direct_xxx_declarator : direct_xxx_declarator LBRACKET type_qualifier_list_opt assignment_expression_opt RBRACKET + """ + quals = (p[3] if len(p) > 5 else []) or [] + # Accept dimension qualifiers + # Per C99 6.7.5.3 p7 + arr = c_ast.ArrayDecl( + type=None, + dim=p[4] if len(p) > 5 else p[3], + dim_quals=quals, + coord=p[1].coord) + + p[0] = self._type_modify_decl(decl=p[1], modifier=arr) + + @parameterized(('id', 'ID'), ('typeid', 'TYPEID'), ('typeid_noparen', 'TYPEID')) + def p_direct_xxx_declarator_4(self, p): + """ direct_xxx_declarator : direct_xxx_declarator LBRACKET STATIC type_qualifier_list_opt assignment_expression RBRACKET + | direct_xxx_declarator LBRACKET type_qualifier_list STATIC assignment_expression RBRACKET + """ + # Using slice notation for PLY objects doesn't work in Python 3 for the + # version of PLY embedded with pycparser; see PLY Google Code issue 30. + # Work around that here by listing the two elements separately. + listed_quals = [item if isinstance(item, list) else [item] + for item in [p[3],p[4]]] + dim_quals = [qual for sublist in listed_quals for qual in sublist + if qual is not None] + arr = c_ast.ArrayDecl( + type=None, + dim=p[5], + dim_quals=dim_quals, + coord=p[1].coord) + + p[0] = self._type_modify_decl(decl=p[1], modifier=arr) + + # Special for VLAs + # + @parameterized(('id', 'ID'), ('typeid', 'TYPEID'), ('typeid_noparen', 'TYPEID')) + def p_direct_xxx_declarator_5(self, p): + """ direct_xxx_declarator : direct_xxx_declarator LBRACKET type_qualifier_list_opt TIMES RBRACKET + """ + arr = c_ast.ArrayDecl( + type=None, + dim=c_ast.ID(p[4], self._token_coord(p, 4)), + dim_quals=p[3] if p[3] != None else [], + coord=p[1].coord) + + p[0] = self._type_modify_decl(decl=p[1], modifier=arr) + + @parameterized(('id', 'ID'), ('typeid', 'TYPEID'), ('typeid_noparen', 'TYPEID')) + def p_direct_xxx_declarator_6(self, p): + """ direct_xxx_declarator : direct_xxx_declarator LPAREN parameter_type_list RPAREN + | direct_xxx_declarator LPAREN identifier_list_opt RPAREN + """ + func = c_ast.FuncDecl( + args=p[3], + type=None, + coord=p[1].coord) + + # To see why _get_yacc_lookahead_token is needed, consider: + # typedef char TT; + # void foo(int TT) { TT = 10; } + # Outside the function, TT is a typedef, but inside (starting and + # ending with the braces) it's a parameter. The trouble begins with + # yacc's lookahead token. We don't know if we're declaring or + # defining a function until we see LBRACE, but if we wait for yacc to + # trigger a rule on that token, then TT will have already been read + # and incorrectly interpreted as TYPEID. We need to add the + # parameters to the scope the moment the lexer sees LBRACE. + # + if self._get_yacc_lookahead_token().type == "LBRACE": + if func.args is not None: + for param in func.args.params: + if isinstance(param, c_ast.EllipsisParam): break + self._add_identifier(param.name, param.coord) + + p[0] = self._type_modify_decl(decl=p[1], modifier=func) + + def p_pointer(self, p): + """ pointer : TIMES type_qualifier_list_opt + | TIMES type_qualifier_list_opt pointer + """ + coord = self._token_coord(p, 1) + # Pointer decls nest from inside out. This is important when different + # levels have different qualifiers. For example: + # + # char * const * p; + # + # Means "pointer to const pointer to char" + # + # While: + # + # char ** const p; + # + # Means "const pointer to pointer to char" + # + # So when we construct PtrDecl nestings, the leftmost pointer goes in + # as the most nested type. + nested_type = c_ast.PtrDecl(quals=p[2] or [], type=None, coord=coord) + if len(p) > 3: + tail_type = p[3] + while tail_type.type is not None: + tail_type = tail_type.type + tail_type.type = nested_type + p[0] = p[3] + else: + p[0] = nested_type + + def p_type_qualifier_list(self, p): + """ type_qualifier_list : type_qualifier + | type_qualifier_list type_qualifier + """ + p[0] = [p[1]] if len(p) == 2 else p[1] + [p[2]] + + def p_parameter_type_list(self, p): + """ parameter_type_list : parameter_list + | parameter_list COMMA ELLIPSIS + """ + if len(p) > 2: + p[1].params.append(c_ast.EllipsisParam(self._token_coord(p, 3))) + + p[0] = p[1] + + def p_parameter_list(self, p): + """ parameter_list : parameter_declaration + | parameter_list COMMA parameter_declaration + """ + if len(p) == 2: # single parameter + p[0] = c_ast.ParamList([p[1]], p[1].coord) + else: + p[1].params.append(p[3]) + p[0] = p[1] + + # From ISO/IEC 9899:TC2, 6.7.5.3.11: + # "If, in a parameter declaration, an identifier can be treated either + # as a typedef name or as a parameter name, it shall be taken as a + # typedef name." + # + # Inside a parameter declaration, once we've reduced declaration specifiers, + # if we shift in an LPAREN and see a TYPEID, it could be either an abstract + # declarator or a declarator nested inside parens. This rule tells us to + # always treat it as an abstract declarator. Therefore, we only accept + # `id_declarator`s and `typeid_noparen_declarator`s. + def p_parameter_declaration_1(self, p): + """ parameter_declaration : declaration_specifiers id_declarator + | declaration_specifiers typeid_noparen_declarator + """ + spec = p[1] + if not spec['type']: + spec['type'] = [c_ast.IdentifierType(['int'], + coord=self._token_coord(p, 1))] + p[0] = self._build_declarations( + spec=spec, + decls=[dict(decl=p[2])])[0] + + def p_parameter_declaration_2(self, p): + """ parameter_declaration : declaration_specifiers abstract_declarator_opt + """ + spec = p[1] + if not spec['type']: + spec['type'] = [c_ast.IdentifierType(['int'], + coord=self._token_coord(p, 1))] + + # Parameters can have the same names as typedefs. The trouble is that + # the parameter's name gets grouped into declaration_specifiers, making + # it look like an old-style declaration; compensate. + # + if len(spec['type']) > 1 and len(spec['type'][-1].names) == 1 and \ + self._is_type_in_scope(spec['type'][-1].names[0]): + decl = self._build_declarations( + spec=spec, + decls=[dict(decl=p[2], init=None)])[0] + + # This truly is an old-style parameter declaration + # + else: + decl = c_ast.Typename( + name='', + quals=spec['qual'], + type=p[2] or c_ast.TypeDecl(None, None, None), + coord=self._token_coord(p, 2)) + typename = spec['type'] + decl = self._fix_decl_name_type(decl, typename) + + p[0] = decl + + def p_identifier_list(self, p): + """ identifier_list : identifier + | identifier_list COMMA identifier + """ + if len(p) == 2: # single parameter + p[0] = c_ast.ParamList([p[1]], p[1].coord) + else: + p[1].params.append(p[3]) + p[0] = p[1] + + def p_initializer_1(self, p): + """ initializer : assignment_expression + """ + p[0] = p[1] + + def p_initializer_2(self, p): + """ initializer : brace_open initializer_list_opt brace_close + | brace_open initializer_list COMMA brace_close + """ + if p[2] is None: + p[0] = c_ast.InitList([], self._token_coord(p, 1)) + else: + p[0] = p[2] + + def p_initializer_list(self, p): + """ initializer_list : designation_opt initializer + | initializer_list COMMA designation_opt initializer + """ + if len(p) == 3: # single initializer + init = p[2] if p[1] is None else c_ast.NamedInitializer(p[1], p[2]) + p[0] = c_ast.InitList([init], p[2].coord) + else: + init = p[4] if p[3] is None else c_ast.NamedInitializer(p[3], p[4]) + p[1].exprs.append(init) + p[0] = p[1] + + def p_designation(self, p): + """ designation : designator_list EQUALS + """ + p[0] = p[1] + + # Designators are represented as a list of nodes, in the order in which + # they're written in the code. + # + def p_designator_list(self, p): + """ designator_list : designator + | designator_list designator + """ + p[0] = [p[1]] if len(p) == 2 else p[1] + [p[2]] + + def p_designator(self, p): + """ designator : LBRACKET constant_expression RBRACKET + | PERIOD identifier + """ + p[0] = p[2] + + def p_type_name(self, p): + """ type_name : specifier_qualifier_list abstract_declarator_opt + """ + typename = c_ast.Typename( + name='', + quals=p[1]['qual'], + type=p[2] or c_ast.TypeDecl(None, None, None), + coord=self._token_coord(p, 2)) + + p[0] = self._fix_decl_name_type(typename, p[1]['type']) + + def p_abstract_declarator_1(self, p): + """ abstract_declarator : pointer + """ + dummytype = c_ast.TypeDecl(None, None, None) + p[0] = self._type_modify_decl( + decl=dummytype, + modifier=p[1]) + + def p_abstract_declarator_2(self, p): + """ abstract_declarator : pointer direct_abstract_declarator + """ + p[0] = self._type_modify_decl(p[2], p[1]) + + def p_abstract_declarator_3(self, p): + """ abstract_declarator : direct_abstract_declarator + """ + p[0] = p[1] + + # Creating and using direct_abstract_declarator_opt here + # instead of listing both direct_abstract_declarator and the + # lack of it in the beginning of _1 and _2 caused two + # shift/reduce errors. + # + def p_direct_abstract_declarator_1(self, p): + """ direct_abstract_declarator : LPAREN abstract_declarator RPAREN """ + p[0] = p[2] + + def p_direct_abstract_declarator_2(self, p): + """ direct_abstract_declarator : direct_abstract_declarator LBRACKET assignment_expression_opt RBRACKET + """ + arr = c_ast.ArrayDecl( + type=None, + dim=p[3], + dim_quals=[], + coord=p[1].coord) + + p[0] = self._type_modify_decl(decl=p[1], modifier=arr) + + def p_direct_abstract_declarator_3(self, p): + """ direct_abstract_declarator : LBRACKET assignment_expression_opt RBRACKET + """ + p[0] = c_ast.ArrayDecl( + type=c_ast.TypeDecl(None, None, None), + dim=p[2], + dim_quals=[], + coord=self._token_coord(p, 1)) + + def p_direct_abstract_declarator_4(self, p): + """ direct_abstract_declarator : direct_abstract_declarator LBRACKET TIMES RBRACKET + """ + arr = c_ast.ArrayDecl( + type=None, + dim=c_ast.ID(p[3], self._token_coord(p, 3)), + dim_quals=[], + coord=p[1].coord) + + p[0] = self._type_modify_decl(decl=p[1], modifier=arr) + + def p_direct_abstract_declarator_5(self, p): + """ direct_abstract_declarator : LBRACKET TIMES RBRACKET + """ + p[0] = c_ast.ArrayDecl( + type=c_ast.TypeDecl(None, None, None), + dim=c_ast.ID(p[3], self._token_coord(p, 3)), + dim_quals=[], + coord=self._token_coord(p, 1)) + + def p_direct_abstract_declarator_6(self, p): + """ direct_abstract_declarator : direct_abstract_declarator LPAREN parameter_type_list_opt RPAREN + """ + func = c_ast.FuncDecl( + args=p[3], + type=None, + coord=p[1].coord) + + p[0] = self._type_modify_decl(decl=p[1], modifier=func) + + def p_direct_abstract_declarator_7(self, p): + """ direct_abstract_declarator : LPAREN parameter_type_list_opt RPAREN + """ + p[0] = c_ast.FuncDecl( + args=p[2], + type=c_ast.TypeDecl(None, None, None), + coord=self._token_coord(p, 1)) + + # declaration is a list, statement isn't. To make it consistent, block_item + # will always be a list + # + def p_block_item(self, p): + """ block_item : declaration + | statement + """ + p[0] = p[1] if isinstance(p[1], list) else [p[1]] + + # Since we made block_item a list, this just combines lists + # + def p_block_item_list(self, p): + """ block_item_list : block_item + | block_item_list block_item + """ + # Empty block items (plain ';') produce [None], so ignore them + p[0] = p[1] if (len(p) == 2 or p[2] == [None]) else p[1] + p[2] + + def p_compound_statement_1(self, p): + """ compound_statement : brace_open block_item_list_opt brace_close """ + p[0] = c_ast.Compound( + block_items=p[2], + coord=self._token_coord(p, 1)) + + def p_labeled_statement_1(self, p): + """ labeled_statement : ID COLON pragmacomp_or_statement """ + p[0] = c_ast.Label(p[1], p[3], self._token_coord(p, 1)) + + def p_labeled_statement_2(self, p): + """ labeled_statement : CASE constant_expression COLON pragmacomp_or_statement """ + p[0] = c_ast.Case(p[2], [p[4]], self._token_coord(p, 1)) + + def p_labeled_statement_3(self, p): + """ labeled_statement : DEFAULT COLON pragmacomp_or_statement """ + p[0] = c_ast.Default([p[3]], self._token_coord(p, 1)) + + def p_selection_statement_1(self, p): + """ selection_statement : IF LPAREN expression RPAREN pragmacomp_or_statement """ + p[0] = c_ast.If(p[3], p[5], None, self._token_coord(p, 1)) + + def p_selection_statement_2(self, p): + """ selection_statement : IF LPAREN expression RPAREN statement ELSE pragmacomp_or_statement """ + p[0] = c_ast.If(p[3], p[5], p[7], self._token_coord(p, 1)) + + def p_selection_statement_3(self, p): + """ selection_statement : SWITCH LPAREN expression RPAREN pragmacomp_or_statement """ + p[0] = fix_switch_cases( + c_ast.Switch(p[3], p[5], self._token_coord(p, 1))) + + def p_iteration_statement_1(self, p): + """ iteration_statement : WHILE LPAREN expression RPAREN pragmacomp_or_statement """ + p[0] = c_ast.While(p[3], p[5], self._token_coord(p, 1)) + + def p_iteration_statement_2(self, p): + """ iteration_statement : DO pragmacomp_or_statement WHILE LPAREN expression RPAREN SEMI """ + p[0] = c_ast.DoWhile(p[5], p[2], self._token_coord(p, 1)) + + def p_iteration_statement_3(self, p): + """ iteration_statement : FOR LPAREN expression_opt SEMI expression_opt SEMI expression_opt RPAREN pragmacomp_or_statement """ + p[0] = c_ast.For(p[3], p[5], p[7], p[9], self._token_coord(p, 1)) + + def p_iteration_statement_4(self, p): + """ iteration_statement : FOR LPAREN declaration expression_opt SEMI expression_opt RPAREN pragmacomp_or_statement """ + p[0] = c_ast.For(c_ast.DeclList(p[3], self._token_coord(p, 1)), + p[4], p[6], p[8], self._token_coord(p, 1)) + + def p_jump_statement_1(self, p): + """ jump_statement : GOTO ID SEMI """ + p[0] = c_ast.Goto(p[2], self._token_coord(p, 1)) + + def p_jump_statement_2(self, p): + """ jump_statement : BREAK SEMI """ + p[0] = c_ast.Break(self._token_coord(p, 1)) + + def p_jump_statement_3(self, p): + """ jump_statement : CONTINUE SEMI """ + p[0] = c_ast.Continue(self._token_coord(p, 1)) + + def p_jump_statement_4(self, p): + """ jump_statement : RETURN expression SEMI + | RETURN SEMI + """ + p[0] = c_ast.Return(p[2] if len(p) == 4 else None, self._token_coord(p, 1)) + + def p_expression_statement(self, p): + """ expression_statement : expression_opt SEMI """ + if p[1] is None: + p[0] = c_ast.EmptyStatement(self._token_coord(p, 2)) + else: + p[0] = p[1] + + def p_expression(self, p): + """ expression : assignment_expression + | expression COMMA assignment_expression + """ + if len(p) == 2: + p[0] = p[1] + else: + if not isinstance(p[1], c_ast.ExprList): + p[1] = c_ast.ExprList([p[1]], p[1].coord) + + p[1].exprs.append(p[3]) + p[0] = p[1] + + def p_typedef_name(self, p): + """ typedef_name : TYPEID """ + p[0] = c_ast.IdentifierType([p[1]], coord=self._token_coord(p, 1)) + + def p_assignment_expression(self, p): + """ assignment_expression : conditional_expression + | unary_expression assignment_operator assignment_expression + """ + if len(p) == 2: + p[0] = p[1] + else: + p[0] = c_ast.Assignment(p[2], p[1], p[3], p[1].coord) + + # K&R2 defines these as many separate rules, to encode + # precedence and associativity. Why work hard ? I'll just use + # the built in precedence/associativity specification feature + # of PLY. (see precedence declaration above) + # + def p_assignment_operator(self, p): + """ assignment_operator : EQUALS + | XOREQUAL + | TIMESEQUAL + | DIVEQUAL + | MODEQUAL + | PLUSEQUAL + | MINUSEQUAL + | LSHIFTEQUAL + | RSHIFTEQUAL + | ANDEQUAL + | OREQUAL + """ + p[0] = p[1] + + def p_constant_expression(self, p): + """ constant_expression : conditional_expression """ + p[0] = p[1] + + def p_conditional_expression(self, p): + """ conditional_expression : binary_expression + | binary_expression CONDOP expression COLON conditional_expression + """ + if len(p) == 2: + p[0] = p[1] + else: + p[0] = c_ast.TernaryOp(p[1], p[3], p[5], p[1].coord) + + def p_binary_expression(self, p): + """ binary_expression : cast_expression + | binary_expression TIMES binary_expression + | binary_expression DIVIDE binary_expression + | binary_expression MOD binary_expression + | binary_expression PLUS binary_expression + | binary_expression MINUS binary_expression + | binary_expression RSHIFT binary_expression + | binary_expression LSHIFT binary_expression + | binary_expression LT binary_expression + | binary_expression LE binary_expression + | binary_expression GE binary_expression + | binary_expression GT binary_expression + | binary_expression EQ binary_expression + | binary_expression NE binary_expression + | binary_expression AND binary_expression + | binary_expression OR binary_expression + | binary_expression XOR binary_expression + | binary_expression LAND binary_expression + | binary_expression LOR binary_expression + """ + if len(p) == 2: + p[0] = p[1] + else: + p[0] = c_ast.BinaryOp(p[2], p[1], p[3], p[1].coord) + + def p_cast_expression_1(self, p): + """ cast_expression : unary_expression """ + p[0] = p[1] + + def p_cast_expression_2(self, p): + """ cast_expression : LPAREN type_name RPAREN cast_expression """ + p[0] = c_ast.Cast(p[2], p[4], self._token_coord(p, 1)) + + def p_unary_expression_1(self, p): + """ unary_expression : postfix_expression """ + p[0] = p[1] + + def p_unary_expression_2(self, p): + """ unary_expression : PLUSPLUS unary_expression + | MINUSMINUS unary_expression + | unary_operator cast_expression + """ + p[0] = c_ast.UnaryOp(p[1], p[2], p[2].coord) + + def p_unary_expression_3(self, p): + """ unary_expression : SIZEOF unary_expression + | SIZEOF LPAREN type_name RPAREN + """ + p[0] = c_ast.UnaryOp( + p[1], + p[2] if len(p) == 3 else p[3], + self._token_coord(p, 1)) + + def p_unary_operator(self, p): + """ unary_operator : AND + | TIMES + | PLUS + | MINUS + | NOT + | LNOT + """ + p[0] = p[1] + + def p_postfix_expression_1(self, p): + """ postfix_expression : primary_expression """ + p[0] = p[1] + + def p_postfix_expression_2(self, p): + """ postfix_expression : postfix_expression LBRACKET expression RBRACKET """ + p[0] = c_ast.ArrayRef(p[1], p[3], p[1].coord) + + def p_postfix_expression_3(self, p): + """ postfix_expression : postfix_expression LPAREN argument_expression_list RPAREN + | postfix_expression LPAREN RPAREN + """ + p[0] = c_ast.FuncCall(p[1], p[3] if len(p) == 5 else None, p[1].coord) + + def p_postfix_expression_4(self, p): + """ postfix_expression : postfix_expression PERIOD ID + | postfix_expression PERIOD TYPEID + | postfix_expression ARROW ID + | postfix_expression ARROW TYPEID + """ + field = c_ast.ID(p[3], self._token_coord(p, 3)) + p[0] = c_ast.StructRef(p[1], p[2], field, p[1].coord) + + def p_postfix_expression_5(self, p): + """ postfix_expression : postfix_expression PLUSPLUS + | postfix_expression MINUSMINUS + """ + p[0] = c_ast.UnaryOp('p' + p[2], p[1], p[1].coord) + + def p_postfix_expression_6(self, p): + """ postfix_expression : LPAREN type_name RPAREN brace_open initializer_list brace_close + | LPAREN type_name RPAREN brace_open initializer_list COMMA brace_close + """ + p[0] = c_ast.CompoundLiteral(p[2], p[5]) + + def p_primary_expression_1(self, p): + """ primary_expression : identifier """ + p[0] = p[1] + + def p_primary_expression_2(self, p): + """ primary_expression : constant """ + p[0] = p[1] + + def p_primary_expression_3(self, p): + """ primary_expression : unified_string_literal + | unified_wstring_literal + """ + p[0] = p[1] + + def p_primary_expression_4(self, p): + """ primary_expression : LPAREN expression RPAREN """ + p[0] = p[2] + + def p_primary_expression_5(self, p): + """ primary_expression : OFFSETOF LPAREN type_name COMMA offsetof_member_designator RPAREN + """ + coord = self._token_coord(p, 1) + p[0] = c_ast.FuncCall(c_ast.ID(p[1], coord), + c_ast.ExprList([p[3], p[5]], coord), + coord) + + def p_offsetof_member_designator(self, p): + """ offsetof_member_designator : identifier + | offsetof_member_designator PERIOD identifier + | offsetof_member_designator LBRACKET expression RBRACKET + """ + if len(p) == 2: + p[0] = p[1] + elif len(p) == 4: + field = c_ast.ID(p[3], self._token_coord(p, 3)) + p[0] = c_ast.StructRef(p[1], p[2], field, p[1].coord) + elif len(p) == 5: + p[0] = c_ast.ArrayRef(p[1], p[3], p[1].coord) + else: + raise NotImplementedError("Unexpected parsing state. len(p): %u" % len(p)) + + def p_argument_expression_list(self, p): + """ argument_expression_list : assignment_expression + | argument_expression_list COMMA assignment_expression + """ + if len(p) == 2: # single expr + p[0] = c_ast.ExprList([p[1]], p[1].coord) + else: + p[1].exprs.append(p[3]) + p[0] = p[1] + + def p_identifier(self, p): + """ identifier : ID """ + p[0] = c_ast.ID(p[1], self._token_coord(p, 1)) + + def p_constant_1(self, p): + """ constant : INT_CONST_DEC + | INT_CONST_OCT + | INT_CONST_HEX + | INT_CONST_BIN + """ + p[0] = c_ast.Constant( + 'int', p[1], self._token_coord(p, 1)) + + def p_constant_2(self, p): + """ constant : FLOAT_CONST + | HEX_FLOAT_CONST + """ + if 'x' in p[1].lower(): + t = 'float' + else: + if p[1][-1] in ('f', 'F'): + t = 'float' + elif p[1][-1] in ('l', 'L'): + t = 'long double' + else: + t = 'double' + + p[0] = c_ast.Constant( + t, p[1], self._token_coord(p, 1)) + + def p_constant_3(self, p): + """ constant : CHAR_CONST + | WCHAR_CONST + """ + p[0] = c_ast.Constant( + 'char', p[1], self._token_coord(p, 1)) + + # The "unified" string and wstring literal rules are for supporting + # concatenation of adjacent string literals. + # I.e. "hello " "world" is seen by the C compiler as a single string literal + # with the value "hello world" + # + def p_unified_string_literal(self, p): + """ unified_string_literal : STRING_LITERAL + | unified_string_literal STRING_LITERAL + """ + if len(p) == 2: # single literal + p[0] = c_ast.Constant( + 'string', p[1], self._token_coord(p, 1)) + else: + p[1].value = p[1].value[:-1] + p[2][1:] + p[0] = p[1] + + def p_unified_wstring_literal(self, p): + """ unified_wstring_literal : WSTRING_LITERAL + | unified_wstring_literal WSTRING_LITERAL + """ + if len(p) == 2: # single literal + p[0] = c_ast.Constant( + 'string', p[1], self._token_coord(p, 1)) + else: + p[1].value = p[1].value.rstrip()[:-1] + p[2][2:] + p[0] = p[1] + + def p_brace_open(self, p): + """ brace_open : LBRACE + """ + p[0] = p[1] + p.set_lineno(0, p.lineno(1)) + + def p_brace_close(self, p): + """ brace_close : RBRACE + """ + p[0] = p[1] + p.set_lineno(0, p.lineno(1)) + + def p_empty(self, p): + 'empty : ' + p[0] = None + + def p_error(self, p): + # If error recovery is added here in the future, make sure + # _get_yacc_lookahead_token still works! + # + if p: + self._parse_error( + 'before: %s' % p.value, + self._coord(lineno=p.lineno, + column=self.clex.find_tok_column(p))) + else: + self._parse_error('At end of input', self.clex.filename) diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pycparser/lextab.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pycparser/lextab.py new file mode 100644 index 00000000..eb3ae07d --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pycparser/lextab.py @@ -0,0 +1,10 @@ +# lextab.py. This file automatically created by PLY (version 3.10). Don't edit! +_tabversion = '3.10' +_lextokens = set(('VOID', 'LBRACKET', 'WCHAR_CONST', 'FLOAT_CONST', 'MINUS', 'RPAREN', 'LONG', 'PLUS', 'ELLIPSIS', 'GT', 'GOTO', 'ENUM', 'PERIOD', 'GE', 'INT_CONST_DEC', 'ARROW', '__INT128', 'HEX_FLOAT_CONST', 'DOUBLE', 'MINUSEQUAL', 'INT_CONST_OCT', 'TIMESEQUAL', 'OR', 'SHORT', 'RETURN', 'RSHIFTEQUAL', 'RESTRICT', 'STATIC', 'SIZEOF', 'UNSIGNED', 'UNION', 'COLON', 'WSTRING_LITERAL', 'DIVIDE', 'FOR', 'PLUSPLUS', 'EQUALS', 'ELSE', 'INLINE', 'EQ', 'AND', 'TYPEID', 'LBRACE', 'PPHASH', 'INT', 'SIGNED', 'CONTINUE', 'NOT', 'OREQUAL', 'MOD', 'RSHIFT', 'DEFAULT', 'CHAR', 'WHILE', 'DIVEQUAL', 'EXTERN', 'CASE', 'LAND', 'REGISTER', 'MODEQUAL', 'NE', 'SWITCH', 'INT_CONST_HEX', '_COMPLEX', 'PPPRAGMASTR', 'PLUSEQUAL', 'STRUCT', 'CONDOP', 'BREAK', 'VOLATILE', 'PPPRAGMA', 'ANDEQUAL', 'INT_CONST_BIN', 'DO', 'LNOT', 'CONST', 'LOR', 'CHAR_CONST', 'LSHIFT', 'RBRACE', '_BOOL', 'LE', 'SEMI', 'LT', 'COMMA', 'OFFSETOF', 'TYPEDEF', 'XOR', 'AUTO', 'TIMES', 'LPAREN', 'MINUSMINUS', 'ID', 'IF', 'STRING_LITERAL', 'FLOAT', 'XOREQUAL', 'LSHIFTEQUAL', 'RBRACKET')) +_lexreflags = 64 +_lexliterals = '' +_lexstateinfo = {'ppline': 'exclusive', 'pppragma': 'exclusive', 'INITIAL': 'inclusive'} +_lexstatere = {'ppline': [('(?P"([^"\\\\\\n]|(\\\\(([a-zA-Z._~!=&\\^\\-\\\\?\'"])|(\\d+)|(x[0-9a-fA-F]+))))*")|(?P(0(([uU]ll)|([uU]LL)|(ll[uU]?)|(LL[uU]?)|([uU][lL])|([lL][uU]?)|[uU])?)|([1-9][0-9]*(([uU]ll)|([uU]LL)|(ll[uU]?)|(LL[uU]?)|([uU][lL])|([lL][uU]?)|[uU])?))|(?P\\n)|(?Pline)', [None, ('t_ppline_FILENAME', 'FILENAME'), None, None, None, None, None, None, ('t_ppline_LINE_NUMBER', 'LINE_NUMBER'), None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, ('t_ppline_NEWLINE', 'NEWLINE'), ('t_ppline_PPLINE', 'PPLINE')])], 'pppragma': [('(?P\\n)|(?Ppragma)|(?P.+)', [None, ('t_pppragma_NEWLINE', 'NEWLINE'), ('t_pppragma_PPPRAGMA', 'PPPRAGMA'), ('t_pppragma_STR', 'STR')])], 'INITIAL': [('(?P[ \\t]*\\#)|(?P\\n+)|(?P\\{)|(?P\\})|(?P((((([0-9]*\\.[0-9]+)|([0-9]+\\.))([eE][-+]?[0-9]+)?)|([0-9]+([eE][-+]?[0-9]+)))[FfLl]?))|(?P(0[xX]([0-9a-fA-F]+|((([0-9a-fA-F]+)?\\.[0-9a-fA-F]+)|([0-9a-fA-F]+\\.)))([pP][+-]?[0-9]+)[FfLl]?))|(?P0[xX][0-9a-fA-F]+(([uU]ll)|([uU]LL)|(ll[uU]?)|(LL[uU]?)|([uU][lL])|([lL][uU]?)|[uU])?)', [None, ('t_PPHASH', 'PPHASH'), ('t_NEWLINE', 'NEWLINE'), ('t_LBRACE', 'LBRACE'), ('t_RBRACE', 'RBRACE'), ('t_FLOAT_CONST', 'FLOAT_CONST'), None, None, None, None, None, None, None, None, None, ('t_HEX_FLOAT_CONST', 'HEX_FLOAT_CONST'), None, None, None, None, None, None, None, ('t_INT_CONST_HEX', 'INT_CONST_HEX')]), ('(?P0[bB][01]+(([uU]ll)|([uU]LL)|(ll[uU]?)|(LL[uU]?)|([uU][lL])|([lL][uU]?)|[uU])?)|(?P0[0-7]*[89])|(?P0[0-7]*(([uU]ll)|([uU]LL)|(ll[uU]?)|(LL[uU]?)|([uU][lL])|([lL][uU]?)|[uU])?)|(?P(0(([uU]ll)|([uU]LL)|(ll[uU]?)|(LL[uU]?)|([uU][lL])|([lL][uU]?)|[uU])?)|([1-9][0-9]*(([uU]ll)|([uU]LL)|(ll[uU]?)|(LL[uU]?)|([uU][lL])|([lL][uU]?)|[uU])?))|(?P\'([^\'\\\\\\n]|(\\\\(([a-zA-Z._~!=&\\^\\-\\\\?\'"])|(\\d+)|(x[0-9a-fA-F]+))))\')|(?PL\'([^\'\\\\\\n]|(\\\\(([a-zA-Z._~!=&\\^\\-\\\\?\'"])|(\\d+)|(x[0-9a-fA-F]+))))\')|(?P(\'([^\'\\\\\\n]|(\\\\(([a-zA-Z._~!=&\\^\\-\\\\?\'"])|(\\d+)|(x[0-9a-fA-F]+))))*\\n)|(\'([^\'\\\\\\n]|(\\\\(([a-zA-Z._~!=&\\^\\-\\\\?\'"])|(\\d+)|(x[0-9a-fA-F]+))))*$))|(?P(\'([^\'\\\\\\n]|(\\\\(([a-zA-Z._~!=&\\^\\-\\\\?\'"])|(\\d+)|(x[0-9a-fA-F]+))))[^\'\n]+\')|(\'\')|(\'([\\\\][^a-zA-Z._~^!=&\\^\\-\\\\?\'"x0-7])[^\'\\n]*\'))', [None, ('t_INT_CONST_BIN', 'INT_CONST_BIN'), None, None, None, None, None, None, None, ('t_BAD_CONST_OCT', 'BAD_CONST_OCT'), ('t_INT_CONST_OCT', 'INT_CONST_OCT'), None, None, None, None, None, None, None, ('t_INT_CONST_DEC', 'INT_CONST_DEC'), None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, ('t_CHAR_CONST', 'CHAR_CONST'), None, None, None, None, None, None, ('t_WCHAR_CONST', 'WCHAR_CONST'), None, None, None, None, None, None, ('t_UNMATCHED_QUOTE', 'UNMATCHED_QUOTE'), None, None, None, None, None, None, None, None, None, None, None, None, None, None, ('t_BAD_CHAR_CONST', 'BAD_CHAR_CONST')]), ('(?PL"([^"\\\\\\n]|(\\\\(([a-zA-Z._~!=&\\^\\-\\\\?\'"])|(\\d+)|(x[0-9a-fA-F]+))))*")|(?P"([^"\\\\\\n]|(\\\\(([a-zA-Z._~!=&\\^\\-\\\\?\'"])|(\\d+)|(x[0-9a-fA-F]+))))*?([\\\\][^a-zA-Z._~^!=&\\^\\-\\\\?\'"x0-7])([^"\\\\\\n]|(\\\\(([a-zA-Z._~!=&\\^\\-\\\\?\'"])|(\\d+)|(x[0-9a-fA-F]+))))*")|(?P[a-zA-Z_$][0-9a-zA-Z_$]*)|(?P"([^"\\\\\\n]|(\\\\(([a-zA-Z._~!=&\\^\\-\\\\?\'"])|(\\d+)|(x[0-9a-fA-F]+))))*")|(?P\\.\\.\\.)|(?P\\+\\+)|(?P\\|\\|)|(?P\\^=)|(?P\\|=)|(?P<<=)|(?P>>=)|(?P\\+=)|(?P\\*=)|(?P\\+)|(?P%=)|(?P/=)', [None, ('t_WSTRING_LITERAL', 'WSTRING_LITERAL'), None, None, None, None, None, None, ('t_BAD_STRING_LITERAL', 'BAD_STRING_LITERAL'), None, None, None, None, None, None, None, None, None, None, None, None, None, ('t_ID', 'ID'), (None, 'STRING_LITERAL'), None, None, None, None, None, None, (None, 'ELLIPSIS'), (None, 'PLUSPLUS'), (None, 'LOR'), (None, 'XOREQUAL'), (None, 'OREQUAL'), (None, 'LSHIFTEQUAL'), (None, 'RSHIFTEQUAL'), (None, 'PLUSEQUAL'), (None, 'TIMESEQUAL'), (None, 'PLUS'), (None, 'MODEQUAL'), (None, 'DIVEQUAL')]), ('(?P\\])|(?P\\?)|(?P\\^)|(?P<<)|(?P<=)|(?P\\()|(?P->)|(?P==)|(?P!=)|(?P--)|(?P\\|)|(?P\\*)|(?P\\[)|(?P>=)|(?P\\))|(?P&&)|(?P>>)|(?P-=)|(?P\\.)|(?P&=)|(?P=)|(?P<)|(?P,)|(?P/)|(?P&)|(?P%)|(?P;)|(?P-)|(?P>)|(?P:)|(?P~)|(?P!)', [None, (None, 'RBRACKET'), (None, 'CONDOP'), (None, 'XOR'), (None, 'LSHIFT'), (None, 'LE'), (None, 'LPAREN'), (None, 'ARROW'), (None, 'EQ'), (None, 'NE'), (None, 'MINUSMINUS'), (None, 'OR'), (None, 'TIMES'), (None, 'LBRACKET'), (None, 'GE'), (None, 'RPAREN'), (None, 'LAND'), (None, 'RSHIFT'), (None, 'MINUSEQUAL'), (None, 'PERIOD'), (None, 'ANDEQUAL'), (None, 'EQUALS'), (None, 'LT'), (None, 'COMMA'), (None, 'DIVIDE'), (None, 'AND'), (None, 'MOD'), (None, 'SEMI'), (None, 'MINUS'), (None, 'GT'), (None, 'COLON'), (None, 'NOT'), (None, 'LNOT')])]} +_lexstateignore = {'ppline': ' \t', 'pppragma': ' \t', 'INITIAL': ' \t'} +_lexstateerrorf = {'ppline': 't_ppline_error', 'pppragma': 't_pppragma_error', 'INITIAL': 't_error'} +_lexstateeoff = {} diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pycparser/ply/__init__.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pycparser/ply/__init__.py new file mode 100644 index 00000000..6e53cddc --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pycparser/ply/__init__.py @@ -0,0 +1,5 @@ +# PLY package +# Author: David Beazley (dave@dabeaz.com) + +__version__ = '3.9' +__all__ = ['lex','yacc'] diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pycparser/ply/cpp.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pycparser/ply/cpp.py new file mode 100644 index 00000000..86273eac --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pycparser/ply/cpp.py @@ -0,0 +1,905 @@ +# ----------------------------------------------------------------------------- +# cpp.py +# +# Author: David Beazley (http://www.dabeaz.com) +# Copyright (C) 2017 +# All rights reserved +# +# This module implements an ANSI-C style lexical preprocessor for PLY. +# ----------------------------------------------------------------------------- +import sys + +# Some Python 3 compatibility shims +if sys.version_info.major < 3: + STRING_TYPES = (str, unicode) +else: + STRING_TYPES = str + xrange = range + +# ----------------------------------------------------------------------------- +# Default preprocessor lexer definitions. These tokens are enough to get +# a basic preprocessor working. Other modules may import these if they want +# ----------------------------------------------------------------------------- + +tokens = ( + 'CPP_ID','CPP_INTEGER', 'CPP_FLOAT', 'CPP_STRING', 'CPP_CHAR', 'CPP_WS', 'CPP_COMMENT1', 'CPP_COMMENT2', 'CPP_POUND','CPP_DPOUND' +) + +literals = "+-*/%|&~^<>=!?()[]{}.,;:\\\'\"" + +# Whitespace +def t_CPP_WS(t): + r'\s+' + t.lexer.lineno += t.value.count("\n") + return t + +t_CPP_POUND = r'\#' +t_CPP_DPOUND = r'\#\#' + +# Identifier +t_CPP_ID = r'[A-Za-z_][\w_]*' + +# Integer literal +def CPP_INTEGER(t): + r'(((((0x)|(0X))[0-9a-fA-F]+)|(\d+))([uU][lL]|[lL][uU]|[uU]|[lL])?)' + return t + +t_CPP_INTEGER = CPP_INTEGER + +# Floating literal +t_CPP_FLOAT = r'((\d+)(\.\d+)(e(\+|-)?(\d+))? | (\d+)e(\+|-)?(\d+))([lL]|[fF])?' + +# String literal +def t_CPP_STRING(t): + r'\"([^\\\n]|(\\(.|\n)))*?\"' + t.lexer.lineno += t.value.count("\n") + return t + +# Character constant 'c' or L'c' +def t_CPP_CHAR(t): + r'(L)?\'([^\\\n]|(\\(.|\n)))*?\'' + t.lexer.lineno += t.value.count("\n") + return t + +# Comment +def t_CPP_COMMENT1(t): + r'(/\*(.|\n)*?\*/)' + ncr = t.value.count("\n") + t.lexer.lineno += ncr + # replace with one space or a number of '\n' + t.type = 'CPP_WS'; t.value = '\n' * ncr if ncr else ' ' + return t + +# Line comment +def t_CPP_COMMENT2(t): + r'(//.*?(\n|$))' + # replace with '/n' + t.type = 'CPP_WS'; t.value = '\n' + return t + +def t_error(t): + t.type = t.value[0] + t.value = t.value[0] + t.lexer.skip(1) + return t + +import re +import copy +import time +import os.path + +# ----------------------------------------------------------------------------- +# trigraph() +# +# Given an input string, this function replaces all trigraph sequences. +# The following mapping is used: +# +# ??= # +# ??/ \ +# ??' ^ +# ??( [ +# ??) ] +# ??! | +# ??< { +# ??> } +# ??- ~ +# ----------------------------------------------------------------------------- + +_trigraph_pat = re.compile(r'''\?\?[=/\'\(\)\!<>\-]''') +_trigraph_rep = { + '=':'#', + '/':'\\', + "'":'^', + '(':'[', + ')':']', + '!':'|', + '<':'{', + '>':'}', + '-':'~' +} + +def trigraph(input): + return _trigraph_pat.sub(lambda g: _trigraph_rep[g.group()[-1]],input) + +# ------------------------------------------------------------------ +# Macro object +# +# This object holds information about preprocessor macros +# +# .name - Macro name (string) +# .value - Macro value (a list of tokens) +# .arglist - List of argument names +# .variadic - Boolean indicating whether or not variadic macro +# .vararg - Name of the variadic parameter +# +# When a macro is created, the macro replacement token sequence is +# pre-scanned and used to create patch lists that are later used +# during macro expansion +# ------------------------------------------------------------------ + +class Macro(object): + def __init__(self,name,value,arglist=None,variadic=False): + self.name = name + self.value = value + self.arglist = arglist + self.variadic = variadic + if variadic: + self.vararg = arglist[-1] + self.source = None + +# ------------------------------------------------------------------ +# Preprocessor object +# +# Object representing a preprocessor. Contains macro definitions, +# include directories, and other information +# ------------------------------------------------------------------ + +class Preprocessor(object): + def __init__(self,lexer=None): + if lexer is None: + lexer = lex.lexer + self.lexer = lexer + self.macros = { } + self.path = [] + self.temp_path = [] + + # Probe the lexer for selected tokens + self.lexprobe() + + tm = time.localtime() + self.define("__DATE__ \"%s\"" % time.strftime("%b %d %Y",tm)) + self.define("__TIME__ \"%s\"" % time.strftime("%H:%M:%S",tm)) + self.parser = None + + # ----------------------------------------------------------------------------- + # tokenize() + # + # Utility function. Given a string of text, tokenize into a list of tokens + # ----------------------------------------------------------------------------- + + def tokenize(self,text): + tokens = [] + self.lexer.input(text) + while True: + tok = self.lexer.token() + if not tok: break + tokens.append(tok) + return tokens + + # --------------------------------------------------------------------- + # error() + # + # Report a preprocessor error/warning of some kind + # ---------------------------------------------------------------------- + + def error(self,file,line,msg): + print("%s:%d %s" % (file,line,msg)) + + # ---------------------------------------------------------------------- + # lexprobe() + # + # This method probes the preprocessor lexer object to discover + # the token types of symbols that are important to the preprocessor. + # If this works right, the preprocessor will simply "work" + # with any suitable lexer regardless of how tokens have been named. + # ---------------------------------------------------------------------- + + def lexprobe(self): + + # Determine the token type for identifiers + self.lexer.input("identifier") + tok = self.lexer.token() + if not tok or tok.value != "identifier": + print("Couldn't determine identifier type") + else: + self.t_ID = tok.type + + # Determine the token type for integers + self.lexer.input("12345") + tok = self.lexer.token() + if not tok or int(tok.value) != 12345: + print("Couldn't determine integer type") + else: + self.t_INTEGER = tok.type + self.t_INTEGER_TYPE = type(tok.value) + + # Determine the token type for strings enclosed in double quotes + self.lexer.input("\"filename\"") + tok = self.lexer.token() + if not tok or tok.value != "\"filename\"": + print("Couldn't determine string type") + else: + self.t_STRING = tok.type + + # Determine the token type for whitespace--if any + self.lexer.input(" ") + tok = self.lexer.token() + if not tok or tok.value != " ": + self.t_SPACE = None + else: + self.t_SPACE = tok.type + + # Determine the token type for newlines + self.lexer.input("\n") + tok = self.lexer.token() + if not tok or tok.value != "\n": + self.t_NEWLINE = None + print("Couldn't determine token for newlines") + else: + self.t_NEWLINE = tok.type + + self.t_WS = (self.t_SPACE, self.t_NEWLINE) + + # Check for other characters used by the preprocessor + chars = [ '<','>','#','##','\\','(',')',',','.'] + for c in chars: + self.lexer.input(c) + tok = self.lexer.token() + if not tok or tok.value != c: + print("Unable to lex '%s' required for preprocessor" % c) + + # ---------------------------------------------------------------------- + # add_path() + # + # Adds a search path to the preprocessor. + # ---------------------------------------------------------------------- + + def add_path(self,path): + self.path.append(path) + + # ---------------------------------------------------------------------- + # group_lines() + # + # Given an input string, this function splits it into lines. Trailing whitespace + # is removed. Any line ending with \ is grouped with the next line. This + # function forms the lowest level of the preprocessor---grouping into text into + # a line-by-line format. + # ---------------------------------------------------------------------- + + def group_lines(self,input): + lex = self.lexer.clone() + lines = [x.rstrip() for x in input.splitlines()] + for i in xrange(len(lines)): + j = i+1 + while lines[i].endswith('\\') and (j < len(lines)): + lines[i] = lines[i][:-1]+lines[j] + lines[j] = "" + j += 1 + + input = "\n".join(lines) + lex.input(input) + lex.lineno = 1 + + current_line = [] + while True: + tok = lex.token() + if not tok: + break + current_line.append(tok) + if tok.type in self.t_WS and '\n' in tok.value: + yield current_line + current_line = [] + + if current_line: + yield current_line + + # ---------------------------------------------------------------------- + # tokenstrip() + # + # Remove leading/trailing whitespace tokens from a token list + # ---------------------------------------------------------------------- + + def tokenstrip(self,tokens): + i = 0 + while i < len(tokens) and tokens[i].type in self.t_WS: + i += 1 + del tokens[:i] + i = len(tokens)-1 + while i >= 0 and tokens[i].type in self.t_WS: + i -= 1 + del tokens[i+1:] + return tokens + + + # ---------------------------------------------------------------------- + # collect_args() + # + # Collects comma separated arguments from a list of tokens. The arguments + # must be enclosed in parenthesis. Returns a tuple (tokencount,args,positions) + # where tokencount is the number of tokens consumed, args is a list of arguments, + # and positions is a list of integers containing the starting index of each + # argument. Each argument is represented by a list of tokens. + # + # When collecting arguments, leading and trailing whitespace is removed + # from each argument. + # + # This function properly handles nested parenthesis and commas---these do not + # define new arguments. + # ---------------------------------------------------------------------- + + def collect_args(self,tokenlist): + args = [] + positions = [] + current_arg = [] + nesting = 1 + tokenlen = len(tokenlist) + + # Search for the opening '('. + i = 0 + while (i < tokenlen) and (tokenlist[i].type in self.t_WS): + i += 1 + + if (i < tokenlen) and (tokenlist[i].value == '('): + positions.append(i+1) + else: + self.error(self.source,tokenlist[0].lineno,"Missing '(' in macro arguments") + return 0, [], [] + + i += 1 + + while i < tokenlen: + t = tokenlist[i] + if t.value == '(': + current_arg.append(t) + nesting += 1 + elif t.value == ')': + nesting -= 1 + if nesting == 0: + if current_arg: + args.append(self.tokenstrip(current_arg)) + positions.append(i) + return i+1,args,positions + current_arg.append(t) + elif t.value == ',' and nesting == 1: + args.append(self.tokenstrip(current_arg)) + positions.append(i+1) + current_arg = [] + else: + current_arg.append(t) + i += 1 + + # Missing end argument + self.error(self.source,tokenlist[-1].lineno,"Missing ')' in macro arguments") + return 0, [],[] + + # ---------------------------------------------------------------------- + # macro_prescan() + # + # Examine the macro value (token sequence) and identify patch points + # This is used to speed up macro expansion later on---we'll know + # right away where to apply patches to the value to form the expansion + # ---------------------------------------------------------------------- + + def macro_prescan(self,macro): + macro.patch = [] # Standard macro arguments + macro.str_patch = [] # String conversion expansion + macro.var_comma_patch = [] # Variadic macro comma patch + i = 0 + while i < len(macro.value): + if macro.value[i].type == self.t_ID and macro.value[i].value in macro.arglist: + argnum = macro.arglist.index(macro.value[i].value) + # Conversion of argument to a string + if i > 0 and macro.value[i-1].value == '#': + macro.value[i] = copy.copy(macro.value[i]) + macro.value[i].type = self.t_STRING + del macro.value[i-1] + macro.str_patch.append((argnum,i-1)) + continue + # Concatenation + elif (i > 0 and macro.value[i-1].value == '##'): + macro.patch.append(('c',argnum,i-1)) + del macro.value[i-1] + continue + elif ((i+1) < len(macro.value) and macro.value[i+1].value == '##'): + macro.patch.append(('c',argnum,i)) + i += 1 + continue + # Standard expansion + else: + macro.patch.append(('e',argnum,i)) + elif macro.value[i].value == '##': + if macro.variadic and (i > 0) and (macro.value[i-1].value == ',') and \ + ((i+1) < len(macro.value)) and (macro.value[i+1].type == self.t_ID) and \ + (macro.value[i+1].value == macro.vararg): + macro.var_comma_patch.append(i-1) + i += 1 + macro.patch.sort(key=lambda x: x[2],reverse=True) + + # ---------------------------------------------------------------------- + # macro_expand_args() + # + # Given a Macro and list of arguments (each a token list), this method + # returns an expanded version of a macro. The return value is a token sequence + # representing the replacement macro tokens + # ---------------------------------------------------------------------- + + def macro_expand_args(self,macro,args): + # Make a copy of the macro token sequence + rep = [copy.copy(_x) for _x in macro.value] + + # Make string expansion patches. These do not alter the length of the replacement sequence + + str_expansion = {} + for argnum, i in macro.str_patch: + if argnum not in str_expansion: + str_expansion[argnum] = ('"%s"' % "".join([x.value for x in args[argnum]])).replace("\\","\\\\") + rep[i] = copy.copy(rep[i]) + rep[i].value = str_expansion[argnum] + + # Make the variadic macro comma patch. If the variadic macro argument is empty, we get rid + comma_patch = False + if macro.variadic and not args[-1]: + for i in macro.var_comma_patch: + rep[i] = None + comma_patch = True + + # Make all other patches. The order of these matters. It is assumed that the patch list + # has been sorted in reverse order of patch location since replacements will cause the + # size of the replacement sequence to expand from the patch point. + + expanded = { } + for ptype, argnum, i in macro.patch: + # Concatenation. Argument is left unexpanded + if ptype == 'c': + rep[i:i+1] = args[argnum] + # Normal expansion. Argument is macro expanded first + elif ptype == 'e': + if argnum not in expanded: + expanded[argnum] = self.expand_macros(args[argnum]) + rep[i:i+1] = expanded[argnum] + + # Get rid of removed comma if necessary + if comma_patch: + rep = [_i for _i in rep if _i] + + return rep + + + # ---------------------------------------------------------------------- + # expand_macros() + # + # Given a list of tokens, this function performs macro expansion. + # The expanded argument is a dictionary that contains macros already + # expanded. This is used to prevent infinite recursion. + # ---------------------------------------------------------------------- + + def expand_macros(self,tokens,expanded=None): + if expanded is None: + expanded = {} + i = 0 + while i < len(tokens): + t = tokens[i] + if t.type == self.t_ID: + if t.value in self.macros and t.value not in expanded: + # Yes, we found a macro match + expanded[t.value] = True + + m = self.macros[t.value] + if not m.arglist: + # A simple macro + ex = self.expand_macros([copy.copy(_x) for _x in m.value],expanded) + for e in ex: + e.lineno = t.lineno + tokens[i:i+1] = ex + i += len(ex) + else: + # A macro with arguments + j = i + 1 + while j < len(tokens) and tokens[j].type in self.t_WS: + j += 1 + if tokens[j].value == '(': + tokcount,args,positions = self.collect_args(tokens[j:]) + if not m.variadic and len(args) != len(m.arglist): + self.error(self.source,t.lineno,"Macro %s requires %d arguments" % (t.value,len(m.arglist))) + i = j + tokcount + elif m.variadic and len(args) < len(m.arglist)-1: + if len(m.arglist) > 2: + self.error(self.source,t.lineno,"Macro %s must have at least %d arguments" % (t.value, len(m.arglist)-1)) + else: + self.error(self.source,t.lineno,"Macro %s must have at least %d argument" % (t.value, len(m.arglist)-1)) + i = j + tokcount + else: + if m.variadic: + if len(args) == len(m.arglist)-1: + args.append([]) + else: + args[len(m.arglist)-1] = tokens[j+positions[len(m.arglist)-1]:j+tokcount-1] + del args[len(m.arglist):] + + # Get macro replacement text + rep = self.macro_expand_args(m,args) + rep = self.expand_macros(rep,expanded) + for r in rep: + r.lineno = t.lineno + tokens[i:j+tokcount] = rep + i += len(rep) + del expanded[t.value] + continue + elif t.value == '__LINE__': + t.type = self.t_INTEGER + t.value = self.t_INTEGER_TYPE(t.lineno) + + i += 1 + return tokens + + # ---------------------------------------------------------------------- + # evalexpr() + # + # Evaluate an expression token sequence for the purposes of evaluating + # integral expressions. + # ---------------------------------------------------------------------- + + def evalexpr(self,tokens): + # tokens = tokenize(line) + # Search for defined macros + i = 0 + while i < len(tokens): + if tokens[i].type == self.t_ID and tokens[i].value == 'defined': + j = i + 1 + needparen = False + result = "0L" + while j < len(tokens): + if tokens[j].type in self.t_WS: + j += 1 + continue + elif tokens[j].type == self.t_ID: + if tokens[j].value in self.macros: + result = "1L" + else: + result = "0L" + if not needparen: break + elif tokens[j].value == '(': + needparen = True + elif tokens[j].value == ')': + break + else: + self.error(self.source,tokens[i].lineno,"Malformed defined()") + j += 1 + tokens[i].type = self.t_INTEGER + tokens[i].value = self.t_INTEGER_TYPE(result) + del tokens[i+1:j+1] + i += 1 + tokens = self.expand_macros(tokens) + for i,t in enumerate(tokens): + if t.type == self.t_ID: + tokens[i] = copy.copy(t) + tokens[i].type = self.t_INTEGER + tokens[i].value = self.t_INTEGER_TYPE("0L") + elif t.type == self.t_INTEGER: + tokens[i] = copy.copy(t) + # Strip off any trailing suffixes + tokens[i].value = str(tokens[i].value) + while tokens[i].value[-1] not in "0123456789abcdefABCDEF": + tokens[i].value = tokens[i].value[:-1] + + expr = "".join([str(x.value) for x in tokens]) + expr = expr.replace("&&"," and ") + expr = expr.replace("||"," or ") + expr = expr.replace("!"," not ") + try: + result = eval(expr) + except Exception: + self.error(self.source,tokens[0].lineno,"Couldn't evaluate expression") + result = 0 + return result + + # ---------------------------------------------------------------------- + # parsegen() + # + # Parse an input string/ + # ---------------------------------------------------------------------- + def parsegen(self,input,source=None): + + # Replace trigraph sequences + t = trigraph(input) + lines = self.group_lines(t) + + if not source: + source = "" + + self.define("__FILE__ \"%s\"" % source) + + self.source = source + chunk = [] + enable = True + iftrigger = False + ifstack = [] + + for x in lines: + for i,tok in enumerate(x): + if tok.type not in self.t_WS: break + if tok.value == '#': + # Preprocessor directive + + # insert necessary whitespace instead of eaten tokens + for tok in x: + if tok.type in self.t_WS and '\n' in tok.value: + chunk.append(tok) + + dirtokens = self.tokenstrip(x[i+1:]) + if dirtokens: + name = dirtokens[0].value + args = self.tokenstrip(dirtokens[1:]) + else: + name = "" + args = [] + + if name == 'define': + if enable: + for tok in self.expand_macros(chunk): + yield tok + chunk = [] + self.define(args) + elif name == 'include': + if enable: + for tok in self.expand_macros(chunk): + yield tok + chunk = [] + oldfile = self.macros['__FILE__'] + for tok in self.include(args): + yield tok + self.macros['__FILE__'] = oldfile + self.source = source + elif name == 'undef': + if enable: + for tok in self.expand_macros(chunk): + yield tok + chunk = [] + self.undef(args) + elif name == 'ifdef': + ifstack.append((enable,iftrigger)) + if enable: + if not args[0].value in self.macros: + enable = False + iftrigger = False + else: + iftrigger = True + elif name == 'ifndef': + ifstack.append((enable,iftrigger)) + if enable: + if args[0].value in self.macros: + enable = False + iftrigger = False + else: + iftrigger = True + elif name == 'if': + ifstack.append((enable,iftrigger)) + if enable: + result = self.evalexpr(args) + if not result: + enable = False + iftrigger = False + else: + iftrigger = True + elif name == 'elif': + if ifstack: + if ifstack[-1][0]: # We only pay attention if outer "if" allows this + if enable: # If already true, we flip enable False + enable = False + elif not iftrigger: # If False, but not triggered yet, we'll check expression + result = self.evalexpr(args) + if result: + enable = True + iftrigger = True + else: + self.error(self.source,dirtokens[0].lineno,"Misplaced #elif") + + elif name == 'else': + if ifstack: + if ifstack[-1][0]: + if enable: + enable = False + elif not iftrigger: + enable = True + iftrigger = True + else: + self.error(self.source,dirtokens[0].lineno,"Misplaced #else") + + elif name == 'endif': + if ifstack: + enable,iftrigger = ifstack.pop() + else: + self.error(self.source,dirtokens[0].lineno,"Misplaced #endif") + else: + # Unknown preprocessor directive + pass + + else: + # Normal text + if enable: + chunk.extend(x) + + for tok in self.expand_macros(chunk): + yield tok + chunk = [] + + # ---------------------------------------------------------------------- + # include() + # + # Implementation of file-inclusion + # ---------------------------------------------------------------------- + + def include(self,tokens): + # Try to extract the filename and then process an include file + if not tokens: + return + if tokens: + if tokens[0].value != '<' and tokens[0].type != self.t_STRING: + tokens = self.expand_macros(tokens) + + if tokens[0].value == '<': + # Include <...> + i = 1 + while i < len(tokens): + if tokens[i].value == '>': + break + i += 1 + else: + print("Malformed #include <...>") + return + filename = "".join([x.value for x in tokens[1:i]]) + path = self.path + [""] + self.temp_path + elif tokens[0].type == self.t_STRING: + filename = tokens[0].value[1:-1] + path = self.temp_path + [""] + self.path + else: + print("Malformed #include statement") + return + for p in path: + iname = os.path.join(p,filename) + try: + data = open(iname,"r").read() + dname = os.path.dirname(iname) + if dname: + self.temp_path.insert(0,dname) + for tok in self.parsegen(data,filename): + yield tok + if dname: + del self.temp_path[0] + break + except IOError: + pass + else: + print("Couldn't find '%s'" % filename) + + # ---------------------------------------------------------------------- + # define() + # + # Define a new macro + # ---------------------------------------------------------------------- + + def define(self,tokens): + if isinstance(tokens,STRING_TYPES): + tokens = self.tokenize(tokens) + + linetok = tokens + try: + name = linetok[0] + if len(linetok) > 1: + mtype = linetok[1] + else: + mtype = None + if not mtype: + m = Macro(name.value,[]) + self.macros[name.value] = m + elif mtype.type in self.t_WS: + # A normal macro + m = Macro(name.value,self.tokenstrip(linetok[2:])) + self.macros[name.value] = m + elif mtype.value == '(': + # A macro with arguments + tokcount, args, positions = self.collect_args(linetok[1:]) + variadic = False + for a in args: + if variadic: + print("No more arguments may follow a variadic argument") + break + astr = "".join([str(_i.value) for _i in a]) + if astr == "...": + variadic = True + a[0].type = self.t_ID + a[0].value = '__VA_ARGS__' + variadic = True + del a[1:] + continue + elif astr[-3:] == "..." and a[0].type == self.t_ID: + variadic = True + del a[1:] + # If, for some reason, "." is part of the identifier, strip off the name for the purposes + # of macro expansion + if a[0].value[-3:] == '...': + a[0].value = a[0].value[:-3] + continue + if len(a) > 1 or a[0].type != self.t_ID: + print("Invalid macro argument") + break + else: + mvalue = self.tokenstrip(linetok[1+tokcount:]) + i = 0 + while i < len(mvalue): + if i+1 < len(mvalue): + if mvalue[i].type in self.t_WS and mvalue[i+1].value == '##': + del mvalue[i] + continue + elif mvalue[i].value == '##' and mvalue[i+1].type in self.t_WS: + del mvalue[i+1] + i += 1 + m = Macro(name.value,mvalue,[x[0].value for x in args],variadic) + self.macro_prescan(m) + self.macros[name.value] = m + else: + print("Bad macro definition") + except LookupError: + print("Bad macro definition") + + # ---------------------------------------------------------------------- + # undef() + # + # Undefine a macro + # ---------------------------------------------------------------------- + + def undef(self,tokens): + id = tokens[0].value + try: + del self.macros[id] + except LookupError: + pass + + # ---------------------------------------------------------------------- + # parse() + # + # Parse input text. + # ---------------------------------------------------------------------- + def parse(self,input,source=None,ignore={}): + self.ignore = ignore + self.parser = self.parsegen(input,source) + + # ---------------------------------------------------------------------- + # token() + # + # Method to return individual tokens + # ---------------------------------------------------------------------- + def token(self): + try: + while True: + tok = next(self.parser) + if tok.type not in self.ignore: return tok + except StopIteration: + self.parser = None + return None + +if __name__ == '__main__': + import ply.lex as lex + lexer = lex.lex() + + # Run a preprocessor + import sys + f = open(sys.argv[1]) + input = f.read() + + p = Preprocessor(lexer) + p.parse(input,sys.argv[1]) + while True: + tok = p.token() + if not tok: break + print(p.source, tok) diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pycparser/ply/ctokens.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pycparser/ply/ctokens.py new file mode 100644 index 00000000..f6f6952d --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pycparser/ply/ctokens.py @@ -0,0 +1,133 @@ +# ---------------------------------------------------------------------- +# ctokens.py +# +# Token specifications for symbols in ANSI C and C++. This file is +# meant to be used as a library in other tokenizers. +# ---------------------------------------------------------------------- + +# Reserved words + +tokens = [ + # Literals (identifier, integer constant, float constant, string constant, char const) + 'ID', 'TYPEID', 'INTEGER', 'FLOAT', 'STRING', 'CHARACTER', + + # Operators (+,-,*,/,%,|,&,~,^,<<,>>, ||, &&, !, <, <=, >, >=, ==, !=) + 'PLUS', 'MINUS', 'TIMES', 'DIVIDE', 'MODULO', + 'OR', 'AND', 'NOT', 'XOR', 'LSHIFT', 'RSHIFT', + 'LOR', 'LAND', 'LNOT', + 'LT', 'LE', 'GT', 'GE', 'EQ', 'NE', + + # Assignment (=, *=, /=, %=, +=, -=, <<=, >>=, &=, ^=, |=) + 'EQUALS', 'TIMESEQUAL', 'DIVEQUAL', 'MODEQUAL', 'PLUSEQUAL', 'MINUSEQUAL', + 'LSHIFTEQUAL','RSHIFTEQUAL', 'ANDEQUAL', 'XOREQUAL', 'OREQUAL', + + # Increment/decrement (++,--) + 'INCREMENT', 'DECREMENT', + + # Structure dereference (->) + 'ARROW', + + # Ternary operator (?) + 'TERNARY', + + # Delimeters ( ) [ ] { } , . ; : + 'LPAREN', 'RPAREN', + 'LBRACKET', 'RBRACKET', + 'LBRACE', 'RBRACE', + 'COMMA', 'PERIOD', 'SEMI', 'COLON', + + # Ellipsis (...) + 'ELLIPSIS', +] + +# Operators +t_PLUS = r'\+' +t_MINUS = r'-' +t_TIMES = r'\*' +t_DIVIDE = r'/' +t_MODULO = r'%' +t_OR = r'\|' +t_AND = r'&' +t_NOT = r'~' +t_XOR = r'\^' +t_LSHIFT = r'<<' +t_RSHIFT = r'>>' +t_LOR = r'\|\|' +t_LAND = r'&&' +t_LNOT = r'!' +t_LT = r'<' +t_GT = r'>' +t_LE = r'<=' +t_GE = r'>=' +t_EQ = r'==' +t_NE = r'!=' + +# Assignment operators + +t_EQUALS = r'=' +t_TIMESEQUAL = r'\*=' +t_DIVEQUAL = r'/=' +t_MODEQUAL = r'%=' +t_PLUSEQUAL = r'\+=' +t_MINUSEQUAL = r'-=' +t_LSHIFTEQUAL = r'<<=' +t_RSHIFTEQUAL = r'>>=' +t_ANDEQUAL = r'&=' +t_OREQUAL = r'\|=' +t_XOREQUAL = r'\^=' + +# Increment/decrement +t_INCREMENT = r'\+\+' +t_DECREMENT = r'--' + +# -> +t_ARROW = r'->' + +# ? +t_TERNARY = r'\?' + +# Delimeters +t_LPAREN = r'\(' +t_RPAREN = r'\)' +t_LBRACKET = r'\[' +t_RBRACKET = r'\]' +t_LBRACE = r'\{' +t_RBRACE = r'\}' +t_COMMA = r',' +t_PERIOD = r'\.' +t_SEMI = r';' +t_COLON = r':' +t_ELLIPSIS = r'\.\.\.' + +# Identifiers +t_ID = r'[A-Za-z_][A-Za-z0-9_]*' + +# Integer literal +t_INTEGER = r'\d+([uU]|[lL]|[uU][lL]|[lL][uU])?' + +# Floating literal +t_FLOAT = r'((\d+)(\.\d+)(e(\+|-)?(\d+))? | (\d+)e(\+|-)?(\d+))([lL]|[fF])?' + +# String literal +t_STRING = r'\"([^\\\n]|(\\.))*?\"' + +# Character constant 'c' or L'c' +t_CHARACTER = r'(L)?\'([^\\\n]|(\\.))*?\'' + +# Comment (C-Style) +def t_COMMENT(t): + r'/\*(.|\n)*?\*/' + t.lexer.lineno += t.value.count('\n') + return t + +# Comment (C++-Style) +def t_CPPCOMMENT(t): + r'//.*\n' + t.lexer.lineno += 1 + return t + + + + + + diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pycparser/ply/lex.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pycparser/ply/lex.py new file mode 100644 index 00000000..4bdd76ca --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pycparser/ply/lex.py @@ -0,0 +1,1099 @@ +# ----------------------------------------------------------------------------- +# ply: lex.py +# +# Copyright (C) 2001-2017 +# David M. Beazley (Dabeaz LLC) +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# +# * Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of the David Beazley or Dabeaz LLC may be used to +# endorse or promote products derived from this software without +# specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# ----------------------------------------------------------------------------- + +__version__ = '3.10' +__tabversion__ = '3.10' + +import re +import sys +import types +import copy +import os +import inspect + +# This tuple contains known string types +try: + # Python 2.6 + StringTypes = (types.StringType, types.UnicodeType) +except AttributeError: + # Python 3.0 + StringTypes = (str, bytes) + +# This regular expression is used to match valid token names +_is_identifier = re.compile(r'^[a-zA-Z0-9_]+$') + +# Exception thrown when invalid token encountered and no default error +# handler is defined. +class LexError(Exception): + def __init__(self, message, s): + self.args = (message,) + self.text = s + + +# Token class. This class is used to represent the tokens produced. +class LexToken(object): + def __str__(self): + return 'LexToken(%s,%r,%d,%d)' % (self.type, self.value, self.lineno, self.lexpos) + + def __repr__(self): + return str(self) + + +# This object is a stand-in for a logging object created by the +# logging module. + +class PlyLogger(object): + def __init__(self, f): + self.f = f + + def critical(self, msg, *args, **kwargs): + self.f.write((msg % args) + '\n') + + def warning(self, msg, *args, **kwargs): + self.f.write('WARNING: ' + (msg % args) + '\n') + + def error(self, msg, *args, **kwargs): + self.f.write('ERROR: ' + (msg % args) + '\n') + + info = critical + debug = critical + + +# Null logger is used when no output is generated. Does nothing. +class NullLogger(object): + def __getattribute__(self, name): + return self + + def __call__(self, *args, **kwargs): + return self + + +# ----------------------------------------------------------------------------- +# === Lexing Engine === +# +# The following Lexer class implements the lexer runtime. There are only +# a few public methods and attributes: +# +# input() - Store a new string in the lexer +# token() - Get the next token +# clone() - Clone the lexer +# +# lineno - Current line number +# lexpos - Current position in the input string +# ----------------------------------------------------------------------------- + +class Lexer: + def __init__(self): + self.lexre = None # Master regular expression. This is a list of + # tuples (re, findex) where re is a compiled + # regular expression and findex is a list + # mapping regex group numbers to rules + self.lexretext = None # Current regular expression strings + self.lexstatere = {} # Dictionary mapping lexer states to master regexs + self.lexstateretext = {} # Dictionary mapping lexer states to regex strings + self.lexstaterenames = {} # Dictionary mapping lexer states to symbol names + self.lexstate = 'INITIAL' # Current lexer state + self.lexstatestack = [] # Stack of lexer states + self.lexstateinfo = None # State information + self.lexstateignore = {} # Dictionary of ignored characters for each state + self.lexstateerrorf = {} # Dictionary of error functions for each state + self.lexstateeoff = {} # Dictionary of eof functions for each state + self.lexreflags = 0 # Optional re compile flags + self.lexdata = None # Actual input data (as a string) + self.lexpos = 0 # Current position in input text + self.lexlen = 0 # Length of the input text + self.lexerrorf = None # Error rule (if any) + self.lexeoff = None # EOF rule (if any) + self.lextokens = None # List of valid tokens + self.lexignore = '' # Ignored characters + self.lexliterals = '' # Literal characters that can be passed through + self.lexmodule = None # Module + self.lineno = 1 # Current line number + self.lexoptimize = False # Optimized mode + + def clone(self, object=None): + c = copy.copy(self) + + # If the object parameter has been supplied, it means we are attaching the + # lexer to a new object. In this case, we have to rebind all methods in + # the lexstatere and lexstateerrorf tables. + + if object: + newtab = {} + for key, ritem in self.lexstatere.items(): + newre = [] + for cre, findex in ritem: + newfindex = [] + for f in findex: + if not f or not f[0]: + newfindex.append(f) + continue + newfindex.append((getattr(object, f[0].__name__), f[1])) + newre.append((cre, newfindex)) + newtab[key] = newre + c.lexstatere = newtab + c.lexstateerrorf = {} + for key, ef in self.lexstateerrorf.items(): + c.lexstateerrorf[key] = getattr(object, ef.__name__) + c.lexmodule = object + return c + + # ------------------------------------------------------------ + # writetab() - Write lexer information to a table file + # ------------------------------------------------------------ + def writetab(self, lextab, outputdir=''): + if isinstance(lextab, types.ModuleType): + raise IOError("Won't overwrite existing lextab module") + basetabmodule = lextab.split('.')[-1] + filename = os.path.join(outputdir, basetabmodule) + '.py' + with open(filename, 'w') as tf: + tf.write('# %s.py. This file automatically created by PLY (version %s). Don\'t edit!\n' % (basetabmodule, __version__)) + tf.write('_tabversion = %s\n' % repr(__tabversion__)) + tf.write('_lextokens = set(%s)\n' % repr(tuple(self.lextokens))) + tf.write('_lexreflags = %s\n' % repr(self.lexreflags)) + tf.write('_lexliterals = %s\n' % repr(self.lexliterals)) + tf.write('_lexstateinfo = %s\n' % repr(self.lexstateinfo)) + + # Rewrite the lexstatere table, replacing function objects with function names + tabre = {} + for statename, lre in self.lexstatere.items(): + titem = [] + for (pat, func), retext, renames in zip(lre, self.lexstateretext[statename], self.lexstaterenames[statename]): + titem.append((retext, _funcs_to_names(func, renames))) + tabre[statename] = titem + + tf.write('_lexstatere = %s\n' % repr(tabre)) + tf.write('_lexstateignore = %s\n' % repr(self.lexstateignore)) + + taberr = {} + for statename, ef in self.lexstateerrorf.items(): + taberr[statename] = ef.__name__ if ef else None + tf.write('_lexstateerrorf = %s\n' % repr(taberr)) + + tabeof = {} + for statename, ef in self.lexstateeoff.items(): + tabeof[statename] = ef.__name__ if ef else None + tf.write('_lexstateeoff = %s\n' % repr(tabeof)) + + # ------------------------------------------------------------ + # readtab() - Read lexer information from a tab file + # ------------------------------------------------------------ + def readtab(self, tabfile, fdict): + if isinstance(tabfile, types.ModuleType): + lextab = tabfile + else: + exec('import %s' % tabfile) + lextab = sys.modules[tabfile] + + if getattr(lextab, '_tabversion', '0.0') != __tabversion__: + raise ImportError('Inconsistent PLY version') + + self.lextokens = lextab._lextokens + self.lexreflags = lextab._lexreflags + self.lexliterals = lextab._lexliterals + self.lextokens_all = self.lextokens | set(self.lexliterals) + self.lexstateinfo = lextab._lexstateinfo + self.lexstateignore = lextab._lexstateignore + self.lexstatere = {} + self.lexstateretext = {} + for statename, lre in lextab._lexstatere.items(): + titem = [] + txtitem = [] + for pat, func_name in lre: + titem.append((re.compile(pat, lextab._lexreflags), _names_to_funcs(func_name, fdict))) + + self.lexstatere[statename] = titem + self.lexstateretext[statename] = txtitem + + self.lexstateerrorf = {} + for statename, ef in lextab._lexstateerrorf.items(): + self.lexstateerrorf[statename] = fdict[ef] + + self.lexstateeoff = {} + for statename, ef in lextab._lexstateeoff.items(): + self.lexstateeoff[statename] = fdict[ef] + + self.begin('INITIAL') + + # ------------------------------------------------------------ + # input() - Push a new string into the lexer + # ------------------------------------------------------------ + def input(self, s): + # Pull off the first character to see if s looks like a string + c = s[:1] + if not isinstance(c, StringTypes): + raise ValueError('Expected a string') + self.lexdata = s + self.lexpos = 0 + self.lexlen = len(s) + + # ------------------------------------------------------------ + # begin() - Changes the lexing state + # ------------------------------------------------------------ + def begin(self, state): + if state not in self.lexstatere: + raise ValueError('Undefined state') + self.lexre = self.lexstatere[state] + self.lexretext = self.lexstateretext[state] + self.lexignore = self.lexstateignore.get(state, '') + self.lexerrorf = self.lexstateerrorf.get(state, None) + self.lexeoff = self.lexstateeoff.get(state, None) + self.lexstate = state + + # ------------------------------------------------------------ + # push_state() - Changes the lexing state and saves old on stack + # ------------------------------------------------------------ + def push_state(self, state): + self.lexstatestack.append(self.lexstate) + self.begin(state) + + # ------------------------------------------------------------ + # pop_state() - Restores the previous state + # ------------------------------------------------------------ + def pop_state(self): + self.begin(self.lexstatestack.pop()) + + # ------------------------------------------------------------ + # current_state() - Returns the current lexing state + # ------------------------------------------------------------ + def current_state(self): + return self.lexstate + + # ------------------------------------------------------------ + # skip() - Skip ahead n characters + # ------------------------------------------------------------ + def skip(self, n): + self.lexpos += n + + # ------------------------------------------------------------ + # opttoken() - Return the next token from the Lexer + # + # Note: This function has been carefully implemented to be as fast + # as possible. Don't make changes unless you really know what + # you are doing + # ------------------------------------------------------------ + def token(self): + # Make local copies of frequently referenced attributes + lexpos = self.lexpos + lexlen = self.lexlen + lexignore = self.lexignore + lexdata = self.lexdata + + while lexpos < lexlen: + # This code provides some short-circuit code for whitespace, tabs, and other ignored characters + if lexdata[lexpos] in lexignore: + lexpos += 1 + continue + + # Look for a regular expression match + for lexre, lexindexfunc in self.lexre: + m = lexre.match(lexdata, lexpos) + if not m: + continue + + # Create a token for return + tok = LexToken() + tok.value = m.group() + tok.lineno = self.lineno + tok.lexpos = lexpos + + i = m.lastindex + func, tok.type = lexindexfunc[i] + + if not func: + # If no token type was set, it's an ignored token + if tok.type: + self.lexpos = m.end() + return tok + else: + lexpos = m.end() + break + + lexpos = m.end() + + # If token is processed by a function, call it + + tok.lexer = self # Set additional attributes useful in token rules + self.lexmatch = m + self.lexpos = lexpos + + newtok = func(tok) + + # Every function must return a token, if nothing, we just move to next token + if not newtok: + lexpos = self.lexpos # This is here in case user has updated lexpos. + lexignore = self.lexignore # This is here in case there was a state change + break + + # Verify type of the token. If not in the token map, raise an error + if not self.lexoptimize: + if newtok.type not in self.lextokens_all: + raise LexError("%s:%d: Rule '%s' returned an unknown token type '%s'" % ( + func.__code__.co_filename, func.__code__.co_firstlineno, + func.__name__, newtok.type), lexdata[lexpos:]) + + return newtok + else: + # No match, see if in literals + if lexdata[lexpos] in self.lexliterals: + tok = LexToken() + tok.value = lexdata[lexpos] + tok.lineno = self.lineno + tok.type = tok.value + tok.lexpos = lexpos + self.lexpos = lexpos + 1 + return tok + + # No match. Call t_error() if defined. + if self.lexerrorf: + tok = LexToken() + tok.value = self.lexdata[lexpos:] + tok.lineno = self.lineno + tok.type = 'error' + tok.lexer = self + tok.lexpos = lexpos + self.lexpos = lexpos + newtok = self.lexerrorf(tok) + if lexpos == self.lexpos: + # Error method didn't change text position at all. This is an error. + raise LexError("Scanning error. Illegal character '%s'" % (lexdata[lexpos]), lexdata[lexpos:]) + lexpos = self.lexpos + if not newtok: + continue + return newtok + + self.lexpos = lexpos + raise LexError("Illegal character '%s' at index %d" % (lexdata[lexpos], lexpos), lexdata[lexpos:]) + + if self.lexeoff: + tok = LexToken() + tok.type = 'eof' + tok.value = '' + tok.lineno = self.lineno + tok.lexpos = lexpos + tok.lexer = self + self.lexpos = lexpos + newtok = self.lexeoff(tok) + return newtok + + self.lexpos = lexpos + 1 + if self.lexdata is None: + raise RuntimeError('No input string given with input()') + return None + + # Iterator interface + def __iter__(self): + return self + + def next(self): + t = self.token() + if t is None: + raise StopIteration + return t + + __next__ = next + +# ----------------------------------------------------------------------------- +# ==== Lex Builder === +# +# The functions and classes below are used to collect lexing information +# and build a Lexer object from it. +# ----------------------------------------------------------------------------- + +# ----------------------------------------------------------------------------- +# _get_regex(func) +# +# Returns the regular expression assigned to a function either as a doc string +# or as a .regex attribute attached by the @TOKEN decorator. +# ----------------------------------------------------------------------------- +def _get_regex(func): + return getattr(func, 'regex', func.__doc__) + +# ----------------------------------------------------------------------------- +# get_caller_module_dict() +# +# This function returns a dictionary containing all of the symbols defined within +# a caller further down the call stack. This is used to get the environment +# associated with the yacc() call if none was provided. +# ----------------------------------------------------------------------------- +def get_caller_module_dict(levels): + f = sys._getframe(levels) + ldict = f.f_globals.copy() + if f.f_globals != f.f_locals: + ldict.update(f.f_locals) + return ldict + +# ----------------------------------------------------------------------------- +# _funcs_to_names() +# +# Given a list of regular expression functions, this converts it to a list +# suitable for output to a table file +# ----------------------------------------------------------------------------- +def _funcs_to_names(funclist, namelist): + result = [] + for f, name in zip(funclist, namelist): + if f and f[0]: + result.append((name, f[1])) + else: + result.append(f) + return result + +# ----------------------------------------------------------------------------- +# _names_to_funcs() +# +# Given a list of regular expression function names, this converts it back to +# functions. +# ----------------------------------------------------------------------------- +def _names_to_funcs(namelist, fdict): + result = [] + for n in namelist: + if n and n[0]: + result.append((fdict[n[0]], n[1])) + else: + result.append(n) + return result + +# ----------------------------------------------------------------------------- +# _form_master_re() +# +# This function takes a list of all of the regex components and attempts to +# form the master regular expression. Given limitations in the Python re +# module, it may be necessary to break the master regex into separate expressions. +# ----------------------------------------------------------------------------- +def _form_master_re(relist, reflags, ldict, toknames): + if not relist: + return [] + regex = '|'.join(relist) + try: + lexre = re.compile(regex, reflags) + + # Build the index to function map for the matching engine + lexindexfunc = [None] * (max(lexre.groupindex.values()) + 1) + lexindexnames = lexindexfunc[:] + + for f, i in lexre.groupindex.items(): + handle = ldict.get(f, None) + if type(handle) in (types.FunctionType, types.MethodType): + lexindexfunc[i] = (handle, toknames[f]) + lexindexnames[i] = f + elif handle is not None: + lexindexnames[i] = f + if f.find('ignore_') > 0: + lexindexfunc[i] = (None, None) + else: + lexindexfunc[i] = (None, toknames[f]) + + return [(lexre, lexindexfunc)], [regex], [lexindexnames] + except Exception: + m = int(len(relist)/2) + if m == 0: + m = 1 + llist, lre, lnames = _form_master_re(relist[:m], reflags, ldict, toknames) + rlist, rre, rnames = _form_master_re(relist[m:], reflags, ldict, toknames) + return (llist+rlist), (lre+rre), (lnames+rnames) + +# ----------------------------------------------------------------------------- +# def _statetoken(s,names) +# +# Given a declaration name s of the form "t_" and a dictionary whose keys are +# state names, this function returns a tuple (states,tokenname) where states +# is a tuple of state names and tokenname is the name of the token. For example, +# calling this with s = "t_foo_bar_SPAM" might return (('foo','bar'),'SPAM') +# ----------------------------------------------------------------------------- +def _statetoken(s, names): + nonstate = 1 + parts = s.split('_') + for i, part in enumerate(parts[1:], 1): + if part not in names and part != 'ANY': + break + + if i > 1: + states = tuple(parts[1:i]) + else: + states = ('INITIAL',) + + if 'ANY' in states: + states = tuple(names) + + tokenname = '_'.join(parts[i:]) + return (states, tokenname) + + +# ----------------------------------------------------------------------------- +# LexerReflect() +# +# This class represents information needed to build a lexer as extracted from a +# user's input file. +# ----------------------------------------------------------------------------- +class LexerReflect(object): + def __init__(self, ldict, log=None, reflags=0): + self.ldict = ldict + self.error_func = None + self.tokens = [] + self.reflags = reflags + self.stateinfo = {'INITIAL': 'inclusive'} + self.modules = set() + self.error = False + self.log = PlyLogger(sys.stderr) if log is None else log + + # Get all of the basic information + def get_all(self): + self.get_tokens() + self.get_literals() + self.get_states() + self.get_rules() + + # Validate all of the information + def validate_all(self): + self.validate_tokens() + self.validate_literals() + self.validate_rules() + return self.error + + # Get the tokens map + def get_tokens(self): + tokens = self.ldict.get('tokens', None) + if not tokens: + self.log.error('No token list is defined') + self.error = True + return + + if not isinstance(tokens, (list, tuple)): + self.log.error('tokens must be a list or tuple') + self.error = True + return + + if not tokens: + self.log.error('tokens is empty') + self.error = True + return + + self.tokens = tokens + + # Validate the tokens + def validate_tokens(self): + terminals = {} + for n in self.tokens: + if not _is_identifier.match(n): + self.log.error("Bad token name '%s'", n) + self.error = True + if n in terminals: + self.log.warning("Token '%s' multiply defined", n) + terminals[n] = 1 + + # Get the literals specifier + def get_literals(self): + self.literals = self.ldict.get('literals', '') + if not self.literals: + self.literals = '' + + # Validate literals + def validate_literals(self): + try: + for c in self.literals: + if not isinstance(c, StringTypes) or len(c) > 1: + self.log.error('Invalid literal %s. Must be a single character', repr(c)) + self.error = True + + except TypeError: + self.log.error('Invalid literals specification. literals must be a sequence of characters') + self.error = True + + def get_states(self): + self.states = self.ldict.get('states', None) + # Build statemap + if self.states: + if not isinstance(self.states, (tuple, list)): + self.log.error('states must be defined as a tuple or list') + self.error = True + else: + for s in self.states: + if not isinstance(s, tuple) or len(s) != 2: + self.log.error("Invalid state specifier %s. Must be a tuple (statename,'exclusive|inclusive')", repr(s)) + self.error = True + continue + name, statetype = s + if not isinstance(name, StringTypes): + self.log.error('State name %s must be a string', repr(name)) + self.error = True + continue + if not (statetype == 'inclusive' or statetype == 'exclusive'): + self.log.error("State type for state %s must be 'inclusive' or 'exclusive'", name) + self.error = True + continue + if name in self.stateinfo: + self.log.error("State '%s' already defined", name) + self.error = True + continue + self.stateinfo[name] = statetype + + # Get all of the symbols with a t_ prefix and sort them into various + # categories (functions, strings, error functions, and ignore characters) + + def get_rules(self): + tsymbols = [f for f in self.ldict if f[:2] == 't_'] + + # Now build up a list of functions and a list of strings + self.toknames = {} # Mapping of symbols to token names + self.funcsym = {} # Symbols defined as functions + self.strsym = {} # Symbols defined as strings + self.ignore = {} # Ignore strings by state + self.errorf = {} # Error functions by state + self.eoff = {} # EOF functions by state + + for s in self.stateinfo: + self.funcsym[s] = [] + self.strsym[s] = [] + + if len(tsymbols) == 0: + self.log.error('No rules of the form t_rulename are defined') + self.error = True + return + + for f in tsymbols: + t = self.ldict[f] + states, tokname = _statetoken(f, self.stateinfo) + self.toknames[f] = tokname + + if hasattr(t, '__call__'): + if tokname == 'error': + for s in states: + self.errorf[s] = t + elif tokname == 'eof': + for s in states: + self.eoff[s] = t + elif tokname == 'ignore': + line = t.__code__.co_firstlineno + file = t.__code__.co_filename + self.log.error("%s:%d: Rule '%s' must be defined as a string", file, line, t.__name__) + self.error = True + else: + for s in states: + self.funcsym[s].append((f, t)) + elif isinstance(t, StringTypes): + if tokname == 'ignore': + for s in states: + self.ignore[s] = t + if '\\' in t: + self.log.warning("%s contains a literal backslash '\\'", f) + + elif tokname == 'error': + self.log.error("Rule '%s' must be defined as a function", f) + self.error = True + else: + for s in states: + self.strsym[s].append((f, t)) + else: + self.log.error('%s not defined as a function or string', f) + self.error = True + + # Sort the functions by line number + for f in self.funcsym.values(): + f.sort(key=lambda x: x[1].__code__.co_firstlineno) + + # Sort the strings by regular expression length + for s in self.strsym.values(): + s.sort(key=lambda x: len(x[1]), reverse=True) + + # Validate all of the t_rules collected + def validate_rules(self): + for state in self.stateinfo: + # Validate all rules defined by functions + + for fname, f in self.funcsym[state]: + line = f.__code__.co_firstlineno + file = f.__code__.co_filename + module = inspect.getmodule(f) + self.modules.add(module) + + tokname = self.toknames[fname] + if isinstance(f, types.MethodType): + reqargs = 2 + else: + reqargs = 1 + nargs = f.__code__.co_argcount + if nargs > reqargs: + self.log.error("%s:%d: Rule '%s' has too many arguments", file, line, f.__name__) + self.error = True + continue + + if nargs < reqargs: + self.log.error("%s:%d: Rule '%s' requires an argument", file, line, f.__name__) + self.error = True + continue + + if not _get_regex(f): + self.log.error("%s:%d: No regular expression defined for rule '%s'", file, line, f.__name__) + self.error = True + continue + + try: + c = re.compile('(?P<%s>%s)' % (fname, _get_regex(f)), self.reflags) + if c.match(''): + self.log.error("%s:%d: Regular expression for rule '%s' matches empty string", file, line, f.__name__) + self.error = True + except re.error as e: + self.log.error("%s:%d: Invalid regular expression for rule '%s'. %s", file, line, f.__name__, e) + if '#' in _get_regex(f): + self.log.error("%s:%d. Make sure '#' in rule '%s' is escaped with '\\#'", file, line, f.__name__) + self.error = True + + # Validate all rules defined by strings + for name, r in self.strsym[state]: + tokname = self.toknames[name] + if tokname == 'error': + self.log.error("Rule '%s' must be defined as a function", name) + self.error = True + continue + + if tokname not in self.tokens and tokname.find('ignore_') < 0: + self.log.error("Rule '%s' defined for an unspecified token %s", name, tokname) + self.error = True + continue + + try: + c = re.compile('(?P<%s>%s)' % (name, r), self.reflags) + if (c.match('')): + self.log.error("Regular expression for rule '%s' matches empty string", name) + self.error = True + except re.error as e: + self.log.error("Invalid regular expression for rule '%s'. %s", name, e) + if '#' in r: + self.log.error("Make sure '#' in rule '%s' is escaped with '\\#'", name) + self.error = True + + if not self.funcsym[state] and not self.strsym[state]: + self.log.error("No rules defined for state '%s'", state) + self.error = True + + # Validate the error function + efunc = self.errorf.get(state, None) + if efunc: + f = efunc + line = f.__code__.co_firstlineno + file = f.__code__.co_filename + module = inspect.getmodule(f) + self.modules.add(module) + + if isinstance(f, types.MethodType): + reqargs = 2 + else: + reqargs = 1 + nargs = f.__code__.co_argcount + if nargs > reqargs: + self.log.error("%s:%d: Rule '%s' has too many arguments", file, line, f.__name__) + self.error = True + + if nargs < reqargs: + self.log.error("%s:%d: Rule '%s' requires an argument", file, line, f.__name__) + self.error = True + + for module in self.modules: + self.validate_module(module) + + # ----------------------------------------------------------------------------- + # validate_module() + # + # This checks to see if there are duplicated t_rulename() functions or strings + # in the parser input file. This is done using a simple regular expression + # match on each line in the source code of the given module. + # ----------------------------------------------------------------------------- + + def validate_module(self, module): + try: + lines, linen = inspect.getsourcelines(module) + except IOError: + return + + fre = re.compile(r'\s*def\s+(t_[a-zA-Z_0-9]*)\(') + sre = re.compile(r'\s*(t_[a-zA-Z_0-9]*)\s*=') + + counthash = {} + linen += 1 + for line in lines: + m = fre.match(line) + if not m: + m = sre.match(line) + if m: + name = m.group(1) + prev = counthash.get(name) + if not prev: + counthash[name] = linen + else: + filename = inspect.getsourcefile(module) + self.log.error('%s:%d: Rule %s redefined. Previously defined on line %d', filename, linen, name, prev) + self.error = True + linen += 1 + +# ----------------------------------------------------------------------------- +# lex(module) +# +# Build all of the regular expression rules from definitions in the supplied module +# ----------------------------------------------------------------------------- +def lex(module=None, object=None, debug=False, optimize=False, lextab='lextab', + reflags=int(re.VERBOSE), nowarn=False, outputdir=None, debuglog=None, errorlog=None): + + if lextab is None: + lextab = 'lextab' + + global lexer + + ldict = None + stateinfo = {'INITIAL': 'inclusive'} + lexobj = Lexer() + lexobj.lexoptimize = optimize + global token, input + + if errorlog is None: + errorlog = PlyLogger(sys.stderr) + + if debug: + if debuglog is None: + debuglog = PlyLogger(sys.stderr) + + # Get the module dictionary used for the lexer + if object: + module = object + + # Get the module dictionary used for the parser + if module: + _items = [(k, getattr(module, k)) for k in dir(module)] + ldict = dict(_items) + # If no __file__ attribute is available, try to obtain it from the __module__ instead + if '__file__' not in ldict: + ldict['__file__'] = sys.modules[ldict['__module__']].__file__ + else: + ldict = get_caller_module_dict(2) + + # Determine if the module is package of a package or not. + # If so, fix the tabmodule setting so that tables load correctly + pkg = ldict.get('__package__') + if pkg and isinstance(lextab, str): + if '.' not in lextab: + lextab = pkg + '.' + lextab + + # Collect parser information from the dictionary + linfo = LexerReflect(ldict, log=errorlog, reflags=reflags) + linfo.get_all() + if not optimize: + if linfo.validate_all(): + raise SyntaxError("Can't build lexer") + + if optimize and lextab: + try: + lexobj.readtab(lextab, ldict) + token = lexobj.token + input = lexobj.input + lexer = lexobj + return lexobj + + except ImportError: + pass + + # Dump some basic debugging information + if debug: + debuglog.info('lex: tokens = %r', linfo.tokens) + debuglog.info('lex: literals = %r', linfo.literals) + debuglog.info('lex: states = %r', linfo.stateinfo) + + # Build a dictionary of valid token names + lexobj.lextokens = set() + for n in linfo.tokens: + lexobj.lextokens.add(n) + + # Get literals specification + if isinstance(linfo.literals, (list, tuple)): + lexobj.lexliterals = type(linfo.literals[0])().join(linfo.literals) + else: + lexobj.lexliterals = linfo.literals + + lexobj.lextokens_all = lexobj.lextokens | set(lexobj.lexliterals) + + # Get the stateinfo dictionary + stateinfo = linfo.stateinfo + + regexs = {} + # Build the master regular expressions + for state in stateinfo: + regex_list = [] + + # Add rules defined by functions first + for fname, f in linfo.funcsym[state]: + line = f.__code__.co_firstlineno + file = f.__code__.co_filename + regex_list.append('(?P<%s>%s)' % (fname, _get_regex(f))) + if debug: + debuglog.info("lex: Adding rule %s -> '%s' (state '%s')", fname, _get_regex(f), state) + + # Now add all of the simple rules + for name, r in linfo.strsym[state]: + regex_list.append('(?P<%s>%s)' % (name, r)) + if debug: + debuglog.info("lex: Adding rule %s -> '%s' (state '%s')", name, r, state) + + regexs[state] = regex_list + + # Build the master regular expressions + + if debug: + debuglog.info('lex: ==== MASTER REGEXS FOLLOW ====') + + for state in regexs: + lexre, re_text, re_names = _form_master_re(regexs[state], reflags, ldict, linfo.toknames) + lexobj.lexstatere[state] = lexre + lexobj.lexstateretext[state] = re_text + lexobj.lexstaterenames[state] = re_names + if debug: + for i, text in enumerate(re_text): + debuglog.info("lex: state '%s' : regex[%d] = '%s'", state, i, text) + + # For inclusive states, we need to add the regular expressions from the INITIAL state + for state, stype in stateinfo.items(): + if state != 'INITIAL' and stype == 'inclusive': + lexobj.lexstatere[state].extend(lexobj.lexstatere['INITIAL']) + lexobj.lexstateretext[state].extend(lexobj.lexstateretext['INITIAL']) + lexobj.lexstaterenames[state].extend(lexobj.lexstaterenames['INITIAL']) + + lexobj.lexstateinfo = stateinfo + lexobj.lexre = lexobj.lexstatere['INITIAL'] + lexobj.lexretext = lexobj.lexstateretext['INITIAL'] + lexobj.lexreflags = reflags + + # Set up ignore variables + lexobj.lexstateignore = linfo.ignore + lexobj.lexignore = lexobj.lexstateignore.get('INITIAL', '') + + # Set up error functions + lexobj.lexstateerrorf = linfo.errorf + lexobj.lexerrorf = linfo.errorf.get('INITIAL', None) + if not lexobj.lexerrorf: + errorlog.warning('No t_error rule is defined') + + # Set up eof functions + lexobj.lexstateeoff = linfo.eoff + lexobj.lexeoff = linfo.eoff.get('INITIAL', None) + + # Check state information for ignore and error rules + for s, stype in stateinfo.items(): + if stype == 'exclusive': + if s not in linfo.errorf: + errorlog.warning("No error rule is defined for exclusive state '%s'", s) + if s not in linfo.ignore and lexobj.lexignore: + errorlog.warning("No ignore rule is defined for exclusive state '%s'", s) + elif stype == 'inclusive': + if s not in linfo.errorf: + linfo.errorf[s] = linfo.errorf.get('INITIAL', None) + if s not in linfo.ignore: + linfo.ignore[s] = linfo.ignore.get('INITIAL', '') + + # Create global versions of the token() and input() functions + token = lexobj.token + input = lexobj.input + lexer = lexobj + + # If in optimize mode, we write the lextab + if lextab and optimize: + if outputdir is None: + # If no output directory is set, the location of the output files + # is determined according to the following rules: + # - If lextab specifies a package, files go into that package directory + # - Otherwise, files go in the same directory as the specifying module + if isinstance(lextab, types.ModuleType): + srcfile = lextab.__file__ + else: + if '.' not in lextab: + srcfile = ldict['__file__'] + else: + parts = lextab.split('.') + pkgname = '.'.join(parts[:-1]) + exec('import %s' % pkgname) + srcfile = getattr(sys.modules[pkgname], '__file__', '') + outputdir = os.path.dirname(srcfile) + try: + lexobj.writetab(lextab, outputdir) + except IOError as e: + errorlog.warning("Couldn't write lextab module %r. %s" % (lextab, e)) + + return lexobj + +# ----------------------------------------------------------------------------- +# runmain() +# +# This runs the lexer as a main program +# ----------------------------------------------------------------------------- + +def runmain(lexer=None, data=None): + if not data: + try: + filename = sys.argv[1] + f = open(filename) + data = f.read() + f.close() + except IndexError: + sys.stdout.write('Reading from standard input (type EOF to end):\n') + data = sys.stdin.read() + + if lexer: + _input = lexer.input + else: + _input = input + _input(data) + if lexer: + _token = lexer.token + else: + _token = token + + while True: + tok = _token() + if not tok: + break + sys.stdout.write('(%s,%r,%d,%d)\n' % (tok.type, tok.value, tok.lineno, tok.lexpos)) + +# ----------------------------------------------------------------------------- +# @TOKEN(regex) +# +# This decorator function can be used to set the regex expression on a function +# when its docstring might need to be set in an alternative way +# ----------------------------------------------------------------------------- + +def TOKEN(r): + def set_regex(f): + if hasattr(r, '__call__'): + f.regex = _get_regex(r) + else: + f.regex = r + return f + return set_regex + +# Alternative spelling of the TOKEN decorator +Token = TOKEN diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pycparser/ply/yacc.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pycparser/ply/yacc.py new file mode 100644 index 00000000..20b4f286 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pycparser/ply/yacc.py @@ -0,0 +1,3494 @@ +# ----------------------------------------------------------------------------- +# ply: yacc.py +# +# Copyright (C) 2001-2017 +# David M. Beazley (Dabeaz LLC) +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# +# * Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of the David Beazley or Dabeaz LLC may be used to +# endorse or promote products derived from this software without +# specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# ----------------------------------------------------------------------------- +# +# This implements an LR parser that is constructed from grammar rules defined +# as Python functions. The grammer is specified by supplying the BNF inside +# Python documentation strings. The inspiration for this technique was borrowed +# from John Aycock's Spark parsing system. PLY might be viewed as cross between +# Spark and the GNU bison utility. +# +# The current implementation is only somewhat object-oriented. The +# LR parser itself is defined in terms of an object (which allows multiple +# parsers to co-exist). However, most of the variables used during table +# construction are defined in terms of global variables. Users shouldn't +# notice unless they are trying to define multiple parsers at the same +# time using threads (in which case they should have their head examined). +# +# This implementation supports both SLR and LALR(1) parsing. LALR(1) +# support was originally implemented by Elias Ioup (ezioup@alumni.uchicago.edu), +# using the algorithm found in Aho, Sethi, and Ullman "Compilers: Principles, +# Techniques, and Tools" (The Dragon Book). LALR(1) has since been replaced +# by the more efficient DeRemer and Pennello algorithm. +# +# :::::::: WARNING ::::::: +# +# Construction of LR parsing tables is fairly complicated and expensive. +# To make this module run fast, a *LOT* of work has been put into +# optimization---often at the expensive of readability and what might +# consider to be good Python "coding style." Modify the code at your +# own risk! +# ---------------------------------------------------------------------------- + +import re +import types +import sys +import os.path +import inspect +import base64 +import warnings + +__version__ = '3.10' +__tabversion__ = '3.10' + +#----------------------------------------------------------------------------- +# === User configurable parameters === +# +# Change these to modify the default behavior of yacc (if you wish) +#----------------------------------------------------------------------------- + +yaccdebug = True # Debugging mode. If set, yacc generates a + # a 'parser.out' file in the current directory + +debug_file = 'parser.out' # Default name of the debugging file +tab_module = 'parsetab' # Default name of the table module +default_lr = 'LALR' # Default LR table generation method + +error_count = 3 # Number of symbols that must be shifted to leave recovery mode + +yaccdevel = False # Set to True if developing yacc. This turns off optimized + # implementations of certain functions. + +resultlimit = 40 # Size limit of results when running in debug mode. + +pickle_protocol = 0 # Protocol to use when writing pickle files + +# String type-checking compatibility +if sys.version_info[0] < 3: + string_types = basestring +else: + string_types = str + +MAXINT = sys.maxsize + +# This object is a stand-in for a logging object created by the +# logging module. PLY will use this by default to create things +# such as the parser.out file. If a user wants more detailed +# information, they can create their own logging object and pass +# it into PLY. + +class PlyLogger(object): + def __init__(self, f): + self.f = f + + def debug(self, msg, *args, **kwargs): + self.f.write((msg % args) + '\n') + + info = debug + + def warning(self, msg, *args, **kwargs): + self.f.write('WARNING: ' + (msg % args) + '\n') + + def error(self, msg, *args, **kwargs): + self.f.write('ERROR: ' + (msg % args) + '\n') + + critical = debug + +# Null logger is used when no output is generated. Does nothing. +class NullLogger(object): + def __getattribute__(self, name): + return self + + def __call__(self, *args, **kwargs): + return self + +# Exception raised for yacc-related errors +class YaccError(Exception): + pass + +# Format the result message that the parser produces when running in debug mode. +def format_result(r): + repr_str = repr(r) + if '\n' in repr_str: + repr_str = repr(repr_str) + if len(repr_str) > resultlimit: + repr_str = repr_str[:resultlimit] + ' ...' + result = '<%s @ 0x%x> (%s)' % (type(r).__name__, id(r), repr_str) + return result + +# Format stack entries when the parser is running in debug mode +def format_stack_entry(r): + repr_str = repr(r) + if '\n' in repr_str: + repr_str = repr(repr_str) + if len(repr_str) < 16: + return repr_str + else: + return '<%s @ 0x%x>' % (type(r).__name__, id(r)) + +# Panic mode error recovery support. This feature is being reworked--much of the +# code here is to offer a deprecation/backwards compatible transition + +_errok = None +_token = None +_restart = None +_warnmsg = '''PLY: Don't use global functions errok(), token(), and restart() in p_error(). +Instead, invoke the methods on the associated parser instance: + + def p_error(p): + ... + # Use parser.errok(), parser.token(), parser.restart() + ... + + parser = yacc.yacc() +''' + +def errok(): + warnings.warn(_warnmsg) + return _errok() + +def restart(): + warnings.warn(_warnmsg) + return _restart() + +def token(): + warnings.warn(_warnmsg) + return _token() + +# Utility function to call the p_error() function with some deprecation hacks +def call_errorfunc(errorfunc, token, parser): + global _errok, _token, _restart + _errok = parser.errok + _token = parser.token + _restart = parser.restart + r = errorfunc(token) + try: + del _errok, _token, _restart + except NameError: + pass + return r + +#----------------------------------------------------------------------------- +# === LR Parsing Engine === +# +# The following classes are used for the LR parser itself. These are not +# used during table construction and are independent of the actual LR +# table generation algorithm +#----------------------------------------------------------------------------- + +# This class is used to hold non-terminal grammar symbols during parsing. +# It normally has the following attributes set: +# .type = Grammar symbol type +# .value = Symbol value +# .lineno = Starting line number +# .endlineno = Ending line number (optional, set automatically) +# .lexpos = Starting lex position +# .endlexpos = Ending lex position (optional, set automatically) + +class YaccSymbol: + def __str__(self): + return self.type + + def __repr__(self): + return str(self) + +# This class is a wrapper around the objects actually passed to each +# grammar rule. Index lookup and assignment actually assign the +# .value attribute of the underlying YaccSymbol object. +# The lineno() method returns the line number of a given +# item (or 0 if not defined). The linespan() method returns +# a tuple of (startline,endline) representing the range of lines +# for a symbol. The lexspan() method returns a tuple (lexpos,endlexpos) +# representing the range of positional information for a symbol. + +class YaccProduction: + def __init__(self, s, stack=None): + self.slice = s + self.stack = stack + self.lexer = None + self.parser = None + + def __getitem__(self, n): + if isinstance(n, slice): + return [s.value for s in self.slice[n]] + elif n >= 0: + return self.slice[n].value + else: + return self.stack[n].value + + def __setitem__(self, n, v): + self.slice[n].value = v + + def __getslice__(self, i, j): + return [s.value for s in self.slice[i:j]] + + def __len__(self): + return len(self.slice) + + def lineno(self, n): + return getattr(self.slice[n], 'lineno', 0) + + def set_lineno(self, n, lineno): + self.slice[n].lineno = lineno + + def linespan(self, n): + startline = getattr(self.slice[n], 'lineno', 0) + endline = getattr(self.slice[n], 'endlineno', startline) + return startline, endline + + def lexpos(self, n): + return getattr(self.slice[n], 'lexpos', 0) + + def lexspan(self, n): + startpos = getattr(self.slice[n], 'lexpos', 0) + endpos = getattr(self.slice[n], 'endlexpos', startpos) + return startpos, endpos + + def error(self): + raise SyntaxError + +# ----------------------------------------------------------------------------- +# == LRParser == +# +# The LR Parsing engine. +# ----------------------------------------------------------------------------- + +class LRParser: + def __init__(self, lrtab, errorf): + self.productions = lrtab.lr_productions + self.action = lrtab.lr_action + self.goto = lrtab.lr_goto + self.errorfunc = errorf + self.set_defaulted_states() + self.errorok = True + + def errok(self): + self.errorok = True + + def restart(self): + del self.statestack[:] + del self.symstack[:] + sym = YaccSymbol() + sym.type = '$end' + self.symstack.append(sym) + self.statestack.append(0) + + # Defaulted state support. + # This method identifies parser states where there is only one possible reduction action. + # For such states, the parser can make a choose to make a rule reduction without consuming + # the next look-ahead token. This delayed invocation of the tokenizer can be useful in + # certain kinds of advanced parsing situations where the lexer and parser interact with + # each other or change states (i.e., manipulation of scope, lexer states, etc.). + # + # See: https://www.gnu.org/software/bison/manual/html_node/Default-Reductions.html#Default-Reductions + def set_defaulted_states(self): + self.defaulted_states = {} + for state, actions in self.action.items(): + rules = list(actions.values()) + if len(rules) == 1 and rules[0] < 0: + self.defaulted_states[state] = rules[0] + + def disable_defaulted_states(self): + self.defaulted_states = {} + + def parse(self, input=None, lexer=None, debug=False, tracking=False, tokenfunc=None): + if debug or yaccdevel: + if isinstance(debug, int): + debug = PlyLogger(sys.stderr) + return self.parsedebug(input, lexer, debug, tracking, tokenfunc) + elif tracking: + return self.parseopt(input, lexer, debug, tracking, tokenfunc) + else: + return self.parseopt_notrack(input, lexer, debug, tracking, tokenfunc) + + + # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + # parsedebug(). + # + # This is the debugging enabled version of parse(). All changes made to the + # parsing engine should be made here. Optimized versions of this function + # are automatically created by the ply/ygen.py script. This script cuts out + # sections enclosed in markers such as this: + # + # #--! DEBUG + # statements + # #--! DEBUG + # + # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + + def parsedebug(self, input=None, lexer=None, debug=False, tracking=False, tokenfunc=None): + #--! parsedebug-start + lookahead = None # Current lookahead symbol + lookaheadstack = [] # Stack of lookahead symbols + actions = self.action # Local reference to action table (to avoid lookup on self.) + goto = self.goto # Local reference to goto table (to avoid lookup on self.) + prod = self.productions # Local reference to production list (to avoid lookup on self.) + defaulted_states = self.defaulted_states # Local reference to defaulted states + pslice = YaccProduction(None) # Production object passed to grammar rules + errorcount = 0 # Used during error recovery + + #--! DEBUG + debug.info('PLY: PARSE DEBUG START') + #--! DEBUG + + # If no lexer was given, we will try to use the lex module + if not lexer: + from . import lex + lexer = lex.lexer + + # Set up the lexer and parser objects on pslice + pslice.lexer = lexer + pslice.parser = self + + # If input was supplied, pass to lexer + if input is not None: + lexer.input(input) + + if tokenfunc is None: + # Tokenize function + get_token = lexer.token + else: + get_token = tokenfunc + + # Set the parser() token method (sometimes used in error recovery) + self.token = get_token + + # Set up the state and symbol stacks + + statestack = [] # Stack of parsing states + self.statestack = statestack + symstack = [] # Stack of grammar symbols + self.symstack = symstack + + pslice.stack = symstack # Put in the production + errtoken = None # Err token + + # The start state is assumed to be (0,$end) + + statestack.append(0) + sym = YaccSymbol() + sym.type = '$end' + symstack.append(sym) + state = 0 + while True: + # Get the next symbol on the input. If a lookahead symbol + # is already set, we just use that. Otherwise, we'll pull + # the next token off of the lookaheadstack or from the lexer + + #--! DEBUG + debug.debug('') + debug.debug('State : %s', state) + #--! DEBUG + + if state not in defaulted_states: + if not lookahead: + if not lookaheadstack: + lookahead = get_token() # Get the next token + else: + lookahead = lookaheadstack.pop() + if not lookahead: + lookahead = YaccSymbol() + lookahead.type = '$end' + + # Check the action table + ltype = lookahead.type + t = actions[state].get(ltype) + else: + t = defaulted_states[state] + #--! DEBUG + debug.debug('Defaulted state %s: Reduce using %d', state, -t) + #--! DEBUG + + #--! DEBUG + debug.debug('Stack : %s', + ('%s . %s' % (' '.join([xx.type for xx in symstack][1:]), str(lookahead))).lstrip()) + #--! DEBUG + + if t is not None: + if t > 0: + # shift a symbol on the stack + statestack.append(t) + state = t + + #--! DEBUG + debug.debug('Action : Shift and goto state %s', t) + #--! DEBUG + + symstack.append(lookahead) + lookahead = None + + # Decrease error count on successful shift + if errorcount: + errorcount -= 1 + continue + + if t < 0: + # reduce a symbol on the stack, emit a production + p = prod[-t] + pname = p.name + plen = p.len + + # Get production function + sym = YaccSymbol() + sym.type = pname # Production name + sym.value = None + + #--! DEBUG + if plen: + debug.info('Action : Reduce rule [%s] with %s and goto state %d', p.str, + '['+','.join([format_stack_entry(_v.value) for _v in symstack[-plen:]])+']', + goto[statestack[-1-plen]][pname]) + else: + debug.info('Action : Reduce rule [%s] with %s and goto state %d', p.str, [], + goto[statestack[-1]][pname]) + + #--! DEBUG + + if plen: + targ = symstack[-plen-1:] + targ[0] = sym + + #--! TRACKING + if tracking: + t1 = targ[1] + sym.lineno = t1.lineno + sym.lexpos = t1.lexpos + t1 = targ[-1] + sym.endlineno = getattr(t1, 'endlineno', t1.lineno) + sym.endlexpos = getattr(t1, 'endlexpos', t1.lexpos) + #--! TRACKING + + # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + # The code enclosed in this section is duplicated + # below as a performance optimization. Make sure + # changes get made in both locations. + + pslice.slice = targ + + try: + # Call the grammar rule with our special slice object + del symstack[-plen:] + self.state = state + p.callable(pslice) + del statestack[-plen:] + #--! DEBUG + debug.info('Result : %s', format_result(pslice[0])) + #--! DEBUG + symstack.append(sym) + state = goto[statestack[-1]][pname] + statestack.append(state) + except SyntaxError: + # If an error was set. Enter error recovery state + lookaheadstack.append(lookahead) # Save the current lookahead token + symstack.extend(targ[1:-1]) # Put the production slice back on the stack + statestack.pop() # Pop back one state (before the reduce) + state = statestack[-1] + sym.type = 'error' + sym.value = 'error' + lookahead = sym + errorcount = error_count + self.errorok = False + + continue + # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + + else: + + #--! TRACKING + if tracking: + sym.lineno = lexer.lineno + sym.lexpos = lexer.lexpos + #--! TRACKING + + targ = [sym] + + # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + # The code enclosed in this section is duplicated + # above as a performance optimization. Make sure + # changes get made in both locations. + + pslice.slice = targ + + try: + # Call the grammar rule with our special slice object + self.state = state + p.callable(pslice) + #--! DEBUG + debug.info('Result : %s', format_result(pslice[0])) + #--! DEBUG + symstack.append(sym) + state = goto[statestack[-1]][pname] + statestack.append(state) + except SyntaxError: + # If an error was set. Enter error recovery state + lookaheadstack.append(lookahead) # Save the current lookahead token + statestack.pop() # Pop back one state (before the reduce) + state = statestack[-1] + sym.type = 'error' + sym.value = 'error' + lookahead = sym + errorcount = error_count + self.errorok = False + + continue + # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + + if t == 0: + n = symstack[-1] + result = getattr(n, 'value', None) + #--! DEBUG + debug.info('Done : Returning %s', format_result(result)) + debug.info('PLY: PARSE DEBUG END') + #--! DEBUG + return result + + if t is None: + + #--! DEBUG + debug.error('Error : %s', + ('%s . %s' % (' '.join([xx.type for xx in symstack][1:]), str(lookahead))).lstrip()) + #--! DEBUG + + # We have some kind of parsing error here. To handle + # this, we are going to push the current token onto + # the tokenstack and replace it with an 'error' token. + # If there are any synchronization rules, they may + # catch it. + # + # In addition to pushing the error token, we call call + # the user defined p_error() function if this is the + # first syntax error. This function is only called if + # errorcount == 0. + if errorcount == 0 or self.errorok: + errorcount = error_count + self.errorok = False + errtoken = lookahead + if errtoken.type == '$end': + errtoken = None # End of file! + if self.errorfunc: + if errtoken and not hasattr(errtoken, 'lexer'): + errtoken.lexer = lexer + self.state = state + tok = call_errorfunc(self.errorfunc, errtoken, self) + if self.errorok: + # User must have done some kind of panic + # mode recovery on their own. The + # returned token is the next lookahead + lookahead = tok + errtoken = None + continue + else: + if errtoken: + if hasattr(errtoken, 'lineno'): + lineno = lookahead.lineno + else: + lineno = 0 + if lineno: + sys.stderr.write('yacc: Syntax error at line %d, token=%s\n' % (lineno, errtoken.type)) + else: + sys.stderr.write('yacc: Syntax error, token=%s' % errtoken.type) + else: + sys.stderr.write('yacc: Parse error in input. EOF\n') + return + + else: + errorcount = error_count + + # case 1: the statestack only has 1 entry on it. If we're in this state, the + # entire parse has been rolled back and we're completely hosed. The token is + # discarded and we just keep going. + + if len(statestack) <= 1 and lookahead.type != '$end': + lookahead = None + errtoken = None + state = 0 + # Nuke the pushback stack + del lookaheadstack[:] + continue + + # case 2: the statestack has a couple of entries on it, but we're + # at the end of the file. nuke the top entry and generate an error token + + # Start nuking entries on the stack + if lookahead.type == '$end': + # Whoa. We're really hosed here. Bail out + return + + if lookahead.type != 'error': + sym = symstack[-1] + if sym.type == 'error': + # Hmmm. Error is on top of stack, we'll just nuke input + # symbol and continue + #--! TRACKING + if tracking: + sym.endlineno = getattr(lookahead, 'lineno', sym.lineno) + sym.endlexpos = getattr(lookahead, 'lexpos', sym.lexpos) + #--! TRACKING + lookahead = None + continue + + # Create the error symbol for the first time and make it the new lookahead symbol + t = YaccSymbol() + t.type = 'error' + + if hasattr(lookahead, 'lineno'): + t.lineno = t.endlineno = lookahead.lineno + if hasattr(lookahead, 'lexpos'): + t.lexpos = t.endlexpos = lookahead.lexpos + t.value = lookahead + lookaheadstack.append(lookahead) + lookahead = t + else: + sym = symstack.pop() + #--! TRACKING + if tracking: + lookahead.lineno = sym.lineno + lookahead.lexpos = sym.lexpos + #--! TRACKING + statestack.pop() + state = statestack[-1] + + continue + + # Call an error function here + raise RuntimeError('yacc: internal parser error!!!\n') + + #--! parsedebug-end + + # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + # parseopt(). + # + # Optimized version of parse() method. DO NOT EDIT THIS CODE DIRECTLY! + # This code is automatically generated by the ply/ygen.py script. Make + # changes to the parsedebug() method instead. + # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + + def parseopt(self, input=None, lexer=None, debug=False, tracking=False, tokenfunc=None): + #--! parseopt-start + lookahead = None # Current lookahead symbol + lookaheadstack = [] # Stack of lookahead symbols + actions = self.action # Local reference to action table (to avoid lookup on self.) + goto = self.goto # Local reference to goto table (to avoid lookup on self.) + prod = self.productions # Local reference to production list (to avoid lookup on self.) + defaulted_states = self.defaulted_states # Local reference to defaulted states + pslice = YaccProduction(None) # Production object passed to grammar rules + errorcount = 0 # Used during error recovery + + + # If no lexer was given, we will try to use the lex module + if not lexer: + from . import lex + lexer = lex.lexer + + # Set up the lexer and parser objects on pslice + pslice.lexer = lexer + pslice.parser = self + + # If input was supplied, pass to lexer + if input is not None: + lexer.input(input) + + if tokenfunc is None: + # Tokenize function + get_token = lexer.token + else: + get_token = tokenfunc + + # Set the parser() token method (sometimes used in error recovery) + self.token = get_token + + # Set up the state and symbol stacks + + statestack = [] # Stack of parsing states + self.statestack = statestack + symstack = [] # Stack of grammar symbols + self.symstack = symstack + + pslice.stack = symstack # Put in the production + errtoken = None # Err token + + # The start state is assumed to be (0,$end) + + statestack.append(0) + sym = YaccSymbol() + sym.type = '$end' + symstack.append(sym) + state = 0 + while True: + # Get the next symbol on the input. If a lookahead symbol + # is already set, we just use that. Otherwise, we'll pull + # the next token off of the lookaheadstack or from the lexer + + + if state not in defaulted_states: + if not lookahead: + if not lookaheadstack: + lookahead = get_token() # Get the next token + else: + lookahead = lookaheadstack.pop() + if not lookahead: + lookahead = YaccSymbol() + lookahead.type = '$end' + + # Check the action table + ltype = lookahead.type + t = actions[state].get(ltype) + else: + t = defaulted_states[state] + + + if t is not None: + if t > 0: + # shift a symbol on the stack + statestack.append(t) + state = t + + + symstack.append(lookahead) + lookahead = None + + # Decrease error count on successful shift + if errorcount: + errorcount -= 1 + continue + + if t < 0: + # reduce a symbol on the stack, emit a production + p = prod[-t] + pname = p.name + plen = p.len + + # Get production function + sym = YaccSymbol() + sym.type = pname # Production name + sym.value = None + + + if plen: + targ = symstack[-plen-1:] + targ[0] = sym + + #--! TRACKING + if tracking: + t1 = targ[1] + sym.lineno = t1.lineno + sym.lexpos = t1.lexpos + t1 = targ[-1] + sym.endlineno = getattr(t1, 'endlineno', t1.lineno) + sym.endlexpos = getattr(t1, 'endlexpos', t1.lexpos) + #--! TRACKING + + # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + # The code enclosed in this section is duplicated + # below as a performance optimization. Make sure + # changes get made in both locations. + + pslice.slice = targ + + try: + # Call the grammar rule with our special slice object + del symstack[-plen:] + self.state = state + p.callable(pslice) + del statestack[-plen:] + symstack.append(sym) + state = goto[statestack[-1]][pname] + statestack.append(state) + except SyntaxError: + # If an error was set. Enter error recovery state + lookaheadstack.append(lookahead) # Save the current lookahead token + symstack.extend(targ[1:-1]) # Put the production slice back on the stack + statestack.pop() # Pop back one state (before the reduce) + state = statestack[-1] + sym.type = 'error' + sym.value = 'error' + lookahead = sym + errorcount = error_count + self.errorok = False + + continue + # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + + else: + + #--! TRACKING + if tracking: + sym.lineno = lexer.lineno + sym.lexpos = lexer.lexpos + #--! TRACKING + + targ = [sym] + + # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + # The code enclosed in this section is duplicated + # above as a performance optimization. Make sure + # changes get made in both locations. + + pslice.slice = targ + + try: + # Call the grammar rule with our special slice object + self.state = state + p.callable(pslice) + symstack.append(sym) + state = goto[statestack[-1]][pname] + statestack.append(state) + except SyntaxError: + # If an error was set. Enter error recovery state + lookaheadstack.append(lookahead) # Save the current lookahead token + statestack.pop() # Pop back one state (before the reduce) + state = statestack[-1] + sym.type = 'error' + sym.value = 'error' + lookahead = sym + errorcount = error_count + self.errorok = False + + continue + # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + + if t == 0: + n = symstack[-1] + result = getattr(n, 'value', None) + return result + + if t is None: + + + # We have some kind of parsing error here. To handle + # this, we are going to push the current token onto + # the tokenstack and replace it with an 'error' token. + # If there are any synchronization rules, they may + # catch it. + # + # In addition to pushing the error token, we call call + # the user defined p_error() function if this is the + # first syntax error. This function is only called if + # errorcount == 0. + if errorcount == 0 or self.errorok: + errorcount = error_count + self.errorok = False + errtoken = lookahead + if errtoken.type == '$end': + errtoken = None # End of file! + if self.errorfunc: + if errtoken and not hasattr(errtoken, 'lexer'): + errtoken.lexer = lexer + self.state = state + tok = call_errorfunc(self.errorfunc, errtoken, self) + if self.errorok: + # User must have done some kind of panic + # mode recovery on their own. The + # returned token is the next lookahead + lookahead = tok + errtoken = None + continue + else: + if errtoken: + if hasattr(errtoken, 'lineno'): + lineno = lookahead.lineno + else: + lineno = 0 + if lineno: + sys.stderr.write('yacc: Syntax error at line %d, token=%s\n' % (lineno, errtoken.type)) + else: + sys.stderr.write('yacc: Syntax error, token=%s' % errtoken.type) + else: + sys.stderr.write('yacc: Parse error in input. EOF\n') + return + + else: + errorcount = error_count + + # case 1: the statestack only has 1 entry on it. If we're in this state, the + # entire parse has been rolled back and we're completely hosed. The token is + # discarded and we just keep going. + + if len(statestack) <= 1 and lookahead.type != '$end': + lookahead = None + errtoken = None + state = 0 + # Nuke the pushback stack + del lookaheadstack[:] + continue + + # case 2: the statestack has a couple of entries on it, but we're + # at the end of the file. nuke the top entry and generate an error token + + # Start nuking entries on the stack + if lookahead.type == '$end': + # Whoa. We're really hosed here. Bail out + return + + if lookahead.type != 'error': + sym = symstack[-1] + if sym.type == 'error': + # Hmmm. Error is on top of stack, we'll just nuke input + # symbol and continue + #--! TRACKING + if tracking: + sym.endlineno = getattr(lookahead, 'lineno', sym.lineno) + sym.endlexpos = getattr(lookahead, 'lexpos', sym.lexpos) + #--! TRACKING + lookahead = None + continue + + # Create the error symbol for the first time and make it the new lookahead symbol + t = YaccSymbol() + t.type = 'error' + + if hasattr(lookahead, 'lineno'): + t.lineno = t.endlineno = lookahead.lineno + if hasattr(lookahead, 'lexpos'): + t.lexpos = t.endlexpos = lookahead.lexpos + t.value = lookahead + lookaheadstack.append(lookahead) + lookahead = t + else: + sym = symstack.pop() + #--! TRACKING + if tracking: + lookahead.lineno = sym.lineno + lookahead.lexpos = sym.lexpos + #--! TRACKING + statestack.pop() + state = statestack[-1] + + continue + + # Call an error function here + raise RuntimeError('yacc: internal parser error!!!\n') + + #--! parseopt-end + + # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + # parseopt_notrack(). + # + # Optimized version of parseopt() with line number tracking removed. + # DO NOT EDIT THIS CODE DIRECTLY. This code is automatically generated + # by the ply/ygen.py script. Make changes to the parsedebug() method instead. + # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + + def parseopt_notrack(self, input=None, lexer=None, debug=False, tracking=False, tokenfunc=None): + #--! parseopt-notrack-start + lookahead = None # Current lookahead symbol + lookaheadstack = [] # Stack of lookahead symbols + actions = self.action # Local reference to action table (to avoid lookup on self.) + goto = self.goto # Local reference to goto table (to avoid lookup on self.) + prod = self.productions # Local reference to production list (to avoid lookup on self.) + defaulted_states = self.defaulted_states # Local reference to defaulted states + pslice = YaccProduction(None) # Production object passed to grammar rules + errorcount = 0 # Used during error recovery + + + # If no lexer was given, we will try to use the lex module + if not lexer: + from . import lex + lexer = lex.lexer + + # Set up the lexer and parser objects on pslice + pslice.lexer = lexer + pslice.parser = self + + # If input was supplied, pass to lexer + if input is not None: + lexer.input(input) + + if tokenfunc is None: + # Tokenize function + get_token = lexer.token + else: + get_token = tokenfunc + + # Set the parser() token method (sometimes used in error recovery) + self.token = get_token + + # Set up the state and symbol stacks + + statestack = [] # Stack of parsing states + self.statestack = statestack + symstack = [] # Stack of grammar symbols + self.symstack = symstack + + pslice.stack = symstack # Put in the production + errtoken = None # Err token + + # The start state is assumed to be (0,$end) + + statestack.append(0) + sym = YaccSymbol() + sym.type = '$end' + symstack.append(sym) + state = 0 + while True: + # Get the next symbol on the input. If a lookahead symbol + # is already set, we just use that. Otherwise, we'll pull + # the next token off of the lookaheadstack or from the lexer + + + if state not in defaulted_states: + if not lookahead: + if not lookaheadstack: + lookahead = get_token() # Get the next token + else: + lookahead = lookaheadstack.pop() + if not lookahead: + lookahead = YaccSymbol() + lookahead.type = '$end' + + # Check the action table + ltype = lookahead.type + t = actions[state].get(ltype) + else: + t = defaulted_states[state] + + + if t is not None: + if t > 0: + # shift a symbol on the stack + statestack.append(t) + state = t + + + symstack.append(lookahead) + lookahead = None + + # Decrease error count on successful shift + if errorcount: + errorcount -= 1 + continue + + if t < 0: + # reduce a symbol on the stack, emit a production + p = prod[-t] + pname = p.name + plen = p.len + + # Get production function + sym = YaccSymbol() + sym.type = pname # Production name + sym.value = None + + + if plen: + targ = symstack[-plen-1:] + targ[0] = sym + + + # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + # The code enclosed in this section is duplicated + # below as a performance optimization. Make sure + # changes get made in both locations. + + pslice.slice = targ + + try: + # Call the grammar rule with our special slice object + del symstack[-plen:] + self.state = state + p.callable(pslice) + del statestack[-plen:] + symstack.append(sym) + state = goto[statestack[-1]][pname] + statestack.append(state) + except SyntaxError: + # If an error was set. Enter error recovery state + lookaheadstack.append(lookahead) # Save the current lookahead token + symstack.extend(targ[1:-1]) # Put the production slice back on the stack + statestack.pop() # Pop back one state (before the reduce) + state = statestack[-1] + sym.type = 'error' + sym.value = 'error' + lookahead = sym + errorcount = error_count + self.errorok = False + + continue + # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + + else: + + + targ = [sym] + + # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + # The code enclosed in this section is duplicated + # above as a performance optimization. Make sure + # changes get made in both locations. + + pslice.slice = targ + + try: + # Call the grammar rule with our special slice object + self.state = state + p.callable(pslice) + symstack.append(sym) + state = goto[statestack[-1]][pname] + statestack.append(state) + except SyntaxError: + # If an error was set. Enter error recovery state + lookaheadstack.append(lookahead) # Save the current lookahead token + statestack.pop() # Pop back one state (before the reduce) + state = statestack[-1] + sym.type = 'error' + sym.value = 'error' + lookahead = sym + errorcount = error_count + self.errorok = False + + continue + # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + + if t == 0: + n = symstack[-1] + result = getattr(n, 'value', None) + return result + + if t is None: + + + # We have some kind of parsing error here. To handle + # this, we are going to push the current token onto + # the tokenstack and replace it with an 'error' token. + # If there are any synchronization rules, they may + # catch it. + # + # In addition to pushing the error token, we call call + # the user defined p_error() function if this is the + # first syntax error. This function is only called if + # errorcount == 0. + if errorcount == 0 or self.errorok: + errorcount = error_count + self.errorok = False + errtoken = lookahead + if errtoken.type == '$end': + errtoken = None # End of file! + if self.errorfunc: + if errtoken and not hasattr(errtoken, 'lexer'): + errtoken.lexer = lexer + self.state = state + tok = call_errorfunc(self.errorfunc, errtoken, self) + if self.errorok: + # User must have done some kind of panic + # mode recovery on their own. The + # returned token is the next lookahead + lookahead = tok + errtoken = None + continue + else: + if errtoken: + if hasattr(errtoken, 'lineno'): + lineno = lookahead.lineno + else: + lineno = 0 + if lineno: + sys.stderr.write('yacc: Syntax error at line %d, token=%s\n' % (lineno, errtoken.type)) + else: + sys.stderr.write('yacc: Syntax error, token=%s' % errtoken.type) + else: + sys.stderr.write('yacc: Parse error in input. EOF\n') + return + + else: + errorcount = error_count + + # case 1: the statestack only has 1 entry on it. If we're in this state, the + # entire parse has been rolled back and we're completely hosed. The token is + # discarded and we just keep going. + + if len(statestack) <= 1 and lookahead.type != '$end': + lookahead = None + errtoken = None + state = 0 + # Nuke the pushback stack + del lookaheadstack[:] + continue + + # case 2: the statestack has a couple of entries on it, but we're + # at the end of the file. nuke the top entry and generate an error token + + # Start nuking entries on the stack + if lookahead.type == '$end': + # Whoa. We're really hosed here. Bail out + return + + if lookahead.type != 'error': + sym = symstack[-1] + if sym.type == 'error': + # Hmmm. Error is on top of stack, we'll just nuke input + # symbol and continue + lookahead = None + continue + + # Create the error symbol for the first time and make it the new lookahead symbol + t = YaccSymbol() + t.type = 'error' + + if hasattr(lookahead, 'lineno'): + t.lineno = t.endlineno = lookahead.lineno + if hasattr(lookahead, 'lexpos'): + t.lexpos = t.endlexpos = lookahead.lexpos + t.value = lookahead + lookaheadstack.append(lookahead) + lookahead = t + else: + sym = symstack.pop() + statestack.pop() + state = statestack[-1] + + continue + + # Call an error function here + raise RuntimeError('yacc: internal parser error!!!\n') + + #--! parseopt-notrack-end + +# ----------------------------------------------------------------------------- +# === Grammar Representation === +# +# The following functions, classes, and variables are used to represent and +# manipulate the rules that make up a grammar. +# ----------------------------------------------------------------------------- + +# regex matching identifiers +_is_identifier = re.compile(r'^[a-zA-Z0-9_-]+$') + +# ----------------------------------------------------------------------------- +# class Production: +# +# This class stores the raw information about a single production or grammar rule. +# A grammar rule refers to a specification such as this: +# +# expr : expr PLUS term +# +# Here are the basic attributes defined on all productions +# +# name - Name of the production. For example 'expr' +# prod - A list of symbols on the right side ['expr','PLUS','term'] +# prec - Production precedence level +# number - Production number. +# func - Function that executes on reduce +# file - File where production function is defined +# lineno - Line number where production function is defined +# +# The following attributes are defined or optional. +# +# len - Length of the production (number of symbols on right hand side) +# usyms - Set of unique symbols found in the production +# ----------------------------------------------------------------------------- + +class Production(object): + reduced = 0 + def __init__(self, number, name, prod, precedence=('right', 0), func=None, file='', line=0): + self.name = name + self.prod = tuple(prod) + self.number = number + self.func = func + self.callable = None + self.file = file + self.line = line + self.prec = precedence + + # Internal settings used during table construction + + self.len = len(self.prod) # Length of the production + + # Create a list of unique production symbols used in the production + self.usyms = [] + for s in self.prod: + if s not in self.usyms: + self.usyms.append(s) + + # List of all LR items for the production + self.lr_items = [] + self.lr_next = None + + # Create a string representation + if self.prod: + self.str = '%s -> %s' % (self.name, ' '.join(self.prod)) + else: + self.str = '%s -> ' % self.name + + def __str__(self): + return self.str + + def __repr__(self): + return 'Production(' + str(self) + ')' + + def __len__(self): + return len(self.prod) + + def __nonzero__(self): + return 1 + + def __getitem__(self, index): + return self.prod[index] + + # Return the nth lr_item from the production (or None if at the end) + def lr_item(self, n): + if n > len(self.prod): + return None + p = LRItem(self, n) + # Precompute the list of productions immediately following. + try: + p.lr_after = Prodnames[p.prod[n+1]] + except (IndexError, KeyError): + p.lr_after = [] + try: + p.lr_before = p.prod[n-1] + except IndexError: + p.lr_before = None + return p + + # Bind the production function name to a callable + def bind(self, pdict): + if self.func: + self.callable = pdict[self.func] + +# This class serves as a minimal standin for Production objects when +# reading table data from files. It only contains information +# actually used by the LR parsing engine, plus some additional +# debugging information. +class MiniProduction(object): + def __init__(self, str, name, len, func, file, line): + self.name = name + self.len = len + self.func = func + self.callable = None + self.file = file + self.line = line + self.str = str + + def __str__(self): + return self.str + + def __repr__(self): + return 'MiniProduction(%s)' % self.str + + # Bind the production function name to a callable + def bind(self, pdict): + if self.func: + self.callable = pdict[self.func] + + +# ----------------------------------------------------------------------------- +# class LRItem +# +# This class represents a specific stage of parsing a production rule. For +# example: +# +# expr : expr . PLUS term +# +# In the above, the "." represents the current location of the parse. Here +# basic attributes: +# +# name - Name of the production. For example 'expr' +# prod - A list of symbols on the right side ['expr','.', 'PLUS','term'] +# number - Production number. +# +# lr_next Next LR item. Example, if we are ' expr -> expr . PLUS term' +# then lr_next refers to 'expr -> expr PLUS . term' +# lr_index - LR item index (location of the ".") in the prod list. +# lookaheads - LALR lookahead symbols for this item +# len - Length of the production (number of symbols on right hand side) +# lr_after - List of all productions that immediately follow +# lr_before - Grammar symbol immediately before +# ----------------------------------------------------------------------------- + +class LRItem(object): + def __init__(self, p, n): + self.name = p.name + self.prod = list(p.prod) + self.number = p.number + self.lr_index = n + self.lookaheads = {} + self.prod.insert(n, '.') + self.prod = tuple(self.prod) + self.len = len(self.prod) + self.usyms = p.usyms + + def __str__(self): + if self.prod: + s = '%s -> %s' % (self.name, ' '.join(self.prod)) + else: + s = '%s -> ' % self.name + return s + + def __repr__(self): + return 'LRItem(' + str(self) + ')' + +# ----------------------------------------------------------------------------- +# rightmost_terminal() +# +# Return the rightmost terminal from a list of symbols. Used in add_production() +# ----------------------------------------------------------------------------- +def rightmost_terminal(symbols, terminals): + i = len(symbols) - 1 + while i >= 0: + if symbols[i] in terminals: + return symbols[i] + i -= 1 + return None + +# ----------------------------------------------------------------------------- +# === GRAMMAR CLASS === +# +# The following class represents the contents of the specified grammar along +# with various computed properties such as first sets, follow sets, LR items, etc. +# This data is used for critical parts of the table generation process later. +# ----------------------------------------------------------------------------- + +class GrammarError(YaccError): + pass + +class Grammar(object): + def __init__(self, terminals): + self.Productions = [None] # A list of all of the productions. The first + # entry is always reserved for the purpose of + # building an augmented grammar + + self.Prodnames = {} # A dictionary mapping the names of nonterminals to a list of all + # productions of that nonterminal. + + self.Prodmap = {} # A dictionary that is only used to detect duplicate + # productions. + + self.Terminals = {} # A dictionary mapping the names of terminal symbols to a + # list of the rules where they are used. + + for term in terminals: + self.Terminals[term] = [] + + self.Terminals['error'] = [] + + self.Nonterminals = {} # A dictionary mapping names of nonterminals to a list + # of rule numbers where they are used. + + self.First = {} # A dictionary of precomputed FIRST(x) symbols + + self.Follow = {} # A dictionary of precomputed FOLLOW(x) symbols + + self.Precedence = {} # Precedence rules for each terminal. Contains tuples of the + # form ('right',level) or ('nonassoc', level) or ('left',level) + + self.UsedPrecedence = set() # Precedence rules that were actually used by the grammer. + # This is only used to provide error checking and to generate + # a warning about unused precedence rules. + + self.Start = None # Starting symbol for the grammar + + + def __len__(self): + return len(self.Productions) + + def __getitem__(self, index): + return self.Productions[index] + + # ----------------------------------------------------------------------------- + # set_precedence() + # + # Sets the precedence for a given terminal. assoc is the associativity such as + # 'left','right', or 'nonassoc'. level is a numeric level. + # + # ----------------------------------------------------------------------------- + + def set_precedence(self, term, assoc, level): + assert self.Productions == [None], 'Must call set_precedence() before add_production()' + if term in self.Precedence: + raise GrammarError('Precedence already specified for terminal %r' % term) + if assoc not in ['left', 'right', 'nonassoc']: + raise GrammarError("Associativity must be one of 'left','right', or 'nonassoc'") + self.Precedence[term] = (assoc, level) + + # ----------------------------------------------------------------------------- + # add_production() + # + # Given an action function, this function assembles a production rule and + # computes its precedence level. + # + # The production rule is supplied as a list of symbols. For example, + # a rule such as 'expr : expr PLUS term' has a production name of 'expr' and + # symbols ['expr','PLUS','term']. + # + # Precedence is determined by the precedence of the right-most non-terminal + # or the precedence of a terminal specified by %prec. + # + # A variety of error checks are performed to make sure production symbols + # are valid and that %prec is used correctly. + # ----------------------------------------------------------------------------- + + def add_production(self, prodname, syms, func=None, file='', line=0): + + if prodname in self.Terminals: + raise GrammarError('%s:%d: Illegal rule name %r. Already defined as a token' % (file, line, prodname)) + if prodname == 'error': + raise GrammarError('%s:%d: Illegal rule name %r. error is a reserved word' % (file, line, prodname)) + if not _is_identifier.match(prodname): + raise GrammarError('%s:%d: Illegal rule name %r' % (file, line, prodname)) + + # Look for literal tokens + for n, s in enumerate(syms): + if s[0] in "'\"": + try: + c = eval(s) + if (len(c) > 1): + raise GrammarError('%s:%d: Literal token %s in rule %r may only be a single character' % + (file, line, s, prodname)) + if c not in self.Terminals: + self.Terminals[c] = [] + syms[n] = c + continue + except SyntaxError: + pass + if not _is_identifier.match(s) and s != '%prec': + raise GrammarError('%s:%d: Illegal name %r in rule %r' % (file, line, s, prodname)) + + # Determine the precedence level + if '%prec' in syms: + if syms[-1] == '%prec': + raise GrammarError('%s:%d: Syntax error. Nothing follows %%prec' % (file, line)) + if syms[-2] != '%prec': + raise GrammarError('%s:%d: Syntax error. %%prec can only appear at the end of a grammar rule' % + (file, line)) + precname = syms[-1] + prodprec = self.Precedence.get(precname) + if not prodprec: + raise GrammarError('%s:%d: Nothing known about the precedence of %r' % (file, line, precname)) + else: + self.UsedPrecedence.add(precname) + del syms[-2:] # Drop %prec from the rule + else: + # If no %prec, precedence is determined by the rightmost terminal symbol + precname = rightmost_terminal(syms, self.Terminals) + prodprec = self.Precedence.get(precname, ('right', 0)) + + # See if the rule is already in the rulemap + map = '%s -> %s' % (prodname, syms) + if map in self.Prodmap: + m = self.Prodmap[map] + raise GrammarError('%s:%d: Duplicate rule %s. ' % (file, line, m) + + 'Previous definition at %s:%d' % (m.file, m.line)) + + # From this point on, everything is valid. Create a new Production instance + pnumber = len(self.Productions) + if prodname not in self.Nonterminals: + self.Nonterminals[prodname] = [] + + # Add the production number to Terminals and Nonterminals + for t in syms: + if t in self.Terminals: + self.Terminals[t].append(pnumber) + else: + if t not in self.Nonterminals: + self.Nonterminals[t] = [] + self.Nonterminals[t].append(pnumber) + + # Create a production and add it to the list of productions + p = Production(pnumber, prodname, syms, prodprec, func, file, line) + self.Productions.append(p) + self.Prodmap[map] = p + + # Add to the global productions list + try: + self.Prodnames[prodname].append(p) + except KeyError: + self.Prodnames[prodname] = [p] + + # ----------------------------------------------------------------------------- + # set_start() + # + # Sets the starting symbol and creates the augmented grammar. Production + # rule 0 is S' -> start where start is the start symbol. + # ----------------------------------------------------------------------------- + + def set_start(self, start=None): + if not start: + start = self.Productions[1].name + if start not in self.Nonterminals: + raise GrammarError('start symbol %s undefined' % start) + self.Productions[0] = Production(0, "S'", [start]) + self.Nonterminals[start].append(0) + self.Start = start + + # ----------------------------------------------------------------------------- + # find_unreachable() + # + # Find all of the nonterminal symbols that can't be reached from the starting + # symbol. Returns a list of nonterminals that can't be reached. + # ----------------------------------------------------------------------------- + + def find_unreachable(self): + + # Mark all symbols that are reachable from a symbol s + def mark_reachable_from(s): + if s in reachable: + return + reachable.add(s) + for p in self.Prodnames.get(s, []): + for r in p.prod: + mark_reachable_from(r) + + reachable = set() + mark_reachable_from(self.Productions[0].prod[0]) + return [s for s in self.Nonterminals if s not in reachable] + + # ----------------------------------------------------------------------------- + # infinite_cycles() + # + # This function looks at the various parsing rules and tries to detect + # infinite recursion cycles (grammar rules where there is no possible way + # to derive a string of only terminals). + # ----------------------------------------------------------------------------- + + def infinite_cycles(self): + terminates = {} + + # Terminals: + for t in self.Terminals: + terminates[t] = True + + terminates['$end'] = True + + # Nonterminals: + + # Initialize to false: + for n in self.Nonterminals: + terminates[n] = False + + # Then propagate termination until no change: + while True: + some_change = False + for (n, pl) in self.Prodnames.items(): + # Nonterminal n terminates iff any of its productions terminates. + for p in pl: + # Production p terminates iff all of its rhs symbols terminate. + for s in p.prod: + if not terminates[s]: + # The symbol s does not terminate, + # so production p does not terminate. + p_terminates = False + break + else: + # didn't break from the loop, + # so every symbol s terminates + # so production p terminates. + p_terminates = True + + if p_terminates: + # symbol n terminates! + if not terminates[n]: + terminates[n] = True + some_change = True + # Don't need to consider any more productions for this n. + break + + if not some_change: + break + + infinite = [] + for (s, term) in terminates.items(): + if not term: + if s not in self.Prodnames and s not in self.Terminals and s != 'error': + # s is used-but-not-defined, and we've already warned of that, + # so it would be overkill to say that it's also non-terminating. + pass + else: + infinite.append(s) + + return infinite + + # ----------------------------------------------------------------------------- + # undefined_symbols() + # + # Find all symbols that were used the grammar, but not defined as tokens or + # grammar rules. Returns a list of tuples (sym, prod) where sym in the symbol + # and prod is the production where the symbol was used. + # ----------------------------------------------------------------------------- + def undefined_symbols(self): + result = [] + for p in self.Productions: + if not p: + continue + + for s in p.prod: + if s not in self.Prodnames and s not in self.Terminals and s != 'error': + result.append((s, p)) + return result + + # ----------------------------------------------------------------------------- + # unused_terminals() + # + # Find all terminals that were defined, but not used by the grammar. Returns + # a list of all symbols. + # ----------------------------------------------------------------------------- + def unused_terminals(self): + unused_tok = [] + for s, v in self.Terminals.items(): + if s != 'error' and not v: + unused_tok.append(s) + + return unused_tok + + # ------------------------------------------------------------------------------ + # unused_rules() + # + # Find all grammar rules that were defined, but not used (maybe not reachable) + # Returns a list of productions. + # ------------------------------------------------------------------------------ + + def unused_rules(self): + unused_prod = [] + for s, v in self.Nonterminals.items(): + if not v: + p = self.Prodnames[s][0] + unused_prod.append(p) + return unused_prod + + # ----------------------------------------------------------------------------- + # unused_precedence() + # + # Returns a list of tuples (term,precedence) corresponding to precedence + # rules that were never used by the grammar. term is the name of the terminal + # on which precedence was applied and precedence is a string such as 'left' or + # 'right' corresponding to the type of precedence. + # ----------------------------------------------------------------------------- + + def unused_precedence(self): + unused = [] + for termname in self.Precedence: + if not (termname in self.Terminals or termname in self.UsedPrecedence): + unused.append((termname, self.Precedence[termname][0])) + + return unused + + # ------------------------------------------------------------------------- + # _first() + # + # Compute the value of FIRST1(beta) where beta is a tuple of symbols. + # + # During execution of compute_first1, the result may be incomplete. + # Afterward (e.g., when called from compute_follow()), it will be complete. + # ------------------------------------------------------------------------- + def _first(self, beta): + + # We are computing First(x1,x2,x3,...,xn) + result = [] + for x in beta: + x_produces_empty = False + + # Add all the non- symbols of First[x] to the result. + for f in self.First[x]: + if f == '': + x_produces_empty = True + else: + if f not in result: + result.append(f) + + if x_produces_empty: + # We have to consider the next x in beta, + # i.e. stay in the loop. + pass + else: + # We don't have to consider any further symbols in beta. + break + else: + # There was no 'break' from the loop, + # so x_produces_empty was true for all x in beta, + # so beta produces empty as well. + result.append('') + + return result + + # ------------------------------------------------------------------------- + # compute_first() + # + # Compute the value of FIRST1(X) for all symbols + # ------------------------------------------------------------------------- + def compute_first(self): + if self.First: + return self.First + + # Terminals: + for t in self.Terminals: + self.First[t] = [t] + + self.First['$end'] = ['$end'] + + # Nonterminals: + + # Initialize to the empty set: + for n in self.Nonterminals: + self.First[n] = [] + + # Then propagate symbols until no change: + while True: + some_change = False + for n in self.Nonterminals: + for p in self.Prodnames[n]: + for f in self._first(p.prod): + if f not in self.First[n]: + self.First[n].append(f) + some_change = True + if not some_change: + break + + return self.First + + # --------------------------------------------------------------------- + # compute_follow() + # + # Computes all of the follow sets for every non-terminal symbol. The + # follow set is the set of all symbols that might follow a given + # non-terminal. See the Dragon book, 2nd Ed. p. 189. + # --------------------------------------------------------------------- + def compute_follow(self, start=None): + # If already computed, return the result + if self.Follow: + return self.Follow + + # If first sets not computed yet, do that first. + if not self.First: + self.compute_first() + + # Add '$end' to the follow list of the start symbol + for k in self.Nonterminals: + self.Follow[k] = [] + + if not start: + start = self.Productions[1].name + + self.Follow[start] = ['$end'] + + while True: + didadd = False + for p in self.Productions[1:]: + # Here is the production set + for i, B in enumerate(p.prod): + if B in self.Nonterminals: + # Okay. We got a non-terminal in a production + fst = self._first(p.prod[i+1:]) + hasempty = False + for f in fst: + if f != '' and f not in self.Follow[B]: + self.Follow[B].append(f) + didadd = True + if f == '': + hasempty = True + if hasempty or i == (len(p.prod)-1): + # Add elements of follow(a) to follow(b) + for f in self.Follow[p.name]: + if f not in self.Follow[B]: + self.Follow[B].append(f) + didadd = True + if not didadd: + break + return self.Follow + + + # ----------------------------------------------------------------------------- + # build_lritems() + # + # This function walks the list of productions and builds a complete set of the + # LR items. The LR items are stored in two ways: First, they are uniquely + # numbered and placed in the list _lritems. Second, a linked list of LR items + # is built for each production. For example: + # + # E -> E PLUS E + # + # Creates the list + # + # [E -> . E PLUS E, E -> E . PLUS E, E -> E PLUS . E, E -> E PLUS E . ] + # ----------------------------------------------------------------------------- + + def build_lritems(self): + for p in self.Productions: + lastlri = p + i = 0 + lr_items = [] + while True: + if i > len(p): + lri = None + else: + lri = LRItem(p, i) + # Precompute the list of productions immediately following + try: + lri.lr_after = self.Prodnames[lri.prod[i+1]] + except (IndexError, KeyError): + lri.lr_after = [] + try: + lri.lr_before = lri.prod[i-1] + except IndexError: + lri.lr_before = None + + lastlri.lr_next = lri + if not lri: + break + lr_items.append(lri) + lastlri = lri + i += 1 + p.lr_items = lr_items + +# ----------------------------------------------------------------------------- +# == Class LRTable == +# +# This basic class represents a basic table of LR parsing information. +# Methods for generating the tables are not defined here. They are defined +# in the derived class LRGeneratedTable. +# ----------------------------------------------------------------------------- + +class VersionError(YaccError): + pass + +class LRTable(object): + def __init__(self): + self.lr_action = None + self.lr_goto = None + self.lr_productions = None + self.lr_method = None + + def read_table(self, module): + if isinstance(module, types.ModuleType): + parsetab = module + else: + exec('import %s' % module) + parsetab = sys.modules[module] + + if parsetab._tabversion != __tabversion__: + raise VersionError('yacc table file version is out of date') + + self.lr_action = parsetab._lr_action + self.lr_goto = parsetab._lr_goto + + self.lr_productions = [] + for p in parsetab._lr_productions: + self.lr_productions.append(MiniProduction(*p)) + + self.lr_method = parsetab._lr_method + return parsetab._lr_signature + + def read_pickle(self, filename): + try: + import cPickle as pickle + except ImportError: + import pickle + + if not os.path.exists(filename): + raise ImportError + + in_f = open(filename, 'rb') + + tabversion = pickle.load(in_f) + if tabversion != __tabversion__: + raise VersionError('yacc table file version is out of date') + self.lr_method = pickle.load(in_f) + signature = pickle.load(in_f) + self.lr_action = pickle.load(in_f) + self.lr_goto = pickle.load(in_f) + productions = pickle.load(in_f) + + self.lr_productions = [] + for p in productions: + self.lr_productions.append(MiniProduction(*p)) + + in_f.close() + return signature + + # Bind all production function names to callable objects in pdict + def bind_callables(self, pdict): + for p in self.lr_productions: + p.bind(pdict) + + +# ----------------------------------------------------------------------------- +# === LR Generator === +# +# The following classes and functions are used to generate LR parsing tables on +# a grammar. +# ----------------------------------------------------------------------------- + +# ----------------------------------------------------------------------------- +# digraph() +# traverse() +# +# The following two functions are used to compute set valued functions +# of the form: +# +# F(x) = F'(x) U U{F(y) | x R y} +# +# This is used to compute the values of Read() sets as well as FOLLOW sets +# in LALR(1) generation. +# +# Inputs: X - An input set +# R - A relation +# FP - Set-valued function +# ------------------------------------------------------------------------------ + +def digraph(X, R, FP): + N = {} + for x in X: + N[x] = 0 + stack = [] + F = {} + for x in X: + if N[x] == 0: + traverse(x, N, stack, F, X, R, FP) + return F + +def traverse(x, N, stack, F, X, R, FP): + stack.append(x) + d = len(stack) + N[x] = d + F[x] = FP(x) # F(X) <- F'(x) + + rel = R(x) # Get y's related to x + for y in rel: + if N[y] == 0: + traverse(y, N, stack, F, X, R, FP) + N[x] = min(N[x], N[y]) + for a in F.get(y, []): + if a not in F[x]: + F[x].append(a) + if N[x] == d: + N[stack[-1]] = MAXINT + F[stack[-1]] = F[x] + element = stack.pop() + while element != x: + N[stack[-1]] = MAXINT + F[stack[-1]] = F[x] + element = stack.pop() + +class LALRError(YaccError): + pass + +# ----------------------------------------------------------------------------- +# == LRGeneratedTable == +# +# This class implements the LR table generation algorithm. There are no +# public methods except for write() +# ----------------------------------------------------------------------------- + +class LRGeneratedTable(LRTable): + def __init__(self, grammar, method='LALR', log=None): + if method not in ['SLR', 'LALR']: + raise LALRError('Unsupported method %s' % method) + + self.grammar = grammar + self.lr_method = method + + # Set up the logger + if not log: + log = NullLogger() + self.log = log + + # Internal attributes + self.lr_action = {} # Action table + self.lr_goto = {} # Goto table + self.lr_productions = grammar.Productions # Copy of grammar Production array + self.lr_goto_cache = {} # Cache of computed gotos + self.lr0_cidhash = {} # Cache of closures + + self._add_count = 0 # Internal counter used to detect cycles + + # Diagonistic information filled in by the table generator + self.sr_conflict = 0 + self.rr_conflict = 0 + self.conflicts = [] # List of conflicts + + self.sr_conflicts = [] + self.rr_conflicts = [] + + # Build the tables + self.grammar.build_lritems() + self.grammar.compute_first() + self.grammar.compute_follow() + self.lr_parse_table() + + # Compute the LR(0) closure operation on I, where I is a set of LR(0) items. + + def lr0_closure(self, I): + self._add_count += 1 + + # Add everything in I to J + J = I[:] + didadd = True + while didadd: + didadd = False + for j in J: + for x in j.lr_after: + if getattr(x, 'lr0_added', 0) == self._add_count: + continue + # Add B --> .G to J + J.append(x.lr_next) + x.lr0_added = self._add_count + didadd = True + + return J + + # Compute the LR(0) goto function goto(I,X) where I is a set + # of LR(0) items and X is a grammar symbol. This function is written + # in a way that guarantees uniqueness of the generated goto sets + # (i.e. the same goto set will never be returned as two different Python + # objects). With uniqueness, we can later do fast set comparisons using + # id(obj) instead of element-wise comparison. + + def lr0_goto(self, I, x): + # First we look for a previously cached entry + g = self.lr_goto_cache.get((id(I), x)) + if g: + return g + + # Now we generate the goto set in a way that guarantees uniqueness + # of the result + + s = self.lr_goto_cache.get(x) + if not s: + s = {} + self.lr_goto_cache[x] = s + + gs = [] + for p in I: + n = p.lr_next + if n and n.lr_before == x: + s1 = s.get(id(n)) + if not s1: + s1 = {} + s[id(n)] = s1 + gs.append(n) + s = s1 + g = s.get('$end') + if not g: + if gs: + g = self.lr0_closure(gs) + s['$end'] = g + else: + s['$end'] = gs + self.lr_goto_cache[(id(I), x)] = g + return g + + # Compute the LR(0) sets of item function + def lr0_items(self): + C = [self.lr0_closure([self.grammar.Productions[0].lr_next])] + i = 0 + for I in C: + self.lr0_cidhash[id(I)] = i + i += 1 + + # Loop over the items in C and each grammar symbols + i = 0 + while i < len(C): + I = C[i] + i += 1 + + # Collect all of the symbols that could possibly be in the goto(I,X) sets + asyms = {} + for ii in I: + for s in ii.usyms: + asyms[s] = None + + for x in asyms: + g = self.lr0_goto(I, x) + if not g or id(g) in self.lr0_cidhash: + continue + self.lr0_cidhash[id(g)] = len(C) + C.append(g) + + return C + + # ----------------------------------------------------------------------------- + # ==== LALR(1) Parsing ==== + # + # LALR(1) parsing is almost exactly the same as SLR except that instead of + # relying upon Follow() sets when performing reductions, a more selective + # lookahead set that incorporates the state of the LR(0) machine is utilized. + # Thus, we mainly just have to focus on calculating the lookahead sets. + # + # The method used here is due to DeRemer and Pennelo (1982). + # + # DeRemer, F. L., and T. J. Pennelo: "Efficient Computation of LALR(1) + # Lookahead Sets", ACM Transactions on Programming Languages and Systems, + # Vol. 4, No. 4, Oct. 1982, pp. 615-649 + # + # Further details can also be found in: + # + # J. Tremblay and P. Sorenson, "The Theory and Practice of Compiler Writing", + # McGraw-Hill Book Company, (1985). + # + # ----------------------------------------------------------------------------- + + # ----------------------------------------------------------------------------- + # compute_nullable_nonterminals() + # + # Creates a dictionary containing all of the non-terminals that might produce + # an empty production. + # ----------------------------------------------------------------------------- + + def compute_nullable_nonterminals(self): + nullable = set() + num_nullable = 0 + while True: + for p in self.grammar.Productions[1:]: + if p.len == 0: + nullable.add(p.name) + continue + for t in p.prod: + if t not in nullable: + break + else: + nullable.add(p.name) + if len(nullable) == num_nullable: + break + num_nullable = len(nullable) + return nullable + + # ----------------------------------------------------------------------------- + # find_nonterminal_trans(C) + # + # Given a set of LR(0) items, this functions finds all of the non-terminal + # transitions. These are transitions in which a dot appears immediately before + # a non-terminal. Returns a list of tuples of the form (state,N) where state + # is the state number and N is the nonterminal symbol. + # + # The input C is the set of LR(0) items. + # ----------------------------------------------------------------------------- + + def find_nonterminal_transitions(self, C): + trans = [] + for stateno, state in enumerate(C): + for p in state: + if p.lr_index < p.len - 1: + t = (stateno, p.prod[p.lr_index+1]) + if t[1] in self.grammar.Nonterminals: + if t not in trans: + trans.append(t) + return trans + + # ----------------------------------------------------------------------------- + # dr_relation() + # + # Computes the DR(p,A) relationships for non-terminal transitions. The input + # is a tuple (state,N) where state is a number and N is a nonterminal symbol. + # + # Returns a list of terminals. + # ----------------------------------------------------------------------------- + + def dr_relation(self, C, trans, nullable): + dr_set = {} + state, N = trans + terms = [] + + g = self.lr0_goto(C[state], N) + for p in g: + if p.lr_index < p.len - 1: + a = p.prod[p.lr_index+1] + if a in self.grammar.Terminals: + if a not in terms: + terms.append(a) + + # This extra bit is to handle the start state + if state == 0 and N == self.grammar.Productions[0].prod[0]: + terms.append('$end') + + return terms + + # ----------------------------------------------------------------------------- + # reads_relation() + # + # Computes the READS() relation (p,A) READS (t,C). + # ----------------------------------------------------------------------------- + + def reads_relation(self, C, trans, empty): + # Look for empty transitions + rel = [] + state, N = trans + + g = self.lr0_goto(C[state], N) + j = self.lr0_cidhash.get(id(g), -1) + for p in g: + if p.lr_index < p.len - 1: + a = p.prod[p.lr_index + 1] + if a in empty: + rel.append((j, a)) + + return rel + + # ----------------------------------------------------------------------------- + # compute_lookback_includes() + # + # Determines the lookback and includes relations + # + # LOOKBACK: + # + # This relation is determined by running the LR(0) state machine forward. + # For example, starting with a production "N : . A B C", we run it forward + # to obtain "N : A B C ." We then build a relationship between this final + # state and the starting state. These relationships are stored in a dictionary + # lookdict. + # + # INCLUDES: + # + # Computes the INCLUDE() relation (p,A) INCLUDES (p',B). + # + # This relation is used to determine non-terminal transitions that occur + # inside of other non-terminal transition states. (p,A) INCLUDES (p', B) + # if the following holds: + # + # B -> LAT, where T -> epsilon and p' -L-> p + # + # L is essentially a prefix (which may be empty), T is a suffix that must be + # able to derive an empty string. State p' must lead to state p with the string L. + # + # ----------------------------------------------------------------------------- + + def compute_lookback_includes(self, C, trans, nullable): + lookdict = {} # Dictionary of lookback relations + includedict = {} # Dictionary of include relations + + # Make a dictionary of non-terminal transitions + dtrans = {} + for t in trans: + dtrans[t] = 1 + + # Loop over all transitions and compute lookbacks and includes + for state, N in trans: + lookb = [] + includes = [] + for p in C[state]: + if p.name != N: + continue + + # Okay, we have a name match. We now follow the production all the way + # through the state machine until we get the . on the right hand side + + lr_index = p.lr_index + j = state + while lr_index < p.len - 1: + lr_index = lr_index + 1 + t = p.prod[lr_index] + + # Check to see if this symbol and state are a non-terminal transition + if (j, t) in dtrans: + # Yes. Okay, there is some chance that this is an includes relation + # the only way to know for certain is whether the rest of the + # production derives empty + + li = lr_index + 1 + while li < p.len: + if p.prod[li] in self.grammar.Terminals: + break # No forget it + if p.prod[li] not in nullable: + break + li = li + 1 + else: + # Appears to be a relation between (j,t) and (state,N) + includes.append((j, t)) + + g = self.lr0_goto(C[j], t) # Go to next set + j = self.lr0_cidhash.get(id(g), -1) # Go to next state + + # When we get here, j is the final state, now we have to locate the production + for r in C[j]: + if r.name != p.name: + continue + if r.len != p.len: + continue + i = 0 + # This look is comparing a production ". A B C" with "A B C ." + while i < r.lr_index: + if r.prod[i] != p.prod[i+1]: + break + i = i + 1 + else: + lookb.append((j, r)) + for i in includes: + if i not in includedict: + includedict[i] = [] + includedict[i].append((state, N)) + lookdict[(state, N)] = lookb + + return lookdict, includedict + + # ----------------------------------------------------------------------------- + # compute_read_sets() + # + # Given a set of LR(0) items, this function computes the read sets. + # + # Inputs: C = Set of LR(0) items + # ntrans = Set of nonterminal transitions + # nullable = Set of empty transitions + # + # Returns a set containing the read sets + # ----------------------------------------------------------------------------- + + def compute_read_sets(self, C, ntrans, nullable): + FP = lambda x: self.dr_relation(C, x, nullable) + R = lambda x: self.reads_relation(C, x, nullable) + F = digraph(ntrans, R, FP) + return F + + # ----------------------------------------------------------------------------- + # compute_follow_sets() + # + # Given a set of LR(0) items, a set of non-terminal transitions, a readset, + # and an include set, this function computes the follow sets + # + # Follow(p,A) = Read(p,A) U U {Follow(p',B) | (p,A) INCLUDES (p',B)} + # + # Inputs: + # ntrans = Set of nonterminal transitions + # readsets = Readset (previously computed) + # inclsets = Include sets (previously computed) + # + # Returns a set containing the follow sets + # ----------------------------------------------------------------------------- + + def compute_follow_sets(self, ntrans, readsets, inclsets): + FP = lambda x: readsets[x] + R = lambda x: inclsets.get(x, []) + F = digraph(ntrans, R, FP) + return F + + # ----------------------------------------------------------------------------- + # add_lookaheads() + # + # Attaches the lookahead symbols to grammar rules. + # + # Inputs: lookbacks - Set of lookback relations + # followset - Computed follow set + # + # This function directly attaches the lookaheads to productions contained + # in the lookbacks set + # ----------------------------------------------------------------------------- + + def add_lookaheads(self, lookbacks, followset): + for trans, lb in lookbacks.items(): + # Loop over productions in lookback + for state, p in lb: + if state not in p.lookaheads: + p.lookaheads[state] = [] + f = followset.get(trans, []) + for a in f: + if a not in p.lookaheads[state]: + p.lookaheads[state].append(a) + + # ----------------------------------------------------------------------------- + # add_lalr_lookaheads() + # + # This function does all of the work of adding lookahead information for use + # with LALR parsing + # ----------------------------------------------------------------------------- + + def add_lalr_lookaheads(self, C): + # Determine all of the nullable nonterminals + nullable = self.compute_nullable_nonterminals() + + # Find all non-terminal transitions + trans = self.find_nonterminal_transitions(C) + + # Compute read sets + readsets = self.compute_read_sets(C, trans, nullable) + + # Compute lookback/includes relations + lookd, included = self.compute_lookback_includes(C, trans, nullable) + + # Compute LALR FOLLOW sets + followsets = self.compute_follow_sets(trans, readsets, included) + + # Add all of the lookaheads + self.add_lookaheads(lookd, followsets) + + # ----------------------------------------------------------------------------- + # lr_parse_table() + # + # This function constructs the parse tables for SLR or LALR + # ----------------------------------------------------------------------------- + def lr_parse_table(self): + Productions = self.grammar.Productions + Precedence = self.grammar.Precedence + goto = self.lr_goto # Goto array + action = self.lr_action # Action array + log = self.log # Logger for output + + actionp = {} # Action production array (temporary) + + log.info('Parsing method: %s', self.lr_method) + + # Step 1: Construct C = { I0, I1, ... IN}, collection of LR(0) items + # This determines the number of states + + C = self.lr0_items() + + if self.lr_method == 'LALR': + self.add_lalr_lookaheads(C) + + # Build the parser table, state by state + st = 0 + for I in C: + # Loop over each production in I + actlist = [] # List of actions + st_action = {} + st_actionp = {} + st_goto = {} + log.info('') + log.info('state %d', st) + log.info('') + for p in I: + log.info(' (%d) %s', p.number, p) + log.info('') + + for p in I: + if p.len == p.lr_index + 1: + if p.name == "S'": + # Start symbol. Accept! + st_action['$end'] = 0 + st_actionp['$end'] = p + else: + # We are at the end of a production. Reduce! + if self.lr_method == 'LALR': + laheads = p.lookaheads[st] + else: + laheads = self.grammar.Follow[p.name] + for a in laheads: + actlist.append((a, p, 'reduce using rule %d (%s)' % (p.number, p))) + r = st_action.get(a) + if r is not None: + # Whoa. Have a shift/reduce or reduce/reduce conflict + if r > 0: + # Need to decide on shift or reduce here + # By default we favor shifting. Need to add + # some precedence rules here. + + # Shift precedence comes from the token + sprec, slevel = Precedence.get(a, ('right', 0)) + + # Reduce precedence comes from rule being reduced (p) + rprec, rlevel = Productions[p.number].prec + + if (slevel < rlevel) or ((slevel == rlevel) and (rprec == 'left')): + # We really need to reduce here. + st_action[a] = -p.number + st_actionp[a] = p + if not slevel and not rlevel: + log.info(' ! shift/reduce conflict for %s resolved as reduce', a) + self.sr_conflicts.append((st, a, 'reduce')) + Productions[p.number].reduced += 1 + elif (slevel == rlevel) and (rprec == 'nonassoc'): + st_action[a] = None + else: + # Hmmm. Guess we'll keep the shift + if not rlevel: + log.info(' ! shift/reduce conflict for %s resolved as shift', a) + self.sr_conflicts.append((st, a, 'shift')) + elif r < 0: + # Reduce/reduce conflict. In this case, we favor the rule + # that was defined first in the grammar file + oldp = Productions[-r] + pp = Productions[p.number] + if oldp.line > pp.line: + st_action[a] = -p.number + st_actionp[a] = p + chosenp, rejectp = pp, oldp + Productions[p.number].reduced += 1 + Productions[oldp.number].reduced -= 1 + else: + chosenp, rejectp = oldp, pp + self.rr_conflicts.append((st, chosenp, rejectp)) + log.info(' ! reduce/reduce conflict for %s resolved using rule %d (%s)', + a, st_actionp[a].number, st_actionp[a]) + else: + raise LALRError('Unknown conflict in state %d' % st) + else: + st_action[a] = -p.number + st_actionp[a] = p + Productions[p.number].reduced += 1 + else: + i = p.lr_index + a = p.prod[i+1] # Get symbol right after the "." + if a in self.grammar.Terminals: + g = self.lr0_goto(I, a) + j = self.lr0_cidhash.get(id(g), -1) + if j >= 0: + # We are in a shift state + actlist.append((a, p, 'shift and go to state %d' % j)) + r = st_action.get(a) + if r is not None: + # Whoa have a shift/reduce or shift/shift conflict + if r > 0: + if r != j: + raise LALRError('Shift/shift conflict in state %d' % st) + elif r < 0: + # Do a precedence check. + # - if precedence of reduce rule is higher, we reduce. + # - if precedence of reduce is same and left assoc, we reduce. + # - otherwise we shift + + # Shift precedence comes from the token + sprec, slevel = Precedence.get(a, ('right', 0)) + + # Reduce precedence comes from the rule that could have been reduced + rprec, rlevel = Productions[st_actionp[a].number].prec + + if (slevel > rlevel) or ((slevel == rlevel) and (rprec == 'right')): + # We decide to shift here... highest precedence to shift + Productions[st_actionp[a].number].reduced -= 1 + st_action[a] = j + st_actionp[a] = p + if not rlevel: + log.info(' ! shift/reduce conflict for %s resolved as shift', a) + self.sr_conflicts.append((st, a, 'shift')) + elif (slevel == rlevel) and (rprec == 'nonassoc'): + st_action[a] = None + else: + # Hmmm. Guess we'll keep the reduce + if not slevel and not rlevel: + log.info(' ! shift/reduce conflict for %s resolved as reduce', a) + self.sr_conflicts.append((st, a, 'reduce')) + + else: + raise LALRError('Unknown conflict in state %d' % st) + else: + st_action[a] = j + st_actionp[a] = p + + # Print the actions associated with each terminal + _actprint = {} + for a, p, m in actlist: + if a in st_action: + if p is st_actionp[a]: + log.info(' %-15s %s', a, m) + _actprint[(a, m)] = 1 + log.info('') + # Print the actions that were not used. (debugging) + not_used = 0 + for a, p, m in actlist: + if a in st_action: + if p is not st_actionp[a]: + if not (a, m) in _actprint: + log.debug(' ! %-15s [ %s ]', a, m) + not_used = 1 + _actprint[(a, m)] = 1 + if not_used: + log.debug('') + + # Construct the goto table for this state + + nkeys = {} + for ii in I: + for s in ii.usyms: + if s in self.grammar.Nonterminals: + nkeys[s] = None + for n in nkeys: + g = self.lr0_goto(I, n) + j = self.lr0_cidhash.get(id(g), -1) + if j >= 0: + st_goto[n] = j + log.info(' %-30s shift and go to state %d', n, j) + + action[st] = st_action + actionp[st] = st_actionp + goto[st] = st_goto + st += 1 + + # ----------------------------------------------------------------------------- + # write() + # + # This function writes the LR parsing tables to a file + # ----------------------------------------------------------------------------- + + def write_table(self, tabmodule, outputdir='', signature=''): + if isinstance(tabmodule, types.ModuleType): + raise IOError("Won't overwrite existing tabmodule") + + basemodulename = tabmodule.split('.')[-1] + filename = os.path.join(outputdir, basemodulename) + '.py' + try: + f = open(filename, 'w') + + f.write(''' +# %s +# This file is automatically generated. Do not edit. +_tabversion = %r + +_lr_method = %r + +_lr_signature = %r + ''' % (os.path.basename(filename), __tabversion__, self.lr_method, signature)) + + # Change smaller to 0 to go back to original tables + smaller = 1 + + # Factor out names to try and make smaller + if smaller: + items = {} + + for s, nd in self.lr_action.items(): + for name, v in nd.items(): + i = items.get(name) + if not i: + i = ([], []) + items[name] = i + i[0].append(s) + i[1].append(v) + + f.write('\n_lr_action_items = {') + for k, v in items.items(): + f.write('%r:([' % k) + for i in v[0]: + f.write('%r,' % i) + f.write('],[') + for i in v[1]: + f.write('%r,' % i) + + f.write(']),') + f.write('}\n') + + f.write(''' +_lr_action = {} +for _k, _v in _lr_action_items.items(): + for _x,_y in zip(_v[0],_v[1]): + if not _x in _lr_action: _lr_action[_x] = {} + _lr_action[_x][_k] = _y +del _lr_action_items +''') + + else: + f.write('\n_lr_action = { ') + for k, v in self.lr_action.items(): + f.write('(%r,%r):%r,' % (k[0], k[1], v)) + f.write('}\n') + + if smaller: + # Factor out names to try and make smaller + items = {} + + for s, nd in self.lr_goto.items(): + for name, v in nd.items(): + i = items.get(name) + if not i: + i = ([], []) + items[name] = i + i[0].append(s) + i[1].append(v) + + f.write('\n_lr_goto_items = {') + for k, v in items.items(): + f.write('%r:([' % k) + for i in v[0]: + f.write('%r,' % i) + f.write('],[') + for i in v[1]: + f.write('%r,' % i) + + f.write(']),') + f.write('}\n') + + f.write(''' +_lr_goto = {} +for _k, _v in _lr_goto_items.items(): + for _x, _y in zip(_v[0], _v[1]): + if not _x in _lr_goto: _lr_goto[_x] = {} + _lr_goto[_x][_k] = _y +del _lr_goto_items +''') + else: + f.write('\n_lr_goto = { ') + for k, v in self.lr_goto.items(): + f.write('(%r,%r):%r,' % (k[0], k[1], v)) + f.write('}\n') + + # Write production table + f.write('_lr_productions = [\n') + for p in self.lr_productions: + if p.func: + f.write(' (%r,%r,%d,%r,%r,%d),\n' % (p.str, p.name, p.len, + p.func, os.path.basename(p.file), p.line)) + else: + f.write(' (%r,%r,%d,None,None,None),\n' % (str(p), p.name, p.len)) + f.write(']\n') + f.close() + + except IOError as e: + raise + + + # ----------------------------------------------------------------------------- + # pickle_table() + # + # This function pickles the LR parsing tables to a supplied file object + # ----------------------------------------------------------------------------- + + def pickle_table(self, filename, signature=''): + try: + import cPickle as pickle + except ImportError: + import pickle + with open(filename, 'wb') as outf: + pickle.dump(__tabversion__, outf, pickle_protocol) + pickle.dump(self.lr_method, outf, pickle_protocol) + pickle.dump(signature, outf, pickle_protocol) + pickle.dump(self.lr_action, outf, pickle_protocol) + pickle.dump(self.lr_goto, outf, pickle_protocol) + + outp = [] + for p in self.lr_productions: + if p.func: + outp.append((p.str, p.name, p.len, p.func, os.path.basename(p.file), p.line)) + else: + outp.append((str(p), p.name, p.len, None, None, None)) + pickle.dump(outp, outf, pickle_protocol) + +# ----------------------------------------------------------------------------- +# === INTROSPECTION === +# +# The following functions and classes are used to implement the PLY +# introspection features followed by the yacc() function itself. +# ----------------------------------------------------------------------------- + +# ----------------------------------------------------------------------------- +# get_caller_module_dict() +# +# This function returns a dictionary containing all of the symbols defined within +# a caller further down the call stack. This is used to get the environment +# associated with the yacc() call if none was provided. +# ----------------------------------------------------------------------------- + +def get_caller_module_dict(levels): + f = sys._getframe(levels) + ldict = f.f_globals.copy() + if f.f_globals != f.f_locals: + ldict.update(f.f_locals) + return ldict + +# ----------------------------------------------------------------------------- +# parse_grammar() +# +# This takes a raw grammar rule string and parses it into production data +# ----------------------------------------------------------------------------- +def parse_grammar(doc, file, line): + grammar = [] + # Split the doc string into lines + pstrings = doc.splitlines() + lastp = None + dline = line + for ps in pstrings: + dline += 1 + p = ps.split() + if not p: + continue + try: + if p[0] == '|': + # This is a continuation of a previous rule + if not lastp: + raise SyntaxError("%s:%d: Misplaced '|'" % (file, dline)) + prodname = lastp + syms = p[1:] + else: + prodname = p[0] + lastp = prodname + syms = p[2:] + assign = p[1] + if assign != ':' and assign != '::=': + raise SyntaxError("%s:%d: Syntax error. Expected ':'" % (file, dline)) + + grammar.append((file, dline, prodname, syms)) + except SyntaxError: + raise + except Exception: + raise SyntaxError('%s:%d: Syntax error in rule %r' % (file, dline, ps.strip())) + + return grammar + +# ----------------------------------------------------------------------------- +# ParserReflect() +# +# This class represents information extracted for building a parser including +# start symbol, error function, tokens, precedence list, action functions, +# etc. +# ----------------------------------------------------------------------------- +class ParserReflect(object): + def __init__(self, pdict, log=None): + self.pdict = pdict + self.start = None + self.error_func = None + self.tokens = None + self.modules = set() + self.grammar = [] + self.error = False + + if log is None: + self.log = PlyLogger(sys.stderr) + else: + self.log = log + + # Get all of the basic information + def get_all(self): + self.get_start() + self.get_error_func() + self.get_tokens() + self.get_precedence() + self.get_pfunctions() + + # Validate all of the information + def validate_all(self): + self.validate_start() + self.validate_error_func() + self.validate_tokens() + self.validate_precedence() + self.validate_pfunctions() + self.validate_modules() + return self.error + + # Compute a signature over the grammar + def signature(self): + parts = [] + try: + if self.start: + parts.append(self.start) + if self.prec: + parts.append(''.join([''.join(p) for p in self.prec])) + if self.tokens: + parts.append(' '.join(self.tokens)) + for f in self.pfuncs: + if f[3]: + parts.append(f[3]) + except (TypeError, ValueError): + pass + return ''.join(parts) + + # ----------------------------------------------------------------------------- + # validate_modules() + # + # This method checks to see if there are duplicated p_rulename() functions + # in the parser module file. Without this function, it is really easy for + # users to make mistakes by cutting and pasting code fragments (and it's a real + # bugger to try and figure out why the resulting parser doesn't work). Therefore, + # we just do a little regular expression pattern matching of def statements + # to try and detect duplicates. + # ----------------------------------------------------------------------------- + + def validate_modules(self): + # Match def p_funcname( + fre = re.compile(r'\s*def\s+(p_[a-zA-Z_0-9]*)\(') + + for module in self.modules: + try: + lines, linen = inspect.getsourcelines(module) + except IOError: + continue + + counthash = {} + for linen, line in enumerate(lines): + linen += 1 + m = fre.match(line) + if m: + name = m.group(1) + prev = counthash.get(name) + if not prev: + counthash[name] = linen + else: + filename = inspect.getsourcefile(module) + self.log.warning('%s:%d: Function %s redefined. Previously defined on line %d', + filename, linen, name, prev) + + # Get the start symbol + def get_start(self): + self.start = self.pdict.get('start') + + # Validate the start symbol + def validate_start(self): + if self.start is not None: + if not isinstance(self.start, string_types): + self.log.error("'start' must be a string") + + # Look for error handler + def get_error_func(self): + self.error_func = self.pdict.get('p_error') + + # Validate the error function + def validate_error_func(self): + if self.error_func: + if isinstance(self.error_func, types.FunctionType): + ismethod = 0 + elif isinstance(self.error_func, types.MethodType): + ismethod = 1 + else: + self.log.error("'p_error' defined, but is not a function or method") + self.error = True + return + + eline = self.error_func.__code__.co_firstlineno + efile = self.error_func.__code__.co_filename + module = inspect.getmodule(self.error_func) + self.modules.add(module) + + argcount = self.error_func.__code__.co_argcount - ismethod + if argcount != 1: + self.log.error('%s:%d: p_error() requires 1 argument', efile, eline) + self.error = True + + # Get the tokens map + def get_tokens(self): + tokens = self.pdict.get('tokens') + if not tokens: + self.log.error('No token list is defined') + self.error = True + return + + if not isinstance(tokens, (list, tuple)): + self.log.error('tokens must be a list or tuple') + self.error = True + return + + if not tokens: + self.log.error('tokens is empty') + self.error = True + return + + self.tokens = tokens + + # Validate the tokens + def validate_tokens(self): + # Validate the tokens. + if 'error' in self.tokens: + self.log.error("Illegal token name 'error'. Is a reserved word") + self.error = True + return + + terminals = set() + for n in self.tokens: + if n in terminals: + self.log.warning('Token %r multiply defined', n) + terminals.add(n) + + # Get the precedence map (if any) + def get_precedence(self): + self.prec = self.pdict.get('precedence') + + # Validate and parse the precedence map + def validate_precedence(self): + preclist = [] + if self.prec: + if not isinstance(self.prec, (list, tuple)): + self.log.error('precedence must be a list or tuple') + self.error = True + return + for level, p in enumerate(self.prec): + if not isinstance(p, (list, tuple)): + self.log.error('Bad precedence table') + self.error = True + return + + if len(p) < 2: + self.log.error('Malformed precedence entry %s. Must be (assoc, term, ..., term)', p) + self.error = True + return + assoc = p[0] + if not isinstance(assoc, string_types): + self.log.error('precedence associativity must be a string') + self.error = True + return + for term in p[1:]: + if not isinstance(term, string_types): + self.log.error('precedence items must be strings') + self.error = True + return + preclist.append((term, assoc, level+1)) + self.preclist = preclist + + # Get all p_functions from the grammar + def get_pfunctions(self): + p_functions = [] + for name, item in self.pdict.items(): + if not name.startswith('p_') or name == 'p_error': + continue + if isinstance(item, (types.FunctionType, types.MethodType)): + line = getattr(item, 'co_firstlineno', item.__code__.co_firstlineno) + module = inspect.getmodule(item) + p_functions.append((line, module, name, item.__doc__)) + + # Sort all of the actions by line number; make sure to stringify + # modules to make them sortable, since `line` may not uniquely sort all + # p functions + p_functions.sort(key=lambda p_function: ( + p_function[0], + str(p_function[1]), + p_function[2], + p_function[3])) + self.pfuncs = p_functions + + # Validate all of the p_functions + def validate_pfunctions(self): + grammar = [] + # Check for non-empty symbols + if len(self.pfuncs) == 0: + self.log.error('no rules of the form p_rulename are defined') + self.error = True + return + + for line, module, name, doc in self.pfuncs: + file = inspect.getsourcefile(module) + func = self.pdict[name] + if isinstance(func, types.MethodType): + reqargs = 2 + else: + reqargs = 1 + if func.__code__.co_argcount > reqargs: + self.log.error('%s:%d: Rule %r has too many arguments', file, line, func.__name__) + self.error = True + elif func.__code__.co_argcount < reqargs: + self.log.error('%s:%d: Rule %r requires an argument', file, line, func.__name__) + self.error = True + elif not func.__doc__: + self.log.warning('%s:%d: No documentation string specified in function %r (ignored)', + file, line, func.__name__) + else: + try: + parsed_g = parse_grammar(doc, file, line) + for g in parsed_g: + grammar.append((name, g)) + except SyntaxError as e: + self.log.error(str(e)) + self.error = True + + # Looks like a valid grammar rule + # Mark the file in which defined. + self.modules.add(module) + + # Secondary validation step that looks for p_ definitions that are not functions + # or functions that look like they might be grammar rules. + + for n, v in self.pdict.items(): + if n.startswith('p_') and isinstance(v, (types.FunctionType, types.MethodType)): + continue + if n.startswith('t_'): + continue + if n.startswith('p_') and n != 'p_error': + self.log.warning('%r not defined as a function', n) + if ((isinstance(v, types.FunctionType) and v.__code__.co_argcount == 1) or + (isinstance(v, types.MethodType) and v.__func__.__code__.co_argcount == 2)): + if v.__doc__: + try: + doc = v.__doc__.split(' ') + if doc[1] == ':': + self.log.warning('%s:%d: Possible grammar rule %r defined without p_ prefix', + v.__code__.co_filename, v.__code__.co_firstlineno, n) + except IndexError: + pass + + self.grammar = grammar + +# ----------------------------------------------------------------------------- +# yacc(module) +# +# Build a parser +# ----------------------------------------------------------------------------- + +def yacc(method='LALR', debug=yaccdebug, module=None, tabmodule=tab_module, start=None, + check_recursion=True, optimize=False, write_tables=True, debugfile=debug_file, + outputdir=None, debuglog=None, errorlog=None, picklefile=None): + + if tabmodule is None: + tabmodule = tab_module + + # Reference to the parsing method of the last built parser + global parse + + # If pickling is enabled, table files are not created + if picklefile: + write_tables = 0 + + if errorlog is None: + errorlog = PlyLogger(sys.stderr) + + # Get the module dictionary used for the parser + if module: + _items = [(k, getattr(module, k)) for k in dir(module)] + pdict = dict(_items) + # If no __file__ attribute is available, try to obtain it from the __module__ instead + if '__file__' not in pdict: + pdict['__file__'] = sys.modules[pdict['__module__']].__file__ + else: + pdict = get_caller_module_dict(2) + + if outputdir is None: + # If no output directory is set, the location of the output files + # is determined according to the following rules: + # - If tabmodule specifies a package, files go into that package directory + # - Otherwise, files go in the same directory as the specifying module + if isinstance(tabmodule, types.ModuleType): + srcfile = tabmodule.__file__ + else: + if '.' not in tabmodule: + srcfile = pdict['__file__'] + else: + parts = tabmodule.split('.') + pkgname = '.'.join(parts[:-1]) + exec('import %s' % pkgname) + srcfile = getattr(sys.modules[pkgname], '__file__', '') + outputdir = os.path.dirname(srcfile) + + # Determine if the module is package of a package or not. + # If so, fix the tabmodule setting so that tables load correctly + pkg = pdict.get('__package__') + if pkg and isinstance(tabmodule, str): + if '.' not in tabmodule: + tabmodule = pkg + '.' + tabmodule + + + + # Set start symbol if it's specified directly using an argument + if start is not None: + pdict['start'] = start + + # Collect parser information from the dictionary + pinfo = ParserReflect(pdict, log=errorlog) + pinfo.get_all() + + if pinfo.error: + raise YaccError('Unable to build parser') + + # Check signature against table files (if any) + signature = pinfo.signature() + + # Read the tables + try: + lr = LRTable() + if picklefile: + read_signature = lr.read_pickle(picklefile) + else: + read_signature = lr.read_table(tabmodule) + if optimize or (read_signature == signature): + try: + lr.bind_callables(pinfo.pdict) + parser = LRParser(lr, pinfo.error_func) + parse = parser.parse + return parser + except Exception as e: + errorlog.warning('There was a problem loading the table file: %r', e) + except VersionError as e: + errorlog.warning(str(e)) + except ImportError: + pass + + if debuglog is None: + if debug: + try: + debuglog = PlyLogger(open(os.path.join(outputdir, debugfile), 'w')) + except IOError as e: + errorlog.warning("Couldn't open %r. %s" % (debugfile, e)) + debuglog = NullLogger() + else: + debuglog = NullLogger() + + debuglog.info('Created by PLY version %s (http://www.dabeaz.com/ply)', __version__) + + errors = False + + # Validate the parser information + if pinfo.validate_all(): + raise YaccError('Unable to build parser') + + if not pinfo.error_func: + errorlog.warning('no p_error() function is defined') + + # Create a grammar object + grammar = Grammar(pinfo.tokens) + + # Set precedence level for terminals + for term, assoc, level in pinfo.preclist: + try: + grammar.set_precedence(term, assoc, level) + except GrammarError as e: + errorlog.warning('%s', e) + + # Add productions to the grammar + for funcname, gram in pinfo.grammar: + file, line, prodname, syms = gram + try: + grammar.add_production(prodname, syms, funcname, file, line) + except GrammarError as e: + errorlog.error('%s', e) + errors = True + + # Set the grammar start symbols + try: + if start is None: + grammar.set_start(pinfo.start) + else: + grammar.set_start(start) + except GrammarError as e: + errorlog.error(str(e)) + errors = True + + if errors: + raise YaccError('Unable to build parser') + + # Verify the grammar structure + undefined_symbols = grammar.undefined_symbols() + for sym, prod in undefined_symbols: + errorlog.error('%s:%d: Symbol %r used, but not defined as a token or a rule', prod.file, prod.line, sym) + errors = True + + unused_terminals = grammar.unused_terminals() + if unused_terminals: + debuglog.info('') + debuglog.info('Unused terminals:') + debuglog.info('') + for term in unused_terminals: + errorlog.warning('Token %r defined, but not used', term) + debuglog.info(' %s', term) + + # Print out all productions to the debug log + if debug: + debuglog.info('') + debuglog.info('Grammar') + debuglog.info('') + for n, p in enumerate(grammar.Productions): + debuglog.info('Rule %-5d %s', n, p) + + # Find unused non-terminals + unused_rules = grammar.unused_rules() + for prod in unused_rules: + errorlog.warning('%s:%d: Rule %r defined, but not used', prod.file, prod.line, prod.name) + + if len(unused_terminals) == 1: + errorlog.warning('There is 1 unused token') + if len(unused_terminals) > 1: + errorlog.warning('There are %d unused tokens', len(unused_terminals)) + + if len(unused_rules) == 1: + errorlog.warning('There is 1 unused rule') + if len(unused_rules) > 1: + errorlog.warning('There are %d unused rules', len(unused_rules)) + + if debug: + debuglog.info('') + debuglog.info('Terminals, with rules where they appear') + debuglog.info('') + terms = list(grammar.Terminals) + terms.sort() + for term in terms: + debuglog.info('%-20s : %s', term, ' '.join([str(s) for s in grammar.Terminals[term]])) + + debuglog.info('') + debuglog.info('Nonterminals, with rules where they appear') + debuglog.info('') + nonterms = list(grammar.Nonterminals) + nonterms.sort() + for nonterm in nonterms: + debuglog.info('%-20s : %s', nonterm, ' '.join([str(s) for s in grammar.Nonterminals[nonterm]])) + debuglog.info('') + + if check_recursion: + unreachable = grammar.find_unreachable() + for u in unreachable: + errorlog.warning('Symbol %r is unreachable', u) + + infinite = grammar.infinite_cycles() + for inf in infinite: + errorlog.error('Infinite recursion detected for symbol %r', inf) + errors = True + + unused_prec = grammar.unused_precedence() + for term, assoc in unused_prec: + errorlog.error('Precedence rule %r defined for unknown symbol %r', assoc, term) + errors = True + + if errors: + raise YaccError('Unable to build parser') + + # Run the LRGeneratedTable on the grammar + if debug: + errorlog.debug('Generating %s tables', method) + + lr = LRGeneratedTable(grammar, method, debuglog) + + if debug: + num_sr = len(lr.sr_conflicts) + + # Report shift/reduce and reduce/reduce conflicts + if num_sr == 1: + errorlog.warning('1 shift/reduce conflict') + elif num_sr > 1: + errorlog.warning('%d shift/reduce conflicts', num_sr) + + num_rr = len(lr.rr_conflicts) + if num_rr == 1: + errorlog.warning('1 reduce/reduce conflict') + elif num_rr > 1: + errorlog.warning('%d reduce/reduce conflicts', num_rr) + + # Write out conflicts to the output file + if debug and (lr.sr_conflicts or lr.rr_conflicts): + debuglog.warning('') + debuglog.warning('Conflicts:') + debuglog.warning('') + + for state, tok, resolution in lr.sr_conflicts: + debuglog.warning('shift/reduce conflict for %s in state %d resolved as %s', tok, state, resolution) + + already_reported = set() + for state, rule, rejected in lr.rr_conflicts: + if (state, id(rule), id(rejected)) in already_reported: + continue + debuglog.warning('reduce/reduce conflict in state %d resolved using rule (%s)', state, rule) + debuglog.warning('rejected rule (%s) in state %d', rejected, state) + errorlog.warning('reduce/reduce conflict in state %d resolved using rule (%s)', state, rule) + errorlog.warning('rejected rule (%s) in state %d', rejected, state) + already_reported.add((state, id(rule), id(rejected))) + + warned_never = [] + for state, rule, rejected in lr.rr_conflicts: + if not rejected.reduced and (rejected not in warned_never): + debuglog.warning('Rule (%s) is never reduced', rejected) + errorlog.warning('Rule (%s) is never reduced', rejected) + warned_never.append(rejected) + + # Write the table file if requested + if write_tables: + try: + lr.write_table(tabmodule, outputdir, signature) + except IOError as e: + errorlog.warning("Couldn't create %r. %s" % (tabmodule, e)) + + # Write a pickled version of the tables + if picklefile: + try: + lr.pickle_table(picklefile, signature) + except IOError as e: + errorlog.warning("Couldn't create %r. %s" % (picklefile, e)) + + # Build the parser + lr.bind_callables(pinfo.pdict) + parser = LRParser(lr, pinfo.error_func) + + parse = parser.parse + return parser diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pycparser/ply/ygen.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pycparser/ply/ygen.py new file mode 100644 index 00000000..acf5ca1a --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pycparser/ply/ygen.py @@ -0,0 +1,74 @@ +# ply: ygen.py +# +# This is a support program that auto-generates different versions of the YACC parsing +# function with different features removed for the purposes of performance. +# +# Users should edit the method LParser.parsedebug() in yacc.py. The source code +# for that method is then used to create the other methods. See the comments in +# yacc.py for further details. + +import os.path +import shutil + +def get_source_range(lines, tag): + srclines = enumerate(lines) + start_tag = '#--! %s-start' % tag + end_tag = '#--! %s-end' % tag + + for start_index, line in srclines: + if line.strip().startswith(start_tag): + break + + for end_index, line in srclines: + if line.strip().endswith(end_tag): + break + + return (start_index + 1, end_index) + +def filter_section(lines, tag): + filtered_lines = [] + include = True + tag_text = '#--! %s' % tag + for line in lines: + if line.strip().startswith(tag_text): + include = not include + elif include: + filtered_lines.append(line) + return filtered_lines + +def main(): + dirname = os.path.dirname(__file__) + shutil.copy2(os.path.join(dirname, 'yacc.py'), os.path.join(dirname, 'yacc.py.bak')) + with open(os.path.join(dirname, 'yacc.py'), 'r') as f: + lines = f.readlines() + + parse_start, parse_end = get_source_range(lines, 'parsedebug') + parseopt_start, parseopt_end = get_source_range(lines, 'parseopt') + parseopt_notrack_start, parseopt_notrack_end = get_source_range(lines, 'parseopt-notrack') + + # Get the original source + orig_lines = lines[parse_start:parse_end] + + # Filter the DEBUG sections out + parseopt_lines = filter_section(orig_lines, 'DEBUG') + + # Filter the TRACKING sections out + parseopt_notrack_lines = filter_section(parseopt_lines, 'TRACKING') + + # Replace the parser source sections with updated versions + lines[parseopt_notrack_start:parseopt_notrack_end] = parseopt_notrack_lines + lines[parseopt_start:parseopt_end] = parseopt_lines + + lines = [line.rstrip()+'\n' for line in lines] + with open(os.path.join(dirname, 'yacc.py'), 'w') as f: + f.writelines(lines) + + print('Updated yacc.py') + +if __name__ == '__main__': + main() + + + + + diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pycparser/plyparser.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pycparser/plyparser.py new file mode 100644 index 00000000..6222c0ea --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pycparser/plyparser.py @@ -0,0 +1,133 @@ +#----------------------------------------------------------------- +# plyparser.py +# +# PLYParser class and other utilites for simplifying programming +# parsers with PLY +# +# Eli Bendersky [https://eli.thegreenplace.net/] +# License: BSD +#----------------------------------------------------------------- + +import warnings + +class Coord(object): + """ Coordinates of a syntactic element. Consists of: + - File name + - Line number + - (optional) column number, for the Lexer + """ + __slots__ = ('file', 'line', 'column', '__weakref__') + def __init__(self, file, line, column=None): + self.file = file + self.line = line + self.column = column + + def __str__(self): + str = "%s:%s" % (self.file, self.line) + if self.column: str += ":%s" % self.column + return str + + +class ParseError(Exception): pass + + +class PLYParser(object): + def _create_opt_rule(self, rulename): + """ Given a rule name, creates an optional ply.yacc rule + for it. The name of the optional rule is + _opt + """ + optname = rulename + '_opt' + + def optrule(self, p): + p[0] = p[1] + + optrule.__doc__ = '%s : empty\n| %s' % (optname, rulename) + optrule.__name__ = 'p_%s' % optname + setattr(self.__class__, optrule.__name__, optrule) + + def _coord(self, lineno, column=None): + return Coord( + file=self.clex.filename, + line=lineno, + column=column) + + def _token_coord(self, p, token_idx): + """ Returns the coordinates for the YaccProduction objet 'p' indexed + with 'token_idx'. The coordinate includes the 'lineno' and + 'column'. Both follow the lex semantic, starting from 1. + """ + last_cr = p.lexer.lexer.lexdata.rfind('\n', 0, p.lexpos(token_idx)) + if last_cr < 0: + last_cr = -1 + column = (p.lexpos(token_idx) - (last_cr)) + return self._coord(p.lineno(token_idx), column) + + def _parse_error(self, msg, coord): + raise ParseError("%s: %s" % (coord, msg)) + + +def parameterized(*params): + """ Decorator to create parameterized rules. + + Parameterized rule methods must be named starting with 'p_' and contain + 'xxx', and their docstrings may contain 'xxx' and 'yyy'. These will be + replaced by the given parameter tuples. For example, ``p_xxx_rule()`` with + docstring 'xxx_rule : yyy' when decorated with + ``@parameterized(('id', 'ID'))`` produces ``p_id_rule()`` with the docstring + 'id_rule : ID'. Using multiple tuples produces multiple rules. + """ + def decorate(rule_func): + rule_func._params = params + return rule_func + return decorate + + +def template(cls): + """ Class decorator to generate rules from parameterized rule templates. + + See `parameterized` for more information on parameterized rules. + """ + issued_nodoc_warning = False + for attr_name in dir(cls): + if attr_name.startswith('p_'): + method = getattr(cls, attr_name) + if hasattr(method, '_params'): + # Remove the template method + delattr(cls, attr_name) + # Create parameterized rules from this method; only run this if + # the method has a docstring. This is to address an issue when + # pycparser's users are installed in -OO mode which strips + # docstrings away. + # See: https://github.com/eliben/pycparser/pull/198/ and + # https://github.com/eliben/pycparser/issues/197 + # for discussion. + if method.__doc__ is not None: + _create_param_rules(cls, method) + elif not issued_nodoc_warning: + warnings.warn( + 'parsing methods must have __doc__ for pycparser to work properly', + RuntimeWarning, + stacklevel=2) + issued_nodoc_warning = True + return cls + + +def _create_param_rules(cls, func): + """ Create ply.yacc rules based on a parameterized rule function + + Generates new methods (one per each pair of parameters) based on the + template rule function `func`, and attaches them to `cls`. The rule + function's parameters must be accessible via its `_params` attribute. + """ + for xxx, yyy in func._params: + # Use the template method's body for each new method + def param_rule(self, p): + func(self, p) + + # Substitute in the params for the grammar rule and function name + param_rule.__doc__ = func.__doc__.replace('xxx', xxx).replace('yyy', yyy) + param_rule.__name__ = func.__name__.replace('xxx', xxx) + + # Attach the new method to the class + setattr(cls, param_rule.__name__, param_rule) diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pycparser/yacctab.py b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pycparser/yacctab.py new file mode 100644 index 00000000..7fbdef97 --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/Lib/site-packages/pycparser/yacctab.py @@ -0,0 +1,338 @@ + +# yacctab.py +# This file is automatically generated. Do not edit. +_tabversion = '3.10' + +_lr_method = 'LALR' + +_lr_signature = 'translation_unit_or_emptyleftLORleftLANDleftORleftXORleftANDleftEQNEleftGTGELTLEleftRSHIFTLSHIFTleftPLUSMINUSleftTIMESDIVIDEMOD_BOOL _COMPLEX AUTO BREAK CASE CHAR CONST CONTINUE DEFAULT DO DOUBLE ELSE ENUM EXTERN FLOAT FOR GOTO IF INLINE INT LONG REGISTER OFFSETOF RESTRICT RETURN SHORT SIGNED SIZEOF STATIC STRUCT SWITCH TYPEDEF UNION UNSIGNED VOID VOLATILE WHILE __INT128 ID TYPEID INT_CONST_DEC INT_CONST_OCT INT_CONST_HEX INT_CONST_BIN FLOAT_CONST HEX_FLOAT_CONST CHAR_CONST WCHAR_CONST STRING_LITERAL WSTRING_LITERAL PLUS MINUS TIMES DIVIDE MOD OR AND NOT XOR LSHIFT RSHIFT LOR LAND LNOT LT LE GT GE EQ NE EQUALS TIMESEQUAL DIVEQUAL MODEQUAL PLUSEQUAL MINUSEQUAL LSHIFTEQUAL RSHIFTEQUAL ANDEQUAL XOREQUAL OREQUAL PLUSPLUS MINUSMINUS ARROW CONDOP LPAREN RPAREN LBRACKET RBRACKET LBRACE RBRACE COMMA PERIOD SEMI COLON ELLIPSIS PPHASH PPPRAGMA PPPRAGMASTRabstract_declarator_opt : empty\n| abstract_declaratorassignment_expression_opt : empty\n| assignment_expressionblock_item_list_opt : empty\n| block_item_listdeclaration_list_opt : empty\n| declaration_listdeclaration_specifiers_no_type_opt : empty\n| declaration_specifiers_no_typedesignation_opt : empty\n| designationexpression_opt : empty\n| expressionid_init_declarator_list_opt : empty\n| id_init_declarator_listidentifier_list_opt : empty\n| identifier_listinit_declarator_list_opt : empty\n| init_declarator_listinitializer_list_opt : empty\n| initializer_listparameter_type_list_opt : empty\n| parameter_type_liststruct_declarator_list_opt : empty\n| struct_declarator_listtype_qualifier_list_opt : empty\n| type_qualifier_list direct_id_declarator : ID\n direct_id_declarator : LPAREN id_declarator RPAREN\n direct_id_declarator : direct_id_declarator LBRACKET type_qualifier_list_opt assignment_expression_opt RBRACKET\n direct_id_declarator : direct_id_declarator LBRACKET STATIC type_qualifier_list_opt assignment_expression RBRACKET\n | direct_id_declarator LBRACKET type_qualifier_list STATIC assignment_expression RBRACKET\n direct_id_declarator : direct_id_declarator LBRACKET type_qualifier_list_opt TIMES RBRACKET\n direct_id_declarator : direct_id_declarator LPAREN parameter_type_list RPAREN\n | direct_id_declarator LPAREN identifier_list_opt RPAREN\n direct_typeid_declarator : TYPEID\n direct_typeid_declarator : LPAREN typeid_declarator RPAREN\n direct_typeid_declarator : direct_typeid_declarator LBRACKET type_qualifier_list_opt assignment_expression_opt RBRACKET\n direct_typeid_declarator : direct_typeid_declarator LBRACKET STATIC type_qualifier_list_opt assignment_expression RBRACKET\n | direct_typeid_declarator LBRACKET type_qualifier_list STATIC assignment_expression RBRACKET\n direct_typeid_declarator : direct_typeid_declarator LBRACKET type_qualifier_list_opt TIMES RBRACKET\n direct_typeid_declarator : direct_typeid_declarator LPAREN parameter_type_list RPAREN\n | direct_typeid_declarator LPAREN identifier_list_opt RPAREN\n direct_typeid_noparen_declarator : TYPEID\n direct_typeid_noparen_declarator : direct_typeid_noparen_declarator LBRACKET type_qualifier_list_opt assignment_expression_opt RBRACKET\n direct_typeid_noparen_declarator : direct_typeid_noparen_declarator LBRACKET STATIC type_qualifier_list_opt assignment_expression RBRACKET\n | direct_typeid_noparen_declarator LBRACKET type_qualifier_list STATIC assignment_expression RBRACKET\n direct_typeid_noparen_declarator : direct_typeid_noparen_declarator LBRACKET type_qualifier_list_opt TIMES RBRACKET\n direct_typeid_noparen_declarator : direct_typeid_noparen_declarator LPAREN parameter_type_list RPAREN\n | direct_typeid_noparen_declarator LPAREN identifier_list_opt RPAREN\n id_declarator : direct_id_declarator\n id_declarator : pointer direct_id_declarator\n typeid_declarator : direct_typeid_declarator\n typeid_declarator : pointer direct_typeid_declarator\n typeid_noparen_declarator : direct_typeid_noparen_declarator\n typeid_noparen_declarator : pointer direct_typeid_noparen_declarator\n translation_unit_or_empty : translation_unit\n | empty\n translation_unit : external_declaration\n translation_unit : translation_unit external_declaration\n external_declaration : function_definition\n external_declaration : declaration\n external_declaration : pp_directive\n | pppragma_directive\n external_declaration : SEMI\n pp_directive : PPHASH\n pppragma_directive : PPPRAGMA\n | PPPRAGMA PPPRAGMASTR\n function_definition : id_declarator declaration_list_opt compound_statement\n function_definition : declaration_specifiers id_declarator declaration_list_opt compound_statement\n statement : labeled_statement\n | expression_statement\n | compound_statement\n | selection_statement\n | iteration_statement\n | jump_statement\n | pppragma_directive\n pragmacomp_or_statement : pppragma_directive statement\n | statement\n decl_body : declaration_specifiers init_declarator_list_opt\n | declaration_specifiers_no_type id_init_declarator_list_opt\n declaration : decl_body SEMI\n declaration_list : declaration\n | declaration_list declaration\n declaration_specifiers_no_type : type_qualifier declaration_specifiers_no_type_opt\n declaration_specifiers_no_type : storage_class_specifier declaration_specifiers_no_type_opt\n declaration_specifiers_no_type : function_specifier declaration_specifiers_no_type_opt\n declaration_specifiers : declaration_specifiers type_qualifier\n declaration_specifiers : declaration_specifiers storage_class_specifier\n declaration_specifiers : declaration_specifiers function_specifier\n declaration_specifiers : declaration_specifiers type_specifier_no_typeid\n declaration_specifiers : type_specifier\n declaration_specifiers : declaration_specifiers_no_type type_specifier\n storage_class_specifier : AUTO\n | REGISTER\n | STATIC\n | EXTERN\n | TYPEDEF\n function_specifier : INLINE\n type_specifier_no_typeid : VOID\n | _BOOL\n | CHAR\n | SHORT\n | INT\n | LONG\n | FLOAT\n | DOUBLE\n | _COMPLEX\n | SIGNED\n | UNSIGNED\n | __INT128\n type_specifier : typedef_name\n | enum_specifier\n | struct_or_union_specifier\n | type_specifier_no_typeid\n type_qualifier : CONST\n | RESTRICT\n | VOLATILE\n init_declarator_list : init_declarator\n | init_declarator_list COMMA init_declarator\n init_declarator : declarator\n | declarator EQUALS initializer\n id_init_declarator_list : id_init_declarator\n | id_init_declarator_list COMMA init_declarator\n id_init_declarator : id_declarator\n | id_declarator EQUALS initializer\n specifier_qualifier_list : specifier_qualifier_list type_specifier_no_typeid\n specifier_qualifier_list : specifier_qualifier_list type_qualifier\n specifier_qualifier_list : type_specifier\n specifier_qualifier_list : type_qualifier_list type_specifier\n struct_or_union_specifier : struct_or_union ID\n | struct_or_union TYPEID\n struct_or_union_specifier : struct_or_union brace_open struct_declaration_list brace_close\n | struct_or_union brace_open brace_close\n struct_or_union_specifier : struct_or_union ID brace_open struct_declaration_list brace_close\n | struct_or_union ID brace_open brace_close\n | struct_or_union TYPEID brace_open struct_declaration_list brace_close\n | struct_or_union TYPEID brace_open brace_close\n struct_or_union : STRUCT\n | UNION\n struct_declaration_list : struct_declaration\n | struct_declaration_list struct_declaration\n struct_declaration : specifier_qualifier_list struct_declarator_list_opt SEMI\n struct_declaration : SEMI\n struct_declaration : pppragma_directive\n struct_declarator_list : struct_declarator\n | struct_declarator_list COMMA struct_declarator\n struct_declarator : declarator\n struct_declarator : declarator COLON constant_expression\n | COLON constant_expression\n enum_specifier : ENUM ID\n | ENUM TYPEID\n enum_specifier : ENUM brace_open enumerator_list brace_close\n enum_specifier : ENUM ID brace_open enumerator_list brace_close\n | ENUM TYPEID brace_open enumerator_list brace_close\n enumerator_list : enumerator\n | enumerator_list COMMA\n | enumerator_list COMMA enumerator\n enumerator : ID\n | ID EQUALS constant_expression\n declarator : id_declarator\n | typeid_declarator\n pointer : TIMES type_qualifier_list_opt\n | TIMES type_qualifier_list_opt pointer\n type_qualifier_list : type_qualifier\n | type_qualifier_list type_qualifier\n parameter_type_list : parameter_list\n | parameter_list COMMA ELLIPSIS\n parameter_list : parameter_declaration\n | parameter_list COMMA parameter_declaration\n parameter_declaration : declaration_specifiers id_declarator\n | declaration_specifiers typeid_noparen_declarator\n parameter_declaration : declaration_specifiers abstract_declarator_opt\n identifier_list : identifier\n | identifier_list COMMA identifier\n initializer : assignment_expression\n initializer : brace_open initializer_list_opt brace_close\n | brace_open initializer_list COMMA brace_close\n initializer_list : designation_opt initializer\n | initializer_list COMMA designation_opt initializer\n designation : designator_list EQUALS\n designator_list : designator\n | designator_list designator\n designator : LBRACKET constant_expression RBRACKET\n | PERIOD identifier\n type_name : specifier_qualifier_list abstract_declarator_opt\n abstract_declarator : pointer\n abstract_declarator : pointer direct_abstract_declarator\n abstract_declarator : direct_abstract_declarator\n direct_abstract_declarator : LPAREN abstract_declarator RPAREN direct_abstract_declarator : direct_abstract_declarator LBRACKET assignment_expression_opt RBRACKET\n direct_abstract_declarator : LBRACKET assignment_expression_opt RBRACKET\n direct_abstract_declarator : direct_abstract_declarator LBRACKET TIMES RBRACKET\n direct_abstract_declarator : LBRACKET TIMES RBRACKET\n direct_abstract_declarator : direct_abstract_declarator LPAREN parameter_type_list_opt RPAREN\n direct_abstract_declarator : LPAREN parameter_type_list_opt RPAREN\n block_item : declaration\n | statement\n block_item_list : block_item\n | block_item_list block_item\n compound_statement : brace_open block_item_list_opt brace_close labeled_statement : ID COLON pragmacomp_or_statement labeled_statement : CASE constant_expression COLON pragmacomp_or_statement labeled_statement : DEFAULT COLON pragmacomp_or_statement selection_statement : IF LPAREN expression RPAREN pragmacomp_or_statement selection_statement : IF LPAREN expression RPAREN statement ELSE pragmacomp_or_statement selection_statement : SWITCH LPAREN expression RPAREN pragmacomp_or_statement iteration_statement : WHILE LPAREN expression RPAREN pragmacomp_or_statement iteration_statement : DO pragmacomp_or_statement WHILE LPAREN expression RPAREN SEMI iteration_statement : FOR LPAREN expression_opt SEMI expression_opt SEMI expression_opt RPAREN pragmacomp_or_statement iteration_statement : FOR LPAREN declaration expression_opt SEMI expression_opt RPAREN pragmacomp_or_statement jump_statement : GOTO ID SEMI jump_statement : BREAK SEMI jump_statement : CONTINUE SEMI jump_statement : RETURN expression SEMI\n | RETURN SEMI\n expression_statement : expression_opt SEMI expression : assignment_expression\n | expression COMMA assignment_expression\n typedef_name : TYPEID assignment_expression : conditional_expression\n | unary_expression assignment_operator assignment_expression\n assignment_operator : EQUALS\n | XOREQUAL\n | TIMESEQUAL\n | DIVEQUAL\n | MODEQUAL\n | PLUSEQUAL\n | MINUSEQUAL\n | LSHIFTEQUAL\n | RSHIFTEQUAL\n | ANDEQUAL\n | OREQUAL\n constant_expression : conditional_expression conditional_expression : binary_expression\n | binary_expression CONDOP expression COLON conditional_expression\n binary_expression : cast_expression\n | binary_expression TIMES binary_expression\n | binary_expression DIVIDE binary_expression\n | binary_expression MOD binary_expression\n | binary_expression PLUS binary_expression\n | binary_expression MINUS binary_expression\n | binary_expression RSHIFT binary_expression\n | binary_expression LSHIFT binary_expression\n | binary_expression LT binary_expression\n | binary_expression LE binary_expression\n | binary_expression GE binary_expression\n | binary_expression GT binary_expression\n | binary_expression EQ binary_expression\n | binary_expression NE binary_expression\n | binary_expression AND binary_expression\n | binary_expression OR binary_expression\n | binary_expression XOR binary_expression\n | binary_expression LAND binary_expression\n | binary_expression LOR binary_expression\n cast_expression : unary_expression cast_expression : LPAREN type_name RPAREN cast_expression unary_expression : postfix_expression unary_expression : PLUSPLUS unary_expression\n | MINUSMINUS unary_expression\n | unary_operator cast_expression\n unary_expression : SIZEOF unary_expression\n | SIZEOF LPAREN type_name RPAREN\n unary_operator : AND\n | TIMES\n | PLUS\n | MINUS\n | NOT\n | LNOT\n postfix_expression : primary_expression postfix_expression : postfix_expression LBRACKET expression RBRACKET postfix_expression : postfix_expression LPAREN argument_expression_list RPAREN\n | postfix_expression LPAREN RPAREN\n postfix_expression : postfix_expression PERIOD ID\n | postfix_expression PERIOD TYPEID\n | postfix_expression ARROW ID\n | postfix_expression ARROW TYPEID\n postfix_expression : postfix_expression PLUSPLUS\n | postfix_expression MINUSMINUS\n postfix_expression : LPAREN type_name RPAREN brace_open initializer_list brace_close\n | LPAREN type_name RPAREN brace_open initializer_list COMMA brace_close\n primary_expression : identifier primary_expression : constant primary_expression : unified_string_literal\n | unified_wstring_literal\n primary_expression : LPAREN expression RPAREN primary_expression : OFFSETOF LPAREN type_name COMMA offsetof_member_designator RPAREN\n offsetof_member_designator : identifier\n | offsetof_member_designator PERIOD identifier\n | offsetof_member_designator LBRACKET expression RBRACKET\n argument_expression_list : assignment_expression\n | argument_expression_list COMMA assignment_expression\n identifier : ID constant : INT_CONST_DEC\n | INT_CONST_OCT\n | INT_CONST_HEX\n | INT_CONST_BIN\n constant : FLOAT_CONST\n | HEX_FLOAT_CONST\n constant : CHAR_CONST\n | WCHAR_CONST\n unified_string_literal : STRING_LITERAL\n | unified_string_literal STRING_LITERAL\n unified_wstring_literal : WSTRING_LITERAL\n | unified_wstring_literal WSTRING_LITERAL\n brace_open : LBRACE\n brace_close : RBRACE\n empty : ' + +_lr_action_items = {'VOID':([0,1,2,3,5,6,7,8,9,10,11,12,14,15,16,17,18,19,20,21,23,24,25,26,29,30,32,33,34,35,36,37,39,40,41,42,44,45,47,48,49,50,51,53,54,55,56,57,60,61,63,64,65,67,68,69,70,71,72,73,74,78,80,83,87,91,92,96,101,102,103,104,105,113,117,120,121,122,123,124,125,126,127,128,129,130,131,132,133,139,145,173,187,188,189,201,202,203,206,208,215,217,218,219,220,222,225,231,232,233,234,235,236,237,238,244,249,258,277,286,287,288,291,293,296,327,331,336,337,339,340,346,349,351,352,353,356,357,360,362,363,398,418,419,432,433,437,442,443,480,501,502,504,505,523,524,527,528,],[6,-309,-104,-117,-115,-101,-99,-52,-97,-116,-98,-64,-60,-102,-93,-66,6,-96,-111,-106,-65,-95,-112,6,-221,-109,-113,6,-63,-118,6,-29,-107,-62,-103,-67,-114,-108,-309,-110,-309,-105,-119,-68,-100,-87,-10,-9,6,-53,6,-84,6,6,-61,-133,-307,-132,6,-153,-152,-166,-90,-92,6,-89,-91,-94,-83,-86,-88,-69,-30,6,6,-70,6,-85,6,6,6,-135,-130,-145,-146,-142,-308,6,6,-167,6,6,-36,-35,6,6,-73,-76,-72,-74,6,-78,-199,-198,-77,-200,-75,6,-139,6,-137,-134,-143,-131,-128,-129,-154,-71,6,-31,6,6,6,-34,6,6,6,-218,-217,6,-215,-201,-214,-78,-80,-202,-138,-136,-144,-156,-155,6,-33,-32,-213,-216,-205,-79,-203,-204,-209,-208,-206,-80,-210,-207,-212,-211,]),'LBRACKET':([2,3,5,6,7,8,9,10,11,15,16,19,20,21,24,25,29,30,31,32,35,37,39,41,44,45,48,50,51,54,61,69,70,71,73,74,76,77,78,79,80,83,85,88,91,92,96,105,113,115,126,127,131,139,140,143,150,153,154,155,156,157,158,161,162,170,172,175,177,178,180,181,187,188,189,192,193,196,199,229,232,234,235,237,238,244,249,251,260,276,279,280,282,286,293,296,319,324,325,356,357,362,363,370,371,374,379,383,384,385,386,389,394,397,398,418,419,420,421,427,428,447,448,452,454,456,459,460,466,472,473,474,475,476,484,485,486,491,492,495,496,507,510,511,512,513,518,520,525,],[-104,-117,-115,-101,-99,59,-97,-116,-98,-102,-93,-96,-111,-106,-95,-112,-221,-109,-309,-113,-118,-29,-107,-103,-114,-108,-110,-105,-119,-100,59,-133,-307,-132,-153,-152,-28,-164,-166,-27,-90,-92,144,-37,-89,-91,-94,-30,198,-294,-135,-130,-308,-167,-165,144,-298,-286,-301,-305,-302,-299,-284,-285,284,-297,-271,-303,-295,-283,-300,-296,-36,-35,198,198,326,-45,330,-294,-139,-137,-134,-131,-128,-129,-154,-38,376,-306,-304,-280,-279,-31,-34,198,198,326,330,-138,-136,-156,-155,-44,-43,-183,376,-278,-277,-276,-275,-274,-287,198,198,-33,-32,-197,-191,-193,-195,-39,-42,-186,376,-184,-272,-273,376,-51,-50,-192,-194,-196,-41,-40,-185,509,-289,-46,-49,-288,376,-281,-48,-47,-290,-282,-291,]),'WCHAR_CONST':([3,35,51,53,59,70,76,78,79,101,104,106,107,108,121,131,139,144,147,148,151,159,160,166,167,169,171,173,174,176,184,185,186,198,202,203,206,207,208,214,215,217,218,219,220,222,224,225,228,239,250,253,254,255,260,264,265,266,267,268,269,270,271,272,273,274,275,277,284,285,288,291,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,326,329,330,336,337,339,340,341,342,343,346,348,349,351,352,353,354,355,361,367,368,369,372,376,378,380,395,422,423,424,430,432,433,435,437,439,442,443,454,457,461,463,466,467,469,470,471,477,479,480,481,482,483,487,488,500,501,502,504,505,509,510,514,517,522,523,524,526,527,528,],[-117,-118,-119,-68,-309,-307,-28,-166,-27,-83,-69,156,-28,-309,156,-308,-167,-309,156,156,-270,156,-268,156,-267,156,-266,156,156,-265,-269,156,156,156,-73,-76,-72,156,-74,156,156,-78,-199,-198,-77,-200,156,-75,-266,156,156,156,-28,-309,-309,-227,-230,-228,-224,-225,-229,-231,156,-233,-234,-226,-232,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,-309,-266,156,-218,-217,156,-215,156,156,156,-201,156,-214,156,-80,-202,156,156,156,-266,156,156,-12,156,156,-11,156,156,-28,-309,-266,-213,-216,156,-205,156,-79,-203,-309,-182,156,156,-309,156,-266,156,156,156,156,-204,156,156,156,156,-11,156,-209,-208,-206,-80,156,-309,156,156,156,-210,-207,156,-212,-211,]),'FLOAT_CONST':([3,35,51,53,59,70,76,78,79,101,104,106,107,108,121,131,139,144,147,148,151,159,160,166,167,169,171,173,174,176,184,185,186,198,202,203,206,207,208,214,215,217,218,219,220,222,224,225,228,239,250,253,254,255,260,264,265,266,267,268,269,270,271,272,273,274,275,277,284,285,288,291,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,326,329,330,336,337,339,340,341,342,343,346,348,349,351,352,353,354,355,361,367,368,369,372,376,378,380,395,422,423,424,430,432,433,435,437,439,442,443,454,457,461,463,466,467,469,470,471,477,479,480,481,482,483,487,488,500,501,502,504,505,509,510,514,517,522,523,524,526,527,528,],[-117,-118,-119,-68,-309,-307,-28,-166,-27,-83,-69,157,-28,-309,157,-308,-167,-309,157,157,-270,157,-268,157,-267,157,-266,157,157,-265,-269,157,157,157,-73,-76,-72,157,-74,157,157,-78,-199,-198,-77,-200,157,-75,-266,157,157,157,-28,-309,-309,-227,-230,-228,-224,-225,-229,-231,157,-233,-234,-226,-232,157,157,157,157,157,157,157,157,157,157,157,157,157,157,157,157,157,157,157,157,157,157,157,157,-309,-266,157,-218,-217,157,-215,157,157,157,-201,157,-214,157,-80,-202,157,157,157,-266,157,157,-12,157,157,-11,157,157,-28,-309,-266,-213,-216,157,-205,157,-79,-203,-309,-182,157,157,-309,157,-266,157,157,157,157,-204,157,157,157,157,-11,157,-209,-208,-206,-80,157,-309,157,157,157,-210,-207,157,-212,-211,]),'MINUS':([3,35,51,53,59,70,76,78,79,101,104,106,107,108,115,121,131,139,144,147,148,150,151,152,153,154,155,156,157,158,159,160,161,162,164,166,167,169,170,171,172,173,174,175,176,177,178,179,180,181,184,185,186,198,202,203,206,207,208,214,215,217,218,219,220,222,224,225,228,229,239,250,253,254,255,260,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,282,284,285,288,289,290,291,292,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,326,329,330,336,337,339,340,341,342,343,346,348,349,351,352,353,354,355,361,367,368,369,372,376,378,380,383,384,385,386,389,394,395,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,416,417,422,423,424,430,432,433,435,437,439,442,443,454,457,458,459,460,461,463,465,466,467,469,470,471,477,479,480,481,482,483,487,488,500,501,502,504,505,507,509,510,511,514,517,520,522,523,524,526,527,528,],[-117,-118,-119,-68,-309,-307,-28,-166,-27,-83,-69,160,-28,-309,-294,160,-308,-167,-309,160,160,-298,-270,-257,-286,-301,-305,-302,-299,-284,160,-268,-285,-259,-238,160,-267,160,-297,-266,-271,160,160,-303,-265,-295,-283,301,-300,-296,-269,160,160,160,-73,-76,-72,160,-74,160,160,-78,-199,-198,-77,-200,160,-75,-266,-294,160,160,160,-28,-309,-309,-227,-230,-228,-224,-225,-229,-231,160,-233,-234,-226,-232,-306,160,-263,-304,-280,-279,160,160,160,-257,-262,160,-260,-261,160,160,160,160,160,160,160,160,160,160,160,160,160,160,160,160,160,160,160,-309,-266,160,-218,-217,160,-215,160,160,160,-201,160,-214,160,-80,-202,160,160,160,-266,160,160,-12,160,160,-11,-278,-277,-276,-275,-274,-287,160,301,301,301,-243,301,301,301,-242,301,301,-240,-239,301,301,301,301,301,-241,160,-28,-309,-266,-213,-216,160,-205,160,-79,-203,-309,-182,-264,-272,-273,160,160,-258,-309,160,-266,160,160,160,160,-204,160,160,160,160,-11,160,-209,-208,-206,-80,-288,160,-309,-281,160,160,-282,160,-210,-207,160,-212,-211,]),'RPAREN':([2,3,5,6,7,8,9,10,11,15,16,19,20,21,24,25,29,30,31,32,35,37,39,41,44,45,48,50,51,54,58,60,61,69,71,73,74,76,77,78,79,80,83,85,88,91,92,96,105,109,110,111,112,113,114,115,116,118,126,127,131,139,140,141,143,145,150,152,153,154,155,156,157,158,161,162,164,170,172,175,177,178,179,180,181,183,187,188,189,190,191,192,193,194,195,196,197,199,211,227,232,234,235,237,238,244,249,251,256,257,276,278,279,280,282,285,286,289,290,292,293,294,295,296,297,319,320,321,322,323,324,325,327,331,332,333,334,347,356,357,362,363,370,371,381,382,383,384,385,386,388,389,390,392,393,394,396,397,398,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,416,417,418,419,420,421,425,426,427,428,431,436,438,440,444,447,448,458,459,460,465,472,473,474,475,476,484,485,490,491,492,494,495,496,500,503,507,511,512,513,514,515,518,520,521,525,],[-104,-117,-115,-101,-99,-52,-97,-116,-98,-102,-93,-96,-111,-106,-95,-112,-221,-109,-309,-113,-118,-29,-107,-103,-114,-108,-110,-105,-119,-100,105,-309,-53,-133,-132,-153,-152,-28,-164,-166,-27,-90,-92,-54,-37,-89,-91,-94,-30,187,-17,188,-170,-309,-18,-294,-168,-175,-135,-130,-308,-167,-165,251,-55,-309,-298,-257,-286,-301,-305,-302,-299,-284,-285,-259,-238,-297,-271,-303,-295,-283,-236,-300,-296,-222,-36,-35,-309,-174,-2,-188,-56,-172,-1,-45,-173,-190,-14,-219,-139,-137,-134,-131,-128,-129,-154,-38,370,371,-306,-263,-304,-280,-279,389,-31,-257,-262,-260,-34,394,395,-309,-261,-188,-23,-24,420,421,-57,-189,-309,-309,-176,-169,-171,-13,-138,-136,-156,-155,-44,-43,-223,458,-278,-277,-276,-275,-292,-274,460,463,464,-287,-187,-188,-309,-244,-256,-245,-243,-247,-251,-246,-242,-249,-254,-240,-239,-248,-255,-250,-252,-253,-241,-33,-32,-197,-191,472,473,-193,-195,476,-220,479,481,483,-39,-42,-264,-272,-273,-258,-51,-50,-192,-194,-196,-41,-40,-293,507,-289,-237,-46,-49,-309,516,-288,-281,-48,-47,-309,522,-290,-282,526,-291,]),'LONG':([0,1,2,3,5,6,7,8,9,10,11,12,14,15,16,17,18,19,20,21,23,24,25,26,29,30,32,33,34,35,36,37,39,40,41,42,44,45,47,48,49,50,51,53,54,55,56,57,60,61,63,64,65,67,68,69,70,71,72,73,74,78,80,83,87,91,92,96,101,102,103,104,105,113,117,120,121,122,123,124,125,126,127,128,129,130,131,132,133,139,145,173,187,188,189,201,202,203,206,208,215,217,218,219,220,222,225,231,232,233,234,235,236,237,238,244,249,258,277,286,287,288,291,293,296,327,331,336,337,339,340,346,349,351,352,353,356,357,360,362,363,398,418,419,432,433,437,442,443,480,501,502,504,505,523,524,527,528,],[21,-309,-104,-117,-115,-101,-99,-52,-97,-116,-98,-64,-60,-102,-93,-66,21,-96,-111,-106,-65,-95,-112,21,-221,-109,-113,21,-63,-118,21,-29,-107,-62,-103,-67,-114,-108,-309,-110,-309,-105,-119,-68,-100,-87,-10,-9,21,-53,21,-84,21,21,-61,-133,-307,-132,21,-153,-152,-166,-90,-92,21,-89,-91,-94,-83,-86,-88,-69,-30,21,21,-70,21,-85,21,21,21,-135,-130,-145,-146,-142,-308,21,21,-167,21,21,-36,-35,21,21,-73,-76,-72,-74,21,-78,-199,-198,-77,-200,-75,21,-139,21,-137,-134,-143,-131,-128,-129,-154,-71,21,-31,21,21,21,-34,21,21,21,-218,-217,21,-215,-201,-214,-78,-80,-202,-138,-136,-144,-156,-155,21,-33,-32,-213,-216,-205,-79,-203,-204,-209,-208,-206,-80,-210,-207,-212,-211,]),'PLUS':([3,35,51,53,59,70,76,78,79,101,104,106,107,108,115,121,131,139,144,147,148,150,151,152,153,154,155,156,157,158,159,160,161,162,164,166,167,169,170,171,172,173,174,175,176,177,178,179,180,181,184,185,186,198,202,203,206,207,208,214,215,217,218,219,220,222,224,225,228,229,239,250,253,254,255,260,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,282,284,285,288,289,290,291,292,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,326,329,330,336,337,339,340,341,342,343,346,348,349,351,352,353,354,355,361,367,368,369,372,376,378,380,383,384,385,386,389,394,395,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,416,417,422,423,424,430,432,433,435,437,439,442,443,454,457,458,459,460,461,463,465,466,467,469,470,471,477,479,480,481,482,483,487,488,500,501,502,504,505,507,509,510,511,514,517,520,522,523,524,526,527,528,],[-117,-118,-119,-68,-309,-307,-28,-166,-27,-83,-69,167,-28,-309,-294,167,-308,-167,-309,167,167,-298,-270,-257,-286,-301,-305,-302,-299,-284,167,-268,-285,-259,-238,167,-267,167,-297,-266,-271,167,167,-303,-265,-295,-283,305,-300,-296,-269,167,167,167,-73,-76,-72,167,-74,167,167,-78,-199,-198,-77,-200,167,-75,-266,-294,167,167,167,-28,-309,-309,-227,-230,-228,-224,-225,-229,-231,167,-233,-234,-226,-232,-306,167,-263,-304,-280,-279,167,167,167,-257,-262,167,-260,-261,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,-309,-266,167,-218,-217,167,-215,167,167,167,-201,167,-214,167,-80,-202,167,167,167,-266,167,167,-12,167,167,-11,-278,-277,-276,-275,-274,-287,167,305,305,305,-243,305,305,305,-242,305,305,-240,-239,305,305,305,305,305,-241,167,-28,-309,-266,-213,-216,167,-205,167,-79,-203,-309,-182,-264,-272,-273,167,167,-258,-309,167,-266,167,167,167,167,-204,167,167,167,167,-11,167,-209,-208,-206,-80,-288,167,-309,-281,167,167,-282,167,-210,-207,167,-212,-211,]),'ELLIPSIS':([201,],[333,]),'GT':([115,131,150,152,153,154,155,156,157,158,161,162,164,170,172,175,177,178,179,180,181,229,276,278,279,280,282,289,290,292,297,383,384,385,386,389,394,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,416,417,458,459,460,465,507,511,520,],[-294,-308,-298,-257,-286,-301,-305,-302,-299,-284,-285,-259,-238,-297,-271,-303,-295,-283,306,-300,-296,-294,-306,-263,-304,-280,-279,-257,-262,-260,-261,-278,-277,-276,-275,-274,-287,-244,306,-245,-243,-247,306,-246,-242,-249,306,-240,-239,-248,306,306,306,306,-241,-264,-272,-273,-258,-288,-281,-282,]),'GOTO':([53,70,101,104,121,131,202,203,206,208,215,217,218,219,220,222,224,225,336,337,340,342,346,349,351,352,353,354,432,433,437,439,442,443,479,480,481,483,501,502,504,505,517,522,523,524,526,527,528,],[-68,-307,-83,-69,204,-308,-73,-76,-72,-74,204,-78,-199,-198,-77,-200,204,-75,-218,-217,-215,204,-201,-214,204,-80,-202,204,-213,-216,-205,204,-79,-203,204,-204,204,204,-209,-208,-206,-80,204,204,-210,-207,204,-212,-211,]),'ENUM':([0,1,3,7,8,9,11,12,14,17,18,19,23,24,26,34,35,36,37,40,42,47,49,51,53,54,55,56,57,60,61,64,65,67,68,70,72,78,87,101,102,103,104,105,117,120,121,122,123,124,125,128,129,130,131,132,139,145,173,187,188,189,201,202,203,206,208,215,217,218,219,220,222,225,231,233,236,258,277,286,287,288,291,293,327,331,336,337,339,340,346,349,351,352,353,360,398,418,419,432,433,437,442,443,480,501,502,504,505,523,524,527,528,],[28,-309,-117,-99,-52,-97,-98,-64,-60,-66,28,-96,-65,-95,28,-63,-118,28,-29,-62,-67,-309,-309,-119,-68,-100,-87,-10,-9,28,-53,-84,28,28,-61,-307,28,-166,28,-83,-86,-88,-69,-30,28,-70,28,-85,28,28,28,-145,-146,-142,-308,28,-167,28,28,-36,-35,28,28,-73,-76,-72,-74,28,-78,-199,-198,-77,-200,-75,28,28,-143,-71,28,-31,28,28,28,-34,28,28,-218,-217,28,-215,-201,-214,-78,-80,-202,-144,28,-33,-32,-213,-216,-205,-79,-203,-204,-209,-208,-206,-80,-210,-207,-212,-211,]),'PERIOD':([70,115,131,150,153,154,155,156,157,158,161,162,170,172,175,177,178,180,181,229,260,276,279,280,282,374,379,383,384,385,386,389,394,452,454,456,459,460,466,486,491,492,507,510,511,518,520,525,],[-307,-294,-308,-298,-286,-301,-305,-302,-299,-284,-285,283,-297,-271,-303,-295,-283,-300,-296,-294,375,-306,-304,-280,-279,-183,375,-278,-277,-276,-275,-274,-287,-186,375,-184,-272,-273,375,-185,508,-289,-288,375,-281,-290,-282,-291,]),'GE':([115,131,150,152,153,154,155,156,157,158,161,162,164,170,172,175,177,178,179,180,181,229,276,278,279,280,282,289,290,292,297,383,384,385,386,389,394,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,416,417,458,459,460,465,507,511,520,],[-294,-308,-298,-257,-286,-301,-305,-302,-299,-284,-285,-259,-238,-297,-271,-303,-295,-283,310,-300,-296,-294,-306,-263,-304,-280,-279,-257,-262,-260,-261,-278,-277,-276,-275,-274,-287,-244,310,-245,-243,-247,310,-246,-242,-249,310,-240,-239,-248,310,310,310,310,-241,-264,-272,-273,-258,-288,-281,-282,]),'INT_CONST_DEC':([3,35,51,53,59,70,76,78,79,101,104,106,107,108,121,131,139,144,147,148,151,159,160,166,167,169,171,173,174,176,184,185,186,198,202,203,206,207,208,214,215,217,218,219,220,222,224,225,228,239,250,253,254,255,260,264,265,266,267,268,269,270,271,272,273,274,275,277,284,285,288,291,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,326,329,330,336,337,339,340,341,342,343,346,348,349,351,352,353,354,355,361,367,368,369,372,376,378,380,395,422,423,424,430,432,433,435,437,439,442,443,454,457,461,463,466,467,469,470,471,477,479,480,481,482,483,487,488,500,501,502,504,505,509,510,514,517,522,523,524,526,527,528,],[-117,-118,-119,-68,-309,-307,-28,-166,-27,-83,-69,177,-28,-309,177,-308,-167,-309,177,177,-270,177,-268,177,-267,177,-266,177,177,-265,-269,177,177,177,-73,-76,-72,177,-74,177,177,-78,-199,-198,-77,-200,177,-75,-266,177,177,177,-28,-309,-309,-227,-230,-228,-224,-225,-229,-231,177,-233,-234,-226,-232,177,177,177,177,177,177,177,177,177,177,177,177,177,177,177,177,177,177,177,177,177,177,177,177,-309,-266,177,-218,-217,177,-215,177,177,177,-201,177,-214,177,-80,-202,177,177,177,-266,177,177,-12,177,177,-11,177,177,-28,-309,-266,-213,-216,177,-205,177,-79,-203,-309,-182,177,177,-309,177,-266,177,177,177,177,-204,177,177,177,177,-11,177,-209,-208,-206,-80,177,-309,177,177,177,-210,-207,177,-212,-211,]),'ARROW':([115,131,150,153,154,155,156,157,158,161,162,170,172,175,177,178,180,181,229,276,279,280,282,383,384,385,386,389,394,459,460,507,511,520,],[-294,-308,-298,-286,-301,-305,-302,-299,-284,-285,281,-297,-271,-303,-295,-283,-300,-296,-294,-306,-304,-280,-279,-278,-277,-276,-275,-274,-287,-272,-273,-288,-281,-282,]),'CHAR':([0,1,2,3,5,6,7,8,9,10,11,12,14,15,16,17,18,19,20,21,23,24,25,26,29,30,32,33,34,35,36,37,39,40,41,42,44,45,47,48,49,50,51,53,54,55,56,57,60,61,63,64,65,67,68,69,70,71,72,73,74,78,80,83,87,91,92,96,101,102,103,104,105,113,117,120,121,122,123,124,125,126,127,128,129,130,131,132,133,139,145,173,187,188,189,201,202,203,206,208,215,217,218,219,220,222,225,231,232,233,234,235,236,237,238,244,249,258,277,286,287,288,291,293,296,327,331,336,337,339,340,346,349,351,352,353,356,357,360,362,363,398,418,419,432,433,437,442,443,480,501,502,504,505,523,524,527,528,],[41,-309,-104,-117,-115,-101,-99,-52,-97,-116,-98,-64,-60,-102,-93,-66,41,-96,-111,-106,-65,-95,-112,41,-221,-109,-113,41,-63,-118,41,-29,-107,-62,-103,-67,-114,-108,-309,-110,-309,-105,-119,-68,-100,-87,-10,-9,41,-53,41,-84,41,41,-61,-133,-307,-132,41,-153,-152,-166,-90,-92,41,-89,-91,-94,-83,-86,-88,-69,-30,41,41,-70,41,-85,41,41,41,-135,-130,-145,-146,-142,-308,41,41,-167,41,41,-36,-35,41,41,-73,-76,-72,-74,41,-78,-199,-198,-77,-200,-75,41,-139,41,-137,-134,-143,-131,-128,-129,-154,-71,41,-31,41,41,41,-34,41,41,41,-218,-217,41,-215,-201,-214,-78,-80,-202,-138,-136,-144,-156,-155,41,-33,-32,-213,-216,-205,-79,-203,-204,-209,-208,-206,-80,-210,-207,-212,-211,]),'HEX_FLOAT_CONST':([3,35,51,53,59,70,76,78,79,101,104,106,107,108,121,131,139,144,147,148,151,159,160,166,167,169,171,173,174,176,184,185,186,198,202,203,206,207,208,214,215,217,218,219,220,222,224,225,228,239,250,253,254,255,260,264,265,266,267,268,269,270,271,272,273,274,275,277,284,285,288,291,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,326,329,330,336,337,339,340,341,342,343,346,348,349,351,352,353,354,355,361,367,368,369,372,376,378,380,395,422,423,424,430,432,433,435,437,439,442,443,454,457,461,463,466,467,469,470,471,477,479,480,481,482,483,487,488,500,501,502,504,505,509,510,514,517,522,523,524,526,527,528,],[-117,-118,-119,-68,-309,-307,-28,-166,-27,-83,-69,180,-28,-309,180,-308,-167,-309,180,180,-270,180,-268,180,-267,180,-266,180,180,-265,-269,180,180,180,-73,-76,-72,180,-74,180,180,-78,-199,-198,-77,-200,180,-75,-266,180,180,180,-28,-309,-309,-227,-230,-228,-224,-225,-229,-231,180,-233,-234,-226,-232,180,180,180,180,180,180,180,180,180,180,180,180,180,180,180,180,180,180,180,180,180,180,180,180,-309,-266,180,-218,-217,180,-215,180,180,180,-201,180,-214,180,-80,-202,180,180,180,-266,180,180,-12,180,180,-11,180,180,-28,-309,-266,-213,-216,180,-205,180,-79,-203,-309,-182,180,180,-309,180,-266,180,180,180,180,-204,180,180,180,180,-11,180,-209,-208,-206,-80,180,-309,180,180,180,-210,-207,180,-212,-211,]),'DOUBLE':([0,1,2,3,5,6,7,8,9,10,11,12,14,15,16,17,18,19,20,21,23,24,25,26,29,30,32,33,34,35,36,37,39,40,41,42,44,45,47,48,49,50,51,53,54,55,56,57,60,61,63,64,65,67,68,69,70,71,72,73,74,78,80,83,87,91,92,96,101,102,103,104,105,113,117,120,121,122,123,124,125,126,127,128,129,130,131,132,133,139,145,173,187,188,189,201,202,203,206,208,215,217,218,219,220,222,225,231,232,233,234,235,236,237,238,244,249,258,277,286,287,288,291,293,296,327,331,336,337,339,340,346,349,351,352,353,356,357,360,362,363,398,418,419,432,433,437,442,443,480,501,502,504,505,523,524,527,528,],[45,-309,-104,-117,-115,-101,-99,-52,-97,-116,-98,-64,-60,-102,-93,-66,45,-96,-111,-106,-65,-95,-112,45,-221,-109,-113,45,-63,-118,45,-29,-107,-62,-103,-67,-114,-108,-309,-110,-309,-105,-119,-68,-100,-87,-10,-9,45,-53,45,-84,45,45,-61,-133,-307,-132,45,-153,-152,-166,-90,-92,45,-89,-91,-94,-83,-86,-88,-69,-30,45,45,-70,45,-85,45,45,45,-135,-130,-145,-146,-142,-308,45,45,-167,45,45,-36,-35,45,45,-73,-76,-72,-74,45,-78,-199,-198,-77,-200,-75,45,-139,45,-137,-134,-143,-131,-128,-129,-154,-71,45,-31,45,45,45,-34,45,45,45,-218,-217,45,-215,-201,-214,-78,-80,-202,-138,-136,-144,-156,-155,45,-33,-32,-213,-216,-205,-79,-203,-204,-209,-208,-206,-80,-210,-207,-212,-211,]),'MINUSEQUAL':([115,131,150,152,153,154,155,156,157,158,161,162,170,172,175,177,178,180,181,229,276,278,279,280,282,289,290,292,297,383,384,385,386,389,394,458,459,460,465,507,511,520,],[-294,-308,-298,265,-286,-301,-305,-302,-299,-284,-285,-259,-297,-271,-303,-295,-283,-300,-296,-294,-306,-263,-304,-280,-279,-257,-262,-260,-261,-278,-277,-276,-275,-274,-287,-264,-272,-273,-258,-288,-281,-282,]),'INT_CONST_OCT':([3,35,51,53,59,70,76,78,79,101,104,106,107,108,121,131,139,144,147,148,151,159,160,166,167,169,171,173,174,176,184,185,186,198,202,203,206,207,208,214,215,217,218,219,220,222,224,225,228,239,250,253,254,255,260,264,265,266,267,268,269,270,271,272,273,274,275,277,284,285,288,291,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,326,329,330,336,337,339,340,341,342,343,346,348,349,351,352,353,354,355,361,367,368,369,372,376,378,380,395,422,423,424,430,432,433,435,437,439,442,443,454,457,461,463,466,467,469,470,471,477,479,480,481,482,483,487,488,500,501,502,504,505,509,510,514,517,522,523,524,526,527,528,],[-117,-118,-119,-68,-309,-307,-28,-166,-27,-83,-69,181,-28,-309,181,-308,-167,-309,181,181,-270,181,-268,181,-267,181,-266,181,181,-265,-269,181,181,181,-73,-76,-72,181,-74,181,181,-78,-199,-198,-77,-200,181,-75,-266,181,181,181,-28,-309,-309,-227,-230,-228,-224,-225,-229,-231,181,-233,-234,-226,-232,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,-309,-266,181,-218,-217,181,-215,181,181,181,-201,181,-214,181,-80,-202,181,181,181,-266,181,181,-12,181,181,-11,181,181,-28,-309,-266,-213,-216,181,-205,181,-79,-203,-309,-182,181,181,-309,181,-266,181,181,181,181,-204,181,181,181,181,-11,181,-209,-208,-206,-80,181,-309,181,181,181,-210,-207,181,-212,-211,]),'TIMESEQUAL':([115,131,150,152,153,154,155,156,157,158,161,162,170,172,175,177,178,180,181,229,276,278,279,280,282,289,290,292,297,383,384,385,386,389,394,458,459,460,465,507,511,520,],[-294,-308,-298,274,-286,-301,-305,-302,-299,-284,-285,-259,-297,-271,-303,-295,-283,-300,-296,-294,-306,-263,-304,-280,-279,-257,-262,-260,-261,-278,-277,-276,-275,-274,-287,-264,-272,-273,-258,-288,-281,-282,]),'OR':([115,131,150,152,153,154,155,156,157,158,161,162,164,170,172,175,177,178,179,180,181,229,276,278,279,280,282,289,290,292,297,383,384,385,386,389,394,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,416,417,458,459,460,465,507,511,520,],[-294,-308,-298,-257,-286,-301,-305,-302,-299,-284,-285,-259,-238,-297,-271,-303,-295,-283,315,-300,-296,-294,-306,-263,-304,-280,-279,-257,-262,-260,-261,-278,-277,-276,-275,-274,-287,-244,315,-245,-243,-247,-251,-246,-242,-249,-254,-240,-239,-248,315,-250,-252,-253,-241,-264,-272,-273,-258,-288,-281,-282,]),'SHORT':([0,1,2,3,5,6,7,8,9,10,11,12,14,15,16,17,18,19,20,21,23,24,25,26,29,30,32,33,34,35,36,37,39,40,41,42,44,45,47,48,49,50,51,53,54,55,56,57,60,61,63,64,65,67,68,69,70,71,72,73,74,78,80,83,87,91,92,96,101,102,103,104,105,113,117,120,121,122,123,124,125,126,127,128,129,130,131,132,133,139,145,173,187,188,189,201,202,203,206,208,215,217,218,219,220,222,225,231,232,233,234,235,236,237,238,244,249,258,277,286,287,288,291,293,296,327,331,336,337,339,340,346,349,351,352,353,356,357,360,362,363,398,418,419,432,433,437,442,443,480,501,502,504,505,523,524,527,528,],[2,-309,-104,-117,-115,-101,-99,-52,-97,-116,-98,-64,-60,-102,-93,-66,2,-96,-111,-106,-65,-95,-112,2,-221,-109,-113,2,-63,-118,2,-29,-107,-62,-103,-67,-114,-108,-309,-110,-309,-105,-119,-68,-100,-87,-10,-9,2,-53,2,-84,2,2,-61,-133,-307,-132,2,-153,-152,-166,-90,-92,2,-89,-91,-94,-83,-86,-88,-69,-30,2,2,-70,2,-85,2,2,2,-135,-130,-145,-146,-142,-308,2,2,-167,2,2,-36,-35,2,2,-73,-76,-72,-74,2,-78,-199,-198,-77,-200,-75,2,-139,2,-137,-134,-143,-131,-128,-129,-154,-71,2,-31,2,2,2,-34,2,2,2,-218,-217,2,-215,-201,-214,-78,-80,-202,-138,-136,-144,-156,-155,2,-33,-32,-213,-216,-205,-79,-203,-204,-209,-208,-206,-80,-210,-207,-212,-211,]),'RETURN':([53,70,101,104,121,131,202,203,206,208,215,217,218,219,220,222,224,225,336,337,340,342,346,349,351,352,353,354,432,433,437,439,442,443,479,480,481,483,501,502,504,505,517,522,523,524,526,527,528,],[-68,-307,-83,-69,207,-308,-73,-76,-72,-74,207,-78,-199,-198,-77,-200,207,-75,-218,-217,-215,207,-201,-214,207,-80,-202,207,-213,-216,-205,207,-79,-203,207,-204,207,207,-209,-208,-206,-80,207,207,-210,-207,207,-212,-211,]),'RSHIFTEQUAL':([115,131,150,152,153,154,155,156,157,158,161,162,170,172,175,177,178,180,181,229,276,278,279,280,282,289,290,292,297,383,384,385,386,389,394,458,459,460,465,507,511,520,],[-294,-308,-298,275,-286,-301,-305,-302,-299,-284,-285,-259,-297,-271,-303,-295,-283,-300,-296,-294,-306,-263,-304,-280,-279,-257,-262,-260,-261,-278,-277,-276,-275,-274,-287,-264,-272,-273,-258,-288,-281,-282,]),'RESTRICT':([0,1,2,3,5,6,7,8,9,10,11,12,14,15,16,17,18,19,20,21,23,24,25,26,29,30,31,32,33,34,35,37,39,40,41,42,44,45,47,48,49,50,51,53,54,59,60,61,63,64,67,68,69,70,71,72,73,74,76,78,80,83,87,91,92,96,101,104,105,107,108,113,120,121,122,123,124,125,126,127,128,129,130,131,132,133,139,144,145,173,187,188,189,201,202,203,206,208,215,217,218,219,220,222,225,231,232,233,234,235,236,237,238,244,249,254,255,258,277,286,287,288,291,293,296,326,327,331,336,337,339,340,346,349,351,352,353,356,357,360,362,363,398,418,419,423,424,432,433,437,442,443,480,501,502,504,505,523,524,527,528,],[35,35,-104,-117,-115,-101,-99,-52,-97,-116,-98,-64,-60,-102,-93,-66,35,-96,-111,-106,-65,-95,-112,35,-221,-109,35,-113,35,-63,-118,-29,-107,-62,-103,-67,-114,-108,35,-110,35,-105,-119,-68,-100,35,35,-53,35,-84,35,-61,-133,-307,-132,35,-153,-152,35,-166,-90,-92,35,-89,-91,-94,-83,-69,-30,35,35,35,-70,35,-85,35,35,35,-135,-130,-145,-146,-142,-308,35,35,-167,35,35,35,-36,-35,35,35,-73,-76,-72,-74,35,-78,-199,-198,-77,-200,-75,35,-139,35,-137,-134,-143,-131,-128,-129,-154,35,35,-71,35,-31,35,35,35,-34,35,35,35,35,-218,-217,35,-215,-201,-214,-78,-80,-202,-138,-136,-144,-156,-155,35,-33,-32,35,35,-213,-216,-205,-79,-203,-204,-209,-208,-206,-80,-210,-207,-212,-211,]),'STATIC':([0,1,2,3,5,6,7,8,9,10,11,12,14,15,16,17,18,19,20,21,23,24,25,26,29,30,32,33,34,35,37,39,40,41,42,44,45,47,48,49,50,51,53,54,59,60,61,63,64,67,68,69,70,71,73,74,78,80,83,87,91,92,96,101,104,105,107,113,120,121,122,126,131,139,144,145,187,188,189,201,202,203,206,208,215,217,218,219,220,222,225,232,234,235,249,254,258,286,293,326,327,331,336,337,339,340,346,349,351,352,353,356,357,362,363,398,418,419,423,432,433,437,442,443,480,501,502,504,505,523,524,527,528,],[9,9,-104,-117,-115,-101,-99,-52,-97,-116,-98,-64,-60,-102,-93,-66,9,-96,-111,-106,-65,-95,-112,9,-221,-109,-113,9,-63,-118,-29,-107,-62,-103,-67,-114,-108,9,-110,9,-105,-119,-68,-100,108,9,-53,9,-84,9,-61,-133,-307,-132,-153,-152,-166,-90,-92,9,-89,-91,-94,-83,-69,-30,185,9,-70,9,-85,-135,-308,-167,255,9,-36,-35,9,9,-73,-76,-72,-74,9,-78,-199,-198,-77,-200,-75,-139,-137,-134,-154,368,-71,-31,-34,424,9,9,-218,-217,9,-215,-201,-214,-78,-80,-202,-138,-136,-156,-155,9,-33,-32,470,-213,-216,-205,-79,-203,-204,-209,-208,-206,-80,-210,-207,-212,-211,]),'SIZEOF':([3,35,51,53,59,70,76,78,79,101,104,106,107,108,121,131,139,144,147,148,151,159,160,166,167,169,171,173,174,176,184,185,186,198,202,203,206,207,208,214,215,217,218,219,220,222,224,225,228,239,250,253,254,255,260,264,265,266,267,268,269,270,271,272,273,274,275,277,284,285,288,291,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,326,329,330,336,337,339,340,341,342,343,346,348,349,351,352,353,354,355,361,367,368,369,372,376,378,380,395,422,423,424,430,432,433,435,437,439,442,443,454,457,461,463,466,467,469,470,471,477,479,480,481,482,483,487,488,500,501,502,504,505,509,510,514,517,522,523,524,526,527,528,],[-117,-118,-119,-68,-309,-307,-28,-166,-27,-83,-69,159,-28,-309,159,-308,-167,-309,159,159,-270,159,-268,159,-267,159,-266,159,159,-265,-269,159,159,159,-73,-76,-72,159,-74,159,159,-78,-199,-198,-77,-200,159,-75,-266,159,159,159,-28,-309,-309,-227,-230,-228,-224,-225,-229,-231,159,-233,-234,-226,-232,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,-309,-266,159,-218,-217,159,-215,159,159,159,-201,159,-214,159,-80,-202,159,159,159,-266,159,159,-12,159,159,-11,159,159,-28,-309,-266,-213,-216,159,-205,159,-79,-203,-309,-182,159,159,-309,159,-266,159,159,159,159,-204,159,159,159,159,-11,159,-209,-208,-206,-80,159,-309,159,159,159,-210,-207,159,-212,-211,]),'UNSIGNED':([0,1,2,3,5,6,7,8,9,10,11,12,14,15,16,17,18,19,20,21,23,24,25,26,29,30,32,33,34,35,36,37,39,40,41,42,44,45,47,48,49,50,51,53,54,55,56,57,60,61,63,64,65,67,68,69,70,71,72,73,74,78,80,83,87,91,92,96,101,102,103,104,105,113,117,120,121,122,123,124,125,126,127,128,129,130,131,132,133,139,145,173,187,188,189,201,202,203,206,208,215,217,218,219,220,222,225,231,232,233,234,235,236,237,238,244,249,258,277,286,287,288,291,293,296,327,331,336,337,339,340,346,349,351,352,353,356,357,360,362,363,398,418,419,432,433,437,442,443,480,501,502,504,505,523,524,527,528,],[20,-309,-104,-117,-115,-101,-99,-52,-97,-116,-98,-64,-60,-102,-93,-66,20,-96,-111,-106,-65,-95,-112,20,-221,-109,-113,20,-63,-118,20,-29,-107,-62,-103,-67,-114,-108,-309,-110,-309,-105,-119,-68,-100,-87,-10,-9,20,-53,20,-84,20,20,-61,-133,-307,-132,20,-153,-152,-166,-90,-92,20,-89,-91,-94,-83,-86,-88,-69,-30,20,20,-70,20,-85,20,20,20,-135,-130,-145,-146,-142,-308,20,20,-167,20,20,-36,-35,20,20,-73,-76,-72,-74,20,-78,-199,-198,-77,-200,-75,20,-139,20,-137,-134,-143,-131,-128,-129,-154,-71,20,-31,20,20,20,-34,20,20,20,-218,-217,20,-215,-201,-214,-78,-80,-202,-138,-136,-144,-156,-155,20,-33,-32,-213,-216,-205,-79,-203,-204,-209,-208,-206,-80,-210,-207,-212,-211,]),'UNION':([0,1,3,7,8,9,11,12,14,17,18,19,23,24,26,34,35,36,37,40,42,47,49,51,53,54,55,56,57,60,61,64,65,67,68,70,72,78,87,101,102,103,104,105,117,120,121,122,123,124,125,128,129,130,131,132,139,145,173,187,188,189,201,202,203,206,208,215,217,218,219,220,222,225,231,233,236,258,277,286,287,288,291,293,327,331,336,337,339,340,346,349,351,352,353,360,398,418,419,432,433,437,442,443,480,501,502,504,505,523,524,527,528,],[22,-309,-117,-99,-52,-97,-98,-64,-60,-66,22,-96,-65,-95,22,-63,-118,22,-29,-62,-67,-309,-309,-119,-68,-100,-87,-10,-9,22,-53,-84,22,22,-61,-307,22,-166,22,-83,-86,-88,-69,-30,22,-70,22,-85,22,22,22,-145,-146,-142,-308,22,-167,22,22,-36,-35,22,22,-73,-76,-72,-74,22,-78,-199,-198,-77,-200,-75,22,22,-143,-71,22,-31,22,22,22,-34,22,22,-218,-217,22,-215,-201,-214,-78,-80,-202,-144,22,-33,-32,-213,-216,-205,-79,-203,-204,-209,-208,-206,-80,-210,-207,-212,-211,]),'COLON':([2,3,5,6,8,10,15,20,21,25,29,30,32,35,37,39,41,44,45,48,50,51,61,69,71,73,74,85,86,88,105,115,119,126,127,131,133,143,150,152,153,154,155,156,157,158,161,162,164,170,172,175,177,178,179,180,181,183,187,188,212,227,229,232,234,235,237,238,244,245,249,251,276,278,279,280,282,286,289,290,292,293,297,344,345,356,357,359,362,363,370,371,381,383,384,385,386,389,394,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,436,447,448,458,459,460,465,484,485,494,507,511,520,],[-104,-117,-115,-101,-52,-116,-102,-111,-106,-112,-221,-109,-113,-118,-29,-107,-103,-114,-108,-110,-105,-119,-53,-133,-132,-153,-152,-54,-163,-37,-30,-294,-162,-135,-130,-308,239,-55,-298,-257,-286,-301,-305,-302,-299,-284,-285,-259,-238,-297,-271,-303,-295,-283,-236,-300,-296,-222,-36,-35,342,-219,354,-139,-137,-134,-131,-128,-129,361,-154,-38,-306,-263,-304,-280,-279,-31,-257,-262,-260,-34,-261,439,-235,-138,-136,239,-156,-155,-44,-43,-223,-278,-277,-276,-275,-274,-287,-244,-256,-245,-243,-247,-251,-246,-242,-249,-254,-240,-239,-248,-255,-250,-252,467,-253,-241,-33,-32,-220,-39,-42,-264,-272,-273,-258,-41,-40,-237,-288,-281,-282,]),'$end':([0,12,14,17,23,26,34,40,42,43,52,53,68,101,104,120,131,258,353,],[-309,-64,-60,-66,-65,-58,-63,-62,-67,0,-59,-68,-61,-83,-69,-70,-308,-71,-202,]),'WSTRING_LITERAL':([3,35,51,53,59,70,76,78,79,101,104,106,107,108,121,131,139,144,147,148,151,153,155,159,160,166,167,169,171,173,174,176,184,185,186,198,202,203,206,207,208,214,215,217,218,219,220,222,224,225,228,239,250,253,254,255,260,264,265,266,267,268,269,270,271,272,273,274,275,276,277,284,285,288,291,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,326,329,330,336,337,339,340,341,342,343,346,348,349,351,352,353,354,355,361,367,368,369,372,376,378,380,395,422,423,424,430,432,433,435,437,439,442,443,454,457,461,463,466,467,469,470,471,477,479,480,481,482,483,487,488,500,501,502,504,505,509,510,514,517,522,523,524,526,527,528,],[-117,-118,-119,-68,-309,-307,-28,-166,-27,-83,-69,155,-28,-309,155,-308,-167,-309,155,155,-270,276,-305,155,-268,155,-267,155,-266,155,155,-265,-269,155,155,155,-73,-76,-72,155,-74,155,155,-78,-199,-198,-77,-200,155,-75,-266,155,155,155,-28,-309,-309,-227,-230,-228,-224,-225,-229,-231,155,-233,-234,-226,-232,-306,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,-309,-266,155,-218,-217,155,-215,155,155,155,-201,155,-214,155,-80,-202,155,155,155,-266,155,155,-12,155,155,-11,155,155,-28,-309,-266,-213,-216,155,-205,155,-79,-203,-309,-182,155,155,-309,155,-266,155,155,155,155,-204,155,155,155,155,-11,155,-209,-208,-206,-80,155,-309,155,155,155,-210,-207,155,-212,-211,]),'DIVIDE':([115,131,150,152,153,154,155,156,157,158,161,162,164,170,172,175,177,178,179,180,181,229,276,278,279,280,282,289,290,292,297,383,384,385,386,389,394,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,416,417,458,459,460,465,507,511,520,],[-294,-308,-298,-257,-286,-301,-305,-302,-299,-284,-285,-259,-238,-297,-271,-303,-295,-283,308,-300,-296,-294,-306,-263,-304,-280,-279,-257,-262,-260,-261,-278,-277,-276,-275,-274,-287,308,308,308,308,308,308,308,308,308,308,-240,-239,308,308,308,308,308,-241,-264,-272,-273,-258,-288,-281,-282,]),'FOR':([53,70,101,104,121,131,202,203,206,208,215,217,218,219,220,222,224,225,336,337,340,342,346,349,351,352,353,354,432,433,437,439,442,443,479,480,481,483,501,502,504,505,517,522,523,524,526,527,528,],[-68,-307,-83,-69,209,-308,-73,-76,-72,-74,209,-78,-199,-198,-77,-200,209,-75,-218,-217,-215,209,-201,-214,209,-80,-202,209,-213,-216,-205,209,-79,-203,209,-204,209,209,-209,-208,-206,-80,209,209,-210,-207,209,-212,-211,]),'PLUSPLUS':([3,35,51,53,59,70,76,78,79,101,104,106,107,108,115,121,131,139,144,147,148,150,151,153,154,155,156,157,158,159,160,161,162,166,167,169,170,171,172,173,174,175,176,177,178,180,181,184,185,186,198,202,203,206,207,208,214,215,217,218,219,220,222,224,225,228,229,239,250,253,254,255,260,264,265,266,267,268,269,270,271,272,273,274,275,276,277,279,280,282,284,285,288,291,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,326,329,330,336,337,339,340,341,342,343,346,348,349,351,352,353,354,355,361,367,368,369,372,376,378,380,383,384,385,386,389,394,395,422,423,424,430,432,433,435,437,439,442,443,454,457,459,460,461,463,466,467,469,470,471,477,479,480,481,482,483,487,488,500,501,502,504,505,507,509,510,511,514,517,520,522,523,524,526,527,528,],[-117,-118,-119,-68,-309,-307,-28,-166,-27,-83,-69,169,-28,-309,-294,169,-308,-167,-309,169,169,-298,-270,-286,-301,-305,-302,-299,-284,169,-268,-285,282,169,-267,169,-297,-266,-271,169,169,-303,-265,-295,-283,-300,-296,-269,169,169,169,-73,-76,-72,169,-74,169,169,-78,-199,-198,-77,-200,169,-75,-266,-294,169,169,169,-28,-309,-309,-227,-230,-228,-224,-225,-229,-231,169,-233,-234,-226,-232,-306,169,-304,-280,-279,169,169,169,169,169,169,169,169,169,169,169,169,169,169,169,169,169,169,169,169,169,169,169,-309,-266,169,-218,-217,169,-215,169,169,169,-201,169,-214,169,-80,-202,169,169,169,-266,169,169,-12,169,169,-11,-278,-277,-276,-275,-274,-287,169,169,-28,-309,-266,-213,-216,169,-205,169,-79,-203,-309,-182,-272,-273,169,169,-309,169,-266,169,169,169,169,-204,169,169,169,169,-11,169,-209,-208,-206,-80,-288,169,-309,-281,169,169,-282,169,-210,-207,169,-212,-211,]),'EQUALS':([8,37,61,85,86,87,88,89,97,105,115,119,131,138,143,150,152,153,154,155,156,157,158,161,162,170,172,175,177,178,180,181,187,188,229,251,276,278,279,280,282,286,289,290,292,293,297,370,371,374,379,383,384,385,386,389,394,418,419,447,448,452,456,458,459,460,465,484,485,486,507,511,520,],[-52,-29,-53,-54,-163,-162,-37,147,148,-30,-294,-162,-308,250,-55,-298,267,-286,-301,-305,-302,-299,-284,-285,-259,-297,-271,-303,-295,-283,-300,-296,-36,-35,-294,-38,-306,-263,-304,-280,-279,-31,-257,-262,-260,-34,-261,-44,-43,-183,457,-278,-277,-276,-275,-274,-287,-33,-32,-39,-42,-186,-184,-264,-272,-273,-258,-41,-40,-185,-288,-281,-282,]),'ELSE':([53,104,131,202,203,206,208,217,220,225,336,337,340,349,351,352,353,432,433,437,442,443,480,501,502,504,505,523,524,527,528,],[-68,-69,-308,-73,-76,-72,-74,-78,-77,-75,-218,-217,-215,-214,-78,-80,-202,-213,-216,-205,-79,-203,-204,-209,-208,-206,517,-210,-207,-212,-211,]),'ANDEQUAL':([115,131,150,152,153,154,155,156,157,158,161,162,170,172,175,177,178,180,181,229,276,278,279,280,282,289,290,292,297,383,384,385,386,389,394,458,459,460,465,507,511,520,],[-294,-308,-298,272,-286,-301,-305,-302,-299,-284,-285,-259,-297,-271,-303,-295,-283,-300,-296,-294,-306,-263,-304,-280,-279,-257,-262,-260,-261,-278,-277,-276,-275,-274,-287,-264,-272,-273,-258,-288,-281,-282,]),'EQ':([115,131,150,152,153,154,155,156,157,158,161,162,164,170,172,175,177,178,179,180,181,229,276,278,279,280,282,289,290,292,297,383,384,385,386,389,394,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,416,417,458,459,460,465,507,511,520,],[-294,-308,-298,-257,-286,-301,-305,-302,-299,-284,-285,-259,-238,-297,-271,-303,-295,-283,312,-300,-296,-294,-306,-263,-304,-280,-279,-257,-262,-260,-261,-278,-277,-276,-275,-274,-287,-244,312,-245,-243,-247,-251,-246,-242,-249,312,-240,-239,-248,312,-250,312,312,-241,-264,-272,-273,-258,-288,-281,-282,]),'AND':([3,35,51,53,59,70,76,78,79,101,104,106,107,108,115,121,131,139,144,147,148,150,151,152,153,154,155,156,157,158,159,160,161,162,164,166,167,169,170,171,172,173,174,175,176,177,178,179,180,181,184,185,186,198,202,203,206,207,208,214,215,217,218,219,220,222,224,225,228,229,239,250,253,254,255,260,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,282,284,285,288,289,290,291,292,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,326,329,330,336,337,339,340,341,342,343,346,348,349,351,352,353,354,355,361,367,368,369,372,376,378,380,383,384,385,386,389,394,395,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,416,417,422,423,424,430,432,433,435,437,439,442,443,454,457,458,459,460,461,463,465,466,467,469,470,471,477,479,480,481,482,483,487,488,500,501,502,504,505,507,509,510,511,514,517,520,522,523,524,526,527,528,],[-117,-118,-119,-68,-309,-307,-28,-166,-27,-83,-69,176,-28,-309,-294,176,-308,-167,-309,176,176,-298,-270,-257,-286,-301,-305,-302,-299,-284,176,-268,-285,-259,-238,176,-267,176,-297,-266,-271,176,176,-303,-265,-295,-283,313,-300,-296,-269,176,176,176,-73,-76,-72,176,-74,176,176,-78,-199,-198,-77,-200,176,-75,-266,-294,176,176,176,-28,-309,-309,-227,-230,-228,-224,-225,-229,-231,176,-233,-234,-226,-232,-306,176,-263,-304,-280,-279,176,176,176,-257,-262,176,-260,-261,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,-309,-266,176,-218,-217,176,-215,176,176,176,-201,176,-214,176,-80,-202,176,176,176,-266,176,176,-12,176,176,-11,-278,-277,-276,-275,-274,-287,176,-244,313,-245,-243,-247,-251,-246,-242,-249,313,-240,-239,-248,313,-250,-252,313,-241,176,-28,-309,-266,-213,-216,176,-205,176,-79,-203,-309,-182,-264,-272,-273,176,176,-258,-309,176,-266,176,176,176,176,-204,176,176,176,176,-11,176,-209,-208,-206,-80,-288,176,-309,-281,176,176,-282,176,-210,-207,176,-212,-211,]),'TYPEID':([0,1,2,3,5,6,7,8,9,10,11,12,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,44,45,47,48,49,50,51,53,54,55,56,57,60,61,63,64,65,67,68,69,70,71,72,73,74,76,77,78,79,80,81,83,84,87,91,92,96,101,102,103,104,105,113,117,120,121,122,123,124,125,126,127,128,129,130,131,132,133,139,140,142,145,149,173,187,188,189,192,201,202,203,206,208,215,217,218,219,220,222,225,231,232,233,234,235,236,237,238,244,249,258,277,281,283,286,287,288,291,293,327,331,336,337,339,340,346,349,351,352,353,356,357,359,360,362,363,398,418,419,432,433,437,442,443,480,501,502,504,505,523,524,527,528,],[29,-309,-104,-117,-115,-101,-99,-52,-97,-116,-98,-64,-60,-102,-93,-66,29,-96,-111,-106,-141,-65,-95,-112,29,69,73,-221,-109,-309,-113,88,-63,-118,29,-29,-140,-107,-62,-103,-67,-114,-108,-309,-110,-309,-105,-119,-68,-100,-87,-10,-9,29,-53,88,-84,29,29,-61,-133,-307,-132,29,-153,-152,-28,-164,-166,-27,-90,88,-92,88,29,-89,-91,-94,-83,-86,-88,-69,-30,196,29,-70,29,-85,29,29,29,-135,-130,-145,-146,-142,-308,29,88,-167,-165,88,29,88,29,-36,-35,29,196,29,-73,-76,-72,-74,29,-78,-199,-198,-77,-200,-75,29,-139,29,-137,-134,-143,-131,-128,-129,-154,-71,29,383,385,-31,29,29,29,-34,29,29,-218,-217,29,-215,-201,-214,-78,-80,-202,-138,-136,88,-144,-156,-155,29,-33,-32,-213,-216,-205,-79,-203,-204,-209,-208,-206,-80,-210,-207,-212,-211,]),'LBRACE':([8,18,22,27,28,37,38,53,61,62,64,66,67,69,70,71,73,74,87,101,104,105,121,122,131,146,147,148,187,188,202,203,206,208,215,217,218,219,220,222,224,225,260,286,293,336,337,340,342,346,349,351,352,353,354,372,378,380,395,418,419,432,433,437,439,442,443,454,457,458,463,464,466,479,480,481,483,487,488,501,502,504,505,510,517,522,523,524,526,527,528,],[-52,-309,-141,70,70,-29,-140,-68,-53,-7,-84,70,-8,70,-307,70,70,70,-309,-83,-69,-30,70,-85,-308,70,70,70,-36,-35,-73,-76,-72,-74,70,-78,-199,-198,-77,-200,70,-75,-309,-31,-34,-218,-217,-215,70,-201,-214,70,-80,-202,70,-12,70,-11,70,-33,-32,-213,-216,-205,70,-79,-203,-309,-182,70,70,70,-309,70,-204,70,70,70,-11,-209,-208,-206,-80,-309,70,70,-210,-207,70,-212,-211,]),'PPHASH':([0,12,14,17,23,26,34,40,42,53,68,101,104,120,131,258,353,],[42,-64,-60,-66,-65,42,-63,-62,-67,-68,-61,-83,-69,-70,-308,-71,-202,]),'INT':([0,1,2,3,5,6,7,8,9,10,11,12,14,15,16,17,18,19,20,21,23,24,25,26,29,30,32,33,34,35,36,37,39,40,41,42,44,45,47,48,49,50,51,53,54,55,56,57,60,61,63,64,65,67,68,69,70,71,72,73,74,78,80,83,87,91,92,96,101,102,103,104,105,113,117,120,121,122,123,124,125,126,127,128,129,130,131,132,133,139,145,173,187,188,189,201,202,203,206,208,215,217,218,219,220,222,225,231,232,233,234,235,236,237,238,244,249,258,277,286,287,288,291,293,296,327,331,336,337,339,340,346,349,351,352,353,356,357,360,362,363,398,418,419,432,433,437,442,443,480,501,502,504,505,523,524,527,528,],[50,-309,-104,-117,-115,-101,-99,-52,-97,-116,-98,-64,-60,-102,-93,-66,50,-96,-111,-106,-65,-95,-112,50,-221,-109,-113,50,-63,-118,50,-29,-107,-62,-103,-67,-114,-108,-309,-110,-309,-105,-119,-68,-100,-87,-10,-9,50,-53,50,-84,50,50,-61,-133,-307,-132,50,-153,-152,-166,-90,-92,50,-89,-91,-94,-83,-86,-88,-69,-30,50,50,-70,50,-85,50,50,50,-135,-130,-145,-146,-142,-308,50,50,-167,50,50,-36,-35,50,50,-73,-76,-72,-74,50,-78,-199,-198,-77,-200,-75,50,-139,50,-137,-134,-143,-131,-128,-129,-154,-71,50,-31,50,50,50,-34,50,50,50,-218,-217,50,-215,-201,-214,-78,-80,-202,-138,-136,-144,-156,-155,50,-33,-32,-213,-216,-205,-79,-203,-204,-209,-208,-206,-80,-210,-207,-212,-211,]),'SIGNED':([0,1,2,3,5,6,7,8,9,10,11,12,14,15,16,17,18,19,20,21,23,24,25,26,29,30,32,33,34,35,36,37,39,40,41,42,44,45,47,48,49,50,51,53,54,55,56,57,60,61,63,64,65,67,68,69,70,71,72,73,74,78,80,83,87,91,92,96,101,102,103,104,105,113,117,120,121,122,123,124,125,126,127,128,129,130,131,132,133,139,145,173,187,188,189,201,202,203,206,208,215,217,218,219,220,222,225,231,232,233,234,235,236,237,238,244,249,258,277,286,287,288,291,293,296,327,331,336,337,339,340,346,349,351,352,353,356,357,360,362,363,398,418,419,432,433,437,442,443,480,501,502,504,505,523,524,527,528,],[48,-309,-104,-117,-115,-101,-99,-52,-97,-116,-98,-64,-60,-102,-93,-66,48,-96,-111,-106,-65,-95,-112,48,-221,-109,-113,48,-63,-118,48,-29,-107,-62,-103,-67,-114,-108,-309,-110,-309,-105,-119,-68,-100,-87,-10,-9,48,-53,48,-84,48,48,-61,-133,-307,-132,48,-153,-152,-166,-90,-92,48,-89,-91,-94,-83,-86,-88,-69,-30,48,48,-70,48,-85,48,48,48,-135,-130,-145,-146,-142,-308,48,48,-167,48,48,-36,-35,48,48,-73,-76,-72,-74,48,-78,-199,-198,-77,-200,-75,48,-139,48,-137,-134,-143,-131,-128,-129,-154,-71,48,-31,48,48,48,-34,48,48,48,-218,-217,48,-215,-201,-214,-78,-80,-202,-138,-136,-144,-156,-155,48,-33,-32,-213,-216,-205,-79,-203,-204,-209,-208,-206,-80,-210,-207,-212,-211,]),'CONTINUE':([53,70,101,104,121,131,202,203,206,208,215,217,218,219,220,222,224,225,336,337,340,342,346,349,351,352,353,354,432,433,437,439,442,443,479,480,481,483,501,502,504,505,517,522,523,524,526,527,528,],[-68,-307,-83,-69,210,-308,-73,-76,-72,-74,210,-78,-199,-198,-77,-200,210,-75,-218,-217,-215,210,-201,-214,210,-80,-202,210,-213,-216,-205,210,-79,-203,210,-204,210,210,-209,-208,-206,-80,210,210,-210,-207,210,-212,-211,]),'NOT':([3,35,51,53,59,70,76,78,79,101,104,106,107,108,121,131,139,144,147,148,151,159,160,166,167,169,171,173,174,176,184,185,186,198,202,203,206,207,208,214,215,217,218,219,220,222,224,225,228,239,250,253,254,255,260,264,265,266,267,268,269,270,271,272,273,274,275,277,284,285,288,291,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,326,329,330,336,337,339,340,341,342,343,346,348,349,351,352,353,354,355,361,367,368,369,372,376,378,380,395,422,423,424,430,432,433,435,437,439,442,443,454,457,461,463,466,467,469,470,471,477,479,480,481,482,483,487,488,500,501,502,504,505,509,510,514,517,522,523,524,526,527,528,],[-117,-118,-119,-68,-309,-307,-28,-166,-27,-83,-69,184,-28,-309,184,-308,-167,-309,184,184,-270,184,-268,184,-267,184,-266,184,184,-265,-269,184,184,184,-73,-76,-72,184,-74,184,184,-78,-199,-198,-77,-200,184,-75,-266,184,184,184,-28,-309,-309,-227,-230,-228,-224,-225,-229,-231,184,-233,-234,-226,-232,184,184,184,184,184,184,184,184,184,184,184,184,184,184,184,184,184,184,184,184,184,184,184,184,-309,-266,184,-218,-217,184,-215,184,184,184,-201,184,-214,184,-80,-202,184,184,184,-266,184,184,-12,184,184,-11,184,184,-28,-309,-266,-213,-216,184,-205,184,-79,-203,-309,-182,184,184,-309,184,-266,184,184,184,184,-204,184,184,184,184,-11,184,-209,-208,-206,-80,184,-309,184,184,184,-210,-207,184,-212,-211,]),'OREQUAL':([115,131,150,152,153,154,155,156,157,158,161,162,170,172,175,177,178,180,181,229,276,278,279,280,282,289,290,292,297,383,384,385,386,389,394,458,459,460,465,507,511,520,],[-294,-308,-298,273,-286,-301,-305,-302,-299,-284,-285,-259,-297,-271,-303,-295,-283,-300,-296,-294,-306,-263,-304,-280,-279,-257,-262,-260,-261,-278,-277,-276,-275,-274,-287,-264,-272,-273,-258,-288,-281,-282,]),'MOD':([115,131,150,152,153,154,155,156,157,158,161,162,164,170,172,175,177,178,179,180,181,229,276,278,279,280,282,289,290,292,297,383,384,385,386,389,394,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,416,417,458,459,460,465,507,511,520,],[-294,-308,-298,-257,-286,-301,-305,-302,-299,-284,-285,-259,-238,-297,-271,-303,-295,-283,316,-300,-296,-294,-306,-263,-304,-280,-279,-257,-262,-260,-261,-278,-277,-276,-275,-274,-287,316,316,316,316,316,316,316,316,316,316,-240,-239,316,316,316,316,316,-241,-264,-272,-273,-258,-288,-281,-282,]),'RSHIFT':([115,131,150,152,153,154,155,156,157,158,161,162,164,170,172,175,177,178,179,180,181,229,276,278,279,280,282,289,290,292,297,383,384,385,386,389,394,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,416,417,458,459,460,465,507,511,520,],[-294,-308,-298,-257,-286,-301,-305,-302,-299,-284,-285,-259,-238,-297,-271,-303,-295,-283,298,-300,-296,-294,-306,-263,-304,-280,-279,-257,-262,-260,-261,-278,-277,-276,-275,-274,-287,-244,298,-245,-243,298,298,298,-242,298,298,-240,-239,298,298,298,298,298,-241,-264,-272,-273,-258,-288,-281,-282,]),'DEFAULT':([53,70,101,104,121,131,202,203,206,208,215,217,218,219,220,222,224,225,336,337,340,342,346,349,351,352,353,354,432,433,437,439,442,443,479,480,481,483,501,502,504,505,517,522,523,524,526,527,528,],[-68,-307,-83,-69,212,-308,-73,-76,-72,-74,212,-78,-199,-198,-77,-200,212,-75,-218,-217,-215,212,-201,-214,212,-80,-202,212,-213,-216,-205,212,-79,-203,212,-204,212,212,-209,-208,-206,-80,212,212,-210,-207,212,-212,-211,]),'__INT128':([0,1,2,3,5,6,7,8,9,10,11,12,14,15,16,17,18,19,20,21,23,24,25,26,29,30,32,33,34,35,36,37,39,40,41,42,44,45,47,48,49,50,51,53,54,55,56,57,60,61,63,64,65,67,68,69,70,71,72,73,74,78,80,83,87,91,92,96,101,102,103,104,105,113,117,120,121,122,123,124,125,126,127,128,129,130,131,132,133,139,145,173,187,188,189,201,202,203,206,208,215,217,218,219,220,222,225,231,232,233,234,235,236,237,238,244,249,258,277,286,287,288,291,293,296,327,331,336,337,339,340,346,349,351,352,353,356,357,360,362,363,398,418,419,432,433,437,442,443,480,501,502,504,505,523,524,527,528,],[25,-309,-104,-117,-115,-101,-99,-52,-97,-116,-98,-64,-60,-102,-93,-66,25,-96,-111,-106,-65,-95,-112,25,-221,-109,-113,25,-63,-118,25,-29,-107,-62,-103,-67,-114,-108,-309,-110,-309,-105,-119,-68,-100,-87,-10,-9,25,-53,25,-84,25,25,-61,-133,-307,-132,25,-153,-152,-166,-90,-92,25,-89,-91,-94,-83,-86,-88,-69,-30,25,25,-70,25,-85,25,25,25,-135,-130,-145,-146,-142,-308,25,25,-167,25,25,-36,-35,25,25,-73,-76,-72,-74,25,-78,-199,-198,-77,-200,-75,25,-139,25,-137,-134,-143,-131,-128,-129,-154,-71,25,-31,25,25,25,-34,25,25,25,-218,-217,25,-215,-201,-214,-78,-80,-202,-138,-136,-144,-156,-155,25,-33,-32,-213,-216,-205,-79,-203,-204,-209,-208,-206,-80,-210,-207,-212,-211,]),'WHILE':([53,70,101,104,121,131,202,203,206,208,215,217,218,219,220,222,224,225,336,337,340,342,346,349,350,351,352,353,354,432,433,437,439,442,443,479,480,481,483,501,502,504,505,517,522,523,524,526,527,528,],[-68,-307,-83,-69,213,-308,-73,-76,-72,-74,213,-78,-199,-198,-77,-200,213,-75,-218,-217,-215,213,-201,-214,441,213,-80,-202,213,-213,-216,-205,213,-79,-203,213,-204,213,213,-209,-208,-206,-80,213,213,-210,-207,213,-212,-211,]),'DIVEQUAL':([115,131,150,152,153,154,155,156,157,158,161,162,170,172,175,177,178,180,181,229,276,278,279,280,282,289,290,292,297,383,384,385,386,389,394,458,459,460,465,507,511,520,],[-294,-308,-298,264,-286,-301,-305,-302,-299,-284,-285,-259,-297,-271,-303,-295,-283,-300,-296,-294,-306,-263,-304,-280,-279,-257,-262,-260,-261,-278,-277,-276,-275,-274,-287,-264,-272,-273,-258,-288,-281,-282,]),'EXTERN':([0,1,2,3,5,6,7,8,9,10,11,12,14,15,16,17,18,19,20,21,23,24,25,26,29,30,32,33,34,35,37,39,40,41,42,44,45,47,48,49,50,51,53,54,60,61,63,64,67,68,69,70,71,73,74,80,83,87,91,92,96,101,104,105,113,120,121,122,126,131,145,187,188,189,201,202,203,206,208,215,217,218,219,220,222,225,232,234,235,249,258,286,293,327,331,336,337,339,340,346,349,351,352,353,356,357,362,363,398,418,419,432,433,437,442,443,480,501,502,504,505,523,524,527,528,],[11,11,-104,-117,-115,-101,-99,-52,-97,-116,-98,-64,-60,-102,-93,-66,11,-96,-111,-106,-65,-95,-112,11,-221,-109,-113,11,-63,-118,-29,-107,-62,-103,-67,-114,-108,11,-110,11,-105,-119,-68,-100,11,-53,11,-84,11,-61,-133,-307,-132,-153,-152,-90,-92,11,-89,-91,-94,-83,-69,-30,11,-70,11,-85,-135,-308,11,-36,-35,11,11,-73,-76,-72,-74,11,-78,-199,-198,-77,-200,-75,-139,-137,-134,-154,-71,-31,-34,11,11,-218,-217,11,-215,-201,-214,-78,-80,-202,-138,-136,-156,-155,11,-33,-32,-213,-216,-205,-79,-203,-204,-209,-208,-206,-80,-210,-207,-212,-211,]),'CASE':([53,70,101,104,121,131,202,203,206,208,215,217,218,219,220,222,224,225,336,337,340,342,346,349,351,352,353,354,432,433,437,439,442,443,479,480,481,483,501,502,504,505,517,522,523,524,526,527,528,],[-68,-307,-83,-69,214,-308,-73,-76,-72,-74,214,-78,-199,-198,-77,-200,214,-75,-218,-217,-215,214,-201,-214,214,-80,-202,214,-213,-216,-205,214,-79,-203,214,-204,214,214,-209,-208,-206,-80,214,214,-210,-207,214,-212,-211,]),'LAND':([115,131,150,152,153,154,155,156,157,158,161,162,164,170,172,175,177,178,179,180,181,229,276,278,279,280,282,289,290,292,297,383,384,385,386,389,394,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,416,417,458,459,460,465,507,511,520,],[-294,-308,-298,-257,-286,-301,-305,-302,-299,-284,-285,-259,-238,-297,-271,-303,-295,-283,311,-300,-296,-294,-306,-263,-304,-280,-279,-257,-262,-260,-261,-278,-277,-276,-275,-274,-287,-244,311,-245,-243,-247,-251,-246,-242,-249,-254,-240,-239,-248,-255,-250,-252,-253,-241,-264,-272,-273,-258,-288,-281,-282,]),'REGISTER':([0,1,2,3,5,6,7,8,9,10,11,12,14,15,16,17,18,19,20,21,23,24,25,26,29,30,32,33,34,35,37,39,40,41,42,44,45,47,48,49,50,51,53,54,60,61,63,64,67,68,69,70,71,73,74,80,83,87,91,92,96,101,104,105,113,120,121,122,126,131,145,187,188,189,201,202,203,206,208,215,217,218,219,220,222,225,232,234,235,249,258,286,293,327,331,336,337,339,340,346,349,351,352,353,356,357,362,363,398,418,419,432,433,437,442,443,480,501,502,504,505,523,524,527,528,],[19,19,-104,-117,-115,-101,-99,-52,-97,-116,-98,-64,-60,-102,-93,-66,19,-96,-111,-106,-65,-95,-112,19,-221,-109,-113,19,-63,-118,-29,-107,-62,-103,-67,-114,-108,19,-110,19,-105,-119,-68,-100,19,-53,19,-84,19,-61,-133,-307,-132,-153,-152,-90,-92,19,-89,-91,-94,-83,-69,-30,19,-70,19,-85,-135,-308,19,-36,-35,19,19,-73,-76,-72,-74,19,-78,-199,-198,-77,-200,-75,-139,-137,-134,-154,-71,-31,-34,19,19,-218,-217,19,-215,-201,-214,-78,-80,-202,-138,-136,-156,-155,19,-33,-32,-213,-216,-205,-79,-203,-204,-209,-208,-206,-80,-210,-207,-212,-211,]),'MODEQUAL':([115,131,150,152,153,154,155,156,157,158,161,162,170,172,175,177,178,180,181,229,276,278,279,280,282,289,290,292,297,383,384,385,386,389,394,458,459,460,465,507,511,520,],[-294,-308,-298,266,-286,-301,-305,-302,-299,-284,-285,-259,-297,-271,-303,-295,-283,-300,-296,-294,-306,-263,-304,-280,-279,-257,-262,-260,-261,-278,-277,-276,-275,-274,-287,-264,-272,-273,-258,-288,-281,-282,]),'NE':([115,131,150,152,153,154,155,156,157,158,161,162,164,170,172,175,177,178,179,180,181,229,276,278,279,280,282,289,290,292,297,383,384,385,386,389,394,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,416,417,458,459,460,465,507,511,520,],[-294,-308,-298,-257,-286,-301,-305,-302,-299,-284,-285,-259,-238,-297,-271,-303,-295,-283,303,-300,-296,-294,-306,-263,-304,-280,-279,-257,-262,-260,-261,-278,-277,-276,-275,-274,-287,-244,303,-245,-243,-247,-251,-246,-242,-249,303,-240,-239,-248,303,-250,303,303,-241,-264,-272,-273,-258,-288,-281,-282,]),'SWITCH':([53,70,101,104,121,131,202,203,206,208,215,217,218,219,220,222,224,225,336,337,340,342,346,349,351,352,353,354,432,433,437,439,442,443,479,480,481,483,501,502,504,505,517,522,523,524,526,527,528,],[-68,-307,-83,-69,216,-308,-73,-76,-72,-74,216,-78,-199,-198,-77,-200,216,-75,-218,-217,-215,216,-201,-214,216,-80,-202,216,-213,-216,-205,216,-79,-203,216,-204,216,216,-209,-208,-206,-80,216,216,-210,-207,216,-212,-211,]),'INT_CONST_HEX':([3,35,51,53,59,70,76,78,79,101,104,106,107,108,121,131,139,144,147,148,151,159,160,166,167,169,171,173,174,176,184,185,186,198,202,203,206,207,208,214,215,217,218,219,220,222,224,225,228,239,250,253,254,255,260,264,265,266,267,268,269,270,271,272,273,274,275,277,284,285,288,291,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,326,329,330,336,337,339,340,341,342,343,346,348,349,351,352,353,354,355,361,367,368,369,372,376,378,380,395,422,423,424,430,432,433,435,437,439,442,443,454,457,461,463,466,467,469,470,471,477,479,480,481,482,483,487,488,500,501,502,504,505,509,510,514,517,522,523,524,526,527,528,],[-117,-118,-119,-68,-309,-307,-28,-166,-27,-83,-69,170,-28,-309,170,-308,-167,-309,170,170,-270,170,-268,170,-267,170,-266,170,170,-265,-269,170,170,170,-73,-76,-72,170,-74,170,170,-78,-199,-198,-77,-200,170,-75,-266,170,170,170,-28,-309,-309,-227,-230,-228,-224,-225,-229,-231,170,-233,-234,-226,-232,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,-309,-266,170,-218,-217,170,-215,170,170,170,-201,170,-214,170,-80,-202,170,170,170,-266,170,170,-12,170,170,-11,170,170,-28,-309,-266,-213,-216,170,-205,170,-79,-203,-309,-182,170,170,-309,170,-266,170,170,170,170,-204,170,170,170,170,-11,170,-209,-208,-206,-80,170,-309,170,170,170,-210,-207,170,-212,-211,]),'_COMPLEX':([0,1,2,3,5,6,7,8,9,10,11,12,14,15,16,17,18,19,20,21,23,24,25,26,29,30,32,33,34,35,36,37,39,40,41,42,44,45,47,48,49,50,51,53,54,55,56,57,60,61,63,64,65,67,68,69,70,71,72,73,74,78,80,83,87,91,92,96,101,102,103,104,105,113,117,120,121,122,123,124,125,126,127,128,129,130,131,132,133,139,145,173,187,188,189,201,202,203,206,208,215,217,218,219,220,222,225,231,232,233,234,235,236,237,238,244,249,258,277,286,287,288,291,293,296,327,331,336,337,339,340,346,349,351,352,353,356,357,360,362,363,398,418,419,432,433,437,442,443,480,501,502,504,505,523,524,527,528,],[30,-309,-104,-117,-115,-101,-99,-52,-97,-116,-98,-64,-60,-102,-93,-66,30,-96,-111,-106,-65,-95,-112,30,-221,-109,-113,30,-63,-118,30,-29,-107,-62,-103,-67,-114,-108,-309,-110,-309,-105,-119,-68,-100,-87,-10,-9,30,-53,30,-84,30,30,-61,-133,-307,-132,30,-153,-152,-166,-90,-92,30,-89,-91,-94,-83,-86,-88,-69,-30,30,30,-70,30,-85,30,30,30,-135,-130,-145,-146,-142,-308,30,30,-167,30,30,-36,-35,30,30,-73,-76,-72,-74,30,-78,-199,-198,-77,-200,-75,30,-139,30,-137,-134,-143,-131,-128,-129,-154,-71,30,-31,30,30,30,-34,30,30,30,-218,-217,30,-215,-201,-214,-78,-80,-202,-138,-136,-144,-156,-155,30,-33,-32,-213,-216,-205,-79,-203,-204,-209,-208,-206,-80,-210,-207,-212,-211,]),'PPPRAGMASTR':([53,],[104,]),'PLUSEQUAL':([115,131,150,152,153,154,155,156,157,158,161,162,170,172,175,177,178,180,181,229,276,278,279,280,282,289,290,292,297,383,384,385,386,389,394,458,459,460,465,507,511,520,],[-294,-308,-298,269,-286,-301,-305,-302,-299,-284,-285,-259,-297,-271,-303,-295,-283,-300,-296,-294,-306,-263,-304,-280,-279,-257,-262,-260,-261,-278,-277,-276,-275,-274,-287,-264,-272,-273,-258,-288,-281,-282,]),'STRUCT':([0,1,3,7,8,9,11,12,14,17,18,19,23,24,26,34,35,36,37,40,42,47,49,51,53,54,55,56,57,60,61,64,65,67,68,70,72,78,87,101,102,103,104,105,117,120,121,122,123,124,125,128,129,130,131,132,139,145,173,187,188,189,201,202,203,206,208,215,217,218,219,220,222,225,231,233,236,258,277,286,287,288,291,293,327,331,336,337,339,340,346,349,351,352,353,360,398,418,419,432,433,437,442,443,480,501,502,504,505,523,524,527,528,],[38,-309,-117,-99,-52,-97,-98,-64,-60,-66,38,-96,-65,-95,38,-63,-118,38,-29,-62,-67,-309,-309,-119,-68,-100,-87,-10,-9,38,-53,-84,38,38,-61,-307,38,-166,38,-83,-86,-88,-69,-30,38,-70,38,-85,38,38,38,-145,-146,-142,-308,38,-167,38,38,-36,-35,38,38,-73,-76,-72,-74,38,-78,-199,-198,-77,-200,-75,38,38,-143,-71,38,-31,38,38,38,-34,38,38,-218,-217,38,-215,-201,-214,-78,-80,-202,-144,38,-33,-32,-213,-216,-205,-79,-203,-204,-209,-208,-206,-80,-210,-207,-212,-211,]),'CONDOP':([115,131,150,152,153,154,155,156,157,158,161,162,164,170,172,175,177,178,179,180,181,229,276,278,279,280,282,289,290,292,297,383,384,385,386,389,394,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,416,417,458,459,460,465,507,511,520,],[-294,-308,-298,-257,-286,-301,-305,-302,-299,-284,-285,-259,-238,-297,-271,-303,-295,-283,314,-300,-296,-294,-306,-263,-304,-280,-279,-257,-262,-260,-261,-278,-277,-276,-275,-274,-287,-244,-256,-245,-243,-247,-251,-246,-242,-249,-254,-240,-239,-248,-255,-250,-252,-253,-241,-264,-272,-273,-258,-288,-281,-282,]),'BREAK':([53,70,101,104,121,131,202,203,206,208,215,217,218,219,220,222,224,225,336,337,340,342,346,349,351,352,353,354,432,433,437,439,442,443,479,480,481,483,501,502,504,505,517,522,523,524,526,527,528,],[-68,-307,-83,-69,221,-308,-73,-76,-72,-74,221,-78,-199,-198,-77,-200,221,-75,-218,-217,-215,221,-201,-214,221,-80,-202,221,-213,-216,-205,221,-79,-203,221,-204,221,221,-209,-208,-206,-80,221,221,-210,-207,221,-212,-211,]),'VOLATILE':([0,1,2,3,5,6,7,8,9,10,11,12,14,15,16,17,18,19,20,21,23,24,25,26,29,30,31,32,33,34,35,37,39,40,41,42,44,45,47,48,49,50,51,53,54,59,60,61,63,64,67,68,69,70,71,72,73,74,76,78,80,83,87,91,92,96,101,104,105,107,108,113,120,121,122,123,124,125,126,127,128,129,130,131,132,133,139,144,145,173,187,188,189,201,202,203,206,208,215,217,218,219,220,222,225,231,232,233,234,235,236,237,238,244,249,254,255,258,277,286,287,288,291,293,296,326,327,331,336,337,339,340,346,349,351,352,353,356,357,360,362,363,398,418,419,423,424,432,433,437,442,443,480,501,502,504,505,523,524,527,528,],[51,51,-104,-117,-115,-101,-99,-52,-97,-116,-98,-64,-60,-102,-93,-66,51,-96,-111,-106,-65,-95,-112,51,-221,-109,51,-113,51,-63,-118,-29,-107,-62,-103,-67,-114,-108,51,-110,51,-105,-119,-68,-100,51,51,-53,51,-84,51,-61,-133,-307,-132,51,-153,-152,51,-166,-90,-92,51,-89,-91,-94,-83,-69,-30,51,51,51,-70,51,-85,51,51,51,-135,-130,-145,-146,-142,-308,51,51,-167,51,51,51,-36,-35,51,51,-73,-76,-72,-74,51,-78,-199,-198,-77,-200,-75,51,-139,51,-137,-134,-143,-131,-128,-129,-154,51,51,-71,51,-31,51,51,51,-34,51,51,51,51,-218,-217,51,-215,-201,-214,-78,-80,-202,-138,-136,-144,-156,-155,51,-33,-32,51,51,-213,-216,-205,-79,-203,-204,-209,-208,-206,-80,-210,-207,-212,-211,]),'PPPRAGMA':([0,12,14,17,23,26,34,40,42,53,68,70,72,101,104,120,121,123,124,125,128,129,130,131,202,203,206,208,215,217,218,219,220,222,224,225,231,233,236,258,336,337,340,342,346,349,351,352,353,354,360,432,433,437,439,442,443,479,480,481,483,501,502,504,505,517,522,523,524,526,527,528,],[53,-64,-60,-66,-65,53,-63,-62,-67,-68,-61,-307,53,-83,-69,-70,53,53,53,53,-145,-146,-142,-308,-73,-76,-72,-74,53,-78,-199,-198,-77,-200,53,-75,53,53,-143,-71,-218,-217,-215,53,-201,-214,53,-80,-202,53,-144,-213,-216,-205,53,-79,-203,53,-204,53,53,-209,-208,-206,-80,53,53,-210,-207,53,-212,-211,]),'INLINE':([0,1,2,3,5,6,7,8,9,10,11,12,14,15,16,17,18,19,20,21,23,24,25,26,29,30,32,33,34,35,37,39,40,41,42,44,45,47,48,49,50,51,53,54,60,61,63,64,67,68,69,70,71,73,74,80,83,87,91,92,96,101,104,105,113,120,121,122,126,131,145,187,188,189,201,202,203,206,208,215,217,218,219,220,222,225,232,234,235,249,258,286,293,327,331,336,337,339,340,346,349,351,352,353,356,357,362,363,398,418,419,432,433,437,442,443,480,501,502,504,505,523,524,527,528,],[54,54,-104,-117,-115,-101,-99,-52,-97,-116,-98,-64,-60,-102,-93,-66,54,-96,-111,-106,-65,-95,-112,54,-221,-109,-113,54,-63,-118,-29,-107,-62,-103,-67,-114,-108,54,-110,54,-105,-119,-68,-100,54,-53,54,-84,54,-61,-133,-307,-132,-153,-152,-90,-92,54,-89,-91,-94,-83,-69,-30,54,-70,54,-85,-135,-308,54,-36,-35,54,54,-73,-76,-72,-74,54,-78,-199,-198,-77,-200,-75,-139,-137,-134,-154,-71,-31,-34,54,54,-218,-217,54,-215,-201,-214,-78,-80,-202,-138,-136,-156,-155,54,-33,-32,-213,-216,-205,-79,-203,-204,-209,-208,-206,-80,-210,-207,-212,-211,]),'INT_CONST_BIN':([3,35,51,53,59,70,76,78,79,101,104,106,107,108,121,131,139,144,147,148,151,159,160,166,167,169,171,173,174,176,184,185,186,198,202,203,206,207,208,214,215,217,218,219,220,222,224,225,228,239,250,253,254,255,260,264,265,266,267,268,269,270,271,272,273,274,275,277,284,285,288,291,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,326,329,330,336,337,339,340,341,342,343,346,348,349,351,352,353,354,355,361,367,368,369,372,376,378,380,395,422,423,424,430,432,433,435,437,439,442,443,454,457,461,463,466,467,469,470,471,477,479,480,481,482,483,487,488,500,501,502,504,505,509,510,514,517,522,523,524,526,527,528,],[-117,-118,-119,-68,-309,-307,-28,-166,-27,-83,-69,150,-28,-309,150,-308,-167,-309,150,150,-270,150,-268,150,-267,150,-266,150,150,-265,-269,150,150,150,-73,-76,-72,150,-74,150,150,-78,-199,-198,-77,-200,150,-75,-266,150,150,150,-28,-309,-309,-227,-230,-228,-224,-225,-229,-231,150,-233,-234,-226,-232,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,-309,-266,150,-218,-217,150,-215,150,150,150,-201,150,-214,150,-80,-202,150,150,150,-266,150,150,-12,150,150,-11,150,150,-28,-309,-266,-213,-216,150,-205,150,-79,-203,-309,-182,150,150,-309,150,-266,150,150,150,150,-204,150,150,150,150,-11,150,-209,-208,-206,-80,150,-309,150,150,150,-210,-207,150,-212,-211,]),'DO':([53,70,101,104,121,131,202,203,206,208,215,217,218,219,220,222,224,225,336,337,340,342,346,349,351,352,353,354,432,433,437,439,442,443,479,480,481,483,501,502,504,505,517,522,523,524,526,527,528,],[-68,-307,-83,-69,224,-308,-73,-76,-72,-74,224,-78,-199,-198,-77,-200,224,-75,-218,-217,-215,224,-201,-214,224,-80,-202,224,-213,-216,-205,224,-79,-203,224,-204,224,224,-209,-208,-206,-80,224,224,-210,-207,224,-212,-211,]),'LNOT':([3,35,51,53,59,70,76,78,79,101,104,106,107,108,121,131,139,144,147,148,151,159,160,166,167,169,171,173,174,176,184,185,186,198,202,203,206,207,208,214,215,217,218,219,220,222,224,225,228,239,250,253,254,255,260,264,265,266,267,268,269,270,271,272,273,274,275,277,284,285,288,291,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,326,329,330,336,337,339,340,341,342,343,346,348,349,351,352,353,354,355,361,367,368,369,372,376,378,380,395,422,423,424,430,432,433,435,437,439,442,443,454,457,461,463,466,467,469,470,471,477,479,480,481,482,483,487,488,500,501,502,504,505,509,510,514,517,522,523,524,526,527,528,],[-117,-118,-119,-68,-309,-307,-28,-166,-27,-83,-69,151,-28,-309,151,-308,-167,-309,151,151,-270,151,-268,151,-267,151,-266,151,151,-265,-269,151,151,151,-73,-76,-72,151,-74,151,151,-78,-199,-198,-77,-200,151,-75,-266,151,151,151,-28,-309,-309,-227,-230,-228,-224,-225,-229,-231,151,-233,-234,-226,-232,151,151,151,151,151,151,151,151,151,151,151,151,151,151,151,151,151,151,151,151,151,151,151,151,-309,-266,151,-218,-217,151,-215,151,151,151,-201,151,-214,151,-80,-202,151,151,151,-266,151,151,-12,151,151,-11,151,151,-28,-309,-266,-213,-216,151,-205,151,-79,-203,-309,-182,151,151,-309,151,-266,151,151,151,151,-204,151,151,151,151,-11,151,-209,-208,-206,-80,151,-309,151,151,151,-210,-207,151,-212,-211,]),'CONST':([0,1,2,3,5,6,7,8,9,10,11,12,14,15,16,17,18,19,20,21,23,24,25,26,29,30,31,32,33,34,35,37,39,40,41,42,44,45,47,48,49,50,51,53,54,59,60,61,63,64,67,68,69,70,71,72,73,74,76,78,80,83,87,91,92,96,101,104,105,107,108,113,120,121,122,123,124,125,126,127,128,129,130,131,132,133,139,144,145,173,187,188,189,201,202,203,206,208,215,217,218,219,220,222,225,231,232,233,234,235,236,237,238,244,249,254,255,258,277,286,287,288,291,293,296,326,327,331,336,337,339,340,346,349,351,352,353,356,357,360,362,363,398,418,419,423,424,432,433,437,442,443,480,501,502,504,505,523,524,527,528,],[3,3,-104,-117,-115,-101,-99,-52,-97,-116,-98,-64,-60,-102,-93,-66,3,-96,-111,-106,-65,-95,-112,3,-221,-109,3,-113,3,-63,-118,-29,-107,-62,-103,-67,-114,-108,3,-110,3,-105,-119,-68,-100,3,3,-53,3,-84,3,-61,-133,-307,-132,3,-153,-152,3,-166,-90,-92,3,-89,-91,-94,-83,-69,-30,3,3,3,-70,3,-85,3,3,3,-135,-130,-145,-146,-142,-308,3,3,-167,3,3,3,-36,-35,3,3,-73,-76,-72,-74,3,-78,-199,-198,-77,-200,-75,3,-139,3,-137,-134,-143,-131,-128,-129,-154,3,3,-71,3,-31,3,3,3,-34,3,3,3,3,-218,-217,3,-215,-201,-214,-78,-80,-202,-138,-136,-144,-156,-155,3,-33,-32,3,3,-213,-216,-205,-79,-203,-204,-209,-208,-206,-80,-210,-207,-212,-211,]),'LOR':([115,131,150,152,153,154,155,156,157,158,161,162,164,170,172,175,177,178,179,180,181,229,276,278,279,280,282,289,290,292,297,383,384,385,386,389,394,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,416,417,458,459,460,465,507,511,520,],[-294,-308,-298,-257,-286,-301,-305,-302,-299,-284,-285,-259,-238,-297,-271,-303,-295,-283,299,-300,-296,-294,-306,-263,-304,-280,-279,-257,-262,-260,-261,-278,-277,-276,-275,-274,-287,-244,-256,-245,-243,-247,-251,-246,-242,-249,-254,-240,-239,-248,-255,-250,-252,-253,-241,-264,-272,-273,-258,-288,-281,-282,]),'CHAR_CONST':([3,35,51,53,59,70,76,78,79,101,104,106,107,108,121,131,139,144,147,148,151,159,160,166,167,169,171,173,174,176,184,185,186,198,202,203,206,207,208,214,215,217,218,219,220,222,224,225,228,239,250,253,254,255,260,264,265,266,267,268,269,270,271,272,273,274,275,277,284,285,288,291,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,326,329,330,336,337,339,340,341,342,343,346,348,349,351,352,353,354,355,361,367,368,369,372,376,378,380,395,422,423,424,430,432,433,435,437,439,442,443,454,457,461,463,466,467,469,470,471,477,479,480,481,482,483,487,488,500,501,502,504,505,509,510,514,517,522,523,524,526,527,528,],[-117,-118,-119,-68,-309,-307,-28,-166,-27,-83,-69,154,-28,-309,154,-308,-167,-309,154,154,-270,154,-268,154,-267,154,-266,154,154,-265,-269,154,154,154,-73,-76,-72,154,-74,154,154,-78,-199,-198,-77,-200,154,-75,-266,154,154,154,-28,-309,-309,-227,-230,-228,-224,-225,-229,-231,154,-233,-234,-226,-232,154,154,154,154,154,154,154,154,154,154,154,154,154,154,154,154,154,154,154,154,154,154,154,154,-309,-266,154,-218,-217,154,-215,154,154,154,-201,154,-214,154,-80,-202,154,154,154,-266,154,154,-12,154,154,-11,154,154,-28,-309,-266,-213,-216,154,-205,154,-79,-203,-309,-182,154,154,-309,154,-266,154,154,154,154,-204,154,154,154,154,-11,154,-209,-208,-206,-80,154,-309,154,154,154,-210,-207,154,-212,-211,]),'LSHIFT':([115,131,150,152,153,154,155,156,157,158,161,162,164,170,172,175,177,178,179,180,181,229,276,278,279,280,282,289,290,292,297,383,384,385,386,389,394,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,416,417,458,459,460,465,507,511,520,],[-294,-308,-298,-257,-286,-301,-305,-302,-299,-284,-285,-259,-238,-297,-271,-303,-295,-283,300,-300,-296,-294,-306,-263,-304,-280,-279,-257,-262,-260,-261,-278,-277,-276,-275,-274,-287,-244,300,-245,-243,300,300,300,-242,300,300,-240,-239,300,300,300,300,300,-241,-264,-272,-273,-258,-288,-281,-282,]),'RBRACE':([53,70,72,101,104,115,121,123,124,125,128,129,130,131,136,137,138,150,152,153,154,155,156,157,158,161,162,164,170,172,175,177,178,179,180,181,183,202,203,206,208,215,217,218,219,220,222,223,225,226,231,233,236,246,247,248,260,261,276,278,279,280,282,289,290,292,297,336,337,340,345,346,349,351,352,353,360,364,365,373,377,380,381,383,384,385,386,389,394,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,416,417,432,433,437,442,443,451,454,455,458,459,460,465,480,489,493,494,501,502,504,505,506,507,510,511,520,523,524,527,528,],[-68,-307,131,-83,-69,-294,-309,131,131,131,-145,-146,-142,-308,-157,131,-160,-298,-257,-286,-301,-305,-302,-299,-284,-285,-259,-238,-297,-271,-303,-295,-283,-236,-300,-296,-222,-73,-76,-72,-74,-6,-78,-199,-198,-77,-200,-5,-75,131,131,131,-143,131,131,-158,-309,-177,-306,-263,-304,-280,-279,-257,-262,-260,-261,-218,-217,-215,-235,-201,-214,-78,-80,-202,-144,-159,-161,131,-22,-21,-223,-278,-277,-276,-275,-274,-287,-244,-256,-245,-243,-247,-251,-246,-242,-249,-254,-240,-239,-248,-255,-250,-252,-253,-241,-213,-216,-205,-79,-203,-178,131,-180,-264,-272,-273,-258,-204,-179,131,-237,-209,-208,-206,-80,-181,-288,131,-281,-282,-210,-207,-212,-211,]),'_BOOL':([0,1,2,3,5,6,7,8,9,10,11,12,14,15,16,17,18,19,20,21,23,24,25,26,29,30,32,33,34,35,36,37,39,40,41,42,44,45,47,48,49,50,51,53,54,55,56,57,60,61,63,64,65,67,68,69,70,71,72,73,74,78,80,83,87,91,92,96,101,102,103,104,105,113,117,120,121,122,123,124,125,126,127,128,129,130,131,132,133,139,145,173,187,188,189,201,202,203,206,208,215,217,218,219,220,222,225,231,232,233,234,235,236,237,238,244,249,258,277,286,287,288,291,293,296,327,331,336,337,339,340,346,349,351,352,353,356,357,360,362,363,398,418,419,432,433,437,442,443,480,501,502,504,505,523,524,527,528,],[15,-309,-104,-117,-115,-101,-99,-52,-97,-116,-98,-64,-60,-102,-93,-66,15,-96,-111,-106,-65,-95,-112,15,-221,-109,-113,15,-63,-118,15,-29,-107,-62,-103,-67,-114,-108,-309,-110,-309,-105,-119,-68,-100,-87,-10,-9,15,-53,15,-84,15,15,-61,-133,-307,-132,15,-153,-152,-166,-90,-92,15,-89,-91,-94,-83,-86,-88,-69,-30,15,15,-70,15,-85,15,15,15,-135,-130,-145,-146,-142,-308,15,15,-167,15,15,-36,-35,15,15,-73,-76,-72,-74,15,-78,-199,-198,-77,-200,-75,15,-139,15,-137,-134,-143,-131,-128,-129,-154,-71,15,-31,15,15,15,-34,15,15,15,-218,-217,15,-215,-201,-214,-78,-80,-202,-138,-136,-144,-156,-155,15,-33,-32,-213,-216,-205,-79,-203,-204,-209,-208,-206,-80,-210,-207,-212,-211,]),'LE':([115,131,150,152,153,154,155,156,157,158,161,162,164,170,172,175,177,178,179,180,181,229,276,278,279,280,282,289,290,292,297,383,384,385,386,389,394,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,416,417,458,459,460,465,507,511,520,],[-294,-308,-298,-257,-286,-301,-305,-302,-299,-284,-285,-259,-238,-297,-271,-303,-295,-283,302,-300,-296,-294,-306,-263,-304,-280,-279,-257,-262,-260,-261,-278,-277,-276,-275,-274,-287,-244,302,-245,-243,-247,302,-246,-242,-249,302,-240,-239,-248,302,302,302,302,-241,-264,-272,-273,-258,-288,-281,-282,]),'SEMI':([0,1,2,3,5,6,7,8,9,10,11,12,14,15,16,17,19,20,21,23,24,25,26,29,30,32,33,34,35,36,37,39,40,41,42,44,45,46,47,48,49,50,51,53,54,55,56,57,61,63,65,68,69,70,71,72,73,74,80,82,83,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,115,119,120,121,123,124,125,126,127,128,129,130,131,133,143,150,152,153,154,155,156,157,158,161,162,164,170,172,175,177,178,179,180,181,183,187,188,202,203,205,206,207,208,210,211,215,217,218,219,220,221,222,223,224,225,227,229,231,232,233,234,235,236,237,238,240,241,242,243,244,245,249,251,252,258,259,261,262,263,276,278,279,280,282,286,289,290,292,293,297,335,336,337,338,339,340,342,345,346,347,349,351,352,353,354,356,357,358,360,362,363,370,371,381,383,384,385,386,389,394,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,416,417,418,419,432,433,434,435,436,437,439,442,443,445,446,447,448,451,458,459,460,465,477,478,479,480,481,483,484,485,489,494,499,501,502,504,505,507,511,516,517,520,522,523,524,526,527,528,],[17,-309,-104,-117,-115,-101,-99,-52,-97,-116,-98,-64,-60,-102,-93,-66,-96,-111,-106,-65,-95,-112,17,-221,-109,-113,-309,-63,-118,-309,-29,-107,-62,-103,-67,-114,-108,101,-309,-110,-309,-105,-119,-68,-100,-87,-10,-9,-53,-309,-309,-61,-133,-307,-132,128,-153,-152,-90,-20,-92,-54,-163,-162,-37,-122,-81,-89,-91,-19,-120,-124,-94,-126,-16,-82,-15,-83,-86,-88,-69,-30,-294,-162,-70,-309,128,128,128,-135,-130,-145,-146,-142,-308,-309,-55,-298,-257,-286,-301,-305,-302,-299,-284,-285,-259,-238,-297,-271,-303,-295,-283,-236,-300,-296,-222,-36,-35,-73,-76,336,-72,337,-74,340,-14,-309,-78,-199,-198,-77,349,-200,-13,-309,-75,-219,-294,128,-139,128,-137,-134,-143,-131,-128,-26,-25,360,-147,-129,-149,-154,-38,-121,-71,-123,-177,-127,-125,-306,-263,-304,-280,-279,-31,-257,-262,-260,-34,-261,432,-218,-217,433,-309,-215,-309,-235,-201,-13,-214,-78,-80,-202,-309,-138,-136,-151,-144,-156,-155,-44,-43,-223,-278,-277,-276,-275,-274,-287,-244,-256,-245,-243,-247,-251,-246,-242,-249,-254,-240,-239,-248,-255,-250,-252,-253,-241,-33,-32,-213,-216,477,-309,-220,-205,-309,-79,-203,-148,-150,-39,-42,-178,-264,-272,-273,-258,-309,500,-309,-204,-309,-309,-41,-40,-179,-237,514,-209,-208,-206,-80,-288,-281,523,-309,-282,-309,-210,-207,-309,-212,-211,]),'LT':([115,131,150,152,153,154,155,156,157,158,161,162,164,170,172,175,177,178,179,180,181,229,276,278,279,280,282,289,290,292,297,383,384,385,386,389,394,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,416,417,458,459,460,465,507,511,520,],[-294,-308,-298,-257,-286,-301,-305,-302,-299,-284,-285,-259,-238,-297,-271,-303,-295,-283,304,-300,-296,-294,-306,-263,-304,-280,-279,-257,-262,-260,-261,-278,-277,-276,-275,-274,-287,-244,304,-245,-243,-247,304,-246,-242,-249,304,-240,-239,-248,304,304,304,304,-241,-264,-272,-273,-258,-288,-281,-282,]),'COMMA':([2,3,5,6,7,8,9,10,11,15,16,19,20,21,24,25,29,30,31,32,35,37,39,41,44,45,48,50,51,54,61,69,71,73,74,76,77,78,79,80,82,83,85,86,87,88,89,91,92,94,95,96,97,98,105,112,113,114,115,116,118,119,126,127,131,136,137,138,139,140,143,150,152,153,154,155,156,157,158,161,162,164,170,172,175,177,178,179,180,181,183,187,188,190,191,192,193,194,195,196,197,199,211,227,229,232,234,235,237,238,240,243,244,245,246,247,248,249,251,252,259,261,262,263,276,278,279,280,282,286,289,290,292,293,294,296,297,324,325,332,334,338,345,356,357,358,362,363,364,365,370,371,377,381,383,384,385,386,387,388,389,390,391,394,396,397,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,420,421,427,428,436,438,440,444,445,446,447,448,451,455,458,459,460,465,472,473,474,475,476,484,485,489,490,493,494,495,496,503,506,507,511,512,513,519,520,],[-104,-117,-115,-101,-99,-52,-97,-116,-98,-102,-93,-96,-111,-106,-95,-112,-221,-109,-309,-113,-118,-29,-107,-103,-114,-108,-110,-105,-119,-100,-53,-133,-132,-153,-152,-28,-164,-166,-27,-90,142,-92,-54,-163,-162,-37,-122,-89,-91,-120,-124,-94,-126,149,-30,-170,-309,200,-294,201,-175,-162,-135,-130,-308,-157,248,-160,-167,-165,-55,-298,-257,-286,-301,-305,-302,-299,-284,-285,-259,-238,-297,-271,-303,-295,-283,-236,-300,-296,-222,-36,-35,-174,-2,-188,-56,-172,-1,-45,-173,-190,341,-219,-294,-139,-137,-134,-131,-128,359,-147,-129,-149,248,248,-158,-154,-38,-121,-123,-177,-127,-125,-306,-263,-304,-280,-279,-31,-257,-262,-260,-34,341,-309,-261,-57,-189,-176,-171,341,-235,-138,-136,-151,-156,-155,-159,-161,-44,-43,454,-223,-278,-277,-276,-275,341,-292,-274,461,462,-287,-187,-188,-244,-256,-245,-243,-247,-251,-246,-242,-249,-254,-240,-239,-248,-255,-250,-252,341,-253,-241,-33,-32,-197,-191,-193,-195,-220,341,341,341,-148,-150,-39,-42,-178,-180,-264,-272,-273,-258,-51,-50,-192,-194,-196,-41,-40,-179,-293,510,-237,-46,-49,341,-181,-288,-281,-48,-47,341,-282,]),'OFFSETOF':([3,35,51,53,59,70,76,78,79,101,104,106,107,108,121,131,139,144,147,148,151,159,160,166,167,169,171,173,174,176,184,185,186,198,202,203,206,207,208,214,215,217,218,219,220,222,224,225,228,239,250,253,254,255,260,264,265,266,267,268,269,270,271,272,273,274,275,277,284,285,288,291,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,326,329,330,336,337,339,340,341,342,343,346,348,349,351,352,353,354,355,361,367,368,369,372,376,378,380,395,422,423,424,430,432,433,435,437,439,442,443,454,457,461,463,466,467,469,470,471,477,479,480,481,482,483,487,488,500,501,502,504,505,509,510,514,517,522,523,524,526,527,528,],[-117,-118,-119,-68,-309,-307,-28,-166,-27,-83,-69,165,-28,-309,165,-308,-167,-309,165,165,-270,165,-268,165,-267,165,-266,165,165,-265,-269,165,165,165,-73,-76,-72,165,-74,165,165,-78,-199,-198,-77,-200,165,-75,-266,165,165,165,-28,-309,-309,-227,-230,-228,-224,-225,-229,-231,165,-233,-234,-226,-232,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,-309,-266,165,-218,-217,165,-215,165,165,165,-201,165,-214,165,-80,-202,165,165,165,-266,165,165,-12,165,165,-11,165,165,-28,-309,-266,-213,-216,165,-205,165,-79,-203,-309,-182,165,165,-309,165,-266,165,165,165,165,-204,165,165,165,165,-11,165,-209,-208,-206,-80,165,-309,165,165,165,-210,-207,165,-212,-211,]),'TYPEDEF':([0,1,2,3,5,6,7,8,9,10,11,12,14,15,16,17,18,19,20,21,23,24,25,26,29,30,32,33,34,35,37,39,40,41,42,44,45,47,48,49,50,51,53,54,60,61,63,64,67,68,69,70,71,73,74,80,83,87,91,92,96,101,104,105,113,120,121,122,126,131,145,187,188,189,201,202,203,206,208,215,217,218,219,220,222,225,232,234,235,249,258,286,293,327,331,336,337,339,340,346,349,351,352,353,356,357,362,363,398,418,419,432,433,437,442,443,480,501,502,504,505,523,524,527,528,],[7,7,-104,-117,-115,-101,-99,-52,-97,-116,-98,-64,-60,-102,-93,-66,7,-96,-111,-106,-65,-95,-112,7,-221,-109,-113,7,-63,-118,-29,-107,-62,-103,-67,-114,-108,7,-110,7,-105,-119,-68,-100,7,-53,7,-84,7,-61,-133,-307,-132,-153,-152,-90,-92,7,-89,-91,-94,-83,-69,-30,7,-70,7,-85,-135,-308,7,-36,-35,7,7,-73,-76,-72,-74,7,-78,-199,-198,-77,-200,-75,-139,-137,-134,-154,-71,-31,-34,7,7,-218,-217,7,-215,-201,-214,-78,-80,-202,-138,-136,-156,-155,7,-33,-32,-213,-216,-205,-79,-203,-204,-209,-208,-206,-80,-210,-207,-212,-211,]),'XOR':([115,131,150,152,153,154,155,156,157,158,161,162,164,170,172,175,177,178,179,180,181,229,276,278,279,280,282,289,290,292,297,383,384,385,386,389,394,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,416,417,458,459,460,465,507,511,520,],[-294,-308,-298,-257,-286,-301,-305,-302,-299,-284,-285,-259,-238,-297,-271,-303,-295,-283,307,-300,-296,-294,-306,-263,-304,-280,-279,-257,-262,-260,-261,-278,-277,-276,-275,-274,-287,-244,307,-245,-243,-247,-251,-246,-242,-249,-254,-240,-239,-248,307,-250,-252,307,-241,-264,-272,-273,-258,-288,-281,-282,]),'AUTO':([0,1,2,3,5,6,7,8,9,10,11,12,14,15,16,17,18,19,20,21,23,24,25,26,29,30,32,33,34,35,37,39,40,41,42,44,45,47,48,49,50,51,53,54,60,61,63,64,67,68,69,70,71,73,74,80,83,87,91,92,96,101,104,105,113,120,121,122,126,131,145,187,188,189,201,202,203,206,208,215,217,218,219,220,222,225,232,234,235,249,258,286,293,327,331,336,337,339,340,346,349,351,352,353,356,357,362,363,398,418,419,432,433,437,442,443,480,501,502,504,505,523,524,527,528,],[24,24,-104,-117,-115,-101,-99,-52,-97,-116,-98,-64,-60,-102,-93,-66,24,-96,-111,-106,-65,-95,-112,24,-221,-109,-113,24,-63,-118,-29,-107,-62,-103,-67,-114,-108,24,-110,24,-105,-119,-68,-100,24,-53,24,-84,24,-61,-133,-307,-132,-153,-152,-90,-92,24,-89,-91,-94,-83,-69,-30,24,-70,24,-85,-135,-308,24,-36,-35,24,24,-73,-76,-72,-74,24,-78,-199,-198,-77,-200,-75,-139,-137,-134,-154,-71,-31,-34,24,24,-218,-217,24,-215,-201,-214,-78,-80,-202,-138,-136,-156,-155,24,-33,-32,-213,-216,-205,-79,-203,-204,-209,-208,-206,-80,-210,-207,-212,-211,]),'TIMES':([0,1,2,3,4,5,6,7,9,10,11,12,14,15,16,17,19,20,21,23,24,25,26,29,30,31,32,33,34,35,36,39,40,41,42,44,45,47,48,49,50,51,53,54,55,56,57,59,63,65,68,69,70,71,73,74,76,77,78,79,80,81,83,91,92,96,101,102,103,104,106,107,108,113,115,120,121,126,127,131,133,139,142,144,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,164,166,167,169,170,171,172,173,174,175,176,177,178,179,180,181,184,185,186,189,198,202,203,206,207,208,214,215,217,218,219,220,222,224,225,228,229,232,234,235,237,238,239,244,249,250,253,254,255,258,260,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,282,284,285,288,289,290,291,292,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,326,329,330,336,337,339,340,341,342,343,346,348,349,351,352,353,354,355,356,357,359,361,362,363,367,368,369,372,376,378,380,383,384,385,386,389,394,395,398,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,416,417,422,423,424,430,432,433,435,437,439,442,443,454,457,458,459,460,461,463,465,466,467,469,470,471,477,479,480,481,482,483,487,488,500,501,502,504,505,507,509,510,511,514,517,520,522,523,524,526,527,528,],[31,-309,-104,-117,31,-115,-101,-99,-97,-116,-98,-64,-60,-102,-93,-66,-96,-111,-106,-65,-95,-112,31,-221,-109,-309,-113,31,-63,-118,31,-107,-62,-103,-67,-114,-108,-309,-110,-309,-105,-119,-68,-100,-87,-10,-9,-309,31,31,-61,-133,-307,-132,-153,-152,-28,31,-166,-27,-90,31,-92,-89,-91,-94,-83,-86,-88,-69,171,-28,-309,31,-294,-70,228,-135,-130,-308,31,-167,31,-309,228,228,31,-298,-270,-257,-286,-301,-305,-302,-299,-284,228,-268,-285,-259,-238,228,-267,228,-297,-266,-271,228,228,-303,-265,-295,-283,309,-300,-296,-269,228,228,31,329,-73,-76,-72,228,-74,228,228,-78,-199,-198,-77,-200,228,-75,-266,-294,-139,-137,-134,-131,-128,228,-129,-154,228,367,-28,-309,-71,-309,-227,-230,-228,-224,-225,-229,-231,228,-233,-234,-226,-232,-306,228,-263,-304,-280,-279,228,228,228,-257,-262,228,-260,31,-261,228,228,228,228,228,228,228,228,228,228,228,228,228,228,228,228,228,228,228,-309,-266,430,-218,-217,228,-215,228,228,228,-201,228,-214,228,-80,-202,228,228,-138,-136,31,228,-156,-155,-266,228,228,-12,228,228,-11,-278,-277,-276,-275,-274,-287,228,31,309,309,309,309,309,309,309,309,309,309,-240,-239,309,309,309,309,309,-241,469,-28,-309,-266,-213,-216,228,-205,228,-79,-203,-309,-182,-264,-272,-273,228,228,-258,-309,228,-266,228,228,228,228,-204,228,228,228,228,-11,228,-209,-208,-206,-80,-288,228,-309,-281,228,228,-282,228,-210,-207,228,-212,-211,]),'LPAREN':([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,19,20,21,23,24,25,26,29,30,31,32,33,34,35,36,37,39,40,41,42,44,45,47,48,49,50,51,53,54,55,56,57,59,61,63,65,68,69,70,71,73,74,76,77,78,79,80,81,83,84,85,88,91,92,96,101,102,103,104,105,106,107,108,113,115,120,121,126,127,131,133,139,140,142,143,144,147,148,149,150,151,153,154,155,156,157,158,159,160,161,162,165,166,167,169,170,171,172,173,174,175,176,177,178,180,181,184,185,186,187,188,189,192,193,196,198,199,202,203,206,207,208,209,213,214,215,216,217,218,219,220,222,224,225,228,229,230,232,234,235,237,238,239,244,249,250,251,253,254,255,258,260,264,265,266,267,268,269,270,271,272,273,274,275,276,277,279,280,282,284,285,286,288,291,293,296,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,319,324,325,326,329,330,336,337,339,340,341,342,343,346,348,349,351,352,353,354,355,356,357,359,361,362,363,367,368,369,370,371,372,376,378,380,383,384,385,386,389,394,395,397,398,418,419,420,421,422,423,424,427,428,430,432,433,435,437,439,441,442,443,447,448,454,457,459,460,461,463,466,467,469,470,471,472,473,474,475,476,477,479,480,481,482,483,484,485,487,488,495,496,500,501,502,504,505,507,509,510,511,512,513,514,517,520,522,523,524,526,527,528,],[4,-309,-104,-117,4,-115,-101,-99,60,-97,-116,-98,-64,4,-60,-102,-93,-66,-96,-111,-106,-65,-95,-112,4,-221,-109,-309,-113,81,-63,-118,4,-29,-107,-62,-103,-67,-114,-108,-309,-110,-309,-105,-119,-68,-100,-87,-10,-9,-309,60,81,4,-61,-133,-307,-132,-153,-152,-28,-164,-166,-27,-90,81,-92,81,145,-37,-89,-91,-94,-83,-86,-88,-69,-30,173,-28,-309,189,-294,-70,173,-135,-130,-308,81,-167,-165,81,145,-309,173,173,81,-298,-270,-286,-301,-305,-302,-299,-284,277,-268,-285,285,287,288,-267,291,-297,-266,-271,173,291,-303,-265,-295,-283,-300,-296,-269,173,173,-36,-35,189,189,327,-45,173,331,-73,-76,-72,173,-74,339,343,288,173,348,-78,-199,-198,-77,-200,173,-75,-266,-294,355,-139,-137,-134,-131,-128,288,-129,-154,288,-38,173,-28,-309,-71,-309,-227,-230,-228,-224,-225,-229,-231,173,-233,-234,-226,-232,-306,173,-304,-280,-279,173,173,-31,173,173,-34,398,288,288,288,288,288,288,288,288,288,288,288,288,288,288,288,288,173,288,288,189,327,331,-309,-266,173,-218,-217,173,-215,173,173,173,-201,173,-214,173,-80,-202,173,173,-138,-136,81,288,-156,-155,-266,173,173,-44,-43,-12,288,173,-11,-278,-277,-276,-275,-274,-287,288,398,398,-33,-32,-197,-191,173,-28,-309,-193,-195,-266,-213,-216,173,-205,173,482,-79,-203,-39,-42,-309,-182,-272,-273,173,288,-309,288,-266,173,173,-51,-50,-192,-194,-196,173,173,-204,173,173,173,-41,-40,173,-11,-46,-49,173,-209,-208,-206,-80,-288,173,-309,-281,-48,-47,173,173,-282,173,-210,-207,173,-212,-211,]),'MINUSMINUS':([3,35,51,53,59,70,76,78,79,101,104,106,107,108,115,121,131,139,144,147,148,150,151,153,154,155,156,157,158,159,160,161,162,166,167,169,170,171,172,173,174,175,176,177,178,180,181,184,185,186,198,202,203,206,207,208,214,215,217,218,219,220,222,224,225,228,229,239,250,253,254,255,260,264,265,266,267,268,269,270,271,272,273,274,275,276,277,279,280,282,284,285,288,291,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,326,329,330,336,337,339,340,341,342,343,346,348,349,351,352,353,354,355,361,367,368,369,372,376,378,380,383,384,385,386,389,394,395,422,423,424,430,432,433,435,437,439,442,443,454,457,459,460,461,463,466,467,469,470,471,477,479,480,481,482,483,487,488,500,501,502,504,505,507,509,510,511,514,517,520,522,523,524,526,527,528,],[-117,-118,-119,-68,-309,-307,-28,-166,-27,-83,-69,174,-28,-309,-294,174,-308,-167,-309,174,174,-298,-270,-286,-301,-305,-302,-299,-284,174,-268,-285,280,174,-267,174,-297,-266,-271,174,174,-303,-265,-295,-283,-300,-296,-269,174,174,174,-73,-76,-72,174,-74,174,174,-78,-199,-198,-77,-200,174,-75,-266,-294,174,174,174,-28,-309,-309,-227,-230,-228,-224,-225,-229,-231,174,-233,-234,-226,-232,-306,174,-304,-280,-279,174,174,174,174,174,174,174,174,174,174,174,174,174,174,174,174,174,174,174,174,174,174,174,-309,-266,174,-218,-217,174,-215,174,174,174,-201,174,-214,174,-80,-202,174,174,174,-266,174,174,-12,174,174,-11,-278,-277,-276,-275,-274,-287,174,174,-28,-309,-266,-213,-216,174,-205,174,-79,-203,-309,-182,-272,-273,174,174,-309,174,-266,174,174,174,174,-204,174,174,174,174,-11,174,-209,-208,-206,-80,-288,174,-309,-281,174,174,-282,174,-210,-207,174,-212,-211,]),'ID':([0,1,2,3,4,5,6,7,9,10,11,12,13,14,15,16,17,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,38,39,40,41,42,44,45,47,48,49,50,51,53,54,55,56,57,59,60,63,65,68,69,70,71,73,74,75,76,77,78,79,80,81,83,84,91,92,96,101,102,103,104,106,107,108,113,120,121,126,127,131,133,134,135,139,140,142,144,145,147,148,149,151,159,160,166,167,169,171,173,174,176,184,185,186,189,192,198,200,202,203,204,206,207,208,214,215,217,218,219,220,222,224,225,228,232,234,235,237,238,239,244,248,249,250,253,254,255,258,260,264,265,266,267,268,269,270,271,272,273,274,275,277,281,283,284,285,288,291,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,319,326,327,329,330,336,337,339,340,341,342,343,346,348,349,351,352,353,354,355,356,357,359,361,362,363,367,368,369,372,375,376,378,380,395,422,423,424,430,432,433,435,437,439,442,443,454,457,461,462,463,466,467,469,470,471,477,479,480,481,482,483,487,488,500,501,502,504,505,508,509,510,514,517,522,523,524,526,527,528,],[37,-309,-104,-117,37,-115,-101,-99,-97,-116,-98,-64,37,-60,-102,-93,-66,-96,-111,-106,-141,-65,-95,-112,37,71,74,-221,-109,-309,-113,37,-63,-118,37,-140,-107,-62,-103,-67,-114,-108,-309,-110,-309,-105,-119,-68,-100,-87,-10,-9,-309,115,37,37,-61,-133,-307,-132,-153,-152,138,-28,-164,-166,-27,-90,37,-92,37,-89,-91,-94,-83,-86,-88,-69,115,-28,-309,37,-70,229,-135,-130,-308,37,138,138,-167,-165,37,-309,115,115,115,37,-270,115,-268,115,-267,115,-266,115,115,-265,-269,115,115,37,37,115,115,-73,-76,335,-72,115,-74,115,229,-78,-199,-198,-77,-200,229,-75,-266,-139,-137,-134,-131,-128,115,-129,138,-154,115,115,-28,-309,-71,-309,-227,-230,-228,-224,-225,-229,-231,115,-233,-234,-226,-232,115,384,386,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,37,-309,115,-266,115,-218,-217,115,-215,115,229,115,-201,115,-214,229,-80,-202,229,115,-138,-136,37,115,-156,-155,-266,115,115,-12,115,115,115,-11,115,115,-28,-309,-266,-213,-216,115,-205,229,-79,-203,-309,-182,115,115,115,-309,115,-266,115,115,115,229,-204,229,115,229,115,-11,115,-209,-208,-206,-80,115,115,-309,115,229,229,-210,-207,229,-212,-211,]),'IF':([53,70,101,104,121,131,202,203,206,208,215,217,218,219,220,222,224,225,336,337,340,342,346,349,351,352,353,354,432,433,437,439,442,443,479,480,481,483,501,502,504,505,517,522,523,524,526,527,528,],[-68,-307,-83,-69,230,-308,-73,-76,-72,-74,230,-78,-199,-198,-77,-200,230,-75,-218,-217,-215,230,-201,-214,230,-80,-202,230,-213,-216,-205,230,-79,-203,230,-204,230,230,-209,-208,-206,-80,230,230,-210,-207,230,-212,-211,]),'STRING_LITERAL':([3,35,51,53,59,70,76,78,79,101,104,106,107,108,121,131,139,144,147,148,151,159,160,161,166,167,169,171,173,174,175,176,184,185,186,198,202,203,206,207,208,214,215,217,218,219,220,222,224,225,228,239,250,253,254,255,260,264,265,266,267,268,269,270,271,272,273,274,275,277,279,284,285,288,291,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,326,329,330,336,337,339,340,341,342,343,346,348,349,351,352,353,354,355,361,367,368,369,372,376,378,380,395,422,423,424,430,432,433,435,437,439,442,443,454,457,461,463,466,467,469,470,471,477,479,480,481,482,483,487,488,500,501,502,504,505,509,510,514,517,522,523,524,526,527,528,],[-117,-118,-119,-68,-309,-307,-28,-166,-27,-83,-69,175,-28,-309,175,-308,-167,-309,175,175,-270,175,-268,279,175,-267,175,-266,175,175,-303,-265,-269,175,175,175,-73,-76,-72,175,-74,175,175,-78,-199,-198,-77,-200,175,-75,-266,175,175,175,-28,-309,-309,-227,-230,-228,-224,-225,-229,-231,175,-233,-234,-226,-232,175,-304,175,175,175,175,175,175,175,175,175,175,175,175,175,175,175,175,175,175,175,175,175,175,175,-309,-266,175,-218,-217,175,-215,175,175,175,-201,175,-214,175,-80,-202,175,175,175,-266,175,175,-12,175,175,-11,175,175,-28,-309,-266,-213,-216,175,-205,175,-79,-203,-309,-182,175,175,-309,175,-266,175,175,175,175,-204,175,175,175,175,-11,175,-209,-208,-206,-80,175,-309,175,175,175,-210,-207,175,-212,-211,]),'FLOAT':([0,1,2,3,5,6,7,8,9,10,11,12,14,15,16,17,18,19,20,21,23,24,25,26,29,30,32,33,34,35,36,37,39,40,41,42,44,45,47,48,49,50,51,53,54,55,56,57,60,61,63,64,65,67,68,69,70,71,72,73,74,78,80,83,87,91,92,96,101,102,103,104,105,113,117,120,121,122,123,124,125,126,127,128,129,130,131,132,133,139,145,173,187,188,189,201,202,203,206,208,215,217,218,219,220,222,225,231,232,233,234,235,236,237,238,244,249,258,277,286,287,288,291,293,296,327,331,336,337,339,340,346,349,351,352,353,356,357,360,362,363,398,418,419,432,433,437,442,443,480,501,502,504,505,523,524,527,528,],[39,-309,-104,-117,-115,-101,-99,-52,-97,-116,-98,-64,-60,-102,-93,-66,39,-96,-111,-106,-65,-95,-112,39,-221,-109,-113,39,-63,-118,39,-29,-107,-62,-103,-67,-114,-108,-309,-110,-309,-105,-119,-68,-100,-87,-10,-9,39,-53,39,-84,39,39,-61,-133,-307,-132,39,-153,-152,-166,-90,-92,39,-89,-91,-94,-83,-86,-88,-69,-30,39,39,-70,39,-85,39,39,39,-135,-130,-145,-146,-142,-308,39,39,-167,39,39,-36,-35,39,39,-73,-76,-72,-74,39,-78,-199,-198,-77,-200,-75,39,-139,39,-137,-134,-143,-131,-128,-129,-154,-71,39,-31,39,39,39,-34,39,39,39,-218,-217,39,-215,-201,-214,-78,-80,-202,-138,-136,-144,-156,-155,39,-33,-32,-213,-216,-205,-79,-203,-204,-209,-208,-206,-80,-210,-207,-212,-211,]),'XOREQUAL':([115,131,150,152,153,154,155,156,157,158,161,162,170,172,175,177,178,180,181,229,276,278,279,280,282,289,290,292,297,383,384,385,386,389,394,458,459,460,465,507,511,520,],[-294,-308,-298,268,-286,-301,-305,-302,-299,-284,-285,-259,-297,-271,-303,-295,-283,-300,-296,-294,-306,-263,-304,-280,-279,-257,-262,-260,-261,-278,-277,-276,-275,-274,-287,-264,-272,-273,-258,-288,-281,-282,]),'LSHIFTEQUAL':([115,131,150,152,153,154,155,156,157,158,161,162,170,172,175,177,178,180,181,229,276,278,279,280,282,289,290,292,297,383,384,385,386,389,394,458,459,460,465,507,511,520,],[-294,-308,-298,270,-286,-301,-305,-302,-299,-284,-285,-259,-297,-271,-303,-295,-283,-300,-296,-294,-306,-263,-304,-280,-279,-257,-262,-260,-261,-278,-277,-276,-275,-274,-287,-264,-272,-273,-258,-288,-281,-282,]),'RBRACKET':([3,35,51,59,78,79,106,107,115,131,139,144,150,152,153,154,155,156,157,158,161,162,163,164,168,170,171,172,175,177,178,179,180,181,182,183,198,227,253,254,276,278,279,280,282,289,290,292,297,317,318,326,328,329,330,345,366,367,381,383,384,385,386,387,389,394,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,416,417,422,423,429,430,436,449,450,453,458,459,460,465,468,469,494,497,498,507,511,519,520,],[-117,-118,-119,-309,-166,-27,-309,-28,-294,-308,-167,-309,-298,-257,-286,-301,-305,-302,-299,-284,-285,-259,286,-238,-4,-297,293,-271,-303,-295,-283,-236,-300,-296,-3,-222,-309,-219,-309,-28,-306,-263,-304,-280,-279,-257,-262,-260,-261,418,419,-309,427,428,-309,-235,447,448,-223,-278,-277,-276,-275,459,-274,-287,-244,-256,-245,-243,-247,-251,-246,-242,-249,-254,-240,-239,-248,-255,-250,-252,-253,-241,-309,-28,474,475,-220,484,485,486,-264,-272,-273,-258,495,496,-237,512,513,-288,-281,525,-282,]),} + +_lr_action = {} +for _k, _v in _lr_action_items.items(): + for _x,_y in zip(_v[0],_v[1]): + if not _x in _lr_action: _lr_action[_x] = {} + _lr_action[_x][_k] = _y +del _lr_action_items + +_lr_goto_items = {'expression_statement':([121,215,224,342,351,354,439,479,481,483,517,522,526,],[202,202,202,202,202,202,202,202,202,202,202,202,202,]),'struct_or_union_specifier':([0,18,26,36,60,65,67,72,87,117,121,123,124,125,132,145,173,189,201,215,231,233,277,287,288,291,327,331,339,398,],[5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,]),'init_declarator_list':([33,63,],[82,82,]),'init_declarator_list_opt':([33,63,],[90,90,]),'iteration_statement':([121,215,224,342,351,354,439,479,481,483,517,522,526,],[203,203,203,203,203,203,203,203,203,203,203,203,203,]),'unified_string_literal':([106,121,147,148,159,166,169,173,174,185,186,198,207,214,215,224,239,250,253,271,277,284,285,288,291,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,330,339,341,342,343,348,351,354,355,361,368,369,376,378,395,422,435,439,461,463,467,470,471,477,479,481,482,483,487,500,509,514,517,522,526,],[161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,]),'assignment_expression_opt':([106,198,253,330,422,],[163,328,366,429,468,]),'brace_open':([27,28,66,69,71,73,74,121,146,147,148,215,224,342,351,354,378,395,439,458,463,464,479,481,483,487,517,522,526,],[72,75,121,123,124,134,135,121,121,260,260,121,121,121,121,121,260,466,121,466,466,466,121,121,121,260,121,121,121,]),'enumerator':([75,134,135,248,],[136,136,136,364,]),'typeid_noparen_declarator':([113,],[197,]),'type_qualifier_list_opt':([31,59,108,144,255,326,424,],[77,106,186,253,369,422,471,]),'declaration_specifiers_no_type_opt':([1,47,49,],[55,102,103,]),'expression_opt':([121,215,224,339,342,351,354,435,439,477,479,481,483,500,514,517,522,526,],[205,205,205,434,205,205,205,478,205,499,205,205,205,515,521,205,205,205,]),'designation':([260,454,466,510,],[372,372,372,372,]),'parameter_list':([60,145,189,327,331,398,],[116,116,116,116,116,116,]),'labeled_statement':([121,215,224,342,351,354,439,479,481,483,517,522,526,],[206,206,206,206,206,206,206,206,206,206,206,206,206,]),'abstract_declarator':([113,189,296,398,],[191,323,191,323,]),'translation_unit':([0,],[26,]),'init_declarator':([33,63,142,149,],[94,94,252,263,]),'direct_abstract_declarator':([113,189,192,296,319,397,398,],[199,199,325,199,325,325,199,]),'designator_list':([260,454,466,510,],[379,379,379,379,]),'identifier':([60,106,121,145,147,148,159,166,169,173,174,185,186,198,200,207,214,215,224,239,250,253,271,277,284,285,288,291,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,327,330,339,341,342,343,348,351,354,355,361,368,369,375,376,378,395,422,435,439,461,462,463,467,470,471,477,479,481,482,483,487,500,508,509,514,517,522,526,],[118,178,178,118,178,178,178,178,178,178,178,178,178,178,332,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,118,178,178,178,178,178,178,178,178,178,178,178,178,452,178,178,178,178,178,178,178,492,178,178,178,178,178,178,178,178,178,178,178,518,178,178,178,178,178,]),'offsetof_member_designator':([462,],[491,]),'unary_expression':([106,121,147,148,159,166,169,173,174,185,186,198,207,214,215,224,239,250,253,271,277,284,285,288,291,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,330,339,341,342,343,348,351,354,355,361,368,369,376,378,395,422,435,439,461,463,467,470,471,477,479,481,482,483,487,500,509,514,517,522,526,],[152,152,152,152,278,289,292,152,297,152,152,152,152,289,152,152,289,289,152,152,152,152,152,152,152,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,152,289,289,152,152,152,152,152,152,152,152,152,289,152,152,289,152,289,152,152,152,152,289,289,152,152,152,152,152,152,152,152,152,152,152,152,152,152,]),'abstract_declarator_opt':([113,296,],[190,396,]),'initializer':([147,148,378,487,],[259,262,455,506,]),'direct_id_declarator':([0,4,13,26,33,36,63,65,81,84,113,133,142,149,189,192,319,359,],[8,8,61,8,8,8,8,8,8,61,8,8,8,8,8,61,61,8,]),'struct_declaration_list':([72,123,124,],[125,231,233,]),'pp_directive':([0,26,],[12,12,]),'declaration_list':([18,87,],[67,67,]),'id_init_declarator':([36,65,],[95,95,]),'type_specifier':([0,18,26,36,60,65,67,72,87,117,121,123,124,125,132,145,173,189,201,215,231,233,277,287,288,291,327,331,339,398,],[16,16,16,96,16,96,16,127,16,96,16,127,127,127,237,16,127,16,16,16,127,127,127,127,127,127,16,16,16,16,]),'compound_statement':([66,121,146,215,224,342,351,354,439,479,481,483,517,522,526,],[120,208,258,208,208,208,208,208,208,208,208,208,208,208,208,]),'pointer':([0,4,26,33,36,63,65,77,81,113,133,142,149,189,296,359,398,],[13,13,13,84,13,84,13,140,84,192,84,84,84,319,397,84,397,]),'typeid_declarator':([33,63,81,133,142,149,359,],[86,86,141,86,86,86,86,]),'id_init_declarator_list':([36,65,],[98,98,]),'declarator':([33,63,133,142,149,359,],[89,89,245,89,89,245,]),'argument_expression_list':([285,],[390,]),'struct_declarator_list_opt':([133,],[242,]),'typedef_name':([0,18,26,36,60,65,67,72,87,117,121,123,124,125,132,145,173,189,201,215,231,233,277,287,288,291,327,331,339,398,],[32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,]),'parameter_type_list_opt':([189,331,398,],[322,431,322,]),'struct_declarator':([133,359,],[243,445,]),'type_qualifier':([0,1,18,26,31,33,47,49,59,60,63,67,72,76,87,107,108,113,121,123,124,125,132,133,144,145,173,189,201,215,231,233,254,255,277,287,288,291,296,326,327,331,339,398,423,424,],[47,47,47,47,78,91,47,47,78,47,91,47,78,139,47,139,78,91,47,78,78,78,139,244,78,47,78,47,47,47,78,78,139,78,78,78,78,78,244,78,47,47,47,47,139,78,]),'assignment_operator':([152,],[271,]),'expression':([121,173,207,215,224,277,284,288,291,314,339,342,343,348,351,354,355,435,439,477,479,481,482,483,500,509,514,517,522,526,],[211,294,338,211,211,294,387,294,294,415,211,211,438,440,211,211,444,211,211,211,211,211,503,211,211,519,211,211,211,211,]),'storage_class_specifier':([0,1,18,26,33,47,49,60,63,67,87,113,121,145,189,201,215,327,331,339,398,],[1,1,1,1,80,1,1,1,80,1,1,80,1,1,1,1,1,1,1,1,1,]),'unified_wstring_literal':([106,121,147,148,159,166,169,173,174,185,186,198,207,214,215,224,239,250,253,271,277,284,285,288,291,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,330,339,341,342,343,348,351,354,355,361,368,369,376,378,395,422,435,439,461,463,467,470,471,477,479,481,482,483,487,500,509,514,517,522,526,],[153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,]),'translation_unit_or_empty':([0,],[43,]),'initializer_list_opt':([260,],[373,]),'brace_close':([72,123,124,125,137,226,231,233,246,247,373,454,493,510,],[126,232,234,235,249,353,356,357,362,363,451,489,511,520,]),'direct_typeid_declarator':([33,63,81,84,133,142,149,359,],[85,85,85,143,85,85,85,85,]),'external_declaration':([0,26,],[14,68,]),'pragmacomp_or_statement':([224,342,354,439,479,481,483,517,522,526,],[350,437,443,480,501,502,504,524,527,528,]),'type_name':([173,277,287,288,291,],[295,382,391,392,393,]),'block_item_list':([121,],[215,]),'pppragma_directive':([0,26,72,121,123,124,125,215,224,231,233,342,351,354,439,479,481,483,517,522,526,],[23,23,129,217,129,129,129,217,351,129,129,351,217,351,351,351,351,351,351,351,351,]),'statement':([121,215,224,342,351,354,439,479,481,483,517,522,526,],[218,218,352,352,442,352,352,352,352,505,352,352,352,]),'cast_expression':([106,121,147,148,166,173,185,186,198,207,214,215,224,239,250,253,271,277,284,285,288,291,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,330,339,341,342,343,348,351,354,355,361,368,369,376,378,395,422,435,439,461,463,467,470,471,477,479,481,482,483,487,500,509,514,517,522,526,],[164,164,164,164,290,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,465,164,164,164,164,465,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,]),'struct_declarator_list':([133,],[240,]),'empty':([0,1,18,31,33,36,47,49,59,60,63,65,87,106,108,113,121,133,144,145,189,198,215,224,253,255,260,296,326,327,330,331,339,342,351,354,398,422,424,435,439,454,466,477,479,481,483,500,510,514,517,522,526,],[52,57,62,79,93,100,57,57,79,110,93,100,62,182,79,195,223,241,79,110,320,182,347,347,182,79,380,195,79,110,182,320,347,347,347,347,320,182,79,347,347,488,488,347,347,347,347,347,488,347,347,347,347,]),'parameter_declaration':([60,145,189,201,327,331,398,],[112,112,112,334,112,112,112,]),'primary_expression':([106,121,147,148,159,166,169,173,174,185,186,198,207,214,215,224,239,250,253,271,277,284,285,288,291,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,330,339,341,342,343,348,351,354,355,361,368,369,376,378,395,422,435,439,461,463,467,470,471,477,479,481,482,483,487,500,509,514,517,522,526,],[172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,]),'declaration':([0,18,26,67,87,121,215,339,],[34,64,34,122,64,219,219,435,]),'declaration_specifiers_no_type':([0,1,18,26,47,49,60,67,87,121,145,189,201,215,327,331,339,398,],[36,56,65,36,56,56,117,65,65,65,117,117,117,65,117,117,65,117,]),'jump_statement':([121,215,224,342,351,354,439,479,481,483,517,522,526,],[220,220,220,220,220,220,220,220,220,220,220,220,220,]),'enumerator_list':([75,134,135,],[137,246,247,]),'block_item':([121,215,],[222,346,]),'constant_expression':([214,239,250,361,376,],[344,358,365,446,453,]),'identifier_list_opt':([60,145,327,],[109,256,425,]),'constant':([106,121,147,148,159,166,169,173,174,185,186,198,207,214,215,224,239,250,253,271,277,284,285,288,291,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,330,339,341,342,343,348,351,354,355,361,368,369,376,378,395,422,435,439,461,463,467,470,471,477,479,481,482,483,487,500,509,514,517,522,526,],[158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,]),'type_specifier_no_typeid':([0,18,26,33,36,60,63,65,67,72,87,113,117,121,123,124,125,132,133,145,173,189,201,215,231,233,277,287,288,291,296,327,331,339,398,],[10,10,10,83,10,10,83,10,10,10,10,83,10,10,10,10,10,10,238,10,10,10,10,10,10,10,10,10,10,10,238,10,10,10,10,]),'struct_declaration':([72,123,124,125,231,233,],[130,130,130,236,236,236,]),'direct_typeid_noparen_declarator':([113,192,],[193,324,]),'id_declarator':([0,4,26,33,36,63,65,81,113,133,142,149,189,359,],[18,58,18,87,97,119,97,58,194,119,119,119,58,119,]),'selection_statement':([121,215,224,342,351,354,439,479,481,483,517,522,526,],[225,225,225,225,225,225,225,225,225,225,225,225,225,]),'postfix_expression':([106,121,147,148,159,166,169,173,174,185,186,198,207,214,215,224,239,250,253,271,277,284,285,288,291,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,330,339,341,342,343,348,351,354,355,361,368,369,376,378,395,422,435,439,461,463,467,470,471,477,479,481,482,483,487,500,509,514,517,522,526,],[162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,]),'initializer_list':([260,466,],[377,493,]),'unary_operator':([106,121,147,148,159,166,169,173,174,185,186,198,207,214,215,224,239,250,253,271,277,284,285,288,291,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,330,339,341,342,343,348,351,354,355,361,368,369,376,378,395,422,435,439,461,463,467,470,471,477,479,481,482,483,487,500,509,514,517,522,526,],[166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,]),'struct_or_union':([0,18,26,36,60,65,67,72,87,117,121,123,124,125,132,145,173,189,201,215,231,233,277,287,288,291,327,331,339,398,],[27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,]),'block_item_list_opt':([121,],[226,]),'assignment_expression':([106,121,147,148,173,185,186,198,207,215,224,253,271,277,284,285,288,291,314,330,339,341,342,343,348,351,354,355,368,369,378,422,435,439,461,470,471,477,479,481,482,483,487,500,509,514,517,522,526,],[168,227,261,261,227,317,318,168,227,227,227,168,381,227,227,388,227,227,227,168,227,436,227,227,227,227,227,227,449,450,261,168,227,227,490,497,498,227,227,227,227,227,261,227,227,227,227,227,227,]),'designation_opt':([260,454,466,510,],[378,487,378,487,]),'parameter_type_list':([60,145,189,327,331,398,],[111,257,321,426,321,321,]),'type_qualifier_list':([31,59,72,108,123,124,125,144,173,231,233,255,277,287,288,291,326,424,],[76,107,132,76,132,132,132,254,132,132,132,76,132,132,132,132,423,76,]),'designator':([260,379,454,466,510,],[374,456,374,374,374,]),'id_init_declarator_list_opt':([36,65,],[99,99,]),'declaration_specifiers':([0,18,26,60,67,87,121,145,189,201,215,327,331,339,398,],[33,63,33,113,63,63,63,113,113,113,63,113,113,63,113,]),'identifier_list':([60,145,327,],[114,114,114,]),'declaration_list_opt':([18,87,],[66,146,]),'function_definition':([0,26,],[40,40,]),'binary_expression':([106,121,147,148,173,185,186,198,207,214,215,224,239,250,253,271,277,284,285,288,291,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,330,339,341,342,343,348,351,354,355,361,368,369,376,378,422,435,439,461,467,470,471,477,479,481,482,483,487,500,509,514,517,522,526,],[179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,179,416,417,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,]),'enum_specifier':([0,18,26,36,60,65,67,72,87,117,121,123,124,125,132,145,173,189,201,215,231,233,277,287,288,291,327,331,339,398,],[44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,]),'decl_body':([0,18,26,67,87,121,215,339,],[46,46,46,46,46,46,46,46,]),'function_specifier':([0,1,18,26,33,47,49,60,63,67,87,113,121,145,189,201,215,327,331,339,398,],[49,49,49,49,92,49,49,49,92,49,49,92,49,49,49,49,49,49,49,49,49,]),'specifier_qualifier_list':([72,123,124,125,173,231,233,277,287,288,291,],[133,133,133,133,296,133,133,296,296,296,296,]),'conditional_expression':([106,121,147,148,173,185,186,198,207,214,215,224,239,250,253,271,277,284,285,288,291,314,330,339,341,342,343,348,351,354,355,361,368,369,376,378,422,435,439,461,467,470,471,477,479,481,482,483,487,500,509,514,517,522,526,],[183,183,183,183,183,183,183,183,183,345,183,183,345,345,183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,345,183,183,345,183,183,183,183,183,494,183,183,183,183,183,183,183,183,183,183,183,183,183,183,]),} + +_lr_goto = {} +for _k, _v in _lr_goto_items.items(): + for _x, _y in zip(_v[0], _v[1]): + if not _x in _lr_goto: _lr_goto[_x] = {} + _lr_goto[_x][_k] = _y +del _lr_goto_items +_lr_productions = [ + ("S' -> translation_unit_or_empty","S'",1,None,None,None), + ('abstract_declarator_opt -> empty','abstract_declarator_opt',1,'p_abstract_declarator_opt','plyparser.py',43), + ('abstract_declarator_opt -> abstract_declarator','abstract_declarator_opt',1,'p_abstract_declarator_opt','plyparser.py',44), + ('assignment_expression_opt -> empty','assignment_expression_opt',1,'p_assignment_expression_opt','plyparser.py',43), + ('assignment_expression_opt -> assignment_expression','assignment_expression_opt',1,'p_assignment_expression_opt','plyparser.py',44), + ('block_item_list_opt -> empty','block_item_list_opt',1,'p_block_item_list_opt','plyparser.py',43), + ('block_item_list_opt -> block_item_list','block_item_list_opt',1,'p_block_item_list_opt','plyparser.py',44), + ('declaration_list_opt -> empty','declaration_list_opt',1,'p_declaration_list_opt','plyparser.py',43), + ('declaration_list_opt -> declaration_list','declaration_list_opt',1,'p_declaration_list_opt','plyparser.py',44), + ('declaration_specifiers_no_type_opt -> empty','declaration_specifiers_no_type_opt',1,'p_declaration_specifiers_no_type_opt','plyparser.py',43), + ('declaration_specifiers_no_type_opt -> declaration_specifiers_no_type','declaration_specifiers_no_type_opt',1,'p_declaration_specifiers_no_type_opt','plyparser.py',44), + ('designation_opt -> empty','designation_opt',1,'p_designation_opt','plyparser.py',43), + ('designation_opt -> designation','designation_opt',1,'p_designation_opt','plyparser.py',44), + ('expression_opt -> empty','expression_opt',1,'p_expression_opt','plyparser.py',43), + ('expression_opt -> expression','expression_opt',1,'p_expression_opt','plyparser.py',44), + ('id_init_declarator_list_opt -> empty','id_init_declarator_list_opt',1,'p_id_init_declarator_list_opt','plyparser.py',43), + ('id_init_declarator_list_opt -> id_init_declarator_list','id_init_declarator_list_opt',1,'p_id_init_declarator_list_opt','plyparser.py',44), + ('identifier_list_opt -> empty','identifier_list_opt',1,'p_identifier_list_opt','plyparser.py',43), + ('identifier_list_opt -> identifier_list','identifier_list_opt',1,'p_identifier_list_opt','plyparser.py',44), + ('init_declarator_list_opt -> empty','init_declarator_list_opt',1,'p_init_declarator_list_opt','plyparser.py',43), + ('init_declarator_list_opt -> init_declarator_list','init_declarator_list_opt',1,'p_init_declarator_list_opt','plyparser.py',44), + ('initializer_list_opt -> empty','initializer_list_opt',1,'p_initializer_list_opt','plyparser.py',43), + ('initializer_list_opt -> initializer_list','initializer_list_opt',1,'p_initializer_list_opt','plyparser.py',44), + ('parameter_type_list_opt -> empty','parameter_type_list_opt',1,'p_parameter_type_list_opt','plyparser.py',43), + ('parameter_type_list_opt -> parameter_type_list','parameter_type_list_opt',1,'p_parameter_type_list_opt','plyparser.py',44), + ('struct_declarator_list_opt -> empty','struct_declarator_list_opt',1,'p_struct_declarator_list_opt','plyparser.py',43), + ('struct_declarator_list_opt -> struct_declarator_list','struct_declarator_list_opt',1,'p_struct_declarator_list_opt','plyparser.py',44), + ('type_qualifier_list_opt -> empty','type_qualifier_list_opt',1,'p_type_qualifier_list_opt','plyparser.py',43), + ('type_qualifier_list_opt -> type_qualifier_list','type_qualifier_list_opt',1,'p_type_qualifier_list_opt','plyparser.py',44), + ('direct_id_declarator -> ID','direct_id_declarator',1,'p_direct_id_declarator_1','plyparser.py',126), + ('direct_id_declarator -> LPAREN id_declarator RPAREN','direct_id_declarator',3,'p_direct_id_declarator_2','plyparser.py',126), + ('direct_id_declarator -> direct_id_declarator LBRACKET type_qualifier_list_opt assignment_expression_opt RBRACKET','direct_id_declarator',5,'p_direct_id_declarator_3','plyparser.py',126), + ('direct_id_declarator -> direct_id_declarator LBRACKET STATIC type_qualifier_list_opt assignment_expression RBRACKET','direct_id_declarator',6,'p_direct_id_declarator_4','plyparser.py',126), + ('direct_id_declarator -> direct_id_declarator LBRACKET type_qualifier_list STATIC assignment_expression RBRACKET','direct_id_declarator',6,'p_direct_id_declarator_4','plyparser.py',127), + ('direct_id_declarator -> direct_id_declarator LBRACKET type_qualifier_list_opt TIMES RBRACKET','direct_id_declarator',5,'p_direct_id_declarator_5','plyparser.py',126), + ('direct_id_declarator -> direct_id_declarator LPAREN parameter_type_list RPAREN','direct_id_declarator',4,'p_direct_id_declarator_6','plyparser.py',126), + ('direct_id_declarator -> direct_id_declarator LPAREN identifier_list_opt RPAREN','direct_id_declarator',4,'p_direct_id_declarator_6','plyparser.py',127), + ('direct_typeid_declarator -> TYPEID','direct_typeid_declarator',1,'p_direct_typeid_declarator_1','plyparser.py',126), + ('direct_typeid_declarator -> LPAREN typeid_declarator RPAREN','direct_typeid_declarator',3,'p_direct_typeid_declarator_2','plyparser.py',126), + ('direct_typeid_declarator -> direct_typeid_declarator LBRACKET type_qualifier_list_opt assignment_expression_opt RBRACKET','direct_typeid_declarator',5,'p_direct_typeid_declarator_3','plyparser.py',126), + ('direct_typeid_declarator -> direct_typeid_declarator LBRACKET STATIC type_qualifier_list_opt assignment_expression RBRACKET','direct_typeid_declarator',6,'p_direct_typeid_declarator_4','plyparser.py',126), + ('direct_typeid_declarator -> direct_typeid_declarator LBRACKET type_qualifier_list STATIC assignment_expression RBRACKET','direct_typeid_declarator',6,'p_direct_typeid_declarator_4','plyparser.py',127), + ('direct_typeid_declarator -> direct_typeid_declarator LBRACKET type_qualifier_list_opt TIMES RBRACKET','direct_typeid_declarator',5,'p_direct_typeid_declarator_5','plyparser.py',126), + ('direct_typeid_declarator -> direct_typeid_declarator LPAREN parameter_type_list RPAREN','direct_typeid_declarator',4,'p_direct_typeid_declarator_6','plyparser.py',126), + ('direct_typeid_declarator -> direct_typeid_declarator LPAREN identifier_list_opt RPAREN','direct_typeid_declarator',4,'p_direct_typeid_declarator_6','plyparser.py',127), + ('direct_typeid_noparen_declarator -> TYPEID','direct_typeid_noparen_declarator',1,'p_direct_typeid_noparen_declarator_1','plyparser.py',126), + ('direct_typeid_noparen_declarator -> direct_typeid_noparen_declarator LBRACKET type_qualifier_list_opt assignment_expression_opt RBRACKET','direct_typeid_noparen_declarator',5,'p_direct_typeid_noparen_declarator_3','plyparser.py',126), + ('direct_typeid_noparen_declarator -> direct_typeid_noparen_declarator LBRACKET STATIC type_qualifier_list_opt assignment_expression RBRACKET','direct_typeid_noparen_declarator',6,'p_direct_typeid_noparen_declarator_4','plyparser.py',126), + ('direct_typeid_noparen_declarator -> direct_typeid_noparen_declarator LBRACKET type_qualifier_list STATIC assignment_expression RBRACKET','direct_typeid_noparen_declarator',6,'p_direct_typeid_noparen_declarator_4','plyparser.py',127), + ('direct_typeid_noparen_declarator -> direct_typeid_noparen_declarator LBRACKET type_qualifier_list_opt TIMES RBRACKET','direct_typeid_noparen_declarator',5,'p_direct_typeid_noparen_declarator_5','plyparser.py',126), + ('direct_typeid_noparen_declarator -> direct_typeid_noparen_declarator LPAREN parameter_type_list RPAREN','direct_typeid_noparen_declarator',4,'p_direct_typeid_noparen_declarator_6','plyparser.py',126), + ('direct_typeid_noparen_declarator -> direct_typeid_noparen_declarator LPAREN identifier_list_opt RPAREN','direct_typeid_noparen_declarator',4,'p_direct_typeid_noparen_declarator_6','plyparser.py',127), + ('id_declarator -> direct_id_declarator','id_declarator',1,'p_id_declarator_1','plyparser.py',126), + ('id_declarator -> pointer direct_id_declarator','id_declarator',2,'p_id_declarator_2','plyparser.py',126), + ('typeid_declarator -> direct_typeid_declarator','typeid_declarator',1,'p_typeid_declarator_1','plyparser.py',126), + ('typeid_declarator -> pointer direct_typeid_declarator','typeid_declarator',2,'p_typeid_declarator_2','plyparser.py',126), + ('typeid_noparen_declarator -> direct_typeid_noparen_declarator','typeid_noparen_declarator',1,'p_typeid_noparen_declarator_1','plyparser.py',126), + ('typeid_noparen_declarator -> pointer direct_typeid_noparen_declarator','typeid_noparen_declarator',2,'p_typeid_noparen_declarator_2','plyparser.py',126), + ('translation_unit_or_empty -> translation_unit','translation_unit_or_empty',1,'p_translation_unit_or_empty','c_parser.py',514), + ('translation_unit_or_empty -> empty','translation_unit_or_empty',1,'p_translation_unit_or_empty','c_parser.py',515), + ('translation_unit -> external_declaration','translation_unit',1,'p_translation_unit_1','c_parser.py',523), + ('translation_unit -> translation_unit external_declaration','translation_unit',2,'p_translation_unit_2','c_parser.py',530), + ('external_declaration -> function_definition','external_declaration',1,'p_external_declaration_1','c_parser.py',542), + ('external_declaration -> declaration','external_declaration',1,'p_external_declaration_2','c_parser.py',547), + ('external_declaration -> pp_directive','external_declaration',1,'p_external_declaration_3','c_parser.py',552), + ('external_declaration -> pppragma_directive','external_declaration',1,'p_external_declaration_3','c_parser.py',553), + ('external_declaration -> SEMI','external_declaration',1,'p_external_declaration_4','c_parser.py',558), + ('pp_directive -> PPHASH','pp_directive',1,'p_pp_directive','c_parser.py',563), + ('pppragma_directive -> PPPRAGMA','pppragma_directive',1,'p_pppragma_directive','c_parser.py',569), + ('pppragma_directive -> PPPRAGMA PPPRAGMASTR','pppragma_directive',2,'p_pppragma_directive','c_parser.py',570), + ('function_definition -> id_declarator declaration_list_opt compound_statement','function_definition',3,'p_function_definition_1','c_parser.py',581), + ('function_definition -> declaration_specifiers id_declarator declaration_list_opt compound_statement','function_definition',4,'p_function_definition_2','c_parser.py',598), + ('statement -> labeled_statement','statement',1,'p_statement','c_parser.py',609), + ('statement -> expression_statement','statement',1,'p_statement','c_parser.py',610), + ('statement -> compound_statement','statement',1,'p_statement','c_parser.py',611), + ('statement -> selection_statement','statement',1,'p_statement','c_parser.py',612), + ('statement -> iteration_statement','statement',1,'p_statement','c_parser.py',613), + ('statement -> jump_statement','statement',1,'p_statement','c_parser.py',614), + ('statement -> pppragma_directive','statement',1,'p_statement','c_parser.py',615), + ('pragmacomp_or_statement -> pppragma_directive statement','pragmacomp_or_statement',2,'p_pragmacomp_or_statement','c_parser.py',662), + ('pragmacomp_or_statement -> statement','pragmacomp_or_statement',1,'p_pragmacomp_or_statement','c_parser.py',663), + ('decl_body -> declaration_specifiers init_declarator_list_opt','decl_body',2,'p_decl_body','c_parser.py',682), + ('decl_body -> declaration_specifiers_no_type id_init_declarator_list_opt','decl_body',2,'p_decl_body','c_parser.py',683), + ('declaration -> decl_body SEMI','declaration',2,'p_declaration','c_parser.py',742), + ('declaration_list -> declaration','declaration_list',1,'p_declaration_list','c_parser.py',751), + ('declaration_list -> declaration_list declaration','declaration_list',2,'p_declaration_list','c_parser.py',752), + ('declaration_specifiers_no_type -> type_qualifier declaration_specifiers_no_type_opt','declaration_specifiers_no_type',2,'p_declaration_specifiers_no_type_1','c_parser.py',762), + ('declaration_specifiers_no_type -> storage_class_specifier declaration_specifiers_no_type_opt','declaration_specifiers_no_type',2,'p_declaration_specifiers_no_type_2','c_parser.py',767), + ('declaration_specifiers_no_type -> function_specifier declaration_specifiers_no_type_opt','declaration_specifiers_no_type',2,'p_declaration_specifiers_no_type_3','c_parser.py',772), + ('declaration_specifiers -> declaration_specifiers type_qualifier','declaration_specifiers',2,'p_declaration_specifiers_1','c_parser.py',778), + ('declaration_specifiers -> declaration_specifiers storage_class_specifier','declaration_specifiers',2,'p_declaration_specifiers_2','c_parser.py',783), + ('declaration_specifiers -> declaration_specifiers function_specifier','declaration_specifiers',2,'p_declaration_specifiers_3','c_parser.py',788), + ('declaration_specifiers -> declaration_specifiers type_specifier_no_typeid','declaration_specifiers',2,'p_declaration_specifiers_4','c_parser.py',793), + ('declaration_specifiers -> type_specifier','declaration_specifiers',1,'p_declaration_specifiers_5','c_parser.py',798), + ('declaration_specifiers -> declaration_specifiers_no_type type_specifier','declaration_specifiers',2,'p_declaration_specifiers_6','c_parser.py',803), + ('storage_class_specifier -> AUTO','storage_class_specifier',1,'p_storage_class_specifier','c_parser.py',809), + ('storage_class_specifier -> REGISTER','storage_class_specifier',1,'p_storage_class_specifier','c_parser.py',810), + ('storage_class_specifier -> STATIC','storage_class_specifier',1,'p_storage_class_specifier','c_parser.py',811), + ('storage_class_specifier -> EXTERN','storage_class_specifier',1,'p_storage_class_specifier','c_parser.py',812), + ('storage_class_specifier -> TYPEDEF','storage_class_specifier',1,'p_storage_class_specifier','c_parser.py',813), + ('function_specifier -> INLINE','function_specifier',1,'p_function_specifier','c_parser.py',818), + ('type_specifier_no_typeid -> VOID','type_specifier_no_typeid',1,'p_type_specifier_no_typeid','c_parser.py',823), + ('type_specifier_no_typeid -> _BOOL','type_specifier_no_typeid',1,'p_type_specifier_no_typeid','c_parser.py',824), + ('type_specifier_no_typeid -> CHAR','type_specifier_no_typeid',1,'p_type_specifier_no_typeid','c_parser.py',825), + ('type_specifier_no_typeid -> SHORT','type_specifier_no_typeid',1,'p_type_specifier_no_typeid','c_parser.py',826), + ('type_specifier_no_typeid -> INT','type_specifier_no_typeid',1,'p_type_specifier_no_typeid','c_parser.py',827), + ('type_specifier_no_typeid -> LONG','type_specifier_no_typeid',1,'p_type_specifier_no_typeid','c_parser.py',828), + ('type_specifier_no_typeid -> FLOAT','type_specifier_no_typeid',1,'p_type_specifier_no_typeid','c_parser.py',829), + ('type_specifier_no_typeid -> DOUBLE','type_specifier_no_typeid',1,'p_type_specifier_no_typeid','c_parser.py',830), + ('type_specifier_no_typeid -> _COMPLEX','type_specifier_no_typeid',1,'p_type_specifier_no_typeid','c_parser.py',831), + ('type_specifier_no_typeid -> SIGNED','type_specifier_no_typeid',1,'p_type_specifier_no_typeid','c_parser.py',832), + ('type_specifier_no_typeid -> UNSIGNED','type_specifier_no_typeid',1,'p_type_specifier_no_typeid','c_parser.py',833), + ('type_specifier_no_typeid -> __INT128','type_specifier_no_typeid',1,'p_type_specifier_no_typeid','c_parser.py',834), + ('type_specifier -> typedef_name','type_specifier',1,'p_type_specifier','c_parser.py',839), + ('type_specifier -> enum_specifier','type_specifier',1,'p_type_specifier','c_parser.py',840), + ('type_specifier -> struct_or_union_specifier','type_specifier',1,'p_type_specifier','c_parser.py',841), + ('type_specifier -> type_specifier_no_typeid','type_specifier',1,'p_type_specifier','c_parser.py',842), + ('type_qualifier -> CONST','type_qualifier',1,'p_type_qualifier','c_parser.py',847), + ('type_qualifier -> RESTRICT','type_qualifier',1,'p_type_qualifier','c_parser.py',848), + ('type_qualifier -> VOLATILE','type_qualifier',1,'p_type_qualifier','c_parser.py',849), + ('init_declarator_list -> init_declarator','init_declarator_list',1,'p_init_declarator_list','c_parser.py',854), + ('init_declarator_list -> init_declarator_list COMMA init_declarator','init_declarator_list',3,'p_init_declarator_list','c_parser.py',855), + ('init_declarator -> declarator','init_declarator',1,'p_init_declarator','c_parser.py',863), + ('init_declarator -> declarator EQUALS initializer','init_declarator',3,'p_init_declarator','c_parser.py',864), + ('id_init_declarator_list -> id_init_declarator','id_init_declarator_list',1,'p_id_init_declarator_list','c_parser.py',869), + ('id_init_declarator_list -> id_init_declarator_list COMMA init_declarator','id_init_declarator_list',3,'p_id_init_declarator_list','c_parser.py',870), + ('id_init_declarator -> id_declarator','id_init_declarator',1,'p_id_init_declarator','c_parser.py',875), + ('id_init_declarator -> id_declarator EQUALS initializer','id_init_declarator',3,'p_id_init_declarator','c_parser.py',876), + ('specifier_qualifier_list -> specifier_qualifier_list type_specifier_no_typeid','specifier_qualifier_list',2,'p_specifier_qualifier_list_1','c_parser.py',883), + ('specifier_qualifier_list -> specifier_qualifier_list type_qualifier','specifier_qualifier_list',2,'p_specifier_qualifier_list_2','c_parser.py',888), + ('specifier_qualifier_list -> type_specifier','specifier_qualifier_list',1,'p_specifier_qualifier_list_3','c_parser.py',893), + ('specifier_qualifier_list -> type_qualifier_list type_specifier','specifier_qualifier_list',2,'p_specifier_qualifier_list_4','c_parser.py',898), + ('struct_or_union_specifier -> struct_or_union ID','struct_or_union_specifier',2,'p_struct_or_union_specifier_1','c_parser.py',907), + ('struct_or_union_specifier -> struct_or_union TYPEID','struct_or_union_specifier',2,'p_struct_or_union_specifier_1','c_parser.py',908), + ('struct_or_union_specifier -> struct_or_union brace_open struct_declaration_list brace_close','struct_or_union_specifier',4,'p_struct_or_union_specifier_2','c_parser.py',918), + ('struct_or_union_specifier -> struct_or_union brace_open brace_close','struct_or_union_specifier',3,'p_struct_or_union_specifier_2','c_parser.py',919), + ('struct_or_union_specifier -> struct_or_union ID brace_open struct_declaration_list brace_close','struct_or_union_specifier',5,'p_struct_or_union_specifier_3','c_parser.py',936), + ('struct_or_union_specifier -> struct_or_union ID brace_open brace_close','struct_or_union_specifier',4,'p_struct_or_union_specifier_3','c_parser.py',937), + ('struct_or_union_specifier -> struct_or_union TYPEID brace_open struct_declaration_list brace_close','struct_or_union_specifier',5,'p_struct_or_union_specifier_3','c_parser.py',938), + ('struct_or_union_specifier -> struct_or_union TYPEID brace_open brace_close','struct_or_union_specifier',4,'p_struct_or_union_specifier_3','c_parser.py',939), + ('struct_or_union -> STRUCT','struct_or_union',1,'p_struct_or_union','c_parser.py',955), + ('struct_or_union -> UNION','struct_or_union',1,'p_struct_or_union','c_parser.py',956), + ('struct_declaration_list -> struct_declaration','struct_declaration_list',1,'p_struct_declaration_list','c_parser.py',963), + ('struct_declaration_list -> struct_declaration_list struct_declaration','struct_declaration_list',2,'p_struct_declaration_list','c_parser.py',964), + ('struct_declaration -> specifier_qualifier_list struct_declarator_list_opt SEMI','struct_declaration',3,'p_struct_declaration_1','c_parser.py',972), + ('struct_declaration -> SEMI','struct_declaration',1,'p_struct_declaration_2','c_parser.py',1010), + ('struct_declaration -> pppragma_directive','struct_declaration',1,'p_struct_declaration_3','c_parser.py',1015), + ('struct_declarator_list -> struct_declarator','struct_declarator_list',1,'p_struct_declarator_list','c_parser.py',1020), + ('struct_declarator_list -> struct_declarator_list COMMA struct_declarator','struct_declarator_list',3,'p_struct_declarator_list','c_parser.py',1021), + ('struct_declarator -> declarator','struct_declarator',1,'p_struct_declarator_1','c_parser.py',1029), + ('struct_declarator -> declarator COLON constant_expression','struct_declarator',3,'p_struct_declarator_2','c_parser.py',1034), + ('struct_declarator -> COLON constant_expression','struct_declarator',2,'p_struct_declarator_2','c_parser.py',1035), + ('enum_specifier -> ENUM ID','enum_specifier',2,'p_enum_specifier_1','c_parser.py',1043), + ('enum_specifier -> ENUM TYPEID','enum_specifier',2,'p_enum_specifier_1','c_parser.py',1044), + ('enum_specifier -> ENUM brace_open enumerator_list brace_close','enum_specifier',4,'p_enum_specifier_2','c_parser.py',1049), + ('enum_specifier -> ENUM ID brace_open enumerator_list brace_close','enum_specifier',5,'p_enum_specifier_3','c_parser.py',1054), + ('enum_specifier -> ENUM TYPEID brace_open enumerator_list brace_close','enum_specifier',5,'p_enum_specifier_3','c_parser.py',1055), + ('enumerator_list -> enumerator','enumerator_list',1,'p_enumerator_list','c_parser.py',1060), + ('enumerator_list -> enumerator_list COMMA','enumerator_list',2,'p_enumerator_list','c_parser.py',1061), + ('enumerator_list -> enumerator_list COMMA enumerator','enumerator_list',3,'p_enumerator_list','c_parser.py',1062), + ('enumerator -> ID','enumerator',1,'p_enumerator','c_parser.py',1073), + ('enumerator -> ID EQUALS constant_expression','enumerator',3,'p_enumerator','c_parser.py',1074), + ('declarator -> id_declarator','declarator',1,'p_declarator','c_parser.py',1089), + ('declarator -> typeid_declarator','declarator',1,'p_declarator','c_parser.py',1090), + ('pointer -> TIMES type_qualifier_list_opt','pointer',2,'p_pointer','c_parser.py',1201), + ('pointer -> TIMES type_qualifier_list_opt pointer','pointer',3,'p_pointer','c_parser.py',1202), + ('type_qualifier_list -> type_qualifier','type_qualifier_list',1,'p_type_qualifier_list','c_parser.py',1231), + ('type_qualifier_list -> type_qualifier_list type_qualifier','type_qualifier_list',2,'p_type_qualifier_list','c_parser.py',1232), + ('parameter_type_list -> parameter_list','parameter_type_list',1,'p_parameter_type_list','c_parser.py',1237), + ('parameter_type_list -> parameter_list COMMA ELLIPSIS','parameter_type_list',3,'p_parameter_type_list','c_parser.py',1238), + ('parameter_list -> parameter_declaration','parameter_list',1,'p_parameter_list','c_parser.py',1246), + ('parameter_list -> parameter_list COMMA parameter_declaration','parameter_list',3,'p_parameter_list','c_parser.py',1247), + ('parameter_declaration -> declaration_specifiers id_declarator','parameter_declaration',2,'p_parameter_declaration_1','c_parser.py',1266), + ('parameter_declaration -> declaration_specifiers typeid_noparen_declarator','parameter_declaration',2,'p_parameter_declaration_1','c_parser.py',1267), + ('parameter_declaration -> declaration_specifiers abstract_declarator_opt','parameter_declaration',2,'p_parameter_declaration_2','c_parser.py',1278), + ('identifier_list -> identifier','identifier_list',1,'p_identifier_list','c_parser.py',1309), + ('identifier_list -> identifier_list COMMA identifier','identifier_list',3,'p_identifier_list','c_parser.py',1310), + ('initializer -> assignment_expression','initializer',1,'p_initializer_1','c_parser.py',1319), + ('initializer -> brace_open initializer_list_opt brace_close','initializer',3,'p_initializer_2','c_parser.py',1324), + ('initializer -> brace_open initializer_list COMMA brace_close','initializer',4,'p_initializer_2','c_parser.py',1325), + ('initializer_list -> designation_opt initializer','initializer_list',2,'p_initializer_list','c_parser.py',1333), + ('initializer_list -> initializer_list COMMA designation_opt initializer','initializer_list',4,'p_initializer_list','c_parser.py',1334), + ('designation -> designator_list EQUALS','designation',2,'p_designation','c_parser.py',1345), + ('designator_list -> designator','designator_list',1,'p_designator_list','c_parser.py',1353), + ('designator_list -> designator_list designator','designator_list',2,'p_designator_list','c_parser.py',1354), + ('designator -> LBRACKET constant_expression RBRACKET','designator',3,'p_designator','c_parser.py',1359), + ('designator -> PERIOD identifier','designator',2,'p_designator','c_parser.py',1360), + ('type_name -> specifier_qualifier_list abstract_declarator_opt','type_name',2,'p_type_name','c_parser.py',1365), + ('abstract_declarator -> pointer','abstract_declarator',1,'p_abstract_declarator_1','c_parser.py',1376), + ('abstract_declarator -> pointer direct_abstract_declarator','abstract_declarator',2,'p_abstract_declarator_2','c_parser.py',1384), + ('abstract_declarator -> direct_abstract_declarator','abstract_declarator',1,'p_abstract_declarator_3','c_parser.py',1389), + ('direct_abstract_declarator -> LPAREN abstract_declarator RPAREN','direct_abstract_declarator',3,'p_direct_abstract_declarator_1','c_parser.py',1399), + ('direct_abstract_declarator -> direct_abstract_declarator LBRACKET assignment_expression_opt RBRACKET','direct_abstract_declarator',4,'p_direct_abstract_declarator_2','c_parser.py',1403), + ('direct_abstract_declarator -> LBRACKET assignment_expression_opt RBRACKET','direct_abstract_declarator',3,'p_direct_abstract_declarator_3','c_parser.py',1414), + ('direct_abstract_declarator -> direct_abstract_declarator LBRACKET TIMES RBRACKET','direct_abstract_declarator',4,'p_direct_abstract_declarator_4','c_parser.py',1423), + ('direct_abstract_declarator -> LBRACKET TIMES RBRACKET','direct_abstract_declarator',3,'p_direct_abstract_declarator_5','c_parser.py',1434), + ('direct_abstract_declarator -> direct_abstract_declarator LPAREN parameter_type_list_opt RPAREN','direct_abstract_declarator',4,'p_direct_abstract_declarator_6','c_parser.py',1443), + ('direct_abstract_declarator -> LPAREN parameter_type_list_opt RPAREN','direct_abstract_declarator',3,'p_direct_abstract_declarator_7','c_parser.py',1453), + ('block_item -> declaration','block_item',1,'p_block_item','c_parser.py',1464), + ('block_item -> statement','block_item',1,'p_block_item','c_parser.py',1465), + ('block_item_list -> block_item','block_item_list',1,'p_block_item_list','c_parser.py',1472), + ('block_item_list -> block_item_list block_item','block_item_list',2,'p_block_item_list','c_parser.py',1473), + ('compound_statement -> brace_open block_item_list_opt brace_close','compound_statement',3,'p_compound_statement_1','c_parser.py',1479), + ('labeled_statement -> ID COLON pragmacomp_or_statement','labeled_statement',3,'p_labeled_statement_1','c_parser.py',1485), + ('labeled_statement -> CASE constant_expression COLON pragmacomp_or_statement','labeled_statement',4,'p_labeled_statement_2','c_parser.py',1489), + ('labeled_statement -> DEFAULT COLON pragmacomp_or_statement','labeled_statement',3,'p_labeled_statement_3','c_parser.py',1493), + ('selection_statement -> IF LPAREN expression RPAREN pragmacomp_or_statement','selection_statement',5,'p_selection_statement_1','c_parser.py',1497), + ('selection_statement -> IF LPAREN expression RPAREN statement ELSE pragmacomp_or_statement','selection_statement',7,'p_selection_statement_2','c_parser.py',1501), + ('selection_statement -> SWITCH LPAREN expression RPAREN pragmacomp_or_statement','selection_statement',5,'p_selection_statement_3','c_parser.py',1505), + ('iteration_statement -> WHILE LPAREN expression RPAREN pragmacomp_or_statement','iteration_statement',5,'p_iteration_statement_1','c_parser.py',1510), + ('iteration_statement -> DO pragmacomp_or_statement WHILE LPAREN expression RPAREN SEMI','iteration_statement',7,'p_iteration_statement_2','c_parser.py',1514), + ('iteration_statement -> FOR LPAREN expression_opt SEMI expression_opt SEMI expression_opt RPAREN pragmacomp_or_statement','iteration_statement',9,'p_iteration_statement_3','c_parser.py',1518), + ('iteration_statement -> FOR LPAREN declaration expression_opt SEMI expression_opt RPAREN pragmacomp_or_statement','iteration_statement',8,'p_iteration_statement_4','c_parser.py',1522), + ('jump_statement -> GOTO ID SEMI','jump_statement',3,'p_jump_statement_1','c_parser.py',1527), + ('jump_statement -> BREAK SEMI','jump_statement',2,'p_jump_statement_2','c_parser.py',1531), + ('jump_statement -> CONTINUE SEMI','jump_statement',2,'p_jump_statement_3','c_parser.py',1535), + ('jump_statement -> RETURN expression SEMI','jump_statement',3,'p_jump_statement_4','c_parser.py',1539), + ('jump_statement -> RETURN SEMI','jump_statement',2,'p_jump_statement_4','c_parser.py',1540), + ('expression_statement -> expression_opt SEMI','expression_statement',2,'p_expression_statement','c_parser.py',1545), + ('expression -> assignment_expression','expression',1,'p_expression','c_parser.py',1552), + ('expression -> expression COMMA assignment_expression','expression',3,'p_expression','c_parser.py',1553), + ('typedef_name -> TYPEID','typedef_name',1,'p_typedef_name','c_parser.py',1565), + ('assignment_expression -> conditional_expression','assignment_expression',1,'p_assignment_expression','c_parser.py',1569), + ('assignment_expression -> unary_expression assignment_operator assignment_expression','assignment_expression',3,'p_assignment_expression','c_parser.py',1570), + ('assignment_operator -> EQUALS','assignment_operator',1,'p_assignment_operator','c_parser.py',1583), + ('assignment_operator -> XOREQUAL','assignment_operator',1,'p_assignment_operator','c_parser.py',1584), + ('assignment_operator -> TIMESEQUAL','assignment_operator',1,'p_assignment_operator','c_parser.py',1585), + ('assignment_operator -> DIVEQUAL','assignment_operator',1,'p_assignment_operator','c_parser.py',1586), + ('assignment_operator -> MODEQUAL','assignment_operator',1,'p_assignment_operator','c_parser.py',1587), + ('assignment_operator -> PLUSEQUAL','assignment_operator',1,'p_assignment_operator','c_parser.py',1588), + ('assignment_operator -> MINUSEQUAL','assignment_operator',1,'p_assignment_operator','c_parser.py',1589), + ('assignment_operator -> LSHIFTEQUAL','assignment_operator',1,'p_assignment_operator','c_parser.py',1590), + ('assignment_operator -> RSHIFTEQUAL','assignment_operator',1,'p_assignment_operator','c_parser.py',1591), + ('assignment_operator -> ANDEQUAL','assignment_operator',1,'p_assignment_operator','c_parser.py',1592), + ('assignment_operator -> OREQUAL','assignment_operator',1,'p_assignment_operator','c_parser.py',1593), + ('constant_expression -> conditional_expression','constant_expression',1,'p_constant_expression','c_parser.py',1598), + ('conditional_expression -> binary_expression','conditional_expression',1,'p_conditional_expression','c_parser.py',1602), + ('conditional_expression -> binary_expression CONDOP expression COLON conditional_expression','conditional_expression',5,'p_conditional_expression','c_parser.py',1603), + ('binary_expression -> cast_expression','binary_expression',1,'p_binary_expression','c_parser.py',1611), + ('binary_expression -> binary_expression TIMES binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1612), + ('binary_expression -> binary_expression DIVIDE binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1613), + ('binary_expression -> binary_expression MOD binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1614), + ('binary_expression -> binary_expression PLUS binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1615), + ('binary_expression -> binary_expression MINUS binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1616), + ('binary_expression -> binary_expression RSHIFT binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1617), + ('binary_expression -> binary_expression LSHIFT binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1618), + ('binary_expression -> binary_expression LT binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1619), + ('binary_expression -> binary_expression LE binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1620), + ('binary_expression -> binary_expression GE binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1621), + ('binary_expression -> binary_expression GT binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1622), + ('binary_expression -> binary_expression EQ binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1623), + ('binary_expression -> binary_expression NE binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1624), + ('binary_expression -> binary_expression AND binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1625), + ('binary_expression -> binary_expression OR binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1626), + ('binary_expression -> binary_expression XOR binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1627), + ('binary_expression -> binary_expression LAND binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1628), + ('binary_expression -> binary_expression LOR binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1629), + ('cast_expression -> unary_expression','cast_expression',1,'p_cast_expression_1','c_parser.py',1637), + ('cast_expression -> LPAREN type_name RPAREN cast_expression','cast_expression',4,'p_cast_expression_2','c_parser.py',1641), + ('unary_expression -> postfix_expression','unary_expression',1,'p_unary_expression_1','c_parser.py',1645), + ('unary_expression -> PLUSPLUS unary_expression','unary_expression',2,'p_unary_expression_2','c_parser.py',1649), + ('unary_expression -> MINUSMINUS unary_expression','unary_expression',2,'p_unary_expression_2','c_parser.py',1650), + ('unary_expression -> unary_operator cast_expression','unary_expression',2,'p_unary_expression_2','c_parser.py',1651), + ('unary_expression -> SIZEOF unary_expression','unary_expression',2,'p_unary_expression_3','c_parser.py',1656), + ('unary_expression -> SIZEOF LPAREN type_name RPAREN','unary_expression',4,'p_unary_expression_3','c_parser.py',1657), + ('unary_operator -> AND','unary_operator',1,'p_unary_operator','c_parser.py',1665), + ('unary_operator -> TIMES','unary_operator',1,'p_unary_operator','c_parser.py',1666), + ('unary_operator -> PLUS','unary_operator',1,'p_unary_operator','c_parser.py',1667), + ('unary_operator -> MINUS','unary_operator',1,'p_unary_operator','c_parser.py',1668), + ('unary_operator -> NOT','unary_operator',1,'p_unary_operator','c_parser.py',1669), + ('unary_operator -> LNOT','unary_operator',1,'p_unary_operator','c_parser.py',1670), + ('postfix_expression -> primary_expression','postfix_expression',1,'p_postfix_expression_1','c_parser.py',1675), + ('postfix_expression -> postfix_expression LBRACKET expression RBRACKET','postfix_expression',4,'p_postfix_expression_2','c_parser.py',1679), + ('postfix_expression -> postfix_expression LPAREN argument_expression_list RPAREN','postfix_expression',4,'p_postfix_expression_3','c_parser.py',1683), + ('postfix_expression -> postfix_expression LPAREN RPAREN','postfix_expression',3,'p_postfix_expression_3','c_parser.py',1684), + ('postfix_expression -> postfix_expression PERIOD ID','postfix_expression',3,'p_postfix_expression_4','c_parser.py',1689), + ('postfix_expression -> postfix_expression PERIOD TYPEID','postfix_expression',3,'p_postfix_expression_4','c_parser.py',1690), + ('postfix_expression -> postfix_expression ARROW ID','postfix_expression',3,'p_postfix_expression_4','c_parser.py',1691), + ('postfix_expression -> postfix_expression ARROW TYPEID','postfix_expression',3,'p_postfix_expression_4','c_parser.py',1692), + ('postfix_expression -> postfix_expression PLUSPLUS','postfix_expression',2,'p_postfix_expression_5','c_parser.py',1698), + ('postfix_expression -> postfix_expression MINUSMINUS','postfix_expression',2,'p_postfix_expression_5','c_parser.py',1699), + ('postfix_expression -> LPAREN type_name RPAREN brace_open initializer_list brace_close','postfix_expression',6,'p_postfix_expression_6','c_parser.py',1704), + ('postfix_expression -> LPAREN type_name RPAREN brace_open initializer_list COMMA brace_close','postfix_expression',7,'p_postfix_expression_6','c_parser.py',1705), + ('primary_expression -> identifier','primary_expression',1,'p_primary_expression_1','c_parser.py',1710), + ('primary_expression -> constant','primary_expression',1,'p_primary_expression_2','c_parser.py',1714), + ('primary_expression -> unified_string_literal','primary_expression',1,'p_primary_expression_3','c_parser.py',1718), + ('primary_expression -> unified_wstring_literal','primary_expression',1,'p_primary_expression_3','c_parser.py',1719), + ('primary_expression -> LPAREN expression RPAREN','primary_expression',3,'p_primary_expression_4','c_parser.py',1724), + ('primary_expression -> OFFSETOF LPAREN type_name COMMA offsetof_member_designator RPAREN','primary_expression',6,'p_primary_expression_5','c_parser.py',1728), + ('offsetof_member_designator -> identifier','offsetof_member_designator',1,'p_offsetof_member_designator','c_parser.py',1736), + ('offsetof_member_designator -> offsetof_member_designator PERIOD identifier','offsetof_member_designator',3,'p_offsetof_member_designator','c_parser.py',1737), + ('offsetof_member_designator -> offsetof_member_designator LBRACKET expression RBRACKET','offsetof_member_designator',4,'p_offsetof_member_designator','c_parser.py',1738), + ('argument_expression_list -> assignment_expression','argument_expression_list',1,'p_argument_expression_list','c_parser.py',1751), + ('argument_expression_list -> argument_expression_list COMMA assignment_expression','argument_expression_list',3,'p_argument_expression_list','c_parser.py',1752), + ('identifier -> ID','identifier',1,'p_identifier','c_parser.py',1761), + ('constant -> INT_CONST_DEC','constant',1,'p_constant_1','c_parser.py',1765), + ('constant -> INT_CONST_OCT','constant',1,'p_constant_1','c_parser.py',1766), + ('constant -> INT_CONST_HEX','constant',1,'p_constant_1','c_parser.py',1767), + ('constant -> INT_CONST_BIN','constant',1,'p_constant_1','c_parser.py',1768), + ('constant -> FLOAT_CONST','constant',1,'p_constant_2','c_parser.py',1774), + ('constant -> HEX_FLOAT_CONST','constant',1,'p_constant_2','c_parser.py',1775), + ('constant -> CHAR_CONST','constant',1,'p_constant_3','c_parser.py',1791), + ('constant -> WCHAR_CONST','constant',1,'p_constant_3','c_parser.py',1792), + ('unified_string_literal -> STRING_LITERAL','unified_string_literal',1,'p_unified_string_literal','c_parser.py',1803), + ('unified_string_literal -> unified_string_literal STRING_LITERAL','unified_string_literal',2,'p_unified_string_literal','c_parser.py',1804), + ('unified_wstring_literal -> WSTRING_LITERAL','unified_wstring_literal',1,'p_unified_wstring_literal','c_parser.py',1814), + ('unified_wstring_literal -> unified_wstring_literal WSTRING_LITERAL','unified_wstring_literal',2,'p_unified_wstring_literal','c_parser.py',1815), + ('brace_open -> LBRACE','brace_open',1,'p_brace_open','c_parser.py',1825), + ('brace_close -> RBRACE','brace_close',1,'p_brace_close','c_parser.py',1831), + ('empty -> ','empty',0,'p_empty','c_parser.py',1837), +] diff --git a/v1.0.1/Resources/WPy32-3720/python-3.7.2/include/greenlet/greenlet.h b/v1.0.1/Resources/WPy32-3720/python-3.7.2/include/greenlet/greenlet.h new file mode 100644 index 00000000..8fff3f5c --- /dev/null +++ b/v1.0.1/Resources/WPy32-3720/python-3.7.2/include/greenlet/greenlet.h @@ -0,0 +1,157 @@ +/* vim:set noet ts=8 sw=8 : */ + +/* Greenlet object interface */ + +#ifndef Py_GREENLETOBJECT_H +#define Py_GREENLETOBJECT_H + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#define GREENLET_VERSION "0.4.15" + +#if PY_VERSION_HEX >= 0x030700A3 +# define GREENLET_USE_EXC_INFO +#endif + +typedef struct _greenlet { + PyObject_HEAD + char* stack_start; + char* stack_stop; + char* stack_copy; + intptr_t stack_saved; + struct _greenlet* stack_prev; + struct _greenlet* parent; + PyObject* run_info; + struct _frame* top_frame; + int recursion_depth; + PyObject* weakreflist; +#ifdef GREENLET_USE_EXC_INFO + _PyErr_StackItem* exc_info; + _PyErr_StackItem exc_state; +#else + PyObject* exc_type; + PyObject* exc_value; + PyObject* exc_traceback; +#endif + PyObject* dict; +} PyGreenlet; + +#define PyGreenlet_Check(op) PyObject_TypeCheck(op, &PyGreenlet_Type) +#define PyGreenlet_MAIN(op) (((PyGreenlet*)(op))->stack_stop == (char*) -1) +#define PyGreenlet_STARTED(op) (((PyGreenlet*)(op))->stack_stop != NULL) +#define PyGreenlet_ACTIVE(op) (((PyGreenlet*)(op))->stack_start != NULL) +#define PyGreenlet_GET_PARENT(op) (((PyGreenlet*)(op))->parent) + +#if (PY_MAJOR_VERSION == 2 && PY_MINOR_VERSION >= 7) || (PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION >= 1) || PY_MAJOR_VERSION > 3 +#define GREENLET_USE_PYCAPSULE +#endif + +/* C API functions */ + +/* Total number of symbols that are exported */ +#define PyGreenlet_API_pointers 8 + +#define PyGreenlet_Type_NUM 0 +#define PyExc_GreenletError_NUM 1 +#define PyExc_GreenletExit_NUM 2 + +#define PyGreenlet_New_NUM 3 +#define PyGreenlet_GetCurrent_NUM 4 +#define PyGreenlet_Throw_NUM 5 +#define PyGreenlet_Switch_NUM 6 +#define PyGreenlet_SetParent_NUM 7 + +#ifndef GREENLET_MODULE +/* This section is used by modules that uses the greenlet C API */ +static void **_PyGreenlet_API = NULL; + +#define PyGreenlet_Type (*(PyTypeObject *) _PyGreenlet_API[PyGreenlet_Type_NUM]) + +#define PyExc_GreenletError \ + ((PyObject *) _PyGreenlet_API[PyExc_GreenletError_NUM]) + +#define PyExc_GreenletExit \ + ((PyObject *) _PyGreenlet_API[PyExc_GreenletExit_NUM]) + +/* + * PyGreenlet_New(PyObject *args) + * + * greenlet.greenlet(run, parent=None) + */ +#define PyGreenlet_New \ + (* (PyGreenlet * (*)(PyObject *run, PyGreenlet *parent)) \ + _PyGreenlet_API[PyGreenlet_New_NUM]) + +/* + * PyGreenlet_GetCurrent(void) + * + * greenlet.getcurrent() + */ +#define PyGreenlet_GetCurrent \ + (* (PyGreenlet * (*)(void)) _PyGreenlet_API[PyGreenlet_GetCurrent_NUM]) + +/* + * PyGreenlet_Throw( + * PyGreenlet *greenlet, + * PyObject *typ, + * PyObject *val, + * PyObject *tb) + * + * g.throw(...) + */ +#define PyGreenlet_Throw \ + (* (PyObject * (*) \ + (PyGreenlet *self, PyObject *typ, PyObject *val, PyObject *tb)) \ + _PyGreenlet_API[PyGreenlet_Throw_NUM]) + +/* + * PyGreenlet_Switch(PyGreenlet *greenlet, PyObject *args) + * + * g.switch(*args, **kwargs) + */ +#define PyGreenlet_Switch \ + (* (PyObject * (*)(PyGreenlet *greenlet, PyObject *args, PyObject *kwargs)) \ + _PyGreenlet_API[PyGreenlet_Switch_NUM]) + +/* + * PyGreenlet_SetParent(PyObject *greenlet, PyObject *new_parent) + * + * g.parent = new_parent + */ +#define PyGreenlet_SetParent \ + (* (int (*)(PyGreenlet *greenlet, PyGreenlet *nparent)) \ + _PyGreenlet_API[PyGreenlet_SetParent_NUM]) + +/* Macro that imports greenlet and initializes C API */ +#ifdef GREENLET_USE_PYCAPSULE +#define PyGreenlet_Import() \ +{ \ + _PyGreenlet_API = (void**)PyCapsule_Import("greenlet._C_API", 0); \ +} +#else +#define PyGreenlet_Import() \ +{ \ + PyObject *module = PyImport_ImportModule("greenlet"); \ + if (module != NULL) { \ + PyObject *c_api_object = PyObject_GetAttrString( \ + module, "_C_API"); \ + if (c_api_object != NULL && PyCObject_Check(c_api_object)) { \ + _PyGreenlet_API = \ + (void **) PyCObject_AsVoidPtr(c_api_object); \ + Py_DECREF(c_api_object); \ + } \ + Py_DECREF(module); \ + } \ +} +#endif + +#endif /* GREENLET_MODULE */ + +#ifdef __cplusplus +} +#endif +#endif /* !Py_GREENLETOBJECT_H */ diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/_cffi_backend.cp37-win_amd64.pyd b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/_cffi_backend.cp37-win_amd64.pyd new file mode 100644 index 0000000000000000000000000000000000000000..44ff33d85dfe80990a11b3f8a1c928152d0826fe GIT binary patch literal 174592 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

~YJ)0czj3%#H(nOoKrb%YpM>57*Z z!~Gj}FS>~pyp>Q~K)2+7^3B#*vvtgg)%OYBz%`%q=7i>%^Hle*02H9k=mV68dO=;5 z9YKZ%-3*L^Zqrx^?CCIpbcD@5qon@zU@JN|KBMP6dhRI(cg(C3u0Lb6aB40o8Qocy z(UzL{Ur%Y=4i|+)=6(_>+a@N!*xmIDBN7`sck&ifFakkAf+`3G1$ymqRl5dAxo~1v za;R=|EQM1S)Yl?wQ1o1M?sl|WnL4+&}E|<<#_uxA_dUY}9wQ(a&a?+U18t zQj@ttE7a^q4aCWcc?4}h^IDtr?kmJYN60xut6*v}Ho@yPz%amoC(&qLyQsMkPA*}! zhD~@iyPN@$wm0`g;Tartw+%P}mm>aHSETHfEIXq=i`mW6K7Ee%T8rbOcSqAp>!KT; z+KR#{KKdWg^yG|$ONQaVdQ3&O{7nz?k+7sU0 zSp`0EW=mHr(+Q2XCz~(1cs93)J^K22zSO z{`ezXZ53Jq4uC#i=dR9>zddUEqZ=?RVJO~|`S@!xEVaJk+M$QGj0cdl0+A8XIx|}J zfq4iG>!fehy=oAftfZ(TdsUC{dq@iwpo+>mv`kMhOM|&UI{@-j%icxU;O7BM(l z*qtSnXQl@~t2IRW?Pd0Nk%avmZm6Y0)Svon5bz$Mcio3WS3J+8cilsIX3jwMlPdv| z*+j6ml~fQX;K?_B!b8vfTUarwOjBY+ShX7S#s$DPy;|?d4_tzb6cgmT_@W>*;`bm_ zK#)m!_p5q9<50(n*OnYUHGMjKhXs3ctZe;d&55mD+pH~=sN_b?nB8I1TFF|GtIGt$#eS=DrZ9pn|}mL8;8lp&F6hAkRze32#q z{EJ0OdIZkrqGYmmm*?9p_A16+1rO}RAc>cI=}-d3MAL(9n@g>InK|ugf1;hq9;`wV z?;~mULy-+lYrs1msjv>2jORqsO?B*)>=t;XM$mx&<~sF{M5dWb_{fLHDy?Zv)7V`~ zs^{4>Cv`kLtP~hzMTb@co`a34WL+b&7ZPg%O&&1&K;-f#1&Cy2Zl+u_JXzM(Rl258 ze?sh$+;cA+)gI7D6$`QlH;$)*rGvDO)8xqZZ|kbmUWyI#oCp@7AeF(RoX%095b=fd zU$P?X{3RP8X_=DrpMOP$(qUv~j7E~smcO3Meey|aD#jjMW11e0rG9FsOXAKuG3H;U zM0>0EV;H-3*yA21F?epezcJOcDwaxi(7D^;57N-5n(mT-roGT71N8ofnmrWKESLjZ zt|faH9vsUe>zNNgKpU&(o5ZU9E4K&%fvIJfoZ_2 z>@Y^R89ZD)C+>~q?Z%)&yh7F4=QJOVvV4y+6R{XCJk{g|WE-h; zw)Nj_dt(5%oe)d041pwZ=&q)^Wp1GP9*p*L3#4nFwMN}~#{Ep}M&trwS1?~oBsW1H zKj1O$wALa-_}kI;vSD|diKS2I7w!C{jNr7_;|hU3;Sv;TU5y7MS4PYJ9QHr4lu&d} zTp!GQZ-Hu<0=L}?q)ZIr5+`cvv>fv{m^t1?KfX*#9#P~^;ifoQvsSmlG#4+E_;P^3 zmc51T^|IogWT&V~1Ia3-`|yQYO$pIoER7mL&M(|vTbAjpFkBTHYB09#Hev&321V$l zJf5z3hUwVk{G)rdMpY>Hr=RI39N}>vW>u6|8SioDf>3-e66&dc7B*uIyZqlAMS6M) z<4P>4Jht+KGIBe#l5F%w?+J|_eg5VuT4Ah8lZPR;dNu7>!p)`|B4r#mt+6C^-h=8R z+Je4IlVLAAI-SPR9jHIp19Wj{aLGtMS0)B=k2|+g%uy$-E)ji4zQTCfJK2k)bDxSf ztWRQRx;@;`xyUy;UH*4TRAXz6DbA z6oI0pBjzMwOz%YfXZ;J8HB@XJVydwQ7-|~bB*hnR?S6vzD#nz=k)&A&Nz}+Q$BOs* zv3Q9++Ieg20lA})p6tqMcUBCzON|DW9jz7E_pKjk{MnPhn+j&l_ZY(N53E6(kbnH4 z+V+hjFC`zRq~*_ZMad73sL12_BGL2(Fw;BSVkf%AK3`PKX{uLa#>Jh1wq42vu2U5^ z_O9XrRbgBgdn6s9NdWm1UFZ$*X)60a`Lg&Usa!fRQhk?`I7id!9GjcFv4_K`0gegS7BpJ+d}JiMsrVY?o~=l=3yG|PlrVFR;*BKG*j(Gl zj8AkUN@J(nl$a{klsMHuLumT>Z(LI`gYbr6FB&Vfc=FR2gxr^e$S#)!eDr&CqtYfC=D#;Z7T7yVqV+_RpM6 zk+>Uu;3m8pFc)KgxkEj4mER~W!AXB9LYe*x5ZvZh``04v&O?o@hgm!v?SBZ2uAIas zUj&h3pyPmRR{2#zpKLPb#mdexlMAe7aTF)7$2i?~Tq$ZZT*A!x#`Vg`Tfn))>+@F0 z6dQwhsl57dbD|`6`tPd}UyVBp$Bh7?((N%q-y#V$C+Y-ry{2AahontY1bpG>*n6P7 zH^!@$nU|0M^Q>8^2G9n=w(E}~Z$SJ|A6*7YGLH!_ZAHf<`;@=P%5V5yuku<1Lu?3U z@iFSGi;rFx{(XpwB)a+^s%U+w5ZOzQbizedHTTh%T7N8 zeIOySV{>;xAMau&F%OBoHl%x4fD`A+H3HmrF{zo$)%=3|&>FWgM9rYj|LEU`;Jy-K zGO^D-YgXzj&C*D3n1UaL=GRNH)Y95a{kJu-t*Q;FOHhLrouCeeFTSM5?v{tY`v7{D zf8note)3U76}XM>3}B^w15|{ZxLk~d5b~2Cf0;=p!K)?#;;$GX$M-{2SuoSP_>+U8vHirUkTA(-Wnkp22eK&fH8~!Wh&w8?S)ku#g1^L+5C=&4;;6 z+(p*081R@ya{4tL&|WhneF@zJ(~{l<}y{s&B> zSb8$>2ELImaVu%i{^Ejb9}^ez=kxy5GQ&)ub(J0hX)C4`jD-=o~-o+j_AHV>21icM*qi>D&KM7$suhFm}b5H^6<`H()O!tzG$n z1c4;6Idk%rnoM1S5GA^(k>RSMI_|`QqMay_GeTx$;jc|Y|3j0SYdZW*o5HDRvo@0m zjfu*ztuw(AS0gy^+5IOdB2443`i92i z-A~7d_3pSg$f0w>nm{Zg6{7n{`tWx}{y3E}n4g=sI_hkQkKWL;|KC49Jzm!^unp$~ zXh-rHhVN}g)qF~sZJpoE4_z2q)fEDeH>`~15;YB$`Dxf2Fsvp%um6r|>+XlbdoPEO z5QhP1!tx&?2~KsNAH+7(eTMsd2v(BrQ{3mrzRNRP{*pD7{&qI_3?p~9`v!fir>@xO zuKfML@b^;j_kkXN??k0%{2h(-gm32F_Mrb-{!1!NSctLE5 zrViX4&wV+s1vR&XVk#f=RVv3}al%jU;-QL%&C7X!^-MU$j%jdV$(5SX;wX08G2VEW z)zq$LjclwxwKTaq*TEz>b1t2jyCdrSF&DVNTFV$CL(^)=NiAS$TENn@fbm=a-+zz= zC(e#M9Y;!gIrDIud~>lTrQ)H;+)0DcL`B#`*FprTrsg#joZ_O7OApNsTGKCqZ{ObX z#Y6m$W_*0i>!)*1H`XV{%}VZar$j0_Lla__rUq>2+01C6o8z)@0ppJ9m2lDvBiTRa zd78=rPO;HD7-b#SD*Z~N^Bts{m&R^HABF#r>(QLJ4m*F)^~}rsZIzOJ2mM@Z2?w%U zE!$3zl0e{gkAj_7Dd7sAXXLv+eo_k3fxX-J($6GT!3U}0)tfb07k)lpe2Nv9zjAM1 zTCKEV2hNqqg7h^c9wf87ZzZ*H4?3ui#rw}niLih`a)x0bMNmm zH@w7HhI-OURWi={qoqAbO?ZF)5}zxb92I*_wN`P?^;@XBy?{ty8gO~6 z_xu$+Rk#ttbLw>P4tv^OlA5Eb>d5%>Ik=z22I0 z;}uq~znwp%QTNS-x`}~Ar{`n|Q&R-a_XZ1`Q>_?ISJ*uMC1B(ZnoC}cDX!05zW z;6)yx6=vq)!!~O+GpL(^;Kldl-{#la?K{Ms?O&(fn1k^RPd+C5aE8|`+SiGeDL!xGZSgcua{5n{8If4)|J z%mEc==m|6K9fUt9S^) z)vz;;no;S)%Quy({4il89eDchB(mfV86u3#kkoS)w0Dw+$mzMjDvE*9a@=XXGBbRr^%oJ@)TcPY&L@cpwajF^hB-IWv=@l)!zDNur*2a4nLn>v47u3QLyuO02IB90BafvUJuJ1mU_OS)!PZb=sn!LK zQHGbpp+j0QBe}rsj!-r3m9An`eg8ed_gv=9!7i$rF)o3sa${85OeD`CUNR-YZq&u@ ze6Ps;R>U`6T}lV~*+A($8Pmhv%nF$ATmJz<=mHE8A7Ftd*zcCiduOY8!PxV$hZ?>8 zLmofCX83`7Lq5>c`xoZ%^VR_2=Y1PhQBfX0m$|^*!RG>gDoHac0uX~%p?##tF}k|} z9Mhe9DItxD4fjjT&U^{>FJCuo9OPo-f~@lU+BTGyWbQn`MIxny#3#ro44#tt*>&os z?;sbNuNgEhs_2WDh)}hls1+fo*|lNfRTn8)j6db{pwt5(p)2#$In-yEEJha3CeO7k z6m?)q!-x|2aev{+H=D|>l|ekX8jD&tj8dt8{LvSBP(H_z?S?l{rLgNZWuuRokn$ zLiJ3!A-R58A-Q-suOeLU?$i+b+n=)HOWE45dej)ZJ>{FI$(wBgA_4Waca=jr+B zM0G4Z;YvaxML7wHcsC}5@JO^hZ3!&^j_Q+bN0*hooH=DWi^T$D>|LEzI&Ctg5a53@ z`;`%QY7}7Rv)!qLShhLymHG4prvqnulAX*(mpdg;YjoF2R@YhK&6!u3A>F#(N5}Iw zXQs_m@Au@g8+UaMP#AzMnLT{$-o@TPv#!;DT%x9qC?x*&n}APeFX`S>^P&IrxD&sq zKNG%#SVn&qn48d(iG$VIVd|w%!2~%LhLz!;*<+x%Dm>)fNGh@dsH>UN&eVfM7JqwE ziO2&B#6hIe1~7m7N3_e=744vR_mt)m?8%BbaW3u~e@ytJ4KF1IMH^n`Fnq&{NkZ&R zE?l+{F>e$Hq3%TPZ^BEJjS`;6h(h#on0B&iv>)x5hb^r}s`0YLWX3z$c^=qpuJ-a* z?grET+MU_{e3WIr&+(ag{u9SdW~sbkXp$HoG4VSA{bNJgmdsB~XKzZ1ab72q)r|zl z@z*}5b~Do%7lftm7Ap`EAhhBF#$R=lwo|0NrXA4@h)PdMNUHWqK) z=+fW+YAo0gQ5j?L>zE$gvFKJJV-eI?FoiT0iEG;k3Q>g{rlF};hzJrm&UK*-;-CFB z0IWjV>V3A2^By42@WEO_6I(L37)2UB3=LjWk?MK=rBs@^AJ7J#U_PoGQR5V z4cMcN-)4iXi$RS<#DBb7CDjec4vcJop4}d;s#(U9lrwL0;hy?+zuuQWDd6|7AVq(L zny}El#c%fM9&*^YE_fJDNtO6tC=w@kpj3>ylq4*wj7UXFLK)AnxQdGw+B1rmA{NKe zb3t|YuYti??jmW&h?a8<0q7N61Y9=95O6GGHXfSNNV*upzc2?(THjVP#PBwBVlG=K zDNhXWuSKNF&O|^8X3t_Xdsqw9xhZq&6jj%{&HvE$Y`smtN@KN~GRzZwS&K0;dxV1C zZp_rfVx$;{;N^?I9GZc2li!xItpljX{@trVz7bs{Bo08Yg@fg-9V+IW72?QHE%2$J z49_o_KhQS#7xg4&naXW)Z6tMdFyg!~*E)`ER#8l`7|T~yXFu1rw_mbiUaC5K0$b2z zIS(Us-xMBf^vhTR{|_z6Dz@LIceS5*PnBaj5jYVC-ys*&h|@y@ua`js?%1PhEt0W| z*FCjR>Fv*0=%QX%o?;9njWXZFUvyNgpW7Yn%L@A|>lpzCZ9k@cA6Lmu3IY;E3Ym(V z^YpnkWule4jU32b3L$B6yO=h{ZiJ2A+Uazf6o8}`s25%vHnA0B?1=9OY~r-bdBa_u z<;i!O)&`!6*IaZG`1_irq`rtRK6v2Si>U0h*GYl;%0o&bB{H zV$8Wo^G~X&VX^TyE#ui$#Y)9BLcqbaJGFqWBVba)dKOS;b2zt^sSQqUR(_G0mM-@> zQiQl9fU><$YMrt}R>^~~c^m&9&1op{t7IAYXfi9HIx3|a7 zTV~`POJDMs_x;+fVy&sMsNyH1)!S257; zjz#KnB=O76)~HGHcjV+XPAy8XMenoRdgK~wq`O6gr9hcc=>JZhlfK1d-zptm^(4EX zgU%JzlRV26zGLqicK^ukAnW|<^wr1VFdb4rxhgM2&7mJ5C2eGs(VL<%EsK}!TEmdM zpc3Z8Qzg8vy4dyMxu1-l`;Nc;KJvsGCbWXh$Le_Yw_^aX{x?eviRA>mzc6-VX2|D_ zv{znBX(^DJv)8W)`r9M+dQIrDT8as#OPQ&#UPadY{RBa5OZdtL@=0*CM&!N05t^9) zzFl$~KQ4-S1`YhDGPa34rfNQ?11+X!WNg33yG13D!Dg0mJRQh=#@N}jiEFfp&Yp6ph&X7mRfs@{G-FtNIdd8yv6Q+8 zR8A0s&@`gLpu~&Ay%Wkm-J^XaZ!Oo%Df-Lg-+_LhJDMHP(%6CQ>xA*^8~i*WTtus))c z;MiEPhz9gLmFFFZlX^ab=LfEFpJ5-qE)7*W(1`)dge>8sM%C`40qp)6U`Y0Iqk0qR z#OJt$AE0nyyZg80USUpTI&vbbqUI6$M>sc)}-!nHuN8!Z|?iON{o*gJrFHu zbB67aLDc6sb=wm5szY=S9rnku&u5OaEj06~x2_VJmg)ebWAANWpYiloLWXe02`>L8xRAu}X)L;VYnW0dZdcF*x0Xtgp>Z-PmeaN(<0x?0(b*R$<1&q3U^19wv* z`wS=5Sf>~1{A9_EszS5%Vkp9BZ`2}^m}H|A?KyoGIWMV_$~jMY&Wjums?N;6P9<%T zKz6-Qir_+%ZWoH>iI3#n4&kr9p@{Hr;f0ppI@cq7Sj8H_!=lw!vM^0@4@UPZQMmd9 zMX6!_i7JDpg!#AnL;RKxi>UH!1`$j_1Tsx?x-t96v<>{{YRhvH?OF>Y=_Q0>m0p&s-i;6nYGb<7WXF}97Ut4FhK>j_;9 zbF7y=*f|F)$)tLIb=e6dLJEuNe)eydf+?S;9FP-s4Q$V!hOn^{>gl}&t`+?du#?!G;}6? zsIux3<8AnK`;hOzbKDPArsE3Q7K^&<+x9EnZ-ZR(siiu;@3|cJ<9`TpCeA&)=k-`U zFw=g-Vjc+}$FVB2ufH#}KEzCOPS_hMTdXID#L=};)z9Yd~VoxPExAxOKMGdpHVRw)`01sL;4 zvXNHDZp^=(*qSF${N?i}^t??Y&hv1(J64N5ryj&e$DhaU(jTYd#25K9R%d&gBTP|w z#d9(yHIwVzPFtZww4%@Pv zox7+yif=C&F)4C%iWOVjepsa8LpNFyu)X;nGiER;iXPj~~2uYw;9j*KM;bU_3D zb>Qs2xl9?*CS4&&Q%!85T@&U)ec)_JOi>0KV$8G&O&S({Rw-Yt>`4<&fp_~vtlNn zHLciV3|9oRA=+&WWVhj8A;!VCDmNNwqDiqN$`?f%-Usj`-b5&*cK$>I}N*H96 zJzVH6@BhHJvPy-DW>Kp9b?A&W)c+0CK$MCz?0BusEQybPJvw?@bTqWS4mM8uXzo>? zSr<(&td6rGsfwkV*j7e3dm9hUTOD&wKP~1Q8!!7Lo;rPe3^L#d-Kq6iPHUe!e%EBC z+~vrj7_6m5+hR?1h*&T8uLM=F$PRX*9oG+vJiHS$@DI<69Xm5`|NB$UYwtisn>M*+ zbLP^19E>COOzKE!+nBBW#<+WfN>u~;vImKBoR{cFX7VWa8`Q`*`hW|tGZVGk2Ivj& zop=aW;9CEx3ABhSFqxLtM$0}S&OJDDeAC}nxt-WwuhoO(?W7yv<&T8~1$a50eDECx zGasP-!fPn6057w7$OQr|daX=V(tISY6S;AajleLyI`ge7Af(tFHNbpmFi|3|UD%od z3R8oR%a+XH^%|U=+2deV16u~ioN<%L7tQt0vK}hOno#1^%*(svmb+625_TyXM&M$N zJd~iWDO|>p`-IETJZ3+QMfnu+YA@u(abtQm^ZS2-dB zxwzWYi0AB{>|PjgP#9ib=7x`s%1_6?;utGFm9SftVcTZ9>aFQjnb{thY=acE<{LQ` z&ZX||B)NZbsp%kts;r-GR@jtjN5jFHy(qVL&x@hA*TY3_)m7|QA2PxU+(x&cMeN9s zg|;epTKeY9+h@@oB3D5-U*|p$O=*3;QRHR{gWh1Mg}5_`{dLEZi(%@BQJcg+6gN_g zNn3<_R0;Q)yu%;O;*a#cpSs+oe+383&g|MxG)r@HU;=H)9EAi@gpb>`xb349b>)wW zi`wZZof*y;jRTdL8Lx>gRWvDG0!3b8=(B(5wI3wfb9zD>QwH~2JGtB4vnKNde%N$U zofc%2)tfVCok{q1wC-~yz9G6#_%(&IZ1#2e01>5r!5jms1bz>@*jU5nB%_zbtKAr% zD0a4HzJCNoFdsEnW$KRNF#;<8nxGu<$845^%KLZ+li3q!Vl;`=;_mYCM_vFOa^?5J zAr@eOo!6EOwx1F?i`WgFi>s zGrYQFN6oBI3g{abvrY+3xj=n^S0;zVq?5(|_FU$819%_w?T`2%Di41>{6$f%7{U=S zR*N#r@U5oTP{Aq0^}1TA%*U(rK$>Kt4*&x{LHCZJmkKiDbc3$ZK&7!^y zUL`-}D1RIxtW?}J1>#Tp7NYx?nli6aRak07boL3v!X^DkX)_O%kP#p~Q5A;NK%}Nk z_p>0wBAU7(PU2297{^i&Z|F*Xp~*SFIlOCqRRY&7EYGN~kSCT7;H31MftJQ77gk0_ z^FwLAq*j_Nj^00S9q!Py;Qsa3g$(esmG}Hk0hxt%*<<|#q=B422~p@>b}-~^owEwq zIkl%u4>EWP8++-7Lh?JbUY~8e5F3#B@>(F>g);8eY2aw?cAZ#7CuEnarF}bvKQPh+ z5@$?ypE-{0tDWOMk7@guty{#Y$Xx}HwypZNo|t%{f}cAI48paT<5J*j^hp*J)CG0s z%=*4%&zL0xqvYDJP#QkGV!fe#a+O?i+0W>96@31-X9r8Wh&hZ}W(C>!(GzKQomNnv zTR6m4mS9OD{sbI=Q|I@6Ldb|n*%G9-Rn}6MXl| zmx@9&tsB100)@3NGpIjLxbtW$;4G}B2QvDsawiaqb8cKZ9vFUirGa zP)AR_j0H1W^IQW|^r8EAhwYbQ^84Y61~rJ~P=F2+jI+Dvl#wJAO=ez&KJF20;CiRf z0ity{7_N(0XDSRV7_c3QRz0cRe>$;uvxW9H+ko|IZ>Pj&Yj2nBm-6i``^@%Ct%QDIi`+#C27dl6W5+XKAAIQQN%ybJ3dOAqxWz$P^1XetRtSenz zY^`9NuZr1~T~@Qe!Zvb&4l;hl7*ykWZ;d-&3L!=ON7N}}q>Ply8a1z6BjsBY-Depo zAC`p(j)M+lk^-0qIgc^EwK_S5Bg`zVXn3r9cxtdJpQBz;^Lub~;!1tV79lF&yrJ&9 zSrTpgPieBXV9DZ)VGQ4$Ncx;0>w^jb_7 z!l^#S4TnhkzMU@Vjem`z;%B$>4sN=Ugh<$udE*NP#LM=&Sr&wP{Mg8ZOe{oJDzm#z zhAPMIQrL}9%vrNT`B(gX3CMpgoMXw7nD1}Dmt+<>^OoL{`48Jl>3th}2dyN2RBMwA z1Fg}r|3uhbH2izf!(Kh~>G()nt;N@EMjGxihYR2FZZFoqYJIbgYylaHTc=1HA%(ch z2d~Qo1`AKSw;$Favj-a%##tlIutNnFDbphj;x~R-{pd(O2&$e^v2@^b)(FvTSadNoe>|xNak|GqmW_8?~PsI8ij{oTPu=T!0x8PXKLtk5&=17LWi00 z=LF^ZRm-Xeg|Jrn?~AeVFFT7jF+A1K{g*MlXQS5lyz8&1y0B<;$Hk4NGNC^rj=MU@ zyCj&;K{o)XHW7*|#_4(dlqx%;FlWAXe*AW2r`y{phlB*j;vG0pC8OedLq!;C)piu; ztGwC{qPD-Og7H(TljnoOVN{b1k-E)I4N3wHj8N+Fs5_SE?L@s{JZh>Uc<`=H77wg& z0Jm!)2XzCr28eGXbHw0@7(7`B-o392f{)i`2_v>K((uZXW4$Z9;-JuXtIDJUyP#>~ zsPyK?0LprRYCjZ=jQ&eB^|@&3V#te5i74uOdHqSRkKa@hLEpD`9+kL?r01y5K$+=Q z*0~Q&^w5KR1LesP7-;Z!*@Aipb%_xRc`T^&gc>cVhrj^L4&pAR=fW_sy!eKM#92C- z4{6`EXSmPu2B|Lbuejfa#rL7x)3;tkqm-EZGiYuuZtZ}*U-)!9C=7;^~E z_Z9d1cD`G$G=A%ioAr>t; zughTO`&-x@sxx_><_+6Kp6@%|P5&IvZ8BKc&`RE}5EfyR&_;1=U$c$$)GqrOLm}&< zO~^vS$fL98_GJx*DKq^PM?s@x7!&lENx&!voVl4N=okb(?ne_!OPrT+0jmT|G^z5l z!&UE9Pu1uD_PQv3Q%LDg%kg1@93P%cf^iGLugoUeCi*!WkfU3*6nsZQ5)Pbk-jF@Q9&X!^4cNnX zHe?6e!z~*K_^<`MS1bW-M6U2RRXjlVyNMtpEy9W;)o!kopuHN-Ig-=nb5n}zrHemC zZO{212Jc@C^(1y0`}A!hOc@fuukEE#>WE3Fi!{c{JWYt0EJTDs1osta_)@Wd1vP+q zE2Wk;E^}LSySPiO-NK3oj;nzq-Yp9+Bc46Q3^`>stiB7B$o&x8T#itXXWzI?nXNQc z_4SZ*iHCmnYF(N#&jP(bD@b1dBucI5zLW~JDM@G*Wr=65f@r}=H+ z*Jt{ff3M9yF)n;O+n^ zolptfM0~;Ph%3*!J!o!r){QC+62V6QC6~HAIG-MrCWl4*j~|9MUa~2WU&SElB0`d% zC`vxplFM0_vQ)WWIYp_*+c^8)d{W)J>Jk8Zt*3q;A9t-QOCVB4QEYF`%os^; zG^emYGGxAA(i54}{43tD1nd|;x)`;JwxbKz-_y^(;+s~A zSl5+Y6n5yfU&|N!rJ!QE`qx(Gla>pSN_wb}bhTApnTWaK{%#9dC2>E&RtHdiO?Pzu z2R4}`P(k4Y5fT{u$1~FDxD0ftB*83B{SB2%2hMt~Xw2TFEgQ4qV;u!DwDF_Pv#SW` zdbjHujF`@~REZ^cTd56r57$x=ozW0@>w0S+S9>m@B6aOPspZKkXP-nHy*{ZBXMDXz z@4kzKq4heP+EYCtl^Qe?pc&B*UMKJ20#zAd>P8E#U21r zdOJ_Qb*`{xG2T#0IW3CK#?loZZ01p+CW(2^BPyp{;NP>A<`NQYbqey@7Gsl?F06~R zSLts{yA;jJAE}eAi9O}!o=n|i`>7$_f7WfIC2CFX7o=;{rVG+_Js=&H2k8qvAo*9g z!5@0)yBI9O3s1q|9%1mgOmdiXIk=&IFm#c*vxTg6K_vPT7 zL*Su~h4tS2L5%}k6H$AHLfMhPe;B$od=$K^ar2+z{`)$!)HV^mV#9UtCP2)MiU4U5 zX!hvA*93fd;O-vl0ymOx1vde<$h|M~so*Qp8}e12RlD`czqHt1f|JzFC~Qv~ower+ zRjk>>bKb}!(3#?L1LywqNpAdbB%j5;!)PQ&es9FIOB5UGtH2k1<3D5ZgqOe9VKi3p z3(Oau)3z&xe*pAVSe`rv^i{G!l>U}s=A9+2t$30h&?kLZ%Sq;^mJYnJRsh=?7L?Im z3n24#Uev#2Yv%Qru_P%md!5;;&aBRydARbM=&4f~E;vk+gN!C!@o{>O^pTy+7;upAROqE<>H6Vl7 z!w-I#zC9FaM(@#lMQO>h*E^)8@i%TqUrk}E6#Ac~cme(Ea{&UX@?Mz7y(Y{m*Q*>a z^QH7SmUiRLN1fR$d@aGK^Jejw7{4hV|MRPK<`NCN^FrpN5dy$wc9lDadWID_E@&aL z!~%Y8kP459*_b{+8S3_vje1Pup<{Swnj-wN^He3;IQln>XYD4_z8fA@>egIfrapUQ zb$F4p;ZOuC?_$MQy|%p5v^^|L6qhHz{ZO7ellJK^^uCAwQdBO1nA`#5C0H4&%rx;m zStVb#lz#5M2^#+l+ExpF>u*~aq-Shf#T2foOK_a(>~qywbWmOl7SG$r6>(RyL**;` zWK?zH$c4tb!^{G=6Gi`{$~D&^b-?_8%m?VR_2F(j40tF3P*Kq14{#^dO4rgVf7Loo z5VTdd&Q!pl4w;cPl;7Z0gNxH9dZei|RjJixdR_Jm6`iA^^Hp>K{=npw=4B3i_;G|W zIRwww$*u*uWTKYVP--G}XNLYz#z*%|bbb_7uvI1KxB(Iq5$*r}rY9r&ahmt+BXX8N z5DVbs=TzKfG{?Q>rn0|TZz)!ew&P2aXUQmneU&xPlVd4W*>aqir7e6LLUjf)gfP+u z463vN^Rmm20v;blk+Y3)^-_BVC=U-;kvF1~QCQhPOEm>*MOzb~ws7uwFgq4zS!+>e zD_f|~Z9Pjovd*Af&BF8}!a}!^t)f>XDS9lDyxlhKd~T4j%>@Qpx2H%IWUa!na2yoT zUF!8AJ4+)`$Jfdhl&gvk?9zPS%Q-6kEju`F1*yZcJY^3PSO-x8u-I+CEb`F9b=IT_ z5=*g5Fm)iFOV80)6#BjC-GJiOZVnX4U7I6PfG)if#@2 zLLi9A&-P3J&^_-`w^io?yY&k3`VJs^^OKSAMd1rCV&B2)zCiI+7opac@;m%EeI@|P zr)C*wYR7LraTviC<3~qPJLEP-U-(<(g}+5df0`UlrtFZg|DpKNG3QefBe^ZnhJW~1 zvB)Ct{KNlEDOc<}<(q=h7v6EY!tjhxH1`}Ykr&?9=CZ>7(Aezp+D}&a*N)BN4alJ# zXKWV#zRDzm&{$iNUw=qT@}#o`T8tV-zAv|v-CH9gpN<^xl+OMPTv>)xAY+0K01cX# z(kmV#yp|^i+S~uwTO|joKwRtC4%?5k;#64HUBf5Vwnwd*KQ)UvbZhh@&Z?SabR(v~ zt?x5WA+WsH+22XmtulcVjEidNCBB3t_cwvl^^W6WOXV13lP;qiGb~3ZIa~`vVv;57 zIZH)YYxkh{;~7^RTX%O@y02UFG98etEE~Pl-T7bwPxEO%E;_sL1L|{=qP^2_88WF#{gOu&Naw!mgL1 z#H*~|&h%!?xMIbu+N@aIF#$b>h=I_3^ZyEmHOM!CxOZ`tx-0uR`$v(b#hWj6SIHg%4BVJ zyk_Qrc|@YE&5qIB>~D`aMOP+q=S$*~Th%1T+@@NasI9-#MEzd8P|X08M|?Zk>Oo_~ z^C+t)GMC3gRS#-i9wmrB|67&5kkW*~Y1rvs@hCbTI$z%_>$~T{+~MQ7`VTR6*}AB{}4Sn zNqz0_U&~{Sx>}*`_33Gq6}^_CZcp149us*}(_I5GMc!WNb7n!snFofje+tqA_c-}F zRE>`TJkrmwmJ7W}vfy}kGRRi@$79@Q8FlMNxzDoI4u%2BR@<`?<}mnS?23_bDj}Iv zyfB*myYICL2s1nJOk%qGPptSk@&ZS=-6Ps}lW1@*Cz~O*oCskWDLaz=T&82Vjg(yT zAdY0Maa$vl{@u+a+D-NC^nwW!GUeQ*_Wu~E=#p1!Jnt9;UblM`TAy!FQ#W-4?3rL7 zM#}Th3i#Jj%|&W7zWEgg{0{3Z>|v)q5;NtJdnNx<()w#X$bnJ3-oegLK;G0#Kf zvB$Xx6CxcCc|znrM)n|bJ=Ovt^2q4;SyjnHFkZ>~PFK{P2P&V-q#M=w>=gv^H-}9o z@^hIbG^7K|ZwzWV6}gbGN;|lZJ__(v2&A*1c@UaBRXF6Xv>g=TG`PB2js%n`c(B_0{xwz2Hc6DZ=0UI7X17^bH({z=Q9_D;7N!NR>!s@*>0j{{ z-9~6d6yNM`6E`IaBAbt(_9F9@pN;v9n%Z387;1zao?UF8u-!;JNL+mI1UL!o=8cNu z3v0*m?3v6!#5FKK$*QCYw^p~p7wG~$ctp$)uzG>&t5W~m-3~~c$eXd@-uYM?8Tn@) zQ1>g|=TC&Ijr@&$>+4?MpHJek5~1przfLdv>8g#EYE(sOZ6R8!6w&n}HWIs*T&O+L zFzgJwCe@TCaBP@O@@w4J;P?cGFfFg7bl^a15%At*+yO6(e|!0-)_DR~K9d;?8>I7Z zTMhVyH+;J2r|PT#;Xma4-rea%4Bq& z@ipe0Gqah=o2-_Ko@+lAv%YaZb;T4IfA6b|By8!tAnFMx9Bx zOU$Zb9Pu}4*uLZ-?un+WikWmiIot~oxo5L1lH;a<1wrP@@Rs4Wl)L`lnz-Wup~nw( zWZ2lu!o)L2j@{dHUES@}pQ${O zmTpi>&eRB&xsrZSX8|bP$We=i54e8JE|w7W{Q7=n@_lWJ{y;=`GKEA$Cg;~Nm-@$@ z1rTUFy`UOxH-vd4vcz(%ni>JEm^vcrf{lW!TmHd-0+A-6G6EykLfnVL{ z_2hK7C-%9x#)3X4Xged1o^kr*FuvSDUX_1*FtG@wAmKrihv*tcW3N11^s`aEQdCm* z+&pcB7ojm=edv{|`{;kN`kMi^cltg5;*i6mI}U33IV6T`99Vd?D0f}rHlF`{g!}w; zp2LURGbe3KjtC6>y!ZZPy*uHM7-qdxt89fhexKQ~*F9_f31`{WhkCECCS7HYHiGK~ zOP{gSIA}c4oxn8El5dTbZEHP}5WbPo=8OI@POM3PykY2)vUrNSMDl~{7k#D!kzaX( zdkOCvgMG9m)L%9g?`#$>f4cMobz^!}_w66{TzX>T?~OW^H_o9?s%&(YtpWJ(?hgKk zgYD9b7*h*263!-S;;COo#QHD-H5ByGPhLTrGmoHECClwanJCpK1wWT4!%cqkb9r!* zp1VX%ExEwbCf=BB7}S0D+85^Hp^diIv6{)%C2#=iBA-|Bxo~LsA1YTMMgxy5N2#53 z;LBEkicZ#h-&_^5sa_`t2c?Ia&UEXA7*$R{&<|11dosYLv-k5Z{ zXH3F{;2fRZw9vCRgvvQ>$1c<<$sX6fF^L$$J>V5yyS`c$Osd%i=B$4!p*f?URW-|i zQ1Nd5{W!K4H`YmB)8zJ9^9%prE&i$rBRAdphlJXF+D1 zICsmwk}YyNaL*3~1yW#U&tsqFx^L#Y6An6Eo!$M~ULPQJ&L|jlH3yUiak&_Qra5JM z9#0XTBH1|IT*?@F(DW!!lGhCB>r=gxbFMKi2N=e$F3}53UlT*WGo2=s8Z`%DiiM$iMLYj3!-&YqJ} znahv2oWmlf#u!Wj?hkMocQO9k83yvQpB3?{Nr3InxL!+qF+ava`K(Hs0gsz{q$Vq$ zpah@KCCQh5DkABybq7@ZBg98JeW77@%`K*YDq?6o6VZDrZtsFB76636Qnpk6_S-<5 z=`>>g$4kBadCdPrskc9m&E@J#(>KPP(yVNF(H~0@@xtk5S@AzH<>>GurPL92wxuJv z$O~`yA36(#W(HMj*}CWpuSatm<0Cs`qt|IG97KbBAlLl#fQo&%o{>f%?3MN}y69?J z2xRO*)#zWFhpG`+dPDWvj|9~O4=O-#p#l)#Il2Ic2ZVpc^(^*%8@--U@bKmOk2n*X z5sh5y?FwdeiK)Fg7bTr=#L=OO;c$EI?WSE;GB;#T$O}%R_>sA?v7DPgrZ>G{DiYM{ z#{mXN#&zZx(!xaa{fhDuPnl>pfLW6DfY2s{WqN|@mu{1DyqUl=DD-9&flXNYSxdY`5V!Gpjrc_#dm#{XVftEIUs7WTQ zO2%aY01&TuDdJq_59P3-X)?h0S}x)L;VsixxIZtZ#Yqz1&s@rXi9t}bNzK=(B;~=! zcr{uW!f@p}mN*r!sYL!AoG6_(PcXVKyb7;4%$$SpG3?p{1xQPoFyLlhsyZBO_jWH@ zB=emIk$l()nF`1>*b&T4Zs@%T??m!N;WE&Lf!I1RtY#rot#IEgo=}8EL%}i+(XTNb z%B3S*`s6nB_-URl%@Vo^ZQ-ic^51{WcR(D}a(ts|M07L;ek`M6Pkzoe9tZo+1+E0u zZu?;ENM5{A{}TgYXd4a!@@OlX#WsI?oVq{0di7TR2QOW{eSGe3wWHxbw507NwzFoNWKVcb9(_B$+0cuOTgGbEK4#{ zk*!6R!4SxLC9SLtvR2()VVM9i7!oUrQvyWt7{ z&WYh^DV0p1UcSo$1dzE>Fe$`p`6+oJIoOy;`H2;p^eDD?a6YfetGM>CP`Ch8Ef|iG zAZ!Yg{45)-F8NX9+K++-<4Znt(Zu5PJ_R&9*4T%!Ulb!3@vIDQ?!xQ|Gm<)(uCl)i z8z%Mohn7+nLGI#%pX5gcc!=iqfhhcgFv7;G&P3Ui14$aLGrJLxR|>_Ig|)Twmwm6I z%5oXSTG_F=R(EV-$6P5+uv!co1Os{%hr|QrPke;Me)2-}54%fKQG?9bVA1|Lq<7k2 zanG>)DjqDdKj1*;9kK-sya>p^!0o^mrk%ez-XB|8Co&cpXf+|@x!tc6!->$wU4Eq) zQ1qpEa0cin(X3185&jm*My zrfPRJft#Ho5{1w{W*vF=4&a=5>|+>pFu1*olYOk>y>~BhL94tI2*;1woi+J9cdq%? zRxDp3n?H^<$fWu?xh3;SkOq40{}6Fwi1-s0!taO_?4IzqzrcrL>7=V;*ye6`xvvxw zWe&$xB0s6Ncr*y>uRUnqFypWc?`DGF$0|q{Ykur+P)pQ0&st|fweAYndRIZM%jqEc zlTe+%yGH7qzenr*7i9Mv)md~Ts{3J^@jRDN+DWD(j@WQ7b?fz2IcZL8)PbtQd9XOn zF`+`J$0oJeJLg#2oHqN{%I$C3>~Fz6?9OI?T^xgl#lED)3vrb(3Hn7g^FyTlm3GT# zS3V1dabv&ABpXa9bW9G`o*i^twud`U`8+q&Yyh{x_gBR0#8pRnVdU^sGyLCD1sLfU zqwe{OunQv;Eje&+q^;%;P?h)oKkQE{S4o#e+xjwut+8xteGf~BczNy7T3lwwFC*Ny zlJv;7FWC7go3+64pXPm+-YN$PPy=i;Ix~wG4$N!CD9rcS`FZomJRDoYK3Bm)hsR*) zc-4FGb{x79n~yLYZzz>5tFy+dHmzn^vP%9(vKb9IJDC$5W8@f{!R?H@^B3?t?t2{1 zdNcT8`PMIs76Eok&jF>;+j6n&^0ccn_2F;o<7O`m^0UeA)z6?mQsmIDt7%0*{h`U0 zgNYEv65IDa`9Z#+=l&y7ibObd7{&*Ku*DPS81Cnti1PcwlJYND`Cjc%-d>2(kt(6X z4^4!x3MjolCfh*oIo6OAhv?fa+TIT+rOPHq8^#B-Z%+;CRq|d^hC?H7BMz}m1!bv4 zDc=)d<)1^bk;;R@D85krCn516!r&XiDyuMa|C`{$nRntf0zA^`-BF|k6nnH^0|=k?|^aMg8S~rt3Fgq z+(Acx{MwGd4$w04jv8P3;mZH#e24g_Ff)PtAFFzezDTT~Gdii@xXwCte18ByPk{)XqNcY9LFUs_RswyWU zrB+ecT8XsT_LRE=-U8;!62&ZK{A0v5QZmm+KGPx>QTZVy=s?w?_cIMd(N6-1TT# z5QTEGPhEBg7b2oek056Yl4n4fYi^y=}= z^Ljf|g~3ygUO)0{T+Grs@?y_H9Dv(<^UCdJ@MRq@$MLDr>>@q3N2Y`JN|;^$}y=x5a+ez1+? zLQkCb_P;53jkJHk91Z;gR?92cru0{6cS`35^0*F5=VQh#`bF2`=WB?dq#dU@Ie0E(#u}^*UjxKgT_u{;&(H!obUqRy1tc5Uo>_u7 zIvp{ya85_uDlmNMOduMs`dea!83I0mEO00K-3#{bhd+!l0QYJW(MZ)ZxJ4MHjzBro zKU|5jS>*L75^Q<0v8qyiROyWm+wWMe5vdM<*E7uiH}wJm@q{Kp&_;pk_ks~-Zo&@HQY>ipz7C*lzob97InJ1d#ve@h3)E* zQtoCsQ2s2EKN17&<5e+c0Q+DL7hYNbHetS}@tmoBbt!XXP&)P*lU^W$?uc@p*{PSt`_=2$W^tT>pfu|q;!qbnNK;h5C*lGuS zF=M^WxG`|>@6B@t3l>l`kD4E#l{mkhv8m#L;+eh zA8uLyjhjErP5}wD^EokVbx_<$b{(j)_iTN0GlPi@Zbat4^E2V!4L)%e?E$z!@c^E(nluC zIugnmW;^S@nY*pAWkGa)H6t_^*p|! zLhHxXEu_SHL9n`o%3yU1?BnVdjL#S@DTKhXS*}vD-g93-R!{x#q$d-!eWT+YK5k)0 zI_wrXkcG*M1@;#kq1|~Cq+O%3#e!AMju9SegWipF0(t`mE`r|57` z{rV?&SK`g|6g?&{MJ?zV`$ng=?E86a@Hy;}aJR>Q=aKR8N`o6E$E&V_%D{=Xkqw^f z;VlQQL~ZdeYTGh$B`nzSTetND`^PFCY`xwbxXsj{gQCRc*u-*6H5OPJub) z96ovhv>Vhb?syPDjt-yj5FUfytqR)wZ5%jh{@;qB?!~*21bcLu^Ax1Av!B5--Y40E z_v7EzaXHP%f>k{XkoO@w1|U$?0jkEUZt_VQJYNQ;i;<67GngK6W&|bb`~Y?!TZP=h zh^N795V}Ol`dVl(e*|SLkW?UbJ*k1&RX`91rsH=#_L9W$vym4g-zi`h zhbXl0-2_pSYhFpe@6u0WncfWY-iwQFWzIV(I`ow|_Hx4|AA`7 zNvN41Kf!v*NtAUqHvy0Q3VvyympBzQ+>5yw7Uu@AOMJ-Vg2|H`&|68?*I2SUlQ-#7 z3FpcSSPEvuCq(P#k{LjgGlrwR! zkd^8DX|v$>6q5=^O{_ftWVm9bD6v33)cIWsMl{8Xw@-(3t}kf-j*2^PN0D@-VRPYA z+~xoq9$xkFD#|ssuwjQG;%o$O^0ATIS^Pf8Pi)ZRekY{D;S1zLY5KjXfF9ff$fm`d z7Y!&v|1h%anCyriDgUNTv;>L#Z9FwB2h;etZS0V>gZZ7b7|s%ti@X4Rq#2Ba?zIfDhcsZTC96G;wePY2a z9#40P->SI?=dZqh7LfuY`;W~qQr=__DH5lQy1jSa%niT05LjM$5Z`nOax;uriXH!!C-ZIbx);y5^HXB6PvfN%m>Uq4-P;Uoj|%M$B&)k0M1_&@kx*;@bG zeAR(XuVbBQH!if>_j*yq-J>twCg^|(Ll=1q`F^ssqV@4(C#s;okAghxME&h8CHtNl zKRye;#M@obc68tCa!XCgSNF>;HHSub^Ol+;`&>=3}GB!36yH&?q*zkDU3>B1oX%&S&6qJaaZGi*cNlM|T|wYq5O5`)Yw>j9>BBRK$F-a2SMG7c@g3{`*nrjr_ON&44HT%&kIWdS zkzbAzlRZrnqw1n`!wJnw0K3?>l zWB)pr#0vS3As2Qx#q%# z;?~xEL)eKm4<{fupsFpE`-{s|7*X+i!BB8&CJ5vPJ>k}CV4@u+#LxOIo8-|OwGK^| zFOVeP!f=$>5OZhv)4-&sTi4fPt9l!}ttc1wMzx@OV|P+>(NjEmGQQ-e3kq#fVvzoT z`kX2C!TwjQauq#g2McTAdGeW2cgB-jVrGe65QY zb9w&Gum1`k{VTZ_N$MZsDZaml$~G+(TQIVg-v#KeDy}Jc45K!ZEgx-O_FVHrA6(pW z7yrkJ>NGJ|eD3?;^l$#9@c_PCvh4Zhr;j%mJ>PuzcuDgO--V~{ujhd+(D&6?DY%sz zhq{re;_M9|90NU!#Zh>iU1puiU5+xJ8~y3vx%!XMiM-*E*xa0`l6_+dYE`^R~d zaiILeaeV0ZOLz0GjFJ!Fca&o`{{zTBxi1BR@HdFGg|WPe@2{Yb`0-+|#4+QCdK$v= zFE)x}n{X>G0l+;}9!^94-H#v#INnoIn^WWOW{&!Ba9%9>LswYiiN_mZav>Y;=fd8I z@xe_a<)_1I0Dltbu@e}*Gyh&6kWY@3zkH_%+AxNU@4}f_it!i(;>gr&Do`N2nah>j zLjrf->SrD{%#9dql;a0TFn%I=Yu70FxfsSC9b>=A5{AwFg5aO`RQVlmzYo z9L0BcZe8ZqJ8|^5;=zvk*L(K8>fJaU|JLH}iSZ-#<41aiFR4ePzZ(u$o=>Jz_b=I5 zAP1*uNq>csU}oVvIj6CZlag}0>MW3CixhttN_7mk;|;#WfLf1N{cH}?iEnl3fo7OO zcS=SA_&I@p#vB_W5@Jm`GRWryX5$C!dn6yZq7*X7p~x@96~^|rk2G2MBf%+S@=?Iku`sBrvr^{oVk@v4`R zOY3`q)c4Q)Vw`h%r2PNgS6J)QBwK-J*_OlpuU3Vg?eWR-jzuM|Ok#%(=uO$yX$h%K`{#4ABN#!%+Rqv`G z;%^+=2bE*@7=Rz1Aa`31!m1sGe+Y8vGs*G?`(^>OoXM{k-+M3A7w$DC3}>fss2aB8 zTkz&EqOC=BAhi99d*%*Hw>om{MNl%?Rw*fS^764q{&tpll~g7qkN@EV^5>0|Ux7qX zdA#KmW_uerGldw6{K=eXylMfHl}`r}3gFL?H6r`NL0PBcPX5~p%bJ4>5IHMvlZcws z&(6PK*4rU&r2OMJ<2hc{BszfKU%++TIz1+75Ztrn{!uJG9Vq|tF4pGr(#|EH;^9#2 zKVvY=FIeGZ$?$fBXC5TTN_}~wpnpI}{|1#vf~DjgHfWPf53{ci zmrNrJ%8SDKHFk#sRsRY)0%1LeVlb(&q73cd?$TWK7yR(2IBUvUT6jD&xTgwdA$_-tnVl2q&%`Sx}&qqdmLJR}S{N#G`C+RfPrKE8)d)>SX{ zp)4$PHIIA?-$=tyH^M4Swn#p!d3gQ!d+tT?$8pQYVkt-(MD~T~B6*-Vm7g2Lmxd1u z{FdkbE`IB59G0rM2m-pOnpb=y-*@uxCgaEz z3*e%|>;*(pc=^dTOhtxqq1Z65?QVemJ&J>h!>=-|C=O90-4mT{mCiL|g zT!_F$nIo0W*t>WmcA&)`DMdrJ3>#d6JY0&&Ln*D>eUD*J>EZFgCng);Hf%!=gMH8k zojZIz9-Q+Wz6IU7_X2@xbfjEz8E54{R*m_pUR_If?KFvGWP-If{j+tvCnzT~_GQgSeLw)qw$c z1l1XB87aeQ100Ddy%9dd()x#3pXT8*Ts17KMWro8qd|RIN4C^$rg!dpRPeaXYy?GY zF6CEunnrk51@#%>xmDEXK&o=m1zUa(535=AWw5zU*$tOi)$>EIk2j3meS01Uds~X0 z8UJbHaQzwhDqhQooX~rn>m zK(V~a9oq1w9k`~HlLX33wsNEwtuRn}=PxSmI4B&3P0DNBvF~oh^SfUkfBA7~7Hr`A z2ATy`pDt}TUYuKs^@_5u6eH8V(chw-c3<3l53cXM^WXN9Ti+W0N%P3`k<#H=$Iofr zH!eas{VTQ+i+I)csj^`3jbrZyhUR@=gM9wD1;M_rjt`FT)^-RUNNE|F(X#9ZyhsHV zz%-ZFwXbdNLjS|t4qWa{1%c|L?zhfGZ?BjyUAq}W$C@%C#+U8D_atbV>=^-^5922A zH)`)S@eAI++_w&ldme*g#hvg3n348kEZAi+;53xVI&|xZtmBmR>^nBCXZ_*EicL>r zohplyPxN!(QdY>9#L+2LT)*$BY5QI+@}ny!L<4=XAC03@1-XH*WauW;^FZ6Qp5Yl4 z50v!bZU5!d8i#RzX~}=$rH9+(hxg#ZjS_z24zJjwQ!;)hdIeS3zQYSfN zyN8Rg$KcFcsjKJxg1Y(_XftH^5x$gzVF+sBa-K>a-i`K&TC4JIzk`Uj5q%vQb40(y zsbA`#Uy!}zrW8<%UV#F{*SqjZG%T?Wt`WtD;RLr)kI?Y}-C`!wEsKUlx6pf9x9{Q@ zKA%>aFM*5T__fa>A=_lkO;TJWN3 zA+Wc208@O>Mbz>;^**fTeQV7iZ1y9^p21`fbnk8+DXMr7m-39vfL4Yk!`6>k@FzUh zJPdCECS~Y)#bp%_wxRn$Jt1uz?RU6m{ZqT~`!RmCu4kBciLsc$dn+Eiyp%|eP?_P! ztRvw2zQdT^SHO>Hxlb!e_v1=y$h#X~xE_OvWE_%7!#dB*S@Xfb>dxutUR z#d8Kv8Y%IaJJmB)qHVjW5wl9H$mk?S>tYfrF>w6+eVaGXUbz0n`!Sk*(+3}W8e_}*HjAiV z|Kj`oILP+TF$7~Y=8fXwqB~H2_&vD6a-?ZsWLqy}Z^yA1@*V`%I!GNbN{-cEzin-a zF{2fCL|gBAaCe*-_}$Ysm}KeFLQ4dWW_&~QM*Ar0TB;fFQs9<%wkXt+khvotK# z@ZYt(XEc0N!%u1Wehr^cyw~abMh$B<^fa8S;dBjO(tIyy_^gJX($I0Trr`ZOO5Z^Z zKdj-GHT;o=FKc+}Pi%en{)-K7)X?Gol*YUFr}X_H4ObP!-~CgI$ECka->-FW4gX#9 zjcNF-hFOi@tKoYTey+=}h(D?CAJuS+rrWOJK@B@KyhKAs*ZVZzsKRe9h=0#N*?N3b z!v{3{wuUcg__~Ib-?Qn@((p13w`ka_;gE*!*YHysKBnPw8vabfS2e7B&f@npT&H1N z!+s5K*6{rr-ml?98XnPbOvBeSoc(=^|9lPCYWPPQZr89^!<#fbsNp9y{IZ5mX*j0g z%NovoUhARZDh)sST?^l?@9)&`CJjHJ;r$vus^Rk*{=0@{|E%@UaHED-Y1pgbkcJ=7 z@S_?Y((r2J)o_P~TQs~-!*ew}MZD;p!*^)B zr|*>-u2uMJ8ooutN)3Oe;mglj`hTk7w>5k~!;fhAJ`D#n+@WEshHEtRG%VBbpIkZG z-cRWJ7d0GH_#-N>NA&%Z8egjLFDSfO`{xOM+c)&r=$XBQcn4wEB;#-|yD&UJVavII7_h4VS-S>+zhvAJg!JhUNl`uTsOs8ZIxg@H&0p zpkcFyaSgX?xI@DM4Tm(`ui-%r@73^-hNBvOQ^V&p9MkZGhNe#G)X>wgPQwiv#x>lb z;edvFH9V-{y&4|Ua8$#i8jfjrLPN7s%h%A;uuj9Z6*iu-!-q3>{{7%(%l~Qk&BsYw zG(MK2E|hdZ&o-02u7lq*1^j-6J9=FD zj^9M<#d!X`pnP!Y9elI^PpNY5Xb4W497D$x4*#X_!NE@`+|^6+AkE1s;H8zeyeN6$}@ojAZJudx*0=P>bSGeP+OTWDU z?$Y-v+|lXM4;8>&`uz&$J0F++o&vZ_f4{;VKVABV3g9mN5rr4h|6Bpwr9Y2<0oeQyEW;U6l1yY%}D;4b|=1#p-C z{sOp5f1S#$qtm5-Xo~cd-O2v8Ut#%qP{W5bJgK40Q@O#0C%*D6nee~#6^F~w>!sn zbhL6;$6EZZ&8LR)NVEYf6Gz__v+s-fd1qY3bs%Q2?%~50*VUPG0lUqI4H zH0kbSKDqd<%m*5X-qhCBb@l8t<_O-|uC)#A9gDX&)HBV|DC}Coo{PX*B;8mPCh3kv zU~x%zA_|jqCnK;9NoVc})6ya7Dgk?eb;z;~w*Ae9H{I0TiE5bU`!sJh-?g}< zUhu^uuxkb1_Aso&rrQyL*>t^t?O%*?hHSYfz7{jRD5o}M-?u**Ge`JtdAkZfjdvtw zuzu-as|i~RSf~xw5Jr3P!&sWryf_n2V9Y%6IlwG>16$9Gt-yO{E+_Fvrq=% z1o&X@c0|->bJ?!Nbt{=>2VnOEFrkU?H~Wj7T5L{jpF1#TM`az;#;%K*?HduERkUQ` z)~fdTaf>0wxS26CvlC%yu_?_K4;1Z~Ru{ucX)%OxPF1O?%Fi@a-7`$pn(3x$)ts?T z4{4F_D_~437N#kq{EJPWW~Q&27N1iw-Bfg!nhK<^ST$?FrT-by7Gvka#V-B)QZpav z=6B36^O1J`s>*?xi>8}JYbwm5?5Sh(2j=Z?d9Omg^RX3T8}c%gvf8J`wamJir1xB7 zT>2{(8S{NSBS_CMHZ5kRq0X`LVpEPqit_CAxcxoTl&`|?suI-i5mOa=$nci#nABm0 zUk96ZhNP9cvc4=6d^@LPnkiXRYDPU{7M%m1=Eq~^oCVX(g8Xzdue;2Ybj%d^w)2d6 zmT~Nzh%<;Yh%<$GIkHZG!9y9szi{cSx1OFq#hlh%Zsx6-Z7NomWv8Dg9%CK%zdvT` zNMC)asoy`-tQaaYb9!f)ve-fsOUyQj7iODlyJwm94)9^s%o8(?mW&n+pv|wIZLWT) z*tF+M%x2K`Hqf>XbWCrbHs<(z&U~~}zSPWyJd|`yH+yj`?mc)O`UL9*7i!g;KM+d$uXbmrH-@ zs|A|BX8GVL;tb#h@$73s94wGY;L?U0wGH#dW(Ud`!gG-LW*3{;pbwwwio$7J0!G@y z=^d`vqB64xeP$74dl6)N5z;MMb?R8`tl8$Q{48@8czYIjdlq8)%SH1 z;LD25GPEzog1U(OP#;8PN#jF0qIZ#lVU7D1?iAP6D5e z@Usn>j(#q!gu2F^C3QrTX@rs_H?{< z;j_i&S&T!|zfjQDe_3q)GC$i)2R~z^>#pL7azY%A-{5ULVa(s*nT_u}oWp(z{#AhA zW#APKHALcVKR_Q?Gt>5iG4uoS75&9a8k54)OgyMZ_&tW(`Dd;YZrXP4z_^XHMV-d% zmGsbog)rt}+ZVvCY|o@_gv?PsFeXBNy)I*J!t+hRhkgvWDS-QY#K)b!3Gf$cN< zuF?VO21%23d@VB=;hhe)_Swe5zF7`k3tJ#NYryJ+S+GkmMx0n&W9=50OYnLv}- ze$xw@7uL*t>!SR8b87cIGk48gbIR(OzjAdNV*HYsZ#@n2JP&eLv1YcJwHgu{>UR-+ zX6g0E!_ix@c@EDvg+|zGp?BBb3r{aHGofW^%dju+B_G3jv0%JdcxuedxG&W2i>H}l zv`O9V#%#h<_gV0Rur=lKo(F6LVZh7y@OwCq(&N)!w-0&<&wj}}4e~MFgkiB6pyM&n z%D(&s^yT>+H_KqV&xGxc-|dzD`0mE}2_bf8odLV-42)lAKrYW%wcrG-{G)S6k#}~9 znf;iRqZ07O=|4X##awVB;063~e2wsMCgw9t`v!cC#D&xSzQ2p@9AH9S2`3FsrrkUF zcpu;ol$i%$w|zW+uDQGW9CK%fXJ*9Cj@J8jr29ar`9L0eumg4!bRF!d9fdfpZBlIZ z{sXR)e-v}FL)u4R%Y|V+jZ^V3Oe<+5tv}VV=A|-o@USsI#q(*0zYr$&awY7Rg0wTI zo0;9%9}2ixQyIlWdFq&BKK~f>{^LkO+-w8r9@_VWEyGj!dBCaPpO`K0%b$QQAPjQO z`0#rq58@-ZjnY9K2wZkf02pYPKpXOg>n!{OU(O-_^3cc75hc(O15X;m53GJ!=%Iaq zdLqvJA!eW)-jn})gVJZt~tE6t9l zjd=`D$KPo`D1@Cm+noE-Ddx-ZXY*%SVT*cf`VJf}= z+eG+uia9Z6%-enf77Lxzz@sQEwy?}BgbrAUF=HXdjD_u0C+3aK8MXP#%oy@+`YHPU zmux+w@5C2P6MLiaXZduq9AlpISH$L&nmHI#=d3C}F>7q*sLa)nn>* zWeir|*tGaL=`xdk=?wFZXU{ZSpE%2`@1{>-u^BjS%$9#MX5azvk@`4)w!FUp*v*8Y z4H+N2qprYXfX4t2Zn8w*@WAf^T(r{)V16H8Sc-O?iFQQ@zAs!=W$lNJss|X(Ej4pH z%3!C>G;>#-GB$faZTy!?&4!c4ycf^%2Q7W!cQ-yRJQaSU$LQIz_7l2@?W2&VL$AO+ zi>HtIWel1t?`OY?d4S?%eE2<*hjujZP#=WhKHr^=3XiF*Q)!VY?JPbazAPE%s2`@A z6R!c?e}ce=K+pOzv;K(^a{=(b1@$*Cpsd0)^!*Tybap;VTFN4LChhAilXAWabBQVJ zci~@ln)XwaQxr4r#PbQ#CT$vpN&0r!{luMz9|C@_I@JFlo@XTw>7R)TM&T}>@Ql0( z^Qsf?(g!QeoUHc20nD>lMsE?ys4#n>hi-vgxcp%&1L60DXP3awa;hnZtv!7pu(cPS z1v?Wk%m974*h{%sSPXew2wP-<8JHb2?=OdKu6V=m5k08%iax>|Z|szqSyzEQ?UHXA z>il1Y!Dko3<;&FRW#;sba&tQL{^_euJ5e=eHT9JK#`%-@wmM5qCuFGt{jOpS{M)Nw zPljc}wZT-OlWT^zYkxv}>|KcU4?IU6(Y6S^yLSCu{7r0&DaZY({Hl}Hb1K`Ra=NL6 z-l<$uYARRF9+S4~fX@jxFRwWtZT|P5U;GF&?su?fOXYnlU`M2EGvPgw zM{F$EJHTa-*PuMH$qUM}JS;V3?a*6q;GZ2^7Bg2YkD11Qux%E72jA9!Z=p01yiT^m z{Xxc{Q_S4ee!#Z|iVW4bLH#MSj4Z<9qQ+tov#Ch40}!g?i7mwYNHE z5^J#T_-N49Q5bw$p)}I=(7%y>Tp<4o7tb(ryU)N_db*h#TVQ6XPCPVOe=Ep4p+DO7 z7}1}89USkh-thej_g)q=-@!8`b%Bi%dUrBAA?z$Soshi_$V6Md)HGx6SaJKTqp-r_ z(;=He59bhB>o2gfINR)Pz`VZ+ZT}T*59lSnKfNhtItW8u!|$jw>qk8OVaO8 zF_kSblg0CX$-}<(JHW~?roJ#8G61ks_(?jTkD+t9&S`0$ZoDgE=CsYw14>`? z9c2S&80PbPKGxx&$K1N94-d;O+oIi#;~0Cd#2AjJZ&c-K&6~p}^H(iAgKMbsO!=>- z5737NQ40JP;qt@3EiH9c#!HQNb3gNa+cC3O8b)qYVH5-gqkD(l{2f?;FMQNao6^WO%W@~#nTB7l=gG2bHq|NcQ zkZ%q?_1fl9pO35;+UOkeGmpLk`8$-3nMd)w#=1a`!tXvUEF&bxqwmCimm5(3$8DbQ zyPxN6GtAqtM!T+ihFJ~%7jF#7sN?T~GR*(+bYPAPS}@N&F?S5U$f@iMm(PXsC$X`Jrf8LVTw^o1ew--UiNIb7>A+r)2) znS1fP^n|NV6z0pzRI*lp-|`u2^m}m+F`m}1TDb_n`#4=4C-!%r-`?%8A@JO-c*5^~ z-6m^$i+hKaZ>tl`9Wk>A&kqz=_`Q%OtUWB5YQ3e#>Db%Re`;o9Z$Pm*?}ZX``V(x| z*`^%+5w7)&zBgu`#B<5lzysFtS@g4fslclCV{9ZGxR@sV9?n-d-Y-0}zhCd%Cu0Uytp6;)`x$sVJfog54G8fu!LFX3bfPoabwjGZyS8g!^+hXo zr~4DhUELS1sU6tUZQ^@c`qTMDB%Rs+6!Y4@ML&v}_+8io^Ys9BAz&vD#$@l7OE)xz zc)&J<(s@6@I>VnrK0~lWKgB*Vz-mHe90lwIUK+Dlkx;22^ zgLI=I*j0e-2W+apKb#x1ocY7KK`SGFI5%kd@P~7QmJfe8H)#3rhjW9L4}Ul}X!-EJ zeQxk`Me#k``qN#R?o^_sKcC9>Z^~wNZOv!X{X4Px1!JaR(_nvBKAq`LbnF>O;a-Gk z@jV^A*;KN7Yd)DzB`#0p%|8ORwJ+V3O4N71b1;{0>F>r%&OD9$P1$T>YbxK?`OZ{V z-c$jyF_Y;_u$a~i3i((`BEBcFaWLK2eO0n=FqPPvzA1&>a4!}EZgV9Xl6`$X85+ME zWoqmeI%nBwQ0!o=km$^y!oEeadk4=--K;6hmewmC+c%sb0{v6 zH)bASO+#IYD^esmlQrgfzgD*9??sB1T?3hHK4Ak}n0ZjKZ^>kLCHsI5Xi@`YnK8Ep zRBlc6^|XM)<{?er*3~tb&8E8fWe}xDnC~d+4Dw!{>Q80UUEp%eOyFT*P8J>v z(e>7ah&U{6mfn`p_Qjq>T8gPFmc zIjVd?!CNx@DRZh)xH+{elhsD~N|=gm{kinc{!}-q5sGF)nr(#>A`+BONCqgwCaOJK z_v9$8Dv3?Nw5czX%tHtoGlQLdknJxx?De?`xIYgJ;8nu%V^d#pXU_B^{pBsKwj;Es z`clapuzXb{npHsBK?uG1On}#?bs1?L9DuNHN$ocGq3(_8E@?doiQfZ1?!zHhW)1LA zMz`fsS;{gy=|c{;>rujq86i$|{qbNrtBklvFKEeP6fQ@XFOrN1X*PO{xV6{RKJIhc2{^cKH{;JOt_^Tkj}toNrv?=0u)ba$$u zH;LZ&46$0>p(40eX}>m=%`~QOOy|(UYz2OxX|K+v^Qmq9*$55uU*cP6cT0(7ApWT^=C$qVfv}=8T zH+0GFOtw4cblM@Ma}zZMx$m|+OW+7px0*`1>QA`*3 ze71V(3nG7;l6^TRfSXZ{ZA+Wtt4arY8kr6*^keVhMZ^Ogk6yWTurn{({!vZYp33Dj zDEbWLUfYeSY)@Ziw`Jf`p90I~UFKD!Q(X)Y`DDyHg4%4#rc&m!irZJ0o0EAcD4ac- zM|?8IB(k2pA9ArXYY6!iyL4RVG1>wno992Jxi)Ydt%CHF_paLU;c6@XG#J17~ zN(2-_e>JB1%;%KGO(~FOu)WlcIpHA*h|%<*`)^U6NK1WAdg1m^dMJnN)v4qS?WrE5 z90+3QEx=b@f^ita(6MQ)G5ryk>lscT-xrEyBRZK%2bjSMt7nb5kCbtAV5c)L2YhM3 zNS;rv!q+wc)6osQ(xJ^<%$A@`v}3^EV@z)Zdw6{KqH+oa_zh~zFA7HS&8d8ErrY(0 zPivkAGRORdqp^Nq0KOG-OHfuw`YHDqn?YA%6OQNgSqZEqouW-?9$+rc_o$U3LUJOjjb56 zuvZxLIlIgD$y0oa6Ful1I&N(Qy->8Ngs3(r!P$VamRyS%InY(#Lt2cLP*vz$W|Z7? zn(L}ex;qZT!K`K}Y)`FGy;x3v6yU4RvAD)mt}B}!K$pj150xAt^8szKEg3s1!z&h{ z&`Ia%fO1S|+iKhA&mA|Mf-nai#5TV9lB2gi=Tm!2h)azr8mX=4B`^u-m0anh!b}8ZrZW%pCzYP$}$FqFhM-iA!Ht zNqHq}>a*G8ogmXQu^4$g8?tWMU&rgT2KeH_<=~6K8xtDP>VjbL{c5@_?B^ zYRHm~y)OzAo7w`uEnM%&4!WVsEY(!7-oQDV>Ng>+g2t2{c5(vjD(I9?ha>``*P80z zneR0}1T;Z8w@4dPJ;}kod{aLpOy)g*;dq4sJZJt-2nVIg%84<%K$+jtK;F@t&V|~- zWXKmCt(Y$uug*Y>TEM>5xFu*2GSj>(cyCV)WKA{m_zfbAH|yAH?9KA}8KeMz5{>EH zKwol?`A=X7(Zlg9m4{~dCDXC*=%8-XV6Wh$^>qDVU=K8R|LTisyFr|}a@yupE|=Vy z+L#%-+HBj})V_L^jk&X=qb~|$zF{f== zu}}XtoD-P;)!0GL)%z1nAJ1mGFz#hhD`UQd99_viQKX-UG0<|&9V`{eZS6i=+@9}) z;gLrt=R}5<;Fkz%&17yE9B@6UFm*|=&X;_WuT}fr!Sf8CJgqVHI8Z`8+O56Ihe}s ziNltoMcUtmT3|W|)2VVI_LgolKLoYh1JL}CP|NQQ%p~my!e6GNi0U~llj5y3Kbm1h zV6R?Ft})d)xN~PJ>nORRseMaRtCOKi&92n0U6~tGW*vWZ^+H3{m_#BE3Eq_gGZVX# zSaV7D-X*O3iv~Sze(XzQ|<(fJx@243^3f&L*OC*wA@D8LiorxZJ zP0XJgWa=F3!BV^F>7t0jFtKH&Gl{MY>e!#Sv1b6@mVA%-fI*r4UAqRb0+vWwo4kBN z>YS#oHq^)Y%wSs1+Zq}Tuo+D{m&0T{WfmGZBZRIC4eFH6qgi*Ei-O;Y6#P4hT&g$G zBLbIT$6jsYZIdPXlkkM>PNe#8OlLFw90Req8%cpl?hqEc@-p2rml)XVJHavxYZ^m7 zh%4k=)M+Tyh3TP-vYF1piW+zZkp&{mY!Y4agRP1Bbq@+Rdb%?(3C$vtAi$i4RF<2` zf%J-9Ij+F10G1WKspP`bR zFzdw(U|bws=ULs*kc9lueDTsbFWET6t&b4pnx*uH8l!#_PlhwEZfMDNXr^=3%(j{~BaIxb}p2h5fx7D+$ zz}imQvP5Z7c`KKD{h7SCq;^$ZUCu0ld_h(AqR@d93hj2u1PO$)tJllXi>q+fN$Ks* zq;h0rZg7D9Pf3Pu;O$Q5ktd%T@Xoo^gIVs*B5sOVgT9`AfV{r?Dl z6j~r3wl=I+qNQykopqa9z-+!-L6X;9+WszXuwPucrYD{1>xOlJ>02bdONT)fRwRz8 zqFm&m7=brb7ojFuauY?&^d+<4$BI0LpcQpPoABp#!R?jo;^2$FH_LCy73qSwivhxH zem);rM94f0^Pbglbe?(njFh_a!bE!}IKqnzwL-btw`! z35~jn?e69FeloPsdZ(Z*PZI|cGD$SlY{Sjxi_?wP|w2vZhv@SOs!2Z zv{a%};yPdF4FHz_n6nn`<}JI_8!GGR^Dgy^s9B14iM!ORt}cVvUrIu1q2$4svfwA+ zJ$+@Q#&%^E9*NEL0Ag(gq$En5An^O6_ZIAbGJ7zF_rj*{H!Dm7JWiY7FYrvtWbt1H z5B8B<5B=Rm8^WtzlB>Rq{7Ll>Vzvi=Pd2>^mJlo&=oOWtYQoi3bt5L|Oy>`m_zlKM zUWkgchm$W4ajCw(^gu2x@JvsS*e2YABL-4`Uf@0AqlR^pTjwnSWH~a@okn%S1UHBU z8icOAn*PDQK4>(iSNb3+%RR`Bs5ms5)pbsPAVM7Wz-e_KlS;4gTwPrqT>XG)=b-2{ z@+;@p8?C@jt?RU% z(-uv?&fA&F!wQ3XfyuRtgN>_yXF8wjP4_UnNm$pHPd{#9GK{CgtDyW%#Kk4$qV+gLZJ^EcLV~ zA1O#V@&@_4^cpOdj4mL0-ltOgK2GgGM4PVTB96g29kd~DE)IM%!{NalF301X53)P zThhJUOATR`1(%suM`b|Mz{hLHMDz#3tihegXA&7%Azmki`0}|V2fo0Npc&JX&f7@j z^sK!R5IfZ#qSu@~g&-Maw1kJw;S@R9sjz3RU~kKfbnh~c{2RQ1Pj=_TRy z$Kshs+Zb{K-2lUp1L<-Pi;7;pHzlJ2rV`nd*PW&vO}n^8*0d3w%zJw>gAz+=N!9MG z^>(F)XnqY2gfd_zfik!;02Znk?%?Jj{S_(l5B zFS;^t$8_Z_!Mjsb>z-=RY=5#3)~BDR4083;YyRwWIQ--_Mk?7hsa5fAm_Xq_D`6cQca9IoHD^iw5#=P zZLq)XjKRtXd#Z>@R8DOgRF8#;s-hVg!5tmbL&iCE;M9QNhlx;5^@Gv9}!VtrRkGz!$y*M3qLy>jv5g;rzYYn5R zy7Rp>$-PT3r{O=e&I9{y5T?k=3t>NTj>0sNyZ`)ls z5_V>G4$|}DTnN=mx@9bfL=ivz8C;iuto8MA2~_g4y?1tbh$9`VS0T-&79)NE-(g@U zv0JvawjvqFa5_ni9W;!AuN?Cr8Z1;2R6|R0oD2~keU&I76wg?jpf8fI+Cw#|yiu5S zY!HWa*`j0MH_*XkwD?#BB#z)!-v!1V!C{5Zj>SMO)`rZ{oP7>_16&Iu9rz7_=QyG+ z4>Tku%zmxNN2k9o@7QQ<{5Q$b-nNnUFp;v81uUw*jGZ-!KE?eV=^QqW*@9qE1$GT* zI{i?(Gq5MJ^8NW)pl z7mb52{NerJ>1ue}qE}FV;FyuiY>JXwhK|%oC743?+xpxS<#AEs-^hAlWcKV z4ot-JU#CyzgpNRE@b78|hv-ngQUlvnAfj@@S&AJ+_nyKjA2&(U`KJ`=K|{vbJ)ao3&E|GElU#Wh1B}UEC}`?hQ**dL>!Kv z5Lpl(8 z^y}ab?w0)lDx<{d>q&6e*=7NwWpH%Ni*VfKyCAn`S7)YAsIks6nGis=g(&TKEzG;hzrG6q6J!Cg1AWp;@s5^;=k)6h5wEY#0>ts z77%$46%_I$OF6dRB^s=9cXJlc2ka){SmacRZ2&%%A`luf+%X72x7so&Ed@Ks@G}0iPHj2H+KQ+h}|kfVA`k`3anZvatRA zb;p8Nuny4Q;V987TuwhmS}nO80M)-3ndN{i*F)Du27*(t?{wsUNRUB>jmfXgtD zkdYz)2lFmFg!q2po^+NQ8L~V5XU!T zGucF7kJztk*Zp8=NKvwp)z2#Pnss%SJg(1zfN&Y%v@o02!6&!e z+ue)fJ(%xw*;xlncX1NB87eI~i%_sv(?O78zMWlNx?Vvkf*ceS2Gb~;qO&QNf&76O zF0V+RAHWiJ8mI1T2IX@;g98Fb!U6dgrb9>x<1|lKTCHC%Te%vP~yd`;k2+OU7M;6+8L%c{k@otaYqasY_;rK zHA|O;AQ0L_E;E?z!jirsgi}9>jTbv1s6E)I3yY1L7yQ|(n^5Z1LA*k22sdx#Z~nDl zLl}i!^^%B%FKbx#v;qaA2h;>BsLBE4=OkQQzLHa%)}fhFHPxZ6MJgrSdoi)xsMK3c zWBVOZLOY=tR#psr9Q1?>byso^n8*V@bf_{JR>g8mWaVf*^wx5!B;?_G7ix)S*t3hW zYHMpJW7bvR_~5#PCc(T8JmBWE@CpMq#dFJ@xX_$6P4~QI6WKZ`U$JEoCk|KGu?j7P zU4C!MVCz>W^L4jMOXv3c{2mg3Aln6JI z7pJ8)T}3ZYQAn>-!A2L@mC5C?IO=2wN+^$G7QIz~rOj73fm(;3 z!r%5}M;_E6*k!@_GU&k$*-*NO!DGkUv>0O!f7l@D$nIem<5b!1xR9Qw*hCQ^s)0M5 z?B7)KTh=%z8yeY4lx$+GhHBt8SByvKs))(TNG2!Xy^J1mUsoo$Lws{&TE0bQwGsZZ z7&;bpVjkJP5N?NpbYd-pNaJu3Y{US+Zf@h0-l{>)-`QCwZ7)9&Sks{Xa<`#a=B3MY zW4i}e5KgN5%V;iR4Q#S&u*AAcHs8XSz!q^?+JXXv3YUXT)Jl1eqcV5riJ;Van;?$j z_2-!c9vOy4fKaDWUT;1>kXv`b1+p)ilVz~IJJXe`O=m7h^c z&U3V=eC8-HYP@rAo0ApVn=YwUpqOdeO}{jY+@`&tn~0MMuhuY;jd(R}{cafJS|4T& zsR7xq53O9Y)b8SfO_G%jP#9LR#+Kqjf^dL>#l3YLD$u9+s%?WnTr5Zow!yt__t|qC z3>L*@J&T#DQF1MOpE%n9eWF>^NLs-Q4=jnY-GTMey~@3~P(ccnRcvZ5+aE%5>raAU z4Dt2>v9om-8+NF{*b4P)@|NDn3^um7^{pgo#N7(8ret?8n6mFvR++T8HVv&q(>6$i zTKdO$%z;}htQO#gFxvojN1FBbqW(OdrQ03-)p3+)myN`J#-^PDz1EEPGT;y7nhxHpXO z;ocQ0(Wax;jTYFANu6v2_0_v}5!vGp^%=D8&SbU|M@nnGmL5(3pgu6N^})KMLRVV_ zs*hzvtBrU&m59qBRp-K=;D^@&U;|+Zl0@Ou9QO72t82sTu6Izl-J245gx)2A4s~y2R?d6KH$e7?2Z8)Y$SnvAjll z(l<*9Yygxg>j!Efkc7#-l?pF(R%&|Ttr|ki&q=Vei}-HIwGh6`(5DHU`@$uPIPny} zGk6_NM`zgna%)V^24fojiSGo1O5w;;IO2rI1m@$x0?}1`!5=*m;dj(yK=p^jhx%^t zZiQUlVd2WTTwOyZew@7&^IzfS%vel9G=N3hV+#)IKI$Qyf^%V=Z z%S8CiKctg)NgR6TzDfSMctMJHUAGaqUH_6~!Mh@2K8aUE{<|XLdJ#82>bjAUbv&SQ zIvdfla3kwZg2*D4cdlb8-XPur{P<8gmJkc@cvj=kJy9XSU zgCnK3+SovoX*4+_a9Q7!e`J@vh={JU`g^&m?PSbOdz`dan>UMhatamI$$Jyrw9{#@ z|9-soCsC2hy~w_Q?Ayhz-4y)57~ZHI^`Ir&(eC^LgX{!LreaQL5$`WVkxBRq@YtNX zVTIWw-umHr;!kGP$(`%eQ|jHAvqeZUd(N$}un2x?n}ANZz+pII_C}wNokj>Er>A^9 z;&T^mI^ibxmm%lfH{#Cs%O z6S@7uq({=bjlg(!>*?%&T%2Wp;12|{a?E$Prp)|!l@(*c-CDB3Wu=&Kw}!0n@G`OM z|Nc5~cwLyfz(u(AVW0~yvrGOkz>ilVS-y?80RL5q4dN}pk5{6Dcne_s|MI$fco|*l z9|pYHeu+2RClNS@P*WLoq+eUNNlS z$HHVy+gS=Z^jT_g))M!w0H3q~CRbc>1_~^^>767JW9vk7fh~X|`I!}wc-RWmc);b> z{KNPi-5UC8+1XweF8fr~`&{ioCGmtAh8(OZ@cad*HCO@d8|>yfA#1f8ixOnD9P3~` z3h_CbP%R%X>ZaR}b&WTI*RqQT2rzU)T?c8fJ}7GgV3ktg)!^F78AzO!N`b6kT ziXaq1gMALC zl4}2O>kGPuj$L+;!zk+3ovuOA*nOd;bDt>g;YwnU3Y+t^LXlFuN( zwUZ@W=_d^43&|<{xS`ev%`c`-Kf&+o_{#cY$%OaMCa78Y-ga|t9q0DcWqfyO?X7I; z!2(=Q_$Rn773{`me(*WuY$6W+K}qZ68dqN7OrL83XE?fe#`$m<)7@t;s_O2O3#`KaKFL_dawyQPc4~ln7id$e9vQr${p|{i-T8h=Yr509d#$h4 zDl<9Q2Rhc5mB|KxhG5VaJ&V0UP_Dl}os=goNa|*9RpoRvV`O!9!*bu%K=oT#6^c1_ zu<0-$+=Bc$|A(t6l&-T|V0P{9#ock93}+bS*#+bj=wy6SlGMn+dW-Lk_L5!b;k@CJ z1{B9@^j=)cLxY2Mk@%b8aple}41TDkT=vtAyV>&Db+9dhVHkcXNE7cp!Tl$=wLCZ% z0#y&4?E?~Wp^1HUJZF^?=&DI;WxP4p zpF59>n)bhSu3sy^sO~(#Y7Y zf8`hHm3)bKN4tf~FT!Q6Q8=j}ytS>q!@p4oXIbkT8k$-WY-yB>%$n<4HwhA@OC#b} zwY3Nfn>V&}Y_5;{8Jah?Z`<1JznW%Y#MXFyLsI}mxqxrEDg=@D)|RauAsFdyZrIko zwXNMWw;%)G8yg}inj0IN8tXgi9k98vY3mj4Mbfvo1=KPB)!|pu+_a^6b5lpX@W-z; z(g`3CjOI;kTf($8U*3ot-~PxisabvR4n=cwTU&$!+e|D8n>ZEgK`11@GUJJWUy`V=6HQ;QwL<L|lWEq}rI)`Yo43V*Q@q+JHCPDQ$d1$2IY$0MdGSdpw*%>Kk-F zsehP2#zzPgtSHxY&H{o6pN!Dfczt{QX2~Yet#Q#%{D;@Z8N5?7@gIGUY8nAbx`wS# z0y5rsR9hO+8gG!UYa_UFV>M})tTbAOp<>AX^lI<5P4Coqzf&=_EJb|+~=6$ zA$A`v(hC_r0j+Uq8vdi{g&d!d){xu@W0b!I>@o5#3LG3m=m;!en~96U4(N%8*cCu= zPv7KhG4Uu{^c@l*@YSpQa^)S8pTiPrIOB6CaVIh;X!? z4|gLY;b=V{UNFp9K?$M*x{y!mHAPOTc#zK@`2;=*Au2x69J;>6ib=eP)8qw8{2LIY z;^k-d`LcD3uL)R=FK&FnpA|Q^iiUTwy8;U&DqapN(%EsC>=mjy`IQ*AfC#+N&+$5! zm%V4Z?WW-TL3qAOdguWTd_6Usonw0z=K9rkONw`{ozR?%oyKleL03aKQFqI)203Kw z7#;hV*~%^o&RemkVh>KXNtO)-h0!_94SkRu+57@erhZor>qeNfXL@wQ`P-J733>e` zgf2|g;BQcOzkG2Hqdx9W5wzH71>{qglj|MK<3nLsp33D0Qz%IP3TnSDsQr>0=7P3R z>spXwS?zMDf-~H@S{?*oRh^H}g>q{u;u`ceiO{wqgY!(7F4AW}9M*S&LgmVC;iJ8W z7-*Ms4sD(3HknyjyK+_SYD>8IZ%8~gY!^&JvA}`0;ToO2VarWLaV?*>WS|z8lcPm- z-fDO9>m@%j@rA>Sw-LHbXd5X?&Kl8^00*k4%!i9b?rC7VxPwGMEei@3f6iF%6y#PM znDmtLi%8hJW4Fee)wLJZ@;uyBp&WuyVkvW2Y!d&RtcK_ud`TDovwSHmC!ss7oJYo9 zR&^Qr5oOv!Ng8wGlL|N^V?#t1xrnuN18B#3`?Yb|`OhRqtrHMFUWsl3>x8%-L)BRCPc_Z=4QY5dWhHojCd z#;>#SH5y-cy^Sx@_{u$6zRUmiX#Bmm+xSL}H{H?lH+;m#$2HztAB~UyiH+Z`@uLOt z=6V~yL*pyo5iNf#W8()je(yincvru%n{0eu`F!w!X#Ty|+W5ViKc0xjAKGE#54!kU zY)%byJ(fp%-X7eA?_zl-acfvP8mF; z{qCr-e02458IEZDq1U4IckyE`{MRTE6~3#zDDyG>JJxRr}6Ou{p;d4X#7FdkA?h+Yy6Itmi|Ki^g8^Xo4kHQ8o%MQ zlgIDZ_<_Zf<9BpU71pW#iof0FKdR%zULAj?$~P7Ko=a_e-ml>oH5}FOsD@)29@Fro zh7Rv_Dz^`v8`Y!o`BzywYOw2fJ8|7Tj?BQa2sG@`gUxv z{3~pKSD&duYqx`VwHdVz+_#1;Nuf`i;HV3?GSSpk;&6n$rKilNlpN4KR$QdB2U%z) z!`UgHJ>kX|du)c^SKt|J9tlmA@xIa(n55Y6n#r{z;1sZTpe&mZOi{wbw8zDLJR6FA zVn`u3nFx}gDElo7-l&P)MAg{;hf``eqUKW~q`P{^+Gu~7B^Vg{gB-erK#!*7^sG*8 zSs4y6y=ldDk{eVuS-{e=9voB3;CKbrYf%w7k($M-S#FX7xOj*Ol3xYKOJTJ)p(so{ zDUxN%wF#{`u>{-*jg`ZISW;w<$fFJU!f1QaHH=y~UA<-7=8aA5SirYQ^=LgB+|FX< zzGN$~zPw?Bg6_1@BSH3jG&ku9yM2!Euxo7@z6+YdwGq4RK`>6e3-be}$G=wi$G?`B z;l5PxKn^_BWbpY7*+-=pJul^+Bdl|x-`V*rxYB`|X5?f$ukPT2e6`0eE;C10= zQrLPjdb#bh`AivlKR;6^%qlpDW~ZWAFcHV!vVD6Xe_OGpja2|S8O2^-hS_R-Pn=QE z3HT6RpY#sza&&i|949~g&Ybf=GVSS*l414)@_G0F#H2YtQvJ-h!#-3eQwPEhR z$m)$l8jfn{^hEJ5?YQOM$7=2SShWr7G}QJab=X}$m_=!@osmd)yQzTMk^!P!LqBNeV1=T z(X~|G1i&gg*at+TO@eSe69VL?>)XgKHUYiqBgsi_H$b^jA-knrR5pU-OfkHJ9*B=c zbxZ+C{ZI9Z;nJ4I+t@zieSc-(W;r0Nl>?cGGET=s{_7;`uNY~HrYh4IlZObrv{@M<m9e#Pptarq(reNg*% z#rT(PMubNWs-c>YDHVby-l;hcRY*Cv3>`t4&B9oP?;>nnF_BbM(h7PuwOyHB)z-es zD$dqiv7*?dG-$PABb`d2!RNI~_Cs884@=EyA10M9KK^&Ez*eg$mdbamp==bL=RRcP zP<5545E_Ugu>-|xT~lI>n5jJzaqD^t?&E5g)H;+p*D9wTXllK~N667Hvk||K`o^_< z)L%Sd8&La*v=DE3o}V?f@%1vvwaXUts`y4+?DBb;QhZ&e$K+~?#QRF?0WTdxdcAO` zyB}4|$B*ycdrm%GY*uQlc9}c+;6lv?&Zdy3recci1@R`uibxcY*JuZfc9@NHR)D|H3M3sR4i+nE0UOFYU($aG)Xdk!v?^#eovei-Tk-p-LEEtc1K3h%&n~x${iH2t zN!s#crwC;Z&KZT4Zfn@utdCTH97QwKufo-sG2oDT=NvxT@WQj=GC`O zTkI97U8!HS{1&zyzhA#p$DIeu>fQ4B125fcwVtlm3!b~go)^w9-t(d66LaUe_i)kc zo&UYxMGTkrlmqII?C#RRYG9nqk4g|IHu-pG~+ zrtsThEmSG<@{j8wxPCsaBy-9m)HQP8pO(2|jp4nOEH1fLAEw!&<0*wu4%lgJh+Xb$ zu=cif^g!D}-*jh_*kPeRef;-wJ}M@4e7+idVJ%BYiIzifoEAKLpo+Du>mhJU$1iS< zxj4MC-Mfb2IQT8KMLgw^b$){z#b^>#7ZxR;PqOWUOw+v6bw zTlU!?I-^OPY~0+oi+wG2@?I7UiWaLx-L5nQPG66@&L{8E;g9P($OYF7tXj3oDtEHp z!*HmTog9*)EGg-WeX>IV)sj-v57K@gENid5dOo$^<^M>B!?#mAmDJhub~1U&laf-B z&t$=g?yb{R4lZLy&@wtQL{MpCUqd^!nwxgG0NSQVLPpzHx{+67-ByIIC&J5$84zwa zEfeD;iELkyhO@)R7=gZ%9C>4n{orBoowv`zYQsttNq(ZQ*48M-w9(haSDqWPqnK5kR-93sRjj(wJr_`{RjgNxDRwHR6f=rh#hhYZv7l(e z?)}w@LB+6QL@}xuQ%oo(6;q0nic^ZyiZhC{idF0NyNV&juwq0psu)x3R7@#m6tjvs z#k^uc(Ol)e=T{6U1{G@+>lEu1V~U-MU5aVNNyRC}X~h{uvq8hD7*Y%?MiirpamA!! zS~07bQ=CzpRjk^m-%$)I)+*L1Mipa{RSh zOe;<*PAN_+&M2CzHN6xAinWRn#b(8XVp1`!m{rUv<`riZtKROu6Hu&Gj3`DG}oZ^h4sZ;+e1{6bzVa2FoT(MIztvIQeQ=CyW*JwH@h7{`*qlyW|F2za3oZ^gP z)jQn#f{JyDQN@^ILNTeBQk+zrQuO+5<^7s^pZkuQ1t{K5T~XSfD&8m~(YKzMyRyd? z{#n+)3#mU+>wdfMHZ}dz9Am+R3&GM!VU?NIz|Ep38P_TRP}^ zGXLJ>Ouk6}-CNp_(AzV{nNqPU8FoTO;zbu6d_n2E*@-nVyv*z$^Y#S6O{>tG)RPNa z?{IsmJ>ycYr_MR$&aSXb6Ieqt0k)LW1KuyA9RiC*rGO1MpSM=CUFY1{-*m%uUybcv zueSfwDP*VbZF^&KE+S?JrT1)1rLGS>eS+iP-~#0_e}d&Pe3>hcq0g4)_u6glcj!WQ zKXqnlxy>$fzcc5QUMB=EoWn!TeL!7>PA`2v@=&QiUif7vez)pnt{*#f-r;2Rf?u(` z-hB99UHIOh_p29hm(=&^Z4+3)U8c<4vIX27*6*I8_m?l=PA~sPaP^N{I-tZ+*)X@O zBP^%(##qS~Q8cuini|WCt6BG8IMuGJa$YSnuO#hnW{)=Gtq$40zT3TUjW1|tj@e=? zlUi~Zv%rqF-D)Lm{uMjbT0D-|6m-2Izv}q&O9%CSXW6=h)~_60C+8r0o5LA~i|zJ? zxxt~W?MkK@WQ58?!4*CkG7~p0l49*`2bl8b)R(r~F#*mTthWK(&eQAObZ^ip6R)~I zT?V$QdpTzwL*@shn$|j7X5y`>Loa5<^bHlc?>cKp*tQAsp7w?omVj`rpF7U0=gcGO z_kE?`xr%DcRhl#|uJzFgg`(f3BI7iB3?s5mw4pfnYu5{y2z9&g`Lrxu*h!szq6jOO z=i;^KGnQ|52X@Lwz4(x24Sk6$UKHQLB$C~TEdiBAfGCuCS9E)^lJR`Y0d~efPJ zWm;*&HrQ577dKp>ogq!vlFu#DZzkfr#p*c|#onR_vBJ!YYwrSq4Q@G056&Y6<}!~n zvmmXioMtU1MD5(0m!W)|Qr!|`ZAvCnBx+f{3Gj#0t!uUmbANWa+fJZKJ;Gcdao0f2 zv&SxLxmkXBaq;1nUGd`Mwg*(c6kc@6XVzg}b9M28ebinG$jUipQEc}`sx=m#Y+bsZ z+^J>}D1Pgm=C+Guy+Lrw3X=GMPZRbLZLnp7y4-jH-Er-0*|mPDEm!+C zP>aniX?XGNR;GEG7!Eqnrqi!w9-$=N;H_1ARSx#O-I}EoH}Q;o#Z8`xkG=O(WA64H z$EF0h1C=YHR(V7mP-R)Q5tnBg z+Z#HXz2Sf<@8@W=Jr9!CmG7-+I?X%k+J*xAA;C z1;rzKbluG6G#6{7>$gCE6ByLEgCW$-`V7|aVPCmgRQh=fPk6@-@QtfPso|K5v6K|m9JZUD_QN* z7Rsv{CHf^?nq^AsElv_xjs70f17t(KEAduTd(fIGqxE^B$@TwFnyWG_o2%bnU2^9c z9WUjZO2?x|^}6SH@lkg_Tjp+wUiaJ`)8`Up?)=Y{zJIa03zWGFmbu%d?h1{i&xgz0 z)$8w6nY(D2y9f1skurDjGIvSucbU7icU=R#P4&7mJ4^kSEpwOC-;pwRg)(=>8|Rj} ztM;yY5q*MK><`P($~NAbuWgns_SINnwufwW$U$Ie{FFLgEn2Cf6ylELustAADf2o% zUcKrRXe2rINDmv=?n$dCD)g$EX(Pq?o#%suaCq z{L0F(Jt#nXD)iiBrl8nyvXzfc0NCcynI2^9MbE!URg&f1UdPj$Ez~+nmRGeO=mI5m z8!PA1KWo|V^ZI4-hN3+@=g?|YS}lZPe~V|O)w9teN{_B~vo-4pb+pbY_7bbiYf5sW z#)tKWJA_bs=#pvlba&~v$Wd_O$TdgB+Dwwywys|2y_9qANGDH~(e}eN91=z1fOBh5 zl4xjE%`y3;w7n8Z$5#NG_q^2@w=c1Jxh;(}zpc0Nyf&3>?aUa6*17Er*z*DG;Tm-O z=RSZxT;D*_-qy?u^%vthe;F=`J!1lEOY4!c+ppNqin8^c?By?yKYrWwgqJJ8NsZTq z(j!xF;Vsus@_+E-4sQhT;-CC|dSapUm^{smlLBRd$)9{;>5)A_cV(|Pix!+O z|LxKv^RW{f_m%tScm2C=MX5jQ%YHYP{f?LYF8A-2eRB4y3P(~?1!-&Nrm)0xt;`NFD`++7WX97rRd#x_WN>NMw-~v(L5j2(^EAG!mi(Mr*Zwxz zKBtl86tZRWjI^vWeb2uVO{+D&^4UiQl1=;e>~CJdl-$CbSm?Ib=#G*SZ)uQJ7mZGq zdzlT z+jh#Cw)7nB>VlL%XBk$GhzzW^hh*5*H|g=S5M;Mg&_kPBjFHI_u?I@J|> zprQ`)?fjNqVDwo#0&ZPRyKUh{>2(NIzodjbKcT-wH}qTA6CyRU!EqC%P9+$uUfT>kSohj{G$$`-S6L(K5gz<*AAEWCn9D0 zM1E5^y!)Z33xD5u@+Iny)+2$@XJpxuH0T zO$>{6<5gSUE~Xs!W4c0&BQS3vQ#&0@@VG;Ryp;>tZ0u=~RGGyk>61Lym7~ORhb1>( z#E<+XFYWojTS}jcUR?V7MR?&AaauUV)jwg?J1%V{jG5K@i8GwP%kNj|I4!5+obvnC z-Z)P0FH|2a6u6Mi+xQ!f|NVuY^R9c}^U%9KmtRVKJa_#xVvRi*JXeckQ3>)wjD zyFT}xlS|8b;cy%5%3d8Gdu`dgU9zR^@_sE58@~2_o;D0jtk&?-5+7T<|tT!W9SC zpGlm+H-dSj9xhn<-<%u43zdh!yObxuPa)#ZE^y;gWA5YGX7Cns<>0C=Du^WEf*(h^;DTpe zWXvdBFoYa}hryeWr{LH-Gs`X}kHJIWcaURn`jH0v%%*yv!s30Gab^`6fT%X4#5R8$TU0;POT&D;5qQs zSKv3e;BusLu)<;jUJV!gJQ9Kno^d7V2p7BsiNXcDkT^UAZV3}_@F@5I(gzoO4w-}t zE?!T*f(O8puOi;yjIYfHHyTrbC&4Miq$@1$;sh2yT<~K^5S{|RkA&fZJFg}l;erQ{ zR(JyZ%qHp`cn18z^^^-Za{%TI92)j8obkFzAdkYCLofy8Fx*6_2aqH1Jh<+iq$xZF zp7So;!9(D!$T4^V97d{!_!jt0#19vI$Bo7;g$sTN3Bi-#KO&j=2RH5@{^8h>HGhFD z9;vXHgD-&#p4vdT-~q4+se=oC2H6G|oIqmmEO^pR;u$Wu8o3WH_%0*`7d*3(`~$~6 ztGN?73>PdQ({RCOona?+k3o&evwo4f&!g8zuDgcrbj_fTKKvA=4* zjD+FX5;m31_#cj4SMzfu0yizxwMac&@FAobF1X@m!U7lEaSQ1JkAe5Lk}mKh`2D^3 zAI{j;97CRh3x@WQ=i!3w$Sj=kxA`Tqcnm+Z(cU3T;YskT$a1*guaFR2FdQSD;1Td( z2mXX-!R9;h8$1Rsc|UOr4}fbvKpKl1@Sl*waKW?hqCCO{*B~?SF!+9C7M=p%m!RGl z$3Nho+|7H1gEfClTL2G%S0f>~;C>_w7kmiW3>U1t2miqZ-;BiJA#euigbTj*Ug|oy z;CiGF9s{34CgJ9T#@vr&;VE$KN6F{#`~&2%PY};=Klm2pX?PfHM4o}iz&}Hd!c*WS zpCoO>4fyMaD6?>FWvND$6?hWQl|g0lu<)*-cU)=A8>NEprhYMbS_&--+apfV(7hLco$XdAICy)qS@Uuu1F8DAKgA1MT=3*?;s?0k zO-L(T@P4EdF8B?k4=(sqBnuZj^Krrs$Cj_T?l9>K$L_EBC9?D{NUta8gCWb|DX{8W zgh#G}?Z{eq0!-vcQ@Q>m`5L(vj{Riw6=XA9@KxU?{BXgwNDMA`))CSaE_e?z3dc6G znMIDk1($vYf5HV1AO*PK*6-q{hbt`J4_^*Xfvw*oPrwBW$Tqm(Dbsux?gx({3E|&o zyz>-!2_6OGKfn+01bFEWDMxT@MVrTvL+~8fI*pG4~6fDn9Gl*z6Ilw! z{PdQo8kU{Gv%~H?x#>mn@C^7fWCmUU`;YMrxeopqnU(9{u3r(ZN&3v-p?@dN;ey}& zHDQ4ZP9t^jJorsRK80hC-CSQmzJo`>(M60=;OHrsUmy>{(P=O@BYkkeS!5J0czz{r z;pjz}Byt2USo5k1^AucgBXSguZiTt^Wa_yu@ICMmWCm@gs;cosbObjD0@_P(3PkQ5yK0rPK2TCP`9mmwLs4nBuW!p#}fM@SaVyqEbj zG6ffW?U}fR3togg4QKAmd>T0lXaBzGI-76_2X8%xu>2M80n^AOaQ5<>N0t#5cozJZ zHxm}PS=I6 zpl=0v9xizC`NRcW@J3_`F8B=c6kPD+3n+hZ!E+Gv*A6$q{qQLGZKM{S2RE(6Z*akL zSK&9f;N?gwTyO_+5FP`cTumIpu?uF-y%4{_vB6;e8R>(YP=)z5l7S0WUPQTv3;rCL zh6`3-jDO*R5#$)0IbL(dTPTlTsxZv|njM!Aw{XGFAWPwbBS;7?_`i^iaORoKb#Em< zz_F=gzH=#Q1<%zIUzd?L;MkHdUtdGskn7;+<>YfXI@IR0wfG;7Ubndmd04K4$#wW2 zj{O{S-W5Ct4}pJ%OvADBW4?vt;es_+QcmH5TajaMY|og-k;Pxe9e8G#aKQuM-yuuo zI@rE}JP$`_$ei*v!UY$6@@m2b7yQ3_b}Nf|c(gpTh+&LOS7s??xVkN5PFZ;%9gS{N85#49|nNZNbm*1o*#^JiGv& zaT9q7j?R_20-1#i?m^6B4nG860vGIm59Jh|0ndIfWdR-n--lcaPlEofghe=5xeb4b z8}Lq~8J+`wh{WIp@bc~CD|iHa2uZ**;NSldVH7vu*LG0H!E@loDDffg!8?#qcmk|! zAn(DMw>MWIS-9ZS$YHqPEHVQ(JDJl#D!;;ez|SI!;p}lTN0B9P(^z5Njx2?)J^>cm%uyc@&-iA4d+s^WZx=NH1{%-izenf|JNIaKRrU=8(fr?kBzA*r7Dv zL6*Y>D{muQaKS%B!f?Uu$Y!`;-~j%IhrsFE$%k;(!_DG2eulF~ZoY+P*&L1!u{Y4$VPY++>cxf7aT=4 z!v+5mX@=*(3-2Z#;1RG7Nx(DUseep)ga^P)$OCY}k0KAk1&5G~xCf6RS-Afm>Re9q0Nfm5f!m7cDF@ z_m@6of33YTzPHsoC2w8LMXN(KEWfi80)41;HCr}cy{fiG7UHp^kI{stbv1W1b<|vW z#i_ovSZ_gf40UE+u&-lX4d;Wb=|FjEZ$rl_?DMy`b+ql?k1^Z5YZ^NCu0C)Pn>(>M zvKs@%?{;VAxv$BqF7)2TkK_39zw{+PV^AWXImLfT>L*}wFgxf^SEuXJ_33E3IUP&K z(}{FvI+^ZDr_$+kCOw(Xrl-=m^mIC(o=F$dvuQI_HRK}N0X!J(d_8-XkoN!EHG9( z78z?EON@1mWyYq)@?*1O{_)^=c)Wf*Hr_d&8qbYSkLSl{#wRCo6VnqWyhxUkm@`g} zca5jVGvkxvS?gwIyf8jHUNzyLsGbN;geGby>Lwx+^%Kn#v5ELZ=R|U%Ya%_7nV6iI zvTvH1C``;wn8+e?2}QpuP#h5U8!^`lbTFTrE;n1 z)J&?7noU)8`@5^VgWaL-+U~mUNOygAb9bye-rd=q?C$DLcW1gMyQjKy-P7GO-Tt2H zo={J1Po$^5C)N}1N%nO0WO^ohay`>Mg`U|Se{XefsJFH^(p%pf>y7s&d%Jowy_3DU z-s#>#?`*HXuevYPSKAlqtM7~T#ru+dU45Cp$-Z3QbYG!ww$I;R-5=_&?T_@=_s9C< z{mK5W{!IU5f3APJztBJ1?;ofh2o2N@Lse$xBeqd&xFfcn{2CD}BgVlq< z!O&oCaC)$6)K5wUM{7sJq}J4Ej&zzKrRv5bq)0PqLgYsmNtQDqjj3oVNcidqpM-6a zFje;kdg};H6<-bv1P6kHwS(coy1~d`{a|#kc`!B@A508(4kib?22+FS!OWoK-6`vX z{NT)BVQ_ZPq^r`Bn*-@!I+U(WhsoEG-&xL{9WujJ!~WrFa(Hk!L@o~x*OAlfhoj{7 z*l?U2-#MHl*QbWlmpq(U zWICl>k>9iAbeGSK=JML^Fz=3%$6XFjY5tz>mT#DzDss5wfw0Zv%{`LWrUwF~?9^a> zu%4Qvi&`T{{N#xnGa_X^Lphhyo1=V7$(3?Tc}y-cDg0qlRklP1v`mJJd9B%&%Y>H9 zl$K5L^GwR%M=5)CebK(ozHHxA-%MY1f111%Aos+n3ny*;S4$n&Nxhb#KFeusR&Q&s e@JNUnDUR>5W0K=z<8fQlh)>0r;`_. + +Contact +------- + +`Mailing list `_ + + diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/cffi-1.12.3.dist-info/RECORD b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/cffi-1.12.3.dist-info/RECORD new file mode 100644 index 00000000..cc4613f5 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/cffi-1.12.3.dist-info/RECORD @@ -0,0 +1,44 @@ +_cffi_backend.cp37-win_amd64.pyd,sha256=IuDm8qFV4_-imEEHEgrrmQyXHjtf4eRJZ0p0amwYibw,174592 +cffi-1.12.3.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4 +cffi-1.12.3.dist-info/LICENSE,sha256=BLgPWwd7vtaICM_rreteNSPyqMmpZJXFh72W3x6sKjM,1294 +cffi-1.12.3.dist-info/METADATA,sha256=OA_DlKzbYB72gWWz0R2ds_RJzTIzvFx5cnHf5NXTRuo,1140 +cffi-1.12.3.dist-info/RECORD,, +cffi-1.12.3.dist-info/WHEEL,sha256=QOmb-VuQJwuZ7Av_Q2839PCv6qsn6RGHIrt6Y0esFDg,106 +cffi-1.12.3.dist-info/entry_points.txt,sha256=Q9f5C9IpjYxo0d2PK9eUcnkgxHc9pHWwjEMaANPKNCI,76 +cffi-1.12.3.dist-info/top_level.txt,sha256=rE7WR3rZfNKxWI9-jn6hsHCAl7MDkB-FmuQbxWjFehQ,19 +cffi/__init__.py,sha256=XPx-ySmw7OmYmr-7iXd3YoXhXj1HQLHYviMKpmAuWLc,513 +cffi/__pycache__/__init__.cpython-37.pyc,, +cffi/__pycache__/api.cpython-37.pyc,, +cffi/__pycache__/backend_ctypes.cpython-37.pyc,, +cffi/__pycache__/cffi_opcode.cpython-37.pyc,, +cffi/__pycache__/commontypes.cpython-37.pyc,, +cffi/__pycache__/cparser.cpython-37.pyc,, +cffi/__pycache__/error.cpython-37.pyc,, +cffi/__pycache__/ffiplatform.cpython-37.pyc,, +cffi/__pycache__/lock.cpython-37.pyc,, +cffi/__pycache__/model.cpython-37.pyc,, +cffi/__pycache__/pkgconfig.cpython-37.pyc,, +cffi/__pycache__/recompiler.cpython-37.pyc,, +cffi/__pycache__/setuptools_ext.cpython-37.pyc,, +cffi/__pycache__/vengine_cpy.cpython-37.pyc,, +cffi/__pycache__/vengine_gen.cpython-37.pyc,, +cffi/__pycache__/verifier.cpython-37.pyc,, +cffi/_cffi_errors.h,sha256=6nFQ-4dRQI1bXRoSeqdvyKU33TmutQJB_2fAhWSzdl8,3856 +cffi/_cffi_include.h,sha256=JuFfmwpRE65vym3Nxr9vDMOIEuv21tXdarkL1l2WNms,12149 +cffi/_embedding.h,sha256=PuNkRzXjURiRh7tXzVdIn0RD9pTJx04ZokHbcEO_3OY,17226 +cffi/api.py,sha256=Q07iwDD0FRwWa2fx2ZzQft69iJs9aNR52fvrtUy3EY4,41800 +cffi/backend_ctypes.py,sha256=_WkpD1SJel5gJovV-0u8hw-XvD3Efapqm9pIAEHTHn4,42449 +cffi/cffi_opcode.py,sha256=v9RdD_ovA8rCtqsC95Ivki5V667rAOhGgs3fb2q9xpM,5724 +cffi/commontypes.py,sha256=QS4uxCDI7JhtTyjh1hlnCA-gynmaszWxJaRRLGkJa1A,2689 +cffi/cparser.py,sha256=dcVqrRob1zqrCO--RZ6e-TtobJ7VMDpCU85W6QJ-N-4,40874 +cffi/error.py,sha256=v6xTiS4U0kvDcy4h_BDRo5v39ZQuj-IMRYLv5ETddZs,877 +cffi/ffiplatform.py,sha256=HMXqR8ks2wtdsNxGaWpQ_PyqIvtiuos_vf1qKCy-cwg,4046 +cffi/lock.py,sha256=l9TTdwMIMpi6jDkJGnQgE9cvTIR7CAntIJr8EGHt3pY,747 +cffi/model.py,sha256=AYyjS26uiFKXtkm43qmStpy9zfGh5HVJF4UETYFBt6w,21682 +cffi/parse_c_type.h,sha256=OdwQfwM9ktq6vlCB43exFQmxDBtj2MBNdK8LYl15tjw,5976 +cffi/pkgconfig.py,sha256=LP1w7vmWvmKwyqLaU1Z243FOWGNQMrgMUZrvgFuOlco,4374 +cffi/recompiler.py,sha256=LGqj7GPuq4KIG4axrN5G0Oy6YGmrLbBA0bHE-jCl6Oo,62711 +cffi/setuptools_ext.py,sha256=qc6arfrSzm4RNT5oJz6d5td7KJ-pHfI7bqYD0X4Q-08,8848 +cffi/vengine_cpy.py,sha256=hdyjjZNijLrg_uGMnnFyC-7GG_LxWtwB8BlS2vvVDQ0,41470 +cffi/vengine_gen.py,sha256=Zkq0-EdeZwn6qUvf_CI8iUEs2UxVIvDmKCH1j0-y0GI,26676 +cffi/verifier.py,sha256=J9Enz2rbJb9CHPqWlWQ5uQESoyr0uc7MNWugchjXBv4,11207 diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/cffi-1.12.3.dist-info/WHEEL b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/cffi-1.12.3.dist-info/WHEEL new file mode 100644 index 00000000..2f3c8613 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/cffi-1.12.3.dist-info/WHEEL @@ -0,0 +1,5 @@ +Wheel-Version: 1.0 +Generator: bdist_wheel (0.33.1) +Root-Is-Purelib: false +Tag: cp37-cp37m-win_amd64 + diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/cffi-1.12.3.dist-info/entry_points.txt b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/cffi-1.12.3.dist-info/entry_points.txt new file mode 100644 index 00000000..eee7e0fb --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/cffi-1.12.3.dist-info/entry_points.txt @@ -0,0 +1,3 @@ +[distutils.setup_keywords] +cffi_modules = cffi.setuptools_ext:cffi_modules + diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/cffi-1.12.3.dist-info/top_level.txt b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/cffi-1.12.3.dist-info/top_level.txt new file mode 100644 index 00000000..f6457795 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/cffi-1.12.3.dist-info/top_level.txt @@ -0,0 +1,2 @@ +_cffi_backend +cffi diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/cffi/__init__.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/cffi/__init__.py new file mode 100644 index 00000000..0224a15a --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/cffi/__init__.py @@ -0,0 +1,14 @@ +__all__ = ['FFI', 'VerificationError', 'VerificationMissing', 'CDefError', + 'FFIError'] + +from .api import FFI +from .error import CDefError, FFIError, VerificationError, VerificationMissing +from .error import PkgConfigError + +__version__ = "1.12.3" +__version_info__ = (1, 12, 3) + +# The verifier module file names are based on the CRC32 of a string that +# contains the following version number. It may be older than __version__ +# if nothing is clearly incompatible. +__version_verifier_modules__ = "0.8.6" diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/cffi/_cffi_errors.h b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/cffi/_cffi_errors.h new file mode 100644 index 00000000..83cdad06 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/cffi/_cffi_errors.h @@ -0,0 +1,147 @@ +#ifndef CFFI_MESSAGEBOX +# ifdef _MSC_VER +# define CFFI_MESSAGEBOX 1 +# else +# define CFFI_MESSAGEBOX 0 +# endif +#endif + + +#if CFFI_MESSAGEBOX +/* Windows only: logic to take the Python-CFFI embedding logic + initialization errors and display them in a background thread + with MessageBox. The idea is that if the whole program closes + as a result of this problem, then likely it is already a console + program and you can read the stderr output in the console too. + If it is not a console program, then it will likely show its own + dialog to complain, or generally not abruptly close, and for this + case the background thread should stay alive. +*/ +static void *volatile _cffi_bootstrap_text; + +static PyObject *_cffi_start_error_capture(void) +{ + PyObject *result = NULL; + PyObject *x, *m, *bi; + + if (InterlockedCompareExchangePointer(&_cffi_bootstrap_text, + (void *)1, NULL) != NULL) + return (PyObject *)1; + + m = PyImport_AddModule("_cffi_error_capture"); + if (m == NULL) + goto error; + + result = PyModule_GetDict(m); + if (result == NULL) + goto error; + +#if PY_MAJOR_VERSION >= 3 + bi = PyImport_ImportModule("builtins"); +#else + bi = PyImport_ImportModule("__builtin__"); +#endif + if (bi == NULL) + goto error; + PyDict_SetItemString(result, "__builtins__", bi); + Py_DECREF(bi); + + x = PyRun_String( + "import sys\n" + "class FileLike:\n" + " def write(self, x):\n" + " try:\n" + " of.write(x)\n" + " except: pass\n" + " self.buf += x\n" + "fl = FileLike()\n" + "fl.buf = ''\n" + "of = sys.stderr\n" + "sys.stderr = fl\n" + "def done():\n" + " sys.stderr = of\n" + " return fl.buf\n", /* make sure the returned value stays alive */ + Py_file_input, + result, result); + Py_XDECREF(x); + + error: + if (PyErr_Occurred()) + { + PyErr_WriteUnraisable(Py_None); + PyErr_Clear(); + } + return result; +} + +#pragma comment(lib, "user32.lib") + +static DWORD WINAPI _cffi_bootstrap_dialog(LPVOID ignored) +{ + Sleep(666); /* may be interrupted if the whole process is closing */ +#if PY_MAJOR_VERSION >= 3 + MessageBoxW(NULL, (wchar_t *)_cffi_bootstrap_text, + L"Python-CFFI error", + MB_OK | MB_ICONERROR); +#else + MessageBoxA(NULL, (char *)_cffi_bootstrap_text, + "Python-CFFI error", + MB_OK | MB_ICONERROR); +#endif + _cffi_bootstrap_text = NULL; + return 0; +} + +static void _cffi_stop_error_capture(PyObject *ecap) +{ + PyObject *s; + void *text; + + if (ecap == (PyObject *)1) + return; + + if (ecap == NULL) + goto error; + + s = PyRun_String("done()", Py_eval_input, ecap, ecap); + if (s == NULL) + goto error; + + /* Show a dialog box, but in a background thread, and + never show multiple dialog boxes at once. */ +#if PY_MAJOR_VERSION >= 3 + text = PyUnicode_AsWideCharString(s, NULL); +#else + text = PyString_AsString(s); +#endif + + _cffi_bootstrap_text = text; + + if (text != NULL) + { + HANDLE h; + h = CreateThread(NULL, 0, _cffi_bootstrap_dialog, + NULL, 0, NULL); + if (h != NULL) + CloseHandle(h); + } + /* decref the string, but it should stay alive as 'fl.buf' + in the small module above. It will really be freed only if + we later get another similar error. So it's a leak of at + most one copy of the small module. That's fine for this + situation which is usually a "fatal error" anyway. */ + Py_DECREF(s); + PyErr_Clear(); + return; + + error: + _cffi_bootstrap_text = NULL; + PyErr_Clear(); +} + +#else + +static PyObject *_cffi_start_error_capture(void) { return NULL; } +static void _cffi_stop_error_capture(PyObject *ecap) { } + +#endif diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/cffi/_cffi_include.h b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/cffi/_cffi_include.h new file mode 100644 index 00000000..37ea74fe --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/cffi/_cffi_include.h @@ -0,0 +1,308 @@ +#define _CFFI_ + +/* We try to define Py_LIMITED_API before including Python.h. + + Mess: we can only define it if Py_DEBUG, Py_TRACE_REFS and + Py_REF_DEBUG are not defined. This is a best-effort approximation: + we can learn about Py_DEBUG from pyconfig.h, but it is unclear if + the same works for the other two macros. Py_DEBUG implies them, + but not the other way around. + + Issue #350 is still open: on Windows, the code here causes it to link + with PYTHON36.DLL (for example) instead of PYTHON3.DLL. A fix was + attempted in 164e526a5515 and 14ce6985e1c3, but reverted: virtualenv + does not make PYTHON3.DLL available, and so the "correctly" compiled + version would not run inside a virtualenv. We will re-apply the fix + after virtualenv has been fixed for some time. For explanation, see + issue #355. For a workaround if you want PYTHON3.DLL and don't worry + about virtualenv, see issue #350. See also 'py_limited_api' in + setuptools_ext.py. +*/ +#if !defined(_CFFI_USE_EMBEDDING) && !defined(Py_LIMITED_API) +# include +# if !defined(Py_DEBUG) && !defined(Py_TRACE_REFS) && !defined(Py_REF_DEBUG) +# define Py_LIMITED_API +# endif +#endif + +#include +#ifdef __cplusplus +extern "C" { +#endif +#include +#include "parse_c_type.h" + +/* this block of #ifs should be kept exactly identical between + c/_cffi_backend.c, cffi/vengine_cpy.py, cffi/vengine_gen.py + and cffi/_cffi_include.h */ +#if defined(_MSC_VER) +# include /* for alloca() */ +# if _MSC_VER < 1600 /* MSVC < 2010 */ + typedef __int8 int8_t; + typedef __int16 int16_t; + typedef __int32 int32_t; + typedef __int64 int64_t; + typedef unsigned __int8 uint8_t; + typedef unsigned __int16 uint16_t; + typedef unsigned __int32 uint32_t; + typedef unsigned __int64 uint64_t; + typedef __int8 int_least8_t; + typedef __int16 int_least16_t; + typedef __int32 int_least32_t; + typedef __int64 int_least64_t; + typedef unsigned __int8 uint_least8_t; + typedef unsigned __int16 uint_least16_t; + typedef unsigned __int32 uint_least32_t; + typedef unsigned __int64 uint_least64_t; + typedef __int8 int_fast8_t; + typedef __int16 int_fast16_t; + typedef __int32 int_fast32_t; + typedef __int64 int_fast64_t; + typedef unsigned __int8 uint_fast8_t; + typedef unsigned __int16 uint_fast16_t; + typedef unsigned __int32 uint_fast32_t; + typedef unsigned __int64 uint_fast64_t; + typedef __int64 intmax_t; + typedef unsigned __int64 uintmax_t; +# else +# include +# endif +# if _MSC_VER < 1800 /* MSVC < 2013 */ +# ifndef __cplusplus + typedef unsigned char _Bool; +# endif +# endif +#else +# include +# if (defined (__SVR4) && defined (__sun)) || defined(_AIX) || defined(__hpux) +# include +# endif +#endif + +#ifdef __GNUC__ +# define _CFFI_UNUSED_FN __attribute__((unused)) +#else +# define _CFFI_UNUSED_FN /* nothing */ +#endif + +#ifdef __cplusplus +# ifndef _Bool + typedef bool _Bool; /* semi-hackish: C++ has no _Bool; bool is builtin */ +# endif +#endif + +/********** CPython-specific section **********/ +#ifndef PYPY_VERSION + + +#if PY_MAJOR_VERSION >= 3 +# define PyInt_FromLong PyLong_FromLong +#endif + +#define _cffi_from_c_double PyFloat_FromDouble +#define _cffi_from_c_float PyFloat_FromDouble +#define _cffi_from_c_long PyInt_FromLong +#define _cffi_from_c_ulong PyLong_FromUnsignedLong +#define _cffi_from_c_longlong PyLong_FromLongLong +#define _cffi_from_c_ulonglong PyLong_FromUnsignedLongLong +#define _cffi_from_c__Bool PyBool_FromLong + +#define _cffi_to_c_double PyFloat_AsDouble +#define _cffi_to_c_float PyFloat_AsDouble + +#define _cffi_from_c_int(x, type) \ + (((type)-1) > 0 ? /* unsigned */ \ + (sizeof(type) < sizeof(long) ? \ + PyInt_FromLong((long)x) : \ + sizeof(type) == sizeof(long) ? \ + PyLong_FromUnsignedLong((unsigned long)x) : \ + PyLong_FromUnsignedLongLong((unsigned long long)x)) : \ + (sizeof(type) <= sizeof(long) ? \ + PyInt_FromLong((long)x) : \ + PyLong_FromLongLong((long long)x))) + +#define _cffi_to_c_int(o, type) \ + ((type)( \ + sizeof(type) == 1 ? (((type)-1) > 0 ? (type)_cffi_to_c_u8(o) \ + : (type)_cffi_to_c_i8(o)) : \ + sizeof(type) == 2 ? (((type)-1) > 0 ? (type)_cffi_to_c_u16(o) \ + : (type)_cffi_to_c_i16(o)) : \ + sizeof(type) == 4 ? (((type)-1) > 0 ? (type)_cffi_to_c_u32(o) \ + : (type)_cffi_to_c_i32(o)) : \ + sizeof(type) == 8 ? (((type)-1) > 0 ? (type)_cffi_to_c_u64(o) \ + : (type)_cffi_to_c_i64(o)) : \ + (Py_FatalError("unsupported size for type " #type), (type)0))) + +#define _cffi_to_c_i8 \ + ((int(*)(PyObject *))_cffi_exports[1]) +#define _cffi_to_c_u8 \ + ((int(*)(PyObject *))_cffi_exports[2]) +#define _cffi_to_c_i16 \ + ((int(*)(PyObject *))_cffi_exports[3]) +#define _cffi_to_c_u16 \ + ((int(*)(PyObject *))_cffi_exports[4]) +#define _cffi_to_c_i32 \ + ((int(*)(PyObject *))_cffi_exports[5]) +#define _cffi_to_c_u32 \ + ((unsigned int(*)(PyObject *))_cffi_exports[6]) +#define _cffi_to_c_i64 \ + ((long long(*)(PyObject *))_cffi_exports[7]) +#define _cffi_to_c_u64 \ + ((unsigned long long(*)(PyObject *))_cffi_exports[8]) +#define _cffi_to_c_char \ + ((int(*)(PyObject *))_cffi_exports[9]) +#define _cffi_from_c_pointer \ + ((PyObject *(*)(char *, struct _cffi_ctypedescr *))_cffi_exports[10]) +#define _cffi_to_c_pointer \ + ((char *(*)(PyObject *, struct _cffi_ctypedescr *))_cffi_exports[11]) +#define _cffi_get_struct_layout \ + not used any more +#define _cffi_restore_errno \ + ((void(*)(void))_cffi_exports[13]) +#define _cffi_save_errno \ + ((void(*)(void))_cffi_exports[14]) +#define _cffi_from_c_char \ + ((PyObject *(*)(char))_cffi_exports[15]) +#define _cffi_from_c_deref \ + ((PyObject *(*)(char *, struct _cffi_ctypedescr *))_cffi_exports[16]) +#define _cffi_to_c \ + ((int(*)(char *, struct _cffi_ctypedescr *, PyObject *))_cffi_exports[17]) +#define _cffi_from_c_struct \ + ((PyObject *(*)(char *, struct _cffi_ctypedescr *))_cffi_exports[18]) +#define _cffi_to_c_wchar_t \ + ((_cffi_wchar_t(*)(PyObject *))_cffi_exports[19]) +#define _cffi_from_c_wchar_t \ + ((PyObject *(*)(_cffi_wchar_t))_cffi_exports[20]) +#define _cffi_to_c_long_double \ + ((long double(*)(PyObject *))_cffi_exports[21]) +#define _cffi_to_c__Bool \ + ((_Bool(*)(PyObject *))_cffi_exports[22]) +#define _cffi_prepare_pointer_call_argument \ + ((Py_ssize_t(*)(struct _cffi_ctypedescr *, \ + PyObject *, char **))_cffi_exports[23]) +#define _cffi_convert_array_from_object \ + ((int(*)(char *, struct _cffi_ctypedescr *, PyObject *))_cffi_exports[24]) +#define _CFFI_CPIDX 25 +#define _cffi_call_python \ + ((void(*)(struct _cffi_externpy_s *, char *))_cffi_exports[_CFFI_CPIDX]) +#define _cffi_to_c_wchar3216_t \ + ((int(*)(PyObject *))_cffi_exports[26]) +#define _cffi_from_c_wchar3216_t \ + ((PyObject *(*)(int))_cffi_exports[27]) +#define _CFFI_NUM_EXPORTS 28 + +struct _cffi_ctypedescr; + +static void *_cffi_exports[_CFFI_NUM_EXPORTS]; + +#define _cffi_type(index) ( \ + assert((((uintptr_t)_cffi_types[index]) & 1) == 0), \ + (struct _cffi_ctypedescr *)_cffi_types[index]) + +static PyObject *_cffi_init(const char *module_name, Py_ssize_t version, + const struct _cffi_type_context_s *ctx) +{ + PyObject *module, *o_arg, *new_module; + void *raw[] = { + (void *)module_name, + (void *)version, + (void *)_cffi_exports, + (void *)ctx, + }; + + module = PyImport_ImportModule("_cffi_backend"); + if (module == NULL) + goto failure; + + o_arg = PyLong_FromVoidPtr((void *)raw); + if (o_arg == NULL) + goto failure; + + new_module = PyObject_CallMethod( + module, (char *)"_init_cffi_1_0_external_module", (char *)"O", o_arg); + + Py_DECREF(o_arg); + Py_DECREF(module); + return new_module; + + failure: + Py_XDECREF(module); + return NULL; +} + + +#ifdef HAVE_WCHAR_H +typedef wchar_t _cffi_wchar_t; +#else +typedef uint16_t _cffi_wchar_t; /* same random pick as _cffi_backend.c */ +#endif + +_CFFI_UNUSED_FN static uint16_t _cffi_to_c_char16_t(PyObject *o) +{ + if (sizeof(_cffi_wchar_t) == 2) + return (uint16_t)_cffi_to_c_wchar_t(o); + else + return (uint16_t)_cffi_to_c_wchar3216_t(o); +} + +_CFFI_UNUSED_FN static PyObject *_cffi_from_c_char16_t(uint16_t x) +{ + if (sizeof(_cffi_wchar_t) == 2) + return _cffi_from_c_wchar_t((_cffi_wchar_t)x); + else + return _cffi_from_c_wchar3216_t((int)x); +} + +_CFFI_UNUSED_FN static int _cffi_to_c_char32_t(PyObject *o) +{ + if (sizeof(_cffi_wchar_t) == 4) + return (int)_cffi_to_c_wchar_t(o); + else + return (int)_cffi_to_c_wchar3216_t(o); +} + +_CFFI_UNUSED_FN static PyObject *_cffi_from_c_char32_t(int x) +{ + if (sizeof(_cffi_wchar_t) == 4) + return _cffi_from_c_wchar_t((_cffi_wchar_t)x); + else + return _cffi_from_c_wchar3216_t(x); +} + + +/********** end CPython-specific section **********/ +#else +_CFFI_UNUSED_FN +static void (*_cffi_call_python_org)(struct _cffi_externpy_s *, char *); +# define _cffi_call_python _cffi_call_python_org +#endif + + +#define _cffi_array_len(array) (sizeof(array) / sizeof((array)[0])) + +#define _cffi_prim_int(size, sign) \ + ((size) == 1 ? ((sign) ? _CFFI_PRIM_INT8 : _CFFI_PRIM_UINT8) : \ + (size) == 2 ? ((sign) ? _CFFI_PRIM_INT16 : _CFFI_PRIM_UINT16) : \ + (size) == 4 ? ((sign) ? _CFFI_PRIM_INT32 : _CFFI_PRIM_UINT32) : \ + (size) == 8 ? ((sign) ? _CFFI_PRIM_INT64 : _CFFI_PRIM_UINT64) : \ + _CFFI__UNKNOWN_PRIM) + +#define _cffi_prim_float(size) \ + ((size) == sizeof(float) ? _CFFI_PRIM_FLOAT : \ + (size) == sizeof(double) ? _CFFI_PRIM_DOUBLE : \ + (size) == sizeof(long double) ? _CFFI__UNKNOWN_LONG_DOUBLE : \ + _CFFI__UNKNOWN_FLOAT_PRIM) + +#define _cffi_check_int(got, got_nonpos, expected) \ + ((got_nonpos) == (expected <= 0) && \ + (got) == (unsigned long long)expected) + +#ifdef MS_WIN32 +# define _cffi_stdcall __stdcall +#else +# define _cffi_stdcall /* nothing */ +#endif + +#ifdef __cplusplus +} +#endif diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/cffi/_embedding.h b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/cffi/_embedding.h new file mode 100644 index 00000000..30842c17 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/cffi/_embedding.h @@ -0,0 +1,518 @@ + +/***** Support code for embedding *****/ + +#ifdef __cplusplus +extern "C" { +#endif + + +#if defined(_WIN32) +# define CFFI_DLLEXPORT __declspec(dllexport) +#elif defined(__GNUC__) +# define CFFI_DLLEXPORT __attribute__((visibility("default"))) +#else +# define CFFI_DLLEXPORT /* nothing */ +#endif + + +/* There are two global variables of type _cffi_call_python_fnptr: + + * _cffi_call_python, which we declare just below, is the one called + by ``extern "Python"`` implementations. + + * _cffi_call_python_org, which on CPython is actually part of the + _cffi_exports[] array, is the function pointer copied from + _cffi_backend. + + After initialization is complete, both are equal. However, the + first one remains equal to &_cffi_start_and_call_python until the + very end of initialization, when we are (or should be) sure that + concurrent threads also see a completely initialized world, and + only then is it changed. +*/ +#undef _cffi_call_python +typedef void (*_cffi_call_python_fnptr)(struct _cffi_externpy_s *, char *); +static void _cffi_start_and_call_python(struct _cffi_externpy_s *, char *); +static _cffi_call_python_fnptr _cffi_call_python = &_cffi_start_and_call_python; + + +#ifndef _MSC_VER + /* --- Assuming a GCC not infinitely old --- */ +# define cffi_compare_and_swap(l,o,n) __sync_bool_compare_and_swap(l,o,n) +# define cffi_write_barrier() __sync_synchronize() +# if !defined(__amd64__) && !defined(__x86_64__) && \ + !defined(__i386__) && !defined(__i386) +# define cffi_read_barrier() __sync_synchronize() +# else +# define cffi_read_barrier() (void)0 +# endif +#else + /* --- Windows threads version --- */ +# include +# define cffi_compare_and_swap(l,o,n) \ + (InterlockedCompareExchangePointer(l,n,o) == (o)) +# define cffi_write_barrier() InterlockedCompareExchange(&_cffi_dummy,0,0) +# define cffi_read_barrier() (void)0 +static volatile LONG _cffi_dummy; +#endif + +#ifdef WITH_THREAD +# ifndef _MSC_VER +# include + static pthread_mutex_t _cffi_embed_startup_lock; +# else + static CRITICAL_SECTION _cffi_embed_startup_lock; +# endif + static char _cffi_embed_startup_lock_ready = 0; +#endif + +static void _cffi_acquire_reentrant_mutex(void) +{ + static void *volatile lock = NULL; + + while (!cffi_compare_and_swap(&lock, NULL, (void *)1)) { + /* should ideally do a spin loop instruction here, but + hard to do it portably and doesn't really matter I + think: pthread_mutex_init() should be very fast, and + this is only run at start-up anyway. */ + } + +#ifdef WITH_THREAD + if (!_cffi_embed_startup_lock_ready) { +# ifndef _MSC_VER + pthread_mutexattr_t attr; + pthread_mutexattr_init(&attr); + pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE); + pthread_mutex_init(&_cffi_embed_startup_lock, &attr); +# else + InitializeCriticalSection(&_cffi_embed_startup_lock); +# endif + _cffi_embed_startup_lock_ready = 1; + } +#endif + + while (!cffi_compare_and_swap(&lock, (void *)1, NULL)) + ; + +#ifndef _MSC_VER + pthread_mutex_lock(&_cffi_embed_startup_lock); +#else + EnterCriticalSection(&_cffi_embed_startup_lock); +#endif +} + +static void _cffi_release_reentrant_mutex(void) +{ +#ifndef _MSC_VER + pthread_mutex_unlock(&_cffi_embed_startup_lock); +#else + LeaveCriticalSection(&_cffi_embed_startup_lock); +#endif +} + + +/********** CPython-specific section **********/ +#ifndef PYPY_VERSION + +#include "_cffi_errors.h" + + +#define _cffi_call_python_org _cffi_exports[_CFFI_CPIDX] + +PyMODINIT_FUNC _CFFI_PYTHON_STARTUP_FUNC(void); /* forward */ + +static void _cffi_py_initialize(void) +{ + /* XXX use initsigs=0, which "skips initialization registration of + signal handlers, which might be useful when Python is + embedded" according to the Python docs. But review and think + if it should be a user-controllable setting. + + XXX we should also give a way to write errors to a buffer + instead of to stderr. + + XXX if importing 'site' fails, CPython (any version) calls + exit(). Should we try to work around this behavior here? + */ + Py_InitializeEx(0); +} + +static int _cffi_initialize_python(void) +{ + /* This initializes Python, imports _cffi_backend, and then the + present .dll/.so is set up as a CPython C extension module. + */ + int result; + PyGILState_STATE state; + PyObject *pycode=NULL, *global_dict=NULL, *x; + PyObject *builtins; + + state = PyGILState_Ensure(); + + /* Call the initxxx() function from the present module. It will + create and initialize us as a CPython extension module, instead + of letting the startup Python code do it---it might reimport + the same .dll/.so and get maybe confused on some platforms. + It might also have troubles locating the .dll/.so again for all + I know. + */ + (void)_CFFI_PYTHON_STARTUP_FUNC(); + if (PyErr_Occurred()) + goto error; + + /* Now run the Python code provided to ffi.embedding_init_code(). + */ + pycode = Py_CompileString(_CFFI_PYTHON_STARTUP_CODE, + "", + Py_file_input); + if (pycode == NULL) + goto error; + global_dict = PyDict_New(); + if (global_dict == NULL) + goto error; + builtins = PyEval_GetBuiltins(); + if (builtins == NULL) + goto error; + if (PyDict_SetItemString(global_dict, "__builtins__", builtins) < 0) + goto error; + x = PyEval_EvalCode( +#if PY_MAJOR_VERSION < 3 + (PyCodeObject *) +#endif + pycode, global_dict, global_dict); + if (x == NULL) + goto error; + Py_DECREF(x); + + /* Done! Now if we've been called from + _cffi_start_and_call_python() in an ``extern "Python"``, we can + only hope that the Python code did correctly set up the + corresponding @ffi.def_extern() function. Otherwise, the + general logic of ``extern "Python"`` functions (inside the + _cffi_backend module) will find that the reference is still + missing and print an error. + */ + result = 0; + done: + Py_XDECREF(pycode); + Py_XDECREF(global_dict); + PyGILState_Release(state); + return result; + + error:; + { + /* Print as much information as potentially useful. + Debugging load-time failures with embedding is not fun + */ + PyObject *ecap; + PyObject *exception, *v, *tb, *f, *modules, *mod; + PyErr_Fetch(&exception, &v, &tb); + ecap = _cffi_start_error_capture(); + f = PySys_GetObject((char *)"stderr"); + if (f != NULL && f != Py_None) { + PyFile_WriteString( + "Failed to initialize the Python-CFFI embedding logic:\n\n", f); + } + + if (exception != NULL) { + PyErr_NormalizeException(&exception, &v, &tb); + PyErr_Display(exception, v, tb); + } + Py_XDECREF(exception); + Py_XDECREF(v); + Py_XDECREF(tb); + + if (f != NULL && f != Py_None) { + PyFile_WriteString("\nFrom: " _CFFI_MODULE_NAME + "\ncompiled with cffi version: 1.12.3" + "\n_cffi_backend module: ", f); + modules = PyImport_GetModuleDict(); + mod = PyDict_GetItemString(modules, "_cffi_backend"); + if (mod == NULL) { + PyFile_WriteString("not loaded", f); + } + else { + v = PyObject_GetAttrString(mod, "__file__"); + PyFile_WriteObject(v, f, 0); + Py_XDECREF(v); + } + PyFile_WriteString("\nsys.path: ", f); + PyFile_WriteObject(PySys_GetObject((char *)"path"), f, 0); + PyFile_WriteString("\n\n", f); + } + _cffi_stop_error_capture(ecap); + } + result = -1; + goto done; +} + +PyAPI_DATA(char *) _PyParser_TokenNames[]; /* from CPython */ + +static int _cffi_carefully_make_gil(void) +{ + /* This does the basic initialization of Python. It can be called + completely concurrently from unrelated threads. It assumes + that we don't hold the GIL before (if it exists), and we don't + hold it afterwards. + + (What it really does used to be completely different in Python 2 + and Python 3, with the Python 2 solution avoiding the spin-lock + around the Py_InitializeEx() call. However, after recent changes + to CPython 2.7 (issue #358) it no longer works. So we use the + Python 3 solution everywhere.) + + This initializes Python by calling Py_InitializeEx(). + Important: this must not be called concurrently at all. + So we use a global variable as a simple spin lock. This global + variable must be from 'libpythonX.Y.so', not from this + cffi-based extension module, because it must be shared from + different cffi-based extension modules. + + In Python < 3.8, we choose + _PyParser_TokenNames[0] as a completely arbitrary pointer value + that is never written to. The default is to point to the + string "ENDMARKER". We change it temporarily to point to the + next character in that string. (Yes, I know it's REALLY + obscure.) + + In Python >= 3.8, this string array is no longer writable, so + instead we pick PyCapsuleType.tp_version_tag. We can't change + Python < 3.8 because someone might use a mixture of cffi + embedded modules, some of which were compiled before this file + changed. + */ + +#ifdef WITH_THREAD +# if PY_VERSION_HEX < 0x03080000 + char *volatile *lock = (char *volatile *)_PyParser_TokenNames; + char *old_value, *locked_value; + + while (1) { /* spin loop */ + old_value = *lock; + locked_value = old_value + 1; + if (old_value[0] == 'E') { + assert(old_value[1] == 'N'); + if (cffi_compare_and_swap(lock, old_value, locked_value)) + break; + } + else { + assert(old_value[0] == 'N'); + /* should ideally do a spin loop instruction here, but + hard to do it portably and doesn't really matter I + think: PyEval_InitThreads() should be very fast, and + this is only run at start-up anyway. */ + } + } +# else + int volatile *lock = (int volatile *)&PyCapsule_Type.tp_version_tag; + int old_value, locked_value; + assert(!(PyCapsule_Type.tp_flags & Py_TPFLAGS_HAVE_VERSION_TAG)); + + while (1) { /* spin loop */ + old_value = *lock; + locked_value = -42; + if (old_value == 0) { + if (cffi_compare_and_swap(lock, old_value, locked_value)) + break; + } + else { + assert(old_value == locked_value); + /* should ideally do a spin loop instruction here, but + hard to do it portably and doesn't really matter I + think: PyEval_InitThreads() should be very fast, and + this is only run at start-up anyway. */ + } + } +# endif +#endif + + /* call Py_InitializeEx() */ + { + PyGILState_STATE state = PyGILState_UNLOCKED; + if (!Py_IsInitialized()) + _cffi_py_initialize(); + else + state = PyGILState_Ensure(); + + PyEval_InitThreads(); + PyGILState_Release(state); + } + +#ifdef WITH_THREAD + /* release the lock */ + while (!cffi_compare_and_swap(lock, locked_value, old_value)) + ; +#endif + + return 0; +} + +/********** end CPython-specific section **********/ + + +#else + + +/********** PyPy-specific section **********/ + +PyMODINIT_FUNC _CFFI_PYTHON_STARTUP_FUNC(const void *[]); /* forward */ + +static struct _cffi_pypy_init_s { + const char *name; + void (*func)(const void *[]); + const char *code; +} _cffi_pypy_init = { + _CFFI_MODULE_NAME, + (void(*)(const void *[]))_CFFI_PYTHON_STARTUP_FUNC, + _CFFI_PYTHON_STARTUP_CODE, +}; + +extern int pypy_carefully_make_gil(const char *); +extern int pypy_init_embedded_cffi_module(int, struct _cffi_pypy_init_s *); + +static int _cffi_carefully_make_gil(void) +{ + return pypy_carefully_make_gil(_CFFI_MODULE_NAME); +} + +static int _cffi_initialize_python(void) +{ + return pypy_init_embedded_cffi_module(0xB011, &_cffi_pypy_init); +} + +/********** end PyPy-specific section **********/ + + +#endif + + +#ifdef __GNUC__ +__attribute__((noinline)) +#endif +static _cffi_call_python_fnptr _cffi_start_python(void) +{ + /* Delicate logic to initialize Python. This function can be + called multiple times concurrently, e.g. when the process calls + its first ``extern "Python"`` functions in multiple threads at + once. It can also be called recursively, in which case we must + ignore it. We also have to consider what occurs if several + different cffi-based extensions reach this code in parallel + threads---it is a different copy of the code, then, and we + can't have any shared global variable unless it comes from + 'libpythonX.Y.so'. + + Idea: + + * _cffi_carefully_make_gil(): "carefully" call + PyEval_InitThreads() (possibly with Py_InitializeEx() first). + + * then we use a (local) custom lock to make sure that a call to this + cffi-based extension will wait if another call to the *same* + extension is running the initialization in another thread. + It is reentrant, so that a recursive call will not block, but + only one from a different thread. + + * then we grab the GIL and (Python 2) we call Py_InitializeEx(). + At this point, concurrent calls to Py_InitializeEx() are not + possible: we have the GIL. + + * do the rest of the specific initialization, which may + temporarily release the GIL but not the custom lock. + Only release the custom lock when we are done. + */ + static char called = 0; + + if (_cffi_carefully_make_gil() != 0) + return NULL; + + _cffi_acquire_reentrant_mutex(); + + /* Here the GIL exists, but we don't have it. We're only protected + from concurrency by the reentrant mutex. */ + + /* This file only initializes the embedded module once, the first + time this is called, even if there are subinterpreters. */ + if (!called) { + called = 1; /* invoke _cffi_initialize_python() only once, + but don't set '_cffi_call_python' right now, + otherwise concurrent threads won't call + this function at all (we need them to wait) */ + if (_cffi_initialize_python() == 0) { + /* now initialization is finished. Switch to the fast-path. */ + + /* We would like nobody to see the new value of + '_cffi_call_python' without also seeing the rest of the + data initialized. However, this is not possible. But + the new value of '_cffi_call_python' is the function + 'cffi_call_python()' from _cffi_backend. So: */ + cffi_write_barrier(); + /* ^^^ we put a write barrier here, and a corresponding + read barrier at the start of cffi_call_python(). This + ensures that after that read barrier, we see everything + done here before the write barrier. + */ + + assert(_cffi_call_python_org != NULL); + _cffi_call_python = (_cffi_call_python_fnptr)_cffi_call_python_org; + } + else { + /* initialization failed. Reset this to NULL, even if it was + already set to some other value. Future calls to + _cffi_start_python() are still forced to occur, and will + always return NULL from now on. */ + _cffi_call_python_org = NULL; + } + } + + _cffi_release_reentrant_mutex(); + + return (_cffi_call_python_fnptr)_cffi_call_python_org; +} + +static +void _cffi_start_and_call_python(struct _cffi_externpy_s *externpy, char *args) +{ + _cffi_call_python_fnptr fnptr; + int current_err = errno; +#ifdef _MSC_VER + int current_lasterr = GetLastError(); +#endif + fnptr = _cffi_start_python(); + if (fnptr == NULL) { + fprintf(stderr, "function %s() called, but initialization code " + "failed. Returning 0.\n", externpy->name); + memset(args, 0, externpy->size_of_result); + } +#ifdef _MSC_VER + SetLastError(current_lasterr); +#endif + errno = current_err; + + if (fnptr != NULL) + fnptr(externpy, args); +} + + +/* The cffi_start_python() function makes sure Python is initialized + and our cffi module is set up. It can be called manually from the + user C code. The same effect is obtained automatically from any + dll-exported ``extern "Python"`` function. This function returns + -1 if initialization failed, 0 if all is OK. */ +_CFFI_UNUSED_FN +static int cffi_start_python(void) +{ + if (_cffi_call_python == &_cffi_start_and_call_python) { + if (_cffi_start_python() == NULL) + return -1; + } + cffi_read_barrier(); + return 0; +} + +#undef cffi_compare_and_swap +#undef cffi_write_barrier +#undef cffi_read_barrier + +#ifdef __cplusplus +} +#endif diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/cffi/api.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/cffi/api.py new file mode 100644 index 00000000..32fe6208 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/cffi/api.py @@ -0,0 +1,961 @@ +import sys, types +from .lock import allocate_lock +from .error import CDefError +from . import model + +try: + callable +except NameError: + # Python 3.1 + from collections import Callable + callable = lambda x: isinstance(x, Callable) + +try: + basestring +except NameError: + # Python 3.x + basestring = str + +_unspecified = object() + + + +class FFI(object): + r''' + The main top-level class that you instantiate once, or once per module. + + Example usage: + + ffi = FFI() + ffi.cdef(""" + int printf(const char *, ...); + """) + + C = ffi.dlopen(None) # standard library + -or- + C = ffi.verify() # use a C compiler: verify the decl above is right + + C.printf("hello, %s!\n", ffi.new("char[]", "world")) + ''' + + def __init__(self, backend=None): + """Create an FFI instance. The 'backend' argument is used to + select a non-default backend, mostly for tests. + """ + if backend is None: + # You need PyPy (>= 2.0 beta), or a CPython (>= 2.6) with + # _cffi_backend.so compiled. + import _cffi_backend as backend + from . import __version__ + if backend.__version__ != __version__: + # bad version! Try to be as explicit as possible. + if hasattr(backend, '__file__'): + # CPython + raise Exception("Version mismatch: this is the 'cffi' package version %s, located in %r. When we import the top-level '_cffi_backend' extension module, we get version %s, located in %r. The two versions should be equal; check your installation." % ( + __version__, __file__, + backend.__version__, backend.__file__)) + else: + # PyPy + raise Exception("Version mismatch: this is the 'cffi' package version %s, located in %r. This interpreter comes with a built-in '_cffi_backend' module, which is version %s. The two versions should be equal; check your installation." % ( + __version__, __file__, backend.__version__)) + # (If you insist you can also try to pass the option + # 'backend=backend_ctypes.CTypesBackend()', but don't + # rely on it! It's probably not going to work well.) + + from . import cparser + self._backend = backend + self._lock = allocate_lock() + self._parser = cparser.Parser() + self._cached_btypes = {} + self._parsed_types = types.ModuleType('parsed_types').__dict__ + self._new_types = types.ModuleType('new_types').__dict__ + self._function_caches = [] + self._libraries = [] + self._cdefsources = [] + self._included_ffis = [] + self._windows_unicode = None + self._init_once_cache = {} + self._cdef_version = None + self._embedding = None + self._typecache = model.get_typecache(backend) + if hasattr(backend, 'set_ffi'): + backend.set_ffi(self) + for name in list(backend.__dict__): + if name.startswith('RTLD_'): + setattr(self, name, getattr(backend, name)) + # + with self._lock: + self.BVoidP = self._get_cached_btype(model.voidp_type) + self.BCharA = self._get_cached_btype(model.char_array_type) + if isinstance(backend, types.ModuleType): + # _cffi_backend: attach these constants to the class + if not hasattr(FFI, 'NULL'): + FFI.NULL = self.cast(self.BVoidP, 0) + FFI.CData, FFI.CType = backend._get_types() + else: + # ctypes backend: attach these constants to the instance + self.NULL = self.cast(self.BVoidP, 0) + self.CData, self.CType = backend._get_types() + self.buffer = backend.buffer + + def cdef(self, csource, override=False, packed=False, pack=None): + """Parse the given C source. This registers all declared functions, + types, and global variables. The functions and global variables can + then be accessed via either 'ffi.dlopen()' or 'ffi.verify()'. + The types can be used in 'ffi.new()' and other functions. + If 'packed' is specified as True, all structs declared inside this + cdef are packed, i.e. laid out without any field alignment at all. + Alternatively, 'pack' can be a small integer, and requests for + alignment greater than that are ignored (pack=1 is equivalent to + packed=True). + """ + self._cdef(csource, override=override, packed=packed, pack=pack) + + def embedding_api(self, csource, packed=False, pack=None): + self._cdef(csource, packed=packed, pack=pack, dllexport=True) + if self._embedding is None: + self._embedding = '' + + def _cdef(self, csource, override=False, **options): + if not isinstance(csource, str): # unicode, on Python 2 + if not isinstance(csource, basestring): + raise TypeError("cdef() argument must be a string") + csource = csource.encode('ascii') + with self._lock: + self._cdef_version = object() + self._parser.parse(csource, override=override, **options) + self._cdefsources.append(csource) + if override: + for cache in self._function_caches: + cache.clear() + finishlist = self._parser._recomplete + if finishlist: + self._parser._recomplete = [] + for tp in finishlist: + tp.finish_backend_type(self, finishlist) + + def dlopen(self, name, flags=0): + """Load and return a dynamic library identified by 'name'. + The standard C library can be loaded by passing None. + Note that functions and types declared by 'ffi.cdef()' are not + linked to a particular library, just like C headers; in the + library we only look for the actual (untyped) symbols. + """ + assert isinstance(name, basestring) or name is None + with self._lock: + lib, function_cache = _make_ffi_library(self, name, flags) + self._function_caches.append(function_cache) + self._libraries.append(lib) + return lib + + def dlclose(self, lib): + """Close a library obtained with ffi.dlopen(). After this call, + access to functions or variables from the library will fail + (possibly with a segmentation fault). + """ + type(lib).__cffi_close__(lib) + + def _typeof_locked(self, cdecl): + # call me with the lock! + key = cdecl + if key in self._parsed_types: + return self._parsed_types[key] + # + if not isinstance(cdecl, str): # unicode, on Python 2 + cdecl = cdecl.encode('ascii') + # + type = self._parser.parse_type(cdecl) + really_a_function_type = type.is_raw_function + if really_a_function_type: + type = type.as_function_pointer() + btype = self._get_cached_btype(type) + result = btype, really_a_function_type + self._parsed_types[key] = result + return result + + def _typeof(self, cdecl, consider_function_as_funcptr=False): + # string -> ctype object + try: + result = self._parsed_types[cdecl] + except KeyError: + with self._lock: + result = self._typeof_locked(cdecl) + # + btype, really_a_function_type = result + if really_a_function_type and not consider_function_as_funcptr: + raise CDefError("the type %r is a function type, not a " + "pointer-to-function type" % (cdecl,)) + return btype + + def typeof(self, cdecl): + """Parse the C type given as a string and return the + corresponding object. + It can also be used on 'cdata' instance to get its C type. + """ + if isinstance(cdecl, basestring): + return self._typeof(cdecl) + if isinstance(cdecl, self.CData): + return self._backend.typeof(cdecl) + if isinstance(cdecl, types.BuiltinFunctionType): + res = _builtin_function_type(cdecl) + if res is not None: + return res + if (isinstance(cdecl, types.FunctionType) + and hasattr(cdecl, '_cffi_base_type')): + with self._lock: + return self._get_cached_btype(cdecl._cffi_base_type) + raise TypeError(type(cdecl)) + + def sizeof(self, cdecl): + """Return the size in bytes of the argument. It can be a + string naming a C type, or a 'cdata' instance. + """ + if isinstance(cdecl, basestring): + BType = self._typeof(cdecl) + return self._backend.sizeof(BType) + else: + return self._backend.sizeof(cdecl) + + def alignof(self, cdecl): + """Return the natural alignment size in bytes of the C type + given as a string. + """ + if isinstance(cdecl, basestring): + cdecl = self._typeof(cdecl) + return self._backend.alignof(cdecl) + + def offsetof(self, cdecl, *fields_or_indexes): + """Return the offset of the named field inside the given + structure or array, which must be given as a C type name. + You can give several field names in case of nested structures. + You can also give numeric values which correspond to array + items, in case of an array type. + """ + if isinstance(cdecl, basestring): + cdecl = self._typeof(cdecl) + return self._typeoffsetof(cdecl, *fields_or_indexes)[1] + + def new(self, cdecl, init=None): + """Allocate an instance according to the specified C type and + return a pointer to it. The specified C type must be either a + pointer or an array: ``new('X *')`` allocates an X and returns + a pointer to it, whereas ``new('X[n]')`` allocates an array of + n X'es and returns an array referencing it (which works + mostly like a pointer, like in C). You can also use + ``new('X[]', n)`` to allocate an array of a non-constant + length n. + + The memory is initialized following the rules of declaring a + global variable in C: by default it is zero-initialized, but + an explicit initializer can be given which can be used to + fill all or part of the memory. + + When the returned object goes out of scope, the memory + is freed. In other words the returned object has + ownership of the value of type 'cdecl' that it points to. This + means that the raw data can be used as long as this object is + kept alive, but must not be used for a longer time. Be careful + about that when copying the pointer to the memory somewhere + else, e.g. into another structure. + """ + if isinstance(cdecl, basestring): + cdecl = self._typeof(cdecl) + return self._backend.newp(cdecl, init) + + def new_allocator(self, alloc=None, free=None, + should_clear_after_alloc=True): + """Return a new allocator, i.e. a function that behaves like ffi.new() + but uses the provided low-level 'alloc' and 'free' functions. + + 'alloc' is called with the size as argument. If it returns NULL, a + MemoryError is raised. 'free' is called with the result of 'alloc' + as argument. Both can be either Python function or directly C + functions. If 'free' is None, then no free function is called. + If both 'alloc' and 'free' are None, the default is used. + + If 'should_clear_after_alloc' is set to False, then the memory + returned by 'alloc' is assumed to be already cleared (or you are + fine with garbage); otherwise CFFI will clear it. + """ + compiled_ffi = self._backend.FFI() + allocator = compiled_ffi.new_allocator(alloc, free, + should_clear_after_alloc) + def allocate(cdecl, init=None): + if isinstance(cdecl, basestring): + cdecl = self._typeof(cdecl) + return allocator(cdecl, init) + return allocate + + def cast(self, cdecl, source): + """Similar to a C cast: returns an instance of the named C + type initialized with the given 'source'. The source is + casted between integers or pointers of any type. + """ + if isinstance(cdecl, basestring): + cdecl = self._typeof(cdecl) + return self._backend.cast(cdecl, source) + + def string(self, cdata, maxlen=-1): + """Return a Python string (or unicode string) from the 'cdata'. + If 'cdata' is a pointer or array of characters or bytes, returns + the null-terminated string. The returned string extends until + the first null character, or at most 'maxlen' characters. If + 'cdata' is an array then 'maxlen' defaults to its length. + + If 'cdata' is a pointer or array of wchar_t, returns a unicode + string following the same rules. + + If 'cdata' is a single character or byte or a wchar_t, returns + it as a string or unicode string. + + If 'cdata' is an enum, returns the value of the enumerator as a + string, or 'NUMBER' if the value is out of range. + """ + return self._backend.string(cdata, maxlen) + + def unpack(self, cdata, length): + """Unpack an array of C data of the given length, + returning a Python string/unicode/list. + + If 'cdata' is a pointer to 'char', returns a byte string. + It does not stop at the first null. This is equivalent to: + ffi.buffer(cdata, length)[:] + + If 'cdata' is a pointer to 'wchar_t', returns a unicode string. + 'length' is measured in wchar_t's; it is not the size in bytes. + + If 'cdata' is a pointer to anything else, returns a list of + 'length' items. This is a faster equivalent to: + [cdata[i] for i in range(length)] + """ + return self._backend.unpack(cdata, length) + + #def buffer(self, cdata, size=-1): + # """Return a read-write buffer object that references the raw C data + # pointed to by the given 'cdata'. The 'cdata' must be a pointer or + # an array. Can be passed to functions expecting a buffer, or directly + # manipulated with: + # + # buf[:] get a copy of it in a regular string, or + # buf[idx] as a single character + # buf[:] = ... + # buf[idx] = ... change the content + # """ + # note that 'buffer' is a type, set on this instance by __init__ + + def from_buffer(self, cdecl, python_buffer=_unspecified, + require_writable=False): + """Return a cdata of the given type pointing to the data of the + given Python object, which must support the buffer interface. + Note that this is not meant to be used on the built-in types + str or unicode (you can build 'char[]' arrays explicitly) + but only on objects containing large quantities of raw data + in some other format, like 'array.array' or numpy arrays. + + The first argument is optional and default to 'char[]'. + """ + if python_buffer is _unspecified: + cdecl, python_buffer = self.BCharA, cdecl + elif isinstance(cdecl, basestring): + cdecl = self._typeof(cdecl) + return self._backend.from_buffer(cdecl, python_buffer, + require_writable) + + def memmove(self, dest, src, n): + """ffi.memmove(dest, src, n) copies n bytes of memory from src to dest. + + Like the C function memmove(), the memory areas may overlap; + apart from that it behaves like the C function memcpy(). + + 'src' can be any cdata ptr or array, or any Python buffer object. + 'dest' can be any cdata ptr or array, or a writable Python buffer + object. The size to copy, 'n', is always measured in bytes. + + Unlike other methods, this one supports all Python buffer including + byte strings and bytearrays---but it still does not support + non-contiguous buffers. + """ + return self._backend.memmove(dest, src, n) + + def callback(self, cdecl, python_callable=None, error=None, onerror=None): + """Return a callback object or a decorator making such a + callback object. 'cdecl' must name a C function pointer type. + The callback invokes the specified 'python_callable' (which may + be provided either directly or via a decorator). Important: the + callback object must be manually kept alive for as long as the + callback may be invoked from the C level. + """ + def callback_decorator_wrap(python_callable): + if not callable(python_callable): + raise TypeError("the 'python_callable' argument " + "is not callable") + return self._backend.callback(cdecl, python_callable, + error, onerror) + if isinstance(cdecl, basestring): + cdecl = self._typeof(cdecl, consider_function_as_funcptr=True) + if python_callable is None: + return callback_decorator_wrap # decorator mode + else: + return callback_decorator_wrap(python_callable) # direct mode + + def getctype(self, cdecl, replace_with=''): + """Return a string giving the C type 'cdecl', which may be itself + a string or a object. If 'replace_with' is given, it gives + extra text to append (or insert for more complicated C types), like + a variable name, or '*' to get actually the C type 'pointer-to-cdecl'. + """ + if isinstance(cdecl, basestring): + cdecl = self._typeof(cdecl) + replace_with = replace_with.strip() + if (replace_with.startswith('*') + and '&[' in self._backend.getcname(cdecl, '&')): + replace_with = '(%s)' % replace_with + elif replace_with and not replace_with[0] in '[(': + replace_with = ' ' + replace_with + return self._backend.getcname(cdecl, replace_with) + + def gc(self, cdata, destructor, size=0): + """Return a new cdata object that points to the same + data. Later, when this new cdata object is garbage-collected, + 'destructor(old_cdata_object)' will be called. + + The optional 'size' gives an estimate of the size, used to + trigger the garbage collection more eagerly. So far only used + on PyPy. It tells the GC that the returned object keeps alive + roughly 'size' bytes of external memory. + """ + return self._backend.gcp(cdata, destructor, size) + + def _get_cached_btype(self, type): + assert self._lock.acquire(False) is False + # call me with the lock! + try: + BType = self._cached_btypes[type] + except KeyError: + finishlist = [] + BType = type.get_cached_btype(self, finishlist) + for type in finishlist: + type.finish_backend_type(self, finishlist) + return BType + + def verify(self, source='', tmpdir=None, **kwargs): + """Verify that the current ffi signatures compile on this + machine, and return a dynamic library object. The dynamic + library can be used to call functions and access global + variables declared in this 'ffi'. The library is compiled + by the C compiler: it gives you C-level API compatibility + (including calling macros). This is unlike 'ffi.dlopen()', + which requires binary compatibility in the signatures. + """ + from .verifier import Verifier, _caller_dir_pycache + # + # If set_unicode(True) was called, insert the UNICODE and + # _UNICODE macro declarations + if self._windows_unicode: + self._apply_windows_unicode(kwargs) + # + # Set the tmpdir here, and not in Verifier.__init__: it picks + # up the caller's directory, which we want to be the caller of + # ffi.verify(), as opposed to the caller of Veritier(). + tmpdir = tmpdir or _caller_dir_pycache() + # + # Make a Verifier() and use it to load the library. + self.verifier = Verifier(self, source, tmpdir, **kwargs) + lib = self.verifier.load_library() + # + # Save the loaded library for keep-alive purposes, even + # if the caller doesn't keep it alive itself (it should). + self._libraries.append(lib) + return lib + + def _get_errno(self): + return self._backend.get_errno() + def _set_errno(self, errno): + self._backend.set_errno(errno) + errno = property(_get_errno, _set_errno, None, + "the value of 'errno' from/to the C calls") + + def getwinerror(self, code=-1): + return self._backend.getwinerror(code) + + def _pointer_to(self, ctype): + with self._lock: + return model.pointer_cache(self, ctype) + + def addressof(self, cdata, *fields_or_indexes): + """Return the address of a . + If 'fields_or_indexes' are given, returns the address of that + field or array item in the structure or array, recursively in + case of nested structures. + """ + try: + ctype = self._backend.typeof(cdata) + except TypeError: + if '__addressof__' in type(cdata).__dict__: + return type(cdata).__addressof__(cdata, *fields_or_indexes) + raise + if fields_or_indexes: + ctype, offset = self._typeoffsetof(ctype, *fields_or_indexes) + else: + if ctype.kind == "pointer": + raise TypeError("addressof(pointer)") + offset = 0 + ctypeptr = self._pointer_to(ctype) + return self._backend.rawaddressof(ctypeptr, cdata, offset) + + def _typeoffsetof(self, ctype, field_or_index, *fields_or_indexes): + ctype, offset = self._backend.typeoffsetof(ctype, field_or_index) + for field1 in fields_or_indexes: + ctype, offset1 = self._backend.typeoffsetof(ctype, field1, 1) + offset += offset1 + return ctype, offset + + def include(self, ffi_to_include): + """Includes the typedefs, structs, unions and enums defined + in another FFI instance. Usage is similar to a #include in C, + where a part of the program might include types defined in + another part for its own usage. Note that the include() + method has no effect on functions, constants and global + variables, which must anyway be accessed directly from the + lib object returned by the original FFI instance. + """ + if not isinstance(ffi_to_include, FFI): + raise TypeError("ffi.include() expects an argument that is also of" + " type cffi.FFI, not %r" % ( + type(ffi_to_include).__name__,)) + if ffi_to_include is self: + raise ValueError("self.include(self)") + with ffi_to_include._lock: + with self._lock: + self._parser.include(ffi_to_include._parser) + self._cdefsources.append('[') + self._cdefsources.extend(ffi_to_include._cdefsources) + self._cdefsources.append(']') + self._included_ffis.append(ffi_to_include) + + def new_handle(self, x): + return self._backend.newp_handle(self.BVoidP, x) + + def from_handle(self, x): + return self._backend.from_handle(x) + + def release(self, x): + self._backend.release(x) + + def set_unicode(self, enabled_flag): + """Windows: if 'enabled_flag' is True, enable the UNICODE and + _UNICODE defines in C, and declare the types like TCHAR and LPTCSTR + to be (pointers to) wchar_t. If 'enabled_flag' is False, + declare these types to be (pointers to) plain 8-bit characters. + This is mostly for backward compatibility; you usually want True. + """ + if self._windows_unicode is not None: + raise ValueError("set_unicode() can only be called once") + enabled_flag = bool(enabled_flag) + if enabled_flag: + self.cdef("typedef wchar_t TBYTE;" + "typedef wchar_t TCHAR;" + "typedef const wchar_t *LPCTSTR;" + "typedef const wchar_t *PCTSTR;" + "typedef wchar_t *LPTSTR;" + "typedef wchar_t *PTSTR;" + "typedef TBYTE *PTBYTE;" + "typedef TCHAR *PTCHAR;") + else: + self.cdef("typedef char TBYTE;" + "typedef char TCHAR;" + "typedef const char *LPCTSTR;" + "typedef const char *PCTSTR;" + "typedef char *LPTSTR;" + "typedef char *PTSTR;" + "typedef TBYTE *PTBYTE;" + "typedef TCHAR *PTCHAR;") + self._windows_unicode = enabled_flag + + def _apply_windows_unicode(self, kwds): + defmacros = kwds.get('define_macros', ()) + if not isinstance(defmacros, (list, tuple)): + raise TypeError("'define_macros' must be a list or tuple") + defmacros = list(defmacros) + [('UNICODE', '1'), + ('_UNICODE', '1')] + kwds['define_macros'] = defmacros + + def _apply_embedding_fix(self, kwds): + # must include an argument like "-lpython2.7" for the compiler + def ensure(key, value): + lst = kwds.setdefault(key, []) + if value not in lst: + lst.append(value) + # + if '__pypy__' in sys.builtin_module_names: + import os + if sys.platform == "win32": + # we need 'libpypy-c.lib'. Current distributions of + # pypy (>= 4.1) contain it as 'libs/python27.lib'. + pythonlib = "python{0[0]}{0[1]}".format(sys.version_info) + if hasattr(sys, 'prefix'): + ensure('library_dirs', os.path.join(sys.prefix, 'libs')) + else: + # we need 'libpypy-c.{so,dylib}', which should be by + # default located in 'sys.prefix/bin' for installed + # systems. + if sys.version_info < (3,): + pythonlib = "pypy-c" + else: + pythonlib = "pypy3-c" + if hasattr(sys, 'prefix'): + ensure('library_dirs', os.path.join(sys.prefix, 'bin')) + # On uninstalled pypy's, the libpypy-c is typically found in + # .../pypy/goal/. + if hasattr(sys, 'prefix'): + ensure('library_dirs', os.path.join(sys.prefix, 'pypy', 'goal')) + else: + if sys.platform == "win32": + template = "python%d%d" + if hasattr(sys, 'gettotalrefcount'): + template += '_d' + else: + try: + import sysconfig + except ImportError: # 2.6 + from distutils import sysconfig + template = "python%d.%d" + if sysconfig.get_config_var('DEBUG_EXT'): + template += sysconfig.get_config_var('DEBUG_EXT') + pythonlib = (template % + (sys.hexversion >> 24, (sys.hexversion >> 16) & 0xff)) + if hasattr(sys, 'abiflags'): + pythonlib += sys.abiflags + ensure('libraries', pythonlib) + if sys.platform == "win32": + ensure('extra_link_args', '/MANIFEST') + + def set_source(self, module_name, source, source_extension='.c', **kwds): + import os + if hasattr(self, '_assigned_source'): + raise ValueError("set_source() cannot be called several times " + "per ffi object") + if not isinstance(module_name, basestring): + raise TypeError("'module_name' must be a string") + if os.sep in module_name or (os.altsep and os.altsep in module_name): + raise ValueError("'module_name' must not contain '/': use a dotted " + "name to make a 'package.module' location") + self._assigned_source = (str(module_name), source, + source_extension, kwds) + + def set_source_pkgconfig(self, module_name, pkgconfig_libs, source, + source_extension='.c', **kwds): + from . import pkgconfig + if not isinstance(pkgconfig_libs, list): + raise TypeError("the pkgconfig_libs argument must be a list " + "of package names") + kwds2 = pkgconfig.flags_from_pkgconfig(pkgconfig_libs) + pkgconfig.merge_flags(kwds, kwds2) + self.set_source(module_name, source, source_extension, **kwds) + + def distutils_extension(self, tmpdir='build', verbose=True): + from distutils.dir_util import mkpath + from .recompiler import recompile + # + if not hasattr(self, '_assigned_source'): + if hasattr(self, 'verifier'): # fallback, 'tmpdir' ignored + return self.verifier.get_extension() + raise ValueError("set_source() must be called before" + " distutils_extension()") + module_name, source, source_extension, kwds = self._assigned_source + if source is None: + raise TypeError("distutils_extension() is only for C extension " + "modules, not for dlopen()-style pure Python " + "modules") + mkpath(tmpdir) + ext, updated = recompile(self, module_name, + source, tmpdir=tmpdir, extradir=tmpdir, + source_extension=source_extension, + call_c_compiler=False, **kwds) + if verbose: + if updated: + sys.stderr.write("regenerated: %r\n" % (ext.sources[0],)) + else: + sys.stderr.write("not modified: %r\n" % (ext.sources[0],)) + return ext + + def emit_c_code(self, filename): + from .recompiler import recompile + # + if not hasattr(self, '_assigned_source'): + raise ValueError("set_source() must be called before emit_c_code()") + module_name, source, source_extension, kwds = self._assigned_source + if source is None: + raise TypeError("emit_c_code() is only for C extension modules, " + "not for dlopen()-style pure Python modules") + recompile(self, module_name, source, + c_file=filename, call_c_compiler=False, **kwds) + + def emit_python_code(self, filename): + from .recompiler import recompile + # + if not hasattr(self, '_assigned_source'): + raise ValueError("set_source() must be called before emit_c_code()") + module_name, source, source_extension, kwds = self._assigned_source + if source is not None: + raise TypeError("emit_python_code() is only for dlopen()-style " + "pure Python modules, not for C extension modules") + recompile(self, module_name, source, + c_file=filename, call_c_compiler=False, **kwds) + + def compile(self, tmpdir='.', verbose=0, target=None, debug=None): + """The 'target' argument gives the final file name of the + compiled DLL. Use '*' to force distutils' choice, suitable for + regular CPython C API modules. Use a file name ending in '.*' + to ask for the system's default extension for dynamic libraries + (.so/.dll/.dylib). + + The default is '*' when building a non-embedded C API extension, + and (module_name + '.*') when building an embedded library. + """ + from .recompiler import recompile + # + if not hasattr(self, '_assigned_source'): + raise ValueError("set_source() must be called before compile()") + module_name, source, source_extension, kwds = self._assigned_source + return recompile(self, module_name, source, tmpdir=tmpdir, + target=target, source_extension=source_extension, + compiler_verbose=verbose, debug=debug, **kwds) + + def init_once(self, func, tag): + # Read _init_once_cache[tag], which is either (False, lock) if + # we're calling the function now in some thread, or (True, result). + # Don't call setdefault() in most cases, to avoid allocating and + # immediately freeing a lock; but still use setdefaut() to avoid + # races. + try: + x = self._init_once_cache[tag] + except KeyError: + x = self._init_once_cache.setdefault(tag, (False, allocate_lock())) + # Common case: we got (True, result), so we return the result. + if x[0]: + return x[1] + # Else, it's a lock. Acquire it to serialize the following tests. + with x[1]: + # Read again from _init_once_cache the current status. + x = self._init_once_cache[tag] + if x[0]: + return x[1] + # Call the function and store the result back. + result = func() + self._init_once_cache[tag] = (True, result) + return result + + def embedding_init_code(self, pysource): + if self._embedding: + raise ValueError("embedding_init_code() can only be called once") + # fix 'pysource' before it gets dumped into the C file: + # - remove empty lines at the beginning, so it starts at "line 1" + # - dedent, if all non-empty lines are indented + # - check for SyntaxErrors + import re + match = re.match(r'\s*\n', pysource) + if match: + pysource = pysource[match.end():] + lines = pysource.splitlines() or [''] + prefix = re.match(r'\s*', lines[0]).group() + for i in range(1, len(lines)): + line = lines[i] + if line.rstrip(): + while not line.startswith(prefix): + prefix = prefix[:-1] + i = len(prefix) + lines = [line[i:]+'\n' for line in lines] + pysource = ''.join(lines) + # + compile(pysource, "cffi_init", "exec") + # + self._embedding = pysource + + def def_extern(self, *args, **kwds): + raise ValueError("ffi.def_extern() is only available on API-mode FFI " + "objects") + + def list_types(self): + """Returns the user type names known to this FFI instance. + This returns a tuple containing three lists of names: + (typedef_names, names_of_structs, names_of_unions) + """ + typedefs = [] + structs = [] + unions = [] + for key in self._parser._declarations: + if key.startswith('typedef '): + typedefs.append(key[8:]) + elif key.startswith('struct '): + structs.append(key[7:]) + elif key.startswith('union '): + unions.append(key[6:]) + typedefs.sort() + structs.sort() + unions.sort() + return (typedefs, structs, unions) + + +def _load_backend_lib(backend, name, flags): + import os + if name is None: + if sys.platform != "win32": + return backend.load_library(None, flags) + name = "c" # Windows: load_library(None) fails, but this works + # on Python 2 (backward compatibility hack only) + first_error = None + if '.' in name or '/' in name or os.sep in name: + try: + return backend.load_library(name, flags) + except OSError as e: + first_error = e + import ctypes.util + path = ctypes.util.find_library(name) + if path is None: + if name == "c" and sys.platform == "win32" and sys.version_info >= (3,): + raise OSError("dlopen(None) cannot work on Windows for Python 3 " + "(see http://bugs.python.org/issue23606)") + msg = ("ctypes.util.find_library() did not manage " + "to locate a library called %r" % (name,)) + if first_error is not None: + msg = "%s. Additionally, %s" % (first_error, msg) + raise OSError(msg) + return backend.load_library(path, flags) + +def _make_ffi_library(ffi, libname, flags): + backend = ffi._backend + backendlib = _load_backend_lib(backend, libname, flags) + # + def accessor_function(name): + key = 'function ' + name + tp, _ = ffi._parser._declarations[key] + BType = ffi._get_cached_btype(tp) + value = backendlib.load_function(BType, name) + library.__dict__[name] = value + # + def accessor_variable(name): + key = 'variable ' + name + tp, _ = ffi._parser._declarations[key] + BType = ffi._get_cached_btype(tp) + read_variable = backendlib.read_variable + write_variable = backendlib.write_variable + setattr(FFILibrary, name, property( + lambda self: read_variable(BType, name), + lambda self, value: write_variable(BType, name, value))) + # + def addressof_var(name): + try: + return addr_variables[name] + except KeyError: + with ffi._lock: + if name not in addr_variables: + key = 'variable ' + name + tp, _ = ffi._parser._declarations[key] + BType = ffi._get_cached_btype(tp) + if BType.kind != 'array': + BType = model.pointer_cache(ffi, BType) + p = backendlib.load_function(BType, name) + addr_variables[name] = p + return addr_variables[name] + # + def accessor_constant(name): + raise NotImplementedError("non-integer constant '%s' cannot be " + "accessed from a dlopen() library" % (name,)) + # + def accessor_int_constant(name): + library.__dict__[name] = ffi._parser._int_constants[name] + # + accessors = {} + accessors_version = [False] + addr_variables = {} + # + def update_accessors(): + if accessors_version[0] is ffi._cdef_version: + return + # + for key, (tp, _) in ffi._parser._declarations.items(): + if not isinstance(tp, model.EnumType): + tag, name = key.split(' ', 1) + if tag == 'function': + accessors[name] = accessor_function + elif tag == 'variable': + accessors[name] = accessor_variable + elif tag == 'constant': + accessors[name] = accessor_constant + else: + for i, enumname in enumerate(tp.enumerators): + def accessor_enum(name, tp=tp, i=i): + tp.check_not_partial() + library.__dict__[name] = tp.enumvalues[i] + accessors[enumname] = accessor_enum + for name in ffi._parser._int_constants: + accessors.setdefault(name, accessor_int_constant) + accessors_version[0] = ffi._cdef_version + # + def make_accessor(name): + with ffi._lock: + if name in library.__dict__ or name in FFILibrary.__dict__: + return # added by another thread while waiting for the lock + if name not in accessors: + update_accessors() + if name not in accessors: + raise AttributeError(name) + accessors[name](name) + # + class FFILibrary(object): + def __getattr__(self, name): + make_accessor(name) + return getattr(self, name) + def __setattr__(self, name, value): + try: + property = getattr(self.__class__, name) + except AttributeError: + make_accessor(name) + setattr(self, name, value) + else: + property.__set__(self, value) + def __dir__(self): + with ffi._lock: + update_accessors() + return accessors.keys() + def __addressof__(self, name): + if name in library.__dict__: + return library.__dict__[name] + if name in FFILibrary.__dict__: + return addressof_var(name) + make_accessor(name) + if name in library.__dict__: + return library.__dict__[name] + if name in FFILibrary.__dict__: + return addressof_var(name) + raise AttributeError("cffi library has no function or " + "global variable named '%s'" % (name,)) + def __cffi_close__(self): + backendlib.close_lib() + self.__dict__.clear() + # + if libname is not None: + try: + if not isinstance(libname, str): # unicode, on Python 2 + libname = libname.encode('utf-8') + FFILibrary.__name__ = 'FFILibrary_%s' % libname + except UnicodeError: + pass + library = FFILibrary() + return library, library.__dict__ + +def _builtin_function_type(func): + # a hack to make at least ffi.typeof(builtin_function) work, + # if the builtin function was obtained by 'vengine_cpy'. + import sys + try: + module = sys.modules[func.__module__] + ffi = module._cffi_original_ffi + types_of_builtin_funcs = module._cffi_types_of_builtin_funcs + tp = types_of_builtin_funcs[func] + except (KeyError, AttributeError, TypeError): + return None + else: + with ffi._lock: + return ffi._get_cached_btype(tp) diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/cffi/backend_ctypes.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/cffi/backend_ctypes.py new file mode 100644 index 00000000..679ae057 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/cffi/backend_ctypes.py @@ -0,0 +1,1121 @@ +import ctypes, ctypes.util, operator, sys +from . import model + +if sys.version_info < (3,): + bytechr = chr +else: + unicode = str + long = int + xrange = range + bytechr = lambda num: bytes([num]) + +class CTypesType(type): + pass + +class CTypesData(object): + __metaclass__ = CTypesType + __slots__ = ['__weakref__'] + __name__ = '' + + def __init__(self, *args): + raise TypeError("cannot instantiate %r" % (self.__class__,)) + + @classmethod + def _newp(cls, init): + raise TypeError("expected a pointer or array ctype, got '%s'" + % (cls._get_c_name(),)) + + @staticmethod + def _to_ctypes(value): + raise TypeError + + @classmethod + def _arg_to_ctypes(cls, *value): + try: + ctype = cls._ctype + except AttributeError: + raise TypeError("cannot create an instance of %r" % (cls,)) + if value: + res = cls._to_ctypes(*value) + if not isinstance(res, ctype): + res = cls._ctype(res) + else: + res = cls._ctype() + return res + + @classmethod + def _create_ctype_obj(cls, init): + if init is None: + return cls._arg_to_ctypes() + else: + return cls._arg_to_ctypes(init) + + @staticmethod + def _from_ctypes(ctypes_value): + raise TypeError + + @classmethod + def _get_c_name(cls, replace_with=''): + return cls._reftypename.replace(' &', replace_with) + + @classmethod + def _fix_class(cls): + cls.__name__ = 'CData<%s>' % (cls._get_c_name(),) + cls.__qualname__ = 'CData<%s>' % (cls._get_c_name(),) + cls.__module__ = 'ffi' + + def _get_own_repr(self): + raise NotImplementedError + + def _addr_repr(self, address): + if address == 0: + return 'NULL' + else: + if address < 0: + address += 1 << (8*ctypes.sizeof(ctypes.c_void_p)) + return '0x%x' % address + + def __repr__(self, c_name=None): + own = self._get_own_repr() + return '' % (c_name or self._get_c_name(), own) + + def _convert_to_address(self, BClass): + if BClass is None: + raise TypeError("cannot convert %r to an address" % ( + self._get_c_name(),)) + else: + raise TypeError("cannot convert %r to %r" % ( + self._get_c_name(), BClass._get_c_name())) + + @classmethod + def _get_size(cls): + return ctypes.sizeof(cls._ctype) + + def _get_size_of_instance(self): + return ctypes.sizeof(self._ctype) + + @classmethod + def _cast_from(cls, source): + raise TypeError("cannot cast to %r" % (cls._get_c_name(),)) + + def _cast_to_integer(self): + return self._convert_to_address(None) + + @classmethod + def _alignment(cls): + return ctypes.alignment(cls._ctype) + + def __iter__(self): + raise TypeError("cdata %r does not support iteration" % ( + self._get_c_name()),) + + def _make_cmp(name): + cmpfunc = getattr(operator, name) + def cmp(self, other): + v_is_ptr = not isinstance(self, CTypesGenericPrimitive) + w_is_ptr = (isinstance(other, CTypesData) and + not isinstance(other, CTypesGenericPrimitive)) + if v_is_ptr and w_is_ptr: + return cmpfunc(self._convert_to_address(None), + other._convert_to_address(None)) + elif v_is_ptr or w_is_ptr: + return NotImplemented + else: + if isinstance(self, CTypesGenericPrimitive): + self = self._value + if isinstance(other, CTypesGenericPrimitive): + other = other._value + return cmpfunc(self, other) + cmp.func_name = name + return cmp + + __eq__ = _make_cmp('__eq__') + __ne__ = _make_cmp('__ne__') + __lt__ = _make_cmp('__lt__') + __le__ = _make_cmp('__le__') + __gt__ = _make_cmp('__gt__') + __ge__ = _make_cmp('__ge__') + + def __hash__(self): + return hash(self._convert_to_address(None)) + + def _to_string(self, maxlen): + raise TypeError("string(): %r" % (self,)) + + +class CTypesGenericPrimitive(CTypesData): + __slots__ = [] + + def __hash__(self): + return hash(self._value) + + def _get_own_repr(self): + return repr(self._from_ctypes(self._value)) + + +class CTypesGenericArray(CTypesData): + __slots__ = [] + + @classmethod + def _newp(cls, init): + return cls(init) + + def __iter__(self): + for i in xrange(len(self)): + yield self[i] + + def _get_own_repr(self): + return self._addr_repr(ctypes.addressof(self._blob)) + + +class CTypesGenericPtr(CTypesData): + __slots__ = ['_address', '_as_ctype_ptr'] + _automatic_casts = False + kind = "pointer" + + @classmethod + def _newp(cls, init): + return cls(init) + + @classmethod + def _cast_from(cls, source): + if source is None: + address = 0 + elif isinstance(source, CTypesData): + address = source._cast_to_integer() + elif isinstance(source, (int, long)): + address = source + else: + raise TypeError("bad type for cast to %r: %r" % + (cls, type(source).__name__)) + return cls._new_pointer_at(address) + + @classmethod + def _new_pointer_at(cls, address): + self = cls.__new__(cls) + self._address = address + self._as_ctype_ptr = ctypes.cast(address, cls._ctype) + return self + + def _get_own_repr(self): + try: + return self._addr_repr(self._address) + except AttributeError: + return '???' + + def _cast_to_integer(self): + return self._address + + def __nonzero__(self): + return bool(self._address) + __bool__ = __nonzero__ + + @classmethod + def _to_ctypes(cls, value): + if not isinstance(value, CTypesData): + raise TypeError("unexpected %s object" % type(value).__name__) + address = value._convert_to_address(cls) + return ctypes.cast(address, cls._ctype) + + @classmethod + def _from_ctypes(cls, ctypes_ptr): + address = ctypes.cast(ctypes_ptr, ctypes.c_void_p).value or 0 + return cls._new_pointer_at(address) + + @classmethod + def _initialize(cls, ctypes_ptr, value): + if value: + ctypes_ptr.contents = cls._to_ctypes(value).contents + + def _convert_to_address(self, BClass): + if (BClass in (self.__class__, None) or BClass._automatic_casts + or self._automatic_casts): + return self._address + else: + return CTypesData._convert_to_address(self, BClass) + + +class CTypesBaseStructOrUnion(CTypesData): + __slots__ = ['_blob'] + + @classmethod + def _create_ctype_obj(cls, init): + # may be overridden + raise TypeError("cannot instantiate opaque type %s" % (cls,)) + + def _get_own_repr(self): + return self._addr_repr(ctypes.addressof(self._blob)) + + @classmethod + def _offsetof(cls, fieldname): + return getattr(cls._ctype, fieldname).offset + + def _convert_to_address(self, BClass): + if getattr(BClass, '_BItem', None) is self.__class__: + return ctypes.addressof(self._blob) + else: + return CTypesData._convert_to_address(self, BClass) + + @classmethod + def _from_ctypes(cls, ctypes_struct_or_union): + self = cls.__new__(cls) + self._blob = ctypes_struct_or_union + return self + + @classmethod + def _to_ctypes(cls, value): + return value._blob + + def __repr__(self, c_name=None): + return CTypesData.__repr__(self, c_name or self._get_c_name(' &')) + + +class CTypesBackend(object): + + PRIMITIVE_TYPES = { + 'char': ctypes.c_char, + 'short': ctypes.c_short, + 'int': ctypes.c_int, + 'long': ctypes.c_long, + 'long long': ctypes.c_longlong, + 'signed char': ctypes.c_byte, + 'unsigned char': ctypes.c_ubyte, + 'unsigned short': ctypes.c_ushort, + 'unsigned int': ctypes.c_uint, + 'unsigned long': ctypes.c_ulong, + 'unsigned long long': ctypes.c_ulonglong, + 'float': ctypes.c_float, + 'double': ctypes.c_double, + '_Bool': ctypes.c_bool, + } + + for _name in ['unsigned long long', 'unsigned long', + 'unsigned int', 'unsigned short', 'unsigned char']: + _size = ctypes.sizeof(PRIMITIVE_TYPES[_name]) + PRIMITIVE_TYPES['uint%d_t' % (8*_size)] = PRIMITIVE_TYPES[_name] + if _size == ctypes.sizeof(ctypes.c_void_p): + PRIMITIVE_TYPES['uintptr_t'] = PRIMITIVE_TYPES[_name] + if _size == ctypes.sizeof(ctypes.c_size_t): + PRIMITIVE_TYPES['size_t'] = PRIMITIVE_TYPES[_name] + + for _name in ['long long', 'long', 'int', 'short', 'signed char']: + _size = ctypes.sizeof(PRIMITIVE_TYPES[_name]) + PRIMITIVE_TYPES['int%d_t' % (8*_size)] = PRIMITIVE_TYPES[_name] + if _size == ctypes.sizeof(ctypes.c_void_p): + PRIMITIVE_TYPES['intptr_t'] = PRIMITIVE_TYPES[_name] + PRIMITIVE_TYPES['ptrdiff_t'] = PRIMITIVE_TYPES[_name] + if _size == ctypes.sizeof(ctypes.c_size_t): + PRIMITIVE_TYPES['ssize_t'] = PRIMITIVE_TYPES[_name] + + + def __init__(self): + self.RTLD_LAZY = 0 # not supported anyway by ctypes + self.RTLD_NOW = 0 + self.RTLD_GLOBAL = ctypes.RTLD_GLOBAL + self.RTLD_LOCAL = ctypes.RTLD_LOCAL + + def set_ffi(self, ffi): + self.ffi = ffi + + def _get_types(self): + return CTypesData, CTypesType + + def load_library(self, path, flags=0): + cdll = ctypes.CDLL(path, flags) + return CTypesLibrary(self, cdll) + + def new_void_type(self): + class CTypesVoid(CTypesData): + __slots__ = [] + _reftypename = 'void &' + @staticmethod + def _from_ctypes(novalue): + return None + @staticmethod + def _to_ctypes(novalue): + if novalue is not None: + raise TypeError("None expected, got %s object" % + (type(novalue).__name__,)) + return None + CTypesVoid._fix_class() + return CTypesVoid + + def new_primitive_type(self, name): + if name == 'wchar_t': + raise NotImplementedError(name) + ctype = self.PRIMITIVE_TYPES[name] + if name == 'char': + kind = 'char' + elif name in ('float', 'double'): + kind = 'float' + else: + if name in ('signed char', 'unsigned char'): + kind = 'byte' + elif name == '_Bool': + kind = 'bool' + else: + kind = 'int' + is_signed = (ctype(-1).value == -1) + # + def _cast_source_to_int(source): + if isinstance(source, (int, long, float)): + source = int(source) + elif isinstance(source, CTypesData): + source = source._cast_to_integer() + elif isinstance(source, bytes): + source = ord(source) + elif source is None: + source = 0 + else: + raise TypeError("bad type for cast to %r: %r" % + (CTypesPrimitive, type(source).__name__)) + return source + # + kind1 = kind + class CTypesPrimitive(CTypesGenericPrimitive): + __slots__ = ['_value'] + _ctype = ctype + _reftypename = '%s &' % name + kind = kind1 + + def __init__(self, value): + self._value = value + + @staticmethod + def _create_ctype_obj(init): + if init is None: + return ctype() + return ctype(CTypesPrimitive._to_ctypes(init)) + + if kind == 'int' or kind == 'byte': + @classmethod + def _cast_from(cls, source): + source = _cast_source_to_int(source) + source = ctype(source).value # cast within range + return cls(source) + def __int__(self): + return self._value + + if kind == 'bool': + @classmethod + def _cast_from(cls, source): + if not isinstance(source, (int, long, float)): + source = _cast_source_to_int(source) + return cls(bool(source)) + def __int__(self): + return self._value + + if kind == 'char': + @classmethod + def _cast_from(cls, source): + source = _cast_source_to_int(source) + source = bytechr(source & 0xFF) + return cls(source) + def __int__(self): + return ord(self._value) + + if kind == 'float': + @classmethod + def _cast_from(cls, source): + if isinstance(source, float): + pass + elif isinstance(source, CTypesGenericPrimitive): + if hasattr(source, '__float__'): + source = float(source) + else: + source = int(source) + else: + source = _cast_source_to_int(source) + source = ctype(source).value # fix precision + return cls(source) + def __int__(self): + return int(self._value) + def __float__(self): + return self._value + + _cast_to_integer = __int__ + + if kind == 'int' or kind == 'byte' or kind == 'bool': + @staticmethod + def _to_ctypes(x): + if not isinstance(x, (int, long)): + if isinstance(x, CTypesData): + x = int(x) + else: + raise TypeError("integer expected, got %s" % + type(x).__name__) + if ctype(x).value != x: + if not is_signed and x < 0: + raise OverflowError("%s: negative integer" % name) + else: + raise OverflowError("%s: integer out of bounds" + % name) + return x + + if kind == 'char': + @staticmethod + def _to_ctypes(x): + if isinstance(x, bytes) and len(x) == 1: + return x + if isinstance(x, CTypesPrimitive): # > + return x._value + raise TypeError("character expected, got %s" % + type(x).__name__) + def __nonzero__(self): + return ord(self._value) != 0 + else: + def __nonzero__(self): + return self._value != 0 + __bool__ = __nonzero__ + + if kind == 'float': + @staticmethod + def _to_ctypes(x): + if not isinstance(x, (int, long, float, CTypesData)): + raise TypeError("float expected, got %s" % + type(x).__name__) + return ctype(x).value + + @staticmethod + def _from_ctypes(value): + return getattr(value, 'value', value) + + @staticmethod + def _initialize(blob, init): + blob.value = CTypesPrimitive._to_ctypes(init) + + if kind == 'char': + def _to_string(self, maxlen): + return self._value + if kind == 'byte': + def _to_string(self, maxlen): + return chr(self._value & 0xff) + # + CTypesPrimitive._fix_class() + return CTypesPrimitive + + def new_pointer_type(self, BItem): + getbtype = self.ffi._get_cached_btype + if BItem is getbtype(model.PrimitiveType('char')): + kind = 'charp' + elif BItem in (getbtype(model.PrimitiveType('signed char')), + getbtype(model.PrimitiveType('unsigned char'))): + kind = 'bytep' + elif BItem is getbtype(model.void_type): + kind = 'voidp' + else: + kind = 'generic' + # + class CTypesPtr(CTypesGenericPtr): + __slots__ = ['_own'] + if kind == 'charp': + __slots__ += ['__as_strbuf'] + _BItem = BItem + if hasattr(BItem, '_ctype'): + _ctype = ctypes.POINTER(BItem._ctype) + _bitem_size = ctypes.sizeof(BItem._ctype) + else: + _ctype = ctypes.c_void_p + if issubclass(BItem, CTypesGenericArray): + _reftypename = BItem._get_c_name('(* &)') + else: + _reftypename = BItem._get_c_name(' * &') + + def __init__(self, init): + ctypeobj = BItem._create_ctype_obj(init) + if kind == 'charp': + self.__as_strbuf = ctypes.create_string_buffer( + ctypeobj.value + b'\x00') + self._as_ctype_ptr = ctypes.cast( + self.__as_strbuf, self._ctype) + else: + self._as_ctype_ptr = ctypes.pointer(ctypeobj) + self._address = ctypes.cast(self._as_ctype_ptr, + ctypes.c_void_p).value + self._own = True + + def __add__(self, other): + if isinstance(other, (int, long)): + return self._new_pointer_at(self._address + + other * self._bitem_size) + else: + return NotImplemented + + def __sub__(self, other): + if isinstance(other, (int, long)): + return self._new_pointer_at(self._address - + other * self._bitem_size) + elif type(self) is type(other): + return (self._address - other._address) // self._bitem_size + else: + return NotImplemented + + def __getitem__(self, index): + if getattr(self, '_own', False) and index != 0: + raise IndexError + return BItem._from_ctypes(self._as_ctype_ptr[index]) + + def __setitem__(self, index, value): + self._as_ctype_ptr[index] = BItem._to_ctypes(value) + + if kind == 'charp' or kind == 'voidp': + @classmethod + def _arg_to_ctypes(cls, *value): + if value and isinstance(value[0], bytes): + return ctypes.c_char_p(value[0]) + else: + return super(CTypesPtr, cls)._arg_to_ctypes(*value) + + if kind == 'charp' or kind == 'bytep': + def _to_string(self, maxlen): + if maxlen < 0: + maxlen = sys.maxsize + p = ctypes.cast(self._as_ctype_ptr, + ctypes.POINTER(ctypes.c_char)) + n = 0 + while n < maxlen and p[n] != b'\x00': + n += 1 + return b''.join([p[i] for i in range(n)]) + + def _get_own_repr(self): + if getattr(self, '_own', False): + return 'owning %d bytes' % ( + ctypes.sizeof(self._as_ctype_ptr.contents),) + return super(CTypesPtr, self)._get_own_repr() + # + if (BItem is self.ffi._get_cached_btype(model.void_type) or + BItem is self.ffi._get_cached_btype(model.PrimitiveType('char'))): + CTypesPtr._automatic_casts = True + # + CTypesPtr._fix_class() + return CTypesPtr + + def new_array_type(self, CTypesPtr, length): + if length is None: + brackets = ' &[]' + else: + brackets = ' &[%d]' % length + BItem = CTypesPtr._BItem + getbtype = self.ffi._get_cached_btype + if BItem is getbtype(model.PrimitiveType('char')): + kind = 'char' + elif BItem in (getbtype(model.PrimitiveType('signed char')), + getbtype(model.PrimitiveType('unsigned char'))): + kind = 'byte' + else: + kind = 'generic' + # + class CTypesArray(CTypesGenericArray): + __slots__ = ['_blob', '_own'] + if length is not None: + _ctype = BItem._ctype * length + else: + __slots__.append('_ctype') + _reftypename = BItem._get_c_name(brackets) + _declared_length = length + _CTPtr = CTypesPtr + + def __init__(self, init): + if length is None: + if isinstance(init, (int, long)): + len1 = init + init = None + elif kind == 'char' and isinstance(init, bytes): + len1 = len(init) + 1 # extra null + else: + init = tuple(init) + len1 = len(init) + self._ctype = BItem._ctype * len1 + self._blob = self._ctype() + self._own = True + if init is not None: + self._initialize(self._blob, init) + + @staticmethod + def _initialize(blob, init): + if isinstance(init, bytes): + init = [init[i:i+1] for i in range(len(init))] + else: + if isinstance(init, CTypesGenericArray): + if (len(init) != len(blob) or + not isinstance(init, CTypesArray)): + raise TypeError("length/type mismatch: %s" % (init,)) + init = tuple(init) + if len(init) > len(blob): + raise IndexError("too many initializers") + addr = ctypes.cast(blob, ctypes.c_void_p).value + PTR = ctypes.POINTER(BItem._ctype) + itemsize = ctypes.sizeof(BItem._ctype) + for i, value in enumerate(init): + p = ctypes.cast(addr + i * itemsize, PTR) + BItem._initialize(p.contents, value) + + def __len__(self): + return len(self._blob) + + def __getitem__(self, index): + if not (0 <= index < len(self._blob)): + raise IndexError + return BItem._from_ctypes(self._blob[index]) + + def __setitem__(self, index, value): + if not (0 <= index < len(self._blob)): + raise IndexError + self._blob[index] = BItem._to_ctypes(value) + + if kind == 'char' or kind == 'byte': + def _to_string(self, maxlen): + if maxlen < 0: + maxlen = len(self._blob) + p = ctypes.cast(self._blob, + ctypes.POINTER(ctypes.c_char)) + n = 0 + while n < maxlen and p[n] != b'\x00': + n += 1 + return b''.join([p[i] for i in range(n)]) + + def _get_own_repr(self): + if getattr(self, '_own', False): + return 'owning %d bytes' % (ctypes.sizeof(self._blob),) + return super(CTypesArray, self)._get_own_repr() + + def _convert_to_address(self, BClass): + if BClass in (CTypesPtr, None) or BClass._automatic_casts: + return ctypes.addressof(self._blob) + else: + return CTypesData._convert_to_address(self, BClass) + + @staticmethod + def _from_ctypes(ctypes_array): + self = CTypesArray.__new__(CTypesArray) + self._blob = ctypes_array + return self + + @staticmethod + def _arg_to_ctypes(value): + return CTypesPtr._arg_to_ctypes(value) + + def __add__(self, other): + if isinstance(other, (int, long)): + return CTypesPtr._new_pointer_at( + ctypes.addressof(self._blob) + + other * ctypes.sizeof(BItem._ctype)) + else: + return NotImplemented + + @classmethod + def _cast_from(cls, source): + raise NotImplementedError("casting to %r" % ( + cls._get_c_name(),)) + # + CTypesArray._fix_class() + return CTypesArray + + def _new_struct_or_union(self, kind, name, base_ctypes_class): + # + class struct_or_union(base_ctypes_class): + pass + struct_or_union.__name__ = '%s_%s' % (kind, name) + kind1 = kind + # + class CTypesStructOrUnion(CTypesBaseStructOrUnion): + __slots__ = ['_blob'] + _ctype = struct_or_union + _reftypename = '%s &' % (name,) + _kind = kind = kind1 + # + CTypesStructOrUnion._fix_class() + return CTypesStructOrUnion + + def new_struct_type(self, name): + return self._new_struct_or_union('struct', name, ctypes.Structure) + + def new_union_type(self, name): + return self._new_struct_or_union('union', name, ctypes.Union) + + def complete_struct_or_union(self, CTypesStructOrUnion, fields, tp, + totalsize=-1, totalalignment=-1, sflags=0, + pack=0): + if totalsize >= 0 or totalalignment >= 0: + raise NotImplementedError("the ctypes backend of CFFI does not support " + "structures completed by verify(); please " + "compile and install the _cffi_backend module.") + struct_or_union = CTypesStructOrUnion._ctype + fnames = [fname for (fname, BField, bitsize) in fields] + btypes = [BField for (fname, BField, bitsize) in fields] + bitfields = [bitsize for (fname, BField, bitsize) in fields] + # + bfield_types = {} + cfields = [] + for (fname, BField, bitsize) in fields: + if bitsize < 0: + cfields.append((fname, BField._ctype)) + bfield_types[fname] = BField + else: + cfields.append((fname, BField._ctype, bitsize)) + bfield_types[fname] = Ellipsis + if sflags & 8: + struct_or_union._pack_ = 1 + elif pack: + struct_or_union._pack_ = pack + struct_or_union._fields_ = cfields + CTypesStructOrUnion._bfield_types = bfield_types + # + @staticmethod + def _create_ctype_obj(init): + result = struct_or_union() + if init is not None: + initialize(result, init) + return result + CTypesStructOrUnion._create_ctype_obj = _create_ctype_obj + # + def initialize(blob, init): + if is_union: + if len(init) > 1: + raise ValueError("union initializer: %d items given, but " + "only one supported (use a dict if needed)" + % (len(init),)) + if not isinstance(init, dict): + if isinstance(init, (bytes, unicode)): + raise TypeError("union initializer: got a str") + init = tuple(init) + if len(init) > len(fnames): + raise ValueError("too many values for %s initializer" % + CTypesStructOrUnion._get_c_name()) + init = dict(zip(fnames, init)) + addr = ctypes.addressof(blob) + for fname, value in init.items(): + BField, bitsize = name2fieldtype[fname] + assert bitsize < 0, \ + "not implemented: initializer with bit fields" + offset = CTypesStructOrUnion._offsetof(fname) + PTR = ctypes.POINTER(BField._ctype) + p = ctypes.cast(addr + offset, PTR) + BField._initialize(p.contents, value) + is_union = CTypesStructOrUnion._kind == 'union' + name2fieldtype = dict(zip(fnames, zip(btypes, bitfields))) + # + for fname, BField, bitsize in fields: + if fname == '': + raise NotImplementedError("nested anonymous structs/unions") + if hasattr(CTypesStructOrUnion, fname): + raise ValueError("the field name %r conflicts in " + "the ctypes backend" % fname) + if bitsize < 0: + def getter(self, fname=fname, BField=BField, + offset=CTypesStructOrUnion._offsetof(fname), + PTR=ctypes.POINTER(BField._ctype)): + addr = ctypes.addressof(self._blob) + p = ctypes.cast(addr + offset, PTR) + return BField._from_ctypes(p.contents) + def setter(self, value, fname=fname, BField=BField): + setattr(self._blob, fname, BField._to_ctypes(value)) + # + if issubclass(BField, CTypesGenericArray): + setter = None + if BField._declared_length == 0: + def getter(self, fname=fname, BFieldPtr=BField._CTPtr, + offset=CTypesStructOrUnion._offsetof(fname), + PTR=ctypes.POINTER(BField._ctype)): + addr = ctypes.addressof(self._blob) + p = ctypes.cast(addr + offset, PTR) + return BFieldPtr._from_ctypes(p) + # + else: + def getter(self, fname=fname, BField=BField): + return BField._from_ctypes(getattr(self._blob, fname)) + def setter(self, value, fname=fname, BField=BField): + # xxx obscure workaround + value = BField._to_ctypes(value) + oldvalue = getattr(self._blob, fname) + setattr(self._blob, fname, value) + if value != getattr(self._blob, fname): + setattr(self._blob, fname, oldvalue) + raise OverflowError("value too large for bitfield") + setattr(CTypesStructOrUnion, fname, property(getter, setter)) + # + CTypesPtr = self.ffi._get_cached_btype(model.PointerType(tp)) + for fname in fnames: + if hasattr(CTypesPtr, fname): + raise ValueError("the field name %r conflicts in " + "the ctypes backend" % fname) + def getter(self, fname=fname): + return getattr(self[0], fname) + def setter(self, value, fname=fname): + setattr(self[0], fname, value) + setattr(CTypesPtr, fname, property(getter, setter)) + + def new_function_type(self, BArgs, BResult, has_varargs): + nameargs = [BArg._get_c_name() for BArg in BArgs] + if has_varargs: + nameargs.append('...') + nameargs = ', '.join(nameargs) + # + class CTypesFunctionPtr(CTypesGenericPtr): + __slots__ = ['_own_callback', '_name'] + _ctype = ctypes.CFUNCTYPE(getattr(BResult, '_ctype', None), + *[BArg._ctype for BArg in BArgs], + use_errno=True) + _reftypename = BResult._get_c_name('(* &)(%s)' % (nameargs,)) + + def __init__(self, init, error=None): + # create a callback to the Python callable init() + import traceback + assert not has_varargs, "varargs not supported for callbacks" + if getattr(BResult, '_ctype', None) is not None: + error = BResult._from_ctypes( + BResult._create_ctype_obj(error)) + else: + error = None + def callback(*args): + args2 = [] + for arg, BArg in zip(args, BArgs): + args2.append(BArg._from_ctypes(arg)) + try: + res2 = init(*args2) + res2 = BResult._to_ctypes(res2) + except: + traceback.print_exc() + res2 = error + if issubclass(BResult, CTypesGenericPtr): + if res2: + res2 = ctypes.cast(res2, ctypes.c_void_p).value + # .value: http://bugs.python.org/issue1574593 + else: + res2 = None + #print repr(res2) + return res2 + if issubclass(BResult, CTypesGenericPtr): + # The only pointers callbacks can return are void*s: + # http://bugs.python.org/issue5710 + callback_ctype = ctypes.CFUNCTYPE( + ctypes.c_void_p, + *[BArg._ctype for BArg in BArgs], + use_errno=True) + else: + callback_ctype = CTypesFunctionPtr._ctype + self._as_ctype_ptr = callback_ctype(callback) + self._address = ctypes.cast(self._as_ctype_ptr, + ctypes.c_void_p).value + self._own_callback = init + + @staticmethod + def _initialize(ctypes_ptr, value): + if value: + raise NotImplementedError("ctypes backend: not supported: " + "initializers for function pointers") + + def __repr__(self): + c_name = getattr(self, '_name', None) + if c_name: + i = self._reftypename.index('(* &)') + if self._reftypename[i-1] not in ' )*': + c_name = ' ' + c_name + c_name = self._reftypename.replace('(* &)', c_name) + return CTypesData.__repr__(self, c_name) + + def _get_own_repr(self): + if getattr(self, '_own_callback', None) is not None: + return 'calling %r' % (self._own_callback,) + return super(CTypesFunctionPtr, self)._get_own_repr() + + def __call__(self, *args): + if has_varargs: + assert len(args) >= len(BArgs) + extraargs = args[len(BArgs):] + args = args[:len(BArgs)] + else: + assert len(args) == len(BArgs) + ctypes_args = [] + for arg, BArg in zip(args, BArgs): + ctypes_args.append(BArg._arg_to_ctypes(arg)) + if has_varargs: + for i, arg in enumerate(extraargs): + if arg is None: + ctypes_args.append(ctypes.c_void_p(0)) # NULL + continue + if not isinstance(arg, CTypesData): + raise TypeError( + "argument %d passed in the variadic part " + "needs to be a cdata object (got %s)" % + (1 + len(BArgs) + i, type(arg).__name__)) + ctypes_args.append(arg._arg_to_ctypes(arg)) + result = self._as_ctype_ptr(*ctypes_args) + return BResult._from_ctypes(result) + # + CTypesFunctionPtr._fix_class() + return CTypesFunctionPtr + + def new_enum_type(self, name, enumerators, enumvalues, CTypesInt): + assert isinstance(name, str) + reverse_mapping = dict(zip(reversed(enumvalues), + reversed(enumerators))) + # + class CTypesEnum(CTypesInt): + __slots__ = [] + _reftypename = '%s &' % name + + def _get_own_repr(self): + value = self._value + try: + return '%d: %s' % (value, reverse_mapping[value]) + except KeyError: + return str(value) + + def _to_string(self, maxlen): + value = self._value + try: + return reverse_mapping[value] + except KeyError: + return str(value) + # + CTypesEnum._fix_class() + return CTypesEnum + + def get_errno(self): + return ctypes.get_errno() + + def set_errno(self, value): + ctypes.set_errno(value) + + def string(self, b, maxlen=-1): + return b._to_string(maxlen) + + def buffer(self, bptr, size=-1): + raise NotImplementedError("buffer() with ctypes backend") + + def sizeof(self, cdata_or_BType): + if isinstance(cdata_or_BType, CTypesData): + return cdata_or_BType._get_size_of_instance() + else: + assert issubclass(cdata_or_BType, CTypesData) + return cdata_or_BType._get_size() + + def alignof(self, BType): + assert issubclass(BType, CTypesData) + return BType._alignment() + + def newp(self, BType, source): + if not issubclass(BType, CTypesData): + raise TypeError + return BType._newp(source) + + def cast(self, BType, source): + return BType._cast_from(source) + + def callback(self, BType, source, error, onerror): + assert onerror is None # XXX not implemented + return BType(source, error) + + _weakref_cache_ref = None + + def gcp(self, cdata, destructor, size=0): + if self._weakref_cache_ref is None: + import weakref + class MyRef(weakref.ref): + def __eq__(self, other): + myref = self() + return self is other or ( + myref is not None and myref is other()) + def __ne__(self, other): + return not (self == other) + def __hash__(self): + try: + return self._hash + except AttributeError: + self._hash = hash(self()) + return self._hash + self._weakref_cache_ref = {}, MyRef + weak_cache, MyRef = self._weakref_cache_ref + + if destructor is None: + try: + del weak_cache[MyRef(cdata)] + except KeyError: + raise TypeError("Can remove destructor only on a object " + "previously returned by ffi.gc()") + return None + + def remove(k): + cdata, destructor = weak_cache.pop(k, (None, None)) + if destructor is not None: + destructor(cdata) + + new_cdata = self.cast(self.typeof(cdata), cdata) + assert new_cdata is not cdata + weak_cache[MyRef(new_cdata, remove)] = (cdata, destructor) + return new_cdata + + typeof = type + + def getcname(self, BType, replace_with): + return BType._get_c_name(replace_with) + + def typeoffsetof(self, BType, fieldname, num=0): + if isinstance(fieldname, str): + if num == 0 and issubclass(BType, CTypesGenericPtr): + BType = BType._BItem + if not issubclass(BType, CTypesBaseStructOrUnion): + raise TypeError("expected a struct or union ctype") + BField = BType._bfield_types[fieldname] + if BField is Ellipsis: + raise TypeError("not supported for bitfields") + return (BField, BType._offsetof(fieldname)) + elif isinstance(fieldname, (int, long)): + if issubclass(BType, CTypesGenericArray): + BType = BType._CTPtr + if not issubclass(BType, CTypesGenericPtr): + raise TypeError("expected an array or ptr ctype") + BItem = BType._BItem + offset = BItem._get_size() * fieldname + if offset > sys.maxsize: + raise OverflowError + return (BItem, offset) + else: + raise TypeError(type(fieldname)) + + def rawaddressof(self, BTypePtr, cdata, offset=None): + if isinstance(cdata, CTypesBaseStructOrUnion): + ptr = ctypes.pointer(type(cdata)._to_ctypes(cdata)) + elif isinstance(cdata, CTypesGenericPtr): + if offset is None or not issubclass(type(cdata)._BItem, + CTypesBaseStructOrUnion): + raise TypeError("unexpected cdata type") + ptr = type(cdata)._to_ctypes(cdata) + elif isinstance(cdata, CTypesGenericArray): + ptr = type(cdata)._to_ctypes(cdata) + else: + raise TypeError("expected a ") + if offset: + ptr = ctypes.cast( + ctypes.c_void_p( + ctypes.cast(ptr, ctypes.c_void_p).value + offset), + type(ptr)) + return BTypePtr._from_ctypes(ptr) + + +class CTypesLibrary(object): + + def __init__(self, backend, cdll): + self.backend = backend + self.cdll = cdll + + def load_function(self, BType, name): + c_func = getattr(self.cdll, name) + funcobj = BType._from_ctypes(c_func) + funcobj._name = name + return funcobj + + def read_variable(self, BType, name): + try: + ctypes_obj = BType._ctype.in_dll(self.cdll, name) + except AttributeError as e: + raise NotImplementedError(e) + return BType._from_ctypes(ctypes_obj) + + def write_variable(self, BType, name, value): + new_ctypes_obj = BType._to_ctypes(value) + ctypes_obj = BType._ctype.in_dll(self.cdll, name) + ctypes.memmove(ctypes.addressof(ctypes_obj), + ctypes.addressof(new_ctypes_obj), + ctypes.sizeof(BType._ctype)) diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/cffi/cffi_opcode.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/cffi/cffi_opcode.py new file mode 100644 index 00000000..a0df98d1 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/cffi/cffi_opcode.py @@ -0,0 +1,187 @@ +from .error import VerificationError + +class CffiOp(object): + def __init__(self, op, arg): + self.op = op + self.arg = arg + + def as_c_expr(self): + if self.op is None: + assert isinstance(self.arg, str) + return '(_cffi_opcode_t)(%s)' % (self.arg,) + classname = CLASS_NAME[self.op] + return '_CFFI_OP(_CFFI_OP_%s, %s)' % (classname, self.arg) + + def as_python_bytes(self): + if self.op is None and self.arg.isdigit(): + value = int(self.arg) # non-negative: '-' not in self.arg + if value >= 2**31: + raise OverflowError("cannot emit %r: limited to 2**31-1" + % (self.arg,)) + return format_four_bytes(value) + if isinstance(self.arg, str): + raise VerificationError("cannot emit to Python: %r" % (self.arg,)) + return format_four_bytes((self.arg << 8) | self.op) + + def __str__(self): + classname = CLASS_NAME.get(self.op, self.op) + return '(%s %s)' % (classname, self.arg) + +def format_four_bytes(num): + return '\\x%02X\\x%02X\\x%02X\\x%02X' % ( + (num >> 24) & 0xFF, + (num >> 16) & 0xFF, + (num >> 8) & 0xFF, + (num ) & 0xFF) + +OP_PRIMITIVE = 1 +OP_POINTER = 3 +OP_ARRAY = 5 +OP_OPEN_ARRAY = 7 +OP_STRUCT_UNION = 9 +OP_ENUM = 11 +OP_FUNCTION = 13 +OP_FUNCTION_END = 15 +OP_NOOP = 17 +OP_BITFIELD = 19 +OP_TYPENAME = 21 +OP_CPYTHON_BLTN_V = 23 # varargs +OP_CPYTHON_BLTN_N = 25 # noargs +OP_CPYTHON_BLTN_O = 27 # O (i.e. a single arg) +OP_CONSTANT = 29 +OP_CONSTANT_INT = 31 +OP_GLOBAL_VAR = 33 +OP_DLOPEN_FUNC = 35 +OP_DLOPEN_CONST = 37 +OP_GLOBAL_VAR_F = 39 +OP_EXTERN_PYTHON = 41 + +PRIM_VOID = 0 +PRIM_BOOL = 1 +PRIM_CHAR = 2 +PRIM_SCHAR = 3 +PRIM_UCHAR = 4 +PRIM_SHORT = 5 +PRIM_USHORT = 6 +PRIM_INT = 7 +PRIM_UINT = 8 +PRIM_LONG = 9 +PRIM_ULONG = 10 +PRIM_LONGLONG = 11 +PRIM_ULONGLONG = 12 +PRIM_FLOAT = 13 +PRIM_DOUBLE = 14 +PRIM_LONGDOUBLE = 15 + +PRIM_WCHAR = 16 +PRIM_INT8 = 17 +PRIM_UINT8 = 18 +PRIM_INT16 = 19 +PRIM_UINT16 = 20 +PRIM_INT32 = 21 +PRIM_UINT32 = 22 +PRIM_INT64 = 23 +PRIM_UINT64 = 24 +PRIM_INTPTR = 25 +PRIM_UINTPTR = 26 +PRIM_PTRDIFF = 27 +PRIM_SIZE = 28 +PRIM_SSIZE = 29 +PRIM_INT_LEAST8 = 30 +PRIM_UINT_LEAST8 = 31 +PRIM_INT_LEAST16 = 32 +PRIM_UINT_LEAST16 = 33 +PRIM_INT_LEAST32 = 34 +PRIM_UINT_LEAST32 = 35 +PRIM_INT_LEAST64 = 36 +PRIM_UINT_LEAST64 = 37 +PRIM_INT_FAST8 = 38 +PRIM_UINT_FAST8 = 39 +PRIM_INT_FAST16 = 40 +PRIM_UINT_FAST16 = 41 +PRIM_INT_FAST32 = 42 +PRIM_UINT_FAST32 = 43 +PRIM_INT_FAST64 = 44 +PRIM_UINT_FAST64 = 45 +PRIM_INTMAX = 46 +PRIM_UINTMAX = 47 +PRIM_FLOATCOMPLEX = 48 +PRIM_DOUBLECOMPLEX = 49 +PRIM_CHAR16 = 50 +PRIM_CHAR32 = 51 + +_NUM_PRIM = 52 +_UNKNOWN_PRIM = -1 +_UNKNOWN_FLOAT_PRIM = -2 +_UNKNOWN_LONG_DOUBLE = -3 + +_IO_FILE_STRUCT = -1 + +PRIMITIVE_TO_INDEX = { + 'char': PRIM_CHAR, + 'short': PRIM_SHORT, + 'int': PRIM_INT, + 'long': PRIM_LONG, + 'long long': PRIM_LONGLONG, + 'signed char': PRIM_SCHAR, + 'unsigned char': PRIM_UCHAR, + 'unsigned short': PRIM_USHORT, + 'unsigned int': PRIM_UINT, + 'unsigned long': PRIM_ULONG, + 'unsigned long long': PRIM_ULONGLONG, + 'float': PRIM_FLOAT, + 'double': PRIM_DOUBLE, + 'long double': PRIM_LONGDOUBLE, + 'float _Complex': PRIM_FLOATCOMPLEX, + 'double _Complex': PRIM_DOUBLECOMPLEX, + '_Bool': PRIM_BOOL, + 'wchar_t': PRIM_WCHAR, + 'char16_t': PRIM_CHAR16, + 'char32_t': PRIM_CHAR32, + 'int8_t': PRIM_INT8, + 'uint8_t': PRIM_UINT8, + 'int16_t': PRIM_INT16, + 'uint16_t': PRIM_UINT16, + 'int32_t': PRIM_INT32, + 'uint32_t': PRIM_UINT32, + 'int64_t': PRIM_INT64, + 'uint64_t': PRIM_UINT64, + 'intptr_t': PRIM_INTPTR, + 'uintptr_t': PRIM_UINTPTR, + 'ptrdiff_t': PRIM_PTRDIFF, + 'size_t': PRIM_SIZE, + 'ssize_t': PRIM_SSIZE, + 'int_least8_t': PRIM_INT_LEAST8, + 'uint_least8_t': PRIM_UINT_LEAST8, + 'int_least16_t': PRIM_INT_LEAST16, + 'uint_least16_t': PRIM_UINT_LEAST16, + 'int_least32_t': PRIM_INT_LEAST32, + 'uint_least32_t': PRIM_UINT_LEAST32, + 'int_least64_t': PRIM_INT_LEAST64, + 'uint_least64_t': PRIM_UINT_LEAST64, + 'int_fast8_t': PRIM_INT_FAST8, + 'uint_fast8_t': PRIM_UINT_FAST8, + 'int_fast16_t': PRIM_INT_FAST16, + 'uint_fast16_t': PRIM_UINT_FAST16, + 'int_fast32_t': PRIM_INT_FAST32, + 'uint_fast32_t': PRIM_UINT_FAST32, + 'int_fast64_t': PRIM_INT_FAST64, + 'uint_fast64_t': PRIM_UINT_FAST64, + 'intmax_t': PRIM_INTMAX, + 'uintmax_t': PRIM_UINTMAX, + } + +F_UNION = 0x01 +F_CHECK_FIELDS = 0x02 +F_PACKED = 0x04 +F_EXTERNAL = 0x08 +F_OPAQUE = 0x10 + +G_FLAGS = dict([('_CFFI_' + _key, globals()[_key]) + for _key in ['F_UNION', 'F_CHECK_FIELDS', 'F_PACKED', + 'F_EXTERNAL', 'F_OPAQUE']]) + +CLASS_NAME = {} +for _name, _value in list(globals().items()): + if _name.startswith('OP_') and isinstance(_value, int): + CLASS_NAME[_value] = _name[3:] diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/cffi/commontypes.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/cffi/commontypes.py new file mode 100644 index 00000000..8ec97c75 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/cffi/commontypes.py @@ -0,0 +1,80 @@ +import sys +from . import model +from .error import FFIError + + +COMMON_TYPES = {} + +try: + # fetch "bool" and all simple Windows types + from _cffi_backend import _get_common_types + _get_common_types(COMMON_TYPES) +except ImportError: + pass + +COMMON_TYPES['FILE'] = model.unknown_type('FILE', '_IO_FILE') +COMMON_TYPES['bool'] = '_Bool' # in case we got ImportError above + +for _type in model.PrimitiveType.ALL_PRIMITIVE_TYPES: + if _type.endswith('_t'): + COMMON_TYPES[_type] = _type +del _type + +_CACHE = {} + +def resolve_common_type(parser, commontype): + try: + return _CACHE[commontype] + except KeyError: + cdecl = COMMON_TYPES.get(commontype, commontype) + if not isinstance(cdecl, str): + result, quals = cdecl, 0 # cdecl is already a BaseType + elif cdecl in model.PrimitiveType.ALL_PRIMITIVE_TYPES: + result, quals = model.PrimitiveType(cdecl), 0 + elif cdecl == 'set-unicode-needed': + raise FFIError("The Windows type %r is only available after " + "you call ffi.set_unicode()" % (commontype,)) + else: + if commontype == cdecl: + raise FFIError( + "Unsupported type: %r. Please look at " + "http://cffi.readthedocs.io/en/latest/cdef.html#ffi-cdef-limitations " + "and file an issue if you think this type should really " + "be supported." % (commontype,)) + result, quals = parser.parse_type_and_quals(cdecl) # recursive + + assert isinstance(result, model.BaseTypeByIdentity) + _CACHE[commontype] = result, quals + return result, quals + + +# ____________________________________________________________ +# extra types for Windows (most of them are in commontypes.c) + + +def win_common_types(): + return { + "UNICODE_STRING": model.StructType( + "_UNICODE_STRING", + ["Length", + "MaximumLength", + "Buffer"], + [model.PrimitiveType("unsigned short"), + model.PrimitiveType("unsigned short"), + model.PointerType(model.PrimitiveType("wchar_t"))], + [-1, -1, -1]), + "PUNICODE_STRING": "UNICODE_STRING *", + "PCUNICODE_STRING": "const UNICODE_STRING *", + + "TBYTE": "set-unicode-needed", + "TCHAR": "set-unicode-needed", + "LPCTSTR": "set-unicode-needed", + "PCTSTR": "set-unicode-needed", + "LPTSTR": "set-unicode-needed", + "PTSTR": "set-unicode-needed", + "PTBYTE": "set-unicode-needed", + "PTCHAR": "set-unicode-needed", + } + +if sys.platform == 'win32': + COMMON_TYPES.update(win_common_types()) diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/cffi/cparser.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/cffi/cparser.py new file mode 100644 index 00000000..262fd765 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/cffi/cparser.py @@ -0,0 +1,931 @@ +from . import model +from .commontypes import COMMON_TYPES, resolve_common_type +from .error import FFIError, CDefError +try: + from . import _pycparser as pycparser +except ImportError: + import pycparser +import weakref, re, sys + +try: + if sys.version_info < (3,): + import thread as _thread + else: + import _thread + lock = _thread.allocate_lock() +except ImportError: + lock = None + +def _workaround_for_static_import_finders(): + # Issue #392: packaging tools like cx_Freeze can not find these + # because pycparser uses exec dynamic import. This is an obscure + # workaround. This function is never called. + import pycparser.yacctab + import pycparser.lextab + +CDEF_SOURCE_STRING = "" +_r_comment = re.compile(r"/\*.*?\*/|//([^\n\\]|\\.)*?$", + re.DOTALL | re.MULTILINE) +_r_define = re.compile(r"^\s*#\s*define\s+([A-Za-z_][A-Za-z_0-9]*)" + r"\b((?:[^\n\\]|\\.)*?)$", + re.DOTALL | re.MULTILINE) +_r_partial_enum = re.compile(r"=\s*\.\.\.\s*[,}]|\.\.\.\s*\}") +_r_enum_dotdotdot = re.compile(r"__dotdotdot\d+__$") +_r_partial_array = re.compile(r"\[\s*\.\.\.\s*\]") +_r_words = re.compile(r"\w+|\S") +_parser_cache = None +_r_int_literal = re.compile(r"-?0?x?[0-9a-f]+[lu]*$", re.IGNORECASE) +_r_stdcall1 = re.compile(r"\b(__stdcall|WINAPI)\b") +_r_stdcall2 = re.compile(r"[(]\s*(__stdcall|WINAPI)\b") +_r_cdecl = re.compile(r"\b__cdecl\b") +_r_extern_python = re.compile(r'\bextern\s*"' + r'(Python|Python\s*\+\s*C|C\s*\+\s*Python)"\s*.') +_r_star_const_space = re.compile( # matches "* const " + r"[*]\s*((const|volatile|restrict)\b\s*)+") +_r_int_dotdotdot = re.compile(r"(\b(int|long|short|signed|unsigned|char)\s*)+" + r"\.\.\.") +_r_float_dotdotdot = re.compile(r"\b(double|float)\s*\.\.\.") + +def _get_parser(): + global _parser_cache + if _parser_cache is None: + _parser_cache = pycparser.CParser() + return _parser_cache + +def _workaround_for_old_pycparser(csource): + # Workaround for a pycparser issue (fixed between pycparser 2.10 and + # 2.14): "char*const***" gives us a wrong syntax tree, the same as + # for "char***(*const)". This means we can't tell the difference + # afterwards. But "char(*const(***))" gives us the right syntax + # tree. The issue only occurs if there are several stars in + # sequence with no parenthesis inbetween, just possibly qualifiers. + # Attempt to fix it by adding some parentheses in the source: each + # time we see "* const" or "* const *", we add an opening + # parenthesis before each star---the hard part is figuring out where + # to close them. + parts = [] + while True: + match = _r_star_const_space.search(csource) + if not match: + break + #print repr(''.join(parts)+csource), '=>', + parts.append(csource[:match.start()]) + parts.append('('); closing = ')' + parts.append(match.group()) # e.g. "* const " + endpos = match.end() + if csource.startswith('*', endpos): + parts.append('('); closing += ')' + level = 0 + i = endpos + while i < len(csource): + c = csource[i] + if c == '(': + level += 1 + elif c == ')': + if level == 0: + break + level -= 1 + elif c in ',;=': + if level == 0: + break + i += 1 + csource = csource[endpos:i] + closing + csource[i:] + #print repr(''.join(parts)+csource) + parts.append(csource) + return ''.join(parts) + +def _preprocess_extern_python(csource): + # input: `extern "Python" int foo(int);` or + # `extern "Python" { int foo(int); }` + # output: + # void __cffi_extern_python_start; + # int foo(int); + # void __cffi_extern_python_stop; + # + # input: `extern "Python+C" int foo(int);` + # output: + # void __cffi_extern_python_plus_c_start; + # int foo(int); + # void __cffi_extern_python_stop; + parts = [] + while True: + match = _r_extern_python.search(csource) + if not match: + break + endpos = match.end() - 1 + #print + #print ''.join(parts)+csource + #print '=>' + parts.append(csource[:match.start()]) + if 'C' in match.group(1): + parts.append('void __cffi_extern_python_plus_c_start; ') + else: + parts.append('void __cffi_extern_python_start; ') + if csource[endpos] == '{': + # grouping variant + closing = csource.find('}', endpos) + if closing < 0: + raise CDefError("'extern \"Python\" {': no '}' found") + if csource.find('{', endpos + 1, closing) >= 0: + raise NotImplementedError("cannot use { } inside a block " + "'extern \"Python\" { ... }'") + parts.append(csource[endpos+1:closing]) + csource = csource[closing+1:] + else: + # non-grouping variant + semicolon = csource.find(';', endpos) + if semicolon < 0: + raise CDefError("'extern \"Python\": no ';' found") + parts.append(csource[endpos:semicolon+1]) + csource = csource[semicolon+1:] + parts.append(' void __cffi_extern_python_stop;') + #print ''.join(parts)+csource + #print + parts.append(csource) + return ''.join(parts) + +def _warn_for_string_literal(csource): + if '"' in csource: + import warnings + warnings.warn("String literal found in cdef() or type source. " + "String literals are ignored here, but you should " + "remove them anyway because some character sequences " + "confuse pre-parsing.") + +def _preprocess(csource): + # Remove comments. NOTE: this only work because the cdef() section + # should not contain any string literal! + csource = _r_comment.sub(' ', csource) + # Remove the "#define FOO x" lines + macros = {} + for match in _r_define.finditer(csource): + macroname, macrovalue = match.groups() + macrovalue = macrovalue.replace('\\\n', '').strip() + macros[macroname] = macrovalue + csource = _r_define.sub('', csource) + # + if pycparser.__version__ < '2.14': + csource = _workaround_for_old_pycparser(csource) + # + # BIG HACK: replace WINAPI or __stdcall with "volatile const". + # It doesn't make sense for the return type of a function to be + # "volatile volatile const", so we abuse it to detect __stdcall... + # Hack number 2 is that "int(volatile *fptr)();" is not valid C + # syntax, so we place the "volatile" before the opening parenthesis. + csource = _r_stdcall2.sub(' volatile volatile const(', csource) + csource = _r_stdcall1.sub(' volatile volatile const ', csource) + csource = _r_cdecl.sub(' ', csource) + # + # Replace `extern "Python"` with start/end markers + csource = _preprocess_extern_python(csource) + # + # Now there should not be any string literal left; warn if we get one + _warn_for_string_literal(csource) + # + # Replace "[...]" with "[__dotdotdotarray__]" + csource = _r_partial_array.sub('[__dotdotdotarray__]', csource) + # + # Replace "...}" with "__dotdotdotNUM__}". This construction should + # occur only at the end of enums; at the end of structs we have "...;}" + # and at the end of vararg functions "...);". Also replace "=...[,}]" + # with ",__dotdotdotNUM__[,}]": this occurs in the enums too, when + # giving an unknown value. + matches = list(_r_partial_enum.finditer(csource)) + for number, match in enumerate(reversed(matches)): + p = match.start() + if csource[p] == '=': + p2 = csource.find('...', p, match.end()) + assert p2 > p + csource = '%s,__dotdotdot%d__ %s' % (csource[:p], number, + csource[p2+3:]) + else: + assert csource[p:p+3] == '...' + csource = '%s __dotdotdot%d__ %s' % (csource[:p], number, + csource[p+3:]) + # Replace "int ..." or "unsigned long int..." with "__dotdotdotint__" + csource = _r_int_dotdotdot.sub(' __dotdotdotint__ ', csource) + # Replace "float ..." or "double..." with "__dotdotdotfloat__" + csource = _r_float_dotdotdot.sub(' __dotdotdotfloat__ ', csource) + # Replace all remaining "..." with the same name, "__dotdotdot__", + # which is declared with a typedef for the purpose of C parsing. + return csource.replace('...', ' __dotdotdot__ '), macros + +def _common_type_names(csource): + # Look in the source for what looks like usages of types from the + # list of common types. A "usage" is approximated here as the + # appearance of the word, minus a "definition" of the type, which + # is the last word in a "typedef" statement. Approximative only + # but should be fine for all the common types. + look_for_words = set(COMMON_TYPES) + look_for_words.add(';') + look_for_words.add(',') + look_for_words.add('(') + look_for_words.add(')') + look_for_words.add('typedef') + words_used = set() + is_typedef = False + paren = 0 + previous_word = '' + for word in _r_words.findall(csource): + if word in look_for_words: + if word == ';': + if is_typedef: + words_used.discard(previous_word) + look_for_words.discard(previous_word) + is_typedef = False + elif word == 'typedef': + is_typedef = True + paren = 0 + elif word == '(': + paren += 1 + elif word == ')': + paren -= 1 + elif word == ',': + if is_typedef and paren == 0: + words_used.discard(previous_word) + look_for_words.discard(previous_word) + else: # word in COMMON_TYPES + words_used.add(word) + previous_word = word + return words_used + + +class Parser(object): + + def __init__(self): + self._declarations = {} + self._included_declarations = set() + self._anonymous_counter = 0 + self._structnode2type = weakref.WeakKeyDictionary() + self._options = {} + self._int_constants = {} + self._recomplete = [] + self._uses_new_feature = None + + def _parse(self, csource): + csource, macros = _preprocess(csource) + # XXX: for more efficiency we would need to poke into the + # internals of CParser... the following registers the + # typedefs, because their presence or absence influences the + # parsing itself (but what they are typedef'ed to plays no role) + ctn = _common_type_names(csource) + typenames = [] + for name in sorted(self._declarations): + if name.startswith('typedef '): + name = name[8:] + typenames.append(name) + ctn.discard(name) + typenames += sorted(ctn) + # + csourcelines = [] + csourcelines.append('# 1 ""') + for typename in typenames: + csourcelines.append('typedef int %s;' % typename) + csourcelines.append('typedef int __dotdotdotint__, __dotdotdotfloat__,' + ' __dotdotdot__;') + # this forces pycparser to consider the following in the file + # called from line 1 + csourcelines.append('# 1 "%s"' % (CDEF_SOURCE_STRING,)) + csourcelines.append(csource) + fullcsource = '\n'.join(csourcelines) + if lock is not None: + lock.acquire() # pycparser is not thread-safe... + try: + ast = _get_parser().parse(fullcsource) + except pycparser.c_parser.ParseError as e: + self.convert_pycparser_error(e, csource) + finally: + if lock is not None: + lock.release() + # csource will be used to find buggy source text + return ast, macros, csource + + def _convert_pycparser_error(self, e, csource): + # xxx look for ":NUM:" at the start of str(e) + # and interpret that as a line number. This will not work if + # the user gives explicit ``# NUM "FILE"`` directives. + line = None + msg = str(e) + match = re.match(r"%s:(\d+):" % (CDEF_SOURCE_STRING,), msg) + if match: + linenum = int(match.group(1), 10) + csourcelines = csource.splitlines() + if 1 <= linenum <= len(csourcelines): + line = csourcelines[linenum-1] + return line + + def convert_pycparser_error(self, e, csource): + line = self._convert_pycparser_error(e, csource) + + msg = str(e) + if line: + msg = 'cannot parse "%s"\n%s' % (line.strip(), msg) + else: + msg = 'parse error\n%s' % (msg,) + raise CDefError(msg) + + def parse(self, csource, override=False, packed=False, pack=None, + dllexport=False): + if packed: + if packed != True: + raise ValueError("'packed' should be False or True; use " + "'pack' to give another value") + if pack: + raise ValueError("cannot give both 'pack' and 'packed'") + pack = 1 + elif pack: + if pack & (pack - 1): + raise ValueError("'pack' must be a power of two, not %r" % + (pack,)) + else: + pack = 0 + prev_options = self._options + try: + self._options = {'override': override, + 'packed': pack, + 'dllexport': dllexport} + self._internal_parse(csource) + finally: + self._options = prev_options + + def _internal_parse(self, csource): + ast, macros, csource = self._parse(csource) + # add the macros + self._process_macros(macros) + # find the first "__dotdotdot__" and use that as a separator + # between the repeated typedefs and the real csource + iterator = iter(ast.ext) + for decl in iterator: + if decl.name == '__dotdotdot__': + break + else: + assert 0 + current_decl = None + # + try: + self._inside_extern_python = '__cffi_extern_python_stop' + for decl in iterator: + current_decl = decl + if isinstance(decl, pycparser.c_ast.Decl): + self._parse_decl(decl) + elif isinstance(decl, pycparser.c_ast.Typedef): + if not decl.name: + raise CDefError("typedef does not declare any name", + decl) + quals = 0 + if (isinstance(decl.type.type, pycparser.c_ast.IdentifierType) and + decl.type.type.names[-1].startswith('__dotdotdot')): + realtype = self._get_unknown_type(decl) + elif (isinstance(decl.type, pycparser.c_ast.PtrDecl) and + isinstance(decl.type.type, pycparser.c_ast.TypeDecl) and + isinstance(decl.type.type.type, + pycparser.c_ast.IdentifierType) and + decl.type.type.type.names[-1].startswith('__dotdotdot')): + realtype = self._get_unknown_ptr_type(decl) + else: + realtype, quals = self._get_type_and_quals( + decl.type, name=decl.name, partial_length_ok=True) + self._declare('typedef ' + decl.name, realtype, quals=quals) + elif decl.__class__.__name__ == 'Pragma': + pass # skip pragma, only in pycparser 2.15 + else: + raise CDefError("unexpected <%s>: this construct is valid " + "C but not valid in cdef()" % + decl.__class__.__name__, decl) + except CDefError as e: + if len(e.args) == 1: + e.args = e.args + (current_decl,) + raise + except FFIError as e: + msg = self._convert_pycparser_error(e, csource) + if msg: + e.args = (e.args[0] + "\n *** Err: %s" % msg,) + raise + + def _add_constants(self, key, val): + if key in self._int_constants: + if self._int_constants[key] == val: + return # ignore identical double declarations + raise FFIError( + "multiple declarations of constant: %s" % (key,)) + self._int_constants[key] = val + + def _add_integer_constant(self, name, int_str): + int_str = int_str.lower().rstrip("ul") + neg = int_str.startswith('-') + if neg: + int_str = int_str[1:] + # "010" is not valid oct in py3 + if (int_str.startswith("0") and int_str != '0' + and not int_str.startswith("0x")): + int_str = "0o" + int_str[1:] + pyvalue = int(int_str, 0) + if neg: + pyvalue = -pyvalue + self._add_constants(name, pyvalue) + self._declare('macro ' + name, pyvalue) + + def _process_macros(self, macros): + for key, value in macros.items(): + value = value.strip() + if _r_int_literal.match(value): + self._add_integer_constant(key, value) + elif value == '...': + self._declare('macro ' + key, value) + else: + raise CDefError( + 'only supports one of the following syntax:\n' + ' #define %s ... (literally dot-dot-dot)\n' + ' #define %s NUMBER (with NUMBER an integer' + ' constant, decimal/hex/octal)\n' + 'got:\n' + ' #define %s %s' + % (key, key, key, value)) + + def _declare_function(self, tp, quals, decl): + tp = self._get_type_pointer(tp, quals) + if self._options.get('dllexport'): + tag = 'dllexport_python ' + elif self._inside_extern_python == '__cffi_extern_python_start': + tag = 'extern_python ' + elif self._inside_extern_python == '__cffi_extern_python_plus_c_start': + tag = 'extern_python_plus_c ' + else: + tag = 'function ' + self._declare(tag + decl.name, tp) + + def _parse_decl(self, decl): + node = decl.type + if isinstance(node, pycparser.c_ast.FuncDecl): + tp, quals = self._get_type_and_quals(node, name=decl.name) + assert isinstance(tp, model.RawFunctionType) + self._declare_function(tp, quals, decl) + else: + if isinstance(node, pycparser.c_ast.Struct): + self._get_struct_union_enum_type('struct', node) + elif isinstance(node, pycparser.c_ast.Union): + self._get_struct_union_enum_type('union', node) + elif isinstance(node, pycparser.c_ast.Enum): + self._get_struct_union_enum_type('enum', node) + elif not decl.name: + raise CDefError("construct does not declare any variable", + decl) + # + if decl.name: + tp, quals = self._get_type_and_quals(node, + partial_length_ok=True) + if tp.is_raw_function: + self._declare_function(tp, quals, decl) + elif (tp.is_integer_type() and + hasattr(decl, 'init') and + hasattr(decl.init, 'value') and + _r_int_literal.match(decl.init.value)): + self._add_integer_constant(decl.name, decl.init.value) + elif (tp.is_integer_type() and + isinstance(decl.init, pycparser.c_ast.UnaryOp) and + decl.init.op == '-' and + hasattr(decl.init.expr, 'value') and + _r_int_literal.match(decl.init.expr.value)): + self._add_integer_constant(decl.name, + '-' + decl.init.expr.value) + elif (tp is model.void_type and + decl.name.startswith('__cffi_extern_python_')): + # hack: `extern "Python"` in the C source is replaced + # with "void __cffi_extern_python_start;" and + # "void __cffi_extern_python_stop;" + self._inside_extern_python = decl.name + else: + if self._inside_extern_python !='__cffi_extern_python_stop': + raise CDefError( + "cannot declare constants or " + "variables with 'extern \"Python\"'") + if (quals & model.Q_CONST) and not tp.is_array_type: + self._declare('constant ' + decl.name, tp, quals=quals) + else: + self._declare('variable ' + decl.name, tp, quals=quals) + + def parse_type(self, cdecl): + return self.parse_type_and_quals(cdecl)[0] + + def parse_type_and_quals(self, cdecl): + ast, macros = self._parse('void __dummy(\n%s\n);' % cdecl)[:2] + assert not macros + exprnode = ast.ext[-1].type.args.params[0] + if isinstance(exprnode, pycparser.c_ast.ID): + raise CDefError("unknown identifier '%s'" % (exprnode.name,)) + return self._get_type_and_quals(exprnode.type) + + def _declare(self, name, obj, included=False, quals=0): + if name in self._declarations: + prevobj, prevquals = self._declarations[name] + if prevobj is obj and prevquals == quals: + return + if not self._options.get('override'): + raise FFIError( + "multiple declarations of %s (for interactive usage, " + "try cdef(xx, override=True))" % (name,)) + assert '__dotdotdot__' not in name.split() + self._declarations[name] = (obj, quals) + if included: + self._included_declarations.add(obj) + + def _extract_quals(self, type): + quals = 0 + if isinstance(type, (pycparser.c_ast.TypeDecl, + pycparser.c_ast.PtrDecl)): + if 'const' in type.quals: + quals |= model.Q_CONST + if 'volatile' in type.quals: + quals |= model.Q_VOLATILE + if 'restrict' in type.quals: + quals |= model.Q_RESTRICT + return quals + + def _get_type_pointer(self, type, quals, declname=None): + if isinstance(type, model.RawFunctionType): + return type.as_function_pointer() + if (isinstance(type, model.StructOrUnionOrEnum) and + type.name.startswith('$') and type.name[1:].isdigit() and + type.forcename is None and declname is not None): + return model.NamedPointerType(type, declname, quals) + return model.PointerType(type, quals) + + def _get_type_and_quals(self, typenode, name=None, partial_length_ok=False): + # first, dereference typedefs, if we have it already parsed, we're good + if (isinstance(typenode, pycparser.c_ast.TypeDecl) and + isinstance(typenode.type, pycparser.c_ast.IdentifierType) and + len(typenode.type.names) == 1 and + ('typedef ' + typenode.type.names[0]) in self._declarations): + tp, quals = self._declarations['typedef ' + typenode.type.names[0]] + quals |= self._extract_quals(typenode) + return tp, quals + # + if isinstance(typenode, pycparser.c_ast.ArrayDecl): + # array type + if typenode.dim is None: + length = None + else: + length = self._parse_constant( + typenode.dim, partial_length_ok=partial_length_ok) + tp, quals = self._get_type_and_quals(typenode.type, + partial_length_ok=partial_length_ok) + return model.ArrayType(tp, length), quals + # + if isinstance(typenode, pycparser.c_ast.PtrDecl): + # pointer type + itemtype, itemquals = self._get_type_and_quals(typenode.type) + tp = self._get_type_pointer(itemtype, itemquals, declname=name) + quals = self._extract_quals(typenode) + return tp, quals + # + if isinstance(typenode, pycparser.c_ast.TypeDecl): + quals = self._extract_quals(typenode) + type = typenode.type + if isinstance(type, pycparser.c_ast.IdentifierType): + # assume a primitive type. get it from .names, but reduce + # synonyms to a single chosen combination + names = list(type.names) + if names != ['signed', 'char']: # keep this unmodified + prefixes = {} + while names: + name = names[0] + if name in ('short', 'long', 'signed', 'unsigned'): + prefixes[name] = prefixes.get(name, 0) + 1 + del names[0] + else: + break + # ignore the 'signed' prefix below, and reorder the others + newnames = [] + for prefix in ('unsigned', 'short', 'long'): + for i in range(prefixes.get(prefix, 0)): + newnames.append(prefix) + if not names: + names = ['int'] # implicitly + if names == ['int']: # but kill it if 'short' or 'long' + if 'short' in prefixes or 'long' in prefixes: + names = [] + names = newnames + names + ident = ' '.join(names) + if ident == 'void': + return model.void_type, quals + if ident == '__dotdotdot__': + raise FFIError(':%d: bad usage of "..."' % + typenode.coord.line) + tp0, quals0 = resolve_common_type(self, ident) + return tp0, (quals | quals0) + # + if isinstance(type, pycparser.c_ast.Struct): + # 'struct foobar' + tp = self._get_struct_union_enum_type('struct', type, name) + return tp, quals + # + if isinstance(type, pycparser.c_ast.Union): + # 'union foobar' + tp = self._get_struct_union_enum_type('union', type, name) + return tp, quals + # + if isinstance(type, pycparser.c_ast.Enum): + # 'enum foobar' + tp = self._get_struct_union_enum_type('enum', type, name) + return tp, quals + # + if isinstance(typenode, pycparser.c_ast.FuncDecl): + # a function type + return self._parse_function_type(typenode, name), 0 + # + # nested anonymous structs or unions end up here + if isinstance(typenode, pycparser.c_ast.Struct): + return self._get_struct_union_enum_type('struct', typenode, name, + nested=True), 0 + if isinstance(typenode, pycparser.c_ast.Union): + return self._get_struct_union_enum_type('union', typenode, name, + nested=True), 0 + # + raise FFIError(":%d: bad or unsupported type declaration" % + typenode.coord.line) + + def _parse_function_type(self, typenode, funcname=None): + params = list(getattr(typenode.args, 'params', [])) + for i, arg in enumerate(params): + if not hasattr(arg, 'type'): + raise CDefError("%s arg %d: unknown type '%s'" + " (if you meant to use the old C syntax of giving" + " untyped arguments, it is not supported)" + % (funcname or 'in expression', i + 1, + getattr(arg, 'name', '?'))) + ellipsis = ( + len(params) > 0 and + isinstance(params[-1].type, pycparser.c_ast.TypeDecl) and + isinstance(params[-1].type.type, + pycparser.c_ast.IdentifierType) and + params[-1].type.type.names == ['__dotdotdot__']) + if ellipsis: + params.pop() + if not params: + raise CDefError( + "%s: a function with only '(...)' as argument" + " is not correct C" % (funcname or 'in expression')) + args = [self._as_func_arg(*self._get_type_and_quals(argdeclnode.type)) + for argdeclnode in params] + if not ellipsis and args == [model.void_type]: + args = [] + result, quals = self._get_type_and_quals(typenode.type) + # the 'quals' on the result type are ignored. HACK: we absure them + # to detect __stdcall functions: we textually replace "__stdcall" + # with "volatile volatile const" above. + abi = None + if hasattr(typenode.type, 'quals'): # else, probable syntax error anyway + if typenode.type.quals[-3:] == ['volatile', 'volatile', 'const']: + abi = '__stdcall' + return model.RawFunctionType(tuple(args), result, ellipsis, abi) + + def _as_func_arg(self, type, quals): + if isinstance(type, model.ArrayType): + return model.PointerType(type.item, quals) + elif isinstance(type, model.RawFunctionType): + return type.as_function_pointer() + else: + return type + + def _get_struct_union_enum_type(self, kind, type, name=None, nested=False): + # First, a level of caching on the exact 'type' node of the AST. + # This is obscure, but needed because pycparser "unrolls" declarations + # such as "typedef struct { } foo_t, *foo_p" and we end up with + # an AST that is not a tree, but a DAG, with the "type" node of the + # two branches foo_t and foo_p of the trees being the same node. + # It's a bit silly but detecting "DAG-ness" in the AST tree seems + # to be the only way to distinguish this case from two independent + # structs. See test_struct_with_two_usages. + try: + return self._structnode2type[type] + except KeyError: + pass + # + # Note that this must handle parsing "struct foo" any number of + # times and always return the same StructType object. Additionally, + # one of these times (not necessarily the first), the fields of + # the struct can be specified with "struct foo { ...fields... }". + # If no name is given, then we have to create a new anonymous struct + # with no caching; in this case, the fields are either specified + # right now or never. + # + force_name = name + name = type.name + # + # get the type or create it if needed + if name is None: + # 'force_name' is used to guess a more readable name for + # anonymous structs, for the common case "typedef struct { } foo". + if force_name is not None: + explicit_name = '$%s' % force_name + else: + self._anonymous_counter += 1 + explicit_name = '$%d' % self._anonymous_counter + tp = None + else: + explicit_name = name + key = '%s %s' % (kind, name) + tp, _ = self._declarations.get(key, (None, None)) + # + if tp is None: + if kind == 'struct': + tp = model.StructType(explicit_name, None, None, None) + elif kind == 'union': + tp = model.UnionType(explicit_name, None, None, None) + elif kind == 'enum': + if explicit_name == '__dotdotdot__': + raise CDefError("Enums cannot be declared with ...") + tp = self._build_enum_type(explicit_name, type.values) + else: + raise AssertionError("kind = %r" % (kind,)) + if name is not None: + self._declare(key, tp) + else: + if kind == 'enum' and type.values is not None: + raise NotImplementedError( + "enum %s: the '{}' declaration should appear on the first " + "time the enum is mentioned, not later" % explicit_name) + if not tp.forcename: + tp.force_the_name(force_name) + if tp.forcename and '$' in tp.name: + self._declare('anonymous %s' % tp.forcename, tp) + # + self._structnode2type[type] = tp + # + # enums: done here + if kind == 'enum': + return tp + # + # is there a 'type.decls'? If yes, then this is the place in the + # C sources that declare the fields. If no, then just return the + # existing type, possibly still incomplete. + if type.decls is None: + return tp + # + if tp.fldnames is not None: + raise CDefError("duplicate declaration of struct %s" % name) + fldnames = [] + fldtypes = [] + fldbitsize = [] + fldquals = [] + for decl in type.decls: + if (isinstance(decl.type, pycparser.c_ast.IdentifierType) and + ''.join(decl.type.names) == '__dotdotdot__'): + # XXX pycparser is inconsistent: 'names' should be a list + # of strings, but is sometimes just one string. Use + # str.join() as a way to cope with both. + self._make_partial(tp, nested) + continue + if decl.bitsize is None: + bitsize = -1 + else: + bitsize = self._parse_constant(decl.bitsize) + self._partial_length = False + type, fqual = self._get_type_and_quals(decl.type, + partial_length_ok=True) + if self._partial_length: + self._make_partial(tp, nested) + if isinstance(type, model.StructType) and type.partial: + self._make_partial(tp, nested) + fldnames.append(decl.name or '') + fldtypes.append(type) + fldbitsize.append(bitsize) + fldquals.append(fqual) + tp.fldnames = tuple(fldnames) + tp.fldtypes = tuple(fldtypes) + tp.fldbitsize = tuple(fldbitsize) + tp.fldquals = tuple(fldquals) + if fldbitsize != [-1] * len(fldbitsize): + if isinstance(tp, model.StructType) and tp.partial: + raise NotImplementedError("%s: using both bitfields and '...;'" + % (tp,)) + tp.packed = self._options.get('packed') + if tp.completed: # must be re-completed: it is not opaque any more + tp.completed = 0 + self._recomplete.append(tp) + return tp + + def _make_partial(self, tp, nested): + if not isinstance(tp, model.StructOrUnion): + raise CDefError("%s cannot be partial" % (tp,)) + if not tp.has_c_name() and not nested: + raise NotImplementedError("%s is partial but has no C name" %(tp,)) + tp.partial = True + + def _parse_constant(self, exprnode, partial_length_ok=False): + # for now, limited to expressions that are an immediate number + # or positive/negative number + if isinstance(exprnode, pycparser.c_ast.Constant): + s = exprnode.value + if '0' <= s[0] <= '9': + s = s.rstrip('uUlL') + try: + if s.startswith('0'): + return int(s, 8) + else: + return int(s, 10) + except ValueError: + if len(s) > 1: + if s.lower()[0:2] == '0x': + return int(s, 16) + elif s.lower()[0:2] == '0b': + return int(s, 2) + raise CDefError("invalid constant %r" % (s,)) + elif s[0] == "'" and s[-1] == "'" and ( + len(s) == 3 or (len(s) == 4 and s[1] == "\\")): + return ord(s[-2]) + else: + raise CDefError("invalid constant %r" % (s,)) + # + if (isinstance(exprnode, pycparser.c_ast.UnaryOp) and + exprnode.op == '+'): + return self._parse_constant(exprnode.expr) + # + if (isinstance(exprnode, pycparser.c_ast.UnaryOp) and + exprnode.op == '-'): + return -self._parse_constant(exprnode.expr) + # load previously defined int constant + if (isinstance(exprnode, pycparser.c_ast.ID) and + exprnode.name in self._int_constants): + return self._int_constants[exprnode.name] + # + if (isinstance(exprnode, pycparser.c_ast.ID) and + exprnode.name == '__dotdotdotarray__'): + if partial_length_ok: + self._partial_length = True + return '...' + raise FFIError(":%d: unsupported '[...]' here, cannot derive " + "the actual array length in this context" + % exprnode.coord.line) + # + if (isinstance(exprnode, pycparser.c_ast.BinaryOp) and + exprnode.op == '+'): + return (self._parse_constant(exprnode.left) + + self._parse_constant(exprnode.right)) + # + if (isinstance(exprnode, pycparser.c_ast.BinaryOp) and + exprnode.op == '-'): + return (self._parse_constant(exprnode.left) - + self._parse_constant(exprnode.right)) + # + raise FFIError(":%d: unsupported expression: expected a " + "simple numeric constant" % exprnode.coord.line) + + def _build_enum_type(self, explicit_name, decls): + if decls is not None: + partial = False + enumerators = [] + enumvalues = [] + nextenumvalue = 0 + for enum in decls.enumerators: + if _r_enum_dotdotdot.match(enum.name): + partial = True + continue + if enum.value is not None: + nextenumvalue = self._parse_constant(enum.value) + enumerators.append(enum.name) + enumvalues.append(nextenumvalue) + self._add_constants(enum.name, nextenumvalue) + nextenumvalue += 1 + enumerators = tuple(enumerators) + enumvalues = tuple(enumvalues) + tp = model.EnumType(explicit_name, enumerators, enumvalues) + tp.partial = partial + else: # opaque enum + tp = model.EnumType(explicit_name, (), ()) + return tp + + def include(self, other): + for name, (tp, quals) in other._declarations.items(): + if name.startswith('anonymous $enum_$'): + continue # fix for test_anonymous_enum_include + kind = name.split(' ', 1)[0] + if kind in ('struct', 'union', 'enum', 'anonymous', 'typedef'): + self._declare(name, tp, included=True, quals=quals) + for k, v in other._int_constants.items(): + self._add_constants(k, v) + + def _get_unknown_type(self, decl): + typenames = decl.type.type.names + if typenames == ['__dotdotdot__']: + return model.unknown_type(decl.name) + + if typenames == ['__dotdotdotint__']: + if self._uses_new_feature is None: + self._uses_new_feature = "'typedef int... %s'" % decl.name + return model.UnknownIntegerType(decl.name) + + if typenames == ['__dotdotdotfloat__']: + # note: not for 'long double' so far + if self._uses_new_feature is None: + self._uses_new_feature = "'typedef float... %s'" % decl.name + return model.UnknownFloatType(decl.name) + + raise FFIError(':%d: unsupported usage of "..." in typedef' + % decl.coord.line) + + def _get_unknown_ptr_type(self, decl): + if decl.type.type.type.names == ['__dotdotdot__']: + return model.unknown_ptr_type(decl.name) + raise FFIError(':%d: unsupported usage of "..." in typedef' + % decl.coord.line) diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/cffi/error.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/cffi/error.py new file mode 100644 index 00000000..0a27247c --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/cffi/error.py @@ -0,0 +1,31 @@ + +class FFIError(Exception): + __module__ = 'cffi' + +class CDefError(Exception): + __module__ = 'cffi' + def __str__(self): + try: + current_decl = self.args[1] + filename = current_decl.coord.file + linenum = current_decl.coord.line + prefix = '%s:%d: ' % (filename, linenum) + except (AttributeError, TypeError, IndexError): + prefix = '' + return '%s%s' % (prefix, self.args[0]) + +class VerificationError(Exception): + """ An error raised when verification fails + """ + __module__ = 'cffi' + +class VerificationMissing(Exception): + """ An error raised when incomplete structures are passed into + cdef, but no verification has been done + """ + __module__ = 'cffi' + +class PkgConfigError(Exception): + """ An error raised for missing modules in pkg-config + """ + __module__ = 'cffi' diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/cffi/ffiplatform.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/cffi/ffiplatform.py new file mode 100644 index 00000000..85313460 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/cffi/ffiplatform.py @@ -0,0 +1,127 @@ +import sys, os +from .error import VerificationError + + +LIST_OF_FILE_NAMES = ['sources', 'include_dirs', 'library_dirs', + 'extra_objects', 'depends'] + +def get_extension(srcfilename, modname, sources=(), **kwds): + _hack_at_distutils() + from distutils.core import Extension + allsources = [srcfilename] + for src in sources: + allsources.append(os.path.normpath(src)) + return Extension(name=modname, sources=allsources, **kwds) + +def compile(tmpdir, ext, compiler_verbose=0, debug=None): + """Compile a C extension module using distutils.""" + + _hack_at_distutils() + saved_environ = os.environ.copy() + try: + outputfilename = _build(tmpdir, ext, compiler_verbose, debug) + outputfilename = os.path.abspath(outputfilename) + finally: + # workaround for a distutils bugs where some env vars can + # become longer and longer every time it is used + for key, value in saved_environ.items(): + if os.environ.get(key) != value: + os.environ[key] = value + return outputfilename + +def _build(tmpdir, ext, compiler_verbose=0, debug=None): + # XXX compact but horrible :-( + from distutils.core import Distribution + import distutils.errors, distutils.log + # + dist = Distribution({'ext_modules': [ext]}) + dist.parse_config_files() + options = dist.get_option_dict('build_ext') + if debug is None: + debug = sys.flags.debug + options['debug'] = ('ffiplatform', debug) + options['force'] = ('ffiplatform', True) + options['build_lib'] = ('ffiplatform', tmpdir) + options['build_temp'] = ('ffiplatform', tmpdir) + # + try: + old_level = distutils.log.set_threshold(0) or 0 + try: + distutils.log.set_verbosity(compiler_verbose) + dist.run_command('build_ext') + cmd_obj = dist.get_command_obj('build_ext') + [soname] = cmd_obj.get_outputs() + finally: + distutils.log.set_threshold(old_level) + except (distutils.errors.CompileError, + distutils.errors.LinkError) as e: + raise VerificationError('%s: %s' % (e.__class__.__name__, e)) + # + return soname + +try: + from os.path import samefile +except ImportError: + def samefile(f1, f2): + return os.path.abspath(f1) == os.path.abspath(f2) + +def maybe_relative_path(path): + if not os.path.isabs(path): + return path # already relative + dir = path + names = [] + while True: + prevdir = dir + dir, name = os.path.split(prevdir) + if dir == prevdir or not dir: + return path # failed to make it relative + names.append(name) + try: + if samefile(dir, os.curdir): + names.reverse() + return os.path.join(*names) + except OSError: + pass + +# ____________________________________________________________ + +try: + int_or_long = (int, long) + import cStringIO +except NameError: + int_or_long = int # Python 3 + import io as cStringIO + +def _flatten(x, f): + if isinstance(x, str): + f.write('%ds%s' % (len(x), x)) + elif isinstance(x, dict): + keys = sorted(x.keys()) + f.write('%dd' % len(keys)) + for key in keys: + _flatten(key, f) + _flatten(x[key], f) + elif isinstance(x, (list, tuple)): + f.write('%dl' % len(x)) + for value in x: + _flatten(value, f) + elif isinstance(x, int_or_long): + f.write('%di' % (x,)) + else: + raise TypeError( + "the keywords to verify() contains unsupported object %r" % (x,)) + +def flatten(x): + f = cStringIO.StringIO() + _flatten(x, f) + return f.getvalue() + +def _hack_at_distutils(): + # Windows-only workaround for some configurations: see + # https://bugs.python.org/issue23246 (Python 2.7 with + # a specific MS compiler suite download) + if sys.platform == "win32": + try: + import setuptools # for side-effects, patches distutils + except ImportError: + pass diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/cffi/lock.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/cffi/lock.py new file mode 100644 index 00000000..db91b715 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/cffi/lock.py @@ -0,0 +1,30 @@ +import sys + +if sys.version_info < (3,): + try: + from thread import allocate_lock + except ImportError: + from dummy_thread import allocate_lock +else: + try: + from _thread import allocate_lock + except ImportError: + from _dummy_thread import allocate_lock + + +##import sys +##l1 = allocate_lock + +##class allocate_lock(object): +## def __init__(self): +## self._real = l1() +## def __enter__(self): +## for i in range(4, 0, -1): +## print sys._getframe(i).f_code +## print +## return self._real.__enter__() +## def __exit__(self, *args): +## return self._real.__exit__(*args) +## def acquire(self, f): +## assert f is False +## return self._real.acquire(f) diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/cffi/model.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/cffi/model.py new file mode 100644 index 00000000..5f1b0d2b --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/cffi/model.py @@ -0,0 +1,614 @@ +import types +import weakref + +from .lock import allocate_lock +from .error import CDefError, VerificationError, VerificationMissing + +# type qualifiers +Q_CONST = 0x01 +Q_RESTRICT = 0x02 +Q_VOLATILE = 0x04 + +def qualify(quals, replace_with): + if quals & Q_CONST: + replace_with = ' const ' + replace_with.lstrip() + if quals & Q_VOLATILE: + replace_with = ' volatile ' + replace_with.lstrip() + if quals & Q_RESTRICT: + # It seems that __restrict is supported by gcc and msvc. + # If you hit some different compiler, add a #define in + # _cffi_include.h for it (and in its copies, documented there) + replace_with = ' __restrict ' + replace_with.lstrip() + return replace_with + + +class BaseTypeByIdentity(object): + is_array_type = False + is_raw_function = False + + def get_c_name(self, replace_with='', context='a C file', quals=0): + result = self.c_name_with_marker + assert result.count('&') == 1 + # some logic duplication with ffi.getctype()... :-( + replace_with = replace_with.strip() + if replace_with: + if replace_with.startswith('*') and '&[' in result: + replace_with = '(%s)' % replace_with + elif not replace_with[0] in '[(': + replace_with = ' ' + replace_with + replace_with = qualify(quals, replace_with) + result = result.replace('&', replace_with) + if '$' in result: + raise VerificationError( + "cannot generate '%s' in %s: unknown type name" + % (self._get_c_name(), context)) + return result + + def _get_c_name(self): + return self.c_name_with_marker.replace('&', '') + + def has_c_name(self): + return '$' not in self._get_c_name() + + def is_integer_type(self): + return False + + def get_cached_btype(self, ffi, finishlist, can_delay=False): + try: + BType = ffi._cached_btypes[self] + except KeyError: + BType = self.build_backend_type(ffi, finishlist) + BType2 = ffi._cached_btypes.setdefault(self, BType) + assert BType2 is BType + return BType + + def __repr__(self): + return '<%s>' % (self._get_c_name(),) + + def _get_items(self): + return [(name, getattr(self, name)) for name in self._attrs_] + + +class BaseType(BaseTypeByIdentity): + + def __eq__(self, other): + return (self.__class__ == other.__class__ and + self._get_items() == other._get_items()) + + def __ne__(self, other): + return not self == other + + def __hash__(self): + return hash((self.__class__, tuple(self._get_items()))) + + +class VoidType(BaseType): + _attrs_ = () + + def __init__(self): + self.c_name_with_marker = 'void&' + + def build_backend_type(self, ffi, finishlist): + return global_cache(self, ffi, 'new_void_type') + +void_type = VoidType() + + +class BasePrimitiveType(BaseType): + def is_complex_type(self): + return False + + +class PrimitiveType(BasePrimitiveType): + _attrs_ = ('name',) + + ALL_PRIMITIVE_TYPES = { + 'char': 'c', + 'short': 'i', + 'int': 'i', + 'long': 'i', + 'long long': 'i', + 'signed char': 'i', + 'unsigned char': 'i', + 'unsigned short': 'i', + 'unsigned int': 'i', + 'unsigned long': 'i', + 'unsigned long long': 'i', + 'float': 'f', + 'double': 'f', + 'long double': 'f', + 'float _Complex': 'j', + 'double _Complex': 'j', + '_Bool': 'i', + # the following types are not primitive in the C sense + 'wchar_t': 'c', + 'char16_t': 'c', + 'char32_t': 'c', + 'int8_t': 'i', + 'uint8_t': 'i', + 'int16_t': 'i', + 'uint16_t': 'i', + 'int32_t': 'i', + 'uint32_t': 'i', + 'int64_t': 'i', + 'uint64_t': 'i', + 'int_least8_t': 'i', + 'uint_least8_t': 'i', + 'int_least16_t': 'i', + 'uint_least16_t': 'i', + 'int_least32_t': 'i', + 'uint_least32_t': 'i', + 'int_least64_t': 'i', + 'uint_least64_t': 'i', + 'int_fast8_t': 'i', + 'uint_fast8_t': 'i', + 'int_fast16_t': 'i', + 'uint_fast16_t': 'i', + 'int_fast32_t': 'i', + 'uint_fast32_t': 'i', + 'int_fast64_t': 'i', + 'uint_fast64_t': 'i', + 'intptr_t': 'i', + 'uintptr_t': 'i', + 'intmax_t': 'i', + 'uintmax_t': 'i', + 'ptrdiff_t': 'i', + 'size_t': 'i', + 'ssize_t': 'i', + } + + def __init__(self, name): + assert name in self.ALL_PRIMITIVE_TYPES + self.name = name + self.c_name_with_marker = name + '&' + + def is_char_type(self): + return self.ALL_PRIMITIVE_TYPES[self.name] == 'c' + def is_integer_type(self): + return self.ALL_PRIMITIVE_TYPES[self.name] == 'i' + def is_float_type(self): + return self.ALL_PRIMITIVE_TYPES[self.name] == 'f' + def is_complex_type(self): + return self.ALL_PRIMITIVE_TYPES[self.name] == 'j' + + def build_backend_type(self, ffi, finishlist): + return global_cache(self, ffi, 'new_primitive_type', self.name) + + +class UnknownIntegerType(BasePrimitiveType): + _attrs_ = ('name',) + + def __init__(self, name): + self.name = name + self.c_name_with_marker = name + '&' + + def is_integer_type(self): + return True + + def build_backend_type(self, ffi, finishlist): + raise NotImplementedError("integer type '%s' can only be used after " + "compilation" % self.name) + +class UnknownFloatType(BasePrimitiveType): + _attrs_ = ('name', ) + + def __init__(self, name): + self.name = name + self.c_name_with_marker = name + '&' + + def build_backend_type(self, ffi, finishlist): + raise NotImplementedError("float type '%s' can only be used after " + "compilation" % self.name) + + +class BaseFunctionType(BaseType): + _attrs_ = ('args', 'result', 'ellipsis', 'abi') + + def __init__(self, args, result, ellipsis, abi=None): + self.args = args + self.result = result + self.ellipsis = ellipsis + self.abi = abi + # + reprargs = [arg._get_c_name() for arg in self.args] + if self.ellipsis: + reprargs.append('...') + reprargs = reprargs or ['void'] + replace_with = self._base_pattern % (', '.join(reprargs),) + if abi is not None: + replace_with = replace_with[:1] + abi + ' ' + replace_with[1:] + self.c_name_with_marker = ( + self.result.c_name_with_marker.replace('&', replace_with)) + + +class RawFunctionType(BaseFunctionType): + # Corresponds to a C type like 'int(int)', which is the C type of + # a function, but not a pointer-to-function. The backend has no + # notion of such a type; it's used temporarily by parsing. + _base_pattern = '(&)(%s)' + is_raw_function = True + + def build_backend_type(self, ffi, finishlist): + raise CDefError("cannot render the type %r: it is a function " + "type, not a pointer-to-function type" % (self,)) + + def as_function_pointer(self): + return FunctionPtrType(self.args, self.result, self.ellipsis, self.abi) + + +class FunctionPtrType(BaseFunctionType): + _base_pattern = '(*&)(%s)' + + def build_backend_type(self, ffi, finishlist): + result = self.result.get_cached_btype(ffi, finishlist) + args = [] + for tp in self.args: + args.append(tp.get_cached_btype(ffi, finishlist)) + abi_args = () + if self.abi == "__stdcall": + if not self.ellipsis: # __stdcall ignored for variadic funcs + try: + abi_args = (ffi._backend.FFI_STDCALL,) + except AttributeError: + pass + return global_cache(self, ffi, 'new_function_type', + tuple(args), result, self.ellipsis, *abi_args) + + def as_raw_function(self): + return RawFunctionType(self.args, self.result, self.ellipsis, self.abi) + + +class PointerType(BaseType): + _attrs_ = ('totype', 'quals') + + def __init__(self, totype, quals=0): + self.totype = totype + self.quals = quals + extra = qualify(quals, " *&") + if totype.is_array_type: + extra = "(%s)" % (extra.lstrip(),) + self.c_name_with_marker = totype.c_name_with_marker.replace('&', extra) + + def build_backend_type(self, ffi, finishlist): + BItem = self.totype.get_cached_btype(ffi, finishlist, can_delay=True) + return global_cache(self, ffi, 'new_pointer_type', BItem) + +voidp_type = PointerType(void_type) + +def ConstPointerType(totype): + return PointerType(totype, Q_CONST) + +const_voidp_type = ConstPointerType(void_type) + + +class NamedPointerType(PointerType): + _attrs_ = ('totype', 'name') + + def __init__(self, totype, name, quals=0): + PointerType.__init__(self, totype, quals) + self.name = name + self.c_name_with_marker = name + '&' + + +class ArrayType(BaseType): + _attrs_ = ('item', 'length') + is_array_type = True + + def __init__(self, item, length): + self.item = item + self.length = length + # + if length is None: + brackets = '&[]' + elif length == '...': + brackets = '&[/*...*/]' + else: + brackets = '&[%s]' % length + self.c_name_with_marker = ( + self.item.c_name_with_marker.replace('&', brackets)) + + def resolve_length(self, newlength): + return ArrayType(self.item, newlength) + + def build_backend_type(self, ffi, finishlist): + if self.length == '...': + raise CDefError("cannot render the type %r: unknown length" % + (self,)) + self.item.get_cached_btype(ffi, finishlist) # force the item BType + BPtrItem = PointerType(self.item).get_cached_btype(ffi, finishlist) + return global_cache(self, ffi, 'new_array_type', BPtrItem, self.length) + +char_array_type = ArrayType(PrimitiveType('char'), None) + + +class StructOrUnionOrEnum(BaseTypeByIdentity): + _attrs_ = ('name',) + forcename = None + + def build_c_name_with_marker(self): + name = self.forcename or '%s %s' % (self.kind, self.name) + self.c_name_with_marker = name + '&' + + def force_the_name(self, forcename): + self.forcename = forcename + self.build_c_name_with_marker() + + def get_official_name(self): + assert self.c_name_with_marker.endswith('&') + return self.c_name_with_marker[:-1] + + +class StructOrUnion(StructOrUnionOrEnum): + fixedlayout = None + completed = 0 + partial = False + packed = 0 + + def __init__(self, name, fldnames, fldtypes, fldbitsize, fldquals=None): + self.name = name + self.fldnames = fldnames + self.fldtypes = fldtypes + self.fldbitsize = fldbitsize + self.fldquals = fldquals + self.build_c_name_with_marker() + + def anonymous_struct_fields(self): + if self.fldtypes is not None: + for name, type in zip(self.fldnames, self.fldtypes): + if name == '' and isinstance(type, StructOrUnion): + yield type + + def enumfields(self, expand_anonymous_struct_union=True): + fldquals = self.fldquals + if fldquals is None: + fldquals = (0,) * len(self.fldnames) + for name, type, bitsize, quals in zip(self.fldnames, self.fldtypes, + self.fldbitsize, fldquals): + if (name == '' and isinstance(type, StructOrUnion) + and expand_anonymous_struct_union): + # nested anonymous struct/union + for result in type.enumfields(): + yield result + else: + yield (name, type, bitsize, quals) + + def force_flatten(self): + # force the struct or union to have a declaration that lists + # directly all fields returned by enumfields(), flattening + # nested anonymous structs/unions. + names = [] + types = [] + bitsizes = [] + fldquals = [] + for name, type, bitsize, quals in self.enumfields(): + names.append(name) + types.append(type) + bitsizes.append(bitsize) + fldquals.append(quals) + self.fldnames = tuple(names) + self.fldtypes = tuple(types) + self.fldbitsize = tuple(bitsizes) + self.fldquals = tuple(fldquals) + + def get_cached_btype(self, ffi, finishlist, can_delay=False): + BType = StructOrUnionOrEnum.get_cached_btype(self, ffi, finishlist, + can_delay) + if not can_delay: + self.finish_backend_type(ffi, finishlist) + return BType + + def finish_backend_type(self, ffi, finishlist): + if self.completed: + if self.completed != 2: + raise NotImplementedError("recursive structure declaration " + "for '%s'" % (self.name,)) + return + BType = ffi._cached_btypes[self] + # + self.completed = 1 + # + if self.fldtypes is None: + pass # not completing it: it's an opaque struct + # + elif self.fixedlayout is None: + fldtypes = [tp.get_cached_btype(ffi, finishlist) + for tp in self.fldtypes] + lst = list(zip(self.fldnames, fldtypes, self.fldbitsize)) + extra_flags = () + if self.packed: + if self.packed == 1: + extra_flags = (8,) # SF_PACKED + else: + extra_flags = (0, self.packed) + ffi._backend.complete_struct_or_union(BType, lst, self, + -1, -1, *extra_flags) + # + else: + fldtypes = [] + fieldofs, fieldsize, totalsize, totalalignment = self.fixedlayout + for i in range(len(self.fldnames)): + fsize = fieldsize[i] + ftype = self.fldtypes[i] + # + if isinstance(ftype, ArrayType) and ftype.length == '...': + # fix the length to match the total size + BItemType = ftype.item.get_cached_btype(ffi, finishlist) + nlen, nrest = divmod(fsize, ffi.sizeof(BItemType)) + if nrest != 0: + self._verification_error( + "field '%s.%s' has a bogus size?" % ( + self.name, self.fldnames[i] or '{}')) + ftype = ftype.resolve_length(nlen) + self.fldtypes = (self.fldtypes[:i] + (ftype,) + + self.fldtypes[i+1:]) + # + BFieldType = ftype.get_cached_btype(ffi, finishlist) + if isinstance(ftype, ArrayType) and ftype.length is None: + assert fsize == 0 + else: + bitemsize = ffi.sizeof(BFieldType) + if bitemsize != fsize: + self._verification_error( + "field '%s.%s' is declared as %d bytes, but is " + "really %d bytes" % (self.name, + self.fldnames[i] or '{}', + bitemsize, fsize)) + fldtypes.append(BFieldType) + # + lst = list(zip(self.fldnames, fldtypes, self.fldbitsize, fieldofs)) + ffi._backend.complete_struct_or_union(BType, lst, self, + totalsize, totalalignment) + self.completed = 2 + + def _verification_error(self, msg): + raise VerificationError(msg) + + def check_not_partial(self): + if self.partial and self.fixedlayout is None: + raise VerificationMissing(self._get_c_name()) + + def build_backend_type(self, ffi, finishlist): + self.check_not_partial() + finishlist.append(self) + # + return global_cache(self, ffi, 'new_%s_type' % self.kind, + self.get_official_name(), key=self) + + +class StructType(StructOrUnion): + kind = 'struct' + + +class UnionType(StructOrUnion): + kind = 'union' + + +class EnumType(StructOrUnionOrEnum): + kind = 'enum' + partial = False + partial_resolved = False + + def __init__(self, name, enumerators, enumvalues, baseinttype=None): + self.name = name + self.enumerators = enumerators + self.enumvalues = enumvalues + self.baseinttype = baseinttype + self.build_c_name_with_marker() + + def force_the_name(self, forcename): + StructOrUnionOrEnum.force_the_name(self, forcename) + if self.forcename is None: + name = self.get_official_name() + self.forcename = '$' + name.replace(' ', '_') + + def check_not_partial(self): + if self.partial and not self.partial_resolved: + raise VerificationMissing(self._get_c_name()) + + def build_backend_type(self, ffi, finishlist): + self.check_not_partial() + base_btype = self.build_baseinttype(ffi, finishlist) + return global_cache(self, ffi, 'new_enum_type', + self.get_official_name(), + self.enumerators, self.enumvalues, + base_btype, key=self) + + def build_baseinttype(self, ffi, finishlist): + if self.baseinttype is not None: + return self.baseinttype.get_cached_btype(ffi, finishlist) + # + if self.enumvalues: + smallest_value = min(self.enumvalues) + largest_value = max(self.enumvalues) + else: + import warnings + try: + # XXX! The goal is to ensure that the warnings.warn() + # will not suppress the warning. We want to get it + # several times if we reach this point several times. + __warningregistry__.clear() + except NameError: + pass + warnings.warn("%r has no values explicitly defined; " + "guessing that it is equivalent to 'unsigned int'" + % self._get_c_name()) + smallest_value = largest_value = 0 + if smallest_value < 0: # needs a signed type + sign = 1 + candidate1 = PrimitiveType("int") + candidate2 = PrimitiveType("long") + else: + sign = 0 + candidate1 = PrimitiveType("unsigned int") + candidate2 = PrimitiveType("unsigned long") + btype1 = candidate1.get_cached_btype(ffi, finishlist) + btype2 = candidate2.get_cached_btype(ffi, finishlist) + size1 = ffi.sizeof(btype1) + size2 = ffi.sizeof(btype2) + if (smallest_value >= ((-1) << (8*size1-1)) and + largest_value < (1 << (8*size1-sign))): + return btype1 + if (smallest_value >= ((-1) << (8*size2-1)) and + largest_value < (1 << (8*size2-sign))): + return btype2 + raise CDefError("%s values don't all fit into either 'long' " + "or 'unsigned long'" % self._get_c_name()) + +def unknown_type(name, structname=None): + if structname is None: + structname = '$%s' % name + tp = StructType(structname, None, None, None) + tp.force_the_name(name) + tp.origin = "unknown_type" + return tp + +def unknown_ptr_type(name, structname=None): + if structname is None: + structname = '$$%s' % name + tp = StructType(structname, None, None, None) + return NamedPointerType(tp, name) + + +global_lock = allocate_lock() +_typecache_cffi_backend = weakref.WeakValueDictionary() + +def get_typecache(backend): + # returns _typecache_cffi_backend if backend is the _cffi_backend + # module, or type(backend).__typecache if backend is an instance of + # CTypesBackend (or some FakeBackend class during tests) + if isinstance(backend, types.ModuleType): + return _typecache_cffi_backend + with global_lock: + if not hasattr(type(backend), '__typecache'): + type(backend).__typecache = weakref.WeakValueDictionary() + return type(backend).__typecache + +def global_cache(srctype, ffi, funcname, *args, **kwds): + key = kwds.pop('key', (funcname, args)) + assert not kwds + try: + return ffi._typecache[key] + except KeyError: + pass + try: + res = getattr(ffi._backend, funcname)(*args) + except NotImplementedError as e: + raise NotImplementedError("%s: %r: %s" % (funcname, srctype, e)) + # note that setdefault() on WeakValueDictionary is not atomic + # and contains a rare bug (http://bugs.python.org/issue19542); + # we have to use a lock and do it ourselves + cache = ffi._typecache + with global_lock: + res1 = cache.get(key) + if res1 is None: + cache[key] = res + return res + else: + return res1 + +def pointer_cache(ffi, BType): + return global_cache('?', ffi, 'new_pointer_type', BType) + +def attach_exception_info(e, name): + if e.args and type(e.args[0]) is str: + e.args = ('%s: %s' % (name, e.args[0]),) + e.args[1:] diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/cffi/parse_c_type.h b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/cffi/parse_c_type.h new file mode 100644 index 00000000..84e4ef85 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/cffi/parse_c_type.h @@ -0,0 +1,181 @@ + +/* This part is from file 'cffi/parse_c_type.h'. It is copied at the + beginning of C sources generated by CFFI's ffi.set_source(). */ + +typedef void *_cffi_opcode_t; + +#define _CFFI_OP(opcode, arg) (_cffi_opcode_t)(opcode | (((uintptr_t)(arg)) << 8)) +#define _CFFI_GETOP(cffi_opcode) ((unsigned char)(uintptr_t)cffi_opcode) +#define _CFFI_GETARG(cffi_opcode) (((intptr_t)cffi_opcode) >> 8) + +#define _CFFI_OP_PRIMITIVE 1 +#define _CFFI_OP_POINTER 3 +#define _CFFI_OP_ARRAY 5 +#define _CFFI_OP_OPEN_ARRAY 7 +#define _CFFI_OP_STRUCT_UNION 9 +#define _CFFI_OP_ENUM 11 +#define _CFFI_OP_FUNCTION 13 +#define _CFFI_OP_FUNCTION_END 15 +#define _CFFI_OP_NOOP 17 +#define _CFFI_OP_BITFIELD 19 +#define _CFFI_OP_TYPENAME 21 +#define _CFFI_OP_CPYTHON_BLTN_V 23 // varargs +#define _CFFI_OP_CPYTHON_BLTN_N 25 // noargs +#define _CFFI_OP_CPYTHON_BLTN_O 27 // O (i.e. a single arg) +#define _CFFI_OP_CONSTANT 29 +#define _CFFI_OP_CONSTANT_INT 31 +#define _CFFI_OP_GLOBAL_VAR 33 +#define _CFFI_OP_DLOPEN_FUNC 35 +#define _CFFI_OP_DLOPEN_CONST 37 +#define _CFFI_OP_GLOBAL_VAR_F 39 +#define _CFFI_OP_EXTERN_PYTHON 41 + +#define _CFFI_PRIM_VOID 0 +#define _CFFI_PRIM_BOOL 1 +#define _CFFI_PRIM_CHAR 2 +#define _CFFI_PRIM_SCHAR 3 +#define _CFFI_PRIM_UCHAR 4 +#define _CFFI_PRIM_SHORT 5 +#define _CFFI_PRIM_USHORT 6 +#define _CFFI_PRIM_INT 7 +#define _CFFI_PRIM_UINT 8 +#define _CFFI_PRIM_LONG 9 +#define _CFFI_PRIM_ULONG 10 +#define _CFFI_PRIM_LONGLONG 11 +#define _CFFI_PRIM_ULONGLONG 12 +#define _CFFI_PRIM_FLOAT 13 +#define _CFFI_PRIM_DOUBLE 14 +#define _CFFI_PRIM_LONGDOUBLE 15 + +#define _CFFI_PRIM_WCHAR 16 +#define _CFFI_PRIM_INT8 17 +#define _CFFI_PRIM_UINT8 18 +#define _CFFI_PRIM_INT16 19 +#define _CFFI_PRIM_UINT16 20 +#define _CFFI_PRIM_INT32 21 +#define _CFFI_PRIM_UINT32 22 +#define _CFFI_PRIM_INT64 23 +#define _CFFI_PRIM_UINT64 24 +#define _CFFI_PRIM_INTPTR 25 +#define _CFFI_PRIM_UINTPTR 26 +#define _CFFI_PRIM_PTRDIFF 27 +#define _CFFI_PRIM_SIZE 28 +#define _CFFI_PRIM_SSIZE 29 +#define _CFFI_PRIM_INT_LEAST8 30 +#define _CFFI_PRIM_UINT_LEAST8 31 +#define _CFFI_PRIM_INT_LEAST16 32 +#define _CFFI_PRIM_UINT_LEAST16 33 +#define _CFFI_PRIM_INT_LEAST32 34 +#define _CFFI_PRIM_UINT_LEAST32 35 +#define _CFFI_PRIM_INT_LEAST64 36 +#define _CFFI_PRIM_UINT_LEAST64 37 +#define _CFFI_PRIM_INT_FAST8 38 +#define _CFFI_PRIM_UINT_FAST8 39 +#define _CFFI_PRIM_INT_FAST16 40 +#define _CFFI_PRIM_UINT_FAST16 41 +#define _CFFI_PRIM_INT_FAST32 42 +#define _CFFI_PRIM_UINT_FAST32 43 +#define _CFFI_PRIM_INT_FAST64 44 +#define _CFFI_PRIM_UINT_FAST64 45 +#define _CFFI_PRIM_INTMAX 46 +#define _CFFI_PRIM_UINTMAX 47 +#define _CFFI_PRIM_FLOATCOMPLEX 48 +#define _CFFI_PRIM_DOUBLECOMPLEX 49 +#define _CFFI_PRIM_CHAR16 50 +#define _CFFI_PRIM_CHAR32 51 + +#define _CFFI__NUM_PRIM 52 +#define _CFFI__UNKNOWN_PRIM (-1) +#define _CFFI__UNKNOWN_FLOAT_PRIM (-2) +#define _CFFI__UNKNOWN_LONG_DOUBLE (-3) + +#define _CFFI__IO_FILE_STRUCT (-1) + + +struct _cffi_global_s { + const char *name; + void *address; + _cffi_opcode_t type_op; + void *size_or_direct_fn; // OP_GLOBAL_VAR: size, or 0 if unknown + // OP_CPYTHON_BLTN_*: addr of direct function +}; + +struct _cffi_getconst_s { + unsigned long long value; + const struct _cffi_type_context_s *ctx; + int gindex; +}; + +struct _cffi_struct_union_s { + const char *name; + int type_index; // -> _cffi_types, on a OP_STRUCT_UNION + int flags; // _CFFI_F_* flags below + size_t size; + int alignment; + int first_field_index; // -> _cffi_fields array + int num_fields; +}; +#define _CFFI_F_UNION 0x01 // is a union, not a struct +#define _CFFI_F_CHECK_FIELDS 0x02 // complain if fields are not in the + // "standard layout" or if some are missing +#define _CFFI_F_PACKED 0x04 // for CHECK_FIELDS, assume a packed struct +#define _CFFI_F_EXTERNAL 0x08 // in some other ffi.include() +#define _CFFI_F_OPAQUE 0x10 // opaque + +struct _cffi_field_s { + const char *name; + size_t field_offset; + size_t field_size; + _cffi_opcode_t field_type_op; +}; + +struct _cffi_enum_s { + const char *name; + int type_index; // -> _cffi_types, on a OP_ENUM + int type_prim; // _CFFI_PRIM_xxx + const char *enumerators; // comma-delimited string +}; + +struct _cffi_typename_s { + const char *name; + int type_index; /* if opaque, points to a possibly artificial + OP_STRUCT which is itself opaque */ +}; + +struct _cffi_type_context_s { + _cffi_opcode_t *types; + const struct _cffi_global_s *globals; + const struct _cffi_field_s *fields; + const struct _cffi_struct_union_s *struct_unions; + const struct _cffi_enum_s *enums; + const struct _cffi_typename_s *typenames; + int num_globals; + int num_struct_unions; + int num_enums; + int num_typenames; + const char *const *includes; + int num_types; + int flags; /* future extension */ +}; + +struct _cffi_parse_info_s { + const struct _cffi_type_context_s *ctx; + _cffi_opcode_t *output; + unsigned int output_size; + size_t error_location; + const char *error_message; +}; + +struct _cffi_externpy_s { + const char *name; + size_t size_of_result; + void *reserved1, *reserved2; +}; + +#ifdef _CFFI_INTERNAL +static int parse_c_type(struct _cffi_parse_info_s *info, const char *input); +static int search_in_globals(const struct _cffi_type_context_s *ctx, + const char *search, size_t search_len); +static int search_in_struct_unions(const struct _cffi_type_context_s *ctx, + const char *search, size_t search_len); +#endif diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/cffi/pkgconfig.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/cffi/pkgconfig.py new file mode 100644 index 00000000..5c93f15a --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/cffi/pkgconfig.py @@ -0,0 +1,121 @@ +# pkg-config, https://www.freedesktop.org/wiki/Software/pkg-config/ integration for cffi +import sys, os, subprocess + +from .error import PkgConfigError + + +def merge_flags(cfg1, cfg2): + """Merge values from cffi config flags cfg2 to cf1 + + Example: + merge_flags({"libraries": ["one"]}, {"libraries": ["two"]}) + {"libraries": ["one", "two"]} + """ + for key, value in cfg2.items(): + if key not in cfg1: + cfg1[key] = value + else: + if not isinstance(cfg1[key], list): + raise TypeError("cfg1[%r] should be a list of strings" % (key,)) + if not isinstance(value, list): + raise TypeError("cfg2[%r] should be a list of strings" % (key,)) + cfg1[key].extend(value) + return cfg1 + + +def call(libname, flag, encoding=sys.getfilesystemencoding()): + """Calls pkg-config and returns the output if found + """ + a = ["pkg-config", "--print-errors"] + a.append(flag) + a.append(libname) + try: + pc = subprocess.Popen(a, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + except EnvironmentError as e: + raise PkgConfigError("cannot run pkg-config: %s" % (str(e).strip(),)) + + bout, berr = pc.communicate() + if pc.returncode != 0: + try: + berr = berr.decode(encoding) + except Exception: + pass + raise PkgConfigError(berr.strip()) + + if sys.version_info >= (3,) and not isinstance(bout, str): # Python 3.x + try: + bout = bout.decode(encoding) + except UnicodeDecodeError: + raise PkgConfigError("pkg-config %s %s returned bytes that cannot " + "be decoded with encoding %r:\n%r" % + (flag, libname, encoding, bout)) + + if os.altsep != '\\' and '\\' in bout: + raise PkgConfigError("pkg-config %s %s returned an unsupported " + "backslash-escaped output:\n%r" % + (flag, libname, bout)) + return bout + + +def flags_from_pkgconfig(libs): + r"""Return compiler line flags for FFI.set_source based on pkg-config output + + Usage + ... + ffibuilder.set_source("_foo", pkgconfig = ["libfoo", "libbar >= 1.8.3"]) + + If pkg-config is installed on build machine, then arguments include_dirs, + library_dirs, libraries, define_macros, extra_compile_args and + extra_link_args are extended with an output of pkg-config for libfoo and + libbar. + + Raises PkgConfigError in case the pkg-config call fails. + """ + + def get_include_dirs(string): + return [x[2:] for x in string.split() if x.startswith("-I")] + + def get_library_dirs(string): + return [x[2:] for x in string.split() if x.startswith("-L")] + + def get_libraries(string): + return [x[2:] for x in string.split() if x.startswith("-l")] + + # convert -Dfoo=bar to list of tuples [("foo", "bar")] expected by distutils + def get_macros(string): + def _macro(x): + x = x[2:] # drop "-D" + if '=' in x: + return tuple(x.split("=", 1)) # "-Dfoo=bar" => ("foo", "bar") + else: + return (x, None) # "-Dfoo" => ("foo", None) + return [_macro(x) for x in string.split() if x.startswith("-D")] + + def get_other_cflags(string): + return [x for x in string.split() if not x.startswith("-I") and + not x.startswith("-D")] + + def get_other_libs(string): + return [x for x in string.split() if not x.startswith("-L") and + not x.startswith("-l")] + + # return kwargs for given libname + def kwargs(libname): + fse = sys.getfilesystemencoding() + all_cflags = call(libname, "--cflags") + all_libs = call(libname, "--libs") + return { + "include_dirs": get_include_dirs(all_cflags), + "library_dirs": get_library_dirs(all_libs), + "libraries": get_libraries(all_libs), + "define_macros": get_macros(all_cflags), + "extra_compile_args": get_other_cflags(all_cflags), + "extra_link_args": get_other_libs(all_libs), + } + + # merge all arguments together + ret = {} + for libname in libs: + lib_flags = kwargs(libname) + merge_flags(ret, lib_flags) + return ret diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/cffi/recompiler.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/cffi/recompiler.py new file mode 100644 index 00000000..20e912b2 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/cffi/recompiler.py @@ -0,0 +1,1542 @@ +import os, sys, io +from . import ffiplatform, model +from .error import VerificationError +from .cffi_opcode import * + +VERSION_BASE = 0x2601 +VERSION_EMBEDDED = 0x2701 +VERSION_CHAR16CHAR32 = 0x2801 + + +class GlobalExpr: + def __init__(self, name, address, type_op, size=0, check_value=0): + self.name = name + self.address = address + self.type_op = type_op + self.size = size + self.check_value = check_value + + def as_c_expr(self): + return ' { "%s", (void *)%s, %s, (void *)%s },' % ( + self.name, self.address, self.type_op.as_c_expr(), self.size) + + def as_python_expr(self): + return "b'%s%s',%d" % (self.type_op.as_python_bytes(), self.name, + self.check_value) + +class FieldExpr: + def __init__(self, name, field_offset, field_size, fbitsize, field_type_op): + self.name = name + self.field_offset = field_offset + self.field_size = field_size + self.fbitsize = fbitsize + self.field_type_op = field_type_op + + def as_c_expr(self): + spaces = " " * len(self.name) + return (' { "%s", %s,\n' % (self.name, self.field_offset) + + ' %s %s,\n' % (spaces, self.field_size) + + ' %s %s },' % (spaces, self.field_type_op.as_c_expr())) + + def as_python_expr(self): + raise NotImplementedError + + def as_field_python_expr(self): + if self.field_type_op.op == OP_NOOP: + size_expr = '' + elif self.field_type_op.op == OP_BITFIELD: + size_expr = format_four_bytes(self.fbitsize) + else: + raise NotImplementedError + return "b'%s%s%s'" % (self.field_type_op.as_python_bytes(), + size_expr, + self.name) + +class StructUnionExpr: + def __init__(self, name, type_index, flags, size, alignment, comment, + first_field_index, c_fields): + self.name = name + self.type_index = type_index + self.flags = flags + self.size = size + self.alignment = alignment + self.comment = comment + self.first_field_index = first_field_index + self.c_fields = c_fields + + def as_c_expr(self): + return (' { "%s", %d, %s,' % (self.name, self.type_index, self.flags) + + '\n %s, %s, ' % (self.size, self.alignment) + + '%d, %d ' % (self.first_field_index, len(self.c_fields)) + + ('/* %s */ ' % self.comment if self.comment else '') + + '},') + + def as_python_expr(self): + flags = eval(self.flags, G_FLAGS) + fields_expr = [c_field.as_field_python_expr() + for c_field in self.c_fields] + return "(b'%s%s%s',%s)" % ( + format_four_bytes(self.type_index), + format_four_bytes(flags), + self.name, + ','.join(fields_expr)) + +class EnumExpr: + def __init__(self, name, type_index, size, signed, allenums): + self.name = name + self.type_index = type_index + self.size = size + self.signed = signed + self.allenums = allenums + + def as_c_expr(self): + return (' { "%s", %d, _cffi_prim_int(%s, %s),\n' + ' "%s" },' % (self.name, self.type_index, + self.size, self.signed, self.allenums)) + + def as_python_expr(self): + prim_index = { + (1, 0): PRIM_UINT8, (1, 1): PRIM_INT8, + (2, 0): PRIM_UINT16, (2, 1): PRIM_INT16, + (4, 0): PRIM_UINT32, (4, 1): PRIM_INT32, + (8, 0): PRIM_UINT64, (8, 1): PRIM_INT64, + }[self.size, self.signed] + return "b'%s%s%s\\x00%s'" % (format_four_bytes(self.type_index), + format_four_bytes(prim_index), + self.name, self.allenums) + +class TypenameExpr: + def __init__(self, name, type_index): + self.name = name + self.type_index = type_index + + def as_c_expr(self): + return ' { "%s", %d },' % (self.name, self.type_index) + + def as_python_expr(self): + return "b'%s%s'" % (format_four_bytes(self.type_index), self.name) + + +# ____________________________________________________________ + + +class Recompiler: + _num_externpy = 0 + + def __init__(self, ffi, module_name, target_is_python=False): + self.ffi = ffi + self.module_name = module_name + self.target_is_python = target_is_python + self._version = VERSION_BASE + + def needs_version(self, ver): + self._version = max(self._version, ver) + + def collect_type_table(self): + self._typesdict = {} + self._generate("collecttype") + # + all_decls = sorted(self._typesdict, key=str) + # + # prepare all FUNCTION bytecode sequences first + self.cffi_types = [] + for tp in all_decls: + if tp.is_raw_function: + assert self._typesdict[tp] is None + self._typesdict[tp] = len(self.cffi_types) + self.cffi_types.append(tp) # placeholder + for tp1 in tp.args: + assert isinstance(tp1, (model.VoidType, + model.BasePrimitiveType, + model.PointerType, + model.StructOrUnionOrEnum, + model.FunctionPtrType)) + if self._typesdict[tp1] is None: + self._typesdict[tp1] = len(self.cffi_types) + self.cffi_types.append(tp1) # placeholder + self.cffi_types.append('END') # placeholder + # + # prepare all OTHER bytecode sequences + for tp in all_decls: + if not tp.is_raw_function and self._typesdict[tp] is None: + self._typesdict[tp] = len(self.cffi_types) + self.cffi_types.append(tp) # placeholder + if tp.is_array_type and tp.length is not None: + self.cffi_types.append('LEN') # placeholder + assert None not in self._typesdict.values() + # + # collect all structs and unions and enums + self._struct_unions = {} + self._enums = {} + for tp in all_decls: + if isinstance(tp, model.StructOrUnion): + self._struct_unions[tp] = None + elif isinstance(tp, model.EnumType): + self._enums[tp] = None + for i, tp in enumerate(sorted(self._struct_unions, + key=lambda tp: tp.name)): + self._struct_unions[tp] = i + for i, tp in enumerate(sorted(self._enums, + key=lambda tp: tp.name)): + self._enums[tp] = i + # + # emit all bytecode sequences now + for tp in all_decls: + method = getattr(self, '_emit_bytecode_' + tp.__class__.__name__) + method(tp, self._typesdict[tp]) + # + # consistency check + for op in self.cffi_types: + assert isinstance(op, CffiOp) + self.cffi_types = tuple(self.cffi_types) # don't change any more + + def _do_collect_type(self, tp): + if not isinstance(tp, model.BaseTypeByIdentity): + if isinstance(tp, tuple): + for x in tp: + self._do_collect_type(x) + return + if tp not in self._typesdict: + self._typesdict[tp] = None + if isinstance(tp, model.FunctionPtrType): + self._do_collect_type(tp.as_raw_function()) + elif isinstance(tp, model.StructOrUnion): + if tp.fldtypes is not None and ( + tp not in self.ffi._parser._included_declarations): + for name1, tp1, _, _ in tp.enumfields(): + self._do_collect_type(self._field_type(tp, name1, tp1)) + else: + for _, x in tp._get_items(): + self._do_collect_type(x) + + def _generate(self, step_name): + lst = self.ffi._parser._declarations.items() + for name, (tp, quals) in sorted(lst): + kind, realname = name.split(' ', 1) + try: + method = getattr(self, '_generate_cpy_%s_%s' % (kind, + step_name)) + except AttributeError: + raise VerificationError( + "not implemented in recompile(): %r" % name) + try: + self._current_quals = quals + method(tp, realname) + except Exception as e: + model.attach_exception_info(e, name) + raise + + # ---------- + + ALL_STEPS = ["global", "field", "struct_union", "enum", "typename"] + + def collect_step_tables(self): + # collect the declarations for '_cffi_globals', '_cffi_typenames', etc. + self._lsts = {} + for step_name in self.ALL_STEPS: + self._lsts[step_name] = [] + self._seen_struct_unions = set() + self._generate("ctx") + self._add_missing_struct_unions() + # + for step_name in self.ALL_STEPS: + lst = self._lsts[step_name] + if step_name != "field": + lst.sort(key=lambda entry: entry.name) + self._lsts[step_name] = tuple(lst) # don't change any more + # + # check for a possible internal inconsistency: _cffi_struct_unions + # should have been generated with exactly self._struct_unions + lst = self._lsts["struct_union"] + for tp, i in self._struct_unions.items(): + assert i < len(lst) + assert lst[i].name == tp.name + assert len(lst) == len(self._struct_unions) + # same with enums + lst = self._lsts["enum"] + for tp, i in self._enums.items(): + assert i < len(lst) + assert lst[i].name == tp.name + assert len(lst) == len(self._enums) + + # ---------- + + def _prnt(self, what=''): + self._f.write(what + '\n') + + def write_source_to_f(self, f, preamble): + if self.target_is_python: + assert preamble is None + self.write_py_source_to_f(f) + else: + assert preamble is not None + self.write_c_source_to_f(f, preamble) + + def _rel_readlines(self, filename): + g = open(os.path.join(os.path.dirname(__file__), filename), 'r') + lines = g.readlines() + g.close() + return lines + + def write_c_source_to_f(self, f, preamble): + self._f = f + prnt = self._prnt + if self.ffi._embedding is not None: + prnt('#define _CFFI_USE_EMBEDDING') + # + # first the '#include' (actually done by inlining the file's content) + lines = self._rel_readlines('_cffi_include.h') + i = lines.index('#include "parse_c_type.h"\n') + lines[i:i+1] = self._rel_readlines('parse_c_type.h') + prnt(''.join(lines)) + # + # if we have ffi._embedding != None, we give it here as a macro + # and include an extra file + base_module_name = self.module_name.split('.')[-1] + if self.ffi._embedding is not None: + prnt('#define _CFFI_MODULE_NAME "%s"' % (self.module_name,)) + prnt('static const char _CFFI_PYTHON_STARTUP_CODE[] = {') + self._print_string_literal_in_array(self.ffi._embedding) + prnt('0 };') + prnt('#ifdef PYPY_VERSION') + prnt('# define _CFFI_PYTHON_STARTUP_FUNC _cffi_pypyinit_%s' % ( + base_module_name,)) + prnt('#elif PY_MAJOR_VERSION >= 3') + prnt('# define _CFFI_PYTHON_STARTUP_FUNC PyInit_%s' % ( + base_module_name,)) + prnt('#else') + prnt('# define _CFFI_PYTHON_STARTUP_FUNC init%s' % ( + base_module_name,)) + prnt('#endif') + lines = self._rel_readlines('_embedding.h') + i = lines.index('#include "_cffi_errors.h"\n') + lines[i:i+1] = self._rel_readlines('_cffi_errors.h') + prnt(''.join(lines)) + self.needs_version(VERSION_EMBEDDED) + # + # then paste the C source given by the user, verbatim. + prnt('/************************************************************/') + prnt() + prnt(preamble) + prnt() + prnt('/************************************************************/') + prnt() + # + # the declaration of '_cffi_types' + prnt('static void *_cffi_types[] = {') + typeindex2type = dict([(i, tp) for (tp, i) in self._typesdict.items()]) + for i, op in enumerate(self.cffi_types): + comment = '' + if i in typeindex2type: + comment = ' // ' + typeindex2type[i]._get_c_name() + prnt('/* %2d */ %s,%s' % (i, op.as_c_expr(), comment)) + if not self.cffi_types: + prnt(' 0') + prnt('};') + prnt() + # + # call generate_cpy_xxx_decl(), for every xxx found from + # ffi._parser._declarations. This generates all the functions. + self._seen_constants = set() + self._generate("decl") + # + # the declaration of '_cffi_globals' and '_cffi_typenames' + nums = {} + for step_name in self.ALL_STEPS: + lst = self._lsts[step_name] + nums[step_name] = len(lst) + if nums[step_name] > 0: + prnt('static const struct _cffi_%s_s _cffi_%ss[] = {' % ( + step_name, step_name)) + for entry in lst: + prnt(entry.as_c_expr()) + prnt('};') + prnt() + # + # the declaration of '_cffi_includes' + if self.ffi._included_ffis: + prnt('static const char * const _cffi_includes[] = {') + for ffi_to_include in self.ffi._included_ffis: + try: + included_module_name, included_source = ( + ffi_to_include._assigned_source[:2]) + except AttributeError: + raise VerificationError( + "ffi object %r includes %r, but the latter has not " + "been prepared with set_source()" % ( + self.ffi, ffi_to_include,)) + if included_source is None: + raise VerificationError( + "not implemented yet: ffi.include() of a Python-based " + "ffi inside a C-based ffi") + prnt(' "%s",' % (included_module_name,)) + prnt(' NULL') + prnt('};') + prnt() + # + # the declaration of '_cffi_type_context' + prnt('static const struct _cffi_type_context_s _cffi_type_context = {') + prnt(' _cffi_types,') + for step_name in self.ALL_STEPS: + if nums[step_name] > 0: + prnt(' _cffi_%ss,' % step_name) + else: + prnt(' NULL, /* no %ss */' % step_name) + for step_name in self.ALL_STEPS: + if step_name != "field": + prnt(' %d, /* num_%ss */' % (nums[step_name], step_name)) + if self.ffi._included_ffis: + prnt(' _cffi_includes,') + else: + prnt(' NULL, /* no includes */') + prnt(' %d, /* num_types */' % (len(self.cffi_types),)) + flags = 0 + if self._num_externpy: + flags |= 1 # set to mean that we use extern "Python" + prnt(' %d, /* flags */' % flags) + prnt('};') + prnt() + # + # the init function + prnt('#ifdef __GNUC__') + prnt('# pragma GCC visibility push(default) /* for -fvisibility= */') + prnt('#endif') + prnt() + prnt('#ifdef PYPY_VERSION') + prnt('PyMODINIT_FUNC') + prnt('_cffi_pypyinit_%s(const void *p[])' % (base_module_name,)) + prnt('{') + if self._num_externpy: + prnt(' if (((intptr_t)p[0]) >= 0x0A03) {') + prnt(' _cffi_call_python_org = ' + '(void(*)(struct _cffi_externpy_s *, char *))p[1];') + prnt(' }') + prnt(' p[0] = (const void *)0x%x;' % self._version) + prnt(' p[1] = &_cffi_type_context;') + prnt('#if PY_MAJOR_VERSION >= 3') + prnt(' return NULL;') + prnt('#endif') + prnt('}') + # on Windows, distutils insists on putting init_cffi_xyz in + # 'export_symbols', so instead of fighting it, just give up and + # give it one + prnt('# ifdef _MSC_VER') + prnt(' PyMODINIT_FUNC') + prnt('# if PY_MAJOR_VERSION >= 3') + prnt(' PyInit_%s(void) { return NULL; }' % (base_module_name,)) + prnt('# else') + prnt(' init%s(void) { }' % (base_module_name,)) + prnt('# endif') + prnt('# endif') + prnt('#elif PY_MAJOR_VERSION >= 3') + prnt('PyMODINIT_FUNC') + prnt('PyInit_%s(void)' % (base_module_name,)) + prnt('{') + prnt(' return _cffi_init("%s", 0x%x, &_cffi_type_context);' % ( + self.module_name, self._version)) + prnt('}') + prnt('#else') + prnt('PyMODINIT_FUNC') + prnt('init%s(void)' % (base_module_name,)) + prnt('{') + prnt(' _cffi_init("%s", 0x%x, &_cffi_type_context);' % ( + self.module_name, self._version)) + prnt('}') + prnt('#endif') + prnt() + prnt('#ifdef __GNUC__') + prnt('# pragma GCC visibility pop') + prnt('#endif') + self._version = None + + def _to_py(self, x): + if isinstance(x, str): + return "b'%s'" % (x,) + if isinstance(x, (list, tuple)): + rep = [self._to_py(item) for item in x] + if len(rep) == 1: + rep.append('') + return "(%s)" % (','.join(rep),) + return x.as_python_expr() # Py2: unicode unexpected; Py3: bytes unexp. + + def write_py_source_to_f(self, f): + self._f = f + prnt = self._prnt + # + # header + prnt("# auto-generated file") + prnt("import _cffi_backend") + # + # the 'import' of the included ffis + num_includes = len(self.ffi._included_ffis or ()) + for i in range(num_includes): + ffi_to_include = self.ffi._included_ffis[i] + try: + included_module_name, included_source = ( + ffi_to_include._assigned_source[:2]) + except AttributeError: + raise VerificationError( + "ffi object %r includes %r, but the latter has not " + "been prepared with set_source()" % ( + self.ffi, ffi_to_include,)) + if included_source is not None: + raise VerificationError( + "not implemented yet: ffi.include() of a C-based " + "ffi inside a Python-based ffi") + prnt('from %s import ffi as _ffi%d' % (included_module_name, i)) + prnt() + prnt("ffi = _cffi_backend.FFI('%s'," % (self.module_name,)) + prnt(" _version = 0x%x," % (self._version,)) + self._version = None + # + # the '_types' keyword argument + self.cffi_types = tuple(self.cffi_types) # don't change any more + types_lst = [op.as_python_bytes() for op in self.cffi_types] + prnt(' _types = %s,' % (self._to_py(''.join(types_lst)),)) + typeindex2type = dict([(i, tp) for (tp, i) in self._typesdict.items()]) + # + # the keyword arguments from ALL_STEPS + for step_name in self.ALL_STEPS: + lst = self._lsts[step_name] + if len(lst) > 0 and step_name != "field": + prnt(' _%ss = %s,' % (step_name, self._to_py(lst))) + # + # the '_includes' keyword argument + if num_includes > 0: + prnt(' _includes = (%s,),' % ( + ', '.join(['_ffi%d' % i for i in range(num_includes)]),)) + # + # the footer + prnt(')') + + # ---------- + + def _gettypenum(self, type): + # a KeyError here is a bug. please report it! :-) + return self._typesdict[type] + + def _convert_funcarg_to_c(self, tp, fromvar, tovar, errcode): + extraarg = '' + if isinstance(tp, model.BasePrimitiveType) and not tp.is_complex_type(): + if tp.is_integer_type() and tp.name != '_Bool': + converter = '_cffi_to_c_int' + extraarg = ', %s' % tp.name + elif isinstance(tp, model.UnknownFloatType): + # don't check with is_float_type(): it may be a 'long + # double' here, and _cffi_to_c_double would loose precision + converter = '(%s)_cffi_to_c_double' % (tp.get_c_name(''),) + else: + cname = tp.get_c_name('') + converter = '(%s)_cffi_to_c_%s' % (cname, + tp.name.replace(' ', '_')) + if cname in ('char16_t', 'char32_t'): + self.needs_version(VERSION_CHAR16CHAR32) + errvalue = '-1' + # + elif isinstance(tp, model.PointerType): + self._convert_funcarg_to_c_ptr_or_array(tp, fromvar, + tovar, errcode) + return + # + elif (isinstance(tp, model.StructOrUnionOrEnum) or + isinstance(tp, model.BasePrimitiveType)): + # a struct (not a struct pointer) as a function argument; + # or, a complex (the same code works) + self._prnt(' if (_cffi_to_c((char *)&%s, _cffi_type(%d), %s) < 0)' + % (tovar, self._gettypenum(tp), fromvar)) + self._prnt(' %s;' % errcode) + return + # + elif isinstance(tp, model.FunctionPtrType): + converter = '(%s)_cffi_to_c_pointer' % tp.get_c_name('') + extraarg = ', _cffi_type(%d)' % self._gettypenum(tp) + errvalue = 'NULL' + # + else: + raise NotImplementedError(tp) + # + self._prnt(' %s = %s(%s%s);' % (tovar, converter, fromvar, extraarg)) + self._prnt(' if (%s == (%s)%s && PyErr_Occurred())' % ( + tovar, tp.get_c_name(''), errvalue)) + self._prnt(' %s;' % errcode) + + def _extra_local_variables(self, tp, localvars): + if isinstance(tp, model.PointerType): + localvars.add('Py_ssize_t datasize') + + def _convert_funcarg_to_c_ptr_or_array(self, tp, fromvar, tovar, errcode): + self._prnt(' datasize = _cffi_prepare_pointer_call_argument(') + self._prnt(' _cffi_type(%d), %s, (char **)&%s);' % ( + self._gettypenum(tp), fromvar, tovar)) + self._prnt(' if (datasize != 0) {') + self._prnt(' if (datasize < 0)') + self._prnt(' %s;' % errcode) + self._prnt(' %s = (%s)alloca((size_t)datasize);' % ( + tovar, tp.get_c_name(''))) + self._prnt(' memset((void *)%s, 0, (size_t)datasize);' % (tovar,)) + self._prnt(' if (_cffi_convert_array_from_object(' + '(char *)%s, _cffi_type(%d), %s) < 0)' % ( + tovar, self._gettypenum(tp), fromvar)) + self._prnt(' %s;' % errcode) + self._prnt(' }') + + def _convert_expr_from_c(self, tp, var, context): + if isinstance(tp, model.BasePrimitiveType): + if tp.is_integer_type() and tp.name != '_Bool': + return '_cffi_from_c_int(%s, %s)' % (var, tp.name) + elif isinstance(tp, model.UnknownFloatType): + return '_cffi_from_c_double(%s)' % (var,) + elif tp.name != 'long double' and not tp.is_complex_type(): + cname = tp.name.replace(' ', '_') + if cname in ('char16_t', 'char32_t'): + self.needs_version(VERSION_CHAR16CHAR32) + return '_cffi_from_c_%s(%s)' % (cname, var) + else: + return '_cffi_from_c_deref((char *)&%s, _cffi_type(%d))' % ( + var, self._gettypenum(tp)) + elif isinstance(tp, (model.PointerType, model.FunctionPtrType)): + return '_cffi_from_c_pointer((char *)%s, _cffi_type(%d))' % ( + var, self._gettypenum(tp)) + elif isinstance(tp, model.ArrayType): + return '_cffi_from_c_pointer((char *)%s, _cffi_type(%d))' % ( + var, self._gettypenum(model.PointerType(tp.item))) + elif isinstance(tp, model.StructOrUnion): + if tp.fldnames is None: + raise TypeError("'%s' is used as %s, but is opaque" % ( + tp._get_c_name(), context)) + return '_cffi_from_c_struct((char *)&%s, _cffi_type(%d))' % ( + var, self._gettypenum(tp)) + elif isinstance(tp, model.EnumType): + return '_cffi_from_c_deref((char *)&%s, _cffi_type(%d))' % ( + var, self._gettypenum(tp)) + else: + raise NotImplementedError(tp) + + # ---------- + # typedefs + + def _typedef_type(self, tp, name): + return self._global_type(tp, "(*(%s *)0)" % (name,)) + + def _generate_cpy_typedef_collecttype(self, tp, name): + self._do_collect_type(self._typedef_type(tp, name)) + + def _generate_cpy_typedef_decl(self, tp, name): + pass + + def _typedef_ctx(self, tp, name): + type_index = self._typesdict[tp] + self._lsts["typename"].append(TypenameExpr(name, type_index)) + + def _generate_cpy_typedef_ctx(self, tp, name): + tp = self._typedef_type(tp, name) + self._typedef_ctx(tp, name) + if getattr(tp, "origin", None) == "unknown_type": + self._struct_ctx(tp, tp.name, approxname=None) + elif isinstance(tp, model.NamedPointerType): + self._struct_ctx(tp.totype, tp.totype.name, approxname=tp.name, + named_ptr=tp) + + # ---------- + # function declarations + + def _generate_cpy_function_collecttype(self, tp, name): + self._do_collect_type(tp.as_raw_function()) + if tp.ellipsis and not self.target_is_python: + self._do_collect_type(tp) + + def _generate_cpy_function_decl(self, tp, name): + assert not self.target_is_python + assert isinstance(tp, model.FunctionPtrType) + if tp.ellipsis: + # cannot support vararg functions better than this: check for its + # exact type (including the fixed arguments), and build it as a + # constant function pointer (no CPython wrapper) + self._generate_cpy_constant_decl(tp, name) + return + prnt = self._prnt + numargs = len(tp.args) + if numargs == 0: + argname = 'noarg' + elif numargs == 1: + argname = 'arg0' + else: + argname = 'args' + # + # ------------------------------ + # the 'd' version of the function, only for addressof(lib, 'func') + arguments = [] + call_arguments = [] + context = 'argument of %s' % name + for i, type in enumerate(tp.args): + arguments.append(type.get_c_name(' x%d' % i, context)) + call_arguments.append('x%d' % i) + repr_arguments = ', '.join(arguments) + repr_arguments = repr_arguments or 'void' + if tp.abi: + abi = tp.abi + ' ' + else: + abi = '' + name_and_arguments = '%s_cffi_d_%s(%s)' % (abi, name, repr_arguments) + prnt('static %s' % (tp.result.get_c_name(name_and_arguments),)) + prnt('{') + call_arguments = ', '.join(call_arguments) + result_code = 'return ' + if isinstance(tp.result, model.VoidType): + result_code = '' + prnt(' %s%s(%s);' % (result_code, name, call_arguments)) + prnt('}') + # + prnt('#ifndef PYPY_VERSION') # ------------------------------ + # + prnt('static PyObject *') + prnt('_cffi_f_%s(PyObject *self, PyObject *%s)' % (name, argname)) + prnt('{') + # + context = 'argument of %s' % name + for i, type in enumerate(tp.args): + arg = type.get_c_name(' x%d' % i, context) + prnt(' %s;' % arg) + # + localvars = set() + for type in tp.args: + self._extra_local_variables(type, localvars) + for decl in localvars: + prnt(' %s;' % (decl,)) + # + if not isinstance(tp.result, model.VoidType): + result_code = 'result = ' + context = 'result of %s' % name + result_decl = ' %s;' % tp.result.get_c_name(' result', context) + prnt(result_decl) + else: + result_decl = None + result_code = '' + # + if len(tp.args) > 1: + rng = range(len(tp.args)) + for i in rng: + prnt(' PyObject *arg%d;' % i) + prnt() + prnt(' if (!PyArg_UnpackTuple(args, "%s", %d, %d, %s))' % ( + name, len(rng), len(rng), + ', '.join(['&arg%d' % i for i in rng]))) + prnt(' return NULL;') + prnt() + # + for i, type in enumerate(tp.args): + self._convert_funcarg_to_c(type, 'arg%d' % i, 'x%d' % i, + 'return NULL') + prnt() + # + prnt(' Py_BEGIN_ALLOW_THREADS') + prnt(' _cffi_restore_errno();') + call_arguments = ['x%d' % i for i in range(len(tp.args))] + call_arguments = ', '.join(call_arguments) + prnt(' { %s%s(%s); }' % (result_code, name, call_arguments)) + prnt(' _cffi_save_errno();') + prnt(' Py_END_ALLOW_THREADS') + prnt() + # + prnt(' (void)self; /* unused */') + if numargs == 0: + prnt(' (void)noarg; /* unused */') + if result_code: + prnt(' return %s;' % + self._convert_expr_from_c(tp.result, 'result', 'result type')) + else: + prnt(' Py_INCREF(Py_None);') + prnt(' return Py_None;') + prnt('}') + # + prnt('#else') # ------------------------------ + # + # the PyPy version: need to replace struct/union arguments with + # pointers, and if the result is a struct/union, insert a first + # arg that is a pointer to the result. We also do that for + # complex args and return type. + def need_indirection(type): + return (isinstance(type, model.StructOrUnion) or + (isinstance(type, model.PrimitiveType) and + type.is_complex_type())) + difference = False + arguments = [] + call_arguments = [] + context = 'argument of %s' % name + for i, type in enumerate(tp.args): + indirection = '' + if need_indirection(type): + indirection = '*' + difference = True + arg = type.get_c_name(' %sx%d' % (indirection, i), context) + arguments.append(arg) + call_arguments.append('%sx%d' % (indirection, i)) + tp_result = tp.result + if need_indirection(tp_result): + context = 'result of %s' % name + arg = tp_result.get_c_name(' *result', context) + arguments.insert(0, arg) + tp_result = model.void_type + result_decl = None + result_code = '*result = ' + difference = True + if difference: + repr_arguments = ', '.join(arguments) + repr_arguments = repr_arguments or 'void' + name_and_arguments = '%s_cffi_f_%s(%s)' % (abi, name, + repr_arguments) + prnt('static %s' % (tp_result.get_c_name(name_and_arguments),)) + prnt('{') + if result_decl: + prnt(result_decl) + call_arguments = ', '.join(call_arguments) + prnt(' { %s%s(%s); }' % (result_code, name, call_arguments)) + if result_decl: + prnt(' return result;') + prnt('}') + else: + prnt('# define _cffi_f_%s _cffi_d_%s' % (name, name)) + # + prnt('#endif') # ------------------------------ + prnt() + + def _generate_cpy_function_ctx(self, tp, name): + if tp.ellipsis and not self.target_is_python: + self._generate_cpy_constant_ctx(tp, name) + return + type_index = self._typesdict[tp.as_raw_function()] + numargs = len(tp.args) + if self.target_is_python: + meth_kind = OP_DLOPEN_FUNC + elif numargs == 0: + meth_kind = OP_CPYTHON_BLTN_N # 'METH_NOARGS' + elif numargs == 1: + meth_kind = OP_CPYTHON_BLTN_O # 'METH_O' + else: + meth_kind = OP_CPYTHON_BLTN_V # 'METH_VARARGS' + self._lsts["global"].append( + GlobalExpr(name, '_cffi_f_%s' % name, + CffiOp(meth_kind, type_index), + size='_cffi_d_%s' % name)) + + # ---------- + # named structs or unions + + def _field_type(self, tp_struct, field_name, tp_field): + if isinstance(tp_field, model.ArrayType): + actual_length = tp_field.length + if actual_length == '...': + ptr_struct_name = tp_struct.get_c_name('*') + actual_length = '_cffi_array_len(((%s)0)->%s)' % ( + ptr_struct_name, field_name) + tp_item = self._field_type(tp_struct, '%s[0]' % field_name, + tp_field.item) + tp_field = model.ArrayType(tp_item, actual_length) + return tp_field + + def _struct_collecttype(self, tp): + self._do_collect_type(tp) + if self.target_is_python: + # also requires nested anon struct/unions in ABI mode, recursively + for fldtype in tp.anonymous_struct_fields(): + self._struct_collecttype(fldtype) + + def _struct_decl(self, tp, cname, approxname): + if tp.fldtypes is None: + return + prnt = self._prnt + checkfuncname = '_cffi_checkfld_%s' % (approxname,) + prnt('_CFFI_UNUSED_FN') + prnt('static void %s(%s *p)' % (checkfuncname, cname)) + prnt('{') + prnt(' /* only to generate compile-time warnings or errors */') + prnt(' (void)p;') + for fname, ftype, fbitsize, fqual in tp.enumfields(): + try: + if ftype.is_integer_type() or fbitsize >= 0: + # accept all integers, but complain on float or double + prnt(" (void)((p->%s) | 0); /* check that '%s.%s' is " + "an integer */" % (fname, cname, fname)) + continue + # only accept exactly the type declared, except that '[]' + # is interpreted as a '*' and so will match any array length. + # (It would also match '*', but that's harder to detect...) + while (isinstance(ftype, model.ArrayType) + and (ftype.length is None or ftype.length == '...')): + ftype = ftype.item + fname = fname + '[0]' + prnt(' { %s = &p->%s; (void)tmp; }' % ( + ftype.get_c_name('*tmp', 'field %r'%fname, quals=fqual), + fname)) + except VerificationError as e: + prnt(' /* %s */' % str(e)) # cannot verify it, ignore + prnt('}') + prnt('struct _cffi_align_%s { char x; %s y; };' % (approxname, cname)) + prnt() + + def _struct_ctx(self, tp, cname, approxname, named_ptr=None): + type_index = self._typesdict[tp] + reason_for_not_expanding = None + flags = [] + if isinstance(tp, model.UnionType): + flags.append("_CFFI_F_UNION") + if tp.fldtypes is None: + flags.append("_CFFI_F_OPAQUE") + reason_for_not_expanding = "opaque" + if (tp not in self.ffi._parser._included_declarations and + (named_ptr is None or + named_ptr not in self.ffi._parser._included_declarations)): + if tp.fldtypes is None: + pass # opaque + elif tp.partial or any(tp.anonymous_struct_fields()): + pass # field layout obtained silently from the C compiler + else: + flags.append("_CFFI_F_CHECK_FIELDS") + if tp.packed: + if tp.packed > 1: + raise NotImplementedError( + "%r is declared with 'pack=%r'; only 0 or 1 are " + "supported in API mode (try to use \"...;\", which " + "does not require a 'pack' declaration)" % + (tp, tp.packed)) + flags.append("_CFFI_F_PACKED") + else: + flags.append("_CFFI_F_EXTERNAL") + reason_for_not_expanding = "external" + flags = '|'.join(flags) or '0' + c_fields = [] + if reason_for_not_expanding is None: + expand_anonymous_struct_union = not self.target_is_python + enumfields = list(tp.enumfields(expand_anonymous_struct_union)) + for fldname, fldtype, fbitsize, fqual in enumfields: + fldtype = self._field_type(tp, fldname, fldtype) + self._check_not_opaque(fldtype, + "field '%s.%s'" % (tp.name, fldname)) + # cname is None for _add_missing_struct_unions() only + op = OP_NOOP + if fbitsize >= 0: + op = OP_BITFIELD + size = '%d /* bits */' % fbitsize + elif cname is None or ( + isinstance(fldtype, model.ArrayType) and + fldtype.length is None): + size = '(size_t)-1' + else: + size = 'sizeof(((%s)0)->%s)' % ( + tp.get_c_name('*') if named_ptr is None + else named_ptr.name, + fldname) + if cname is None or fbitsize >= 0: + offset = '(size_t)-1' + elif named_ptr is not None: + offset = '((char *)&((%s)0)->%s) - (char *)0' % ( + named_ptr.name, fldname) + else: + offset = 'offsetof(%s, %s)' % (tp.get_c_name(''), fldname) + c_fields.append( + FieldExpr(fldname, offset, size, fbitsize, + CffiOp(op, self._typesdict[fldtype]))) + first_field_index = len(self._lsts["field"]) + self._lsts["field"].extend(c_fields) + # + if cname is None: # unknown name, for _add_missing_struct_unions + size = '(size_t)-2' + align = -2 + comment = "unnamed" + else: + if named_ptr is not None: + size = 'sizeof(*(%s)0)' % (named_ptr.name,) + align = '-1 /* unknown alignment */' + else: + size = 'sizeof(%s)' % (cname,) + align = 'offsetof(struct _cffi_align_%s, y)' % (approxname,) + comment = None + else: + size = '(size_t)-1' + align = -1 + first_field_index = -1 + comment = reason_for_not_expanding + self._lsts["struct_union"].append( + StructUnionExpr(tp.name, type_index, flags, size, align, comment, + first_field_index, c_fields)) + self._seen_struct_unions.add(tp) + + def _check_not_opaque(self, tp, location): + while isinstance(tp, model.ArrayType): + tp = tp.item + if isinstance(tp, model.StructOrUnion) and tp.fldtypes is None: + raise TypeError( + "%s is of an opaque type (not declared in cdef())" % location) + + def _add_missing_struct_unions(self): + # not very nice, but some struct declarations might be missing + # because they don't have any known C name. Check that they are + # not partial (we can't complete or verify them!) and emit them + # anonymously. + lst = list(self._struct_unions.items()) + lst.sort(key=lambda tp_order: tp_order[1]) + for tp, order in lst: + if tp not in self._seen_struct_unions: + if tp.partial: + raise NotImplementedError("internal inconsistency: %r is " + "partial but was not seen at " + "this point" % (tp,)) + if tp.name.startswith('$') and tp.name[1:].isdigit(): + approxname = tp.name[1:] + elif tp.name == '_IO_FILE' and tp.forcename == 'FILE': + approxname = 'FILE' + self._typedef_ctx(tp, 'FILE') + else: + raise NotImplementedError("internal inconsistency: %r" % + (tp,)) + self._struct_ctx(tp, None, approxname) + + def _generate_cpy_struct_collecttype(self, tp, name): + self._struct_collecttype(tp) + _generate_cpy_union_collecttype = _generate_cpy_struct_collecttype + + def _struct_names(self, tp): + cname = tp.get_c_name('') + if ' ' in cname: + return cname, cname.replace(' ', '_') + else: + return cname, '_' + cname + + def _generate_cpy_struct_decl(self, tp, name): + self._struct_decl(tp, *self._struct_names(tp)) + _generate_cpy_union_decl = _generate_cpy_struct_decl + + def _generate_cpy_struct_ctx(self, tp, name): + self._struct_ctx(tp, *self._struct_names(tp)) + _generate_cpy_union_ctx = _generate_cpy_struct_ctx + + # ---------- + # 'anonymous' declarations. These are produced for anonymous structs + # or unions; the 'name' is obtained by a typedef. + + def _generate_cpy_anonymous_collecttype(self, tp, name): + if isinstance(tp, model.EnumType): + self._generate_cpy_enum_collecttype(tp, name) + else: + self._struct_collecttype(tp) + + def _generate_cpy_anonymous_decl(self, tp, name): + if isinstance(tp, model.EnumType): + self._generate_cpy_enum_decl(tp) + else: + self._struct_decl(tp, name, 'typedef_' + name) + + def _generate_cpy_anonymous_ctx(self, tp, name): + if isinstance(tp, model.EnumType): + self._enum_ctx(tp, name) + else: + self._struct_ctx(tp, name, 'typedef_' + name) + + # ---------- + # constants, declared with "static const ..." + + def _generate_cpy_const(self, is_int, name, tp=None, category='const', + check_value=None): + if (category, name) in self._seen_constants: + raise VerificationError( + "duplicate declaration of %s '%s'" % (category, name)) + self._seen_constants.add((category, name)) + # + prnt = self._prnt + funcname = '_cffi_%s_%s' % (category, name) + if is_int: + prnt('static int %s(unsigned long long *o)' % funcname) + prnt('{') + prnt(' int n = (%s) <= 0;' % (name,)) + prnt(' *o = (unsigned long long)((%s) | 0);' + ' /* check that %s is an integer */' % (name, name)) + if check_value is not None: + if check_value > 0: + check_value = '%dU' % (check_value,) + prnt(' if (!_cffi_check_int(*o, n, %s))' % (check_value,)) + prnt(' n |= 2;') + prnt(' return n;') + prnt('}') + else: + assert check_value is None + prnt('static void %s(char *o)' % funcname) + prnt('{') + prnt(' *(%s)o = %s;' % (tp.get_c_name('*'), name)) + prnt('}') + prnt() + + def _generate_cpy_constant_collecttype(self, tp, name): + is_int = tp.is_integer_type() + if not is_int or self.target_is_python: + self._do_collect_type(tp) + + def _generate_cpy_constant_decl(self, tp, name): + is_int = tp.is_integer_type() + self._generate_cpy_const(is_int, name, tp) + + def _generate_cpy_constant_ctx(self, tp, name): + if not self.target_is_python and tp.is_integer_type(): + type_op = CffiOp(OP_CONSTANT_INT, -1) + else: + if self.target_is_python: + const_kind = OP_DLOPEN_CONST + else: + const_kind = OP_CONSTANT + type_index = self._typesdict[tp] + type_op = CffiOp(const_kind, type_index) + self._lsts["global"].append( + GlobalExpr(name, '_cffi_const_%s' % name, type_op)) + + # ---------- + # enums + + def _generate_cpy_enum_collecttype(self, tp, name): + self._do_collect_type(tp) + + def _generate_cpy_enum_decl(self, tp, name=None): + for enumerator in tp.enumerators: + self._generate_cpy_const(True, enumerator) + + def _enum_ctx(self, tp, cname): + type_index = self._typesdict[tp] + type_op = CffiOp(OP_ENUM, -1) + if self.target_is_python: + tp.check_not_partial() + for enumerator, enumvalue in zip(tp.enumerators, tp.enumvalues): + self._lsts["global"].append( + GlobalExpr(enumerator, '_cffi_const_%s' % enumerator, type_op, + check_value=enumvalue)) + # + if cname is not None and '$' not in cname and not self.target_is_python: + size = "sizeof(%s)" % cname + signed = "((%s)-1) <= 0" % cname + else: + basetp = tp.build_baseinttype(self.ffi, []) + size = self.ffi.sizeof(basetp) + signed = int(int(self.ffi.cast(basetp, -1)) < 0) + allenums = ",".join(tp.enumerators) + self._lsts["enum"].append( + EnumExpr(tp.name, type_index, size, signed, allenums)) + + def _generate_cpy_enum_ctx(self, tp, name): + self._enum_ctx(tp, tp._get_c_name()) + + # ---------- + # macros: for now only for integers + + def _generate_cpy_macro_collecttype(self, tp, name): + pass + + def _generate_cpy_macro_decl(self, tp, name): + if tp == '...': + check_value = None + else: + check_value = tp # an integer + self._generate_cpy_const(True, name, check_value=check_value) + + def _generate_cpy_macro_ctx(self, tp, name): + if tp == '...': + if self.target_is_python: + raise VerificationError( + "cannot use the syntax '...' in '#define %s ...' when " + "using the ABI mode" % (name,)) + check_value = None + else: + check_value = tp # an integer + type_op = CffiOp(OP_CONSTANT_INT, -1) + self._lsts["global"].append( + GlobalExpr(name, '_cffi_const_%s' % name, type_op, + check_value=check_value)) + + # ---------- + # global variables + + def _global_type(self, tp, global_name): + if isinstance(tp, model.ArrayType): + actual_length = tp.length + if actual_length == '...': + actual_length = '_cffi_array_len(%s)' % (global_name,) + tp_item = self._global_type(tp.item, '%s[0]' % global_name) + tp = model.ArrayType(tp_item, actual_length) + return tp + + def _generate_cpy_variable_collecttype(self, tp, name): + self._do_collect_type(self._global_type(tp, name)) + + def _generate_cpy_variable_decl(self, tp, name): + prnt = self._prnt + tp = self._global_type(tp, name) + if isinstance(tp, model.ArrayType) and tp.length is None: + tp = tp.item + ampersand = '' + else: + ampersand = '&' + # This code assumes that casts from "tp *" to "void *" is a + # no-op, i.e. a function that returns a "tp *" can be called + # as if it returned a "void *". This should be generally true + # on any modern machine. The only exception to that rule (on + # uncommon architectures, and as far as I can tell) might be + # if 'tp' were a function type, but that is not possible here. + # (If 'tp' is a function _pointer_ type, then casts from "fn_t + # **" to "void *" are again no-ops, as far as I can tell.) + decl = '*_cffi_var_%s(void)' % (name,) + prnt('static ' + tp.get_c_name(decl, quals=self._current_quals)) + prnt('{') + prnt(' return %s(%s);' % (ampersand, name)) + prnt('}') + prnt() + + def _generate_cpy_variable_ctx(self, tp, name): + tp = self._global_type(tp, name) + type_index = self._typesdict[tp] + if self.target_is_python: + op = OP_GLOBAL_VAR + else: + op = OP_GLOBAL_VAR_F + self._lsts["global"].append( + GlobalExpr(name, '_cffi_var_%s' % name, CffiOp(op, type_index))) + + # ---------- + # extern "Python" + + def _generate_cpy_extern_python_collecttype(self, tp, name): + assert isinstance(tp, model.FunctionPtrType) + self._do_collect_type(tp) + _generate_cpy_dllexport_python_collecttype = \ + _generate_cpy_extern_python_plus_c_collecttype = \ + _generate_cpy_extern_python_collecttype + + def _extern_python_decl(self, tp, name, tag_and_space): + prnt = self._prnt + if isinstance(tp.result, model.VoidType): + size_of_result = '0' + else: + context = 'result of %s' % name + size_of_result = '(int)sizeof(%s)' % ( + tp.result.get_c_name('', context),) + prnt('static struct _cffi_externpy_s _cffi_externpy__%s =' % name) + prnt(' { "%s.%s", %s };' % (self.module_name, name, size_of_result)) + prnt() + # + arguments = [] + context = 'argument of %s' % name + for i, type in enumerate(tp.args): + arg = type.get_c_name(' a%d' % i, context) + arguments.append(arg) + # + repr_arguments = ', '.join(arguments) + repr_arguments = repr_arguments or 'void' + name_and_arguments = '%s(%s)' % (name, repr_arguments) + if tp.abi == "__stdcall": + name_and_arguments = '_cffi_stdcall ' + name_and_arguments + # + def may_need_128_bits(tp): + return (isinstance(tp, model.PrimitiveType) and + tp.name == 'long double') + # + size_of_a = max(len(tp.args)*8, 8) + if may_need_128_bits(tp.result): + size_of_a = max(size_of_a, 16) + if isinstance(tp.result, model.StructOrUnion): + size_of_a = 'sizeof(%s) > %d ? sizeof(%s) : %d' % ( + tp.result.get_c_name(''), size_of_a, + tp.result.get_c_name(''), size_of_a) + prnt('%s%s' % (tag_and_space, tp.result.get_c_name(name_and_arguments))) + prnt('{') + prnt(' char a[%s];' % size_of_a) + prnt(' char *p = a;') + for i, type in enumerate(tp.args): + arg = 'a%d' % i + if (isinstance(type, model.StructOrUnion) or + may_need_128_bits(type)): + arg = '&' + arg + type = model.PointerType(type) + prnt(' *(%s)(p + %d) = %s;' % (type.get_c_name('*'), i*8, arg)) + prnt(' _cffi_call_python(&_cffi_externpy__%s, p);' % name) + if not isinstance(tp.result, model.VoidType): + prnt(' return *(%s)p;' % (tp.result.get_c_name('*'),)) + prnt('}') + prnt() + self._num_externpy += 1 + + def _generate_cpy_extern_python_decl(self, tp, name): + self._extern_python_decl(tp, name, 'static ') + + def _generate_cpy_dllexport_python_decl(self, tp, name): + self._extern_python_decl(tp, name, 'CFFI_DLLEXPORT ') + + def _generate_cpy_extern_python_plus_c_decl(self, tp, name): + self._extern_python_decl(tp, name, '') + + def _generate_cpy_extern_python_ctx(self, tp, name): + if self.target_is_python: + raise VerificationError( + "cannot use 'extern \"Python\"' in the ABI mode") + if tp.ellipsis: + raise NotImplementedError("a vararg function is extern \"Python\"") + type_index = self._typesdict[tp] + type_op = CffiOp(OP_EXTERN_PYTHON, type_index) + self._lsts["global"].append( + GlobalExpr(name, '&_cffi_externpy__%s' % name, type_op, name)) + + _generate_cpy_dllexport_python_ctx = \ + _generate_cpy_extern_python_plus_c_ctx = \ + _generate_cpy_extern_python_ctx + + def _print_string_literal_in_array(self, s): + prnt = self._prnt + prnt('// # NB. this is not a string because of a size limit in MSVC') + for line in s.splitlines(True): + prnt(('// ' + line).rstrip()) + printed_line = '' + for c in line: + if len(printed_line) >= 76: + prnt(printed_line) + printed_line = '' + printed_line += '%d,' % (ord(c),) + prnt(printed_line) + + # ---------- + # emitting the opcodes for individual types + + def _emit_bytecode_VoidType(self, tp, index): + self.cffi_types[index] = CffiOp(OP_PRIMITIVE, PRIM_VOID) + + def _emit_bytecode_PrimitiveType(self, tp, index): + prim_index = PRIMITIVE_TO_INDEX[tp.name] + self.cffi_types[index] = CffiOp(OP_PRIMITIVE, prim_index) + + def _emit_bytecode_UnknownIntegerType(self, tp, index): + s = ('_cffi_prim_int(sizeof(%s), (\n' + ' ((%s)-1) | 0 /* check that %s is an integer type */\n' + ' ) <= 0)' % (tp.name, tp.name, tp.name)) + self.cffi_types[index] = CffiOp(OP_PRIMITIVE, s) + + def _emit_bytecode_UnknownFloatType(self, tp, index): + s = ('_cffi_prim_float(sizeof(%s) *\n' + ' (((%s)1) / 2) * 2 /* integer => 0, float => 1 */\n' + ' )' % (tp.name, tp.name)) + self.cffi_types[index] = CffiOp(OP_PRIMITIVE, s) + + def _emit_bytecode_RawFunctionType(self, tp, index): + self.cffi_types[index] = CffiOp(OP_FUNCTION, self._typesdict[tp.result]) + index += 1 + for tp1 in tp.args: + realindex = self._typesdict[tp1] + if index != realindex: + if isinstance(tp1, model.PrimitiveType): + self._emit_bytecode_PrimitiveType(tp1, index) + else: + self.cffi_types[index] = CffiOp(OP_NOOP, realindex) + index += 1 + flags = int(tp.ellipsis) + if tp.abi is not None: + if tp.abi == '__stdcall': + flags |= 2 + else: + raise NotImplementedError("abi=%r" % (tp.abi,)) + self.cffi_types[index] = CffiOp(OP_FUNCTION_END, flags) + + def _emit_bytecode_PointerType(self, tp, index): + self.cffi_types[index] = CffiOp(OP_POINTER, self._typesdict[tp.totype]) + + _emit_bytecode_ConstPointerType = _emit_bytecode_PointerType + _emit_bytecode_NamedPointerType = _emit_bytecode_PointerType + + def _emit_bytecode_FunctionPtrType(self, tp, index): + raw = tp.as_raw_function() + self.cffi_types[index] = CffiOp(OP_POINTER, self._typesdict[raw]) + + def _emit_bytecode_ArrayType(self, tp, index): + item_index = self._typesdict[tp.item] + if tp.length is None: + self.cffi_types[index] = CffiOp(OP_OPEN_ARRAY, item_index) + elif tp.length == '...': + raise VerificationError( + "type %s badly placed: the '...' array length can only be " + "used on global arrays or on fields of structures" % ( + str(tp).replace('/*...*/', '...'),)) + else: + assert self.cffi_types[index + 1] == 'LEN' + self.cffi_types[index] = CffiOp(OP_ARRAY, item_index) + self.cffi_types[index + 1] = CffiOp(None, str(tp.length)) + + def _emit_bytecode_StructType(self, tp, index): + struct_index = self._struct_unions[tp] + self.cffi_types[index] = CffiOp(OP_STRUCT_UNION, struct_index) + _emit_bytecode_UnionType = _emit_bytecode_StructType + + def _emit_bytecode_EnumType(self, tp, index): + enum_index = self._enums[tp] + self.cffi_types[index] = CffiOp(OP_ENUM, enum_index) + + +if sys.version_info >= (3,): + NativeIO = io.StringIO +else: + class NativeIO(io.BytesIO): + def write(self, s): + if isinstance(s, unicode): + s = s.encode('ascii') + super(NativeIO, self).write(s) + +def _make_c_or_py_source(ffi, module_name, preamble, target_file, verbose): + if verbose: + print("generating %s" % (target_file,)) + recompiler = Recompiler(ffi, module_name, + target_is_python=(preamble is None)) + recompiler.collect_type_table() + recompiler.collect_step_tables() + f = NativeIO() + recompiler.write_source_to_f(f, preamble) + output = f.getvalue() + try: + with open(target_file, 'r') as f1: + if f1.read(len(output) + 1) != output: + raise IOError + if verbose: + print("(already up-to-date)") + return False # already up-to-date + except IOError: + tmp_file = '%s.~%d' % (target_file, os.getpid()) + with open(tmp_file, 'w') as f1: + f1.write(output) + try: + os.rename(tmp_file, target_file) + except OSError: + os.unlink(target_file) + os.rename(tmp_file, target_file) + return True + +def make_c_source(ffi, module_name, preamble, target_c_file, verbose=False): + assert preamble is not None + return _make_c_or_py_source(ffi, module_name, preamble, target_c_file, + verbose) + +def make_py_source(ffi, module_name, target_py_file, verbose=False): + return _make_c_or_py_source(ffi, module_name, None, target_py_file, + verbose) + +def _modname_to_file(outputdir, modname, extension): + parts = modname.split('.') + try: + os.makedirs(os.path.join(outputdir, *parts[:-1])) + except OSError: + pass + parts[-1] += extension + return os.path.join(outputdir, *parts), parts + + +# Aaargh. Distutils is not tested at all for the purpose of compiling +# DLLs that are not extension modules. Here are some hacks to work +# around that, in the _patch_for_*() functions... + +def _patch_meth(patchlist, cls, name, new_meth): + old = getattr(cls, name) + patchlist.append((cls, name, old)) + setattr(cls, name, new_meth) + return old + +def _unpatch_meths(patchlist): + for cls, name, old_meth in reversed(patchlist): + setattr(cls, name, old_meth) + +def _patch_for_embedding(patchlist): + if sys.platform == 'win32': + # we must not remove the manifest when building for embedding! + from distutils.msvc9compiler import MSVCCompiler + _patch_meth(patchlist, MSVCCompiler, '_remove_visual_c_ref', + lambda self, manifest_file: manifest_file) + + if sys.platform == 'darwin': + # we must not make a '-bundle', but a '-dynamiclib' instead + from distutils.ccompiler import CCompiler + def my_link_shared_object(self, *args, **kwds): + if '-bundle' in self.linker_so: + self.linker_so = list(self.linker_so) + i = self.linker_so.index('-bundle') + self.linker_so[i] = '-dynamiclib' + return old_link_shared_object(self, *args, **kwds) + old_link_shared_object = _patch_meth(patchlist, CCompiler, + 'link_shared_object', + my_link_shared_object) + +def _patch_for_target(patchlist, target): + from distutils.command.build_ext import build_ext + # if 'target' is different from '*', we need to patch some internal + # method to just return this 'target' value, instead of having it + # built from module_name + if target.endswith('.*'): + target = target[:-2] + if sys.platform == 'win32': + target += '.dll' + elif sys.platform == 'darwin': + target += '.dylib' + else: + target += '.so' + _patch_meth(patchlist, build_ext, 'get_ext_filename', + lambda self, ext_name: target) + + +def recompile(ffi, module_name, preamble, tmpdir='.', call_c_compiler=True, + c_file=None, source_extension='.c', extradir=None, + compiler_verbose=1, target=None, debug=None, **kwds): + if not isinstance(module_name, str): + module_name = module_name.encode('ascii') + if ffi._windows_unicode: + ffi._apply_windows_unicode(kwds) + if preamble is not None: + embedding = (ffi._embedding is not None) + if embedding: + ffi._apply_embedding_fix(kwds) + if c_file is None: + c_file, parts = _modname_to_file(tmpdir, module_name, + source_extension) + if extradir: + parts = [extradir] + parts + ext_c_file = os.path.join(*parts) + else: + ext_c_file = c_file + # + if target is None: + if embedding: + target = '%s.*' % module_name + else: + target = '*' + # + ext = ffiplatform.get_extension(ext_c_file, module_name, **kwds) + updated = make_c_source(ffi, module_name, preamble, c_file, + verbose=compiler_verbose) + if call_c_compiler: + patchlist = [] + cwd = os.getcwd() + try: + if embedding: + _patch_for_embedding(patchlist) + if target != '*': + _patch_for_target(patchlist, target) + if compiler_verbose: + if tmpdir == '.': + msg = 'the current directory is' + else: + msg = 'setting the current directory to' + print('%s %r' % (msg, os.path.abspath(tmpdir))) + os.chdir(tmpdir) + outputfilename = ffiplatform.compile('.', ext, + compiler_verbose, debug) + finally: + os.chdir(cwd) + _unpatch_meths(patchlist) + return outputfilename + else: + return ext, updated + else: + if c_file is None: + c_file, _ = _modname_to_file(tmpdir, module_name, '.py') + updated = make_py_source(ffi, module_name, c_file, + verbose=compiler_verbose) + if call_c_compiler: + return c_file + else: + return None, updated + diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/cffi/setuptools_ext.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/cffi/setuptools_ext.py new file mode 100644 index 00000000..df5a5183 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/cffi/setuptools_ext.py @@ -0,0 +1,217 @@ +import os +import sys + +try: + basestring +except NameError: + # Python 3.x + basestring = str + +def error(msg): + from distutils.errors import DistutilsSetupError + raise DistutilsSetupError(msg) + + +def execfile(filename, glob): + # We use execfile() (here rewritten for Python 3) instead of + # __import__() to load the build script. The problem with + # a normal import is that in some packages, the intermediate + # __init__.py files may already try to import the file that + # we are generating. + with open(filename) as f: + src = f.read() + src += '\n' # Python 2.6 compatibility + code = compile(src, filename, 'exec') + exec(code, glob, glob) + + +def add_cffi_module(dist, mod_spec): + from cffi.api import FFI + + if not isinstance(mod_spec, basestring): + error("argument to 'cffi_modules=...' must be a str or a list of str," + " not %r" % (type(mod_spec).__name__,)) + mod_spec = str(mod_spec) + try: + build_file_name, ffi_var_name = mod_spec.split(':') + except ValueError: + error("%r must be of the form 'path/build.py:ffi_variable'" % + (mod_spec,)) + if not os.path.exists(build_file_name): + ext = '' + rewritten = build_file_name.replace('.', '/') + '.py' + if os.path.exists(rewritten): + ext = ' (rewrite cffi_modules to [%r])' % ( + rewritten + ':' + ffi_var_name,) + error("%r does not name an existing file%s" % (build_file_name, ext)) + + mod_vars = {'__name__': '__cffi__', '__file__': build_file_name} + execfile(build_file_name, mod_vars) + + try: + ffi = mod_vars[ffi_var_name] + except KeyError: + error("%r: object %r not found in module" % (mod_spec, + ffi_var_name)) + if not isinstance(ffi, FFI): + ffi = ffi() # maybe it's a function instead of directly an ffi + if not isinstance(ffi, FFI): + error("%r is not an FFI instance (got %r)" % (mod_spec, + type(ffi).__name__)) + if not hasattr(ffi, '_assigned_source'): + error("%r: the set_source() method was not called" % (mod_spec,)) + module_name, source, source_extension, kwds = ffi._assigned_source + if ffi._windows_unicode: + kwds = kwds.copy() + ffi._apply_windows_unicode(kwds) + + if source is None: + _add_py_module(dist, ffi, module_name) + else: + _add_c_module(dist, ffi, module_name, source, source_extension, kwds) + +def _set_py_limited_api(Extension, kwds): + """ + Add py_limited_api to kwds if setuptools >= 26 is in use. + Do not alter the setting if it already exists. + Setuptools takes care of ignoring the flag on Python 2 and PyPy. + + CPython itself should ignore the flag in a debugging version + (by not listing .abi3.so in the extensions it supports), but + it doesn't so far, creating troubles. That's why we check + for "not hasattr(sys, 'gettotalrefcount')" (the 2.7 compatible equivalent + of 'd' not in sys.abiflags). (http://bugs.python.org/issue28401) + + On Windows, with CPython <= 3.4, it's better not to use py_limited_api + because virtualenv *still* doesn't copy PYTHON3.DLL on these versions. + For now we'll skip py_limited_api on all Windows versions to avoid an + inconsistent mess. + """ + if ('py_limited_api' not in kwds and not hasattr(sys, 'gettotalrefcount') + and sys.platform != 'win32'): + import setuptools + try: + setuptools_major_version = int(setuptools.__version__.partition('.')[0]) + if setuptools_major_version >= 26: + kwds['py_limited_api'] = True + except ValueError: # certain development versions of setuptools + # If we don't know the version number of setuptools, we + # try to set 'py_limited_api' anyway. At worst, we get a + # warning. + kwds['py_limited_api'] = True + return kwds + +def _add_c_module(dist, ffi, module_name, source, source_extension, kwds): + from distutils.core import Extension + # We are a setuptools extension. Need this build_ext for py_limited_api. + from setuptools.command.build_ext import build_ext + from distutils.dir_util import mkpath + from distutils import log + from cffi import recompiler + + allsources = ['$PLACEHOLDER'] + allsources.extend(kwds.pop('sources', [])) + kwds = _set_py_limited_api(Extension, kwds) + ext = Extension(name=module_name, sources=allsources, **kwds) + + def make_mod(tmpdir, pre_run=None): + c_file = os.path.join(tmpdir, module_name + source_extension) + log.info("generating cffi module %r" % c_file) + mkpath(tmpdir) + # a setuptools-only, API-only hook: called with the "ext" and "ffi" + # arguments just before we turn the ffi into C code. To use it, + # subclass the 'distutils.command.build_ext.build_ext' class and + # add a method 'def pre_run(self, ext, ffi)'. + if pre_run is not None: + pre_run(ext, ffi) + updated = recompiler.make_c_source(ffi, module_name, source, c_file) + if not updated: + log.info("already up-to-date") + return c_file + + if dist.ext_modules is None: + dist.ext_modules = [] + dist.ext_modules.append(ext) + + base_class = dist.cmdclass.get('build_ext', build_ext) + class build_ext_make_mod(base_class): + def run(self): + if ext.sources[0] == '$PLACEHOLDER': + pre_run = getattr(self, 'pre_run', None) + ext.sources[0] = make_mod(self.build_temp, pre_run) + base_class.run(self) + dist.cmdclass['build_ext'] = build_ext_make_mod + # NB. multiple runs here will create multiple 'build_ext_make_mod' + # classes. Even in this case the 'build_ext' command should be + # run once; but just in case, the logic above does nothing if + # called again. + + +def _add_py_module(dist, ffi, module_name): + from distutils.dir_util import mkpath + from setuptools.command.build_py import build_py + from setuptools.command.build_ext import build_ext + from distutils import log + from cffi import recompiler + + def generate_mod(py_file): + log.info("generating cffi module %r" % py_file) + mkpath(os.path.dirname(py_file)) + updated = recompiler.make_py_source(ffi, module_name, py_file) + if not updated: + log.info("already up-to-date") + + base_class = dist.cmdclass.get('build_py', build_py) + class build_py_make_mod(base_class): + def run(self): + base_class.run(self) + module_path = module_name.split('.') + module_path[-1] += '.py' + generate_mod(os.path.join(self.build_lib, *module_path)) + def get_source_files(self): + # This is called from 'setup.py sdist' only. Exclude + # the generate .py module in this case. + saved_py_modules = self.py_modules + try: + if saved_py_modules: + self.py_modules = [m for m in saved_py_modules + if m != module_name] + return base_class.get_source_files(self) + finally: + self.py_modules = saved_py_modules + dist.cmdclass['build_py'] = build_py_make_mod + + # distutils and setuptools have no notion I could find of a + # generated python module. If we don't add module_name to + # dist.py_modules, then things mostly work but there are some + # combination of options (--root and --record) that will miss + # the module. So we add it here, which gives a few apparently + # harmless warnings about not finding the file outside the + # build directory. + # Then we need to hack more in get_source_files(); see above. + if dist.py_modules is None: + dist.py_modules = [] + dist.py_modules.append(module_name) + + # the following is only for "build_ext -i" + base_class_2 = dist.cmdclass.get('build_ext', build_ext) + class build_ext_make_mod(base_class_2): + def run(self): + base_class_2.run(self) + if self.inplace: + # from get_ext_fullpath() in distutils/command/build_ext.py + module_path = module_name.split('.') + package = '.'.join(module_path[:-1]) + build_py = self.get_finalized_command('build_py') + package_dir = build_py.get_package_dir(package) + file_name = module_path[-1] + '.py' + generate_mod(os.path.join(package_dir, file_name)) + dist.cmdclass['build_ext'] = build_ext_make_mod + +def cffi_modules(dist, attr, value): + assert attr == 'cffi_modules' + if isinstance(value, basestring): + value = [value] + + for cffi_module in value: + add_cffi_module(dist, cffi_module) diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/cffi/vengine_cpy.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/cffi/vengine_cpy.py new file mode 100644 index 00000000..536f11f8 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/cffi/vengine_cpy.py @@ -0,0 +1,1015 @@ +# +# DEPRECATED: implementation for ffi.verify() +# +import sys, imp +from . import model +from .error import VerificationError + + +class VCPythonEngine(object): + _class_key = 'x' + _gen_python_module = True + + def __init__(self, verifier): + self.verifier = verifier + self.ffi = verifier.ffi + self._struct_pending_verification = {} + self._types_of_builtin_functions = {} + + def patch_extension_kwds(self, kwds): + pass + + def find_module(self, module_name, path, so_suffixes): + try: + f, filename, descr = imp.find_module(module_name, path) + except ImportError: + return None + if f is not None: + f.close() + # Note that after a setuptools installation, there are both .py + # and .so files with the same basename. The code here relies on + # imp.find_module() locating the .so in priority. + if descr[0] not in so_suffixes: + return None + return filename + + def collect_types(self): + self._typesdict = {} + self._generate("collecttype") + + def _prnt(self, what=''): + self._f.write(what + '\n') + + def _gettypenum(self, type): + # a KeyError here is a bug. please report it! :-) + return self._typesdict[type] + + def _do_collect_type(self, tp): + if ((not isinstance(tp, model.PrimitiveType) + or tp.name == 'long double') + and tp not in self._typesdict): + num = len(self._typesdict) + self._typesdict[tp] = num + + def write_source_to_f(self): + self.collect_types() + # + # The new module will have a _cffi_setup() function that receives + # objects from the ffi world, and that calls some setup code in + # the module. This setup code is split in several independent + # functions, e.g. one per constant. The functions are "chained" + # by ending in a tail call to each other. + # + # This is further split in two chained lists, depending on if we + # can do it at import-time or if we must wait for _cffi_setup() to + # provide us with the objects. This is needed because we + # need the values of the enum constants in order to build the + # that we may have to pass to _cffi_setup(). + # + # The following two 'chained_list_constants' items contains + # the head of these two chained lists, as a string that gives the + # call to do, if any. + self._chained_list_constants = ['((void)lib,0)', '((void)lib,0)'] + # + prnt = self._prnt + # first paste some standard set of lines that are mostly '#define' + prnt(cffimod_header) + prnt() + # then paste the C source given by the user, verbatim. + prnt(self.verifier.preamble) + prnt() + # + # call generate_cpy_xxx_decl(), for every xxx found from + # ffi._parser._declarations. This generates all the functions. + self._generate("decl") + # + # implement the function _cffi_setup_custom() as calling the + # head of the chained list. + self._generate_setup_custom() + prnt() + # + # produce the method table, including the entries for the + # generated Python->C function wrappers, which are done + # by generate_cpy_function_method(). + prnt('static PyMethodDef _cffi_methods[] = {') + self._generate("method") + prnt(' {"_cffi_setup", _cffi_setup, METH_VARARGS, NULL},') + prnt(' {NULL, NULL, 0, NULL} /* Sentinel */') + prnt('};') + prnt() + # + # standard init. + modname = self.verifier.get_module_name() + constants = self._chained_list_constants[False] + prnt('#if PY_MAJOR_VERSION >= 3') + prnt() + prnt('static struct PyModuleDef _cffi_module_def = {') + prnt(' PyModuleDef_HEAD_INIT,') + prnt(' "%s",' % modname) + prnt(' NULL,') + prnt(' -1,') + prnt(' _cffi_methods,') + prnt(' NULL, NULL, NULL, NULL') + prnt('};') + prnt() + prnt('PyMODINIT_FUNC') + prnt('PyInit_%s(void)' % modname) + prnt('{') + prnt(' PyObject *lib;') + prnt(' lib = PyModule_Create(&_cffi_module_def);') + prnt(' if (lib == NULL)') + prnt(' return NULL;') + prnt(' if (%s < 0 || _cffi_init() < 0) {' % (constants,)) + prnt(' Py_DECREF(lib);') + prnt(' return NULL;') + prnt(' }') + prnt(' return lib;') + prnt('}') + prnt() + prnt('#else') + prnt() + prnt('PyMODINIT_FUNC') + prnt('init%s(void)' % modname) + prnt('{') + prnt(' PyObject *lib;') + prnt(' lib = Py_InitModule("%s", _cffi_methods);' % modname) + prnt(' if (lib == NULL)') + prnt(' return;') + prnt(' if (%s < 0 || _cffi_init() < 0)' % (constants,)) + prnt(' return;') + prnt(' return;') + prnt('}') + prnt() + prnt('#endif') + + def load_library(self, flags=None): + # XXX review all usages of 'self' here! + # import it as a new extension module + imp.acquire_lock() + try: + if hasattr(sys, "getdlopenflags"): + previous_flags = sys.getdlopenflags() + try: + if hasattr(sys, "setdlopenflags") and flags is not None: + sys.setdlopenflags(flags) + module = imp.load_dynamic(self.verifier.get_module_name(), + self.verifier.modulefilename) + except ImportError as e: + error = "importing %r: %s" % (self.verifier.modulefilename, e) + raise VerificationError(error) + finally: + if hasattr(sys, "setdlopenflags"): + sys.setdlopenflags(previous_flags) + finally: + imp.release_lock() + # + # call loading_cpy_struct() to get the struct layout inferred by + # the C compiler + self._load(module, 'loading') + # + # the C code will need the objects. Collect them in + # order in a list. + revmapping = dict([(value, key) + for (key, value) in self._typesdict.items()]) + lst = [revmapping[i] for i in range(len(revmapping))] + lst = list(map(self.ffi._get_cached_btype, lst)) + # + # build the FFILibrary class and instance and call _cffi_setup(). + # this will set up some fields like '_cffi_types', and only then + # it will invoke the chained list of functions that will really + # build (notably) the constant objects, as if they are + # pointers, and store them as attributes on the 'library' object. + class FFILibrary(object): + _cffi_python_module = module + _cffi_ffi = self.ffi + _cffi_dir = [] + def __dir__(self): + return FFILibrary._cffi_dir + list(self.__dict__) + library = FFILibrary() + if module._cffi_setup(lst, VerificationError, library): + import warnings + warnings.warn("reimporting %r might overwrite older definitions" + % (self.verifier.get_module_name())) + # + # finally, call the loaded_cpy_xxx() functions. This will perform + # the final adjustments, like copying the Python->C wrapper + # functions from the module to the 'library' object, and setting + # up the FFILibrary class with properties for the global C variables. + self._load(module, 'loaded', library=library) + module._cffi_original_ffi = self.ffi + module._cffi_types_of_builtin_funcs = self._types_of_builtin_functions + return library + + def _get_declarations(self): + lst = [(key, tp) for (key, (tp, qual)) in + self.ffi._parser._declarations.items()] + lst.sort() + return lst + + def _generate(self, step_name): + for name, tp in self._get_declarations(): + kind, realname = name.split(' ', 1) + try: + method = getattr(self, '_generate_cpy_%s_%s' % (kind, + step_name)) + except AttributeError: + raise VerificationError( + "not implemented in verify(): %r" % name) + try: + method(tp, realname) + except Exception as e: + model.attach_exception_info(e, name) + raise + + def _load(self, module, step_name, **kwds): + for name, tp in self._get_declarations(): + kind, realname = name.split(' ', 1) + method = getattr(self, '_%s_cpy_%s' % (step_name, kind)) + try: + method(tp, realname, module, **kwds) + except Exception as e: + model.attach_exception_info(e, name) + raise + + def _generate_nothing(self, tp, name): + pass + + def _loaded_noop(self, tp, name, module, **kwds): + pass + + # ---------- + + def _convert_funcarg_to_c(self, tp, fromvar, tovar, errcode): + extraarg = '' + if isinstance(tp, model.PrimitiveType): + if tp.is_integer_type() and tp.name != '_Bool': + converter = '_cffi_to_c_int' + extraarg = ', %s' % tp.name + else: + converter = '(%s)_cffi_to_c_%s' % (tp.get_c_name(''), + tp.name.replace(' ', '_')) + errvalue = '-1' + # + elif isinstance(tp, model.PointerType): + self._convert_funcarg_to_c_ptr_or_array(tp, fromvar, + tovar, errcode) + return + # + elif isinstance(tp, (model.StructOrUnion, model.EnumType)): + # a struct (not a struct pointer) as a function argument + self._prnt(' if (_cffi_to_c((char *)&%s, _cffi_type(%d), %s) < 0)' + % (tovar, self._gettypenum(tp), fromvar)) + self._prnt(' %s;' % errcode) + return + # + elif isinstance(tp, model.FunctionPtrType): + converter = '(%s)_cffi_to_c_pointer' % tp.get_c_name('') + extraarg = ', _cffi_type(%d)' % self._gettypenum(tp) + errvalue = 'NULL' + # + else: + raise NotImplementedError(tp) + # + self._prnt(' %s = %s(%s%s);' % (tovar, converter, fromvar, extraarg)) + self._prnt(' if (%s == (%s)%s && PyErr_Occurred())' % ( + tovar, tp.get_c_name(''), errvalue)) + self._prnt(' %s;' % errcode) + + def _extra_local_variables(self, tp, localvars): + if isinstance(tp, model.PointerType): + localvars.add('Py_ssize_t datasize') + + def _convert_funcarg_to_c_ptr_or_array(self, tp, fromvar, tovar, errcode): + self._prnt(' datasize = _cffi_prepare_pointer_call_argument(') + self._prnt(' _cffi_type(%d), %s, (char **)&%s);' % ( + self._gettypenum(tp), fromvar, tovar)) + self._prnt(' if (datasize != 0) {') + self._prnt(' if (datasize < 0)') + self._prnt(' %s;' % errcode) + self._prnt(' %s = alloca((size_t)datasize);' % (tovar,)) + self._prnt(' memset((void *)%s, 0, (size_t)datasize);' % (tovar,)) + self._prnt(' if (_cffi_convert_array_from_object(' + '(char *)%s, _cffi_type(%d), %s) < 0)' % ( + tovar, self._gettypenum(tp), fromvar)) + self._prnt(' %s;' % errcode) + self._prnt(' }') + + def _convert_expr_from_c(self, tp, var, context): + if isinstance(tp, model.PrimitiveType): + if tp.is_integer_type() and tp.name != '_Bool': + return '_cffi_from_c_int(%s, %s)' % (var, tp.name) + elif tp.name != 'long double': + return '_cffi_from_c_%s(%s)' % (tp.name.replace(' ', '_'), var) + else: + return '_cffi_from_c_deref((char *)&%s, _cffi_type(%d))' % ( + var, self._gettypenum(tp)) + elif isinstance(tp, (model.PointerType, model.FunctionPtrType)): + return '_cffi_from_c_pointer((char *)%s, _cffi_type(%d))' % ( + var, self._gettypenum(tp)) + elif isinstance(tp, model.ArrayType): + return '_cffi_from_c_pointer((char *)%s, _cffi_type(%d))' % ( + var, self._gettypenum(model.PointerType(tp.item))) + elif isinstance(tp, model.StructOrUnion): + if tp.fldnames is None: + raise TypeError("'%s' is used as %s, but is opaque" % ( + tp._get_c_name(), context)) + return '_cffi_from_c_struct((char *)&%s, _cffi_type(%d))' % ( + var, self._gettypenum(tp)) + elif isinstance(tp, model.EnumType): + return '_cffi_from_c_deref((char *)&%s, _cffi_type(%d))' % ( + var, self._gettypenum(tp)) + else: + raise NotImplementedError(tp) + + # ---------- + # typedefs: generates no code so far + + _generate_cpy_typedef_collecttype = _generate_nothing + _generate_cpy_typedef_decl = _generate_nothing + _generate_cpy_typedef_method = _generate_nothing + _loading_cpy_typedef = _loaded_noop + _loaded_cpy_typedef = _loaded_noop + + # ---------- + # function declarations + + def _generate_cpy_function_collecttype(self, tp, name): + assert isinstance(tp, model.FunctionPtrType) + if tp.ellipsis: + self._do_collect_type(tp) + else: + # don't call _do_collect_type(tp) in this common case, + # otherwise test_autofilled_struct_as_argument fails + for type in tp.args: + self._do_collect_type(type) + self._do_collect_type(tp.result) + + def _generate_cpy_function_decl(self, tp, name): + assert isinstance(tp, model.FunctionPtrType) + if tp.ellipsis: + # cannot support vararg functions better than this: check for its + # exact type (including the fixed arguments), and build it as a + # constant function pointer (no CPython wrapper) + self._generate_cpy_const(False, name, tp) + return + prnt = self._prnt + numargs = len(tp.args) + if numargs == 0: + argname = 'noarg' + elif numargs == 1: + argname = 'arg0' + else: + argname = 'args' + prnt('static PyObject *') + prnt('_cffi_f_%s(PyObject *self, PyObject *%s)' % (name, argname)) + prnt('{') + # + context = 'argument of %s' % name + for i, type in enumerate(tp.args): + prnt(' %s;' % type.get_c_name(' x%d' % i, context)) + # + localvars = set() + for type in tp.args: + self._extra_local_variables(type, localvars) + for decl in localvars: + prnt(' %s;' % (decl,)) + # + if not isinstance(tp.result, model.VoidType): + result_code = 'result = ' + context = 'result of %s' % name + prnt(' %s;' % tp.result.get_c_name(' result', context)) + else: + result_code = '' + # + if len(tp.args) > 1: + rng = range(len(tp.args)) + for i in rng: + prnt(' PyObject *arg%d;' % i) + prnt() + prnt(' if (!PyArg_ParseTuple(args, "%s:%s", %s))' % ( + 'O' * numargs, name, ', '.join(['&arg%d' % i for i in rng]))) + prnt(' return NULL;') + prnt() + # + for i, type in enumerate(tp.args): + self._convert_funcarg_to_c(type, 'arg%d' % i, 'x%d' % i, + 'return NULL') + prnt() + # + prnt(' Py_BEGIN_ALLOW_THREADS') + prnt(' _cffi_restore_errno();') + prnt(' { %s%s(%s); }' % ( + result_code, name, + ', '.join(['x%d' % i for i in range(len(tp.args))]))) + prnt(' _cffi_save_errno();') + prnt(' Py_END_ALLOW_THREADS') + prnt() + # + prnt(' (void)self; /* unused */') + if numargs == 0: + prnt(' (void)noarg; /* unused */') + if result_code: + prnt(' return %s;' % + self._convert_expr_from_c(tp.result, 'result', 'result type')) + else: + prnt(' Py_INCREF(Py_None);') + prnt(' return Py_None;') + prnt('}') + prnt() + + def _generate_cpy_function_method(self, tp, name): + if tp.ellipsis: + return + numargs = len(tp.args) + if numargs == 0: + meth = 'METH_NOARGS' + elif numargs == 1: + meth = 'METH_O' + else: + meth = 'METH_VARARGS' + self._prnt(' {"%s", _cffi_f_%s, %s, NULL},' % (name, name, meth)) + + _loading_cpy_function = _loaded_noop + + def _loaded_cpy_function(self, tp, name, module, library): + if tp.ellipsis: + return + func = getattr(module, name) + setattr(library, name, func) + self._types_of_builtin_functions[func] = tp + + # ---------- + # named structs + + _generate_cpy_struct_collecttype = _generate_nothing + def _generate_cpy_struct_decl(self, tp, name): + assert name == tp.name + self._generate_struct_or_union_decl(tp, 'struct', name) + def _generate_cpy_struct_method(self, tp, name): + self._generate_struct_or_union_method(tp, 'struct', name) + def _loading_cpy_struct(self, tp, name, module): + self._loading_struct_or_union(tp, 'struct', name, module) + def _loaded_cpy_struct(self, tp, name, module, **kwds): + self._loaded_struct_or_union(tp) + + _generate_cpy_union_collecttype = _generate_nothing + def _generate_cpy_union_decl(self, tp, name): + assert name == tp.name + self._generate_struct_or_union_decl(tp, 'union', name) + def _generate_cpy_union_method(self, tp, name): + self._generate_struct_or_union_method(tp, 'union', name) + def _loading_cpy_union(self, tp, name, module): + self._loading_struct_or_union(tp, 'union', name, module) + def _loaded_cpy_union(self, tp, name, module, **kwds): + self._loaded_struct_or_union(tp) + + def _generate_struct_or_union_decl(self, tp, prefix, name): + if tp.fldnames is None: + return # nothing to do with opaque structs + checkfuncname = '_cffi_check_%s_%s' % (prefix, name) + layoutfuncname = '_cffi_layout_%s_%s' % (prefix, name) + cname = ('%s %s' % (prefix, name)).strip() + # + prnt = self._prnt + prnt('static void %s(%s *p)' % (checkfuncname, cname)) + prnt('{') + prnt(' /* only to generate compile-time warnings or errors */') + prnt(' (void)p;') + for fname, ftype, fbitsize, fqual in tp.enumfields(): + if (isinstance(ftype, model.PrimitiveType) + and ftype.is_integer_type()) or fbitsize >= 0: + # accept all integers, but complain on float or double + prnt(' (void)((p->%s) << 1);' % fname) + else: + # only accept exactly the type declared. + try: + prnt(' { %s = &p->%s; (void)tmp; }' % ( + ftype.get_c_name('*tmp', 'field %r'%fname, quals=fqual), + fname)) + except VerificationError as e: + prnt(' /* %s */' % str(e)) # cannot verify it, ignore + prnt('}') + prnt('static PyObject *') + prnt('%s(PyObject *self, PyObject *noarg)' % (layoutfuncname,)) + prnt('{') + prnt(' struct _cffi_aligncheck { char x; %s y; };' % cname) + prnt(' static Py_ssize_t nums[] = {') + prnt(' sizeof(%s),' % cname) + prnt(' offsetof(struct _cffi_aligncheck, y),') + for fname, ftype, fbitsize, fqual in tp.enumfields(): + if fbitsize >= 0: + continue # xxx ignore fbitsize for now + prnt(' offsetof(%s, %s),' % (cname, fname)) + if isinstance(ftype, model.ArrayType) and ftype.length is None: + prnt(' 0, /* %s */' % ftype._get_c_name()) + else: + prnt(' sizeof(((%s *)0)->%s),' % (cname, fname)) + prnt(' -1') + prnt(' };') + prnt(' (void)self; /* unused */') + prnt(' (void)noarg; /* unused */') + prnt(' return _cffi_get_struct_layout(nums);') + prnt(' /* the next line is not executed, but compiled */') + prnt(' %s(0);' % (checkfuncname,)) + prnt('}') + prnt() + + def _generate_struct_or_union_method(self, tp, prefix, name): + if tp.fldnames is None: + return # nothing to do with opaque structs + layoutfuncname = '_cffi_layout_%s_%s' % (prefix, name) + self._prnt(' {"%s", %s, METH_NOARGS, NULL},' % (layoutfuncname, + layoutfuncname)) + + def _loading_struct_or_union(self, tp, prefix, name, module): + if tp.fldnames is None: + return # nothing to do with opaque structs + layoutfuncname = '_cffi_layout_%s_%s' % (prefix, name) + # + function = getattr(module, layoutfuncname) + layout = function() + if isinstance(tp, model.StructOrUnion) and tp.partial: + # use the function()'s sizes and offsets to guide the + # layout of the struct + totalsize = layout[0] + totalalignment = layout[1] + fieldofs = layout[2::2] + fieldsize = layout[3::2] + tp.force_flatten() + assert len(fieldofs) == len(fieldsize) == len(tp.fldnames) + tp.fixedlayout = fieldofs, fieldsize, totalsize, totalalignment + else: + cname = ('%s %s' % (prefix, name)).strip() + self._struct_pending_verification[tp] = layout, cname + + def _loaded_struct_or_union(self, tp): + if tp.fldnames is None: + return # nothing to do with opaque structs + self.ffi._get_cached_btype(tp) # force 'fixedlayout' to be considered + + if tp in self._struct_pending_verification: + # check that the layout sizes and offsets match the real ones + def check(realvalue, expectedvalue, msg): + if realvalue != expectedvalue: + raise VerificationError( + "%s (we have %d, but C compiler says %d)" + % (msg, expectedvalue, realvalue)) + ffi = self.ffi + BStruct = ffi._get_cached_btype(tp) + layout, cname = self._struct_pending_verification.pop(tp) + check(layout[0], ffi.sizeof(BStruct), "wrong total size") + check(layout[1], ffi.alignof(BStruct), "wrong total alignment") + i = 2 + for fname, ftype, fbitsize, fqual in tp.enumfields(): + if fbitsize >= 0: + continue # xxx ignore fbitsize for now + check(layout[i], ffi.offsetof(BStruct, fname), + "wrong offset for field %r" % (fname,)) + if layout[i+1] != 0: + BField = ffi._get_cached_btype(ftype) + check(layout[i+1], ffi.sizeof(BField), + "wrong size for field %r" % (fname,)) + i += 2 + assert i == len(layout) + + # ---------- + # 'anonymous' declarations. These are produced for anonymous structs + # or unions; the 'name' is obtained by a typedef. + + _generate_cpy_anonymous_collecttype = _generate_nothing + + def _generate_cpy_anonymous_decl(self, tp, name): + if isinstance(tp, model.EnumType): + self._generate_cpy_enum_decl(tp, name, '') + else: + self._generate_struct_or_union_decl(tp, '', name) + + def _generate_cpy_anonymous_method(self, tp, name): + if not isinstance(tp, model.EnumType): + self._generate_struct_or_union_method(tp, '', name) + + def _loading_cpy_anonymous(self, tp, name, module): + if isinstance(tp, model.EnumType): + self._loading_cpy_enum(tp, name, module) + else: + self._loading_struct_or_union(tp, '', name, module) + + def _loaded_cpy_anonymous(self, tp, name, module, **kwds): + if isinstance(tp, model.EnumType): + self._loaded_cpy_enum(tp, name, module, **kwds) + else: + self._loaded_struct_or_union(tp) + + # ---------- + # constants, likely declared with '#define' + + def _generate_cpy_const(self, is_int, name, tp=None, category='const', + vartp=None, delayed=True, size_too=False, + check_value=None): + prnt = self._prnt + funcname = '_cffi_%s_%s' % (category, name) + prnt('static int %s(PyObject *lib)' % funcname) + prnt('{') + prnt(' PyObject *o;') + prnt(' int res;') + if not is_int: + prnt(' %s;' % (vartp or tp).get_c_name(' i', name)) + else: + assert category == 'const' + # + if check_value is not None: + self._check_int_constant_value(name, check_value) + # + if not is_int: + if category == 'var': + realexpr = '&' + name + else: + realexpr = name + prnt(' i = (%s);' % (realexpr,)) + prnt(' o = %s;' % (self._convert_expr_from_c(tp, 'i', + 'variable type'),)) + assert delayed + else: + prnt(' o = _cffi_from_c_int_const(%s);' % name) + prnt(' if (o == NULL)') + prnt(' return -1;') + if size_too: + prnt(' {') + prnt(' PyObject *o1 = o;') + prnt(' o = Py_BuildValue("On", o1, (Py_ssize_t)sizeof(%s));' + % (name,)) + prnt(' Py_DECREF(o1);') + prnt(' if (o == NULL)') + prnt(' return -1;') + prnt(' }') + prnt(' res = PyObject_SetAttrString(lib, "%s", o);' % name) + prnt(' Py_DECREF(o);') + prnt(' if (res < 0)') + prnt(' return -1;') + prnt(' return %s;' % self._chained_list_constants[delayed]) + self._chained_list_constants[delayed] = funcname + '(lib)' + prnt('}') + prnt() + + def _generate_cpy_constant_collecttype(self, tp, name): + is_int = isinstance(tp, model.PrimitiveType) and tp.is_integer_type() + if not is_int: + self._do_collect_type(tp) + + def _generate_cpy_constant_decl(self, tp, name): + is_int = isinstance(tp, model.PrimitiveType) and tp.is_integer_type() + self._generate_cpy_const(is_int, name, tp) + + _generate_cpy_constant_method = _generate_nothing + _loading_cpy_constant = _loaded_noop + _loaded_cpy_constant = _loaded_noop + + # ---------- + # enums + + def _check_int_constant_value(self, name, value, err_prefix=''): + prnt = self._prnt + if value <= 0: + prnt(' if ((%s) > 0 || (long)(%s) != %dL) {' % ( + name, name, value)) + else: + prnt(' if ((%s) <= 0 || (unsigned long)(%s) != %dUL) {' % ( + name, name, value)) + prnt(' char buf[64];') + prnt(' if ((%s) <= 0)' % name) + prnt(' snprintf(buf, 63, "%%ld", (long)(%s));' % name) + prnt(' else') + prnt(' snprintf(buf, 63, "%%lu", (unsigned long)(%s));' % + name) + prnt(' PyErr_Format(_cffi_VerificationError,') + prnt(' "%s%s has the real value %s, not %s",') + prnt(' "%s", "%s", buf, "%d");' % ( + err_prefix, name, value)) + prnt(' return -1;') + prnt(' }') + + def _enum_funcname(self, prefix, name): + # "$enum_$1" => "___D_enum____D_1" + name = name.replace('$', '___D_') + return '_cffi_e_%s_%s' % (prefix, name) + + def _generate_cpy_enum_decl(self, tp, name, prefix='enum'): + if tp.partial: + for enumerator in tp.enumerators: + self._generate_cpy_const(True, enumerator, delayed=False) + return + # + funcname = self._enum_funcname(prefix, name) + prnt = self._prnt + prnt('static int %s(PyObject *lib)' % funcname) + prnt('{') + for enumerator, enumvalue in zip(tp.enumerators, tp.enumvalues): + self._check_int_constant_value(enumerator, enumvalue, + "enum %s: " % name) + prnt(' return %s;' % self._chained_list_constants[True]) + self._chained_list_constants[True] = funcname + '(lib)' + prnt('}') + prnt() + + _generate_cpy_enum_collecttype = _generate_nothing + _generate_cpy_enum_method = _generate_nothing + + def _loading_cpy_enum(self, tp, name, module): + if tp.partial: + enumvalues = [getattr(module, enumerator) + for enumerator in tp.enumerators] + tp.enumvalues = tuple(enumvalues) + tp.partial_resolved = True + + def _loaded_cpy_enum(self, tp, name, module, library): + for enumerator, enumvalue in zip(tp.enumerators, tp.enumvalues): + setattr(library, enumerator, enumvalue) + + # ---------- + # macros: for now only for integers + + def _generate_cpy_macro_decl(self, tp, name): + if tp == '...': + check_value = None + else: + check_value = tp # an integer + self._generate_cpy_const(True, name, check_value=check_value) + + _generate_cpy_macro_collecttype = _generate_nothing + _generate_cpy_macro_method = _generate_nothing + _loading_cpy_macro = _loaded_noop + _loaded_cpy_macro = _loaded_noop + + # ---------- + # global variables + + def _generate_cpy_variable_collecttype(self, tp, name): + if isinstance(tp, model.ArrayType): + tp_ptr = model.PointerType(tp.item) + else: + tp_ptr = model.PointerType(tp) + self._do_collect_type(tp_ptr) + + def _generate_cpy_variable_decl(self, tp, name): + if isinstance(tp, model.ArrayType): + tp_ptr = model.PointerType(tp.item) + self._generate_cpy_const(False, name, tp, vartp=tp_ptr, + size_too = (tp.length == '...')) + else: + tp_ptr = model.PointerType(tp) + self._generate_cpy_const(False, name, tp_ptr, category='var') + + _generate_cpy_variable_method = _generate_nothing + _loading_cpy_variable = _loaded_noop + + def _loaded_cpy_variable(self, tp, name, module, library): + value = getattr(library, name) + if isinstance(tp, model.ArrayType): # int a[5] is "constant" in the + # sense that "a=..." is forbidden + if tp.length == '...': + assert isinstance(value, tuple) + (value, size) = value + BItemType = self.ffi._get_cached_btype(tp.item) + length, rest = divmod(size, self.ffi.sizeof(BItemType)) + if rest != 0: + raise VerificationError( + "bad size: %r does not seem to be an array of %s" % + (name, tp.item)) + tp = tp.resolve_length(length) + # 'value' is a which we have to replace with + # a if the N is actually known + if tp.length is not None: + BArray = self.ffi._get_cached_btype(tp) + value = self.ffi.cast(BArray, value) + setattr(library, name, value) + return + # remove ptr= from the library instance, and replace + # it by a property on the class, which reads/writes into ptr[0]. + ptr = value + delattr(library, name) + def getter(library): + return ptr[0] + def setter(library, value): + ptr[0] = value + setattr(type(library), name, property(getter, setter)) + type(library)._cffi_dir.append(name) + + # ---------- + + def _generate_setup_custom(self): + prnt = self._prnt + prnt('static int _cffi_setup_custom(PyObject *lib)') + prnt('{') + prnt(' return %s;' % self._chained_list_constants[True]) + prnt('}') + +cffimod_header = r''' +#include +#include + +/* this block of #ifs should be kept exactly identical between + c/_cffi_backend.c, cffi/vengine_cpy.py, cffi/vengine_gen.py + and cffi/_cffi_include.h */ +#if defined(_MSC_VER) +# include /* for alloca() */ +# if _MSC_VER < 1600 /* MSVC < 2010 */ + typedef __int8 int8_t; + typedef __int16 int16_t; + typedef __int32 int32_t; + typedef __int64 int64_t; + typedef unsigned __int8 uint8_t; + typedef unsigned __int16 uint16_t; + typedef unsigned __int32 uint32_t; + typedef unsigned __int64 uint64_t; + typedef __int8 int_least8_t; + typedef __int16 int_least16_t; + typedef __int32 int_least32_t; + typedef __int64 int_least64_t; + typedef unsigned __int8 uint_least8_t; + typedef unsigned __int16 uint_least16_t; + typedef unsigned __int32 uint_least32_t; + typedef unsigned __int64 uint_least64_t; + typedef __int8 int_fast8_t; + typedef __int16 int_fast16_t; + typedef __int32 int_fast32_t; + typedef __int64 int_fast64_t; + typedef unsigned __int8 uint_fast8_t; + typedef unsigned __int16 uint_fast16_t; + typedef unsigned __int32 uint_fast32_t; + typedef unsigned __int64 uint_fast64_t; + typedef __int64 intmax_t; + typedef unsigned __int64 uintmax_t; +# else +# include +# endif +# if _MSC_VER < 1800 /* MSVC < 2013 */ +# ifndef __cplusplus + typedef unsigned char _Bool; +# endif +# endif +#else +# include +# if (defined (__SVR4) && defined (__sun)) || defined(_AIX) || defined(__hpux) +# include +# endif +#endif + +#if PY_MAJOR_VERSION < 3 +# undef PyCapsule_CheckExact +# undef PyCapsule_GetPointer +# define PyCapsule_CheckExact(capsule) (PyCObject_Check(capsule)) +# define PyCapsule_GetPointer(capsule, name) \ + (PyCObject_AsVoidPtr(capsule)) +#endif + +#if PY_MAJOR_VERSION >= 3 +# define PyInt_FromLong PyLong_FromLong +#endif + +#define _cffi_from_c_double PyFloat_FromDouble +#define _cffi_from_c_float PyFloat_FromDouble +#define _cffi_from_c_long PyInt_FromLong +#define _cffi_from_c_ulong PyLong_FromUnsignedLong +#define _cffi_from_c_longlong PyLong_FromLongLong +#define _cffi_from_c_ulonglong PyLong_FromUnsignedLongLong +#define _cffi_from_c__Bool PyBool_FromLong + +#define _cffi_to_c_double PyFloat_AsDouble +#define _cffi_to_c_float PyFloat_AsDouble + +#define _cffi_from_c_int_const(x) \ + (((x) > 0) ? \ + ((unsigned long long)(x) <= (unsigned long long)LONG_MAX) ? \ + PyInt_FromLong((long)(x)) : \ + PyLong_FromUnsignedLongLong((unsigned long long)(x)) : \ + ((long long)(x) >= (long long)LONG_MIN) ? \ + PyInt_FromLong((long)(x)) : \ + PyLong_FromLongLong((long long)(x))) + +#define _cffi_from_c_int(x, type) \ + (((type)-1) > 0 ? /* unsigned */ \ + (sizeof(type) < sizeof(long) ? \ + PyInt_FromLong((long)x) : \ + sizeof(type) == sizeof(long) ? \ + PyLong_FromUnsignedLong((unsigned long)x) : \ + PyLong_FromUnsignedLongLong((unsigned long long)x)) : \ + (sizeof(type) <= sizeof(long) ? \ + PyInt_FromLong((long)x) : \ + PyLong_FromLongLong((long long)x))) + +#define _cffi_to_c_int(o, type) \ + ((type)( \ + sizeof(type) == 1 ? (((type)-1) > 0 ? (type)_cffi_to_c_u8(o) \ + : (type)_cffi_to_c_i8(o)) : \ + sizeof(type) == 2 ? (((type)-1) > 0 ? (type)_cffi_to_c_u16(o) \ + : (type)_cffi_to_c_i16(o)) : \ + sizeof(type) == 4 ? (((type)-1) > 0 ? (type)_cffi_to_c_u32(o) \ + : (type)_cffi_to_c_i32(o)) : \ + sizeof(type) == 8 ? (((type)-1) > 0 ? (type)_cffi_to_c_u64(o) \ + : (type)_cffi_to_c_i64(o)) : \ + (Py_FatalError("unsupported size for type " #type), (type)0))) + +#define _cffi_to_c_i8 \ + ((int(*)(PyObject *))_cffi_exports[1]) +#define _cffi_to_c_u8 \ + ((int(*)(PyObject *))_cffi_exports[2]) +#define _cffi_to_c_i16 \ + ((int(*)(PyObject *))_cffi_exports[3]) +#define _cffi_to_c_u16 \ + ((int(*)(PyObject *))_cffi_exports[4]) +#define _cffi_to_c_i32 \ + ((int(*)(PyObject *))_cffi_exports[5]) +#define _cffi_to_c_u32 \ + ((unsigned int(*)(PyObject *))_cffi_exports[6]) +#define _cffi_to_c_i64 \ + ((long long(*)(PyObject *))_cffi_exports[7]) +#define _cffi_to_c_u64 \ + ((unsigned long long(*)(PyObject *))_cffi_exports[8]) +#define _cffi_to_c_char \ + ((int(*)(PyObject *))_cffi_exports[9]) +#define _cffi_from_c_pointer \ + ((PyObject *(*)(char *, CTypeDescrObject *))_cffi_exports[10]) +#define _cffi_to_c_pointer \ + ((char *(*)(PyObject *, CTypeDescrObject *))_cffi_exports[11]) +#define _cffi_get_struct_layout \ + ((PyObject *(*)(Py_ssize_t[]))_cffi_exports[12]) +#define _cffi_restore_errno \ + ((void(*)(void))_cffi_exports[13]) +#define _cffi_save_errno \ + ((void(*)(void))_cffi_exports[14]) +#define _cffi_from_c_char \ + ((PyObject *(*)(char))_cffi_exports[15]) +#define _cffi_from_c_deref \ + ((PyObject *(*)(char *, CTypeDescrObject *))_cffi_exports[16]) +#define _cffi_to_c \ + ((int(*)(char *, CTypeDescrObject *, PyObject *))_cffi_exports[17]) +#define _cffi_from_c_struct \ + ((PyObject *(*)(char *, CTypeDescrObject *))_cffi_exports[18]) +#define _cffi_to_c_wchar_t \ + ((wchar_t(*)(PyObject *))_cffi_exports[19]) +#define _cffi_from_c_wchar_t \ + ((PyObject *(*)(wchar_t))_cffi_exports[20]) +#define _cffi_to_c_long_double \ + ((long double(*)(PyObject *))_cffi_exports[21]) +#define _cffi_to_c__Bool \ + ((_Bool(*)(PyObject *))_cffi_exports[22]) +#define _cffi_prepare_pointer_call_argument \ + ((Py_ssize_t(*)(CTypeDescrObject *, PyObject *, char **))_cffi_exports[23]) +#define _cffi_convert_array_from_object \ + ((int(*)(char *, CTypeDescrObject *, PyObject *))_cffi_exports[24]) +#define _CFFI_NUM_EXPORTS 25 + +typedef struct _ctypedescr CTypeDescrObject; + +static void *_cffi_exports[_CFFI_NUM_EXPORTS]; +static PyObject *_cffi_types, *_cffi_VerificationError; + +static int _cffi_setup_custom(PyObject *lib); /* forward */ + +static PyObject *_cffi_setup(PyObject *self, PyObject *args) +{ + PyObject *library; + int was_alive = (_cffi_types != NULL); + (void)self; /* unused */ + if (!PyArg_ParseTuple(args, "OOO", &_cffi_types, &_cffi_VerificationError, + &library)) + return NULL; + Py_INCREF(_cffi_types); + Py_INCREF(_cffi_VerificationError); + if (_cffi_setup_custom(library) < 0) + return NULL; + return PyBool_FromLong(was_alive); +} + +static int _cffi_init(void) +{ + PyObject *module, *c_api_object = NULL; + + module = PyImport_ImportModule("_cffi_backend"); + if (module == NULL) + goto failure; + + c_api_object = PyObject_GetAttrString(module, "_C_API"); + if (c_api_object == NULL) + goto failure; + if (!PyCapsule_CheckExact(c_api_object)) { + PyErr_SetNone(PyExc_ImportError); + goto failure; + } + memcpy(_cffi_exports, PyCapsule_GetPointer(c_api_object, "cffi"), + _CFFI_NUM_EXPORTS * sizeof(void *)); + + Py_DECREF(module); + Py_DECREF(c_api_object); + return 0; + + failure: + Py_XDECREF(module); + Py_XDECREF(c_api_object); + return -1; +} + +#define _cffi_type(num) ((CTypeDescrObject *)PyList_GET_ITEM(_cffi_types, num)) + +/**********/ +''' diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/cffi/vengine_gen.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/cffi/vengine_gen.py new file mode 100644 index 00000000..a64ff644 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/cffi/vengine_gen.py @@ -0,0 +1,675 @@ +# +# DEPRECATED: implementation for ffi.verify() +# +import sys, os +import types + +from . import model +from .error import VerificationError + + +class VGenericEngine(object): + _class_key = 'g' + _gen_python_module = False + + def __init__(self, verifier): + self.verifier = verifier + self.ffi = verifier.ffi + self.export_symbols = [] + self._struct_pending_verification = {} + + def patch_extension_kwds(self, kwds): + # add 'export_symbols' to the dictionary. Note that we add the + # list before filling it. When we fill it, it will thus also show + # up in kwds['export_symbols']. + kwds.setdefault('export_symbols', self.export_symbols) + + def find_module(self, module_name, path, so_suffixes): + for so_suffix in so_suffixes: + basename = module_name + so_suffix + if path is None: + path = sys.path + for dirname in path: + filename = os.path.join(dirname, basename) + if os.path.isfile(filename): + return filename + + def collect_types(self): + pass # not needed in the generic engine + + def _prnt(self, what=''): + self._f.write(what + '\n') + + def write_source_to_f(self): + prnt = self._prnt + # first paste some standard set of lines that are mostly '#include' + prnt(cffimod_header) + # then paste the C source given by the user, verbatim. + prnt(self.verifier.preamble) + # + # call generate_gen_xxx_decl(), for every xxx found from + # ffi._parser._declarations. This generates all the functions. + self._generate('decl') + # + # on Windows, distutils insists on putting init_cffi_xyz in + # 'export_symbols', so instead of fighting it, just give up and + # give it one + if sys.platform == 'win32': + if sys.version_info >= (3,): + prefix = 'PyInit_' + else: + prefix = 'init' + modname = self.verifier.get_module_name() + prnt("void %s%s(void) { }\n" % (prefix, modname)) + + def load_library(self, flags=0): + # import it with the CFFI backend + backend = self.ffi._backend + # needs to make a path that contains '/', on Posix + filename = os.path.join(os.curdir, self.verifier.modulefilename) + module = backend.load_library(filename, flags) + # + # call loading_gen_struct() to get the struct layout inferred by + # the C compiler + self._load(module, 'loading') + + # build the FFILibrary class and instance, this is a module subclass + # because modules are expected to have usually-constant-attributes and + # in PyPy this means the JIT is able to treat attributes as constant, + # which we want. + class FFILibrary(types.ModuleType): + _cffi_generic_module = module + _cffi_ffi = self.ffi + _cffi_dir = [] + def __dir__(self): + return FFILibrary._cffi_dir + library = FFILibrary("") + # + # finally, call the loaded_gen_xxx() functions. This will set + # up the 'library' object. + self._load(module, 'loaded', library=library) + return library + + def _get_declarations(self): + lst = [(key, tp) for (key, (tp, qual)) in + self.ffi._parser._declarations.items()] + lst.sort() + return lst + + def _generate(self, step_name): + for name, tp in self._get_declarations(): + kind, realname = name.split(' ', 1) + try: + method = getattr(self, '_generate_gen_%s_%s' % (kind, + step_name)) + except AttributeError: + raise VerificationError( + "not implemented in verify(): %r" % name) + try: + method(tp, realname) + except Exception as e: + model.attach_exception_info(e, name) + raise + + def _load(self, module, step_name, **kwds): + for name, tp in self._get_declarations(): + kind, realname = name.split(' ', 1) + method = getattr(self, '_%s_gen_%s' % (step_name, kind)) + try: + method(tp, realname, module, **kwds) + except Exception as e: + model.attach_exception_info(e, name) + raise + + def _generate_nothing(self, tp, name): + pass + + def _loaded_noop(self, tp, name, module, **kwds): + pass + + # ---------- + # typedefs: generates no code so far + + _generate_gen_typedef_decl = _generate_nothing + _loading_gen_typedef = _loaded_noop + _loaded_gen_typedef = _loaded_noop + + # ---------- + # function declarations + + def _generate_gen_function_decl(self, tp, name): + assert isinstance(tp, model.FunctionPtrType) + if tp.ellipsis: + # cannot support vararg functions better than this: check for its + # exact type (including the fixed arguments), and build it as a + # constant function pointer (no _cffi_f_%s wrapper) + self._generate_gen_const(False, name, tp) + return + prnt = self._prnt + numargs = len(tp.args) + argnames = [] + for i, type in enumerate(tp.args): + indirection = '' + if isinstance(type, model.StructOrUnion): + indirection = '*' + argnames.append('%sx%d' % (indirection, i)) + context = 'argument of %s' % name + arglist = [type.get_c_name(' %s' % arg, context) + for type, arg in zip(tp.args, argnames)] + tpresult = tp.result + if isinstance(tpresult, model.StructOrUnion): + arglist.insert(0, tpresult.get_c_name(' *r', context)) + tpresult = model.void_type + arglist = ', '.join(arglist) or 'void' + wrappername = '_cffi_f_%s' % name + self.export_symbols.append(wrappername) + if tp.abi: + abi = tp.abi + ' ' + else: + abi = '' + funcdecl = ' %s%s(%s)' % (abi, wrappername, arglist) + context = 'result of %s' % name + prnt(tpresult.get_c_name(funcdecl, context)) + prnt('{') + # + if isinstance(tp.result, model.StructOrUnion): + result_code = '*r = ' + elif not isinstance(tp.result, model.VoidType): + result_code = 'return ' + else: + result_code = '' + prnt(' %s%s(%s);' % (result_code, name, ', '.join(argnames))) + prnt('}') + prnt() + + _loading_gen_function = _loaded_noop + + def _loaded_gen_function(self, tp, name, module, library): + assert isinstance(tp, model.FunctionPtrType) + if tp.ellipsis: + newfunction = self._load_constant(False, tp, name, module) + else: + indirections = [] + base_tp = tp + if (any(isinstance(typ, model.StructOrUnion) for typ in tp.args) + or isinstance(tp.result, model.StructOrUnion)): + indirect_args = [] + for i, typ in enumerate(tp.args): + if isinstance(typ, model.StructOrUnion): + typ = model.PointerType(typ) + indirections.append((i, typ)) + indirect_args.append(typ) + indirect_result = tp.result + if isinstance(indirect_result, model.StructOrUnion): + if indirect_result.fldtypes is None: + raise TypeError("'%s' is used as result type, " + "but is opaque" % ( + indirect_result._get_c_name(),)) + indirect_result = model.PointerType(indirect_result) + indirect_args.insert(0, indirect_result) + indirections.insert(0, ("result", indirect_result)) + indirect_result = model.void_type + tp = model.FunctionPtrType(tuple(indirect_args), + indirect_result, tp.ellipsis) + BFunc = self.ffi._get_cached_btype(tp) + wrappername = '_cffi_f_%s' % name + newfunction = module.load_function(BFunc, wrappername) + for i, typ in indirections: + newfunction = self._make_struct_wrapper(newfunction, i, typ, + base_tp) + setattr(library, name, newfunction) + type(library)._cffi_dir.append(name) + + def _make_struct_wrapper(self, oldfunc, i, tp, base_tp): + backend = self.ffi._backend + BType = self.ffi._get_cached_btype(tp) + if i == "result": + ffi = self.ffi + def newfunc(*args): + res = ffi.new(BType) + oldfunc(res, *args) + return res[0] + else: + def newfunc(*args): + args = args[:i] + (backend.newp(BType, args[i]),) + args[i+1:] + return oldfunc(*args) + newfunc._cffi_base_type = base_tp + return newfunc + + # ---------- + # named structs + + def _generate_gen_struct_decl(self, tp, name): + assert name == tp.name + self._generate_struct_or_union_decl(tp, 'struct', name) + + def _loading_gen_struct(self, tp, name, module): + self._loading_struct_or_union(tp, 'struct', name, module) + + def _loaded_gen_struct(self, tp, name, module, **kwds): + self._loaded_struct_or_union(tp) + + def _generate_gen_union_decl(self, tp, name): + assert name == tp.name + self._generate_struct_or_union_decl(tp, 'union', name) + + def _loading_gen_union(self, tp, name, module): + self._loading_struct_or_union(tp, 'union', name, module) + + def _loaded_gen_union(self, tp, name, module, **kwds): + self._loaded_struct_or_union(tp) + + def _generate_struct_or_union_decl(self, tp, prefix, name): + if tp.fldnames is None: + return # nothing to do with opaque structs + checkfuncname = '_cffi_check_%s_%s' % (prefix, name) + layoutfuncname = '_cffi_layout_%s_%s' % (prefix, name) + cname = ('%s %s' % (prefix, name)).strip() + # + prnt = self._prnt + prnt('static void %s(%s *p)' % (checkfuncname, cname)) + prnt('{') + prnt(' /* only to generate compile-time warnings or errors */') + prnt(' (void)p;') + for fname, ftype, fbitsize, fqual in tp.enumfields(): + if (isinstance(ftype, model.PrimitiveType) + and ftype.is_integer_type()) or fbitsize >= 0: + # accept all integers, but complain on float or double + prnt(' (void)((p->%s) << 1);' % fname) + else: + # only accept exactly the type declared. + try: + prnt(' { %s = &p->%s; (void)tmp; }' % ( + ftype.get_c_name('*tmp', 'field %r'%fname, quals=fqual), + fname)) + except VerificationError as e: + prnt(' /* %s */' % str(e)) # cannot verify it, ignore + prnt('}') + self.export_symbols.append(layoutfuncname) + prnt('intptr_t %s(intptr_t i)' % (layoutfuncname,)) + prnt('{') + prnt(' struct _cffi_aligncheck { char x; %s y; };' % cname) + prnt(' static intptr_t nums[] = {') + prnt(' sizeof(%s),' % cname) + prnt(' offsetof(struct _cffi_aligncheck, y),') + for fname, ftype, fbitsize, fqual in tp.enumfields(): + if fbitsize >= 0: + continue # xxx ignore fbitsize for now + prnt(' offsetof(%s, %s),' % (cname, fname)) + if isinstance(ftype, model.ArrayType) and ftype.length is None: + prnt(' 0, /* %s */' % ftype._get_c_name()) + else: + prnt(' sizeof(((%s *)0)->%s),' % (cname, fname)) + prnt(' -1') + prnt(' };') + prnt(' return nums[i];') + prnt(' /* the next line is not executed, but compiled */') + prnt(' %s(0);' % (checkfuncname,)) + prnt('}') + prnt() + + def _loading_struct_or_union(self, tp, prefix, name, module): + if tp.fldnames is None: + return # nothing to do with opaque structs + layoutfuncname = '_cffi_layout_%s_%s' % (prefix, name) + # + BFunc = self.ffi._typeof_locked("intptr_t(*)(intptr_t)")[0] + function = module.load_function(BFunc, layoutfuncname) + layout = [] + num = 0 + while True: + x = function(num) + if x < 0: break + layout.append(x) + num += 1 + if isinstance(tp, model.StructOrUnion) and tp.partial: + # use the function()'s sizes and offsets to guide the + # layout of the struct + totalsize = layout[0] + totalalignment = layout[1] + fieldofs = layout[2::2] + fieldsize = layout[3::2] + tp.force_flatten() + assert len(fieldofs) == len(fieldsize) == len(tp.fldnames) + tp.fixedlayout = fieldofs, fieldsize, totalsize, totalalignment + else: + cname = ('%s %s' % (prefix, name)).strip() + self._struct_pending_verification[tp] = layout, cname + + def _loaded_struct_or_union(self, tp): + if tp.fldnames is None: + return # nothing to do with opaque structs + self.ffi._get_cached_btype(tp) # force 'fixedlayout' to be considered + + if tp in self._struct_pending_verification: + # check that the layout sizes and offsets match the real ones + def check(realvalue, expectedvalue, msg): + if realvalue != expectedvalue: + raise VerificationError( + "%s (we have %d, but C compiler says %d)" + % (msg, expectedvalue, realvalue)) + ffi = self.ffi + BStruct = ffi._get_cached_btype(tp) + layout, cname = self._struct_pending_verification.pop(tp) + check(layout[0], ffi.sizeof(BStruct), "wrong total size") + check(layout[1], ffi.alignof(BStruct), "wrong total alignment") + i = 2 + for fname, ftype, fbitsize, fqual in tp.enumfields(): + if fbitsize >= 0: + continue # xxx ignore fbitsize for now + check(layout[i], ffi.offsetof(BStruct, fname), + "wrong offset for field %r" % (fname,)) + if layout[i+1] != 0: + BField = ffi._get_cached_btype(ftype) + check(layout[i+1], ffi.sizeof(BField), + "wrong size for field %r" % (fname,)) + i += 2 + assert i == len(layout) + + # ---------- + # 'anonymous' declarations. These are produced for anonymous structs + # or unions; the 'name' is obtained by a typedef. + + def _generate_gen_anonymous_decl(self, tp, name): + if isinstance(tp, model.EnumType): + self._generate_gen_enum_decl(tp, name, '') + else: + self._generate_struct_or_union_decl(tp, '', name) + + def _loading_gen_anonymous(self, tp, name, module): + if isinstance(tp, model.EnumType): + self._loading_gen_enum(tp, name, module, '') + else: + self._loading_struct_or_union(tp, '', name, module) + + def _loaded_gen_anonymous(self, tp, name, module, **kwds): + if isinstance(tp, model.EnumType): + self._loaded_gen_enum(tp, name, module, **kwds) + else: + self._loaded_struct_or_union(tp) + + # ---------- + # constants, likely declared with '#define' + + def _generate_gen_const(self, is_int, name, tp=None, category='const', + check_value=None): + prnt = self._prnt + funcname = '_cffi_%s_%s' % (category, name) + self.export_symbols.append(funcname) + if check_value is not None: + assert is_int + assert category == 'const' + prnt('int %s(char *out_error)' % funcname) + prnt('{') + self._check_int_constant_value(name, check_value) + prnt(' return 0;') + prnt('}') + elif is_int: + assert category == 'const' + prnt('int %s(long long *out_value)' % funcname) + prnt('{') + prnt(' *out_value = (long long)(%s);' % (name,)) + prnt(' return (%s) <= 0;' % (name,)) + prnt('}') + else: + assert tp is not None + assert check_value is None + if category == 'var': + ampersand = '&' + else: + ampersand = '' + extra = '' + if category == 'const' and isinstance(tp, model.StructOrUnion): + extra = 'const *' + ampersand = '&' + prnt(tp.get_c_name(' %s%s(void)' % (extra, funcname), name)) + prnt('{') + prnt(' return (%s%s);' % (ampersand, name)) + prnt('}') + prnt() + + def _generate_gen_constant_decl(self, tp, name): + is_int = isinstance(tp, model.PrimitiveType) and tp.is_integer_type() + self._generate_gen_const(is_int, name, tp) + + _loading_gen_constant = _loaded_noop + + def _load_constant(self, is_int, tp, name, module, check_value=None): + funcname = '_cffi_const_%s' % name + if check_value is not None: + assert is_int + self._load_known_int_constant(module, funcname) + value = check_value + elif is_int: + BType = self.ffi._typeof_locked("long long*")[0] + BFunc = self.ffi._typeof_locked("int(*)(long long*)")[0] + function = module.load_function(BFunc, funcname) + p = self.ffi.new(BType) + negative = function(p) + value = int(p[0]) + if value < 0 and not negative: + BLongLong = self.ffi._typeof_locked("long long")[0] + value += (1 << (8*self.ffi.sizeof(BLongLong))) + else: + assert check_value is None + fntypeextra = '(*)(void)' + if isinstance(tp, model.StructOrUnion): + fntypeextra = '*' + fntypeextra + BFunc = self.ffi._typeof_locked(tp.get_c_name(fntypeextra, name))[0] + function = module.load_function(BFunc, funcname) + value = function() + if isinstance(tp, model.StructOrUnion): + value = value[0] + return value + + def _loaded_gen_constant(self, tp, name, module, library): + is_int = isinstance(tp, model.PrimitiveType) and tp.is_integer_type() + value = self._load_constant(is_int, tp, name, module) + setattr(library, name, value) + type(library)._cffi_dir.append(name) + + # ---------- + # enums + + def _check_int_constant_value(self, name, value): + prnt = self._prnt + if value <= 0: + prnt(' if ((%s) > 0 || (long)(%s) != %dL) {' % ( + name, name, value)) + else: + prnt(' if ((%s) <= 0 || (unsigned long)(%s) != %dUL) {' % ( + name, name, value)) + prnt(' char buf[64];') + prnt(' if ((%s) <= 0)' % name) + prnt(' sprintf(buf, "%%ld", (long)(%s));' % name) + prnt(' else') + prnt(' sprintf(buf, "%%lu", (unsigned long)(%s));' % + name) + prnt(' sprintf(out_error, "%s has the real value %s, not %s",') + prnt(' "%s", buf, "%d");' % (name[:100], value)) + prnt(' return -1;') + prnt(' }') + + def _load_known_int_constant(self, module, funcname): + BType = self.ffi._typeof_locked("char[]")[0] + BFunc = self.ffi._typeof_locked("int(*)(char*)")[0] + function = module.load_function(BFunc, funcname) + p = self.ffi.new(BType, 256) + if function(p) < 0: + error = self.ffi.string(p) + if sys.version_info >= (3,): + error = str(error, 'utf-8') + raise VerificationError(error) + + def _enum_funcname(self, prefix, name): + # "$enum_$1" => "___D_enum____D_1" + name = name.replace('$', '___D_') + return '_cffi_e_%s_%s' % (prefix, name) + + def _generate_gen_enum_decl(self, tp, name, prefix='enum'): + if tp.partial: + for enumerator in tp.enumerators: + self._generate_gen_const(True, enumerator) + return + # + funcname = self._enum_funcname(prefix, name) + self.export_symbols.append(funcname) + prnt = self._prnt + prnt('int %s(char *out_error)' % funcname) + prnt('{') + for enumerator, enumvalue in zip(tp.enumerators, tp.enumvalues): + self._check_int_constant_value(enumerator, enumvalue) + prnt(' return 0;') + prnt('}') + prnt() + + def _loading_gen_enum(self, tp, name, module, prefix='enum'): + if tp.partial: + enumvalues = [self._load_constant(True, tp, enumerator, module) + for enumerator in tp.enumerators] + tp.enumvalues = tuple(enumvalues) + tp.partial_resolved = True + else: + funcname = self._enum_funcname(prefix, name) + self._load_known_int_constant(module, funcname) + + def _loaded_gen_enum(self, tp, name, module, library): + for enumerator, enumvalue in zip(tp.enumerators, tp.enumvalues): + setattr(library, enumerator, enumvalue) + type(library)._cffi_dir.append(enumerator) + + # ---------- + # macros: for now only for integers + + def _generate_gen_macro_decl(self, tp, name): + if tp == '...': + check_value = None + else: + check_value = tp # an integer + self._generate_gen_const(True, name, check_value=check_value) + + _loading_gen_macro = _loaded_noop + + def _loaded_gen_macro(self, tp, name, module, library): + if tp == '...': + check_value = None + else: + check_value = tp # an integer + value = self._load_constant(True, tp, name, module, + check_value=check_value) + setattr(library, name, value) + type(library)._cffi_dir.append(name) + + # ---------- + # global variables + + def _generate_gen_variable_decl(self, tp, name): + if isinstance(tp, model.ArrayType): + if tp.length == '...': + prnt = self._prnt + funcname = '_cffi_sizeof_%s' % (name,) + self.export_symbols.append(funcname) + prnt("size_t %s(void)" % funcname) + prnt("{") + prnt(" return sizeof(%s);" % (name,)) + prnt("}") + tp_ptr = model.PointerType(tp.item) + self._generate_gen_const(False, name, tp_ptr) + else: + tp_ptr = model.PointerType(tp) + self._generate_gen_const(False, name, tp_ptr, category='var') + + _loading_gen_variable = _loaded_noop + + def _loaded_gen_variable(self, tp, name, module, library): + if isinstance(tp, model.ArrayType): # int a[5] is "constant" in the + # sense that "a=..." is forbidden + if tp.length == '...': + funcname = '_cffi_sizeof_%s' % (name,) + BFunc = self.ffi._typeof_locked('size_t(*)(void)')[0] + function = module.load_function(BFunc, funcname) + size = function() + BItemType = self.ffi._get_cached_btype(tp.item) + length, rest = divmod(size, self.ffi.sizeof(BItemType)) + if rest != 0: + raise VerificationError( + "bad size: %r does not seem to be an array of %s" % + (name, tp.item)) + tp = tp.resolve_length(length) + tp_ptr = model.PointerType(tp.item) + value = self._load_constant(False, tp_ptr, name, module) + # 'value' is a which we have to replace with + # a if the N is actually known + if tp.length is not None: + BArray = self.ffi._get_cached_btype(tp) + value = self.ffi.cast(BArray, value) + setattr(library, name, value) + type(library)._cffi_dir.append(name) + return + # remove ptr= from the library instance, and replace + # it by a property on the class, which reads/writes into ptr[0]. + funcname = '_cffi_var_%s' % name + BFunc = self.ffi._typeof_locked(tp.get_c_name('*(*)(void)', name))[0] + function = module.load_function(BFunc, funcname) + ptr = function() + def getter(library): + return ptr[0] + def setter(library, value): + ptr[0] = value + setattr(type(library), name, property(getter, setter)) + type(library)._cffi_dir.append(name) + +cffimod_header = r''' +#include +#include +#include +#include +#include /* XXX for ssize_t on some platforms */ + +/* this block of #ifs should be kept exactly identical between + c/_cffi_backend.c, cffi/vengine_cpy.py, cffi/vengine_gen.py + and cffi/_cffi_include.h */ +#if defined(_MSC_VER) +# include /* for alloca() */ +# if _MSC_VER < 1600 /* MSVC < 2010 */ + typedef __int8 int8_t; + typedef __int16 int16_t; + typedef __int32 int32_t; + typedef __int64 int64_t; + typedef unsigned __int8 uint8_t; + typedef unsigned __int16 uint16_t; + typedef unsigned __int32 uint32_t; + typedef unsigned __int64 uint64_t; + typedef __int8 int_least8_t; + typedef __int16 int_least16_t; + typedef __int32 int_least32_t; + typedef __int64 int_least64_t; + typedef unsigned __int8 uint_least8_t; + typedef unsigned __int16 uint_least16_t; + typedef unsigned __int32 uint_least32_t; + typedef unsigned __int64 uint_least64_t; + typedef __int8 int_fast8_t; + typedef __int16 int_fast16_t; + typedef __int32 int_fast32_t; + typedef __int64 int_fast64_t; + typedef unsigned __int8 uint_fast8_t; + typedef unsigned __int16 uint_fast16_t; + typedef unsigned __int32 uint_fast32_t; + typedef unsigned __int64 uint_fast64_t; + typedef __int64 intmax_t; + typedef unsigned __int64 uintmax_t; +# else +# include +# endif +# if _MSC_VER < 1800 /* MSVC < 2013 */ +# ifndef __cplusplus + typedef unsigned char _Bool; +# endif +# endif +#else +# include +# if (defined (__SVR4) && defined (__sun)) || defined(_AIX) || defined(__hpux) +# include +# endif +#endif +''' diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/cffi/verifier.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/cffi/verifier.py new file mode 100644 index 00000000..59b78c21 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/cffi/verifier.py @@ -0,0 +1,306 @@ +# +# DEPRECATED: implementation for ffi.verify() +# +import sys, os, binascii, shutil, io +from . import __version_verifier_modules__ +from . import ffiplatform +from .error import VerificationError + +if sys.version_info >= (3, 3): + import importlib.machinery + def _extension_suffixes(): + return importlib.machinery.EXTENSION_SUFFIXES[:] +else: + import imp + def _extension_suffixes(): + return [suffix for suffix, _, type in imp.get_suffixes() + if type == imp.C_EXTENSION] + + +if sys.version_info >= (3,): + NativeIO = io.StringIO +else: + class NativeIO(io.BytesIO): + def write(self, s): + if isinstance(s, unicode): + s = s.encode('ascii') + super(NativeIO, self).write(s) + + +class Verifier(object): + + def __init__(self, ffi, preamble, tmpdir=None, modulename=None, + ext_package=None, tag='', force_generic_engine=False, + source_extension='.c', flags=None, relative_to=None, **kwds): + if ffi._parser._uses_new_feature: + raise VerificationError( + "feature not supported with ffi.verify(), but only " + "with ffi.set_source(): %s" % (ffi._parser._uses_new_feature,)) + self.ffi = ffi + self.preamble = preamble + if not modulename: + flattened_kwds = ffiplatform.flatten(kwds) + vengine_class = _locate_engine_class(ffi, force_generic_engine) + self._vengine = vengine_class(self) + self._vengine.patch_extension_kwds(kwds) + self.flags = flags + self.kwds = self.make_relative_to(kwds, relative_to) + # + if modulename: + if tag: + raise TypeError("can't specify both 'modulename' and 'tag'") + else: + key = '\x00'.join([sys.version[:3], __version_verifier_modules__, + preamble, flattened_kwds] + + ffi._cdefsources) + if sys.version_info >= (3,): + key = key.encode('utf-8') + k1 = hex(binascii.crc32(key[0::2]) & 0xffffffff) + k1 = k1.lstrip('0x').rstrip('L') + k2 = hex(binascii.crc32(key[1::2]) & 0xffffffff) + k2 = k2.lstrip('0').rstrip('L') + modulename = '_cffi_%s_%s%s%s' % (tag, self._vengine._class_key, + k1, k2) + suffix = _get_so_suffixes()[0] + self.tmpdir = tmpdir or _caller_dir_pycache() + self.sourcefilename = os.path.join(self.tmpdir, modulename + source_extension) + self.modulefilename = os.path.join(self.tmpdir, modulename + suffix) + self.ext_package = ext_package + self._has_source = False + self._has_module = False + + def write_source(self, file=None): + """Write the C source code. It is produced in 'self.sourcefilename', + which can be tweaked beforehand.""" + with self.ffi._lock: + if self._has_source and file is None: + raise VerificationError( + "source code already written") + self._write_source(file) + + def compile_module(self): + """Write the C source code (if not done already) and compile it. + This produces a dynamic link library in 'self.modulefilename'.""" + with self.ffi._lock: + if self._has_module: + raise VerificationError("module already compiled") + if not self._has_source: + self._write_source() + self._compile_module() + + def load_library(self): + """Get a C module from this Verifier instance. + Returns an instance of a FFILibrary class that behaves like the + objects returned by ffi.dlopen(), but that delegates all + operations to the C module. If necessary, the C code is written + and compiled first. + """ + with self.ffi._lock: + if not self._has_module: + self._locate_module() + if not self._has_module: + if not self._has_source: + self._write_source() + self._compile_module() + return self._load_library() + + def get_module_name(self): + basename = os.path.basename(self.modulefilename) + # kill both the .so extension and the other .'s, as introduced + # by Python 3: 'basename.cpython-33m.so' + basename = basename.split('.', 1)[0] + # and the _d added in Python 2 debug builds --- but try to be + # conservative and not kill a legitimate _d + if basename.endswith('_d') and hasattr(sys, 'gettotalrefcount'): + basename = basename[:-2] + return basename + + def get_extension(self): + ffiplatform._hack_at_distutils() # backward compatibility hack + if not self._has_source: + with self.ffi._lock: + if not self._has_source: + self._write_source() + sourcename = ffiplatform.maybe_relative_path(self.sourcefilename) + modname = self.get_module_name() + return ffiplatform.get_extension(sourcename, modname, **self.kwds) + + def generates_python_module(self): + return self._vengine._gen_python_module + + def make_relative_to(self, kwds, relative_to): + if relative_to and os.path.dirname(relative_to): + dirname = os.path.dirname(relative_to) + kwds = kwds.copy() + for key in ffiplatform.LIST_OF_FILE_NAMES: + if key in kwds: + lst = kwds[key] + if not isinstance(lst, (list, tuple)): + raise TypeError("keyword '%s' should be a list or tuple" + % (key,)) + lst = [os.path.join(dirname, fn) for fn in lst] + kwds[key] = lst + return kwds + + # ---------- + + def _locate_module(self): + if not os.path.isfile(self.modulefilename): + if self.ext_package: + try: + pkg = __import__(self.ext_package, None, None, ['__doc__']) + except ImportError: + return # cannot import the package itself, give up + # (e.g. it might be called differently before installation) + path = pkg.__path__ + else: + path = None + filename = self._vengine.find_module(self.get_module_name(), path, + _get_so_suffixes()) + if filename is None: + return + self.modulefilename = filename + self._vengine.collect_types() + self._has_module = True + + def _write_source_to(self, file): + self._vengine._f = file + try: + self._vengine.write_source_to_f() + finally: + del self._vengine._f + + def _write_source(self, file=None): + if file is not None: + self._write_source_to(file) + else: + # Write our source file to an in memory file. + f = NativeIO() + self._write_source_to(f) + source_data = f.getvalue() + + # Determine if this matches the current file + if os.path.exists(self.sourcefilename): + with open(self.sourcefilename, "r") as fp: + needs_written = not (fp.read() == source_data) + else: + needs_written = True + + # Actually write the file out if it doesn't match + if needs_written: + _ensure_dir(self.sourcefilename) + with open(self.sourcefilename, "w") as fp: + fp.write(source_data) + + # Set this flag + self._has_source = True + + def _compile_module(self): + # compile this C source + tmpdir = os.path.dirname(self.sourcefilename) + outputfilename = ffiplatform.compile(tmpdir, self.get_extension()) + try: + same = ffiplatform.samefile(outputfilename, self.modulefilename) + except OSError: + same = False + if not same: + _ensure_dir(self.modulefilename) + shutil.move(outputfilename, self.modulefilename) + self._has_module = True + + def _load_library(self): + assert self._has_module + if self.flags is not None: + return self._vengine.load_library(self.flags) + else: + return self._vengine.load_library() + +# ____________________________________________________________ + +_FORCE_GENERIC_ENGINE = False # for tests + +def _locate_engine_class(ffi, force_generic_engine): + if _FORCE_GENERIC_ENGINE: + force_generic_engine = True + if not force_generic_engine: + if '__pypy__' in sys.builtin_module_names: + force_generic_engine = True + else: + try: + import _cffi_backend + except ImportError: + _cffi_backend = '?' + if ffi._backend is not _cffi_backend: + force_generic_engine = True + if force_generic_engine: + from . import vengine_gen + return vengine_gen.VGenericEngine + else: + from . import vengine_cpy + return vengine_cpy.VCPythonEngine + +# ____________________________________________________________ + +_TMPDIR = None + +def _caller_dir_pycache(): + if _TMPDIR: + return _TMPDIR + result = os.environ.get('CFFI_TMPDIR') + if result: + return result + filename = sys._getframe(2).f_code.co_filename + return os.path.abspath(os.path.join(os.path.dirname(filename), + '__pycache__')) + +def set_tmpdir(dirname): + """Set the temporary directory to use instead of __pycache__.""" + global _TMPDIR + _TMPDIR = dirname + +def cleanup_tmpdir(tmpdir=None, keep_so=False): + """Clean up the temporary directory by removing all files in it + called `_cffi_*.{c,so}` as well as the `build` subdirectory.""" + tmpdir = tmpdir or _caller_dir_pycache() + try: + filelist = os.listdir(tmpdir) + except OSError: + return + if keep_so: + suffix = '.c' # only remove .c files + else: + suffix = _get_so_suffixes()[0].lower() + for fn in filelist: + if fn.lower().startswith('_cffi_') and ( + fn.lower().endswith(suffix) or fn.lower().endswith('.c')): + try: + os.unlink(os.path.join(tmpdir, fn)) + except OSError: + pass + clean_dir = [os.path.join(tmpdir, 'build')] + for dir in clean_dir: + try: + for fn in os.listdir(dir): + fn = os.path.join(dir, fn) + if os.path.isdir(fn): + clean_dir.append(fn) + else: + os.unlink(fn) + except OSError: + pass + +def _get_so_suffixes(): + suffixes = _extension_suffixes() + if not suffixes: + # bah, no C_EXTENSION available. Occurs on pypy without cpyext + if sys.platform == 'win32': + suffixes = [".pyd"] + else: + suffixes = [".so"] + + return suffixes + +def _ensure_dir(filename): + dirname = os.path.dirname(filename) + if dirname and not os.path.isdir(dirname): + os.makedirs(dirname) diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent-1.4.0.dist-info/AUTHORS b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent-1.4.0.dist-info/AUTHORS new file mode 100644 index 00000000..05892fb7 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent-1.4.0.dist-info/AUTHORS @@ -0,0 +1,62 @@ +Gevent is written and maintained by + + Denis Bilenko + Matt Iversen + Steffen Prince + Jason Madden + +and the contributors (ordered by the date of first contribution): + + Jason Toffaletti + Mike Barton + Ludvig Ericson + Marcus Cavanaugh + Matt Goodall + Ralf Schmitt + Daniele Varrazzo + Nicholas Piël + Örjan Persson + Uriel Katz + Ted Suzman + Randall Leeds + Erik Näslund + Alexey Borzenkov + David Hain + Dmitry Chechik + Ned Rockson + Tommie Gannert + Shaun Lindsay + Andreas Blixt + Nick Barkas + Galfy Pundee + Alexander Boudkar + Damien Churchill + Tom Lynn + Shaun Cutts + David LaBissoniere + Alexandre Kandalintsev + Geert Jansen + Vitaly Kruglikov + Saúl Ibarra Corretgé + Oliver Beattie + Bobby Powers + Anton Patrushev + Jan-Philip Gehrcke + Alex Gaynor + 陈小玉 + Philip Conrad + Heungsub Lee + Ron Rothman + + See https://github.com/gevent/gevent/graphs/contributors for more info. + +Gevent is inspired by and uses some code from eventlet which was written by + + Bob Ipollito + Donovan Preston + +The win32util module is taken from Twisted. The tblib module is taken from python-tblib by Ionel Cristian Mărieș. + +Some modules (local, ssl) contain code from the Python standard library. + +If your code is used in gevent and you are not mentioned above, please contact the maintainer. diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent-1.4.0.dist-info/INSTALLER b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent-1.4.0.dist-info/INSTALLER new file mode 100644 index 00000000..a1b589e3 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent-1.4.0.dist-info/INSTALLER @@ -0,0 +1 @@ +pip diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent-1.4.0.dist-info/LICENSE b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent-1.4.0.dist-info/LICENSE new file mode 100644 index 00000000..b767c245 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent-1.4.0.dist-info/LICENSE @@ -0,0 +1,25 @@ +MIT License + +Except when otherwise stated (look at the beginning of each file) the software +and the documentation in this project are copyrighted by: + + Denis Bilenko and the contributors, http://www.gevent.org + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent-1.4.0.dist-info/METADATA b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent-1.4.0.dist-info/METADATA new file mode 100644 index 00000000..eca8738b --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent-1.4.0.dist-info/METADATA @@ -0,0 +1,367 @@ +Metadata-Version: 2.1 +Name: gevent +Version: 1.4.0 +Summary: Coroutine-based network library +Home-page: http://www.gevent.org/ +Author: Denis Bilenko +Author-email: denis.bilenko@gmail.com +Maintainer: Jason Madden +Maintainer-email: jason@nextthought.com +License: MIT +Project-URL: Bug Tracker, https://github.com/gevent/gevent/issues +Project-URL: Source Code, https://github.com/gevent/gevent/ +Project-URL: Documentation, http://www.gevent.org +Keywords: greenlet coroutine cooperative multitasking light threads monkey +Platform: UNKNOWN +Classifier: License :: OSI Approved :: MIT License +Classifier: Programming Language :: Python :: 2.7 +Classifier: Programming Language :: Python :: 3.4 +Classifier: Programming Language :: Python :: 3.5 +Classifier: Programming Language :: Python :: 3.6 +Classifier: Programming Language :: Python :: 3.7 +Classifier: Programming Language :: Python :: Implementation :: CPython +Classifier: Programming Language :: Python :: Implementation :: PyPy +Classifier: Operating System :: MacOS :: MacOS X +Classifier: Operating System :: POSIX +Classifier: Operating System :: Microsoft :: Windows +Classifier: Topic :: Internet +Classifier: Topic :: Software Development :: Libraries :: Python Modules +Classifier: Intended Audience :: Developers +Classifier: Development Status :: 4 - Beta +Requires-Python: >=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.* +Description-Content-Type: text/x-rst +Requires-Dist: greenlet (>=0.4.14) ; platform_python_implementation == "CPython" +Requires-Dist: cffi (>=1.11.5) ; sys_platform == "win32" and platform_python_implementation == "CPython" +Provides-Extra: dnspython +Requires-Dist: dnspython ; extra == 'dnspython' +Requires-Dist: idna ; extra == 'dnspython' +Provides-Extra: doc +Requires-Dist: repoze.sphinx.autointerface ; extra == 'doc' +Provides-Extra: events +Requires-Dist: zope.event ; extra == 'events' +Requires-Dist: zope.interface ; extra == 'events' +Provides-Extra: test +Requires-Dist: zope.interface ; extra == 'test' +Requires-Dist: zope.event ; extra == 'test' +Requires-Dist: requests ; extra == 'test' +Requires-Dist: objgraph ; extra == 'test' +Requires-Dist: psutil ; (platform_python_implementation == "CPython" or sys_platform != "win32") and extra == 'test' +Requires-Dist: futures ; (python_version == "2.7") and extra == 'test' +Requires-Dist: mock ; (python_version == "2.7") and extra == 'test' +Requires-Dist: coverage (>=5.0a3) ; (sys_platform != "win32") and extra == 'test' +Requires-Dist: coveralls (>=1.0) ; (sys_platform != "win32") and extra == 'test' + +======== + gevent +======== + +.. image:: https://travis-ci.org/gevent/gevent.svg?branch=master + :target: https://travis-ci.org/gevent/gevent + +.. image:: https://ci.appveyor.com/api/projects/status/q4kl21ng2yo2ixur?svg=true + :target: https://ci.appveyor.com/project/denik/gevent + +.. image:: https://coveralls.io/repos/gevent/gevent/badge.svg?branch=master&service=github + :target: https://coveralls.io/github/gevent/gevent?branch=master + +.. + This file is included in README.rst from the top-level + so it is limited to pure ReST markup, not Sphinx. + + + +gevent is a coroutine_ -based Python_ networking library that uses +`greenlet `_ to provide a high-level synchronous API on top of the `libev`_ +or `libuv`_ event loop. + +Features include: + + +* Fast event loop based on `libev`_ or `libuv`_. +* Lightweight execution units based on greenlets. +* API that re-uses concepts from the Python standard library (for + examples there are `events`_ and + `queues`_). +* `Cooperative sockets with SSL support `_ +* `Cooperative DNS queries `_ performed through a threadpool, + dnspython, or c-ares. +* `Monkey patching utility `_ to get 3rd party modules to become cooperative +* TCP/UDP/HTTP servers +* Subprocess support (through `gevent.subprocess`_) +* Thread pools + +gevent is `inspired by eventlet`_ but features a more consistent API, +simpler implementation and better performance. Read why others `use +gevent`_ and check out the list of the `open source projects based on +gevent`_. + +gevent was written by `Denis Bilenko `_. + +Since version 1.1, gevent is maintained by Jason Madden for +`NextThought `_ with help from the +`contributors `_ +and is licensed under the MIT license. + +See `what's new`_ in the latest major release. + +Check out the detailed changelog_ for this version. + +.. _events: http://www.gevent.org/api/gevent.event.html#gevent.event.Event +.. _queues: http://www.gevent.org/api/gevent.queue.html#gevent.queue.Queue +.. _gevent.subprocess: http://www.gevent.org/api/gevent.subprocess.html#module-gevent.subprocess + +.. _coroutine: https://en.wikipedia.org/wiki/Coroutine +.. _Python: http://python.org +.. _libev: http://software.schmorp.de/pkg/libev.html +.. _libuv: http://libuv.org +.. _inspired by eventlet: http://blog.gevent.org/2010/02/27/why-gevent/ +.. _use gevent: http://groups.google.com/group/gevent/browse_thread/thread/4de9703e5dca8271 +.. _open source projects based on gevent: https://github.com/gevent/gevent/wiki/Projects +.. _what's new: http://www.gevent.org/whatsnew_1_3.html +.. _changelog: http://www.gevent.org/changelog.html + + +Read the documentation online at http://www.gevent.org. + +Post feedback and issues on the `bug tracker`_, `mailing list`_, blog_ +and `twitter (@gevent)`_. + + +=============================== + Installation and Requirements +=============================== + +.. _installation: + +.. + This file is included in README.rst so it is limited to plain + ReST markup, not Sphinx. + +Supported Platforms +=================== + +`gevent 1.3`_ runs on Python 2.7 and Python 3. Releases 3.4, 3.5 and +3.6 of Python 3 are supported. (Users of older versions of Python 2 +need to install gevent 1.0.x (2.5), 1.1.x (2.6) or 1.2.x (<=2.7.8); +gevent 1.2 can be installed on Python 3.3.) gevent requires the +`greenlet `_ library and will install +the `cffi`_ library by default on Windows. + +gevent 1.3 also runs on PyPy 5.5 and above, although 5.9 or above is +strongly recommended. On PyPy, there are no external dependencies. + +gevent is tested on Windows, OS X, and Linux, and should run on most +other Unix-like operating systems (e.g., FreeBSD, Solaris, etc.) + +.. note:: On Windows using the libev backend, gevent is + limited to a maximum of 1024 open sockets due to + `limitations in libev`_. This limitation should not exist + with the default libuv backend. + +Installation +============ + +.. note:: + + This section is about installing released versions of gevent + as distributed on the `Python Package Index`_ + +.. _Python Package Index: http://pypi.org/project/gevent + +gevent and greenlet can both be installed with `pip`_, e.g., ``pip +install gevent``. Installation using `buildout +`_ is also supported. + +On Windows, OS X, and Linux, both gevent and greenlet are +distributed as binary `wheels`_. + +.. tip:: + + You need Pip 8.0 or later, or buildout 2.10.0 to install the + binary wheels. + +.. tip:: + + On Linux, you'll need to install gevent from source if you wish to + use the libuv loop implementation. This is because the `manylinux1 + `_ specification for the + distributed wheels does not support libuv. The `cffi`_ library + *must* be installed at build time. + + +Installing From Source +---------------------- + +If you are unable to use the binary wheels (for platforms where no +pre-built wheels are available or if wheel installation is disabled, +e.g., for libuv support on Linux), here are some things you need to know. + +- You can install gevent from source with ``pip install --no-binary + gevent gevent``. + +- You'll need a working C compiler that can build Python extensions. + On some platforms, you may need to install Python development + packages. + +- Installing from source requires ``setuptools``. This is installed + automatically in virtual environments and by buildout. However, + gevent uses :pep:`496` environment markers in ``setup.py``. + Consequently, you'll need a version of setuptools newer than 25 + (mid 2016) to install gevent from source; a version that's too old + will produce a ``ValueError``. Older versions of pipenv may also + `have issues installing gevent for this reason + `_. + +- To build the libuv backend (which is required on Windows and + optional elsewhere), or the CFFI-based libev backend, you must + install `cffi`_ before attempting to install gevent on CPython (on + PyPy this step is not necessary). + + +Common Installation Issues +-------------------------- + +The following are some common installation problems and solutions for +those compiling gevent from source. + +- Some Linux distributions are now mounting their temporary + directories with the ``noexec`` option. This can cause a standard + ``pip install gevent`` to fail with an error like ``cannot run C + compiled programs``. One fix is to mount the temporary directory + without that option. Another may be to use the ``--build`` option to + ``pip install`` to specify another directory. See `issue #570 + `_ and `issue #612 + `_ for examples. + +- Also check for conflicts with environment variables like ``CFLAGS``. For + example, see `Library Updates `_. + +- Users of a recent SmartOS release may need to customize the + ``CPPFLAGS`` (the environment variable containing the default + options for the C preprocessor) if they are using the libev shipped + with gevent. See `Operating Systems + `_ + for more information. + +- If you see ``ValueError: ("Expected ',' or end-of-list in", "cffi >= + 1.11.5 ; sys_platform == 'win32' and platform_python_implementation + == 'CPython'", 'at', " ; sys_platform == 'win32' and + platform_python_implementation == 'CPython'")``, the version of + setuptools is too old. Install a more recent version of setuptools. + + +Extra Dependencies +================== + +gevent has no runtime dependencies outside the standard library, +greenlet and (on some platforms) `cffi`_. However, there are a +number of additional libraries that extend gevent's functionality and +will be used if they are available. + +The `psutil `_ library is needed to +monitor memory usage. + +`zope.event `_ is highly +recommended for configurable event support; it can be installed with +the ``events`` extra, e.g., ``pip install gevent[events]``. + +`dnspython `_ is required for the +new pure-Python resolver, and on Python 2, so is `idna +`_. They can be installed with the +``dnspython`` extra. + + +Development +=========== + +To install the latest development version:: + + pip install setuptools cffi 'cython>=0.28' git+git://github.com/gevent/gevent.git#egg=gevent + +.. note:: + + You will not be able to run gevent's test suite using that method. + +To hack on gevent (using a virtualenv):: + + $ git clone https://github.com/gevent/gevent.git + $ cd gevent + $ virtualenv env + $ source env/bin/activate + (env) $ pip install -r dev-requirements.txt + +.. note:: + + The notes above about installing from source apply here as well. + The ``dev-requirements.txt`` file takes care of the library + prerequisites (CFFI, Cython), but having a working C compiler that + can create Python extensions is up to you. + + +Running Tests +------------- + +There are a few different ways to run the tests. To simply run the +tests on one version of Python during development, begin with the +above instructions to install gevent in a virtual environment and then +run:: + + (env) $ python -mgevent.tests + +Before submitting a pull request, it's a good idea to run the tests +across all supported versions of Python, and to check the code quality +using prospector. This is what is done on Travis CI. Locally it +can be done using tox:: + + pip install tox + tox + +The testrunner accepts a ``--coverage`` argument to enable code +coverage metrics through the `coverage.py`_ package. That would go +something like this:: + + python -m gevent.tests --coverage + coverage combine + coverage html -i + + +Continuous integration +---------------------- + +A test suite is run for every push and pull request submitted. Travis +CI is used to test on Linux, and `AppVeyor`_ runs the builds on +Windows. + +.. image:: https://travis-ci.org/gevent/gevent.svg?branch=master + :target: https://travis-ci.org/gevent/gevent + +.. image:: https://ci.appveyor.com/api/projects/status/q4kl21ng2yo2ixur?svg=true + :target: https://ci.appveyor.com/project/denik/gevent + + +Builds on Travis CI automatically submit updates to `coveralls.io`_ to +monitor test coverage. + +.. image:: https://coveralls.io/repos/gevent/gevent/badge.svg?branch=master&service=github + :target: https://coveralls.io/github/gevent/gevent?branch=master + +.. note:: On Debian, you will probably need ``libpythonX.Y-testsuite`` + installed to run all the tests. + +.. _coverage.py: https://pypi.python.org/pypi/coverage/ +.. _coveralls.io: https://coveralls.io/github/gevent/gevent +.. _`pip`: https://pip.pypa.io/en/stable/installing/ +.. _`wheels`: http://pythonwheels.com +.. _`gevent 1.3`: whatsnew_1_3.html + +.. _`cffi`: https://cffi.readthedocs.io +.. _`limitations in libev`: http://pod.tst.eu/http://cvs.schmorp.de/libev/ev.pod#WIN32_PLATFORM_LIMITATIONS_AND_WORKA +.. _AppVeyor: https://ci.appveyor.com/project/denik/gevent + + +.. _bug tracker: https://github.com/gevent/gevent/wiki/Projects +.. _mailing list: http://groups.google.com/group/gevent +.. _blog: http://blog.gevent.org +.. _twitter (@gevent): http://twitter.com/gevent + + diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent-1.4.0.dist-info/NOTICE b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent-1.4.0.dist-info/NOTICE new file mode 100644 index 00000000..83573c08 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent-1.4.0.dist-info/NOTICE @@ -0,0 +1,94 @@ +gevent is licensed under the MIT license. See the LICENSE file for the +complete license. + +Portions of this software may have other licenses. + +============================================= + +greentest/2.7 +greentest/2.7.8 +greentest/2.7pypy +greentest/3.3 +greentest/3.4 +greentest/3.5 +----------------- + +Copyright (c) 2001-2016 Python Software Foundation; All Rights Reserved + +PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2 +-------------------------------------------- + +1. This LICENSE AGREEMENT is between the Python Software Foundation +("PSF"), and the Individual or Organization ("Licensee") accessing and +otherwise using this software ("Python") in source or binary form and +its associated documentation. + +2. Subject to the terms and conditions of this License Agreement, PSF hereby +grants Licensee a nonexclusive, royalty-free, world-wide license to reproduce, +analyze, test, perform and/or display publicly, prepare derivative works, +distribute, and otherwise use Python alone or in any derivative version, +provided, however, that PSF's License Agreement and PSF's notice of copyright, +i.e., "Copyright (c) 2001-2016 Python Software Foundation; All Rights +Reserved" are retained in Python alone or in any derivative version prepared +by Licensee. + +3. In the event Licensee prepares a derivative work that is based on +or incorporates Python or any part thereof, and wants to make +the derivative work available to others as provided herein, then +Licensee hereby agrees to include in any such work a brief summary of +the changes made to Python. + +4. PSF is making Python available to Licensee on an "AS IS" +basis. PSF MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR +IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, PSF MAKES NO AND +DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS +FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON WILL NOT +INFRINGE ANY THIRD PARTY RIGHTS. + +5. PSF SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON +FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS +A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON, +OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF. + +6. This License Agreement will automatically terminate upon a material +breach of its terms and conditions. + +7. Nothing in this License Agreement shall be deemed to create any +relationship of agency, partnership, or joint venture between PSF and +Licensee. This License Agreement does not grant permission to use PSF +trademarks or trade name in a trademark sense to endorse or promote +products or services of Licensee, or any third party. + +8. By copying, installing or otherwise using Python, Licensee +agrees to be bound by the terms and conditions of this License +Agreement. + +============================================ + +gevent/libuv/_corecffi_source.c +gevent/libuv/_corecffi_cdef.c + +Originally based on code from https://github.com/veegee/guv + +Copyright (c) 2014 V G + + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. + +=========================================== diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent-1.4.0.dist-info/RECORD b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent-1.4.0.dist-info/RECORD new file mode 100644 index 00000000..7d315508 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent-1.4.0.dist-info/RECORD @@ -0,0 +1,563 @@ +gevent-1.4.0.dist-info/AUTHORS,sha256=IS4ttuioANx5ucZqOXHiezC9ys2nkpxl1M_8f77Rleo,1303 +gevent-1.4.0.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4 +gevent-1.4.0.dist-info/LICENSE,sha256=TUa8EdGeOFPVQyWXO44sUwkPVjinvyf6H18SMseJAfc,1235 +gevent-1.4.0.dist-info/METADATA,sha256=sWhcP3zm6JeF0jrJNoZmE_WJ1tirRm_QGd9018zsewg,14012 +gevent-1.4.0.dist-info/NOTICE,sha256=ZJOCR8qaV_7kwRZWQEuTwxMCkYfhPaeHySe2xkpoBYM,4004 +gevent-1.4.0.dist-info/RECORD,, +gevent-1.4.0.dist-info/WHEEL,sha256=qpJVJz3f_oih5sb10CVod9jCddHwxilziZPn0B8tgFQ,106 +gevent-1.4.0.dist-info/entry_points.txt,sha256=j3Bs4dZY03xbORf-NbA6xkzNErzi1OVktpPF8rFrRQA,96 +gevent-1.4.0.dist-info/top_level.txt,sha256=fpElGiTe2fdw27vmNxdV5MQpyndjzWZMk5TB_NMYPSI,7 +gevent/__abstract_linkable.cp37-win_amd64.pyd,sha256=A1Mxdqcx_l56IH_oM9ZaasErb2rVfvom-iz67IlZEC4,71168 +gevent/__abstract_linkable.pxd,sha256=PVN1gd3tfa_yMOYZ7d-kjc1No2sz7Wie_IIgsx3-x_Q,1469 +gevent/__greenlet_primitives.cp37-win_amd64.pyd,sha256=e_2JaoKFe2eV6ub_Cd4_gZlydXQQ4l-VuKy6umlGDnw,57856 +gevent/__greenlet_primitives.pxd,sha256=GW2sdrRzeRtvjqQ7D-oay0BTQ7FEVt2Tt7KUn6KVjNU,1101 +gevent/__hub_local.cp37-win_amd64.pyd,sha256=uVt3Vxkxn5Dk-nNSX3K7yf_S3aRK2GDIt9HWim3H1gM,54272 +gevent/__hub_local.pxd,sha256=DTX_cs_K3W_QZxRZnDkER897FMrBGB8DuBumW0HFQqk,522 +gevent/__hub_primitives.cp37-win_amd64.pyd,sha256=4-ZU8qDj1SYHUB5_t7dbEe8ZagJnm5AaRmmSzWffB5Q,120832 +gevent/__hub_primitives.pxd,sha256=jMZVuU8c5LDF5ACKmGYQgbZinRaf2cRxdYbUNFeoR8o,1972 +gevent/__ident.cp37-win_amd64.pyd,sha256=2rTdfuDe3mJqSYZ-XP6GNu9KKK1_TaItzYOCWqSKohY,49664 +gevent/__ident.pxd,sha256=toMQT_XCLLeNB9rbjRHp5h9vdBHNbL5tplra0BUSiDQ,496 +gevent/__imap.cp37-win_amd64.pyd,sha256=iAmrXHve38EnU7XJUBOG2N5QmvTpa5FcYJTaH8BwVBU,86528 +gevent/__imap.pxd,sha256=BIgNRMvjzrChq4PwAHnEOhOr5h-9Wte0s4USf7KPqsg,1103 +gevent/__init__.py,sha256=LmqW8f68068GxkaRliZHHpDt_Ox5kp6Em-HUQf90vl8,5245 +gevent/__pycache__/__init__.cpython-37.pyc,, +gevent/__pycache__/_abstract_linkable.cpython-37.pyc,, +gevent/__pycache__/_compat.cpython-37.pyc,, +gevent/__pycache__/_config.cpython-37.pyc,, +gevent/__pycache__/_fileobjectcommon.cpython-37.pyc,, +gevent/__pycache__/_fileobjectposix.cpython-37.pyc,, +gevent/__pycache__/_greenlet_primitives.cpython-37.pyc,, +gevent/__pycache__/_hub_local.cpython-37.pyc,, +gevent/__pycache__/_hub_primitives.cpython-37.pyc,, +gevent/__pycache__/_ident.cpython-37.pyc,, +gevent/__pycache__/_imap.cpython-37.pyc,, +gevent/__pycache__/_interfaces.cpython-37.pyc,, +gevent/__pycache__/_monitor.cpython-37.pyc,, +gevent/__pycache__/_patcher.cpython-37.pyc,, +gevent/__pycache__/_semaphore.cpython-37.pyc,, +gevent/__pycache__/_socket2.cpython-37.pyc,, +gevent/__pycache__/_socket3.cpython-37.pyc,, +gevent/__pycache__/_socketcommon.cpython-37.pyc,, +gevent/__pycache__/_ssl2.cpython-37.pyc,, +gevent/__pycache__/_ssl3.cpython-37.pyc,, +gevent/__pycache__/_sslgte279.cpython-37.pyc,, +gevent/__pycache__/_tblib.cpython-37.pyc,, +gevent/__pycache__/_threading.cpython-37.pyc,, +gevent/__pycache__/_tracer.cpython-37.pyc,, +gevent/__pycache__/_util.cpython-37.pyc,, +gevent/__pycache__/_util_py2.cpython-37.pyc,, +gevent/__pycache__/_waiter.cpython-37.pyc,, +gevent/__pycache__/ares.cpython-37.pyc,, +gevent/__pycache__/backdoor.cpython-37.pyc,, +gevent/__pycache__/baseserver.cpython-37.pyc,, +gevent/__pycache__/builtins.cpython-37.pyc,, +gevent/__pycache__/core.cpython-37.pyc,, +gevent/__pycache__/event.cpython-37.pyc,, +gevent/__pycache__/events.cpython-37.pyc,, +gevent/__pycache__/exceptions.cpython-37.pyc,, +gevent/__pycache__/fileobject.cpython-37.pyc,, +gevent/__pycache__/greenlet.cpython-37.pyc,, +gevent/__pycache__/hub.cpython-37.pyc,, +gevent/__pycache__/local.cpython-37.pyc,, +gevent/__pycache__/lock.cpython-37.pyc,, +gevent/__pycache__/monkey.cpython-37.pyc,, +gevent/__pycache__/os.cpython-37.pyc,, +gevent/__pycache__/pool.cpython-37.pyc,, +gevent/__pycache__/pywsgi.cpython-37.pyc,, +gevent/__pycache__/queue.cpython-37.pyc,, +gevent/__pycache__/resolver_ares.cpython-37.pyc,, +gevent/__pycache__/resolver_thread.cpython-37.pyc,, +gevent/__pycache__/select.cpython-37.pyc,, +gevent/__pycache__/server.cpython-37.pyc,, +gevent/__pycache__/signal.cpython-37.pyc,, +gevent/__pycache__/socket.cpython-37.pyc,, +gevent/__pycache__/ssl.cpython-37.pyc,, +gevent/__pycache__/subprocess.cpython-37.pyc,, +gevent/__pycache__/thread.cpython-37.pyc,, +gevent/__pycache__/threading.cpython-37.pyc,, +gevent/__pycache__/threadpool.cpython-37.pyc,, +gevent/__pycache__/time.cpython-37.pyc,, +gevent/__pycache__/timeout.cpython-37.pyc,, +gevent/__pycache__/util.cpython-37.pyc,, +gevent/__pycache__/win32util.cpython-37.pyc,, +gevent/__semaphore.cp37-win_amd64.pyd,sha256=jKDz_3FHgJkUDBGP4DmeRxzCOwxNZxUkR25OpuVshHM,78336 +gevent/__semaphore.pxd,sha256=h600zR6GZTPXMYxpMmNeL4gd01mlraW10yZf2Clt8RU,665 +gevent/__tracer.cp37-win_amd64.pyd,sha256=VSa-Xezbki6WDtHWXUWBranEB_YyC-P9Lb03nQxZI-w,86528 +gevent/__tracer.pxd,sha256=m7uZ-bUN4D8Av_NE9xUJfRkiCnu5BGZ4RjNJvHHosHo,884 +gevent/__waiter.cp37-win_amd64.pyd,sha256=oNyUt5E-mduuulKqQXpx2i0yUMLeLBfPcYgRqjJorLA,76800 +gevent/__waiter.pxd,sha256=oYVauEKGS6MFNVNjsp5H_sxHEjqBc_ha2oEbE7d9DcE,1129 +gevent/_abstract_linkable.c,sha256=FHaxF03m7ZnAPni3vVqV0l-YC70XnAzpltDzbEH7JAw,345985 +gevent/_abstract_linkable.html,sha256=JR0imfGj_tZKKy8rfuWjDLtOY-oqZo8DbCxP-yIsZY8,169474 +gevent/_abstract_linkable.py,sha256=jWNoSAdXtnRlJhodxFP-wvOoV9RmMQHkrUtuSaPPbaI,8416 +gevent/_compat.py,sha256=W8P-VbE5JgGUtUc9eOAKleDFBdi_IBWIEQySgeZDVX4,5028 +gevent/_config.py,sha256=zFnJyoiW39i97TavK9U5fvxPO3O6n3B2MBP1bv0Z8dc,20240 +gevent/_event.cp37-win_amd64.pyd,sha256=87PxsJz5Fe4ThBbEuAXZ6dyQvcTX-csSlSb6xJvahlg,104960 +gevent/_event.pxd,sha256=-jkoHbYbLcvKC1FBwgOady2vUrSofRhHVMASlhs-oKg,628 +gevent/_ffi/__init__.py,sha256=BTBgjjvO4ecQBPbReBhem-0zvy1Mq6jXf5dMrykGIhs,493 +gevent/_ffi/__pycache__/__init__.cpython-37.pyc,, +gevent/_ffi/__pycache__/callback.cpython-37.pyc,, +gevent/_ffi/__pycache__/loop.cpython-37.pyc,, +gevent/_ffi/__pycache__/watcher.cpython-37.pyc,, +gevent/_ffi/callback.py,sha256=XR8Nll5CiX4QKDwflPLpWj1-BaUGcwka0QvO3qqpN8s,1651 +gevent/_ffi/loop.py,sha256=Yjl9FKSl1eXfFsCi5xrlxKUwIfUKIDbFuRvo_9E1ErI,28728 +gevent/_ffi/watcher.py,sha256=BUIJ-bzOgfAqvL8nVmd5x_jQ_X7t79mHe0BgEHRW3ys,20551 +gevent/_fileobjectcommon.py,sha256=KDySdmDpBDsMUmBe-LAtbep_GBhpfpWk3pSX5WC1U5s,9652 +gevent/_fileobjectposix.py,sha256=Q3HFvNsn2Snqo2QSDz1RTlEjWQBLbwGjlxSKO0k0Fk0,13796 +gevent/_greenlet.cp37-win_amd64.pyd,sha256=uilDFMfPFAcYOFqjQ620yrqY93aY7MCktno-nPy2JOw,225280 +gevent/_greenlet.pxd,sha256=IWVlcZLwVDLykNwnEf6wSQFWp8PfpOld53AytbiTcrg,4375 +gevent/_greenlet_primitives.c,sha256=G-H98Y0t7HM5sst1kD2V444qIQE52FjYfu-eVKErl6Y,263101 +gevent/_greenlet_primitives.html,sha256=7Z5Uk-xSe3yP0a8nY6_eWFyH7JHirqLEKi4IIaatPUw,92705 +gevent/_greenlet_primitives.py,sha256=DeeZeRb_FSMKcKamkUrH4TXsDHCBeoFI0ic4_LLI7Sg,3259 +gevent/_hub_local.c,sha256=EdKZD3RzDe-M9bn3FMQlnawYJ7xGOVTNVy1MWYxygmk,227777 +gevent/_hub_local.html,sha256=VCIfCDQqrH6YkgDZ5ZT1Rlqo6ynmiYaPEFVPS6qW814,83545 +gevent/_hub_local.py,sha256=lECCOC5_CeP7Jby4zj1Lebm5SUbRhaQJMytNe_zI8_k,2739 +gevent/_hub_primitives.c,sha256=kS9qTa1ivKGEKDg0273guIm43muXkSs7tI4tfSH5cME,528536 +gevent/_hub_primitives.html,sha256=9GOjtOWJIpHCgztA_xupnzjCTloYUkY8grYbtc97FT0,373917 +gevent/_hub_primitives.py,sha256=1IWA3lkQNZSkot8OsqQCwSB4cNeM2ytif3FPZyyHYTE,12946 +gevent/_ident.c,sha256=B_fMMKUhQ0UnWlDIKRfhBVf1l24WOE5YORladDZujmM,213245 +gevent/_ident.html,sha256=Qg9DeQVa4yxhw3FjxtXnRiI2dfCYYmsjhvr8MLsj3EQ,61604 +gevent/_ident.py,sha256=eyA7pXNr3saDDZwJfXjn8U69wS2iWbrJcGjcAEcEbDk,2245 +gevent/_imap.c,sha256=7tY9wL8MMrl1MyPhRN15vDW0EJcJmkyriNELmIZUZPc,421406 +gevent/_imap.html,sha256=0fGaZ42tSbEGFx5jIcnbB_s_6WtKZpQ1M_8zdP4MYI4,165842 +gevent/_imap.py,sha256=RubqWMTHdK4vLPzLY4vptCnbNfsfLRi9_uNy9Fw-XLM,7710 +gevent/_interfaces.py,sha256=0MwiLJ_mI-fN6HewTmgljM93Q9GJSx02f5Pf4BUCb8w,6983 +gevent/_local.cp37-win_amd64.pyd,sha256=6K-N17S4bJAnLy72m9qinJYjuhd0cFY09Lq9_7mXSFU,127488 +gevent/_local.pxd,sha256=NImltr7cRrnk-7zRZ2lXUigD3v4xOSqZWz0kd2F2BoU,2792 +gevent/_monitor.py,sha256=ArTvznAbobIICMOuV55T5Kbs2U0LBI6tjeOPcS07xRs,11901 +gevent/_patcher.py,sha256=-KdbfhqMLEG3PDBrqIXuYYZWPWanseOgGiARIPX8-qY,4118 +gevent/_queue.cp37-win_amd64.pyd,sha256=Y2ZoqPDTmqABy2l2Rp5LdthYO_9y-FwyIgksKfj-_00,200704 +gevent/_queue.pxd,sha256=qBieZQPOfYWbiu3FIWF1nqCP8tLe-y4zrxtNtwLKjY8,1391 +gevent/_semaphore.c,sha256=qXkqJvmZBo5WRXVhjkt7xPO8q2_DmV7mjVw1_CJnUck,349798 +gevent/_semaphore.html,sha256=1-PupnHnpQlJaRByqOIuhEI6W98Hp7H1wXllfwqQPks,172337 +gevent/_semaphore.py,sha256=5M9rHCYEnU-9Bi4DZyDvQCNtp_BVm15P0h-61qbes-I,6686 +gevent/_socket2.py,sha256=FXl1CyVXG0CWI1xrcfrigtwv9VYo3ReTIlWhW4cy2Jg,16534 +gevent/_socket3.py,sha256=9V2yjAIcICi0lxyfdQ6GtLEZ0I8Ne45AGBlG6_AtxwY,28893 +gevent/_socketcommon.py,sha256=tD3JqqWor88DYbceWzXrdQDX_8hz4kpGaSvQqV_UX7w,13454 +gevent/_ssl2.py,sha256=EnUQAc8ouigaMJAJVuO0FE9xmYjrtLf2NhNGB9dqX30,16951 +gevent/_ssl3.py,sha256=cZUs3JiTzPMBuRq0cMuPfWctbGharkbJL8Il2criV60,27103 +gevent/_sslgte279.py,sha256=UMNcclu1pKHcKKDwAB-B8Vctd42oxRAccrN2xcJ12V0,27490 +gevent/_tblib.py,sha256=ce8x51beuHDdXob1LvvqW7XSNS0q1rsuXtKzkuBL83Q,13246 +gevent/_threading.py,sha256=Ah9cozibYKrfdzTyh30qNGdhyKpoHywLbgFZeM6Nyo0,5291 +gevent/_tracer.c,sha256=LL7h450JmXvH1v9GQSgSjqmIQSDI4m9uvXx7EQPfFsk,404271 +gevent/_tracer.html,sha256=ahBikt-K41EvjRW7dB1Y7lmQITROOWtGmAY29ew_0bw,229792 +gevent/_tracer.py,sha256=EdNhOERSRYk21We8C6LdgD02m_rvI45QOYAJXPZwMmE,6235 +gevent/_util.py,sha256=aOapAAnsrl1NqBOAkRRpwYZxu0QorXCVPGuW7L2cu1A,5035 +gevent/_util_py2.py,sha256=og4n5HlSiFY6-NWoZiOJfQ3r47wMn3PgFiONHGPLAyA,506 +gevent/_waiter.c,sha256=iUXorwMQqeduNZGBmHvbegni6wq47kRKPPF7M9FtCQI,354894 +gevent/_waiter.html,sha256=aHjAH9jAKMcjKyGwAx2lFMVy4TOyvT68ebtXAER9Yi4,172037 +gevent/_waiter.py,sha256=2Wr2da5g49-IJtPI-TWy7Di1RhMHhmkE0QDERVPNo1g,7265 +gevent/ares.py,sha256=KJvKlPIqupEi51HaVx0Yli4HU97IhtFSN4cgIKJKLh4,336 +gevent/backdoor.py,sha256=-mXkfGChbQnC-vdPKBwzT937KcGzYPDh0rlKoe9u_B8,7123 +gevent/baseserver.py,sha256=yWX_FckWVfm3Go-O_xaDUw33ajqUXnAtfTWZ0UymEm4,15389 +gevent/builtins.py,sha256=H6T0k0yufU6qsnOZAQpXjQBwXF6L2-FdWK-c36IZocU,4718 +gevent/core.py,sha256=XgaVreHocvO9JCVby3JCo8ixbllJL08V9OrA7ETDaHs,479 +gevent/event.c,sha256=fkUMQhIrmve9Vg0FCu1m3hO6WQ0Y86tQglFEjTPhfNs,453774 +gevent/event.html,sha256=5DUg00J20K9LTGr01BWzhtZGEijY5-q82Wf5L8xe8i8,283514 +gevent/event.py,sha256=ptwIV0ogu8Yew2v-F115uSdLp-Te04yCFCulKLaoeFU,13571 +gevent/events.py,sha256=YTVY_G_ORI9VFcls-whRvr3GpsYKCpwVWxnPzt2YFVA,15611 +gevent/exceptions.py,sha256=KDmYwbSQjtMbl-wwyIsIQRGLBK20HdTdKpFrGPau2Vw,2093 +gevent/fileobject.py,sha256=gM2GT14akHsWCbIlCDonc9gi2Tq3tjffn4uVjWGccto,1892 +gevent/greenlet.c,sha256=XZeiZVaE4w5Cj2WdZDvupSfB8-b4GD-E_9y0gF2x2UQ,1023797 +gevent/greenlet.html,sha256=Jfuvo9GryoJcxfFfop36hBX5xDtz1fYMOqZTFBmbJn8,800938 +gevent/greenlet.py,sha256=1X2Mn6cxp62smf59S5z7RD4iMOOJn38t4SP7zxZNhDI,36559 +gevent/hub.py,sha256=OXjVswgRyrOooy83jz_y_hnYhcoCLwr_rzR61uABWYQ,27333 +gevent/libev/__init__.py,sha256=I6hpYFJCnbBBDrousKzZ7Ql--mnfAFwfM2q1BuxcMfI,169 +gevent/libev/__pycache__/__init__.cpython-37.pyc,, +gevent/libev/__pycache__/_corecffi_build.cpython-37.pyc,, +gevent/libev/__pycache__/corecffi.cpython-37.pyc,, +gevent/libev/__pycache__/watcher.cpython-37.pyc,, +gevent/libev/_corecffi_build.py,sha256=dvd3DMajYmV6vPHHfKbMV3s7rolGWOHaqf7nSDdyfL0,2374 +gevent/libev/_corecffi_cdef.c,sha256=l9-BecMsvpKaPDerD8zWtjPIhbg9LDszf2m4X0BXZS0,6679 +gevent/libev/_corecffi_source.c,sha256=xYFjS9IxF8RQKpS9HG6A1xMB7XPFO16sbcs6Fv5MPXk,2078 +gevent/libev/callbacks.c,sha256=_6gnWL5t0__7FuzMdQq2otP8Z6ammfE31MzwvlE7ZpQ,5983 +gevent/libev/callbacks.h,sha256=WTsA3IguzFiDUb9EQi3qQewg9goN4azoeQdb3m0LgVs,1029 +gevent/libev/corecext.c,sha256=WIiYCntx2SPBYgfyME3qGV4Sqdd1uZwv9jVap7TgY8I,951856 +gevent/libev/corecext.cp37-win_amd64.pyd,sha256=M4a7nfOT9IpnqbeLJR0HTVVTxXmfRTxBEVwlAuMB33Y,262144 +gevent/libev/corecext.h,sha256=KLlGMFw9sgLonvmJdDJxnFGEock2E9Tx5M0JWxvJslw,4018 +gevent/libev/corecext.html,sha256=PSSE94dGxO-MFSILAIibbo4b39gtOu_z0HzXrYLl2vE,1037242 +gevent/libev/corecext.pyx,sha256=dUmw0dF4aLTQpz5ujw-tvgx3mytiWK5UDLlRo60CNp0,44499 +gevent/libev/corecffi.py,sha256=LqFjBgQngupsRdva06hXkUy7hf4k8GG9g3DJJHEaemg,11915 +gevent/libev/libev.h,sha256=H_4mpixGJB1kyFg2uG_e5hNkYWCbc4b5AbCKyLY-llc,2800 +gevent/libev/libev.pxd,sha256=3Nw5UjV2MQS5SrwejGzyHExqWBQ_8CkKDflVUL3D_mc,5891 +gevent/libev/libev_vfd.h,sha256=ud1OzvgVJdl_EzGPp9w2Ljs0wYKOm4a5c7IIeZ-bK0s,5825 +gevent/libev/stathelper.c,sha256=kHXlvNryG-6NnAmFRS0owynyAtWjHQ3qhyp3gcdgA2s,5017 +gevent/libev/watcher.py,sha256=7y07l7ilDyDTgyUJg-q2fhSYmImox11CTd0GCu1B7QA,7926 +gevent/libuv/__init__.py,sha256=I6hpYFJCnbBBDrousKzZ7Ql--mnfAFwfM2q1BuxcMfI,169 +gevent/libuv/__pycache__/__init__.cpython-37.pyc,, +gevent/libuv/__pycache__/_corecffi_build.cpython-37.pyc,, +gevent/libuv/__pycache__/loop.cpython-37.pyc,, +gevent/libuv/__pycache__/watcher.cpython-37.pyc,, +gevent/libuv/_corecffi.cp37-win_amd64.pyd,sha256=sOMKu7VcpL4SF4oVd9uCHQ0dW8rb3w6Yl2TQdKg6iGA,159232 +gevent/libuv/_corecffi_build.py,sha256=2Z1xENB2jMkloYR1IahcR_gee5fq-jNxPb0lKDSMSko,8787 +gevent/libuv/_corecffi_cdef.c,sha256=Cg5viD68beoK4cEmA_ZNODv03rssb42Nl0PawNBNOyM,12922 +gevent/libuv/_corecffi_source.c,sha256=oy2RQKKWqCjpI3_rha_0T-vrr77-KBm79KpJawSpGNE,5795 +gevent/libuv/loop.py,sha256=c821BlJTXO6kJgUcSTjyQpvCEV14w22x1wMvnhAaaIM,23684 +gevent/libuv/watcher.py,sha256=1W4t-wrhwifBqLGwhabOkI4yNGsl3yf48ZJckJPemuo,26791 +gevent/local.c,sha256=IhWJlbrBRmPBDjzvrgL6W9LTiuPOgmu4CwLyiQ9vSx0,560361 +gevent/local.html,sha256=HpcSYyrazt9WjiKwHd8Qut8Y3RA4Lh2n88_y1JweV1Y,340512 +gevent/local.py,sha256=eQbEf5OCApOGLsWA2IMfxAN5fudLxSzn-5X8kTBGy6w,20617 +gevent/lock.py,sha256=Taq0qWkFjz554UhzZEmlP5ifedan3DuLCWJxn6ZGn1s,8082 +gevent/monkey.py,sha256=Ngjo5ZvSSHW3ys5zNPDi-aZ_FV4zfW6RtzAWcObDDE4,40683 +gevent/os.py,sha256=_1YwH4wyx3omsyfI7bzlXypIHdbTiXhKbDQc8MLEi9M,19554 +gevent/pool.py,sha256=zTnB7IM4Wa-SDq5G2DkaJ5GZZXunN1sVJk2_ijOqDl8,25584 +gevent/pywsgi.py,sha256=-Aya6QNUfwcf0Y0CIoLOqwvrAALwwoRa_k-jymfHCyk,60568 +gevent/queue.c,sha256=wjLvn6e5ZOWikpgnfXBmcn_kY7UA30HPApGxaQv1yVk,915684 +gevent/queue.html,sha256=ZXfdFLRrNpYraLzNu3xVXnpXUOghcX86cxB0BUHutlE,725133 +gevent/queue.py,sha256=JbvQulA3dhdB26ciX6PrppJMi_RoxSeN8Maf6BckloI,22806 +gevent/resolver/__init__.py,sha256=opqBGkhgE-Q7ex5wq2UKUL-XTSF6kCSeHHPes-Z-8GY,3690 +gevent/resolver/__pycache__/__init__.cpython-37.pyc,, +gevent/resolver/__pycache__/ares.cpython-37.pyc,, +gevent/resolver/__pycache__/blocking.cpython-37.pyc,, +gevent/resolver/__pycache__/dnspython.cpython-37.pyc,, +gevent/resolver/__pycache__/thread.cpython-37.pyc,, +gevent/resolver/ares.py,sha256=EHMPHZmmrq3VsTWck3OLA07AidtieN1RUucEz89yg8s,13829 +gevent/resolver/blocking.py,sha256=5ubBMewB7X-JouMKIlf_s2JNw4KJ_EqmNVUg4PrrSaA,1216 +gevent/resolver/cares.c,sha256=BQcgq_8AB0ZIR6MxT2ldb1AaVzmDFMANvG4NktQio_w,618987 +gevent/resolver/cares.cp37-win_amd64.pyd,sha256=phjOvBH7RQaIcNhjREFy4DVjoRI1RG3bqMYP8mt3sqA,189952 +gevent/resolver/cares.html,sha256=ZgWXkxq8XsTaBRM_R-Of66-KyGrEt1XGKWzKEs0XlGY,461050 +gevent/resolver/cares.pyx,sha256=G581qVmtMs5fNOS25Ue2U-Y8xqpVxiMO_4SqcEZakHg,16578 +gevent/resolver/cares_ntop.h,sha256=-YEPNUD3Ibx3hv6_II1iQ-nVOVsxbcG4gBLrnjTaUyI,148 +gevent/resolver/cares_pton.h,sha256=nfvWc----WPHJSyMHtAsB6yJWStxg2YdYwQMNDQMcuw,217 +gevent/resolver/dnshelper.c,sha256=wruRYzUEK9NK3txHOVeKbjBtTeMTgDhTEGRcRzOoRmY,4033 +gevent/resolver/dnspython.py,sha256=TpXTzmAZAlc6IpXUqv8VK9HfFB98vtINtOZUc8CUqOs,25168 +gevent/resolver/libcares.pxd,sha256=rwX-IiuFFBUEq2ESZ7GIEwqWDjZx7PfXSfupwOOVcAc,2770 +gevent/resolver/thread.py,sha256=lNlqGlEZfL0SViJx6Ow_S7EL1CNcUGcvWDuYyxLAR2o,2493 +gevent/resolver_ares.py,sha256=s5Jo9Z0b-zKxSWcIvW5onaFE2OrfqLuNnTPlOoxFxEQ,486 +gevent/resolver_thread.py,sha256=jcKcEVCXwyRqcsDUZmryQ9hc-83yztgaM4kuTKHOvaw,504 +gevent/select.py,sha256=x8nHoAV_2i5Poi-MTWMJZxYMouXDNUr4iWfs47P-uKs,10187 +gevent/server.py,sha256=xOgzEEle5wJ4yTfB5U-kYkRiH9B6nx20S8DCG_Nt-f0,9591 +gevent/signal.py,sha256=7uu4a7v0kGyOqauqqdtZxAVQy8IrdjWHKM6SpqAvhko,4915 +gevent/socket.py,sha256=xz-ntpsujqpXQ14lLyAnGOlW7679Quisw-r9m8HZWqQ,4870 +gevent/ssl.py,sha256=N5qr4kd8jXmKfxYOqiPBAFRV4n9FZiZHgDFetHIbc_k,1200 +gevent/subprocess.py,sha256=Bo8CCTwRJ2d08r2mmHn0IseEHMlFScZ-pJ9zyqUp8kc,68291 +gevent/testing/__init__.py,sha256=hkVMAVkgmlsjJGUlTIuAPayGGd81kpFy5LvoQ8PdqCI,3976 +gevent/testing/__pycache__/__init__.cpython-37.pyc,, +gevent/testing/__pycache__/errorhandler.cpython-37.pyc,, +gevent/testing/__pycache__/exception.cpython-37.pyc,, +gevent/testing/__pycache__/flaky.cpython-37.pyc,, +gevent/testing/__pycache__/hub.cpython-37.pyc,, +gevent/testing/__pycache__/leakcheck.cpython-37.pyc,, +gevent/testing/__pycache__/modules.cpython-37.pyc,, +gevent/testing/__pycache__/monkey_test.cpython-37.pyc,, +gevent/testing/__pycache__/openfiles.cpython-37.pyc,, +gevent/testing/__pycache__/params.cpython-37.pyc,, +gevent/testing/__pycache__/patched_tests_setup.cpython-37.pyc,, +gevent/testing/__pycache__/six.cpython-37.pyc,, +gevent/testing/__pycache__/skipping.cpython-37.pyc,, +gevent/testing/__pycache__/sockets.cpython-37.pyc,, +gevent/testing/__pycache__/switching.cpython-37.pyc,, +gevent/testing/__pycache__/sysinfo.cpython-37.pyc,, +gevent/testing/__pycache__/testcase.cpython-37.pyc,, +gevent/testing/__pycache__/testrunner.cpython-37.pyc,, +gevent/testing/__pycache__/timing.cpython-37.pyc,, +gevent/testing/__pycache__/util.cpython-37.pyc,, +gevent/testing/coveragesite/__pycache__/sitecustomize.cpython-37.pyc,, +gevent/testing/coveragesite/sitecustomize.py,sha256=GSOkHhxLE_pjOHuUn4InKmmuLyIGSIumySFVVSmc4Vo,558 +gevent/testing/errorhandler.py,sha256=0S16ylXH_epEJBV9jZ4Ukd8-zlFdeb0FCv8eJyo0g8Q,2015 +gevent/testing/exception.py,sha256=yQHF9Ebom2JAKUq70mLsdFk9p4eorpK36O-3iH1LL1Q,1265 +gevent/testing/flaky.py,sha256=x-IujIZGK_m2FYRyi4RxKMZhLfxq25p47En4DAlYhCs,4104 +gevent/testing/hub.py,sha256=tH0vKcSW_C5vqcPr4cdf-ucKQ5YjcP4kHFG8T1VDfSc,1568 +gevent/testing/leakcheck.py,sha256=CyxY7HiZW_kxpVgztdX_hYIZhgrAwMxTm-7xlt_nwNo,7013 +gevent/testing/modules.py,sha256=YszQZAglfns-HabYDWmFjoDRX5Oxhh67DRaMU4z5gQY,3182 +gevent/testing/monkey_test.py,sha256=QFHQgmxlTE8RVzakU4QZ5yaaamYrvCLAGKO1leNM_Fw,2432 +gevent/testing/openfiles.py,sha256=TYorMzGRNQD4lznfDU0NNyxiEMsF_h6t5CqKO9DApU0,4869 +gevent/testing/params.py,sha256=NP8muVgzgVrC9wudC7gQTYTJpllKG3GQVpQI-UL-iig,3033 +gevent/testing/patched_tests_setup.py,sha256=TwxLVQBaLT8OekKkaQrY5KpIm3AFMY3eBG9vNJTu_zk,49460 +gevent/testing/six.py,sha256=uOHGN3XiRVQViBTFgaTac8nBy5azRODOFWvkcQVbtdA,1004 +gevent/testing/skipping.py,sha256=R1EzxSRTnOaKlr7jBaVxue5v0CnCTmTuHBh-NHwIVl0,3668 +gevent/testing/sockets.py,sha256=dMxbn7khWbBWqDwjEZithklFCK2yphiwgJOliYZvxRI,1914 +gevent/testing/switching.py,sha256=6idIaCiHKFZF8aibeHjxIdZi38cxXCKuhQRHUT1YWoo,2708 +gevent/testing/sysinfo.py,sha256=0LOpveTMOw2mv3cLQwLXRTpaAQ4jEXrpFA3O9s_oPWQ,4184 +gevent/testing/testcase.py,sha256=0GJFaSjK1Pr-QZn5M9q5SdFP1MXzlQ70v751N46ZNOY,12783 +gevent/testing/testrunner.py,sha256=hEG_r9VXTlxqgkB91PMHpC1u5s1ppzOmSrrIrFXl3nE,16385 +gevent/testing/timing.py,sha256=mhsdL-_Q0UMQyVjrIQGNlHphaw0Z_TBrB5hvzRUyxxk,4949 +gevent/testing/util.py,sha256=CehaaTcFyUUyJbDK5Rqs8hcn1lGfwF7C7Ep7xB8TbSg,12915 +gevent/tests/2_7_keycert.pem,sha256=xPXi5idPcQVbrhgxBqF2TNGm6sSZ2aLVVEt6DWzplL8,1783 +gevent/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +gevent/tests/__main__.py,sha256=EMw-OppCjl-heu15mLg-cf400NS1Ikuy96OisvLoKLM,179 +gevent/tests/__pycache__/__init__.cpython-37.pyc,, +gevent/tests/__pycache__/__main__.cpython-37.pyc,, +gevent/tests/__pycache__/_blocks_at_top_level.cpython-37.pyc,, +gevent/tests/__pycache__/_import_import_patch.cpython-37.pyc,, +gevent/tests/__pycache__/_import_patch.cpython-37.pyc,, +gevent/tests/__pycache__/_import_wait.cpython-37.pyc,, +gevent/tests/__pycache__/_imports_at_top_level.cpython-37.pyc,, +gevent/tests/__pycache__/_imports_imports_at_top_level.cpython-37.pyc,, +gevent/tests/__pycache__/getaddrinfo_module.cpython-37.pyc,, +gevent/tests/__pycache__/known_failures.cpython-37.pyc,, +gevent/tests/__pycache__/lock_tests.cpython-37.pyc,, +gevent/tests/__pycache__/test__GreenletExit.cpython-37.pyc,, +gevent/tests/__pycache__/test___config.cpython-37.pyc,, +gevent/tests/__pycache__/test___example_servers.cpython-37.pyc,, +gevent/tests/__pycache__/test___ident.cpython-37.pyc,, +gevent/tests/__pycache__/test___monitor.cpython-37.pyc,, +gevent/tests/__pycache__/test___monkey_patching.cpython-37.pyc,, +gevent/tests/__pycache__/test__all__.cpython-37.pyc,, +gevent/tests/__pycache__/test__api.cpython-37.pyc,, +gevent/tests/__pycache__/test__api_timeout.cpython-37.pyc,, +gevent/tests/__pycache__/test__ares_host_result.cpython-37.pyc,, +gevent/tests/__pycache__/test__ares_timeout.cpython-37.pyc,, +gevent/tests/__pycache__/test__backdoor.cpython-37.pyc,, +gevent/tests/__pycache__/test__close_backend_fd.cpython-37.pyc,, +gevent/tests/__pycache__/test__compat.cpython-37.pyc,, +gevent/tests/__pycache__/test__core.cpython-37.pyc,, +gevent/tests/__pycache__/test__core_async.cpython-37.pyc,, +gevent/tests/__pycache__/test__core_callback.cpython-37.pyc,, +gevent/tests/__pycache__/test__core_fork.cpython-37.pyc,, +gevent/tests/__pycache__/test__core_loop_run.cpython-37.pyc,, +gevent/tests/__pycache__/test__core_loop_run_sig_mod.cpython-37.pyc,, +gevent/tests/__pycache__/test__core_stat.cpython-37.pyc,, +gevent/tests/__pycache__/test__core_timer.cpython-37.pyc,, +gevent/tests/__pycache__/test__core_watcher.cpython-37.pyc,, +gevent/tests/__pycache__/test__destroy.cpython-37.pyc,, +gevent/tests/__pycache__/test__destroy_default_loop.cpython-37.pyc,, +gevent/tests/__pycache__/test__doctests.cpython-37.pyc,, +gevent/tests/__pycache__/test__environ.cpython-37.pyc,, +gevent/tests/__pycache__/test__event.cpython-37.pyc,, +gevent/tests/__pycache__/test__events.cpython-37.pyc,, +gevent/tests/__pycache__/test__example_echoserver.cpython-37.pyc,, +gevent/tests/__pycache__/test__example_portforwarder.cpython-37.pyc,, +gevent/tests/__pycache__/test__example_udp_client.cpython-37.pyc,, +gevent/tests/__pycache__/test__example_udp_server.cpython-37.pyc,, +gevent/tests/__pycache__/test__examples.cpython-37.pyc,, +gevent/tests/__pycache__/test__exc_info.cpython-37.pyc,, +gevent/tests/__pycache__/test__execmodules.cpython-37.pyc,, +gevent/tests/__pycache__/test__fileobject.cpython-37.pyc,, +gevent/tests/__pycache__/test__getaddrinfo_import.cpython-37.pyc,, +gevent/tests/__pycache__/test__greenio.cpython-37.pyc,, +gevent/tests/__pycache__/test__greenlet.cpython-37.pyc,, +gevent/tests/__pycache__/test__greenletset.cpython-37.pyc,, +gevent/tests/__pycache__/test__greenness.cpython-37.pyc,, +gevent/tests/__pycache__/test__hub.cpython-37.pyc,, +gevent/tests/__pycache__/test__hub_join.cpython-37.pyc,, +gevent/tests/__pycache__/test__hub_join_timeout.cpython-37.pyc,, +gevent/tests/__pycache__/test__import_blocking_in_greenlet.cpython-37.pyc,, +gevent/tests/__pycache__/test__import_wait.cpython-37.pyc,, +gevent/tests/__pycache__/test__issue112.cpython-37.pyc,, +gevent/tests/__pycache__/test__issue230.cpython-37.pyc,, +gevent/tests/__pycache__/test__issue330.cpython-37.pyc,, +gevent/tests/__pycache__/test__issue467.cpython-37.pyc,, +gevent/tests/__pycache__/test__issue6.cpython-37.pyc,, +gevent/tests/__pycache__/test__issue600.cpython-37.pyc,, +gevent/tests/__pycache__/test__issue607.cpython-37.pyc,, +gevent/tests/__pycache__/test__issue639.cpython-37.pyc,, +gevent/tests/__pycache__/test__issue_728.cpython-37.pyc,, +gevent/tests/__pycache__/test__issues461_471.cpython-37.pyc,, +gevent/tests/__pycache__/test__iwait.cpython-37.pyc,, +gevent/tests/__pycache__/test__joinall.cpython-37.pyc,, +gevent/tests/__pycache__/test__local.cpython-37.pyc,, +gevent/tests/__pycache__/test__loop_callback.cpython-37.pyc,, +gevent/tests/__pycache__/test__makefile_ref.cpython-37.pyc,, +gevent/tests/__pycache__/test__memleak.cpython-37.pyc,, +gevent/tests/__pycache__/test__monkey.cpython-37.pyc,, +gevent/tests/__pycache__/test__monkey_builtins_future.cpython-37.pyc,, +gevent/tests/__pycache__/test__monkey_hub_in_thread.cpython-37.pyc,, +gevent/tests/__pycache__/test__monkey_logging.cpython-37.pyc,, +gevent/tests/__pycache__/test__monkey_multiple_imports.cpython-37.pyc,, +gevent/tests/__pycache__/test__monkey_queue.cpython-37.pyc,, +gevent/tests/__pycache__/test__monkey_scope.cpython-37.pyc,, +gevent/tests/__pycache__/test__monkey_selectors.cpython-37.pyc,, +gevent/tests/__pycache__/test__monkey_sigchld.cpython-37.pyc,, +gevent/tests/__pycache__/test__monkey_sigchld_2.cpython-37.pyc,, +gevent/tests/__pycache__/test__monkey_sigchld_3.cpython-37.pyc,, +gevent/tests/__pycache__/test__monkey_ssl_warning.cpython-37.pyc,, +gevent/tests/__pycache__/test__monkey_ssl_warning2.cpython-37.pyc,, +gevent/tests/__pycache__/test__monkey_ssl_warning3.cpython-37.pyc,, +gevent/tests/__pycache__/test__nondefaultloop.cpython-37.pyc,, +gevent/tests/__pycache__/test__order.cpython-37.pyc,, +gevent/tests/__pycache__/test__os.cpython-37.pyc,, +gevent/tests/__pycache__/test__pool.cpython-37.pyc,, +gevent/tests/__pycache__/test__pywsgi.cpython-37.pyc,, +gevent/tests/__pycache__/test__queue.cpython-37.pyc,, +gevent/tests/__pycache__/test__real_greenlet.cpython-37.pyc,, +gevent/tests/__pycache__/test__refcount.cpython-37.pyc,, +gevent/tests/__pycache__/test__refcount_core.cpython-37.pyc,, +gevent/tests/__pycache__/test__select.cpython-37.pyc,, +gevent/tests/__pycache__/test__semaphore.cpython-37.pyc,, +gevent/tests/__pycache__/test__server.cpython-37.pyc,, +gevent/tests/__pycache__/test__server_pywsgi.cpython-37.pyc,, +gevent/tests/__pycache__/test__signal.cpython-37.pyc,, +gevent/tests/__pycache__/test__sleep0.cpython-37.pyc,, +gevent/tests/__pycache__/test__socket.cpython-37.pyc,, +gevent/tests/__pycache__/test__socket_close.cpython-37.pyc,, +gevent/tests/__pycache__/test__socket_dns.cpython-37.pyc,, +gevent/tests/__pycache__/test__socket_dns6.cpython-37.pyc,, +gevent/tests/__pycache__/test__socket_errors.cpython-37.pyc,, +gevent/tests/__pycache__/test__socket_ex.cpython-37.pyc,, +gevent/tests/__pycache__/test__socket_send_memoryview.cpython-37.pyc,, +gevent/tests/__pycache__/test__socket_ssl.cpython-37.pyc,, +gevent/tests/__pycache__/test__socket_timeout.cpython-37.pyc,, +gevent/tests/__pycache__/test__socketpair.cpython-37.pyc,, +gevent/tests/__pycache__/test__ssl.cpython-37.pyc,, +gevent/tests/__pycache__/test__subprocess.cpython-37.pyc,, +gevent/tests/__pycache__/test__subprocess_interrupted.cpython-37.pyc,, +gevent/tests/__pycache__/test__subprocess_poll.cpython-37.pyc,, +gevent/tests/__pycache__/test__systemerror.cpython-37.pyc,, +gevent/tests/__pycache__/test__threading.cpython-37.pyc,, +gevent/tests/__pycache__/test__threading_2.cpython-37.pyc,, +gevent/tests/__pycache__/test__threading_before_monkey.cpython-37.pyc,, +gevent/tests/__pycache__/test__threading_holding_lock_while_monkey.cpython-37.pyc,, +gevent/tests/__pycache__/test__threading_monkey_in_thread.cpython-37.pyc,, +gevent/tests/__pycache__/test__threading_native_before_monkey.cpython-37.pyc,, +gevent/tests/__pycache__/test__threading_patched_local.cpython-37.pyc,, +gevent/tests/__pycache__/test__threading_vs_settrace.cpython-37.pyc,, +gevent/tests/__pycache__/test__threadpool.cpython-37.pyc,, +gevent/tests/__pycache__/test__threadpool_executor_patched.cpython-37.pyc,, +gevent/tests/__pycache__/test__timeout.cpython-37.pyc,, +gevent/tests/__pycache__/test__util.cpython-37.pyc,, +gevent/tests/_blocks_at_top_level.py,sha256=Hp36RFiC0djMSfvUHZsu8pVttpc7Hbmv_7VGq6xW630,48 +gevent/tests/_import_import_patch.py,sha256=IbgraY7KaPggcX1JNVkUQTTBSboegF_VWSDFJp38buI,28 +gevent/tests/_import_patch.py,sha256=_PWRiLjpsFyhT2CxTDIE9ZVS9gcCFqzQGFKel00zc2s,47 +gevent/tests/_import_wait.py,sha256=8353o30STWbRg53op9CWmTXfElU6VV4klLdqiq7Jmjg,570 +gevent/tests/_imports_at_top_level.py,sha256=9SCo81uRMT8xWbDFUBhbc_EwAoii9oygwOBSSNWfWWI,55 +gevent/tests/_imports_imports_at_top_level.py,sha256=VcIaDELcdgeEMqO_Cndy0XMjx05h5eG4_F_12giOSDs,345 +gevent/tests/badcert.pem,sha256=JioQeRZkHH8hGsWJjAF3U1zQvcWqhyzG6IOEJpTY9SE,1928 +gevent/tests/badkey.pem,sha256=gaBK9px_gG7DmrLKxfD6f6i-toAmARBTVfs-YGFRQF0,2162 +gevent/tests/getaddrinfo_module.py,sha256=oFyeNRywc3QO5HlpuV5DVcpUbml8hFn86pbWm_mGQX8,116 +gevent/tests/hosts_file.txt,sha256=07jEX3FicSKuiUJbQ_14H0MP8v7r35h_usGUmScPnSM,290909 +gevent/tests/https_svn_python_org_root.pem,sha256=wOB3Onnc62Iu9kEFd8GcHhd_suucYjpJNA3jyfHeJWA,2569 +gevent/tests/keycert.pem,sha256=r0KE1WH9eV6X4mUykpCY5Dm8_robBSi4zwMcGBPtMi4,1872 +gevent/tests/known_failures.py,sha256=Z_1njrvmPuHBgQdMlkUeem6Io6-h3AwuRJM5X7sfIl8,16153 +gevent/tests/lock_tests.py,sha256=FAHkMkAQSAofnKSYo4Q1yUz5DnMmXURfhp-zMbFzQUs,21861 +gevent/tests/monkey_package/__main__.py,sha256=uXMcIdKy25HEJtowa4Xd-uwrXQK-ca15TZ9knYMtwFc,180 +gevent/tests/monkey_package/__pycache__/__main__.cpython-37.pyc,, +gevent/tests/monkey_package/__pycache__/issue302monkey.cpython-37.pyc,, +gevent/tests/monkey_package/__pycache__/script.cpython-37.pyc,, +gevent/tests/monkey_package/issue302monkey.py,sha256=DMdW7B0MVcpTMKk94hW4kxqBzbBXFs4QQBwsFN844dQ,1095 +gevent/tests/monkey_package/script.py,sha256=2bXmWybFAoMYldTLN41r9eqnsCVK1QXnaEcl1EeQstc,391 +gevent/tests/nullcert.pem,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +gevent/tests/server.crt,sha256=B4Oj77EfnNyQIPmD9UxB_0QZuUT5evuDcGhSvx9ClRk,887 +gevent/tests/server.key,sha256=ZtnbGm6-aP6CTTJPoBv1QoIEz6SgeOfgHKuWTJ4cxhQ,891 +gevent/tests/sha256.pem,sha256=trYsA7FY0hyVoV1AoGNwZ_s6T89eiiOIFexoNRv029s,2065 +gevent/tests/test__GreenletExit.py,sha256=qHtC7KnjCG039F_VGDXnsrhyWaQXvfcmgnVB2Rfa_Vk,127 +gevent/tests/test___config.py,sha256=b-Aj8uJnuqYUFkM5BNZLp_coMjBS2GZnMgKh4r-rfCs,4817 +gevent/tests/test___example_servers.py,sha256=Wi13Mlr3jFX3Lb7Wo3L4I5Z5VJ5ABU0Tma-T8mFP830,4741 +gevent/tests/test___ident.py,sha256=gZk0QW6gQy8_ZhB_mNwCSqno7P7N4ItkWs8U3DZfogU,2101 +gevent/tests/test___monitor.py,sha256=HhzValkaHYp-y0QzhzDzMYU4ZoSWiWfsCHsIqo8QeLU,12573 +gevent/tests/test___monkey_patching.py,sha256=5VD3iRMovke9RUgI16nXAtXNgnFMQO_-dDp1HKmNEco,3659 +gevent/tests/test__all__.py,sha256=HBRkZEDjChGPleSuNzUV9Zxs6aMMLphDaHJ3xTIhXx4,8964 +gevent/tests/test__api.py,sha256=zJF6cfQKnPscZio9ErpkY2Mn2NNPOzNnzX4J8ujx4ww,4550 +gevent/tests/test__api_timeout.py,sha256=j2P5BHLGkLTvYg-NzcE90-gxXGzc6wxoomF43C05Bxg,6307 +gevent/tests/test__ares_host_result.py,sha256=OXQIzDgE-rz3Bj-_s6PjbicMGaPqnAPmtSa3wWzk6iI,873 +gevent/tests/test__ares_timeout.py,sha256=7plIQnTiPeoWkF-yHxbuqAe6ohKsMJP4ZUGgW3yzfTY,1257 +gevent/tests/test__backdoor.py,sha256=_pHAgWh4w34KkEwPa46FF7sb6Xn81sUonJyuSjBXcgI,4193 +gevent/tests/test__close_backend_fd.py,sha256=K7ZbNpu9Xj1aF1jHHDmPr0iHzdIQje8yFsFWfzZyguE,1964 +gevent/tests/test__compat.py,sha256=YBE4IJwtRozcCRqeZXY9dkxqjZ6m2xS0Pk1ceApjvnE,1439 +gevent/tests/test__core.py,sha256=0-JaW0m9zRvFESvya34Saomy62-__KTKpfsvQJRBvZw,5668 +gevent/tests/test__core_async.py,sha256=vySo8IqVpKPhd_ljN_cEmxV_ng5ORxKBzJY-Gy-7tL4,547 +gevent/tests/test__core_callback.py,sha256=1zjZvKOavnYIzXiJpgtn0JjTSpwXA2Syx5U1OueEN54,471 +gevent/tests/test__core_fork.py,sha256=DNq33dpct7xiD6A_M1atR2L9wi27y-KCwcoy5hCt-ms,1830 +gevent/tests/test__core_loop_run.py,sha256=Yi1xKGcqGWaBVeu54XGDWISFklYXIc7r2d-Xgz71gsU,668 +gevent/tests/test__core_loop_run_sig_mod.py,sha256=qaD4Q7Z0UXU_pevsXMjaylPoABFc-rfNToXi36ygIEE,597 +gevent/tests/test__core_stat.py,sha256=YvqLSe-9j5tIFC6MoPQhD5_0MdBtxrbVagp4o0jzpw8,3754 +gevent/tests/test__core_timer.py,sha256=e6VG-IHLiQ3OkrTOYGiLMX4VdU6RLG3UoA69uao2xG8,4330 +gevent/tests/test__core_watcher.py,sha256=ULftUAJqrMLYgzItmSzEosgeagKbI72m0oheKn14vYo,3573 +gevent/tests/test__destroy.py,sha256=UjbbX-16T0Kjpb2Y0IHhnE7n3-6PD18eKTxdFCHlBaM,1682 +gevent/tests/test__destroy_default_loop.py,sha256=JAja9tOyflLkKonpJW4TDmHHKVOnnSMx95_OxnfEkwA,1657 +gevent/tests/test__doctests.py,sha256=aZqNLQDOpyvFYkhmqgXyDRhtV3CnN50H4OnZkp0vC0E,3613 +gevent/tests/test__environ.py,sha256=FHBRtFqtDQbDU4qBBb5XHGRDd7Myh6wj4KJFVqmB2lg,520 +gevent/tests/test__event.py,sha256=QHboAng3_0tuw_AnyCQFIHFnGs3LgaV70Gz4cEqk6ek,7511 +gevent/tests/test__events.py,sha256=8yEdTm-oZdWvODHhIACN_ZOZQCH-oqZ_yDGbuAR_wQk,1268 +gevent/tests/test__example_echoserver.py,sha256=uS8U1qV3wV_9zK40ZMP41dplVgC1RruSrgGr0gzK5vI,1197 +gevent/tests/test__example_portforwarder.py,sha256=AgA1rWRkrkt4Jz4D6hxFLR109Ca18-Q5Bl3PssKgZ3U,2030 +gevent/tests/test__example_udp_client.py,sha256=42k_6BAWaIsy876GUJJI48SJJCGPtBnBoeAStSQPX38,786 +gevent/tests/test__example_udp_server.py,sha256=HKE94iVWq-qs-K5ROcIIOkZETGVWU1erPOE_dinvz_0,512 +gevent/tests/test__examples.py,sha256=bKo_UR91wK3iGbh4z6TP3du0OfKgpDnj7ku0-RTzcOo,2246 +gevent/tests/test__exc_info.py,sha256=23iWivgGUbroxrgJ9r1Be2NDiv8E4zEVUB9tnOPI9WI,1381 +gevent/tests/test__execmodules.py,sha256=1D-P4MmCOldJf-Dc-dVKrJgDnDj2km0MGPlqV6IMZjI,871 +gevent/tests/test__fileobject.py,sha256=1UTOw0-pTgKEDmyCAbPANiQRWFtuF0KH294m9QlhGqI,8682 +gevent/tests/test__getaddrinfo_import.py,sha256=Z4rjp1EFnUQin20Qxg_w7m1Fkkn21LuKTPzvUPoPIqg,334 +gevent/tests/test__greenio.py,sha256=ar48aU9uSrfFsPslpeE6Q19SPSs8_u9Hdr-RVrM2Mr4,4559 +gevent/tests/test__greenlet.py,sha256=uesiAG-p2b5LKNbkVwBhR2ioF6MjpluMlAolC7eYTHA,25050 +gevent/tests/test__greenletset.py,sha256=6jGMzRbFGNdLmub8-eVIw9iOZfEQ0GaXdqvzbNxvpEE,4490 +gevent/tests/test__greenness.py,sha256=4iiDkwZmagF_7cxqUKBL1LnERP-h8AnPH96YVA6Lt7s,2605 +gevent/tests/test__hub.py,sha256=ktpNQLmZFs2Ncx0MFtRbXU3nIRleMyeRHKClemm7oho,11233 +gevent/tests/test__hub_join.py,sha256=hVk84a1yZ6liO2ovSlunzwC4fPJ8cZAk0wvOoxui1f8,485 +gevent/tests/test__hub_join_timeout.py,sha256=D7_mRFIRY-yPrxa8YbCLtSH75PfLjRePy069yJgZRF4,2905 +gevent/tests/test__import_blocking_in_greenlet.py,sha256=TnqXgCo-JsrpoWuIDXbdn555kuXSj4fdSGRGoXZJr3w,431 +gevent/tests/test__import_wait.py,sha256=cEy4415W-meuNeXm6s8b1meXtvrmSj7nieOV8hNvgYY,143 +gevent/tests/test__issue112.py,sha256=kqropEsaNonQ70O6nHGZCGUoueLdB6LgRB73a4SZyqU,370 +gevent/tests/test__issue230.py,sha256=wqiwH_D2Qt1A2CJ_tWZAv50p5AoMis_ZRhEE1Qz58Vk,392 +gevent/tests/test__issue330.py,sha256=KlMXB1G1rvRqN5PzsJPs3YKwAsxPps52_9MoUtoMXNc,2259 +gevent/tests/test__issue467.py,sha256=q02FmOgt9IA1zBE6dqCsKs1AxeJ2_-s62SiNIyZXev8,948 +gevent/tests/test__issue6.py,sha256=_VDF4xiqM1HJev4wAUIaD3ELVG4HlnTWowpbdbwqXWc,1350 +gevent/tests/test__issue600.py,sha256=LhkXP-F1cdczD1oFlJbeGUegOLHGWOg9IVJN9XfEgRE,1306 +gevent/tests/test__issue607.py,sha256=uGWlqsn9ySDg40WXrpoRBJXoDDSzK5yDpcl7I6frc2o,1080 +gevent/tests/test__issue639.py,sha256=ZeDfYeBgB4FxgGsm9RPSoNnjlcvf_eThUMlut-5Y5GI,55 +gevent/tests/test__issue_728.py,sha256=1u6WSToRxMYe70aLU5vMhrWSZ_OHtwN9oP6L4UXXywg,212 +gevent/tests/test__issues461_471.py,sha256=q6B4wAl5nbrrOxFNoKTzcp1hc4Z-etD042p8t0NQidQ,3576 +gevent/tests/test__iwait.py,sha256=uzef1gKSo8dDbciyjZobklIXNDdc-B0ehEKb3iIn2Bg,1205 +gevent/tests/test__joinall.py,sha256=RF92Mw-qLxdrnJHE0xfuSMLuM_LfFveDsXth35j8C_M,111 +gevent/tests/test__local.py,sha256=SrkwrrprNxQspzYqDXZ7GidI0wfO7Og-vUVE4vOGeq8,11742 +gevent/tests/test__loop_callback.py,sha256=AMDWCjzrH8fr3dvMsrEFIzRMB2AjKcRq0ZfYt9fE57E,161 +gevent/tests/test__makefile_ref.py,sha256=a4wMUCY21dRsP2bDiCsOBWi1DqAxUzu5HS_hts5NSVI,17102 +gevent/tests/test__memleak.py,sha256=ijqrQ7qUwrWxdjLUKN4rtVPoTZVLv9LJphkd1GFxp8Y,1275 +gevent/tests/test__monkey.py,sha256=eT5rgqT2j3m-iobo8pSo8a7vGflYz9_saPzF7Im0DY8,5995 +gevent/tests/test__monkey_builtins_future.py,sha256=ZUJj7wWz9jEa9vDPSdEPrjqewiUwBspmtgh7RN8LymA,521 +gevent/tests/test__monkey_hub_in_thread.py,sha256=iMWv4a8Agy_llZypYxXo62kSB7LLTdNG5u9N_eHKIg8,520 +gevent/tests/test__monkey_logging.py,sha256=6uqY5n7TfzyVaiIFSBnSkW0OluQgcuFu2u7k9PC9q-w,1121 +gevent/tests/test__monkey_multiple_imports.py,sha256=QwmJJ4r3RXOQhti_5vj3Let0zllXzq4GwDY8NqzJUuQ,296 +gevent/tests/test__monkey_queue.py,sha256=jXMUF1DYdbSvwoFvReQFH86f0GfnTMrUNkP-R_eqels,12335 +gevent/tests/test__monkey_scope.py,sha256=JhgnSgGBvNYka-dqP9m9kLMLVEA8JZ2qZ7L1w95kzHM,1770 +gevent/tests/test__monkey_selectors.py,sha256=Oca3HpplLS9r6jSfFvM0E-NVoZEO4Zxeg-eQaD848iY,599 +gevent/tests/test__monkey_sigchld.py,sha256=f9o9x5LjUie6L2Z4n8keUPB1VlzsF7lX0DJOTQnn_FI,2103 +gevent/tests/test__monkey_sigchld_2.py,sha256=scXDckYto7VYr4oTPYpvMgcfL5AOavVpOtdKA2jMxEM,1580 +gevent/tests/test__monkey_sigchld_3.py,sha256=TKc67r-c7u6jG3QVN_KDPy01PYrQQkRimnH0bcPAeU8,1471 +gevent/tests/test__monkey_ssl_warning.py,sha256=-UkFSgrOLE_jmmeIOqs_sFIJ-LSVmvuXZKjN7r1W_nY,1022 +gevent/tests/test__monkey_ssl_warning2.py,sha256=NRlZ8-s-doOC6xNkQbaiVPIaqOtFBfEmQzyrKsUukww,1255 +gevent/tests/test__monkey_ssl_warning3.py,sha256=WZEOHQoewYAuYJu0f8UMjpmRzaR0B-sf0wBhvaRKTEQ,1330 +gevent/tests/test__nondefaultloop.py,sha256=Y3IrgT8SF3SmO3A1IlvC0nF4GCqxzvKES0KqvO72crE,204 +gevent/tests/test__order.py,sha256=iI8wh316sNia20IkHx7wSnE_LKdCsse6Q89xVkQev1U,1125 +gevent/tests/test__os.py,sha256=zoRh5Z5138wSU_sWgncYbSXSfr-v7HzqJ7MBnfdXUSc,5827 +gevent/tests/test__pool.py,sha256=33weK0xDFzH_-_PWrrBj-iIwxkAbpGDoMEZFUd07D3Q,17926 +gevent/tests/test__pywsgi.py,sha256=gtMSayFtxMuiMmwzWFpMQEBReYdIXVXhbCmqxAfzKDY,64069 +gevent/tests/test__queue.py,sha256=HTQVGLSkJYYesHqOSBq20DLb1ibzykCYVK-i6-NM9S8,12918 +gevent/tests/test__real_greenlet.py,sha256=58odp7leEc7C-CBIE_8Fposz8qS3y2nZp-DrPAuVo7E,464 +gevent/tests/test__refcount.py,sha256=Di1TWn7evn9elIiLtKjvq4g0Aeat0N0QCFZPmeGHzz8,5099 +gevent/tests/test__refcount_core.py,sha256=MaDRNKzNoDoCPFTZuHMpehszx7eMxUw83uTzjKIJZJI,509 +gevent/tests/test__select.py,sha256=kefxR5a1oKULgsNKb1NDnqRwpycL5swCcUUCtw0pIHI,3843 +gevent/tests/test__semaphore.py,sha256=bjRsbb7iHO_CRUcJOf8NOkwArvepyIeY2OPWueT3gFU,2542 +gevent/tests/test__server.py,sha256=Wrqz_M1--WYRobmtKFv5Py-uppvXJJIqLHIXvf1IvAg,16756 +gevent/tests/test__server_pywsgi.py,sha256=NI0mP2XbtsmCEfPj3OwKnzIpWruf15QCukCGnY5O4n0,2919 +gevent/tests/test__signal.py,sha256=aruabTlycpxjUwORKfB4JUS029dU9Wq8GsYWNFmicjU,4923 +gevent/tests/test__sleep0.py,sha256=uoruOPjsaPk1m0thN_4UppH4kW4k9fHQXDuLXnc3u5k,139 +gevent/tests/test__socket.py,sha256=Eb34BqW7dvSjkX-9UckAFuW7vxSPQ2ly0z4Jpp5wQhE,14704 +gevent/tests/test__socket_close.py,sha256=z-ecsccygna2cczb0SDkbwwee0f6JziWRvssm_PxHJI,1807 +gevent/tests/test__socket_dns.py,sha256=U8x2L4qxzfdglLrr0qNEpalShr7koEslvRbyMR_w0S4,24226 +gevent/tests/test__socket_dns6.py,sha256=trqgbuh3uGZoFNEcU5TtakLJeXQIpA9w-OtgLmSX5TI,2453 +gevent/tests/test__socket_errors.py,sha256=AnMt04cPU4iQjIYet_CyLttK1FO7t6mMPXk8QWmjXPs,1718 +gevent/tests/test__socket_ex.py,sha256=gOL_NKAVHf4WTsdDOv8KPDYMqiyu9XOtxMtYLbBpx08,1128 +gevent/tests/test__socket_send_memoryview.py,sha256=_C_8FbQhmCUi8pCqTYh0tSeTMy5K6JHptS8NqWkYtNc,886 +gevent/tests/test__socket_ssl.py,sha256=aS6ACvSO6K30qHwhSFXBXyIkg6RZ9-YFbpd-uunDQMo,828 +gevent/tests/test__socket_timeout.py,sha256=fJh7XqjJGlol-Lkr7echpJqD7pQBGUaLd5RO6APVf-M,1407 +gevent/tests/test__socketpair.py,sha256=mhxBAxWxWSnse0_NfEfA3_Cfh07V2tOkX4ygCMfhKJQ,851 +gevent/tests/test__ssl.py,sha256=e7iSoq07_lAkz8-UOPsW_v5wHyatGCNiSJQas_t7eGs,4070 +gevent/tests/test__subprocess.py,sha256=QVLlWF4zsUfonzQf1CYWPfQrAV3HD3URXk-1dhqFe84,18984 +gevent/tests/test__subprocess_interrupted.py,sha256=Blz-qIHuXGdSpI9D__zNn0WEcjUwSbaEhN7c_ikZ9_M,790 +gevent/tests/test__subprocess_poll.py,sha256=Y7CYIeryaY-WVXN9fGUhLDLqzq1KrSQKGdfUF1Ry0SQ,179 +gevent/tests/test__systemerror.py,sha256=SFKdXD3MbGhHnp6jwAOeaOFvrhLuoXmv0o3I7NL6NCk,3184 +gevent/tests/test__threading.py,sha256=s8nR6ik-dEkzR_3Nb2nftPfEW7M9pJVArqB0xPEaTJU,1443 +gevent/tests/test__threading_2.py,sha256=lbmU3HWtTCzWMVaGJI_mzwYJ3PBvUiU9JtIxsXJgz7k,22811 +gevent/tests/test__threading_before_monkey.py,sha256=Z-bNhXH218tp6vFFwqGmdL2EnSR26ydp9MZh9tH1zY4,675 +gevent/tests/test__threading_holding_lock_while_monkey.py,sha256=OnttJRH3ukPydDLll5KThIOEiBV1MkucUGIdO4eHDMA,337 +gevent/tests/test__threading_monkey_in_thread.py,sha256=jRbwWX-SA95tIoxITU4Yq83kRGO3Z8ZfDI5YVcrN004,2393 +gevent/tests/test__threading_native_before_monkey.py,sha256=qQe7WMSc_KCWhejfq-Hfa4Yv4Gb0vRP0F0c05GD9RQ0,1661 +gevent/tests/test__threading_patched_local.py,sha256=sXtfMuPgAEF5gl646OM-MELvQX3MZACtyU54ClWAku8,523 +gevent/tests/test__threading_vs_settrace.py,sha256=2iiHS0DWnHJ0gSLvVLcaKxoF-SofUEs_7exrSecDfr0,5051 +gevent/tests/test__threadpool.py,sha256=chJVc6BDfJ24MkKDTkwd-aFE-VrSDHdm2pmsZPkk6d8,19480 +gevent/tests/test__threadpool_executor_patched.py,sha256=UMJlfgDDCykK9gc-mC8w3JjeLJsk_k7DGoBfBKhb_Co,379 +gevent/tests/test__timeout.py,sha256=uRjOchrp6NVrjkxrCW9UMd6r5iheRe8EjzpW5XDD7Bg,5243 +gevent/tests/test__util.py,sha256=lA-L0D3a0IcefEwJm0E1qRxrvJ3kkKxBjwJfnr0t8v4,10149 +gevent/tests/test_server.crt,sha256=B4Oj77EfnNyQIPmD9UxB_0QZuUT5evuDcGhSvx9ClRk,887 +gevent/tests/test_server.key,sha256=ZtnbGm6-aP6CTTJPoBv1QoIEz6SgeOfgHKuWTJ4cxhQ,891 +gevent/tests/tests_that_dont_do_leakchecks.txt,sha256=hqT3OFiGvKj8V8jugeRR42mLIZ9tS8xHRQK5sS4sYR8,204 +gevent/tests/tests_that_dont_monkeypatch.txt,sha256=DeqqzP8rEzNtssCO1OPDwLJSyb3JSkQuEI9cAkpnATI,568 +gevent/tests/tests_that_dont_use_resolver.txt,sha256=vE3Mhrrtx_N7WB1_fxT9dySMRiAO3eMH5LNhuWol84A,3171 +gevent/tests/wrongcert.pem,sha256=6n4u7wcalNKCtnMsq7J3Y7uOiez901ZLiH38oE0jGUM,1880 +gevent/thread.py,sha256=XktB9n2NaVYycKhRVoYjGwizq0kjU2ohihgSyjdQssU,3608 +gevent/threading.py,sha256=hOmCvuScgvK54WFYjbru76pg6Z1-iJkOqaDf4CgQ-AY,8634 +gevent/threadpool.py,sha256=CNnBZXQ7t67I9VMlKFzWg42d8MZkIAhXWAdMHbBsI8M,20228 +gevent/time.py,sha256=C0eRlHq0rBxy9tC_SsIywkYaBNlwO1bc04qFi2OceB4,491 +gevent/timeout.py,sha256=kURx8Rwi9__4OPbKQoB_UPHYGd_WoOsm1dz5r60h_Rc,12692 +gevent/util.py,sha256=RF24Ji8psB5ZC4r7BLUFK3cNSKSOH6NcubA4umaPxOQ,19617 +gevent/win32util.py,sha256=WBk_YNf_kk3QF3PMUdScqgM_PreF4OBhfXq2W5264n0,3637 diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent-1.4.0.dist-info/WHEEL b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent-1.4.0.dist-info/WHEEL new file mode 100644 index 00000000..5762633f --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent-1.4.0.dist-info/WHEEL @@ -0,0 +1,5 @@ +Wheel-Version: 1.0 +Generator: bdist_wheel (0.32.3) +Root-Is-Purelib: false +Tag: cp37-cp37m-win_amd64 + diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent-1.4.0.dist-info/entry_points.txt b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent-1.4.0.dist-info/entry_points.txt new file mode 100644 index 00000000..540b271a --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent-1.4.0.dist-info/entry_points.txt @@ -0,0 +1,3 @@ +[gevent.plugins.monkey.will_patch_all] +signal_os_incompat = gevent.monkey:_subscribe_signal_os + diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent-1.4.0.dist-info/top_level.txt b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent-1.4.0.dist-info/top_level.txt new file mode 100644 index 00000000..4a63abe6 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent-1.4.0.dist-info/top_level.txt @@ -0,0 +1 @@ +gevent diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/__abstract_linkable.cp37-win_amd64.pyd b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/__abstract_linkable.cp37-win_amd64.pyd new file mode 100644 index 0000000000000000000000000000000000000000..dd7cee75957c5970cd1f71452d86e482a742d293 GIT binary patch literal 71168 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

cP&>^oc5^cukLc5=BdbYX9v%p zcQ+5?+mjMFM(s0RuKtpT^zKN^pMX0k@TK3w;qaN0*gpYxM8K^R_;4FE_D{gAHQ@w4 zITi{V@tnR*0!|ZroZbUmiGbU5igwcl+=NrWtrKwj1>9*pw5tiYIsrGJ2RKQa_+HRfp4v7wq(#M1RqBPTu<~B3w$d@yFKY&r@)tX3i<69aH*$|OQmS{K0#l<9^|rG;9D#3^`tMU z0&aqU>#5&Xi~f*Kp?~)YxEul3qnrgF4guGby;>>gYZUbLq^Ax6H}@3sYct2Mkl&y# z^5Yq)g1#0(pE=K1;6m>=igvYAw7Xj1+a%!9EJPwA@Z|`68wGtm^;>-Pp3-UNytb0t zEpwh}d!MK0ZslQ4V{CcxM?B3>UJavC%(q7_%{wz4)NY`ygn5Rc}YTEUCIUi&IXP@zT9jl%JpQfAlyRo zwcrZDOFE?|3J0m)i>(SQ2cv7#J{pSR99Xr<>l>qv5Gx?GlCAj{uzg>0$hb=-Ira&; z=J9Zy2u*s;u=pp!%@uIP0?(029IuJT3@d*kT%&+%6L^Yyz_(h!<@8W)wtJs|>zv5x zS}8)a+zi+MM7T`?uA~P%Ccd3N5$>RXbDRQS_$R_07jWt+@TH1zd@8tf0oQghm!D%o z_x+ps6X7P9a2E-D0ke{t*D?M>|AlmjAyEqsAkR!|q3tSdIzUk`lTSOpA{S z8i-Vl7T@gP$6W1U=!pR)2-_s=>Bc3T{+{eZPxi3n4PI|u9HSe@@%*^#F3J5lKMihO z_D_S89I+M@?<2B)!8?U4GzrKwBXQx{_c)yTHV=zGh^=RWcgE43V;1~3{Qso{(%>MC z#gE>F$19am3x3s)@bFo@+x;W*HzFK|1zqN^0E2KO7N6CKk3qN+zqyE0_-FhcM7#~* zH~6(7PT}@}c#jS7od_r56QO@V{1SwI{HU!)gd0Sh!Yv~HD#Fi1oWcY+uLPfr(2F0n zTZ!;Kkx$_U5vTB5{D_9*2)E#U@J_^EMK~YtgYQJV1R;HYm|!S;R>U_VG(=p2<9a53 z)NVS$SMmFi@F4t$$R9Wu_vG*+mB%2w%7DJj@f(kP3d8tm1ds5*h0rU+=^w|r2){bSF*i!j#149O++;Sxq4AIe}rqF9( zKpBb@F+i?uu4!qm;ZhD4PGAI5Be58XA^eg090&jZlYt>(3SuAwgJB^^3?4dU=x{;| z89MayE>sE=M*l@a0gXhR+Iy{jQ)Uq z22arEUZH(q^)#;m-l9*+Jm`%xv@dL+uU8pEa05O4Dt`DdkF_a(V25yqo_dXA+~ip3 z-dpr7c-6;R`da_`Hs?>e)bciM2dn7sm>1cV_pj4tuzY7qiaihWU#e36fH@Uj z^^;!ptCs%NXFsGJ$s_fv1ImDZptop z3)ayTyA5Y(`4jTNtG>~ze$>*R`XctUxzsm5YtVi+}Gt+B$JkYhSsyD7#rYeym(7HhBi> z0uOy`mfkqKwO%Q)$jJicHjCTM&C>N|w{-HwCmuV&N>;Odjx~J>*zInXSWeyO;*i+h z?yk2lo!`6Ky}EO4oo7`xw!7_P`^QVHfbL$}!H?%3Pu1noWKqxFD~pZ)ILG@s$zTqq z0y1lERfg)YHS7%Q-&LK4({hxQYZm*8cE{Fi!|vOzJ+`NIX3y=MlXuEa#i^51cY2QN zjGWY&ISWT|i|(3Rb!%?N)!e=-+=)AN=kB4K_X=LcQ@w`Q@_L@(jl8ip^DXHHhEowxqs1xat5%r@*q{R8S5LaR~uE&j7i}ko4i@285lSZN?deTco;wGbH znxx4rIZTKansI%R9YYjEQK+ISYN91NLKBAQi?Nu9Ow2{j%$sGiV%E)ushd61FkN$G oj?L7ZnVGpTl|gPW9!v&{LEfrZ4XbYnYigy|%sRAW;s5{VE~YyPoB#j- literal 0 HcmV?d00001 diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/__hub_local.pxd b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/__hub_local.pxd new file mode 100644 index 00000000..e7df56f5 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/__hub_local.pxd @@ -0,0 +1,17 @@ +from gevent.__greenlet_primitives cimport SwitchOutGreenletWithLoop + +cdef _threadlocal + +cpdef get_hub_class() +cpdef SwitchOutGreenletWithLoop get_hub_if_exists() +cpdef set_hub(SwitchOutGreenletWithLoop hub) +cpdef get_loop() +cpdef set_loop(loop) + +# We can't cdef this, it won't do varargs. +# cpdef WaitOperationsGreenlet get_hub(*args, **kwargs) + +# XXX: TODO: Move the definition of TrackedRawGreenlet +# into a file that can be cython compiled so get_hub can +# return that. +cpdef SwitchOutGreenletWithLoop get_hub_noargs() diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/__hub_primitives.cp37-win_amd64.pyd b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/__hub_primitives.cp37-win_amd64.pyd new file mode 100644 index 0000000000000000000000000000000000000000..6065ffc1bf2f67beb26ddd7f1ce18749b9a6fbbb GIT binary patch literal 120832 zcmdqK349b));`<`DF|TGVJQs=(rVBsf{}=V5lutDYUwDepe&*Yf*>Mv6ciCmq84Q< zIy&x-qod-eQ?zhi+#;}K3@+0+qTcQ6u3{Jdc#*C|?!AmCvXI0DyPMr}fJAZia%BwD$)YI>8Rp5}m@#Ci-DXENa zaR2xEX~c%Uc=qjHy`H}pe4u`PyI0DyZ}*Dzr$~OS{N{YRdVL?kU%laP_+7Mn)A}>y zH!iFbH#v+$epR|@y(sla@jDGW6>8o!V&^{>?DtLZsY0g8-} z)pr;mRyKkw?Roj+sh7=mwFe#JpKo&$aI9!~<2VU8`xHOy#1o?*@_2!<{|0YSt1He!8Kye82cRjjI}qD65{eFC_No8gs< zcHCN4P+IzWR%O5U)`3E_)v^}Mo7~dpi)$;9L|zi>09sWOy*%+p)F30~--VwKqSNWr;rP4*;SlVdd6z{68xiP1>reTO( zXKI6xk{AbTl`c96P4%hl_wrh>>8j~$ihTv7GP^v4^u!&wEnT!JaX#29-cq_~V`8c> z8n~y{sx@3jO3A~;wXnan(lAE{BW7v7IRrK{axWMqMk@_l`>Y>fw(2bvfxdbT>hX=V z+e?ry*59r?n04)miP!L8?J&yEXJcC(__c*&iiRFzz5XH|5E zO^!!i@fM=^kmo&21itrh9w=AaQLWN$R&k<7t2DKU_FnSQ9#aj?i+8~vil;+43N3Lh>JRaOy3sR3A2CDywZGancq$#PD$CB|HMV}v znebj~ovojS8(S}x$GSIK=J;3#gJTT4+o?=5BdBkcU-nsc1jJ4pg6mh;L|ZJQ8*VrO z?*Do%oZ_!|GAuZcVQP=Sl17a8l{KiTT2DS(+AaJswSz18gbIoKpMe_JwjhP2#Ro(R>OL>k(lwEES8*1xBQc*k#Hm@=q6?vmj6OG5r|z%!65<`8*=rb zZAyn)=pc$w}cG6%s!yl9#~vs#6}cMfDUcl&m0Kb*QmU#pbuDx6ihKJ^8{`E1N4S=ywc8|_aYtQ;_+j|AJ7gao`EJ|O4NY97a9bq)i0anRF)<3yXeI7a$vM4h z8d@YQJiL&FQVVM#A6QDj-O#E9?osqyTDJfW%_Nc9C9YEsEfQDbrs2yJ{KUmbNnC`B zlSup~{5otMVr7Oe)+g#v$582xsQf7l-Ga3#@uB!7Y9Rf3JM}l(iWCfK%E9a32C~cJ zjY24z2LqnE8irth@D|b%8&wHf;_tXgmGwpExqb<5l&=R~(~bvn^_suauL5PYw`xb= zIWY`OB^CnA(L#qrR6VqW&ZgqF;fqC3A*z8_mq!}bmvkCyXXT-+z%5ULUSbza0ef~w zMLr&UvOSho9ck3LSJoq{%?vd*?vEGq?-$~|XyuX`aYytOV; zydq)_+=Ks#K%V^W`!1+pd^vOw`8W27OjX`8h0aVP6Kj6&EjU4ZO*HL-`dW zBHdR6UJrFJVng$dW}9)_+=v~vAQC%ltzmX32$#GQ&9}}yEK;(3Rx7K2ZnNc)lA2j) zIaU-ld}YV4kh- zJ1xs+)flJn{(W^HD-WvYm3$r;1X`Z4d{59Q#(nX?JfnEIu?$?`5A=`4L$O;}Ni8^D zj;3`e%Y+XY#(~XvJeQ9UVw|)K>@f0-%6>mFZm(!=>(`^8WJIX~do_DE$e53%{&^ zdaa$RM|ld72kVQqZo>(c-Ijnh$|&Dgyd|`BGs;Wck9;QB`rh7@>EQ(2*@)e8PY76ZSHNn&W} zeJoWvwCY<~pR&o8r7#emOo*2i4AIf-;CBSu8uY86i719$A?UHkiw)ctxEtCiD==8- zs#C!=N-MSXmvD<#v(^4xN7fvz{be}?eW+kF)MPANNo|eu+98R3rT;f#U0MwwiQdid z({Q+9l^6(O;L)2BQ^~@1qp~*FDEVO4XBhzjh-JhQptZ5T(2CANk5tpbZzhJy%gU^^W!9F^!fz(ch)xYH z{C4V$N#W4KeKVqyrVnhrxy;&CW@&$@$?}C3eiy2UP8ryGr?s`L_0EOgo-=7iMe!Qz zU|H)e;=h5%%z^vLtTkn3`9Z7B9QVCB^5=nQdWIR5{&6VM4pr9WblZ2f9Vj!k5GeMm zX`bba7WSLaJlhvNy5CIxbkbfp^fLm`;I&5@=rfYeCEhKVC2)1gYycC*9dFmsQe(9GRGwXZ+y~HC}soa zRp5jIZ+z5Y_Kdi;HT5mSYk$GrM@(P-t z*}S5crA2{JS(h8vCgKJ@>f1js5j3@Nc#5{KtP94qb8!og@|l`}J9=u>lHFBLJ*PG;8CD)tfdaGO)$@Mn5-Y(b0 za=lBgcjNj(RxQe*cT3+?i1xBuG1%%G$_-Ti0c=LBP+k}<`lVr_9v3KDD#i{n7kpJZdC#!)K}<&5IYW7?~AbY4fwi#L6)!FI*38It)EO*9OXSjvpBrVsZtDRs;MDeBw%!s?wqD|;MXvS5NgIXvWcWoU9{eQk zO7F!08FLg$e*J66j~NDt^)UJ-TfYO6DEXrrq-!|K*3V2PT?e?&meCb32c*AD-C3dB zh;=LDrgGGGEo8sbfKW3JCeKiaUp%alLbfS|U>YIa*E3~utp7jM1+@Yhj)n{n;9FWU zU4Uj``y;fVLtt`OgNS4c8LnE|#}@&<7&Bc}1$jsbEo0A%P%y|aAQIE&&qF>!y;DQ6 zp;@;69TbOl09WMQG&alk1_Dp$u8uJ1S+*i4@ET^l`ji!%TG5TSy>NS4MJKw^ZBm9& zygqUL7YwIYk_p7NfPbS7bQoY3Mpznx^gNV|LXIW_NDn#z=hY}7q(Xkoca*aE?un#S z;zy+rR}x1o^eSsBnydJL`l(#H1O@tT=zCzH+#mps_AoH~vljEYddu9lp#uxttU&dN z>}THixYO)hO!3xpO@dRscDFZRYgenuU-VDbMR}+?5o-;q!TgR!tbcx_BsWl1O-vhI zMNMv`q;_7zKt$?@JM#b)xcw<)8dkr*fo3FjQGRm1I&8I0WqMW$(~~15YogbMt%aj$ zP*lwx5vw$>cnf;B`RAgT{6N=I1SPrA3k(}ENKJ0IWb?eQ8%`EgjHwM<%L83e=mH{VPt9q8d0Vx+!pVO^?yIm)S-_ca1HLzO|)cB%}- zAbKw;qeh99qz{^%CnxREH17WHC1ueV4klWAv<3mAdT;b3 zOF#HJYr}@bQq<%U?F&5JaJX@w(X6JdZ`rC`w#8#tp_Omea8kLo9>h2)y(#g4xE?#p z=oFNmbKt{0Z`yAe( zFUV*QRct_6BtU>ejb`Y?{x3AvQ@-d=)=rY`{lYI72*clmtVGyaW4(ts<^+$Q3&29> zGHV^0kNy`hbsHuEa<666_3`oOm|IGB)#O=V8LN)3_|;9`C)5z zFl>E-&f3xr!UUoo|F39@*==HsKC^fW%ru1tn?U=IW>Y4EYJ+z$BBz^iDRQP_+4Q0S za5@v5k}bp9N286BzzPAl)1f8<^40Z|P$9j#$D8UkfvR(1HI|F%8pLmE+->#y_*LrT zJp>BXc7?Hw3xXKWvna-%Er4TA!Q6K~90cLrD}at`PvTk%p5oelxC00%h|w6@!Cnv_ zflpDHwaV&!ozUN8ZHpkOPXa-wFEVjoS;_tzjt|2O&9?NNzCE`B>q3WZH_Xl$=bw-j zsJ>Z9hH?=%Hr!xoXMje@zKWi)nQ)9v#>8zHG3MC1eH>Yr-gdOvTL+NUyETh5wZr%` zaa*~yI$W}C{;>w;%a(tXV>H_o?!JxfNgyw@&xnOF9~pudevwu2Re7@-d$rkn-78tX z{^s;}?zv{?IAw+-Vs>2CqtZo8({HJ$6Y~LR7fR4#-v%;t@sllmE^kq3`a-4>Z5p0# z=;&6zcy0wo7da>hmZjd{B=Va^91pZx?!e+*WwBuxob3!*wU`T-lV3h@ZF#dbgG$QQ zW07D|VYgvDP1h+#FyG6ekF-vQVSV?gE; zlCkuNATf+vuoz@G(nA;rE!g_dWYNQ9m{4~tQTn|D(wsIO*zX)BRQ8mxbr5RZMz|%7 zdxBBYuRHRhhvVikfJaZ|SVzAFX(-_M;=K*W+WOOYLSvbYpW?k>Ww~(VKNml?zFrC+ zj8K2}1jD)>I)l34ZP3~E6CxZ^M@(qaf=W5m^s{irWs^dDMTJ3p)b(|&-(%{z-9zpiJFrR4cQydj+qx!F>(>O8qAdds z(vE>iPk2F~Y8|lQ|GCM4G$-03k)MyLe=TwJ54KIqJSmnrZ#0_@j3~yV&zXm=#hQ<5 zIA{VgQ4I$<)o_qh!=^l}$zGatn(7ZDTnpeJ(0?lGo2~B`{#iV#LmM`7=-^8!_xM_j zgOygIern!JN2HQ`s*e_`wVn+1%lZYn@P1eu#dx2^K)nGp1G}E%q#-9HHT36ksPNkfYT59d$XR~iA6zU~^g6`B{e5(S!J{fIf4Gjl2~gU<6%!zI|X^*u+? zIuaoTxh9C3-><7GrbDLlVYFI;`2ZPHZbl1|m`43OvuQ^qXVbWVJ`}53fQ%>3Aq*Nf z3zKWde%(6qot1q*#rNNq+8>;*`5JHC-sN(Jg z++_!<9#nT((cz)WA9JE$*Z(F3jp-w=qzW(*^nMq#ZZ-9P2PDJoHVDBm4}e4}eSX9m zoEOGgV+G=@;raD!fq`6ueNhd^C&A}9;O7$@$rU-pTd>L))2{*`Tnqg9b5L$M`v;VH zpOo2fZaG%9xL074y{(}i$)WzE^b-`h=rMvC(-(pYD6D|hTnZN`3TQPH`oC3kQlHk) zQmj3~1>fNEyxr|Vkn(cTU!${x|18O>IAuw8v@80Xik7Ug?0C9jplIvus6h;q#ZgQ2 ziJj4XXk1(T)UXlasp(sfBJHQ*Hra6!L`MwYG^{W>iEmkNq4CWjdmAc#HKJHh9vqZp zR7WSdok~Vs1ava_CmO>Vj0&BW{HaPV%}Cy$l8uaH)e8)kJ}QOwpA_`y4Cq@`@)RZ` zkW~y;R2UWponR&{6%%llz^A2#CBAeTwCiWGyF0OXf8W`2<{yhLsEiT?(&_l^)kbAJ zw`BI5d7rSoK~%@y5ba@VRL8AG^5?F%Vpqjb`cdWeg}x}f7qeS`K9Yu8m$*=*Q0+M! z;3gz{=5qUo%DIJr-5Euvd4+>^Ogh@&G&GL@?Tw}goq`jm?_}%{o4AV_ zZRP|sbHw1x!AK!BcyMga98655=ZM*vQ<|A0mS+y)h;$q=K68d-=7{~7gTY)nj<^7G zrex%Jp3uQCpAoM}$Mk%H`QjfL`JAkyvY0RT>G{fM&K5Vae&{=G&itU`GU*{!(rfmh zlFYRA*&S(pdXG76CY?uCoSfc^yTsIAW_#<7@zDVFeTuV@-(ZX$cm~5l#8Fni7}6rv zkC^xGMDpxY0#yqkLNV6=X3jHAqcCF5fkTW&BVfP_>}WH?Zef^nf_MfmMjyj&ZkQM! znFa=u20HsGLkxQ$h?N!00Xf3^%)xUEbMQ>VRO&UA7EMbUWYZEoalL22Xj{KY1Vta} z)elGw)2h*UQc_1=D~#s3CF;Qn;JI2z{<`&Pp(rtMVZ(Zkv-X2N9K$uSP?u zF)G_rwzt@S*$pY7!I=KmWmF^jh%x}WUA|#wH)OM;Hd#p6 zTr6e5N77B65g8~MJpNVNCH#*ytc9XEXg6$cW@C=KzJ^r_BUOsiGU5rrM3sU@vC{lM znJm&P9a!3^!@+&J4wCX$oPse#Z-K~$C?pI~g#K@d0)^!OA&S5%O<`|AVJ|~LP}tas zj>6gl&{bH{d~SPYEfle=|1J4lB`L{0`SpJ*zd%raQh@wI==bCYLWcY~6(T=18PiX? z)RiBAza#%n`%W>r*t(*nf~4pEr$!g=;trhjKSXY$F=aHa1K6nEfGcTb?W{@18RR+BEE=t`a8BrO5{0l*tJq5mmD z9SWNq{r;O;Mm1pF<)U<37f96YxJO87gVjlKhdQ7*F&LMlAqb>L!V=00XocjpKf z>C2PFyBf^|yL-dI9_M-eo3TzN_!k2o+FEbxuaZ)%%W*;(G2=awGv_6+eIn9i7>MCw zbEpL?hz}aJ_S4;9^lnd~De_`U0YkJVCa&)DM6c)xHo`6&J8%OwIw4IXNKF5A49mnQ z5<*@oVA8Kkt;_7m6${Du6MNjL_oCwcSZl|Ug!KVd0WeHy&xN+0109~2UEaUY_Ro+$byX+j4@KD7Q9()ggkkT zO)-|MtoJ-P5Ccld4Y)li@#gn2;~tV(S-qT8thK^E^)exs(m2x`Jh_ zV;_|{m}jk&0lD&kj0J6uE;w43Ot*YDe$WSiKGsV;y}6-}TJt`^3i;d#mBJVF}0x!A9E4wJL@p&`$ zK4Tvzi8?XpbErw&*1MgtzX*k*#AgzoMMSqHXt3zBmQ#a-eZtZdUW zQ+jGYxvJc4y|=1-@p#TsTeS@zx;9DuMSGP?*X$3$@}@xMzKd%hI%akeDs$ir12oh+ zshr14O|=A;u_=P=k5gL3WC{2Yn(|7|XkB167Q8!fGv* z?fG%s$EMa&&%yesv!2{GIz4qgwc#WzB&V*AI_t?Rq64W*tS9R`;4xSo#Z#{^Ho(CH z7L~vQEPq!xM#MTdAF`Y}l0H%9c+8WnIm?8a)yG+7cHV+WQG|0V^_`rHPRAyVpZeqGZv>n|nJrk39 z8ATPvE>cUxEAQ^0)M8vb!$=4GhV(e>itR6>8K2uzhEnOX`a*gH4T z-y`zE45Bv%^QQ4{rOVJw-Munjq8Rdln&ZrXcTz;X9zNZMsq^93(e(q-Eq!uJ{-B%j z=EIAroueDig+s-h3)es3TzEz140HKt*iTK1k8`KRZODbv# zDYd`yRvR!JXU8N?;!SRQLT1FQsHtfS2iT#r2V?2iU<8GN_-=ISh84_?Hj^z2DWPvp zpc>n@ef7cJ8H>LlL20p-S$2h8!F?!*8nHcKerN7O33SCqkNiN@Bf$2yqO6+Nkep;I zwgDWt{d3wZHYEEbQ)QRR8ibqkb?yW)`sPIkc{@SsxI?4i0_BQOYAI_ZUIDOb-T6MR zeewK#4zx#q4+>U8N9;K6G#m4c>k>2Gw{5QZBQk3ZAb7~}h8;I5S7VF$FM->-I@?*& z=Ln@hMe0+}j_yswdOvKA$t^br8@1_i5=zO?-+*gw<~J8S|~2gn2`Dx;@huA*|!gfk~p z9Bo*0^BM*jmDrB+G^dcJ7~MA-%MUdRn>m~6KM=O(mNs;=^~zjU$!3Z(tB-Y#Ljm4@ zV_riJuBBlTuV^Ea@*@B)upyMSq%_)UNif+V22i)v3 zH(={+SrX^B=R*{sfshb;3~O_Z$`T)@yVc zmQlK+kbG-EQXykRA!E`MG63MetB@TPh^3%BrI4S>Y?-X>IF1mIS+Bt(36~!3sQ> zDyaSiJfe%arW_Gg3*7i|gT{U}up?Gg0ectG@5mfA#zc+E5XS!iV1d~hm}w}-{053! z6Vxx}>LS>4VflwEGPgy@0OtokhI!Iq`Gl6qh~R}fC|k<~Ylcg<(HC9MkAKZFHb|hqyPlRY4bp1{%#E_O03a z=};{i5Q(8#^(8-70zEze4lx@0eNHj(L15sOLAJT=I3c2vnId_J6-^8g{vZ*u*(L(3 zS=Yg7E`rmbrzr!R*&oj&Z}!KcW)pKMO$QcDc@TQQp~6Af>}l}d$xZm9NZUAiK{CY6 z3~HQ_EXL680NQ!y+w~Lom;DU4u9j#kpu~z+GI*}P1~2p==>U?V*C0L{e>+T2vLbqg zVcn|w^)*opBizvfc55upclv9@uVtz6E3oVClp!AaiTWNI8>q%z`V%NAHH3}UvG3Sl znwJy(2Vaa|Q~wD%JeTQ|-;D79W&kj;gYk_en|%Xs>^W-onX)ehGXog;|AI=v4Y*ay zr1R*GEosk-Q%QK25$AIhg%Gj}Kydtfq4AMFI6ARdxekpp5B9cYtxi(E1mvE>&W(I1lB`2h~hxEL^~7OsL+$!zWXG; z;9HDpFcI?by zwqB21+X(iZ6TG37t?$Cq>e2$%9!_43B`Orb$*WrtiNQtR>F>Dc5^OzC@}VL~RkyJC(%-Whd6bHubO2h$Y%N z0Ix8x=dpeu`{<-^?2P>e&+4-TRFcMe?)lgL(tQLh4 z*I@VH<@i5Q&X3@{RjI8%@gqf&NzMV-DhE?X%$czBX0;THrPV1xY${EZlU{NwFZaap z9jVO8EDkSAona*Soz6}QdjsK_Mcz(@G=EInzeM%OYcJ?NcN*3b%7|fH1wzMuFnc|h zKk>dWtm65HjtBUM&V4PV^p64v1pnX(E7PUffj_LXxx?!V@$!QyPH~ar6rJG|?;@8@ zFi0U}SY&t{u_vj&urqKHHf{?4W4(IBXM)>p8${`$^K3j z3;fYV^iNnmZJNg2Lfl52R$6?nx?D@^;C;J($*%g#{WREbuexLqcISUUC|SSrxIeTM zHb18l3f(U=I5pAJIYf{NF0O^(n2hl##s8*a;Z>PX#X$N@ld{&@)v+2+zeD@3-Ae9MqIm%==cj%?>(N{2yqW{{YP@IRsO&vbW)Y|x!Auw?`DXI z7-|HQP3^f`NRHDqmX@XX{1HiUE!X4oDDc?;KI?~b_6B1@e-U0)we=O$ys2GJ9vupA z(_E&uR4A;*m3+mu_p7peUy?#wm%`TzNFg6HBmjRgg@+pyg=>UDl}F(LP}oZfn=t-P zjQ*$SmOPg$_(1|c!h^p8@Lv=DPaLoFWdrmOU8V@%*-G*TD8l8tg`(mUDs4O}1)$RY z7*M&8R4i>NQDXj%XW+*M|9Og1D*tcMJxuL2K;qmmT$KjigJbEW6p;A?|G)ZD{>|SD z@cm*^Wdmt{Ozj%Muk!F80RG{`-y|neX=i~)RD|b220po1wAl{!fX7iQrzWq2os>Q{ zS^6?%)|cQnajgbdrGsq%Kbq89gBseQ?;yMi=EyQ<%b>U$1j+J{{tTpUMB4Tgemc#^#lWD`pa5B?YB)caxi zxR&F=cLMxLgg>9~`AN-fQ1Gh-{#{&^tY1JwJqh2H@P%jKo&DNAEF@6vXG-(l>cPi{ zj;E-H?{M%*;>{lF;a`0C8g-mFJNeMdd05Z$Q7r#=P+QxN5VLWWZ)G+!FRo4kcU4O_%{=O zBqe0&{)eUHE`Q|D|AAMu`I_>3UJ+-Nf&4HnPmhH^*53KfXKh+I@&44{+pN}wPG(AN$hz) zmH(SPIuC))%cQfT3(Cph2=>2K=)(Sj@7dqO9}E1~h(D6@Tl#3g%T6Kxzu+0RzId-& zE82NDg}_-#oXeUjGozL`S~-YCyA-c@k(I>M{)#f<+EQE(7p-iBsI{crY`>%a6--}kFC@IZXCNe>^vJiKPSKdqYm5V$&GeKuJ={$QRIc(HcbQZds z65sDk)oLdXzXB%udc%b)bRl0iLFAC`U^=*qN|KZ?7=^Iv;Rv)U|X zEiyF|t`^ts#TACc-E%P9KCG5`IIP7<85*%?ETgQ`-)!$F~BK`TL)TSRGErb+X* z2lY=t9Yd(LN}8urr15*w+~L7L0r&#Ke}pFDKagh4Y?0=@S-&aG+bAVPnmi>uG0WKZj~MmwWKrq3dG8 zw{JokYy-)tE6aGK8|FR#mB#USI+v-90@b)S30Dxr-Swb-7HPjA4UG2o)ruD{(E1w^ zr18`Ws3b4_a6Xxs__wrY(lQ=a8JPRlwm{G%#!5b!-0r3IrT2KGy7S2l1(ES+G&SQc zKAE9H=;$flTK<_ZysdYFXi7;B;aLgt5&(u#kgpIyWU2&|9|0tqk2snSG$w^md1xul zRRDcV=Oy;6OKV6@q3@d7iNJ|#eQ@n5$~q5ajAa>>UlH7YqH8#Php=bnW>NFkf9A6H z3q)3^?Ex^JsOLAyp8rFr8RtHU&9q^P*L6dM*HdSv^LlDJuRKZ;yv|2an9srWY~l4W zm|-dl+`dGBFjaBI{7GB3eO6c_(8V~ac zrwOkMkd>;}TQQfFQf+p^yTR)g;Ka2(xQ-BB_d}1@u)yw$*Da7(Dulk2&gAlXtjFsU z9_rtLI)|tSFmPys*IPi!)?Wl>;(Z(-pTbMI;$@KVG6L5JgqJHou#yD-^rh&nCpb{N ztW4$Q-cMY;b@WhA25L1?r!~#XC&Oc|!qgrB z4$g1H^%>#yAHZ770>5hzUT;DHiq{>u^Yqs6vCHd~9%>~}?;`5k?V8lv>B8$=NC{ro zQu3HS<|5&B{fu-Q|D`UC*B|H?ruG$Z;@Z!+{!MsohXNmFf#)b*x8YgwdKgUP@p`t$ z>v9iuI{^Mf)b>sDYJrrkZvZBEZKL!$>U`mKCU|8OC6)XqiCnyJGNKqAD2xur^(A3+ zDoXn+OM8STR9SitkPt@w--%8h{>as4R}ZH*aGoX3)fm(__Cl>A%@NZV$;KW3^{Grv zPG{q4_tQ&Q}14daR>`&shH~HF*RP8%JrC9&nvEtg zu5|#>jpQXa(W6=ZPS^$ zR53M1n3{@fXJP6_6!0Dkc!kGOqaOwd#Z*gS>g5kzrh0oggMsrtac&7TrBrPbnc`lZ zzW!4I%3XU}3Fu-L2q!SH%hON7W5Z?WK3el;IF9YlCV=JtgWzJlW&qZR&qLu{q_nho zE=kk>(Ukx+^)H}3Zhyf^dD#t}Y<&^5#{&3rKK2l4g`tRQB}yYbmSeujeSbr9$^SkM3olyN`757rJ^Ls43U@3RcBFlHIOr zbn0^L#^=37omStII>z`X)rV2frvj8)KIM+36lBpHIbXtw404l~l z?_#8RRj$j~cocu_2>=?qUpL&q*f$IA_K0;3I+PF!XTyj0^Iejre*^)|F29T?!Cf2- zG~;04253(idlv@-n-VK!y#uW#KOvIR5(muzrX;jQs}NrbQgSA!l54i z<-ng!{Kvr-;D-ZVEpL4TmD~D*@3^ke#ltBEP6cr=9Dsjjl-bx{=?{);ypI8_xW?9T zw4~dVbyU zI2u&0aRyz-)QUkru7z-2Bz74EWzVN*w@b)4vB!6W6}NRgugA+D$|o%1zg-s+QJS%)-sAGEUYG6Kf9&CSHEmE3pLY zA4pyV)VTI1ha7MhNHN-6q_A-aRKEG8y(@>Qfm`65F;KxI>xFUcOFS!_Y~b7r957!?vzXeO z$oq{KPw)m^9!Z1aKy`B|#62>z{=jx-z~OM{RgdX=Z55Z?nxVv|>_t`1zSoHRtx;LdG< zo=q+|!B?+(;4>;VB+5ow$l4ybX9bV*ErzH;mIx0#g(k+E0ilcWmR`x`=%--v%ZNgV9{Hn13)|^WpA+c1s=8Ng*yDCzV@}7dS2WAik;*?};ndfphV8k>*541Z zkm_r|h*a~P;ucDAn}v&beKnq3zjc3|_d_!FPzE ze3b^@Nf6It#TqNBsza@L<5(C8RjT3$#x(wCLf&+^CkV@ItIS9gSSPAi(22)+HXhPj=nn5N>Td#WS_dW7r>jfUCm!esq@a3c*R= z7(t~eG8v7xNRxh0K@;}H!9xDGT9f-*sF`F0GDNWv7B)tCY+MO827`@yxFQv~tRoeP zc48(J=^n4Vf_(|T&kMTJ$gGzIeek}!^K2Dury zg`!^{fqZawQRY$0acu!-^Qm*3V@BJW+8Jn_hhyPG?DyIb;7^fp|C_J4|W2>L4El->piHR$b(xTCidT9Jm* z+XlgM^mY&suz~0;N0FPP$W3<0IeNQ_G(Ek2wA$0#X{2CkA3{0QTi3>VGccE2PA92l zQ%@B#nme&HGL!xVh?7Jz@m zgWoYS%XdEEhf8_sMuCH$iSp2%C$-5C`zkt(sZD`H$F*y4rA4tm3|d1;>tt1SzVOO# zFifVS#PlPOkT^z_-3Q|Xzz+kw>O{4UifTKd8g!@zsz3gPZL(~(t>4P~jLHfoH|3Ja ztaK*V(n6+I3th*xcW_lqehyYfkjX`$1qD40Tv!`Sc2o+Q{{xnDZ@9-*D1Ce+;V(ds z19)}*0pXV^p>6_!M7all3sNs2{Ba8YY>-p*Uxc_&!Ysmf@!&@ReiY&NE2T~I_&H^$ zz)vRp-n(6XjtBf`!mk#CrMGB!o$0lo8+T4zm-2PP>JkLwl48 zG_^b7LelC!gqy>}vM*s$?N}5lVFubvRLsz_#mIshP6RQCRm>j@2rFNOiA?R&A$Wv~ z2SL{WUCjS`)GhBIl{+PjjBCdMrVn7S{tx?} zEZk^&sRUEoMvG?}6Vn%XlQ_Mic-@Woa%OHO2}ar+APBIEVUqEH9F_-b+ytpusjjP~ ze#9QVVUID2vopb&_{cf9X%D9H{sXGWS3v@kw)A`HHLFyqE9|K21f_}}9qR-^{MVHv z^gR@)NVWpWZ$Pr1<7M!46i{tFfuO?iTGp%=frLQsufW3oUtD2H+--ydeoNdcsacOA z5gzihs#&`5urBe$i(-x$5oI!X$h97U7zq480=-$d<00R_AP8M(7}yvHgFJ+>K-f=& z93TYpz_9ki)8tL-2^)j`BjiWh^Cw~0|CdKA$kkvit||lvwmPQ2~fnfoOn4y8&b(9+cDzA-}D!0|7{V5&R!H zc>u%w-;gZdr6>>@@32DX`;n4a3po$@+Z8!ke~1U2Z2@_X%iU>J)M@qb+PR!$nn^UHjf5Z@4H5k7!zlO~Fq0I#7Ed^*%}W!(A5rj| z0PhMuTtsjMe?kd<-WVcph8v~}-rN;@j47%EP=avz#tSA@XFVCXMG zU}+|SY#}gG5g4CB;5tQMwh;I;2s|MKuFWKX)jDv{K@k{YO*MS!oU7A1iHM>HJ>+rC3mTss=*PYL<~Jf~^^m4xQYs2=Na6!5KJ3?1?p zuljuQjaQu4hEE6~4pAof*eMG!%;UJt2hq5;jDFq~j{QYzLEeC8N5_j4T0;_TI&Qn5 zkhpdez`i5e%Rs}M(A$Vc&7ypD4oyU1@1`SgFQJ5n-9ezI5C{R`R}z>d<@%pP4vuVq z9oHd8zN?7uBu*hP*I_3h<1wg&_m~jZW{@oIaR?WV*Wg(jr95vLtH`_*$(I&|AAG=% z-&<5R^SwrD+B-y63_XBb#n21z>8v0a`luD9&?1QXmgS&$EC|=(9zuRYx3~0j@x)Ss zwtl%H*oP|egrx7E4Mfa;0HGCW#)PK74mnE58A1bRKT=2nlOTnBOQcsqnvTG~DJTeLq`Zh`U9n&OTVtra*5`N@<%*9BcePD%wveTJD2M5=X;{8hLD~p1a?L7i;PN? zozDI5io&X#X0K^4izt^7S&5=~3>^uEx{;xXFr?j>Vy~AW7VPyG{J<$+J(~=QQ*KcN zXOo~O8b>~2qh@NmVlxs7=c~E&IeuI(-DvSPXr@dY1Vu0MG5%M#vQyMi^c-mK?Du%C#m1Ut-Q=om0GmkbRThP3%?Ivndg)<>+@UdeYiavbaJR0R8{ z3Aq&HF*gSxH^N3Yk)};CEdLpRQ`SqQT93f4kS9CDX}zDE``;C^k@aHFijb3utb{z? zW2hgBttLY=gdy#I2<-~_*6AW-PZ$(Nd>%QDkl!nUJxI`NV7B6Enh04Bt=vwUorI>& zc2)^lNqxBu41rxC&vl4X$ip*)WCKH)2>aU&%o0QdaM5KXq=fA6F*F**-bsc`lCk_N zk)s&84mq;T5Z)!t)s(6fu3izFsAg}0!=bDCGE66vAzq5uwiFhxNj7(#6gR~VH$CFo zE4U?XtdBsS4}cqpYN;wwg*;9hEnLar1K0VTyNm&bx4smF5T{d3R=-?$;%}d!ww8RT zc{HA(R?Nqk{{7disc~6wUh*`O%r5T;r@Oei&uqXw6z zrDVJI#BPK>YRWX}^sfE*j{4613!rOX7Cw|)x%5_4Bww_{{?Ng!iZ*y308;a)EKGGm z#W?M4UO^G&iyOy%#o#icTma790-!0 zBQi6mG$ThHZ?#xDHS9B!X*cilLNedx9$K7-d3JnR=}xQy_!_VyQ2QF<$+k=VGqlt8 zV$>Z7FX5ghvlD=+MGjuS&%^ELCy=e)-7n`YUu4tVU+zg_&@f}Ne0JYU$_G>^}12GHz7&yjxsC|v1 zXnu+^zG98S4lbluv}+(4$eB}_uOam_x};ScL( zk0D)cdu=rLN6wYJ?*PG-_adP;R?*Xi-t$R%EC2j&=@~rcex`w0M8p{wQSsXuK?ywE zV1sAa7A2M=v~?BKn;wJpT@)18&cs!PWy9d=_jaa&B=U;+H|&Cf>gG5KO8szyV+M&g z_~n%mp^>2rWbZIo(e%xr&+nY^3no_YUms;dv^Qe)W?ALd9(;uN3f##j(EH~Nw0?kr9!_!a!A97H+RYtP;5WO<_du0y}yLQ-}cW@uJ2)BI1Lg z3iu8MJm;ho;1U;@U+@F)XczcW1$<;GD{TlYk|^>CVoY!`*biVidO2nTm|n<_t3b#6 zDnm@K>?nmM{;sxdV$0e{)U~NFemy3*K~)qfN)!b`dG#MM11bts;e7<>uGYK5{3Fs} zjVjbW5EzAnmbK%$!^)LEVj&nG6>$y?iTPJ-0ze>AhlcbIpW~LX@ltRLEdK+K;-_SD zC{SL5WtIYF3qGA1A2NyQbCHBEk^ouTzk_u#_fM?ce}u|!1p93NRAm|hRmHXOxYCX3y<3eNc z)x0L#4}8Bvs@cLX6U4x|JnQkpnpPz=@G&HOWeOy_EP9v`{5N59_MYPX<>tiA5v$uj zz+$;M4WD4#%ZeLB4U2XRS?EdTw+rKIgW?=8;ryI(YeJr3K3lK{rC`3_e6s*G8oGWH z6evBnIPLqhNMA2)^Z{JwiS+&+IArrk_>p|2!n*Z7AVO-454Y19qyjX3HrClNq%#yD z{l$vDDfI8f^#-B;9IDGC(m!10*|bw2Xt526`VPqDu4Tk<*!qv1OE?)Ey%)aLjcU#& zIVIqF3zSe4VyhBuDoU-m1mzW>2qSj4`brPRGRNpPh z+B3k8fQd)>2qqZOI!u6rh~hw03JwGay4=6QJ6L;g{{9vCEX)@7sQhexAe-!Q&(AQA zwJ9*ge6m)RgL0bw#^^(l|)TPJ4u?jY5j zsFRsnarr(^`j)atNsl`opvV2f-SYahLbh`o65rjyHB4@9yAt%4fL=pLJ`}_5a)Mfw zLRYl`b$?AvMLRKa^5r0_fF576k5K-@%)-T>6c z?nf4@A_B45sEYfe_^_B$6=8g@Dz;)M&u=gAbauRTQI}Z!AR0(0WnH5A{cr_#Swzpv zv^lq>GY8gy-s0LrF!63>jd5rTV2umlh;i*QTo=L`{7e^B7D1c@9gZk464luETVDNX zv|YIJq=KvpeD|yjA4@`TFr=uwdT+FCxbjM$d{AW|Qa4B{7zxWh@US%qi5rnfg$}77 zf+8}VFq7pbSjZ*|*2Z#cRoHqL+$GvRVB26rQN_8SunQi8rdD%2jDcI&Q=5m>`YtTd zB5O3@pCNt|Ci<3kP$ptyIzSv!I}`ZW--#?O z^8;6celni#d5;^&ku%)JXX#k@V|@a!y6R8>G6CqqGHfVG~DLyGpjxpZxnYz)qX=9 z_GAy2NOI!&`3Pohz0V)mGOdQn zv*5dElx|_8WNHhbsbRnPWnzfe+dNrpTzU` zqg09K3n?2y>09al|7kpbq}zRY@q8DL(_(OXkeoX4{Iw|Q-^KHf1N;BBc>X3hrc&a4 zsFyxg_WvxNuegJj@#6X8SVv8NSCGT`wjR*|AljTn8^`nO0rYR;`H%3fRC4IC9bTkZ z-Fp0zz%;^Q*)k+<1O45QkEujOVw+Ao>4MJYRz$mx>8bi@_EC<9L2OOnkAjMhtBMtZ_3O zF|OT>>l9d{iD3Fw^Z)gDz86_YjpswRr^WN{!7eJE-*+V1B`2PL7O5HW{5uf8iFp1P zRDzVobhbF8HXZnJ?K)hknYgwXv=>5mZam-NHphDZWjvn)=9TTP!!~HC#=jTOAA-jy z1_EH<4rRQ}bShI@gS`KFJpUl6#QYr)h$c?I^#6PDd~q0R`mK0gP0h>1Jm=&whk&_7 zH7j4jNev96xoq(#ni%I_!U1spC9b7n(>F0y`yjfV&{94_37@Zk5_(hq=nFgPiRsHLUkIe{Kx4zGqW6MCRYIz7KD_A`g?6 z9P~6X_f7~*pB4%Z=2L@01e2pkGIr`Cc6o^+$93pLHp1qip#nFrEZ<6p-pVf&C z`zAHV-g^EHf8X_>R&eD zDLt$n_J6VW?(tO?$K(GK$OGXLPedZYdO0d+K!_1gfmEAtGtmSi7ePf&LUJI{ki_JK zTfLwp)p$xjYVD`iT8q}U*xHub)>3ONDjK{YRjX93qP6Xb@j_cKXs!9aXLg@+%Q*x; z+WvljG%tAeJkPT`J3BKwJ3BkO4<)Qwefd@y!d|&b6hzY~e01Q9P!x)8=yb2sktZ%tvzp)zagkr>SFYltDn^WpjTkGp@rNk;BMpMN73ZCVY)Jn{e7oG| zxEgVO6TT&gbDq>xLrvlx-(42oCR3or;vIi!w&$g?OOgYgz-p3#QP3W7_ zeqQ?}5#&Vsxe*3_I)C_`G)vkmE|%RYwC*1O%Ki?nXFyNP2Q~B!*{51;yDz4=U|69OcCGf5Nd?XG1H1_j3)T;LL7OMEf_VWwga1phi z|A@pHO#eZ9uNF+L{d_Vt^=Cg%mUd#qs|bA7{_q)5)E0xH1PzV`DHYVOB=z7>NaW%=g)(wsQhs5JlaB^#2;QdB5FUoyq2Dt&VKGtdGPG#VHA8tC@S{z^^9-- zH~V=VQygQ1y+?!g-+ulwEPmT?qXJz3H|8LS>?h_b&gvBQbK7PApWDxWzck5y&RCyd zKi>pjjQzYh2WD9Nxq+ui_VaZ#KZX7Ls_-G^51*_8=}w@0mph%SP^QbR1onY4q+5UZ zGwUq(KB4`*?Mjb#)7RN-hMt$plryVu!XVq zea=w%|C>MjAE!X3l=gEzUuv!hvwU4H10{Rqwz9k#`O|P==XM!;o9Jb=s5oeKKD_U8 zFXDQNvh#`q*dI7btQxte{q1Z8i@YzsckCZiW}KEenJW%IN>@H7SPHdd93&GMD&zl>~YVt!KCZ8mV03W5oJaAA0WNmtwsU zCqvjorH037B*yD(qtB5~K=asy$Akq%F_gugEmpfag^9jFa)npvB4ky0c$F6()8rTH zt+G6Pd0co*Jyq|gJAJd*W#Qb*vqgE@@R+qi4KRwj)9F#s@EB}TDe&>oxB_KTAkK7; zhR1xzWIks|T;@Z)%!%&w%hm#Qb37XVh_)im(6^y6mz863-}Q5YXQCVZqYsQ5{q{D` z$Uk*BPCrDb`+h|yB=JSc3?&?4G1PqcCA@!C-m8hPlNJ5-aP%4dj<;g=|3KkrbWBzj zoib+jXUdxm*|&>u7_+}^8$aW{>6b{eqGtafd7WtXpT{F>_V50gjJ&UZQG|N+Fh2Kc z#)N6>1g1L)G4FDVxr&%ah5gqQiaa|{guNSot%{9EOli2uFLF{^^!E~0pToH$U`t8( zA>R%6mrgr7%Xh=pVfVMqm5))3CWt3j(A<#wtl%fd5}pVWJ;O`GJ0hQJQoCaeonZ6j zipU+Xt;_u-SJVHVKsZK%YR|#)EqA7n)XN&_bCEs&m;mVx#dk07;OetTLe;{%(W{=f4a>(7^RnFZW z#Do3MT#d%@fqjC;8NsfxNC(RTX|%_yYXF-@duY7i)Uxna{R%zGPrL_k3p{p8ynr7Q zGIGv9?(LN8e1p{4ic~FEoCu(|7G5>08kBoPO!j|8_EcJ=rh2Q7Hr`v}`C_qr8V4U+ z`;k%qUjCu<$2Rva^cni8@5tJ!@a-?3HAYi=(Ri)t>el@F@ zTjr@M>TzWXT`BA9xw}_OR-6V3>i~sC5GqcCGdU+EoV$InD25%zV=xeo3Mht%2-NVk z(|G7A7Ts=oSv21ZLT<6-G!tDxGl^S4a3}ZcnQ^&)B)Jn6i18H6lgu03hnV^6+}DQJ zRU-6v{23Y$Z0L^!IG>X=*-fwHHv4;0%?9^}n@C`BAy1j~ zWUt!FJ-DKx+%u>N;FriF&xfR4YbaFea&M%9Q>j2qPW3qq@U`D6b*ak1r%g2kVQk2K z`nSvu3Fx90-VLCZ0|7||L#e>`Eh2R9A0RJ4=TJdMsuvC9FZWeE3abAUrm#N*Fj{?h zl~g~P>d&Qm`o;5fb=1q#h+LQZ3Re-ik}X#7e$IB5$f~&_cs(KGRX_xk`@)m(0?v9x zu!|9FaWM!XN+sAOM9@aF-sq4o-m;5LMHgyCt8GQB4-QI_^?Io?Q>tX&`u#GpY2@9N zCmPkUQJ~t$yS`C(GJfYRT%>`m;MqO-1!!>mN|EvpOT!;j$YzF;X`?U8EDNv6qK6lC zqY3GZgUX9O;Flm?EYf%zEurMsMB#_|Jl-_-DCA5}gnk6ilE|3(a?oM-aNBb}d54gp zr=0yX4nNpbVNMDE9P}15mi;LTOOJwnb|5)A54&6;#g2krB)kH0=45*m^eveAY6F|2 zppVx+K;dL*S64n(T z6vCF^nHh?-sQfJiSoiqoTF2|N$0FZfC1@~#Bupatlo%@Ncu(Ca*J)36uR*kod>ib3 z3^nc*>`oHwk^?%Zu9KlVIsS%L%rM}J6kHis11$za`a1Dio|c85 ztq9K{YWYtg!F(@34phJ@H;n?X^OVaKY_FUyKUhweKSElma?{&GXw;6#G6Px+pHgwb zc1&h7L6Ff!$&+(pFYMA<^HV>f2=N2|$(Z7N|n2 za<@Cu(kCO8b!r+=;s? zJn1N%?ioVpr1LxbpG|qOd9%XqQ38NCB{NA*(mp)u<3bcLm2e1zoaJS5&sug1}1*(rSMw1jHXjh@yT-_X1P-A_WnQg7_jJ-W3oJ4-+1)9{=$Z{z-$>h_KME0=J#=TKphKeVFWAulnUk3}BGmc0HwQH+5tL;JC=r1oYPSiuI^Ay~T3zlPTn#gR3sc=(a389;C&v0p^*1r0=p%F@ zR|ei03h$gKye8lc6?h{cr}z}|%ZsuvXcR~E*Wt?KM|yL2kvXmp3^9NPD4-m!Vp($j zC4i0NT>T-1gpz^f~x`Xr++!lI02ET zQwzaGY@G%yE*VX|2w5IV{BCJ^(b!+Cpw}!c3+sL=@gIkOUlx9(x00b)?INk{98=jm zt*nYG9wn+>NoA!{*=QwXKD%b7$S>R&-TC?>d$4pM^f96(S|o+Ae+x;`SblYNN^LzN zfy6%}V(53S_?h^XMQzKaw)ukvSoY1lu|2=~1KaaA@gvsrPx%J7+VgjPXnOv{C;3qt z{(X6PHUrpE(ANxLl?qFHey)J%Jmms~WCt*M{sq#rOwU)*d?F(AdF^YxDr_ejtP2$D z&vV7U3)b^!`Ne|uw*~>APe&n)xFp;TefvQju`4qD0xWIazH*W#Ps=1V1#XEPNT0r5zGhTTWkKvqF*`RU>Q* z|6az&=4NY0oyjv9mIIBpQA8~F?E)R9si$K$!ywVCeE*#*3km#M4oVxPsdu>mOA2hR z02TS?{{AAVskbEjcG};pkC?;Qo)WvD3Yp=CZ$stC6ic5sP04 z>hEXrzR2A}r|@-jX_@&s;nQ=%_s6zXZ00fh4Ol^1CmAdXx{uh}}QnR<~R{RWDsFIVBP%6c=$pdiF^B8s`9vsO1;l*z^mv~Faks7+%*NjDy2z#pdIkBfpY0sKw@|7F0Z zl9D9DN5koH1?r-38Sa-2Ee7rIdB;J&t8z(-`7J(aV1uT^0~fUfieT*FjCTivacai*e_Gv zd}Kgo)&5d5W<-YyUq`vxWbSyBQppyUv88>7(Y{&i3)N=MdY_?JjA`U|lxjnEQG0Rs zSjJhxtPR=YZlNWzpB|}`v=}NF|HuEFDo3@m_Y}rU@Jq37Yl*B53h@c0&=Z$sQc-BU zBu~HRIEPbV_a7hw&Of#HfB!2)4^!v1I-!*I2LxvmS&x#eKjx*jk$J%rkrjltD_4Y| z{I=%VVDIvOtTyPf&|&VOb2kV}aLGEnxmK#exA!VcP*QD9E$m zN`Yf3aGVq<^mTks5j+RM^pM_;%8nExWDEga?myqfuplpXsA^XCZkP|Xe}a5rwinOfL&% z3OO}0gnQbm5o~`Hb;kMc2z;0O8dvGbUG9f}cbs}AASGMm9^(G!8xXg7y7fQD?JJM2 zm&N?gk6cF)nd`DM4{z9AOQoCbB@zjv_iZ`IqgZSe(o)%CLuy>nr^0t(af;=zIodIj zBi2gUB(C6aF!biuPz@sxAO#2=5JxtLcHn#tbYCTnklo(v6;SSSXi6dDh+ZqiRC|!A z9XJtJznvAA;(QEQCtK#lEct*p0?HlE#u4P>x z{nf6&AjMid!L!~pHK6`?fW%*gTlatP1suy;08+aCm4D$}mbn$4<$y ztjfv4rVf%31`Z>jUGBw{7eNHzctI)b9v39(bjQHLE_V`Fkx(P2kta`90i};uNi|pnel;UdJqN+`t5m=^3j28#^u5x9rQGLCxsh7#sA##VlzUUkeL>1ueK;Sb_L%Nq z?NWF$dHyCvP<0--$3l4&OhfWvfAZ#zvVc;5pYaT$zBYgzoGHZhCL}}oyS&7 zrYMT54a|!b=H*MQHETqzl-w=g@ zHv?jPmqKQIKaDIqBnxI#?)MZgoR3dNhSkaCJ(*=wRjE-6Fo=wDVa0|m4)9D!;b;Re3;3zYf5Fex>$u6SXdFd z(sT)Pto7T9W4jDv9!9g@a6jXddxa03?p|b}%N+#DcPZfyMFXsY2qjzOo@N~JRhn@< zHk2-T#%cGs^~KnEAyp9X&k`zXbUa9(xMPXNCu>wPx?Z|*sYWNGq$D~y{FbgZPD6P1 zCpP)Qe4`EQaUl4{<71Q8P#My-uh`@-(ZZ;L|Hk=31r)oDflC#ed>95%v_PE{Fe8HM z?c~_x((bs-MX}5}BB10GVv}pG>#O9idPY<*26g1k1>TC|RXs>GOtG=aq6`rRn*NDn zlWYD8`mrDd(XsHjS2*U=BRqC~ho5Nh=n)>z2}Pqp3f1yDF-YNV9@!v;A6_e+b@q88 zQcpv*D$|>8klxGpEg*cC`%SJQT2TS}3WXvkOj2h&vB~gPkMDr1$+5{aS;i$949xnW zHB_b;_!AX=k%f&ba>*P zb7))m1C5R^55Ft!_mL+0AiFGFrvm^%2hBN{T+Ht{rtCEE^AzeAFHpjSP+FYt&Gl*R zgEt~WzZ?O(j~u}JqEo)Cb?otVG(;8b4iwqDv@eB%eHik`DcDh_jvTGyaIU}CI;K#^ zlTwFxczScMI9Ceo62wHozN+0K`vv5#%N;`2-;q@nYz_iM2!|@zSrjq~_Ae1|mn@=S zXH!aNdrwAwKp?nvOfUuCO0H+fg^svFD{$9p1y^$wtVB)vItZpEhc`9t7SC~i`qTR0 zYn4tqv`kYM8WrW4iVoC@j<6MVxhI0kE>Q7x{6;D^YdJdqWB_BN&+mSm=Xwq$=gu#d zEJ_^O=RPDoqSL((@^`t9bA47R`YM$9yU?H!Uz*Nhv%fY3H6#80>AAcN#j6;lO{IFZZI9U?9#f%eZtvrn!8wB9R;q}LR8jEyJvD#)650AUs(}8r4hm1!Im2RB z#)wxDj|8*pJq#l(lHt(QsFh+JN4A4qd3Y&~*ljW!O%b*7BNeddIAWq!7?N7xJ2aB0 z6%sT}Z|?ZBsal2;g_Rh!axtQQ(`%x@ZPZG|BB6pz64a#dwa=1@G-_pSe7>&SXy%0Z!IyDY%P{MY+(m?hal@1YGyo5} zS?{AMcIYVXo}#zeA4mf?xE~9NVQnD_M}k$J{}%UV>f!#SQ?lefDUZAvqZ;$)FBEq7 z(6sZU0)_!9$o{^8s4?OKk$ME;)o~Ep4a7_PKpdtJzX8OB(vcRFu3wuoF!V)k8szx>y=-d&74{U39v)DEK?Mn%?lh zpOSjRn^#lOR4S6;2pOaA*{w1^8)1f{Edn*=RvGOuiR;Ph-&jrC>aL`S=`2-~->e9C z6L_lOEq|D1PQCDTEKt_VA)8lASH|Pfmh--zw&@JWaeVDYG}fu&Me+(&BTjSYyo&q( zXmb17#V@WS!09l|eiZ#}Ui;ej3dZ3xfPIBmo|8tJ^LhrzXlYLle2kv6{S~R1a2B&v zeV_tTJtz~Gr7HdIc?fTpThG;y@N(*S_&{Xs5v}G-PJGJ#EhT*&Pw4~VX*cBFO=Mx| zw8|_`wI?8xY1F&BMyj87hqOO*m^S5dq(qw%c9+P@&g{detp^wU#F6|cE!q=0fZtj2 zyK~|+$CBgW^X_Ov46P!1Z)S zzJx>^GfqUWJ1Av)2Ty*1;BN7W6lLemg8{@?1oC7Y@Dl^fs*O5}lMpGnk7iNv961qd z5$$RVmM|w`Vx2E*CbKupF{fW~Xc#NEqD+Y)t`!#$qeJ8`i=vYve6zzr@_8Y-alO6Z zYrhuYGPw9Uz9he7Z7BR$_bT~avg#$ zvBSjhw@4`%*ha+J80?6fHGOp>uh)^FYijITq!EL9o} zHtF8sy%A63YyinoHy+^V#L-slg}&hV;t<&cpKjPa@k~&bpcU&9IpqMUbKC0F&P%a> zIp6ah`0PaP68W;~?(X^8@}ImSE&mPIAMz6W|0Tz{5!#e&k$Z&u@bwfd;|s1j_@_9Y zH4Z+K9)*9lfq$mLKR*h;H5vYWR|3C#?7rY*foH}1ImVI?e}LoY)$(~18Q{=_!9%!MdO z*lD|kx(m4)I$!ih$0>r&-OIEZv|Um54?)4#u}O$%0!458*wcw$)rSel7@fHOS8CT$ z!wMjZQlu>xDhjlPa~OF_SGpP;2@oMpiy!hQit%9XFY@lY+G z1VdCzQnfWvWT?5K>=P;k=YO`5!JIe7Xz)eU+#o5N3{Dn9pNt%HCL<`seJpZwx%3n| zf1E2N*45tBeUMpaNi*CGIMe0&xEd;seG#KVdUA3d@yoqlZ$e@JL0GjRd+0i3uI*@5 z*ke#g-jLws^uWcOYY%mQ1TU<;%kJ3D(kzZ!UBsuPZiHmAkGpd*zJj{lv%?=TVc1m? zev#?J&XVvu<(+lgOTr&9ZP+?H{DwFlMQd_=cQJIUKLh-^N1tN<`P#>*Fo-qW73EgwHWN!Y3SeFry74>ZpK0Zsg!FdHkhz@}8}||# z-xM{6d$V?H54dxek(Z(rL;La_Q^?_KUnd2N+;agNT2;1w2Xgp?94jdnTyO3$L4@!= z1#dQ7y_Ti^p>tE6IDg!$3sHj;I! zWWCDeIXKIPYn!b?MCNwIpeMUDY|56iAmA6xEwjyg1uY2$IjX#Tm0vTmtOe>gIiXxJDpH8-8-lMuo6|AA1Oh#_0VYV z1(d7Ij~u663Ie21copF{FfTaAR5gK{Q!YdC_f?GCfpjJ!14fb%{|PI;jtq(Bn3^s; zKvwb5clWF{`7jl0S*G~n;bIN3&rJdYrZNvQM_!7d840l6A7QvUqV;F{pA~xM4*9(# zDZ|kYD3e!vRf4`{kUsh}A>50l(@x83gI>n)9j}HjtQPWqoE)t#?iQk{4kWl&28Aah zSIrS2!N;F&jh#a?P$)^?g0+tL=;(no=ckY<9^*;ryJD==K&2(W5vEY4v?BbZu2TFy zvVDf2XEaYa2Na6J=$^~>=KG>_94hV|QE}!g0$6=10{}z}`>gdRSK;XcWYyRHS7uCd z!XdV%{KEG}Pr|C~ewbUdbYdB-Db zMwP_9BGBZK$hC(cKu7rQdF7B+9JxE?(WN+vdxo2v-rP~tEsFTNKDfY+0#~GpgbdOIjT3e zR&-ilEXGcl3F0=!i2b9XF?G_Zn`QBMwH%tcPTO*)IeU#Y(`)6vk8B%_-{*0f^E0;* zDIpdQlZ_=08gqzXnQfdq&n#oH7(p`c?QGsH-*M?&jUDt>d1uv5F@nlFS8v4%%Hcmf zyde28LoXB^=wvSHyAiyQaCqoHDmY>fb%DT zvwMIb@L1$)QY_iR3A=Mm@zb>U!f5e}DE?O|eybGk-OiU`N_%sMz-l7W=9LIY7OL7U z^ZE-)D-Vw=XY-Q;rHQ-|dM4wV8PDQk(aw<1I~dZ_xZIL0|Dz;%c_%TGVx--xwB&m$ z;fT%XIYlJ1$WNDh7nu*2%u+UyB}F~Hj=yT>P4uX=jVRe76PPZyjlxqX%$h{vtTy{{ zI32mZSk#J)B@z!-O6D&}X3i0RGIElroFskU<;s!hGs#mT2arND_hsoUo$fBcF;sSw z(4Ee0mGRH?h{&a*82uRd=qNj6;9D){tE{7Rq~=t0zaAIsJld0%@TEQXn?U+sGU5Mu z5|1QRcDHleNAl2!rXJf3weSTL{<;ygV-h#%wpCjbWuEE z^jnB3kkCL08(P0@aY?Ep_q)HzcxH8tBpT#>zo&ir-WSg|pTZDFK^4Rqz5>i+3lZhv zSJ;~~JNz~~a;BYA8DdwQ`^qU~>25F*DnGB|L7C2GaEU&c#ve5 z_=|PB1vvJs+WHrExnrZbi^zSG5v`@MrSTAGX+DZ91pR2p$RSd>a=`yu5;E14H$ zsA8HEH!tX6qlLVYPRe}XJv$%hVIHs}HV+ufTQLg5J$*+DvlZuMOu}U#q`CS`Q9lwq ztVOt08pM7#C?b*gVi8Vb8+)GEK!uowi~(4LOxm!xF%09UdleeMC+@w+A|Id_dKl2f z6^br+osOzAh;)&ZEFUFXhR3lp0DAd4o?rqIXN<|i?qBf?|KASBxdepSAA%9{v`~9P zrrh2VeerW%JR~ndyy(qcLsLCV=6Y>v_5n22STZ5@0gDy$D-oGbWW_vsAk9s*Vt$#! zqo@^g7WJYe4`u%!sEIrg_}k?k40gW|?4D(8>&-px^ANv}N$kEeo$S+Cg7LM_q!kh% zo(DsJ(Iu?XPer6L^^Z=J>k#6PT(3Y7@GEh>TxoaRqmJ{AAn^^5uuHt1RB5Mx;C!ad zt2i$u`+Ji8D6$JKg*t(klyAWG=H5~yMRiQzlLRB9)r_ayKc(F3h&f~C4px3en8LZW zP=Wm?lw&Q8GP`+WPXRg{3}s%NAkbxa%8OBVrRx99eFA!?m@VHIYp*yPeA1aZ-7JuTzg*WTktcv!j+hTq zw3EA=rwQ?1W=&Q57(NgJhtW*{+M*m0Q z76ErUaH;ttk&sUJT|}UdP^O+Pr`QO{i2k?$*pQulAtQPniwHfZ_5qh9(|u+kVDr6` zfFe7r2nYVTekw&QppD8xGms|EfV|BB@e8MG-~AZdPR|yU@9xCKUh8!X}W{8FVYT2Yp%C_^jqab2zzjisU&q@q$&k=e93SoF6nFLhoj z5i6zP3Rarp9I54^{a&`Gzofm}Jrl(Q-AfVQF86G%7c1fo+Z^XmQLWPPdvkB4q^uB9 zQn@wSlp3L>{LxY;QR)aOb&de<9jw6~Z)&aDFIoM_erc*ynEf0~>vCNR93=(5LaiFy z!**E$M5?tNyX-{cS5-6M@N+!I@OJQ^bh#Kams8|Kw`O|0Y5=Nl;3qFHj9XB`2!kfgq}(VrXwK zA9w9J*lTZeRiyLMQWga<>WgJvs8nqHN?8|@mB_d_Bz5j4o@cYB8u-Q}uOcwWx9E{F zbe@C-ePCjOxR%>Z1ZN`J5{qrO0nE^C04a796lfQip##@qT+^aoWuYZappeWvax*4@ zhXirx4g;22*uO{-l~jf`0~r1(7@9HQXDh z?xGsWlDkeGNd!%%(uHHC4md$X>t)&ITqh8}V;~MP5QljX!CWBzb#)BKuNsIi%A*7vFI0$oA^Tb&ngFHD&?Pc?2gL1? zKb-wt8bW~5R|E)+mH?&e<;@27>s96va}N`sB#kG&P@&!i)NcZn&Q>E@rPE#VfZ%^2 z*IM$GY>_LSX*Pf(&S2A-n6Js1I}*F5s~0h8_2gHN;^D*vx`9S9OE&TnU%Xd(yIuS* zev6S4-`*CfBi(+8wDEr`$L^i?3%>VoT>upPzewKaX;H}*xd-!qR)P7PL3W9LzvKVT zr*LfA{U440E1>Fq#Q)8sg|Ya*{W7S`nYgv6;|2 zV#D=`|EmlrM5!;jKj_|@5IkA`jod|;g^mCF4WE(_=}!~?Ck-V2Pe?2sb^zEQ$=XYd`HBCd0?-Nw5L&PCfAWU-KdDm);&m@UmH592g6B-2jsq&)E0YdN_xcyi zBmR$WC*m0u(t`mUxpkljY0rvi@A@S1e{^TS-=g5}dm>fmP!7ybKq%OiDXI=eaR`}1e!f(zBze`l0 z1B-ke0j^^1rHg>ky+YwW5iomx8I6EBOd+uGW(sW7<`ma{>)1^D zb>g}q_uKgXOjzJI^Srpet*P?pOW_8IHze_}Z@raXBvPT4{ioXAc04!XKki@1-@TBS z+$h1h!u#<#)~x)FA_Ok{H{7(Ao}kB z@EkS_%F6B>opo=OA3E#4TbXL2|GqE3i`>an?CZEfF-eX9Y*Z{{)?H^X1CM4wW_3I= zHY~78kf}4`_=KH-r;G&@M137gnSpn?)r?&S39?@Xff5|^!~>p_FN9W`UiLK%70K+( z9tfkl+!M$@n*8)~Z-x!Ibt5nn6Fh{9CseBFyyRhm0%whpPh6ID@`+2iAu15v|7=C) ztcUZM5k&5r=uwWqPcUHoLspKZ0{Y~2B0;QwBB`8z##KkeWFbkOG^8@BQ!ek8hyRQN zeHQZqKr_%juo%_y$B#em?S2Ivn7r}Zo1CPN7VPSNi*miWYsUf3PJDM9r%mWWB)Z(+ zb6up3>_OUR3)R1x^08knsL^9ruu4RnEVmcTq#U>2Pc zhKu3fi`Bfxcf$j8(xOxL9)qZHTxroMjrwcruI?O zzOgzpioiJ_&?X36ZTo6M%s`TialS`n+dn=QYeCx7EzDv42Lg1tqTA2YHVp#gH3IS* zM4$TFF9$H5(s#xf8zh{2+fR|ViJt>WD=fDfI5#PrO>>9j z04Xnu_}WhZXzYNlUF1x`f^H?|F0Y#DrkcrGO$k@5BC1(L;U7vhuS*~W=h#z+#{wJ^ zh6Ts(lLgZE^DQ5?2_Fcd(nW*EBEP`6+7~lsb-8yVT?UoMe}?ZGRKQ|`h!5XC;+?9} z3XSp*2j)yg(+lh9o?>6@i*LYdI~qU|zZ*$&>_SRak=ltSBOmL1>mZ-(j-K=?21s;) z-up~Pk~>Y}bxTXpgoS!`fQ&Bw67|!ATp{&dMlB6vs0+^Sf#<0^47hU>lb*> z_i^rWoNbKYC0pbk1$O^@1nSTaKQ_U_3A;|klV|=s`zLn1z=dZC{+K?qWb`=k>7!5* z3CG*AX7}$p;r8PrsayAP$bxy|UZJ&&`Nz=4=v?7Q;T>37^FIEB+Z{iN%l82-kbH|F zps#(M5XWvIy%Nd-H7`E*W0D)|2{pJ!N>zE87fR+0?yz~L!}3Ze4VBpSi*BN$G1~eg zml7soCJm$L&Nsu3zce65~)1KPb#-fhUeNgm0hVSr#R zhezi_CHe=3+4WQqf5PqUl0{Fr{a?+jC*1z6&Kv?DcD^~`_IN;I{#Q~#;t99YrAnzj z{)F4nifZl%!9%LQ!!OmJO!YsedgOGksD@7WZ!o9J?d2*07!|`0D-px5y)R;DKW)T8 z6FT9RBaUH&3J#CNA9?#fFR82Bd}LleF`wK!AAh_!elOh>Z)_DT!tR{8 zBxZWRkinC7-O(p!8H~N{2*}+#`8~1ASP_meSs>6@L@H}q;bocS;i|0C&YQ=`UXa;r z1nM|f1tR^VVY8Qum51vv)8&iz zW-k#X=>s?1NzvG(;UR?-9U~6buIBoFDjYtHt5G?Ve~goT2r~ZGV5yktKv8zCBcxCdqu^#2kJw+{s>| z6EpcuGFGxAxqv0=!4I>pJ4~|g^|fE-3N^g>!z6(cH-9*q{w4DV-7wq>fh3mx&y+0< z_q1Vam=TW?IynVW0#jKhPpZ({Gc;Q!5J!W5+l9tVmnA$A2gc1O*e0W!hrC&XZXDvU zC~-OzM}9;cytTENIy_CQ)(U-PT*u_`wW|`s`-H<#&<07s+eGkyeqk zSXZxD$h4tSuwdpghl$I>GI7zlg6jXcB@+f_3!IVsNDthp=(}cT@bh(Wco;K= zXZBMFOPA}A{c5szxzBPhV$@v?Tg0AYH__@m zIkj~#>vD#0N-i|3%ob!n5n7g+0>7C!=y7glo$jh5qf|S#%l+05i4LL)Sbu?5?Jm-) zgI*iP#x{}55%d<&7h7mX;hax z3M`%$x;#Z~oRVFXJ>+xrjITYIu#6*%u(?1j3xDNCiqR2|qnz*{CYn*JzfdcVcFHSE z#cQ?VtGS}&sQ8v2IL<3l@i|m%zs(NZ8sMgY`J(bl++$(@&xk@1pY@*v%4V>Gk}n=2 zYc}tx1wO%xzdl;KI3eh=ezhxkLEGyN*kncSNO1RcTm^62&ZsRu2J;=#EMPr{H4U=woVDcmU z?iwY(@1MMt-$j7qv{5r<#YW)#1#(8GthFN7eE$Y9W?vOoEE|4Z@qNdcD2))6>1z){ z_}GY0M+;MQkzWBfZpu2;Kpv=&59B&eAs-9mlLhjt+|prw2(C%<)$-_kl|VsR3yxn0 zhE>p0W9Kjrp-w>W zJ}A!l4_phBh_8OvaSG`IC0pbk;I05)tiV}ONwMKE4!&^MgC8{TFHramQTSIT!~gDV z;O~9I&XH2VC*C11(FWWo^>FUyED~b_Udt1dV|n;hS>`L`>?TPU&knyu$aP8hrP<X|Iwdk*7w z4uafFEKF1+p)R{pQnElO3>$nMLB$qle|Sf?9z|H>{!%K&fL@e%XmVRU zxWu2BJbS}w1Jn>`AT->DvLo7J09;Ko;!aFHEzOC^W_iHZu~uJF~AtV7uIJb2U8s1*MLaQcI+zOpNM?ZbRL4>A+7grO@d? z2L98qoMl@hQ__Y9^R$21<%tD+{}w2dfWrO`3mFz3qcyrm@WhiqooPrMlN^G0u`4g+ zOx5M`D|V*pVttWl3nW93ZBm5I%dw^2E-54~XYx}-FtZPZMiZ901)(|_S~600xsM@+ zW#HI-hwx0MFyLQS^pLOpSZv%#)(UYZs)#dB%a-#DB@(|gTl59z8*rTtDE5Z}r%K>7 z0mmMr`$eBLKxr+Ll?fu+o!MixiVnTQN6Aa2voBIfN!jN$l);llRaDQ!8t+`f+W(2MbpieI8)sy$gGw$m*H^Dg&PuBQk^C1zST z6=+Zl&Vxu`h?1DP1~ zm26q*gTjkh(l}0wk}u$aU8E;lzl!STyP!y*tT=SK-_~v<{+3SnJf3#HL3=#7@a^k2 zN%Q*bmDmaOttx;qX9HxDFs2C#{c#wtge#wH^=Svl8K%ra&i1w7(ZK#ku)5nY5@0BllNq+ei{WxASHR(DrX)RQ5U#dXExP z-v4f&?~~$@nGeuU>$CLy)F=3MXm9TQ!aLRQAtLZ)6Wx_LB7O`seBfzdj~`)@NN~NKbZQ!4dyl#;S#)hkCugh7eRU)o#}WpmE!rc!weM9m#qI2 z@z{@)yyxKk{axsw680BW)Kq4^zpH%U?@DX7mmmGRvYH1^509jm&&&~xHSmnA_euu( zLPLFbmkeCLdr$em?d6lH>Eiy3%k(Rpcx- z>|9I9LcYobL@hD-kt?P$>~Cde9=@OFipPI1`$vJ7)*_1h?X~G}Ih&5Ze4Ea(>A5y- zwCOcAz1^nw*mS2&U$^O?OANe2ZThIKM=RlSs(pU8O;_5~dw;#Xzs06^+Vnn~?y~8J zHa+-KQ{N<;o^I2{Hud1X7&7_Zvgt=Q9oc4{A7#@?Ha*>@7udAfrtLPp(WZCW^kJJm zW7F4c`jJhCuQc@>Zqq3?on_N`Hm$YkWj4LurnlMjUYkB+)7NbJp-qR&p(fr+O)x@m)Z0Nn{Kk{-8S7} z)7>_G$EI0p4E#fFI@PA-Hod^6jW%6p)9Y<|n@#Vs>BBbNWz#oo>R9<4Vbgq@7Ta{5 zO_$kprA@zN)7x!&x24Z*Hoe}aD{Z>Wrj<55)uv-?I?|>ex0-hEw&~+Gz00OI+w>Zn zhHSdnrc-Qss78a6U{hO&D4&*Ku(2T+ z3e-2&bL*_Ct`7xPwbX}#oKn%y)Jo#iwJmj8$x<6!R^8SR3fRJdU`tC=3-4Q-YAy;= zxV}ls)HenJ76`Re*94bV*IdN2rnW|b-56Xgi4&N6=G@t&1{YQw*EBm#OD_!8gj$`J z>Qz9v$XNs)XEq00szdcnjjg9yEDHiP)r~d5hJc_cpq#38rk(3-y2++nZK~~Q30BvV zw{=y0sHTqkmfE%fh6h1ugGUE}xw5*UP1@bosHo`fsOFaXCaAJT-b?$XOm$7Dex+pO zFG`cuHF~f0HZ?|T2m~N|uq6=Cx6mN4q8ciBx6mRKfX;!&rs|gEt-yt-*$6 zvHSrK;Q*Mes24;isK^4wS)pSf$AFQCiMyzVsOeDX>EP&d?n3n%TVCh z=YB&oe|=-9$v?Jrx_@koKR>v-8D0fzxf!R(aR~^+%4lJAsHvqO)>?VomyhtGrDloY z{}OF?tQ7^#LgZvV_kq6}IfZ%^2xNV8Ls04wrUY6;)wH)UxGK=p5~yuku|iqqET{|m zjhy=Hs$2cl4I&e3{7aF3zsh;7f9V>3bz@TqdGLG0wfzA;dNQuy!O!-iKwGFDstR4J z8yY~UhQvs{JeB8`1D4b9xu&h91!1u7qk>~-FLEPq>g7j(ioK4(Gq1nNd-zzrA{gW2 z{7_S~AwT_v_cNOsZ9Qjd&sx|TjB-~bNnpsI*8`F}7W`-o1%g(ZrM~7hs{<=T)k_<+ z)|mX6_64PbDLl{?+FBiAo0qOXd(8!YDA;P{vX!l;+(_~{XK{+Vk+b--B~tf{87z@u<|i+@>5@Zz>$W6c_Q#G8VlLz%Gg=gCEqP&=lB zo!J)hRM{fHmp5rcFKnt8mg%1~w{L$bNbU|sPsfRe;ZIFcCZmV5jXPQlE1e2HsjiR8I4@!7fZY-7T+GR?Os@tNk^ zobaqt^KD6drunueJX@gowkJN*d^>p-V%?&kMcQEaC44jYW7e)+Tf3BII5%Ek+tCuL z8B_QI=(F+ilZQC?)PwCDffo9llbWr zugGv%kMf>PmS>B37RQ4r@=WZsJ8@jtvM0$i2Mf)=h-U`8<9{y0*(~)hZPl^Y*~6E> zQ3D0dHiI+3@NxOF`r6hpW+2KL;8X#spoI}|OyLOvwu)yr#-1sj@_b)^8N56&H_OQl z4RLa72Rpe_206Kt4%|KHa7RSa`7Ht@hk=T`$=`v#L5{CB%kh!VH)&Y2m+vp+$wWx& zZN7{_1DrvV22^H@%yLGOf8>I}&Pd9PoRrf%Zc+<-w?@{6PnC z!UQlRRT%Stp>+<9)|oMcuMcB;Wn^VKSuL5(1FHrU+WHFR+1rK0~3;5a{3x+v);FvdW(%q=qk}*x^6}TZDk}_%{d{$=lJ_*TTDMK)ILU= ze8{=>l9f{rribIFz3&f>@B<#fkLHZ{-y`U^ z3x?BohdCqW9k6G3^Dx7&*M>U&682&6|ArbvoA~<#82On_erS;Bvcl1a58?yYV;#3S zvq~f|+P?(9rS!98J(Z02@sq%OwZHlL-*9Q;Eat?y7 z2SL|^=J|GKHxIAs)AsmsqOWJ9pieTrWE`p;=HxCIiVkKxns?xC)0eWG%?mMc&c-HS zxnE^D?mlJzP#rn~**p;0%yIJWva*@3Z^z@iXpplgG!&T{<_v8aRFy$YV%ChzJu+?_ zd3cs{_-mQYXms9zwdfw?ej^KUhqn{`p}1jT@!sLR!+R&`eM(%DZo(HA3dINm@{~fyIY=Z=Gl=K z40kRF9pWrlaHw+(0hOQIHX6D4oRc}_NT>K`j3xYEyj*Y|z(k=;7tl zbSZo~g7Ig{NGIp1;d_SePUK<6tSo01W2xF(lZNaW+&rjKW$d*f&gSRoCV%AIntI!> zC=-i93<%5sK5gG^{w$v&ua z`M=Y`h`%3w=pZNiF8ICE-8!(@jF%$AM;<-MIr_C+CkGob3mb9whz#e5gEE|v7a2U_ z@6*{BhR37&$Xk>~B9r~mTIK7Yl=8I>Jfkv!&i6e9HFqb4eJVzye z=b)`RBY|$hvn?JRPd-UUj~j*^e7G|zgZ?5Gb5!e@GAi4t_&R{OOJPjz0iE#oy!Ch7 z#e6k`H{SnE+~3Ln&HQh^if^=$iYHEdHZiwWK~3}IlP9jinOwc1_M|DePivjZHD$Q- z1Ibw_UD+rw%-_AN)$CX6+{m+ZfB#)qHMIHf zx~ieWf7ewF9sawnYUuFqURT{VpmNQ8UmFat3Uw9F%FOzqNh+FZf$4On zeqPQxOoK(3BW6q+<~Fsg0D-l^DAxEI<0xFxYH7`gYf7A119@6xJ?S0~CuM+#)zTQx zP75{$Tk30|ud?n);4YAL(-|x~2TFr2tj!h(-Q$_Du#pvC)~joUD@Rj<(0(2Z)GS2U z6|y&ZS`lR7r&dYhToJ3$N{J^8zl_IF$mdkY@}4#`u&`0^xyWgZJuR(nt#huYoXS>n zOArZ*ib>flJW;elMCR8kR@Q5%^Dn_rnISpn!bJ9>L%&(|HK71Ye<9YETb+kg z=H@mv2En(j296#l6l!C+R2z1iSAtft#1@tD??j)&H)j!b89C7|La#Me#9*_nb&kj$t-d5y=e+uwx|uBURf}vKAH~?T>@I~rr@EolBUlC{ zEuHBko@~D@)Hm{>1s~vE`;Oj?i$aACLRM!z?`=Qgk%1?iV%8y$qI@*ZE{I_}hp-1e z!e?k0?Lc0)cjoZM>*oNjWEoNExg-W*Rz386Css>IZLQaeKr9!MI*Z_d#jz(d8-mp> zi-OfCt7WZtB4cmnHi7qTw9(U%(m6d!-zJnm*_wXS7Hc>4nsySJF7!e92Ik2MJTu%F zY#Jd_<@K&RZOauIXH{ICvx1_Y<@g>bAc|U4m~$%iMX4m(QL1U_8{9IR&R*)x6HO_gN=om$~#%}cRvXyug`+CxIHciBEws{?v zsXVEh6pU~;`LyfNY*K;)IDQ$1-!JnNU$Gwl4CR!6mwDn1!gzaQ7$7&Ta1;JHvr+9Y2sQcTbgQuEQns^E(o@)ppS%t-XrI-fn}}srm1C4uv&1f zYzekXI7~_AS#80VHI=~@A~9A-nAc2+8)JYN-4}XUt#er1Q!~Kx(22-X!}JA==q0T* zASl0_!!u^pw@Ubm$y{E)w57TQ{n^ma>QoPuUQn;ydA=yHQgjmu2WaB17}<-ryY z%QI%rn>)LF@+3p^EN0^~1FeKZAv-kzLp(S$mglXZ+CWJ3Tz%uRCSvDWLoH2f0u5q{ zI;T1-f-71jX722n^A^rsP*ySfgeipv=1C@Af`+eP2bRW8$nQW9+mj%$x&UDmJO~KW z^PE6UQ{%Gw<%1&AM8$%zN1q-m1(D%iNPzNM*gg+?DuNyvebAaNcV3d0$X z4lz8-L6v&!n`PGKb&hff3BiQLuuUj*IJgjb1-k*{9L$~ma0p46xS~}Y6cc$rkpL4h zwI(*4F!6+mw#n(72>*fSlWu!?;x|~seBylnQ_G%VHz0pft;|ve@c(!}m$*MOdxOLKf5zl`MSFU~FgeJrLb&b!mR8mUf%V`HES65^bseEfsfHLVHvecpp>eEzXmE?%5dGIP?jJHEK{ zY4I1@eZu;a!|>=ui2<*l_Wsl2^J&Wy52>C>p^f}~+WU0)B*YC8kLuO>Z_2+EZK*L| z`wQQT!u>bpufcwA6l-KZ;eXQn(P-vaq_5%Ue%2Q)zu)<76k>8b;-|g;r1gJR`BTOB z3I#u_=jrfF2miCmF9Sz>*zza6Plrb`oc+y*k(GAeg3vo1oY(@3j<%mVpNGE}NB(K= z)8U;A_p{39#ff|H_xHZP`aL+GNj`D83RC%0JU_wxKI@Nz^O@wcvGGwnKf(Pz>yLx; zndFmpTbNOL?&tkJ>yLxGzxi|khhWkC-WH8mM{O-w9@|{uy)IyWR#I8E?{YE2+uI@( z%P$QNw#0)Lwng^~^?{#cgU6xtiOMaa+P?b$#9s0&2L%_yGpXJL`-iLv_xVj`x77r* z4MOH)MBqZYmyy{in2A5>{ zNWky2r=1;0($UVNn>XG_<7Dk2Mx1{qexmTwVP@#0_{EJgdLO6Hqwnprs2-FTG-Opv zQ1^8GXWFAk?6X0NZ`{7QWPE4fEWd~q)#$z`ki;Z7t@6A5pK&+iHpOln|^3Ch+ar@cieUx5a#W96}S7txz zw>y3%ul)53uOECpGz_%;sJ|b0F@_q5jPvnZHRI&iyziS|_hFmiDQ*K^a=t)F0|}xz zqI9tRJ~@B#{l4~r3T83>rjujx*!|j)KU%-o8&Ry}dE)+M*_|r+(+)V3PDm+RfwY3< zAD?c-l>w=tsk&D5d6}#jm{oOu4gUD$L4Pev?7CffBAYkav$#SRT>UuK{7sDwvIp3& zrEASDXPnydBMOC0=xid@HH`wXzf4Wu&f9>vw6R-SLYZ z><`LTY-9jfcC}C!>6AkK)%Qu^wN%%)2B-TmI{lOVE81E^B97JmkhlHc4<-`9;qeDn zg~TK54|?H3{uR}0l(}`)E2U^_5P4%2#!oPX9%Gq!hGq$q zimm{fn&S$}PH0<_E=NQXyP=y_Bo(R-(a%`w@)$FAp1-xOsjZ7%L`DT2I`G4w`9#Qp7+uWU_QFu=U!$h@2*&nUqgr zwyYYiouGosLUVnMNas>khFjLaeA#o4l3H5d!0{Rd{@EUhgi$J3GyQd#&%qXpmG{`| zoQ5Cu<{S&ZIiUdVwXwHfc<5 zb?kgd7_f@JFfeIaU=sFS9fMY_cm9F0d7r#bpI?sKkP{bHvGTlJTRH*twgweoPFq0Q zrG9&!MN}iwL-q1jF-igi9IXz_j79T`aZ=!~n7yDhaAx_el6j}iH?|U1 zE#_}a%;-Ck_SkOjwN(zuS)rkfLPY*hM){ocGq%?1eKjKJh)w5W1Blp0Jq z^vbcZ;i)mW9EoL|_liezdJj^=!|pcVup9ObPjZf}Eg0(=g6Z_D(J?`BarzlKCG47W zjO5f7I}JD%vw)%WSbuF3_Jim~Vn%D~{MG`FE2NkupR>~6y;Yh~;8*|{;8<_g5SR&x zTIwY%$#1gS_9w&bACAY;L^yrmdqbb7Wltq9CrFEa8Go`yUOEzqFx)~rCoV5tofiTln$PtASGrxQGos!TQEg*eAIFkMCDl`rj~t<+O?se z^grsB(}Lmm8$V(VP$&dQg` zXk!xtta0g|B2$OxogC+MicaPy_|?5(ZpIBA>gP|LNzs*=G?31-fEAPgKYyHm;;A}A zF;LX6r{ldw@k4sg^Md)ySy}$^2F3A)EOG{yaGzZ;9r&fMq@we7XKZ;IOS|=!w)?m;-U3$m#DrsYtg$Xc>G_K#PRDc<$V8=K%}fxo1=nLu|lID7LOQ6bGTw^CtM%@tEv*jta&-kwrRSGpufIpy1xXm61O9xaZ@u8_3%UHWlYo=)mN-gcNnr)cBc0d zQ&jenP^nDCv^wdR)5T_(US$Ve=90kz0a;MrWMpx=*L&jB#dPgf(ax#eUO42hH=WvM zm7x(;*&6LH{u$9Gp}76i)k`tmBbqH$73=k?Sd{fK5b$+PQ=93Q)z&DH$)WPa;)-Kl z#|efD>-$4?)DIAAwyoQ?+tyvMz$jZ!u}oJPX!T!av(bYJ(z#)$`$0`q+W0uhkJjg% zu7-a^op$=d^z+^8%(&n`&7_&$z+h7o$=cgnoHU+Py=3xx*(2XJ_k-*MzfF_jdHMTG zRsVc8W6{2#dvAvun2AZk`u+n6z?$ zNj>>myu;jkan+p3qU9y_TK+blYwpcm?COnkMtA0$WP+!*qQhO(PO;{zqvgcPNn_yH zJ{>ca;>JBa*D_7Hf0IB8rvDjv+#e=G{zI>@{46plr{?Hi@dM_5la&L<%7Mq{EmjVu zTDx}FVv~QgEgwxXj3oG9G4I)asPb@7G=u$N^X<0z@@zhj&(Z8wuy)yeTWvl*@R0at z;W-w+&_YwMrx&A{ZN7C@k8Zc^I3SwA{;>I~to>ehu7P(*ntX*eU&P{fa-V$W!HqUw z;dut$lr;Ia+V<``+vM~36wU6@Z?}2B@f?$;YsW^Luhim~7X@U0Sa_=~T{hW#9OIYx zXY-YM^P2whS$^DT`7tID8XGkXgDWk(Yb~9RPLuCOi(j2>@1be(t+wsmW#J7@lW(id z_jya_bosV>^t1Akjvt$CzDk>KNSb>69$hT`hNsE5)5<}XZEtp(e8pb9md@$=+g=Or z(0=;IMoZ_tHeWiq^6Zh?e&F3`+dIb6*&83C&9QQjZ|$8rn{Q||gZ<&n>W92u=&!-%O*>|t8F{d>8m}KAI-KMoL-jrXWQ#o{4TL{ zPFJtrlLIUF>H7Ib+u!!ud?ONTjrPlY3va5$FP;2V+IH;j2VTVH+hfn;O-GkJn=i}K zFC9M$EuE)Y{-%|CD=$tz@|!{0r&-rfDk zOQEGpt(CuY^1RE|TW<05?73w8w%dAdwD@tHY~r77$745Z-fJyg-sq9@}2>nqQO0G@xl%GR5% ze=N56t+RAaC#Tn1IViPqmDV1z`KH)>>G)P<>%GzD>)Q?^2pg>&v|Bo-)8myk-=P*> zI{DjV^Ns8WzZ<=N*-!tdv+%Z9eUOtz{vuYc{Qb~*v(2~I;+GEICMyTKEnU*lZ-P_D_ zPfvMpJh}GDC+y>p@2u#)$b9*v2TqSQ%@d4wliy3nNtumT7`W>SOzP=@oxe5rd%tbc z%4r54tKPio`c3yYf8GXD&rVBk4{(*G*VR8V@4e^A>9t?7@83zJ+fM60^75x%#fblY zhNV^1`>k$w_P&U3oxKd|6F)@{0kWz-o>e|&s0fJ&EA{jj&zV-D;l{nt)I;4qXt<^QE$<@(S zD#^sTI{4<*ft=8Q@%Xy!>R5rgm^m6n*GW7NSrid~*p(-5c|jLU6lTm>&kBe(sK2eI@Xv&@9x=Rvz%wC8)vQM70-!|q1qn#fumPys)Yif= zA~6?!I&w^kuegL$W>y(;*qX)*bnvOFlGVzpssh$3{qo@^R&u0KL=6g0DMQFd4JgEF zRFU%ZyQi1EakU?L6TT)2TAVP6jM~-EMAv^l!K{QHXi%msBZ9Ye{f~<-m&QrR0;H?Y zDyzrLw#HTtI+OF-YW=ls5|T(8rNt~(#I;dy>ATM?;X7N2?O^FxBsrlQZfDocVSJtB(bj>XmgDi*RNO+MfIf}sAO0|chE*gRo#v4;5 z^dbO-n)u+8Ki_^hjz}#D?l7Nj;{lz=pE$Z9na z-G<}AT1!63(Hd-#5zN1elNeECP0h^-ujBBr$~rM?y!5DOf(Wwn|JpnM7`dt{j^8C! z2f<_#39MLPfHpg=+jfej8I~;_K+4ddjL{oqDPc?+S%s80 zvoo_Z^WOYOfH(n!fmGN4e+-q#Y8siuMi&ESRM3?`^mE?3Z#%o}hDG!b1Dl+DzkA=E z`|j_1-hJo3vsm$^@ODp>TetN$r~I-AoanTRB;D`ZXMdhe-XrP6{39`X{3;T3v!FZW ziE&`xz#a>0eSUdsi1D9vRyy}?dNZ}@WP7~~9yT%Qo9g-$}*J2L?EL)Z2N)LQE?%n8}N&(>^&L!4k%857_PARyj_R3%yUY&*ZjS zvGDzUttZD`bLK_&`EWqbyHh`M=FjLe&UII>ZOzjo-F+C3*2mrbW_RAKy6+|5oSRPd zaVLFO4_{25chh(G^A@|$qTiwL@3Pm`>LdQ$KOL}8VjF;E(0v9{=R@La1)5Y2n<4wBpdUSdk-E>@>((z*YIk>9P zz5ZVD9na}vRdmA*wk|CLel(%S&r43e-1)0EZ~k)UpZVj}op0vnYyRgAT!nAeB4ROJ z?<(?VKYVc_^1$FO4r;B|E8S`_gR&=dj)XYVf49~VWT_R6VYR)?tw#59W7zY)T+xfv zYHio$S~IYKiA9#Z;<%?U(fo!-_+q3S;}a`sc}CL~pR;-CwtwavCA05=&VunI${YG5 zzhgDSu_i06ZEYv^diGO~UQ*Fa`)|E@aHpIllhfyvMn7owXa!Los%_7oT0gYw)9>%^ z_Tew|##NM%C)fQw_N^tZ{E7NIC~M#R3vv-1fNPkj&i##ClD{1+r+b{0Q5)*%TE|)s z1f(v|opdq%o7rTfm&uQLw59In<#;y-blFpI zZ1U_}+dD9PD#ZCrCrVNOJ5?fW66$DTQUf}F&h7~%(h0ieiKvs@nqV$rr76bUI!kM$ zJ1msr{#*O;EsKS+t~*`u@S)B?Li>rdf5-q_6TiQT0HLsON*yMbKmsfqtV{S z!q4KI{Ve~y{LcRSgw~U_z8rl{|34eSA<=pH4$Qm$;lJ;%2E4q$T91e?VcZR>JCVKk zSrV*Z% z)RTZm!8;L&BUsVA3jRxTg@NW7h~%>q#ATm)Ows}WsKZa=rTaQW;sn8OeOjqW;>5vc z5vh~s!P7Ce6Yc~5a27t6;qAV4#TV}?ez*@V zXdwZ39rSPxJOpP>R7a37yaj${18oCmZc-CS4BqaeR(#i>~OGoM$wZLr%Ss`-127D0Lb<02Yzu5)Q7s zSg92f4i=Ga2?tm9;@(rj!S5oy@D|v&2|uN9p54_?kgMVB2dHy62)rH6UW2M2*GV|| zHnJ1Wo`%|j?3FlR5!nx~g7=2-KLR(vQ!k}X;6CtrICk)LaFDFx8O~1a0|Y?cM>1mcqMfL4}k}f4D}HK!j_f2{@EPQGxL|NA>B0p!BN=!E-1d3$4^M(0{Q~U>_k!O>rr@D3D)mj| zI6MxX^(E#wcnf@En_^<4UA~NuYs3q$f<4>GKRg6Jh^&Cu!TYWu{}Kmueas4$kv_r& zk05*D4e;Twkbn6tc*a+iO2U2M?~uIkuPOCCqz>oYfx71o>L1?jC-&?+mHG=ZO}Jp> z2aFT^tVY3qAbz;|A?MYRUU(9`FhRe9hrrhk(yt`W-AZjuGWOvSaK$0=2@ilT+)F;; zO)&UV`V71ZwthyQ;p#rxZi0Cq9tFRVXMDkVccsP)jA4lnZYe7D5WL<0tN4Yz%%og| z3x<)V!~xH-xCb1aQaymoz|nWrQwR>E6gr<;R;IjgFL)W^g-5`{NGH4szKZzZoB>e1 zh+pD>Papv}XGB!@gOm;4?$b3&*z=E24}=T;2{{B8{M4hg5!?sfgVf;cJ*u}Jr@i3q zK3T-|qNR}e1v2(lbMs)DZ|0eB0%<{9QUID5!y>$B7ayxpg&_+LHt0&PLK;G0MW zF1YF_d4LDNCNc?U?^f;kHGLi)2hVnlJJG=^>@n_a@ICdrK#TH`|-UPq%H|hOt z@88KYyxrHS_&|N~pIjzf@MXk{f6x|q>6^4EJOYlqO`F2w;PH+Q6_z;QB`2YeNF4Am z5`$O4o{ym8z}x+livQ9M{EvDH=T`dOE~XZ)$wydcniGrJbb6ZIfJc6R(7aE@HqI_H67|9xLVtx_8>1x zIG9{d9^eLevc(_+m~nrE7y4Ly5iE}qeYMq-F|16Nl4|EVdjD1u< zJd?;wWty3Kb~4+@PGuW8kL9!cmNJ;5xgN`m5+j)z%NUt_rdF&Mo5ks3tEkLyDN>4- z21>C~yp${%r9dTE30ESOzREx)RvE2~Rg6l#GFh3fw9tESw5jfA>h>C)M$iZuQDeYJ z7)hgQ)Ql;kX{eMZJCIFeli6yvMyZ=wmGk8Mxj-(G>&uPi;yELi&rRkUxmIo_*E!*v2u*}11}0(? z$%(Ov+C+V#IWaxq$$RsGd@$dakLKg~L_VLd<{SB`{7haIdknKviRhS@S_%uZS) zWQDB(D`q9FF{@_Pt)?|?c}m_=pcE|i(GKxaqLeRHOO4W0X{Mygk#b)-T8@=R%ZYNb zJXSW!&GK}4rmQL+yM5x7L?vIT(n7RNoi!iurTytZdVsoA8BfMb4F)nnyZxmE)k2L@ zGzv|-9IEJ{B)+1*7@#!aVx-t-m&dS6)GE$UBCpwL`Y2V<3{kGAIbg=jgqbwQ%&J*4 z>*kc%G^b5vc`PqIE?`BhJ}YXCT5&638CKq!v>H~+nz1@dzEY?Zw)8v*wrj@0Q6SOi> IK9GO^2EO#~4gdfE literal 0 HcmV?d00001 diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/__hub_primitives.pxd b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/__hub_primitives.pxd new file mode 100644 index 00000000..35e5ad20 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/__hub_primitives.pxd @@ -0,0 +1,73 @@ +cimport cython + +from gevent.__greenlet_primitives cimport SwitchOutGreenletWithLoop +from gevent.__hub_local cimport get_hub_noargs as get_hub + +from gevent.__waiter cimport Waiter +from gevent.__waiter cimport MultipleWaiter + +cdef InvalidSwitchError +cdef _waiter +cdef _greenlet_primitives +cdef traceback +cdef _timeout_error +cdef Timeout + + +cdef extern from "greenlet/greenlet.h": + + ctypedef class greenlet.greenlet [object PyGreenlet]: + pass + + # These are actually macros and so much be included + # (defined) in each .pxd, as are the two functions + # that call them. + greenlet PyGreenlet_GetCurrent() + void PyGreenlet_Import() + +@cython.final +cdef inline greenlet getcurrent(): + return PyGreenlet_GetCurrent() + +cdef bint _greenlet_imported + +cdef inline void greenlet_init(): + global _greenlet_imported + if not _greenlet_imported: + PyGreenlet_Import() + _greenlet_imported = True + + +cdef class WaitOperationsGreenlet(SwitchOutGreenletWithLoop): + + cpdef wait(self, watcher) + cpdef cancel_wait(self, watcher, error, close_watcher=*) + cpdef _cancel_wait(self, watcher, error, close_watcher) + +cdef class _WaitIterator: + cdef SwitchOutGreenletWithLoop _hub + cdef MultipleWaiter _waiter + cdef _switch + cdef _timeout + cdef _objects + cdef _timer + cdef Py_ssize_t _count + cdef bint _begun + + + cdef _begin(self) + cdef _cleanup(self) + + cpdef __enter__(self) + cpdef __exit__(self, typ, value, tb) + + +cpdef iwait_on_objects(objects, timeout=*, count=*) +cpdef wait_on_objects(objects=*, timeout=*, count=*) + +cdef _primitive_wait(watcher, timeout, timeout_exc, WaitOperationsGreenlet hub) +cpdef wait_on_watcher(watcher, timeout=*, timeout_exc=*, WaitOperationsGreenlet hub=*) +cpdef wait_read(fileno, timeout=*, timeout_exc=*) +cpdef wait_write(fileno, timeout=*, timeout_exc=*, event=*) +cpdef wait_readwrite(fileno, timeout=*, timeout_exc=*, event=*) +cpdef wait_on_socket(socket, watcher, timeout_exc=*) diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/__ident.cp37-win_amd64.pyd b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/__ident.cp37-win_amd64.pyd new file mode 100644 index 0000000000000000000000000000000000000000..7f590a964504f6faac671abc8a9cb42421d942cc GIT binary patch literal 49664 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ΞNnnqU4}dakU3_fMq;| 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 literal 0 HcmV?d00001 diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/__ident.pxd b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/__ident.pxd new file mode 100644 index 00000000..55e43078 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/__ident.pxd @@ -0,0 +1,26 @@ +cimport cython + +cdef extern from "Python.h": + + ctypedef class weakref.ref [object PyWeakReference]: + pass + +cdef heappop +cdef heappush +cdef object WeakKeyDictionary +cdef type ref + +@cython.internal +@cython.final +cdef class ValuedWeakRef(ref): + cdef object value + +@cython.final +cdef class IdentRegistry: + cdef object _registry + cdef list _available_idents + + @cython.final + cpdef object get_ident(self, obj) + @cython.final + cpdef _return_ident(self, ValuedWeakRef ref) diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/__imap.cp37-win_amd64.pyd b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/__imap.cp37-win_amd64.pyd new file mode 100644 index 0000000000000000000000000000000000000000..bc59426b5dadcb7c851d790bdc3ffb480c3902a6 GIT binary patch literal 86528 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 0: + global _switchinterval + _switchinterval = interval + +from gevent._config import config +from gevent._hub_local import get_hub +from gevent._hub_primitives import iwait_on_objects as iwait +from gevent._hub_primitives import wait_on_objects as wait + +from gevent.greenlet import Greenlet, joinall, killall +joinall = joinall # export for pylint +spawn = Greenlet.spawn +spawn_later = Greenlet.spawn_later +#: The singleton configuration object for gevent. +config = config + +from gevent.timeout import Timeout, with_timeout +from gevent.hub import getcurrent, GreenletExit, spawn_raw, sleep, idle, kill, reinit +try: + from gevent.os import fork +except ImportError: + __all__.remove('fork') + +# See https://github.com/gevent/gevent/issues/648 +# A temporary backwards compatibility shim to enable users to continue +# to treat 'from gevent import signal' as a callable, to matter whether +# the 'gevent.signal' module has been imported first +from gevent.hub import signal as _signal_class +signal_handler = _signal_class +from gevent import signal as _signal_module + +# The object 'gevent.signal' must: +# - be callable, returning a gevent.hub.signal; +# - answer True to isinstance(gevent.signal(...), gevent.signal); +# - answer True to isinstance(gevent.signal(...), gevent.hub.signal) +# - have all the attributes of the module 'gevent.signal'; +# - answer True to isinstance(gevent.signal, types.ModuleType) (optional) + +# The only way to do this is to use a metaclass, an instance of which (a class) +# is put in sys.modules and is substituted for gevent.hub.signal. +# This handles everything except the last one. + + +class _signal_metaclass(type): + + def __getattr__(cls, name): + return getattr(_signal_module, name) + + def __setattr__(cls, name, value): + setattr(_signal_module, name, value) + + def __instancecheck__(cls, instance): + return isinstance(instance, _signal_class) + + def __dir__(cls): + return dir(_signal_module) + + +class signal(object): + + __doc__ = _signal_module.__doc__ + + def __new__(cls, *args, **kwargs): + return _signal_class(*args, **kwargs) + + +# The metaclass is applied after the class declaration +# for Python 2/3 compatibility +signal = _signal_metaclass(str("signal"), + (), + dict(signal.__dict__)) + +sys.modules['gevent.signal'] = signal +sys.modules['gevent.hub'].signal = signal + +del sys + + +# the following makes hidden imports visible to freezing tools like +# py2exe. see https://github.com/gevent/gevent/issues/181 +# This is not well maintained or tested, though, so it likely becomes +# outdated on each major release. + +def __dependencies_for_freezing(): # pragma: no cover + # pylint:disable=unused-import + from gevent import core + from gevent import resolver_thread + from gevent import resolver_ares + from gevent import socket as _socket + from gevent import threadpool + from gevent import thread + from gevent import threading + from gevent import select + from gevent import subprocess + import pprint + import traceback + import signal as _signal + +del __dependencies_for_freezing diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/__semaphore.cp37-win_amd64.pyd b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/__semaphore.cp37-win_amd64.pyd new file mode 100644 index 0000000000000000000000000000000000000000..689e21e696da282938b6d210353071af84edc02d GIT binary patch literal 78336 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

nH`1TG$-lDp$w24_ggQ*_UMR{4m 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 EFSbMI3jhEB literal 0 HcmV?d00001 diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/__tracer.pxd b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/__tracer.pxd new file mode 100644 index 00000000..454147ef --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/__tracer.pxd @@ -0,0 +1,43 @@ +cimport cython + +cdef sys +cdef traceback + +cdef settrace +cdef getcurrent + +cdef format_run_info + +cdef perf_counter +cdef gmctime + + +cdef class GreenletTracer: + cpdef readonly object active_greenlet + cpdef readonly object previous_trace_function + cpdef readonly Py_ssize_t greenlet_switch_counter + + cdef bint _killed + + cpdef _trace(self, str event, tuple args) + + @cython.locals(did_switch=bint) + cpdef did_block_hub(self, hub) + + cpdef kill(self) + +@cython.internal +cdef class _HubTracer(GreenletTracer): + cpdef readonly object hub + cpdef readonly double max_blocking_time + + +cdef class HubSwitchTracer(_HubTracer): + cpdef readonly double last_entered_hub + +cdef class MaxSwitchTracer(_HubTracer): + cpdef readonly double max_blocking + cpdef readonly double last_switch + + @cython.locals(switched_at=double) + cpdef _trace(self, str event, tuple args) diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/__waiter.cp37-win_amd64.pyd b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/__waiter.cp37-win_amd64.pyd new file mode 100644 index 0000000000000000000000000000000000000000..1883b8719425293b59e1eb98b8c98add1bd405ae GIT binary patch literal 76800 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 +#ifndef offsetof + #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) +#endif +#if !defined(WIN32) && !defined(MS_WINDOWS) + #ifndef __stdcall + #define __stdcall + #endif + #ifndef __cdecl + #define __cdecl + #endif + #ifndef __fastcall + #define __fastcall + #endif +#endif +#ifndef DL_IMPORT + #define DL_IMPORT(t) t +#endif +#ifndef DL_EXPORT + #define DL_EXPORT(t) t +#endif +#define __PYX_COMMA , +#ifndef HAVE_LONG_LONG + #if PY_VERSION_HEX >= 0x02070000 + #define HAVE_LONG_LONG + #endif +#endif +#ifndef PY_LONG_LONG + #define PY_LONG_LONG LONG_LONG +#endif +#ifndef Py_HUGE_VAL + #define Py_HUGE_VAL HUGE_VAL +#endif +#ifdef PYPY_VERSION + #define CYTHON_COMPILING_IN_PYPY 1 + #define CYTHON_COMPILING_IN_PYSTON 0 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #undef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 0 + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #if PY_VERSION_HEX < 0x03050000 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #elif !defined(CYTHON_USE_ASYNC_SLOTS) + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #undef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 0 + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #undef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 1 + #undef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 0 + #undef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 0 + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #undef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE 0 + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 +#elif defined(PYSTON_VERSION) + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_PYSTON 1 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #ifndef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 1 + #endif + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #ifndef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 1 + #endif + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #ifndef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 0 + #endif + #ifndef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 1 + #endif + #ifndef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 1 + #endif + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #undef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE 0 + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 +#else + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_PYSTON 0 + #define CYTHON_COMPILING_IN_CPYTHON 1 + #ifndef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 1 + #endif + #if PY_VERSION_HEX < 0x02070000 + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #elif !defined(CYTHON_USE_PYTYPE_LOOKUP) + #define CYTHON_USE_PYTYPE_LOOKUP 1 + #endif + #if PY_MAJOR_VERSION < 3 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #elif !defined(CYTHON_USE_ASYNC_SLOTS) + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #if PY_VERSION_HEX < 0x02070000 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #elif !defined(CYTHON_USE_PYLONG_INTERNALS) + #define CYTHON_USE_PYLONG_INTERNALS 1 + #endif + #ifndef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 1 + #endif + #ifndef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 1 + #endif + #if PY_VERSION_HEX < 0x030300F0 + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #elif !defined(CYTHON_USE_UNICODE_WRITER) + #define CYTHON_USE_UNICODE_WRITER 1 + #endif + #ifndef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 0 + #endif + #ifndef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 1 + #endif + #ifndef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 1 + #endif + #ifndef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 1 + #endif + #ifndef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 1 + #endif + #ifndef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000) + #endif + #ifndef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1) + #endif + #ifndef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1) + #endif + #ifndef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3) + #endif +#endif +#if !defined(CYTHON_FAST_PYCCALL) +#define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) +#endif +#if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #undef SHIFT + #undef BASE + #undef MASK + #ifdef SIZEOF_VOID_P + enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) }; + #endif +#endif +#ifndef __has_attribute + #define __has_attribute(x) 0 +#endif +#ifndef __has_cpp_attribute + #define __has_cpp_attribute(x) 0 +#endif +#ifndef CYTHON_RESTRICT + #if defined(__GNUC__) + #define CYTHON_RESTRICT __restrict__ + #elif defined(_MSC_VER) && _MSC_VER >= 1400 + #define CYTHON_RESTRICT __restrict + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_RESTRICT restrict + #else + #define CYTHON_RESTRICT + #endif +#endif +#ifndef CYTHON_UNUSED +# if defined(__GNUC__) +# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +#endif +#ifndef CYTHON_MAYBE_UNUSED_VAR +# if defined(__cplusplus) + template void CYTHON_MAYBE_UNUSED_VAR( const T& ) { } +# else +# define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x) +# endif +#endif +#ifndef CYTHON_NCP_UNUSED +# if CYTHON_COMPILING_IN_CPYTHON +# define CYTHON_NCP_UNUSED +# else +# define CYTHON_NCP_UNUSED CYTHON_UNUSED +# endif +#endif +#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) +#ifdef _MSC_VER + #ifndef _MSC_STDINT_H_ + #if _MSC_VER < 1300 + typedef unsigned char uint8_t; + typedef unsigned int uint32_t; + #else + typedef unsigned __int8 uint8_t; + typedef unsigned __int32 uint32_t; + #endif + #endif +#else + #include +#endif +#ifndef CYTHON_FALLTHROUGH + #if defined(__cplusplus) && __cplusplus >= 201103L + #if __has_cpp_attribute(fallthrough) + #define CYTHON_FALLTHROUGH [[fallthrough]] + #elif __has_cpp_attribute(clang::fallthrough) + #define CYTHON_FALLTHROUGH [[clang::fallthrough]] + #elif __has_cpp_attribute(gnu::fallthrough) + #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] + #endif + #endif + #ifndef CYTHON_FALLTHROUGH + #if __has_attribute(fallthrough) + #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) + #else + #define CYTHON_FALLTHROUGH + #endif + #endif + #if defined(__clang__ ) && defined(__apple_build_version__) + #if __apple_build_version__ < 7000000 + #undef CYTHON_FALLTHROUGH + #define CYTHON_FALLTHROUGH + #endif + #endif +#endif + +#ifndef CYTHON_INLINE + #if defined(__clang__) + #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) + #elif defined(__GNUC__) + #define CYTHON_INLINE __inline__ + #elif defined(_MSC_VER) + #define CYTHON_INLINE __inline + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_INLINE inline + #else + #define CYTHON_INLINE + #endif +#endif + +#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) + #define Py_OptimizeFlag 0 +#endif +#define __PYX_BUILD_PY_SSIZE_T "n" +#define CYTHON_FORMAT_SSIZE_T "z" +#if PY_MAJOR_VERSION < 3 + #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyClass_Type +#else + #define __Pyx_BUILTIN_MODULE_NAME "builtins" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyType_Type +#endif +#ifndef Py_TPFLAGS_CHECKTYPES + #define Py_TPFLAGS_CHECKTYPES 0 +#endif +#ifndef Py_TPFLAGS_HAVE_INDEX + #define Py_TPFLAGS_HAVE_INDEX 0 +#endif +#ifndef Py_TPFLAGS_HAVE_NEWBUFFER + #define Py_TPFLAGS_HAVE_NEWBUFFER 0 +#endif +#ifndef Py_TPFLAGS_HAVE_FINALIZE + #define Py_TPFLAGS_HAVE_FINALIZE 0 +#endif +#ifndef METH_STACKLESS + #define METH_STACKLESS 0 +#endif +#if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) + #ifndef METH_FASTCALL + #define METH_FASTCALL 0x80 + #endif + typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs); + typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args, + Py_ssize_t nargs, PyObject *kwnames); +#else + #define __Pyx_PyCFunctionFast _PyCFunctionFast + #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords +#endif +#if CYTHON_FAST_PYCCALL +#define __Pyx_PyFastCFunction_Check(func)\ + ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS))))) +#else +#define __Pyx_PyFastCFunction_Check(func) 0 +#endif +#if CYTHON_USE_DICT_VERSIONS +#define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) +#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ + (version_var) = __PYX_GET_DICT_VERSION(dict);\ + (cache_var) = (value); +#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ + static PY_UINT64_T __pyx_dict_version = 0;\ + static PyObject *__pyx_dict_cached_value = NULL;\ + if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ + (VAR) = __pyx_dict_cached_value;\ + } else {\ + (VAR) = __pyx_dict_cached_value = (LOOKUP);\ + __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ + }\ + } +#else +#define __PYX_GET_DICT_VERSION(dict) (0) +#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) +#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) + #define PyObject_Malloc(s) PyMem_Malloc(s) + #define PyObject_Free(p) PyMem_Free(p) + #define PyObject_Realloc(p) PyMem_Realloc(p) +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1 + #define PyMem_RawMalloc(n) PyMem_Malloc(n) + #define PyMem_RawRealloc(p, n) PyMem_Realloc(p, n) + #define PyMem_RawFree(p) PyMem_Free(p) +#endif +#if CYTHON_COMPILING_IN_PYSTON + #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co) + #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno) +#else + #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) + #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) +#endif +#if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000 + #define __Pyx_PyThreadState_Current PyThreadState_GET() +#elif PY_VERSION_HEX >= 0x03060000 + #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() +#elif PY_VERSION_HEX >= 0x03000000 + #define __Pyx_PyThreadState_Current PyThreadState_GET() +#else + #define __Pyx_PyThreadState_Current _PyThreadState_Current +#endif +#if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) +#include "pythread.h" +#define Py_tss_NEEDS_INIT 0 +typedef int Py_tss_t; +static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) { + *key = PyThread_create_key(); + return 0; // PyThread_create_key reports success always +} +static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) { + Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t)); + *key = Py_tss_NEEDS_INIT; + return key; +} +static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) { + PyObject_Free(key); +} +static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) { + return *key != Py_tss_NEEDS_INIT; +} +static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) { + PyThread_delete_key(*key); + *key = Py_tss_NEEDS_INIT; +} +static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) { + return PyThread_set_key_value(*key, value); +} +static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { + return PyThread_get_key_value(*key); +} +#endif // TSS (Thread Specific Storage) API +#if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized) +#define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) +#else +#define __Pyx_PyDict_NewPresized(n) PyDict_New() +#endif +#if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION + #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) +#else + #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS +#define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) +#else +#define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name) +#endif +#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) + #define CYTHON_PEP393_ENABLED 1 + #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ + 0 : _PyUnicode_Ready((PyObject *)(op))) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) + #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) + #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) + #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) + #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) + #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch) + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) +#else + #define CYTHON_PEP393_ENABLED 0 + #define PyUnicode_1BYTE_KIND 1 + #define PyUnicode_2BYTE_KIND 2 + #define PyUnicode_4BYTE_KIND 4 + #define __Pyx_PyUnicode_READY(op) (0) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) + #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111) + #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) + #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) + #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) + #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch) + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) +#endif +#if CYTHON_COMPILING_IN_PYPY + #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) +#else + #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ + PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains) + #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check) + #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format) + #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) +#endif +#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) +#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) +#else + #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) +#endif +#if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) + #define PyObject_ASCII(o) PyObject_Repr(o) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBaseString_Type PyUnicode_Type + #define PyStringObject PyUnicodeObject + #define PyString_Type PyUnicode_Type + #define PyString_Check PyUnicode_Check + #define PyString_CheckExact PyUnicode_CheckExact + #define PyObject_Unicode PyObject_Str +#endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) + #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) +#else + #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) + #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) +#endif +#ifndef PySet_CheckExact + #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) +#endif +#if CYTHON_ASSUME_SAFE_MACROS + #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) +#else + #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyIntObject PyLongObject + #define PyInt_Type PyLong_Type + #define PyInt_Check(op) PyLong_Check(op) + #define PyInt_CheckExact(op) PyLong_CheckExact(op) + #define PyInt_FromString PyLong_FromString + #define PyInt_FromUnicode PyLong_FromUnicode + #define PyInt_FromLong PyLong_FromLong + #define PyInt_FromSize_t PyLong_FromSize_t + #define PyInt_FromSsize_t PyLong_FromSsize_t + #define PyInt_AsLong PyLong_AsLong + #define PyInt_AS_LONG PyLong_AS_LONG + #define PyInt_AsSsize_t PyLong_AsSsize_t + #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask + #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask + #define PyNumber_Int PyNumber_Long +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBoolObject PyLongObject +#endif +#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY + #ifndef PyUnicode_InternFromString + #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) + #endif +#endif +#if PY_VERSION_HEX < 0x030200A4 + typedef long Py_hash_t; + #define __Pyx_PyInt_FromHash_t PyInt_FromLong + #define __Pyx_PyInt_AsHash_t PyInt_AsLong +#else + #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t + #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t +#endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : (Py_INCREF(func), func)) +#else + #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) +#endif +#if CYTHON_USE_ASYNC_SLOTS + #if PY_VERSION_HEX >= 0x030500B1 + #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods + #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) + #else + #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) + #endif +#else + #define __Pyx_PyType_AsAsync(obj) NULL +#endif +#ifndef __Pyx_PyAsyncMethodsStruct + typedef struct { + unaryfunc am_await; + unaryfunc am_aiter; + unaryfunc am_anext; + } __Pyx_PyAsyncMethodsStruct; +#endif + +#if defined(WIN32) || defined(MS_WINDOWS) + #define _USE_MATH_DEFINES +#endif +#include +#ifdef NAN +#define __PYX_NAN() ((float) NAN) +#else +static CYTHON_INLINE float __PYX_NAN() { + float value; + memset(&value, 0xFF, sizeof(value)); + return value; +} +#endif +#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) +#define __Pyx_truncl trunc +#else +#define __Pyx_truncl truncl +#endif + + +#define __PYX_ERR(f_index, lineno, Ln_error) \ +{ \ + __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \ +} + +#ifndef __PYX_EXTERN_C + #ifdef __cplusplus + #define __PYX_EXTERN_C extern "C" + #else + #define __PYX_EXTERN_C extern + #endif +#endif + +#define __PYX_HAVE__gevent____abstract_linkable +#define __PYX_HAVE_API__gevent____abstract_linkable +/* Early includes */ +#include "greenlet/greenlet.h" +#ifdef _OPENMP +#include +#endif /* _OPENMP */ + +#if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) +#define CYTHON_WITHOUT_ASSERTIONS +#endif + +typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; + const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; + +#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 +#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0 +#define __PYX_DEFAULT_STRING_ENCODING "" +#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString +#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#define __Pyx_uchar_cast(c) ((unsigned char)c) +#define __Pyx_long_cast(x) ((long)x) +#define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ + (sizeof(type) < sizeof(Py_ssize_t)) ||\ + (sizeof(type) > sizeof(Py_ssize_t) &&\ + likely(v < (type)PY_SSIZE_T_MAX ||\ + v == (type)PY_SSIZE_T_MAX) &&\ + (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ + v == (type)PY_SSIZE_T_MIN))) ||\ + (sizeof(type) == sizeof(Py_ssize_t) &&\ + (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ + v == (type)PY_SSIZE_T_MAX))) ) +static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) { + return (size_t) i < (size_t) limit; +} +#if defined (__cplusplus) && __cplusplus >= 201103L + #include + #define __Pyx_sst_abs(value) std::abs(value) +#elif SIZEOF_INT >= SIZEOF_SIZE_T + #define __Pyx_sst_abs(value) abs(value) +#elif SIZEOF_LONG >= SIZEOF_SIZE_T + #define __Pyx_sst_abs(value) labs(value) +#elif defined (_MSC_VER) + #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) +#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define __Pyx_sst_abs(value) llabs(value) +#elif defined (__GNUC__) + #define __Pyx_sst_abs(value) __builtin_llabs(value) +#else + #define __Pyx_sst_abs(value) ((value<0) ? -value : value) +#endif +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*); +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); +#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) +#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) +#define __Pyx_PyBytes_FromString PyBytes_FromString +#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); +#if PY_MAJOR_VERSION < 3 + #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#else + #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize +#endif +#define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) +#define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) +#define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) +#define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) +#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) +static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) { + const Py_UNICODE *u_end = u; + while (*u_end++) ; + return (size_t)(u_end - u - 1); +} +#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) +#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode +#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode +#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) +#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) +static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); +static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*); +static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); +#define __Pyx_PySequence_Tuple(obj)\ + (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); +#if CYTHON_ASSUME_SAFE_MACROS +#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) +#else +#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) +#endif +#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) +#if PY_MAJOR_VERSION >= 3 +#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) +#else +#define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) +#endif +#define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x)) +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII +static int __Pyx_sys_getdefaultencoding_not_ascii; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + PyObject* ascii_chars_u = NULL; + PyObject* ascii_chars_b = NULL; + const char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + if (strcmp(default_encoding_c, "ascii") == 0) { + __Pyx_sys_getdefaultencoding_not_ascii = 0; + } else { + char ascii_chars[128]; + int c; + for (c = 0; c < 128; c++) { + ascii_chars[c] = c; + } + __Pyx_sys_getdefaultencoding_not_ascii = 1; + ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); + if (!ascii_chars_u) goto bad; + ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); + if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { + PyErr_Format( + PyExc_ValueError, + "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", + default_encoding_c); + goto bad; + } + Py_DECREF(ascii_chars_u); + Py_DECREF(ascii_chars_b); + } + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + Py_XDECREF(ascii_chars_u); + Py_XDECREF(ascii_chars_b); + return -1; +} +#endif +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) +#else +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +static char* __PYX_DEFAULT_STRING_ENCODING; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1); + if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; + strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + return -1; +} +#endif +#endif + + +/* Test for GCC > 2.95 */ +#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) + #define likely(x) __builtin_expect(!!(x), 1) + #define unlikely(x) __builtin_expect(!!(x), 0) +#else /* !__GNUC__ or GCC < 2.95 */ + #define likely(x) (x) + #define unlikely(x) (x) +#endif /* __GNUC__ */ +static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } + +static PyObject *__pyx_m = NULL; +static PyObject *__pyx_d; +static PyObject *__pyx_b; +static PyObject *__pyx_cython_runtime = NULL; +static PyObject *__pyx_empty_tuple; +static PyObject *__pyx_empty_bytes; +static PyObject *__pyx_empty_unicode; +static int __pyx_lineno; +static int __pyx_clineno = 0; +static const char * __pyx_cfilenm= __FILE__; +static const char *__pyx_filename; + + +static const char *__pyx_f[] = { + "src\\gevent\\_abstract_linkable.py", + "src\\gevent\\__greenlet_primitives.pxd", + "src\\gevent\\__abstract_linkable.pxd", +}; + +/*--- Type declarations ---*/ +struct __pyx_obj_6gevent_21__greenlet_primitives_TrackedRawGreenlet; +struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop; +struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable; +struct __pyx_opt_args_6gevent_19__abstract_linkable_16AbstractLinkable__wait_core; +struct __pyx_opt_args_6gevent_19__abstract_linkable_16AbstractLinkable__wait; + +/* "gevent/__abstract_linkable.pxd":51 + * cdef _check_and_notify(self) + * cpdef _notify_links(self) + * cdef _wait_core(self, timeout, catch=*) # <<<<<<<<<<<<<< + * cdef _wait_return_value(self, waited, wait_success) + * cdef _wait(self, timeout=*) + */ +struct __pyx_opt_args_6gevent_19__abstract_linkable_16AbstractLinkable__wait_core { + int __pyx_n; + PyObject *catch; +}; + +/* "gevent/__abstract_linkable.pxd":53 + * cdef _wait_core(self, timeout, catch=*) + * cdef _wait_return_value(self, waited, wait_success) + * cdef _wait(self, timeout=*) # <<<<<<<<<<<<<< + */ +struct __pyx_opt_args_6gevent_19__abstract_linkable_16AbstractLinkable__wait { + int __pyx_n; + PyObject *timeout; +}; + +/* "gevent/__greenlet_primitives.pxd":37 + * return PyGreenlet_Switch(self, NULL, NULL) + * + * cdef class TrackedRawGreenlet(greenlet): # <<<<<<<<<<<<<< + * pass + * + */ +struct __pyx_obj_6gevent_21__greenlet_primitives_TrackedRawGreenlet { + PyGreenlet __pyx_base; +}; + + +/* "gevent/__greenlet_primitives.pxd":40 + * pass + * + * cdef class SwitchOutGreenletWithLoop(TrackedRawGreenlet): # <<<<<<<<<<<<<< + * cdef public loop + * + */ +struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop { + struct __pyx_obj_6gevent_21__greenlet_primitives_TrackedRawGreenlet __pyx_base; + struct __pyx_vtabstruct_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *__pyx_vtab; + PyObject *loop; +}; + + +/* "gevent/__abstract_linkable.pxd":32 + * cdef void _init() + * + * cdef class AbstractLinkable(object): # <<<<<<<<<<<<<< + * # We declare the __weakref__ here in the base (even though + * # that's not really what we want) as a workaround for a Cython + */ +struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable { + PyObject_HEAD + struct __pyx_vtabstruct_6gevent_19__abstract_linkable_AbstractLinkable *__pyx_vtab; + PyObject *__weakref__; + struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *hub; + PyObject *_notifier; + PyObject *_links; + int _notify_all; +}; + + + +/* "gevent/__greenlet_primitives.pxd":40 + * pass + * + * cdef class SwitchOutGreenletWithLoop(TrackedRawGreenlet): # <<<<<<<<<<<<<< + * cdef public loop + * + */ + +struct __pyx_vtabstruct_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop { + PyObject *(*__pyx_switch)(struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *, int __pyx_skip_dispatch); + PyObject *(*switch_out)(struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *, int __pyx_skip_dispatch); +}; +static struct __pyx_vtabstruct_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *__pyx_vtabptr_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop; + + +/* "src/gevent/_abstract_linkable.py":25 + * ] + * + * class AbstractLinkable(object): # <<<<<<<<<<<<<< + * # Encapsulates the standard parts of the linking and notifying + * # protocol common to both repeatable events (Event, Semaphore) and + */ + +struct __pyx_vtabstruct_6gevent_19__abstract_linkable_AbstractLinkable { + PyObject *(*rawlink)(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *, PyObject *, int __pyx_skip_dispatch); + int (*ready)(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *, int __pyx_skip_dispatch); + PyObject *(*unlink)(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *, PyObject *, int __pyx_skip_dispatch); + PyObject *(*_check_and_notify)(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *); + PyObject *(*_notify_links)(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *, int __pyx_skip_dispatch); + PyObject *(*_wait_core)(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *, PyObject *, struct __pyx_opt_args_6gevent_19__abstract_linkable_16AbstractLinkable__wait_core *__pyx_optional_args); + PyObject *(*_wait_return_value)(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *, PyObject *, PyObject *); + PyObject *(*_wait)(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *, struct __pyx_opt_args_6gevent_19__abstract_linkable_16AbstractLinkable__wait *__pyx_optional_args); +}; +static struct __pyx_vtabstruct_6gevent_19__abstract_linkable_AbstractLinkable *__pyx_vtabptr_6gevent_19__abstract_linkable_AbstractLinkable; + +/* --- Runtime support code (head) --- */ +/* Refnanny.proto */ +#ifndef CYTHON_REFNANNY + #define CYTHON_REFNANNY 0 +#endif +#if CYTHON_REFNANNY + typedef struct { + void (*INCREF)(void*, PyObject*, int); + void (*DECREF)(void*, PyObject*, int); + void (*GOTREF)(void*, PyObject*, int); + void (*GIVEREF)(void*, PyObject*, int); + void* (*SetupContext)(const char*, int, const char*); + void (*FinishContext)(void**); + } __Pyx_RefNannyAPIStruct; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); + #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; +#ifdef WITH_THREAD + #define __Pyx_RefNannySetupContext(name, acquire_gil)\ + if (acquire_gil) {\ + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ + PyGILState_Release(__pyx_gilstate_save);\ + } else {\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ + } +#else + #define __Pyx_RefNannySetupContext(name, acquire_gil)\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) +#endif + #define __Pyx_RefNannyFinishContext()\ + __Pyx_RefNanny->FinishContext(&__pyx_refnanny) + #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0) + #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) + #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) + #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) +#else + #define __Pyx_RefNannyDeclarations + #define __Pyx_RefNannySetupContext(name, acquire_gil) + #define __Pyx_RefNannyFinishContext() + #define __Pyx_INCREF(r) Py_INCREF(r) + #define __Pyx_DECREF(r) Py_DECREF(r) + #define __Pyx_GOTREF(r) + #define __Pyx_GIVEREF(r) + #define __Pyx_XINCREF(r) Py_XINCREF(r) + #define __Pyx_XDECREF(r) Py_XDECREF(r) + #define __Pyx_XGOTREF(r) + #define __Pyx_XGIVEREF(r) +#endif +#define __Pyx_XDECREF_SET(r, v) do {\ + PyObject *tmp = (PyObject *) r;\ + r = v; __Pyx_XDECREF(tmp);\ + } while (0) +#define __Pyx_DECREF_SET(r, v) do {\ + PyObject *tmp = (PyObject *) r;\ + r = v; __Pyx_DECREF(tmp);\ + } while (0) +#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) +#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) + +/* PyObjectGetAttrStr.proto */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); +#else +#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) +#endif + +/* GetBuiltinName.proto */ +static PyObject *__Pyx_GetBuiltinName(PyObject *name); + +/* RaiseArgTupleInvalid.proto */ +static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, + Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); + +/* KeywordStringCheck.proto */ +static int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* function_name, int kw_allowed); + +/* PyFunctionFastCall.proto */ +#if CYTHON_FAST_PYCALL +#define __Pyx_PyFunction_FastCall(func, args, nargs)\ + __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) +#if 1 || PY_VERSION_HEX < 0x030600B1 +static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs); +#else +#define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs) +#endif +#define __Pyx_BUILD_ASSERT_EXPR(cond)\ + (sizeof(char [1 - 2*!(cond)]) - 1) +#ifndef Py_MEMBER_SIZE +#define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member) +#endif + static size_t __pyx_pyframe_localsplus_offset = 0; + #include "frameobject.h" + #define __Pxy_PyFrame_Initialize_Offsets()\ + ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\ + (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus))) + #define __Pyx_PyFrame_GetLocalsplus(frame)\ + (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset)) +#endif + +/* PyObjectCall.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); +#else +#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) +#endif + +/* PyObjectCallMethO.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); +#endif + +/* PyObjectCallNoArg.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); +#else +#define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL) +#endif + +/* PyCFunctionFastCall.proto */ +#if CYTHON_FAST_PYCCALL +static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs); +#else +#define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL) +#endif + +/* PyObjectCallOneArg.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); + +/* PyThreadStateGet.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; +#define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; +#define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type +#else +#define __Pyx_PyThreadState_declare +#define __Pyx_PyThreadState_assign +#define __Pyx_PyErr_Occurred() PyErr_Occurred() +#endif + +/* PyErrFetchRestore.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) +#define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) +#define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) +#define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) +#define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); +static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) +#else +#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) +#endif +#else +#define __Pyx_PyErr_Clear() PyErr_Clear() +#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) +#define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) +#define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb) +#define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) +#endif + +/* RaiseException.proto */ +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); + +/* WriteUnraisableException.proto */ +static void __Pyx_WriteUnraisable(const char *name, int clineno, + int lineno, const char *filename, + int full_traceback, int nogil); + +/* PyObjectCall2Args.proto */ +static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2); + +/* CallableCheck.proto */ +#if CYTHON_USE_TYPE_SLOTS && PY_MAJOR_VERSION >= 3 +#define __Pyx_PyCallable_Check(obj) ((obj)->ob_type->tp_call != NULL) +#else +#define __Pyx_PyCallable_Check(obj) PyCallable_Check(obj) +#endif + +/* pyfrozenset_new.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyFrozenSet_New(PyObject* it); + +/* py_set_discard.proto */ +static CYTHON_INLINE int __Pyx_PySet_Discard(PyObject *set, PyObject *key); + +/* IterFinish.proto */ +static CYTHON_INLINE int __Pyx_IterFinish(void); + +/* set_iter.proto */ +static CYTHON_INLINE PyObject* __Pyx_set_iterator(PyObject* iterable, int is_set, + Py_ssize_t* p_orig_length, int* p_source_is_set); +static CYTHON_INLINE int __Pyx_set_iter_next( + PyObject* iter_obj, Py_ssize_t orig_length, + Py_ssize_t* ppos, PyObject **value, + int source_is_set); + +/* PySetContains.proto */ +static CYTHON_INLINE int __Pyx_PySet_ContainsTF(PyObject* key, PyObject* set, int eq); + +/* GetTopmostException.proto */ +#if CYTHON_USE_EXC_INFO_STACK +static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate); +#endif + +/* SaveResetException.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); +#else +#define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb) +#define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb) +#endif + +/* GetException.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb) +static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#else +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); +#endif + +/* GetModuleGlobalName.proto */ +#if CYTHON_USE_DICT_VERSIONS +#define __Pyx_GetModuleGlobalName(var, name) {\ + static PY_UINT64_T __pyx_dict_version = 0;\ + static PyObject *__pyx_dict_cached_value = NULL;\ + (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\ + (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\ + __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ +} +#define __Pyx_GetModuleGlobalNameUncached(var, name) {\ + PY_UINT64_T __pyx_dict_version;\ + PyObject *__pyx_dict_cached_value;\ + (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ +} +static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value); +#else +#define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name) +#define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name) +static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name); +#endif + +/* PyErrExceptionMatches.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) +static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); +#else +#define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) +#endif + +/* GetAttr.proto */ +static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *); + +/* GetAttr3.proto */ +static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *); + +/* SwapException.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#else +static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb); +#endif + +/* PyObjectLookupSpecial.proto */ +#if CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject* __Pyx_PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name) { + PyObject *res; + PyTypeObject *tp = Py_TYPE(obj); +#if PY_MAJOR_VERSION < 3 + if (unlikely(PyInstance_Check(obj))) + return __Pyx_PyObject_GetAttrStr(obj, attr_name); +#endif + res = _PyType_Lookup(tp, attr_name); + if (likely(res)) { + descrgetfunc f = Py_TYPE(res)->tp_descr_get; + if (!f) { + Py_INCREF(res); + } else { + res = f(res, obj, (PyObject *)tp); + } + } else { + PyErr_SetObject(PyExc_AttributeError, attr_name); + } + return res; +} +#else +#define __Pyx_PyObject_LookupSpecial(o,n) __Pyx_PyObject_GetAttrStr(o,n) +#endif + +/* TypeImport.proto */ +#ifndef __PYX_HAVE_RT_ImportType_proto +#define __PYX_HAVE_RT_ImportType_proto +enum __Pyx_ImportType_CheckSize { + __Pyx_ImportType_CheckSize_Error = 0, + __Pyx_ImportType_CheckSize_Warn = 1, + __Pyx_ImportType_CheckSize_Ignore = 2 +}; +static PyTypeObject *__Pyx_ImportType(PyObject* module, const char *module_name, const char *class_name, size_t size, enum __Pyx_ImportType_CheckSize check_size); +#endif + +/* PyObject_GenericGetAttrNoDict.proto */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name); +#else +#define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr +#endif + +/* PyObject_GenericGetAttr.proto */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name); +#else +#define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr +#endif + +/* SetVTable.proto */ +static int __Pyx_SetVtable(PyObject *dict, void *vtable); + +/* GetVTable.proto */ +static void* __Pyx_GetVtable(PyObject *dict); + +/* Import.proto */ +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); + +/* ImportFrom.proto */ +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); + +/* FetchCommonType.proto */ +static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); + +/* CythonFunction.proto */ +#define __Pyx_CyFunction_USED 1 +#define __Pyx_CYFUNCTION_STATICMETHOD 0x01 +#define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 +#define __Pyx_CYFUNCTION_CCLASS 0x04 +#define __Pyx_CyFunction_GetClosure(f)\ + (((__pyx_CyFunctionObject *) (f))->func_closure) +#define __Pyx_CyFunction_GetClassObj(f)\ + (((__pyx_CyFunctionObject *) (f))->func_classobj) +#define __Pyx_CyFunction_Defaults(type, f)\ + ((type *)(((__pyx_CyFunctionObject *) (f))->defaults)) +#define __Pyx_CyFunction_SetDefaultsGetter(f, g)\ + ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g) +typedef struct { + PyCFunctionObject func; +#if PY_VERSION_HEX < 0x030500A0 + PyObject *func_weakreflist; +#endif + PyObject *func_dict; + PyObject *func_name; + PyObject *func_qualname; + PyObject *func_doc; + PyObject *func_globals; + PyObject *func_code; + PyObject *func_closure; + PyObject *func_classobj; + void *defaults; + int defaults_pyobjects; + int flags; + PyObject *defaults_tuple; + PyObject *defaults_kwdict; + PyObject *(*defaults_getter)(PyObject *); + PyObject *func_annotations; +} __pyx_CyFunctionObject; +static PyTypeObject *__pyx_CyFunctionType = 0; +#define __Pyx_CyFunction_Check(obj) (__Pyx_TypeCheck(obj, __pyx_CyFunctionType)) +#define __Pyx_CyFunction_NewEx(ml, flags, qualname, self, module, globals, code)\ + __Pyx_CyFunction_New(__pyx_CyFunctionType, ml, flags, qualname, self, module, globals, code) +static PyObject *__Pyx_CyFunction_New(PyTypeObject *, PyMethodDef *ml, + int flags, PyObject* qualname, + PyObject *self, + PyObject *module, PyObject *globals, + PyObject* code); +static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, + size_t size, + int pyobjects); +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, + PyObject *tuple); +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, + PyObject *dict); +static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m, + PyObject *dict); +static int __pyx_CyFunction_init(void); + +/* Globals.proto */ +static PyObject* __Pyx_Globals(void); + +/* CLineInTraceback.proto */ +#ifdef CYTHON_CLINE_IN_TRACEBACK +#define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) +#else +static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line); +#endif + +/* CodeObjectCache.proto */ +typedef struct { + PyCodeObject* code_object; + int code_line; +} __Pyx_CodeObjectCacheEntry; +struct __Pyx_CodeObjectCache { + int count; + int max_count; + __Pyx_CodeObjectCacheEntry* entries; +}; +static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); +static PyCodeObject *__pyx_find_code_object(int code_line); +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); + +/* AddTraceback.proto */ +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename); + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); + +/* CIntFromPy.proto */ +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); + +/* CIntFromPy.proto */ +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); + +/* FastTypeChecks.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) +static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b); +static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type); +static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2); +#else +#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) +#define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) +#define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) +#endif +#define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) + +/* CheckBinaryVersion.proto */ +static int __Pyx_check_binary_version(void); + +/* PyObjectSetAttrStr.proto */ +#if CYTHON_USE_TYPE_SLOTS +#define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o, n, NULL) +static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value); +#else +#define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n) +#define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v) +#endif + +/* VoidPtrExport.proto */ +static int __Pyx_ExportVoidPtr(PyObject *name, void *p, const char *sig); + +/* FunctionExport.proto */ +static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig); + +/* VoidPtrImport.proto */ +static int __Pyx_ImportVoidPtr(PyObject *module, const char *name, void **p, const char *sig); + +/* FunctionImport.proto */ +static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig); + +/* InitStrings.proto */ +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); + +static int __pyx_f_6gevent_19__abstract_linkable_16AbstractLinkable_ready(CYTHON_UNUSED struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/ +static PyObject *__pyx_f_6gevent_19__abstract_linkable_16AbstractLinkable__check_and_notify(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *__pyx_v_self); /* proto*/ +static PyObject *__pyx_f_6gevent_19__abstract_linkable_16AbstractLinkable_rawlink(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *__pyx_v_self, PyObject *__pyx_v_callback, int __pyx_skip_dispatch); /* proto*/ +static PyObject *__pyx_f_6gevent_19__abstract_linkable_16AbstractLinkable_unlink(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *__pyx_v_self, PyObject *__pyx_v_callback, int __pyx_skip_dispatch); /* proto*/ +static PyObject *__pyx_f_6gevent_19__abstract_linkable_16AbstractLinkable__notify_links(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/ +static PyObject *__pyx_f_6gevent_19__abstract_linkable_16AbstractLinkable__wait_core(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *__pyx_v_self, PyObject *__pyx_v_timeout, struct __pyx_opt_args_6gevent_19__abstract_linkable_16AbstractLinkable__wait_core *__pyx_optional_args); /* proto*/ +static PyObject *__pyx_f_6gevent_19__abstract_linkable_16AbstractLinkable__wait_return_value(CYTHON_UNUSED struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_waited, CYTHON_UNUSED PyObject *__pyx_v_wait_success); /* proto*/ +static PyObject *__pyx_f_6gevent_19__abstract_linkable_16AbstractLinkable__wait(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *__pyx_v_self, struct __pyx_opt_args_6gevent_19__abstract_linkable_16AbstractLinkable__wait *__pyx_optional_args); /* proto*/ + +/* Module declarations from 'cython' */ + +/* Module declarations from 'greenlet' */ + +/* Module declarations from 'gevent.__greenlet_primitives' */ +static PyTypeObject *__pyx_ptype_6gevent_21__greenlet_primitives_greenlet = 0; +static PyTypeObject *__pyx_ptype_6gevent_21__greenlet_primitives_TrackedRawGreenlet = 0; +static PyTypeObject *__pyx_ptype_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop = 0; +static PyObject **__pyx_vp_6gevent_21__greenlet_primitives_get_objects = 0; +#define __pyx_v_6gevent_21__greenlet_primitives_get_objects (*__pyx_vp_6gevent_21__greenlet_primitives_get_objects) +static PyObject **__pyx_vp_6gevent_21__greenlet_primitives_wref = 0; +#define __pyx_v_6gevent_21__greenlet_primitives_wref (*__pyx_vp_6gevent_21__greenlet_primitives_wref) +static PyObject **__pyx_vp_6gevent_21__greenlet_primitives_BlockingSwitchOutError = 0; +#define __pyx_v_6gevent_21__greenlet_primitives_BlockingSwitchOutError (*__pyx_vp_6gevent_21__greenlet_primitives_BlockingSwitchOutError) +static int *__pyx_vp_6gevent_21__greenlet_primitives__greenlet_imported = 0; +#define __pyx_v_6gevent_21__greenlet_primitives__greenlet_imported (*__pyx_vp_6gevent_21__greenlet_primitives__greenlet_imported) + +/* Module declarations from 'gevent.__hub_local' */ +static PyObject **__pyx_vp_6gevent_11__hub_local__threadlocal = 0; +#define __pyx_v_6gevent_11__hub_local__threadlocal (*__pyx_vp_6gevent_11__hub_local__threadlocal) +static struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *(*__pyx_f_6gevent_11__hub_local_get_hub_noargs)(int __pyx_skip_dispatch); /*proto*/ + +/* Module declarations from 'gevent.__abstract_linkable' */ +static PyTypeObject *__pyx_ptype_6gevent_19__abstract_linkable_greenlet = 0; +static PyTypeObject *__pyx_ptype_6gevent_19__abstract_linkable_AbstractLinkable = 0; +static PyObject *__pyx_v_6gevent_19__abstract_linkable_InvalidSwitchError = 0; +static PyObject *__pyx_v_6gevent_19__abstract_linkable_Timeout = 0; +static int __pyx_v_6gevent_19__abstract_linkable__greenlet_imported; +static CYTHON_INLINE PyGreenlet *__pyx_f_6gevent_19__abstract_linkable_getcurrent(void); /*proto*/ +static CYTHON_INLINE void __pyx_f_6gevent_19__abstract_linkable_greenlet_init(void); /*proto*/ +static void __pyx_f_6gevent_19__abstract_linkable__init(void); /*proto*/ +#define __Pyx_MODULE_NAME "gevent.__abstract_linkable" +extern int __pyx_module_is_main_gevent____abstract_linkable; +int __pyx_module_is_main_gevent____abstract_linkable = 0; + +/* Implementation of 'gevent.__abstract_linkable' */ +static PyObject *__pyx_builtin___import__; +static PyObject *__pyx_builtin_NotImplementedError; +static PyObject *__pyx_builtin_TypeError; +static const char __pyx_k_all[] = "__all__"; +static const char __pyx_k_hub[] = "hub"; +static const char __pyx_k_sys[] = "sys"; +static const char __pyx_k_exit[] = "__exit__"; +static const char __pyx_k_main[] = "__main__"; +static const char __pyx_k_name[] = "__name__"; +static const char __pyx_k_self[] = "self"; +static const char __pyx_k_stop[] = "stop"; +static const char __pyx_k_test[] = "__test__"; +static const char __pyx_k_enter[] = "__enter__"; +static const char __pyx_k_links[] = "_links"; +static const char __pyx_k_ready[] = "ready"; +static const char __pyx_k_slots[] = "__slots__"; +static const char __pyx_k_import[] = "__import__"; +static const char __pyx_k_lambda[] = ""; +static const char __pyx_k_switch[] = "switch"; +static const char __pyx_k_unlink[] = "unlink"; +static const char __pyx_k_Timeout[] = "Timeout"; +static const char __pyx_k_rawlink[] = "rawlink"; +static const char __pyx_k_weakref[] = "__weakref__"; +static const char __pyx_k_callback[] = "callback"; +static const char __pyx_k_exc_info[] = "exc_info"; +static const char __pyx_k_greenlet[] = "greenlet"; +static const char __pyx_k_notifier[] = "_notifier"; +static const char __pyx_k_pyx_capi[] = "__pyx_capi__"; +static const char __pyx_k_TypeError[] = "TypeError"; +static const char __pyx_k_linkcount[] = "linkcount"; +static const char __pyx_k_getcurrent[] = "getcurrent"; +static const char __pyx_k_notify_all[] = "_notify_all"; +static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__"; +static const char __pyx_k_auto_unlink[] = "auto_unlink"; +static const char __pyx_k_gevent__util[] = "gevent._util"; +static const char __pyx_k_handle_error[] = "handle_error"; +static const char __pyx_k_notify_links[] = "_notify_links"; +static const char __pyx_k_run_callback[] = "run_callback"; +static const char __pyx_k_greenlet_init[] = "greenlet_init"; +static const char __pyx_k_get_hub_noargs[] = "get_hub_noargs"; +static const char __pyx_k_gevent_timeout[] = "gevent.timeout"; +static const char __pyx_k_import_c_accel[] = "import_c_accel"; +static const char __pyx_k_AbstractLinkable[] = "AbstractLinkable"; +static const char __pyx_k_gevent__hub_local[] = "gevent._hub_local"; +static const char __pyx_k_gevent_exceptions[] = "gevent.exceptions"; +static const char __pyx_k_greenlet_imported[] = "_greenlet_imported"; +static const char __pyx_k_InvalidSwitchError[] = "InvalidSwitchError"; +static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; +static const char __pyx_k_start_new_or_dummy[] = "_start_new_or_dummy"; +static const char __pyx_k_Expected_callable_r[] = "Expected callable: %r"; +static const char __pyx_k_NotImplementedError[] = "NotImplementedError"; +static const char __pyx_k_AbstractLinkable_ready[] = "AbstractLinkable.ready"; +static const char __pyx_k_AbstractLinkable_unlink[] = "AbstractLinkable.unlink"; +static const char __pyx_k_AbstractLinkable_rawlink[] = "AbstractLinkable.rawlink"; +static const char __pyx_k_AbstractLinkable_linkcount[] = "AbstractLinkable.linkcount"; +static const char __pyx_k_gevent___abstract_linkable[] = "gevent.__abstract_linkable"; +static const char __pyx_k_AbstractLinkable__notify_links[] = "AbstractLinkable._notify_links"; +static const char __pyx_k_Internal_module_support_for_the[] = "\nInternal module, support for the linkable protocol for \"event\" like objects.\n\n"; +static const char __pyx_k_Invalid_switch_into_Event_wait_r[] = "Invalid switch into Event.wait(): %r"; +static const char __pyx_k_src_gevent__abstract_linkable_py[] = "src\\gevent\\_abstract_linkable.py"; +static PyObject *__pyx_n_s_AbstractLinkable; +static PyObject *__pyx_n_s_AbstractLinkable__notify_links; +static PyObject *__pyx_n_s_AbstractLinkable_linkcount; +static PyObject *__pyx_n_s_AbstractLinkable_rawlink; +static PyObject *__pyx_n_s_AbstractLinkable_ready; +static PyObject *__pyx_n_s_AbstractLinkable_unlink; +static PyObject *__pyx_kp_s_Expected_callable_r; +static PyObject *__pyx_n_s_InvalidSwitchError; +static PyObject *__pyx_kp_s_Invalid_switch_into_Event_wait_r; +static PyObject *__pyx_n_s_NotImplementedError; +static PyObject *__pyx_n_s_Timeout; +static PyObject *__pyx_n_s_TypeError; +static PyObject *__pyx_n_s_all; +static PyObject *__pyx_n_s_auto_unlink; +static PyObject *__pyx_n_s_callback; +static PyObject *__pyx_n_s_cline_in_traceback; +static PyObject *__pyx_n_s_enter; +static PyObject *__pyx_n_s_exc_info; +static PyObject *__pyx_n_s_exit; +static PyObject *__pyx_n_s_get_hub_noargs; +static PyObject *__pyx_n_s_getcurrent; +static PyObject *__pyx_n_s_gevent___abstract_linkable; +static PyObject *__pyx_n_s_gevent__hub_local; +static PyObject *__pyx_n_s_gevent__util; +static PyObject *__pyx_n_s_gevent_exceptions; +static PyObject *__pyx_n_s_gevent_timeout; +static PyObject *__pyx_n_s_greenlet; +static PyObject *__pyx_n_s_greenlet_imported; +static PyObject *__pyx_n_s_greenlet_init; +static PyObject *__pyx_n_s_handle_error; +static PyObject *__pyx_n_s_hub; +static PyObject *__pyx_n_s_import; +static PyObject *__pyx_n_s_import_c_accel; +static PyObject *__pyx_n_s_lambda; +static PyObject *__pyx_n_s_linkcount; +static PyObject *__pyx_n_s_links; +static PyObject *__pyx_n_s_main; +static PyObject *__pyx_n_s_name; +static PyObject *__pyx_n_s_notifier; +static PyObject *__pyx_n_s_notify_all; +static PyObject *__pyx_n_s_notify_links; +static PyObject *__pyx_n_s_pyx_capi; +static PyObject *__pyx_n_s_pyx_vtable; +static PyObject *__pyx_n_s_rawlink; +static PyObject *__pyx_n_s_ready; +static PyObject *__pyx_n_s_run_callback; +static PyObject *__pyx_n_s_self; +static PyObject *__pyx_n_s_slots; +static PyObject *__pyx_kp_s_src_gevent__abstract_linkable_py; +static PyObject *__pyx_n_s_start_new_or_dummy; +static PyObject *__pyx_n_s_stop; +static PyObject *__pyx_n_s_switch; +static PyObject *__pyx_n_s_sys; +static PyObject *__pyx_n_s_test; +static PyObject *__pyx_n_s_unlink; +static PyObject *__pyx_n_s_weakref; +static PyObject *__pyx_lambda_funcdef_6gevent_19__abstract_linkable_lambda(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static int __pyx_pf_6gevent_19__abstract_linkable_16AbstractLinkable___init__(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_19__abstract_linkable_16AbstractLinkable_2linkcount(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_19__abstract_linkable_16AbstractLinkable_4ready(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_19__abstract_linkable_16AbstractLinkable_6rawlink(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *__pyx_v_self, PyObject *__pyx_v_callback); /* proto */ +static PyObject *__pyx_pf_6gevent_19__abstract_linkable_16AbstractLinkable_8unlink(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *__pyx_v_self, PyObject *__pyx_v_callback); /* proto */ +static PyObject *__pyx_pf_6gevent_19__abstract_linkable_16AbstractLinkable_10_notify_links(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_19__abstract_linkable_16AbstractLinkable_3hub___get__(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *__pyx_v_self); /* proto */ +static PyObject *__pyx_tp_new_6gevent_19__abstract_linkable_AbstractLinkable(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_k_; +static PyObject *__pyx_tuple__2; +static PyObject *__pyx_tuple__3; +static PyObject *__pyx_tuple__4; +static PyObject *__pyx_tuple__5; +static PyObject *__pyx_tuple__7; +static PyObject *__pyx_tuple__9; +static PyObject *__pyx_tuple__11; +static PyObject *__pyx_tuple__13; +static PyObject *__pyx_codeobj__6; +static PyObject *__pyx_codeobj__8; +static PyObject *__pyx_codeobj__10; +static PyObject *__pyx_codeobj__12; +static PyObject *__pyx_codeobj__14; +/* Late includes */ + +/* "src/gevent/_abstract_linkable.py":19 + * + * locals()['getcurrent'] = __import__('greenlet').getcurrent + * locals()['greenlet_init'] = lambda: None # <<<<<<<<<<<<<< + * + * __all__ = [ + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_19__abstract_linkable_lambda(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyMethodDef __pyx_mdef_6gevent_19__abstract_linkable_lambda = {"lambda", (PyCFunction)__pyx_pw_6gevent_19__abstract_linkable_lambda, METH_NOARGS, 0}; +static PyObject *__pyx_pw_6gevent_19__abstract_linkable_lambda(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("lambda (wrapper)", 0); + __pyx_r = __pyx_lambda_funcdef_6gevent_19__abstract_linkable_lambda(__pyx_self); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_lambda_funcdef_6gevent_19__abstract_linkable_lambda(CYTHON_UNUSED PyObject *__pyx_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("lambda", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_abstract_linkable.py":32 + * __slots__ = ('hub', '_links', '_notifier', '_notify_all', '__weakref__') + * + * def __init__(self): # <<<<<<<<<<<<<< + * # Before this implementation, AsyncResult and Semaphore + * # maintained the order of notifications, but Event did not. + */ + +/* Python wrapper */ +static int __pyx_pw_6gevent_19__abstract_linkable_16AbstractLinkable_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6gevent_19__abstract_linkable_16AbstractLinkable_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { + __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;} + if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1; + __pyx_r = __pyx_pf_6gevent_19__abstract_linkable_16AbstractLinkable___init__(((struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_19__abstract_linkable_16AbstractLinkable___init__(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "src/gevent/_abstract_linkable.py":62 + * # CPython ("No attribute...") + * # See https://github.com/gevent/gevent/issues/660 + * self._links = set() # <<<<<<<<<<<<<< + * self._notifier = None + * # This is conceptually a class attribute, defined here for ease of access in + */ + __pyx_t_1 = PySet_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 62, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_self->_links); + __Pyx_DECREF(__pyx_v_self->_links); + __pyx_v_self->_links = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "src/gevent/_abstract_linkable.py":63 + * # See https://github.com/gevent/gevent/issues/660 + * self._links = set() + * self._notifier = None # <<<<<<<<<<<<<< + * # This is conceptually a class attribute, defined here for ease of access in + * # cython. If it's true, when notifiers fire, all existing callbacks are called. + */ + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->_notifier); + __Pyx_DECREF(__pyx_v_self->_notifier); + __pyx_v_self->_notifier = Py_None; + + /* "src/gevent/_abstract_linkable.py":67 + * # cython. If it's true, when notifiers fire, all existing callbacks are called. + * # If its false, we only call callbacks as long as ready() returns true. + * self._notify_all = True # <<<<<<<<<<<<<< + * # we don't want to do get_hub() here to allow defining module-level objects + * # without initializing the hub + */ + __pyx_v_self->_notify_all = 1; + + /* "src/gevent/_abstract_linkable.py":70 + * # we don't want to do get_hub() here to allow defining module-level objects + * # without initializing the hub + * self.hub = None # <<<<<<<<<<<<<< + * + * def linkcount(self): + */ + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->hub); + __Pyx_DECREF(((PyObject *)__pyx_v_self->hub)); + __pyx_v_self->hub = ((struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *)Py_None); + + /* "src/gevent/_abstract_linkable.py":32 + * __slots__ = ('hub', '_links', '_notifier', '_notify_all', '__weakref__') + * + * def __init__(self): # <<<<<<<<<<<<<< + * # Before this implementation, AsyncResult and Semaphore + * # maintained the order of notifications, but Event did not. + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__abstract_linkable.AbstractLinkable.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_abstract_linkable.py":72 + * self.hub = None + * + * def linkcount(self): # <<<<<<<<<<<<<< + * # For testing: how many objects are linked to this one? + * return len(self._links) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_19__abstract_linkable_16AbstractLinkable_3linkcount(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6gevent_19__abstract_linkable_16AbstractLinkable_2linkcount[] = "AbstractLinkable.linkcount(self)"; +static PyMethodDef __pyx_mdef_6gevent_19__abstract_linkable_16AbstractLinkable_3linkcount = {"linkcount", (PyCFunction)__pyx_pw_6gevent_19__abstract_linkable_16AbstractLinkable_3linkcount, METH_NOARGS, __pyx_doc_6gevent_19__abstract_linkable_16AbstractLinkable_2linkcount}; +static PyObject *__pyx_pw_6gevent_19__abstract_linkable_16AbstractLinkable_3linkcount(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("linkcount (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_19__abstract_linkable_16AbstractLinkable_2linkcount(((struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_19__abstract_linkable_16AbstractLinkable_2linkcount(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + __Pyx_RefNannySetupContext("linkcount", 0); + + /* "src/gevent/_abstract_linkable.py":74 + * def linkcount(self): + * # For testing: how many objects are linked to this one? + * return len(self._links) # <<<<<<<<<<<<<< + * + * def ready(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_v_self->_links; + __Pyx_INCREF(__pyx_t_1); + if (unlikely(__pyx_t_1 == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + __PYX_ERR(0, 74, __pyx_L1_error) + } + __pyx_t_2 = PySet_GET_SIZE(__pyx_t_1); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 74, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 74, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "src/gevent/_abstract_linkable.py":72 + * self.hub = None + * + * def linkcount(self): # <<<<<<<<<<<<<< + * # For testing: how many objects are linked to this one? + * return len(self._links) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__abstract_linkable.AbstractLinkable.linkcount", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_abstract_linkable.py":76 + * return len(self._links) + * + * def ready(self): # <<<<<<<<<<<<<< + * # Instances must define this + * raise NotImplementedError + */ + +static PyObject *__pyx_pw_6gevent_19__abstract_linkable_16AbstractLinkable_5ready(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static int __pyx_f_6gevent_19__abstract_linkable_16AbstractLinkable_ready(CYTHON_UNUSED struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *__pyx_v_self, int __pyx_skip_dispatch) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + __Pyx_RefNannySetupContext("ready", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0; + if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self)))))); + else { + PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + #endif + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_ready); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 76, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_19__abstract_linkable_16AbstractLinkable_5ready)) { + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 76, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 76, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_5; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0; + if (unlikely(type_dict_guard != tp_dict_version)) { + tp_dict_version = obj_dict_version = 0; + } + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + } + #endif + } + + /* "src/gevent/_abstract_linkable.py":78 + * def ready(self): + * # Instances must define this + * raise NotImplementedError # <<<<<<<<<<<<<< + * + * def _check_and_notify(self): + */ + __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0); + __PYX_ERR(0, 78, __pyx_L1_error) + + /* "src/gevent/_abstract_linkable.py":76 + * return len(self._links) + * + * def ready(self): # <<<<<<<<<<<<<< + * # Instances must define this + * raise NotImplementedError + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_WriteUnraisable("gevent.__abstract_linkable.AbstractLinkable.ready", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_19__abstract_linkable_16AbstractLinkable_5ready(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6gevent_19__abstract_linkable_16AbstractLinkable_4ready[] = "AbstractLinkable.ready(self) -> bool"; +static PyMethodDef __pyx_mdef_6gevent_19__abstract_linkable_16AbstractLinkable_5ready = {"ready", (PyCFunction)__pyx_pw_6gevent_19__abstract_linkable_16AbstractLinkable_5ready, METH_NOARGS, __pyx_doc_6gevent_19__abstract_linkable_16AbstractLinkable_4ready}; +static PyObject *__pyx_pw_6gevent_19__abstract_linkable_16AbstractLinkable_5ready(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("ready (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_19__abstract_linkable_16AbstractLinkable_4ready(((struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_19__abstract_linkable_16AbstractLinkable_4ready(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("ready", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_f_6gevent_19__abstract_linkable_16AbstractLinkable_ready(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 76, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__abstract_linkable.AbstractLinkable.ready", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_abstract_linkable.py":80 + * raise NotImplementedError + * + * def _check_and_notify(self): # <<<<<<<<<<<<<< + * # If this object is ready to be notified, begin the process. + * if self.ready() and self._links and not self._notifier: + */ + +static PyObject *__pyx_f_6gevent_19__abstract_linkable_16AbstractLinkable__check_and_notify(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + __Pyx_RefNannySetupContext("_check_and_notify", 0); + + /* "src/gevent/_abstract_linkable.py":82 + * def _check_and_notify(self): + * # If this object is ready to be notified, begin the process. + * if self.ready() and self._links and not self._notifier: # <<<<<<<<<<<<<< + * if self.hub is None: + * self.hub = get_hub() + */ + __pyx_t_2 = (((struct __pyx_vtabstruct_6gevent_19__abstract_linkable_AbstractLinkable *)__pyx_v_self->__pyx_vtab)->ready(__pyx_v_self, 0) != 0); + if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_2 = (__pyx_v_self->_links != Py_None)&&(PySet_GET_SIZE(__pyx_v_self->_links) != 0); + if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_self->_notifier); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 82, __pyx_L1_error) + __pyx_t_3 = ((!__pyx_t_2) != 0); + __pyx_t_1 = __pyx_t_3; + __pyx_L4_bool_binop_done:; + if (__pyx_t_1) { + + /* "src/gevent/_abstract_linkable.py":83 + * # If this object is ready to be notified, begin the process. + * if self.ready() and self._links and not self._notifier: + * if self.hub is None: # <<<<<<<<<<<<<< + * self.hub = get_hub() + * + */ + __pyx_t_1 = (((PyObject *)__pyx_v_self->hub) == Py_None); + __pyx_t_3 = (__pyx_t_1 != 0); + if (__pyx_t_3) { + + /* "src/gevent/_abstract_linkable.py":84 + * if self.ready() and self._links and not self._notifier: + * if self.hub is None: + * self.hub = get_hub() # <<<<<<<<<<<<<< + * + * self._notifier = self.hub.loop.run_callback(self._notify_links) + */ + __pyx_t_4 = ((PyObject *)__pyx_f_6gevent_11__hub_local_get_hub_noargs(0)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 84, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_v_self->hub); + __Pyx_DECREF(((PyObject *)__pyx_v_self->hub)); + __pyx_v_self->hub = ((struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *)__pyx_t_4); + __pyx_t_4 = 0; + + /* "src/gevent/_abstract_linkable.py":83 + * # If this object is ready to be notified, begin the process. + * if self.ready() and self._links and not self._notifier: + * if self.hub is None: # <<<<<<<<<<<<<< + * self.hub = get_hub() + * + */ + } + + /* "src/gevent/_abstract_linkable.py":86 + * self.hub = get_hub() + * + * self._notifier = self.hub.loop.run_callback(self._notify_links) # <<<<<<<<<<<<<< + * + * def rawlink(self, callback): + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->hub->loop, __pyx_n_s_run_callback); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 86, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_notify_links); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 86, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5); + if (likely(__pyx_t_7)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_7); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_5, function); + } + } + __pyx_t_4 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_7, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 86, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GIVEREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_v_self->_notifier); + __Pyx_DECREF(__pyx_v_self->_notifier); + __pyx_v_self->_notifier = __pyx_t_4; + __pyx_t_4 = 0; + + /* "src/gevent/_abstract_linkable.py":82 + * def _check_and_notify(self): + * # If this object is ready to be notified, begin the process. + * if self.ready() and self._links and not self._notifier: # <<<<<<<<<<<<<< + * if self.hub is None: + * self.hub = get_hub() + */ + } + + /* "src/gevent/_abstract_linkable.py":80 + * raise NotImplementedError + * + * def _check_and_notify(self): # <<<<<<<<<<<<<< + * # If this object is ready to be notified, begin the process. + * if self.ready() and self._links and not self._notifier: + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("gevent.__abstract_linkable.AbstractLinkable._check_and_notify", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_abstract_linkable.py":88 + * self._notifier = self.hub.loop.run_callback(self._notify_links) + * + * def rawlink(self, callback): # <<<<<<<<<<<<<< + * """ + * Register a callback to call when this object is ready. + */ + +static PyObject *__pyx_pw_6gevent_19__abstract_linkable_16AbstractLinkable_7rawlink(PyObject *__pyx_v_self, PyObject *__pyx_v_callback); /*proto*/ +static PyObject *__pyx_f_6gevent_19__abstract_linkable_16AbstractLinkable_rawlink(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *__pyx_v_self, PyObject *__pyx_v_callback, int __pyx_skip_dispatch) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + int __pyx_t_6; + int __pyx_t_7; + __Pyx_RefNannySetupContext("rawlink", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0; + if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self)))))); + else { + PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + #endif + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_rawlink); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 88, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_19__abstract_linkable_16AbstractLinkable_7rawlink)) { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_callback) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_callback); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 88, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0; + if (unlikely(type_dict_guard != tp_dict_version)) { + tp_dict_version = obj_dict_version = 0; + } + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + } + #endif + } + + /* "src/gevent/_abstract_linkable.py":96 + * *callback* will be passed one argument: this instance. + * """ + * if not callable(callback): # <<<<<<<<<<<<<< + * raise TypeError('Expected callable: %r' % (callback, )) + * + */ + __pyx_t_5 = __Pyx_PyCallable_Check(__pyx_v_callback); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 96, __pyx_L1_error) + __pyx_t_6 = ((!(__pyx_t_5 != 0)) != 0); + if (unlikely(__pyx_t_6)) { + + /* "src/gevent/_abstract_linkable.py":97 + * """ + * if not callable(callback): + * raise TypeError('Expected callable: %r' % (callback, )) # <<<<<<<<<<<<<< + * + * self._links.add(callback) + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 97, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_callback); + __Pyx_GIVEREF(__pyx_v_callback); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_callback); + __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_Expected_callable_r, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 97, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 97, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 97, __pyx_L1_error) + + /* "src/gevent/_abstract_linkable.py":96 + * *callback* will be passed one argument: this instance. + * """ + * if not callable(callback): # <<<<<<<<<<<<<< + * raise TypeError('Expected callable: %r' % (callback, )) + * + */ + } + + /* "src/gevent/_abstract_linkable.py":99 + * raise TypeError('Expected callable: %r' % (callback, )) + * + * self._links.add(callback) # <<<<<<<<<<<<<< + * self._check_and_notify() + * + */ + if (unlikely(__pyx_v_self->_links == Py_None)) { + PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "add"); + __PYX_ERR(0, 99, __pyx_L1_error) + } + __pyx_t_7 = PySet_Add(__pyx_v_self->_links, __pyx_v_callback); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 99, __pyx_L1_error) + + /* "src/gevent/_abstract_linkable.py":100 + * + * self._links.add(callback) + * self._check_and_notify() # <<<<<<<<<<<<<< + * + * def unlink(self, callback): + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_19__abstract_linkable_AbstractLinkable *)__pyx_v_self->__pyx_vtab)->_check_and_notify(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 100, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_abstract_linkable.py":88 + * self._notifier = self.hub.loop.run_callback(self._notify_links) + * + * def rawlink(self, callback): # <<<<<<<<<<<<<< + * """ + * Register a callback to call when this object is ready. + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("gevent.__abstract_linkable.AbstractLinkable.rawlink", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_19__abstract_linkable_16AbstractLinkable_7rawlink(PyObject *__pyx_v_self, PyObject *__pyx_v_callback); /*proto*/ +static char __pyx_doc_6gevent_19__abstract_linkable_16AbstractLinkable_6rawlink[] = "AbstractLinkable.rawlink(self, callback)\n\n Register a callback to call when this object is ready.\n\n *callback* will be called in the :class:`Hub\n `, so it must not use blocking gevent API.\n *callback* will be passed one argument: this instance.\n "; +static PyMethodDef __pyx_mdef_6gevent_19__abstract_linkable_16AbstractLinkable_7rawlink = {"rawlink", (PyCFunction)__pyx_pw_6gevent_19__abstract_linkable_16AbstractLinkable_7rawlink, METH_O, __pyx_doc_6gevent_19__abstract_linkable_16AbstractLinkable_6rawlink}; +static PyObject *__pyx_pw_6gevent_19__abstract_linkable_16AbstractLinkable_7rawlink(PyObject *__pyx_v_self, PyObject *__pyx_v_callback) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("rawlink (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_19__abstract_linkable_16AbstractLinkable_6rawlink(((struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *)__pyx_v_self), ((PyObject *)__pyx_v_callback)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_19__abstract_linkable_16AbstractLinkable_6rawlink(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *__pyx_v_self, PyObject *__pyx_v_callback) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("rawlink", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6gevent_19__abstract_linkable_16AbstractLinkable_rawlink(__pyx_v_self, __pyx_v_callback, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 88, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__abstract_linkable.AbstractLinkable.rawlink", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_abstract_linkable.py":102 + * self._check_and_notify() + * + * def unlink(self, callback): # <<<<<<<<<<<<<< + * """Remove the callback set by :meth:`rawlink`""" + * self._links.discard(callback) + */ + +static PyObject *__pyx_pw_6gevent_19__abstract_linkable_16AbstractLinkable_9unlink(PyObject *__pyx_v_self, PyObject *__pyx_v_callback); /*proto*/ +static PyObject *__pyx_f_6gevent_19__abstract_linkable_16AbstractLinkable_unlink(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *__pyx_v_self, PyObject *__pyx_v_callback, int __pyx_skip_dispatch) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + int __pyx_t_6; + int __pyx_t_7; + int __pyx_t_8; + __Pyx_RefNannySetupContext("unlink", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0; + if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self)))))); + else { + PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + #endif + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_unlink); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 102, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_19__abstract_linkable_16AbstractLinkable_9unlink)) { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_callback) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_callback); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 102, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0; + if (unlikely(type_dict_guard != tp_dict_version)) { + tp_dict_version = obj_dict_version = 0; + } + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + } + #endif + } + + /* "src/gevent/_abstract_linkable.py":104 + * def unlink(self, callback): + * """Remove the callback set by :meth:`rawlink`""" + * self._links.discard(callback) # <<<<<<<<<<<<<< + * + * if not self._links and self._notifier is not None: + */ + if (unlikely(__pyx_v_self->_links == Py_None)) { + PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "discard"); + __PYX_ERR(0, 104, __pyx_L1_error) + } + __pyx_t_5 = __Pyx_PySet_Discard(__pyx_v_self->_links, __pyx_v_callback); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 104, __pyx_L1_error) + + /* "src/gevent/_abstract_linkable.py":106 + * self._links.discard(callback) + * + * if not self._links and self._notifier is not None: # <<<<<<<<<<<<<< + * # If we currently have one queued, de-queue it. + * # This will break a reference cycle. + */ + __pyx_t_7 = (__pyx_v_self->_links != Py_None)&&(PySet_GET_SIZE(__pyx_v_self->_links) != 0); + __pyx_t_8 = ((!__pyx_t_7) != 0); + if (__pyx_t_8) { + } else { + __pyx_t_6 = __pyx_t_8; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_8 = (__pyx_v_self->_notifier != Py_None); + __pyx_t_7 = (__pyx_t_8 != 0); + __pyx_t_6 = __pyx_t_7; + __pyx_L4_bool_binop_done:; + if (__pyx_t_6) { + + /* "src/gevent/_abstract_linkable.py":111 + * # (self._notifier -> self._notify_links -> self) + * # But we can't set it to None in case it was actually running. + * self._notifier.stop() # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_notifier, __pyx_n_s_stop); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 111, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 111, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_abstract_linkable.py":106 + * self._links.discard(callback) + * + * if not self._links and self._notifier is not None: # <<<<<<<<<<<<<< + * # If we currently have one queued, de-queue it. + * # This will break a reference cycle. + */ + } + + /* "src/gevent/_abstract_linkable.py":102 + * self._check_and_notify() + * + * def unlink(self, callback): # <<<<<<<<<<<<<< + * """Remove the callback set by :meth:`rawlink`""" + * self._links.discard(callback) + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("gevent.__abstract_linkable.AbstractLinkable.unlink", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_19__abstract_linkable_16AbstractLinkable_9unlink(PyObject *__pyx_v_self, PyObject *__pyx_v_callback); /*proto*/ +static char __pyx_doc_6gevent_19__abstract_linkable_16AbstractLinkable_8unlink[] = "AbstractLinkable.unlink(self, callback)\nRemove the callback set by :meth:`rawlink`"; +static PyMethodDef __pyx_mdef_6gevent_19__abstract_linkable_16AbstractLinkable_9unlink = {"unlink", (PyCFunction)__pyx_pw_6gevent_19__abstract_linkable_16AbstractLinkable_9unlink, METH_O, __pyx_doc_6gevent_19__abstract_linkable_16AbstractLinkable_8unlink}; +static PyObject *__pyx_pw_6gevent_19__abstract_linkable_16AbstractLinkable_9unlink(PyObject *__pyx_v_self, PyObject *__pyx_v_callback) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("unlink (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_19__abstract_linkable_16AbstractLinkable_8unlink(((struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *)__pyx_v_self), ((PyObject *)__pyx_v_callback)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_19__abstract_linkable_16AbstractLinkable_8unlink(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *__pyx_v_self, PyObject *__pyx_v_callback) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("unlink", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6gevent_19__abstract_linkable_16AbstractLinkable_unlink(__pyx_v_self, __pyx_v_callback, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 102, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__abstract_linkable.AbstractLinkable.unlink", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_abstract_linkable.py":114 + * + * + * def _notify_links(self): # <<<<<<<<<<<<<< + * # We release self._notifier here. We are called by it + * # at the end of the loop, and it is now false in a boolean way (as soon + */ + +static PyObject *__pyx_pw_6gevent_19__abstract_linkable_16AbstractLinkable_11_notify_links(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_f_6gevent_19__abstract_linkable_16AbstractLinkable__notify_links(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *__pyx_v_self, int __pyx_skip_dispatch) { + PyObject *__pyx_v_notifier = NULL; + PyObject *__pyx_v_todo = NULL; + PyObject *__pyx_v_link = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + Py_ssize_t __pyx_t_5; + Py_ssize_t __pyx_t_6; + int __pyx_t_7; + int __pyx_t_8; + int __pyx_t_9; + int __pyx_t_10; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + PyObject *__pyx_t_14 = NULL; + PyObject *__pyx_t_15 = NULL; + PyObject *__pyx_t_16 = NULL; + PyObject *__pyx_t_17 = NULL; + PyObject *__pyx_t_18 = NULL; + int __pyx_t_19; + char const *__pyx_t_20; + PyObject *__pyx_t_21 = NULL; + PyObject *__pyx_t_22 = NULL; + PyObject *__pyx_t_23 = NULL; + char const *__pyx_t_24; + __Pyx_RefNannySetupContext("_notify_links", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0; + if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self)))))); + else { + PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + #endif + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_notify_links); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 114, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_19__abstract_linkable_16AbstractLinkable_11_notify_links)) { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 114, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0; + if (unlikely(type_dict_guard != tp_dict_version)) { + tp_dict_version = obj_dict_version = 0; + } + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + } + #endif + } + + /* "src/gevent/_abstract_linkable.py":118 + * # at the end of the loop, and it is now false in a boolean way (as soon + * # as this method returns). + * notifier = self._notifier # <<<<<<<<<<<<<< + * # We were ready() at the time this callback was scheduled; + * # we may not be anymore, and that status may change during + */ + __pyx_t_1 = __pyx_v_self->_notifier; + __Pyx_INCREF(__pyx_t_1); + __pyx_v_notifier = __pyx_t_1; + __pyx_t_1 = 0; + + /* "src/gevent/_abstract_linkable.py":124 + * # notify everyone that the status was once true, even though not it + * # may not be anymore. + * todo = set(self._links) # <<<<<<<<<<<<<< + * try: + * for link in todo: + */ + __pyx_t_1 = PySet_New(__pyx_v_self->_links); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 124, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_todo = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "src/gevent/_abstract_linkable.py":125 + * # may not be anymore. + * todo = set(self._links) + * try: # <<<<<<<<<<<<<< + * for link in todo: + * if not self._notify_all and not self.ready(): + */ + /*try:*/ { + + /* "src/gevent/_abstract_linkable.py":126 + * todo = set(self._links) + * try: + * for link in todo: # <<<<<<<<<<<<<< + * if not self._notify_all and not self.ready(): + * break + */ + __pyx_t_5 = 0; + __pyx_t_2 = __Pyx_set_iterator(__pyx_v_todo, 1, (&__pyx_t_6), (&__pyx_t_7)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 126, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_1); + __pyx_t_1 = __pyx_t_2; + __pyx_t_2 = 0; + while (1) { + __pyx_t_8 = __Pyx_set_iter_next(__pyx_t_1, __pyx_t_6, &__pyx_t_5, &__pyx_t_2, __pyx_t_7); + if (unlikely(__pyx_t_8 == 0)) break; + if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(0, 126, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_XDECREF_SET(__pyx_v_link, __pyx_t_2); + __pyx_t_2 = 0; + + /* "src/gevent/_abstract_linkable.py":127 + * try: + * for link in todo: + * if not self._notify_all and not self.ready(): # <<<<<<<<<<<<<< + * break + * + */ + __pyx_t_10 = ((!(__pyx_v_self->_notify_all != 0)) != 0); + if (__pyx_t_10) { + } else { + __pyx_t_9 = __pyx_t_10; + goto __pyx_L9_bool_binop_done; + } + __pyx_t_10 = ((!(((struct __pyx_vtabstruct_6gevent_19__abstract_linkable_AbstractLinkable *)__pyx_v_self->__pyx_vtab)->ready(__pyx_v_self, 0) != 0)) != 0); + __pyx_t_9 = __pyx_t_10; + __pyx_L9_bool_binop_done:; + if (__pyx_t_9) { + + /* "src/gevent/_abstract_linkable.py":128 + * for link in todo: + * if not self._notify_all and not self.ready(): + * break # <<<<<<<<<<<<<< + * + * if link not in self._links: + */ + goto __pyx_L7_break; + + /* "src/gevent/_abstract_linkable.py":127 + * try: + * for link in todo: + * if not self._notify_all and not self.ready(): # <<<<<<<<<<<<<< + * break + * + */ + } + + /* "src/gevent/_abstract_linkable.py":130 + * break + * + * if link not in self._links: # <<<<<<<<<<<<<< + * # Been removed already by some previous link. OK, fine. + * continue + */ + if (unlikely(__pyx_v_self->_links == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); + __PYX_ERR(0, 130, __pyx_L4_error) + } + __pyx_t_9 = (__Pyx_PySet_ContainsTF(__pyx_v_link, __pyx_v_self->_links, Py_NE)); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 130, __pyx_L4_error) + __pyx_t_10 = (__pyx_t_9 != 0); + if (__pyx_t_10) { + + /* "src/gevent/_abstract_linkable.py":132 + * if link not in self._links: + * # Been removed already by some previous link. OK, fine. + * continue # <<<<<<<<<<<<<< + * try: + * link(self) + */ + goto __pyx_L6_continue; + + /* "src/gevent/_abstract_linkable.py":130 + * break + * + * if link not in self._links: # <<<<<<<<<<<<<< + * # Been removed already by some previous link. OK, fine. + * continue + */ + } + + /* "src/gevent/_abstract_linkable.py":133 + * # Been removed already by some previous link. OK, fine. + * continue + * try: # <<<<<<<<<<<<<< + * link(self) + * except: # pylint:disable=bare-except + */ + /*try:*/ { + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13); + __Pyx_XGOTREF(__pyx_t_11); + __Pyx_XGOTREF(__pyx_t_12); + __Pyx_XGOTREF(__pyx_t_13); + /*try:*/ { + + /* "src/gevent/_abstract_linkable.py":134 + * continue + * try: + * link(self) # <<<<<<<<<<<<<< + * except: # pylint:disable=bare-except + * # We're running in the hub, so getcurrent() returns + */ + __Pyx_INCREF(__pyx_v_link); + __pyx_t_3 = __pyx_v_link; __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, ((PyObject *)__pyx_v_self)) : __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_self)); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 134, __pyx_L17_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/_abstract_linkable.py":133 + * # Been removed already by some previous link. OK, fine. + * continue + * try: # <<<<<<<<<<<<<< + * link(self) + * except: # pylint:disable=bare-except + */ + } + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; + goto __pyx_L24_try_end; + __pyx_L17_error:; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/_abstract_linkable.py":135 + * try: + * link(self) + * except: # pylint:disable=bare-except # <<<<<<<<<<<<<< + * # We're running in the hub, so getcurrent() returns + * # a hub. + */ + /*except:*/ { + __Pyx_AddTraceback("gevent.__abstract_linkable.AbstractLinkable._notify_links", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4) < 0) __PYX_ERR(0, 135, __pyx_L19_except_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GOTREF(__pyx_t_4); + + /* "src/gevent/_abstract_linkable.py":138 + * # We're running in the hub, so getcurrent() returns + * # a hub. + * self.hub.handle_error((link, self), *sys.exc_info()) # pylint:disable=undefined-variable # <<<<<<<<<<<<<< + * finally: + * if getattr(link, 'auto_unlink', None): + */ + __pyx_t_14 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->hub), __pyx_n_s_handle_error); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 138, __pyx_L19_except_error) + __Pyx_GOTREF(__pyx_t_14); + __pyx_t_15 = PyTuple_New(2); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 138, __pyx_L19_except_error) + __Pyx_GOTREF(__pyx_t_15); + __Pyx_INCREF(__pyx_v_link); + __Pyx_GIVEREF(__pyx_v_link); + PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_v_link); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_15, 1, ((PyObject *)__pyx_v_self)); + __pyx_t_16 = PyTuple_New(1); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 138, __pyx_L19_except_error) + __Pyx_GOTREF(__pyx_t_16); + __Pyx_GIVEREF(__pyx_t_15); + PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_15); + __pyx_t_15 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_17, __pyx_n_s_sys); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 138, __pyx_L19_except_error) + __Pyx_GOTREF(__pyx_t_17); + __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_t_17, __pyx_n_s_exc_info); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 138, __pyx_L19_except_error) + __Pyx_GOTREF(__pyx_t_18); + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + __pyx_t_17 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_18))) { + __pyx_t_17 = PyMethod_GET_SELF(__pyx_t_18); + if (likely(__pyx_t_17)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_18); + __Pyx_INCREF(__pyx_t_17); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_18, function); + } + } + __pyx_t_15 = (__pyx_t_17) ? __Pyx_PyObject_CallOneArg(__pyx_t_18, __pyx_t_17) : __Pyx_PyObject_CallNoArg(__pyx_t_18); + __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0; + if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 138, __pyx_L19_except_error) + __Pyx_GOTREF(__pyx_t_15); + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + __pyx_t_18 = __Pyx_PySequence_Tuple(__pyx_t_15); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 138, __pyx_L19_except_error) + __Pyx_GOTREF(__pyx_t_18); + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + __pyx_t_15 = PyNumber_Add(__pyx_t_16, __pyx_t_18); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 138, __pyx_L19_except_error) + __Pyx_GOTREF(__pyx_t_15); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + __pyx_t_18 = __Pyx_PyObject_Call(__pyx_t_14, __pyx_t_15, NULL); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 138, __pyx_L19_except_error) + __Pyx_GOTREF(__pyx_t_18); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L18_exception_handled; + } + __pyx_L19_except_error:; + + /* "src/gevent/_abstract_linkable.py":133 + * # Been removed already by some previous link. OK, fine. + * continue + * try: # <<<<<<<<<<<<<< + * link(self) + * except: # pylint:disable=bare-except + */ + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_XGIVEREF(__pyx_t_12); + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13); + goto __pyx_L15_error; + __pyx_L18_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_XGIVEREF(__pyx_t_12); + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13); + __pyx_L24_try_end:; + } + } + + /* "src/gevent/_abstract_linkable.py":140 + * self.hub.handle_error((link, self), *sys.exc_info()) # pylint:disable=undefined-variable + * finally: + * if getattr(link, 'auto_unlink', None): # <<<<<<<<<<<<<< + * # This attribute can avoid having to keep a reference to the function + * # *in* the function, which is a cycle + */ + /*finally:*/ { + /*normal exit:*/{ + __pyx_t_4 = __Pyx_GetAttr3(__pyx_v_link, __pyx_n_s_auto_unlink, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 140, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 140, __pyx_L4_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_10) { + + /* "src/gevent/_abstract_linkable.py":143 + * # This attribute can avoid having to keep a reference to the function + * # *in* the function, which is a cycle + * self.unlink(link) # <<<<<<<<<<<<<< + * finally: + * # We should not have created a new notifier even if callbacks + */ + __pyx_t_4 = ((struct __pyx_vtabstruct_6gevent_19__abstract_linkable_AbstractLinkable *)__pyx_v_self->__pyx_vtab)->unlink(__pyx_v_self, __pyx_v_link, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 143, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "src/gevent/_abstract_linkable.py":140 + * self.hub.handle_error((link, self), *sys.exc_info()) # pylint:disable=undefined-variable + * finally: + * if getattr(link, 'auto_unlink', None): # <<<<<<<<<<<<<< + * # This attribute can avoid having to keep a reference to the function + * # *in* the function, which is a cycle + */ + } + goto __pyx_L16; + } + __pyx_L15_error:; + /*exception exit:*/{ + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __pyx_t_13 = 0; __pyx_t_12 = 0; __pyx_t_11 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_t_23 = 0; + __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0; + __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; + __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; + __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_21, &__pyx_t_22, &__pyx_t_23); + if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_13, &__pyx_t_12, &__pyx_t_11) < 0)) __Pyx_ErrFetch(&__pyx_t_13, &__pyx_t_12, &__pyx_t_11); + __Pyx_XGOTREF(__pyx_t_13); + __Pyx_XGOTREF(__pyx_t_12); + __Pyx_XGOTREF(__pyx_t_11); + __Pyx_XGOTREF(__pyx_t_21); + __Pyx_XGOTREF(__pyx_t_22); + __Pyx_XGOTREF(__pyx_t_23); + __pyx_t_8 = __pyx_lineno; __pyx_t_19 = __pyx_clineno; __pyx_t_20 = __pyx_filename; + { + __pyx_t_4 = __Pyx_GetAttr3(__pyx_v_link, __pyx_n_s_auto_unlink, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 140, __pyx_L31_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 140, __pyx_L31_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_10) { + + /* "src/gevent/_abstract_linkable.py":143 + * # This attribute can avoid having to keep a reference to the function + * # *in* the function, which is a cycle + * self.unlink(link) # <<<<<<<<<<<<<< + * finally: + * # We should not have created a new notifier even if callbacks + */ + __pyx_t_4 = ((struct __pyx_vtabstruct_6gevent_19__abstract_linkable_AbstractLinkable *)__pyx_v_self->__pyx_vtab)->unlink(__pyx_v_self, __pyx_v_link, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 143, __pyx_L31_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "src/gevent/_abstract_linkable.py":140 + * self.hub.handle_error((link, self), *sys.exc_info()) # pylint:disable=undefined-variable + * finally: + * if getattr(link, 'auto_unlink', None): # <<<<<<<<<<<<<< + * # This attribute can avoid having to keep a reference to the function + * # *in* the function, which is a cycle + */ + } + } + if (PY_MAJOR_VERSION >= 3) { + __Pyx_XGIVEREF(__pyx_t_21); + __Pyx_XGIVEREF(__pyx_t_22); + __Pyx_XGIVEREF(__pyx_t_23); + __Pyx_ExceptionReset(__pyx_t_21, __pyx_t_22, __pyx_t_23); + } + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_XGIVEREF(__pyx_t_12); + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_ErrRestore(__pyx_t_13, __pyx_t_12, __pyx_t_11); + __pyx_t_13 = 0; __pyx_t_12 = 0; __pyx_t_11 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_t_23 = 0; + __pyx_lineno = __pyx_t_8; __pyx_clineno = __pyx_t_19; __pyx_filename = __pyx_t_20; + goto __pyx_L4_error; + __pyx_L31_error:; + if (PY_MAJOR_VERSION >= 3) { + __Pyx_XGIVEREF(__pyx_t_21); + __Pyx_XGIVEREF(__pyx_t_22); + __Pyx_XGIVEREF(__pyx_t_23); + __Pyx_ExceptionReset(__pyx_t_21, __pyx_t_22, __pyx_t_23); + } + __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_t_23 = 0; + goto __pyx_L4_error; + } + __pyx_L16:; + } + __pyx_L6_continue:; + } + __pyx_L7_break:; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + + /* "src/gevent/_abstract_linkable.py":148 + * # released us because we loop through *all* of our links on the + * # same callback while self._notifier is still true. + * assert self._notifier is notifier # <<<<<<<<<<<<<< + * self._notifier = None + * + */ + /*finally:*/ { + /*normal exit:*/{ + #ifndef CYTHON_WITHOUT_ASSERTIONS + if (unlikely(!Py_OptimizeFlag)) { + __pyx_t_10 = (__pyx_v_self->_notifier == __pyx_v_notifier); + if (unlikely(!(__pyx_t_10 != 0))) { + PyErr_SetNone(PyExc_AssertionError); + __PYX_ERR(0, 148, __pyx_L1_error) + } + } + #endif + + /* "src/gevent/_abstract_linkable.py":149 + * # same callback while self._notifier is still true. + * assert self._notifier is notifier + * self._notifier = None # <<<<<<<<<<<<<< + * + * # Our set of active links changed, and we were told to stop on the first + */ + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->_notifier); + __Pyx_DECREF(__pyx_v_self->_notifier); + __pyx_v_self->_notifier = Py_None; + goto __pyx_L5; + } + __pyx_L4_error:; + /*exception exit:*/{ + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __pyx_t_23 = 0; __pyx_t_22 = 0; __pyx_t_21 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; + __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0; + __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; + __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; + __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13); + if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_23, &__pyx_t_22, &__pyx_t_21) < 0)) __Pyx_ErrFetch(&__pyx_t_23, &__pyx_t_22, &__pyx_t_21); + __Pyx_XGOTREF(__pyx_t_23); + __Pyx_XGOTREF(__pyx_t_22); + __Pyx_XGOTREF(__pyx_t_21); + __Pyx_XGOTREF(__pyx_t_11); + __Pyx_XGOTREF(__pyx_t_12); + __Pyx_XGOTREF(__pyx_t_13); + __pyx_t_7 = __pyx_lineno; __pyx_t_19 = __pyx_clineno; __pyx_t_24 = __pyx_filename; + { + + /* "src/gevent/_abstract_linkable.py":148 + * # released us because we loop through *all* of our links on the + * # same callback while self._notifier is still true. + * assert self._notifier is notifier # <<<<<<<<<<<<<< + * self._notifier = None + * + */ + #ifndef CYTHON_WITHOUT_ASSERTIONS + if (unlikely(!Py_OptimizeFlag)) { + __pyx_t_10 = (__pyx_v_self->_notifier == __pyx_v_notifier); + if (unlikely(!(__pyx_t_10 != 0))) { + PyErr_SetNone(PyExc_AssertionError); + __PYX_ERR(0, 148, __pyx_L34_error) + } + } + #endif + + /* "src/gevent/_abstract_linkable.py":149 + * # same callback while self._notifier is still true. + * assert self._notifier is notifier + * self._notifier = None # <<<<<<<<<<<<<< + * + * # Our set of active links changed, and we were told to stop on the first + */ + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->_notifier); + __Pyx_DECREF(__pyx_v_self->_notifier); + __pyx_v_self->_notifier = Py_None; + } + if (PY_MAJOR_VERSION >= 3) { + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_XGIVEREF(__pyx_t_12); + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13); + } + __Pyx_XGIVEREF(__pyx_t_23); + __Pyx_XGIVEREF(__pyx_t_22); + __Pyx_XGIVEREF(__pyx_t_21); + __Pyx_ErrRestore(__pyx_t_23, __pyx_t_22, __pyx_t_21); + __pyx_t_23 = 0; __pyx_t_22 = 0; __pyx_t_21 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; + __pyx_lineno = __pyx_t_7; __pyx_clineno = __pyx_t_19; __pyx_filename = __pyx_t_24; + goto __pyx_L1_error; + __pyx_L34_error:; + if (PY_MAJOR_VERSION >= 3) { + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_XGIVEREF(__pyx_t_12); + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13); + } + __Pyx_XDECREF(__pyx_t_23); __pyx_t_23 = 0; + __Pyx_XDECREF(__pyx_t_22); __pyx_t_22 = 0; + __Pyx_XDECREF(__pyx_t_21); __pyx_t_21 = 0; + __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; + goto __pyx_L1_error; + } + __pyx_L5:; + } + + /* "src/gevent/_abstract_linkable.py":154 + * # time we went unready. See if we're ready, and if so, go around + * # again. + * if not self._notify_all and todo != self._links: # <<<<<<<<<<<<<< + * self._check_and_notify() + * + */ + __pyx_t_9 = ((!(__pyx_v_self->_notify_all != 0)) != 0); + if (__pyx_t_9) { + } else { + __pyx_t_10 = __pyx_t_9; + goto __pyx_L36_bool_binop_done; + } + __pyx_t_1 = PyObject_RichCompare(__pyx_v_todo, __pyx_v_self->_links, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 154, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 154, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_10 = __pyx_t_9; + __pyx_L36_bool_binop_done:; + if (__pyx_t_10) { + + /* "src/gevent/_abstract_linkable.py":155 + * # again. + * if not self._notify_all and todo != self._links: + * self._check_and_notify() # <<<<<<<<<<<<<< + * + * def _wait_core(self, timeout, catch=Timeout): + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_19__abstract_linkable_AbstractLinkable *)__pyx_v_self->__pyx_vtab)->_check_and_notify(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 155, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_abstract_linkable.py":154 + * # time we went unready. See if we're ready, and if so, go around + * # again. + * if not self._notify_all and todo != self._links: # <<<<<<<<<<<<<< + * self._check_and_notify() + * + */ + } + + /* "src/gevent/_abstract_linkable.py":114 + * + * + * def _notify_links(self): # <<<<<<<<<<<<<< + * # We release self._notifier here. We are called by it + * # at the end of the loop, and it is now false in a boolean way (as soon + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_14); + __Pyx_XDECREF(__pyx_t_15); + __Pyx_XDECREF(__pyx_t_16); + __Pyx_XDECREF(__pyx_t_17); + __Pyx_XDECREF(__pyx_t_18); + __Pyx_AddTraceback("gevent.__abstract_linkable.AbstractLinkable._notify_links", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_notifier); + __Pyx_XDECREF(__pyx_v_todo); + __Pyx_XDECREF(__pyx_v_link); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_19__abstract_linkable_16AbstractLinkable_11_notify_links(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6gevent_19__abstract_linkable_16AbstractLinkable_10_notify_links[] = "AbstractLinkable._notify_links(self)"; +static PyMethodDef __pyx_mdef_6gevent_19__abstract_linkable_16AbstractLinkable_11_notify_links = {"_notify_links", (PyCFunction)__pyx_pw_6gevent_19__abstract_linkable_16AbstractLinkable_11_notify_links, METH_NOARGS, __pyx_doc_6gevent_19__abstract_linkable_16AbstractLinkable_10_notify_links}; +static PyObject *__pyx_pw_6gevent_19__abstract_linkable_16AbstractLinkable_11_notify_links(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_notify_links (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_19__abstract_linkable_16AbstractLinkable_10_notify_links(((struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_19__abstract_linkable_16AbstractLinkable_10_notify_links(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("_notify_links", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6gevent_19__abstract_linkable_16AbstractLinkable__notify_links(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 114, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__abstract_linkable.AbstractLinkable._notify_links", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_abstract_linkable.py":157 + * self._check_and_notify() + * + * def _wait_core(self, timeout, catch=Timeout): # <<<<<<<<<<<<<< + * # The core of the wait implementation, handling + * # switching and linking. If *catch* is set to (), + */ + +static PyObject *__pyx_f_6gevent_19__abstract_linkable_16AbstractLinkable__wait_core(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *__pyx_v_self, PyObject *__pyx_v_timeout, struct __pyx_opt_args_6gevent_19__abstract_linkable_16AbstractLinkable__wait_core *__pyx_optional_args) { + PyObject *__pyx_v_catch = __pyx_k_; + PyObject *__pyx_v_switch = NULL; + PyObject *__pyx_v_timer = NULL; + PyObject *__pyx_v_result = NULL; + PyObject *__pyx_v_ex = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + int __pyx_t_12; + int __pyx_t_13; + int __pyx_t_14; + int __pyx_t_15; + char const *__pyx_t_16; + PyObject *__pyx_t_17 = NULL; + PyObject *__pyx_t_18 = NULL; + PyObject *__pyx_t_19 = NULL; + PyObject *__pyx_t_20 = NULL; + PyObject *__pyx_t_21 = NULL; + PyObject *__pyx_t_22 = NULL; + char const *__pyx_t_23; + __Pyx_RefNannySetupContext("_wait_core", 0); + if (__pyx_optional_args) { + if (__pyx_optional_args->__pyx_n > 0) { + __pyx_v_catch = __pyx_optional_args->catch; + } + } + + /* "src/gevent/_abstract_linkable.py":162 + * # a timeout that elapses will be allowed to be raised. + * # Returns a true value if the wait succeeded without timing out. + * switch = getcurrent().switch # pylint:disable=undefined-variable # <<<<<<<<<<<<<< + * self.rawlink(switch) + * try: + */ + __pyx_t_1 = ((PyObject *)__pyx_f_6gevent_19__abstract_linkable_getcurrent()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 162, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_switch); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 162, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_switch = __pyx_t_2; + __pyx_t_2 = 0; + + /* "src/gevent/_abstract_linkable.py":163 + * # Returns a true value if the wait succeeded without timing out. + * switch = getcurrent().switch # pylint:disable=undefined-variable + * self.rawlink(switch) # <<<<<<<<<<<<<< + * try: + * with Timeout._start_new_or_dummy(timeout) as timer: + */ + __pyx_t_2 = ((struct __pyx_vtabstruct_6gevent_19__abstract_linkable_AbstractLinkable *)__pyx_v_self->__pyx_vtab)->rawlink(__pyx_v_self, __pyx_v_switch, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 163, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/_abstract_linkable.py":164 + * switch = getcurrent().switch # pylint:disable=undefined-variable + * self.rawlink(switch) + * try: # <<<<<<<<<<<<<< + * with Timeout._start_new_or_dummy(timeout) as timer: + * try: + */ + /*try:*/ { + + /* "src/gevent/_abstract_linkable.py":165 + * self.rawlink(switch) + * try: + * with Timeout._start_new_or_dummy(timeout) as timer: # <<<<<<<<<<<<<< + * try: + * if self.hub is None: + */ + /*with:*/ { + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_6gevent_19__abstract_linkable_Timeout, __pyx_n_s_start_new_or_dummy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 165, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_1, function); + } + } + __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_3, __pyx_v_timeout) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_timeout); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 165, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_4 = __Pyx_PyObject_LookupSpecial(__pyx_t_2, __pyx_n_s_exit); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 165, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyObject_LookupSpecial(__pyx_t_2, __pyx_n_s_enter); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 165, __pyx_L6_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 165, __pyx_L6_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __pyx_t_1; + __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + /*try:*/ { + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); + __Pyx_XGOTREF(__pyx_t_6); + __Pyx_XGOTREF(__pyx_t_7); + __Pyx_XGOTREF(__pyx_t_8); + /*try:*/ { + __pyx_v_timer = __pyx_t_3; + __pyx_t_3 = 0; + + /* "src/gevent/_abstract_linkable.py":166 + * try: + * with Timeout._start_new_or_dummy(timeout) as timer: + * try: # <<<<<<<<<<<<<< + * if self.hub is None: + * self.hub = get_hub() + */ + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); + __Pyx_XGOTREF(__pyx_t_9); + __Pyx_XGOTREF(__pyx_t_10); + __Pyx_XGOTREF(__pyx_t_11); + /*try:*/ { + + /* "src/gevent/_abstract_linkable.py":167 + * with Timeout._start_new_or_dummy(timeout) as timer: + * try: + * if self.hub is None: # <<<<<<<<<<<<<< + * self.hub = get_hub() + * result = self.hub.switch() + */ + __pyx_t_12 = (((PyObject *)__pyx_v_self->hub) == Py_None); + __pyx_t_13 = (__pyx_t_12 != 0); + if (__pyx_t_13) { + + /* "src/gevent/_abstract_linkable.py":168 + * try: + * if self.hub is None: + * self.hub = get_hub() # <<<<<<<<<<<<<< + * result = self.hub.switch() + * if result is not self: # pragma: no cover + */ + __pyx_t_3 = ((PyObject *)__pyx_f_6gevent_11__hub_local_get_hub_noargs(0)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 168, __pyx_L16_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __Pyx_GOTREF(__pyx_v_self->hub); + __Pyx_DECREF(((PyObject *)__pyx_v_self->hub)); + __pyx_v_self->hub = ((struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *)__pyx_t_3); + __pyx_t_3 = 0; + + /* "src/gevent/_abstract_linkable.py":167 + * with Timeout._start_new_or_dummy(timeout) as timer: + * try: + * if self.hub is None: # <<<<<<<<<<<<<< + * self.hub = get_hub() + * result = self.hub.switch() + */ + } + + /* "src/gevent/_abstract_linkable.py":169 + * if self.hub is None: + * self.hub = get_hub() + * result = self.hub.switch() # <<<<<<<<<<<<<< + * if result is not self: # pragma: no cover + * raise InvalidSwitchError('Invalid switch into Event.wait(): %r' % (result, )) + */ + __pyx_t_3 = ((struct __pyx_vtabstruct_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *)__pyx_v_self->hub->__pyx_vtab)->__pyx_switch(__pyx_v_self->hub, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 169, __pyx_L16_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_v_result = __pyx_t_3; + __pyx_t_3 = 0; + + /* "src/gevent/_abstract_linkable.py":170 + * self.hub = get_hub() + * result = self.hub.switch() + * if result is not self: # pragma: no cover # <<<<<<<<<<<<<< + * raise InvalidSwitchError('Invalid switch into Event.wait(): %r' % (result, )) + * return True + */ + __pyx_t_13 = (__pyx_v_result != ((PyObject *)__pyx_v_self)); + __pyx_t_12 = (__pyx_t_13 != 0); + if (unlikely(__pyx_t_12)) { + + /* "src/gevent/_abstract_linkable.py":171 + * result = self.hub.switch() + * if result is not self: # pragma: no cover + * raise InvalidSwitchError('Invalid switch into Event.wait(): %r' % (result, )) # <<<<<<<<<<<<<< + * return True + * except catch as ex: + */ + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 171, __pyx_L16_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_result); + __Pyx_GIVEREF(__pyx_v_result); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_result); + __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_switch_into_Event_wait_r, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 171, __pyx_L16_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_INCREF(__pyx_v_6gevent_19__abstract_linkable_InvalidSwitchError); + __pyx_t_2 = __pyx_v_6gevent_19__abstract_linkable_InvalidSwitchError; __pyx_t_5 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_1) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_1); + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 171, __pyx_L16_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(0, 171, __pyx_L16_error) + + /* "src/gevent/_abstract_linkable.py":170 + * self.hub = get_hub() + * result = self.hub.switch() + * if result is not self: # pragma: no cover # <<<<<<<<<<<<<< + * raise InvalidSwitchError('Invalid switch into Event.wait(): %r' % (result, )) + * return True + */ + } + + /* "src/gevent/_abstract_linkable.py":172 + * if result is not self: # pragma: no cover + * raise InvalidSwitchError('Invalid switch into Event.wait(): %r' % (result, )) + * return True # <<<<<<<<<<<<<< + * except catch as ex: + * if ex is not timer: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; + goto __pyx_L20_try_return; + + /* "src/gevent/_abstract_linkable.py":166 + * try: + * with Timeout._start_new_or_dummy(timeout) as timer: + * try: # <<<<<<<<<<<<<< + * if self.hub is None: + * self.hub = get_hub() + */ + } + __pyx_L16_error:; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "src/gevent/_abstract_linkable.py":173 + * raise InvalidSwitchError('Invalid switch into Event.wait(): %r' % (result, )) + * return True + * except catch as ex: # <<<<<<<<<<<<<< + * if ex is not timer: + * raise + */ + __pyx_t_14 = __Pyx_PyErr_ExceptionMatches(__pyx_v_catch); + if (__pyx_t_14) { + __Pyx_AddTraceback("gevent.__abstract_linkable.AbstractLinkable._wait_core", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_2, &__pyx_t_1) < 0) __PYX_ERR(0, 173, __pyx_L18_except_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_t_2); + __pyx_v_ex = __pyx_t_2; + /*try:*/ { + + /* "src/gevent/_abstract_linkable.py":174 + * return True + * except catch as ex: + * if ex is not timer: # <<<<<<<<<<<<<< + * raise + * # test_set_and_clear and test_timeout in test_threading + */ + __pyx_t_12 = (__pyx_v_ex != __pyx_v_timer); + __pyx_t_13 = (__pyx_t_12 != 0); + if (unlikely(__pyx_t_13)) { + + /* "src/gevent/_abstract_linkable.py":175 + * except catch as ex: + * if ex is not timer: + * raise # <<<<<<<<<<<<<< + * # test_set_and_clear and test_timeout in test_threading + * # rely on the exact return values, not just truthish-ness + */ + __Pyx_GIVEREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_ErrRestoreWithState(__pyx_t_3, __pyx_t_2, __pyx_t_1); + __pyx_t_3 = 0; __pyx_t_2 = 0; __pyx_t_1 = 0; + __PYX_ERR(0, 175, __pyx_L29_error) + + /* "src/gevent/_abstract_linkable.py":174 + * return True + * except catch as ex: + * if ex is not timer: # <<<<<<<<<<<<<< + * raise + * # test_set_and_clear and test_timeout in test_threading + */ + } + + /* "src/gevent/_abstract_linkable.py":178 + * # test_set_and_clear and test_timeout in test_threading + * # rely on the exact return values, not just truthish-ness + * return False # <<<<<<<<<<<<<< + * finally: + * self.unlink(switch) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L28_return; + } + + /* "src/gevent/_abstract_linkable.py":173 + * raise InvalidSwitchError('Invalid switch into Event.wait(): %r' % (result, )) + * return True + * except catch as ex: # <<<<<<<<<<<<<< + * if ex is not timer: + * raise + */ + /*finally:*/ { + __pyx_L29_error:; + /*exception exit:*/{ + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22); + if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19) < 0)) __Pyx_ErrFetch(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19); + __Pyx_XGOTREF(__pyx_t_17); + __Pyx_XGOTREF(__pyx_t_18); + __Pyx_XGOTREF(__pyx_t_19); + __Pyx_XGOTREF(__pyx_t_20); + __Pyx_XGOTREF(__pyx_t_21); + __Pyx_XGOTREF(__pyx_t_22); + __pyx_t_14 = __pyx_lineno; __pyx_t_15 = __pyx_clineno; __pyx_t_16 = __pyx_filename; + { + __Pyx_DECREF(__pyx_v_ex); + __pyx_v_ex = NULL; + } + if (PY_MAJOR_VERSION >= 3) { + __Pyx_XGIVEREF(__pyx_t_20); + __Pyx_XGIVEREF(__pyx_t_21); + __Pyx_XGIVEREF(__pyx_t_22); + __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_21, __pyx_t_22); + } + __Pyx_XGIVEREF(__pyx_t_17); + __Pyx_XGIVEREF(__pyx_t_18); + __Pyx_XGIVEREF(__pyx_t_19); + __Pyx_ErrRestore(__pyx_t_17, __pyx_t_18, __pyx_t_19); + __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; + __pyx_lineno = __pyx_t_14; __pyx_clineno = __pyx_t_15; __pyx_filename = __pyx_t_16; + goto __pyx_L18_except_error; + } + __pyx_L28_return: { + __pyx_t_22 = __pyx_r; + __pyx_r = 0; + __Pyx_DECREF(__pyx_v_ex); + __pyx_v_ex = NULL; + __pyx_r = __pyx_t_22; + __pyx_t_22 = 0; + goto __pyx_L19_except_return; + } + } + } + goto __pyx_L18_except_error; + __pyx_L18_except_error:; + + /* "src/gevent/_abstract_linkable.py":166 + * try: + * with Timeout._start_new_or_dummy(timeout) as timer: + * try: # <<<<<<<<<<<<<< + * if self.hub is None: + * self.hub = get_hub() + */ + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11); + goto __pyx_L10_error; + __pyx_L20_try_return:; + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11); + goto __pyx_L14_try_return; + __pyx_L19_except_return:; + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11); + goto __pyx_L14_try_return; + } + + /* "src/gevent/_abstract_linkable.py":165 + * self.rawlink(switch) + * try: + * with Timeout._start_new_or_dummy(timeout) as timer: # <<<<<<<<<<<<<< + * try: + * if self.hub is None: + */ + } + __pyx_L10_error:; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + /*except:*/ { + __Pyx_AddTraceback("gevent.__abstract_linkable.AbstractLinkable._wait_core", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3) < 0) __PYX_ERR(0, 165, __pyx_L12_except_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyTuple_Pack(3, __pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 165, __pyx_L12_except_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 165, __pyx_L12_except_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_11); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + if (__pyx_t_13 < 0) __PYX_ERR(0, 165, __pyx_L12_except_error) + __pyx_t_12 = ((!(__pyx_t_13 != 0)) != 0); + if (__pyx_t_12) { + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ErrRestoreWithState(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_3 = 0; + __PYX_ERR(0, 165, __pyx_L12_except_error) + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L11_exception_handled; + } + __pyx_L12_except_error:; + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); + goto __pyx_L4_error; + __pyx_L14_try_return:; + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); + goto __pyx_L7_return; + __pyx_L11_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); + } + } + /*finally:*/ { + /*normal exit:*/{ + if (__pyx_t_4) { + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__2, NULL); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 165, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + } + goto __pyx_L9; + } + __pyx_L7_return: { + __pyx_t_8 = __pyx_r; + __pyx_r = 0; + if (__pyx_t_4) { + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__2, NULL); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 165, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } + __pyx_r = __pyx_t_8; + __pyx_t_8 = 0; + goto __pyx_L3_return; + } + __pyx_L9:; + } + goto __pyx_L39; + __pyx_L6_error:; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_error; + __pyx_L39:; + } + } + + /* "src/gevent/_abstract_linkable.py":180 + * return False + * finally: + * self.unlink(switch) # <<<<<<<<<<<<<< + * + * def _wait_return_value(self, waited, wait_success): + */ + /*finally:*/ { + /*normal exit:*/{ + __pyx_t_3 = ((struct __pyx_vtabstruct_6gevent_19__abstract_linkable_AbstractLinkable *)__pyx_v_self->__pyx_vtab)->unlink(__pyx_v_self, __pyx_v_switch, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 180, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L5; + } + __pyx_L4_error:; + /*exception exit:*/{ + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __pyx_t_4 = 0; __pyx_t_8 = 0; __pyx_t_7 = 0; __pyx_t_6 = 0; __pyx_t_11 = 0; __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_6, &__pyx_t_11, &__pyx_t_10); + if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_4, &__pyx_t_8, &__pyx_t_7) < 0)) __Pyx_ErrFetch(&__pyx_t_4, &__pyx_t_8, &__pyx_t_7); + __Pyx_XGOTREF(__pyx_t_4); + __Pyx_XGOTREF(__pyx_t_8); + __Pyx_XGOTREF(__pyx_t_7); + __Pyx_XGOTREF(__pyx_t_6); + __Pyx_XGOTREF(__pyx_t_11); + __Pyx_XGOTREF(__pyx_t_10); + __pyx_t_15 = __pyx_lineno; __pyx_t_14 = __pyx_clineno; __pyx_t_23 = __pyx_filename; + { + __pyx_t_3 = ((struct __pyx_vtabstruct_6gevent_19__abstract_linkable_AbstractLinkable *)__pyx_v_self->__pyx_vtab)->unlink(__pyx_v_self, __pyx_v_switch, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 180, __pyx_L41_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + if (PY_MAJOR_VERSION >= 3) { + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_11, __pyx_t_10); + } + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_ErrRestore(__pyx_t_4, __pyx_t_8, __pyx_t_7); + __pyx_t_4 = 0; __pyx_t_8 = 0; __pyx_t_7 = 0; __pyx_t_6 = 0; __pyx_t_11 = 0; __pyx_t_10 = 0; + __pyx_lineno = __pyx_t_15; __pyx_clineno = __pyx_t_14; __pyx_filename = __pyx_t_23; + goto __pyx_L1_error; + __pyx_L41_error:; + if (PY_MAJOR_VERSION >= 3) { + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_11, __pyx_t_10); + } + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_6 = 0; __pyx_t_11 = 0; __pyx_t_10 = 0; + goto __pyx_L1_error; + } + __pyx_L3_return: { + __pyx_t_10 = __pyx_r; + __pyx_r = 0; + __pyx_t_3 = ((struct __pyx_vtabstruct_6gevent_19__abstract_linkable_AbstractLinkable *)__pyx_v_self->__pyx_vtab)->unlink(__pyx_v_self, __pyx_v_switch, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 180, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_10; + __pyx_t_10 = 0; + goto __pyx_L0; + } + __pyx_L5:; + } + + /* "src/gevent/_abstract_linkable.py":157 + * self._check_and_notify() + * + * def _wait_core(self, timeout, catch=Timeout): # <<<<<<<<<<<<<< + * # The core of the wait implementation, handling + * # switching and linking. If *catch* is set to (), + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("gevent.__abstract_linkable.AbstractLinkable._wait_core", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_switch); + __Pyx_XDECREF(__pyx_v_timer); + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XDECREF(__pyx_v_ex); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_abstract_linkable.py":182 + * self.unlink(switch) + * + * def _wait_return_value(self, waited, wait_success): # <<<<<<<<<<<<<< + * # pylint:disable=unused-argument + * # Subclasses should override this to return a value from _wait. + */ + +static PyObject *__pyx_f_6gevent_19__abstract_linkable_16AbstractLinkable__wait_return_value(CYTHON_UNUSED struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_waited, CYTHON_UNUSED PyObject *__pyx_v_wait_success) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_wait_return_value", 0); + + /* "src/gevent/_abstract_linkable.py":186 + * # Subclasses should override this to return a value from _wait. + * # By default we return None. + * return None # pragma: no cover all extent subclasses override # <<<<<<<<<<<<<< + * + * def _wait(self, timeout=None): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + + /* "src/gevent/_abstract_linkable.py":182 + * self.unlink(switch) + * + * def _wait_return_value(self, waited, wait_success): # <<<<<<<<<<<<<< + * # pylint:disable=unused-argument + * # Subclasses should override this to return a value from _wait. + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_abstract_linkable.py":188 + * return None # pragma: no cover all extent subclasses override + * + * def _wait(self, timeout=None): # <<<<<<<<<<<<<< + * if self.ready(): + * return self._wait_return_value(False, False) + */ + +static PyObject *__pyx_f_6gevent_19__abstract_linkable_16AbstractLinkable__wait(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *__pyx_v_self, struct __pyx_opt_args_6gevent_19__abstract_linkable_16AbstractLinkable__wait *__pyx_optional_args) { + PyObject *__pyx_v_timeout = ((PyObject *)Py_None); + PyObject *__pyx_v_gotit = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("_wait", 0); + if (__pyx_optional_args) { + if (__pyx_optional_args->__pyx_n > 0) { + __pyx_v_timeout = __pyx_optional_args->timeout; + } + } + + /* "src/gevent/_abstract_linkable.py":189 + * + * def _wait(self, timeout=None): + * if self.ready(): # <<<<<<<<<<<<<< + * return self._wait_return_value(False, False) + * + */ + __pyx_t_1 = (((struct __pyx_vtabstruct_6gevent_19__abstract_linkable_AbstractLinkable *)__pyx_v_self->__pyx_vtab)->ready(__pyx_v_self, 0) != 0); + if (__pyx_t_1) { + + /* "src/gevent/_abstract_linkable.py":190 + * def _wait(self, timeout=None): + * if self.ready(): + * return self._wait_return_value(False, False) # <<<<<<<<<<<<<< + * + * gotit = self._wait_core(timeout) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = ((struct __pyx_vtabstruct_6gevent_19__abstract_linkable_AbstractLinkable *)__pyx_v_self->__pyx_vtab)->_wait_return_value(__pyx_v_self, Py_False, Py_False); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 190, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "src/gevent/_abstract_linkable.py":189 + * + * def _wait(self, timeout=None): + * if self.ready(): # <<<<<<<<<<<<<< + * return self._wait_return_value(False, False) + * + */ + } + + /* "src/gevent/_abstract_linkable.py":192 + * return self._wait_return_value(False, False) + * + * gotit = self._wait_core(timeout) # <<<<<<<<<<<<<< + * return self._wait_return_value(True, gotit) + * + */ + __pyx_t_2 = ((struct __pyx_vtabstruct_6gevent_19__abstract_linkable_AbstractLinkable *)__pyx_v_self->__pyx_vtab)->_wait_core(__pyx_v_self, __pyx_v_timeout, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 192, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_gotit = __pyx_t_2; + __pyx_t_2 = 0; + + /* "src/gevent/_abstract_linkable.py":193 + * + * gotit = self._wait_core(timeout) + * return self._wait_return_value(True, gotit) # <<<<<<<<<<<<<< + * + * def _init(): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = ((struct __pyx_vtabstruct_6gevent_19__abstract_linkable_AbstractLinkable *)__pyx_v_self->__pyx_vtab)->_wait_return_value(__pyx_v_self, Py_True, __pyx_v_gotit); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 193, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "src/gevent/_abstract_linkable.py":188 + * return None # pragma: no cover all extent subclasses override + * + * def _wait(self, timeout=None): # <<<<<<<<<<<<<< + * if self.ready(): + * return self._wait_return_value(False, False) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent.__abstract_linkable.AbstractLinkable._wait", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_gotit); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/__abstract_linkable.pxd":39 + * cdef object __weakref__ + * + * cdef readonly SwitchOutGreenletWithLoop hub # <<<<<<<<<<<<<< + * + * cdef _notifier + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_19__abstract_linkable_16AbstractLinkable_3hub_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_19__abstract_linkable_16AbstractLinkable_3hub_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_19__abstract_linkable_16AbstractLinkable_3hub___get__(((struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_19__abstract_linkable_16AbstractLinkable_3hub___get__(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_self->hub)); + __pyx_r = ((PyObject *)__pyx_v_self->hub); + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_abstract_linkable.py":195 + * return self._wait_return_value(True, gotit) + * + * def _init(): # <<<<<<<<<<<<<< + * greenlet_init() # pylint:disable=undefined-variable + * + */ + +static void __pyx_f_6gevent_19__abstract_linkable__init(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_init", 0); + + /* "src/gevent/_abstract_linkable.py":196 + * + * def _init(): + * greenlet_init() # pylint:disable=undefined-variable # <<<<<<<<<<<<<< + * + * _init() + */ + __pyx_f_6gevent_19__abstract_linkable_greenlet_init(); + + /* "src/gevent/_abstract_linkable.py":195 + * return self._wait_return_value(True, gotit) + * + * def _init(): # <<<<<<<<<<<<<< + * greenlet_init() # pylint:disable=undefined-variable + * + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "gevent/__greenlet_primitives.pxd":23 + * + * @cython.final + * cdef inline greenlet getcurrent(): # <<<<<<<<<<<<<< + * return PyGreenlet_GetCurrent() + * + */ + +static CYTHON_INLINE PyGreenlet *__pyx_f_6gevent_21__greenlet_primitives_getcurrent(void) { + PyGreenlet *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("getcurrent", 0); + + /* "gevent/__greenlet_primitives.pxd":24 + * @cython.final + * cdef inline greenlet getcurrent(): + * return PyGreenlet_GetCurrent() # <<<<<<<<<<<<<< + * + * cdef bint _greenlet_imported + */ + __Pyx_XDECREF(((PyObject *)__pyx_r)); + __pyx_t_1 = ((PyObject *)PyGreenlet_GetCurrent()); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 24, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = ((PyGreenlet *)__pyx_t_1); + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "gevent/__greenlet_primitives.pxd":23 + * + * @cython.final + * cdef inline greenlet getcurrent(): # <<<<<<<<<<<<<< + * return PyGreenlet_GetCurrent() + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__greenlet_primitives.getcurrent", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF((PyObject *)__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/__greenlet_primitives.pxd":28 + * cdef bint _greenlet_imported + * + * cdef inline void greenlet_init(): # <<<<<<<<<<<<<< + * global _greenlet_imported + * if not _greenlet_imported: + */ + +static CYTHON_INLINE void __pyx_f_6gevent_21__greenlet_primitives_greenlet_init(void) { + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("greenlet_init", 0); + + /* "gevent/__greenlet_primitives.pxd":30 + * cdef inline void greenlet_init(): + * global _greenlet_imported + * if not _greenlet_imported: # <<<<<<<<<<<<<< + * PyGreenlet_Import() + * _greenlet_imported = True + */ + __pyx_t_1 = ((!(__pyx_v_6gevent_21__greenlet_primitives__greenlet_imported != 0)) != 0); + if (__pyx_t_1) { + + /* "gevent/__greenlet_primitives.pxd":31 + * global _greenlet_imported + * if not _greenlet_imported: + * PyGreenlet_Import() # <<<<<<<<<<<<<< + * _greenlet_imported = True + * + */ + PyGreenlet_Import(); + + /* "gevent/__greenlet_primitives.pxd":32 + * if not _greenlet_imported: + * PyGreenlet_Import() + * _greenlet_imported = True # <<<<<<<<<<<<<< + * + * cdef inline object _greenlet_switch(greenlet self): + */ + __pyx_v_6gevent_21__greenlet_primitives__greenlet_imported = 1; + + /* "gevent/__greenlet_primitives.pxd":30 + * cdef inline void greenlet_init(): + * global _greenlet_imported + * if not _greenlet_imported: # <<<<<<<<<<<<<< + * PyGreenlet_Import() + * _greenlet_imported = True + */ + } + + /* "gevent/__greenlet_primitives.pxd":28 + * cdef bint _greenlet_imported + * + * cdef inline void greenlet_init(): # <<<<<<<<<<<<<< + * global _greenlet_imported + * if not _greenlet_imported: + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "gevent/__greenlet_primitives.pxd":34 + * _greenlet_imported = True + * + * cdef inline object _greenlet_switch(greenlet self): # <<<<<<<<<<<<<< + * return PyGreenlet_Switch(self, NULL, NULL) + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_6gevent_21__greenlet_primitives__greenlet_switch(PyGreenlet *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("_greenlet_switch", 0); + + /* "gevent/__greenlet_primitives.pxd":35 + * + * cdef inline object _greenlet_switch(greenlet self): + * return PyGreenlet_Switch(self, NULL, NULL) # <<<<<<<<<<<<<< + * + * cdef class TrackedRawGreenlet(greenlet): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyGreenlet_Switch(__pyx_v_self, NULL, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 35, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "gevent/__greenlet_primitives.pxd":34 + * _greenlet_imported = True + * + * cdef inline object _greenlet_switch(greenlet self): # <<<<<<<<<<<<<< + * return PyGreenlet_Switch(self, NULL, NULL) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__greenlet_primitives._greenlet_switch", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/__abstract_linkable.pxd":21 + * void PyGreenlet_Import() + * + * cdef inline greenlet getcurrent(): # <<<<<<<<<<<<<< + * return PyGreenlet_GetCurrent() + * + */ + +static CYTHON_INLINE PyGreenlet *__pyx_f_6gevent_19__abstract_linkable_getcurrent(void) { + PyGreenlet *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("getcurrent", 0); + + /* "gevent/__abstract_linkable.pxd":22 + * + * cdef inline greenlet getcurrent(): + * return PyGreenlet_GetCurrent() # <<<<<<<<<<<<<< + * + * cdef inline void greenlet_init(): + */ + __Pyx_XDECREF(((PyObject *)__pyx_r)); + __pyx_t_1 = ((PyObject *)PyGreenlet_GetCurrent()); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 22, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = ((PyGreenlet *)__pyx_t_1); + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "gevent/__abstract_linkable.pxd":21 + * void PyGreenlet_Import() + * + * cdef inline greenlet getcurrent(): # <<<<<<<<<<<<<< + * return PyGreenlet_GetCurrent() + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__abstract_linkable.getcurrent", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF((PyObject *)__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/__abstract_linkable.pxd":24 + * return PyGreenlet_GetCurrent() + * + * cdef inline void greenlet_init(): # <<<<<<<<<<<<<< + * global _greenlet_imported + * if not _greenlet_imported: + */ + +static CYTHON_INLINE void __pyx_f_6gevent_19__abstract_linkable_greenlet_init(void) { + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("greenlet_init", 0); + + /* "gevent/__abstract_linkable.pxd":26 + * cdef inline void greenlet_init(): + * global _greenlet_imported + * if not _greenlet_imported: # <<<<<<<<<<<<<< + * PyGreenlet_Import() + * _greenlet_imported = True + */ + __pyx_t_1 = ((!(__pyx_v_6gevent_19__abstract_linkable__greenlet_imported != 0)) != 0); + if (__pyx_t_1) { + + /* "gevent/__abstract_linkable.pxd":27 + * global _greenlet_imported + * if not _greenlet_imported: + * PyGreenlet_Import() # <<<<<<<<<<<<<< + * _greenlet_imported = True + * + */ + PyGreenlet_Import(); + + /* "gevent/__abstract_linkable.pxd":28 + * if not _greenlet_imported: + * PyGreenlet_Import() + * _greenlet_imported = True # <<<<<<<<<<<<<< + * + * cdef void _init() + */ + __pyx_v_6gevent_19__abstract_linkable__greenlet_imported = 1; + + /* "gevent/__abstract_linkable.pxd":26 + * cdef inline void greenlet_init(): + * global _greenlet_imported + * if not _greenlet_imported: # <<<<<<<<<<<<<< + * PyGreenlet_Import() + * _greenlet_imported = True + */ + } + + /* "gevent/__abstract_linkable.pxd":24 + * return PyGreenlet_GetCurrent() + * + * cdef inline void greenlet_init(): # <<<<<<<<<<<<<< + * global _greenlet_imported + * if not _greenlet_imported: + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} +static struct __pyx_vtabstruct_6gevent_19__abstract_linkable_AbstractLinkable __pyx_vtable_6gevent_19__abstract_linkable_AbstractLinkable; + +static PyObject *__pyx_tp_new_6gevent_19__abstract_linkable_AbstractLinkable(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *p; + PyObject *o; + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *)o); + p->__pyx_vtab = __pyx_vtabptr_6gevent_19__abstract_linkable_AbstractLinkable; + p->hub = ((struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *)Py_None); Py_INCREF(Py_None); + p->_notifier = Py_None; Py_INCREF(Py_None); + p->_links = ((PyObject*)Py_None); Py_INCREF(Py_None); + return o; +} + +static void __pyx_tp_dealloc_6gevent_19__abstract_linkable_AbstractLinkable(PyObject *o) { + struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *p = (struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *)o; + #if CYTHON_USE_TP_FINALIZE + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + PyObject_GC_UnTrack(o); + if (p->__weakref__) PyObject_ClearWeakRefs(o); + Py_CLEAR(p->hub); + Py_CLEAR(p->_notifier); + Py_CLEAR(p->_links); + (*Py_TYPE(o)->tp_free)(o); +} + +static int __pyx_tp_traverse_6gevent_19__abstract_linkable_AbstractLinkable(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *p = (struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *)o; + if (p->hub) { + e = (*v)(((PyObject *)p->hub), a); if (e) return e; + } + if (p->_notifier) { + e = (*v)(p->_notifier, a); if (e) return e; + } + if (p->_links) { + e = (*v)(p->_links, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_6gevent_19__abstract_linkable_AbstractLinkable(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *p = (struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *)o; + tmp = ((PyObject*)p->hub); + p->hub = ((struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->_notifier); + p->_notifier = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->_links); + p->_links = ((PyObject*)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyObject *__pyx_getprop_6gevent_19__abstract_linkable_16AbstractLinkable_hub(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_19__abstract_linkable_16AbstractLinkable_3hub_1__get__(o); +} + +static PyMethodDef __pyx_methods_6gevent_19__abstract_linkable_AbstractLinkable[] = { + {"linkcount", (PyCFunction)__pyx_pw_6gevent_19__abstract_linkable_16AbstractLinkable_3linkcount, METH_NOARGS, __pyx_doc_6gevent_19__abstract_linkable_16AbstractLinkable_2linkcount}, + {0, 0, 0, 0} +}; + +static struct PyGetSetDef __pyx_getsets_6gevent_19__abstract_linkable_AbstractLinkable[] = { + {(char *)"hub", __pyx_getprop_6gevent_19__abstract_linkable_16AbstractLinkable_hub, 0, (char *)0, 0}, + {0, 0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_6gevent_19__abstract_linkable_AbstractLinkable = { + PyVarObject_HEAD_INIT(0, 0) + "gevent.__abstract_linkable.AbstractLinkable", /*tp_name*/ + sizeof(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6gevent_19__abstract_linkable_AbstractLinkable, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + "AbstractLinkable()", /*tp_doc*/ + __pyx_tp_traverse_6gevent_19__abstract_linkable_AbstractLinkable, /*tp_traverse*/ + __pyx_tp_clear_6gevent_19__abstract_linkable_AbstractLinkable, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6gevent_19__abstract_linkable_AbstractLinkable, /*tp_methods*/ + 0, /*tp_members*/ + __pyx_getsets_6gevent_19__abstract_linkable_AbstractLinkable, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_pw_6gevent_19__abstract_linkable_16AbstractLinkable_1__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6gevent_19__abstract_linkable_AbstractLinkable, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static PyMethodDef __pyx_methods[] = { + {0, 0, 0, 0} +}; + +#if PY_MAJOR_VERSION >= 3 +#if CYTHON_PEP489_MULTI_PHASE_INIT +static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ +static int __pyx_pymod_exec___abstract_linkable(PyObject* module); /*proto*/ +static PyModuleDef_Slot __pyx_moduledef_slots[] = { + {Py_mod_create, (void*)__pyx_pymod_create}, + {Py_mod_exec, (void*)__pyx_pymod_exec___abstract_linkable}, + {0, NULL} +}; +#endif + +static struct PyModuleDef __pyx_moduledef = { + PyModuleDef_HEAD_INIT, + "__abstract_linkable", + __pyx_k_Internal_module_support_for_the, /* m_doc */ + #if CYTHON_PEP489_MULTI_PHASE_INIT + 0, /* m_size */ + #else + -1, /* m_size */ + #endif + __pyx_methods /* m_methods */, + #if CYTHON_PEP489_MULTI_PHASE_INIT + __pyx_moduledef_slots, /* m_slots */ + #else + NULL, /* m_reload */ + #endif + NULL, /* m_traverse */ + NULL, /* m_clear */ + NULL /* m_free */ +}; +#endif +#ifndef CYTHON_SMALL_CODE +#if defined(__clang__) + #define CYTHON_SMALL_CODE +#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) + #define CYTHON_SMALL_CODE __attribute__((cold)) +#else + #define CYTHON_SMALL_CODE +#endif +#endif + +static __Pyx_StringTabEntry __pyx_string_tab[] = { + {&__pyx_n_s_AbstractLinkable, __pyx_k_AbstractLinkable, sizeof(__pyx_k_AbstractLinkable), 0, 0, 1, 1}, + {&__pyx_n_s_AbstractLinkable__notify_links, __pyx_k_AbstractLinkable__notify_links, sizeof(__pyx_k_AbstractLinkable__notify_links), 0, 0, 1, 1}, + {&__pyx_n_s_AbstractLinkable_linkcount, __pyx_k_AbstractLinkable_linkcount, sizeof(__pyx_k_AbstractLinkable_linkcount), 0, 0, 1, 1}, + {&__pyx_n_s_AbstractLinkable_rawlink, __pyx_k_AbstractLinkable_rawlink, sizeof(__pyx_k_AbstractLinkable_rawlink), 0, 0, 1, 1}, + {&__pyx_n_s_AbstractLinkable_ready, __pyx_k_AbstractLinkable_ready, sizeof(__pyx_k_AbstractLinkable_ready), 0, 0, 1, 1}, + {&__pyx_n_s_AbstractLinkable_unlink, __pyx_k_AbstractLinkable_unlink, sizeof(__pyx_k_AbstractLinkable_unlink), 0, 0, 1, 1}, + {&__pyx_kp_s_Expected_callable_r, __pyx_k_Expected_callable_r, sizeof(__pyx_k_Expected_callable_r), 0, 0, 1, 0}, + {&__pyx_n_s_InvalidSwitchError, __pyx_k_InvalidSwitchError, sizeof(__pyx_k_InvalidSwitchError), 0, 0, 1, 1}, + {&__pyx_kp_s_Invalid_switch_into_Event_wait_r, __pyx_k_Invalid_switch_into_Event_wait_r, sizeof(__pyx_k_Invalid_switch_into_Event_wait_r), 0, 0, 1, 0}, + {&__pyx_n_s_NotImplementedError, __pyx_k_NotImplementedError, sizeof(__pyx_k_NotImplementedError), 0, 0, 1, 1}, + {&__pyx_n_s_Timeout, __pyx_k_Timeout, sizeof(__pyx_k_Timeout), 0, 0, 1, 1}, + {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1}, + {&__pyx_n_s_all, __pyx_k_all, sizeof(__pyx_k_all), 0, 0, 1, 1}, + {&__pyx_n_s_auto_unlink, __pyx_k_auto_unlink, sizeof(__pyx_k_auto_unlink), 0, 0, 1, 1}, + {&__pyx_n_s_callback, __pyx_k_callback, sizeof(__pyx_k_callback), 0, 0, 1, 1}, + {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, + {&__pyx_n_s_enter, __pyx_k_enter, sizeof(__pyx_k_enter), 0, 0, 1, 1}, + {&__pyx_n_s_exc_info, __pyx_k_exc_info, sizeof(__pyx_k_exc_info), 0, 0, 1, 1}, + {&__pyx_n_s_exit, __pyx_k_exit, sizeof(__pyx_k_exit), 0, 0, 1, 1}, + {&__pyx_n_s_get_hub_noargs, __pyx_k_get_hub_noargs, sizeof(__pyx_k_get_hub_noargs), 0, 0, 1, 1}, + {&__pyx_n_s_getcurrent, __pyx_k_getcurrent, sizeof(__pyx_k_getcurrent), 0, 0, 1, 1}, + {&__pyx_n_s_gevent___abstract_linkable, __pyx_k_gevent___abstract_linkable, sizeof(__pyx_k_gevent___abstract_linkable), 0, 0, 1, 1}, + {&__pyx_n_s_gevent__hub_local, __pyx_k_gevent__hub_local, sizeof(__pyx_k_gevent__hub_local), 0, 0, 1, 1}, + {&__pyx_n_s_gevent__util, __pyx_k_gevent__util, sizeof(__pyx_k_gevent__util), 0, 0, 1, 1}, + {&__pyx_n_s_gevent_exceptions, __pyx_k_gevent_exceptions, sizeof(__pyx_k_gevent_exceptions), 0, 0, 1, 1}, + {&__pyx_n_s_gevent_timeout, __pyx_k_gevent_timeout, sizeof(__pyx_k_gevent_timeout), 0, 0, 1, 1}, + {&__pyx_n_s_greenlet, __pyx_k_greenlet, sizeof(__pyx_k_greenlet), 0, 0, 1, 1}, + {&__pyx_n_s_greenlet_imported, __pyx_k_greenlet_imported, sizeof(__pyx_k_greenlet_imported), 0, 0, 1, 1}, + {&__pyx_n_s_greenlet_init, __pyx_k_greenlet_init, sizeof(__pyx_k_greenlet_init), 0, 0, 1, 1}, + {&__pyx_n_s_handle_error, __pyx_k_handle_error, sizeof(__pyx_k_handle_error), 0, 0, 1, 1}, + {&__pyx_n_s_hub, __pyx_k_hub, sizeof(__pyx_k_hub), 0, 0, 1, 1}, + {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, + {&__pyx_n_s_import_c_accel, __pyx_k_import_c_accel, sizeof(__pyx_k_import_c_accel), 0, 0, 1, 1}, + {&__pyx_n_s_lambda, __pyx_k_lambda, sizeof(__pyx_k_lambda), 0, 0, 1, 1}, + {&__pyx_n_s_linkcount, __pyx_k_linkcount, sizeof(__pyx_k_linkcount), 0, 0, 1, 1}, + {&__pyx_n_s_links, __pyx_k_links, sizeof(__pyx_k_links), 0, 0, 1, 1}, + {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, + {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, + {&__pyx_n_s_notifier, __pyx_k_notifier, sizeof(__pyx_k_notifier), 0, 0, 1, 1}, + {&__pyx_n_s_notify_all, __pyx_k_notify_all, sizeof(__pyx_k_notify_all), 0, 0, 1, 1}, + {&__pyx_n_s_notify_links, __pyx_k_notify_links, sizeof(__pyx_k_notify_links), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_capi, __pyx_k_pyx_capi, sizeof(__pyx_k_pyx_capi), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1}, + {&__pyx_n_s_rawlink, __pyx_k_rawlink, sizeof(__pyx_k_rawlink), 0, 0, 1, 1}, + {&__pyx_n_s_ready, __pyx_k_ready, sizeof(__pyx_k_ready), 0, 0, 1, 1}, + {&__pyx_n_s_run_callback, __pyx_k_run_callback, sizeof(__pyx_k_run_callback), 0, 0, 1, 1}, + {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1}, + {&__pyx_n_s_slots, __pyx_k_slots, sizeof(__pyx_k_slots), 0, 0, 1, 1}, + {&__pyx_kp_s_src_gevent__abstract_linkable_py, __pyx_k_src_gevent__abstract_linkable_py, sizeof(__pyx_k_src_gevent__abstract_linkable_py), 0, 0, 1, 0}, + {&__pyx_n_s_start_new_or_dummy, __pyx_k_start_new_or_dummy, sizeof(__pyx_k_start_new_or_dummy), 0, 0, 1, 1}, + {&__pyx_n_s_stop, __pyx_k_stop, sizeof(__pyx_k_stop), 0, 0, 1, 1}, + {&__pyx_n_s_switch, __pyx_k_switch, sizeof(__pyx_k_switch), 0, 0, 1, 1}, + {&__pyx_n_s_sys, __pyx_k_sys, sizeof(__pyx_k_sys), 0, 0, 1, 1}, + {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, + {&__pyx_n_s_unlink, __pyx_k_unlink, sizeof(__pyx_k_unlink), 0, 0, 1, 1}, + {&__pyx_n_s_weakref, __pyx_k_weakref, sizeof(__pyx_k_weakref), 0, 0, 1, 1}, + {0, 0, 0, 0, 0, 0, 0} +}; +static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { + __pyx_builtin___import__ = __Pyx_GetBuiltinName(__pyx_n_s_import); if (!__pyx_builtin___import__) __PYX_ERR(0, 18, __pyx_L1_error) + __pyx_builtin_NotImplementedError = __Pyx_GetBuiltinName(__pyx_n_s_NotImplementedError); if (!__pyx_builtin_NotImplementedError) __PYX_ERR(0, 78, __pyx_L1_error) + __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(0, 97, __pyx_L1_error) + return 0; + __pyx_L1_error:; + return -1; +} + +static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); + + /* "src/gevent/_abstract_linkable.py":165 + * self.rawlink(switch) + * try: + * with Timeout._start_new_or_dummy(timeout) as timer: # <<<<<<<<<<<<<< + * try: + * if self.hub is None: + */ + __pyx_tuple__2 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 165, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2); + __Pyx_GIVEREF(__pyx_tuple__2); + + /* "src/gevent/_abstract_linkable.py":18 + * from gevent.timeout import Timeout + * + * locals()['getcurrent'] = __import__('greenlet').getcurrent # <<<<<<<<<<<<<< + * locals()['greenlet_init'] = lambda: None + * + */ + __pyx_tuple__3 = PyTuple_Pack(1, __pyx_n_s_greenlet); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 18, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__3); + __Pyx_GIVEREF(__pyx_tuple__3); + + /* "src/gevent/_abstract_linkable.py":30 + * # one-time events (AsyncResult). + * + * __slots__ = ('hub', '_links', '_notifier', '_notify_all', '__weakref__') # <<<<<<<<<<<<<< + * + * def __init__(self): + */ + __pyx_tuple__4 = PyTuple_Pack(5, __pyx_n_s_hub, __pyx_n_s_links, __pyx_n_s_notifier, __pyx_n_s_notify_all, __pyx_n_s_weakref); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 30, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__4); + __Pyx_GIVEREF(__pyx_tuple__4); + + /* "src/gevent/_abstract_linkable.py":72 + * self.hub = None + * + * def linkcount(self): # <<<<<<<<<<<<<< + * # For testing: how many objects are linked to this one? + * return len(self._links) + */ + __pyx_tuple__5 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 72, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__5); + __Pyx_GIVEREF(__pyx_tuple__5); + __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__5, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__abstract_linkable_py, __pyx_n_s_linkcount, 72, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__6)) __PYX_ERR(0, 72, __pyx_L1_error) + + /* "src/gevent/_abstract_linkable.py":76 + * return len(self._links) + * + * def ready(self): # <<<<<<<<<<<<<< + * # Instances must define this + * raise NotImplementedError + */ + __pyx_tuple__7 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 76, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__7); + __Pyx_GIVEREF(__pyx_tuple__7); + __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__abstract_linkable_py, __pyx_n_s_ready, 76, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) __PYX_ERR(0, 76, __pyx_L1_error) + + /* "src/gevent/_abstract_linkable.py":88 + * self._notifier = self.hub.loop.run_callback(self._notify_links) + * + * def rawlink(self, callback): # <<<<<<<<<<<<<< + * """ + * Register a callback to call when this object is ready. + */ + __pyx_tuple__9 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_callback); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 88, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__9); + __Pyx_GIVEREF(__pyx_tuple__9); + __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__9, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__abstract_linkable_py, __pyx_n_s_rawlink, 88, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__10)) __PYX_ERR(0, 88, __pyx_L1_error) + + /* "src/gevent/_abstract_linkable.py":102 + * self._check_and_notify() + * + * def unlink(self, callback): # <<<<<<<<<<<<<< + * """Remove the callback set by :meth:`rawlink`""" + * self._links.discard(callback) + */ + __pyx_tuple__11 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_callback); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 102, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__11); + __Pyx_GIVEREF(__pyx_tuple__11); + __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__11, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__abstract_linkable_py, __pyx_n_s_unlink, 102, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(0, 102, __pyx_L1_error) + + /* "src/gevent/_abstract_linkable.py":114 + * + * + * def _notify_links(self): # <<<<<<<<<<<<<< + * # We release self._notifier here. We are called by it + * # at the end of the loop, and it is now false in a boolean way (as soon + */ + __pyx_tuple__13 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 114, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__13); + __Pyx_GIVEREF(__pyx_tuple__13); + __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__13, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__abstract_linkable_py, __pyx_n_s_notify_links, 114, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__14)) __PYX_ERR(0, 114, __pyx_L1_error) + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} + +static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { + if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + return 0; + __pyx_L1_error:; + return -1; +} + +static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/ + +static int __Pyx_modinit_global_init_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); + /*--- Global init code ---*/ + __pyx_v_6gevent_19__abstract_linkable_InvalidSwitchError = Py_None; Py_INCREF(Py_None); + __pyx_v_6gevent_19__abstract_linkable_Timeout = Py_None; Py_INCREF(Py_None); + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_variable_export_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); + /*--- Variable export code ---*/ + if (__Pyx_ExportVoidPtr(__pyx_n_s_InvalidSwitchError, (void *)&__pyx_v_6gevent_19__abstract_linkable_InvalidSwitchError, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportVoidPtr(__pyx_n_s_Timeout, (void *)&__pyx_v_6gevent_19__abstract_linkable_Timeout, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportVoidPtr(__pyx_n_s_greenlet_imported, (void *)&__pyx_v_6gevent_19__abstract_linkable__greenlet_imported, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_modinit_function_export_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); + /*--- Function export code ---*/ + if (__Pyx_ExportFunction("_init", (void (*)(void))__pyx_f_6gevent_19__abstract_linkable__init, "void (void)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_modinit_type_init_code(void) { + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); + /*--- Type init code ---*/ + __pyx_t_1 = PyImport_ImportModule("greenlet"); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_ptype_6gevent_19__abstract_linkable_greenlet = __Pyx_ImportType(__pyx_t_1, "greenlet", "greenlet", sizeof(PyGreenlet), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_19__abstract_linkable_greenlet) __PYX_ERR(2, 12, __pyx_L1_error) + __pyx_vtabptr_6gevent_19__abstract_linkable_AbstractLinkable = &__pyx_vtable_6gevent_19__abstract_linkable_AbstractLinkable; + __pyx_vtable_6gevent_19__abstract_linkable_AbstractLinkable.rawlink = (PyObject *(*)(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *, PyObject *, int __pyx_skip_dispatch))__pyx_f_6gevent_19__abstract_linkable_16AbstractLinkable_rawlink; + __pyx_vtable_6gevent_19__abstract_linkable_AbstractLinkable.ready = (int (*)(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *, int __pyx_skip_dispatch))__pyx_f_6gevent_19__abstract_linkable_16AbstractLinkable_ready; + __pyx_vtable_6gevent_19__abstract_linkable_AbstractLinkable.unlink = (PyObject *(*)(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *, PyObject *, int __pyx_skip_dispatch))__pyx_f_6gevent_19__abstract_linkable_16AbstractLinkable_unlink; + __pyx_vtable_6gevent_19__abstract_linkable_AbstractLinkable._check_and_notify = (PyObject *(*)(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *))__pyx_f_6gevent_19__abstract_linkable_16AbstractLinkable__check_and_notify; + __pyx_vtable_6gevent_19__abstract_linkable_AbstractLinkable._notify_links = (PyObject *(*)(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *, int __pyx_skip_dispatch))__pyx_f_6gevent_19__abstract_linkable_16AbstractLinkable__notify_links; + __pyx_vtable_6gevent_19__abstract_linkable_AbstractLinkable._wait_core = (PyObject *(*)(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *, PyObject *, struct __pyx_opt_args_6gevent_19__abstract_linkable_16AbstractLinkable__wait_core *__pyx_optional_args))__pyx_f_6gevent_19__abstract_linkable_16AbstractLinkable__wait_core; + __pyx_vtable_6gevent_19__abstract_linkable_AbstractLinkable._wait_return_value = (PyObject *(*)(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *, PyObject *, PyObject *))__pyx_f_6gevent_19__abstract_linkable_16AbstractLinkable__wait_return_value; + __pyx_vtable_6gevent_19__abstract_linkable_AbstractLinkable._wait = (PyObject *(*)(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *, struct __pyx_opt_args_6gevent_19__abstract_linkable_16AbstractLinkable__wait *__pyx_optional_args))__pyx_f_6gevent_19__abstract_linkable_16AbstractLinkable__wait; + if (PyType_Ready(&__pyx_type_6gevent_19__abstract_linkable_AbstractLinkable) < 0) __PYX_ERR(0, 25, __pyx_L1_error) + __pyx_type_6gevent_19__abstract_linkable_AbstractLinkable.tp_print = 0; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6gevent_19__abstract_linkable_AbstractLinkable.tp_dictoffset && __pyx_type_6gevent_19__abstract_linkable_AbstractLinkable.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_type_6gevent_19__abstract_linkable_AbstractLinkable.tp_getattro = __Pyx_PyObject_GenericGetAttr; + } + if (__Pyx_SetVtable(__pyx_type_6gevent_19__abstract_linkable_AbstractLinkable.tp_dict, __pyx_vtabptr_6gevent_19__abstract_linkable_AbstractLinkable) < 0) __PYX_ERR(0, 25, __pyx_L1_error) + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_AbstractLinkable, (PyObject *)&__pyx_type_6gevent_19__abstract_linkable_AbstractLinkable) < 0) __PYX_ERR(0, 25, __pyx_L1_error) + if (__pyx_type_6gevent_19__abstract_linkable_AbstractLinkable.tp_weaklistoffset == 0) __pyx_type_6gevent_19__abstract_linkable_AbstractLinkable.tp_weaklistoffset = offsetof(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable, __weakref__); + __pyx_ptype_6gevent_19__abstract_linkable_AbstractLinkable = &__pyx_type_6gevent_19__abstract_linkable_AbstractLinkable; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_modinit_type_import_code(void) { + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); + /*--- Type import code ---*/ + __pyx_t_1 = PyImport_ImportModule("greenlet"); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_ptype_6gevent_21__greenlet_primitives_greenlet = __Pyx_ImportType(__pyx_t_1, "greenlet", "greenlet", sizeof(PyGreenlet), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_21__greenlet_primitives_greenlet) __PYX_ERR(1, 12, __pyx_L1_error) + __pyx_t_2 = PyImport_ImportModule("gevent.__greenlet_primitives"); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 37, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_ptype_6gevent_21__greenlet_primitives_TrackedRawGreenlet = __Pyx_ImportType(__pyx_t_2, "gevent.__greenlet_primitives", "TrackedRawGreenlet", sizeof(struct __pyx_obj_6gevent_21__greenlet_primitives_TrackedRawGreenlet), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_21__greenlet_primitives_TrackedRawGreenlet) __PYX_ERR(1, 37, __pyx_L1_error) + __pyx_ptype_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop = __Pyx_ImportType(__pyx_t_2, "gevent.__greenlet_primitives", "SwitchOutGreenletWithLoop", sizeof(struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop) __PYX_ERR(1, 40, __pyx_L1_error) + __pyx_vtabptr_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop = (struct __pyx_vtabstruct_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop*)__Pyx_GetVtable(__pyx_ptype_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop->tp_dict); if (unlikely(!__pyx_vtabptr_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop)) __PYX_ERR(1, 40, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_modinit_variable_import_code(void) { + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); + /*--- Variable import code ---*/ + __pyx_t_1 = PyImport_ImportModule("gevent.__greenlet_primitives"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_1, "get_objects", (void **)&__pyx_vp_6gevent_21__greenlet_primitives_get_objects, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_1, "wref", (void **)&__pyx_vp_6gevent_21__greenlet_primitives_wref, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_1, "BlockingSwitchOutError", (void **)&__pyx_vp_6gevent_21__greenlet_primitives_BlockingSwitchOutError, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_1, "_greenlet_imported", (void **)&__pyx_vp_6gevent_21__greenlet_primitives__greenlet_imported, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + Py_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_2 = PyImport_ImportModule("gevent.__hub_local"); if (!__pyx_t_2) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_2, "_threadlocal", (void **)&__pyx_vp_6gevent_11__hub_local__threadlocal, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + Py_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_modinit_function_import_code(void) { + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); + /*--- Function import code ---*/ + __pyx_t_1 = PyImport_ImportModule("gevent.__hub_local"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportFunction(__pyx_t_1, "get_hub_noargs", (void (**)(void))&__pyx_f_6gevent_11__hub_local_get_hub_noargs, "struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *(int __pyx_skip_dispatch)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + Py_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_RefNannyFinishContext(); + return -1; +} + + +#if PY_MAJOR_VERSION < 3 +#ifdef CYTHON_NO_PYINIT_EXPORT +#define __Pyx_PyMODINIT_FUNC void +#else +#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC +#endif +#else +#ifdef CYTHON_NO_PYINIT_EXPORT +#define __Pyx_PyMODINIT_FUNC PyObject * +#else +#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC +#endif +#endif + + +#if PY_MAJOR_VERSION < 3 +__Pyx_PyMODINIT_FUNC init__abstract_linkable(void) CYTHON_SMALL_CODE; /*proto*/ +__Pyx_PyMODINIT_FUNC init__abstract_linkable(void) +#else +__Pyx_PyMODINIT_FUNC PyInit___abstract_linkable(void) CYTHON_SMALL_CODE; /*proto*/ +__Pyx_PyMODINIT_FUNC PyInit___abstract_linkable(void) +#if CYTHON_PEP489_MULTI_PHASE_INIT +{ + return PyModuleDef_Init(&__pyx_moduledef); +} +static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { + #if PY_VERSION_HEX >= 0x030700A1 + static PY_INT64_T main_interpreter_id = -1; + PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); + if (main_interpreter_id == -1) { + main_interpreter_id = current_id; + return (unlikely(current_id == -1)) ? -1 : 0; + } else if (unlikely(main_interpreter_id != current_id)) + #else + static PyInterpreterState *main_interpreter = NULL; + PyInterpreterState *current_interpreter = PyThreadState_Get()->interp; + if (!main_interpreter) { + main_interpreter = current_interpreter; + } else if (unlikely(main_interpreter != current_interpreter)) + #endif + { + PyErr_SetString( + PyExc_ImportError, + "Interpreter change detected - this module can only be loaded into one interpreter per process."); + return -1; + } + return 0; +} +static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) { + PyObject *value = PyObject_GetAttrString(spec, from_name); + int result = 0; + if (likely(value)) { + if (allow_none || value != Py_None) { + result = PyDict_SetItemString(moddict, to_name, value); + } + Py_DECREF(value); + } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_Clear(); + } else { + result = -1; + } + return result; +} +static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) { + PyObject *module = NULL, *moddict, *modname; + if (__Pyx_check_single_interpreter()) + return NULL; + if (__pyx_m) + return __Pyx_NewRef(__pyx_m); + modname = PyObject_GetAttrString(spec, "name"); + if (unlikely(!modname)) goto bad; + module = PyModule_NewObject(modname); + Py_DECREF(modname); + if (unlikely(!module)) goto bad; + moddict = PyModule_GetDict(module); + if (unlikely(!moddict)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad; + return module; +bad: + Py_XDECREF(module); + return NULL; +} + + +static CYTHON_SMALL_CODE int __pyx_pymod_exec___abstract_linkable(PyObject *__pyx_pyinit_module) +#endif +#endif +{ + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannyDeclarations + #if CYTHON_PEP489_MULTI_PHASE_INIT + if (__pyx_m) { + if (__pyx_m == __pyx_pyinit_module) return 0; + PyErr_SetString(PyExc_RuntimeError, "Module '__abstract_linkable' has already been imported. Re-initialisation is not supported."); + return -1; + } + #elif PY_MAJOR_VERSION >= 3 + if (__pyx_m) return __Pyx_NewRef(__pyx_m); + #endif + #if CYTHON_REFNANNY +__Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); +if (!__Pyx_RefNanny) { + PyErr_Clear(); + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); + if (!__Pyx_RefNanny) + Py_FatalError("failed to import 'refnanny' module"); +} +#endif + __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit___abstract_linkable(void)", 0); + if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #ifdef __Pxy_PyFrame_Initialize_Offsets + __Pxy_PyFrame_Initialize_Offsets(); + #endif + __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) + #ifdef __Pyx_CyFunction_USED + if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_FusedFunction_USED + if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_Coroutine_USED + if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_Generator_USED + if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_AsyncGen_USED + if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_StopAsyncIteration_USED + if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + /*--- Library function declarations ---*/ + /*--- Threads initialization code ---*/ + #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS + #ifdef WITH_THREAD /* Python build with threading support? */ + PyEval_InitThreads(); + #endif + #endif + /*--- Module creation code ---*/ + #if CYTHON_PEP489_MULTI_PHASE_INIT + __pyx_m = __pyx_pyinit_module; + Py_INCREF(__pyx_m); + #else + #if PY_MAJOR_VERSION < 3 + __pyx_m = Py_InitModule4("__abstract_linkable", __pyx_methods, __pyx_k_Internal_module_support_for_the, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); + #else + __pyx_m = PyModule_Create(&__pyx_moduledef); + #endif + if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) + Py_INCREF(__pyx_d); + __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) + #if CYTHON_COMPILING_IN_PYPY + Py_INCREF(__pyx_b); + #endif + if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + /*--- Initialize various global constants etc. ---*/ + if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) + if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + if (__pyx_module_is_main_gevent____abstract_linkable) { + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + } + #if PY_MAJOR_VERSION >= 3 + { + PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) + if (!PyDict_GetItemString(modules, "gevent.__abstract_linkable")) { + if (unlikely(PyDict_SetItemString(modules, "gevent.__abstract_linkable", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error) + } + } + #endif + /*--- Builtin init code ---*/ + if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + /*--- Constants init code ---*/ + if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + /*--- Global type/function init code ---*/ + (void)__Pyx_modinit_global_init_code(); + if (unlikely(__Pyx_modinit_variable_export_code() != 0)) goto __pyx_L1_error; + if (unlikely(__Pyx_modinit_function_export_code() != 0)) goto __pyx_L1_error; + if (unlikely(__Pyx_modinit_type_init_code() != 0)) goto __pyx_L1_error; + if (unlikely(__Pyx_modinit_type_import_code() != 0)) goto __pyx_L1_error; + if (unlikely(__Pyx_modinit_variable_import_code() != 0)) goto __pyx_L1_error; + if (unlikely(__Pyx_modinit_function_import_code() != 0)) goto __pyx_L1_error; + /*--- Execution code ---*/ + #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) + if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + + /* "src/gevent/_abstract_linkable.py":11 + * from __future__ import print_function + * + * import sys # <<<<<<<<<<<<<< + * + * from gevent._hub_local import get_hub_noargs as get_hub + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_sys, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 11, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_sys, __pyx_t_1) < 0) __PYX_ERR(0, 11, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_abstract_linkable.py":13 + * import sys + * + * from gevent._hub_local import get_hub_noargs as get_hub # <<<<<<<<<<<<<< + * + * from gevent.exceptions import InvalidSwitchError + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_get_hub_noargs); + __Pyx_GIVEREF(__pyx_n_s_get_hub_noargs); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_get_hub_noargs); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_gevent__hub_local, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_get_hub_noargs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_hub_noargs, __pyx_t_1) < 0) __PYX_ERR(0, 13, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/_abstract_linkable.py":15 + * from gevent._hub_local import get_hub_noargs as get_hub + * + * from gevent.exceptions import InvalidSwitchError # <<<<<<<<<<<<<< + * from gevent.timeout import Timeout + * + */ + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 15, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_InvalidSwitchError); + __Pyx_GIVEREF(__pyx_n_s_InvalidSwitchError); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_InvalidSwitchError); + __pyx_t_1 = __Pyx_Import(__pyx_n_s_gevent_exceptions, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 15, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_InvalidSwitchError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 15, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_v_6gevent_19__abstract_linkable_InvalidSwitchError); + __Pyx_DECREF_SET(__pyx_v_6gevent_19__abstract_linkable_InvalidSwitchError, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_abstract_linkable.py":16 + * + * from gevent.exceptions import InvalidSwitchError + * from gevent.timeout import Timeout # <<<<<<<<<<<<<< + * + * locals()['getcurrent'] = __import__('greenlet').getcurrent + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 16, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_Timeout); + __Pyx_GIVEREF(__pyx_n_s_Timeout); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_Timeout); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_gevent_timeout, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 16, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_Timeout); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 16, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_v_6gevent_19__abstract_linkable_Timeout); + __Pyx_DECREF_SET(__pyx_v_6gevent_19__abstract_linkable_Timeout, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/_abstract_linkable.py":18 + * from gevent.timeout import Timeout + * + * locals()['getcurrent'] = __import__('greenlet').getcurrent # <<<<<<<<<<<<<< + * locals()['greenlet_init'] = lambda: None + * + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin___import__, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 18, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_getcurrent); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 18, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_Globals(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 18, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (unlikely(PyDict_SetItem(__pyx_t_2, __pyx_n_s_getcurrent, __pyx_t_1) < 0)) __PYX_ERR(0, 18, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_abstract_linkable.py":19 + * + * locals()['getcurrent'] = __import__('greenlet').getcurrent + * locals()['greenlet_init'] = lambda: None # <<<<<<<<<<<<<< + * + * __all__ = [ + */ + __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_19__abstract_linkable_lambda, 0, __pyx_n_s_lambda, NULL, __pyx_n_s_gevent___abstract_linkable, __pyx_d, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 19, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_Globals(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 19, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (unlikely(PyDict_SetItem(__pyx_t_2, __pyx_n_s_greenlet_init, __pyx_t_1) < 0)) __PYX_ERR(0, 19, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_abstract_linkable.py":21 + * locals()['greenlet_init'] = lambda: None + * + * __all__ = [ # <<<<<<<<<<<<<< + * 'AbstractLinkable', + * ] + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 21, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_AbstractLinkable); + __Pyx_GIVEREF(__pyx_n_s_AbstractLinkable); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_AbstractLinkable); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_all, __pyx_t_1) < 0) __PYX_ERR(0, 21, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_abstract_linkable.py":30 + * # one-time events (AsyncResult). + * + * __slots__ = ('hub', '_links', '_notifier', '_notify_all', '__weakref__') # <<<<<<<<<<<<<< + * + * def __init__(self): + */ + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_19__abstract_linkable_AbstractLinkable->tp_dict, __pyx_n_s_slots, __pyx_tuple__4) < 0) __PYX_ERR(0, 30, __pyx_L1_error) + PyType_Modified(__pyx_ptype_6gevent_19__abstract_linkable_AbstractLinkable); + + /* "src/gevent/_abstract_linkable.py":72 + * self.hub = None + * + * def linkcount(self): # <<<<<<<<<<<<<< + * # For testing: how many objects are linked to this one? + * return len(self._links) + */ + __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_19__abstract_linkable_16AbstractLinkable_3linkcount, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AbstractLinkable_linkcount, NULL, __pyx_n_s_gevent___abstract_linkable, __pyx_d, ((PyObject *)__pyx_codeobj__6)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 72, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_19__abstract_linkable_AbstractLinkable->tp_dict, __pyx_n_s_linkcount, __pyx_t_1) < 0) __PYX_ERR(0, 72, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + PyType_Modified(__pyx_ptype_6gevent_19__abstract_linkable_AbstractLinkable); + + /* "src/gevent/_abstract_linkable.py":76 + * return len(self._links) + * + * def ready(self): # <<<<<<<<<<<<<< + * # Instances must define this + * raise NotImplementedError + */ + __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_19__abstract_linkable_16AbstractLinkable_5ready, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AbstractLinkable_ready, NULL, __pyx_n_s_gevent___abstract_linkable, __pyx_d, ((PyObject *)__pyx_codeobj__8)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 76, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_19__abstract_linkable_AbstractLinkable->tp_dict, __pyx_n_s_ready, __pyx_t_1) < 0) __PYX_ERR(0, 76, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + PyType_Modified(__pyx_ptype_6gevent_19__abstract_linkable_AbstractLinkable); + + /* "src/gevent/_abstract_linkable.py":88 + * self._notifier = self.hub.loop.run_callback(self._notify_links) + * + * def rawlink(self, callback): # <<<<<<<<<<<<<< + * """ + * Register a callback to call when this object is ready. + */ + __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_19__abstract_linkable_16AbstractLinkable_7rawlink, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AbstractLinkable_rawlink, NULL, __pyx_n_s_gevent___abstract_linkable, __pyx_d, ((PyObject *)__pyx_codeobj__10)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 88, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_19__abstract_linkable_AbstractLinkable->tp_dict, __pyx_n_s_rawlink, __pyx_t_1) < 0) __PYX_ERR(0, 88, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + PyType_Modified(__pyx_ptype_6gevent_19__abstract_linkable_AbstractLinkable); + + /* "src/gevent/_abstract_linkable.py":102 + * self._check_and_notify() + * + * def unlink(self, callback): # <<<<<<<<<<<<<< + * """Remove the callback set by :meth:`rawlink`""" + * self._links.discard(callback) + */ + __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_19__abstract_linkable_16AbstractLinkable_9unlink, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AbstractLinkable_unlink, NULL, __pyx_n_s_gevent___abstract_linkable, __pyx_d, ((PyObject *)__pyx_codeobj__12)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 102, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_19__abstract_linkable_AbstractLinkable->tp_dict, __pyx_n_s_unlink, __pyx_t_1) < 0) __PYX_ERR(0, 102, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + PyType_Modified(__pyx_ptype_6gevent_19__abstract_linkable_AbstractLinkable); + + /* "src/gevent/_abstract_linkable.py":114 + * + * + * def _notify_links(self): # <<<<<<<<<<<<<< + * # We release self._notifier here. We are called by it + * # at the end of the loop, and it is now false in a boolean way (as soon + */ + __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_19__abstract_linkable_16AbstractLinkable_11_notify_links, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AbstractLinkable__notify_links, NULL, __pyx_n_s_gevent___abstract_linkable, __pyx_d, ((PyObject *)__pyx_codeobj__14)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 114, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_19__abstract_linkable_AbstractLinkable->tp_dict, __pyx_n_s_notify_links, __pyx_t_1) < 0) __PYX_ERR(0, 114, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + PyType_Modified(__pyx_ptype_6gevent_19__abstract_linkable_AbstractLinkable); + + /* "src/gevent/_abstract_linkable.py":157 + * self._check_and_notify() + * + * def _wait_core(self, timeout, catch=Timeout): # <<<<<<<<<<<<<< + * # The core of the wait implementation, handling + * # switching and linking. If *catch* is set to (), + */ + __Pyx_INCREF(__pyx_v_6gevent_19__abstract_linkable_Timeout); + __pyx_k_ = __pyx_v_6gevent_19__abstract_linkable_Timeout; + __Pyx_GIVEREF(__pyx_v_6gevent_19__abstract_linkable_Timeout); + + /* "src/gevent/_abstract_linkable.py":198 + * greenlet_init() # pylint:disable=undefined-variable + * + * _init() # <<<<<<<<<<<<<< + * + * + */ + __pyx_f_6gevent_19__abstract_linkable__init(); + + /* "src/gevent/_abstract_linkable.py":201 + * + * + * from gevent._util import import_c_accel # <<<<<<<<<<<<<< + * import_c_accel(globals(), 'gevent.__abstract_linkable') + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 201, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_import_c_accel); + __Pyx_GIVEREF(__pyx_n_s_import_c_accel); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_import_c_accel); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_gevent__util, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 201, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_import_c_accel); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 201, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_import_c_accel, __pyx_t_1) < 0) __PYX_ERR(0, 201, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/_abstract_linkable.py":202 + * + * from gevent._util import import_c_accel + * import_c_accel(globals(), 'gevent.__abstract_linkable') # <<<<<<<<<<<<<< + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_import_c_accel); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 202, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_Globals(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 202, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 202, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_INCREF(__pyx_n_s_gevent___abstract_linkable); + __Pyx_GIVEREF(__pyx_n_s_gevent___abstract_linkable); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_n_s_gevent___abstract_linkable); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 202, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_abstract_linkable.py":1 + * # -*- coding: utf-8 -*- # <<<<<<<<<<<<<< + * # cython: auto_pickle=False,embedsignature=True,always_allow_keywords=False + * """ + */ + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "gevent/__abstract_linkable.pxd":24 + * return PyGreenlet_GetCurrent() + * + * cdef inline void greenlet_init(): # <<<<<<<<<<<<<< + * global _greenlet_imported + * if not _greenlet_imported: + */ + + /*--- Wrapped vars code ---*/ + + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + if (__pyx_m) { + if (__pyx_d) { + __Pyx_AddTraceback("init gevent.__abstract_linkable", __pyx_clineno, __pyx_lineno, __pyx_filename); + } + Py_CLEAR(__pyx_m); + } else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_ImportError, "init gevent.__abstract_linkable"); + } + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + #if CYTHON_PEP489_MULTI_PHASE_INIT + return (__pyx_m != NULL) ? 0 : -1; + #elif PY_MAJOR_VERSION >= 3 + return __pyx_m; + #else + return; + #endif +} + +/* --- Runtime support code --- */ +/* Refnanny */ +#if CYTHON_REFNANNY +static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { + PyObject *m = NULL, *p = NULL; + void *r = NULL; + m = PyImport_ImportModule(modname); + if (!m) goto end; + p = PyObject_GetAttrString(m, "RefNannyAPI"); + if (!p) goto end; + r = PyLong_AsVoidPtr(p); +end: + Py_XDECREF(p); + Py_XDECREF(m); + return (__Pyx_RefNannyAPIStruct *)r; +} +#endif + +/* PyObjectGetAttrStr */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_getattro)) + return tp->tp_getattro(obj, attr_name); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_getattr)) + return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); +#endif + return PyObject_GetAttr(obj, attr_name); +} +#endif + +/* GetBuiltinName */ +static PyObject *__Pyx_GetBuiltinName(PyObject *name) { + PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name); + if (unlikely(!result)) { + PyErr_Format(PyExc_NameError, +#if PY_MAJOR_VERSION >= 3 + "name '%U' is not defined", name); +#else + "name '%.200s' is not defined", PyString_AS_STRING(name)); +#endif + } + return result; +} + +/* RaiseArgTupleInvalid */ +static void __Pyx_RaiseArgtupleInvalid( + const char* func_name, + int exact, + Py_ssize_t num_min, + Py_ssize_t num_max, + Py_ssize_t num_found) +{ + Py_ssize_t num_expected; + const char *more_or_less; + if (num_found < num_min) { + num_expected = num_min; + more_or_less = "at least"; + } else { + num_expected = num_max; + more_or_less = "at most"; + } + if (exact) { + more_or_less = "exactly"; + } + PyErr_Format(PyExc_TypeError, + "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", + func_name, more_or_less, num_expected, + (num_expected == 1) ? "" : "s", num_found); +} + +/* KeywordStringCheck */ +static int __Pyx_CheckKeywordStrings( + PyObject *kwdict, + const char* function_name, + int kw_allowed) +{ + PyObject* key = 0; + Py_ssize_t pos = 0; +#if CYTHON_COMPILING_IN_PYPY + if (!kw_allowed && PyDict_Next(kwdict, &pos, &key, 0)) + goto invalid_keyword; + return 1; +#else + while (PyDict_Next(kwdict, &pos, &key, 0)) { + #if PY_MAJOR_VERSION < 3 + if (unlikely(!PyString_Check(key))) + #endif + if (unlikely(!PyUnicode_Check(key))) + goto invalid_keyword_type; + } + if ((!kw_allowed) && unlikely(key)) + goto invalid_keyword; + return 1; +invalid_keyword_type: + PyErr_Format(PyExc_TypeError, + "%.200s() keywords must be strings", function_name); + return 0; +#endif +invalid_keyword: + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION < 3 + "%.200s() got an unexpected keyword argument '%.200s'", + function_name, PyString_AsString(key)); + #else + "%s() got an unexpected keyword argument '%U'", + function_name, key); + #endif + return 0; +} + +/* PyFunctionFastCall */ +#if CYTHON_FAST_PYCALL +static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, + PyObject *globals) { + PyFrameObject *f; + PyThreadState *tstate = __Pyx_PyThreadState_Current; + PyObject **fastlocals; + Py_ssize_t i; + PyObject *result; + assert(globals != NULL); + /* XXX Perhaps we should create a specialized + PyFrame_New() that doesn't take locals, but does + take builtins without sanity checking them. + */ + assert(tstate != NULL); + f = PyFrame_New(tstate, co, globals, NULL); + if (f == NULL) { + return NULL; + } + fastlocals = __Pyx_PyFrame_GetLocalsplus(f); + for (i = 0; i < na; i++) { + Py_INCREF(*args); + fastlocals[i] = *args++; + } + result = PyEval_EvalFrameEx(f,0); + ++tstate->recursion_depth; + Py_DECREF(f); + --tstate->recursion_depth; + return result; +} +#if 1 || PY_VERSION_HEX < 0x030600B1 +static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs) { + PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); + PyObject *globals = PyFunction_GET_GLOBALS(func); + PyObject *argdefs = PyFunction_GET_DEFAULTS(func); + PyObject *closure; +#if PY_MAJOR_VERSION >= 3 + PyObject *kwdefs; +#endif + PyObject *kwtuple, **k; + PyObject **d; + Py_ssize_t nd; + Py_ssize_t nk; + PyObject *result; + assert(kwargs == NULL || PyDict_Check(kwargs)); + nk = kwargs ? PyDict_Size(kwargs) : 0; + if (Py_EnterRecursiveCall((char*)" while calling a Python object")) { + return NULL; + } + if ( +#if PY_MAJOR_VERSION >= 3 + co->co_kwonlyargcount == 0 && +#endif + likely(kwargs == NULL || nk == 0) && + co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { + if (argdefs == NULL && co->co_argcount == nargs) { + result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); + goto done; + } + else if (nargs == 0 && argdefs != NULL + && co->co_argcount == Py_SIZE(argdefs)) { + /* function called with no arguments, but all parameters have + a default value: use default values as arguments .*/ + args = &PyTuple_GET_ITEM(argdefs, 0); + result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); + goto done; + } + } + if (kwargs != NULL) { + Py_ssize_t pos, i; + kwtuple = PyTuple_New(2 * nk); + if (kwtuple == NULL) { + result = NULL; + goto done; + } + k = &PyTuple_GET_ITEM(kwtuple, 0); + pos = i = 0; + while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { + Py_INCREF(k[i]); + Py_INCREF(k[i+1]); + i += 2; + } + nk = i / 2; + } + else { + kwtuple = NULL; + k = NULL; + } + closure = PyFunction_GET_CLOSURE(func); +#if PY_MAJOR_VERSION >= 3 + kwdefs = PyFunction_GET_KW_DEFAULTS(func); +#endif + if (argdefs != NULL) { + d = &PyTuple_GET_ITEM(argdefs, 0); + nd = Py_SIZE(argdefs); + } + else { + d = NULL; + nd = 0; + } +#if PY_MAJOR_VERSION >= 3 + result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, + args, nargs, + k, (int)nk, + d, (int)nd, kwdefs, closure); +#else + result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, + args, nargs, + k, (int)nk, + d, (int)nd, closure); +#endif + Py_XDECREF(kwtuple); +done: + Py_LeaveRecursiveCall(); + return result; +} +#endif +#endif + +/* PyObjectCall */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { + PyObject *result; + ternaryfunc call = func->ob_type->tp_call; + if (unlikely(!call)) + return PyObject_Call(func, arg, kw); + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; + result = (*call)(func, arg, kw); + Py_LeaveRecursiveCall(); + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +/* PyObjectCallMethO */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { + PyObject *self, *result; + PyCFunction cfunc; + cfunc = PyCFunction_GET_FUNCTION(func); + self = PyCFunction_GET_SELF(func); + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; + result = cfunc(self, arg); + Py_LeaveRecursiveCall(); + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +/* PyObjectCallNoArg */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { +#if CYTHON_FAST_PYCALL + if (PyFunction_Check(func)) { + return __Pyx_PyFunction_FastCall(func, NULL, 0); + } +#endif +#ifdef __Pyx_CyFunction_USED + if (likely(PyCFunction_Check(func) || __Pyx_CyFunction_Check(func))) +#else + if (likely(PyCFunction_Check(func))) +#endif + { + if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) { + return __Pyx_PyObject_CallMethO(func, NULL); + } + } + return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL); +} +#endif + +/* PyCFunctionFastCall */ +#if CYTHON_FAST_PYCCALL +static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) { + PyCFunctionObject *func = (PyCFunctionObject*)func_obj; + PyCFunction meth = PyCFunction_GET_FUNCTION(func); + PyObject *self = PyCFunction_GET_SELF(func); + int flags = PyCFunction_GET_FLAGS(func); + assert(PyCFunction_Check(func)); + assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS))); + assert(nargs >= 0); + assert(nargs == 0 || args != NULL); + /* _PyCFunction_FastCallDict() must not be called with an exception set, + because it may clear it (directly or indirectly) and so the + caller loses its exception */ + assert(!PyErr_Occurred()); + if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) { + return (*((__Pyx_PyCFunctionFastWithKeywords)(void*)meth)) (self, args, nargs, NULL); + } else { + return (*((__Pyx_PyCFunctionFast)(void*)meth)) (self, args, nargs); + } +} +#endif + +/* PyObjectCallOneArg */ +#if CYTHON_COMPILING_IN_CPYTHON +static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) { + PyObject *result; + PyObject *args = PyTuple_New(1); + if (unlikely(!args)) return NULL; + Py_INCREF(arg); + PyTuple_SET_ITEM(args, 0, arg); + result = __Pyx_PyObject_Call(func, args, NULL); + Py_DECREF(args); + return result; +} +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { +#if CYTHON_FAST_PYCALL + if (PyFunction_Check(func)) { + return __Pyx_PyFunction_FastCall(func, &arg, 1); + } +#endif + if (likely(PyCFunction_Check(func))) { + if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) { + return __Pyx_PyObject_CallMethO(func, arg); +#if CYTHON_FAST_PYCCALL + } else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) { + return __Pyx_PyCFunction_FastCall(func, &arg, 1); +#endif + } + } + return __Pyx__PyObject_CallOneArg(func, arg); +} +#else +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { + PyObject *result; + PyObject *args = PyTuple_Pack(1, arg); + if (unlikely(!args)) return NULL; + result = __Pyx_PyObject_Call(func, args, NULL); + Py_DECREF(args); + return result; +} +#endif + +/* PyErrFetchRestore */ +#if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + tmp_type = tstate->curexc_type; + tmp_value = tstate->curexc_value; + tmp_tb = tstate->curexc_traceback; + tstate->curexc_type = type; + tstate->curexc_value = value; + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +} +static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { + *type = tstate->curexc_type; + *value = tstate->curexc_value; + *tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +} +#endif + +/* RaiseException */ +#if PY_MAJOR_VERSION < 3 +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, + CYTHON_UNUSED PyObject *cause) { + __Pyx_PyThreadState_declare + Py_XINCREF(type); + if (!value || value == Py_None) + value = NULL; + else + Py_INCREF(value); + if (!tb || tb == Py_None) + tb = NULL; + else { + Py_INCREF(tb); + if (!PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto raise_error; + } + } + if (PyType_Check(type)) { +#if CYTHON_COMPILING_IN_PYPY + if (!value) { + Py_INCREF(Py_None); + value = Py_None; + } +#endif + PyErr_NormalizeException(&type, &value, &tb); + } else { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto raise_error; + } + value = type; + type = (PyObject*) Py_TYPE(type); + Py_INCREF(type); + if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto raise_error; + } + } + __Pyx_PyThreadState_assign + __Pyx_ErrRestore(type, value, tb); + return; +raise_error: + Py_XDECREF(value); + Py_XDECREF(type); + Py_XDECREF(tb); + return; +} +#else +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { + PyObject* owned_instance = NULL; + if (tb == Py_None) { + tb = 0; + } else if (tb && !PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto bad; + } + if (value == Py_None) + value = 0; + if (PyExceptionInstance_Check(type)) { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto bad; + } + value = type; + type = (PyObject*) Py_TYPE(value); + } else if (PyExceptionClass_Check(type)) { + PyObject *instance_class = NULL; + if (value && PyExceptionInstance_Check(value)) { + instance_class = (PyObject*) Py_TYPE(value); + if (instance_class != type) { + int is_subclass = PyObject_IsSubclass(instance_class, type); + if (!is_subclass) { + instance_class = NULL; + } else if (unlikely(is_subclass == -1)) { + goto bad; + } else { + type = instance_class; + } + } + } + if (!instance_class) { + PyObject *args; + if (!value) + args = PyTuple_New(0); + else if (PyTuple_Check(value)) { + Py_INCREF(value); + args = value; + } else + args = PyTuple_Pack(1, value); + if (!args) + goto bad; + owned_instance = PyObject_Call(type, args, NULL); + Py_DECREF(args); + if (!owned_instance) + goto bad; + value = owned_instance; + if (!PyExceptionInstance_Check(value)) { + PyErr_Format(PyExc_TypeError, + "calling %R should have returned an instance of " + "BaseException, not %R", + type, Py_TYPE(value)); + goto bad; + } + } + } else { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto bad; + } + if (cause) { + PyObject *fixed_cause; + if (cause == Py_None) { + fixed_cause = NULL; + } else if (PyExceptionClass_Check(cause)) { + fixed_cause = PyObject_CallObject(cause, NULL); + if (fixed_cause == NULL) + goto bad; + } else if (PyExceptionInstance_Check(cause)) { + fixed_cause = cause; + Py_INCREF(fixed_cause); + } else { + PyErr_SetString(PyExc_TypeError, + "exception causes must derive from " + "BaseException"); + goto bad; + } + PyException_SetCause(value, fixed_cause); + } + PyErr_SetObject(type, value); + if (tb) { +#if CYTHON_COMPILING_IN_PYPY + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); + Py_INCREF(tb); + PyErr_Restore(tmp_type, tmp_value, tb); + Py_XDECREF(tmp_tb); +#else + PyThreadState *tstate = __Pyx_PyThreadState_Current; + PyObject* tmp_tb = tstate->curexc_traceback; + if (tb != tmp_tb) { + Py_INCREF(tb); + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_tb); + } +#endif + } +bad: + Py_XDECREF(owned_instance); + return; +} +#endif + +/* WriteUnraisableException */ +static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno, + CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename, + int full_traceback, CYTHON_UNUSED int nogil) { + PyObject *old_exc, *old_val, *old_tb; + PyObject *ctx; + __Pyx_PyThreadState_declare +#ifdef WITH_THREAD + PyGILState_STATE state; + if (nogil) + state = PyGILState_Ensure(); +#ifdef _MSC_VER + else state = (PyGILState_STATE)-1; +#endif +#endif + __Pyx_PyThreadState_assign + __Pyx_ErrFetch(&old_exc, &old_val, &old_tb); + if (full_traceback) { + Py_XINCREF(old_exc); + Py_XINCREF(old_val); + Py_XINCREF(old_tb); + __Pyx_ErrRestore(old_exc, old_val, old_tb); + PyErr_PrintEx(1); + } + #if PY_MAJOR_VERSION < 3 + ctx = PyString_FromString(name); + #else + ctx = PyUnicode_FromString(name); + #endif + __Pyx_ErrRestore(old_exc, old_val, old_tb); + if (!ctx) { + PyErr_WriteUnraisable(Py_None); + } else { + PyErr_WriteUnraisable(ctx); + Py_DECREF(ctx); + } +#ifdef WITH_THREAD + if (nogil) + PyGILState_Release(state); +#endif +} + +/* PyObjectCall2Args */ +static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) { + PyObject *args, *result = NULL; + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(function)) { + PyObject *args[2] = {arg1, arg2}; + return __Pyx_PyFunction_FastCall(function, args, 2); + } + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(function)) { + PyObject *args[2] = {arg1, arg2}; + return __Pyx_PyCFunction_FastCall(function, args, 2); + } + #endif + args = PyTuple_New(2); + if (unlikely(!args)) goto done; + Py_INCREF(arg1); + PyTuple_SET_ITEM(args, 0, arg1); + Py_INCREF(arg2); + PyTuple_SET_ITEM(args, 1, arg2); + Py_INCREF(function); + result = __Pyx_PyObject_Call(function, args, NULL); + Py_DECREF(args); + Py_DECREF(function); +done: + return result; +} + +/* pyfrozenset_new */ +static CYTHON_INLINE PyObject* __Pyx_PyFrozenSet_New(PyObject* it) { + if (it) { + PyObject* result; +#if CYTHON_COMPILING_IN_PYPY + PyObject* args; + args = PyTuple_Pack(1, it); + if (unlikely(!args)) + return NULL; + result = PyObject_Call((PyObject*)&PyFrozenSet_Type, args, NULL); + Py_DECREF(args); + return result; +#else + if (PyFrozenSet_CheckExact(it)) { + Py_INCREF(it); + return it; + } + result = PyFrozenSet_New(it); + if (unlikely(!result)) + return NULL; + if (likely(PySet_GET_SIZE(result))) + return result; + Py_DECREF(result); +#endif + } +#if CYTHON_USE_TYPE_SLOTS + return PyFrozenSet_Type.tp_new(&PyFrozenSet_Type, __pyx_empty_tuple, NULL); +#else + return PyObject_Call((PyObject*)&PyFrozenSet_Type, __pyx_empty_tuple, NULL); +#endif +} + +/* py_set_discard_unhashable */ +static int __Pyx_PySet_DiscardUnhashable(PyObject *set, PyObject *key) { + PyObject *tmpkey; + int rv; + if (likely(!PySet_Check(key) || !PyErr_ExceptionMatches(PyExc_TypeError))) + return -1; + PyErr_Clear(); + tmpkey = __Pyx_PyFrozenSet_New(key); + if (tmpkey == NULL) + return -1; + rv = PySet_Discard(set, tmpkey); + Py_DECREF(tmpkey); + return rv; +} + +/* py_set_discard */ +static CYTHON_INLINE int __Pyx_PySet_Discard(PyObject *set, PyObject *key) { + int found = PySet_Discard(set, key); + if (unlikely(found < 0)) { + found = __Pyx_PySet_DiscardUnhashable(set, key); + } + return found; +} + +/* IterFinish */ +static CYTHON_INLINE int __Pyx_IterFinish(void) { +#if CYTHON_FAST_THREAD_STATE + PyThreadState *tstate = __Pyx_PyThreadState_Current; + PyObject* exc_type = tstate->curexc_type; + if (unlikely(exc_type)) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) { + PyObject *exc_value, *exc_tb; + exc_value = tstate->curexc_value; + exc_tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; + Py_DECREF(exc_type); + Py_XDECREF(exc_value); + Py_XDECREF(exc_tb); + return 0; + } else { + return -1; + } + } + return 0; +#else + if (unlikely(PyErr_Occurred())) { + if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) { + PyErr_Clear(); + return 0; + } else { + return -1; + } + } + return 0; +#endif +} + +/* set_iter */ +static CYTHON_INLINE PyObject* __Pyx_set_iterator(PyObject* iterable, int is_set, + Py_ssize_t* p_orig_length, int* p_source_is_set) { +#if CYTHON_COMPILING_IN_CPYTHON + is_set = is_set || likely(PySet_CheckExact(iterable) || PyFrozenSet_CheckExact(iterable)); + *p_source_is_set = is_set; + if (likely(is_set)) { + *p_orig_length = PySet_Size(iterable); + Py_INCREF(iterable); + return iterable; + } +#else + (void)is_set; + *p_source_is_set = 0; +#endif + *p_orig_length = 0; + return PyObject_GetIter(iterable); +} +static CYTHON_INLINE int __Pyx_set_iter_next( + PyObject* iter_obj, Py_ssize_t orig_length, + Py_ssize_t* ppos, PyObject **value, + int source_is_set) { + if (!CYTHON_COMPILING_IN_CPYTHON || unlikely(!source_is_set)) { + *value = PyIter_Next(iter_obj); + if (unlikely(!*value)) { + return __Pyx_IterFinish(); + } + (void)orig_length; + (void)ppos; + return 1; + } +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(PySet_GET_SIZE(iter_obj) != orig_length)) { + PyErr_SetString( + PyExc_RuntimeError, + "set changed size during iteration"); + return -1; + } + { + Py_hash_t hash; + int ret = _PySet_NextEntry(iter_obj, ppos, value, &hash); + assert (ret != -1); + if (likely(ret)) { + Py_INCREF(*value); + return 1; + } + } +#endif + return 0; +} + +/* PySetContains */ +static int __Pyx_PySet_ContainsUnhashable(PyObject *set, PyObject *key) { + int result = -1; + if (PySet_Check(key) && PyErr_ExceptionMatches(PyExc_TypeError)) { + PyObject *tmpkey; + PyErr_Clear(); + tmpkey = __Pyx_PyFrozenSet_New(key); + if (tmpkey != NULL) { + result = PySet_Contains(set, tmpkey); + Py_DECREF(tmpkey); + } + } + return result; +} +static CYTHON_INLINE int __Pyx_PySet_ContainsTF(PyObject* key, PyObject* set, int eq) { + int result = PySet_Contains(set, key); + if (unlikely(result < 0)) { + result = __Pyx_PySet_ContainsUnhashable(set, key); + } + return unlikely(result < 0) ? result : (result == (eq == Py_EQ)); +} + +/* GetTopmostException */ +#if CYTHON_USE_EXC_INFO_STACK +static _PyErr_StackItem * +__Pyx_PyErr_GetTopmostException(PyThreadState *tstate) +{ + _PyErr_StackItem *exc_info = tstate->exc_info; + while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) && + exc_info->previous_item != NULL) + { + exc_info = exc_info->previous_item; + } + return exc_info; +} +#endif + +/* SaveResetException */ +#if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { + #if CYTHON_USE_EXC_INFO_STACK + _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate); + *type = exc_info->exc_type; + *value = exc_info->exc_value; + *tb = exc_info->exc_traceback; + #else + *type = tstate->exc_type; + *value = tstate->exc_value; + *tb = tstate->exc_traceback; + #endif + Py_XINCREF(*type); + Py_XINCREF(*value); + Py_XINCREF(*tb); +} +static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + #if CYTHON_USE_EXC_INFO_STACK + _PyErr_StackItem *exc_info = tstate->exc_info; + tmp_type = exc_info->exc_type; + tmp_value = exc_info->exc_value; + tmp_tb = exc_info->exc_traceback; + exc_info->exc_type = type; + exc_info->exc_value = value; + exc_info->exc_traceback = tb; + #else + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = type; + tstate->exc_value = value; + tstate->exc_traceback = tb; + #endif + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +} +#endif + +/* GetException */ +#if CYTHON_FAST_THREAD_STATE +static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) +#else +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) +#endif +{ + PyObject *local_type, *local_value, *local_tb; +#if CYTHON_FAST_THREAD_STATE + PyObject *tmp_type, *tmp_value, *tmp_tb; + local_type = tstate->curexc_type; + local_value = tstate->curexc_value; + local_tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +#else + PyErr_Fetch(&local_type, &local_value, &local_tb); +#endif + PyErr_NormalizeException(&local_type, &local_value, &local_tb); +#if CYTHON_FAST_THREAD_STATE + if (unlikely(tstate->curexc_type)) +#else + if (unlikely(PyErr_Occurred())) +#endif + goto bad; + #if PY_MAJOR_VERSION >= 3 + if (local_tb) { + if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) + goto bad; + } + #endif + Py_XINCREF(local_tb); + Py_XINCREF(local_type); + Py_XINCREF(local_value); + *type = local_type; + *value = local_value; + *tb = local_tb; +#if CYTHON_FAST_THREAD_STATE + #if CYTHON_USE_EXC_INFO_STACK + { + _PyErr_StackItem *exc_info = tstate->exc_info; + tmp_type = exc_info->exc_type; + tmp_value = exc_info->exc_value; + tmp_tb = exc_info->exc_traceback; + exc_info->exc_type = local_type; + exc_info->exc_value = local_value; + exc_info->exc_traceback = local_tb; + } + #else + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = local_type; + tstate->exc_value = local_value; + tstate->exc_traceback = local_tb; + #endif + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#else + PyErr_SetExcInfo(local_type, local_value, local_tb); +#endif + return 0; +bad: + *type = 0; + *value = 0; + *tb = 0; + Py_XDECREF(local_type); + Py_XDECREF(local_value); + Py_XDECREF(local_tb); + return -1; +} + +/* GetModuleGlobalName */ +#if CYTHON_USE_DICT_VERSIONS +static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value) +#else +static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) +#endif +{ + PyObject *result; +#if !CYTHON_AVOID_BORROWED_REFS +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 + result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } else if (unlikely(PyErr_Occurred())) { + return NULL; + } +#else + result = PyDict_GetItem(__pyx_d, name); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } +#endif +#else + result = PyObject_GetItem(__pyx_d, name); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } + PyErr_Clear(); +#endif + return __Pyx_GetBuiltinName(name); +} + +/* PyErrExceptionMatches */ +#if CYTHON_FAST_THREAD_STATE +static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { + Py_ssize_t i, n; + n = PyTuple_GET_SIZE(tuple); +#if PY_MAJOR_VERSION >= 3 + for (i=0; icurexc_type; + if (exc_type == err) return 1; + if (unlikely(!exc_type)) return 0; + if (unlikely(PyTuple_Check(err))) + return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err); + return __Pyx_PyErr_GivenExceptionMatches(exc_type, err); +} +#endif + +/* GetAttr */ +static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) { +#if CYTHON_USE_TYPE_SLOTS +#if PY_MAJOR_VERSION >= 3 + if (likely(PyUnicode_Check(n))) +#else + if (likely(PyString_Check(n))) +#endif + return __Pyx_PyObject_GetAttrStr(o, n); +#endif + return PyObject_GetAttr(o, n); +} + +/* GetAttr3 */ +static PyObject *__Pyx_GetAttr3Default(PyObject *d) { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) + return NULL; + __Pyx_PyErr_Clear(); + Py_INCREF(d); + return d; +} +static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) { + PyObject *r = __Pyx_GetAttr(o, n); + return (likely(r)) ? r : __Pyx_GetAttr3Default(d); +} + +/* SwapException */ +#if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + #if CYTHON_USE_EXC_INFO_STACK + _PyErr_StackItem *exc_info = tstate->exc_info; + tmp_type = exc_info->exc_type; + tmp_value = exc_info->exc_value; + tmp_tb = exc_info->exc_traceback; + exc_info->exc_type = *type; + exc_info->exc_value = *value; + exc_info->exc_traceback = *tb; + #else + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = *type; + tstate->exc_value = *value; + tstate->exc_traceback = *tb; + #endif + *type = tmp_type; + *value = tmp_value; + *tb = tmp_tb; +} +#else +static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb); + PyErr_SetExcInfo(*type, *value, *tb); + *type = tmp_type; + *value = tmp_value; + *tb = tmp_tb; +} +#endif + +/* TypeImport */ +#ifndef __PYX_HAVE_RT_ImportType +#define __PYX_HAVE_RT_ImportType +static PyTypeObject *__Pyx_ImportType(PyObject *module, const char *module_name, const char *class_name, + size_t size, enum __Pyx_ImportType_CheckSize check_size) +{ + PyObject *result = 0; + char warning[200]; + Py_ssize_t basicsize; +#ifdef Py_LIMITED_API + PyObject *py_basicsize; +#endif + result = PyObject_GetAttrString(module, class_name); + if (!result) + goto bad; + if (!PyType_Check(result)) { + PyErr_Format(PyExc_TypeError, + "%.200s.%.200s is not a type object", + module_name, class_name); + goto bad; + } +#ifndef Py_LIMITED_API + basicsize = ((PyTypeObject *)result)->tp_basicsize; +#else + py_basicsize = PyObject_GetAttrString(result, "__basicsize__"); + if (!py_basicsize) + goto bad; + basicsize = PyLong_AsSsize_t(py_basicsize); + Py_DECREF(py_basicsize); + py_basicsize = 0; + if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred()) + goto bad; +#endif + if ((size_t)basicsize < size) { + PyErr_Format(PyExc_ValueError, + "%.200s.%.200s size changed, may indicate binary incompatibility. " + "Expected %zd from C header, got %zd from PyObject", + module_name, class_name, size, basicsize); + goto bad; + } + if (check_size == __Pyx_ImportType_CheckSize_Error && (size_t)basicsize != size) { + PyErr_Format(PyExc_ValueError, + "%.200s.%.200s size changed, may indicate binary incompatibility. " + "Expected %zd from C header, got %zd from PyObject", + module_name, class_name, size, basicsize); + goto bad; + } + else if (check_size == __Pyx_ImportType_CheckSize_Warn && (size_t)basicsize > size) { + PyOS_snprintf(warning, sizeof(warning), + "%s.%s size changed, may indicate binary incompatibility. " + "Expected %zd from C header, got %zd from PyObject", + module_name, class_name, size, basicsize); + if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad; + } + return (PyTypeObject *)result; +bad: + Py_XDECREF(result); + return NULL; +} +#endif + +/* PyObject_GenericGetAttrNoDict */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) { + PyErr_Format(PyExc_AttributeError, +#if PY_MAJOR_VERSION >= 3 + "'%.50s' object has no attribute '%U'", + tp->tp_name, attr_name); +#else + "'%.50s' object has no attribute '%.400s'", + tp->tp_name, PyString_AS_STRING(attr_name)); +#endif + return NULL; +} +static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) { + PyObject *descr; + PyTypeObject *tp = Py_TYPE(obj); + if (unlikely(!PyString_Check(attr_name))) { + return PyObject_GenericGetAttr(obj, attr_name); + } + assert(!tp->tp_dictoffset); + descr = _PyType_Lookup(tp, attr_name); + if (unlikely(!descr)) { + return __Pyx_RaiseGenericGetAttributeError(tp, attr_name); + } + Py_INCREF(descr); + #if PY_MAJOR_VERSION < 3 + if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS))) + #endif + { + descrgetfunc f = Py_TYPE(descr)->tp_descr_get; + if (unlikely(f)) { + PyObject *res = f(descr, obj, (PyObject *)tp); + Py_DECREF(descr); + return res; + } + } + return descr; +} +#endif + +/* PyObject_GenericGetAttr */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) { + if (unlikely(Py_TYPE(obj)->tp_dictoffset)) { + return PyObject_GenericGetAttr(obj, attr_name); + } + return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name); +} +#endif + +/* SetVTable */ +static int __Pyx_SetVtable(PyObject *dict, void *vtable) { +#if PY_VERSION_HEX >= 0x02070000 + PyObject *ob = PyCapsule_New(vtable, 0, 0); +#else + PyObject *ob = PyCObject_FromVoidPtr(vtable, 0); +#endif + if (!ob) + goto bad; + if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0) + goto bad; + Py_DECREF(ob); + return 0; +bad: + Py_XDECREF(ob); + return -1; +} + +/* GetVTable */ +static void* __Pyx_GetVtable(PyObject *dict) { + void* ptr; + PyObject *ob = PyObject_GetItem(dict, __pyx_n_s_pyx_vtable); + if (!ob) + goto bad; +#if PY_VERSION_HEX >= 0x02070000 + ptr = PyCapsule_GetPointer(ob, 0); +#else + ptr = PyCObject_AsVoidPtr(ob); +#endif + if (!ptr && !PyErr_Occurred()) + PyErr_SetString(PyExc_RuntimeError, "invalid vtable found for imported type"); + Py_DECREF(ob); + return ptr; +bad: + Py_XDECREF(ob); + return NULL; +} + +/* Import */ +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { + PyObject *empty_list = 0; + PyObject *module = 0; + PyObject *global_dict = 0; + PyObject *empty_dict = 0; + PyObject *list; + #if PY_MAJOR_VERSION < 3 + PyObject *py_import; + py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); + if (!py_import) + goto bad; + #endif + if (from_list) + list = from_list; + else { + empty_list = PyList_New(0); + if (!empty_list) + goto bad; + list = empty_list; + } + global_dict = PyModule_GetDict(__pyx_m); + if (!global_dict) + goto bad; + empty_dict = PyDict_New(); + if (!empty_dict) + goto bad; + { + #if PY_MAJOR_VERSION >= 3 + if (level == -1) { + if (strchr(__Pyx_MODULE_NAME, '.')) { + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, 1); + if (!module) { + if (!PyErr_ExceptionMatches(PyExc_ImportError)) + goto bad; + PyErr_Clear(); + } + } + level = 0; + } + #endif + if (!module) { + #if PY_MAJOR_VERSION < 3 + PyObject *py_level = PyInt_FromLong(level); + if (!py_level) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, py_level, (PyObject *)NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, level); + #endif + } + } +bad: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(py_import); + #endif + Py_XDECREF(empty_list); + Py_XDECREF(empty_dict); + return module; +} + +/* ImportFrom */ +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { + PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); + if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_Format(PyExc_ImportError, + #if PY_MAJOR_VERSION < 3 + "cannot import name %.230s", PyString_AS_STRING(name)); + #else + "cannot import name %S", name); + #endif + } + return value; +} + +/* FetchCommonType */ +static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { + PyObject* fake_module; + PyTypeObject* cached_type = NULL; + fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI); + if (!fake_module) return NULL; + Py_INCREF(fake_module); + cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name); + if (cached_type) { + if (!PyType_Check((PyObject*)cached_type)) { + PyErr_Format(PyExc_TypeError, + "Shared Cython type %.200s is not a type object", + type->tp_name); + goto bad; + } + if (cached_type->tp_basicsize != type->tp_basicsize) { + PyErr_Format(PyExc_TypeError, + "Shared Cython type %.200s has the wrong size, try recompiling", + type->tp_name); + goto bad; + } + } else { + if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; + PyErr_Clear(); + if (PyType_Ready(type) < 0) goto bad; + if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0) + goto bad; + Py_INCREF(type); + cached_type = type; + } +done: + Py_DECREF(fake_module); + return cached_type; +bad: + Py_XDECREF(cached_type); + cached_type = NULL; + goto done; +} + +/* CythonFunction */ +#include +static PyObject * +__Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure) +{ + if (unlikely(op->func_doc == NULL)) { + if (op->func.m_ml->ml_doc) { +#if PY_MAJOR_VERSION >= 3 + op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc); +#else + op->func_doc = PyString_FromString(op->func.m_ml->ml_doc); +#endif + if (unlikely(op->func_doc == NULL)) + return NULL; + } else { + Py_INCREF(Py_None); + return Py_None; + } + } + Py_INCREF(op->func_doc); + return op->func_doc; +} +static int +__Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context) +{ + PyObject *tmp = op->func_doc; + if (value == NULL) { + value = Py_None; + } + Py_INCREF(value); + op->func_doc = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + if (unlikely(op->func_name == NULL)) { +#if PY_MAJOR_VERSION >= 3 + op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name); +#else + op->func_name = PyString_InternFromString(op->func.m_ml->ml_name); +#endif + if (unlikely(op->func_name == NULL)) + return NULL; + } + Py_INCREF(op->func_name); + return op->func_name; +} +static int +__Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context) +{ + PyObject *tmp; +#if PY_MAJOR_VERSION >= 3 + if (unlikely(value == NULL || !PyUnicode_Check(value))) +#else + if (unlikely(value == NULL || !PyString_Check(value))) +#endif + { + PyErr_SetString(PyExc_TypeError, + "__name__ must be set to a string object"); + return -1; + } + tmp = op->func_name; + Py_INCREF(value); + op->func_name = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + Py_INCREF(op->func_qualname); + return op->func_qualname; +} +static int +__Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context) +{ + PyObject *tmp; +#if PY_MAJOR_VERSION >= 3 + if (unlikely(value == NULL || !PyUnicode_Check(value))) +#else + if (unlikely(value == NULL || !PyString_Check(value))) +#endif + { + PyErr_SetString(PyExc_TypeError, + "__qualname__ must be set to a string object"); + return -1; + } + tmp = op->func_qualname; + Py_INCREF(value); + op->func_qualname = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED void *closure) +{ + PyObject *self; + self = m->func_closure; + if (self == NULL) + self = Py_None; + Py_INCREF(self); + return self; +} +static PyObject * +__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + if (unlikely(op->func_dict == NULL)) { + op->func_dict = PyDict_New(); + if (unlikely(op->func_dict == NULL)) + return NULL; + } + Py_INCREF(op->func_dict); + return op->func_dict; +} +static int +__Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context) +{ + PyObject *tmp; + if (unlikely(value == NULL)) { + PyErr_SetString(PyExc_TypeError, + "function's dictionary may not be deleted"); + return -1; + } + if (unlikely(!PyDict_Check(value))) { + PyErr_SetString(PyExc_TypeError, + "setting function's dictionary to a non-dict"); + return -1; + } + tmp = op->func_dict; + Py_INCREF(value); + op->func_dict = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + Py_INCREF(op->func_globals); + return op->func_globals; +} +static PyObject * +__Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + Py_INCREF(Py_None); + return Py_None; +} +static PyObject * +__Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + PyObject* result = (op->func_code) ? op->func_code : Py_None; + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { + int result = 0; + PyObject *res = op->defaults_getter((PyObject *) op); + if (unlikely(!res)) + return -1; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + op->defaults_tuple = PyTuple_GET_ITEM(res, 0); + Py_INCREF(op->defaults_tuple); + op->defaults_kwdict = PyTuple_GET_ITEM(res, 1); + Py_INCREF(op->defaults_kwdict); + #else + op->defaults_tuple = PySequence_ITEM(res, 0); + if (unlikely(!op->defaults_tuple)) result = -1; + else { + op->defaults_kwdict = PySequence_ITEM(res, 1); + if (unlikely(!op->defaults_kwdict)) result = -1; + } + #endif + Py_DECREF(res); + return result; +} +static int +__Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) { + PyObject* tmp; + if (!value) { + value = Py_None; + } else if (value != Py_None && !PyTuple_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__defaults__ must be set to a tuple object"); + return -1; + } + Py_INCREF(value); + tmp = op->defaults_tuple; + op->defaults_tuple = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) { + PyObject* result = op->defaults_tuple; + if (unlikely(!result)) { + if (op->defaults_getter) { + if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL; + result = op->defaults_tuple; + } else { + result = Py_None; + } + } + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) { + PyObject* tmp; + if (!value) { + value = Py_None; + } else if (value != Py_None && !PyDict_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__kwdefaults__ must be set to a dict object"); + return -1; + } + Py_INCREF(value); + tmp = op->defaults_kwdict; + op->defaults_kwdict = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) { + PyObject* result = op->defaults_kwdict; + if (unlikely(!result)) { + if (op->defaults_getter) { + if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL; + result = op->defaults_kwdict; + } else { + result = Py_None; + } + } + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) { + PyObject* tmp; + if (!value || value == Py_None) { + value = NULL; + } else if (!PyDict_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__annotations__ must be set to a dict object"); + return -1; + } + Py_XINCREF(value); + tmp = op->func_annotations; + op->func_annotations = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) { + PyObject* result = op->func_annotations; + if (unlikely(!result)) { + result = PyDict_New(); + if (unlikely(!result)) return NULL; + op->func_annotations = result; + } + Py_INCREF(result); + return result; +} +static PyGetSetDef __pyx_CyFunction_getsets[] = { + {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, + {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, + {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, + {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, + {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, + {(char *) "__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0}, + {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, + {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, + {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, + {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, + {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, + {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, + {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, + {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, + {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, + {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, + {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, + {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, + {0, 0, 0, 0, 0} +}; +static PyMemberDef __pyx_CyFunction_members[] = { + {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), PY_WRITE_RESTRICTED, 0}, + {0, 0, 0, 0, 0} +}; +static PyObject * +__Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args) +{ +#if PY_MAJOR_VERSION >= 3 + return PyUnicode_FromString(m->func.m_ml->ml_name); +#else + return PyString_FromString(m->func.m_ml->ml_name); +#endif +} +static PyMethodDef __pyx_CyFunction_methods[] = { + {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, + {0, 0, 0, 0} +}; +#if PY_VERSION_HEX < 0x030500A0 +#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist) +#else +#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func.m_weakreflist) +#endif +static PyObject *__Pyx_CyFunction_New(PyTypeObject *type, PyMethodDef *ml, int flags, PyObject* qualname, + PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { + __pyx_CyFunctionObject *op = PyObject_GC_New(__pyx_CyFunctionObject, type); + if (op == NULL) + return NULL; + op->flags = flags; + __Pyx_CyFunction_weakreflist(op) = NULL; + op->func.m_ml = ml; + op->func.m_self = (PyObject *) op; + Py_XINCREF(closure); + op->func_closure = closure; + Py_XINCREF(module); + op->func.m_module = module; + op->func_dict = NULL; + op->func_name = NULL; + Py_INCREF(qualname); + op->func_qualname = qualname; + op->func_doc = NULL; + op->func_classobj = NULL; + op->func_globals = globals; + Py_INCREF(op->func_globals); + Py_XINCREF(code); + op->func_code = code; + op->defaults_pyobjects = 0; + op->defaults = NULL; + op->defaults_tuple = NULL; + op->defaults_kwdict = NULL; + op->defaults_getter = NULL; + op->func_annotations = NULL; + PyObject_GC_Track(op); + return (PyObject *) op; +} +static int +__Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) +{ + Py_CLEAR(m->func_closure); + Py_CLEAR(m->func.m_module); + Py_CLEAR(m->func_dict); + Py_CLEAR(m->func_name); + Py_CLEAR(m->func_qualname); + Py_CLEAR(m->func_doc); + Py_CLEAR(m->func_globals); + Py_CLEAR(m->func_code); + Py_CLEAR(m->func_classobj); + Py_CLEAR(m->defaults_tuple); + Py_CLEAR(m->defaults_kwdict); + Py_CLEAR(m->func_annotations); + if (m->defaults) { + PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); + int i; + for (i = 0; i < m->defaults_pyobjects; i++) + Py_XDECREF(pydefaults[i]); + PyObject_Free(m->defaults); + m->defaults = NULL; + } + return 0; +} +static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m) +{ + if (__Pyx_CyFunction_weakreflist(m) != NULL) + PyObject_ClearWeakRefs((PyObject *) m); + __Pyx_CyFunction_clear(m); + PyObject_GC_Del(m); +} +static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) +{ + PyObject_GC_UnTrack(m); + __Pyx__CyFunction_dealloc(m); +} +static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) +{ + Py_VISIT(m->func_closure); + Py_VISIT(m->func.m_module); + Py_VISIT(m->func_dict); + Py_VISIT(m->func_name); + Py_VISIT(m->func_qualname); + Py_VISIT(m->func_doc); + Py_VISIT(m->func_globals); + Py_VISIT(m->func_code); + Py_VISIT(m->func_classobj); + Py_VISIT(m->defaults_tuple); + Py_VISIT(m->defaults_kwdict); + if (m->defaults) { + PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); + int i; + for (i = 0; i < m->defaults_pyobjects; i++) + Py_VISIT(pydefaults[i]); + } + return 0; +} +static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type) +{ + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) { + Py_INCREF(func); + return func; + } + if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) { + if (type == NULL) + type = (PyObject *)(Py_TYPE(obj)); + return __Pyx_PyMethod_New(func, type, (PyObject *)(Py_TYPE(type))); + } + if (obj == Py_None) + obj = NULL; + return __Pyx_PyMethod_New(func, obj, type); +} +static PyObject* +__Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) +{ +#if PY_MAJOR_VERSION >= 3 + return PyUnicode_FromFormat("", + op->func_qualname, (void *)op); +#else + return PyString_FromFormat("", + PyString_AsString(op->func_qualname), (void *)op); +#endif +} +static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) { + PyCFunctionObject* f = (PyCFunctionObject*)func; + PyCFunction meth = f->m_ml->ml_meth; + Py_ssize_t size; + switch (f->m_ml->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) { + case METH_VARARGS: + if (likely(kw == NULL || PyDict_Size(kw) == 0)) + return (*meth)(self, arg); + break; + case METH_VARARGS | METH_KEYWORDS: + return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw); + case METH_NOARGS: + if (likely(kw == NULL || PyDict_Size(kw) == 0)) { + size = PyTuple_GET_SIZE(arg); + if (likely(size == 0)) + return (*meth)(self, NULL); + PyErr_Format(PyExc_TypeError, + "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", + f->m_ml->ml_name, size); + return NULL; + } + break; + case METH_O: + if (likely(kw == NULL || PyDict_Size(kw) == 0)) { + size = PyTuple_GET_SIZE(arg); + if (likely(size == 1)) { + PyObject *result, *arg0; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + arg0 = PyTuple_GET_ITEM(arg, 0); + #else + arg0 = PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL; + #endif + result = (*meth)(self, arg0); + #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) + Py_DECREF(arg0); + #endif + return result; + } + PyErr_Format(PyExc_TypeError, + "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", + f->m_ml->ml_name, size); + return NULL; + } + break; + default: + PyErr_SetString(PyExc_SystemError, "Bad call flags in " + "__Pyx_CyFunction_Call. METH_OLDARGS is no " + "longer supported!"); + return NULL; + } + PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", + f->m_ml->ml_name); + return NULL; +} +static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { + return __Pyx_CyFunction_CallMethod(func, ((PyCFunctionObject*)func)->m_self, arg, kw); +} +static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) { + PyObject *result; + __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func; + if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { + Py_ssize_t argc; + PyObject *new_args; + PyObject *self; + argc = PyTuple_GET_SIZE(args); + new_args = PyTuple_GetSlice(args, 1, argc); + if (unlikely(!new_args)) + return NULL; + self = PyTuple_GetItem(args, 0); + if (unlikely(!self)) { + Py_DECREF(new_args); + return NULL; + } + result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw); + Py_DECREF(new_args); + } else { + result = __Pyx_CyFunction_Call(func, args, kw); + } + return result; +} +static PyTypeObject __pyx_CyFunctionType_type = { + PyVarObject_HEAD_INIT(0, 0) + "cython_function_or_method", + sizeof(__pyx_CyFunctionObject), + 0, + (destructor) __Pyx_CyFunction_dealloc, + 0, + 0, + 0, +#if PY_MAJOR_VERSION < 3 + 0, +#else + 0, +#endif + (reprfunc) __Pyx_CyFunction_repr, + 0, + 0, + 0, + 0, + __Pyx_CyFunction_CallAsMethod, + 0, + 0, + 0, + 0, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, + 0, + (traverseproc) __Pyx_CyFunction_traverse, + (inquiry) __Pyx_CyFunction_clear, + 0, +#if PY_VERSION_HEX < 0x030500A0 + offsetof(__pyx_CyFunctionObject, func_weakreflist), +#else + offsetof(PyCFunctionObject, m_weakreflist), +#endif + 0, + 0, + __pyx_CyFunction_methods, + __pyx_CyFunction_members, + __pyx_CyFunction_getsets, + 0, + 0, + __Pyx_CyFunction_descr_get, + 0, + offsetof(__pyx_CyFunctionObject, func_dict), + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, +#if PY_VERSION_HEX >= 0x030400a1 + 0, +#endif +}; +static int __pyx_CyFunction_init(void) { + __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); + if (unlikely(__pyx_CyFunctionType == NULL)) { + return -1; + } + return 0; +} +static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults = PyObject_Malloc(size); + if (unlikely(!m->defaults)) + return PyErr_NoMemory(); + memset(m->defaults, 0, size); + m->defaults_pyobjects = pyobjects; + return m->defaults; +} +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults_tuple = tuple; + Py_INCREF(tuple); +} +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults_kwdict = dict; + Py_INCREF(dict); +} +static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->func_annotations = dict; + Py_INCREF(dict); +} + +/* Globals */ +static PyObject* __Pyx_Globals(void) { + Py_ssize_t i; + PyObject *names; + PyObject *globals = __pyx_d; + Py_INCREF(globals); + names = PyObject_Dir(__pyx_m); + if (!names) + goto bad; + for (i = PyList_GET_SIZE(names)-1; i >= 0; i--) { +#if CYTHON_COMPILING_IN_PYPY + PyObject* name = PySequence_ITEM(names, i); + if (!name) + goto bad; +#else + PyObject* name = PyList_GET_ITEM(names, i); +#endif + if (!PyDict_Contains(globals, name)) { + PyObject* value = __Pyx_GetAttr(__pyx_m, name); + if (!value) { +#if CYTHON_COMPILING_IN_PYPY + Py_DECREF(name); +#endif + goto bad; + } + if (PyDict_SetItem(globals, name, value) < 0) { +#if CYTHON_COMPILING_IN_PYPY + Py_DECREF(name); +#endif + Py_DECREF(value); + goto bad; + } + } +#if CYTHON_COMPILING_IN_PYPY + Py_DECREF(name); +#endif + } + Py_DECREF(names); + return globals; +bad: + Py_XDECREF(names); + Py_XDECREF(globals); + return NULL; +} + +/* CLineInTraceback */ +#ifndef CYTHON_CLINE_IN_TRACEBACK +static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { + PyObject *use_cline; + PyObject *ptype, *pvalue, *ptraceback; +#if CYTHON_COMPILING_IN_CPYTHON + PyObject **cython_runtime_dict; +#endif + if (unlikely(!__pyx_cython_runtime)) { + return c_line; + } + __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); +#if CYTHON_COMPILING_IN_CPYTHON + cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); + if (likely(cython_runtime_dict)) { + __PYX_PY_DICT_LOOKUP_IF_MODIFIED( + use_cline, *cython_runtime_dict, + __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback)) + } else +#endif + { + PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback); + if (use_cline_obj) { + use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; + Py_DECREF(use_cline_obj); + } else { + PyErr_Clear(); + use_cline = NULL; + } + } + if (!use_cline) { + c_line = 0; + PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); + } + else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { + c_line = 0; + } + __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); + return c_line; +} +#endif + +/* CodeObjectCache */ +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { + int start = 0, mid = 0, end = count - 1; + if (end >= 0 && code_line > entries[end].code_line) { + return count; + } + while (start < end) { + mid = start + (end - start) / 2; + if (code_line < entries[mid].code_line) { + end = mid; + } else if (code_line > entries[mid].code_line) { + start = mid + 1; + } else { + return mid; + } + } + if (code_line <= entries[mid].code_line) { + return mid; + } else { + return mid + 1; + } +} +static PyCodeObject *__pyx_find_code_object(int code_line) { + PyCodeObject* code_object; + int pos; + if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { + return NULL; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { + return NULL; + } + code_object = __pyx_code_cache.entries[pos].code_object; + Py_INCREF(code_object); + return code_object; +} +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { + int pos, i; + __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; + if (unlikely(!code_line)) { + return; + } + if (unlikely(!entries)) { + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); + if (likely(entries)) { + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = 64; + __pyx_code_cache.count = 1; + entries[0].code_line = code_line; + entries[0].code_object = code_object; + Py_INCREF(code_object); + } + return; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { + PyCodeObject* tmp = entries[pos].code_object; + entries[pos].code_object = code_object; + Py_DECREF(tmp); + return; + } + if (__pyx_code_cache.count == __pyx_code_cache.max_count) { + int new_max = __pyx_code_cache.max_count + 64; + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( + __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry)); + if (unlikely(!entries)) { + return; + } + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = new_max; + } + for (i=__pyx_code_cache.count; i>pos; i--) { + entries[i] = entries[i-1]; + } + entries[pos].code_line = code_line; + entries[pos].code_object = code_object; + __pyx_code_cache.count++; + Py_INCREF(code_object); +} + +/* AddTraceback */ +#include "compile.h" +#include "frameobject.h" +#include "traceback.h" +static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( + const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyObject *py_srcfile = 0; + PyObject *py_funcname = 0; + #if PY_MAJOR_VERSION < 3 + py_srcfile = PyString_FromString(filename); + #else + py_srcfile = PyUnicode_FromString(filename); + #endif + if (!py_srcfile) goto bad; + if (c_line) { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + #else + py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + #endif + } + else { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromString(funcname); + #else + py_funcname = PyUnicode_FromString(funcname); + #endif + } + if (!py_funcname) goto bad; + py_code = __Pyx_PyCode_New( + 0, + 0, + 0, + 0, + 0, + __pyx_empty_bytes, /*PyObject *code,*/ + __pyx_empty_tuple, /*PyObject *consts,*/ + __pyx_empty_tuple, /*PyObject *names,*/ + __pyx_empty_tuple, /*PyObject *varnames,*/ + __pyx_empty_tuple, /*PyObject *freevars,*/ + __pyx_empty_tuple, /*PyObject *cellvars,*/ + py_srcfile, /*PyObject *filename,*/ + py_funcname, /*PyObject *name,*/ + py_line, + __pyx_empty_bytes /*PyObject *lnotab*/ + ); + Py_DECREF(py_srcfile); + Py_DECREF(py_funcname); + return py_code; +bad: + Py_XDECREF(py_srcfile); + Py_XDECREF(py_funcname); + return NULL; +} +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyFrameObject *py_frame = 0; + PyThreadState *tstate = __Pyx_PyThreadState_Current; + if (c_line) { + c_line = __Pyx_CLineForTraceback(tstate, c_line); + } + py_code = __pyx_find_code_object(c_line ? -c_line : py_line); + if (!py_code) { + py_code = __Pyx_CreateCodeObjectForTraceback( + funcname, c_line, py_line, filename); + if (!py_code) goto bad; + __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); + } + py_frame = PyFrame_New( + tstate, /*PyThreadState *tstate,*/ + py_code, /*PyCodeObject *code,*/ + __pyx_d, /*PyObject *globals,*/ + 0 /*PyObject *locals*/ + ); + if (!py_frame) goto bad; + __Pyx_PyFrame_SetLineNumber(py_frame, py_line); + PyTraceBack_Here(py_frame); +bad: + Py_XDECREF(py_code); + Py_XDECREF(py_frame); +} + +/* CIntToPy */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { + const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(long) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(long) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(long) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(long), + little, !is_unsigned); + } +} + +/* CIntFromPyVerify */ +#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ + __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) +#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ + __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) +#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ + {\ + func_type value = func_value;\ + if (sizeof(target_type) < sizeof(func_type)) {\ + if (unlikely(value != (func_type) (target_type) value)) {\ + func_type zero = 0;\ + if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ + return (target_type) -1;\ + if (is_unsigned && unlikely(value < zero))\ + goto raise_neg_overflow;\ + else\ + goto raise_overflow;\ + }\ + }\ + return (target_type) value;\ + } + +/* CIntFromPy */ +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { + const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(long) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (long) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (long) 0; + case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0]) + case 2: + if (8 * sizeof(long) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) { + return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + case 3: + if (8 * sizeof(long) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) { + return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + case 4: + if (8 * sizeof(long) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) { + return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (long) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if (sizeof(long) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (long) 0; + case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0])) + case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0]) + case -2: + if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 2: + if (8 * sizeof(long) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case -3: + if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 3: + if (8 * sizeof(long) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case -4: + if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 4: + if (8 * sizeof(long) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + } +#endif + if (sizeof(long) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + long val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (long) -1; + } + } else { + long val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (long) -1; + val = __Pyx_PyInt_As_long(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to long"); + return (long) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to long"); + return (long) -1; +} + +/* CIntFromPy */ +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { + const int neg_one = (int) ((int) 0 - (int) 1), const_zero = (int) 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(int) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (int) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (int) 0; + case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0]) + case 2: + if (8 * sizeof(int) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) { + return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + case 3: + if (8 * sizeof(int) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) { + return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + case 4: + if (8 * sizeof(int) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) { + return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (int) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if (sizeof(int) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (int) 0; + case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0])) + case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0]) + case -2: + if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { + return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 2: + if (8 * sizeof(int) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { + return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case -3: + if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { + return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 3: + if (8 * sizeof(int) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { + return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case -4: + if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { + return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 4: + if (8 * sizeof(int) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { + return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + } +#endif + if (sizeof(int) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + int val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (int) -1; + } + } else { + int val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (int) -1; + val = __Pyx_PyInt_As_int(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to int"); + return (int) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to int"); + return (int) -1; +} + +/* FastTypeChecks */ +#if CYTHON_COMPILING_IN_CPYTHON +static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) { + while (a) { + a = a->tp_base; + if (a == b) + return 1; + } + return b == &PyBaseObject_Type; +} +static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) { + PyObject *mro; + if (a == b) return 1; + mro = a->tp_mro; + if (likely(mro)) { + Py_ssize_t i, n; + n = PyTuple_GET_SIZE(mro); + for (i = 0; i < n; i++) { + if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b) + return 1; + } + return 0; + } + return __Pyx_InBases(a, b); +} +#if PY_MAJOR_VERSION == 2 +static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { + PyObject *exception, *value, *tb; + int res; + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ErrFetch(&exception, &value, &tb); + res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; + if (unlikely(res == -1)) { + PyErr_WriteUnraisable(err); + res = 0; + } + if (!res) { + res = PyObject_IsSubclass(err, exc_type2); + if (unlikely(res == -1)) { + PyErr_WriteUnraisable(err); + res = 0; + } + } + __Pyx_ErrRestore(exception, value, tb); + return res; +} +#else +static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { + int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0; + if (!res) { + res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); + } + return res; +} +#endif +static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { + Py_ssize_t i, n; + assert(PyExceptionClass_Check(exc_type)); + n = PyTuple_GET_SIZE(tuple); +#if PY_MAJOR_VERSION >= 3 + for (i=0; itp_setattro)) + return tp->tp_setattro(obj, attr_name, value); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_setattr)) + return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value); +#endif + return PyObject_SetAttr(obj, attr_name, value); +} +#endif + +/* VoidPtrExport */ +static int __Pyx_ExportVoidPtr(PyObject *name, void *p, const char *sig) { + PyObject *d; + PyObject *cobj = 0; + d = PyDict_GetItem(__pyx_d, __pyx_n_s_pyx_capi); + Py_XINCREF(d); + if (!d) { + d = PyDict_New(); + if (!d) + goto bad; + if (__Pyx_PyObject_SetAttrStr(__pyx_m, __pyx_n_s_pyx_capi, d) < 0) + goto bad; + } +#if PY_VERSION_HEX >= 0x02070000 + cobj = PyCapsule_New(p, sig, 0); +#else + cobj = PyCObject_FromVoidPtrAndDesc(p, (void *)sig, 0); +#endif + if (!cobj) + goto bad; + if (PyDict_SetItem(d, name, cobj) < 0) + goto bad; + Py_DECREF(cobj); + Py_DECREF(d); + return 0; +bad: + Py_XDECREF(cobj); + Py_XDECREF(d); + return -1; +} + +/* FunctionExport */ +static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig) { + PyObject *d = 0; + PyObject *cobj = 0; + union { + void (*fp)(void); + void *p; + } tmp; + d = PyObject_GetAttrString(__pyx_m, (char *)"__pyx_capi__"); + if (!d) { + PyErr_Clear(); + d = PyDict_New(); + if (!d) + goto bad; + Py_INCREF(d); + if (PyModule_AddObject(__pyx_m, (char *)"__pyx_capi__", d) < 0) + goto bad; + } + tmp.fp = f; +#if PY_VERSION_HEX >= 0x02070000 + cobj = PyCapsule_New(tmp.p, sig, 0); +#else + cobj = PyCObject_FromVoidPtrAndDesc(tmp.p, (void *)sig, 0); +#endif + if (!cobj) + goto bad; + if (PyDict_SetItemString(d, name, cobj) < 0) + goto bad; + Py_DECREF(cobj); + Py_DECREF(d); + return 0; +bad: + Py_XDECREF(cobj); + Py_XDECREF(d); + return -1; +} + +/* VoidPtrImport */ +#ifndef __PYX_HAVE_RT_ImportVoidPtr +#define __PYX_HAVE_RT_ImportVoidPtr +static int __Pyx_ImportVoidPtr(PyObject *module, const char *name, void **p, const char *sig) { + PyObject *d = 0; + PyObject *cobj = 0; + d = PyObject_GetAttrString(module, (char *)"__pyx_capi__"); + if (!d) + goto bad; + cobj = PyDict_GetItemString(d, name); + if (!cobj) { + PyErr_Format(PyExc_ImportError, + "%.200s does not export expected C variable %.200s", + PyModule_GetName(module), name); + goto bad; + } +#if PY_VERSION_HEX >= 0x02070000 + if (!PyCapsule_IsValid(cobj, sig)) { + PyErr_Format(PyExc_TypeError, + "C variable %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", + PyModule_GetName(module), name, sig, PyCapsule_GetName(cobj)); + goto bad; + } + *p = PyCapsule_GetPointer(cobj, sig); +#else + {const char *desc, *s1, *s2; + desc = (const char *)PyCObject_GetDesc(cobj); + if (!desc) + goto bad; + s1 = desc; s2 = sig; + while (*s1 != '\0' && *s1 == *s2) { s1++; s2++; } + if (*s1 != *s2) { + PyErr_Format(PyExc_TypeError, + "C variable %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", + PyModule_GetName(module), name, sig, desc); + goto bad; + } + *p = PyCObject_AsVoidPtr(cobj);} +#endif + if (!(*p)) + goto bad; + Py_DECREF(d); + return 0; +bad: + Py_XDECREF(d); + return -1; +} +#endif + +/* FunctionImport */ +#ifndef __PYX_HAVE_RT_ImportFunction +#define __PYX_HAVE_RT_ImportFunction +static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig) { + PyObject *d = 0; + PyObject *cobj = 0; + union { + void (*fp)(void); + void *p; + } tmp; + d = PyObject_GetAttrString(module, (char *)"__pyx_capi__"); + if (!d) + goto bad; + cobj = PyDict_GetItemString(d, funcname); + if (!cobj) { + PyErr_Format(PyExc_ImportError, + "%.200s does not export expected C function %.200s", + PyModule_GetName(module), funcname); + goto bad; + } +#if PY_VERSION_HEX >= 0x02070000 + if (!PyCapsule_IsValid(cobj, sig)) { + PyErr_Format(PyExc_TypeError, + "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", + PyModule_GetName(module), funcname, sig, PyCapsule_GetName(cobj)); + goto bad; + } + tmp.p = PyCapsule_GetPointer(cobj, sig); +#else + {const char *desc, *s1, *s2; + desc = (const char *)PyCObject_GetDesc(cobj); + if (!desc) + goto bad; + s1 = desc; s2 = sig; + while (*s1 != '\0' && *s1 == *s2) { s1++; s2++; } + if (*s1 != *s2) { + PyErr_Format(PyExc_TypeError, + "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", + PyModule_GetName(module), funcname, sig, desc); + goto bad; + } + tmp.p = PyCObject_AsVoidPtr(cobj);} +#endif + *f = tmp.fp; + if (!(*f)) + goto bad; + Py_DECREF(d); + return 0; +bad: + Py_XDECREF(d); + return -1; +} +#endif + +/* InitStrings */ +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { + while (t->p) { + #if PY_MAJOR_VERSION < 3 + if (t->is_unicode) { + *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); + } else if (t->intern) { + *t->p = PyString_InternFromString(t->s); + } else { + *t->p = PyString_FromStringAndSize(t->s, t->n - 1); + } + #else + if (t->is_unicode | t->is_str) { + if (t->intern) { + *t->p = PyUnicode_InternFromString(t->s); + } else if (t->encoding) { + *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); + } else { + *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); + } + } else { + *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); + } + #endif + if (!*t->p) + return -1; + if (PyObject_Hash(*t->p) == -1) + return -1; + ++t; + } + return 0; +} + +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { + return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); +} +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { + Py_ssize_t ignore; + return __Pyx_PyObject_AsStringAndSize(o, &ignore); +} +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +#if !CYTHON_PEP393_ENABLED +static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { + char* defenc_c; + PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); + if (!defenc) return NULL; + defenc_c = PyBytes_AS_STRING(defenc); +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + { + char* end = defenc_c + PyBytes_GET_SIZE(defenc); + char* c; + for (c = defenc_c; c < end; c++) { + if ((unsigned char) (*c) >= 128) { + PyUnicode_AsASCIIString(o); + return NULL; + } + } + } +#endif + *length = PyBytes_GET_SIZE(defenc); + return defenc_c; +} +#else +static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { + if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + if (likely(PyUnicode_IS_ASCII(o))) { + *length = PyUnicode_GET_LENGTH(o); + return PyUnicode_AsUTF8(o); + } else { + PyUnicode_AsASCIIString(o); + return NULL; + } +#else + return PyUnicode_AsUTF8AndSize(o, length); +#endif +} +#endif +#endif +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT + if ( +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + __Pyx_sys_getdefaultencoding_not_ascii && +#endif + PyUnicode_Check(o)) { + return __Pyx_PyUnicode_AsStringAndSize(o, length); + } else +#endif +#if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) + if (PyByteArray_Check(o)) { + *length = PyByteArray_GET_SIZE(o); + return PyByteArray_AS_STRING(o); + } else +#endif + { + char* result; + int r = PyBytes_AsStringAndSize(o, &result, length); + if (unlikely(r < 0)) { + return NULL; + } else { + return result; + } + } +} +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { + int is_true = x == Py_True; + if (is_true | (x == Py_False) | (x == Py_None)) return is_true; + else return PyObject_IsTrue(x); +} +static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) { + int retval; + if (unlikely(!x)) return -1; + retval = __Pyx_PyObject_IsTrue(x); + Py_DECREF(x); + return retval; +} +static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) { +#if PY_MAJOR_VERSION >= 3 + if (PyLong_Check(result)) { + if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, + "__int__ returned non-int (type %.200s). " + "The ability to return an instance of a strict subclass of int " + "is deprecated, and may be removed in a future version of Python.", + Py_TYPE(result)->tp_name)) { + Py_DECREF(result); + return NULL; + } + return result; + } +#endif + PyErr_Format(PyExc_TypeError, + "__%.4s__ returned non-%.4s (type %.200s)", + type_name, type_name, Py_TYPE(result)->tp_name); + Py_DECREF(result); + return NULL; +} +static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { +#if CYTHON_USE_TYPE_SLOTS + PyNumberMethods *m; +#endif + const char *name = NULL; + PyObject *res = NULL; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x) || PyLong_Check(x))) +#else + if (likely(PyLong_Check(x))) +#endif + return __Pyx_NewRef(x); +#if CYTHON_USE_TYPE_SLOTS + m = Py_TYPE(x)->tp_as_number; + #if PY_MAJOR_VERSION < 3 + if (m && m->nb_int) { + name = "int"; + res = m->nb_int(x); + } + else if (m && m->nb_long) { + name = "long"; + res = m->nb_long(x); + } + #else + if (likely(m && m->nb_int)) { + name = "int"; + res = m->nb_int(x); + } + #endif +#else + if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { + res = PyNumber_Int(x); + } +#endif + if (likely(res)) { +#if PY_MAJOR_VERSION < 3 + if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) { +#else + if (unlikely(!PyLong_CheckExact(res))) { +#endif + return __Pyx_PyNumber_IntOrLongWrongResultType(res, name); + } + } + else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_TypeError, + "an integer is required"); + } + return res; +} +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { + Py_ssize_t ival; + PyObject *x; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_CheckExact(b))) { + if (sizeof(Py_ssize_t) >= sizeof(long)) + return PyInt_AS_LONG(b); + else + return PyInt_AsSsize_t(b); + } +#endif + if (likely(PyLong_CheckExact(b))) { + #if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)b)->ob_digit; + const Py_ssize_t size = Py_SIZE(b); + if (likely(__Pyx_sst_abs(size) <= 1)) { + ival = likely(size) ? digits[0] : 0; + if (size == -1) ival = -ival; + return ival; + } else { + switch (size) { + case 2: + if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { + return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -2: + if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case 3: + if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { + return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -3: + if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case 4: + if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { + return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -4: + if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + } + } + #endif + return PyLong_AsSsize_t(b); + } + x = PyNumber_Index(b); + if (!x) return -1; + ival = PyInt_AsSsize_t(x); + Py_DECREF(x); + return ival; +} +static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) { + return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False); +} +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { + return PyInt_FromSize_t(ival); +} + + +#endif /* Py_PYTHON_H */ diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_abstract_linkable.html b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_abstract_linkable.html new file mode 100644 index 00000000..6d532c15 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_abstract_linkable.html @@ -0,0 +1,2189 @@ + + + + + + Cython: _abstract_linkable.py + + + +

Generated by Cython 0.29.2

+

+ Yellow lines hint at Python interaction.
+ Click on a line that starts with a "+" to see the C code that Cython generated for it. +

+

Raw output: _abstract_linkable.c

+
+001: # -*- coding: utf-8 -*-
+
  __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 002: # cython: auto_pickle=False,embedsignature=True,always_allow_keywords=False
+
 003: """
+
 004: Internal module, support for the linkable protocol for "event" like objects.
+
 005: 
+
 006: """
+
 007: from __future__ import absolute_import
+
 008: from __future__ import division
+
 009: from __future__ import print_function
+
 010: 
+
+011: import sys
+
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_sys, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 11, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_sys, __pyx_t_1) < 0) __PYX_ERR(0, 11, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 012: 
+
+013: from gevent._hub_local import get_hub_noargs as get_hub
+
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 13, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(__pyx_n_s_get_hub_noargs);
+  __Pyx_GIVEREF(__pyx_n_s_get_hub_noargs);
+  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_get_hub_noargs);
+  __pyx_t_2 = __Pyx_Import(__pyx_n_s_gevent__hub_local, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 13, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_get_hub_noargs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 13, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_hub_noargs, __pyx_t_1) < 0) __PYX_ERR(0, 13, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
 014: 
+
+015: from gevent.exceptions import InvalidSwitchError
+
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 15, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_InvalidSwitchError);
+  __Pyx_GIVEREF(__pyx_n_s_InvalidSwitchError);
+  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_InvalidSwitchError);
+  __pyx_t_1 = __Pyx_Import(__pyx_n_s_gevent_exceptions, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 15, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_InvalidSwitchError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 15, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(__pyx_t_2);
+  __Pyx_XGOTREF(__pyx_v_6gevent_19__abstract_linkable_InvalidSwitchError);
+  __Pyx_DECREF_SET(__pyx_v_6gevent_19__abstract_linkable_InvalidSwitchError, __pyx_t_2);
+  __Pyx_GIVEREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+016: from gevent.timeout import Timeout
+
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 16, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(__pyx_n_s_Timeout);
+  __Pyx_GIVEREF(__pyx_n_s_Timeout);
+  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_Timeout);
+  __pyx_t_2 = __Pyx_Import(__pyx_n_s_gevent_timeout, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 16, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_Timeout); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 16, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(__pyx_t_1);
+  __Pyx_XGOTREF(__pyx_v_6gevent_19__abstract_linkable_Timeout);
+  __Pyx_DECREF_SET(__pyx_v_6gevent_19__abstract_linkable_Timeout, __pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
 017: 
+
+018: locals()['getcurrent'] = __import__('greenlet').getcurrent
+
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin___import__, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 18, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_getcurrent); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 18, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_2 = __Pyx_Globals(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 18, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (unlikely(PyDict_SetItem(__pyx_t_2, __pyx_n_s_getcurrent, __pyx_t_1) < 0)) __PYX_ERR(0, 18, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+/* … */
+  __pyx_tuple__3 = PyTuple_Pack(1, __pyx_n_s_greenlet); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 18, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__3);
+  __Pyx_GIVEREF(__pyx_tuple__3);
+
+019: locals()['greenlet_init'] = lambda: None
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_19__abstract_linkable_lambda(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyMethodDef __pyx_mdef_6gevent_19__abstract_linkable_lambda = {"lambda", (PyCFunction)__pyx_pw_6gevent_19__abstract_linkable_lambda, METH_NOARGS, 0};
+static PyObject *__pyx_pw_6gevent_19__abstract_linkable_lambda(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("lambda (wrapper)", 0);
+  __pyx_r = __pyx_lambda_funcdef_6gevent_19__abstract_linkable_lambda(__pyx_self);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_lambda_funcdef_6gevent_19__abstract_linkable_lambda(CYTHON_UNUSED PyObject *__pyx_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("lambda", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_19__abstract_linkable_lambda, 0, __pyx_n_s_lambda, NULL, __pyx_n_s_gevent___abstract_linkable, __pyx_d, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 19, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = __Pyx_Globals(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 19, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (unlikely(PyDict_SetItem(__pyx_t_2, __pyx_n_s_greenlet_init, __pyx_t_1) < 0)) __PYX_ERR(0, 19, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 020: 
+
+021: __all__ = [
+
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 21, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(__pyx_n_s_AbstractLinkable);
+  __Pyx_GIVEREF(__pyx_n_s_AbstractLinkable);
+  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_AbstractLinkable);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_all, __pyx_t_1) < 0) __PYX_ERR(0, 21, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 022:     'AbstractLinkable',
+
 023: ]
+
 024: 
+
+025: class AbstractLinkable(object):
+
struct __pyx_vtabstruct_6gevent_19__abstract_linkable_AbstractLinkable {
+  PyObject *(*rawlink)(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *, PyObject *, int __pyx_skip_dispatch);
+  int (*ready)(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *, int __pyx_skip_dispatch);
+  PyObject *(*unlink)(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *, PyObject *, int __pyx_skip_dispatch);
+  PyObject *(*_check_and_notify)(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *);
+  PyObject *(*_notify_links)(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *, int __pyx_skip_dispatch);
+  PyObject *(*_wait_core)(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *, PyObject *, struct __pyx_opt_args_6gevent_19__abstract_linkable_16AbstractLinkable__wait_core *__pyx_optional_args);
+  PyObject *(*_wait_return_value)(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *, PyObject *, PyObject *);
+  PyObject *(*_wait)(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *, struct __pyx_opt_args_6gevent_19__abstract_linkable_16AbstractLinkable__wait *__pyx_optional_args);
+};
+static struct __pyx_vtabstruct_6gevent_19__abstract_linkable_AbstractLinkable *__pyx_vtabptr_6gevent_19__abstract_linkable_AbstractLinkable;
+
 026:     # Encapsulates the standard parts of the linking and notifying
+
 027:     # protocol common to both repeatable events (Event, Semaphore) and
+
 028:     # one-time events (AsyncResult).
+
 029: 
+
+030:     __slots__ = ('hub', '_links', '_notifier', '_notify_all', '__weakref__')
+
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_19__abstract_linkable_AbstractLinkable->tp_dict, __pyx_n_s_slots, __pyx_tuple__4) < 0) __PYX_ERR(0, 30, __pyx_L1_error)
+  PyType_Modified(__pyx_ptype_6gevent_19__abstract_linkable_AbstractLinkable);
+/* … */
+  __pyx_tuple__4 = PyTuple_Pack(5, __pyx_n_s_hub, __pyx_n_s_links, __pyx_n_s_notifier, __pyx_n_s_notify_all, __pyx_n_s_weakref); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 30, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__4);
+  __Pyx_GIVEREF(__pyx_tuple__4);
+
 031: 
+
+032:     def __init__(self):
+
/* Python wrapper */
+static int __pyx_pw_6gevent_19__abstract_linkable_16AbstractLinkable_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static int __pyx_pw_6gevent_19__abstract_linkable_16AbstractLinkable_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
+  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
+    __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
+  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1;
+  __pyx_r = __pyx_pf_6gevent_19__abstract_linkable_16AbstractLinkable___init__(((struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_19__abstract_linkable_16AbstractLinkable___init__(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *__pyx_v_self) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = 0;
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.__abstract_linkable.AbstractLinkable.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = -1;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
 033:         # Before this implementation, AsyncResult and Semaphore
+
 034:         # maintained the order of notifications, but Event did not.
+
 035: 
+
 036:         # In gevent 1.3, before Semaphore extended this class,
+
 037:         # that was changed to not maintain the order. It was done because
+
 038:         # Event guaranteed to only call callbacks once (a set) but
+
 039:         # AsyncResult had no such guarantees.
+
 040: 
+
 041:         # Semaphore likes to maintain order of callbacks, though,
+
 042:         # so when it was added we went back to a list implementation
+
 043:         # for storing callbacks. But we want to preserve the unique callback
+
 044:         # property, so we manually check.
+
 045: 
+
 046:         # We generally don't expect to have so many waiters (for any of those
+
 047:         # objects) that testing membership and removing is a bottleneck.
+
 048: 
+
 049:         # In PyPy 2.6.1 with Cython 0.23, `cdef public` or `cdef
+
 050:         # readonly` or simply `cdef` attributes of type `object` can appear to leak if
+
 051:         # a Python subclass is used (this is visible simply
+
 052:         # instantiating this subclass if _links=[]). Our _links and
+
 053:         # _notifier are such attributes, and gevent.thread subclasses
+
 054:         # this class. Thus, we carefully manage the lifetime of the
+
 055:         # objects we put in these attributes so that, in the normal
+
 056:         # case of a semaphore used correctly (deallocated when it's not
+
 057:         # locked and no one is waiting), the leak goes away (because
+
 058:         # these objects are back to None). This can also be solved on PyPy
+
 059:         # by simply not declaring these objects in the pxd file, but that doesn't work for
+
 060:         # CPython ("No attribute...")
+
 061:         # See https://github.com/gevent/gevent/issues/660
+
+062:         self._links = set()
+
  __pyx_t_1 = PySet_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 62, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_1);
+  __Pyx_GOTREF(__pyx_v_self->_links);
+  __Pyx_DECREF(__pyx_v_self->_links);
+  __pyx_v_self->_links = ((PyObject*)__pyx_t_1);
+  __pyx_t_1 = 0;
+
+063:         self._notifier = None
+
  __Pyx_INCREF(Py_None);
+  __Pyx_GIVEREF(Py_None);
+  __Pyx_GOTREF(__pyx_v_self->_notifier);
+  __Pyx_DECREF(__pyx_v_self->_notifier);
+  __pyx_v_self->_notifier = Py_None;
+
 064:         # This is conceptually a class attribute, defined here for ease of access in
+
 065:         # cython. If it's true, when notifiers fire, all existing callbacks are called.
+
 066:         # If its false, we only call callbacks as long as ready() returns true.
+
+067:         self._notify_all = True
+
  __pyx_v_self->_notify_all = 1;
+
 068:         # we don't want to do get_hub() here to allow defining module-level objects
+
 069:         # without initializing the hub
+
+070:         self.hub = None
+
  __Pyx_INCREF(Py_None);
+  __Pyx_GIVEREF(Py_None);
+  __Pyx_GOTREF(__pyx_v_self->hub);
+  __Pyx_DECREF(((PyObject *)__pyx_v_self->hub));
+  __pyx_v_self->hub = ((struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *)Py_None);
+
 071: 
+
+072:     def linkcount(self):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_19__abstract_linkable_16AbstractLinkable_3linkcount(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6gevent_19__abstract_linkable_16AbstractLinkable_2linkcount[] = "AbstractLinkable.linkcount(self)";
+static PyMethodDef __pyx_mdef_6gevent_19__abstract_linkable_16AbstractLinkable_3linkcount = {"linkcount", (PyCFunction)__pyx_pw_6gevent_19__abstract_linkable_16AbstractLinkable_3linkcount, METH_NOARGS, __pyx_doc_6gevent_19__abstract_linkable_16AbstractLinkable_2linkcount};
+static PyObject *__pyx_pw_6gevent_19__abstract_linkable_16AbstractLinkable_3linkcount(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("linkcount (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_19__abstract_linkable_16AbstractLinkable_2linkcount(((struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_19__abstract_linkable_16AbstractLinkable_2linkcount(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("linkcount", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.__abstract_linkable.AbstractLinkable.linkcount", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__5 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 72, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__5);
+  __Pyx_GIVEREF(__pyx_tuple__5);
+/* … */
+  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_19__abstract_linkable_16AbstractLinkable_3linkcount, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AbstractLinkable_linkcount, NULL, __pyx_n_s_gevent___abstract_linkable, __pyx_d, ((PyObject *)__pyx_codeobj__6)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 72, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_19__abstract_linkable_AbstractLinkable->tp_dict, __pyx_n_s_linkcount, __pyx_t_1) < 0) __PYX_ERR(0, 72, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_19__abstract_linkable_AbstractLinkable);
+  __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__5, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__abstract_linkable_py, __pyx_n_s_linkcount, 72, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__6)) __PYX_ERR(0, 72, __pyx_L1_error)
+
 073:         # For testing: how many objects are linked to this one?
+
+074:         return len(self._links)
+
  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __pyx_v_self->_links;
+  __Pyx_INCREF(__pyx_t_1);
+  if (unlikely(__pyx_t_1 == Py_None)) {
+    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
+    __PYX_ERR(0, 74, __pyx_L1_error)
+  }
+  __pyx_t_2 = PySet_GET_SIZE(__pyx_t_1); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 74, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 74, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
 075: 
+
+076:     def ready(self):
+
static PyObject *__pyx_pw_6gevent_19__abstract_linkable_16AbstractLinkable_5ready(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static int __pyx_f_6gevent_19__abstract_linkable_16AbstractLinkable_ready(CYTHON_UNUSED struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *__pyx_v_self, int __pyx_skip_dispatch) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("ready", 0);
+  /* Check if called by wrapper */
+  if (unlikely(__pyx_skip_dispatch)) ;
+  /* Check if overridden in Python */
+  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
+    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
+    if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
+    else {
+      PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      #endif
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_ready); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 76, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_19__abstract_linkable_16AbstractLinkable_5ready)) {
+        __Pyx_INCREF(__pyx_t_1);
+        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+          if (likely(__pyx_t_4)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+            __Pyx_INCREF(__pyx_t_4);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_3, function);
+          }
+        }
+        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
+        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 76, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 76, __pyx_L1_error)
+        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+        __pyx_r = __pyx_t_5;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        goto __pyx_L0;
+      }
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+      tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
+      if (unlikely(type_dict_guard != tp_dict_version)) {
+        tp_dict_version = obj_dict_version = 0;
+      }
+      #endif
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    }
+    #endif
+  }
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_WriteUnraisable("gevent.__abstract_linkable.AbstractLinkable.ready", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_19__abstract_linkable_16AbstractLinkable_5ready(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6gevent_19__abstract_linkable_16AbstractLinkable_4ready[] = "AbstractLinkable.ready(self) -> bool";
+static PyMethodDef __pyx_mdef_6gevent_19__abstract_linkable_16AbstractLinkable_5ready = {"ready", (PyCFunction)__pyx_pw_6gevent_19__abstract_linkable_16AbstractLinkable_5ready, METH_NOARGS, __pyx_doc_6gevent_19__abstract_linkable_16AbstractLinkable_4ready};
+static PyObject *__pyx_pw_6gevent_19__abstract_linkable_16AbstractLinkable_5ready(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("ready (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_19__abstract_linkable_16AbstractLinkable_4ready(((struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_19__abstract_linkable_16AbstractLinkable_4ready(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("ready", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_f_6gevent_19__abstract_linkable_16AbstractLinkable_ready(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 76, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.__abstract_linkable.AbstractLinkable.ready", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__7 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 76, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__7);
+  __Pyx_GIVEREF(__pyx_tuple__7);
+/* … */
+  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_19__abstract_linkable_16AbstractLinkable_5ready, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AbstractLinkable_ready, NULL, __pyx_n_s_gevent___abstract_linkable, __pyx_d, ((PyObject *)__pyx_codeobj__8)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 76, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_19__abstract_linkable_AbstractLinkable->tp_dict, __pyx_n_s_ready, __pyx_t_1) < 0) __PYX_ERR(0, 76, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_19__abstract_linkable_AbstractLinkable);
+  __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__abstract_linkable_py, __pyx_n_s_ready, 76, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) __PYX_ERR(0, 76, __pyx_L1_error)
+
 077:         # Instances must define this
+
+078:         raise NotImplementedError
+
  __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0);
+  __PYX_ERR(0, 78, __pyx_L1_error)
+
 079: 
+
+080:     def _check_and_notify(self):
+
static PyObject *__pyx_f_6gevent_19__abstract_linkable_16AbstractLinkable__check_and_notify(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_check_and_notify", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_XDECREF(__pyx_t_6);
+  __Pyx_XDECREF(__pyx_t_7);
+  __Pyx_AddTraceback("gevent.__abstract_linkable.AbstractLinkable._check_and_notify", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
 081:         # If this object is ready to be notified, begin the process.
+
+082:         if self.ready() and self._links and not self._notifier:
+
  __pyx_t_2 = (((struct __pyx_vtabstruct_6gevent_19__abstract_linkable_AbstractLinkable *)__pyx_v_self->__pyx_vtab)->ready(__pyx_v_self, 0) != 0);
+  if (__pyx_t_2) {
+  } else {
+    __pyx_t_1 = __pyx_t_2;
+    goto __pyx_L4_bool_binop_done;
+  }
+  __pyx_t_2 = (__pyx_v_self->_links != Py_None)&&(PySet_GET_SIZE(__pyx_v_self->_links) != 0);
+  if (__pyx_t_2) {
+  } else {
+    __pyx_t_1 = __pyx_t_2;
+    goto __pyx_L4_bool_binop_done;
+  }
+  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_self->_notifier); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 82, __pyx_L1_error)
+  __pyx_t_3 = ((!__pyx_t_2) != 0);
+  __pyx_t_1 = __pyx_t_3;
+  __pyx_L4_bool_binop_done:;
+  if (__pyx_t_1) {
+/* … */
+  }
+
+083:             if self.hub is None:
+
    __pyx_t_1 = (((PyObject *)__pyx_v_self->hub) == Py_None);
+    __pyx_t_3 = (__pyx_t_1 != 0);
+    if (__pyx_t_3) {
+/* … */
+    }
+
+084:                 self.hub = get_hub()
+
      __pyx_t_4 = ((PyObject *)__pyx_f_6gevent_11__hub_local_get_hub_noargs(0)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 84, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_4);
+      __Pyx_GIVEREF(__pyx_t_4);
+      __Pyx_GOTREF(__pyx_v_self->hub);
+      __Pyx_DECREF(((PyObject *)__pyx_v_self->hub));
+      __pyx_v_self->hub = ((struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *)__pyx_t_4);
+      __pyx_t_4 = 0;
+
 085: 
+
+086:             self._notifier = self.hub.loop.run_callback(self._notify_links)
+
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->hub->loop, __pyx_n_s_run_callback); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 86, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_5);
+    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_notify_links); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 86, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_6);
+    __pyx_t_7 = NULL;
+    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
+      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
+      if (likely(__pyx_t_7)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
+        __Pyx_INCREF(__pyx_t_7);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_5, function);
+      }
+    }
+    __pyx_t_4 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_7, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6);
+    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 86, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __Pyx_GIVEREF(__pyx_t_4);
+    __Pyx_GOTREF(__pyx_v_self->_notifier);
+    __Pyx_DECREF(__pyx_v_self->_notifier);
+    __pyx_v_self->_notifier = __pyx_t_4;
+    __pyx_t_4 = 0;
+
 087: 
+
+088:     def rawlink(self, callback):
+
static PyObject *__pyx_pw_6gevent_19__abstract_linkable_16AbstractLinkable_7rawlink(PyObject *__pyx_v_self, PyObject *__pyx_v_callback); /*proto*/
+static PyObject *__pyx_f_6gevent_19__abstract_linkable_16AbstractLinkable_rawlink(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *__pyx_v_self, PyObject *__pyx_v_callback, int __pyx_skip_dispatch) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("rawlink", 0);
+  /* Check if called by wrapper */
+  if (unlikely(__pyx_skip_dispatch)) ;
+  /* Check if overridden in Python */
+  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
+    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
+    if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
+    else {
+      PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      #endif
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_rawlink); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 88, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_19__abstract_linkable_16AbstractLinkable_7rawlink)) {
+        __Pyx_XDECREF(__pyx_r);
+        __Pyx_INCREF(__pyx_t_1);
+        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+          if (likely(__pyx_t_4)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+            __Pyx_INCREF(__pyx_t_4);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_3, function);
+          }
+        }
+        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_callback) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_callback);
+        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 88, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __pyx_r = __pyx_t_2;
+        __pyx_t_2 = 0;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        goto __pyx_L0;
+      }
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+      tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
+      if (unlikely(type_dict_guard != tp_dict_version)) {
+        tp_dict_version = obj_dict_version = 0;
+      }
+      #endif
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    }
+    #endif
+  }
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_AddTraceback("gevent.__abstract_linkable.AbstractLinkable.rawlink", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_19__abstract_linkable_16AbstractLinkable_7rawlink(PyObject *__pyx_v_self, PyObject *__pyx_v_callback); /*proto*/
+static char __pyx_doc_6gevent_19__abstract_linkable_16AbstractLinkable_6rawlink[] = "AbstractLinkable.rawlink(self, callback)\n\n        Register a callback to call when this object is ready.\n\n        *callback* will be called in the :class:`Hub\n        <gevent.hub.Hub>`, so it must not use blocking gevent API.\n        *callback* will be passed one argument: this instance.\n        ";
+static PyMethodDef __pyx_mdef_6gevent_19__abstract_linkable_16AbstractLinkable_7rawlink = {"rawlink", (PyCFunction)__pyx_pw_6gevent_19__abstract_linkable_16AbstractLinkable_7rawlink, METH_O, __pyx_doc_6gevent_19__abstract_linkable_16AbstractLinkable_6rawlink};
+static PyObject *__pyx_pw_6gevent_19__abstract_linkable_16AbstractLinkable_7rawlink(PyObject *__pyx_v_self, PyObject *__pyx_v_callback) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("rawlink (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_19__abstract_linkable_16AbstractLinkable_6rawlink(((struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *)__pyx_v_self), ((PyObject *)__pyx_v_callback));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_19__abstract_linkable_16AbstractLinkable_6rawlink(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *__pyx_v_self, PyObject *__pyx_v_callback) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("rawlink", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __pyx_f_6gevent_19__abstract_linkable_16AbstractLinkable_rawlink(__pyx_v_self, __pyx_v_callback, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 88, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.__abstract_linkable.AbstractLinkable.rawlink", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__9 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_callback); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 88, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__9);
+  __Pyx_GIVEREF(__pyx_tuple__9);
+/* … */
+  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_19__abstract_linkable_16AbstractLinkable_7rawlink, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AbstractLinkable_rawlink, NULL, __pyx_n_s_gevent___abstract_linkable, __pyx_d, ((PyObject *)__pyx_codeobj__10)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 88, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_19__abstract_linkable_AbstractLinkable->tp_dict, __pyx_n_s_rawlink, __pyx_t_1) < 0) __PYX_ERR(0, 88, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_19__abstract_linkable_AbstractLinkable);
+  __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__9, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__abstract_linkable_py, __pyx_n_s_rawlink, 88, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__10)) __PYX_ERR(0, 88, __pyx_L1_error)
+
 089:         """
+
 090:         Register a callback to call when this object is ready.
+
 091: 
+
 092:         *callback* will be called in the :class:`Hub
+
 093:         <gevent.hub.Hub>`, so it must not use blocking gevent API.
+
 094:         *callback* will be passed one argument: this instance.
+
 095:         """
+
+096:         if not callable(callback):
+
  __pyx_t_5 = __Pyx_PyCallable_Check(__pyx_v_callback); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 96, __pyx_L1_error)
+  __pyx_t_6 = ((!(__pyx_t_5 != 0)) != 0);
+  if (unlikely(__pyx_t_6)) {
+/* … */
+  }
+
+097:             raise TypeError('Expected callable: %r' % (callback, ))
+
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 97, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_INCREF(__pyx_v_callback);
+    __Pyx_GIVEREF(__pyx_v_callback);
+    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_callback);
+    __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_Expected_callable_r, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 97, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 97, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __PYX_ERR(0, 97, __pyx_L1_error)
+
 098: 
+
+099:         self._links.add(callback)
+
  if (unlikely(__pyx_v_self->_links == Py_None)) {
+    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "add");
+    __PYX_ERR(0, 99, __pyx_L1_error)
+  }
+  __pyx_t_7 = PySet_Add(__pyx_v_self->_links, __pyx_v_callback); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 99, __pyx_L1_error)
+
+100:         self._check_and_notify()
+
  __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_19__abstract_linkable_AbstractLinkable *)__pyx_v_self->__pyx_vtab)->_check_and_notify(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 100, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 101: 
+
+102:     def unlink(self, callback):
+
static PyObject *__pyx_pw_6gevent_19__abstract_linkable_16AbstractLinkable_9unlink(PyObject *__pyx_v_self, PyObject *__pyx_v_callback); /*proto*/
+static PyObject *__pyx_f_6gevent_19__abstract_linkable_16AbstractLinkable_unlink(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *__pyx_v_self, PyObject *__pyx_v_callback, int __pyx_skip_dispatch) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("unlink", 0);
+  /* Check if called by wrapper */
+  if (unlikely(__pyx_skip_dispatch)) ;
+  /* Check if overridden in Python */
+  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
+    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
+    if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
+    else {
+      PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      #endif
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_unlink); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 102, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_19__abstract_linkable_16AbstractLinkable_9unlink)) {
+        __Pyx_XDECREF(__pyx_r);
+        __Pyx_INCREF(__pyx_t_1);
+        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+          if (likely(__pyx_t_4)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+            __Pyx_INCREF(__pyx_t_4);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_3, function);
+          }
+        }
+        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_callback) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_callback);
+        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 102, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __pyx_r = __pyx_t_2;
+        __pyx_t_2 = 0;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        goto __pyx_L0;
+      }
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+      tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
+      if (unlikely(type_dict_guard != tp_dict_version)) {
+        tp_dict_version = obj_dict_version = 0;
+      }
+      #endif
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    }
+    #endif
+  }
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_AddTraceback("gevent.__abstract_linkable.AbstractLinkable.unlink", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_19__abstract_linkable_16AbstractLinkable_9unlink(PyObject *__pyx_v_self, PyObject *__pyx_v_callback); /*proto*/
+static char __pyx_doc_6gevent_19__abstract_linkable_16AbstractLinkable_8unlink[] = "AbstractLinkable.unlink(self, callback)\nRemove the callback set by :meth:`rawlink`";
+static PyMethodDef __pyx_mdef_6gevent_19__abstract_linkable_16AbstractLinkable_9unlink = {"unlink", (PyCFunction)__pyx_pw_6gevent_19__abstract_linkable_16AbstractLinkable_9unlink, METH_O, __pyx_doc_6gevent_19__abstract_linkable_16AbstractLinkable_8unlink};
+static PyObject *__pyx_pw_6gevent_19__abstract_linkable_16AbstractLinkable_9unlink(PyObject *__pyx_v_self, PyObject *__pyx_v_callback) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("unlink (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_19__abstract_linkable_16AbstractLinkable_8unlink(((struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *)__pyx_v_self), ((PyObject *)__pyx_v_callback));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_19__abstract_linkable_16AbstractLinkable_8unlink(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *__pyx_v_self, PyObject *__pyx_v_callback) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("unlink", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __pyx_f_6gevent_19__abstract_linkable_16AbstractLinkable_unlink(__pyx_v_self, __pyx_v_callback, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 102, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.__abstract_linkable.AbstractLinkable.unlink", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__11 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_callback); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 102, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__11);
+  __Pyx_GIVEREF(__pyx_tuple__11);
+/* … */
+  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_19__abstract_linkable_16AbstractLinkable_9unlink, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AbstractLinkable_unlink, NULL, __pyx_n_s_gevent___abstract_linkable, __pyx_d, ((PyObject *)__pyx_codeobj__12)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 102, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_19__abstract_linkable_AbstractLinkable->tp_dict, __pyx_n_s_unlink, __pyx_t_1) < 0) __PYX_ERR(0, 102, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_19__abstract_linkable_AbstractLinkable);
+  __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__11, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__abstract_linkable_py, __pyx_n_s_unlink, 102, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(0, 102, __pyx_L1_error)
+
 103:         """Remove the callback set by :meth:`rawlink`"""
+
+104:         self._links.discard(callback)
+
  if (unlikely(__pyx_v_self->_links == Py_None)) {
+    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "discard");
+    __PYX_ERR(0, 104, __pyx_L1_error)
+  }
+  __pyx_t_5 = __Pyx_PySet_Discard(__pyx_v_self->_links, __pyx_v_callback); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 104, __pyx_L1_error)
+
 105: 
+
+106:         if not self._links and self._notifier is not None:
+
  __pyx_t_7 = (__pyx_v_self->_links != Py_None)&&(PySet_GET_SIZE(__pyx_v_self->_links) != 0);
+  __pyx_t_8 = ((!__pyx_t_7) != 0);
+  if (__pyx_t_8) {
+  } else {
+    __pyx_t_6 = __pyx_t_8;
+    goto __pyx_L4_bool_binop_done;
+  }
+  __pyx_t_8 = (__pyx_v_self->_notifier != Py_None);
+  __pyx_t_7 = (__pyx_t_8 != 0);
+  __pyx_t_6 = __pyx_t_7;
+  __pyx_L4_bool_binop_done:;
+  if (__pyx_t_6) {
+/* … */
+  }
+
 107:             # If we currently have one queued, de-queue it.
+
 108:             # This will break a reference cycle.
+
 109:             # (self._notifier -> self._notify_links -> self)
+
 110:             # But we can't set it to None in case it was actually running.
+
+111:             self._notifier.stop()
+
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_notifier, __pyx_n_s_stop); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 111, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_3 = NULL;
+    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+      if (likely(__pyx_t_3)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+        __Pyx_INCREF(__pyx_t_3);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_2, function);
+      }
+    }
+    __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
+    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 111, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 112: 
+
 113: 
+
+114:     def _notify_links(self):
+
static PyObject *__pyx_pw_6gevent_19__abstract_linkable_16AbstractLinkable_11_notify_links(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyObject *__pyx_f_6gevent_19__abstract_linkable_16AbstractLinkable__notify_links(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *__pyx_v_self, int __pyx_skip_dispatch) {
+  PyObject *__pyx_v_notifier = NULL;
+  PyObject *__pyx_v_todo = NULL;
+  PyObject *__pyx_v_link = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_notify_links", 0);
+  /* Check if called by wrapper */
+  if (unlikely(__pyx_skip_dispatch)) ;
+  /* Check if overridden in Python */
+  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
+    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
+    if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
+    else {
+      PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      #endif
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_notify_links); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 114, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_19__abstract_linkable_16AbstractLinkable_11_notify_links)) {
+        __Pyx_XDECREF(__pyx_r);
+        __Pyx_INCREF(__pyx_t_1);
+        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+          if (likely(__pyx_t_4)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+            __Pyx_INCREF(__pyx_t_4);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_3, function);
+          }
+        }
+        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
+        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 114, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __pyx_r = __pyx_t_2;
+        __pyx_t_2 = 0;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        goto __pyx_L0;
+      }
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+      tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
+      if (unlikely(type_dict_guard != tp_dict_version)) {
+        tp_dict_version = obj_dict_version = 0;
+      }
+      #endif
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    }
+    #endif
+  }
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_14);
+  __Pyx_XDECREF(__pyx_t_15);
+  __Pyx_XDECREF(__pyx_t_16);
+  __Pyx_XDECREF(__pyx_t_17);
+  __Pyx_XDECREF(__pyx_t_18);
+  __Pyx_AddTraceback("gevent.__abstract_linkable.AbstractLinkable._notify_links", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_notifier);
+  __Pyx_XDECREF(__pyx_v_todo);
+  __Pyx_XDECREF(__pyx_v_link);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_19__abstract_linkable_16AbstractLinkable_11_notify_links(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6gevent_19__abstract_linkable_16AbstractLinkable_10_notify_links[] = "AbstractLinkable._notify_links(self)";
+static PyMethodDef __pyx_mdef_6gevent_19__abstract_linkable_16AbstractLinkable_11_notify_links = {"_notify_links", (PyCFunction)__pyx_pw_6gevent_19__abstract_linkable_16AbstractLinkable_11_notify_links, METH_NOARGS, __pyx_doc_6gevent_19__abstract_linkable_16AbstractLinkable_10_notify_links};
+static PyObject *__pyx_pw_6gevent_19__abstract_linkable_16AbstractLinkable_11_notify_links(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_notify_links (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_19__abstract_linkable_16AbstractLinkable_10_notify_links(((struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_19__abstract_linkable_16AbstractLinkable_10_notify_links(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_notify_links", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __pyx_f_6gevent_19__abstract_linkable_16AbstractLinkable__notify_links(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 114, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.__abstract_linkable.AbstractLinkable._notify_links", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__13 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 114, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__13);
+  __Pyx_GIVEREF(__pyx_tuple__13);
+/* … */
+  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_19__abstract_linkable_16AbstractLinkable_11_notify_links, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AbstractLinkable__notify_links, NULL, __pyx_n_s_gevent___abstract_linkable, __pyx_d, ((PyObject *)__pyx_codeobj__14)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 114, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_19__abstract_linkable_AbstractLinkable->tp_dict, __pyx_n_s_notify_links, __pyx_t_1) < 0) __PYX_ERR(0, 114, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_19__abstract_linkable_AbstractLinkable);
+
 115:         # We release self._notifier here. We are called by it
+
 116:         # at the end of the loop, and it is now false in a boolean way (as soon
+
 117:         # as this method returns).
+
+118:         notifier = self._notifier
+
  __pyx_t_1 = __pyx_v_self->_notifier;
+  __Pyx_INCREF(__pyx_t_1);
+  __pyx_v_notifier = __pyx_t_1;
+  __pyx_t_1 = 0;
+
 119:         # We were ready() at the time this callback was scheduled;
+
 120:         # we may not be anymore, and that status may change during
+
 121:         # callback processing. Some of our subclasses will want to
+
 122:         # notify everyone that the status was once true, even though not it
+
 123:         # may not be anymore.
+
+124:         todo = set(self._links)
+
  __pyx_t_1 = PySet_New(__pyx_v_self->_links); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 124, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_v_todo = ((PyObject*)__pyx_t_1);
+  __pyx_t_1 = 0;
+
+125:         try:
+
  /*try:*/ {
+
+126:             for link in todo:
+
    __pyx_t_5 = 0;
+    __pyx_t_2 = __Pyx_set_iterator(__pyx_v_todo, 1, (&__pyx_t_6), (&__pyx_t_7)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 126, __pyx_L4_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_XDECREF(__pyx_t_1);
+    __pyx_t_1 = __pyx_t_2;
+    __pyx_t_2 = 0;
+    while (1) {
+      __pyx_t_8 = __Pyx_set_iter_next(__pyx_t_1, __pyx_t_6, &__pyx_t_5, &__pyx_t_2, __pyx_t_7);
+      if (unlikely(__pyx_t_8 == 0)) break;
+      if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(0, 126, __pyx_L4_error)
+      __Pyx_GOTREF(__pyx_t_2);
+      __Pyx_XDECREF_SET(__pyx_v_link, __pyx_t_2);
+      __pyx_t_2 = 0;
+
+127:                 if not self._notify_all and not self.ready():
+
      __pyx_t_10 = ((!(__pyx_v_self->_notify_all != 0)) != 0);
+      if (__pyx_t_10) {
+      } else {
+        __pyx_t_9 = __pyx_t_10;
+        goto __pyx_L9_bool_binop_done;
+      }
+      __pyx_t_10 = ((!(((struct __pyx_vtabstruct_6gevent_19__abstract_linkable_AbstractLinkable *)__pyx_v_self->__pyx_vtab)->ready(__pyx_v_self, 0) != 0)) != 0);
+      __pyx_t_9 = __pyx_t_10;
+      __pyx_L9_bool_binop_done:;
+      if (__pyx_t_9) {
+/* … */
+      }
+
+128:                     break
+
        goto __pyx_L7_break;
+
 129: 
+
+130:                 if link not in self._links:
+
      if (unlikely(__pyx_v_self->_links == Py_None)) {
+        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
+        __PYX_ERR(0, 130, __pyx_L4_error)
+      }
+      __pyx_t_9 = (__Pyx_PySet_ContainsTF(__pyx_v_link, __pyx_v_self->_links, Py_NE)); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 130, __pyx_L4_error)
+      __pyx_t_10 = (__pyx_t_9 != 0);
+      if (__pyx_t_10) {
+/* … */
+      }
+
 131:                     # Been removed already by some previous link. OK, fine.
+
+132:                     continue
+
        goto __pyx_L6_continue;
+
+133:                 try:
+
      /*try:*/ {
+        {
+          /*try:*/ {
+/* … */
+          }
+          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
+          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
+          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
+          goto __pyx_L24_try_end;
+          __pyx_L17_error:;
+          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+/* … */
+          __Pyx_XGIVEREF(__pyx_t_11);
+          __Pyx_XGIVEREF(__pyx_t_12);
+          __Pyx_XGIVEREF(__pyx_t_13);
+          __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13);
+          goto __pyx_L15_error;
+          __pyx_L18_exception_handled:;
+          __Pyx_XGIVEREF(__pyx_t_11);
+          __Pyx_XGIVEREF(__pyx_t_12);
+          __Pyx_XGIVEREF(__pyx_t_13);
+          __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13);
+          __pyx_L24_try_end:;
+        }
+      }
+
+134:                     link(self)
+
            __Pyx_INCREF(__pyx_v_link);
+            __pyx_t_3 = __pyx_v_link; __pyx_t_4 = NULL;
+            if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+              __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+              if (likely(__pyx_t_4)) {
+                PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+                __Pyx_INCREF(__pyx_t_4);
+                __Pyx_INCREF(function);
+                __Pyx_DECREF_SET(__pyx_t_3, function);
+              }
+            }
+            __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, ((PyObject *)__pyx_v_self)) : __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_self));
+            __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+            if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 134, __pyx_L17_error)
+            __Pyx_GOTREF(__pyx_t_2);
+            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+135:                 except: # pylint:disable=bare-except
+
          /*except:*/ {
+            __Pyx_AddTraceback("gevent.__abstract_linkable.AbstractLinkable._notify_links", __pyx_clineno, __pyx_lineno, __pyx_filename);
+            if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4) < 0) __PYX_ERR(0, 135, __pyx_L19_except_error)
+            __Pyx_GOTREF(__pyx_t_2);
+            __Pyx_GOTREF(__pyx_t_3);
+            __Pyx_GOTREF(__pyx_t_4);
+
 136:                     # We're running in the hub, so getcurrent() returns
+
 137:                     # a hub.
+
+138:                     self.hub.handle_error((link, self), *sys.exc_info()) # pylint:disable=undefined-variable
+
            __pyx_t_14 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->hub), __pyx_n_s_handle_error); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 138, __pyx_L19_except_error)
+            __Pyx_GOTREF(__pyx_t_14);
+            __pyx_t_15 = PyTuple_New(2); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 138, __pyx_L19_except_error)
+            __Pyx_GOTREF(__pyx_t_15);
+            __Pyx_INCREF(__pyx_v_link);
+            __Pyx_GIVEREF(__pyx_v_link);
+            PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_v_link);
+            __Pyx_INCREF(((PyObject *)__pyx_v_self));
+            __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
+            PyTuple_SET_ITEM(__pyx_t_15, 1, ((PyObject *)__pyx_v_self));
+            __pyx_t_16 = PyTuple_New(1); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 138, __pyx_L19_except_error)
+            __Pyx_GOTREF(__pyx_t_16);
+            __Pyx_GIVEREF(__pyx_t_15);
+            PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_15);
+            __pyx_t_15 = 0;
+            __Pyx_GetModuleGlobalName(__pyx_t_17, __pyx_n_s_sys); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 138, __pyx_L19_except_error)
+            __Pyx_GOTREF(__pyx_t_17);
+            __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_t_17, __pyx_n_s_exc_info); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 138, __pyx_L19_except_error)
+            __Pyx_GOTREF(__pyx_t_18);
+            __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
+            __pyx_t_17 = NULL;
+            if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_18))) {
+              __pyx_t_17 = PyMethod_GET_SELF(__pyx_t_18);
+              if (likely(__pyx_t_17)) {
+                PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_18);
+                __Pyx_INCREF(__pyx_t_17);
+                __Pyx_INCREF(function);
+                __Pyx_DECREF_SET(__pyx_t_18, function);
+              }
+            }
+            __pyx_t_15 = (__pyx_t_17) ? __Pyx_PyObject_CallOneArg(__pyx_t_18, __pyx_t_17) : __Pyx_PyObject_CallNoArg(__pyx_t_18);
+            __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
+            if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 138, __pyx_L19_except_error)
+            __Pyx_GOTREF(__pyx_t_15);
+            __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
+            __pyx_t_18 = __Pyx_PySequence_Tuple(__pyx_t_15); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 138, __pyx_L19_except_error)
+            __Pyx_GOTREF(__pyx_t_18);
+            __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
+            __pyx_t_15 = PyNumber_Add(__pyx_t_16, __pyx_t_18); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 138, __pyx_L19_except_error)
+            __Pyx_GOTREF(__pyx_t_15);
+            __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
+            __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
+            __pyx_t_18 = __Pyx_PyObject_Call(__pyx_t_14, __pyx_t_15, NULL); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 138, __pyx_L19_except_error)
+            __Pyx_GOTREF(__pyx_t_18);
+            __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
+            __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
+            __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
+            __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+            __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+            __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+            goto __pyx_L18_exception_handled;
+          }
+          __pyx_L19_except_error:;
+
 139:                 finally:
+
+140:                     if getattr(link, 'auto_unlink', None):
+
      /*finally:*/ {
+        /*normal exit:*/{
+          __pyx_t_4 = __Pyx_GetAttr3(__pyx_v_link, __pyx_n_s_auto_unlink, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 140, __pyx_L4_error)
+          __Pyx_GOTREF(__pyx_t_4);
+          __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 140, __pyx_L4_error)
+          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+          if (__pyx_t_10) {
+/* … */
+          }
+          goto __pyx_L16;
+        }
+        __pyx_L15_error:;
+        /*exception exit:*/{
+          __Pyx_PyThreadState_declare
+          __Pyx_PyThreadState_assign
+          __pyx_t_13 = 0; __pyx_t_12 = 0; __pyx_t_11 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_t_23 = 0;
+          __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
+          __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
+          __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
+          __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
+          __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
+          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_21, &__pyx_t_22, &__pyx_t_23);
+          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_13, &__pyx_t_12, &__pyx_t_11) < 0)) __Pyx_ErrFetch(&__pyx_t_13, &__pyx_t_12, &__pyx_t_11);
+          __Pyx_XGOTREF(__pyx_t_13);
+          __Pyx_XGOTREF(__pyx_t_12);
+          __Pyx_XGOTREF(__pyx_t_11);
+          __Pyx_XGOTREF(__pyx_t_21);
+          __Pyx_XGOTREF(__pyx_t_22);
+          __Pyx_XGOTREF(__pyx_t_23);
+          __pyx_t_8 = __pyx_lineno; __pyx_t_19 = __pyx_clineno; __pyx_t_20 = __pyx_filename;
+          {
+            __pyx_t_4 = __Pyx_GetAttr3(__pyx_v_link, __pyx_n_s_auto_unlink, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 140, __pyx_L31_error)
+            __Pyx_GOTREF(__pyx_t_4);
+            __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 140, __pyx_L31_error)
+            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+            if (__pyx_t_10) {
+/* … */
+            }
+          }
+          if (PY_MAJOR_VERSION >= 3) {
+            __Pyx_XGIVEREF(__pyx_t_21);
+            __Pyx_XGIVEREF(__pyx_t_22);
+            __Pyx_XGIVEREF(__pyx_t_23);
+            __Pyx_ExceptionReset(__pyx_t_21, __pyx_t_22, __pyx_t_23);
+          }
+          __Pyx_XGIVEREF(__pyx_t_13);
+          __Pyx_XGIVEREF(__pyx_t_12);
+          __Pyx_XGIVEREF(__pyx_t_11);
+          __Pyx_ErrRestore(__pyx_t_13, __pyx_t_12, __pyx_t_11);
+          __pyx_t_13 = 0; __pyx_t_12 = 0; __pyx_t_11 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_t_23 = 0;
+          __pyx_lineno = __pyx_t_8; __pyx_clineno = __pyx_t_19; __pyx_filename = __pyx_t_20;
+          goto __pyx_L4_error;
+          __pyx_L31_error:;
+          if (PY_MAJOR_VERSION >= 3) {
+            __Pyx_XGIVEREF(__pyx_t_21);
+            __Pyx_XGIVEREF(__pyx_t_22);
+            __Pyx_XGIVEREF(__pyx_t_23);
+            __Pyx_ExceptionReset(__pyx_t_21, __pyx_t_22, __pyx_t_23);
+          }
+          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
+          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
+          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
+          __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_t_23 = 0;
+          goto __pyx_L4_error;
+        }
+        __pyx_L16:;
+      }
+      __pyx_L6_continue:;
+    }
+    __pyx_L7_break:;
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  }
+
 141:                         # This attribute can avoid having to keep a reference to the function
+
 142:                         # *in* the function, which is a cycle
+
+143:                         self.unlink(link)
+
            __pyx_t_4 = ((struct __pyx_vtabstruct_6gevent_19__abstract_linkable_AbstractLinkable *)__pyx_v_self->__pyx_vtab)->unlink(__pyx_v_self, __pyx_v_link, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 143, __pyx_L4_error)
+            __Pyx_GOTREF(__pyx_t_4);
+            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+/* … */
+              __pyx_t_4 = ((struct __pyx_vtabstruct_6gevent_19__abstract_linkable_AbstractLinkable *)__pyx_v_self->__pyx_vtab)->unlink(__pyx_v_self, __pyx_v_link, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 143, __pyx_L31_error)
+              __Pyx_GOTREF(__pyx_t_4);
+              __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+
 144:         finally:
+
 145:             # We should not have created a new notifier even if callbacks
+
 146:             # released us because we loop through *all* of our links on the
+
 147:             # same callback while self._notifier is still true.
+
+148:             assert self._notifier is notifier
+
  /*finally:*/ {
+    /*normal exit:*/{
+      #ifndef CYTHON_WITHOUT_ASSERTIONS
+      if (unlikely(!Py_OptimizeFlag)) {
+        __pyx_t_10 = (__pyx_v_self->_notifier == __pyx_v_notifier);
+        if (unlikely(!(__pyx_t_10 != 0))) {
+          PyErr_SetNone(PyExc_AssertionError);
+          __PYX_ERR(0, 148, __pyx_L1_error)
+        }
+      }
+      #endif
+/* … */
+        #ifndef CYTHON_WITHOUT_ASSERTIONS
+        if (unlikely(!Py_OptimizeFlag)) {
+          __pyx_t_10 = (__pyx_v_self->_notifier == __pyx_v_notifier);
+          if (unlikely(!(__pyx_t_10 != 0))) {
+            PyErr_SetNone(PyExc_AssertionError);
+            __PYX_ERR(0, 148, __pyx_L34_error)
+          }
+        }
+        #endif
+
+149:             self._notifier = None
+
      __Pyx_INCREF(Py_None);
+      __Pyx_GIVEREF(Py_None);
+      __Pyx_GOTREF(__pyx_v_self->_notifier);
+      __Pyx_DECREF(__pyx_v_self->_notifier);
+      __pyx_v_self->_notifier = Py_None;
+      goto __pyx_L5;
+    }
+    __pyx_L4_error:;
+    /*exception exit:*/{
+      __Pyx_PyThreadState_declare
+      __Pyx_PyThreadState_assign
+      __pyx_t_23 = 0; __pyx_t_22 = 0; __pyx_t_21 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0;
+      __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
+      __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
+      __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
+      __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
+      __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
+      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+      if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13);
+      if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_23, &__pyx_t_22, &__pyx_t_21) < 0)) __Pyx_ErrFetch(&__pyx_t_23, &__pyx_t_22, &__pyx_t_21);
+      __Pyx_XGOTREF(__pyx_t_23);
+      __Pyx_XGOTREF(__pyx_t_22);
+      __Pyx_XGOTREF(__pyx_t_21);
+      __Pyx_XGOTREF(__pyx_t_11);
+      __Pyx_XGOTREF(__pyx_t_12);
+      __Pyx_XGOTREF(__pyx_t_13);
+      __pyx_t_7 = __pyx_lineno; __pyx_t_19 = __pyx_clineno; __pyx_t_24 = __pyx_filename;
+      {
+/* … */
+        __Pyx_INCREF(Py_None);
+        __Pyx_GIVEREF(Py_None);
+        __Pyx_GOTREF(__pyx_v_self->_notifier);
+        __Pyx_DECREF(__pyx_v_self->_notifier);
+        __pyx_v_self->_notifier = Py_None;
+      }
+      if (PY_MAJOR_VERSION >= 3) {
+        __Pyx_XGIVEREF(__pyx_t_11);
+        __Pyx_XGIVEREF(__pyx_t_12);
+        __Pyx_XGIVEREF(__pyx_t_13);
+        __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13);
+      }
+      __Pyx_XGIVEREF(__pyx_t_23);
+      __Pyx_XGIVEREF(__pyx_t_22);
+      __Pyx_XGIVEREF(__pyx_t_21);
+      __Pyx_ErrRestore(__pyx_t_23, __pyx_t_22, __pyx_t_21);
+      __pyx_t_23 = 0; __pyx_t_22 = 0; __pyx_t_21 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0;
+      __pyx_lineno = __pyx_t_7; __pyx_clineno = __pyx_t_19; __pyx_filename = __pyx_t_24;
+      goto __pyx_L1_error;
+      __pyx_L34_error:;
+      if (PY_MAJOR_VERSION >= 3) {
+        __Pyx_XGIVEREF(__pyx_t_11);
+        __Pyx_XGIVEREF(__pyx_t_12);
+        __Pyx_XGIVEREF(__pyx_t_13);
+        __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13);
+      }
+      __Pyx_XDECREF(__pyx_t_23); __pyx_t_23 = 0;
+      __Pyx_XDECREF(__pyx_t_22); __pyx_t_22 = 0;
+      __Pyx_XDECREF(__pyx_t_21); __pyx_t_21 = 0;
+      __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0;
+      goto __pyx_L1_error;
+    }
+    __pyx_L5:;
+  }
+
 150: 
+
 151:         # Our set of active links changed, and we were told to stop on the first
+
 152:         # time we went unready. See if we're ready, and if so, go around
+
 153:         # again.
+
+154:         if not self._notify_all and todo != self._links:
+
  __pyx_t_9 = ((!(__pyx_v_self->_notify_all != 0)) != 0);
+  if (__pyx_t_9) {
+  } else {
+    __pyx_t_10 = __pyx_t_9;
+    goto __pyx_L36_bool_binop_done;
+  }
+  __pyx_t_1 = PyObject_RichCompare(__pyx_v_todo, __pyx_v_self->_links, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 154, __pyx_L1_error)
+  __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 154, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_10 = __pyx_t_9;
+  __pyx_L36_bool_binop_done:;
+  if (__pyx_t_10) {
+/* … */
+  }
+
+155:             self._check_and_notify()
+
    __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_19__abstract_linkable_AbstractLinkable *)__pyx_v_self->__pyx_vtab)->_check_and_notify(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 155, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 156: 
+
+157:     def _wait_core(self, timeout, catch=Timeout):
+
static PyObject *__pyx_f_6gevent_19__abstract_linkable_16AbstractLinkable__wait_core(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *__pyx_v_self, PyObject *__pyx_v_timeout, struct __pyx_opt_args_6gevent_19__abstract_linkable_16AbstractLinkable__wait_core *__pyx_optional_args) {
+  PyObject *__pyx_v_catch = __pyx_k_;
+  PyObject *__pyx_v_switch = NULL;
+  PyObject *__pyx_v_timer = NULL;
+  PyObject *__pyx_v_result = NULL;
+  PyObject *__pyx_v_ex = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_wait_core", 0);
+  if (__pyx_optional_args) {
+    if (__pyx_optional_args->__pyx_n > 0) {
+      __pyx_v_catch = __pyx_optional_args->catch;
+    }
+  }
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_AddTraceback("gevent.__abstract_linkable.AbstractLinkable._wait_core", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_switch);
+  __Pyx_XDECREF(__pyx_v_timer);
+  __Pyx_XDECREF(__pyx_v_result);
+  __Pyx_XDECREF(__pyx_v_ex);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __Pyx_INCREF(__pyx_v_6gevent_19__abstract_linkable_Timeout);
+  __pyx_k_ = __pyx_v_6gevent_19__abstract_linkable_Timeout;
+  __Pyx_GIVEREF(__pyx_v_6gevent_19__abstract_linkable_Timeout);
+
 158:         # The core of the wait implementation, handling
+
 159:         # switching and linking. If *catch* is set to (),
+
 160:         # a timeout that elapses will be allowed to be raised.
+
 161:         # Returns a true value if the wait succeeded without timing out.
+
+162:         switch = getcurrent().switch # pylint:disable=undefined-variable
+
  __pyx_t_1 = ((PyObject *)__pyx_f_6gevent_19__abstract_linkable_getcurrent()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 162, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_switch); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 162, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_v_switch = __pyx_t_2;
+  __pyx_t_2 = 0;
+
+163:         self.rawlink(switch)
+
  __pyx_t_2 = ((struct __pyx_vtabstruct_6gevent_19__abstract_linkable_AbstractLinkable *)__pyx_v_self->__pyx_vtab)->rawlink(__pyx_v_self, __pyx_v_switch, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 163, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+164:         try:
+
  /*try:*/ {
+
+165:             with Timeout._start_new_or_dummy(timeout) as timer:
+
    /*with:*/ {
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_6gevent_19__abstract_linkable_Timeout, __pyx_n_s_start_new_or_dummy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 165, __pyx_L4_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      __pyx_t_3 = NULL;
+      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
+        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
+        if (likely(__pyx_t_3)) {
+          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
+          __Pyx_INCREF(__pyx_t_3);
+          __Pyx_INCREF(function);
+          __Pyx_DECREF_SET(__pyx_t_1, function);
+        }
+      }
+      __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_3, __pyx_v_timeout) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_timeout);
+      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 165, __pyx_L4_error)
+      __Pyx_GOTREF(__pyx_t_2);
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      __pyx_t_4 = __Pyx_PyObject_LookupSpecial(__pyx_t_2, __pyx_n_s_exit); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 165, __pyx_L4_error)
+      __Pyx_GOTREF(__pyx_t_4);
+      __pyx_t_3 = __Pyx_PyObject_LookupSpecial(__pyx_t_2, __pyx_n_s_enter); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 165, __pyx_L6_error)
+      __Pyx_GOTREF(__pyx_t_3);
+      __pyx_t_5 = NULL;
+      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
+        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
+        if (likely(__pyx_t_5)) {
+          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+          __Pyx_INCREF(__pyx_t_5);
+          __Pyx_INCREF(function);
+          __Pyx_DECREF_SET(__pyx_t_3, function);
+        }
+      }
+      __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
+      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 165, __pyx_L6_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __pyx_t_3 = __pyx_t_1;
+      __pyx_t_1 = 0;
+      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+      /*try:*/ {
+        {
+          /*try:*/ {
+            __pyx_v_timer = __pyx_t_3;
+            __pyx_t_3 = 0;
+/* … */
+          }
+          __pyx_L10_error:;
+          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+          /*except:*/ {
+            __Pyx_AddTraceback("gevent.__abstract_linkable.AbstractLinkable._wait_core", __pyx_clineno, __pyx_lineno, __pyx_filename);
+            if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3) < 0) __PYX_ERR(0, 165, __pyx_L12_except_error)
+            __Pyx_GOTREF(__pyx_t_1);
+            __Pyx_GOTREF(__pyx_t_2);
+            __Pyx_GOTREF(__pyx_t_3);
+            __pyx_t_5 = PyTuple_Pack(3, __pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 165, __pyx_L12_except_error)
+            __Pyx_GOTREF(__pyx_t_5);
+            __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL);
+            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+            if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 165, __pyx_L12_except_error)
+            __Pyx_GOTREF(__pyx_t_11);
+            __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_11);
+            __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+            if (__pyx_t_13 < 0) __PYX_ERR(0, 165, __pyx_L12_except_error)
+            __pyx_t_12 = ((!(__pyx_t_13 != 0)) != 0);
+            if (__pyx_t_12) {
+              __Pyx_GIVEREF(__pyx_t_1);
+              __Pyx_GIVEREF(__pyx_t_2);
+              __Pyx_XGIVEREF(__pyx_t_3);
+              __Pyx_ErrRestoreWithState(__pyx_t_1, __pyx_t_2, __pyx_t_3);
+              __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_3 = 0; 
+              __PYX_ERR(0, 165, __pyx_L12_except_error)
+            }
+            __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+            __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+            __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+            goto __pyx_L11_exception_handled;
+          }
+          __pyx_L12_except_error:;
+          __Pyx_XGIVEREF(__pyx_t_6);
+          __Pyx_XGIVEREF(__pyx_t_7);
+          __Pyx_XGIVEREF(__pyx_t_8);
+          __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
+          goto __pyx_L4_error;
+          __pyx_L14_try_return:;
+          __Pyx_XGIVEREF(__pyx_t_6);
+          __Pyx_XGIVEREF(__pyx_t_7);
+          __Pyx_XGIVEREF(__pyx_t_8);
+          __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
+          goto __pyx_L7_return;
+          __pyx_L11_exception_handled:;
+          __Pyx_XGIVEREF(__pyx_t_6);
+          __Pyx_XGIVEREF(__pyx_t_7);
+          __Pyx_XGIVEREF(__pyx_t_8);
+          __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
+        }
+      }
+      /*finally:*/ {
+        /*normal exit:*/{
+          if (__pyx_t_4) {
+            __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__2, NULL);
+            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+            if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 165, __pyx_L4_error)
+            __Pyx_GOTREF(__pyx_t_8);
+            __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+          }
+          goto __pyx_L9;
+        }
+        __pyx_L7_return: {
+          __pyx_t_8 = __pyx_r;
+          __pyx_r = 0;
+          if (__pyx_t_4) {
+            __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__2, NULL);
+            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+            if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 165, __pyx_L4_error)
+            __Pyx_GOTREF(__pyx_t_7);
+            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+          }
+          __pyx_r = __pyx_t_8;
+          __pyx_t_8 = 0;
+          goto __pyx_L3_return;
+        }
+        __pyx_L9:;
+      }
+      goto __pyx_L39;
+      __pyx_L6_error:;
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      goto __pyx_L4_error;
+      __pyx_L39:;
+    }
+  }
+/* … */
+  __pyx_tuple__2 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 165, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__2);
+  __Pyx_GIVEREF(__pyx_tuple__2);
+
+166:                 try:
+
            {
+              /*try:*/ {
+/* … */
+              }
+              __pyx_L16_error:;
+              __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+              __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+              __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+              __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+/* … */
+              __Pyx_XGIVEREF(__pyx_t_9);
+              __Pyx_XGIVEREF(__pyx_t_10);
+              __Pyx_XGIVEREF(__pyx_t_11);
+              __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
+              goto __pyx_L10_error;
+              __pyx_L20_try_return:;
+              __Pyx_XGIVEREF(__pyx_t_9);
+              __Pyx_XGIVEREF(__pyx_t_10);
+              __Pyx_XGIVEREF(__pyx_t_11);
+              __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
+              goto __pyx_L14_try_return;
+              __pyx_L19_except_return:;
+              __Pyx_XGIVEREF(__pyx_t_9);
+              __Pyx_XGIVEREF(__pyx_t_10);
+              __Pyx_XGIVEREF(__pyx_t_11);
+              __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
+              goto __pyx_L14_try_return;
+            }
+
+167:                     if self.hub is None:
+
                __pyx_t_12 = (((PyObject *)__pyx_v_self->hub) == Py_None);
+                __pyx_t_13 = (__pyx_t_12 != 0);
+                if (__pyx_t_13) {
+/* … */
+                }
+
+168:                         self.hub = get_hub()
+
                  __pyx_t_3 = ((PyObject *)__pyx_f_6gevent_11__hub_local_get_hub_noargs(0)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 168, __pyx_L16_error)
+                  __Pyx_GOTREF(__pyx_t_3);
+                  __Pyx_GIVEREF(__pyx_t_3);
+                  __Pyx_GOTREF(__pyx_v_self->hub);
+                  __Pyx_DECREF(((PyObject *)__pyx_v_self->hub));
+                  __pyx_v_self->hub = ((struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *)__pyx_t_3);
+                  __pyx_t_3 = 0;
+
+169:                     result = self.hub.switch()
+
                __pyx_t_3 = ((struct __pyx_vtabstruct_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *)__pyx_v_self->hub->__pyx_vtab)->__pyx_switch(__pyx_v_self->hub, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 169, __pyx_L16_error)
+                __Pyx_GOTREF(__pyx_t_3);
+                __pyx_v_result = __pyx_t_3;
+                __pyx_t_3 = 0;
+
+170:                     if result is not self: # pragma: no cover
+
                __pyx_t_13 = (__pyx_v_result != ((PyObject *)__pyx_v_self));
+                __pyx_t_12 = (__pyx_t_13 != 0);
+                if (unlikely(__pyx_t_12)) {
+/* … */
+                }
+
+171:                         raise InvalidSwitchError('Invalid switch into Event.wait(): %r' % (result, ))
+
                  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 171, __pyx_L16_error)
+                  __Pyx_GOTREF(__pyx_t_2);
+                  __Pyx_INCREF(__pyx_v_result);
+                  __Pyx_GIVEREF(__pyx_v_result);
+                  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_result);
+                  __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_switch_into_Event_wait_r, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 171, __pyx_L16_error)
+                  __Pyx_GOTREF(__pyx_t_1);
+                  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+                  __Pyx_INCREF(__pyx_v_6gevent_19__abstract_linkable_InvalidSwitchError);
+                  __pyx_t_2 = __pyx_v_6gevent_19__abstract_linkable_InvalidSwitchError; __pyx_t_5 = NULL;
+                  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
+                    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
+                    if (likely(__pyx_t_5)) {
+                      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+                      __Pyx_INCREF(__pyx_t_5);
+                      __Pyx_INCREF(function);
+                      __Pyx_DECREF_SET(__pyx_t_2, function);
+                    }
+                  }
+                  __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_1) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_1);
+                  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+                  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+                  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 171, __pyx_L16_error)
+                  __Pyx_GOTREF(__pyx_t_3);
+                  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+                  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
+                  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+                  __PYX_ERR(0, 171, __pyx_L16_error)
+
+172:                     return True
+
                __Pyx_XDECREF(__pyx_r);
+                __Pyx_INCREF(Py_True);
+                __pyx_r = Py_True;
+                goto __pyx_L20_try_return;
+
+173:                 except catch as ex:
+
              __pyx_t_14 = __Pyx_PyErr_ExceptionMatches(__pyx_v_catch);
+              if (__pyx_t_14) {
+                __Pyx_AddTraceback("gevent.__abstract_linkable.AbstractLinkable._wait_core", __pyx_clineno, __pyx_lineno, __pyx_filename);
+                if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_2, &__pyx_t_1) < 0) __PYX_ERR(0, 173, __pyx_L18_except_error)
+                __Pyx_GOTREF(__pyx_t_3);
+                __Pyx_GOTREF(__pyx_t_2);
+                __Pyx_GOTREF(__pyx_t_1);
+                __Pyx_INCREF(__pyx_t_2);
+                __pyx_v_ex = __pyx_t_2;
+                /*try:*/ {
+/* … */
+                /*finally:*/ {
+                  __pyx_L29_error:;
+                  /*exception exit:*/{
+                    __Pyx_PyThreadState_declare
+                    __Pyx_PyThreadState_assign
+                    __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
+                    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+                    if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22);
+                    if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19) < 0)) __Pyx_ErrFetch(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19);
+                    __Pyx_XGOTREF(__pyx_t_17);
+                    __Pyx_XGOTREF(__pyx_t_18);
+                    __Pyx_XGOTREF(__pyx_t_19);
+                    __Pyx_XGOTREF(__pyx_t_20);
+                    __Pyx_XGOTREF(__pyx_t_21);
+                    __Pyx_XGOTREF(__pyx_t_22);
+                    __pyx_t_14 = __pyx_lineno; __pyx_t_15 = __pyx_clineno; __pyx_t_16 = __pyx_filename;
+                    {
+                      __Pyx_DECREF(__pyx_v_ex);
+                      __pyx_v_ex = NULL;
+                    }
+                    if (PY_MAJOR_VERSION >= 3) {
+                      __Pyx_XGIVEREF(__pyx_t_20);
+                      __Pyx_XGIVEREF(__pyx_t_21);
+                      __Pyx_XGIVEREF(__pyx_t_22);
+                      __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_21, __pyx_t_22);
+                    }
+                    __Pyx_XGIVEREF(__pyx_t_17);
+                    __Pyx_XGIVEREF(__pyx_t_18);
+                    __Pyx_XGIVEREF(__pyx_t_19);
+                    __Pyx_ErrRestore(__pyx_t_17, __pyx_t_18, __pyx_t_19);
+                    __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
+                    __pyx_lineno = __pyx_t_14; __pyx_clineno = __pyx_t_15; __pyx_filename = __pyx_t_16;
+                    goto __pyx_L18_except_error;
+                  }
+                  __pyx_L28_return: {
+                    __pyx_t_22 = __pyx_r;
+                    __pyx_r = 0;
+                    __Pyx_DECREF(__pyx_v_ex);
+                    __pyx_v_ex = NULL;
+                    __pyx_r = __pyx_t_22;
+                    __pyx_t_22 = 0;
+                    goto __pyx_L19_except_return;
+                  }
+                }
+              }
+              goto __pyx_L18_except_error;
+              __pyx_L18_except_error:;
+
+174:                     if ex is not timer:
+
                  __pyx_t_12 = (__pyx_v_ex != __pyx_v_timer);
+                  __pyx_t_13 = (__pyx_t_12 != 0);
+                  if (unlikely(__pyx_t_13)) {
+/* … */
+                  }
+
+175:                         raise
+
                    __Pyx_GIVEREF(__pyx_t_3);
+                    __Pyx_GIVEREF(__pyx_t_2);
+                    __Pyx_XGIVEREF(__pyx_t_1);
+                    __Pyx_ErrRestoreWithState(__pyx_t_3, __pyx_t_2, __pyx_t_1);
+                    __pyx_t_3 = 0; __pyx_t_2 = 0; __pyx_t_1 = 0; 
+                    __PYX_ERR(0, 175, __pyx_L29_error)
+
 176:                     # test_set_and_clear and test_timeout in test_threading
+
 177:                     # rely on the exact return values, not just truthish-ness
+
+178:                     return False
+
                  __Pyx_XDECREF(__pyx_r);
+                  __Pyx_INCREF(Py_False);
+                  __pyx_r = Py_False;
+                  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+                  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+                  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+                  goto __pyx_L28_return;
+                }
+
 179:         finally:
+
+180:             self.unlink(switch)
+
  /*finally:*/ {
+    /*normal exit:*/{
+      __pyx_t_3 = ((struct __pyx_vtabstruct_6gevent_19__abstract_linkable_AbstractLinkable *)__pyx_v_self->__pyx_vtab)->unlink(__pyx_v_self, __pyx_v_switch, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 180, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_3);
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+      goto __pyx_L5;
+    }
+    __pyx_L4_error:;
+    /*exception exit:*/{
+      __Pyx_PyThreadState_declare
+      __Pyx_PyThreadState_assign
+      __pyx_t_4 = 0; __pyx_t_8 = 0; __pyx_t_7 = 0; __pyx_t_6 = 0; __pyx_t_11 = 0; __pyx_t_10 = 0;
+      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+      if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_6, &__pyx_t_11, &__pyx_t_10);
+      if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_4, &__pyx_t_8, &__pyx_t_7) < 0)) __Pyx_ErrFetch(&__pyx_t_4, &__pyx_t_8, &__pyx_t_7);
+      __Pyx_XGOTREF(__pyx_t_4);
+      __Pyx_XGOTREF(__pyx_t_8);
+      __Pyx_XGOTREF(__pyx_t_7);
+      __Pyx_XGOTREF(__pyx_t_6);
+      __Pyx_XGOTREF(__pyx_t_11);
+      __Pyx_XGOTREF(__pyx_t_10);
+      __pyx_t_15 = __pyx_lineno; __pyx_t_14 = __pyx_clineno; __pyx_t_23 = __pyx_filename;
+      {
+        __pyx_t_3 = ((struct __pyx_vtabstruct_6gevent_19__abstract_linkable_AbstractLinkable *)__pyx_v_self->__pyx_vtab)->unlink(__pyx_v_self, __pyx_v_switch, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 180, __pyx_L41_error)
+        __Pyx_GOTREF(__pyx_t_3);
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+      }
+      if (PY_MAJOR_VERSION >= 3) {
+        __Pyx_XGIVEREF(__pyx_t_6);
+        __Pyx_XGIVEREF(__pyx_t_11);
+        __Pyx_XGIVEREF(__pyx_t_10);
+        __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_11, __pyx_t_10);
+      }
+      __Pyx_XGIVEREF(__pyx_t_4);
+      __Pyx_XGIVEREF(__pyx_t_8);
+      __Pyx_XGIVEREF(__pyx_t_7);
+      __Pyx_ErrRestore(__pyx_t_4, __pyx_t_8, __pyx_t_7);
+      __pyx_t_4 = 0; __pyx_t_8 = 0; __pyx_t_7 = 0; __pyx_t_6 = 0; __pyx_t_11 = 0; __pyx_t_10 = 0;
+      __pyx_lineno = __pyx_t_15; __pyx_clineno = __pyx_t_14; __pyx_filename = __pyx_t_23;
+      goto __pyx_L1_error;
+      __pyx_L41_error:;
+      if (PY_MAJOR_VERSION >= 3) {
+        __Pyx_XGIVEREF(__pyx_t_6);
+        __Pyx_XGIVEREF(__pyx_t_11);
+        __Pyx_XGIVEREF(__pyx_t_10);
+        __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_11, __pyx_t_10);
+      }
+      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
+      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+      __pyx_t_6 = 0; __pyx_t_11 = 0; __pyx_t_10 = 0;
+      goto __pyx_L1_error;
+    }
+    __pyx_L3_return: {
+      __pyx_t_10 = __pyx_r;
+      __pyx_r = 0;
+      __pyx_t_3 = ((struct __pyx_vtabstruct_6gevent_19__abstract_linkable_AbstractLinkable *)__pyx_v_self->__pyx_vtab)->unlink(__pyx_v_self, __pyx_v_switch, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 180, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_3);
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __pyx_r = __pyx_t_10;
+      __pyx_t_10 = 0;
+      goto __pyx_L0;
+    }
+    __pyx_L5:;
+  }
+
 181: 
+
+182:     def _wait_return_value(self, waited, wait_success):
+
static PyObject *__pyx_f_6gevent_19__abstract_linkable_16AbstractLinkable__wait_return_value(CYTHON_UNUSED struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_waited, CYTHON_UNUSED PyObject *__pyx_v_wait_success) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_wait_return_value", 0);
+/* … */
+  /* function exit code */
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
 183:         # pylint:disable=unused-argument
+
 184:         # Subclasses should override this to return a value from _wait.
+
 185:         # By default we return None.
+
+186:         return None # pragma: no cover all extent subclasses override
+
  __Pyx_XDECREF(__pyx_r);
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+
 187: 
+
+188:     def _wait(self, timeout=None):
+
static PyObject *__pyx_f_6gevent_19__abstract_linkable_16AbstractLinkable__wait(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *__pyx_v_self, struct __pyx_opt_args_6gevent_19__abstract_linkable_16AbstractLinkable__wait *__pyx_optional_args) {
+  PyObject *__pyx_v_timeout = ((PyObject *)Py_None);
+  PyObject *__pyx_v_gotit = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_wait", 0);
+  if (__pyx_optional_args) {
+    if (__pyx_optional_args->__pyx_n > 0) {
+      __pyx_v_timeout = __pyx_optional_args->timeout;
+    }
+  }
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_AddTraceback("gevent.__abstract_linkable.AbstractLinkable._wait", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_gotit);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+189:         if self.ready():
+
  __pyx_t_1 = (((struct __pyx_vtabstruct_6gevent_19__abstract_linkable_AbstractLinkable *)__pyx_v_self->__pyx_vtab)->ready(__pyx_v_self, 0) != 0);
+  if (__pyx_t_1) {
+/* … */
+  }
+
+190:             return self._wait_return_value(False, False)
+
    __Pyx_XDECREF(__pyx_r);
+    __pyx_t_2 = ((struct __pyx_vtabstruct_6gevent_19__abstract_linkable_AbstractLinkable *)__pyx_v_self->__pyx_vtab)->_wait_return_value(__pyx_v_self, Py_False, Py_False); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 190, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_r = __pyx_t_2;
+    __pyx_t_2 = 0;
+    goto __pyx_L0;
+
 191: 
+
+192:         gotit = self._wait_core(timeout)
+
  __pyx_t_2 = ((struct __pyx_vtabstruct_6gevent_19__abstract_linkable_AbstractLinkable *)__pyx_v_self->__pyx_vtab)->_wait_core(__pyx_v_self, __pyx_v_timeout, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 192, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_v_gotit = __pyx_t_2;
+  __pyx_t_2 = 0;
+
+193:         return self._wait_return_value(True, gotit)
+
  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_2 = ((struct __pyx_vtabstruct_6gevent_19__abstract_linkable_AbstractLinkable *)__pyx_v_self->__pyx_vtab)->_wait_return_value(__pyx_v_self, Py_True, __pyx_v_gotit); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 193, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_r = __pyx_t_2;
+  __pyx_t_2 = 0;
+  goto __pyx_L0;
+
 194: 
+
+195: def _init():
+
static void __pyx_f_6gevent_19__abstract_linkable__init(void) {
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_init", 0);
+/* … */
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+}
+
+196:     greenlet_init() # pylint:disable=undefined-variable
+
  __pyx_f_6gevent_19__abstract_linkable_greenlet_init();
+
 197: 
+
+198: _init()
+
  __pyx_f_6gevent_19__abstract_linkable__init();
+
 199: 
+
 200: 
+
+201: from gevent._util import import_c_accel
+
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 201, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(__pyx_n_s_import_c_accel);
+  __Pyx_GIVEREF(__pyx_n_s_import_c_accel);
+  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_import_c_accel);
+  __pyx_t_2 = __Pyx_Import(__pyx_n_s_gevent__util, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 201, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_import_c_accel); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 201, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_import_c_accel, __pyx_t_1) < 0) __PYX_ERR(0, 201, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+202: import_c_accel(globals(), 'gevent.__abstract_linkable')
+
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_import_c_accel); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 202, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_1 = __Pyx_Globals(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 202, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 202, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_GIVEREF(__pyx_t_1);
+  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
+  __Pyx_INCREF(__pyx_n_s_gevent___abstract_linkable);
+  __Pyx_GIVEREF(__pyx_n_s_gevent___abstract_linkable);
+  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_n_s_gevent___abstract_linkable);
+  __pyx_t_1 = 0;
+  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 202, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_abstract_linkable.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_abstract_linkable.py new file mode 100644 index 00000000..304e75d0 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_abstract_linkable.py @@ -0,0 +1,202 @@ +# -*- coding: utf-8 -*- +# cython: auto_pickle=False,embedsignature=True,always_allow_keywords=False +""" +Internal module, support for the linkable protocol for "event" like objects. + +""" +from __future__ import absolute_import +from __future__ import division +from __future__ import print_function + +import sys + +from gevent._hub_local import get_hub_noargs as get_hub + +from gevent.exceptions import InvalidSwitchError +from gevent.timeout import Timeout + +locals()['getcurrent'] = __import__('greenlet').getcurrent +locals()['greenlet_init'] = lambda: None + +__all__ = [ + 'AbstractLinkable', +] + +class AbstractLinkable(object): + # Encapsulates the standard parts of the linking and notifying + # protocol common to both repeatable events (Event, Semaphore) and + # one-time events (AsyncResult). + + __slots__ = ('hub', '_links', '_notifier', '_notify_all', '__weakref__') + + def __init__(self): + # Before this implementation, AsyncResult and Semaphore + # maintained the order of notifications, but Event did not. + + # In gevent 1.3, before Semaphore extended this class, + # that was changed to not maintain the order. It was done because + # Event guaranteed to only call callbacks once (a set) but + # AsyncResult had no such guarantees. + + # Semaphore likes to maintain order of callbacks, though, + # so when it was added we went back to a list implementation + # for storing callbacks. But we want to preserve the unique callback + # property, so we manually check. + + # We generally don't expect to have so many waiters (for any of those + # objects) that testing membership and removing is a bottleneck. + + # In PyPy 2.6.1 with Cython 0.23, `cdef public` or `cdef + # readonly` or simply `cdef` attributes of type `object` can appear to leak if + # a Python subclass is used (this is visible simply + # instantiating this subclass if _links=[]). Our _links and + # _notifier are such attributes, and gevent.thread subclasses + # this class. Thus, we carefully manage the lifetime of the + # objects we put in these attributes so that, in the normal + # case of a semaphore used correctly (deallocated when it's not + # locked and no one is waiting), the leak goes away (because + # these objects are back to None). This can also be solved on PyPy + # by simply not declaring these objects in the pxd file, but that doesn't work for + # CPython ("No attribute...") + # See https://github.com/gevent/gevent/issues/660 + self._links = set() + self._notifier = None + # This is conceptually a class attribute, defined here for ease of access in + # cython. If it's true, when notifiers fire, all existing callbacks are called. + # If its false, we only call callbacks as long as ready() returns true. + self._notify_all = True + # we don't want to do get_hub() here to allow defining module-level objects + # without initializing the hub + self.hub = None + + def linkcount(self): + # For testing: how many objects are linked to this one? + return len(self._links) + + def ready(self): + # Instances must define this + raise NotImplementedError + + def _check_and_notify(self): + # If this object is ready to be notified, begin the process. + if self.ready() and self._links and not self._notifier: + if self.hub is None: + self.hub = get_hub() + + self._notifier = self.hub.loop.run_callback(self._notify_links) + + def rawlink(self, callback): + """ + Register a callback to call when this object is ready. + + *callback* will be called in the :class:`Hub + `, so it must not use blocking gevent API. + *callback* will be passed one argument: this instance. + """ + if not callable(callback): + raise TypeError('Expected callable: %r' % (callback, )) + + self._links.add(callback) + self._check_and_notify() + + def unlink(self, callback): + """Remove the callback set by :meth:`rawlink`""" + self._links.discard(callback) + + if not self._links and self._notifier is not None: + # If we currently have one queued, de-queue it. + # This will break a reference cycle. + # (self._notifier -> self._notify_links -> self) + # But we can't set it to None in case it was actually running. + self._notifier.stop() + + + def _notify_links(self): + # We release self._notifier here. We are called by it + # at the end of the loop, and it is now false in a boolean way (as soon + # as this method returns). + notifier = self._notifier + # We were ready() at the time this callback was scheduled; + # we may not be anymore, and that status may change during + # callback processing. Some of our subclasses will want to + # notify everyone that the status was once true, even though not it + # may not be anymore. + todo = set(self._links) + try: + for link in todo: + if not self._notify_all and not self.ready(): + break + + if link not in self._links: + # Been removed already by some previous link. OK, fine. + continue + try: + link(self) + except: # pylint:disable=bare-except + # We're running in the hub, so getcurrent() returns + # a hub. + self.hub.handle_error((link, self), *sys.exc_info()) # pylint:disable=undefined-variable + finally: + if getattr(link, 'auto_unlink', None): + # This attribute can avoid having to keep a reference to the function + # *in* the function, which is a cycle + self.unlink(link) + finally: + # We should not have created a new notifier even if callbacks + # released us because we loop through *all* of our links on the + # same callback while self._notifier is still true. + assert self._notifier is notifier + self._notifier = None + + # Our set of active links changed, and we were told to stop on the first + # time we went unready. See if we're ready, and if so, go around + # again. + if not self._notify_all and todo != self._links: + self._check_and_notify() + + def _wait_core(self, timeout, catch=Timeout): + # The core of the wait implementation, handling + # switching and linking. If *catch* is set to (), + # a timeout that elapses will be allowed to be raised. + # Returns a true value if the wait succeeded without timing out. + switch = getcurrent().switch # pylint:disable=undefined-variable + self.rawlink(switch) + try: + with Timeout._start_new_or_dummy(timeout) as timer: + try: + if self.hub is None: + self.hub = get_hub() + result = self.hub.switch() + if result is not self: # pragma: no cover + raise InvalidSwitchError('Invalid switch into Event.wait(): %r' % (result, )) + return True + except catch as ex: + if ex is not timer: + raise + # test_set_and_clear and test_timeout in test_threading + # rely on the exact return values, not just truthish-ness + return False + finally: + self.unlink(switch) + + def _wait_return_value(self, waited, wait_success): + # pylint:disable=unused-argument + # Subclasses should override this to return a value from _wait. + # By default we return None. + return None # pragma: no cover all extent subclasses override + + def _wait(self, timeout=None): + if self.ready(): + return self._wait_return_value(False, False) + + gotit = self._wait_core(timeout) + return self._wait_return_value(True, gotit) + +def _init(): + greenlet_init() # pylint:disable=undefined-variable + +_init() + + +from gevent._util import import_c_accel +import_c_accel(globals(), 'gevent.__abstract_linkable') diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_compat.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_compat.py new file mode 100644 index 00000000..22bad70c --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_compat.py @@ -0,0 +1,160 @@ +# -*- coding: utf-8 -*- +""" +internal gevent python 2/python 3 bridges. Not for external use. +""" + +from __future__ import print_function, absolute_import, division + +import sys +import os + + +PY2 = sys.version_info[0] == 2 +PY3 = sys.version_info[0] >= 3 +PYPY = hasattr(sys, 'pypy_version_info') +WIN = sys.platform.startswith("win") +LINUX = sys.platform.startswith('linux') +OSX = sys.platform == 'darwin' + + +PURE_PYTHON = PYPY or os.getenv('PURE_PYTHON') + +## Types + +if PY3: + string_types = (str,) + integer_types = (int,) + text_type = str + native_path_types = (str, bytes) + thread_mod_name = '_thread' + +else: + import __builtin__ # pylint:disable=import-error + string_types = (__builtin__.basestring,) + text_type = __builtin__.unicode + integer_types = (int, __builtin__.long) + native_path_types = string_types + thread_mod_name = 'thread' + +def NativeStrIO(): + import io + return io.BytesIO() if str is bytes else io.StringIO() + +## Exceptions +if PY3: + def reraise(t, value, tb=None): # pylint:disable=unused-argument + if value.__traceback__ is not tb and tb is not None: + raise value.with_traceback(tb) + raise value + def exc_clear(): + pass + +else: + from gevent._util_py2 import reraise # pylint:disable=import-error,no-name-in-module + reraise = reraise # export + exc_clear = sys.exc_clear + +## import locks +try: + # In Python 3.4 and newer in CPython and PyPy3, + # imp.acquire_lock and imp.release_lock are delegated to + # '_imp'. (Which is also used by importlib.) 'imp' itself is + # deprecated. Avoid that warning. + import _imp as imp +except ImportError: + import imp +imp_acquire_lock = imp.acquire_lock +imp_release_lock = imp.release_lock + +## Functions +if PY3: + iteritems = dict.items + itervalues = dict.values + xrange = range + izip = zip + +else: + iteritems = dict.iteritems # python 3: pylint:disable=no-member + itervalues = dict.itervalues # python 3: pylint:disable=no-member + xrange = __builtin__.xrange + from itertools import izip # python 3: pylint:disable=no-member,no-name-in-module + izip = izip + +# fspath from 3.6 os.py, but modified to raise the same exceptions as the +# real native implementation. +# Define for testing +def _fspath(path): + """ + Return the path representation of a path-like object. + + If str or bytes is passed in, it is returned unchanged. Otherwise the + os.PathLike interface is used to get the path representation. If the + path representation is not str or bytes, TypeError is raised. If the + provided path is not str, bytes, or os.PathLike, TypeError is raised. + """ + if isinstance(path, native_path_types): + return path + + # Work from the object's type to match method resolution of other magic + # methods. + path_type = type(path) + try: + path_type_fspath = path_type.__fspath__ + except AttributeError: + raise TypeError("expected str, bytes or os.PathLike object, " + "not " + path_type.__name__) + + path_repr = path_type_fspath(path) + if isinstance(path_repr, native_path_types): + return path_repr + + raise TypeError("expected {}.__fspath__() to return str or bytes, " + "not {}".format(path_type.__name__, + type(path_repr).__name__)) +try: + from os import fspath # pylint: disable=unused-import,no-name-in-module +except ImportError: + # if not available, use the Python version as transparently as + # possible + fspath = _fspath + fspath.__name__ = 'fspath' + +try: + from os import fsencode # pylint: disable=unused-import,no-name-in-module +except ImportError: + encoding = sys.getfilesystemencoding() or ('utf-8' if not WIN else 'mbcs') + errors = 'strict' if WIN and encoding == 'mbcs' else 'surrogateescape' + + # Added in 3.2, so this is for Python 2.7. Note that it doesn't have + # sys.getfilesystemencodeerrors(), which was added in 3.6 + def fsencode(filename): + """Encode filename (an os.PathLike, bytes, or str) to the filesystem + encoding with 'surrogateescape' error handler, return bytes unchanged. + On Windows, use 'strict' error handler if the file system encoding is + 'mbcs' (which is the default encoding). + """ + filename = fspath(filename) # Does type-checking of `filename`. + if isinstance(filename, bytes): + return filename + + try: + return filename.encode(encoding, errors) + except LookupError: + # Can't encode it, and the error handler doesn't + # exist. Probably on Python 2 with an astral character. + # Not sure how to handle this. + raise UnicodeEncodeError("Can't encode path to filesystem encoding") + + +## Clocks +try: + # Python 3.3+ (PEP 418) + from time import perf_counter + perf_counter = perf_counter +except ImportError: + import time + + if sys.platform == "win32": + perf_counter = time.clock + else: + perf_counter = time.time diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_config.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_config.py new file mode 100644 index 00000000..5a9990f8 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_config.py @@ -0,0 +1,701 @@ +# Copyright (c) 2018 gevent. See LICENSE for details. +""" +gevent tunables. + +This should be used as ``from gevent import config``. That variable +is an object of :class:`Config`. + +.. versionadded:: 1.3a2 +""" + +from __future__ import print_function, absolute_import, division + +import importlib +import os +import textwrap + +from gevent._compat import string_types +from gevent._compat import WIN + +__all__ = [ + 'config', +] + +ALL_SETTINGS = [] + +class SettingType(type): + # pylint:disable=bad-mcs-classmethod-argument + + def __new__(cls, name, bases, cls_dict): + if name == 'Setting': + return type.__new__(cls, name, bases, cls_dict) + + cls_dict["order"] = len(ALL_SETTINGS) + if 'name' not in cls_dict: + cls_dict['name'] = name.lower() + + if 'environment_key' not in cls_dict: + cls_dict['environment_key'] = 'GEVENT_' + cls_dict['name'].upper() + + + new_class = type.__new__(cls, name, bases, cls_dict) + new_class.fmt_desc(cls_dict.get("desc", "")) + new_class.__doc__ = new_class.desc + ALL_SETTINGS.append(new_class) + + if new_class.document: + setting_name = cls_dict['name'] + + def getter(self): + return self.settings[setting_name].get() + + def setter(self, value): # pragma: no cover + # The setter should never be hit, Config has a + # __setattr__ that would override. But for the sake + # of consistency we provide one. + self.settings[setting_name].set(value) + + prop = property(getter, setter, doc=new_class.__doc__) + + setattr(Config, cls_dict['name'], prop) + return new_class + + def fmt_desc(cls, desc): + desc = textwrap.dedent(desc).strip() + if hasattr(cls, 'shortname_map'): + desc += ( + "\n\nThis is an importable value. It can be " + "given as a string naming an importable object, " + "or a list of strings in preference order and the first " + "successfully importable object will be used. (Separate values " + "in the environment variable with commas.) " + "It can also be given as the callable object itself (in code). " + ) + if cls.shortname_map: + desc += "Shorthand names for default objects are %r" % (list(cls.shortname_map),) + if getattr(cls.validate, '__doc__'): + desc += '\n\n' + textwrap.dedent(cls.validate.__doc__).strip() + if isinstance(cls.default, str) and hasattr(cls, 'shortname_map'): + default = "`%s`" % (cls.default,) + else: + default = "`%r`" % (cls.default,) + desc += "\n\nThe default value is %s" % (default,) + desc += ("\n\nThe environment variable ``%s`` " + "can be used to control this." % (cls.environment_key,)) + setattr(cls, "desc", desc) + return desc + +def validate_invalid(value): + raise ValueError("Not a valid value: %r" % (value,)) + +def validate_bool(value): + """ + This is a boolean value. + + In the environment variable, it may be given as ``1``, ``true``, + ``on`` or ``yes`` for `True`, or ``0``, ``false``, ``off``, or + ``no`` for `False`. + """ + if isinstance(value, string_types): + value = value.lower().strip() + if value in ('1', 'true', 'on', 'yes'): + value = True + elif value in ('0', 'false', 'off', 'no') or not value: + value = False + else: + raise ValueError("Invalid boolean string: %r" % (value,)) + return bool(value) + +def validate_anything(value): + return value + +convert_str_value_as_is = validate_anything + +class Setting(object): + name = None + value = None + validate = staticmethod(validate_invalid) + default = None + environment_key = None + document = True + + desc = """\ + + A long ReST description. + + The first line should be a single sentence. + + """ + + def _convert(self, value): + if isinstance(value, string_types): + return value.split(',') + return value + + def _default(self): + result = os.environ.get(self.environment_key, self.default) + result = self._convert(result) + return result + + def get(self): + # If we've been specifically set, return it + if 'value' in self.__dict__: + return self.value + # Otherwise, read from the environment and reify + # so we return consistent results. + self.value = self.validate(self._default()) + return self.value + + def set(self, val): + self.value = self.validate(self._convert(val)) + + +Setting = SettingType('Setting', (Setting,), dict(Setting.__dict__)) + +def make_settings(): + """ + Return fresh instances of all classes defined in `ALL_SETTINGS`. + """ + settings = {} + for setting_kind in ALL_SETTINGS: + setting = setting_kind() + assert setting.name not in settings + settings[setting.name] = setting + return settings + + +class Config(object): + """ + Global configuration for gevent. + + There is one instance of this object at ``gevent.config``. If you + are going to make changes in code, instead of using the documented + environment variables, you need to make the changes before using + any parts of gevent that might need those settings. For example:: + + >>> from gevent import config + >>> config.fileobject = 'thread' + + >>> from gevent import fileobject + >>> fileobject.FileObject.__name__ + 'FileObjectThread' + + .. versionadded:: 1.3a2 + + """ + + def __init__(self): + self.settings = make_settings() + + def __getattr__(self, name): + if name not in self.settings: + raise AttributeError("No configuration setting for: %r" % name) + return self.settings[name].get() + + def __setattr__(self, name, value): + if name != "settings" and name in self.settings: + self.set(name, value) + else: + super(Config, self).__setattr__(name, value) + + def set(self, name, value): + if name not in self.settings: + raise AttributeError("No configuration setting for: %r" % name) + self.settings[name].set(value) + + def __dir__(self): + return list(self.settings) + + +class ImportableSetting(object): + + def _import_one_of(self, candidates): + assert isinstance(candidates, list) + if not candidates: + raise ImportError('Cannot import from empty list') + + for item in candidates[:-1]: + try: + return self._import_one(item) + except ImportError: + pass + + return self._import_one(candidates[-1]) + + def _import_one(self, path, _MISSING=object()): + if not isinstance(path, string_types): + return path + + if '.' not in path or '/' in path: + raise ImportError("Cannot import %r. " + "Required format: [package.]module.class. " + "Or choose from %r" + % (path, list(self.shortname_map))) + + + module, item = path.rsplit('.', 1) + module = importlib.import_module(module) + x = getattr(module, item, _MISSING) + if x is _MISSING: + raise ImportError('Cannot import %r from %r' % (item, module)) + return x + + shortname_map = {} + + def validate(self, value): + if isinstance(value, type): + return value + return self._import_one_of([self.shortname_map.get(x, x) for x in value]) + + def get_options(self): + result = {} + for name, val in self.shortname_map.items(): + try: + result[name] = self._import_one(val) + except ImportError as e: + result[name] = e + return result + + +class BoolSettingMixin(object): + validate = staticmethod(validate_bool) + # Don't do string-to-list conversion. + _convert = staticmethod(convert_str_value_as_is) + + +class IntSettingMixin(object): + # Don't do string-to-list conversion. + def _convert(self, value): + if value: + return int(value) + + validate = staticmethod(validate_anything) + + +class _PositiveValueMixin(object): + + def validate(self, value): + if value is not None and value <= 0: + raise ValueError("Must be positive") + return value + + +class FloatSettingMixin(_PositiveValueMixin): + def _convert(self, value): + if value: + return float(value) + + +class ByteCountSettingMixin(_PositiveValueMixin): + + _MULTIPLES = { + # All keys must be the same size. + 'kb': 1024, + 'mb': 1024 * 1024, + 'gb': 1024 * 1024 * 1024, + } + + _SUFFIX_SIZE = 2 + + def _convert(self, value): + if not value or not isinstance(value, str): + return value + value = value.lower() + for s, m in self._MULTIPLES.items(): + if value[-self._SUFFIX_SIZE:] == s: + return int(value[:-self._SUFFIX_SIZE]) * m + return int(value) + + +class Resolver(ImportableSetting, Setting): + + desc = """\ + The callable that will be used to create + :attr:`gevent.hub.Hub.resolver`. + + See :doc:`dns` for more information. + """ + + default = [ + 'thread', + 'dnspython', + 'ares', + 'block', + ] + + shortname_map = { + 'ares': 'gevent.resolver.ares.Resolver', + 'thread': 'gevent.resolver.thread.Resolver', + 'block': 'gevent.resolver.blocking.Resolver', + 'dnspython': 'gevent.resolver.dnspython.Resolver', + } + + + +class Threadpool(ImportableSetting, Setting): + + desc = """\ + The kind of threadpool we use. + """ + + default = 'gevent.threadpool.ThreadPool' + + +class Loop(ImportableSetting, Setting): + + desc = """\ + The kind of the loop we use. + + On Windows, this defaults to libuv, while on + other platforms it defaults to libev. + + """ + + default = [ + 'libev-cext', + 'libev-cffi', + 'libuv-cffi', + ] if not WIN else [ + 'libuv-cffi', + 'libev-cext', + 'libev-cffi', + ] + + shortname_map = { + 'libev-cext': 'gevent.libev.corecext.loop', + 'libev-cffi': 'gevent.libev.corecffi.loop', + 'libuv-cffi': 'gevent.libuv.loop.loop', + } + + shortname_map['libuv'] = shortname_map['libuv-cffi'] + + +class FormatContext(ImportableSetting, Setting): + name = 'format_context' + + # using pprint.pformat can override custom __repr__ methods on dict/list + # subclasses, which can be a security concern + default = 'pprint.saferepr' + + +class LibevBackend(Setting): + name = 'libev_backend' + environment_key = 'GEVENT_BACKEND' + + desc = """\ + The backend for libev, such as 'select' + """ + + default = None + + validate = staticmethod(validate_anything) + + +class FileObject(ImportableSetting, Setting): + desc = """\ + The kind of ``FileObject`` we will use. + + See :mod:`gevent.fileobject` for a detailed description. + + """ + environment_key = 'GEVENT_FILE' + + default = [ + 'posix', + 'thread', + ] + + shortname_map = { + 'thread': 'gevent._fileobjectcommon.FileObjectThread', + 'posix': 'gevent._fileobjectposix.FileObjectPosix', + 'block': 'gevent._fileobjectcommon.FileObjectBlock' + } + + +class WatchChildren(BoolSettingMixin, Setting): + desc = """\ + Should we *not* watch children with the event loop watchers? + + This is an advanced setting. + + See :mod:`gevent.os` for a detailed description. + """ + name = 'disable_watch_children' + environment_key = 'GEVENT_NOWAITPID' + default = False + + +class TraceMalloc(IntSettingMixin, Setting): + name = 'trace_malloc' + environment_key = 'PYTHONTRACEMALLOC' + default = False + + desc = """\ + Should FFI objects track their allocation? + + This is only useful for low-level debugging. + + On Python 3, this environment variable is built in to the + interpreter, and it may also be set with the ``-X + tracemalloc`` command line argument. + + On Python 2, gevent interprets this argument and adds extra + tracking information for FFI objects. + """ + + +class TrackGreenletTree(BoolSettingMixin, Setting): + name = 'track_greenlet_tree' + environment_key = 'GEVENT_TRACK_GREENLET_TREE' + default = True + + desc = """\ + Should `Greenlet` objects track their spawning tree? + + Setting this to a false value will make spawning `Greenlet` + objects and using `spawn_raw` faster, but the + ``spawning_greenlet``, ``spawn_tree_locals`` and ``spawning_stack`` + will not be captured. + + .. versionadded:: 1.3b1 + """ + + +## Monitoring settings +# All env keys should begin with GEVENT_MONITOR + +class MonitorThread(BoolSettingMixin, Setting): + name = 'monitor_thread' + environment_key = 'GEVENT_MONITOR_THREAD_ENABLE' + default = False + + desc = """\ + Should each hub start a native OS thread to monitor + for problems? + + Such a thread will periodically check to see if the event loop + is blocked for longer than `max_blocking_time`, producing output on + the hub's exception stream (stderr by default) if it detects this condition. + + If this setting is true, then this thread will be created + the first time the hub is switched to, + or you can call :meth:`gevent.hub.Hub.start_periodic_monitoring_thread` at any + time to create it (from the same thread that will run the hub). That function + will return an instance of :class:`gevent.events.IPeriodicMonitorThread` + to which you can add your own monitoring functions. That function + also emits an event of :class:`gevent.events.PeriodicMonitorThreadStartedEvent`. + + .. seealso:: `max_blocking_time` + + .. versionadded:: 1.3b1 + """ + +class MaxBlockingTime(FloatSettingMixin, Setting): + name = 'max_blocking_time' + # This environment key doesn't follow the convention because it's + # meant to match a key used by existing projects + environment_key = 'GEVENT_MAX_BLOCKING_TIME' + default = 0.1 + + desc = """\ + If the `monitor_thread` is enabled, this is + approximately how long (in seconds) + the event loop will be allowed to block before a warning is issued. + + This function depends on using `greenlet.settrace`, so installing + your own trace function after starting the monitoring thread will + cause this feature to misbehave unless you call the function + returned by `greenlet.settrace`. If you install a tracing function *before* + the monitoring thread is started, it will still be called. + + .. note:: In the unlikely event of creating and using multiple different + gevent hubs in the same native thread in a short period of time, + especially without destroying the hubs, false positives may be reported. + + .. versionadded:: 1.3b1 + """ + +class MonitorMemoryPeriod(FloatSettingMixin, Setting): + name = 'memory_monitor_period' + + environment_key = 'GEVENT_MONITOR_MEMORY_PERIOD' + default = 5 + + desc = """\ + If `monitor_thread` is enabled, this is approximately how long + (in seconds) we will go between checking the processes memory usage. + + Checking the memory usage is relatively expensive on some operating + systems, so this should not be too low. gevent will place a floor + value on it. + """ + +class MonitorMemoryMaxUsage(ByteCountSettingMixin, Setting): + name = 'max_memory_usage' + + environment_key = 'GEVENT_MONITOR_MEMORY_MAX' + default = None + + desc = """\ + If `monitor_thread` is enabled, + then if memory usage exceeds this amount (in bytes), events will + be emitted. See `gevent.events`. In the environment variable, you can use + a suffix of 'kb', 'mb' or 'gb' to specify the value in kilobytes, megabytes + or gigibytes. + + There is no default value for this setting. If you wish to + cap memory usage, you must choose a value. + """ + +# The ares settings are all interpreted by +# gevent/resolver/ares.pyx, so we don't do +# any validation here. + +class AresSettingMixin(object): + + document = False + + @property + def kwarg_name(self): + return self.name[5:] + + validate = staticmethod(validate_anything) + + _convert = staticmethod(convert_str_value_as_is) + +class AresFlags(AresSettingMixin, Setting): + name = 'ares_flags' + default = None + environment_key = 'GEVENTARES_FLAGS' + +class AresTimeout(AresSettingMixin, Setting): + document = True + name = 'ares_timeout' + default = None + environment_key = 'GEVENTARES_TIMEOUT' + desc = """\ + + .. deprecated:: 1.3a2 + Prefer the :attr:`resolver_timeout` setting. If both are set, + the results are not defined. + """ + +class AresTries(AresSettingMixin, Setting): + name = 'ares_tries' + default = None + environment_key = 'GEVENTARES_TRIES' + +class AresNdots(AresSettingMixin, Setting): + name = 'ares_ndots' + default = None + environment_key = 'GEVENTARES_NDOTS' + +class AresUDPPort(AresSettingMixin, Setting): + name = 'ares_udp_port' + default = None + environment_key = 'GEVENTARES_UDP_PORT' + +class AresTCPPort(AresSettingMixin, Setting): + name = 'ares_tcp_port' + default = None + environment_key = 'GEVENTARES_TCP_PORT' + +class AresServers(AresSettingMixin, Setting): + document = True + name = 'ares_servers' + default = None + environment_key = 'GEVENTARES_SERVERS' + desc = """\ + A list of strings giving the IP addresses of nameservers for the ares resolver. + + In the environment variable, these strings are separated by commas. + + .. deprecated:: 1.3a2 + Prefer the :attr:`resolver_nameservers` setting. If both are set, + the results are not defined. + """ + +# Generic nameservers, works for dnspython and ares. +class ResolverNameservers(AresSettingMixin, Setting): + document = True + name = 'resolver_nameservers' + default = None + environment_key = 'GEVENT_RESOLVER_NAMESERVERS' + desc = """\ + A list of strings giving the IP addresses of nameservers for the (non-system) resolver. + + In the environment variable, these strings are separated by commas. + + .. rubric:: Resolver Behaviour + + * blocking + + Ignored + + * Threaded + + Ignored + + * dnspython + + If this setting is not given, the dnspython resolver will + load nameservers to use from ``/etc/resolv.conf`` + or the Windows registry. This setting replaces any nameservers read + from those means. Note that the file and registry are still read + for other settings. + + .. caution:: dnspython does not validate the members of the list. + An improper address (such as a hostname instead of IP) has + undefined results, including hanging the process. + + * ares + + Similar to dnspython, but with more platform and compile-time + options. ares validates that the members of the list are valid + addresses. + """ + + # Normal string-to-list rules. But still validate_anything. + _convert = Setting._convert + + # TODO: In the future, support reading a resolv.conf file + # *other* than /etc/resolv.conf, and do that both on Windows + # and other platforms. Also offer the option to disable the system + # configuration entirely. + + @property + def kwarg_name(self): + return 'servers' + +# Generic timeout, works for dnspython and ares +class ResolverTimeout(FloatSettingMixin, AresSettingMixin, Setting): + document = True + name = 'resolver_timeout' + environment_key = 'GEVENT_RESOLVER_TIMEOUT' + desc = """\ + The total amount of time that the DNS resolver will spend making queries. + + Only the ares and dnspython resolvers support this. + + .. versionadded:: 1.3a2 + """ + + @property + def kwarg_name(self): + return 'timeout' + +config = Config() + +# Go ahead and attempt to import the loop when this class is +# instantiated. The hub won't work if the loop can't be found. This +# can solve problems with the class being imported from multiple +# threads at once, leading to one of the imports failing. +# factories are themselves handled lazily. See #687. + +# Don't cache it though, in case the user re-configures through the +# API. + +try: + Loop().get() +except ImportError: # pragma: no cover + pass diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_event.cp37-win_amd64.pyd b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_event.cp37-win_amd64.pyd new file mode 100644 index 0000000000000000000000000000000000000000..2861009e750561a9e0894f1eacf646c8c7600d5a GIT binary patch literal 104960 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 If9t>h3o+Hz0ssI2 literal 0 HcmV?d00001 diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_event.pxd b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_event.pxd new file mode 100644 index 00000000..f08d2d78 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_event.pxd @@ -0,0 +1,30 @@ +cimport cython + +from gevent.__hub_local cimport get_hub_noargs as get_hub +from gevent.__abstract_linkable cimport AbstractLinkable + +cdef _None +cdef reraise +cdef dump_traceback +cdef load_traceback + +cdef Timeout + +cdef class Event(AbstractLinkable): + cdef bint _flag + +cdef class AsyncResult(AbstractLinkable): + cdef readonly _value + cdef readonly tuple _exc_info + + # For the use of _imap.py + cdef public int _imap_task_index + + cpdef get(self, block=*, timeout=*) + cpdef bint successful(self) + + cpdef wait(self, timeout=*) + cpdef bint done(self) + + cpdef bint cancel(self) + cpdef bint cancelled(self) diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_ffi/__init__.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_ffi/__init__.py new file mode 100644 index 00000000..56f1e965 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_ffi/__init__.py @@ -0,0 +1,27 @@ +""" +Internal helpers for FFI implementations. +""" +from __future__ import print_function, absolute_import + +import os +import sys + +def _dbg(*args, **kwargs): + # pylint:disable=unused-argument + pass + +#_dbg = print + +def _pid_dbg(*args, **kwargs): + kwargs['file'] = sys.stderr + print(os.getpid(), *args, **kwargs) + +CRITICAL = 1 +ERROR = 3 +DEBUG = 5 +TRACE = 9 + +GEVENT_DEBUG_LEVEL = vars()[os.getenv("GEVENT_DEBUG", 'CRITICAL').upper()] + +if GEVENT_DEBUG_LEVEL >= TRACE: + _dbg = _pid_dbg diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_ffi/callback.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_ffi/callback.py new file mode 100644 index 00000000..df59a9f3 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_ffi/callback.py @@ -0,0 +1,58 @@ +from __future__ import absolute_import, print_function + +__all__ = [ + 'callback', +] + + +# For times when *args is captured but often not passed (empty), +# we can avoid keeping the new tuple that was created for *args +# around by using a constant. +_NOARGS = () + + +class callback(object): + + __slots__ = ('callback', 'args') + + def __init__(self, cb, args): + self.callback = cb + self.args = args or _NOARGS + + def stop(self): + self.callback = None + self.args = None + + close = stop + + # Note that __nonzero__ and pending are different + # bool() is used in contexts where we need to know whether to schedule another callback, + # so it's true if it's pending or currently running + # 'pending' has the same meaning as libev watchers: it is cleared before actually + # running the callback + + def __nonzero__(self): + # it's nonzero if it's pending or currently executing + # NOTE: This depends on loop._run_callbacks setting the args property + # to None. + return self.args is not None + __bool__ = __nonzero__ + + @property + def pending(self): + return self.callback is not None + + def _format(self): + return '' + + def __repr__(self): + result = "<%s at 0x%x" % (self.__class__.__name__, id(self)) + if self.pending: + result += " pending" + if self.callback is not None: + result += " callback=%r" % (self.callback, ) + if self.args is not None: + result += " args=%r" % (self.args, ) + if self.callback is None and self.args is None: + result += " stopped" + return result + ">" diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_ffi/loop.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_ffi/loop.py new file mode 100644 index 00000000..f77c25ac --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_ffi/loop.py @@ -0,0 +1,713 @@ +""" +Basic loop implementation for ffi-based cores. +""" +# pylint: disable=too-many-lines, protected-access, redefined-outer-name, not-callable +from __future__ import absolute_import, print_function + +from collections import deque +import sys +import os +import traceback + +from gevent._ffi import _dbg +from gevent._ffi import GEVENT_DEBUG_LEVEL +from gevent._ffi import TRACE +from gevent._ffi.callback import callback +from gevent._compat import PYPY + +from gevent import getswitchinterval + +__all__ = [ + 'AbstractLoop', + 'assign_standard_callbacks', +] + + +class _EVENTSType(object): + def __repr__(self): + return 'gevent.core.EVENTS' + +EVENTS = GEVENT_CORE_EVENTS = _EVENTSType() + + +##### +## Note on CFFI objects, callbacks and the lifecycle of watcher objects +# +# Each subclass of `watcher` allocates a C structure of the +# appropriate type e.g., struct gevent_ev_io and holds this pointer in +# its `_gwatcher` attribute. When that watcher instance is garbage +# collected, then the C structure is also freed. The C structure is +# passed to libev from the watcher's start() method and then to the +# appropriate C callback function, e.g., _gevent_ev_io_callback, which +# passes it back to python's _python_callback where we need the +# watcher instance. Therefore, as long as that callback is active (the +# watcher is started), the watcher instance must not be allowed to get +# GC'd---any access at the C level or even the FFI level to the freed +# memory could crash the process. +# +# However, the typical idiom calls for writing something like this: +# loop.io(fd, python_cb).start() +# thus forgetting the newly created watcher subclass and allowing it to be immediately +# GC'd. To combat this, when the watcher is started, it places itself into the loop's +# `_keepaliveset`, and it only removes itself when the watcher's `stop()` method is called. +# Often, this is the *only* reference keeping the watcher object, and hence its C structure, +# alive. +# +# This is slightly complicated by the fact that the python-level +# callback, called from the C callback, could choose to manually stop +# the watcher. When we return to the C level callback, we now have an +# invalid pointer, and attempting to pass it back to Python (e.g., to +# handle an error) could crash. Hence, _python_callback, +# _gevent_io_callback, and _python_handle_error cooperate to make sure +# that the watcher instance stays in the loops `_keepaliveset` while +# the C code could be running---and if it gets removed, to not call back +# to Python again. +# See also https://github.com/gevent/gevent/issues/676 +#### +class AbstractCallbacks(object): + + + def __init__(self, ffi): + self.ffi = ffi + self.callbacks = [] + if GEVENT_DEBUG_LEVEL < TRACE: + self.from_handle = ffi.from_handle + + def from_handle(self, handle): # pylint:disable=method-hidden + x = self.ffi.from_handle(handle) + return x + + def python_callback(self, handle, revents): + """ + Returns an integer having one of three values: + + - -1 + An exception occurred during the callback and you must call + :func:`_python_handle_error` to deal with it. The Python watcher + object will have the exception tuple saved in ``_exc_info``. + - 1 + Everything went according to plan. You should check to see if the libev + watcher is still active, and call :func:`python_stop` if it is not. This will + clean up the memory. Finding the watcher still active at the event loop level, + but not having stopped itself at the gevent level is a buggy scenario and + shouldn't happen. + - 2 + Everything went according to plan, but the watcher has already + been stopped. Its memory may no longer be valid. + + This function should never return 0, as that's the default value that + Python exceptions will produce. + """ + #print("Running callback", handle) + orig_ffi_watcher = None + try: + # Even dereferencing the handle needs to be inside the try/except; + # if we don't return normally (e.g., a signal) then we wind up going + # to the 'onerror' handler (unhandled_onerror), which + # is not what we want; that can permanently wedge the loop depending + # on which callback was executing. + # XXX: See comments in that function. We may be able to restart and do better? + if not handle: + # Hmm, a NULL handle. That's not supposed to happen. + # We can easily get into a loop if we deref it and allow that + # to raise. + _dbg("python_callback got null handle") + return 1 + the_watcher = self.from_handle(handle) + orig_ffi_watcher = the_watcher._watcher + args = the_watcher.args + if args is None: + # Legacy behaviour from corecext: convert None into () + # See test__core_watcher.py + args = _NOARGS + if args and args[0] == GEVENT_CORE_EVENTS: + args = (revents, ) + args[1:] + #print("Calling function", the_watcher.callback, args) + the_watcher.callback(*args) + except: # pylint:disable=bare-except + _dbg("Got exception servicing watcher with handle", handle, sys.exc_info()) + # It's possible for ``the_watcher`` to be undefined (UnboundLocalError) + # if we threw an exception (signal) on the line that created that variable. + # This is typically the case with a signal under libuv + try: + the_watcher + except UnboundLocalError: + the_watcher = self.from_handle(handle) + the_watcher._exc_info = sys.exc_info() + # Depending on when the exception happened, the watcher + # may or may not have been stopped. We need to make sure its + # memory stays valid so we can stop it at the ev level if needed. + # If its loop is gone, it has already been stopped, + # see https://github.com/gevent/gevent/issues/1295 for a case where + # that happened + if the_watcher.loop is not None: + the_watcher.loop._keepaliveset.add(the_watcher) + return -1 + else: + if (the_watcher.loop is not None + and the_watcher in the_watcher.loop._keepaliveset + and the_watcher._watcher is orig_ffi_watcher): + # It didn't stop itself, *and* it didn't stop itself, reset + # its watcher, and start itself again. libuv's io watchers MAY + # do that. + # The normal, expected scenario when we find the watcher still + # in the keepaliveset is that it is still active at the event loop + # level, so we don't expect that python_stop gets called. + #_dbg("The watcher has not stopped itself, possibly still active", the_watcher) + return 1 + return 2 # it stopped itself + + def python_handle_error(self, handle, _revents): + _dbg("Handling error for handle", handle) + if not handle: + return + try: + watcher = self.from_handle(handle) + exc_info = watcher._exc_info + del watcher._exc_info + # In the past, we passed the ``watcher`` itself as the context, + # which typically meant that the Hub would just print + # the exception. This is a problem because sometimes we can't + # detect signals until late in ``python_callback``; specifically, + # test_selectors.py:DefaultSelectorTest.test_select_interrupt_exc + # installs a SIGALRM handler that raises an exception. That exception can happen + # before we enter ``python_callback`` or at any point within it because of the way + # libuv swallows signals. By passing None, we get the exception prapagated into + # the main greenlet (which is probably *also* not what we always want, but + # I see no way to distinguish the cases). + watcher.loop.handle_error(None, *exc_info) + finally: + # XXX Since we're here on an error condition, and we + # made sure that the watcher object was put in loop._keepaliveset, + # what about not stopping the watcher? Looks like a possible + # memory leak? + # XXX: This used to do "if revents & (libev.EV_READ | libev.EV_WRITE)" + # before stopping. Why? + try: + watcher.stop() + except: # pylint:disable=bare-except + watcher.loop.handle_error(watcher, *sys.exc_info()) + return # pylint:disable=lost-exception + + def unhandled_onerror(self, t, v, tb): + # This is supposed to be called for signals, etc. + # This is the onerror= value for CFFI. + # If we return None, C will get a value of 0/NULL; + # if we raise, CFFI will print the exception and then + # return 0/NULL; (unless error= was configured) + # If things go as planned, we return the value that asks + # C to call back and check on if the watcher needs to be closed or + # not. + + # XXX: TODO: Could this cause events to be lost? Maybe we need to return + # a value that causes the C loop to try the callback again? + # at least for signals under libuv, which are delivered at very odd times. + # Hopefully the event still shows up when we poll the next time. + watcher = None + handle = tb.tb_frame.f_locals['handle'] if tb is not None else None + if handle: # handle could be NULL + watcher = self.from_handle(handle) + if watcher is not None: + watcher.loop.handle_error(None, t, v, tb) + return 1 + + # Raising it causes a lot of noise from CFFI + print("WARNING: gevent: Unhandled error with no watcher", + file=sys.stderr) + traceback.print_exception(t, v, tb) + + def python_stop(self, handle): + if not handle: # pragma: no cover + print( + "WARNING: gevent: Unable to dereference handle; not stopping watcher. " + "Native resources may leak. This is most likely a bug in gevent.", + file=sys.stderr) + # The alternative is to crash with no helpful information + # NOTE: Raising exceptions here does nothing, they're swallowed by CFFI. + # Since the C level passed in a null pointer, even dereferencing the handle + # will just produce some exceptions. + return + watcher = self.from_handle(handle) + watcher.stop() + + if not PYPY: + def python_check_callback(self, watcher_ptr): # pylint:disable=unused-argument + # If we have the onerror callback, this is a no-op; all the real + # work to rethrow the exception is done by the onerror callback + + # NOTE: Unlike the rest of the functions, this is called with a pointer + # to the C level structure, *not* a pointer to the void* that represents a + # for the Python Watcher object. + pass + else: # PyPy + # On PyPy, we need the function to have some sort of body, otherwise + # the signal exceptions don't always get caught, *especially* with + # libuv (however, there's no reason to expect this to only be a libuv + # issue; it's just that we don't depend on the periodic signal timer + # under libev, so the issue is much more pronounced under libuv) + # test_socket's test_sendall_interrupted can hang. + # See https://github.com/gevent/gevent/issues/1112 + + def python_check_callback(self, watcher_ptr): # pylint:disable=unused-argument + # Things we've tried that *don't* work: + # greenlet.getcurrent() + # 1 + 1 + try: + raise MemoryError() + except MemoryError: + pass + + def python_prepare_callback(self, watcher_ptr): + loop = self._find_loop_from_c_watcher(watcher_ptr) + if loop is None: # pragma: no cover + print("WARNING: gevent: running prepare callbacks from a destroyed handle: ", + watcher_ptr) + return + loop._run_callbacks() + + def check_callback_onerror(self, t, v, tb): + watcher_ptr = tb.tb_frame.f_locals['watcher_ptr'] if tb is not None else None + if watcher_ptr: + loop = self._find_loop_from_c_watcher(watcher_ptr) + if loop is not None: + # None as the context argument causes the exception to be raised + # in the main greenlet. + loop.handle_error(None, t, v, tb) + return None + raise v # Let CFFI print + + def _find_loop_from_c_watcher(self, watcher_ptr): + raise NotImplementedError() + + + +def assign_standard_callbacks(ffi, lib, callbacks_class, extras=()): # pylint:disable=unused-argument + # callbacks keeps these cdata objects alive at the python level + callbacks = callbacks_class(ffi) + extras = tuple([(getattr(callbacks, name), error) for name, error in extras]) + for (func, error_func) in ((callbacks.python_callback, None), + (callbacks.python_handle_error, None), + (callbacks.python_stop, None), + (callbacks.python_check_callback, + callbacks.check_callback_onerror), + (callbacks.python_prepare_callback, + callbacks.check_callback_onerror)) + extras: + # The name of the callback function matches the 'extern Python' declaration. + error_func = error_func or callbacks.unhandled_onerror + callback = ffi.def_extern(onerror=error_func)(func) + # keep alive the cdata + # (def_extern returns the original function, and it requests that + # the function be "global", so maybe it keeps a hard reference to it somewhere now + # unlike ffi.callback(), and we don't need to do this?) + callbacks.callbacks.append(callback) + + # At this point, the library C variable (static function, actually) + # is filled in. + + return callbacks + + +if sys.version_info[0] >= 3: + basestring = (bytes, str) + integer_types = (int,) +else: + import __builtin__ # pylint:disable=import-error + basestring = (__builtin__.basestring,) + integer_types = (int, __builtin__.long) + + + + +_NOARGS = () + +CALLBACK_CHECK_COUNT = 50 + +class AbstractLoop(object): + # pylint:disable=too-many-public-methods,too-many-instance-attributes + + error_handler = None + + _CHECK_POINTER = None + + _TIMER_POINTER = None + _TIMER_CALLBACK_SIG = None + + _PREPARE_POINTER = None + + starting_timer_may_update_loop_time = False + + # Subclasses should set this in __init__ to reflect + # whether they were the default loop. + _default = None + + def __init__(self, ffi, lib, watchers, flags=None, default=None): + self._ffi = ffi + self._lib = lib + self._ptr = None + self._handle_to_self = self._ffi.new_handle(self) # XXX: Reference cycle? + self._watchers = watchers + self._in_callback = False + self._callbacks = deque() + # Stores python watcher objects while they are started + self._keepaliveset = set() + self._init_loop_and_aux_watchers(flags, default) + + + def _init_loop_and_aux_watchers(self, flags=None, default=None): + + self._ptr = self._init_loop(flags, default) + + + # self._check is a watcher that runs in each iteration of the + # mainloop, just after the blocking call. It's point is to handle + # signals. It doesn't run watchers or callbacks, it just exists to give + # CFFI a chance to raise signal exceptions so we can handle them. + self._check = self._ffi.new(self._CHECK_POINTER) + self._check.data = self._handle_to_self + self._init_and_start_check() + + # self._prepare is a watcher that runs in each iteration of the mainloop, + # just before the blocking call. It's where we run deferred callbacks + # from self.run_callback. This cooperates with _setup_for_run_callback() + # to schedule self._timer0 if needed. + self._prepare = self._ffi.new(self._PREPARE_POINTER) + self._prepare.data = self._handle_to_self + self._init_and_start_prepare() + + # A timer we start and stop on demand. If we have callbacks, + # too many to run in one iteration of _run_callbacks, we turn this + # on so as to have the next iteration of the run loop return to us + # as quickly as possible. + # TODO: There may be a more efficient way to do this using ev_timer_again; + # see the "ev_timer" section of the ev manpage (http://linux.die.net/man/3/ev) + # Alternatively, setting the ev maximum block time may also work. + self._timer0 = self._ffi.new(self._TIMER_POINTER) + self._timer0.data = self._handle_to_self + self._init_callback_timer() + + # TODO: We may be able to do something nicer and use the existing python_callback + # combined with onerror and the class check/timer/prepare to simplify things + # and unify our handling + + def _init_loop(self, flags, default): + """ + Called by __init__ to create or find the loop. The return value + is assigned to self._ptr. + """ + raise NotImplementedError() + + def _init_and_start_check(self): + raise NotImplementedError() + + def _init_and_start_prepare(self): + raise NotImplementedError() + + def _init_callback_timer(self): + raise NotImplementedError() + + def _stop_callback_timer(self): + raise NotImplementedError() + + def _start_callback_timer(self): + raise NotImplementedError() + + def _check_callback_handle_error(self, t, v, tb): + self.handle_error(None, t, v, tb) + + def _run_callbacks(self): # pylint:disable=too-many-branches + # When we're running callbacks, its safe for timers to + # update the notion of the current time (because if we're here, + # we're not running in a timer callback that may let other timers + # run; this is mostly an issue for libuv). + + # That's actually a bit of a lie: on libev, self._timer0 really is + # a timer, and so sometimes this is running in a timer callback, not + # a prepare callback. But that's OK, libev doesn't suffer from cascading + # timer expiration and its safe to update the loop time at any + # moment there. + self.starting_timer_may_update_loop_time = True + try: + count = CALLBACK_CHECK_COUNT + now = self.now() + expiration = now + getswitchinterval() + self._stop_callback_timer() + while self._callbacks: + cb = self._callbacks.popleft() # pylint:disable=assignment-from-no-return + count -= 1 + self.unref() # XXX: libuv doesn't have a global ref count! + callback = cb.callback + cb.callback = None + args = cb.args + if callback is None or args is None: + # it's been stopped + continue + + try: + callback(*args) + except: # pylint:disable=bare-except + # If we allow an exception to escape this method (while we are running the ev callback), + # then CFFI will print the error and libev will continue executing. + # There are two problems with this. The first is that the code after + # the loop won't run. The second is that any remaining callbacks scheduled + # for this loop iteration will be silently dropped; they won't run, but they'll + # also not be *stopped* (which is not a huge deal unless you're looking for + # consistency or checking the boolean/pending status; the loop doesn't keep + # a reference to them like it does to watchers...*UNLESS* the callback itself had + # a reference to a watcher; then I don't know what would happen, it depends on + # the state of the watcher---a leak or crash is not totally inconceivable). + # The Cython implementation in core.ppyx uses gevent_call from callbacks.c + # to run the callback, which uses gevent_handle_error to handle any errors the + # Python callback raises...it unconditionally simply prints any error raised + # by loop.handle_error and clears it, so callback handling continues. + # We take a similar approach (but are extra careful about printing) + try: + self.handle_error(cb, *sys.exc_info()) + except: # pylint:disable=bare-except + try: + print("Exception while handling another error", file=sys.stderr) + traceback.print_exc() + except: # pylint:disable=bare-except + pass # Nothing we can do here + finally: + # NOTE: this must be reset here, because cb.args is used as a flag in + # the callback class so that bool(cb) of a callback that has been run + # becomes False + cb.args = None + + # We've finished running one group of callbacks + # but we may have more, so before looping check our + # switch interval. + if count == 0 and self._callbacks: + count = CALLBACK_CHECK_COUNT + self.update_now() + if self.now() >= expiration: + now = 0 + break + + # Update the time before we start going again, if we didn't + # just do so. + if now != 0: + self.update_now() + + if self._callbacks: + self._start_callback_timer() + finally: + self.starting_timer_may_update_loop_time = False + + def _stop_aux_watchers(self): + raise NotImplementedError() + + def destroy(self): + if self._ptr: + try: + if not self._can_destroy_loop(self._ptr): + return False + self._stop_aux_watchers() + self._destroy_loop(self._ptr) + finally: + # not ffi.NULL, we don't want something that can be + # passed to C and crash later. This will create nice friendly + # TypeError from CFFI. + self._ptr = None + del self._handle_to_self + del self._callbacks + del self._keepaliveset + + return True + + def _can_destroy_loop(self, ptr): + raise NotImplementedError() + + def _destroy_loop(self, ptr): + raise NotImplementedError() + + @property + def ptr(self): + return self._ptr + + @property + def WatcherType(self): + return self._watchers.watcher + + @property + def MAXPRI(self): + return 1 + + @property + def MINPRI(self): + return 1 + + def _handle_syserr(self, message, errno): + try: + errno = os.strerror(errno) + except: # pylint:disable=bare-except + traceback.print_exc() + try: + message = '%s: %s' % (message, errno) + except: # pylint:disable=bare-except + traceback.print_exc() + self.handle_error(None, SystemError, SystemError(message), None) + + def handle_error(self, context, type, value, tb): + handle_error = None + error_handler = self.error_handler + if error_handler is not None: + # we do want to do getattr every time so that setting Hub.handle_error property just works + handle_error = getattr(error_handler, 'handle_error', error_handler) + handle_error(context, type, value, tb) + else: + self._default_handle_error(context, type, value, tb) + + def _default_handle_error(self, context, type, value, tb): # pylint:disable=unused-argument + # note: Hub sets its own error handler so this is not used by gevent + # this is here to make core.loop usable without the rest of gevent + # Should cause the loop to stop running. + traceback.print_exception(type, value, tb) + + + def run(self, nowait=False, once=False): + raise NotImplementedError() + + def reinit(self): + raise NotImplementedError() + + def ref(self): + # XXX: libuv doesn't do it this way + raise NotImplementedError() + + def unref(self): + raise NotImplementedError() + + def break_(self, how=None): + raise NotImplementedError() + + def verify(self): + pass + + def now(self): + raise NotImplementedError() + + def update_now(self): + raise NotImplementedError() + + def update(self): + import warnings + warnings.warn("'update' is deprecated; use 'update_now'", + DeprecationWarning, + stacklevel=2) + self.update_now() + + def __repr__(self): + return '<%s at 0x%x %s>' % (self.__class__.__name__, id(self), self._format()) + + @property + def default(self): + return self._default if self._ptr else False + + @property + def iteration(self): + return -1 + + @property + def depth(self): + return -1 + + @property + def backend_int(self): + return 0 + + @property + def backend(self): + return "default" + + @property + def pendingcnt(self): + return 0 + + def io(self, fd, events, ref=True, priority=None): + return self._watchers.io(self, fd, events, ref, priority) + + def timer(self, after, repeat=0.0, ref=True, priority=None): + return self._watchers.timer(self, after, repeat, ref, priority) + + def signal(self, signum, ref=True, priority=None): + return self._watchers.signal(self, signum, ref, priority) + + def idle(self, ref=True, priority=None): + return self._watchers.idle(self, ref, priority) + + def prepare(self, ref=True, priority=None): + return self._watchers.prepare(self, ref, priority) + + def check(self, ref=True, priority=None): + return self._watchers.check(self, ref, priority) + + def fork(self, ref=True, priority=None): + return self._watchers.fork(self, ref, priority) + + def async_(self, ref=True, priority=None): + return self._watchers.async_(self, ref, priority) + + # Provide BWC for those that can use 'async' as is + locals()['async'] = async_ + + if sys.platform != "win32": + + def child(self, pid, trace=0, ref=True): + return self._watchers.child(self, pid, trace, ref) + + def install_sigchld(self): + pass + + def stat(self, path, interval=0.0, ref=True, priority=None): + return self._watchers.stat(self, path, interval, ref, priority) + + def callback(self, priority=None): + return callback(self, priority) + + def _setup_for_run_callback(self): + raise NotImplementedError() + + def run_callback(self, func, *args): + # If we happen to already be running callbacks (inside + # _run_callbacks), this could happen almost immediately, + # without the loop cycling. + cb = callback(func, args) + self._callbacks.append(cb) + self._setup_for_run_callback() + + return cb + + def _format(self): + if not self._ptr: + return 'destroyed' + msg = self.backend + if self.default: + msg += ' default' + msg += ' pending=%s' % self.pendingcnt + msg += self._format_details() + return msg + + def _format_details(self): + msg = '' + fileno = self.fileno() # pylint:disable=assignment-from-none + try: + activecnt = self.activecnt + except AttributeError: + activecnt = None + if activecnt is not None: + msg += ' ref=' + repr(activecnt) + if fileno is not None: + msg += ' fileno=' + repr(fileno) + #if sigfd is not None and sigfd != -1: + # msg += ' sigfd=' + repr(sigfd) + return msg + + def fileno(self): + return None + + @property + def activecnt(self): + if not self._ptr: + raise ValueError('operation on destroyed loop') + return 0 diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_ffi/watcher.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_ffi/watcher.py new file mode 100644 index 00000000..3f880cef --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_ffi/watcher.py @@ -0,0 +1,641 @@ +""" +Useful base classes for watchers. The available +watchers will depend on the specific event loop. +""" +# pylint:disable=not-callable +from __future__ import absolute_import, print_function + +import signal as signalmodule +import functools +import warnings + +from gevent._config import config + +try: + from tracemalloc import get_object_traceback + + def tracemalloc(init): + # PYTHONTRACEMALLOC env var controls this on Python 3. + return init +except ImportError: # Python < 3.4 + + if config.trace_malloc: + # Use the same env var to turn this on for Python 2 + import traceback + + class _TB(object): + __slots__ = ('lines',) + + def __init__(self, lines): + # These end in newlines, which we don't want for consistency + self.lines = [x.rstrip() for x in lines] + + def format(self): + return self.lines + + def tracemalloc(init): + @functools.wraps(init) + def traces(self, *args, **kwargs): + init(self, *args, **kwargs) + self._captured_malloc = _TB(traceback.format_stack()) + return traces + + def get_object_traceback(obj): + return obj._captured_malloc + + else: + def get_object_traceback(_obj): + return None + + def tracemalloc(init): + return init + +from gevent._compat import fsencode + +from gevent._ffi import _dbg # pylint:disable=unused-import +from gevent._ffi import GEVENT_DEBUG_LEVEL +from gevent._ffi import DEBUG +from gevent._ffi.loop import GEVENT_CORE_EVENTS +from gevent._ffi.loop import _NOARGS + +ALLOW_WATCHER_DEL = GEVENT_DEBUG_LEVEL >= DEBUG + +__all__ = [ + +] + +try: + ResourceWarning +except NameError: + class ResourceWarning(Warning): + "Python 2 fallback" + +class _NoWatcherResult(int): + + def __repr__(self): + return "" + +_NoWatcherResult = _NoWatcherResult(0) + +def events_to_str(event_field, all_events): + result = [] + for (flag, string) in all_events: + c_flag = flag + if event_field & c_flag: + result.append(string) + event_field = event_field & (~c_flag) + if not event_field: + break + if event_field: + result.append(hex(event_field)) + return '|'.join(result) + + +def not_while_active(func): + @functools.wraps(func) + def nw(self, *args, **kwargs): + if self.active: + raise ValueError("not while active") + func(self, *args, **kwargs) + return nw + +def only_if_watcher(func): + @functools.wraps(func) + def if_w(self): + if self._watcher: + return func(self) + return _NoWatcherResult + return if_w + + +class LazyOnClass(object): + + @classmethod + def lazy(cls, cls_dict, func): + "Put a LazyOnClass object in *cls_dict* with the same name as *func*" + cls_dict[func.__name__] = cls(func) + + def __init__(self, func, name=None): + self.name = name or func.__name__ + self.func = func + + def __get__(self, inst, klass): + if inst is None: # pragma: no cover + return self + + val = self.func(inst) + setattr(klass, self.name, val) + return val + + +class AbstractWatcherType(type): + """ + Base metaclass for watchers. + + To use, you will: + + - subclass the watcher class defined from this type. + - optionally subclass this type + """ + # pylint:disable=bad-mcs-classmethod-argument + + _FFI = None + _LIB = None + + def __new__(cls, name, bases, cls_dict): + if name != 'watcher' and not cls_dict.get('_watcher_skip_ffi'): + cls._fill_watcher(name, bases, cls_dict) + if '__del__' in cls_dict and not ALLOW_WATCHER_DEL: # pragma: no cover + raise TypeError("CFFI watchers are not allowed to have __del__") + return type.__new__(cls, name, bases, cls_dict) + + @classmethod + def _fill_watcher(cls, name, bases, cls_dict): + # TODO: refactor smaller + # pylint:disable=too-many-locals + if name.endswith('_'): + # Strip trailing _ added to avoid keyword duplications + # e.g., async_ + name = name[:-1] + + def _mro_get(attr, bases, error=True): + for b in bases: + try: + return getattr(b, attr) + except AttributeError: + continue + if error: # pragma: no cover + raise AttributeError(attr) + _watcher_prefix = cls_dict.get('_watcher_prefix') or _mro_get('_watcher_prefix', bases) + + if '_watcher_type' not in cls_dict: + watcher_type = _watcher_prefix + '_' + name + cls_dict['_watcher_type'] = watcher_type + elif not cls_dict['_watcher_type'].startswith(_watcher_prefix): + watcher_type = _watcher_prefix + '_' + cls_dict['_watcher_type'] + cls_dict['_watcher_type'] = watcher_type + + active_name = _watcher_prefix + '_is_active' + + def _watcher_is_active(self): + return getattr(self._LIB, active_name) + + LazyOnClass.lazy(cls_dict, _watcher_is_active) + + watcher_struct_name = cls_dict.get('_watcher_struct_name') + if not watcher_struct_name: + watcher_struct_pattern = (cls_dict.get('_watcher_struct_pattern') + or _mro_get('_watcher_struct_pattern', bases, False) + or 'struct %s') + watcher_struct_name = watcher_struct_pattern % (watcher_type,) + + def _watcher_struct_pointer_type(self): + return self._FFI.typeof(watcher_struct_name + ' *') + + LazyOnClass.lazy(cls_dict, _watcher_struct_pointer_type) + + callback_name = (cls_dict.get('_watcher_callback_name') + or _mro_get('_watcher_callback_name', bases, False) + or '_gevent_generic_callback') + + def _watcher_callback(self): + return self._FFI.addressof(self._LIB, callback_name) + + LazyOnClass.lazy(cls_dict, _watcher_callback) + + def _make_meth(name, watcher_name): + def meth(self): + lib_name = self._watcher_type + '_' + name + return getattr(self._LIB, lib_name) + meth.__name__ = watcher_name + return meth + + for meth_name in 'start', 'stop', 'init': + watcher_name = '_watcher' + '_' + meth_name + if watcher_name not in cls_dict: + LazyOnClass.lazy(cls_dict, _make_meth(meth_name, watcher_name)) + + def new_handle(cls, obj): + return cls._FFI.new_handle(obj) + + def new(cls, kind): + return cls._FFI.new(kind) + +class watcher(object): + + _callback = None + _args = None + _watcher = None + # self._handle has a reference to self, keeping it alive. + # We must keep self._handle alive for ffi.from_handle() to be + # able to work. We only fill this in when we are started, + # and when we are stopped we destroy it. + # NOTE: This is a GC cycle, so we keep it around for as short + # as possible. + _handle = None + + @tracemalloc + def __init__(self, _loop, ref=True, priority=None, args=_NOARGS): + self.loop = _loop + self.__init_priority = priority + self.__init_args = args + self.__init_ref = ref + self._watcher_full_init() + + + def _watcher_full_init(self): + priority = self.__init_priority + ref = self.__init_ref + args = self.__init_args + + self._watcher_create(ref) + + if priority is not None: + self._watcher_ffi_set_priority(priority) + + try: + self._watcher_ffi_init(args) + except: + # Let these be GC'd immediately. + # If we keep them around to when *we* are gc'd, + # they're probably invalid, meaning any native calls + # we do then to close() them are likely to fail + self._watcher = None + raise + self._watcher_ffi_set_init_ref(ref) + + @classmethod + def _watcher_ffi_close(cls, ffi_watcher): + pass + + def _watcher_create(self, ref): # pylint:disable=unused-argument + self._watcher = self._watcher_new() + + def _watcher_new(self): + return type(self).new(self._watcher_struct_pointer_type) # pylint:disable=no-member + + def _watcher_ffi_set_init_ref(self, ref): + pass + + def _watcher_ffi_set_priority(self, priority): + pass + + def _watcher_ffi_init(self, args): + raise NotImplementedError() + + def _watcher_ffi_start(self): + raise NotImplementedError() + + def _watcher_ffi_stop(self): + self._watcher_stop(self.loop._ptr, self._watcher) + + def _watcher_ffi_ref(self): + raise NotImplementedError() + + def _watcher_ffi_unref(self): + raise NotImplementedError() + + def _watcher_ffi_start_unref(self): + # While a watcher is active, we don't keep it + # referenced. This allows a timer, for example, to be started, + # and still allow the loop to end if there is nothing + # else to do. see test__order.TestSleep0 for one example. + self._watcher_ffi_unref() + + def _watcher_ffi_stop_ref(self): + self._watcher_ffi_ref() + + # A string identifying the type of libev object we watch, e.g., 'ev_io' + # This should be a class attribute. + _watcher_type = None + # A class attribute that is the callback on the libev object that init's the C struct, + # e.g., libev.ev_io_init. If None, will be set by _init_subclasses. + _watcher_init = None + # A class attribute that is the callback on the libev object that starts the C watcher, + # e.g., libev.ev_io_start. If None, will be set by _init_subclasses. + _watcher_start = None + # A class attribute that is the callback on the libev object that stops the C watcher, + # e.g., libev.ev_io_stop. If None, will be set by _init_subclasses. + _watcher_stop = None + # A cffi ctype object identifying the struct pointer we create. + # This is a class attribute set based on the _watcher_type + _watcher_struct_pointer_type = None + # The attribute of the libev object identifying the custom + # callback function for this type of watcher. This is a class + # attribute set based on the _watcher_type in _init_subclasses. + _watcher_callback = None + _watcher_is_active = None + + def close(self): + if self._watcher is None: + return + + self.stop() + _watcher = self._watcher + self._watcher = None + self._watcher_set_data(_watcher, self._FFI.NULL) # pylint: disable=no-member + self._watcher_ffi_close(_watcher) + self.loop = None + + def _watcher_set_data(self, the_watcher, data): + # This abstraction exists for the sole benefit of + # libuv.watcher.stat, which "subclasses" uv_handle_t. + # Can we do something to avoid this extra function call? + the_watcher.data = data + return data + + def __enter__(self): + return self + + def __exit__(self, t, v, tb): + self.close() + + if ALLOW_WATCHER_DEL: + def __del__(self): + if self._watcher: + tb = get_object_traceback(self) + tb_msg = '' + if tb is not None: + tb_msg = '\n'.join(tb.format()) + tb_msg = '\nTraceback:\n' + tb_msg + warnings.warn("Failed to close watcher %r%s" % (self, tb_msg), + ResourceWarning) + + # may fail if __init__ did; will be harmlessly printed + self.close() + + + def __repr__(self): + formats = self._format() + result = "<%s at 0x%x%s" % (self.__class__.__name__, id(self), formats) + if self.pending: + result += " pending" + if self.callback is not None: + fself = getattr(self.callback, '__self__', None) + if fself is self: + result += " callback=" % (self.callback.__name__) + else: + result += " callback=%r" % (self.callback, ) + if self.args is not None: + result += " args=%r" % (self.args, ) + if self.callback is None and self.args is None: + result += " stopped" + result += " watcher=%s" % (self._watcher) + result += " handle=%s" % (self._watcher_handle) + result += " ref=%s" % (self.ref) + return result + ">" + + @property + def _watcher_handle(self): + if self._watcher: + return self._watcher.data + + def _format(self): + return '' + + @property + def ref(self): + raise NotImplementedError() + + def _get_callback(self): + return self._callback + + def _set_callback(self, cb): + if not callable(cb) and cb is not None: + raise TypeError("Expected callable, not %r" % (cb, )) + if cb is None: + if '_callback' in self.__dict__: + del self._callback + else: + self._callback = cb + callback = property(_get_callback, _set_callback) + + def _get_args(self): + return self._args + + def _set_args(self, args): + if not isinstance(args, tuple) and args is not None: + raise TypeError("args must be a tuple or None") + if args is None: + if '_args' in self.__dict__: + del self._args + else: + self._args = args + + args = property(_get_args, _set_args) + + def start(self, callback, *args): + if callback is None: + raise TypeError('callback must be callable, not None') + self.callback = callback + self.args = args or _NOARGS + self.loop._keepaliveset.add(self) + self._handle = self._watcher_set_data(self._watcher, type(self).new_handle(self)) # pylint:disable=no-member + self._watcher_ffi_start() + self._watcher_ffi_start_unref() + + def stop(self): + if self._callback is None: + assert self.loop is None or self not in self.loop._keepaliveset + return + self._watcher_ffi_stop_ref() + self._watcher_ffi_stop() + self.loop._keepaliveset.discard(self) + self._handle = None + self._watcher_set_data(self._watcher, self._FFI.NULL) # pylint:disable=no-member + self.callback = None + self.args = None + + def _get_priority(self): + return None + + @not_while_active + def _set_priority(self, priority): + pass + + priority = property(_get_priority, _set_priority) + + + @property + def active(self): + if self._watcher is not None and self._watcher_is_active(self._watcher): + return True + return False + + @property + def pending(self): + return False + +watcher = AbstractWatcherType('watcher', (object,), dict(watcher.__dict__)) + +class IoMixin(object): + + EVENT_MASK = 0 + + def __init__(self, loop, fd, events, ref=True, priority=None, _args=None): + # Win32 only works with sockets, and only when we use libuv, because + # we don't use _open_osfhandle. See libuv/watchers.py:io for a description. + if fd < 0: + raise ValueError('fd must be non-negative: %r' % fd) + if events & ~self.EVENT_MASK: + raise ValueError('illegal event mask: %r' % events) + self._fd = fd + super(IoMixin, self).__init__(loop, ref=ref, priority=priority, + args=_args or (fd, events)) + + def start(self, callback, *args, **kwargs): + args = args or _NOARGS + if kwargs.get('pass_events'): + args = (GEVENT_CORE_EVENTS, ) + args + super(IoMixin, self).start(callback, *args) + + def _format(self): + return ' fd=%d' % self._fd + +class TimerMixin(object): + _watcher_type = 'timer' + + def __init__(self, loop, after=0.0, repeat=0.0, ref=True, priority=None): + if repeat < 0.0: + raise ValueError("repeat must be positive or zero: %r" % repeat) + self._after = after + self._repeat = repeat + super(TimerMixin, self).__init__(loop, ref=ref, priority=priority, args=(after, repeat)) + + def start(self, callback, *args, **kw): + update = kw.get("update", self.loop.starting_timer_may_update_loop_time) + if update: + # Quoth the libev doc: "This is a costly operation and is + # usually done automatically within ev_run(). This + # function is rarely useful, but when some event callback + # runs for a very long time without entering the event + # loop, updating libev's idea of the current time is a + # good idea." + + # 1.3 changed the default for this to False *unless* the loop is + # running a callback; see libuv for details. Note that + # starting Timeout objects still sets this to true. + + self.loop.update_now() + super(TimerMixin, self).start(callback, *args) + + def again(self, callback, *args, **kw): + raise NotImplementedError() + + +class SignalMixin(object): + _watcher_type = 'signal' + + def __init__(self, loop, signalnum, ref=True, priority=None): + if signalnum < 1 or signalnum >= signalmodule.NSIG: + raise ValueError('illegal signal number: %r' % signalnum) + # still possible to crash on one of libev's asserts: + # 1) "libev: ev_signal_start called with illegal signal number" + # EV_NSIG might be different from signal.NSIG on some platforms + # 2) "libev: a signal must not be attached to two different loops" + # we probably could check that in LIBEV_EMBED mode, but not in general + self._signalnum = signalnum + super(SignalMixin, self).__init__(loop, ref=ref, priority=priority, args=(signalnum, )) + + +class IdleMixin(object): + _watcher_type = 'idle' + + +class PrepareMixin(object): + _watcher_type = 'prepare' + + +class CheckMixin(object): + _watcher_type = 'check' + + +class ForkMixin(object): + _watcher_type = 'fork' + + +class AsyncMixin(object): + _watcher_type = 'async' + + def send(self): + raise NotImplementedError() + + @property + def pending(self): + raise NotImplementedError() + + +class ChildMixin(object): + + # hack for libuv which doesn't extend watcher + _CALL_SUPER_INIT = True + + def __init__(self, loop, pid, trace=0, ref=True): + if not loop.default: + raise TypeError('child watchers are only available on the default loop') + loop.install_sigchld() + self._pid = pid + if self._CALL_SUPER_INIT: + super(ChildMixin, self).__init__(loop, ref=ref, args=(pid, trace)) + + def _format(self): + return ' pid=%r rstatus=%r' % (self.pid, self.rstatus) + + @property + def pid(self): + return self._pid + + @property + def rpid(self): + # The received pid, the result of the waitpid() call. + return self._rpid + + _rpid = None + _rstatus = 0 + + @property + def rstatus(self): + return self._rstatus + +class StatMixin(object): + + @staticmethod + def _encode_path(path): + return fsencode(path) + + def __init__(self, _loop, path, interval=0.0, ref=True, priority=None): + # Store the encoded path in the same attribute that corecext does + self._paths = self._encode_path(path) + + # Keep the original path to avoid re-encoding, especially on Python 3 + self._path = path + + # Although CFFI would automatically convert a bytes object into a char* when + # calling ev_stat_init(..., char*, ...), on PyPy the char* pointer is not + # guaranteed to live past the function call. On CPython, only with a constant/interned + # bytes object is the pointer guaranteed to last path the function call. (And since + # Python 3 is pretty much guaranteed to produce a newly-encoded bytes object above, thats + # rarely the case). Therefore, we must keep a reference to the produced cdata object + # so that the struct ev_stat_watcher's `path` pointer doesn't become invalid/deallocated + self._cpath = self._FFI.new('char[]', self._paths) + + self._interval = interval + super(StatMixin, self).__init__(_loop, ref=ref, priority=priority, + args=(self._cpath, + interval)) + + @property + def path(self): + return self._path + + @property + def attr(self): + raise NotImplementedError + + @property + def prev(self): + raise NotImplementedError + + @property + def interval(self): + return self._interval diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_fileobjectcommon.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_fileobjectcommon.py new file mode 100644 index 00000000..99404f3e --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_fileobjectcommon.py @@ -0,0 +1,281 @@ +from __future__ import absolute_import, print_function, division + +try: + from errno import EBADF +except ImportError: + EBADF = 9 + +import os +from io import TextIOWrapper +import functools +import sys + + +from gevent.hub import _get_hub_noargs as get_hub +from gevent._compat import integer_types +from gevent._compat import reraise +from gevent.lock import Semaphore, DummySemaphore + +class cancel_wait_ex(IOError): + + def __init__(self): + super(cancel_wait_ex, self).__init__( + EBADF, 'File descriptor was closed in another greenlet') + + +class FileObjectClosed(IOError): + + def __init__(self): + super(FileObjectClosed, self).__init__( + EBADF, 'Bad file descriptor (FileObject was closed)') + +class FileObjectBase(object): + """ + Internal base class to ensure a level of consistency + between FileObjectPosix and FileObjectThread + """ + + # List of methods we delegate to the wrapping IO object, if they + # implement them and we do not. + _delegate_methods = ( + # General methods + 'flush', + 'fileno', + 'writable', + 'readable', + 'seek', + 'seekable', + 'tell', + + # Read + 'read', + 'readline', + 'readlines', + 'read1', + + # Write + 'write', + 'writelines', + 'truncate', + ) + + + # Whether we are translating universal newlines or not. + _translate = False + + _translate_encoding = None + _translate_errors = None + + def __init__(self, io, closefd): + """ + :param io: An io.IOBase-like object. + """ + self._io = io + # We don't actually use this property ourself, but we save it (and + # pass it along) for compatibility. + self._close = closefd + + if self._translate: + # This automatically handles delegation by assigning to + # self.io + self.translate_newlines(None, self._translate_encoding, self._translate_errors) + else: + self._do_delegate_methods() + + + io = property(lambda s: s._io, + # Historically we either hand-wrote all the delegation methods + # to use self.io, or we simply used __getattr__ to look them up at + # runtime. This meant people could change the io attribute on the fly + # and it would mostly work (subprocess.py used to do that). We don't recommend + # that, but we still support it. + lambda s, nv: setattr(s, '_io', nv) or s._do_delegate_methods()) + + def _do_delegate_methods(self): + for meth_name in self._delegate_methods: + meth = getattr(self._io, meth_name, None) + implemented_by_class = hasattr(type(self), meth_name) + if meth and not implemented_by_class: + setattr(self, meth_name, self._wrap_method(meth)) + elif hasattr(self, meth_name) and not implemented_by_class: + delattr(self, meth_name) + + def _wrap_method(self, method): + """ + Wrap a method we're copying into our dictionary from the underlying + io object to do something special or different, if necessary. + """ + return method + + def translate_newlines(self, mode, *text_args, **text_kwargs): + wrapper = TextIOWrapper(self._io, *text_args, **text_kwargs) + if mode: + wrapper.mode = mode + self.io = wrapper + self._translate = True + + @property + def closed(self): + """True if the file is closed""" + return self._io is None + + def close(self): + if self._io is None: + return + + io = self._io + self._io = None + self._do_close(io, self._close) + + def _do_close(self, fobj, closefd): + raise NotImplementedError() + + def __getattr__(self, name): + if self._io is None: + raise FileObjectClosed() + return getattr(self._io, name) + + def __repr__(self): + return '<%s _fobj=%r%s>' % (self.__class__.__name__, self.io, self._extra_repr()) + + def _extra_repr(self): + return '' + + def __enter__(self): + return self + + def __exit__(self, *args): + self.close() + +class FileObjectBlock(FileObjectBase): + + def __init__(self, fobj, *args, **kwargs): + closefd = kwargs.pop('close', True) + if kwargs: + raise TypeError('Unexpected arguments: %r' % kwargs.keys()) + if isinstance(fobj, integer_types): + if not closefd: + # we cannot do this, since fdopen object will close the descriptor + raise TypeError('FileObjectBlock does not support close=False on an fd.') + fobj = os.fdopen(fobj, *args) + super(FileObjectBlock, self).__init__(fobj, closefd) + + def _do_close(self, fobj, closefd): + fobj.close() + +class FileObjectThread(FileObjectBase): + """ + A file-like object wrapping another file-like object, performing all blocking + operations on that object in a background thread. + + .. caution:: + Attempting to change the threadpool or lock of an existing FileObjectThread + has undefined consequences. + + .. versionchanged:: 1.1b1 + The file object is closed using the threadpool. Note that whether or + not this action is synchronous or asynchronous is not documented. + + """ + + def __init__(self, fobj, mode=None, bufsize=-1, close=True, threadpool=None, lock=True): + """ + :param fobj: The underlying file-like object to wrap, or an integer fileno + that will be pass to :func:`os.fdopen` along with *mode* and *bufsize*. + :keyword bool lock: If True (the default) then all operations will + be performed one-by-one. Note that this does not guarantee that, if using + this file object from multiple threads/greenlets, operations will be performed + in any particular order, only that no two operations will be attempted at the + same time. You can also pass your own :class:`gevent.lock.Semaphore` to synchronize + file operations with an external resource. + :keyword bool close: If True (the default) then when this object is closed, + the underlying object is closed as well. + """ + closefd = close + self.threadpool = threadpool or get_hub().threadpool + self.lock = lock + if self.lock is True: + self.lock = Semaphore() + elif not self.lock: + self.lock = DummySemaphore() + if not hasattr(self.lock, '__enter__'): + raise TypeError('Expected a Semaphore or boolean, got %r' % type(self.lock)) + if isinstance(fobj, integer_types): + if not closefd: + # we cannot do this, since fdopen object will close the descriptor + raise TypeError('FileObjectThread does not support close=False on an fd.') + if mode is None: + assert bufsize == -1, "If you use the default mode, you can't choose a bufsize" + fobj = os.fdopen(fobj) + else: + fobj = os.fdopen(fobj, mode, bufsize) + + self.__io_holder = [fobj] # signal for _wrap_method + super(FileObjectThread, self).__init__(fobj, closefd) + + def _do_close(self, fobj, closefd): + self.__io_holder[0] = None # for _wrap_method + try: + with self.lock: + self.threadpool.apply(fobj.flush) + finally: + if closefd: + # Note that we're not taking the lock; older code + # did fobj.close() without going through the threadpool at all, + # so acquiring the lock could potentially introduce deadlocks + # that weren't present before. Avoiding the lock doesn't make + # the existing race condition any worse. + # We wrap the close in an exception handler and re-raise directly + # to avoid the (common, expected) IOError from being logged by the pool + def close(_fobj=fobj): + try: + _fobj.close() + except: # pylint:disable=bare-except + return sys.exc_info() + finally: + _fobj = None + del fobj + + exc_info = self.threadpool.apply(close) + del close + + if exc_info: + reraise(*exc_info) + + def _do_delegate_methods(self): + super(FileObjectThread, self)._do_delegate_methods() + if not hasattr(self, 'read1') and 'r' in getattr(self._io, 'mode', ''): + self.read1 = self.read + self.__io_holder[0] = self._io + + def _extra_repr(self): + return ' threadpool=%r' % (self.threadpool,) + + def __iter__(self): + return self + + def next(self): + line = self.readline() + if line: + return line + raise StopIteration + __next__ = next + + def _wrap_method(self, method): + # NOTE: We are careful to avoid introducing a refcycle + # within self. Our wrapper cannot refer to self. + io_holder = self.__io_holder + lock = self.lock + threadpool = self.threadpool + + @functools.wraps(method) + def thread_method(*args, **kwargs): + if io_holder[0] is None: + # This is different than FileObjectPosix, etc, + # because we want to save the expensive trip through + # the threadpool. + raise FileObjectClosed() + with lock: + return threadpool.apply(method, args, kwargs) + + return thread_method diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_fileobjectposix.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_fileobjectposix.py new file mode 100644 index 00000000..699743c8 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_fileobjectposix.py @@ -0,0 +1,357 @@ +from __future__ import absolute_import +import os +import sys +import io +from io import BufferedReader +from io import BufferedWriter +from io import BytesIO +from io import DEFAULT_BUFFER_SIZE +from io import RawIOBase +from io import UnsupportedOperation + +from gevent._compat import reraise +from gevent._fileobjectcommon import cancel_wait_ex +from gevent._fileobjectcommon import FileObjectBase +from gevent.hub import get_hub +from gevent.os import _read +from gevent.os import _write +from gevent.os import ignored_errors +from gevent.os import make_nonblocking + + +class GreenFileDescriptorIO(RawIOBase): + + # Note that RawIOBase has a __del__ method that calls + # self.close(). (In C implementations like CPython, this is + # the type's tp_dealloc slot; prior to Python 3, the object doesn't + # appear to have a __del__ method, even though it functionally does) + + _read_event = None + _write_event = None + _closed = False + _seekable = None + + def __init__(self, fileno, mode='r', closefd=True): + RawIOBase.__init__(self) # Python 2: pylint:disable=no-member,non-parent-init-called + + self._closefd = closefd + self._fileno = fileno + make_nonblocking(fileno) + readable = 'r' in mode + writable = 'w' in mode + + self.hub = get_hub() + io_watcher = self.hub.loop.io + try: + if readable: + self._read_event = io_watcher(fileno, 1) + + if writable: + self._write_event = io_watcher(fileno, 2) + except: + # If anything goes wrong, it's important to go ahead and + # close these watchers *now*, especially under libuv, so + # that they don't get eventually reclaimed by the garbage + # collector at some random time, thanks to the C level + # slot (even though we don't seem to have any actual references + # at the Python level). Previously, if we didn't close now, + # that random close in the future would cause issues if we had duplicated + # the fileno (if a wrapping with statement had closed an open fileobject, + # for example) + + # test__fileobject can show a failure if this doesn't happen + # TRAVIS=true GEVENT_LOOP=libuv python -m gevent.tests.test__fileobject \ + # TestFileObjectPosix.test_seek TestFileObjectThread.test_bufsize_0 + self.close() + raise + + def readable(self): + return self._read_event is not None + + def writable(self): + return self._write_event is not None + + def seekable(self): + if self._seekable is None: + try: + os.lseek(self._fileno, 0, os.SEEK_CUR) + except OSError: + self._seekable = False + else: + self._seekable = True + return self._seekable + + def fileno(self): + return self._fileno + + @property + def closed(self): + return self._closed + + def __destroy_events(self): + read_event = self._read_event + write_event = self._write_event + hub = self.hub + self.hub = self._read_event = self._write_event = None + + if read_event is not None: + hub.cancel_wait(read_event, cancel_wait_ex, True) + if write_event is not None: + hub.cancel_wait(write_event, cancel_wait_ex, True) + + def close(self): + if self._closed: + return + self.flush() + # TODO: Can we use 'read_event is not None and write_event is + # not None' to mean _closed? + self._closed = True + self.__destroy_events() + fileno = self._fileno + if self._closefd: + self._fileno = None + os.close(fileno) + + # RawIOBase provides a 'read' method that will call readall() if + # the `size` was missing or -1 and otherwise call readinto(). We + # want to take advantage of this to avoid single byte reads when + # possible. This is highlighted by a bug in BufferedIOReader that + # calls read() in a loop when its readall() method is invoked; + # this was fixed in Python 3.3, but we still need our workaround for 2.7. See + # https://github.com/gevent/gevent/issues/675) + def __read(self, n): + if self._read_event is None: + raise UnsupportedOperation('read') + while True: + try: + return _read(self._fileno, n) + except (IOError, OSError) as ex: + if ex.args[0] not in ignored_errors: + raise + self.hub.wait(self._read_event) + + def readall(self): + ret = BytesIO() + while True: + data = self.__read(DEFAULT_BUFFER_SIZE) + if not data: + break + ret.write(data) + return ret.getvalue() + + def readinto(self, b): + data = self.__read(len(b)) + n = len(data) + try: + b[:n] = data + except TypeError as err: + import array + if not isinstance(b, array.array): + raise err + b[:n] = array.array(b'b', data) + return n + + def write(self, b): + if self._write_event is None: + raise UnsupportedOperation('write') + while True: + try: + return _write(self._fileno, b) + except (IOError, OSError) as ex: + if ex.args[0] not in ignored_errors: + raise + self.hub.wait(self._write_event) + + def seek(self, offset, whence=0): + try: + return os.lseek(self._fileno, offset, whence) + except IOError: # pylint:disable=try-except-raise + raise + except OSError as ex: # pylint:disable=duplicate-except + # Python 2.x + # make sure on Python 2.x we raise an IOError + # as documented for RawIOBase. + # See https://github.com/gevent/gevent/issues/1323 + reraise(IOError, IOError(*ex.args), sys.exc_info()[2]) + + +class FlushingBufferedWriter(BufferedWriter): + + def write(self, b): + ret = BufferedWriter.write(self, b) + self.flush() + return ret + + +class FileObjectPosix(FileObjectBase): + """ + A file-like object that operates on non-blocking files but + provides a synchronous, cooperative interface. + + .. caution:: + This object is only effective wrapping files that can be used meaningfully + with :func:`select.select` such as sockets and pipes. + + In general, on most platforms, operations on regular files + (e.g., ``open('a_file.txt')``) are considered non-blocking + already, even though they can take some time to complete as + data is copied to the kernel and flushed to disk: this time + is relatively bounded compared to sockets or pipes, though. + A :func:`~os.read` or :func:`~os.write` call on such a file + will still effectively block for some small period of time. + Therefore, wrapping this class around a regular file is + unlikely to make IO gevent-friendly: reading or writing large + amounts of data could still block the event loop. + + If you'll be working with regular files and doing IO in large + chunks, you may consider using + :class:`~gevent.fileobject.FileObjectThread` or + :func:`~gevent.os.tp_read` and :func:`~gevent.os.tp_write` to bypass this + concern. + + .. note:: + Random read/write (e.g., ``mode='rwb'``) is not supported. + For that, use :class:`io.BufferedRWPair` around two instance of this + class. + + .. tip:: + Although this object provides a :meth:`fileno` method and so + can itself be passed to :func:`fcntl.fcntl`, setting the + :data:`os.O_NONBLOCK` flag will have no effect (reads will + still block the greenlet, although other greenlets can run). + However, removing that flag *will cause this object to no + longer be cooperative* (other greenlets will no longer run). + + You can use the internal ``fileio`` attribute of this object + (a :class:`io.RawIOBase`) to perform non-blocking byte reads. + Note, however, that once you begin directly using this + attribute, the results from using methods of *this* object + are undefined, especially in text mode. (See :issue:`222`.) + + .. versionchanged:: 1.1 + Now uses the :mod:`io` package internally. Under Python 2, previously + used the undocumented class :class:`socket._fileobject`. This provides + better file-like semantics (and portability to Python 3). + .. versionchanged:: 1.2a1 + Document the ``fileio`` attribute for non-blocking reads. + """ + + #: platform specific default for the *bufsize* parameter + default_bufsize = io.DEFAULT_BUFFER_SIZE + + def __init__(self, fobj, mode='rb', bufsize=-1, close=True): + """ + :param fobj: Either an integer fileno, or an object supporting the + usual :meth:`socket.fileno` method. The file *will* be + put in non-blocking mode using :func:`gevent.os.make_nonblocking`. + :keyword str mode: The manner of access to the file, one of "rb", "rU" or "wb" + (where the "b" or "U" can be omitted). + If "U" is part of the mode, universal newlines will be used. On Python 2, + if 't' is not in the mode, this will result in returning byte (native) strings; + putting 't' in the mode will return text strings. This may cause + :exc:`UnicodeDecodeError` to be raised. + :keyword int bufsize: If given, the size of the buffer to use. The default + value means to use a platform-specific default + Other values are interpreted as for the :mod:`io` package. + Buffering is ignored in text mode. + + .. versionchanged:: 1.3a1 + + On Python 2, enabling universal newlines no longer forces unicode + IO. + + .. versionchanged:: 1.2a1 + + A bufsize of 0 in write mode is no longer forced to be 1. + Instead, the underlying buffer is flushed after every write + operation to simulate a bufsize of 0. In gevent 1.0, a + bufsize of 0 was flushed when a newline was written, while + in gevent 1.1 it was flushed when more than one byte was + written. Note that this may have performance impacts. + """ + + if isinstance(fobj, int): + fileno = fobj + fobj = None + else: + fileno = fobj.fileno() + if not isinstance(fileno, int): + raise TypeError('fileno must be int: %r' % fileno) + + orig_mode = mode + mode = (mode or 'rb').replace('b', '') + if 'U' in mode: + self._translate = True + if bytes is str and 't' not in mode: + # We're going to be producing unicode objects, but + # universal newlines doesn't do that in the stdlib, + # so fix that to return str objects. The fix is two parts: + # first, set an encoding on the stream that can round-trip + # all bytes, and second, decode all bytes once they've been read. + self._translate_encoding = 'latin-1' + import functools + + def wrap_method(m): + if m.__name__.startswith("read"): + @functools.wraps(m) + def wrapped(*args, **kwargs): + result = m(*args, **kwargs) + assert isinstance(result, unicode) # pylint:disable=undefined-variable + return result.encode('latin-1') + return wrapped + return m + self._wrap_method = wrap_method + mode = mode.replace('U', '') + else: + self._translate = False + + mode = mode.replace('t', '') + + if len(mode) != 1 and mode not in 'rw': # pragma: no cover + # Python 3 builtin `open` raises a ValueError for invalid modes; + # Python 2 ignores it. In the past, we raised an AssertionError, if __debug__ was + # enabled (which it usually was). Match Python 3 because it makes more sense + # and because __debug__ may not be enabled. + # NOTE: This is preventing a mode like 'rwb' for binary random access; + # that code was never tested and was explicitly marked as "not used" + raise ValueError('mode can only be [rb, rU, wb], not %r' % (orig_mode,)) + + + self._orig_bufsize = bufsize + if bufsize < 0 or bufsize == 1: + bufsize = self.default_bufsize + elif bufsize == 0: + bufsize = 1 + + if mode == 'r': + IOFamily = BufferedReader + else: + assert mode == 'w' + IOFamily = BufferedWriter + if self._orig_bufsize == 0: + # We could also simply pass self.fileio as *io*, but this way + # we at least consistently expose a BufferedWriter in our *io* + # attribute. + IOFamily = FlushingBufferedWriter + + + self._fobj = fobj + # This attribute is documented as available for non-blocking reads. + self.fileio = GreenFileDescriptorIO(fileno, mode, closefd=close) + + buffered_fobj = IOFamily(self.fileio, bufsize) + + super(FileObjectPosix, self).__init__(buffered_fobj, close) + + def _do_close(self, fobj, closefd): + try: + fobj.close() + # self.fileio already knows whether or not to close the + # file descriptor + self.fileio.close() + finally: + self._fobj = None + self.fileio = None + + def __iter__(self): + return self._io diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_greenlet.cp37-win_amd64.pyd b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_greenlet.cp37-win_amd64.pyd new file mode 100644 index 0000000000000000000000000000000000000000..b829ae8c3dbc614ad906167313363e9bc4464fcb GIT binary patch literal 225280 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%0AH%xmiT~g`&fkUA?=m zH68xIQ|6ISNsXy*G*qvGszS6$v!!}1&OMM)IRy^1Q?7;zpHv>3;WMT}(f4>q^P*8U z%QfpXyenmlT#wM7gg((+&6g^<9-u#cgx|wh9qd03ol0@dJUd#$I&Kznz~qW+?9o2P zWGrIx8BF=wLM9RV4k;ke`j1yi^3$E6FDaD#Z;t4%l*2qC@0{evL-e{rqDX!ig*wU4 zM42TePpKUtmn6Sl?UL(NN-iD?B+p!KVv3hg@{W$lk;deD5tGkTv41UQGX54%1B;Q} zqC_tsg_*ty3737F4A@kVn|I`xkfa|QgG8al{97KzkH3fxbMc)Wk;OqxK;&vJ&xGxa zw+BQX5D`1|!;kk85!Wos99mE5z!@5t2Z8w~-e)`y%qN8TsLl)VW9{J4sWxXC42(*^ zQlX4$cd9W|?JoF{)v8vE6sYzT-}JFmJh>M15|@sldKruu+QJx$kEXOhl>V+p&Q_U` zD3^oT+eFy~%vr+B>ZB4swi7}+Q6}WK4*`dwoOMO3D5v8u{(DjGxXeU3S2g8C`3?3Q zLw`eqFN&dqjG_4Tlop6`lGDI%1-0@#n7f)Nr-S*bFuOTXP6p12(lftS1RRPoE!`^0 z-Qs3-1`lpwt-P5sQ8KNf^obby01dt-hA!86A%6U2N()4}-DzN<)ECvtPuwwp!@%wa z^BrOCXPB|6&~&0akuQpXLs8zpyj7I9)j|H(qO9daxvo`|<06LEgQ54u(DORbgFFkR z1)}`hp*>e1iuw_SfiHCi2kX_4)m6^f=C1-rCSa3jNV=vylALi_t5m0o^lGF^@6}G7 zV`mx<-_gC;1nRGfb&Y=oigEl*r?Iyi3O|P!Kk*wWC@`~AogQ8-sGHf`5qe{0XM(w= zFe{xTr$OFHva3}=Ac=s(x_KbgD#d-)tX9+8p@qW6|8|p!vSzC&eItfGqAp@$=t>Tn zpl<#kB^lPu^OVebey51XgdNq*cc^o1lV~agHV}cmbs7lkVIl1#vbmJw@{+aPNHc-c9nBf#83qcZ77DGW8nb}=LHlSRL(+&R#Q+pTZ6f=iSh;Hs+GgQ+|EQ<6U^;|Im0kxogz{GWabpunSeu423Z2zMOAy4qgYL? zv=QZuMib=`8L6uk`A)~scxqt>F|@TYM*-){dv2gy$$K`=VD<8LY#kH*eWJ;G zgz#Mbc8>UYoH`sSevUDIyv^b7sZOqbV@QR(M^Ht`dr828R2wsely!v4`gv`WeF$()_SaQJ=vDE@;$CXWQrE16D74hgR7i zzR+YpQw%%V*NXUgii$i+{G0$k2-*!v!hYf=3eCmOa+>?SpfVLpW=x=Q5I9K$wsHd1 z1Lp)fDPJG~n?MNj@I|e{{5{a(e>cwi@B)+QQkCE&8W=J31=f117`i@Y673Izp+p%< z&c*L=`nXfJ5LMA~w7T3Rx)%axi@*U8z&r)#B$_ixj0Zkez+n|BDtXslx+;3hME{T6 zj~lYD?F727RiH5uKO4Z$c=0ovRcIJtdxQu&zPB7&r7R+nWIOKMwygIs-iw5JnPJ8j z^TtW?pxILxmB2$-H}O0v*7*;lFh&Xnii6I#x;eI0lv}A|$Ix&XY7#@gtYxC?Olg5A ze{!NU2`v)k7%<(|vvt6{LYV(D%vdZE<+uDw5pXEVUK3SYu0n>IBVBccv=wFC1QTVv zke!(=f<4F3L>kJ~VrV-UqT%#IqoJ9NrsQ0F7pI8t3naRlJGaYj4+z{W0!!Uq{3>L1 zm2(ENMrJ19P@-`cwn|iwBhmB!uHoE!o=J3qcybbzMGVO%ZWTj^!4Tc|nvzK7iF605 z$>RTDAQwN%spVI35LML-l;rjm9uMBVqO-me>}X1Gf>m3?53EkWpb2V1i zCV=eYL}}OBjxM8;9YX^s_IWY%IpZ^|?mF5|Xmv}ZUA_+w1G#vMBXSB1w+gl=blk?+ zZ@_z5bZ&zVb@UZ)oM7$q>qx+%U_B?edXd%r>1by1?%ht8vp}**Uky{uIxUlu@j-=wgUedI&X^3i=9lc^&-L6G5!PN6L2Wl zi1S(nO9r9ID*Z$o!7ez*1bdRE90;};1v!Q;hWWR}P(NcRekP>_#y8CAL%y+9l-s~O zkP%VP<_cxd#_HR{0$B3av z5d3#BG#Z9b#1RrDP{cKq%y)a78oL!p^a3^F_P(D10dE)tHggi43TY=%mDONir2-Bm zx_?}&ME9EWS&c;Er@-kit~ZI+X|>WFBZiis$Z|1sg^Kj!uTWZ0Id?ck+$=P=h>rC7 za&+qU_umWVI>J1_VcrRx6XhYQO_MM-XCvTHln>8o73E#pYrd5xyH{JedNu&|_1i~O zdh}h?8l%UYC~wL!I6FHbVkizn>x-cm&;TxSl0>0&Rn(6%3qSr6O3uaSq(; zsy#Yi)nsRC79snHGe4fHcYIXC$8)?9PXoBVI^a*EP7jsoxklV)1kWpT@mC!K|B!(? zlV-oz``AW*l{|^kp#L^JIaM5F)B{77DVZwBqm)B--9Xn;$J%D`t?Iy-9apeWY{cok zI_Ba-&M-}!jXO|v_h#M-E(X8_=YODEE6n%ycHZP)kk6YSWhFu|Ra&$df!l)hd+J*` zdT6;gM zR_i}FJEH*@rtC${pOy6ILUIV(wr>~3?P}OCpN<_3(b{7~FadDF@Ay0m1X77E$yA~| zktu^X3t+WQXHo9zKB{@NwSH0e9ikaK~asSRrwgPpNvy-R}LSDMT#Cb~@clV(cO zTIgg~MNrlIQ$l6Je_J0VToW>thc+jUG-JEzB;1JbQZuZs^1jY<1~UA28bEqbr3w(qA#?{(Go{f*IkT@}4=zNMwGeop?n@cv!a z0z}fh@=9}6*TVZ=c&+^R8*f%{AL`fZYes~cXV&u($g5_GDO7$?%l>8pJWkSR=4)N> zz)SVEo{d8j)lAedT3WU{zGAb%+_;zekYwJ=b@C{ZL!XyhL=C+?h8psH6F=2xKfX6x z52=i%x%IK4lkdD~4q>WTOEub$?_IkJgmWB%RZyzYethrfRUiy?2v*~%M*HDhgjFEK z9l{L9lKuEz*(wk|J;8*Y=@9J4_ZH~kN`!vYA!u+>#Z|cRT?!{F7 z6ug+{UYP9^ym-XDc&H7=P40!+LIK7^_hP1gc(Dc{lnQS+8IG)8^B*3_L#w;|hc!I3 z`pJJtAMGzGrpftFzUet1vVGVKb8N=|xl)epkbBp8Chuusd^&ckeg>NA3fp({GrXzT zOzm5eHPE74+jsMAyv)=1ev6N zW_i1Ywb>tvb*N&x*qDjKVkdO(lZ$WQn%j+la!L=ft)ECeqq`zk;ZN1G;JsZJ9-`@o z^(lP2E_xqUtKQpn(R=A2q;JCQM29V^yAdty(Op7|6|~T z?C=hHkfB)EZ|qh`3{3Q?-#E{LmRZOCg4tK1Ps6%xUqRPk61mZ~%OUK|6@O4v14ZSo z8UQoF;4}(C)+1W4nSmA2XIylZe$p3B<)>n^iTnjTw(rq!n@TKCq^prAwx@1$oE8=v z;9e}`vUl`wOZRXw54%PW*LDw=@UTPl@Ry^EZkC73bZIm{bq~Mc;oI(EZDW>m6zkQo z`m>O+FixU@R?18AQxqAvPF?c*wOvUf&^&U-QVa^;35}errjqjhJyxqkuVH*pi?n>V z@ML!QRImwphVH44jUVU0ksCI&EhNQ-Qv?NfapiX@T|VcQn;gY~OAvE}?cHk`4L^i& zer*>!fR_GWPfB$FaQ~b^53dBYlG_JY2HK{t2=>3X_787c-$0@C4|0Y&=1X38{e%zs z)wsvJz^O={w{!8-F_LI_7ZHgkGK0F9Jry<-SA^bHmUwGN+5~33k`P<(ij+JnEpPj%yjZF7rX3N&xG!k*)N9i%u*}_6Vh4QC)9L0qawP{}{^;`BYic6RD*%{Zi)8V=$)f0y> z)nb5ldiITRG?+o9+#e2*d80A{;u&*cyU@9r_0tx5>{csZ}ow8oG01PJ5M0x z@RJ|k<#-Yqud1G_{g-q)TB5dbTqR$IJ+}LZitC=&Nt>gZ7A0kf6}Qi9np591_i`e= z+j?-6IA&HV{_AmE_`7CMFrTMPriPJC>8#+crEA|swf>x%+*OuNu`@_2CjY=2J35(h zE_n2xpr^f#Tj;L$adcNnf46^%xTyL42aVQ~zZ?L!oR4O9w%8(A#oei~6B4Ph9Es=M zT`LTC6n-MtnU4*Ou502n{MwwpOHj#|?`cbC@mbrB-T7oeHP`I(IE(Mvp2v4>JGXuU zSKlc(c~t7Gal9RyNIg1HT&5nq)csgIk$Ut-?sD<*W|TCd@9i9=gIiB=ZmFx8Q3DKl z%VXM?wXa4O8<9s{d~iGZVeWV_jTb-e0c{HRy_eLSQr@2toBY&bNuQ2g{SrO(SL>*S zZ{JQQxK`>Q(NRgCiV2S6qt4V64x%Y6$nDoBK?P#uM;_7Ib-VUZGn#Ed^n|tk+}sE{ zFc&h6aHZZcMj^wI6gtRQi^1AlSgV<#dl;GXB8(gZBPH5U;2)y%7i$i*^I}I-95l1m zClvZM>HqS5#f5{rSJ!FSp@=Q%pV_6>e@WHTJwY&3zaGb25)y4`(cGTYl{Vq{hjcZY zY$1Q3Q*X5E{>f3O$^RxmE*Dz;HZ8T}+#f#-mHG3N{+?ZP@v&@l6cLb|smzreIUG^E zH`WxvB?7pFI=FoWz#-UIXf%mI^_uP4o+bg3X(i;-@vk?)7HJQakjU-Agle37rx+_W^%ro+co%41D_lRezLmf^;jL6BIjT2^s*!|rE7k80 z64jniy+`Kfdwa=Ir@UKm0~zmNnpq8{JNr$fV-p~pJ)uH%-~6iyMFm;iSS9UW&bX|q z+lm7@?sNe&Exj>uKZDz-t$K|d>{`#)dmItcGMsUF!-lZ?9Pbf)=zIKFe*rfwoGiL$ zS5z}XLa%Un^I@xhHrZ&i{gWv7PZoP{9vKU3Ino zu+bVt_y=@P@~_)ra$%z>^sl>i6UP6q{&hpDJCR$pe?965CPq}<@~`6# zX!WlNUJQ_dn}0ptI!W(Iq{qLGll1A>zB8%e%PoTXKliV7{=%gHPM!aJtxu;nFVEn< zG%w>-QFg}rg}=_=?nB{!g2Bkkp7}4>`D3jjFDoBdIr6}RY7VFw8TeML+8cQ%y6HPx zZDUm5r8rx4+#~8_sP82G=E44tc~18gTu;(J8mBwEuIbbIzUFkd$alRD8^oDC8woxH=#1rq+at0o@*Fj3p;S1!6Kc_~-W3@Yh ztYUJ4f}AJ53%iTp{u#i@6IV=rMQzL6^@>q>KsNn3KA8Kl#_WhqfQA6obM{pK|vq!999YH%&lRAQPyV9HY5cNc&YPX+9;GpL# z9`RqKGpNK=^1Fi0Gr%ir?F=50DW&5B-!!Rn@p3qdI)mX7#EQrU=Ff5_-Mq9b(%ij`V}py3X6ilH6?s%xI*pcXXG z*PoI6<*q*|mr!$f&0$9#ad=+G5JcgM#~OE= zPvb9ZsAR@39ed|#oqh5i;vhlO{*vGUUQ1OaMl3F#^9~0tH-dbIi{wtD|CRhWJ>*9e zKAJB155~76f6WZtQ`X*;mA$ERk&nqAAUOVd=kd3T@wcnv@3Z|>!dffmFX_LBx2jE_ zJS{Qlt7@|oZ`!SJCucRJYr=1uC|3NJZA|`MZR*hSy3{dC>im!DQYSC2^RsoSvlg1m z=sUA6b>18f+y`%>PKK9}5zz57T7O0)`7=N(e8_|?rHM!xoGs`bJkpf$GEDLvc~tUm z3_j!SgfBUyiYA$}_2!Itw6+5B1z7=qw;lK9NccsGs{U&ra>aGCm?f_2|2_{fWdh); zpB2~4S?gtGEjf<=E^MB@=l43yabeS<@#5eu^Hg5KIOqfiZx{!U;Tn$@2j{~<1JkUX zo4ea;{#Ubq8K`uij=nJwZg2!T8-W-3`<4+n3j$3du&aqsU5+W^az`Oq(x0fo2|;$f zSCd=V(uwntU@7<#4l5`wjHvX6$|a(*rk1N09VJ!kGv(4SG2ySsKK$DXoq!{OIyrvM z!EI)|{!m(M{CsjCv8gCchf>AlJJwLm#tvqCOZKr{5Gaslj@od_8)(=+%k>)eJz(D^ z?9;>t=MHku(Unw-ny9{|Q$nZ-tm4R1)Txg22Y9iJHwDt~80ozrb-zfj2kGpXpEO$$ zDmOOJaANlx&X@>i18}AbryVQJk-0tU8`5{_ko0lw5(9^oH}pvQ=XBMeWiv(KaLCY7 zoN!Q8&&?Y;llaj`IfnRO*;jz7ym$7&WSTBBYnMprkwge)atjivA=zYV2%qD?g1J~S zBt4{K4KC&RB^?sI7A8{-bCRj^7iM!D%hFnd4I}x&3=C$xM`2xpHYZs6EtV?kdT!OQ zX01Q8yw*P0Goq=v5pDv_W{8^1l(z{LMK?CQf zz-cl)a=GI)HH7i}5Nyk_S)Rvc(%Ae4HVHXu%72Lhm+!i*7?bG$AS?!5}>N~Rt z3QKICTj*q{Xxf*gcgFks0qx6PGC5jsvL?qwET<-2$HJy(_fq|8*rtXMOPkw?t-z6G zyk`S&zS{zc`KqgtAW8w9lc}+M-sz`E!*cX!l(fYQU2D=q+STT$%p5MmZrhtkJPRLm zz#S>mk~-i8eAMgN>p9+~RrBgcoMC;7-~B)ZzgkX6&~wZDQ+bm;x6VH{EvYI=P$hB` zBk(k_X(Na`{rHCXQ0c6Mb>CKt?|C=RzSHt9DNk__@}q@!&Av~9jjzPU8rI~z1En&SWTX~AuSk#u$um+(U#$Xq z1mg*s4kz6V1Ex1HEyKz6ZA#p2W8rxH-Zsty6xR+|C1BeNtUF&jsa3vqLH5Sb2AGd! zQx--4iskkJD&q|Zm_Qrfs((p&N5fn$ejQ30()UxUNZ~e4?O48h!=F)Von30}g9)|% zf##n`RPiky61j!vveoHftvw8UmYPkegX*omf;fxvgPyvTEbbb#kJ%3LXlmJ z)u)Q|WDM$0rYe)E(dGQ_l3l!=jRQ7H`lpdiy8yd9drUHQJRcQ0el-8bv{WP+<_}QH zt=dvqf${YG6{PSqPx%ys7{}{|>9(Gmhzo)ciQJnG?_L5yzg~8%r=4A)>RUfxxC5rvD z;b8i03Y|!y6uFanQNDM98_jsfVZ$F`S4reERpA}b-2vUlWslfCm#b@9S~2-@T2yW0 zsb!?;Ch5{2LQT$ZK9lR>L*#24x9#4pVXa!I0P_lUSc0%8!v3puex}xcL#^X(;str7 zl=luyaWx?2U5c%$M;ZmIzvJvhR_9gu9rZzRP zI1F4W)R0r&M9O9zDSSyy8Skq)miM8^W}jQMxfm>5oa%4Ku>N``{Ii1kOZXoY`Cm6L zlI?@cuJ$h8A@I66dEG)EiqBOD)+jHO@_xYhIR6Na9518cWt4cy(NNn;U(qzmc(h(9 zIPXu_3L7VZT0#dK4T>yP<*wz*onYneLb;!q4zfwUyQXpSL9(_#V#iv!*QjxyrtN70n0 zD*m*KoK!{A_tpzBvq2p7sjjQMLn*qVX{zxuyfBWcXiD+exFVK%2(D%rKky}%2%TVQ z8Z7bZ)R}S^dEwLWw&7F2FW&mh;qA*7!fy+Sl9e(GW9Y{*yEE4{xXBK=_|Y}$TE3BO z@5XoQp!61$GT!kt1=T4PvYEPxly{Zl6n))tlBAPEJ};n03u`%DMO&8>gj==#o080* zSDTvf62aEs?uxeRQiI)1``X+P&0^K1PI;+oc2@>EP9FLeQ=a!X`aDYAh*J5E6n~wC zUAz~YhTyQIq$T@`g03bEg-doIgMIHT3CVYR?q@`N$?_FBy6IiQZYshpI@z^N=j89! zkuk3I{dE&H-&nkck@%ap2;3%3zL2yl2qVF3_w=z5@YuyvXC#*rPNnj=5U9$xkz7P z_-FPp%!GeZ52Hhxi4Gj9N#&eWjKxd$Shnj0In-R$qNHmNlE5^SvbA7*IrtM*hj z@fDYv9IlE}Hy&8yf;ZXWhham7E4hj?yC9>PXKAgWtSjR?d<2z<2zzLOcqi2Bk! z0^kIbU;vK@fsb{--3I3Y&uj%Y%A-PHwO-PK58c-`u{n8ToVPw@MUmMjX;kj4+I@$y zaaz&%KTTwGuNez6rlvWx*8GXR*b_&`GNj3`>CUcRh^`*DD`w;--)FD~b%BSAt7$Hc zzj8h_`Ied)bi`^sJ0g3cA~}aNWQ!7_1Y12U$wx$euB573SW{6qlYHrWdTsb_Hix|5 z+dQhPr~}!1^IkjGcsFGvuNcZk9z?+Eu2fgVcM0UBy?^po+gfU7*yfgW>~A1tU-^Ni zJF|s81B<~}%uXyV$r0tu)RFWfs?8p^R2`J!HyS~YcU{8nAro}=*i|L$Y<@FXPx6Zj zCf4n`D{Q$j>h5sayeGHm*vF(<1Kv_z9qyHxhP93JXECE0yUw%Z*3b#Iz_lLnu#6<=d z3Ky5c4EZm(cmXafUSoZTEl|Lr;|os!00}CQAbZ~TQfNMpd^nlv+}H}%GP!lE-~`;b zRU<4bZOtH7?>~~MiUUa_4!}XIy$91X^zT)@-`hpK&$l)Hdm0stshIqSHH7)Lu0W5* z=Hg{mgz^o`Rd;xR3Cz6;JUQ_Et`$uifufjyT!NWix|uNw`@x$=eaOQsF}>-z;${?g z7?*9FvJupzeXfI|Zr|Hb#VP{fTcs}e-o}DAMsy6Vin;(xB5PGk_L|;AZ-lvgAaY*z zxIWky?VR#*EDkFg*(iwR&CL2bEeFnap%~U`#2%HU<`?;fSz*-o0dm zJp;e4enB>SL?_Cq@@|D=+D484O2u`2*wZ`J8xt(R{xXK*s+^Sc%rTP$QRW@Eom&T}P{`yxOXT+QYFg5jc0` z=UYBY_&t;Uc+ylSQXSK~&jd-WHDTROv|>h)7^`eLt55H!P_I?|t~Djae`+U*KPT{@ zMB!8DTdq(A1OeftaBBl%KBdt=;g5%>Ts^~sgISqMo9s|99!UC=-OP(}7xS{e_oP*l z&brPXX6J7k4XoPc8%Wi%;G^j+{H+H3bfqg~u01l|ns77)jxd_FXj3&a^x1Pf>F)GR zSkURXQn`_81($y=;ZQdaTsn5b?Pwo3ONaEyRx(lKmXeT_YOYv;}d2Y})1b`1!QTd~`ghu%b zvb*;RN4(c<5sVm@)~^%UZ{&S6__$bu#3JuY(UQkfoti(Pq?SKHI2WI77QR@~+vHw` zS(sdM*-qg4Nq@^te;=z0D*BYCO2kp-=XGrb9_f}>vlp5*Q3%SP407A?LQ$b@*k{>x zTZbWMJD~LA>N=cV8xK>5%LAuUL(GJ1U2RiTdSs_}lU|=S@6>Wq8~q_I6btgwR9=Z1 zfLNk!!78J&?PF^=mv^^#ioDT?L>2Dy^5=hrm3$*$naLYF(zLY(kG^4yqSCQyd35N( ziW+}93{*LML-Hu&J=E|YW5{(F8 zLIki40G|rrjsk!~BY-sk_(%W~3jlVB0J2r&o&jh%I^%VZo-X3)D|$MVbHt;k&+>Gx zp0bU0IX=-bc`r{hdiv*#_c2eW!@70RXds?;E+P$a=Nh19skedj8iVEcf=i5mY07g6wY zclX605NFi*U*+N#?LbuoGn>oQm8HBR@roI*8(iFC_BU@J$9oRIdJfn0OjWlJw|736 z0I`P!C`Zr?2vDB9ksqyWTbr>wwR5{8*Tu-a%3po#GviHw+$JKow#X@LeI+q)I04Fh z0+fo)s>_Z)p3Rt(;Zb!w2#>w%oJ5WjFkC)YVf2WE|8pYstO+8&*~X;=2_E{9J$EYE zk8}uRknj7@1ua=Lksq|o0EA2sK})i#f6I1xL5pT3U+Yw#6*9 zD2JHkeh4Jp=y`M$vmoC}C-J|5XLBZL5o`&+$!}c14>FA zgNcGz<(r-PezxkuP3(H_0q|eNDheAd|2r=`V)HOo(ZlTK-PMxm+Do% znU7gbX1t?d=Wy7;c#fuLtC?{-7DJ$N{cf}fzPpDTTVx0+xQd^1c4O;pTq`SkinNG%+Fts-DqkbQMa zG3^4DH!WaMA+6ITZ3e1s*k5_TLeEjkjj&Rh@TBb<1uO{#ER~vC8l_%rbauu1sCP^o zrCF5nReqF0VI{kp(mj)imyBMNhzr^dmOBc4TI^hn(`d7NX5DR6L2i`xiXuh!+uXKz zMGhB6uzt6m6py>G!KQZ`*v~@`&Gd2h%1zsqH7>_AMjQT=?lZ0N%Pm*ozc1g12uVQ@ zz|VGHsCRAjKaA*J!-3@X`HiMx@>@`3olo-{Mj1y({6o9CgBC&j)0h5SPU;CO&)!}b zz3t80d-V3k*0)DRZ!36vCvRKMS5yJnq0y@!c5GjEyIv9V^ogE+z|*vz67y^nJ)OhT z%k-3(r(^W=5uRSEr^GzV@VHZ9*J7TVcrk$&1gBBVbG2GX%4-jtnGExVN&iJ$QZ}=$ z(;G1l^R(i#x@7|6NFeVr1?&a64^&Pv<6X?tJMC#do-WeUoig6o=;@|BU8twXx-Qp! zbxqXNiR&G>&Uk}?y%h@hkw47c{{UMj<5-MaF|4R*rqy5Gp%f+K8=FmC0BA6qI$M`f zoYbt`E8mORTBbJ#>l1Ba4W@q1!B{&epsRisJN@bBTR^4I%8u--~~aq zC9GKKF+cm!M)GAOtg=tqAOWB9t|q(+zwRej*7P)NP;V5u4n>-PUi+Y@OL=375KMGJ z#~!HRZt13Eh`5rtujD*`$zHDngF%CFJs`o~{cuAU_UM%afB$59gF|e>b{UN)i}G;{ zM3P&z4n)Q!qhZIhZrH*7ji^AYI;ZkmvL-bZGm)1CGKNzwZj7Qhv*xh8-8goBNR~IDJRA@%Bu)~!^~pYOYIO@do74*s|Myd%`B?w((5s{I3UBSKoOq*v z)3G5}poJOlTMD;vb|Nn^8>DD0pWSwT$E%0Fo8KA3bk25vv9)h(zxtFbo8n={K=V7N zbWaTN|4@1sPr6Le6>%18du)n_Du7GoRIu5VPw+5jfM!o3y?ct*1i4k`bO>jn1jvRH zJPE>F#_QeH6tw+@Zj9ZZ1ghh}jJY|a&LMCxB@|8E9Or;f@0kbu4w`h5IPx|xG&A$hvy5B1`| zo94NFD;iUqX`bQdzxvN_zI?Zu9aBPG|!KBaaTCa^Bs?ZX`Tz2+snnz*iu>P z`?hUg_Al7Sn@#H}n%;&u+>G}Ye`U;(N$&?z_Oo|vn&%wZjjcG>bfBhrXggYep8!Lv zc4a`?Rp9Iron+6G5^$l~Bfp0$=pp=C#yc%2DC2DcD+R46cNs;VNs%ob7=bXksCpZt zsiUPc|MRIMm(OPZ2I*6JQrpAfcE`bbeBS1^U@GZ%o3sVu``;@59$o8yS?ABI^M57D zJ;eWk(Un&8cB}E3;J9FeT7OJAJ1s7V)v>avae4a-I@bB)x+be)N6<=Y{C|@^w(-}j zx~h4M!s@DC4%aF(Pcb(a{~67*PX%s91S^$$t0UpNx_zXP!_dp+D3bgqR({4#*w)RA z)GC@7S%il=ZUWoEN)Kj9yrtGt{RW9cjl_nKNE?X^t?GP{I7oxVaE;n?CaXpTw!HH} zp{HV-8SeZ1b+|sb7YX+)1-zWQi&fI~Yq}wR78IE4WclCUBltsspDcJBqu_u3i#jOM zBft-e;LnfXdja1hc+cQt+XJ7}?tr(lQ@Vx`vp$)&SA?>hrhKtb7O9~I{YjXS3WqA8 z_h)x=^N$RY^bNZGrLZ7f@GtX5ULU+R@ehBmG*wN3_HClQE#r9`=E(DmM$NhS^v$Gi zMew!?=zK?E*><8Z9ST<&g+rilzbJgEp;@Tx5mr~Bvb`FI`-tI=jc_*w_aDN&$%b|D zi%c0#*`1)^CYG1uRUa1APzQBg_f{1zsSKeO0riNWDh(>OfmIxeeLXwq&%yY~j$)Y5 zeKg-c0{T%we}@ol;t&P_1RnW=02^~wd2=bQ{%j^ms?kmTsl>;%jSF(Q_(w$BZp5j0 zX&A(xfw*>tDZZb!1V=#h)sV<|y?FN=?=s$rC_^g5l(�OL^DgR>S(W;9Kb{2Hm5Z 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 +#ifndef offsetof + #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) +#endif +#if !defined(WIN32) && !defined(MS_WINDOWS) + #ifndef __stdcall + #define __stdcall + #endif + #ifndef __cdecl + #define __cdecl + #endif + #ifndef __fastcall + #define __fastcall + #endif +#endif +#ifndef DL_IMPORT + #define DL_IMPORT(t) t +#endif +#ifndef DL_EXPORT + #define DL_EXPORT(t) t +#endif +#define __PYX_COMMA , +#ifndef HAVE_LONG_LONG + #if PY_VERSION_HEX >= 0x02070000 + #define HAVE_LONG_LONG + #endif +#endif +#ifndef PY_LONG_LONG + #define PY_LONG_LONG LONG_LONG +#endif +#ifndef Py_HUGE_VAL + #define Py_HUGE_VAL HUGE_VAL +#endif +#ifdef PYPY_VERSION + #define CYTHON_COMPILING_IN_PYPY 1 + #define CYTHON_COMPILING_IN_PYSTON 0 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #undef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 0 + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #if PY_VERSION_HEX < 0x03050000 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #elif !defined(CYTHON_USE_ASYNC_SLOTS) + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #undef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 0 + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #undef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 1 + #undef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 0 + #undef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 0 + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #undef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE 0 + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 +#elif defined(PYSTON_VERSION) + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_PYSTON 1 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #ifndef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 1 + #endif + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #ifndef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 1 + #endif + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #ifndef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 0 + #endif + #ifndef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 1 + #endif + #ifndef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 1 + #endif + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #undef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE 0 + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 +#else + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_PYSTON 0 + #define CYTHON_COMPILING_IN_CPYTHON 1 + #ifndef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 1 + #endif + #if PY_VERSION_HEX < 0x02070000 + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #elif !defined(CYTHON_USE_PYTYPE_LOOKUP) + #define CYTHON_USE_PYTYPE_LOOKUP 1 + #endif + #if PY_MAJOR_VERSION < 3 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #elif !defined(CYTHON_USE_ASYNC_SLOTS) + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #if PY_VERSION_HEX < 0x02070000 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #elif !defined(CYTHON_USE_PYLONG_INTERNALS) + #define CYTHON_USE_PYLONG_INTERNALS 1 + #endif + #ifndef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 1 + #endif + #ifndef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 1 + #endif + #if PY_VERSION_HEX < 0x030300F0 + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #elif !defined(CYTHON_USE_UNICODE_WRITER) + #define CYTHON_USE_UNICODE_WRITER 1 + #endif + #ifndef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 0 + #endif + #ifndef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 1 + #endif + #ifndef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 1 + #endif + #ifndef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 1 + #endif + #ifndef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 1 + #endif + #ifndef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000) + #endif + #ifndef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1) + #endif + #ifndef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1) + #endif + #ifndef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3) + #endif +#endif +#if !defined(CYTHON_FAST_PYCCALL) +#define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) +#endif +#if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #undef SHIFT + #undef BASE + #undef MASK + #ifdef SIZEOF_VOID_P + enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) }; + #endif +#endif +#ifndef __has_attribute + #define __has_attribute(x) 0 +#endif +#ifndef __has_cpp_attribute + #define __has_cpp_attribute(x) 0 +#endif +#ifndef CYTHON_RESTRICT + #if defined(__GNUC__) + #define CYTHON_RESTRICT __restrict__ + #elif defined(_MSC_VER) && _MSC_VER >= 1400 + #define CYTHON_RESTRICT __restrict + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_RESTRICT restrict + #else + #define CYTHON_RESTRICT + #endif +#endif +#ifndef CYTHON_UNUSED +# if defined(__GNUC__) +# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +#endif +#ifndef CYTHON_MAYBE_UNUSED_VAR +# if defined(__cplusplus) + template void CYTHON_MAYBE_UNUSED_VAR( const T& ) { } +# else +# define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x) +# endif +#endif +#ifndef CYTHON_NCP_UNUSED +# if CYTHON_COMPILING_IN_CPYTHON +# define CYTHON_NCP_UNUSED +# else +# define CYTHON_NCP_UNUSED CYTHON_UNUSED +# endif +#endif +#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) +#ifdef _MSC_VER + #ifndef _MSC_STDINT_H_ + #if _MSC_VER < 1300 + typedef unsigned char uint8_t; + typedef unsigned int uint32_t; + #else + typedef unsigned __int8 uint8_t; + typedef unsigned __int32 uint32_t; + #endif + #endif +#else + #include +#endif +#ifndef CYTHON_FALLTHROUGH + #if defined(__cplusplus) && __cplusplus >= 201103L + #if __has_cpp_attribute(fallthrough) + #define CYTHON_FALLTHROUGH [[fallthrough]] + #elif __has_cpp_attribute(clang::fallthrough) + #define CYTHON_FALLTHROUGH [[clang::fallthrough]] + #elif __has_cpp_attribute(gnu::fallthrough) + #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] + #endif + #endif + #ifndef CYTHON_FALLTHROUGH + #if __has_attribute(fallthrough) + #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) + #else + #define CYTHON_FALLTHROUGH + #endif + #endif + #if defined(__clang__ ) && defined(__apple_build_version__) + #if __apple_build_version__ < 7000000 + #undef CYTHON_FALLTHROUGH + #define CYTHON_FALLTHROUGH + #endif + #endif +#endif + +#ifndef CYTHON_INLINE + #if defined(__clang__) + #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) + #elif defined(__GNUC__) + #define CYTHON_INLINE __inline__ + #elif defined(_MSC_VER) + #define CYTHON_INLINE __inline + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_INLINE inline + #else + #define CYTHON_INLINE + #endif +#endif + +#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) + #define Py_OptimizeFlag 0 +#endif +#define __PYX_BUILD_PY_SSIZE_T "n" +#define CYTHON_FORMAT_SSIZE_T "z" +#if PY_MAJOR_VERSION < 3 + #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyClass_Type +#else + #define __Pyx_BUILTIN_MODULE_NAME "builtins" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyType_Type +#endif +#ifndef Py_TPFLAGS_CHECKTYPES + #define Py_TPFLAGS_CHECKTYPES 0 +#endif +#ifndef Py_TPFLAGS_HAVE_INDEX + #define Py_TPFLAGS_HAVE_INDEX 0 +#endif +#ifndef Py_TPFLAGS_HAVE_NEWBUFFER + #define Py_TPFLAGS_HAVE_NEWBUFFER 0 +#endif +#ifndef Py_TPFLAGS_HAVE_FINALIZE + #define Py_TPFLAGS_HAVE_FINALIZE 0 +#endif +#ifndef METH_STACKLESS + #define METH_STACKLESS 0 +#endif +#if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) + #ifndef METH_FASTCALL + #define METH_FASTCALL 0x80 + #endif + typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs); + typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args, + Py_ssize_t nargs, PyObject *kwnames); +#else + #define __Pyx_PyCFunctionFast _PyCFunctionFast + #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords +#endif +#if CYTHON_FAST_PYCCALL +#define __Pyx_PyFastCFunction_Check(func)\ + ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS))))) +#else +#define __Pyx_PyFastCFunction_Check(func) 0 +#endif +#if CYTHON_USE_DICT_VERSIONS +#define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) +#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ + (version_var) = __PYX_GET_DICT_VERSION(dict);\ + (cache_var) = (value); +#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ + static PY_UINT64_T __pyx_dict_version = 0;\ + static PyObject *__pyx_dict_cached_value = NULL;\ + if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ + (VAR) = __pyx_dict_cached_value;\ + } else {\ + (VAR) = __pyx_dict_cached_value = (LOOKUP);\ + __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ + }\ + } +#else +#define __PYX_GET_DICT_VERSION(dict) (0) +#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) +#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) + #define PyObject_Malloc(s) PyMem_Malloc(s) + #define PyObject_Free(p) PyMem_Free(p) + #define PyObject_Realloc(p) PyMem_Realloc(p) +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1 + #define PyMem_RawMalloc(n) PyMem_Malloc(n) + #define PyMem_RawRealloc(p, n) PyMem_Realloc(p, n) + #define PyMem_RawFree(p) PyMem_Free(p) +#endif +#if CYTHON_COMPILING_IN_PYSTON + #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co) + #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno) +#else + #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) + #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) +#endif +#if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000 + #define __Pyx_PyThreadState_Current PyThreadState_GET() +#elif PY_VERSION_HEX >= 0x03060000 + #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() +#elif PY_VERSION_HEX >= 0x03000000 + #define __Pyx_PyThreadState_Current PyThreadState_GET() +#else + #define __Pyx_PyThreadState_Current _PyThreadState_Current +#endif +#if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) +#include "pythread.h" +#define Py_tss_NEEDS_INIT 0 +typedef int Py_tss_t; +static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) { + *key = PyThread_create_key(); + return 0; // PyThread_create_key reports success always +} +static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) { + Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t)); + *key = Py_tss_NEEDS_INIT; + return key; +} +static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) { + PyObject_Free(key); +} +static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) { + return *key != Py_tss_NEEDS_INIT; +} +static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) { + PyThread_delete_key(*key); + *key = Py_tss_NEEDS_INIT; +} +static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) { + return PyThread_set_key_value(*key, value); +} +static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { + return PyThread_get_key_value(*key); +} +#endif // TSS (Thread Specific Storage) API +#if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized) +#define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) +#else +#define __Pyx_PyDict_NewPresized(n) PyDict_New() +#endif +#if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION + #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) +#else + #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS +#define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) +#else +#define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name) +#endif +#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) + #define CYTHON_PEP393_ENABLED 1 + #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ + 0 : _PyUnicode_Ready((PyObject *)(op))) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) + #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) + #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) + #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) + #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) + #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch) + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) +#else + #define CYTHON_PEP393_ENABLED 0 + #define PyUnicode_1BYTE_KIND 1 + #define PyUnicode_2BYTE_KIND 2 + #define PyUnicode_4BYTE_KIND 4 + #define __Pyx_PyUnicode_READY(op) (0) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) + #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111) + #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) + #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) + #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) + #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch) + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) +#endif +#if CYTHON_COMPILING_IN_PYPY + #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) +#else + #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ + PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains) + #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check) + #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format) + #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) +#endif +#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) +#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) +#else + #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) +#endif +#if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) + #define PyObject_ASCII(o) PyObject_Repr(o) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBaseString_Type PyUnicode_Type + #define PyStringObject PyUnicodeObject + #define PyString_Type PyUnicode_Type + #define PyString_Check PyUnicode_Check + #define PyString_CheckExact PyUnicode_CheckExact + #define PyObject_Unicode PyObject_Str +#endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) + #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) +#else + #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) + #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) +#endif +#ifndef PySet_CheckExact + #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) +#endif +#if CYTHON_ASSUME_SAFE_MACROS + #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) +#else + #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyIntObject PyLongObject + #define PyInt_Type PyLong_Type + #define PyInt_Check(op) PyLong_Check(op) + #define PyInt_CheckExact(op) PyLong_CheckExact(op) + #define PyInt_FromString PyLong_FromString + #define PyInt_FromUnicode PyLong_FromUnicode + #define PyInt_FromLong PyLong_FromLong + #define PyInt_FromSize_t PyLong_FromSize_t + #define PyInt_FromSsize_t PyLong_FromSsize_t + #define PyInt_AsLong PyLong_AsLong + #define PyInt_AS_LONG PyLong_AS_LONG + #define PyInt_AsSsize_t PyLong_AsSsize_t + #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask + #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask + #define PyNumber_Int PyNumber_Long +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBoolObject PyLongObject +#endif +#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY + #ifndef PyUnicode_InternFromString + #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) + #endif +#endif +#if PY_VERSION_HEX < 0x030200A4 + typedef long Py_hash_t; + #define __Pyx_PyInt_FromHash_t PyInt_FromLong + #define __Pyx_PyInt_AsHash_t PyInt_AsLong +#else + #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t + #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t +#endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : (Py_INCREF(func), func)) +#else + #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) +#endif +#if CYTHON_USE_ASYNC_SLOTS + #if PY_VERSION_HEX >= 0x030500B1 + #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods + #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) + #else + #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) + #endif +#else + #define __Pyx_PyType_AsAsync(obj) NULL +#endif +#ifndef __Pyx_PyAsyncMethodsStruct + typedef struct { + unaryfunc am_await; + unaryfunc am_aiter; + unaryfunc am_anext; + } __Pyx_PyAsyncMethodsStruct; +#endif + +#if defined(WIN32) || defined(MS_WINDOWS) + #define _USE_MATH_DEFINES +#endif +#include +#ifdef NAN +#define __PYX_NAN() ((float) NAN) +#else +static CYTHON_INLINE float __PYX_NAN() { + float value; + memset(&value, 0xFF, sizeof(value)); + return value; +} +#endif +#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) +#define __Pyx_truncl trunc +#else +#define __Pyx_truncl truncl +#endif + + +#define __PYX_ERR(f_index, lineno, Ln_error) \ +{ \ + __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \ +} + +#ifndef __PYX_EXTERN_C + #ifdef __cplusplus + #define __PYX_EXTERN_C extern "C" + #else + #define __PYX_EXTERN_C extern + #endif +#endif + +#define __PYX_HAVE__gevent____greenlet_primitives +#define __PYX_HAVE_API__gevent____greenlet_primitives +/* Early includes */ +#include "greenlet/greenlet.h" +#ifdef _OPENMP +#include +#endif /* _OPENMP */ + +#if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) +#define CYTHON_WITHOUT_ASSERTIONS +#endif + +typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; + const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; + +#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 +#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0 +#define __PYX_DEFAULT_STRING_ENCODING "" +#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString +#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#define __Pyx_uchar_cast(c) ((unsigned char)c) +#define __Pyx_long_cast(x) ((long)x) +#define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ + (sizeof(type) < sizeof(Py_ssize_t)) ||\ + (sizeof(type) > sizeof(Py_ssize_t) &&\ + likely(v < (type)PY_SSIZE_T_MAX ||\ + v == (type)PY_SSIZE_T_MAX) &&\ + (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ + v == (type)PY_SSIZE_T_MIN))) ||\ + (sizeof(type) == sizeof(Py_ssize_t) &&\ + (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ + v == (type)PY_SSIZE_T_MAX))) ) +static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) { + return (size_t) i < (size_t) limit; +} +#if defined (__cplusplus) && __cplusplus >= 201103L + #include + #define __Pyx_sst_abs(value) std::abs(value) +#elif SIZEOF_INT >= SIZEOF_SIZE_T + #define __Pyx_sst_abs(value) abs(value) +#elif SIZEOF_LONG >= SIZEOF_SIZE_T + #define __Pyx_sst_abs(value) labs(value) +#elif defined (_MSC_VER) + #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) +#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define __Pyx_sst_abs(value) llabs(value) +#elif defined (__GNUC__) + #define __Pyx_sst_abs(value) __builtin_llabs(value) +#else + #define __Pyx_sst_abs(value) ((value<0) ? -value : value) +#endif +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*); +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); +#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) +#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) +#define __Pyx_PyBytes_FromString PyBytes_FromString +#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); +#if PY_MAJOR_VERSION < 3 + #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#else + #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize +#endif +#define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) +#define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) +#define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) +#define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) +#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) +static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) { + const Py_UNICODE *u_end = u; + while (*u_end++) ; + return (size_t)(u_end - u - 1); +} +#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) +#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode +#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode +#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) +#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) +static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); +static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*); +static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); +#define __Pyx_PySequence_Tuple(obj)\ + (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); +#if CYTHON_ASSUME_SAFE_MACROS +#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) +#else +#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) +#endif +#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) +#if PY_MAJOR_VERSION >= 3 +#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) +#else +#define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) +#endif +#define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x)) +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII +static int __Pyx_sys_getdefaultencoding_not_ascii; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + PyObject* ascii_chars_u = NULL; + PyObject* ascii_chars_b = NULL; + const char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + if (strcmp(default_encoding_c, "ascii") == 0) { + __Pyx_sys_getdefaultencoding_not_ascii = 0; + } else { + char ascii_chars[128]; + int c; + for (c = 0; c < 128; c++) { + ascii_chars[c] = c; + } + __Pyx_sys_getdefaultencoding_not_ascii = 1; + ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); + if (!ascii_chars_u) goto bad; + ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); + if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { + PyErr_Format( + PyExc_ValueError, + "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", + default_encoding_c); + goto bad; + } + Py_DECREF(ascii_chars_u); + Py_DECREF(ascii_chars_b); + } + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + Py_XDECREF(ascii_chars_u); + Py_XDECREF(ascii_chars_b); + return -1; +} +#endif +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) +#else +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +static char* __PYX_DEFAULT_STRING_ENCODING; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1); + if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; + strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + return -1; +} +#endif +#endif + + +/* Test for GCC > 2.95 */ +#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) + #define likely(x) __builtin_expect(!!(x), 1) + #define unlikely(x) __builtin_expect(!!(x), 0) +#else /* !__GNUC__ or GCC < 2.95 */ + #define likely(x) (x) + #define unlikely(x) (x) +#endif /* __GNUC__ */ +static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } + +static PyObject *__pyx_m = NULL; +static PyObject *__pyx_d; +static PyObject *__pyx_b; +static PyObject *__pyx_cython_runtime = NULL; +static PyObject *__pyx_empty_tuple; +static PyObject *__pyx_empty_bytes; +static PyObject *__pyx_empty_unicode; +static int __pyx_lineno; +static int __pyx_clineno = 0; +static const char * __pyx_cfilenm= __FILE__; +static const char *__pyx_filename; + + +static const char *__pyx_f[] = { + "src\\gevent\\_greenlet_primitives.py", + "src\\gevent\\__greenlet_primitives.pxd", +}; + +/*--- Type declarations ---*/ +struct __pyx_obj_6gevent_21__greenlet_primitives_TrackedRawGreenlet; +struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop; + +/* "gevent/__greenlet_primitives.pxd":37 + * return PyGreenlet_Switch(self, NULL, NULL) + * + * cdef class TrackedRawGreenlet(greenlet): # <<<<<<<<<<<<<< + * pass + * + */ +struct __pyx_obj_6gevent_21__greenlet_primitives_TrackedRawGreenlet { + PyGreenlet __pyx_base; +}; + + +/* "gevent/__greenlet_primitives.pxd":40 + * pass + * + * cdef class SwitchOutGreenletWithLoop(TrackedRawGreenlet): # <<<<<<<<<<<<<< + * cdef public loop + * + */ +struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop { + struct __pyx_obj_6gevent_21__greenlet_primitives_TrackedRawGreenlet __pyx_base; + struct __pyx_vtabstruct_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *__pyx_vtab; + PyObject *loop; +}; + + + +/* "src/gevent/_greenlet_primitives.py":53 + * + * + * class SwitchOutGreenletWithLoop(TrackedRawGreenlet): # <<<<<<<<<<<<<< + * # Subclasses must define: + * # - self.loop + */ + +struct __pyx_vtabstruct_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop { + PyObject *(*__pyx_switch)(struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *, int __pyx_skip_dispatch); + PyObject *(*switch_out)(struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *, int __pyx_skip_dispatch); +}; +static struct __pyx_vtabstruct_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *__pyx_vtabptr_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop; + +/* --- Runtime support code (head) --- */ +/* Refnanny.proto */ +#ifndef CYTHON_REFNANNY + #define CYTHON_REFNANNY 0 +#endif +#if CYTHON_REFNANNY + typedef struct { + void (*INCREF)(void*, PyObject*, int); + void (*DECREF)(void*, PyObject*, int); + void (*GOTREF)(void*, PyObject*, int); + void (*GIVEREF)(void*, PyObject*, int); + void* (*SetupContext)(const char*, int, const char*); + void (*FinishContext)(void**); + } __Pyx_RefNannyAPIStruct; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); + #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; +#ifdef WITH_THREAD + #define __Pyx_RefNannySetupContext(name, acquire_gil)\ + if (acquire_gil) {\ + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ + PyGILState_Release(__pyx_gilstate_save);\ + } else {\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ + } +#else + #define __Pyx_RefNannySetupContext(name, acquire_gil)\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) +#endif + #define __Pyx_RefNannyFinishContext()\ + __Pyx_RefNanny->FinishContext(&__pyx_refnanny) + #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0) + #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) + #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) + #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) +#else + #define __Pyx_RefNannyDeclarations + #define __Pyx_RefNannySetupContext(name, acquire_gil) + #define __Pyx_RefNannyFinishContext() + #define __Pyx_INCREF(r) Py_INCREF(r) + #define __Pyx_DECREF(r) Py_DECREF(r) + #define __Pyx_GOTREF(r) + #define __Pyx_GIVEREF(r) + #define __Pyx_XINCREF(r) Py_XINCREF(r) + #define __Pyx_XDECREF(r) Py_XDECREF(r) + #define __Pyx_XGOTREF(r) + #define __Pyx_XGIVEREF(r) +#endif +#define __Pyx_XDECREF_SET(r, v) do {\ + PyObject *tmp = (PyObject *) r;\ + r = v; __Pyx_XDECREF(tmp);\ + } while (0) +#define __Pyx_DECREF_SET(r, v) do {\ + PyObject *tmp = (PyObject *) r;\ + r = v; __Pyx_DECREF(tmp);\ + } while (0) +#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) +#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) + +/* PyObjectGetAttrStr.proto */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); +#else +#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) +#endif + +/* GetBuiltinName.proto */ +static PyObject *__Pyx_GetBuiltinName(PyObject *name); + +/* RaiseArgTupleInvalid.proto */ +static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, + Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); + +/* RaiseDoubleKeywords.proto */ +static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); + +/* ParseKeywords.proto */ +static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\ + PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\ + const char* function_name); + +/* PyFunctionFastCall.proto */ +#if CYTHON_FAST_PYCALL +#define __Pyx_PyFunction_FastCall(func, args, nargs)\ + __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) +#if 1 || PY_VERSION_HEX < 0x030600B1 +static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs); +#else +#define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs) +#endif +#define __Pyx_BUILD_ASSERT_EXPR(cond)\ + (sizeof(char [1 - 2*!(cond)]) - 1) +#ifndef Py_MEMBER_SIZE +#define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member) +#endif + static size_t __pyx_pyframe_localsplus_offset = 0; + #include "frameobject.h" + #define __Pxy_PyFrame_Initialize_Offsets()\ + ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\ + (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus))) + #define __Pyx_PyFrame_GetLocalsplus(frame)\ + (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset)) +#endif + +/* PyCFunctionFastCall.proto */ +#if CYTHON_FAST_PYCCALL +static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs); +#else +#define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL) +#endif + +/* PyObjectCall.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); +#else +#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) +#endif + +/* PyObjectCall2Args.proto */ +static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2); + +/* PyObjectCallMethO.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); +#endif + +/* PyObjectCallOneArg.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); + +/* PyObjectSetAttrStr.proto */ +#if CYTHON_USE_TYPE_SLOTS +#define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o, n, NULL) +static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value); +#else +#define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n) +#define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v) +#endif + +/* GetTopmostException.proto */ +#if CYTHON_USE_EXC_INFO_STACK +static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate); +#endif + +/* PyThreadStateGet.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; +#define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; +#define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type +#else +#define __Pyx_PyThreadState_declare +#define __Pyx_PyThreadState_assign +#define __Pyx_PyErr_Occurred() PyErr_Occurred() +#endif + +/* SaveResetException.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); +#else +#define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb) +#define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb) +#endif + +/* PyErrExceptionMatches.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) +static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); +#else +#define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) +#endif + +/* GetException.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb) +static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#else +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); +#endif + +/* PyObjectCallNoArg.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); +#else +#define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL) +#endif + +/* PyErrFetchRestore.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) +#define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) +#define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) +#define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) +#define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); +static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) +#else +#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) +#endif +#else +#define __Pyx_PyErr_Clear() PyErr_Clear() +#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) +#define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) +#define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb) +#define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) +#endif + +/* GetAttr.proto */ +static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *); + +/* GetAttr3.proto */ +static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *); + +/* RaiseException.proto */ +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); + +/* ListCompAppend.proto */ +#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS +static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) { + PyListObject* L = (PyListObject*) list; + Py_ssize_t len = Py_SIZE(list); + if (likely(L->allocated > len)) { + Py_INCREF(x); + PyList_SET_ITEM(list, len, x); + Py_SIZE(list) = len+1; + return 0; + } + return PyList_Append(list, x); +} +#else +#define __Pyx_ListComp_Append(L,x) PyList_Append(L,x) +#endif + +/* CallNextTpDealloc.proto */ +static void __Pyx_call_next_tp_dealloc(PyObject* obj, destructor current_tp_dealloc); + +/* CallNextTpTraverse.proto */ +static int __Pyx_call_next_tp_traverse(PyObject* obj, visitproc v, void *a, traverseproc current_tp_traverse); + +/* CallNextTpClear.proto */ +static void __Pyx_call_next_tp_clear(PyObject* obj, inquiry current_tp_dealloc); + +/* TypeImport.proto */ +#ifndef __PYX_HAVE_RT_ImportType_proto +#define __PYX_HAVE_RT_ImportType_proto +enum __Pyx_ImportType_CheckSize { + __Pyx_ImportType_CheckSize_Error = 0, + __Pyx_ImportType_CheckSize_Warn = 1, + __Pyx_ImportType_CheckSize_Ignore = 2 +}; +static PyTypeObject *__Pyx_ImportType(PyObject* module, const char *module_name, const char *class_name, size_t size, enum __Pyx_ImportType_CheckSize check_size); +#endif + +/* PyObject_GenericGetAttrNoDict.proto */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name); +#else +#define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr +#endif + +/* PyObject_GenericGetAttr.proto */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name); +#else +#define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr +#endif + +/* SetVTable.proto */ +static int __Pyx_SetVtable(PyObject *dict, void *vtable); + +/* Import.proto */ +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); + +/* ImportFrom.proto */ +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); + +/* FetchCommonType.proto */ +static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); + +/* CythonFunction.proto */ +#define __Pyx_CyFunction_USED 1 +#define __Pyx_CYFUNCTION_STATICMETHOD 0x01 +#define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 +#define __Pyx_CYFUNCTION_CCLASS 0x04 +#define __Pyx_CyFunction_GetClosure(f)\ + (((__pyx_CyFunctionObject *) (f))->func_closure) +#define __Pyx_CyFunction_GetClassObj(f)\ + (((__pyx_CyFunctionObject *) (f))->func_classobj) +#define __Pyx_CyFunction_Defaults(type, f)\ + ((type *)(((__pyx_CyFunctionObject *) (f))->defaults)) +#define __Pyx_CyFunction_SetDefaultsGetter(f, g)\ + ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g) +typedef struct { + PyCFunctionObject func; +#if PY_VERSION_HEX < 0x030500A0 + PyObject *func_weakreflist; +#endif + PyObject *func_dict; + PyObject *func_name; + PyObject *func_qualname; + PyObject *func_doc; + PyObject *func_globals; + PyObject *func_code; + PyObject *func_closure; + PyObject *func_classobj; + void *defaults; + int defaults_pyobjects; + int flags; + PyObject *defaults_tuple; + PyObject *defaults_kwdict; + PyObject *(*defaults_getter)(PyObject *); + PyObject *func_annotations; +} __pyx_CyFunctionObject; +static PyTypeObject *__pyx_CyFunctionType = 0; +#define __Pyx_CyFunction_Check(obj) (__Pyx_TypeCheck(obj, __pyx_CyFunctionType)) +#define __Pyx_CyFunction_NewEx(ml, flags, qualname, self, module, globals, code)\ + __Pyx_CyFunction_New(__pyx_CyFunctionType, ml, flags, qualname, self, module, globals, code) +static PyObject *__Pyx_CyFunction_New(PyTypeObject *, PyMethodDef *ml, + int flags, PyObject* qualname, + PyObject *self, + PyObject *module, PyObject *globals, + PyObject* code); +static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, + size_t size, + int pyobjects); +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, + PyObject *tuple); +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, + PyObject *dict); +static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m, + PyObject *dict); +static int __pyx_CyFunction_init(void); + +/* GetModuleGlobalName.proto */ +#if CYTHON_USE_DICT_VERSIONS +#define __Pyx_GetModuleGlobalName(var, name) {\ + static PY_UINT64_T __pyx_dict_version = 0;\ + static PyObject *__pyx_dict_cached_value = NULL;\ + (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\ + (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\ + __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ +} +#define __Pyx_GetModuleGlobalNameUncached(var, name) {\ + PY_UINT64_T __pyx_dict_version;\ + PyObject *__pyx_dict_cached_value;\ + (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ +} +static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value); +#else +#define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name) +#define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name) +static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name); +#endif + +/* Globals.proto */ +static PyObject* __Pyx_Globals(void); + +/* CLineInTraceback.proto */ +#ifdef CYTHON_CLINE_IN_TRACEBACK +#define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) +#else +static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line); +#endif + +/* CodeObjectCache.proto */ +typedef struct { + PyCodeObject* code_object; + int code_line; +} __Pyx_CodeObjectCacheEntry; +struct __Pyx_CodeObjectCache { + int count; + int max_count; + __Pyx_CodeObjectCacheEntry* entries; +}; +static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); +static PyCodeObject *__pyx_find_code_object(int code_line); +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); + +/* AddTraceback.proto */ +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename); + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); + +/* CIntFromPy.proto */ +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); + +/* CIntFromPy.proto */ +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); + +/* FastTypeChecks.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) +static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b); +static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type); +static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2); +#else +#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) +#define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) +#define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) +#endif +#define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) + +/* CheckBinaryVersion.proto */ +static int __Pyx_check_binary_version(void); + +/* VoidPtrExport.proto */ +static int __Pyx_ExportVoidPtr(PyObject *name, void *p, const char *sig); + +/* FunctionExport.proto */ +static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig); + +/* InitStrings.proto */ +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); + +static PyObject *__pyx_f_6gevent_21__greenlet_primitives_25SwitchOutGreenletWithLoop_switch(struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/ +static PyObject *__pyx_f_6gevent_21__greenlet_primitives_25SwitchOutGreenletWithLoop_switch_out(CYTHON_UNUSED struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/ + +/* Module declarations from 'cython' */ + +/* Module declarations from 'greenlet' */ + +/* Module declarations from 'gevent.__greenlet_primitives' */ +static PyTypeObject *__pyx_ptype_6gevent_21__greenlet_primitives_greenlet = 0; +static PyTypeObject *__pyx_ptype_6gevent_21__greenlet_primitives_TrackedRawGreenlet = 0; +static PyTypeObject *__pyx_ptype_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop = 0; +static PyObject *__pyx_v_6gevent_21__greenlet_primitives_get_objects = 0; +static PyObject *__pyx_v_6gevent_21__greenlet_primitives_wref = 0; +static PyObject *__pyx_v_6gevent_21__greenlet_primitives_BlockingSwitchOutError = 0; +static int __pyx_v_6gevent_21__greenlet_primitives__greenlet_imported; +static CYTHON_INLINE PyGreenlet *__pyx_f_6gevent_21__greenlet_primitives_getcurrent(void); /*proto*/ +static CYTHON_INLINE void __pyx_f_6gevent_21__greenlet_primitives_greenlet_init(void); /*proto*/ +static CYTHON_INLINE PyObject *__pyx_f_6gevent_21__greenlet_primitives__greenlet_switch(PyGreenlet *); /*proto*/ +static PyObject *__pyx_f_6gevent_21__greenlet_primitives_get_reachable_greenlets(int __pyx_skip_dispatch); /*proto*/ +#define __Pyx_MODULE_NAME "gevent.__greenlet_primitives" +extern int __pyx_module_is_main_gevent____greenlet_primitives; +int __pyx_module_is_main_gevent____greenlet_primitives = 0; + +/* Implementation of 'gevent.__greenlet_primitives' */ +static PyObject *__pyx_builtin___import__; +static PyObject *__pyx_builtin_AttributeError; +static const char __pyx_k_gc[] = "gc"; +static const char __pyx_k_all[] = "__all__"; +static const char __pyx_k_ref[] = "ref"; +static const char __pyx_k_init[] = "__init__"; +static const char __pyx_k_main[] = "__main__"; +static const char __pyx_k_name[] = "__name__"; +static const char __pyx_k_self[] = "self"; +static const char __pyx_k_test[] = "__test__"; +static const char __pyx_k_wref[] = "wref"; +static const char __pyx_k_import[] = "__import__"; +static const char __pyx_k_init_2[] = "_init"; +static const char __pyx_k_lambda[] = ""; +static const char __pyx_k_parent[] = "parent"; +static const char __pyx_k_switch[] = "switch"; +static const char __pyx_k_weakref[] = "weakref"; +static const char __pyx_k_function[] = "function"; +static const char __pyx_k_greenlet[] = "greenlet"; +static const char __pyx_k_pyx_capi[] = "__pyx_capi__"; +static const char __pyx_k_getcurrent[] = "getcurrent"; +static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__"; +static const char __pyx_k_switch_out[] = "switch_out"; +static const char __pyx_k_get_objects[] = "get_objects"; +static const char __pyx_k_gevent__util[] = "gevent._util"; +static const char __pyx_k_greenlet_init[] = "greenlet_init"; +static const char __pyx_k_AttributeError[] = "AttributeError"; +static const char __pyx_k_import_c_accel[] = "import_c_accel"; +static const char __pyx_k_greenlet_switch[] = "_greenlet_switch"; +static const char __pyx_k_gevent_exceptions[] = "gevent.exceptions"; +static const char __pyx_k_greenlet_imported[] = "_greenlet_imported"; +static const char __pyx_k_spawn_tree_locals[] = "spawn_tree_locals"; +static const char __pyx_k_spawning_greenlet[] = "spawning_greenlet"; +static const char __pyx_k_TrackedRawGreenlet[] = "TrackedRawGreenlet"; +static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; +static const char __pyx_k_BlockingSwitchOutError[] = "BlockingSwitchOutError"; +static const char __pyx_k_get_reachable_greenlets[] = "get_reachable_greenlets"; +static const char __pyx_k_greenlet_tree_is_ignored[] = "greenlet_tree_is_ignored"; +static const char __pyx_k_SwitchOutGreenletWithLoop[] = "SwitchOutGreenletWithLoop"; +static const char __pyx_k_gevent___greenlet_primitives[] = "gevent.__greenlet_primitives"; +static const char __pyx_k_A_collection_of_primitives_used[] = "\nA collection of primitives used by the hub, and suitable for\ncompilation with Cython because of their frequency of use.\n\n"; +static const char __pyx_k_src_gevent__greenlet_primitives[] = "src\\gevent\\_greenlet_primitives.py"; +static const char __pyx_k_Impossible_to_call_blocking_func[] = "Impossible to call blocking function in the event loop callback"; +static const char __pyx_k_SwitchOutGreenletWithLoop_switch[] = "SwitchOutGreenletWithLoop.switch"; +static const char __pyx_k_SwitchOutGreenletWithLoop_switch_2[] = "SwitchOutGreenletWithLoop.switch_out"; +static PyObject *__pyx_n_s_AttributeError; +static PyObject *__pyx_n_s_BlockingSwitchOutError; +static PyObject *__pyx_kp_s_Impossible_to_call_blocking_func; +static PyObject *__pyx_n_s_SwitchOutGreenletWithLoop; +static PyObject *__pyx_n_s_SwitchOutGreenletWithLoop_switch; +static PyObject *__pyx_n_s_SwitchOutGreenletWithLoop_switch_2; +static PyObject *__pyx_n_s_TrackedRawGreenlet; +static PyObject *__pyx_n_s_all; +static PyObject *__pyx_n_s_cline_in_traceback; +static PyObject *__pyx_n_s_function; +static PyObject *__pyx_n_s_gc; +static PyObject *__pyx_n_s_get_objects; +static PyObject *__pyx_n_s_get_reachable_greenlets; +static PyObject *__pyx_n_s_getcurrent; +static PyObject *__pyx_n_s_gevent___greenlet_primitives; +static PyObject *__pyx_n_s_gevent__util; +static PyObject *__pyx_n_s_gevent_exceptions; +static PyObject *__pyx_n_s_greenlet; +static PyObject *__pyx_n_s_greenlet_imported; +static PyObject *__pyx_n_s_greenlet_init; +static PyObject *__pyx_n_s_greenlet_switch; +static PyObject *__pyx_n_s_greenlet_tree_is_ignored; +static PyObject *__pyx_n_s_import; +static PyObject *__pyx_n_s_import_c_accel; +static PyObject *__pyx_n_s_init; +static PyObject *__pyx_n_s_init_2; +static PyObject *__pyx_n_s_lambda; +static PyObject *__pyx_n_s_main; +static PyObject *__pyx_n_s_name; +static PyObject *__pyx_n_s_parent; +static PyObject *__pyx_n_s_pyx_capi; +static PyObject *__pyx_n_s_pyx_vtable; +static PyObject *__pyx_n_s_ref; +static PyObject *__pyx_n_s_self; +static PyObject *__pyx_n_s_spawn_tree_locals; +static PyObject *__pyx_n_s_spawning_greenlet; +static PyObject *__pyx_kp_s_src_gevent__greenlet_primitives; +static PyObject *__pyx_n_s_switch; +static PyObject *__pyx_n_s_switch_out; +static PyObject *__pyx_n_s_test; +static PyObject *__pyx_n_s_weakref; +static PyObject *__pyx_n_s_wref; +static PyObject *__pyx_lambda_funcdef_6gevent_21__greenlet_primitives_lambda(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static int __pyx_pf_6gevent_21__greenlet_primitives_18TrackedRawGreenlet___init__(struct __pyx_obj_6gevent_21__greenlet_primitives_TrackedRawGreenlet *__pyx_v_self, PyObject *__pyx_v_function, PyObject *__pyx_v_parent); /* proto */ +static PyObject *__pyx_pf_6gevent_21__greenlet_primitives_25SwitchOutGreenletWithLoop_switch(struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_21__greenlet_primitives_25SwitchOutGreenletWithLoop_2switch_out(struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_21__greenlet_primitives_25SwitchOutGreenletWithLoop_4loop___get__(struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_21__greenlet_primitives_25SwitchOutGreenletWithLoop_4loop_2__set__(struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6gevent_21__greenlet_primitives_25SwitchOutGreenletWithLoop_4loop_4__del__(struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_21__greenlet_primitives_get_reachable_greenlets(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_6gevent_21__greenlet_primitives_2_init(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_tp_new_6gevent_21__greenlet_primitives_TrackedRawGreenlet(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tuple_; +static PyObject *__pyx_tuple__2; +static PyObject *__pyx_tuple__4; +static PyObject *__pyx_codeobj__3; +static PyObject *__pyx_codeobj__5; +static PyObject *__pyx_codeobj__6; +static PyObject *__pyx_codeobj__7; +/* Late includes */ + +/* "src/gevent/_greenlet_primitives.py":26 + * # error. + * locals()['getcurrent'] = __import__('greenlet').getcurrent + * locals()['greenlet_init'] = lambda: None # <<<<<<<<<<<<<< + * locals()['_greenlet_switch'] = greenlet.switch + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_21__greenlet_primitives_4lambda(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyMethodDef __pyx_mdef_6gevent_21__greenlet_primitives_4lambda = {"lambda", (PyCFunction)__pyx_pw_6gevent_21__greenlet_primitives_4lambda, METH_NOARGS, 0}; +static PyObject *__pyx_pw_6gevent_21__greenlet_primitives_4lambda(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("lambda (wrapper)", 0); + __pyx_r = __pyx_lambda_funcdef_6gevent_21__greenlet_primitives_lambda(__pyx_self); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_lambda_funcdef_6gevent_21__greenlet_primitives_lambda(CYTHON_UNUSED PyObject *__pyx_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("lambda", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_greenlet_primitives.py":36 + * class TrackedRawGreenlet(greenlet): + * + * def __init__(self, function, parent): # <<<<<<<<<<<<<< + * greenlet.__init__(self, function, parent) + * # See greenlet.py's Greenlet class. We capture the cheap + */ + +/* Python wrapper */ +static int __pyx_pw_6gevent_21__greenlet_primitives_18TrackedRawGreenlet_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6gevent_21__greenlet_primitives_18TrackedRawGreenlet_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_function = 0; + PyObject *__pyx_v_parent = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_function,&__pyx_n_s_parent,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_function)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_parent)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(0, 36, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 36, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_function = values[0]; + __pyx_v_parent = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 36, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.__greenlet_primitives.TrackedRawGreenlet.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_21__greenlet_primitives_18TrackedRawGreenlet___init__(((struct __pyx_obj_6gevent_21__greenlet_primitives_TrackedRawGreenlet *)__pyx_v_self), __pyx_v_function, __pyx_v_parent); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_21__greenlet_primitives_18TrackedRawGreenlet___init__(struct __pyx_obj_6gevent_21__greenlet_primitives_TrackedRawGreenlet *__pyx_v_self, PyObject *__pyx_v_function, PyObject *__pyx_v_parent) { + PyGreenlet *__pyx_v_current = NULL; + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + int __pyx_t_9; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "src/gevent/_greenlet_primitives.py":37 + * + * def __init__(self, function, parent): + * greenlet.__init__(self, function, parent) # <<<<<<<<<<<<<< + * # See greenlet.py's Greenlet class. We capture the cheap + * # parts to maintain the tree structure, but we do not capture + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_6gevent_21__greenlet_primitives_greenlet), __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 37, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + __pyx_t_4 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_4 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[4] = {__pyx_t_3, ((PyObject *)__pyx_v_self), __pyx_v_function, __pyx_v_parent}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 37, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[4] = {__pyx_t_3, ((PyObject *)__pyx_v_self), __pyx_v_function, __pyx_v_parent}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 37, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else + #endif + { + __pyx_t_5 = PyTuple_New(3+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 37, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (__pyx_t_3) { + __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL; + } + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, ((PyObject *)__pyx_v_self)); + __Pyx_INCREF(__pyx_v_function); + __Pyx_GIVEREF(__pyx_v_function); + PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_function); + __Pyx_INCREF(__pyx_v_parent); + __Pyx_GIVEREF(__pyx_v_parent); + PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_4, __pyx_v_parent); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 37, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_greenlet_primitives.py":42 + * # the stack because that's too expensive for 'spawn_raw'. + * + * current = getcurrent() # pylint:disable=undefined-variable # <<<<<<<<<<<<<< + * self.spawning_greenlet = wref(current) + * # See Greenlet for how trees are maintained. + */ + __pyx_t_1 = ((PyObject *)__pyx_f_6gevent_21__greenlet_primitives_getcurrent()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 42, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_current = ((PyGreenlet *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "src/gevent/_greenlet_primitives.py":43 + * + * current = getcurrent() # pylint:disable=undefined-variable + * self.spawning_greenlet = wref(current) # <<<<<<<<<<<<<< + * # See Greenlet for how trees are maintained. + * try: + */ + __Pyx_INCREF(__pyx_v_6gevent_21__greenlet_primitives_wref); + __pyx_t_2 = __pyx_v_6gevent_21__greenlet_primitives_wref; __pyx_t_5 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, ((PyObject *)__pyx_v_current)) : __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_v_current)); + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 43, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_spawning_greenlet, __pyx_t_1) < 0) __PYX_ERR(0, 43, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_greenlet_primitives.py":45 + * self.spawning_greenlet = wref(current) + * # See Greenlet for how trees are maintained. + * try: # <<<<<<<<<<<<<< + * self.spawn_tree_locals = current.spawn_tree_locals + * except AttributeError: + */ + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); + __Pyx_XGOTREF(__pyx_t_6); + __Pyx_XGOTREF(__pyx_t_7); + __Pyx_XGOTREF(__pyx_t_8); + /*try:*/ { + + /* "src/gevent/_greenlet_primitives.py":46 + * # See Greenlet for how trees are maintained. + * try: + * self.spawn_tree_locals = current.spawn_tree_locals # <<<<<<<<<<<<<< + * except AttributeError: + * self.spawn_tree_locals = {} + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_current), __pyx_n_s_spawn_tree_locals); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 46, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_1); + if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_spawn_tree_locals, __pyx_t_1) < 0) __PYX_ERR(0, 46, __pyx_L3_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_greenlet_primitives.py":45 + * self.spawning_greenlet = wref(current) + * # See Greenlet for how trees are maintained. + * try: # <<<<<<<<<<<<<< + * self.spawn_tree_locals = current.spawn_tree_locals + * except AttributeError: + */ + } + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + goto __pyx_L8_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_greenlet_primitives.py":47 + * try: + * self.spawn_tree_locals = current.spawn_tree_locals + * except AttributeError: # <<<<<<<<<<<<<< + * self.spawn_tree_locals = {} + * if current.parent: + */ + __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_AttributeError); + if (__pyx_t_4) { + __Pyx_AddTraceback("gevent.__greenlet_primitives.TrackedRawGreenlet.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_2, &__pyx_t_5) < 0) __PYX_ERR(0, 47, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_t_5); + + /* "src/gevent/_greenlet_primitives.py":48 + * self.spawn_tree_locals = current.spawn_tree_locals + * except AttributeError: + * self.spawn_tree_locals = {} # <<<<<<<<<<<<<< + * if current.parent: + * current.spawn_tree_locals = self.spawn_tree_locals + */ + __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 48, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_3); + if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_spawn_tree_locals, __pyx_t_3) < 0) __PYX_ERR(0, 48, __pyx_L5_except_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "src/gevent/_greenlet_primitives.py":49 + * except AttributeError: + * self.spawn_tree_locals = {} + * if current.parent: # <<<<<<<<<<<<<< + * current.spawn_tree_locals = self.spawn_tree_locals + * + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_current), __pyx_n_s_parent); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 49, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 49, __pyx_L5_except_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_9) { + + /* "src/gevent/_greenlet_primitives.py":50 + * self.spawn_tree_locals = {} + * if current.parent: + * current.spawn_tree_locals = self.spawn_tree_locals # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_spawn_tree_locals); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 50, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_3); + if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_current), __pyx_n_s_spawn_tree_locals, __pyx_t_3) < 0) __PYX_ERR(0, 50, __pyx_L5_except_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "src/gevent/_greenlet_primitives.py":49 + * except AttributeError: + * self.spawn_tree_locals = {} + * if current.parent: # <<<<<<<<<<<<<< + * current.spawn_tree_locals = self.spawn_tree_locals + * + */ + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + + /* "src/gevent/_greenlet_primitives.py":45 + * self.spawning_greenlet = wref(current) + * # See Greenlet for how trees are maintained. + * try: # <<<<<<<<<<<<<< + * self.spawn_tree_locals = current.spawn_tree_locals + * except AttributeError: + */ + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); + goto __pyx_L1_error; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); + __pyx_L8_try_end:; + } + + /* "src/gevent/_greenlet_primitives.py":36 + * class TrackedRawGreenlet(greenlet): + * + * def __init__(self, function, parent): # <<<<<<<<<<<<<< + * greenlet.__init__(self, function, parent) + * # See greenlet.py's Greenlet class. We capture the cheap + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("gevent.__greenlet_primitives.TrackedRawGreenlet.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_current); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_greenlet_primitives.py":60 + * # circular dependencies with the hub. + * + * def switch(self): # <<<<<<<<<<<<<< + * switch_out = getattr(getcurrent(), 'switch_out', None) # pylint:disable=undefined-variable + * if switch_out is not None: + */ + +static PyObject *__pyx_pw_6gevent_21__greenlet_primitives_25SwitchOutGreenletWithLoop_1switch(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_f_6gevent_21__greenlet_primitives_25SwitchOutGreenletWithLoop_switch(struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *__pyx_v_self, int __pyx_skip_dispatch) { + PyObject *__pyx_v_switch_out = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + int __pyx_t_6; + __Pyx_RefNannySetupContext("switch", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0; + if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self)))))); + else { + PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + #endif + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_switch); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 60, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_21__greenlet_primitives_25SwitchOutGreenletWithLoop_1switch)) { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 60, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0; + if (unlikely(type_dict_guard != tp_dict_version)) { + tp_dict_version = obj_dict_version = 0; + } + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + } + #endif + } + + /* "src/gevent/_greenlet_primitives.py":61 + * + * def switch(self): + * switch_out = getattr(getcurrent(), 'switch_out', None) # pylint:disable=undefined-variable # <<<<<<<<<<<<<< + * if switch_out is not None: + * switch_out() + */ + __pyx_t_1 = ((PyObject *)__pyx_f_6gevent_21__greenlet_primitives_getcurrent()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 61, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_GetAttr3(__pyx_t_1, __pyx_n_s_switch_out, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 61, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_switch_out = __pyx_t_2; + __pyx_t_2 = 0; + + /* "src/gevent/_greenlet_primitives.py":62 + * def switch(self): + * switch_out = getattr(getcurrent(), 'switch_out', None) # pylint:disable=undefined-variable + * if switch_out is not None: # <<<<<<<<<<<<<< + * switch_out() + * return _greenlet_switch(self) # pylint:disable=undefined-variable + */ + __pyx_t_5 = (__pyx_v_switch_out != Py_None); + __pyx_t_6 = (__pyx_t_5 != 0); + if (__pyx_t_6) { + + /* "src/gevent/_greenlet_primitives.py":63 + * switch_out = getattr(getcurrent(), 'switch_out', None) # pylint:disable=undefined-variable + * if switch_out is not None: + * switch_out() # <<<<<<<<<<<<<< + * return _greenlet_switch(self) # pylint:disable=undefined-variable + * + */ + __Pyx_INCREF(__pyx_v_switch_out); + __pyx_t_1 = __pyx_v_switch_out; __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_1, function); + } + } + __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 63, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/_greenlet_primitives.py":62 + * def switch(self): + * switch_out = getattr(getcurrent(), 'switch_out', None) # pylint:disable=undefined-variable + * if switch_out is not None: # <<<<<<<<<<<<<< + * switch_out() + * return _greenlet_switch(self) # pylint:disable=undefined-variable + */ + } + + /* "src/gevent/_greenlet_primitives.py":64 + * if switch_out is not None: + * switch_out() + * return _greenlet_switch(self) # pylint:disable=undefined-variable # <<<<<<<<<<<<<< + * + * def switch_out(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __pyx_f_6gevent_21__greenlet_primitives__greenlet_switch(((PyGreenlet *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 64, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "src/gevent/_greenlet_primitives.py":60 + * # circular dependencies with the hub. + * + * def switch(self): # <<<<<<<<<<<<<< + * switch_out = getattr(getcurrent(), 'switch_out', None) # pylint:disable=undefined-variable + * if switch_out is not None: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("gevent.__greenlet_primitives.SwitchOutGreenletWithLoop.switch", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_switch_out); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_21__greenlet_primitives_25SwitchOutGreenletWithLoop_1switch(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6gevent_21__greenlet_primitives_25SwitchOutGreenletWithLoop_switch[] = "SwitchOutGreenletWithLoop.switch(self)"; +static PyMethodDef __pyx_mdef_6gevent_21__greenlet_primitives_25SwitchOutGreenletWithLoop_1switch = {"switch", (PyCFunction)__pyx_pw_6gevent_21__greenlet_primitives_25SwitchOutGreenletWithLoop_1switch, METH_NOARGS, __pyx_doc_6gevent_21__greenlet_primitives_25SwitchOutGreenletWithLoop_switch}; +static PyObject *__pyx_pw_6gevent_21__greenlet_primitives_25SwitchOutGreenletWithLoop_1switch(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("switch (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_21__greenlet_primitives_25SwitchOutGreenletWithLoop_switch(((struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_21__greenlet_primitives_25SwitchOutGreenletWithLoop_switch(struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("switch", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6gevent_21__greenlet_primitives_25SwitchOutGreenletWithLoop_switch(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 60, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__greenlet_primitives.SwitchOutGreenletWithLoop.switch", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_greenlet_primitives.py":66 + * return _greenlet_switch(self) # pylint:disable=undefined-variable + * + * def switch_out(self): # <<<<<<<<<<<<<< + * raise BlockingSwitchOutError('Impossible to call blocking function in the event loop callback') + * + */ + +static PyObject *__pyx_pw_6gevent_21__greenlet_primitives_25SwitchOutGreenletWithLoop_3switch_out(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_f_6gevent_21__greenlet_primitives_25SwitchOutGreenletWithLoop_switch_out(CYTHON_UNUSED struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *__pyx_v_self, int __pyx_skip_dispatch) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + __Pyx_RefNannySetupContext("switch_out", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0; + if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self)))))); + else { + PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + #endif + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_switch_out); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 66, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_21__greenlet_primitives_25SwitchOutGreenletWithLoop_3switch_out)) { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 66, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0; + if (unlikely(type_dict_guard != tp_dict_version)) { + tp_dict_version = obj_dict_version = 0; + } + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + } + #endif + } + + /* "src/gevent/_greenlet_primitives.py":67 + * + * def switch_out(self): + * raise BlockingSwitchOutError('Impossible to call blocking function in the event loop callback') # <<<<<<<<<<<<<< + * + * + */ + __Pyx_INCREF(__pyx_v_6gevent_21__greenlet_primitives_BlockingSwitchOutError); + __pyx_t_2 = __pyx_v_6gevent_21__greenlet_primitives_BlockingSwitchOutError; __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_kp_s_Impossible_to_call_blocking_func) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_kp_s_Impossible_to_call_blocking_func); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 67, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 67, __pyx_L1_error) + + /* "src/gevent/_greenlet_primitives.py":66 + * return _greenlet_switch(self) # pylint:disable=undefined-variable + * + * def switch_out(self): # <<<<<<<<<<<<<< + * raise BlockingSwitchOutError('Impossible to call blocking function in the event loop callback') + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("gevent.__greenlet_primitives.SwitchOutGreenletWithLoop.switch_out", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_21__greenlet_primitives_25SwitchOutGreenletWithLoop_3switch_out(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6gevent_21__greenlet_primitives_25SwitchOutGreenletWithLoop_2switch_out[] = "SwitchOutGreenletWithLoop.switch_out(self)"; +static PyMethodDef __pyx_mdef_6gevent_21__greenlet_primitives_25SwitchOutGreenletWithLoop_3switch_out = {"switch_out", (PyCFunction)__pyx_pw_6gevent_21__greenlet_primitives_25SwitchOutGreenletWithLoop_3switch_out, METH_NOARGS, __pyx_doc_6gevent_21__greenlet_primitives_25SwitchOutGreenletWithLoop_2switch_out}; +static PyObject *__pyx_pw_6gevent_21__greenlet_primitives_25SwitchOutGreenletWithLoop_3switch_out(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("switch_out (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_21__greenlet_primitives_25SwitchOutGreenletWithLoop_2switch_out(((struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_21__greenlet_primitives_25SwitchOutGreenletWithLoop_2switch_out(struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("switch_out", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6gevent_21__greenlet_primitives_25SwitchOutGreenletWithLoop_switch_out(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 66, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__greenlet_primitives.SwitchOutGreenletWithLoop.switch_out", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/__greenlet_primitives.pxd":41 + * + * cdef class SwitchOutGreenletWithLoop(TrackedRawGreenlet): + * cdef public loop # <<<<<<<<<<<<<< + * + * cpdef switch(self) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_21__greenlet_primitives_25SwitchOutGreenletWithLoop_4loop_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_21__greenlet_primitives_25SwitchOutGreenletWithLoop_4loop_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_21__greenlet_primitives_25SwitchOutGreenletWithLoop_4loop___get__(((struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_21__greenlet_primitives_25SwitchOutGreenletWithLoop_4loop___get__(struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->loop); + __pyx_r = __pyx_v_self->loop; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6gevent_21__greenlet_primitives_25SwitchOutGreenletWithLoop_4loop_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6gevent_21__greenlet_primitives_25SwitchOutGreenletWithLoop_4loop_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_21__greenlet_primitives_25SwitchOutGreenletWithLoop_4loop_2__set__(((struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_21__greenlet_primitives_25SwitchOutGreenletWithLoop_4loop_2__set__(struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__", 0); + __Pyx_INCREF(__pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + __Pyx_GOTREF(__pyx_v_self->loop); + __Pyx_DECREF(__pyx_v_self->loop); + __pyx_v_self->loop = __pyx_v_value; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6gevent_21__greenlet_primitives_25SwitchOutGreenletWithLoop_4loop_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6gevent_21__greenlet_primitives_25SwitchOutGreenletWithLoop_4loop_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_21__greenlet_primitives_25SwitchOutGreenletWithLoop_4loop_4__del__(((struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_21__greenlet_primitives_25SwitchOutGreenletWithLoop_4loop_4__del__(struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->loop); + __Pyx_DECREF(__pyx_v_self->loop); + __pyx_v_self->loop = Py_None; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_greenlet_primitives.py":70 + * + * + * def get_reachable_greenlets(): # <<<<<<<<<<<<<< + * # We compile this loop with Cython so that it's faster, and so that + * # the GIL isn't dropped at unpredictable times during the loop. + */ + +static PyObject *__pyx_pw_6gevent_21__greenlet_primitives_1get_reachable_greenlets(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_f_6gevent_21__greenlet_primitives_get_reachable_greenlets(CYTHON_UNUSED int __pyx_skip_dispatch) { + PyObject *__pyx_7genexpr__pyx_v_x = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + Py_ssize_t __pyx_t_5; + PyObject *(*__pyx_t_6)(PyObject *); + int __pyx_t_7; + int __pyx_t_8; + int __pyx_t_9; + __Pyx_RefNannySetupContext("get_reachable_greenlets", 0); + + /* "src/gevent/_greenlet_primitives.py":79 + * # if other threads have dropped the GIL, but hopefully the speed makes that + * # more rare.) See https://github.com/gevent/gevent/issues/1302 + * return [ # <<<<<<<<<<<<<< + * x for x in get_objects() + * if isinstance(x, greenlet) and not getattr(x, 'greenlet_tree_is_ignored', False) + */ + __Pyx_XDECREF(__pyx_r); + { /* enter inner scope */ + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 79, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_1); + + /* "src/gevent/_greenlet_primitives.py":80 + * # more rare.) See https://github.com/gevent/gevent/issues/1302 + * return [ + * x for x in get_objects() # <<<<<<<<<<<<<< + * if isinstance(x, greenlet) and not getattr(x, 'greenlet_tree_is_ignored', False) + * ] + */ + __Pyx_INCREF(__pyx_v_6gevent_21__greenlet_primitives_get_objects); + __pyx_t_3 = __pyx_v_6gevent_21__greenlet_primitives_get_objects; __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 80, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) { + __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3); __pyx_t_5 = 0; + __pyx_t_6 = NULL; + } else { + __pyx_t_5 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 80, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_6 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 80, __pyx_L5_error) + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + for (;;) { + if (likely(!__pyx_t_6)) { + if (likely(PyList_CheckExact(__pyx_t_3))) { + if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 80, __pyx_L5_error) + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 80, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_2); + #endif + } else { + if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 80, __pyx_L5_error) + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 80, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_2); + #endif + } + } else { + __pyx_t_2 = __pyx_t_6(__pyx_t_3); + if (unlikely(!__pyx_t_2)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(0, 80, __pyx_L5_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_2); + } + __Pyx_XDECREF_SET(__pyx_7genexpr__pyx_v_x, __pyx_t_2); + __pyx_t_2 = 0; + + /* "src/gevent/_greenlet_primitives.py":81 + * return [ + * x for x in get_objects() + * if isinstance(x, greenlet) and not getattr(x, 'greenlet_tree_is_ignored', False) # <<<<<<<<<<<<<< + * ] + * + */ + __pyx_t_8 = __Pyx_TypeCheck(__pyx_7genexpr__pyx_v_x, __pyx_ptype_6gevent_21__greenlet_primitives_greenlet); + __pyx_t_9 = (__pyx_t_8 != 0); + if (__pyx_t_9) { + } else { + __pyx_t_7 = __pyx_t_9; + goto __pyx_L9_bool_binop_done; + } + __pyx_t_2 = __Pyx_GetAttr3(__pyx_7genexpr__pyx_v_x, __pyx_n_s_greenlet_tree_is_ignored, Py_False); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 81, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 81, __pyx_L5_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_8 = ((!__pyx_t_9) != 0); + __pyx_t_7 = __pyx_t_8; + __pyx_L9_bool_binop_done:; + if (__pyx_t_7) { + + /* "src/gevent/_greenlet_primitives.py":80 + * # more rare.) See https://github.com/gevent/gevent/issues/1302 + * return [ + * x for x in get_objects() # <<<<<<<<<<<<<< + * if isinstance(x, greenlet) and not getattr(x, 'greenlet_tree_is_ignored', False) + * ] + */ + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_7genexpr__pyx_v_x))) __PYX_ERR(0, 79, __pyx_L5_error) + + /* "src/gevent/_greenlet_primitives.py":81 + * return [ + * x for x in get_objects() + * if isinstance(x, greenlet) and not getattr(x, 'greenlet_tree_is_ignored', False) # <<<<<<<<<<<<<< + * ] + * + */ + } + + /* "src/gevent/_greenlet_primitives.py":80 + * # more rare.) See https://github.com/gevent/gevent/issues/1302 + * return [ + * x for x in get_objects() # <<<<<<<<<<<<<< + * if isinstance(x, greenlet) and not getattr(x, 'greenlet_tree_is_ignored', False) + * ] + */ + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_7genexpr__pyx_v_x); __pyx_7genexpr__pyx_v_x = 0; + goto __pyx_L11_exit_scope; + __pyx_L5_error:; + __Pyx_XDECREF(__pyx_7genexpr__pyx_v_x); __pyx_7genexpr__pyx_v_x = 0; + goto __pyx_L1_error; + __pyx_L11_exit_scope:; + } /* exit inner scope */ + __pyx_r = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "src/gevent/_greenlet_primitives.py":70 + * + * + * def get_reachable_greenlets(): # <<<<<<<<<<<<<< + * # We compile this loop with Cython so that it's faster, and so that + * # the GIL isn't dropped at unpredictable times during the loop. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("gevent.__greenlet_primitives.get_reachable_greenlets", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_7genexpr__pyx_v_x); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_21__greenlet_primitives_1get_reachable_greenlets(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6gevent_21__greenlet_primitives_get_reachable_greenlets[] = "get_reachable_greenlets() -> list"; +static PyMethodDef __pyx_mdef_6gevent_21__greenlet_primitives_1get_reachable_greenlets = {"get_reachable_greenlets", (PyCFunction)__pyx_pw_6gevent_21__greenlet_primitives_1get_reachable_greenlets, METH_NOARGS, __pyx_doc_6gevent_21__greenlet_primitives_get_reachable_greenlets}; +static PyObject *__pyx_pw_6gevent_21__greenlet_primitives_1get_reachable_greenlets(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get_reachable_greenlets (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_21__greenlet_primitives_get_reachable_greenlets(__pyx_self); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_21__greenlet_primitives_get_reachable_greenlets(CYTHON_UNUSED PyObject *__pyx_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("get_reachable_greenlets", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6gevent_21__greenlet_primitives_get_reachable_greenlets(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 70, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__greenlet_primitives.get_reachable_greenlets", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_greenlet_primitives.py":84 + * ] + * + * def _init(): # <<<<<<<<<<<<<< + * greenlet_init() # pylint:disable=undefined-variable + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_21__greenlet_primitives_3_init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6gevent_21__greenlet_primitives_2_init[] = "_init()"; +static PyMethodDef __pyx_mdef_6gevent_21__greenlet_primitives_3_init = {"_init", (PyCFunction)__pyx_pw_6gevent_21__greenlet_primitives_3_init, METH_NOARGS, __pyx_doc_6gevent_21__greenlet_primitives_2_init}; +static PyObject *__pyx_pw_6gevent_21__greenlet_primitives_3_init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_init (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_21__greenlet_primitives_2_init(__pyx_self); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_21__greenlet_primitives_2_init(CYTHON_UNUSED PyObject *__pyx_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_init", 0); + + /* "src/gevent/_greenlet_primitives.py":85 + * + * def _init(): + * greenlet_init() # pylint:disable=undefined-variable # <<<<<<<<<<<<<< + * + * _init() + */ + __pyx_f_6gevent_21__greenlet_primitives_greenlet_init(); + + /* "src/gevent/_greenlet_primitives.py":84 + * ] + * + * def _init(): # <<<<<<<<<<<<<< + * greenlet_init() # pylint:disable=undefined-variable + * + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/__greenlet_primitives.pxd":23 + * + * @cython.final + * cdef inline greenlet getcurrent(): # <<<<<<<<<<<<<< + * return PyGreenlet_GetCurrent() + * + */ + +static CYTHON_INLINE PyGreenlet *__pyx_f_6gevent_21__greenlet_primitives_getcurrent(void) { + PyGreenlet *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("getcurrent", 0); + + /* "gevent/__greenlet_primitives.pxd":24 + * @cython.final + * cdef inline greenlet getcurrent(): + * return PyGreenlet_GetCurrent() # <<<<<<<<<<<<<< + * + * cdef bint _greenlet_imported + */ + __Pyx_XDECREF(((PyObject *)__pyx_r)); + __pyx_t_1 = ((PyObject *)PyGreenlet_GetCurrent()); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 24, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = ((PyGreenlet *)__pyx_t_1); + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "gevent/__greenlet_primitives.pxd":23 + * + * @cython.final + * cdef inline greenlet getcurrent(): # <<<<<<<<<<<<<< + * return PyGreenlet_GetCurrent() + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__greenlet_primitives.getcurrent", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF((PyObject *)__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/__greenlet_primitives.pxd":28 + * cdef bint _greenlet_imported + * + * cdef inline void greenlet_init(): # <<<<<<<<<<<<<< + * global _greenlet_imported + * if not _greenlet_imported: + */ + +static CYTHON_INLINE void __pyx_f_6gevent_21__greenlet_primitives_greenlet_init(void) { + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("greenlet_init", 0); + + /* "gevent/__greenlet_primitives.pxd":30 + * cdef inline void greenlet_init(): + * global _greenlet_imported + * if not _greenlet_imported: # <<<<<<<<<<<<<< + * PyGreenlet_Import() + * _greenlet_imported = True + */ + __pyx_t_1 = ((!(__pyx_v_6gevent_21__greenlet_primitives__greenlet_imported != 0)) != 0); + if (__pyx_t_1) { + + /* "gevent/__greenlet_primitives.pxd":31 + * global _greenlet_imported + * if not _greenlet_imported: + * PyGreenlet_Import() # <<<<<<<<<<<<<< + * _greenlet_imported = True + * + */ + PyGreenlet_Import(); + + /* "gevent/__greenlet_primitives.pxd":32 + * if not _greenlet_imported: + * PyGreenlet_Import() + * _greenlet_imported = True # <<<<<<<<<<<<<< + * + * cdef inline object _greenlet_switch(greenlet self): + */ + __pyx_v_6gevent_21__greenlet_primitives__greenlet_imported = 1; + + /* "gevent/__greenlet_primitives.pxd":30 + * cdef inline void greenlet_init(): + * global _greenlet_imported + * if not _greenlet_imported: # <<<<<<<<<<<<<< + * PyGreenlet_Import() + * _greenlet_imported = True + */ + } + + /* "gevent/__greenlet_primitives.pxd":28 + * cdef bint _greenlet_imported + * + * cdef inline void greenlet_init(): # <<<<<<<<<<<<<< + * global _greenlet_imported + * if not _greenlet_imported: + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "gevent/__greenlet_primitives.pxd":34 + * _greenlet_imported = True + * + * cdef inline object _greenlet_switch(greenlet self): # <<<<<<<<<<<<<< + * return PyGreenlet_Switch(self, NULL, NULL) + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_6gevent_21__greenlet_primitives__greenlet_switch(PyGreenlet *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("_greenlet_switch", 0); + + /* "gevent/__greenlet_primitives.pxd":35 + * + * cdef inline object _greenlet_switch(greenlet self): + * return PyGreenlet_Switch(self, NULL, NULL) # <<<<<<<<<<<<<< + * + * cdef class TrackedRawGreenlet(greenlet): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyGreenlet_Switch(__pyx_v_self, NULL, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 35, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "gevent/__greenlet_primitives.pxd":34 + * _greenlet_imported = True + * + * cdef inline object _greenlet_switch(greenlet self): # <<<<<<<<<<<<<< + * return PyGreenlet_Switch(self, NULL, NULL) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__greenlet_primitives._greenlet_switch", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_tp_new_6gevent_21__greenlet_primitives_TrackedRawGreenlet(PyTypeObject *t, PyObject *a, PyObject *k) { + PyObject *o = __pyx_ptype_6gevent_21__greenlet_primitives_greenlet->tp_new(t, a, k); + if (unlikely(!o)) return 0; + return o; +} + +static PyMethodDef __pyx_methods_6gevent_21__greenlet_primitives_TrackedRawGreenlet[] = { + {0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_6gevent_21__greenlet_primitives_TrackedRawGreenlet = { + PyVarObject_HEAD_INIT(0, 0) + "gevent.__greenlet_primitives.TrackedRawGreenlet", /*tp_name*/ + sizeof(struct __pyx_obj_6gevent_21__greenlet_primitives_TrackedRawGreenlet), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + 0, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ + "TrackedRawGreenlet(function, parent)", /*tp_doc*/ + 0, /*tp_traverse*/ + 0, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6gevent_21__greenlet_primitives_TrackedRawGreenlet, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_pw_6gevent_21__greenlet_primitives_18TrackedRawGreenlet_1__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6gevent_21__greenlet_primitives_TrackedRawGreenlet, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; +static struct __pyx_vtabstruct_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop __pyx_vtable_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop; + +static PyObject *__pyx_tp_new_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *p; + PyObject *o = __pyx_tp_new_6gevent_21__greenlet_primitives_TrackedRawGreenlet(t, a, k); + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *)o); + p->__pyx_vtab = __pyx_vtabptr_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop; + p->loop = Py_None; Py_INCREF(Py_None); + return o; +} + +static void __pyx_tp_dealloc_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop(PyObject *o) { + struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *p = (struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *)o; + #if CYTHON_USE_TP_FINALIZE + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + PyObject_GC_UnTrack(o); + Py_CLEAR(p->loop); + #if CYTHON_USE_TYPE_SLOTS + if (PyType_IS_GC(Py_TYPE(o)->tp_base)) + #endif + PyObject_GC_Track(o); + if (likely(__pyx_ptype_6gevent_21__greenlet_primitives_TrackedRawGreenlet)) __pyx_ptype_6gevent_21__greenlet_primitives_TrackedRawGreenlet->tp_dealloc(o); else __Pyx_call_next_tp_dealloc(o, __pyx_tp_dealloc_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop); +} + +static int __pyx_tp_traverse_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *p = (struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *)o; + e = ((likely(__pyx_ptype_6gevent_21__greenlet_primitives_TrackedRawGreenlet)) ? ((__pyx_ptype_6gevent_21__greenlet_primitives_TrackedRawGreenlet->tp_traverse) ? __pyx_ptype_6gevent_21__greenlet_primitives_TrackedRawGreenlet->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop)); if (e) return e; + if (p->loop) { + e = (*v)(p->loop, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *p = (struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *)o; + if (likely(__pyx_ptype_6gevent_21__greenlet_primitives_TrackedRawGreenlet)) { if (__pyx_ptype_6gevent_21__greenlet_primitives_TrackedRawGreenlet->tp_clear) __pyx_ptype_6gevent_21__greenlet_primitives_TrackedRawGreenlet->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop); + tmp = ((PyObject*)p->loop); + p->loop = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyObject *__pyx_getprop_6gevent_21__greenlet_primitives_25SwitchOutGreenletWithLoop_loop(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_21__greenlet_primitives_25SwitchOutGreenletWithLoop_4loop_1__get__(o); +} + +static int __pyx_setprop_6gevent_21__greenlet_primitives_25SwitchOutGreenletWithLoop_loop(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6gevent_21__greenlet_primitives_25SwitchOutGreenletWithLoop_4loop_3__set__(o, v); + } + else { + return __pyx_pw_6gevent_21__greenlet_primitives_25SwitchOutGreenletWithLoop_4loop_5__del__(o); + } +} + +static PyMethodDef __pyx_methods_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop[] = { + {0, 0, 0, 0} +}; + +static struct PyGetSetDef __pyx_getsets_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop[] = { + {(char *)"loop", __pyx_getprop_6gevent_21__greenlet_primitives_25SwitchOutGreenletWithLoop_loop, __pyx_setprop_6gevent_21__greenlet_primitives_25SwitchOutGreenletWithLoop_loop, (char *)"loop: object", 0}, + {0, 0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop = { + PyVarObject_HEAD_INIT(0, 0) + "gevent.__greenlet_primitives.SwitchOutGreenletWithLoop", /*tp_name*/ + sizeof(struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop, /*tp_traverse*/ + __pyx_tp_clear_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop, /*tp_methods*/ + 0, /*tp_members*/ + __pyx_getsets_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_6gevent_21__greenlet_primitives_18TrackedRawGreenlet_1__init__, /*tp_init*/ + #else + 0, /*tp_init*/ + #endif + 0, /*tp_alloc*/ + __pyx_tp_new_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static PyMethodDef __pyx_methods[] = { + {0, 0, 0, 0} +}; + +#if PY_MAJOR_VERSION >= 3 +#if CYTHON_PEP489_MULTI_PHASE_INIT +static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ +static int __pyx_pymod_exec___greenlet_primitives(PyObject* module); /*proto*/ +static PyModuleDef_Slot __pyx_moduledef_slots[] = { + {Py_mod_create, (void*)__pyx_pymod_create}, + {Py_mod_exec, (void*)__pyx_pymod_exec___greenlet_primitives}, + {0, NULL} +}; +#endif + +static struct PyModuleDef __pyx_moduledef = { + PyModuleDef_HEAD_INIT, + "__greenlet_primitives", + __pyx_k_A_collection_of_primitives_used, /* m_doc */ + #if CYTHON_PEP489_MULTI_PHASE_INIT + 0, /* m_size */ + #else + -1, /* m_size */ + #endif + __pyx_methods /* m_methods */, + #if CYTHON_PEP489_MULTI_PHASE_INIT + __pyx_moduledef_slots, /* m_slots */ + #else + NULL, /* m_reload */ + #endif + NULL, /* m_traverse */ + NULL, /* m_clear */ + NULL /* m_free */ +}; +#endif +#ifndef CYTHON_SMALL_CODE +#if defined(__clang__) + #define CYTHON_SMALL_CODE +#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) + #define CYTHON_SMALL_CODE __attribute__((cold)) +#else + #define CYTHON_SMALL_CODE +#endif +#endif + +static __Pyx_StringTabEntry __pyx_string_tab[] = { + {&__pyx_n_s_AttributeError, __pyx_k_AttributeError, sizeof(__pyx_k_AttributeError), 0, 0, 1, 1}, + {&__pyx_n_s_BlockingSwitchOutError, __pyx_k_BlockingSwitchOutError, sizeof(__pyx_k_BlockingSwitchOutError), 0, 0, 1, 1}, + {&__pyx_kp_s_Impossible_to_call_blocking_func, __pyx_k_Impossible_to_call_blocking_func, sizeof(__pyx_k_Impossible_to_call_blocking_func), 0, 0, 1, 0}, + {&__pyx_n_s_SwitchOutGreenletWithLoop, __pyx_k_SwitchOutGreenletWithLoop, sizeof(__pyx_k_SwitchOutGreenletWithLoop), 0, 0, 1, 1}, + {&__pyx_n_s_SwitchOutGreenletWithLoop_switch, __pyx_k_SwitchOutGreenletWithLoop_switch, sizeof(__pyx_k_SwitchOutGreenletWithLoop_switch), 0, 0, 1, 1}, + {&__pyx_n_s_SwitchOutGreenletWithLoop_switch_2, __pyx_k_SwitchOutGreenletWithLoop_switch_2, sizeof(__pyx_k_SwitchOutGreenletWithLoop_switch_2), 0, 0, 1, 1}, + {&__pyx_n_s_TrackedRawGreenlet, __pyx_k_TrackedRawGreenlet, sizeof(__pyx_k_TrackedRawGreenlet), 0, 0, 1, 1}, + {&__pyx_n_s_all, __pyx_k_all, sizeof(__pyx_k_all), 0, 0, 1, 1}, + {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, + {&__pyx_n_s_function, __pyx_k_function, sizeof(__pyx_k_function), 0, 0, 1, 1}, + {&__pyx_n_s_gc, __pyx_k_gc, sizeof(__pyx_k_gc), 0, 0, 1, 1}, + {&__pyx_n_s_get_objects, __pyx_k_get_objects, sizeof(__pyx_k_get_objects), 0, 0, 1, 1}, + {&__pyx_n_s_get_reachable_greenlets, __pyx_k_get_reachable_greenlets, sizeof(__pyx_k_get_reachable_greenlets), 0, 0, 1, 1}, + {&__pyx_n_s_getcurrent, __pyx_k_getcurrent, sizeof(__pyx_k_getcurrent), 0, 0, 1, 1}, + {&__pyx_n_s_gevent___greenlet_primitives, __pyx_k_gevent___greenlet_primitives, sizeof(__pyx_k_gevent___greenlet_primitives), 0, 0, 1, 1}, + {&__pyx_n_s_gevent__util, __pyx_k_gevent__util, sizeof(__pyx_k_gevent__util), 0, 0, 1, 1}, + {&__pyx_n_s_gevent_exceptions, __pyx_k_gevent_exceptions, sizeof(__pyx_k_gevent_exceptions), 0, 0, 1, 1}, + {&__pyx_n_s_greenlet, __pyx_k_greenlet, sizeof(__pyx_k_greenlet), 0, 0, 1, 1}, + {&__pyx_n_s_greenlet_imported, __pyx_k_greenlet_imported, sizeof(__pyx_k_greenlet_imported), 0, 0, 1, 1}, + {&__pyx_n_s_greenlet_init, __pyx_k_greenlet_init, sizeof(__pyx_k_greenlet_init), 0, 0, 1, 1}, + {&__pyx_n_s_greenlet_switch, __pyx_k_greenlet_switch, sizeof(__pyx_k_greenlet_switch), 0, 0, 1, 1}, + {&__pyx_n_s_greenlet_tree_is_ignored, __pyx_k_greenlet_tree_is_ignored, sizeof(__pyx_k_greenlet_tree_is_ignored), 0, 0, 1, 1}, + {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, + {&__pyx_n_s_import_c_accel, __pyx_k_import_c_accel, sizeof(__pyx_k_import_c_accel), 0, 0, 1, 1}, + {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1}, + {&__pyx_n_s_init_2, __pyx_k_init_2, sizeof(__pyx_k_init_2), 0, 0, 1, 1}, + {&__pyx_n_s_lambda, __pyx_k_lambda, sizeof(__pyx_k_lambda), 0, 0, 1, 1}, + {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, + {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, + {&__pyx_n_s_parent, __pyx_k_parent, sizeof(__pyx_k_parent), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_capi, __pyx_k_pyx_capi, sizeof(__pyx_k_pyx_capi), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1}, + {&__pyx_n_s_ref, __pyx_k_ref, sizeof(__pyx_k_ref), 0, 0, 1, 1}, + {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1}, + {&__pyx_n_s_spawn_tree_locals, __pyx_k_spawn_tree_locals, sizeof(__pyx_k_spawn_tree_locals), 0, 0, 1, 1}, + {&__pyx_n_s_spawning_greenlet, __pyx_k_spawning_greenlet, sizeof(__pyx_k_spawning_greenlet), 0, 0, 1, 1}, + {&__pyx_kp_s_src_gevent__greenlet_primitives, __pyx_k_src_gevent__greenlet_primitives, sizeof(__pyx_k_src_gevent__greenlet_primitives), 0, 0, 1, 0}, + {&__pyx_n_s_switch, __pyx_k_switch, sizeof(__pyx_k_switch), 0, 0, 1, 1}, + {&__pyx_n_s_switch_out, __pyx_k_switch_out, sizeof(__pyx_k_switch_out), 0, 0, 1, 1}, + {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, + {&__pyx_n_s_weakref, __pyx_k_weakref, sizeof(__pyx_k_weakref), 0, 0, 1, 1}, + {&__pyx_n_s_wref, __pyx_k_wref, sizeof(__pyx_k_wref), 0, 0, 1, 1}, + {0, 0, 0, 0, 0, 0, 0} +}; +static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { + __pyx_builtin___import__ = __Pyx_GetBuiltinName(__pyx_n_s_import); if (!__pyx_builtin___import__) __PYX_ERR(0, 25, __pyx_L1_error) + __pyx_builtin_AttributeError = __Pyx_GetBuiltinName(__pyx_n_s_AttributeError); if (!__pyx_builtin_AttributeError) __PYX_ERR(0, 47, __pyx_L1_error) + return 0; + __pyx_L1_error:; + return -1; +} + +static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); + + /* "src/gevent/_greenlet_primitives.py":25 + * # is assignment) without generating a 'lvalue is not valid target' + * # error. + * locals()['getcurrent'] = __import__('greenlet').getcurrent # <<<<<<<<<<<<<< + * locals()['greenlet_init'] = lambda: None + * locals()['_greenlet_switch'] = greenlet.switch + */ + __pyx_tuple_ = PyTuple_Pack(1, __pyx_n_s_greenlet); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 25, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple_); + __Pyx_GIVEREF(__pyx_tuple_); + + /* "src/gevent/_greenlet_primitives.py":60 + * # circular dependencies with the hub. + * + * def switch(self): # <<<<<<<<<<<<<< + * switch_out = getattr(getcurrent(), 'switch_out', None) # pylint:disable=undefined-variable + * if switch_out is not None: + */ + __pyx_tuple__2 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 60, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2); + __Pyx_GIVEREF(__pyx_tuple__2); + __pyx_codeobj__3 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__greenlet_primitives, __pyx_n_s_switch, 60, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__3)) __PYX_ERR(0, 60, __pyx_L1_error) + + /* "src/gevent/_greenlet_primitives.py":66 + * return _greenlet_switch(self) # pylint:disable=undefined-variable + * + * def switch_out(self): # <<<<<<<<<<<<<< + * raise BlockingSwitchOutError('Impossible to call blocking function in the event loop callback') + * + */ + __pyx_tuple__4 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 66, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__4); + __Pyx_GIVEREF(__pyx_tuple__4); + __pyx_codeobj__5 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__4, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__greenlet_primitives, __pyx_n_s_switch_out, 66, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__5)) __PYX_ERR(0, 66, __pyx_L1_error) + + /* "src/gevent/_greenlet_primitives.py":70 + * + * + * def get_reachable_greenlets(): # <<<<<<<<<<<<<< + * # We compile this loop with Cython so that it's faster, and so that + * # the GIL isn't dropped at unpredictable times during the loop. + */ + __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__greenlet_primitives, __pyx_n_s_get_reachable_greenlets, 70, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__6)) __PYX_ERR(0, 70, __pyx_L1_error) + + /* "src/gevent/_greenlet_primitives.py":84 + * ] + * + * def _init(): # <<<<<<<<<<<<<< + * greenlet_init() # pylint:disable=undefined-variable + * + */ + __pyx_codeobj__7 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__greenlet_primitives, __pyx_n_s_init_2, 84, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__7)) __PYX_ERR(0, 84, __pyx_L1_error) + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} + +static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { + if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + return 0; + __pyx_L1_error:; + return -1; +} + +static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/ + +static int __Pyx_modinit_global_init_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); + /*--- Global init code ---*/ + __pyx_v_6gevent_21__greenlet_primitives_get_objects = Py_None; Py_INCREF(Py_None); + __pyx_v_6gevent_21__greenlet_primitives_wref = Py_None; Py_INCREF(Py_None); + __pyx_v_6gevent_21__greenlet_primitives_BlockingSwitchOutError = Py_None; Py_INCREF(Py_None); + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_variable_export_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); + /*--- Variable export code ---*/ + if (__Pyx_ExportVoidPtr(__pyx_n_s_get_objects, (void *)&__pyx_v_6gevent_21__greenlet_primitives_get_objects, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportVoidPtr(__pyx_n_s_wref, (void *)&__pyx_v_6gevent_21__greenlet_primitives_wref, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportVoidPtr(__pyx_n_s_BlockingSwitchOutError, (void *)&__pyx_v_6gevent_21__greenlet_primitives_BlockingSwitchOutError, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportVoidPtr(__pyx_n_s_greenlet_imported, (void *)&__pyx_v_6gevent_21__greenlet_primitives__greenlet_imported, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_modinit_function_export_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); + /*--- Function export code ---*/ + if (__Pyx_ExportFunction("get_reachable_greenlets", (void (*)(void))__pyx_f_6gevent_21__greenlet_primitives_get_reachable_greenlets, "PyObject *(int __pyx_skip_dispatch)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_modinit_type_init_code(void) { + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); + /*--- Type init code ---*/ + __pyx_t_1 = PyImport_ImportModule("greenlet"); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_ptype_6gevent_21__greenlet_primitives_greenlet = __Pyx_ImportType(__pyx_t_1, "greenlet", "greenlet", sizeof(PyGreenlet), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_21__greenlet_primitives_greenlet) __PYX_ERR(1, 12, __pyx_L1_error) + __pyx_type_6gevent_21__greenlet_primitives_TrackedRawGreenlet.tp_base = __pyx_ptype_6gevent_21__greenlet_primitives_greenlet; + if (PyType_Ready(&__pyx_type_6gevent_21__greenlet_primitives_TrackedRawGreenlet) < 0) __PYX_ERR(0, 34, __pyx_L1_error) + __pyx_type_6gevent_21__greenlet_primitives_TrackedRawGreenlet.tp_print = 0; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6gevent_21__greenlet_primitives_TrackedRawGreenlet.tp_dictoffset && __pyx_type_6gevent_21__greenlet_primitives_TrackedRawGreenlet.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_type_6gevent_21__greenlet_primitives_TrackedRawGreenlet.tp_getattro = __Pyx_PyObject_GenericGetAttr; + } + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_TrackedRawGreenlet, (PyObject *)&__pyx_type_6gevent_21__greenlet_primitives_TrackedRawGreenlet) < 0) __PYX_ERR(0, 34, __pyx_L1_error) + __pyx_ptype_6gevent_21__greenlet_primitives_TrackedRawGreenlet = &__pyx_type_6gevent_21__greenlet_primitives_TrackedRawGreenlet; + __pyx_vtabptr_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop = &__pyx_vtable_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop; + __pyx_vtable_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop.__pyx_switch = (PyObject *(*)(struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *, int __pyx_skip_dispatch))__pyx_f_6gevent_21__greenlet_primitives_25SwitchOutGreenletWithLoop_switch; + __pyx_vtable_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop.switch_out = (PyObject *(*)(struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *, int __pyx_skip_dispatch))__pyx_f_6gevent_21__greenlet_primitives_25SwitchOutGreenletWithLoop_switch_out; + __pyx_type_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop.tp_base = __pyx_ptype_6gevent_21__greenlet_primitives_TrackedRawGreenlet; + if (PyType_Ready(&__pyx_type_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop) < 0) __PYX_ERR(0, 53, __pyx_L1_error) + __pyx_type_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop.tp_print = 0; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop.tp_dictoffset && __pyx_type_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_type_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop.tp_getattro = __Pyx_PyObject_GenericGetAttr; + } + if (__Pyx_SetVtable(__pyx_type_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop.tp_dict, __pyx_vtabptr_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop) < 0) __PYX_ERR(0, 53, __pyx_L1_error) + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_SwitchOutGreenletWithLoop, (PyObject *)&__pyx_type_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop) < 0) __PYX_ERR(0, 53, __pyx_L1_error) + __pyx_ptype_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop = &__pyx_type_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_modinit_type_import_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); + /*--- Type import code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_variable_import_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); + /*--- Variable import code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_function_import_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); + /*--- Function import code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + + +#if PY_MAJOR_VERSION < 3 +#ifdef CYTHON_NO_PYINIT_EXPORT +#define __Pyx_PyMODINIT_FUNC void +#else +#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC +#endif +#else +#ifdef CYTHON_NO_PYINIT_EXPORT +#define __Pyx_PyMODINIT_FUNC PyObject * +#else +#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC +#endif +#endif + + +#if PY_MAJOR_VERSION < 3 +__Pyx_PyMODINIT_FUNC init__greenlet_primitives(void) CYTHON_SMALL_CODE; /*proto*/ +__Pyx_PyMODINIT_FUNC init__greenlet_primitives(void) +#else +__Pyx_PyMODINIT_FUNC PyInit___greenlet_primitives(void) CYTHON_SMALL_CODE; /*proto*/ +__Pyx_PyMODINIT_FUNC PyInit___greenlet_primitives(void) +#if CYTHON_PEP489_MULTI_PHASE_INIT +{ + return PyModuleDef_Init(&__pyx_moduledef); +} +static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { + #if PY_VERSION_HEX >= 0x030700A1 + static PY_INT64_T main_interpreter_id = -1; + PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); + if (main_interpreter_id == -1) { + main_interpreter_id = current_id; + return (unlikely(current_id == -1)) ? -1 : 0; + } else if (unlikely(main_interpreter_id != current_id)) + #else + static PyInterpreterState *main_interpreter = NULL; + PyInterpreterState *current_interpreter = PyThreadState_Get()->interp; + if (!main_interpreter) { + main_interpreter = current_interpreter; + } else if (unlikely(main_interpreter != current_interpreter)) + #endif + { + PyErr_SetString( + PyExc_ImportError, + "Interpreter change detected - this module can only be loaded into one interpreter per process."); + return -1; + } + return 0; +} +static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) { + PyObject *value = PyObject_GetAttrString(spec, from_name); + int result = 0; + if (likely(value)) { + if (allow_none || value != Py_None) { + result = PyDict_SetItemString(moddict, to_name, value); + } + Py_DECREF(value); + } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_Clear(); + } else { + result = -1; + } + return result; +} +static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) { + PyObject *module = NULL, *moddict, *modname; + if (__Pyx_check_single_interpreter()) + return NULL; + if (__pyx_m) + return __Pyx_NewRef(__pyx_m); + modname = PyObject_GetAttrString(spec, "name"); + if (unlikely(!modname)) goto bad; + module = PyModule_NewObject(modname); + Py_DECREF(modname); + if (unlikely(!module)) goto bad; + moddict = PyModule_GetDict(module); + if (unlikely(!moddict)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad; + return module; +bad: + Py_XDECREF(module); + return NULL; +} + + +static CYTHON_SMALL_CODE int __pyx_pymod_exec___greenlet_primitives(PyObject *__pyx_pyinit_module) +#endif +#endif +{ + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannyDeclarations + #if CYTHON_PEP489_MULTI_PHASE_INIT + if (__pyx_m) { + if (__pyx_m == __pyx_pyinit_module) return 0; + PyErr_SetString(PyExc_RuntimeError, "Module '__greenlet_primitives' has already been imported. Re-initialisation is not supported."); + return -1; + } + #elif PY_MAJOR_VERSION >= 3 + if (__pyx_m) return __Pyx_NewRef(__pyx_m); + #endif + #if CYTHON_REFNANNY +__Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); +if (!__Pyx_RefNanny) { + PyErr_Clear(); + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); + if (!__Pyx_RefNanny) + Py_FatalError("failed to import 'refnanny' module"); +} +#endif + __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit___greenlet_primitives(void)", 0); + if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #ifdef __Pxy_PyFrame_Initialize_Offsets + __Pxy_PyFrame_Initialize_Offsets(); + #endif + __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) + #ifdef __Pyx_CyFunction_USED + if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_FusedFunction_USED + if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_Coroutine_USED + if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_Generator_USED + if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_AsyncGen_USED + if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_StopAsyncIteration_USED + if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + /*--- Library function declarations ---*/ + /*--- Threads initialization code ---*/ + #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS + #ifdef WITH_THREAD /* Python build with threading support? */ + PyEval_InitThreads(); + #endif + #endif + /*--- Module creation code ---*/ + #if CYTHON_PEP489_MULTI_PHASE_INIT + __pyx_m = __pyx_pyinit_module; + Py_INCREF(__pyx_m); + #else + #if PY_MAJOR_VERSION < 3 + __pyx_m = Py_InitModule4("__greenlet_primitives", __pyx_methods, __pyx_k_A_collection_of_primitives_used, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); + #else + __pyx_m = PyModule_Create(&__pyx_moduledef); + #endif + if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) + Py_INCREF(__pyx_d); + __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) + #if CYTHON_COMPILING_IN_PYPY + Py_INCREF(__pyx_b); + #endif + if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + /*--- Initialize various global constants etc. ---*/ + if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) + if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + if (__pyx_module_is_main_gevent____greenlet_primitives) { + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + } + #if PY_MAJOR_VERSION >= 3 + { + PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) + if (!PyDict_GetItemString(modules, "gevent.__greenlet_primitives")) { + if (unlikely(PyDict_SetItemString(modules, "gevent.__greenlet_primitives", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error) + } + } + #endif + /*--- Builtin init code ---*/ + if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + /*--- Constants init code ---*/ + if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + /*--- Global type/function init code ---*/ + (void)__Pyx_modinit_global_init_code(); + if (unlikely(__Pyx_modinit_variable_export_code() != 0)) goto __pyx_L1_error; + if (unlikely(__Pyx_modinit_function_export_code() != 0)) goto __pyx_L1_error; + if (unlikely(__Pyx_modinit_type_init_code() != 0)) goto __pyx_L1_error; + (void)__Pyx_modinit_type_import_code(); + (void)__Pyx_modinit_variable_import_code(); + (void)__Pyx_modinit_function_import_code(); + /*--- Execution code ---*/ + #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) + if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + + /* "src/gevent/_greenlet_primitives.py":13 + * from __future__ import print_function + * + * from weakref import ref as wref # <<<<<<<<<<<<<< + * from gc import get_objects + * + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_ref); + __Pyx_GIVEREF(__pyx_n_s_ref); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_ref); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_weakref, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_ref); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_v_6gevent_21__greenlet_primitives_wref); + __Pyx_DECREF_SET(__pyx_v_6gevent_21__greenlet_primitives_wref, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/_greenlet_primitives.py":14 + * + * from weakref import ref as wref + * from gc import get_objects # <<<<<<<<<<<<<< + * + * from greenlet import greenlet + */ + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 14, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_get_objects); + __Pyx_GIVEREF(__pyx_n_s_get_objects); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_get_objects); + __pyx_t_1 = __Pyx_Import(__pyx_n_s_gc, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 14, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_get_objects); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 14, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_v_6gevent_21__greenlet_primitives_get_objects); + __Pyx_DECREF_SET(__pyx_v_6gevent_21__greenlet_primitives_get_objects, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_greenlet_primitives.py":16 + * from gc import get_objects + * + * from greenlet import greenlet # <<<<<<<<<<<<<< + * + * from gevent.exceptions import BlockingSwitchOutError + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 16, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_greenlet); + __Pyx_GIVEREF(__pyx_n_s_greenlet); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_greenlet); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_greenlet, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 16, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/_greenlet_primitives.py":18 + * from greenlet import greenlet + * + * from gevent.exceptions import BlockingSwitchOutError # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 18, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_BlockingSwitchOutError); + __Pyx_GIVEREF(__pyx_n_s_BlockingSwitchOutError); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_BlockingSwitchOutError); + __pyx_t_1 = __Pyx_Import(__pyx_n_s_gevent_exceptions, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 18, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_BlockingSwitchOutError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 18, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_v_6gevent_21__greenlet_primitives_BlockingSwitchOutError); + __Pyx_DECREF_SET(__pyx_v_6gevent_21__greenlet_primitives_BlockingSwitchOutError, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_greenlet_primitives.py":25 + * # is assignment) without generating a 'lvalue is not valid target' + * # error. + * locals()['getcurrent'] = __import__('greenlet').getcurrent # <<<<<<<<<<<<<< + * locals()['greenlet_init'] = lambda: None + * locals()['_greenlet_switch'] = greenlet.switch + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin___import__, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 25, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_getcurrent); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 25, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_Globals(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 25, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (unlikely(PyDict_SetItem(__pyx_t_1, __pyx_n_s_getcurrent, __pyx_t_2) < 0)) __PYX_ERR(0, 25, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/_greenlet_primitives.py":26 + * # error. + * locals()['getcurrent'] = __import__('greenlet').getcurrent + * locals()['greenlet_init'] = lambda: None # <<<<<<<<<<<<<< + * locals()['_greenlet_switch'] = greenlet.switch + * + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_21__greenlet_primitives_4lambda, 0, __pyx_n_s_lambda, NULL, __pyx_n_s_gevent___greenlet_primitives, __pyx_d, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 26, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_Globals(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 26, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (unlikely(PyDict_SetItem(__pyx_t_1, __pyx_n_s_greenlet_init, __pyx_t_2) < 0)) __PYX_ERR(0, 26, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/_greenlet_primitives.py":27 + * locals()['getcurrent'] = __import__('greenlet').getcurrent + * locals()['greenlet_init'] = lambda: None + * locals()['_greenlet_switch'] = greenlet.switch # <<<<<<<<<<<<<< + * + * __all__ = [ + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_6gevent_21__greenlet_primitives_greenlet), __pyx_n_s_switch); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 27, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_Globals(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 27, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (unlikely(PyDict_SetItem(__pyx_t_1, __pyx_n_s_greenlet_switch, __pyx_t_2) < 0)) __PYX_ERR(0, 27, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/_greenlet_primitives.py":29 + * locals()['_greenlet_switch'] = greenlet.switch + * + * __all__ = [ # <<<<<<<<<<<<<< + * 'TrackedRawGreenlet', + * 'SwitchOutGreenletWithLoop', + */ + __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 29, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_TrackedRawGreenlet); + __Pyx_GIVEREF(__pyx_n_s_TrackedRawGreenlet); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_TrackedRawGreenlet); + __Pyx_INCREF(__pyx_n_s_SwitchOutGreenletWithLoop); + __Pyx_GIVEREF(__pyx_n_s_SwitchOutGreenletWithLoop); + PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_SwitchOutGreenletWithLoop); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_all, __pyx_t_2) < 0) __PYX_ERR(0, 29, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/_greenlet_primitives.py":60 + * # circular dependencies with the hub. + * + * def switch(self): # <<<<<<<<<<<<<< + * switch_out = getattr(getcurrent(), 'switch_out', None) # pylint:disable=undefined-variable + * if switch_out is not None: + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_21__greenlet_primitives_25SwitchOutGreenletWithLoop_1switch, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_SwitchOutGreenletWithLoop_switch, NULL, __pyx_n_s_gevent___greenlet_primitives, __pyx_d, ((PyObject *)__pyx_codeobj__3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 60, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop->tp_dict, __pyx_n_s_switch, __pyx_t_2) < 0) __PYX_ERR(0, 60, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop); + + /* "src/gevent/_greenlet_primitives.py":66 + * return _greenlet_switch(self) # pylint:disable=undefined-variable + * + * def switch_out(self): # <<<<<<<<<<<<<< + * raise BlockingSwitchOutError('Impossible to call blocking function in the event loop callback') + * + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_21__greenlet_primitives_25SwitchOutGreenletWithLoop_3switch_out, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_SwitchOutGreenletWithLoop_switch_2, NULL, __pyx_n_s_gevent___greenlet_primitives, __pyx_d, ((PyObject *)__pyx_codeobj__5)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 66, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop->tp_dict, __pyx_n_s_switch_out, __pyx_t_2) < 0) __PYX_ERR(0, 66, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop); + + /* "src/gevent/_greenlet_primitives.py":70 + * + * + * def get_reachable_greenlets(): # <<<<<<<<<<<<<< + * # We compile this loop with Cython so that it's faster, and so that + * # the GIL isn't dropped at unpredictable times during the loop. + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_21__greenlet_primitives_1get_reachable_greenlets, 0, __pyx_n_s_get_reachable_greenlets, NULL, __pyx_n_s_gevent___greenlet_primitives, __pyx_d, ((PyObject *)__pyx_codeobj__6)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 70, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_reachable_greenlets, __pyx_t_2) < 0) __PYX_ERR(0, 70, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/_greenlet_primitives.py":84 + * ] + * + * def _init(): # <<<<<<<<<<<<<< + * greenlet_init() # pylint:disable=undefined-variable + * + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_21__greenlet_primitives_3_init, 0, __pyx_n_s_init_2, NULL, __pyx_n_s_gevent___greenlet_primitives, __pyx_d, ((PyObject *)__pyx_codeobj__7)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 84, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_init_2, __pyx_t_2) < 0) __PYX_ERR(0, 84, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/_greenlet_primitives.py":87 + * greenlet_init() # pylint:disable=undefined-variable + * + * _init() # <<<<<<<<<<<<<< + * + * from gevent._util import import_c_accel + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_init_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 87, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 87, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_greenlet_primitives.py":89 + * _init() + * + * from gevent._util import import_c_accel # <<<<<<<<<<<<<< + * import_c_accel(globals(), 'gevent.__greenlet_primitives') + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 89, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_import_c_accel); + __Pyx_GIVEREF(__pyx_n_s_import_c_accel); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_import_c_accel); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_gevent__util, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 89, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_import_c_accel); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 89, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_import_c_accel, __pyx_t_1) < 0) __PYX_ERR(0, 89, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/_greenlet_primitives.py":90 + * + * from gevent._util import import_c_accel + * import_c_accel(globals(), 'gevent.__greenlet_primitives') # <<<<<<<<<<<<<< + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_import_c_accel); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 90, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_Globals(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 90, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 90, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_INCREF(__pyx_n_s_gevent___greenlet_primitives); + __Pyx_GIVEREF(__pyx_n_s_gevent___greenlet_primitives); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_n_s_gevent___greenlet_primitives); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 90, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_greenlet_primitives.py":1 + * # -*- coding: utf-8 -*- # <<<<<<<<<<<<<< + * # copyright (c) 2018 gevent. See LICENSE. + * # cython: auto_pickle=False,embedsignature=True,always_allow_keywords=False + */ + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "gevent/__greenlet_primitives.pxd":34 + * _greenlet_imported = True + * + * cdef inline object _greenlet_switch(greenlet self): # <<<<<<<<<<<<<< + * return PyGreenlet_Switch(self, NULL, NULL) + * + */ + + /*--- Wrapped vars code ---*/ + + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + if (__pyx_m) { + if (__pyx_d) { + __Pyx_AddTraceback("init gevent.__greenlet_primitives", __pyx_clineno, __pyx_lineno, __pyx_filename); + } + Py_CLEAR(__pyx_m); + } else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_ImportError, "init gevent.__greenlet_primitives"); + } + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + #if CYTHON_PEP489_MULTI_PHASE_INIT + return (__pyx_m != NULL) ? 0 : -1; + #elif PY_MAJOR_VERSION >= 3 + return __pyx_m; + #else + return; + #endif +} + +/* --- Runtime support code --- */ +/* Refnanny */ +#if CYTHON_REFNANNY +static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { + PyObject *m = NULL, *p = NULL; + void *r = NULL; + m = PyImport_ImportModule(modname); + if (!m) goto end; + p = PyObject_GetAttrString(m, "RefNannyAPI"); + if (!p) goto end; + r = PyLong_AsVoidPtr(p); +end: + Py_XDECREF(p); + Py_XDECREF(m); + return (__Pyx_RefNannyAPIStruct *)r; +} +#endif + +/* PyObjectGetAttrStr */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_getattro)) + return tp->tp_getattro(obj, attr_name); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_getattr)) + return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); +#endif + return PyObject_GetAttr(obj, attr_name); +} +#endif + +/* GetBuiltinName */ +static PyObject *__Pyx_GetBuiltinName(PyObject *name) { + PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name); + if (unlikely(!result)) { + PyErr_Format(PyExc_NameError, +#if PY_MAJOR_VERSION >= 3 + "name '%U' is not defined", name); +#else + "name '%.200s' is not defined", PyString_AS_STRING(name)); +#endif + } + return result; +} + +/* RaiseArgTupleInvalid */ +static void __Pyx_RaiseArgtupleInvalid( + const char* func_name, + int exact, + Py_ssize_t num_min, + Py_ssize_t num_max, + Py_ssize_t num_found) +{ + Py_ssize_t num_expected; + const char *more_or_less; + if (num_found < num_min) { + num_expected = num_min; + more_or_less = "at least"; + } else { + num_expected = num_max; + more_or_less = "at most"; + } + if (exact) { + more_or_less = "exactly"; + } + PyErr_Format(PyExc_TypeError, + "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", + func_name, more_or_less, num_expected, + (num_expected == 1) ? "" : "s", num_found); +} + +/* RaiseDoubleKeywords */ +static void __Pyx_RaiseDoubleKeywordsError( + const char* func_name, + PyObject* kw_name) +{ + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION >= 3 + "%s() got multiple values for keyword argument '%U'", func_name, kw_name); + #else + "%s() got multiple values for keyword argument '%s'", func_name, + PyString_AsString(kw_name)); + #endif +} + +/* ParseKeywords */ +static int __Pyx_ParseOptionalKeywords( + PyObject *kwds, + PyObject **argnames[], + PyObject *kwds2, + PyObject *values[], + Py_ssize_t num_pos_args, + const char* function_name) +{ + PyObject *key = 0, *value = 0; + Py_ssize_t pos = 0; + PyObject*** name; + PyObject*** first_kw_arg = argnames + num_pos_args; + while (PyDict_Next(kwds, &pos, &key, &value)) { + name = first_kw_arg; + while (*name && (**name != key)) name++; + if (*name) { + values[name-argnames] = value; + continue; + } + name = first_kw_arg; + #if PY_MAJOR_VERSION < 3 + if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) { + while (*name) { + if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) + && _PyString_Eq(**name, key)) { + values[name-argnames] = value; + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + if ((**argname == key) || ( + (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) + && _PyString_Eq(**argname, key))) { + goto arg_passed_twice; + } + argname++; + } + } + } else + #endif + if (likely(PyUnicode_Check(key))) { + while (*name) { + int cmp = (**name == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 : + #endif + PyUnicode_Compare(**name, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) { + values[name-argnames] = value; + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + int cmp = (**argname == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 : + #endif + PyUnicode_Compare(**argname, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) goto arg_passed_twice; + argname++; + } + } + } else + goto invalid_keyword_type; + if (kwds2) { + if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; + } else { + goto invalid_keyword; + } + } + return 0; +arg_passed_twice: + __Pyx_RaiseDoubleKeywordsError(function_name, key); + goto bad; +invalid_keyword_type: + PyErr_Format(PyExc_TypeError, + "%.200s() keywords must be strings", function_name); + goto bad; +invalid_keyword: + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION < 3 + "%.200s() got an unexpected keyword argument '%.200s'", + function_name, PyString_AsString(key)); + #else + "%s() got an unexpected keyword argument '%U'", + function_name, key); + #endif +bad: + return -1; +} + +/* PyFunctionFastCall */ +#if CYTHON_FAST_PYCALL +static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, + PyObject *globals) { + PyFrameObject *f; + PyThreadState *tstate = __Pyx_PyThreadState_Current; + PyObject **fastlocals; + Py_ssize_t i; + PyObject *result; + assert(globals != NULL); + /* XXX Perhaps we should create a specialized + PyFrame_New() that doesn't take locals, but does + take builtins without sanity checking them. + */ + assert(tstate != NULL); + f = PyFrame_New(tstate, co, globals, NULL); + if (f == NULL) { + return NULL; + } + fastlocals = __Pyx_PyFrame_GetLocalsplus(f); + for (i = 0; i < na; i++) { + Py_INCREF(*args); + fastlocals[i] = *args++; + } + result = PyEval_EvalFrameEx(f,0); + ++tstate->recursion_depth; + Py_DECREF(f); + --tstate->recursion_depth; + return result; +} +#if 1 || PY_VERSION_HEX < 0x030600B1 +static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs) { + PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); + PyObject *globals = PyFunction_GET_GLOBALS(func); + PyObject *argdefs = PyFunction_GET_DEFAULTS(func); + PyObject *closure; +#if PY_MAJOR_VERSION >= 3 + PyObject *kwdefs; +#endif + PyObject *kwtuple, **k; + PyObject **d; + Py_ssize_t nd; + Py_ssize_t nk; + PyObject *result; + assert(kwargs == NULL || PyDict_Check(kwargs)); + nk = kwargs ? PyDict_Size(kwargs) : 0; + if (Py_EnterRecursiveCall((char*)" while calling a Python object")) { + return NULL; + } + if ( +#if PY_MAJOR_VERSION >= 3 + co->co_kwonlyargcount == 0 && +#endif + likely(kwargs == NULL || nk == 0) && + co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { + if (argdefs == NULL && co->co_argcount == nargs) { + result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); + goto done; + } + else if (nargs == 0 && argdefs != NULL + && co->co_argcount == Py_SIZE(argdefs)) { + /* function called with no arguments, but all parameters have + a default value: use default values as arguments .*/ + args = &PyTuple_GET_ITEM(argdefs, 0); + result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); + goto done; + } + } + if (kwargs != NULL) { + Py_ssize_t pos, i; + kwtuple = PyTuple_New(2 * nk); + if (kwtuple == NULL) { + result = NULL; + goto done; + } + k = &PyTuple_GET_ITEM(kwtuple, 0); + pos = i = 0; + while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { + Py_INCREF(k[i]); + Py_INCREF(k[i+1]); + i += 2; + } + nk = i / 2; + } + else { + kwtuple = NULL; + k = NULL; + } + closure = PyFunction_GET_CLOSURE(func); +#if PY_MAJOR_VERSION >= 3 + kwdefs = PyFunction_GET_KW_DEFAULTS(func); +#endif + if (argdefs != NULL) { + d = &PyTuple_GET_ITEM(argdefs, 0); + nd = Py_SIZE(argdefs); + } + else { + d = NULL; + nd = 0; + } +#if PY_MAJOR_VERSION >= 3 + result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, + args, nargs, + k, (int)nk, + d, (int)nd, kwdefs, closure); +#else + result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, + args, nargs, + k, (int)nk, + d, (int)nd, closure); +#endif + Py_XDECREF(kwtuple); +done: + Py_LeaveRecursiveCall(); + return result; +} +#endif +#endif + +/* PyCFunctionFastCall */ +#if CYTHON_FAST_PYCCALL +static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) { + PyCFunctionObject *func = (PyCFunctionObject*)func_obj; + PyCFunction meth = PyCFunction_GET_FUNCTION(func); + PyObject *self = PyCFunction_GET_SELF(func); + int flags = PyCFunction_GET_FLAGS(func); + assert(PyCFunction_Check(func)); + assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS))); + assert(nargs >= 0); + assert(nargs == 0 || args != NULL); + /* _PyCFunction_FastCallDict() must not be called with an exception set, + because it may clear it (directly or indirectly) and so the + caller loses its exception */ + assert(!PyErr_Occurred()); + if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) { + return (*((__Pyx_PyCFunctionFastWithKeywords)(void*)meth)) (self, args, nargs, NULL); + } else { + return (*((__Pyx_PyCFunctionFast)(void*)meth)) (self, args, nargs); + } +} +#endif + +/* PyObjectCall */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { + PyObject *result; + ternaryfunc call = func->ob_type->tp_call; + if (unlikely(!call)) + return PyObject_Call(func, arg, kw); + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; + result = (*call)(func, arg, kw); + Py_LeaveRecursiveCall(); + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +/* PyObjectCall2Args */ +static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) { + PyObject *args, *result = NULL; + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(function)) { + PyObject *args[2] = {arg1, arg2}; + return __Pyx_PyFunction_FastCall(function, args, 2); + } + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(function)) { + PyObject *args[2] = {arg1, arg2}; + return __Pyx_PyCFunction_FastCall(function, args, 2); + } + #endif + args = PyTuple_New(2); + if (unlikely(!args)) goto done; + Py_INCREF(arg1); + PyTuple_SET_ITEM(args, 0, arg1); + Py_INCREF(arg2); + PyTuple_SET_ITEM(args, 1, arg2); + Py_INCREF(function); + result = __Pyx_PyObject_Call(function, args, NULL); + Py_DECREF(args); + Py_DECREF(function); +done: + return result; +} + +/* PyObjectCallMethO */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { + PyObject *self, *result; + PyCFunction cfunc; + cfunc = PyCFunction_GET_FUNCTION(func); + self = PyCFunction_GET_SELF(func); + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; + result = cfunc(self, arg); + Py_LeaveRecursiveCall(); + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +/* PyObjectCallOneArg */ +#if CYTHON_COMPILING_IN_CPYTHON +static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) { + PyObject *result; + PyObject *args = PyTuple_New(1); + if (unlikely(!args)) return NULL; + Py_INCREF(arg); + PyTuple_SET_ITEM(args, 0, arg); + result = __Pyx_PyObject_Call(func, args, NULL); + Py_DECREF(args); + return result; +} +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { +#if CYTHON_FAST_PYCALL + if (PyFunction_Check(func)) { + return __Pyx_PyFunction_FastCall(func, &arg, 1); + } +#endif + if (likely(PyCFunction_Check(func))) { + if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) { + return __Pyx_PyObject_CallMethO(func, arg); +#if CYTHON_FAST_PYCCALL + } else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) { + return __Pyx_PyCFunction_FastCall(func, &arg, 1); +#endif + } + } + return __Pyx__PyObject_CallOneArg(func, arg); +} +#else +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { + PyObject *result; + PyObject *args = PyTuple_Pack(1, arg); + if (unlikely(!args)) return NULL; + result = __Pyx_PyObject_Call(func, args, NULL); + Py_DECREF(args); + return result; +} +#endif + +/* PyObjectSetAttrStr */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) { + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_setattro)) + return tp->tp_setattro(obj, attr_name, value); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_setattr)) + return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value); +#endif + return PyObject_SetAttr(obj, attr_name, value); +} +#endif + +/* GetTopmostException */ +#if CYTHON_USE_EXC_INFO_STACK +static _PyErr_StackItem * +__Pyx_PyErr_GetTopmostException(PyThreadState *tstate) +{ + _PyErr_StackItem *exc_info = tstate->exc_info; + while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) && + exc_info->previous_item != NULL) + { + exc_info = exc_info->previous_item; + } + return exc_info; +} +#endif + +/* SaveResetException */ +#if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { + #if CYTHON_USE_EXC_INFO_STACK + _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate); + *type = exc_info->exc_type; + *value = exc_info->exc_value; + *tb = exc_info->exc_traceback; + #else + *type = tstate->exc_type; + *value = tstate->exc_value; + *tb = tstate->exc_traceback; + #endif + Py_XINCREF(*type); + Py_XINCREF(*value); + Py_XINCREF(*tb); +} +static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + #if CYTHON_USE_EXC_INFO_STACK + _PyErr_StackItem *exc_info = tstate->exc_info; + tmp_type = exc_info->exc_type; + tmp_value = exc_info->exc_value; + tmp_tb = exc_info->exc_traceback; + exc_info->exc_type = type; + exc_info->exc_value = value; + exc_info->exc_traceback = tb; + #else + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = type; + tstate->exc_value = value; + tstate->exc_traceback = tb; + #endif + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +} +#endif + +/* PyErrExceptionMatches */ +#if CYTHON_FAST_THREAD_STATE +static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { + Py_ssize_t i, n; + n = PyTuple_GET_SIZE(tuple); +#if PY_MAJOR_VERSION >= 3 + for (i=0; icurexc_type; + if (exc_type == err) return 1; + if (unlikely(!exc_type)) return 0; + if (unlikely(PyTuple_Check(err))) + return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err); + return __Pyx_PyErr_GivenExceptionMatches(exc_type, err); +} +#endif + +/* GetException */ +#if CYTHON_FAST_THREAD_STATE +static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) +#else +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) +#endif +{ + PyObject *local_type, *local_value, *local_tb; +#if CYTHON_FAST_THREAD_STATE + PyObject *tmp_type, *tmp_value, *tmp_tb; + local_type = tstate->curexc_type; + local_value = tstate->curexc_value; + local_tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +#else + PyErr_Fetch(&local_type, &local_value, &local_tb); +#endif + PyErr_NormalizeException(&local_type, &local_value, &local_tb); +#if CYTHON_FAST_THREAD_STATE + if (unlikely(tstate->curexc_type)) +#else + if (unlikely(PyErr_Occurred())) +#endif + goto bad; + #if PY_MAJOR_VERSION >= 3 + if (local_tb) { + if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) + goto bad; + } + #endif + Py_XINCREF(local_tb); + Py_XINCREF(local_type); + Py_XINCREF(local_value); + *type = local_type; + *value = local_value; + *tb = local_tb; +#if CYTHON_FAST_THREAD_STATE + #if CYTHON_USE_EXC_INFO_STACK + { + _PyErr_StackItem *exc_info = tstate->exc_info; + tmp_type = exc_info->exc_type; + tmp_value = exc_info->exc_value; + tmp_tb = exc_info->exc_traceback; + exc_info->exc_type = local_type; + exc_info->exc_value = local_value; + exc_info->exc_traceback = local_tb; + } + #else + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = local_type; + tstate->exc_value = local_value; + tstate->exc_traceback = local_tb; + #endif + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#else + PyErr_SetExcInfo(local_type, local_value, local_tb); +#endif + return 0; +bad: + *type = 0; + *value = 0; + *tb = 0; + Py_XDECREF(local_type); + Py_XDECREF(local_value); + Py_XDECREF(local_tb); + return -1; +} + +/* PyObjectCallNoArg */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { +#if CYTHON_FAST_PYCALL + if (PyFunction_Check(func)) { + return __Pyx_PyFunction_FastCall(func, NULL, 0); + } +#endif +#ifdef __Pyx_CyFunction_USED + if (likely(PyCFunction_Check(func) || __Pyx_CyFunction_Check(func))) +#else + if (likely(PyCFunction_Check(func))) +#endif + { + if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) { + return __Pyx_PyObject_CallMethO(func, NULL); + } + } + return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL); +} +#endif + +/* PyErrFetchRestore */ +#if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + tmp_type = tstate->curexc_type; + tmp_value = tstate->curexc_value; + tmp_tb = tstate->curexc_traceback; + tstate->curexc_type = type; + tstate->curexc_value = value; + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +} +static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { + *type = tstate->curexc_type; + *value = tstate->curexc_value; + *tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +} +#endif + +/* GetAttr */ +static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) { +#if CYTHON_USE_TYPE_SLOTS +#if PY_MAJOR_VERSION >= 3 + if (likely(PyUnicode_Check(n))) +#else + if (likely(PyString_Check(n))) +#endif + return __Pyx_PyObject_GetAttrStr(o, n); +#endif + return PyObject_GetAttr(o, n); +} + +/* GetAttr3 */ +static PyObject *__Pyx_GetAttr3Default(PyObject *d) { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) + return NULL; + __Pyx_PyErr_Clear(); + Py_INCREF(d); + return d; +} +static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) { + PyObject *r = __Pyx_GetAttr(o, n); + return (likely(r)) ? r : __Pyx_GetAttr3Default(d); +} + +/* RaiseException */ +#if PY_MAJOR_VERSION < 3 +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, + CYTHON_UNUSED PyObject *cause) { + __Pyx_PyThreadState_declare + Py_XINCREF(type); + if (!value || value == Py_None) + value = NULL; + else + Py_INCREF(value); + if (!tb || tb == Py_None) + tb = NULL; + else { + Py_INCREF(tb); + if (!PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto raise_error; + } + } + if (PyType_Check(type)) { +#if CYTHON_COMPILING_IN_PYPY + if (!value) { + Py_INCREF(Py_None); + value = Py_None; + } +#endif + PyErr_NormalizeException(&type, &value, &tb); + } else { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto raise_error; + } + value = type; + type = (PyObject*) Py_TYPE(type); + Py_INCREF(type); + if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto raise_error; + } + } + __Pyx_PyThreadState_assign + __Pyx_ErrRestore(type, value, tb); + return; +raise_error: + Py_XDECREF(value); + Py_XDECREF(type); + Py_XDECREF(tb); + return; +} +#else +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { + PyObject* owned_instance = NULL; + if (tb == Py_None) { + tb = 0; + } else if (tb && !PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto bad; + } + if (value == Py_None) + value = 0; + if (PyExceptionInstance_Check(type)) { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto bad; + } + value = type; + type = (PyObject*) Py_TYPE(value); + } else if (PyExceptionClass_Check(type)) { + PyObject *instance_class = NULL; + if (value && PyExceptionInstance_Check(value)) { + instance_class = (PyObject*) Py_TYPE(value); + if (instance_class != type) { + int is_subclass = PyObject_IsSubclass(instance_class, type); + if (!is_subclass) { + instance_class = NULL; + } else if (unlikely(is_subclass == -1)) { + goto bad; + } else { + type = instance_class; + } + } + } + if (!instance_class) { + PyObject *args; + if (!value) + args = PyTuple_New(0); + else if (PyTuple_Check(value)) { + Py_INCREF(value); + args = value; + } else + args = PyTuple_Pack(1, value); + if (!args) + goto bad; + owned_instance = PyObject_Call(type, args, NULL); + Py_DECREF(args); + if (!owned_instance) + goto bad; + value = owned_instance; + if (!PyExceptionInstance_Check(value)) { + PyErr_Format(PyExc_TypeError, + "calling %R should have returned an instance of " + "BaseException, not %R", + type, Py_TYPE(value)); + goto bad; + } + } + } else { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto bad; + } + if (cause) { + PyObject *fixed_cause; + if (cause == Py_None) { + fixed_cause = NULL; + } else if (PyExceptionClass_Check(cause)) { + fixed_cause = PyObject_CallObject(cause, NULL); + if (fixed_cause == NULL) + goto bad; + } else if (PyExceptionInstance_Check(cause)) { + fixed_cause = cause; + Py_INCREF(fixed_cause); + } else { + PyErr_SetString(PyExc_TypeError, + "exception causes must derive from " + "BaseException"); + goto bad; + } + PyException_SetCause(value, fixed_cause); + } + PyErr_SetObject(type, value); + if (tb) { +#if CYTHON_COMPILING_IN_PYPY + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); + Py_INCREF(tb); + PyErr_Restore(tmp_type, tmp_value, tb); + Py_XDECREF(tmp_tb); +#else + PyThreadState *tstate = __Pyx_PyThreadState_Current; + PyObject* tmp_tb = tstate->curexc_traceback; + if (tb != tmp_tb) { + Py_INCREF(tb); + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_tb); + } +#endif + } +bad: + Py_XDECREF(owned_instance); + return; +} +#endif + +/* CallNextTpDealloc */ +static void __Pyx_call_next_tp_dealloc(PyObject* obj, destructor current_tp_dealloc) { + PyTypeObject* type = Py_TYPE(obj); + while (type && type->tp_dealloc != current_tp_dealloc) + type = type->tp_base; + while (type && type->tp_dealloc == current_tp_dealloc) + type = type->tp_base; + if (type) + type->tp_dealloc(obj); +} + +/* CallNextTpTraverse */ +static int __Pyx_call_next_tp_traverse(PyObject* obj, visitproc v, void *a, traverseproc current_tp_traverse) { + PyTypeObject* type = Py_TYPE(obj); + while (type && type->tp_traverse != current_tp_traverse) + type = type->tp_base; + while (type && type->tp_traverse == current_tp_traverse) + type = type->tp_base; + if (type && type->tp_traverse) + return type->tp_traverse(obj, v, a); + return 0; +} + +/* CallNextTpClear */ +static void __Pyx_call_next_tp_clear(PyObject* obj, inquiry current_tp_clear) { + PyTypeObject* type = Py_TYPE(obj); + while (type && type->tp_clear != current_tp_clear) + type = type->tp_base; + while (type && type->tp_clear == current_tp_clear) + type = type->tp_base; + if (type && type->tp_clear) + type->tp_clear(obj); +} + +/* TypeImport */ +#ifndef __PYX_HAVE_RT_ImportType +#define __PYX_HAVE_RT_ImportType +static PyTypeObject *__Pyx_ImportType(PyObject *module, const char *module_name, const char *class_name, + size_t size, enum __Pyx_ImportType_CheckSize check_size) +{ + PyObject *result = 0; + char warning[200]; + Py_ssize_t basicsize; +#ifdef Py_LIMITED_API + PyObject *py_basicsize; +#endif + result = PyObject_GetAttrString(module, class_name); + if (!result) + goto bad; + if (!PyType_Check(result)) { + PyErr_Format(PyExc_TypeError, + "%.200s.%.200s is not a type object", + module_name, class_name); + goto bad; + } +#ifndef Py_LIMITED_API + basicsize = ((PyTypeObject *)result)->tp_basicsize; +#else + py_basicsize = PyObject_GetAttrString(result, "__basicsize__"); + if (!py_basicsize) + goto bad; + basicsize = PyLong_AsSsize_t(py_basicsize); + Py_DECREF(py_basicsize); + py_basicsize = 0; + if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred()) + goto bad; +#endif + if ((size_t)basicsize < size) { + PyErr_Format(PyExc_ValueError, + "%.200s.%.200s size changed, may indicate binary incompatibility. " + "Expected %zd from C header, got %zd from PyObject", + module_name, class_name, size, basicsize); + goto bad; + } + if (check_size == __Pyx_ImportType_CheckSize_Error && (size_t)basicsize != size) { + PyErr_Format(PyExc_ValueError, + "%.200s.%.200s size changed, may indicate binary incompatibility. " + "Expected %zd from C header, got %zd from PyObject", + module_name, class_name, size, basicsize); + goto bad; + } + else if (check_size == __Pyx_ImportType_CheckSize_Warn && (size_t)basicsize > size) { + PyOS_snprintf(warning, sizeof(warning), + "%s.%s size changed, may indicate binary incompatibility. " + "Expected %zd from C header, got %zd from PyObject", + module_name, class_name, size, basicsize); + if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad; + } + return (PyTypeObject *)result; +bad: + Py_XDECREF(result); + return NULL; +} +#endif + +/* PyObject_GenericGetAttrNoDict */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) { + PyErr_Format(PyExc_AttributeError, +#if PY_MAJOR_VERSION >= 3 + "'%.50s' object has no attribute '%U'", + tp->tp_name, attr_name); +#else + "'%.50s' object has no attribute '%.400s'", + tp->tp_name, PyString_AS_STRING(attr_name)); +#endif + return NULL; +} +static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) { + PyObject *descr; + PyTypeObject *tp = Py_TYPE(obj); + if (unlikely(!PyString_Check(attr_name))) { + return PyObject_GenericGetAttr(obj, attr_name); + } + assert(!tp->tp_dictoffset); + descr = _PyType_Lookup(tp, attr_name); + if (unlikely(!descr)) { + return __Pyx_RaiseGenericGetAttributeError(tp, attr_name); + } + Py_INCREF(descr); + #if PY_MAJOR_VERSION < 3 + if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS))) + #endif + { + descrgetfunc f = Py_TYPE(descr)->tp_descr_get; + if (unlikely(f)) { + PyObject *res = f(descr, obj, (PyObject *)tp); + Py_DECREF(descr); + return res; + } + } + return descr; +} +#endif + +/* PyObject_GenericGetAttr */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) { + if (unlikely(Py_TYPE(obj)->tp_dictoffset)) { + return PyObject_GenericGetAttr(obj, attr_name); + } + return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name); +} +#endif + +/* SetVTable */ +static int __Pyx_SetVtable(PyObject *dict, void *vtable) { +#if PY_VERSION_HEX >= 0x02070000 + PyObject *ob = PyCapsule_New(vtable, 0, 0); +#else + PyObject *ob = PyCObject_FromVoidPtr(vtable, 0); +#endif + if (!ob) + goto bad; + if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0) + goto bad; + Py_DECREF(ob); + return 0; +bad: + Py_XDECREF(ob); + return -1; +} + +/* Import */ +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { + PyObject *empty_list = 0; + PyObject *module = 0; + PyObject *global_dict = 0; + PyObject *empty_dict = 0; + PyObject *list; + #if PY_MAJOR_VERSION < 3 + PyObject *py_import; + py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); + if (!py_import) + goto bad; + #endif + if (from_list) + list = from_list; + else { + empty_list = PyList_New(0); + if (!empty_list) + goto bad; + list = empty_list; + } + global_dict = PyModule_GetDict(__pyx_m); + if (!global_dict) + goto bad; + empty_dict = PyDict_New(); + if (!empty_dict) + goto bad; + { + #if PY_MAJOR_VERSION >= 3 + if (level == -1) { + if (strchr(__Pyx_MODULE_NAME, '.')) { + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, 1); + if (!module) { + if (!PyErr_ExceptionMatches(PyExc_ImportError)) + goto bad; + PyErr_Clear(); + } + } + level = 0; + } + #endif + if (!module) { + #if PY_MAJOR_VERSION < 3 + PyObject *py_level = PyInt_FromLong(level); + if (!py_level) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, py_level, (PyObject *)NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, level); + #endif + } + } +bad: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(py_import); + #endif + Py_XDECREF(empty_list); + Py_XDECREF(empty_dict); + return module; +} + +/* ImportFrom */ +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { + PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); + if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_Format(PyExc_ImportError, + #if PY_MAJOR_VERSION < 3 + "cannot import name %.230s", PyString_AS_STRING(name)); + #else + "cannot import name %S", name); + #endif + } + return value; +} + +/* FetchCommonType */ +static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { + PyObject* fake_module; + PyTypeObject* cached_type = NULL; + fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI); + if (!fake_module) return NULL; + Py_INCREF(fake_module); + cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name); + if (cached_type) { + if (!PyType_Check((PyObject*)cached_type)) { + PyErr_Format(PyExc_TypeError, + "Shared Cython type %.200s is not a type object", + type->tp_name); + goto bad; + } + if (cached_type->tp_basicsize != type->tp_basicsize) { + PyErr_Format(PyExc_TypeError, + "Shared Cython type %.200s has the wrong size, try recompiling", + type->tp_name); + goto bad; + } + } else { + if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; + PyErr_Clear(); + if (PyType_Ready(type) < 0) goto bad; + if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0) + goto bad; + Py_INCREF(type); + cached_type = type; + } +done: + Py_DECREF(fake_module); + return cached_type; +bad: + Py_XDECREF(cached_type); + cached_type = NULL; + goto done; +} + +/* CythonFunction */ +#include +static PyObject * +__Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure) +{ + if (unlikely(op->func_doc == NULL)) { + if (op->func.m_ml->ml_doc) { +#if PY_MAJOR_VERSION >= 3 + op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc); +#else + op->func_doc = PyString_FromString(op->func.m_ml->ml_doc); +#endif + if (unlikely(op->func_doc == NULL)) + return NULL; + } else { + Py_INCREF(Py_None); + return Py_None; + } + } + Py_INCREF(op->func_doc); + return op->func_doc; +} +static int +__Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context) +{ + PyObject *tmp = op->func_doc; + if (value == NULL) { + value = Py_None; + } + Py_INCREF(value); + op->func_doc = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + if (unlikely(op->func_name == NULL)) { +#if PY_MAJOR_VERSION >= 3 + op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name); +#else + op->func_name = PyString_InternFromString(op->func.m_ml->ml_name); +#endif + if (unlikely(op->func_name == NULL)) + return NULL; + } + Py_INCREF(op->func_name); + return op->func_name; +} +static int +__Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context) +{ + PyObject *tmp; +#if PY_MAJOR_VERSION >= 3 + if (unlikely(value == NULL || !PyUnicode_Check(value))) +#else + if (unlikely(value == NULL || !PyString_Check(value))) +#endif + { + PyErr_SetString(PyExc_TypeError, + "__name__ must be set to a string object"); + return -1; + } + tmp = op->func_name; + Py_INCREF(value); + op->func_name = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + Py_INCREF(op->func_qualname); + return op->func_qualname; +} +static int +__Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context) +{ + PyObject *tmp; +#if PY_MAJOR_VERSION >= 3 + if (unlikely(value == NULL || !PyUnicode_Check(value))) +#else + if (unlikely(value == NULL || !PyString_Check(value))) +#endif + { + PyErr_SetString(PyExc_TypeError, + "__qualname__ must be set to a string object"); + return -1; + } + tmp = op->func_qualname; + Py_INCREF(value); + op->func_qualname = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED void *closure) +{ + PyObject *self; + self = m->func_closure; + if (self == NULL) + self = Py_None; + Py_INCREF(self); + return self; +} +static PyObject * +__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + if (unlikely(op->func_dict == NULL)) { + op->func_dict = PyDict_New(); + if (unlikely(op->func_dict == NULL)) + return NULL; + } + Py_INCREF(op->func_dict); + return op->func_dict; +} +static int +__Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context) +{ + PyObject *tmp; + if (unlikely(value == NULL)) { + PyErr_SetString(PyExc_TypeError, + "function's dictionary may not be deleted"); + return -1; + } + if (unlikely(!PyDict_Check(value))) { + PyErr_SetString(PyExc_TypeError, + "setting function's dictionary to a non-dict"); + return -1; + } + tmp = op->func_dict; + Py_INCREF(value); + op->func_dict = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + Py_INCREF(op->func_globals); + return op->func_globals; +} +static PyObject * +__Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + Py_INCREF(Py_None); + return Py_None; +} +static PyObject * +__Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + PyObject* result = (op->func_code) ? op->func_code : Py_None; + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { + int result = 0; + PyObject *res = op->defaults_getter((PyObject *) op); + if (unlikely(!res)) + return -1; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + op->defaults_tuple = PyTuple_GET_ITEM(res, 0); + Py_INCREF(op->defaults_tuple); + op->defaults_kwdict = PyTuple_GET_ITEM(res, 1); + Py_INCREF(op->defaults_kwdict); + #else + op->defaults_tuple = PySequence_ITEM(res, 0); + if (unlikely(!op->defaults_tuple)) result = -1; + else { + op->defaults_kwdict = PySequence_ITEM(res, 1); + if (unlikely(!op->defaults_kwdict)) result = -1; + } + #endif + Py_DECREF(res); + return result; +} +static int +__Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) { + PyObject* tmp; + if (!value) { + value = Py_None; + } else if (value != Py_None && !PyTuple_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__defaults__ must be set to a tuple object"); + return -1; + } + Py_INCREF(value); + tmp = op->defaults_tuple; + op->defaults_tuple = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) { + PyObject* result = op->defaults_tuple; + if (unlikely(!result)) { + if (op->defaults_getter) { + if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL; + result = op->defaults_tuple; + } else { + result = Py_None; + } + } + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) { + PyObject* tmp; + if (!value) { + value = Py_None; + } else if (value != Py_None && !PyDict_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__kwdefaults__ must be set to a dict object"); + return -1; + } + Py_INCREF(value); + tmp = op->defaults_kwdict; + op->defaults_kwdict = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) { + PyObject* result = op->defaults_kwdict; + if (unlikely(!result)) { + if (op->defaults_getter) { + if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL; + result = op->defaults_kwdict; + } else { + result = Py_None; + } + } + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) { + PyObject* tmp; + if (!value || value == Py_None) { + value = NULL; + } else if (!PyDict_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__annotations__ must be set to a dict object"); + return -1; + } + Py_XINCREF(value); + tmp = op->func_annotations; + op->func_annotations = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) { + PyObject* result = op->func_annotations; + if (unlikely(!result)) { + result = PyDict_New(); + if (unlikely(!result)) return NULL; + op->func_annotations = result; + } + Py_INCREF(result); + return result; +} +static PyGetSetDef __pyx_CyFunction_getsets[] = { + {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, + {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, + {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, + {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, + {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, + {(char *) "__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0}, + {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, + {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, + {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, + {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, + {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, + {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, + {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, + {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, + {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, + {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, + {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, + {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, + {0, 0, 0, 0, 0} +}; +static PyMemberDef __pyx_CyFunction_members[] = { + {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), PY_WRITE_RESTRICTED, 0}, + {0, 0, 0, 0, 0} +}; +static PyObject * +__Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args) +{ +#if PY_MAJOR_VERSION >= 3 + return PyUnicode_FromString(m->func.m_ml->ml_name); +#else + return PyString_FromString(m->func.m_ml->ml_name); +#endif +} +static PyMethodDef __pyx_CyFunction_methods[] = { + {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, + {0, 0, 0, 0} +}; +#if PY_VERSION_HEX < 0x030500A0 +#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist) +#else +#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func.m_weakreflist) +#endif +static PyObject *__Pyx_CyFunction_New(PyTypeObject *type, PyMethodDef *ml, int flags, PyObject* qualname, + PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { + __pyx_CyFunctionObject *op = PyObject_GC_New(__pyx_CyFunctionObject, type); + if (op == NULL) + return NULL; + op->flags = flags; + __Pyx_CyFunction_weakreflist(op) = NULL; + op->func.m_ml = ml; + op->func.m_self = (PyObject *) op; + Py_XINCREF(closure); + op->func_closure = closure; + Py_XINCREF(module); + op->func.m_module = module; + op->func_dict = NULL; + op->func_name = NULL; + Py_INCREF(qualname); + op->func_qualname = qualname; + op->func_doc = NULL; + op->func_classobj = NULL; + op->func_globals = globals; + Py_INCREF(op->func_globals); + Py_XINCREF(code); + op->func_code = code; + op->defaults_pyobjects = 0; + op->defaults = NULL; + op->defaults_tuple = NULL; + op->defaults_kwdict = NULL; + op->defaults_getter = NULL; + op->func_annotations = NULL; + PyObject_GC_Track(op); + return (PyObject *) op; +} +static int +__Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) +{ + Py_CLEAR(m->func_closure); + Py_CLEAR(m->func.m_module); + Py_CLEAR(m->func_dict); + Py_CLEAR(m->func_name); + Py_CLEAR(m->func_qualname); + Py_CLEAR(m->func_doc); + Py_CLEAR(m->func_globals); + Py_CLEAR(m->func_code); + Py_CLEAR(m->func_classobj); + Py_CLEAR(m->defaults_tuple); + Py_CLEAR(m->defaults_kwdict); + Py_CLEAR(m->func_annotations); + if (m->defaults) { + PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); + int i; + for (i = 0; i < m->defaults_pyobjects; i++) + Py_XDECREF(pydefaults[i]); + PyObject_Free(m->defaults); + m->defaults = NULL; + } + return 0; +} +static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m) +{ + if (__Pyx_CyFunction_weakreflist(m) != NULL) + PyObject_ClearWeakRefs((PyObject *) m); + __Pyx_CyFunction_clear(m); + PyObject_GC_Del(m); +} +static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) +{ + PyObject_GC_UnTrack(m); + __Pyx__CyFunction_dealloc(m); +} +static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) +{ + Py_VISIT(m->func_closure); + Py_VISIT(m->func.m_module); + Py_VISIT(m->func_dict); + Py_VISIT(m->func_name); + Py_VISIT(m->func_qualname); + Py_VISIT(m->func_doc); + Py_VISIT(m->func_globals); + Py_VISIT(m->func_code); + Py_VISIT(m->func_classobj); + Py_VISIT(m->defaults_tuple); + Py_VISIT(m->defaults_kwdict); + if (m->defaults) { + PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); + int i; + for (i = 0; i < m->defaults_pyobjects; i++) + Py_VISIT(pydefaults[i]); + } + return 0; +} +static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type) +{ + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) { + Py_INCREF(func); + return func; + } + if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) { + if (type == NULL) + type = (PyObject *)(Py_TYPE(obj)); + return __Pyx_PyMethod_New(func, type, (PyObject *)(Py_TYPE(type))); + } + if (obj == Py_None) + obj = NULL; + return __Pyx_PyMethod_New(func, obj, type); +} +static PyObject* +__Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) +{ +#if PY_MAJOR_VERSION >= 3 + return PyUnicode_FromFormat("", + op->func_qualname, (void *)op); +#else + return PyString_FromFormat("", + PyString_AsString(op->func_qualname), (void *)op); +#endif +} +static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) { + PyCFunctionObject* f = (PyCFunctionObject*)func; + PyCFunction meth = f->m_ml->ml_meth; + Py_ssize_t size; + switch (f->m_ml->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) { + case METH_VARARGS: + if (likely(kw == NULL || PyDict_Size(kw) == 0)) + return (*meth)(self, arg); + break; + case METH_VARARGS | METH_KEYWORDS: + return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw); + case METH_NOARGS: + if (likely(kw == NULL || PyDict_Size(kw) == 0)) { + size = PyTuple_GET_SIZE(arg); + if (likely(size == 0)) + return (*meth)(self, NULL); + PyErr_Format(PyExc_TypeError, + "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", + f->m_ml->ml_name, size); + return NULL; + } + break; + case METH_O: + if (likely(kw == NULL || PyDict_Size(kw) == 0)) { + size = PyTuple_GET_SIZE(arg); + if (likely(size == 1)) { + PyObject *result, *arg0; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + arg0 = PyTuple_GET_ITEM(arg, 0); + #else + arg0 = PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL; + #endif + result = (*meth)(self, arg0); + #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) + Py_DECREF(arg0); + #endif + return result; + } + PyErr_Format(PyExc_TypeError, + "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", + f->m_ml->ml_name, size); + return NULL; + } + break; + default: + PyErr_SetString(PyExc_SystemError, "Bad call flags in " + "__Pyx_CyFunction_Call. METH_OLDARGS is no " + "longer supported!"); + return NULL; + } + PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", + f->m_ml->ml_name); + return NULL; +} +static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { + return __Pyx_CyFunction_CallMethod(func, ((PyCFunctionObject*)func)->m_self, arg, kw); +} +static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) { + PyObject *result; + __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func; + if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { + Py_ssize_t argc; + PyObject *new_args; + PyObject *self; + argc = PyTuple_GET_SIZE(args); + new_args = PyTuple_GetSlice(args, 1, argc); + if (unlikely(!new_args)) + return NULL; + self = PyTuple_GetItem(args, 0); + if (unlikely(!self)) { + Py_DECREF(new_args); + return NULL; + } + result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw); + Py_DECREF(new_args); + } else { + result = __Pyx_CyFunction_Call(func, args, kw); + } + return result; +} +static PyTypeObject __pyx_CyFunctionType_type = { + PyVarObject_HEAD_INIT(0, 0) + "cython_function_or_method", + sizeof(__pyx_CyFunctionObject), + 0, + (destructor) __Pyx_CyFunction_dealloc, + 0, + 0, + 0, +#if PY_MAJOR_VERSION < 3 + 0, +#else + 0, +#endif + (reprfunc) __Pyx_CyFunction_repr, + 0, + 0, + 0, + 0, + __Pyx_CyFunction_CallAsMethod, + 0, + 0, + 0, + 0, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, + 0, + (traverseproc) __Pyx_CyFunction_traverse, + (inquiry) __Pyx_CyFunction_clear, + 0, +#if PY_VERSION_HEX < 0x030500A0 + offsetof(__pyx_CyFunctionObject, func_weakreflist), +#else + offsetof(PyCFunctionObject, m_weakreflist), +#endif + 0, + 0, + __pyx_CyFunction_methods, + __pyx_CyFunction_members, + __pyx_CyFunction_getsets, + 0, + 0, + __Pyx_CyFunction_descr_get, + 0, + offsetof(__pyx_CyFunctionObject, func_dict), + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, +#if PY_VERSION_HEX >= 0x030400a1 + 0, +#endif +}; +static int __pyx_CyFunction_init(void) { + __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); + if (unlikely(__pyx_CyFunctionType == NULL)) { + return -1; + } + return 0; +} +static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults = PyObject_Malloc(size); + if (unlikely(!m->defaults)) + return PyErr_NoMemory(); + memset(m->defaults, 0, size); + m->defaults_pyobjects = pyobjects; + return m->defaults; +} +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults_tuple = tuple; + Py_INCREF(tuple); +} +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults_kwdict = dict; + Py_INCREF(dict); +} +static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->func_annotations = dict; + Py_INCREF(dict); +} + +/* GetModuleGlobalName */ +#if CYTHON_USE_DICT_VERSIONS +static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value) +#else +static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) +#endif +{ + PyObject *result; +#if !CYTHON_AVOID_BORROWED_REFS +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 + result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } else if (unlikely(PyErr_Occurred())) { + return NULL; + } +#else + result = PyDict_GetItem(__pyx_d, name); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } +#endif +#else + result = PyObject_GetItem(__pyx_d, name); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } + PyErr_Clear(); +#endif + return __Pyx_GetBuiltinName(name); +} + +/* Globals */ +static PyObject* __Pyx_Globals(void) { + Py_ssize_t i; + PyObject *names; + PyObject *globals = __pyx_d; + Py_INCREF(globals); + names = PyObject_Dir(__pyx_m); + if (!names) + goto bad; + for (i = PyList_GET_SIZE(names)-1; i >= 0; i--) { +#if CYTHON_COMPILING_IN_PYPY + PyObject* name = PySequence_ITEM(names, i); + if (!name) + goto bad; +#else + PyObject* name = PyList_GET_ITEM(names, i); +#endif + if (!PyDict_Contains(globals, name)) { + PyObject* value = __Pyx_GetAttr(__pyx_m, name); + if (!value) { +#if CYTHON_COMPILING_IN_PYPY + Py_DECREF(name); +#endif + goto bad; + } + if (PyDict_SetItem(globals, name, value) < 0) { +#if CYTHON_COMPILING_IN_PYPY + Py_DECREF(name); +#endif + Py_DECREF(value); + goto bad; + } + } +#if CYTHON_COMPILING_IN_PYPY + Py_DECREF(name); +#endif + } + Py_DECREF(names); + return globals; +bad: + Py_XDECREF(names); + Py_XDECREF(globals); + return NULL; +} + +/* CLineInTraceback */ +#ifndef CYTHON_CLINE_IN_TRACEBACK +static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { + PyObject *use_cline; + PyObject *ptype, *pvalue, *ptraceback; +#if CYTHON_COMPILING_IN_CPYTHON + PyObject **cython_runtime_dict; +#endif + if (unlikely(!__pyx_cython_runtime)) { + return c_line; + } + __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); +#if CYTHON_COMPILING_IN_CPYTHON + cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); + if (likely(cython_runtime_dict)) { + __PYX_PY_DICT_LOOKUP_IF_MODIFIED( + use_cline, *cython_runtime_dict, + __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback)) + } else +#endif + { + PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback); + if (use_cline_obj) { + use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; + Py_DECREF(use_cline_obj); + } else { + PyErr_Clear(); + use_cline = NULL; + } + } + if (!use_cline) { + c_line = 0; + PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); + } + else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { + c_line = 0; + } + __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); + return c_line; +} +#endif + +/* CodeObjectCache */ +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { + int start = 0, mid = 0, end = count - 1; + if (end >= 0 && code_line > entries[end].code_line) { + return count; + } + while (start < end) { + mid = start + (end - start) / 2; + if (code_line < entries[mid].code_line) { + end = mid; + } else if (code_line > entries[mid].code_line) { + start = mid + 1; + } else { + return mid; + } + } + if (code_line <= entries[mid].code_line) { + return mid; + } else { + return mid + 1; + } +} +static PyCodeObject *__pyx_find_code_object(int code_line) { + PyCodeObject* code_object; + int pos; + if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { + return NULL; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { + return NULL; + } + code_object = __pyx_code_cache.entries[pos].code_object; + Py_INCREF(code_object); + return code_object; +} +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { + int pos, i; + __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; + if (unlikely(!code_line)) { + return; + } + if (unlikely(!entries)) { + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); + if (likely(entries)) { + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = 64; + __pyx_code_cache.count = 1; + entries[0].code_line = code_line; + entries[0].code_object = code_object; + Py_INCREF(code_object); + } + return; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { + PyCodeObject* tmp = entries[pos].code_object; + entries[pos].code_object = code_object; + Py_DECREF(tmp); + return; + } + if (__pyx_code_cache.count == __pyx_code_cache.max_count) { + int new_max = __pyx_code_cache.max_count + 64; + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( + __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry)); + if (unlikely(!entries)) { + return; + } + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = new_max; + } + for (i=__pyx_code_cache.count; i>pos; i--) { + entries[i] = entries[i-1]; + } + entries[pos].code_line = code_line; + entries[pos].code_object = code_object; + __pyx_code_cache.count++; + Py_INCREF(code_object); +} + +/* AddTraceback */ +#include "compile.h" +#include "frameobject.h" +#include "traceback.h" +static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( + const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyObject *py_srcfile = 0; + PyObject *py_funcname = 0; + #if PY_MAJOR_VERSION < 3 + py_srcfile = PyString_FromString(filename); + #else + py_srcfile = PyUnicode_FromString(filename); + #endif + if (!py_srcfile) goto bad; + if (c_line) { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + #else + py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + #endif + } + else { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromString(funcname); + #else + py_funcname = PyUnicode_FromString(funcname); + #endif + } + if (!py_funcname) goto bad; + py_code = __Pyx_PyCode_New( + 0, + 0, + 0, + 0, + 0, + __pyx_empty_bytes, /*PyObject *code,*/ + __pyx_empty_tuple, /*PyObject *consts,*/ + __pyx_empty_tuple, /*PyObject *names,*/ + __pyx_empty_tuple, /*PyObject *varnames,*/ + __pyx_empty_tuple, /*PyObject *freevars,*/ + __pyx_empty_tuple, /*PyObject *cellvars,*/ + py_srcfile, /*PyObject *filename,*/ + py_funcname, /*PyObject *name,*/ + py_line, + __pyx_empty_bytes /*PyObject *lnotab*/ + ); + Py_DECREF(py_srcfile); + Py_DECREF(py_funcname); + return py_code; +bad: + Py_XDECREF(py_srcfile); + Py_XDECREF(py_funcname); + return NULL; +} +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyFrameObject *py_frame = 0; + PyThreadState *tstate = __Pyx_PyThreadState_Current; + if (c_line) { + c_line = __Pyx_CLineForTraceback(tstate, c_line); + } + py_code = __pyx_find_code_object(c_line ? -c_line : py_line); + if (!py_code) { + py_code = __Pyx_CreateCodeObjectForTraceback( + funcname, c_line, py_line, filename); + if (!py_code) goto bad; + __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); + } + py_frame = PyFrame_New( + tstate, /*PyThreadState *tstate,*/ + py_code, /*PyCodeObject *code,*/ + __pyx_d, /*PyObject *globals,*/ + 0 /*PyObject *locals*/ + ); + if (!py_frame) goto bad; + __Pyx_PyFrame_SetLineNumber(py_frame, py_line); + PyTraceBack_Here(py_frame); +bad: + Py_XDECREF(py_code); + Py_XDECREF(py_frame); +} + +/* CIntToPy */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { + const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(long) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(long) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(long) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(long), + little, !is_unsigned); + } +} + +/* CIntFromPyVerify */ +#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ + __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) +#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ + __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) +#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ + {\ + func_type value = func_value;\ + if (sizeof(target_type) < sizeof(func_type)) {\ + if (unlikely(value != (func_type) (target_type) value)) {\ + func_type zero = 0;\ + if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ + return (target_type) -1;\ + if (is_unsigned && unlikely(value < zero))\ + goto raise_neg_overflow;\ + else\ + goto raise_overflow;\ + }\ + }\ + return (target_type) value;\ + } + +/* CIntFromPy */ +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { + const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(long) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (long) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (long) 0; + case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0]) + case 2: + if (8 * sizeof(long) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) { + return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + case 3: + if (8 * sizeof(long) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) { + return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + case 4: + if (8 * sizeof(long) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) { + return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (long) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if (sizeof(long) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (long) 0; + case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0])) + case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0]) + case -2: + if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 2: + if (8 * sizeof(long) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case -3: + if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 3: + if (8 * sizeof(long) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case -4: + if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 4: + if (8 * sizeof(long) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + } +#endif + if (sizeof(long) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + long val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (long) -1; + } + } else { + long val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (long) -1; + val = __Pyx_PyInt_As_long(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to long"); + return (long) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to long"); + return (long) -1; +} + +/* CIntFromPy */ +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { + const int neg_one = (int) ((int) 0 - (int) 1), const_zero = (int) 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(int) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (int) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (int) 0; + case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0]) + case 2: + if (8 * sizeof(int) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) { + return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + case 3: + if (8 * sizeof(int) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) { + return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + case 4: + if (8 * sizeof(int) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) { + return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (int) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if (sizeof(int) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (int) 0; + case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0])) + case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0]) + case -2: + if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { + return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 2: + if (8 * sizeof(int) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { + return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case -3: + if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { + return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 3: + if (8 * sizeof(int) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { + return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case -4: + if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { + return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 4: + if (8 * sizeof(int) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { + return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + } +#endif + if (sizeof(int) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + int val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (int) -1; + } + } else { + int val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (int) -1; + val = __Pyx_PyInt_As_int(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to int"); + return (int) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to int"); + return (int) -1; +} + +/* FastTypeChecks */ +#if CYTHON_COMPILING_IN_CPYTHON +static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) { + while (a) { + a = a->tp_base; + if (a == b) + return 1; + } + return b == &PyBaseObject_Type; +} +static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) { + PyObject *mro; + if (a == b) return 1; + mro = a->tp_mro; + if (likely(mro)) { + Py_ssize_t i, n; + n = PyTuple_GET_SIZE(mro); + for (i = 0; i < n; i++) { + if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b) + return 1; + } + return 0; + } + return __Pyx_InBases(a, b); +} +#if PY_MAJOR_VERSION == 2 +static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { + PyObject *exception, *value, *tb; + int res; + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ErrFetch(&exception, &value, &tb); + res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; + if (unlikely(res == -1)) { + PyErr_WriteUnraisable(err); + res = 0; + } + if (!res) { + res = PyObject_IsSubclass(err, exc_type2); + if (unlikely(res == -1)) { + PyErr_WriteUnraisable(err); + res = 0; + } + } + __Pyx_ErrRestore(exception, value, tb); + return res; +} +#else +static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { + int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0; + if (!res) { + res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); + } + return res; +} +#endif +static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { + Py_ssize_t i, n; + assert(PyExceptionClass_Check(exc_type)); + n = PyTuple_GET_SIZE(tuple); +#if PY_MAJOR_VERSION >= 3 + for (i=0; i= 0x02070000 + cobj = PyCapsule_New(p, sig, 0); +#else + cobj = PyCObject_FromVoidPtrAndDesc(p, (void *)sig, 0); +#endif + if (!cobj) + goto bad; + if (PyDict_SetItem(d, name, cobj) < 0) + goto bad; + Py_DECREF(cobj); + Py_DECREF(d); + return 0; +bad: + Py_XDECREF(cobj); + Py_XDECREF(d); + return -1; +} + +/* FunctionExport */ +static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig) { + PyObject *d = 0; + PyObject *cobj = 0; + union { + void (*fp)(void); + void *p; + } tmp; + d = PyObject_GetAttrString(__pyx_m, (char *)"__pyx_capi__"); + if (!d) { + PyErr_Clear(); + d = PyDict_New(); + if (!d) + goto bad; + Py_INCREF(d); + if (PyModule_AddObject(__pyx_m, (char *)"__pyx_capi__", d) < 0) + goto bad; + } + tmp.fp = f; +#if PY_VERSION_HEX >= 0x02070000 + cobj = PyCapsule_New(tmp.p, sig, 0); +#else + cobj = PyCObject_FromVoidPtrAndDesc(tmp.p, (void *)sig, 0); +#endif + if (!cobj) + goto bad; + if (PyDict_SetItemString(d, name, cobj) < 0) + goto bad; + Py_DECREF(cobj); + Py_DECREF(d); + return 0; +bad: + Py_XDECREF(cobj); + Py_XDECREF(d); + return -1; +} + +/* InitStrings */ +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { + while (t->p) { + #if PY_MAJOR_VERSION < 3 + if (t->is_unicode) { + *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); + } else if (t->intern) { + *t->p = PyString_InternFromString(t->s); + } else { + *t->p = PyString_FromStringAndSize(t->s, t->n - 1); + } + #else + if (t->is_unicode | t->is_str) { + if (t->intern) { + *t->p = PyUnicode_InternFromString(t->s); + } else if (t->encoding) { + *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); + } else { + *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); + } + } else { + *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); + } + #endif + if (!*t->p) + return -1; + if (PyObject_Hash(*t->p) == -1) + return -1; + ++t; + } + return 0; +} + +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { + return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); +} +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { + Py_ssize_t ignore; + return __Pyx_PyObject_AsStringAndSize(o, &ignore); +} +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +#if !CYTHON_PEP393_ENABLED +static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { + char* defenc_c; + PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); + if (!defenc) return NULL; + defenc_c = PyBytes_AS_STRING(defenc); +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + { + char* end = defenc_c + PyBytes_GET_SIZE(defenc); + char* c; + for (c = defenc_c; c < end; c++) { + if ((unsigned char) (*c) >= 128) { + PyUnicode_AsASCIIString(o); + return NULL; + } + } + } +#endif + *length = PyBytes_GET_SIZE(defenc); + return defenc_c; +} +#else +static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { + if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + if (likely(PyUnicode_IS_ASCII(o))) { + *length = PyUnicode_GET_LENGTH(o); + return PyUnicode_AsUTF8(o); + } else { + PyUnicode_AsASCIIString(o); + return NULL; + } +#else + return PyUnicode_AsUTF8AndSize(o, length); +#endif +} +#endif +#endif +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT + if ( +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + __Pyx_sys_getdefaultencoding_not_ascii && +#endif + PyUnicode_Check(o)) { + return __Pyx_PyUnicode_AsStringAndSize(o, length); + } else +#endif +#if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) + if (PyByteArray_Check(o)) { + *length = PyByteArray_GET_SIZE(o); + return PyByteArray_AS_STRING(o); + } else +#endif + { + char* result; + int r = PyBytes_AsStringAndSize(o, &result, length); + if (unlikely(r < 0)) { + return NULL; + } else { + return result; + } + } +} +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { + int is_true = x == Py_True; + if (is_true | (x == Py_False) | (x == Py_None)) return is_true; + else return PyObject_IsTrue(x); +} +static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) { + int retval; + if (unlikely(!x)) return -1; + retval = __Pyx_PyObject_IsTrue(x); + Py_DECREF(x); + return retval; +} +static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) { +#if PY_MAJOR_VERSION >= 3 + if (PyLong_Check(result)) { + if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, + "__int__ returned non-int (type %.200s). " + "The ability to return an instance of a strict subclass of int " + "is deprecated, and may be removed in a future version of Python.", + Py_TYPE(result)->tp_name)) { + Py_DECREF(result); + return NULL; + } + return result; + } +#endif + PyErr_Format(PyExc_TypeError, + "__%.4s__ returned non-%.4s (type %.200s)", + type_name, type_name, Py_TYPE(result)->tp_name); + Py_DECREF(result); + return NULL; +} +static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { +#if CYTHON_USE_TYPE_SLOTS + PyNumberMethods *m; +#endif + const char *name = NULL; + PyObject *res = NULL; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x) || PyLong_Check(x))) +#else + if (likely(PyLong_Check(x))) +#endif + return __Pyx_NewRef(x); +#if CYTHON_USE_TYPE_SLOTS + m = Py_TYPE(x)->tp_as_number; + #if PY_MAJOR_VERSION < 3 + if (m && m->nb_int) { + name = "int"; + res = m->nb_int(x); + } + else if (m && m->nb_long) { + name = "long"; + res = m->nb_long(x); + } + #else + if (likely(m && m->nb_int)) { + name = "int"; + res = m->nb_int(x); + } + #endif +#else + if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { + res = PyNumber_Int(x); + } +#endif + if (likely(res)) { +#if PY_MAJOR_VERSION < 3 + if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) { +#else + if (unlikely(!PyLong_CheckExact(res))) { +#endif + return __Pyx_PyNumber_IntOrLongWrongResultType(res, name); + } + } + else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_TypeError, + "an integer is required"); + } + return res; +} +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { + Py_ssize_t ival; + PyObject *x; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_CheckExact(b))) { + if (sizeof(Py_ssize_t) >= sizeof(long)) + return PyInt_AS_LONG(b); + else + return PyInt_AsSsize_t(b); + } +#endif + if (likely(PyLong_CheckExact(b))) { + #if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)b)->ob_digit; + const Py_ssize_t size = Py_SIZE(b); + if (likely(__Pyx_sst_abs(size) <= 1)) { + ival = likely(size) ? digits[0] : 0; + if (size == -1) ival = -ival; + return ival; + } else { + switch (size) { + case 2: + if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { + return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -2: + if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case 3: + if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { + return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -3: + if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case 4: + if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { + return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -4: + if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + } + } + #endif + return PyLong_AsSsize_t(b); + } + x = PyNumber_Index(b); + if (!x) return -1; + ival = PyInt_AsSsize_t(x); + Py_DECREF(x); + return ival; +} +static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) { + return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False); +} +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { + return PyInt_FromSize_t(ival); +} + + +#endif /* Py_PYTHON_H */ diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_greenlet_primitives.html b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_greenlet_primitives.html new file mode 100644 index 00000000..42ec9258 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_greenlet_primitives.html @@ -0,0 +1,1246 @@ + + + + + + Cython: _greenlet_primitives.py + + + +

Generated by Cython 0.29.2

+

+ Yellow lines hint at Python interaction.
+ Click on a line that starts with a "+" to see the C code that Cython generated for it. +

+

Raw output: _greenlet_primitives.c

+
+01: # -*- coding: utf-8 -*-
+
  __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 02: # copyright (c) 2018 gevent. See  LICENSE.
+
 03: # cython: auto_pickle=False,embedsignature=True,always_allow_keywords=False
+
 04: """
+
 05: A collection of primitives used by the hub, and suitable for
+
 06: compilation with Cython because of their frequency of use.
+
 07: 
+
 08: """
+
 09: from __future__ import absolute_import
+
 10: from __future__ import division
+
 11: from __future__ import print_function
+
 12: 
+
+13: from weakref import ref as wref
+
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 13, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(__pyx_n_s_ref);
+  __Pyx_GIVEREF(__pyx_n_s_ref);
+  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_ref);
+  __pyx_t_2 = __Pyx_Import(__pyx_n_s_weakref, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 13, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_ref); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 13, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(__pyx_t_1);
+  __Pyx_XGOTREF(__pyx_v_6gevent_21__greenlet_primitives_wref);
+  __Pyx_DECREF_SET(__pyx_v_6gevent_21__greenlet_primitives_wref, __pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+14: from gc import get_objects
+
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 14, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_get_objects);
+  __Pyx_GIVEREF(__pyx_n_s_get_objects);
+  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_get_objects);
+  __pyx_t_1 = __Pyx_Import(__pyx_n_s_gc, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 14, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_get_objects); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 14, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(__pyx_t_2);
+  __Pyx_XGOTREF(__pyx_v_6gevent_21__greenlet_primitives_get_objects);
+  __Pyx_DECREF_SET(__pyx_v_6gevent_21__greenlet_primitives_get_objects, __pyx_t_2);
+  __Pyx_GIVEREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 15: 
+
+16: from greenlet import greenlet
+
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 16, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(__pyx_n_s_greenlet);
+  __Pyx_GIVEREF(__pyx_n_s_greenlet);
+  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_greenlet);
+  __pyx_t_2 = __Pyx_Import(__pyx_n_s_greenlet, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 16, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
 17: 
+
+18: from gevent.exceptions import BlockingSwitchOutError
+
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 18, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_BlockingSwitchOutError);
+  __Pyx_GIVEREF(__pyx_n_s_BlockingSwitchOutError);
+  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_BlockingSwitchOutError);
+  __pyx_t_1 = __Pyx_Import(__pyx_n_s_gevent_exceptions, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 18, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_BlockingSwitchOutError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 18, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(__pyx_t_2);
+  __Pyx_XGOTREF(__pyx_v_6gevent_21__greenlet_primitives_BlockingSwitchOutError);
+  __Pyx_DECREF_SET(__pyx_v_6gevent_21__greenlet_primitives_BlockingSwitchOutError, __pyx_t_2);
+  __Pyx_GIVEREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 19: 
+
 20: 
+
 21: # In Cython, we define these as 'cdef inline' functions. The
+
 22: # compilation unit cannot have a direct assignment to them (import
+
 23: # is assignment) without generating a 'lvalue is not valid target'
+
 24: # error.
+
+25: locals()['getcurrent'] = __import__('greenlet').getcurrent
+
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin___import__, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 25, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_getcurrent); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 25, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_1 = __Pyx_Globals(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 25, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (unlikely(PyDict_SetItem(__pyx_t_1, __pyx_n_s_getcurrent, __pyx_t_2) < 0)) __PYX_ERR(0, 25, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+/* … */
+  __pyx_tuple_ = PyTuple_Pack(1, __pyx_n_s_greenlet); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 25, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple_);
+  __Pyx_GIVEREF(__pyx_tuple_);
+
+26: locals()['greenlet_init'] = lambda: None
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_21__greenlet_primitives_4lambda(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyMethodDef __pyx_mdef_6gevent_21__greenlet_primitives_4lambda = {"lambda", (PyCFunction)__pyx_pw_6gevent_21__greenlet_primitives_4lambda, METH_NOARGS, 0};
+static PyObject *__pyx_pw_6gevent_21__greenlet_primitives_4lambda(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("lambda (wrapper)", 0);
+  __pyx_r = __pyx_lambda_funcdef_6gevent_21__greenlet_primitives_lambda(__pyx_self);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_lambda_funcdef_6gevent_21__greenlet_primitives_lambda(CYTHON_UNUSED PyObject *__pyx_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("lambda", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_21__greenlet_primitives_4lambda, 0, __pyx_n_s_lambda, NULL, __pyx_n_s_gevent___greenlet_primitives, __pyx_d, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 26, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_1 = __Pyx_Globals(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 26, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (unlikely(PyDict_SetItem(__pyx_t_1, __pyx_n_s_greenlet_init, __pyx_t_2) < 0)) __PYX_ERR(0, 26, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+27: locals()['_greenlet_switch'] = greenlet.switch
+
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_6gevent_21__greenlet_primitives_greenlet), __pyx_n_s_switch); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 27, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_1 = __Pyx_Globals(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 27, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (unlikely(PyDict_SetItem(__pyx_t_1, __pyx_n_s_greenlet_switch, __pyx_t_2) < 0)) __PYX_ERR(0, 27, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
 28: 
+
+29: __all__ = [
+
  __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 29, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_TrackedRawGreenlet);
+  __Pyx_GIVEREF(__pyx_n_s_TrackedRawGreenlet);
+  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_TrackedRawGreenlet);
+  __Pyx_INCREF(__pyx_n_s_SwitchOutGreenletWithLoop);
+  __Pyx_GIVEREF(__pyx_n_s_SwitchOutGreenletWithLoop);
+  PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_SwitchOutGreenletWithLoop);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_all, __pyx_t_2) < 0) __PYX_ERR(0, 29, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
 30:     'TrackedRawGreenlet',
+
 31:     'SwitchOutGreenletWithLoop',
+
 32: ]
+
 33: 
+
 34: class TrackedRawGreenlet(greenlet):
+
 35: 
+
+36:     def __init__(self, function, parent):
+
/* Python wrapper */
+static int __pyx_pw_6gevent_21__greenlet_primitives_18TrackedRawGreenlet_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static int __pyx_pw_6gevent_21__greenlet_primitives_18TrackedRawGreenlet_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_function = 0;
+  PyObject *__pyx_v_parent = 0;
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_function,&__pyx_n_s_parent,0};
+    PyObject* values[2] = {0,0};
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_function)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_parent)) != 0)) kw_args--;
+        else {
+          __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(0, 36, __pyx_L3_error)
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 36, __pyx_L3_error)
+      }
+    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
+      goto __pyx_L5_argtuple_error;
+    } else {
+      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+    }
+    __pyx_v_function = values[0];
+    __pyx_v_parent = values[1];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 36, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.__greenlet_primitives.TrackedRawGreenlet.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return -1;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_21__greenlet_primitives_18TrackedRawGreenlet___init__(((struct __pyx_obj_6gevent_21__greenlet_primitives_TrackedRawGreenlet *)__pyx_v_self), __pyx_v_function, __pyx_v_parent);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_21__greenlet_primitives_18TrackedRawGreenlet___init__(struct __pyx_obj_6gevent_21__greenlet_primitives_TrackedRawGreenlet *__pyx_v_self, PyObject *__pyx_v_function, PyObject *__pyx_v_parent) {
+  PyGreenlet *__pyx_v_current = NULL;
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = 0;
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_AddTraceback("gevent.__greenlet_primitives.TrackedRawGreenlet.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = -1;
+  __pyx_L0:;
+  __Pyx_XDECREF((PyObject *)__pyx_v_current);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+37:         greenlet.__init__(self, function, parent)
+
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_6gevent_21__greenlet_primitives_greenlet), __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 37, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = NULL;
+  __pyx_t_4 = 0;
+  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+    if (likely(__pyx_t_3)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+      __Pyx_INCREF(__pyx_t_3);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_2, function);
+      __pyx_t_4 = 1;
+    }
+  }
+  #if CYTHON_FAST_PYCALL
+  if (PyFunction_Check(__pyx_t_2)) {
+    PyObject *__pyx_temp[4] = {__pyx_t_3, ((PyObject *)__pyx_v_self), __pyx_v_function, __pyx_v_parent};
+    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 37, __pyx_L1_error)
+    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __Pyx_GOTREF(__pyx_t_1);
+  } else
+  #endif
+  #if CYTHON_FAST_PYCCALL
+  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
+    PyObject *__pyx_temp[4] = {__pyx_t_3, ((PyObject *)__pyx_v_self), __pyx_v_function, __pyx_v_parent};
+    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 37, __pyx_L1_error)
+    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __Pyx_GOTREF(__pyx_t_1);
+  } else
+  #endif
+  {
+    __pyx_t_5 = PyTuple_New(3+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 37, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_5);
+    if (__pyx_t_3) {
+      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
+    }
+    __Pyx_INCREF(((PyObject *)__pyx_v_self));
+    __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
+    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, ((PyObject *)__pyx_v_self));
+    __Pyx_INCREF(__pyx_v_function);
+    __Pyx_GIVEREF(__pyx_v_function);
+    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_function);
+    __Pyx_INCREF(__pyx_v_parent);
+    __Pyx_GIVEREF(__pyx_v_parent);
+    PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_4, __pyx_v_parent);
+    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 37, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+  }
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 38:         # See greenlet.py's Greenlet class. We capture the cheap
+
 39:         # parts to maintain the tree structure, but we do not capture
+
 40:         # the stack because that's too expensive for 'spawn_raw'.
+
 41: 
+
+42:         current = getcurrent() # pylint:disable=undefined-variable
+
  __pyx_t_1 = ((PyObject *)__pyx_f_6gevent_21__greenlet_primitives_getcurrent()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 42, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_v_current = ((PyGreenlet *)__pyx_t_1);
+  __pyx_t_1 = 0;
+
+43:         self.spawning_greenlet = wref(current)
+
  __Pyx_INCREF(__pyx_v_6gevent_21__greenlet_primitives_wref);
+  __pyx_t_2 = __pyx_v_6gevent_21__greenlet_primitives_wref; __pyx_t_5 = NULL;
+  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
+    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
+    if (likely(__pyx_t_5)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+      __Pyx_INCREF(__pyx_t_5);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_2, function);
+    }
+  }
+  __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, ((PyObject *)__pyx_v_current)) : __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_v_current));
+  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 43, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_spawning_greenlet, __pyx_t_1) < 0) __PYX_ERR(0, 43, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 44:         # See Greenlet for how trees are maintained.
+
+45:         try:
+
  {
+    /*try:*/ {
+/* … */
+    }
+    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
+    goto __pyx_L8_try_end;
+    __pyx_L3_error:;
+    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+/* … */
+    __Pyx_XGIVEREF(__pyx_t_6);
+    __Pyx_XGIVEREF(__pyx_t_7);
+    __Pyx_XGIVEREF(__pyx_t_8);
+    __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
+    goto __pyx_L1_error;
+    __pyx_L4_exception_handled:;
+    __Pyx_XGIVEREF(__pyx_t_6);
+    __Pyx_XGIVEREF(__pyx_t_7);
+    __Pyx_XGIVEREF(__pyx_t_8);
+    __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
+    __pyx_L8_try_end:;
+  }
+
+46:             self.spawn_tree_locals = current.spawn_tree_locals
+
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_current), __pyx_n_s_spawn_tree_locals); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 46, __pyx_L3_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_spawn_tree_locals, __pyx_t_1) < 0) __PYX_ERR(0, 46, __pyx_L3_error)
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+47:         except AttributeError:
+
    __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_AttributeError);
+    if (__pyx_t_4) {
+      __Pyx_AddTraceback("gevent.__greenlet_primitives.TrackedRawGreenlet.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+      if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_2, &__pyx_t_5) < 0) __PYX_ERR(0, 47, __pyx_L5_except_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      __Pyx_GOTREF(__pyx_t_2);
+      __Pyx_GOTREF(__pyx_t_5);
+
+48:             self.spawn_tree_locals = {}
+
      __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 48, __pyx_L5_except_error)
+      __Pyx_GOTREF(__pyx_t_3);
+      if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_spawn_tree_locals, __pyx_t_3) < 0) __PYX_ERR(0, 48, __pyx_L5_except_error)
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+
+49:             if current.parent:
+
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_current), __pyx_n_s_parent); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 49, __pyx_L5_except_error)
+      __Pyx_GOTREF(__pyx_t_3);
+      __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 49, __pyx_L5_except_error)
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+      if (__pyx_t_9) {
+/* … */
+      }
+      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+      goto __pyx_L4_exception_handled;
+    }
+    goto __pyx_L5_except_error;
+    __pyx_L5_except_error:;
+
+50:                 current.spawn_tree_locals = self.spawn_tree_locals
+
        __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_spawn_tree_locals); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 50, __pyx_L5_except_error)
+        __Pyx_GOTREF(__pyx_t_3);
+        if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_current), __pyx_n_s_spawn_tree_locals, __pyx_t_3) < 0) __PYX_ERR(0, 50, __pyx_L5_except_error)
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+
 51: 
+
 52: 
+
+53: class SwitchOutGreenletWithLoop(TrackedRawGreenlet):
+
struct __pyx_vtabstruct_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop {
+  PyObject *(*__pyx_switch)(struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *, int __pyx_skip_dispatch);
+  PyObject *(*switch_out)(struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *, int __pyx_skip_dispatch);
+};
+static struct __pyx_vtabstruct_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *__pyx_vtabptr_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop;
+
 54:     # Subclasses must define:
+
 55:     # - self.loop
+
 56: 
+
 57:     # This class defines loop in its .pxd for Cython. This lets us avoid
+
 58:     # circular dependencies with the hub.
+
 59: 
+
+60:     def switch(self):
+
static PyObject *__pyx_pw_6gevent_21__greenlet_primitives_25SwitchOutGreenletWithLoop_1switch(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyObject *__pyx_f_6gevent_21__greenlet_primitives_25SwitchOutGreenletWithLoop_switch(struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *__pyx_v_self, int __pyx_skip_dispatch) {
+  PyObject *__pyx_v_switch_out = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("switch", 0);
+  /* Check if called by wrapper */
+  if (unlikely(__pyx_skip_dispatch)) ;
+  /* Check if overridden in Python */
+  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
+    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
+    if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
+    else {
+      PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      #endif
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_switch); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 60, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_21__greenlet_primitives_25SwitchOutGreenletWithLoop_1switch)) {
+        __Pyx_XDECREF(__pyx_r);
+        __Pyx_INCREF(__pyx_t_1);
+        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+          if (likely(__pyx_t_4)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+            __Pyx_INCREF(__pyx_t_4);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_3, function);
+          }
+        }
+        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
+        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 60, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __pyx_r = __pyx_t_2;
+        __pyx_t_2 = 0;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        goto __pyx_L0;
+      }
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+      tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
+      if (unlikely(type_dict_guard != tp_dict_version)) {
+        tp_dict_version = obj_dict_version = 0;
+      }
+      #endif
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    }
+    #endif
+  }
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_AddTraceback("gevent.__greenlet_primitives.SwitchOutGreenletWithLoop.switch", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_switch_out);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_21__greenlet_primitives_25SwitchOutGreenletWithLoop_1switch(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6gevent_21__greenlet_primitives_25SwitchOutGreenletWithLoop_switch[] = "SwitchOutGreenletWithLoop.switch(self)";
+static PyMethodDef __pyx_mdef_6gevent_21__greenlet_primitives_25SwitchOutGreenletWithLoop_1switch = {"switch", (PyCFunction)__pyx_pw_6gevent_21__greenlet_primitives_25SwitchOutGreenletWithLoop_1switch, METH_NOARGS, __pyx_doc_6gevent_21__greenlet_primitives_25SwitchOutGreenletWithLoop_switch};
+static PyObject *__pyx_pw_6gevent_21__greenlet_primitives_25SwitchOutGreenletWithLoop_1switch(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("switch (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_21__greenlet_primitives_25SwitchOutGreenletWithLoop_switch(((struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_21__greenlet_primitives_25SwitchOutGreenletWithLoop_switch(struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("switch", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __pyx_f_6gevent_21__greenlet_primitives_25SwitchOutGreenletWithLoop_switch(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 60, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.__greenlet_primitives.SwitchOutGreenletWithLoop.switch", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__2 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 60, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__2);
+  __Pyx_GIVEREF(__pyx_tuple__2);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_21__greenlet_primitives_25SwitchOutGreenletWithLoop_1switch, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_SwitchOutGreenletWithLoop_switch, NULL, __pyx_n_s_gevent___greenlet_primitives, __pyx_d, ((PyObject *)__pyx_codeobj__3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 60, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop->tp_dict, __pyx_n_s_switch, __pyx_t_2) < 0) __PYX_ERR(0, 60, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop);
+  __pyx_codeobj__3 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__greenlet_primitives, __pyx_n_s_switch, 60, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__3)) __PYX_ERR(0, 60, __pyx_L1_error)
+
+61:         switch_out = getattr(getcurrent(), 'switch_out', None) # pylint:disable=undefined-variable
+
  __pyx_t_1 = ((PyObject *)__pyx_f_6gevent_21__greenlet_primitives_getcurrent()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 61, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = __Pyx_GetAttr3(__pyx_t_1, __pyx_n_s_switch_out, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 61, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_v_switch_out = __pyx_t_2;
+  __pyx_t_2 = 0;
+
+62:         if switch_out is not None:
+
  __pyx_t_5 = (__pyx_v_switch_out != Py_None);
+  __pyx_t_6 = (__pyx_t_5 != 0);
+  if (__pyx_t_6) {
+/* … */
+  }
+
+63:             switch_out()
+
    __Pyx_INCREF(__pyx_v_switch_out);
+    __pyx_t_1 = __pyx_v_switch_out; __pyx_t_3 = NULL;
+    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
+      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
+      if (likely(__pyx_t_3)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
+        __Pyx_INCREF(__pyx_t_3);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_1, function);
+      }
+    }
+    __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_1);
+    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 63, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+64:         return _greenlet_switch(self) # pylint:disable=undefined-variable
+
  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_2 = __pyx_f_6gevent_21__greenlet_primitives__greenlet_switch(((PyGreenlet *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 64, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_r = __pyx_t_2;
+  __pyx_t_2 = 0;
+  goto __pyx_L0;
+
 65: 
+
+66:     def switch_out(self):
+
static PyObject *__pyx_pw_6gevent_21__greenlet_primitives_25SwitchOutGreenletWithLoop_3switch_out(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyObject *__pyx_f_6gevent_21__greenlet_primitives_25SwitchOutGreenletWithLoop_switch_out(CYTHON_UNUSED struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *__pyx_v_self, int __pyx_skip_dispatch) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("switch_out", 0);
+  /* Check if called by wrapper */
+  if (unlikely(__pyx_skip_dispatch)) ;
+  /* Check if overridden in Python */
+  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
+    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
+    if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
+    else {
+      PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      #endif
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_switch_out); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 66, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_21__greenlet_primitives_25SwitchOutGreenletWithLoop_3switch_out)) {
+        __Pyx_XDECREF(__pyx_r);
+        __Pyx_INCREF(__pyx_t_1);
+        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+          if (likely(__pyx_t_4)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+            __Pyx_INCREF(__pyx_t_4);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_3, function);
+          }
+        }
+        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
+        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 66, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __pyx_r = __pyx_t_2;
+        __pyx_t_2 = 0;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        goto __pyx_L0;
+      }
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+      tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
+      if (unlikely(type_dict_guard != tp_dict_version)) {
+        tp_dict_version = obj_dict_version = 0;
+      }
+      #endif
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    }
+    #endif
+  }
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_AddTraceback("gevent.__greenlet_primitives.SwitchOutGreenletWithLoop.switch_out", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_21__greenlet_primitives_25SwitchOutGreenletWithLoop_3switch_out(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6gevent_21__greenlet_primitives_25SwitchOutGreenletWithLoop_2switch_out[] = "SwitchOutGreenletWithLoop.switch_out(self)";
+static PyMethodDef __pyx_mdef_6gevent_21__greenlet_primitives_25SwitchOutGreenletWithLoop_3switch_out = {"switch_out", (PyCFunction)__pyx_pw_6gevent_21__greenlet_primitives_25SwitchOutGreenletWithLoop_3switch_out, METH_NOARGS, __pyx_doc_6gevent_21__greenlet_primitives_25SwitchOutGreenletWithLoop_2switch_out};
+static PyObject *__pyx_pw_6gevent_21__greenlet_primitives_25SwitchOutGreenletWithLoop_3switch_out(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("switch_out (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_21__greenlet_primitives_25SwitchOutGreenletWithLoop_2switch_out(((struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_21__greenlet_primitives_25SwitchOutGreenletWithLoop_2switch_out(struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("switch_out", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __pyx_f_6gevent_21__greenlet_primitives_25SwitchOutGreenletWithLoop_switch_out(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 66, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.__greenlet_primitives.SwitchOutGreenletWithLoop.switch_out", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__4 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 66, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__4);
+  __Pyx_GIVEREF(__pyx_tuple__4);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_21__greenlet_primitives_25SwitchOutGreenletWithLoop_3switch_out, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_SwitchOutGreenletWithLoop_switch_2, NULL, __pyx_n_s_gevent___greenlet_primitives, __pyx_d, ((PyObject *)__pyx_codeobj__5)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 66, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop->tp_dict, __pyx_n_s_switch_out, __pyx_t_2) < 0) __PYX_ERR(0, 66, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop);
+  __pyx_codeobj__5 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__4, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__greenlet_primitives, __pyx_n_s_switch_out, 66, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__5)) __PYX_ERR(0, 66, __pyx_L1_error)
+
+67:         raise BlockingSwitchOutError('Impossible to call blocking function in the event loop callback')
+
  __Pyx_INCREF(__pyx_v_6gevent_21__greenlet_primitives_BlockingSwitchOutError);
+  __pyx_t_2 = __pyx_v_6gevent_21__greenlet_primitives_BlockingSwitchOutError; __pyx_t_3 = NULL;
+  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
+    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+    if (likely(__pyx_t_3)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+      __Pyx_INCREF(__pyx_t_3);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_2, function);
+    }
+  }
+  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_kp_s_Impossible_to_call_blocking_func) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_kp_s_Impossible_to_call_blocking_func);
+  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 67, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __PYX_ERR(0, 67, __pyx_L1_error)
+
 68: 
+
 69: 
+
+70: def get_reachable_greenlets():
+
static PyObject *__pyx_pw_6gevent_21__greenlet_primitives_1get_reachable_greenlets(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyObject *__pyx_f_6gevent_21__greenlet_primitives_get_reachable_greenlets(CYTHON_UNUSED int __pyx_skip_dispatch) {
+  PyObject *__pyx_7genexpr__pyx_v_x = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("get_reachable_greenlets", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_AddTraceback("gevent.__greenlet_primitives.get_reachable_greenlets", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_7genexpr__pyx_v_x);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_21__greenlet_primitives_1get_reachable_greenlets(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6gevent_21__greenlet_primitives_get_reachable_greenlets[] = "get_reachable_greenlets() -> list";
+static PyMethodDef __pyx_mdef_6gevent_21__greenlet_primitives_1get_reachable_greenlets = {"get_reachable_greenlets", (PyCFunction)__pyx_pw_6gevent_21__greenlet_primitives_1get_reachable_greenlets, METH_NOARGS, __pyx_doc_6gevent_21__greenlet_primitives_get_reachable_greenlets};
+static PyObject *__pyx_pw_6gevent_21__greenlet_primitives_1get_reachable_greenlets(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("get_reachable_greenlets (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_21__greenlet_primitives_get_reachable_greenlets(__pyx_self);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_21__greenlet_primitives_get_reachable_greenlets(CYTHON_UNUSED PyObject *__pyx_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("get_reachable_greenlets", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __pyx_f_6gevent_21__greenlet_primitives_get_reachable_greenlets(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 70, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.__greenlet_primitives.get_reachable_greenlets", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_21__greenlet_primitives_1get_reachable_greenlets, 0, __pyx_n_s_get_reachable_greenlets, NULL, __pyx_n_s_gevent___greenlet_primitives, __pyx_d, ((PyObject *)__pyx_codeobj__6)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 70, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_reachable_greenlets, __pyx_t_2) < 0) __PYX_ERR(0, 70, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+/* … */
+  __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__greenlet_primitives, __pyx_n_s_get_reachable_greenlets, 70, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__6)) __PYX_ERR(0, 70, __pyx_L1_error)
+
 71:     # We compile this loop with Cython so that it's faster, and so that
+
 72:     # the GIL isn't dropped at unpredictable times during the loop.
+
 73:     # Dropping the GIL could lead to accessing partly constructed objects
+
 74:     # in undefined states (particularly, tuples). This helps close a hole
+
 75:     # where a `SystemError: Objects/tupleobject.c bad argument to internal function`
+
 76:     # could get raised. (Note that this probably doesn't completely close the hole,
+
 77:     # if other threads have dropped the GIL, but hopefully the speed makes that
+
 78:     # more rare.) See https://github.com/gevent/gevent/issues/1302
+
+79:     return [
+
  __Pyx_XDECREF(__pyx_r);
+  { /* enter inner scope */
+    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 79, __pyx_L5_error)
+    __Pyx_GOTREF(__pyx_t_1);
+
+80:         x for x in get_objects()
+
    __Pyx_INCREF(__pyx_v_6gevent_21__greenlet_primitives_get_objects);
+    __pyx_t_3 = __pyx_v_6gevent_21__greenlet_primitives_get_objects; __pyx_t_4 = NULL;
+    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+      if (likely(__pyx_t_4)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+        __Pyx_INCREF(__pyx_t_4);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_3, function);
+      }
+    }
+    __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
+    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 80, __pyx_L5_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
+      __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3); __pyx_t_5 = 0;
+      __pyx_t_6 = NULL;
+    } else {
+      __pyx_t_5 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 80, __pyx_L5_error)
+      __Pyx_GOTREF(__pyx_t_3);
+      __pyx_t_6 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 80, __pyx_L5_error)
+    }
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    for (;;) {
+      if (likely(!__pyx_t_6)) {
+        if (likely(PyList_CheckExact(__pyx_t_3))) {
+          if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_3)) break;
+          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+          __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 80, __pyx_L5_error)
+          #else
+          __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 80, __pyx_L5_error)
+          __Pyx_GOTREF(__pyx_t_2);
+          #endif
+        } else {
+          if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
+          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+          __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 80, __pyx_L5_error)
+          #else
+          __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 80, __pyx_L5_error)
+          __Pyx_GOTREF(__pyx_t_2);
+          #endif
+        }
+      } else {
+        __pyx_t_2 = __pyx_t_6(__pyx_t_3);
+        if (unlikely(!__pyx_t_2)) {
+          PyObject* exc_type = PyErr_Occurred();
+          if (exc_type) {
+            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+            else __PYX_ERR(0, 80, __pyx_L5_error)
+          }
+          break;
+        }
+        __Pyx_GOTREF(__pyx_t_2);
+      }
+      __Pyx_XDECREF_SET(__pyx_7genexpr__pyx_v_x, __pyx_t_2);
+      __pyx_t_2 = 0;
+/* … */
+        if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_7genexpr__pyx_v_x))) __PYX_ERR(0, 79, __pyx_L5_error)
+/* … */
+    }
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __Pyx_XDECREF(__pyx_7genexpr__pyx_v_x); __pyx_7genexpr__pyx_v_x = 0;
+    goto __pyx_L11_exit_scope;
+    __pyx_L5_error:;
+    __Pyx_XDECREF(__pyx_7genexpr__pyx_v_x); __pyx_7genexpr__pyx_v_x = 0;
+    goto __pyx_L1_error;
+    __pyx_L11_exit_scope:;
+  } /* exit inner scope */
+  __pyx_r = ((PyObject*)__pyx_t_1);
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+81:         if isinstance(x, greenlet) and not getattr(x, 'greenlet_tree_is_ignored', False)
+
      __pyx_t_8 = __Pyx_TypeCheck(__pyx_7genexpr__pyx_v_x, __pyx_ptype_6gevent_21__greenlet_primitives_greenlet); 
+      __pyx_t_9 = (__pyx_t_8 != 0);
+      if (__pyx_t_9) {
+      } else {
+        __pyx_t_7 = __pyx_t_9;
+        goto __pyx_L9_bool_binop_done;
+      }
+      __pyx_t_2 = __Pyx_GetAttr3(__pyx_7genexpr__pyx_v_x, __pyx_n_s_greenlet_tree_is_ignored, Py_False); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 81, __pyx_L5_error)
+      __Pyx_GOTREF(__pyx_t_2);
+      __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 81, __pyx_L5_error)
+      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+      __pyx_t_8 = ((!__pyx_t_9) != 0);
+      __pyx_t_7 = __pyx_t_8;
+      __pyx_L9_bool_binop_done:;
+      if (__pyx_t_7) {
+/* … */
+      }
+
 82:     ]
+
 83: 
+
+84: def _init():
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_21__greenlet_primitives_3_init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6gevent_21__greenlet_primitives_2_init[] = "_init()";
+static PyMethodDef __pyx_mdef_6gevent_21__greenlet_primitives_3_init = {"_init", (PyCFunction)__pyx_pw_6gevent_21__greenlet_primitives_3_init, METH_NOARGS, __pyx_doc_6gevent_21__greenlet_primitives_2_init};
+static PyObject *__pyx_pw_6gevent_21__greenlet_primitives_3_init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_init (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_21__greenlet_primitives_2_init(__pyx_self);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_21__greenlet_primitives_2_init(CYTHON_UNUSED PyObject *__pyx_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_init", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_21__greenlet_primitives_3_init, 0, __pyx_n_s_init_2, NULL, __pyx_n_s_gevent___greenlet_primitives, __pyx_d, ((PyObject *)__pyx_codeobj__7)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 84, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_init_2, __pyx_t_2) < 0) __PYX_ERR(0, 84, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+85:     greenlet_init() # pylint:disable=undefined-variable
+
  __pyx_f_6gevent_21__greenlet_primitives_greenlet_init();
+
 86: 
+
+87: _init()
+
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_init_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 87, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 87, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 88: 
+
+89: from gevent._util import import_c_accel
+
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 89, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(__pyx_n_s_import_c_accel);
+  __Pyx_GIVEREF(__pyx_n_s_import_c_accel);
+  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_import_c_accel);
+  __pyx_t_2 = __Pyx_Import(__pyx_n_s_gevent__util, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 89, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_import_c_accel); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 89, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_import_c_accel, __pyx_t_1) < 0) __PYX_ERR(0, 89, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+90: import_c_accel(globals(), 'gevent.__greenlet_primitives')
+
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_import_c_accel); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 90, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_1 = __Pyx_Globals(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 90, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 90, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_GIVEREF(__pyx_t_1);
+  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
+  __Pyx_INCREF(__pyx_n_s_gevent___greenlet_primitives);
+  __Pyx_GIVEREF(__pyx_n_s_gevent___greenlet_primitives);
+  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_n_s_gevent___greenlet_primitives);
+  __pyx_t_1 = 0;
+  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 90, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_greenlet_primitives.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_greenlet_primitives.py new file mode 100644 index 00000000..b982bc14 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_greenlet_primitives.py @@ -0,0 +1,90 @@ +# -*- coding: utf-8 -*- +# copyright (c) 2018 gevent. See LICENSE. +# cython: auto_pickle=False,embedsignature=True,always_allow_keywords=False +""" +A collection of primitives used by the hub, and suitable for +compilation with Cython because of their frequency of use. + +""" +from __future__ import absolute_import +from __future__ import division +from __future__ import print_function + +from weakref import ref as wref +from gc import get_objects + +from greenlet import greenlet + +from gevent.exceptions import BlockingSwitchOutError + + +# In Cython, we define these as 'cdef inline' functions. The +# compilation unit cannot have a direct assignment to them (import +# is assignment) without generating a 'lvalue is not valid target' +# error. +locals()['getcurrent'] = __import__('greenlet').getcurrent +locals()['greenlet_init'] = lambda: None +locals()['_greenlet_switch'] = greenlet.switch + +__all__ = [ + 'TrackedRawGreenlet', + 'SwitchOutGreenletWithLoop', +] + +class TrackedRawGreenlet(greenlet): + + def __init__(self, function, parent): + greenlet.__init__(self, function, parent) + # See greenlet.py's Greenlet class. We capture the cheap + # parts to maintain the tree structure, but we do not capture + # the stack because that's too expensive for 'spawn_raw'. + + current = getcurrent() # pylint:disable=undefined-variable + self.spawning_greenlet = wref(current) + # See Greenlet for how trees are maintained. + try: + self.spawn_tree_locals = current.spawn_tree_locals + except AttributeError: + self.spawn_tree_locals = {} + if current.parent: + current.spawn_tree_locals = self.spawn_tree_locals + + +class SwitchOutGreenletWithLoop(TrackedRawGreenlet): + # Subclasses must define: + # - self.loop + + # This class defines loop in its .pxd for Cython. This lets us avoid + # circular dependencies with the hub. + + def switch(self): + switch_out = getattr(getcurrent(), 'switch_out', None) # pylint:disable=undefined-variable + if switch_out is not None: + switch_out() + return _greenlet_switch(self) # pylint:disable=undefined-variable + + def switch_out(self): + raise BlockingSwitchOutError('Impossible to call blocking function in the event loop callback') + + +def get_reachable_greenlets(): + # We compile this loop with Cython so that it's faster, and so that + # the GIL isn't dropped at unpredictable times during the loop. + # Dropping the GIL could lead to accessing partly constructed objects + # in undefined states (particularly, tuples). This helps close a hole + # where a `SystemError: Objects/tupleobject.c bad argument to internal function` + # could get raised. (Note that this probably doesn't completely close the hole, + # if other threads have dropped the GIL, but hopefully the speed makes that + # more rare.) See https://github.com/gevent/gevent/issues/1302 + return [ + x for x in get_objects() + if isinstance(x, greenlet) and not getattr(x, 'greenlet_tree_is_ignored', False) + ] + +def _init(): + greenlet_init() # pylint:disable=undefined-variable + +_init() + +from gevent._util import import_c_accel +import_c_accel(globals(), 'gevent.__greenlet_primitives') diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_hub_local.c b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_hub_local.c new file mode 100644 index 00000000..635f6663 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_hub_local.c @@ -0,0 +1,5841 @@ +/* Generated by Cython 0.29.2 */ + +/* BEGIN: Cython Metadata +{ + "distutils": { + "depends": [ + "src/gevent/__hub_local.pxd", + "src\\gevent\\__hub_local.pxd" + ], + "include_dirs": [ + "C:\\Python37-x64\\Include", + "deps" + ], + "name": "gevent.__hub_local", + "sources": [ + "src/gevent/_hub_local.py" + ] + }, + "module_name": "gevent.__hub_local" +} +END: Cython Metadata */ + +#define PY_SSIZE_T_CLEAN +#include "Python.h" +#ifndef Py_PYTHON_H + #error Python headers needed to compile C extensions, please install development version of Python. +#elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) + #error Cython requires Python 2.6+ or Python 3.3+. +#else +#define CYTHON_ABI "0_29_2" +#define CYTHON_HEX_VERSION 0x001D02F0 +#define CYTHON_FUTURE_DIVISION 1 +#include +#ifndef offsetof + #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) +#endif +#if !defined(WIN32) && !defined(MS_WINDOWS) + #ifndef __stdcall + #define __stdcall + #endif + #ifndef __cdecl + #define __cdecl + #endif + #ifndef __fastcall + #define __fastcall + #endif +#endif +#ifndef DL_IMPORT + #define DL_IMPORT(t) t +#endif +#ifndef DL_EXPORT + #define DL_EXPORT(t) t +#endif +#define __PYX_COMMA , +#ifndef HAVE_LONG_LONG + #if PY_VERSION_HEX >= 0x02070000 + #define HAVE_LONG_LONG + #endif +#endif +#ifndef PY_LONG_LONG + #define PY_LONG_LONG LONG_LONG +#endif +#ifndef Py_HUGE_VAL + #define Py_HUGE_VAL HUGE_VAL +#endif +#ifdef PYPY_VERSION + #define CYTHON_COMPILING_IN_PYPY 1 + #define CYTHON_COMPILING_IN_PYSTON 0 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #undef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 0 + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #if PY_VERSION_HEX < 0x03050000 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #elif !defined(CYTHON_USE_ASYNC_SLOTS) + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #undef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 0 + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #undef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 1 + #undef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 0 + #undef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 0 + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #undef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE 0 + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 +#elif defined(PYSTON_VERSION) + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_PYSTON 1 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #ifndef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 1 + #endif + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #ifndef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 1 + #endif + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #ifndef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 0 + #endif + #ifndef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 1 + #endif + #ifndef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 1 + #endif + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #undef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE 0 + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 +#else + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_PYSTON 0 + #define CYTHON_COMPILING_IN_CPYTHON 1 + #ifndef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 1 + #endif + #if PY_VERSION_HEX < 0x02070000 + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #elif !defined(CYTHON_USE_PYTYPE_LOOKUP) + #define CYTHON_USE_PYTYPE_LOOKUP 1 + #endif + #if PY_MAJOR_VERSION < 3 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #elif !defined(CYTHON_USE_ASYNC_SLOTS) + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #if PY_VERSION_HEX < 0x02070000 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #elif !defined(CYTHON_USE_PYLONG_INTERNALS) + #define CYTHON_USE_PYLONG_INTERNALS 1 + #endif + #ifndef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 1 + #endif + #ifndef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 1 + #endif + #if PY_VERSION_HEX < 0x030300F0 + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #elif !defined(CYTHON_USE_UNICODE_WRITER) + #define CYTHON_USE_UNICODE_WRITER 1 + #endif + #ifndef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 0 + #endif + #ifndef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 1 + #endif + #ifndef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 1 + #endif + #ifndef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 1 + #endif + #ifndef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 1 + #endif + #ifndef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000) + #endif + #ifndef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1) + #endif + #ifndef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1) + #endif + #ifndef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3) + #endif +#endif +#if !defined(CYTHON_FAST_PYCCALL) +#define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) +#endif +#if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #undef SHIFT + #undef BASE + #undef MASK + #ifdef SIZEOF_VOID_P + enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) }; + #endif +#endif +#ifndef __has_attribute + #define __has_attribute(x) 0 +#endif +#ifndef __has_cpp_attribute + #define __has_cpp_attribute(x) 0 +#endif +#ifndef CYTHON_RESTRICT + #if defined(__GNUC__) + #define CYTHON_RESTRICT __restrict__ + #elif defined(_MSC_VER) && _MSC_VER >= 1400 + #define CYTHON_RESTRICT __restrict + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_RESTRICT restrict + #else + #define CYTHON_RESTRICT + #endif +#endif +#ifndef CYTHON_UNUSED +# if defined(__GNUC__) +# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +#endif +#ifndef CYTHON_MAYBE_UNUSED_VAR +# if defined(__cplusplus) + template void CYTHON_MAYBE_UNUSED_VAR( const T& ) { } +# else +# define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x) +# endif +#endif +#ifndef CYTHON_NCP_UNUSED +# if CYTHON_COMPILING_IN_CPYTHON +# define CYTHON_NCP_UNUSED +# else +# define CYTHON_NCP_UNUSED CYTHON_UNUSED +# endif +#endif +#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) +#ifdef _MSC_VER + #ifndef _MSC_STDINT_H_ + #if _MSC_VER < 1300 + typedef unsigned char uint8_t; + typedef unsigned int uint32_t; + #else + typedef unsigned __int8 uint8_t; + typedef unsigned __int32 uint32_t; + #endif + #endif +#else + #include +#endif +#ifndef CYTHON_FALLTHROUGH + #if defined(__cplusplus) && __cplusplus >= 201103L + #if __has_cpp_attribute(fallthrough) + #define CYTHON_FALLTHROUGH [[fallthrough]] + #elif __has_cpp_attribute(clang::fallthrough) + #define CYTHON_FALLTHROUGH [[clang::fallthrough]] + #elif __has_cpp_attribute(gnu::fallthrough) + #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] + #endif + #endif + #ifndef CYTHON_FALLTHROUGH + #if __has_attribute(fallthrough) + #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) + #else + #define CYTHON_FALLTHROUGH + #endif + #endif + #if defined(__clang__ ) && defined(__apple_build_version__) + #if __apple_build_version__ < 7000000 + #undef CYTHON_FALLTHROUGH + #define CYTHON_FALLTHROUGH + #endif + #endif +#endif + +#ifndef CYTHON_INLINE + #if defined(__clang__) + #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) + #elif defined(__GNUC__) + #define CYTHON_INLINE __inline__ + #elif defined(_MSC_VER) + #define CYTHON_INLINE __inline + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_INLINE inline + #else + #define CYTHON_INLINE + #endif +#endif + +#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) + #define Py_OptimizeFlag 0 +#endif +#define __PYX_BUILD_PY_SSIZE_T "n" +#define CYTHON_FORMAT_SSIZE_T "z" +#if PY_MAJOR_VERSION < 3 + #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyClass_Type +#else + #define __Pyx_BUILTIN_MODULE_NAME "builtins" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyType_Type +#endif +#ifndef Py_TPFLAGS_CHECKTYPES + #define Py_TPFLAGS_CHECKTYPES 0 +#endif +#ifndef Py_TPFLAGS_HAVE_INDEX + #define Py_TPFLAGS_HAVE_INDEX 0 +#endif +#ifndef Py_TPFLAGS_HAVE_NEWBUFFER + #define Py_TPFLAGS_HAVE_NEWBUFFER 0 +#endif +#ifndef Py_TPFLAGS_HAVE_FINALIZE + #define Py_TPFLAGS_HAVE_FINALIZE 0 +#endif +#ifndef METH_STACKLESS + #define METH_STACKLESS 0 +#endif +#if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) + #ifndef METH_FASTCALL + #define METH_FASTCALL 0x80 + #endif + typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs); + typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args, + Py_ssize_t nargs, PyObject *kwnames); +#else + #define __Pyx_PyCFunctionFast _PyCFunctionFast + #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords +#endif +#if CYTHON_FAST_PYCCALL +#define __Pyx_PyFastCFunction_Check(func)\ + ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS))))) +#else +#define __Pyx_PyFastCFunction_Check(func) 0 +#endif +#if CYTHON_USE_DICT_VERSIONS +#define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) +#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ + (version_var) = __PYX_GET_DICT_VERSION(dict);\ + (cache_var) = (value); +#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ + static PY_UINT64_T __pyx_dict_version = 0;\ + static PyObject *__pyx_dict_cached_value = NULL;\ + if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ + (VAR) = __pyx_dict_cached_value;\ + } else {\ + (VAR) = __pyx_dict_cached_value = (LOOKUP);\ + __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ + }\ + } +#else +#define __PYX_GET_DICT_VERSION(dict) (0) +#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) +#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) + #define PyObject_Malloc(s) PyMem_Malloc(s) + #define PyObject_Free(p) PyMem_Free(p) + #define PyObject_Realloc(p) PyMem_Realloc(p) +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1 + #define PyMem_RawMalloc(n) PyMem_Malloc(n) + #define PyMem_RawRealloc(p, n) PyMem_Realloc(p, n) + #define PyMem_RawFree(p) PyMem_Free(p) +#endif +#if CYTHON_COMPILING_IN_PYSTON + #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co) + #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno) +#else + #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) + #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) +#endif +#if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000 + #define __Pyx_PyThreadState_Current PyThreadState_GET() +#elif PY_VERSION_HEX >= 0x03060000 + #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() +#elif PY_VERSION_HEX >= 0x03000000 + #define __Pyx_PyThreadState_Current PyThreadState_GET() +#else + #define __Pyx_PyThreadState_Current _PyThreadState_Current +#endif +#if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) +#include "pythread.h" +#define Py_tss_NEEDS_INIT 0 +typedef int Py_tss_t; +static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) { + *key = PyThread_create_key(); + return 0; // PyThread_create_key reports success always +} +static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) { + Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t)); + *key = Py_tss_NEEDS_INIT; + return key; +} +static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) { + PyObject_Free(key); +} +static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) { + return *key != Py_tss_NEEDS_INIT; +} +static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) { + PyThread_delete_key(*key); + *key = Py_tss_NEEDS_INIT; +} +static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) { + return PyThread_set_key_value(*key, value); +} +static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { + return PyThread_get_key_value(*key); +} +#endif // TSS (Thread Specific Storage) API +#if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized) +#define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) +#else +#define __Pyx_PyDict_NewPresized(n) PyDict_New() +#endif +#if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION + #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) +#else + #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS +#define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) +#else +#define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name) +#endif +#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) + #define CYTHON_PEP393_ENABLED 1 + #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ + 0 : _PyUnicode_Ready((PyObject *)(op))) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) + #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) + #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) + #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) + #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) + #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch) + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) +#else + #define CYTHON_PEP393_ENABLED 0 + #define PyUnicode_1BYTE_KIND 1 + #define PyUnicode_2BYTE_KIND 2 + #define PyUnicode_4BYTE_KIND 4 + #define __Pyx_PyUnicode_READY(op) (0) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) + #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111) + #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) + #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) + #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) + #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch) + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) +#endif +#if CYTHON_COMPILING_IN_PYPY + #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) +#else + #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ + PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains) + #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check) + #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format) + #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) +#endif +#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) +#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) +#else + #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) +#endif +#if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) + #define PyObject_ASCII(o) PyObject_Repr(o) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBaseString_Type PyUnicode_Type + #define PyStringObject PyUnicodeObject + #define PyString_Type PyUnicode_Type + #define PyString_Check PyUnicode_Check + #define PyString_CheckExact PyUnicode_CheckExact + #define PyObject_Unicode PyObject_Str +#endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) + #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) +#else + #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) + #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) +#endif +#ifndef PySet_CheckExact + #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) +#endif +#if CYTHON_ASSUME_SAFE_MACROS + #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) +#else + #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyIntObject PyLongObject + #define PyInt_Type PyLong_Type + #define PyInt_Check(op) PyLong_Check(op) + #define PyInt_CheckExact(op) PyLong_CheckExact(op) + #define PyInt_FromString PyLong_FromString + #define PyInt_FromUnicode PyLong_FromUnicode + #define PyInt_FromLong PyLong_FromLong + #define PyInt_FromSize_t PyLong_FromSize_t + #define PyInt_FromSsize_t PyLong_FromSsize_t + #define PyInt_AsLong PyLong_AsLong + #define PyInt_AS_LONG PyLong_AS_LONG + #define PyInt_AsSsize_t PyLong_AsSsize_t + #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask + #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask + #define PyNumber_Int PyNumber_Long +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBoolObject PyLongObject +#endif +#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY + #ifndef PyUnicode_InternFromString + #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) + #endif +#endif +#if PY_VERSION_HEX < 0x030200A4 + typedef long Py_hash_t; + #define __Pyx_PyInt_FromHash_t PyInt_FromLong + #define __Pyx_PyInt_AsHash_t PyInt_AsLong +#else + #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t + #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t +#endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : (Py_INCREF(func), func)) +#else + #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) +#endif +#if CYTHON_USE_ASYNC_SLOTS + #if PY_VERSION_HEX >= 0x030500B1 + #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods + #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) + #else + #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) + #endif +#else + #define __Pyx_PyType_AsAsync(obj) NULL +#endif +#ifndef __Pyx_PyAsyncMethodsStruct + typedef struct { + unaryfunc am_await; + unaryfunc am_aiter; + unaryfunc am_anext; + } __Pyx_PyAsyncMethodsStruct; +#endif + +#if defined(WIN32) || defined(MS_WINDOWS) + #define _USE_MATH_DEFINES +#endif +#include +#ifdef NAN +#define __PYX_NAN() ((float) NAN) +#else +static CYTHON_INLINE float __PYX_NAN() { + float value; + memset(&value, 0xFF, sizeof(value)); + return value; +} +#endif +#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) +#define __Pyx_truncl trunc +#else +#define __Pyx_truncl truncl +#endif + + +#define __PYX_ERR(f_index, lineno, Ln_error) \ +{ \ + __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \ +} + +#ifndef __PYX_EXTERN_C + #ifdef __cplusplus + #define __PYX_EXTERN_C extern "C" + #else + #define __PYX_EXTERN_C extern + #endif +#endif + +#define __PYX_HAVE__gevent____hub_local +#define __PYX_HAVE_API__gevent____hub_local +/* Early includes */ +#include "greenlet/greenlet.h" +#ifdef _OPENMP +#include +#endif /* _OPENMP */ + +#if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) +#define CYTHON_WITHOUT_ASSERTIONS +#endif + +typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; + const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; + +#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 +#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0 +#define __PYX_DEFAULT_STRING_ENCODING "" +#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString +#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#define __Pyx_uchar_cast(c) ((unsigned char)c) +#define __Pyx_long_cast(x) ((long)x) +#define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ + (sizeof(type) < sizeof(Py_ssize_t)) ||\ + (sizeof(type) > sizeof(Py_ssize_t) &&\ + likely(v < (type)PY_SSIZE_T_MAX ||\ + v == (type)PY_SSIZE_T_MAX) &&\ + (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ + v == (type)PY_SSIZE_T_MIN))) ||\ + (sizeof(type) == sizeof(Py_ssize_t) &&\ + (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ + v == (type)PY_SSIZE_T_MAX))) ) +static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) { + return (size_t) i < (size_t) limit; +} +#if defined (__cplusplus) && __cplusplus >= 201103L + #include + #define __Pyx_sst_abs(value) std::abs(value) +#elif SIZEOF_INT >= SIZEOF_SIZE_T + #define __Pyx_sst_abs(value) abs(value) +#elif SIZEOF_LONG >= SIZEOF_SIZE_T + #define __Pyx_sst_abs(value) labs(value) +#elif defined (_MSC_VER) + #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) +#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define __Pyx_sst_abs(value) llabs(value) +#elif defined (__GNUC__) + #define __Pyx_sst_abs(value) __builtin_llabs(value) +#else + #define __Pyx_sst_abs(value) ((value<0) ? -value : value) +#endif +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*); +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); +#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) +#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) +#define __Pyx_PyBytes_FromString PyBytes_FromString +#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); +#if PY_MAJOR_VERSION < 3 + #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#else + #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize +#endif +#define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) +#define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) +#define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) +#define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) +#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) +static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) { + const Py_UNICODE *u_end = u; + while (*u_end++) ; + return (size_t)(u_end - u - 1); +} +#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) +#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode +#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode +#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) +#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) +static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); +static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*); +static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); +#define __Pyx_PySequence_Tuple(obj)\ + (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); +#if CYTHON_ASSUME_SAFE_MACROS +#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) +#else +#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) +#endif +#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) +#if PY_MAJOR_VERSION >= 3 +#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) +#else +#define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) +#endif +#define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x)) +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII +static int __Pyx_sys_getdefaultencoding_not_ascii; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + PyObject* ascii_chars_u = NULL; + PyObject* ascii_chars_b = NULL; + const char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + if (strcmp(default_encoding_c, "ascii") == 0) { + __Pyx_sys_getdefaultencoding_not_ascii = 0; + } else { + char ascii_chars[128]; + int c; + for (c = 0; c < 128; c++) { + ascii_chars[c] = c; + } + __Pyx_sys_getdefaultencoding_not_ascii = 1; + ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); + if (!ascii_chars_u) goto bad; + ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); + if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { + PyErr_Format( + PyExc_ValueError, + "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", + default_encoding_c); + goto bad; + } + Py_DECREF(ascii_chars_u); + Py_DECREF(ascii_chars_b); + } + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + Py_XDECREF(ascii_chars_u); + Py_XDECREF(ascii_chars_b); + return -1; +} +#endif +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) +#else +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +static char* __PYX_DEFAULT_STRING_ENCODING; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1); + if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; + strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + return -1; +} +#endif +#endif + + +/* Test for GCC > 2.95 */ +#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) + #define likely(x) __builtin_expect(!!(x), 1) + #define unlikely(x) __builtin_expect(!!(x), 0) +#else /* !__GNUC__ or GCC < 2.95 */ + #define likely(x) (x) + #define unlikely(x) (x) +#endif /* __GNUC__ */ +static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } + +static PyObject *__pyx_m = NULL; +static PyObject *__pyx_d; +static PyObject *__pyx_b; +static PyObject *__pyx_cython_runtime = NULL; +static PyObject *__pyx_empty_tuple; +static PyObject *__pyx_empty_bytes; +static PyObject *__pyx_empty_unicode; +static int __pyx_lineno; +static int __pyx_clineno = 0; +static const char * __pyx_cfilenm= __FILE__; +static const char *__pyx_filename; + + +static const char *__pyx_f[] = { + "src\\gevent\\_hub_local.py", + "src\\gevent\\__greenlet_primitives.pxd", +}; + +/*--- Type declarations ---*/ +struct __pyx_obj_6gevent_21__greenlet_primitives_TrackedRawGreenlet; +struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop; + +/* "gevent/__greenlet_primitives.pxd":37 + * return PyGreenlet_Switch(self, NULL, NULL) + * + * cdef class TrackedRawGreenlet(greenlet): # <<<<<<<<<<<<<< + * pass + * + */ +struct __pyx_obj_6gevent_21__greenlet_primitives_TrackedRawGreenlet { + PyGreenlet __pyx_base; +}; + + +/* "gevent/__greenlet_primitives.pxd":40 + * pass + * + * cdef class SwitchOutGreenletWithLoop(TrackedRawGreenlet): # <<<<<<<<<<<<<< + * cdef public loop + * + */ +struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop { + struct __pyx_obj_6gevent_21__greenlet_primitives_TrackedRawGreenlet __pyx_base; + struct __pyx_vtabstruct_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *__pyx_vtab; + PyObject *loop; +}; + + + +struct __pyx_vtabstruct_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop { + PyObject *(*__pyx_switch)(struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *, int __pyx_skip_dispatch); + PyObject *(*switch_out)(struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *, int __pyx_skip_dispatch); +}; +static struct __pyx_vtabstruct_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *__pyx_vtabptr_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop; + +/* --- Runtime support code (head) --- */ +/* Refnanny.proto */ +#ifndef CYTHON_REFNANNY + #define CYTHON_REFNANNY 0 +#endif +#if CYTHON_REFNANNY + typedef struct { + void (*INCREF)(void*, PyObject*, int); + void (*DECREF)(void*, PyObject*, int); + void (*GOTREF)(void*, PyObject*, int); + void (*GIVEREF)(void*, PyObject*, int); + void* (*SetupContext)(const char*, int, const char*); + void (*FinishContext)(void**); + } __Pyx_RefNannyAPIStruct; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); + #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; +#ifdef WITH_THREAD + #define __Pyx_RefNannySetupContext(name, acquire_gil)\ + if (acquire_gil) {\ + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ + PyGILState_Release(__pyx_gilstate_save);\ + } else {\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ + } +#else + #define __Pyx_RefNannySetupContext(name, acquire_gil)\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) +#endif + #define __Pyx_RefNannyFinishContext()\ + __Pyx_RefNanny->FinishContext(&__pyx_refnanny) + #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0) + #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) + #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) + #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) +#else + #define __Pyx_RefNannyDeclarations + #define __Pyx_RefNannySetupContext(name, acquire_gil) + #define __Pyx_RefNannyFinishContext() + #define __Pyx_INCREF(r) Py_INCREF(r) + #define __Pyx_DECREF(r) Py_DECREF(r) + #define __Pyx_GOTREF(r) + #define __Pyx_GIVEREF(r) + #define __Pyx_XINCREF(r) Py_XINCREF(r) + #define __Pyx_XDECREF(r) Py_XDECREF(r) + #define __Pyx_XGOTREF(r) + #define __Pyx_XGIVEREF(r) +#endif +#define __Pyx_XDECREF_SET(r, v) do {\ + PyObject *tmp = (PyObject *) r;\ + r = v; __Pyx_XDECREF(tmp);\ + } while (0) +#define __Pyx_DECREF_SET(r, v) do {\ + PyObject *tmp = (PyObject *) r;\ + r = v; __Pyx_DECREF(tmp);\ + } while (0) +#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) +#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) + +/* PyObjectGetAttrStr.proto */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); +#else +#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) +#endif + +/* GetBuiltinName.proto */ +static PyObject *__Pyx_GetBuiltinName(PyObject *name); + +/* GetModuleGlobalName.proto */ +#if CYTHON_USE_DICT_VERSIONS +#define __Pyx_GetModuleGlobalName(var, name) {\ + static PY_UINT64_T __pyx_dict_version = 0;\ + static PyObject *__pyx_dict_cached_value = NULL;\ + (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\ + (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\ + __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ +} +#define __Pyx_GetModuleGlobalNameUncached(var, name) {\ + PY_UINT64_T __pyx_dict_version;\ + PyObject *__pyx_dict_cached_value;\ + (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ +} +static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value); +#else +#define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name) +#define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name) +static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name); +#endif + +/* PyObjectCall.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); +#else +#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) +#endif + +/* PyFunctionFastCall.proto */ +#if CYTHON_FAST_PYCALL +#define __Pyx_PyFunction_FastCall(func, args, nargs)\ + __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) +#if 1 || PY_VERSION_HEX < 0x030600B1 +static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs); +#else +#define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs) +#endif +#define __Pyx_BUILD_ASSERT_EXPR(cond)\ + (sizeof(char [1 - 2*!(cond)]) - 1) +#ifndef Py_MEMBER_SIZE +#define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member) +#endif + static size_t __pyx_pyframe_localsplus_offset = 0; + #include "frameobject.h" + #define __Pxy_PyFrame_Initialize_Offsets()\ + ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\ + (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus))) + #define __Pyx_PyFrame_GetLocalsplus(frame)\ + (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset)) +#endif + +/* PyObjectCallMethO.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); +#endif + +/* PyObjectCallNoArg.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); +#else +#define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL) +#endif + +/* PyCFunctionFastCall.proto */ +#if CYTHON_FAST_PYCCALL +static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs); +#else +#define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL) +#endif + +/* PyObjectCallOneArg.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); + +/* PyObjectSetAttrStr.proto */ +#if CYTHON_USE_TYPE_SLOTS +#define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o, n, NULL) +static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value); +#else +#define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n) +#define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v) +#endif + +/* KeywordStringCheck.proto */ +static int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* function_name, int kw_allowed); + +/* ExtTypeTest.proto */ +static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); + +/* ArgTypeTest.proto */ +#define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\ + ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\ + __Pyx__ArgTypeTest(obj, type, name, exact)) +static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact); + +/* TypeImport.proto */ +#ifndef __PYX_HAVE_RT_ImportType_proto +#define __PYX_HAVE_RT_ImportType_proto +enum __Pyx_ImportType_CheckSize { + __Pyx_ImportType_CheckSize_Error = 0, + __Pyx_ImportType_CheckSize_Warn = 1, + __Pyx_ImportType_CheckSize_Ignore = 2 +}; +static PyTypeObject *__Pyx_ImportType(PyObject* module, const char *module_name, const char *class_name, size_t size, enum __Pyx_ImportType_CheckSize check_size); +#endif + +/* GetVTable.proto */ +static void* __Pyx_GetVtable(PyObject *dict); + +/* Import.proto */ +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); + +/* ImportFrom.proto */ +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); + +/* CalculateMetaclass.proto */ +static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases); + +/* FetchCommonType.proto */ +static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); + +/* CythonFunction.proto */ +#define __Pyx_CyFunction_USED 1 +#define __Pyx_CYFUNCTION_STATICMETHOD 0x01 +#define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 +#define __Pyx_CYFUNCTION_CCLASS 0x04 +#define __Pyx_CyFunction_GetClosure(f)\ + (((__pyx_CyFunctionObject *) (f))->func_closure) +#define __Pyx_CyFunction_GetClassObj(f)\ + (((__pyx_CyFunctionObject *) (f))->func_classobj) +#define __Pyx_CyFunction_Defaults(type, f)\ + ((type *)(((__pyx_CyFunctionObject *) (f))->defaults)) +#define __Pyx_CyFunction_SetDefaultsGetter(f, g)\ + ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g) +typedef struct { + PyCFunctionObject func; +#if PY_VERSION_HEX < 0x030500A0 + PyObject *func_weakreflist; +#endif + PyObject *func_dict; + PyObject *func_name; + PyObject *func_qualname; + PyObject *func_doc; + PyObject *func_globals; + PyObject *func_code; + PyObject *func_closure; + PyObject *func_classobj; + void *defaults; + int defaults_pyobjects; + int flags; + PyObject *defaults_tuple; + PyObject *defaults_kwdict; + PyObject *(*defaults_getter)(PyObject *); + PyObject *func_annotations; +} __pyx_CyFunctionObject; +static PyTypeObject *__pyx_CyFunctionType = 0; +#define __Pyx_CyFunction_Check(obj) (__Pyx_TypeCheck(obj, __pyx_CyFunctionType)) +#define __Pyx_CyFunction_NewEx(ml, flags, qualname, self, module, globals, code)\ + __Pyx_CyFunction_New(__pyx_CyFunctionType, ml, flags, qualname, self, module, globals, code) +static PyObject *__Pyx_CyFunction_New(PyTypeObject *, PyMethodDef *ml, + int flags, PyObject* qualname, + PyObject *self, + PyObject *module, PyObject *globals, + PyObject* code); +static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, + size_t size, + int pyobjects); +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, + PyObject *tuple); +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, + PyObject *dict); +static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m, + PyObject *dict); +static int __pyx_CyFunction_init(void); + +/* SetNameInClass.proto */ +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 +#define __Pyx_SetNameInClass(ns, name, value)\ + (likely(PyDict_CheckExact(ns)) ? _PyDict_SetItem_KnownHash(ns, name, value, ((PyASCIIObject *) name)->hash) : PyObject_SetItem(ns, name, value)) +#elif CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_SetNameInClass(ns, name, value)\ + (likely(PyDict_CheckExact(ns)) ? PyDict_SetItem(ns, name, value) : PyObject_SetItem(ns, name, value)) +#else +#define __Pyx_SetNameInClass(ns, name, value) PyObject_SetItem(ns, name, value) +#endif + +/* Py3ClassCreate.proto */ +static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname, + PyObject *mkw, PyObject *modname, PyObject *doc); +static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict, + PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass); + +/* GetAttr.proto */ +static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *); + +/* Globals.proto */ +static PyObject* __Pyx_Globals(void); + +/* PyThreadStateGet.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; +#define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; +#define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type +#else +#define __Pyx_PyThreadState_declare +#define __Pyx_PyThreadState_assign +#define __Pyx_PyErr_Occurred() PyErr_Occurred() +#endif + +/* PyErrFetchRestore.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) +#define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) +#define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) +#define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) +#define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); +static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) +#else +#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) +#endif +#else +#define __Pyx_PyErr_Clear() PyErr_Clear() +#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) +#define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) +#define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb) +#define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) +#endif + +/* CLineInTraceback.proto */ +#ifdef CYTHON_CLINE_IN_TRACEBACK +#define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) +#else +static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line); +#endif + +/* CodeObjectCache.proto */ +typedef struct { + PyCodeObject* code_object; + int code_line; +} __Pyx_CodeObjectCacheEntry; +struct __Pyx_CodeObjectCache { + int count; + int max_count; + __Pyx_CodeObjectCacheEntry* entries; +}; +static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); +static PyCodeObject *__pyx_find_code_object(int code_line); +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); + +/* AddTraceback.proto */ +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename); + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); + +/* CIntFromPy.proto */ +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); + +/* CIntFromPy.proto */ +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); + +/* FastTypeChecks.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) +static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b); +static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type); +static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2); +#else +#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) +#define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) +#define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) +#endif +#define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) + +/* CheckBinaryVersion.proto */ +static int __Pyx_check_binary_version(void); + +/* VoidPtrExport.proto */ +static int __Pyx_ExportVoidPtr(PyObject *name, void *p, const char *sig); + +/* FunctionExport.proto */ +static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig); + +/* VoidPtrImport.proto */ +static int __Pyx_ImportVoidPtr(PyObject *module, const char *name, void **p, const char *sig); + +/* InitStrings.proto */ +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); + + +/* Module declarations from 'cython' */ + +/* Module declarations from 'greenlet' */ + +/* Module declarations from 'gevent.__greenlet_primitives' */ +static PyTypeObject *__pyx_ptype_6gevent_21__greenlet_primitives_greenlet = 0; +static PyTypeObject *__pyx_ptype_6gevent_21__greenlet_primitives_TrackedRawGreenlet = 0; +static PyTypeObject *__pyx_ptype_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop = 0; +static PyObject **__pyx_vp_6gevent_21__greenlet_primitives_get_objects = 0; +#define __pyx_v_6gevent_21__greenlet_primitives_get_objects (*__pyx_vp_6gevent_21__greenlet_primitives_get_objects) +static PyObject **__pyx_vp_6gevent_21__greenlet_primitives_wref = 0; +#define __pyx_v_6gevent_21__greenlet_primitives_wref (*__pyx_vp_6gevent_21__greenlet_primitives_wref) +static PyObject **__pyx_vp_6gevent_21__greenlet_primitives_BlockingSwitchOutError = 0; +#define __pyx_v_6gevent_21__greenlet_primitives_BlockingSwitchOutError (*__pyx_vp_6gevent_21__greenlet_primitives_BlockingSwitchOutError) +static int *__pyx_vp_6gevent_21__greenlet_primitives__greenlet_imported = 0; +#define __pyx_v_6gevent_21__greenlet_primitives__greenlet_imported (*__pyx_vp_6gevent_21__greenlet_primitives__greenlet_imported) + +/* Module declarations from 'gevent.__hub_local' */ +static PyObject *__pyx_v_6gevent_11__hub_local__threadlocal = 0; +static PyObject *__pyx_f_6gevent_11__hub_local_get_hub_class(int __pyx_skip_dispatch); /*proto*/ +static struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *__pyx_f_6gevent_11__hub_local_get_hub_if_exists(int __pyx_skip_dispatch); /*proto*/ +static PyObject *__pyx_f_6gevent_11__hub_local_set_hub(struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *, int __pyx_skip_dispatch); /*proto*/ +static PyObject *__pyx_f_6gevent_11__hub_local_get_loop(int __pyx_skip_dispatch); /*proto*/ +static PyObject *__pyx_f_6gevent_11__hub_local_set_loop(PyObject *, int __pyx_skip_dispatch); /*proto*/ +static struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *__pyx_f_6gevent_11__hub_local_get_hub_noargs(int __pyx_skip_dispatch); /*proto*/ +#define __Pyx_MODULE_NAME "gevent.__hub_local" +extern int __pyx_module_is_main_gevent____hub_local; +int __pyx_module_is_main_gevent____hub_local = 0; + +/* Implementation of 'gevent.__hub_local' */ +static PyObject *__pyx_builtin___import__; +static PyObject *__pyx_builtin_super; +static const char __pyx_k_Hub[] = "Hub"; +static const char __pyx_k_all[] = "__all__"; +static const char __pyx_k_doc[] = "__doc__"; +static const char __pyx_k_hub[] = "hub"; +static const char __pyx_k_args[] = "args"; +static const char __pyx_k_init[] = "__init__"; +static const char __pyx_k_loop[] = "loop"; +static const char __pyx_k_main[] = "__main__"; +static const char __pyx_k_name[] = "__name__"; +static const char __pyx_k_self[] = "self"; +static const char __pyx_k_test[] = "__test__"; +static const char __pyx_k_local[] = "_local"; +static const char __pyx_k_super[] = "super"; +static const char __pyx_k_import[] = "__import__"; +static const char __pyx_k_kwargs[] = "kwargs"; +static const char __pyx_k_module[] = "__module__"; +static const char __pyx_k_get_hub[] = "get_hub"; +static const char __pyx_k_hubtype[] = "hubtype"; +static const char __pyx_k_prepare[] = "__prepare__"; +static const char __pyx_k_set_hub[] = "set_hub"; +static const char __pyx_k_get_loop[] = "get_loop"; +static const char __pyx_k_pyx_capi[] = "__pyx_capi__"; +static const char __pyx_k_qualname[] = "__qualname__"; +static const char __pyx_k_set_loop[] = "set_loop"; +static const char __pyx_k_metaclass[] = "__metaclass__"; +static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__"; +static const char __pyx_k_Threadlocal[] = "_Threadlocal"; +static const char __pyx_k_threadlocal[] = "_threadlocal"; +static const char __pyx_k_gevent__util[] = "gevent._util"; +static const char __pyx_k_get_hub_class[] = "get_hub_class"; +static const char __pyx_k_get_hub_noargs[] = "get_hub_noargs"; +static const char __pyx_k_gevent__compat[] = "gevent._compat"; +static const char __pyx_k_import_c_accel[] = "import_c_accel"; +static const char __pyx_k_thread_mod_name[] = "thread_mod_name"; +static const char __pyx_k_get_hub_if_exists[] = "get_hub_if_exists"; +static const char __pyx_k_Threadlocal___init[] = "_Threadlocal.__init__"; +static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; +static const char __pyx_k_gevent___hub_local[] = "gevent.__hub_local"; +static const char __pyx_k_set_default_hub_class[] = "set_default_hub_class"; +static const char __pyx_k_src_gevent__hub_local_py[] = "src\\gevent\\_hub_local.py"; +static const char __pyx_k_Maintains_the_thread_local_hub[] = "\nMaintains the thread local hub.\n\n"; +static PyObject *__pyx_n_s_Hub; +static PyObject *__pyx_n_s_Threadlocal; +static PyObject *__pyx_n_s_Threadlocal___init; +static PyObject *__pyx_n_s_all; +static PyObject *__pyx_n_s_args; +static PyObject *__pyx_n_s_cline_in_traceback; +static PyObject *__pyx_n_s_doc; +static PyObject *__pyx_n_s_get_hub; +static PyObject *__pyx_n_s_get_hub_class; +static PyObject *__pyx_n_s_get_hub_if_exists; +static PyObject *__pyx_n_s_get_hub_noargs; +static PyObject *__pyx_n_s_get_loop; +static PyObject *__pyx_n_s_gevent___hub_local; +static PyObject *__pyx_n_s_gevent__compat; +static PyObject *__pyx_n_s_gevent__util; +static PyObject *__pyx_n_s_hub; +static PyObject *__pyx_n_s_hubtype; +static PyObject *__pyx_n_s_import; +static PyObject *__pyx_n_s_import_c_accel; +static PyObject *__pyx_n_s_init; +static PyObject *__pyx_n_s_kwargs; +static PyObject *__pyx_n_s_local; +static PyObject *__pyx_n_s_loop; +static PyObject *__pyx_n_s_main; +static PyObject *__pyx_n_s_metaclass; +static PyObject *__pyx_n_s_module; +static PyObject *__pyx_n_s_name; +static PyObject *__pyx_n_s_prepare; +static PyObject *__pyx_n_s_pyx_capi; +static PyObject *__pyx_n_s_pyx_vtable; +static PyObject *__pyx_n_s_qualname; +static PyObject *__pyx_n_s_self; +static PyObject *__pyx_n_s_set_default_hub_class; +static PyObject *__pyx_n_s_set_hub; +static PyObject *__pyx_n_s_set_loop; +static PyObject *__pyx_kp_s_src_gevent__hub_local_py; +static PyObject *__pyx_n_s_super; +static PyObject *__pyx_n_s_test; +static PyObject *__pyx_n_s_thread_mod_name; +static PyObject *__pyx_n_s_threadlocal; +static PyObject *__pyx_pf_6gevent_11__hub_local_12_Threadlocal___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_11__hub_local_get_hub_class(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_6gevent_11__hub_local_2set_default_hub_class(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_hubtype); /* proto */ +static PyObject *__pyx_pf_6gevent_11__hub_local_4get_hub(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */ +static PyObject *__pyx_pf_6gevent_11__hub_local_6get_hub_noargs(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_6gevent_11__hub_local_8get_hub_if_exists(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_6gevent_11__hub_local_10set_hub(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *__pyx_v_hub); /* proto */ +static PyObject *__pyx_pf_6gevent_11__hub_local_12get_loop(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_6gevent_11__hub_local_14set_loop(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_loop); /* proto */ +static PyObject *__pyx_tuple_; +static PyObject *__pyx_tuple__4; +static PyObject *__pyx_tuple__6; +static PyObject *__pyx_tuple__10; +static PyObject *__pyx_tuple__13; +static PyObject *__pyx_codeobj__2; +static PyObject *__pyx_codeobj__3; +static PyObject *__pyx_codeobj__5; +static PyObject *__pyx_codeobj__7; +static PyObject *__pyx_codeobj__8; +static PyObject *__pyx_codeobj__9; +static PyObject *__pyx_codeobj__11; +static PyObject *__pyx_codeobj__12; +static PyObject *__pyx_codeobj__14; +/* Late includes */ + +/* "src/gevent/_hub_local.py":26 + * class _Threadlocal(__import__(thread_mod_name)._local): + * + * def __init__(self): # <<<<<<<<<<<<<< + * # Use a class with an initializer so that we can test + * # for 'is None' instead of catching AttributeError, making + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_11__hub_local_12_Threadlocal_1__init__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_6gevent_11__hub_local_12_Threadlocal_1__init__ = {"__init__", (PyCFunction)__pyx_pw_6gevent_11__hub_local_12_Threadlocal_1__init__, METH_O, 0}; +static PyObject *__pyx_pw_6gevent_11__hub_local_12_Threadlocal_1__init__(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_11__hub_local_12_Threadlocal___init__(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_11__hub_local_12_Threadlocal___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "src/gevent/_hub_local.py":31 + * # the code cleaner and possibly solving some corner cases + * # (like #687) + * super(_Threadlocal, self).__init__() # <<<<<<<<<<<<<< + * self.Hub = None + * self.loop = None + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Threadlocal); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 31, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 31, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __Pyx_INCREF(__pyx_v_self); + __Pyx_GIVEREF(__pyx_v_self); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_self); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 31, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_init); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 31, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_2)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 31, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_hub_local.py":32 + * # (like #687) + * super(_Threadlocal, self).__init__() + * self.Hub = None # <<<<<<<<<<<<<< + * self.loop = None + * self.hub = None + */ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_Hub, Py_None) < 0) __PYX_ERR(0, 32, __pyx_L1_error) + + /* "src/gevent/_hub_local.py":33 + * super(_Threadlocal, self).__init__() + * self.Hub = None + * self.loop = None # <<<<<<<<<<<<<< + * self.hub = None + * + */ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_loop, Py_None) < 0) __PYX_ERR(0, 33, __pyx_L1_error) + + /* "src/gevent/_hub_local.py":34 + * self.Hub = None + * self.loop = None + * self.hub = None # <<<<<<<<<<<<<< + * + * _threadlocal = _Threadlocal() + */ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_hub, Py_None) < 0) __PYX_ERR(0, 34, __pyx_L1_error) + + /* "src/gevent/_hub_local.py":26 + * class _Threadlocal(__import__(thread_mod_name)._local): + * + * def __init__(self): # <<<<<<<<<<<<<< + * # Use a class with an initializer so that we can test + * # for 'is None' instead of catching AttributeError, making + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("gevent.__hub_local._Threadlocal.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_hub_local.py":40 + * Hub = None # Set when gevent.hub is imported + * + * def get_hub_class(): # <<<<<<<<<<<<<< + * """Return the type of hub to use for the current thread. + * + */ + +static PyObject *__pyx_pw_6gevent_11__hub_local_1get_hub_class(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_f_6gevent_11__hub_local_get_hub_class(CYTHON_UNUSED int __pyx_skip_dispatch) { + PyObject *__pyx_v_hubtype = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + __Pyx_RefNannySetupContext("get_hub_class", 0); + + /* "src/gevent/_hub_local.py":45 + * If there's no type of hub for the current thread yet, 'gevent.hub.Hub' is used. + * """ + * hubtype = _threadlocal.Hub # <<<<<<<<<<<<<< + * if hubtype is None: + * hubtype = _threadlocal.Hub = Hub + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_6gevent_11__hub_local__threadlocal, __pyx_n_s_Hub); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 45, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_hubtype = __pyx_t_1; + __pyx_t_1 = 0; + + /* "src/gevent/_hub_local.py":46 + * """ + * hubtype = _threadlocal.Hub + * if hubtype is None: # <<<<<<<<<<<<<< + * hubtype = _threadlocal.Hub = Hub + * return hubtype + */ + __pyx_t_2 = (__pyx_v_hubtype == Py_None); + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "src/gevent/_hub_local.py":47 + * hubtype = _threadlocal.Hub + * if hubtype is None: + * hubtype = _threadlocal.Hub = Hub # <<<<<<<<<<<<<< + * return hubtype + * + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Hub); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 47, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_t_1); + __Pyx_DECREF_SET(__pyx_v_hubtype, __pyx_t_1); + if (__Pyx_PyObject_SetAttrStr(__pyx_v_6gevent_11__hub_local__threadlocal, __pyx_n_s_Hub, __pyx_t_1) < 0) __PYX_ERR(0, 47, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_hub_local.py":46 + * """ + * hubtype = _threadlocal.Hub + * if hubtype is None: # <<<<<<<<<<<<<< + * hubtype = _threadlocal.Hub = Hub + * return hubtype + */ + } + + /* "src/gevent/_hub_local.py":48 + * if hubtype is None: + * hubtype = _threadlocal.Hub = Hub + * return hubtype # <<<<<<<<<<<<<< + * + * def set_default_hub_class(hubtype): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_hubtype); + __pyx_r = __pyx_v_hubtype; + goto __pyx_L0; + + /* "src/gevent/_hub_local.py":40 + * Hub = None # Set when gevent.hub is imported + * + * def get_hub_class(): # <<<<<<<<<<<<<< + * """Return the type of hub to use for the current thread. + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__hub_local.get_hub_class", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_hubtype); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_11__hub_local_1get_hub_class(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6gevent_11__hub_local_get_hub_class[] = "Return the type of hub to use for the current thread.\n\n If there's no type of hub for the current thread yet, 'gevent.hub.Hub' is used.\n "; +static PyMethodDef __pyx_mdef_6gevent_11__hub_local_1get_hub_class = {"get_hub_class", (PyCFunction)__pyx_pw_6gevent_11__hub_local_1get_hub_class, METH_NOARGS, __pyx_doc_6gevent_11__hub_local_get_hub_class}; +static PyObject *__pyx_pw_6gevent_11__hub_local_1get_hub_class(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get_hub_class (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_11__hub_local_get_hub_class(__pyx_self); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_11__hub_local_get_hub_class(CYTHON_UNUSED PyObject *__pyx_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("get_hub_class", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6gevent_11__hub_local_get_hub_class(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 40, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__hub_local.get_hub_class", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_hub_local.py":50 + * return hubtype + * + * def set_default_hub_class(hubtype): # <<<<<<<<<<<<<< + * global Hub + * Hub = hubtype + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_11__hub_local_3set_default_hub_class(PyObject *__pyx_self, PyObject *__pyx_v_hubtype); /*proto*/ +static PyMethodDef __pyx_mdef_6gevent_11__hub_local_3set_default_hub_class = {"set_default_hub_class", (PyCFunction)__pyx_pw_6gevent_11__hub_local_3set_default_hub_class, METH_O, 0}; +static PyObject *__pyx_pw_6gevent_11__hub_local_3set_default_hub_class(PyObject *__pyx_self, PyObject *__pyx_v_hubtype) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("set_default_hub_class (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_11__hub_local_2set_default_hub_class(__pyx_self, ((PyObject *)__pyx_v_hubtype)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_11__hub_local_2set_default_hub_class(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_hubtype) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("set_default_hub_class", 0); + + /* "src/gevent/_hub_local.py":52 + * def set_default_hub_class(hubtype): + * global Hub + * Hub = hubtype # <<<<<<<<<<<<<< + * + * def get_hub(*args, **kwargs): + */ + if (PyDict_SetItem(__pyx_d, __pyx_n_s_Hub, __pyx_v_hubtype) < 0) __PYX_ERR(0, 52, __pyx_L1_error) + + /* "src/gevent/_hub_local.py":50 + * return hubtype + * + * def set_default_hub_class(hubtype): # <<<<<<<<<<<<<< + * global Hub + * Hub = hubtype + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("gevent.__hub_local.set_default_hub_class", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_hub_local.py":54 + * Hub = hubtype + * + * def get_hub(*args, **kwargs): # <<<<<<<<<<<<<< + * """ + * Return the hub for the current thread. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_11__hub_local_5get_hub(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6gevent_11__hub_local_4get_hub[] = "\n Return the hub for the current thread.\n\n If a hub does not exist in the current thread, a new one is\n created of the type returned by :func:`get_hub_class`.\n\n .. deprecated:: 1.3b1\n The ``*args`` and ``**kwargs`` arguments are deprecated. They were\n only used when the hub was created, and so were non-deterministic---to be\n sure they were used, *all* callers had to pass them, or they were order-dependent.\n Use ``set_hub`` instead.\n "; +static PyMethodDef __pyx_mdef_6gevent_11__hub_local_5get_hub = {"get_hub", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_11__hub_local_5get_hub, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_11__hub_local_4get_hub}; +static PyObject *__pyx_pw_6gevent_11__hub_local_5get_hub(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_args = 0; + PyObject *__pyx_v_kwargs = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get_hub (wrapper)", 0); + if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "get_hub", 1))) return NULL; + if (unlikely(__pyx_kwds)) { + __pyx_v_kwargs = PyDict_Copy(__pyx_kwds); if (unlikely(!__pyx_v_kwargs)) return NULL; + __Pyx_GOTREF(__pyx_v_kwargs); + } else { + __pyx_v_kwargs = NULL; + } + __Pyx_INCREF(__pyx_args); + __pyx_v_args = __pyx_args; + __pyx_r = __pyx_pf_6gevent_11__hub_local_4get_hub(__pyx_self, __pyx_v_args, __pyx_v_kwargs); + + /* function exit code */ + __Pyx_XDECREF(__pyx_v_args); + __Pyx_XDECREF(__pyx_v_kwargs); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_11__hub_local_4get_hub(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) { + PyObject *__pyx_v_hub = NULL; + PyObject *__pyx_v_hubtype = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + __Pyx_RefNannySetupContext("get_hub", 0); + + /* "src/gevent/_hub_local.py":67 + * Use ``set_hub`` instead. + * """ + * hub = _threadlocal.hub # <<<<<<<<<<<<<< + * if hub is None: + * hubtype = get_hub_class() + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_6gevent_11__hub_local__threadlocal, __pyx_n_s_hub); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 67, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_hub = __pyx_t_1; + __pyx_t_1 = 0; + + /* "src/gevent/_hub_local.py":68 + * """ + * hub = _threadlocal.hub + * if hub is None: # <<<<<<<<<<<<<< + * hubtype = get_hub_class() + * hub = _threadlocal.hub = hubtype(*args, **kwargs) + */ + __pyx_t_2 = (__pyx_v_hub == Py_None); + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "src/gevent/_hub_local.py":69 + * hub = _threadlocal.hub + * if hub is None: + * hubtype = get_hub_class() # <<<<<<<<<<<<<< + * hub = _threadlocal.hub = hubtype(*args, **kwargs) + * return hub + */ + __pyx_t_1 = __pyx_f_6gevent_11__hub_local_get_hub_class(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 69, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_hubtype = __pyx_t_1; + __pyx_t_1 = 0; + + /* "src/gevent/_hub_local.py":70 + * if hub is None: + * hubtype = get_hub_class() + * hub = _threadlocal.hub = hubtype(*args, **kwargs) # <<<<<<<<<<<<<< + * return hub + * + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_hubtype, __pyx_v_args, __pyx_v_kwargs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 70, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_t_1); + __Pyx_DECREF_SET(__pyx_v_hub, __pyx_t_1); + if (__Pyx_PyObject_SetAttrStr(__pyx_v_6gevent_11__hub_local__threadlocal, __pyx_n_s_hub, __pyx_t_1) < 0) __PYX_ERR(0, 70, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_hub_local.py":68 + * """ + * hub = _threadlocal.hub + * if hub is None: # <<<<<<<<<<<<<< + * hubtype = get_hub_class() + * hub = _threadlocal.hub = hubtype(*args, **kwargs) + */ + } + + /* "src/gevent/_hub_local.py":71 + * hubtype = get_hub_class() + * hub = _threadlocal.hub = hubtype(*args, **kwargs) + * return hub # <<<<<<<<<<<<<< + * + * def get_hub_noargs(): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_hub); + __pyx_r = __pyx_v_hub; + goto __pyx_L0; + + /* "src/gevent/_hub_local.py":54 + * Hub = hubtype + * + * def get_hub(*args, **kwargs): # <<<<<<<<<<<<<< + * """ + * Return the hub for the current thread. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__hub_local.get_hub", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_hub); + __Pyx_XDECREF(__pyx_v_hubtype); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_hub_local.py":73 + * return hub + * + * def get_hub_noargs(): # <<<<<<<<<<<<<< + * # Just like get_hub, but cheaper to call because it + * # takes no arguments or kwargs. See also a copy in + */ + +static PyObject *__pyx_pw_6gevent_11__hub_local_7get_hub_noargs(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *__pyx_f_6gevent_11__hub_local_get_hub_noargs(CYTHON_UNUSED int __pyx_skip_dispatch) { + PyObject *__pyx_v_hub = NULL; + PyObject *__pyx_v_hubtype = NULL; + struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + __Pyx_RefNannySetupContext("get_hub_noargs", 0); + + /* "src/gevent/_hub_local.py":77 + * # takes no arguments or kwargs. See also a copy in + * # gevent/greenlet.py + * hub = _threadlocal.hub # <<<<<<<<<<<<<< + * if hub is None: + * hubtype = get_hub_class() + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_6gevent_11__hub_local__threadlocal, __pyx_n_s_hub); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 77, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_hub = __pyx_t_1; + __pyx_t_1 = 0; + + /* "src/gevent/_hub_local.py":78 + * # gevent/greenlet.py + * hub = _threadlocal.hub + * if hub is None: # <<<<<<<<<<<<<< + * hubtype = get_hub_class() + * hub = _threadlocal.hub = hubtype() + */ + __pyx_t_2 = (__pyx_v_hub == Py_None); + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "src/gevent/_hub_local.py":79 + * hub = _threadlocal.hub + * if hub is None: + * hubtype = get_hub_class() # <<<<<<<<<<<<<< + * hub = _threadlocal.hub = hubtype() + * return hub + */ + __pyx_t_1 = __pyx_f_6gevent_11__hub_local_get_hub_class(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 79, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_hubtype = __pyx_t_1; + __pyx_t_1 = 0; + + /* "src/gevent/_hub_local.py":80 + * if hub is None: + * hubtype = get_hub_class() + * hub = _threadlocal.hub = hubtype() # <<<<<<<<<<<<<< + * return hub + * + */ + __Pyx_INCREF(__pyx_v_hubtype); + __pyx_t_4 = __pyx_v_hubtype; __pyx_t_5 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + } + } + __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 80, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_INCREF(__pyx_t_1); + __Pyx_DECREF_SET(__pyx_v_hub, __pyx_t_1); + if (__Pyx_PyObject_SetAttrStr(__pyx_v_6gevent_11__hub_local__threadlocal, __pyx_n_s_hub, __pyx_t_1) < 0) __PYX_ERR(0, 80, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_hub_local.py":78 + * # gevent/greenlet.py + * hub = _threadlocal.hub + * if hub is None: # <<<<<<<<<<<<<< + * hubtype = get_hub_class() + * hub = _threadlocal.hub = hubtype() + */ + } + + /* "src/gevent/_hub_local.py":81 + * hubtype = get_hub_class() + * hub = _threadlocal.hub = hubtype() + * return hub # <<<<<<<<<<<<<< + * + * def get_hub_if_exists(): + */ + __Pyx_XDECREF(((PyObject *)__pyx_r)); + if (!(likely(((__pyx_v_hub) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_hub, __pyx_ptype_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop))))) __PYX_ERR(0, 81, __pyx_L1_error) + __Pyx_INCREF(__pyx_v_hub); + __pyx_r = ((struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *)__pyx_v_hub); + goto __pyx_L0; + + /* "src/gevent/_hub_local.py":73 + * return hub + * + * def get_hub_noargs(): # <<<<<<<<<<<<<< + * # Just like get_hub, but cheaper to call because it + * # takes no arguments or kwargs. See also a copy in + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("gevent.__hub_local.get_hub_noargs", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_hub); + __Pyx_XDECREF(__pyx_v_hubtype); + __Pyx_XGIVEREF((PyObject *)__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_11__hub_local_7get_hub_noargs(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyMethodDef __pyx_mdef_6gevent_11__hub_local_7get_hub_noargs = {"get_hub_noargs", (PyCFunction)__pyx_pw_6gevent_11__hub_local_7get_hub_noargs, METH_NOARGS, 0}; +static PyObject *__pyx_pw_6gevent_11__hub_local_7get_hub_noargs(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get_hub_noargs (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_11__hub_local_6get_hub_noargs(__pyx_self); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_11__hub_local_6get_hub_noargs(CYTHON_UNUSED PyObject *__pyx_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("get_hub_noargs", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = ((PyObject *)__pyx_f_6gevent_11__hub_local_get_hub_noargs(0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 73, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__hub_local.get_hub_noargs", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_hub_local.py":83 + * return hub + * + * def get_hub_if_exists(): # <<<<<<<<<<<<<< + * """Return the hub for the current thread. + * + */ + +static PyObject *__pyx_pw_6gevent_11__hub_local_9get_hub_if_exists(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *__pyx_f_6gevent_11__hub_local_get_hub_if_exists(CYTHON_UNUSED int __pyx_skip_dispatch) { + struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("get_hub_if_exists", 0); + + /* "src/gevent/_hub_local.py":88 + * Return ``None`` if no hub has been created yet. + * """ + * return _threadlocal.hub # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(((PyObject *)__pyx_r)); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_6gevent_11__hub_local__threadlocal, __pyx_n_s_hub); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 88, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop))))) __PYX_ERR(0, 88, __pyx_L1_error) + __pyx_r = ((struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *)__pyx_t_1); + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "src/gevent/_hub_local.py":83 + * return hub + * + * def get_hub_if_exists(): # <<<<<<<<<<<<<< + * """Return the hub for the current thread. + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__hub_local.get_hub_if_exists", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF((PyObject *)__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_11__hub_local_9get_hub_if_exists(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6gevent_11__hub_local_8get_hub_if_exists[] = "Return the hub for the current thread.\n\n Return ``None`` if no hub has been created yet.\n "; +static PyMethodDef __pyx_mdef_6gevent_11__hub_local_9get_hub_if_exists = {"get_hub_if_exists", (PyCFunction)__pyx_pw_6gevent_11__hub_local_9get_hub_if_exists, METH_NOARGS, __pyx_doc_6gevent_11__hub_local_8get_hub_if_exists}; +static PyObject *__pyx_pw_6gevent_11__hub_local_9get_hub_if_exists(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get_hub_if_exists (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_11__hub_local_8get_hub_if_exists(__pyx_self); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_11__hub_local_8get_hub_if_exists(CYTHON_UNUSED PyObject *__pyx_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("get_hub_if_exists", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = ((PyObject *)__pyx_f_6gevent_11__hub_local_get_hub_if_exists(0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 83, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__hub_local.get_hub_if_exists", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_hub_local.py":91 + * + * + * def set_hub(hub): # <<<<<<<<<<<<<< + * _threadlocal.hub = hub + * + */ + +static PyObject *__pyx_pw_6gevent_11__hub_local_11set_hub(PyObject *__pyx_self, PyObject *__pyx_v_hub); /*proto*/ +static PyObject *__pyx_f_6gevent_11__hub_local_set_hub(struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *__pyx_v_hub, CYTHON_UNUSED int __pyx_skip_dispatch) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("set_hub", 0); + + /* "src/gevent/_hub_local.py":92 + * + * def set_hub(hub): + * _threadlocal.hub = hub # <<<<<<<<<<<<<< + * + * def get_loop(): + */ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_6gevent_11__hub_local__threadlocal, __pyx_n_s_hub, ((PyObject *)__pyx_v_hub)) < 0) __PYX_ERR(0, 92, __pyx_L1_error) + + /* "src/gevent/_hub_local.py":91 + * + * + * def set_hub(hub): # <<<<<<<<<<<<<< + * _threadlocal.hub = hub + * + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("gevent.__hub_local.set_hub", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_11__hub_local_11set_hub(PyObject *__pyx_self, PyObject *__pyx_v_hub); /*proto*/ +static PyMethodDef __pyx_mdef_6gevent_11__hub_local_11set_hub = {"set_hub", (PyCFunction)__pyx_pw_6gevent_11__hub_local_11set_hub, METH_O, 0}; +static PyObject *__pyx_pw_6gevent_11__hub_local_11set_hub(PyObject *__pyx_self, PyObject *__pyx_v_hub) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("set_hub (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_hub), __pyx_ptype_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop, 1, "hub", 0))) __PYX_ERR(0, 91, __pyx_L1_error) + __pyx_r = __pyx_pf_6gevent_11__hub_local_10set_hub(__pyx_self, ((struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *)__pyx_v_hub)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_11__hub_local_10set_hub(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *__pyx_v_hub) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("set_hub", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6gevent_11__hub_local_set_hub(__pyx_v_hub, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 91, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__hub_local.set_hub", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_hub_local.py":94 + * _threadlocal.hub = hub + * + * def get_loop(): # <<<<<<<<<<<<<< + * return _threadlocal.loop + * + */ + +static PyObject *__pyx_pw_6gevent_11__hub_local_13get_loop(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_f_6gevent_11__hub_local_get_loop(CYTHON_UNUSED int __pyx_skip_dispatch) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("get_loop", 0); + + /* "src/gevent/_hub_local.py":95 + * + * def get_loop(): + * return _threadlocal.loop # <<<<<<<<<<<<<< + * + * def set_loop(loop): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_6gevent_11__hub_local__threadlocal, __pyx_n_s_loop); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 95, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "src/gevent/_hub_local.py":94 + * _threadlocal.hub = hub + * + * def get_loop(): # <<<<<<<<<<<<<< + * return _threadlocal.loop + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__hub_local.get_loop", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_11__hub_local_13get_loop(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyMethodDef __pyx_mdef_6gevent_11__hub_local_13get_loop = {"get_loop", (PyCFunction)__pyx_pw_6gevent_11__hub_local_13get_loop, METH_NOARGS, 0}; +static PyObject *__pyx_pw_6gevent_11__hub_local_13get_loop(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get_loop (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_11__hub_local_12get_loop(__pyx_self); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_11__hub_local_12get_loop(CYTHON_UNUSED PyObject *__pyx_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("get_loop", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6gevent_11__hub_local_get_loop(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 94, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__hub_local.get_loop", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_hub_local.py":97 + * return _threadlocal.loop + * + * def set_loop(loop): # <<<<<<<<<<<<<< + * _threadlocal.loop = loop + * + */ + +static PyObject *__pyx_pw_6gevent_11__hub_local_15set_loop(PyObject *__pyx_self, PyObject *__pyx_v_loop); /*proto*/ +static PyObject *__pyx_f_6gevent_11__hub_local_set_loop(PyObject *__pyx_v_loop, CYTHON_UNUSED int __pyx_skip_dispatch) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("set_loop", 0); + + /* "src/gevent/_hub_local.py":98 + * + * def set_loop(loop): + * _threadlocal.loop = loop # <<<<<<<<<<<<<< + * + * from gevent._util import import_c_accel + */ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_6gevent_11__hub_local__threadlocal, __pyx_n_s_loop, __pyx_v_loop) < 0) __PYX_ERR(0, 98, __pyx_L1_error) + + /* "src/gevent/_hub_local.py":97 + * return _threadlocal.loop + * + * def set_loop(loop): # <<<<<<<<<<<<<< + * _threadlocal.loop = loop + * + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("gevent.__hub_local.set_loop", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_11__hub_local_15set_loop(PyObject *__pyx_self, PyObject *__pyx_v_loop); /*proto*/ +static PyMethodDef __pyx_mdef_6gevent_11__hub_local_15set_loop = {"set_loop", (PyCFunction)__pyx_pw_6gevent_11__hub_local_15set_loop, METH_O, 0}; +static PyObject *__pyx_pw_6gevent_11__hub_local_15set_loop(PyObject *__pyx_self, PyObject *__pyx_v_loop) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("set_loop (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_11__hub_local_14set_loop(__pyx_self, ((PyObject *)__pyx_v_loop)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_11__hub_local_14set_loop(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_loop) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("set_loop", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6gevent_11__hub_local_set_loop(__pyx_v_loop, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 97, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__hub_local.set_loop", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/__greenlet_primitives.pxd":23 + * + * @cython.final + * cdef inline greenlet getcurrent(): # <<<<<<<<<<<<<< + * return PyGreenlet_GetCurrent() + * + */ + +static CYTHON_INLINE PyGreenlet *__pyx_f_6gevent_21__greenlet_primitives_getcurrent(void) { + PyGreenlet *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("getcurrent", 0); + + /* "gevent/__greenlet_primitives.pxd":24 + * @cython.final + * cdef inline greenlet getcurrent(): + * return PyGreenlet_GetCurrent() # <<<<<<<<<<<<<< + * + * cdef bint _greenlet_imported + */ + __Pyx_XDECREF(((PyObject *)__pyx_r)); + __pyx_t_1 = ((PyObject *)PyGreenlet_GetCurrent()); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 24, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = ((PyGreenlet *)__pyx_t_1); + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "gevent/__greenlet_primitives.pxd":23 + * + * @cython.final + * cdef inline greenlet getcurrent(): # <<<<<<<<<<<<<< + * return PyGreenlet_GetCurrent() + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__greenlet_primitives.getcurrent", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF((PyObject *)__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/__greenlet_primitives.pxd":28 + * cdef bint _greenlet_imported + * + * cdef inline void greenlet_init(): # <<<<<<<<<<<<<< + * global _greenlet_imported + * if not _greenlet_imported: + */ + +static CYTHON_INLINE void __pyx_f_6gevent_21__greenlet_primitives_greenlet_init(void) { + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("greenlet_init", 0); + + /* "gevent/__greenlet_primitives.pxd":30 + * cdef inline void greenlet_init(): + * global _greenlet_imported + * if not _greenlet_imported: # <<<<<<<<<<<<<< + * PyGreenlet_Import() + * _greenlet_imported = True + */ + __pyx_t_1 = ((!(__pyx_v_6gevent_21__greenlet_primitives__greenlet_imported != 0)) != 0); + if (__pyx_t_1) { + + /* "gevent/__greenlet_primitives.pxd":31 + * global _greenlet_imported + * if not _greenlet_imported: + * PyGreenlet_Import() # <<<<<<<<<<<<<< + * _greenlet_imported = True + * + */ + PyGreenlet_Import(); + + /* "gevent/__greenlet_primitives.pxd":32 + * if not _greenlet_imported: + * PyGreenlet_Import() + * _greenlet_imported = True # <<<<<<<<<<<<<< + * + * cdef inline object _greenlet_switch(greenlet self): + */ + __pyx_v_6gevent_21__greenlet_primitives__greenlet_imported = 1; + + /* "gevent/__greenlet_primitives.pxd":30 + * cdef inline void greenlet_init(): + * global _greenlet_imported + * if not _greenlet_imported: # <<<<<<<<<<<<<< + * PyGreenlet_Import() + * _greenlet_imported = True + */ + } + + /* "gevent/__greenlet_primitives.pxd":28 + * cdef bint _greenlet_imported + * + * cdef inline void greenlet_init(): # <<<<<<<<<<<<<< + * global _greenlet_imported + * if not _greenlet_imported: + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "gevent/__greenlet_primitives.pxd":34 + * _greenlet_imported = True + * + * cdef inline object _greenlet_switch(greenlet self): # <<<<<<<<<<<<<< + * return PyGreenlet_Switch(self, NULL, NULL) + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_6gevent_21__greenlet_primitives__greenlet_switch(PyGreenlet *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("_greenlet_switch", 0); + + /* "gevent/__greenlet_primitives.pxd":35 + * + * cdef inline object _greenlet_switch(greenlet self): + * return PyGreenlet_Switch(self, NULL, NULL) # <<<<<<<<<<<<<< + * + * cdef class TrackedRawGreenlet(greenlet): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyGreenlet_Switch(__pyx_v_self, NULL, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 35, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "gevent/__greenlet_primitives.pxd":34 + * _greenlet_imported = True + * + * cdef inline object _greenlet_switch(greenlet self): # <<<<<<<<<<<<<< + * return PyGreenlet_Switch(self, NULL, NULL) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__greenlet_primitives._greenlet_switch", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyMethodDef __pyx_methods[] = { + {0, 0, 0, 0} +}; + +#if PY_MAJOR_VERSION >= 3 +#if CYTHON_PEP489_MULTI_PHASE_INIT +static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ +static int __pyx_pymod_exec___hub_local(PyObject* module); /*proto*/ +static PyModuleDef_Slot __pyx_moduledef_slots[] = { + {Py_mod_create, (void*)__pyx_pymod_create}, + {Py_mod_exec, (void*)__pyx_pymod_exec___hub_local}, + {0, NULL} +}; +#endif + +static struct PyModuleDef __pyx_moduledef = { + PyModuleDef_HEAD_INIT, + "__hub_local", + __pyx_k_Maintains_the_thread_local_hub, /* m_doc */ + #if CYTHON_PEP489_MULTI_PHASE_INIT + 0, /* m_size */ + #else + -1, /* m_size */ + #endif + __pyx_methods /* m_methods */, + #if CYTHON_PEP489_MULTI_PHASE_INIT + __pyx_moduledef_slots, /* m_slots */ + #else + NULL, /* m_reload */ + #endif + NULL, /* m_traverse */ + NULL, /* m_clear */ + NULL /* m_free */ +}; +#endif +#ifndef CYTHON_SMALL_CODE +#if defined(__clang__) + #define CYTHON_SMALL_CODE +#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) + #define CYTHON_SMALL_CODE __attribute__((cold)) +#else + #define CYTHON_SMALL_CODE +#endif +#endif + +static __Pyx_StringTabEntry __pyx_string_tab[] = { + {&__pyx_n_s_Hub, __pyx_k_Hub, sizeof(__pyx_k_Hub), 0, 0, 1, 1}, + {&__pyx_n_s_Threadlocal, __pyx_k_Threadlocal, sizeof(__pyx_k_Threadlocal), 0, 0, 1, 1}, + {&__pyx_n_s_Threadlocal___init, __pyx_k_Threadlocal___init, sizeof(__pyx_k_Threadlocal___init), 0, 0, 1, 1}, + {&__pyx_n_s_all, __pyx_k_all, sizeof(__pyx_k_all), 0, 0, 1, 1}, + {&__pyx_n_s_args, __pyx_k_args, sizeof(__pyx_k_args), 0, 0, 1, 1}, + {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, + {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1}, + {&__pyx_n_s_get_hub, __pyx_k_get_hub, sizeof(__pyx_k_get_hub), 0, 0, 1, 1}, + {&__pyx_n_s_get_hub_class, __pyx_k_get_hub_class, sizeof(__pyx_k_get_hub_class), 0, 0, 1, 1}, + {&__pyx_n_s_get_hub_if_exists, __pyx_k_get_hub_if_exists, sizeof(__pyx_k_get_hub_if_exists), 0, 0, 1, 1}, + {&__pyx_n_s_get_hub_noargs, __pyx_k_get_hub_noargs, sizeof(__pyx_k_get_hub_noargs), 0, 0, 1, 1}, + {&__pyx_n_s_get_loop, __pyx_k_get_loop, sizeof(__pyx_k_get_loop), 0, 0, 1, 1}, + {&__pyx_n_s_gevent___hub_local, __pyx_k_gevent___hub_local, sizeof(__pyx_k_gevent___hub_local), 0, 0, 1, 1}, + {&__pyx_n_s_gevent__compat, __pyx_k_gevent__compat, sizeof(__pyx_k_gevent__compat), 0, 0, 1, 1}, + {&__pyx_n_s_gevent__util, __pyx_k_gevent__util, sizeof(__pyx_k_gevent__util), 0, 0, 1, 1}, + {&__pyx_n_s_hub, __pyx_k_hub, sizeof(__pyx_k_hub), 0, 0, 1, 1}, + {&__pyx_n_s_hubtype, __pyx_k_hubtype, sizeof(__pyx_k_hubtype), 0, 0, 1, 1}, + {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, + {&__pyx_n_s_import_c_accel, __pyx_k_import_c_accel, sizeof(__pyx_k_import_c_accel), 0, 0, 1, 1}, + {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1}, + {&__pyx_n_s_kwargs, __pyx_k_kwargs, sizeof(__pyx_k_kwargs), 0, 0, 1, 1}, + {&__pyx_n_s_local, __pyx_k_local, sizeof(__pyx_k_local), 0, 0, 1, 1}, + {&__pyx_n_s_loop, __pyx_k_loop, sizeof(__pyx_k_loop), 0, 0, 1, 1}, + {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, + {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1}, + {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1}, + {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, + {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_capi, __pyx_k_pyx_capi, sizeof(__pyx_k_pyx_capi), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1}, + {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1}, + {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1}, + {&__pyx_n_s_set_default_hub_class, __pyx_k_set_default_hub_class, sizeof(__pyx_k_set_default_hub_class), 0, 0, 1, 1}, + {&__pyx_n_s_set_hub, __pyx_k_set_hub, sizeof(__pyx_k_set_hub), 0, 0, 1, 1}, + {&__pyx_n_s_set_loop, __pyx_k_set_loop, sizeof(__pyx_k_set_loop), 0, 0, 1, 1}, + {&__pyx_kp_s_src_gevent__hub_local_py, __pyx_k_src_gevent__hub_local_py, sizeof(__pyx_k_src_gevent__hub_local_py), 0, 0, 1, 0}, + {&__pyx_n_s_super, __pyx_k_super, sizeof(__pyx_k_super), 0, 0, 1, 1}, + {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, + {&__pyx_n_s_thread_mod_name, __pyx_k_thread_mod_name, sizeof(__pyx_k_thread_mod_name), 0, 0, 1, 1}, + {&__pyx_n_s_threadlocal, __pyx_k_threadlocal, sizeof(__pyx_k_threadlocal), 0, 0, 1, 1}, + {0, 0, 0, 0, 0, 0, 0} +}; +static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { + __pyx_builtin___import__ = __Pyx_GetBuiltinName(__pyx_n_s_import); if (!__pyx_builtin___import__) __PYX_ERR(0, 24, __pyx_L1_error) + __pyx_builtin_super = __Pyx_GetBuiltinName(__pyx_n_s_super); if (!__pyx_builtin_super) __PYX_ERR(0, 31, __pyx_L1_error) + return 0; + __pyx_L1_error:; + return -1; +} + +static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); + + /* "src/gevent/_hub_local.py":26 + * class _Threadlocal(__import__(thread_mod_name)._local): + * + * def __init__(self): # <<<<<<<<<<<<<< + * # Use a class with an initializer so that we can test + * # for 'is None' instead of catching AttributeError, making + */ + __pyx_tuple_ = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 26, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple_); + __Pyx_GIVEREF(__pyx_tuple_); + __pyx_codeobj__2 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple_, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__hub_local_py, __pyx_n_s_init, 26, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2)) __PYX_ERR(0, 26, __pyx_L1_error) + + /* "src/gevent/_hub_local.py":40 + * Hub = None # Set when gevent.hub is imported + * + * def get_hub_class(): # <<<<<<<<<<<<<< + * """Return the type of hub to use for the current thread. + * + */ + __pyx_codeobj__3 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__hub_local_py, __pyx_n_s_get_hub_class, 40, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__3)) __PYX_ERR(0, 40, __pyx_L1_error) + + /* "src/gevent/_hub_local.py":50 + * return hubtype + * + * def set_default_hub_class(hubtype): # <<<<<<<<<<<<<< + * global Hub + * Hub = hubtype + */ + __pyx_tuple__4 = PyTuple_Pack(1, __pyx_n_s_hubtype); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 50, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__4); + __Pyx_GIVEREF(__pyx_tuple__4); + __pyx_codeobj__5 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__4, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__hub_local_py, __pyx_n_s_set_default_hub_class, 50, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__5)) __PYX_ERR(0, 50, __pyx_L1_error) + + /* "src/gevent/_hub_local.py":54 + * Hub = hubtype + * + * def get_hub(*args, **kwargs): # <<<<<<<<<<<<<< + * """ + * Return the hub for the current thread. + */ + __pyx_tuple__6 = PyTuple_Pack(4, __pyx_n_s_args, __pyx_n_s_kwargs, __pyx_n_s_hub, __pyx_n_s_hubtype); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 54, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__6); + __Pyx_GIVEREF(__pyx_tuple__6); + __pyx_codeobj__7 = (PyObject*)__Pyx_PyCode_New(0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__6, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__hub_local_py, __pyx_n_s_get_hub, 54, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__7)) __PYX_ERR(0, 54, __pyx_L1_error) + + /* "src/gevent/_hub_local.py":73 + * return hub + * + * def get_hub_noargs(): # <<<<<<<<<<<<<< + * # Just like get_hub, but cheaper to call because it + * # takes no arguments or kwargs. See also a copy in + */ + __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__hub_local_py, __pyx_n_s_get_hub_noargs, 73, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) __PYX_ERR(0, 73, __pyx_L1_error) + + /* "src/gevent/_hub_local.py":83 + * return hub + * + * def get_hub_if_exists(): # <<<<<<<<<<<<<< + * """Return the hub for the current thread. + * + */ + __pyx_codeobj__9 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__hub_local_py, __pyx_n_s_get_hub_if_exists, 83, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__9)) __PYX_ERR(0, 83, __pyx_L1_error) + + /* "src/gevent/_hub_local.py":91 + * + * + * def set_hub(hub): # <<<<<<<<<<<<<< + * _threadlocal.hub = hub + * + */ + __pyx_tuple__10 = PyTuple_Pack(1, __pyx_n_s_hub); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 91, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__10); + __Pyx_GIVEREF(__pyx_tuple__10); + __pyx_codeobj__11 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__10, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__hub_local_py, __pyx_n_s_set_hub, 91, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__11)) __PYX_ERR(0, 91, __pyx_L1_error) + + /* "src/gevent/_hub_local.py":94 + * _threadlocal.hub = hub + * + * def get_loop(): # <<<<<<<<<<<<<< + * return _threadlocal.loop + * + */ + __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__hub_local_py, __pyx_n_s_get_loop, 94, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(0, 94, __pyx_L1_error) + + /* "src/gevent/_hub_local.py":97 + * return _threadlocal.loop + * + * def set_loop(loop): # <<<<<<<<<<<<<< + * _threadlocal.loop = loop + * + */ + __pyx_tuple__13 = PyTuple_Pack(1, __pyx_n_s_loop); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 97, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__13); + __Pyx_GIVEREF(__pyx_tuple__13); + __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__13, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__hub_local_py, __pyx_n_s_set_loop, 97, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__14)) __PYX_ERR(0, 97, __pyx_L1_error) + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} + +static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { + if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + return 0; + __pyx_L1_error:; + return -1; +} + +static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/ + +static int __Pyx_modinit_global_init_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); + /*--- Global init code ---*/ + __pyx_v_6gevent_11__hub_local__threadlocal = Py_None; Py_INCREF(Py_None); + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_variable_export_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); + /*--- Variable export code ---*/ + if (__Pyx_ExportVoidPtr(__pyx_n_s_threadlocal, (void *)&__pyx_v_6gevent_11__hub_local__threadlocal, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_modinit_function_export_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); + /*--- Function export code ---*/ + if (__Pyx_ExportFunction("get_hub_class", (void (*)(void))__pyx_f_6gevent_11__hub_local_get_hub_class, "PyObject *(int __pyx_skip_dispatch)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportFunction("get_hub_if_exists", (void (*)(void))__pyx_f_6gevent_11__hub_local_get_hub_if_exists, "struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *(int __pyx_skip_dispatch)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportFunction("set_hub", (void (*)(void))__pyx_f_6gevent_11__hub_local_set_hub, "PyObject *(struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *, int __pyx_skip_dispatch)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportFunction("get_loop", (void (*)(void))__pyx_f_6gevent_11__hub_local_get_loop, "PyObject *(int __pyx_skip_dispatch)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportFunction("set_loop", (void (*)(void))__pyx_f_6gevent_11__hub_local_set_loop, "PyObject *(PyObject *, int __pyx_skip_dispatch)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportFunction("get_hub_noargs", (void (*)(void))__pyx_f_6gevent_11__hub_local_get_hub_noargs, "struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *(int __pyx_skip_dispatch)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_modinit_type_init_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); + /*--- Type init code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_type_import_code(void) { + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); + /*--- Type import code ---*/ + __pyx_t_1 = PyImport_ImportModule("greenlet"); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_ptype_6gevent_21__greenlet_primitives_greenlet = __Pyx_ImportType(__pyx_t_1, "greenlet", "greenlet", sizeof(PyGreenlet), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_21__greenlet_primitives_greenlet) __PYX_ERR(1, 12, __pyx_L1_error) + __pyx_t_2 = PyImport_ImportModule("gevent.__greenlet_primitives"); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 37, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_ptype_6gevent_21__greenlet_primitives_TrackedRawGreenlet = __Pyx_ImportType(__pyx_t_2, "gevent.__greenlet_primitives", "TrackedRawGreenlet", sizeof(struct __pyx_obj_6gevent_21__greenlet_primitives_TrackedRawGreenlet), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_21__greenlet_primitives_TrackedRawGreenlet) __PYX_ERR(1, 37, __pyx_L1_error) + __pyx_ptype_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop = __Pyx_ImportType(__pyx_t_2, "gevent.__greenlet_primitives", "SwitchOutGreenletWithLoop", sizeof(struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop) __PYX_ERR(1, 40, __pyx_L1_error) + __pyx_vtabptr_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop = (struct __pyx_vtabstruct_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop*)__Pyx_GetVtable(__pyx_ptype_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop->tp_dict); if (unlikely(!__pyx_vtabptr_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop)) __PYX_ERR(1, 40, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_modinit_variable_import_code(void) { + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); + /*--- Variable import code ---*/ + __pyx_t_1 = PyImport_ImportModule("gevent.__greenlet_primitives"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_1, "get_objects", (void **)&__pyx_vp_6gevent_21__greenlet_primitives_get_objects, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_1, "wref", (void **)&__pyx_vp_6gevent_21__greenlet_primitives_wref, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_1, "BlockingSwitchOutError", (void **)&__pyx_vp_6gevent_21__greenlet_primitives_BlockingSwitchOutError, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_1, "_greenlet_imported", (void **)&__pyx_vp_6gevent_21__greenlet_primitives__greenlet_imported, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + Py_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_modinit_function_import_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); + /*--- Function import code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + + +#if PY_MAJOR_VERSION < 3 +#ifdef CYTHON_NO_PYINIT_EXPORT +#define __Pyx_PyMODINIT_FUNC void +#else +#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC +#endif +#else +#ifdef CYTHON_NO_PYINIT_EXPORT +#define __Pyx_PyMODINIT_FUNC PyObject * +#else +#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC +#endif +#endif + + +#if PY_MAJOR_VERSION < 3 +__Pyx_PyMODINIT_FUNC init__hub_local(void) CYTHON_SMALL_CODE; /*proto*/ +__Pyx_PyMODINIT_FUNC init__hub_local(void) +#else +__Pyx_PyMODINIT_FUNC PyInit___hub_local(void) CYTHON_SMALL_CODE; /*proto*/ +__Pyx_PyMODINIT_FUNC PyInit___hub_local(void) +#if CYTHON_PEP489_MULTI_PHASE_INIT +{ + return PyModuleDef_Init(&__pyx_moduledef); +} +static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { + #if PY_VERSION_HEX >= 0x030700A1 + static PY_INT64_T main_interpreter_id = -1; + PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); + if (main_interpreter_id == -1) { + main_interpreter_id = current_id; + return (unlikely(current_id == -1)) ? -1 : 0; + } else if (unlikely(main_interpreter_id != current_id)) + #else + static PyInterpreterState *main_interpreter = NULL; + PyInterpreterState *current_interpreter = PyThreadState_Get()->interp; + if (!main_interpreter) { + main_interpreter = current_interpreter; + } else if (unlikely(main_interpreter != current_interpreter)) + #endif + { + PyErr_SetString( + PyExc_ImportError, + "Interpreter change detected - this module can only be loaded into one interpreter per process."); + return -1; + } + return 0; +} +static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) { + PyObject *value = PyObject_GetAttrString(spec, from_name); + int result = 0; + if (likely(value)) { + if (allow_none || value != Py_None) { + result = PyDict_SetItemString(moddict, to_name, value); + } + Py_DECREF(value); + } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_Clear(); + } else { + result = -1; + } + return result; +} +static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) { + PyObject *module = NULL, *moddict, *modname; + if (__Pyx_check_single_interpreter()) + return NULL; + if (__pyx_m) + return __Pyx_NewRef(__pyx_m); + modname = PyObject_GetAttrString(spec, "name"); + if (unlikely(!modname)) goto bad; + module = PyModule_NewObject(modname); + Py_DECREF(modname); + if (unlikely(!module)) goto bad; + moddict = PyModule_GetDict(module); + if (unlikely(!moddict)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad; + return module; +bad: + Py_XDECREF(module); + return NULL; +} + + +static CYTHON_SMALL_CODE int __pyx_pymod_exec___hub_local(PyObject *__pyx_pyinit_module) +#endif +#endif +{ + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + __Pyx_RefNannyDeclarations + #if CYTHON_PEP489_MULTI_PHASE_INIT + if (__pyx_m) { + if (__pyx_m == __pyx_pyinit_module) return 0; + PyErr_SetString(PyExc_RuntimeError, "Module '__hub_local' has already been imported. Re-initialisation is not supported."); + return -1; + } + #elif PY_MAJOR_VERSION >= 3 + if (__pyx_m) return __Pyx_NewRef(__pyx_m); + #endif + #if CYTHON_REFNANNY +__Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); +if (!__Pyx_RefNanny) { + PyErr_Clear(); + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); + if (!__Pyx_RefNanny) + Py_FatalError("failed to import 'refnanny' module"); +} +#endif + __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit___hub_local(void)", 0); + if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #ifdef __Pxy_PyFrame_Initialize_Offsets + __Pxy_PyFrame_Initialize_Offsets(); + #endif + __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) + #ifdef __Pyx_CyFunction_USED + if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_FusedFunction_USED + if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_Coroutine_USED + if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_Generator_USED + if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_AsyncGen_USED + if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_StopAsyncIteration_USED + if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + /*--- Library function declarations ---*/ + /*--- Threads initialization code ---*/ + #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS + #ifdef WITH_THREAD /* Python build with threading support? */ + PyEval_InitThreads(); + #endif + #endif + /*--- Module creation code ---*/ + #if CYTHON_PEP489_MULTI_PHASE_INIT + __pyx_m = __pyx_pyinit_module; + Py_INCREF(__pyx_m); + #else + #if PY_MAJOR_VERSION < 3 + __pyx_m = Py_InitModule4("__hub_local", __pyx_methods, __pyx_k_Maintains_the_thread_local_hub, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); + #else + __pyx_m = PyModule_Create(&__pyx_moduledef); + #endif + if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) + Py_INCREF(__pyx_d); + __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) + #if CYTHON_COMPILING_IN_PYPY + Py_INCREF(__pyx_b); + #endif + if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + /*--- Initialize various global constants etc. ---*/ + if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) + if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + if (__pyx_module_is_main_gevent____hub_local) { + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + } + #if PY_MAJOR_VERSION >= 3 + { + PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) + if (!PyDict_GetItemString(modules, "gevent.__hub_local")) { + if (unlikely(PyDict_SetItemString(modules, "gevent.__hub_local", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error) + } + } + #endif + /*--- Builtin init code ---*/ + if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + /*--- Constants init code ---*/ + if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + /*--- Global type/function init code ---*/ + (void)__Pyx_modinit_global_init_code(); + if (unlikely(__Pyx_modinit_variable_export_code() != 0)) goto __pyx_L1_error; + if (unlikely(__Pyx_modinit_function_export_code() != 0)) goto __pyx_L1_error; + (void)__Pyx_modinit_type_init_code(); + if (unlikely(__Pyx_modinit_type_import_code() != 0)) goto __pyx_L1_error; + if (unlikely(__Pyx_modinit_variable_import_code() != 0)) goto __pyx_L1_error; + (void)__Pyx_modinit_function_import_code(); + /*--- Execution code ---*/ + #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) + if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + + /* "src/gevent/_hub_local.py":12 + * + * + * from gevent._compat import thread_mod_name # <<<<<<<<<<<<<< + * + * __all__ = [ + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_thread_mod_name); + __Pyx_GIVEREF(__pyx_n_s_thread_mod_name); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_thread_mod_name); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_gevent__compat, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_thread_mod_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_thread_mod_name, __pyx_t_1) < 0) __PYX_ERR(0, 12, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/_hub_local.py":14 + * from gevent._compat import thread_mod_name + * + * __all__ = [ # <<<<<<<<<<<<<< + * 'get_hub', + * 'get_hub_noargs', + */ + __pyx_t_2 = PyList_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 14, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_get_hub); + __Pyx_GIVEREF(__pyx_n_s_get_hub); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_get_hub); + __Pyx_INCREF(__pyx_n_s_get_hub_noargs); + __Pyx_GIVEREF(__pyx_n_s_get_hub_noargs); + PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_get_hub_noargs); + __Pyx_INCREF(__pyx_n_s_get_hub_if_exists); + __Pyx_GIVEREF(__pyx_n_s_get_hub_if_exists); + PyList_SET_ITEM(__pyx_t_2, 2, __pyx_n_s_get_hub_if_exists); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_all, __pyx_t_2) < 0) __PYX_ERR(0, 14, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/_hub_local.py":24 + * # We are imported early enough (by gevent/__init__) that + * # we can rely on not being monkey-patched in any way yet. + * class _Threadlocal(__import__(thread_mod_name)._local): # <<<<<<<<<<<<<< + * + * def __init__(self): + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_thread_mod_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 24, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin___import__, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 24, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_local); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 24, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 24, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 24, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_Threadlocal, __pyx_n_s_Threadlocal, (PyObject *) NULL, __pyx_n_s_gevent___hub_local, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 24, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + + /* "src/gevent/_hub_local.py":26 + * class _Threadlocal(__import__(thread_mod_name)._local): + * + * def __init__(self): # <<<<<<<<<<<<<< + * # Use a class with an initializer so that we can test + * # for 'is None' instead of catching AttributeError, making + */ + __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_11__hub_local_12_Threadlocal_1__init__, 0, __pyx_n_s_Threadlocal___init, NULL, __pyx_n_s_gevent___hub_local, __pyx_d, ((PyObject *)__pyx_codeobj__2)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 26, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_init, __pyx_t_4) < 0) __PYX_ERR(0, 26, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "src/gevent/_hub_local.py":24 + * # We are imported early enough (by gevent/__init__) that + * # we can rely on not being monkey-patched in any way yet. + * class _Threadlocal(__import__(thread_mod_name)._local): # <<<<<<<<<<<<<< + * + * def __init__(self): + */ + __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_Threadlocal, __pyx_t_1, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 24, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_Threadlocal, __pyx_t_4) < 0) __PYX_ERR(0, 24, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_hub_local.py":36 + * self.hub = None + * + * _threadlocal = _Threadlocal() # <<<<<<<<<<<<<< + * + * Hub = None # Set when gevent.hub is imported + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Threadlocal); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 36, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 36, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XGOTREF(__pyx_v_6gevent_11__hub_local__threadlocal); + __Pyx_DECREF_SET(__pyx_v_6gevent_11__hub_local__threadlocal, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + + /* "src/gevent/_hub_local.py":38 + * _threadlocal = _Threadlocal() + * + * Hub = None # Set when gevent.hub is imported # <<<<<<<<<<<<<< + * + * def get_hub_class(): + */ + if (PyDict_SetItem(__pyx_d, __pyx_n_s_Hub, Py_None) < 0) __PYX_ERR(0, 38, __pyx_L1_error) + + /* "src/gevent/_hub_local.py":40 + * Hub = None # Set when gevent.hub is imported + * + * def get_hub_class(): # <<<<<<<<<<<<<< + * """Return the type of hub to use for the current thread. + * + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_11__hub_local_1get_hub_class, 0, __pyx_n_s_get_hub_class, NULL, __pyx_n_s_gevent___hub_local, __pyx_d, ((PyObject *)__pyx_codeobj__3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 40, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_hub_class, __pyx_t_2) < 0) __PYX_ERR(0, 40, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/_hub_local.py":50 + * return hubtype + * + * def set_default_hub_class(hubtype): # <<<<<<<<<<<<<< + * global Hub + * Hub = hubtype + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_11__hub_local_3set_default_hub_class, 0, __pyx_n_s_set_default_hub_class, NULL, __pyx_n_s_gevent___hub_local, __pyx_d, ((PyObject *)__pyx_codeobj__5)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 50, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_default_hub_class, __pyx_t_2) < 0) __PYX_ERR(0, 50, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/_hub_local.py":54 + * Hub = hubtype + * + * def get_hub(*args, **kwargs): # <<<<<<<<<<<<<< + * """ + * Return the hub for the current thread. + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_11__hub_local_5get_hub, 0, __pyx_n_s_get_hub, NULL, __pyx_n_s_gevent___hub_local, __pyx_d, ((PyObject *)__pyx_codeobj__7)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 54, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_hub, __pyx_t_2) < 0) __PYX_ERR(0, 54, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/_hub_local.py":73 + * return hub + * + * def get_hub_noargs(): # <<<<<<<<<<<<<< + * # Just like get_hub, but cheaper to call because it + * # takes no arguments or kwargs. See also a copy in + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_11__hub_local_7get_hub_noargs, 0, __pyx_n_s_get_hub_noargs, NULL, __pyx_n_s_gevent___hub_local, __pyx_d, ((PyObject *)__pyx_codeobj__8)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 73, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_hub_noargs, __pyx_t_2) < 0) __PYX_ERR(0, 73, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/_hub_local.py":83 + * return hub + * + * def get_hub_if_exists(): # <<<<<<<<<<<<<< + * """Return the hub for the current thread. + * + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_11__hub_local_9get_hub_if_exists, 0, __pyx_n_s_get_hub_if_exists, NULL, __pyx_n_s_gevent___hub_local, __pyx_d, ((PyObject *)__pyx_codeobj__9)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 83, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_hub_if_exists, __pyx_t_2) < 0) __PYX_ERR(0, 83, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/_hub_local.py":91 + * + * + * def set_hub(hub): # <<<<<<<<<<<<<< + * _threadlocal.hub = hub + * + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_11__hub_local_11set_hub, 0, __pyx_n_s_set_hub, NULL, __pyx_n_s_gevent___hub_local, __pyx_d, ((PyObject *)__pyx_codeobj__11)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 91, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_hub, __pyx_t_2) < 0) __PYX_ERR(0, 91, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/_hub_local.py":94 + * _threadlocal.hub = hub + * + * def get_loop(): # <<<<<<<<<<<<<< + * return _threadlocal.loop + * + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_11__hub_local_13get_loop, 0, __pyx_n_s_get_loop, NULL, __pyx_n_s_gevent___hub_local, __pyx_d, ((PyObject *)__pyx_codeobj__12)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 94, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_loop, __pyx_t_2) < 0) __PYX_ERR(0, 94, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/_hub_local.py":97 + * return _threadlocal.loop + * + * def set_loop(loop): # <<<<<<<<<<<<<< + * _threadlocal.loop = loop + * + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_11__hub_local_15set_loop, 0, __pyx_n_s_set_loop, NULL, __pyx_n_s_gevent___hub_local, __pyx_d, ((PyObject *)__pyx_codeobj__14)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 97, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_loop, __pyx_t_2) < 0) __PYX_ERR(0, 97, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/_hub_local.py":100 + * _threadlocal.loop = loop + * + * from gevent._util import import_c_accel # <<<<<<<<<<<<<< + * import_c_accel(globals(), 'gevent.__hub_local') + */ + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 100, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_import_c_accel); + __Pyx_GIVEREF(__pyx_n_s_import_c_accel); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_import_c_accel); + __pyx_t_1 = __Pyx_Import(__pyx_n_s_gevent__util, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 100, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_import_c_accel); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 100, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_import_c_accel, __pyx_t_2) < 0) __PYX_ERR(0, 100, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_hub_local.py":101 + * + * from gevent._util import import_c_accel + * import_c_accel(globals(), 'gevent.__hub_local') # <<<<<<<<<<<<<< + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_import_c_accel); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 101, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_Globals(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 101, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 101, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __Pyx_INCREF(__pyx_n_s_gevent___hub_local); + __Pyx_GIVEREF(__pyx_n_s_gevent___hub_local); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_n_s_gevent___hub_local); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 101, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/_hub_local.py":1 + * # -*- coding: utf-8 -*- # <<<<<<<<<<<<<< + * # copyright 2018 gevent. See LICENSE + * """ + */ + __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "gevent/__greenlet_primitives.pxd":34 + * _greenlet_imported = True + * + * cdef inline object _greenlet_switch(greenlet self): # <<<<<<<<<<<<<< + * return PyGreenlet_Switch(self, NULL, NULL) + * + */ + + /*--- Wrapped vars code ---*/ + + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + if (__pyx_m) { + if (__pyx_d) { + __Pyx_AddTraceback("init gevent.__hub_local", __pyx_clineno, __pyx_lineno, __pyx_filename); + } + Py_CLEAR(__pyx_m); + } else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_ImportError, "init gevent.__hub_local"); + } + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + #if CYTHON_PEP489_MULTI_PHASE_INIT + return (__pyx_m != NULL) ? 0 : -1; + #elif PY_MAJOR_VERSION >= 3 + return __pyx_m; + #else + return; + #endif +} + +/* --- Runtime support code --- */ +/* Refnanny */ +#if CYTHON_REFNANNY +static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { + PyObject *m = NULL, *p = NULL; + void *r = NULL; + m = PyImport_ImportModule(modname); + if (!m) goto end; + p = PyObject_GetAttrString(m, "RefNannyAPI"); + if (!p) goto end; + r = PyLong_AsVoidPtr(p); +end: + Py_XDECREF(p); + Py_XDECREF(m); + return (__Pyx_RefNannyAPIStruct *)r; +} +#endif + +/* PyObjectGetAttrStr */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_getattro)) + return tp->tp_getattro(obj, attr_name); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_getattr)) + return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); +#endif + return PyObject_GetAttr(obj, attr_name); +} +#endif + +/* GetBuiltinName */ +static PyObject *__Pyx_GetBuiltinName(PyObject *name) { + PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name); + if (unlikely(!result)) { + PyErr_Format(PyExc_NameError, +#if PY_MAJOR_VERSION >= 3 + "name '%U' is not defined", name); +#else + "name '%.200s' is not defined", PyString_AS_STRING(name)); +#endif + } + return result; +} + +/* GetModuleGlobalName */ +#if CYTHON_USE_DICT_VERSIONS +static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value) +#else +static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) +#endif +{ + PyObject *result; +#if !CYTHON_AVOID_BORROWED_REFS +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 + result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } else if (unlikely(PyErr_Occurred())) { + return NULL; + } +#else + result = PyDict_GetItem(__pyx_d, name); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } +#endif +#else + result = PyObject_GetItem(__pyx_d, name); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } + PyErr_Clear(); +#endif + return __Pyx_GetBuiltinName(name); +} + +/* PyObjectCall */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { + PyObject *result; + ternaryfunc call = func->ob_type->tp_call; + if (unlikely(!call)) + return PyObject_Call(func, arg, kw); + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; + result = (*call)(func, arg, kw); + Py_LeaveRecursiveCall(); + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +/* PyFunctionFastCall */ +#if CYTHON_FAST_PYCALL +static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, + PyObject *globals) { + PyFrameObject *f; + PyThreadState *tstate = __Pyx_PyThreadState_Current; + PyObject **fastlocals; + Py_ssize_t i; + PyObject *result; + assert(globals != NULL); + /* XXX Perhaps we should create a specialized + PyFrame_New() that doesn't take locals, but does + take builtins without sanity checking them. + */ + assert(tstate != NULL); + f = PyFrame_New(tstate, co, globals, NULL); + if (f == NULL) { + return NULL; + } + fastlocals = __Pyx_PyFrame_GetLocalsplus(f); + for (i = 0; i < na; i++) { + Py_INCREF(*args); + fastlocals[i] = *args++; + } + result = PyEval_EvalFrameEx(f,0); + ++tstate->recursion_depth; + Py_DECREF(f); + --tstate->recursion_depth; + return result; +} +#if 1 || PY_VERSION_HEX < 0x030600B1 +static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs) { + PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); + PyObject *globals = PyFunction_GET_GLOBALS(func); + PyObject *argdefs = PyFunction_GET_DEFAULTS(func); + PyObject *closure; +#if PY_MAJOR_VERSION >= 3 + PyObject *kwdefs; +#endif + PyObject *kwtuple, **k; + PyObject **d; + Py_ssize_t nd; + Py_ssize_t nk; + PyObject *result; + assert(kwargs == NULL || PyDict_Check(kwargs)); + nk = kwargs ? PyDict_Size(kwargs) : 0; + if (Py_EnterRecursiveCall((char*)" while calling a Python object")) { + return NULL; + } + if ( +#if PY_MAJOR_VERSION >= 3 + co->co_kwonlyargcount == 0 && +#endif + likely(kwargs == NULL || nk == 0) && + co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { + if (argdefs == NULL && co->co_argcount == nargs) { + result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); + goto done; + } + else if (nargs == 0 && argdefs != NULL + && co->co_argcount == Py_SIZE(argdefs)) { + /* function called with no arguments, but all parameters have + a default value: use default values as arguments .*/ + args = &PyTuple_GET_ITEM(argdefs, 0); + result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); + goto done; + } + } + if (kwargs != NULL) { + Py_ssize_t pos, i; + kwtuple = PyTuple_New(2 * nk); + if (kwtuple == NULL) { + result = NULL; + goto done; + } + k = &PyTuple_GET_ITEM(kwtuple, 0); + pos = i = 0; + while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { + Py_INCREF(k[i]); + Py_INCREF(k[i+1]); + i += 2; + } + nk = i / 2; + } + else { + kwtuple = NULL; + k = NULL; + } + closure = PyFunction_GET_CLOSURE(func); +#if PY_MAJOR_VERSION >= 3 + kwdefs = PyFunction_GET_KW_DEFAULTS(func); +#endif + if (argdefs != NULL) { + d = &PyTuple_GET_ITEM(argdefs, 0); + nd = Py_SIZE(argdefs); + } + else { + d = NULL; + nd = 0; + } +#if PY_MAJOR_VERSION >= 3 + result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, + args, nargs, + k, (int)nk, + d, (int)nd, kwdefs, closure); +#else + result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, + args, nargs, + k, (int)nk, + d, (int)nd, closure); +#endif + Py_XDECREF(kwtuple); +done: + Py_LeaveRecursiveCall(); + return result; +} +#endif +#endif + +/* PyObjectCallMethO */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { + PyObject *self, *result; + PyCFunction cfunc; + cfunc = PyCFunction_GET_FUNCTION(func); + self = PyCFunction_GET_SELF(func); + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; + result = cfunc(self, arg); + Py_LeaveRecursiveCall(); + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +/* PyObjectCallNoArg */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { +#if CYTHON_FAST_PYCALL + if (PyFunction_Check(func)) { + return __Pyx_PyFunction_FastCall(func, NULL, 0); + } +#endif +#ifdef __Pyx_CyFunction_USED + if (likely(PyCFunction_Check(func) || __Pyx_CyFunction_Check(func))) +#else + if (likely(PyCFunction_Check(func))) +#endif + { + if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) { + return __Pyx_PyObject_CallMethO(func, NULL); + } + } + return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL); +} +#endif + +/* PyCFunctionFastCall */ +#if CYTHON_FAST_PYCCALL +static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) { + PyCFunctionObject *func = (PyCFunctionObject*)func_obj; + PyCFunction meth = PyCFunction_GET_FUNCTION(func); + PyObject *self = PyCFunction_GET_SELF(func); + int flags = PyCFunction_GET_FLAGS(func); + assert(PyCFunction_Check(func)); + assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS))); + assert(nargs >= 0); + assert(nargs == 0 || args != NULL); + /* _PyCFunction_FastCallDict() must not be called with an exception set, + because it may clear it (directly or indirectly) and so the + caller loses its exception */ + assert(!PyErr_Occurred()); + if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) { + return (*((__Pyx_PyCFunctionFastWithKeywords)(void*)meth)) (self, args, nargs, NULL); + } else { + return (*((__Pyx_PyCFunctionFast)(void*)meth)) (self, args, nargs); + } +} +#endif + +/* PyObjectCallOneArg */ +#if CYTHON_COMPILING_IN_CPYTHON +static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) { + PyObject *result; + PyObject *args = PyTuple_New(1); + if (unlikely(!args)) return NULL; + Py_INCREF(arg); + PyTuple_SET_ITEM(args, 0, arg); + result = __Pyx_PyObject_Call(func, args, NULL); + Py_DECREF(args); + return result; +} +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { +#if CYTHON_FAST_PYCALL + if (PyFunction_Check(func)) { + return __Pyx_PyFunction_FastCall(func, &arg, 1); + } +#endif + if (likely(PyCFunction_Check(func))) { + if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) { + return __Pyx_PyObject_CallMethO(func, arg); +#if CYTHON_FAST_PYCCALL + } else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) { + return __Pyx_PyCFunction_FastCall(func, &arg, 1); +#endif + } + } + return __Pyx__PyObject_CallOneArg(func, arg); +} +#else +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { + PyObject *result; + PyObject *args = PyTuple_Pack(1, arg); + if (unlikely(!args)) return NULL; + result = __Pyx_PyObject_Call(func, args, NULL); + Py_DECREF(args); + return result; +} +#endif + +/* PyObjectSetAttrStr */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) { + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_setattro)) + return tp->tp_setattro(obj, attr_name, value); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_setattr)) + return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value); +#endif + return PyObject_SetAttr(obj, attr_name, value); +} +#endif + +/* KeywordStringCheck */ +static int __Pyx_CheckKeywordStrings( + PyObject *kwdict, + const char* function_name, + int kw_allowed) +{ + PyObject* key = 0; + Py_ssize_t pos = 0; +#if CYTHON_COMPILING_IN_PYPY + if (!kw_allowed && PyDict_Next(kwdict, &pos, &key, 0)) + goto invalid_keyword; + return 1; +#else + while (PyDict_Next(kwdict, &pos, &key, 0)) { + #if PY_MAJOR_VERSION < 3 + if (unlikely(!PyString_Check(key))) + #endif + if (unlikely(!PyUnicode_Check(key))) + goto invalid_keyword_type; + } + if ((!kw_allowed) && unlikely(key)) + goto invalid_keyword; + return 1; +invalid_keyword_type: + PyErr_Format(PyExc_TypeError, + "%.200s() keywords must be strings", function_name); + return 0; +#endif +invalid_keyword: + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION < 3 + "%.200s() got an unexpected keyword argument '%.200s'", + function_name, PyString_AsString(key)); + #else + "%s() got an unexpected keyword argument '%U'", + function_name, key); + #endif + return 0; +} + +/* ExtTypeTest */ +static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { + if (unlikely(!type)) { + PyErr_SetString(PyExc_SystemError, "Missing type object"); + return 0; + } + if (likely(__Pyx_TypeCheck(obj, type))) + return 1; + PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s", + Py_TYPE(obj)->tp_name, type->tp_name); + return 0; +} + +/* ArgTypeTest */ +static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact) +{ + if (unlikely(!type)) { + PyErr_SetString(PyExc_SystemError, "Missing type object"); + return 0; + } + else if (exact) { + #if PY_MAJOR_VERSION == 2 + if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1; + #endif + } + else { + if (likely(__Pyx_TypeCheck(obj, type))) return 1; + } + PyErr_Format(PyExc_TypeError, + "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)", + name, type->tp_name, Py_TYPE(obj)->tp_name); + return 0; +} + +/* TypeImport */ +#ifndef __PYX_HAVE_RT_ImportType +#define __PYX_HAVE_RT_ImportType +static PyTypeObject *__Pyx_ImportType(PyObject *module, const char *module_name, const char *class_name, + size_t size, enum __Pyx_ImportType_CheckSize check_size) +{ + PyObject *result = 0; + char warning[200]; + Py_ssize_t basicsize; +#ifdef Py_LIMITED_API + PyObject *py_basicsize; +#endif + result = PyObject_GetAttrString(module, class_name); + if (!result) + goto bad; + if (!PyType_Check(result)) { + PyErr_Format(PyExc_TypeError, + "%.200s.%.200s is not a type object", + module_name, class_name); + goto bad; + } +#ifndef Py_LIMITED_API + basicsize = ((PyTypeObject *)result)->tp_basicsize; +#else + py_basicsize = PyObject_GetAttrString(result, "__basicsize__"); + if (!py_basicsize) + goto bad; + basicsize = PyLong_AsSsize_t(py_basicsize); + Py_DECREF(py_basicsize); + py_basicsize = 0; + if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred()) + goto bad; +#endif + if ((size_t)basicsize < size) { + PyErr_Format(PyExc_ValueError, + "%.200s.%.200s size changed, may indicate binary incompatibility. " + "Expected %zd from C header, got %zd from PyObject", + module_name, class_name, size, basicsize); + goto bad; + } + if (check_size == __Pyx_ImportType_CheckSize_Error && (size_t)basicsize != size) { + PyErr_Format(PyExc_ValueError, + "%.200s.%.200s size changed, may indicate binary incompatibility. " + "Expected %zd from C header, got %zd from PyObject", + module_name, class_name, size, basicsize); + goto bad; + } + else if (check_size == __Pyx_ImportType_CheckSize_Warn && (size_t)basicsize > size) { + PyOS_snprintf(warning, sizeof(warning), + "%s.%s size changed, may indicate binary incompatibility. " + "Expected %zd from C header, got %zd from PyObject", + module_name, class_name, size, basicsize); + if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad; + } + return (PyTypeObject *)result; +bad: + Py_XDECREF(result); + return NULL; +} +#endif + +/* GetVTable */ +static void* __Pyx_GetVtable(PyObject *dict) { + void* ptr; + PyObject *ob = PyObject_GetItem(dict, __pyx_n_s_pyx_vtable); + if (!ob) + goto bad; +#if PY_VERSION_HEX >= 0x02070000 + ptr = PyCapsule_GetPointer(ob, 0); +#else + ptr = PyCObject_AsVoidPtr(ob); +#endif + if (!ptr && !PyErr_Occurred()) + PyErr_SetString(PyExc_RuntimeError, "invalid vtable found for imported type"); + Py_DECREF(ob); + return ptr; +bad: + Py_XDECREF(ob); + return NULL; +} + +/* Import */ +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { + PyObject *empty_list = 0; + PyObject *module = 0; + PyObject *global_dict = 0; + PyObject *empty_dict = 0; + PyObject *list; + #if PY_MAJOR_VERSION < 3 + PyObject *py_import; + py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); + if (!py_import) + goto bad; + #endif + if (from_list) + list = from_list; + else { + empty_list = PyList_New(0); + if (!empty_list) + goto bad; + list = empty_list; + } + global_dict = PyModule_GetDict(__pyx_m); + if (!global_dict) + goto bad; + empty_dict = PyDict_New(); + if (!empty_dict) + goto bad; + { + #if PY_MAJOR_VERSION >= 3 + if (level == -1) { + if (strchr(__Pyx_MODULE_NAME, '.')) { + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, 1); + if (!module) { + if (!PyErr_ExceptionMatches(PyExc_ImportError)) + goto bad; + PyErr_Clear(); + } + } + level = 0; + } + #endif + if (!module) { + #if PY_MAJOR_VERSION < 3 + PyObject *py_level = PyInt_FromLong(level); + if (!py_level) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, py_level, (PyObject *)NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, level); + #endif + } + } +bad: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(py_import); + #endif + Py_XDECREF(empty_list); + Py_XDECREF(empty_dict); + return module; +} + +/* ImportFrom */ +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { + PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); + if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_Format(PyExc_ImportError, + #if PY_MAJOR_VERSION < 3 + "cannot import name %.230s", PyString_AS_STRING(name)); + #else + "cannot import name %S", name); + #endif + } + return value; +} + +/* CalculateMetaclass */ +static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) { + Py_ssize_t i, nbases = PyTuple_GET_SIZE(bases); + for (i=0; i < nbases; i++) { + PyTypeObject *tmptype; + PyObject *tmp = PyTuple_GET_ITEM(bases, i); + tmptype = Py_TYPE(tmp); +#if PY_MAJOR_VERSION < 3 + if (tmptype == &PyClass_Type) + continue; +#endif + if (!metaclass) { + metaclass = tmptype; + continue; + } + if (PyType_IsSubtype(metaclass, tmptype)) + continue; + if (PyType_IsSubtype(tmptype, metaclass)) { + metaclass = tmptype; + continue; + } + PyErr_SetString(PyExc_TypeError, + "metaclass conflict: " + "the metaclass of a derived class " + "must be a (non-strict) subclass " + "of the metaclasses of all its bases"); + return NULL; + } + if (!metaclass) { +#if PY_MAJOR_VERSION < 3 + metaclass = &PyClass_Type; +#else + metaclass = &PyType_Type; +#endif + } + Py_INCREF((PyObject*) metaclass); + return (PyObject*) metaclass; +} + +/* FetchCommonType */ +static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { + PyObject* fake_module; + PyTypeObject* cached_type = NULL; + fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI); + if (!fake_module) return NULL; + Py_INCREF(fake_module); + cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name); + if (cached_type) { + if (!PyType_Check((PyObject*)cached_type)) { + PyErr_Format(PyExc_TypeError, + "Shared Cython type %.200s is not a type object", + type->tp_name); + goto bad; + } + if (cached_type->tp_basicsize != type->tp_basicsize) { + PyErr_Format(PyExc_TypeError, + "Shared Cython type %.200s has the wrong size, try recompiling", + type->tp_name); + goto bad; + } + } else { + if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; + PyErr_Clear(); + if (PyType_Ready(type) < 0) goto bad; + if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0) + goto bad; + Py_INCREF(type); + cached_type = type; + } +done: + Py_DECREF(fake_module); + return cached_type; +bad: + Py_XDECREF(cached_type); + cached_type = NULL; + goto done; +} + +/* CythonFunction */ +#include +static PyObject * +__Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure) +{ + if (unlikely(op->func_doc == NULL)) { + if (op->func.m_ml->ml_doc) { +#if PY_MAJOR_VERSION >= 3 + op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc); +#else + op->func_doc = PyString_FromString(op->func.m_ml->ml_doc); +#endif + if (unlikely(op->func_doc == NULL)) + return NULL; + } else { + Py_INCREF(Py_None); + return Py_None; + } + } + Py_INCREF(op->func_doc); + return op->func_doc; +} +static int +__Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context) +{ + PyObject *tmp = op->func_doc; + if (value == NULL) { + value = Py_None; + } + Py_INCREF(value); + op->func_doc = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + if (unlikely(op->func_name == NULL)) { +#if PY_MAJOR_VERSION >= 3 + op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name); +#else + op->func_name = PyString_InternFromString(op->func.m_ml->ml_name); +#endif + if (unlikely(op->func_name == NULL)) + return NULL; + } + Py_INCREF(op->func_name); + return op->func_name; +} +static int +__Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context) +{ + PyObject *tmp; +#if PY_MAJOR_VERSION >= 3 + if (unlikely(value == NULL || !PyUnicode_Check(value))) +#else + if (unlikely(value == NULL || !PyString_Check(value))) +#endif + { + PyErr_SetString(PyExc_TypeError, + "__name__ must be set to a string object"); + return -1; + } + tmp = op->func_name; + Py_INCREF(value); + op->func_name = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + Py_INCREF(op->func_qualname); + return op->func_qualname; +} +static int +__Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context) +{ + PyObject *tmp; +#if PY_MAJOR_VERSION >= 3 + if (unlikely(value == NULL || !PyUnicode_Check(value))) +#else + if (unlikely(value == NULL || !PyString_Check(value))) +#endif + { + PyErr_SetString(PyExc_TypeError, + "__qualname__ must be set to a string object"); + return -1; + } + tmp = op->func_qualname; + Py_INCREF(value); + op->func_qualname = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED void *closure) +{ + PyObject *self; + self = m->func_closure; + if (self == NULL) + self = Py_None; + Py_INCREF(self); + return self; +} +static PyObject * +__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + if (unlikely(op->func_dict == NULL)) { + op->func_dict = PyDict_New(); + if (unlikely(op->func_dict == NULL)) + return NULL; + } + Py_INCREF(op->func_dict); + return op->func_dict; +} +static int +__Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context) +{ + PyObject *tmp; + if (unlikely(value == NULL)) { + PyErr_SetString(PyExc_TypeError, + "function's dictionary may not be deleted"); + return -1; + } + if (unlikely(!PyDict_Check(value))) { + PyErr_SetString(PyExc_TypeError, + "setting function's dictionary to a non-dict"); + return -1; + } + tmp = op->func_dict; + Py_INCREF(value); + op->func_dict = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + Py_INCREF(op->func_globals); + return op->func_globals; +} +static PyObject * +__Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + Py_INCREF(Py_None); + return Py_None; +} +static PyObject * +__Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + PyObject* result = (op->func_code) ? op->func_code : Py_None; + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { + int result = 0; + PyObject *res = op->defaults_getter((PyObject *) op); + if (unlikely(!res)) + return -1; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + op->defaults_tuple = PyTuple_GET_ITEM(res, 0); + Py_INCREF(op->defaults_tuple); + op->defaults_kwdict = PyTuple_GET_ITEM(res, 1); + Py_INCREF(op->defaults_kwdict); + #else + op->defaults_tuple = PySequence_ITEM(res, 0); + if (unlikely(!op->defaults_tuple)) result = -1; + else { + op->defaults_kwdict = PySequence_ITEM(res, 1); + if (unlikely(!op->defaults_kwdict)) result = -1; + } + #endif + Py_DECREF(res); + return result; +} +static int +__Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) { + PyObject* tmp; + if (!value) { + value = Py_None; + } else if (value != Py_None && !PyTuple_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__defaults__ must be set to a tuple object"); + return -1; + } + Py_INCREF(value); + tmp = op->defaults_tuple; + op->defaults_tuple = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) { + PyObject* result = op->defaults_tuple; + if (unlikely(!result)) { + if (op->defaults_getter) { + if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL; + result = op->defaults_tuple; + } else { + result = Py_None; + } + } + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) { + PyObject* tmp; + if (!value) { + value = Py_None; + } else if (value != Py_None && !PyDict_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__kwdefaults__ must be set to a dict object"); + return -1; + } + Py_INCREF(value); + tmp = op->defaults_kwdict; + op->defaults_kwdict = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) { + PyObject* result = op->defaults_kwdict; + if (unlikely(!result)) { + if (op->defaults_getter) { + if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL; + result = op->defaults_kwdict; + } else { + result = Py_None; + } + } + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) { + PyObject* tmp; + if (!value || value == Py_None) { + value = NULL; + } else if (!PyDict_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__annotations__ must be set to a dict object"); + return -1; + } + Py_XINCREF(value); + tmp = op->func_annotations; + op->func_annotations = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) { + PyObject* result = op->func_annotations; + if (unlikely(!result)) { + result = PyDict_New(); + if (unlikely(!result)) return NULL; + op->func_annotations = result; + } + Py_INCREF(result); + return result; +} +static PyGetSetDef __pyx_CyFunction_getsets[] = { + {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, + {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, + {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, + {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, + {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, + {(char *) "__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0}, + {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, + {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, + {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, + {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, + {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, + {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, + {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, + {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, + {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, + {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, + {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, + {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, + {0, 0, 0, 0, 0} +}; +static PyMemberDef __pyx_CyFunction_members[] = { + {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), PY_WRITE_RESTRICTED, 0}, + {0, 0, 0, 0, 0} +}; +static PyObject * +__Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args) +{ +#if PY_MAJOR_VERSION >= 3 + return PyUnicode_FromString(m->func.m_ml->ml_name); +#else + return PyString_FromString(m->func.m_ml->ml_name); +#endif +} +static PyMethodDef __pyx_CyFunction_methods[] = { + {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, + {0, 0, 0, 0} +}; +#if PY_VERSION_HEX < 0x030500A0 +#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist) +#else +#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func.m_weakreflist) +#endif +static PyObject *__Pyx_CyFunction_New(PyTypeObject *type, PyMethodDef *ml, int flags, PyObject* qualname, + PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { + __pyx_CyFunctionObject *op = PyObject_GC_New(__pyx_CyFunctionObject, type); + if (op == NULL) + return NULL; + op->flags = flags; + __Pyx_CyFunction_weakreflist(op) = NULL; + op->func.m_ml = ml; + op->func.m_self = (PyObject *) op; + Py_XINCREF(closure); + op->func_closure = closure; + Py_XINCREF(module); + op->func.m_module = module; + op->func_dict = NULL; + op->func_name = NULL; + Py_INCREF(qualname); + op->func_qualname = qualname; + op->func_doc = NULL; + op->func_classobj = NULL; + op->func_globals = globals; + Py_INCREF(op->func_globals); + Py_XINCREF(code); + op->func_code = code; + op->defaults_pyobjects = 0; + op->defaults = NULL; + op->defaults_tuple = NULL; + op->defaults_kwdict = NULL; + op->defaults_getter = NULL; + op->func_annotations = NULL; + PyObject_GC_Track(op); + return (PyObject *) op; +} +static int +__Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) +{ + Py_CLEAR(m->func_closure); + Py_CLEAR(m->func.m_module); + Py_CLEAR(m->func_dict); + Py_CLEAR(m->func_name); + Py_CLEAR(m->func_qualname); + Py_CLEAR(m->func_doc); + Py_CLEAR(m->func_globals); + Py_CLEAR(m->func_code); + Py_CLEAR(m->func_classobj); + Py_CLEAR(m->defaults_tuple); + Py_CLEAR(m->defaults_kwdict); + Py_CLEAR(m->func_annotations); + if (m->defaults) { + PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); + int i; + for (i = 0; i < m->defaults_pyobjects; i++) + Py_XDECREF(pydefaults[i]); + PyObject_Free(m->defaults); + m->defaults = NULL; + } + return 0; +} +static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m) +{ + if (__Pyx_CyFunction_weakreflist(m) != NULL) + PyObject_ClearWeakRefs((PyObject *) m); + __Pyx_CyFunction_clear(m); + PyObject_GC_Del(m); +} +static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) +{ + PyObject_GC_UnTrack(m); + __Pyx__CyFunction_dealloc(m); +} +static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) +{ + Py_VISIT(m->func_closure); + Py_VISIT(m->func.m_module); + Py_VISIT(m->func_dict); + Py_VISIT(m->func_name); + Py_VISIT(m->func_qualname); + Py_VISIT(m->func_doc); + Py_VISIT(m->func_globals); + Py_VISIT(m->func_code); + Py_VISIT(m->func_classobj); + Py_VISIT(m->defaults_tuple); + Py_VISIT(m->defaults_kwdict); + if (m->defaults) { + PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); + int i; + for (i = 0; i < m->defaults_pyobjects; i++) + Py_VISIT(pydefaults[i]); + } + return 0; +} +static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type) +{ + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) { + Py_INCREF(func); + return func; + } + if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) { + if (type == NULL) + type = (PyObject *)(Py_TYPE(obj)); + return __Pyx_PyMethod_New(func, type, (PyObject *)(Py_TYPE(type))); + } + if (obj == Py_None) + obj = NULL; + return __Pyx_PyMethod_New(func, obj, type); +} +static PyObject* +__Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) +{ +#if PY_MAJOR_VERSION >= 3 + return PyUnicode_FromFormat("", + op->func_qualname, (void *)op); +#else + return PyString_FromFormat("", + PyString_AsString(op->func_qualname), (void *)op); +#endif +} +static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) { + PyCFunctionObject* f = (PyCFunctionObject*)func; + PyCFunction meth = f->m_ml->ml_meth; + Py_ssize_t size; + switch (f->m_ml->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) { + case METH_VARARGS: + if (likely(kw == NULL || PyDict_Size(kw) == 0)) + return (*meth)(self, arg); + break; + case METH_VARARGS | METH_KEYWORDS: + return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw); + case METH_NOARGS: + if (likely(kw == NULL || PyDict_Size(kw) == 0)) { + size = PyTuple_GET_SIZE(arg); + if (likely(size == 0)) + return (*meth)(self, NULL); + PyErr_Format(PyExc_TypeError, + "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", + f->m_ml->ml_name, size); + return NULL; + } + break; + case METH_O: + if (likely(kw == NULL || PyDict_Size(kw) == 0)) { + size = PyTuple_GET_SIZE(arg); + if (likely(size == 1)) { + PyObject *result, *arg0; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + arg0 = PyTuple_GET_ITEM(arg, 0); + #else + arg0 = PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL; + #endif + result = (*meth)(self, arg0); + #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) + Py_DECREF(arg0); + #endif + return result; + } + PyErr_Format(PyExc_TypeError, + "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", + f->m_ml->ml_name, size); + return NULL; + } + break; + default: + PyErr_SetString(PyExc_SystemError, "Bad call flags in " + "__Pyx_CyFunction_Call. METH_OLDARGS is no " + "longer supported!"); + return NULL; + } + PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", + f->m_ml->ml_name); + return NULL; +} +static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { + return __Pyx_CyFunction_CallMethod(func, ((PyCFunctionObject*)func)->m_self, arg, kw); +} +static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) { + PyObject *result; + __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func; + if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { + Py_ssize_t argc; + PyObject *new_args; + PyObject *self; + argc = PyTuple_GET_SIZE(args); + new_args = PyTuple_GetSlice(args, 1, argc); + if (unlikely(!new_args)) + return NULL; + self = PyTuple_GetItem(args, 0); + if (unlikely(!self)) { + Py_DECREF(new_args); + return NULL; + } + result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw); + Py_DECREF(new_args); + } else { + result = __Pyx_CyFunction_Call(func, args, kw); + } + return result; +} +static PyTypeObject __pyx_CyFunctionType_type = { + PyVarObject_HEAD_INIT(0, 0) + "cython_function_or_method", + sizeof(__pyx_CyFunctionObject), + 0, + (destructor) __Pyx_CyFunction_dealloc, + 0, + 0, + 0, +#if PY_MAJOR_VERSION < 3 + 0, +#else + 0, +#endif + (reprfunc) __Pyx_CyFunction_repr, + 0, + 0, + 0, + 0, + __Pyx_CyFunction_CallAsMethod, + 0, + 0, + 0, + 0, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, + 0, + (traverseproc) __Pyx_CyFunction_traverse, + (inquiry) __Pyx_CyFunction_clear, + 0, +#if PY_VERSION_HEX < 0x030500A0 + offsetof(__pyx_CyFunctionObject, func_weakreflist), +#else + offsetof(PyCFunctionObject, m_weakreflist), +#endif + 0, + 0, + __pyx_CyFunction_methods, + __pyx_CyFunction_members, + __pyx_CyFunction_getsets, + 0, + 0, + __Pyx_CyFunction_descr_get, + 0, + offsetof(__pyx_CyFunctionObject, func_dict), + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, +#if PY_VERSION_HEX >= 0x030400a1 + 0, +#endif +}; +static int __pyx_CyFunction_init(void) { + __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); + if (unlikely(__pyx_CyFunctionType == NULL)) { + return -1; + } + return 0; +} +static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults = PyObject_Malloc(size); + if (unlikely(!m->defaults)) + return PyErr_NoMemory(); + memset(m->defaults, 0, size); + m->defaults_pyobjects = pyobjects; + return m->defaults; +} +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults_tuple = tuple; + Py_INCREF(tuple); +} +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults_kwdict = dict; + Py_INCREF(dict); +} +static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->func_annotations = dict; + Py_INCREF(dict); +} + +/* Py3ClassCreate */ +static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, + PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) { + PyObject *ns; + if (metaclass) { + PyObject *prep = __Pyx_PyObject_GetAttrStr(metaclass, __pyx_n_s_prepare); + if (prep) { + PyObject *pargs = PyTuple_Pack(2, name, bases); + if (unlikely(!pargs)) { + Py_DECREF(prep); + return NULL; + } + ns = PyObject_Call(prep, pargs, mkw); + Py_DECREF(prep); + Py_DECREF(pargs); + } else { + if (unlikely(!PyErr_ExceptionMatches(PyExc_AttributeError))) + return NULL; + PyErr_Clear(); + ns = PyDict_New(); + } + } else { + ns = PyDict_New(); + } + if (unlikely(!ns)) + return NULL; + if (unlikely(PyObject_SetItem(ns, __pyx_n_s_module, modname) < 0)) goto bad; + if (unlikely(PyObject_SetItem(ns, __pyx_n_s_qualname, qualname) < 0)) goto bad; + if (unlikely(doc && PyObject_SetItem(ns, __pyx_n_s_doc, doc) < 0)) goto bad; + return ns; +bad: + Py_DECREF(ns); + return NULL; +} +static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, + PyObject *dict, PyObject *mkw, + int calculate_metaclass, int allow_py2_metaclass) { + PyObject *result, *margs; + PyObject *owned_metaclass = NULL; + if (allow_py2_metaclass) { + owned_metaclass = PyObject_GetItem(dict, __pyx_n_s_metaclass); + if (owned_metaclass) { + metaclass = owned_metaclass; + } else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) { + PyErr_Clear(); + } else { + return NULL; + } + } + if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) { + metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases); + Py_XDECREF(owned_metaclass); + if (unlikely(!metaclass)) + return NULL; + owned_metaclass = metaclass; + } + margs = PyTuple_Pack(3, name, bases, dict); + if (unlikely(!margs)) { + result = NULL; + } else { + result = PyObject_Call(metaclass, margs, mkw); + Py_DECREF(margs); + } + Py_XDECREF(owned_metaclass); + return result; +} + +/* GetAttr */ +static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) { +#if CYTHON_USE_TYPE_SLOTS +#if PY_MAJOR_VERSION >= 3 + if (likely(PyUnicode_Check(n))) +#else + if (likely(PyString_Check(n))) +#endif + return __Pyx_PyObject_GetAttrStr(o, n); +#endif + return PyObject_GetAttr(o, n); +} + +/* Globals */ +static PyObject* __Pyx_Globals(void) { + Py_ssize_t i; + PyObject *names; + PyObject *globals = __pyx_d; + Py_INCREF(globals); + names = PyObject_Dir(__pyx_m); + if (!names) + goto bad; + for (i = PyList_GET_SIZE(names)-1; i >= 0; i--) { +#if CYTHON_COMPILING_IN_PYPY + PyObject* name = PySequence_ITEM(names, i); + if (!name) + goto bad; +#else + PyObject* name = PyList_GET_ITEM(names, i); +#endif + if (!PyDict_Contains(globals, name)) { + PyObject* value = __Pyx_GetAttr(__pyx_m, name); + if (!value) { +#if CYTHON_COMPILING_IN_PYPY + Py_DECREF(name); +#endif + goto bad; + } + if (PyDict_SetItem(globals, name, value) < 0) { +#if CYTHON_COMPILING_IN_PYPY + Py_DECREF(name); +#endif + Py_DECREF(value); + goto bad; + } + } +#if CYTHON_COMPILING_IN_PYPY + Py_DECREF(name); +#endif + } + Py_DECREF(names); + return globals; +bad: + Py_XDECREF(names); + Py_XDECREF(globals); + return NULL; +} + +/* PyErrFetchRestore */ +#if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + tmp_type = tstate->curexc_type; + tmp_value = tstate->curexc_value; + tmp_tb = tstate->curexc_traceback; + tstate->curexc_type = type; + tstate->curexc_value = value; + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +} +static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { + *type = tstate->curexc_type; + *value = tstate->curexc_value; + *tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +} +#endif + +/* CLineInTraceback */ +#ifndef CYTHON_CLINE_IN_TRACEBACK +static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { + PyObject *use_cline; + PyObject *ptype, *pvalue, *ptraceback; +#if CYTHON_COMPILING_IN_CPYTHON + PyObject **cython_runtime_dict; +#endif + if (unlikely(!__pyx_cython_runtime)) { + return c_line; + } + __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); +#if CYTHON_COMPILING_IN_CPYTHON + cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); + if (likely(cython_runtime_dict)) { + __PYX_PY_DICT_LOOKUP_IF_MODIFIED( + use_cline, *cython_runtime_dict, + __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback)) + } else +#endif + { + PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback); + if (use_cline_obj) { + use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; + Py_DECREF(use_cline_obj); + } else { + PyErr_Clear(); + use_cline = NULL; + } + } + if (!use_cline) { + c_line = 0; + PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); + } + else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { + c_line = 0; + } + __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); + return c_line; +} +#endif + +/* CodeObjectCache */ +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { + int start = 0, mid = 0, end = count - 1; + if (end >= 0 && code_line > entries[end].code_line) { + return count; + } + while (start < end) { + mid = start + (end - start) / 2; + if (code_line < entries[mid].code_line) { + end = mid; + } else if (code_line > entries[mid].code_line) { + start = mid + 1; + } else { + return mid; + } + } + if (code_line <= entries[mid].code_line) { + return mid; + } else { + return mid + 1; + } +} +static PyCodeObject *__pyx_find_code_object(int code_line) { + PyCodeObject* code_object; + int pos; + if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { + return NULL; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { + return NULL; + } + code_object = __pyx_code_cache.entries[pos].code_object; + Py_INCREF(code_object); + return code_object; +} +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { + int pos, i; + __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; + if (unlikely(!code_line)) { + return; + } + if (unlikely(!entries)) { + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); + if (likely(entries)) { + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = 64; + __pyx_code_cache.count = 1; + entries[0].code_line = code_line; + entries[0].code_object = code_object; + Py_INCREF(code_object); + } + return; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { + PyCodeObject* tmp = entries[pos].code_object; + entries[pos].code_object = code_object; + Py_DECREF(tmp); + return; + } + if (__pyx_code_cache.count == __pyx_code_cache.max_count) { + int new_max = __pyx_code_cache.max_count + 64; + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( + __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry)); + if (unlikely(!entries)) { + return; + } + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = new_max; + } + for (i=__pyx_code_cache.count; i>pos; i--) { + entries[i] = entries[i-1]; + } + entries[pos].code_line = code_line; + entries[pos].code_object = code_object; + __pyx_code_cache.count++; + Py_INCREF(code_object); +} + +/* AddTraceback */ +#include "compile.h" +#include "frameobject.h" +#include "traceback.h" +static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( + const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyObject *py_srcfile = 0; + PyObject *py_funcname = 0; + #if PY_MAJOR_VERSION < 3 + py_srcfile = PyString_FromString(filename); + #else + py_srcfile = PyUnicode_FromString(filename); + #endif + if (!py_srcfile) goto bad; + if (c_line) { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + #else + py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + #endif + } + else { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromString(funcname); + #else + py_funcname = PyUnicode_FromString(funcname); + #endif + } + if (!py_funcname) goto bad; + py_code = __Pyx_PyCode_New( + 0, + 0, + 0, + 0, + 0, + __pyx_empty_bytes, /*PyObject *code,*/ + __pyx_empty_tuple, /*PyObject *consts,*/ + __pyx_empty_tuple, /*PyObject *names,*/ + __pyx_empty_tuple, /*PyObject *varnames,*/ + __pyx_empty_tuple, /*PyObject *freevars,*/ + __pyx_empty_tuple, /*PyObject *cellvars,*/ + py_srcfile, /*PyObject *filename,*/ + py_funcname, /*PyObject *name,*/ + py_line, + __pyx_empty_bytes /*PyObject *lnotab*/ + ); + Py_DECREF(py_srcfile); + Py_DECREF(py_funcname); + return py_code; +bad: + Py_XDECREF(py_srcfile); + Py_XDECREF(py_funcname); + return NULL; +} +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyFrameObject *py_frame = 0; + PyThreadState *tstate = __Pyx_PyThreadState_Current; + if (c_line) { + c_line = __Pyx_CLineForTraceback(tstate, c_line); + } + py_code = __pyx_find_code_object(c_line ? -c_line : py_line); + if (!py_code) { + py_code = __Pyx_CreateCodeObjectForTraceback( + funcname, c_line, py_line, filename); + if (!py_code) goto bad; + __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); + } + py_frame = PyFrame_New( + tstate, /*PyThreadState *tstate,*/ + py_code, /*PyCodeObject *code,*/ + __pyx_d, /*PyObject *globals,*/ + 0 /*PyObject *locals*/ + ); + if (!py_frame) goto bad; + __Pyx_PyFrame_SetLineNumber(py_frame, py_line); + PyTraceBack_Here(py_frame); +bad: + Py_XDECREF(py_code); + Py_XDECREF(py_frame); +} + +/* CIntToPy */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { + const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(long) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(long) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(long) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(long), + little, !is_unsigned); + } +} + +/* CIntFromPyVerify */ +#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ + __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) +#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ + __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) +#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ + {\ + func_type value = func_value;\ + if (sizeof(target_type) < sizeof(func_type)) {\ + if (unlikely(value != (func_type) (target_type) value)) {\ + func_type zero = 0;\ + if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ + return (target_type) -1;\ + if (is_unsigned && unlikely(value < zero))\ + goto raise_neg_overflow;\ + else\ + goto raise_overflow;\ + }\ + }\ + return (target_type) value;\ + } + +/* CIntFromPy */ +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { + const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(long) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (long) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (long) 0; + case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0]) + case 2: + if (8 * sizeof(long) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) { + return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + case 3: + if (8 * sizeof(long) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) { + return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + case 4: + if (8 * sizeof(long) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) { + return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (long) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if (sizeof(long) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (long) 0; + case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0])) + case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0]) + case -2: + if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 2: + if (8 * sizeof(long) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case -3: + if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 3: + if (8 * sizeof(long) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case -4: + if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 4: + if (8 * sizeof(long) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + } +#endif + if (sizeof(long) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + long val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (long) -1; + } + } else { + long val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (long) -1; + val = __Pyx_PyInt_As_long(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to long"); + return (long) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to long"); + return (long) -1; +} + +/* CIntFromPy */ +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { + const int neg_one = (int) ((int) 0 - (int) 1), const_zero = (int) 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(int) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (int) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (int) 0; + case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0]) + case 2: + if (8 * sizeof(int) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) { + return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + case 3: + if (8 * sizeof(int) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) { + return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + case 4: + if (8 * sizeof(int) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) { + return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (int) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if (sizeof(int) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (int) 0; + case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0])) + case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0]) + case -2: + if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { + return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 2: + if (8 * sizeof(int) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { + return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case -3: + if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { + return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 3: + if (8 * sizeof(int) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { + return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case -4: + if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { + return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 4: + if (8 * sizeof(int) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { + return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + } +#endif + if (sizeof(int) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + int val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (int) -1; + } + } else { + int val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (int) -1; + val = __Pyx_PyInt_As_int(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to int"); + return (int) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to int"); + return (int) -1; +} + +/* FastTypeChecks */ +#if CYTHON_COMPILING_IN_CPYTHON +static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) { + while (a) { + a = a->tp_base; + if (a == b) + return 1; + } + return b == &PyBaseObject_Type; +} +static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) { + PyObject *mro; + if (a == b) return 1; + mro = a->tp_mro; + if (likely(mro)) { + Py_ssize_t i, n; + n = PyTuple_GET_SIZE(mro); + for (i = 0; i < n; i++) { + if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b) + return 1; + } + return 0; + } + return __Pyx_InBases(a, b); +} +#if PY_MAJOR_VERSION == 2 +static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { + PyObject *exception, *value, *tb; + int res; + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ErrFetch(&exception, &value, &tb); + res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; + if (unlikely(res == -1)) { + PyErr_WriteUnraisable(err); + res = 0; + } + if (!res) { + res = PyObject_IsSubclass(err, exc_type2); + if (unlikely(res == -1)) { + PyErr_WriteUnraisable(err); + res = 0; + } + } + __Pyx_ErrRestore(exception, value, tb); + return res; +} +#else +static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { + int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0; + if (!res) { + res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); + } + return res; +} +#endif +static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { + Py_ssize_t i, n; + assert(PyExceptionClass_Check(exc_type)); + n = PyTuple_GET_SIZE(tuple); +#if PY_MAJOR_VERSION >= 3 + for (i=0; i= 0x02070000 + cobj = PyCapsule_New(p, sig, 0); +#else + cobj = PyCObject_FromVoidPtrAndDesc(p, (void *)sig, 0); +#endif + if (!cobj) + goto bad; + if (PyDict_SetItem(d, name, cobj) < 0) + goto bad; + Py_DECREF(cobj); + Py_DECREF(d); + return 0; +bad: + Py_XDECREF(cobj); + Py_XDECREF(d); + return -1; +} + +/* FunctionExport */ +static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig) { + PyObject *d = 0; + PyObject *cobj = 0; + union { + void (*fp)(void); + void *p; + } tmp; + d = PyObject_GetAttrString(__pyx_m, (char *)"__pyx_capi__"); + if (!d) { + PyErr_Clear(); + d = PyDict_New(); + if (!d) + goto bad; + Py_INCREF(d); + if (PyModule_AddObject(__pyx_m, (char *)"__pyx_capi__", d) < 0) + goto bad; + } + tmp.fp = f; +#if PY_VERSION_HEX >= 0x02070000 + cobj = PyCapsule_New(tmp.p, sig, 0); +#else + cobj = PyCObject_FromVoidPtrAndDesc(tmp.p, (void *)sig, 0); +#endif + if (!cobj) + goto bad; + if (PyDict_SetItemString(d, name, cobj) < 0) + goto bad; + Py_DECREF(cobj); + Py_DECREF(d); + return 0; +bad: + Py_XDECREF(cobj); + Py_XDECREF(d); + return -1; +} + +/* VoidPtrImport */ +#ifndef __PYX_HAVE_RT_ImportVoidPtr +#define __PYX_HAVE_RT_ImportVoidPtr +static int __Pyx_ImportVoidPtr(PyObject *module, const char *name, void **p, const char *sig) { + PyObject *d = 0; + PyObject *cobj = 0; + d = PyObject_GetAttrString(module, (char *)"__pyx_capi__"); + if (!d) + goto bad; + cobj = PyDict_GetItemString(d, name); + if (!cobj) { + PyErr_Format(PyExc_ImportError, + "%.200s does not export expected C variable %.200s", + PyModule_GetName(module), name); + goto bad; + } +#if PY_VERSION_HEX >= 0x02070000 + if (!PyCapsule_IsValid(cobj, sig)) { + PyErr_Format(PyExc_TypeError, + "C variable %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", + PyModule_GetName(module), name, sig, PyCapsule_GetName(cobj)); + goto bad; + } + *p = PyCapsule_GetPointer(cobj, sig); +#else + {const char *desc, *s1, *s2; + desc = (const char *)PyCObject_GetDesc(cobj); + if (!desc) + goto bad; + s1 = desc; s2 = sig; + while (*s1 != '\0' && *s1 == *s2) { s1++; s2++; } + if (*s1 != *s2) { + PyErr_Format(PyExc_TypeError, + "C variable %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", + PyModule_GetName(module), name, sig, desc); + goto bad; + } + *p = PyCObject_AsVoidPtr(cobj);} +#endif + if (!(*p)) + goto bad; + Py_DECREF(d); + return 0; +bad: + Py_XDECREF(d); + return -1; +} +#endif + +/* InitStrings */ +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { + while (t->p) { + #if PY_MAJOR_VERSION < 3 + if (t->is_unicode) { + *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); + } else if (t->intern) { + *t->p = PyString_InternFromString(t->s); + } else { + *t->p = PyString_FromStringAndSize(t->s, t->n - 1); + } + #else + if (t->is_unicode | t->is_str) { + if (t->intern) { + *t->p = PyUnicode_InternFromString(t->s); + } else if (t->encoding) { + *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); + } else { + *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); + } + } else { + *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); + } + #endif + if (!*t->p) + return -1; + if (PyObject_Hash(*t->p) == -1) + return -1; + ++t; + } + return 0; +} + +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { + return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); +} +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { + Py_ssize_t ignore; + return __Pyx_PyObject_AsStringAndSize(o, &ignore); +} +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +#if !CYTHON_PEP393_ENABLED +static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { + char* defenc_c; + PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); + if (!defenc) return NULL; + defenc_c = PyBytes_AS_STRING(defenc); +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + { + char* end = defenc_c + PyBytes_GET_SIZE(defenc); + char* c; + for (c = defenc_c; c < end; c++) { + if ((unsigned char) (*c) >= 128) { + PyUnicode_AsASCIIString(o); + return NULL; + } + } + } +#endif + *length = PyBytes_GET_SIZE(defenc); + return defenc_c; +} +#else +static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { + if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + if (likely(PyUnicode_IS_ASCII(o))) { + *length = PyUnicode_GET_LENGTH(o); + return PyUnicode_AsUTF8(o); + } else { + PyUnicode_AsASCIIString(o); + return NULL; + } +#else + return PyUnicode_AsUTF8AndSize(o, length); +#endif +} +#endif +#endif +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT + if ( +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + __Pyx_sys_getdefaultencoding_not_ascii && +#endif + PyUnicode_Check(o)) { + return __Pyx_PyUnicode_AsStringAndSize(o, length); + } else +#endif +#if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) + if (PyByteArray_Check(o)) { + *length = PyByteArray_GET_SIZE(o); + return PyByteArray_AS_STRING(o); + } else +#endif + { + char* result; + int r = PyBytes_AsStringAndSize(o, &result, length); + if (unlikely(r < 0)) { + return NULL; + } else { + return result; + } + } +} +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { + int is_true = x == Py_True; + if (is_true | (x == Py_False) | (x == Py_None)) return is_true; + else return PyObject_IsTrue(x); +} +static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) { + int retval; + if (unlikely(!x)) return -1; + retval = __Pyx_PyObject_IsTrue(x); + Py_DECREF(x); + return retval; +} +static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) { +#if PY_MAJOR_VERSION >= 3 + if (PyLong_Check(result)) { + if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, + "__int__ returned non-int (type %.200s). " + "The ability to return an instance of a strict subclass of int " + "is deprecated, and may be removed in a future version of Python.", + Py_TYPE(result)->tp_name)) { + Py_DECREF(result); + return NULL; + } + return result; + } +#endif + PyErr_Format(PyExc_TypeError, + "__%.4s__ returned non-%.4s (type %.200s)", + type_name, type_name, Py_TYPE(result)->tp_name); + Py_DECREF(result); + return NULL; +} +static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { +#if CYTHON_USE_TYPE_SLOTS + PyNumberMethods *m; +#endif + const char *name = NULL; + PyObject *res = NULL; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x) || PyLong_Check(x))) +#else + if (likely(PyLong_Check(x))) +#endif + return __Pyx_NewRef(x); +#if CYTHON_USE_TYPE_SLOTS + m = Py_TYPE(x)->tp_as_number; + #if PY_MAJOR_VERSION < 3 + if (m && m->nb_int) { + name = "int"; + res = m->nb_int(x); + } + else if (m && m->nb_long) { + name = "long"; + res = m->nb_long(x); + } + #else + if (likely(m && m->nb_int)) { + name = "int"; + res = m->nb_int(x); + } + #endif +#else + if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { + res = PyNumber_Int(x); + } +#endif + if (likely(res)) { +#if PY_MAJOR_VERSION < 3 + if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) { +#else + if (unlikely(!PyLong_CheckExact(res))) { +#endif + return __Pyx_PyNumber_IntOrLongWrongResultType(res, name); + } + } + else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_TypeError, + "an integer is required"); + } + return res; +} +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { + Py_ssize_t ival; + PyObject *x; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_CheckExact(b))) { + if (sizeof(Py_ssize_t) >= sizeof(long)) + return PyInt_AS_LONG(b); + else + return PyInt_AsSsize_t(b); + } +#endif + if (likely(PyLong_CheckExact(b))) { + #if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)b)->ob_digit; + const Py_ssize_t size = Py_SIZE(b); + if (likely(__Pyx_sst_abs(size) <= 1)) { + ival = likely(size) ? digits[0] : 0; + if (size == -1) ival = -ival; + return ival; + } else { + switch (size) { + case 2: + if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { + return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -2: + if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case 3: + if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { + return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -3: + if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case 4: + if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { + return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -4: + if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + } + } + #endif + return PyLong_AsSsize_t(b); + } + x = PyNumber_Index(b); + if (!x) return -1; + ival = PyInt_AsSsize_t(x); + Py_DECREF(x); + return ival; +} +static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) { + return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False); +} +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { + return PyInt_FromSize_t(ival); +} + + +#endif /* Py_PYTHON_H */ diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_hub_local.html b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_hub_local.html new file mode 100644 index 00000000..9f1315cb --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_hub_local.html @@ -0,0 +1,1141 @@ + + + + + + Cython: _hub_local.py + + + +

Generated by Cython 0.29.2

+

+ Yellow lines hint at Python interaction.
+ Click on a line that starts with a "+" to see the C code that Cython generated for it. +

+

Raw output: _hub_local.c

+
+001: # -*- coding: utf-8 -*-
+
  __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
 002: # copyright 2018 gevent. See LICENSE
+
 003: """
+
 004: Maintains the thread local hub.
+
 005: 
+
 006: """
+
 007: from __future__ import absolute_import
+
 008: from __future__ import division
+
 009: from __future__ import print_function
+
 010: 
+
 011: 
+
+012: from gevent._compat import thread_mod_name
+
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 12, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(__pyx_n_s_thread_mod_name);
+  __Pyx_GIVEREF(__pyx_n_s_thread_mod_name);
+  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_thread_mod_name);
+  __pyx_t_2 = __Pyx_Import(__pyx_n_s_gevent__compat, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 12, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_thread_mod_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 12, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_thread_mod_name, __pyx_t_1) < 0) __PYX_ERR(0, 12, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
 013: 
+
+014: __all__ = [
+
  __pyx_t_2 = PyList_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 14, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_get_hub);
+  __Pyx_GIVEREF(__pyx_n_s_get_hub);
+  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_get_hub);
+  __Pyx_INCREF(__pyx_n_s_get_hub_noargs);
+  __Pyx_GIVEREF(__pyx_n_s_get_hub_noargs);
+  PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_get_hub_noargs);
+  __Pyx_INCREF(__pyx_n_s_get_hub_if_exists);
+  __Pyx_GIVEREF(__pyx_n_s_get_hub_if_exists);
+  PyList_SET_ITEM(__pyx_t_2, 2, __pyx_n_s_get_hub_if_exists);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_all, __pyx_t_2) < 0) __PYX_ERR(0, 14, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
 015:     'get_hub',
+
 016:     'get_hub_noargs',
+
 017:     'get_hub_if_exists',
+
 018: ]
+
 019: 
+
 020: # These must be the "real" native thread versions,
+
 021: # not monkey-patched.
+
 022: # We are imported early enough (by gevent/__init__) that
+
 023: # we can rely on not being monkey-patched in any way yet.
+
+024: class _Threadlocal(__import__(thread_mod_name)._local):
+
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_thread_mod_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 24, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin___import__, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 24, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_local); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 24, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 24, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_2);
+  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
+  __pyx_t_2 = 0;
+  __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 24, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_Threadlocal, __pyx_n_s_Threadlocal, (PyObject *) NULL, __pyx_n_s_gevent___hub_local, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 24, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+/* … */
+  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_Threadlocal, __pyx_t_1, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 24, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_4);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Threadlocal, __pyx_t_4) < 0) __PYX_ERR(0, 24, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 025: 
+
+026:     def __init__(self):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_11__hub_local_12_Threadlocal_1__init__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
+static PyMethodDef __pyx_mdef_6gevent_11__hub_local_12_Threadlocal_1__init__ = {"__init__", (PyCFunction)__pyx_pw_6gevent_11__hub_local_12_Threadlocal_1__init__, METH_O, 0};
+static PyObject *__pyx_pw_6gevent_11__hub_local_12_Threadlocal_1__init__(PyObject *__pyx_self, PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_11__hub_local_12_Threadlocal___init__(__pyx_self, ((PyObject *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_11__hub_local_12_Threadlocal___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_AddTraceback("gevent.__hub_local._Threadlocal.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple_ = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 26, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple_);
+  __Pyx_GIVEREF(__pyx_tuple_);
+/* … */
+  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_11__hub_local_12_Threadlocal_1__init__, 0, __pyx_n_s_Threadlocal___init, NULL, __pyx_n_s_gevent___hub_local, __pyx_d, ((PyObject *)__pyx_codeobj__2)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 26, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_4);
+  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_init, __pyx_t_4) < 0) __PYX_ERR(0, 26, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __pyx_codeobj__2 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple_, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__hub_local_py, __pyx_n_s_init, 26, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2)) __PYX_ERR(0, 26, __pyx_L1_error)
+
 027:         # Use a class with an initializer so that we can test
+
 028:         # for 'is None' instead of catching AttributeError, making
+
 029:         # the code cleaner and possibly solving some corner cases
+
 030:         # (like #687)
+
+031:         super(_Threadlocal, self).__init__()
+
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Threadlocal); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 31, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 31, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_GIVEREF(__pyx_t_2);
+  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
+  __Pyx_INCREF(__pyx_v_self);
+  __Pyx_GIVEREF(__pyx_v_self);
+  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_self);
+  __pyx_t_2 = 0;
+  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 31, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_init); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 31, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_2 = NULL;
+  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
+    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
+    if (likely(__pyx_t_2)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+      __Pyx_INCREF(__pyx_t_2);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_3, function);
+    }
+  }
+  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 31, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+032:         self.Hub = None
+
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_Hub, Py_None) < 0) __PYX_ERR(0, 32, __pyx_L1_error)
+
+033:         self.loop = None
+
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_loop, Py_None) < 0) __PYX_ERR(0, 33, __pyx_L1_error)
+
+034:         self.hub = None
+
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_hub, Py_None) < 0) __PYX_ERR(0, 34, __pyx_L1_error)
+
 035: 
+
+036: _threadlocal = _Threadlocal()
+
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Threadlocal); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 36, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 36, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_XGOTREF(__pyx_v_6gevent_11__hub_local__threadlocal);
+  __Pyx_DECREF_SET(__pyx_v_6gevent_11__hub_local__threadlocal, __pyx_t_2);
+  __Pyx_GIVEREF(__pyx_t_2);
+  __pyx_t_2 = 0;
+
 037: 
+
+038: Hub = None # Set when gevent.hub is imported
+
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Hub, Py_None) < 0) __PYX_ERR(0, 38, __pyx_L1_error)
+
 039: 
+
+040: def get_hub_class():
+
static PyObject *__pyx_pw_6gevent_11__hub_local_1get_hub_class(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyObject *__pyx_f_6gevent_11__hub_local_get_hub_class(CYTHON_UNUSED int __pyx_skip_dispatch) {
+  PyObject *__pyx_v_hubtype = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("get_hub_class", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.__hub_local.get_hub_class", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_hubtype);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_11__hub_local_1get_hub_class(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6gevent_11__hub_local_get_hub_class[] = "Return the type of hub to use for the current thread.\n\n    If there's no type of hub for the current thread yet, 'gevent.hub.Hub' is used.\n    ";
+static PyMethodDef __pyx_mdef_6gevent_11__hub_local_1get_hub_class = {"get_hub_class", (PyCFunction)__pyx_pw_6gevent_11__hub_local_1get_hub_class, METH_NOARGS, __pyx_doc_6gevent_11__hub_local_get_hub_class};
+static PyObject *__pyx_pw_6gevent_11__hub_local_1get_hub_class(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("get_hub_class (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_11__hub_local_get_hub_class(__pyx_self);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_11__hub_local_get_hub_class(CYTHON_UNUSED PyObject *__pyx_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("get_hub_class", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __pyx_f_6gevent_11__hub_local_get_hub_class(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 40, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.__hub_local.get_hub_class", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_11__hub_local_1get_hub_class, 0, __pyx_n_s_get_hub_class, NULL, __pyx_n_s_gevent___hub_local, __pyx_d, ((PyObject *)__pyx_codeobj__3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 40, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_hub_class, __pyx_t_2) < 0) __PYX_ERR(0, 40, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+/* … */
+  __pyx_codeobj__3 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__hub_local_py, __pyx_n_s_get_hub_class, 40, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__3)) __PYX_ERR(0, 40, __pyx_L1_error)
+
 041:     """Return the type of hub to use for the current thread.
+
 042: 
+
 043:     If there's no type of hub for the current thread yet, 'gevent.hub.Hub' is used.
+
 044:     """
+
+045:     hubtype = _threadlocal.Hub
+
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_6gevent_11__hub_local__threadlocal, __pyx_n_s_Hub); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 45, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_v_hubtype = __pyx_t_1;
+  __pyx_t_1 = 0;
+
+046:     if hubtype is None:
+
  __pyx_t_2 = (__pyx_v_hubtype == Py_None);
+  __pyx_t_3 = (__pyx_t_2 != 0);
+  if (__pyx_t_3) {
+/* … */
+  }
+
+047:         hubtype = _threadlocal.Hub = Hub
+
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Hub); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 47, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_INCREF(__pyx_t_1);
+    __Pyx_DECREF_SET(__pyx_v_hubtype, __pyx_t_1);
+    if (__Pyx_PyObject_SetAttrStr(__pyx_v_6gevent_11__hub_local__threadlocal, __pyx_n_s_Hub, __pyx_t_1) < 0) __PYX_ERR(0, 47, __pyx_L1_error)
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+048:     return hubtype
+
  __Pyx_XDECREF(__pyx_r);
+  __Pyx_INCREF(__pyx_v_hubtype);
+  __pyx_r = __pyx_v_hubtype;
+  goto __pyx_L0;
+
 049: 
+
+050: def set_default_hub_class(hubtype):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_11__hub_local_3set_default_hub_class(PyObject *__pyx_self, PyObject *__pyx_v_hubtype); /*proto*/
+static PyMethodDef __pyx_mdef_6gevent_11__hub_local_3set_default_hub_class = {"set_default_hub_class", (PyCFunction)__pyx_pw_6gevent_11__hub_local_3set_default_hub_class, METH_O, 0};
+static PyObject *__pyx_pw_6gevent_11__hub_local_3set_default_hub_class(PyObject *__pyx_self, PyObject *__pyx_v_hubtype) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("set_default_hub_class (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_11__hub_local_2set_default_hub_class(__pyx_self, ((PyObject *)__pyx_v_hubtype));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_11__hub_local_2set_default_hub_class(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_hubtype) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("set_default_hub_class", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_AddTraceback("gevent.__hub_local.set_default_hub_class", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__4 = PyTuple_Pack(1, __pyx_n_s_hubtype); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 50, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__4);
+  __Pyx_GIVEREF(__pyx_tuple__4);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_11__hub_local_3set_default_hub_class, 0, __pyx_n_s_set_default_hub_class, NULL, __pyx_n_s_gevent___hub_local, __pyx_d, ((PyObject *)__pyx_codeobj__5)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 50, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_default_hub_class, __pyx_t_2) < 0) __PYX_ERR(0, 50, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_codeobj__5 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__4, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__hub_local_py, __pyx_n_s_set_default_hub_class, 50, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__5)) __PYX_ERR(0, 50, __pyx_L1_error)
+
 051:     global Hub
+
+052:     Hub = hubtype
+
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Hub, __pyx_v_hubtype) < 0) __PYX_ERR(0, 52, __pyx_L1_error)
+
 053: 
+
+054: def get_hub(*args, **kwargs):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_11__hub_local_5get_hub(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_6gevent_11__hub_local_4get_hub[] = "\n    Return the hub for the current thread.\n\n    If a hub does not exist in the current thread, a new one is\n    created of the type returned by :func:`get_hub_class`.\n\n    .. deprecated:: 1.3b1\n       The ``*args`` and ``**kwargs`` arguments are deprecated. They were\n       only used when the hub was created, and so were non-deterministic---to be\n       sure they were used, *all* callers had to pass them, or they were order-dependent.\n       Use ``set_hub`` instead.\n    ";
+static PyMethodDef __pyx_mdef_6gevent_11__hub_local_5get_hub = {"get_hub", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_11__hub_local_5get_hub, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_11__hub_local_4get_hub};
+static PyObject *__pyx_pw_6gevent_11__hub_local_5get_hub(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_args = 0;
+  PyObject *__pyx_v_kwargs = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("get_hub (wrapper)", 0);
+  if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "get_hub", 1))) return NULL;
+  if (unlikely(__pyx_kwds)) {
+    __pyx_v_kwargs = PyDict_Copy(__pyx_kwds); if (unlikely(!__pyx_v_kwargs)) return NULL;
+    __Pyx_GOTREF(__pyx_v_kwargs);
+  } else {
+    __pyx_v_kwargs = NULL;
+  }
+  __Pyx_INCREF(__pyx_args);
+  __pyx_v_args = __pyx_args;
+  __pyx_r = __pyx_pf_6gevent_11__hub_local_4get_hub(__pyx_self, __pyx_v_args, __pyx_v_kwargs);
+
+  /* function exit code */
+  __Pyx_XDECREF(__pyx_v_args);
+  __Pyx_XDECREF(__pyx_v_kwargs);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_11__hub_local_4get_hub(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) {
+  PyObject *__pyx_v_hub = NULL;
+  PyObject *__pyx_v_hubtype = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("get_hub", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.__hub_local.get_hub", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_hub);
+  __Pyx_XDECREF(__pyx_v_hubtype);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__6 = PyTuple_Pack(4, __pyx_n_s_args, __pyx_n_s_kwargs, __pyx_n_s_hub, __pyx_n_s_hubtype); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 54, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__6);
+  __Pyx_GIVEREF(__pyx_tuple__6);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_11__hub_local_5get_hub, 0, __pyx_n_s_get_hub, NULL, __pyx_n_s_gevent___hub_local, __pyx_d, ((PyObject *)__pyx_codeobj__7)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 54, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_hub, __pyx_t_2) < 0) __PYX_ERR(0, 54, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_codeobj__7 = (PyObject*)__Pyx_PyCode_New(0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__6, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__hub_local_py, __pyx_n_s_get_hub, 54, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__7)) __PYX_ERR(0, 54, __pyx_L1_error)
+
 055:     """
+
 056:     Return the hub for the current thread.
+
 057: 
+
 058:     If a hub does not exist in the current thread, a new one is
+
 059:     created of the type returned by :func:`get_hub_class`.
+
 060: 
+
 061:     .. deprecated:: 1.3b1
+
 062:        The ``*args`` and ``**kwargs`` arguments are deprecated. They were
+
 063:        only used when the hub was created, and so were non-deterministic---to be
+
 064:        sure they were used, *all* callers had to pass them, or they were order-dependent.
+
 065:        Use ``set_hub`` instead.
+
 066:     """
+
+067:     hub = _threadlocal.hub
+
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_6gevent_11__hub_local__threadlocal, __pyx_n_s_hub); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 67, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_v_hub = __pyx_t_1;
+  __pyx_t_1 = 0;
+
+068:     if hub is None:
+
  __pyx_t_2 = (__pyx_v_hub == Py_None);
+  __pyx_t_3 = (__pyx_t_2 != 0);
+  if (__pyx_t_3) {
+/* … */
+  }
+
+069:         hubtype = get_hub_class()
+
    __pyx_t_1 = __pyx_f_6gevent_11__hub_local_get_hub_class(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 69, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __pyx_v_hubtype = __pyx_t_1;
+    __pyx_t_1 = 0;
+
+070:         hub = _threadlocal.hub = hubtype(*args, **kwargs)
+
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_hubtype, __pyx_v_args, __pyx_v_kwargs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 70, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_INCREF(__pyx_t_1);
+    __Pyx_DECREF_SET(__pyx_v_hub, __pyx_t_1);
+    if (__Pyx_PyObject_SetAttrStr(__pyx_v_6gevent_11__hub_local__threadlocal, __pyx_n_s_hub, __pyx_t_1) < 0) __PYX_ERR(0, 70, __pyx_L1_error)
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+071:     return hub
+
  __Pyx_XDECREF(__pyx_r);
+  __Pyx_INCREF(__pyx_v_hub);
+  __pyx_r = __pyx_v_hub;
+  goto __pyx_L0;
+
 072: 
+
+073: def get_hub_noargs():
+
static PyObject *__pyx_pw_6gevent_11__hub_local_7get_hub_noargs(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *__pyx_f_6gevent_11__hub_local_get_hub_noargs(CYTHON_UNUSED int __pyx_skip_dispatch) {
+  PyObject *__pyx_v_hub = NULL;
+  PyObject *__pyx_v_hubtype = NULL;
+  struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("get_hub_noargs", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_AddTraceback("gevent.__hub_local.get_hub_noargs", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_hub);
+  __Pyx_XDECREF(__pyx_v_hubtype);
+  __Pyx_XGIVEREF((PyObject *)__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_11__hub_local_7get_hub_noargs(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyMethodDef __pyx_mdef_6gevent_11__hub_local_7get_hub_noargs = {"get_hub_noargs", (PyCFunction)__pyx_pw_6gevent_11__hub_local_7get_hub_noargs, METH_NOARGS, 0};
+static PyObject *__pyx_pw_6gevent_11__hub_local_7get_hub_noargs(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("get_hub_noargs (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_11__hub_local_6get_hub_noargs(__pyx_self);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_11__hub_local_6get_hub_noargs(CYTHON_UNUSED PyObject *__pyx_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("get_hub_noargs", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = ((PyObject *)__pyx_f_6gevent_11__hub_local_get_hub_noargs(0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 73, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.__hub_local.get_hub_noargs", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_11__hub_local_7get_hub_noargs, 0, __pyx_n_s_get_hub_noargs, NULL, __pyx_n_s_gevent___hub_local, __pyx_d, ((PyObject *)__pyx_codeobj__8)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 73, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_hub_noargs, __pyx_t_2) < 0) __PYX_ERR(0, 73, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+/* … */
+  __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__hub_local_py, __pyx_n_s_get_hub_noargs, 73, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) __PYX_ERR(0, 73, __pyx_L1_error)
+
 074:     # Just like get_hub, but cheaper to call because it
+
 075:     # takes no arguments or kwargs. See also a copy in
+
 076:     # gevent/greenlet.py
+
+077:     hub = _threadlocal.hub
+
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_6gevent_11__hub_local__threadlocal, __pyx_n_s_hub); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 77, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_v_hub = __pyx_t_1;
+  __pyx_t_1 = 0;
+
+078:     if hub is None:
+
  __pyx_t_2 = (__pyx_v_hub == Py_None);
+  __pyx_t_3 = (__pyx_t_2 != 0);
+  if (__pyx_t_3) {
+/* … */
+  }
+
+079:         hubtype = get_hub_class()
+
    __pyx_t_1 = __pyx_f_6gevent_11__hub_local_get_hub_class(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 79, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __pyx_v_hubtype = __pyx_t_1;
+    __pyx_t_1 = 0;
+
+080:         hub = _threadlocal.hub = hubtype()
+
    __Pyx_INCREF(__pyx_v_hubtype);
+    __pyx_t_4 = __pyx_v_hubtype; __pyx_t_5 = NULL;
+    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
+      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
+      if (likely(__pyx_t_5)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
+        __Pyx_INCREF(__pyx_t_5);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_4, function);
+      }
+    }
+    __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
+    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 80, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __Pyx_INCREF(__pyx_t_1);
+    __Pyx_DECREF_SET(__pyx_v_hub, __pyx_t_1);
+    if (__Pyx_PyObject_SetAttrStr(__pyx_v_6gevent_11__hub_local__threadlocal, __pyx_n_s_hub, __pyx_t_1) < 0) __PYX_ERR(0, 80, __pyx_L1_error)
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+081:     return hub
+
  __Pyx_XDECREF(((PyObject *)__pyx_r));
+  if (!(likely(((__pyx_v_hub) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_hub, __pyx_ptype_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop))))) __PYX_ERR(0, 81, __pyx_L1_error)
+  __Pyx_INCREF(__pyx_v_hub);
+  __pyx_r = ((struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *)__pyx_v_hub);
+  goto __pyx_L0;
+
 082: 
+
+083: def get_hub_if_exists():
+
static PyObject *__pyx_pw_6gevent_11__hub_local_9get_hub_if_exists(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *__pyx_f_6gevent_11__hub_local_get_hub_if_exists(CYTHON_UNUSED int __pyx_skip_dispatch) {
+  struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("get_hub_if_exists", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.__hub_local.get_hub_if_exists", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XGIVEREF((PyObject *)__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_11__hub_local_9get_hub_if_exists(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6gevent_11__hub_local_8get_hub_if_exists[] = "Return the hub for the current thread.\n\n    Return ``None`` if no hub has been created yet.\n    ";
+static PyMethodDef __pyx_mdef_6gevent_11__hub_local_9get_hub_if_exists = {"get_hub_if_exists", (PyCFunction)__pyx_pw_6gevent_11__hub_local_9get_hub_if_exists, METH_NOARGS, __pyx_doc_6gevent_11__hub_local_8get_hub_if_exists};
+static PyObject *__pyx_pw_6gevent_11__hub_local_9get_hub_if_exists(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("get_hub_if_exists (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_11__hub_local_8get_hub_if_exists(__pyx_self);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_11__hub_local_8get_hub_if_exists(CYTHON_UNUSED PyObject *__pyx_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("get_hub_if_exists", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = ((PyObject *)__pyx_f_6gevent_11__hub_local_get_hub_if_exists(0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 83, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.__hub_local.get_hub_if_exists", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_11__hub_local_9get_hub_if_exists, 0, __pyx_n_s_get_hub_if_exists, NULL, __pyx_n_s_gevent___hub_local, __pyx_d, ((PyObject *)__pyx_codeobj__9)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 83, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_hub_if_exists, __pyx_t_2) < 0) __PYX_ERR(0, 83, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+/* … */
+  __pyx_codeobj__9 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__hub_local_py, __pyx_n_s_get_hub_if_exists, 83, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__9)) __PYX_ERR(0, 83, __pyx_L1_error)
+
 084:     """Return the hub for the current thread.
+
 085: 
+
 086:     Return ``None`` if no hub has been created yet.
+
 087:     """
+
+088:     return _threadlocal.hub
+
  __Pyx_XDECREF(((PyObject *)__pyx_r));
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_6gevent_11__hub_local__threadlocal, __pyx_n_s_hub); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 88, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop))))) __PYX_ERR(0, 88, __pyx_L1_error)
+  __pyx_r = ((struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *)__pyx_t_1);
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
 089: 
+
 090: 
+
+091: def set_hub(hub):
+
static PyObject *__pyx_pw_6gevent_11__hub_local_11set_hub(PyObject *__pyx_self, PyObject *__pyx_v_hub); /*proto*/
+static PyObject *__pyx_f_6gevent_11__hub_local_set_hub(struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *__pyx_v_hub, CYTHON_UNUSED int __pyx_skip_dispatch) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("set_hub", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_AddTraceback("gevent.__hub_local.set_hub", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_11__hub_local_11set_hub(PyObject *__pyx_self, PyObject *__pyx_v_hub); /*proto*/
+static PyMethodDef __pyx_mdef_6gevent_11__hub_local_11set_hub = {"set_hub", (PyCFunction)__pyx_pw_6gevent_11__hub_local_11set_hub, METH_O, 0};
+static PyObject *__pyx_pw_6gevent_11__hub_local_11set_hub(PyObject *__pyx_self, PyObject *__pyx_v_hub) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("set_hub (wrapper)", 0);
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_hub), __pyx_ptype_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop, 1, "hub", 0))) __PYX_ERR(0, 91, __pyx_L1_error)
+  __pyx_r = __pyx_pf_6gevent_11__hub_local_10set_hub(__pyx_self, ((struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *)__pyx_v_hub));
+
+  /* function exit code */
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_11__hub_local_10set_hub(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *__pyx_v_hub) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("set_hub", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __pyx_f_6gevent_11__hub_local_set_hub(__pyx_v_hub, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 91, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.__hub_local.set_hub", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__10 = PyTuple_Pack(1, __pyx_n_s_hub); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 91, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__10);
+  __Pyx_GIVEREF(__pyx_tuple__10);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_11__hub_local_11set_hub, 0, __pyx_n_s_set_hub, NULL, __pyx_n_s_gevent___hub_local, __pyx_d, ((PyObject *)__pyx_codeobj__11)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 91, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_hub, __pyx_t_2) < 0) __PYX_ERR(0, 91, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_codeobj__11 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__10, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__hub_local_py, __pyx_n_s_set_hub, 91, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__11)) __PYX_ERR(0, 91, __pyx_L1_error)
+
+092:     _threadlocal.hub = hub
+
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_6gevent_11__hub_local__threadlocal, __pyx_n_s_hub, ((PyObject *)__pyx_v_hub)) < 0) __PYX_ERR(0, 92, __pyx_L1_error)
+
 093: 
+
+094: def get_loop():
+
static PyObject *__pyx_pw_6gevent_11__hub_local_13get_loop(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyObject *__pyx_f_6gevent_11__hub_local_get_loop(CYTHON_UNUSED int __pyx_skip_dispatch) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("get_loop", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.__hub_local.get_loop", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_11__hub_local_13get_loop(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyMethodDef __pyx_mdef_6gevent_11__hub_local_13get_loop = {"get_loop", (PyCFunction)__pyx_pw_6gevent_11__hub_local_13get_loop, METH_NOARGS, 0};
+static PyObject *__pyx_pw_6gevent_11__hub_local_13get_loop(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("get_loop (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_11__hub_local_12get_loop(__pyx_self);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_11__hub_local_12get_loop(CYTHON_UNUSED PyObject *__pyx_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("get_loop", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __pyx_f_6gevent_11__hub_local_get_loop(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 94, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.__hub_local.get_loop", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_11__hub_local_13get_loop, 0, __pyx_n_s_get_loop, NULL, __pyx_n_s_gevent___hub_local, __pyx_d, ((PyObject *)__pyx_codeobj__12)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 94, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_loop, __pyx_t_2) < 0) __PYX_ERR(0, 94, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+/* … */
+  __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__hub_local_py, __pyx_n_s_get_loop, 94, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(0, 94, __pyx_L1_error)
+
+095:     return _threadlocal.loop
+
  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_6gevent_11__hub_local__threadlocal, __pyx_n_s_loop); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 95, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
 096: 
+
+097: def set_loop(loop):
+
static PyObject *__pyx_pw_6gevent_11__hub_local_15set_loop(PyObject *__pyx_self, PyObject *__pyx_v_loop); /*proto*/
+static PyObject *__pyx_f_6gevent_11__hub_local_set_loop(PyObject *__pyx_v_loop, CYTHON_UNUSED int __pyx_skip_dispatch) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("set_loop", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_AddTraceback("gevent.__hub_local.set_loop", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_11__hub_local_15set_loop(PyObject *__pyx_self, PyObject *__pyx_v_loop); /*proto*/
+static PyMethodDef __pyx_mdef_6gevent_11__hub_local_15set_loop = {"set_loop", (PyCFunction)__pyx_pw_6gevent_11__hub_local_15set_loop, METH_O, 0};
+static PyObject *__pyx_pw_6gevent_11__hub_local_15set_loop(PyObject *__pyx_self, PyObject *__pyx_v_loop) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("set_loop (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_11__hub_local_14set_loop(__pyx_self, ((PyObject *)__pyx_v_loop));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_11__hub_local_14set_loop(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_loop) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("set_loop", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __pyx_f_6gevent_11__hub_local_set_loop(__pyx_v_loop, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 97, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.__hub_local.set_loop", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__13 = PyTuple_Pack(1, __pyx_n_s_loop); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 97, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__13);
+  __Pyx_GIVEREF(__pyx_tuple__13);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_11__hub_local_15set_loop, 0, __pyx_n_s_set_loop, NULL, __pyx_n_s_gevent___hub_local, __pyx_d, ((PyObject *)__pyx_codeobj__14)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 97, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_loop, __pyx_t_2) < 0) __PYX_ERR(0, 97, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+098:     _threadlocal.loop = loop
+
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_6gevent_11__hub_local__threadlocal, __pyx_n_s_loop, __pyx_v_loop) < 0) __PYX_ERR(0, 98, __pyx_L1_error)
+
 099: 
+
+100: from gevent._util import import_c_accel
+
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 100, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_import_c_accel);
+  __Pyx_GIVEREF(__pyx_n_s_import_c_accel);
+  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_import_c_accel);
+  __pyx_t_1 = __Pyx_Import(__pyx_n_s_gevent__util, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 100, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_import_c_accel); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 100, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_import_c_accel, __pyx_t_2) < 0) __PYX_ERR(0, 100, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+101: import_c_accel(globals(), 'gevent.__hub_local')
+
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_import_c_accel); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 101, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = __Pyx_Globals(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 101, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 101, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_GIVEREF(__pyx_t_2);
+  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_gevent___hub_local);
+  __Pyx_GIVEREF(__pyx_n_s_gevent___hub_local);
+  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_n_s_gevent___hub_local);
+  __pyx_t_2 = 0;
+  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 101, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_hub_local.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_hub_local.py new file mode 100644 index 00000000..622062a7 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_hub_local.py @@ -0,0 +1,101 @@ +# -*- coding: utf-8 -*- +# copyright 2018 gevent. See LICENSE +""" +Maintains the thread local hub. + +""" +from __future__ import absolute_import +from __future__ import division +from __future__ import print_function + + +from gevent._compat import thread_mod_name + +__all__ = [ + 'get_hub', + 'get_hub_noargs', + 'get_hub_if_exists', +] + +# These must be the "real" native thread versions, +# not monkey-patched. +# We are imported early enough (by gevent/__init__) that +# we can rely on not being monkey-patched in any way yet. +class _Threadlocal(__import__(thread_mod_name)._local): + + def __init__(self): + # Use a class with an initializer so that we can test + # for 'is None' instead of catching AttributeError, making + # the code cleaner and possibly solving some corner cases + # (like #687) + super(_Threadlocal, self).__init__() + self.Hub = None + self.loop = None + self.hub = None + +_threadlocal = _Threadlocal() + +Hub = None # Set when gevent.hub is imported + +def get_hub_class(): + """Return the type of hub to use for the current thread. + + If there's no type of hub for the current thread yet, 'gevent.hub.Hub' is used. + """ + hubtype = _threadlocal.Hub + if hubtype is None: + hubtype = _threadlocal.Hub = Hub + return hubtype + +def set_default_hub_class(hubtype): + global Hub + Hub = hubtype + +def get_hub(*args, **kwargs): + """ + Return the hub for the current thread. + + If a hub does not exist in the current thread, a new one is + created of the type returned by :func:`get_hub_class`. + + .. deprecated:: 1.3b1 + The ``*args`` and ``**kwargs`` arguments are deprecated. They were + only used when the hub was created, and so were non-deterministic---to be + sure they were used, *all* callers had to pass them, or they were order-dependent. + Use ``set_hub`` instead. + """ + hub = _threadlocal.hub + if hub is None: + hubtype = get_hub_class() + hub = _threadlocal.hub = hubtype(*args, **kwargs) + return hub + +def get_hub_noargs(): + # Just like get_hub, but cheaper to call because it + # takes no arguments or kwargs. See also a copy in + # gevent/greenlet.py + hub = _threadlocal.hub + if hub is None: + hubtype = get_hub_class() + hub = _threadlocal.hub = hubtype() + return hub + +def get_hub_if_exists(): + """Return the hub for the current thread. + + Return ``None`` if no hub has been created yet. + """ + return _threadlocal.hub + + +def set_hub(hub): + _threadlocal.hub = hub + +def get_loop(): + return _threadlocal.loop + +def set_loop(loop): + _threadlocal.loop = loop + +from gevent._util import import_c_accel +import_c_accel(globals(), 'gevent.__hub_local') diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_hub_primitives.c b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_hub_primitives.c new file mode 100644 index 00000000..39c536e1 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_hub_primitives.c @@ -0,0 +1,12492 @@ +/* Generated by Cython 0.29.2 */ + +/* BEGIN: Cython Metadata +{ + "distutils": { + "depends": [ + "src/gevent/__hub_primitives.pxd", + "src\\gevent\\__hub_primitives.pxd" + ], + "include_dirs": [ + "C:\\Python37-x64\\Include", + "deps" + ], + "name": "gevent.__hub_primitives", + "sources": [ + "src/gevent/_hub_primitives.py" + ] + }, + "module_name": "gevent.__hub_primitives" +} +END: Cython Metadata */ + +#define PY_SSIZE_T_CLEAN +#include "Python.h" +#ifndef Py_PYTHON_H + #error Python headers needed to compile C extensions, please install development version of Python. +#elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) + #error Cython requires Python 2.6+ or Python 3.3+. +#else +#define CYTHON_ABI "0_29_2" +#define CYTHON_HEX_VERSION 0x001D02F0 +#define CYTHON_FUTURE_DIVISION 1 +#include +#ifndef offsetof + #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) +#endif +#if !defined(WIN32) && !defined(MS_WINDOWS) + #ifndef __stdcall + #define __stdcall + #endif + #ifndef __cdecl + #define __cdecl + #endif + #ifndef __fastcall + #define __fastcall + #endif +#endif +#ifndef DL_IMPORT + #define DL_IMPORT(t) t +#endif +#ifndef DL_EXPORT + #define DL_EXPORT(t) t +#endif +#define __PYX_COMMA , +#ifndef HAVE_LONG_LONG + #if PY_VERSION_HEX >= 0x02070000 + #define HAVE_LONG_LONG + #endif +#endif +#ifndef PY_LONG_LONG + #define PY_LONG_LONG LONG_LONG +#endif +#ifndef Py_HUGE_VAL + #define Py_HUGE_VAL HUGE_VAL +#endif +#ifdef PYPY_VERSION + #define CYTHON_COMPILING_IN_PYPY 1 + #define CYTHON_COMPILING_IN_PYSTON 0 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #undef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 0 + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #if PY_VERSION_HEX < 0x03050000 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #elif !defined(CYTHON_USE_ASYNC_SLOTS) + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #undef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 0 + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #undef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 1 + #undef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 0 + #undef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 0 + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #undef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE 0 + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 +#elif defined(PYSTON_VERSION) + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_PYSTON 1 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #ifndef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 1 + #endif + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #ifndef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 1 + #endif + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #ifndef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 0 + #endif + #ifndef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 1 + #endif + #ifndef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 1 + #endif + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #undef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE 0 + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 +#else + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_PYSTON 0 + #define CYTHON_COMPILING_IN_CPYTHON 1 + #ifndef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 1 + #endif + #if PY_VERSION_HEX < 0x02070000 + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #elif !defined(CYTHON_USE_PYTYPE_LOOKUP) + #define CYTHON_USE_PYTYPE_LOOKUP 1 + #endif + #if PY_MAJOR_VERSION < 3 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #elif !defined(CYTHON_USE_ASYNC_SLOTS) + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #if PY_VERSION_HEX < 0x02070000 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #elif !defined(CYTHON_USE_PYLONG_INTERNALS) + #define CYTHON_USE_PYLONG_INTERNALS 1 + #endif + #ifndef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 1 + #endif + #ifndef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 1 + #endif + #if PY_VERSION_HEX < 0x030300F0 + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #elif !defined(CYTHON_USE_UNICODE_WRITER) + #define CYTHON_USE_UNICODE_WRITER 1 + #endif + #ifndef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 0 + #endif + #ifndef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 1 + #endif + #ifndef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 1 + #endif + #ifndef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 1 + #endif + #ifndef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 1 + #endif + #ifndef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000) + #endif + #ifndef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1) + #endif + #ifndef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1) + #endif + #ifndef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3) + #endif +#endif +#if !defined(CYTHON_FAST_PYCCALL) +#define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) +#endif +#if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #undef SHIFT + #undef BASE + #undef MASK + #ifdef SIZEOF_VOID_P + enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) }; + #endif +#endif +#ifndef __has_attribute + #define __has_attribute(x) 0 +#endif +#ifndef __has_cpp_attribute + #define __has_cpp_attribute(x) 0 +#endif +#ifndef CYTHON_RESTRICT + #if defined(__GNUC__) + #define CYTHON_RESTRICT __restrict__ + #elif defined(_MSC_VER) && _MSC_VER >= 1400 + #define CYTHON_RESTRICT __restrict + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_RESTRICT restrict + #else + #define CYTHON_RESTRICT + #endif +#endif +#ifndef CYTHON_UNUSED +# if defined(__GNUC__) +# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +#endif +#ifndef CYTHON_MAYBE_UNUSED_VAR +# if defined(__cplusplus) + template void CYTHON_MAYBE_UNUSED_VAR( const T& ) { } +# else +# define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x) +# endif +#endif +#ifndef CYTHON_NCP_UNUSED +# if CYTHON_COMPILING_IN_CPYTHON +# define CYTHON_NCP_UNUSED +# else +# define CYTHON_NCP_UNUSED CYTHON_UNUSED +# endif +#endif +#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) +#ifdef _MSC_VER + #ifndef _MSC_STDINT_H_ + #if _MSC_VER < 1300 + typedef unsigned char uint8_t; + typedef unsigned int uint32_t; + #else + typedef unsigned __int8 uint8_t; + typedef unsigned __int32 uint32_t; + #endif + #endif +#else + #include +#endif +#ifndef CYTHON_FALLTHROUGH + #if defined(__cplusplus) && __cplusplus >= 201103L + #if __has_cpp_attribute(fallthrough) + #define CYTHON_FALLTHROUGH [[fallthrough]] + #elif __has_cpp_attribute(clang::fallthrough) + #define CYTHON_FALLTHROUGH [[clang::fallthrough]] + #elif __has_cpp_attribute(gnu::fallthrough) + #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] + #endif + #endif + #ifndef CYTHON_FALLTHROUGH + #if __has_attribute(fallthrough) + #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) + #else + #define CYTHON_FALLTHROUGH + #endif + #endif + #if defined(__clang__ ) && defined(__apple_build_version__) + #if __apple_build_version__ < 7000000 + #undef CYTHON_FALLTHROUGH + #define CYTHON_FALLTHROUGH + #endif + #endif +#endif + +#ifndef CYTHON_INLINE + #if defined(__clang__) + #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) + #elif defined(__GNUC__) + #define CYTHON_INLINE __inline__ + #elif defined(_MSC_VER) + #define CYTHON_INLINE __inline + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_INLINE inline + #else + #define CYTHON_INLINE + #endif +#endif + +#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) + #define Py_OptimizeFlag 0 +#endif +#define __PYX_BUILD_PY_SSIZE_T "n" +#define CYTHON_FORMAT_SSIZE_T "z" +#if PY_MAJOR_VERSION < 3 + #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyClass_Type +#else + #define __Pyx_BUILTIN_MODULE_NAME "builtins" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyType_Type +#endif +#ifndef Py_TPFLAGS_CHECKTYPES + #define Py_TPFLAGS_CHECKTYPES 0 +#endif +#ifndef Py_TPFLAGS_HAVE_INDEX + #define Py_TPFLAGS_HAVE_INDEX 0 +#endif +#ifndef Py_TPFLAGS_HAVE_NEWBUFFER + #define Py_TPFLAGS_HAVE_NEWBUFFER 0 +#endif +#ifndef Py_TPFLAGS_HAVE_FINALIZE + #define Py_TPFLAGS_HAVE_FINALIZE 0 +#endif +#ifndef METH_STACKLESS + #define METH_STACKLESS 0 +#endif +#if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) + #ifndef METH_FASTCALL + #define METH_FASTCALL 0x80 + #endif + typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs); + typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args, + Py_ssize_t nargs, PyObject *kwnames); +#else + #define __Pyx_PyCFunctionFast _PyCFunctionFast + #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords +#endif +#if CYTHON_FAST_PYCCALL +#define __Pyx_PyFastCFunction_Check(func)\ + ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS))))) +#else +#define __Pyx_PyFastCFunction_Check(func) 0 +#endif +#if CYTHON_USE_DICT_VERSIONS +#define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) +#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ + (version_var) = __PYX_GET_DICT_VERSION(dict);\ + (cache_var) = (value); +#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ + static PY_UINT64_T __pyx_dict_version = 0;\ + static PyObject *__pyx_dict_cached_value = NULL;\ + if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ + (VAR) = __pyx_dict_cached_value;\ + } else {\ + (VAR) = __pyx_dict_cached_value = (LOOKUP);\ + __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ + }\ + } +#else +#define __PYX_GET_DICT_VERSION(dict) (0) +#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) +#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) + #define PyObject_Malloc(s) PyMem_Malloc(s) + #define PyObject_Free(p) PyMem_Free(p) + #define PyObject_Realloc(p) PyMem_Realloc(p) +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1 + #define PyMem_RawMalloc(n) PyMem_Malloc(n) + #define PyMem_RawRealloc(p, n) PyMem_Realloc(p, n) + #define PyMem_RawFree(p) PyMem_Free(p) +#endif +#if CYTHON_COMPILING_IN_PYSTON + #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co) + #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno) +#else + #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) + #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) +#endif +#if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000 + #define __Pyx_PyThreadState_Current PyThreadState_GET() +#elif PY_VERSION_HEX >= 0x03060000 + #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() +#elif PY_VERSION_HEX >= 0x03000000 + #define __Pyx_PyThreadState_Current PyThreadState_GET() +#else + #define __Pyx_PyThreadState_Current _PyThreadState_Current +#endif +#if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) +#include "pythread.h" +#define Py_tss_NEEDS_INIT 0 +typedef int Py_tss_t; +static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) { + *key = PyThread_create_key(); + return 0; // PyThread_create_key reports success always +} +static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) { + Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t)); + *key = Py_tss_NEEDS_INIT; + return key; +} +static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) { + PyObject_Free(key); +} +static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) { + return *key != Py_tss_NEEDS_INIT; +} +static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) { + PyThread_delete_key(*key); + *key = Py_tss_NEEDS_INIT; +} +static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) { + return PyThread_set_key_value(*key, value); +} +static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { + return PyThread_get_key_value(*key); +} +#endif // TSS (Thread Specific Storage) API +#if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized) +#define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) +#else +#define __Pyx_PyDict_NewPresized(n) PyDict_New() +#endif +#if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION + #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) +#else + #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS +#define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) +#else +#define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name) +#endif +#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) + #define CYTHON_PEP393_ENABLED 1 + #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ + 0 : _PyUnicode_Ready((PyObject *)(op))) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) + #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) + #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) + #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) + #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) + #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch) + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) +#else + #define CYTHON_PEP393_ENABLED 0 + #define PyUnicode_1BYTE_KIND 1 + #define PyUnicode_2BYTE_KIND 2 + #define PyUnicode_4BYTE_KIND 4 + #define __Pyx_PyUnicode_READY(op) (0) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) + #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111) + #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) + #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) + #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) + #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch) + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) +#endif +#if CYTHON_COMPILING_IN_PYPY + #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) +#else + #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ + PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains) + #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check) + #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format) + #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) +#endif +#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) +#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) +#else + #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) +#endif +#if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) + #define PyObject_ASCII(o) PyObject_Repr(o) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBaseString_Type PyUnicode_Type + #define PyStringObject PyUnicodeObject + #define PyString_Type PyUnicode_Type + #define PyString_Check PyUnicode_Check + #define PyString_CheckExact PyUnicode_CheckExact + #define PyObject_Unicode PyObject_Str +#endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) + #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) +#else + #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) + #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) +#endif +#ifndef PySet_CheckExact + #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) +#endif +#if CYTHON_ASSUME_SAFE_MACROS + #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) +#else + #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyIntObject PyLongObject + #define PyInt_Type PyLong_Type + #define PyInt_Check(op) PyLong_Check(op) + #define PyInt_CheckExact(op) PyLong_CheckExact(op) + #define PyInt_FromString PyLong_FromString + #define PyInt_FromUnicode PyLong_FromUnicode + #define PyInt_FromLong PyLong_FromLong + #define PyInt_FromSize_t PyLong_FromSize_t + #define PyInt_FromSsize_t PyLong_FromSsize_t + #define PyInt_AsLong PyLong_AsLong + #define PyInt_AS_LONG PyLong_AS_LONG + #define PyInt_AsSsize_t PyLong_AsSsize_t + #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask + #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask + #define PyNumber_Int PyNumber_Long +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBoolObject PyLongObject +#endif +#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY + #ifndef PyUnicode_InternFromString + #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) + #endif +#endif +#if PY_VERSION_HEX < 0x030200A4 + typedef long Py_hash_t; + #define __Pyx_PyInt_FromHash_t PyInt_FromLong + #define __Pyx_PyInt_AsHash_t PyInt_AsLong +#else + #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t + #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t +#endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : (Py_INCREF(func), func)) +#else + #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) +#endif +#if CYTHON_USE_ASYNC_SLOTS + #if PY_VERSION_HEX >= 0x030500B1 + #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods + #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) + #else + #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) + #endif +#else + #define __Pyx_PyType_AsAsync(obj) NULL +#endif +#ifndef __Pyx_PyAsyncMethodsStruct + typedef struct { + unaryfunc am_await; + unaryfunc am_aiter; + unaryfunc am_anext; + } __Pyx_PyAsyncMethodsStruct; +#endif + +#if defined(WIN32) || defined(MS_WINDOWS) + #define _USE_MATH_DEFINES +#endif +#include +#ifdef NAN +#define __PYX_NAN() ((float) NAN) +#else +static CYTHON_INLINE float __PYX_NAN() { + float value; + memset(&value, 0xFF, sizeof(value)); + return value; +} +#endif +#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) +#define __Pyx_truncl trunc +#else +#define __Pyx_truncl truncl +#endif + + +#define __PYX_ERR(f_index, lineno, Ln_error) \ +{ \ + __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \ +} + +#ifndef __PYX_EXTERN_C + #ifdef __cplusplus + #define __PYX_EXTERN_C extern "C" + #else + #define __PYX_EXTERN_C extern + #endif +#endif + +#define __PYX_HAVE__gevent____hub_primitives +#define __PYX_HAVE_API__gevent____hub_primitives +/* Early includes */ +#include "greenlet/greenlet.h" +#ifdef _OPENMP +#include +#endif /* _OPENMP */ + +#if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) +#define CYTHON_WITHOUT_ASSERTIONS +#endif + +typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; + const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; + +#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 +#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0 +#define __PYX_DEFAULT_STRING_ENCODING "" +#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString +#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#define __Pyx_uchar_cast(c) ((unsigned char)c) +#define __Pyx_long_cast(x) ((long)x) +#define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ + (sizeof(type) < sizeof(Py_ssize_t)) ||\ + (sizeof(type) > sizeof(Py_ssize_t) &&\ + likely(v < (type)PY_SSIZE_T_MAX ||\ + v == (type)PY_SSIZE_T_MAX) &&\ + (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ + v == (type)PY_SSIZE_T_MIN))) ||\ + (sizeof(type) == sizeof(Py_ssize_t) &&\ + (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ + v == (type)PY_SSIZE_T_MAX))) ) +static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) { + return (size_t) i < (size_t) limit; +} +#if defined (__cplusplus) && __cplusplus >= 201103L + #include + #define __Pyx_sst_abs(value) std::abs(value) +#elif SIZEOF_INT >= SIZEOF_SIZE_T + #define __Pyx_sst_abs(value) abs(value) +#elif SIZEOF_LONG >= SIZEOF_SIZE_T + #define __Pyx_sst_abs(value) labs(value) +#elif defined (_MSC_VER) + #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) +#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define __Pyx_sst_abs(value) llabs(value) +#elif defined (__GNUC__) + #define __Pyx_sst_abs(value) __builtin_llabs(value) +#else + #define __Pyx_sst_abs(value) ((value<0) ? -value : value) +#endif +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*); +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); +#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) +#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) +#define __Pyx_PyBytes_FromString PyBytes_FromString +#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); +#if PY_MAJOR_VERSION < 3 + #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#else + #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize +#endif +#define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) +#define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) +#define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) +#define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) +#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) +static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) { + const Py_UNICODE *u_end = u; + while (*u_end++) ; + return (size_t)(u_end - u - 1); +} +#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) +#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode +#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode +#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) +#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) +static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); +static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*); +static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); +#define __Pyx_PySequence_Tuple(obj)\ + (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); +#if CYTHON_ASSUME_SAFE_MACROS +#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) +#else +#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) +#endif +#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) +#if PY_MAJOR_VERSION >= 3 +#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) +#else +#define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) +#endif +#define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x)) +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII +static int __Pyx_sys_getdefaultencoding_not_ascii; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + PyObject* ascii_chars_u = NULL; + PyObject* ascii_chars_b = NULL; + const char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + if (strcmp(default_encoding_c, "ascii") == 0) { + __Pyx_sys_getdefaultencoding_not_ascii = 0; + } else { + char ascii_chars[128]; + int c; + for (c = 0; c < 128; c++) { + ascii_chars[c] = c; + } + __Pyx_sys_getdefaultencoding_not_ascii = 1; + ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); + if (!ascii_chars_u) goto bad; + ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); + if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { + PyErr_Format( + PyExc_ValueError, + "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", + default_encoding_c); + goto bad; + } + Py_DECREF(ascii_chars_u); + Py_DECREF(ascii_chars_b); + } + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + Py_XDECREF(ascii_chars_u); + Py_XDECREF(ascii_chars_b); + return -1; +} +#endif +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) +#else +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +static char* __PYX_DEFAULT_STRING_ENCODING; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1); + if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; + strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + return -1; +} +#endif +#endif + + +/* Test for GCC > 2.95 */ +#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) + #define likely(x) __builtin_expect(!!(x), 1) + #define unlikely(x) __builtin_expect(!!(x), 0) +#else /* !__GNUC__ or GCC < 2.95 */ + #define likely(x) (x) + #define unlikely(x) (x) +#endif /* __GNUC__ */ +static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } + +static PyObject *__pyx_m = NULL; +static PyObject *__pyx_d; +static PyObject *__pyx_b; +static PyObject *__pyx_cython_runtime = NULL; +static PyObject *__pyx_empty_tuple; +static PyObject *__pyx_empty_bytes; +static PyObject *__pyx_empty_unicode; +static int __pyx_lineno; +static int __pyx_clineno = 0; +static const char * __pyx_cfilenm= __FILE__; +static const char *__pyx_filename; + + +static const char *__pyx_f[] = { + "src\\gevent\\_hub_primitives.py", + "src\\gevent\\__greenlet_primitives.pxd", + "src\\gevent\\__waiter.pxd", + "src\\gevent\\__hub_primitives.pxd", +}; + +/*--- Type declarations ---*/ +struct __pyx_obj_6gevent_21__greenlet_primitives_TrackedRawGreenlet; +struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop; +struct __pyx_obj_6gevent_8__waiter_Waiter; +struct __pyx_obj_6gevent_8__waiter_MultipleWaiter; +struct __pyx_obj_6gevent_16__hub_primitives_WaitOperationsGreenlet; +struct __pyx_obj_6gevent_16__hub_primitives__WaitIterator; +struct __pyx_opt_args_6gevent_16__hub_primitives_22WaitOperationsGreenlet_cancel_wait; +struct __pyx_opt_args_6gevent_16__hub_primitives_iwait_on_objects; +struct __pyx_opt_args_6gevent_16__hub_primitives_wait_on_objects; +struct __pyx_opt_args_6gevent_16__hub_primitives_wait_on_watcher; +struct __pyx_opt_args_6gevent_16__hub_primitives_wait_read; +struct __pyx_opt_args_6gevent_16__hub_primitives_wait_write; +struct __pyx_opt_args_6gevent_16__hub_primitives_wait_readwrite; +struct __pyx_opt_args_6gevent_16__hub_primitives_wait_on_socket; + +/* "gevent/__hub_primitives.pxd":44 + * + * cpdef wait(self, watcher) + * cpdef cancel_wait(self, watcher, error, close_watcher=*) # <<<<<<<<<<<<<< + * cpdef _cancel_wait(self, watcher, error, close_watcher) + * + */ +struct __pyx_opt_args_6gevent_16__hub_primitives_22WaitOperationsGreenlet_cancel_wait { + int __pyx_n; + PyObject *close_watcher; +}; + +/* "gevent/__hub_primitives.pxd":65 + * + * + * cpdef iwait_on_objects(objects, timeout=*, count=*) # <<<<<<<<<<<<<< + * cpdef wait_on_objects(objects=*, timeout=*, count=*) + * + */ +struct __pyx_opt_args_6gevent_16__hub_primitives_iwait_on_objects { + int __pyx_n; + PyObject *timeout; + PyObject *count; +}; + +/* "gevent/__hub_primitives.pxd":66 + * + * cpdef iwait_on_objects(objects, timeout=*, count=*) + * cpdef wait_on_objects(objects=*, timeout=*, count=*) # <<<<<<<<<<<<<< + * + * cdef _primitive_wait(watcher, timeout, timeout_exc, WaitOperationsGreenlet hub) + */ +struct __pyx_opt_args_6gevent_16__hub_primitives_wait_on_objects { + int __pyx_n; + PyObject *objects; + PyObject *timeout; + PyObject *count; +}; + +/* "gevent/__hub_primitives.pxd":69 + * + * cdef _primitive_wait(watcher, timeout, timeout_exc, WaitOperationsGreenlet hub) + * cpdef wait_on_watcher(watcher, timeout=*, timeout_exc=*, WaitOperationsGreenlet hub=*) # <<<<<<<<<<<<<< + * cpdef wait_read(fileno, timeout=*, timeout_exc=*) + * cpdef wait_write(fileno, timeout=*, timeout_exc=*, event=*) + */ +struct __pyx_opt_args_6gevent_16__hub_primitives_wait_on_watcher { + int __pyx_n; + PyObject *timeout; + PyObject *timeout_exc; + struct __pyx_obj_6gevent_16__hub_primitives_WaitOperationsGreenlet *hub; +}; + +/* "gevent/__hub_primitives.pxd":70 + * cdef _primitive_wait(watcher, timeout, timeout_exc, WaitOperationsGreenlet hub) + * cpdef wait_on_watcher(watcher, timeout=*, timeout_exc=*, WaitOperationsGreenlet hub=*) + * cpdef wait_read(fileno, timeout=*, timeout_exc=*) # <<<<<<<<<<<<<< + * cpdef wait_write(fileno, timeout=*, timeout_exc=*, event=*) + * cpdef wait_readwrite(fileno, timeout=*, timeout_exc=*, event=*) + */ +struct __pyx_opt_args_6gevent_16__hub_primitives_wait_read { + int __pyx_n; + PyObject *timeout; + PyObject *timeout_exc; +}; + +/* "gevent/__hub_primitives.pxd":71 + * cpdef wait_on_watcher(watcher, timeout=*, timeout_exc=*, WaitOperationsGreenlet hub=*) + * cpdef wait_read(fileno, timeout=*, timeout_exc=*) + * cpdef wait_write(fileno, timeout=*, timeout_exc=*, event=*) # <<<<<<<<<<<<<< + * cpdef wait_readwrite(fileno, timeout=*, timeout_exc=*, event=*) + * cpdef wait_on_socket(socket, watcher, timeout_exc=*) + */ +struct __pyx_opt_args_6gevent_16__hub_primitives_wait_write { + int __pyx_n; + PyObject *timeout; + PyObject *timeout_exc; + PyObject *event; +}; + +/* "gevent/__hub_primitives.pxd":72 + * cpdef wait_read(fileno, timeout=*, timeout_exc=*) + * cpdef wait_write(fileno, timeout=*, timeout_exc=*, event=*) + * cpdef wait_readwrite(fileno, timeout=*, timeout_exc=*, event=*) # <<<<<<<<<<<<<< + * cpdef wait_on_socket(socket, watcher, timeout_exc=*) + */ +struct __pyx_opt_args_6gevent_16__hub_primitives_wait_readwrite { + int __pyx_n; + PyObject *timeout; + PyObject *timeout_exc; + PyObject *event; +}; + +/* "gevent/__hub_primitives.pxd":73 + * cpdef wait_write(fileno, timeout=*, timeout_exc=*, event=*) + * cpdef wait_readwrite(fileno, timeout=*, timeout_exc=*, event=*) + * cpdef wait_on_socket(socket, watcher, timeout_exc=*) # <<<<<<<<<<<<<< + */ +struct __pyx_opt_args_6gevent_16__hub_primitives_wait_on_socket { + int __pyx_n; + PyObject *timeout_exc; +}; + +/* "gevent/__greenlet_primitives.pxd":37 + * return PyGreenlet_Switch(self, NULL, NULL) + * + * cdef class TrackedRawGreenlet(greenlet): # <<<<<<<<<<<<<< + * pass + * + */ +struct __pyx_obj_6gevent_21__greenlet_primitives_TrackedRawGreenlet { + PyGreenlet __pyx_base; +}; + + +/* "gevent/__greenlet_primitives.pxd":40 + * pass + * + * cdef class SwitchOutGreenletWithLoop(TrackedRawGreenlet): # <<<<<<<<<<<<<< + * cdef public loop + * + */ +struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop { + struct __pyx_obj_6gevent_21__greenlet_primitives_TrackedRawGreenlet __pyx_base; + struct __pyx_vtabstruct_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *__pyx_vtab; + PyObject *loop; +}; + + +/* "gevent/__waiter.pxd":33 + * _greenlet_imported = True + * + * cdef class Waiter: # <<<<<<<<<<<<<< + * cdef readonly SwitchOutGreenletWithLoop hub + * cdef readonly greenlet greenlet + */ +struct __pyx_obj_6gevent_8__waiter_Waiter { + PyObject_HEAD + struct __pyx_vtabstruct_6gevent_8__waiter_Waiter *__pyx_vtab; + struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *hub; + PyGreenlet *greenlet; + PyObject *value; + PyObject *_exception; +}; + + +/* "gevent/__waiter.pxd":47 + * @cython.final + * @cython.internal + * cdef class MultipleWaiter(Waiter): # <<<<<<<<<<<<<< + * cdef list _values + */ +struct __pyx_obj_6gevent_8__waiter_MultipleWaiter { + struct __pyx_obj_6gevent_8__waiter_Waiter __pyx_base; + PyObject *_values; +}; + + +/* "gevent/__hub_primitives.pxd":41 + * + * + * cdef class WaitOperationsGreenlet(SwitchOutGreenletWithLoop): # <<<<<<<<<<<<<< + * + * cpdef wait(self, watcher) + */ +struct __pyx_obj_6gevent_16__hub_primitives_WaitOperationsGreenlet { + struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop __pyx_base; +}; + + +/* "gevent/__hub_primitives.pxd":47 + * cpdef _cancel_wait(self, watcher, error, close_watcher) + * + * cdef class _WaitIterator: # <<<<<<<<<<<<<< + * cdef SwitchOutGreenletWithLoop _hub + * cdef MultipleWaiter _waiter + */ +struct __pyx_obj_6gevent_16__hub_primitives__WaitIterator { + PyObject_HEAD + struct __pyx_vtabstruct_6gevent_16__hub_primitives__WaitIterator *__pyx_vtab; + struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *_hub; + struct __pyx_obj_6gevent_8__waiter_MultipleWaiter *_waiter; + PyObject *_switch; + PyObject *_timeout; + PyObject *_objects; + PyObject *_timer; + Py_ssize_t _count; + int _begun; +}; + + + +/* "gevent/__greenlet_primitives.pxd":40 + * pass + * + * cdef class SwitchOutGreenletWithLoop(TrackedRawGreenlet): # <<<<<<<<<<<<<< + * cdef public loop + * + */ + +struct __pyx_vtabstruct_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop { + PyObject *(*__pyx_switch)(struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *, int __pyx_skip_dispatch); + PyObject *(*switch_out)(struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *, int __pyx_skip_dispatch); +}; +static struct __pyx_vtabstruct_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *__pyx_vtabptr_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop; + + +/* "gevent/__waiter.pxd":33 + * _greenlet_imported = True + * + * cdef class Waiter: # <<<<<<<<<<<<<< + * cdef readonly SwitchOutGreenletWithLoop hub + * cdef readonly greenlet greenlet + */ + +struct __pyx_vtabstruct_6gevent_8__waiter_Waiter { + PyObject *(*get)(struct __pyx_obj_6gevent_8__waiter_Waiter *, int __pyx_skip_dispatch); + PyObject *(*clear)(struct __pyx_obj_6gevent_8__waiter_Waiter *, int __pyx_skip_dispatch); +}; +static struct __pyx_vtabstruct_6gevent_8__waiter_Waiter *__pyx_vtabptr_6gevent_8__waiter_Waiter; + + +/* "gevent/__waiter.pxd":47 + * @cython.final + * @cython.internal + * cdef class MultipleWaiter(Waiter): # <<<<<<<<<<<<<< + * cdef list _values + */ + +struct __pyx_vtabstruct_6gevent_8__waiter_MultipleWaiter { + struct __pyx_vtabstruct_6gevent_8__waiter_Waiter __pyx_base; +}; +static struct __pyx_vtabstruct_6gevent_8__waiter_MultipleWaiter *__pyx_vtabptr_6gevent_8__waiter_MultipleWaiter; + + +/* "src/gevent/_hub_primitives.py":44 + * ] + * + * class WaitOperationsGreenlet(SwitchOutGreenletWithLoop): # pylint:disable=undefined-variable # <<<<<<<<<<<<<< + * + * def wait(self, watcher): + */ + +struct __pyx_vtabstruct_6gevent_16__hub_primitives_WaitOperationsGreenlet { + struct __pyx_vtabstruct_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop __pyx_base; + PyObject *(*wait)(struct __pyx_obj_6gevent_16__hub_primitives_WaitOperationsGreenlet *, PyObject *, int __pyx_skip_dispatch); + PyObject *(*cancel_wait)(struct __pyx_obj_6gevent_16__hub_primitives_WaitOperationsGreenlet *, PyObject *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_16__hub_primitives_22WaitOperationsGreenlet_cancel_wait *__pyx_optional_args); + PyObject *(*_cancel_wait)(struct __pyx_obj_6gevent_16__hub_primitives_WaitOperationsGreenlet *, PyObject *, PyObject *, PyObject *, int __pyx_skip_dispatch); +}; +static struct __pyx_vtabstruct_6gevent_16__hub_primitives_WaitOperationsGreenlet *__pyx_vtabptr_6gevent_16__hub_primitives_WaitOperationsGreenlet; + + +/* "src/gevent/_hub_primitives.py":98 + * + * + * class _WaitIterator(object): # <<<<<<<<<<<<<< + * + * def __init__(self, objects, hub, timeout, count): + */ + +struct __pyx_vtabstruct_6gevent_16__hub_primitives__WaitIterator { + PyObject *(*_begin)(struct __pyx_obj_6gevent_16__hub_primitives__WaitIterator *); + PyObject *(*_cleanup)(struct __pyx_obj_6gevent_16__hub_primitives__WaitIterator *); + PyObject *(*__pyx___enter__)(struct __pyx_obj_6gevent_16__hub_primitives__WaitIterator *, int __pyx_skip_dispatch); + PyObject *(*__pyx___exit__)(struct __pyx_obj_6gevent_16__hub_primitives__WaitIterator *, PyObject *, PyObject *, PyObject *, int __pyx_skip_dispatch); +}; +static struct __pyx_vtabstruct_6gevent_16__hub_primitives__WaitIterator *__pyx_vtabptr_6gevent_16__hub_primitives__WaitIterator; + +/* --- Runtime support code (head) --- */ +/* Refnanny.proto */ +#ifndef CYTHON_REFNANNY + #define CYTHON_REFNANNY 0 +#endif +#if CYTHON_REFNANNY + typedef struct { + void (*INCREF)(void*, PyObject*, int); + void (*DECREF)(void*, PyObject*, int); + void (*GOTREF)(void*, PyObject*, int); + void (*GIVEREF)(void*, PyObject*, int); + void* (*SetupContext)(const char*, int, const char*); + void (*FinishContext)(void**); + } __Pyx_RefNannyAPIStruct; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); + #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; +#ifdef WITH_THREAD + #define __Pyx_RefNannySetupContext(name, acquire_gil)\ + if (acquire_gil) {\ + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ + PyGILState_Release(__pyx_gilstate_save);\ + } else {\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ + } +#else + #define __Pyx_RefNannySetupContext(name, acquire_gil)\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) +#endif + #define __Pyx_RefNannyFinishContext()\ + __Pyx_RefNanny->FinishContext(&__pyx_refnanny) + #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0) + #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) + #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) + #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) +#else + #define __Pyx_RefNannyDeclarations + #define __Pyx_RefNannySetupContext(name, acquire_gil) + #define __Pyx_RefNannyFinishContext() + #define __Pyx_INCREF(r) Py_INCREF(r) + #define __Pyx_DECREF(r) Py_DECREF(r) + #define __Pyx_GOTREF(r) + #define __Pyx_GIVEREF(r) + #define __Pyx_XINCREF(r) Py_XINCREF(r) + #define __Pyx_XDECREF(r) Py_XDECREF(r) + #define __Pyx_XGOTREF(r) + #define __Pyx_XGIVEREF(r) +#endif +#define __Pyx_XDECREF_SET(r, v) do {\ + PyObject *tmp = (PyObject *) r;\ + r = v; __Pyx_XDECREF(tmp);\ + } while (0) +#define __Pyx_DECREF_SET(r, v) do {\ + PyObject *tmp = (PyObject *) r;\ + r = v; __Pyx_DECREF(tmp);\ + } while (0) +#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) +#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) + +/* PyObjectGetAttrStr.proto */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); +#else +#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) +#endif + +/* GetBuiltinName.proto */ +static PyObject *__Pyx_GetBuiltinName(PyObject *name); + +/* PyCFunctionFastCall.proto */ +#if CYTHON_FAST_PYCCALL +static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs); +#else +#define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL) +#endif + +/* PyFunctionFastCall.proto */ +#if CYTHON_FAST_PYCALL +#define __Pyx_PyFunction_FastCall(func, args, nargs)\ + __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) +#if 1 || PY_VERSION_HEX < 0x030600B1 +static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs); +#else +#define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs) +#endif +#define __Pyx_BUILD_ASSERT_EXPR(cond)\ + (sizeof(char [1 - 2*!(cond)]) - 1) +#ifndef Py_MEMBER_SIZE +#define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member) +#endif + static size_t __pyx_pyframe_localsplus_offset = 0; + #include "frameobject.h" + #define __Pxy_PyFrame_Initialize_Offsets()\ + ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\ + (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus))) + #define __Pyx_PyFrame_GetLocalsplus(frame)\ + (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset)) +#endif + +/* PyObjectCall.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); +#else +#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) +#endif + +/* PyObjectCall2Args.proto */ +static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2); + +/* PyObjectCallMethO.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); +#endif + +/* PyObjectCallOneArg.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); + +/* PyThreadStateGet.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; +#define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; +#define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type +#else +#define __Pyx_PyThreadState_declare +#define __Pyx_PyThreadState_assign +#define __Pyx_PyErr_Occurred() PyErr_Occurred() +#endif + +/* PyErrFetchRestore.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) +#define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) +#define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) +#define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) +#define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); +static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) +#else +#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) +#endif +#else +#define __Pyx_PyErr_Clear() PyErr_Clear() +#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) +#define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) +#define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb) +#define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) +#endif + +/* RaiseException.proto */ +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); + +/* PyObjectCallNoArg.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); +#else +#define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL) +#endif + +/* GetException.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb) +static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#else +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); +#endif + +/* SwapException.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#else +static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb); +#endif + +/* GetTopmostException.proto */ +#if CYTHON_USE_EXC_INFO_STACK +static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate); +#endif + +/* SaveResetException.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); +#else +#define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb) +#define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb) +#endif + +/* RaiseArgTupleInvalid.proto */ +static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, + Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); + +/* RaiseDoubleKeywords.proto */ +static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); + +/* ParseKeywords.proto */ +static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\ + PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\ + const char* function_name); + +/* PyErrExceptionMatches.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) +static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); +#else +#define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) +#endif + +/* GetAttr.proto */ +static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *); + +/* GetAttr3.proto */ +static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *); + +/* ExtTypeTest.proto */ +static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); + +/* GetModuleGlobalName.proto */ +#if CYTHON_USE_DICT_VERSIONS +#define __Pyx_GetModuleGlobalName(var, name) {\ + static PY_UINT64_T __pyx_dict_version = 0;\ + static PyObject *__pyx_dict_cached_value = NULL;\ + (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\ + (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\ + __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ +} +#define __Pyx_GetModuleGlobalNameUncached(var, name) {\ + PY_UINT64_T __pyx_dict_version;\ + PyObject *__pyx_dict_cached_value;\ + (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ +} +static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value); +#else +#define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name) +#define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name) +static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name); +#endif + +/* PyObjectLookupSpecial.proto */ +#if CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject* __Pyx_PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name) { + PyObject *res; + PyTypeObject *tp = Py_TYPE(obj); +#if PY_MAJOR_VERSION < 3 + if (unlikely(PyInstance_Check(obj))) + return __Pyx_PyObject_GetAttrStr(obj, attr_name); +#endif + res = _PyType_Lookup(tp, attr_name); + if (likely(res)) { + descrgetfunc f = Py_TYPE(res)->tp_descr_get; + if (!f) { + Py_INCREF(res); + } else { + res = f(res, obj, (PyObject *)tp); + } + } else { + PyErr_SetObject(PyExc_AttributeError, attr_name); + } + return res; +} +#else +#define __Pyx_PyObject_LookupSpecial(o,n) __Pyx_PyObject_GetAttrStr(o,n) +#endif + +/* ArgTypeTest.proto */ +#define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\ + ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\ + __Pyx__ArgTypeTest(obj, type, name, exact)) +static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact); + +/* CallNextTpDealloc.proto */ +static void __Pyx_call_next_tp_dealloc(PyObject* obj, destructor current_tp_dealloc); + +/* CallNextTpTraverse.proto */ +static int __Pyx_call_next_tp_traverse(PyObject* obj, visitproc v, void *a, traverseproc current_tp_traverse); + +/* CallNextTpClear.proto */ +static void __Pyx_call_next_tp_clear(PyObject* obj, inquiry current_tp_dealloc); + +/* TypeImport.proto */ +#ifndef __PYX_HAVE_RT_ImportType_proto +#define __PYX_HAVE_RT_ImportType_proto +enum __Pyx_ImportType_CheckSize { + __Pyx_ImportType_CheckSize_Error = 0, + __Pyx_ImportType_CheckSize_Warn = 1, + __Pyx_ImportType_CheckSize_Ignore = 2 +}; +static PyTypeObject *__Pyx_ImportType(PyObject* module, const char *module_name, const char *class_name, size_t size, enum __Pyx_ImportType_CheckSize check_size); +#endif + +/* GetVTable.proto */ +static void* __Pyx_GetVtable(PyObject *dict); + +/* PyObject_GenericGetAttrNoDict.proto */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name); +#else +#define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr +#endif + +/* PyObject_GenericGetAttr.proto */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name); +#else +#define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr +#endif + +/* SetVTable.proto */ +static int __Pyx_SetVtable(PyObject *dict, void *vtable); + +/* Import.proto */ +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); + +/* ImportFrom.proto */ +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); + +/* FetchCommonType.proto */ +static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); + +/* CythonFunction.proto */ +#define __Pyx_CyFunction_USED 1 +#define __Pyx_CYFUNCTION_STATICMETHOD 0x01 +#define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 +#define __Pyx_CYFUNCTION_CCLASS 0x04 +#define __Pyx_CyFunction_GetClosure(f)\ + (((__pyx_CyFunctionObject *) (f))->func_closure) +#define __Pyx_CyFunction_GetClassObj(f)\ + (((__pyx_CyFunctionObject *) (f))->func_classobj) +#define __Pyx_CyFunction_Defaults(type, f)\ + ((type *)(((__pyx_CyFunctionObject *) (f))->defaults)) +#define __Pyx_CyFunction_SetDefaultsGetter(f, g)\ + ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g) +typedef struct { + PyCFunctionObject func; +#if PY_VERSION_HEX < 0x030500A0 + PyObject *func_weakreflist; +#endif + PyObject *func_dict; + PyObject *func_name; + PyObject *func_qualname; + PyObject *func_doc; + PyObject *func_globals; + PyObject *func_code; + PyObject *func_closure; + PyObject *func_classobj; + void *defaults; + int defaults_pyobjects; + int flags; + PyObject *defaults_tuple; + PyObject *defaults_kwdict; + PyObject *(*defaults_getter)(PyObject *); + PyObject *func_annotations; +} __pyx_CyFunctionObject; +static PyTypeObject *__pyx_CyFunctionType = 0; +#define __Pyx_CyFunction_Check(obj) (__Pyx_TypeCheck(obj, __pyx_CyFunctionType)) +#define __Pyx_CyFunction_NewEx(ml, flags, qualname, self, module, globals, code)\ + __Pyx_CyFunction_New(__pyx_CyFunctionType, ml, flags, qualname, self, module, globals, code) +static PyObject *__Pyx_CyFunction_New(PyTypeObject *, PyMethodDef *ml, + int flags, PyObject* qualname, + PyObject *self, + PyObject *module, PyObject *globals, + PyObject* code); +static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, + size_t size, + int pyobjects); +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, + PyObject *tuple); +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, + PyObject *dict); +static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m, + PyObject *dict); +static int __pyx_CyFunction_init(void); + +/* GetNameInClass.proto */ +#define __Pyx_GetNameInClass(var, nmspace, name) (var) = __Pyx__GetNameInClass(nmspace, name) +static PyObject *__Pyx__GetNameInClass(PyObject *nmspace, PyObject *name); + +/* Globals.proto */ +static PyObject* __Pyx_Globals(void); + +/* CLineInTraceback.proto */ +#ifdef CYTHON_CLINE_IN_TRACEBACK +#define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) +#else +static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line); +#endif + +/* CodeObjectCache.proto */ +typedef struct { + PyCodeObject* code_object; + int code_line; +} __Pyx_CodeObjectCacheEntry; +struct __Pyx_CodeObjectCache { + int count; + int max_count; + __Pyx_CodeObjectCacheEntry* entries; +}; +static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); +static PyCodeObject *__pyx_find_code_object(int code_line); +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); + +/* AddTraceback.proto */ +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename); + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); + +/* CIntFromPy.proto */ +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); + +/* CIntFromPy.proto */ +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); + +/* FastTypeChecks.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) +static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b); +static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type); +static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2); +#else +#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) +#define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) +#define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) +#endif +#define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) + +/* CheckBinaryVersion.proto */ +static int __Pyx_check_binary_version(void); + +/* PyObjectSetAttrStr.proto */ +#if CYTHON_USE_TYPE_SLOTS +#define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o, n, NULL) +static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value); +#else +#define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n) +#define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v) +#endif + +/* VoidPtrExport.proto */ +static int __Pyx_ExportVoidPtr(PyObject *name, void *p, const char *sig); + +/* FunctionExport.proto */ +static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig); + +/* VoidPtrImport.proto */ +static int __Pyx_ImportVoidPtr(PyObject *module, const char *name, void **p, const char *sig); + +/* FunctionImport.proto */ +static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig); + +/* InitStrings.proto */ +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); + +static PyObject *__pyx_f_6gevent_16__hub_primitives_22WaitOperationsGreenlet_wait(struct __pyx_obj_6gevent_16__hub_primitives_WaitOperationsGreenlet *__pyx_v_self, PyObject *__pyx_v_watcher, int __pyx_skip_dispatch); /* proto*/ +static PyObject *__pyx_f_6gevent_16__hub_primitives_22WaitOperationsGreenlet_cancel_wait(struct __pyx_obj_6gevent_16__hub_primitives_WaitOperationsGreenlet *__pyx_v_self, PyObject *__pyx_v_watcher, PyObject *__pyx_v_error, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_16__hub_primitives_22WaitOperationsGreenlet_cancel_wait *__pyx_optional_args); /* proto*/ +static PyObject *__pyx_f_6gevent_16__hub_primitives_22WaitOperationsGreenlet__cancel_wait(CYTHON_UNUSED struct __pyx_obj_6gevent_16__hub_primitives_WaitOperationsGreenlet *__pyx_v_self, PyObject *__pyx_v_watcher, PyObject *__pyx_v_error, PyObject *__pyx_v_close_watcher, int __pyx_skip_dispatch); /* proto*/ +static PyObject *__pyx_f_6gevent_16__hub_primitives_13_WaitIterator__begin(struct __pyx_obj_6gevent_16__hub_primitives__WaitIterator *__pyx_v_self); /* proto*/ +static PyObject *__pyx_f_6gevent_16__hub_primitives_13_WaitIterator__cleanup(struct __pyx_obj_6gevent_16__hub_primitives__WaitIterator *__pyx_v_self); /* proto*/ +static PyObject *__pyx_f_6gevent_16__hub_primitives_13_WaitIterator___enter__(struct __pyx_obj_6gevent_16__hub_primitives__WaitIterator *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/ +static PyObject *__pyx_f_6gevent_16__hub_primitives_13_WaitIterator___exit__(struct __pyx_obj_6gevent_16__hub_primitives__WaitIterator *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_typ, CYTHON_UNUSED PyObject *__pyx_v_value, CYTHON_UNUSED PyObject *__pyx_v_tb, int __pyx_skip_dispatch); /* proto*/ + +/* Module declarations from 'cython' */ + +/* Module declarations from 'greenlet' */ + +/* Module declarations from 'gevent.__greenlet_primitives' */ +static PyTypeObject *__pyx_ptype_6gevent_21__greenlet_primitives_greenlet = 0; +static PyTypeObject *__pyx_ptype_6gevent_21__greenlet_primitives_TrackedRawGreenlet = 0; +static PyTypeObject *__pyx_ptype_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop = 0; +static PyObject **__pyx_vp_6gevent_21__greenlet_primitives_get_objects = 0; +#define __pyx_v_6gevent_21__greenlet_primitives_get_objects (*__pyx_vp_6gevent_21__greenlet_primitives_get_objects) +static PyObject **__pyx_vp_6gevent_21__greenlet_primitives_wref = 0; +#define __pyx_v_6gevent_21__greenlet_primitives_wref (*__pyx_vp_6gevent_21__greenlet_primitives_wref) +static PyObject **__pyx_vp_6gevent_21__greenlet_primitives_BlockingSwitchOutError = 0; +#define __pyx_v_6gevent_21__greenlet_primitives_BlockingSwitchOutError (*__pyx_vp_6gevent_21__greenlet_primitives_BlockingSwitchOutError) +static int *__pyx_vp_6gevent_21__greenlet_primitives__greenlet_imported = 0; +#define __pyx_v_6gevent_21__greenlet_primitives__greenlet_imported (*__pyx_vp_6gevent_21__greenlet_primitives__greenlet_imported) + +/* Module declarations from 'gevent.__hub_local' */ +static PyObject **__pyx_vp_6gevent_11__hub_local__threadlocal = 0; +#define __pyx_v_6gevent_11__hub_local__threadlocal (*__pyx_vp_6gevent_11__hub_local__threadlocal) +static struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *(*__pyx_f_6gevent_11__hub_local_get_hub_noargs)(int __pyx_skip_dispatch); /*proto*/ + +/* Module declarations from 'gevent.__waiter' */ +static PyTypeObject *__pyx_ptype_6gevent_8__waiter_greenlet = 0; +static PyTypeObject *__pyx_ptype_6gevent_8__waiter_Waiter = 0; +static PyTypeObject *__pyx_ptype_6gevent_8__waiter_MultipleWaiter = 0; +static PyObject **__pyx_vp_6gevent_8__waiter_sys = 0; +#define __pyx_v_6gevent_8__waiter_sys (*__pyx_vp_6gevent_8__waiter_sys) +static PyObject **__pyx_vp_6gevent_8__waiter_ConcurrentObjectUseError = 0; +#define __pyx_v_6gevent_8__waiter_ConcurrentObjectUseError (*__pyx_vp_6gevent_8__waiter_ConcurrentObjectUseError) +static int *__pyx_vp_6gevent_8__waiter__greenlet_imported = 0; +#define __pyx_v_6gevent_8__waiter__greenlet_imported (*__pyx_vp_6gevent_8__waiter__greenlet_imported) +static PyObject **__pyx_vp_6gevent_8__waiter__NONE = 0; +#define __pyx_v_6gevent_8__waiter__NONE (*__pyx_vp_6gevent_8__waiter__NONE) + +/* Module declarations from 'gevent.__hub_primitives' */ +static PyTypeObject *__pyx_ptype_6gevent_16__hub_primitives_greenlet = 0; +static PyTypeObject *__pyx_ptype_6gevent_16__hub_primitives_WaitOperationsGreenlet = 0; +static PyTypeObject *__pyx_ptype_6gevent_16__hub_primitives__WaitIterator = 0; +static PyObject *__pyx_v_6gevent_16__hub_primitives_InvalidSwitchError = 0; +static PyObject *__pyx_v_6gevent_16__hub_primitives__waiter = 0; +static PyObject *__pyx_v_6gevent_16__hub_primitives__greenlet_primitives = 0; +static PyObject *__pyx_v_6gevent_16__hub_primitives_traceback = 0; +static PyObject *__pyx_v_6gevent_16__hub_primitives__timeout_error = 0; +static PyObject *__pyx_v_6gevent_16__hub_primitives_Timeout = 0; +static int __pyx_v_6gevent_16__hub_primitives__greenlet_imported; +static CYTHON_INLINE PyGreenlet *__pyx_f_6gevent_16__hub_primitives_getcurrent(void); /*proto*/ +static CYTHON_INLINE void __pyx_f_6gevent_16__hub_primitives_greenlet_init(void); /*proto*/ +static PyObject *__pyx_f_6gevent_16__hub_primitives_iwait_on_objects(PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_16__hub_primitives_iwait_on_objects *__pyx_optional_args); /*proto*/ +static PyObject *__pyx_f_6gevent_16__hub_primitives_wait_on_objects(int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_16__hub_primitives_wait_on_objects *__pyx_optional_args); /*proto*/ +static PyObject *__pyx_f_6gevent_16__hub_primitives__primitive_wait(PyObject *, PyObject *, PyObject *, struct __pyx_obj_6gevent_16__hub_primitives_WaitOperationsGreenlet *); /*proto*/ +static PyObject *__pyx_f_6gevent_16__hub_primitives_wait_on_watcher(PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_16__hub_primitives_wait_on_watcher *__pyx_optional_args); /*proto*/ +static PyObject *__pyx_f_6gevent_16__hub_primitives_wait_read(PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_16__hub_primitives_wait_read *__pyx_optional_args); /*proto*/ +static PyObject *__pyx_f_6gevent_16__hub_primitives_wait_write(PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_16__hub_primitives_wait_write *__pyx_optional_args); /*proto*/ +static PyObject *__pyx_f_6gevent_16__hub_primitives_wait_readwrite(PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_16__hub_primitives_wait_readwrite *__pyx_optional_args); /*proto*/ +static PyObject *__pyx_f_6gevent_16__hub_primitives_wait_on_socket(PyObject *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_16__hub_primitives_wait_on_socket *__pyx_optional_args); /*proto*/ +#define __Pyx_MODULE_NAME "gevent.__hub_primitives" +extern int __pyx_module_is_main_gevent____hub_primitives; +int __pyx_module_is_main_gevent____hub_primitives = 0; + +/* Implementation of 'gevent.__hub_primitives' */ +static PyObject *__pyx_builtin___import__; +static PyObject *__pyx_builtin_StopIteration; +static const char __pyx_k_e[] = "e"; +static const char __pyx_k_io[] = "io"; +static const char __pyx_k_tb[] = "tb"; +static const char __pyx_k_all[] = "__all__"; +static const char __pyx_k_hub[] = "hub"; +static const char __pyx_k_typ[] = "typ"; +static const char __pyx_k_NONE[] = "_NONE"; +static const char __pyx_k_exit[] = "__exit__"; +static const char __pyx_k_init[] = "_init"; +static const char __pyx_k_join[] = "join"; +static const char __pyx_k_main[] = "__main__"; +static const char __pyx_k_name[] = "__name__"; +static const char __pyx_k_next[] = "__next__"; +static const char __pyx_k_self[] = "__self__"; +static const char __pyx_k_stop[] = "stop"; +static const char __pyx_k_test[] = "__test__"; +static const char __pyx_k_wait[] = "wait"; +static const char __pyx_k_close[] = "close"; +static const char __pyx_k_count[] = "count"; +static const char __pyx_k_enter[] = "__enter__"; +static const char __pyx_k_error[] = "error"; +static const char __pyx_k_event[] = "event"; +static const char __pyx_k_start[] = "start"; +static const char __pyx_k_throw[] = "throw"; +static const char __pyx_k_timer[] = "timer"; +static const char __pyx_k_value[] = "value"; +static const char __pyx_k_Waiter[] = "Waiter"; +static const char __pyx_k_active[] = "active"; +static const char __pyx_k_fileno[] = "fileno"; +static const char __pyx_k_gevent[] = "gevent"; +static const char __pyx_k_import[] = "__import__"; +static const char __pyx_k_lambda[] = ""; +static const char __pyx_k_next_2[] = "next"; +static const char __pyx_k_self_2[] = "self"; +static const char __pyx_k_socket[] = "socket"; +static const char __pyx_k_switch[] = "switch"; +static const char __pyx_k_unlink[] = "unlink"; +static const char __pyx_k_waiter[] = "_waiter"; +static const char __pyx_k_Timeout[] = "Timeout"; +static const char __pyx_k_objects[] = "objects"; +static const char __pyx_k_rawlink[] = "rawlink"; +static const char __pyx_k_timeout[] = "timeout"; +static const char __pyx_k_watcher[] = "watcher"; +static const char __pyx_k_callback[] = "callback"; +static const char __pyx_k_greenlet[] = "greenlet"; +static const char __pyx_k_priority[] = "priority"; +static const char __pyx_k_pyx_capi[] = "__pyx_capi__"; +static const char __pyx_k_print_exc[] = "print_exc"; +static const char __pyx_k_timed_out[] = "timed out"; +static const char __pyx_k_traceback[] = "traceback"; +static const char __pyx_k_wait_read[] = "wait_read"; +static const char __pyx_k_getcurrent[] = "getcurrent"; +static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__"; +static const char __pyx_k_wait_write[] = "wait_write"; +static const char __pyx_k_cancel_wait[] = "cancel_wait"; +static const char __pyx_k_timeout_exc[] = "timeout_exc"; +static const char __pyx_k_WaitIterator[] = "_WaitIterator"; +static const char __pyx_k_gevent__util[] = "gevent._util"; +static const char __pyx_k_run_callback[] = "run_callback"; +static const char __pyx_k_StopIteration[] = "StopIteration"; +static const char __pyx_k_cancel_wait_2[] = "_cancel_wait"; +static const char __pyx_k_close_watcher[] = "close_watcher"; +static const char __pyx_k_greenlet_init[] = "greenlet_init"; +static const char __pyx_k_timeout_error[] = "_timeout_error"; +static const char __pyx_k_MultipleWaiter[] = "MultipleWaiter"; +static const char __pyx_k_get_hub_noargs[] = "get_hub_noargs"; +static const char __pyx_k_gevent_timeout[] = "gevent.timeout"; +static const char __pyx_k_import_c_accel[] = "import_c_accel"; +static const char __pyx_k_wait_on_socket[] = "wait_on_socket"; +static const char __pyx_k_wait_readwrite[] = "wait_readwrite"; +static const char __pyx_k_wait_on_objects[] = "wait_on_objects"; +static const char __pyx_k_wait_on_watcher[] = "wait_on_watcher"; +static const char __pyx_k_iwait_on_objects[] = "iwait_on_objects"; +static const char __pyx_k_gevent__hub_local[] = "gevent._hub_local"; +static const char __pyx_k_gevent_exceptions[] = "gevent.exceptions"; +static const char __pyx_k_greenlet_imported[] = "_greenlet_imported"; +static const char __pyx_k_InvalidSwitchError[] = "InvalidSwitchError"; +static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; +static const char __pyx_k_start_new_or_dummy[] = "_start_new_or_dummy"; +static const char __pyx_k_WaitIterator___exit[] = "_WaitIterator.__exit__"; +static const char __pyx_k_greenlet_primitives[] = "_greenlet_primitives"; +static const char __pyx_k_WaitIterator___enter[] = "_WaitIterator.__enter__"; +static const char __pyx_k_WaitOperationsGreenlet[] = "WaitOperationsGreenlet"; +static const char __pyx_k_gevent___hub_primitives[] = "gevent.__hub_primitives"; +static const char __pyx_k_ConcurrentObjectUseError[] = "ConcurrentObjectUseError"; +static const char __pyx_k_SwitchOutGreenletWithLoop[] = "SwitchOutGreenletWithLoop"; +static const char __pyx_k_set_default_timeout_error[] = "set_default_timeout_error"; +static const char __pyx_k_WaitOperationsGreenlet_wait[] = "WaitOperationsGreenlet.wait"; +static const char __pyx_k_src_gevent__hub_primitives_py[] = "src\\gevent\\_hub_primitives.py"; +static const char __pyx_k_A_collection_of_primitives_used[] = "\nA collection of primitives used by the hub, and suitable for\ncompilation with Cython because of their frequency of use.\n\n\n"; +static const char __pyx_k_Invalid_switch_into_s_r_expected[] = "Invalid switch into %s: %r (expected %r)"; +static const char __pyx_k_The_socket_has_already_been_clos[] = "The socket has already been closed by another greenlet"; +static const char __pyx_k_This_socket_is_already_used_by_a[] = "This socket is already used by another greenlet: %r"; +static const char __pyx_k_WaitOperationsGreenlet__cancel_w[] = "WaitOperationsGreenlet._cancel_wait"; +static const char __pyx_k_WaitOperationsGreenlet_cancel_wa[] = "WaitOperationsGreenlet.cancel_wait"; +static PyObject *__pyx_n_s_ConcurrentObjectUseError; +static PyObject *__pyx_n_s_InvalidSwitchError; +static PyObject *__pyx_kp_s_Invalid_switch_into_s_r_expected; +static PyObject *__pyx_n_s_MultipleWaiter; +static PyObject *__pyx_n_s_NONE; +static PyObject *__pyx_n_s_StopIteration; +static PyObject *__pyx_n_s_SwitchOutGreenletWithLoop; +static PyObject *__pyx_kp_s_The_socket_has_already_been_clos; +static PyObject *__pyx_kp_s_This_socket_is_already_used_by_a; +static PyObject *__pyx_n_s_Timeout; +static PyObject *__pyx_n_s_WaitIterator; +static PyObject *__pyx_n_s_WaitIterator___enter; +static PyObject *__pyx_n_s_WaitIterator___exit; +static PyObject *__pyx_n_s_WaitOperationsGreenlet; +static PyObject *__pyx_n_s_WaitOperationsGreenlet__cancel_w; +static PyObject *__pyx_n_s_WaitOperationsGreenlet_cancel_wa; +static PyObject *__pyx_n_s_WaitOperationsGreenlet_wait; +static PyObject *__pyx_n_s_Waiter; +static PyObject *__pyx_n_s_active; +static PyObject *__pyx_n_s_all; +static PyObject *__pyx_n_s_callback; +static PyObject *__pyx_n_s_cancel_wait; +static PyObject *__pyx_n_s_cancel_wait_2; +static PyObject *__pyx_n_s_cline_in_traceback; +static PyObject *__pyx_n_s_close; +static PyObject *__pyx_n_s_close_watcher; +static PyObject *__pyx_n_s_count; +static PyObject *__pyx_n_s_e; +static PyObject *__pyx_n_s_enter; +static PyObject *__pyx_n_s_error; +static PyObject *__pyx_n_s_event; +static PyObject *__pyx_n_s_exit; +static PyObject *__pyx_n_s_fileno; +static PyObject *__pyx_n_s_get_hub_noargs; +static PyObject *__pyx_n_s_getcurrent; +static PyObject *__pyx_n_s_gevent; +static PyObject *__pyx_n_s_gevent___hub_primitives; +static PyObject *__pyx_n_s_gevent__hub_local; +static PyObject *__pyx_n_s_gevent__util; +static PyObject *__pyx_n_s_gevent_exceptions; +static PyObject *__pyx_n_s_gevent_timeout; +static PyObject *__pyx_n_s_greenlet; +static PyObject *__pyx_n_s_greenlet_imported; +static PyObject *__pyx_n_s_greenlet_init; +static PyObject *__pyx_n_s_greenlet_primitives; +static PyObject *__pyx_n_s_hub; +static PyObject *__pyx_n_s_import; +static PyObject *__pyx_n_s_import_c_accel; +static PyObject *__pyx_n_s_init; +static PyObject *__pyx_n_s_io; +static PyObject *__pyx_n_s_iwait_on_objects; +static PyObject *__pyx_n_s_join; +static PyObject *__pyx_n_s_lambda; +static PyObject *__pyx_n_s_main; +static PyObject *__pyx_n_s_name; +static PyObject *__pyx_n_s_next; +static PyObject *__pyx_n_s_next_2; +static PyObject *__pyx_n_s_objects; +static PyObject *__pyx_n_s_print_exc; +static PyObject *__pyx_n_s_priority; +static PyObject *__pyx_n_s_pyx_capi; +static PyObject *__pyx_n_s_pyx_vtable; +static PyObject *__pyx_n_s_rawlink; +static PyObject *__pyx_n_s_run_callback; +static PyObject *__pyx_n_s_self; +static PyObject *__pyx_n_s_self_2; +static PyObject *__pyx_n_s_set_default_timeout_error; +static PyObject *__pyx_n_s_socket; +static PyObject *__pyx_kp_s_src_gevent__hub_primitives_py; +static PyObject *__pyx_n_s_start; +static PyObject *__pyx_n_s_start_new_or_dummy; +static PyObject *__pyx_n_s_stop; +static PyObject *__pyx_n_s_switch; +static PyObject *__pyx_n_s_tb; +static PyObject *__pyx_n_s_test; +static PyObject *__pyx_n_s_throw; +static PyObject *__pyx_kp_s_timed_out; +static PyObject *__pyx_n_s_timeout; +static PyObject *__pyx_n_s_timeout_error; +static PyObject *__pyx_n_s_timeout_exc; +static PyObject *__pyx_n_s_timer; +static PyObject *__pyx_n_s_traceback; +static PyObject *__pyx_n_s_typ; +static PyObject *__pyx_n_s_unlink; +static PyObject *__pyx_n_s_value; +static PyObject *__pyx_n_s_wait; +static PyObject *__pyx_n_s_wait_on_objects; +static PyObject *__pyx_n_s_wait_on_socket; +static PyObject *__pyx_n_s_wait_on_watcher; +static PyObject *__pyx_n_s_wait_read; +static PyObject *__pyx_n_s_wait_readwrite; +static PyObject *__pyx_n_s_wait_write; +static PyObject *__pyx_n_s_waiter; +static PyObject *__pyx_n_s_watcher; +static PyObject *__pyx_lambda_funcdef_6gevent_16__hub_primitives_lambda(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_6gevent_16__hub_primitives_22WaitOperationsGreenlet_wait(struct __pyx_obj_6gevent_16__hub_primitives_WaitOperationsGreenlet *__pyx_v_self, PyObject *__pyx_v_watcher); /* proto */ +static PyObject *__pyx_pf_6gevent_16__hub_primitives_22WaitOperationsGreenlet_2cancel_wait(struct __pyx_obj_6gevent_16__hub_primitives_WaitOperationsGreenlet *__pyx_v_self, PyObject *__pyx_v_watcher, PyObject *__pyx_v_error, PyObject *__pyx_v_close_watcher); /* proto */ +static PyObject *__pyx_pf_6gevent_16__hub_primitives_22WaitOperationsGreenlet_4_cancel_wait(struct __pyx_obj_6gevent_16__hub_primitives_WaitOperationsGreenlet *__pyx_v_self, PyObject *__pyx_v_watcher, PyObject *__pyx_v_error, PyObject *__pyx_v_close_watcher); /* proto */ +static int __pyx_pf_6gevent_16__hub_primitives_13_WaitIterator___init__(struct __pyx_obj_6gevent_16__hub_primitives__WaitIterator *__pyx_v_self, PyObject *__pyx_v_objects, PyObject *__pyx_v_hub, PyObject *__pyx_v_timeout, PyObject *__pyx_v_count); /* proto */ +static PyObject *__pyx_pf_6gevent_16__hub_primitives_13_WaitIterator_2__iter__(struct __pyx_obj_6gevent_16__hub_primitives__WaitIterator *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_16__hub_primitives_13_WaitIterator_4__next__(struct __pyx_obj_6gevent_16__hub_primitives__WaitIterator *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_16__hub_primitives_13_WaitIterator_6__enter__(struct __pyx_obj_6gevent_16__hub_primitives__WaitIterator *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_16__hub_primitives_13_WaitIterator_8__exit__(struct __pyx_obj_6gevent_16__hub_primitives__WaitIterator *__pyx_v_self, PyObject *__pyx_v_typ, PyObject *__pyx_v_value, PyObject *__pyx_v_tb); /* proto */ +static PyObject *__pyx_pf_6gevent_16__hub_primitives_iwait_on_objects(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_objects, PyObject *__pyx_v_timeout, PyObject *__pyx_v_count); /* proto */ +static PyObject *__pyx_pf_6gevent_16__hub_primitives_2wait_on_objects(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_objects, PyObject *__pyx_v_timeout, PyObject *__pyx_v_count); /* proto */ +static PyObject *__pyx_pf_6gevent_16__hub_primitives_4set_default_timeout_error(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_e); /* proto */ +static PyObject *__pyx_pf_6gevent_16__hub_primitives_6wait_on_socket(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_socket, PyObject *__pyx_v_watcher, PyObject *__pyx_v_timeout_exc); /* proto */ +static PyObject *__pyx_pf_6gevent_16__hub_primitives_8wait_on_watcher(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_watcher, PyObject *__pyx_v_timeout, PyObject *__pyx_v_timeout_exc, struct __pyx_obj_6gevent_16__hub_primitives_WaitOperationsGreenlet *__pyx_v_hub); /* proto */ +static PyObject *__pyx_pf_6gevent_16__hub_primitives_10wait_read(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_fileno, PyObject *__pyx_v_timeout, PyObject *__pyx_v_timeout_exc); /* proto */ +static PyObject *__pyx_pf_6gevent_16__hub_primitives_12wait_write(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_fileno, PyObject *__pyx_v_timeout, PyObject *__pyx_v_timeout_exc, PyObject *__pyx_v_event); /* proto */ +static PyObject *__pyx_pf_6gevent_16__hub_primitives_14wait_readwrite(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_fileno, PyObject *__pyx_v_timeout, PyObject *__pyx_v_timeout_exc, PyObject *__pyx_v_event); /* proto */ +static PyObject *__pyx_pf_6gevent_16__hub_primitives_16_init(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_tp_new_6gevent_16__hub_primitives_WaitOperationsGreenlet(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6gevent_16__hub_primitives__WaitIterator(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_int_1; +static PyObject *__pyx_int_2; +static PyObject *__pyx_int_3; +static PyObject *__pyx_int_neg_1; +static PyObject *__pyx_k__2; +static PyObject *__pyx_k__3; +static PyObject *__pyx_k__4; +static PyObject *__pyx_k__5; +static PyObject *__pyx_k__6; +static PyObject *__pyx_k__7; +static PyObject *__pyx_tuple_; +static PyObject *__pyx_tuple__8; +static PyObject *__pyx_tuple__9; +static PyObject *__pyx_tuple__11; +static PyObject *__pyx_tuple__13; +static PyObject *__pyx_tuple__15; +static PyObject *__pyx_tuple__17; +static PyObject *__pyx_tuple__19; +static PyObject *__pyx_tuple__21; +static PyObject *__pyx_tuple__23; +static PyObject *__pyx_tuple__25; +static PyObject *__pyx_tuple__27; +static PyObject *__pyx_tuple__29; +static PyObject *__pyx_tuple__31; +static PyObject *__pyx_tuple__33; +static PyObject *__pyx_codeobj__10; +static PyObject *__pyx_codeobj__12; +static PyObject *__pyx_codeobj__14; +static PyObject *__pyx_codeobj__16; +static PyObject *__pyx_codeobj__18; +static PyObject *__pyx_codeobj__20; +static PyObject *__pyx_codeobj__22; +static PyObject *__pyx_codeobj__24; +static PyObject *__pyx_codeobj__26; +static PyObject *__pyx_codeobj__28; +static PyObject *__pyx_codeobj__30; +static PyObject *__pyx_codeobj__32; +static PyObject *__pyx_codeobj__34; +static PyObject *__pyx_codeobj__35; +/* Late includes */ + +/* "src/gevent/_hub_primitives.py":30 + * # error. + * locals()['getcurrent'] = __import__('greenlet').getcurrent + * locals()['greenlet_init'] = lambda: None # <<<<<<<<<<<<<< + * locals()['Waiter'] = _waiter.Waiter + * locals()['MultipleWaiter'] = _waiter.MultipleWaiter + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_16__hub_primitives_18lambda(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyMethodDef __pyx_mdef_6gevent_16__hub_primitives_18lambda = {"lambda", (PyCFunction)__pyx_pw_6gevent_16__hub_primitives_18lambda, METH_NOARGS, 0}; +static PyObject *__pyx_pw_6gevent_16__hub_primitives_18lambda(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("lambda (wrapper)", 0); + __pyx_r = __pyx_lambda_funcdef_6gevent_16__hub_primitives_lambda(__pyx_self); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_lambda_funcdef_6gevent_16__hub_primitives_lambda(CYTHON_UNUSED PyObject *__pyx_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("lambda", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_hub_primitives.py":46 + * class WaitOperationsGreenlet(SwitchOutGreenletWithLoop): # pylint:disable=undefined-variable + * + * def wait(self, watcher): # <<<<<<<<<<<<<< + * """ + * Wait until the *watcher* (which must not be started) is ready. + */ + +static PyObject *__pyx_pw_6gevent_16__hub_primitives_22WaitOperationsGreenlet_1wait(PyObject *__pyx_v_self, PyObject *__pyx_v_watcher); /*proto*/ +static PyObject *__pyx_f_6gevent_16__hub_primitives_22WaitOperationsGreenlet_wait(struct __pyx_obj_6gevent_16__hub_primitives_WaitOperationsGreenlet *__pyx_v_self, PyObject *__pyx_v_watcher, int __pyx_skip_dispatch) { + struct __pyx_obj_6gevent_8__waiter_Waiter *__pyx_v_waiter = NULL; + PyObject *__pyx_v_result = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + int __pyx_t_8; + int __pyx_t_9; + char const *__pyx_t_10; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + PyObject *__pyx_t_14 = NULL; + PyObject *__pyx_t_15 = NULL; + PyObject *__pyx_t_16 = NULL; + __Pyx_RefNannySetupContext("wait", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0; + if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self)))))); + else { + PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + #endif + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_wait); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 46, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_16__hub_primitives_22WaitOperationsGreenlet_1wait)) { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_watcher) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_watcher); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 46, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0; + if (unlikely(type_dict_guard != tp_dict_version)) { + tp_dict_version = obj_dict_version = 0; + } + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + } + #endif + } + + /* "src/gevent/_hub_primitives.py":52 + * The current greenlet will be unscheduled during this time. + * """ + * waiter = Waiter(self) # pylint:disable=undefined-variable # <<<<<<<<<<<<<< + * watcher.start(waiter.switch, waiter) + * try: + */ + __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_6gevent_8__waiter_Waiter), ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 52, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_waiter = ((struct __pyx_obj_6gevent_8__waiter_Waiter *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "src/gevent/_hub_primitives.py":53 + * """ + * waiter = Waiter(self) # pylint:disable=undefined-variable + * watcher.start(waiter.switch, waiter) # <<<<<<<<<<<<<< + * try: + * result = waiter.get() + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_watcher, __pyx_n_s_start); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 53, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_waiter), __pyx_n_s_switch); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 53, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = NULL; + __pyx_t_5 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_5 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_3, ((PyObject *)__pyx_v_waiter)}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 53, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_3, ((PyObject *)__pyx_v_waiter)}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 53, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } else + #endif + { + __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 53, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (__pyx_t_4) { + __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL; + } + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_t_3); + __Pyx_INCREF(((PyObject *)__pyx_v_waiter)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_waiter)); + PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, ((PyObject *)__pyx_v_waiter)); + __pyx_t_3 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 53, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_hub_primitives.py":54 + * waiter = Waiter(self) # pylint:disable=undefined-variable + * watcher.start(waiter.switch, waiter) + * try: # <<<<<<<<<<<<<< + * result = waiter.get() + * if result is not waiter: + */ + /*try:*/ { + + /* "src/gevent/_hub_primitives.py":55 + * watcher.start(waiter.switch, waiter) + * try: + * result = waiter.get() # <<<<<<<<<<<<<< + * if result is not waiter: + * raise InvalidSwitchError('Invalid switch into %s: %r (expected %r)' % ( + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_8__waiter_Waiter *)__pyx_v_waiter->__pyx_vtab)->get(__pyx_v_waiter, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 55, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_result = __pyx_t_1; + __pyx_t_1 = 0; + + /* "src/gevent/_hub_primitives.py":56 + * try: + * result = waiter.get() + * if result is not waiter: # <<<<<<<<<<<<<< + * raise InvalidSwitchError('Invalid switch into %s: %r (expected %r)' % ( + * getcurrent(), # pylint:disable=undefined-variable + */ + __pyx_t_7 = (__pyx_v_result != ((PyObject *)__pyx_v_waiter)); + __pyx_t_8 = (__pyx_t_7 != 0); + if (unlikely(__pyx_t_8)) { + + /* "src/gevent/_hub_primitives.py":58 + * if result is not waiter: + * raise InvalidSwitchError('Invalid switch into %s: %r (expected %r)' % ( + * getcurrent(), # pylint:disable=undefined-variable # <<<<<<<<<<<<<< + * result, waiter)) + * finally: + */ + __pyx_t_2 = ((PyObject *)__pyx_f_6gevent_16__hub_primitives_getcurrent()); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 58, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_2); + + /* "src/gevent/_hub_primitives.py":59 + * raise InvalidSwitchError('Invalid switch into %s: %r (expected %r)' % ( + * getcurrent(), # pylint:disable=undefined-variable + * result, waiter)) # <<<<<<<<<<<<<< + * finally: + * watcher.stop() + */ + __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 58, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); + __Pyx_INCREF(__pyx_v_result); + __Pyx_GIVEREF(__pyx_v_result); + PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_result); + __Pyx_INCREF(((PyObject *)__pyx_v_waiter)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_waiter)); + PyTuple_SET_ITEM(__pyx_t_6, 2, ((PyObject *)__pyx_v_waiter)); + __pyx_t_2 = 0; + + /* "src/gevent/_hub_primitives.py":57 + * result = waiter.get() + * if result is not waiter: + * raise InvalidSwitchError('Invalid switch into %s: %r (expected %r)' % ( # <<<<<<<<<<<<<< + * getcurrent(), # pylint:disable=undefined-variable + * result, waiter)) + */ + __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_switch_into_s_r_expected, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 57, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_INCREF(__pyx_v_6gevent_16__hub_primitives_InvalidSwitchError); + __pyx_t_6 = __pyx_v_6gevent_16__hub_primitives_InvalidSwitchError; __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_6); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_6, function); + } + } + __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 57, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 57, __pyx_L4_error) + + /* "src/gevent/_hub_primitives.py":56 + * try: + * result = waiter.get() + * if result is not waiter: # <<<<<<<<<<<<<< + * raise InvalidSwitchError('Invalid switch into %s: %r (expected %r)' % ( + * getcurrent(), # pylint:disable=undefined-variable + */ + } + } + + /* "src/gevent/_hub_primitives.py":61 + * result, waiter)) + * finally: + * watcher.stop() # <<<<<<<<<<<<<< + * + * def cancel_wait(self, watcher, error, close_watcher=False): + */ + /*finally:*/ { + /*normal exit:*/{ + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_watcher, __pyx_n_s_stop); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 61, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_2 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { + __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_6); + if (likely(__pyx_t_2)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_6, function); + } + } + __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 61, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L5; + } + __pyx_L4_error:; + /*exception exit:*/{ + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_14, &__pyx_t_15, &__pyx_t_16); + if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13) < 0)) __Pyx_ErrFetch(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13); + __Pyx_XGOTREF(__pyx_t_11); + __Pyx_XGOTREF(__pyx_t_12); + __Pyx_XGOTREF(__pyx_t_13); + __Pyx_XGOTREF(__pyx_t_14); + __Pyx_XGOTREF(__pyx_t_15); + __Pyx_XGOTREF(__pyx_t_16); + __pyx_t_5 = __pyx_lineno; __pyx_t_9 = __pyx_clineno; __pyx_t_10 = __pyx_filename; + { + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_watcher, __pyx_n_s_stop); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 61, __pyx_L8_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_2 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { + __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_6); + if (likely(__pyx_t_2)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_6, function); + } + } + __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 61, __pyx_L8_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + if (PY_MAJOR_VERSION >= 3) { + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_XGIVEREF(__pyx_t_15); + __Pyx_XGIVEREF(__pyx_t_16); + __Pyx_ExceptionReset(__pyx_t_14, __pyx_t_15, __pyx_t_16); + } + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_XGIVEREF(__pyx_t_12); + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_ErrRestore(__pyx_t_11, __pyx_t_12, __pyx_t_13); + __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; + __pyx_lineno = __pyx_t_5; __pyx_clineno = __pyx_t_9; __pyx_filename = __pyx_t_10; + goto __pyx_L1_error; + __pyx_L8_error:; + if (PY_MAJOR_VERSION >= 3) { + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_XGIVEREF(__pyx_t_15); + __Pyx_XGIVEREF(__pyx_t_16); + __Pyx_ExceptionReset(__pyx_t_14, __pyx_t_15, __pyx_t_16); + } + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; + goto __pyx_L1_error; + } + __pyx_L5:; + } + + /* "src/gevent/_hub_primitives.py":46 + * class WaitOperationsGreenlet(SwitchOutGreenletWithLoop): # pylint:disable=undefined-variable + * + * def wait(self, watcher): # <<<<<<<<<<<<<< + * """ + * Wait until the *watcher* (which must not be started) is ready. + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("gevent.__hub_primitives.WaitOperationsGreenlet.wait", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_waiter); + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_16__hub_primitives_22WaitOperationsGreenlet_1wait(PyObject *__pyx_v_self, PyObject *__pyx_v_watcher); /*proto*/ +static char __pyx_doc_6gevent_16__hub_primitives_22WaitOperationsGreenlet_wait[] = "WaitOperationsGreenlet.wait(self, watcher)\n\n Wait until the *watcher* (which must not be started) is ready.\n\n The current greenlet will be unscheduled during this time.\n "; +static PyMethodDef __pyx_mdef_6gevent_16__hub_primitives_22WaitOperationsGreenlet_1wait = {"wait", (PyCFunction)__pyx_pw_6gevent_16__hub_primitives_22WaitOperationsGreenlet_1wait, METH_O, __pyx_doc_6gevent_16__hub_primitives_22WaitOperationsGreenlet_wait}; +static PyObject *__pyx_pw_6gevent_16__hub_primitives_22WaitOperationsGreenlet_1wait(PyObject *__pyx_v_self, PyObject *__pyx_v_watcher) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("wait (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_16__hub_primitives_22WaitOperationsGreenlet_wait(((struct __pyx_obj_6gevent_16__hub_primitives_WaitOperationsGreenlet *)__pyx_v_self), ((PyObject *)__pyx_v_watcher)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_16__hub_primitives_22WaitOperationsGreenlet_wait(struct __pyx_obj_6gevent_16__hub_primitives_WaitOperationsGreenlet *__pyx_v_self, PyObject *__pyx_v_watcher) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("wait", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6gevent_16__hub_primitives_22WaitOperationsGreenlet_wait(__pyx_v_self, __pyx_v_watcher, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 46, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__hub_primitives.WaitOperationsGreenlet.wait", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_hub_primitives.py":63 + * watcher.stop() + * + * def cancel_wait(self, watcher, error, close_watcher=False): # <<<<<<<<<<<<<< + * """ + * Cancel an in-progress call to :meth:`wait` by throwing the given *error* + */ + +static PyObject *__pyx_pw_6gevent_16__hub_primitives_22WaitOperationsGreenlet_3cancel_wait(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_6gevent_16__hub_primitives_22WaitOperationsGreenlet_cancel_wait(struct __pyx_obj_6gevent_16__hub_primitives_WaitOperationsGreenlet *__pyx_v_self, PyObject *__pyx_v_watcher, PyObject *__pyx_v_error, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_16__hub_primitives_22WaitOperationsGreenlet_cancel_wait *__pyx_optional_args) { + PyObject *__pyx_v_close_watcher = ((PyObject *)Py_False); + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + int __pyx_t_8; + __Pyx_RefNannySetupContext("cancel_wait", 0); + if (__pyx_optional_args) { + if (__pyx_optional_args->__pyx_n > 0) { + __pyx_v_close_watcher = __pyx_optional_args->close_watcher; + } + } + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0; + if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self)))))); + else { + PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + #endif + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_cancel_wait); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 63, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_16__hub_primitives_22WaitOperationsGreenlet_3cancel_wait)) { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; + __pyx_t_5 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_5 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_3)) { + PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_watcher, __pyx_v_error, __pyx_v_close_watcher}; + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 63, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GOTREF(__pyx_t_2); + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { + PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_watcher, __pyx_v_error, __pyx_v_close_watcher}; + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 63, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GOTREF(__pyx_t_2); + } else + #endif + { + __pyx_t_6 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 63, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (__pyx_t_4) { + __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL; + } + __Pyx_INCREF(__pyx_v_watcher); + __Pyx_GIVEREF(__pyx_v_watcher); + PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_watcher); + __Pyx_INCREF(__pyx_v_error); + __Pyx_GIVEREF(__pyx_v_error); + PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_error); + __Pyx_INCREF(__pyx_v_close_watcher); + __Pyx_GIVEREF(__pyx_v_close_watcher); + PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_v_close_watcher); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 63, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0; + if (unlikely(type_dict_guard != tp_dict_version)) { + tp_dict_version = obj_dict_version = 0; + } + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + } + #endif + } + + /* "src/gevent/_hub_primitives.py":75 + * Allow the *watcher* to be ``None``. No action is taken in that case. + * """ + * if watcher is None: # <<<<<<<<<<<<<< + * # Presumably already closed. + * # See https://github.com/gevent/gevent/issues/1089 + */ + __pyx_t_7 = (__pyx_v_watcher == Py_None); + __pyx_t_8 = (__pyx_t_7 != 0); + if (__pyx_t_8) { + + /* "src/gevent/_hub_primitives.py":78 + * # Presumably already closed. + * # See https://github.com/gevent/gevent/issues/1089 + * return # <<<<<<<<<<<<<< + * if watcher.callback is not None: + * self.loop.run_callback(self._cancel_wait, watcher, error, close_watcher) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + + /* "src/gevent/_hub_primitives.py":75 + * Allow the *watcher* to be ``None``. No action is taken in that case. + * """ + * if watcher is None: # <<<<<<<<<<<<<< + * # Presumably already closed. + * # See https://github.com/gevent/gevent/issues/1089 + */ + } + + /* "src/gevent/_hub_primitives.py":79 + * # See https://github.com/gevent/gevent/issues/1089 + * return + * if watcher.callback is not None: # <<<<<<<<<<<<<< + * self.loop.run_callback(self._cancel_wait, watcher, error, close_watcher) + * elif close_watcher: + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_watcher, __pyx_n_s_callback); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 79, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_8 = (__pyx_t_1 != Py_None); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_7 = (__pyx_t_8 != 0); + if (__pyx_t_7) { + + /* "src/gevent/_hub_primitives.py":80 + * return + * if watcher.callback is not None: + * self.loop.run_callback(self._cancel_wait, watcher, error, close_watcher) # <<<<<<<<<<<<<< + * elif close_watcher: + * watcher.close() + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->__pyx_base.loop, __pyx_n_s_run_callback); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 80, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_cancel_wait_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 80, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_6 = NULL; + __pyx_t_5 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_6)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_5 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[5] = {__pyx_t_6, __pyx_t_3, __pyx_v_watcher, __pyx_v_error, __pyx_v_close_watcher}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 4+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 80, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[5] = {__pyx_t_6, __pyx_t_3, __pyx_v_watcher, __pyx_v_error, __pyx_v_close_watcher}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 4+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 80, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } else + #endif + { + __pyx_t_4 = PyTuple_New(4+__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 80, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (__pyx_t_6) { + __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6); __pyx_t_6 = NULL; + } + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_5, __pyx_t_3); + __Pyx_INCREF(__pyx_v_watcher); + __Pyx_GIVEREF(__pyx_v_watcher); + PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_5, __pyx_v_watcher); + __Pyx_INCREF(__pyx_v_error); + __Pyx_GIVEREF(__pyx_v_error); + PyTuple_SET_ITEM(__pyx_t_4, 2+__pyx_t_5, __pyx_v_error); + __Pyx_INCREF(__pyx_v_close_watcher); + __Pyx_GIVEREF(__pyx_v_close_watcher); + PyTuple_SET_ITEM(__pyx_t_4, 3+__pyx_t_5, __pyx_v_close_watcher); + __pyx_t_3 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 80, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_hub_primitives.py":79 + * # See https://github.com/gevent/gevent/issues/1089 + * return + * if watcher.callback is not None: # <<<<<<<<<<<<<< + * self.loop.run_callback(self._cancel_wait, watcher, error, close_watcher) + * elif close_watcher: + */ + goto __pyx_L4; + } + + /* "src/gevent/_hub_primitives.py":81 + * if watcher.callback is not None: + * self.loop.run_callback(self._cancel_wait, watcher, error, close_watcher) + * elif close_watcher: # <<<<<<<<<<<<<< + * watcher.close() + * + */ + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_close_watcher); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 81, __pyx_L1_error) + if (__pyx_t_7) { + + /* "src/gevent/_hub_primitives.py":82 + * self.loop.run_callback(self._cancel_wait, watcher, error, close_watcher) + * elif close_watcher: + * watcher.close() # <<<<<<<<<<<<<< + * + * def _cancel_wait(self, watcher, error, close_watcher): + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_watcher, __pyx_n_s_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 82, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 82, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_hub_primitives.py":81 + * if watcher.callback is not None: + * self.loop.run_callback(self._cancel_wait, watcher, error, close_watcher) + * elif close_watcher: # <<<<<<<<<<<<<< + * watcher.close() + * + */ + } + __pyx_L4:; + + /* "src/gevent/_hub_primitives.py":63 + * watcher.stop() + * + * def cancel_wait(self, watcher, error, close_watcher=False): # <<<<<<<<<<<<<< + * """ + * Cancel an in-progress call to :meth:`wait` by throwing the given *error* + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("gevent.__hub_primitives.WaitOperationsGreenlet.cancel_wait", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_16__hub_primitives_22WaitOperationsGreenlet_3cancel_wait(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6gevent_16__hub_primitives_22WaitOperationsGreenlet_2cancel_wait[] = "WaitOperationsGreenlet.cancel_wait(self, watcher, error, close_watcher=False)\n\n Cancel an in-progress call to :meth:`wait` by throwing the given *error*\n in the waiting greenlet.\n\n .. versionchanged:: 1.3a1\n Added the *close_watcher* parameter. If true, the watcher\n will be closed after the exception is thrown. The watcher should then\n be discarded. Closing the watcher is important to release native resources.\n .. versionchanged:: 1.3a2\n Allow the *watcher* to be ``None``. No action is taken in that case.\n "; +static PyMethodDef __pyx_mdef_6gevent_16__hub_primitives_22WaitOperationsGreenlet_3cancel_wait = {"cancel_wait", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_16__hub_primitives_22WaitOperationsGreenlet_3cancel_wait, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_16__hub_primitives_22WaitOperationsGreenlet_2cancel_wait}; +static PyObject *__pyx_pw_6gevent_16__hub_primitives_22WaitOperationsGreenlet_3cancel_wait(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_watcher = 0; + PyObject *__pyx_v_error = 0; + PyObject *__pyx_v_close_watcher = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("cancel_wait (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_watcher,&__pyx_n_s_error,&__pyx_n_s_close_watcher,0}; + PyObject* values[3] = {0,0,0}; + values[2] = ((PyObject *)Py_False); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_watcher)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_error)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("cancel_wait", 0, 2, 3, 1); __PYX_ERR(0, 63, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_close_watcher); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "cancel_wait") < 0)) __PYX_ERR(0, 63, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_watcher = values[0]; + __pyx_v_error = values[1]; + __pyx_v_close_watcher = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("cancel_wait", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 63, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.__hub_primitives.WaitOperationsGreenlet.cancel_wait", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_16__hub_primitives_22WaitOperationsGreenlet_2cancel_wait(((struct __pyx_obj_6gevent_16__hub_primitives_WaitOperationsGreenlet *)__pyx_v_self), __pyx_v_watcher, __pyx_v_error, __pyx_v_close_watcher); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_16__hub_primitives_22WaitOperationsGreenlet_2cancel_wait(struct __pyx_obj_6gevent_16__hub_primitives_WaitOperationsGreenlet *__pyx_v_self, PyObject *__pyx_v_watcher, PyObject *__pyx_v_error, PyObject *__pyx_v_close_watcher) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + struct __pyx_opt_args_6gevent_16__hub_primitives_22WaitOperationsGreenlet_cancel_wait __pyx_t_2; + __Pyx_RefNannySetupContext("cancel_wait", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_2.__pyx_n = 1; + __pyx_t_2.close_watcher = __pyx_v_close_watcher; + __pyx_t_1 = __pyx_vtabptr_6gevent_16__hub_primitives_WaitOperationsGreenlet->cancel_wait(__pyx_v_self, __pyx_v_watcher, __pyx_v_error, 1, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 63, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__hub_primitives.WaitOperationsGreenlet.cancel_wait", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_hub_primitives.py":84 + * watcher.close() + * + * def _cancel_wait(self, watcher, error, close_watcher): # <<<<<<<<<<<<<< + * # We have to check again to see if it was still active by the time + * # our callback actually runs. + */ + +static PyObject *__pyx_pw_6gevent_16__hub_primitives_22WaitOperationsGreenlet_5_cancel_wait(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_6gevent_16__hub_primitives_22WaitOperationsGreenlet__cancel_wait(CYTHON_UNUSED struct __pyx_obj_6gevent_16__hub_primitives_WaitOperationsGreenlet *__pyx_v_self, PyObject *__pyx_v_watcher, PyObject *__pyx_v_error, PyObject *__pyx_v_close_watcher, int __pyx_skip_dispatch) { + PyObject *__pyx_v_active = NULL; + PyObject *__pyx_v_cb = NULL; + PyObject *__pyx_v_glet = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + int __pyx_t_8; + __Pyx_RefNannySetupContext("_cancel_wait", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0; + if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self)))))); + else { + PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + #endif + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_cancel_wait_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 84, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_16__hub_primitives_22WaitOperationsGreenlet_5_cancel_wait)) { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; + __pyx_t_5 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_5 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_3)) { + PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_watcher, __pyx_v_error, __pyx_v_close_watcher}; + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 84, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GOTREF(__pyx_t_2); + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { + PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_watcher, __pyx_v_error, __pyx_v_close_watcher}; + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 84, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GOTREF(__pyx_t_2); + } else + #endif + { + __pyx_t_6 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 84, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (__pyx_t_4) { + __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL; + } + __Pyx_INCREF(__pyx_v_watcher); + __Pyx_GIVEREF(__pyx_v_watcher); + PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_watcher); + __Pyx_INCREF(__pyx_v_error); + __Pyx_GIVEREF(__pyx_v_error); + PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_error); + __Pyx_INCREF(__pyx_v_close_watcher); + __Pyx_GIVEREF(__pyx_v_close_watcher); + PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_v_close_watcher); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 84, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0; + if (unlikely(type_dict_guard != tp_dict_version)) { + tp_dict_version = obj_dict_version = 0; + } + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + } + #endif + } + + /* "src/gevent/_hub_primitives.py":87 + * # We have to check again to see if it was still active by the time + * # our callback actually runs. + * active = watcher.active # <<<<<<<<<<<<<< + * cb = watcher.callback + * if close_watcher: + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_watcher, __pyx_n_s_active); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 87, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_active = __pyx_t_1; + __pyx_t_1 = 0; + + /* "src/gevent/_hub_primitives.py":88 + * # our callback actually runs. + * active = watcher.active + * cb = watcher.callback # <<<<<<<<<<<<<< + * if close_watcher: + * watcher.close() + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_watcher, __pyx_n_s_callback); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 88, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_cb = __pyx_t_1; + __pyx_t_1 = 0; + + /* "src/gevent/_hub_primitives.py":89 + * active = watcher.active + * cb = watcher.callback + * if close_watcher: # <<<<<<<<<<<<<< + * watcher.close() + * if active: + */ + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_close_watcher); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 89, __pyx_L1_error) + if (__pyx_t_7) { + + /* "src/gevent/_hub_primitives.py":90 + * cb = watcher.callback + * if close_watcher: + * watcher.close() # <<<<<<<<<<<<<< + * if active: + * # The callback should be greenlet.switch(). It may or may not be None. + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_watcher, __pyx_n_s_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 90, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 90, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_hub_primitives.py":89 + * active = watcher.active + * cb = watcher.callback + * if close_watcher: # <<<<<<<<<<<<<< + * watcher.close() + * if active: + */ + } + + /* "src/gevent/_hub_primitives.py":91 + * if close_watcher: + * watcher.close() + * if active: # <<<<<<<<<<<<<< + * # The callback should be greenlet.switch(). It may or may not be None. + * glet = getattr(cb, '__self__', None) + */ + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_active); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 91, __pyx_L1_error) + if (__pyx_t_7) { + + /* "src/gevent/_hub_primitives.py":93 + * if active: + * # The callback should be greenlet.switch(). It may or may not be None. + * glet = getattr(cb, '__self__', None) # <<<<<<<<<<<<<< + * if glet is not None: + * glet.throw(error) + */ + __pyx_t_1 = __Pyx_GetAttr3(__pyx_v_cb, __pyx_n_s_self, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 93, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_glet = __pyx_t_1; + __pyx_t_1 = 0; + + /* "src/gevent/_hub_primitives.py":94 + * # The callback should be greenlet.switch(). It may or may not be None. + * glet = getattr(cb, '__self__', None) + * if glet is not None: # <<<<<<<<<<<<<< + * glet.throw(error) + * + */ + __pyx_t_7 = (__pyx_v_glet != Py_None); + __pyx_t_8 = (__pyx_t_7 != 0); + if (__pyx_t_8) { + + /* "src/gevent/_hub_primitives.py":95 + * glet = getattr(cb, '__self__', None) + * if glet is not None: + * glet.throw(error) # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_glet, __pyx_n_s_throw); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 95, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_error) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_error); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 95, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_hub_primitives.py":94 + * # The callback should be greenlet.switch(). It may or may not be None. + * glet = getattr(cb, '__self__', None) + * if glet is not None: # <<<<<<<<<<<<<< + * glet.throw(error) + * + */ + } + + /* "src/gevent/_hub_primitives.py":91 + * if close_watcher: + * watcher.close() + * if active: # <<<<<<<<<<<<<< + * # The callback should be greenlet.switch(). It may or may not be None. + * glet = getattr(cb, '__self__', None) + */ + } + + /* "src/gevent/_hub_primitives.py":84 + * watcher.close() + * + * def _cancel_wait(self, watcher, error, close_watcher): # <<<<<<<<<<<<<< + * # We have to check again to see if it was still active by the time + * # our callback actually runs. + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("gevent.__hub_primitives.WaitOperationsGreenlet._cancel_wait", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_active); + __Pyx_XDECREF(__pyx_v_cb); + __Pyx_XDECREF(__pyx_v_glet); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_16__hub_primitives_22WaitOperationsGreenlet_5_cancel_wait(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6gevent_16__hub_primitives_22WaitOperationsGreenlet_4_cancel_wait[] = "WaitOperationsGreenlet._cancel_wait(self, watcher, error, close_watcher)"; +static PyMethodDef __pyx_mdef_6gevent_16__hub_primitives_22WaitOperationsGreenlet_5_cancel_wait = {"_cancel_wait", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_16__hub_primitives_22WaitOperationsGreenlet_5_cancel_wait, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_16__hub_primitives_22WaitOperationsGreenlet_4_cancel_wait}; +static PyObject *__pyx_pw_6gevent_16__hub_primitives_22WaitOperationsGreenlet_5_cancel_wait(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_watcher = 0; + PyObject *__pyx_v_error = 0; + PyObject *__pyx_v_close_watcher = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_cancel_wait (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_watcher,&__pyx_n_s_error,&__pyx_n_s_close_watcher,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_watcher)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_error)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("_cancel_wait", 1, 3, 3, 1); __PYX_ERR(0, 84, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_close_watcher)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("_cancel_wait", 1, 3, 3, 2); __PYX_ERR(0, 84, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_cancel_wait") < 0)) __PYX_ERR(0, 84, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + } + __pyx_v_watcher = values[0]; + __pyx_v_error = values[1]; + __pyx_v_close_watcher = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("_cancel_wait", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 84, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.__hub_primitives.WaitOperationsGreenlet._cancel_wait", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_16__hub_primitives_22WaitOperationsGreenlet_4_cancel_wait(((struct __pyx_obj_6gevent_16__hub_primitives_WaitOperationsGreenlet *)__pyx_v_self), __pyx_v_watcher, __pyx_v_error, __pyx_v_close_watcher); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_16__hub_primitives_22WaitOperationsGreenlet_4_cancel_wait(struct __pyx_obj_6gevent_16__hub_primitives_WaitOperationsGreenlet *__pyx_v_self, PyObject *__pyx_v_watcher, PyObject *__pyx_v_error, PyObject *__pyx_v_close_watcher) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("_cancel_wait", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6gevent_16__hub_primitives_22WaitOperationsGreenlet__cancel_wait(__pyx_v_self, __pyx_v_watcher, __pyx_v_error, __pyx_v_close_watcher, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 84, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__hub_primitives.WaitOperationsGreenlet._cancel_wait", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_hub_primitives.py":100 + * class _WaitIterator(object): + * + * def __init__(self, objects, hub, timeout, count): # <<<<<<<<<<<<<< + * self._hub = hub + * self._waiter = MultipleWaiter(hub) # pylint:disable=undefined-variable + */ + +/* Python wrapper */ +static int __pyx_pw_6gevent_16__hub_primitives_13_WaitIterator_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6gevent_16__hub_primitives_13_WaitIterator_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_objects = 0; + PyObject *__pyx_v_hub = 0; + PyObject *__pyx_v_timeout = 0; + PyObject *__pyx_v_count = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_objects,&__pyx_n_s_hub,&__pyx_n_s_timeout,&__pyx_n_s_count,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_objects)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_hub)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, 1); __PYX_ERR(0, 100, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_timeout)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, 2); __PYX_ERR(0, 100, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 3: + if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_count)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, 3); __PYX_ERR(0, 100, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 100, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_objects = values[0]; + __pyx_v_hub = values[1]; + __pyx_v_timeout = values[2]; + __pyx_v_count = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 100, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.__hub_primitives._WaitIterator.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_16__hub_primitives_13_WaitIterator___init__(((struct __pyx_obj_6gevent_16__hub_primitives__WaitIterator *)__pyx_v_self), __pyx_v_objects, __pyx_v_hub, __pyx_v_timeout, __pyx_v_count); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_16__hub_primitives_13_WaitIterator___init__(struct __pyx_obj_6gevent_16__hub_primitives__WaitIterator *__pyx_v_self, PyObject *__pyx_v_objects, PyObject *__pyx_v_hub, PyObject *__pyx_v_timeout, PyObject *__pyx_v_count) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + int __pyx_t_3; + Py_ssize_t __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + int __pyx_t_8; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "src/gevent/_hub_primitives.py":101 + * + * def __init__(self, objects, hub, timeout, count): + * self._hub = hub # <<<<<<<<<<<<<< + * self._waiter = MultipleWaiter(hub) # pylint:disable=undefined-variable + * self._switch = self._waiter.switch + */ + if (!(likely(((__pyx_v_hub) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_hub, __pyx_ptype_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop))))) __PYX_ERR(0, 101, __pyx_L1_error) + __pyx_t_1 = __pyx_v_hub; + __Pyx_INCREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_self->_hub); + __Pyx_DECREF(((PyObject *)__pyx_v_self->_hub)); + __pyx_v_self->_hub = ((struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "src/gevent/_hub_primitives.py":102 + * def __init__(self, objects, hub, timeout, count): + * self._hub = hub + * self._waiter = MultipleWaiter(hub) # pylint:disable=undefined-variable # <<<<<<<<<<<<<< + * self._switch = self._waiter.switch + * self._timeout = timeout + */ + __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_6gevent_8__waiter_MultipleWaiter), __pyx_v_hub); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 102, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_self->_waiter); + __Pyx_DECREF(((PyObject *)__pyx_v_self->_waiter)); + __pyx_v_self->_waiter = ((struct __pyx_obj_6gevent_8__waiter_MultipleWaiter *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "src/gevent/_hub_primitives.py":103 + * self._hub = hub + * self._waiter = MultipleWaiter(hub) # pylint:disable=undefined-variable + * self._switch = self._waiter.switch # <<<<<<<<<<<<<< + * self._timeout = timeout + * self._objects = objects + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->_waiter), __pyx_n_s_switch); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 103, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_self->_switch); + __Pyx_DECREF(__pyx_v_self->_switch); + __pyx_v_self->_switch = __pyx_t_1; + __pyx_t_1 = 0; + + /* "src/gevent/_hub_primitives.py":104 + * self._waiter = MultipleWaiter(hub) # pylint:disable=undefined-variable + * self._switch = self._waiter.switch + * self._timeout = timeout # <<<<<<<<<<<<<< + * self._objects = objects + * + */ + __Pyx_INCREF(__pyx_v_timeout); + __Pyx_GIVEREF(__pyx_v_timeout); + __Pyx_GOTREF(__pyx_v_self->_timeout); + __Pyx_DECREF(__pyx_v_self->_timeout); + __pyx_v_self->_timeout = __pyx_v_timeout; + + /* "src/gevent/_hub_primitives.py":105 + * self._switch = self._waiter.switch + * self._timeout = timeout + * self._objects = objects # <<<<<<<<<<<<<< + * + * self._timer = None + */ + __Pyx_INCREF(__pyx_v_objects); + __Pyx_GIVEREF(__pyx_v_objects); + __Pyx_GOTREF(__pyx_v_self->_objects); + __Pyx_DECREF(__pyx_v_self->_objects); + __pyx_v_self->_objects = __pyx_v_objects; + + /* "src/gevent/_hub_primitives.py":107 + * self._objects = objects + * + * self._timer = None # <<<<<<<<<<<<<< + * self._begun = False + * + */ + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->_timer); + __Pyx_DECREF(__pyx_v_self->_timer); + __pyx_v_self->_timer = Py_None; + + /* "src/gevent/_hub_primitives.py":108 + * + * self._timer = None + * self._begun = False # <<<<<<<<<<<<<< + * + * # Even if we're only going to return 1 object, + */ + __pyx_v_self->_begun = 0; + + /* "src/gevent/_hub_primitives.py":113 + * # we must still rawlink() *all* of them, so that no + * # matter which one finishes first we find it. + * self._count = len(objects) if count is None else min(count, len(objects)) # <<<<<<<<<<<<<< + * + * def _begin(self): + */ + __pyx_t_3 = (__pyx_v_count == Py_None); + if ((__pyx_t_3 != 0)) { + __pyx_t_4 = PyObject_Length(__pyx_v_objects); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 113, __pyx_L1_error) + __pyx_t_2 = __pyx_t_4; + } else { + __pyx_t_4 = PyObject_Length(__pyx_v_objects); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 113, __pyx_L1_error) + __Pyx_INCREF(__pyx_v_count); + __pyx_t_1 = __pyx_v_count; + __pyx_t_6 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 113, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = PyObject_RichCompare(__pyx_t_6, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 113, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 113, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (__pyx_t_8) { + __pyx_t_7 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 113, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_5 = __pyx_t_7; + __pyx_t_7 = 0; + } else { + __Pyx_INCREF(__pyx_t_1); + __pyx_t_5 = __pyx_t_1; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_4 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_4 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 113, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_2 = __pyx_t_4; + } + __pyx_v_self->_count = __pyx_t_2; + + /* "src/gevent/_hub_primitives.py":100 + * class _WaitIterator(object): + * + * def __init__(self, objects, hub, timeout, count): # <<<<<<<<<<<<<< + * self._hub = hub + * self._waiter = MultipleWaiter(hub) # pylint:disable=undefined-variable + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("gevent.__hub_primitives._WaitIterator.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_hub_primitives.py":115 + * self._count = len(objects) if count is None else min(count, len(objects)) + * + * def _begin(self): # <<<<<<<<<<<<<< + * if self._begun: + * return + */ + +static PyObject *__pyx_f_6gevent_16__hub_primitives_13_WaitIterator__begin(struct __pyx_obj_6gevent_16__hub_primitives__WaitIterator *__pyx_v_self) { + PyObject *__pyx_v_obj = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + PyObject *(*__pyx_t_4)(PyObject *); + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + int __pyx_t_8; + int __pyx_t_9; + __Pyx_RefNannySetupContext("_begin", 0); + + /* "src/gevent/_hub_primitives.py":116 + * + * def _begin(self): + * if self._begun: # <<<<<<<<<<<<<< + * return + * + */ + __pyx_t_1 = (__pyx_v_self->_begun != 0); + if (__pyx_t_1) { + + /* "src/gevent/_hub_primitives.py":117 + * def _begin(self): + * if self._begun: + * return # <<<<<<<<<<<<<< + * + * self._begun = True + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + + /* "src/gevent/_hub_primitives.py":116 + * + * def _begin(self): + * if self._begun: # <<<<<<<<<<<<<< + * return + * + */ + } + + /* "src/gevent/_hub_primitives.py":119 + * return + * + * self._begun = True # <<<<<<<<<<<<<< + * + * # XXX: If iteration doesn't actually happen, we + */ + __pyx_v_self->_begun = 1; + + /* "src/gevent/_hub_primitives.py":123 + * # XXX: If iteration doesn't actually happen, we + * # could leave these links around! + * for obj in self._objects: # <<<<<<<<<<<<<< + * obj.rawlink(self._switch) + * + */ + if (likely(PyList_CheckExact(__pyx_v_self->_objects)) || PyTuple_CheckExact(__pyx_v_self->_objects)) { + __pyx_t_2 = __pyx_v_self->_objects; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; + __pyx_t_4 = NULL; + } else { + __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_self->_objects); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 123, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 123, __pyx_L1_error) + } + for (;;) { + if (likely(!__pyx_t_4)) { + if (likely(PyList_CheckExact(__pyx_t_2))) { + if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 123, __pyx_L1_error) + #else + __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 123, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + #endif + } else { + if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 123, __pyx_L1_error) + #else + __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 123, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + #endif + } + } else { + __pyx_t_5 = __pyx_t_4(__pyx_t_2); + if (unlikely(!__pyx_t_5)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(0, 123, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_5); + } + __Pyx_XDECREF_SET(__pyx_v_obj, __pyx_t_5); + __pyx_t_5 = 0; + + /* "src/gevent/_hub_primitives.py":124 + * # could leave these links around! + * for obj in self._objects: + * obj.rawlink(self._switch) # <<<<<<<<<<<<<< + * + * if self._timeout is not None: + */ + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_rawlink); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 124, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { + __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); + if (likely(__pyx_t_7)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); + __Pyx_INCREF(__pyx_t_7); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_6, function); + } + } + __pyx_t_5 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_v_self->_switch) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_self->_switch); + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 124, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "src/gevent/_hub_primitives.py":123 + * # XXX: If iteration doesn't actually happen, we + * # could leave these links around! + * for obj in self._objects: # <<<<<<<<<<<<<< + * obj.rawlink(self._switch) + * + */ + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/_hub_primitives.py":126 + * obj.rawlink(self._switch) + * + * if self._timeout is not None: # <<<<<<<<<<<<<< + * self._timer = self._hub.loop.timer(self._timeout, priority=-1) + * self._timer.start(self._switch, self) + */ + __pyx_t_1 = (__pyx_v_self->_timeout != Py_None); + __pyx_t_8 = (__pyx_t_1 != 0); + if (__pyx_t_8) { + + /* "src/gevent/_hub_primitives.py":127 + * + * if self._timeout is not None: + * self._timer = self._hub.loop.timer(self._timeout, priority=-1) # <<<<<<<<<<<<<< + * self._timer.start(self._switch, self) + * + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_hub->loop, __pyx_n_s_timer); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 127, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 127, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_self->_timeout); + __Pyx_GIVEREF(__pyx_v_self->_timeout); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_self->_timeout); + __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 127, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_priority, __pyx_int_neg_1) < 0) __PYX_ERR(0, 127, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 127, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_GIVEREF(__pyx_t_7); + __Pyx_GOTREF(__pyx_v_self->_timer); + __Pyx_DECREF(__pyx_v_self->_timer); + __pyx_v_self->_timer = __pyx_t_7; + __pyx_t_7 = 0; + + /* "src/gevent/_hub_primitives.py":128 + * if self._timeout is not None: + * self._timer = self._hub.loop.timer(self._timeout, priority=-1) + * self._timer.start(self._switch, self) # <<<<<<<<<<<<<< + * + * def __iter__(self): + */ + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_timer, __pyx_n_s_start); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 128, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_5 = NULL; + __pyx_t_9 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_6, function); + __pyx_t_9 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_6)) { + PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_self->_switch, ((PyObject *)__pyx_v_self)}; + __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 128, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_t_7); + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) { + PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_self->_switch, ((PyObject *)__pyx_v_self)}; + __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 128, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_t_7); + } else + #endif + { + __pyx_t_2 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 128, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (__pyx_t_5) { + __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5); __pyx_t_5 = NULL; + } + __Pyx_INCREF(__pyx_v_self->_switch); + __Pyx_GIVEREF(__pyx_v_self->_switch); + PyTuple_SET_ITEM(__pyx_t_2, 0+__pyx_t_9, __pyx_v_self->_switch); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_2, 1+__pyx_t_9, ((PyObject *)__pyx_v_self)); + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_2, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 128, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "src/gevent/_hub_primitives.py":126 + * obj.rawlink(self._switch) + * + * if self._timeout is not None: # <<<<<<<<<<<<<< + * self._timer = self._hub.loop.timer(self._timeout, priority=-1) + * self._timer.start(self._switch, self) + */ + } + + /* "src/gevent/_hub_primitives.py":115 + * self._count = len(objects) if count is None else min(count, len(objects)) + * + * def _begin(self): # <<<<<<<<<<<<<< + * if self._begun: + * return + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("gevent.__hub_primitives._WaitIterator._begin", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_obj); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_hub_primitives.py":130 + * self._timer.start(self._switch, self) + * + * def __iter__(self): # <<<<<<<<<<<<<< + * return self + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_16__hub_primitives_13_WaitIterator_3__iter__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_16__hub_primitives_13_WaitIterator_3__iter__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_16__hub_primitives_13_WaitIterator_2__iter__(((struct __pyx_obj_6gevent_16__hub_primitives__WaitIterator *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_16__hub_primitives_13_WaitIterator_2__iter__(struct __pyx_obj_6gevent_16__hub_primitives__WaitIterator *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__iter__", 0); + + /* "src/gevent/_hub_primitives.py":131 + * + * def __iter__(self): + * return self # <<<<<<<<<<<<<< + * + * def __next__(self): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __pyx_r = ((PyObject *)__pyx_v_self); + goto __pyx_L0; + + /* "src/gevent/_hub_primitives.py":130 + * self._timer.start(self._switch, self) + * + * def __iter__(self): # <<<<<<<<<<<<<< + * return self + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_hub_primitives.py":133 + * return self + * + * def __next__(self): # <<<<<<<<<<<<<< + * self._begin() + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_16__hub_primitives_13_WaitIterator_5__next__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_16__hub_primitives_13_WaitIterator_5__next__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__next__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_16__hub_primitives_13_WaitIterator_4__next__(((struct __pyx_obj_6gevent_16__hub_primitives__WaitIterator *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_16__hub_primitives_13_WaitIterator_4__next__(struct __pyx_obj_6gevent_16__hub_primitives__WaitIterator *__pyx_v_self) { + PyObject *__pyx_v_item = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + __Pyx_RefNannySetupContext("__next__", 0); + + /* "src/gevent/_hub_primitives.py":134 + * + * def __next__(self): + * self._begin() # <<<<<<<<<<<<<< + * + * if self._count == 0: + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_16__hub_primitives__WaitIterator *)__pyx_v_self->__pyx_vtab)->_begin(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 134, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_hub_primitives.py":136 + * self._begin() + * + * if self._count == 0: # <<<<<<<<<<<<<< + * # Exhausted + * self._cleanup() + */ + __pyx_t_2 = ((__pyx_v_self->_count == 0) != 0); + if (unlikely(__pyx_t_2)) { + + /* "src/gevent/_hub_primitives.py":138 + * if self._count == 0: + * # Exhausted + * self._cleanup() # <<<<<<<<<<<<<< + * raise StopIteration() + * + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_16__hub_primitives__WaitIterator *)__pyx_v_self->__pyx_vtab)->_cleanup(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 138, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_hub_primitives.py":139 + * # Exhausted + * self._cleanup() + * raise StopIteration() # <<<<<<<<<<<<<< + * + * self._count -= 1 + */ + __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_builtin_StopIteration); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 139, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 139, __pyx_L1_error) + + /* "src/gevent/_hub_primitives.py":136 + * self._begin() + * + * if self._count == 0: # <<<<<<<<<<<<<< + * # Exhausted + * self._cleanup() + */ + } + + /* "src/gevent/_hub_primitives.py":141 + * raise StopIteration() + * + * self._count -= 1 # <<<<<<<<<<<<<< + * try: + * item = self._waiter.get() + */ + __pyx_v_self->_count = (__pyx_v_self->_count - 1); + + /* "src/gevent/_hub_primitives.py":142 + * + * self._count -= 1 + * try: # <<<<<<<<<<<<<< + * item = self._waiter.get() + * self._waiter.clear() + */ + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5); + __Pyx_XGOTREF(__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_4); + __Pyx_XGOTREF(__pyx_t_5); + /*try:*/ { + + /* "src/gevent/_hub_primitives.py":143 + * self._count -= 1 + * try: + * item = self._waiter.get() # <<<<<<<<<<<<<< + * self._waiter.clear() + * if item is self: + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_8__waiter_MultipleWaiter *)__pyx_v_self->_waiter->__pyx_base.__pyx_vtab)->__pyx_base.get(((struct __pyx_obj_6gevent_8__waiter_Waiter *)__pyx_v_self->_waiter), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 143, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_item = __pyx_t_1; + __pyx_t_1 = 0; + + /* "src/gevent/_hub_primitives.py":144 + * try: + * item = self._waiter.get() + * self._waiter.clear() # <<<<<<<<<<<<<< + * if item is self: + * # Timer expired, no more + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_8__waiter_MultipleWaiter *)__pyx_v_self->_waiter->__pyx_base.__pyx_vtab)->__pyx_base.clear(((struct __pyx_obj_6gevent_8__waiter_Waiter *)__pyx_v_self->_waiter), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 144, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_hub_primitives.py":145 + * item = self._waiter.get() + * self._waiter.clear() + * if item is self: # <<<<<<<<<<<<<< + * # Timer expired, no more + * self._cleanup() + */ + __pyx_t_2 = (__pyx_v_item == ((PyObject *)__pyx_v_self)); + __pyx_t_6 = (__pyx_t_2 != 0); + if (unlikely(__pyx_t_6)) { + + /* "src/gevent/_hub_primitives.py":147 + * if item is self: + * # Timer expired, no more + * self._cleanup() # <<<<<<<<<<<<<< + * raise StopIteration() + * return item + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_16__hub_primitives__WaitIterator *)__pyx_v_self->__pyx_vtab)->_cleanup(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 147, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_hub_primitives.py":148 + * # Timer expired, no more + * self._cleanup() + * raise StopIteration() # <<<<<<<<<<<<<< + * return item + * except: + */ + __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_builtin_StopIteration); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 148, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 148, __pyx_L4_error) + + /* "src/gevent/_hub_primitives.py":145 + * item = self._waiter.get() + * self._waiter.clear() + * if item is self: # <<<<<<<<<<<<<< + * # Timer expired, no more + * self._cleanup() + */ + } + + /* "src/gevent/_hub_primitives.py":149 + * self._cleanup() + * raise StopIteration() + * return item # <<<<<<<<<<<<<< + * except: + * self._cleanup() + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_item); + __pyx_r = __pyx_v_item; + goto __pyx_L8_try_return; + + /* "src/gevent/_hub_primitives.py":142 + * + * self._count -= 1 + * try: # <<<<<<<<<<<<<< + * item = self._waiter.get() + * self._waiter.clear() + */ + } + __pyx_L4_error:; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_hub_primitives.py":150 + * raise StopIteration() + * return item + * except: # <<<<<<<<<<<<<< + * self._cleanup() + * raise + */ + /*except:*/ { + __Pyx_AddTraceback("gevent.__hub_primitives._WaitIterator.__next__", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(0, 150, __pyx_L6_except_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GOTREF(__pyx_t_8); + + /* "src/gevent/_hub_primitives.py":151 + * return item + * except: + * self._cleanup() # <<<<<<<<<<<<<< + * raise + * + */ + __pyx_t_9 = ((struct __pyx_vtabstruct_6gevent_16__hub_primitives__WaitIterator *)__pyx_v_self->__pyx_vtab)->_cleanup(__pyx_v_self); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 151, __pyx_L6_except_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "src/gevent/_hub_primitives.py":152 + * except: + * self._cleanup() + * raise # <<<<<<<<<<<<<< + * + * next = __next__ + */ + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_7); + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_ErrRestoreWithState(__pyx_t_1, __pyx_t_7, __pyx_t_8); + __pyx_t_1 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; + __PYX_ERR(0, 152, __pyx_L6_except_error) + } + __pyx_L6_except_error:; + + /* "src/gevent/_hub_primitives.py":142 + * + * self._count -= 1 + * try: # <<<<<<<<<<<<<< + * item = self._waiter.get() + * self._waiter.clear() + */ + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); + goto __pyx_L1_error; + __pyx_L8_try_return:; + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); + goto __pyx_L0; + } + + /* "src/gevent/_hub_primitives.py":133 + * return self + * + * def __next__(self): # <<<<<<<<<<<<<< + * self._begin() + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_AddTraceback("gevent.__hub_primitives._WaitIterator.__next__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_item); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_hub_primitives.py":156 + * next = __next__ + * + * def _cleanup(self): # <<<<<<<<<<<<<< + * if self._timer is not None: + * self._timer.close() + */ + +static PyObject *__pyx_f_6gevent_16__hub_primitives_13_WaitIterator__cleanup(struct __pyx_obj_6gevent_16__hub_primitives__WaitIterator *__pyx_v_self) { + PyObject *__pyx_v_objs = NULL; + PyObject *__pyx_v_aobj = NULL; + PyObject *__pyx_v_unlink = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + Py_ssize_t __pyx_t_6; + PyObject *(*__pyx_t_7)(PyObject *); + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + PyObject *__pyx_t_14 = NULL; + __Pyx_RefNannySetupContext("_cleanup", 0); + + /* "src/gevent/_hub_primitives.py":157 + * + * def _cleanup(self): + * if self._timer is not None: # <<<<<<<<<<<<<< + * self._timer.close() + * self._timer = None + */ + __pyx_t_1 = (__pyx_v_self->_timer != Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "src/gevent/_hub_primitives.py":158 + * def _cleanup(self): + * if self._timer is not None: + * self._timer.close() # <<<<<<<<<<<<<< + * self._timer = None + * + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_timer, __pyx_n_s_close); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 158, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + } + } + __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 158, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "src/gevent/_hub_primitives.py":159 + * if self._timer is not None: + * self._timer.close() + * self._timer = None # <<<<<<<<<<<<<< + * + * objs = self._objects + */ + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->_timer); + __Pyx_DECREF(__pyx_v_self->_timer); + __pyx_v_self->_timer = Py_None; + + /* "src/gevent/_hub_primitives.py":157 + * + * def _cleanup(self): + * if self._timer is not None: # <<<<<<<<<<<<<< + * self._timer.close() + * self._timer = None + */ + } + + /* "src/gevent/_hub_primitives.py":161 + * self._timer = None + * + * objs = self._objects # <<<<<<<<<<<<<< + * self._objects = () + * for aobj in objs: + */ + __pyx_t_3 = __pyx_v_self->_objects; + __Pyx_INCREF(__pyx_t_3); + __pyx_v_objs = __pyx_t_3; + __pyx_t_3 = 0; + + /* "src/gevent/_hub_primitives.py":162 + * + * objs = self._objects + * self._objects = () # <<<<<<<<<<<<<< + * for aobj in objs: + * unlink = getattr(aobj, 'unlink', None) + */ + __Pyx_INCREF(__pyx_empty_tuple); + __Pyx_GIVEREF(__pyx_empty_tuple); + __Pyx_GOTREF(__pyx_v_self->_objects); + __Pyx_DECREF(__pyx_v_self->_objects); + __pyx_v_self->_objects = __pyx_empty_tuple; + + /* "src/gevent/_hub_primitives.py":163 + * objs = self._objects + * self._objects = () + * for aobj in objs: # <<<<<<<<<<<<<< + * unlink = getattr(aobj, 'unlink', None) + * if unlink is not None: + */ + if (likely(PyList_CheckExact(__pyx_v_objs)) || PyTuple_CheckExact(__pyx_v_objs)) { + __pyx_t_3 = __pyx_v_objs; __Pyx_INCREF(__pyx_t_3); __pyx_t_6 = 0; + __pyx_t_7 = NULL; + } else { + __pyx_t_6 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_objs); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 163, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_7 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 163, __pyx_L1_error) + } + for (;;) { + if (likely(!__pyx_t_7)) { + if (likely(PyList_CheckExact(__pyx_t_3))) { + if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_4); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 163, __pyx_L1_error) + #else + __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 163, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + } else { + if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_4); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 163, __pyx_L1_error) + #else + __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 163, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + } + } else { + __pyx_t_4 = __pyx_t_7(__pyx_t_3); + if (unlikely(!__pyx_t_4)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(0, 163, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_4); + } + __Pyx_XDECREF_SET(__pyx_v_aobj, __pyx_t_4); + __pyx_t_4 = 0; + + /* "src/gevent/_hub_primitives.py":164 + * self._objects = () + * for aobj in objs: + * unlink = getattr(aobj, 'unlink', None) # <<<<<<<<<<<<<< + * if unlink is not None: + * try: + */ + __pyx_t_4 = __Pyx_GetAttr3(__pyx_v_aobj, __pyx_n_s_unlink, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 164, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_XDECREF_SET(__pyx_v_unlink, __pyx_t_4); + __pyx_t_4 = 0; + + /* "src/gevent/_hub_primitives.py":165 + * for aobj in objs: + * unlink = getattr(aobj, 'unlink', None) + * if unlink is not None: # <<<<<<<<<<<<<< + * try: + * unlink(self._switch) + */ + __pyx_t_2 = (__pyx_v_unlink != Py_None); + __pyx_t_1 = (__pyx_t_2 != 0); + if (__pyx_t_1) { + + /* "src/gevent/_hub_primitives.py":166 + * unlink = getattr(aobj, 'unlink', None) + * if unlink is not None: + * try: # <<<<<<<<<<<<<< + * unlink(self._switch) + * except: # pylint:disable=bare-except + */ + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); + __Pyx_XGOTREF(__pyx_t_8); + __Pyx_XGOTREF(__pyx_t_9); + __Pyx_XGOTREF(__pyx_t_10); + /*try:*/ { + + /* "src/gevent/_hub_primitives.py":167 + * if unlink is not None: + * try: + * unlink(self._switch) # <<<<<<<<<<<<<< + * except: # pylint:disable=bare-except + * traceback.print_exc() + */ + __Pyx_INCREF(__pyx_v_unlink); + __pyx_t_5 = __pyx_v_unlink; __pyx_t_11 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_5); + if (likely(__pyx_t_11)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_11); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_5, function); + } + } + __pyx_t_4 = (__pyx_t_11) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_11, __pyx_v_self->_switch) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_self->_switch); + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 167, __pyx_L7_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "src/gevent/_hub_primitives.py":166 + * unlink = getattr(aobj, 'unlink', None) + * if unlink is not None: + * try: # <<<<<<<<<<<<<< + * unlink(self._switch) + * except: # pylint:disable=bare-except + */ + } + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + goto __pyx_L14_try_end; + __pyx_L7_error:; + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "src/gevent/_hub_primitives.py":168 + * try: + * unlink(self._switch) + * except: # pylint:disable=bare-except # <<<<<<<<<<<<<< + * traceback.print_exc() + * + */ + /*except:*/ { + __Pyx_AddTraceback("gevent.__hub_primitives._WaitIterator._cleanup", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_5, &__pyx_t_11) < 0) __PYX_ERR(0, 168, __pyx_L9_except_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_11); + + /* "src/gevent/_hub_primitives.py":169 + * unlink(self._switch) + * except: # pylint:disable=bare-except + * traceback.print_exc() # <<<<<<<<<<<<<< + * + * def __enter__(self): + */ + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_6gevent_16__hub_primitives_traceback, __pyx_n_s_print_exc); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 169, __pyx_L9_except_error) + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_14 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_13))) { + __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_13); + if (likely(__pyx_t_14)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13); + __Pyx_INCREF(__pyx_t_14); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_13, function); + } + } + __pyx_t_12 = (__pyx_t_14) ? __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_t_14) : __Pyx_PyObject_CallNoArg(__pyx_t_13); + __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; + if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 169, __pyx_L9_except_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + goto __pyx_L8_exception_handled; + } + __pyx_L9_except_error:; + + /* "src/gevent/_hub_primitives.py":166 + * unlink = getattr(aobj, 'unlink', None) + * if unlink is not None: + * try: # <<<<<<<<<<<<<< + * unlink(self._switch) + * except: # pylint:disable=bare-except + */ + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10); + goto __pyx_L1_error; + __pyx_L8_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10); + __pyx_L14_try_end:; + } + + /* "src/gevent/_hub_primitives.py":165 + * for aobj in objs: + * unlink = getattr(aobj, 'unlink', None) + * if unlink is not None: # <<<<<<<<<<<<<< + * try: + * unlink(self._switch) + */ + } + + /* "src/gevent/_hub_primitives.py":163 + * objs = self._objects + * self._objects = () + * for aobj in objs: # <<<<<<<<<<<<<< + * unlink = getattr(aobj, 'unlink', None) + * if unlink is not None: + */ + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "src/gevent/_hub_primitives.py":156 + * next = __next__ + * + * def _cleanup(self): # <<<<<<<<<<<<<< + * if self._timer is not None: + * self._timer.close() + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_XDECREF(__pyx_t_13); + __Pyx_XDECREF(__pyx_t_14); + __Pyx_AddTraceback("gevent.__hub_primitives._WaitIterator._cleanup", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_objs); + __Pyx_XDECREF(__pyx_v_aobj); + __Pyx_XDECREF(__pyx_v_unlink); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_hub_primitives.py":171 + * traceback.print_exc() + * + * def __enter__(self): # <<<<<<<<<<<<<< + * return self + * + */ + +static PyObject *__pyx_pw_6gevent_16__hub_primitives_13_WaitIterator_7__enter__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_f_6gevent_16__hub_primitives_13_WaitIterator___enter__(struct __pyx_obj_6gevent_16__hub_primitives__WaitIterator *__pyx_v_self, int __pyx_skip_dispatch) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + __Pyx_RefNannySetupContext("__enter__", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0; + if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self)))))); + else { + PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + #endif + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_enter); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 171, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_16__hub_primitives_13_WaitIterator_7__enter__)) { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 171, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0; + if (unlikely(type_dict_guard != tp_dict_version)) { + tp_dict_version = obj_dict_version = 0; + } + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + } + #endif + } + + /* "src/gevent/_hub_primitives.py":172 + * + * def __enter__(self): + * return self # <<<<<<<<<<<<<< + * + * def __exit__(self, typ, value, tb): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __pyx_r = ((PyObject *)__pyx_v_self); + goto __pyx_L0; + + /* "src/gevent/_hub_primitives.py":171 + * traceback.print_exc() + * + * def __enter__(self): # <<<<<<<<<<<<<< + * return self + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("gevent.__hub_primitives._WaitIterator.__enter__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_16__hub_primitives_13_WaitIterator_7__enter__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6gevent_16__hub_primitives_13_WaitIterator_6__enter__[] = "_WaitIterator.__enter__(self)"; +static PyMethodDef __pyx_mdef_6gevent_16__hub_primitives_13_WaitIterator_7__enter__ = {"__enter__", (PyCFunction)__pyx_pw_6gevent_16__hub_primitives_13_WaitIterator_7__enter__, METH_NOARGS, __pyx_doc_6gevent_16__hub_primitives_13_WaitIterator_6__enter__}; +static PyObject *__pyx_pw_6gevent_16__hub_primitives_13_WaitIterator_7__enter__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__enter__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_16__hub_primitives_13_WaitIterator_6__enter__(((struct __pyx_obj_6gevent_16__hub_primitives__WaitIterator *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_16__hub_primitives_13_WaitIterator_6__enter__(struct __pyx_obj_6gevent_16__hub_primitives__WaitIterator *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__enter__", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6gevent_16__hub_primitives_13_WaitIterator___enter__(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 171, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__hub_primitives._WaitIterator.__enter__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_hub_primitives.py":174 + * return self + * + * def __exit__(self, typ, value, tb): # <<<<<<<<<<<<<< + * self._cleanup() + * + */ + +static PyObject *__pyx_pw_6gevent_16__hub_primitives_13_WaitIterator_9__exit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_6gevent_16__hub_primitives_13_WaitIterator___exit__(struct __pyx_obj_6gevent_16__hub_primitives__WaitIterator *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_typ, CYTHON_UNUSED PyObject *__pyx_v_value, CYTHON_UNUSED PyObject *__pyx_v_tb, int __pyx_skip_dispatch) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + __Pyx_RefNannySetupContext("__exit__", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0; + if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self)))))); + else { + PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + #endif + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_exit); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 174, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_16__hub_primitives_13_WaitIterator_9__exit__)) { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; + __pyx_t_5 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_5 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_3)) { + PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_typ, __pyx_v_value, __pyx_v_tb}; + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 174, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GOTREF(__pyx_t_2); + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { + PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_typ, __pyx_v_value, __pyx_v_tb}; + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 174, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GOTREF(__pyx_t_2); + } else + #endif + { + __pyx_t_6 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 174, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (__pyx_t_4) { + __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL; + } + __Pyx_INCREF(__pyx_v_typ); + __Pyx_GIVEREF(__pyx_v_typ); + PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_typ); + __Pyx_INCREF(__pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_value); + __Pyx_INCREF(__pyx_v_tb); + __Pyx_GIVEREF(__pyx_v_tb); + PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_v_tb); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 174, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0; + if (unlikely(type_dict_guard != tp_dict_version)) { + tp_dict_version = obj_dict_version = 0; + } + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + } + #endif + } + + /* "src/gevent/_hub_primitives.py":175 + * + * def __exit__(self, typ, value, tb): + * self._cleanup() # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_16__hub_primitives__WaitIterator *)__pyx_v_self->__pyx_vtab)->_cleanup(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 175, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_hub_primitives.py":174 + * return self + * + * def __exit__(self, typ, value, tb): # <<<<<<<<<<<<<< + * self._cleanup() + * + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("gevent.__hub_primitives._WaitIterator.__exit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_16__hub_primitives_13_WaitIterator_9__exit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6gevent_16__hub_primitives_13_WaitIterator_8__exit__[] = "_WaitIterator.__exit__(self, typ, value, tb)"; +static PyMethodDef __pyx_mdef_6gevent_16__hub_primitives_13_WaitIterator_9__exit__ = {"__exit__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_16__hub_primitives_13_WaitIterator_9__exit__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_16__hub_primitives_13_WaitIterator_8__exit__}; +static PyObject *__pyx_pw_6gevent_16__hub_primitives_13_WaitIterator_9__exit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_typ = 0; + PyObject *__pyx_v_value = 0; + PyObject *__pyx_v_tb = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__exit__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_typ,&__pyx_n_s_value,&__pyx_n_s_tb,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_typ)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, 1); __PYX_ERR(0, 174, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tb)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, 2); __PYX_ERR(0, 174, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__exit__") < 0)) __PYX_ERR(0, 174, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + } + __pyx_v_typ = values[0]; + __pyx_v_value = values[1]; + __pyx_v_tb = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 174, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.__hub_primitives._WaitIterator.__exit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_16__hub_primitives_13_WaitIterator_8__exit__(((struct __pyx_obj_6gevent_16__hub_primitives__WaitIterator *)__pyx_v_self), __pyx_v_typ, __pyx_v_value, __pyx_v_tb); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_16__hub_primitives_13_WaitIterator_8__exit__(struct __pyx_obj_6gevent_16__hub_primitives__WaitIterator *__pyx_v_self, PyObject *__pyx_v_typ, PyObject *__pyx_v_value, PyObject *__pyx_v_tb) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__exit__", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6gevent_16__hub_primitives_13_WaitIterator___exit__(__pyx_v_self, __pyx_v_typ, __pyx_v_value, __pyx_v_tb, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 174, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__hub_primitives._WaitIterator.__exit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_hub_primitives.py":178 + * + * + * def iwait_on_objects(objects, timeout=None, count=None): # <<<<<<<<<<<<<< + * """ + * Iteratively yield *objects* as they are ready, until all (or *count*) are ready + */ + +static PyObject *__pyx_pw_6gevent_16__hub_primitives_1iwait_on_objects(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_6gevent_16__hub_primitives_iwait_on_objects(PyObject *__pyx_v_objects, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_16__hub_primitives_iwait_on_objects *__pyx_optional_args) { + PyObject *__pyx_v_timeout = ((PyObject *)Py_None); + PyObject *__pyx_v_count = ((PyObject *)Py_None); + struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *__pyx_v_hub = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + __Pyx_RefNannySetupContext("iwait_on_objects", 0); + if (__pyx_optional_args) { + if (__pyx_optional_args->__pyx_n > 0) { + __pyx_v_timeout = __pyx_optional_args->timeout; + if (__pyx_optional_args->__pyx_n > 1) { + __pyx_v_count = __pyx_optional_args->count; + } + } + } + + /* "src/gevent/_hub_primitives.py":211 + * """ + * # QQQ would be nice to support iterable here that can be generated slowly (why?) + * hub = get_hub() # <<<<<<<<<<<<<< + * if objects is None: + * return [hub.join(timeout=timeout)] + */ + __pyx_t_1 = ((PyObject *)__pyx_f_6gevent_11__hub_local_get_hub_noargs(0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 211, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_hub = ((struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "src/gevent/_hub_primitives.py":212 + * # QQQ would be nice to support iterable here that can be generated slowly (why?) + * hub = get_hub() + * if objects is None: # <<<<<<<<<<<<<< + * return [hub.join(timeout=timeout)] + * return _WaitIterator(objects, hub, timeout, count) + */ + __pyx_t_2 = (__pyx_v_objects == Py_None); + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "src/gevent/_hub_primitives.py":213 + * hub = get_hub() + * if objects is None: + * return [hub.join(timeout=timeout)] # <<<<<<<<<<<<<< + * return _WaitIterator(objects, hub, timeout, count) + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_hub), __pyx_n_s_join); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 213, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 213, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_timeout, __pyx_v_timeout) < 0) __PYX_ERR(0, 213, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 213, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 213, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_5); + PyList_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); + __pyx_t_5 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + + /* "src/gevent/_hub_primitives.py":212 + * # QQQ would be nice to support iterable here that can be generated slowly (why?) + * hub = get_hub() + * if objects is None: # <<<<<<<<<<<<<< + * return [hub.join(timeout=timeout)] + * return _WaitIterator(objects, hub, timeout, count) + */ + } + + /* "src/gevent/_hub_primitives.py":214 + * if objects is None: + * return [hub.join(timeout=timeout)] + * return _WaitIterator(objects, hub, timeout, count) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = PyTuple_New(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 214, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_objects); + __Pyx_GIVEREF(__pyx_v_objects); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_objects); + __Pyx_INCREF(((PyObject *)__pyx_v_hub)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_hub)); + PyTuple_SET_ITEM(__pyx_t_4, 1, ((PyObject *)__pyx_v_hub)); + __Pyx_INCREF(__pyx_v_timeout); + __Pyx_GIVEREF(__pyx_v_timeout); + PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_timeout); + __Pyx_INCREF(__pyx_v_count); + __Pyx_GIVEREF(__pyx_v_count); + PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_v_count); + __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6gevent_16__hub_primitives__WaitIterator), __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 214, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L0; + + /* "src/gevent/_hub_primitives.py":178 + * + * + * def iwait_on_objects(objects, timeout=None, count=None): # <<<<<<<<<<<<<< + * """ + * Iteratively yield *objects* as they are ready, until all (or *count*) are ready + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("gevent.__hub_primitives.iwait_on_objects", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_hub); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_16__hub_primitives_1iwait_on_objects(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6gevent_16__hub_primitives_iwait_on_objects[] = "iwait_on_objects(objects, timeout=None, count=None)\n\n Iteratively yield *objects* as they are ready, until all (or *count*) are ready\n or *timeout* expired.\n\n If you will only be consuming a portion of the *objects*, you should\n do so inside a ``with`` block on this object to avoid leaking resources::\n\n with gevent.iwait((a, b, c)) as it:\n for i in it:\n if i is a:\n break\n\n :param objects: A sequence (supporting :func:`len`) containing objects\n implementing the wait protocol (rawlink() and unlink()).\n :keyword int count: If not `None`, then a number specifying the maximum number\n of objects to wait for. If ``None`` (the default), all objects\n are waited for.\n :keyword float timeout: If given, specifies a maximum number of seconds\n to wait. If the timeout expires before the desired waited-for objects\n are available, then this method returns immediately.\n\n .. seealso:: :func:`wait`\n\n .. versionchanged:: 1.1a1\n Add the *count* parameter.\n .. versionchanged:: 1.1a2\n No longer raise :exc:`LoopExit` if our caller switches greenlets\n in between items yielded by this function.\n .. versionchanged:: 1.4\n Add support to use the returned object as a context manager.\n "; +static PyMethodDef __pyx_mdef_6gevent_16__hub_primitives_1iwait_on_objects = {"iwait_on_objects", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_16__hub_primitives_1iwait_on_objects, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_16__hub_primitives_iwait_on_objects}; +static PyObject *__pyx_pw_6gevent_16__hub_primitives_1iwait_on_objects(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_objects = 0; + PyObject *__pyx_v_timeout = 0; + PyObject *__pyx_v_count = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("iwait_on_objects (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_objects,&__pyx_n_s_timeout,&__pyx_n_s_count,0}; + PyObject* values[3] = {0,0,0}; + values[1] = ((PyObject *)Py_None); + values[2] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_objects)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_timeout); + if (value) { values[1] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 2: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_count); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "iwait_on_objects") < 0)) __PYX_ERR(0, 178, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_objects = values[0]; + __pyx_v_timeout = values[1]; + __pyx_v_count = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("iwait_on_objects", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 178, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.__hub_primitives.iwait_on_objects", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_16__hub_primitives_iwait_on_objects(__pyx_self, __pyx_v_objects, __pyx_v_timeout, __pyx_v_count); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_16__hub_primitives_iwait_on_objects(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_objects, PyObject *__pyx_v_timeout, PyObject *__pyx_v_count) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + struct __pyx_opt_args_6gevent_16__hub_primitives_iwait_on_objects __pyx_t_2; + __Pyx_RefNannySetupContext("iwait_on_objects", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_2.__pyx_n = 2; + __pyx_t_2.timeout = __pyx_v_timeout; + __pyx_t_2.count = __pyx_v_count; + __pyx_t_1 = __pyx_f_6gevent_16__hub_primitives_iwait_on_objects(__pyx_v_objects, 0, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 178, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__hub_primitives.iwait_on_objects", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_hub_primitives.py":217 + * + * + * def wait_on_objects(objects=None, timeout=None, count=None): # <<<<<<<<<<<<<< + * """ + * Wait for ``objects`` to become ready or for event loop to finish. + */ + +static PyObject *__pyx_pw_6gevent_16__hub_primitives_3wait_on_objects(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_6gevent_16__hub_primitives_wait_on_objects(CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_16__hub_primitives_wait_on_objects *__pyx_optional_args) { + PyObject *__pyx_v_objects = ((PyObject *)Py_None); + PyObject *__pyx_v_timeout = ((PyObject *)Py_None); + PyObject *__pyx_v_count = ((PyObject *)Py_None); + struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *__pyx_v_hub = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + struct __pyx_opt_args_6gevent_16__hub_primitives_iwait_on_objects __pyx_t_6; + __Pyx_RefNannySetupContext("wait_on_objects", 0); + if (__pyx_optional_args) { + if (__pyx_optional_args->__pyx_n > 0) { + __pyx_v_objects = __pyx_optional_args->objects; + if (__pyx_optional_args->__pyx_n > 1) { + __pyx_v_timeout = __pyx_optional_args->timeout; + if (__pyx_optional_args->__pyx_n > 2) { + __pyx_v_count = __pyx_optional_args->count; + } + } + } + } + + /* "src/gevent/_hub_primitives.py":251 + * .. seealso:: :func:`iwait` + * """ + * if objects is None: # <<<<<<<<<<<<<< + * hub = get_hub() + * return hub.join(timeout=timeout) # pylint:disable= + */ + __pyx_t_1 = (__pyx_v_objects == Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "src/gevent/_hub_primitives.py":252 + * """ + * if objects is None: + * hub = get_hub() # <<<<<<<<<<<<<< + * return hub.join(timeout=timeout) # pylint:disable= + * return list(iwait_on_objects(objects, timeout, count)) + */ + __pyx_t_3 = ((PyObject *)__pyx_f_6gevent_11__hub_local_get_hub_noargs(0)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 252, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_v_hub = ((struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *)__pyx_t_3); + __pyx_t_3 = 0; + + /* "src/gevent/_hub_primitives.py":253 + * if objects is None: + * hub = get_hub() + * return hub.join(timeout=timeout) # pylint:disable= # <<<<<<<<<<<<<< + * return list(iwait_on_objects(objects, timeout, count)) + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_hub), __pyx_n_s_join); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 253, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 253, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_timeout, __pyx_v_timeout) < 0) __PYX_ERR(0, 253, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 253, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L0; + + /* "src/gevent/_hub_primitives.py":251 + * .. seealso:: :func:`iwait` + * """ + * if objects is None: # <<<<<<<<<<<<<< + * hub = get_hub() + * return hub.join(timeout=timeout) # pylint:disable= + */ + } + + /* "src/gevent/_hub_primitives.py":254 + * hub = get_hub() + * return hub.join(timeout=timeout) # pylint:disable= + * return list(iwait_on_objects(objects, timeout, count)) # <<<<<<<<<<<<<< + * + * _timeout_error = Exception + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_6.__pyx_n = 2; + __pyx_t_6.timeout = __pyx_v_timeout; + __pyx_t_6.count = __pyx_v_count; + __pyx_t_5 = __pyx_f_6gevent_16__hub_primitives_iwait_on_objects(__pyx_v_objects, 0, &__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 254, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = PySequence_List(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 254, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + + /* "src/gevent/_hub_primitives.py":217 + * + * + * def wait_on_objects(objects=None, timeout=None, count=None): # <<<<<<<<<<<<<< + * """ + * Wait for ``objects`` to become ready or for event loop to finish. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("gevent.__hub_primitives.wait_on_objects", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_hub); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_16__hub_primitives_3wait_on_objects(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6gevent_16__hub_primitives_2wait_on_objects[] = "wait_on_objects(objects=None, timeout=None, count=None)\n\n Wait for ``objects`` to become ready or for event loop to finish.\n\n If ``objects`` is provided, it must be a list containing objects\n implementing the wait protocol (rawlink() and unlink() methods):\n\n - :class:`gevent.Greenlet` instance\n - :class:`gevent.event.Event` instance\n - :class:`gevent.lock.Semaphore` instance\n - :class:`gevent.subprocess.Popen` instance\n\n If ``objects`` is ``None`` (the default), ``wait()`` blocks until\n the current event loop has nothing to do (or until ``timeout`` passes):\n\n - all greenlets have finished\n - all servers were stopped\n - all event loop watchers were stopped.\n\n If ``count`` is ``None`` (the default), wait for all ``objects``\n to become ready.\n\n If ``count`` is a number, wait for (up to) ``count`` objects to become\n ready. (For example, if count is ``1`` then the function exits\n when any object in the list is ready).\n\n If ``timeout`` is provided, it specifies the maximum number of\n seconds ``wait()`` will block.\n\n Returns the list of ready objects, in the order in which they were\n ready.\n\n .. seealso:: :func:`iwait`\n "; +static PyMethodDef __pyx_mdef_6gevent_16__hub_primitives_3wait_on_objects = {"wait_on_objects", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_16__hub_primitives_3wait_on_objects, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_16__hub_primitives_2wait_on_objects}; +static PyObject *__pyx_pw_6gevent_16__hub_primitives_3wait_on_objects(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_objects = 0; + PyObject *__pyx_v_timeout = 0; + PyObject *__pyx_v_count = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("wait_on_objects (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_objects,&__pyx_n_s_timeout,&__pyx_n_s_count,0}; + PyObject* values[3] = {0,0,0}; + values[0] = ((PyObject *)Py_None); + values[1] = ((PyObject *)Py_None); + values[2] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_objects); + if (value) { values[0] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 1: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_timeout); + if (value) { values[1] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 2: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_count); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "wait_on_objects") < 0)) __PYX_ERR(0, 217, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_objects = values[0]; + __pyx_v_timeout = values[1]; + __pyx_v_count = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("wait_on_objects", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 217, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.__hub_primitives.wait_on_objects", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_16__hub_primitives_2wait_on_objects(__pyx_self, __pyx_v_objects, __pyx_v_timeout, __pyx_v_count); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_16__hub_primitives_2wait_on_objects(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_objects, PyObject *__pyx_v_timeout, PyObject *__pyx_v_count) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + struct __pyx_opt_args_6gevent_16__hub_primitives_wait_on_objects __pyx_t_2; + __Pyx_RefNannySetupContext("wait_on_objects", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_2.__pyx_n = 3; + __pyx_t_2.objects = __pyx_v_objects; + __pyx_t_2.timeout = __pyx_v_timeout; + __pyx_t_2.count = __pyx_v_count; + __pyx_t_1 = __pyx_f_6gevent_16__hub_primitives_wait_on_objects(0, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 217, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__hub_primitives.wait_on_objects", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_hub_primitives.py":258 + * _timeout_error = Exception + * + * def set_default_timeout_error(e): # <<<<<<<<<<<<<< + * global _timeout_error + * _timeout_error = e + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_16__hub_primitives_5set_default_timeout_error(PyObject *__pyx_self, PyObject *__pyx_v_e); /*proto*/ +static char __pyx_doc_6gevent_16__hub_primitives_4set_default_timeout_error[] = "set_default_timeout_error(e)"; +static PyMethodDef __pyx_mdef_6gevent_16__hub_primitives_5set_default_timeout_error = {"set_default_timeout_error", (PyCFunction)__pyx_pw_6gevent_16__hub_primitives_5set_default_timeout_error, METH_O, __pyx_doc_6gevent_16__hub_primitives_4set_default_timeout_error}; +static PyObject *__pyx_pw_6gevent_16__hub_primitives_5set_default_timeout_error(PyObject *__pyx_self, PyObject *__pyx_v_e) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("set_default_timeout_error (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_16__hub_primitives_4set_default_timeout_error(__pyx_self, ((PyObject *)__pyx_v_e)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_16__hub_primitives_4set_default_timeout_error(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_e) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("set_default_timeout_error", 0); + + /* "src/gevent/_hub_primitives.py":260 + * def set_default_timeout_error(e): + * global _timeout_error + * _timeout_error = e # <<<<<<<<<<<<<< + * + * def _primitive_wait(watcher, timeout, timeout_exc, hub): + */ + __Pyx_INCREF(__pyx_v_e); + __Pyx_XGOTREF(__pyx_v_6gevent_16__hub_primitives__timeout_error); + __Pyx_DECREF_SET(__pyx_v_6gevent_16__hub_primitives__timeout_error, __pyx_v_e); + __Pyx_GIVEREF(__pyx_v_e); + + /* "src/gevent/_hub_primitives.py":258 + * _timeout_error = Exception + * + * def set_default_timeout_error(e): # <<<<<<<<<<<<<< + * global _timeout_error + * _timeout_error = e + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_hub_primitives.py":262 + * _timeout_error = e + * + * def _primitive_wait(watcher, timeout, timeout_exc, hub): # <<<<<<<<<<<<<< + * if watcher.callback is not None: + * raise ConcurrentObjectUseError('This socket is already used by another greenlet: %r' + */ + +static PyObject *__pyx_f_6gevent_16__hub_primitives__primitive_wait(PyObject *__pyx_v_watcher, PyObject *__pyx_v_timeout, PyObject *__pyx_v_timeout_exc, struct __pyx_obj_6gevent_16__hub_primitives_WaitOperationsGreenlet *__pyx_v_hub) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + int __pyx_t_10; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + PyObject *__pyx_t_14 = NULL; + PyObject *__pyx_t_15 = NULL; + __Pyx_RefNannySetupContext("_primitive_wait", 0); + __Pyx_INCREF(__pyx_v_timeout); + __Pyx_INCREF((PyObject *)__pyx_v_hub); + + /* "src/gevent/_hub_primitives.py":263 + * + * def _primitive_wait(watcher, timeout, timeout_exc, hub): + * if watcher.callback is not None: # <<<<<<<<<<<<<< + * raise ConcurrentObjectUseError('This socket is already used by another greenlet: %r' + * % (watcher.callback, )) + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_watcher, __pyx_n_s_callback); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 263, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = (__pyx_t_1 != Py_None); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = (__pyx_t_2 != 0); + if (unlikely(__pyx_t_3)) { + + /* "src/gevent/_hub_primitives.py":264 + * def _primitive_wait(watcher, timeout, timeout_exc, hub): + * if watcher.callback is not None: + * raise ConcurrentObjectUseError('This socket is already used by another greenlet: %r' # <<<<<<<<<<<<<< + * % (watcher.callback, )) + * + */ + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ConcurrentObjectUseError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 264, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + + /* "src/gevent/_hub_primitives.py":265 + * if watcher.callback is not None: + * raise ConcurrentObjectUseError('This socket is already used by another greenlet: %r' + * % (watcher.callback, )) # <<<<<<<<<<<<<< + * + * if hub is None: + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_watcher, __pyx_n_s_callback); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 265, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 265, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_This_socket_is_already_used_by_a, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 265, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_6)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + } + } + __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_6, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 264, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 264, __pyx_L1_error) + + /* "src/gevent/_hub_primitives.py":263 + * + * def _primitive_wait(watcher, timeout, timeout_exc, hub): + * if watcher.callback is not None: # <<<<<<<<<<<<<< + * raise ConcurrentObjectUseError('This socket is already used by another greenlet: %r' + * % (watcher.callback, )) + */ + } + + /* "src/gevent/_hub_primitives.py":267 + * % (watcher.callback, )) + * + * if hub is None: # <<<<<<<<<<<<<< + * hub = get_hub() + * + */ + __pyx_t_3 = (((PyObject *)__pyx_v_hub) == Py_None); + __pyx_t_2 = (__pyx_t_3 != 0); + if (__pyx_t_2) { + + /* "src/gevent/_hub_primitives.py":268 + * + * if hub is None: + * hub = get_hub() # <<<<<<<<<<<<<< + * + * if timeout is None: + */ + __pyx_t_1 = ((PyObject *)__pyx_f_6gevent_11__hub_local_get_hub_noargs(0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 268, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_6gevent_16__hub_primitives_WaitOperationsGreenlet))))) __PYX_ERR(0, 268, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_hub, ((struct __pyx_obj_6gevent_16__hub_primitives_WaitOperationsGreenlet *)__pyx_t_1)); + __pyx_t_1 = 0; + + /* "src/gevent/_hub_primitives.py":267 + * % (watcher.callback, )) + * + * if hub is None: # <<<<<<<<<<<<<< + * hub = get_hub() + * + */ + } + + /* "src/gevent/_hub_primitives.py":270 + * hub = get_hub() + * + * if timeout is None: # <<<<<<<<<<<<<< + * hub.wait(watcher) + * return + */ + __pyx_t_2 = (__pyx_v_timeout == Py_None); + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "src/gevent/_hub_primitives.py":271 + * + * if timeout is None: + * hub.wait(watcher) # <<<<<<<<<<<<<< + * return + * + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_16__hub_primitives_WaitOperationsGreenlet *)__pyx_v_hub->__pyx_base.__pyx_vtab)->wait(__pyx_v_hub, __pyx_v_watcher, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 271, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_hub_primitives.py":272 + * if timeout is None: + * hub.wait(watcher) + * return # <<<<<<<<<<<<<< + * + * timeout = Timeout._start_new_or_dummy( + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + + /* "src/gevent/_hub_primitives.py":270 + * hub = get_hub() + * + * if timeout is None: # <<<<<<<<<<<<<< + * hub.wait(watcher) + * return + */ + } + + /* "src/gevent/_hub_primitives.py":274 + * return + * + * timeout = Timeout._start_new_or_dummy( # <<<<<<<<<<<<<< + * timeout, + * (timeout_exc + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_6gevent_16__hub_primitives_Timeout, __pyx_n_s_start_new_or_dummy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 274, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + + /* "src/gevent/_hub_primitives.py":277 + * timeout, + * (timeout_exc + * if timeout_exc is not _NONE or timeout is None # <<<<<<<<<<<<<< + * else _timeout_error('timed out'))) + * + */ + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_NONE); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 277, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_2 = (__pyx_v_timeout_exc != __pyx_t_6); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_7 = (__pyx_t_2 != 0); + if (!__pyx_t_7) { + } else { + __pyx_t_3 = __pyx_t_7; + goto __pyx_L6_bool_binop_done; + } + __pyx_t_7 = (__pyx_v_timeout == Py_None); + __pyx_t_2 = (__pyx_t_7 != 0); + __pyx_t_3 = __pyx_t_2; + __pyx_L6_bool_binop_done:; + if (__pyx_t_3) { + + /* "src/gevent/_hub_primitives.py":276 + * timeout = Timeout._start_new_or_dummy( + * timeout, + * (timeout_exc # <<<<<<<<<<<<<< + * if timeout_exc is not _NONE or timeout is None + * else _timeout_error('timed out'))) + */ + __Pyx_INCREF(__pyx_v_timeout_exc); + __pyx_t_5 = __pyx_v_timeout_exc; + } else { + + /* "src/gevent/_hub_primitives.py":278 + * (timeout_exc + * if timeout_exc is not _NONE or timeout is None + * else _timeout_error('timed out'))) # <<<<<<<<<<<<<< + * + * with timeout: + */ + __Pyx_INCREF(__pyx_v_6gevent_16__hub_primitives__timeout_error); + __pyx_t_8 = __pyx_v_6gevent_16__hub_primitives__timeout_error; __pyx_t_9 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) { + __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8); + if (likely(__pyx_t_9)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); + __Pyx_INCREF(__pyx_t_9); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_8, function); + } + } + __pyx_t_6 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_9, __pyx_kp_s_timed_out) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_kp_s_timed_out); + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 278, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_5 = __pyx_t_6; + __pyx_t_6 = 0; + } + __pyx_t_6 = NULL; + __pyx_t_10 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_6)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + __pyx_t_10 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_4)) { + PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_timeout, __pyx_t_5}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 274, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { + PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_timeout, __pyx_t_5}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 274, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } else + #endif + { + __pyx_t_8 = PyTuple_New(2+__pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 274, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + if (__pyx_t_6) { + __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL; + } + __Pyx_INCREF(__pyx_v_timeout); + __Pyx_GIVEREF(__pyx_v_timeout); + PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_10, __pyx_v_timeout); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_10, __pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 274, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF_SET(__pyx_v_timeout, __pyx_t_1); + __pyx_t_1 = 0; + + /* "src/gevent/_hub_primitives.py":280 + * else _timeout_error('timed out'))) + * + * with timeout: # <<<<<<<<<<<<<< + * hub.wait(watcher) + * + */ + /*with:*/ { + __pyx_t_11 = __Pyx_PyObject_LookupSpecial(__pyx_v_timeout, __pyx_n_s_exit); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 280, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_4 = __Pyx_PyObject_LookupSpecial(__pyx_v_timeout, __pyx_n_s_enter); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 280, __pyx_L8_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_8 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_8)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_8); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + } + } + __pyx_t_1 = (__pyx_t_8) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_8) : __Pyx_PyObject_CallNoArg(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 280, __pyx_L8_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + /*try:*/ { + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14); + __Pyx_XGOTREF(__pyx_t_12); + __Pyx_XGOTREF(__pyx_t_13); + __Pyx_XGOTREF(__pyx_t_14); + /*try:*/ { + + /* "src/gevent/_hub_primitives.py":281 + * + * with timeout: + * hub.wait(watcher) # <<<<<<<<<<<<<< + * + * # Suitable to be bound as an instance method + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_16__hub_primitives_WaitOperationsGreenlet *)__pyx_v_hub->__pyx_base.__pyx_vtab)->wait(__pyx_v_hub, __pyx_v_watcher, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 281, __pyx_L12_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_hub_primitives.py":280 + * else _timeout_error('timed out'))) + * + * with timeout: # <<<<<<<<<<<<<< + * hub.wait(watcher) + * + */ + } + __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; + goto __pyx_L17_try_end; + __pyx_L12_error:; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + /*except:*/ { + __Pyx_AddTraceback("gevent.__hub_primitives._primitive_wait", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_4, &__pyx_t_8) < 0) __PYX_ERR(0, 280, __pyx_L14_except_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_5 = PyTuple_Pack(3, __pyx_t_1, __pyx_t_4, __pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 280, __pyx_L14_except_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_15 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_5, NULL); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 280, __pyx_L14_except_error) + __Pyx_GOTREF(__pyx_t_15); + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_15); + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + if (__pyx_t_3 < 0) __PYX_ERR(0, 280, __pyx_L14_except_error) + __pyx_t_2 = ((!(__pyx_t_3 != 0)) != 0); + if (__pyx_t_2) { + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_ErrRestoreWithState(__pyx_t_1, __pyx_t_4, __pyx_t_8); + __pyx_t_1 = 0; __pyx_t_4 = 0; __pyx_t_8 = 0; + __PYX_ERR(0, 280, __pyx_L14_except_error) + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + goto __pyx_L13_exception_handled; + } + __pyx_L14_except_error:; + __Pyx_XGIVEREF(__pyx_t_12); + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14); + goto __pyx_L1_error; + __pyx_L13_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_12); + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14); + __pyx_L17_try_end:; + } + } + /*finally:*/ { + /*normal exit:*/{ + if (__pyx_t_11) { + __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_tuple_, NULL); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 280, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_14); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + } + goto __pyx_L11; + } + __pyx_L11:; + } + goto __pyx_L21; + __pyx_L8_error:; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + goto __pyx_L1_error; + __pyx_L21:; + } + + /* "src/gevent/_hub_primitives.py":262 + * _timeout_error = e + * + * def _primitive_wait(watcher, timeout, timeout_exc, hub): # <<<<<<<<<<<<<< + * if watcher.callback is not None: + * raise ConcurrentObjectUseError('This socket is already used by another greenlet: %r' + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_AddTraceback("gevent.__hub_primitives._primitive_wait", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_timeout); + __Pyx_XDECREF((PyObject *)__pyx_v_hub); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_hub_primitives.py":284 + * + * # Suitable to be bound as an instance method + * def wait_on_socket(socket, watcher, timeout_exc=None): # <<<<<<<<<<<<<< + * if socket is None or watcher is None: + * # test__hub TestCloseSocketWhilePolling, on Python 2; Python 3 + */ + +static PyObject *__pyx_pw_6gevent_16__hub_primitives_7wait_on_socket(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_6gevent_16__hub_primitives_wait_on_socket(PyObject *__pyx_v_socket, PyObject *__pyx_v_watcher, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_16__hub_primitives_wait_on_socket *__pyx_optional_args) { + PyObject *__pyx_v_timeout_exc = ((PyObject *)Py_None); + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + __Pyx_RefNannySetupContext("wait_on_socket", 0); + if (__pyx_optional_args) { + if (__pyx_optional_args->__pyx_n > 0) { + __pyx_v_timeout_exc = __pyx_optional_args->timeout_exc; + } + } + + /* "src/gevent/_hub_primitives.py":285 + * # Suitable to be bound as an instance method + * def wait_on_socket(socket, watcher, timeout_exc=None): + * if socket is None or watcher is None: # <<<<<<<<<<<<<< + * # test__hub TestCloseSocketWhilePolling, on Python 2; Python 3 + * # catches the EBADF differently. + */ + __pyx_t_2 = (__pyx_v_socket == Py_None); + __pyx_t_3 = (__pyx_t_2 != 0); + if (!__pyx_t_3) { + } else { + __pyx_t_1 = __pyx_t_3; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_3 = (__pyx_v_watcher == Py_None); + __pyx_t_2 = (__pyx_t_3 != 0); + __pyx_t_1 = __pyx_t_2; + __pyx_L4_bool_binop_done:; + if (unlikely(__pyx_t_1)) { + + /* "src/gevent/_hub_primitives.py":288 + * # test__hub TestCloseSocketWhilePolling, on Python 2; Python 3 + * # catches the EBADF differently. + * raise ConcurrentObjectUseError("The socket has already been closed by another greenlet") # <<<<<<<<<<<<<< + * _primitive_wait(watcher, socket.timeout, + * timeout_exc if timeout_exc is not None else _NONE, + */ + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_ConcurrentObjectUseError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 288, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); + if (likely(__pyx_t_6)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_5, function); + } + } + __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_kp_s_The_socket_has_already_been_clos) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_kp_s_The_socket_has_already_been_clos); + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 288, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __PYX_ERR(0, 288, __pyx_L1_error) + + /* "src/gevent/_hub_primitives.py":285 + * # Suitable to be bound as an instance method + * def wait_on_socket(socket, watcher, timeout_exc=None): + * if socket is None or watcher is None: # <<<<<<<<<<<<<< + * # test__hub TestCloseSocketWhilePolling, on Python 2; Python 3 + * # catches the EBADF differently. + */ + } + + /* "src/gevent/_hub_primitives.py":289 + * # catches the EBADF differently. + * raise ConcurrentObjectUseError("The socket has already been closed by another greenlet") + * _primitive_wait(watcher, socket.timeout, # <<<<<<<<<<<<<< + * timeout_exc if timeout_exc is not None else _NONE, + * socket.hub) + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_socket, __pyx_n_s_timeout); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 289, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + + /* "src/gevent/_hub_primitives.py":290 + * raise ConcurrentObjectUseError("The socket has already been closed by another greenlet") + * _primitive_wait(watcher, socket.timeout, + * timeout_exc if timeout_exc is not None else _NONE, # <<<<<<<<<<<<<< + * socket.hub) + * + */ + __pyx_t_1 = (__pyx_v_timeout_exc != Py_None); + if ((__pyx_t_1 != 0)) { + __Pyx_INCREF(__pyx_v_timeout_exc); + __pyx_t_5 = __pyx_v_timeout_exc; + } else { + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_NONE); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 290, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_5 = __pyx_t_6; + __pyx_t_6 = 0; + } + + /* "src/gevent/_hub_primitives.py":291 + * _primitive_wait(watcher, socket.timeout, + * timeout_exc if timeout_exc is not None else _NONE, + * socket.hub) # <<<<<<<<<<<<<< + * + * def wait_on_watcher(watcher, timeout=None, timeout_exc=_NONE, hub=None): + */ + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_socket, __pyx_n_s_hub); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 291, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_6gevent_16__hub_primitives_WaitOperationsGreenlet))))) __PYX_ERR(0, 291, __pyx_L1_error) + + /* "src/gevent/_hub_primitives.py":289 + * # catches the EBADF differently. + * raise ConcurrentObjectUseError("The socket has already been closed by another greenlet") + * _primitive_wait(watcher, socket.timeout, # <<<<<<<<<<<<<< + * timeout_exc if timeout_exc is not None else _NONE, + * socket.hub) + */ + __pyx_t_7 = __pyx_f_6gevent_16__hub_primitives__primitive_wait(__pyx_v_watcher, __pyx_t_4, __pyx_t_5, ((struct __pyx_obj_6gevent_16__hub_primitives_WaitOperationsGreenlet *)__pyx_t_6)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 289, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "src/gevent/_hub_primitives.py":284 + * + * # Suitable to be bound as an instance method + * def wait_on_socket(socket, watcher, timeout_exc=None): # <<<<<<<<<<<<<< + * if socket is None or watcher is None: + * # test__hub TestCloseSocketWhilePolling, on Python 2; Python 3 + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("gevent.__hub_primitives.wait_on_socket", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_16__hub_primitives_7wait_on_socket(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6gevent_16__hub_primitives_6wait_on_socket[] = "wait_on_socket(socket, watcher, timeout_exc=None)"; +static PyMethodDef __pyx_mdef_6gevent_16__hub_primitives_7wait_on_socket = {"wait_on_socket", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_16__hub_primitives_7wait_on_socket, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_16__hub_primitives_6wait_on_socket}; +static PyObject *__pyx_pw_6gevent_16__hub_primitives_7wait_on_socket(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_socket = 0; + PyObject *__pyx_v_watcher = 0; + PyObject *__pyx_v_timeout_exc = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("wait_on_socket (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_socket,&__pyx_n_s_watcher,&__pyx_n_s_timeout_exc,0}; + PyObject* values[3] = {0,0,0}; + values[2] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_socket)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_watcher)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("wait_on_socket", 0, 2, 3, 1); __PYX_ERR(0, 284, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_timeout_exc); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "wait_on_socket") < 0)) __PYX_ERR(0, 284, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_socket = values[0]; + __pyx_v_watcher = values[1]; + __pyx_v_timeout_exc = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("wait_on_socket", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 284, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.__hub_primitives.wait_on_socket", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_16__hub_primitives_6wait_on_socket(__pyx_self, __pyx_v_socket, __pyx_v_watcher, __pyx_v_timeout_exc); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_16__hub_primitives_6wait_on_socket(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_socket, PyObject *__pyx_v_watcher, PyObject *__pyx_v_timeout_exc) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + struct __pyx_opt_args_6gevent_16__hub_primitives_wait_on_socket __pyx_t_2; + __Pyx_RefNannySetupContext("wait_on_socket", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_2.__pyx_n = 1; + __pyx_t_2.timeout_exc = __pyx_v_timeout_exc; + __pyx_t_1 = __pyx_f_6gevent_16__hub_primitives_wait_on_socket(__pyx_v_socket, __pyx_v_watcher, 0, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 284, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__hub_primitives.wait_on_socket", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_hub_primitives.py":293 + * socket.hub) + * + * def wait_on_watcher(watcher, timeout=None, timeout_exc=_NONE, hub=None): # <<<<<<<<<<<<<< + * """ + * wait(watcher, timeout=None, [timeout_exc=None]) -> None + */ + +static PyObject *__pyx_pw_6gevent_16__hub_primitives_9wait_on_watcher(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_6gevent_16__hub_primitives_wait_on_watcher(PyObject *__pyx_v_watcher, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_16__hub_primitives_wait_on_watcher *__pyx_optional_args) { + PyObject *__pyx_v_timeout = ((PyObject *)Py_None); + PyObject *__pyx_v_timeout_exc = __pyx_k__2; + struct __pyx_obj_6gevent_16__hub_primitives_WaitOperationsGreenlet *__pyx_v_hub = ((struct __pyx_obj_6gevent_16__hub_primitives_WaitOperationsGreenlet *)Py_None); + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("wait_on_watcher", 0); + if (__pyx_optional_args) { + if (__pyx_optional_args->__pyx_n > 0) { + __pyx_v_timeout = __pyx_optional_args->timeout; + if (__pyx_optional_args->__pyx_n > 1) { + __pyx_v_timeout_exc = __pyx_optional_args->timeout_exc; + if (__pyx_optional_args->__pyx_n > 2) { + __pyx_v_hub = __pyx_optional_args->hub; + } + } + } + } + + /* "src/gevent/_hub_primitives.py":317 + * already started. + * """ + * _primitive_wait(watcher, timeout, timeout_exc, hub) # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_1 = __pyx_f_6gevent_16__hub_primitives__primitive_wait(__pyx_v_watcher, __pyx_v_timeout, __pyx_v_timeout_exc, __pyx_v_hub); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 317, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_hub_primitives.py":293 + * socket.hub) + * + * def wait_on_watcher(watcher, timeout=None, timeout_exc=_NONE, hub=None): # <<<<<<<<<<<<<< + * """ + * wait(watcher, timeout=None, [timeout_exc=None]) -> None + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__hub_primitives.wait_on_watcher", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_16__hub_primitives_9wait_on_watcher(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6gevent_16__hub_primitives_8wait_on_watcher[] = "wait_on_watcher(watcher, timeout=None, timeout_exc=_NONE, WaitOperationsGreenlet hub=None)\n\n wait(watcher, timeout=None, [timeout_exc=None]) -> None\n\n Block the current greenlet until *watcher* is ready.\n\n If *timeout* is non-negative, then *timeout_exc* is raised after\n *timeout* second has passed.\n\n If :func:`cancel_wait` is called on *io* by another greenlet,\n raise an exception in this blocking greenlet\n (``socket.error(EBADF, 'File descriptor was closed in another\n greenlet')`` by default).\n\n :param io: An event loop watcher, most commonly an IO watcher obtained from\n :meth:`gevent.core.loop.io`\n :keyword timeout_exc: The exception to raise if the timeout expires.\n By default, a :class:`socket.timeout` exception is raised.\n If you pass a value for this keyword, it is interpreted as for\n :class:`gevent.timeout.Timeout`.\n\n :raises ~gevent.hub.ConcurrentObjectUseError: If the *watcher* is\n already started.\n "; +static PyMethodDef __pyx_mdef_6gevent_16__hub_primitives_9wait_on_watcher = {"wait_on_watcher", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_16__hub_primitives_9wait_on_watcher, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_16__hub_primitives_8wait_on_watcher}; +static PyObject *__pyx_pw_6gevent_16__hub_primitives_9wait_on_watcher(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_watcher = 0; + PyObject *__pyx_v_timeout = 0; + PyObject *__pyx_v_timeout_exc = 0; + struct __pyx_obj_6gevent_16__hub_primitives_WaitOperationsGreenlet *__pyx_v_hub = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("wait_on_watcher (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_watcher,&__pyx_n_s_timeout,&__pyx_n_s_timeout_exc,&__pyx_n_s_hub,0}; + PyObject* values[4] = {0,0,0,0}; + values[1] = ((PyObject *)Py_None); + values[2] = __pyx_k__2; + values[3] = (PyObject *)((struct __pyx_obj_6gevent_16__hub_primitives_WaitOperationsGreenlet *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_watcher)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_timeout); + if (value) { values[1] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 2: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_timeout_exc); + if (value) { values[2] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 3: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_hub); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "wait_on_watcher") < 0)) __PYX_ERR(0, 293, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_watcher = values[0]; + __pyx_v_timeout = values[1]; + __pyx_v_timeout_exc = values[2]; + __pyx_v_hub = ((struct __pyx_obj_6gevent_16__hub_primitives_WaitOperationsGreenlet *)values[3]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("wait_on_watcher", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 293, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.__hub_primitives.wait_on_watcher", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_hub), __pyx_ptype_6gevent_16__hub_primitives_WaitOperationsGreenlet, 1, "hub", 0))) __PYX_ERR(0, 293, __pyx_L1_error) + __pyx_r = __pyx_pf_6gevent_16__hub_primitives_8wait_on_watcher(__pyx_self, __pyx_v_watcher, __pyx_v_timeout, __pyx_v_timeout_exc, __pyx_v_hub); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_16__hub_primitives_8wait_on_watcher(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_watcher, PyObject *__pyx_v_timeout, PyObject *__pyx_v_timeout_exc, struct __pyx_obj_6gevent_16__hub_primitives_WaitOperationsGreenlet *__pyx_v_hub) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + struct __pyx_opt_args_6gevent_16__hub_primitives_wait_on_watcher __pyx_t_2; + __Pyx_RefNannySetupContext("wait_on_watcher", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_2.__pyx_n = 3; + __pyx_t_2.timeout = __pyx_v_timeout; + __pyx_t_2.timeout_exc = __pyx_v_timeout_exc; + __pyx_t_2.hub = __pyx_v_hub; + __pyx_t_1 = __pyx_f_6gevent_16__hub_primitives_wait_on_watcher(__pyx_v_watcher, 0, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 293, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__hub_primitives.wait_on_watcher", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_hub_primitives.py":320 + * + * + * def wait_read(fileno, timeout=None, timeout_exc=_NONE): # <<<<<<<<<<<<<< + * """ + * wait_read(fileno, timeout=None, [timeout_exc=None]) -> None + */ + +static PyObject *__pyx_pw_6gevent_16__hub_primitives_11wait_read(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_6gevent_16__hub_primitives_wait_read(PyObject *__pyx_v_fileno, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_16__hub_primitives_wait_read *__pyx_optional_args) { + PyObject *__pyx_v_timeout = ((PyObject *)Py_None); + PyObject *__pyx_v_timeout_exc = __pyx_k__3; + struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *__pyx_v_hub = NULL; + PyObject *__pyx_v_io = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + struct __pyx_opt_args_6gevent_16__hub_primitives_wait_on_watcher __pyx_t_6; + int __pyx_t_7; + char const *__pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + PyObject *__pyx_t_14 = NULL; + __Pyx_RefNannySetupContext("wait_read", 0); + if (__pyx_optional_args) { + if (__pyx_optional_args->__pyx_n > 0) { + __pyx_v_timeout = __pyx_optional_args->timeout; + if (__pyx_optional_args->__pyx_n > 1) { + __pyx_v_timeout_exc = __pyx_optional_args->timeout_exc; + } + } + } + + /* "src/gevent/_hub_primitives.py":331 + * .. seealso:: :func:`cancel_wait` + * """ + * hub = get_hub() # <<<<<<<<<<<<<< + * io = hub.loop.io(fileno, 1) + * try: + */ + __pyx_t_1 = ((PyObject *)__pyx_f_6gevent_11__hub_local_get_hub_noargs(0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 331, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_hub = ((struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "src/gevent/_hub_primitives.py":332 + * """ + * hub = get_hub() + * io = hub.loop.io(fileno, 1) # <<<<<<<<<<<<<< + * try: + * return wait_on_watcher(io, timeout, timeout_exc, hub) + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_hub->loop, __pyx_n_s_io); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 332, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + __pyx_t_4 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_4 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_fileno, __pyx_int_1}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 332, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_fileno, __pyx_int_1}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 332, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else + #endif + { + __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 332, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (__pyx_t_3) { + __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL; + } + __Pyx_INCREF(__pyx_v_fileno); + __Pyx_GIVEREF(__pyx_v_fileno); + PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_fileno); + __Pyx_INCREF(__pyx_int_1); + __Pyx_GIVEREF(__pyx_int_1); + PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_int_1); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 332, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_io = __pyx_t_1; + __pyx_t_1 = 0; + + /* "src/gevent/_hub_primitives.py":333 + * hub = get_hub() + * io = hub.loop.io(fileno, 1) + * try: # <<<<<<<<<<<<<< + * return wait_on_watcher(io, timeout, timeout_exc, hub) + * finally: + */ + /*try:*/ { + + /* "src/gevent/_hub_primitives.py":334 + * io = hub.loop.io(fileno, 1) + * try: + * return wait_on_watcher(io, timeout, timeout_exc, hub) # <<<<<<<<<<<<<< + * finally: + * io.close() + */ + __Pyx_XDECREF(__pyx_r); + if (!(likely(((((PyObject *)__pyx_v_hub)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_hub), __pyx_ptype_6gevent_16__hub_primitives_WaitOperationsGreenlet))))) __PYX_ERR(0, 334, __pyx_L4_error) + __pyx_t_6.__pyx_n = 3; + __pyx_t_6.timeout = __pyx_v_timeout; + __pyx_t_6.timeout_exc = __pyx_v_timeout_exc; + __pyx_t_6.hub = ((struct __pyx_obj_6gevent_16__hub_primitives_WaitOperationsGreenlet *)__pyx_v_hub); + __pyx_t_1 = __pyx_f_6gevent_16__hub_primitives_wait_on_watcher(__pyx_v_io, 0, &__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 334, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L3_return; + } + + /* "src/gevent/_hub_primitives.py":336 + * return wait_on_watcher(io, timeout, timeout_exc, hub) + * finally: + * io.close() # <<<<<<<<<<<<<< + * + * + */ + /*finally:*/ { + __pyx_L4_error:; + /*exception exit:*/{ + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14); + if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11) < 0)) __Pyx_ErrFetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); + __Pyx_XGOTREF(__pyx_t_9); + __Pyx_XGOTREF(__pyx_t_10); + __Pyx_XGOTREF(__pyx_t_11); + __Pyx_XGOTREF(__pyx_t_12); + __Pyx_XGOTREF(__pyx_t_13); + __Pyx_XGOTREF(__pyx_t_14); + __pyx_t_4 = __pyx_lineno; __pyx_t_7 = __pyx_clineno; __pyx_t_8 = __pyx_filename; + { + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_io, __pyx_n_s_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 336, __pyx_L7_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 336, __pyx_L7_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + if (PY_MAJOR_VERSION >= 3) { + __Pyx_XGIVEREF(__pyx_t_12); + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14); + } + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_ErrRestore(__pyx_t_9, __pyx_t_10, __pyx_t_11); + __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; + __pyx_lineno = __pyx_t_4; __pyx_clineno = __pyx_t_7; __pyx_filename = __pyx_t_8; + goto __pyx_L1_error; + __pyx_L7_error:; + if (PY_MAJOR_VERSION >= 3) { + __Pyx_XGIVEREF(__pyx_t_12); + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14); + } + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; + goto __pyx_L1_error; + } + __pyx_L3_return: { + __pyx_t_14 = __pyx_r; + __pyx_r = 0; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_io, __pyx_n_s_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 336, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 336, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_14; + __pyx_t_14 = 0; + goto __pyx_L0; + } + } + + /* "src/gevent/_hub_primitives.py":320 + * + * + * def wait_read(fileno, timeout=None, timeout_exc=_NONE): # <<<<<<<<<<<<<< + * """ + * wait_read(fileno, timeout=None, [timeout_exc=None]) -> None + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("gevent.__hub_primitives.wait_read", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_hub); + __Pyx_XDECREF(__pyx_v_io); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_16__hub_primitives_11wait_read(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6gevent_16__hub_primitives_10wait_read[] = "wait_read(fileno, timeout=None, timeout_exc=_NONE)\n\n wait_read(fileno, timeout=None, [timeout_exc=None]) -> None\n\n Block the current greenlet until *fileno* is ready to read.\n\n For the meaning of the other parameters and possible exceptions,\n see :func:`wait`.\n\n .. seealso:: :func:`cancel_wait`\n "; +static PyMethodDef __pyx_mdef_6gevent_16__hub_primitives_11wait_read = {"wait_read", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_16__hub_primitives_11wait_read, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_16__hub_primitives_10wait_read}; +static PyObject *__pyx_pw_6gevent_16__hub_primitives_11wait_read(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_fileno = 0; + PyObject *__pyx_v_timeout = 0; + PyObject *__pyx_v_timeout_exc = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("wait_read (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_fileno,&__pyx_n_s_timeout,&__pyx_n_s_timeout_exc,0}; + PyObject* values[3] = {0,0,0}; + values[1] = ((PyObject *)Py_None); + values[2] = __pyx_k__3; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_fileno)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_timeout); + if (value) { values[1] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 2: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_timeout_exc); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "wait_read") < 0)) __PYX_ERR(0, 320, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_fileno = values[0]; + __pyx_v_timeout = values[1]; + __pyx_v_timeout_exc = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("wait_read", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 320, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.__hub_primitives.wait_read", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_16__hub_primitives_10wait_read(__pyx_self, __pyx_v_fileno, __pyx_v_timeout, __pyx_v_timeout_exc); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_16__hub_primitives_10wait_read(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_fileno, PyObject *__pyx_v_timeout, PyObject *__pyx_v_timeout_exc) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + struct __pyx_opt_args_6gevent_16__hub_primitives_wait_read __pyx_t_2; + __Pyx_RefNannySetupContext("wait_read", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_2.__pyx_n = 2; + __pyx_t_2.timeout = __pyx_v_timeout; + __pyx_t_2.timeout_exc = __pyx_v_timeout_exc; + __pyx_t_1 = __pyx_f_6gevent_16__hub_primitives_wait_read(__pyx_v_fileno, 0, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 320, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__hub_primitives.wait_read", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_hub_primitives.py":339 + * + * + * def wait_write(fileno, timeout=None, timeout_exc=_NONE, event=_NONE): # <<<<<<<<<<<<<< + * """ + * wait_write(fileno, timeout=None, [timeout_exc=None]) -> None + */ + +static PyObject *__pyx_pw_6gevent_16__hub_primitives_13wait_write(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_6gevent_16__hub_primitives_wait_write(PyObject *__pyx_v_fileno, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_16__hub_primitives_wait_write *__pyx_optional_args) { + PyObject *__pyx_v_timeout = ((PyObject *)Py_None); + PyObject *__pyx_v_timeout_exc = __pyx_k__4; + struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *__pyx_v_hub = NULL; + PyObject *__pyx_v_io = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + struct __pyx_opt_args_6gevent_16__hub_primitives_wait_on_watcher __pyx_t_6; + int __pyx_t_7; + char const *__pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + PyObject *__pyx_t_14 = NULL; + __Pyx_RefNannySetupContext("wait_write", 0); + if (__pyx_optional_args) { + if (__pyx_optional_args->__pyx_n > 0) { + __pyx_v_timeout = __pyx_optional_args->timeout; + if (__pyx_optional_args->__pyx_n > 1) { + __pyx_v_timeout_exc = __pyx_optional_args->timeout_exc; + } + } + } + + /* "src/gevent/_hub_primitives.py":355 + * """ + * # pylint:disable=unused-argument + * hub = get_hub() # <<<<<<<<<<<<<< + * io = hub.loop.io(fileno, 2) + * try: + */ + __pyx_t_1 = ((PyObject *)__pyx_f_6gevent_11__hub_local_get_hub_noargs(0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 355, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_hub = ((struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "src/gevent/_hub_primitives.py":356 + * # pylint:disable=unused-argument + * hub = get_hub() + * io = hub.loop.io(fileno, 2) # <<<<<<<<<<<<<< + * try: + * return wait_on_watcher(io, timeout, timeout_exc, hub) + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_hub->loop, __pyx_n_s_io); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 356, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + __pyx_t_4 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_4 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_fileno, __pyx_int_2}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 356, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_fileno, __pyx_int_2}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 356, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else + #endif + { + __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 356, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (__pyx_t_3) { + __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL; + } + __Pyx_INCREF(__pyx_v_fileno); + __Pyx_GIVEREF(__pyx_v_fileno); + PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_fileno); + __Pyx_INCREF(__pyx_int_2); + __Pyx_GIVEREF(__pyx_int_2); + PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_int_2); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 356, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_io = __pyx_t_1; + __pyx_t_1 = 0; + + /* "src/gevent/_hub_primitives.py":357 + * hub = get_hub() + * io = hub.loop.io(fileno, 2) + * try: # <<<<<<<<<<<<<< + * return wait_on_watcher(io, timeout, timeout_exc, hub) + * finally: + */ + /*try:*/ { + + /* "src/gevent/_hub_primitives.py":358 + * io = hub.loop.io(fileno, 2) + * try: + * return wait_on_watcher(io, timeout, timeout_exc, hub) # <<<<<<<<<<<<<< + * finally: + * io.close() + */ + __Pyx_XDECREF(__pyx_r); + if (!(likely(((((PyObject *)__pyx_v_hub)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_hub), __pyx_ptype_6gevent_16__hub_primitives_WaitOperationsGreenlet))))) __PYX_ERR(0, 358, __pyx_L4_error) + __pyx_t_6.__pyx_n = 3; + __pyx_t_6.timeout = __pyx_v_timeout; + __pyx_t_6.timeout_exc = __pyx_v_timeout_exc; + __pyx_t_6.hub = ((struct __pyx_obj_6gevent_16__hub_primitives_WaitOperationsGreenlet *)__pyx_v_hub); + __pyx_t_1 = __pyx_f_6gevent_16__hub_primitives_wait_on_watcher(__pyx_v_io, 0, &__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 358, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L3_return; + } + + /* "src/gevent/_hub_primitives.py":360 + * return wait_on_watcher(io, timeout, timeout_exc, hub) + * finally: + * io.close() # <<<<<<<<<<<<<< + * + * + */ + /*finally:*/ { + __pyx_L4_error:; + /*exception exit:*/{ + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14); + if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11) < 0)) __Pyx_ErrFetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); + __Pyx_XGOTREF(__pyx_t_9); + __Pyx_XGOTREF(__pyx_t_10); + __Pyx_XGOTREF(__pyx_t_11); + __Pyx_XGOTREF(__pyx_t_12); + __Pyx_XGOTREF(__pyx_t_13); + __Pyx_XGOTREF(__pyx_t_14); + __pyx_t_4 = __pyx_lineno; __pyx_t_7 = __pyx_clineno; __pyx_t_8 = __pyx_filename; + { + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_io, __pyx_n_s_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 360, __pyx_L7_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 360, __pyx_L7_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + if (PY_MAJOR_VERSION >= 3) { + __Pyx_XGIVEREF(__pyx_t_12); + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14); + } + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_ErrRestore(__pyx_t_9, __pyx_t_10, __pyx_t_11); + __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; + __pyx_lineno = __pyx_t_4; __pyx_clineno = __pyx_t_7; __pyx_filename = __pyx_t_8; + goto __pyx_L1_error; + __pyx_L7_error:; + if (PY_MAJOR_VERSION >= 3) { + __Pyx_XGIVEREF(__pyx_t_12); + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14); + } + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; + goto __pyx_L1_error; + } + __pyx_L3_return: { + __pyx_t_14 = __pyx_r; + __pyx_r = 0; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_io, __pyx_n_s_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 360, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 360, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_14; + __pyx_t_14 = 0; + goto __pyx_L0; + } + } + + /* "src/gevent/_hub_primitives.py":339 + * + * + * def wait_write(fileno, timeout=None, timeout_exc=_NONE, event=_NONE): # <<<<<<<<<<<<<< + * """ + * wait_write(fileno, timeout=None, [timeout_exc=None]) -> None + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("gevent.__hub_primitives.wait_write", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_hub); + __Pyx_XDECREF(__pyx_v_io); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_16__hub_primitives_13wait_write(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6gevent_16__hub_primitives_12wait_write[] = "wait_write(fileno, timeout=None, timeout_exc=_NONE, event=_NONE)\n\n wait_write(fileno, timeout=None, [timeout_exc=None]) -> None\n\n Block the current greenlet until *fileno* is ready to write.\n\n For the meaning of the other parameters and possible exceptions,\n see :func:`wait`.\n\n .. deprecated:: 1.1\n The keyword argument *event* is ignored. Applications should not pass this parameter.\n In the future, doing so will become an error.\n\n .. seealso:: :func:`cancel_wait`\n "; +static PyMethodDef __pyx_mdef_6gevent_16__hub_primitives_13wait_write = {"wait_write", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_16__hub_primitives_13wait_write, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_16__hub_primitives_12wait_write}; +static PyObject *__pyx_pw_6gevent_16__hub_primitives_13wait_write(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_fileno = 0; + PyObject *__pyx_v_timeout = 0; + PyObject *__pyx_v_timeout_exc = 0; + PyObject *__pyx_v_event = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("wait_write (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_fileno,&__pyx_n_s_timeout,&__pyx_n_s_timeout_exc,&__pyx_n_s_event,0}; + PyObject* values[4] = {0,0,0,0}; + values[1] = ((PyObject *)Py_None); + values[2] = __pyx_k__4; + values[3] = __pyx_k__5; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_fileno)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_timeout); + if (value) { values[1] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 2: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_timeout_exc); + if (value) { values[2] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 3: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_event); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "wait_write") < 0)) __PYX_ERR(0, 339, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_fileno = values[0]; + __pyx_v_timeout = values[1]; + __pyx_v_timeout_exc = values[2]; + __pyx_v_event = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("wait_write", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 339, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.__hub_primitives.wait_write", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_16__hub_primitives_12wait_write(__pyx_self, __pyx_v_fileno, __pyx_v_timeout, __pyx_v_timeout_exc, __pyx_v_event); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_16__hub_primitives_12wait_write(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_fileno, PyObject *__pyx_v_timeout, PyObject *__pyx_v_timeout_exc, PyObject *__pyx_v_event) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + struct __pyx_opt_args_6gevent_16__hub_primitives_wait_write __pyx_t_2; + __Pyx_RefNannySetupContext("wait_write", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_2.__pyx_n = 3; + __pyx_t_2.timeout = __pyx_v_timeout; + __pyx_t_2.timeout_exc = __pyx_v_timeout_exc; + __pyx_t_2.event = __pyx_v_event; + __pyx_t_1 = __pyx_f_6gevent_16__hub_primitives_wait_write(__pyx_v_fileno, 0, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 339, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__hub_primitives.wait_write", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_hub_primitives.py":363 + * + * + * def wait_readwrite(fileno, timeout=None, timeout_exc=_NONE, event=_NONE): # <<<<<<<<<<<<<< + * """ + * wait_readwrite(fileno, timeout=None, [timeout_exc=None]) -> None + */ + +static PyObject *__pyx_pw_6gevent_16__hub_primitives_15wait_readwrite(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_6gevent_16__hub_primitives_wait_readwrite(PyObject *__pyx_v_fileno, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_16__hub_primitives_wait_readwrite *__pyx_optional_args) { + PyObject *__pyx_v_timeout = ((PyObject *)Py_None); + PyObject *__pyx_v_timeout_exc = __pyx_k__6; + struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *__pyx_v_hub = NULL; + PyObject *__pyx_v_io = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + struct __pyx_opt_args_6gevent_16__hub_primitives_wait_on_watcher __pyx_t_6; + int __pyx_t_7; + char const *__pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + PyObject *__pyx_t_14 = NULL; + __Pyx_RefNannySetupContext("wait_readwrite", 0); + if (__pyx_optional_args) { + if (__pyx_optional_args->__pyx_n > 0) { + __pyx_v_timeout = __pyx_optional_args->timeout; + if (__pyx_optional_args->__pyx_n > 1) { + __pyx_v_timeout_exc = __pyx_optional_args->timeout_exc; + } + } + } + + /* "src/gevent/_hub_primitives.py":380 + * """ + * # pylint:disable=unused-argument + * hub = get_hub() # <<<<<<<<<<<<<< + * io = hub.loop.io(fileno, 3) + * try: + */ + __pyx_t_1 = ((PyObject *)__pyx_f_6gevent_11__hub_local_get_hub_noargs(0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 380, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_hub = ((struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "src/gevent/_hub_primitives.py":381 + * # pylint:disable=unused-argument + * hub = get_hub() + * io = hub.loop.io(fileno, 3) # <<<<<<<<<<<<<< + * try: + * return wait_on_watcher(io, timeout, timeout_exc, hub) + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_hub->loop, __pyx_n_s_io); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 381, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + __pyx_t_4 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_4 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_fileno, __pyx_int_3}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 381, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_fileno, __pyx_int_3}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 381, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else + #endif + { + __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 381, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (__pyx_t_3) { + __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL; + } + __Pyx_INCREF(__pyx_v_fileno); + __Pyx_GIVEREF(__pyx_v_fileno); + PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_fileno); + __Pyx_INCREF(__pyx_int_3); + __Pyx_GIVEREF(__pyx_int_3); + PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_int_3); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 381, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_io = __pyx_t_1; + __pyx_t_1 = 0; + + /* "src/gevent/_hub_primitives.py":382 + * hub = get_hub() + * io = hub.loop.io(fileno, 3) + * try: # <<<<<<<<<<<<<< + * return wait_on_watcher(io, timeout, timeout_exc, hub) + * finally: + */ + /*try:*/ { + + /* "src/gevent/_hub_primitives.py":383 + * io = hub.loop.io(fileno, 3) + * try: + * return wait_on_watcher(io, timeout, timeout_exc, hub) # <<<<<<<<<<<<<< + * finally: + * io.close() + */ + __Pyx_XDECREF(__pyx_r); + if (!(likely(((((PyObject *)__pyx_v_hub)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_hub), __pyx_ptype_6gevent_16__hub_primitives_WaitOperationsGreenlet))))) __PYX_ERR(0, 383, __pyx_L4_error) + __pyx_t_6.__pyx_n = 3; + __pyx_t_6.timeout = __pyx_v_timeout; + __pyx_t_6.timeout_exc = __pyx_v_timeout_exc; + __pyx_t_6.hub = ((struct __pyx_obj_6gevent_16__hub_primitives_WaitOperationsGreenlet *)__pyx_v_hub); + __pyx_t_1 = __pyx_f_6gevent_16__hub_primitives_wait_on_watcher(__pyx_v_io, 0, &__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 383, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L3_return; + } + + /* "src/gevent/_hub_primitives.py":385 + * return wait_on_watcher(io, timeout, timeout_exc, hub) + * finally: + * io.close() # <<<<<<<<<<<<<< + * + * + */ + /*finally:*/ { + __pyx_L4_error:; + /*exception exit:*/{ + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14); + if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11) < 0)) __Pyx_ErrFetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); + __Pyx_XGOTREF(__pyx_t_9); + __Pyx_XGOTREF(__pyx_t_10); + __Pyx_XGOTREF(__pyx_t_11); + __Pyx_XGOTREF(__pyx_t_12); + __Pyx_XGOTREF(__pyx_t_13); + __Pyx_XGOTREF(__pyx_t_14); + __pyx_t_4 = __pyx_lineno; __pyx_t_7 = __pyx_clineno; __pyx_t_8 = __pyx_filename; + { + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_io, __pyx_n_s_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 385, __pyx_L7_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 385, __pyx_L7_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + if (PY_MAJOR_VERSION >= 3) { + __Pyx_XGIVEREF(__pyx_t_12); + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14); + } + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_ErrRestore(__pyx_t_9, __pyx_t_10, __pyx_t_11); + __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; + __pyx_lineno = __pyx_t_4; __pyx_clineno = __pyx_t_7; __pyx_filename = __pyx_t_8; + goto __pyx_L1_error; + __pyx_L7_error:; + if (PY_MAJOR_VERSION >= 3) { + __Pyx_XGIVEREF(__pyx_t_12); + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14); + } + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; + goto __pyx_L1_error; + } + __pyx_L3_return: { + __pyx_t_14 = __pyx_r; + __pyx_r = 0; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_io, __pyx_n_s_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 385, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 385, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_14; + __pyx_t_14 = 0; + goto __pyx_L0; + } + } + + /* "src/gevent/_hub_primitives.py":363 + * + * + * def wait_readwrite(fileno, timeout=None, timeout_exc=_NONE, event=_NONE): # <<<<<<<<<<<<<< + * """ + * wait_readwrite(fileno, timeout=None, [timeout_exc=None]) -> None + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("gevent.__hub_primitives.wait_readwrite", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_hub); + __Pyx_XDECREF(__pyx_v_io); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_16__hub_primitives_15wait_readwrite(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6gevent_16__hub_primitives_14wait_readwrite[] = "wait_readwrite(fileno, timeout=None, timeout_exc=_NONE, event=_NONE)\n\n wait_readwrite(fileno, timeout=None, [timeout_exc=None]) -> None\n\n Block the current greenlet until *fileno* is ready to read or\n write.\n\n For the meaning of the other parameters and possible exceptions,\n see :func:`wait`.\n\n .. deprecated:: 1.1\n The keyword argument *event* is ignored. Applications should not pass this parameter.\n In the future, doing so will become an error.\n\n .. seealso:: :func:`cancel_wait`\n "; +static PyMethodDef __pyx_mdef_6gevent_16__hub_primitives_15wait_readwrite = {"wait_readwrite", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_16__hub_primitives_15wait_readwrite, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_16__hub_primitives_14wait_readwrite}; +static PyObject *__pyx_pw_6gevent_16__hub_primitives_15wait_readwrite(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_fileno = 0; + PyObject *__pyx_v_timeout = 0; + PyObject *__pyx_v_timeout_exc = 0; + PyObject *__pyx_v_event = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("wait_readwrite (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_fileno,&__pyx_n_s_timeout,&__pyx_n_s_timeout_exc,&__pyx_n_s_event,0}; + PyObject* values[4] = {0,0,0,0}; + values[1] = ((PyObject *)Py_None); + values[2] = __pyx_k__6; + values[3] = __pyx_k__7; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_fileno)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_timeout); + if (value) { values[1] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 2: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_timeout_exc); + if (value) { values[2] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 3: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_event); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "wait_readwrite") < 0)) __PYX_ERR(0, 363, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_fileno = values[0]; + __pyx_v_timeout = values[1]; + __pyx_v_timeout_exc = values[2]; + __pyx_v_event = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("wait_readwrite", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 363, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.__hub_primitives.wait_readwrite", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_16__hub_primitives_14wait_readwrite(__pyx_self, __pyx_v_fileno, __pyx_v_timeout, __pyx_v_timeout_exc, __pyx_v_event); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_16__hub_primitives_14wait_readwrite(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_fileno, PyObject *__pyx_v_timeout, PyObject *__pyx_v_timeout_exc, PyObject *__pyx_v_event) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + struct __pyx_opt_args_6gevent_16__hub_primitives_wait_readwrite __pyx_t_2; + __Pyx_RefNannySetupContext("wait_readwrite", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_2.__pyx_n = 3; + __pyx_t_2.timeout = __pyx_v_timeout; + __pyx_t_2.timeout_exc = __pyx_v_timeout_exc; + __pyx_t_2.event = __pyx_v_event; + __pyx_t_1 = __pyx_f_6gevent_16__hub_primitives_wait_readwrite(__pyx_v_fileno, 0, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 363, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__hub_primitives.wait_readwrite", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_hub_primitives.py":388 + * + * + * def _init(): # <<<<<<<<<<<<<< + * greenlet_init() # pylint:disable=undefined-variable + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_16__hub_primitives_17_init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6gevent_16__hub_primitives_16_init[] = "_init()"; +static PyMethodDef __pyx_mdef_6gevent_16__hub_primitives_17_init = {"_init", (PyCFunction)__pyx_pw_6gevent_16__hub_primitives_17_init, METH_NOARGS, __pyx_doc_6gevent_16__hub_primitives_16_init}; +static PyObject *__pyx_pw_6gevent_16__hub_primitives_17_init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_init (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_16__hub_primitives_16_init(__pyx_self); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_16__hub_primitives_16_init(CYTHON_UNUSED PyObject *__pyx_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_init", 0); + + /* "src/gevent/_hub_primitives.py":389 + * + * def _init(): + * greenlet_init() # pylint:disable=undefined-variable # <<<<<<<<<<<<<< + * + * _init() + */ + __pyx_f_6gevent_16__hub_primitives_greenlet_init(); + + /* "src/gevent/_hub_primitives.py":388 + * + * + * def _init(): # <<<<<<<<<<<<<< + * greenlet_init() # pylint:disable=undefined-variable + * + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/__greenlet_primitives.pxd":23 + * + * @cython.final + * cdef inline greenlet getcurrent(): # <<<<<<<<<<<<<< + * return PyGreenlet_GetCurrent() + * + */ + +static CYTHON_INLINE PyGreenlet *__pyx_f_6gevent_21__greenlet_primitives_getcurrent(void) { + PyGreenlet *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("getcurrent", 0); + + /* "gevent/__greenlet_primitives.pxd":24 + * @cython.final + * cdef inline greenlet getcurrent(): + * return PyGreenlet_GetCurrent() # <<<<<<<<<<<<<< + * + * cdef bint _greenlet_imported + */ + __Pyx_XDECREF(((PyObject *)__pyx_r)); + __pyx_t_1 = ((PyObject *)PyGreenlet_GetCurrent()); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 24, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = ((PyGreenlet *)__pyx_t_1); + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "gevent/__greenlet_primitives.pxd":23 + * + * @cython.final + * cdef inline greenlet getcurrent(): # <<<<<<<<<<<<<< + * return PyGreenlet_GetCurrent() + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__greenlet_primitives.getcurrent", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF((PyObject *)__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/__greenlet_primitives.pxd":28 + * cdef bint _greenlet_imported + * + * cdef inline void greenlet_init(): # <<<<<<<<<<<<<< + * global _greenlet_imported + * if not _greenlet_imported: + */ + +static CYTHON_INLINE void __pyx_f_6gevent_21__greenlet_primitives_greenlet_init(void) { + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("greenlet_init", 0); + + /* "gevent/__greenlet_primitives.pxd":30 + * cdef inline void greenlet_init(): + * global _greenlet_imported + * if not _greenlet_imported: # <<<<<<<<<<<<<< + * PyGreenlet_Import() + * _greenlet_imported = True + */ + __pyx_t_1 = ((!(__pyx_v_6gevent_21__greenlet_primitives__greenlet_imported != 0)) != 0); + if (__pyx_t_1) { + + /* "gevent/__greenlet_primitives.pxd":31 + * global _greenlet_imported + * if not _greenlet_imported: + * PyGreenlet_Import() # <<<<<<<<<<<<<< + * _greenlet_imported = True + * + */ + PyGreenlet_Import(); + + /* "gevent/__greenlet_primitives.pxd":32 + * if not _greenlet_imported: + * PyGreenlet_Import() + * _greenlet_imported = True # <<<<<<<<<<<<<< + * + * cdef inline object _greenlet_switch(greenlet self): + */ + __pyx_v_6gevent_21__greenlet_primitives__greenlet_imported = 1; + + /* "gevent/__greenlet_primitives.pxd":30 + * cdef inline void greenlet_init(): + * global _greenlet_imported + * if not _greenlet_imported: # <<<<<<<<<<<<<< + * PyGreenlet_Import() + * _greenlet_imported = True + */ + } + + /* "gevent/__greenlet_primitives.pxd":28 + * cdef bint _greenlet_imported + * + * cdef inline void greenlet_init(): # <<<<<<<<<<<<<< + * global _greenlet_imported + * if not _greenlet_imported: + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "gevent/__greenlet_primitives.pxd":34 + * _greenlet_imported = True + * + * cdef inline object _greenlet_switch(greenlet self): # <<<<<<<<<<<<<< + * return PyGreenlet_Switch(self, NULL, NULL) + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_6gevent_21__greenlet_primitives__greenlet_switch(PyGreenlet *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("_greenlet_switch", 0); + + /* "gevent/__greenlet_primitives.pxd":35 + * + * cdef inline object _greenlet_switch(greenlet self): + * return PyGreenlet_Switch(self, NULL, NULL) # <<<<<<<<<<<<<< + * + * cdef class TrackedRawGreenlet(greenlet): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyGreenlet_Switch(__pyx_v_self, NULL, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 35, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "gevent/__greenlet_primitives.pxd":34 + * _greenlet_imported = True + * + * cdef inline object _greenlet_switch(greenlet self): # <<<<<<<<<<<<<< + * return PyGreenlet_Switch(self, NULL, NULL) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__greenlet_primitives._greenlet_switch", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/__waiter.pxd":24 + * void PyGreenlet_Import() + * + * cdef inline greenlet getcurrent(): # <<<<<<<<<<<<<< + * return PyGreenlet_GetCurrent() + * + */ + +static CYTHON_INLINE PyGreenlet *__pyx_f_6gevent_8__waiter_getcurrent(void) { + PyGreenlet *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("getcurrent", 0); + + /* "gevent/__waiter.pxd":25 + * + * cdef inline greenlet getcurrent(): + * return PyGreenlet_GetCurrent() # <<<<<<<<<<<<<< + * + * cdef inline void greenlet_init(): + */ + __Pyx_XDECREF(((PyObject *)__pyx_r)); + __pyx_t_1 = ((PyObject *)PyGreenlet_GetCurrent()); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 25, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = ((PyGreenlet *)__pyx_t_1); + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "gevent/__waiter.pxd":24 + * void PyGreenlet_Import() + * + * cdef inline greenlet getcurrent(): # <<<<<<<<<<<<<< + * return PyGreenlet_GetCurrent() + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__waiter.getcurrent", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF((PyObject *)__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/__waiter.pxd":27 + * return PyGreenlet_GetCurrent() + * + * cdef inline void greenlet_init(): # <<<<<<<<<<<<<< + * global _greenlet_imported + * if not _greenlet_imported: + */ + +static CYTHON_INLINE void __pyx_f_6gevent_8__waiter_greenlet_init(void) { + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("greenlet_init", 0); + + /* "gevent/__waiter.pxd":29 + * cdef inline void greenlet_init(): + * global _greenlet_imported + * if not _greenlet_imported: # <<<<<<<<<<<<<< + * PyGreenlet_Import() + * _greenlet_imported = True + */ + __pyx_t_1 = ((!(__pyx_v_6gevent_8__waiter__greenlet_imported != 0)) != 0); + if (__pyx_t_1) { + + /* "gevent/__waiter.pxd":30 + * global _greenlet_imported + * if not _greenlet_imported: + * PyGreenlet_Import() # <<<<<<<<<<<<<< + * _greenlet_imported = True + * + */ + PyGreenlet_Import(); + + /* "gevent/__waiter.pxd":31 + * if not _greenlet_imported: + * PyGreenlet_Import() + * _greenlet_imported = True # <<<<<<<<<<<<<< + * + * cdef class Waiter: + */ + __pyx_v_6gevent_8__waiter__greenlet_imported = 1; + + /* "gevent/__waiter.pxd":29 + * cdef inline void greenlet_init(): + * global _greenlet_imported + * if not _greenlet_imported: # <<<<<<<<<<<<<< + * PyGreenlet_Import() + * _greenlet_imported = True + */ + } + + /* "gevent/__waiter.pxd":27 + * return PyGreenlet_GetCurrent() + * + * cdef inline void greenlet_init(): # <<<<<<<<<<<<<< + * global _greenlet_imported + * if not _greenlet_imported: + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "gevent/__hub_primitives.pxd":29 + * + * @cython.final + * cdef inline greenlet getcurrent(): # <<<<<<<<<<<<<< + * return PyGreenlet_GetCurrent() + * + */ + +static CYTHON_INLINE PyGreenlet *__pyx_f_6gevent_16__hub_primitives_getcurrent(void) { + PyGreenlet *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("getcurrent", 0); + + /* "gevent/__hub_primitives.pxd":30 + * @cython.final + * cdef inline greenlet getcurrent(): + * return PyGreenlet_GetCurrent() # <<<<<<<<<<<<<< + * + * cdef bint _greenlet_imported + */ + __Pyx_XDECREF(((PyObject *)__pyx_r)); + __pyx_t_1 = ((PyObject *)PyGreenlet_GetCurrent()); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 30, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = ((PyGreenlet *)__pyx_t_1); + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "gevent/__hub_primitives.pxd":29 + * + * @cython.final + * cdef inline greenlet getcurrent(): # <<<<<<<<<<<<<< + * return PyGreenlet_GetCurrent() + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__hub_primitives.getcurrent", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF((PyObject *)__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/__hub_primitives.pxd":34 + * cdef bint _greenlet_imported + * + * cdef inline void greenlet_init(): # <<<<<<<<<<<<<< + * global _greenlet_imported + * if not _greenlet_imported: + */ + +static CYTHON_INLINE void __pyx_f_6gevent_16__hub_primitives_greenlet_init(void) { + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("greenlet_init", 0); + + /* "gevent/__hub_primitives.pxd":36 + * cdef inline void greenlet_init(): + * global _greenlet_imported + * if not _greenlet_imported: # <<<<<<<<<<<<<< + * PyGreenlet_Import() + * _greenlet_imported = True + */ + __pyx_t_1 = ((!(__pyx_v_6gevent_16__hub_primitives__greenlet_imported != 0)) != 0); + if (__pyx_t_1) { + + /* "gevent/__hub_primitives.pxd":37 + * global _greenlet_imported + * if not _greenlet_imported: + * PyGreenlet_Import() # <<<<<<<<<<<<<< + * _greenlet_imported = True + * + */ + PyGreenlet_Import(); + + /* "gevent/__hub_primitives.pxd":38 + * if not _greenlet_imported: + * PyGreenlet_Import() + * _greenlet_imported = True # <<<<<<<<<<<<<< + * + * + */ + __pyx_v_6gevent_16__hub_primitives__greenlet_imported = 1; + + /* "gevent/__hub_primitives.pxd":36 + * cdef inline void greenlet_init(): + * global _greenlet_imported + * if not _greenlet_imported: # <<<<<<<<<<<<<< + * PyGreenlet_Import() + * _greenlet_imported = True + */ + } + + /* "gevent/__hub_primitives.pxd":34 + * cdef bint _greenlet_imported + * + * cdef inline void greenlet_init(): # <<<<<<<<<<<<<< + * global _greenlet_imported + * if not _greenlet_imported: + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} +static struct __pyx_vtabstruct_6gevent_16__hub_primitives_WaitOperationsGreenlet __pyx_vtable_6gevent_16__hub_primitives_WaitOperationsGreenlet; + +static PyObject *__pyx_tp_new_6gevent_16__hub_primitives_WaitOperationsGreenlet(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_6gevent_16__hub_primitives_WaitOperationsGreenlet *p; + PyObject *o = __pyx_ptype_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop->tp_new(t, a, k); + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_6gevent_16__hub_primitives_WaitOperationsGreenlet *)o); + p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop*)__pyx_vtabptr_6gevent_16__hub_primitives_WaitOperationsGreenlet; + return o; +} + +static void __pyx_tp_dealloc_6gevent_16__hub_primitives_WaitOperationsGreenlet(PyObject *o) { + #if CYTHON_USE_TP_FINALIZE + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + PyObject_GC_UnTrack(o); + PyObject_GC_Track(o); + if (likely(__pyx_ptype_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop)) __pyx_ptype_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop->tp_dealloc(o); else __Pyx_call_next_tp_dealloc(o, __pyx_tp_dealloc_6gevent_16__hub_primitives_WaitOperationsGreenlet); +} + +static int __pyx_tp_traverse_6gevent_16__hub_primitives_WaitOperationsGreenlet(PyObject *o, visitproc v, void *a) { + int e; + e = ((likely(__pyx_ptype_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop)) ? ((__pyx_ptype_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop->tp_traverse) ? __pyx_ptype_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_6gevent_16__hub_primitives_WaitOperationsGreenlet)); if (e) return e; + return 0; +} + +static int __pyx_tp_clear_6gevent_16__hub_primitives_WaitOperationsGreenlet(PyObject *o) { + if (likely(__pyx_ptype_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop)) { if (__pyx_ptype_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop->tp_clear) __pyx_ptype_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_6gevent_16__hub_primitives_WaitOperationsGreenlet); + return 0; +} + +static PyMethodDef __pyx_methods_6gevent_16__hub_primitives_WaitOperationsGreenlet[] = { + {0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_6gevent_16__hub_primitives_WaitOperationsGreenlet = { + PyVarObject_HEAD_INIT(0, 0) + "gevent.__hub_primitives.WaitOperationsGreenlet", /*tp_name*/ + sizeof(struct __pyx_obj_6gevent_16__hub_primitives_WaitOperationsGreenlet), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6gevent_16__hub_primitives_WaitOperationsGreenlet, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_6gevent_16__hub_primitives_WaitOperationsGreenlet, /*tp_traverse*/ + __pyx_tp_clear_6gevent_16__hub_primitives_WaitOperationsGreenlet, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6gevent_16__hub_primitives_WaitOperationsGreenlet, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6gevent_16__hub_primitives_WaitOperationsGreenlet, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; +static struct __pyx_vtabstruct_6gevent_16__hub_primitives__WaitIterator __pyx_vtable_6gevent_16__hub_primitives__WaitIterator; + +static PyObject *__pyx_tp_new_6gevent_16__hub_primitives__WaitIterator(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + struct __pyx_obj_6gevent_16__hub_primitives__WaitIterator *p; + PyObject *o; + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_6gevent_16__hub_primitives__WaitIterator *)o); + p->__pyx_vtab = __pyx_vtabptr_6gevent_16__hub_primitives__WaitIterator; + p->_hub = ((struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *)Py_None); Py_INCREF(Py_None); + p->_waiter = ((struct __pyx_obj_6gevent_8__waiter_MultipleWaiter *)Py_None); Py_INCREF(Py_None); + p->_switch = Py_None; Py_INCREF(Py_None); + p->_timeout = Py_None; Py_INCREF(Py_None); + p->_objects = Py_None; Py_INCREF(Py_None); + p->_timer = Py_None; Py_INCREF(Py_None); + return o; +} + +static void __pyx_tp_dealloc_6gevent_16__hub_primitives__WaitIterator(PyObject *o) { + struct __pyx_obj_6gevent_16__hub_primitives__WaitIterator *p = (struct __pyx_obj_6gevent_16__hub_primitives__WaitIterator *)o; + #if CYTHON_USE_TP_FINALIZE + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + PyObject_GC_UnTrack(o); + Py_CLEAR(p->_hub); + Py_CLEAR(p->_waiter); + Py_CLEAR(p->_switch); + Py_CLEAR(p->_timeout); + Py_CLEAR(p->_objects); + Py_CLEAR(p->_timer); + (*Py_TYPE(o)->tp_free)(o); +} + +static int __pyx_tp_traverse_6gevent_16__hub_primitives__WaitIterator(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_6gevent_16__hub_primitives__WaitIterator *p = (struct __pyx_obj_6gevent_16__hub_primitives__WaitIterator *)o; + if (p->_hub) { + e = (*v)(((PyObject *)p->_hub), a); if (e) return e; + } + if (p->_waiter) { + e = (*v)(((PyObject *)p->_waiter), a); if (e) return e; + } + if (p->_switch) { + e = (*v)(p->_switch, a); if (e) return e; + } + if (p->_timeout) { + e = (*v)(p->_timeout, a); if (e) return e; + } + if (p->_objects) { + e = (*v)(p->_objects, a); if (e) return e; + } + if (p->_timer) { + e = (*v)(p->_timer, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_6gevent_16__hub_primitives__WaitIterator(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_6gevent_16__hub_primitives__WaitIterator *p = (struct __pyx_obj_6gevent_16__hub_primitives__WaitIterator *)o; + tmp = ((PyObject*)p->_hub); + p->_hub = ((struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->_waiter); + p->_waiter = ((struct __pyx_obj_6gevent_8__waiter_MultipleWaiter *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->_switch); + p->_switch = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->_timeout); + p->_timeout = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->_objects); + p->_objects = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->_timer); + p->_timer = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyObject *__pyx_specialmethod___pyx_pw_6gevent_16__hub_primitives_13_WaitIterator_5__next__(PyObject *self, CYTHON_UNUSED PyObject *arg) {return __pyx_pw_6gevent_16__hub_primitives_13_WaitIterator_5__next__(self);} + +static PyMethodDef __pyx_methods_6gevent_16__hub_primitives__WaitIterator[] = { + {"__next__", (PyCFunction)__pyx_specialmethod___pyx_pw_6gevent_16__hub_primitives_13_WaitIterator_5__next__, METH_NOARGS|METH_COEXIST, 0}, + {0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_6gevent_16__hub_primitives__WaitIterator = { + PyVarObject_HEAD_INIT(0, 0) + "gevent.__hub_primitives._WaitIterator", /*tp_name*/ + sizeof(struct __pyx_obj_6gevent_16__hub_primitives__WaitIterator), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6gevent_16__hub_primitives__WaitIterator, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + "_WaitIterator(objects, hub, timeout, count)", /*tp_doc*/ + __pyx_tp_traverse_6gevent_16__hub_primitives__WaitIterator, /*tp_traverse*/ + __pyx_tp_clear_6gevent_16__hub_primitives__WaitIterator, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + __pyx_pw_6gevent_16__hub_primitives_13_WaitIterator_3__iter__, /*tp_iter*/ + __pyx_pw_6gevent_16__hub_primitives_13_WaitIterator_5__next__, /*tp_iternext*/ + __pyx_methods_6gevent_16__hub_primitives__WaitIterator, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_pw_6gevent_16__hub_primitives_13_WaitIterator_1__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6gevent_16__hub_primitives__WaitIterator, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static PyMethodDef __pyx_methods[] = { + {0, 0, 0, 0} +}; + +#if PY_MAJOR_VERSION >= 3 +#if CYTHON_PEP489_MULTI_PHASE_INIT +static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ +static int __pyx_pymod_exec___hub_primitives(PyObject* module); /*proto*/ +static PyModuleDef_Slot __pyx_moduledef_slots[] = { + {Py_mod_create, (void*)__pyx_pymod_create}, + {Py_mod_exec, (void*)__pyx_pymod_exec___hub_primitives}, + {0, NULL} +}; +#endif + +static struct PyModuleDef __pyx_moduledef = { + PyModuleDef_HEAD_INIT, + "__hub_primitives", + __pyx_k_A_collection_of_primitives_used, /* m_doc */ + #if CYTHON_PEP489_MULTI_PHASE_INIT + 0, /* m_size */ + #else + -1, /* m_size */ + #endif + __pyx_methods /* m_methods */, + #if CYTHON_PEP489_MULTI_PHASE_INIT + __pyx_moduledef_slots, /* m_slots */ + #else + NULL, /* m_reload */ + #endif + NULL, /* m_traverse */ + NULL, /* m_clear */ + NULL /* m_free */ +}; +#endif +#ifndef CYTHON_SMALL_CODE +#if defined(__clang__) + #define CYTHON_SMALL_CODE +#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) + #define CYTHON_SMALL_CODE __attribute__((cold)) +#else + #define CYTHON_SMALL_CODE +#endif +#endif + +static __Pyx_StringTabEntry __pyx_string_tab[] = { + {&__pyx_n_s_ConcurrentObjectUseError, __pyx_k_ConcurrentObjectUseError, sizeof(__pyx_k_ConcurrentObjectUseError), 0, 0, 1, 1}, + {&__pyx_n_s_InvalidSwitchError, __pyx_k_InvalidSwitchError, sizeof(__pyx_k_InvalidSwitchError), 0, 0, 1, 1}, + {&__pyx_kp_s_Invalid_switch_into_s_r_expected, __pyx_k_Invalid_switch_into_s_r_expected, sizeof(__pyx_k_Invalid_switch_into_s_r_expected), 0, 0, 1, 0}, + {&__pyx_n_s_MultipleWaiter, __pyx_k_MultipleWaiter, sizeof(__pyx_k_MultipleWaiter), 0, 0, 1, 1}, + {&__pyx_n_s_NONE, __pyx_k_NONE, sizeof(__pyx_k_NONE), 0, 0, 1, 1}, + {&__pyx_n_s_StopIteration, __pyx_k_StopIteration, sizeof(__pyx_k_StopIteration), 0, 0, 1, 1}, + {&__pyx_n_s_SwitchOutGreenletWithLoop, __pyx_k_SwitchOutGreenletWithLoop, sizeof(__pyx_k_SwitchOutGreenletWithLoop), 0, 0, 1, 1}, + {&__pyx_kp_s_The_socket_has_already_been_clos, __pyx_k_The_socket_has_already_been_clos, sizeof(__pyx_k_The_socket_has_already_been_clos), 0, 0, 1, 0}, + {&__pyx_kp_s_This_socket_is_already_used_by_a, __pyx_k_This_socket_is_already_used_by_a, sizeof(__pyx_k_This_socket_is_already_used_by_a), 0, 0, 1, 0}, + {&__pyx_n_s_Timeout, __pyx_k_Timeout, sizeof(__pyx_k_Timeout), 0, 0, 1, 1}, + {&__pyx_n_s_WaitIterator, __pyx_k_WaitIterator, sizeof(__pyx_k_WaitIterator), 0, 0, 1, 1}, + {&__pyx_n_s_WaitIterator___enter, __pyx_k_WaitIterator___enter, sizeof(__pyx_k_WaitIterator___enter), 0, 0, 1, 1}, + {&__pyx_n_s_WaitIterator___exit, __pyx_k_WaitIterator___exit, sizeof(__pyx_k_WaitIterator___exit), 0, 0, 1, 1}, + {&__pyx_n_s_WaitOperationsGreenlet, __pyx_k_WaitOperationsGreenlet, sizeof(__pyx_k_WaitOperationsGreenlet), 0, 0, 1, 1}, + {&__pyx_n_s_WaitOperationsGreenlet__cancel_w, __pyx_k_WaitOperationsGreenlet__cancel_w, sizeof(__pyx_k_WaitOperationsGreenlet__cancel_w), 0, 0, 1, 1}, + {&__pyx_n_s_WaitOperationsGreenlet_cancel_wa, __pyx_k_WaitOperationsGreenlet_cancel_wa, sizeof(__pyx_k_WaitOperationsGreenlet_cancel_wa), 0, 0, 1, 1}, + {&__pyx_n_s_WaitOperationsGreenlet_wait, __pyx_k_WaitOperationsGreenlet_wait, sizeof(__pyx_k_WaitOperationsGreenlet_wait), 0, 0, 1, 1}, + {&__pyx_n_s_Waiter, __pyx_k_Waiter, sizeof(__pyx_k_Waiter), 0, 0, 1, 1}, + {&__pyx_n_s_active, __pyx_k_active, sizeof(__pyx_k_active), 0, 0, 1, 1}, + {&__pyx_n_s_all, __pyx_k_all, sizeof(__pyx_k_all), 0, 0, 1, 1}, + {&__pyx_n_s_callback, __pyx_k_callback, sizeof(__pyx_k_callback), 0, 0, 1, 1}, + {&__pyx_n_s_cancel_wait, __pyx_k_cancel_wait, sizeof(__pyx_k_cancel_wait), 0, 0, 1, 1}, + {&__pyx_n_s_cancel_wait_2, __pyx_k_cancel_wait_2, sizeof(__pyx_k_cancel_wait_2), 0, 0, 1, 1}, + {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, + {&__pyx_n_s_close, __pyx_k_close, sizeof(__pyx_k_close), 0, 0, 1, 1}, + {&__pyx_n_s_close_watcher, __pyx_k_close_watcher, sizeof(__pyx_k_close_watcher), 0, 0, 1, 1}, + {&__pyx_n_s_count, __pyx_k_count, sizeof(__pyx_k_count), 0, 0, 1, 1}, + {&__pyx_n_s_e, __pyx_k_e, sizeof(__pyx_k_e), 0, 0, 1, 1}, + {&__pyx_n_s_enter, __pyx_k_enter, sizeof(__pyx_k_enter), 0, 0, 1, 1}, + {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1}, + {&__pyx_n_s_event, __pyx_k_event, sizeof(__pyx_k_event), 0, 0, 1, 1}, + {&__pyx_n_s_exit, __pyx_k_exit, sizeof(__pyx_k_exit), 0, 0, 1, 1}, + {&__pyx_n_s_fileno, __pyx_k_fileno, sizeof(__pyx_k_fileno), 0, 0, 1, 1}, + {&__pyx_n_s_get_hub_noargs, __pyx_k_get_hub_noargs, sizeof(__pyx_k_get_hub_noargs), 0, 0, 1, 1}, + {&__pyx_n_s_getcurrent, __pyx_k_getcurrent, sizeof(__pyx_k_getcurrent), 0, 0, 1, 1}, + {&__pyx_n_s_gevent, __pyx_k_gevent, sizeof(__pyx_k_gevent), 0, 0, 1, 1}, + {&__pyx_n_s_gevent___hub_primitives, __pyx_k_gevent___hub_primitives, sizeof(__pyx_k_gevent___hub_primitives), 0, 0, 1, 1}, + {&__pyx_n_s_gevent__hub_local, __pyx_k_gevent__hub_local, sizeof(__pyx_k_gevent__hub_local), 0, 0, 1, 1}, + {&__pyx_n_s_gevent__util, __pyx_k_gevent__util, sizeof(__pyx_k_gevent__util), 0, 0, 1, 1}, + {&__pyx_n_s_gevent_exceptions, __pyx_k_gevent_exceptions, sizeof(__pyx_k_gevent_exceptions), 0, 0, 1, 1}, + {&__pyx_n_s_gevent_timeout, __pyx_k_gevent_timeout, sizeof(__pyx_k_gevent_timeout), 0, 0, 1, 1}, + {&__pyx_n_s_greenlet, __pyx_k_greenlet, sizeof(__pyx_k_greenlet), 0, 0, 1, 1}, + {&__pyx_n_s_greenlet_imported, __pyx_k_greenlet_imported, sizeof(__pyx_k_greenlet_imported), 0, 0, 1, 1}, + {&__pyx_n_s_greenlet_init, __pyx_k_greenlet_init, sizeof(__pyx_k_greenlet_init), 0, 0, 1, 1}, + {&__pyx_n_s_greenlet_primitives, __pyx_k_greenlet_primitives, sizeof(__pyx_k_greenlet_primitives), 0, 0, 1, 1}, + {&__pyx_n_s_hub, __pyx_k_hub, sizeof(__pyx_k_hub), 0, 0, 1, 1}, + {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, + {&__pyx_n_s_import_c_accel, __pyx_k_import_c_accel, sizeof(__pyx_k_import_c_accel), 0, 0, 1, 1}, + {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1}, + {&__pyx_n_s_io, __pyx_k_io, sizeof(__pyx_k_io), 0, 0, 1, 1}, + {&__pyx_n_s_iwait_on_objects, __pyx_k_iwait_on_objects, sizeof(__pyx_k_iwait_on_objects), 0, 0, 1, 1}, + {&__pyx_n_s_join, __pyx_k_join, sizeof(__pyx_k_join), 0, 0, 1, 1}, + {&__pyx_n_s_lambda, __pyx_k_lambda, sizeof(__pyx_k_lambda), 0, 0, 1, 1}, + {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, + {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, + {&__pyx_n_s_next, __pyx_k_next, sizeof(__pyx_k_next), 0, 0, 1, 1}, + {&__pyx_n_s_next_2, __pyx_k_next_2, sizeof(__pyx_k_next_2), 0, 0, 1, 1}, + {&__pyx_n_s_objects, __pyx_k_objects, sizeof(__pyx_k_objects), 0, 0, 1, 1}, + {&__pyx_n_s_print_exc, __pyx_k_print_exc, sizeof(__pyx_k_print_exc), 0, 0, 1, 1}, + {&__pyx_n_s_priority, __pyx_k_priority, sizeof(__pyx_k_priority), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_capi, __pyx_k_pyx_capi, sizeof(__pyx_k_pyx_capi), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1}, + {&__pyx_n_s_rawlink, __pyx_k_rawlink, sizeof(__pyx_k_rawlink), 0, 0, 1, 1}, + {&__pyx_n_s_run_callback, __pyx_k_run_callback, sizeof(__pyx_k_run_callback), 0, 0, 1, 1}, + {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1}, + {&__pyx_n_s_self_2, __pyx_k_self_2, sizeof(__pyx_k_self_2), 0, 0, 1, 1}, + {&__pyx_n_s_set_default_timeout_error, __pyx_k_set_default_timeout_error, sizeof(__pyx_k_set_default_timeout_error), 0, 0, 1, 1}, + {&__pyx_n_s_socket, __pyx_k_socket, sizeof(__pyx_k_socket), 0, 0, 1, 1}, + {&__pyx_kp_s_src_gevent__hub_primitives_py, __pyx_k_src_gevent__hub_primitives_py, sizeof(__pyx_k_src_gevent__hub_primitives_py), 0, 0, 1, 0}, + {&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1}, + {&__pyx_n_s_start_new_or_dummy, __pyx_k_start_new_or_dummy, sizeof(__pyx_k_start_new_or_dummy), 0, 0, 1, 1}, + {&__pyx_n_s_stop, __pyx_k_stop, sizeof(__pyx_k_stop), 0, 0, 1, 1}, + {&__pyx_n_s_switch, __pyx_k_switch, sizeof(__pyx_k_switch), 0, 0, 1, 1}, + {&__pyx_n_s_tb, __pyx_k_tb, sizeof(__pyx_k_tb), 0, 0, 1, 1}, + {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, + {&__pyx_n_s_throw, __pyx_k_throw, sizeof(__pyx_k_throw), 0, 0, 1, 1}, + {&__pyx_kp_s_timed_out, __pyx_k_timed_out, sizeof(__pyx_k_timed_out), 0, 0, 1, 0}, + {&__pyx_n_s_timeout, __pyx_k_timeout, sizeof(__pyx_k_timeout), 0, 0, 1, 1}, + {&__pyx_n_s_timeout_error, __pyx_k_timeout_error, sizeof(__pyx_k_timeout_error), 0, 0, 1, 1}, + {&__pyx_n_s_timeout_exc, __pyx_k_timeout_exc, sizeof(__pyx_k_timeout_exc), 0, 0, 1, 1}, + {&__pyx_n_s_timer, __pyx_k_timer, sizeof(__pyx_k_timer), 0, 0, 1, 1}, + {&__pyx_n_s_traceback, __pyx_k_traceback, sizeof(__pyx_k_traceback), 0, 0, 1, 1}, + {&__pyx_n_s_typ, __pyx_k_typ, sizeof(__pyx_k_typ), 0, 0, 1, 1}, + {&__pyx_n_s_unlink, __pyx_k_unlink, sizeof(__pyx_k_unlink), 0, 0, 1, 1}, + {&__pyx_n_s_value, __pyx_k_value, sizeof(__pyx_k_value), 0, 0, 1, 1}, + {&__pyx_n_s_wait, __pyx_k_wait, sizeof(__pyx_k_wait), 0, 0, 1, 1}, + {&__pyx_n_s_wait_on_objects, __pyx_k_wait_on_objects, sizeof(__pyx_k_wait_on_objects), 0, 0, 1, 1}, + {&__pyx_n_s_wait_on_socket, __pyx_k_wait_on_socket, sizeof(__pyx_k_wait_on_socket), 0, 0, 1, 1}, + {&__pyx_n_s_wait_on_watcher, __pyx_k_wait_on_watcher, sizeof(__pyx_k_wait_on_watcher), 0, 0, 1, 1}, + {&__pyx_n_s_wait_read, __pyx_k_wait_read, sizeof(__pyx_k_wait_read), 0, 0, 1, 1}, + {&__pyx_n_s_wait_readwrite, __pyx_k_wait_readwrite, sizeof(__pyx_k_wait_readwrite), 0, 0, 1, 1}, + {&__pyx_n_s_wait_write, __pyx_k_wait_write, sizeof(__pyx_k_wait_write), 0, 0, 1, 1}, + {&__pyx_n_s_waiter, __pyx_k_waiter, sizeof(__pyx_k_waiter), 0, 0, 1, 1}, + {&__pyx_n_s_watcher, __pyx_k_watcher, sizeof(__pyx_k_watcher), 0, 0, 1, 1}, + {0, 0, 0, 0, 0, 0, 0} +}; +static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { + __pyx_builtin___import__ = __Pyx_GetBuiltinName(__pyx_n_s_import); if (!__pyx_builtin___import__) __PYX_ERR(0, 29, __pyx_L1_error) + __pyx_builtin_StopIteration = __Pyx_GetBuiltinName(__pyx_n_s_StopIteration); if (!__pyx_builtin_StopIteration) __PYX_ERR(0, 139, __pyx_L1_error) + return 0; + __pyx_L1_error:; + return -1; +} + +static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); + + /* "src/gevent/_hub_primitives.py":280 + * else _timeout_error('timed out'))) + * + * with timeout: # <<<<<<<<<<<<<< + * hub.wait(watcher) + * + */ + __pyx_tuple_ = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 280, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple_); + __Pyx_GIVEREF(__pyx_tuple_); + + /* "src/gevent/_hub_primitives.py":29 + * # is assignment) without generating a 'lvalue is not valid target' + * # error. + * locals()['getcurrent'] = __import__('greenlet').getcurrent # <<<<<<<<<<<<<< + * locals()['greenlet_init'] = lambda: None + * locals()['Waiter'] = _waiter.Waiter + */ + __pyx_tuple__8 = PyTuple_Pack(1, __pyx_n_s_greenlet); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 29, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__8); + __Pyx_GIVEREF(__pyx_tuple__8); + + /* "src/gevent/_hub_primitives.py":46 + * class WaitOperationsGreenlet(SwitchOutGreenletWithLoop): # pylint:disable=undefined-variable + * + * def wait(self, watcher): # <<<<<<<<<<<<<< + * """ + * Wait until the *watcher* (which must not be started) is ready. + */ + __pyx_tuple__9 = PyTuple_Pack(2, __pyx_n_s_self_2, __pyx_n_s_watcher); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 46, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__9); + __Pyx_GIVEREF(__pyx_tuple__9); + __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__9, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__hub_primitives_py, __pyx_n_s_wait, 46, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__10)) __PYX_ERR(0, 46, __pyx_L1_error) + + /* "src/gevent/_hub_primitives.py":63 + * watcher.stop() + * + * def cancel_wait(self, watcher, error, close_watcher=False): # <<<<<<<<<<<<<< + * """ + * Cancel an in-progress call to :meth:`wait` by throwing the given *error* + */ + __pyx_tuple__11 = PyTuple_Pack(4, __pyx_n_s_self_2, __pyx_n_s_watcher, __pyx_n_s_error, __pyx_n_s_close_watcher); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 63, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__11); + __Pyx_GIVEREF(__pyx_tuple__11); + __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__11, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__hub_primitives_py, __pyx_n_s_cancel_wait, 63, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(0, 63, __pyx_L1_error) + + /* "src/gevent/_hub_primitives.py":84 + * watcher.close() + * + * def _cancel_wait(self, watcher, error, close_watcher): # <<<<<<<<<<<<<< + * # We have to check again to see if it was still active by the time + * # our callback actually runs. + */ + __pyx_tuple__13 = PyTuple_Pack(4, __pyx_n_s_self_2, __pyx_n_s_watcher, __pyx_n_s_error, __pyx_n_s_close_watcher); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 84, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__13); + __Pyx_GIVEREF(__pyx_tuple__13); + __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__13, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__hub_primitives_py, __pyx_n_s_cancel_wait_2, 84, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__14)) __PYX_ERR(0, 84, __pyx_L1_error) + + /* "src/gevent/_hub_primitives.py":171 + * traceback.print_exc() + * + * def __enter__(self): # <<<<<<<<<<<<<< + * return self + * + */ + __pyx_tuple__15 = PyTuple_Pack(1, __pyx_n_s_self_2); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(0, 171, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__15); + __Pyx_GIVEREF(__pyx_tuple__15); + __pyx_codeobj__16 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__15, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__hub_primitives_py, __pyx_n_s_enter, 171, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__16)) __PYX_ERR(0, 171, __pyx_L1_error) + + /* "src/gevent/_hub_primitives.py":174 + * return self + * + * def __exit__(self, typ, value, tb): # <<<<<<<<<<<<<< + * self._cleanup() + * + */ + __pyx_tuple__17 = PyTuple_Pack(4, __pyx_n_s_self_2, __pyx_n_s_typ, __pyx_n_s_value, __pyx_n_s_tb); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(0, 174, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__17); + __Pyx_GIVEREF(__pyx_tuple__17); + __pyx_codeobj__18 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__17, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__hub_primitives_py, __pyx_n_s_exit, 174, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__18)) __PYX_ERR(0, 174, __pyx_L1_error) + + /* "src/gevent/_hub_primitives.py":178 + * + * + * def iwait_on_objects(objects, timeout=None, count=None): # <<<<<<<<<<<<<< + * """ + * Iteratively yield *objects* as they are ready, until all (or *count*) are ready + */ + __pyx_tuple__19 = PyTuple_Pack(3, __pyx_n_s_objects, __pyx_n_s_timeout, __pyx_n_s_count); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(0, 178, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__19); + __Pyx_GIVEREF(__pyx_tuple__19); + __pyx_codeobj__20 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__19, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__hub_primitives_py, __pyx_n_s_iwait_on_objects, 178, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__20)) __PYX_ERR(0, 178, __pyx_L1_error) + + /* "src/gevent/_hub_primitives.py":217 + * + * + * def wait_on_objects(objects=None, timeout=None, count=None): # <<<<<<<<<<<<<< + * """ + * Wait for ``objects`` to become ready or for event loop to finish. + */ + __pyx_tuple__21 = PyTuple_Pack(3, __pyx_n_s_objects, __pyx_n_s_timeout, __pyx_n_s_count); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(0, 217, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__21); + __Pyx_GIVEREF(__pyx_tuple__21); + __pyx_codeobj__22 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__21, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__hub_primitives_py, __pyx_n_s_wait_on_objects, 217, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__22)) __PYX_ERR(0, 217, __pyx_L1_error) + + /* "src/gevent/_hub_primitives.py":258 + * _timeout_error = Exception + * + * def set_default_timeout_error(e): # <<<<<<<<<<<<<< + * global _timeout_error + * _timeout_error = e + */ + __pyx_tuple__23 = PyTuple_Pack(1, __pyx_n_s_e); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(0, 258, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__23); + __Pyx_GIVEREF(__pyx_tuple__23); + __pyx_codeobj__24 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__23, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__hub_primitives_py, __pyx_n_s_set_default_timeout_error, 258, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__24)) __PYX_ERR(0, 258, __pyx_L1_error) + + /* "src/gevent/_hub_primitives.py":284 + * + * # Suitable to be bound as an instance method + * def wait_on_socket(socket, watcher, timeout_exc=None): # <<<<<<<<<<<<<< + * if socket is None or watcher is None: + * # test__hub TestCloseSocketWhilePolling, on Python 2; Python 3 + */ + __pyx_tuple__25 = PyTuple_Pack(3, __pyx_n_s_socket, __pyx_n_s_watcher, __pyx_n_s_timeout_exc); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(0, 284, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__25); + __Pyx_GIVEREF(__pyx_tuple__25); + __pyx_codeobj__26 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__25, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__hub_primitives_py, __pyx_n_s_wait_on_socket, 284, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__26)) __PYX_ERR(0, 284, __pyx_L1_error) + + /* "src/gevent/_hub_primitives.py":293 + * socket.hub) + * + * def wait_on_watcher(watcher, timeout=None, timeout_exc=_NONE, hub=None): # <<<<<<<<<<<<<< + * """ + * wait(watcher, timeout=None, [timeout_exc=None]) -> None + */ + __pyx_tuple__27 = PyTuple_Pack(4, __pyx_n_s_watcher, __pyx_n_s_timeout, __pyx_n_s_timeout_exc, __pyx_n_s_hub); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(0, 293, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__27); + __Pyx_GIVEREF(__pyx_tuple__27); + __pyx_codeobj__28 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__27, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__hub_primitives_py, __pyx_n_s_wait_on_watcher, 293, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__28)) __PYX_ERR(0, 293, __pyx_L1_error) + + /* "src/gevent/_hub_primitives.py":320 + * + * + * def wait_read(fileno, timeout=None, timeout_exc=_NONE): # <<<<<<<<<<<<<< + * """ + * wait_read(fileno, timeout=None, [timeout_exc=None]) -> None + */ + __pyx_tuple__29 = PyTuple_Pack(3, __pyx_n_s_fileno, __pyx_n_s_timeout, __pyx_n_s_timeout_exc); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(0, 320, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__29); + __Pyx_GIVEREF(__pyx_tuple__29); + __pyx_codeobj__30 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__29, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__hub_primitives_py, __pyx_n_s_wait_read, 320, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__30)) __PYX_ERR(0, 320, __pyx_L1_error) + + /* "src/gevent/_hub_primitives.py":339 + * + * + * def wait_write(fileno, timeout=None, timeout_exc=_NONE, event=_NONE): # <<<<<<<<<<<<<< + * """ + * wait_write(fileno, timeout=None, [timeout_exc=None]) -> None + */ + __pyx_tuple__31 = PyTuple_Pack(4, __pyx_n_s_fileno, __pyx_n_s_timeout, __pyx_n_s_timeout_exc, __pyx_n_s_event); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(0, 339, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__31); + __Pyx_GIVEREF(__pyx_tuple__31); + __pyx_codeobj__32 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__31, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__hub_primitives_py, __pyx_n_s_wait_write, 339, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__32)) __PYX_ERR(0, 339, __pyx_L1_error) + + /* "src/gevent/_hub_primitives.py":363 + * + * + * def wait_readwrite(fileno, timeout=None, timeout_exc=_NONE, event=_NONE): # <<<<<<<<<<<<<< + * """ + * wait_readwrite(fileno, timeout=None, [timeout_exc=None]) -> None + */ + __pyx_tuple__33 = PyTuple_Pack(4, __pyx_n_s_fileno, __pyx_n_s_timeout, __pyx_n_s_timeout_exc, __pyx_n_s_event); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(0, 363, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__33); + __Pyx_GIVEREF(__pyx_tuple__33); + __pyx_codeobj__34 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__33, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__hub_primitives_py, __pyx_n_s_wait_readwrite, 363, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__34)) __PYX_ERR(0, 363, __pyx_L1_error) + + /* "src/gevent/_hub_primitives.py":388 + * + * + * def _init(): # <<<<<<<<<<<<<< + * greenlet_init() # pylint:disable=undefined-variable + * + */ + __pyx_codeobj__35 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__hub_primitives_py, __pyx_n_s_init, 388, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__35)) __PYX_ERR(0, 388, __pyx_L1_error) + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} + +static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { + if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error) + return 0; + __pyx_L1_error:; + return -1; +} + +static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/ + +static int __Pyx_modinit_global_init_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); + /*--- Global init code ---*/ + __pyx_v_6gevent_16__hub_primitives_InvalidSwitchError = Py_None; Py_INCREF(Py_None); + __pyx_v_6gevent_16__hub_primitives__waiter = Py_None; Py_INCREF(Py_None); + __pyx_v_6gevent_16__hub_primitives__greenlet_primitives = Py_None; Py_INCREF(Py_None); + __pyx_v_6gevent_16__hub_primitives_traceback = Py_None; Py_INCREF(Py_None); + __pyx_v_6gevent_16__hub_primitives__timeout_error = Py_None; Py_INCREF(Py_None); + __pyx_v_6gevent_16__hub_primitives_Timeout = Py_None; Py_INCREF(Py_None); + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_variable_export_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); + /*--- Variable export code ---*/ + if (__Pyx_ExportVoidPtr(__pyx_n_s_InvalidSwitchError, (void *)&__pyx_v_6gevent_16__hub_primitives_InvalidSwitchError, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportVoidPtr(__pyx_n_s_waiter, (void *)&__pyx_v_6gevent_16__hub_primitives__waiter, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportVoidPtr(__pyx_n_s_greenlet_primitives, (void *)&__pyx_v_6gevent_16__hub_primitives__greenlet_primitives, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportVoidPtr(__pyx_n_s_traceback, (void *)&__pyx_v_6gevent_16__hub_primitives_traceback, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportVoidPtr(__pyx_n_s_timeout_error, (void *)&__pyx_v_6gevent_16__hub_primitives__timeout_error, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportVoidPtr(__pyx_n_s_Timeout, (void *)&__pyx_v_6gevent_16__hub_primitives_Timeout, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportVoidPtr(__pyx_n_s_greenlet_imported, (void *)&__pyx_v_6gevent_16__hub_primitives__greenlet_imported, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_modinit_function_export_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); + /*--- Function export code ---*/ + if (__Pyx_ExportFunction("iwait_on_objects", (void (*)(void))__pyx_f_6gevent_16__hub_primitives_iwait_on_objects, "PyObject *(PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_16__hub_primitives_iwait_on_objects *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportFunction("wait_on_objects", (void (*)(void))__pyx_f_6gevent_16__hub_primitives_wait_on_objects, "PyObject *(int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_16__hub_primitives_wait_on_objects *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportFunction("_primitive_wait", (void (*)(void))__pyx_f_6gevent_16__hub_primitives__primitive_wait, "PyObject *(PyObject *, PyObject *, PyObject *, struct __pyx_obj_6gevent_16__hub_primitives_WaitOperationsGreenlet *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportFunction("wait_on_watcher", (void (*)(void))__pyx_f_6gevent_16__hub_primitives_wait_on_watcher, "PyObject *(PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_16__hub_primitives_wait_on_watcher *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportFunction("wait_read", (void (*)(void))__pyx_f_6gevent_16__hub_primitives_wait_read, "PyObject *(PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_16__hub_primitives_wait_read *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportFunction("wait_write", (void (*)(void))__pyx_f_6gevent_16__hub_primitives_wait_write, "PyObject *(PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_16__hub_primitives_wait_write *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportFunction("wait_readwrite", (void (*)(void))__pyx_f_6gevent_16__hub_primitives_wait_readwrite, "PyObject *(PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_16__hub_primitives_wait_readwrite *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportFunction("wait_on_socket", (void (*)(void))__pyx_f_6gevent_16__hub_primitives_wait_on_socket, "PyObject *(PyObject *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_16__hub_primitives_wait_on_socket *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_modinit_type_init_code(void) { + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); + /*--- Type init code ---*/ + __pyx_t_1 = PyImport_ImportModule("greenlet"); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 19, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_ptype_6gevent_16__hub_primitives_greenlet = __Pyx_ImportType(__pyx_t_1, "greenlet", "greenlet", sizeof(PyGreenlet), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_16__hub_primitives_greenlet) __PYX_ERR(3, 19, __pyx_L1_error) + __pyx_t_2 = PyImport_ImportModule("gevent.__greenlet_primitives"); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_ptype_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop = __Pyx_ImportType(__pyx_t_2, "gevent.__greenlet_primitives", "SwitchOutGreenletWithLoop", sizeof(struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_vtabptr_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop = (struct __pyx_vtabstruct_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop*)__Pyx_GetVtable(__pyx_ptype_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop->tp_dict); if (unlikely(!__pyx_vtabptr_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_vtabptr_6gevent_16__hub_primitives_WaitOperationsGreenlet = &__pyx_vtable_6gevent_16__hub_primitives_WaitOperationsGreenlet; + __pyx_vtable_6gevent_16__hub_primitives_WaitOperationsGreenlet.__pyx_base = *__pyx_vtabptr_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop; + __pyx_vtable_6gevent_16__hub_primitives_WaitOperationsGreenlet.wait = (PyObject *(*)(struct __pyx_obj_6gevent_16__hub_primitives_WaitOperationsGreenlet *, PyObject *, int __pyx_skip_dispatch))__pyx_f_6gevent_16__hub_primitives_22WaitOperationsGreenlet_wait; + __pyx_vtable_6gevent_16__hub_primitives_WaitOperationsGreenlet.cancel_wait = (PyObject *(*)(struct __pyx_obj_6gevent_16__hub_primitives_WaitOperationsGreenlet *, PyObject *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_16__hub_primitives_22WaitOperationsGreenlet_cancel_wait *__pyx_optional_args))__pyx_f_6gevent_16__hub_primitives_22WaitOperationsGreenlet_cancel_wait; + __pyx_vtable_6gevent_16__hub_primitives_WaitOperationsGreenlet._cancel_wait = (PyObject *(*)(struct __pyx_obj_6gevent_16__hub_primitives_WaitOperationsGreenlet *, PyObject *, PyObject *, PyObject *, int __pyx_skip_dispatch))__pyx_f_6gevent_16__hub_primitives_22WaitOperationsGreenlet__cancel_wait; + __pyx_type_6gevent_16__hub_primitives_WaitOperationsGreenlet.tp_base = __pyx_ptype_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop; + if (PyType_Ready(&__pyx_type_6gevent_16__hub_primitives_WaitOperationsGreenlet) < 0) __PYX_ERR(0, 44, __pyx_L1_error) + __pyx_type_6gevent_16__hub_primitives_WaitOperationsGreenlet.tp_print = 0; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6gevent_16__hub_primitives_WaitOperationsGreenlet.tp_dictoffset && __pyx_type_6gevent_16__hub_primitives_WaitOperationsGreenlet.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_type_6gevent_16__hub_primitives_WaitOperationsGreenlet.tp_getattro = __Pyx_PyObject_GenericGetAttr; + } + if (__Pyx_SetVtable(__pyx_type_6gevent_16__hub_primitives_WaitOperationsGreenlet.tp_dict, __pyx_vtabptr_6gevent_16__hub_primitives_WaitOperationsGreenlet) < 0) __PYX_ERR(0, 44, __pyx_L1_error) + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_WaitOperationsGreenlet, (PyObject *)&__pyx_type_6gevent_16__hub_primitives_WaitOperationsGreenlet) < 0) __PYX_ERR(0, 44, __pyx_L1_error) + __pyx_ptype_6gevent_16__hub_primitives_WaitOperationsGreenlet = &__pyx_type_6gevent_16__hub_primitives_WaitOperationsGreenlet; + __pyx_vtabptr_6gevent_16__hub_primitives__WaitIterator = &__pyx_vtable_6gevent_16__hub_primitives__WaitIterator; + __pyx_vtable_6gevent_16__hub_primitives__WaitIterator._begin = (PyObject *(*)(struct __pyx_obj_6gevent_16__hub_primitives__WaitIterator *))__pyx_f_6gevent_16__hub_primitives_13_WaitIterator__begin; + __pyx_vtable_6gevent_16__hub_primitives__WaitIterator._cleanup = (PyObject *(*)(struct __pyx_obj_6gevent_16__hub_primitives__WaitIterator *))__pyx_f_6gevent_16__hub_primitives_13_WaitIterator__cleanup; + __pyx_vtable_6gevent_16__hub_primitives__WaitIterator.__pyx___enter__ = (PyObject *(*)(struct __pyx_obj_6gevent_16__hub_primitives__WaitIterator *, int __pyx_skip_dispatch))__pyx_f_6gevent_16__hub_primitives_13_WaitIterator___enter__; + __pyx_vtable_6gevent_16__hub_primitives__WaitIterator.__pyx___exit__ = (PyObject *(*)(struct __pyx_obj_6gevent_16__hub_primitives__WaitIterator *, PyObject *, PyObject *, PyObject *, int __pyx_skip_dispatch))__pyx_f_6gevent_16__hub_primitives_13_WaitIterator___exit__; + if (PyType_Ready(&__pyx_type_6gevent_16__hub_primitives__WaitIterator) < 0) __PYX_ERR(0, 98, __pyx_L1_error) + __pyx_type_6gevent_16__hub_primitives__WaitIterator.tp_print = 0; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6gevent_16__hub_primitives__WaitIterator.tp_dictoffset && __pyx_type_6gevent_16__hub_primitives__WaitIterator.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_type_6gevent_16__hub_primitives__WaitIterator.tp_getattro = __Pyx_PyObject_GenericGetAttr; + } + if (__Pyx_SetVtable(__pyx_type_6gevent_16__hub_primitives__WaitIterator.tp_dict, __pyx_vtabptr_6gevent_16__hub_primitives__WaitIterator) < 0) __PYX_ERR(0, 98, __pyx_L1_error) + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_WaitIterator, (PyObject *)&__pyx_type_6gevent_16__hub_primitives__WaitIterator) < 0) __PYX_ERR(0, 98, __pyx_L1_error) + __pyx_ptype_6gevent_16__hub_primitives__WaitIterator = &__pyx_type_6gevent_16__hub_primitives__WaitIterator; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_modinit_type_import_code(void) { + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); + /*--- Type import code ---*/ + __pyx_t_1 = PyImport_ImportModule("greenlet"); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_ptype_6gevent_21__greenlet_primitives_greenlet = __Pyx_ImportType(__pyx_t_1, "greenlet", "greenlet", sizeof(PyGreenlet), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_21__greenlet_primitives_greenlet) __PYX_ERR(1, 12, __pyx_L1_error) + __pyx_t_2 = PyImport_ImportModule("gevent.__greenlet_primitives"); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 37, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_ptype_6gevent_21__greenlet_primitives_TrackedRawGreenlet = __Pyx_ImportType(__pyx_t_2, "gevent.__greenlet_primitives", "TrackedRawGreenlet", sizeof(struct __pyx_obj_6gevent_21__greenlet_primitives_TrackedRawGreenlet), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_21__greenlet_primitives_TrackedRawGreenlet) __PYX_ERR(1, 37, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyImport_ImportModule("greenlet"); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 15, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_ptype_6gevent_8__waiter_greenlet = __Pyx_ImportType(__pyx_t_2, "greenlet", "greenlet", sizeof(PyGreenlet), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_8__waiter_greenlet) __PYX_ERR(2, 15, __pyx_L1_error) + __pyx_t_1 = PyImport_ImportModule("gevent.__waiter"); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 33, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_ptype_6gevent_8__waiter_Waiter = __Pyx_ImportType(__pyx_t_1, "gevent.__waiter", "Waiter", sizeof(struct __pyx_obj_6gevent_8__waiter_Waiter), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_8__waiter_Waiter) __PYX_ERR(2, 33, __pyx_L1_error) + __pyx_vtabptr_6gevent_8__waiter_Waiter = (struct __pyx_vtabstruct_6gevent_8__waiter_Waiter*)__Pyx_GetVtable(__pyx_ptype_6gevent_8__waiter_Waiter->tp_dict); if (unlikely(!__pyx_vtabptr_6gevent_8__waiter_Waiter)) __PYX_ERR(2, 33, __pyx_L1_error) + __pyx_ptype_6gevent_8__waiter_MultipleWaiter = __Pyx_ImportType(__pyx_t_1, "gevent.__waiter", "MultipleWaiter", sizeof(struct __pyx_obj_6gevent_8__waiter_MultipleWaiter), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_8__waiter_MultipleWaiter) __PYX_ERR(2, 47, __pyx_L1_error) + __pyx_vtabptr_6gevent_8__waiter_MultipleWaiter = (struct __pyx_vtabstruct_6gevent_8__waiter_MultipleWaiter*)__Pyx_GetVtable(__pyx_ptype_6gevent_8__waiter_MultipleWaiter->tp_dict); if (unlikely(!__pyx_vtabptr_6gevent_8__waiter_MultipleWaiter)) __PYX_ERR(2, 47, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_modinit_variable_import_code(void) { + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); + /*--- Variable import code ---*/ + __pyx_t_1 = PyImport_ImportModule("gevent.__greenlet_primitives"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_1, "get_objects", (void **)&__pyx_vp_6gevent_21__greenlet_primitives_get_objects, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_1, "wref", (void **)&__pyx_vp_6gevent_21__greenlet_primitives_wref, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_1, "BlockingSwitchOutError", (void **)&__pyx_vp_6gevent_21__greenlet_primitives_BlockingSwitchOutError, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_1, "_greenlet_imported", (void **)&__pyx_vp_6gevent_21__greenlet_primitives__greenlet_imported, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + Py_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_2 = PyImport_ImportModule("gevent.__hub_local"); if (!__pyx_t_2) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_2, "_threadlocal", (void **)&__pyx_vp_6gevent_11__hub_local__threadlocal, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + Py_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_3 = PyImport_ImportModule("gevent.__waiter"); if (!__pyx_t_3) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_3, "sys", (void **)&__pyx_vp_6gevent_8__waiter_sys, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_3, "ConcurrentObjectUseError", (void **)&__pyx_vp_6gevent_8__waiter_ConcurrentObjectUseError, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_3, "_greenlet_imported", (void **)&__pyx_vp_6gevent_8__waiter__greenlet_imported, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_3, "_NONE", (void **)&__pyx_vp_6gevent_8__waiter__NONE, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + Py_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_modinit_function_import_code(void) { + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); + /*--- Function import code ---*/ + __pyx_t_1 = PyImport_ImportModule("gevent.__hub_local"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportFunction(__pyx_t_1, "get_hub_noargs", (void (**)(void))&__pyx_f_6gevent_11__hub_local_get_hub_noargs, "struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *(int __pyx_skip_dispatch)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + Py_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_RefNannyFinishContext(); + return -1; +} + + +#if PY_MAJOR_VERSION < 3 +#ifdef CYTHON_NO_PYINIT_EXPORT +#define __Pyx_PyMODINIT_FUNC void +#else +#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC +#endif +#else +#ifdef CYTHON_NO_PYINIT_EXPORT +#define __Pyx_PyMODINIT_FUNC PyObject * +#else +#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC +#endif +#endif + + +#if PY_MAJOR_VERSION < 3 +__Pyx_PyMODINIT_FUNC init__hub_primitives(void) CYTHON_SMALL_CODE; /*proto*/ +__Pyx_PyMODINIT_FUNC init__hub_primitives(void) +#else +__Pyx_PyMODINIT_FUNC PyInit___hub_primitives(void) CYTHON_SMALL_CODE; /*proto*/ +__Pyx_PyMODINIT_FUNC PyInit___hub_primitives(void) +#if CYTHON_PEP489_MULTI_PHASE_INIT +{ + return PyModuleDef_Init(&__pyx_moduledef); +} +static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { + #if PY_VERSION_HEX >= 0x030700A1 + static PY_INT64_T main_interpreter_id = -1; + PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); + if (main_interpreter_id == -1) { + main_interpreter_id = current_id; + return (unlikely(current_id == -1)) ? -1 : 0; + } else if (unlikely(main_interpreter_id != current_id)) + #else + static PyInterpreterState *main_interpreter = NULL; + PyInterpreterState *current_interpreter = PyThreadState_Get()->interp; + if (!main_interpreter) { + main_interpreter = current_interpreter; + } else if (unlikely(main_interpreter != current_interpreter)) + #endif + { + PyErr_SetString( + PyExc_ImportError, + "Interpreter change detected - this module can only be loaded into one interpreter per process."); + return -1; + } + return 0; +} +static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) { + PyObject *value = PyObject_GetAttrString(spec, from_name); + int result = 0; + if (likely(value)) { + if (allow_none || value != Py_None) { + result = PyDict_SetItemString(moddict, to_name, value); + } + Py_DECREF(value); + } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_Clear(); + } else { + result = -1; + } + return result; +} +static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) { + PyObject *module = NULL, *moddict, *modname; + if (__Pyx_check_single_interpreter()) + return NULL; + if (__pyx_m) + return __Pyx_NewRef(__pyx_m); + modname = PyObject_GetAttrString(spec, "name"); + if (unlikely(!modname)) goto bad; + module = PyModule_NewObject(modname); + Py_DECREF(modname); + if (unlikely(!module)) goto bad; + moddict = PyModule_GetDict(module); + if (unlikely(!moddict)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad; + return module; +bad: + Py_XDECREF(module); + return NULL; +} + + +static CYTHON_SMALL_CODE int __pyx_pymod_exec___hub_primitives(PyObject *__pyx_pyinit_module) +#endif +#endif +{ + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannyDeclarations + #if CYTHON_PEP489_MULTI_PHASE_INIT + if (__pyx_m) { + if (__pyx_m == __pyx_pyinit_module) return 0; + PyErr_SetString(PyExc_RuntimeError, "Module '__hub_primitives' has already been imported. Re-initialisation is not supported."); + return -1; + } + #elif PY_MAJOR_VERSION >= 3 + if (__pyx_m) return __Pyx_NewRef(__pyx_m); + #endif + #if CYTHON_REFNANNY +__Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); +if (!__Pyx_RefNanny) { + PyErr_Clear(); + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); + if (!__Pyx_RefNanny) + Py_FatalError("failed to import 'refnanny' module"); +} +#endif + __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit___hub_primitives(void)", 0); + if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #ifdef __Pxy_PyFrame_Initialize_Offsets + __Pxy_PyFrame_Initialize_Offsets(); + #endif + __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) + #ifdef __Pyx_CyFunction_USED + if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_FusedFunction_USED + if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_Coroutine_USED + if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_Generator_USED + if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_AsyncGen_USED + if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_StopAsyncIteration_USED + if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + /*--- Library function declarations ---*/ + /*--- Threads initialization code ---*/ + #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS + #ifdef WITH_THREAD /* Python build with threading support? */ + PyEval_InitThreads(); + #endif + #endif + /*--- Module creation code ---*/ + #if CYTHON_PEP489_MULTI_PHASE_INIT + __pyx_m = __pyx_pyinit_module; + Py_INCREF(__pyx_m); + #else + #if PY_MAJOR_VERSION < 3 + __pyx_m = Py_InitModule4("__hub_primitives", __pyx_methods, __pyx_k_A_collection_of_primitives_used, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); + #else + __pyx_m = PyModule_Create(&__pyx_moduledef); + #endif + if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) + Py_INCREF(__pyx_d); + __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) + #if CYTHON_COMPILING_IN_PYPY + Py_INCREF(__pyx_b); + #endif + if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + /*--- Initialize various global constants etc. ---*/ + if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) + if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + if (__pyx_module_is_main_gevent____hub_primitives) { + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + } + #if PY_MAJOR_VERSION >= 3 + { + PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) + if (!PyDict_GetItemString(modules, "gevent.__hub_primitives")) { + if (unlikely(PyDict_SetItemString(modules, "gevent.__hub_primitives", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error) + } + } + #endif + /*--- Builtin init code ---*/ + if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + /*--- Constants init code ---*/ + if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + /*--- Global type/function init code ---*/ + (void)__Pyx_modinit_global_init_code(); + if (unlikely(__Pyx_modinit_variable_export_code() != 0)) goto __pyx_L1_error; + if (unlikely(__Pyx_modinit_function_export_code() != 0)) goto __pyx_L1_error; + if (unlikely(__Pyx_modinit_type_init_code() != 0)) goto __pyx_L1_error; + if (unlikely(__Pyx_modinit_type_import_code() != 0)) goto __pyx_L1_error; + if (unlikely(__Pyx_modinit_variable_import_code() != 0)) goto __pyx_L1_error; + if (unlikely(__Pyx_modinit_function_import_code() != 0)) goto __pyx_L1_error; + /*--- Execution code ---*/ + #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) + if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + + /* "src/gevent/_hub_primitives.py":14 + * from __future__ import print_function + * + * import traceback # <<<<<<<<<<<<<< + * + * from gevent.exceptions import InvalidSwitchError + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_traceback, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 14, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_v_6gevent_16__hub_primitives_traceback); + __Pyx_DECREF_SET(__pyx_v_6gevent_16__hub_primitives_traceback, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + + /* "src/gevent/_hub_primitives.py":16 + * import traceback + * + * from gevent.exceptions import InvalidSwitchError # <<<<<<<<<<<<<< + * from gevent.exceptions import ConcurrentObjectUseError + * + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 16, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_InvalidSwitchError); + __Pyx_GIVEREF(__pyx_n_s_InvalidSwitchError); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_InvalidSwitchError); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_gevent_exceptions, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 16, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_InvalidSwitchError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 16, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_v_6gevent_16__hub_primitives_InvalidSwitchError); + __Pyx_DECREF_SET(__pyx_v_6gevent_16__hub_primitives_InvalidSwitchError, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/_hub_primitives.py":17 + * + * from gevent.exceptions import InvalidSwitchError + * from gevent.exceptions import ConcurrentObjectUseError # <<<<<<<<<<<<<< + * + * from gevent import _greenlet_primitives + */ + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 17, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_ConcurrentObjectUseError); + __Pyx_GIVEREF(__pyx_n_s_ConcurrentObjectUseError); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_ConcurrentObjectUseError); + __pyx_t_1 = __Pyx_Import(__pyx_n_s_gevent_exceptions, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 17, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_ConcurrentObjectUseError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 17, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ConcurrentObjectUseError, __pyx_t_2) < 0) __PYX_ERR(0, 17, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_hub_primitives.py":19 + * from gevent.exceptions import ConcurrentObjectUseError + * + * from gevent import _greenlet_primitives # <<<<<<<<<<<<<< + * from gevent import _waiter + * from gevent._util import _NONE + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 19, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_greenlet_primitives); + __Pyx_GIVEREF(__pyx_n_s_greenlet_primitives); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_greenlet_primitives); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_gevent, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 19, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_greenlet_primitives); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 19, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_v_6gevent_16__hub_primitives__greenlet_primitives); + __Pyx_DECREF_SET(__pyx_v_6gevent_16__hub_primitives__greenlet_primitives, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/_hub_primitives.py":20 + * + * from gevent import _greenlet_primitives + * from gevent import _waiter # <<<<<<<<<<<<<< + * from gevent._util import _NONE + * from gevent._hub_local import get_hub_noargs as get_hub + */ + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 20, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_waiter); + __Pyx_GIVEREF(__pyx_n_s_waiter); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_waiter); + __pyx_t_1 = __Pyx_Import(__pyx_n_s_gevent, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 20, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_waiter); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 20, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_v_6gevent_16__hub_primitives__waiter); + __Pyx_DECREF_SET(__pyx_v_6gevent_16__hub_primitives__waiter, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_hub_primitives.py":21 + * from gevent import _greenlet_primitives + * from gevent import _waiter + * from gevent._util import _NONE # <<<<<<<<<<<<<< + * from gevent._hub_local import get_hub_noargs as get_hub + * from gevent.timeout import Timeout + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 21, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_NONE); + __Pyx_GIVEREF(__pyx_n_s_NONE); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_NONE); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_gevent__util, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 21, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_NONE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 21, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_NONE, __pyx_t_1) < 0) __PYX_ERR(0, 21, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/_hub_primitives.py":22 + * from gevent import _waiter + * from gevent._util import _NONE + * from gevent._hub_local import get_hub_noargs as get_hub # <<<<<<<<<<<<<< + * from gevent.timeout import Timeout + * + */ + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 22, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_get_hub_noargs); + __Pyx_GIVEREF(__pyx_n_s_get_hub_noargs); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_get_hub_noargs); + __pyx_t_1 = __Pyx_Import(__pyx_n_s_gevent__hub_local, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 22, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_get_hub_noargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 22, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_hub_noargs, __pyx_t_2) < 0) __PYX_ERR(0, 22, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_hub_primitives.py":23 + * from gevent._util import _NONE + * from gevent._hub_local import get_hub_noargs as get_hub + * from gevent.timeout import Timeout # <<<<<<<<<<<<<< + * + * # In Cython, we define these as 'cdef inline' functions. The + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 23, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_Timeout); + __Pyx_GIVEREF(__pyx_n_s_Timeout); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_Timeout); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_gevent_timeout, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 23, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_Timeout); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 23, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_v_6gevent_16__hub_primitives_Timeout); + __Pyx_DECREF_SET(__pyx_v_6gevent_16__hub_primitives_Timeout, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/_hub_primitives.py":29 + * # is assignment) without generating a 'lvalue is not valid target' + * # error. + * locals()['getcurrent'] = __import__('greenlet').getcurrent # <<<<<<<<<<<<<< + * locals()['greenlet_init'] = lambda: None + * locals()['Waiter'] = _waiter.Waiter + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin___import__, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 29, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_getcurrent); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 29, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_Globals(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 29, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (unlikely(PyDict_SetItem(__pyx_t_2, __pyx_n_s_getcurrent, __pyx_t_1) < 0)) __PYX_ERR(0, 29, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_hub_primitives.py":30 + * # error. + * locals()['getcurrent'] = __import__('greenlet').getcurrent + * locals()['greenlet_init'] = lambda: None # <<<<<<<<<<<<<< + * locals()['Waiter'] = _waiter.Waiter + * locals()['MultipleWaiter'] = _waiter.MultipleWaiter + */ + __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_16__hub_primitives_18lambda, 0, __pyx_n_s_lambda, NULL, __pyx_n_s_gevent___hub_primitives, __pyx_d, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 30, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_Globals(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 30, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (unlikely(PyDict_SetItem(__pyx_t_2, __pyx_n_s_greenlet_init, __pyx_t_1) < 0)) __PYX_ERR(0, 30, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_hub_primitives.py":31 + * locals()['getcurrent'] = __import__('greenlet').getcurrent + * locals()['greenlet_init'] = lambda: None + * locals()['Waiter'] = _waiter.Waiter # <<<<<<<<<<<<<< + * locals()['MultipleWaiter'] = _waiter.MultipleWaiter + * locals()['SwitchOutGreenletWithLoop'] = _greenlet_primitives.SwitchOutGreenletWithLoop + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_6gevent_16__hub_primitives__waiter, __pyx_n_s_Waiter); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 31, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_Globals(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 31, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (unlikely(PyDict_SetItem(__pyx_t_2, __pyx_n_s_Waiter, __pyx_t_1) < 0)) __PYX_ERR(0, 31, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_hub_primitives.py":32 + * locals()['greenlet_init'] = lambda: None + * locals()['Waiter'] = _waiter.Waiter + * locals()['MultipleWaiter'] = _waiter.MultipleWaiter # <<<<<<<<<<<<<< + * locals()['SwitchOutGreenletWithLoop'] = _greenlet_primitives.SwitchOutGreenletWithLoop + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_6gevent_16__hub_primitives__waiter, __pyx_n_s_MultipleWaiter); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 32, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_Globals(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 32, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (unlikely(PyDict_SetItem(__pyx_t_2, __pyx_n_s_MultipleWaiter, __pyx_t_1) < 0)) __PYX_ERR(0, 32, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_hub_primitives.py":33 + * locals()['Waiter'] = _waiter.Waiter + * locals()['MultipleWaiter'] = _waiter.MultipleWaiter + * locals()['SwitchOutGreenletWithLoop'] = _greenlet_primitives.SwitchOutGreenletWithLoop # <<<<<<<<<<<<<< + * + * __all__ = [ + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_6gevent_16__hub_primitives__greenlet_primitives, __pyx_n_s_SwitchOutGreenletWithLoop); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 33, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_Globals(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 33, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (unlikely(PyDict_SetItem(__pyx_t_2, __pyx_n_s_SwitchOutGreenletWithLoop, __pyx_t_1) < 0)) __PYX_ERR(0, 33, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_hub_primitives.py":35 + * locals()['SwitchOutGreenletWithLoop'] = _greenlet_primitives.SwitchOutGreenletWithLoop + * + * __all__ = [ # <<<<<<<<<<<<<< + * 'WaitOperationsGreenlet', + * 'iwait_on_objects', + */ + __pyx_t_1 = PyList_New(6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 35, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_WaitOperationsGreenlet); + __Pyx_GIVEREF(__pyx_n_s_WaitOperationsGreenlet); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_WaitOperationsGreenlet); + __Pyx_INCREF(__pyx_n_s_iwait_on_objects); + __Pyx_GIVEREF(__pyx_n_s_iwait_on_objects); + PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_iwait_on_objects); + __Pyx_INCREF(__pyx_n_s_wait_on_objects); + __Pyx_GIVEREF(__pyx_n_s_wait_on_objects); + PyList_SET_ITEM(__pyx_t_1, 2, __pyx_n_s_wait_on_objects); + __Pyx_INCREF(__pyx_n_s_wait_read); + __Pyx_GIVEREF(__pyx_n_s_wait_read); + PyList_SET_ITEM(__pyx_t_1, 3, __pyx_n_s_wait_read); + __Pyx_INCREF(__pyx_n_s_wait_write); + __Pyx_GIVEREF(__pyx_n_s_wait_write); + PyList_SET_ITEM(__pyx_t_1, 4, __pyx_n_s_wait_write); + __Pyx_INCREF(__pyx_n_s_wait_readwrite); + __Pyx_GIVEREF(__pyx_n_s_wait_readwrite); + PyList_SET_ITEM(__pyx_t_1, 5, __pyx_n_s_wait_readwrite); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_all, __pyx_t_1) < 0) __PYX_ERR(0, 35, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_hub_primitives.py":46 + * class WaitOperationsGreenlet(SwitchOutGreenletWithLoop): # pylint:disable=undefined-variable + * + * def wait(self, watcher): # <<<<<<<<<<<<<< + * """ + * Wait until the *watcher* (which must not be started) is ready. + */ + __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_16__hub_primitives_22WaitOperationsGreenlet_1wait, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_WaitOperationsGreenlet_wait, NULL, __pyx_n_s_gevent___hub_primitives, __pyx_d, ((PyObject *)__pyx_codeobj__10)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 46, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_16__hub_primitives_WaitOperationsGreenlet->tp_dict, __pyx_n_s_wait, __pyx_t_1) < 0) __PYX_ERR(0, 46, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + PyType_Modified(__pyx_ptype_6gevent_16__hub_primitives_WaitOperationsGreenlet); + + /* "src/gevent/_hub_primitives.py":63 + * watcher.stop() + * + * def cancel_wait(self, watcher, error, close_watcher=False): # <<<<<<<<<<<<<< + * """ + * Cancel an in-progress call to :meth:`wait` by throwing the given *error* + */ + __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_16__hub_primitives_22WaitOperationsGreenlet_3cancel_wait, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_WaitOperationsGreenlet_cancel_wa, NULL, __pyx_n_s_gevent___hub_primitives, __pyx_d, ((PyObject *)__pyx_codeobj__12)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 63, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_16__hub_primitives_WaitOperationsGreenlet->tp_dict, __pyx_n_s_cancel_wait, __pyx_t_1) < 0) __PYX_ERR(0, 63, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + PyType_Modified(__pyx_ptype_6gevent_16__hub_primitives_WaitOperationsGreenlet); + + /* "src/gevent/_hub_primitives.py":84 + * watcher.close() + * + * def _cancel_wait(self, watcher, error, close_watcher): # <<<<<<<<<<<<<< + * # We have to check again to see if it was still active by the time + * # our callback actually runs. + */ + __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_16__hub_primitives_22WaitOperationsGreenlet_5_cancel_wait, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_WaitOperationsGreenlet__cancel_w, NULL, __pyx_n_s_gevent___hub_primitives, __pyx_d, ((PyObject *)__pyx_codeobj__14)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 84, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_16__hub_primitives_WaitOperationsGreenlet->tp_dict, __pyx_n_s_cancel_wait_2, __pyx_t_1) < 0) __PYX_ERR(0, 84, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + PyType_Modified(__pyx_ptype_6gevent_16__hub_primitives_WaitOperationsGreenlet); + + /* "src/gevent/_hub_primitives.py":154 + * raise + * + * next = __next__ # <<<<<<<<<<<<<< + * + * def _cleanup(self): + */ + __Pyx_GetNameInClass(__pyx_t_1, (PyObject *)__pyx_ptype_6gevent_16__hub_primitives__WaitIterator, __pyx_n_s_next); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 154, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_16__hub_primitives__WaitIterator->tp_dict, __pyx_n_s_next_2, __pyx_t_1) < 0) __PYX_ERR(0, 154, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + PyType_Modified(__pyx_ptype_6gevent_16__hub_primitives__WaitIterator); + + /* "src/gevent/_hub_primitives.py":171 + * traceback.print_exc() + * + * def __enter__(self): # <<<<<<<<<<<<<< + * return self + * + */ + __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_16__hub_primitives_13_WaitIterator_7__enter__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_WaitIterator___enter, NULL, __pyx_n_s_gevent___hub_primitives, __pyx_d, ((PyObject *)__pyx_codeobj__16)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 171, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_16__hub_primitives__WaitIterator->tp_dict, __pyx_n_s_enter, __pyx_t_1) < 0) __PYX_ERR(0, 171, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + PyType_Modified(__pyx_ptype_6gevent_16__hub_primitives__WaitIterator); + + /* "src/gevent/_hub_primitives.py":174 + * return self + * + * def __exit__(self, typ, value, tb): # <<<<<<<<<<<<<< + * self._cleanup() + * + */ + __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_16__hub_primitives_13_WaitIterator_9__exit__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_WaitIterator___exit, NULL, __pyx_n_s_gevent___hub_primitives, __pyx_d, ((PyObject *)__pyx_codeobj__18)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 174, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_16__hub_primitives__WaitIterator->tp_dict, __pyx_n_s_exit, __pyx_t_1) < 0) __PYX_ERR(0, 174, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + PyType_Modified(__pyx_ptype_6gevent_16__hub_primitives__WaitIterator); + + /* "src/gevent/_hub_primitives.py":178 + * + * + * def iwait_on_objects(objects, timeout=None, count=None): # <<<<<<<<<<<<<< + * """ + * Iteratively yield *objects* as they are ready, until all (or *count*) are ready + */ + __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_16__hub_primitives_1iwait_on_objects, 0, __pyx_n_s_iwait_on_objects, NULL, __pyx_n_s_gevent___hub_primitives, __pyx_d, ((PyObject *)__pyx_codeobj__20)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 178, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_iwait_on_objects, __pyx_t_1) < 0) __PYX_ERR(0, 178, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_hub_primitives.py":217 + * + * + * def wait_on_objects(objects=None, timeout=None, count=None): # <<<<<<<<<<<<<< + * """ + * Wait for ``objects`` to become ready or for event loop to finish. + */ + __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_16__hub_primitives_3wait_on_objects, 0, __pyx_n_s_wait_on_objects, NULL, __pyx_n_s_gevent___hub_primitives, __pyx_d, ((PyObject *)__pyx_codeobj__22)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 217, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_wait_on_objects, __pyx_t_1) < 0) __PYX_ERR(0, 217, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_hub_primitives.py":256 + * return list(iwait_on_objects(objects, timeout, count)) + * + * _timeout_error = Exception # <<<<<<<<<<<<<< + * + * def set_default_timeout_error(e): + */ + __Pyx_INCREF(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); + __Pyx_XGOTREF(__pyx_v_6gevent_16__hub_primitives__timeout_error); + __Pyx_DECREF_SET(__pyx_v_6gevent_16__hub_primitives__timeout_error, ((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); + __Pyx_GIVEREF(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); + + /* "src/gevent/_hub_primitives.py":258 + * _timeout_error = Exception + * + * def set_default_timeout_error(e): # <<<<<<<<<<<<<< + * global _timeout_error + * _timeout_error = e + */ + __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_16__hub_primitives_5set_default_timeout_error, 0, __pyx_n_s_set_default_timeout_error, NULL, __pyx_n_s_gevent___hub_primitives, __pyx_d, ((PyObject *)__pyx_codeobj__24)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 258, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_default_timeout_error, __pyx_t_1) < 0) __PYX_ERR(0, 258, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_hub_primitives.py":284 + * + * # Suitable to be bound as an instance method + * def wait_on_socket(socket, watcher, timeout_exc=None): # <<<<<<<<<<<<<< + * if socket is None or watcher is None: + * # test__hub TestCloseSocketWhilePolling, on Python 2; Python 3 + */ + __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_16__hub_primitives_7wait_on_socket, 0, __pyx_n_s_wait_on_socket, NULL, __pyx_n_s_gevent___hub_primitives, __pyx_d, ((PyObject *)__pyx_codeobj__26)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 284, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_wait_on_socket, __pyx_t_1) < 0) __PYX_ERR(0, 284, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_hub_primitives.py":293 + * socket.hub) + * + * def wait_on_watcher(watcher, timeout=None, timeout_exc=_NONE, hub=None): # <<<<<<<<<<<<<< + * """ + * wait(watcher, timeout=None, [timeout_exc=None]) -> None + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_NONE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 293, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_k__2 = __pyx_t_1; + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_NONE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 293, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_k__2 = __pyx_t_1; + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_16__hub_primitives_9wait_on_watcher, 0, __pyx_n_s_wait_on_watcher, NULL, __pyx_n_s_gevent___hub_primitives, __pyx_d, ((PyObject *)__pyx_codeobj__28)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 293, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_wait_on_watcher, __pyx_t_1) < 0) __PYX_ERR(0, 293, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_hub_primitives.py":320 + * + * + * def wait_read(fileno, timeout=None, timeout_exc=_NONE): # <<<<<<<<<<<<<< + * """ + * wait_read(fileno, timeout=None, [timeout_exc=None]) -> None + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_NONE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 320, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_k__3 = __pyx_t_1; + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_NONE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 320, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_k__3 = __pyx_t_1; + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_16__hub_primitives_11wait_read, 0, __pyx_n_s_wait_read, NULL, __pyx_n_s_gevent___hub_primitives, __pyx_d, ((PyObject *)__pyx_codeobj__30)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 320, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_wait_read, __pyx_t_1) < 0) __PYX_ERR(0, 320, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_hub_primitives.py":339 + * + * + * def wait_write(fileno, timeout=None, timeout_exc=_NONE, event=_NONE): # <<<<<<<<<<<<<< + * """ + * wait_write(fileno, timeout=None, [timeout_exc=None]) -> None + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_NONE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 339, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_k__4 = __pyx_t_1; + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_NONE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 339, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_k__5 = __pyx_t_1; + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_NONE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 339, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_k__4 = __pyx_t_1; + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_NONE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 339, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_k__5 = __pyx_t_1; + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_16__hub_primitives_13wait_write, 0, __pyx_n_s_wait_write, NULL, __pyx_n_s_gevent___hub_primitives, __pyx_d, ((PyObject *)__pyx_codeobj__32)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 339, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_wait_write, __pyx_t_1) < 0) __PYX_ERR(0, 339, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_hub_primitives.py":363 + * + * + * def wait_readwrite(fileno, timeout=None, timeout_exc=_NONE, event=_NONE): # <<<<<<<<<<<<<< + * """ + * wait_readwrite(fileno, timeout=None, [timeout_exc=None]) -> None + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_NONE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 363, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_k__6 = __pyx_t_1; + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_NONE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 363, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_k__7 = __pyx_t_1; + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_NONE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 363, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_k__6 = __pyx_t_1; + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_NONE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 363, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_k__7 = __pyx_t_1; + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_16__hub_primitives_15wait_readwrite, 0, __pyx_n_s_wait_readwrite, NULL, __pyx_n_s_gevent___hub_primitives, __pyx_d, ((PyObject *)__pyx_codeobj__34)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 363, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_wait_readwrite, __pyx_t_1) < 0) __PYX_ERR(0, 363, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_hub_primitives.py":388 + * + * + * def _init(): # <<<<<<<<<<<<<< + * greenlet_init() # pylint:disable=undefined-variable + * + */ + __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_16__hub_primitives_17_init, 0, __pyx_n_s_init, NULL, __pyx_n_s_gevent___hub_primitives, __pyx_d, ((PyObject *)__pyx_codeobj__35)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 388, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_init, __pyx_t_1) < 0) __PYX_ERR(0, 388, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_hub_primitives.py":391 + * greenlet_init() # pylint:disable=undefined-variable + * + * _init() # <<<<<<<<<<<<<< + * + * from gevent._util import import_c_accel + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_init); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 391, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 391, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/_hub_primitives.py":393 + * _init() + * + * from gevent._util import import_c_accel # <<<<<<<<<<<<<< + * import_c_accel(globals(), 'gevent.__hub_primitives') + */ + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 393, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_import_c_accel); + __Pyx_GIVEREF(__pyx_n_s_import_c_accel); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_import_c_accel); + __pyx_t_1 = __Pyx_Import(__pyx_n_s_gevent__util, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 393, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_import_c_accel); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 393, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_import_c_accel, __pyx_t_2) < 0) __PYX_ERR(0, 393, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_hub_primitives.py":394 + * + * from gevent._util import import_c_accel + * import_c_accel(globals(), 'gevent.__hub_primitives') # <<<<<<<<<<<<<< + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_import_c_accel); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 394, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_Globals(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 394, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 394, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __Pyx_INCREF(__pyx_n_s_gevent___hub_primitives); + __Pyx_GIVEREF(__pyx_n_s_gevent___hub_primitives); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_n_s_gevent___hub_primitives); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 394, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/_hub_primitives.py":1 + * # -*- coding: utf-8 -*- # <<<<<<<<<<<<<< + * # copyright (c) 2018 gevent. See LICENSE. + * # cython: auto_pickle=False,embedsignature=True,always_allow_keywords=False,binding=True + */ + __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "gevent/__hub_primitives.pxd":34 + * cdef bint _greenlet_imported + * + * cdef inline void greenlet_init(): # <<<<<<<<<<<<<< + * global _greenlet_imported + * if not _greenlet_imported: + */ + + /*--- Wrapped vars code ---*/ + + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + if (__pyx_m) { + if (__pyx_d) { + __Pyx_AddTraceback("init gevent.__hub_primitives", __pyx_clineno, __pyx_lineno, __pyx_filename); + } + Py_CLEAR(__pyx_m); + } else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_ImportError, "init gevent.__hub_primitives"); + } + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + #if CYTHON_PEP489_MULTI_PHASE_INIT + return (__pyx_m != NULL) ? 0 : -1; + #elif PY_MAJOR_VERSION >= 3 + return __pyx_m; + #else + return; + #endif +} + +/* --- Runtime support code --- */ +/* Refnanny */ +#if CYTHON_REFNANNY +static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { + PyObject *m = NULL, *p = NULL; + void *r = NULL; + m = PyImport_ImportModule(modname); + if (!m) goto end; + p = PyObject_GetAttrString(m, "RefNannyAPI"); + if (!p) goto end; + r = PyLong_AsVoidPtr(p); +end: + Py_XDECREF(p); + Py_XDECREF(m); + return (__Pyx_RefNannyAPIStruct *)r; +} +#endif + +/* PyObjectGetAttrStr */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_getattro)) + return tp->tp_getattro(obj, attr_name); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_getattr)) + return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); +#endif + return PyObject_GetAttr(obj, attr_name); +} +#endif + +/* GetBuiltinName */ +static PyObject *__Pyx_GetBuiltinName(PyObject *name) { + PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name); + if (unlikely(!result)) { + PyErr_Format(PyExc_NameError, +#if PY_MAJOR_VERSION >= 3 + "name '%U' is not defined", name); +#else + "name '%.200s' is not defined", PyString_AS_STRING(name)); +#endif + } + return result; +} + +/* PyCFunctionFastCall */ +#if CYTHON_FAST_PYCCALL +static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) { + PyCFunctionObject *func = (PyCFunctionObject*)func_obj; + PyCFunction meth = PyCFunction_GET_FUNCTION(func); + PyObject *self = PyCFunction_GET_SELF(func); + int flags = PyCFunction_GET_FLAGS(func); + assert(PyCFunction_Check(func)); + assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS))); + assert(nargs >= 0); + assert(nargs == 0 || args != NULL); + /* _PyCFunction_FastCallDict() must not be called with an exception set, + because it may clear it (directly or indirectly) and so the + caller loses its exception */ + assert(!PyErr_Occurred()); + if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) { + return (*((__Pyx_PyCFunctionFastWithKeywords)(void*)meth)) (self, args, nargs, NULL); + } else { + return (*((__Pyx_PyCFunctionFast)(void*)meth)) (self, args, nargs); + } +} +#endif + +/* PyFunctionFastCall */ +#if CYTHON_FAST_PYCALL +static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, + PyObject *globals) { + PyFrameObject *f; + PyThreadState *tstate = __Pyx_PyThreadState_Current; + PyObject **fastlocals; + Py_ssize_t i; + PyObject *result; + assert(globals != NULL); + /* XXX Perhaps we should create a specialized + PyFrame_New() that doesn't take locals, but does + take builtins without sanity checking them. + */ + assert(tstate != NULL); + f = PyFrame_New(tstate, co, globals, NULL); + if (f == NULL) { + return NULL; + } + fastlocals = __Pyx_PyFrame_GetLocalsplus(f); + for (i = 0; i < na; i++) { + Py_INCREF(*args); + fastlocals[i] = *args++; + } + result = PyEval_EvalFrameEx(f,0); + ++tstate->recursion_depth; + Py_DECREF(f); + --tstate->recursion_depth; + return result; +} +#if 1 || PY_VERSION_HEX < 0x030600B1 +static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs) { + PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); + PyObject *globals = PyFunction_GET_GLOBALS(func); + PyObject *argdefs = PyFunction_GET_DEFAULTS(func); + PyObject *closure; +#if PY_MAJOR_VERSION >= 3 + PyObject *kwdefs; +#endif + PyObject *kwtuple, **k; + PyObject **d; + Py_ssize_t nd; + Py_ssize_t nk; + PyObject *result; + assert(kwargs == NULL || PyDict_Check(kwargs)); + nk = kwargs ? PyDict_Size(kwargs) : 0; + if (Py_EnterRecursiveCall((char*)" while calling a Python object")) { + return NULL; + } + if ( +#if PY_MAJOR_VERSION >= 3 + co->co_kwonlyargcount == 0 && +#endif + likely(kwargs == NULL || nk == 0) && + co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { + if (argdefs == NULL && co->co_argcount == nargs) { + result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); + goto done; + } + else if (nargs == 0 && argdefs != NULL + && co->co_argcount == Py_SIZE(argdefs)) { + /* function called with no arguments, but all parameters have + a default value: use default values as arguments .*/ + args = &PyTuple_GET_ITEM(argdefs, 0); + result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); + goto done; + } + } + if (kwargs != NULL) { + Py_ssize_t pos, i; + kwtuple = PyTuple_New(2 * nk); + if (kwtuple == NULL) { + result = NULL; + goto done; + } + k = &PyTuple_GET_ITEM(kwtuple, 0); + pos = i = 0; + while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { + Py_INCREF(k[i]); + Py_INCREF(k[i+1]); + i += 2; + } + nk = i / 2; + } + else { + kwtuple = NULL; + k = NULL; + } + closure = PyFunction_GET_CLOSURE(func); +#if PY_MAJOR_VERSION >= 3 + kwdefs = PyFunction_GET_KW_DEFAULTS(func); +#endif + if (argdefs != NULL) { + d = &PyTuple_GET_ITEM(argdefs, 0); + nd = Py_SIZE(argdefs); + } + else { + d = NULL; + nd = 0; + } +#if PY_MAJOR_VERSION >= 3 + result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, + args, nargs, + k, (int)nk, + d, (int)nd, kwdefs, closure); +#else + result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, + args, nargs, + k, (int)nk, + d, (int)nd, closure); +#endif + Py_XDECREF(kwtuple); +done: + Py_LeaveRecursiveCall(); + return result; +} +#endif +#endif + +/* PyObjectCall */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { + PyObject *result; + ternaryfunc call = func->ob_type->tp_call; + if (unlikely(!call)) + return PyObject_Call(func, arg, kw); + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; + result = (*call)(func, arg, kw); + Py_LeaveRecursiveCall(); + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +/* PyObjectCall2Args */ +static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) { + PyObject *args, *result = NULL; + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(function)) { + PyObject *args[2] = {arg1, arg2}; + return __Pyx_PyFunction_FastCall(function, args, 2); + } + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(function)) { + PyObject *args[2] = {arg1, arg2}; + return __Pyx_PyCFunction_FastCall(function, args, 2); + } + #endif + args = PyTuple_New(2); + if (unlikely(!args)) goto done; + Py_INCREF(arg1); + PyTuple_SET_ITEM(args, 0, arg1); + Py_INCREF(arg2); + PyTuple_SET_ITEM(args, 1, arg2); + Py_INCREF(function); + result = __Pyx_PyObject_Call(function, args, NULL); + Py_DECREF(args); + Py_DECREF(function); +done: + return result; +} + +/* PyObjectCallMethO */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { + PyObject *self, *result; + PyCFunction cfunc; + cfunc = PyCFunction_GET_FUNCTION(func); + self = PyCFunction_GET_SELF(func); + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; + result = cfunc(self, arg); + Py_LeaveRecursiveCall(); + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +/* PyObjectCallOneArg */ +#if CYTHON_COMPILING_IN_CPYTHON +static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) { + PyObject *result; + PyObject *args = PyTuple_New(1); + if (unlikely(!args)) return NULL; + Py_INCREF(arg); + PyTuple_SET_ITEM(args, 0, arg); + result = __Pyx_PyObject_Call(func, args, NULL); + Py_DECREF(args); + return result; +} +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { +#if CYTHON_FAST_PYCALL + if (PyFunction_Check(func)) { + return __Pyx_PyFunction_FastCall(func, &arg, 1); + } +#endif + if (likely(PyCFunction_Check(func))) { + if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) { + return __Pyx_PyObject_CallMethO(func, arg); +#if CYTHON_FAST_PYCCALL + } else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) { + return __Pyx_PyCFunction_FastCall(func, &arg, 1); +#endif + } + } + return __Pyx__PyObject_CallOneArg(func, arg); +} +#else +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { + PyObject *result; + PyObject *args = PyTuple_Pack(1, arg); + if (unlikely(!args)) return NULL; + result = __Pyx_PyObject_Call(func, args, NULL); + Py_DECREF(args); + return result; +} +#endif + +/* PyErrFetchRestore */ +#if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + tmp_type = tstate->curexc_type; + tmp_value = tstate->curexc_value; + tmp_tb = tstate->curexc_traceback; + tstate->curexc_type = type; + tstate->curexc_value = value; + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +} +static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { + *type = tstate->curexc_type; + *value = tstate->curexc_value; + *tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +} +#endif + +/* RaiseException */ +#if PY_MAJOR_VERSION < 3 +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, + CYTHON_UNUSED PyObject *cause) { + __Pyx_PyThreadState_declare + Py_XINCREF(type); + if (!value || value == Py_None) + value = NULL; + else + Py_INCREF(value); + if (!tb || tb == Py_None) + tb = NULL; + else { + Py_INCREF(tb); + if (!PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto raise_error; + } + } + if (PyType_Check(type)) { +#if CYTHON_COMPILING_IN_PYPY + if (!value) { + Py_INCREF(Py_None); + value = Py_None; + } +#endif + PyErr_NormalizeException(&type, &value, &tb); + } else { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto raise_error; + } + value = type; + type = (PyObject*) Py_TYPE(type); + Py_INCREF(type); + if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto raise_error; + } + } + __Pyx_PyThreadState_assign + __Pyx_ErrRestore(type, value, tb); + return; +raise_error: + Py_XDECREF(value); + Py_XDECREF(type); + Py_XDECREF(tb); + return; +} +#else +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { + PyObject* owned_instance = NULL; + if (tb == Py_None) { + tb = 0; + } else if (tb && !PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto bad; + } + if (value == Py_None) + value = 0; + if (PyExceptionInstance_Check(type)) { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto bad; + } + value = type; + type = (PyObject*) Py_TYPE(value); + } else if (PyExceptionClass_Check(type)) { + PyObject *instance_class = NULL; + if (value && PyExceptionInstance_Check(value)) { + instance_class = (PyObject*) Py_TYPE(value); + if (instance_class != type) { + int is_subclass = PyObject_IsSubclass(instance_class, type); + if (!is_subclass) { + instance_class = NULL; + } else if (unlikely(is_subclass == -1)) { + goto bad; + } else { + type = instance_class; + } + } + } + if (!instance_class) { + PyObject *args; + if (!value) + args = PyTuple_New(0); + else if (PyTuple_Check(value)) { + Py_INCREF(value); + args = value; + } else + args = PyTuple_Pack(1, value); + if (!args) + goto bad; + owned_instance = PyObject_Call(type, args, NULL); + Py_DECREF(args); + if (!owned_instance) + goto bad; + value = owned_instance; + if (!PyExceptionInstance_Check(value)) { + PyErr_Format(PyExc_TypeError, + "calling %R should have returned an instance of " + "BaseException, not %R", + type, Py_TYPE(value)); + goto bad; + } + } + } else { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto bad; + } + if (cause) { + PyObject *fixed_cause; + if (cause == Py_None) { + fixed_cause = NULL; + } else if (PyExceptionClass_Check(cause)) { + fixed_cause = PyObject_CallObject(cause, NULL); + if (fixed_cause == NULL) + goto bad; + } else if (PyExceptionInstance_Check(cause)) { + fixed_cause = cause; + Py_INCREF(fixed_cause); + } else { + PyErr_SetString(PyExc_TypeError, + "exception causes must derive from " + "BaseException"); + goto bad; + } + PyException_SetCause(value, fixed_cause); + } + PyErr_SetObject(type, value); + if (tb) { +#if CYTHON_COMPILING_IN_PYPY + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); + Py_INCREF(tb); + PyErr_Restore(tmp_type, tmp_value, tb); + Py_XDECREF(tmp_tb); +#else + PyThreadState *tstate = __Pyx_PyThreadState_Current; + PyObject* tmp_tb = tstate->curexc_traceback; + if (tb != tmp_tb) { + Py_INCREF(tb); + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_tb); + } +#endif + } +bad: + Py_XDECREF(owned_instance); + return; +} +#endif + +/* PyObjectCallNoArg */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { +#if CYTHON_FAST_PYCALL + if (PyFunction_Check(func)) { + return __Pyx_PyFunction_FastCall(func, NULL, 0); + } +#endif +#ifdef __Pyx_CyFunction_USED + if (likely(PyCFunction_Check(func) || __Pyx_CyFunction_Check(func))) +#else + if (likely(PyCFunction_Check(func))) +#endif + { + if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) { + return __Pyx_PyObject_CallMethO(func, NULL); + } + } + return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL); +} +#endif + +/* GetException */ +#if CYTHON_FAST_THREAD_STATE +static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) +#else +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) +#endif +{ + PyObject *local_type, *local_value, *local_tb; +#if CYTHON_FAST_THREAD_STATE + PyObject *tmp_type, *tmp_value, *tmp_tb; + local_type = tstate->curexc_type; + local_value = tstate->curexc_value; + local_tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +#else + PyErr_Fetch(&local_type, &local_value, &local_tb); +#endif + PyErr_NormalizeException(&local_type, &local_value, &local_tb); +#if CYTHON_FAST_THREAD_STATE + if (unlikely(tstate->curexc_type)) +#else + if (unlikely(PyErr_Occurred())) +#endif + goto bad; + #if PY_MAJOR_VERSION >= 3 + if (local_tb) { + if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) + goto bad; + } + #endif + Py_XINCREF(local_tb); + Py_XINCREF(local_type); + Py_XINCREF(local_value); + *type = local_type; + *value = local_value; + *tb = local_tb; +#if CYTHON_FAST_THREAD_STATE + #if CYTHON_USE_EXC_INFO_STACK + { + _PyErr_StackItem *exc_info = tstate->exc_info; + tmp_type = exc_info->exc_type; + tmp_value = exc_info->exc_value; + tmp_tb = exc_info->exc_traceback; + exc_info->exc_type = local_type; + exc_info->exc_value = local_value; + exc_info->exc_traceback = local_tb; + } + #else + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = local_type; + tstate->exc_value = local_value; + tstate->exc_traceback = local_tb; + #endif + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#else + PyErr_SetExcInfo(local_type, local_value, local_tb); +#endif + return 0; +bad: + *type = 0; + *value = 0; + *tb = 0; + Py_XDECREF(local_type); + Py_XDECREF(local_value); + Py_XDECREF(local_tb); + return -1; +} + +/* SwapException */ +#if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + #if CYTHON_USE_EXC_INFO_STACK + _PyErr_StackItem *exc_info = tstate->exc_info; + tmp_type = exc_info->exc_type; + tmp_value = exc_info->exc_value; + tmp_tb = exc_info->exc_traceback; + exc_info->exc_type = *type; + exc_info->exc_value = *value; + exc_info->exc_traceback = *tb; + #else + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = *type; + tstate->exc_value = *value; + tstate->exc_traceback = *tb; + #endif + *type = tmp_type; + *value = tmp_value; + *tb = tmp_tb; +} +#else +static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb); + PyErr_SetExcInfo(*type, *value, *tb); + *type = tmp_type; + *value = tmp_value; + *tb = tmp_tb; +} +#endif + +/* GetTopmostException */ +#if CYTHON_USE_EXC_INFO_STACK +static _PyErr_StackItem * +__Pyx_PyErr_GetTopmostException(PyThreadState *tstate) +{ + _PyErr_StackItem *exc_info = tstate->exc_info; + while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) && + exc_info->previous_item != NULL) + { + exc_info = exc_info->previous_item; + } + return exc_info; +} +#endif + +/* SaveResetException */ +#if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { + #if CYTHON_USE_EXC_INFO_STACK + _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate); + *type = exc_info->exc_type; + *value = exc_info->exc_value; + *tb = exc_info->exc_traceback; + #else + *type = tstate->exc_type; + *value = tstate->exc_value; + *tb = tstate->exc_traceback; + #endif + Py_XINCREF(*type); + Py_XINCREF(*value); + Py_XINCREF(*tb); +} +static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + #if CYTHON_USE_EXC_INFO_STACK + _PyErr_StackItem *exc_info = tstate->exc_info; + tmp_type = exc_info->exc_type; + tmp_value = exc_info->exc_value; + tmp_tb = exc_info->exc_traceback; + exc_info->exc_type = type; + exc_info->exc_value = value; + exc_info->exc_traceback = tb; + #else + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = type; + tstate->exc_value = value; + tstate->exc_traceback = tb; + #endif + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +} +#endif + +/* RaiseArgTupleInvalid */ +static void __Pyx_RaiseArgtupleInvalid( + const char* func_name, + int exact, + Py_ssize_t num_min, + Py_ssize_t num_max, + Py_ssize_t num_found) +{ + Py_ssize_t num_expected; + const char *more_or_less; + if (num_found < num_min) { + num_expected = num_min; + more_or_less = "at least"; + } else { + num_expected = num_max; + more_or_less = "at most"; + } + if (exact) { + more_or_less = "exactly"; + } + PyErr_Format(PyExc_TypeError, + "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", + func_name, more_or_less, num_expected, + (num_expected == 1) ? "" : "s", num_found); +} + +/* RaiseDoubleKeywords */ +static void __Pyx_RaiseDoubleKeywordsError( + const char* func_name, + PyObject* kw_name) +{ + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION >= 3 + "%s() got multiple values for keyword argument '%U'", func_name, kw_name); + #else + "%s() got multiple values for keyword argument '%s'", func_name, + PyString_AsString(kw_name)); + #endif +} + +/* ParseKeywords */ +static int __Pyx_ParseOptionalKeywords( + PyObject *kwds, + PyObject **argnames[], + PyObject *kwds2, + PyObject *values[], + Py_ssize_t num_pos_args, + const char* function_name) +{ + PyObject *key = 0, *value = 0; + Py_ssize_t pos = 0; + PyObject*** name; + PyObject*** first_kw_arg = argnames + num_pos_args; + while (PyDict_Next(kwds, &pos, &key, &value)) { + name = first_kw_arg; + while (*name && (**name != key)) name++; + if (*name) { + values[name-argnames] = value; + continue; + } + name = first_kw_arg; + #if PY_MAJOR_VERSION < 3 + if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) { + while (*name) { + if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) + && _PyString_Eq(**name, key)) { + values[name-argnames] = value; + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + if ((**argname == key) || ( + (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) + && _PyString_Eq(**argname, key))) { + goto arg_passed_twice; + } + argname++; + } + } + } else + #endif + if (likely(PyUnicode_Check(key))) { + while (*name) { + int cmp = (**name == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 : + #endif + PyUnicode_Compare(**name, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) { + values[name-argnames] = value; + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + int cmp = (**argname == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 : + #endif + PyUnicode_Compare(**argname, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) goto arg_passed_twice; + argname++; + } + } + } else + goto invalid_keyword_type; + if (kwds2) { + if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; + } else { + goto invalid_keyword; + } + } + return 0; +arg_passed_twice: + __Pyx_RaiseDoubleKeywordsError(function_name, key); + goto bad; +invalid_keyword_type: + PyErr_Format(PyExc_TypeError, + "%.200s() keywords must be strings", function_name); + goto bad; +invalid_keyword: + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION < 3 + "%.200s() got an unexpected keyword argument '%.200s'", + function_name, PyString_AsString(key)); + #else + "%s() got an unexpected keyword argument '%U'", + function_name, key); + #endif +bad: + return -1; +} + +/* PyErrExceptionMatches */ +#if CYTHON_FAST_THREAD_STATE +static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { + Py_ssize_t i, n; + n = PyTuple_GET_SIZE(tuple); +#if PY_MAJOR_VERSION >= 3 + for (i=0; icurexc_type; + if (exc_type == err) return 1; + if (unlikely(!exc_type)) return 0; + if (unlikely(PyTuple_Check(err))) + return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err); + return __Pyx_PyErr_GivenExceptionMatches(exc_type, err); +} +#endif + +/* GetAttr */ +static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) { +#if CYTHON_USE_TYPE_SLOTS +#if PY_MAJOR_VERSION >= 3 + if (likely(PyUnicode_Check(n))) +#else + if (likely(PyString_Check(n))) +#endif + return __Pyx_PyObject_GetAttrStr(o, n); +#endif + return PyObject_GetAttr(o, n); +} + +/* GetAttr3 */ +static PyObject *__Pyx_GetAttr3Default(PyObject *d) { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) + return NULL; + __Pyx_PyErr_Clear(); + Py_INCREF(d); + return d; +} +static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) { + PyObject *r = __Pyx_GetAttr(o, n); + return (likely(r)) ? r : __Pyx_GetAttr3Default(d); +} + +/* ExtTypeTest */ +static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { + if (unlikely(!type)) { + PyErr_SetString(PyExc_SystemError, "Missing type object"); + return 0; + } + if (likely(__Pyx_TypeCheck(obj, type))) + return 1; + PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s", + Py_TYPE(obj)->tp_name, type->tp_name); + return 0; +} + +/* GetModuleGlobalName */ +#if CYTHON_USE_DICT_VERSIONS +static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value) +#else +static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) +#endif +{ + PyObject *result; +#if !CYTHON_AVOID_BORROWED_REFS +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 + result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } else if (unlikely(PyErr_Occurred())) { + return NULL; + } +#else + result = PyDict_GetItem(__pyx_d, name); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } +#endif +#else + result = PyObject_GetItem(__pyx_d, name); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } + PyErr_Clear(); +#endif + return __Pyx_GetBuiltinName(name); +} + +/* ArgTypeTest */ +static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact) +{ + if (unlikely(!type)) { + PyErr_SetString(PyExc_SystemError, "Missing type object"); + return 0; + } + else if (exact) { + #if PY_MAJOR_VERSION == 2 + if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1; + #endif + } + else { + if (likely(__Pyx_TypeCheck(obj, type))) return 1; + } + PyErr_Format(PyExc_TypeError, + "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)", + name, type->tp_name, Py_TYPE(obj)->tp_name); + return 0; +} + +/* CallNextTpDealloc */ +static void __Pyx_call_next_tp_dealloc(PyObject* obj, destructor current_tp_dealloc) { + PyTypeObject* type = Py_TYPE(obj); + while (type && type->tp_dealloc != current_tp_dealloc) + type = type->tp_base; + while (type && type->tp_dealloc == current_tp_dealloc) + type = type->tp_base; + if (type) + type->tp_dealloc(obj); +} + +/* CallNextTpTraverse */ +static int __Pyx_call_next_tp_traverse(PyObject* obj, visitproc v, void *a, traverseproc current_tp_traverse) { + PyTypeObject* type = Py_TYPE(obj); + while (type && type->tp_traverse != current_tp_traverse) + type = type->tp_base; + while (type && type->tp_traverse == current_tp_traverse) + type = type->tp_base; + if (type && type->tp_traverse) + return type->tp_traverse(obj, v, a); + return 0; +} + +/* CallNextTpClear */ +static void __Pyx_call_next_tp_clear(PyObject* obj, inquiry current_tp_clear) { + PyTypeObject* type = Py_TYPE(obj); + while (type && type->tp_clear != current_tp_clear) + type = type->tp_base; + while (type && type->tp_clear == current_tp_clear) + type = type->tp_base; + if (type && type->tp_clear) + type->tp_clear(obj); +} + +/* TypeImport */ +#ifndef __PYX_HAVE_RT_ImportType +#define __PYX_HAVE_RT_ImportType +static PyTypeObject *__Pyx_ImportType(PyObject *module, const char *module_name, const char *class_name, + size_t size, enum __Pyx_ImportType_CheckSize check_size) +{ + PyObject *result = 0; + char warning[200]; + Py_ssize_t basicsize; +#ifdef Py_LIMITED_API + PyObject *py_basicsize; +#endif + result = PyObject_GetAttrString(module, class_name); + if (!result) + goto bad; + if (!PyType_Check(result)) { + PyErr_Format(PyExc_TypeError, + "%.200s.%.200s is not a type object", + module_name, class_name); + goto bad; + } +#ifndef Py_LIMITED_API + basicsize = ((PyTypeObject *)result)->tp_basicsize; +#else + py_basicsize = PyObject_GetAttrString(result, "__basicsize__"); + if (!py_basicsize) + goto bad; + basicsize = PyLong_AsSsize_t(py_basicsize); + Py_DECREF(py_basicsize); + py_basicsize = 0; + if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred()) + goto bad; +#endif + if ((size_t)basicsize < size) { + PyErr_Format(PyExc_ValueError, + "%.200s.%.200s size changed, may indicate binary incompatibility. " + "Expected %zd from C header, got %zd from PyObject", + module_name, class_name, size, basicsize); + goto bad; + } + if (check_size == __Pyx_ImportType_CheckSize_Error && (size_t)basicsize != size) { + PyErr_Format(PyExc_ValueError, + "%.200s.%.200s size changed, may indicate binary incompatibility. " + "Expected %zd from C header, got %zd from PyObject", + module_name, class_name, size, basicsize); + goto bad; + } + else if (check_size == __Pyx_ImportType_CheckSize_Warn && (size_t)basicsize > size) { + PyOS_snprintf(warning, sizeof(warning), + "%s.%s size changed, may indicate binary incompatibility. " + "Expected %zd from C header, got %zd from PyObject", + module_name, class_name, size, basicsize); + if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad; + } + return (PyTypeObject *)result; +bad: + Py_XDECREF(result); + return NULL; +} +#endif + +/* GetVTable */ +static void* __Pyx_GetVtable(PyObject *dict) { + void* ptr; + PyObject *ob = PyObject_GetItem(dict, __pyx_n_s_pyx_vtable); + if (!ob) + goto bad; +#if PY_VERSION_HEX >= 0x02070000 + ptr = PyCapsule_GetPointer(ob, 0); +#else + ptr = PyCObject_AsVoidPtr(ob); +#endif + if (!ptr && !PyErr_Occurred()) + PyErr_SetString(PyExc_RuntimeError, "invalid vtable found for imported type"); + Py_DECREF(ob); + return ptr; +bad: + Py_XDECREF(ob); + return NULL; +} + +/* PyObject_GenericGetAttrNoDict */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) { + PyErr_Format(PyExc_AttributeError, +#if PY_MAJOR_VERSION >= 3 + "'%.50s' object has no attribute '%U'", + tp->tp_name, attr_name); +#else + "'%.50s' object has no attribute '%.400s'", + tp->tp_name, PyString_AS_STRING(attr_name)); +#endif + return NULL; +} +static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) { + PyObject *descr; + PyTypeObject *tp = Py_TYPE(obj); + if (unlikely(!PyString_Check(attr_name))) { + return PyObject_GenericGetAttr(obj, attr_name); + } + assert(!tp->tp_dictoffset); + descr = _PyType_Lookup(tp, attr_name); + if (unlikely(!descr)) { + return __Pyx_RaiseGenericGetAttributeError(tp, attr_name); + } + Py_INCREF(descr); + #if PY_MAJOR_VERSION < 3 + if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS))) + #endif + { + descrgetfunc f = Py_TYPE(descr)->tp_descr_get; + if (unlikely(f)) { + PyObject *res = f(descr, obj, (PyObject *)tp); + Py_DECREF(descr); + return res; + } + } + return descr; +} +#endif + +/* PyObject_GenericGetAttr */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) { + if (unlikely(Py_TYPE(obj)->tp_dictoffset)) { + return PyObject_GenericGetAttr(obj, attr_name); + } + return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name); +} +#endif + +/* SetVTable */ +static int __Pyx_SetVtable(PyObject *dict, void *vtable) { +#if PY_VERSION_HEX >= 0x02070000 + PyObject *ob = PyCapsule_New(vtable, 0, 0); +#else + PyObject *ob = PyCObject_FromVoidPtr(vtable, 0); +#endif + if (!ob) + goto bad; + if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0) + goto bad; + Py_DECREF(ob); + return 0; +bad: + Py_XDECREF(ob); + return -1; +} + +/* Import */ +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { + PyObject *empty_list = 0; + PyObject *module = 0; + PyObject *global_dict = 0; + PyObject *empty_dict = 0; + PyObject *list; + #if PY_MAJOR_VERSION < 3 + PyObject *py_import; + py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); + if (!py_import) + goto bad; + #endif + if (from_list) + list = from_list; + else { + empty_list = PyList_New(0); + if (!empty_list) + goto bad; + list = empty_list; + } + global_dict = PyModule_GetDict(__pyx_m); + if (!global_dict) + goto bad; + empty_dict = PyDict_New(); + if (!empty_dict) + goto bad; + { + #if PY_MAJOR_VERSION >= 3 + if (level == -1) { + if (strchr(__Pyx_MODULE_NAME, '.')) { + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, 1); + if (!module) { + if (!PyErr_ExceptionMatches(PyExc_ImportError)) + goto bad; + PyErr_Clear(); + } + } + level = 0; + } + #endif + if (!module) { + #if PY_MAJOR_VERSION < 3 + PyObject *py_level = PyInt_FromLong(level); + if (!py_level) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, py_level, (PyObject *)NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, level); + #endif + } + } +bad: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(py_import); + #endif + Py_XDECREF(empty_list); + Py_XDECREF(empty_dict); + return module; +} + +/* ImportFrom */ +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { + PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); + if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_Format(PyExc_ImportError, + #if PY_MAJOR_VERSION < 3 + "cannot import name %.230s", PyString_AS_STRING(name)); + #else + "cannot import name %S", name); + #endif + } + return value; +} + +/* FetchCommonType */ +static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { + PyObject* fake_module; + PyTypeObject* cached_type = NULL; + fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI); + if (!fake_module) return NULL; + Py_INCREF(fake_module); + cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name); + if (cached_type) { + if (!PyType_Check((PyObject*)cached_type)) { + PyErr_Format(PyExc_TypeError, + "Shared Cython type %.200s is not a type object", + type->tp_name); + goto bad; + } + if (cached_type->tp_basicsize != type->tp_basicsize) { + PyErr_Format(PyExc_TypeError, + "Shared Cython type %.200s has the wrong size, try recompiling", + type->tp_name); + goto bad; + } + } else { + if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; + PyErr_Clear(); + if (PyType_Ready(type) < 0) goto bad; + if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0) + goto bad; + Py_INCREF(type); + cached_type = type; + } +done: + Py_DECREF(fake_module); + return cached_type; +bad: + Py_XDECREF(cached_type); + cached_type = NULL; + goto done; +} + +/* CythonFunction */ +#include +static PyObject * +__Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure) +{ + if (unlikely(op->func_doc == NULL)) { + if (op->func.m_ml->ml_doc) { +#if PY_MAJOR_VERSION >= 3 + op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc); +#else + op->func_doc = PyString_FromString(op->func.m_ml->ml_doc); +#endif + if (unlikely(op->func_doc == NULL)) + return NULL; + } else { + Py_INCREF(Py_None); + return Py_None; + } + } + Py_INCREF(op->func_doc); + return op->func_doc; +} +static int +__Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context) +{ + PyObject *tmp = op->func_doc; + if (value == NULL) { + value = Py_None; + } + Py_INCREF(value); + op->func_doc = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + if (unlikely(op->func_name == NULL)) { +#if PY_MAJOR_VERSION >= 3 + op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name); +#else + op->func_name = PyString_InternFromString(op->func.m_ml->ml_name); +#endif + if (unlikely(op->func_name == NULL)) + return NULL; + } + Py_INCREF(op->func_name); + return op->func_name; +} +static int +__Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context) +{ + PyObject *tmp; +#if PY_MAJOR_VERSION >= 3 + if (unlikely(value == NULL || !PyUnicode_Check(value))) +#else + if (unlikely(value == NULL || !PyString_Check(value))) +#endif + { + PyErr_SetString(PyExc_TypeError, + "__name__ must be set to a string object"); + return -1; + } + tmp = op->func_name; + Py_INCREF(value); + op->func_name = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + Py_INCREF(op->func_qualname); + return op->func_qualname; +} +static int +__Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context) +{ + PyObject *tmp; +#if PY_MAJOR_VERSION >= 3 + if (unlikely(value == NULL || !PyUnicode_Check(value))) +#else + if (unlikely(value == NULL || !PyString_Check(value))) +#endif + { + PyErr_SetString(PyExc_TypeError, + "__qualname__ must be set to a string object"); + return -1; + } + tmp = op->func_qualname; + Py_INCREF(value); + op->func_qualname = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED void *closure) +{ + PyObject *self; + self = m->func_closure; + if (self == NULL) + self = Py_None; + Py_INCREF(self); + return self; +} +static PyObject * +__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + if (unlikely(op->func_dict == NULL)) { + op->func_dict = PyDict_New(); + if (unlikely(op->func_dict == NULL)) + return NULL; + } + Py_INCREF(op->func_dict); + return op->func_dict; +} +static int +__Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context) +{ + PyObject *tmp; + if (unlikely(value == NULL)) { + PyErr_SetString(PyExc_TypeError, + "function's dictionary may not be deleted"); + return -1; + } + if (unlikely(!PyDict_Check(value))) { + PyErr_SetString(PyExc_TypeError, + "setting function's dictionary to a non-dict"); + return -1; + } + tmp = op->func_dict; + Py_INCREF(value); + op->func_dict = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + Py_INCREF(op->func_globals); + return op->func_globals; +} +static PyObject * +__Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + Py_INCREF(Py_None); + return Py_None; +} +static PyObject * +__Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + PyObject* result = (op->func_code) ? op->func_code : Py_None; + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { + int result = 0; + PyObject *res = op->defaults_getter((PyObject *) op); + if (unlikely(!res)) + return -1; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + op->defaults_tuple = PyTuple_GET_ITEM(res, 0); + Py_INCREF(op->defaults_tuple); + op->defaults_kwdict = PyTuple_GET_ITEM(res, 1); + Py_INCREF(op->defaults_kwdict); + #else + op->defaults_tuple = PySequence_ITEM(res, 0); + if (unlikely(!op->defaults_tuple)) result = -1; + else { + op->defaults_kwdict = PySequence_ITEM(res, 1); + if (unlikely(!op->defaults_kwdict)) result = -1; + } + #endif + Py_DECREF(res); + return result; +} +static int +__Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) { + PyObject* tmp; + if (!value) { + value = Py_None; + } else if (value != Py_None && !PyTuple_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__defaults__ must be set to a tuple object"); + return -1; + } + Py_INCREF(value); + tmp = op->defaults_tuple; + op->defaults_tuple = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) { + PyObject* result = op->defaults_tuple; + if (unlikely(!result)) { + if (op->defaults_getter) { + if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL; + result = op->defaults_tuple; + } else { + result = Py_None; + } + } + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) { + PyObject* tmp; + if (!value) { + value = Py_None; + } else if (value != Py_None && !PyDict_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__kwdefaults__ must be set to a dict object"); + return -1; + } + Py_INCREF(value); + tmp = op->defaults_kwdict; + op->defaults_kwdict = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) { + PyObject* result = op->defaults_kwdict; + if (unlikely(!result)) { + if (op->defaults_getter) { + if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL; + result = op->defaults_kwdict; + } else { + result = Py_None; + } + } + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) { + PyObject* tmp; + if (!value || value == Py_None) { + value = NULL; + } else if (!PyDict_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__annotations__ must be set to a dict object"); + return -1; + } + Py_XINCREF(value); + tmp = op->func_annotations; + op->func_annotations = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) { + PyObject* result = op->func_annotations; + if (unlikely(!result)) { + result = PyDict_New(); + if (unlikely(!result)) return NULL; + op->func_annotations = result; + } + Py_INCREF(result); + return result; +} +static PyGetSetDef __pyx_CyFunction_getsets[] = { + {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, + {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, + {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, + {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, + {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, + {(char *) "__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0}, + {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, + {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, + {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, + {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, + {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, + {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, + {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, + {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, + {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, + {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, + {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, + {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, + {0, 0, 0, 0, 0} +}; +static PyMemberDef __pyx_CyFunction_members[] = { + {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), PY_WRITE_RESTRICTED, 0}, + {0, 0, 0, 0, 0} +}; +static PyObject * +__Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args) +{ +#if PY_MAJOR_VERSION >= 3 + return PyUnicode_FromString(m->func.m_ml->ml_name); +#else + return PyString_FromString(m->func.m_ml->ml_name); +#endif +} +static PyMethodDef __pyx_CyFunction_methods[] = { + {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, + {0, 0, 0, 0} +}; +#if PY_VERSION_HEX < 0x030500A0 +#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist) +#else +#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func.m_weakreflist) +#endif +static PyObject *__Pyx_CyFunction_New(PyTypeObject *type, PyMethodDef *ml, int flags, PyObject* qualname, + PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { + __pyx_CyFunctionObject *op = PyObject_GC_New(__pyx_CyFunctionObject, type); + if (op == NULL) + return NULL; + op->flags = flags; + __Pyx_CyFunction_weakreflist(op) = NULL; + op->func.m_ml = ml; + op->func.m_self = (PyObject *) op; + Py_XINCREF(closure); + op->func_closure = closure; + Py_XINCREF(module); + op->func.m_module = module; + op->func_dict = NULL; + op->func_name = NULL; + Py_INCREF(qualname); + op->func_qualname = qualname; + op->func_doc = NULL; + op->func_classobj = NULL; + op->func_globals = globals; + Py_INCREF(op->func_globals); + Py_XINCREF(code); + op->func_code = code; + op->defaults_pyobjects = 0; + op->defaults = NULL; + op->defaults_tuple = NULL; + op->defaults_kwdict = NULL; + op->defaults_getter = NULL; + op->func_annotations = NULL; + PyObject_GC_Track(op); + return (PyObject *) op; +} +static int +__Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) +{ + Py_CLEAR(m->func_closure); + Py_CLEAR(m->func.m_module); + Py_CLEAR(m->func_dict); + Py_CLEAR(m->func_name); + Py_CLEAR(m->func_qualname); + Py_CLEAR(m->func_doc); + Py_CLEAR(m->func_globals); + Py_CLEAR(m->func_code); + Py_CLEAR(m->func_classobj); + Py_CLEAR(m->defaults_tuple); + Py_CLEAR(m->defaults_kwdict); + Py_CLEAR(m->func_annotations); + if (m->defaults) { + PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); + int i; + for (i = 0; i < m->defaults_pyobjects; i++) + Py_XDECREF(pydefaults[i]); + PyObject_Free(m->defaults); + m->defaults = NULL; + } + return 0; +} +static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m) +{ + if (__Pyx_CyFunction_weakreflist(m) != NULL) + PyObject_ClearWeakRefs((PyObject *) m); + __Pyx_CyFunction_clear(m); + PyObject_GC_Del(m); +} +static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) +{ + PyObject_GC_UnTrack(m); + __Pyx__CyFunction_dealloc(m); +} +static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) +{ + Py_VISIT(m->func_closure); + Py_VISIT(m->func.m_module); + Py_VISIT(m->func_dict); + Py_VISIT(m->func_name); + Py_VISIT(m->func_qualname); + Py_VISIT(m->func_doc); + Py_VISIT(m->func_globals); + Py_VISIT(m->func_code); + Py_VISIT(m->func_classobj); + Py_VISIT(m->defaults_tuple); + Py_VISIT(m->defaults_kwdict); + if (m->defaults) { + PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); + int i; + for (i = 0; i < m->defaults_pyobjects; i++) + Py_VISIT(pydefaults[i]); + } + return 0; +} +static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type) +{ + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) { + Py_INCREF(func); + return func; + } + if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) { + if (type == NULL) + type = (PyObject *)(Py_TYPE(obj)); + return __Pyx_PyMethod_New(func, type, (PyObject *)(Py_TYPE(type))); + } + if (obj == Py_None) + obj = NULL; + return __Pyx_PyMethod_New(func, obj, type); +} +static PyObject* +__Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) +{ +#if PY_MAJOR_VERSION >= 3 + return PyUnicode_FromFormat("", + op->func_qualname, (void *)op); +#else + return PyString_FromFormat("", + PyString_AsString(op->func_qualname), (void *)op); +#endif +} +static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) { + PyCFunctionObject* f = (PyCFunctionObject*)func; + PyCFunction meth = f->m_ml->ml_meth; + Py_ssize_t size; + switch (f->m_ml->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) { + case METH_VARARGS: + if (likely(kw == NULL || PyDict_Size(kw) == 0)) + return (*meth)(self, arg); + break; + case METH_VARARGS | METH_KEYWORDS: + return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw); + case METH_NOARGS: + if (likely(kw == NULL || PyDict_Size(kw) == 0)) { + size = PyTuple_GET_SIZE(arg); + if (likely(size == 0)) + return (*meth)(self, NULL); + PyErr_Format(PyExc_TypeError, + "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", + f->m_ml->ml_name, size); + return NULL; + } + break; + case METH_O: + if (likely(kw == NULL || PyDict_Size(kw) == 0)) { + size = PyTuple_GET_SIZE(arg); + if (likely(size == 1)) { + PyObject *result, *arg0; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + arg0 = PyTuple_GET_ITEM(arg, 0); + #else + arg0 = PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL; + #endif + result = (*meth)(self, arg0); + #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) + Py_DECREF(arg0); + #endif + return result; + } + PyErr_Format(PyExc_TypeError, + "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", + f->m_ml->ml_name, size); + return NULL; + } + break; + default: + PyErr_SetString(PyExc_SystemError, "Bad call flags in " + "__Pyx_CyFunction_Call. METH_OLDARGS is no " + "longer supported!"); + return NULL; + } + PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", + f->m_ml->ml_name); + return NULL; +} +static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { + return __Pyx_CyFunction_CallMethod(func, ((PyCFunctionObject*)func)->m_self, arg, kw); +} +static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) { + PyObject *result; + __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func; + if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { + Py_ssize_t argc; + PyObject *new_args; + PyObject *self; + argc = PyTuple_GET_SIZE(args); + new_args = PyTuple_GetSlice(args, 1, argc); + if (unlikely(!new_args)) + return NULL; + self = PyTuple_GetItem(args, 0); + if (unlikely(!self)) { + Py_DECREF(new_args); + return NULL; + } + result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw); + Py_DECREF(new_args); + } else { + result = __Pyx_CyFunction_Call(func, args, kw); + } + return result; +} +static PyTypeObject __pyx_CyFunctionType_type = { + PyVarObject_HEAD_INIT(0, 0) + "cython_function_or_method", + sizeof(__pyx_CyFunctionObject), + 0, + (destructor) __Pyx_CyFunction_dealloc, + 0, + 0, + 0, +#if PY_MAJOR_VERSION < 3 + 0, +#else + 0, +#endif + (reprfunc) __Pyx_CyFunction_repr, + 0, + 0, + 0, + 0, + __Pyx_CyFunction_CallAsMethod, + 0, + 0, + 0, + 0, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, + 0, + (traverseproc) __Pyx_CyFunction_traverse, + (inquiry) __Pyx_CyFunction_clear, + 0, +#if PY_VERSION_HEX < 0x030500A0 + offsetof(__pyx_CyFunctionObject, func_weakreflist), +#else + offsetof(PyCFunctionObject, m_weakreflist), +#endif + 0, + 0, + __pyx_CyFunction_methods, + __pyx_CyFunction_members, + __pyx_CyFunction_getsets, + 0, + 0, + __Pyx_CyFunction_descr_get, + 0, + offsetof(__pyx_CyFunctionObject, func_dict), + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, +#if PY_VERSION_HEX >= 0x030400a1 + 0, +#endif +}; +static int __pyx_CyFunction_init(void) { + __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); + if (unlikely(__pyx_CyFunctionType == NULL)) { + return -1; + } + return 0; +} +static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults = PyObject_Malloc(size); + if (unlikely(!m->defaults)) + return PyErr_NoMemory(); + memset(m->defaults, 0, size); + m->defaults_pyobjects = pyobjects; + return m->defaults; +} +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults_tuple = tuple; + Py_INCREF(tuple); +} +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults_kwdict = dict; + Py_INCREF(dict); +} +static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->func_annotations = dict; + Py_INCREF(dict); +} + +/* GetNameInClass */ +static PyObject *__Pyx_GetGlobalNameAfterAttributeLookup(PyObject *name) { + PyObject *result; + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) + return NULL; + __Pyx_PyErr_Clear(); + __Pyx_GetModuleGlobalNameUncached(result, name); + return result; +} +static PyObject *__Pyx__GetNameInClass(PyObject *nmspace, PyObject *name) { + PyObject *result; + result = __Pyx_PyObject_GetAttrStr(nmspace, name); + if (!result) { + result = __Pyx_GetGlobalNameAfterAttributeLookup(name); + } + return result; +} + +/* Globals */ +static PyObject* __Pyx_Globals(void) { + Py_ssize_t i; + PyObject *names; + PyObject *globals = __pyx_d; + Py_INCREF(globals); + names = PyObject_Dir(__pyx_m); + if (!names) + goto bad; + for (i = PyList_GET_SIZE(names)-1; i >= 0; i--) { +#if CYTHON_COMPILING_IN_PYPY + PyObject* name = PySequence_ITEM(names, i); + if (!name) + goto bad; +#else + PyObject* name = PyList_GET_ITEM(names, i); +#endif + if (!PyDict_Contains(globals, name)) { + PyObject* value = __Pyx_GetAttr(__pyx_m, name); + if (!value) { +#if CYTHON_COMPILING_IN_PYPY + Py_DECREF(name); +#endif + goto bad; + } + if (PyDict_SetItem(globals, name, value) < 0) { +#if CYTHON_COMPILING_IN_PYPY + Py_DECREF(name); +#endif + Py_DECREF(value); + goto bad; + } + } +#if CYTHON_COMPILING_IN_PYPY + Py_DECREF(name); +#endif + } + Py_DECREF(names); + return globals; +bad: + Py_XDECREF(names); + Py_XDECREF(globals); + return NULL; +} + +/* CLineInTraceback */ +#ifndef CYTHON_CLINE_IN_TRACEBACK +static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { + PyObject *use_cline; + PyObject *ptype, *pvalue, *ptraceback; +#if CYTHON_COMPILING_IN_CPYTHON + PyObject **cython_runtime_dict; +#endif + if (unlikely(!__pyx_cython_runtime)) { + return c_line; + } + __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); +#if CYTHON_COMPILING_IN_CPYTHON + cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); + if (likely(cython_runtime_dict)) { + __PYX_PY_DICT_LOOKUP_IF_MODIFIED( + use_cline, *cython_runtime_dict, + __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback)) + } else +#endif + { + PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback); + if (use_cline_obj) { + use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; + Py_DECREF(use_cline_obj); + } else { + PyErr_Clear(); + use_cline = NULL; + } + } + if (!use_cline) { + c_line = 0; + PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); + } + else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { + c_line = 0; + } + __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); + return c_line; +} +#endif + +/* CodeObjectCache */ +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { + int start = 0, mid = 0, end = count - 1; + if (end >= 0 && code_line > entries[end].code_line) { + return count; + } + while (start < end) { + mid = start + (end - start) / 2; + if (code_line < entries[mid].code_line) { + end = mid; + } else if (code_line > entries[mid].code_line) { + start = mid + 1; + } else { + return mid; + } + } + if (code_line <= entries[mid].code_line) { + return mid; + } else { + return mid + 1; + } +} +static PyCodeObject *__pyx_find_code_object(int code_line) { + PyCodeObject* code_object; + int pos; + if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { + return NULL; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { + return NULL; + } + code_object = __pyx_code_cache.entries[pos].code_object; + Py_INCREF(code_object); + return code_object; +} +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { + int pos, i; + __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; + if (unlikely(!code_line)) { + return; + } + if (unlikely(!entries)) { + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); + if (likely(entries)) { + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = 64; + __pyx_code_cache.count = 1; + entries[0].code_line = code_line; + entries[0].code_object = code_object; + Py_INCREF(code_object); + } + return; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { + PyCodeObject* tmp = entries[pos].code_object; + entries[pos].code_object = code_object; + Py_DECREF(tmp); + return; + } + if (__pyx_code_cache.count == __pyx_code_cache.max_count) { + int new_max = __pyx_code_cache.max_count + 64; + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( + __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry)); + if (unlikely(!entries)) { + return; + } + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = new_max; + } + for (i=__pyx_code_cache.count; i>pos; i--) { + entries[i] = entries[i-1]; + } + entries[pos].code_line = code_line; + entries[pos].code_object = code_object; + __pyx_code_cache.count++; + Py_INCREF(code_object); +} + +/* AddTraceback */ +#include "compile.h" +#include "frameobject.h" +#include "traceback.h" +static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( + const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyObject *py_srcfile = 0; + PyObject *py_funcname = 0; + #if PY_MAJOR_VERSION < 3 + py_srcfile = PyString_FromString(filename); + #else + py_srcfile = PyUnicode_FromString(filename); + #endif + if (!py_srcfile) goto bad; + if (c_line) { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + #else + py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + #endif + } + else { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromString(funcname); + #else + py_funcname = PyUnicode_FromString(funcname); + #endif + } + if (!py_funcname) goto bad; + py_code = __Pyx_PyCode_New( + 0, + 0, + 0, + 0, + 0, + __pyx_empty_bytes, /*PyObject *code,*/ + __pyx_empty_tuple, /*PyObject *consts,*/ + __pyx_empty_tuple, /*PyObject *names,*/ + __pyx_empty_tuple, /*PyObject *varnames,*/ + __pyx_empty_tuple, /*PyObject *freevars,*/ + __pyx_empty_tuple, /*PyObject *cellvars,*/ + py_srcfile, /*PyObject *filename,*/ + py_funcname, /*PyObject *name,*/ + py_line, + __pyx_empty_bytes /*PyObject *lnotab*/ + ); + Py_DECREF(py_srcfile); + Py_DECREF(py_funcname); + return py_code; +bad: + Py_XDECREF(py_srcfile); + Py_XDECREF(py_funcname); + return NULL; +} +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyFrameObject *py_frame = 0; + PyThreadState *tstate = __Pyx_PyThreadState_Current; + if (c_line) { + c_line = __Pyx_CLineForTraceback(tstate, c_line); + } + py_code = __pyx_find_code_object(c_line ? -c_line : py_line); + if (!py_code) { + py_code = __Pyx_CreateCodeObjectForTraceback( + funcname, c_line, py_line, filename); + if (!py_code) goto bad; + __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); + } + py_frame = PyFrame_New( + tstate, /*PyThreadState *tstate,*/ + py_code, /*PyCodeObject *code,*/ + __pyx_d, /*PyObject *globals,*/ + 0 /*PyObject *locals*/ + ); + if (!py_frame) goto bad; + __Pyx_PyFrame_SetLineNumber(py_frame, py_line); + PyTraceBack_Here(py_frame); +bad: + Py_XDECREF(py_code); + Py_XDECREF(py_frame); +} + +/* CIntToPy */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { + const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(long) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(long) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(long) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(long), + little, !is_unsigned); + } +} + +/* CIntFromPyVerify */ +#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ + __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) +#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ + __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) +#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ + {\ + func_type value = func_value;\ + if (sizeof(target_type) < sizeof(func_type)) {\ + if (unlikely(value != (func_type) (target_type) value)) {\ + func_type zero = 0;\ + if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ + return (target_type) -1;\ + if (is_unsigned && unlikely(value < zero))\ + goto raise_neg_overflow;\ + else\ + goto raise_overflow;\ + }\ + }\ + return (target_type) value;\ + } + +/* CIntFromPy */ +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { + const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(long) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (long) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (long) 0; + case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0]) + case 2: + if (8 * sizeof(long) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) { + return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + case 3: + if (8 * sizeof(long) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) { + return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + case 4: + if (8 * sizeof(long) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) { + return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (long) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if (sizeof(long) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (long) 0; + case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0])) + case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0]) + case -2: + if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 2: + if (8 * sizeof(long) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case -3: + if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 3: + if (8 * sizeof(long) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case -4: + if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 4: + if (8 * sizeof(long) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + } +#endif + if (sizeof(long) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + long val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (long) -1; + } + } else { + long val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (long) -1; + val = __Pyx_PyInt_As_long(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to long"); + return (long) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to long"); + return (long) -1; +} + +/* CIntFromPy */ +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { + const int neg_one = (int) ((int) 0 - (int) 1), const_zero = (int) 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(int) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (int) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (int) 0; + case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0]) + case 2: + if (8 * sizeof(int) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) { + return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + case 3: + if (8 * sizeof(int) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) { + return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + case 4: + if (8 * sizeof(int) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) { + return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (int) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if (sizeof(int) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (int) 0; + case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0])) + case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0]) + case -2: + if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { + return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 2: + if (8 * sizeof(int) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { + return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case -3: + if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { + return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 3: + if (8 * sizeof(int) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { + return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case -4: + if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { + return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 4: + if (8 * sizeof(int) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { + return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + } +#endif + if (sizeof(int) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + int val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (int) -1; + } + } else { + int val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (int) -1; + val = __Pyx_PyInt_As_int(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to int"); + return (int) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to int"); + return (int) -1; +} + +/* FastTypeChecks */ +#if CYTHON_COMPILING_IN_CPYTHON +static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) { + while (a) { + a = a->tp_base; + if (a == b) + return 1; + } + return b == &PyBaseObject_Type; +} +static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) { + PyObject *mro; + if (a == b) return 1; + mro = a->tp_mro; + if (likely(mro)) { + Py_ssize_t i, n; + n = PyTuple_GET_SIZE(mro); + for (i = 0; i < n; i++) { + if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b) + return 1; + } + return 0; + } + return __Pyx_InBases(a, b); +} +#if PY_MAJOR_VERSION == 2 +static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { + PyObject *exception, *value, *tb; + int res; + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ErrFetch(&exception, &value, &tb); + res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; + if (unlikely(res == -1)) { + PyErr_WriteUnraisable(err); + res = 0; + } + if (!res) { + res = PyObject_IsSubclass(err, exc_type2); + if (unlikely(res == -1)) { + PyErr_WriteUnraisable(err); + res = 0; + } + } + __Pyx_ErrRestore(exception, value, tb); + return res; +} +#else +static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { + int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0; + if (!res) { + res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); + } + return res; +} +#endif +static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { + Py_ssize_t i, n; + assert(PyExceptionClass_Check(exc_type)); + n = PyTuple_GET_SIZE(tuple); +#if PY_MAJOR_VERSION >= 3 + for (i=0; itp_setattro)) + return tp->tp_setattro(obj, attr_name, value); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_setattr)) + return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value); +#endif + return PyObject_SetAttr(obj, attr_name, value); +} +#endif + +/* VoidPtrExport */ +static int __Pyx_ExportVoidPtr(PyObject *name, void *p, const char *sig) { + PyObject *d; + PyObject *cobj = 0; + d = PyDict_GetItem(__pyx_d, __pyx_n_s_pyx_capi); + Py_XINCREF(d); + if (!d) { + d = PyDict_New(); + if (!d) + goto bad; + if (__Pyx_PyObject_SetAttrStr(__pyx_m, __pyx_n_s_pyx_capi, d) < 0) + goto bad; + } +#if PY_VERSION_HEX >= 0x02070000 + cobj = PyCapsule_New(p, sig, 0); +#else + cobj = PyCObject_FromVoidPtrAndDesc(p, (void *)sig, 0); +#endif + if (!cobj) + goto bad; + if (PyDict_SetItem(d, name, cobj) < 0) + goto bad; + Py_DECREF(cobj); + Py_DECREF(d); + return 0; +bad: + Py_XDECREF(cobj); + Py_XDECREF(d); + return -1; +} + +/* FunctionExport */ +static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig) { + PyObject *d = 0; + PyObject *cobj = 0; + union { + void (*fp)(void); + void *p; + } tmp; + d = PyObject_GetAttrString(__pyx_m, (char *)"__pyx_capi__"); + if (!d) { + PyErr_Clear(); + d = PyDict_New(); + if (!d) + goto bad; + Py_INCREF(d); + if (PyModule_AddObject(__pyx_m, (char *)"__pyx_capi__", d) < 0) + goto bad; + } + tmp.fp = f; +#if PY_VERSION_HEX >= 0x02070000 + cobj = PyCapsule_New(tmp.p, sig, 0); +#else + cobj = PyCObject_FromVoidPtrAndDesc(tmp.p, (void *)sig, 0); +#endif + if (!cobj) + goto bad; + if (PyDict_SetItemString(d, name, cobj) < 0) + goto bad; + Py_DECREF(cobj); + Py_DECREF(d); + return 0; +bad: + Py_XDECREF(cobj); + Py_XDECREF(d); + return -1; +} + +/* VoidPtrImport */ +#ifndef __PYX_HAVE_RT_ImportVoidPtr +#define __PYX_HAVE_RT_ImportVoidPtr +static int __Pyx_ImportVoidPtr(PyObject *module, const char *name, void **p, const char *sig) { + PyObject *d = 0; + PyObject *cobj = 0; + d = PyObject_GetAttrString(module, (char *)"__pyx_capi__"); + if (!d) + goto bad; + cobj = PyDict_GetItemString(d, name); + if (!cobj) { + PyErr_Format(PyExc_ImportError, + "%.200s does not export expected C variable %.200s", + PyModule_GetName(module), name); + goto bad; + } +#if PY_VERSION_HEX >= 0x02070000 + if (!PyCapsule_IsValid(cobj, sig)) { + PyErr_Format(PyExc_TypeError, + "C variable %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", + PyModule_GetName(module), name, sig, PyCapsule_GetName(cobj)); + goto bad; + } + *p = PyCapsule_GetPointer(cobj, sig); +#else + {const char *desc, *s1, *s2; + desc = (const char *)PyCObject_GetDesc(cobj); + if (!desc) + goto bad; + s1 = desc; s2 = sig; + while (*s1 != '\0' && *s1 == *s2) { s1++; s2++; } + if (*s1 != *s2) { + PyErr_Format(PyExc_TypeError, + "C variable %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", + PyModule_GetName(module), name, sig, desc); + goto bad; + } + *p = PyCObject_AsVoidPtr(cobj);} +#endif + if (!(*p)) + goto bad; + Py_DECREF(d); + return 0; +bad: + Py_XDECREF(d); + return -1; +} +#endif + +/* FunctionImport */ +#ifndef __PYX_HAVE_RT_ImportFunction +#define __PYX_HAVE_RT_ImportFunction +static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig) { + PyObject *d = 0; + PyObject *cobj = 0; + union { + void (*fp)(void); + void *p; + } tmp; + d = PyObject_GetAttrString(module, (char *)"__pyx_capi__"); + if (!d) + goto bad; + cobj = PyDict_GetItemString(d, funcname); + if (!cobj) { + PyErr_Format(PyExc_ImportError, + "%.200s does not export expected C function %.200s", + PyModule_GetName(module), funcname); + goto bad; + } +#if PY_VERSION_HEX >= 0x02070000 + if (!PyCapsule_IsValid(cobj, sig)) { + PyErr_Format(PyExc_TypeError, + "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", + PyModule_GetName(module), funcname, sig, PyCapsule_GetName(cobj)); + goto bad; + } + tmp.p = PyCapsule_GetPointer(cobj, sig); +#else + {const char *desc, *s1, *s2; + desc = (const char *)PyCObject_GetDesc(cobj); + if (!desc) + goto bad; + s1 = desc; s2 = sig; + while (*s1 != '\0' && *s1 == *s2) { s1++; s2++; } + if (*s1 != *s2) { + PyErr_Format(PyExc_TypeError, + "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", + PyModule_GetName(module), funcname, sig, desc); + goto bad; + } + tmp.p = PyCObject_AsVoidPtr(cobj);} +#endif + *f = tmp.fp; + if (!(*f)) + goto bad; + Py_DECREF(d); + return 0; +bad: + Py_XDECREF(d); + return -1; +} +#endif + +/* InitStrings */ +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { + while (t->p) { + #if PY_MAJOR_VERSION < 3 + if (t->is_unicode) { + *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); + } else if (t->intern) { + *t->p = PyString_InternFromString(t->s); + } else { + *t->p = PyString_FromStringAndSize(t->s, t->n - 1); + } + #else + if (t->is_unicode | t->is_str) { + if (t->intern) { + *t->p = PyUnicode_InternFromString(t->s); + } else if (t->encoding) { + *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); + } else { + *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); + } + } else { + *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); + } + #endif + if (!*t->p) + return -1; + if (PyObject_Hash(*t->p) == -1) + return -1; + ++t; + } + return 0; +} + +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { + return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); +} +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { + Py_ssize_t ignore; + return __Pyx_PyObject_AsStringAndSize(o, &ignore); +} +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +#if !CYTHON_PEP393_ENABLED +static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { + char* defenc_c; + PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); + if (!defenc) return NULL; + defenc_c = PyBytes_AS_STRING(defenc); +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + { + char* end = defenc_c + PyBytes_GET_SIZE(defenc); + char* c; + for (c = defenc_c; c < end; c++) { + if ((unsigned char) (*c) >= 128) { + PyUnicode_AsASCIIString(o); + return NULL; + } + } + } +#endif + *length = PyBytes_GET_SIZE(defenc); + return defenc_c; +} +#else +static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { + if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + if (likely(PyUnicode_IS_ASCII(o))) { + *length = PyUnicode_GET_LENGTH(o); + return PyUnicode_AsUTF8(o); + } else { + PyUnicode_AsASCIIString(o); + return NULL; + } +#else + return PyUnicode_AsUTF8AndSize(o, length); +#endif +} +#endif +#endif +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT + if ( +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + __Pyx_sys_getdefaultencoding_not_ascii && +#endif + PyUnicode_Check(o)) { + return __Pyx_PyUnicode_AsStringAndSize(o, length); + } else +#endif +#if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) + if (PyByteArray_Check(o)) { + *length = PyByteArray_GET_SIZE(o); + return PyByteArray_AS_STRING(o); + } else +#endif + { + char* result; + int r = PyBytes_AsStringAndSize(o, &result, length); + if (unlikely(r < 0)) { + return NULL; + } else { + return result; + } + } +} +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { + int is_true = x == Py_True; + if (is_true | (x == Py_False) | (x == Py_None)) return is_true; + else return PyObject_IsTrue(x); +} +static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) { + int retval; + if (unlikely(!x)) return -1; + retval = __Pyx_PyObject_IsTrue(x); + Py_DECREF(x); + return retval; +} +static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) { +#if PY_MAJOR_VERSION >= 3 + if (PyLong_Check(result)) { + if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, + "__int__ returned non-int (type %.200s). " + "The ability to return an instance of a strict subclass of int " + "is deprecated, and may be removed in a future version of Python.", + Py_TYPE(result)->tp_name)) { + Py_DECREF(result); + return NULL; + } + return result; + } +#endif + PyErr_Format(PyExc_TypeError, + "__%.4s__ returned non-%.4s (type %.200s)", + type_name, type_name, Py_TYPE(result)->tp_name); + Py_DECREF(result); + return NULL; +} +static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { +#if CYTHON_USE_TYPE_SLOTS + PyNumberMethods *m; +#endif + const char *name = NULL; + PyObject *res = NULL; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x) || PyLong_Check(x))) +#else + if (likely(PyLong_Check(x))) +#endif + return __Pyx_NewRef(x); +#if CYTHON_USE_TYPE_SLOTS + m = Py_TYPE(x)->tp_as_number; + #if PY_MAJOR_VERSION < 3 + if (m && m->nb_int) { + name = "int"; + res = m->nb_int(x); + } + else if (m && m->nb_long) { + name = "long"; + res = m->nb_long(x); + } + #else + if (likely(m && m->nb_int)) { + name = "int"; + res = m->nb_int(x); + } + #endif +#else + if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { + res = PyNumber_Int(x); + } +#endif + if (likely(res)) { +#if PY_MAJOR_VERSION < 3 + if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) { +#else + if (unlikely(!PyLong_CheckExact(res))) { +#endif + return __Pyx_PyNumber_IntOrLongWrongResultType(res, name); + } + } + else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_TypeError, + "an integer is required"); + } + return res; +} +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { + Py_ssize_t ival; + PyObject *x; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_CheckExact(b))) { + if (sizeof(Py_ssize_t) >= sizeof(long)) + return PyInt_AS_LONG(b); + else + return PyInt_AsSsize_t(b); + } +#endif + if (likely(PyLong_CheckExact(b))) { + #if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)b)->ob_digit; + const Py_ssize_t size = Py_SIZE(b); + if (likely(__Pyx_sst_abs(size) <= 1)) { + ival = likely(size) ? digits[0] : 0; + if (size == -1) ival = -ival; + return ival; + } else { + switch (size) { + case 2: + if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { + return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -2: + if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case 3: + if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { + return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -3: + if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case 4: + if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { + return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -4: + if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + } + } + #endif + return PyLong_AsSsize_t(b); + } + x = PyNumber_Index(b); + if (!x) return -1; + ival = PyInt_AsSsize_t(x); + Py_DECREF(x); + return ival; +} +static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) { + return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False); +} +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { + return PyInt_FromSize_t(ival); +} + + +#endif /* Py_PYTHON_H */ diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_hub_primitives.html b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_hub_primitives.html new file mode 100644 index 00000000..6bf97d50 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_hub_primitives.html @@ -0,0 +1,4991 @@ + + + + + + Cython: _hub_primitives.py + + + +

Generated by Cython 0.29.2

+

+ Yellow lines hint at Python interaction.
+ Click on a line that starts with a "+" to see the C code that Cython generated for it. +

+

Raw output: _hub_primitives.c

+
+001: # -*- coding: utf-8 -*-
+
  __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
 002: # copyright (c) 2018 gevent. See  LICENSE.
+
 003: # cython: auto_pickle=False,embedsignature=True,always_allow_keywords=False,binding=True
+
 004: """
+
 005: A collection of primitives used by the hub, and suitable for
+
 006: compilation with Cython because of their frequency of use.
+
 007: 
+
 008: 
+
 009: """
+
 010: from __future__ import absolute_import
+
 011: from __future__ import division
+
 012: from __future__ import print_function
+
 013: 
+
+014: import traceback
+
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_traceback, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 14, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_XGOTREF(__pyx_v_6gevent_16__hub_primitives_traceback);
+  __Pyx_DECREF_SET(__pyx_v_6gevent_16__hub_primitives_traceback, __pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_1);
+  __pyx_t_1 = 0;
+
 015: 
+
+016: from gevent.exceptions import InvalidSwitchError
+
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 16, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(__pyx_n_s_InvalidSwitchError);
+  __Pyx_GIVEREF(__pyx_n_s_InvalidSwitchError);
+  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_InvalidSwitchError);
+  __pyx_t_2 = __Pyx_Import(__pyx_n_s_gevent_exceptions, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 16, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_InvalidSwitchError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 16, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(__pyx_t_1);
+  __Pyx_XGOTREF(__pyx_v_6gevent_16__hub_primitives_InvalidSwitchError);
+  __Pyx_DECREF_SET(__pyx_v_6gevent_16__hub_primitives_InvalidSwitchError, __pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+017: from gevent.exceptions import ConcurrentObjectUseError
+
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 17, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_ConcurrentObjectUseError);
+  __Pyx_GIVEREF(__pyx_n_s_ConcurrentObjectUseError);
+  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_ConcurrentObjectUseError);
+  __pyx_t_1 = __Pyx_Import(__pyx_n_s_gevent_exceptions, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 17, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_ConcurrentObjectUseError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 17, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ConcurrentObjectUseError, __pyx_t_2) < 0) __PYX_ERR(0, 17, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 018: 
+
+019: from gevent import _greenlet_primitives
+
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 19, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(__pyx_n_s_greenlet_primitives);
+  __Pyx_GIVEREF(__pyx_n_s_greenlet_primitives);
+  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_greenlet_primitives);
+  __pyx_t_2 = __Pyx_Import(__pyx_n_s_gevent, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 19, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_greenlet_primitives); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 19, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(__pyx_t_1);
+  __Pyx_XGOTREF(__pyx_v_6gevent_16__hub_primitives__greenlet_primitives);
+  __Pyx_DECREF_SET(__pyx_v_6gevent_16__hub_primitives__greenlet_primitives, __pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+020: from gevent import _waiter
+
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 20, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_waiter);
+  __Pyx_GIVEREF(__pyx_n_s_waiter);
+  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_waiter);
+  __pyx_t_1 = __Pyx_Import(__pyx_n_s_gevent, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 20, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_waiter); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 20, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(__pyx_t_2);
+  __Pyx_XGOTREF(__pyx_v_6gevent_16__hub_primitives__waiter);
+  __Pyx_DECREF_SET(__pyx_v_6gevent_16__hub_primitives__waiter, __pyx_t_2);
+  __Pyx_GIVEREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+021: from gevent._util import _NONE
+
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 21, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(__pyx_n_s_NONE);
+  __Pyx_GIVEREF(__pyx_n_s_NONE);
+  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_NONE);
+  __pyx_t_2 = __Pyx_Import(__pyx_n_s_gevent__util, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 21, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_NONE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 21, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_NONE, __pyx_t_1) < 0) __PYX_ERR(0, 21, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+022: from gevent._hub_local import get_hub_noargs as get_hub
+
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 22, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_get_hub_noargs);
+  __Pyx_GIVEREF(__pyx_n_s_get_hub_noargs);
+  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_get_hub_noargs);
+  __pyx_t_1 = __Pyx_Import(__pyx_n_s_gevent__hub_local, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 22, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_get_hub_noargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 22, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_hub_noargs, __pyx_t_2) < 0) __PYX_ERR(0, 22, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+023: from gevent.timeout import Timeout
+
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 23, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(__pyx_n_s_Timeout);
+  __Pyx_GIVEREF(__pyx_n_s_Timeout);
+  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_Timeout);
+  __pyx_t_2 = __Pyx_Import(__pyx_n_s_gevent_timeout, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 23, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_Timeout); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 23, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(__pyx_t_1);
+  __Pyx_XGOTREF(__pyx_v_6gevent_16__hub_primitives_Timeout);
+  __Pyx_DECREF_SET(__pyx_v_6gevent_16__hub_primitives_Timeout, __pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
 024: 
+
 025: # In Cython, we define these as 'cdef inline' functions. The
+
 026: # compilation unit cannot have a direct assignment to them (import
+
 027: # is assignment) without generating a 'lvalue is not valid target'
+
 028: # error.
+
+029: locals()['getcurrent'] = __import__('greenlet').getcurrent
+
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin___import__, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 29, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_getcurrent); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 29, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_2 = __Pyx_Globals(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 29, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (unlikely(PyDict_SetItem(__pyx_t_2, __pyx_n_s_getcurrent, __pyx_t_1) < 0)) __PYX_ERR(0, 29, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+/* … */
+  __pyx_tuple__8 = PyTuple_Pack(1, __pyx_n_s_greenlet); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 29, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__8);
+  __Pyx_GIVEREF(__pyx_tuple__8);
+
+030: locals()['greenlet_init'] = lambda: None
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_16__hub_primitives_18lambda(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyMethodDef __pyx_mdef_6gevent_16__hub_primitives_18lambda = {"lambda", (PyCFunction)__pyx_pw_6gevent_16__hub_primitives_18lambda, METH_NOARGS, 0};
+static PyObject *__pyx_pw_6gevent_16__hub_primitives_18lambda(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("lambda (wrapper)", 0);
+  __pyx_r = __pyx_lambda_funcdef_6gevent_16__hub_primitives_lambda(__pyx_self);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_lambda_funcdef_6gevent_16__hub_primitives_lambda(CYTHON_UNUSED PyObject *__pyx_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("lambda", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_16__hub_primitives_18lambda, 0, __pyx_n_s_lambda, NULL, __pyx_n_s_gevent___hub_primitives, __pyx_d, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 30, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = __Pyx_Globals(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 30, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (unlikely(PyDict_SetItem(__pyx_t_2, __pyx_n_s_greenlet_init, __pyx_t_1) < 0)) __PYX_ERR(0, 30, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+031: locals()['Waiter'] = _waiter.Waiter
+
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_6gevent_16__hub_primitives__waiter, __pyx_n_s_Waiter); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 31, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = __Pyx_Globals(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 31, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (unlikely(PyDict_SetItem(__pyx_t_2, __pyx_n_s_Waiter, __pyx_t_1) < 0)) __PYX_ERR(0, 31, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+032: locals()['MultipleWaiter'] = _waiter.MultipleWaiter
+
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_6gevent_16__hub_primitives__waiter, __pyx_n_s_MultipleWaiter); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 32, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = __Pyx_Globals(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 32, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (unlikely(PyDict_SetItem(__pyx_t_2, __pyx_n_s_MultipleWaiter, __pyx_t_1) < 0)) __PYX_ERR(0, 32, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+033: locals()['SwitchOutGreenletWithLoop'] = _greenlet_primitives.SwitchOutGreenletWithLoop
+
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_6gevent_16__hub_primitives__greenlet_primitives, __pyx_n_s_SwitchOutGreenletWithLoop); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 33, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = __Pyx_Globals(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 33, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (unlikely(PyDict_SetItem(__pyx_t_2, __pyx_n_s_SwitchOutGreenletWithLoop, __pyx_t_1) < 0)) __PYX_ERR(0, 33, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 034: 
+
+035: __all__ = [
+
  __pyx_t_1 = PyList_New(6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 35, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(__pyx_n_s_WaitOperationsGreenlet);
+  __Pyx_GIVEREF(__pyx_n_s_WaitOperationsGreenlet);
+  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_WaitOperationsGreenlet);
+  __Pyx_INCREF(__pyx_n_s_iwait_on_objects);
+  __Pyx_GIVEREF(__pyx_n_s_iwait_on_objects);
+  PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_iwait_on_objects);
+  __Pyx_INCREF(__pyx_n_s_wait_on_objects);
+  __Pyx_GIVEREF(__pyx_n_s_wait_on_objects);
+  PyList_SET_ITEM(__pyx_t_1, 2, __pyx_n_s_wait_on_objects);
+  __Pyx_INCREF(__pyx_n_s_wait_read);
+  __Pyx_GIVEREF(__pyx_n_s_wait_read);
+  PyList_SET_ITEM(__pyx_t_1, 3, __pyx_n_s_wait_read);
+  __Pyx_INCREF(__pyx_n_s_wait_write);
+  __Pyx_GIVEREF(__pyx_n_s_wait_write);
+  PyList_SET_ITEM(__pyx_t_1, 4, __pyx_n_s_wait_write);
+  __Pyx_INCREF(__pyx_n_s_wait_readwrite);
+  __Pyx_GIVEREF(__pyx_n_s_wait_readwrite);
+  PyList_SET_ITEM(__pyx_t_1, 5, __pyx_n_s_wait_readwrite);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_all, __pyx_t_1) < 0) __PYX_ERR(0, 35, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 036:     'WaitOperationsGreenlet',
+
 037:     'iwait_on_objects',
+
 038:     'wait_on_objects',
+
 039:     'wait_read',
+
 040:     'wait_write',
+
 041:     'wait_readwrite',
+
 042: ]
+
 043: 
+
+044: class WaitOperationsGreenlet(SwitchOutGreenletWithLoop): # pylint:disable=undefined-variable
+
struct __pyx_vtabstruct_6gevent_16__hub_primitives_WaitOperationsGreenlet {
+  struct __pyx_vtabstruct_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop __pyx_base;
+  PyObject *(*wait)(struct __pyx_obj_6gevent_16__hub_primitives_WaitOperationsGreenlet *, PyObject *, int __pyx_skip_dispatch);
+  PyObject *(*cancel_wait)(struct __pyx_obj_6gevent_16__hub_primitives_WaitOperationsGreenlet *, PyObject *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_16__hub_primitives_22WaitOperationsGreenlet_cancel_wait *__pyx_optional_args);
+  PyObject *(*_cancel_wait)(struct __pyx_obj_6gevent_16__hub_primitives_WaitOperationsGreenlet *, PyObject *, PyObject *, PyObject *, int __pyx_skip_dispatch);
+};
+static struct __pyx_vtabstruct_6gevent_16__hub_primitives_WaitOperationsGreenlet *__pyx_vtabptr_6gevent_16__hub_primitives_WaitOperationsGreenlet;
+
+
 045: 
+
+046:     def wait(self, watcher):
+
static PyObject *__pyx_pw_6gevent_16__hub_primitives_22WaitOperationsGreenlet_1wait(PyObject *__pyx_v_self, PyObject *__pyx_v_watcher); /*proto*/
+static PyObject *__pyx_f_6gevent_16__hub_primitives_22WaitOperationsGreenlet_wait(struct __pyx_obj_6gevent_16__hub_primitives_WaitOperationsGreenlet *__pyx_v_self, PyObject *__pyx_v_watcher, int __pyx_skip_dispatch) {
+  struct __pyx_obj_6gevent_8__waiter_Waiter *__pyx_v_waiter = NULL;
+  PyObject *__pyx_v_result = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("wait", 0);
+  /* Check if called by wrapper */
+  if (unlikely(__pyx_skip_dispatch)) ;
+  /* Check if overridden in Python */
+  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
+    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
+    if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
+    else {
+      PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      #endif
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_wait); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 46, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_16__hub_primitives_22WaitOperationsGreenlet_1wait)) {
+        __Pyx_XDECREF(__pyx_r);
+        __Pyx_INCREF(__pyx_t_1);
+        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+          if (likely(__pyx_t_4)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+            __Pyx_INCREF(__pyx_t_4);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_3, function);
+          }
+        }
+        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_watcher) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_watcher);
+        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 46, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __pyx_r = __pyx_t_2;
+        __pyx_t_2 = 0;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        goto __pyx_L0;
+      }
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+      tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
+      if (unlikely(type_dict_guard != tp_dict_version)) {
+        tp_dict_version = obj_dict_version = 0;
+      }
+      #endif
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    }
+    #endif
+  }
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_6);
+  __Pyx_AddTraceback("gevent.__hub_primitives.WaitOperationsGreenlet.wait", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XDECREF((PyObject *)__pyx_v_waiter);
+  __Pyx_XDECREF(__pyx_v_result);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_16__hub_primitives_22WaitOperationsGreenlet_1wait(PyObject *__pyx_v_self, PyObject *__pyx_v_watcher); /*proto*/
+static char __pyx_doc_6gevent_16__hub_primitives_22WaitOperationsGreenlet_wait[] = "WaitOperationsGreenlet.wait(self, watcher)\n\n        Wait until the *watcher* (which must not be started) is ready.\n\n        The current greenlet will be unscheduled during this time.\n        ";
+static PyMethodDef __pyx_mdef_6gevent_16__hub_primitives_22WaitOperationsGreenlet_1wait = {"wait", (PyCFunction)__pyx_pw_6gevent_16__hub_primitives_22WaitOperationsGreenlet_1wait, METH_O, __pyx_doc_6gevent_16__hub_primitives_22WaitOperationsGreenlet_wait};
+static PyObject *__pyx_pw_6gevent_16__hub_primitives_22WaitOperationsGreenlet_1wait(PyObject *__pyx_v_self, PyObject *__pyx_v_watcher) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("wait (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_16__hub_primitives_22WaitOperationsGreenlet_wait(((struct __pyx_obj_6gevent_16__hub_primitives_WaitOperationsGreenlet *)__pyx_v_self), ((PyObject *)__pyx_v_watcher));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_16__hub_primitives_22WaitOperationsGreenlet_wait(struct __pyx_obj_6gevent_16__hub_primitives_WaitOperationsGreenlet *__pyx_v_self, PyObject *__pyx_v_watcher) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("wait", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __pyx_f_6gevent_16__hub_primitives_22WaitOperationsGreenlet_wait(__pyx_v_self, __pyx_v_watcher, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 46, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.__hub_primitives.WaitOperationsGreenlet.wait", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__9 = PyTuple_Pack(2, __pyx_n_s_self_2, __pyx_n_s_watcher); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 46, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__9);
+  __Pyx_GIVEREF(__pyx_tuple__9);
+/* … */
+  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_16__hub_primitives_22WaitOperationsGreenlet_1wait, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_WaitOperationsGreenlet_wait, NULL, __pyx_n_s_gevent___hub_primitives, __pyx_d, ((PyObject *)__pyx_codeobj__10)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 46, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_16__hub_primitives_WaitOperationsGreenlet->tp_dict, __pyx_n_s_wait, __pyx_t_1) < 0) __PYX_ERR(0, 46, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_16__hub_primitives_WaitOperationsGreenlet);
+  __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__9, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__hub_primitives_py, __pyx_n_s_wait, 46, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__10)) __PYX_ERR(0, 46, __pyx_L1_error)
+
 047:         """
+
 048:         Wait until the *watcher* (which must not be started) is ready.
+
 049: 
+
 050:         The current greenlet will be unscheduled during this time.
+
 051:         """
+
+052:         waiter = Waiter(self) # pylint:disable=undefined-variable
+
  __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_6gevent_8__waiter_Waiter), ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 52, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_v_waiter = ((struct __pyx_obj_6gevent_8__waiter_Waiter *)__pyx_t_1);
+  __pyx_t_1 = 0;
+
+053:         watcher.start(waiter.switch, waiter)
+
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_watcher, __pyx_n_s_start); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 53, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_waiter), __pyx_n_s_switch); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 53, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __pyx_t_4 = NULL;
+  __pyx_t_5 = 0;
+  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
+    if (likely(__pyx_t_4)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+      __Pyx_INCREF(__pyx_t_4);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_2, function);
+      __pyx_t_5 = 1;
+    }
+  }
+  #if CYTHON_FAST_PYCALL
+  if (PyFunction_Check(__pyx_t_2)) {
+    PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_3, ((PyObject *)__pyx_v_waiter)};
+    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 53, __pyx_L1_error)
+    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  } else
+  #endif
+  #if CYTHON_FAST_PYCCALL
+  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
+    PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_3, ((PyObject *)__pyx_v_waiter)};
+    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 53, __pyx_L1_error)
+    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  } else
+  #endif
+  {
+    __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 53, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_6);
+    if (__pyx_t_4) {
+      __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
+    }
+    __Pyx_GIVEREF(__pyx_t_3);
+    PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_t_3);
+    __Pyx_INCREF(((PyObject *)__pyx_v_waiter));
+    __Pyx_GIVEREF(((PyObject *)__pyx_v_waiter));
+    PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, ((PyObject *)__pyx_v_waiter));
+    __pyx_t_3 = 0;
+    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 53, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  }
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+054:         try:
+
  /*try:*/ {
+
+055:             result = waiter.get()
+
    __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_8__waiter_Waiter *)__pyx_v_waiter->__pyx_vtab)->get(__pyx_v_waiter, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 55, __pyx_L4_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __pyx_v_result = __pyx_t_1;
+    __pyx_t_1 = 0;
+
+056:             if result is not waiter:
+
    __pyx_t_7 = (__pyx_v_result != ((PyObject *)__pyx_v_waiter));
+    __pyx_t_8 = (__pyx_t_7 != 0);
+    if (unlikely(__pyx_t_8)) {
+/* … */
+    }
+  }
+
+057:                 raise InvalidSwitchError('Invalid switch into %s: %r (expected %r)' % (
+
      __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_switch_into_s_r_expected, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 57, __pyx_L4_error)
+      __Pyx_GOTREF(__pyx_t_2);
+      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+      __Pyx_INCREF(__pyx_v_6gevent_16__hub_primitives_InvalidSwitchError);
+      __pyx_t_6 = __pyx_v_6gevent_16__hub_primitives_InvalidSwitchError; __pyx_t_3 = NULL;
+      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
+        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_6);
+        if (likely(__pyx_t_3)) {
+          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
+          __Pyx_INCREF(__pyx_t_3);
+          __Pyx_INCREF(function);
+          __Pyx_DECREF_SET(__pyx_t_6, function);
+        }
+      }
+      __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_2);
+      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 57, __pyx_L4_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+      __Pyx_Raise(__pyx_t_1, 0, 0, 0);
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      __PYX_ERR(0, 57, __pyx_L4_error)
+
+058:                     getcurrent(), # pylint:disable=undefined-variable
+
      __pyx_t_2 = ((PyObject *)__pyx_f_6gevent_16__hub_primitives_getcurrent()); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 58, __pyx_L4_error)
+      __Pyx_GOTREF(__pyx_t_2);
+/* … */
+      __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 58, __pyx_L4_error)
+      __Pyx_GOTREF(__pyx_t_6);
+      __Pyx_GIVEREF(__pyx_t_2);
+      PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2);
+      __Pyx_INCREF(__pyx_v_result);
+      __Pyx_GIVEREF(__pyx_v_result);
+      PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_result);
+      __Pyx_INCREF(((PyObject *)__pyx_v_waiter));
+      __Pyx_GIVEREF(((PyObject *)__pyx_v_waiter));
+      PyTuple_SET_ITEM(__pyx_t_6, 2, ((PyObject *)__pyx_v_waiter));
+      __pyx_t_2 = 0;
+
 059:                     result, waiter))
+
 060:         finally:
+
+061:             watcher.stop()
+
  /*finally:*/ {
+    /*normal exit:*/{
+      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_watcher, __pyx_n_s_stop); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 61, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_6);
+      __pyx_t_2 = NULL;
+      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
+        __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_6);
+        if (likely(__pyx_t_2)) {
+          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
+          __Pyx_INCREF(__pyx_t_2);
+          __Pyx_INCREF(function);
+          __Pyx_DECREF_SET(__pyx_t_6, function);
+        }
+      }
+      __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_6);
+      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 61, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      goto __pyx_L5;
+    }
+    __pyx_L4_error:;
+    /*exception exit:*/{
+      __Pyx_PyThreadState_declare
+      __Pyx_PyThreadState_assign
+      __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0;
+      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+      if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_14, &__pyx_t_15, &__pyx_t_16);
+      if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13) < 0)) __Pyx_ErrFetch(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13);
+      __Pyx_XGOTREF(__pyx_t_11);
+      __Pyx_XGOTREF(__pyx_t_12);
+      __Pyx_XGOTREF(__pyx_t_13);
+      __Pyx_XGOTREF(__pyx_t_14);
+      __Pyx_XGOTREF(__pyx_t_15);
+      __Pyx_XGOTREF(__pyx_t_16);
+      __pyx_t_5 = __pyx_lineno; __pyx_t_9 = __pyx_clineno; __pyx_t_10 = __pyx_filename;
+      {
+        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_watcher, __pyx_n_s_stop); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 61, __pyx_L8_error)
+        __Pyx_GOTREF(__pyx_t_6);
+        __pyx_t_2 = NULL;
+        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
+          __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_6);
+          if (likely(__pyx_t_2)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
+            __Pyx_INCREF(__pyx_t_2);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_6, function);
+          }
+        }
+        __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_6);
+        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+        if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 61, __pyx_L8_error)
+        __Pyx_GOTREF(__pyx_t_1);
+        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      }
+      if (PY_MAJOR_VERSION >= 3) {
+        __Pyx_XGIVEREF(__pyx_t_14);
+        __Pyx_XGIVEREF(__pyx_t_15);
+        __Pyx_XGIVEREF(__pyx_t_16);
+        __Pyx_ExceptionReset(__pyx_t_14, __pyx_t_15, __pyx_t_16);
+      }
+      __Pyx_XGIVEREF(__pyx_t_11);
+      __Pyx_XGIVEREF(__pyx_t_12);
+      __Pyx_XGIVEREF(__pyx_t_13);
+      __Pyx_ErrRestore(__pyx_t_11, __pyx_t_12, __pyx_t_13);
+      __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0;
+      __pyx_lineno = __pyx_t_5; __pyx_clineno = __pyx_t_9; __pyx_filename = __pyx_t_10;
+      goto __pyx_L1_error;
+      __pyx_L8_error:;
+      if (PY_MAJOR_VERSION >= 3) {
+        __Pyx_XGIVEREF(__pyx_t_14);
+        __Pyx_XGIVEREF(__pyx_t_15);
+        __Pyx_XGIVEREF(__pyx_t_16);
+        __Pyx_ExceptionReset(__pyx_t_14, __pyx_t_15, __pyx_t_16);
+      }
+      __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
+      __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
+      __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
+      __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0;
+      goto __pyx_L1_error;
+    }
+    __pyx_L5:;
+  }
+
 062: 
+
+063:     def cancel_wait(self, watcher, error, close_watcher=False):
+
+/* "src/gevent/_hub_primitives.py":63
+ *             watcher.stop()
+ * 
+ *     def cancel_wait(self, watcher, error, close_watcher=False):             # <<<<<<<<<<<<<<
+ *         """
+ *         Cancel an in-progress call to :meth:`wait` by throwing the given *error*
+ */
+
+static PyObject *__pyx_pw_6gevent_16__hub_primitives_22WaitOperationsGreenlet_3cancel_wait(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_f_6gevent_16__hub_primitives_22WaitOperationsGreenlet_cancel_wait(struct __pyx_obj_6gevent_16__hub_primitives_WaitOperationsGreenlet *__pyx_v_self, PyObject *__pyx_v_watcher, PyObject *__pyx_v_error, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_16__hub_primitives_22WaitOperationsGreenlet_cancel_wait *__pyx_optional_args) {
+  PyObject *__pyx_v_close_watcher = ((PyObject *)Py_False);
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("cancel_wait", 0);
+  if (__pyx_optional_args) {
+    if (__pyx_optional_args->__pyx_n > 0) {
+      __pyx_v_close_watcher = __pyx_optional_args->close_watcher;
+    }
+  }
+  /* Check if called by wrapper */
+  if (unlikely(__pyx_skip_dispatch)) ;
+  /* Check if overridden in Python */
+  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
+    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
+    if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
+    else {
+      PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      #endif
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_cancel_wait); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 63, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_16__hub_primitives_22WaitOperationsGreenlet_3cancel_wait)) {
+        __Pyx_XDECREF(__pyx_r);
+        __Pyx_INCREF(__pyx_t_1);
+        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
+        __pyx_t_5 = 0;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+          if (likely(__pyx_t_4)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+            __Pyx_INCREF(__pyx_t_4);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_3, function);
+            __pyx_t_5 = 1;
+          }
+        }
+        #if CYTHON_FAST_PYCALL
+        if (PyFunction_Check(__pyx_t_3)) {
+          PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_watcher, __pyx_v_error, __pyx_v_close_watcher};
+          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 63, __pyx_L1_error)
+          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+          __Pyx_GOTREF(__pyx_t_2);
+        } else
+        #endif
+        #if CYTHON_FAST_PYCCALL
+        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
+          PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_watcher, __pyx_v_error, __pyx_v_close_watcher};
+          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 63, __pyx_L1_error)
+          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+          __Pyx_GOTREF(__pyx_t_2);
+        } else
+        #endif
+        {
+          __pyx_t_6 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 63, __pyx_L1_error)
+          __Pyx_GOTREF(__pyx_t_6);
+          if (__pyx_t_4) {
+            __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
+          }
+          __Pyx_INCREF(__pyx_v_watcher);
+          __Pyx_GIVEREF(__pyx_v_watcher);
+          PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_watcher);
+          __Pyx_INCREF(__pyx_v_error);
+          __Pyx_GIVEREF(__pyx_v_error);
+          PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_error);
+          __Pyx_INCREF(__pyx_v_close_watcher);
+          __Pyx_GIVEREF(__pyx_v_close_watcher);
+          PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_v_close_watcher);
+          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 63, __pyx_L1_error)
+          __Pyx_GOTREF(__pyx_t_2);
+          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+        }
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __pyx_r = __pyx_t_2;
+        __pyx_t_2 = 0;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        goto __pyx_L0;
+      }
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+      tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
+      if (unlikely(type_dict_guard != tp_dict_version)) {
+        tp_dict_version = obj_dict_version = 0;
+      }
+      #endif
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    }
+    #endif
+  }
+
+  /* "src/gevent/_hub_primitives.py":63
+ *             watcher.stop()
+ * 
+ *     def cancel_wait(self, watcher, error, close_watcher=False):             # <<<<<<<<<<<<<<
+ *         """
+ *         Cancel an in-progress call to :meth:`wait` by throwing the given *error*
+ */
+
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_6);
+  __Pyx_AddTraceback("gevent.__hub_primitives.WaitOperationsGreenlet.cancel_wait", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_16__hub_primitives_22WaitOperationsGreenlet_3cancel_wait(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_6gevent_16__hub_primitives_22WaitOperationsGreenlet_2cancel_wait[] = "WaitOperationsGreenlet.cancel_wait(self, watcher, error, close_watcher=False)\n\n        Cancel an in-progress call to :meth:`wait` by throwing the given *error*\n        in the waiting greenlet.\n\n        .. versionchanged:: 1.3a1\n           Added the *close_watcher* parameter. If true, the watcher\n           will be closed after the exception is thrown. The watcher should then\n           be discarded. Closing the watcher is important to release native resources.\n        .. versionchanged:: 1.3a2\n           Allow the *watcher* to be ``None``. No action is taken in that case.\n        ";
+static PyMethodDef __pyx_mdef_6gevent_16__hub_primitives_22WaitOperationsGreenlet_3cancel_wait = {"cancel_wait", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_16__hub_primitives_22WaitOperationsGreenlet_3cancel_wait, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_16__hub_primitives_22WaitOperationsGreenlet_2cancel_wait};
+static PyObject *__pyx_pw_6gevent_16__hub_primitives_22WaitOperationsGreenlet_3cancel_wait(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_watcher = 0;
+  PyObject *__pyx_v_error = 0;
+  PyObject *__pyx_v_close_watcher = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("cancel_wait (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_watcher,&__pyx_n_s_error,&__pyx_n_s_close_watcher,0};
+    PyObject* values[3] = {0,0,0};
+    values[2] = ((PyObject *)Py_False);
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_watcher)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_error)) != 0)) kw_args--;
+        else {
+          __Pyx_RaiseArgtupleInvalid("cancel_wait", 0, 2, 3, 1); __PYX_ERR(0, 63, __pyx_L3_error)
+        }
+        CYTHON_FALLTHROUGH;
+        case  2:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_close_watcher);
+          if (value) { values[2] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "cancel_wait") < 0)) __PYX_ERR(0, 63, __pyx_L3_error)
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    __pyx_v_watcher = values[0];
+    __pyx_v_error = values[1];
+    __pyx_v_close_watcher = values[2];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("cancel_wait", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 63, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.__hub_primitives.WaitOperationsGreenlet.cancel_wait", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_16__hub_primitives_22WaitOperationsGreenlet_2cancel_wait(((struct __pyx_obj_6gevent_16__hub_primitives_WaitOperationsGreenlet *)__pyx_v_self), __pyx_v_watcher, __pyx_v_error, __pyx_v_close_watcher);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_16__hub_primitives_22WaitOperationsGreenlet_2cancel_wait(struct __pyx_obj_6gevent_16__hub_primitives_WaitOperationsGreenlet *__pyx_v_self, PyObject *__pyx_v_watcher, PyObject *__pyx_v_error, PyObject *__pyx_v_close_watcher) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("cancel_wait", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_2.__pyx_n = 1;
+  __pyx_t_2.close_watcher = __pyx_v_close_watcher;
+  __pyx_t_1 = __pyx_vtabptr_6gevent_16__hub_primitives_WaitOperationsGreenlet->cancel_wait(__pyx_v_self, __pyx_v_watcher, __pyx_v_error, 1, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 63, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.__hub_primitives.WaitOperationsGreenlet.cancel_wait", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+  /* "src/gevent/_hub_primitives.py":63
+ *             watcher.stop()
+ * 
+ *     def cancel_wait(self, watcher, error, close_watcher=False):             # <<<<<<<<<<<<<<
+ *         """
+ *         Cancel an in-progress call to :meth:`wait` by throwing the given *error*
+ */
+  __pyx_tuple__11 = PyTuple_Pack(4, __pyx_n_s_self_2, __pyx_n_s_watcher, __pyx_n_s_error, __pyx_n_s_close_watcher); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 63, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__11);
+  __Pyx_GIVEREF(__pyx_tuple__11);
+
+  /* "src/gevent/_hub_primitives.py":63
+ *             watcher.stop()
+ * 
+ *     def cancel_wait(self, watcher, error, close_watcher=False):             # <<<<<<<<<<<<<<
+ *         """
+ *         Cancel an in-progress call to :meth:`wait` by throwing the given *error*
+ */
+  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_16__hub_primitives_22WaitOperationsGreenlet_3cancel_wait, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_WaitOperationsGreenlet_cancel_wa, NULL, __pyx_n_s_gevent___hub_primitives, __pyx_d, ((PyObject *)__pyx_codeobj__12)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 63, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_16__hub_primitives_WaitOperationsGreenlet->tp_dict, __pyx_n_s_cancel_wait, __pyx_t_1) < 0) __PYX_ERR(0, 63, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_16__hub_primitives_WaitOperationsGreenlet);
+  __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__11, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__hub_primitives_py, __pyx_n_s_cancel_wait, 63, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(0, 63, __pyx_L1_error)
+
 064:         """
+
 065:         Cancel an in-progress call to :meth:`wait` by throwing the given *error*
+
 066:         in the waiting greenlet.
+
 067: 
+
 068:         .. versionchanged:: 1.3a1
+
 069:            Added the *close_watcher* parameter. If true, the watcher
+
 070:            will be closed after the exception is thrown. The watcher should then
+
 071:            be discarded. Closing the watcher is important to release native resources.
+
 072:         .. versionchanged:: 1.3a2
+
 073:            Allow the *watcher* to be ``None``. No action is taken in that case.
+
 074:         """
+
+075:         if watcher is None:
+
  __pyx_t_7 = (__pyx_v_watcher == Py_None);
+  __pyx_t_8 = (__pyx_t_7 != 0);
+  if (__pyx_t_8) {
+/* … */
+  }
+
 076:             # Presumably already closed.
+
 077:             # See https://github.com/gevent/gevent/issues/1089
+
+078:             return
+
    __Pyx_XDECREF(__pyx_r);
+    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+    goto __pyx_L0;
+
+079:         if watcher.callback is not None:
+
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_watcher, __pyx_n_s_callback); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 79, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_8 = (__pyx_t_1 != Py_None);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_7 = (__pyx_t_8 != 0);
+  if (__pyx_t_7) {
+/* … */
+    goto __pyx_L4;
+  }
+
+080:             self.loop.run_callback(self._cancel_wait, watcher, error, close_watcher)
+
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->__pyx_base.loop, __pyx_n_s_run_callback); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 80, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_cancel_wait_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 80, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __pyx_t_6 = NULL;
+    __pyx_t_5 = 0;
+    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
+      if (likely(__pyx_t_6)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+        __Pyx_INCREF(__pyx_t_6);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_2, function);
+        __pyx_t_5 = 1;
+      }
+    }
+    #if CYTHON_FAST_PYCALL
+    if (PyFunction_Check(__pyx_t_2)) {
+      PyObject *__pyx_temp[5] = {__pyx_t_6, __pyx_t_3, __pyx_v_watcher, __pyx_v_error, __pyx_v_close_watcher};
+      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 4+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 80, __pyx_L1_error)
+      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+      __Pyx_GOTREF(__pyx_t_1);
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    } else
+    #endif
+    #if CYTHON_FAST_PYCCALL
+    if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
+      PyObject *__pyx_temp[5] = {__pyx_t_6, __pyx_t_3, __pyx_v_watcher, __pyx_v_error, __pyx_v_close_watcher};
+      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 4+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 80, __pyx_L1_error)
+      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+      __Pyx_GOTREF(__pyx_t_1);
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    } else
+    #endif
+    {
+      __pyx_t_4 = PyTuple_New(4+__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 80, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_4);
+      if (__pyx_t_6) {
+        __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6); __pyx_t_6 = NULL;
+      }
+      __Pyx_GIVEREF(__pyx_t_3);
+      PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_5, __pyx_t_3);
+      __Pyx_INCREF(__pyx_v_watcher);
+      __Pyx_GIVEREF(__pyx_v_watcher);
+      PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_5, __pyx_v_watcher);
+      __Pyx_INCREF(__pyx_v_error);
+      __Pyx_GIVEREF(__pyx_v_error);
+      PyTuple_SET_ITEM(__pyx_t_4, 2+__pyx_t_5, __pyx_v_error);
+      __Pyx_INCREF(__pyx_v_close_watcher);
+      __Pyx_GIVEREF(__pyx_v_close_watcher);
+      PyTuple_SET_ITEM(__pyx_t_4, 3+__pyx_t_5, __pyx_v_close_watcher);
+      __pyx_t_3 = 0;
+      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 80, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    }
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+081:         elif close_watcher:
+
  __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_close_watcher); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 81, __pyx_L1_error)
+  if (__pyx_t_7) {
+/* … */
+  }
+  __pyx_L4:;
+
+082:             watcher.close()
+
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_watcher, __pyx_n_s_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 82, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_4 = NULL;
+    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
+      if (likely(__pyx_t_4)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+        __Pyx_INCREF(__pyx_t_4);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_2, function);
+      }
+    }
+    __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
+    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 82, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 083: 
+
+084:     def _cancel_wait(self, watcher, error, close_watcher):
+
static PyObject *__pyx_pw_6gevent_16__hub_primitives_22WaitOperationsGreenlet_5_cancel_wait(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_f_6gevent_16__hub_primitives_22WaitOperationsGreenlet__cancel_wait(CYTHON_UNUSED struct __pyx_obj_6gevent_16__hub_primitives_WaitOperationsGreenlet *__pyx_v_self, PyObject *__pyx_v_watcher, PyObject *__pyx_v_error, PyObject *__pyx_v_close_watcher, int __pyx_skip_dispatch) {
+  PyObject *__pyx_v_active = NULL;
+  PyObject *__pyx_v_cb = NULL;
+  PyObject *__pyx_v_glet = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_cancel_wait", 0);
+  /* Check if called by wrapper */
+  if (unlikely(__pyx_skip_dispatch)) ;
+  /* Check if overridden in Python */
+  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
+    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
+    if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
+    else {
+      PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      #endif
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_cancel_wait_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 84, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_16__hub_primitives_22WaitOperationsGreenlet_5_cancel_wait)) {
+        __Pyx_XDECREF(__pyx_r);
+        __Pyx_INCREF(__pyx_t_1);
+        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
+        __pyx_t_5 = 0;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+          if (likely(__pyx_t_4)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+            __Pyx_INCREF(__pyx_t_4);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_3, function);
+            __pyx_t_5 = 1;
+          }
+        }
+        #if CYTHON_FAST_PYCALL
+        if (PyFunction_Check(__pyx_t_3)) {
+          PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_watcher, __pyx_v_error, __pyx_v_close_watcher};
+          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 84, __pyx_L1_error)
+          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+          __Pyx_GOTREF(__pyx_t_2);
+        } else
+        #endif
+        #if CYTHON_FAST_PYCCALL
+        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
+          PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_watcher, __pyx_v_error, __pyx_v_close_watcher};
+          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 84, __pyx_L1_error)
+          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+          __Pyx_GOTREF(__pyx_t_2);
+        } else
+        #endif
+        {
+          __pyx_t_6 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 84, __pyx_L1_error)
+          __Pyx_GOTREF(__pyx_t_6);
+          if (__pyx_t_4) {
+            __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
+          }
+          __Pyx_INCREF(__pyx_v_watcher);
+          __Pyx_GIVEREF(__pyx_v_watcher);
+          PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_watcher);
+          __Pyx_INCREF(__pyx_v_error);
+          __Pyx_GIVEREF(__pyx_v_error);
+          PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_error);
+          __Pyx_INCREF(__pyx_v_close_watcher);
+          __Pyx_GIVEREF(__pyx_v_close_watcher);
+          PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_v_close_watcher);
+          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 84, __pyx_L1_error)
+          __Pyx_GOTREF(__pyx_t_2);
+          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+        }
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __pyx_r = __pyx_t_2;
+        __pyx_t_2 = 0;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        goto __pyx_L0;
+      }
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+      tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
+      if (unlikely(type_dict_guard != tp_dict_version)) {
+        tp_dict_version = obj_dict_version = 0;
+      }
+      #endif
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    }
+    #endif
+  }
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_6);
+  __Pyx_AddTraceback("gevent.__hub_primitives.WaitOperationsGreenlet._cancel_wait", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_active);
+  __Pyx_XDECREF(__pyx_v_cb);
+  __Pyx_XDECREF(__pyx_v_glet);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_16__hub_primitives_22WaitOperationsGreenlet_5_cancel_wait(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_6gevent_16__hub_primitives_22WaitOperationsGreenlet_4_cancel_wait[] = "WaitOperationsGreenlet._cancel_wait(self, watcher, error, close_watcher)";
+static PyMethodDef __pyx_mdef_6gevent_16__hub_primitives_22WaitOperationsGreenlet_5_cancel_wait = {"_cancel_wait", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_16__hub_primitives_22WaitOperationsGreenlet_5_cancel_wait, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_16__hub_primitives_22WaitOperationsGreenlet_4_cancel_wait};
+static PyObject *__pyx_pw_6gevent_16__hub_primitives_22WaitOperationsGreenlet_5_cancel_wait(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_watcher = 0;
+  PyObject *__pyx_v_error = 0;
+  PyObject *__pyx_v_close_watcher = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_cancel_wait (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_watcher,&__pyx_n_s_error,&__pyx_n_s_close_watcher,0};
+    PyObject* values[3] = {0,0,0};
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_watcher)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_error)) != 0)) kw_args--;
+        else {
+          __Pyx_RaiseArgtupleInvalid("_cancel_wait", 1, 3, 3, 1); __PYX_ERR(0, 84, __pyx_L3_error)
+        }
+        CYTHON_FALLTHROUGH;
+        case  2:
+        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_close_watcher)) != 0)) kw_args--;
+        else {
+          __Pyx_RaiseArgtupleInvalid("_cancel_wait", 1, 3, 3, 2); __PYX_ERR(0, 84, __pyx_L3_error)
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_cancel_wait") < 0)) __PYX_ERR(0, 84, __pyx_L3_error)
+      }
+    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
+      goto __pyx_L5_argtuple_error;
+    } else {
+      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+    }
+    __pyx_v_watcher = values[0];
+    __pyx_v_error = values[1];
+    __pyx_v_close_watcher = values[2];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("_cancel_wait", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 84, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.__hub_primitives.WaitOperationsGreenlet._cancel_wait", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_16__hub_primitives_22WaitOperationsGreenlet_4_cancel_wait(((struct __pyx_obj_6gevent_16__hub_primitives_WaitOperationsGreenlet *)__pyx_v_self), __pyx_v_watcher, __pyx_v_error, __pyx_v_close_watcher);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_16__hub_primitives_22WaitOperationsGreenlet_4_cancel_wait(struct __pyx_obj_6gevent_16__hub_primitives_WaitOperationsGreenlet *__pyx_v_self, PyObject *__pyx_v_watcher, PyObject *__pyx_v_error, PyObject *__pyx_v_close_watcher) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_cancel_wait", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __pyx_f_6gevent_16__hub_primitives_22WaitOperationsGreenlet__cancel_wait(__pyx_v_self, __pyx_v_watcher, __pyx_v_error, __pyx_v_close_watcher, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 84, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.__hub_primitives.WaitOperationsGreenlet._cancel_wait", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__13 = PyTuple_Pack(4, __pyx_n_s_self_2, __pyx_n_s_watcher, __pyx_n_s_error, __pyx_n_s_close_watcher); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 84, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__13);
+  __Pyx_GIVEREF(__pyx_tuple__13);
+/* … */
+  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_16__hub_primitives_22WaitOperationsGreenlet_5_cancel_wait, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_WaitOperationsGreenlet__cancel_w, NULL, __pyx_n_s_gevent___hub_primitives, __pyx_d, ((PyObject *)__pyx_codeobj__14)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 84, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_16__hub_primitives_WaitOperationsGreenlet->tp_dict, __pyx_n_s_cancel_wait_2, __pyx_t_1) < 0) __PYX_ERR(0, 84, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_16__hub_primitives_WaitOperationsGreenlet);
+  __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__13, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__hub_primitives_py, __pyx_n_s_cancel_wait_2, 84, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__14)) __PYX_ERR(0, 84, __pyx_L1_error)
+
 085:         # We have to check again to see if it was still active by the time
+
 086:         # our callback actually runs.
+
+087:         active = watcher.active
+
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_watcher, __pyx_n_s_active); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 87, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_v_active = __pyx_t_1;
+  __pyx_t_1 = 0;
+
+088:         cb = watcher.callback
+
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_watcher, __pyx_n_s_callback); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 88, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_v_cb = __pyx_t_1;
+  __pyx_t_1 = 0;
+
+089:         if close_watcher:
+
  __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_close_watcher); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 89, __pyx_L1_error)
+  if (__pyx_t_7) {
+/* … */
+  }
+
+090:             watcher.close()
+
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_watcher, __pyx_n_s_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 90, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_3 = NULL;
+    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+      if (likely(__pyx_t_3)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+        __Pyx_INCREF(__pyx_t_3);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_2, function);
+      }
+    }
+    __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
+    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 90, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+091:         if active:
+
  __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_active); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 91, __pyx_L1_error)
+  if (__pyx_t_7) {
+/* … */
+  }
+
 092:             # The callback should be greenlet.switch(). It may or may not be None.
+
+093:             glet = getattr(cb, '__self__', None)
+
    __pyx_t_1 = __Pyx_GetAttr3(__pyx_v_cb, __pyx_n_s_self, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 93, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __pyx_v_glet = __pyx_t_1;
+    __pyx_t_1 = 0;
+
+094:             if glet is not None:
+
    __pyx_t_7 = (__pyx_v_glet != Py_None);
+    __pyx_t_8 = (__pyx_t_7 != 0);
+    if (__pyx_t_8) {
+/* … */
+    }
+
+095:                 glet.throw(error)
+
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_glet, __pyx_n_s_throw); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 95, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_2);
+      __pyx_t_3 = NULL;
+      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+        if (likely(__pyx_t_3)) {
+          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+          __Pyx_INCREF(__pyx_t_3);
+          __Pyx_INCREF(function);
+          __Pyx_DECREF_SET(__pyx_t_2, function);
+        }
+      }
+      __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_error) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_error);
+      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 95, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 096: 
+
 097: 
+
+098: class _WaitIterator(object):
+
struct __pyx_vtabstruct_6gevent_16__hub_primitives__WaitIterator {
+  PyObject *(*_begin)(struct __pyx_obj_6gevent_16__hub_primitives__WaitIterator *);
+  PyObject *(*_cleanup)(struct __pyx_obj_6gevent_16__hub_primitives__WaitIterator *);
+  PyObject *(*__pyx___enter__)(struct __pyx_obj_6gevent_16__hub_primitives__WaitIterator *, int __pyx_skip_dispatch);
+  PyObject *(*__pyx___exit__)(struct __pyx_obj_6gevent_16__hub_primitives__WaitIterator *, PyObject *, PyObject *, PyObject *, int __pyx_skip_dispatch);
+};
+static struct __pyx_vtabstruct_6gevent_16__hub_primitives__WaitIterator *__pyx_vtabptr_6gevent_16__hub_primitives__WaitIterator;
+
 099: 
+
+100:     def __init__(self, objects, hub, timeout, count):
+
/* Python wrapper */
+static int __pyx_pw_6gevent_16__hub_primitives_13_WaitIterator_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static int __pyx_pw_6gevent_16__hub_primitives_13_WaitIterator_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_objects = 0;
+  PyObject *__pyx_v_hub = 0;
+  PyObject *__pyx_v_timeout = 0;
+  PyObject *__pyx_v_count = 0;
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_objects,&__pyx_n_s_hub,&__pyx_n_s_timeout,&__pyx_n_s_count,0};
+    PyObject* values[4] = {0,0,0,0};
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
+        CYTHON_FALLTHROUGH;
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_objects)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_hub)) != 0)) kw_args--;
+        else {
+          __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, 1); __PYX_ERR(0, 100, __pyx_L3_error)
+        }
+        CYTHON_FALLTHROUGH;
+        case  2:
+        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_timeout)) != 0)) kw_args--;
+        else {
+          __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, 2); __PYX_ERR(0, 100, __pyx_L3_error)
+        }
+        CYTHON_FALLTHROUGH;
+        case  3:
+        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_count)) != 0)) kw_args--;
+        else {
+          __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, 3); __PYX_ERR(0, 100, __pyx_L3_error)
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 100, __pyx_L3_error)
+      }
+    } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
+      goto __pyx_L5_argtuple_error;
+    } else {
+      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
+    }
+    __pyx_v_objects = values[0];
+    __pyx_v_hub = values[1];
+    __pyx_v_timeout = values[2];
+    __pyx_v_count = values[3];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 100, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.__hub_primitives._WaitIterator.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return -1;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_16__hub_primitives_13_WaitIterator___init__(((struct __pyx_obj_6gevent_16__hub_primitives__WaitIterator *)__pyx_v_self), __pyx_v_objects, __pyx_v_hub, __pyx_v_timeout, __pyx_v_count);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_16__hub_primitives_13_WaitIterator___init__(struct __pyx_obj_6gevent_16__hub_primitives__WaitIterator *__pyx_v_self, PyObject *__pyx_v_objects, PyObject *__pyx_v_hub, PyObject *__pyx_v_timeout, PyObject *__pyx_v_count) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = 0;
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_XDECREF(__pyx_t_6);
+  __Pyx_XDECREF(__pyx_t_7);
+  __Pyx_AddTraceback("gevent.__hub_primitives._WaitIterator.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = -1;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+101:         self._hub = hub
+
  if (!(likely(((__pyx_v_hub) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_hub, __pyx_ptype_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop))))) __PYX_ERR(0, 101, __pyx_L1_error)
+  __pyx_t_1 = __pyx_v_hub;
+  __Pyx_INCREF(__pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_1);
+  __Pyx_GOTREF(__pyx_v_self->_hub);
+  __Pyx_DECREF(((PyObject *)__pyx_v_self->_hub));
+  __pyx_v_self->_hub = ((struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *)__pyx_t_1);
+  __pyx_t_1 = 0;
+
+102:         self._waiter = MultipleWaiter(hub) # pylint:disable=undefined-variable
+
  __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_6gevent_8__waiter_MultipleWaiter), __pyx_v_hub); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 102, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_1);
+  __Pyx_GOTREF(__pyx_v_self->_waiter);
+  __Pyx_DECREF(((PyObject *)__pyx_v_self->_waiter));
+  __pyx_v_self->_waiter = ((struct __pyx_obj_6gevent_8__waiter_MultipleWaiter *)__pyx_t_1);
+  __pyx_t_1 = 0;
+
+103:         self._switch = self._waiter.switch
+
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->_waiter), __pyx_n_s_switch); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 103, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_1);
+  __Pyx_GOTREF(__pyx_v_self->_switch);
+  __Pyx_DECREF(__pyx_v_self->_switch);
+  __pyx_v_self->_switch = __pyx_t_1;
+  __pyx_t_1 = 0;
+
+104:         self._timeout = timeout
+
  __Pyx_INCREF(__pyx_v_timeout);
+  __Pyx_GIVEREF(__pyx_v_timeout);
+  __Pyx_GOTREF(__pyx_v_self->_timeout);
+  __Pyx_DECREF(__pyx_v_self->_timeout);
+  __pyx_v_self->_timeout = __pyx_v_timeout;
+
+105:         self._objects = objects
+
  __Pyx_INCREF(__pyx_v_objects);
+  __Pyx_GIVEREF(__pyx_v_objects);
+  __Pyx_GOTREF(__pyx_v_self->_objects);
+  __Pyx_DECREF(__pyx_v_self->_objects);
+  __pyx_v_self->_objects = __pyx_v_objects;
+
 106: 
+
+107:         self._timer = None
+
  __Pyx_INCREF(Py_None);
+  __Pyx_GIVEREF(Py_None);
+  __Pyx_GOTREF(__pyx_v_self->_timer);
+  __Pyx_DECREF(__pyx_v_self->_timer);
+  __pyx_v_self->_timer = Py_None;
+
+108:         self._begun = False
+
  __pyx_v_self->_begun = 0;
+
 109: 
+
 110:         # Even if we're only going to return 1 object,
+
 111:         # we must still rawlink() *all* of them, so that no
+
 112:         # matter which one finishes first we find it.
+
+113:         self._count = len(objects) if count is None else min(count, len(objects))
+
  __pyx_t_3 = (__pyx_v_count == Py_None);
+  if ((__pyx_t_3 != 0)) {
+    __pyx_t_4 = PyObject_Length(__pyx_v_objects); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 113, __pyx_L1_error)
+    __pyx_t_2 = __pyx_t_4;
+  } else {
+    __pyx_t_4 = PyObject_Length(__pyx_v_objects); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 113, __pyx_L1_error)
+    __Pyx_INCREF(__pyx_v_count);
+    __pyx_t_1 = __pyx_v_count;
+    __pyx_t_6 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 113, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_6);
+    __pyx_t_7 = PyObject_RichCompare(__pyx_t_6, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 113, __pyx_L1_error)
+    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+    __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 113, __pyx_L1_error)
+    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+    if (__pyx_t_8) {
+      __pyx_t_7 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 113, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_7);
+      __pyx_t_5 = __pyx_t_7;
+      __pyx_t_7 = 0;
+    } else {
+      __Pyx_INCREF(__pyx_t_1);
+      __pyx_t_5 = __pyx_t_1;
+    }
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __pyx_t_4 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_4 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 113, __pyx_L1_error)
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __pyx_t_2 = __pyx_t_4;
+  }
+  __pyx_v_self->_count = __pyx_t_2;
+
 114: 
+
+115:     def _begin(self):
+
static PyObject *__pyx_f_6gevent_16__hub_primitives_13_WaitIterator__begin(struct __pyx_obj_6gevent_16__hub_primitives__WaitIterator *__pyx_v_self) {
+  PyObject *__pyx_v_obj = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_begin", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_XDECREF(__pyx_t_6);
+  __Pyx_XDECREF(__pyx_t_7);
+  __Pyx_AddTraceback("gevent.__hub_primitives._WaitIterator._begin", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_obj);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+116:         if self._begun:
+
  __pyx_t_1 = (__pyx_v_self->_begun != 0);
+  if (__pyx_t_1) {
+/* … */
+  }
+
+117:             return
+
    __Pyx_XDECREF(__pyx_r);
+    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+    goto __pyx_L0;
+
 118: 
+
+119:         self._begun = True
+
  __pyx_v_self->_begun = 1;
+
 120: 
+
 121:         # XXX: If iteration doesn't actually happen, we
+
 122:         # could leave these links around!
+
+123:         for obj in self._objects:
+
  if (likely(PyList_CheckExact(__pyx_v_self->_objects)) || PyTuple_CheckExact(__pyx_v_self->_objects)) {
+    __pyx_t_2 = __pyx_v_self->_objects; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
+    __pyx_t_4 = NULL;
+  } else {
+    __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_self->_objects); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 123, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 123, __pyx_L1_error)
+  }
+  for (;;) {
+    if (likely(!__pyx_t_4)) {
+      if (likely(PyList_CheckExact(__pyx_t_2))) {
+        if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
+        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+        __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 123, __pyx_L1_error)
+        #else
+        __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 123, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_5);
+        #endif
+      } else {
+        if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
+        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+        __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 123, __pyx_L1_error)
+        #else
+        __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 123, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_5);
+        #endif
+      }
+    } else {
+      __pyx_t_5 = __pyx_t_4(__pyx_t_2);
+      if (unlikely(!__pyx_t_5)) {
+        PyObject* exc_type = PyErr_Occurred();
+        if (exc_type) {
+          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+          else __PYX_ERR(0, 123, __pyx_L1_error)
+        }
+        break;
+      }
+      __Pyx_GOTREF(__pyx_t_5);
+    }
+    __Pyx_XDECREF_SET(__pyx_v_obj, __pyx_t_5);
+    __pyx_t_5 = 0;
+/* … */
+  }
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+124:             obj.rawlink(self._switch)
+
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_rawlink); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 124, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_6);
+    __pyx_t_7 = NULL;
+    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
+      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
+      if (likely(__pyx_t_7)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
+        __Pyx_INCREF(__pyx_t_7);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_6, function);
+      }
+    }
+    __pyx_t_5 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_v_self->_switch) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_self->_switch);
+    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+    if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 124, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_5);
+    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+
 125: 
+
+126:         if self._timeout is not None:
+
  __pyx_t_1 = (__pyx_v_self->_timeout != Py_None);
+  __pyx_t_8 = (__pyx_t_1 != 0);
+  if (__pyx_t_8) {
+/* … */
+  }
+
+127:             self._timer = self._hub.loop.timer(self._timeout, priority=-1)
+
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_hub->loop, __pyx_n_s_timer); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 127, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 127, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_5);
+    __Pyx_INCREF(__pyx_v_self->_timeout);
+    __Pyx_GIVEREF(__pyx_v_self->_timeout);
+    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_self->_timeout);
+    __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 127, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_6);
+    if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_priority, __pyx_int_neg_1) < 0) __PYX_ERR(0, 127, __pyx_L1_error)
+    __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 127, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_7);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+    __Pyx_GIVEREF(__pyx_t_7);
+    __Pyx_GOTREF(__pyx_v_self->_timer);
+    __Pyx_DECREF(__pyx_v_self->_timer);
+    __pyx_v_self->_timer = __pyx_t_7;
+    __pyx_t_7 = 0;
+
+128:             self._timer.start(self._switch, self)
+
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_timer, __pyx_n_s_start); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 128, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_6);
+    __pyx_t_5 = NULL;
+    __pyx_t_9 = 0;
+    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
+      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
+      if (likely(__pyx_t_5)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
+        __Pyx_INCREF(__pyx_t_5);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_6, function);
+        __pyx_t_9 = 1;
+      }
+    }
+    #if CYTHON_FAST_PYCALL
+    if (PyFunction_Check(__pyx_t_6)) {
+      PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_self->_switch, ((PyObject *)__pyx_v_self)};
+      __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 128, __pyx_L1_error)
+      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+      __Pyx_GOTREF(__pyx_t_7);
+    } else
+    #endif
+    #if CYTHON_FAST_PYCCALL
+    if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
+      PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_self->_switch, ((PyObject *)__pyx_v_self)};
+      __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 128, __pyx_L1_error)
+      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+      __Pyx_GOTREF(__pyx_t_7);
+    } else
+    #endif
+    {
+      __pyx_t_2 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 128, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_2);
+      if (__pyx_t_5) {
+        __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5); __pyx_t_5 = NULL;
+      }
+      __Pyx_INCREF(__pyx_v_self->_switch);
+      __Pyx_GIVEREF(__pyx_v_self->_switch);
+      PyTuple_SET_ITEM(__pyx_t_2, 0+__pyx_t_9, __pyx_v_self->_switch);
+      __Pyx_INCREF(((PyObject *)__pyx_v_self));
+      __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
+      PyTuple_SET_ITEM(__pyx_t_2, 1+__pyx_t_9, ((PyObject *)__pyx_v_self));
+      __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_2, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 128, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_7);
+      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    }
+    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+
 129: 
+
+130:     def __iter__(self):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_16__hub_primitives_13_WaitIterator_3__iter__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_16__hub_primitives_13_WaitIterator_3__iter__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_16__hub_primitives_13_WaitIterator_2__iter__(((struct __pyx_obj_6gevent_16__hub_primitives__WaitIterator *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_16__hub_primitives_13_WaitIterator_2__iter__(struct __pyx_obj_6gevent_16__hub_primitives__WaitIterator *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__iter__", 0);
+/* … */
+  /* function exit code */
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+131:         return self
+
  __Pyx_XDECREF(__pyx_r);
+  __Pyx_INCREF(((PyObject *)__pyx_v_self));
+  __pyx_r = ((PyObject *)__pyx_v_self);
+  goto __pyx_L0;
+
 132: 
+
+133:     def __next__(self):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_16__hub_primitives_13_WaitIterator_5__next__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_16__hub_primitives_13_WaitIterator_5__next__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__next__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_16__hub_primitives_13_WaitIterator_4__next__(((struct __pyx_obj_6gevent_16__hub_primitives__WaitIterator *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_16__hub_primitives_13_WaitIterator_4__next__(struct __pyx_obj_6gevent_16__hub_primitives__WaitIterator *__pyx_v_self) {
+  PyObject *__pyx_v_item = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__next__", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_7);
+  __Pyx_XDECREF(__pyx_t_8);
+  __Pyx_XDECREF(__pyx_t_9);
+  __Pyx_AddTraceback("gevent.__hub_primitives._WaitIterator.__next__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_item);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+134:         self._begin()
+
  __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_16__hub_primitives__WaitIterator *)__pyx_v_self->__pyx_vtab)->_begin(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 134, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 135: 
+
+136:         if self._count == 0:
+
  __pyx_t_2 = ((__pyx_v_self->_count == 0) != 0);
+  if (unlikely(__pyx_t_2)) {
+/* … */
+  }
+
 137:             # Exhausted
+
+138:             self._cleanup()
+
    __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_16__hub_primitives__WaitIterator *)__pyx_v_self->__pyx_vtab)->_cleanup(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 138, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+139:             raise StopIteration()
+
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_builtin_StopIteration); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 139, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __PYX_ERR(0, 139, __pyx_L1_error)
+
 140: 
+
+141:         self._count -= 1
+
  __pyx_v_self->_count = (__pyx_v_self->_count - 1);
+
+142:         try:
+
  {
+    /*try:*/ {
+/* … */
+    }
+    __pyx_L4_error:;
+    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+/* … */
+    __Pyx_XGIVEREF(__pyx_t_3);
+    __Pyx_XGIVEREF(__pyx_t_4);
+    __Pyx_XGIVEREF(__pyx_t_5);
+    __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
+    goto __pyx_L1_error;
+    __pyx_L8_try_return:;
+    __Pyx_XGIVEREF(__pyx_t_3);
+    __Pyx_XGIVEREF(__pyx_t_4);
+    __Pyx_XGIVEREF(__pyx_t_5);
+    __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
+    goto __pyx_L0;
+  }
+
+143:             item = self._waiter.get()
+
      __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_8__waiter_MultipleWaiter *)__pyx_v_self->_waiter->__pyx_base.__pyx_vtab)->__pyx_base.get(((struct __pyx_obj_6gevent_8__waiter_Waiter *)__pyx_v_self->_waiter), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 143, __pyx_L4_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      __pyx_v_item = __pyx_t_1;
+      __pyx_t_1 = 0;
+
+144:             self._waiter.clear()
+
      __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_8__waiter_MultipleWaiter *)__pyx_v_self->_waiter->__pyx_base.__pyx_vtab)->__pyx_base.clear(((struct __pyx_obj_6gevent_8__waiter_Waiter *)__pyx_v_self->_waiter), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 144, __pyx_L4_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+145:             if item is self:
+
      __pyx_t_2 = (__pyx_v_item == ((PyObject *)__pyx_v_self));
+      __pyx_t_6 = (__pyx_t_2 != 0);
+      if (unlikely(__pyx_t_6)) {
+/* … */
+      }
+
 146:                 # Timer expired, no more
+
+147:                 self._cleanup()
+
        __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_16__hub_primitives__WaitIterator *)__pyx_v_self->__pyx_vtab)->_cleanup(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 147, __pyx_L4_error)
+        __Pyx_GOTREF(__pyx_t_1);
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+148:                 raise StopIteration()
+
        __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_builtin_StopIteration); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 148, __pyx_L4_error)
+        __Pyx_GOTREF(__pyx_t_1);
+        __Pyx_Raise(__pyx_t_1, 0, 0, 0);
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        __PYX_ERR(0, 148, __pyx_L4_error)
+
+149:             return item
+
      __Pyx_XDECREF(__pyx_r);
+      __Pyx_INCREF(__pyx_v_item);
+      __pyx_r = __pyx_v_item;
+      goto __pyx_L8_try_return;
+
+150:         except:
+
    /*except:*/ {
+      __Pyx_AddTraceback("gevent.__hub_primitives._WaitIterator.__next__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+      if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(0, 150, __pyx_L6_except_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      __Pyx_GOTREF(__pyx_t_7);
+      __Pyx_GOTREF(__pyx_t_8);
+
+151:             self._cleanup()
+
      __pyx_t_9 = ((struct __pyx_vtabstruct_6gevent_16__hub_primitives__WaitIterator *)__pyx_v_self->__pyx_vtab)->_cleanup(__pyx_v_self); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 151, __pyx_L6_except_error)
+      __Pyx_GOTREF(__pyx_t_9);
+      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+
+152:             raise
+
      __Pyx_GIVEREF(__pyx_t_1);
+      __Pyx_GIVEREF(__pyx_t_7);
+      __Pyx_XGIVEREF(__pyx_t_8);
+      __Pyx_ErrRestoreWithState(__pyx_t_1, __pyx_t_7, __pyx_t_8);
+      __pyx_t_1 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; 
+      __PYX_ERR(0, 152, __pyx_L6_except_error)
+    }
+    __pyx_L6_except_error:;
+
 153: 
+
+154:     next = __next__
+
  __Pyx_GetNameInClass(__pyx_t_1, (PyObject *)__pyx_ptype_6gevent_16__hub_primitives__WaitIterator, __pyx_n_s_next); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 154, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_16__hub_primitives__WaitIterator->tp_dict, __pyx_n_s_next_2, __pyx_t_1) < 0) __PYX_ERR(0, 154, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_16__hub_primitives__WaitIterator);
+
 155: 
+
+156:     def _cleanup(self):
+
static PyObject *__pyx_f_6gevent_16__hub_primitives_13_WaitIterator__cleanup(struct __pyx_obj_6gevent_16__hub_primitives__WaitIterator *__pyx_v_self) {
+  PyObject *__pyx_v_objs = NULL;
+  PyObject *__pyx_v_aobj = NULL;
+  PyObject *__pyx_v_unlink = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_cleanup", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_XDECREF(__pyx_t_11);
+  __Pyx_XDECREF(__pyx_t_12);
+  __Pyx_XDECREF(__pyx_t_13);
+  __Pyx_XDECREF(__pyx_t_14);
+  __Pyx_AddTraceback("gevent.__hub_primitives._WaitIterator._cleanup", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_objs);
+  __Pyx_XDECREF(__pyx_v_aobj);
+  __Pyx_XDECREF(__pyx_v_unlink);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+157:         if self._timer is not None:
+
  __pyx_t_1 = (__pyx_v_self->_timer != Py_None);
+  __pyx_t_2 = (__pyx_t_1 != 0);
+  if (__pyx_t_2) {
+/* … */
+  }
+
+158:             self._timer.close()
+
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_timer, __pyx_n_s_close); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 158, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    __pyx_t_5 = NULL;
+    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
+      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
+      if (likely(__pyx_t_5)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
+        __Pyx_INCREF(__pyx_t_5);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_4, function);
+      }
+    }
+    __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
+    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 158, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+
+159:             self._timer = None
+
    __Pyx_INCREF(Py_None);
+    __Pyx_GIVEREF(Py_None);
+    __Pyx_GOTREF(__pyx_v_self->_timer);
+    __Pyx_DECREF(__pyx_v_self->_timer);
+    __pyx_v_self->_timer = Py_None;
+
 160: 
+
+161:         objs = self._objects
+
  __pyx_t_3 = __pyx_v_self->_objects;
+  __Pyx_INCREF(__pyx_t_3);
+  __pyx_v_objs = __pyx_t_3;
+  __pyx_t_3 = 0;
+
+162:         self._objects = ()
+
  __Pyx_INCREF(__pyx_empty_tuple);
+  __Pyx_GIVEREF(__pyx_empty_tuple);
+  __Pyx_GOTREF(__pyx_v_self->_objects);
+  __Pyx_DECREF(__pyx_v_self->_objects);
+  __pyx_v_self->_objects = __pyx_empty_tuple;
+
+163:         for aobj in objs:
+
  if (likely(PyList_CheckExact(__pyx_v_objs)) || PyTuple_CheckExact(__pyx_v_objs)) {
+    __pyx_t_3 = __pyx_v_objs; __Pyx_INCREF(__pyx_t_3); __pyx_t_6 = 0;
+    __pyx_t_7 = NULL;
+  } else {
+    __pyx_t_6 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_objs); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 163, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __pyx_t_7 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 163, __pyx_L1_error)
+  }
+  for (;;) {
+    if (likely(!__pyx_t_7)) {
+      if (likely(PyList_CheckExact(__pyx_t_3))) {
+        if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_3)) break;
+        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_4); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 163, __pyx_L1_error)
+        #else
+        __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 163, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_4);
+        #endif
+      } else {
+        if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
+        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_4); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 163, __pyx_L1_error)
+        #else
+        __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 163, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_4);
+        #endif
+      }
+    } else {
+      __pyx_t_4 = __pyx_t_7(__pyx_t_3);
+      if (unlikely(!__pyx_t_4)) {
+        PyObject* exc_type = PyErr_Occurred();
+        if (exc_type) {
+          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+          else __PYX_ERR(0, 163, __pyx_L1_error)
+        }
+        break;
+      }
+      __Pyx_GOTREF(__pyx_t_4);
+    }
+    __Pyx_XDECREF_SET(__pyx_v_aobj, __pyx_t_4);
+    __pyx_t_4 = 0;
+/* … */
+  }
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+
+164:             unlink = getattr(aobj, 'unlink', None)
+
    __pyx_t_4 = __Pyx_GetAttr3(__pyx_v_aobj, __pyx_n_s_unlink, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 164, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_XDECREF_SET(__pyx_v_unlink, __pyx_t_4);
+    __pyx_t_4 = 0;
+
+165:             if unlink is not None:
+
    __pyx_t_2 = (__pyx_v_unlink != Py_None);
+    __pyx_t_1 = (__pyx_t_2 != 0);
+    if (__pyx_t_1) {
+/* … */
+    }
+
+166:                 try:
+
      {
+        /*try:*/ {
+/* … */
+        }
+        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
+        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
+        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
+        goto __pyx_L14_try_end;
+        __pyx_L7_error:;
+        __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
+        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+/* … */
+        __Pyx_XGIVEREF(__pyx_t_8);
+        __Pyx_XGIVEREF(__pyx_t_9);
+        __Pyx_XGIVEREF(__pyx_t_10);
+        __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
+        goto __pyx_L1_error;
+        __pyx_L8_exception_handled:;
+        __Pyx_XGIVEREF(__pyx_t_8);
+        __Pyx_XGIVEREF(__pyx_t_9);
+        __Pyx_XGIVEREF(__pyx_t_10);
+        __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
+        __pyx_L14_try_end:;
+      }
+
+167:                     unlink(self._switch)
+
          __Pyx_INCREF(__pyx_v_unlink);
+          __pyx_t_5 = __pyx_v_unlink; __pyx_t_11 = NULL;
+          if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
+            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_5);
+            if (likely(__pyx_t_11)) {
+              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
+              __Pyx_INCREF(__pyx_t_11);
+              __Pyx_INCREF(function);
+              __Pyx_DECREF_SET(__pyx_t_5, function);
+            }
+          }
+          __pyx_t_4 = (__pyx_t_11) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_11, __pyx_v_self->_switch) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_self->_switch);
+          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
+          if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 167, __pyx_L7_error)
+          __Pyx_GOTREF(__pyx_t_4);
+          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+
+168:                 except: # pylint:disable=bare-except
+
        /*except:*/ {
+          __Pyx_AddTraceback("gevent.__hub_primitives._WaitIterator._cleanup", __pyx_clineno, __pyx_lineno, __pyx_filename);
+          if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_5, &__pyx_t_11) < 0) __PYX_ERR(0, 168, __pyx_L9_except_error)
+          __Pyx_GOTREF(__pyx_t_4);
+          __Pyx_GOTREF(__pyx_t_5);
+          __Pyx_GOTREF(__pyx_t_11);
+
+169:                     traceback.print_exc()
+
          __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_6gevent_16__hub_primitives_traceback, __pyx_n_s_print_exc); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 169, __pyx_L9_except_error)
+          __Pyx_GOTREF(__pyx_t_13);
+          __pyx_t_14 = NULL;
+          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_13))) {
+            __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_13);
+            if (likely(__pyx_t_14)) {
+              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13);
+              __Pyx_INCREF(__pyx_t_14);
+              __Pyx_INCREF(function);
+              __Pyx_DECREF_SET(__pyx_t_13, function);
+            }
+          }
+          __pyx_t_12 = (__pyx_t_14) ? __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_t_14) : __Pyx_PyObject_CallNoArg(__pyx_t_13);
+          __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
+          if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 169, __pyx_L9_except_error)
+          __Pyx_GOTREF(__pyx_t_12);
+          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
+          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
+          goto __pyx_L8_exception_handled;
+        }
+        __pyx_L9_except_error:;
+
 170: 
+
+171:     def __enter__(self):
+
static PyObject *__pyx_pw_6gevent_16__hub_primitives_13_WaitIterator_7__enter__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyObject *__pyx_f_6gevent_16__hub_primitives_13_WaitIterator___enter__(struct __pyx_obj_6gevent_16__hub_primitives__WaitIterator *__pyx_v_self, int __pyx_skip_dispatch) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__enter__", 0);
+  /* Check if called by wrapper */
+  if (unlikely(__pyx_skip_dispatch)) ;
+  /* Check if overridden in Python */
+  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
+    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
+    if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
+    else {
+      PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      #endif
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_enter); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 171, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_16__hub_primitives_13_WaitIterator_7__enter__)) {
+        __Pyx_XDECREF(__pyx_r);
+        __Pyx_INCREF(__pyx_t_1);
+        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+          if (likely(__pyx_t_4)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+            __Pyx_INCREF(__pyx_t_4);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_3, function);
+          }
+        }
+        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
+        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 171, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __pyx_r = __pyx_t_2;
+        __pyx_t_2 = 0;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        goto __pyx_L0;
+      }
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+      tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
+      if (unlikely(type_dict_guard != tp_dict_version)) {
+        tp_dict_version = obj_dict_version = 0;
+      }
+      #endif
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    }
+    #endif
+  }
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_AddTraceback("gevent.__hub_primitives._WaitIterator.__enter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_16__hub_primitives_13_WaitIterator_7__enter__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6gevent_16__hub_primitives_13_WaitIterator_6__enter__[] = "_WaitIterator.__enter__(self)";
+static PyMethodDef __pyx_mdef_6gevent_16__hub_primitives_13_WaitIterator_7__enter__ = {"__enter__", (PyCFunction)__pyx_pw_6gevent_16__hub_primitives_13_WaitIterator_7__enter__, METH_NOARGS, __pyx_doc_6gevent_16__hub_primitives_13_WaitIterator_6__enter__};
+static PyObject *__pyx_pw_6gevent_16__hub_primitives_13_WaitIterator_7__enter__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__enter__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_16__hub_primitives_13_WaitIterator_6__enter__(((struct __pyx_obj_6gevent_16__hub_primitives__WaitIterator *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_16__hub_primitives_13_WaitIterator_6__enter__(struct __pyx_obj_6gevent_16__hub_primitives__WaitIterator *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__enter__", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __pyx_f_6gevent_16__hub_primitives_13_WaitIterator___enter__(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 171, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.__hub_primitives._WaitIterator.__enter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__15 = PyTuple_Pack(1, __pyx_n_s_self_2); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(0, 171, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__15);
+  __Pyx_GIVEREF(__pyx_tuple__15);
+/* … */
+  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_16__hub_primitives_13_WaitIterator_7__enter__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_WaitIterator___enter, NULL, __pyx_n_s_gevent___hub_primitives, __pyx_d, ((PyObject *)__pyx_codeobj__16)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 171, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_16__hub_primitives__WaitIterator->tp_dict, __pyx_n_s_enter, __pyx_t_1) < 0) __PYX_ERR(0, 171, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_16__hub_primitives__WaitIterator);
+  __pyx_codeobj__16 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__15, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__hub_primitives_py, __pyx_n_s_enter, 171, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__16)) __PYX_ERR(0, 171, __pyx_L1_error)
+
+172:         return self
+
  __Pyx_XDECREF(__pyx_r);
+  __Pyx_INCREF(((PyObject *)__pyx_v_self));
+  __pyx_r = ((PyObject *)__pyx_v_self);
+  goto __pyx_L0;
+
 173: 
+
+174:     def __exit__(self, typ, value, tb):
+
static PyObject *__pyx_pw_6gevent_16__hub_primitives_13_WaitIterator_9__exit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_f_6gevent_16__hub_primitives_13_WaitIterator___exit__(struct __pyx_obj_6gevent_16__hub_primitives__WaitIterator *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_typ, CYTHON_UNUSED PyObject *__pyx_v_value, CYTHON_UNUSED PyObject *__pyx_v_tb, int __pyx_skip_dispatch) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__exit__", 0);
+  /* Check if called by wrapper */
+  if (unlikely(__pyx_skip_dispatch)) ;
+  /* Check if overridden in Python */
+  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
+    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
+    if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
+    else {
+      PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      #endif
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_exit); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 174, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_16__hub_primitives_13_WaitIterator_9__exit__)) {
+        __Pyx_XDECREF(__pyx_r);
+        __Pyx_INCREF(__pyx_t_1);
+        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
+        __pyx_t_5 = 0;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+          if (likely(__pyx_t_4)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+            __Pyx_INCREF(__pyx_t_4);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_3, function);
+            __pyx_t_5 = 1;
+          }
+        }
+        #if CYTHON_FAST_PYCALL
+        if (PyFunction_Check(__pyx_t_3)) {
+          PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_typ, __pyx_v_value, __pyx_v_tb};
+          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 174, __pyx_L1_error)
+          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+          __Pyx_GOTREF(__pyx_t_2);
+        } else
+        #endif
+        #if CYTHON_FAST_PYCCALL
+        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
+          PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_typ, __pyx_v_value, __pyx_v_tb};
+          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 174, __pyx_L1_error)
+          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+          __Pyx_GOTREF(__pyx_t_2);
+        } else
+        #endif
+        {
+          __pyx_t_6 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 174, __pyx_L1_error)
+          __Pyx_GOTREF(__pyx_t_6);
+          if (__pyx_t_4) {
+            __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
+          }
+          __Pyx_INCREF(__pyx_v_typ);
+          __Pyx_GIVEREF(__pyx_v_typ);
+          PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_typ);
+          __Pyx_INCREF(__pyx_v_value);
+          __Pyx_GIVEREF(__pyx_v_value);
+          PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_value);
+          __Pyx_INCREF(__pyx_v_tb);
+          __Pyx_GIVEREF(__pyx_v_tb);
+          PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_v_tb);
+          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 174, __pyx_L1_error)
+          __Pyx_GOTREF(__pyx_t_2);
+          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+        }
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __pyx_r = __pyx_t_2;
+        __pyx_t_2 = 0;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        goto __pyx_L0;
+      }
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+      tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
+      if (unlikely(type_dict_guard != tp_dict_version)) {
+        tp_dict_version = obj_dict_version = 0;
+      }
+      #endif
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    }
+    #endif
+  }
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_6);
+  __Pyx_AddTraceback("gevent.__hub_primitives._WaitIterator.__exit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_16__hub_primitives_13_WaitIterator_9__exit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_6gevent_16__hub_primitives_13_WaitIterator_8__exit__[] = "_WaitIterator.__exit__(self, typ, value, tb)";
+static PyMethodDef __pyx_mdef_6gevent_16__hub_primitives_13_WaitIterator_9__exit__ = {"__exit__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_16__hub_primitives_13_WaitIterator_9__exit__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_16__hub_primitives_13_WaitIterator_8__exit__};
+static PyObject *__pyx_pw_6gevent_16__hub_primitives_13_WaitIterator_9__exit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_typ = 0;
+  PyObject *__pyx_v_value = 0;
+  PyObject *__pyx_v_tb = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__exit__ (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_typ,&__pyx_n_s_value,&__pyx_n_s_tb,0};
+    PyObject* values[3] = {0,0,0};
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_typ)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
+        else {
+          __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, 1); __PYX_ERR(0, 174, __pyx_L3_error)
+        }
+        CYTHON_FALLTHROUGH;
+        case  2:
+        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tb)) != 0)) kw_args--;
+        else {
+          __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, 2); __PYX_ERR(0, 174, __pyx_L3_error)
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__exit__") < 0)) __PYX_ERR(0, 174, __pyx_L3_error)
+      }
+    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
+      goto __pyx_L5_argtuple_error;
+    } else {
+      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+    }
+    __pyx_v_typ = values[0];
+    __pyx_v_value = values[1];
+    __pyx_v_tb = values[2];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 174, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.__hub_primitives._WaitIterator.__exit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_16__hub_primitives_13_WaitIterator_8__exit__(((struct __pyx_obj_6gevent_16__hub_primitives__WaitIterator *)__pyx_v_self), __pyx_v_typ, __pyx_v_value, __pyx_v_tb);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_16__hub_primitives_13_WaitIterator_8__exit__(struct __pyx_obj_6gevent_16__hub_primitives__WaitIterator *__pyx_v_self, PyObject *__pyx_v_typ, PyObject *__pyx_v_value, PyObject *__pyx_v_tb) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__exit__", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __pyx_f_6gevent_16__hub_primitives_13_WaitIterator___exit__(__pyx_v_self, __pyx_v_typ, __pyx_v_value, __pyx_v_tb, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 174, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.__hub_primitives._WaitIterator.__exit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__17 = PyTuple_Pack(4, __pyx_n_s_self_2, __pyx_n_s_typ, __pyx_n_s_value, __pyx_n_s_tb); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(0, 174, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__17);
+  __Pyx_GIVEREF(__pyx_tuple__17);
+/* … */
+  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_16__hub_primitives_13_WaitIterator_9__exit__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_WaitIterator___exit, NULL, __pyx_n_s_gevent___hub_primitives, __pyx_d, ((PyObject *)__pyx_codeobj__18)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 174, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_16__hub_primitives__WaitIterator->tp_dict, __pyx_n_s_exit, __pyx_t_1) < 0) __PYX_ERR(0, 174, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_16__hub_primitives__WaitIterator);
+  __pyx_codeobj__18 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__17, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__hub_primitives_py, __pyx_n_s_exit, 174, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__18)) __PYX_ERR(0, 174, __pyx_L1_error)
+
+175:         self._cleanup()
+
  __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_16__hub_primitives__WaitIterator *)__pyx_v_self->__pyx_vtab)->_cleanup(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 175, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 176: 
+
 177: 
+
+178: def iwait_on_objects(objects, timeout=None, count=None):
+
static PyObject *__pyx_pw_6gevent_16__hub_primitives_1iwait_on_objects(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_f_6gevent_16__hub_primitives_iwait_on_objects(PyObject *__pyx_v_objects, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_16__hub_primitives_iwait_on_objects *__pyx_optional_args) {
+  PyObject *__pyx_v_timeout = ((PyObject *)Py_None);
+  PyObject *__pyx_v_count = ((PyObject *)Py_None);
+  struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *__pyx_v_hub = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("iwait_on_objects", 0);
+  if (__pyx_optional_args) {
+    if (__pyx_optional_args->__pyx_n > 0) {
+      __pyx_v_timeout = __pyx_optional_args->timeout;
+      if (__pyx_optional_args->__pyx_n > 1) {
+        __pyx_v_count = __pyx_optional_args->count;
+      }
+    }
+  }
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_AddTraceback("gevent.__hub_primitives.iwait_on_objects", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XDECREF((PyObject *)__pyx_v_hub);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_16__hub_primitives_1iwait_on_objects(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_6gevent_16__hub_primitives_iwait_on_objects[] = "iwait_on_objects(objects, timeout=None, count=None)\n\n    Iteratively yield *objects* as they are ready, until all (or *count*) are ready\n    or *timeout* expired.\n\n    If you will only be consuming a portion of the *objects*, you should\n    do so inside a ``with`` block on this object to avoid leaking resources::\n\n        with gevent.iwait((a, b, c)) as it:\n            for i in it:\n                if i is a:\n                    break\n\n    :param objects: A sequence (supporting :func:`len`) containing objects\n        implementing the wait protocol (rawlink() and unlink()).\n    :keyword int count: If not `None`, then a number specifying the maximum number\n        of objects to wait for. If ``None`` (the default), all objects\n        are waited for.\n    :keyword float timeout: If given, specifies a maximum number of seconds\n        to wait. If the timeout expires before the desired waited-for objects\n        are available, then this method returns immediately.\n\n    .. seealso:: :func:`wait`\n\n    .. versionchanged:: 1.1a1\n       Add the *count* parameter.\n    .. versionchanged:: 1.1a2\n       No longer raise :exc:`LoopExit` if our caller switches greenlets\n       in between items yielded by this function.\n    .. versionchanged:: 1.4\n       Add support to use the returned object as a context manager.\n    ";
+static PyMethodDef __pyx_mdef_6gevent_16__hub_primitives_1iwait_on_objects = {"iwait_on_objects", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_16__hub_primitives_1iwait_on_objects, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_16__hub_primitives_iwait_on_objects};
+static PyObject *__pyx_pw_6gevent_16__hub_primitives_1iwait_on_objects(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_objects = 0;
+  PyObject *__pyx_v_timeout = 0;
+  PyObject *__pyx_v_count = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("iwait_on_objects (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_objects,&__pyx_n_s_timeout,&__pyx_n_s_count,0};
+    PyObject* values[3] = {0,0,0};
+    values[1] = ((PyObject *)Py_None);
+    values[2] = ((PyObject *)Py_None);
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_objects)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_timeout);
+          if (value) { values[1] = value; kw_args--; }
+        }
+        CYTHON_FALLTHROUGH;
+        case  2:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_count);
+          if (value) { values[2] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "iwait_on_objects") < 0)) __PYX_ERR(0, 178, __pyx_L3_error)
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    __pyx_v_objects = values[0];
+    __pyx_v_timeout = values[1];
+    __pyx_v_count = values[2];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("iwait_on_objects", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 178, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.__hub_primitives.iwait_on_objects", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_16__hub_primitives_iwait_on_objects(__pyx_self, __pyx_v_objects, __pyx_v_timeout, __pyx_v_count);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_16__hub_primitives_iwait_on_objects(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_objects, PyObject *__pyx_v_timeout, PyObject *__pyx_v_count) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("iwait_on_objects", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_2.__pyx_n = 2;
+  __pyx_t_2.timeout = __pyx_v_timeout;
+  __pyx_t_2.count = __pyx_v_count;
+  __pyx_t_1 = __pyx_f_6gevent_16__hub_primitives_iwait_on_objects(__pyx_v_objects, 0, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 178, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.__hub_primitives.iwait_on_objects", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__19 = PyTuple_Pack(3, __pyx_n_s_objects, __pyx_n_s_timeout, __pyx_n_s_count); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(0, 178, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__19);
+  __Pyx_GIVEREF(__pyx_tuple__19);
+/* … */
+  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_16__hub_primitives_1iwait_on_objects, 0, __pyx_n_s_iwait_on_objects, NULL, __pyx_n_s_gevent___hub_primitives, __pyx_d, ((PyObject *)__pyx_codeobj__20)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 178, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_iwait_on_objects, __pyx_t_1) < 0) __PYX_ERR(0, 178, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_codeobj__20 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__19, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__hub_primitives_py, __pyx_n_s_iwait_on_objects, 178, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__20)) __PYX_ERR(0, 178, __pyx_L1_error)
+
 179:     """
+
 180:     Iteratively yield *objects* as they are ready, until all (or *count*) are ready
+
 181:     or *timeout* expired.
+
 182: 
+
 183:     If you will only be consuming a portion of the *objects*, you should
+
 184:     do so inside a ``with`` block on this object to avoid leaking resources::
+
 185: 
+
 186:         with gevent.iwait((a, b, c)) as it:
+
 187:             for i in it:
+
 188:                 if i is a:
+
 189:                     break
+
 190: 
+
 191:     :param objects: A sequence (supporting :func:`len`) containing objects
+
 192:         implementing the wait protocol (rawlink() and unlink()).
+
 193:     :keyword int count: If not `None`, then a number specifying the maximum number
+
 194:         of objects to wait for. If ``None`` (the default), all objects
+
 195:         are waited for.
+
 196:     :keyword float timeout: If given, specifies a maximum number of seconds
+
 197:         to wait. If the timeout expires before the desired waited-for objects
+
 198:         are available, then this method returns immediately.
+
 199: 
+
 200:     .. seealso:: :func:`wait`
+
 201: 
+
 202:     .. versionchanged:: 1.1a1
+
 203:        Add the *count* parameter.
+
 204:     .. versionchanged:: 1.1a2
+
 205:        No longer raise :exc:`LoopExit` if our caller switches greenlets
+
 206:        in between items yielded by this function.
+
 207:     .. versionchanged:: 1.4
+
 208:        Add support to use the returned object as a context manager.
+
 209:     """
+
 210:     # QQQ would be nice to support iterable here that can be generated slowly (why?)
+
+211:     hub = get_hub()
+
  __pyx_t_1 = ((PyObject *)__pyx_f_6gevent_11__hub_local_get_hub_noargs(0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 211, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_v_hub = ((struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *)__pyx_t_1);
+  __pyx_t_1 = 0;
+
+212:     if objects is None:
+
  __pyx_t_2 = (__pyx_v_objects == Py_None);
+  __pyx_t_3 = (__pyx_t_2 != 0);
+  if (__pyx_t_3) {
+/* … */
+  }
+
+213:         return [hub.join(timeout=timeout)]
+
    __Pyx_XDECREF(__pyx_r);
+    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_hub), __pyx_n_s_join); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 213, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 213, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_timeout, __pyx_v_timeout) < 0) __PYX_ERR(0, 213, __pyx_L1_error)
+    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 213, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_5);
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 213, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_GIVEREF(__pyx_t_5);
+    PyList_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
+    __pyx_t_5 = 0;
+    __pyx_r = __pyx_t_4;
+    __pyx_t_4 = 0;
+    goto __pyx_L0;
+
+214:     return _WaitIterator(objects, hub, timeout, count)
+
  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_4 = PyTuple_New(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 214, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_4);
+  __Pyx_INCREF(__pyx_v_objects);
+  __Pyx_GIVEREF(__pyx_v_objects);
+  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_objects);
+  __Pyx_INCREF(((PyObject *)__pyx_v_hub));
+  __Pyx_GIVEREF(((PyObject *)__pyx_v_hub));
+  PyTuple_SET_ITEM(__pyx_t_4, 1, ((PyObject *)__pyx_v_hub));
+  __Pyx_INCREF(__pyx_v_timeout);
+  __Pyx_GIVEREF(__pyx_v_timeout);
+  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_timeout);
+  __Pyx_INCREF(__pyx_v_count);
+  __Pyx_GIVEREF(__pyx_v_count);
+  PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_v_count);
+  __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6gevent_16__hub_primitives__WaitIterator), __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 214, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_5);
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __pyx_r = __pyx_t_5;
+  __pyx_t_5 = 0;
+  goto __pyx_L0;
+
 215: 
+
 216: 
+
+217: def wait_on_objects(objects=None, timeout=None, count=None):
+
static PyObject *__pyx_pw_6gevent_16__hub_primitives_3wait_on_objects(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_f_6gevent_16__hub_primitives_wait_on_objects(CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_16__hub_primitives_wait_on_objects *__pyx_optional_args) {
+  PyObject *__pyx_v_objects = ((PyObject *)Py_None);
+  PyObject *__pyx_v_timeout = ((PyObject *)Py_None);
+  PyObject *__pyx_v_count = ((PyObject *)Py_None);
+  struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *__pyx_v_hub = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("wait_on_objects", 0);
+  if (__pyx_optional_args) {
+    if (__pyx_optional_args->__pyx_n > 0) {
+      __pyx_v_objects = __pyx_optional_args->objects;
+      if (__pyx_optional_args->__pyx_n > 1) {
+        __pyx_v_timeout = __pyx_optional_args->timeout;
+        if (__pyx_optional_args->__pyx_n > 2) {
+          __pyx_v_count = __pyx_optional_args->count;
+        }
+      }
+    }
+  }
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_AddTraceback("gevent.__hub_primitives.wait_on_objects", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XDECREF((PyObject *)__pyx_v_hub);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_16__hub_primitives_3wait_on_objects(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_6gevent_16__hub_primitives_2wait_on_objects[] = "wait_on_objects(objects=None, timeout=None, count=None)\n\n    Wait for ``objects`` to become ready or for event loop to finish.\n\n    If ``objects`` is provided, it must be a list containing objects\n    implementing the wait protocol (rawlink() and unlink() methods):\n\n    - :class:`gevent.Greenlet` instance\n    - :class:`gevent.event.Event` instance\n    - :class:`gevent.lock.Semaphore` instance\n    - :class:`gevent.subprocess.Popen` instance\n\n    If ``objects`` is ``None`` (the default), ``wait()`` blocks until\n    the current event loop has nothing to do (or until ``timeout`` passes):\n\n    - all greenlets have finished\n    - all servers were stopped\n    - all event loop watchers were stopped.\n\n    If ``count`` is ``None`` (the default), wait for all ``objects``\n    to become ready.\n\n    If ``count`` is a number, wait for (up to) ``count`` objects to become\n    ready. (For example, if count is ``1`` then the function exits\n    when any object in the list is ready).\n\n    If ``timeout`` is provided, it specifies the maximum number of\n    seconds ``wait()`` will block.\n\n    Returns the list of ready objects, in the order in which they were\n    ready.\n\n    .. seealso:: :func:`iwait`\n    ";
+static PyMethodDef __pyx_mdef_6gevent_16__hub_primitives_3wait_on_objects = {"wait_on_objects", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_16__hub_primitives_3wait_on_objects, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_16__hub_primitives_2wait_on_objects};
+static PyObject *__pyx_pw_6gevent_16__hub_primitives_3wait_on_objects(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_objects = 0;
+  PyObject *__pyx_v_timeout = 0;
+  PyObject *__pyx_v_count = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("wait_on_objects (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_objects,&__pyx_n_s_timeout,&__pyx_n_s_count,0};
+    PyObject* values[3] = {0,0,0};
+    values[0] = ((PyObject *)Py_None);
+    values[1] = ((PyObject *)Py_None);
+    values[2] = ((PyObject *)Py_None);
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_objects);
+          if (value) { values[0] = value; kw_args--; }
+        }
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_timeout);
+          if (value) { values[1] = value; kw_args--; }
+        }
+        CYTHON_FALLTHROUGH;
+        case  2:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_count);
+          if (value) { values[2] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "wait_on_objects") < 0)) __PYX_ERR(0, 217, __pyx_L3_error)
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    __pyx_v_objects = values[0];
+    __pyx_v_timeout = values[1];
+    __pyx_v_count = values[2];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("wait_on_objects", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 217, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.__hub_primitives.wait_on_objects", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_16__hub_primitives_2wait_on_objects(__pyx_self, __pyx_v_objects, __pyx_v_timeout, __pyx_v_count);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_16__hub_primitives_2wait_on_objects(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_objects, PyObject *__pyx_v_timeout, PyObject *__pyx_v_count) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("wait_on_objects", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_2.__pyx_n = 3;
+  __pyx_t_2.objects = __pyx_v_objects;
+  __pyx_t_2.timeout = __pyx_v_timeout;
+  __pyx_t_2.count = __pyx_v_count;
+  __pyx_t_1 = __pyx_f_6gevent_16__hub_primitives_wait_on_objects(0, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 217, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.__hub_primitives.wait_on_objects", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__21 = PyTuple_Pack(3, __pyx_n_s_objects, __pyx_n_s_timeout, __pyx_n_s_count); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(0, 217, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__21);
+  __Pyx_GIVEREF(__pyx_tuple__21);
+/* … */
+  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_16__hub_primitives_3wait_on_objects, 0, __pyx_n_s_wait_on_objects, NULL, __pyx_n_s_gevent___hub_primitives, __pyx_d, ((PyObject *)__pyx_codeobj__22)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 217, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_wait_on_objects, __pyx_t_1) < 0) __PYX_ERR(0, 217, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_codeobj__22 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__21, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__hub_primitives_py, __pyx_n_s_wait_on_objects, 217, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__22)) __PYX_ERR(0, 217, __pyx_L1_error)
+
 218:     """
+
 219:     Wait for ``objects`` to become ready or for event loop to finish.
+
 220: 
+
 221:     If ``objects`` is provided, it must be a list containing objects
+
 222:     implementing the wait protocol (rawlink() and unlink() methods):
+
 223: 
+
 224:     - :class:`gevent.Greenlet` instance
+
 225:     - :class:`gevent.event.Event` instance
+
 226:     - :class:`gevent.lock.Semaphore` instance
+
 227:     - :class:`gevent.subprocess.Popen` instance
+
 228: 
+
 229:     If ``objects`` is ``None`` (the default), ``wait()`` blocks until
+
 230:     the current event loop has nothing to do (or until ``timeout`` passes):
+
 231: 
+
 232:     - all greenlets have finished
+
 233:     - all servers were stopped
+
 234:     - all event loop watchers were stopped.
+
 235: 
+
 236:     If ``count`` is ``None`` (the default), wait for all ``objects``
+
 237:     to become ready.
+
 238: 
+
 239:     If ``count`` is a number, wait for (up to) ``count`` objects to become
+
 240:     ready. (For example, if count is ``1`` then the function exits
+
 241:     when any object in the list is ready).
+
 242: 
+
 243:     If ``timeout`` is provided, it specifies the maximum number of
+
 244:     seconds ``wait()`` will block.
+
 245: 
+
 246:     Returns the list of ready objects, in the order in which they were
+
 247:     ready.
+
 248: 
+
 249:     .. seealso:: :func:`iwait`
+
 250:     """
+
+251:     if objects is None:
+
  __pyx_t_1 = (__pyx_v_objects == Py_None);
+  __pyx_t_2 = (__pyx_t_1 != 0);
+  if (__pyx_t_2) {
+/* … */
+  }
+
+252:         hub = get_hub()
+
    __pyx_t_3 = ((PyObject *)__pyx_f_6gevent_11__hub_local_get_hub_noargs(0)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 252, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __pyx_v_hub = ((struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *)__pyx_t_3);
+    __pyx_t_3 = 0;
+
+253:         return hub.join(timeout=timeout) # pylint:disable=
+
    __Pyx_XDECREF(__pyx_r);
+    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_hub), __pyx_n_s_join); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 253, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 253, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_timeout, __pyx_v_timeout) < 0) __PYX_ERR(0, 253, __pyx_L1_error)
+    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 253, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_5);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __pyx_r = __pyx_t_5;
+    __pyx_t_5 = 0;
+    goto __pyx_L0;
+
+254:     return list(iwait_on_objects(objects, timeout, count))
+
  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_6.__pyx_n = 2;
+  __pyx_t_6.timeout = __pyx_v_timeout;
+  __pyx_t_6.count = __pyx_v_count;
+  __pyx_t_5 = __pyx_f_6gevent_16__hub_primitives_iwait_on_objects(__pyx_v_objects, 0, &__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 254, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_5);
+  __pyx_t_4 = PySequence_List(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 254, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_4);
+  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+  __pyx_r = __pyx_t_4;
+  __pyx_t_4 = 0;
+  goto __pyx_L0;
+
 255: 
+
+256: _timeout_error = Exception
+
  __Pyx_INCREF(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
+  __Pyx_XGOTREF(__pyx_v_6gevent_16__hub_primitives__timeout_error);
+  __Pyx_DECREF_SET(__pyx_v_6gevent_16__hub_primitives__timeout_error, ((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
+  __Pyx_GIVEREF(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
+
 257: 
+
+258: def set_default_timeout_error(e):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_16__hub_primitives_5set_default_timeout_error(PyObject *__pyx_self, PyObject *__pyx_v_e); /*proto*/
+static char __pyx_doc_6gevent_16__hub_primitives_4set_default_timeout_error[] = "set_default_timeout_error(e)";
+static PyMethodDef __pyx_mdef_6gevent_16__hub_primitives_5set_default_timeout_error = {"set_default_timeout_error", (PyCFunction)__pyx_pw_6gevent_16__hub_primitives_5set_default_timeout_error, METH_O, __pyx_doc_6gevent_16__hub_primitives_4set_default_timeout_error};
+static PyObject *__pyx_pw_6gevent_16__hub_primitives_5set_default_timeout_error(PyObject *__pyx_self, PyObject *__pyx_v_e) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("set_default_timeout_error (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_16__hub_primitives_4set_default_timeout_error(__pyx_self, ((PyObject *)__pyx_v_e));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_16__hub_primitives_4set_default_timeout_error(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_e) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("set_default_timeout_error", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__23 = PyTuple_Pack(1, __pyx_n_s_e); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(0, 258, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__23);
+  __Pyx_GIVEREF(__pyx_tuple__23);
+/* … */
+  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_16__hub_primitives_5set_default_timeout_error, 0, __pyx_n_s_set_default_timeout_error, NULL, __pyx_n_s_gevent___hub_primitives, __pyx_d, ((PyObject *)__pyx_codeobj__24)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 258, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_default_timeout_error, __pyx_t_1) < 0) __PYX_ERR(0, 258, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_codeobj__24 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__23, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__hub_primitives_py, __pyx_n_s_set_default_timeout_error, 258, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__24)) __PYX_ERR(0, 258, __pyx_L1_error)
+
 259:     global _timeout_error
+
+260:     _timeout_error = e
+
  __Pyx_INCREF(__pyx_v_e);
+  __Pyx_XGOTREF(__pyx_v_6gevent_16__hub_primitives__timeout_error);
+  __Pyx_DECREF_SET(__pyx_v_6gevent_16__hub_primitives__timeout_error, __pyx_v_e);
+  __Pyx_GIVEREF(__pyx_v_e);
+
 261: 
+
+262: def _primitive_wait(watcher, timeout, timeout_exc, hub):
+
static PyObject *__pyx_f_6gevent_16__hub_primitives__primitive_wait(PyObject *__pyx_v_watcher, PyObject *__pyx_v_timeout, PyObject *__pyx_v_timeout_exc, struct __pyx_obj_6gevent_16__hub_primitives_WaitOperationsGreenlet *__pyx_v_hub) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_primitive_wait", 0);
+  __Pyx_INCREF(__pyx_v_timeout);
+  __Pyx_INCREF((PyObject *)__pyx_v_hub);
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_XDECREF(__pyx_t_6);
+  __Pyx_XDECREF(__pyx_t_8);
+  __Pyx_XDECREF(__pyx_t_9);
+  __Pyx_AddTraceback("gevent.__hub_primitives._primitive_wait", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_timeout);
+  __Pyx_XDECREF((PyObject *)__pyx_v_hub);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+263:     if watcher.callback is not None:
+
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_watcher, __pyx_n_s_callback); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 263, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = (__pyx_t_1 != Py_None);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_3 = (__pyx_t_2 != 0);
+  if (unlikely(__pyx_t_3)) {
+/* … */
+  }
+
+264:         raise ConcurrentObjectUseError('This socket is already used by another greenlet: %r'
+
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ConcurrentObjectUseError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 264, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+
+265:                                        % (watcher.callback, ))
+
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_watcher, __pyx_n_s_callback); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 265, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_5);
+    __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 265, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_6);
+    __Pyx_GIVEREF(__pyx_t_5);
+    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5);
+    __pyx_t_5 = 0;
+    __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_This_socket_is_already_used_by_a, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 265, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_5);
+    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+    __pyx_t_6 = NULL;
+    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
+      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
+      if (likely(__pyx_t_6)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
+        __Pyx_INCREF(__pyx_t_6);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_4, function);
+      }
+    }
+    __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_6, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5);
+    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 264, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __PYX_ERR(0, 264, __pyx_L1_error)
+
 266: 
+
+267:     if hub is None:
+
  __pyx_t_3 = (((PyObject *)__pyx_v_hub) == Py_None);
+  __pyx_t_2 = (__pyx_t_3 != 0);
+  if (__pyx_t_2) {
+/* … */
+  }
+
+268:         hub = get_hub()
+
    __pyx_t_1 = ((PyObject *)__pyx_f_6gevent_11__hub_local_get_hub_noargs(0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 268, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_6gevent_16__hub_primitives_WaitOperationsGreenlet))))) __PYX_ERR(0, 268, __pyx_L1_error)
+    __Pyx_DECREF_SET(__pyx_v_hub, ((struct __pyx_obj_6gevent_16__hub_primitives_WaitOperationsGreenlet *)__pyx_t_1));
+    __pyx_t_1 = 0;
+
 269: 
+
+270:     if timeout is None:
+
  __pyx_t_2 = (__pyx_v_timeout == Py_None);
+  __pyx_t_3 = (__pyx_t_2 != 0);
+  if (__pyx_t_3) {
+/* … */
+  }
+
+271:         hub.wait(watcher)
+
    __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_16__hub_primitives_WaitOperationsGreenlet *)__pyx_v_hub->__pyx_base.__pyx_vtab)->wait(__pyx_v_hub, __pyx_v_watcher, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 271, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+272:         return
+
    __Pyx_XDECREF(__pyx_r);
+    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+    goto __pyx_L0;
+
 273: 
+
+274:     timeout = Timeout._start_new_or_dummy(
+
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_6gevent_16__hub_primitives_Timeout, __pyx_n_s_start_new_or_dummy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 274, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_4);
+
 275:         timeout,
+
+276:         (timeout_exc
+
    __Pyx_INCREF(__pyx_v_timeout_exc);
+    __pyx_t_5 = __pyx_v_timeout_exc;
+  } else {
+
+277:          if timeout_exc is not _NONE or timeout is None
+
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_NONE); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 277, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  __pyx_t_2 = (__pyx_v_timeout_exc != __pyx_t_6);
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  __pyx_t_7 = (__pyx_t_2 != 0);
+  if (!__pyx_t_7) {
+  } else {
+    __pyx_t_3 = __pyx_t_7;
+    goto __pyx_L6_bool_binop_done;
+  }
+  __pyx_t_7 = (__pyx_v_timeout == Py_None);
+  __pyx_t_2 = (__pyx_t_7 != 0);
+  __pyx_t_3 = __pyx_t_2;
+  __pyx_L6_bool_binop_done:;
+  if (__pyx_t_3) {
+
+278:          else _timeout_error('timed out')))
+
    __Pyx_INCREF(__pyx_v_6gevent_16__hub_primitives__timeout_error);
+    __pyx_t_8 = __pyx_v_6gevent_16__hub_primitives__timeout_error; __pyx_t_9 = NULL;
+    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
+      __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8);
+      if (likely(__pyx_t_9)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
+        __Pyx_INCREF(__pyx_t_9);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_8, function);
+      }
+    }
+    __pyx_t_6 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_9, __pyx_kp_s_timed_out) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_kp_s_timed_out);
+    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
+    if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 278, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_6);
+    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+    __pyx_t_5 = __pyx_t_6;
+    __pyx_t_6 = 0;
+  }
+  __pyx_t_6 = NULL;
+  __pyx_t_10 = 0;
+  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
+    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
+    if (likely(__pyx_t_6)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
+      __Pyx_INCREF(__pyx_t_6);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_4, function);
+      __pyx_t_10 = 1;
+    }
+  }
+  #if CYTHON_FAST_PYCALL
+  if (PyFunction_Check(__pyx_t_4)) {
+    PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_timeout, __pyx_t_5};
+    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 274, __pyx_L1_error)
+    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+  } else
+  #endif
+  #if CYTHON_FAST_PYCCALL
+  if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
+    PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_timeout, __pyx_t_5};
+    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 274, __pyx_L1_error)
+    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+  } else
+  #endif
+  {
+    __pyx_t_8 = PyTuple_New(2+__pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 274, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_8);
+    if (__pyx_t_6) {
+      __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL;
+    }
+    __Pyx_INCREF(__pyx_v_timeout);
+    __Pyx_GIVEREF(__pyx_v_timeout);
+    PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_10, __pyx_v_timeout);
+    __Pyx_GIVEREF(__pyx_t_5);
+    PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_10, __pyx_t_5);
+    __pyx_t_5 = 0;
+    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 274, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+  }
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __Pyx_DECREF_SET(__pyx_v_timeout, __pyx_t_1);
+  __pyx_t_1 = 0;
+
 279: 
+
+280:     with timeout:
+
  /*with:*/ {
+    __pyx_t_11 = __Pyx_PyObject_LookupSpecial(__pyx_v_timeout, __pyx_n_s_exit); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 280, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_11);
+    __pyx_t_4 = __Pyx_PyObject_LookupSpecial(__pyx_v_timeout, __pyx_n_s_enter); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 280, __pyx_L8_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    __pyx_t_8 = NULL;
+    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
+      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_4);
+      if (likely(__pyx_t_8)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
+        __Pyx_INCREF(__pyx_t_8);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_4, function);
+      }
+    }
+    __pyx_t_1 = (__pyx_t_8) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_8) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
+    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
+    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 280, __pyx_L8_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    /*try:*/ {
+      {
+        /*try:*/ {
+/* … */
+        }
+        __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
+        __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
+        __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
+        goto __pyx_L17_try_end;
+        __pyx_L12_error:;
+        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
+        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
+        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+        /*except:*/ {
+          __Pyx_AddTraceback("gevent.__hub_primitives._primitive_wait", __pyx_clineno, __pyx_lineno, __pyx_filename);
+          if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_4, &__pyx_t_8) < 0) __PYX_ERR(0, 280, __pyx_L14_except_error)
+          __Pyx_GOTREF(__pyx_t_1);
+          __Pyx_GOTREF(__pyx_t_4);
+          __Pyx_GOTREF(__pyx_t_8);
+          __pyx_t_5 = PyTuple_Pack(3, __pyx_t_1, __pyx_t_4, __pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 280, __pyx_L14_except_error)
+          __Pyx_GOTREF(__pyx_t_5);
+          __pyx_t_15 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_5, NULL);
+          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+          if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 280, __pyx_L14_except_error)
+          __Pyx_GOTREF(__pyx_t_15);
+          __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_15);
+          __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
+          if (__pyx_t_3 < 0) __PYX_ERR(0, 280, __pyx_L14_except_error)
+          __pyx_t_2 = ((!(__pyx_t_3 != 0)) != 0);
+          if (__pyx_t_2) {
+            __Pyx_GIVEREF(__pyx_t_1);
+            __Pyx_GIVEREF(__pyx_t_4);
+            __Pyx_XGIVEREF(__pyx_t_8);
+            __Pyx_ErrRestoreWithState(__pyx_t_1, __pyx_t_4, __pyx_t_8);
+            __pyx_t_1 = 0; __pyx_t_4 = 0; __pyx_t_8 = 0; 
+            __PYX_ERR(0, 280, __pyx_L14_except_error)
+          }
+          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
+          goto __pyx_L13_exception_handled;
+        }
+        __pyx_L14_except_error:;
+        __Pyx_XGIVEREF(__pyx_t_12);
+        __Pyx_XGIVEREF(__pyx_t_13);
+        __Pyx_XGIVEREF(__pyx_t_14);
+        __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14);
+        goto __pyx_L1_error;
+        __pyx_L13_exception_handled:;
+        __Pyx_XGIVEREF(__pyx_t_12);
+        __Pyx_XGIVEREF(__pyx_t_13);
+        __Pyx_XGIVEREF(__pyx_t_14);
+        __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14);
+        __pyx_L17_try_end:;
+      }
+    }
+    /*finally:*/ {
+      /*normal exit:*/{
+        if (__pyx_t_11) {
+          __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_tuple_, NULL);
+          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+          if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 280, __pyx_L1_error)
+          __Pyx_GOTREF(__pyx_t_14);
+          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
+        }
+        goto __pyx_L11;
+      }
+      __pyx_L11:;
+    }
+    goto __pyx_L21;
+    __pyx_L8_error:;
+    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+    goto __pyx_L1_error;
+    __pyx_L21:;
+  }
+/* … */
+  __pyx_tuple_ = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 280, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple_);
+  __Pyx_GIVEREF(__pyx_tuple_);
+
+281:         hub.wait(watcher)
+
          __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_16__hub_primitives_WaitOperationsGreenlet *)__pyx_v_hub->__pyx_base.__pyx_vtab)->wait(__pyx_v_hub, __pyx_v_watcher, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 281, __pyx_L12_error)
+          __Pyx_GOTREF(__pyx_t_1);
+          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 282: 
+
 283: # Suitable to be bound as an instance method
+
+284: def wait_on_socket(socket, watcher, timeout_exc=None):
+
static PyObject *__pyx_pw_6gevent_16__hub_primitives_7wait_on_socket(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_f_6gevent_16__hub_primitives_wait_on_socket(PyObject *__pyx_v_socket, PyObject *__pyx_v_watcher, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_16__hub_primitives_wait_on_socket *__pyx_optional_args) {
+  PyObject *__pyx_v_timeout_exc = ((PyObject *)Py_None);
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("wait_on_socket", 0);
+  if (__pyx_optional_args) {
+    if (__pyx_optional_args->__pyx_n > 0) {
+      __pyx_v_timeout_exc = __pyx_optional_args->timeout_exc;
+    }
+  }
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_XDECREF(__pyx_t_6);
+  __Pyx_XDECREF(__pyx_t_7);
+  __Pyx_AddTraceback("gevent.__hub_primitives.wait_on_socket", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_16__hub_primitives_7wait_on_socket(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_6gevent_16__hub_primitives_6wait_on_socket[] = "wait_on_socket(socket, watcher, timeout_exc=None)";
+static PyMethodDef __pyx_mdef_6gevent_16__hub_primitives_7wait_on_socket = {"wait_on_socket", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_16__hub_primitives_7wait_on_socket, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_16__hub_primitives_6wait_on_socket};
+static PyObject *__pyx_pw_6gevent_16__hub_primitives_7wait_on_socket(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_socket = 0;
+  PyObject *__pyx_v_watcher = 0;
+  PyObject *__pyx_v_timeout_exc = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("wait_on_socket (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_socket,&__pyx_n_s_watcher,&__pyx_n_s_timeout_exc,0};
+    PyObject* values[3] = {0,0,0};
+    values[2] = ((PyObject *)Py_None);
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_socket)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_watcher)) != 0)) kw_args--;
+        else {
+          __Pyx_RaiseArgtupleInvalid("wait_on_socket", 0, 2, 3, 1); __PYX_ERR(0, 284, __pyx_L3_error)
+        }
+        CYTHON_FALLTHROUGH;
+        case  2:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_timeout_exc);
+          if (value) { values[2] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "wait_on_socket") < 0)) __PYX_ERR(0, 284, __pyx_L3_error)
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    __pyx_v_socket = values[0];
+    __pyx_v_watcher = values[1];
+    __pyx_v_timeout_exc = values[2];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("wait_on_socket", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 284, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.__hub_primitives.wait_on_socket", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_16__hub_primitives_6wait_on_socket(__pyx_self, __pyx_v_socket, __pyx_v_watcher, __pyx_v_timeout_exc);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_16__hub_primitives_6wait_on_socket(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_socket, PyObject *__pyx_v_watcher, PyObject *__pyx_v_timeout_exc) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("wait_on_socket", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_2.__pyx_n = 1;
+  __pyx_t_2.timeout_exc = __pyx_v_timeout_exc;
+  __pyx_t_1 = __pyx_f_6gevent_16__hub_primitives_wait_on_socket(__pyx_v_socket, __pyx_v_watcher, 0, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 284, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.__hub_primitives.wait_on_socket", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__25 = PyTuple_Pack(3, __pyx_n_s_socket, __pyx_n_s_watcher, __pyx_n_s_timeout_exc); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(0, 284, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__25);
+  __Pyx_GIVEREF(__pyx_tuple__25);
+/* … */
+  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_16__hub_primitives_7wait_on_socket, 0, __pyx_n_s_wait_on_socket, NULL, __pyx_n_s_gevent___hub_primitives, __pyx_d, ((PyObject *)__pyx_codeobj__26)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 284, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_wait_on_socket, __pyx_t_1) < 0) __PYX_ERR(0, 284, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_codeobj__26 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__25, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__hub_primitives_py, __pyx_n_s_wait_on_socket, 284, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__26)) __PYX_ERR(0, 284, __pyx_L1_error)
+
+285:     if socket is None or watcher is None:
+
  __pyx_t_2 = (__pyx_v_socket == Py_None);
+  __pyx_t_3 = (__pyx_t_2 != 0);
+  if (!__pyx_t_3) {
+  } else {
+    __pyx_t_1 = __pyx_t_3;
+    goto __pyx_L4_bool_binop_done;
+  }
+  __pyx_t_3 = (__pyx_v_watcher == Py_None);
+  __pyx_t_2 = (__pyx_t_3 != 0);
+  __pyx_t_1 = __pyx_t_2;
+  __pyx_L4_bool_binop_done:;
+  if (unlikely(__pyx_t_1)) {
+/* … */
+  }
+
 286:         # test__hub TestCloseSocketWhilePolling, on Python 2; Python 3
+
 287:         # catches the EBADF differently.
+
+288:         raise ConcurrentObjectUseError("The socket has already been closed by another greenlet")
+
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_ConcurrentObjectUseError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 288, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_5);
+    __pyx_t_6 = NULL;
+    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
+      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
+      if (likely(__pyx_t_6)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
+        __Pyx_INCREF(__pyx_t_6);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_5, function);
+      }
+    }
+    __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_kp_s_The_socket_has_already_been_clos) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_kp_s_The_socket_has_already_been_clos);
+    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 288, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __PYX_ERR(0, 288, __pyx_L1_error)
+
+289:     _primitive_wait(watcher, socket.timeout,
+
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_socket, __pyx_n_s_timeout); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 289, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_4);
+/* … */
+  __pyx_t_7 = __pyx_f_6gevent_16__hub_primitives__primitive_wait(__pyx_v_watcher, __pyx_t_4, __pyx_t_5, ((struct __pyx_obj_6gevent_16__hub_primitives_WaitOperationsGreenlet *)__pyx_t_6)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 289, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_7);
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+
+290:                     timeout_exc if timeout_exc is not None else _NONE,
+
  __pyx_t_1 = (__pyx_v_timeout_exc != Py_None);
+  if ((__pyx_t_1 != 0)) {
+    __Pyx_INCREF(__pyx_v_timeout_exc);
+    __pyx_t_5 = __pyx_v_timeout_exc;
+  } else {
+    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_NONE); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 290, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_6);
+    __pyx_t_5 = __pyx_t_6;
+    __pyx_t_6 = 0;
+  }
+
+291:                     socket.hub)
+
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_socket, __pyx_n_s_hub); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 291, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_6gevent_16__hub_primitives_WaitOperationsGreenlet))))) __PYX_ERR(0, 291, __pyx_L1_error)
+
 292: 
+
+293: def wait_on_watcher(watcher, timeout=None, timeout_exc=_NONE, hub=None):
+
static PyObject *__pyx_pw_6gevent_16__hub_primitives_9wait_on_watcher(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_f_6gevent_16__hub_primitives_wait_on_watcher(PyObject *__pyx_v_watcher, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_16__hub_primitives_wait_on_watcher *__pyx_optional_args) {
+  PyObject *__pyx_v_timeout = ((PyObject *)Py_None);
+  PyObject *__pyx_v_timeout_exc = __pyx_k__2;
+  struct __pyx_obj_6gevent_16__hub_primitives_WaitOperationsGreenlet *__pyx_v_hub = ((struct __pyx_obj_6gevent_16__hub_primitives_WaitOperationsGreenlet *)Py_None);
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("wait_on_watcher", 0);
+  if (__pyx_optional_args) {
+    if (__pyx_optional_args->__pyx_n > 0) {
+      __pyx_v_timeout = __pyx_optional_args->timeout;
+      if (__pyx_optional_args->__pyx_n > 1) {
+        __pyx_v_timeout_exc = __pyx_optional_args->timeout_exc;
+        if (__pyx_optional_args->__pyx_n > 2) {
+          __pyx_v_hub = __pyx_optional_args->hub;
+        }
+      }
+    }
+  }
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.__hub_primitives.wait_on_watcher", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_16__hub_primitives_9wait_on_watcher(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_6gevent_16__hub_primitives_8wait_on_watcher[] = "wait_on_watcher(watcher, timeout=None, timeout_exc=_NONE, WaitOperationsGreenlet hub=None)\n\n    wait(watcher, timeout=None, [timeout_exc=None]) -> None\n\n    Block the current greenlet until *watcher* is ready.\n\n    If *timeout* is non-negative, then *timeout_exc* is raised after\n    *timeout* second has passed.\n\n    If :func:`cancel_wait` is called on *io* by another greenlet,\n    raise an exception in this blocking greenlet\n    (``socket.error(EBADF, 'File descriptor was closed in another\n    greenlet')`` by default).\n\n    :param io: An event loop watcher, most commonly an IO watcher obtained from\n        :meth:`gevent.core.loop.io`\n    :keyword timeout_exc: The exception to raise if the timeout expires.\n        By default, a :class:`socket.timeout` exception is raised.\n        If you pass a value for this keyword, it is interpreted as for\n        :class:`gevent.timeout.Timeout`.\n\n    :raises ~gevent.hub.ConcurrentObjectUseError: If the *watcher* is\n        already started.\n    ";
+static PyMethodDef __pyx_mdef_6gevent_16__hub_primitives_9wait_on_watcher = {"wait_on_watcher", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_16__hub_primitives_9wait_on_watcher, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_16__hub_primitives_8wait_on_watcher};
+static PyObject *__pyx_pw_6gevent_16__hub_primitives_9wait_on_watcher(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_watcher = 0;
+  PyObject *__pyx_v_timeout = 0;
+  PyObject *__pyx_v_timeout_exc = 0;
+  struct __pyx_obj_6gevent_16__hub_primitives_WaitOperationsGreenlet *__pyx_v_hub = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("wait_on_watcher (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_watcher,&__pyx_n_s_timeout,&__pyx_n_s_timeout_exc,&__pyx_n_s_hub,0};
+    PyObject* values[4] = {0,0,0,0};
+    values[1] = ((PyObject *)Py_None);
+    values[2] = __pyx_k__2;
+    values[3] = (PyObject *)((struct __pyx_obj_6gevent_16__hub_primitives_WaitOperationsGreenlet *)Py_None);
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
+        CYTHON_FALLTHROUGH;
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_watcher)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_timeout);
+          if (value) { values[1] = value; kw_args--; }
+        }
+        CYTHON_FALLTHROUGH;
+        case  2:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_timeout_exc);
+          if (value) { values[2] = value; kw_args--; }
+        }
+        CYTHON_FALLTHROUGH;
+        case  3:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_hub);
+          if (value) { values[3] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "wait_on_watcher") < 0)) __PYX_ERR(0, 293, __pyx_L3_error)
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
+        CYTHON_FALLTHROUGH;
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    __pyx_v_watcher = values[0];
+    __pyx_v_timeout = values[1];
+    __pyx_v_timeout_exc = values[2];
+    __pyx_v_hub = ((struct __pyx_obj_6gevent_16__hub_primitives_WaitOperationsGreenlet *)values[3]);
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("wait_on_watcher", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 293, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.__hub_primitives.wait_on_watcher", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_hub), __pyx_ptype_6gevent_16__hub_primitives_WaitOperationsGreenlet, 1, "hub", 0))) __PYX_ERR(0, 293, __pyx_L1_error)
+  __pyx_r = __pyx_pf_6gevent_16__hub_primitives_8wait_on_watcher(__pyx_self, __pyx_v_watcher, __pyx_v_timeout, __pyx_v_timeout_exc, __pyx_v_hub);
+
+  /* function exit code */
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_16__hub_primitives_8wait_on_watcher(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_watcher, PyObject *__pyx_v_timeout, PyObject *__pyx_v_timeout_exc, struct __pyx_obj_6gevent_16__hub_primitives_WaitOperationsGreenlet *__pyx_v_hub) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("wait_on_watcher", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_2.__pyx_n = 3;
+  __pyx_t_2.timeout = __pyx_v_timeout;
+  __pyx_t_2.timeout_exc = __pyx_v_timeout_exc;
+  __pyx_t_2.hub = __pyx_v_hub;
+  __pyx_t_1 = __pyx_f_6gevent_16__hub_primitives_wait_on_watcher(__pyx_v_watcher, 0, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 293, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.__hub_primitives.wait_on_watcher", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_NONE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 293, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_k__2 = __pyx_t_1;
+  __Pyx_GIVEREF(__pyx_t_1);
+  __pyx_t_1 = 0;
+  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_NONE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 293, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_k__2 = __pyx_t_1;
+  __Pyx_GIVEREF(__pyx_t_1);
+  __pyx_t_1 = 0;
+/* … */
+  __pyx_tuple__27 = PyTuple_Pack(4, __pyx_n_s_watcher, __pyx_n_s_timeout, __pyx_n_s_timeout_exc, __pyx_n_s_hub); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(0, 293, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__27);
+  __Pyx_GIVEREF(__pyx_tuple__27);
+  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_16__hub_primitives_9wait_on_watcher, 0, __pyx_n_s_wait_on_watcher, NULL, __pyx_n_s_gevent___hub_primitives, __pyx_d, ((PyObject *)__pyx_codeobj__28)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 293, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_wait_on_watcher, __pyx_t_1) < 0) __PYX_ERR(0, 293, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_codeobj__28 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__27, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__hub_primitives_py, __pyx_n_s_wait_on_watcher, 293, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__28)) __PYX_ERR(0, 293, __pyx_L1_error)
+
 294:     """
+
 295:     wait(watcher, timeout=None, [timeout_exc=None]) -> None
+
 296: 
+
 297:     Block the current greenlet until *watcher* is ready.
+
 298: 
+
 299:     If *timeout* is non-negative, then *timeout_exc* is raised after
+
 300:     *timeout* second has passed.
+
 301: 
+
 302:     If :func:`cancel_wait` is called on *io* by another greenlet,
+
 303:     raise an exception in this blocking greenlet
+
 304:     (``socket.error(EBADF, 'File descriptor was closed in another
+
 305:     greenlet')`` by default).
+
 306: 
+
 307:     :param io: An event loop watcher, most commonly an IO watcher obtained from
+
 308:         :meth:`gevent.core.loop.io`
+
 309:     :keyword timeout_exc: The exception to raise if the timeout expires.
+
 310:         By default, a :class:`socket.timeout` exception is raised.
+
 311:         If you pass a value for this keyword, it is interpreted as for
+
 312:         :class:`gevent.timeout.Timeout`.
+
 313: 
+
 314:     :raises ~gevent.hub.ConcurrentObjectUseError: If the *watcher* is
+
 315:         already started.
+
 316:     """
+
+317:     _primitive_wait(watcher, timeout, timeout_exc, hub)
+
  __pyx_t_1 = __pyx_f_6gevent_16__hub_primitives__primitive_wait(__pyx_v_watcher, __pyx_v_timeout, __pyx_v_timeout_exc, __pyx_v_hub); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 317, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 318: 
+
 319: 
+
+320: def wait_read(fileno, timeout=None, timeout_exc=_NONE):
+
static PyObject *__pyx_pw_6gevent_16__hub_primitives_11wait_read(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_f_6gevent_16__hub_primitives_wait_read(PyObject *__pyx_v_fileno, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_16__hub_primitives_wait_read *__pyx_optional_args) {
+  PyObject *__pyx_v_timeout = ((PyObject *)Py_None);
+  PyObject *__pyx_v_timeout_exc = __pyx_k__3;
+  struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *__pyx_v_hub = NULL;
+  PyObject *__pyx_v_io = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("wait_read", 0);
+  if (__pyx_optional_args) {
+    if (__pyx_optional_args->__pyx_n > 0) {
+      __pyx_v_timeout = __pyx_optional_args->timeout;
+      if (__pyx_optional_args->__pyx_n > 1) {
+        __pyx_v_timeout_exc = __pyx_optional_args->timeout_exc;
+      }
+    }
+  }
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_AddTraceback("gevent.__hub_primitives.wait_read", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XDECREF((PyObject *)__pyx_v_hub);
+  __Pyx_XDECREF(__pyx_v_io);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_16__hub_primitives_11wait_read(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_6gevent_16__hub_primitives_10wait_read[] = "wait_read(fileno, timeout=None, timeout_exc=_NONE)\n\n    wait_read(fileno, timeout=None, [timeout_exc=None]) -> None\n\n    Block the current greenlet until *fileno* is ready to read.\n\n    For the meaning of the other parameters and possible exceptions,\n    see :func:`wait`.\n\n    .. seealso:: :func:`cancel_wait`\n    ";
+static PyMethodDef __pyx_mdef_6gevent_16__hub_primitives_11wait_read = {"wait_read", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_16__hub_primitives_11wait_read, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_16__hub_primitives_10wait_read};
+static PyObject *__pyx_pw_6gevent_16__hub_primitives_11wait_read(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_fileno = 0;
+  PyObject *__pyx_v_timeout = 0;
+  PyObject *__pyx_v_timeout_exc = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("wait_read (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_fileno,&__pyx_n_s_timeout,&__pyx_n_s_timeout_exc,0};
+    PyObject* values[3] = {0,0,0};
+    values[1] = ((PyObject *)Py_None);
+    values[2] = __pyx_k__3;
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_fileno)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_timeout);
+          if (value) { values[1] = value; kw_args--; }
+        }
+        CYTHON_FALLTHROUGH;
+        case  2:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_timeout_exc);
+          if (value) { values[2] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "wait_read") < 0)) __PYX_ERR(0, 320, __pyx_L3_error)
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    __pyx_v_fileno = values[0];
+    __pyx_v_timeout = values[1];
+    __pyx_v_timeout_exc = values[2];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("wait_read", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 320, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.__hub_primitives.wait_read", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_16__hub_primitives_10wait_read(__pyx_self, __pyx_v_fileno, __pyx_v_timeout, __pyx_v_timeout_exc);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_16__hub_primitives_10wait_read(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_fileno, PyObject *__pyx_v_timeout, PyObject *__pyx_v_timeout_exc) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("wait_read", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_2.__pyx_n = 2;
+  __pyx_t_2.timeout = __pyx_v_timeout;
+  __pyx_t_2.timeout_exc = __pyx_v_timeout_exc;
+  __pyx_t_1 = __pyx_f_6gevent_16__hub_primitives_wait_read(__pyx_v_fileno, 0, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 320, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.__hub_primitives.wait_read", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_NONE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 320, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_k__3 = __pyx_t_1;
+  __Pyx_GIVEREF(__pyx_t_1);
+  __pyx_t_1 = 0;
+  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_NONE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 320, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_k__3 = __pyx_t_1;
+  __Pyx_GIVEREF(__pyx_t_1);
+  __pyx_t_1 = 0;
+/* … */
+  __pyx_tuple__29 = PyTuple_Pack(3, __pyx_n_s_fileno, __pyx_n_s_timeout, __pyx_n_s_timeout_exc); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(0, 320, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__29);
+  __Pyx_GIVEREF(__pyx_tuple__29);
+  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_16__hub_primitives_11wait_read, 0, __pyx_n_s_wait_read, NULL, __pyx_n_s_gevent___hub_primitives, __pyx_d, ((PyObject *)__pyx_codeobj__30)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 320, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_wait_read, __pyx_t_1) < 0) __PYX_ERR(0, 320, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_codeobj__30 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__29, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__hub_primitives_py, __pyx_n_s_wait_read, 320, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__30)) __PYX_ERR(0, 320, __pyx_L1_error)
+
 321:     """
+
 322:     wait_read(fileno, timeout=None, [timeout_exc=None]) -> None
+
 323: 
+
 324:     Block the current greenlet until *fileno* is ready to read.
+
 325: 
+
 326:     For the meaning of the other parameters and possible exceptions,
+
 327:     see :func:`wait`.
+
 328: 
+
 329:     .. seealso:: :func:`cancel_wait`
+
 330:     """
+
+331:     hub = get_hub()
+
  __pyx_t_1 = ((PyObject *)__pyx_f_6gevent_11__hub_local_get_hub_noargs(0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 331, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_v_hub = ((struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *)__pyx_t_1);
+  __pyx_t_1 = 0;
+
+332:     io = hub.loop.io(fileno, 1)
+
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_hub->loop, __pyx_n_s_io); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 332, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = NULL;
+  __pyx_t_4 = 0;
+  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+    if (likely(__pyx_t_3)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+      __Pyx_INCREF(__pyx_t_3);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_2, function);
+      __pyx_t_4 = 1;
+    }
+  }
+  #if CYTHON_FAST_PYCALL
+  if (PyFunction_Check(__pyx_t_2)) {
+    PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_fileno, __pyx_int_1};
+    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 332, __pyx_L1_error)
+    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __Pyx_GOTREF(__pyx_t_1);
+  } else
+  #endif
+  #if CYTHON_FAST_PYCCALL
+  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
+    PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_fileno, __pyx_int_1};
+    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 332, __pyx_L1_error)
+    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __Pyx_GOTREF(__pyx_t_1);
+  } else
+  #endif
+  {
+    __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 332, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_5);
+    if (__pyx_t_3) {
+      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
+    }
+    __Pyx_INCREF(__pyx_v_fileno);
+    __Pyx_GIVEREF(__pyx_v_fileno);
+    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_fileno);
+    __Pyx_INCREF(__pyx_int_1);
+    __Pyx_GIVEREF(__pyx_int_1);
+    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_int_1);
+    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 332, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+  }
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_v_io = __pyx_t_1;
+  __pyx_t_1 = 0;
+
+333:     try:
+
  /*try:*/ {
+
+334:         return wait_on_watcher(io, timeout, timeout_exc, hub)
+
    __Pyx_XDECREF(__pyx_r);
+    if (!(likely(((((PyObject *)__pyx_v_hub)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_hub), __pyx_ptype_6gevent_16__hub_primitives_WaitOperationsGreenlet))))) __PYX_ERR(0, 334, __pyx_L4_error)
+    __pyx_t_6.__pyx_n = 3;
+    __pyx_t_6.timeout = __pyx_v_timeout;
+    __pyx_t_6.timeout_exc = __pyx_v_timeout_exc;
+    __pyx_t_6.hub = ((struct __pyx_obj_6gevent_16__hub_primitives_WaitOperationsGreenlet *)__pyx_v_hub);
+    __pyx_t_1 = __pyx_f_6gevent_16__hub_primitives_wait_on_watcher(__pyx_v_io, 0, &__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 334, __pyx_L4_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __pyx_r = __pyx_t_1;
+    __pyx_t_1 = 0;
+    goto __pyx_L3_return;
+  }
+
 335:     finally:
+
+336:         io.close()
+
  /*finally:*/ {
+    __pyx_L4_error:;
+    /*exception exit:*/{
+      __Pyx_PyThreadState_declare
+      __Pyx_PyThreadState_assign
+      __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0;
+      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+      if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14);
+      if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11) < 0)) __Pyx_ErrFetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
+      __Pyx_XGOTREF(__pyx_t_9);
+      __Pyx_XGOTREF(__pyx_t_10);
+      __Pyx_XGOTREF(__pyx_t_11);
+      __Pyx_XGOTREF(__pyx_t_12);
+      __Pyx_XGOTREF(__pyx_t_13);
+      __Pyx_XGOTREF(__pyx_t_14);
+      __pyx_t_4 = __pyx_lineno; __pyx_t_7 = __pyx_clineno; __pyx_t_8 = __pyx_filename;
+      {
+        __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_io, __pyx_n_s_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 336, __pyx_L7_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        __pyx_t_5 = NULL;
+        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+          __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
+          if (likely(__pyx_t_5)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+            __Pyx_INCREF(__pyx_t_5);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_2, function);
+          }
+        }
+        __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
+        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+        if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 336, __pyx_L7_error)
+        __Pyx_GOTREF(__pyx_t_1);
+        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      }
+      if (PY_MAJOR_VERSION >= 3) {
+        __Pyx_XGIVEREF(__pyx_t_12);
+        __Pyx_XGIVEREF(__pyx_t_13);
+        __Pyx_XGIVEREF(__pyx_t_14);
+        __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14);
+      }
+      __Pyx_XGIVEREF(__pyx_t_9);
+      __Pyx_XGIVEREF(__pyx_t_10);
+      __Pyx_XGIVEREF(__pyx_t_11);
+      __Pyx_ErrRestore(__pyx_t_9, __pyx_t_10, __pyx_t_11);
+      __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0;
+      __pyx_lineno = __pyx_t_4; __pyx_clineno = __pyx_t_7; __pyx_filename = __pyx_t_8;
+      goto __pyx_L1_error;
+      __pyx_L7_error:;
+      if (PY_MAJOR_VERSION >= 3) {
+        __Pyx_XGIVEREF(__pyx_t_12);
+        __Pyx_XGIVEREF(__pyx_t_13);
+        __Pyx_XGIVEREF(__pyx_t_14);
+        __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14);
+      }
+      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
+      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
+      __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
+      __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0;
+      goto __pyx_L1_error;
+    }
+    __pyx_L3_return: {
+      __pyx_t_14 = __pyx_r;
+      __pyx_r = 0;
+      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_io, __pyx_n_s_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 336, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_2);
+      __pyx_t_5 = NULL;
+      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
+        if (likely(__pyx_t_5)) {
+          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+          __Pyx_INCREF(__pyx_t_5);
+          __Pyx_INCREF(function);
+          __Pyx_DECREF_SET(__pyx_t_2, function);
+        }
+      }
+      __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
+      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 336, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      __pyx_r = __pyx_t_14;
+      __pyx_t_14 = 0;
+      goto __pyx_L0;
+    }
+  }
+
 337: 
+
 338: 
+
+339: def wait_write(fileno, timeout=None, timeout_exc=_NONE, event=_NONE):
+
static PyObject *__pyx_pw_6gevent_16__hub_primitives_13wait_write(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_f_6gevent_16__hub_primitives_wait_write(PyObject *__pyx_v_fileno, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_16__hub_primitives_wait_write *__pyx_optional_args) {
+  PyObject *__pyx_v_timeout = ((PyObject *)Py_None);
+  PyObject *__pyx_v_timeout_exc = __pyx_k__4;
+  struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *__pyx_v_hub = NULL;
+  PyObject *__pyx_v_io = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("wait_write", 0);
+  if (__pyx_optional_args) {
+    if (__pyx_optional_args->__pyx_n > 0) {
+      __pyx_v_timeout = __pyx_optional_args->timeout;
+      if (__pyx_optional_args->__pyx_n > 1) {
+        __pyx_v_timeout_exc = __pyx_optional_args->timeout_exc;
+      }
+    }
+  }
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_AddTraceback("gevent.__hub_primitives.wait_write", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XDECREF((PyObject *)__pyx_v_hub);
+  __Pyx_XDECREF(__pyx_v_io);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_16__hub_primitives_13wait_write(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_6gevent_16__hub_primitives_12wait_write[] = "wait_write(fileno, timeout=None, timeout_exc=_NONE, event=_NONE)\n\n    wait_write(fileno, timeout=None, [timeout_exc=None]) -> None\n\n    Block the current greenlet until *fileno* is ready to write.\n\n    For the meaning of the other parameters and possible exceptions,\n    see :func:`wait`.\n\n    .. deprecated:: 1.1\n       The keyword argument *event* is ignored. Applications should not pass this parameter.\n       In the future, doing so will become an error.\n\n    .. seealso:: :func:`cancel_wait`\n    ";
+static PyMethodDef __pyx_mdef_6gevent_16__hub_primitives_13wait_write = {"wait_write", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_16__hub_primitives_13wait_write, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_16__hub_primitives_12wait_write};
+static PyObject *__pyx_pw_6gevent_16__hub_primitives_13wait_write(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_fileno = 0;
+  PyObject *__pyx_v_timeout = 0;
+  PyObject *__pyx_v_timeout_exc = 0;
+  PyObject *__pyx_v_event = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("wait_write (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_fileno,&__pyx_n_s_timeout,&__pyx_n_s_timeout_exc,&__pyx_n_s_event,0};
+    PyObject* values[4] = {0,0,0,0};
+    values[1] = ((PyObject *)Py_None);
+    values[2] = __pyx_k__4;
+    values[3] = __pyx_k__5;
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
+        CYTHON_FALLTHROUGH;
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_fileno)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_timeout);
+          if (value) { values[1] = value; kw_args--; }
+        }
+        CYTHON_FALLTHROUGH;
+        case  2:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_timeout_exc);
+          if (value) { values[2] = value; kw_args--; }
+        }
+        CYTHON_FALLTHROUGH;
+        case  3:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_event);
+          if (value) { values[3] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "wait_write") < 0)) __PYX_ERR(0, 339, __pyx_L3_error)
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
+        CYTHON_FALLTHROUGH;
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    __pyx_v_fileno = values[0];
+    __pyx_v_timeout = values[1];
+    __pyx_v_timeout_exc = values[2];
+    __pyx_v_event = values[3];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("wait_write", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 339, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.__hub_primitives.wait_write", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_16__hub_primitives_12wait_write(__pyx_self, __pyx_v_fileno, __pyx_v_timeout, __pyx_v_timeout_exc, __pyx_v_event);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_16__hub_primitives_12wait_write(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_fileno, PyObject *__pyx_v_timeout, PyObject *__pyx_v_timeout_exc, PyObject *__pyx_v_event) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("wait_write", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_2.__pyx_n = 3;
+  __pyx_t_2.timeout = __pyx_v_timeout;
+  __pyx_t_2.timeout_exc = __pyx_v_timeout_exc;
+  __pyx_t_2.event = __pyx_v_event;
+  __pyx_t_1 = __pyx_f_6gevent_16__hub_primitives_wait_write(__pyx_v_fileno, 0, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 339, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.__hub_primitives.wait_write", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_NONE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 339, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_k__4 = __pyx_t_1;
+  __Pyx_GIVEREF(__pyx_t_1);
+  __pyx_t_1 = 0;
+  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_NONE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 339, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_k__5 = __pyx_t_1;
+  __Pyx_GIVEREF(__pyx_t_1);
+  __pyx_t_1 = 0;
+  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_NONE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 339, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_k__4 = __pyx_t_1;
+  __Pyx_GIVEREF(__pyx_t_1);
+  __pyx_t_1 = 0;
+  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_NONE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 339, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_k__5 = __pyx_t_1;
+  __Pyx_GIVEREF(__pyx_t_1);
+  __pyx_t_1 = 0;
+/* … */
+  __pyx_tuple__31 = PyTuple_Pack(4, __pyx_n_s_fileno, __pyx_n_s_timeout, __pyx_n_s_timeout_exc, __pyx_n_s_event); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(0, 339, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__31);
+  __Pyx_GIVEREF(__pyx_tuple__31);
+  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_16__hub_primitives_13wait_write, 0, __pyx_n_s_wait_write, NULL, __pyx_n_s_gevent___hub_primitives, __pyx_d, ((PyObject *)__pyx_codeobj__32)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 339, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_wait_write, __pyx_t_1) < 0) __PYX_ERR(0, 339, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_codeobj__32 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__31, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__hub_primitives_py, __pyx_n_s_wait_write, 339, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__32)) __PYX_ERR(0, 339, __pyx_L1_error)
+
 340:     """
+
 341:     wait_write(fileno, timeout=None, [timeout_exc=None]) -> None
+
 342: 
+
 343:     Block the current greenlet until *fileno* is ready to write.
+
 344: 
+
 345:     For the meaning of the other parameters and possible exceptions,
+
 346:     see :func:`wait`.
+
 347: 
+
 348:     .. deprecated:: 1.1
+
 349:        The keyword argument *event* is ignored. Applications should not pass this parameter.
+
 350:        In the future, doing so will become an error.
+
 351: 
+
 352:     .. seealso:: :func:`cancel_wait`
+
 353:     """
+
 354:     # pylint:disable=unused-argument
+
+355:     hub = get_hub()
+
  __pyx_t_1 = ((PyObject *)__pyx_f_6gevent_11__hub_local_get_hub_noargs(0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 355, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_v_hub = ((struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *)__pyx_t_1);
+  __pyx_t_1 = 0;
+
+356:     io = hub.loop.io(fileno, 2)
+
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_hub->loop, __pyx_n_s_io); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 356, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = NULL;
+  __pyx_t_4 = 0;
+  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+    if (likely(__pyx_t_3)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+      __Pyx_INCREF(__pyx_t_3);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_2, function);
+      __pyx_t_4 = 1;
+    }
+  }
+  #if CYTHON_FAST_PYCALL
+  if (PyFunction_Check(__pyx_t_2)) {
+    PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_fileno, __pyx_int_2};
+    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 356, __pyx_L1_error)
+    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __Pyx_GOTREF(__pyx_t_1);
+  } else
+  #endif
+  #if CYTHON_FAST_PYCCALL
+  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
+    PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_fileno, __pyx_int_2};
+    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 356, __pyx_L1_error)
+    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __Pyx_GOTREF(__pyx_t_1);
+  } else
+  #endif
+  {
+    __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 356, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_5);
+    if (__pyx_t_3) {
+      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
+    }
+    __Pyx_INCREF(__pyx_v_fileno);
+    __Pyx_GIVEREF(__pyx_v_fileno);
+    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_fileno);
+    __Pyx_INCREF(__pyx_int_2);
+    __Pyx_GIVEREF(__pyx_int_2);
+    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_int_2);
+    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 356, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+  }
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_v_io = __pyx_t_1;
+  __pyx_t_1 = 0;
+
+357:     try:
+
  /*try:*/ {
+
+358:         return wait_on_watcher(io, timeout, timeout_exc, hub)
+
    __Pyx_XDECREF(__pyx_r);
+    if (!(likely(((((PyObject *)__pyx_v_hub)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_hub), __pyx_ptype_6gevent_16__hub_primitives_WaitOperationsGreenlet))))) __PYX_ERR(0, 358, __pyx_L4_error)
+    __pyx_t_6.__pyx_n = 3;
+    __pyx_t_6.timeout = __pyx_v_timeout;
+    __pyx_t_6.timeout_exc = __pyx_v_timeout_exc;
+    __pyx_t_6.hub = ((struct __pyx_obj_6gevent_16__hub_primitives_WaitOperationsGreenlet *)__pyx_v_hub);
+    __pyx_t_1 = __pyx_f_6gevent_16__hub_primitives_wait_on_watcher(__pyx_v_io, 0, &__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 358, __pyx_L4_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __pyx_r = __pyx_t_1;
+    __pyx_t_1 = 0;
+    goto __pyx_L3_return;
+  }
+
 359:     finally:
+
+360:         io.close()
+
  /*finally:*/ {
+    __pyx_L4_error:;
+    /*exception exit:*/{
+      __Pyx_PyThreadState_declare
+      __Pyx_PyThreadState_assign
+      __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0;
+      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+      if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14);
+      if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11) < 0)) __Pyx_ErrFetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
+      __Pyx_XGOTREF(__pyx_t_9);
+      __Pyx_XGOTREF(__pyx_t_10);
+      __Pyx_XGOTREF(__pyx_t_11);
+      __Pyx_XGOTREF(__pyx_t_12);
+      __Pyx_XGOTREF(__pyx_t_13);
+      __Pyx_XGOTREF(__pyx_t_14);
+      __pyx_t_4 = __pyx_lineno; __pyx_t_7 = __pyx_clineno; __pyx_t_8 = __pyx_filename;
+      {
+        __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_io, __pyx_n_s_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 360, __pyx_L7_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        __pyx_t_5 = NULL;
+        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+          __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
+          if (likely(__pyx_t_5)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+            __Pyx_INCREF(__pyx_t_5);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_2, function);
+          }
+        }
+        __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
+        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+        if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 360, __pyx_L7_error)
+        __Pyx_GOTREF(__pyx_t_1);
+        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      }
+      if (PY_MAJOR_VERSION >= 3) {
+        __Pyx_XGIVEREF(__pyx_t_12);
+        __Pyx_XGIVEREF(__pyx_t_13);
+        __Pyx_XGIVEREF(__pyx_t_14);
+        __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14);
+      }
+      __Pyx_XGIVEREF(__pyx_t_9);
+      __Pyx_XGIVEREF(__pyx_t_10);
+      __Pyx_XGIVEREF(__pyx_t_11);
+      __Pyx_ErrRestore(__pyx_t_9, __pyx_t_10, __pyx_t_11);
+      __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0;
+      __pyx_lineno = __pyx_t_4; __pyx_clineno = __pyx_t_7; __pyx_filename = __pyx_t_8;
+      goto __pyx_L1_error;
+      __pyx_L7_error:;
+      if (PY_MAJOR_VERSION >= 3) {
+        __Pyx_XGIVEREF(__pyx_t_12);
+        __Pyx_XGIVEREF(__pyx_t_13);
+        __Pyx_XGIVEREF(__pyx_t_14);
+        __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14);
+      }
+      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
+      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
+      __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
+      __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0;
+      goto __pyx_L1_error;
+    }
+    __pyx_L3_return: {
+      __pyx_t_14 = __pyx_r;
+      __pyx_r = 0;
+      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_io, __pyx_n_s_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 360, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_2);
+      __pyx_t_5 = NULL;
+      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
+        if (likely(__pyx_t_5)) {
+          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+          __Pyx_INCREF(__pyx_t_5);
+          __Pyx_INCREF(function);
+          __Pyx_DECREF_SET(__pyx_t_2, function);
+        }
+      }
+      __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
+      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 360, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      __pyx_r = __pyx_t_14;
+      __pyx_t_14 = 0;
+      goto __pyx_L0;
+    }
+  }
+
 361: 
+
 362: 
+
+363: def wait_readwrite(fileno, timeout=None, timeout_exc=_NONE, event=_NONE):
+
static PyObject *__pyx_pw_6gevent_16__hub_primitives_15wait_readwrite(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_f_6gevent_16__hub_primitives_wait_readwrite(PyObject *__pyx_v_fileno, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_16__hub_primitives_wait_readwrite *__pyx_optional_args) {
+  PyObject *__pyx_v_timeout = ((PyObject *)Py_None);
+  PyObject *__pyx_v_timeout_exc = __pyx_k__6;
+  struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *__pyx_v_hub = NULL;
+  PyObject *__pyx_v_io = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("wait_readwrite", 0);
+  if (__pyx_optional_args) {
+    if (__pyx_optional_args->__pyx_n > 0) {
+      __pyx_v_timeout = __pyx_optional_args->timeout;
+      if (__pyx_optional_args->__pyx_n > 1) {
+        __pyx_v_timeout_exc = __pyx_optional_args->timeout_exc;
+      }
+    }
+  }
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_AddTraceback("gevent.__hub_primitives.wait_readwrite", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XDECREF((PyObject *)__pyx_v_hub);
+  __Pyx_XDECREF(__pyx_v_io);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_16__hub_primitives_15wait_readwrite(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_6gevent_16__hub_primitives_14wait_readwrite[] = "wait_readwrite(fileno, timeout=None, timeout_exc=_NONE, event=_NONE)\n\n    wait_readwrite(fileno, timeout=None, [timeout_exc=None]) -> None\n\n    Block the current greenlet until *fileno* is ready to read or\n    write.\n\n    For the meaning of the other parameters and possible exceptions,\n    see :func:`wait`.\n\n    .. deprecated:: 1.1\n       The keyword argument *event* is ignored. Applications should not pass this parameter.\n       In the future, doing so will become an error.\n\n    .. seealso:: :func:`cancel_wait`\n    ";
+static PyMethodDef __pyx_mdef_6gevent_16__hub_primitives_15wait_readwrite = {"wait_readwrite", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_16__hub_primitives_15wait_readwrite, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_16__hub_primitives_14wait_readwrite};
+static PyObject *__pyx_pw_6gevent_16__hub_primitives_15wait_readwrite(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_fileno = 0;
+  PyObject *__pyx_v_timeout = 0;
+  PyObject *__pyx_v_timeout_exc = 0;
+  PyObject *__pyx_v_event = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("wait_readwrite (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_fileno,&__pyx_n_s_timeout,&__pyx_n_s_timeout_exc,&__pyx_n_s_event,0};
+    PyObject* values[4] = {0,0,0,0};
+    values[1] = ((PyObject *)Py_None);
+    values[2] = __pyx_k__6;
+    values[3] = __pyx_k__7;
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
+        CYTHON_FALLTHROUGH;
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_fileno)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_timeout);
+          if (value) { values[1] = value; kw_args--; }
+        }
+        CYTHON_FALLTHROUGH;
+        case  2:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_timeout_exc);
+          if (value) { values[2] = value; kw_args--; }
+        }
+        CYTHON_FALLTHROUGH;
+        case  3:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_event);
+          if (value) { values[3] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "wait_readwrite") < 0)) __PYX_ERR(0, 363, __pyx_L3_error)
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
+        CYTHON_FALLTHROUGH;
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    __pyx_v_fileno = values[0];
+    __pyx_v_timeout = values[1];
+    __pyx_v_timeout_exc = values[2];
+    __pyx_v_event = values[3];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("wait_readwrite", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 363, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.__hub_primitives.wait_readwrite", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_16__hub_primitives_14wait_readwrite(__pyx_self, __pyx_v_fileno, __pyx_v_timeout, __pyx_v_timeout_exc, __pyx_v_event);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_16__hub_primitives_14wait_readwrite(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_fileno, PyObject *__pyx_v_timeout, PyObject *__pyx_v_timeout_exc, PyObject *__pyx_v_event) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("wait_readwrite", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_2.__pyx_n = 3;
+  __pyx_t_2.timeout = __pyx_v_timeout;
+  __pyx_t_2.timeout_exc = __pyx_v_timeout_exc;
+  __pyx_t_2.event = __pyx_v_event;
+  __pyx_t_1 = __pyx_f_6gevent_16__hub_primitives_wait_readwrite(__pyx_v_fileno, 0, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 363, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.__hub_primitives.wait_readwrite", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_NONE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 363, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_k__6 = __pyx_t_1;
+  __Pyx_GIVEREF(__pyx_t_1);
+  __pyx_t_1 = 0;
+  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_NONE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 363, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_k__7 = __pyx_t_1;
+  __Pyx_GIVEREF(__pyx_t_1);
+  __pyx_t_1 = 0;
+  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_NONE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 363, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_k__6 = __pyx_t_1;
+  __Pyx_GIVEREF(__pyx_t_1);
+  __pyx_t_1 = 0;
+  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_NONE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 363, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_k__7 = __pyx_t_1;
+  __Pyx_GIVEREF(__pyx_t_1);
+  __pyx_t_1 = 0;
+/* … */
+  __pyx_tuple__33 = PyTuple_Pack(4, __pyx_n_s_fileno, __pyx_n_s_timeout, __pyx_n_s_timeout_exc, __pyx_n_s_event); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(0, 363, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__33);
+  __Pyx_GIVEREF(__pyx_tuple__33);
+  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_16__hub_primitives_15wait_readwrite, 0, __pyx_n_s_wait_readwrite, NULL, __pyx_n_s_gevent___hub_primitives, __pyx_d, ((PyObject *)__pyx_codeobj__34)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 363, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_wait_readwrite, __pyx_t_1) < 0) __PYX_ERR(0, 363, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_codeobj__34 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__33, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__hub_primitives_py, __pyx_n_s_wait_readwrite, 363, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__34)) __PYX_ERR(0, 363, __pyx_L1_error)
+
 364:     """
+
 365:     wait_readwrite(fileno, timeout=None, [timeout_exc=None]) -> None
+
 366: 
+
 367:     Block the current greenlet until *fileno* is ready to read or
+
 368:     write.
+
 369: 
+
 370:     For the meaning of the other parameters and possible exceptions,
+
 371:     see :func:`wait`.
+
 372: 
+
 373:     .. deprecated:: 1.1
+
 374:        The keyword argument *event* is ignored. Applications should not pass this parameter.
+
 375:        In the future, doing so will become an error.
+
 376: 
+
 377:     .. seealso:: :func:`cancel_wait`
+
 378:     """
+
 379:     # pylint:disable=unused-argument
+
+380:     hub = get_hub()
+
  __pyx_t_1 = ((PyObject *)__pyx_f_6gevent_11__hub_local_get_hub_noargs(0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 380, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_v_hub = ((struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *)__pyx_t_1);
+  __pyx_t_1 = 0;
+
+381:     io = hub.loop.io(fileno, 3)
+
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_hub->loop, __pyx_n_s_io); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 381, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = NULL;
+  __pyx_t_4 = 0;
+  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+    if (likely(__pyx_t_3)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+      __Pyx_INCREF(__pyx_t_3);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_2, function);
+      __pyx_t_4 = 1;
+    }
+  }
+  #if CYTHON_FAST_PYCALL
+  if (PyFunction_Check(__pyx_t_2)) {
+    PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_fileno, __pyx_int_3};
+    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 381, __pyx_L1_error)
+    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __Pyx_GOTREF(__pyx_t_1);
+  } else
+  #endif
+  #if CYTHON_FAST_PYCCALL
+  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
+    PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_fileno, __pyx_int_3};
+    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 381, __pyx_L1_error)
+    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __Pyx_GOTREF(__pyx_t_1);
+  } else
+  #endif
+  {
+    __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 381, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_5);
+    if (__pyx_t_3) {
+      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
+    }
+    __Pyx_INCREF(__pyx_v_fileno);
+    __Pyx_GIVEREF(__pyx_v_fileno);
+    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_fileno);
+    __Pyx_INCREF(__pyx_int_3);
+    __Pyx_GIVEREF(__pyx_int_3);
+    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_int_3);
+    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 381, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+  }
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_v_io = __pyx_t_1;
+  __pyx_t_1 = 0;
+
+382:     try:
+
  /*try:*/ {
+
+383:         return wait_on_watcher(io, timeout, timeout_exc, hub)
+
    __Pyx_XDECREF(__pyx_r);
+    if (!(likely(((((PyObject *)__pyx_v_hub)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_hub), __pyx_ptype_6gevent_16__hub_primitives_WaitOperationsGreenlet))))) __PYX_ERR(0, 383, __pyx_L4_error)
+    __pyx_t_6.__pyx_n = 3;
+    __pyx_t_6.timeout = __pyx_v_timeout;
+    __pyx_t_6.timeout_exc = __pyx_v_timeout_exc;
+    __pyx_t_6.hub = ((struct __pyx_obj_6gevent_16__hub_primitives_WaitOperationsGreenlet *)__pyx_v_hub);
+    __pyx_t_1 = __pyx_f_6gevent_16__hub_primitives_wait_on_watcher(__pyx_v_io, 0, &__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 383, __pyx_L4_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __pyx_r = __pyx_t_1;
+    __pyx_t_1 = 0;
+    goto __pyx_L3_return;
+  }
+
 384:     finally:
+
+385:         io.close()
+
  /*finally:*/ {
+    __pyx_L4_error:;
+    /*exception exit:*/{
+      __Pyx_PyThreadState_declare
+      __Pyx_PyThreadState_assign
+      __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0;
+      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+      if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14);
+      if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11) < 0)) __Pyx_ErrFetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
+      __Pyx_XGOTREF(__pyx_t_9);
+      __Pyx_XGOTREF(__pyx_t_10);
+      __Pyx_XGOTREF(__pyx_t_11);
+      __Pyx_XGOTREF(__pyx_t_12);
+      __Pyx_XGOTREF(__pyx_t_13);
+      __Pyx_XGOTREF(__pyx_t_14);
+      __pyx_t_4 = __pyx_lineno; __pyx_t_7 = __pyx_clineno; __pyx_t_8 = __pyx_filename;
+      {
+        __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_io, __pyx_n_s_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 385, __pyx_L7_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        __pyx_t_5 = NULL;
+        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+          __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
+          if (likely(__pyx_t_5)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+            __Pyx_INCREF(__pyx_t_5);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_2, function);
+          }
+        }
+        __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
+        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+        if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 385, __pyx_L7_error)
+        __Pyx_GOTREF(__pyx_t_1);
+        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      }
+      if (PY_MAJOR_VERSION >= 3) {
+        __Pyx_XGIVEREF(__pyx_t_12);
+        __Pyx_XGIVEREF(__pyx_t_13);
+        __Pyx_XGIVEREF(__pyx_t_14);
+        __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14);
+      }
+      __Pyx_XGIVEREF(__pyx_t_9);
+      __Pyx_XGIVEREF(__pyx_t_10);
+      __Pyx_XGIVEREF(__pyx_t_11);
+      __Pyx_ErrRestore(__pyx_t_9, __pyx_t_10, __pyx_t_11);
+      __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0;
+      __pyx_lineno = __pyx_t_4; __pyx_clineno = __pyx_t_7; __pyx_filename = __pyx_t_8;
+      goto __pyx_L1_error;
+      __pyx_L7_error:;
+      if (PY_MAJOR_VERSION >= 3) {
+        __Pyx_XGIVEREF(__pyx_t_12);
+        __Pyx_XGIVEREF(__pyx_t_13);
+        __Pyx_XGIVEREF(__pyx_t_14);
+        __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14);
+      }
+      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
+      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
+      __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
+      __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0;
+      goto __pyx_L1_error;
+    }
+    __pyx_L3_return: {
+      __pyx_t_14 = __pyx_r;
+      __pyx_r = 0;
+      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_io, __pyx_n_s_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 385, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_2);
+      __pyx_t_5 = NULL;
+      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
+        if (likely(__pyx_t_5)) {
+          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+          __Pyx_INCREF(__pyx_t_5);
+          __Pyx_INCREF(function);
+          __Pyx_DECREF_SET(__pyx_t_2, function);
+        }
+      }
+      __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
+      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 385, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      __pyx_r = __pyx_t_14;
+      __pyx_t_14 = 0;
+      goto __pyx_L0;
+    }
+  }
+
 386: 
+
 387: 
+
+388: def _init():
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_16__hub_primitives_17_init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6gevent_16__hub_primitives_16_init[] = "_init()";
+static PyMethodDef __pyx_mdef_6gevent_16__hub_primitives_17_init = {"_init", (PyCFunction)__pyx_pw_6gevent_16__hub_primitives_17_init, METH_NOARGS, __pyx_doc_6gevent_16__hub_primitives_16_init};
+static PyObject *__pyx_pw_6gevent_16__hub_primitives_17_init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_init (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_16__hub_primitives_16_init(__pyx_self);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_16__hub_primitives_16_init(CYTHON_UNUSED PyObject *__pyx_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_init", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_16__hub_primitives_17_init, 0, __pyx_n_s_init, NULL, __pyx_n_s_gevent___hub_primitives, __pyx_d, ((PyObject *)__pyx_codeobj__35)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 388, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_init, __pyx_t_1) < 0) __PYX_ERR(0, 388, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+389:     greenlet_init() # pylint:disable=undefined-variable
+
  __pyx_f_6gevent_16__hub_primitives_greenlet_init();
+
 390: 
+
+391: _init()
+
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_init); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 391, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 391, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
 392: 
+
+393: from gevent._util import import_c_accel
+
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 393, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_import_c_accel);
+  __Pyx_GIVEREF(__pyx_n_s_import_c_accel);
+  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_import_c_accel);
+  __pyx_t_1 = __Pyx_Import(__pyx_n_s_gevent__util, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 393, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_import_c_accel); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 393, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_import_c_accel, __pyx_t_2) < 0) __PYX_ERR(0, 393, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+394: import_c_accel(globals(), 'gevent.__hub_primitives')
+
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_import_c_accel); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 394, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = __Pyx_Globals(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 394, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 394, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_GIVEREF(__pyx_t_2);
+  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_gevent___hub_primitives);
+  __Pyx_GIVEREF(__pyx_n_s_gevent___hub_primitives);
+  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_n_s_gevent___hub_primitives);
+  __pyx_t_2 = 0;
+  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 394, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_hub_primitives.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_hub_primitives.py new file mode 100644 index 00000000..490c7a6b --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_hub_primitives.py @@ -0,0 +1,394 @@ +# -*- coding: utf-8 -*- +# copyright (c) 2018 gevent. See LICENSE. +# cython: auto_pickle=False,embedsignature=True,always_allow_keywords=False,binding=True +""" +A collection of primitives used by the hub, and suitable for +compilation with Cython because of their frequency of use. + + +""" +from __future__ import absolute_import +from __future__ import division +from __future__ import print_function + +import traceback + +from gevent.exceptions import InvalidSwitchError +from gevent.exceptions import ConcurrentObjectUseError + +from gevent import _greenlet_primitives +from gevent import _waiter +from gevent._util import _NONE +from gevent._hub_local import get_hub_noargs as get_hub +from gevent.timeout import Timeout + +# In Cython, we define these as 'cdef inline' functions. The +# compilation unit cannot have a direct assignment to them (import +# is assignment) without generating a 'lvalue is not valid target' +# error. +locals()['getcurrent'] = __import__('greenlet').getcurrent +locals()['greenlet_init'] = lambda: None +locals()['Waiter'] = _waiter.Waiter +locals()['MultipleWaiter'] = _waiter.MultipleWaiter +locals()['SwitchOutGreenletWithLoop'] = _greenlet_primitives.SwitchOutGreenletWithLoop + +__all__ = [ + 'WaitOperationsGreenlet', + 'iwait_on_objects', + 'wait_on_objects', + 'wait_read', + 'wait_write', + 'wait_readwrite', +] + +class WaitOperationsGreenlet(SwitchOutGreenletWithLoop): # pylint:disable=undefined-variable + + def wait(self, watcher): + """ + Wait until the *watcher* (which must not be started) is ready. + + The current greenlet will be unscheduled during this time. + """ + waiter = Waiter(self) # pylint:disable=undefined-variable + watcher.start(waiter.switch, waiter) + try: + result = waiter.get() + if result is not waiter: + raise InvalidSwitchError('Invalid switch into %s: %r (expected %r)' % ( + getcurrent(), # pylint:disable=undefined-variable + result, waiter)) + finally: + watcher.stop() + + def cancel_wait(self, watcher, error, close_watcher=False): + """ + Cancel an in-progress call to :meth:`wait` by throwing the given *error* + in the waiting greenlet. + + .. versionchanged:: 1.3a1 + Added the *close_watcher* parameter. If true, the watcher + will be closed after the exception is thrown. The watcher should then + be discarded. Closing the watcher is important to release native resources. + .. versionchanged:: 1.3a2 + Allow the *watcher* to be ``None``. No action is taken in that case. + """ + if watcher is None: + # Presumably already closed. + # See https://github.com/gevent/gevent/issues/1089 + return + if watcher.callback is not None: + self.loop.run_callback(self._cancel_wait, watcher, error, close_watcher) + elif close_watcher: + watcher.close() + + def _cancel_wait(self, watcher, error, close_watcher): + # We have to check again to see if it was still active by the time + # our callback actually runs. + active = watcher.active + cb = watcher.callback + if close_watcher: + watcher.close() + if active: + # The callback should be greenlet.switch(). It may or may not be None. + glet = getattr(cb, '__self__', None) + if glet is not None: + glet.throw(error) + + +class _WaitIterator(object): + + def __init__(self, objects, hub, timeout, count): + self._hub = hub + self._waiter = MultipleWaiter(hub) # pylint:disable=undefined-variable + self._switch = self._waiter.switch + self._timeout = timeout + self._objects = objects + + self._timer = None + self._begun = False + + # Even if we're only going to return 1 object, + # we must still rawlink() *all* of them, so that no + # matter which one finishes first we find it. + self._count = len(objects) if count is None else min(count, len(objects)) + + def _begin(self): + if self._begun: + return + + self._begun = True + + # XXX: If iteration doesn't actually happen, we + # could leave these links around! + for obj in self._objects: + obj.rawlink(self._switch) + + if self._timeout is not None: + self._timer = self._hub.loop.timer(self._timeout, priority=-1) + self._timer.start(self._switch, self) + + def __iter__(self): + return self + + def __next__(self): + self._begin() + + if self._count == 0: + # Exhausted + self._cleanup() + raise StopIteration() + + self._count -= 1 + try: + item = self._waiter.get() + self._waiter.clear() + if item is self: + # Timer expired, no more + self._cleanup() + raise StopIteration() + return item + except: + self._cleanup() + raise + + next = __next__ + + def _cleanup(self): + if self._timer is not None: + self._timer.close() + self._timer = None + + objs = self._objects + self._objects = () + for aobj in objs: + unlink = getattr(aobj, 'unlink', None) + if unlink is not None: + try: + unlink(self._switch) + except: # pylint:disable=bare-except + traceback.print_exc() + + def __enter__(self): + return self + + def __exit__(self, typ, value, tb): + self._cleanup() + + +def iwait_on_objects(objects, timeout=None, count=None): + """ + Iteratively yield *objects* as they are ready, until all (or *count*) are ready + or *timeout* expired. + + If you will only be consuming a portion of the *objects*, you should + do so inside a ``with`` block on this object to avoid leaking resources:: + + with gevent.iwait((a, b, c)) as it: + for i in it: + if i is a: + break + + :param objects: A sequence (supporting :func:`len`) containing objects + implementing the wait protocol (rawlink() and unlink()). + :keyword int count: If not `None`, then a number specifying the maximum number + of objects to wait for. If ``None`` (the default), all objects + are waited for. + :keyword float timeout: If given, specifies a maximum number of seconds + to wait. If the timeout expires before the desired waited-for objects + are available, then this method returns immediately. + + .. seealso:: :func:`wait` + + .. versionchanged:: 1.1a1 + Add the *count* parameter. + .. versionchanged:: 1.1a2 + No longer raise :exc:`LoopExit` if our caller switches greenlets + in between items yielded by this function. + .. versionchanged:: 1.4 + Add support to use the returned object as a context manager. + """ + # QQQ would be nice to support iterable here that can be generated slowly (why?) + hub = get_hub() + if objects is None: + return [hub.join(timeout=timeout)] + return _WaitIterator(objects, hub, timeout, count) + + +def wait_on_objects(objects=None, timeout=None, count=None): + """ + Wait for ``objects`` to become ready or for event loop to finish. + + If ``objects`` is provided, it must be a list containing objects + implementing the wait protocol (rawlink() and unlink() methods): + + - :class:`gevent.Greenlet` instance + - :class:`gevent.event.Event` instance + - :class:`gevent.lock.Semaphore` instance + - :class:`gevent.subprocess.Popen` instance + + If ``objects`` is ``None`` (the default), ``wait()`` blocks until + the current event loop has nothing to do (or until ``timeout`` passes): + + - all greenlets have finished + - all servers were stopped + - all event loop watchers were stopped. + + If ``count`` is ``None`` (the default), wait for all ``objects`` + to become ready. + + If ``count`` is a number, wait for (up to) ``count`` objects to become + ready. (For example, if count is ``1`` then the function exits + when any object in the list is ready). + + If ``timeout`` is provided, it specifies the maximum number of + seconds ``wait()`` will block. + + Returns the list of ready objects, in the order in which they were + ready. + + .. seealso:: :func:`iwait` + """ + if objects is None: + hub = get_hub() + return hub.join(timeout=timeout) # pylint:disable= + return list(iwait_on_objects(objects, timeout, count)) + +_timeout_error = Exception + +def set_default_timeout_error(e): + global _timeout_error + _timeout_error = e + +def _primitive_wait(watcher, timeout, timeout_exc, hub): + if watcher.callback is not None: + raise ConcurrentObjectUseError('This socket is already used by another greenlet: %r' + % (watcher.callback, )) + + if hub is None: + hub = get_hub() + + if timeout is None: + hub.wait(watcher) + return + + timeout = Timeout._start_new_or_dummy( + timeout, + (timeout_exc + if timeout_exc is not _NONE or timeout is None + else _timeout_error('timed out'))) + + with timeout: + hub.wait(watcher) + +# Suitable to be bound as an instance method +def wait_on_socket(socket, watcher, timeout_exc=None): + if socket is None or watcher is None: + # test__hub TestCloseSocketWhilePolling, on Python 2; Python 3 + # catches the EBADF differently. + raise ConcurrentObjectUseError("The socket has already been closed by another greenlet") + _primitive_wait(watcher, socket.timeout, + timeout_exc if timeout_exc is not None else _NONE, + socket.hub) + +def wait_on_watcher(watcher, timeout=None, timeout_exc=_NONE, hub=None): + """ + wait(watcher, timeout=None, [timeout_exc=None]) -> None + + Block the current greenlet until *watcher* is ready. + + If *timeout* is non-negative, then *timeout_exc* is raised after + *timeout* second has passed. + + If :func:`cancel_wait` is called on *io* by another greenlet, + raise an exception in this blocking greenlet + (``socket.error(EBADF, 'File descriptor was closed in another + greenlet')`` by default). + + :param io: An event loop watcher, most commonly an IO watcher obtained from + :meth:`gevent.core.loop.io` + :keyword timeout_exc: The exception to raise if the timeout expires. + By default, a :class:`socket.timeout` exception is raised. + If you pass a value for this keyword, it is interpreted as for + :class:`gevent.timeout.Timeout`. + + :raises ~gevent.hub.ConcurrentObjectUseError: If the *watcher* is + already started. + """ + _primitive_wait(watcher, timeout, timeout_exc, hub) + + +def wait_read(fileno, timeout=None, timeout_exc=_NONE): + """ + wait_read(fileno, timeout=None, [timeout_exc=None]) -> None + + Block the current greenlet until *fileno* is ready to read. + + For the meaning of the other parameters and possible exceptions, + see :func:`wait`. + + .. seealso:: :func:`cancel_wait` + """ + hub = get_hub() + io = hub.loop.io(fileno, 1) + try: + return wait_on_watcher(io, timeout, timeout_exc, hub) + finally: + io.close() + + +def wait_write(fileno, timeout=None, timeout_exc=_NONE, event=_NONE): + """ + wait_write(fileno, timeout=None, [timeout_exc=None]) -> None + + Block the current greenlet until *fileno* is ready to write. + + For the meaning of the other parameters and possible exceptions, + see :func:`wait`. + + .. deprecated:: 1.1 + The keyword argument *event* is ignored. Applications should not pass this parameter. + In the future, doing so will become an error. + + .. seealso:: :func:`cancel_wait` + """ + # pylint:disable=unused-argument + hub = get_hub() + io = hub.loop.io(fileno, 2) + try: + return wait_on_watcher(io, timeout, timeout_exc, hub) + finally: + io.close() + + +def wait_readwrite(fileno, timeout=None, timeout_exc=_NONE, event=_NONE): + """ + wait_readwrite(fileno, timeout=None, [timeout_exc=None]) -> None + + Block the current greenlet until *fileno* is ready to read or + write. + + For the meaning of the other parameters and possible exceptions, + see :func:`wait`. + + .. deprecated:: 1.1 + The keyword argument *event* is ignored. Applications should not pass this parameter. + In the future, doing so will become an error. + + .. seealso:: :func:`cancel_wait` + """ + # pylint:disable=unused-argument + hub = get_hub() + io = hub.loop.io(fileno, 3) + try: + return wait_on_watcher(io, timeout, timeout_exc, hub) + finally: + io.close() + + +def _init(): + greenlet_init() # pylint:disable=undefined-variable + +_init() + +from gevent._util import import_c_accel +import_c_accel(globals(), 'gevent.__hub_primitives') diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_ident.c b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_ident.c new file mode 100644 index 00000000..07c780f2 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_ident.c @@ -0,0 +1,5548 @@ +/* Generated by Cython 0.29.2 */ + +/* BEGIN: Cython Metadata +{ + "distutils": { + "depends": [ + "src/gevent/__ident.pxd", + "src\\gevent\\__ident.pxd" + ], + "include_dirs": [ + "C:\\Python37-x64\\Include", + "deps" + ], + "name": "gevent.__ident", + "sources": [ + "src/gevent/_ident.py" + ] + }, + "module_name": "gevent.__ident" +} +END: Cython Metadata */ + +#define PY_SSIZE_T_CLEAN +#include "Python.h" +#ifndef Py_PYTHON_H + #error Python headers needed to compile C extensions, please install development version of Python. +#elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) + #error Cython requires Python 2.6+ or Python 3.3+. +#else +#define CYTHON_ABI "0_29_2" +#define CYTHON_HEX_VERSION 0x001D02F0 +#define CYTHON_FUTURE_DIVISION 1 +#include +#ifndef offsetof + #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) +#endif +#if !defined(WIN32) && !defined(MS_WINDOWS) + #ifndef __stdcall + #define __stdcall + #endif + #ifndef __cdecl + #define __cdecl + #endif + #ifndef __fastcall + #define __fastcall + #endif +#endif +#ifndef DL_IMPORT + #define DL_IMPORT(t) t +#endif +#ifndef DL_EXPORT + #define DL_EXPORT(t) t +#endif +#define __PYX_COMMA , +#ifndef HAVE_LONG_LONG + #if PY_VERSION_HEX >= 0x02070000 + #define HAVE_LONG_LONG + #endif +#endif +#ifndef PY_LONG_LONG + #define PY_LONG_LONG LONG_LONG +#endif +#ifndef Py_HUGE_VAL + #define Py_HUGE_VAL HUGE_VAL +#endif +#ifdef PYPY_VERSION + #define CYTHON_COMPILING_IN_PYPY 1 + #define CYTHON_COMPILING_IN_PYSTON 0 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #undef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 0 + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #if PY_VERSION_HEX < 0x03050000 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #elif !defined(CYTHON_USE_ASYNC_SLOTS) + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #undef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 0 + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #undef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 1 + #undef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 0 + #undef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 0 + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #undef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE 0 + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 +#elif defined(PYSTON_VERSION) + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_PYSTON 1 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #ifndef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 1 + #endif + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #ifndef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 1 + #endif + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #ifndef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 0 + #endif + #ifndef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 1 + #endif + #ifndef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 1 + #endif + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #undef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE 0 + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 +#else + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_PYSTON 0 + #define CYTHON_COMPILING_IN_CPYTHON 1 + #ifndef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 1 + #endif + #if PY_VERSION_HEX < 0x02070000 + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #elif !defined(CYTHON_USE_PYTYPE_LOOKUP) + #define CYTHON_USE_PYTYPE_LOOKUP 1 + #endif + #if PY_MAJOR_VERSION < 3 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #elif !defined(CYTHON_USE_ASYNC_SLOTS) + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #if PY_VERSION_HEX < 0x02070000 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #elif !defined(CYTHON_USE_PYLONG_INTERNALS) + #define CYTHON_USE_PYLONG_INTERNALS 1 + #endif + #ifndef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 1 + #endif + #ifndef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 1 + #endif + #if PY_VERSION_HEX < 0x030300F0 + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #elif !defined(CYTHON_USE_UNICODE_WRITER) + #define CYTHON_USE_UNICODE_WRITER 1 + #endif + #ifndef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 0 + #endif + #ifndef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 1 + #endif + #ifndef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 1 + #endif + #ifndef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 1 + #endif + #ifndef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 1 + #endif + #ifndef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000) + #endif + #ifndef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1) + #endif + #ifndef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1) + #endif + #ifndef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3) + #endif +#endif +#if !defined(CYTHON_FAST_PYCCALL) +#define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) +#endif +#if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #undef SHIFT + #undef BASE + #undef MASK + #ifdef SIZEOF_VOID_P + enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) }; + #endif +#endif +#ifndef __has_attribute + #define __has_attribute(x) 0 +#endif +#ifndef __has_cpp_attribute + #define __has_cpp_attribute(x) 0 +#endif +#ifndef CYTHON_RESTRICT + #if defined(__GNUC__) + #define CYTHON_RESTRICT __restrict__ + #elif defined(_MSC_VER) && _MSC_VER >= 1400 + #define CYTHON_RESTRICT __restrict + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_RESTRICT restrict + #else + #define CYTHON_RESTRICT + #endif +#endif +#ifndef CYTHON_UNUSED +# if defined(__GNUC__) +# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +#endif +#ifndef CYTHON_MAYBE_UNUSED_VAR +# if defined(__cplusplus) + template void CYTHON_MAYBE_UNUSED_VAR( const T& ) { } +# else +# define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x) +# endif +#endif +#ifndef CYTHON_NCP_UNUSED +# if CYTHON_COMPILING_IN_CPYTHON +# define CYTHON_NCP_UNUSED +# else +# define CYTHON_NCP_UNUSED CYTHON_UNUSED +# endif +#endif +#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) +#ifdef _MSC_VER + #ifndef _MSC_STDINT_H_ + #if _MSC_VER < 1300 + typedef unsigned char uint8_t; + typedef unsigned int uint32_t; + #else + typedef unsigned __int8 uint8_t; + typedef unsigned __int32 uint32_t; + #endif + #endif +#else + #include +#endif +#ifndef CYTHON_FALLTHROUGH + #if defined(__cplusplus) && __cplusplus >= 201103L + #if __has_cpp_attribute(fallthrough) + #define CYTHON_FALLTHROUGH [[fallthrough]] + #elif __has_cpp_attribute(clang::fallthrough) + #define CYTHON_FALLTHROUGH [[clang::fallthrough]] + #elif __has_cpp_attribute(gnu::fallthrough) + #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] + #endif + #endif + #ifndef CYTHON_FALLTHROUGH + #if __has_attribute(fallthrough) + #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) + #else + #define CYTHON_FALLTHROUGH + #endif + #endif + #if defined(__clang__ ) && defined(__apple_build_version__) + #if __apple_build_version__ < 7000000 + #undef CYTHON_FALLTHROUGH + #define CYTHON_FALLTHROUGH + #endif + #endif +#endif + +#ifndef CYTHON_INLINE + #if defined(__clang__) + #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) + #elif defined(__GNUC__) + #define CYTHON_INLINE __inline__ + #elif defined(_MSC_VER) + #define CYTHON_INLINE __inline + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_INLINE inline + #else + #define CYTHON_INLINE + #endif +#endif + +#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) + #define Py_OptimizeFlag 0 +#endif +#define __PYX_BUILD_PY_SSIZE_T "n" +#define CYTHON_FORMAT_SSIZE_T "z" +#if PY_MAJOR_VERSION < 3 + #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyClass_Type +#else + #define __Pyx_BUILTIN_MODULE_NAME "builtins" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyType_Type +#endif +#ifndef Py_TPFLAGS_CHECKTYPES + #define Py_TPFLAGS_CHECKTYPES 0 +#endif +#ifndef Py_TPFLAGS_HAVE_INDEX + #define Py_TPFLAGS_HAVE_INDEX 0 +#endif +#ifndef Py_TPFLAGS_HAVE_NEWBUFFER + #define Py_TPFLAGS_HAVE_NEWBUFFER 0 +#endif +#ifndef Py_TPFLAGS_HAVE_FINALIZE + #define Py_TPFLAGS_HAVE_FINALIZE 0 +#endif +#ifndef METH_STACKLESS + #define METH_STACKLESS 0 +#endif +#if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) + #ifndef METH_FASTCALL + #define METH_FASTCALL 0x80 + #endif + typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs); + typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args, + Py_ssize_t nargs, PyObject *kwnames); +#else + #define __Pyx_PyCFunctionFast _PyCFunctionFast + #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords +#endif +#if CYTHON_FAST_PYCCALL +#define __Pyx_PyFastCFunction_Check(func)\ + ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS))))) +#else +#define __Pyx_PyFastCFunction_Check(func) 0 +#endif +#if CYTHON_USE_DICT_VERSIONS +#define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) +#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ + (version_var) = __PYX_GET_DICT_VERSION(dict);\ + (cache_var) = (value); +#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ + static PY_UINT64_T __pyx_dict_version = 0;\ + static PyObject *__pyx_dict_cached_value = NULL;\ + if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ + (VAR) = __pyx_dict_cached_value;\ + } else {\ + (VAR) = __pyx_dict_cached_value = (LOOKUP);\ + __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ + }\ + } +#else +#define __PYX_GET_DICT_VERSION(dict) (0) +#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) +#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) + #define PyObject_Malloc(s) PyMem_Malloc(s) + #define PyObject_Free(p) PyMem_Free(p) + #define PyObject_Realloc(p) PyMem_Realloc(p) +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1 + #define PyMem_RawMalloc(n) PyMem_Malloc(n) + #define PyMem_RawRealloc(p, n) PyMem_Realloc(p, n) + #define PyMem_RawFree(p) PyMem_Free(p) +#endif +#if CYTHON_COMPILING_IN_PYSTON + #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co) + #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno) +#else + #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) + #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) +#endif +#if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000 + #define __Pyx_PyThreadState_Current PyThreadState_GET() +#elif PY_VERSION_HEX >= 0x03060000 + #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() +#elif PY_VERSION_HEX >= 0x03000000 + #define __Pyx_PyThreadState_Current PyThreadState_GET() +#else + #define __Pyx_PyThreadState_Current _PyThreadState_Current +#endif +#if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) +#include "pythread.h" +#define Py_tss_NEEDS_INIT 0 +typedef int Py_tss_t; +static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) { + *key = PyThread_create_key(); + return 0; // PyThread_create_key reports success always +} +static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) { + Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t)); + *key = Py_tss_NEEDS_INIT; + return key; +} +static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) { + PyObject_Free(key); +} +static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) { + return *key != Py_tss_NEEDS_INIT; +} +static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) { + PyThread_delete_key(*key); + *key = Py_tss_NEEDS_INIT; +} +static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) { + return PyThread_set_key_value(*key, value); +} +static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { + return PyThread_get_key_value(*key); +} +#endif // TSS (Thread Specific Storage) API +#if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized) +#define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) +#else +#define __Pyx_PyDict_NewPresized(n) PyDict_New() +#endif +#if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION + #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) +#else + #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS +#define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) +#else +#define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name) +#endif +#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) + #define CYTHON_PEP393_ENABLED 1 + #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ + 0 : _PyUnicode_Ready((PyObject *)(op))) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) + #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) + #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) + #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) + #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) + #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch) + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) +#else + #define CYTHON_PEP393_ENABLED 0 + #define PyUnicode_1BYTE_KIND 1 + #define PyUnicode_2BYTE_KIND 2 + #define PyUnicode_4BYTE_KIND 4 + #define __Pyx_PyUnicode_READY(op) (0) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) + #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111) + #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) + #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) + #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) + #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch) + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) +#endif +#if CYTHON_COMPILING_IN_PYPY + #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) +#else + #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ + PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains) + #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check) + #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format) + #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) +#endif +#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) +#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) +#else + #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) +#endif +#if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) + #define PyObject_ASCII(o) PyObject_Repr(o) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBaseString_Type PyUnicode_Type + #define PyStringObject PyUnicodeObject + #define PyString_Type PyUnicode_Type + #define PyString_Check PyUnicode_Check + #define PyString_CheckExact PyUnicode_CheckExact + #define PyObject_Unicode PyObject_Str +#endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) + #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) +#else + #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) + #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) +#endif +#ifndef PySet_CheckExact + #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) +#endif +#if CYTHON_ASSUME_SAFE_MACROS + #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) +#else + #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyIntObject PyLongObject + #define PyInt_Type PyLong_Type + #define PyInt_Check(op) PyLong_Check(op) + #define PyInt_CheckExact(op) PyLong_CheckExact(op) + #define PyInt_FromString PyLong_FromString + #define PyInt_FromUnicode PyLong_FromUnicode + #define PyInt_FromLong PyLong_FromLong + #define PyInt_FromSize_t PyLong_FromSize_t + #define PyInt_FromSsize_t PyLong_FromSsize_t + #define PyInt_AsLong PyLong_AsLong + #define PyInt_AS_LONG PyLong_AS_LONG + #define PyInt_AsSsize_t PyLong_AsSsize_t + #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask + #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask + #define PyNumber_Int PyNumber_Long +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBoolObject PyLongObject +#endif +#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY + #ifndef PyUnicode_InternFromString + #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) + #endif +#endif +#if PY_VERSION_HEX < 0x030200A4 + typedef long Py_hash_t; + #define __Pyx_PyInt_FromHash_t PyInt_FromLong + #define __Pyx_PyInt_AsHash_t PyInt_AsLong +#else + #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t + #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t +#endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : (Py_INCREF(func), func)) +#else + #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) +#endif +#if CYTHON_USE_ASYNC_SLOTS + #if PY_VERSION_HEX >= 0x030500B1 + #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods + #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) + #else + #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) + #endif +#else + #define __Pyx_PyType_AsAsync(obj) NULL +#endif +#ifndef __Pyx_PyAsyncMethodsStruct + typedef struct { + unaryfunc am_await; + unaryfunc am_aiter; + unaryfunc am_anext; + } __Pyx_PyAsyncMethodsStruct; +#endif + +#if defined(WIN32) || defined(MS_WINDOWS) + #define _USE_MATH_DEFINES +#endif +#include +#ifdef NAN +#define __PYX_NAN() ((float) NAN) +#else +static CYTHON_INLINE float __PYX_NAN() { + float value; + memset(&value, 0xFF, sizeof(value)); + return value; +} +#endif +#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) +#define __Pyx_truncl trunc +#else +#define __Pyx_truncl truncl +#endif + + +#define __PYX_ERR(f_index, lineno, Ln_error) \ +{ \ + __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \ +} + +#ifndef __PYX_EXTERN_C + #ifdef __cplusplus + #define __PYX_EXTERN_C extern "C" + #else + #define __PYX_EXTERN_C extern + #endif +#endif + +#define __PYX_HAVE__gevent____ident +#define __PYX_HAVE_API__gevent____ident +/* Early includes */ +#ifdef _OPENMP +#include +#endif /* _OPENMP */ + +#if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) +#define CYTHON_WITHOUT_ASSERTIONS +#endif + +typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; + const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; + +#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 +#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0 +#define __PYX_DEFAULT_STRING_ENCODING "" +#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString +#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#define __Pyx_uchar_cast(c) ((unsigned char)c) +#define __Pyx_long_cast(x) ((long)x) +#define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ + (sizeof(type) < sizeof(Py_ssize_t)) ||\ + (sizeof(type) > sizeof(Py_ssize_t) &&\ + likely(v < (type)PY_SSIZE_T_MAX ||\ + v == (type)PY_SSIZE_T_MAX) &&\ + (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ + v == (type)PY_SSIZE_T_MIN))) ||\ + (sizeof(type) == sizeof(Py_ssize_t) &&\ + (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ + v == (type)PY_SSIZE_T_MAX))) ) +static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) { + return (size_t) i < (size_t) limit; +} +#if defined (__cplusplus) && __cplusplus >= 201103L + #include + #define __Pyx_sst_abs(value) std::abs(value) +#elif SIZEOF_INT >= SIZEOF_SIZE_T + #define __Pyx_sst_abs(value) abs(value) +#elif SIZEOF_LONG >= SIZEOF_SIZE_T + #define __Pyx_sst_abs(value) labs(value) +#elif defined (_MSC_VER) + #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) +#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define __Pyx_sst_abs(value) llabs(value) +#elif defined (__GNUC__) + #define __Pyx_sst_abs(value) __builtin_llabs(value) +#else + #define __Pyx_sst_abs(value) ((value<0) ? -value : value) +#endif +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*); +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); +#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) +#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) +#define __Pyx_PyBytes_FromString PyBytes_FromString +#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); +#if PY_MAJOR_VERSION < 3 + #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#else + #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize +#endif +#define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) +#define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) +#define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) +#define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) +#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) +static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) { + const Py_UNICODE *u_end = u; + while (*u_end++) ; + return (size_t)(u_end - u - 1); +} +#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) +#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode +#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode +#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) +#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) +static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); +static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*); +static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); +#define __Pyx_PySequence_Tuple(obj)\ + (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); +#if CYTHON_ASSUME_SAFE_MACROS +#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) +#else +#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) +#endif +#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) +#if PY_MAJOR_VERSION >= 3 +#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) +#else +#define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) +#endif +#define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x)) +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII +static int __Pyx_sys_getdefaultencoding_not_ascii; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + PyObject* ascii_chars_u = NULL; + PyObject* ascii_chars_b = NULL; + const char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + if (strcmp(default_encoding_c, "ascii") == 0) { + __Pyx_sys_getdefaultencoding_not_ascii = 0; + } else { + char ascii_chars[128]; + int c; + for (c = 0; c < 128; c++) { + ascii_chars[c] = c; + } + __Pyx_sys_getdefaultencoding_not_ascii = 1; + ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); + if (!ascii_chars_u) goto bad; + ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); + if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { + PyErr_Format( + PyExc_ValueError, + "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", + default_encoding_c); + goto bad; + } + Py_DECREF(ascii_chars_u); + Py_DECREF(ascii_chars_b); + } + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + Py_XDECREF(ascii_chars_u); + Py_XDECREF(ascii_chars_b); + return -1; +} +#endif +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) +#else +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +static char* __PYX_DEFAULT_STRING_ENCODING; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1); + if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; + strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + return -1; +} +#endif +#endif + + +/* Test for GCC > 2.95 */ +#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) + #define likely(x) __builtin_expect(!!(x), 1) + #define unlikely(x) __builtin_expect(!!(x), 0) +#else /* !__GNUC__ or GCC < 2.95 */ + #define likely(x) (x) + #define unlikely(x) (x) +#endif /* __GNUC__ */ +static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } + +static PyObject *__pyx_m = NULL; +static PyObject *__pyx_d; +static PyObject *__pyx_b; +static PyObject *__pyx_cython_runtime = NULL; +static PyObject *__pyx_empty_tuple; +static PyObject *__pyx_empty_bytes; +static PyObject *__pyx_empty_unicode; +static int __pyx_lineno; +static int __pyx_clineno = 0; +static const char * __pyx_cfilenm= __FILE__; +static const char *__pyx_filename; + + +static const char *__pyx_f[] = { + "src\\gevent\\_ident.py", + "src\\gevent\\__ident.pxd", +}; + +/*--- Type declarations ---*/ +struct __pyx_obj_6gevent_7__ident_ValuedWeakRef; +struct __pyx_obj_6gevent_7__ident_IdentRegistry; + +/* "gevent/__ident.pxd":15 + * @cython.internal + * @cython.final + * cdef class ValuedWeakRef(ref): # <<<<<<<<<<<<<< + * cdef object value + * + */ +struct __pyx_obj_6gevent_7__ident_ValuedWeakRef { + PyWeakReference __pyx_base; + PyObject *value; +}; + + +/* "gevent/__ident.pxd":19 + * + * @cython.final + * cdef class IdentRegistry: # <<<<<<<<<<<<<< + * cdef object _registry + * cdef list _available_idents + */ +struct __pyx_obj_6gevent_7__ident_IdentRegistry { + PyObject_HEAD + struct __pyx_vtabstruct_6gevent_7__ident_IdentRegistry *__pyx_vtab; + PyObject *_registry; + PyObject *_available_idents; +}; + + + +/* "src/gevent/_ident.py":28 + * + * + * class IdentRegistry(object): # <<<<<<<<<<<<<< + * """ + * Maintains a unique mapping of (small) positive integer identifiers + */ + +struct __pyx_vtabstruct_6gevent_7__ident_IdentRegistry { + PyObject *(*get_ident)(struct __pyx_obj_6gevent_7__ident_IdentRegistry *, PyObject *, int __pyx_skip_dispatch); + PyObject *(*_return_ident)(struct __pyx_obj_6gevent_7__ident_IdentRegistry *, struct __pyx_obj_6gevent_7__ident_ValuedWeakRef *, int __pyx_skip_dispatch); +}; +static struct __pyx_vtabstruct_6gevent_7__ident_IdentRegistry *__pyx_vtabptr_6gevent_7__ident_IdentRegistry; +static PyObject *__pyx_f_6gevent_7__ident_13IdentRegistry_get_ident(struct __pyx_obj_6gevent_7__ident_IdentRegistry *, PyObject *, int __pyx_skip_dispatch); +static PyObject *__pyx_f_6gevent_7__ident_13IdentRegistry__return_ident(struct __pyx_obj_6gevent_7__ident_IdentRegistry *, struct __pyx_obj_6gevent_7__ident_ValuedWeakRef *, int __pyx_skip_dispatch); + +/* --- Runtime support code (head) --- */ +/* Refnanny.proto */ +#ifndef CYTHON_REFNANNY + #define CYTHON_REFNANNY 0 +#endif +#if CYTHON_REFNANNY + typedef struct { + void (*INCREF)(void*, PyObject*, int); + void (*DECREF)(void*, PyObject*, int); + void (*GOTREF)(void*, PyObject*, int); + void (*GIVEREF)(void*, PyObject*, int); + void* (*SetupContext)(const char*, int, const char*); + void (*FinishContext)(void**); + } __Pyx_RefNannyAPIStruct; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); + #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; +#ifdef WITH_THREAD + #define __Pyx_RefNannySetupContext(name, acquire_gil)\ + if (acquire_gil) {\ + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ + PyGILState_Release(__pyx_gilstate_save);\ + } else {\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ + } +#else + #define __Pyx_RefNannySetupContext(name, acquire_gil)\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) +#endif + #define __Pyx_RefNannyFinishContext()\ + __Pyx_RefNanny->FinishContext(&__pyx_refnanny) + #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0) + #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) + #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) + #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) +#else + #define __Pyx_RefNannyDeclarations + #define __Pyx_RefNannySetupContext(name, acquire_gil) + #define __Pyx_RefNannyFinishContext() + #define __Pyx_INCREF(r) Py_INCREF(r) + #define __Pyx_DECREF(r) Py_DECREF(r) + #define __Pyx_GOTREF(r) + #define __Pyx_GIVEREF(r) + #define __Pyx_XINCREF(r) Py_XINCREF(r) + #define __Pyx_XDECREF(r) Py_XDECREF(r) + #define __Pyx_XGOTREF(r) + #define __Pyx_XGIVEREF(r) +#endif +#define __Pyx_XDECREF_SET(r, v) do {\ + PyObject *tmp = (PyObject *) r;\ + r = v; __Pyx_XDECREF(tmp);\ + } while (0) +#define __Pyx_DECREF_SET(r, v) do {\ + PyObject *tmp = (PyObject *) r;\ + r = v; __Pyx_DECREF(tmp);\ + } while (0) +#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) +#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) + +/* PyObjectGetAttrStr.proto */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); +#else +#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) +#endif + +/* GetBuiltinName.proto */ +static PyObject *__Pyx_GetBuiltinName(PyObject *name); + +/* RaiseArgTupleInvalid.proto */ +static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, + Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); + +/* KeywordStringCheck.proto */ +static int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* function_name, int kw_allowed); + +/* PyFunctionFastCall.proto */ +#if CYTHON_FAST_PYCALL +#define __Pyx_PyFunction_FastCall(func, args, nargs)\ + __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) +#if 1 || PY_VERSION_HEX < 0x030600B1 +static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs); +#else +#define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs) +#endif +#define __Pyx_BUILD_ASSERT_EXPR(cond)\ + (sizeof(char [1 - 2*!(cond)]) - 1) +#ifndef Py_MEMBER_SIZE +#define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member) +#endif + static size_t __pyx_pyframe_localsplus_offset = 0; + #include "frameobject.h" + #define __Pxy_PyFrame_Initialize_Offsets()\ + ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\ + (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus))) + #define __Pyx_PyFrame_GetLocalsplus(frame)\ + (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset)) +#endif + +/* PyObjectCall.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); +#else +#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) +#endif + +/* PyObjectCallMethO.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); +#endif + +/* PyObjectCallNoArg.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); +#else +#define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL) +#endif + +/* PyCFunctionFastCall.proto */ +#if CYTHON_FAST_PYCCALL +static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs); +#else +#define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL) +#endif + +/* PyObjectCallOneArg.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); + +/* GetItemInt.proto */ +#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ + __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\ + (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\ + __Pyx_GetItemInt_Generic(o, to_py_func(i)))) +#define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ + __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ + (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL)) +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, + int wraparound, int boundscheck); +#define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ + __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ + (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL)) +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, + int wraparound, int boundscheck); +static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j); +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, + int is_list, int wraparound, int boundscheck); + +/* ObjectGetItem.proto */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key); +#else +#define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key) +#endif + +/* GetTopmostException.proto */ +#if CYTHON_USE_EXC_INFO_STACK +static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate); +#endif + +/* PyThreadStateGet.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; +#define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; +#define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type +#else +#define __Pyx_PyThreadState_declare +#define __Pyx_PyThreadState_assign +#define __Pyx_PyErr_Occurred() PyErr_Occurred() +#endif + +/* SaveResetException.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); +#else +#define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb) +#define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb) +#endif + +/* PyErrExceptionMatches.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) +static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); +#else +#define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) +#endif + +/* PyErrFetchRestore.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) +#define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) +#define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) +#define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) +#define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); +static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) +#else +#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) +#endif +#else +#define __Pyx_PyErr_Clear() PyErr_Clear() +#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) +#define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) +#define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb) +#define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) +#endif + +/* PyObjectCall2Args.proto */ +static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2); + +/* ArgTypeTest.proto */ +#define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\ + ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\ + __Pyx__ArgTypeTest(obj, type, name, exact)) +static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact); + +/* CallNextTpDealloc.proto */ +static void __Pyx_call_next_tp_dealloc(PyObject* obj, destructor current_tp_dealloc); + +/* CallNextTpTraverse.proto */ +static int __Pyx_call_next_tp_traverse(PyObject* obj, visitproc v, void *a, traverseproc current_tp_traverse); + +/* CallNextTpClear.proto */ +static void __Pyx_call_next_tp_clear(PyObject* obj, inquiry current_tp_dealloc); + +/* TypeImport.proto */ +#ifndef __PYX_HAVE_RT_ImportType_proto +#define __PYX_HAVE_RT_ImportType_proto +enum __Pyx_ImportType_CheckSize { + __Pyx_ImportType_CheckSize_Error = 0, + __Pyx_ImportType_CheckSize_Warn = 1, + __Pyx_ImportType_CheckSize_Ignore = 2 +}; +static PyTypeObject *__Pyx_ImportType(PyObject* module, const char *module_name, const char *class_name, size_t size, enum __Pyx_ImportType_CheckSize check_size); +#endif + +/* PyObject_GenericGetAttrNoDict.proto */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name); +#else +#define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr +#endif + +/* SetVTable.proto */ +static int __Pyx_SetVtable(PyObject *dict, void *vtable); + +/* Import.proto */ +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); + +/* ImportFrom.proto */ +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); + +/* FetchCommonType.proto */ +static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); + +/* CythonFunction.proto */ +#define __Pyx_CyFunction_USED 1 +#define __Pyx_CYFUNCTION_STATICMETHOD 0x01 +#define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 +#define __Pyx_CYFUNCTION_CCLASS 0x04 +#define __Pyx_CyFunction_GetClosure(f)\ + (((__pyx_CyFunctionObject *) (f))->func_closure) +#define __Pyx_CyFunction_GetClassObj(f)\ + (((__pyx_CyFunctionObject *) (f))->func_classobj) +#define __Pyx_CyFunction_Defaults(type, f)\ + ((type *)(((__pyx_CyFunctionObject *) (f))->defaults)) +#define __Pyx_CyFunction_SetDefaultsGetter(f, g)\ + ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g) +typedef struct { + PyCFunctionObject func; +#if PY_VERSION_HEX < 0x030500A0 + PyObject *func_weakreflist; +#endif + PyObject *func_dict; + PyObject *func_name; + PyObject *func_qualname; + PyObject *func_doc; + PyObject *func_globals; + PyObject *func_code; + PyObject *func_closure; + PyObject *func_classobj; + void *defaults; + int defaults_pyobjects; + int flags; + PyObject *defaults_tuple; + PyObject *defaults_kwdict; + PyObject *(*defaults_getter)(PyObject *); + PyObject *func_annotations; +} __pyx_CyFunctionObject; +static PyTypeObject *__pyx_CyFunctionType = 0; +#define __Pyx_CyFunction_Check(obj) (__Pyx_TypeCheck(obj, __pyx_CyFunctionType)) +#define __Pyx_CyFunction_NewEx(ml, flags, qualname, self, module, globals, code)\ + __Pyx_CyFunction_New(__pyx_CyFunctionType, ml, flags, qualname, self, module, globals, code) +static PyObject *__Pyx_CyFunction_New(PyTypeObject *, PyMethodDef *ml, + int flags, PyObject* qualname, + PyObject *self, + PyObject *module, PyObject *globals, + PyObject* code); +static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, + size_t size, + int pyobjects); +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, + PyObject *tuple); +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, + PyObject *dict); +static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m, + PyObject *dict); +static int __pyx_CyFunction_init(void); + +/* GetModuleGlobalName.proto */ +#if CYTHON_USE_DICT_VERSIONS +#define __Pyx_GetModuleGlobalName(var, name) {\ + static PY_UINT64_T __pyx_dict_version = 0;\ + static PyObject *__pyx_dict_cached_value = NULL;\ + (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\ + (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\ + __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ +} +#define __Pyx_GetModuleGlobalNameUncached(var, name) {\ + PY_UINT64_T __pyx_dict_version;\ + PyObject *__pyx_dict_cached_value;\ + (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ +} +static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value); +#else +#define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name) +#define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name) +static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name); +#endif + +/* GetAttr.proto */ +static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *); + +/* Globals.proto */ +static PyObject* __Pyx_Globals(void); + +/* CLineInTraceback.proto */ +#ifdef CYTHON_CLINE_IN_TRACEBACK +#define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) +#else +static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line); +#endif + +/* CodeObjectCache.proto */ +typedef struct { + PyCodeObject* code_object; + int code_line; +} __Pyx_CodeObjectCacheEntry; +struct __Pyx_CodeObjectCache { + int count; + int max_count; + __Pyx_CodeObjectCacheEntry* entries; +}; +static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); +static PyCodeObject *__pyx_find_code_object(int code_line); +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); + +/* AddTraceback.proto */ +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename); + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); + +/* CIntFromPy.proto */ +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); + +/* CIntFromPy.proto */ +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); + +/* FastTypeChecks.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) +static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b); +static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type); +static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2); +#else +#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) +#define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) +#define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) +#endif +#define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) + +/* CheckBinaryVersion.proto */ +static int __Pyx_check_binary_version(void); + +/* PyObjectSetAttrStr.proto */ +#if CYTHON_USE_TYPE_SLOTS +#define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o, n, NULL) +static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value); +#else +#define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n) +#define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v) +#endif + +/* VoidPtrExport.proto */ +static int __Pyx_ExportVoidPtr(PyObject *name, void *p, const char *sig); + +/* InitStrings.proto */ +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); + +static PyObject *__pyx_f_6gevent_7__ident_13IdentRegistry_get_ident(struct __pyx_obj_6gevent_7__ident_IdentRegistry *__pyx_v_self, PyObject *__pyx_v_obj, CYTHON_UNUSED int __pyx_skip_dispatch); /* proto*/ +static PyObject *__pyx_f_6gevent_7__ident_13IdentRegistry__return_ident(struct __pyx_obj_6gevent_7__ident_IdentRegistry *__pyx_v_self, struct __pyx_obj_6gevent_7__ident_ValuedWeakRef *__pyx_v_vref, CYTHON_UNUSED int __pyx_skip_dispatch); /* proto*/ + +/* Module declarations from 'cython' */ + +/* Module declarations from 'weakref' */ + +/* Module declarations from 'gevent.__ident' */ +static PyTypeObject *__pyx_ptype_6gevent_7__ident_ref = 0; +static PyTypeObject *__pyx_ptype_6gevent_7__ident_ValuedWeakRef = 0; +static PyTypeObject *__pyx_ptype_6gevent_7__ident_IdentRegistry = 0; +static PyObject *__pyx_v_6gevent_7__ident_heappop = 0; +static PyObject *__pyx_v_6gevent_7__ident_heappush = 0; +static PyObject *__pyx_v_6gevent_7__ident_WeakKeyDictionary = 0; +#define __Pyx_MODULE_NAME "gevent.__ident" +extern int __pyx_module_is_main_gevent____ident; +int __pyx_module_is_main_gevent____ident = 0; + +/* Implementation of 'gevent.__ident' */ +static PyObject *__pyx_builtin_KeyError; +static const char __pyx_k_all[] = "__all__"; +static const char __pyx_k_obj[] = "obj"; +static const char __pyx_k_ref[] = "ref"; +static const char __pyx_k_main[] = "__main__"; +static const char __pyx_k_name[] = "__name__"; +static const char __pyx_k_self[] = "self"; +static const char __pyx_k_test[] = "__test__"; +static const char __pyx_k_vref[] = "vref"; +static const char __pyx_k_heapq[] = "heapq"; +static const char __pyx_k_slots[] = "__slots__"; +static const char __pyx_k_value[] = "value"; +static const char __pyx_k_import[] = "__import__"; +static const char __pyx_k_heappop[] = "heappop"; +static const char __pyx_k_weakref[] = "weakref"; +static const char __pyx_k_KeyError[] = "KeyError"; +static const char __pyx_k_heappush[] = "heappush"; +static const char __pyx_k_pyx_capi[] = "__pyx_capi__"; +static const char __pyx_k_get_ident[] = "get_ident"; +static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__"; +static const char __pyx_k_gevent__util[] = "gevent._util"; +static const char __pyx_k_return_ident[] = "_return_ident"; +static const char __pyx_k_IdentRegistry[] = "IdentRegistry"; +static const char __pyx_k_ValuedWeakRef[] = "ValuedWeakRef"; +static const char __pyx_k_gevent___ident[] = "gevent.__ident"; +static const char __pyx_k_import_c_accel[] = "import_c_accel"; +static const char __pyx_k_WeakKeyDictionary[] = "WeakKeyDictionary"; +static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; +static const char __pyx_k_src_gevent__ident_py[] = "src\\gevent\\_ident.py"; +static const char __pyx_k_IdentRegistry_get_ident[] = "IdentRegistry.get_ident"; +static const char __pyx_k_IdentRegistry__return_ident[] = "IdentRegistry._return_ident"; +static PyObject *__pyx_n_s_IdentRegistry; +static PyObject *__pyx_n_s_IdentRegistry__return_ident; +static PyObject *__pyx_n_s_IdentRegistry_get_ident; +static PyObject *__pyx_n_s_KeyError; +static PyObject *__pyx_n_s_ValuedWeakRef; +static PyObject *__pyx_n_s_WeakKeyDictionary; +static PyObject *__pyx_n_s_all; +static PyObject *__pyx_n_s_cline_in_traceback; +static PyObject *__pyx_n_s_get_ident; +static PyObject *__pyx_n_s_gevent___ident; +static PyObject *__pyx_n_s_gevent__util; +static PyObject *__pyx_n_s_heappop; +static PyObject *__pyx_n_s_heappush; +static PyObject *__pyx_n_s_heapq; +static PyObject *__pyx_n_s_import; +static PyObject *__pyx_n_s_import_c_accel; +static PyObject *__pyx_n_s_main; +static PyObject *__pyx_n_s_name; +static PyObject *__pyx_n_s_obj; +static PyObject *__pyx_n_s_pyx_capi; +static PyObject *__pyx_n_s_pyx_vtable; +static PyObject *__pyx_n_s_ref; +static PyObject *__pyx_n_s_return_ident; +static PyObject *__pyx_n_s_self; +static PyObject *__pyx_n_s_slots; +static PyObject *__pyx_kp_s_src_gevent__ident_py; +static PyObject *__pyx_n_s_test; +static PyObject *__pyx_n_s_value; +static PyObject *__pyx_n_s_vref; +static PyObject *__pyx_n_s_weakref; +static int __pyx_pf_6gevent_7__ident_13IdentRegistry___init__(struct __pyx_obj_6gevent_7__ident_IdentRegistry *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_7__ident_13IdentRegistry_2get_ident(struct __pyx_obj_6gevent_7__ident_IdentRegistry *__pyx_v_self, PyObject *__pyx_v_obj); /* proto */ +static PyObject *__pyx_pf_6gevent_7__ident_13IdentRegistry_4_return_ident(struct __pyx_obj_6gevent_7__ident_IdentRegistry *__pyx_v_self, struct __pyx_obj_6gevent_7__ident_ValuedWeakRef *__pyx_v_vref); /* proto */ +static Py_ssize_t __pyx_pf_6gevent_7__ident_13IdentRegistry_6__len__(struct __pyx_obj_6gevent_7__ident_IdentRegistry *__pyx_v_self); /* proto */ +static PyObject *__pyx_tp_new_6gevent_7__ident_ValuedWeakRef(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6gevent_7__ident_IdentRegistry(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tuple_; +static PyObject *__pyx_tuple__2; +static PyObject *__pyx_tuple__4; +static PyObject *__pyx_codeobj__3; +static PyObject *__pyx_codeobj__5; +/* Late includes */ + +/* "src/gevent/_ident.py":38 + * """ + * + * def __init__(self): # <<<<<<<<<<<<<< + * # {obj -> (ident, wref(obj))} + * self._registry = WeakKeyDictionary() + */ + +/* Python wrapper */ +static int __pyx_pw_6gevent_7__ident_13IdentRegistry_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6gevent_7__ident_13IdentRegistry_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { + __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;} + if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1; + __pyx_r = __pyx_pf_6gevent_7__ident_13IdentRegistry___init__(((struct __pyx_obj_6gevent_7__ident_IdentRegistry *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_7__ident_13IdentRegistry___init__(struct __pyx_obj_6gevent_7__ident_IdentRegistry *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "src/gevent/_ident.py":40 + * def __init__(self): + * # {obj -> (ident, wref(obj))} + * self._registry = WeakKeyDictionary() # <<<<<<<<<<<<<< + * + * # A heap of numbers that have been used and returned + */ + __Pyx_INCREF(__pyx_v_6gevent_7__ident_WeakKeyDictionary); + __pyx_t_2 = __pyx_v_6gevent_7__ident_WeakKeyDictionary; __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 40, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_self->_registry); + __Pyx_DECREF(__pyx_v_self->_registry); + __pyx_v_self->_registry = __pyx_t_1; + __pyx_t_1 = 0; + + /* "src/gevent/_ident.py":43 + * + * # A heap of numbers that have been used and returned + * self._available_idents = [] # <<<<<<<<<<<<<< + * + * def get_ident(self, obj): + */ + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 43, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_self->_available_idents); + __Pyx_DECREF(__pyx_v_self->_available_idents); + __pyx_v_self->_available_idents = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "src/gevent/_ident.py":38 + * """ + * + * def __init__(self): # <<<<<<<<<<<<<< + * # {obj -> (ident, wref(obj))} + * self._registry = WeakKeyDictionary() + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("gevent.__ident.IdentRegistry.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_ident.py":45 + * self._available_idents = [] + * + * def get_ident(self, obj): # <<<<<<<<<<<<<< + * """ + * Retrieve the identifier for *obj*, creating one + */ + +static PyObject *__pyx_pw_6gevent_7__ident_13IdentRegistry_3get_ident(PyObject *__pyx_v_self, PyObject *__pyx_v_obj); /*proto*/ +static PyObject *__pyx_f_6gevent_7__ident_13IdentRegistry_get_ident(struct __pyx_obj_6gevent_7__ident_IdentRegistry *__pyx_v_self, PyObject *__pyx_v_obj, CYTHON_UNUSED int __pyx_skip_dispatch) { + PyObject *__pyx_v_ident = NULL; + struct __pyx_obj_6gevent_7__ident_ValuedWeakRef *__pyx_v_vref = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + Py_ssize_t __pyx_t_9; + __Pyx_RefNannySetupContext("get_ident", 0); + + /* "src/gevent/_ident.py":51 + * """ + * + * try: # <<<<<<<<<<<<<< + * return self._registry[obj][0] + * except KeyError: + */ + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "src/gevent/_ident.py":52 + * + * try: + * return self._registry[obj][0] # <<<<<<<<<<<<<< + * except KeyError: + * pass + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_v_self->_registry, __pyx_v_obj); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 52, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_4, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 52, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L7_try_return; + + /* "src/gevent/_ident.py":51 + * """ + * + * try: # <<<<<<<<<<<<<< + * return self._registry[obj][0] + * except KeyError: + */ + } + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "src/gevent/_ident.py":53 + * try: + * return self._registry[obj][0] + * except KeyError: # <<<<<<<<<<<<<< + * pass + * + */ + __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError); + if (__pyx_t_6) { + __Pyx_ErrRestore(0,0,0); + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + + /* "src/gevent/_ident.py":51 + * """ + * + * try: # <<<<<<<<<<<<<< + * return self._registry[obj][0] + * except KeyError: + */ + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + } + + /* "src/gevent/_ident.py":56 + * pass + * + * if self._available_idents: # <<<<<<<<<<<<<< + * # Take the smallest free number + * ident = heappop(self._available_idents) + */ + __pyx_t_7 = (__pyx_v_self->_available_idents != Py_None)&&(PyList_GET_SIZE(__pyx_v_self->_available_idents) != 0); + if (__pyx_t_7) { + + /* "src/gevent/_ident.py":58 + * if self._available_idents: + * # Take the smallest free number + * ident = heappop(self._available_idents) # <<<<<<<<<<<<<< + * else: + * # Allocate a bigger one + */ + __Pyx_INCREF(__pyx_v_6gevent_7__ident_heappop); + __pyx_t_4 = __pyx_v_6gevent_7__ident_heappop; __pyx_t_8 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_8)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_8); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + } + } + __pyx_t_5 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_8, __pyx_v_self->_available_idents) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_self->_available_idents); + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 58, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_ident = __pyx_t_5; + __pyx_t_5 = 0; + + /* "src/gevent/_ident.py":56 + * pass + * + * if self._available_idents: # <<<<<<<<<<<<<< + * # Take the smallest free number + * ident = heappop(self._available_idents) + */ + goto __pyx_L9; + } + + /* "src/gevent/_ident.py":61 + * else: + * # Allocate a bigger one + * ident = len(self._registry) # <<<<<<<<<<<<<< + * + * vref = ValuedWeakRef(obj, self._return_ident) + */ + /*else*/ { + __pyx_t_5 = __pyx_v_self->_registry; + __Pyx_INCREF(__pyx_t_5); + __pyx_t_9 = PyObject_Length(__pyx_t_5); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 61, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyInt_FromSsize_t(__pyx_t_9); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 61, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_v_ident = __pyx_t_5; + __pyx_t_5 = 0; + } + __pyx_L9:; + + /* "src/gevent/_ident.py":63 + * ident = len(self._registry) + * + * vref = ValuedWeakRef(obj, self._return_ident) # <<<<<<<<<<<<<< + * vref.value = ident # pylint:disable=assigning-non-slot,attribute-defined-outside-init + * self._registry[obj] = (ident, vref) + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_return_ident); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 63, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 63, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_obj); + __Pyx_GIVEREF(__pyx_v_obj); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_obj); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6gevent_7__ident_ValuedWeakRef), __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 63, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_vref = ((struct __pyx_obj_6gevent_7__ident_ValuedWeakRef *)__pyx_t_5); + __pyx_t_5 = 0; + + /* "src/gevent/_ident.py":64 + * + * vref = ValuedWeakRef(obj, self._return_ident) + * vref.value = ident # pylint:disable=assigning-non-slot,attribute-defined-outside-init # <<<<<<<<<<<<<< + * self._registry[obj] = (ident, vref) + * return ident + */ + __Pyx_INCREF(__pyx_v_ident); + __Pyx_GIVEREF(__pyx_v_ident); + __Pyx_GOTREF(__pyx_v_vref->value); + __Pyx_DECREF(__pyx_v_vref->value); + __pyx_v_vref->value = __pyx_v_ident; + + /* "src/gevent/_ident.py":65 + * vref = ValuedWeakRef(obj, self._return_ident) + * vref.value = ident # pylint:disable=assigning-non-slot,attribute-defined-outside-init + * self._registry[obj] = (ident, vref) # <<<<<<<<<<<<<< + * return ident + * + */ + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 65, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_ident); + __Pyx_GIVEREF(__pyx_v_ident); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_ident); + __Pyx_INCREF(((PyObject *)__pyx_v_vref)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_vref)); + PyTuple_SET_ITEM(__pyx_t_5, 1, ((PyObject *)__pyx_v_vref)); + if (unlikely(PyObject_SetItem(__pyx_v_self->_registry, __pyx_v_obj, __pyx_t_5) < 0)) __PYX_ERR(0, 65, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "src/gevent/_ident.py":66 + * vref.value = ident # pylint:disable=assigning-non-slot,attribute-defined-outside-init + * self._registry[obj] = (ident, vref) + * return ident # <<<<<<<<<<<<<< + * + * def _return_ident(self, vref): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_ident); + __pyx_r = __pyx_v_ident; + goto __pyx_L0; + + /* "src/gevent/_ident.py":45 + * self._available_idents = [] + * + * def get_ident(self, obj): # <<<<<<<<<<<<<< + * """ + * Retrieve the identifier for *obj*, creating one + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("gevent.__ident.IdentRegistry.get_ident", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_ident); + __Pyx_XDECREF((PyObject *)__pyx_v_vref); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_7__ident_13IdentRegistry_3get_ident(PyObject *__pyx_v_self, PyObject *__pyx_v_obj); /*proto*/ +static char __pyx_doc_6gevent_7__ident_13IdentRegistry_2get_ident[] = "IdentRegistry.get_ident(self, obj)\n\n Retrieve the identifier for *obj*, creating one\n if necessary.\n "; +static PyMethodDef __pyx_mdef_6gevent_7__ident_13IdentRegistry_3get_ident = {"get_ident", (PyCFunction)__pyx_pw_6gevent_7__ident_13IdentRegistry_3get_ident, METH_O, __pyx_doc_6gevent_7__ident_13IdentRegistry_2get_ident}; +static PyObject *__pyx_pw_6gevent_7__ident_13IdentRegistry_3get_ident(PyObject *__pyx_v_self, PyObject *__pyx_v_obj) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get_ident (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_7__ident_13IdentRegistry_2get_ident(((struct __pyx_obj_6gevent_7__ident_IdentRegistry *)__pyx_v_self), ((PyObject *)__pyx_v_obj)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_7__ident_13IdentRegistry_2get_ident(struct __pyx_obj_6gevent_7__ident_IdentRegistry *__pyx_v_self, PyObject *__pyx_v_obj) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("get_ident", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6gevent_7__ident_13IdentRegistry_get_ident(__pyx_v_self, __pyx_v_obj, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 45, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__ident.IdentRegistry.get_ident", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_ident.py":68 + * return ident + * + * def _return_ident(self, vref): # <<<<<<<<<<<<<< + * # By the time this is called, self._registry has been + * # updated + */ + +static PyObject *__pyx_pw_6gevent_7__ident_13IdentRegistry_5_return_ident(PyObject *__pyx_v_self, PyObject *__pyx_v_vref); /*proto*/ +static PyObject *__pyx_f_6gevent_7__ident_13IdentRegistry__return_ident(struct __pyx_obj_6gevent_7__ident_IdentRegistry *__pyx_v_self, struct __pyx_obj_6gevent_7__ident_ValuedWeakRef *__pyx_v_vref, CYTHON_UNUSED int __pyx_skip_dispatch) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + __Pyx_RefNannySetupContext("_return_ident", 0); + + /* "src/gevent/_ident.py":71 + * # By the time this is called, self._registry has been + * # updated + * if heappush is not None: # <<<<<<<<<<<<<< + * # Under some circumstances we can get called + * # when the interpreter is shutting down, and globals + */ + __pyx_t_1 = (__pyx_v_6gevent_7__ident_heappush != Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "src/gevent/_ident.py":75 + * # when the interpreter is shutting down, and globals + * # aren't available any more. + * heappush(self._available_idents, vref.value) # <<<<<<<<<<<<<< + * + * def __len__(self): + */ + __Pyx_INCREF(__pyx_v_6gevent_7__ident_heappush); + __pyx_t_4 = __pyx_v_6gevent_7__ident_heappush; __pyx_t_5 = NULL; + __pyx_t_6 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + __pyx_t_6 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_4)) { + PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_self->_available_idents, __pyx_v_vref->value}; + __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 75, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_t_3); + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { + PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_self->_available_idents, __pyx_v_vref->value}; + __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 75, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_t_3); + } else + #endif + { + __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 75, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + if (__pyx_t_5) { + __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL; + } + __Pyx_INCREF(__pyx_v_self->_available_idents); + __Pyx_GIVEREF(__pyx_v_self->_available_idents); + PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_v_self->_available_idents); + __Pyx_INCREF(__pyx_v_vref->value); + __Pyx_GIVEREF(__pyx_v_vref->value); + PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_vref->value); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 75, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "src/gevent/_ident.py":71 + * # By the time this is called, self._registry has been + * # updated + * if heappush is not None: # <<<<<<<<<<<<<< + * # Under some circumstances we can get called + * # when the interpreter is shutting down, and globals + */ + } + + /* "src/gevent/_ident.py":68 + * return ident + * + * def _return_ident(self, vref): # <<<<<<<<<<<<<< + * # By the time this is called, self._registry has been + * # updated + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("gevent.__ident.IdentRegistry._return_ident", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_7__ident_13IdentRegistry_5_return_ident(PyObject *__pyx_v_self, PyObject *__pyx_v_vref); /*proto*/ +static char __pyx_doc_6gevent_7__ident_13IdentRegistry_4_return_ident[] = "IdentRegistry._return_ident(self, ValuedWeakRef vref)"; +static PyMethodDef __pyx_mdef_6gevent_7__ident_13IdentRegistry_5_return_ident = {"_return_ident", (PyCFunction)__pyx_pw_6gevent_7__ident_13IdentRegistry_5_return_ident, METH_O, __pyx_doc_6gevent_7__ident_13IdentRegistry_4_return_ident}; +static PyObject *__pyx_pw_6gevent_7__ident_13IdentRegistry_5_return_ident(PyObject *__pyx_v_self, PyObject *__pyx_v_vref) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_return_ident (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vref), __pyx_ptype_6gevent_7__ident_ValuedWeakRef, 1, "vref", 0))) __PYX_ERR(0, 68, __pyx_L1_error) + __pyx_r = __pyx_pf_6gevent_7__ident_13IdentRegistry_4_return_ident(((struct __pyx_obj_6gevent_7__ident_IdentRegistry *)__pyx_v_self), ((struct __pyx_obj_6gevent_7__ident_ValuedWeakRef *)__pyx_v_vref)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_7__ident_13IdentRegistry_4_return_ident(struct __pyx_obj_6gevent_7__ident_IdentRegistry *__pyx_v_self, struct __pyx_obj_6gevent_7__ident_ValuedWeakRef *__pyx_v_vref) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("_return_ident", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6gevent_7__ident_13IdentRegistry__return_ident(__pyx_v_self, __pyx_v_vref, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 68, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__ident.IdentRegistry._return_ident", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_ident.py":77 + * heappush(self._available_idents, vref.value) + * + * def __len__(self): # <<<<<<<<<<<<<< + * return len(self._registry) + * + */ + +/* Python wrapper */ +static Py_ssize_t __pyx_pw_6gevent_7__ident_13IdentRegistry_7__len__(PyObject *__pyx_v_self); /*proto*/ +static Py_ssize_t __pyx_pw_6gevent_7__ident_13IdentRegistry_7__len__(PyObject *__pyx_v_self) { + Py_ssize_t __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__len__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_7__ident_13IdentRegistry_6__len__(((struct __pyx_obj_6gevent_7__ident_IdentRegistry *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static Py_ssize_t __pyx_pf_6gevent_7__ident_13IdentRegistry_6__len__(struct __pyx_obj_6gevent_7__ident_IdentRegistry *__pyx_v_self) { + Py_ssize_t __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + __Pyx_RefNannySetupContext("__len__", 0); + + /* "src/gevent/_ident.py":78 + * + * def __len__(self): + * return len(self._registry) # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_1 = __pyx_v_self->_registry; + __Pyx_INCREF(__pyx_t_1); + __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 78, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + goto __pyx_L0; + + /* "src/gevent/_ident.py":77 + * heappush(self._available_idents, vref.value) + * + * def __len__(self): # <<<<<<<<<<<<<< + * return len(self._registry) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__ident.IdentRegistry.__len__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_tp_new_6gevent_7__ident_ValuedWeakRef(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_6gevent_7__ident_ValuedWeakRef *p; + PyObject *o = __pyx_ptype_6gevent_7__ident_ref->tp_new(t, a, k); + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_6gevent_7__ident_ValuedWeakRef *)o); + p->value = Py_None; Py_INCREF(Py_None); + return o; +} + +static void __pyx_tp_dealloc_6gevent_7__ident_ValuedWeakRef(PyObject *o) { + struct __pyx_obj_6gevent_7__ident_ValuedWeakRef *p = (struct __pyx_obj_6gevent_7__ident_ValuedWeakRef *)o; + PyObject_GC_UnTrack(o); + Py_CLEAR(p->value); + #if CYTHON_USE_TYPE_SLOTS + if (PyType_IS_GC(Py_TYPE(o)->tp_base)) + #endif + PyObject_GC_Track(o); + if (likely(__pyx_ptype_6gevent_7__ident_ref)) __pyx_ptype_6gevent_7__ident_ref->tp_dealloc(o); else __Pyx_call_next_tp_dealloc(o, __pyx_tp_dealloc_6gevent_7__ident_ValuedWeakRef); +} + +static int __pyx_tp_traverse_6gevent_7__ident_ValuedWeakRef(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_6gevent_7__ident_ValuedWeakRef *p = (struct __pyx_obj_6gevent_7__ident_ValuedWeakRef *)o; + e = ((likely(__pyx_ptype_6gevent_7__ident_ref)) ? ((__pyx_ptype_6gevent_7__ident_ref->tp_traverse) ? __pyx_ptype_6gevent_7__ident_ref->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_6gevent_7__ident_ValuedWeakRef)); if (e) return e; + if (p->value) { + e = (*v)(p->value, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_6gevent_7__ident_ValuedWeakRef(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_6gevent_7__ident_ValuedWeakRef *p = (struct __pyx_obj_6gevent_7__ident_ValuedWeakRef *)o; + if (likely(__pyx_ptype_6gevent_7__ident_ref)) { if (__pyx_ptype_6gevent_7__ident_ref->tp_clear) __pyx_ptype_6gevent_7__ident_ref->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_6gevent_7__ident_ValuedWeakRef); + tmp = ((PyObject*)p->value); + p->value = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyTypeObject __pyx_type_6gevent_7__ident_ValuedWeakRef = { + PyVarObject_HEAD_INIT(0, 0) + "gevent.__ident.ValuedWeakRef", /*tp_name*/ + sizeof(struct __pyx_obj_6gevent_7__ident_ValuedWeakRef), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6gevent_7__ident_ValuedWeakRef, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + "\n A weak ref with an associated value.\n ", /*tp_doc*/ + __pyx_tp_traverse_6gevent_7__ident_ValuedWeakRef, /*tp_traverse*/ + __pyx_tp_clear_6gevent_7__ident_ValuedWeakRef, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + 0, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6gevent_7__ident_ValuedWeakRef, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; +static struct __pyx_vtabstruct_6gevent_7__ident_IdentRegistry __pyx_vtable_6gevent_7__ident_IdentRegistry; + +static PyObject *__pyx_tp_new_6gevent_7__ident_IdentRegistry(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + struct __pyx_obj_6gevent_7__ident_IdentRegistry *p; + PyObject *o; + o = (*t->tp_alloc)(t, 0); + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_6gevent_7__ident_IdentRegistry *)o); + p->__pyx_vtab = __pyx_vtabptr_6gevent_7__ident_IdentRegistry; + p->_registry = Py_None; Py_INCREF(Py_None); + p->_available_idents = ((PyObject*)Py_None); Py_INCREF(Py_None); + return o; +} + +static void __pyx_tp_dealloc_6gevent_7__ident_IdentRegistry(PyObject *o) { + struct __pyx_obj_6gevent_7__ident_IdentRegistry *p = (struct __pyx_obj_6gevent_7__ident_IdentRegistry *)o; + PyObject_GC_UnTrack(o); + Py_CLEAR(p->_registry); + Py_CLEAR(p->_available_idents); + (*Py_TYPE(o)->tp_free)(o); +} + +static int __pyx_tp_traverse_6gevent_7__ident_IdentRegistry(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_6gevent_7__ident_IdentRegistry *p = (struct __pyx_obj_6gevent_7__ident_IdentRegistry *)o; + if (p->_registry) { + e = (*v)(p->_registry, a); if (e) return e; + } + if (p->_available_idents) { + e = (*v)(p->_available_idents, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_6gevent_7__ident_IdentRegistry(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_6gevent_7__ident_IdentRegistry *p = (struct __pyx_obj_6gevent_7__ident_IdentRegistry *)o; + tmp = ((PyObject*)p->_registry); + p->_registry = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->_available_idents); + p->_available_idents = ((PyObject*)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyMethodDef __pyx_methods_6gevent_7__ident_IdentRegistry[] = { + {0, 0, 0, 0} +}; + +static PySequenceMethods __pyx_tp_as_sequence_IdentRegistry = { + __pyx_pw_6gevent_7__ident_13IdentRegistry_7__len__, /*sq_length*/ + 0, /*sq_concat*/ + 0, /*sq_repeat*/ + 0, /*sq_item*/ + 0, /*sq_slice*/ + 0, /*sq_ass_item*/ + 0, /*sq_ass_slice*/ + 0, /*sq_contains*/ + 0, /*sq_inplace_concat*/ + 0, /*sq_inplace_repeat*/ +}; + +static PyMappingMethods __pyx_tp_as_mapping_IdentRegistry = { + __pyx_pw_6gevent_7__ident_13IdentRegistry_7__len__, /*mp_length*/ + 0, /*mp_subscript*/ + 0, /*mp_ass_subscript*/ +}; + +static PyTypeObject __pyx_type_6gevent_7__ident_IdentRegistry = { + PyVarObject_HEAD_INIT(0, 0) + "gevent.__ident.IdentRegistry", /*tp_name*/ + sizeof(struct __pyx_obj_6gevent_7__ident_IdentRegistry), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6gevent_7__ident_IdentRegistry, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + &__pyx_tp_as_sequence_IdentRegistry, /*tp_as_sequence*/ + &__pyx_tp_as_mapping_IdentRegistry, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + "IdentRegistry()\n\n Maintains a unique mapping of (small) positive integer identifiers\n to objects that can be weakly referenced.\n\n It is guaranteed that no two objects will have the the same\n identifier at the same time, as long as those objects are\n also uniquely hashable.\n ", /*tp_doc*/ + __pyx_tp_traverse_6gevent_7__ident_IdentRegistry, /*tp_traverse*/ + __pyx_tp_clear_6gevent_7__ident_IdentRegistry, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6gevent_7__ident_IdentRegistry, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_pw_6gevent_7__ident_13IdentRegistry_1__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6gevent_7__ident_IdentRegistry, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static PyMethodDef __pyx_methods[] = { + {0, 0, 0, 0} +}; + +#if PY_MAJOR_VERSION >= 3 +#if CYTHON_PEP489_MULTI_PHASE_INIT +static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ +static int __pyx_pymod_exec___ident(PyObject* module); /*proto*/ +static PyModuleDef_Slot __pyx_moduledef_slots[] = { + {Py_mod_create, (void*)__pyx_pymod_create}, + {Py_mod_exec, (void*)__pyx_pymod_exec___ident}, + {0, NULL} +}; +#endif + +static struct PyModuleDef __pyx_moduledef = { + PyModuleDef_HEAD_INIT, + "__ident", + 0, /* m_doc */ + #if CYTHON_PEP489_MULTI_PHASE_INIT + 0, /* m_size */ + #else + -1, /* m_size */ + #endif + __pyx_methods /* m_methods */, + #if CYTHON_PEP489_MULTI_PHASE_INIT + __pyx_moduledef_slots, /* m_slots */ + #else + NULL, /* m_reload */ + #endif + NULL, /* m_traverse */ + NULL, /* m_clear */ + NULL /* m_free */ +}; +#endif +#ifndef CYTHON_SMALL_CODE +#if defined(__clang__) + #define CYTHON_SMALL_CODE +#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) + #define CYTHON_SMALL_CODE __attribute__((cold)) +#else + #define CYTHON_SMALL_CODE +#endif +#endif + +static __Pyx_StringTabEntry __pyx_string_tab[] = { + {&__pyx_n_s_IdentRegistry, __pyx_k_IdentRegistry, sizeof(__pyx_k_IdentRegistry), 0, 0, 1, 1}, + {&__pyx_n_s_IdentRegistry__return_ident, __pyx_k_IdentRegistry__return_ident, sizeof(__pyx_k_IdentRegistry__return_ident), 0, 0, 1, 1}, + {&__pyx_n_s_IdentRegistry_get_ident, __pyx_k_IdentRegistry_get_ident, sizeof(__pyx_k_IdentRegistry_get_ident), 0, 0, 1, 1}, + {&__pyx_n_s_KeyError, __pyx_k_KeyError, sizeof(__pyx_k_KeyError), 0, 0, 1, 1}, + {&__pyx_n_s_ValuedWeakRef, __pyx_k_ValuedWeakRef, sizeof(__pyx_k_ValuedWeakRef), 0, 0, 1, 1}, + {&__pyx_n_s_WeakKeyDictionary, __pyx_k_WeakKeyDictionary, sizeof(__pyx_k_WeakKeyDictionary), 0, 0, 1, 1}, + {&__pyx_n_s_all, __pyx_k_all, sizeof(__pyx_k_all), 0, 0, 1, 1}, + {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, + {&__pyx_n_s_get_ident, __pyx_k_get_ident, sizeof(__pyx_k_get_ident), 0, 0, 1, 1}, + {&__pyx_n_s_gevent___ident, __pyx_k_gevent___ident, sizeof(__pyx_k_gevent___ident), 0, 0, 1, 1}, + {&__pyx_n_s_gevent__util, __pyx_k_gevent__util, sizeof(__pyx_k_gevent__util), 0, 0, 1, 1}, + {&__pyx_n_s_heappop, __pyx_k_heappop, sizeof(__pyx_k_heappop), 0, 0, 1, 1}, + {&__pyx_n_s_heappush, __pyx_k_heappush, sizeof(__pyx_k_heappush), 0, 0, 1, 1}, + {&__pyx_n_s_heapq, __pyx_k_heapq, sizeof(__pyx_k_heapq), 0, 0, 1, 1}, + {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, + {&__pyx_n_s_import_c_accel, __pyx_k_import_c_accel, sizeof(__pyx_k_import_c_accel), 0, 0, 1, 1}, + {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, + {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, + {&__pyx_n_s_obj, __pyx_k_obj, sizeof(__pyx_k_obj), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_capi, __pyx_k_pyx_capi, sizeof(__pyx_k_pyx_capi), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1}, + {&__pyx_n_s_ref, __pyx_k_ref, sizeof(__pyx_k_ref), 0, 0, 1, 1}, + {&__pyx_n_s_return_ident, __pyx_k_return_ident, sizeof(__pyx_k_return_ident), 0, 0, 1, 1}, + {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1}, + {&__pyx_n_s_slots, __pyx_k_slots, sizeof(__pyx_k_slots), 0, 0, 1, 1}, + {&__pyx_kp_s_src_gevent__ident_py, __pyx_k_src_gevent__ident_py, sizeof(__pyx_k_src_gevent__ident_py), 0, 0, 1, 0}, + {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, + {&__pyx_n_s_value, __pyx_k_value, sizeof(__pyx_k_value), 0, 0, 1, 1}, + {&__pyx_n_s_vref, __pyx_k_vref, sizeof(__pyx_k_vref), 0, 0, 1, 1}, + {&__pyx_n_s_weakref, __pyx_k_weakref, sizeof(__pyx_k_weakref), 0, 0, 1, 1}, + {0, 0, 0, 0, 0, 0, 0} +}; +static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { + __pyx_builtin_KeyError = __Pyx_GetBuiltinName(__pyx_n_s_KeyError); if (!__pyx_builtin_KeyError) __PYX_ERR(0, 53, __pyx_L1_error) + return 0; + __pyx_L1_error:; + return -1; +} + +static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); + + /* "src/gevent/_ident.py":25 + * """ + * + * __slots__ = ('value',) # <<<<<<<<<<<<<< + * + * + */ + __pyx_tuple_ = PyTuple_Pack(1, __pyx_n_s_value); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 25, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple_); + __Pyx_GIVEREF(__pyx_tuple_); + + /* "src/gevent/_ident.py":45 + * self._available_idents = [] + * + * def get_ident(self, obj): # <<<<<<<<<<<<<< + * """ + * Retrieve the identifier for *obj*, creating one + */ + __pyx_tuple__2 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_obj); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 45, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2); + __Pyx_GIVEREF(__pyx_tuple__2); + __pyx_codeobj__3 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__ident_py, __pyx_n_s_get_ident, 45, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__3)) __PYX_ERR(0, 45, __pyx_L1_error) + + /* "src/gevent/_ident.py":68 + * return ident + * + * def _return_ident(self, vref): # <<<<<<<<<<<<<< + * # By the time this is called, self._registry has been + * # updated + */ + __pyx_tuple__4 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_vref); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 68, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__4); + __Pyx_GIVEREF(__pyx_tuple__4); + __pyx_codeobj__5 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__4, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__ident_py, __pyx_n_s_return_ident, 68, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__5)) __PYX_ERR(0, 68, __pyx_L1_error) + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} + +static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { + if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + return 0; + __pyx_L1_error:; + return -1; +} + +static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/ + +static int __Pyx_modinit_global_init_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); + /*--- Global init code ---*/ + __pyx_v_6gevent_7__ident_heappop = Py_None; Py_INCREF(Py_None); + __pyx_v_6gevent_7__ident_heappush = Py_None; Py_INCREF(Py_None); + __pyx_v_6gevent_7__ident_WeakKeyDictionary = Py_None; Py_INCREF(Py_None); + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_variable_export_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); + /*--- Variable export code ---*/ + if (__Pyx_ExportVoidPtr(__pyx_n_s_heappop, (void *)&__pyx_v_6gevent_7__ident_heappop, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportVoidPtr(__pyx_n_s_heappush, (void *)&__pyx_v_6gevent_7__ident_heappush, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportVoidPtr(__pyx_n_s_WeakKeyDictionary, (void *)&__pyx_v_6gevent_7__ident_WeakKeyDictionary, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_modinit_function_export_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); + /*--- Function export code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_type_init_code(void) { + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); + /*--- Type init code ---*/ + __pyx_t_1 = PyImport_ImportModule("weakref"); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_ptype_6gevent_7__ident_ref = __Pyx_ImportType(__pyx_t_1, "weakref", "ref", sizeof(PyWeakReference), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_7__ident_ref) __PYX_ERR(1, 5, __pyx_L1_error) + __pyx_type_6gevent_7__ident_ValuedWeakRef.tp_base = __pyx_ptype_6gevent_7__ident_ref; + if (PyType_Ready(&__pyx_type_6gevent_7__ident_ValuedWeakRef) < 0) __PYX_ERR(0, 20, __pyx_L1_error) + __pyx_type_6gevent_7__ident_ValuedWeakRef.tp_print = 0; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6gevent_7__ident_ValuedWeakRef.tp_dictoffset && __pyx_type_6gevent_7__ident_ValuedWeakRef.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_type_6gevent_7__ident_ValuedWeakRef.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + } + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_ValuedWeakRef, (PyObject *)&__pyx_type_6gevent_7__ident_ValuedWeakRef) < 0) __PYX_ERR(0, 20, __pyx_L1_error) + __pyx_ptype_6gevent_7__ident_ValuedWeakRef = &__pyx_type_6gevent_7__ident_ValuedWeakRef; + __pyx_vtabptr_6gevent_7__ident_IdentRegistry = &__pyx_vtable_6gevent_7__ident_IdentRegistry; + __pyx_vtable_6gevent_7__ident_IdentRegistry.get_ident = (PyObject *(*)(struct __pyx_obj_6gevent_7__ident_IdentRegistry *, PyObject *, int __pyx_skip_dispatch))__pyx_f_6gevent_7__ident_13IdentRegistry_get_ident; + __pyx_vtable_6gevent_7__ident_IdentRegistry._return_ident = (PyObject *(*)(struct __pyx_obj_6gevent_7__ident_IdentRegistry *, struct __pyx_obj_6gevent_7__ident_ValuedWeakRef *, int __pyx_skip_dispatch))__pyx_f_6gevent_7__ident_13IdentRegistry__return_ident; + if (PyType_Ready(&__pyx_type_6gevent_7__ident_IdentRegistry) < 0) __PYX_ERR(0, 28, __pyx_L1_error) + __pyx_type_6gevent_7__ident_IdentRegistry.tp_print = 0; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6gevent_7__ident_IdentRegistry.tp_dictoffset && __pyx_type_6gevent_7__ident_IdentRegistry.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_type_6gevent_7__ident_IdentRegistry.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + } + if (__Pyx_SetVtable(__pyx_type_6gevent_7__ident_IdentRegistry.tp_dict, __pyx_vtabptr_6gevent_7__ident_IdentRegistry) < 0) __PYX_ERR(0, 28, __pyx_L1_error) + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_IdentRegistry, (PyObject *)&__pyx_type_6gevent_7__ident_IdentRegistry) < 0) __PYX_ERR(0, 28, __pyx_L1_error) + __pyx_ptype_6gevent_7__ident_IdentRegistry = &__pyx_type_6gevent_7__ident_IdentRegistry; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_modinit_type_import_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); + /*--- Type import code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_variable_import_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); + /*--- Variable import code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_function_import_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); + /*--- Function import code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + + +#if PY_MAJOR_VERSION < 3 +#ifdef CYTHON_NO_PYINIT_EXPORT +#define __Pyx_PyMODINIT_FUNC void +#else +#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC +#endif +#else +#ifdef CYTHON_NO_PYINIT_EXPORT +#define __Pyx_PyMODINIT_FUNC PyObject * +#else +#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC +#endif +#endif + + +#if PY_MAJOR_VERSION < 3 +__Pyx_PyMODINIT_FUNC init__ident(void) CYTHON_SMALL_CODE; /*proto*/ +__Pyx_PyMODINIT_FUNC init__ident(void) +#else +__Pyx_PyMODINIT_FUNC PyInit___ident(void) CYTHON_SMALL_CODE; /*proto*/ +__Pyx_PyMODINIT_FUNC PyInit___ident(void) +#if CYTHON_PEP489_MULTI_PHASE_INIT +{ + return PyModuleDef_Init(&__pyx_moduledef); +} +static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { + #if PY_VERSION_HEX >= 0x030700A1 + static PY_INT64_T main_interpreter_id = -1; + PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); + if (main_interpreter_id == -1) { + main_interpreter_id = current_id; + return (unlikely(current_id == -1)) ? -1 : 0; + } else if (unlikely(main_interpreter_id != current_id)) + #else + static PyInterpreterState *main_interpreter = NULL; + PyInterpreterState *current_interpreter = PyThreadState_Get()->interp; + if (!main_interpreter) { + main_interpreter = current_interpreter; + } else if (unlikely(main_interpreter != current_interpreter)) + #endif + { + PyErr_SetString( + PyExc_ImportError, + "Interpreter change detected - this module can only be loaded into one interpreter per process."); + return -1; + } + return 0; +} +static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) { + PyObject *value = PyObject_GetAttrString(spec, from_name); + int result = 0; + if (likely(value)) { + if (allow_none || value != Py_None) { + result = PyDict_SetItemString(moddict, to_name, value); + } + Py_DECREF(value); + } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_Clear(); + } else { + result = -1; + } + return result; +} +static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) { + PyObject *module = NULL, *moddict, *modname; + if (__Pyx_check_single_interpreter()) + return NULL; + if (__pyx_m) + return __Pyx_NewRef(__pyx_m); + modname = PyObject_GetAttrString(spec, "name"); + if (unlikely(!modname)) goto bad; + module = PyModule_NewObject(modname); + Py_DECREF(modname); + if (unlikely(!module)) goto bad; + moddict = PyModule_GetDict(module); + if (unlikely(!moddict)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad; + return module; +bad: + Py_XDECREF(module); + return NULL; +} + + +static CYTHON_SMALL_CODE int __pyx_pymod_exec___ident(PyObject *__pyx_pyinit_module) +#endif +#endif +{ + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannyDeclarations + #if CYTHON_PEP489_MULTI_PHASE_INIT + if (__pyx_m) { + if (__pyx_m == __pyx_pyinit_module) return 0; + PyErr_SetString(PyExc_RuntimeError, "Module '__ident' has already been imported. Re-initialisation is not supported."); + return -1; + } + #elif PY_MAJOR_VERSION >= 3 + if (__pyx_m) return __Pyx_NewRef(__pyx_m); + #endif + #if CYTHON_REFNANNY +__Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); +if (!__Pyx_RefNanny) { + PyErr_Clear(); + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); + if (!__Pyx_RefNanny) + Py_FatalError("failed to import 'refnanny' module"); +} +#endif + __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit___ident(void)", 0); + if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #ifdef __Pxy_PyFrame_Initialize_Offsets + __Pxy_PyFrame_Initialize_Offsets(); + #endif + __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) + #ifdef __Pyx_CyFunction_USED + if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_FusedFunction_USED + if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_Coroutine_USED + if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_Generator_USED + if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_AsyncGen_USED + if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_StopAsyncIteration_USED + if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + /*--- Library function declarations ---*/ + /*--- Threads initialization code ---*/ + #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS + #ifdef WITH_THREAD /* Python build with threading support? */ + PyEval_InitThreads(); + #endif + #endif + /*--- Module creation code ---*/ + #if CYTHON_PEP489_MULTI_PHASE_INIT + __pyx_m = __pyx_pyinit_module; + Py_INCREF(__pyx_m); + #else + #if PY_MAJOR_VERSION < 3 + __pyx_m = Py_InitModule4("__ident", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); + #else + __pyx_m = PyModule_Create(&__pyx_moduledef); + #endif + if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) + Py_INCREF(__pyx_d); + __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) + #if CYTHON_COMPILING_IN_PYPY + Py_INCREF(__pyx_b); + #endif + if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + /*--- Initialize various global constants etc. ---*/ + if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) + if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + if (__pyx_module_is_main_gevent____ident) { + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + } + #if PY_MAJOR_VERSION >= 3 + { + PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) + if (!PyDict_GetItemString(modules, "gevent.__ident")) { + if (unlikely(PyDict_SetItemString(modules, "gevent.__ident", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error) + } + } + #endif + /*--- Builtin init code ---*/ + if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + /*--- Constants init code ---*/ + if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + /*--- Global type/function init code ---*/ + (void)__Pyx_modinit_global_init_code(); + if (unlikely(__Pyx_modinit_variable_export_code() != 0)) goto __pyx_L1_error; + (void)__Pyx_modinit_function_export_code(); + if (unlikely(__Pyx_modinit_type_init_code() != 0)) goto __pyx_L1_error; + (void)__Pyx_modinit_type_import_code(); + (void)__Pyx_modinit_variable_import_code(); + (void)__Pyx_modinit_function_import_code(); + /*--- Execution code ---*/ + #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) + if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + + /* "src/gevent/_ident.py":10 + * + * + * from weakref import WeakKeyDictionary # <<<<<<<<<<<<<< + * from weakref import ref + * + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_WeakKeyDictionary); + __Pyx_GIVEREF(__pyx_n_s_WeakKeyDictionary); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_WeakKeyDictionary); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_weakref, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_WeakKeyDictionary); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_v_6gevent_7__ident_WeakKeyDictionary); + __Pyx_DECREF_SET(__pyx_v_6gevent_7__ident_WeakKeyDictionary, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/_ident.py":11 + * + * from weakref import WeakKeyDictionary + * from weakref import ref # <<<<<<<<<<<<<< + * + * from heapq import heappop + */ + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 11, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_ref); + __Pyx_GIVEREF(__pyx_n_s_ref); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_ref); + __pyx_t_1 = __Pyx_Import(__pyx_n_s_weakref, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 11, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_ident.py":13 + * from weakref import ref + * + * from heapq import heappop # <<<<<<<<<<<<<< + * from heapq import heappush + * + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_heappop); + __Pyx_GIVEREF(__pyx_n_s_heappop); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_heappop); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_heapq, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_heappop); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_v_6gevent_7__ident_heappop); + __Pyx_DECREF_SET(__pyx_v_6gevent_7__ident_heappop, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/_ident.py":14 + * + * from heapq import heappop + * from heapq import heappush # <<<<<<<<<<<<<< + * + * __all__ = [ + */ + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 14, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_heappush); + __Pyx_GIVEREF(__pyx_n_s_heappush); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_heappush); + __pyx_t_1 = __Pyx_Import(__pyx_n_s_heapq, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 14, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_heappush); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 14, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_v_6gevent_7__ident_heappush); + __Pyx_DECREF_SET(__pyx_v_6gevent_7__ident_heappush, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_ident.py":16 + * from heapq import heappush + * + * __all__ = [ # <<<<<<<<<<<<<< + * 'IdentRegistry', + * ] + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 16, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_IdentRegistry); + __Pyx_GIVEREF(__pyx_n_s_IdentRegistry); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_IdentRegistry); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_all, __pyx_t_1) < 0) __PYX_ERR(0, 16, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_ident.py":25 + * """ + * + * __slots__ = ('value',) # <<<<<<<<<<<<<< + * + * + */ + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_7__ident_ValuedWeakRef->tp_dict, __pyx_n_s_slots, __pyx_tuple_) < 0) __PYX_ERR(0, 25, __pyx_L1_error) + PyType_Modified(__pyx_ptype_6gevent_7__ident_ValuedWeakRef); + + /* "src/gevent/_ident.py":45 + * self._available_idents = [] + * + * def get_ident(self, obj): # <<<<<<<<<<<<<< + * """ + * Retrieve the identifier for *obj*, creating one + */ + __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_7__ident_13IdentRegistry_3get_ident, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_IdentRegistry_get_ident, NULL, __pyx_n_s_gevent___ident, __pyx_d, ((PyObject *)__pyx_codeobj__3)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 45, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_7__ident_IdentRegistry->tp_dict, __pyx_n_s_get_ident, __pyx_t_1) < 0) __PYX_ERR(0, 45, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + PyType_Modified(__pyx_ptype_6gevent_7__ident_IdentRegistry); + + /* "src/gevent/_ident.py":68 + * return ident + * + * def _return_ident(self, vref): # <<<<<<<<<<<<<< + * # By the time this is called, self._registry has been + * # updated + */ + __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_7__ident_13IdentRegistry_5_return_ident, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_IdentRegistry__return_ident, NULL, __pyx_n_s_gevent___ident, __pyx_d, ((PyObject *)__pyx_codeobj__5)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 68, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_7__ident_IdentRegistry->tp_dict, __pyx_n_s_return_ident, __pyx_t_1) < 0) __PYX_ERR(0, 68, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + PyType_Modified(__pyx_ptype_6gevent_7__ident_IdentRegistry); + + /* "src/gevent/_ident.py":81 + * + * + * from gevent._util import import_c_accel # <<<<<<<<<<<<<< + * import_c_accel(globals(), 'gevent.__ident') + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 81, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_import_c_accel); + __Pyx_GIVEREF(__pyx_n_s_import_c_accel); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_import_c_accel); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_gevent__util, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 81, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_import_c_accel); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 81, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_import_c_accel, __pyx_t_1) < 0) __PYX_ERR(0, 81, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/_ident.py":82 + * + * from gevent._util import import_c_accel + * import_c_accel(globals(), 'gevent.__ident') # <<<<<<<<<<<<<< + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_import_c_accel); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 82, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_Globals(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 82, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 82, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_INCREF(__pyx_n_s_gevent___ident); + __Pyx_GIVEREF(__pyx_n_s_gevent___ident); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_n_s_gevent___ident); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 82, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_ident.py":1 + * # -*- coding: utf-8 -*- # <<<<<<<<<<<<<< + * # Copyright 2018 gevent contributors. See LICENSE for details. + * # cython: auto_pickle=False,embedsignature=True,always_allow_keywords=False + */ + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /*--- Wrapped vars code ---*/ + + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + if (__pyx_m) { + if (__pyx_d) { + __Pyx_AddTraceback("init gevent.__ident", __pyx_clineno, __pyx_lineno, __pyx_filename); + } + Py_CLEAR(__pyx_m); + } else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_ImportError, "init gevent.__ident"); + } + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + #if CYTHON_PEP489_MULTI_PHASE_INIT + return (__pyx_m != NULL) ? 0 : -1; + #elif PY_MAJOR_VERSION >= 3 + return __pyx_m; + #else + return; + #endif +} + +/* --- Runtime support code --- */ +/* Refnanny */ +#if CYTHON_REFNANNY +static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { + PyObject *m = NULL, *p = NULL; + void *r = NULL; + m = PyImport_ImportModule(modname); + if (!m) goto end; + p = PyObject_GetAttrString(m, "RefNannyAPI"); + if (!p) goto end; + r = PyLong_AsVoidPtr(p); +end: + Py_XDECREF(p); + Py_XDECREF(m); + return (__Pyx_RefNannyAPIStruct *)r; +} +#endif + +/* PyObjectGetAttrStr */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_getattro)) + return tp->tp_getattro(obj, attr_name); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_getattr)) + return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); +#endif + return PyObject_GetAttr(obj, attr_name); +} +#endif + +/* GetBuiltinName */ +static PyObject *__Pyx_GetBuiltinName(PyObject *name) { + PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name); + if (unlikely(!result)) { + PyErr_Format(PyExc_NameError, +#if PY_MAJOR_VERSION >= 3 + "name '%U' is not defined", name); +#else + "name '%.200s' is not defined", PyString_AS_STRING(name)); +#endif + } + return result; +} + +/* RaiseArgTupleInvalid */ +static void __Pyx_RaiseArgtupleInvalid( + const char* func_name, + int exact, + Py_ssize_t num_min, + Py_ssize_t num_max, + Py_ssize_t num_found) +{ + Py_ssize_t num_expected; + const char *more_or_less; + if (num_found < num_min) { + num_expected = num_min; + more_or_less = "at least"; + } else { + num_expected = num_max; + more_or_less = "at most"; + } + if (exact) { + more_or_less = "exactly"; + } + PyErr_Format(PyExc_TypeError, + "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", + func_name, more_or_less, num_expected, + (num_expected == 1) ? "" : "s", num_found); +} + +/* KeywordStringCheck */ +static int __Pyx_CheckKeywordStrings( + PyObject *kwdict, + const char* function_name, + int kw_allowed) +{ + PyObject* key = 0; + Py_ssize_t pos = 0; +#if CYTHON_COMPILING_IN_PYPY + if (!kw_allowed && PyDict_Next(kwdict, &pos, &key, 0)) + goto invalid_keyword; + return 1; +#else + while (PyDict_Next(kwdict, &pos, &key, 0)) { + #if PY_MAJOR_VERSION < 3 + if (unlikely(!PyString_Check(key))) + #endif + if (unlikely(!PyUnicode_Check(key))) + goto invalid_keyword_type; + } + if ((!kw_allowed) && unlikely(key)) + goto invalid_keyword; + return 1; +invalid_keyword_type: + PyErr_Format(PyExc_TypeError, + "%.200s() keywords must be strings", function_name); + return 0; +#endif +invalid_keyword: + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION < 3 + "%.200s() got an unexpected keyword argument '%.200s'", + function_name, PyString_AsString(key)); + #else + "%s() got an unexpected keyword argument '%U'", + function_name, key); + #endif + return 0; +} + +/* PyFunctionFastCall */ +#if CYTHON_FAST_PYCALL +static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, + PyObject *globals) { + PyFrameObject *f; + PyThreadState *tstate = __Pyx_PyThreadState_Current; + PyObject **fastlocals; + Py_ssize_t i; + PyObject *result; + assert(globals != NULL); + /* XXX Perhaps we should create a specialized + PyFrame_New() that doesn't take locals, but does + take builtins without sanity checking them. + */ + assert(tstate != NULL); + f = PyFrame_New(tstate, co, globals, NULL); + if (f == NULL) { + return NULL; + } + fastlocals = __Pyx_PyFrame_GetLocalsplus(f); + for (i = 0; i < na; i++) { + Py_INCREF(*args); + fastlocals[i] = *args++; + } + result = PyEval_EvalFrameEx(f,0); + ++tstate->recursion_depth; + Py_DECREF(f); + --tstate->recursion_depth; + return result; +} +#if 1 || PY_VERSION_HEX < 0x030600B1 +static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs) { + PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); + PyObject *globals = PyFunction_GET_GLOBALS(func); + PyObject *argdefs = PyFunction_GET_DEFAULTS(func); + PyObject *closure; +#if PY_MAJOR_VERSION >= 3 + PyObject *kwdefs; +#endif + PyObject *kwtuple, **k; + PyObject **d; + Py_ssize_t nd; + Py_ssize_t nk; + PyObject *result; + assert(kwargs == NULL || PyDict_Check(kwargs)); + nk = kwargs ? PyDict_Size(kwargs) : 0; + if (Py_EnterRecursiveCall((char*)" while calling a Python object")) { + return NULL; + } + if ( +#if PY_MAJOR_VERSION >= 3 + co->co_kwonlyargcount == 0 && +#endif + likely(kwargs == NULL || nk == 0) && + co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { + if (argdefs == NULL && co->co_argcount == nargs) { + result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); + goto done; + } + else if (nargs == 0 && argdefs != NULL + && co->co_argcount == Py_SIZE(argdefs)) { + /* function called with no arguments, but all parameters have + a default value: use default values as arguments .*/ + args = &PyTuple_GET_ITEM(argdefs, 0); + result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); + goto done; + } + } + if (kwargs != NULL) { + Py_ssize_t pos, i; + kwtuple = PyTuple_New(2 * nk); + if (kwtuple == NULL) { + result = NULL; + goto done; + } + k = &PyTuple_GET_ITEM(kwtuple, 0); + pos = i = 0; + while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { + Py_INCREF(k[i]); + Py_INCREF(k[i+1]); + i += 2; + } + nk = i / 2; + } + else { + kwtuple = NULL; + k = NULL; + } + closure = PyFunction_GET_CLOSURE(func); +#if PY_MAJOR_VERSION >= 3 + kwdefs = PyFunction_GET_KW_DEFAULTS(func); +#endif + if (argdefs != NULL) { + d = &PyTuple_GET_ITEM(argdefs, 0); + nd = Py_SIZE(argdefs); + } + else { + d = NULL; + nd = 0; + } +#if PY_MAJOR_VERSION >= 3 + result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, + args, nargs, + k, (int)nk, + d, (int)nd, kwdefs, closure); +#else + result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, + args, nargs, + k, (int)nk, + d, (int)nd, closure); +#endif + Py_XDECREF(kwtuple); +done: + Py_LeaveRecursiveCall(); + return result; +} +#endif +#endif + +/* PyObjectCall */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { + PyObject *result; + ternaryfunc call = func->ob_type->tp_call; + if (unlikely(!call)) + return PyObject_Call(func, arg, kw); + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; + result = (*call)(func, arg, kw); + Py_LeaveRecursiveCall(); + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +/* PyObjectCallMethO */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { + PyObject *self, *result; + PyCFunction cfunc; + cfunc = PyCFunction_GET_FUNCTION(func); + self = PyCFunction_GET_SELF(func); + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; + result = cfunc(self, arg); + Py_LeaveRecursiveCall(); + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +/* PyObjectCallNoArg */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { +#if CYTHON_FAST_PYCALL + if (PyFunction_Check(func)) { + return __Pyx_PyFunction_FastCall(func, NULL, 0); + } +#endif +#ifdef __Pyx_CyFunction_USED + if (likely(PyCFunction_Check(func) || __Pyx_CyFunction_Check(func))) +#else + if (likely(PyCFunction_Check(func))) +#endif + { + if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) { + return __Pyx_PyObject_CallMethO(func, NULL); + } + } + return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL); +} +#endif + +/* PyCFunctionFastCall */ +#if CYTHON_FAST_PYCCALL +static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) { + PyCFunctionObject *func = (PyCFunctionObject*)func_obj; + PyCFunction meth = PyCFunction_GET_FUNCTION(func); + PyObject *self = PyCFunction_GET_SELF(func); + int flags = PyCFunction_GET_FLAGS(func); + assert(PyCFunction_Check(func)); + assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS))); + assert(nargs >= 0); + assert(nargs == 0 || args != NULL); + /* _PyCFunction_FastCallDict() must not be called with an exception set, + because it may clear it (directly or indirectly) and so the + caller loses its exception */ + assert(!PyErr_Occurred()); + if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) { + return (*((__Pyx_PyCFunctionFastWithKeywords)(void*)meth)) (self, args, nargs, NULL); + } else { + return (*((__Pyx_PyCFunctionFast)(void*)meth)) (self, args, nargs); + } +} +#endif + +/* PyObjectCallOneArg */ +#if CYTHON_COMPILING_IN_CPYTHON +static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) { + PyObject *result; + PyObject *args = PyTuple_New(1); + if (unlikely(!args)) return NULL; + Py_INCREF(arg); + PyTuple_SET_ITEM(args, 0, arg); + result = __Pyx_PyObject_Call(func, args, NULL); + Py_DECREF(args); + return result; +} +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { +#if CYTHON_FAST_PYCALL + if (PyFunction_Check(func)) { + return __Pyx_PyFunction_FastCall(func, &arg, 1); + } +#endif + if (likely(PyCFunction_Check(func))) { + if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) { + return __Pyx_PyObject_CallMethO(func, arg); +#if CYTHON_FAST_PYCCALL + } else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) { + return __Pyx_PyCFunction_FastCall(func, &arg, 1); +#endif + } + } + return __Pyx__PyObject_CallOneArg(func, arg); +} +#else +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { + PyObject *result; + PyObject *args = PyTuple_Pack(1, arg); + if (unlikely(!args)) return NULL; + result = __Pyx_PyObject_Call(func, args, NULL); + Py_DECREF(args); + return result; +} +#endif + +/* GetItemInt */ +static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { + PyObject *r; + if (!j) return NULL; + r = PyObject_GetItem(o, j); + Py_DECREF(j); + return r; +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, + CYTHON_NCP_UNUSED int wraparound, + CYTHON_NCP_UNUSED int boundscheck) { +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + Py_ssize_t wrapped_i = i; + if (wraparound & unlikely(i < 0)) { + wrapped_i += PyList_GET_SIZE(o); + } + if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) { + PyObject *r = PyList_GET_ITEM(o, wrapped_i); + Py_INCREF(r); + return r; + } + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +#else + return PySequence_GetItem(o, i); +#endif +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, + CYTHON_NCP_UNUSED int wraparound, + CYTHON_NCP_UNUSED int boundscheck) { +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + Py_ssize_t wrapped_i = i; + if (wraparound & unlikely(i < 0)) { + wrapped_i += PyTuple_GET_SIZE(o); + } + if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) { + PyObject *r = PyTuple_GET_ITEM(o, wrapped_i); + Py_INCREF(r); + return r; + } + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +#else + return PySequence_GetItem(o, i); +#endif +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, + CYTHON_NCP_UNUSED int wraparound, + CYTHON_NCP_UNUSED int boundscheck) { +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS + if (is_list || PyList_CheckExact(o)) { + Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); + if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) { + PyObject *r = PyList_GET_ITEM(o, n); + Py_INCREF(r); + return r; + } + } + else if (PyTuple_CheckExact(o)) { + Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o); + if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) { + PyObject *r = PyTuple_GET_ITEM(o, n); + Py_INCREF(r); + return r; + } + } else { + PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence; + if (likely(m && m->sq_item)) { + if (wraparound && unlikely(i < 0) && likely(m->sq_length)) { + Py_ssize_t l = m->sq_length(o); + if (likely(l >= 0)) { + i += l; + } else { + if (!PyErr_ExceptionMatches(PyExc_OverflowError)) + return NULL; + PyErr_Clear(); + } + } + return m->sq_item(o, i); + } + } +#else + if (is_list || PySequence_Check(o)) { + return PySequence_GetItem(o, i); + } +#endif + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +} + +/* ObjectGetItem */ +#if CYTHON_USE_TYPE_SLOTS +static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject* index) { + PyObject *runerr; + Py_ssize_t key_value; + PySequenceMethods *m = Py_TYPE(obj)->tp_as_sequence; + if (unlikely(!(m && m->sq_item))) { + PyErr_Format(PyExc_TypeError, "'%.200s' object is not subscriptable", Py_TYPE(obj)->tp_name); + return NULL; + } + key_value = __Pyx_PyIndex_AsSsize_t(index); + if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) { + return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1); + } + if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) { + PyErr_Clear(); + PyErr_Format(PyExc_IndexError, "cannot fit '%.200s' into an index-sized integer", Py_TYPE(index)->tp_name); + } + return NULL; +} +static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key) { + PyMappingMethods *m = Py_TYPE(obj)->tp_as_mapping; + if (likely(m && m->mp_subscript)) { + return m->mp_subscript(obj, key); + } + return __Pyx_PyObject_GetIndex(obj, key); +} +#endif + +/* GetTopmostException */ +#if CYTHON_USE_EXC_INFO_STACK +static _PyErr_StackItem * +__Pyx_PyErr_GetTopmostException(PyThreadState *tstate) +{ + _PyErr_StackItem *exc_info = tstate->exc_info; + while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) && + exc_info->previous_item != NULL) + { + exc_info = exc_info->previous_item; + } + return exc_info; +} +#endif + +/* SaveResetException */ +#if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { + #if CYTHON_USE_EXC_INFO_STACK + _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate); + *type = exc_info->exc_type; + *value = exc_info->exc_value; + *tb = exc_info->exc_traceback; + #else + *type = tstate->exc_type; + *value = tstate->exc_value; + *tb = tstate->exc_traceback; + #endif + Py_XINCREF(*type); + Py_XINCREF(*value); + Py_XINCREF(*tb); +} +static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + #if CYTHON_USE_EXC_INFO_STACK + _PyErr_StackItem *exc_info = tstate->exc_info; + tmp_type = exc_info->exc_type; + tmp_value = exc_info->exc_value; + tmp_tb = exc_info->exc_traceback; + exc_info->exc_type = type; + exc_info->exc_value = value; + exc_info->exc_traceback = tb; + #else + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = type; + tstate->exc_value = value; + tstate->exc_traceback = tb; + #endif + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +} +#endif + +/* PyErrExceptionMatches */ +#if CYTHON_FAST_THREAD_STATE +static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { + Py_ssize_t i, n; + n = PyTuple_GET_SIZE(tuple); +#if PY_MAJOR_VERSION >= 3 + for (i=0; icurexc_type; + if (exc_type == err) return 1; + if (unlikely(!exc_type)) return 0; + if (unlikely(PyTuple_Check(err))) + return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err); + return __Pyx_PyErr_GivenExceptionMatches(exc_type, err); +} +#endif + +/* PyErrFetchRestore */ +#if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + tmp_type = tstate->curexc_type; + tmp_value = tstate->curexc_value; + tmp_tb = tstate->curexc_traceback; + tstate->curexc_type = type; + tstate->curexc_value = value; + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +} +static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { + *type = tstate->curexc_type; + *value = tstate->curexc_value; + *tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +} +#endif + +/* PyObjectCall2Args */ +static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) { + PyObject *args, *result = NULL; + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(function)) { + PyObject *args[2] = {arg1, arg2}; + return __Pyx_PyFunction_FastCall(function, args, 2); + } + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(function)) { + PyObject *args[2] = {arg1, arg2}; + return __Pyx_PyCFunction_FastCall(function, args, 2); + } + #endif + args = PyTuple_New(2); + if (unlikely(!args)) goto done; + Py_INCREF(arg1); + PyTuple_SET_ITEM(args, 0, arg1); + Py_INCREF(arg2); + PyTuple_SET_ITEM(args, 1, arg2); + Py_INCREF(function); + result = __Pyx_PyObject_Call(function, args, NULL); + Py_DECREF(args); + Py_DECREF(function); +done: + return result; +} + +/* ArgTypeTest */ +static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact) +{ + if (unlikely(!type)) { + PyErr_SetString(PyExc_SystemError, "Missing type object"); + return 0; + } + else if (exact) { + #if PY_MAJOR_VERSION == 2 + if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1; + #endif + } + else { + if (likely(__Pyx_TypeCheck(obj, type))) return 1; + } + PyErr_Format(PyExc_TypeError, + "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)", + name, type->tp_name, Py_TYPE(obj)->tp_name); + return 0; +} + +/* CallNextTpDealloc */ +static void __Pyx_call_next_tp_dealloc(PyObject* obj, destructor current_tp_dealloc) { + PyTypeObject* type = Py_TYPE(obj); + while (type && type->tp_dealloc != current_tp_dealloc) + type = type->tp_base; + while (type && type->tp_dealloc == current_tp_dealloc) + type = type->tp_base; + if (type) + type->tp_dealloc(obj); +} + +/* CallNextTpTraverse */ +static int __Pyx_call_next_tp_traverse(PyObject* obj, visitproc v, void *a, traverseproc current_tp_traverse) { + PyTypeObject* type = Py_TYPE(obj); + while (type && type->tp_traverse != current_tp_traverse) + type = type->tp_base; + while (type && type->tp_traverse == current_tp_traverse) + type = type->tp_base; + if (type && type->tp_traverse) + return type->tp_traverse(obj, v, a); + return 0; +} + +/* CallNextTpClear */ +static void __Pyx_call_next_tp_clear(PyObject* obj, inquiry current_tp_clear) { + PyTypeObject* type = Py_TYPE(obj); + while (type && type->tp_clear != current_tp_clear) + type = type->tp_base; + while (type && type->tp_clear == current_tp_clear) + type = type->tp_base; + if (type && type->tp_clear) + type->tp_clear(obj); +} + +/* TypeImport */ +#ifndef __PYX_HAVE_RT_ImportType +#define __PYX_HAVE_RT_ImportType +static PyTypeObject *__Pyx_ImportType(PyObject *module, const char *module_name, const char *class_name, + size_t size, enum __Pyx_ImportType_CheckSize check_size) +{ + PyObject *result = 0; + char warning[200]; + Py_ssize_t basicsize; +#ifdef Py_LIMITED_API + PyObject *py_basicsize; +#endif + result = PyObject_GetAttrString(module, class_name); + if (!result) + goto bad; + if (!PyType_Check(result)) { + PyErr_Format(PyExc_TypeError, + "%.200s.%.200s is not a type object", + module_name, class_name); + goto bad; + } +#ifndef Py_LIMITED_API + basicsize = ((PyTypeObject *)result)->tp_basicsize; +#else + py_basicsize = PyObject_GetAttrString(result, "__basicsize__"); + if (!py_basicsize) + goto bad; + basicsize = PyLong_AsSsize_t(py_basicsize); + Py_DECREF(py_basicsize); + py_basicsize = 0; + if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred()) + goto bad; +#endif + if ((size_t)basicsize < size) { + PyErr_Format(PyExc_ValueError, + "%.200s.%.200s size changed, may indicate binary incompatibility. " + "Expected %zd from C header, got %zd from PyObject", + module_name, class_name, size, basicsize); + goto bad; + } + if (check_size == __Pyx_ImportType_CheckSize_Error && (size_t)basicsize != size) { + PyErr_Format(PyExc_ValueError, + "%.200s.%.200s size changed, may indicate binary incompatibility. " + "Expected %zd from C header, got %zd from PyObject", + module_name, class_name, size, basicsize); + goto bad; + } + else if (check_size == __Pyx_ImportType_CheckSize_Warn && (size_t)basicsize > size) { + PyOS_snprintf(warning, sizeof(warning), + "%s.%s size changed, may indicate binary incompatibility. " + "Expected %zd from C header, got %zd from PyObject", + module_name, class_name, size, basicsize); + if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad; + } + return (PyTypeObject *)result; +bad: + Py_XDECREF(result); + return NULL; +} +#endif + +/* PyObject_GenericGetAttrNoDict */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) { + PyErr_Format(PyExc_AttributeError, +#if PY_MAJOR_VERSION >= 3 + "'%.50s' object has no attribute '%U'", + tp->tp_name, attr_name); +#else + "'%.50s' object has no attribute '%.400s'", + tp->tp_name, PyString_AS_STRING(attr_name)); +#endif + return NULL; +} +static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) { + PyObject *descr; + PyTypeObject *tp = Py_TYPE(obj); + if (unlikely(!PyString_Check(attr_name))) { + return PyObject_GenericGetAttr(obj, attr_name); + } + assert(!tp->tp_dictoffset); + descr = _PyType_Lookup(tp, attr_name); + if (unlikely(!descr)) { + return __Pyx_RaiseGenericGetAttributeError(tp, attr_name); + } + Py_INCREF(descr); + #if PY_MAJOR_VERSION < 3 + if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS))) + #endif + { + descrgetfunc f = Py_TYPE(descr)->tp_descr_get; + if (unlikely(f)) { + PyObject *res = f(descr, obj, (PyObject *)tp); + Py_DECREF(descr); + return res; + } + } + return descr; +} +#endif + +/* SetVTable */ +static int __Pyx_SetVtable(PyObject *dict, void *vtable) { +#if PY_VERSION_HEX >= 0x02070000 + PyObject *ob = PyCapsule_New(vtable, 0, 0); +#else + PyObject *ob = PyCObject_FromVoidPtr(vtable, 0); +#endif + if (!ob) + goto bad; + if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0) + goto bad; + Py_DECREF(ob); + return 0; +bad: + Py_XDECREF(ob); + return -1; +} + +/* Import */ +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { + PyObject *empty_list = 0; + PyObject *module = 0; + PyObject *global_dict = 0; + PyObject *empty_dict = 0; + PyObject *list; + #if PY_MAJOR_VERSION < 3 + PyObject *py_import; + py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); + if (!py_import) + goto bad; + #endif + if (from_list) + list = from_list; + else { + empty_list = PyList_New(0); + if (!empty_list) + goto bad; + list = empty_list; + } + global_dict = PyModule_GetDict(__pyx_m); + if (!global_dict) + goto bad; + empty_dict = PyDict_New(); + if (!empty_dict) + goto bad; + { + #if PY_MAJOR_VERSION >= 3 + if (level == -1) { + if (strchr(__Pyx_MODULE_NAME, '.')) { + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, 1); + if (!module) { + if (!PyErr_ExceptionMatches(PyExc_ImportError)) + goto bad; + PyErr_Clear(); + } + } + level = 0; + } + #endif + if (!module) { + #if PY_MAJOR_VERSION < 3 + PyObject *py_level = PyInt_FromLong(level); + if (!py_level) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, py_level, (PyObject *)NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, level); + #endif + } + } +bad: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(py_import); + #endif + Py_XDECREF(empty_list); + Py_XDECREF(empty_dict); + return module; +} + +/* ImportFrom */ +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { + PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); + if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_Format(PyExc_ImportError, + #if PY_MAJOR_VERSION < 3 + "cannot import name %.230s", PyString_AS_STRING(name)); + #else + "cannot import name %S", name); + #endif + } + return value; +} + +/* FetchCommonType */ +static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { + PyObject* fake_module; + PyTypeObject* cached_type = NULL; + fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI); + if (!fake_module) return NULL; + Py_INCREF(fake_module); + cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name); + if (cached_type) { + if (!PyType_Check((PyObject*)cached_type)) { + PyErr_Format(PyExc_TypeError, + "Shared Cython type %.200s is not a type object", + type->tp_name); + goto bad; + } + if (cached_type->tp_basicsize != type->tp_basicsize) { + PyErr_Format(PyExc_TypeError, + "Shared Cython type %.200s has the wrong size, try recompiling", + type->tp_name); + goto bad; + } + } else { + if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; + PyErr_Clear(); + if (PyType_Ready(type) < 0) goto bad; + if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0) + goto bad; + Py_INCREF(type); + cached_type = type; + } +done: + Py_DECREF(fake_module); + return cached_type; +bad: + Py_XDECREF(cached_type); + cached_type = NULL; + goto done; +} + +/* CythonFunction */ +#include +static PyObject * +__Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure) +{ + if (unlikely(op->func_doc == NULL)) { + if (op->func.m_ml->ml_doc) { +#if PY_MAJOR_VERSION >= 3 + op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc); +#else + op->func_doc = PyString_FromString(op->func.m_ml->ml_doc); +#endif + if (unlikely(op->func_doc == NULL)) + return NULL; + } else { + Py_INCREF(Py_None); + return Py_None; + } + } + Py_INCREF(op->func_doc); + return op->func_doc; +} +static int +__Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context) +{ + PyObject *tmp = op->func_doc; + if (value == NULL) { + value = Py_None; + } + Py_INCREF(value); + op->func_doc = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + if (unlikely(op->func_name == NULL)) { +#if PY_MAJOR_VERSION >= 3 + op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name); +#else + op->func_name = PyString_InternFromString(op->func.m_ml->ml_name); +#endif + if (unlikely(op->func_name == NULL)) + return NULL; + } + Py_INCREF(op->func_name); + return op->func_name; +} +static int +__Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context) +{ + PyObject *tmp; +#if PY_MAJOR_VERSION >= 3 + if (unlikely(value == NULL || !PyUnicode_Check(value))) +#else + if (unlikely(value == NULL || !PyString_Check(value))) +#endif + { + PyErr_SetString(PyExc_TypeError, + "__name__ must be set to a string object"); + return -1; + } + tmp = op->func_name; + Py_INCREF(value); + op->func_name = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + Py_INCREF(op->func_qualname); + return op->func_qualname; +} +static int +__Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context) +{ + PyObject *tmp; +#if PY_MAJOR_VERSION >= 3 + if (unlikely(value == NULL || !PyUnicode_Check(value))) +#else + if (unlikely(value == NULL || !PyString_Check(value))) +#endif + { + PyErr_SetString(PyExc_TypeError, + "__qualname__ must be set to a string object"); + return -1; + } + tmp = op->func_qualname; + Py_INCREF(value); + op->func_qualname = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED void *closure) +{ + PyObject *self; + self = m->func_closure; + if (self == NULL) + self = Py_None; + Py_INCREF(self); + return self; +} +static PyObject * +__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + if (unlikely(op->func_dict == NULL)) { + op->func_dict = PyDict_New(); + if (unlikely(op->func_dict == NULL)) + return NULL; + } + Py_INCREF(op->func_dict); + return op->func_dict; +} +static int +__Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context) +{ + PyObject *tmp; + if (unlikely(value == NULL)) { + PyErr_SetString(PyExc_TypeError, + "function's dictionary may not be deleted"); + return -1; + } + if (unlikely(!PyDict_Check(value))) { + PyErr_SetString(PyExc_TypeError, + "setting function's dictionary to a non-dict"); + return -1; + } + tmp = op->func_dict; + Py_INCREF(value); + op->func_dict = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + Py_INCREF(op->func_globals); + return op->func_globals; +} +static PyObject * +__Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + Py_INCREF(Py_None); + return Py_None; +} +static PyObject * +__Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + PyObject* result = (op->func_code) ? op->func_code : Py_None; + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { + int result = 0; + PyObject *res = op->defaults_getter((PyObject *) op); + if (unlikely(!res)) + return -1; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + op->defaults_tuple = PyTuple_GET_ITEM(res, 0); + Py_INCREF(op->defaults_tuple); + op->defaults_kwdict = PyTuple_GET_ITEM(res, 1); + Py_INCREF(op->defaults_kwdict); + #else + op->defaults_tuple = PySequence_ITEM(res, 0); + if (unlikely(!op->defaults_tuple)) result = -1; + else { + op->defaults_kwdict = PySequence_ITEM(res, 1); + if (unlikely(!op->defaults_kwdict)) result = -1; + } + #endif + Py_DECREF(res); + return result; +} +static int +__Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) { + PyObject* tmp; + if (!value) { + value = Py_None; + } else if (value != Py_None && !PyTuple_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__defaults__ must be set to a tuple object"); + return -1; + } + Py_INCREF(value); + tmp = op->defaults_tuple; + op->defaults_tuple = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) { + PyObject* result = op->defaults_tuple; + if (unlikely(!result)) { + if (op->defaults_getter) { + if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL; + result = op->defaults_tuple; + } else { + result = Py_None; + } + } + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) { + PyObject* tmp; + if (!value) { + value = Py_None; + } else if (value != Py_None && !PyDict_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__kwdefaults__ must be set to a dict object"); + return -1; + } + Py_INCREF(value); + tmp = op->defaults_kwdict; + op->defaults_kwdict = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) { + PyObject* result = op->defaults_kwdict; + if (unlikely(!result)) { + if (op->defaults_getter) { + if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL; + result = op->defaults_kwdict; + } else { + result = Py_None; + } + } + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) { + PyObject* tmp; + if (!value || value == Py_None) { + value = NULL; + } else if (!PyDict_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__annotations__ must be set to a dict object"); + return -1; + } + Py_XINCREF(value); + tmp = op->func_annotations; + op->func_annotations = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) { + PyObject* result = op->func_annotations; + if (unlikely(!result)) { + result = PyDict_New(); + if (unlikely(!result)) return NULL; + op->func_annotations = result; + } + Py_INCREF(result); + return result; +} +static PyGetSetDef __pyx_CyFunction_getsets[] = { + {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, + {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, + {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, + {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, + {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, + {(char *) "__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0}, + {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, + {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, + {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, + {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, + {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, + {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, + {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, + {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, + {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, + {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, + {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, + {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, + {0, 0, 0, 0, 0} +}; +static PyMemberDef __pyx_CyFunction_members[] = { + {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), PY_WRITE_RESTRICTED, 0}, + {0, 0, 0, 0, 0} +}; +static PyObject * +__Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args) +{ +#if PY_MAJOR_VERSION >= 3 + return PyUnicode_FromString(m->func.m_ml->ml_name); +#else + return PyString_FromString(m->func.m_ml->ml_name); +#endif +} +static PyMethodDef __pyx_CyFunction_methods[] = { + {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, + {0, 0, 0, 0} +}; +#if PY_VERSION_HEX < 0x030500A0 +#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist) +#else +#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func.m_weakreflist) +#endif +static PyObject *__Pyx_CyFunction_New(PyTypeObject *type, PyMethodDef *ml, int flags, PyObject* qualname, + PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { + __pyx_CyFunctionObject *op = PyObject_GC_New(__pyx_CyFunctionObject, type); + if (op == NULL) + return NULL; + op->flags = flags; + __Pyx_CyFunction_weakreflist(op) = NULL; + op->func.m_ml = ml; + op->func.m_self = (PyObject *) op; + Py_XINCREF(closure); + op->func_closure = closure; + Py_XINCREF(module); + op->func.m_module = module; + op->func_dict = NULL; + op->func_name = NULL; + Py_INCREF(qualname); + op->func_qualname = qualname; + op->func_doc = NULL; + op->func_classobj = NULL; + op->func_globals = globals; + Py_INCREF(op->func_globals); + Py_XINCREF(code); + op->func_code = code; + op->defaults_pyobjects = 0; + op->defaults = NULL; + op->defaults_tuple = NULL; + op->defaults_kwdict = NULL; + op->defaults_getter = NULL; + op->func_annotations = NULL; + PyObject_GC_Track(op); + return (PyObject *) op; +} +static int +__Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) +{ + Py_CLEAR(m->func_closure); + Py_CLEAR(m->func.m_module); + Py_CLEAR(m->func_dict); + Py_CLEAR(m->func_name); + Py_CLEAR(m->func_qualname); + Py_CLEAR(m->func_doc); + Py_CLEAR(m->func_globals); + Py_CLEAR(m->func_code); + Py_CLEAR(m->func_classobj); + Py_CLEAR(m->defaults_tuple); + Py_CLEAR(m->defaults_kwdict); + Py_CLEAR(m->func_annotations); + if (m->defaults) { + PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); + int i; + for (i = 0; i < m->defaults_pyobjects; i++) + Py_XDECREF(pydefaults[i]); + PyObject_Free(m->defaults); + m->defaults = NULL; + } + return 0; +} +static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m) +{ + if (__Pyx_CyFunction_weakreflist(m) != NULL) + PyObject_ClearWeakRefs((PyObject *) m); + __Pyx_CyFunction_clear(m); + PyObject_GC_Del(m); +} +static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) +{ + PyObject_GC_UnTrack(m); + __Pyx__CyFunction_dealloc(m); +} +static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) +{ + Py_VISIT(m->func_closure); + Py_VISIT(m->func.m_module); + Py_VISIT(m->func_dict); + Py_VISIT(m->func_name); + Py_VISIT(m->func_qualname); + Py_VISIT(m->func_doc); + Py_VISIT(m->func_globals); + Py_VISIT(m->func_code); + Py_VISIT(m->func_classobj); + Py_VISIT(m->defaults_tuple); + Py_VISIT(m->defaults_kwdict); + if (m->defaults) { + PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); + int i; + for (i = 0; i < m->defaults_pyobjects; i++) + Py_VISIT(pydefaults[i]); + } + return 0; +} +static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type) +{ + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) { + Py_INCREF(func); + return func; + } + if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) { + if (type == NULL) + type = (PyObject *)(Py_TYPE(obj)); + return __Pyx_PyMethod_New(func, type, (PyObject *)(Py_TYPE(type))); + } + if (obj == Py_None) + obj = NULL; + return __Pyx_PyMethod_New(func, obj, type); +} +static PyObject* +__Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) +{ +#if PY_MAJOR_VERSION >= 3 + return PyUnicode_FromFormat("", + op->func_qualname, (void *)op); +#else + return PyString_FromFormat("", + PyString_AsString(op->func_qualname), (void *)op); +#endif +} +static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) { + PyCFunctionObject* f = (PyCFunctionObject*)func; + PyCFunction meth = f->m_ml->ml_meth; + Py_ssize_t size; + switch (f->m_ml->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) { + case METH_VARARGS: + if (likely(kw == NULL || PyDict_Size(kw) == 0)) + return (*meth)(self, arg); + break; + case METH_VARARGS | METH_KEYWORDS: + return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw); + case METH_NOARGS: + if (likely(kw == NULL || PyDict_Size(kw) == 0)) { + size = PyTuple_GET_SIZE(arg); + if (likely(size == 0)) + return (*meth)(self, NULL); + PyErr_Format(PyExc_TypeError, + "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", + f->m_ml->ml_name, size); + return NULL; + } + break; + case METH_O: + if (likely(kw == NULL || PyDict_Size(kw) == 0)) { + size = PyTuple_GET_SIZE(arg); + if (likely(size == 1)) { + PyObject *result, *arg0; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + arg0 = PyTuple_GET_ITEM(arg, 0); + #else + arg0 = PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL; + #endif + result = (*meth)(self, arg0); + #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) + Py_DECREF(arg0); + #endif + return result; + } + PyErr_Format(PyExc_TypeError, + "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", + f->m_ml->ml_name, size); + return NULL; + } + break; + default: + PyErr_SetString(PyExc_SystemError, "Bad call flags in " + "__Pyx_CyFunction_Call. METH_OLDARGS is no " + "longer supported!"); + return NULL; + } + PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", + f->m_ml->ml_name); + return NULL; +} +static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { + return __Pyx_CyFunction_CallMethod(func, ((PyCFunctionObject*)func)->m_self, arg, kw); +} +static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) { + PyObject *result; + __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func; + if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { + Py_ssize_t argc; + PyObject *new_args; + PyObject *self; + argc = PyTuple_GET_SIZE(args); + new_args = PyTuple_GetSlice(args, 1, argc); + if (unlikely(!new_args)) + return NULL; + self = PyTuple_GetItem(args, 0); + if (unlikely(!self)) { + Py_DECREF(new_args); + return NULL; + } + result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw); + Py_DECREF(new_args); + } else { + result = __Pyx_CyFunction_Call(func, args, kw); + } + return result; +} +static PyTypeObject __pyx_CyFunctionType_type = { + PyVarObject_HEAD_INIT(0, 0) + "cython_function_or_method", + sizeof(__pyx_CyFunctionObject), + 0, + (destructor) __Pyx_CyFunction_dealloc, + 0, + 0, + 0, +#if PY_MAJOR_VERSION < 3 + 0, +#else + 0, +#endif + (reprfunc) __Pyx_CyFunction_repr, + 0, + 0, + 0, + 0, + __Pyx_CyFunction_CallAsMethod, + 0, + 0, + 0, + 0, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, + 0, + (traverseproc) __Pyx_CyFunction_traverse, + (inquiry) __Pyx_CyFunction_clear, + 0, +#if PY_VERSION_HEX < 0x030500A0 + offsetof(__pyx_CyFunctionObject, func_weakreflist), +#else + offsetof(PyCFunctionObject, m_weakreflist), +#endif + 0, + 0, + __pyx_CyFunction_methods, + __pyx_CyFunction_members, + __pyx_CyFunction_getsets, + 0, + 0, + __Pyx_CyFunction_descr_get, + 0, + offsetof(__pyx_CyFunctionObject, func_dict), + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, +#if PY_VERSION_HEX >= 0x030400a1 + 0, +#endif +}; +static int __pyx_CyFunction_init(void) { + __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); + if (unlikely(__pyx_CyFunctionType == NULL)) { + return -1; + } + return 0; +} +static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults = PyObject_Malloc(size); + if (unlikely(!m->defaults)) + return PyErr_NoMemory(); + memset(m->defaults, 0, size); + m->defaults_pyobjects = pyobjects; + return m->defaults; +} +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults_tuple = tuple; + Py_INCREF(tuple); +} +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults_kwdict = dict; + Py_INCREF(dict); +} +static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->func_annotations = dict; + Py_INCREF(dict); +} + +/* GetModuleGlobalName */ +#if CYTHON_USE_DICT_VERSIONS +static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value) +#else +static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) +#endif +{ + PyObject *result; +#if !CYTHON_AVOID_BORROWED_REFS +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 + result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } else if (unlikely(PyErr_Occurred())) { + return NULL; + } +#else + result = PyDict_GetItem(__pyx_d, name); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } +#endif +#else + result = PyObject_GetItem(__pyx_d, name); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } + PyErr_Clear(); +#endif + return __Pyx_GetBuiltinName(name); +} + +/* GetAttr */ +static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) { +#if CYTHON_USE_TYPE_SLOTS +#if PY_MAJOR_VERSION >= 3 + if (likely(PyUnicode_Check(n))) +#else + if (likely(PyString_Check(n))) +#endif + return __Pyx_PyObject_GetAttrStr(o, n); +#endif + return PyObject_GetAttr(o, n); +} + +/* Globals */ +static PyObject* __Pyx_Globals(void) { + Py_ssize_t i; + PyObject *names; + PyObject *globals = __pyx_d; + Py_INCREF(globals); + names = PyObject_Dir(__pyx_m); + if (!names) + goto bad; + for (i = PyList_GET_SIZE(names)-1; i >= 0; i--) { +#if CYTHON_COMPILING_IN_PYPY + PyObject* name = PySequence_ITEM(names, i); + if (!name) + goto bad; +#else + PyObject* name = PyList_GET_ITEM(names, i); +#endif + if (!PyDict_Contains(globals, name)) { + PyObject* value = __Pyx_GetAttr(__pyx_m, name); + if (!value) { +#if CYTHON_COMPILING_IN_PYPY + Py_DECREF(name); +#endif + goto bad; + } + if (PyDict_SetItem(globals, name, value) < 0) { +#if CYTHON_COMPILING_IN_PYPY + Py_DECREF(name); +#endif + Py_DECREF(value); + goto bad; + } + } +#if CYTHON_COMPILING_IN_PYPY + Py_DECREF(name); +#endif + } + Py_DECREF(names); + return globals; +bad: + Py_XDECREF(names); + Py_XDECREF(globals); + return NULL; +} + +/* CLineInTraceback */ +#ifndef CYTHON_CLINE_IN_TRACEBACK +static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { + PyObject *use_cline; + PyObject *ptype, *pvalue, *ptraceback; +#if CYTHON_COMPILING_IN_CPYTHON + PyObject **cython_runtime_dict; +#endif + if (unlikely(!__pyx_cython_runtime)) { + return c_line; + } + __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); +#if CYTHON_COMPILING_IN_CPYTHON + cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); + if (likely(cython_runtime_dict)) { + __PYX_PY_DICT_LOOKUP_IF_MODIFIED( + use_cline, *cython_runtime_dict, + __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback)) + } else +#endif + { + PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback); + if (use_cline_obj) { + use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; + Py_DECREF(use_cline_obj); + } else { + PyErr_Clear(); + use_cline = NULL; + } + } + if (!use_cline) { + c_line = 0; + PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); + } + else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { + c_line = 0; + } + __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); + return c_line; +} +#endif + +/* CodeObjectCache */ +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { + int start = 0, mid = 0, end = count - 1; + if (end >= 0 && code_line > entries[end].code_line) { + return count; + } + while (start < end) { + mid = start + (end - start) / 2; + if (code_line < entries[mid].code_line) { + end = mid; + } else if (code_line > entries[mid].code_line) { + start = mid + 1; + } else { + return mid; + } + } + if (code_line <= entries[mid].code_line) { + return mid; + } else { + return mid + 1; + } +} +static PyCodeObject *__pyx_find_code_object(int code_line) { + PyCodeObject* code_object; + int pos; + if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { + return NULL; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { + return NULL; + } + code_object = __pyx_code_cache.entries[pos].code_object; + Py_INCREF(code_object); + return code_object; +} +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { + int pos, i; + __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; + if (unlikely(!code_line)) { + return; + } + if (unlikely(!entries)) { + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); + if (likely(entries)) { + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = 64; + __pyx_code_cache.count = 1; + entries[0].code_line = code_line; + entries[0].code_object = code_object; + Py_INCREF(code_object); + } + return; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { + PyCodeObject* tmp = entries[pos].code_object; + entries[pos].code_object = code_object; + Py_DECREF(tmp); + return; + } + if (__pyx_code_cache.count == __pyx_code_cache.max_count) { + int new_max = __pyx_code_cache.max_count + 64; + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( + __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry)); + if (unlikely(!entries)) { + return; + } + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = new_max; + } + for (i=__pyx_code_cache.count; i>pos; i--) { + entries[i] = entries[i-1]; + } + entries[pos].code_line = code_line; + entries[pos].code_object = code_object; + __pyx_code_cache.count++; + Py_INCREF(code_object); +} + +/* AddTraceback */ +#include "compile.h" +#include "frameobject.h" +#include "traceback.h" +static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( + const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyObject *py_srcfile = 0; + PyObject *py_funcname = 0; + #if PY_MAJOR_VERSION < 3 + py_srcfile = PyString_FromString(filename); + #else + py_srcfile = PyUnicode_FromString(filename); + #endif + if (!py_srcfile) goto bad; + if (c_line) { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + #else + py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + #endif + } + else { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromString(funcname); + #else + py_funcname = PyUnicode_FromString(funcname); + #endif + } + if (!py_funcname) goto bad; + py_code = __Pyx_PyCode_New( + 0, + 0, + 0, + 0, + 0, + __pyx_empty_bytes, /*PyObject *code,*/ + __pyx_empty_tuple, /*PyObject *consts,*/ + __pyx_empty_tuple, /*PyObject *names,*/ + __pyx_empty_tuple, /*PyObject *varnames,*/ + __pyx_empty_tuple, /*PyObject *freevars,*/ + __pyx_empty_tuple, /*PyObject *cellvars,*/ + py_srcfile, /*PyObject *filename,*/ + py_funcname, /*PyObject *name,*/ + py_line, + __pyx_empty_bytes /*PyObject *lnotab*/ + ); + Py_DECREF(py_srcfile); + Py_DECREF(py_funcname); + return py_code; +bad: + Py_XDECREF(py_srcfile); + Py_XDECREF(py_funcname); + return NULL; +} +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyFrameObject *py_frame = 0; + PyThreadState *tstate = __Pyx_PyThreadState_Current; + if (c_line) { + c_line = __Pyx_CLineForTraceback(tstate, c_line); + } + py_code = __pyx_find_code_object(c_line ? -c_line : py_line); + if (!py_code) { + py_code = __Pyx_CreateCodeObjectForTraceback( + funcname, c_line, py_line, filename); + if (!py_code) goto bad; + __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); + } + py_frame = PyFrame_New( + tstate, /*PyThreadState *tstate,*/ + py_code, /*PyCodeObject *code,*/ + __pyx_d, /*PyObject *globals,*/ + 0 /*PyObject *locals*/ + ); + if (!py_frame) goto bad; + __Pyx_PyFrame_SetLineNumber(py_frame, py_line); + PyTraceBack_Here(py_frame); +bad: + Py_XDECREF(py_code); + Py_XDECREF(py_frame); +} + +/* CIntToPy */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { + const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(long) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(long) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(long) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(long), + little, !is_unsigned); + } +} + +/* CIntFromPyVerify */ +#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ + __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) +#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ + __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) +#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ + {\ + func_type value = func_value;\ + if (sizeof(target_type) < sizeof(func_type)) {\ + if (unlikely(value != (func_type) (target_type) value)) {\ + func_type zero = 0;\ + if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ + return (target_type) -1;\ + if (is_unsigned && unlikely(value < zero))\ + goto raise_neg_overflow;\ + else\ + goto raise_overflow;\ + }\ + }\ + return (target_type) value;\ + } + +/* CIntFromPy */ +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { + const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(long) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (long) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (long) 0; + case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0]) + case 2: + if (8 * sizeof(long) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) { + return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + case 3: + if (8 * sizeof(long) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) { + return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + case 4: + if (8 * sizeof(long) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) { + return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (long) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if (sizeof(long) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (long) 0; + case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0])) + case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0]) + case -2: + if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 2: + if (8 * sizeof(long) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case -3: + if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 3: + if (8 * sizeof(long) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case -4: + if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 4: + if (8 * sizeof(long) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + } +#endif + if (sizeof(long) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + long val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (long) -1; + } + } else { + long val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (long) -1; + val = __Pyx_PyInt_As_long(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to long"); + return (long) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to long"); + return (long) -1; +} + +/* CIntFromPy */ +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { + const int neg_one = (int) ((int) 0 - (int) 1), const_zero = (int) 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(int) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (int) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (int) 0; + case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0]) + case 2: + if (8 * sizeof(int) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) { + return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + case 3: + if (8 * sizeof(int) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) { + return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + case 4: + if (8 * sizeof(int) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) { + return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (int) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if (sizeof(int) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (int) 0; + case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0])) + case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0]) + case -2: + if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { + return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 2: + if (8 * sizeof(int) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { + return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case -3: + if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { + return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 3: + if (8 * sizeof(int) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { + return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case -4: + if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { + return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 4: + if (8 * sizeof(int) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { + return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + } +#endif + if (sizeof(int) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + int val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (int) -1; + } + } else { + int val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (int) -1; + val = __Pyx_PyInt_As_int(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to int"); + return (int) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to int"); + return (int) -1; +} + +/* FastTypeChecks */ +#if CYTHON_COMPILING_IN_CPYTHON +static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) { + while (a) { + a = a->tp_base; + if (a == b) + return 1; + } + return b == &PyBaseObject_Type; +} +static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) { + PyObject *mro; + if (a == b) return 1; + mro = a->tp_mro; + if (likely(mro)) { + Py_ssize_t i, n; + n = PyTuple_GET_SIZE(mro); + for (i = 0; i < n; i++) { + if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b) + return 1; + } + return 0; + } + return __Pyx_InBases(a, b); +} +#if PY_MAJOR_VERSION == 2 +static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { + PyObject *exception, *value, *tb; + int res; + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ErrFetch(&exception, &value, &tb); + res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; + if (unlikely(res == -1)) { + PyErr_WriteUnraisable(err); + res = 0; + } + if (!res) { + res = PyObject_IsSubclass(err, exc_type2); + if (unlikely(res == -1)) { + PyErr_WriteUnraisable(err); + res = 0; + } + } + __Pyx_ErrRestore(exception, value, tb); + return res; +} +#else +static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { + int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0; + if (!res) { + res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); + } + return res; +} +#endif +static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { + Py_ssize_t i, n; + assert(PyExceptionClass_Check(exc_type)); + n = PyTuple_GET_SIZE(tuple); +#if PY_MAJOR_VERSION >= 3 + for (i=0; itp_setattro)) + return tp->tp_setattro(obj, attr_name, value); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_setattr)) + return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value); +#endif + return PyObject_SetAttr(obj, attr_name, value); +} +#endif + +/* VoidPtrExport */ +static int __Pyx_ExportVoidPtr(PyObject *name, void *p, const char *sig) { + PyObject *d; + PyObject *cobj = 0; + d = PyDict_GetItem(__pyx_d, __pyx_n_s_pyx_capi); + Py_XINCREF(d); + if (!d) { + d = PyDict_New(); + if (!d) + goto bad; + if (__Pyx_PyObject_SetAttrStr(__pyx_m, __pyx_n_s_pyx_capi, d) < 0) + goto bad; + } +#if PY_VERSION_HEX >= 0x02070000 + cobj = PyCapsule_New(p, sig, 0); +#else + cobj = PyCObject_FromVoidPtrAndDesc(p, (void *)sig, 0); +#endif + if (!cobj) + goto bad; + if (PyDict_SetItem(d, name, cobj) < 0) + goto bad; + Py_DECREF(cobj); + Py_DECREF(d); + return 0; +bad: + Py_XDECREF(cobj); + Py_XDECREF(d); + return -1; +} + +/* InitStrings */ +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { + while (t->p) { + #if PY_MAJOR_VERSION < 3 + if (t->is_unicode) { + *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); + } else if (t->intern) { + *t->p = PyString_InternFromString(t->s); + } else { + *t->p = PyString_FromStringAndSize(t->s, t->n - 1); + } + #else + if (t->is_unicode | t->is_str) { + if (t->intern) { + *t->p = PyUnicode_InternFromString(t->s); + } else if (t->encoding) { + *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); + } else { + *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); + } + } else { + *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); + } + #endif + if (!*t->p) + return -1; + if (PyObject_Hash(*t->p) == -1) + return -1; + ++t; + } + return 0; +} + +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { + return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); +} +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { + Py_ssize_t ignore; + return __Pyx_PyObject_AsStringAndSize(o, &ignore); +} +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +#if !CYTHON_PEP393_ENABLED +static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { + char* defenc_c; + PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); + if (!defenc) return NULL; + defenc_c = PyBytes_AS_STRING(defenc); +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + { + char* end = defenc_c + PyBytes_GET_SIZE(defenc); + char* c; + for (c = defenc_c; c < end; c++) { + if ((unsigned char) (*c) >= 128) { + PyUnicode_AsASCIIString(o); + return NULL; + } + } + } +#endif + *length = PyBytes_GET_SIZE(defenc); + return defenc_c; +} +#else +static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { + if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + if (likely(PyUnicode_IS_ASCII(o))) { + *length = PyUnicode_GET_LENGTH(o); + return PyUnicode_AsUTF8(o); + } else { + PyUnicode_AsASCIIString(o); + return NULL; + } +#else + return PyUnicode_AsUTF8AndSize(o, length); +#endif +} +#endif +#endif +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT + if ( +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + __Pyx_sys_getdefaultencoding_not_ascii && +#endif + PyUnicode_Check(o)) { + return __Pyx_PyUnicode_AsStringAndSize(o, length); + } else +#endif +#if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) + if (PyByteArray_Check(o)) { + *length = PyByteArray_GET_SIZE(o); + return PyByteArray_AS_STRING(o); + } else +#endif + { + char* result; + int r = PyBytes_AsStringAndSize(o, &result, length); + if (unlikely(r < 0)) { + return NULL; + } else { + return result; + } + } +} +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { + int is_true = x == Py_True; + if (is_true | (x == Py_False) | (x == Py_None)) return is_true; + else return PyObject_IsTrue(x); +} +static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) { + int retval; + if (unlikely(!x)) return -1; + retval = __Pyx_PyObject_IsTrue(x); + Py_DECREF(x); + return retval; +} +static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) { +#if PY_MAJOR_VERSION >= 3 + if (PyLong_Check(result)) { + if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, + "__int__ returned non-int (type %.200s). " + "The ability to return an instance of a strict subclass of int " + "is deprecated, and may be removed in a future version of Python.", + Py_TYPE(result)->tp_name)) { + Py_DECREF(result); + return NULL; + } + return result; + } +#endif + PyErr_Format(PyExc_TypeError, + "__%.4s__ returned non-%.4s (type %.200s)", + type_name, type_name, Py_TYPE(result)->tp_name); + Py_DECREF(result); + return NULL; +} +static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { +#if CYTHON_USE_TYPE_SLOTS + PyNumberMethods *m; +#endif + const char *name = NULL; + PyObject *res = NULL; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x) || PyLong_Check(x))) +#else + if (likely(PyLong_Check(x))) +#endif + return __Pyx_NewRef(x); +#if CYTHON_USE_TYPE_SLOTS + m = Py_TYPE(x)->tp_as_number; + #if PY_MAJOR_VERSION < 3 + if (m && m->nb_int) { + name = "int"; + res = m->nb_int(x); + } + else if (m && m->nb_long) { + name = "long"; + res = m->nb_long(x); + } + #else + if (likely(m && m->nb_int)) { + name = "int"; + res = m->nb_int(x); + } + #endif +#else + if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { + res = PyNumber_Int(x); + } +#endif + if (likely(res)) { +#if PY_MAJOR_VERSION < 3 + if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) { +#else + if (unlikely(!PyLong_CheckExact(res))) { +#endif + return __Pyx_PyNumber_IntOrLongWrongResultType(res, name); + } + } + else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_TypeError, + "an integer is required"); + } + return res; +} +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { + Py_ssize_t ival; + PyObject *x; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_CheckExact(b))) { + if (sizeof(Py_ssize_t) >= sizeof(long)) + return PyInt_AS_LONG(b); + else + return PyInt_AsSsize_t(b); + } +#endif + if (likely(PyLong_CheckExact(b))) { + #if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)b)->ob_digit; + const Py_ssize_t size = Py_SIZE(b); + if (likely(__Pyx_sst_abs(size) <= 1)) { + ival = likely(size) ? digits[0] : 0; + if (size == -1) ival = -ival; + return ival; + } else { + switch (size) { + case 2: + if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { + return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -2: + if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case 3: + if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { + return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -3: + if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case 4: + if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { + return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -4: + if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + } + } + #endif + return PyLong_AsSsize_t(b); + } + x = PyNumber_Index(b); + if (!x) return -1; + ival = PyInt_AsSsize_t(x); + Py_DECREF(x); + return ival; +} +static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) { + return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False); +} +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { + return PyInt_FromSize_t(ival); +} + + +#endif /* Py_PYTHON_H */ diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_ident.html b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_ident.html new file mode 100644 index 00000000..eed42247 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_ident.html @@ -0,0 +1,884 @@ + + + + + + Cython: _ident.py + + + +

Generated by Cython 0.29.2

+

+ Yellow lines hint at Python interaction.
+ Click on a line that starts with a "+" to see the C code that Cython generated for it. +

+

Raw output: _ident.c

+
 01: # -*- coding: utf-8 -*-
+
 02: # Copyright 2018 gevent contributors. See LICENSE for details.
+
 03: # cython: auto_pickle=False,embedsignature=True,always_allow_keywords=False
+
 04: 
+
 05: from __future__ import absolute_import
+
 06: from __future__ import division
+
 07: from __future__ import print_function
+
 08: 
+
 09: 
+
+10: from weakref import WeakKeyDictionary
+
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 10, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(__pyx_n_s_WeakKeyDictionary);
+  __Pyx_GIVEREF(__pyx_n_s_WeakKeyDictionary);
+  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_WeakKeyDictionary);
+  __pyx_t_2 = __Pyx_Import(__pyx_n_s_weakref, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_WeakKeyDictionary); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 10, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(__pyx_t_1);
+  __Pyx_XGOTREF(__pyx_v_6gevent_7__ident_WeakKeyDictionary);
+  __Pyx_DECREF_SET(__pyx_v_6gevent_7__ident_WeakKeyDictionary, __pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+11: from weakref import ref
+
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 11, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_ref);
+  __Pyx_GIVEREF(__pyx_n_s_ref);
+  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_ref);
+  __pyx_t_1 = __Pyx_Import(__pyx_n_s_weakref, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 11, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 12: 
+
+13: from heapq import heappop
+
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 13, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(__pyx_n_s_heappop);
+  __Pyx_GIVEREF(__pyx_n_s_heappop);
+  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_heappop);
+  __pyx_t_2 = __Pyx_Import(__pyx_n_s_heapq, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 13, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_heappop); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 13, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(__pyx_t_1);
+  __Pyx_XGOTREF(__pyx_v_6gevent_7__ident_heappop);
+  __Pyx_DECREF_SET(__pyx_v_6gevent_7__ident_heappop, __pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+14: from heapq import heappush
+
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 14, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_heappush);
+  __Pyx_GIVEREF(__pyx_n_s_heappush);
+  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_heappush);
+  __pyx_t_1 = __Pyx_Import(__pyx_n_s_heapq, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 14, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_heappush); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 14, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(__pyx_t_2);
+  __Pyx_XGOTREF(__pyx_v_6gevent_7__ident_heappush);
+  __Pyx_DECREF_SET(__pyx_v_6gevent_7__ident_heappush, __pyx_t_2);
+  __Pyx_GIVEREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 15: 
+
+16: __all__ = [
+
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 16, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(__pyx_n_s_IdentRegistry);
+  __Pyx_GIVEREF(__pyx_n_s_IdentRegistry);
+  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_IdentRegistry);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_all, __pyx_t_1) < 0) __PYX_ERR(0, 16, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 17:     'IdentRegistry',
+
 18: ]
+
 19: 
+
 20: class ValuedWeakRef(ref):
+
 21:     """
+
 22:     A weak ref with an associated value.
+
 23:     """
+
 24: 
+
+25:     __slots__ = ('value',)
+
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_7__ident_ValuedWeakRef->tp_dict, __pyx_n_s_slots, __pyx_tuple_) < 0) __PYX_ERR(0, 25, __pyx_L1_error)
+  PyType_Modified(__pyx_ptype_6gevent_7__ident_ValuedWeakRef);
+/* … */
+  __pyx_tuple_ = PyTuple_Pack(1, __pyx_n_s_value); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 25, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple_);
+  __Pyx_GIVEREF(__pyx_tuple_);
+
 26: 
+
 27: 
+
+28: class IdentRegistry(object):
+
struct __pyx_vtabstruct_6gevent_7__ident_IdentRegistry {
+  PyObject *(*get_ident)(struct __pyx_obj_6gevent_7__ident_IdentRegistry *, PyObject *, int __pyx_skip_dispatch);
+  PyObject *(*_return_ident)(struct __pyx_obj_6gevent_7__ident_IdentRegistry *, struct __pyx_obj_6gevent_7__ident_ValuedWeakRef *, int __pyx_skip_dispatch);
+};
+static struct __pyx_vtabstruct_6gevent_7__ident_IdentRegistry *__pyx_vtabptr_6gevent_7__ident_IdentRegistry;
+
 29:     """
+
 30:     Maintains a unique mapping of (small) positive integer identifiers
+
 31:     to objects that can be weakly referenced.
+
 32: 
+
 33:     It is guaranteed that no two objects will have the the same
+
 34:     identifier at the same time, as long as those objects are
+
 35:     also uniquely hashable.
+
 36:     """
+
 37: 
+
+38:     def __init__(self):
+
/* Python wrapper */
+static int __pyx_pw_6gevent_7__ident_13IdentRegistry_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static int __pyx_pw_6gevent_7__ident_13IdentRegistry_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
+  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
+    __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
+  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1;
+  __pyx_r = __pyx_pf_6gevent_7__ident_13IdentRegistry___init__(((struct __pyx_obj_6gevent_7__ident_IdentRegistry *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_7__ident_13IdentRegistry___init__(struct __pyx_obj_6gevent_7__ident_IdentRegistry *__pyx_v_self) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = 0;
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_AddTraceback("gevent.__ident.IdentRegistry.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = -1;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
 39:         # {obj -> (ident, wref(obj))}
+
+40:         self._registry = WeakKeyDictionary()
+
  __Pyx_INCREF(__pyx_v_6gevent_7__ident_WeakKeyDictionary);
+  __pyx_t_2 = __pyx_v_6gevent_7__ident_WeakKeyDictionary; __pyx_t_3 = NULL;
+  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
+    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+    if (likely(__pyx_t_3)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+      __Pyx_INCREF(__pyx_t_3);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_2, function);
+    }
+  }
+  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 40, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_GIVEREF(__pyx_t_1);
+  __Pyx_GOTREF(__pyx_v_self->_registry);
+  __Pyx_DECREF(__pyx_v_self->_registry);
+  __pyx_v_self->_registry = __pyx_t_1;
+  __pyx_t_1 = 0;
+
 41: 
+
 42:         # A heap of numbers that have been used and returned
+
+43:         self._available_idents = []
+
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 43, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_1);
+  __Pyx_GOTREF(__pyx_v_self->_available_idents);
+  __Pyx_DECREF(__pyx_v_self->_available_idents);
+  __pyx_v_self->_available_idents = ((PyObject*)__pyx_t_1);
+  __pyx_t_1 = 0;
+
 44: 
+
+45:     def get_ident(self, obj):
+
static PyObject *__pyx_pw_6gevent_7__ident_13IdentRegistry_3get_ident(PyObject *__pyx_v_self, PyObject *__pyx_v_obj); /*proto*/
+static PyObject *__pyx_f_6gevent_7__ident_13IdentRegistry_get_ident(struct __pyx_obj_6gevent_7__ident_IdentRegistry *__pyx_v_self, PyObject *__pyx_v_obj, CYTHON_UNUSED int __pyx_skip_dispatch) {
+  PyObject *__pyx_v_ident = NULL;
+  struct __pyx_obj_6gevent_7__ident_ValuedWeakRef *__pyx_v_vref = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("get_ident", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_XDECREF(__pyx_t_8);
+  __Pyx_AddTraceback("gevent.__ident.IdentRegistry.get_ident", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_ident);
+  __Pyx_XDECREF((PyObject *)__pyx_v_vref);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_7__ident_13IdentRegistry_3get_ident(PyObject *__pyx_v_self, PyObject *__pyx_v_obj); /*proto*/
+static char __pyx_doc_6gevent_7__ident_13IdentRegistry_2get_ident[] = "IdentRegistry.get_ident(self, obj)\n\n        Retrieve the identifier for *obj*, creating one\n        if necessary.\n        ";
+static PyMethodDef __pyx_mdef_6gevent_7__ident_13IdentRegistry_3get_ident = {"get_ident", (PyCFunction)__pyx_pw_6gevent_7__ident_13IdentRegistry_3get_ident, METH_O, __pyx_doc_6gevent_7__ident_13IdentRegistry_2get_ident};
+static PyObject *__pyx_pw_6gevent_7__ident_13IdentRegistry_3get_ident(PyObject *__pyx_v_self, PyObject *__pyx_v_obj) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("get_ident (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_7__ident_13IdentRegistry_2get_ident(((struct __pyx_obj_6gevent_7__ident_IdentRegistry *)__pyx_v_self), ((PyObject *)__pyx_v_obj));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_7__ident_13IdentRegistry_2get_ident(struct __pyx_obj_6gevent_7__ident_IdentRegistry *__pyx_v_self, PyObject *__pyx_v_obj) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("get_ident", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __pyx_f_6gevent_7__ident_13IdentRegistry_get_ident(__pyx_v_self, __pyx_v_obj, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 45, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.__ident.IdentRegistry.get_ident", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__2 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_obj); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 45, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__2);
+  __Pyx_GIVEREF(__pyx_tuple__2);
+/* … */
+  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_7__ident_13IdentRegistry_3get_ident, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_IdentRegistry_get_ident, NULL, __pyx_n_s_gevent___ident, __pyx_d, ((PyObject *)__pyx_codeobj__3)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 45, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_7__ident_IdentRegistry->tp_dict, __pyx_n_s_get_ident, __pyx_t_1) < 0) __PYX_ERR(0, 45, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_7__ident_IdentRegistry);
+  __pyx_codeobj__3 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__ident_py, __pyx_n_s_get_ident, 45, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__3)) __PYX_ERR(0, 45, __pyx_L1_error)
+
 46:         """
+
 47:         Retrieve the identifier for *obj*, creating one
+
 48:         if necessary.
+
 49:         """
+
 50: 
+
+51:         try:
+
  {
+    /*try:*/ {
+/* … */
+    }
+    __pyx_L3_error:;
+    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+/* … */
+    __Pyx_XGIVEREF(__pyx_t_1);
+    __Pyx_XGIVEREF(__pyx_t_2);
+    __Pyx_XGIVEREF(__pyx_t_3);
+    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
+    goto __pyx_L1_error;
+    __pyx_L7_try_return:;
+    __Pyx_XGIVEREF(__pyx_t_1);
+    __Pyx_XGIVEREF(__pyx_t_2);
+    __Pyx_XGIVEREF(__pyx_t_3);
+    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
+    goto __pyx_L0;
+    __pyx_L4_exception_handled:;
+    __Pyx_XGIVEREF(__pyx_t_1);
+    __Pyx_XGIVEREF(__pyx_t_2);
+    __Pyx_XGIVEREF(__pyx_t_3);
+    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
+  }
+
+52:             return self._registry[obj][0]
+
      __Pyx_XDECREF(__pyx_r);
+      __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_v_self->_registry, __pyx_v_obj); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 52, __pyx_L3_error)
+      __Pyx_GOTREF(__pyx_t_4);
+      __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_4, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 52, __pyx_L3_error)
+      __Pyx_GOTREF(__pyx_t_5);
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __pyx_r = __pyx_t_5;
+      __pyx_t_5 = 0;
+      goto __pyx_L7_try_return;
+
+53:         except KeyError:
+
    __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
+    if (__pyx_t_6) {
+      __Pyx_ErrRestore(0,0,0);
+      goto __pyx_L4_exception_handled;
+    }
+    goto __pyx_L5_except_error;
+    __pyx_L5_except_error:;
+
 54:             pass
+
 55: 
+
+56:         if self._available_idents:
+
  __pyx_t_7 = (__pyx_v_self->_available_idents != Py_None)&&(PyList_GET_SIZE(__pyx_v_self->_available_idents) != 0);
+  if (__pyx_t_7) {
+/* … */
+    goto __pyx_L9;
+  }
+
 57:             # Take the smallest free number
+
+58:             ident = heappop(self._available_idents)
+
    __Pyx_INCREF(__pyx_v_6gevent_7__ident_heappop);
+    __pyx_t_4 = __pyx_v_6gevent_7__ident_heappop; __pyx_t_8 = NULL;
+    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
+      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_4);
+      if (likely(__pyx_t_8)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
+        __Pyx_INCREF(__pyx_t_8);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_4, function);
+      }
+    }
+    __pyx_t_5 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_8, __pyx_v_self->_available_idents) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_self->_available_idents);
+    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
+    if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 58, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_5);
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __pyx_v_ident = __pyx_t_5;
+    __pyx_t_5 = 0;
+
 59:         else:
+
 60:             # Allocate a bigger one
+
+61:             ident = len(self._registry)
+
  /*else*/ {
+    __pyx_t_5 = __pyx_v_self->_registry;
+    __Pyx_INCREF(__pyx_t_5);
+    __pyx_t_9 = PyObject_Length(__pyx_t_5); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 61, __pyx_L1_error)
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __pyx_t_5 = PyInt_FromSsize_t(__pyx_t_9); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 61, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_5);
+    __pyx_v_ident = __pyx_t_5;
+    __pyx_t_5 = 0;
+  }
+  __pyx_L9:;
+
 62: 
+
+63:         vref = ValuedWeakRef(obj, self._return_ident)
+
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_return_ident); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 63, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_5);
+  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 63, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_4);
+  __Pyx_INCREF(__pyx_v_obj);
+  __Pyx_GIVEREF(__pyx_v_obj);
+  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_obj);
+  __Pyx_GIVEREF(__pyx_t_5);
+  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_5);
+  __pyx_t_5 = 0;
+  __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6gevent_7__ident_ValuedWeakRef), __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 63, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_5);
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __pyx_v_vref = ((struct __pyx_obj_6gevent_7__ident_ValuedWeakRef *)__pyx_t_5);
+  __pyx_t_5 = 0;
+
+64:         vref.value = ident # pylint:disable=assigning-non-slot,attribute-defined-outside-init
+
  __Pyx_INCREF(__pyx_v_ident);
+  __Pyx_GIVEREF(__pyx_v_ident);
+  __Pyx_GOTREF(__pyx_v_vref->value);
+  __Pyx_DECREF(__pyx_v_vref->value);
+  __pyx_v_vref->value = __pyx_v_ident;
+
+65:         self._registry[obj] = (ident, vref)
+
  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 65, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_5);
+  __Pyx_INCREF(__pyx_v_ident);
+  __Pyx_GIVEREF(__pyx_v_ident);
+  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_ident);
+  __Pyx_INCREF(((PyObject *)__pyx_v_vref));
+  __Pyx_GIVEREF(((PyObject *)__pyx_v_vref));
+  PyTuple_SET_ITEM(__pyx_t_5, 1, ((PyObject *)__pyx_v_vref));
+  if (unlikely(PyObject_SetItem(__pyx_v_self->_registry, __pyx_v_obj, __pyx_t_5) < 0)) __PYX_ERR(0, 65, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+
+66:         return ident
+
  __Pyx_XDECREF(__pyx_r);
+  __Pyx_INCREF(__pyx_v_ident);
+  __pyx_r = __pyx_v_ident;
+  goto __pyx_L0;
+
 67: 
+
+68:     def _return_ident(self, vref):
+
static PyObject *__pyx_pw_6gevent_7__ident_13IdentRegistry_5_return_ident(PyObject *__pyx_v_self, PyObject *__pyx_v_vref); /*proto*/
+static PyObject *__pyx_f_6gevent_7__ident_13IdentRegistry__return_ident(struct __pyx_obj_6gevent_7__ident_IdentRegistry *__pyx_v_self, struct __pyx_obj_6gevent_7__ident_ValuedWeakRef *__pyx_v_vref, CYTHON_UNUSED int __pyx_skip_dispatch) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_return_ident", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_XDECREF(__pyx_t_7);
+  __Pyx_AddTraceback("gevent.__ident.IdentRegistry._return_ident", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_7__ident_13IdentRegistry_5_return_ident(PyObject *__pyx_v_self, PyObject *__pyx_v_vref); /*proto*/
+static char __pyx_doc_6gevent_7__ident_13IdentRegistry_4_return_ident[] = "IdentRegistry._return_ident(self, ValuedWeakRef vref)";
+static PyMethodDef __pyx_mdef_6gevent_7__ident_13IdentRegistry_5_return_ident = {"_return_ident", (PyCFunction)__pyx_pw_6gevent_7__ident_13IdentRegistry_5_return_ident, METH_O, __pyx_doc_6gevent_7__ident_13IdentRegistry_4_return_ident};
+static PyObject *__pyx_pw_6gevent_7__ident_13IdentRegistry_5_return_ident(PyObject *__pyx_v_self, PyObject *__pyx_v_vref) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_return_ident (wrapper)", 0);
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vref), __pyx_ptype_6gevent_7__ident_ValuedWeakRef, 1, "vref", 0))) __PYX_ERR(0, 68, __pyx_L1_error)
+  __pyx_r = __pyx_pf_6gevent_7__ident_13IdentRegistry_4_return_ident(((struct __pyx_obj_6gevent_7__ident_IdentRegistry *)__pyx_v_self), ((struct __pyx_obj_6gevent_7__ident_ValuedWeakRef *)__pyx_v_vref));
+
+  /* function exit code */
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_7__ident_13IdentRegistry_4_return_ident(struct __pyx_obj_6gevent_7__ident_IdentRegistry *__pyx_v_self, struct __pyx_obj_6gevent_7__ident_ValuedWeakRef *__pyx_v_vref) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_return_ident", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __pyx_f_6gevent_7__ident_13IdentRegistry__return_ident(__pyx_v_self, __pyx_v_vref, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 68, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.__ident.IdentRegistry._return_ident", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__4 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_vref); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 68, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__4);
+  __Pyx_GIVEREF(__pyx_tuple__4);
+/* … */
+  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_7__ident_13IdentRegistry_5_return_ident, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_IdentRegistry__return_ident, NULL, __pyx_n_s_gevent___ident, __pyx_d, ((PyObject *)__pyx_codeobj__5)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 68, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_7__ident_IdentRegistry->tp_dict, __pyx_n_s_return_ident, __pyx_t_1) < 0) __PYX_ERR(0, 68, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_7__ident_IdentRegistry);
+
 69:         # By the time this is called, self._registry has been
+
 70:         # updated
+
+71:         if heappush is not None:
+
  __pyx_t_1 = (__pyx_v_6gevent_7__ident_heappush != Py_None);
+  __pyx_t_2 = (__pyx_t_1 != 0);
+  if (__pyx_t_2) {
+/* … */
+  }
+
 72:             # Under some circumstances we can get called
+
 73:             # when the interpreter is shutting down, and globals
+
 74:             # aren't available any more.
+
+75:             heappush(self._available_idents, vref.value)
+
    __Pyx_INCREF(__pyx_v_6gevent_7__ident_heappush);
+    __pyx_t_4 = __pyx_v_6gevent_7__ident_heappush; __pyx_t_5 = NULL;
+    __pyx_t_6 = 0;
+    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
+      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
+      if (likely(__pyx_t_5)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
+        __Pyx_INCREF(__pyx_t_5);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_4, function);
+        __pyx_t_6 = 1;
+      }
+    }
+    #if CYTHON_FAST_PYCALL
+    if (PyFunction_Check(__pyx_t_4)) {
+      PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_self->_available_idents, __pyx_v_vref->value};
+      __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 75, __pyx_L1_error)
+      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+      __Pyx_GOTREF(__pyx_t_3);
+    } else
+    #endif
+    #if CYTHON_FAST_PYCCALL
+    if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
+      PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_self->_available_idents, __pyx_v_vref->value};
+      __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 75, __pyx_L1_error)
+      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+      __Pyx_GOTREF(__pyx_t_3);
+    } else
+    #endif
+    {
+      __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 75, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_7);
+      if (__pyx_t_5) {
+        __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
+      }
+      __Pyx_INCREF(__pyx_v_self->_available_idents);
+      __Pyx_GIVEREF(__pyx_v_self->_available_idents);
+      PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_v_self->_available_idents);
+      __Pyx_INCREF(__pyx_v_vref->value);
+      __Pyx_GIVEREF(__pyx_v_vref->value);
+      PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_vref->value);
+      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 75, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_3);
+      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+    }
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+
 76: 
+
+77:     def __len__(self):
+
/* Python wrapper */
+static Py_ssize_t __pyx_pw_6gevent_7__ident_13IdentRegistry_7__len__(PyObject *__pyx_v_self); /*proto*/
+static Py_ssize_t __pyx_pw_6gevent_7__ident_13IdentRegistry_7__len__(PyObject *__pyx_v_self) {
+  Py_ssize_t __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_7__ident_13IdentRegistry_6__len__(((struct __pyx_obj_6gevent_7__ident_IdentRegistry *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static Py_ssize_t __pyx_pf_6gevent_7__ident_13IdentRegistry_6__len__(struct __pyx_obj_6gevent_7__ident_IdentRegistry *__pyx_v_self) {
+  Py_ssize_t __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__len__", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.__ident.IdentRegistry.__len__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = -1;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+78:         return len(self._registry)
+
  __pyx_t_1 = __pyx_v_self->_registry;
+  __Pyx_INCREF(__pyx_t_1);
+  __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 78, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_r = __pyx_t_2;
+  goto __pyx_L0;
+
 79: 
+
 80: 
+
+81: from gevent._util import import_c_accel
+
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 81, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(__pyx_n_s_import_c_accel);
+  __Pyx_GIVEREF(__pyx_n_s_import_c_accel);
+  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_import_c_accel);
+  __pyx_t_2 = __Pyx_Import(__pyx_n_s_gevent__util, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 81, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_import_c_accel); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 81, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_import_c_accel, __pyx_t_1) < 0) __PYX_ERR(0, 81, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+82: import_c_accel(globals(), 'gevent.__ident')
+
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_import_c_accel); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 82, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_1 = __Pyx_Globals(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 82, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 82, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_GIVEREF(__pyx_t_1);
+  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
+  __Pyx_INCREF(__pyx_n_s_gevent___ident);
+  __Pyx_GIVEREF(__pyx_n_s_gevent___ident);
+  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_n_s_gevent___ident);
+  __pyx_t_1 = 0;
+  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 82, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_ident.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_ident.py new file mode 100644 index 00000000..97c60553 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_ident.py @@ -0,0 +1,82 @@ +# -*- coding: utf-8 -*- +# Copyright 2018 gevent contributors. See LICENSE for details. +# cython: auto_pickle=False,embedsignature=True,always_allow_keywords=False + +from __future__ import absolute_import +from __future__ import division +from __future__ import print_function + + +from weakref import WeakKeyDictionary +from weakref import ref + +from heapq import heappop +from heapq import heappush + +__all__ = [ + 'IdentRegistry', +] + +class ValuedWeakRef(ref): + """ + A weak ref with an associated value. + """ + + __slots__ = ('value',) + + +class IdentRegistry(object): + """ + Maintains a unique mapping of (small) positive integer identifiers + to objects that can be weakly referenced. + + It is guaranteed that no two objects will have the the same + identifier at the same time, as long as those objects are + also uniquely hashable. + """ + + def __init__(self): + # {obj -> (ident, wref(obj))} + self._registry = WeakKeyDictionary() + + # A heap of numbers that have been used and returned + self._available_idents = [] + + def get_ident(self, obj): + """ + Retrieve the identifier for *obj*, creating one + if necessary. + """ + + try: + return self._registry[obj][0] + except KeyError: + pass + + if self._available_idents: + # Take the smallest free number + ident = heappop(self._available_idents) + else: + # Allocate a bigger one + ident = len(self._registry) + + vref = ValuedWeakRef(obj, self._return_ident) + vref.value = ident # pylint:disable=assigning-non-slot,attribute-defined-outside-init + self._registry[obj] = (ident, vref) + return ident + + def _return_ident(self, vref): + # By the time this is called, self._registry has been + # updated + if heappush is not None: + # Under some circumstances we can get called + # when the interpreter is shutting down, and globals + # aren't available any more. + heappush(self._available_idents, vref.value) + + def __len__(self): + return len(self._registry) + + +from gevent._util import import_c_accel +import_c_accel(globals(), 'gevent.__ident') diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_imap.c b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_imap.c new file mode 100644 index 00000000..702aec11 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_imap.c @@ -0,0 +1,10616 @@ +/* Generated by Cython 0.29.2 */ + +/* BEGIN: Cython Metadata +{ + "distutils": { + "depends": [ + "src/gevent/__imap.pxd", + "src\\gevent\\__imap.pxd" + ], + "include_dirs": [ + "C:\\Python37-x64\\Include", + "deps" + ], + "name": "gevent.__imap", + "sources": [ + "src/gevent/_imap.py" + ] + }, + "module_name": "gevent.__imap" +} +END: Cython Metadata */ + +#define PY_SSIZE_T_CLEAN +#include "Python.h" +#ifndef Py_PYTHON_H + #error Python headers needed to compile C extensions, please install development version of Python. +#elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) + #error Cython requires Python 2.6+ or Python 3.3+. +#else +#define CYTHON_ABI "0_29_2" +#define CYTHON_HEX_VERSION 0x001D02F0 +#define CYTHON_FUTURE_DIVISION 1 +#include +#ifndef offsetof + #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) +#endif +#if !defined(WIN32) && !defined(MS_WINDOWS) + #ifndef __stdcall + #define __stdcall + #endif + #ifndef __cdecl + #define __cdecl + #endif + #ifndef __fastcall + #define __fastcall + #endif +#endif +#ifndef DL_IMPORT + #define DL_IMPORT(t) t +#endif +#ifndef DL_EXPORT + #define DL_EXPORT(t) t +#endif +#define __PYX_COMMA , +#ifndef HAVE_LONG_LONG + #if PY_VERSION_HEX >= 0x02070000 + #define HAVE_LONG_LONG + #endif +#endif +#ifndef PY_LONG_LONG + #define PY_LONG_LONG LONG_LONG +#endif +#ifndef Py_HUGE_VAL + #define Py_HUGE_VAL HUGE_VAL +#endif +#ifdef PYPY_VERSION + #define CYTHON_COMPILING_IN_PYPY 1 + #define CYTHON_COMPILING_IN_PYSTON 0 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #undef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 0 + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #if PY_VERSION_HEX < 0x03050000 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #elif !defined(CYTHON_USE_ASYNC_SLOTS) + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #undef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 0 + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #undef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 1 + #undef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 0 + #undef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 0 + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #undef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE 0 + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 +#elif defined(PYSTON_VERSION) + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_PYSTON 1 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #ifndef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 1 + #endif + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #ifndef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 1 + #endif + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #ifndef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 0 + #endif + #ifndef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 1 + #endif + #ifndef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 1 + #endif + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #undef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE 0 + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 +#else + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_PYSTON 0 + #define CYTHON_COMPILING_IN_CPYTHON 1 + #ifndef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 1 + #endif + #if PY_VERSION_HEX < 0x02070000 + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #elif !defined(CYTHON_USE_PYTYPE_LOOKUP) + #define CYTHON_USE_PYTYPE_LOOKUP 1 + #endif + #if PY_MAJOR_VERSION < 3 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #elif !defined(CYTHON_USE_ASYNC_SLOTS) + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #if PY_VERSION_HEX < 0x02070000 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #elif !defined(CYTHON_USE_PYLONG_INTERNALS) + #define CYTHON_USE_PYLONG_INTERNALS 1 + #endif + #ifndef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 1 + #endif + #ifndef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 1 + #endif + #if PY_VERSION_HEX < 0x030300F0 + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #elif !defined(CYTHON_USE_UNICODE_WRITER) + #define CYTHON_USE_UNICODE_WRITER 1 + #endif + #ifndef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 0 + #endif + #ifndef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 1 + #endif + #ifndef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 1 + #endif + #ifndef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 1 + #endif + #ifndef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 1 + #endif + #ifndef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000) + #endif + #ifndef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1) + #endif + #ifndef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1) + #endif + #ifndef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3) + #endif +#endif +#if !defined(CYTHON_FAST_PYCCALL) +#define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) +#endif +#if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #undef SHIFT + #undef BASE + #undef MASK + #ifdef SIZEOF_VOID_P + enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) }; + #endif +#endif +#ifndef __has_attribute + #define __has_attribute(x) 0 +#endif +#ifndef __has_cpp_attribute + #define __has_cpp_attribute(x) 0 +#endif +#ifndef CYTHON_RESTRICT + #if defined(__GNUC__) + #define CYTHON_RESTRICT __restrict__ + #elif defined(_MSC_VER) && _MSC_VER >= 1400 + #define CYTHON_RESTRICT __restrict + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_RESTRICT restrict + #else + #define CYTHON_RESTRICT + #endif +#endif +#ifndef CYTHON_UNUSED +# if defined(__GNUC__) +# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +#endif +#ifndef CYTHON_MAYBE_UNUSED_VAR +# if defined(__cplusplus) + template void CYTHON_MAYBE_UNUSED_VAR( const T& ) { } +# else +# define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x) +# endif +#endif +#ifndef CYTHON_NCP_UNUSED +# if CYTHON_COMPILING_IN_CPYTHON +# define CYTHON_NCP_UNUSED +# else +# define CYTHON_NCP_UNUSED CYTHON_UNUSED +# endif +#endif +#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) +#ifdef _MSC_VER + #ifndef _MSC_STDINT_H_ + #if _MSC_VER < 1300 + typedef unsigned char uint8_t; + typedef unsigned int uint32_t; + #else + typedef unsigned __int8 uint8_t; + typedef unsigned __int32 uint32_t; + #endif + #endif +#else + #include +#endif +#ifndef CYTHON_FALLTHROUGH + #if defined(__cplusplus) && __cplusplus >= 201103L + #if __has_cpp_attribute(fallthrough) + #define CYTHON_FALLTHROUGH [[fallthrough]] + #elif __has_cpp_attribute(clang::fallthrough) + #define CYTHON_FALLTHROUGH [[clang::fallthrough]] + #elif __has_cpp_attribute(gnu::fallthrough) + #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] + #endif + #endif + #ifndef CYTHON_FALLTHROUGH + #if __has_attribute(fallthrough) + #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) + #else + #define CYTHON_FALLTHROUGH + #endif + #endif + #if defined(__clang__ ) && defined(__apple_build_version__) + #if __apple_build_version__ < 7000000 + #undef CYTHON_FALLTHROUGH + #define CYTHON_FALLTHROUGH + #endif + #endif +#endif + +#ifndef CYTHON_INLINE + #if defined(__clang__) + #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) + #elif defined(__GNUC__) + #define CYTHON_INLINE __inline__ + #elif defined(_MSC_VER) + #define CYTHON_INLINE __inline + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_INLINE inline + #else + #define CYTHON_INLINE + #endif +#endif + +#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) + #define Py_OptimizeFlag 0 +#endif +#define __PYX_BUILD_PY_SSIZE_T "n" +#define CYTHON_FORMAT_SSIZE_T "z" +#if PY_MAJOR_VERSION < 3 + #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyClass_Type +#else + #define __Pyx_BUILTIN_MODULE_NAME "builtins" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyType_Type +#endif +#ifndef Py_TPFLAGS_CHECKTYPES + #define Py_TPFLAGS_CHECKTYPES 0 +#endif +#ifndef Py_TPFLAGS_HAVE_INDEX + #define Py_TPFLAGS_HAVE_INDEX 0 +#endif +#ifndef Py_TPFLAGS_HAVE_NEWBUFFER + #define Py_TPFLAGS_HAVE_NEWBUFFER 0 +#endif +#ifndef Py_TPFLAGS_HAVE_FINALIZE + #define Py_TPFLAGS_HAVE_FINALIZE 0 +#endif +#ifndef METH_STACKLESS + #define METH_STACKLESS 0 +#endif +#if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) + #ifndef METH_FASTCALL + #define METH_FASTCALL 0x80 + #endif + typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs); + typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args, + Py_ssize_t nargs, PyObject *kwnames); +#else + #define __Pyx_PyCFunctionFast _PyCFunctionFast + #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords +#endif +#if CYTHON_FAST_PYCCALL +#define __Pyx_PyFastCFunction_Check(func)\ + ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS))))) +#else +#define __Pyx_PyFastCFunction_Check(func) 0 +#endif +#if CYTHON_USE_DICT_VERSIONS +#define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) +#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ + (version_var) = __PYX_GET_DICT_VERSION(dict);\ + (cache_var) = (value); +#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ + static PY_UINT64_T __pyx_dict_version = 0;\ + static PyObject *__pyx_dict_cached_value = NULL;\ + if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ + (VAR) = __pyx_dict_cached_value;\ + } else {\ + (VAR) = __pyx_dict_cached_value = (LOOKUP);\ + __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ + }\ + } +#else +#define __PYX_GET_DICT_VERSION(dict) (0) +#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) +#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) + #define PyObject_Malloc(s) PyMem_Malloc(s) + #define PyObject_Free(p) PyMem_Free(p) + #define PyObject_Realloc(p) PyMem_Realloc(p) +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1 + #define PyMem_RawMalloc(n) PyMem_Malloc(n) + #define PyMem_RawRealloc(p, n) PyMem_Realloc(p, n) + #define PyMem_RawFree(p) PyMem_Free(p) +#endif +#if CYTHON_COMPILING_IN_PYSTON + #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co) + #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno) +#else + #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) + #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) +#endif +#if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000 + #define __Pyx_PyThreadState_Current PyThreadState_GET() +#elif PY_VERSION_HEX >= 0x03060000 + #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() +#elif PY_VERSION_HEX >= 0x03000000 + #define __Pyx_PyThreadState_Current PyThreadState_GET() +#else + #define __Pyx_PyThreadState_Current _PyThreadState_Current +#endif +#if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) +#include "pythread.h" +#define Py_tss_NEEDS_INIT 0 +typedef int Py_tss_t; +static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) { + *key = PyThread_create_key(); + return 0; // PyThread_create_key reports success always +} +static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) { + Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t)); + *key = Py_tss_NEEDS_INIT; + return key; +} +static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) { + PyObject_Free(key); +} +static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) { + return *key != Py_tss_NEEDS_INIT; +} +static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) { + PyThread_delete_key(*key); + *key = Py_tss_NEEDS_INIT; +} +static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) { + return PyThread_set_key_value(*key, value); +} +static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { + return PyThread_get_key_value(*key); +} +#endif // TSS (Thread Specific Storage) API +#if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized) +#define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) +#else +#define __Pyx_PyDict_NewPresized(n) PyDict_New() +#endif +#if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION + #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) +#else + #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS +#define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) +#else +#define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name) +#endif +#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) + #define CYTHON_PEP393_ENABLED 1 + #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ + 0 : _PyUnicode_Ready((PyObject *)(op))) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) + #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) + #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) + #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) + #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) + #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch) + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) +#else + #define CYTHON_PEP393_ENABLED 0 + #define PyUnicode_1BYTE_KIND 1 + #define PyUnicode_2BYTE_KIND 2 + #define PyUnicode_4BYTE_KIND 4 + #define __Pyx_PyUnicode_READY(op) (0) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) + #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111) + #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) + #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) + #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) + #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch) + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) +#endif +#if CYTHON_COMPILING_IN_PYPY + #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) +#else + #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ + PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains) + #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check) + #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format) + #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) +#endif +#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) +#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) +#else + #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) +#endif +#if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) + #define PyObject_ASCII(o) PyObject_Repr(o) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBaseString_Type PyUnicode_Type + #define PyStringObject PyUnicodeObject + #define PyString_Type PyUnicode_Type + #define PyString_Check PyUnicode_Check + #define PyString_CheckExact PyUnicode_CheckExact + #define PyObject_Unicode PyObject_Str +#endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) + #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) +#else + #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) + #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) +#endif +#ifndef PySet_CheckExact + #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) +#endif +#if CYTHON_ASSUME_SAFE_MACROS + #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) +#else + #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyIntObject PyLongObject + #define PyInt_Type PyLong_Type + #define PyInt_Check(op) PyLong_Check(op) + #define PyInt_CheckExact(op) PyLong_CheckExact(op) + #define PyInt_FromString PyLong_FromString + #define PyInt_FromUnicode PyLong_FromUnicode + #define PyInt_FromLong PyLong_FromLong + #define PyInt_FromSize_t PyLong_FromSize_t + #define PyInt_FromSsize_t PyLong_FromSsize_t + #define PyInt_AsLong PyLong_AsLong + #define PyInt_AS_LONG PyLong_AS_LONG + #define PyInt_AsSsize_t PyLong_AsSsize_t + #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask + #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask + #define PyNumber_Int PyNumber_Long +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBoolObject PyLongObject +#endif +#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY + #ifndef PyUnicode_InternFromString + #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) + #endif +#endif +#if PY_VERSION_HEX < 0x030200A4 + typedef long Py_hash_t; + #define __Pyx_PyInt_FromHash_t PyInt_FromLong + #define __Pyx_PyInt_AsHash_t PyInt_AsLong +#else + #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t + #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t +#endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : (Py_INCREF(func), func)) +#else + #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) +#endif +#if CYTHON_USE_ASYNC_SLOTS + #if PY_VERSION_HEX >= 0x030500B1 + #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods + #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) + #else + #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) + #endif +#else + #define __Pyx_PyType_AsAsync(obj) NULL +#endif +#ifndef __Pyx_PyAsyncMethodsStruct + typedef struct { + unaryfunc am_await; + unaryfunc am_aiter; + unaryfunc am_anext; + } __Pyx_PyAsyncMethodsStruct; +#endif + +#if defined(WIN32) || defined(MS_WINDOWS) + #define _USE_MATH_DEFINES +#endif +#include +#ifdef NAN +#define __PYX_NAN() ((float) NAN) +#else +static CYTHON_INLINE float __PYX_NAN() { + float value; + memset(&value, 0xFF, sizeof(value)); + return value; +} +#endif +#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) +#define __Pyx_truncl trunc +#else +#define __Pyx_truncl truncl +#endif + + +#define __PYX_ERR(f_index, lineno, Ln_error) \ +{ \ + __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \ +} + +#ifndef __PYX_EXTERN_C + #ifdef __cplusplus + #define __PYX_EXTERN_C extern "C" + #else + #define __PYX_EXTERN_C extern + #endif +#endif + +#define __PYX_HAVE__gevent____imap +#define __PYX_HAVE_API__gevent____imap +/* Early includes */ +#include "greenlet/greenlet.h" +#include "frameobject.h" +#ifdef _OPENMP +#include +#endif /* _OPENMP */ + +#if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) +#define CYTHON_WITHOUT_ASSERTIONS +#endif + +typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; + const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; + +#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 +#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0 +#define __PYX_DEFAULT_STRING_ENCODING "" +#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString +#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#define __Pyx_uchar_cast(c) ((unsigned char)c) +#define __Pyx_long_cast(x) ((long)x) +#define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ + (sizeof(type) < sizeof(Py_ssize_t)) ||\ + (sizeof(type) > sizeof(Py_ssize_t) &&\ + likely(v < (type)PY_SSIZE_T_MAX ||\ + v == (type)PY_SSIZE_T_MAX) &&\ + (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ + v == (type)PY_SSIZE_T_MIN))) ||\ + (sizeof(type) == sizeof(Py_ssize_t) &&\ + (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ + v == (type)PY_SSIZE_T_MAX))) ) +static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) { + return (size_t) i < (size_t) limit; +} +#if defined (__cplusplus) && __cplusplus >= 201103L + #include + #define __Pyx_sst_abs(value) std::abs(value) +#elif SIZEOF_INT >= SIZEOF_SIZE_T + #define __Pyx_sst_abs(value) abs(value) +#elif SIZEOF_LONG >= SIZEOF_SIZE_T + #define __Pyx_sst_abs(value) labs(value) +#elif defined (_MSC_VER) + #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) +#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define __Pyx_sst_abs(value) llabs(value) +#elif defined (__GNUC__) + #define __Pyx_sst_abs(value) __builtin_llabs(value) +#else + #define __Pyx_sst_abs(value) ((value<0) ? -value : value) +#endif +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*); +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); +#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) +#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) +#define __Pyx_PyBytes_FromString PyBytes_FromString +#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); +#if PY_MAJOR_VERSION < 3 + #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#else + #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize +#endif +#define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) +#define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) +#define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) +#define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) +#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) +static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) { + const Py_UNICODE *u_end = u; + while (*u_end++) ; + return (size_t)(u_end - u - 1); +} +#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) +#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode +#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode +#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) +#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) +static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); +static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*); +static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); +#define __Pyx_PySequence_Tuple(obj)\ + (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); +#if CYTHON_ASSUME_SAFE_MACROS +#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) +#else +#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) +#endif +#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) +#if PY_MAJOR_VERSION >= 3 +#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) +#else +#define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) +#endif +#define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x)) +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII +static int __Pyx_sys_getdefaultencoding_not_ascii; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + PyObject* ascii_chars_u = NULL; + PyObject* ascii_chars_b = NULL; + const char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + if (strcmp(default_encoding_c, "ascii") == 0) { + __Pyx_sys_getdefaultencoding_not_ascii = 0; + } else { + char ascii_chars[128]; + int c; + for (c = 0; c < 128; c++) { + ascii_chars[c] = c; + } + __Pyx_sys_getdefaultencoding_not_ascii = 1; + ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); + if (!ascii_chars_u) goto bad; + ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); + if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { + PyErr_Format( + PyExc_ValueError, + "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", + default_encoding_c); + goto bad; + } + Py_DECREF(ascii_chars_u); + Py_DECREF(ascii_chars_b); + } + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + Py_XDECREF(ascii_chars_u); + Py_XDECREF(ascii_chars_b); + return -1; +} +#endif +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) +#else +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +static char* __PYX_DEFAULT_STRING_ENCODING; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1); + if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; + strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + return -1; +} +#endif +#endif + + +/* Test for GCC > 2.95 */ +#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) + #define likely(x) __builtin_expect(!!(x), 1) + #define unlikely(x) __builtin_expect(!!(x), 0) +#else /* !__GNUC__ or GCC < 2.95 */ + #define likely(x) (x) + #define unlikely(x) (x) +#endif /* __GNUC__ */ +static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } + +static PyObject *__pyx_m = NULL; +static PyObject *__pyx_d; +static PyObject *__pyx_b; +static PyObject *__pyx_cython_runtime = NULL; +static PyObject *__pyx_empty_tuple; +static PyObject *__pyx_empty_bytes; +static PyObject *__pyx_empty_unicode; +static int __pyx_lineno; +static int __pyx_clineno = 0; +static const char * __pyx_cfilenm= __FILE__; +static const char *__pyx_filename; + + +static const char *__pyx_f[] = { + "src\\gevent\\_imap.py", + "src\\gevent\\__imap.pxd", + "src\\gevent\\__greenlet_primitives.pxd", + "src\\gevent\\__waiter.pxd", + "src\\gevent\\_greenlet.pxd", + "src\\gevent\\__abstract_linkable.pxd", + "src\\gevent\\__ident.pxd", + "src\\gevent\\__semaphore.pxd", + "src\\gevent\\_event.pxd", + "src\\gevent\\_queue.pxd", +}; + +/*--- Type declarations ---*/ +struct __pyx_obj_6gevent_7__ident_ValuedWeakRef; +struct __pyx_obj_6gevent_7__ident_IdentRegistry; +struct __pyx_obj_6gevent_21__greenlet_primitives_TrackedRawGreenlet; +struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop; +struct __pyx_obj_6gevent_8__waiter_Waiter; +struct __pyx_obj_6gevent_8__waiter_MultipleWaiter; +struct __pyx_obj_6gevent_9_greenlet_SpawnedLink; +struct __pyx_obj_6gevent_9_greenlet_SuccessSpawnedLink; +struct __pyx_obj_6gevent_9_greenlet_FailureSpawnedLink; +struct __pyx_obj_6gevent_9_greenlet__Frame; +struct __pyx_obj_6gevent_9_greenlet_Greenlet; +struct __pyx_obj_6gevent_9_greenlet__dummy_event; +struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable; +struct __pyx_obj_6gevent_11__semaphore_Semaphore; +struct __pyx_obj_6gevent_11__semaphore_BoundedSemaphore; +struct __pyx_obj_6gevent_6_event_Event; +struct __pyx_obj_6gevent_6_event_AsyncResult; +struct __pyx_obj_6gevent_6_queue_ItemWaiter; +struct __pyx_obj_6gevent_6_queue_Queue; +struct __pyx_obj_6gevent_6_queue_UnboundQueue; +struct __pyx_obj_6gevent_6_queue_PriorityQueue; +struct __pyx_obj_6gevent_6_queue_LifoQueue; +struct __pyx_obj_6gevent_6_queue_JoinableQueue; +struct __pyx_obj_6gevent_6_queue_Channel; +struct __pyx_obj_6gevent_6__imap_Failure; +struct __pyx_obj_6gevent_6__imap_IMapUnordered; +struct __pyx_obj_6gevent_6__imap_IMap; +struct __pyx_opt_args_6gevent_9_greenlet_8Greenlet_join; +struct __pyx_opt_args_6gevent_9_greenlet_joinall; + +/* "gevent/_greenlet.pxd":105 + * + * cpdef bint has_links(self) + * cpdef join(self, timeout=*) # <<<<<<<<<<<<<< + * cpdef bint ready(self) + * cpdef bint successful(self) + */ +struct __pyx_opt_args_6gevent_9_greenlet_8Greenlet_join { + int __pyx_n; + PyObject *timeout; +}; + +/* "gevent/_greenlet.pxd":174 + * + * @cython.locals(done=list) + * cpdef joinall(greenlets, timeout=*, raise_error=*, count=*) # <<<<<<<<<<<<<< + * + * cdef set _spawn_callbacks + */ +struct __pyx_opt_args_6gevent_9_greenlet_joinall { + int __pyx_n; + PyObject *timeout; + PyObject *raise_error; + PyObject *count; +}; +struct __pyx_opt_args_6gevent_19__abstract_linkable_16AbstractLinkable__wait_core; +struct __pyx_opt_args_6gevent_19__abstract_linkable_16AbstractLinkable__wait; + +/* "gevent/__abstract_linkable.pxd":51 + * cdef _check_and_notify(self) + * cpdef _notify_links(self) + * cdef _wait_core(self, timeout, catch=*) # <<<<<<<<<<<<<< + * cdef _wait_return_value(self, waited, wait_success) + * cdef _wait(self, timeout=*) + */ +struct __pyx_opt_args_6gevent_19__abstract_linkable_16AbstractLinkable__wait_core { + int __pyx_n; + PyObject *catch; +}; + +/* "gevent/__abstract_linkable.pxd":53 + * cdef _wait_core(self, timeout, catch=*) + * cdef _wait_return_value(self, waited, wait_success) + * cdef _wait(self, timeout=*) # <<<<<<<<<<<<<< + */ +struct __pyx_opt_args_6gevent_19__abstract_linkable_16AbstractLinkable__wait { + int __pyx_n; + PyObject *timeout; +}; +struct __pyx_opt_args_6gevent_11__semaphore_9Semaphore_wait; +struct __pyx_opt_args_6gevent_11__semaphore_9Semaphore_acquire; + +/* "gevent/__semaphore.pxd":15 + * # threadpool uses it + * cpdef _start_notify(self) + * cpdef int wait(self, object timeout=*) except -1000 # <<<<<<<<<<<<<< + * cpdef bint acquire(self, int blocking=*, object timeout=*) except -1000 + * cpdef __enter__(self) + */ +struct __pyx_opt_args_6gevent_11__semaphore_9Semaphore_wait { + int __pyx_n; + PyObject *timeout; +}; + +/* "gevent/__semaphore.pxd":16 + * cpdef _start_notify(self) + * cpdef int wait(self, object timeout=*) except -1000 + * cpdef bint acquire(self, int blocking=*, object timeout=*) except -1000 # <<<<<<<<<<<<<< + * cpdef __enter__(self) + * cpdef __exit__(self, object t, object v, object tb) + */ +struct __pyx_opt_args_6gevent_11__semaphore_9Semaphore_acquire { + int __pyx_n; + int blocking; + PyObject *timeout; +}; +struct __pyx_opt_args_6gevent_6_event_11AsyncResult_get; +struct __pyx_opt_args_6gevent_6_event_11AsyncResult_wait; + +/* "gevent/_event.pxd":23 + * cdef public int _imap_task_index + * + * cpdef get(self, block=*, timeout=*) # <<<<<<<<<<<<<< + * cpdef bint successful(self) + * + */ +struct __pyx_opt_args_6gevent_6_event_11AsyncResult_get { + int __pyx_n; + PyObject *block; + PyObject *timeout; +}; + +/* "gevent/_event.pxd":26 + * cpdef bint successful(self) + * + * cpdef wait(self, timeout=*) # <<<<<<<<<<<<<< + * cpdef bint done(self) + * + */ +struct __pyx_opt_args_6gevent_6_event_11AsyncResult_wait { + int __pyx_n; + PyObject *timeout; +}; +struct __pyx_opt_args_6gevent_6_queue_5Queue_put; +struct __pyx_opt_args_6gevent_6_queue_5Queue_get; +struct __pyx_opt_args_6gevent_6_queue_5Queue_peek; +struct __pyx_opt_args_6gevent_6_queue_7Channel_get; + +/* "gevent/_queue.pxd":37 + * cpdef bint full(self) + * + * cpdef put(self, item, block=*, timeout=*) # <<<<<<<<<<<<<< + * cpdef put_nowait(self, item) + * + */ +struct __pyx_opt_args_6gevent_6_queue_5Queue_put { + int __pyx_n; + PyObject *block; + PyObject *timeout; +}; + +/* "gevent/_queue.pxd":42 + * cdef __get_or_peek(self, method, block, timeout) + * + * cpdef get(self, block=*, timeout=*) # <<<<<<<<<<<<<< + * cpdef get_nowait(self) + * cpdef peek(self, block=*, timeout=*) + */ +struct __pyx_opt_args_6gevent_6_queue_5Queue_get { + int __pyx_n; + PyObject *block; + PyObject *timeout; +}; + +/* "gevent/_queue.pxd":44 + * cpdef get(self, block=*, timeout=*) + * cpdef get_nowait(self) + * cpdef peek(self, block=*, timeout=*) # <<<<<<<<<<<<<< + * cpdef peek_nowait(self) + * + */ +struct __pyx_opt_args_6gevent_6_queue_5Queue_peek { + int __pyx_n; + PyObject *block; + PyObject *timeout; +}; + +/* "gevent/_queue.pxd":71 + * cdef _event_unlock + * + * cpdef get(self, block=*, timeout=*) # <<<<<<<<<<<<<< + * cpdef get_nowait(self) + * + */ +struct __pyx_opt_args_6gevent_6_queue_7Channel_get { + int __pyx_n; + PyObject *block; + PyObject *timeout; +}; + +/* "gevent/__ident.pxd":15 + * @cython.internal + * @cython.final + * cdef class ValuedWeakRef(ref): # <<<<<<<<<<<<<< + * cdef object value + * + */ +struct __pyx_obj_6gevent_7__ident_ValuedWeakRef { + PyWeakReference __pyx_base; + PyObject *value; +}; + + +/* "gevent/__ident.pxd":19 + * + * @cython.final + * cdef class IdentRegistry: # <<<<<<<<<<<<<< + * cdef object _registry + * cdef list _available_idents + */ +struct __pyx_obj_6gevent_7__ident_IdentRegistry { + PyObject_HEAD + struct __pyx_vtabstruct_6gevent_7__ident_IdentRegistry *__pyx_vtab; + PyObject *_registry; + PyObject *_available_idents; +}; + + +/* "gevent/__greenlet_primitives.pxd":37 + * return PyGreenlet_Switch(self, NULL, NULL) + * + * cdef class TrackedRawGreenlet(greenlet): # <<<<<<<<<<<<<< + * pass + * + */ +struct __pyx_obj_6gevent_21__greenlet_primitives_TrackedRawGreenlet { + PyGreenlet __pyx_base; +}; + + +/* "gevent/__greenlet_primitives.pxd":40 + * pass + * + * cdef class SwitchOutGreenletWithLoop(TrackedRawGreenlet): # <<<<<<<<<<<<<< + * cdef public loop + * + */ +struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop { + struct __pyx_obj_6gevent_21__greenlet_primitives_TrackedRawGreenlet __pyx_base; + struct __pyx_vtabstruct_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *__pyx_vtab; + PyObject *loop; +}; + + +/* "gevent/__waiter.pxd":33 + * _greenlet_imported = True + * + * cdef class Waiter: # <<<<<<<<<<<<<< + * cdef readonly SwitchOutGreenletWithLoop hub + * cdef readonly greenlet greenlet + */ +struct __pyx_obj_6gevent_8__waiter_Waiter { + PyObject_HEAD + struct __pyx_vtabstruct_6gevent_8__waiter_Waiter *__pyx_vtab; + struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *hub; + PyGreenlet *greenlet; + PyObject *value; + PyObject *_exception; +}; + + +/* "gevent/__waiter.pxd":47 + * @cython.final + * @cython.internal + * cdef class MultipleWaiter(Waiter): # <<<<<<<<<<<<<< + * cdef list _values + */ +struct __pyx_obj_6gevent_8__waiter_MultipleWaiter { + struct __pyx_obj_6gevent_8__waiter_Waiter __pyx_base; + PyObject *_values; +}; + + +/* "gevent/_greenlet.pxd":56 + * cdef void _init() + * + * cdef class SpawnedLink: # <<<<<<<<<<<<<< + * cdef public object callback + * + */ +struct __pyx_obj_6gevent_9_greenlet_SpawnedLink { + PyObject_HEAD + PyObject *callback; +}; + + +/* "gevent/_greenlet.pxd":61 + * + * @cython.final + * cdef class SuccessSpawnedLink(SpawnedLink): # <<<<<<<<<<<<<< + * pass + * + */ +struct __pyx_obj_6gevent_9_greenlet_SuccessSpawnedLink { + struct __pyx_obj_6gevent_9_greenlet_SpawnedLink __pyx_base; +}; + + +/* "gevent/_greenlet.pxd":65 + * + * @cython.final + * cdef class FailureSpawnedLink(SpawnedLink): # <<<<<<<<<<<<<< + * pass + * + */ +struct __pyx_obj_6gevent_9_greenlet_FailureSpawnedLink { + struct __pyx_obj_6gevent_9_greenlet_SpawnedLink __pyx_base; +}; + + +/* "gevent/_greenlet.pxd":71 + * @cython.internal + * @cython.freelist(1000) + * cdef class _Frame: # <<<<<<<<<<<<<< + * cdef readonly CodeType f_code + * cdef readonly int f_lineno + */ +struct __pyx_obj_6gevent_9_greenlet__Frame { + PyObject_HEAD + PyCodeObject *f_code; + int f_lineno; + struct __pyx_obj_6gevent_9_greenlet__Frame *f_back; +}; + + +/* "gevent/_greenlet.pxd":86 + * + * + * cdef class Greenlet(greenlet): # <<<<<<<<<<<<<< + * cdef readonly object value + * cdef readonly tuple args + */ +struct __pyx_obj_6gevent_9_greenlet_Greenlet { + PyGreenlet __pyx_base; + struct __pyx_vtabstruct_6gevent_9_greenlet_Greenlet *__pyx_vtab; + PyObject *value; + PyObject *args; + PyObject *kwargs; + PyObject *spawning_greenlet; + PyObject *spawn_tree_locals; + PyObject *_spawning_stack_frames; + PyObject *_links; + PyObject *_exc_info; + PyObject *_notifier; + PyObject *_start_event; + PyObject *_formatted_info; + PyObject *_ident; +}; + + +/* "gevent/_greenlet.pxd":157 + * @cython.final + * @cython.internal + * cdef class _dummy_event: # <<<<<<<<<<<<<< + * cdef readonly bint pending + * cdef readonly bint active + */ +struct __pyx_obj_6gevent_9_greenlet__dummy_event { + PyObject_HEAD + struct __pyx_vtabstruct_6gevent_9_greenlet__dummy_event *__pyx_vtab; + int pending; + int active; +}; + + +/* "gevent/__abstract_linkable.pxd":32 + * cdef void _init() + * + * cdef class AbstractLinkable(object): # <<<<<<<<<<<<<< + * # We declare the __weakref__ here in the base (even though + * # that's not really what we want) as a workaround for a Cython + */ +struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable { + PyObject_HEAD + struct __pyx_vtabstruct_6gevent_19__abstract_linkable_AbstractLinkable *__pyx_vtab; + PyObject *__weakref__; + struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *hub; + PyObject *_notifier; + PyObject *_links; + int _notify_all; +}; + + +/* "gevent/__semaphore.pxd":7 + * + * + * cdef class Semaphore(AbstractLinkable): # <<<<<<<<<<<<<< + * cdef public int counter + * + */ +struct __pyx_obj_6gevent_11__semaphore_Semaphore { + struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable __pyx_base; + int counter; +}; + + +/* "gevent/__semaphore.pxd":20 + * cpdef __exit__(self, object t, object v, object tb) + * + * cdef class BoundedSemaphore(Semaphore): # <<<<<<<<<<<<<< + * cdef readonly int _initial_value + * + */ +struct __pyx_obj_6gevent_11__semaphore_BoundedSemaphore { + struct __pyx_obj_6gevent_11__semaphore_Semaphore __pyx_base; + int _initial_value; +}; + + +/* "gevent/_event.pxd":13 + * cdef Timeout + * + * cdef class Event(AbstractLinkable): # <<<<<<<<<<<<<< + * cdef bint _flag + * + */ +struct __pyx_obj_6gevent_6_event_Event { + struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable __pyx_base; + int _flag; +}; + + +/* "gevent/_event.pxd":16 + * cdef bint _flag + * + * cdef class AsyncResult(AbstractLinkable): # <<<<<<<<<<<<<< + * cdef readonly _value + * cdef readonly tuple _exc_info + */ +struct __pyx_obj_6gevent_6_event_AsyncResult { + struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable __pyx_base; + PyObject *_value; + PyObject *_exc_info; + int _imap_task_index; +}; + + +/* "gevent/_queue.pxd":14 + * @cython.final + * @cython.internal + * cdef class ItemWaiter(Waiter): # <<<<<<<<<<<<<< + * cdef readonly item + * cdef readonly queue + */ +struct __pyx_obj_6gevent_6_queue_ItemWaiter { + struct __pyx_obj_6gevent_8__waiter_Waiter __pyx_base; + PyObject *item; + PyObject *queue; +}; + + +/* "gevent/_queue.pxd":18 + * cdef readonly queue + * + * cdef class Queue: # <<<<<<<<<<<<<< + * cdef __weakref__ + * cdef readonly hub + */ +struct __pyx_obj_6gevent_6_queue_Queue { + PyObject_HEAD + struct __pyx_vtabstruct_6gevent_6_queue_Queue *__pyx_vtab; + PyObject *__weakref__; + PyObject *hub; + PyObject *queue; + PyObject *getters; + PyObject *putters; + PyObject *_event_unlock; + Py_ssize_t _maxsize; +}; + + +/* "gevent/_queue.pxd":50 + * + * @cython.final + * cdef class UnboundQueue(Queue): # <<<<<<<<<<<<<< + * pass + * + */ +struct __pyx_obj_6gevent_6_queue_UnboundQueue { + struct __pyx_obj_6gevent_6_queue_Queue __pyx_base; +}; + + +/* "gevent/_queue.pxd":53 + * pass + * + * cdef class PriorityQueue(Queue): # <<<<<<<<<<<<<< + * pass + * + */ +struct __pyx_obj_6gevent_6_queue_PriorityQueue { + struct __pyx_obj_6gevent_6_queue_Queue __pyx_base; +}; + + +/* "gevent/_queue.pxd":56 + * pass + * + * cdef class LifoQueue(Queue): # <<<<<<<<<<<<<< + * pass + * + */ +struct __pyx_obj_6gevent_6_queue_LifoQueue { + struct __pyx_obj_6gevent_6_queue_Queue __pyx_base; +}; + + +/* "gevent/_queue.pxd":59 + * pass + * + * cdef class JoinableQueue(Queue): # <<<<<<<<<<<<<< + * cdef Event _cond + * cdef readonly int unfinished_tasks + */ +struct __pyx_obj_6gevent_6_queue_JoinableQueue { + struct __pyx_obj_6gevent_6_queue_Queue __pyx_base; + struct __pyx_obj_6gevent_6_event_Event *_cond; + int unfinished_tasks; +}; + + +/* "gevent/_queue.pxd":64 + * + * + * cdef class Channel: # <<<<<<<<<<<<<< + * cdef __weakref__ + * cdef readonly getters + */ +struct __pyx_obj_6gevent_6_queue_Channel { + PyObject_HEAD + struct __pyx_vtabstruct_6gevent_6_queue_Channel *__pyx_vtab; + PyObject *__weakref__; + PyObject *getters; + PyObject *putters; + PyObject *hub; + PyObject *_event_unlock; +}; + + +/* "gevent/__imap.pxd":9 + * @cython.internal + * @cython.final + * cdef class Failure: # <<<<<<<<<<<<<< + * cdef readonly exc + * cdef raise_exception + */ +struct __pyx_obj_6gevent_6__imap_Failure { + PyObject_HEAD + PyObject *exc; + PyObject *raise_exception; +}; + + +/* "gevent/__imap.pxd":15 + * cdef inline _raise_exc(Failure failure) + * + * cdef class IMapUnordered(Greenlet): # <<<<<<<<<<<<<< + * cdef bint _zipped + * cdef func + */ +struct __pyx_obj_6gevent_6__imap_IMapUnordered { + struct __pyx_obj_6gevent_9_greenlet_Greenlet __pyx_base; + int _zipped; + PyObject *func; + PyObject *iterable; + PyObject *spawn; + struct __pyx_obj_6gevent_11__semaphore_Semaphore *_result_semaphore; + int _outstanding_tasks; + int _max_index; + struct __pyx_obj_6gevent_6_queue_UnboundQueue *queue; + int finished; +}; + + +/* "gevent/__imap.pxd":40 + * cdef _iqueue_value_for_self_failure(self, exception) + * + * cdef class IMap(IMapUnordered): # <<<<<<<<<<<<<< + * cdef int index + * cdef dict _results + */ +struct __pyx_obj_6gevent_6__imap_IMap { + struct __pyx_obj_6gevent_6__imap_IMapUnordered __pyx_base; + int index; + PyObject *_results; +}; + + + +/* "gevent/__ident.pxd":19 + * + * @cython.final + * cdef class IdentRegistry: # <<<<<<<<<<<<<< + * cdef object _registry + * cdef list _available_idents + */ + +struct __pyx_vtabstruct_6gevent_7__ident_IdentRegistry { + PyObject *(*get_ident)(struct __pyx_obj_6gevent_7__ident_IdentRegistry *, PyObject *, int __pyx_skip_dispatch); + PyObject *(*_return_ident)(struct __pyx_obj_6gevent_7__ident_IdentRegistry *, struct __pyx_obj_6gevent_7__ident_ValuedWeakRef *, int __pyx_skip_dispatch); +}; +static struct __pyx_vtabstruct_6gevent_7__ident_IdentRegistry *__pyx_vtabptr_6gevent_7__ident_IdentRegistry; + + +/* "gevent/__greenlet_primitives.pxd":40 + * pass + * + * cdef class SwitchOutGreenletWithLoop(TrackedRawGreenlet): # <<<<<<<<<<<<<< + * cdef public loop + * + */ + +struct __pyx_vtabstruct_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop { + PyObject *(*__pyx_switch)(struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *, int __pyx_skip_dispatch); + PyObject *(*switch_out)(struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *, int __pyx_skip_dispatch); +}; +static struct __pyx_vtabstruct_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *__pyx_vtabptr_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop; + + +/* "gevent/__waiter.pxd":33 + * _greenlet_imported = True + * + * cdef class Waiter: # <<<<<<<<<<<<<< + * cdef readonly SwitchOutGreenletWithLoop hub + * cdef readonly greenlet greenlet + */ + +struct __pyx_vtabstruct_6gevent_8__waiter_Waiter { + PyObject *(*get)(struct __pyx_obj_6gevent_8__waiter_Waiter *, int __pyx_skip_dispatch); + PyObject *(*clear)(struct __pyx_obj_6gevent_8__waiter_Waiter *, int __pyx_skip_dispatch); +}; +static struct __pyx_vtabstruct_6gevent_8__waiter_Waiter *__pyx_vtabptr_6gevent_8__waiter_Waiter; + + +/* "gevent/__waiter.pxd":47 + * @cython.final + * @cython.internal + * cdef class MultipleWaiter(Waiter): # <<<<<<<<<<<<<< + * cdef list _values + */ + +struct __pyx_vtabstruct_6gevent_8__waiter_MultipleWaiter { + struct __pyx_vtabstruct_6gevent_8__waiter_Waiter __pyx_base; +}; +static struct __pyx_vtabstruct_6gevent_8__waiter_MultipleWaiter *__pyx_vtabptr_6gevent_8__waiter_MultipleWaiter; + + +/* "gevent/_greenlet.pxd":86 + * + * + * cdef class Greenlet(greenlet): # <<<<<<<<<<<<<< + * cdef readonly object value + * cdef readonly tuple args + */ + +struct __pyx_vtabstruct_6gevent_9_greenlet_Greenlet { + int (*has_links)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *, int __pyx_skip_dispatch); + PyObject *(*join)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_9_greenlet_8Greenlet_join *__pyx_optional_args); + int (*ready)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *, int __pyx_skip_dispatch); + int (*successful)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *, int __pyx_skip_dispatch); + PyObject *(*rawlink)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *, PyObject *, int __pyx_skip_dispatch); + PyObject *(*_formatinfo)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *, int __pyx_skip_dispatch); + PyObject *(*_get_minimal_ident)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *); + int (*__pyx___started_but_aborted)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *); + int (*__pyx___start_cancelled_by_kill)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *); + int (*__pyx___start_pending)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *); + int (*__pyx___never_started_or_killed)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *); + int (*__pyx___start_completed)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *); + PyObject *(*__pyx___handle_death_before_start)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *, PyObject *); + PyObject *(*__pyx___cancel_start)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *); + PyObject *(*_report_result)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *, PyObject *); + PyObject *(*_report_error)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *, PyObject *); + PyObject *(*_notify_links)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *, int __pyx_skip_dispatch); +}; +static struct __pyx_vtabstruct_6gevent_9_greenlet_Greenlet *__pyx_vtabptr_6gevent_9_greenlet_Greenlet; + + +/* "gevent/_greenlet.pxd":157 + * @cython.final + * @cython.internal + * cdef class _dummy_event: # <<<<<<<<<<<<<< + * cdef readonly bint pending + * cdef readonly bint active + */ + +struct __pyx_vtabstruct_6gevent_9_greenlet__dummy_event { + PyObject *(*stop)(struct __pyx_obj_6gevent_9_greenlet__dummy_event *, int __pyx_skip_dispatch); + PyObject *(*start)(struct __pyx_obj_6gevent_9_greenlet__dummy_event *, PyObject *, int __pyx_skip_dispatch); + PyObject *(*close)(struct __pyx_obj_6gevent_9_greenlet__dummy_event *, int __pyx_skip_dispatch); +}; +static struct __pyx_vtabstruct_6gevent_9_greenlet__dummy_event *__pyx_vtabptr_6gevent_9_greenlet__dummy_event; + + +/* "gevent/__abstract_linkable.pxd":32 + * cdef void _init() + * + * cdef class AbstractLinkable(object): # <<<<<<<<<<<<<< + * # We declare the __weakref__ here in the base (even though + * # that's not really what we want) as a workaround for a Cython + */ + +struct __pyx_vtabstruct_6gevent_19__abstract_linkable_AbstractLinkable { + PyObject *(*rawlink)(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *, PyObject *, int __pyx_skip_dispatch); + int (*ready)(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *, int __pyx_skip_dispatch); + PyObject *(*unlink)(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *, PyObject *, int __pyx_skip_dispatch); + PyObject *(*_check_and_notify)(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *); + PyObject *(*_notify_links)(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *, int __pyx_skip_dispatch); + PyObject *(*_wait_core)(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *, PyObject *, struct __pyx_opt_args_6gevent_19__abstract_linkable_16AbstractLinkable__wait_core *__pyx_optional_args); + PyObject *(*_wait_return_value)(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *, PyObject *, PyObject *); + PyObject *(*_wait)(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *, struct __pyx_opt_args_6gevent_19__abstract_linkable_16AbstractLinkable__wait *__pyx_optional_args); +}; +static struct __pyx_vtabstruct_6gevent_19__abstract_linkable_AbstractLinkable *__pyx_vtabptr_6gevent_19__abstract_linkable_AbstractLinkable; + + +/* "gevent/__semaphore.pxd":7 + * + * + * cdef class Semaphore(AbstractLinkable): # <<<<<<<<<<<<<< + * cdef public int counter + * + */ + +struct __pyx_vtabstruct_6gevent_11__semaphore_Semaphore { + struct __pyx_vtabstruct_6gevent_19__abstract_linkable_AbstractLinkable __pyx_base; + int (*locked)(struct __pyx_obj_6gevent_11__semaphore_Semaphore *, int __pyx_skip_dispatch); + int (*release)(struct __pyx_obj_6gevent_11__semaphore_Semaphore *, int __pyx_skip_dispatch); + PyObject *(*_start_notify)(struct __pyx_obj_6gevent_11__semaphore_Semaphore *, int __pyx_skip_dispatch); + int (*wait)(struct __pyx_obj_6gevent_11__semaphore_Semaphore *, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_11__semaphore_9Semaphore_wait *__pyx_optional_args); + int (*acquire)(struct __pyx_obj_6gevent_11__semaphore_Semaphore *, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_11__semaphore_9Semaphore_acquire *__pyx_optional_args); + PyObject *(*__pyx___enter__)(struct __pyx_obj_6gevent_11__semaphore_Semaphore *, int __pyx_skip_dispatch); + PyObject *(*__pyx___exit__)(struct __pyx_obj_6gevent_11__semaphore_Semaphore *, PyObject *, PyObject *, PyObject *, int __pyx_skip_dispatch); +}; +static struct __pyx_vtabstruct_6gevent_11__semaphore_Semaphore *__pyx_vtabptr_6gevent_11__semaphore_Semaphore; + + +/* "gevent/__semaphore.pxd":20 + * cpdef __exit__(self, object t, object v, object tb) + * + * cdef class BoundedSemaphore(Semaphore): # <<<<<<<<<<<<<< + * cdef readonly int _initial_value + * + */ + +struct __pyx_vtabstruct_6gevent_11__semaphore_BoundedSemaphore { + struct __pyx_vtabstruct_6gevent_11__semaphore_Semaphore __pyx_base; +}; +static struct __pyx_vtabstruct_6gevent_11__semaphore_BoundedSemaphore *__pyx_vtabptr_6gevent_11__semaphore_BoundedSemaphore; + + +/* "gevent/_event.pxd":13 + * cdef Timeout + * + * cdef class Event(AbstractLinkable): # <<<<<<<<<<<<<< + * cdef bint _flag + * + */ + +struct __pyx_vtabstruct_6gevent_6_event_Event { + struct __pyx_vtabstruct_6gevent_19__abstract_linkable_AbstractLinkable __pyx_base; +}; +static struct __pyx_vtabstruct_6gevent_6_event_Event *__pyx_vtabptr_6gevent_6_event_Event; + + +/* "gevent/_event.pxd":16 + * cdef bint _flag + * + * cdef class AsyncResult(AbstractLinkable): # <<<<<<<<<<<<<< + * cdef readonly _value + * cdef readonly tuple _exc_info + */ + +struct __pyx_vtabstruct_6gevent_6_event_AsyncResult { + struct __pyx_vtabstruct_6gevent_19__abstract_linkable_AbstractLinkable __pyx_base; + PyObject *(*get)(struct __pyx_obj_6gevent_6_event_AsyncResult *, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_6_event_11AsyncResult_get *__pyx_optional_args); + int (*successful)(struct __pyx_obj_6gevent_6_event_AsyncResult *, int __pyx_skip_dispatch); + PyObject *(*wait)(struct __pyx_obj_6gevent_6_event_AsyncResult *, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_6_event_11AsyncResult_wait *__pyx_optional_args); + int (*done)(struct __pyx_obj_6gevent_6_event_AsyncResult *, int __pyx_skip_dispatch); + int (*cancel)(struct __pyx_obj_6gevent_6_event_AsyncResult *, int __pyx_skip_dispatch); + int (*cancelled)(struct __pyx_obj_6gevent_6_event_AsyncResult *, int __pyx_skip_dispatch); +}; +static struct __pyx_vtabstruct_6gevent_6_event_AsyncResult *__pyx_vtabptr_6gevent_6_event_AsyncResult; + + +/* "gevent/_queue.pxd":14 + * @cython.final + * @cython.internal + * cdef class ItemWaiter(Waiter): # <<<<<<<<<<<<<< + * cdef readonly item + * cdef readonly queue + */ + +struct __pyx_vtabstruct_6gevent_6_queue_ItemWaiter { + struct __pyx_vtabstruct_6gevent_8__waiter_Waiter __pyx_base; +}; +static struct __pyx_vtabstruct_6gevent_6_queue_ItemWaiter *__pyx_vtabptr_6gevent_6_queue_ItemWaiter; + + +/* "gevent/_queue.pxd":18 + * cdef readonly queue + * + * cdef class Queue: # <<<<<<<<<<<<<< + * cdef __weakref__ + * cdef readonly hub + */ + +struct __pyx_vtabstruct_6gevent_6_queue_Queue { + PyObject *(*_get)(struct __pyx_obj_6gevent_6_queue_Queue *, int __pyx_skip_dispatch); + PyObject *(*_put)(struct __pyx_obj_6gevent_6_queue_Queue *, PyObject *, int __pyx_skip_dispatch); + PyObject *(*_peek)(struct __pyx_obj_6gevent_6_queue_Queue *, int __pyx_skip_dispatch); + Py_ssize_t (*qsize)(struct __pyx_obj_6gevent_6_queue_Queue *, int __pyx_skip_dispatch); + int (*empty)(struct __pyx_obj_6gevent_6_queue_Queue *, int __pyx_skip_dispatch); + int (*full)(struct __pyx_obj_6gevent_6_queue_Queue *, int __pyx_skip_dispatch); + PyObject *(*put)(struct __pyx_obj_6gevent_6_queue_Queue *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_6_queue_5Queue_put *__pyx_optional_args); + PyObject *(*put_nowait)(struct __pyx_obj_6gevent_6_queue_Queue *, PyObject *, int __pyx_skip_dispatch); + PyObject *(*__pyx___get_or_peek)(struct __pyx_obj_6gevent_6_queue_Queue *, PyObject *, PyObject *, PyObject *); + PyObject *(*get)(struct __pyx_obj_6gevent_6_queue_Queue *, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_6_queue_5Queue_get *__pyx_optional_args); + PyObject *(*get_nowait)(struct __pyx_obj_6gevent_6_queue_Queue *, int __pyx_skip_dispatch); + PyObject *(*peek)(struct __pyx_obj_6gevent_6_queue_Queue *, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_6_queue_5Queue_peek *__pyx_optional_args); + PyObject *(*peek_nowait)(struct __pyx_obj_6gevent_6_queue_Queue *, int __pyx_skip_dispatch); + PyObject *(*_schedule_unlock)(struct __pyx_obj_6gevent_6_queue_Queue *); +}; +static struct __pyx_vtabstruct_6gevent_6_queue_Queue *__pyx_vtabptr_6gevent_6_queue_Queue; + + +/* "gevent/_queue.pxd":50 + * + * @cython.final + * cdef class UnboundQueue(Queue): # <<<<<<<<<<<<<< + * pass + * + */ + +struct __pyx_vtabstruct_6gevent_6_queue_UnboundQueue { + struct __pyx_vtabstruct_6gevent_6_queue_Queue __pyx_base; +}; +static struct __pyx_vtabstruct_6gevent_6_queue_UnboundQueue *__pyx_vtabptr_6gevent_6_queue_UnboundQueue; + + +/* "gevent/_queue.pxd":53 + * pass + * + * cdef class PriorityQueue(Queue): # <<<<<<<<<<<<<< + * pass + * + */ + +struct __pyx_vtabstruct_6gevent_6_queue_PriorityQueue { + struct __pyx_vtabstruct_6gevent_6_queue_Queue __pyx_base; +}; +static struct __pyx_vtabstruct_6gevent_6_queue_PriorityQueue *__pyx_vtabptr_6gevent_6_queue_PriorityQueue; + + +/* "gevent/_queue.pxd":56 + * pass + * + * cdef class LifoQueue(Queue): # <<<<<<<<<<<<<< + * pass + * + */ + +struct __pyx_vtabstruct_6gevent_6_queue_LifoQueue { + struct __pyx_vtabstruct_6gevent_6_queue_Queue __pyx_base; +}; +static struct __pyx_vtabstruct_6gevent_6_queue_LifoQueue *__pyx_vtabptr_6gevent_6_queue_LifoQueue; + + +/* "gevent/_queue.pxd":59 + * pass + * + * cdef class JoinableQueue(Queue): # <<<<<<<<<<<<<< + * cdef Event _cond + * cdef readonly int unfinished_tasks + */ + +struct __pyx_vtabstruct_6gevent_6_queue_JoinableQueue { + struct __pyx_vtabstruct_6gevent_6_queue_Queue __pyx_base; +}; +static struct __pyx_vtabstruct_6gevent_6_queue_JoinableQueue *__pyx_vtabptr_6gevent_6_queue_JoinableQueue; + + +/* "gevent/_queue.pxd":64 + * + * + * cdef class Channel: # <<<<<<<<<<<<<< + * cdef __weakref__ + * cdef readonly getters + */ + +struct __pyx_vtabstruct_6gevent_6_queue_Channel { + PyObject *(*get)(struct __pyx_obj_6gevent_6_queue_Channel *, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_6_queue_7Channel_get *__pyx_optional_args); + PyObject *(*get_nowait)(struct __pyx_obj_6gevent_6_queue_Channel *, int __pyx_skip_dispatch); + PyObject *(*_schedule_unlock)(struct __pyx_obj_6gevent_6_queue_Channel *); +}; +static struct __pyx_vtabstruct_6gevent_6_queue_Channel *__pyx_vtabptr_6gevent_6_queue_Channel; + + +/* "src/gevent/_imap.py":43 + * raise failure.exc + * + * class IMapUnordered(Greenlet): # pylint:disable=undefined-variable # <<<<<<<<<<<<<< + * """ + * At iterator of map results. + */ + +struct __pyx_vtabstruct_6gevent_6__imap_IMapUnordered { + struct __pyx_vtabstruct_6gevent_9_greenlet_Greenlet __pyx_base; + PyObject *(*_inext)(struct __pyx_obj_6gevent_6__imap_IMapUnordered *); + PyObject *(*_ispawn)(struct __pyx_obj_6gevent_6__imap_IMapUnordered *, PyObject *, PyObject *, int); + PyObject *(*_on_result)(struct __pyx_obj_6gevent_6__imap_IMapUnordered *, PyObject *, int __pyx_skip_dispatch); + PyObject *(*_on_finish)(struct __pyx_obj_6gevent_6__imap_IMapUnordered *, PyObject *); + PyObject *(*_iqueue_value_for_success)(struct __pyx_obj_6gevent_6__imap_IMapUnordered *, PyObject *); + PyObject *(*_iqueue_value_for_failure)(struct __pyx_obj_6gevent_6__imap_IMapUnordered *, PyObject *); + PyObject *(*_iqueue_value_for_self_finished)(struct __pyx_obj_6gevent_6__imap_IMapUnordered *); + PyObject *(*_iqueue_value_for_self_failure)(struct __pyx_obj_6gevent_6__imap_IMapUnordered *, PyObject *); +}; +static struct __pyx_vtabstruct_6gevent_6__imap_IMapUnordered *__pyx_vtabptr_6gevent_6__imap_IMapUnordered; + + +/* "src/gevent/_imap.py":187 + * + * + * class IMap(IMapUnordered): # <<<<<<<<<<<<<< + * # A specialization of IMapUnordered that returns items + * # in the order in which they were generated, not + */ + +struct __pyx_vtabstruct_6gevent_6__imap_IMap { + struct __pyx_vtabstruct_6gevent_6__imap_IMapUnordered __pyx_base; +}; +static struct __pyx_vtabstruct_6gevent_6__imap_IMap *__pyx_vtabptr_6gevent_6__imap_IMap; + +/* --- Runtime support code (head) --- */ +/* Refnanny.proto */ +#ifndef CYTHON_REFNANNY + #define CYTHON_REFNANNY 0 +#endif +#if CYTHON_REFNANNY + typedef struct { + void (*INCREF)(void*, PyObject*, int); + void (*DECREF)(void*, PyObject*, int); + void (*GOTREF)(void*, PyObject*, int); + void (*GIVEREF)(void*, PyObject*, int); + void* (*SetupContext)(const char*, int, const char*); + void (*FinishContext)(void**); + } __Pyx_RefNannyAPIStruct; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); + #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; +#ifdef WITH_THREAD + #define __Pyx_RefNannySetupContext(name, acquire_gil)\ + if (acquire_gil) {\ + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ + PyGILState_Release(__pyx_gilstate_save);\ + } else {\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ + } +#else + #define __Pyx_RefNannySetupContext(name, acquire_gil)\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) +#endif + #define __Pyx_RefNannyFinishContext()\ + __Pyx_RefNanny->FinishContext(&__pyx_refnanny) + #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0) + #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) + #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) + #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) +#else + #define __Pyx_RefNannyDeclarations + #define __Pyx_RefNannySetupContext(name, acquire_gil) + #define __Pyx_RefNannyFinishContext() + #define __Pyx_INCREF(r) Py_INCREF(r) + #define __Pyx_DECREF(r) Py_DECREF(r) + #define __Pyx_GOTREF(r) + #define __Pyx_GIVEREF(r) + #define __Pyx_XINCREF(r) Py_XINCREF(r) + #define __Pyx_XDECREF(r) Py_XDECREF(r) + #define __Pyx_XGOTREF(r) + #define __Pyx_XGIVEREF(r) +#endif +#define __Pyx_XDECREF_SET(r, v) do {\ + PyObject *tmp = (PyObject *) r;\ + r = v; __Pyx_XDECREF(tmp);\ + } while (0) +#define __Pyx_DECREF_SET(r, v) do {\ + PyObject *tmp = (PyObject *) r;\ + r = v; __Pyx_DECREF(tmp);\ + } while (0) +#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) +#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) + +/* PyObjectGetAttrStr.proto */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); +#else +#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) +#endif + +/* GetBuiltinName.proto */ +static PyObject *__Pyx_GetBuiltinName(PyObject *name); + +/* RaiseDoubleKeywords.proto */ +static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); + +/* ParseKeywords.proto */ +static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\ + PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\ + const char* function_name); + +/* RaiseArgTupleInvalid.proto */ +static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, + Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); + +/* PyFunctionFastCall.proto */ +#if CYTHON_FAST_PYCALL +#define __Pyx_PyFunction_FastCall(func, args, nargs)\ + __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) +#if 1 || PY_VERSION_HEX < 0x030600B1 +static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs); +#else +#define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs) +#endif +#define __Pyx_BUILD_ASSERT_EXPR(cond)\ + (sizeof(char [1 - 2*!(cond)]) - 1) +#ifndef Py_MEMBER_SIZE +#define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member) +#endif + static size_t __pyx_pyframe_localsplus_offset = 0; + #include "frameobject.h" + #define __Pxy_PyFrame_Initialize_Offsets()\ + ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\ + (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus))) + #define __Pyx_PyFrame_GetLocalsplus(frame)\ + (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset)) +#endif + +/* PyObjectCall.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); +#else +#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) +#endif + +/* PyObjectCallMethO.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); +#endif + +/* PyObjectCallNoArg.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); +#else +#define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL) +#endif + +/* PyCFunctionFastCall.proto */ +#if CYTHON_FAST_PYCCALL +static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs); +#else +#define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL) +#endif + +/* PyObjectCallOneArg.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); + +/* PyThreadStateGet.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; +#define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; +#define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type +#else +#define __Pyx_PyThreadState_declare +#define __Pyx_PyThreadState_assign +#define __Pyx_PyErr_Occurred() PyErr_Occurred() +#endif + +/* PyErrFetchRestore.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) +#define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) +#define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) +#define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) +#define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); +static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) +#else +#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) +#endif +#else +#define __Pyx_PyErr_Clear() PyErr_Clear() +#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) +#define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) +#define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb) +#define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) +#endif + +/* RaiseException.proto */ +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); + +/* PyObjectCall2Args.proto */ +static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2); + +/* ExtTypeTest.proto */ +static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); + +/* PyObjectSetAttrStr.proto */ +#if CYTHON_USE_TYPE_SLOTS +#define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o, n, NULL) +static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value); +#else +#define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n) +#define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v) +#endif + +/* GetTopmostException.proto */ +#if CYTHON_USE_EXC_INFO_STACK +static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate); +#endif + +/* SaveResetException.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); +#else +#define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb) +#define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb) +#endif + +/* PyErrExceptionMatches.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) +static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); +#else +#define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) +#endif + +/* GetException.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb) +static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#else +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); +#endif + +/* SwapException.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#else +static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb); +#endif + +/* GetAttr.proto */ +static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *); + +/* KeywordStringCheck.proto */ +static int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* function_name, int kw_allowed); + +/* py_dict_pop.proto */ +static CYTHON_INLINE PyObject *__Pyx_PyDict_Pop(PyObject *d, PyObject *key, PyObject *default_value); + +/* UnpackUnboundCMethod.proto */ +typedef struct { + PyObject *type; + PyObject **method_name; + PyCFunction func; + PyObject *method; + int flag; +} __Pyx_CachedCFunction; + +/* CallUnboundCMethod2.proto */ +static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2); +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030600B1 +static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2); +#else +#define __Pyx_CallUnboundCMethod2(cfunc, self, arg1, arg2) __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2) +#endif + +/* CallUnboundCMethod1.proto */ +static PyObject* __Pyx__CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg); +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg); +#else +#define __Pyx_CallUnboundCMethod1(cfunc, self, arg) __Pyx__CallUnboundCMethod1(cfunc, self, arg) +#endif + +/* RaiseTooManyValuesToUnpack.proto */ +static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); + +/* RaiseNeedMoreValuesToUnpack.proto */ +static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); + +/* IterFinish.proto */ +static CYTHON_INLINE int __Pyx_IterFinish(void); + +/* UnpackItemEndCheck.proto */ +static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); + +/* None.proto */ +static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname); + +/* CallNextTpDealloc.proto */ +static void __Pyx_call_next_tp_dealloc(PyObject* obj, destructor current_tp_dealloc); + +/* CallNextTpTraverse.proto */ +static int __Pyx_call_next_tp_traverse(PyObject* obj, visitproc v, void *a, traverseproc current_tp_traverse); + +/* CallNextTpClear.proto */ +static void __Pyx_call_next_tp_clear(PyObject* obj, inquiry current_tp_dealloc); + +/* PyObject_GenericGetAttrNoDict.proto */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name); +#else +#define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr +#endif + +/* TypeImport.proto */ +#ifndef __PYX_HAVE_RT_ImportType_proto +#define __PYX_HAVE_RT_ImportType_proto +enum __Pyx_ImportType_CheckSize { + __Pyx_ImportType_CheckSize_Error = 0, + __Pyx_ImportType_CheckSize_Warn = 1, + __Pyx_ImportType_CheckSize_Ignore = 2 +}; +static PyTypeObject *__Pyx_ImportType(PyObject* module, const char *module_name, const char *class_name, size_t size, enum __Pyx_ImportType_CheckSize check_size); +#endif + +/* GetVTable.proto */ +static void* __Pyx_GetVtable(PyObject *dict); + +/* PyObject_GenericGetAttr.proto */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name); +#else +#define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr +#endif + +/* SetVTable.proto */ +static int __Pyx_SetVtable(PyObject *dict, void *vtable); + +/* Import.proto */ +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); + +/* ImportFrom.proto */ +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); + +/* GetModuleGlobalName.proto */ +#if CYTHON_USE_DICT_VERSIONS +#define __Pyx_GetModuleGlobalName(var, name) {\ + static PY_UINT64_T __pyx_dict_version = 0;\ + static PyObject *__pyx_dict_cached_value = NULL;\ + (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\ + (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\ + __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ +} +#define __Pyx_GetModuleGlobalNameUncached(var, name) {\ + PY_UINT64_T __pyx_dict_version;\ + PyObject *__pyx_dict_cached_value;\ + (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ +} +static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value); +#else +#define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name) +#define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name) +static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name); +#endif + +/* GetNameInClass.proto */ +#define __Pyx_GetNameInClass(var, nmspace, name) (var) = __Pyx__GetNameInClass(nmspace, name) +static PyObject *__Pyx__GetNameInClass(PyObject *nmspace, PyObject *name); + +/* FetchCommonType.proto */ +static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); + +/* CythonFunction.proto */ +#define __Pyx_CyFunction_USED 1 +#define __Pyx_CYFUNCTION_STATICMETHOD 0x01 +#define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 +#define __Pyx_CYFUNCTION_CCLASS 0x04 +#define __Pyx_CyFunction_GetClosure(f)\ + (((__pyx_CyFunctionObject *) (f))->func_closure) +#define __Pyx_CyFunction_GetClassObj(f)\ + (((__pyx_CyFunctionObject *) (f))->func_classobj) +#define __Pyx_CyFunction_Defaults(type, f)\ + ((type *)(((__pyx_CyFunctionObject *) (f))->defaults)) +#define __Pyx_CyFunction_SetDefaultsGetter(f, g)\ + ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g) +typedef struct { + PyCFunctionObject func; +#if PY_VERSION_HEX < 0x030500A0 + PyObject *func_weakreflist; +#endif + PyObject *func_dict; + PyObject *func_name; + PyObject *func_qualname; + PyObject *func_doc; + PyObject *func_globals; + PyObject *func_code; + PyObject *func_closure; + PyObject *func_classobj; + void *defaults; + int defaults_pyobjects; + int flags; + PyObject *defaults_tuple; + PyObject *defaults_kwdict; + PyObject *(*defaults_getter)(PyObject *); + PyObject *func_annotations; +} __pyx_CyFunctionObject; +static PyTypeObject *__pyx_CyFunctionType = 0; +#define __Pyx_CyFunction_Check(obj) (__Pyx_TypeCheck(obj, __pyx_CyFunctionType)) +#define __Pyx_CyFunction_NewEx(ml, flags, qualname, self, module, globals, code)\ + __Pyx_CyFunction_New(__pyx_CyFunctionType, ml, flags, qualname, self, module, globals, code) +static PyObject *__Pyx_CyFunction_New(PyTypeObject *, PyMethodDef *ml, + int flags, PyObject* qualname, + PyObject *self, + PyObject *module, PyObject *globals, + PyObject* code); +static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, + size_t size, + int pyobjects); +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, + PyObject *tuple); +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, + PyObject *dict); +static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m, + PyObject *dict); +static int __pyx_CyFunction_init(void); + +/* Globals.proto */ +static PyObject* __Pyx_Globals(void); + +/* CLineInTraceback.proto */ +#ifdef CYTHON_CLINE_IN_TRACEBACK +#define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) +#else +static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line); +#endif + +/* CodeObjectCache.proto */ +typedef struct { + PyCodeObject* code_object; + int code_line; +} __Pyx_CodeObjectCacheEntry; +struct __Pyx_CodeObjectCache { + int count; + int max_count; + __Pyx_CodeObjectCacheEntry* entries; +}; +static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); +static PyCodeObject *__pyx_find_code_object(int code_line); +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); + +/* AddTraceback.proto */ +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename); + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); + +/* CIntFromPy.proto */ +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); + +/* CIntFromPy.proto */ +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); + +/* FastTypeChecks.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) +static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b); +static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type); +static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2); +#else +#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) +#define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) +#define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) +#endif +#define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) + +/* CheckBinaryVersion.proto */ +static int __Pyx_check_binary_version(void); + +/* FunctionExport.proto */ +static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig); + +/* VoidPtrImport.proto */ +static int __Pyx_ImportVoidPtr(PyObject *module, const char *name, void **p, const char *sig); + +/* FunctionImport.proto */ +static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig); + +/* InitStrings.proto */ +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); + +static PyObject *__pyx_f_6gevent_6__imap_13IMapUnordered__inext(struct __pyx_obj_6gevent_6__imap_IMapUnordered *__pyx_v_self); /* proto*/ +static PyObject *__pyx_f_6gevent_6__imap_13IMapUnordered__ispawn(struct __pyx_obj_6gevent_6__imap_IMapUnordered *__pyx_v_self, PyObject *__pyx_v_func, PyObject *__pyx_v_item, int __pyx_v_item_index); /* proto*/ +static PyObject *__pyx_f_6gevent_6__imap_13IMapUnordered__on_result(struct __pyx_obj_6gevent_6__imap_IMapUnordered *__pyx_v_self, PyObject *__pyx_v_greenlet, int __pyx_skip_dispatch); /* proto*/ +static PyObject *__pyx_f_6gevent_6__imap_13IMapUnordered__on_finish(struct __pyx_obj_6gevent_6__imap_IMapUnordered *__pyx_v_self, PyObject *__pyx_v_exception); /* proto*/ +static PyObject *__pyx_f_6gevent_6__imap_13IMapUnordered__iqueue_value_for_success(CYTHON_UNUSED struct __pyx_obj_6gevent_6__imap_IMapUnordered *__pyx_v_self, PyObject *__pyx_v_greenlet); /* proto*/ +static PyObject *__pyx_f_6gevent_6__imap_13IMapUnordered__iqueue_value_for_failure(CYTHON_UNUSED struct __pyx_obj_6gevent_6__imap_IMapUnordered *__pyx_v_self, PyObject *__pyx_v_greenlet); /* proto*/ +static PyObject *__pyx_f_6gevent_6__imap_13IMapUnordered__iqueue_value_for_self_finished(CYTHON_UNUSED struct __pyx_obj_6gevent_6__imap_IMapUnordered *__pyx_v_self); /* proto*/ +static PyObject *__pyx_f_6gevent_6__imap_13IMapUnordered__iqueue_value_for_self_failure(struct __pyx_obj_6gevent_6__imap_IMapUnordered *__pyx_v_self, PyObject *__pyx_v_exception); /* proto*/ +static PyObject *__pyx_f_6gevent_6__imap_4IMap__inext(struct __pyx_obj_6gevent_6__imap_IMap *__pyx_v_self); /* proto*/ +static PyObject *__pyx_f_6gevent_6__imap_4IMap__iqueue_value_for_success(struct __pyx_obj_6gevent_6__imap_IMap *__pyx_v_self, PyObject *__pyx_v_greenlet); /* proto*/ +static PyObject *__pyx_f_6gevent_6__imap_4IMap__iqueue_value_for_failure(struct __pyx_obj_6gevent_6__imap_IMap *__pyx_v_self, PyObject *__pyx_v_greenlet); /* proto*/ +static PyObject *__pyx_f_6gevent_6__imap_4IMap__iqueue_value_for_self_finished(struct __pyx_obj_6gevent_6__imap_IMap *__pyx_v_self); /* proto*/ +static PyObject *__pyx_f_6gevent_6__imap_4IMap__iqueue_value_for_self_failure(struct __pyx_obj_6gevent_6__imap_IMap *__pyx_v_self, PyObject *__pyx_v_exception); /* proto*/ + +/* Module declarations from 'cython' */ + +/* Module declarations from 'weakref' */ + +/* Module declarations from 'gevent.__ident' */ +static PyTypeObject *__pyx_ptype_6gevent_7__ident_ref = 0; +static PyTypeObject *__pyx_ptype_6gevent_7__ident_ValuedWeakRef = 0; +static PyTypeObject *__pyx_ptype_6gevent_7__ident_IdentRegistry = 0; +static PyObject **__pyx_vp_6gevent_7__ident_heappop = 0; +#define __pyx_v_6gevent_7__ident_heappop (*__pyx_vp_6gevent_7__ident_heappop) +static PyObject **__pyx_vp_6gevent_7__ident_heappush = 0; +#define __pyx_v_6gevent_7__ident_heappush (*__pyx_vp_6gevent_7__ident_heappush) +static PyObject **__pyx_vp_6gevent_7__ident_WeakKeyDictionary = 0; +#define __pyx_v_6gevent_7__ident_WeakKeyDictionary (*__pyx_vp_6gevent_7__ident_WeakKeyDictionary) + +/* Module declarations from 'greenlet' */ + +/* Module declarations from 'gevent.__greenlet_primitives' */ +static PyTypeObject *__pyx_ptype_6gevent_21__greenlet_primitives_greenlet = 0; +static PyTypeObject *__pyx_ptype_6gevent_21__greenlet_primitives_TrackedRawGreenlet = 0; +static PyTypeObject *__pyx_ptype_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop = 0; +static PyObject **__pyx_vp_6gevent_21__greenlet_primitives_get_objects = 0; +#define __pyx_v_6gevent_21__greenlet_primitives_get_objects (*__pyx_vp_6gevent_21__greenlet_primitives_get_objects) +static PyObject **__pyx_vp_6gevent_21__greenlet_primitives_wref = 0; +#define __pyx_v_6gevent_21__greenlet_primitives_wref (*__pyx_vp_6gevent_21__greenlet_primitives_wref) +static PyObject **__pyx_vp_6gevent_21__greenlet_primitives_BlockingSwitchOutError = 0; +#define __pyx_v_6gevent_21__greenlet_primitives_BlockingSwitchOutError (*__pyx_vp_6gevent_21__greenlet_primitives_BlockingSwitchOutError) +static int *__pyx_vp_6gevent_21__greenlet_primitives__greenlet_imported = 0; +#define __pyx_v_6gevent_21__greenlet_primitives__greenlet_imported (*__pyx_vp_6gevent_21__greenlet_primitives__greenlet_imported) + +/* Module declarations from 'gevent.__hub_local' */ +static PyObject **__pyx_vp_6gevent_11__hub_local__threadlocal = 0; +#define __pyx_v_6gevent_11__hub_local__threadlocal (*__pyx_vp_6gevent_11__hub_local__threadlocal) +static struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *(*__pyx_f_6gevent_11__hub_local_get_hub_noargs)(int __pyx_skip_dispatch); /*proto*/ + +/* Module declarations from 'gevent.__waiter' */ +static PyTypeObject *__pyx_ptype_6gevent_8__waiter_greenlet = 0; +static PyTypeObject *__pyx_ptype_6gevent_8__waiter_Waiter = 0; +static PyTypeObject *__pyx_ptype_6gevent_8__waiter_MultipleWaiter = 0; +static PyObject **__pyx_vp_6gevent_8__waiter_sys = 0; +#define __pyx_v_6gevent_8__waiter_sys (*__pyx_vp_6gevent_8__waiter_sys) +static PyObject **__pyx_vp_6gevent_8__waiter_ConcurrentObjectUseError = 0; +#define __pyx_v_6gevent_8__waiter_ConcurrentObjectUseError (*__pyx_vp_6gevent_8__waiter_ConcurrentObjectUseError) +static int *__pyx_vp_6gevent_8__waiter__greenlet_imported = 0; +#define __pyx_v_6gevent_8__waiter__greenlet_imported (*__pyx_vp_6gevent_8__waiter__greenlet_imported) +static PyObject **__pyx_vp_6gevent_8__waiter__NONE = 0; +#define __pyx_v_6gevent_8__waiter__NONE (*__pyx_vp_6gevent_8__waiter__NONE) + +/* Module declarations from 'types' */ + +/* Module declarations from 'gevent._greenlet' */ +static PyTypeObject *__pyx_ptype_6gevent_9_greenlet_greenlet = 0; +static PyTypeObject *__pyx_ptype_6gevent_9_greenlet_CodeType = 0; +static PyTypeObject *__pyx_ptype_6gevent_9_greenlet_FrameType = 0; +static PyTypeObject *__pyx_ptype_6gevent_9_greenlet_SpawnedLink = 0; +static PyTypeObject *__pyx_ptype_6gevent_9_greenlet_SuccessSpawnedLink = 0; +static PyTypeObject *__pyx_ptype_6gevent_9_greenlet_FailureSpawnedLink = 0; +static PyTypeObject *__pyx_ptype_6gevent_9_greenlet__Frame = 0; +static PyTypeObject *__pyx_ptype_6gevent_9_greenlet_Greenlet = 0; +static PyTypeObject *__pyx_ptype_6gevent_9_greenlet__dummy_event = 0; +static int *__pyx_vp_6gevent_9_greenlet__PYPY = 0; +#define __pyx_v_6gevent_9_greenlet__PYPY (*__pyx_vp_6gevent_9_greenlet__PYPY) +static PyObject **__pyx_vp_6gevent_9_greenlet_sys_getframe = 0; +#define __pyx_v_6gevent_9_greenlet_sys_getframe (*__pyx_vp_6gevent_9_greenlet_sys_getframe) +static PyObject **__pyx_vp_6gevent_9_greenlet_sys_exc_info = 0; +#define __pyx_v_6gevent_9_greenlet_sys_exc_info (*__pyx_vp_6gevent_9_greenlet_sys_exc_info) +static PyObject **__pyx_vp_6gevent_9_greenlet_Timeout = 0; +#define __pyx_v_6gevent_9_greenlet_Timeout (*__pyx_vp_6gevent_9_greenlet_Timeout) +static PyObject **__pyx_vp_6gevent_9_greenlet_GreenletExit = 0; +#define __pyx_v_6gevent_9_greenlet_GreenletExit (*__pyx_vp_6gevent_9_greenlet_GreenletExit) +static PyObject **__pyx_vp_6gevent_9_greenlet_InvalidSwitchError = 0; +#define __pyx_v_6gevent_9_greenlet_InvalidSwitchError (*__pyx_vp_6gevent_9_greenlet_InvalidSwitchError) +static int *__pyx_vp_6gevent_9_greenlet__greenlet_imported = 0; +#define __pyx_v_6gevent_9_greenlet__greenlet_imported (*__pyx_vp_6gevent_9_greenlet__greenlet_imported) +static PyObject **__pyx_vp_6gevent_9_greenlet__greenlet__init__ = 0; +#define __pyx_v_6gevent_9_greenlet__greenlet__init__ (*__pyx_vp_6gevent_9_greenlet__greenlet__init__) +static PyObject **__pyx_vp_6gevent_9_greenlet__threadlocal = 0; +#define __pyx_v_6gevent_9_greenlet__threadlocal (*__pyx_vp_6gevent_9_greenlet__threadlocal) +static PyObject **__pyx_vp_6gevent_9_greenlet_get_hub_class = 0; +#define __pyx_v_6gevent_9_greenlet_get_hub_class (*__pyx_vp_6gevent_9_greenlet_get_hub_class) +static PyObject **__pyx_vp_6gevent_9_greenlet_wref = 0; +#define __pyx_v_6gevent_9_greenlet_wref (*__pyx_vp_6gevent_9_greenlet_wref) +static PyObject **__pyx_vp_6gevent_9_greenlet_dump_traceback = 0; +#define __pyx_v_6gevent_9_greenlet_dump_traceback (*__pyx_vp_6gevent_9_greenlet_dump_traceback) +static PyObject **__pyx_vp_6gevent_9_greenlet_load_traceback = 0; +#define __pyx_v_6gevent_9_greenlet_load_traceback (*__pyx_vp_6gevent_9_greenlet_load_traceback) +static PyObject **__pyx_vp_6gevent_9_greenlet_wait = 0; +#define __pyx_v_6gevent_9_greenlet_wait (*__pyx_vp_6gevent_9_greenlet_wait) +static PyObject **__pyx_vp_6gevent_9_greenlet_iwait = 0; +#define __pyx_v_6gevent_9_greenlet_iwait (*__pyx_vp_6gevent_9_greenlet_iwait) +static PyObject **__pyx_vp_6gevent_9_greenlet_reraise = 0; +#define __pyx_v_6gevent_9_greenlet_reraise (*__pyx_vp_6gevent_9_greenlet_reraise) +static PyObject **__pyx_vp_6gevent_9_greenlet_GEVENT_CONFIG = 0; +#define __pyx_v_6gevent_9_greenlet_GEVENT_CONFIG (*__pyx_vp_6gevent_9_greenlet_GEVENT_CONFIG) +static struct __pyx_obj_6gevent_9_greenlet__dummy_event **__pyx_vp_6gevent_9_greenlet__cancelled_start_event = 0; +#define __pyx_v_6gevent_9_greenlet__cancelled_start_event (*__pyx_vp_6gevent_9_greenlet__cancelled_start_event) +static struct __pyx_obj_6gevent_9_greenlet__dummy_event **__pyx_vp_6gevent_9_greenlet__start_completed_event = 0; +#define __pyx_v_6gevent_9_greenlet__start_completed_event (*__pyx_vp_6gevent_9_greenlet__start_completed_event) +static PyObject **__pyx_vp_6gevent_9_greenlet__spawn_callbacks = 0; +#define __pyx_v_6gevent_9_greenlet__spawn_callbacks (*__pyx_vp_6gevent_9_greenlet__spawn_callbacks) + +/* Module declarations from 'gevent.__abstract_linkable' */ +static PyTypeObject *__pyx_ptype_6gevent_19__abstract_linkable_greenlet = 0; +static PyTypeObject *__pyx_ptype_6gevent_19__abstract_linkable_AbstractLinkable = 0; +static PyObject **__pyx_vp_6gevent_19__abstract_linkable_InvalidSwitchError = 0; +#define __pyx_v_6gevent_19__abstract_linkable_InvalidSwitchError (*__pyx_vp_6gevent_19__abstract_linkable_InvalidSwitchError) +static PyObject **__pyx_vp_6gevent_19__abstract_linkable_Timeout = 0; +#define __pyx_v_6gevent_19__abstract_linkable_Timeout (*__pyx_vp_6gevent_19__abstract_linkable_Timeout) +static int *__pyx_vp_6gevent_19__abstract_linkable__greenlet_imported = 0; +#define __pyx_v_6gevent_19__abstract_linkable__greenlet_imported (*__pyx_vp_6gevent_19__abstract_linkable__greenlet_imported) + +/* Module declarations from 'gevent.__semaphore' */ +static PyTypeObject *__pyx_ptype_6gevent_11__semaphore_Semaphore = 0; +static PyTypeObject *__pyx_ptype_6gevent_11__semaphore_BoundedSemaphore = 0; +static PyObject **__pyx_vp_6gevent_11__semaphore_Timeout = 0; +#define __pyx_v_6gevent_11__semaphore_Timeout (*__pyx_vp_6gevent_11__semaphore_Timeout) + +/* Module declarations from 'gevent._event' */ +static PyTypeObject *__pyx_ptype_6gevent_6_event_Event = 0; +static PyTypeObject *__pyx_ptype_6gevent_6_event_AsyncResult = 0; +static PyObject **__pyx_vp_6gevent_6_event__None = 0; +#define __pyx_v_6gevent_6_event__None (*__pyx_vp_6gevent_6_event__None) +static PyObject **__pyx_vp_6gevent_6_event_reraise = 0; +#define __pyx_v_6gevent_6_event_reraise (*__pyx_vp_6gevent_6_event_reraise) +static PyObject **__pyx_vp_6gevent_6_event_dump_traceback = 0; +#define __pyx_v_6gevent_6_event_dump_traceback (*__pyx_vp_6gevent_6_event_dump_traceback) +static PyObject **__pyx_vp_6gevent_6_event_load_traceback = 0; +#define __pyx_v_6gevent_6_event_load_traceback (*__pyx_vp_6gevent_6_event_load_traceback) +static PyObject **__pyx_vp_6gevent_6_event_Timeout = 0; +#define __pyx_v_6gevent_6_event_Timeout (*__pyx_vp_6gevent_6_event_Timeout) + +/* Module declarations from 'gevent._queue' */ +static PyTypeObject *__pyx_ptype_6gevent_6_queue_ItemWaiter = 0; +static PyTypeObject *__pyx_ptype_6gevent_6_queue_Queue = 0; +static PyTypeObject *__pyx_ptype_6gevent_6_queue_UnboundQueue = 0; +static PyTypeObject *__pyx_ptype_6gevent_6_queue_PriorityQueue = 0; +static PyTypeObject *__pyx_ptype_6gevent_6_queue_LifoQueue = 0; +static PyTypeObject *__pyx_ptype_6gevent_6_queue_JoinableQueue = 0; +static PyTypeObject *__pyx_ptype_6gevent_6_queue_Channel = 0; +static PyObject **__pyx_vp_6gevent_6_queue__heappush = 0; +#define __pyx_v_6gevent_6_queue__heappush (*__pyx_vp_6gevent_6_queue__heappush) +static PyObject **__pyx_vp_6gevent_6_queue__heappop = 0; +#define __pyx_v_6gevent_6_queue__heappop (*__pyx_vp_6gevent_6_queue__heappop) +static PyObject **__pyx_vp_6gevent_6_queue__heapify = 0; +#define __pyx_v_6gevent_6_queue__heapify (*__pyx_vp_6gevent_6_queue__heapify) + +/* Module declarations from 'gevent.__imap' */ +static PyTypeObject *__pyx_ptype_6gevent_6__imap_Failure = 0; +static PyTypeObject *__pyx_ptype_6gevent_6__imap_IMapUnordered = 0; +static PyTypeObject *__pyx_ptype_6gevent_6__imap_IMap = 0; +static CYTHON_INLINE PyObject *__pyx_f_6gevent_6__imap__raise_exc(struct __pyx_obj_6gevent_6__imap_Failure *); /*proto*/ +#define __Pyx_MODULE_NAME "gevent.__imap" +extern int __pyx_module_is_main_gevent____imap; +int __pyx_module_is_main_gevent____imap = 0; + +/* Implementation of 'gevent.__imap' */ +static PyObject *__pyx_builtin___import__; +static PyObject *__pyx_builtin_BaseException; +static PyObject *__pyx_builtin_StopIteration; +static PyObject *__pyx_builtin_KeyError; +static const char __pyx_k_e[] = "e"; +static const char __pyx_k_all[] = "__all__"; +static const char __pyx_k_exc[] = "exc"; +static const char __pyx_k_pop[] = "pop"; +static const char __pyx_k_run[] = "_run"; +static const char __pyx_k_IMap[] = "IMap"; +static const char __pyx_k_func[] = "func"; +static const char __pyx_k_init[] = "__init__"; +static const char __pyx_k_item[] = "item"; +static const char __pyx_k_main[] = "__main__"; +static const char __pyx_k_name[] = "__name__"; +static const char __pyx_k_next[] = "__next__"; +static const char __pyx_k_self[] = "self"; +static const char __pyx_k_test[] = "__test__"; +static const char __pyx_k_queue[] = "queue"; +static const char __pyx_k_slots[] = "__slots__"; +static const char __pyx_k_spawn[] = "spawn"; +static const char __pyx_k_value[] = "value"; +static const char __pyx_k_gevent[] = "gevent"; +static const char __pyx_k_import[] = "__import__"; +static const char __pyx_k_next_2[] = "next"; +static const char __pyx_k_zipped[] = "_zipped"; +static const char __pyx_k_Failure[] = "Failure"; +static const char __pyx_k_maxsize[] = "maxsize"; +static const char __pyx_k_rawlink[] = "rawlink"; +static const char __pyx_k_Greenlet[] = "Greenlet"; +static const char __pyx_k_KeyError[] = "KeyError"; +static const char __pyx_k_greenlet[] = "greenlet"; +static const char __pyx_k_iterable[] = "iterable"; +static const char __pyx_k_Semaphore[] = "Semaphore"; +static const char __pyx_k_exception[] = "exception"; +static const char __pyx_k_on_result[] = "_on_result"; +static const char __pyx_k_semaphore[] = "_semaphore"; +static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__"; +static const char __pyx_k_successful[] = "successful"; +static const char __pyx_k_UnboundQueue[] = "UnboundQueue"; +static const char __pyx_k_gevent__util[] = "gevent._util"; +static const char __pyx_k_BaseException[] = "BaseException"; +static const char __pyx_k_IMapUnordered[] = "IMapUnordered"; +static const char __pyx_k_StopIteration[] = "StopIteration"; +static const char __pyx_k_gevent___imap[] = "gevent.__imap"; +static const char __pyx_k_import_c_accel[] = "import_c_accel"; +static const char __pyx_k_imap_task_index[] = "_imap_task_index"; +static const char __pyx_k_raise_exception[] = "raise_exception"; +static const char __pyx_k_raise_exception_2[] = "_raise_exception"; +static const char __pyx_k_IMapUnordered__run[] = "IMapUnordered._run"; +static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; +static const char __pyx_k_src_gevent__imap_py[] = "src\\gevent\\_imap.py"; +static const char __pyx_k_IMapUnordered__on_result[] = "IMapUnordered._on_result"; +static const char __pyx_k_Iterators_across_greenlets_or_A[] = "\nIterators across greenlets or AsyncResult objects.\n\n"; +static PyObject *__pyx_n_s_BaseException; +static PyObject *__pyx_n_s_Failure; +static PyObject *__pyx_n_s_Greenlet; +static PyObject *__pyx_n_s_IMap; +static PyObject *__pyx_n_s_IMapUnordered; +static PyObject *__pyx_n_s_IMapUnordered__on_result; +static PyObject *__pyx_n_s_IMapUnordered__run; +static PyObject *__pyx_n_s_KeyError; +static PyObject *__pyx_n_s_Semaphore; +static PyObject *__pyx_n_s_StopIteration; +static PyObject *__pyx_n_s_UnboundQueue; +static PyObject *__pyx_n_s_all; +static PyObject *__pyx_n_s_cline_in_traceback; +static PyObject *__pyx_n_s_e; +static PyObject *__pyx_n_s_exc; +static PyObject *__pyx_n_s_exception; +static PyObject *__pyx_n_s_func; +static PyObject *__pyx_n_s_gevent; +static PyObject *__pyx_n_s_gevent___imap; +static PyObject *__pyx_n_s_gevent__util; +static PyObject *__pyx_n_s_greenlet; +static PyObject *__pyx_n_s_imap_task_index; +static PyObject *__pyx_n_s_import; +static PyObject *__pyx_n_s_import_c_accel; +static PyObject *__pyx_n_s_init; +static PyObject *__pyx_n_s_item; +static PyObject *__pyx_n_s_iterable; +static PyObject *__pyx_n_s_main; +static PyObject *__pyx_n_s_maxsize; +static PyObject *__pyx_n_s_name; +static PyObject *__pyx_n_s_next; +static PyObject *__pyx_n_s_next_2; +static PyObject *__pyx_n_s_on_result; +static PyObject *__pyx_n_s_pop; +static PyObject *__pyx_n_s_pyx_vtable; +static PyObject *__pyx_n_s_queue; +static PyObject *__pyx_n_s_raise_exception; +static PyObject *__pyx_n_s_raise_exception_2; +static PyObject *__pyx_n_s_rawlink; +static PyObject *__pyx_n_s_run; +static PyObject *__pyx_n_s_self; +static PyObject *__pyx_n_s_semaphore; +static PyObject *__pyx_n_s_slots; +static PyObject *__pyx_n_s_spawn; +static PyObject *__pyx_kp_s_src_gevent__imap_py; +static PyObject *__pyx_n_s_successful; +static PyObject *__pyx_n_s_test; +static PyObject *__pyx_n_s_value; +static PyObject *__pyx_n_s_zipped; +static int __pyx_pf_6gevent_6__imap_7Failure___init__(struct __pyx_obj_6gevent_6__imap_Failure *__pyx_v_self, PyObject *__pyx_v_exc, PyObject *__pyx_v_raise_exception); /* proto */ +static PyObject *__pyx_pf_6gevent_6__imap_7Failure_3exc___get__(struct __pyx_obj_6gevent_6__imap_Failure *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_6__imap_13IMapUnordered___init__(struct __pyx_obj_6gevent_6__imap_IMapUnordered *__pyx_v_self, PyObject *__pyx_v_func, PyObject *__pyx_v_iterable, PyObject *__pyx_v_spawn, PyObject *__pyx_v_maxsize, PyObject *__pyx_v__zipped); /* proto */ +static PyObject *__pyx_pf_6gevent_6__imap_13IMapUnordered_2__iter__(struct __pyx_obj_6gevent_6__imap_IMapUnordered *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_6__imap_13IMapUnordered_4__next__(struct __pyx_obj_6gevent_6__imap_IMapUnordered *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_6__imap_13IMapUnordered_6_run(struct __pyx_obj_6gevent_6__imap_IMapUnordered *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_6__imap_13IMapUnordered_8_on_result(struct __pyx_obj_6gevent_6__imap_IMapUnordered *__pyx_v_self, PyObject *__pyx_v_greenlet); /* proto */ +static PyObject *__pyx_pf_6gevent_6__imap_13IMapUnordered_5queue___get__(struct __pyx_obj_6gevent_6__imap_IMapUnordered *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_6__imap_13IMapUnordered_8finished___get__(struct __pyx_obj_6gevent_6__imap_IMapUnordered *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_6__imap_4IMap___init__(struct __pyx_obj_6gevent_6__imap_IMap *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */ +static PyObject *__pyx_tp_new_6gevent_6__imap_Failure(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6gevent_6__imap_IMapUnordered(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6gevent_6__imap_IMap(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_pop = {0, &__pyx_n_s_pop, 0, 0, 0}; +static PyObject *__pyx_tuple_; +static PyObject *__pyx_tuple__2; +static PyObject *__pyx_tuple__3; +static PyObject *__pyx_tuple__5; +static PyObject *__pyx_codeobj__4; +static PyObject *__pyx_codeobj__6; +/* Late includes */ + +/* "src/gevent/_imap.py":31 + * __slots__ = ('exc', 'raise_exception') + * + * def __init__(self, exc, raise_exception=None): # <<<<<<<<<<<<<< + * self.exc = exc + * self.raise_exception = raise_exception + */ + +/* Python wrapper */ +static int __pyx_pw_6gevent_6__imap_7Failure_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6gevent_6__imap_7Failure_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_exc = 0; + PyObject *__pyx_v_raise_exception = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_exc,&__pyx_n_s_raise_exception,0}; + PyObject* values[2] = {0,0}; + values[1] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_exc)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_raise_exception); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 31, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_exc = values[0]; + __pyx_v_raise_exception = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 31, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.__imap.Failure.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_6__imap_7Failure___init__(((struct __pyx_obj_6gevent_6__imap_Failure *)__pyx_v_self), __pyx_v_exc, __pyx_v_raise_exception); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_6__imap_7Failure___init__(struct __pyx_obj_6gevent_6__imap_Failure *__pyx_v_self, PyObject *__pyx_v_exc, PyObject *__pyx_v_raise_exception) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__", 0); + + /* "src/gevent/_imap.py":32 + * + * def __init__(self, exc, raise_exception=None): + * self.exc = exc # <<<<<<<<<<<<<< + * self.raise_exception = raise_exception + * + */ + __Pyx_INCREF(__pyx_v_exc); + __Pyx_GIVEREF(__pyx_v_exc); + __Pyx_GOTREF(__pyx_v_self->exc); + __Pyx_DECREF(__pyx_v_self->exc); + __pyx_v_self->exc = __pyx_v_exc; + + /* "src/gevent/_imap.py":33 + * def __init__(self, exc, raise_exception=None): + * self.exc = exc + * self.raise_exception = raise_exception # <<<<<<<<<<<<<< + * + * + */ + __Pyx_INCREF(__pyx_v_raise_exception); + __Pyx_GIVEREF(__pyx_v_raise_exception); + __Pyx_GOTREF(__pyx_v_self->raise_exception); + __Pyx_DECREF(__pyx_v_self->raise_exception); + __pyx_v_self->raise_exception = __pyx_v_raise_exception; + + /* "src/gevent/_imap.py":31 + * __slots__ = ('exc', 'raise_exception') + * + * def __init__(self, exc, raise_exception=None): # <<<<<<<<<<<<<< + * self.exc = exc + * self.raise_exception = raise_exception + */ + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/__imap.pxd":10 + * @cython.final + * cdef class Failure: + * cdef readonly exc # <<<<<<<<<<<<<< + * cdef raise_exception + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6__imap_7Failure_3exc_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_6__imap_7Failure_3exc_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6__imap_7Failure_3exc___get__(((struct __pyx_obj_6gevent_6__imap_Failure *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6__imap_7Failure_3exc___get__(struct __pyx_obj_6gevent_6__imap_Failure *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->exc); + __pyx_r = __pyx_v_self->exc; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_imap.py":36 + * + * + * def _raise_exc(failure): # <<<<<<<<<<<<<< + * # For cython. + * if failure.raise_exception: + */ + +static CYTHON_INLINE PyObject *__pyx_f_6gevent_6__imap__raise_exc(struct __pyx_obj_6gevent_6__imap_Failure *__pyx_v_failure) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + __Pyx_RefNannySetupContext("_raise_exc", 0); + + /* "src/gevent/_imap.py":38 + * def _raise_exc(failure): + * # For cython. + * if failure.raise_exception: # <<<<<<<<<<<<<< + * failure.raise_exception() + * else: + */ + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_failure->raise_exception); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 38, __pyx_L1_error) + if (likely(__pyx_t_1)) { + + /* "src/gevent/_imap.py":39 + * # For cython. + * if failure.raise_exception: + * failure.raise_exception() # <<<<<<<<<<<<<< + * else: + * raise failure.exc + */ + __Pyx_INCREF(__pyx_v_failure->raise_exception); + __pyx_t_3 = __pyx_v_failure->raise_exception; __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 39, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/_imap.py":38 + * def _raise_exc(failure): + * # For cython. + * if failure.raise_exception: # <<<<<<<<<<<<<< + * failure.raise_exception() + * else: + */ + goto __pyx_L3; + } + + /* "src/gevent/_imap.py":41 + * failure.raise_exception() + * else: + * raise failure.exc # <<<<<<<<<<<<<< + * + * class IMapUnordered(Greenlet): # pylint:disable=undefined-variable + */ + /*else*/ { + __Pyx_Raise(__pyx_v_failure->exc, 0, 0, 0); + __PYX_ERR(0, 41, __pyx_L1_error) + } + __pyx_L3:; + + /* "src/gevent/_imap.py":36 + * + * + * def _raise_exc(failure): # <<<<<<<<<<<<<< + * # For cython. + * if failure.raise_exception: + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("gevent.__imap._raise_exc", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_imap.py":48 + * """ + * + * def __init__(self, func, iterable, spawn, maxsize=None, _zipped=False): # <<<<<<<<<<<<<< + * """ + * An iterator that. + */ + +/* Python wrapper */ +static int __pyx_pw_6gevent_6__imap_13IMapUnordered_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6gevent_6__imap_13IMapUnordered___init__[] = "\n An iterator that.\n\n :param callable spawn: The function we use to create new greenlets.\n :keyword int maxsize: If given and not-None, specifies the maximum number of\n finished results that will be allowed to accumulated awaiting the reader;\n more than that number of results will cause map function greenlets to begin\n to block. This is most useful is there is a great disparity in the speed of\n the mapping code and the consumer and the results consume a great deal of resources.\n Using a bound is more computationally expensive than not using a bound.\n\n .. versionchanged:: 1.1b3\n Added the *maxsize* parameter.\n "; +#if CYTHON_COMPILING_IN_CPYTHON +struct wrapperbase __pyx_wrapperbase_6gevent_6__imap_13IMapUnordered___init__; +#endif +static int __pyx_pw_6gevent_6__imap_13IMapUnordered_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_func = 0; + PyObject *__pyx_v_iterable = 0; + PyObject *__pyx_v_spawn = 0; + PyObject *__pyx_v_maxsize = 0; + PyObject *__pyx_v__zipped = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_func,&__pyx_n_s_iterable,&__pyx_n_s_spawn,&__pyx_n_s_maxsize,&__pyx_n_s_zipped,0}; + PyObject* values[5] = {0,0,0,0,0}; + values[3] = ((PyObject *)Py_None); + values[4] = ((PyObject *)Py_False); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + CYTHON_FALLTHROUGH; + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_func)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_iterable)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 5, 1); __PYX_ERR(0, 48, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_spawn)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 5, 2); __PYX_ERR(0, 48, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 3: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_maxsize); + if (value) { values[3] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 4: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_zipped); + if (value) { values[4] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 48, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + CYTHON_FALLTHROUGH; + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_func = values[0]; + __pyx_v_iterable = values[1]; + __pyx_v_spawn = values[2]; + __pyx_v_maxsize = values[3]; + __pyx_v__zipped = values[4]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 48, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.__imap.IMapUnordered.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_6__imap_13IMapUnordered___init__(((struct __pyx_obj_6gevent_6__imap_IMapUnordered *)__pyx_v_self), __pyx_v_func, __pyx_v_iterable, __pyx_v_spawn, __pyx_v_maxsize, __pyx_v__zipped); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_6__imap_13IMapUnordered___init__(struct __pyx_obj_6gevent_6__imap_IMapUnordered *__pyx_v_self, PyObject *__pyx_v_func, PyObject *__pyx_v_iterable, PyObject *__pyx_v_spawn, PyObject *__pyx_v_maxsize, PyObject *__pyx_v__zipped) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "src/gevent/_imap.py":63 + * Added the *maxsize* parameter. + * """ + * Greenlet.__init__(self) # pylint:disable=undefined-variable # <<<<<<<<<<<<<< + * self.spawn = spawn + * self._zipped = _zipped + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet), __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 63, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, ((PyObject *)__pyx_v_self)) : __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_v_self)); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 63, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_imap.py":64 + * """ + * Greenlet.__init__(self) # pylint:disable=undefined-variable + * self.spawn = spawn # <<<<<<<<<<<<<< + * self._zipped = _zipped + * self.func = func + */ + __Pyx_INCREF(__pyx_v_spawn); + __Pyx_GIVEREF(__pyx_v_spawn); + __Pyx_GOTREF(__pyx_v_self->spawn); + __Pyx_DECREF(__pyx_v_self->spawn); + __pyx_v_self->spawn = __pyx_v_spawn; + + /* "src/gevent/_imap.py":65 + * Greenlet.__init__(self) # pylint:disable=undefined-variable + * self.spawn = spawn + * self._zipped = _zipped # <<<<<<<<<<<<<< + * self.func = func + * self.iterable = iterable + */ + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v__zipped); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 65, __pyx_L1_error) + __pyx_v_self->_zipped = __pyx_t_4; + + /* "src/gevent/_imap.py":66 + * self.spawn = spawn + * self._zipped = _zipped + * self.func = func # <<<<<<<<<<<<<< + * self.iterable = iterable + * self.queue = UnboundQueue() # pylint:disable=undefined-variable + */ + __Pyx_INCREF(__pyx_v_func); + __Pyx_GIVEREF(__pyx_v_func); + __Pyx_GOTREF(__pyx_v_self->func); + __Pyx_DECREF(__pyx_v_self->func); + __pyx_v_self->func = __pyx_v_func; + + /* "src/gevent/_imap.py":67 + * self._zipped = _zipped + * self.func = func + * self.iterable = iterable # <<<<<<<<<<<<<< + * self.queue = UnboundQueue() # pylint:disable=undefined-variable + * + */ + __Pyx_INCREF(__pyx_v_iterable); + __Pyx_GIVEREF(__pyx_v_iterable); + __Pyx_GOTREF(__pyx_v_self->iterable); + __Pyx_DECREF(__pyx_v_self->iterable); + __pyx_v_self->iterable = __pyx_v_iterable; + + /* "src/gevent/_imap.py":68 + * self.func = func + * self.iterable = iterable + * self.queue = UnboundQueue() # pylint:disable=undefined-variable # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_6gevent_6_queue_UnboundQueue)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 68, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_self->queue); + __Pyx_DECREF(((PyObject *)__pyx_v_self->queue)); + __pyx_v_self->queue = ((struct __pyx_obj_6gevent_6_queue_UnboundQueue *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "src/gevent/_imap.py":71 + * + * + * if maxsize: # <<<<<<<<<<<<<< + * # Bounding the queue is not enough if we want to keep from + * # accumulating objects; the result value will be around as + */ + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_maxsize); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 71, __pyx_L1_error) + if (__pyx_t_4) { + + /* "src/gevent/_imap.py":87 + * # of self.rawlink() to avoid having blocking methods called in the + * # hub greenlet. + * self._result_semaphore = Semaphore(maxsize) # pylint:disable=undefined-variable # <<<<<<<<<<<<<< + * else: + * self._result_semaphore = None + */ + __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_6gevent_11__semaphore_Semaphore), __pyx_v_maxsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 87, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_self->_result_semaphore); + __Pyx_DECREF(((PyObject *)__pyx_v_self->_result_semaphore)); + __pyx_v_self->_result_semaphore = ((struct __pyx_obj_6gevent_11__semaphore_Semaphore *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "src/gevent/_imap.py":71 + * + * + * if maxsize: # <<<<<<<<<<<<<< + * # Bounding the queue is not enough if we want to keep from + * # accumulating objects; the result value will be around as + */ + goto __pyx_L3; + } + + /* "src/gevent/_imap.py":89 + * self._result_semaphore = Semaphore(maxsize) # pylint:disable=undefined-variable + * else: + * self._result_semaphore = None # <<<<<<<<<<<<<< + * + * self._outstanding_tasks = 0 + */ + /*else*/ { + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->_result_semaphore); + __Pyx_DECREF(((PyObject *)__pyx_v_self->_result_semaphore)); + __pyx_v_self->_result_semaphore = ((struct __pyx_obj_6gevent_11__semaphore_Semaphore *)Py_None); + } + __pyx_L3:; + + /* "src/gevent/_imap.py":91 + * self._result_semaphore = None + * + * self._outstanding_tasks = 0 # <<<<<<<<<<<<<< + * # The index (zero based) of the maximum number of + * # results we will have. + */ + __pyx_v_self->_outstanding_tasks = 0; + + /* "src/gevent/_imap.py":94 + * # The index (zero based) of the maximum number of + * # results we will have. + * self._max_index = -1 # <<<<<<<<<<<<<< + * self.finished = False + * + */ + __pyx_v_self->_max_index = -1; + + /* "src/gevent/_imap.py":95 + * # results we will have. + * self._max_index = -1 + * self.finished = False # <<<<<<<<<<<<<< + * + * + */ + __pyx_v_self->finished = 0; + + /* "src/gevent/_imap.py":48 + * """ + * + * def __init__(self, func, iterable, spawn, maxsize=None, _zipped=False): # <<<<<<<<<<<<<< + * """ + * An iterator that. + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("gevent.__imap.IMapUnordered.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_imap.py":99 + * + * # We're iterating in a different greenlet than we're running. + * def __iter__(self): # <<<<<<<<<<<<<< + * return self + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6__imap_13IMapUnordered_3__iter__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_6__imap_13IMapUnordered_3__iter__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6__imap_13IMapUnordered_2__iter__(((struct __pyx_obj_6gevent_6__imap_IMapUnordered *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6__imap_13IMapUnordered_2__iter__(struct __pyx_obj_6gevent_6__imap_IMapUnordered *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__iter__", 0); + + /* "src/gevent/_imap.py":100 + * # We're iterating in a different greenlet than we're running. + * def __iter__(self): + * return self # <<<<<<<<<<<<<< + * + * def __next__(self): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __pyx_r = ((PyObject *)__pyx_v_self); + goto __pyx_L0; + + /* "src/gevent/_imap.py":99 + * + * # We're iterating in a different greenlet than we're running. + * def __iter__(self): # <<<<<<<<<<<<<< + * return self + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_imap.py":102 + * return self + * + * def __next__(self): # <<<<<<<<<<<<<< + * if self._result_semaphore is not None: + * self._result_semaphore.release() + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6__imap_13IMapUnordered_5__next__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_6__imap_13IMapUnordered_5__next__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__next__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6__imap_13IMapUnordered_4__next__(((struct __pyx_obj_6gevent_6__imap_IMapUnordered *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6__imap_13IMapUnordered_4__next__(struct __pyx_obj_6gevent_6__imap_IMapUnordered *__pyx_v_self) { + PyObject *__pyx_v_value = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + __Pyx_RefNannySetupContext("__next__", 0); + + /* "src/gevent/_imap.py":103 + * + * def __next__(self): + * if self._result_semaphore is not None: # <<<<<<<<<<<<<< + * self._result_semaphore.release() + * value = self._inext() + */ + __pyx_t_1 = (((PyObject *)__pyx_v_self->_result_semaphore) != Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "src/gevent/_imap.py":104 + * def __next__(self): + * if self._result_semaphore is not None: + * self._result_semaphore.release() # <<<<<<<<<<<<<< + * value = self._inext() + * if isinstance(value, Failure): + */ + __pyx_t_3 = ((struct __pyx_vtabstruct_6gevent_11__semaphore_Semaphore *)__pyx_v_self->_result_semaphore->__pyx_base.__pyx_vtab)->release(__pyx_v_self->_result_semaphore, 0); if (unlikely(__pyx_t_3 == ((int)-1000))) __PYX_ERR(0, 104, __pyx_L1_error) + + /* "src/gevent/_imap.py":103 + * + * def __next__(self): + * if self._result_semaphore is not None: # <<<<<<<<<<<<<< + * self._result_semaphore.release() + * value = self._inext() + */ + } + + /* "src/gevent/_imap.py":105 + * if self._result_semaphore is not None: + * self._result_semaphore.release() + * value = self._inext() # <<<<<<<<<<<<<< + * if isinstance(value, Failure): + * _raise_exc(value) + */ + __pyx_t_4 = ((struct __pyx_vtabstruct_6gevent_6__imap_IMapUnordered *)__pyx_v_self->__pyx_base.__pyx_vtab)->_inext(__pyx_v_self); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 105, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_v_value = __pyx_t_4; + __pyx_t_4 = 0; + + /* "src/gevent/_imap.py":106 + * self._result_semaphore.release() + * value = self._inext() + * if isinstance(value, Failure): # <<<<<<<<<<<<<< + * _raise_exc(value) + * return value + */ + __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_value, __pyx_ptype_6gevent_6__imap_Failure); + __pyx_t_1 = (__pyx_t_2 != 0); + if (__pyx_t_1) { + + /* "src/gevent/_imap.py":107 + * value = self._inext() + * if isinstance(value, Failure): + * _raise_exc(value) # <<<<<<<<<<<<<< + * return value + * + */ + if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_6gevent_6__imap_Failure))))) __PYX_ERR(0, 107, __pyx_L1_error) + __pyx_t_4 = __pyx_f_6gevent_6__imap__raise_exc(((struct __pyx_obj_6gevent_6__imap_Failure *)__pyx_v_value)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 107, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "src/gevent/_imap.py":106 + * self._result_semaphore.release() + * value = self._inext() + * if isinstance(value, Failure): # <<<<<<<<<<<<<< + * _raise_exc(value) + * return value + */ + } + + /* "src/gevent/_imap.py":108 + * if isinstance(value, Failure): + * _raise_exc(value) + * return value # <<<<<<<<<<<<<< + * + * next = __next__ # Py2 + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_value); + __pyx_r = __pyx_v_value; + goto __pyx_L0; + + /* "src/gevent/_imap.py":102 + * return self + * + * def __next__(self): # <<<<<<<<<<<<<< + * if self._result_semaphore is not None: + * self._result_semaphore.release() + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("gevent.__imap.IMapUnordered.__next__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_value); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_imap.py":112 + * next = __next__ # Py2 + * + * def _inext(self): # <<<<<<<<<<<<<< + * return self.queue.get() + * + */ + +static PyObject *__pyx_f_6gevent_6__imap_13IMapUnordered__inext(struct __pyx_obj_6gevent_6__imap_IMapUnordered *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("_inext", 0); + + /* "src/gevent/_imap.py":113 + * + * def _inext(self): + * return self.queue.get() # <<<<<<<<<<<<<< + * + * def _ispawn(self, func, item, item_index): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_6_queue_UnboundQueue *)__pyx_v_self->queue->__pyx_base.__pyx_vtab)->__pyx_base.get(((struct __pyx_obj_6gevent_6_queue_Queue *)__pyx_v_self->queue), 0, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 113, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "src/gevent/_imap.py":112 + * next = __next__ # Py2 + * + * def _inext(self): # <<<<<<<<<<<<<< + * return self.queue.get() + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__imap.IMapUnordered._inext", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_imap.py":115 + * return self.queue.get() + * + * def _ispawn(self, func, item, item_index): # <<<<<<<<<<<<<< + * if self._result_semaphore is not None: + * self._result_semaphore.acquire() + */ + +static PyObject *__pyx_f_6gevent_6__imap_13IMapUnordered__ispawn(struct __pyx_obj_6gevent_6__imap_IMapUnordered *__pyx_v_self, PyObject *__pyx_v_func, PyObject *__pyx_v_item, int __pyx_v_item_index) { + PyObject *__pyx_v_g = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + __Pyx_RefNannySetupContext("_ispawn", 0); + + /* "src/gevent/_imap.py":116 + * + * def _ispawn(self, func, item, item_index): + * if self._result_semaphore is not None: # <<<<<<<<<<<<<< + * self._result_semaphore.acquire() + * self._outstanding_tasks += 1 + */ + __pyx_t_1 = (((PyObject *)__pyx_v_self->_result_semaphore) != Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "src/gevent/_imap.py":117 + * def _ispawn(self, func, item, item_index): + * if self._result_semaphore is not None: + * self._result_semaphore.acquire() # <<<<<<<<<<<<<< + * self._outstanding_tasks += 1 + * g = self.spawn(func, item) if not self._zipped else self.spawn(func, *item) + */ + __pyx_t_2 = ((struct __pyx_vtabstruct_6gevent_11__semaphore_Semaphore *)__pyx_v_self->_result_semaphore->__pyx_base.__pyx_vtab)->acquire(__pyx_v_self->_result_semaphore, 0, NULL); if (unlikely(__pyx_t_2 == ((int)-1000))) __PYX_ERR(0, 117, __pyx_L1_error) + + /* "src/gevent/_imap.py":116 + * + * def _ispawn(self, func, item, item_index): + * if self._result_semaphore is not None: # <<<<<<<<<<<<<< + * self._result_semaphore.acquire() + * self._outstanding_tasks += 1 + */ + } + + /* "src/gevent/_imap.py":118 + * if self._result_semaphore is not None: + * self._result_semaphore.acquire() + * self._outstanding_tasks += 1 # <<<<<<<<<<<<<< + * g = self.spawn(func, item) if not self._zipped else self.spawn(func, *item) + * g._imap_task_index = item_index + */ + __pyx_v_self->_outstanding_tasks = (__pyx_v_self->_outstanding_tasks + 1); + + /* "src/gevent/_imap.py":119 + * self._result_semaphore.acquire() + * self._outstanding_tasks += 1 + * g = self.spawn(func, item) if not self._zipped else self.spawn(func, *item) # <<<<<<<<<<<<<< + * g._imap_task_index = item_index + * g.rawlink(self._on_result) + */ + if (((!(__pyx_v_self->_zipped != 0)) != 0)) { + __Pyx_INCREF(__pyx_v_self->spawn); + __pyx_t_5 = __pyx_v_self->spawn; __pyx_t_6 = NULL; + __pyx_t_7 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); + if (likely(__pyx_t_6)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_5, function); + __pyx_t_7 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_5)) { + PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_func, __pyx_v_item}; + __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 119, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_GOTREF(__pyx_t_4); + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { + PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_func, __pyx_v_item}; + __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 119, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_GOTREF(__pyx_t_4); + } else + #endif + { + __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 119, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + if (__pyx_t_6) { + __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL; + } + __Pyx_INCREF(__pyx_v_func); + __Pyx_GIVEREF(__pyx_v_func); + PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_v_func); + __Pyx_INCREF(__pyx_v_item); + __Pyx_GIVEREF(__pyx_v_item); + PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_item); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 119, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + } + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_3 = __pyx_t_4; + __pyx_t_4 = 0; + } else { + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 119, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_func); + __Pyx_GIVEREF(__pyx_v_func); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_func); + __pyx_t_5 = __Pyx_PySequence_Tuple(__pyx_v_item); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 119, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_8 = PyNumber_Add(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 119, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_v_self->spawn, __pyx_t_8, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 119, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_3 = __pyx_t_5; + __pyx_t_5 = 0; + } + __pyx_v_g = __pyx_t_3; + __pyx_t_3 = 0; + + /* "src/gevent/_imap.py":120 + * self._outstanding_tasks += 1 + * g = self.spawn(func, item) if not self._zipped else self.spawn(func, *item) + * g._imap_task_index = item_index # <<<<<<<<<<<<<< + * g.rawlink(self._on_result) + * return g + */ + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_item_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 120, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (__Pyx_PyObject_SetAttrStr(__pyx_v_g, __pyx_n_s_imap_task_index, __pyx_t_3) < 0) __PYX_ERR(0, 120, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "src/gevent/_imap.py":121 + * g = self.spawn(func, item) if not self._zipped else self.spawn(func, *item) + * g._imap_task_index = item_index + * g.rawlink(self._on_result) # <<<<<<<<<<<<<< + * return g + * + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_g, __pyx_n_s_rawlink); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 121, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_on_result); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 121, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_5, function); + } + } + __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_4, __pyx_t_8) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_8); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 121, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "src/gevent/_imap.py":122 + * g._imap_task_index = item_index + * g.rawlink(self._on_result) + * return g # <<<<<<<<<<<<<< + * + * def _run(self): # pylint:disable=method-hidden + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_g); + __pyx_r = __pyx_v_g; + goto __pyx_L0; + + /* "src/gevent/_imap.py":115 + * return self.queue.get() + * + * def _ispawn(self, func, item, item_index): # <<<<<<<<<<<<<< + * if self._result_semaphore is not None: + * self._result_semaphore.acquire() + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("gevent.__imap.IMapUnordered._ispawn", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_g); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_imap.py":124 + * return g + * + * def _run(self): # pylint:disable=method-hidden # <<<<<<<<<<<<<< + * try: + * func = self.func + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6__imap_13IMapUnordered_7_run(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6gevent_6__imap_13IMapUnordered_6_run[] = "IMapUnordered._run(self)"; +static PyMethodDef __pyx_mdef_6gevent_6__imap_13IMapUnordered_7_run = {"_run", (PyCFunction)__pyx_pw_6gevent_6__imap_13IMapUnordered_7_run, METH_NOARGS, __pyx_doc_6gevent_6__imap_13IMapUnordered_6_run}; +static PyObject *__pyx_pw_6gevent_6__imap_13IMapUnordered_7_run(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_run (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6__imap_13IMapUnordered_6_run(((struct __pyx_obj_6gevent_6__imap_IMapUnordered *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6__imap_13IMapUnordered_6_run(struct __pyx_obj_6gevent_6__imap_IMapUnordered *__pyx_v_self) { + PyObject *__pyx_v_func = NULL; + PyObject *__pyx_v_item = NULL; + PyObject *__pyx_v_e = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + Py_ssize_t __pyx_t_5; + PyObject *(*__pyx_t_6)(PyObject *); + PyObject *__pyx_t_7 = NULL; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + int __pyx_t_11; + char const *__pyx_t_12; + PyObject *__pyx_t_13 = NULL; + PyObject *__pyx_t_14 = NULL; + PyObject *__pyx_t_15 = NULL; + PyObject *__pyx_t_16 = NULL; + PyObject *__pyx_t_17 = NULL; + PyObject *__pyx_t_18 = NULL; + char const *__pyx_t_19; + __Pyx_RefNannySetupContext("_run", 0); + + /* "src/gevent/_imap.py":125 + * + * def _run(self): # pylint:disable=method-hidden + * try: # <<<<<<<<<<<<<< + * func = self.func + * for item in self.iterable: + */ + /*try:*/ { + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "src/gevent/_imap.py":126 + * def _run(self): # pylint:disable=method-hidden + * try: + * func = self.func # <<<<<<<<<<<<<< + * for item in self.iterable: + * self._max_index += 1 + */ + __pyx_t_4 = __pyx_v_self->func; + __Pyx_INCREF(__pyx_t_4); + __pyx_v_func = __pyx_t_4; + __pyx_t_4 = 0; + + /* "src/gevent/_imap.py":127 + * try: + * func = self.func + * for item in self.iterable: # <<<<<<<<<<<<<< + * self._max_index += 1 + * self._ispawn(func, item, self._max_index) + */ + if (likely(PyList_CheckExact(__pyx_v_self->iterable)) || PyTuple_CheckExact(__pyx_v_self->iterable)) { + __pyx_t_4 = __pyx_v_self->iterable; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0; + __pyx_t_6 = NULL; + } else { + __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_self->iterable); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 127, __pyx_L6_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 127, __pyx_L6_error) + } + for (;;) { + if (likely(!__pyx_t_6)) { + if (likely(PyList_CheckExact(__pyx_t_4))) { + if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 127, __pyx_L6_error) + #else + __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 127, __pyx_L6_error) + __Pyx_GOTREF(__pyx_t_7); + #endif + } else { + if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 127, __pyx_L6_error) + #else + __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 127, __pyx_L6_error) + __Pyx_GOTREF(__pyx_t_7); + #endif + } + } else { + __pyx_t_7 = __pyx_t_6(__pyx_t_4); + if (unlikely(!__pyx_t_7)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(0, 127, __pyx_L6_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_7); + } + __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_7); + __pyx_t_7 = 0; + + /* "src/gevent/_imap.py":128 + * func = self.func + * for item in self.iterable: + * self._max_index += 1 # <<<<<<<<<<<<<< + * self._ispawn(func, item, self._max_index) + * self._on_finish(None) + */ + __pyx_v_self->_max_index = (__pyx_v_self->_max_index + 1); + + /* "src/gevent/_imap.py":129 + * for item in self.iterable: + * self._max_index += 1 + * self._ispawn(func, item, self._max_index) # <<<<<<<<<<<<<< + * self._on_finish(None) + * except BaseException as e: + */ + __pyx_t_7 = ((struct __pyx_vtabstruct_6gevent_6__imap_IMapUnordered *)__pyx_v_self->__pyx_base.__pyx_vtab)->_ispawn(__pyx_v_self, __pyx_v_func, __pyx_v_item, __pyx_v_self->_max_index); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 129, __pyx_L6_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "src/gevent/_imap.py":127 + * try: + * func = self.func + * for item in self.iterable: # <<<<<<<<<<<<<< + * self._max_index += 1 + * self._ispawn(func, item, self._max_index) + */ + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "src/gevent/_imap.py":130 + * self._max_index += 1 + * self._ispawn(func, item, self._max_index) + * self._on_finish(None) # <<<<<<<<<<<<<< + * except BaseException as e: + * self._on_finish(e) + */ + __pyx_t_4 = ((struct __pyx_vtabstruct_6gevent_6__imap_IMapUnordered *)__pyx_v_self->__pyx_base.__pyx_vtab)->_on_finish(__pyx_v_self, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 130, __pyx_L6_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "src/gevent/_imap.py":125 + * + * def _run(self): # pylint:disable=method-hidden + * try: # <<<<<<<<<<<<<< + * func = self.func + * for item in self.iterable: + */ + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L11_try_end; + __pyx_L6_error:; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "src/gevent/_imap.py":131 + * self._ispawn(func, item, self._max_index) + * self._on_finish(None) + * except BaseException as e: # <<<<<<<<<<<<<< + * self._on_finish(e) + * raise + */ + __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_BaseException); + if (__pyx_t_8) { + __Pyx_AddTraceback("gevent.__imap.IMapUnordered._run", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_7, &__pyx_t_9) < 0) __PYX_ERR(0, 131, __pyx_L8_except_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GOTREF(__pyx_t_9); + __Pyx_INCREF(__pyx_t_7); + __pyx_v_e = __pyx_t_7; + /*try:*/ { + + /* "src/gevent/_imap.py":132 + * self._on_finish(None) + * except BaseException as e: + * self._on_finish(e) # <<<<<<<<<<<<<< + * raise + * finally: + */ + __pyx_t_10 = ((struct __pyx_vtabstruct_6gevent_6__imap_IMapUnordered *)__pyx_v_self->__pyx_base.__pyx_vtab)->_on_finish(__pyx_v_self, __pyx_v_e); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 132, __pyx_L19_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + + /* "src/gevent/_imap.py":133 + * except BaseException as e: + * self._on_finish(e) + * raise # <<<<<<<<<<<<<< + * finally: + * self.spawn = None + */ + __Pyx_GIVEREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_7); + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_ErrRestoreWithState(__pyx_t_4, __pyx_t_7, __pyx_t_9); + __pyx_t_4 = 0; __pyx_t_7 = 0; __pyx_t_9 = 0; + __PYX_ERR(0, 133, __pyx_L19_error) + } + + /* "src/gevent/_imap.py":131 + * self._ispawn(func, item, self._max_index) + * self._on_finish(None) + * except BaseException as e: # <<<<<<<<<<<<<< + * self._on_finish(e) + * raise + */ + /*finally:*/ { + __pyx_L19_error:; + /*exception exit:*/{ + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18); + if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15) < 0)) __Pyx_ErrFetch(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15); + __Pyx_XGOTREF(__pyx_t_13); + __Pyx_XGOTREF(__pyx_t_14); + __Pyx_XGOTREF(__pyx_t_15); + __Pyx_XGOTREF(__pyx_t_16); + __Pyx_XGOTREF(__pyx_t_17); + __Pyx_XGOTREF(__pyx_t_18); + __pyx_t_8 = __pyx_lineno; __pyx_t_11 = __pyx_clineno; __pyx_t_12 = __pyx_filename; + { + __Pyx_DECREF(__pyx_v_e); + __pyx_v_e = NULL; + } + if (PY_MAJOR_VERSION >= 3) { + __Pyx_XGIVEREF(__pyx_t_16); + __Pyx_XGIVEREF(__pyx_t_17); + __Pyx_XGIVEREF(__pyx_t_18); + __Pyx_ExceptionReset(__pyx_t_16, __pyx_t_17, __pyx_t_18); + } + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_XGIVEREF(__pyx_t_15); + __Pyx_ErrRestore(__pyx_t_13, __pyx_t_14, __pyx_t_15); + __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; + __pyx_lineno = __pyx_t_8; __pyx_clineno = __pyx_t_11; __pyx_filename = __pyx_t_12; + goto __pyx_L8_except_error; + } + } + } + goto __pyx_L8_except_error; + __pyx_L8_except_error:; + + /* "src/gevent/_imap.py":125 + * + * def _run(self): # pylint:disable=method-hidden + * try: # <<<<<<<<<<<<<< + * func = self.func + * for item in self.iterable: + */ + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L4_error; + __pyx_L11_try_end:; + } + } + + /* "src/gevent/_imap.py":135 + * raise + * finally: + * self.spawn = None # <<<<<<<<<<<<<< + * self.func = None + * self.iterable = None + */ + /*finally:*/ { + /*normal exit:*/{ + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->spawn); + __Pyx_DECREF(__pyx_v_self->spawn); + __pyx_v_self->spawn = Py_None; + + /* "src/gevent/_imap.py":136 + * finally: + * self.spawn = None + * self.func = None # <<<<<<<<<<<<<< + * self.iterable = None + * self._result_semaphore = None + */ + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->func); + __Pyx_DECREF(__pyx_v_self->func); + __pyx_v_self->func = Py_None; + + /* "src/gevent/_imap.py":137 + * self.spawn = None + * self.func = None + * self.iterable = None # <<<<<<<<<<<<<< + * self._result_semaphore = None + * + */ + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->iterable); + __Pyx_DECREF(__pyx_v_self->iterable); + __pyx_v_self->iterable = Py_None; + + /* "src/gevent/_imap.py":138 + * self.func = None + * self.iterable = None + * self._result_semaphore = None # <<<<<<<<<<<<<< + * + * def _on_result(self, greenlet): + */ + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->_result_semaphore); + __Pyx_DECREF(((PyObject *)__pyx_v_self->_result_semaphore)); + __pyx_v_self->_result_semaphore = ((struct __pyx_obj_6gevent_11__semaphore_Semaphore *)Py_None); + goto __pyx_L5; + } + __pyx_L4_error:; + /*exception exit:*/{ + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __pyx_t_3 = 0; __pyx_t_2 = 0; __pyx_t_1 = 0; __pyx_t_18 = 0; __pyx_t_17 = 0; __pyx_t_16 = 0; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_18, &__pyx_t_17, &__pyx_t_16); + if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_3, &__pyx_t_2, &__pyx_t_1) < 0)) __Pyx_ErrFetch(&__pyx_t_3, &__pyx_t_2, &__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_18); + __Pyx_XGOTREF(__pyx_t_17); + __Pyx_XGOTREF(__pyx_t_16); + __pyx_t_11 = __pyx_lineno; __pyx_t_8 = __pyx_clineno; __pyx_t_19 = __pyx_filename; + { + + /* "src/gevent/_imap.py":135 + * raise + * finally: + * self.spawn = None # <<<<<<<<<<<<<< + * self.func = None + * self.iterable = None + */ + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->spawn); + __Pyx_DECREF(__pyx_v_self->spawn); + __pyx_v_self->spawn = Py_None; + + /* "src/gevent/_imap.py":136 + * finally: + * self.spawn = None + * self.func = None # <<<<<<<<<<<<<< + * self.iterable = None + * self._result_semaphore = None + */ + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->func); + __Pyx_DECREF(__pyx_v_self->func); + __pyx_v_self->func = Py_None; + + /* "src/gevent/_imap.py":137 + * self.spawn = None + * self.func = None + * self.iterable = None # <<<<<<<<<<<<<< + * self._result_semaphore = None + * + */ + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->iterable); + __Pyx_DECREF(__pyx_v_self->iterable); + __pyx_v_self->iterable = Py_None; + + /* "src/gevent/_imap.py":138 + * self.func = None + * self.iterable = None + * self._result_semaphore = None # <<<<<<<<<<<<<< + * + * def _on_result(self, greenlet): + */ + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->_result_semaphore); + __Pyx_DECREF(((PyObject *)__pyx_v_self->_result_semaphore)); + __pyx_v_self->_result_semaphore = ((struct __pyx_obj_6gevent_11__semaphore_Semaphore *)Py_None); + } + if (PY_MAJOR_VERSION >= 3) { + __Pyx_XGIVEREF(__pyx_t_18); + __Pyx_XGIVEREF(__pyx_t_17); + __Pyx_XGIVEREF(__pyx_t_16); + __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_17, __pyx_t_16); + } + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_ErrRestore(__pyx_t_3, __pyx_t_2, __pyx_t_1); + __pyx_t_3 = 0; __pyx_t_2 = 0; __pyx_t_1 = 0; __pyx_t_18 = 0; __pyx_t_17 = 0; __pyx_t_16 = 0; + __pyx_lineno = __pyx_t_11; __pyx_clineno = __pyx_t_8; __pyx_filename = __pyx_t_19; + goto __pyx_L1_error; + } + __pyx_L5:; + } + + /* "src/gevent/_imap.py":124 + * return g + * + * def _run(self): # pylint:disable=method-hidden # <<<<<<<<<<<<<< + * try: + * func = self.func + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_AddTraceback("gevent.__imap.IMapUnordered._run", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_func); + __Pyx_XDECREF(__pyx_v_item); + __Pyx_XDECREF(__pyx_v_e); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_imap.py":140 + * self._result_semaphore = None + * + * def _on_result(self, greenlet): # <<<<<<<<<<<<<< + * # This method will be called in the hub greenlet (we rawlink) + * self._outstanding_tasks -= 1 + */ + +static PyObject *__pyx_pw_6gevent_6__imap_13IMapUnordered_9_on_result(PyObject *__pyx_v_self, PyObject *__pyx_v_greenlet); /*proto*/ +static PyObject *__pyx_f_6gevent_6__imap_13IMapUnordered__on_result(struct __pyx_obj_6gevent_6__imap_IMapUnordered *__pyx_v_self, PyObject *__pyx_v_greenlet, int __pyx_skip_dispatch) { + int __pyx_v_count; + int __pyx_v_finished; + int __pyx_v_ready; + int __pyx_v_put_finished; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + int __pyx_t_6; + int __pyx_t_7; + __Pyx_RefNannySetupContext("_on_result", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0; + if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self)))))); + else { + PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + #endif + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_on_result); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 140, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_6__imap_13IMapUnordered_9_on_result)) { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_greenlet) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_greenlet); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 140, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0; + if (unlikely(type_dict_guard != tp_dict_version)) { + tp_dict_version = obj_dict_version = 0; + } + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + } + #endif + } + + /* "src/gevent/_imap.py":142 + * def _on_result(self, greenlet): + * # This method will be called in the hub greenlet (we rawlink) + * self._outstanding_tasks -= 1 # <<<<<<<<<<<<<< + * count = self._outstanding_tasks + * finished = self.finished + */ + __pyx_v_self->_outstanding_tasks = (__pyx_v_self->_outstanding_tasks - 1); + + /* "src/gevent/_imap.py":143 + * # This method will be called in the hub greenlet (we rawlink) + * self._outstanding_tasks -= 1 + * count = self._outstanding_tasks # <<<<<<<<<<<<<< + * finished = self.finished + * ready = self.ready() + */ + __pyx_t_5 = __pyx_v_self->_outstanding_tasks; + __pyx_v_count = __pyx_t_5; + + /* "src/gevent/_imap.py":144 + * self._outstanding_tasks -= 1 + * count = self._outstanding_tasks + * finished = self.finished # <<<<<<<<<<<<<< + * ready = self.ready() + * put_finished = False + */ + __pyx_t_6 = __pyx_v_self->finished; + __pyx_v_finished = __pyx_t_6; + + /* "src/gevent/_imap.py":145 + * count = self._outstanding_tasks + * finished = self.finished + * ready = self.ready() # <<<<<<<<<<<<<< + * put_finished = False + * + */ + __pyx_v_ready = ((struct __pyx_vtabstruct_6gevent_6__imap_IMapUnordered *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.ready(((struct __pyx_obj_6gevent_9_greenlet_Greenlet *)__pyx_v_self), 0); + + /* "src/gevent/_imap.py":146 + * finished = self.finished + * ready = self.ready() + * put_finished = False # <<<<<<<<<<<<<< + * + * if ready and count <= 0 and not finished: + */ + __pyx_v_put_finished = 0; + + /* "src/gevent/_imap.py":148 + * put_finished = False + * + * if ready and count <= 0 and not finished: # <<<<<<<<<<<<<< + * finished = self.finished = True + * put_finished = True + */ + __pyx_t_7 = (__pyx_v_ready != 0); + if (__pyx_t_7) { + } else { + __pyx_t_6 = __pyx_t_7; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_7 = ((__pyx_v_count <= 0) != 0); + if (__pyx_t_7) { + } else { + __pyx_t_6 = __pyx_t_7; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_7 = ((!(__pyx_v_finished != 0)) != 0); + __pyx_t_6 = __pyx_t_7; + __pyx_L4_bool_binop_done:; + if (__pyx_t_6) { + + /* "src/gevent/_imap.py":149 + * + * if ready and count <= 0 and not finished: + * finished = self.finished = True # <<<<<<<<<<<<<< + * put_finished = True + * + */ + __pyx_v_finished = 1; + __pyx_v_self->finished = 1; + + /* "src/gevent/_imap.py":150 + * if ready and count <= 0 and not finished: + * finished = self.finished = True + * put_finished = True # <<<<<<<<<<<<<< + * + * if greenlet.successful(): + */ + __pyx_v_put_finished = 1; + + /* "src/gevent/_imap.py":148 + * put_finished = False + * + * if ready and count <= 0 and not finished: # <<<<<<<<<<<<<< + * finished = self.finished = True + * put_finished = True + */ + } + + /* "src/gevent/_imap.py":152 + * put_finished = True + * + * if greenlet.successful(): # <<<<<<<<<<<<<< + * self.queue.put(self._iqueue_value_for_success(greenlet)) + * else: + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_greenlet, __pyx_n_s_successful); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 152, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 152, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 152, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_6) { + + /* "src/gevent/_imap.py":153 + * + * if greenlet.successful(): + * self.queue.put(self._iqueue_value_for_success(greenlet)) # <<<<<<<<<<<<<< + * else: + * self.queue.put(self._iqueue_value_for_failure(greenlet)) + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_6__imap_IMapUnordered *)__pyx_v_self->__pyx_base.__pyx_vtab)->_iqueue_value_for_success(__pyx_v_self, __pyx_v_greenlet); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 153, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = ((struct __pyx_vtabstruct_6gevent_6_queue_UnboundQueue *)__pyx_v_self->queue->__pyx_base.__pyx_vtab)->__pyx_base.put(((struct __pyx_obj_6gevent_6_queue_Queue *)__pyx_v_self->queue), __pyx_t_1, 0, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 153, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/_imap.py":152 + * put_finished = True + * + * if greenlet.successful(): # <<<<<<<<<<<<<< + * self.queue.put(self._iqueue_value_for_success(greenlet)) + * else: + */ + goto __pyx_L7; + } + + /* "src/gevent/_imap.py":155 + * self.queue.put(self._iqueue_value_for_success(greenlet)) + * else: + * self.queue.put(self._iqueue_value_for_failure(greenlet)) # <<<<<<<<<<<<<< + * + * if put_finished: + */ + /*else*/ { + __pyx_t_2 = ((struct __pyx_vtabstruct_6gevent_6__imap_IMapUnordered *)__pyx_v_self->__pyx_base.__pyx_vtab)->_iqueue_value_for_failure(__pyx_v_self, __pyx_v_greenlet); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 155, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_6_queue_UnboundQueue *)__pyx_v_self->queue->__pyx_base.__pyx_vtab)->__pyx_base.put(((struct __pyx_obj_6gevent_6_queue_Queue *)__pyx_v_self->queue), __pyx_t_2, 0, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 155, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + __pyx_L7:; + + /* "src/gevent/_imap.py":157 + * self.queue.put(self._iqueue_value_for_failure(greenlet)) + * + * if put_finished: # <<<<<<<<<<<<<< + * self.queue.put(self._iqueue_value_for_self_finished()) + * + */ + __pyx_t_6 = (__pyx_v_put_finished != 0); + if (__pyx_t_6) { + + /* "src/gevent/_imap.py":158 + * + * if put_finished: + * self.queue.put(self._iqueue_value_for_self_finished()) # <<<<<<<<<<<<<< + * + * def _on_finish(self, exception): + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_6__imap_IMapUnordered *)__pyx_v_self->__pyx_base.__pyx_vtab)->_iqueue_value_for_self_finished(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 158, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = ((struct __pyx_vtabstruct_6gevent_6_queue_UnboundQueue *)__pyx_v_self->queue->__pyx_base.__pyx_vtab)->__pyx_base.put(((struct __pyx_obj_6gevent_6_queue_Queue *)__pyx_v_self->queue), __pyx_t_1, 0, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 158, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/_imap.py":157 + * self.queue.put(self._iqueue_value_for_failure(greenlet)) + * + * if put_finished: # <<<<<<<<<<<<<< + * self.queue.put(self._iqueue_value_for_self_finished()) + * + */ + } + + /* "src/gevent/_imap.py":140 + * self._result_semaphore = None + * + * def _on_result(self, greenlet): # <<<<<<<<<<<<<< + * # This method will be called in the hub greenlet (we rawlink) + * self._outstanding_tasks -= 1 + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("gevent.__imap.IMapUnordered._on_result", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6__imap_13IMapUnordered_9_on_result(PyObject *__pyx_v_self, PyObject *__pyx_v_greenlet); /*proto*/ +static char __pyx_doc_6gevent_6__imap_13IMapUnordered_8_on_result[] = "IMapUnordered._on_result(self, greenlet)"; +static PyMethodDef __pyx_mdef_6gevent_6__imap_13IMapUnordered_9_on_result = {"_on_result", (PyCFunction)__pyx_pw_6gevent_6__imap_13IMapUnordered_9_on_result, METH_O, __pyx_doc_6gevent_6__imap_13IMapUnordered_8_on_result}; +static PyObject *__pyx_pw_6gevent_6__imap_13IMapUnordered_9_on_result(PyObject *__pyx_v_self, PyObject *__pyx_v_greenlet) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_on_result (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6__imap_13IMapUnordered_8_on_result(((struct __pyx_obj_6gevent_6__imap_IMapUnordered *)__pyx_v_self), ((PyObject *)__pyx_v_greenlet)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6__imap_13IMapUnordered_8_on_result(struct __pyx_obj_6gevent_6__imap_IMapUnordered *__pyx_v_self, PyObject *__pyx_v_greenlet) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("_on_result", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6gevent_6__imap_13IMapUnordered__on_result(__pyx_v_self, __pyx_v_greenlet, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 140, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__imap.IMapUnordered._on_result", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_imap.py":160 + * self.queue.put(self._iqueue_value_for_self_finished()) + * + * def _on_finish(self, exception): # <<<<<<<<<<<<<< + * # Called in this greenlet. + * if self.finished: + */ + +static PyObject *__pyx_f_6gevent_6__imap_13IMapUnordered__on_finish(struct __pyx_obj_6gevent_6__imap_IMapUnordered *__pyx_v_self, PyObject *__pyx_v_exception) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + __Pyx_RefNannySetupContext("_on_finish", 0); + + /* "src/gevent/_imap.py":162 + * def _on_finish(self, exception): + * # Called in this greenlet. + * if self.finished: # <<<<<<<<<<<<<< + * return + * + */ + __pyx_t_1 = (__pyx_v_self->finished != 0); + if (__pyx_t_1) { + + /* "src/gevent/_imap.py":163 + * # Called in this greenlet. + * if self.finished: + * return # <<<<<<<<<<<<<< + * + * if exception is not None: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + + /* "src/gevent/_imap.py":162 + * def _on_finish(self, exception): + * # Called in this greenlet. + * if self.finished: # <<<<<<<<<<<<<< + * return + * + */ + } + + /* "src/gevent/_imap.py":165 + * return + * + * if exception is not None: # <<<<<<<<<<<<<< + * self.finished = True + * self.queue.put(self._iqueue_value_for_self_failure(exception)) + */ + __pyx_t_1 = (__pyx_v_exception != Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "src/gevent/_imap.py":166 + * + * if exception is not None: + * self.finished = True # <<<<<<<<<<<<<< + * self.queue.put(self._iqueue_value_for_self_failure(exception)) + * return + */ + __pyx_v_self->finished = 1; + + /* "src/gevent/_imap.py":167 + * if exception is not None: + * self.finished = True + * self.queue.put(self._iqueue_value_for_self_failure(exception)) # <<<<<<<<<<<<<< + * return + * + */ + __pyx_t_3 = ((struct __pyx_vtabstruct_6gevent_6__imap_IMapUnordered *)__pyx_v_self->__pyx_base.__pyx_vtab)->_iqueue_value_for_self_failure(__pyx_v_self, __pyx_v_exception); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 167, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = ((struct __pyx_vtabstruct_6gevent_6_queue_UnboundQueue *)__pyx_v_self->queue->__pyx_base.__pyx_vtab)->__pyx_base.put(((struct __pyx_obj_6gevent_6_queue_Queue *)__pyx_v_self->queue), __pyx_t_3, 0, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 167, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "src/gevent/_imap.py":168 + * self.finished = True + * self.queue.put(self._iqueue_value_for_self_failure(exception)) + * return # <<<<<<<<<<<<<< + * + * if self._outstanding_tasks <= 0: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + + /* "src/gevent/_imap.py":165 + * return + * + * if exception is not None: # <<<<<<<<<<<<<< + * self.finished = True + * self.queue.put(self._iqueue_value_for_self_failure(exception)) + */ + } + + /* "src/gevent/_imap.py":170 + * return + * + * if self._outstanding_tasks <= 0: # <<<<<<<<<<<<<< + * self.finished = True + * self.queue.put(self._iqueue_value_for_self_finished()) + */ + __pyx_t_2 = ((__pyx_v_self->_outstanding_tasks <= 0) != 0); + if (__pyx_t_2) { + + /* "src/gevent/_imap.py":171 + * + * if self._outstanding_tasks <= 0: + * self.finished = True # <<<<<<<<<<<<<< + * self.queue.put(self._iqueue_value_for_self_finished()) + * + */ + __pyx_v_self->finished = 1; + + /* "src/gevent/_imap.py":172 + * if self._outstanding_tasks <= 0: + * self.finished = True + * self.queue.put(self._iqueue_value_for_self_finished()) # <<<<<<<<<<<<<< + * + * def _iqueue_value_for_success(self, greenlet): + */ + __pyx_t_4 = ((struct __pyx_vtabstruct_6gevent_6__imap_IMapUnordered *)__pyx_v_self->__pyx_base.__pyx_vtab)->_iqueue_value_for_self_finished(__pyx_v_self); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 172, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = ((struct __pyx_vtabstruct_6gevent_6_queue_UnboundQueue *)__pyx_v_self->queue->__pyx_base.__pyx_vtab)->__pyx_base.put(((struct __pyx_obj_6gevent_6_queue_Queue *)__pyx_v_self->queue), __pyx_t_4, 0, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 172, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "src/gevent/_imap.py":170 + * return + * + * if self._outstanding_tasks <= 0: # <<<<<<<<<<<<<< + * self.finished = True + * self.queue.put(self._iqueue_value_for_self_finished()) + */ + } + + /* "src/gevent/_imap.py":160 + * self.queue.put(self._iqueue_value_for_self_finished()) + * + * def _on_finish(self, exception): # <<<<<<<<<<<<<< + * # Called in this greenlet. + * if self.finished: + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("gevent.__imap.IMapUnordered._on_finish", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_imap.py":174 + * self.queue.put(self._iqueue_value_for_self_finished()) + * + * def _iqueue_value_for_success(self, greenlet): # <<<<<<<<<<<<<< + * return greenlet.value + * + */ + +static PyObject *__pyx_f_6gevent_6__imap_13IMapUnordered__iqueue_value_for_success(CYTHON_UNUSED struct __pyx_obj_6gevent_6__imap_IMapUnordered *__pyx_v_self, PyObject *__pyx_v_greenlet) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("_iqueue_value_for_success", 0); + + /* "src/gevent/_imap.py":175 + * + * def _iqueue_value_for_success(self, greenlet): + * return greenlet.value # <<<<<<<<<<<<<< + * + * def _iqueue_value_for_failure(self, greenlet): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_greenlet, __pyx_n_s_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 175, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "src/gevent/_imap.py":174 + * self.queue.put(self._iqueue_value_for_self_finished()) + * + * def _iqueue_value_for_success(self, greenlet): # <<<<<<<<<<<<<< + * return greenlet.value + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__imap.IMapUnordered._iqueue_value_for_success", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_imap.py":177 + * return greenlet.value + * + * def _iqueue_value_for_failure(self, greenlet): # <<<<<<<<<<<<<< + * return Failure(greenlet.exception, getattr(greenlet, '_raise_exception')) + * + */ + +static PyObject *__pyx_f_6gevent_6__imap_13IMapUnordered__iqueue_value_for_failure(CYTHON_UNUSED struct __pyx_obj_6gevent_6__imap_IMapUnordered *__pyx_v_self, PyObject *__pyx_v_greenlet) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("_iqueue_value_for_failure", 0); + + /* "src/gevent/_imap.py":178 + * + * def _iqueue_value_for_failure(self, greenlet): + * return Failure(greenlet.exception, getattr(greenlet, '_raise_exception')) # <<<<<<<<<<<<<< + * + * def _iqueue_value_for_self_finished(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_greenlet, __pyx_n_s_exception); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 178, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_GetAttr(__pyx_v_greenlet, __pyx_n_s_raise_exception_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 178, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 178, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); + __pyx_t_1 = 0; + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6gevent_6__imap_Failure), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 178, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "src/gevent/_imap.py":177 + * return greenlet.value + * + * def _iqueue_value_for_failure(self, greenlet): # <<<<<<<<<<<<<< + * return Failure(greenlet.exception, getattr(greenlet, '_raise_exception')) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("gevent.__imap.IMapUnordered._iqueue_value_for_failure", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_imap.py":180 + * return Failure(greenlet.exception, getattr(greenlet, '_raise_exception')) + * + * def _iqueue_value_for_self_finished(self): # <<<<<<<<<<<<<< + * return Failure(StopIteration()) + * + */ + +static PyObject *__pyx_f_6gevent_6__imap_13IMapUnordered__iqueue_value_for_self_finished(CYTHON_UNUSED struct __pyx_obj_6gevent_6__imap_IMapUnordered *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("_iqueue_value_for_self_finished", 0); + + /* "src/gevent/_imap.py":181 + * + * def _iqueue_value_for_self_finished(self): + * return Failure(StopIteration()) # <<<<<<<<<<<<<< + * + * def _iqueue_value_for_self_failure(self, exception): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_builtin_StopIteration); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 181, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_6gevent_6__imap_Failure), __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 181, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "src/gevent/_imap.py":180 + * return Failure(greenlet.exception, getattr(greenlet, '_raise_exception')) + * + * def _iqueue_value_for_self_finished(self): # <<<<<<<<<<<<<< + * return Failure(StopIteration()) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent.__imap.IMapUnordered._iqueue_value_for_self_finished", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_imap.py":183 + * return Failure(StopIteration()) + * + * def _iqueue_value_for_self_failure(self, exception): # <<<<<<<<<<<<<< + * return Failure(exception, self._raise_exception) + * + */ + +static PyObject *__pyx_f_6gevent_6__imap_13IMapUnordered__iqueue_value_for_self_failure(struct __pyx_obj_6gevent_6__imap_IMapUnordered *__pyx_v_self, PyObject *__pyx_v_exception) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("_iqueue_value_for_self_failure", 0); + + /* "src/gevent/_imap.py":184 + * + * def _iqueue_value_for_self_failure(self, exception): + * return Failure(exception, self._raise_exception) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_raise_exception_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 184, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 184, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_exception); + __Pyx_GIVEREF(__pyx_v_exception); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_exception); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6gevent_6__imap_Failure), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 184, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "src/gevent/_imap.py":183 + * return Failure(StopIteration()) + * + * def _iqueue_value_for_self_failure(self, exception): # <<<<<<<<<<<<<< + * return Failure(exception, self._raise_exception) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent.__imap.IMapUnordered._iqueue_value_for_self_failure", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/__imap.pxd":24 + * cdef int _max_index + * + * cdef readonly UnboundQueue queue # <<<<<<<<<<<<<< + * cdef readonly bint finished + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6__imap_13IMapUnordered_5queue_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_6__imap_13IMapUnordered_5queue_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6__imap_13IMapUnordered_5queue___get__(((struct __pyx_obj_6gevent_6__imap_IMapUnordered *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6__imap_13IMapUnordered_5queue___get__(struct __pyx_obj_6gevent_6__imap_IMapUnordered *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_self->queue)); + __pyx_r = ((PyObject *)__pyx_v_self->queue); + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/__imap.pxd":25 + * + * cdef readonly UnboundQueue queue + * cdef readonly bint finished # <<<<<<<<<<<<<< + * + * cdef _inext(self) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6__imap_13IMapUnordered_8finished_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_6__imap_13IMapUnordered_8finished_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6__imap_13IMapUnordered_8finished___get__(((struct __pyx_obj_6gevent_6__imap_IMapUnordered *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6__imap_13IMapUnordered_8finished___get__(struct __pyx_obj_6gevent_6__imap_IMapUnordered *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->finished); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 25, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__imap.IMapUnordered.finished.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_imap.py":192 + * # the order in which they finish. + * + * def __init__(self, *args, **kwargs): # <<<<<<<<<<<<<< + * # The result dictionary: {index: value} + * self._results = {} + */ + +/* Python wrapper */ +static int __pyx_pw_6gevent_6__imap_4IMap_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6gevent_6__imap_4IMap_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_args = 0; + PyObject *__pyx_v_kwargs = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 1))) return -1; + if (unlikely(__pyx_kwds)) { + __pyx_v_kwargs = PyDict_Copy(__pyx_kwds); if (unlikely(!__pyx_v_kwargs)) return -1; + __Pyx_GOTREF(__pyx_v_kwargs); + } else { + __pyx_v_kwargs = NULL; + } + __Pyx_INCREF(__pyx_args); + __pyx_v_args = __pyx_args; + __pyx_r = __pyx_pf_6gevent_6__imap_4IMap___init__(((struct __pyx_obj_6gevent_6__imap_IMap *)__pyx_v_self), __pyx_v_args, __pyx_v_kwargs); + + /* function exit code */ + __Pyx_XDECREF(__pyx_v_args); + __Pyx_XDECREF(__pyx_v_kwargs); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_6__imap_4IMap___init__(struct __pyx_obj_6gevent_6__imap_IMap *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "src/gevent/_imap.py":194 + * def __init__(self, *args, **kwargs): + * # The result dictionary: {index: value} + * self._results = {} # <<<<<<<<<<<<<< + * + * # The index of the result to return next. + */ + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 194, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_self->_results); + __Pyx_DECREF(__pyx_v_self->_results); + __pyx_v_self->_results = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "src/gevent/_imap.py":197 + * + * # The index of the result to return next. + * self.index = 0 # <<<<<<<<<<<<<< + * IMapUnordered.__init__(self, *args, **kwargs) + * + */ + __pyx_v_self->index = 0; + + /* "src/gevent/_imap.py":198 + * # The index of the result to return next. + * self.index = 0 + * IMapUnordered.__init__(self, *args, **kwargs) # <<<<<<<<<<<<<< + * + * def _inext(self): + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_6gevent_6__imap_IMapUnordered), __pyx_n_s_init); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 198, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 198, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self)); + __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_v_args); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 198, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 198, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/_imap.py":192 + * # the order in which they finish. + * + * def __init__(self, *args, **kwargs): # <<<<<<<<<<<<<< + * # The result dictionary: {index: value} + * self._results = {} + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("gevent.__imap.IMap.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_imap.py":200 + * IMapUnordered.__init__(self, *args, **kwargs) + * + * def _inext(self): # <<<<<<<<<<<<<< + * try: + * value = self._results.pop(self.index) + */ + +static PyObject *__pyx_f_6gevent_6__imap_4IMap__inext(struct __pyx_obj_6gevent_6__imap_IMap *__pyx_v_self) { + int __pyx_v_index; + PyObject *__pyx_v_value = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *(*__pyx_t_12)(PyObject *); + int __pyx_t_13; + __Pyx_RefNannySetupContext("_inext", 0); + + /* "src/gevent/_imap.py":201 + * + * def _inext(self): + * try: # <<<<<<<<<<<<<< + * value = self._results.pop(self.index) + * except KeyError: + */ + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "src/gevent/_imap.py":202 + * def _inext(self): + * try: + * value = self._results.pop(self.index) # <<<<<<<<<<<<<< + * except KeyError: + * # Wait for our index to finish. + */ + if (unlikely(__pyx_v_self->_results == Py_None)) { + PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "pop"); + __PYX_ERR(0, 202, __pyx_L3_error) + } + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_self->index); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 202, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyDict_Pop(__pyx_v_self->_results, __pyx_t_4, ((PyObject *)NULL)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 202, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_value = __pyx_t_5; + __pyx_t_5 = 0; + + /* "src/gevent/_imap.py":201 + * + * def _inext(self): + * try: # <<<<<<<<<<<<<< + * value = self._results.pop(self.index) + * except KeyError: + */ + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L8_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "src/gevent/_imap.py":203 + * try: + * value = self._results.pop(self.index) + * except KeyError: # <<<<<<<<<<<<<< + * # Wait for our index to finish. + * while 1: + */ + __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError); + if (__pyx_t_6) { + __Pyx_AddTraceback("gevent.__imap.IMap._inext", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_4, &__pyx_t_7) < 0) __PYX_ERR(0, 203, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_7); + + /* "src/gevent/_imap.py":205 + * except KeyError: + * # Wait for our index to finish. + * while 1: # <<<<<<<<<<<<<< + * index, value = self.queue.get() + * if index == self.index: + */ + while (1) { + + /* "src/gevent/_imap.py":206 + * # Wait for our index to finish. + * while 1: + * index, value = self.queue.get() # <<<<<<<<<<<<<< + * if index == self.index: + * break + */ + __pyx_t_8 = ((struct __pyx_vtabstruct_6gevent_6_queue_UnboundQueue *)__pyx_v_self->__pyx_base.queue->__pyx_base.__pyx_vtab)->__pyx_base.get(((struct __pyx_obj_6gevent_6_queue_Queue *)__pyx_v_self->__pyx_base.queue), 0, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 206, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_8); + if ((likely(PyTuple_CheckExact(__pyx_t_8))) || (PyList_CheckExact(__pyx_t_8))) { + PyObject* sequence = __pyx_t_8; + Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + __PYX_ERR(0, 206, __pyx_L5_except_error) + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_9 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_10 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_9 = PyList_GET_ITEM(sequence, 0); + __pyx_t_10 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_9); + __Pyx_INCREF(__pyx_t_10); + #else + __pyx_t_9 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 206, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 206, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_10); + #endif + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_11 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 206, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_12 = Py_TYPE(__pyx_t_11)->tp_iternext; + index = 0; __pyx_t_9 = __pyx_t_12(__pyx_t_11); if (unlikely(!__pyx_t_9)) goto __pyx_L13_unpacking_failed; + __Pyx_GOTREF(__pyx_t_9); + index = 1; __pyx_t_10 = __pyx_t_12(__pyx_t_11); if (unlikely(!__pyx_t_10)) goto __pyx_L13_unpacking_failed; + __Pyx_GOTREF(__pyx_t_10); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_11), 2) < 0) __PYX_ERR(0, 206, __pyx_L5_except_error) + __pyx_t_12 = NULL; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + goto __pyx_L14_unpacking_done; + __pyx_L13_unpacking_failed:; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_12 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + __PYX_ERR(0, 206, __pyx_L5_except_error) + __pyx_L14_unpacking_done:; + } + __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_t_9); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 206, __pyx_L5_except_error) + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_v_index = __pyx_t_6; + __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_10); + __pyx_t_10 = 0; + + /* "src/gevent/_imap.py":207 + * while 1: + * index, value = self.queue.get() + * if index == self.index: # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_t_13 = ((__pyx_v_index == __pyx_v_self->index) != 0); + if (__pyx_t_13) { + + /* "src/gevent/_imap.py":208 + * index, value = self.queue.get() + * if index == self.index: + * break # <<<<<<<<<<<<<< + * else: + * self._results[index] = value + */ + goto __pyx_L12_break; + + /* "src/gevent/_imap.py":207 + * while 1: + * index, value = self.queue.get() + * if index == self.index: # <<<<<<<<<<<<<< + * break + * else: + */ + } + + /* "src/gevent/_imap.py":210 + * break + * else: + * self._results[index] = value # <<<<<<<<<<<<<< + * self.index += 1 + * return value + */ + /*else*/ { + if (unlikely(__pyx_v_self->_results == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 210, __pyx_L5_except_error) + } + __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_index); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 210, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_8); + if (unlikely(PyDict_SetItem(__pyx_v_self->_results, __pyx_t_8, __pyx_v_value) < 0)) __PYX_ERR(0, 210, __pyx_L5_except_error) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + } + } + __pyx_L12_break:; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + + /* "src/gevent/_imap.py":201 + * + * def _inext(self): + * try: # <<<<<<<<<<<<<< + * value = self._results.pop(self.index) + * except KeyError: + */ + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L8_try_end:; + } + + /* "src/gevent/_imap.py":211 + * else: + * self._results[index] = value + * self.index += 1 # <<<<<<<<<<<<<< + * return value + * + */ + __pyx_v_self->index = (__pyx_v_self->index + 1); + + /* "src/gevent/_imap.py":212 + * self._results[index] = value + * self.index += 1 + * return value # <<<<<<<<<<<<<< + * + * def _iqueue_value_for_success(self, greenlet): + */ + __Pyx_XDECREF(__pyx_r); + if (unlikely(!__pyx_v_value)) { __Pyx_RaiseUnboundLocalError("value"); __PYX_ERR(0, 212, __pyx_L1_error) } + __Pyx_INCREF(__pyx_v_value); + __pyx_r = __pyx_v_value; + goto __pyx_L0; + + /* "src/gevent/_imap.py":200 + * IMapUnordered.__init__(self, *args, **kwargs) + * + * def _inext(self): # <<<<<<<<<<<<<< + * try: + * value = self._results.pop(self.index) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_AddTraceback("gevent.__imap.IMap._inext", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_value); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_imap.py":214 + * return value + * + * def _iqueue_value_for_success(self, greenlet): # <<<<<<<<<<<<<< + * return (greenlet._imap_task_index, IMapUnordered._iqueue_value_for_success(self, greenlet)) + * + */ + +static PyObject *__pyx_f_6gevent_6__imap_4IMap__iqueue_value_for_success(struct __pyx_obj_6gevent_6__imap_IMap *__pyx_v_self, PyObject *__pyx_v_greenlet) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("_iqueue_value_for_success", 0); + + /* "src/gevent/_imap.py":215 + * + * def _iqueue_value_for_success(self, greenlet): + * return (greenlet._imap_task_index, IMapUnordered._iqueue_value_for_success(self, greenlet)) # <<<<<<<<<<<<<< + * + * def _iqueue_value_for_failure(self, greenlet): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_greenlet, __pyx_n_s_imap_task_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 215, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __pyx_f_6gevent_6__imap_13IMapUnordered__iqueue_value_for_success(((struct __pyx_obj_6gevent_6__imap_IMapUnordered *)__pyx_v_self), __pyx_v_greenlet); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 215, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 215, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); + __pyx_t_1 = 0; + __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "src/gevent/_imap.py":214 + * return value + * + * def _iqueue_value_for_success(self, greenlet): # <<<<<<<<<<<<<< + * return (greenlet._imap_task_index, IMapUnordered._iqueue_value_for_success(self, greenlet)) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("gevent.__imap.IMap._iqueue_value_for_success", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_imap.py":217 + * return (greenlet._imap_task_index, IMapUnordered._iqueue_value_for_success(self, greenlet)) + * + * def _iqueue_value_for_failure(self, greenlet): # <<<<<<<<<<<<<< + * return (greenlet._imap_task_index, IMapUnordered._iqueue_value_for_failure(self, greenlet)) + * + */ + +static PyObject *__pyx_f_6gevent_6__imap_4IMap__iqueue_value_for_failure(struct __pyx_obj_6gevent_6__imap_IMap *__pyx_v_self, PyObject *__pyx_v_greenlet) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("_iqueue_value_for_failure", 0); + + /* "src/gevent/_imap.py":218 + * + * def _iqueue_value_for_failure(self, greenlet): + * return (greenlet._imap_task_index, IMapUnordered._iqueue_value_for_failure(self, greenlet)) # <<<<<<<<<<<<<< + * + * def _iqueue_value_for_self_finished(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_greenlet, __pyx_n_s_imap_task_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 218, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __pyx_f_6gevent_6__imap_13IMapUnordered__iqueue_value_for_failure(((struct __pyx_obj_6gevent_6__imap_IMapUnordered *)__pyx_v_self), __pyx_v_greenlet); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 218, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 218, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); + __pyx_t_1 = 0; + __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "src/gevent/_imap.py":217 + * return (greenlet._imap_task_index, IMapUnordered._iqueue_value_for_success(self, greenlet)) + * + * def _iqueue_value_for_failure(self, greenlet): # <<<<<<<<<<<<<< + * return (greenlet._imap_task_index, IMapUnordered._iqueue_value_for_failure(self, greenlet)) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("gevent.__imap.IMap._iqueue_value_for_failure", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_imap.py":220 + * return (greenlet._imap_task_index, IMapUnordered._iqueue_value_for_failure(self, greenlet)) + * + * def _iqueue_value_for_self_finished(self): # <<<<<<<<<<<<<< + * return (self._max_index + 1, IMapUnordered._iqueue_value_for_self_finished(self)) + * + */ + +static PyObject *__pyx_f_6gevent_6__imap_4IMap__iqueue_value_for_self_finished(struct __pyx_obj_6gevent_6__imap_IMap *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("_iqueue_value_for_self_finished", 0); + + /* "src/gevent/_imap.py":221 + * + * def _iqueue_value_for_self_finished(self): + * return (self._max_index + 1, IMapUnordered._iqueue_value_for_self_finished(self)) # <<<<<<<<<<<<<< + * + * def _iqueue_value_for_self_failure(self, exception): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_long((__pyx_v_self->__pyx_base._max_index + 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 221, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __pyx_f_6gevent_6__imap_13IMapUnordered__iqueue_value_for_self_finished(((struct __pyx_obj_6gevent_6__imap_IMapUnordered *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 221, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 221, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); + __pyx_t_1 = 0; + __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "src/gevent/_imap.py":220 + * return (greenlet._imap_task_index, IMapUnordered._iqueue_value_for_failure(self, greenlet)) + * + * def _iqueue_value_for_self_finished(self): # <<<<<<<<<<<<<< + * return (self._max_index + 1, IMapUnordered._iqueue_value_for_self_finished(self)) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("gevent.__imap.IMap._iqueue_value_for_self_finished", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_imap.py":223 + * return (self._max_index + 1, IMapUnordered._iqueue_value_for_self_finished(self)) + * + * def _iqueue_value_for_self_failure(self, exception): # <<<<<<<<<<<<<< + * return (self._max_index + 1, IMapUnordered._iqueue_value_for_self_failure(self, exception)) + * + */ + +static PyObject *__pyx_f_6gevent_6__imap_4IMap__iqueue_value_for_self_failure(struct __pyx_obj_6gevent_6__imap_IMap *__pyx_v_self, PyObject *__pyx_v_exception) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("_iqueue_value_for_self_failure", 0); + + /* "src/gevent/_imap.py":224 + * + * def _iqueue_value_for_self_failure(self, exception): + * return (self._max_index + 1, IMapUnordered._iqueue_value_for_self_failure(self, exception)) # <<<<<<<<<<<<<< + * + * from gevent._util import import_c_accel + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_long((__pyx_v_self->__pyx_base._max_index + 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 224, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __pyx_f_6gevent_6__imap_13IMapUnordered__iqueue_value_for_self_failure(((struct __pyx_obj_6gevent_6__imap_IMapUnordered *)__pyx_v_self), __pyx_v_exception); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 224, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 224, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); + __pyx_t_1 = 0; + __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "src/gevent/_imap.py":223 + * return (self._max_index + 1, IMapUnordered._iqueue_value_for_self_finished(self)) + * + * def _iqueue_value_for_self_failure(self, exception): # <<<<<<<<<<<<<< + * return (self._max_index + 1, IMapUnordered._iqueue_value_for_self_failure(self, exception)) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("gevent.__imap.IMap._iqueue_value_for_self_failure", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/__greenlet_primitives.pxd":23 + * + * @cython.final + * cdef inline greenlet getcurrent(): # <<<<<<<<<<<<<< + * return PyGreenlet_GetCurrent() + * + */ + +static CYTHON_INLINE PyGreenlet *__pyx_f_6gevent_21__greenlet_primitives_getcurrent(void) { + PyGreenlet *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("getcurrent", 0); + + /* "gevent/__greenlet_primitives.pxd":24 + * @cython.final + * cdef inline greenlet getcurrent(): + * return PyGreenlet_GetCurrent() # <<<<<<<<<<<<<< + * + * cdef bint _greenlet_imported + */ + __Pyx_XDECREF(((PyObject *)__pyx_r)); + __pyx_t_1 = ((PyObject *)PyGreenlet_GetCurrent()); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 24, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = ((PyGreenlet *)__pyx_t_1); + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "gevent/__greenlet_primitives.pxd":23 + * + * @cython.final + * cdef inline greenlet getcurrent(): # <<<<<<<<<<<<<< + * return PyGreenlet_GetCurrent() + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__greenlet_primitives.getcurrent", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF((PyObject *)__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/__greenlet_primitives.pxd":28 + * cdef bint _greenlet_imported + * + * cdef inline void greenlet_init(): # <<<<<<<<<<<<<< + * global _greenlet_imported + * if not _greenlet_imported: + */ + +static CYTHON_INLINE void __pyx_f_6gevent_21__greenlet_primitives_greenlet_init(void) { + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("greenlet_init", 0); + + /* "gevent/__greenlet_primitives.pxd":30 + * cdef inline void greenlet_init(): + * global _greenlet_imported + * if not _greenlet_imported: # <<<<<<<<<<<<<< + * PyGreenlet_Import() + * _greenlet_imported = True + */ + __pyx_t_1 = ((!(__pyx_v_6gevent_21__greenlet_primitives__greenlet_imported != 0)) != 0); + if (__pyx_t_1) { + + /* "gevent/__greenlet_primitives.pxd":31 + * global _greenlet_imported + * if not _greenlet_imported: + * PyGreenlet_Import() # <<<<<<<<<<<<<< + * _greenlet_imported = True + * + */ + PyGreenlet_Import(); + + /* "gevent/__greenlet_primitives.pxd":32 + * if not _greenlet_imported: + * PyGreenlet_Import() + * _greenlet_imported = True # <<<<<<<<<<<<<< + * + * cdef inline object _greenlet_switch(greenlet self): + */ + __pyx_v_6gevent_21__greenlet_primitives__greenlet_imported = 1; + + /* "gevent/__greenlet_primitives.pxd":30 + * cdef inline void greenlet_init(): + * global _greenlet_imported + * if not _greenlet_imported: # <<<<<<<<<<<<<< + * PyGreenlet_Import() + * _greenlet_imported = True + */ + } + + /* "gevent/__greenlet_primitives.pxd":28 + * cdef bint _greenlet_imported + * + * cdef inline void greenlet_init(): # <<<<<<<<<<<<<< + * global _greenlet_imported + * if not _greenlet_imported: + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "gevent/__greenlet_primitives.pxd":34 + * _greenlet_imported = True + * + * cdef inline object _greenlet_switch(greenlet self): # <<<<<<<<<<<<<< + * return PyGreenlet_Switch(self, NULL, NULL) + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_6gevent_21__greenlet_primitives__greenlet_switch(PyGreenlet *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("_greenlet_switch", 0); + + /* "gevent/__greenlet_primitives.pxd":35 + * + * cdef inline object _greenlet_switch(greenlet self): + * return PyGreenlet_Switch(self, NULL, NULL) # <<<<<<<<<<<<<< + * + * cdef class TrackedRawGreenlet(greenlet): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyGreenlet_Switch(__pyx_v_self, NULL, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 35, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "gevent/__greenlet_primitives.pxd":34 + * _greenlet_imported = True + * + * cdef inline object _greenlet_switch(greenlet self): # <<<<<<<<<<<<<< + * return PyGreenlet_Switch(self, NULL, NULL) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__greenlet_primitives._greenlet_switch", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/__waiter.pxd":24 + * void PyGreenlet_Import() + * + * cdef inline greenlet getcurrent(): # <<<<<<<<<<<<<< + * return PyGreenlet_GetCurrent() + * + */ + +static CYTHON_INLINE PyGreenlet *__pyx_f_6gevent_8__waiter_getcurrent(void) { + PyGreenlet *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("getcurrent", 0); + + /* "gevent/__waiter.pxd":25 + * + * cdef inline greenlet getcurrent(): + * return PyGreenlet_GetCurrent() # <<<<<<<<<<<<<< + * + * cdef inline void greenlet_init(): + */ + __Pyx_XDECREF(((PyObject *)__pyx_r)); + __pyx_t_1 = ((PyObject *)PyGreenlet_GetCurrent()); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 25, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = ((PyGreenlet *)__pyx_t_1); + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "gevent/__waiter.pxd":24 + * void PyGreenlet_Import() + * + * cdef inline greenlet getcurrent(): # <<<<<<<<<<<<<< + * return PyGreenlet_GetCurrent() + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__waiter.getcurrent", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF((PyObject *)__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/__waiter.pxd":27 + * return PyGreenlet_GetCurrent() + * + * cdef inline void greenlet_init(): # <<<<<<<<<<<<<< + * global _greenlet_imported + * if not _greenlet_imported: + */ + +static CYTHON_INLINE void __pyx_f_6gevent_8__waiter_greenlet_init(void) { + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("greenlet_init", 0); + + /* "gevent/__waiter.pxd":29 + * cdef inline void greenlet_init(): + * global _greenlet_imported + * if not _greenlet_imported: # <<<<<<<<<<<<<< + * PyGreenlet_Import() + * _greenlet_imported = True + */ + __pyx_t_1 = ((!(__pyx_v_6gevent_8__waiter__greenlet_imported != 0)) != 0); + if (__pyx_t_1) { + + /* "gevent/__waiter.pxd":30 + * global _greenlet_imported + * if not _greenlet_imported: + * PyGreenlet_Import() # <<<<<<<<<<<<<< + * _greenlet_imported = True + * + */ + PyGreenlet_Import(); + + /* "gevent/__waiter.pxd":31 + * if not _greenlet_imported: + * PyGreenlet_Import() + * _greenlet_imported = True # <<<<<<<<<<<<<< + * + * cdef class Waiter: + */ + __pyx_v_6gevent_8__waiter__greenlet_imported = 1; + + /* "gevent/__waiter.pxd":29 + * cdef inline void greenlet_init(): + * global _greenlet_imported + * if not _greenlet_imported: # <<<<<<<<<<<<<< + * PyGreenlet_Import() + * _greenlet_imported = True + */ + } + + /* "gevent/__waiter.pxd":27 + * return PyGreenlet_GetCurrent() + * + * cdef inline void greenlet_init(): # <<<<<<<<<<<<<< + * global _greenlet_imported + * if not _greenlet_imported: + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "gevent/_greenlet.pxd":27 + * + * @cython.final + * cdef inline greenlet getcurrent(): # <<<<<<<<<<<<<< + * return PyGreenlet_GetCurrent() + * + */ + +static CYTHON_INLINE PyGreenlet *__pyx_f_6gevent_9_greenlet_getcurrent(void) { + PyGreenlet *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("getcurrent", 0); + + /* "gevent/_greenlet.pxd":28 + * @cython.final + * cdef inline greenlet getcurrent(): + * return PyGreenlet_GetCurrent() # <<<<<<<<<<<<<< + * + * cdef bint _greenlet_imported + */ + __Pyx_XDECREF(((PyObject *)__pyx_r)); + __pyx_t_1 = ((PyObject *)PyGreenlet_GetCurrent()); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 28, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = ((PyGreenlet *)__pyx_t_1); + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "gevent/_greenlet.pxd":27 + * + * @cython.final + * cdef inline greenlet getcurrent(): # <<<<<<<<<<<<<< + * return PyGreenlet_GetCurrent() + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent._greenlet.getcurrent", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF((PyObject *)__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/_greenlet.pxd":32 + * cdef bint _greenlet_imported + * + * cdef inline void greenlet_init(): # <<<<<<<<<<<<<< + * global _greenlet_imported + * if not _greenlet_imported: + */ + +static CYTHON_INLINE void __pyx_f_6gevent_9_greenlet_greenlet_init(void) { + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("greenlet_init", 0); + + /* "gevent/_greenlet.pxd":34 + * cdef inline void greenlet_init(): + * global _greenlet_imported + * if not _greenlet_imported: # <<<<<<<<<<<<<< + * PyGreenlet_Import() + * _greenlet_imported = True + */ + __pyx_t_1 = ((!(__pyx_v_6gevent_9_greenlet__greenlet_imported != 0)) != 0); + if (__pyx_t_1) { + + /* "gevent/_greenlet.pxd":35 + * global _greenlet_imported + * if not _greenlet_imported: + * PyGreenlet_Import() # <<<<<<<<<<<<<< + * _greenlet_imported = True + * + */ + PyGreenlet_Import(); + + /* "gevent/_greenlet.pxd":36 + * if not _greenlet_imported: + * PyGreenlet_Import() + * _greenlet_imported = True # <<<<<<<<<<<<<< + * + * cdef extern from "Python.h": + */ + __pyx_v_6gevent_9_greenlet__greenlet_imported = 1; + + /* "gevent/_greenlet.pxd":34 + * cdef inline void greenlet_init(): + * global _greenlet_imported + * if not _greenlet_imported: # <<<<<<<<<<<<<< + * PyGreenlet_Import() + * _greenlet_imported = True + */ + } + + /* "gevent/_greenlet.pxd":32 + * cdef bint _greenlet_imported + * + * cdef inline void greenlet_init(): # <<<<<<<<<<<<<< + * global _greenlet_imported + * if not _greenlet_imported: + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "gevent/__abstract_linkable.pxd":21 + * void PyGreenlet_Import() + * + * cdef inline greenlet getcurrent(): # <<<<<<<<<<<<<< + * return PyGreenlet_GetCurrent() + * + */ + +static CYTHON_INLINE PyGreenlet *__pyx_f_6gevent_19__abstract_linkable_getcurrent(void) { + PyGreenlet *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("getcurrent", 0); + + /* "gevent/__abstract_linkable.pxd":22 + * + * cdef inline greenlet getcurrent(): + * return PyGreenlet_GetCurrent() # <<<<<<<<<<<<<< + * + * cdef inline void greenlet_init(): + */ + __Pyx_XDECREF(((PyObject *)__pyx_r)); + __pyx_t_1 = ((PyObject *)PyGreenlet_GetCurrent()); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 22, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = ((PyGreenlet *)__pyx_t_1); + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "gevent/__abstract_linkable.pxd":21 + * void PyGreenlet_Import() + * + * cdef inline greenlet getcurrent(): # <<<<<<<<<<<<<< + * return PyGreenlet_GetCurrent() + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__abstract_linkable.getcurrent", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF((PyObject *)__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/__abstract_linkable.pxd":24 + * return PyGreenlet_GetCurrent() + * + * cdef inline void greenlet_init(): # <<<<<<<<<<<<<< + * global _greenlet_imported + * if not _greenlet_imported: + */ + +static CYTHON_INLINE void __pyx_f_6gevent_19__abstract_linkable_greenlet_init(void) { + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("greenlet_init", 0); + + /* "gevent/__abstract_linkable.pxd":26 + * cdef inline void greenlet_init(): + * global _greenlet_imported + * if not _greenlet_imported: # <<<<<<<<<<<<<< + * PyGreenlet_Import() + * _greenlet_imported = True + */ + __pyx_t_1 = ((!(__pyx_v_6gevent_19__abstract_linkable__greenlet_imported != 0)) != 0); + if (__pyx_t_1) { + + /* "gevent/__abstract_linkable.pxd":27 + * global _greenlet_imported + * if not _greenlet_imported: + * PyGreenlet_Import() # <<<<<<<<<<<<<< + * _greenlet_imported = True + * + */ + PyGreenlet_Import(); + + /* "gevent/__abstract_linkable.pxd":28 + * if not _greenlet_imported: + * PyGreenlet_Import() + * _greenlet_imported = True # <<<<<<<<<<<<<< + * + * cdef void _init() + */ + __pyx_v_6gevent_19__abstract_linkable__greenlet_imported = 1; + + /* "gevent/__abstract_linkable.pxd":26 + * cdef inline void greenlet_init(): + * global _greenlet_imported + * if not _greenlet_imported: # <<<<<<<<<<<<<< + * PyGreenlet_Import() + * _greenlet_imported = True + */ + } + + /* "gevent/__abstract_linkable.pxd":24 + * return PyGreenlet_GetCurrent() + * + * cdef inline void greenlet_init(): # <<<<<<<<<<<<<< + * global _greenlet_imported + * if not _greenlet_imported: + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +static PyObject *__pyx_tp_new_6gevent_6__imap_Failure(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + struct __pyx_obj_6gevent_6__imap_Failure *p; + PyObject *o; + o = (*t->tp_alloc)(t, 0); + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_6gevent_6__imap_Failure *)o); + p->exc = Py_None; Py_INCREF(Py_None); + p->raise_exception = Py_None; Py_INCREF(Py_None); + return o; +} + +static void __pyx_tp_dealloc_6gevent_6__imap_Failure(PyObject *o) { + struct __pyx_obj_6gevent_6__imap_Failure *p = (struct __pyx_obj_6gevent_6__imap_Failure *)o; + PyObject_GC_UnTrack(o); + Py_CLEAR(p->exc); + Py_CLEAR(p->raise_exception); + (*Py_TYPE(o)->tp_free)(o); +} + +static int __pyx_tp_traverse_6gevent_6__imap_Failure(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_6gevent_6__imap_Failure *p = (struct __pyx_obj_6gevent_6__imap_Failure *)o; + if (p->exc) { + e = (*v)(p->exc, a); if (e) return e; + } + if (p->raise_exception) { + e = (*v)(p->raise_exception, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_6gevent_6__imap_Failure(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_6gevent_6__imap_Failure *p = (struct __pyx_obj_6gevent_6__imap_Failure *)o; + tmp = ((PyObject*)p->exc); + p->exc = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->raise_exception); + p->raise_exception = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyObject *__pyx_getprop_6gevent_6__imap_7Failure_exc(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_6__imap_7Failure_3exc_1__get__(o); +} + +static PyMethodDef __pyx_methods_6gevent_6__imap_Failure[] = { + {0, 0, 0, 0} +}; + +static struct PyGetSetDef __pyx_getsets_6gevent_6__imap_Failure[] = { + {(char *)"exc", __pyx_getprop_6gevent_6__imap_7Failure_exc, 0, (char *)0, 0}, + {0, 0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_6gevent_6__imap_Failure = { + PyVarObject_HEAD_INIT(0, 0) + "gevent.__imap.Failure", /*tp_name*/ + sizeof(struct __pyx_obj_6gevent_6__imap_Failure), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6gevent_6__imap_Failure, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + "Failure(exc, raise_exception=None)", /*tp_doc*/ + __pyx_tp_traverse_6gevent_6__imap_Failure, /*tp_traverse*/ + __pyx_tp_clear_6gevent_6__imap_Failure, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6gevent_6__imap_Failure, /*tp_methods*/ + 0, /*tp_members*/ + __pyx_getsets_6gevent_6__imap_Failure, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_pw_6gevent_6__imap_7Failure_1__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6gevent_6__imap_Failure, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; +static struct __pyx_vtabstruct_6gevent_6__imap_IMapUnordered __pyx_vtable_6gevent_6__imap_IMapUnordered; + +static PyObject *__pyx_tp_new_6gevent_6__imap_IMapUnordered(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_6gevent_6__imap_IMapUnordered *p; + PyObject *o = __pyx_ptype_6gevent_9_greenlet_Greenlet->tp_new(t, a, k); + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_6gevent_6__imap_IMapUnordered *)o); + p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_6gevent_9_greenlet_Greenlet*)__pyx_vtabptr_6gevent_6__imap_IMapUnordered; + p->func = Py_None; Py_INCREF(Py_None); + p->iterable = Py_None; Py_INCREF(Py_None); + p->spawn = Py_None; Py_INCREF(Py_None); + p->_result_semaphore = ((struct __pyx_obj_6gevent_11__semaphore_Semaphore *)Py_None); Py_INCREF(Py_None); + p->queue = ((struct __pyx_obj_6gevent_6_queue_UnboundQueue *)Py_None); Py_INCREF(Py_None); + return o; +} + +static void __pyx_tp_dealloc_6gevent_6__imap_IMapUnordered(PyObject *o) { + struct __pyx_obj_6gevent_6__imap_IMapUnordered *p = (struct __pyx_obj_6gevent_6__imap_IMapUnordered *)o; + #if CYTHON_USE_TP_FINALIZE + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + PyObject_GC_UnTrack(o); + Py_CLEAR(p->func); + Py_CLEAR(p->iterable); + Py_CLEAR(p->spawn); + Py_CLEAR(p->_result_semaphore); + Py_CLEAR(p->queue); + PyObject_GC_Track(o); + if (likely(__pyx_ptype_6gevent_9_greenlet_Greenlet)) __pyx_ptype_6gevent_9_greenlet_Greenlet->tp_dealloc(o); else __Pyx_call_next_tp_dealloc(o, __pyx_tp_dealloc_6gevent_6__imap_IMapUnordered); +} + +static int __pyx_tp_traverse_6gevent_6__imap_IMapUnordered(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_6gevent_6__imap_IMapUnordered *p = (struct __pyx_obj_6gevent_6__imap_IMapUnordered *)o; + e = ((likely(__pyx_ptype_6gevent_9_greenlet_Greenlet)) ? ((__pyx_ptype_6gevent_9_greenlet_Greenlet->tp_traverse) ? __pyx_ptype_6gevent_9_greenlet_Greenlet->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_6gevent_6__imap_IMapUnordered)); if (e) return e; + if (p->func) { + e = (*v)(p->func, a); if (e) return e; + } + if (p->iterable) { + e = (*v)(p->iterable, a); if (e) return e; + } + if (p->spawn) { + e = (*v)(p->spawn, a); if (e) return e; + } + if (p->_result_semaphore) { + e = (*v)(((PyObject *)p->_result_semaphore), a); if (e) return e; + } + if (p->queue) { + e = (*v)(((PyObject *)p->queue), a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_6gevent_6__imap_IMapUnordered(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_6gevent_6__imap_IMapUnordered *p = (struct __pyx_obj_6gevent_6__imap_IMapUnordered *)o; + if (likely(__pyx_ptype_6gevent_9_greenlet_Greenlet)) { if (__pyx_ptype_6gevent_9_greenlet_Greenlet->tp_clear) __pyx_ptype_6gevent_9_greenlet_Greenlet->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_6gevent_6__imap_IMapUnordered); + tmp = ((PyObject*)p->func); + p->func = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->iterable); + p->iterable = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->spawn); + p->spawn = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->_result_semaphore); + p->_result_semaphore = ((struct __pyx_obj_6gevent_11__semaphore_Semaphore *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->queue); + p->queue = ((struct __pyx_obj_6gevent_6_queue_UnboundQueue *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyObject *__pyx_getprop_6gevent_6__imap_13IMapUnordered_queue(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_6__imap_13IMapUnordered_5queue_1__get__(o); +} + +static PyObject *__pyx_getprop_6gevent_6__imap_13IMapUnordered_finished(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_6__imap_13IMapUnordered_8finished_1__get__(o); +} + +static PyObject *__pyx_specialmethod___pyx_pw_6gevent_6__imap_13IMapUnordered_5__next__(PyObject *self, CYTHON_UNUSED PyObject *arg) {return __pyx_pw_6gevent_6__imap_13IMapUnordered_5__next__(self);} + +static PyMethodDef __pyx_methods_6gevent_6__imap_IMapUnordered[] = { + {"__next__", (PyCFunction)__pyx_specialmethod___pyx_pw_6gevent_6__imap_13IMapUnordered_5__next__, METH_NOARGS|METH_COEXIST, 0}, + {"_run", (PyCFunction)__pyx_pw_6gevent_6__imap_13IMapUnordered_7_run, METH_NOARGS, __pyx_doc_6gevent_6__imap_13IMapUnordered_6_run}, + {0, 0, 0, 0} +}; + +static struct PyGetSetDef __pyx_getsets_6gevent_6__imap_IMapUnordered[] = { + {(char *)"queue", __pyx_getprop_6gevent_6__imap_13IMapUnordered_queue, 0, (char *)0, 0}, + {(char *)"finished", __pyx_getprop_6gevent_6__imap_13IMapUnordered_finished, 0, (char *)0, 0}, + {0, 0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_6gevent_6__imap_IMapUnordered = { + PyVarObject_HEAD_INIT(0, 0) + "gevent.__imap.IMapUnordered", /*tp_name*/ + sizeof(struct __pyx_obj_6gevent_6__imap_IMapUnordered), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6gevent_6__imap_IMapUnordered, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + "IMapUnordered(func, iterable, spawn, maxsize=None, _zipped=False)\n\n At iterator of map results.\n ", /*tp_doc*/ + __pyx_tp_traverse_6gevent_6__imap_IMapUnordered, /*tp_traverse*/ + __pyx_tp_clear_6gevent_6__imap_IMapUnordered, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + __pyx_pw_6gevent_6__imap_13IMapUnordered_3__iter__, /*tp_iter*/ + __pyx_pw_6gevent_6__imap_13IMapUnordered_5__next__, /*tp_iternext*/ + __pyx_methods_6gevent_6__imap_IMapUnordered, /*tp_methods*/ + 0, /*tp_members*/ + __pyx_getsets_6gevent_6__imap_IMapUnordered, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_pw_6gevent_6__imap_13IMapUnordered_1__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6gevent_6__imap_IMapUnordered, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; +static struct __pyx_vtabstruct_6gevent_6__imap_IMap __pyx_vtable_6gevent_6__imap_IMap; + +static PyObject *__pyx_tp_new_6gevent_6__imap_IMap(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_6gevent_6__imap_IMap *p; + PyObject *o = __pyx_tp_new_6gevent_6__imap_IMapUnordered(t, a, k); + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_6gevent_6__imap_IMap *)o); + p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_6gevent_9_greenlet_Greenlet*)__pyx_vtabptr_6gevent_6__imap_IMap; + p->_results = ((PyObject*)Py_None); Py_INCREF(Py_None); + return o; +} + +static void __pyx_tp_dealloc_6gevent_6__imap_IMap(PyObject *o) { + struct __pyx_obj_6gevent_6__imap_IMap *p = (struct __pyx_obj_6gevent_6__imap_IMap *)o; + #if CYTHON_USE_TP_FINALIZE + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + PyObject_GC_UnTrack(o); + Py_CLEAR(p->_results); + PyObject_GC_Track(o); + __pyx_tp_dealloc_6gevent_6__imap_IMapUnordered(o); +} + +static int __pyx_tp_traverse_6gevent_6__imap_IMap(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_6gevent_6__imap_IMap *p = (struct __pyx_obj_6gevent_6__imap_IMap *)o; + e = __pyx_tp_traverse_6gevent_6__imap_IMapUnordered(o, v, a); if (e) return e; + if (p->_results) { + e = (*v)(p->_results, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_6gevent_6__imap_IMap(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_6gevent_6__imap_IMap *p = (struct __pyx_obj_6gevent_6__imap_IMap *)o; + __pyx_tp_clear_6gevent_6__imap_IMapUnordered(o); + tmp = ((PyObject*)p->_results); + p->_results = ((PyObject*)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyMethodDef __pyx_methods_6gevent_6__imap_IMap[] = { + {0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_6gevent_6__imap_IMap = { + PyVarObject_HEAD_INIT(0, 0) + "gevent.__imap.IMap", /*tp_name*/ + sizeof(struct __pyx_obj_6gevent_6__imap_IMap), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6gevent_6__imap_IMap, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + "IMap(*args, **kwargs)", /*tp_doc*/ + __pyx_tp_traverse_6gevent_6__imap_IMap, /*tp_traverse*/ + __pyx_tp_clear_6gevent_6__imap_IMap, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_6gevent_6__imap_13IMapUnordered_3__iter__, /*tp_iter*/ + #else + 0, /*tp_iter*/ + #endif + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_6gevent_6__imap_13IMapUnordered_5__next__, /*tp_iternext*/ + #else + 0, /*tp_iternext*/ + #endif + __pyx_methods_6gevent_6__imap_IMap, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_pw_6gevent_6__imap_4IMap_1__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6gevent_6__imap_IMap, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static PyMethodDef __pyx_methods[] = { + {0, 0, 0, 0} +}; + +#if PY_MAJOR_VERSION >= 3 +#if CYTHON_PEP489_MULTI_PHASE_INIT +static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ +static int __pyx_pymod_exec___imap(PyObject* module); /*proto*/ +static PyModuleDef_Slot __pyx_moduledef_slots[] = { + {Py_mod_create, (void*)__pyx_pymod_create}, + {Py_mod_exec, (void*)__pyx_pymod_exec___imap}, + {0, NULL} +}; +#endif + +static struct PyModuleDef __pyx_moduledef = { + PyModuleDef_HEAD_INIT, + "__imap", + __pyx_k_Iterators_across_greenlets_or_A, /* m_doc */ + #if CYTHON_PEP489_MULTI_PHASE_INIT + 0, /* m_size */ + #else + -1, /* m_size */ + #endif + __pyx_methods /* m_methods */, + #if CYTHON_PEP489_MULTI_PHASE_INIT + __pyx_moduledef_slots, /* m_slots */ + #else + NULL, /* m_reload */ + #endif + NULL, /* m_traverse */ + NULL, /* m_clear */ + NULL /* m_free */ +}; +#endif +#ifndef CYTHON_SMALL_CODE +#if defined(__clang__) + #define CYTHON_SMALL_CODE +#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) + #define CYTHON_SMALL_CODE __attribute__((cold)) +#else + #define CYTHON_SMALL_CODE +#endif +#endif + +static __Pyx_StringTabEntry __pyx_string_tab[] = { + {&__pyx_n_s_BaseException, __pyx_k_BaseException, sizeof(__pyx_k_BaseException), 0, 0, 1, 1}, + {&__pyx_n_s_Failure, __pyx_k_Failure, sizeof(__pyx_k_Failure), 0, 0, 1, 1}, + {&__pyx_n_s_Greenlet, __pyx_k_Greenlet, sizeof(__pyx_k_Greenlet), 0, 0, 1, 1}, + {&__pyx_n_s_IMap, __pyx_k_IMap, sizeof(__pyx_k_IMap), 0, 0, 1, 1}, + {&__pyx_n_s_IMapUnordered, __pyx_k_IMapUnordered, sizeof(__pyx_k_IMapUnordered), 0, 0, 1, 1}, + {&__pyx_n_s_IMapUnordered__on_result, __pyx_k_IMapUnordered__on_result, sizeof(__pyx_k_IMapUnordered__on_result), 0, 0, 1, 1}, + {&__pyx_n_s_IMapUnordered__run, __pyx_k_IMapUnordered__run, sizeof(__pyx_k_IMapUnordered__run), 0, 0, 1, 1}, + {&__pyx_n_s_KeyError, __pyx_k_KeyError, sizeof(__pyx_k_KeyError), 0, 0, 1, 1}, + {&__pyx_n_s_Semaphore, __pyx_k_Semaphore, sizeof(__pyx_k_Semaphore), 0, 0, 1, 1}, + {&__pyx_n_s_StopIteration, __pyx_k_StopIteration, sizeof(__pyx_k_StopIteration), 0, 0, 1, 1}, + {&__pyx_n_s_UnboundQueue, __pyx_k_UnboundQueue, sizeof(__pyx_k_UnboundQueue), 0, 0, 1, 1}, + {&__pyx_n_s_all, __pyx_k_all, sizeof(__pyx_k_all), 0, 0, 1, 1}, + {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, + {&__pyx_n_s_e, __pyx_k_e, sizeof(__pyx_k_e), 0, 0, 1, 1}, + {&__pyx_n_s_exc, __pyx_k_exc, sizeof(__pyx_k_exc), 0, 0, 1, 1}, + {&__pyx_n_s_exception, __pyx_k_exception, sizeof(__pyx_k_exception), 0, 0, 1, 1}, + {&__pyx_n_s_func, __pyx_k_func, sizeof(__pyx_k_func), 0, 0, 1, 1}, + {&__pyx_n_s_gevent, __pyx_k_gevent, sizeof(__pyx_k_gevent), 0, 0, 1, 1}, + {&__pyx_n_s_gevent___imap, __pyx_k_gevent___imap, sizeof(__pyx_k_gevent___imap), 0, 0, 1, 1}, + {&__pyx_n_s_gevent__util, __pyx_k_gevent__util, sizeof(__pyx_k_gevent__util), 0, 0, 1, 1}, + {&__pyx_n_s_greenlet, __pyx_k_greenlet, sizeof(__pyx_k_greenlet), 0, 0, 1, 1}, + {&__pyx_n_s_imap_task_index, __pyx_k_imap_task_index, sizeof(__pyx_k_imap_task_index), 0, 0, 1, 1}, + {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, + {&__pyx_n_s_import_c_accel, __pyx_k_import_c_accel, sizeof(__pyx_k_import_c_accel), 0, 0, 1, 1}, + {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1}, + {&__pyx_n_s_item, __pyx_k_item, sizeof(__pyx_k_item), 0, 0, 1, 1}, + {&__pyx_n_s_iterable, __pyx_k_iterable, sizeof(__pyx_k_iterable), 0, 0, 1, 1}, + {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, + {&__pyx_n_s_maxsize, __pyx_k_maxsize, sizeof(__pyx_k_maxsize), 0, 0, 1, 1}, + {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, + {&__pyx_n_s_next, __pyx_k_next, sizeof(__pyx_k_next), 0, 0, 1, 1}, + {&__pyx_n_s_next_2, __pyx_k_next_2, sizeof(__pyx_k_next_2), 0, 0, 1, 1}, + {&__pyx_n_s_on_result, __pyx_k_on_result, sizeof(__pyx_k_on_result), 0, 0, 1, 1}, + {&__pyx_n_s_pop, __pyx_k_pop, sizeof(__pyx_k_pop), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1}, + {&__pyx_n_s_queue, __pyx_k_queue, sizeof(__pyx_k_queue), 0, 0, 1, 1}, + {&__pyx_n_s_raise_exception, __pyx_k_raise_exception, sizeof(__pyx_k_raise_exception), 0, 0, 1, 1}, + {&__pyx_n_s_raise_exception_2, __pyx_k_raise_exception_2, sizeof(__pyx_k_raise_exception_2), 0, 0, 1, 1}, + {&__pyx_n_s_rawlink, __pyx_k_rawlink, sizeof(__pyx_k_rawlink), 0, 0, 1, 1}, + {&__pyx_n_s_run, __pyx_k_run, sizeof(__pyx_k_run), 0, 0, 1, 1}, + {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1}, + {&__pyx_n_s_semaphore, __pyx_k_semaphore, sizeof(__pyx_k_semaphore), 0, 0, 1, 1}, + {&__pyx_n_s_slots, __pyx_k_slots, sizeof(__pyx_k_slots), 0, 0, 1, 1}, + {&__pyx_n_s_spawn, __pyx_k_spawn, sizeof(__pyx_k_spawn), 0, 0, 1, 1}, + {&__pyx_kp_s_src_gevent__imap_py, __pyx_k_src_gevent__imap_py, sizeof(__pyx_k_src_gevent__imap_py), 0, 0, 1, 0}, + {&__pyx_n_s_successful, __pyx_k_successful, sizeof(__pyx_k_successful), 0, 0, 1, 1}, + {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, + {&__pyx_n_s_value, __pyx_k_value, sizeof(__pyx_k_value), 0, 0, 1, 1}, + {&__pyx_n_s_zipped, __pyx_k_zipped, sizeof(__pyx_k_zipped), 0, 0, 1, 1}, + {0, 0, 0, 0, 0, 0, 0} +}; +static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { + __pyx_builtin___import__ = __Pyx_GetBuiltinName(__pyx_n_s_import); if (!__pyx_builtin___import__) __PYX_ERR(0, 23, __pyx_L1_error) + __pyx_builtin_BaseException = __Pyx_GetBuiltinName(__pyx_n_s_BaseException); if (!__pyx_builtin_BaseException) __PYX_ERR(0, 131, __pyx_L1_error) + __pyx_builtin_StopIteration = __Pyx_GetBuiltinName(__pyx_n_s_StopIteration); if (!__pyx_builtin_StopIteration) __PYX_ERR(0, 181, __pyx_L1_error) + __pyx_builtin_KeyError = __Pyx_GetBuiltinName(__pyx_n_s_KeyError); if (!__pyx_builtin_KeyError) __PYX_ERR(0, 203, __pyx_L1_error) + return 0; + __pyx_L1_error:; + return -1; +} + +static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); + + /* "src/gevent/_imap.py":23 + * ] + * + * locals()['Greenlet'] = __import__('gevent').Greenlet # <<<<<<<<<<<<<< + * locals()['Semaphore'] = _semaphore.Semaphore + * locals()['UnboundQueue'] = queue.UnboundQueue + */ + __pyx_tuple_ = PyTuple_Pack(1, __pyx_n_s_gevent); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 23, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple_); + __Pyx_GIVEREF(__pyx_tuple_); + + /* "src/gevent/_imap.py":29 + * + * class Failure(object): + * __slots__ = ('exc', 'raise_exception') # <<<<<<<<<<<<<< + * + * def __init__(self, exc, raise_exception=None): + */ + __pyx_tuple__2 = PyTuple_Pack(2, __pyx_n_s_exc, __pyx_n_s_raise_exception); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 29, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2); + __Pyx_GIVEREF(__pyx_tuple__2); + + /* "src/gevent/_imap.py":124 + * return g + * + * def _run(self): # pylint:disable=method-hidden # <<<<<<<<<<<<<< + * try: + * func = self.func + */ + __pyx_tuple__3 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_func, __pyx_n_s_item, __pyx_n_s_e); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 124, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__3); + __Pyx_GIVEREF(__pyx_tuple__3); + __pyx_codeobj__4 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__3, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__imap_py, __pyx_n_s_run, 124, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__4)) __PYX_ERR(0, 124, __pyx_L1_error) + + /* "src/gevent/_imap.py":140 + * self._result_semaphore = None + * + * def _on_result(self, greenlet): # <<<<<<<<<<<<<< + * # This method will be called in the hub greenlet (we rawlink) + * self._outstanding_tasks -= 1 + */ + __pyx_tuple__5 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_greenlet); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 140, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__5); + __Pyx_GIVEREF(__pyx_tuple__5); + __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__5, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__imap_py, __pyx_n_s_on_result, 140, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__6)) __PYX_ERR(0, 140, __pyx_L1_error) + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} + +static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { + __pyx_umethod_PyDict_Type_pop.type = (PyObject*)&PyDict_Type; + if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + return 0; + __pyx_L1_error:; + return -1; +} + +static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/ + +static int __Pyx_modinit_global_init_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); + /*--- Global init code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_variable_export_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); + /*--- Variable export code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_function_export_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); + /*--- Function export code ---*/ + if (__Pyx_ExportFunction("_raise_exc", (void (*)(void))__pyx_f_6gevent_6__imap__raise_exc, "PyObject *(struct __pyx_obj_6gevent_6__imap_Failure *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_modinit_type_init_code(void) { + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); + /*--- Type init code ---*/ + if (PyType_Ready(&__pyx_type_6gevent_6__imap_Failure) < 0) __PYX_ERR(0, 28, __pyx_L1_error) + __pyx_type_6gevent_6__imap_Failure.tp_print = 0; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6gevent_6__imap_Failure.tp_dictoffset && __pyx_type_6gevent_6__imap_Failure.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_type_6gevent_6__imap_Failure.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + } + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Failure, (PyObject *)&__pyx_type_6gevent_6__imap_Failure) < 0) __PYX_ERR(0, 28, __pyx_L1_error) + __pyx_ptype_6gevent_6__imap_Failure = &__pyx_type_6gevent_6__imap_Failure; + __pyx_t_1 = PyImport_ImportModule("gevent._greenlet"); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_ptype_6gevent_9_greenlet_Greenlet = __Pyx_ImportType(__pyx_t_1, "gevent._greenlet", "Greenlet", sizeof(struct __pyx_obj_6gevent_9_greenlet_Greenlet), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_9_greenlet_Greenlet) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_vtabptr_6gevent_9_greenlet_Greenlet = (struct __pyx_vtabstruct_6gevent_9_greenlet_Greenlet*)__Pyx_GetVtable(__pyx_ptype_6gevent_9_greenlet_Greenlet->tp_dict); if (unlikely(!__pyx_vtabptr_6gevent_9_greenlet_Greenlet)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_vtabptr_6gevent_6__imap_IMapUnordered = &__pyx_vtable_6gevent_6__imap_IMapUnordered; + __pyx_vtable_6gevent_6__imap_IMapUnordered.__pyx_base = *__pyx_vtabptr_6gevent_9_greenlet_Greenlet; + __pyx_vtable_6gevent_6__imap_IMapUnordered._inext = (PyObject *(*)(struct __pyx_obj_6gevent_6__imap_IMapUnordered *))__pyx_f_6gevent_6__imap_13IMapUnordered__inext; + __pyx_vtable_6gevent_6__imap_IMapUnordered._ispawn = (PyObject *(*)(struct __pyx_obj_6gevent_6__imap_IMapUnordered *, PyObject *, PyObject *, int))__pyx_f_6gevent_6__imap_13IMapUnordered__ispawn; + __pyx_vtable_6gevent_6__imap_IMapUnordered._on_result = (PyObject *(*)(struct __pyx_obj_6gevent_6__imap_IMapUnordered *, PyObject *, int __pyx_skip_dispatch))__pyx_f_6gevent_6__imap_13IMapUnordered__on_result; + __pyx_vtable_6gevent_6__imap_IMapUnordered._on_finish = (PyObject *(*)(struct __pyx_obj_6gevent_6__imap_IMapUnordered *, PyObject *))__pyx_f_6gevent_6__imap_13IMapUnordered__on_finish; + __pyx_vtable_6gevent_6__imap_IMapUnordered._iqueue_value_for_success = (PyObject *(*)(struct __pyx_obj_6gevent_6__imap_IMapUnordered *, PyObject *))__pyx_f_6gevent_6__imap_13IMapUnordered__iqueue_value_for_success; + __pyx_vtable_6gevent_6__imap_IMapUnordered._iqueue_value_for_failure = (PyObject *(*)(struct __pyx_obj_6gevent_6__imap_IMapUnordered *, PyObject *))__pyx_f_6gevent_6__imap_13IMapUnordered__iqueue_value_for_failure; + __pyx_vtable_6gevent_6__imap_IMapUnordered._iqueue_value_for_self_finished = (PyObject *(*)(struct __pyx_obj_6gevent_6__imap_IMapUnordered *))__pyx_f_6gevent_6__imap_13IMapUnordered__iqueue_value_for_self_finished; + __pyx_vtable_6gevent_6__imap_IMapUnordered._iqueue_value_for_self_failure = (PyObject *(*)(struct __pyx_obj_6gevent_6__imap_IMapUnordered *, PyObject *))__pyx_f_6gevent_6__imap_13IMapUnordered__iqueue_value_for_self_failure; + __pyx_type_6gevent_6__imap_IMapUnordered.tp_base = __pyx_ptype_6gevent_9_greenlet_Greenlet; + if (PyType_Ready(&__pyx_type_6gevent_6__imap_IMapUnordered) < 0) __PYX_ERR(0, 43, __pyx_L1_error) + __pyx_type_6gevent_6__imap_IMapUnordered.tp_print = 0; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6gevent_6__imap_IMapUnordered.tp_dictoffset && __pyx_type_6gevent_6__imap_IMapUnordered.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_type_6gevent_6__imap_IMapUnordered.tp_getattro = __Pyx_PyObject_GenericGetAttr; + } + #if CYTHON_COMPILING_IN_CPYTHON + { + PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_6gevent_6__imap_IMapUnordered, "__init__"); if (unlikely(!wrapper)) __PYX_ERR(0, 43, __pyx_L1_error) + if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) { + __pyx_wrapperbase_6gevent_6__imap_13IMapUnordered___init__ = *((PyWrapperDescrObject *)wrapper)->d_base; + __pyx_wrapperbase_6gevent_6__imap_13IMapUnordered___init__.doc = __pyx_doc_6gevent_6__imap_13IMapUnordered___init__; + ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_6gevent_6__imap_13IMapUnordered___init__; + } + } + #endif + if (__Pyx_SetVtable(__pyx_type_6gevent_6__imap_IMapUnordered.tp_dict, __pyx_vtabptr_6gevent_6__imap_IMapUnordered) < 0) __PYX_ERR(0, 43, __pyx_L1_error) + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_IMapUnordered, (PyObject *)&__pyx_type_6gevent_6__imap_IMapUnordered) < 0) __PYX_ERR(0, 43, __pyx_L1_error) + __pyx_ptype_6gevent_6__imap_IMapUnordered = &__pyx_type_6gevent_6__imap_IMapUnordered; + __pyx_vtabptr_6gevent_6__imap_IMap = &__pyx_vtable_6gevent_6__imap_IMap; + __pyx_vtable_6gevent_6__imap_IMap.__pyx_base = *__pyx_vtabptr_6gevent_6__imap_IMapUnordered; + __pyx_vtable_6gevent_6__imap_IMap.__pyx_base._inext = (PyObject *(*)(struct __pyx_obj_6gevent_6__imap_IMapUnordered *))__pyx_f_6gevent_6__imap_4IMap__inext; + __pyx_vtable_6gevent_6__imap_IMap.__pyx_base._iqueue_value_for_success = (PyObject *(*)(struct __pyx_obj_6gevent_6__imap_IMapUnordered *, PyObject *))__pyx_f_6gevent_6__imap_4IMap__iqueue_value_for_success; + __pyx_vtable_6gevent_6__imap_IMap.__pyx_base._iqueue_value_for_failure = (PyObject *(*)(struct __pyx_obj_6gevent_6__imap_IMapUnordered *, PyObject *))__pyx_f_6gevent_6__imap_4IMap__iqueue_value_for_failure; + __pyx_vtable_6gevent_6__imap_IMap.__pyx_base._iqueue_value_for_self_finished = (PyObject *(*)(struct __pyx_obj_6gevent_6__imap_IMapUnordered *))__pyx_f_6gevent_6__imap_4IMap__iqueue_value_for_self_finished; + __pyx_vtable_6gevent_6__imap_IMap.__pyx_base._iqueue_value_for_self_failure = (PyObject *(*)(struct __pyx_obj_6gevent_6__imap_IMapUnordered *, PyObject *))__pyx_f_6gevent_6__imap_4IMap__iqueue_value_for_self_failure; + __pyx_type_6gevent_6__imap_IMap.tp_base = __pyx_ptype_6gevent_6__imap_IMapUnordered; + if (PyType_Ready(&__pyx_type_6gevent_6__imap_IMap) < 0) __PYX_ERR(0, 187, __pyx_L1_error) + __pyx_type_6gevent_6__imap_IMap.tp_print = 0; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6gevent_6__imap_IMap.tp_dictoffset && __pyx_type_6gevent_6__imap_IMap.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_type_6gevent_6__imap_IMap.tp_getattro = __Pyx_PyObject_GenericGetAttr; + } + if (__Pyx_SetVtable(__pyx_type_6gevent_6__imap_IMap.tp_dict, __pyx_vtabptr_6gevent_6__imap_IMap) < 0) __PYX_ERR(0, 187, __pyx_L1_error) + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_IMap, (PyObject *)&__pyx_type_6gevent_6__imap_IMap) < 0) __PYX_ERR(0, 187, __pyx_L1_error) + __pyx_ptype_6gevent_6__imap_IMap = &__pyx_type_6gevent_6__imap_IMap; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_modinit_type_import_code(void) { + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); + /*--- Type import code ---*/ + __pyx_t_1 = PyImport_ImportModule("weakref"); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 5, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_ptype_6gevent_7__ident_ref = __Pyx_ImportType(__pyx_t_1, "weakref", "ref", sizeof(PyWeakReference), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_7__ident_ref) __PYX_ERR(6, 5, __pyx_L1_error) + __pyx_t_2 = PyImport_ImportModule("gevent.__ident"); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 15, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_ptype_6gevent_7__ident_ValuedWeakRef = __Pyx_ImportType(__pyx_t_2, "gevent.__ident", "ValuedWeakRef", sizeof(struct __pyx_obj_6gevent_7__ident_ValuedWeakRef), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_7__ident_ValuedWeakRef) __PYX_ERR(6, 15, __pyx_L1_error) + __pyx_ptype_6gevent_7__ident_IdentRegistry = __Pyx_ImportType(__pyx_t_2, "gevent.__ident", "IdentRegistry", sizeof(struct __pyx_obj_6gevent_7__ident_IdentRegistry), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_7__ident_IdentRegistry) __PYX_ERR(6, 19, __pyx_L1_error) + __pyx_vtabptr_6gevent_7__ident_IdentRegistry = (struct __pyx_vtabstruct_6gevent_7__ident_IdentRegistry*)__Pyx_GetVtable(__pyx_ptype_6gevent_7__ident_IdentRegistry->tp_dict); if (unlikely(!__pyx_vtabptr_6gevent_7__ident_IdentRegistry)) __PYX_ERR(6, 19, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyImport_ImportModule("greenlet"); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_ptype_6gevent_21__greenlet_primitives_greenlet = __Pyx_ImportType(__pyx_t_2, "greenlet", "greenlet", sizeof(PyGreenlet), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_21__greenlet_primitives_greenlet) __PYX_ERR(2, 12, __pyx_L1_error) + __pyx_t_1 = PyImport_ImportModule("gevent.__greenlet_primitives"); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 37, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_ptype_6gevent_21__greenlet_primitives_TrackedRawGreenlet = __Pyx_ImportType(__pyx_t_1, "gevent.__greenlet_primitives", "TrackedRawGreenlet", sizeof(struct __pyx_obj_6gevent_21__greenlet_primitives_TrackedRawGreenlet), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_21__greenlet_primitives_TrackedRawGreenlet) __PYX_ERR(2, 37, __pyx_L1_error) + __pyx_ptype_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop = __Pyx_ImportType(__pyx_t_1, "gevent.__greenlet_primitives", "SwitchOutGreenletWithLoop", sizeof(struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop) __PYX_ERR(2, 40, __pyx_L1_error) + __pyx_vtabptr_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop = (struct __pyx_vtabstruct_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop*)__Pyx_GetVtable(__pyx_ptype_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop->tp_dict); if (unlikely(!__pyx_vtabptr_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop)) __PYX_ERR(2, 40, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyImport_ImportModule("greenlet"); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 15, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_ptype_6gevent_8__waiter_greenlet = __Pyx_ImportType(__pyx_t_1, "greenlet", "greenlet", sizeof(PyGreenlet), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_8__waiter_greenlet) __PYX_ERR(3, 15, __pyx_L1_error) + __pyx_t_2 = PyImport_ImportModule("gevent.__waiter"); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 33, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_ptype_6gevent_8__waiter_Waiter = __Pyx_ImportType(__pyx_t_2, "gevent.__waiter", "Waiter", sizeof(struct __pyx_obj_6gevent_8__waiter_Waiter), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_8__waiter_Waiter) __PYX_ERR(3, 33, __pyx_L1_error) + __pyx_vtabptr_6gevent_8__waiter_Waiter = (struct __pyx_vtabstruct_6gevent_8__waiter_Waiter*)__Pyx_GetVtable(__pyx_ptype_6gevent_8__waiter_Waiter->tp_dict); if (unlikely(!__pyx_vtabptr_6gevent_8__waiter_Waiter)) __PYX_ERR(3, 33, __pyx_L1_error) + __pyx_ptype_6gevent_8__waiter_MultipleWaiter = __Pyx_ImportType(__pyx_t_2, "gevent.__waiter", "MultipleWaiter", sizeof(struct __pyx_obj_6gevent_8__waiter_MultipleWaiter), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_8__waiter_MultipleWaiter) __PYX_ERR(3, 47, __pyx_L1_error) + __pyx_vtabptr_6gevent_8__waiter_MultipleWaiter = (struct __pyx_vtabstruct_6gevent_8__waiter_MultipleWaiter*)__Pyx_GetVtable(__pyx_ptype_6gevent_8__waiter_MultipleWaiter->tp_dict); if (unlikely(!__pyx_vtabptr_6gevent_8__waiter_MultipleWaiter)) __PYX_ERR(3, 47, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyImport_ImportModule("greenlet"); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 17, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_ptype_6gevent_9_greenlet_greenlet = __Pyx_ImportType(__pyx_t_2, "greenlet", "greenlet", sizeof(PyGreenlet), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_9_greenlet_greenlet) __PYX_ERR(4, 17, __pyx_L1_error) + __pyx_t_1 = PyImport_ImportModule("types"); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 40, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_ptype_6gevent_9_greenlet_CodeType = __Pyx_ImportType(__pyx_t_1, "types", "CodeType", sizeof(PyCodeObject), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_9_greenlet_CodeType) __PYX_ERR(4, 40, __pyx_L1_error) + __pyx_ptype_6gevent_9_greenlet_FrameType = __Pyx_ImportType(__pyx_t_1, "types", "FrameType", sizeof(PyFrameObject), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_9_greenlet_FrameType) __PYX_ERR(4, 45, __pyx_L1_error) + __pyx_t_3 = PyImport_ImportModule("gevent._greenlet"); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 56, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_ptype_6gevent_9_greenlet_SpawnedLink = __Pyx_ImportType(__pyx_t_3, "gevent._greenlet", "SpawnedLink", sizeof(struct __pyx_obj_6gevent_9_greenlet_SpawnedLink), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_9_greenlet_SpawnedLink) __PYX_ERR(4, 56, __pyx_L1_error) + __pyx_ptype_6gevent_9_greenlet_SuccessSpawnedLink = __Pyx_ImportType(__pyx_t_3, "gevent._greenlet", "SuccessSpawnedLink", sizeof(struct __pyx_obj_6gevent_9_greenlet_SuccessSpawnedLink), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_9_greenlet_SuccessSpawnedLink) __PYX_ERR(4, 61, __pyx_L1_error) + __pyx_ptype_6gevent_9_greenlet_FailureSpawnedLink = __Pyx_ImportType(__pyx_t_3, "gevent._greenlet", "FailureSpawnedLink", sizeof(struct __pyx_obj_6gevent_9_greenlet_FailureSpawnedLink), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_9_greenlet_FailureSpawnedLink) __PYX_ERR(4, 65, __pyx_L1_error) + __pyx_ptype_6gevent_9_greenlet__Frame = __Pyx_ImportType(__pyx_t_3, "gevent._greenlet", "_Frame", sizeof(struct __pyx_obj_6gevent_9_greenlet__Frame), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_9_greenlet__Frame) __PYX_ERR(4, 71, __pyx_L1_error) + __pyx_ptype_6gevent_9_greenlet__dummy_event = __Pyx_ImportType(__pyx_t_3, "gevent._greenlet", "_dummy_event", sizeof(struct __pyx_obj_6gevent_9_greenlet__dummy_event), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_9_greenlet__dummy_event) __PYX_ERR(4, 157, __pyx_L1_error) + __pyx_vtabptr_6gevent_9_greenlet__dummy_event = (struct __pyx_vtabstruct_6gevent_9_greenlet__dummy_event*)__Pyx_GetVtable(__pyx_ptype_6gevent_9_greenlet__dummy_event->tp_dict); if (unlikely(!__pyx_vtabptr_6gevent_9_greenlet__dummy_event)) __PYX_ERR(4, 157, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyImport_ImportModule("greenlet"); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_ptype_6gevent_19__abstract_linkable_greenlet = __Pyx_ImportType(__pyx_t_3, "greenlet", "greenlet", sizeof(PyGreenlet), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_19__abstract_linkable_greenlet) __PYX_ERR(5, 12, __pyx_L1_error) + __pyx_t_1 = PyImport_ImportModule("gevent.__abstract_linkable"); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 32, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_ptype_6gevent_19__abstract_linkable_AbstractLinkable = __Pyx_ImportType(__pyx_t_1, "gevent.__abstract_linkable", "AbstractLinkable", sizeof(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_19__abstract_linkable_AbstractLinkable) __PYX_ERR(5, 32, __pyx_L1_error) + __pyx_vtabptr_6gevent_19__abstract_linkable_AbstractLinkable = (struct __pyx_vtabstruct_6gevent_19__abstract_linkable_AbstractLinkable*)__Pyx_GetVtable(__pyx_ptype_6gevent_19__abstract_linkable_AbstractLinkable->tp_dict); if (unlikely(!__pyx_vtabptr_6gevent_19__abstract_linkable_AbstractLinkable)) __PYX_ERR(5, 32, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyImport_ImportModule("gevent.__semaphore"); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 7, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_ptype_6gevent_11__semaphore_Semaphore = __Pyx_ImportType(__pyx_t_1, "gevent.__semaphore", "Semaphore", sizeof(struct __pyx_obj_6gevent_11__semaphore_Semaphore), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_11__semaphore_Semaphore) __PYX_ERR(7, 7, __pyx_L1_error) + __pyx_vtabptr_6gevent_11__semaphore_Semaphore = (struct __pyx_vtabstruct_6gevent_11__semaphore_Semaphore*)__Pyx_GetVtable(__pyx_ptype_6gevent_11__semaphore_Semaphore->tp_dict); if (unlikely(!__pyx_vtabptr_6gevent_11__semaphore_Semaphore)) __PYX_ERR(7, 7, __pyx_L1_error) + __pyx_ptype_6gevent_11__semaphore_BoundedSemaphore = __Pyx_ImportType(__pyx_t_1, "gevent.__semaphore", "BoundedSemaphore", sizeof(struct __pyx_obj_6gevent_11__semaphore_BoundedSemaphore), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_11__semaphore_BoundedSemaphore) __PYX_ERR(7, 20, __pyx_L1_error) + __pyx_vtabptr_6gevent_11__semaphore_BoundedSemaphore = (struct __pyx_vtabstruct_6gevent_11__semaphore_BoundedSemaphore*)__Pyx_GetVtable(__pyx_ptype_6gevent_11__semaphore_BoundedSemaphore->tp_dict); if (unlikely(!__pyx_vtabptr_6gevent_11__semaphore_BoundedSemaphore)) __PYX_ERR(7, 20, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyImport_ImportModule("gevent._event"); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_ptype_6gevent_6_event_Event = __Pyx_ImportType(__pyx_t_1, "gevent._event", "Event", sizeof(struct __pyx_obj_6gevent_6_event_Event), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_6_event_Event) __PYX_ERR(8, 13, __pyx_L1_error) + __pyx_vtabptr_6gevent_6_event_Event = (struct __pyx_vtabstruct_6gevent_6_event_Event*)__Pyx_GetVtable(__pyx_ptype_6gevent_6_event_Event->tp_dict); if (unlikely(!__pyx_vtabptr_6gevent_6_event_Event)) __PYX_ERR(8, 13, __pyx_L1_error) + __pyx_ptype_6gevent_6_event_AsyncResult = __Pyx_ImportType(__pyx_t_1, "gevent._event", "AsyncResult", sizeof(struct __pyx_obj_6gevent_6_event_AsyncResult), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_6_event_AsyncResult) __PYX_ERR(8, 16, __pyx_L1_error) + __pyx_vtabptr_6gevent_6_event_AsyncResult = (struct __pyx_vtabstruct_6gevent_6_event_AsyncResult*)__Pyx_GetVtable(__pyx_ptype_6gevent_6_event_AsyncResult->tp_dict); if (unlikely(!__pyx_vtabptr_6gevent_6_event_AsyncResult)) __PYX_ERR(8, 16, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyImport_ImportModule("gevent._queue"); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 14, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_ptype_6gevent_6_queue_ItemWaiter = __Pyx_ImportType(__pyx_t_1, "gevent._queue", "ItemWaiter", sizeof(struct __pyx_obj_6gevent_6_queue_ItemWaiter), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_6_queue_ItemWaiter) __PYX_ERR(9, 14, __pyx_L1_error) + __pyx_vtabptr_6gevent_6_queue_ItemWaiter = (struct __pyx_vtabstruct_6gevent_6_queue_ItemWaiter*)__Pyx_GetVtable(__pyx_ptype_6gevent_6_queue_ItemWaiter->tp_dict); if (unlikely(!__pyx_vtabptr_6gevent_6_queue_ItemWaiter)) __PYX_ERR(9, 14, __pyx_L1_error) + __pyx_ptype_6gevent_6_queue_Queue = __Pyx_ImportType(__pyx_t_1, "gevent._queue", "Queue", sizeof(struct __pyx_obj_6gevent_6_queue_Queue), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_6_queue_Queue) __PYX_ERR(9, 18, __pyx_L1_error) + __pyx_vtabptr_6gevent_6_queue_Queue = (struct __pyx_vtabstruct_6gevent_6_queue_Queue*)__Pyx_GetVtable(__pyx_ptype_6gevent_6_queue_Queue->tp_dict); if (unlikely(!__pyx_vtabptr_6gevent_6_queue_Queue)) __PYX_ERR(9, 18, __pyx_L1_error) + __pyx_ptype_6gevent_6_queue_UnboundQueue = __Pyx_ImportType(__pyx_t_1, "gevent._queue", "UnboundQueue", sizeof(struct __pyx_obj_6gevent_6_queue_UnboundQueue), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_6_queue_UnboundQueue) __PYX_ERR(9, 50, __pyx_L1_error) + __pyx_vtabptr_6gevent_6_queue_UnboundQueue = (struct __pyx_vtabstruct_6gevent_6_queue_UnboundQueue*)__Pyx_GetVtable(__pyx_ptype_6gevent_6_queue_UnboundQueue->tp_dict); if (unlikely(!__pyx_vtabptr_6gevent_6_queue_UnboundQueue)) __PYX_ERR(9, 50, __pyx_L1_error) + __pyx_ptype_6gevent_6_queue_PriorityQueue = __Pyx_ImportType(__pyx_t_1, "gevent._queue", "PriorityQueue", sizeof(struct __pyx_obj_6gevent_6_queue_PriorityQueue), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_6_queue_PriorityQueue) __PYX_ERR(9, 53, __pyx_L1_error) + __pyx_vtabptr_6gevent_6_queue_PriorityQueue = (struct __pyx_vtabstruct_6gevent_6_queue_PriorityQueue*)__Pyx_GetVtable(__pyx_ptype_6gevent_6_queue_PriorityQueue->tp_dict); if (unlikely(!__pyx_vtabptr_6gevent_6_queue_PriorityQueue)) __PYX_ERR(9, 53, __pyx_L1_error) + __pyx_ptype_6gevent_6_queue_LifoQueue = __Pyx_ImportType(__pyx_t_1, "gevent._queue", "LifoQueue", sizeof(struct __pyx_obj_6gevent_6_queue_LifoQueue), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_6_queue_LifoQueue) __PYX_ERR(9, 56, __pyx_L1_error) + __pyx_vtabptr_6gevent_6_queue_LifoQueue = (struct __pyx_vtabstruct_6gevent_6_queue_LifoQueue*)__Pyx_GetVtable(__pyx_ptype_6gevent_6_queue_LifoQueue->tp_dict); if (unlikely(!__pyx_vtabptr_6gevent_6_queue_LifoQueue)) __PYX_ERR(9, 56, __pyx_L1_error) + __pyx_ptype_6gevent_6_queue_JoinableQueue = __Pyx_ImportType(__pyx_t_1, "gevent._queue", "JoinableQueue", sizeof(struct __pyx_obj_6gevent_6_queue_JoinableQueue), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_6_queue_JoinableQueue) __PYX_ERR(9, 59, __pyx_L1_error) + __pyx_vtabptr_6gevent_6_queue_JoinableQueue = (struct __pyx_vtabstruct_6gevent_6_queue_JoinableQueue*)__Pyx_GetVtable(__pyx_ptype_6gevent_6_queue_JoinableQueue->tp_dict); if (unlikely(!__pyx_vtabptr_6gevent_6_queue_JoinableQueue)) __PYX_ERR(9, 59, __pyx_L1_error) + __pyx_ptype_6gevent_6_queue_Channel = __Pyx_ImportType(__pyx_t_1, "gevent._queue", "Channel", sizeof(struct __pyx_obj_6gevent_6_queue_Channel), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_6_queue_Channel) __PYX_ERR(9, 64, __pyx_L1_error) + __pyx_vtabptr_6gevent_6_queue_Channel = (struct __pyx_vtabstruct_6gevent_6_queue_Channel*)__Pyx_GetVtable(__pyx_ptype_6gevent_6_queue_Channel->tp_dict); if (unlikely(!__pyx_vtabptr_6gevent_6_queue_Channel)) __PYX_ERR(9, 64, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_modinit_variable_import_code(void) { + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); + /*--- Variable import code ---*/ + __pyx_t_1 = PyImport_ImportModule("gevent.__ident"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_1, "heappop", (void **)&__pyx_vp_6gevent_7__ident_heappop, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_1, "heappush", (void **)&__pyx_vp_6gevent_7__ident_heappush, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_1, "WeakKeyDictionary", (void **)&__pyx_vp_6gevent_7__ident_WeakKeyDictionary, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + Py_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_2 = PyImport_ImportModule("gevent.__greenlet_primitives"); if (!__pyx_t_2) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_2, "get_objects", (void **)&__pyx_vp_6gevent_21__greenlet_primitives_get_objects, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_2, "wref", (void **)&__pyx_vp_6gevent_21__greenlet_primitives_wref, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_2, "BlockingSwitchOutError", (void **)&__pyx_vp_6gevent_21__greenlet_primitives_BlockingSwitchOutError, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_2, "_greenlet_imported", (void **)&__pyx_vp_6gevent_21__greenlet_primitives__greenlet_imported, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + Py_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_3 = PyImport_ImportModule("gevent.__hub_local"); if (!__pyx_t_3) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_3, "_threadlocal", (void **)&__pyx_vp_6gevent_11__hub_local__threadlocal, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + Py_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_4 = PyImport_ImportModule("gevent.__waiter"); if (!__pyx_t_4) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_4, "sys", (void **)&__pyx_vp_6gevent_8__waiter_sys, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_4, "ConcurrentObjectUseError", (void **)&__pyx_vp_6gevent_8__waiter_ConcurrentObjectUseError, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_4, "_greenlet_imported", (void **)&__pyx_vp_6gevent_8__waiter__greenlet_imported, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_4, "_NONE", (void **)&__pyx_vp_6gevent_8__waiter__NONE, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + Py_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = PyImport_ImportModule("gevent._greenlet"); if (!__pyx_t_5) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_5, "_PYPY", (void **)&__pyx_vp_6gevent_9_greenlet__PYPY, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_5, "sys_getframe", (void **)&__pyx_vp_6gevent_9_greenlet_sys_getframe, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_5, "sys_exc_info", (void **)&__pyx_vp_6gevent_9_greenlet_sys_exc_info, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_5, "Timeout", (void **)&__pyx_vp_6gevent_9_greenlet_Timeout, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_5, "GreenletExit", (void **)&__pyx_vp_6gevent_9_greenlet_GreenletExit, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_5, "InvalidSwitchError", (void **)&__pyx_vp_6gevent_9_greenlet_InvalidSwitchError, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_5, "_greenlet_imported", (void **)&__pyx_vp_6gevent_9_greenlet__greenlet_imported, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_5, "_greenlet__init__", (void **)&__pyx_vp_6gevent_9_greenlet__greenlet__init__, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_5, "_threadlocal", (void **)&__pyx_vp_6gevent_9_greenlet__threadlocal, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_5, "get_hub_class", (void **)&__pyx_vp_6gevent_9_greenlet_get_hub_class, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_5, "wref", (void **)&__pyx_vp_6gevent_9_greenlet_wref, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_5, "dump_traceback", (void **)&__pyx_vp_6gevent_9_greenlet_dump_traceback, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_5, "load_traceback", (void **)&__pyx_vp_6gevent_9_greenlet_load_traceback, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_5, "wait", (void **)&__pyx_vp_6gevent_9_greenlet_wait, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_5, "iwait", (void **)&__pyx_vp_6gevent_9_greenlet_iwait, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_5, "reraise", (void **)&__pyx_vp_6gevent_9_greenlet_reraise, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_5, "GEVENT_CONFIG", (void **)&__pyx_vp_6gevent_9_greenlet_GEVENT_CONFIG, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_5, "_cancelled_start_event", (void **)&__pyx_vp_6gevent_9_greenlet__cancelled_start_event, "struct __pyx_obj_6gevent_9_greenlet__dummy_event *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_5, "_start_completed_event", (void **)&__pyx_vp_6gevent_9_greenlet__start_completed_event, "struct __pyx_obj_6gevent_9_greenlet__dummy_event *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_5, "_spawn_callbacks", (void **)&__pyx_vp_6gevent_9_greenlet__spawn_callbacks, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + Py_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = PyImport_ImportModule("gevent.__abstract_linkable"); if (!__pyx_t_6) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_6, "InvalidSwitchError", (void **)&__pyx_vp_6gevent_19__abstract_linkable_InvalidSwitchError, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_6, "Timeout", (void **)&__pyx_vp_6gevent_19__abstract_linkable_Timeout, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_6, "_greenlet_imported", (void **)&__pyx_vp_6gevent_19__abstract_linkable__greenlet_imported, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + Py_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_7 = PyImport_ImportModule("gevent.__semaphore"); if (!__pyx_t_7) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_7, "Timeout", (void **)&__pyx_vp_6gevent_11__semaphore_Timeout, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + Py_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_8 = PyImport_ImportModule("gevent._event"); if (!__pyx_t_8) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_8, "_None", (void **)&__pyx_vp_6gevent_6_event__None, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_8, "reraise", (void **)&__pyx_vp_6gevent_6_event_reraise, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_8, "dump_traceback", (void **)&__pyx_vp_6gevent_6_event_dump_traceback, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_8, "load_traceback", (void **)&__pyx_vp_6gevent_6_event_load_traceback, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_8, "Timeout", (void **)&__pyx_vp_6gevent_6_event_Timeout, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + Py_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_9 = PyImport_ImportModule("gevent._queue"); if (!__pyx_t_9) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_9, "_heappush", (void **)&__pyx_vp_6gevent_6_queue__heappush, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_9, "_heappop", (void **)&__pyx_vp_6gevent_6_queue__heappop, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_9, "_heapify", (void **)&__pyx_vp_6gevent_6_queue__heapify, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + Py_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_modinit_function_import_code(void) { + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); + /*--- Function import code ---*/ + __pyx_t_1 = PyImport_ImportModule("gevent.__hub_local"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportFunction(__pyx_t_1, "get_hub_noargs", (void (**)(void))&__pyx_f_6gevent_11__hub_local_get_hub_noargs, "struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *(int __pyx_skip_dispatch)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + Py_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_RefNannyFinishContext(); + return -1; +} + + +#if PY_MAJOR_VERSION < 3 +#ifdef CYTHON_NO_PYINIT_EXPORT +#define __Pyx_PyMODINIT_FUNC void +#else +#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC +#endif +#else +#ifdef CYTHON_NO_PYINIT_EXPORT +#define __Pyx_PyMODINIT_FUNC PyObject * +#else +#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC +#endif +#endif + + +#if PY_MAJOR_VERSION < 3 +__Pyx_PyMODINIT_FUNC init__imap(void) CYTHON_SMALL_CODE; /*proto*/ +__Pyx_PyMODINIT_FUNC init__imap(void) +#else +__Pyx_PyMODINIT_FUNC PyInit___imap(void) CYTHON_SMALL_CODE; /*proto*/ +__Pyx_PyMODINIT_FUNC PyInit___imap(void) +#if CYTHON_PEP489_MULTI_PHASE_INIT +{ + return PyModuleDef_Init(&__pyx_moduledef); +} +static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { + #if PY_VERSION_HEX >= 0x030700A1 + static PY_INT64_T main_interpreter_id = -1; + PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); + if (main_interpreter_id == -1) { + main_interpreter_id = current_id; + return (unlikely(current_id == -1)) ? -1 : 0; + } else if (unlikely(main_interpreter_id != current_id)) + #else + static PyInterpreterState *main_interpreter = NULL; + PyInterpreterState *current_interpreter = PyThreadState_Get()->interp; + if (!main_interpreter) { + main_interpreter = current_interpreter; + } else if (unlikely(main_interpreter != current_interpreter)) + #endif + { + PyErr_SetString( + PyExc_ImportError, + "Interpreter change detected - this module can only be loaded into one interpreter per process."); + return -1; + } + return 0; +} +static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) { + PyObject *value = PyObject_GetAttrString(spec, from_name); + int result = 0; + if (likely(value)) { + if (allow_none || value != Py_None) { + result = PyDict_SetItemString(moddict, to_name, value); + } + Py_DECREF(value); + } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_Clear(); + } else { + result = -1; + } + return result; +} +static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) { + PyObject *module = NULL, *moddict, *modname; + if (__Pyx_check_single_interpreter()) + return NULL; + if (__pyx_m) + return __Pyx_NewRef(__pyx_m); + modname = PyObject_GetAttrString(spec, "name"); + if (unlikely(!modname)) goto bad; + module = PyModule_NewObject(modname); + Py_DECREF(modname); + if (unlikely(!module)) goto bad; + moddict = PyModule_GetDict(module); + if (unlikely(!moddict)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad; + return module; +bad: + Py_XDECREF(module); + return NULL; +} + + +static CYTHON_SMALL_CODE int __pyx_pymod_exec___imap(PyObject *__pyx_pyinit_module) +#endif +#endif +{ + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannyDeclarations + #if CYTHON_PEP489_MULTI_PHASE_INIT + if (__pyx_m) { + if (__pyx_m == __pyx_pyinit_module) return 0; + PyErr_SetString(PyExc_RuntimeError, "Module '__imap' has already been imported. Re-initialisation is not supported."); + return -1; + } + #elif PY_MAJOR_VERSION >= 3 + if (__pyx_m) return __Pyx_NewRef(__pyx_m); + #endif + #if CYTHON_REFNANNY +__Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); +if (!__Pyx_RefNanny) { + PyErr_Clear(); + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); + if (!__Pyx_RefNanny) + Py_FatalError("failed to import 'refnanny' module"); +} +#endif + __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit___imap(void)", 0); + if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #ifdef __Pxy_PyFrame_Initialize_Offsets + __Pxy_PyFrame_Initialize_Offsets(); + #endif + __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) + #ifdef __Pyx_CyFunction_USED + if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_FusedFunction_USED + if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_Coroutine_USED + if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_Generator_USED + if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_AsyncGen_USED + if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_StopAsyncIteration_USED + if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + /*--- Library function declarations ---*/ + /*--- Threads initialization code ---*/ + #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS + #ifdef WITH_THREAD /* Python build with threading support? */ + PyEval_InitThreads(); + #endif + #endif + /*--- Module creation code ---*/ + #if CYTHON_PEP489_MULTI_PHASE_INIT + __pyx_m = __pyx_pyinit_module; + Py_INCREF(__pyx_m); + #else + #if PY_MAJOR_VERSION < 3 + __pyx_m = Py_InitModule4("__imap", __pyx_methods, __pyx_k_Iterators_across_greenlets_or_A, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); + #else + __pyx_m = PyModule_Create(&__pyx_moduledef); + #endif + if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) + Py_INCREF(__pyx_d); + __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) + #if CYTHON_COMPILING_IN_PYPY + Py_INCREF(__pyx_b); + #endif + if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + /*--- Initialize various global constants etc. ---*/ + if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) + if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + if (__pyx_module_is_main_gevent____imap) { + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + } + #if PY_MAJOR_VERSION >= 3 + { + PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) + if (!PyDict_GetItemString(modules, "gevent.__imap")) { + if (unlikely(PyDict_SetItemString(modules, "gevent.__imap", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error) + } + } + #endif + /*--- Builtin init code ---*/ + if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + /*--- Constants init code ---*/ + if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + /*--- Global type/function init code ---*/ + (void)__Pyx_modinit_global_init_code(); + (void)__Pyx_modinit_variable_export_code(); + if (unlikely(__Pyx_modinit_function_export_code() != 0)) goto __pyx_L1_error; + if (unlikely(__Pyx_modinit_type_init_code() != 0)) goto __pyx_L1_error; + if (unlikely(__Pyx_modinit_type_import_code() != 0)) goto __pyx_L1_error; + if (unlikely(__Pyx_modinit_variable_import_code() != 0)) goto __pyx_L1_error; + if (unlikely(__Pyx_modinit_function_import_code() != 0)) goto __pyx_L1_error; + /*--- Execution code ---*/ + #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) + if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + + /* "src/gevent/_imap.py":14 + * + * + * from gevent import _semaphore # <<<<<<<<<<<<<< + * from gevent import queue + * + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 14, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_semaphore); + __Pyx_GIVEREF(__pyx_n_s_semaphore); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_semaphore); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_gevent, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 14, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_semaphore); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 14, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_semaphore, __pyx_t_1) < 0) __PYX_ERR(0, 14, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/_imap.py":15 + * + * from gevent import _semaphore + * from gevent import queue # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 15, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_queue); + __Pyx_GIVEREF(__pyx_n_s_queue); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_queue); + __pyx_t_1 = __Pyx_Import(__pyx_n_s_gevent, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 15, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_queue); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 15, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_queue, __pyx_t_2) < 0) __PYX_ERR(0, 15, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_imap.py":18 + * + * + * __all__ = [ # <<<<<<<<<<<<<< + * 'IMapUnordered', + * 'IMap', + */ + __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 18, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_IMapUnordered); + __Pyx_GIVEREF(__pyx_n_s_IMapUnordered); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_IMapUnordered); + __Pyx_INCREF(__pyx_n_s_IMap); + __Pyx_GIVEREF(__pyx_n_s_IMap); + PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_IMap); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_all, __pyx_t_1) < 0) __PYX_ERR(0, 18, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_imap.py":23 + * ] + * + * locals()['Greenlet'] = __import__('gevent').Greenlet # <<<<<<<<<<<<<< + * locals()['Semaphore'] = _semaphore.Semaphore + * locals()['UnboundQueue'] = queue.UnboundQueue + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin___import__, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 23, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_Greenlet); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 23, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_Globals(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 23, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (unlikely(PyDict_SetItem(__pyx_t_1, __pyx_n_s_Greenlet, __pyx_t_2) < 0)) __PYX_ERR(0, 23, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/_imap.py":24 + * + * locals()['Greenlet'] = __import__('gevent').Greenlet + * locals()['Semaphore'] = _semaphore.Semaphore # <<<<<<<<<<<<<< + * locals()['UnboundQueue'] = queue.UnboundQueue + * + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_semaphore); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 24, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_Semaphore); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 24, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_Globals(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 24, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (unlikely(PyDict_SetItem(__pyx_t_2, __pyx_n_s_Semaphore, __pyx_t_1) < 0)) __PYX_ERR(0, 24, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_imap.py":25 + * locals()['Greenlet'] = __import__('gevent').Greenlet + * locals()['Semaphore'] = _semaphore.Semaphore + * locals()['UnboundQueue'] = queue.UnboundQueue # <<<<<<<<<<<<<< + * + * + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_queue); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 25, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_UnboundQueue); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 25, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_Globals(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 25, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (unlikely(PyDict_SetItem(__pyx_t_1, __pyx_n_s_UnboundQueue, __pyx_t_2) < 0)) __PYX_ERR(0, 25, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/_imap.py":29 + * + * class Failure(object): + * __slots__ = ('exc', 'raise_exception') # <<<<<<<<<<<<<< + * + * def __init__(self, exc, raise_exception=None): + */ + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6__imap_Failure->tp_dict, __pyx_n_s_slots, __pyx_tuple__2) < 0) __PYX_ERR(0, 29, __pyx_L1_error) + PyType_Modified(__pyx_ptype_6gevent_6__imap_Failure); + + /* "src/gevent/_imap.py":110 + * return value + * + * next = __next__ # Py2 # <<<<<<<<<<<<<< + * + * def _inext(self): + */ + __Pyx_GetNameInClass(__pyx_t_2, (PyObject *)__pyx_ptype_6gevent_6__imap_IMapUnordered, __pyx_n_s_next); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 110, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6__imap_IMapUnordered->tp_dict, __pyx_n_s_next_2, __pyx_t_2) < 0) __PYX_ERR(0, 110, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_6__imap_IMapUnordered); + + /* "src/gevent/_imap.py":124 + * return g + * + * def _run(self): # pylint:disable=method-hidden # <<<<<<<<<<<<<< + * try: + * func = self.func + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6__imap_13IMapUnordered_7_run, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_IMapUnordered__run, NULL, __pyx_n_s_gevent___imap, __pyx_d, ((PyObject *)__pyx_codeobj__4)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 124, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6__imap_IMapUnordered->tp_dict, __pyx_n_s_run, __pyx_t_2) < 0) __PYX_ERR(0, 124, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_6__imap_IMapUnordered); + + /* "src/gevent/_imap.py":140 + * self._result_semaphore = None + * + * def _on_result(self, greenlet): # <<<<<<<<<<<<<< + * # This method will be called in the hub greenlet (we rawlink) + * self._outstanding_tasks -= 1 + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6__imap_13IMapUnordered_9_on_result, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_IMapUnordered__on_result, NULL, __pyx_n_s_gevent___imap, __pyx_d, ((PyObject *)__pyx_codeobj__6)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 140, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6__imap_IMapUnordered->tp_dict, __pyx_n_s_on_result, __pyx_t_2) < 0) __PYX_ERR(0, 140, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_6__imap_IMapUnordered); + + /* "src/gevent/_imap.py":226 + * return (self._max_index + 1, IMapUnordered._iqueue_value_for_self_failure(self, exception)) + * + * from gevent._util import import_c_accel # <<<<<<<<<<<<<< + * import_c_accel(globals(), 'gevent.__imap') + */ + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 226, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_import_c_accel); + __Pyx_GIVEREF(__pyx_n_s_import_c_accel); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_import_c_accel); + __pyx_t_1 = __Pyx_Import(__pyx_n_s_gevent__util, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 226, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_import_c_accel); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 226, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_import_c_accel, __pyx_t_2) < 0) __PYX_ERR(0, 226, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_imap.py":227 + * + * from gevent._util import import_c_accel + * import_c_accel(globals(), 'gevent.__imap') # <<<<<<<<<<<<<< + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_import_c_accel); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 227, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_Globals(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 227, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 227, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __Pyx_INCREF(__pyx_n_s_gevent___imap); + __Pyx_GIVEREF(__pyx_n_s_gevent___imap); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_n_s_gevent___imap); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 227, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/_imap.py":1 + * # -*- coding: utf-8 -*- # <<<<<<<<<<<<<< + * # Copyright (c) 2018 gevent + * # cython: auto_pickle=False,embedsignature=True,always_allow_keywords=False,infer_types=True + */ + __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "gevent/__abstract_linkable.pxd":24 + * return PyGreenlet_GetCurrent() + * + * cdef inline void greenlet_init(): # <<<<<<<<<<<<<< + * global _greenlet_imported + * if not _greenlet_imported: + */ + + /*--- Wrapped vars code ---*/ + + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + if (__pyx_m) { + if (__pyx_d) { + __Pyx_AddTraceback("init gevent.__imap", __pyx_clineno, __pyx_lineno, __pyx_filename); + } + Py_CLEAR(__pyx_m); + } else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_ImportError, "init gevent.__imap"); + } + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + #if CYTHON_PEP489_MULTI_PHASE_INIT + return (__pyx_m != NULL) ? 0 : -1; + #elif PY_MAJOR_VERSION >= 3 + return __pyx_m; + #else + return; + #endif +} + +/* --- Runtime support code --- */ +/* Refnanny */ +#if CYTHON_REFNANNY +static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { + PyObject *m = NULL, *p = NULL; + void *r = NULL; + m = PyImport_ImportModule(modname); + if (!m) goto end; + p = PyObject_GetAttrString(m, "RefNannyAPI"); + if (!p) goto end; + r = PyLong_AsVoidPtr(p); +end: + Py_XDECREF(p); + Py_XDECREF(m); + return (__Pyx_RefNannyAPIStruct *)r; +} +#endif + +/* PyObjectGetAttrStr */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_getattro)) + return tp->tp_getattro(obj, attr_name); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_getattr)) + return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); +#endif + return PyObject_GetAttr(obj, attr_name); +} +#endif + +/* GetBuiltinName */ +static PyObject *__Pyx_GetBuiltinName(PyObject *name) { + PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name); + if (unlikely(!result)) { + PyErr_Format(PyExc_NameError, +#if PY_MAJOR_VERSION >= 3 + "name '%U' is not defined", name); +#else + "name '%.200s' is not defined", PyString_AS_STRING(name)); +#endif + } + return result; +} + +/* RaiseDoubleKeywords */ +static void __Pyx_RaiseDoubleKeywordsError( + const char* func_name, + PyObject* kw_name) +{ + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION >= 3 + "%s() got multiple values for keyword argument '%U'", func_name, kw_name); + #else + "%s() got multiple values for keyword argument '%s'", func_name, + PyString_AsString(kw_name)); + #endif +} + +/* ParseKeywords */ +static int __Pyx_ParseOptionalKeywords( + PyObject *kwds, + PyObject **argnames[], + PyObject *kwds2, + PyObject *values[], + Py_ssize_t num_pos_args, + const char* function_name) +{ + PyObject *key = 0, *value = 0; + Py_ssize_t pos = 0; + PyObject*** name; + PyObject*** first_kw_arg = argnames + num_pos_args; + while (PyDict_Next(kwds, &pos, &key, &value)) { + name = first_kw_arg; + while (*name && (**name != key)) name++; + if (*name) { + values[name-argnames] = value; + continue; + } + name = first_kw_arg; + #if PY_MAJOR_VERSION < 3 + if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) { + while (*name) { + if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) + && _PyString_Eq(**name, key)) { + values[name-argnames] = value; + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + if ((**argname == key) || ( + (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) + && _PyString_Eq(**argname, key))) { + goto arg_passed_twice; + } + argname++; + } + } + } else + #endif + if (likely(PyUnicode_Check(key))) { + while (*name) { + int cmp = (**name == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 : + #endif + PyUnicode_Compare(**name, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) { + values[name-argnames] = value; + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + int cmp = (**argname == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 : + #endif + PyUnicode_Compare(**argname, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) goto arg_passed_twice; + argname++; + } + } + } else + goto invalid_keyword_type; + if (kwds2) { + if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; + } else { + goto invalid_keyword; + } + } + return 0; +arg_passed_twice: + __Pyx_RaiseDoubleKeywordsError(function_name, key); + goto bad; +invalid_keyword_type: + PyErr_Format(PyExc_TypeError, + "%.200s() keywords must be strings", function_name); + goto bad; +invalid_keyword: + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION < 3 + "%.200s() got an unexpected keyword argument '%.200s'", + function_name, PyString_AsString(key)); + #else + "%s() got an unexpected keyword argument '%U'", + function_name, key); + #endif +bad: + return -1; +} + +/* RaiseArgTupleInvalid */ +static void __Pyx_RaiseArgtupleInvalid( + const char* func_name, + int exact, + Py_ssize_t num_min, + Py_ssize_t num_max, + Py_ssize_t num_found) +{ + Py_ssize_t num_expected; + const char *more_or_less; + if (num_found < num_min) { + num_expected = num_min; + more_or_less = "at least"; + } else { + num_expected = num_max; + more_or_less = "at most"; + } + if (exact) { + more_or_less = "exactly"; + } + PyErr_Format(PyExc_TypeError, + "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", + func_name, more_or_less, num_expected, + (num_expected == 1) ? "" : "s", num_found); +} + +/* PyFunctionFastCall */ +#if CYTHON_FAST_PYCALL +static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, + PyObject *globals) { + PyFrameObject *f; + PyThreadState *tstate = __Pyx_PyThreadState_Current; + PyObject **fastlocals; + Py_ssize_t i; + PyObject *result; + assert(globals != NULL); + /* XXX Perhaps we should create a specialized + PyFrame_New() that doesn't take locals, but does + take builtins without sanity checking them. + */ + assert(tstate != NULL); + f = PyFrame_New(tstate, co, globals, NULL); + if (f == NULL) { + return NULL; + } + fastlocals = __Pyx_PyFrame_GetLocalsplus(f); + for (i = 0; i < na; i++) { + Py_INCREF(*args); + fastlocals[i] = *args++; + } + result = PyEval_EvalFrameEx(f,0); + ++tstate->recursion_depth; + Py_DECREF(f); + --tstate->recursion_depth; + return result; +} +#if 1 || PY_VERSION_HEX < 0x030600B1 +static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs) { + PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); + PyObject *globals = PyFunction_GET_GLOBALS(func); + PyObject *argdefs = PyFunction_GET_DEFAULTS(func); + PyObject *closure; +#if PY_MAJOR_VERSION >= 3 + PyObject *kwdefs; +#endif + PyObject *kwtuple, **k; + PyObject **d; + Py_ssize_t nd; + Py_ssize_t nk; + PyObject *result; + assert(kwargs == NULL || PyDict_Check(kwargs)); + nk = kwargs ? PyDict_Size(kwargs) : 0; + if (Py_EnterRecursiveCall((char*)" while calling a Python object")) { + return NULL; + } + if ( +#if PY_MAJOR_VERSION >= 3 + co->co_kwonlyargcount == 0 && +#endif + likely(kwargs == NULL || nk == 0) && + co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { + if (argdefs == NULL && co->co_argcount == nargs) { + result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); + goto done; + } + else if (nargs == 0 && argdefs != NULL + && co->co_argcount == Py_SIZE(argdefs)) { + /* function called with no arguments, but all parameters have + a default value: use default values as arguments .*/ + args = &PyTuple_GET_ITEM(argdefs, 0); + result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); + goto done; + } + } + if (kwargs != NULL) { + Py_ssize_t pos, i; + kwtuple = PyTuple_New(2 * nk); + if (kwtuple == NULL) { + result = NULL; + goto done; + } + k = &PyTuple_GET_ITEM(kwtuple, 0); + pos = i = 0; + while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { + Py_INCREF(k[i]); + Py_INCREF(k[i+1]); + i += 2; + } + nk = i / 2; + } + else { + kwtuple = NULL; + k = NULL; + } + closure = PyFunction_GET_CLOSURE(func); +#if PY_MAJOR_VERSION >= 3 + kwdefs = PyFunction_GET_KW_DEFAULTS(func); +#endif + if (argdefs != NULL) { + d = &PyTuple_GET_ITEM(argdefs, 0); + nd = Py_SIZE(argdefs); + } + else { + d = NULL; + nd = 0; + } +#if PY_MAJOR_VERSION >= 3 + result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, + args, nargs, + k, (int)nk, + d, (int)nd, kwdefs, closure); +#else + result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, + args, nargs, + k, (int)nk, + d, (int)nd, closure); +#endif + Py_XDECREF(kwtuple); +done: + Py_LeaveRecursiveCall(); + return result; +} +#endif +#endif + +/* PyObjectCall */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { + PyObject *result; + ternaryfunc call = func->ob_type->tp_call; + if (unlikely(!call)) + return PyObject_Call(func, arg, kw); + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; + result = (*call)(func, arg, kw); + Py_LeaveRecursiveCall(); + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +/* PyObjectCallMethO */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { + PyObject *self, *result; + PyCFunction cfunc; + cfunc = PyCFunction_GET_FUNCTION(func); + self = PyCFunction_GET_SELF(func); + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; + result = cfunc(self, arg); + Py_LeaveRecursiveCall(); + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +/* PyObjectCallNoArg */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { +#if CYTHON_FAST_PYCALL + if (PyFunction_Check(func)) { + return __Pyx_PyFunction_FastCall(func, NULL, 0); + } +#endif +#ifdef __Pyx_CyFunction_USED + if (likely(PyCFunction_Check(func) || __Pyx_CyFunction_Check(func))) +#else + if (likely(PyCFunction_Check(func))) +#endif + { + if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) { + return __Pyx_PyObject_CallMethO(func, NULL); + } + } + return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL); +} +#endif + +/* PyCFunctionFastCall */ +#if CYTHON_FAST_PYCCALL +static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) { + PyCFunctionObject *func = (PyCFunctionObject*)func_obj; + PyCFunction meth = PyCFunction_GET_FUNCTION(func); + PyObject *self = PyCFunction_GET_SELF(func); + int flags = PyCFunction_GET_FLAGS(func); + assert(PyCFunction_Check(func)); + assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS))); + assert(nargs >= 0); + assert(nargs == 0 || args != NULL); + /* _PyCFunction_FastCallDict() must not be called with an exception set, + because it may clear it (directly or indirectly) and so the + caller loses its exception */ + assert(!PyErr_Occurred()); + if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) { + return (*((__Pyx_PyCFunctionFastWithKeywords)(void*)meth)) (self, args, nargs, NULL); + } else { + return (*((__Pyx_PyCFunctionFast)(void*)meth)) (self, args, nargs); + } +} +#endif + +/* PyObjectCallOneArg */ +#if CYTHON_COMPILING_IN_CPYTHON +static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) { + PyObject *result; + PyObject *args = PyTuple_New(1); + if (unlikely(!args)) return NULL; + Py_INCREF(arg); + PyTuple_SET_ITEM(args, 0, arg); + result = __Pyx_PyObject_Call(func, args, NULL); + Py_DECREF(args); + return result; +} +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { +#if CYTHON_FAST_PYCALL + if (PyFunction_Check(func)) { + return __Pyx_PyFunction_FastCall(func, &arg, 1); + } +#endif + if (likely(PyCFunction_Check(func))) { + if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) { + return __Pyx_PyObject_CallMethO(func, arg); +#if CYTHON_FAST_PYCCALL + } else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) { + return __Pyx_PyCFunction_FastCall(func, &arg, 1); +#endif + } + } + return __Pyx__PyObject_CallOneArg(func, arg); +} +#else +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { + PyObject *result; + PyObject *args = PyTuple_Pack(1, arg); + if (unlikely(!args)) return NULL; + result = __Pyx_PyObject_Call(func, args, NULL); + Py_DECREF(args); + return result; +} +#endif + +/* PyErrFetchRestore */ +#if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + tmp_type = tstate->curexc_type; + tmp_value = tstate->curexc_value; + tmp_tb = tstate->curexc_traceback; + tstate->curexc_type = type; + tstate->curexc_value = value; + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +} +static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { + *type = tstate->curexc_type; + *value = tstate->curexc_value; + *tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +} +#endif + +/* RaiseException */ +#if PY_MAJOR_VERSION < 3 +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, + CYTHON_UNUSED PyObject *cause) { + __Pyx_PyThreadState_declare + Py_XINCREF(type); + if (!value || value == Py_None) + value = NULL; + else + Py_INCREF(value); + if (!tb || tb == Py_None) + tb = NULL; + else { + Py_INCREF(tb); + if (!PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto raise_error; + } + } + if (PyType_Check(type)) { +#if CYTHON_COMPILING_IN_PYPY + if (!value) { + Py_INCREF(Py_None); + value = Py_None; + } +#endif + PyErr_NormalizeException(&type, &value, &tb); + } else { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto raise_error; + } + value = type; + type = (PyObject*) Py_TYPE(type); + Py_INCREF(type); + if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto raise_error; + } + } + __Pyx_PyThreadState_assign + __Pyx_ErrRestore(type, value, tb); + return; +raise_error: + Py_XDECREF(value); + Py_XDECREF(type); + Py_XDECREF(tb); + return; +} +#else +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { + PyObject* owned_instance = NULL; + if (tb == Py_None) { + tb = 0; + } else if (tb && !PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto bad; + } + if (value == Py_None) + value = 0; + if (PyExceptionInstance_Check(type)) { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto bad; + } + value = type; + type = (PyObject*) Py_TYPE(value); + } else if (PyExceptionClass_Check(type)) { + PyObject *instance_class = NULL; + if (value && PyExceptionInstance_Check(value)) { + instance_class = (PyObject*) Py_TYPE(value); + if (instance_class != type) { + int is_subclass = PyObject_IsSubclass(instance_class, type); + if (!is_subclass) { + instance_class = NULL; + } else if (unlikely(is_subclass == -1)) { + goto bad; + } else { + type = instance_class; + } + } + } + if (!instance_class) { + PyObject *args; + if (!value) + args = PyTuple_New(0); + else if (PyTuple_Check(value)) { + Py_INCREF(value); + args = value; + } else + args = PyTuple_Pack(1, value); + if (!args) + goto bad; + owned_instance = PyObject_Call(type, args, NULL); + Py_DECREF(args); + if (!owned_instance) + goto bad; + value = owned_instance; + if (!PyExceptionInstance_Check(value)) { + PyErr_Format(PyExc_TypeError, + "calling %R should have returned an instance of " + "BaseException, not %R", + type, Py_TYPE(value)); + goto bad; + } + } + } else { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto bad; + } + if (cause) { + PyObject *fixed_cause; + if (cause == Py_None) { + fixed_cause = NULL; + } else if (PyExceptionClass_Check(cause)) { + fixed_cause = PyObject_CallObject(cause, NULL); + if (fixed_cause == NULL) + goto bad; + } else if (PyExceptionInstance_Check(cause)) { + fixed_cause = cause; + Py_INCREF(fixed_cause); + } else { + PyErr_SetString(PyExc_TypeError, + "exception causes must derive from " + "BaseException"); + goto bad; + } + PyException_SetCause(value, fixed_cause); + } + PyErr_SetObject(type, value); + if (tb) { +#if CYTHON_COMPILING_IN_PYPY + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); + Py_INCREF(tb); + PyErr_Restore(tmp_type, tmp_value, tb); + Py_XDECREF(tmp_tb); +#else + PyThreadState *tstate = __Pyx_PyThreadState_Current; + PyObject* tmp_tb = tstate->curexc_traceback; + if (tb != tmp_tb) { + Py_INCREF(tb); + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_tb); + } +#endif + } +bad: + Py_XDECREF(owned_instance); + return; +} +#endif + +/* PyObjectCall2Args */ +static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) { + PyObject *args, *result = NULL; + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(function)) { + PyObject *args[2] = {arg1, arg2}; + return __Pyx_PyFunction_FastCall(function, args, 2); + } + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(function)) { + PyObject *args[2] = {arg1, arg2}; + return __Pyx_PyCFunction_FastCall(function, args, 2); + } + #endif + args = PyTuple_New(2); + if (unlikely(!args)) goto done; + Py_INCREF(arg1); + PyTuple_SET_ITEM(args, 0, arg1); + Py_INCREF(arg2); + PyTuple_SET_ITEM(args, 1, arg2); + Py_INCREF(function); + result = __Pyx_PyObject_Call(function, args, NULL); + Py_DECREF(args); + Py_DECREF(function); +done: + return result; +} + +/* ExtTypeTest */ +static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { + if (unlikely(!type)) { + PyErr_SetString(PyExc_SystemError, "Missing type object"); + return 0; + } + if (likely(__Pyx_TypeCheck(obj, type))) + return 1; + PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s", + Py_TYPE(obj)->tp_name, type->tp_name); + return 0; +} + +/* PyObjectSetAttrStr */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) { + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_setattro)) + return tp->tp_setattro(obj, attr_name, value); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_setattr)) + return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value); +#endif + return PyObject_SetAttr(obj, attr_name, value); +} +#endif + +/* GetTopmostException */ +#if CYTHON_USE_EXC_INFO_STACK +static _PyErr_StackItem * +__Pyx_PyErr_GetTopmostException(PyThreadState *tstate) +{ + _PyErr_StackItem *exc_info = tstate->exc_info; + while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) && + exc_info->previous_item != NULL) + { + exc_info = exc_info->previous_item; + } + return exc_info; +} +#endif + +/* SaveResetException */ +#if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { + #if CYTHON_USE_EXC_INFO_STACK + _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate); + *type = exc_info->exc_type; + *value = exc_info->exc_value; + *tb = exc_info->exc_traceback; + #else + *type = tstate->exc_type; + *value = tstate->exc_value; + *tb = tstate->exc_traceback; + #endif + Py_XINCREF(*type); + Py_XINCREF(*value); + Py_XINCREF(*tb); +} +static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + #if CYTHON_USE_EXC_INFO_STACK + _PyErr_StackItem *exc_info = tstate->exc_info; + tmp_type = exc_info->exc_type; + tmp_value = exc_info->exc_value; + tmp_tb = exc_info->exc_traceback; + exc_info->exc_type = type; + exc_info->exc_value = value; + exc_info->exc_traceback = tb; + #else + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = type; + tstate->exc_value = value; + tstate->exc_traceback = tb; + #endif + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +} +#endif + +/* PyErrExceptionMatches */ +#if CYTHON_FAST_THREAD_STATE +static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { + Py_ssize_t i, n; + n = PyTuple_GET_SIZE(tuple); +#if PY_MAJOR_VERSION >= 3 + for (i=0; icurexc_type; + if (exc_type == err) return 1; + if (unlikely(!exc_type)) return 0; + if (unlikely(PyTuple_Check(err))) + return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err); + return __Pyx_PyErr_GivenExceptionMatches(exc_type, err); +} +#endif + +/* GetException */ +#if CYTHON_FAST_THREAD_STATE +static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) +#else +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) +#endif +{ + PyObject *local_type, *local_value, *local_tb; +#if CYTHON_FAST_THREAD_STATE + PyObject *tmp_type, *tmp_value, *tmp_tb; + local_type = tstate->curexc_type; + local_value = tstate->curexc_value; + local_tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +#else + PyErr_Fetch(&local_type, &local_value, &local_tb); +#endif + PyErr_NormalizeException(&local_type, &local_value, &local_tb); +#if CYTHON_FAST_THREAD_STATE + if (unlikely(tstate->curexc_type)) +#else + if (unlikely(PyErr_Occurred())) +#endif + goto bad; + #if PY_MAJOR_VERSION >= 3 + if (local_tb) { + if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) + goto bad; + } + #endif + Py_XINCREF(local_tb); + Py_XINCREF(local_type); + Py_XINCREF(local_value); + *type = local_type; + *value = local_value; + *tb = local_tb; +#if CYTHON_FAST_THREAD_STATE + #if CYTHON_USE_EXC_INFO_STACK + { + _PyErr_StackItem *exc_info = tstate->exc_info; + tmp_type = exc_info->exc_type; + tmp_value = exc_info->exc_value; + tmp_tb = exc_info->exc_traceback; + exc_info->exc_type = local_type; + exc_info->exc_value = local_value; + exc_info->exc_traceback = local_tb; + } + #else + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = local_type; + tstate->exc_value = local_value; + tstate->exc_traceback = local_tb; + #endif + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#else + PyErr_SetExcInfo(local_type, local_value, local_tb); +#endif + return 0; +bad: + *type = 0; + *value = 0; + *tb = 0; + Py_XDECREF(local_type); + Py_XDECREF(local_value); + Py_XDECREF(local_tb); + return -1; +} + +/* SwapException */ +#if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + #if CYTHON_USE_EXC_INFO_STACK + _PyErr_StackItem *exc_info = tstate->exc_info; + tmp_type = exc_info->exc_type; + tmp_value = exc_info->exc_value; + tmp_tb = exc_info->exc_traceback; + exc_info->exc_type = *type; + exc_info->exc_value = *value; + exc_info->exc_traceback = *tb; + #else + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = *type; + tstate->exc_value = *value; + tstate->exc_traceback = *tb; + #endif + *type = tmp_type; + *value = tmp_value; + *tb = tmp_tb; +} +#else +static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb); + PyErr_SetExcInfo(*type, *value, *tb); + *type = tmp_type; + *value = tmp_value; + *tb = tmp_tb; +} +#endif + +/* GetAttr */ +static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) { +#if CYTHON_USE_TYPE_SLOTS +#if PY_MAJOR_VERSION >= 3 + if (likely(PyUnicode_Check(n))) +#else + if (likely(PyString_Check(n))) +#endif + return __Pyx_PyObject_GetAttrStr(o, n); +#endif + return PyObject_GetAttr(o, n); +} + +/* KeywordStringCheck */ +static int __Pyx_CheckKeywordStrings( + PyObject *kwdict, + const char* function_name, + int kw_allowed) +{ + PyObject* key = 0; + Py_ssize_t pos = 0; +#if CYTHON_COMPILING_IN_PYPY + if (!kw_allowed && PyDict_Next(kwdict, &pos, &key, 0)) + goto invalid_keyword; + return 1; +#else + while (PyDict_Next(kwdict, &pos, &key, 0)) { + #if PY_MAJOR_VERSION < 3 + if (unlikely(!PyString_Check(key))) + #endif + if (unlikely(!PyUnicode_Check(key))) + goto invalid_keyword_type; + } + if ((!kw_allowed) && unlikely(key)) + goto invalid_keyword; + return 1; +invalid_keyword_type: + PyErr_Format(PyExc_TypeError, + "%.200s() keywords must be strings", function_name); + return 0; +#endif +invalid_keyword: + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION < 3 + "%.200s() got an unexpected keyword argument '%.200s'", + function_name, PyString_AsString(key)); + #else + "%s() got an unexpected keyword argument '%U'", + function_name, key); + #endif + return 0; +} + +/* UnpackUnboundCMethod */ +static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target) { + PyObject *method; + method = __Pyx_PyObject_GetAttrStr(target->type, *target->method_name); + if (unlikely(!method)) + return -1; + target->method = method; +#if CYTHON_COMPILING_IN_CPYTHON + #if PY_MAJOR_VERSION >= 3 + if (likely(__Pyx_TypeCheck(method, &PyMethodDescr_Type))) + #endif + { + PyMethodDescrObject *descr = (PyMethodDescrObject*) method; + target->func = descr->d_method->ml_meth; + target->flag = descr->d_method->ml_flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_STACKLESS); + } +#endif + return 0; +} + +/* CallUnboundCMethod2 */ +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030600B1 +static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2) { + if (likely(cfunc->func)) { + PyObject *args[2] = {arg1, arg2}; + if (cfunc->flag == METH_FASTCALL) { + #if PY_VERSION_HEX >= 0x030700A0 + return (*(__Pyx_PyCFunctionFast)(void*)(PyCFunction)cfunc->func)(self, args, 2); + #else + return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, 2, NULL); + #endif + } + #if PY_VERSION_HEX >= 0x030700A0 + if (cfunc->flag == (METH_FASTCALL | METH_KEYWORDS)) + return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, 2, NULL); + #endif + } + return __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2); +} +#endif +static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2){ + PyObject *args, *result = NULL; + if (unlikely(!cfunc->func && !cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL; +#if CYTHON_COMPILING_IN_CPYTHON + if (cfunc->func && (cfunc->flag & METH_VARARGS)) { + args = PyTuple_New(2); + if (unlikely(!args)) goto bad; + Py_INCREF(arg1); + PyTuple_SET_ITEM(args, 0, arg1); + Py_INCREF(arg2); + PyTuple_SET_ITEM(args, 1, arg2); + if (cfunc->flag & METH_KEYWORDS) + result = (*(PyCFunctionWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, NULL); + else + result = (*cfunc->func)(self, args); + } else { + args = PyTuple_New(3); + if (unlikely(!args)) goto bad; + Py_INCREF(self); + PyTuple_SET_ITEM(args, 0, self); + Py_INCREF(arg1); + PyTuple_SET_ITEM(args, 1, arg1); + Py_INCREF(arg2); + PyTuple_SET_ITEM(args, 2, arg2); + result = __Pyx_PyObject_Call(cfunc->method, args, NULL); + } +#else + args = PyTuple_Pack(3, self, arg1, arg2); + if (unlikely(!args)) goto bad; + result = __Pyx_PyObject_Call(cfunc->method, args, NULL); +#endif +bad: + Py_XDECREF(args); + return result; +} + +/* CallUnboundCMethod1 */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg) { + if (likely(cfunc->func)) { + int flag = cfunc->flag; + if (flag == METH_O) { + return (*(cfunc->func))(self, arg); + } else if (PY_VERSION_HEX >= 0x030600B1 && flag == METH_FASTCALL) { + if (PY_VERSION_HEX >= 0x030700A0) { + return (*(__Pyx_PyCFunctionFast)(void*)(PyCFunction)cfunc->func)(self, &arg, 1); + } else { + return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, &arg, 1, NULL); + } + } else if (PY_VERSION_HEX >= 0x030700A0 && flag == (METH_FASTCALL | METH_KEYWORDS)) { + return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, &arg, 1, NULL); + } + } + return __Pyx__CallUnboundCMethod1(cfunc, self, arg); +} +#endif +static PyObject* __Pyx__CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg){ + PyObject *args, *result = NULL; + if (unlikely(!cfunc->func && !cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL; +#if CYTHON_COMPILING_IN_CPYTHON + if (cfunc->func && (cfunc->flag & METH_VARARGS)) { + args = PyTuple_New(1); + if (unlikely(!args)) goto bad; + Py_INCREF(arg); + PyTuple_SET_ITEM(args, 0, arg); + if (cfunc->flag & METH_KEYWORDS) + result = (*(PyCFunctionWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, NULL); + else + result = (*cfunc->func)(self, args); + } else { + args = PyTuple_New(2); + if (unlikely(!args)) goto bad; + Py_INCREF(self); + PyTuple_SET_ITEM(args, 0, self); + Py_INCREF(arg); + PyTuple_SET_ITEM(args, 1, arg); + result = __Pyx_PyObject_Call(cfunc->method, args, NULL); + } +#else + args = PyTuple_Pack(2, self, arg); + if (unlikely(!args)) goto bad; + result = __Pyx_PyObject_Call(cfunc->method, args, NULL); +#endif +bad: + Py_XDECREF(args); + return result; +} + +/* py_dict_pop */ +static CYTHON_INLINE PyObject *__Pyx_PyDict_Pop(PyObject *d, PyObject *key, PyObject *default_value) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX > 0x030600B3 + if ((1)) { + return _PyDict_Pop(d, key, default_value); + } else +#endif + if (default_value) { + return __Pyx_CallUnboundCMethod2(&__pyx_umethod_PyDict_Type_pop, d, key, default_value); + } else { + return __Pyx_CallUnboundCMethod1(&__pyx_umethod_PyDict_Type_pop, d, key); + } +} + +/* RaiseTooManyValuesToUnpack */ +static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { + PyErr_Format(PyExc_ValueError, + "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected); +} + +/* RaiseNeedMoreValuesToUnpack */ +static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { + PyErr_Format(PyExc_ValueError, + "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack", + index, (index == 1) ? "" : "s"); +} + +/* IterFinish */ +static CYTHON_INLINE int __Pyx_IterFinish(void) { +#if CYTHON_FAST_THREAD_STATE + PyThreadState *tstate = __Pyx_PyThreadState_Current; + PyObject* exc_type = tstate->curexc_type; + if (unlikely(exc_type)) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) { + PyObject *exc_value, *exc_tb; + exc_value = tstate->curexc_value; + exc_tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; + Py_DECREF(exc_type); + Py_XDECREF(exc_value); + Py_XDECREF(exc_tb); + return 0; + } else { + return -1; + } + } + return 0; +#else + if (unlikely(PyErr_Occurred())) { + if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) { + PyErr_Clear(); + return 0; + } else { + return -1; + } + } + return 0; +#endif +} + +/* UnpackItemEndCheck */ +static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { + if (unlikely(retval)) { + Py_DECREF(retval); + __Pyx_RaiseTooManyValuesError(expected); + return -1; + } else { + return __Pyx_IterFinish(); + } + return 0; +} + +/* None */ +static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) { + PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname); +} + +/* CallNextTpDealloc */ +static void __Pyx_call_next_tp_dealloc(PyObject* obj, destructor current_tp_dealloc) { + PyTypeObject* type = Py_TYPE(obj); + while (type && type->tp_dealloc != current_tp_dealloc) + type = type->tp_base; + while (type && type->tp_dealloc == current_tp_dealloc) + type = type->tp_base; + if (type) + type->tp_dealloc(obj); +} + +/* CallNextTpTraverse */ +static int __Pyx_call_next_tp_traverse(PyObject* obj, visitproc v, void *a, traverseproc current_tp_traverse) { + PyTypeObject* type = Py_TYPE(obj); + while (type && type->tp_traverse != current_tp_traverse) + type = type->tp_base; + while (type && type->tp_traverse == current_tp_traverse) + type = type->tp_base; + if (type && type->tp_traverse) + return type->tp_traverse(obj, v, a); + return 0; +} + +/* CallNextTpClear */ +static void __Pyx_call_next_tp_clear(PyObject* obj, inquiry current_tp_clear) { + PyTypeObject* type = Py_TYPE(obj); + while (type && type->tp_clear != current_tp_clear) + type = type->tp_base; + while (type && type->tp_clear == current_tp_clear) + type = type->tp_base; + if (type && type->tp_clear) + type->tp_clear(obj); +} + +/* PyObject_GenericGetAttrNoDict */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) { + PyErr_Format(PyExc_AttributeError, +#if PY_MAJOR_VERSION >= 3 + "'%.50s' object has no attribute '%U'", + tp->tp_name, attr_name); +#else + "'%.50s' object has no attribute '%.400s'", + tp->tp_name, PyString_AS_STRING(attr_name)); +#endif + return NULL; +} +static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) { + PyObject *descr; + PyTypeObject *tp = Py_TYPE(obj); + if (unlikely(!PyString_Check(attr_name))) { + return PyObject_GenericGetAttr(obj, attr_name); + } + assert(!tp->tp_dictoffset); + descr = _PyType_Lookup(tp, attr_name); + if (unlikely(!descr)) { + return __Pyx_RaiseGenericGetAttributeError(tp, attr_name); + } + Py_INCREF(descr); + #if PY_MAJOR_VERSION < 3 + if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS))) + #endif + { + descrgetfunc f = Py_TYPE(descr)->tp_descr_get; + if (unlikely(f)) { + PyObject *res = f(descr, obj, (PyObject *)tp); + Py_DECREF(descr); + return res; + } + } + return descr; +} +#endif + +/* TypeImport */ +#ifndef __PYX_HAVE_RT_ImportType +#define __PYX_HAVE_RT_ImportType +static PyTypeObject *__Pyx_ImportType(PyObject *module, const char *module_name, const char *class_name, + size_t size, enum __Pyx_ImportType_CheckSize check_size) +{ + PyObject *result = 0; + char warning[200]; + Py_ssize_t basicsize; +#ifdef Py_LIMITED_API + PyObject *py_basicsize; +#endif + result = PyObject_GetAttrString(module, class_name); + if (!result) + goto bad; + if (!PyType_Check(result)) { + PyErr_Format(PyExc_TypeError, + "%.200s.%.200s is not a type object", + module_name, class_name); + goto bad; + } +#ifndef Py_LIMITED_API + basicsize = ((PyTypeObject *)result)->tp_basicsize; +#else + py_basicsize = PyObject_GetAttrString(result, "__basicsize__"); + if (!py_basicsize) + goto bad; + basicsize = PyLong_AsSsize_t(py_basicsize); + Py_DECREF(py_basicsize); + py_basicsize = 0; + if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred()) + goto bad; +#endif + if ((size_t)basicsize < size) { + PyErr_Format(PyExc_ValueError, + "%.200s.%.200s size changed, may indicate binary incompatibility. " + "Expected %zd from C header, got %zd from PyObject", + module_name, class_name, size, basicsize); + goto bad; + } + if (check_size == __Pyx_ImportType_CheckSize_Error && (size_t)basicsize != size) { + PyErr_Format(PyExc_ValueError, + "%.200s.%.200s size changed, may indicate binary incompatibility. " + "Expected %zd from C header, got %zd from PyObject", + module_name, class_name, size, basicsize); + goto bad; + } + else if (check_size == __Pyx_ImportType_CheckSize_Warn && (size_t)basicsize > size) { + PyOS_snprintf(warning, sizeof(warning), + "%s.%s size changed, may indicate binary incompatibility. " + "Expected %zd from C header, got %zd from PyObject", + module_name, class_name, size, basicsize); + if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad; + } + return (PyTypeObject *)result; +bad: + Py_XDECREF(result); + return NULL; +} +#endif + +/* GetVTable */ +static void* __Pyx_GetVtable(PyObject *dict) { + void* ptr; + PyObject *ob = PyObject_GetItem(dict, __pyx_n_s_pyx_vtable); + if (!ob) + goto bad; +#if PY_VERSION_HEX >= 0x02070000 + ptr = PyCapsule_GetPointer(ob, 0); +#else + ptr = PyCObject_AsVoidPtr(ob); +#endif + if (!ptr && !PyErr_Occurred()) + PyErr_SetString(PyExc_RuntimeError, "invalid vtable found for imported type"); + Py_DECREF(ob); + return ptr; +bad: + Py_XDECREF(ob); + return NULL; +} + +/* PyObject_GenericGetAttr */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) { + if (unlikely(Py_TYPE(obj)->tp_dictoffset)) { + return PyObject_GenericGetAttr(obj, attr_name); + } + return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name); +} +#endif + +/* SetVTable */ +static int __Pyx_SetVtable(PyObject *dict, void *vtable) { +#if PY_VERSION_HEX >= 0x02070000 + PyObject *ob = PyCapsule_New(vtable, 0, 0); +#else + PyObject *ob = PyCObject_FromVoidPtr(vtable, 0); +#endif + if (!ob) + goto bad; + if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0) + goto bad; + Py_DECREF(ob); + return 0; +bad: + Py_XDECREF(ob); + return -1; +} + +/* Import */ +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { + PyObject *empty_list = 0; + PyObject *module = 0; + PyObject *global_dict = 0; + PyObject *empty_dict = 0; + PyObject *list; + #if PY_MAJOR_VERSION < 3 + PyObject *py_import; + py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); + if (!py_import) + goto bad; + #endif + if (from_list) + list = from_list; + else { + empty_list = PyList_New(0); + if (!empty_list) + goto bad; + list = empty_list; + } + global_dict = PyModule_GetDict(__pyx_m); + if (!global_dict) + goto bad; + empty_dict = PyDict_New(); + if (!empty_dict) + goto bad; + { + #if PY_MAJOR_VERSION >= 3 + if (level == -1) { + if (strchr(__Pyx_MODULE_NAME, '.')) { + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, 1); + if (!module) { + if (!PyErr_ExceptionMatches(PyExc_ImportError)) + goto bad; + PyErr_Clear(); + } + } + level = 0; + } + #endif + if (!module) { + #if PY_MAJOR_VERSION < 3 + PyObject *py_level = PyInt_FromLong(level); + if (!py_level) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, py_level, (PyObject *)NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, level); + #endif + } + } +bad: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(py_import); + #endif + Py_XDECREF(empty_list); + Py_XDECREF(empty_dict); + return module; +} + +/* ImportFrom */ +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { + PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); + if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_Format(PyExc_ImportError, + #if PY_MAJOR_VERSION < 3 + "cannot import name %.230s", PyString_AS_STRING(name)); + #else + "cannot import name %S", name); + #endif + } + return value; +} + +/* GetModuleGlobalName */ +#if CYTHON_USE_DICT_VERSIONS +static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value) +#else +static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) +#endif +{ + PyObject *result; +#if !CYTHON_AVOID_BORROWED_REFS +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 + result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } else if (unlikely(PyErr_Occurred())) { + return NULL; + } +#else + result = PyDict_GetItem(__pyx_d, name); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } +#endif +#else + result = PyObject_GetItem(__pyx_d, name); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } + PyErr_Clear(); +#endif + return __Pyx_GetBuiltinName(name); +} + +/* GetNameInClass */ +static PyObject *__Pyx_GetGlobalNameAfterAttributeLookup(PyObject *name) { + PyObject *result; + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) + return NULL; + __Pyx_PyErr_Clear(); + __Pyx_GetModuleGlobalNameUncached(result, name); + return result; +} +static PyObject *__Pyx__GetNameInClass(PyObject *nmspace, PyObject *name) { + PyObject *result; + result = __Pyx_PyObject_GetAttrStr(nmspace, name); + if (!result) { + result = __Pyx_GetGlobalNameAfterAttributeLookup(name); + } + return result; +} + +/* FetchCommonType */ +static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { + PyObject* fake_module; + PyTypeObject* cached_type = NULL; + fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI); + if (!fake_module) return NULL; + Py_INCREF(fake_module); + cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name); + if (cached_type) { + if (!PyType_Check((PyObject*)cached_type)) { + PyErr_Format(PyExc_TypeError, + "Shared Cython type %.200s is not a type object", + type->tp_name); + goto bad; + } + if (cached_type->tp_basicsize != type->tp_basicsize) { + PyErr_Format(PyExc_TypeError, + "Shared Cython type %.200s has the wrong size, try recompiling", + type->tp_name); + goto bad; + } + } else { + if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; + PyErr_Clear(); + if (PyType_Ready(type) < 0) goto bad; + if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0) + goto bad; + Py_INCREF(type); + cached_type = type; + } +done: + Py_DECREF(fake_module); + return cached_type; +bad: + Py_XDECREF(cached_type); + cached_type = NULL; + goto done; +} + +/* CythonFunction */ +#include +static PyObject * +__Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure) +{ + if (unlikely(op->func_doc == NULL)) { + if (op->func.m_ml->ml_doc) { +#if PY_MAJOR_VERSION >= 3 + op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc); +#else + op->func_doc = PyString_FromString(op->func.m_ml->ml_doc); +#endif + if (unlikely(op->func_doc == NULL)) + return NULL; + } else { + Py_INCREF(Py_None); + return Py_None; + } + } + Py_INCREF(op->func_doc); + return op->func_doc; +} +static int +__Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context) +{ + PyObject *tmp = op->func_doc; + if (value == NULL) { + value = Py_None; + } + Py_INCREF(value); + op->func_doc = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + if (unlikely(op->func_name == NULL)) { +#if PY_MAJOR_VERSION >= 3 + op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name); +#else + op->func_name = PyString_InternFromString(op->func.m_ml->ml_name); +#endif + if (unlikely(op->func_name == NULL)) + return NULL; + } + Py_INCREF(op->func_name); + return op->func_name; +} +static int +__Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context) +{ + PyObject *tmp; +#if PY_MAJOR_VERSION >= 3 + if (unlikely(value == NULL || !PyUnicode_Check(value))) +#else + if (unlikely(value == NULL || !PyString_Check(value))) +#endif + { + PyErr_SetString(PyExc_TypeError, + "__name__ must be set to a string object"); + return -1; + } + tmp = op->func_name; + Py_INCREF(value); + op->func_name = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + Py_INCREF(op->func_qualname); + return op->func_qualname; +} +static int +__Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context) +{ + PyObject *tmp; +#if PY_MAJOR_VERSION >= 3 + if (unlikely(value == NULL || !PyUnicode_Check(value))) +#else + if (unlikely(value == NULL || !PyString_Check(value))) +#endif + { + PyErr_SetString(PyExc_TypeError, + "__qualname__ must be set to a string object"); + return -1; + } + tmp = op->func_qualname; + Py_INCREF(value); + op->func_qualname = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED void *closure) +{ + PyObject *self; + self = m->func_closure; + if (self == NULL) + self = Py_None; + Py_INCREF(self); + return self; +} +static PyObject * +__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + if (unlikely(op->func_dict == NULL)) { + op->func_dict = PyDict_New(); + if (unlikely(op->func_dict == NULL)) + return NULL; + } + Py_INCREF(op->func_dict); + return op->func_dict; +} +static int +__Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context) +{ + PyObject *tmp; + if (unlikely(value == NULL)) { + PyErr_SetString(PyExc_TypeError, + "function's dictionary may not be deleted"); + return -1; + } + if (unlikely(!PyDict_Check(value))) { + PyErr_SetString(PyExc_TypeError, + "setting function's dictionary to a non-dict"); + return -1; + } + tmp = op->func_dict; + Py_INCREF(value); + op->func_dict = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + Py_INCREF(op->func_globals); + return op->func_globals; +} +static PyObject * +__Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + Py_INCREF(Py_None); + return Py_None; +} +static PyObject * +__Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + PyObject* result = (op->func_code) ? op->func_code : Py_None; + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { + int result = 0; + PyObject *res = op->defaults_getter((PyObject *) op); + if (unlikely(!res)) + return -1; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + op->defaults_tuple = PyTuple_GET_ITEM(res, 0); + Py_INCREF(op->defaults_tuple); + op->defaults_kwdict = PyTuple_GET_ITEM(res, 1); + Py_INCREF(op->defaults_kwdict); + #else + op->defaults_tuple = PySequence_ITEM(res, 0); + if (unlikely(!op->defaults_tuple)) result = -1; + else { + op->defaults_kwdict = PySequence_ITEM(res, 1); + if (unlikely(!op->defaults_kwdict)) result = -1; + } + #endif + Py_DECREF(res); + return result; +} +static int +__Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) { + PyObject* tmp; + if (!value) { + value = Py_None; + } else if (value != Py_None && !PyTuple_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__defaults__ must be set to a tuple object"); + return -1; + } + Py_INCREF(value); + tmp = op->defaults_tuple; + op->defaults_tuple = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) { + PyObject* result = op->defaults_tuple; + if (unlikely(!result)) { + if (op->defaults_getter) { + if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL; + result = op->defaults_tuple; + } else { + result = Py_None; + } + } + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) { + PyObject* tmp; + if (!value) { + value = Py_None; + } else if (value != Py_None && !PyDict_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__kwdefaults__ must be set to a dict object"); + return -1; + } + Py_INCREF(value); + tmp = op->defaults_kwdict; + op->defaults_kwdict = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) { + PyObject* result = op->defaults_kwdict; + if (unlikely(!result)) { + if (op->defaults_getter) { + if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL; + result = op->defaults_kwdict; + } else { + result = Py_None; + } + } + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) { + PyObject* tmp; + if (!value || value == Py_None) { + value = NULL; + } else if (!PyDict_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__annotations__ must be set to a dict object"); + return -1; + } + Py_XINCREF(value); + tmp = op->func_annotations; + op->func_annotations = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) { + PyObject* result = op->func_annotations; + if (unlikely(!result)) { + result = PyDict_New(); + if (unlikely(!result)) return NULL; + op->func_annotations = result; + } + Py_INCREF(result); + return result; +} +static PyGetSetDef __pyx_CyFunction_getsets[] = { + {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, + {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, + {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, + {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, + {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, + {(char *) "__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0}, + {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, + {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, + {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, + {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, + {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, + {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, + {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, + {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, + {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, + {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, + {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, + {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, + {0, 0, 0, 0, 0} +}; +static PyMemberDef __pyx_CyFunction_members[] = { + {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), PY_WRITE_RESTRICTED, 0}, + {0, 0, 0, 0, 0} +}; +static PyObject * +__Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args) +{ +#if PY_MAJOR_VERSION >= 3 + return PyUnicode_FromString(m->func.m_ml->ml_name); +#else + return PyString_FromString(m->func.m_ml->ml_name); +#endif +} +static PyMethodDef __pyx_CyFunction_methods[] = { + {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, + {0, 0, 0, 0} +}; +#if PY_VERSION_HEX < 0x030500A0 +#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist) +#else +#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func.m_weakreflist) +#endif +static PyObject *__Pyx_CyFunction_New(PyTypeObject *type, PyMethodDef *ml, int flags, PyObject* qualname, + PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { + __pyx_CyFunctionObject *op = PyObject_GC_New(__pyx_CyFunctionObject, type); + if (op == NULL) + return NULL; + op->flags = flags; + __Pyx_CyFunction_weakreflist(op) = NULL; + op->func.m_ml = ml; + op->func.m_self = (PyObject *) op; + Py_XINCREF(closure); + op->func_closure = closure; + Py_XINCREF(module); + op->func.m_module = module; + op->func_dict = NULL; + op->func_name = NULL; + Py_INCREF(qualname); + op->func_qualname = qualname; + op->func_doc = NULL; + op->func_classobj = NULL; + op->func_globals = globals; + Py_INCREF(op->func_globals); + Py_XINCREF(code); + op->func_code = code; + op->defaults_pyobjects = 0; + op->defaults = NULL; + op->defaults_tuple = NULL; + op->defaults_kwdict = NULL; + op->defaults_getter = NULL; + op->func_annotations = NULL; + PyObject_GC_Track(op); + return (PyObject *) op; +} +static int +__Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) +{ + Py_CLEAR(m->func_closure); + Py_CLEAR(m->func.m_module); + Py_CLEAR(m->func_dict); + Py_CLEAR(m->func_name); + Py_CLEAR(m->func_qualname); + Py_CLEAR(m->func_doc); + Py_CLEAR(m->func_globals); + Py_CLEAR(m->func_code); + Py_CLEAR(m->func_classobj); + Py_CLEAR(m->defaults_tuple); + Py_CLEAR(m->defaults_kwdict); + Py_CLEAR(m->func_annotations); + if (m->defaults) { + PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); + int i; + for (i = 0; i < m->defaults_pyobjects; i++) + Py_XDECREF(pydefaults[i]); + PyObject_Free(m->defaults); + m->defaults = NULL; + } + return 0; +} +static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m) +{ + if (__Pyx_CyFunction_weakreflist(m) != NULL) + PyObject_ClearWeakRefs((PyObject *) m); + __Pyx_CyFunction_clear(m); + PyObject_GC_Del(m); +} +static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) +{ + PyObject_GC_UnTrack(m); + __Pyx__CyFunction_dealloc(m); +} +static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) +{ + Py_VISIT(m->func_closure); + Py_VISIT(m->func.m_module); + Py_VISIT(m->func_dict); + Py_VISIT(m->func_name); + Py_VISIT(m->func_qualname); + Py_VISIT(m->func_doc); + Py_VISIT(m->func_globals); + Py_VISIT(m->func_code); + Py_VISIT(m->func_classobj); + Py_VISIT(m->defaults_tuple); + Py_VISIT(m->defaults_kwdict); + if (m->defaults) { + PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); + int i; + for (i = 0; i < m->defaults_pyobjects; i++) + Py_VISIT(pydefaults[i]); + } + return 0; +} +static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type) +{ + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) { + Py_INCREF(func); + return func; + } + if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) { + if (type == NULL) + type = (PyObject *)(Py_TYPE(obj)); + return __Pyx_PyMethod_New(func, type, (PyObject *)(Py_TYPE(type))); + } + if (obj == Py_None) + obj = NULL; + return __Pyx_PyMethod_New(func, obj, type); +} +static PyObject* +__Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) +{ +#if PY_MAJOR_VERSION >= 3 + return PyUnicode_FromFormat("", + op->func_qualname, (void *)op); +#else + return PyString_FromFormat("", + PyString_AsString(op->func_qualname), (void *)op); +#endif +} +static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) { + PyCFunctionObject* f = (PyCFunctionObject*)func; + PyCFunction meth = f->m_ml->ml_meth; + Py_ssize_t size; + switch (f->m_ml->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) { + case METH_VARARGS: + if (likely(kw == NULL || PyDict_Size(kw) == 0)) + return (*meth)(self, arg); + break; + case METH_VARARGS | METH_KEYWORDS: + return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw); + case METH_NOARGS: + if (likely(kw == NULL || PyDict_Size(kw) == 0)) { + size = PyTuple_GET_SIZE(arg); + if (likely(size == 0)) + return (*meth)(self, NULL); + PyErr_Format(PyExc_TypeError, + "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", + f->m_ml->ml_name, size); + return NULL; + } + break; + case METH_O: + if (likely(kw == NULL || PyDict_Size(kw) == 0)) { + size = PyTuple_GET_SIZE(arg); + if (likely(size == 1)) { + PyObject *result, *arg0; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + arg0 = PyTuple_GET_ITEM(arg, 0); + #else + arg0 = PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL; + #endif + result = (*meth)(self, arg0); + #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) + Py_DECREF(arg0); + #endif + return result; + } + PyErr_Format(PyExc_TypeError, + "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", + f->m_ml->ml_name, size); + return NULL; + } + break; + default: + PyErr_SetString(PyExc_SystemError, "Bad call flags in " + "__Pyx_CyFunction_Call. METH_OLDARGS is no " + "longer supported!"); + return NULL; + } + PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", + f->m_ml->ml_name); + return NULL; +} +static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { + return __Pyx_CyFunction_CallMethod(func, ((PyCFunctionObject*)func)->m_self, arg, kw); +} +static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) { + PyObject *result; + __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func; + if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { + Py_ssize_t argc; + PyObject *new_args; + PyObject *self; + argc = PyTuple_GET_SIZE(args); + new_args = PyTuple_GetSlice(args, 1, argc); + if (unlikely(!new_args)) + return NULL; + self = PyTuple_GetItem(args, 0); + if (unlikely(!self)) { + Py_DECREF(new_args); + return NULL; + } + result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw); + Py_DECREF(new_args); + } else { + result = __Pyx_CyFunction_Call(func, args, kw); + } + return result; +} +static PyTypeObject __pyx_CyFunctionType_type = { + PyVarObject_HEAD_INIT(0, 0) + "cython_function_or_method", + sizeof(__pyx_CyFunctionObject), + 0, + (destructor) __Pyx_CyFunction_dealloc, + 0, + 0, + 0, +#if PY_MAJOR_VERSION < 3 + 0, +#else + 0, +#endif + (reprfunc) __Pyx_CyFunction_repr, + 0, + 0, + 0, + 0, + __Pyx_CyFunction_CallAsMethod, + 0, + 0, + 0, + 0, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, + 0, + (traverseproc) __Pyx_CyFunction_traverse, + (inquiry) __Pyx_CyFunction_clear, + 0, +#if PY_VERSION_HEX < 0x030500A0 + offsetof(__pyx_CyFunctionObject, func_weakreflist), +#else + offsetof(PyCFunctionObject, m_weakreflist), +#endif + 0, + 0, + __pyx_CyFunction_methods, + __pyx_CyFunction_members, + __pyx_CyFunction_getsets, + 0, + 0, + __Pyx_CyFunction_descr_get, + 0, + offsetof(__pyx_CyFunctionObject, func_dict), + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, +#if PY_VERSION_HEX >= 0x030400a1 + 0, +#endif +}; +static int __pyx_CyFunction_init(void) { + __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); + if (unlikely(__pyx_CyFunctionType == NULL)) { + return -1; + } + return 0; +} +static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults = PyObject_Malloc(size); + if (unlikely(!m->defaults)) + return PyErr_NoMemory(); + memset(m->defaults, 0, size); + m->defaults_pyobjects = pyobjects; + return m->defaults; +} +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults_tuple = tuple; + Py_INCREF(tuple); +} +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults_kwdict = dict; + Py_INCREF(dict); +} +static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->func_annotations = dict; + Py_INCREF(dict); +} + +/* Globals */ +static PyObject* __Pyx_Globals(void) { + Py_ssize_t i; + PyObject *names; + PyObject *globals = __pyx_d; + Py_INCREF(globals); + names = PyObject_Dir(__pyx_m); + if (!names) + goto bad; + for (i = PyList_GET_SIZE(names)-1; i >= 0; i--) { +#if CYTHON_COMPILING_IN_PYPY + PyObject* name = PySequence_ITEM(names, i); + if (!name) + goto bad; +#else + PyObject* name = PyList_GET_ITEM(names, i); +#endif + if (!PyDict_Contains(globals, name)) { + PyObject* value = __Pyx_GetAttr(__pyx_m, name); + if (!value) { +#if CYTHON_COMPILING_IN_PYPY + Py_DECREF(name); +#endif + goto bad; + } + if (PyDict_SetItem(globals, name, value) < 0) { +#if CYTHON_COMPILING_IN_PYPY + Py_DECREF(name); +#endif + Py_DECREF(value); + goto bad; + } + } +#if CYTHON_COMPILING_IN_PYPY + Py_DECREF(name); +#endif + } + Py_DECREF(names); + return globals; +bad: + Py_XDECREF(names); + Py_XDECREF(globals); + return NULL; +} + +/* CLineInTraceback */ +#ifndef CYTHON_CLINE_IN_TRACEBACK +static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { + PyObject *use_cline; + PyObject *ptype, *pvalue, *ptraceback; +#if CYTHON_COMPILING_IN_CPYTHON + PyObject **cython_runtime_dict; +#endif + if (unlikely(!__pyx_cython_runtime)) { + return c_line; + } + __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); +#if CYTHON_COMPILING_IN_CPYTHON + cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); + if (likely(cython_runtime_dict)) { + __PYX_PY_DICT_LOOKUP_IF_MODIFIED( + use_cline, *cython_runtime_dict, + __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback)) + } else +#endif + { + PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback); + if (use_cline_obj) { + use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; + Py_DECREF(use_cline_obj); + } else { + PyErr_Clear(); + use_cline = NULL; + } + } + if (!use_cline) { + c_line = 0; + PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); + } + else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { + c_line = 0; + } + __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); + return c_line; +} +#endif + +/* CodeObjectCache */ +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { + int start = 0, mid = 0, end = count - 1; + if (end >= 0 && code_line > entries[end].code_line) { + return count; + } + while (start < end) { + mid = start + (end - start) / 2; + if (code_line < entries[mid].code_line) { + end = mid; + } else if (code_line > entries[mid].code_line) { + start = mid + 1; + } else { + return mid; + } + } + if (code_line <= entries[mid].code_line) { + return mid; + } else { + return mid + 1; + } +} +static PyCodeObject *__pyx_find_code_object(int code_line) { + PyCodeObject* code_object; + int pos; + if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { + return NULL; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { + return NULL; + } + code_object = __pyx_code_cache.entries[pos].code_object; + Py_INCREF(code_object); + return code_object; +} +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { + int pos, i; + __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; + if (unlikely(!code_line)) { + return; + } + if (unlikely(!entries)) { + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); + if (likely(entries)) { + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = 64; + __pyx_code_cache.count = 1; + entries[0].code_line = code_line; + entries[0].code_object = code_object; + Py_INCREF(code_object); + } + return; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { + PyCodeObject* tmp = entries[pos].code_object; + entries[pos].code_object = code_object; + Py_DECREF(tmp); + return; + } + if (__pyx_code_cache.count == __pyx_code_cache.max_count) { + int new_max = __pyx_code_cache.max_count + 64; + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( + __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry)); + if (unlikely(!entries)) { + return; + } + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = new_max; + } + for (i=__pyx_code_cache.count; i>pos; i--) { + entries[i] = entries[i-1]; + } + entries[pos].code_line = code_line; + entries[pos].code_object = code_object; + __pyx_code_cache.count++; + Py_INCREF(code_object); +} + +/* AddTraceback */ +#include "compile.h" +#include "frameobject.h" +#include "traceback.h" +static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( + const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyObject *py_srcfile = 0; + PyObject *py_funcname = 0; + #if PY_MAJOR_VERSION < 3 + py_srcfile = PyString_FromString(filename); + #else + py_srcfile = PyUnicode_FromString(filename); + #endif + if (!py_srcfile) goto bad; + if (c_line) { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + #else + py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + #endif + } + else { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromString(funcname); + #else + py_funcname = PyUnicode_FromString(funcname); + #endif + } + if (!py_funcname) goto bad; + py_code = __Pyx_PyCode_New( + 0, + 0, + 0, + 0, + 0, + __pyx_empty_bytes, /*PyObject *code,*/ + __pyx_empty_tuple, /*PyObject *consts,*/ + __pyx_empty_tuple, /*PyObject *names,*/ + __pyx_empty_tuple, /*PyObject *varnames,*/ + __pyx_empty_tuple, /*PyObject *freevars,*/ + __pyx_empty_tuple, /*PyObject *cellvars,*/ + py_srcfile, /*PyObject *filename,*/ + py_funcname, /*PyObject *name,*/ + py_line, + __pyx_empty_bytes /*PyObject *lnotab*/ + ); + Py_DECREF(py_srcfile); + Py_DECREF(py_funcname); + return py_code; +bad: + Py_XDECREF(py_srcfile); + Py_XDECREF(py_funcname); + return NULL; +} +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyFrameObject *py_frame = 0; + PyThreadState *tstate = __Pyx_PyThreadState_Current; + if (c_line) { + c_line = __Pyx_CLineForTraceback(tstate, c_line); + } + py_code = __pyx_find_code_object(c_line ? -c_line : py_line); + if (!py_code) { + py_code = __Pyx_CreateCodeObjectForTraceback( + funcname, c_line, py_line, filename); + if (!py_code) goto bad; + __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); + } + py_frame = PyFrame_New( + tstate, /*PyThreadState *tstate,*/ + py_code, /*PyCodeObject *code,*/ + __pyx_d, /*PyObject *globals,*/ + 0 /*PyObject *locals*/ + ); + if (!py_frame) goto bad; + __Pyx_PyFrame_SetLineNumber(py_frame, py_line); + PyTraceBack_Here(py_frame); +bad: + Py_XDECREF(py_code); + Py_XDECREF(py_frame); +} + +/* CIntToPy */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { + const int neg_one = (int) ((int) 0 - (int) 1), const_zero = (int) 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(int) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(int) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(int) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(int), + little, !is_unsigned); + } +} + +/* CIntFromPyVerify */ +#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ + __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) +#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ + __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) +#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ + {\ + func_type value = func_value;\ + if (sizeof(target_type) < sizeof(func_type)) {\ + if (unlikely(value != (func_type) (target_type) value)) {\ + func_type zero = 0;\ + if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ + return (target_type) -1;\ + if (is_unsigned && unlikely(value < zero))\ + goto raise_neg_overflow;\ + else\ + goto raise_overflow;\ + }\ + }\ + return (target_type) value;\ + } + +/* CIntToPy */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { + const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(long) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(long) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(long) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(long), + little, !is_unsigned); + } +} + +/* CIntFromPy */ +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { + const int neg_one = (int) ((int) 0 - (int) 1), const_zero = (int) 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(int) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (int) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (int) 0; + case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0]) + case 2: + if (8 * sizeof(int) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) { + return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + case 3: + if (8 * sizeof(int) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) { + return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + case 4: + if (8 * sizeof(int) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) { + return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (int) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if (sizeof(int) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (int) 0; + case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0])) + case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0]) + case -2: + if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { + return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 2: + if (8 * sizeof(int) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { + return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case -3: + if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { + return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 3: + if (8 * sizeof(int) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { + return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case -4: + if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { + return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 4: + if (8 * sizeof(int) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { + return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + } +#endif + if (sizeof(int) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + int val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (int) -1; + } + } else { + int val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (int) -1; + val = __Pyx_PyInt_As_int(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to int"); + return (int) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to int"); + return (int) -1; +} + +/* CIntFromPy */ +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { + const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(long) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (long) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (long) 0; + case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0]) + case 2: + if (8 * sizeof(long) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) { + return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + case 3: + if (8 * sizeof(long) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) { + return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + case 4: + if (8 * sizeof(long) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) { + return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (long) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if (sizeof(long) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (long) 0; + case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0])) + case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0]) + case -2: + if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 2: + if (8 * sizeof(long) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case -3: + if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 3: + if (8 * sizeof(long) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case -4: + if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 4: + if (8 * sizeof(long) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + } +#endif + if (sizeof(long) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + long val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (long) -1; + } + } else { + long val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (long) -1; + val = __Pyx_PyInt_As_long(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to long"); + return (long) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to long"); + return (long) -1; +} + +/* FastTypeChecks */ +#if CYTHON_COMPILING_IN_CPYTHON +static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) { + while (a) { + a = a->tp_base; + if (a == b) + return 1; + } + return b == &PyBaseObject_Type; +} +static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) { + PyObject *mro; + if (a == b) return 1; + mro = a->tp_mro; + if (likely(mro)) { + Py_ssize_t i, n; + n = PyTuple_GET_SIZE(mro); + for (i = 0; i < n; i++) { + if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b) + return 1; + } + return 0; + } + return __Pyx_InBases(a, b); +} +#if PY_MAJOR_VERSION == 2 +static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { + PyObject *exception, *value, *tb; + int res; + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ErrFetch(&exception, &value, &tb); + res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; + if (unlikely(res == -1)) { + PyErr_WriteUnraisable(err); + res = 0; + } + if (!res) { + res = PyObject_IsSubclass(err, exc_type2); + if (unlikely(res == -1)) { + PyErr_WriteUnraisable(err); + res = 0; + } + } + __Pyx_ErrRestore(exception, value, tb); + return res; +} +#else +static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { + int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0; + if (!res) { + res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); + } + return res; +} +#endif +static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { + Py_ssize_t i, n; + assert(PyExceptionClass_Check(exc_type)); + n = PyTuple_GET_SIZE(tuple); +#if PY_MAJOR_VERSION >= 3 + for (i=0; i= 0x02070000 + cobj = PyCapsule_New(tmp.p, sig, 0); +#else + cobj = PyCObject_FromVoidPtrAndDesc(tmp.p, (void *)sig, 0); +#endif + if (!cobj) + goto bad; + if (PyDict_SetItemString(d, name, cobj) < 0) + goto bad; + Py_DECREF(cobj); + Py_DECREF(d); + return 0; +bad: + Py_XDECREF(cobj); + Py_XDECREF(d); + return -1; +} + +/* VoidPtrImport */ +#ifndef __PYX_HAVE_RT_ImportVoidPtr +#define __PYX_HAVE_RT_ImportVoidPtr +static int __Pyx_ImportVoidPtr(PyObject *module, const char *name, void **p, const char *sig) { + PyObject *d = 0; + PyObject *cobj = 0; + d = PyObject_GetAttrString(module, (char *)"__pyx_capi__"); + if (!d) + goto bad; + cobj = PyDict_GetItemString(d, name); + if (!cobj) { + PyErr_Format(PyExc_ImportError, + "%.200s does not export expected C variable %.200s", + PyModule_GetName(module), name); + goto bad; + } +#if PY_VERSION_HEX >= 0x02070000 + if (!PyCapsule_IsValid(cobj, sig)) { + PyErr_Format(PyExc_TypeError, + "C variable %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", + PyModule_GetName(module), name, sig, PyCapsule_GetName(cobj)); + goto bad; + } + *p = PyCapsule_GetPointer(cobj, sig); +#else + {const char *desc, *s1, *s2; + desc = (const char *)PyCObject_GetDesc(cobj); + if (!desc) + goto bad; + s1 = desc; s2 = sig; + while (*s1 != '\0' && *s1 == *s2) { s1++; s2++; } + if (*s1 != *s2) { + PyErr_Format(PyExc_TypeError, + "C variable %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", + PyModule_GetName(module), name, sig, desc); + goto bad; + } + *p = PyCObject_AsVoidPtr(cobj);} +#endif + if (!(*p)) + goto bad; + Py_DECREF(d); + return 0; +bad: + Py_XDECREF(d); + return -1; +} +#endif + +/* FunctionImport */ +#ifndef __PYX_HAVE_RT_ImportFunction +#define __PYX_HAVE_RT_ImportFunction +static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig) { + PyObject *d = 0; + PyObject *cobj = 0; + union { + void (*fp)(void); + void *p; + } tmp; + d = PyObject_GetAttrString(module, (char *)"__pyx_capi__"); + if (!d) + goto bad; + cobj = PyDict_GetItemString(d, funcname); + if (!cobj) { + PyErr_Format(PyExc_ImportError, + "%.200s does not export expected C function %.200s", + PyModule_GetName(module), funcname); + goto bad; + } +#if PY_VERSION_HEX >= 0x02070000 + if (!PyCapsule_IsValid(cobj, sig)) { + PyErr_Format(PyExc_TypeError, + "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", + PyModule_GetName(module), funcname, sig, PyCapsule_GetName(cobj)); + goto bad; + } + tmp.p = PyCapsule_GetPointer(cobj, sig); +#else + {const char *desc, *s1, *s2; + desc = (const char *)PyCObject_GetDesc(cobj); + if (!desc) + goto bad; + s1 = desc; s2 = sig; + while (*s1 != '\0' && *s1 == *s2) { s1++; s2++; } + if (*s1 != *s2) { + PyErr_Format(PyExc_TypeError, + "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", + PyModule_GetName(module), funcname, sig, desc); + goto bad; + } + tmp.p = PyCObject_AsVoidPtr(cobj);} +#endif + *f = tmp.fp; + if (!(*f)) + goto bad; + Py_DECREF(d); + return 0; +bad: + Py_XDECREF(d); + return -1; +} +#endif + +/* InitStrings */ +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { + while (t->p) { + #if PY_MAJOR_VERSION < 3 + if (t->is_unicode) { + *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); + } else if (t->intern) { + *t->p = PyString_InternFromString(t->s); + } else { + *t->p = PyString_FromStringAndSize(t->s, t->n - 1); + } + #else + if (t->is_unicode | t->is_str) { + if (t->intern) { + *t->p = PyUnicode_InternFromString(t->s); + } else if (t->encoding) { + *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); + } else { + *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); + } + } else { + *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); + } + #endif + if (!*t->p) + return -1; + if (PyObject_Hash(*t->p) == -1) + return -1; + ++t; + } + return 0; +} + +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { + return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); +} +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { + Py_ssize_t ignore; + return __Pyx_PyObject_AsStringAndSize(o, &ignore); +} +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +#if !CYTHON_PEP393_ENABLED +static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { + char* defenc_c; + PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); + if (!defenc) return NULL; + defenc_c = PyBytes_AS_STRING(defenc); +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + { + char* end = defenc_c + PyBytes_GET_SIZE(defenc); + char* c; + for (c = defenc_c; c < end; c++) { + if ((unsigned char) (*c) >= 128) { + PyUnicode_AsASCIIString(o); + return NULL; + } + } + } +#endif + *length = PyBytes_GET_SIZE(defenc); + return defenc_c; +} +#else +static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { + if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + if (likely(PyUnicode_IS_ASCII(o))) { + *length = PyUnicode_GET_LENGTH(o); + return PyUnicode_AsUTF8(o); + } else { + PyUnicode_AsASCIIString(o); + return NULL; + } +#else + return PyUnicode_AsUTF8AndSize(o, length); +#endif +} +#endif +#endif +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT + if ( +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + __Pyx_sys_getdefaultencoding_not_ascii && +#endif + PyUnicode_Check(o)) { + return __Pyx_PyUnicode_AsStringAndSize(o, length); + } else +#endif +#if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) + if (PyByteArray_Check(o)) { + *length = PyByteArray_GET_SIZE(o); + return PyByteArray_AS_STRING(o); + } else +#endif + { + char* result; + int r = PyBytes_AsStringAndSize(o, &result, length); + if (unlikely(r < 0)) { + return NULL; + } else { + return result; + } + } +} +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { + int is_true = x == Py_True; + if (is_true | (x == Py_False) | (x == Py_None)) return is_true; + else return PyObject_IsTrue(x); +} +static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) { + int retval; + if (unlikely(!x)) return -1; + retval = __Pyx_PyObject_IsTrue(x); + Py_DECREF(x); + return retval; +} +static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) { +#if PY_MAJOR_VERSION >= 3 + if (PyLong_Check(result)) { + if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, + "__int__ returned non-int (type %.200s). " + "The ability to return an instance of a strict subclass of int " + "is deprecated, and may be removed in a future version of Python.", + Py_TYPE(result)->tp_name)) { + Py_DECREF(result); + return NULL; + } + return result; + } +#endif + PyErr_Format(PyExc_TypeError, + "__%.4s__ returned non-%.4s (type %.200s)", + type_name, type_name, Py_TYPE(result)->tp_name); + Py_DECREF(result); + return NULL; +} +static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { +#if CYTHON_USE_TYPE_SLOTS + PyNumberMethods *m; +#endif + const char *name = NULL; + PyObject *res = NULL; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x) || PyLong_Check(x))) +#else + if (likely(PyLong_Check(x))) +#endif + return __Pyx_NewRef(x); +#if CYTHON_USE_TYPE_SLOTS + m = Py_TYPE(x)->tp_as_number; + #if PY_MAJOR_VERSION < 3 + if (m && m->nb_int) { + name = "int"; + res = m->nb_int(x); + } + else if (m && m->nb_long) { + name = "long"; + res = m->nb_long(x); + } + #else + if (likely(m && m->nb_int)) { + name = "int"; + res = m->nb_int(x); + } + #endif +#else + if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { + res = PyNumber_Int(x); + } +#endif + if (likely(res)) { +#if PY_MAJOR_VERSION < 3 + if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) { +#else + if (unlikely(!PyLong_CheckExact(res))) { +#endif + return __Pyx_PyNumber_IntOrLongWrongResultType(res, name); + } + } + else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_TypeError, + "an integer is required"); + } + return res; +} +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { + Py_ssize_t ival; + PyObject *x; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_CheckExact(b))) { + if (sizeof(Py_ssize_t) >= sizeof(long)) + return PyInt_AS_LONG(b); + else + return PyInt_AsSsize_t(b); + } +#endif + if (likely(PyLong_CheckExact(b))) { + #if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)b)->ob_digit; + const Py_ssize_t size = Py_SIZE(b); + if (likely(__Pyx_sst_abs(size) <= 1)) { + ival = likely(size) ? digits[0] : 0; + if (size == -1) ival = -ival; + return ival; + } else { + switch (size) { + case 2: + if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { + return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -2: + if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case 3: + if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { + return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -3: + if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case 4: + if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { + return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -4: + if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + } + } + #endif + return PyLong_AsSsize_t(b); + } + x = PyNumber_Index(b); + if (!x) return -1; + ival = PyInt_AsSsize_t(x); + Py_DECREF(x); + return ival; +} +static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) { + return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False); +} +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { + return PyInt_FromSize_t(ival); +} + + +#endif /* Py_PYTHON_H */ diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_imap.html b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_imap.html new file mode 100644 index 00000000..cbce96e9 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_imap.html @@ -0,0 +1,2184 @@ + + + + + + Cython: _imap.py + + + +

Generated by Cython 0.29.2

+

+ Yellow lines hint at Python interaction.
+ Click on a line that starts with a "+" to see the C code that Cython generated for it. +

+

Raw output: _imap.c

+
+001: # -*- coding: utf-8 -*-
+
  __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
 002: # Copyright (c) 2018 gevent
+
 003: # cython: auto_pickle=False,embedsignature=True,always_allow_keywords=False,infer_types=True
+
 004: 
+
 005: """
+
 006: Iterators across greenlets or AsyncResult objects.
+
 007: 
+
 008: """
+
 009: from __future__ import absolute_import
+
 010: from __future__ import division
+
 011: from __future__ import print_function
+
 012: 
+
 013: 
+
+014: from gevent import _semaphore
+
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 14, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(__pyx_n_s_semaphore);
+  __Pyx_GIVEREF(__pyx_n_s_semaphore);
+  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_semaphore);
+  __pyx_t_2 = __Pyx_Import(__pyx_n_s_gevent, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 14, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_semaphore); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 14, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_semaphore, __pyx_t_1) < 0) __PYX_ERR(0, 14, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+015: from gevent import queue
+
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 15, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_queue);
+  __Pyx_GIVEREF(__pyx_n_s_queue);
+  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_queue);
+  __pyx_t_1 = __Pyx_Import(__pyx_n_s_gevent, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 15, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_queue); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 15, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_queue, __pyx_t_2) < 0) __PYX_ERR(0, 15, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 016: 
+
 017: 
+
+018: __all__ = [
+
  __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 18, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(__pyx_n_s_IMapUnordered);
+  __Pyx_GIVEREF(__pyx_n_s_IMapUnordered);
+  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_IMapUnordered);
+  __Pyx_INCREF(__pyx_n_s_IMap);
+  __Pyx_GIVEREF(__pyx_n_s_IMap);
+  PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_IMap);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_all, __pyx_t_1) < 0) __PYX_ERR(0, 18, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 019:     'IMapUnordered',
+
 020:     'IMap',
+
 021: ]
+
 022: 
+
+023: locals()['Greenlet'] = __import__('gevent').Greenlet
+
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin___import__, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 23, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_Greenlet); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 23, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_1 = __Pyx_Globals(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 23, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (unlikely(PyDict_SetItem(__pyx_t_1, __pyx_n_s_Greenlet, __pyx_t_2) < 0)) __PYX_ERR(0, 23, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+/* … */
+  __pyx_tuple_ = PyTuple_Pack(1, __pyx_n_s_gevent); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 23, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple_);
+  __Pyx_GIVEREF(__pyx_tuple_);
+
+024: locals()['Semaphore'] = _semaphore.Semaphore
+
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_semaphore); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 24, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_Semaphore); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 24, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_2 = __Pyx_Globals(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 24, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (unlikely(PyDict_SetItem(__pyx_t_2, __pyx_n_s_Semaphore, __pyx_t_1) < 0)) __PYX_ERR(0, 24, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+025: locals()['UnboundQueue'] = queue.UnboundQueue
+
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_queue); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 25, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_UnboundQueue); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 25, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_1 = __Pyx_Globals(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 25, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (unlikely(PyDict_SetItem(__pyx_t_1, __pyx_n_s_UnboundQueue, __pyx_t_2) < 0)) __PYX_ERR(0, 25, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
 026: 
+
 027: 
+
 028: class Failure(object):
+
+029:     __slots__ = ('exc', 'raise_exception')
+
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6__imap_Failure->tp_dict, __pyx_n_s_slots, __pyx_tuple__2) < 0) __PYX_ERR(0, 29, __pyx_L1_error)
+  PyType_Modified(__pyx_ptype_6gevent_6__imap_Failure);
+/* … */
+  __pyx_tuple__2 = PyTuple_Pack(2, __pyx_n_s_exc, __pyx_n_s_raise_exception); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 29, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__2);
+  __Pyx_GIVEREF(__pyx_tuple__2);
+
 030: 
+
+031:     def __init__(self, exc, raise_exception=None):
+
/* Python wrapper */
+static int __pyx_pw_6gevent_6__imap_7Failure_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static int __pyx_pw_6gevent_6__imap_7Failure_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_exc = 0;
+  PyObject *__pyx_v_raise_exception = 0;
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_exc,&__pyx_n_s_raise_exception,0};
+    PyObject* values[2] = {0,0};
+    values[1] = ((PyObject *)Py_None);
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_exc)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_raise_exception);
+          if (value) { values[1] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 31, __pyx_L3_error)
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    __pyx_v_exc = values[0];
+    __pyx_v_raise_exception = values[1];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 31, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.__imap.Failure.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return -1;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_6__imap_7Failure___init__(((struct __pyx_obj_6gevent_6__imap_Failure *)__pyx_v_self), __pyx_v_exc, __pyx_v_raise_exception);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_6__imap_7Failure___init__(struct __pyx_obj_6gevent_6__imap_Failure *__pyx_v_self, PyObject *__pyx_v_exc, PyObject *__pyx_v_raise_exception) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = 0;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+032:         self.exc = exc
+
  __Pyx_INCREF(__pyx_v_exc);
+  __Pyx_GIVEREF(__pyx_v_exc);
+  __Pyx_GOTREF(__pyx_v_self->exc);
+  __Pyx_DECREF(__pyx_v_self->exc);
+  __pyx_v_self->exc = __pyx_v_exc;
+
+033:         self.raise_exception = raise_exception
+
  __Pyx_INCREF(__pyx_v_raise_exception);
+  __Pyx_GIVEREF(__pyx_v_raise_exception);
+  __Pyx_GOTREF(__pyx_v_self->raise_exception);
+  __Pyx_DECREF(__pyx_v_self->raise_exception);
+  __pyx_v_self->raise_exception = __pyx_v_raise_exception;
+
 034: 
+
 035: 
+
+036: def _raise_exc(failure):
+
static CYTHON_INLINE PyObject *__pyx_f_6gevent_6__imap__raise_exc(struct __pyx_obj_6gevent_6__imap_Failure *__pyx_v_failure) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_raise_exc", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_AddTraceback("gevent.__imap._raise_exc", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
 037:     # For cython.
+
+038:     if failure.raise_exception:
+
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_failure->raise_exception); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 38, __pyx_L1_error)
+  if (likely(__pyx_t_1)) {
+/* … */
+    goto __pyx_L3;
+  }
+
+039:         failure.raise_exception()
+
    __Pyx_INCREF(__pyx_v_failure->raise_exception);
+    __pyx_t_3 = __pyx_v_failure->raise_exception; __pyx_t_4 = NULL;
+    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
+      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+      if (likely(__pyx_t_4)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+        __Pyx_INCREF(__pyx_t_4);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_3, function);
+      }
+    }
+    __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
+    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 39, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
 040:     else:
+
+041:         raise failure.exc
+
  /*else*/ {
+    __Pyx_Raise(__pyx_v_failure->exc, 0, 0, 0);
+    __PYX_ERR(0, 41, __pyx_L1_error)
+  }
+  __pyx_L3:;
+
 042: 
+
+043: class IMapUnordered(Greenlet): # pylint:disable=undefined-variable
+
struct __pyx_vtabstruct_6gevent_6__imap_IMapUnordered {
+  struct __pyx_vtabstruct_6gevent_9_greenlet_Greenlet __pyx_base;
+  PyObject *(*_inext)(struct __pyx_obj_6gevent_6__imap_IMapUnordered *);
+  PyObject *(*_ispawn)(struct __pyx_obj_6gevent_6__imap_IMapUnordered *, PyObject *, PyObject *, int);
+  PyObject *(*_on_result)(struct __pyx_obj_6gevent_6__imap_IMapUnordered *, PyObject *, int __pyx_skip_dispatch);
+  PyObject *(*_on_finish)(struct __pyx_obj_6gevent_6__imap_IMapUnordered *, PyObject *);
+  PyObject *(*_iqueue_value_for_success)(struct __pyx_obj_6gevent_6__imap_IMapUnordered *, PyObject *);
+  PyObject *(*_iqueue_value_for_failure)(struct __pyx_obj_6gevent_6__imap_IMapUnordered *, PyObject *);
+  PyObject *(*_iqueue_value_for_self_finished)(struct __pyx_obj_6gevent_6__imap_IMapUnordered *);
+  PyObject *(*_iqueue_value_for_self_failure)(struct __pyx_obj_6gevent_6__imap_IMapUnordered *, PyObject *);
+};
+static struct __pyx_vtabstruct_6gevent_6__imap_IMapUnordered *__pyx_vtabptr_6gevent_6__imap_IMapUnordered;
+
+
 044:     """
+
 045:     At iterator of map results.
+
 046:     """
+
 047: 
+
+048:     def __init__(self, func, iterable, spawn, maxsize=None, _zipped=False):
+
/* Python wrapper */
+static int __pyx_pw_6gevent_6__imap_13IMapUnordered_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_6gevent_6__imap_13IMapUnordered___init__[] = "\n        An iterator that.\n\n        :param callable spawn: The function we use to create new greenlets.\n        :keyword int maxsize: If given and not-None, specifies the maximum number of\n            finished results that will be allowed to accumulated awaiting the reader;\n            more than that number of results will cause map function greenlets to begin\n            to block. This is most useful is there is a great disparity in the speed of\n            the mapping code and the consumer and the results consume a great deal of resources.\n            Using a bound is more computationally expensive than not using a bound.\n\n        .. versionchanged:: 1.1b3\n            Added the *maxsize* parameter.\n        ";
+#if CYTHON_COMPILING_IN_CPYTHON
+struct wrapperbase __pyx_wrapperbase_6gevent_6__imap_13IMapUnordered___init__;
+#endif
+static int __pyx_pw_6gevent_6__imap_13IMapUnordered_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_func = 0;
+  PyObject *__pyx_v_iterable = 0;
+  PyObject *__pyx_v_spawn = 0;
+  PyObject *__pyx_v_maxsize = 0;
+  PyObject *__pyx_v__zipped = 0;
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_func,&__pyx_n_s_iterable,&__pyx_n_s_spawn,&__pyx_n_s_maxsize,&__pyx_n_s_zipped,0};
+    PyObject* values[5] = {0,0,0,0,0};
+    values[3] = ((PyObject *)Py_None);
+    values[4] = ((PyObject *)Py_False);
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
+        CYTHON_FALLTHROUGH;
+        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
+        CYTHON_FALLTHROUGH;
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_func)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_iterable)) != 0)) kw_args--;
+        else {
+          __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 5, 1); __PYX_ERR(0, 48, __pyx_L3_error)
+        }
+        CYTHON_FALLTHROUGH;
+        case  2:
+        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_spawn)) != 0)) kw_args--;
+        else {
+          __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 5, 2); __PYX_ERR(0, 48, __pyx_L3_error)
+        }
+        CYTHON_FALLTHROUGH;
+        case  3:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_maxsize);
+          if (value) { values[3] = value; kw_args--; }
+        }
+        CYTHON_FALLTHROUGH;
+        case  4:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_zipped);
+          if (value) { values[4] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 48, __pyx_L3_error)
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
+        CYTHON_FALLTHROUGH;
+        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
+        CYTHON_FALLTHROUGH;
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    __pyx_v_func = values[0];
+    __pyx_v_iterable = values[1];
+    __pyx_v_spawn = values[2];
+    __pyx_v_maxsize = values[3];
+    __pyx_v__zipped = values[4];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 48, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.__imap.IMapUnordered.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return -1;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_6__imap_13IMapUnordered___init__(((struct __pyx_obj_6gevent_6__imap_IMapUnordered *)__pyx_v_self), __pyx_v_func, __pyx_v_iterable, __pyx_v_spawn, __pyx_v_maxsize, __pyx_v__zipped);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_6__imap_13IMapUnordered___init__(struct __pyx_obj_6gevent_6__imap_IMapUnordered *__pyx_v_self, PyObject *__pyx_v_func, PyObject *__pyx_v_iterable, PyObject *__pyx_v_spawn, PyObject *__pyx_v_maxsize, PyObject *__pyx_v__zipped) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = 0;
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_AddTraceback("gevent.__imap.IMapUnordered.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = -1;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
 049:         """
+
 050:         An iterator that.
+
 051: 
+
 052:         :param callable spawn: The function we use to create new greenlets.
+
 053:         :keyword int maxsize: If given and not-None, specifies the maximum number of
+
 054:             finished results that will be allowed to accumulated awaiting the reader;
+
 055:             more than that number of results will cause map function greenlets to begin
+
 056:             to block. This is most useful is there is a great disparity in the speed of
+
 057:             the mapping code and the consumer and the results consume a great deal of resources.
+
 058:             Using a bound is more computationally expensive than not using a bound.
+
 059: 
+
 060:         .. versionchanged:: 1.1b3
+
 061:             Added the *maxsize* parameter.
+
 062:         """
+
+063:         Greenlet.__init__(self) # pylint:disable=undefined-variable
+
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet), __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 63, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = NULL;
+  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+    if (likely(__pyx_t_3)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+      __Pyx_INCREF(__pyx_t_3);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_2, function);
+    }
+  }
+  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, ((PyObject *)__pyx_v_self)) : __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_v_self));
+  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 63, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+064:         self.spawn = spawn
+
  __Pyx_INCREF(__pyx_v_spawn);
+  __Pyx_GIVEREF(__pyx_v_spawn);
+  __Pyx_GOTREF(__pyx_v_self->spawn);
+  __Pyx_DECREF(__pyx_v_self->spawn);
+  __pyx_v_self->spawn = __pyx_v_spawn;
+
+065:         self._zipped = _zipped
+
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v__zipped); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 65, __pyx_L1_error)
+  __pyx_v_self->_zipped = __pyx_t_4;
+
+066:         self.func = func
+
  __Pyx_INCREF(__pyx_v_func);
+  __Pyx_GIVEREF(__pyx_v_func);
+  __Pyx_GOTREF(__pyx_v_self->func);
+  __Pyx_DECREF(__pyx_v_self->func);
+  __pyx_v_self->func = __pyx_v_func;
+
+067:         self.iterable = iterable
+
  __Pyx_INCREF(__pyx_v_iterable);
+  __Pyx_GIVEREF(__pyx_v_iterable);
+  __Pyx_GOTREF(__pyx_v_self->iterable);
+  __Pyx_DECREF(__pyx_v_self->iterable);
+  __pyx_v_self->iterable = __pyx_v_iterable;
+
+068:         self.queue = UnboundQueue() # pylint:disable=undefined-variable
+
  __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_6gevent_6_queue_UnboundQueue)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 68, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_1);
+  __Pyx_GOTREF(__pyx_v_self->queue);
+  __Pyx_DECREF(((PyObject *)__pyx_v_self->queue));
+  __pyx_v_self->queue = ((struct __pyx_obj_6gevent_6_queue_UnboundQueue *)__pyx_t_1);
+  __pyx_t_1 = 0;
+
 069: 
+
 070: 
+
+071:         if maxsize:
+
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_maxsize); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 71, __pyx_L1_error)
+  if (__pyx_t_4) {
+/* … */
+    goto __pyx_L3;
+  }
+
 072:             # Bounding the queue is not enough if we want to keep from
+
 073:             # accumulating objects; the result value will be around as
+
 074:             # the greenlet's result, blocked on self.queue.put(), and
+
 075:             # we'll go on to spawn another greenlet, which in turn can
+
 076:             # create the result. So we need a semaphore to prevent a
+
 077:             # greenlet from exiting while the queue is full so that we
+
 078:             # don't spawn the next greenlet (assuming that self.spawn
+
 079:             # is of course bounded). (Alternatively we could have the
+
 080:             # greenlet itself do the insert into the pool, but that
+
 081:             # takes some rework).
+
 082:             #
+
 083:             # Given the use of a semaphore at this level, sizing the queue becomes
+
 084:             # redundant, and that lets us avoid having to use self.link() instead
+
 085:             # of self.rawlink() to avoid having blocking methods called in the
+
 086:             # hub greenlet.
+
+087:             self._result_semaphore = Semaphore(maxsize) # pylint:disable=undefined-variable
+
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_6gevent_11__semaphore_Semaphore), __pyx_v_maxsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 87, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_GIVEREF(__pyx_t_1);
+    __Pyx_GOTREF(__pyx_v_self->_result_semaphore);
+    __Pyx_DECREF(((PyObject *)__pyx_v_self->_result_semaphore));
+    __pyx_v_self->_result_semaphore = ((struct __pyx_obj_6gevent_11__semaphore_Semaphore *)__pyx_t_1);
+    __pyx_t_1 = 0;
+
 088:         else:
+
+089:             self._result_semaphore = None
+
  /*else*/ {
+    __Pyx_INCREF(Py_None);
+    __Pyx_GIVEREF(Py_None);
+    __Pyx_GOTREF(__pyx_v_self->_result_semaphore);
+    __Pyx_DECREF(((PyObject *)__pyx_v_self->_result_semaphore));
+    __pyx_v_self->_result_semaphore = ((struct __pyx_obj_6gevent_11__semaphore_Semaphore *)Py_None);
+  }
+  __pyx_L3:;
+
 090: 
+
+091:         self._outstanding_tasks = 0
+
  __pyx_v_self->_outstanding_tasks = 0;
+
 092:         # The index (zero based) of the maximum number of
+
 093:         # results we will have.
+
+094:         self._max_index = -1
+
  __pyx_v_self->_max_index = -1;
+
+095:         self.finished = False
+
  __pyx_v_self->finished = 0;
+
 096: 
+
 097: 
+
 098:     # We're iterating in a different greenlet than we're running.
+
+099:     def __iter__(self):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6__imap_13IMapUnordered_3__iter__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_6__imap_13IMapUnordered_3__iter__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_6__imap_13IMapUnordered_2__iter__(((struct __pyx_obj_6gevent_6__imap_IMapUnordered *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6__imap_13IMapUnordered_2__iter__(struct __pyx_obj_6gevent_6__imap_IMapUnordered *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__iter__", 0);
+/* … */
+  /* function exit code */
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+100:         return self
+
  __Pyx_XDECREF(__pyx_r);
+  __Pyx_INCREF(((PyObject *)__pyx_v_self));
+  __pyx_r = ((PyObject *)__pyx_v_self);
+  goto __pyx_L0;
+
 101: 
+
+102:     def __next__(self):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6__imap_13IMapUnordered_5__next__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_6__imap_13IMapUnordered_5__next__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__next__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_6__imap_13IMapUnordered_4__next__(((struct __pyx_obj_6gevent_6__imap_IMapUnordered *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6__imap_13IMapUnordered_4__next__(struct __pyx_obj_6gevent_6__imap_IMapUnordered *__pyx_v_self) {
+  PyObject *__pyx_v_value = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__next__", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_AddTraceback("gevent.__imap.IMapUnordered.__next__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_value);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+103:         if self._result_semaphore is not None:
+
  __pyx_t_1 = (((PyObject *)__pyx_v_self->_result_semaphore) != Py_None);
+  __pyx_t_2 = (__pyx_t_1 != 0);
+  if (__pyx_t_2) {
+/* … */
+  }
+
+104:             self._result_semaphore.release()
+
    __pyx_t_3 = ((struct __pyx_vtabstruct_6gevent_11__semaphore_Semaphore *)__pyx_v_self->_result_semaphore->__pyx_base.__pyx_vtab)->release(__pyx_v_self->_result_semaphore, 0); if (unlikely(__pyx_t_3 == ((int)-1000))) __PYX_ERR(0, 104, __pyx_L1_error)
+
+105:         value = self._inext()
+
  __pyx_t_4 = ((struct __pyx_vtabstruct_6gevent_6__imap_IMapUnordered *)__pyx_v_self->__pyx_base.__pyx_vtab)->_inext(__pyx_v_self); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 105, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_4);
+  __pyx_v_value = __pyx_t_4;
+  __pyx_t_4 = 0;
+
+106:         if isinstance(value, Failure):
+
  __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_value, __pyx_ptype_6gevent_6__imap_Failure); 
+  __pyx_t_1 = (__pyx_t_2 != 0);
+  if (__pyx_t_1) {
+/* … */
+  }
+
+107:             _raise_exc(value)
+
    if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_6gevent_6__imap_Failure))))) __PYX_ERR(0, 107, __pyx_L1_error)
+    __pyx_t_4 = __pyx_f_6gevent_6__imap__raise_exc(((struct __pyx_obj_6gevent_6__imap_Failure *)__pyx_v_value)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 107, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+
+108:         return value
+
  __Pyx_XDECREF(__pyx_r);
+  __Pyx_INCREF(__pyx_v_value);
+  __pyx_r = __pyx_v_value;
+  goto __pyx_L0;
+
 109: 
+
+110:     next = __next__ # Py2
+
  __Pyx_GetNameInClass(__pyx_t_2, (PyObject *)__pyx_ptype_6gevent_6__imap_IMapUnordered, __pyx_n_s_next); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 110, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6__imap_IMapUnordered->tp_dict, __pyx_n_s_next_2, __pyx_t_2) < 0) __PYX_ERR(0, 110, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_6__imap_IMapUnordered);
+
 111: 
+
+112:     def _inext(self):
+
static PyObject *__pyx_f_6gevent_6__imap_13IMapUnordered__inext(struct __pyx_obj_6gevent_6__imap_IMapUnordered *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_inext", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.__imap.IMapUnordered._inext", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+113:         return self.queue.get()
+
  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_6_queue_UnboundQueue *)__pyx_v_self->queue->__pyx_base.__pyx_vtab)->__pyx_base.get(((struct __pyx_obj_6gevent_6_queue_Queue *)__pyx_v_self->queue), 0, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 113, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
 114: 
+
+115:     def _ispawn(self, func, item, item_index):
+
static PyObject *__pyx_f_6gevent_6__imap_13IMapUnordered__ispawn(struct __pyx_obj_6gevent_6__imap_IMapUnordered *__pyx_v_self, PyObject *__pyx_v_func, PyObject *__pyx_v_item, int __pyx_v_item_index) {
+  PyObject *__pyx_v_g = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_ispawn", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_XDECREF(__pyx_t_6);
+  __Pyx_XDECREF(__pyx_t_8);
+  __Pyx_AddTraceback("gevent.__imap.IMapUnordered._ispawn", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_g);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+116:         if self._result_semaphore is not None:
+
  __pyx_t_1 = (((PyObject *)__pyx_v_self->_result_semaphore) != Py_None);
+  __pyx_t_2 = (__pyx_t_1 != 0);
+  if (__pyx_t_2) {
+/* … */
+  }
+
+117:             self._result_semaphore.acquire()
+
    __pyx_t_2 = ((struct __pyx_vtabstruct_6gevent_11__semaphore_Semaphore *)__pyx_v_self->_result_semaphore->__pyx_base.__pyx_vtab)->acquire(__pyx_v_self->_result_semaphore, 0, NULL); if (unlikely(__pyx_t_2 == ((int)-1000))) __PYX_ERR(0, 117, __pyx_L1_error)
+
+118:         self._outstanding_tasks += 1
+
  __pyx_v_self->_outstanding_tasks = (__pyx_v_self->_outstanding_tasks + 1);
+
+119:         g = self.spawn(func, item) if not self._zipped else self.spawn(func, *item)
+
  if (((!(__pyx_v_self->_zipped != 0)) != 0)) {
+    __Pyx_INCREF(__pyx_v_self->spawn);
+    __pyx_t_5 = __pyx_v_self->spawn; __pyx_t_6 = NULL;
+    __pyx_t_7 = 0;
+    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
+      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
+      if (likely(__pyx_t_6)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
+        __Pyx_INCREF(__pyx_t_6);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_5, function);
+        __pyx_t_7 = 1;
+      }
+    }
+    #if CYTHON_FAST_PYCALL
+    if (PyFunction_Check(__pyx_t_5)) {
+      PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_func, __pyx_v_item};
+      __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 119, __pyx_L1_error)
+      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+      __Pyx_GOTREF(__pyx_t_4);
+    } else
+    #endif
+    #if CYTHON_FAST_PYCCALL
+    if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
+      PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_func, __pyx_v_item};
+      __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 119, __pyx_L1_error)
+      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+      __Pyx_GOTREF(__pyx_t_4);
+    } else
+    #endif
+    {
+      __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 119, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_8);
+      if (__pyx_t_6) {
+        __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL;
+      }
+      __Pyx_INCREF(__pyx_v_func);
+      __Pyx_GIVEREF(__pyx_v_func);
+      PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_v_func);
+      __Pyx_INCREF(__pyx_v_item);
+      __Pyx_GIVEREF(__pyx_v_item);
+      PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_item);
+      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 119, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_4);
+      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+    }
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __pyx_t_3 = __pyx_t_4;
+    __pyx_t_4 = 0;
+  } else {
+    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 119, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_INCREF(__pyx_v_func);
+    __Pyx_GIVEREF(__pyx_v_func);
+    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_func);
+    __pyx_t_5 = __Pyx_PySequence_Tuple(__pyx_v_item); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 119, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_5);
+    __pyx_t_8 = PyNumber_Add(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 119, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_8);
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_v_self->spawn, __pyx_t_8, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 119, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_5);
+    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+    __pyx_t_3 = __pyx_t_5;
+    __pyx_t_5 = 0;
+  }
+  __pyx_v_g = __pyx_t_3;
+  __pyx_t_3 = 0;
+
+120:         g._imap_task_index = item_index
+
  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_item_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 120, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  if (__Pyx_PyObject_SetAttrStr(__pyx_v_g, __pyx_n_s_imap_task_index, __pyx_t_3) < 0) __PYX_ERR(0, 120, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+
+121:         g.rawlink(self._on_result)
+
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_g, __pyx_n_s_rawlink); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 121, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_5);
+  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_on_result); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 121, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_8);
+  __pyx_t_4 = NULL;
+  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
+    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
+    if (likely(__pyx_t_4)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
+      __Pyx_INCREF(__pyx_t_4);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_5, function);
+    }
+  }
+  __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_4, __pyx_t_8) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_8);
+  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 121, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+
+122:         return g
+
  __Pyx_XDECREF(__pyx_r);
+  __Pyx_INCREF(__pyx_v_g);
+  __pyx_r = __pyx_v_g;
+  goto __pyx_L0;
+
 123: 
+
+124:     def _run(self): # pylint:disable=method-hidden
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6__imap_13IMapUnordered_7_run(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6gevent_6__imap_13IMapUnordered_6_run[] = "IMapUnordered._run(self)";
+static PyMethodDef __pyx_mdef_6gevent_6__imap_13IMapUnordered_7_run = {"_run", (PyCFunction)__pyx_pw_6gevent_6__imap_13IMapUnordered_7_run, METH_NOARGS, __pyx_doc_6gevent_6__imap_13IMapUnordered_6_run};
+static PyObject *__pyx_pw_6gevent_6__imap_13IMapUnordered_7_run(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_run (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_6__imap_13IMapUnordered_6_run(((struct __pyx_obj_6gevent_6__imap_IMapUnordered *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6__imap_13IMapUnordered_6_run(struct __pyx_obj_6gevent_6__imap_IMapUnordered *__pyx_v_self) {
+  PyObject *__pyx_v_func = NULL;
+  PyObject *__pyx_v_item = NULL;
+  PyObject *__pyx_v_e = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_run", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_7);
+  __Pyx_XDECREF(__pyx_t_9);
+  __Pyx_XDECREF(__pyx_t_10);
+  __Pyx_AddTraceback("gevent.__imap.IMapUnordered._run", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_func);
+  __Pyx_XDECREF(__pyx_v_item);
+  __Pyx_XDECREF(__pyx_v_e);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__3 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_func, __pyx_n_s_item, __pyx_n_s_e); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 124, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__3);
+  __Pyx_GIVEREF(__pyx_tuple__3);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6__imap_13IMapUnordered_7_run, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_IMapUnordered__run, NULL, __pyx_n_s_gevent___imap, __pyx_d, ((PyObject *)__pyx_codeobj__4)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 124, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6__imap_IMapUnordered->tp_dict, __pyx_n_s_run, __pyx_t_2) < 0) __PYX_ERR(0, 124, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_6__imap_IMapUnordered);
+  __pyx_codeobj__4 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__3, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__imap_py, __pyx_n_s_run, 124, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__4)) __PYX_ERR(0, 124, __pyx_L1_error)
+
+125:         try:
+
  /*try:*/ {
+    {
+      /*try:*/ {
+/* … */
+      }
+      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+      goto __pyx_L11_try_end;
+      __pyx_L6_error:;
+      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+/* … */
+      __Pyx_XGIVEREF(__pyx_t_1);
+      __Pyx_XGIVEREF(__pyx_t_2);
+      __Pyx_XGIVEREF(__pyx_t_3);
+      __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
+      goto __pyx_L4_error;
+      __pyx_L11_try_end:;
+    }
+  }
+
+126:             func = self.func
+
        __pyx_t_4 = __pyx_v_self->func;
+        __Pyx_INCREF(__pyx_t_4);
+        __pyx_v_func = __pyx_t_4;
+        __pyx_t_4 = 0;
+
+127:             for item in self.iterable:
+
        if (likely(PyList_CheckExact(__pyx_v_self->iterable)) || PyTuple_CheckExact(__pyx_v_self->iterable)) {
+          __pyx_t_4 = __pyx_v_self->iterable; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0;
+          __pyx_t_6 = NULL;
+        } else {
+          __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_self->iterable); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 127, __pyx_L6_error)
+          __Pyx_GOTREF(__pyx_t_4);
+          __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 127, __pyx_L6_error)
+        }
+        for (;;) {
+          if (likely(!__pyx_t_6)) {
+            if (likely(PyList_CheckExact(__pyx_t_4))) {
+              if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break;
+              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+              __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 127, __pyx_L6_error)
+              #else
+              __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 127, __pyx_L6_error)
+              __Pyx_GOTREF(__pyx_t_7);
+              #endif
+            } else {
+              if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
+              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+              __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 127, __pyx_L6_error)
+              #else
+              __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 127, __pyx_L6_error)
+              __Pyx_GOTREF(__pyx_t_7);
+              #endif
+            }
+          } else {
+            __pyx_t_7 = __pyx_t_6(__pyx_t_4);
+            if (unlikely(!__pyx_t_7)) {
+              PyObject* exc_type = PyErr_Occurred();
+              if (exc_type) {
+                if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+                else __PYX_ERR(0, 127, __pyx_L6_error)
+              }
+              break;
+            }
+            __Pyx_GOTREF(__pyx_t_7);
+          }
+          __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_7);
+          __pyx_t_7 = 0;
+/* … */
+        }
+        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+
+128:                 self._max_index += 1
+
          __pyx_v_self->_max_index = (__pyx_v_self->_max_index + 1);
+
+129:                 self._ispawn(func, item, self._max_index)
+
          __pyx_t_7 = ((struct __pyx_vtabstruct_6gevent_6__imap_IMapUnordered *)__pyx_v_self->__pyx_base.__pyx_vtab)->_ispawn(__pyx_v_self, __pyx_v_func, __pyx_v_item, __pyx_v_self->_max_index); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 129, __pyx_L6_error)
+          __Pyx_GOTREF(__pyx_t_7);
+          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+
+130:             self._on_finish(None)
+
        __pyx_t_4 = ((struct __pyx_vtabstruct_6gevent_6__imap_IMapUnordered *)__pyx_v_self->__pyx_base.__pyx_vtab)->_on_finish(__pyx_v_self, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 130, __pyx_L6_error)
+        __Pyx_GOTREF(__pyx_t_4);
+        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+
+131:         except BaseException as e:
+
      __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_BaseException);
+      if (__pyx_t_8) {
+        __Pyx_AddTraceback("gevent.__imap.IMapUnordered._run", __pyx_clineno, __pyx_lineno, __pyx_filename);
+        if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_7, &__pyx_t_9) < 0) __PYX_ERR(0, 131, __pyx_L8_except_error)
+        __Pyx_GOTREF(__pyx_t_4);
+        __Pyx_GOTREF(__pyx_t_7);
+        __Pyx_GOTREF(__pyx_t_9);
+        __Pyx_INCREF(__pyx_t_7);
+        __pyx_v_e = __pyx_t_7;
+        /*try:*/ {
+/* … */
+        /*finally:*/ {
+          __pyx_L19_error:;
+          /*exception exit:*/{
+            __Pyx_PyThreadState_declare
+            __Pyx_PyThreadState_assign
+            __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0;
+            __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
+            if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18);
+            if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15) < 0)) __Pyx_ErrFetch(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15);
+            __Pyx_XGOTREF(__pyx_t_13);
+            __Pyx_XGOTREF(__pyx_t_14);
+            __Pyx_XGOTREF(__pyx_t_15);
+            __Pyx_XGOTREF(__pyx_t_16);
+            __Pyx_XGOTREF(__pyx_t_17);
+            __Pyx_XGOTREF(__pyx_t_18);
+            __pyx_t_8 = __pyx_lineno; __pyx_t_11 = __pyx_clineno; __pyx_t_12 = __pyx_filename;
+            {
+              __Pyx_DECREF(__pyx_v_e);
+              __pyx_v_e = NULL;
+            }
+            if (PY_MAJOR_VERSION >= 3) {
+              __Pyx_XGIVEREF(__pyx_t_16);
+              __Pyx_XGIVEREF(__pyx_t_17);
+              __Pyx_XGIVEREF(__pyx_t_18);
+              __Pyx_ExceptionReset(__pyx_t_16, __pyx_t_17, __pyx_t_18);
+            }
+            __Pyx_XGIVEREF(__pyx_t_13);
+            __Pyx_XGIVEREF(__pyx_t_14);
+            __Pyx_XGIVEREF(__pyx_t_15);
+            __Pyx_ErrRestore(__pyx_t_13, __pyx_t_14, __pyx_t_15);
+            __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0;
+            __pyx_lineno = __pyx_t_8; __pyx_clineno = __pyx_t_11; __pyx_filename = __pyx_t_12;
+            goto __pyx_L8_except_error;
+          }
+        }
+      }
+      goto __pyx_L8_except_error;
+      __pyx_L8_except_error:;
+
+132:             self._on_finish(e)
+
          __pyx_t_10 = ((struct __pyx_vtabstruct_6gevent_6__imap_IMapUnordered *)__pyx_v_self->__pyx_base.__pyx_vtab)->_on_finish(__pyx_v_self, __pyx_v_e); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 132, __pyx_L19_error)
+          __Pyx_GOTREF(__pyx_t_10);
+          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+
+133:             raise
+
          __Pyx_GIVEREF(__pyx_t_4);
+          __Pyx_GIVEREF(__pyx_t_7);
+          __Pyx_XGIVEREF(__pyx_t_9);
+          __Pyx_ErrRestoreWithState(__pyx_t_4, __pyx_t_7, __pyx_t_9);
+          __pyx_t_4 = 0; __pyx_t_7 = 0; __pyx_t_9 = 0; 
+          __PYX_ERR(0, 133, __pyx_L19_error)
+        }
+
 134:         finally:
+
+135:             self.spawn = None
+
  /*finally:*/ {
+    /*normal exit:*/{
+      __Pyx_INCREF(Py_None);
+      __Pyx_GIVEREF(Py_None);
+      __Pyx_GOTREF(__pyx_v_self->spawn);
+      __Pyx_DECREF(__pyx_v_self->spawn);
+      __pyx_v_self->spawn = Py_None;
+/* … */
+        __Pyx_INCREF(Py_None);
+        __Pyx_GIVEREF(Py_None);
+        __Pyx_GOTREF(__pyx_v_self->spawn);
+        __Pyx_DECREF(__pyx_v_self->spawn);
+        __pyx_v_self->spawn = Py_None;
+
+136:             self.func = None
+
      __Pyx_INCREF(Py_None);
+      __Pyx_GIVEREF(Py_None);
+      __Pyx_GOTREF(__pyx_v_self->func);
+      __Pyx_DECREF(__pyx_v_self->func);
+      __pyx_v_self->func = Py_None;
+/* … */
+        __Pyx_INCREF(Py_None);
+        __Pyx_GIVEREF(Py_None);
+        __Pyx_GOTREF(__pyx_v_self->func);
+        __Pyx_DECREF(__pyx_v_self->func);
+        __pyx_v_self->func = Py_None;
+
+137:             self.iterable = None
+
      __Pyx_INCREF(Py_None);
+      __Pyx_GIVEREF(Py_None);
+      __Pyx_GOTREF(__pyx_v_self->iterable);
+      __Pyx_DECREF(__pyx_v_self->iterable);
+      __pyx_v_self->iterable = Py_None;
+/* … */
+        __Pyx_INCREF(Py_None);
+        __Pyx_GIVEREF(Py_None);
+        __Pyx_GOTREF(__pyx_v_self->iterable);
+        __Pyx_DECREF(__pyx_v_self->iterable);
+        __pyx_v_self->iterable = Py_None;
+
+138:             self._result_semaphore = None
+
      __Pyx_INCREF(Py_None);
+      __Pyx_GIVEREF(Py_None);
+      __Pyx_GOTREF(__pyx_v_self->_result_semaphore);
+      __Pyx_DECREF(((PyObject *)__pyx_v_self->_result_semaphore));
+      __pyx_v_self->_result_semaphore = ((struct __pyx_obj_6gevent_11__semaphore_Semaphore *)Py_None);
+      goto __pyx_L5;
+    }
+    __pyx_L4_error:;
+    /*exception exit:*/{
+      __Pyx_PyThreadState_declare
+      __Pyx_PyThreadState_assign
+      __pyx_t_3 = 0; __pyx_t_2 = 0; __pyx_t_1 = 0; __pyx_t_18 = 0; __pyx_t_17 = 0; __pyx_t_16 = 0;
+      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
+      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
+      if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_18, &__pyx_t_17, &__pyx_t_16);
+      if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_3, &__pyx_t_2, &__pyx_t_1) < 0)) __Pyx_ErrFetch(&__pyx_t_3, &__pyx_t_2, &__pyx_t_1);
+      __Pyx_XGOTREF(__pyx_t_3);
+      __Pyx_XGOTREF(__pyx_t_2);
+      __Pyx_XGOTREF(__pyx_t_1);
+      __Pyx_XGOTREF(__pyx_t_18);
+      __Pyx_XGOTREF(__pyx_t_17);
+      __Pyx_XGOTREF(__pyx_t_16);
+      __pyx_t_11 = __pyx_lineno; __pyx_t_8 = __pyx_clineno; __pyx_t_19 = __pyx_filename;
+      {
+/* … */
+        __Pyx_INCREF(Py_None);
+        __Pyx_GIVEREF(Py_None);
+        __Pyx_GOTREF(__pyx_v_self->_result_semaphore);
+        __Pyx_DECREF(((PyObject *)__pyx_v_self->_result_semaphore));
+        __pyx_v_self->_result_semaphore = ((struct __pyx_obj_6gevent_11__semaphore_Semaphore *)Py_None);
+      }
+      if (PY_MAJOR_VERSION >= 3) {
+        __Pyx_XGIVEREF(__pyx_t_18);
+        __Pyx_XGIVEREF(__pyx_t_17);
+        __Pyx_XGIVEREF(__pyx_t_16);
+        __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_17, __pyx_t_16);
+      }
+      __Pyx_XGIVEREF(__pyx_t_3);
+      __Pyx_XGIVEREF(__pyx_t_2);
+      __Pyx_XGIVEREF(__pyx_t_1);
+      __Pyx_ErrRestore(__pyx_t_3, __pyx_t_2, __pyx_t_1);
+      __pyx_t_3 = 0; __pyx_t_2 = 0; __pyx_t_1 = 0; __pyx_t_18 = 0; __pyx_t_17 = 0; __pyx_t_16 = 0;
+      __pyx_lineno = __pyx_t_11; __pyx_clineno = __pyx_t_8; __pyx_filename = __pyx_t_19;
+      goto __pyx_L1_error;
+    }
+    __pyx_L5:;
+  }
+
 139: 
+
+140:     def _on_result(self, greenlet):
+
static PyObject *__pyx_pw_6gevent_6__imap_13IMapUnordered_9_on_result(PyObject *__pyx_v_self, PyObject *__pyx_v_greenlet); /*proto*/
+static PyObject *__pyx_f_6gevent_6__imap_13IMapUnordered__on_result(struct __pyx_obj_6gevent_6__imap_IMapUnordered *__pyx_v_self, PyObject *__pyx_v_greenlet, int __pyx_skip_dispatch) {
+  int __pyx_v_count;
+  int __pyx_v_finished;
+  int __pyx_v_ready;
+  int __pyx_v_put_finished;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_on_result", 0);
+  /* Check if called by wrapper */
+  if (unlikely(__pyx_skip_dispatch)) ;
+  /* Check if overridden in Python */
+  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
+    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
+    if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
+    else {
+      PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      #endif
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_on_result); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 140, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_6__imap_13IMapUnordered_9_on_result)) {
+        __Pyx_XDECREF(__pyx_r);
+        __Pyx_INCREF(__pyx_t_1);
+        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+          if (likely(__pyx_t_4)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+            __Pyx_INCREF(__pyx_t_4);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_3, function);
+          }
+        }
+        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_greenlet) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_greenlet);
+        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 140, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __pyx_r = __pyx_t_2;
+        __pyx_t_2 = 0;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        goto __pyx_L0;
+      }
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+      tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
+      if (unlikely(type_dict_guard != tp_dict_version)) {
+        tp_dict_version = obj_dict_version = 0;
+      }
+      #endif
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    }
+    #endif
+  }
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_AddTraceback("gevent.__imap.IMapUnordered._on_result", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6__imap_13IMapUnordered_9_on_result(PyObject *__pyx_v_self, PyObject *__pyx_v_greenlet); /*proto*/
+static char __pyx_doc_6gevent_6__imap_13IMapUnordered_8_on_result[] = "IMapUnordered._on_result(self, greenlet)";
+static PyMethodDef __pyx_mdef_6gevent_6__imap_13IMapUnordered_9_on_result = {"_on_result", (PyCFunction)__pyx_pw_6gevent_6__imap_13IMapUnordered_9_on_result, METH_O, __pyx_doc_6gevent_6__imap_13IMapUnordered_8_on_result};
+static PyObject *__pyx_pw_6gevent_6__imap_13IMapUnordered_9_on_result(PyObject *__pyx_v_self, PyObject *__pyx_v_greenlet) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_on_result (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_6__imap_13IMapUnordered_8_on_result(((struct __pyx_obj_6gevent_6__imap_IMapUnordered *)__pyx_v_self), ((PyObject *)__pyx_v_greenlet));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6__imap_13IMapUnordered_8_on_result(struct __pyx_obj_6gevent_6__imap_IMapUnordered *__pyx_v_self, PyObject *__pyx_v_greenlet) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_on_result", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __pyx_f_6gevent_6__imap_13IMapUnordered__on_result(__pyx_v_self, __pyx_v_greenlet, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 140, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.__imap.IMapUnordered._on_result", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__5 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_greenlet); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 140, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__5);
+  __Pyx_GIVEREF(__pyx_tuple__5);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6__imap_13IMapUnordered_9_on_result, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_IMapUnordered__on_result, NULL, __pyx_n_s_gevent___imap, __pyx_d, ((PyObject *)__pyx_codeobj__6)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 140, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6__imap_IMapUnordered->tp_dict, __pyx_n_s_on_result, __pyx_t_2) < 0) __PYX_ERR(0, 140, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_6__imap_IMapUnordered);
+
 141:         # This method will be called in the hub greenlet (we rawlink)
+
+142:         self._outstanding_tasks -= 1
+
  __pyx_v_self->_outstanding_tasks = (__pyx_v_self->_outstanding_tasks - 1);
+
+143:         count = self._outstanding_tasks
+
  __pyx_t_5 = __pyx_v_self->_outstanding_tasks;
+  __pyx_v_count = __pyx_t_5;
+
+144:         finished = self.finished
+
  __pyx_t_6 = __pyx_v_self->finished;
+  __pyx_v_finished = __pyx_t_6;
+
+145:         ready = self.ready()
+
  __pyx_v_ready = ((struct __pyx_vtabstruct_6gevent_6__imap_IMapUnordered *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.ready(((struct __pyx_obj_6gevent_9_greenlet_Greenlet *)__pyx_v_self), 0);
+
+146:         put_finished = False
+
  __pyx_v_put_finished = 0;
+
 147: 
+
+148:         if ready and count <= 0 and not finished:
+
  __pyx_t_7 = (__pyx_v_ready != 0);
+  if (__pyx_t_7) {
+  } else {
+    __pyx_t_6 = __pyx_t_7;
+    goto __pyx_L4_bool_binop_done;
+  }
+  __pyx_t_7 = ((__pyx_v_count <= 0) != 0);
+  if (__pyx_t_7) {
+  } else {
+    __pyx_t_6 = __pyx_t_7;
+    goto __pyx_L4_bool_binop_done;
+  }
+  __pyx_t_7 = ((!(__pyx_v_finished != 0)) != 0);
+  __pyx_t_6 = __pyx_t_7;
+  __pyx_L4_bool_binop_done:;
+  if (__pyx_t_6) {
+/* … */
+  }
+
+149:             finished = self.finished = True
+
    __pyx_v_finished = 1;
+    __pyx_v_self->finished = 1;
+
+150:             put_finished = True
+
    __pyx_v_put_finished = 1;
+
 151: 
+
+152:         if greenlet.successful():
+
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_greenlet, __pyx_n_s_successful); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 152, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = NULL;
+  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+    if (likely(__pyx_t_3)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+      __Pyx_INCREF(__pyx_t_3);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_2, function);
+    }
+  }
+  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 152, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 152, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  if (__pyx_t_6) {
+/* … */
+    goto __pyx_L7;
+  }
+
+153:             self.queue.put(self._iqueue_value_for_success(greenlet))
+
    __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_6__imap_IMapUnordered *)__pyx_v_self->__pyx_base.__pyx_vtab)->_iqueue_value_for_success(__pyx_v_self, __pyx_v_greenlet); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 153, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __pyx_t_2 = ((struct __pyx_vtabstruct_6gevent_6_queue_UnboundQueue *)__pyx_v_self->queue->__pyx_base.__pyx_vtab)->__pyx_base.put(((struct __pyx_obj_6gevent_6_queue_Queue *)__pyx_v_self->queue), __pyx_t_1, 0, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 153, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
 154:         else:
+
+155:             self.queue.put(self._iqueue_value_for_failure(greenlet))
+
  /*else*/ {
+    __pyx_t_2 = ((struct __pyx_vtabstruct_6gevent_6__imap_IMapUnordered *)__pyx_v_self->__pyx_base.__pyx_vtab)->_iqueue_value_for_failure(__pyx_v_self, __pyx_v_greenlet); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 155, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_6_queue_UnboundQueue *)__pyx_v_self->queue->__pyx_base.__pyx_vtab)->__pyx_base.put(((struct __pyx_obj_6gevent_6_queue_Queue *)__pyx_v_self->queue), __pyx_t_2, 0, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 155, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  }
+  __pyx_L7:;
+
 156: 
+
+157:         if put_finished:
+
  __pyx_t_6 = (__pyx_v_put_finished != 0);
+  if (__pyx_t_6) {
+/* … */
+  }
+
+158:             self.queue.put(self._iqueue_value_for_self_finished())
+
    __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_6__imap_IMapUnordered *)__pyx_v_self->__pyx_base.__pyx_vtab)->_iqueue_value_for_self_finished(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 158, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __pyx_t_2 = ((struct __pyx_vtabstruct_6gevent_6_queue_UnboundQueue *)__pyx_v_self->queue->__pyx_base.__pyx_vtab)->__pyx_base.put(((struct __pyx_obj_6gevent_6_queue_Queue *)__pyx_v_self->queue), __pyx_t_1, 0, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 158, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
 159: 
+
+160:     def _on_finish(self, exception):
+
static PyObject *__pyx_f_6gevent_6__imap_13IMapUnordered__on_finish(struct __pyx_obj_6gevent_6__imap_IMapUnordered *__pyx_v_self, PyObject *__pyx_v_exception) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_on_finish", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_AddTraceback("gevent.__imap.IMapUnordered._on_finish", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
 161:         # Called in this greenlet.
+
+162:         if self.finished:
+
  __pyx_t_1 = (__pyx_v_self->finished != 0);
+  if (__pyx_t_1) {
+/* … */
+  }
+
+163:             return
+
    __Pyx_XDECREF(__pyx_r);
+    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+    goto __pyx_L0;
+
 164: 
+
+165:         if exception is not None:
+
  __pyx_t_1 = (__pyx_v_exception != Py_None);
+  __pyx_t_2 = (__pyx_t_1 != 0);
+  if (__pyx_t_2) {
+/* … */
+  }
+
+166:             self.finished = True
+
    __pyx_v_self->finished = 1;
+
+167:             self.queue.put(self._iqueue_value_for_self_failure(exception))
+
    __pyx_t_3 = ((struct __pyx_vtabstruct_6gevent_6__imap_IMapUnordered *)__pyx_v_self->__pyx_base.__pyx_vtab)->_iqueue_value_for_self_failure(__pyx_v_self, __pyx_v_exception); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 167, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __pyx_t_4 = ((struct __pyx_vtabstruct_6gevent_6_queue_UnboundQueue *)__pyx_v_self->queue->__pyx_base.__pyx_vtab)->__pyx_base.put(((struct __pyx_obj_6gevent_6_queue_Queue *)__pyx_v_self->queue), __pyx_t_3, 0, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 167, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+
+168:             return
+
    __Pyx_XDECREF(__pyx_r);
+    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+    goto __pyx_L0;
+
 169: 
+
+170:         if self._outstanding_tasks <= 0:
+
  __pyx_t_2 = ((__pyx_v_self->_outstanding_tasks <= 0) != 0);
+  if (__pyx_t_2) {
+/* … */
+  }
+
+171:             self.finished = True
+
    __pyx_v_self->finished = 1;
+
+172:             self.queue.put(self._iqueue_value_for_self_finished())
+
    __pyx_t_4 = ((struct __pyx_vtabstruct_6gevent_6__imap_IMapUnordered *)__pyx_v_self->__pyx_base.__pyx_vtab)->_iqueue_value_for_self_finished(__pyx_v_self); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 172, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    __pyx_t_3 = ((struct __pyx_vtabstruct_6gevent_6_queue_UnboundQueue *)__pyx_v_self->queue->__pyx_base.__pyx_vtab)->__pyx_base.put(((struct __pyx_obj_6gevent_6_queue_Queue *)__pyx_v_self->queue), __pyx_t_4, 0, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 172, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+
 173: 
+
+174:     def _iqueue_value_for_success(self, greenlet):
+
static PyObject *__pyx_f_6gevent_6__imap_13IMapUnordered__iqueue_value_for_success(CYTHON_UNUSED struct __pyx_obj_6gevent_6__imap_IMapUnordered *__pyx_v_self, PyObject *__pyx_v_greenlet) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_iqueue_value_for_success", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.__imap.IMapUnordered._iqueue_value_for_success", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+175:         return greenlet.value
+
  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_greenlet, __pyx_n_s_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 175, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
 176: 
+
+177:     def _iqueue_value_for_failure(self, greenlet):
+
static PyObject *__pyx_f_6gevent_6__imap_13IMapUnordered__iqueue_value_for_failure(CYTHON_UNUSED struct __pyx_obj_6gevent_6__imap_IMapUnordered *__pyx_v_self, PyObject *__pyx_v_greenlet) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_iqueue_value_for_failure", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_AddTraceback("gevent.__imap.IMapUnordered._iqueue_value_for_failure", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+178:         return Failure(greenlet.exception, getattr(greenlet, '_raise_exception'))
+
  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_greenlet, __pyx_n_s_exception); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 178, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = __Pyx_GetAttr(__pyx_v_greenlet, __pyx_n_s_raise_exception_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 178, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 178, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_GIVEREF(__pyx_t_1);
+  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_2);
+  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
+  __pyx_t_1 = 0;
+  __pyx_t_2 = 0;
+  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6gevent_6__imap_Failure), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 178, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __pyx_r = __pyx_t_2;
+  __pyx_t_2 = 0;
+  goto __pyx_L0;
+
 179: 
+
+180:     def _iqueue_value_for_self_finished(self):
+
static PyObject *__pyx_f_6gevent_6__imap_13IMapUnordered__iqueue_value_for_self_finished(CYTHON_UNUSED struct __pyx_obj_6gevent_6__imap_IMapUnordered *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_iqueue_value_for_self_finished", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_AddTraceback("gevent.__imap.IMapUnordered._iqueue_value_for_self_finished", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+181:         return Failure(StopIteration())
+
  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_builtin_StopIteration); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 181, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_6gevent_6__imap_Failure), __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 181, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_r = __pyx_t_2;
+  __pyx_t_2 = 0;
+  goto __pyx_L0;
+
 182: 
+
+183:     def _iqueue_value_for_self_failure(self, exception):
+
static PyObject *__pyx_f_6gevent_6__imap_13IMapUnordered__iqueue_value_for_self_failure(struct __pyx_obj_6gevent_6__imap_IMapUnordered *__pyx_v_self, PyObject *__pyx_v_exception) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_iqueue_value_for_self_failure", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_AddTraceback("gevent.__imap.IMapUnordered._iqueue_value_for_self_failure", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+184:         return Failure(exception, self._raise_exception)
+
  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_raise_exception_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 184, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 184, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(__pyx_v_exception);
+  __Pyx_GIVEREF(__pyx_v_exception);
+  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_exception);
+  __Pyx_GIVEREF(__pyx_t_1);
+  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1);
+  __pyx_t_1 = 0;
+  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6gevent_6__imap_Failure), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 184, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
 185: 
+
 186: 
+
+187: class IMap(IMapUnordered):
+
struct __pyx_vtabstruct_6gevent_6__imap_IMap {
+  struct __pyx_vtabstruct_6gevent_6__imap_IMapUnordered __pyx_base;
+};
+static struct __pyx_vtabstruct_6gevent_6__imap_IMap *__pyx_vtabptr_6gevent_6__imap_IMap;
+
 188:     # A specialization of IMapUnordered that returns items
+
 189:     # in the order in which they were generated, not
+
 190:     # the order in which they finish.
+
 191: 
+
+192:     def __init__(self, *args, **kwargs):
+
/* Python wrapper */
+static int __pyx_pw_6gevent_6__imap_4IMap_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static int __pyx_pw_6gevent_6__imap_4IMap_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_args = 0;
+  PyObject *__pyx_v_kwargs = 0;
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
+  if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 1))) return -1;
+  if (unlikely(__pyx_kwds)) {
+    __pyx_v_kwargs = PyDict_Copy(__pyx_kwds); if (unlikely(!__pyx_v_kwargs)) return -1;
+    __Pyx_GOTREF(__pyx_v_kwargs);
+  } else {
+    __pyx_v_kwargs = NULL;
+  }
+  __Pyx_INCREF(__pyx_args);
+  __pyx_v_args = __pyx_args;
+  __pyx_r = __pyx_pf_6gevent_6__imap_4IMap___init__(((struct __pyx_obj_6gevent_6__imap_IMap *)__pyx_v_self), __pyx_v_args, __pyx_v_kwargs);
+
+  /* function exit code */
+  __Pyx_XDECREF(__pyx_v_args);
+  __Pyx_XDECREF(__pyx_v_kwargs);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_6__imap_4IMap___init__(struct __pyx_obj_6gevent_6__imap_IMap *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = 0;
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_AddTraceback("gevent.__imap.IMap.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = -1;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
 193:         # The result dictionary: {index: value}
+
+194:         self._results = {}
+
  __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 194, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_1);
+  __Pyx_GOTREF(__pyx_v_self->_results);
+  __Pyx_DECREF(__pyx_v_self->_results);
+  __pyx_v_self->_results = ((PyObject*)__pyx_t_1);
+  __pyx_t_1 = 0;
+
 195: 
+
 196:         # The index of the result to return next.
+
+197:         self.index = 0
+
  __pyx_v_self->index = 0;
+
+198:         IMapUnordered.__init__(self, *args, **kwargs)
+
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_6gevent_6__imap_IMapUnordered), __pyx_n_s_init); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 198, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 198, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(((PyObject *)__pyx_v_self));
+  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
+  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self));
+  __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_v_args); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 198, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 198, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
 199: 
+
+200:     def _inext(self):
+
static PyObject *__pyx_f_6gevent_6__imap_4IMap__inext(struct __pyx_obj_6gevent_6__imap_IMap *__pyx_v_self) {
+  int __pyx_v_index;
+  PyObject *__pyx_v_value = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_inext", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_XDECREF(__pyx_t_7);
+  __Pyx_XDECREF(__pyx_t_8);
+  __Pyx_XDECREF(__pyx_t_9);
+  __Pyx_XDECREF(__pyx_t_10);
+  __Pyx_XDECREF(__pyx_t_11);
+  __Pyx_AddTraceback("gevent.__imap.IMap._inext", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_value);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+201:         try:
+
  {
+    /*try:*/ {
+/* … */
+    }
+    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+    goto __pyx_L8_try_end;
+    __pyx_L3_error:;
+    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+/* … */
+    __Pyx_XGIVEREF(__pyx_t_1);
+    __Pyx_XGIVEREF(__pyx_t_2);
+    __Pyx_XGIVEREF(__pyx_t_3);
+    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
+    goto __pyx_L1_error;
+    __pyx_L4_exception_handled:;
+    __Pyx_XGIVEREF(__pyx_t_1);
+    __Pyx_XGIVEREF(__pyx_t_2);
+    __Pyx_XGIVEREF(__pyx_t_3);
+    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
+    __pyx_L8_try_end:;
+  }
+
+202:             value = self._results.pop(self.index)
+
      if (unlikely(__pyx_v_self->_results == Py_None)) {
+        PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "pop");
+        __PYX_ERR(0, 202, __pyx_L3_error)
+      }
+      __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_self->index); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 202, __pyx_L3_error)
+      __Pyx_GOTREF(__pyx_t_4);
+      __pyx_t_5 = __Pyx_PyDict_Pop(__pyx_v_self->_results, __pyx_t_4, ((PyObject *)NULL)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 202, __pyx_L3_error)
+      __Pyx_GOTREF(__pyx_t_5);
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __pyx_v_value = __pyx_t_5;
+      __pyx_t_5 = 0;
+
+203:         except KeyError:
+
    __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
+    if (__pyx_t_6) {
+      __Pyx_AddTraceback("gevent.__imap.IMap._inext", __pyx_clineno, __pyx_lineno, __pyx_filename);
+      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_4, &__pyx_t_7) < 0) __PYX_ERR(0, 203, __pyx_L5_except_error)
+      __Pyx_GOTREF(__pyx_t_5);
+      __Pyx_GOTREF(__pyx_t_4);
+      __Pyx_GOTREF(__pyx_t_7);
+
 204:             # Wait for our index to finish.
+
+205:             while 1:
+
      while (1) {
+
+206:                 index, value = self.queue.get()
+
        __pyx_t_8 = ((struct __pyx_vtabstruct_6gevent_6_queue_UnboundQueue *)__pyx_v_self->__pyx_base.queue->__pyx_base.__pyx_vtab)->__pyx_base.get(((struct __pyx_obj_6gevent_6_queue_Queue *)__pyx_v_self->__pyx_base.queue), 0, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 206, __pyx_L5_except_error)
+        __Pyx_GOTREF(__pyx_t_8);
+        if ((likely(PyTuple_CheckExact(__pyx_t_8))) || (PyList_CheckExact(__pyx_t_8))) {
+          PyObject* sequence = __pyx_t_8;
+          Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
+          if (unlikely(size != 2)) {
+            if (size > 2) __Pyx_RaiseTooManyValuesError(2);
+            else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
+            __PYX_ERR(0, 206, __pyx_L5_except_error)
+          }
+          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+          if (likely(PyTuple_CheckExact(sequence))) {
+            __pyx_t_9 = PyTuple_GET_ITEM(sequence, 0); 
+            __pyx_t_10 = PyTuple_GET_ITEM(sequence, 1); 
+          } else {
+            __pyx_t_9 = PyList_GET_ITEM(sequence, 0); 
+            __pyx_t_10 = PyList_GET_ITEM(sequence, 1); 
+          }
+          __Pyx_INCREF(__pyx_t_9);
+          __Pyx_INCREF(__pyx_t_10);
+          #else
+          __pyx_t_9 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 206, __pyx_L5_except_error)
+          __Pyx_GOTREF(__pyx_t_9);
+          __pyx_t_10 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 206, __pyx_L5_except_error)
+          __Pyx_GOTREF(__pyx_t_10);
+          #endif
+          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+        } else {
+          Py_ssize_t index = -1;
+          __pyx_t_11 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 206, __pyx_L5_except_error)
+          __Pyx_GOTREF(__pyx_t_11);
+          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+          __pyx_t_12 = Py_TYPE(__pyx_t_11)->tp_iternext;
+          index = 0; __pyx_t_9 = __pyx_t_12(__pyx_t_11); if (unlikely(!__pyx_t_9)) goto __pyx_L13_unpacking_failed;
+          __Pyx_GOTREF(__pyx_t_9);
+          index = 1; __pyx_t_10 = __pyx_t_12(__pyx_t_11); if (unlikely(!__pyx_t_10)) goto __pyx_L13_unpacking_failed;
+          __Pyx_GOTREF(__pyx_t_10);
+          if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_11), 2) < 0) __PYX_ERR(0, 206, __pyx_L5_except_error)
+          __pyx_t_12 = NULL;
+          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+          goto __pyx_L14_unpacking_done;
+          __pyx_L13_unpacking_failed:;
+          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+          __pyx_t_12 = NULL;
+          if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
+          __PYX_ERR(0, 206, __pyx_L5_except_error)
+          __pyx_L14_unpacking_done:;
+        }
+        __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_t_9); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 206, __pyx_L5_except_error)
+        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+        __pyx_v_index = __pyx_t_6;
+        __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_10);
+        __pyx_t_10 = 0;
+
+207:                 if index == self.index:
+
        __pyx_t_13 = ((__pyx_v_index == __pyx_v_self->index) != 0);
+        if (__pyx_t_13) {
+/* … */
+        }
+
+208:                     break
+
          goto __pyx_L12_break;
+
 209:                 else:
+
+210:                     self._results[index] = value
+
        /*else*/ {
+          if (unlikely(__pyx_v_self->_results == Py_None)) {
+            PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
+            __PYX_ERR(0, 210, __pyx_L5_except_error)
+          }
+          __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_index); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 210, __pyx_L5_except_error)
+          __Pyx_GOTREF(__pyx_t_8);
+          if (unlikely(PyDict_SetItem(__pyx_v_self->_results, __pyx_t_8, __pyx_v_value) < 0)) __PYX_ERR(0, 210, __pyx_L5_except_error)
+          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+        }
+      }
+      __pyx_L12_break:;
+      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+      goto __pyx_L4_exception_handled;
+    }
+    goto __pyx_L5_except_error;
+    __pyx_L5_except_error:;
+
+211:         self.index += 1
+
  __pyx_v_self->index = (__pyx_v_self->index + 1);
+
+212:         return value
+
  __Pyx_XDECREF(__pyx_r);
+  if (unlikely(!__pyx_v_value)) { __Pyx_RaiseUnboundLocalError("value"); __PYX_ERR(0, 212, __pyx_L1_error) }
+  __Pyx_INCREF(__pyx_v_value);
+  __pyx_r = __pyx_v_value;
+  goto __pyx_L0;
+
 213: 
+
+214:     def _iqueue_value_for_success(self, greenlet):
+
static PyObject *__pyx_f_6gevent_6__imap_4IMap__iqueue_value_for_success(struct __pyx_obj_6gevent_6__imap_IMap *__pyx_v_self, PyObject *__pyx_v_greenlet) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_iqueue_value_for_success", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_AddTraceback("gevent.__imap.IMap._iqueue_value_for_success", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+215:         return (greenlet._imap_task_index, IMapUnordered._iqueue_value_for_success(self, greenlet))
+
  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_greenlet, __pyx_n_s_imap_task_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 215, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = __pyx_f_6gevent_6__imap_13IMapUnordered__iqueue_value_for_success(((struct __pyx_obj_6gevent_6__imap_IMapUnordered *)__pyx_v_self), __pyx_v_greenlet); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 215, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 215, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_GIVEREF(__pyx_t_1);
+  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_2);
+  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
+  __pyx_t_1 = 0;
+  __pyx_t_2 = 0;
+  __pyx_r = __pyx_t_3;
+  __pyx_t_3 = 0;
+  goto __pyx_L0;
+
 216: 
+
+217:     def _iqueue_value_for_failure(self, greenlet):
+
static PyObject *__pyx_f_6gevent_6__imap_4IMap__iqueue_value_for_failure(struct __pyx_obj_6gevent_6__imap_IMap *__pyx_v_self, PyObject *__pyx_v_greenlet) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_iqueue_value_for_failure", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_AddTraceback("gevent.__imap.IMap._iqueue_value_for_failure", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+218:         return (greenlet._imap_task_index, IMapUnordered._iqueue_value_for_failure(self, greenlet))
+
  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_greenlet, __pyx_n_s_imap_task_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 218, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = __pyx_f_6gevent_6__imap_13IMapUnordered__iqueue_value_for_failure(((struct __pyx_obj_6gevent_6__imap_IMapUnordered *)__pyx_v_self), __pyx_v_greenlet); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 218, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 218, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_GIVEREF(__pyx_t_1);
+  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_2);
+  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
+  __pyx_t_1 = 0;
+  __pyx_t_2 = 0;
+  __pyx_r = __pyx_t_3;
+  __pyx_t_3 = 0;
+  goto __pyx_L0;
+
 219: 
+
+220:     def _iqueue_value_for_self_finished(self):
+
static PyObject *__pyx_f_6gevent_6__imap_4IMap__iqueue_value_for_self_finished(struct __pyx_obj_6gevent_6__imap_IMap *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_iqueue_value_for_self_finished", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_AddTraceback("gevent.__imap.IMap._iqueue_value_for_self_finished", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+221:         return (self._max_index + 1, IMapUnordered._iqueue_value_for_self_finished(self))
+
  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __Pyx_PyInt_From_long((__pyx_v_self->__pyx_base._max_index + 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 221, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = __pyx_f_6gevent_6__imap_13IMapUnordered__iqueue_value_for_self_finished(((struct __pyx_obj_6gevent_6__imap_IMapUnordered *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 221, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 221, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_GIVEREF(__pyx_t_1);
+  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_2);
+  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
+  __pyx_t_1 = 0;
+  __pyx_t_2 = 0;
+  __pyx_r = __pyx_t_3;
+  __pyx_t_3 = 0;
+  goto __pyx_L0;
+
 222: 
+
+223:     def _iqueue_value_for_self_failure(self, exception):
+
static PyObject *__pyx_f_6gevent_6__imap_4IMap__iqueue_value_for_self_failure(struct __pyx_obj_6gevent_6__imap_IMap *__pyx_v_self, PyObject *__pyx_v_exception) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_iqueue_value_for_self_failure", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_AddTraceback("gevent.__imap.IMap._iqueue_value_for_self_failure", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+224:         return (self._max_index + 1, IMapUnordered._iqueue_value_for_self_failure(self, exception))
+
  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __Pyx_PyInt_From_long((__pyx_v_self->__pyx_base._max_index + 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 224, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = __pyx_f_6gevent_6__imap_13IMapUnordered__iqueue_value_for_self_failure(((struct __pyx_obj_6gevent_6__imap_IMapUnordered *)__pyx_v_self), __pyx_v_exception); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 224, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 224, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_GIVEREF(__pyx_t_1);
+  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_2);
+  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
+  __pyx_t_1 = 0;
+  __pyx_t_2 = 0;
+  __pyx_r = __pyx_t_3;
+  __pyx_t_3 = 0;
+  goto __pyx_L0;
+
 225: 
+
+226: from gevent._util import import_c_accel
+
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 226, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_import_c_accel);
+  __Pyx_GIVEREF(__pyx_n_s_import_c_accel);
+  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_import_c_accel);
+  __pyx_t_1 = __Pyx_Import(__pyx_n_s_gevent__util, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 226, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_import_c_accel); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 226, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_import_c_accel, __pyx_t_2) < 0) __PYX_ERR(0, 226, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+227: import_c_accel(globals(), 'gevent.__imap')
+
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_import_c_accel); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 227, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = __Pyx_Globals(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 227, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 227, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_GIVEREF(__pyx_t_2);
+  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_gevent___imap);
+  __Pyx_GIVEREF(__pyx_n_s_gevent___imap);
+  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_n_s_gevent___imap);
+  __pyx_t_2 = 0;
+  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 227, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_imap.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_imap.py new file mode 100644 index 00000000..e976b679 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_imap.py @@ -0,0 +1,227 @@ +# -*- coding: utf-8 -*- +# Copyright (c) 2018 gevent +# cython: auto_pickle=False,embedsignature=True,always_allow_keywords=False,infer_types=True + +""" +Iterators across greenlets or AsyncResult objects. + +""" +from __future__ import absolute_import +from __future__ import division +from __future__ import print_function + + +from gevent import _semaphore +from gevent import queue + + +__all__ = [ + 'IMapUnordered', + 'IMap', +] + +locals()['Greenlet'] = __import__('gevent').Greenlet +locals()['Semaphore'] = _semaphore.Semaphore +locals()['UnboundQueue'] = queue.UnboundQueue + + +class Failure(object): + __slots__ = ('exc', 'raise_exception') + + def __init__(self, exc, raise_exception=None): + self.exc = exc + self.raise_exception = raise_exception + + +def _raise_exc(failure): + # For cython. + if failure.raise_exception: + failure.raise_exception() + else: + raise failure.exc + +class IMapUnordered(Greenlet): # pylint:disable=undefined-variable + """ + At iterator of map results. + """ + + def __init__(self, func, iterable, spawn, maxsize=None, _zipped=False): + """ + An iterator that. + + :param callable spawn: The function we use to create new greenlets. + :keyword int maxsize: If given and not-None, specifies the maximum number of + finished results that will be allowed to accumulated awaiting the reader; + more than that number of results will cause map function greenlets to begin + to block. This is most useful is there is a great disparity in the speed of + the mapping code and the consumer and the results consume a great deal of resources. + Using a bound is more computationally expensive than not using a bound. + + .. versionchanged:: 1.1b3 + Added the *maxsize* parameter. + """ + Greenlet.__init__(self) # pylint:disable=undefined-variable + self.spawn = spawn + self._zipped = _zipped + self.func = func + self.iterable = iterable + self.queue = UnboundQueue() # pylint:disable=undefined-variable + + + if maxsize: + # Bounding the queue is not enough if we want to keep from + # accumulating objects; the result value will be around as + # the greenlet's result, blocked on self.queue.put(), and + # we'll go on to spawn another greenlet, which in turn can + # create the result. So we need a semaphore to prevent a + # greenlet from exiting while the queue is full so that we + # don't spawn the next greenlet (assuming that self.spawn + # is of course bounded). (Alternatively we could have the + # greenlet itself do the insert into the pool, but that + # takes some rework). + # + # Given the use of a semaphore at this level, sizing the queue becomes + # redundant, and that lets us avoid having to use self.link() instead + # of self.rawlink() to avoid having blocking methods called in the + # hub greenlet. + self._result_semaphore = Semaphore(maxsize) # pylint:disable=undefined-variable + else: + self._result_semaphore = None + + self._outstanding_tasks = 0 + # The index (zero based) of the maximum number of + # results we will have. + self._max_index = -1 + self.finished = False + + + # We're iterating in a different greenlet than we're running. + def __iter__(self): + return self + + def __next__(self): + if self._result_semaphore is not None: + self._result_semaphore.release() + value = self._inext() + if isinstance(value, Failure): + _raise_exc(value) + return value + + next = __next__ # Py2 + + def _inext(self): + return self.queue.get() + + def _ispawn(self, func, item, item_index): + if self._result_semaphore is not None: + self._result_semaphore.acquire() + self._outstanding_tasks += 1 + g = self.spawn(func, item) if not self._zipped else self.spawn(func, *item) + g._imap_task_index = item_index + g.rawlink(self._on_result) + return g + + def _run(self): # pylint:disable=method-hidden + try: + func = self.func + for item in self.iterable: + self._max_index += 1 + self._ispawn(func, item, self._max_index) + self._on_finish(None) + except BaseException as e: + self._on_finish(e) + raise + finally: + self.spawn = None + self.func = None + self.iterable = None + self._result_semaphore = None + + def _on_result(self, greenlet): + # This method will be called in the hub greenlet (we rawlink) + self._outstanding_tasks -= 1 + count = self._outstanding_tasks + finished = self.finished + ready = self.ready() + put_finished = False + + if ready and count <= 0 and not finished: + finished = self.finished = True + put_finished = True + + if greenlet.successful(): + self.queue.put(self._iqueue_value_for_success(greenlet)) + else: + self.queue.put(self._iqueue_value_for_failure(greenlet)) + + if put_finished: + self.queue.put(self._iqueue_value_for_self_finished()) + + def _on_finish(self, exception): + # Called in this greenlet. + if self.finished: + return + + if exception is not None: + self.finished = True + self.queue.put(self._iqueue_value_for_self_failure(exception)) + return + + if self._outstanding_tasks <= 0: + self.finished = True + self.queue.put(self._iqueue_value_for_self_finished()) + + def _iqueue_value_for_success(self, greenlet): + return greenlet.value + + def _iqueue_value_for_failure(self, greenlet): + return Failure(greenlet.exception, getattr(greenlet, '_raise_exception')) + + def _iqueue_value_for_self_finished(self): + return Failure(StopIteration()) + + def _iqueue_value_for_self_failure(self, exception): + return Failure(exception, self._raise_exception) + + +class IMap(IMapUnordered): + # A specialization of IMapUnordered that returns items + # in the order in which they were generated, not + # the order in which they finish. + + def __init__(self, *args, **kwargs): + # The result dictionary: {index: value} + self._results = {} + + # The index of the result to return next. + self.index = 0 + IMapUnordered.__init__(self, *args, **kwargs) + + def _inext(self): + try: + value = self._results.pop(self.index) + except KeyError: + # Wait for our index to finish. + while 1: + index, value = self.queue.get() + if index == self.index: + break + else: + self._results[index] = value + self.index += 1 + return value + + def _iqueue_value_for_success(self, greenlet): + return (greenlet._imap_task_index, IMapUnordered._iqueue_value_for_success(self, greenlet)) + + def _iqueue_value_for_failure(self, greenlet): + return (greenlet._imap_task_index, IMapUnordered._iqueue_value_for_failure(self, greenlet)) + + def _iqueue_value_for_self_finished(self): + return (self._max_index + 1, IMapUnordered._iqueue_value_for_self_finished(self)) + + def _iqueue_value_for_self_failure(self, exception): + return (self._max_index + 1, IMapUnordered._iqueue_value_for_self_failure(self, exception)) + +from gevent._util import import_c_accel +import_c_accel(globals(), 'gevent.__imap') diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_interfaces.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_interfaces.py new file mode 100644 index 00000000..8ee20209 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_interfaces.py @@ -0,0 +1,230 @@ +# -*- coding: utf-8 -*- +# Copyright (c) 2018 gevent contributors. See LICENSE for details. +""" +Interfaces gevent uses that don't belong any one place. + +This is not a public module, these interfaces are not +currently exposed to the public, they mostly exist for +documentation and testing purposes. + +.. versionadded:: 1.3b2 + +""" +from __future__ import absolute_import +from __future__ import division +from __future__ import print_function + +import sys + +from gevent._util import Interface +from gevent._util import Attribute + +# pylint:disable=no-method-argument, unused-argument, no-self-argument + +__all__ = [ + 'ILoop', + 'IWatcher', +] + +class ILoop(Interface): + """ + The common interface expected for all event loops. + + .. caution:: + This is an internal, low-level interface. It may change + between minor versions of gevent. + + .. rubric:: Watchers + + The methods that create event loop watchers are `io`, `timer`, + `signal`, `idle`, `prepare`, `check`, `fork`, `async_`, `child`, + `stat`. These all return various types of :class:`IWatcher`. + + All of those methods have one or two common arguments. *ref* is a + boolean saying whether the event loop is allowed to exit even if + this watcher is still started. *priority* is event loop specific. + """ + + default = Attribute("Boolean indicating whether this is the default loop") + + approx_timer_resolution = Attribute( + "Floating point number of seconds giving (approximately) the minimum " + "resolution of a timer (and hence the minimun value the sleep can sleep for). " + "On libuv, this is fixed by the library, but on libev it is just a guess " + "and the actual value is system dependent." + ) + + def run(nowait=False, once=False): + """ + Run the event loop. + + This is usually called automatically by the hub greenlet, but + in special cases (when the hub is *not* running) you can use + this to control how the event loop runs (for example, to integrate + it with another event loop). + """ + + def now(): + """ + now() -> float + + Return the loop's notion of the current time. + + This may not necessarily be related to :func:`time.time` (it + may have a different starting point), but it must be expressed + in fractional seconds (the same *units* used by :func:`time.time`). + """ + + def update_now(): + """ + Update the loop's notion of the current time. + + .. versionadded:: 1.3 + In the past, this available as ``update``. This is still available as + an alias but will be removed in the future. + """ + + def destroy(): + """ + Clean up resources used by this loop. + + If you create loops + (especially loops that are not the default) you *should* call + this method when you are done with the loop. + + .. caution:: + + As an implementation note, the libev C loop implementation has a + finalizer (``__del__``) that destroys the object, but the libuv + and libev CFFI implementations do not. The C implementation may change. + + """ + + def io(fd, events, ref=True, priority=None): + """ + Create and return a new IO watcher for the given *fd*. + + *events* is a bitmask specifying which events to watch + for. 1 means read, and 2 means write. + """ + + def timer(after, repeat=0.0, ref=True, priority=None): + """ + Create and return a timer watcher that will fire after *after* seconds. + + If *repeat* is given, the timer will continue to fire every *repeat* seconds. + """ + + def signal(signum, ref=True, priority=None): + """ + Create and return a signal watcher for the signal *signum*, + one of the constants defined in :mod:`signal`. + + This is platform and event loop specific. + """ + + def idle(ref=True, priority=None): + """ + Create and return a watcher that fires when the event loop is idle. + """ + + def prepare(ref=True, priority=None): + """ + Create and return a watcher that fires before the event loop + polls for IO. + + .. caution:: This method is not supported by libuv. + """ + + def check(ref=True, priority=None): + """ + Create and return a watcher that fires after the event loop + polls for IO. + """ + + def fork(ref=True, priority=None): + """ + Create a watcher that fires when the process forks. + + Availability: POSIX + """ + + def async_(ref=True, priority=None): + """ + Create a watcher that fires when triggered, possibly + from another thread. + + .. versionchanged:: 1.3 + This was previously just named ``async``; for compatibility + with Python 3.7 where ``async`` is a keyword it was renamed. + On older versions of Python the old name is still around, but + it will be removed in the future. + """ + + if sys.platform != "win32": + + def child(pid, trace=0, ref=True): + """ + Create a watcher that fires for events on the child with process ID *pid*. + + This is platform specific and not available on Windows. + """ + + def stat(path, interval=0.0, ref=True, priority=None): + """ + Create a watcher that monitors the filesystem item at *path*. + + If the operating system doesn't support event notifications + from the filesystem, poll for changes every *interval* seconds. + """ + + def run_callback(func, *args): + """ + Run the *func* passing it *args* at the next opportune moment. + + This is a way of handing control to the event loop and deferring + an action. + """ + +class IWatcher(Interface): + """ + An event loop watcher. + + These objects call their *callback* function when the event + loop detects the event has happened. + + .. important:: You *must* call :meth:`close` when you are + done with this object to avoid leaking native resources. + """ + + def start(callback, *args, **kwargs): + """ + Have the event loop begin watching for this event. + + When the event is detected, *callback* will be called with + *args*. + + .. caution:: + + Not all watchers accept ``**kwargs``, + and some watchers define special meanings for certain keyword args. + """ + + def stop(): + """ + Have the event loop stop watching this event. + + In the future you may call :meth:`start` to begin watching + again. + """ + + def close(): + """ + Dispose of any native resources associated with the watcher. + + If we were active, stop. + + Attempting to operate on this object after calling close is + undefined. You should dispose of any references you have to it + after calling this method. + """ diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_local.cp37-win_amd64.pyd b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_local.cp37-win_amd64.pyd new file mode 100644 index 0000000000000000000000000000000000000000..12740093037d36a35f4dad773f4cb925908bcbdf GIT binary patch literal 127488 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�nV`ZhB)qq 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 max_allowed: + if mem_usage > self._memory_exceeded: + # We're still growing + event = MemoryUsageThresholdExceeded( + mem_usage, max_allowed, rusage) + notify(event) + self._memory_exceeded = mem_usage + else: + # we're below. Were we above it last time? + if self._memory_exceeded: + event = MemoryUsageUnderThreshold( + mem_usage, max_allowed, rusage, self._memory_exceeded) + notify(event) + self._memory_exceeded = 0 + + return event + + def __repr__(self): + return '<%s at %s in thread %s greenlet %r for %r>' % ( + self.__class__.__name__, + hex(id(self)), + hex(self.monitor_thread_ident), + getcurrent(), + self._hub_wref()) diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_patcher.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_patcher.py new file mode 100644 index 00000000..2ced50cc --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_patcher.py @@ -0,0 +1,127 @@ +# Copyright 2018 gevent. See LICENSE for details. + +# Portions of the following are inspired by code from eventlet. I +# believe they are distinct enough that no eventlet copyright would +# apply (they are not a copy or substantial portion of the eventlot +# code). + +# Added in gevent 1.3a2. Not public in that release. + +from __future__ import absolute_import, print_function + +import importlib +import sys + +from gevent._compat import PY3 +from gevent._compat import iteritems +from gevent._compat import imp_acquire_lock +from gevent._compat import imp_release_lock + + +from gevent.builtins import __import__ as _import + + +MAPPING = { + 'gevent.local': '_threading_local', + 'gevent.socket': 'socket', + 'gevent.select': 'select', + 'gevent.ssl': 'ssl', + 'gevent.thread': '_thread' if PY3 else 'thread', + 'gevent.subprocess': 'subprocess', + 'gevent.os': 'os', + 'gevent.threading': 'threading', + 'gevent.builtins': 'builtins' if PY3 else '__builtin__', + 'gevent.signal': 'signal', + 'gevent.time': 'time', + 'gevent.queue': 'queue' if PY3 else 'Queue', +} + +_PATCH_PREFIX = '__g_patched_module_' + +class _SysModulesPatcher(object): + + def __init__(self, importing): + self._saved = {} + self.importing = importing + self.green_modules = { + stdlib_name: importlib.import_module(gevent_name) + for gevent_name, stdlib_name + in iteritems(MAPPING) + } + self.orig_imported = frozenset(sys.modules) + + def _save(self): + for modname in self.green_modules: + self._saved[modname] = sys.modules.get(modname, None) + + self._saved[self.importing] = sys.modules.get(self.importing, None) + # Anything we've already patched regains its original name during this + # process + for mod_name, mod in iteritems(sys.modules): + if mod_name.startswith(_PATCH_PREFIX): + orig_mod_name = mod_name[len(_PATCH_PREFIX):] + self._saved[mod_name] = sys.modules.get(orig_mod_name, None) + self.green_modules[orig_mod_name] = mod + + def _replace(self): + # Cover the target modules so that when you import the module it + # sees only the patched versions + for name, mod in iteritems(self.green_modules): + sys.modules[name] = mod + + def _restore(self): + for modname, mod in iteritems(self._saved): + if mod is not None: + sys.modules[modname] = mod + else: + try: + del sys.modules[modname] + except KeyError: + pass + # Anything from the same package tree we imported this time + # needs to be saved so we can restore it later, and so it doesn't + # leak into the namespace. + pkg_prefix = self.importing.split('.', 1)[0] + for modname, mod in list(iteritems(sys.modules)): + if (modname not in self.orig_imported + and modname != self.importing + and not modname.startswith(_PATCH_PREFIX) + and modname.startswith(pkg_prefix)): + sys.modules[_PATCH_PREFIX + modname] = mod + del sys.modules[modname] + + def __exit__(self, t, v, tb): + try: + self._restore() + finally: + imp_release_lock() + + def __enter__(self): + imp_acquire_lock() + self._save() + self._replace() + + +def import_patched(module_name): + """ + Import *module_name* with gevent monkey-patches active, + and return the greened module. + + Any sub-modules that were imported by the package are also + saved. + + """ + patched_name = _PATCH_PREFIX + module_name + if patched_name in sys.modules: + return sys.modules[patched_name] + + + # Save the current module state, and restore on exit, + # capturing desirable changes in the modules package. + with _SysModulesPatcher(module_name): + sys.modules.pop(module_name, None) + + module = _import(module_name, {}, {}, module_name.split('.')[:-1]) + sys.modules[patched_name] = module + + return module diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_queue.cp37-win_amd64.pyd b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_queue.cp37-win_amd64.pyd new file mode 100644 index 0000000000000000000000000000000000000000..3296d5eb1d2ee9fe0d4e708eaa7f1f3a1f7231d0 GIT binary patch literal 200704 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 IUq=c2AMaw=IsgCw literal 0 HcmV?d00001 diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_queue.pxd b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_queue.pxd new file mode 100644 index 00000000..d4d9da7c --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_queue.pxd @@ -0,0 +1,74 @@ +cimport cython +from gevent.__waiter cimport Waiter +from gevent._event cimport Event + +cdef _heappush +cdef _heappop +cdef _heapify + +@cython.final +cdef _safe_remove(deq, item) + +@cython.final +@cython.internal +cdef class ItemWaiter(Waiter): + cdef readonly item + cdef readonly queue + +cdef class Queue: + cdef __weakref__ + cdef readonly hub + cdef readonly queue + + cdef getters + cdef putters + + cdef _event_unlock + cdef Py_ssize_t _maxsize + + cpdef _get(self) + cpdef _put(self, item) + cpdef _peek(self) + + cpdef Py_ssize_t qsize(self) + cpdef bint empty(self) + cpdef bint full(self) + + cpdef put(self, item, block=*, timeout=*) + cpdef put_nowait(self, item) + + cdef __get_or_peek(self, method, block, timeout) + + cpdef get(self, block=*, timeout=*) + cpdef get_nowait(self) + cpdef peek(self, block=*, timeout=*) + cpdef peek_nowait(self) + + cdef _schedule_unlock(self) + +@cython.final +cdef class UnboundQueue(Queue): + pass + +cdef class PriorityQueue(Queue): + pass + +cdef class LifoQueue(Queue): + pass + +cdef class JoinableQueue(Queue): + cdef Event _cond + cdef readonly int unfinished_tasks + + +cdef class Channel: + cdef __weakref__ + cdef readonly getters + cdef readonly putters + cdef readonly hub + cdef _event_unlock + + cpdef get(self, block=*, timeout=*) + cpdef get_nowait(self) + + cdef _schedule_unlock(self) diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_semaphore.c b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_semaphore.c new file mode 100644 index 00000000..7e703aee --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_semaphore.c @@ -0,0 +1,8412 @@ +/* Generated by Cython 0.29.2 */ + +/* BEGIN: Cython Metadata +{ + "distutils": { + "depends": [ + "src/gevent/__semaphore.pxd", + "src\\gevent\\__semaphore.pxd" + ], + "include_dirs": [ + "C:\\Python37-x64\\Include", + "deps" + ], + "name": "gevent.__semaphore", + "sources": [ + "src/gevent/_semaphore.py" + ] + }, + "module_name": "gevent.__semaphore" +} +END: Cython Metadata */ + +#define PY_SSIZE_T_CLEAN +#include "Python.h" +#ifndef Py_PYTHON_H + #error Python headers needed to compile C extensions, please install development version of Python. +#elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) + #error Cython requires Python 2.6+ or Python 3.3+. +#else +#define CYTHON_ABI "0_29_2" +#define CYTHON_HEX_VERSION 0x001D02F0 +#define CYTHON_FUTURE_DIVISION 1 +#include +#ifndef offsetof + #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) +#endif +#if !defined(WIN32) && !defined(MS_WINDOWS) + #ifndef __stdcall + #define __stdcall + #endif + #ifndef __cdecl + #define __cdecl + #endif + #ifndef __fastcall + #define __fastcall + #endif +#endif +#ifndef DL_IMPORT + #define DL_IMPORT(t) t +#endif +#ifndef DL_EXPORT + #define DL_EXPORT(t) t +#endif +#define __PYX_COMMA , +#ifndef HAVE_LONG_LONG + #if PY_VERSION_HEX >= 0x02070000 + #define HAVE_LONG_LONG + #endif +#endif +#ifndef PY_LONG_LONG + #define PY_LONG_LONG LONG_LONG +#endif +#ifndef Py_HUGE_VAL + #define Py_HUGE_VAL HUGE_VAL +#endif +#ifdef PYPY_VERSION + #define CYTHON_COMPILING_IN_PYPY 1 + #define CYTHON_COMPILING_IN_PYSTON 0 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #undef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 0 + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #if PY_VERSION_HEX < 0x03050000 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #elif !defined(CYTHON_USE_ASYNC_SLOTS) + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #undef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 0 + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #undef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 1 + #undef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 0 + #undef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 0 + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #undef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE 0 + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 +#elif defined(PYSTON_VERSION) + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_PYSTON 1 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #ifndef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 1 + #endif + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #ifndef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 1 + #endif + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #ifndef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 0 + #endif + #ifndef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 1 + #endif + #ifndef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 1 + #endif + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #undef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE 0 + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 +#else + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_PYSTON 0 + #define CYTHON_COMPILING_IN_CPYTHON 1 + #ifndef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 1 + #endif + #if PY_VERSION_HEX < 0x02070000 + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #elif !defined(CYTHON_USE_PYTYPE_LOOKUP) + #define CYTHON_USE_PYTYPE_LOOKUP 1 + #endif + #if PY_MAJOR_VERSION < 3 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #elif !defined(CYTHON_USE_ASYNC_SLOTS) + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #if PY_VERSION_HEX < 0x02070000 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #elif !defined(CYTHON_USE_PYLONG_INTERNALS) + #define CYTHON_USE_PYLONG_INTERNALS 1 + #endif + #ifndef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 1 + #endif + #ifndef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 1 + #endif + #if PY_VERSION_HEX < 0x030300F0 + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #elif !defined(CYTHON_USE_UNICODE_WRITER) + #define CYTHON_USE_UNICODE_WRITER 1 + #endif + #ifndef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 0 + #endif + #ifndef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 1 + #endif + #ifndef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 1 + #endif + #ifndef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 1 + #endif + #ifndef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 1 + #endif + #ifndef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000) + #endif + #ifndef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1) + #endif + #ifndef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1) + #endif + #ifndef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3) + #endif +#endif +#if !defined(CYTHON_FAST_PYCCALL) +#define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) +#endif +#if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #undef SHIFT + #undef BASE + #undef MASK + #ifdef SIZEOF_VOID_P + enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) }; + #endif +#endif +#ifndef __has_attribute + #define __has_attribute(x) 0 +#endif +#ifndef __has_cpp_attribute + #define __has_cpp_attribute(x) 0 +#endif +#ifndef CYTHON_RESTRICT + #if defined(__GNUC__) + #define CYTHON_RESTRICT __restrict__ + #elif defined(_MSC_VER) && _MSC_VER >= 1400 + #define CYTHON_RESTRICT __restrict + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_RESTRICT restrict + #else + #define CYTHON_RESTRICT + #endif +#endif +#ifndef CYTHON_UNUSED +# if defined(__GNUC__) +# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +#endif +#ifndef CYTHON_MAYBE_UNUSED_VAR +# if defined(__cplusplus) + template void CYTHON_MAYBE_UNUSED_VAR( const T& ) { } +# else +# define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x) +# endif +#endif +#ifndef CYTHON_NCP_UNUSED +# if CYTHON_COMPILING_IN_CPYTHON +# define CYTHON_NCP_UNUSED +# else +# define CYTHON_NCP_UNUSED CYTHON_UNUSED +# endif +#endif +#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) +#ifdef _MSC_VER + #ifndef _MSC_STDINT_H_ + #if _MSC_VER < 1300 + typedef unsigned char uint8_t; + typedef unsigned int uint32_t; + #else + typedef unsigned __int8 uint8_t; + typedef unsigned __int32 uint32_t; + #endif + #endif +#else + #include +#endif +#ifndef CYTHON_FALLTHROUGH + #if defined(__cplusplus) && __cplusplus >= 201103L + #if __has_cpp_attribute(fallthrough) + #define CYTHON_FALLTHROUGH [[fallthrough]] + #elif __has_cpp_attribute(clang::fallthrough) + #define CYTHON_FALLTHROUGH [[clang::fallthrough]] + #elif __has_cpp_attribute(gnu::fallthrough) + #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] + #endif + #endif + #ifndef CYTHON_FALLTHROUGH + #if __has_attribute(fallthrough) + #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) + #else + #define CYTHON_FALLTHROUGH + #endif + #endif + #if defined(__clang__ ) && defined(__apple_build_version__) + #if __apple_build_version__ < 7000000 + #undef CYTHON_FALLTHROUGH + #define CYTHON_FALLTHROUGH + #endif + #endif +#endif + +#ifndef CYTHON_INLINE + #if defined(__clang__) + #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) + #elif defined(__GNUC__) + #define CYTHON_INLINE __inline__ + #elif defined(_MSC_VER) + #define CYTHON_INLINE __inline + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_INLINE inline + #else + #define CYTHON_INLINE + #endif +#endif + +#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) + #define Py_OptimizeFlag 0 +#endif +#define __PYX_BUILD_PY_SSIZE_T "n" +#define CYTHON_FORMAT_SSIZE_T "z" +#if PY_MAJOR_VERSION < 3 + #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyClass_Type +#else + #define __Pyx_BUILTIN_MODULE_NAME "builtins" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyType_Type +#endif +#ifndef Py_TPFLAGS_CHECKTYPES + #define Py_TPFLAGS_CHECKTYPES 0 +#endif +#ifndef Py_TPFLAGS_HAVE_INDEX + #define Py_TPFLAGS_HAVE_INDEX 0 +#endif +#ifndef Py_TPFLAGS_HAVE_NEWBUFFER + #define Py_TPFLAGS_HAVE_NEWBUFFER 0 +#endif +#ifndef Py_TPFLAGS_HAVE_FINALIZE + #define Py_TPFLAGS_HAVE_FINALIZE 0 +#endif +#ifndef METH_STACKLESS + #define METH_STACKLESS 0 +#endif +#if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) + #ifndef METH_FASTCALL + #define METH_FASTCALL 0x80 + #endif + typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs); + typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args, + Py_ssize_t nargs, PyObject *kwnames); +#else + #define __Pyx_PyCFunctionFast _PyCFunctionFast + #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords +#endif +#if CYTHON_FAST_PYCCALL +#define __Pyx_PyFastCFunction_Check(func)\ + ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS))))) +#else +#define __Pyx_PyFastCFunction_Check(func) 0 +#endif +#if CYTHON_USE_DICT_VERSIONS +#define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) +#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ + (version_var) = __PYX_GET_DICT_VERSION(dict);\ + (cache_var) = (value); +#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ + static PY_UINT64_T __pyx_dict_version = 0;\ + static PyObject *__pyx_dict_cached_value = NULL;\ + if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ + (VAR) = __pyx_dict_cached_value;\ + } else {\ + (VAR) = __pyx_dict_cached_value = (LOOKUP);\ + __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ + }\ + } +#else +#define __PYX_GET_DICT_VERSION(dict) (0) +#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) +#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) + #define PyObject_Malloc(s) PyMem_Malloc(s) + #define PyObject_Free(p) PyMem_Free(p) + #define PyObject_Realloc(p) PyMem_Realloc(p) +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1 + #define PyMem_RawMalloc(n) PyMem_Malloc(n) + #define PyMem_RawRealloc(p, n) PyMem_Realloc(p, n) + #define PyMem_RawFree(p) PyMem_Free(p) +#endif +#if CYTHON_COMPILING_IN_PYSTON + #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co) + #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno) +#else + #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) + #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) +#endif +#if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000 + #define __Pyx_PyThreadState_Current PyThreadState_GET() +#elif PY_VERSION_HEX >= 0x03060000 + #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() +#elif PY_VERSION_HEX >= 0x03000000 + #define __Pyx_PyThreadState_Current PyThreadState_GET() +#else + #define __Pyx_PyThreadState_Current _PyThreadState_Current +#endif +#if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) +#include "pythread.h" +#define Py_tss_NEEDS_INIT 0 +typedef int Py_tss_t; +static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) { + *key = PyThread_create_key(); + return 0; // PyThread_create_key reports success always +} +static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) { + Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t)); + *key = Py_tss_NEEDS_INIT; + return key; +} +static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) { + PyObject_Free(key); +} +static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) { + return *key != Py_tss_NEEDS_INIT; +} +static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) { + PyThread_delete_key(*key); + *key = Py_tss_NEEDS_INIT; +} +static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) { + return PyThread_set_key_value(*key, value); +} +static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { + return PyThread_get_key_value(*key); +} +#endif // TSS (Thread Specific Storage) API +#if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized) +#define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) +#else +#define __Pyx_PyDict_NewPresized(n) PyDict_New() +#endif +#if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION + #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) +#else + #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS +#define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) +#else +#define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name) +#endif +#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) + #define CYTHON_PEP393_ENABLED 1 + #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ + 0 : _PyUnicode_Ready((PyObject *)(op))) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) + #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) + #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) + #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) + #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) + #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch) + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) +#else + #define CYTHON_PEP393_ENABLED 0 + #define PyUnicode_1BYTE_KIND 1 + #define PyUnicode_2BYTE_KIND 2 + #define PyUnicode_4BYTE_KIND 4 + #define __Pyx_PyUnicode_READY(op) (0) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) + #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111) + #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) + #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) + #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) + #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch) + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) +#endif +#if CYTHON_COMPILING_IN_PYPY + #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) +#else + #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ + PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains) + #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check) + #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format) + #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) +#endif +#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) +#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) +#else + #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) +#endif +#if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) + #define PyObject_ASCII(o) PyObject_Repr(o) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBaseString_Type PyUnicode_Type + #define PyStringObject PyUnicodeObject + #define PyString_Type PyUnicode_Type + #define PyString_Check PyUnicode_Check + #define PyString_CheckExact PyUnicode_CheckExact + #define PyObject_Unicode PyObject_Str +#endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) + #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) +#else + #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) + #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) +#endif +#ifndef PySet_CheckExact + #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) +#endif +#if CYTHON_ASSUME_SAFE_MACROS + #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) +#else + #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyIntObject PyLongObject + #define PyInt_Type PyLong_Type + #define PyInt_Check(op) PyLong_Check(op) + #define PyInt_CheckExact(op) PyLong_CheckExact(op) + #define PyInt_FromString PyLong_FromString + #define PyInt_FromUnicode PyLong_FromUnicode + #define PyInt_FromLong PyLong_FromLong + #define PyInt_FromSize_t PyLong_FromSize_t + #define PyInt_FromSsize_t PyLong_FromSsize_t + #define PyInt_AsLong PyLong_AsLong + #define PyInt_AS_LONG PyLong_AS_LONG + #define PyInt_AsSsize_t PyLong_AsSsize_t + #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask + #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask + #define PyNumber_Int PyNumber_Long +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBoolObject PyLongObject +#endif +#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY + #ifndef PyUnicode_InternFromString + #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) + #endif +#endif +#if PY_VERSION_HEX < 0x030200A4 + typedef long Py_hash_t; + #define __Pyx_PyInt_FromHash_t PyInt_FromLong + #define __Pyx_PyInt_AsHash_t PyInt_AsLong +#else + #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t + #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t +#endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : (Py_INCREF(func), func)) +#else + #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) +#endif +#if CYTHON_USE_ASYNC_SLOTS + #if PY_VERSION_HEX >= 0x030500B1 + #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods + #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) + #else + #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) + #endif +#else + #define __Pyx_PyType_AsAsync(obj) NULL +#endif +#ifndef __Pyx_PyAsyncMethodsStruct + typedef struct { + unaryfunc am_await; + unaryfunc am_aiter; + unaryfunc am_anext; + } __Pyx_PyAsyncMethodsStruct; +#endif + +#if defined(WIN32) || defined(MS_WINDOWS) + #define _USE_MATH_DEFINES +#endif +#include +#ifdef NAN +#define __PYX_NAN() ((float) NAN) +#else +static CYTHON_INLINE float __PYX_NAN() { + float value; + memset(&value, 0xFF, sizeof(value)); + return value; +} +#endif +#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) +#define __Pyx_truncl trunc +#else +#define __Pyx_truncl truncl +#endif + + +#define __PYX_ERR(f_index, lineno, Ln_error) \ +{ \ + __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \ +} + +#ifndef __PYX_EXTERN_C + #ifdef __cplusplus + #define __PYX_EXTERN_C extern "C" + #else + #define __PYX_EXTERN_C extern + #endif +#endif + +#define __PYX_HAVE__gevent____semaphore +#define __PYX_HAVE_API__gevent____semaphore +/* Early includes */ +#include "greenlet/greenlet.h" +#ifdef _OPENMP +#include +#endif /* _OPENMP */ + +#if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) +#define CYTHON_WITHOUT_ASSERTIONS +#endif + +typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; + const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; + +#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 +#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0 +#define __PYX_DEFAULT_STRING_ENCODING "" +#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString +#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#define __Pyx_uchar_cast(c) ((unsigned char)c) +#define __Pyx_long_cast(x) ((long)x) +#define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ + (sizeof(type) < sizeof(Py_ssize_t)) ||\ + (sizeof(type) > sizeof(Py_ssize_t) &&\ + likely(v < (type)PY_SSIZE_T_MAX ||\ + v == (type)PY_SSIZE_T_MAX) &&\ + (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ + v == (type)PY_SSIZE_T_MIN))) ||\ + (sizeof(type) == sizeof(Py_ssize_t) &&\ + (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ + v == (type)PY_SSIZE_T_MAX))) ) +static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) { + return (size_t) i < (size_t) limit; +} +#if defined (__cplusplus) && __cplusplus >= 201103L + #include + #define __Pyx_sst_abs(value) std::abs(value) +#elif SIZEOF_INT >= SIZEOF_SIZE_T + #define __Pyx_sst_abs(value) abs(value) +#elif SIZEOF_LONG >= SIZEOF_SIZE_T + #define __Pyx_sst_abs(value) labs(value) +#elif defined (_MSC_VER) + #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) +#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define __Pyx_sst_abs(value) llabs(value) +#elif defined (__GNUC__) + #define __Pyx_sst_abs(value) __builtin_llabs(value) +#else + #define __Pyx_sst_abs(value) ((value<0) ? -value : value) +#endif +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*); +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); +#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) +#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) +#define __Pyx_PyBytes_FromString PyBytes_FromString +#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); +#if PY_MAJOR_VERSION < 3 + #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#else + #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize +#endif +#define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) +#define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) +#define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) +#define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) +#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) +static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) { + const Py_UNICODE *u_end = u; + while (*u_end++) ; + return (size_t)(u_end - u - 1); +} +#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) +#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode +#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode +#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) +#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) +static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); +static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*); +static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); +#define __Pyx_PySequence_Tuple(obj)\ + (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); +#if CYTHON_ASSUME_SAFE_MACROS +#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) +#else +#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) +#endif +#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) +#if PY_MAJOR_VERSION >= 3 +#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) +#else +#define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) +#endif +#define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x)) +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII +static int __Pyx_sys_getdefaultencoding_not_ascii; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + PyObject* ascii_chars_u = NULL; + PyObject* ascii_chars_b = NULL; + const char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + if (strcmp(default_encoding_c, "ascii") == 0) { + __Pyx_sys_getdefaultencoding_not_ascii = 0; + } else { + char ascii_chars[128]; + int c; + for (c = 0; c < 128; c++) { + ascii_chars[c] = c; + } + __Pyx_sys_getdefaultencoding_not_ascii = 1; + ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); + if (!ascii_chars_u) goto bad; + ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); + if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { + PyErr_Format( + PyExc_ValueError, + "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", + default_encoding_c); + goto bad; + } + Py_DECREF(ascii_chars_u); + Py_DECREF(ascii_chars_b); + } + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + Py_XDECREF(ascii_chars_u); + Py_XDECREF(ascii_chars_b); + return -1; +} +#endif +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) +#else +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +static char* __PYX_DEFAULT_STRING_ENCODING; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1); + if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; + strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + return -1; +} +#endif +#endif + + +/* Test for GCC > 2.95 */ +#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) + #define likely(x) __builtin_expect(!!(x), 1) + #define unlikely(x) __builtin_expect(!!(x), 0) +#else /* !__GNUC__ or GCC < 2.95 */ + #define likely(x) (x) + #define unlikely(x) (x) +#endif /* __GNUC__ */ +static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } + +static PyObject *__pyx_m = NULL; +static PyObject *__pyx_d; +static PyObject *__pyx_b; +static PyObject *__pyx_cython_runtime = NULL; +static PyObject *__pyx_empty_tuple; +static PyObject *__pyx_empty_bytes; +static PyObject *__pyx_empty_unicode; +static int __pyx_lineno; +static int __pyx_clineno = 0; +static const char * __pyx_cfilenm= __FILE__; +static const char *__pyx_filename; + + +static const char *__pyx_f[] = { + "src\\gevent\\_semaphore.py", + "src\\gevent\\__semaphore.pxd", + "src\\gevent\\__greenlet_primitives.pxd", + "src\\gevent\\__abstract_linkable.pxd", +}; + +/*--- Type declarations ---*/ +struct __pyx_obj_6gevent_21__greenlet_primitives_TrackedRawGreenlet; +struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop; +struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable; +struct __pyx_obj_6gevent_11__semaphore_Semaphore; +struct __pyx_obj_6gevent_11__semaphore_BoundedSemaphore; +struct __pyx_opt_args_6gevent_19__abstract_linkable_16AbstractLinkable__wait_core; +struct __pyx_opt_args_6gevent_19__abstract_linkable_16AbstractLinkable__wait; + +/* "gevent/__abstract_linkable.pxd":51 + * cdef _check_and_notify(self) + * cpdef _notify_links(self) + * cdef _wait_core(self, timeout, catch=*) # <<<<<<<<<<<<<< + * cdef _wait_return_value(self, waited, wait_success) + * cdef _wait(self, timeout=*) + */ +struct __pyx_opt_args_6gevent_19__abstract_linkable_16AbstractLinkable__wait_core { + int __pyx_n; + PyObject *catch; +}; + +/* "gevent/__abstract_linkable.pxd":53 + * cdef _wait_core(self, timeout, catch=*) + * cdef _wait_return_value(self, waited, wait_success) + * cdef _wait(self, timeout=*) # <<<<<<<<<<<<<< + */ +struct __pyx_opt_args_6gevent_19__abstract_linkable_16AbstractLinkable__wait { + int __pyx_n; + PyObject *timeout; +}; +struct __pyx_opt_args_6gevent_11__semaphore_9Semaphore_wait; +struct __pyx_opt_args_6gevent_11__semaphore_9Semaphore_acquire; + +/* "gevent/__semaphore.pxd":15 + * # threadpool uses it + * cpdef _start_notify(self) + * cpdef int wait(self, object timeout=*) except -1000 # <<<<<<<<<<<<<< + * cpdef bint acquire(self, int blocking=*, object timeout=*) except -1000 + * cpdef __enter__(self) + */ +struct __pyx_opt_args_6gevent_11__semaphore_9Semaphore_wait { + int __pyx_n; + PyObject *timeout; +}; + +/* "gevent/__semaphore.pxd":16 + * cpdef _start_notify(self) + * cpdef int wait(self, object timeout=*) except -1000 + * cpdef bint acquire(self, int blocking=*, object timeout=*) except -1000 # <<<<<<<<<<<<<< + * cpdef __enter__(self) + * cpdef __exit__(self, object t, object v, object tb) + */ +struct __pyx_opt_args_6gevent_11__semaphore_9Semaphore_acquire { + int __pyx_n; + int blocking; + PyObject *timeout; +}; + +/* "gevent/__greenlet_primitives.pxd":37 + * return PyGreenlet_Switch(self, NULL, NULL) + * + * cdef class TrackedRawGreenlet(greenlet): # <<<<<<<<<<<<<< + * pass + * + */ +struct __pyx_obj_6gevent_21__greenlet_primitives_TrackedRawGreenlet { + PyGreenlet __pyx_base; +}; + + +/* "gevent/__greenlet_primitives.pxd":40 + * pass + * + * cdef class SwitchOutGreenletWithLoop(TrackedRawGreenlet): # <<<<<<<<<<<<<< + * cdef public loop + * + */ +struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop { + struct __pyx_obj_6gevent_21__greenlet_primitives_TrackedRawGreenlet __pyx_base; + struct __pyx_vtabstruct_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *__pyx_vtab; + PyObject *loop; +}; + + +/* "gevent/__abstract_linkable.pxd":32 + * cdef void _init() + * + * cdef class AbstractLinkable(object): # <<<<<<<<<<<<<< + * # We declare the __weakref__ here in the base (even though + * # that's not really what we want) as a workaround for a Cython + */ +struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable { + PyObject_HEAD + struct __pyx_vtabstruct_6gevent_19__abstract_linkable_AbstractLinkable *__pyx_vtab; + PyObject *__weakref__; + struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *hub; + PyObject *_notifier; + PyObject *_links; + int _notify_all; +}; + + +/* "gevent/__semaphore.pxd":7 + * + * + * cdef class Semaphore(AbstractLinkable): # <<<<<<<<<<<<<< + * cdef public int counter + * + */ +struct __pyx_obj_6gevent_11__semaphore_Semaphore { + struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable __pyx_base; + int counter; +}; + + +/* "gevent/__semaphore.pxd":20 + * cpdef __exit__(self, object t, object v, object tb) + * + * cdef class BoundedSemaphore(Semaphore): # <<<<<<<<<<<<<< + * cdef readonly int _initial_value + * + */ +struct __pyx_obj_6gevent_11__semaphore_BoundedSemaphore { + struct __pyx_obj_6gevent_11__semaphore_Semaphore __pyx_base; + int _initial_value; +}; + + + +/* "gevent/__greenlet_primitives.pxd":40 + * pass + * + * cdef class SwitchOutGreenletWithLoop(TrackedRawGreenlet): # <<<<<<<<<<<<<< + * cdef public loop + * + */ + +struct __pyx_vtabstruct_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop { + PyObject *(*__pyx_switch)(struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *, int __pyx_skip_dispatch); + PyObject *(*switch_out)(struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *, int __pyx_skip_dispatch); +}; +static struct __pyx_vtabstruct_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *__pyx_vtabptr_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop; + + +/* "gevent/__abstract_linkable.pxd":32 + * cdef void _init() + * + * cdef class AbstractLinkable(object): # <<<<<<<<<<<<<< + * # We declare the __weakref__ here in the base (even though + * # that's not really what we want) as a workaround for a Cython + */ + +struct __pyx_vtabstruct_6gevent_19__abstract_linkable_AbstractLinkable { + PyObject *(*rawlink)(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *, PyObject *, int __pyx_skip_dispatch); + int (*ready)(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *, int __pyx_skip_dispatch); + PyObject *(*unlink)(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *, PyObject *, int __pyx_skip_dispatch); + PyObject *(*_check_and_notify)(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *); + PyObject *(*_notify_links)(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *, int __pyx_skip_dispatch); + PyObject *(*_wait_core)(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *, PyObject *, struct __pyx_opt_args_6gevent_19__abstract_linkable_16AbstractLinkable__wait_core *__pyx_optional_args); + PyObject *(*_wait_return_value)(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *, PyObject *, PyObject *); + PyObject *(*_wait)(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *, struct __pyx_opt_args_6gevent_19__abstract_linkable_16AbstractLinkable__wait *__pyx_optional_args); +}; +static struct __pyx_vtabstruct_6gevent_19__abstract_linkable_AbstractLinkable *__pyx_vtabptr_6gevent_19__abstract_linkable_AbstractLinkable; + + +/* "src/gevent/_semaphore.py":16 + * + * + * class Semaphore(AbstractLinkable): # pylint:disable=undefined-variable # <<<<<<<<<<<<<< + * """ + * Semaphore(value=1) -> Semaphore + */ + +struct __pyx_vtabstruct_6gevent_11__semaphore_Semaphore { + struct __pyx_vtabstruct_6gevent_19__abstract_linkable_AbstractLinkable __pyx_base; + int (*locked)(struct __pyx_obj_6gevent_11__semaphore_Semaphore *, int __pyx_skip_dispatch); + int (*release)(struct __pyx_obj_6gevent_11__semaphore_Semaphore *, int __pyx_skip_dispatch); + PyObject *(*_start_notify)(struct __pyx_obj_6gevent_11__semaphore_Semaphore *, int __pyx_skip_dispatch); + int (*wait)(struct __pyx_obj_6gevent_11__semaphore_Semaphore *, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_11__semaphore_9Semaphore_wait *__pyx_optional_args); + int (*acquire)(struct __pyx_obj_6gevent_11__semaphore_Semaphore *, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_11__semaphore_9Semaphore_acquire *__pyx_optional_args); + PyObject *(*__pyx___enter__)(struct __pyx_obj_6gevent_11__semaphore_Semaphore *, int __pyx_skip_dispatch); + PyObject *(*__pyx___exit__)(struct __pyx_obj_6gevent_11__semaphore_Semaphore *, PyObject *, PyObject *, PyObject *, int __pyx_skip_dispatch); +}; +static struct __pyx_vtabstruct_6gevent_11__semaphore_Semaphore *__pyx_vtabptr_6gevent_11__semaphore_Semaphore; + + +/* "src/gevent/_semaphore.py":148 + * + * + * class BoundedSemaphore(Semaphore): # <<<<<<<<<<<<<< + * """ + * BoundedSemaphore(value=1) -> BoundedSemaphore + */ + +struct __pyx_vtabstruct_6gevent_11__semaphore_BoundedSemaphore { + struct __pyx_vtabstruct_6gevent_11__semaphore_Semaphore __pyx_base; +}; +static struct __pyx_vtabstruct_6gevent_11__semaphore_BoundedSemaphore *__pyx_vtabptr_6gevent_11__semaphore_BoundedSemaphore; + +/* --- Runtime support code (head) --- */ +/* Refnanny.proto */ +#ifndef CYTHON_REFNANNY + #define CYTHON_REFNANNY 0 +#endif +#if CYTHON_REFNANNY + typedef struct { + void (*INCREF)(void*, PyObject*, int); + void (*DECREF)(void*, PyObject*, int); + void (*GOTREF)(void*, PyObject*, int); + void (*GIVEREF)(void*, PyObject*, int); + void* (*SetupContext)(const char*, int, const char*); + void (*FinishContext)(void**); + } __Pyx_RefNannyAPIStruct; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); + #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; +#ifdef WITH_THREAD + #define __Pyx_RefNannySetupContext(name, acquire_gil)\ + if (acquire_gil) {\ + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ + PyGILState_Release(__pyx_gilstate_save);\ + } else {\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ + } +#else + #define __Pyx_RefNannySetupContext(name, acquire_gil)\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) +#endif + #define __Pyx_RefNannyFinishContext()\ + __Pyx_RefNanny->FinishContext(&__pyx_refnanny) + #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0) + #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) + #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) + #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) +#else + #define __Pyx_RefNannyDeclarations + #define __Pyx_RefNannySetupContext(name, acquire_gil) + #define __Pyx_RefNannyFinishContext() + #define __Pyx_INCREF(r) Py_INCREF(r) + #define __Pyx_DECREF(r) Py_DECREF(r) + #define __Pyx_GOTREF(r) + #define __Pyx_GIVEREF(r) + #define __Pyx_XINCREF(r) Py_XINCREF(r) + #define __Pyx_XDECREF(r) Py_XDECREF(r) + #define __Pyx_XGOTREF(r) + #define __Pyx_XGIVEREF(r) +#endif +#define __Pyx_XDECREF_SET(r, v) do {\ + PyObject *tmp = (PyObject *) r;\ + r = v; __Pyx_XDECREF(tmp);\ + } while (0) +#define __Pyx_DECREF_SET(r, v) do {\ + PyObject *tmp = (PyObject *) r;\ + r = v; __Pyx_DECREF(tmp);\ + } while (0) +#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) +#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) + +/* PyObjectGetAttrStr.proto */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); +#else +#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) +#endif + +/* GetBuiltinName.proto */ +static PyObject *__Pyx_GetBuiltinName(PyObject *name); + +/* PyObjectCall.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); +#else +#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) +#endif + +/* RaiseDoubleKeywords.proto */ +static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); + +/* ParseKeywords.proto */ +static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\ + PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\ + const char* function_name); + +/* RaiseArgTupleInvalid.proto */ +static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, + Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); + +/* PyThreadStateGet.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; +#define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; +#define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type +#else +#define __Pyx_PyThreadState_declare +#define __Pyx_PyThreadState_assign +#define __Pyx_PyErr_Occurred() PyErr_Occurred() +#endif + +/* PyErrFetchRestore.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) +#define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) +#define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) +#define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) +#define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); +static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) +#else +#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) +#endif +#else +#define __Pyx_PyErr_Clear() PyErr_Clear() +#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) +#define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) +#define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb) +#define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) +#endif + +/* RaiseException.proto */ +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); + +/* PyFunctionFastCall.proto */ +#if CYTHON_FAST_PYCALL +#define __Pyx_PyFunction_FastCall(func, args, nargs)\ + __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) +#if 1 || PY_VERSION_HEX < 0x030600B1 +static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs); +#else +#define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs) +#endif +#define __Pyx_BUILD_ASSERT_EXPR(cond)\ + (sizeof(char [1 - 2*!(cond)]) - 1) +#ifndef Py_MEMBER_SIZE +#define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member) +#endif + static size_t __pyx_pyframe_localsplus_offset = 0; + #include "frameobject.h" + #define __Pxy_PyFrame_Initialize_Offsets()\ + ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\ + (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus))) + #define __Pyx_PyFrame_GetLocalsplus(frame)\ + (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset)) +#endif + +/* PyObjectCallMethO.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); +#endif + +/* PyObjectCallNoArg.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); +#else +#define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL) +#endif + +/* PyCFunctionFastCall.proto */ +#if CYTHON_FAST_PYCCALL +static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs); +#else +#define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL) +#endif + +/* PyObjectCallOneArg.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); + +/* WriteUnraisableException.proto */ +static void __Pyx_WriteUnraisable(const char *name, int clineno, + int lineno, const char *filename, + int full_traceback, int nogil); + +/* PyObjectCall2Args.proto */ +static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2); + +/* KeywordStringCheck.proto */ +static int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* function_name, int kw_allowed); + +/* CallNextTpDealloc.proto */ +static void __Pyx_call_next_tp_dealloc(PyObject* obj, destructor current_tp_dealloc); + +/* CallNextTpTraverse.proto */ +static int __Pyx_call_next_tp_traverse(PyObject* obj, visitproc v, void *a, traverseproc current_tp_traverse); + +/* CallNextTpClear.proto */ +static void __Pyx_call_next_tp_clear(PyObject* obj, inquiry current_tp_dealloc); + +/* TypeImport.proto */ +#ifndef __PYX_HAVE_RT_ImportType_proto +#define __PYX_HAVE_RT_ImportType_proto +enum __Pyx_ImportType_CheckSize { + __Pyx_ImportType_CheckSize_Error = 0, + __Pyx_ImportType_CheckSize_Warn = 1, + __Pyx_ImportType_CheckSize_Ignore = 2 +}; +static PyTypeObject *__Pyx_ImportType(PyObject* module, const char *module_name, const char *class_name, size_t size, enum __Pyx_ImportType_CheckSize check_size); +#endif + +/* GetVTable.proto */ +static void* __Pyx_GetVtable(PyObject *dict); + +/* PyObject_GenericGetAttrNoDict.proto */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name); +#else +#define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr +#endif + +/* PyObject_GenericGetAttr.proto */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name); +#else +#define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr +#endif + +/* SetVTable.proto */ +static int __Pyx_SetVtable(PyObject *dict, void *vtable); + +/* FetchCommonType.proto */ +static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); + +/* CythonFunction.proto */ +#define __Pyx_CyFunction_USED 1 +#define __Pyx_CYFUNCTION_STATICMETHOD 0x01 +#define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 +#define __Pyx_CYFUNCTION_CCLASS 0x04 +#define __Pyx_CyFunction_GetClosure(f)\ + (((__pyx_CyFunctionObject *) (f))->func_closure) +#define __Pyx_CyFunction_GetClassObj(f)\ + (((__pyx_CyFunctionObject *) (f))->func_classobj) +#define __Pyx_CyFunction_Defaults(type, f)\ + ((type *)(((__pyx_CyFunctionObject *) (f))->defaults)) +#define __Pyx_CyFunction_SetDefaultsGetter(f, g)\ + ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g) +typedef struct { + PyCFunctionObject func; +#if PY_VERSION_HEX < 0x030500A0 + PyObject *func_weakreflist; +#endif + PyObject *func_dict; + PyObject *func_name; + PyObject *func_qualname; + PyObject *func_doc; + PyObject *func_globals; + PyObject *func_code; + PyObject *func_closure; + PyObject *func_classobj; + void *defaults; + int defaults_pyobjects; + int flags; + PyObject *defaults_tuple; + PyObject *defaults_kwdict; + PyObject *(*defaults_getter)(PyObject *); + PyObject *func_annotations; +} __pyx_CyFunctionObject; +static PyTypeObject *__pyx_CyFunctionType = 0; +#define __Pyx_CyFunction_Check(obj) (__Pyx_TypeCheck(obj, __pyx_CyFunctionType)) +#define __Pyx_CyFunction_NewEx(ml, flags, qualname, self, module, globals, code)\ + __Pyx_CyFunction_New(__pyx_CyFunctionType, ml, flags, qualname, self, module, globals, code) +static PyObject *__Pyx_CyFunction_New(PyTypeObject *, PyMethodDef *ml, + int flags, PyObject* qualname, + PyObject *self, + PyObject *module, PyObject *globals, + PyObject* code); +static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, + size_t size, + int pyobjects); +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, + PyObject *tuple); +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, + PyObject *dict); +static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m, + PyObject *dict); +static int __pyx_CyFunction_init(void); + +/* GetModuleGlobalName.proto */ +#if CYTHON_USE_DICT_VERSIONS +#define __Pyx_GetModuleGlobalName(var, name) {\ + static PY_UINT64_T __pyx_dict_version = 0;\ + static PyObject *__pyx_dict_cached_value = NULL;\ + (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\ + (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\ + __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ +} +#define __Pyx_GetModuleGlobalNameUncached(var, name) {\ + PY_UINT64_T __pyx_dict_version;\ + PyObject *__pyx_dict_cached_value;\ + (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ +} +static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value); +#else +#define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name) +#define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name) +static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name); +#endif + +/* PyObjectSetAttrStr.proto */ +#if CYTHON_USE_TYPE_SLOTS +#define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o, n, NULL) +static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value); +#else +#define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n) +#define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v) +#endif + +/* PyErrExceptionMatches.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) +static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); +#else +#define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) +#endif + +/* GetNameInClass.proto */ +#define __Pyx_GetNameInClass(var, nmspace, name) (var) = __Pyx__GetNameInClass(nmspace, name) +static PyObject *__Pyx__GetNameInClass(PyObject *nmspace, PyObject *name); + +/* Import.proto */ +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); + +/* ImportFrom.proto */ +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); + +/* GetAttr.proto */ +static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *); + +/* Globals.proto */ +static PyObject* __Pyx_Globals(void); + +/* CLineInTraceback.proto */ +#ifdef CYTHON_CLINE_IN_TRACEBACK +#define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) +#else +static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line); +#endif + +/* CodeObjectCache.proto */ +typedef struct { + PyCodeObject* code_object; + int code_line; +} __Pyx_CodeObjectCacheEntry; +struct __Pyx_CodeObjectCache { + int count; + int max_count; + __Pyx_CodeObjectCacheEntry* entries; +}; +static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); +static PyCodeObject *__pyx_find_code_object(int code_line); +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); + +/* AddTraceback.proto */ +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename); + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); + +/* CIntFromPy.proto */ +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); + +/* CIntFromPy.proto */ +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); + +/* FastTypeChecks.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) +static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b); +static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type); +static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2); +#else +#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) +#define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) +#define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) +#endif +#define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) + +/* CheckBinaryVersion.proto */ +static int __Pyx_check_binary_version(void); + +/* VoidPtrExport.proto */ +static int __Pyx_ExportVoidPtr(PyObject *name, void *p, const char *sig); + +/* VoidPtrImport.proto */ +static int __Pyx_ImportVoidPtr(PyObject *module, const char *name, void **p, const char *sig); + +/* FunctionImport.proto */ +static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig); + +/* InitStrings.proto */ +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); + +static int __pyx_f_6gevent_11__semaphore_9Semaphore_locked(struct __pyx_obj_6gevent_11__semaphore_Semaphore *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/ +static int __pyx_f_6gevent_11__semaphore_9Semaphore_release(struct __pyx_obj_6gevent_11__semaphore_Semaphore *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/ +static int __pyx_f_6gevent_11__semaphore_9Semaphore_ready(struct __pyx_obj_6gevent_11__semaphore_Semaphore *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/ +static PyObject *__pyx_f_6gevent_11__semaphore_9Semaphore__start_notify(struct __pyx_obj_6gevent_11__semaphore_Semaphore *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/ +static PyObject *__pyx_f_6gevent_11__semaphore_9Semaphore__wait_return_value(CYTHON_UNUSED struct __pyx_obj_6gevent_11__semaphore_Semaphore *__pyx_v_self, PyObject *__pyx_v_waited, PyObject *__pyx_v_wait_success); /* proto*/ +static int __pyx_f_6gevent_11__semaphore_9Semaphore_wait(struct __pyx_obj_6gevent_11__semaphore_Semaphore *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_11__semaphore_9Semaphore_wait *__pyx_optional_args); /* proto*/ +static int __pyx_f_6gevent_11__semaphore_9Semaphore_acquire(struct __pyx_obj_6gevent_11__semaphore_Semaphore *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_11__semaphore_9Semaphore_acquire *__pyx_optional_args); /* proto*/ +static PyObject *__pyx_f_6gevent_11__semaphore_9Semaphore___enter__(struct __pyx_obj_6gevent_11__semaphore_Semaphore *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/ +static PyObject *__pyx_f_6gevent_11__semaphore_9Semaphore___exit__(struct __pyx_obj_6gevent_11__semaphore_Semaphore *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_t, CYTHON_UNUSED PyObject *__pyx_v_v, CYTHON_UNUSED PyObject *__pyx_v_tb, int __pyx_skip_dispatch); /* proto*/ +static int __pyx_f_6gevent_11__semaphore_16BoundedSemaphore_release(struct __pyx_obj_6gevent_11__semaphore_BoundedSemaphore *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/ + +/* Module declarations from 'cython' */ + +/* Module declarations from 'greenlet' */ + +/* Module declarations from 'gevent.__greenlet_primitives' */ +static PyTypeObject *__pyx_ptype_6gevent_21__greenlet_primitives_greenlet = 0; +static PyTypeObject *__pyx_ptype_6gevent_21__greenlet_primitives_TrackedRawGreenlet = 0; +static PyTypeObject *__pyx_ptype_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop = 0; +static PyObject **__pyx_vp_6gevent_21__greenlet_primitives_get_objects = 0; +#define __pyx_v_6gevent_21__greenlet_primitives_get_objects (*__pyx_vp_6gevent_21__greenlet_primitives_get_objects) +static PyObject **__pyx_vp_6gevent_21__greenlet_primitives_wref = 0; +#define __pyx_v_6gevent_21__greenlet_primitives_wref (*__pyx_vp_6gevent_21__greenlet_primitives_wref) +static PyObject **__pyx_vp_6gevent_21__greenlet_primitives_BlockingSwitchOutError = 0; +#define __pyx_v_6gevent_21__greenlet_primitives_BlockingSwitchOutError (*__pyx_vp_6gevent_21__greenlet_primitives_BlockingSwitchOutError) +static int *__pyx_vp_6gevent_21__greenlet_primitives__greenlet_imported = 0; +#define __pyx_v_6gevent_21__greenlet_primitives__greenlet_imported (*__pyx_vp_6gevent_21__greenlet_primitives__greenlet_imported) + +/* Module declarations from 'gevent.__hub_local' */ +static PyObject **__pyx_vp_6gevent_11__hub_local__threadlocal = 0; +#define __pyx_v_6gevent_11__hub_local__threadlocal (*__pyx_vp_6gevent_11__hub_local__threadlocal) +static struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *(*__pyx_f_6gevent_11__hub_local_get_hub_noargs)(int __pyx_skip_dispatch); /*proto*/ + +/* Module declarations from 'gevent.__abstract_linkable' */ +static PyTypeObject *__pyx_ptype_6gevent_19__abstract_linkable_greenlet = 0; +static PyTypeObject *__pyx_ptype_6gevent_19__abstract_linkable_AbstractLinkable = 0; +static PyObject **__pyx_vp_6gevent_19__abstract_linkable_InvalidSwitchError = 0; +#define __pyx_v_6gevent_19__abstract_linkable_InvalidSwitchError (*__pyx_vp_6gevent_19__abstract_linkable_InvalidSwitchError) +static PyObject **__pyx_vp_6gevent_19__abstract_linkable_Timeout = 0; +#define __pyx_v_6gevent_19__abstract_linkable_Timeout (*__pyx_vp_6gevent_19__abstract_linkable_Timeout) +static int *__pyx_vp_6gevent_19__abstract_linkable__greenlet_imported = 0; +#define __pyx_v_6gevent_19__abstract_linkable__greenlet_imported (*__pyx_vp_6gevent_19__abstract_linkable__greenlet_imported) + +/* Module declarations from 'gevent.__semaphore' */ +static PyTypeObject *__pyx_ptype_6gevent_11__semaphore_Semaphore = 0; +static PyTypeObject *__pyx_ptype_6gevent_11__semaphore_BoundedSemaphore = 0; +static PyObject *__pyx_v_6gevent_11__semaphore_Timeout = 0; +#define __Pyx_MODULE_NAME "gevent.__semaphore" +extern int __pyx_module_is_main_gevent____semaphore; +int __pyx_module_is_main_gevent____semaphore = 0; + +/* Implementation of 'gevent.__semaphore' */ +static PyObject *__pyx_builtin_ValueError; +static PyObject *__pyx_builtin___import__; +static PyObject *__pyx_builtin_super; +static const char __pyx_k_t[] = "t"; +static const char __pyx_k_v[] = "v"; +static const char __pyx_k_x[] = "x"; +static const char __pyx_k_tb[] = "tb"; +static const char __pyx_k_all[] = "__all__"; +static const char __pyx_k_exit[] = "__exit__"; +static const char __pyx_k_init[] = "__init__"; +static const char __pyx_k_main[] = "__main__"; +static const char __pyx_k_name[] = "__name__"; +static const char __pyx_k_self[] = "self"; +static const char __pyx_k_test[] = "__test__"; +static const char __pyx_k_wait[] = "wait"; +static const char __pyx_k_class[] = "__class__"; +static const char __pyx_k_enter[] = "__enter__"; +static const char __pyx_k_ready[] = "ready"; +static const char __pyx_k_super[] = "super"; +static const char __pyx_k_value[] = "value"; +static const char __pyx_k_import[] = "__import__"; +static const char __pyx_k_locked[] = "locked"; +static const char __pyx_k_Timeout[] = "Timeout"; +static const char __pyx_k_acquire[] = "acquire"; +static const char __pyx_k_release[] = "release"; +static const char __pyx_k_timeout[] = "timeout"; +static const char __pyx_k_blocking[] = "blocking"; +static const char __pyx_k_pyx_capi[] = "__pyx_capi__"; +static const char __pyx_k_Semaphore[] = "Semaphore"; +static const char __pyx_k_linkcount[] = "linkcount"; +static const char __pyx_k_ValueError[] = "ValueError"; +static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__"; +static const char __pyx_k_get_linkable[] = "_get_linkable"; +static const char __pyx_k_gevent__util[] = "gevent._util"; +static const char __pyx_k_py3k_acquire[] = "_py3k_acquire"; +static const char __pyx_k_start_notify[] = "_start_notify"; +static const char __pyx_k_Semaphore_wait[] = "Semaphore.wait"; +static const char __pyx_k_import_c_accel[] = "import_c_accel"; +static const char __pyx_k_Semaphore_ready[] = "Semaphore.ready"; +static const char __pyx_k_AbstractLinkable[] = "AbstractLinkable"; +static const char __pyx_k_BoundedSemaphore[] = "BoundedSemaphore"; +static const char __pyx_k_Semaphore___exit[] = "Semaphore.__exit__"; +static const char __pyx_k_Semaphore_locked[] = "Semaphore.locked"; +static const char __pyx_k_Semaphore___enter[] = "Semaphore.__enter__"; +static const char __pyx_k_Semaphore_acquire[] = "Semaphore.acquire"; +static const char __pyx_k_Semaphore_release[] = "Semaphore.release"; +static const char __pyx_k_abstract_linkable[] = "_abstract_linkable"; +static const char __pyx_k_OVER_RELEASE_ERROR[] = "_OVER_RELEASE_ERROR"; +static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; +static const char __pyx_k_gevent___semaphore[] = "gevent.__semaphore"; +static const char __pyx_k_s_counter_s__links_s[] = "<%s counter=%s _links[%s]>"; +static const char __pyx_k_Semaphore__start_notify[] = "Semaphore._start_notify"; +static const char __pyx_k_BoundedSemaphore_release[] = "BoundedSemaphore.release"; +static const char __pyx_k_src_gevent__semaphore_py[] = "src\\gevent\\_semaphore.py"; +static const char __pyx_k_gevent__abstract_linkable[] = "gevent._abstract_linkable"; +static const char __pyx_k_semaphore_initial_value_must_be[] = "semaphore initial value must be >= 0"; +static const char __pyx_k_Semaphore_released_too_many_time[] = "Semaphore released too many times"; +static PyObject *__pyx_n_s_AbstractLinkable; +static PyObject *__pyx_n_s_BoundedSemaphore; +static PyObject *__pyx_n_s_BoundedSemaphore_release; +static PyObject *__pyx_n_s_OVER_RELEASE_ERROR; +static PyObject *__pyx_n_s_Semaphore; +static PyObject *__pyx_n_s_Semaphore___enter; +static PyObject *__pyx_n_s_Semaphore___exit; +static PyObject *__pyx_n_s_Semaphore__start_notify; +static PyObject *__pyx_n_s_Semaphore_acquire; +static PyObject *__pyx_n_s_Semaphore_locked; +static PyObject *__pyx_n_s_Semaphore_ready; +static PyObject *__pyx_n_s_Semaphore_release; +static PyObject *__pyx_kp_s_Semaphore_released_too_many_time; +static PyObject *__pyx_n_s_Semaphore_wait; +static PyObject *__pyx_n_s_Timeout; +static PyObject *__pyx_n_s_ValueError; +static PyObject *__pyx_n_s_abstract_linkable; +static PyObject *__pyx_n_s_acquire; +static PyObject *__pyx_n_s_all; +static PyObject *__pyx_n_s_blocking; +static PyObject *__pyx_n_s_class; +static PyObject *__pyx_n_s_cline_in_traceback; +static PyObject *__pyx_n_s_enter; +static PyObject *__pyx_n_s_exit; +static PyObject *__pyx_n_s_get_linkable; +static PyObject *__pyx_n_s_gevent___semaphore; +static PyObject *__pyx_kp_s_gevent__abstract_linkable; +static PyObject *__pyx_n_s_gevent__util; +static PyObject *__pyx_n_s_import; +static PyObject *__pyx_n_s_import_c_accel; +static PyObject *__pyx_n_s_init; +static PyObject *__pyx_n_s_linkcount; +static PyObject *__pyx_n_s_locked; +static PyObject *__pyx_n_s_main; +static PyObject *__pyx_n_s_name; +static PyObject *__pyx_n_s_py3k_acquire; +static PyObject *__pyx_n_s_pyx_capi; +static PyObject *__pyx_n_s_pyx_vtable; +static PyObject *__pyx_n_s_ready; +static PyObject *__pyx_n_s_release; +static PyObject *__pyx_kp_s_s_counter_s__links_s; +static PyObject *__pyx_n_s_self; +static PyObject *__pyx_kp_s_semaphore_initial_value_must_be; +static PyObject *__pyx_kp_s_src_gevent__semaphore_py; +static PyObject *__pyx_n_s_start_notify; +static PyObject *__pyx_n_s_super; +static PyObject *__pyx_n_s_t; +static PyObject *__pyx_n_s_tb; +static PyObject *__pyx_n_s_test; +static PyObject *__pyx_n_s_timeout; +static PyObject *__pyx_n_s_v; +static PyObject *__pyx_n_s_value; +static PyObject *__pyx_n_s_wait; +static PyObject *__pyx_n_s_x; +static PyObject *__pyx_pf_6gevent_11__semaphore__get_linkable(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static int __pyx_pf_6gevent_11__semaphore_9Semaphore___init__(struct __pyx_obj_6gevent_11__semaphore_Semaphore *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_6gevent_11__semaphore_9Semaphore_2__str__(struct __pyx_obj_6gevent_11__semaphore_Semaphore *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_11__semaphore_9Semaphore_4locked(struct __pyx_obj_6gevent_11__semaphore_Semaphore *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_11__semaphore_9Semaphore_6release(struct __pyx_obj_6gevent_11__semaphore_Semaphore *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_11__semaphore_9Semaphore_8ready(struct __pyx_obj_6gevent_11__semaphore_Semaphore *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_11__semaphore_9Semaphore_10_start_notify(struct __pyx_obj_6gevent_11__semaphore_Semaphore *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_11__semaphore_9Semaphore_12wait(struct __pyx_obj_6gevent_11__semaphore_Semaphore *__pyx_v_self, PyObject *__pyx_v_timeout); /* proto */ +static PyObject *__pyx_pf_6gevent_11__semaphore_9Semaphore_14acquire(struct __pyx_obj_6gevent_11__semaphore_Semaphore *__pyx_v_self, int __pyx_v_blocking, PyObject *__pyx_v_timeout); /* proto */ +static PyObject *__pyx_pf_6gevent_11__semaphore_9Semaphore_16__enter__(struct __pyx_obj_6gevent_11__semaphore_Semaphore *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_11__semaphore_9Semaphore_18__exit__(struct __pyx_obj_6gevent_11__semaphore_Semaphore *__pyx_v_self, PyObject *__pyx_v_t, PyObject *__pyx_v_v, PyObject *__pyx_v_tb); /* proto */ +static PyObject *__pyx_pf_6gevent_11__semaphore_9Semaphore_7counter___get__(struct __pyx_obj_6gevent_11__semaphore_Semaphore *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_11__semaphore_9Semaphore_7counter_2__set__(struct __pyx_obj_6gevent_11__semaphore_Semaphore *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6gevent_11__semaphore_16BoundedSemaphore___init__(struct __pyx_obj_6gevent_11__semaphore_BoundedSemaphore *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */ +static PyObject *__pyx_pf_6gevent_11__semaphore_16BoundedSemaphore_2release(struct __pyx_obj_6gevent_11__semaphore_BoundedSemaphore *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_11__semaphore_16BoundedSemaphore_14_initial_value___get__(struct __pyx_obj_6gevent_11__semaphore_BoundedSemaphore *__pyx_v_self); /* proto */ +static PyObject *__pyx_tp_new_6gevent_11__semaphore_Semaphore(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6gevent_11__semaphore_BoundedSemaphore(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_int_0; +static PyObject *__pyx_int_1; +static PyObject *__pyx_tuple_; +static PyObject *__pyx_tuple__2; +static PyObject *__pyx_tuple__3; +static PyObject *__pyx_tuple__5; +static PyObject *__pyx_tuple__7; +static PyObject *__pyx_tuple__9; +static PyObject *__pyx_tuple__11; +static PyObject *__pyx_tuple__13; +static PyObject *__pyx_tuple__15; +static PyObject *__pyx_tuple__17; +static PyObject *__pyx_tuple__19; +static PyObject *__pyx_tuple__21; +static PyObject *__pyx_codeobj__4; +static PyObject *__pyx_codeobj__6; +static PyObject *__pyx_codeobj__8; +static PyObject *__pyx_codeobj__10; +static PyObject *__pyx_codeobj__12; +static PyObject *__pyx_codeobj__14; +static PyObject *__pyx_codeobj__16; +static PyObject *__pyx_codeobj__18; +static PyObject *__pyx_codeobj__20; +static PyObject *__pyx_codeobj__22; +/* Late includes */ + +/* "src/gevent/_semaphore.py":9 + * ] + * + * def _get_linkable(): # <<<<<<<<<<<<<< + * x = __import__('gevent._abstract_linkable') + * return x._abstract_linkable.AbstractLinkable + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_11__semaphore_1_get_linkable(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6gevent_11__semaphore__get_linkable[] = "_get_linkable()"; +static PyMethodDef __pyx_mdef_6gevent_11__semaphore_1_get_linkable = {"_get_linkable", (PyCFunction)__pyx_pw_6gevent_11__semaphore_1_get_linkable, METH_NOARGS, __pyx_doc_6gevent_11__semaphore__get_linkable}; +static PyObject *__pyx_pw_6gevent_11__semaphore_1_get_linkable(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_get_linkable (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_11__semaphore__get_linkable(__pyx_self); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_11__semaphore__get_linkable(CYTHON_UNUSED PyObject *__pyx_self) { + PyObject *__pyx_v_x = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("_get_linkable", 0); + + /* "src/gevent/_semaphore.py":10 + * + * def _get_linkable(): + * x = __import__('gevent._abstract_linkable') # <<<<<<<<<<<<<< + * return x._abstract_linkable.AbstractLinkable + * locals()['AbstractLinkable'] = _get_linkable() + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin___import__, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_x = __pyx_t_1; + __pyx_t_1 = 0; + + /* "src/gevent/_semaphore.py":11 + * def _get_linkable(): + * x = __import__('gevent._abstract_linkable') + * return x._abstract_linkable.AbstractLinkable # <<<<<<<<<<<<<< + * locals()['AbstractLinkable'] = _get_linkable() + * del _get_linkable + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_abstract_linkable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 11, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_AbstractLinkable); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 11, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "src/gevent/_semaphore.py":9 + * ] + * + * def _get_linkable(): # <<<<<<<<<<<<<< + * x = __import__('gevent._abstract_linkable') + * return x._abstract_linkable.AbstractLinkable + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent.__semaphore._get_linkable", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_x); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_semaphore.py":41 + * """ + * + * def __init__(self, value=1): # <<<<<<<<<<<<<< + * if value < 0: + * raise ValueError("semaphore initial value must be >= 0") + */ + +/* Python wrapper */ +static int __pyx_pw_6gevent_11__semaphore_9Semaphore_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6gevent_11__semaphore_9Semaphore_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_value = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_value,0}; + PyObject* values[1] = {0}; + values[0] = ((PyObject *)__pyx_int_1); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value); + if (value) { values[0] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 41, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_value = values[0]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 41, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.__semaphore.Semaphore.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_11__semaphore_9Semaphore___init__(((struct __pyx_obj_6gevent_11__semaphore_Semaphore *)__pyx_v_self), __pyx_v_value); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_11__semaphore_9Semaphore___init__(struct __pyx_obj_6gevent_11__semaphore_Semaphore *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "src/gevent/_semaphore.py":42 + * + * def __init__(self, value=1): + * if value < 0: # <<<<<<<<<<<<<< + * raise ValueError("semaphore initial value must be >= 0") + * super(Semaphore, self).__init__() + */ + __pyx_t_1 = PyObject_RichCompare(__pyx_v_value, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 42, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 42, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(__pyx_t_2)) { + + /* "src/gevent/_semaphore.py":43 + * def __init__(self, value=1): + * if value < 0: + * raise ValueError("semaphore initial value must be >= 0") # <<<<<<<<<<<<<< + * super(Semaphore, self).__init__() + * self.counter = value + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 43, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 43, __pyx_L1_error) + + /* "src/gevent/_semaphore.py":42 + * + * def __init__(self, value=1): + * if value < 0: # <<<<<<<<<<<<<< + * raise ValueError("semaphore initial value must be >= 0") + * super(Semaphore, self).__init__() + */ + } + + /* "src/gevent/_semaphore.py":44 + * if value < 0: + * raise ValueError("semaphore initial value must be >= 0") + * super(Semaphore, self).__init__() # <<<<<<<<<<<<<< + * self.counter = value + * self._notify_all = False + */ + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 44, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)__pyx_ptype_6gevent_11__semaphore_Semaphore)); + __Pyx_GIVEREF(((PyObject *)__pyx_ptype_6gevent_11__semaphore_Semaphore)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_ptype_6gevent_11__semaphore_Semaphore)); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_v_self)); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 44, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_init); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 44, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 44, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_semaphore.py":45 + * raise ValueError("semaphore initial value must be >= 0") + * super(Semaphore, self).__init__() + * self.counter = value # <<<<<<<<<<<<<< + * self._notify_all = False + * + */ + __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 45, __pyx_L1_error) + __pyx_v_self->counter = __pyx_t_5; + + /* "src/gevent/_semaphore.py":46 + * super(Semaphore, self).__init__() + * self.counter = value + * self._notify_all = False # <<<<<<<<<<<<<< + * + * def __str__(self): + */ + __pyx_v_self->__pyx_base._notify_all = 0; + + /* "src/gevent/_semaphore.py":41 + * """ + * + * def __init__(self, value=1): # <<<<<<<<<<<<<< + * if value < 0: + * raise ValueError("semaphore initial value must be >= 0") + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("gevent.__semaphore.Semaphore.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_semaphore.py":48 + * self._notify_all = False + * + * def __str__(self): # <<<<<<<<<<<<<< + * params = (self.__class__.__name__, self.counter, self.linkcount()) + * return '<%s counter=%s _links[%s]>' % params + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_11__semaphore_9Semaphore_3__str__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_11__semaphore_9Semaphore_3__str__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__str__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_11__semaphore_9Semaphore_2__str__(((struct __pyx_obj_6gevent_11__semaphore_Semaphore *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_11__semaphore_9Semaphore_2__str__(struct __pyx_obj_6gevent_11__semaphore_Semaphore *__pyx_v_self) { + PyObject *__pyx_v_params = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + __Pyx_RefNannySetupContext("__str__", 0); + + /* "src/gevent/_semaphore.py":49 + * + * def __str__(self): + * params = (self.__class__.__name__, self.counter, self.linkcount()) # <<<<<<<<<<<<<< + * return '<%s counter=%s _links[%s]>' % params + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 49, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 49, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->counter); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 49, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_linkcount); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 49, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + } + } + __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 49, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 49, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3); + __pyx_t_2 = 0; + __pyx_t_1 = 0; + __pyx_t_3 = 0; + __pyx_v_params = ((PyObject*)__pyx_t_4); + __pyx_t_4 = 0; + + /* "src/gevent/_semaphore.py":50 + * def __str__(self): + * params = (self.__class__.__name__, self.counter, self.linkcount()) + * return '<%s counter=%s _links[%s]>' % params # <<<<<<<<<<<<<< + * + * def locked(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_s_counter_s__links_s, __pyx_v_params); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 50, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + + /* "src/gevent/_semaphore.py":48 + * self._notify_all = False + * + * def __str__(self): # <<<<<<<<<<<<<< + * params = (self.__class__.__name__, self.counter, self.linkcount()) + * return '<%s counter=%s _links[%s]>' % params + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("gevent.__semaphore.Semaphore.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_params); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_semaphore.py":52 + * return '<%s counter=%s _links[%s]>' % params + * + * def locked(self): # <<<<<<<<<<<<<< + * """Return a boolean indicating whether the semaphore can be acquired. + * Most useful with binary semaphores.""" + */ + +static PyObject *__pyx_pw_6gevent_11__semaphore_9Semaphore_5locked(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static int __pyx_f_6gevent_11__semaphore_9Semaphore_locked(struct __pyx_obj_6gevent_11__semaphore_Semaphore *__pyx_v_self, int __pyx_skip_dispatch) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + __Pyx_RefNannySetupContext("locked", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0; + if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self)))))); + else { + PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + #endif + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_locked); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 52, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_11__semaphore_9Semaphore_5locked)) { + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 52, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 52, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_5; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0; + if (unlikely(type_dict_guard != tp_dict_version)) { + tp_dict_version = obj_dict_version = 0; + } + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + } + #endif + } + + /* "src/gevent/_semaphore.py":55 + * """Return a boolean indicating whether the semaphore can be acquired. + * Most useful with binary semaphores.""" + * return self.counter <= 0 # <<<<<<<<<<<<<< + * + * def release(self): + */ + __pyx_r = (__pyx_v_self->counter <= 0); + goto __pyx_L0; + + /* "src/gevent/_semaphore.py":52 + * return '<%s counter=%s _links[%s]>' % params + * + * def locked(self): # <<<<<<<<<<<<<< + * """Return a boolean indicating whether the semaphore can be acquired. + * Most useful with binary semaphores.""" + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_WriteUnraisable("gevent.__semaphore.Semaphore.locked", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_11__semaphore_9Semaphore_5locked(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6gevent_11__semaphore_9Semaphore_4locked[] = "Semaphore.locked(self) -> bool\nReturn a boolean indicating whether the semaphore can be acquired.\n Most useful with binary semaphores."; +static PyMethodDef __pyx_mdef_6gevent_11__semaphore_9Semaphore_5locked = {"locked", (PyCFunction)__pyx_pw_6gevent_11__semaphore_9Semaphore_5locked, METH_NOARGS, __pyx_doc_6gevent_11__semaphore_9Semaphore_4locked}; +static PyObject *__pyx_pw_6gevent_11__semaphore_9Semaphore_5locked(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("locked (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_11__semaphore_9Semaphore_4locked(((struct __pyx_obj_6gevent_11__semaphore_Semaphore *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_11__semaphore_9Semaphore_4locked(struct __pyx_obj_6gevent_11__semaphore_Semaphore *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("locked", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_f_6gevent_11__semaphore_9Semaphore_locked(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 52, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__semaphore.Semaphore.locked", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_semaphore.py":57 + * return self.counter <= 0 + * + * def release(self): # <<<<<<<<<<<<<< + * """ + * Release the semaphore, notifying any waiters if needed. + */ + +static PyObject *__pyx_pw_6gevent_11__semaphore_9Semaphore_7release(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static int __pyx_f_6gevent_11__semaphore_9Semaphore_release(struct __pyx_obj_6gevent_11__semaphore_Semaphore *__pyx_v_self, int __pyx_skip_dispatch) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + __Pyx_RefNannySetupContext("release", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0; + if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self)))))); + else { + PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + #endif + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_release); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 57, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_11__semaphore_9Semaphore_7release)) { + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 57, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 57, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_5; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0; + if (unlikely(type_dict_guard != tp_dict_version)) { + tp_dict_version = obj_dict_version = 0; + } + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + } + #endif + } + + /* "src/gevent/_semaphore.py":61 + * Release the semaphore, notifying any waiters if needed. + * """ + * self.counter += 1 # <<<<<<<<<<<<<< + * self._check_and_notify() + * return self.counter + */ + __pyx_v_self->counter = (__pyx_v_self->counter + 1); + + /* "src/gevent/_semaphore.py":62 + * """ + * self.counter += 1 + * self._check_and_notify() # <<<<<<<<<<<<<< + * return self.counter + * + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_11__semaphore_Semaphore *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._check_and_notify(((struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 62, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_semaphore.py":63 + * self.counter += 1 + * self._check_and_notify() + * return self.counter # <<<<<<<<<<<<<< + * + * def ready(self): + */ + __pyx_r = __pyx_v_self->counter; + goto __pyx_L0; + + /* "src/gevent/_semaphore.py":57 + * return self.counter <= 0 + * + * def release(self): # <<<<<<<<<<<<<< + * """ + * Release the semaphore, notifying any waiters if needed. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("gevent.__semaphore.Semaphore.release", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1000; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_11__semaphore_9Semaphore_7release(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6gevent_11__semaphore_9Semaphore_6release[] = "Semaphore.release(self) -> int\n\n Release the semaphore, notifying any waiters if needed.\n "; +static PyMethodDef __pyx_mdef_6gevent_11__semaphore_9Semaphore_7release = {"release", (PyCFunction)__pyx_pw_6gevent_11__semaphore_9Semaphore_7release, METH_NOARGS, __pyx_doc_6gevent_11__semaphore_9Semaphore_6release}; +static PyObject *__pyx_pw_6gevent_11__semaphore_9Semaphore_7release(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("release (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_11__semaphore_9Semaphore_6release(((struct __pyx_obj_6gevent_11__semaphore_Semaphore *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_11__semaphore_9Semaphore_6release(struct __pyx_obj_6gevent_11__semaphore_Semaphore *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("release", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6gevent_11__semaphore_9Semaphore_release(__pyx_v_self, 1); if (unlikely(__pyx_t_1 == ((int)-1000))) __PYX_ERR(0, 57, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 57, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent.__semaphore.Semaphore.release", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_semaphore.py":65 + * return self.counter + * + * def ready(self): # <<<<<<<<<<<<<< + * return self.counter > 0 + * + */ + +static PyObject *__pyx_pw_6gevent_11__semaphore_9Semaphore_9ready(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static int __pyx_f_6gevent_11__semaphore_9Semaphore_ready(struct __pyx_obj_6gevent_11__semaphore_Semaphore *__pyx_v_self, int __pyx_skip_dispatch) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + __Pyx_RefNannySetupContext("ready", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0; + if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self)))))); + else { + PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + #endif + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_ready); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 65, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_11__semaphore_9Semaphore_9ready)) { + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 65, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 65, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_5; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0; + if (unlikely(type_dict_guard != tp_dict_version)) { + tp_dict_version = obj_dict_version = 0; + } + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + } + #endif + } + + /* "src/gevent/_semaphore.py":66 + * + * def ready(self): + * return self.counter > 0 # <<<<<<<<<<<<<< + * + * def _start_notify(self): + */ + __pyx_r = (__pyx_v_self->counter > 0); + goto __pyx_L0; + + /* "src/gevent/_semaphore.py":65 + * return self.counter + * + * def ready(self): # <<<<<<<<<<<<<< + * return self.counter > 0 + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_WriteUnraisable("gevent.__semaphore.Semaphore.ready", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_11__semaphore_9Semaphore_9ready(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6gevent_11__semaphore_9Semaphore_8ready[] = "Semaphore.ready(self) -> bool"; +static PyMethodDef __pyx_mdef_6gevent_11__semaphore_9Semaphore_9ready = {"ready", (PyCFunction)__pyx_pw_6gevent_11__semaphore_9Semaphore_9ready, METH_NOARGS, __pyx_doc_6gevent_11__semaphore_9Semaphore_8ready}; +static PyObject *__pyx_pw_6gevent_11__semaphore_9Semaphore_9ready(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("ready (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_11__semaphore_9Semaphore_8ready(((struct __pyx_obj_6gevent_11__semaphore_Semaphore *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_11__semaphore_9Semaphore_8ready(struct __pyx_obj_6gevent_11__semaphore_Semaphore *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("ready", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_f_6gevent_11__semaphore_9Semaphore_ready(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 65, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__semaphore.Semaphore.ready", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_semaphore.py":68 + * return self.counter > 0 + * + * def _start_notify(self): # <<<<<<<<<<<<<< + * self._check_and_notify() + * + */ + +static PyObject *__pyx_pw_6gevent_11__semaphore_9Semaphore_11_start_notify(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_f_6gevent_11__semaphore_9Semaphore__start_notify(struct __pyx_obj_6gevent_11__semaphore_Semaphore *__pyx_v_self, int __pyx_skip_dispatch) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + __Pyx_RefNannySetupContext("_start_notify", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0; + if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self)))))); + else { + PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + #endif + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_start_notify); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 68, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_11__semaphore_9Semaphore_11_start_notify)) { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 68, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0; + if (unlikely(type_dict_guard != tp_dict_version)) { + tp_dict_version = obj_dict_version = 0; + } + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + } + #endif + } + + /* "src/gevent/_semaphore.py":69 + * + * def _start_notify(self): + * self._check_and_notify() # <<<<<<<<<<<<<< + * + * def _wait_return_value(self, waited, wait_success): + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_11__semaphore_Semaphore *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._check_and_notify(((struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 69, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_semaphore.py":68 + * return self.counter > 0 + * + * def _start_notify(self): # <<<<<<<<<<<<<< + * self._check_and_notify() + * + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("gevent.__semaphore.Semaphore._start_notify", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_11__semaphore_9Semaphore_11_start_notify(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6gevent_11__semaphore_9Semaphore_10_start_notify[] = "Semaphore._start_notify(self)"; +static PyMethodDef __pyx_mdef_6gevent_11__semaphore_9Semaphore_11_start_notify = {"_start_notify", (PyCFunction)__pyx_pw_6gevent_11__semaphore_9Semaphore_11_start_notify, METH_NOARGS, __pyx_doc_6gevent_11__semaphore_9Semaphore_10_start_notify}; +static PyObject *__pyx_pw_6gevent_11__semaphore_9Semaphore_11_start_notify(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_start_notify (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_11__semaphore_9Semaphore_10_start_notify(((struct __pyx_obj_6gevent_11__semaphore_Semaphore *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_11__semaphore_9Semaphore_10_start_notify(struct __pyx_obj_6gevent_11__semaphore_Semaphore *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("_start_notify", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6gevent_11__semaphore_9Semaphore__start_notify(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 68, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__semaphore.Semaphore._start_notify", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_semaphore.py":71 + * self._check_and_notify() + * + * def _wait_return_value(self, waited, wait_success): # <<<<<<<<<<<<<< + * if waited: + * return wait_success + */ + +static PyObject *__pyx_f_6gevent_11__semaphore_9Semaphore__wait_return_value(CYTHON_UNUSED struct __pyx_obj_6gevent_11__semaphore_Semaphore *__pyx_v_self, PyObject *__pyx_v_waited, PyObject *__pyx_v_wait_success) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("_wait_return_value", 0); + + /* "src/gevent/_semaphore.py":72 + * + * def _wait_return_value(self, waited, wait_success): + * if waited: # <<<<<<<<<<<<<< + * return wait_success + * # We didn't even wait, we must be good to go. + */ + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_waited); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 72, __pyx_L1_error) + if (__pyx_t_1) { + + /* "src/gevent/_semaphore.py":73 + * def _wait_return_value(self, waited, wait_success): + * if waited: + * return wait_success # <<<<<<<<<<<<<< + * # We didn't even wait, we must be good to go. + * # XXX: This is probably dead code, we're careful not to go into the wait + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_wait_success); + __pyx_r = __pyx_v_wait_success; + goto __pyx_L0; + + /* "src/gevent/_semaphore.py":72 + * + * def _wait_return_value(self, waited, wait_success): + * if waited: # <<<<<<<<<<<<<< + * return wait_success + * # We didn't even wait, we must be good to go. + */ + } + + /* "src/gevent/_semaphore.py":77 + * # XXX: This is probably dead code, we're careful not to go into the wait + * # state if we don't expect to need to + * return True # <<<<<<<<<<<<<< + * + * def wait(self, timeout=None): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; + goto __pyx_L0; + + /* "src/gevent/_semaphore.py":71 + * self._check_and_notify() + * + * def _wait_return_value(self, waited, wait_success): # <<<<<<<<<<<<<< + * if waited: + * return wait_success + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_AddTraceback("gevent.__semaphore.Semaphore._wait_return_value", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_semaphore.py":79 + * return True + * + * def wait(self, timeout=None): # <<<<<<<<<<<<<< + * """ + * wait(timeout=None) -> int + */ + +static PyObject *__pyx_pw_6gevent_11__semaphore_9Semaphore_13wait(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_f_6gevent_11__semaphore_9Semaphore_wait(struct __pyx_obj_6gevent_11__semaphore_Semaphore *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_11__semaphore_9Semaphore_wait *__pyx_optional_args) { + PyObject *__pyx_v_timeout = ((PyObject *)Py_None); + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + int __pyx_t_6; + struct __pyx_opt_args_6gevent_19__abstract_linkable_16AbstractLinkable__wait __pyx_t_7; + __Pyx_RefNannySetupContext("wait", 0); + if (__pyx_optional_args) { + if (__pyx_optional_args->__pyx_n > 0) { + __pyx_v_timeout = __pyx_optional_args->timeout; + } + } + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0; + if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self)))))); + else { + PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + #endif + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_wait); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 79, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_11__semaphore_9Semaphore_13wait)) { + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_timeout) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_timeout); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 79, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 79, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_5; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0; + if (unlikely(type_dict_guard != tp_dict_version)) { + tp_dict_version = obj_dict_version = 0; + } + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + } + #endif + } + + /* "src/gevent/_semaphore.py":94 + * before blocking. + * """ + * if self.counter > 0: # <<<<<<<<<<<<<< + * return self.counter + * + */ + __pyx_t_6 = ((__pyx_v_self->counter > 0) != 0); + if (__pyx_t_6) { + + /* "src/gevent/_semaphore.py":95 + * """ + * if self.counter > 0: + * return self.counter # <<<<<<<<<<<<<< + * + * self._wait(timeout) # return value irrelevant, whether we got it or got a timeout + */ + __pyx_r = __pyx_v_self->counter; + goto __pyx_L0; + + /* "src/gevent/_semaphore.py":94 + * before blocking. + * """ + * if self.counter > 0: # <<<<<<<<<<<<<< + * return self.counter + * + */ + } + + /* "src/gevent/_semaphore.py":97 + * return self.counter + * + * self._wait(timeout) # return value irrelevant, whether we got it or got a timeout # <<<<<<<<<<<<<< + * return self.counter + * + */ + __pyx_t_7.__pyx_n = 1; + __pyx_t_7.timeout = __pyx_v_timeout; + __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_11__semaphore_Semaphore *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._wait(((struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *)__pyx_v_self), &__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 97, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_semaphore.py":98 + * + * self._wait(timeout) # return value irrelevant, whether we got it or got a timeout + * return self.counter # <<<<<<<<<<<<<< + * + * def acquire(self, blocking=True, timeout=None): + */ + __pyx_r = __pyx_v_self->counter; + goto __pyx_L0; + + /* "src/gevent/_semaphore.py":79 + * return True + * + * def wait(self, timeout=None): # <<<<<<<<<<<<<< + * """ + * wait(timeout=None) -> int + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("gevent.__semaphore.Semaphore.wait", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1000; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_11__semaphore_9Semaphore_13wait(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6gevent_11__semaphore_9Semaphore_12wait[] = "Semaphore.wait(self, timeout=None) -> int\n\n wait(timeout=None) -> int\n\n Wait until it is possible to acquire this semaphore, or until the optional\n *timeout* elapses.\n\n .. caution:: If this semaphore was initialized with a size of 0,\n this method will block forever if no timeout is given.\n\n :keyword float timeout: If given, specifies the maximum amount of seconds\n this method will block.\n :return: A number indicating how many times the semaphore can be acquired\n before blocking.\n "; +static PyMethodDef __pyx_mdef_6gevent_11__semaphore_9Semaphore_13wait = {"wait", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_11__semaphore_9Semaphore_13wait, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_11__semaphore_9Semaphore_12wait}; +static PyObject *__pyx_pw_6gevent_11__semaphore_9Semaphore_13wait(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_timeout = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("wait (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_timeout,0}; + PyObject* values[1] = {0}; + values[0] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_timeout); + if (value) { values[0] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "wait") < 0)) __PYX_ERR(0, 79, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_timeout = values[0]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("wait", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 79, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.__semaphore.Semaphore.wait", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_11__semaphore_9Semaphore_12wait(((struct __pyx_obj_6gevent_11__semaphore_Semaphore *)__pyx_v_self), __pyx_v_timeout); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_11__semaphore_9Semaphore_12wait(struct __pyx_obj_6gevent_11__semaphore_Semaphore *__pyx_v_self, PyObject *__pyx_v_timeout) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + struct __pyx_opt_args_6gevent_11__semaphore_9Semaphore_wait __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("wait", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_2.__pyx_n = 1; + __pyx_t_2.timeout = __pyx_v_timeout; + __pyx_t_1 = __pyx_vtabptr_6gevent_11__semaphore_Semaphore->wait(__pyx_v_self, 1, &__pyx_t_2); if (unlikely(__pyx_t_1 == ((int)-1000))) __PYX_ERR(0, 79, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 79, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("gevent.__semaphore.Semaphore.wait", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_semaphore.py":100 + * return self.counter + * + * def acquire(self, blocking=True, timeout=None): # <<<<<<<<<<<<<< + * """ + * acquire(blocking=True, timeout=None) -> bool + */ + +static PyObject *__pyx_pw_6gevent_11__semaphore_9Semaphore_15acquire(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_f_6gevent_11__semaphore_9Semaphore_acquire(struct __pyx_obj_6gevent_11__semaphore_Semaphore *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_11__semaphore_9Semaphore_acquire *__pyx_optional_args) { + int __pyx_v_blocking = ((int)1); + PyObject *__pyx_v_timeout = ((PyObject *)Py_None); + PyObject *__pyx_v_success = NULL; + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + int __pyx_t_8; + struct __pyx_opt_args_6gevent_19__abstract_linkable_16AbstractLinkable__wait __pyx_t_9; + int __pyx_t_10; + __Pyx_RefNannySetupContext("acquire", 0); + if (__pyx_optional_args) { + if (__pyx_optional_args->__pyx_n > 0) { + __pyx_v_blocking = __pyx_optional_args->blocking; + if (__pyx_optional_args->__pyx_n > 1) { + __pyx_v_timeout = __pyx_optional_args->timeout; + } + } + } + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0; + if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self)))))); + else { + PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + #endif + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_acquire); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 100, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_11__semaphore_9Semaphore_15acquire)) { + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_blocking); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 100, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_t_1); + __pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL; + __pyx_t_6 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + __pyx_t_6 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_4)) { + PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_3, __pyx_v_timeout}; + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 100, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { + PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_3, __pyx_v_timeout}; + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 100, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } else + #endif + { + __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 100, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + if (__pyx_t_5) { + __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL; + } + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_t_3); + __Pyx_INCREF(__pyx_v_timeout); + __Pyx_GIVEREF(__pyx_v_timeout); + PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_timeout); + __pyx_t_3 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 100, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 100, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_8; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0; + if (unlikely(type_dict_guard != tp_dict_version)) { + tp_dict_version = obj_dict_version = 0; + } + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + } + #endif + } + + /* "src/gevent/_semaphore.py":121 + * raise a ``Timeout`` exception, if some other caller had already started a timer.) + * """ + * if self.counter > 0: # <<<<<<<<<<<<<< + * self.counter -= 1 + * return True + */ + __pyx_t_8 = ((__pyx_v_self->counter > 0) != 0); + if (__pyx_t_8) { + + /* "src/gevent/_semaphore.py":122 + * """ + * if self.counter > 0: + * self.counter -= 1 # <<<<<<<<<<<<<< + * return True + * + */ + __pyx_v_self->counter = (__pyx_v_self->counter - 1); + + /* "src/gevent/_semaphore.py":123 + * if self.counter > 0: + * self.counter -= 1 + * return True # <<<<<<<<<<<<<< + * + * if not blocking: + */ + __pyx_r = 1; + goto __pyx_L0; + + /* "src/gevent/_semaphore.py":121 + * raise a ``Timeout`` exception, if some other caller had already started a timer.) + * """ + * if self.counter > 0: # <<<<<<<<<<<<<< + * self.counter -= 1 + * return True + */ + } + + /* "src/gevent/_semaphore.py":125 + * return True + * + * if not blocking: # <<<<<<<<<<<<<< + * return False + * + */ + __pyx_t_8 = ((!(__pyx_v_blocking != 0)) != 0); + if (__pyx_t_8) { + + /* "src/gevent/_semaphore.py":126 + * + * if not blocking: + * return False # <<<<<<<<<<<<<< + * + * success = self._wait(timeout) + */ + __pyx_r = 0; + goto __pyx_L0; + + /* "src/gevent/_semaphore.py":125 + * return True + * + * if not blocking: # <<<<<<<<<<<<<< + * return False + * + */ + } + + /* "src/gevent/_semaphore.py":128 + * return False + * + * success = self._wait(timeout) # <<<<<<<<<<<<<< + * if not success: + * # Our timer expired. + */ + __pyx_t_9.__pyx_n = 1; + __pyx_t_9.timeout = __pyx_v_timeout; + __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_11__semaphore_Semaphore *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._wait(((struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *)__pyx_v_self), &__pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 128, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_success = __pyx_t_1; + __pyx_t_1 = 0; + + /* "src/gevent/_semaphore.py":129 + * + * success = self._wait(timeout) + * if not success: # <<<<<<<<<<<<<< + * # Our timer expired. + * return False + */ + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_success); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 129, __pyx_L1_error) + __pyx_t_10 = ((!__pyx_t_8) != 0); + if (__pyx_t_10) { + + /* "src/gevent/_semaphore.py":131 + * if not success: + * # Our timer expired. + * return False # <<<<<<<<<<<<<< + * + * # Neither our timer no another one expired, so we blocked until + */ + __pyx_r = 0; + goto __pyx_L0; + + /* "src/gevent/_semaphore.py":129 + * + * success = self._wait(timeout) + * if not success: # <<<<<<<<<<<<<< + * # Our timer expired. + * return False + */ + } + + /* "src/gevent/_semaphore.py":135 + * # Neither our timer no another one expired, so we blocked until + * # awoke. Therefore, the counter is ours + * self.counter -= 1 # <<<<<<<<<<<<<< + * assert self.counter >= 0 + * return True + */ + __pyx_v_self->counter = (__pyx_v_self->counter - 1); + + /* "src/gevent/_semaphore.py":136 + * # awoke. Therefore, the counter is ours + * self.counter -= 1 + * assert self.counter >= 0 # <<<<<<<<<<<<<< + * return True + * + */ + #ifndef CYTHON_WITHOUT_ASSERTIONS + if (unlikely(!Py_OptimizeFlag)) { + if (unlikely(!((__pyx_v_self->counter >= 0) != 0))) { + PyErr_SetNone(PyExc_AssertionError); + __PYX_ERR(0, 136, __pyx_L1_error) + } + } + #endif + + /* "src/gevent/_semaphore.py":137 + * self.counter -= 1 + * assert self.counter >= 0 + * return True # <<<<<<<<<<<<<< + * + * _py3k_acquire = acquire # PyPy needs this; it must be static for Cython + */ + __pyx_r = 1; + goto __pyx_L0; + + /* "src/gevent/_semaphore.py":100 + * return self.counter + * + * def acquire(self, blocking=True, timeout=None): # <<<<<<<<<<<<<< + * """ + * acquire(blocking=True, timeout=None) -> bool + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("gevent.__semaphore.Semaphore.acquire", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1000; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_success); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_11__semaphore_9Semaphore_15acquire(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6gevent_11__semaphore_9Semaphore_14acquire[] = "Semaphore.acquire(self, int blocking=True, timeout=None) -> bool\n\n acquire(blocking=True, timeout=None) -> bool\n\n Acquire the semaphore.\n\n .. caution:: If this semaphore was initialized with a size of 0,\n this method will block forever (unless a timeout is given or blocking is\n set to false).\n\n :keyword bool blocking: If True (the default), this function will block\n until the semaphore is acquired.\n :keyword float timeout: If given, specifies the maximum amount of seconds\n this method will block.\n :return: A boolean indicating whether the semaphore was acquired.\n If ``blocking`` is True and ``timeout`` is None (the default), then\n (so long as this semaphore was initialized with a size greater than 0)\n this will always return True. If a timeout was given, and it expired before\n the semaphore was acquired, False will be returned. (Note that this can still\n raise a ``Timeout`` exception, if some other caller had already started a timer.)\n "; +static PyMethodDef __pyx_mdef_6gevent_11__semaphore_9Semaphore_15acquire = {"acquire", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_11__semaphore_9Semaphore_15acquire, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_11__semaphore_9Semaphore_14acquire}; +static PyObject *__pyx_pw_6gevent_11__semaphore_9Semaphore_15acquire(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + int __pyx_v_blocking; + PyObject *__pyx_v_timeout = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("acquire (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_blocking,&__pyx_n_s_timeout,0}; + PyObject* values[2] = {0,0}; + values[1] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_blocking); + if (value) { values[0] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 1: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_timeout); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "acquire") < 0)) __PYX_ERR(0, 100, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + } + if (values[0]) { + __pyx_v_blocking = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_blocking == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 100, __pyx_L3_error) + } else { + __pyx_v_blocking = ((int)1); + } + __pyx_v_timeout = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("acquire", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 100, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.__semaphore.Semaphore.acquire", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_11__semaphore_9Semaphore_14acquire(((struct __pyx_obj_6gevent_11__semaphore_Semaphore *)__pyx_v_self), __pyx_v_blocking, __pyx_v_timeout); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_11__semaphore_9Semaphore_14acquire(struct __pyx_obj_6gevent_11__semaphore_Semaphore *__pyx_v_self, int __pyx_v_blocking, PyObject *__pyx_v_timeout) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + struct __pyx_opt_args_6gevent_11__semaphore_9Semaphore_acquire __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("acquire", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_2.__pyx_n = 2; + __pyx_t_2.blocking = __pyx_v_blocking; + __pyx_t_2.timeout = __pyx_v_timeout; + __pyx_t_1 = __pyx_vtabptr_6gevent_11__semaphore_Semaphore->acquire(__pyx_v_self, 1, &__pyx_t_2); if (unlikely(__pyx_t_1 == ((int)-1000))) __PYX_ERR(0, 100, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 100, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("gevent.__semaphore.Semaphore.acquire", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_semaphore.py":141 + * _py3k_acquire = acquire # PyPy needs this; it must be static for Cython + * + * def __enter__(self): # <<<<<<<<<<<<<< + * self.acquire() + * + */ + +static PyObject *__pyx_pw_6gevent_11__semaphore_9Semaphore_17__enter__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_f_6gevent_11__semaphore_9Semaphore___enter__(struct __pyx_obj_6gevent_11__semaphore_Semaphore *__pyx_v_self, int __pyx_skip_dispatch) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + __Pyx_RefNannySetupContext("__enter__", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0; + if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self)))))); + else { + PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + #endif + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_enter); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 141, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_11__semaphore_9Semaphore_17__enter__)) { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 141, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0; + if (unlikely(type_dict_guard != tp_dict_version)) { + tp_dict_version = obj_dict_version = 0; + } + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + } + #endif + } + + /* "src/gevent/_semaphore.py":142 + * + * def __enter__(self): + * self.acquire() # <<<<<<<<<<<<<< + * + * def __exit__(self, t, v, tb): + */ + __pyx_t_5 = ((struct __pyx_vtabstruct_6gevent_11__semaphore_Semaphore *)__pyx_v_self->__pyx_base.__pyx_vtab)->acquire(__pyx_v_self, 0, NULL); if (unlikely(__pyx_t_5 == ((int)-1000))) __PYX_ERR(0, 142, __pyx_L1_error) + + /* "src/gevent/_semaphore.py":141 + * _py3k_acquire = acquire # PyPy needs this; it must be static for Cython + * + * def __enter__(self): # <<<<<<<<<<<<<< + * self.acquire() + * + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("gevent.__semaphore.Semaphore.__enter__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_11__semaphore_9Semaphore_17__enter__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6gevent_11__semaphore_9Semaphore_16__enter__[] = "Semaphore.__enter__(self)"; +static PyMethodDef __pyx_mdef_6gevent_11__semaphore_9Semaphore_17__enter__ = {"__enter__", (PyCFunction)__pyx_pw_6gevent_11__semaphore_9Semaphore_17__enter__, METH_NOARGS, __pyx_doc_6gevent_11__semaphore_9Semaphore_16__enter__}; +static PyObject *__pyx_pw_6gevent_11__semaphore_9Semaphore_17__enter__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__enter__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_11__semaphore_9Semaphore_16__enter__(((struct __pyx_obj_6gevent_11__semaphore_Semaphore *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_11__semaphore_9Semaphore_16__enter__(struct __pyx_obj_6gevent_11__semaphore_Semaphore *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__enter__", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6gevent_11__semaphore_9Semaphore___enter__(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 141, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__semaphore.Semaphore.__enter__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_semaphore.py":144 + * self.acquire() + * + * def __exit__(self, t, v, tb): # <<<<<<<<<<<<<< + * self.release() + * + */ + +static PyObject *__pyx_pw_6gevent_11__semaphore_9Semaphore_19__exit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_6gevent_11__semaphore_9Semaphore___exit__(struct __pyx_obj_6gevent_11__semaphore_Semaphore *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_t, CYTHON_UNUSED PyObject *__pyx_v_v, CYTHON_UNUSED PyObject *__pyx_v_tb, int __pyx_skip_dispatch) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + __Pyx_RefNannySetupContext("__exit__", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0; + if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self)))))); + else { + PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + #endif + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_exit); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 144, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_11__semaphore_9Semaphore_19__exit__)) { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; + __pyx_t_5 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_5 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_3)) { + PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_t, __pyx_v_v, __pyx_v_tb}; + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 144, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GOTREF(__pyx_t_2); + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { + PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_t, __pyx_v_v, __pyx_v_tb}; + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 144, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GOTREF(__pyx_t_2); + } else + #endif + { + __pyx_t_6 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 144, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (__pyx_t_4) { + __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL; + } + __Pyx_INCREF(__pyx_v_t); + __Pyx_GIVEREF(__pyx_v_t); + PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_t); + __Pyx_INCREF(__pyx_v_v); + __Pyx_GIVEREF(__pyx_v_v); + PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_v); + __Pyx_INCREF(__pyx_v_tb); + __Pyx_GIVEREF(__pyx_v_tb); + PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_v_tb); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 144, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0; + if (unlikely(type_dict_guard != tp_dict_version)) { + tp_dict_version = obj_dict_version = 0; + } + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + } + #endif + } + + /* "src/gevent/_semaphore.py":145 + * + * def __exit__(self, t, v, tb): + * self.release() # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_5 = ((struct __pyx_vtabstruct_6gevent_11__semaphore_Semaphore *)__pyx_v_self->__pyx_base.__pyx_vtab)->release(__pyx_v_self, 0); if (unlikely(__pyx_t_5 == ((int)-1000))) __PYX_ERR(0, 145, __pyx_L1_error) + + /* "src/gevent/_semaphore.py":144 + * self.acquire() + * + * def __exit__(self, t, v, tb): # <<<<<<<<<<<<<< + * self.release() + * + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("gevent.__semaphore.Semaphore.__exit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_11__semaphore_9Semaphore_19__exit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6gevent_11__semaphore_9Semaphore_18__exit__[] = "Semaphore.__exit__(self, t, v, tb)"; +static PyMethodDef __pyx_mdef_6gevent_11__semaphore_9Semaphore_19__exit__ = {"__exit__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_11__semaphore_9Semaphore_19__exit__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_11__semaphore_9Semaphore_18__exit__}; +static PyObject *__pyx_pw_6gevent_11__semaphore_9Semaphore_19__exit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_t = 0; + PyObject *__pyx_v_v = 0; + PyObject *__pyx_v_tb = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__exit__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_t,&__pyx_n_s_v,&__pyx_n_s_tb,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_v)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, 1); __PYX_ERR(0, 144, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tb)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, 2); __PYX_ERR(0, 144, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__exit__") < 0)) __PYX_ERR(0, 144, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + } + __pyx_v_t = values[0]; + __pyx_v_v = values[1]; + __pyx_v_tb = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 144, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.__semaphore.Semaphore.__exit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_11__semaphore_9Semaphore_18__exit__(((struct __pyx_obj_6gevent_11__semaphore_Semaphore *)__pyx_v_self), __pyx_v_t, __pyx_v_v, __pyx_v_tb); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_11__semaphore_9Semaphore_18__exit__(struct __pyx_obj_6gevent_11__semaphore_Semaphore *__pyx_v_self, PyObject *__pyx_v_t, PyObject *__pyx_v_v, PyObject *__pyx_v_tb) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__exit__", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6gevent_11__semaphore_9Semaphore___exit__(__pyx_v_self, __pyx_v_t, __pyx_v_v, __pyx_v_tb, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 144, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__semaphore.Semaphore.__exit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/__semaphore.pxd":8 + * + * cdef class Semaphore(AbstractLinkable): + * cdef public int counter # <<<<<<<<<<<<<< + * + * cpdef bint locked(self) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_11__semaphore_9Semaphore_7counter_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_11__semaphore_9Semaphore_7counter_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_11__semaphore_9Semaphore_7counter___get__(((struct __pyx_obj_6gevent_11__semaphore_Semaphore *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_11__semaphore_9Semaphore_7counter___get__(struct __pyx_obj_6gevent_11__semaphore_Semaphore *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->counter); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 8, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__semaphore.Semaphore.counter.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6gevent_11__semaphore_9Semaphore_7counter_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6gevent_11__semaphore_9Semaphore_7counter_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_11__semaphore_9Semaphore_7counter_2__set__(((struct __pyx_obj_6gevent_11__semaphore_Semaphore *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_11__semaphore_9Semaphore_7counter_2__set__(struct __pyx_obj_6gevent_11__semaphore_Semaphore *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("__set__", 0); + __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 8, __pyx_L1_error) + __pyx_v_self->counter = __pyx_t_1; + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("gevent.__semaphore.Semaphore.counter.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_semaphore.py":164 + * _OVER_RELEASE_ERROR = ValueError + * + * def __init__(self, *args, **kwargs): # <<<<<<<<<<<<<< + * Semaphore.__init__(self, *args, **kwargs) + * self._initial_value = self.counter + */ + +/* Python wrapper */ +static int __pyx_pw_6gevent_11__semaphore_16BoundedSemaphore_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6gevent_11__semaphore_16BoundedSemaphore_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_args = 0; + PyObject *__pyx_v_kwargs = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 1))) return -1; + if (unlikely(__pyx_kwds)) { + __pyx_v_kwargs = PyDict_Copy(__pyx_kwds); if (unlikely(!__pyx_v_kwargs)) return -1; + __Pyx_GOTREF(__pyx_v_kwargs); + } else { + __pyx_v_kwargs = NULL; + } + __Pyx_INCREF(__pyx_args); + __pyx_v_args = __pyx_args; + __pyx_r = __pyx_pf_6gevent_11__semaphore_16BoundedSemaphore___init__(((struct __pyx_obj_6gevent_11__semaphore_BoundedSemaphore *)__pyx_v_self), __pyx_v_args, __pyx_v_kwargs); + + /* function exit code */ + __Pyx_XDECREF(__pyx_v_args); + __Pyx_XDECREF(__pyx_v_kwargs); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_11__semaphore_16BoundedSemaphore___init__(struct __pyx_obj_6gevent_11__semaphore_BoundedSemaphore *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "src/gevent/_semaphore.py":165 + * + * def __init__(self, *args, **kwargs): + * Semaphore.__init__(self, *args, **kwargs) # <<<<<<<<<<<<<< + * self._initial_value = self.counter + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_6gevent_11__semaphore_Semaphore), __pyx_n_s_init); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 165, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 165, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self)); + __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_v_args); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 165, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 165, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/_semaphore.py":166 + * def __init__(self, *args, **kwargs): + * Semaphore.__init__(self, *args, **kwargs) + * self._initial_value = self.counter # <<<<<<<<<<<<<< + * + * def release(self): + */ + __pyx_t_4 = __pyx_v_self->__pyx_base.counter; + __pyx_v_self->_initial_value = __pyx_t_4; + + /* "src/gevent/_semaphore.py":164 + * _OVER_RELEASE_ERROR = ValueError + * + * def __init__(self, *args, **kwargs): # <<<<<<<<<<<<<< + * Semaphore.__init__(self, *args, **kwargs) + * self._initial_value = self.counter + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("gevent.__semaphore.BoundedSemaphore.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_semaphore.py":168 + * self._initial_value = self.counter + * + * def release(self): # <<<<<<<<<<<<<< + * if self.counter >= self._initial_value: + * raise self._OVER_RELEASE_ERROR("Semaphore released too many times") + */ + +static PyObject *__pyx_pw_6gevent_11__semaphore_16BoundedSemaphore_3release(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static int __pyx_f_6gevent_11__semaphore_16BoundedSemaphore_release(struct __pyx_obj_6gevent_11__semaphore_BoundedSemaphore *__pyx_v_self, int __pyx_skip_dispatch) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + int __pyx_t_6; + __Pyx_RefNannySetupContext("release", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0; + if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self)))))); + else { + PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + #endif + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_release); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 168, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_11__semaphore_16BoundedSemaphore_3release)) { + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 168, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 168, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_5; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0; + if (unlikely(type_dict_guard != tp_dict_version)) { + tp_dict_version = obj_dict_version = 0; + } + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + } + #endif + } + + /* "src/gevent/_semaphore.py":169 + * + * def release(self): + * if self.counter >= self._initial_value: # <<<<<<<<<<<<<< + * raise self._OVER_RELEASE_ERROR("Semaphore released too many times") + * Semaphore.release(self) + */ + __pyx_t_6 = ((__pyx_v_self->__pyx_base.counter >= __pyx_v_self->_initial_value) != 0); + if (unlikely(__pyx_t_6)) { + + /* "src/gevent/_semaphore.py":170 + * def release(self): + * if self.counter >= self._initial_value: + * raise self._OVER_RELEASE_ERROR("Semaphore released too many times") # <<<<<<<<<<<<<< + * Semaphore.release(self) + * + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_OVER_RELEASE_ERROR); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 170, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_kp_s_Semaphore_released_too_many_time) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_kp_s_Semaphore_released_too_many_time); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 170, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 170, __pyx_L1_error) + + /* "src/gevent/_semaphore.py":169 + * + * def release(self): + * if self.counter >= self._initial_value: # <<<<<<<<<<<<<< + * raise self._OVER_RELEASE_ERROR("Semaphore released too many times") + * Semaphore.release(self) + */ + } + + /* "src/gevent/_semaphore.py":171 + * if self.counter >= self._initial_value: + * raise self._OVER_RELEASE_ERROR("Semaphore released too many times") + * Semaphore.release(self) # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_5 = __pyx_f_6gevent_11__semaphore_9Semaphore_release(((struct __pyx_obj_6gevent_11__semaphore_Semaphore *)__pyx_v_self), 1); if (unlikely(__pyx_t_5 == ((int)-1000))) __PYX_ERR(0, 171, __pyx_L1_error) + + /* "src/gevent/_semaphore.py":168 + * self._initial_value = self.counter + * + * def release(self): # <<<<<<<<<<<<<< + * if self.counter >= self._initial_value: + * raise self._OVER_RELEASE_ERROR("Semaphore released too many times") + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("gevent.__semaphore.BoundedSemaphore.release", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1000; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_11__semaphore_16BoundedSemaphore_3release(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6gevent_11__semaphore_16BoundedSemaphore_2release[] = "BoundedSemaphore.release(self) -> int"; +static PyMethodDef __pyx_mdef_6gevent_11__semaphore_16BoundedSemaphore_3release = {"release", (PyCFunction)__pyx_pw_6gevent_11__semaphore_16BoundedSemaphore_3release, METH_NOARGS, __pyx_doc_6gevent_11__semaphore_16BoundedSemaphore_2release}; +static PyObject *__pyx_pw_6gevent_11__semaphore_16BoundedSemaphore_3release(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("release (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_11__semaphore_16BoundedSemaphore_2release(((struct __pyx_obj_6gevent_11__semaphore_BoundedSemaphore *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_11__semaphore_16BoundedSemaphore_2release(struct __pyx_obj_6gevent_11__semaphore_BoundedSemaphore *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("release", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6gevent_11__semaphore_16BoundedSemaphore_release(__pyx_v_self, 1); if (unlikely(__pyx_t_1 == ((int)-1000))) __PYX_ERR(0, 168, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 168, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent.__semaphore.BoundedSemaphore.release", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/__semaphore.pxd":21 + * + * cdef class BoundedSemaphore(Semaphore): + * cdef readonly int _initial_value # <<<<<<<<<<<<<< + * + * cpdef int release(self) except -1000 + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_11__semaphore_16BoundedSemaphore_14_initial_value_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_11__semaphore_16BoundedSemaphore_14_initial_value_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_11__semaphore_16BoundedSemaphore_14_initial_value___get__(((struct __pyx_obj_6gevent_11__semaphore_BoundedSemaphore *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_11__semaphore_16BoundedSemaphore_14_initial_value___get__(struct __pyx_obj_6gevent_11__semaphore_BoundedSemaphore *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->_initial_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 21, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__semaphore.BoundedSemaphore._initial_value.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/__greenlet_primitives.pxd":23 + * + * @cython.final + * cdef inline greenlet getcurrent(): # <<<<<<<<<<<<<< + * return PyGreenlet_GetCurrent() + * + */ + +static CYTHON_INLINE PyGreenlet *__pyx_f_6gevent_21__greenlet_primitives_getcurrent(void) { + PyGreenlet *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("getcurrent", 0); + + /* "gevent/__greenlet_primitives.pxd":24 + * @cython.final + * cdef inline greenlet getcurrent(): + * return PyGreenlet_GetCurrent() # <<<<<<<<<<<<<< + * + * cdef bint _greenlet_imported + */ + __Pyx_XDECREF(((PyObject *)__pyx_r)); + __pyx_t_1 = ((PyObject *)PyGreenlet_GetCurrent()); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 24, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = ((PyGreenlet *)__pyx_t_1); + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "gevent/__greenlet_primitives.pxd":23 + * + * @cython.final + * cdef inline greenlet getcurrent(): # <<<<<<<<<<<<<< + * return PyGreenlet_GetCurrent() + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__greenlet_primitives.getcurrent", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF((PyObject *)__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/__greenlet_primitives.pxd":28 + * cdef bint _greenlet_imported + * + * cdef inline void greenlet_init(): # <<<<<<<<<<<<<< + * global _greenlet_imported + * if not _greenlet_imported: + */ + +static CYTHON_INLINE void __pyx_f_6gevent_21__greenlet_primitives_greenlet_init(void) { + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("greenlet_init", 0); + + /* "gevent/__greenlet_primitives.pxd":30 + * cdef inline void greenlet_init(): + * global _greenlet_imported + * if not _greenlet_imported: # <<<<<<<<<<<<<< + * PyGreenlet_Import() + * _greenlet_imported = True + */ + __pyx_t_1 = ((!(__pyx_v_6gevent_21__greenlet_primitives__greenlet_imported != 0)) != 0); + if (__pyx_t_1) { + + /* "gevent/__greenlet_primitives.pxd":31 + * global _greenlet_imported + * if not _greenlet_imported: + * PyGreenlet_Import() # <<<<<<<<<<<<<< + * _greenlet_imported = True + * + */ + PyGreenlet_Import(); + + /* "gevent/__greenlet_primitives.pxd":32 + * if not _greenlet_imported: + * PyGreenlet_Import() + * _greenlet_imported = True # <<<<<<<<<<<<<< + * + * cdef inline object _greenlet_switch(greenlet self): + */ + __pyx_v_6gevent_21__greenlet_primitives__greenlet_imported = 1; + + /* "gevent/__greenlet_primitives.pxd":30 + * cdef inline void greenlet_init(): + * global _greenlet_imported + * if not _greenlet_imported: # <<<<<<<<<<<<<< + * PyGreenlet_Import() + * _greenlet_imported = True + */ + } + + /* "gevent/__greenlet_primitives.pxd":28 + * cdef bint _greenlet_imported + * + * cdef inline void greenlet_init(): # <<<<<<<<<<<<<< + * global _greenlet_imported + * if not _greenlet_imported: + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "gevent/__greenlet_primitives.pxd":34 + * _greenlet_imported = True + * + * cdef inline object _greenlet_switch(greenlet self): # <<<<<<<<<<<<<< + * return PyGreenlet_Switch(self, NULL, NULL) + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_6gevent_21__greenlet_primitives__greenlet_switch(PyGreenlet *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("_greenlet_switch", 0); + + /* "gevent/__greenlet_primitives.pxd":35 + * + * cdef inline object _greenlet_switch(greenlet self): + * return PyGreenlet_Switch(self, NULL, NULL) # <<<<<<<<<<<<<< + * + * cdef class TrackedRawGreenlet(greenlet): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyGreenlet_Switch(__pyx_v_self, NULL, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 35, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "gevent/__greenlet_primitives.pxd":34 + * _greenlet_imported = True + * + * cdef inline object _greenlet_switch(greenlet self): # <<<<<<<<<<<<<< + * return PyGreenlet_Switch(self, NULL, NULL) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__greenlet_primitives._greenlet_switch", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/__abstract_linkable.pxd":21 + * void PyGreenlet_Import() + * + * cdef inline greenlet getcurrent(): # <<<<<<<<<<<<<< + * return PyGreenlet_GetCurrent() + * + */ + +static CYTHON_INLINE PyGreenlet *__pyx_f_6gevent_19__abstract_linkable_getcurrent(void) { + PyGreenlet *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("getcurrent", 0); + + /* "gevent/__abstract_linkable.pxd":22 + * + * cdef inline greenlet getcurrent(): + * return PyGreenlet_GetCurrent() # <<<<<<<<<<<<<< + * + * cdef inline void greenlet_init(): + */ + __Pyx_XDECREF(((PyObject *)__pyx_r)); + __pyx_t_1 = ((PyObject *)PyGreenlet_GetCurrent()); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 22, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = ((PyGreenlet *)__pyx_t_1); + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "gevent/__abstract_linkable.pxd":21 + * void PyGreenlet_Import() + * + * cdef inline greenlet getcurrent(): # <<<<<<<<<<<<<< + * return PyGreenlet_GetCurrent() + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__abstract_linkable.getcurrent", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF((PyObject *)__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/__abstract_linkable.pxd":24 + * return PyGreenlet_GetCurrent() + * + * cdef inline void greenlet_init(): # <<<<<<<<<<<<<< + * global _greenlet_imported + * if not _greenlet_imported: + */ + +static CYTHON_INLINE void __pyx_f_6gevent_19__abstract_linkable_greenlet_init(void) { + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("greenlet_init", 0); + + /* "gevent/__abstract_linkable.pxd":26 + * cdef inline void greenlet_init(): + * global _greenlet_imported + * if not _greenlet_imported: # <<<<<<<<<<<<<< + * PyGreenlet_Import() + * _greenlet_imported = True + */ + __pyx_t_1 = ((!(__pyx_v_6gevent_19__abstract_linkable__greenlet_imported != 0)) != 0); + if (__pyx_t_1) { + + /* "gevent/__abstract_linkable.pxd":27 + * global _greenlet_imported + * if not _greenlet_imported: + * PyGreenlet_Import() # <<<<<<<<<<<<<< + * _greenlet_imported = True + * + */ + PyGreenlet_Import(); + + /* "gevent/__abstract_linkable.pxd":28 + * if not _greenlet_imported: + * PyGreenlet_Import() + * _greenlet_imported = True # <<<<<<<<<<<<<< + * + * cdef void _init() + */ + __pyx_v_6gevent_19__abstract_linkable__greenlet_imported = 1; + + /* "gevent/__abstract_linkable.pxd":26 + * cdef inline void greenlet_init(): + * global _greenlet_imported + * if not _greenlet_imported: # <<<<<<<<<<<<<< + * PyGreenlet_Import() + * _greenlet_imported = True + */ + } + + /* "gevent/__abstract_linkable.pxd":24 + * return PyGreenlet_GetCurrent() + * + * cdef inline void greenlet_init(): # <<<<<<<<<<<<<< + * global _greenlet_imported + * if not _greenlet_imported: + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} +static struct __pyx_vtabstruct_6gevent_11__semaphore_Semaphore __pyx_vtable_6gevent_11__semaphore_Semaphore; + +static PyObject *__pyx_tp_new_6gevent_11__semaphore_Semaphore(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_6gevent_11__semaphore_Semaphore *p; + PyObject *o = __pyx_ptype_6gevent_19__abstract_linkable_AbstractLinkable->tp_new(t, a, k); + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_6gevent_11__semaphore_Semaphore *)o); + p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_6gevent_19__abstract_linkable_AbstractLinkable*)__pyx_vtabptr_6gevent_11__semaphore_Semaphore; + return o; +} + +static void __pyx_tp_dealloc_6gevent_11__semaphore_Semaphore(PyObject *o) { + #if CYTHON_USE_TP_FINALIZE + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + PyObject_GC_UnTrack(o); + PyObject_GC_Track(o); + if (likely(__pyx_ptype_6gevent_19__abstract_linkable_AbstractLinkable)) __pyx_ptype_6gevent_19__abstract_linkable_AbstractLinkable->tp_dealloc(o); else __Pyx_call_next_tp_dealloc(o, __pyx_tp_dealloc_6gevent_11__semaphore_Semaphore); +} + +static int __pyx_tp_traverse_6gevent_11__semaphore_Semaphore(PyObject *o, visitproc v, void *a) { + int e; + e = ((likely(__pyx_ptype_6gevent_19__abstract_linkable_AbstractLinkable)) ? ((__pyx_ptype_6gevent_19__abstract_linkable_AbstractLinkable->tp_traverse) ? __pyx_ptype_6gevent_19__abstract_linkable_AbstractLinkable->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_6gevent_11__semaphore_Semaphore)); if (e) return e; + return 0; +} + +static int __pyx_tp_clear_6gevent_11__semaphore_Semaphore(PyObject *o) { + if (likely(__pyx_ptype_6gevent_19__abstract_linkable_AbstractLinkable)) { if (__pyx_ptype_6gevent_19__abstract_linkable_AbstractLinkable->tp_clear) __pyx_ptype_6gevent_19__abstract_linkable_AbstractLinkable->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_6gevent_11__semaphore_Semaphore); + return 0; +} + +static PyObject *__pyx_getprop_6gevent_11__semaphore_9Semaphore_counter(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_11__semaphore_9Semaphore_7counter_1__get__(o); +} + +static int __pyx_setprop_6gevent_11__semaphore_9Semaphore_counter(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6gevent_11__semaphore_9Semaphore_7counter_3__set__(o, v); + } + else { + PyErr_SetString(PyExc_NotImplementedError, "__del__"); + return -1; + } +} + +static PyMethodDef __pyx_methods_6gevent_11__semaphore_Semaphore[] = { + {0, 0, 0, 0} +}; + +static struct PyGetSetDef __pyx_getsets_6gevent_11__semaphore_Semaphore[] = { + {(char *)"counter", __pyx_getprop_6gevent_11__semaphore_9Semaphore_counter, __pyx_setprop_6gevent_11__semaphore_9Semaphore_counter, (char *)"counter: 'int'", 0}, + {0, 0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_6gevent_11__semaphore_Semaphore = { + PyVarObject_HEAD_INIT(0, 0) + "gevent.__semaphore.Semaphore", /*tp_name*/ + sizeof(struct __pyx_obj_6gevent_11__semaphore_Semaphore), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6gevent_11__semaphore_Semaphore, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + __pyx_pw_6gevent_11__semaphore_9Semaphore_3__str__, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + "Semaphore(value=1)\n\n Semaphore(value=1) -> Semaphore\n\n A semaphore manages a counter representing the number of release()\n calls minus the number of acquire() calls, plus an initial value.\n The acquire() method blocks if necessary until it can return\n without making the counter negative.\n\n If not given, ``value`` defaults to 1.\n\n The semaphore is a context manager and can be used in ``with`` statements.\n\n This Semaphore's ``__exit__`` method does not call the trace function\n on CPython, but does under PyPy.\n\n .. seealso:: :class:`BoundedSemaphore` for a safer version that prevents\n some classes of bugs.\n\n .. versionchanged:: 1.4.0\n\n The order in which waiters are awakened is not specified. It was not\n specified previously, but usually went in FIFO order.\n ", /*tp_doc*/ + __pyx_tp_traverse_6gevent_11__semaphore_Semaphore, /*tp_traverse*/ + __pyx_tp_clear_6gevent_11__semaphore_Semaphore, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6gevent_11__semaphore_Semaphore, /*tp_methods*/ + 0, /*tp_members*/ + __pyx_getsets_6gevent_11__semaphore_Semaphore, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_pw_6gevent_11__semaphore_9Semaphore_1__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6gevent_11__semaphore_Semaphore, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; +static struct __pyx_vtabstruct_6gevent_11__semaphore_BoundedSemaphore __pyx_vtable_6gevent_11__semaphore_BoundedSemaphore; + +static PyObject *__pyx_tp_new_6gevent_11__semaphore_BoundedSemaphore(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_6gevent_11__semaphore_BoundedSemaphore *p; + PyObject *o = __pyx_tp_new_6gevent_11__semaphore_Semaphore(t, a, k); + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_6gevent_11__semaphore_BoundedSemaphore *)o); + p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_6gevent_19__abstract_linkable_AbstractLinkable*)__pyx_vtabptr_6gevent_11__semaphore_BoundedSemaphore; + return o; +} + +static PyObject *__pyx_getprop_6gevent_11__semaphore_16BoundedSemaphore__initial_value(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_11__semaphore_16BoundedSemaphore_14_initial_value_1__get__(o); +} + +static PyMethodDef __pyx_methods_6gevent_11__semaphore_BoundedSemaphore[] = { + {0, 0, 0, 0} +}; + +static struct PyGetSetDef __pyx_getsets_6gevent_11__semaphore_BoundedSemaphore[] = { + {(char *)"_initial_value", __pyx_getprop_6gevent_11__semaphore_16BoundedSemaphore__initial_value, 0, (char *)0, 0}, + {0, 0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_6gevent_11__semaphore_BoundedSemaphore = { + PyVarObject_HEAD_INIT(0, 0) + "gevent.__semaphore.BoundedSemaphore", /*tp_name*/ + sizeof(struct __pyx_obj_6gevent_11__semaphore_BoundedSemaphore), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6gevent_11__semaphore_Semaphore, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_6gevent_11__semaphore_9Semaphore_3__str__, /*tp_str*/ + #else + 0, /*tp_str*/ + #endif + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + "BoundedSemaphore(*args, **kwargs)\n\n BoundedSemaphore(value=1) -> BoundedSemaphore\n\n A bounded semaphore checks to make sure its current value doesn't\n exceed its initial value. If it does, :class:`ValueError` is\n raised. In most situations semaphores are used to guard resources\n with limited capacity. If the semaphore is released too many times\n it's a sign of a bug.\n\n If not given, *value* defaults to 1.\n ", /*tp_doc*/ + __pyx_tp_traverse_6gevent_11__semaphore_Semaphore, /*tp_traverse*/ + __pyx_tp_clear_6gevent_11__semaphore_Semaphore, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6gevent_11__semaphore_BoundedSemaphore, /*tp_methods*/ + 0, /*tp_members*/ + __pyx_getsets_6gevent_11__semaphore_BoundedSemaphore, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_pw_6gevent_11__semaphore_16BoundedSemaphore_1__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6gevent_11__semaphore_BoundedSemaphore, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static PyMethodDef __pyx_methods[] = { + {0, 0, 0, 0} +}; + +#if PY_MAJOR_VERSION >= 3 +#if CYTHON_PEP489_MULTI_PHASE_INIT +static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ +static int __pyx_pymod_exec___semaphore(PyObject* module); /*proto*/ +static PyModuleDef_Slot __pyx_moduledef_slots[] = { + {Py_mod_create, (void*)__pyx_pymod_create}, + {Py_mod_exec, (void*)__pyx_pymod_exec___semaphore}, + {0, NULL} +}; +#endif + +static struct PyModuleDef __pyx_moduledef = { + PyModuleDef_HEAD_INIT, + "__semaphore", + 0, /* m_doc */ + #if CYTHON_PEP489_MULTI_PHASE_INIT + 0, /* m_size */ + #else + -1, /* m_size */ + #endif + __pyx_methods /* m_methods */, + #if CYTHON_PEP489_MULTI_PHASE_INIT + __pyx_moduledef_slots, /* m_slots */ + #else + NULL, /* m_reload */ + #endif + NULL, /* m_traverse */ + NULL, /* m_clear */ + NULL /* m_free */ +}; +#endif +#ifndef CYTHON_SMALL_CODE +#if defined(__clang__) + #define CYTHON_SMALL_CODE +#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) + #define CYTHON_SMALL_CODE __attribute__((cold)) +#else + #define CYTHON_SMALL_CODE +#endif +#endif + +static __Pyx_StringTabEntry __pyx_string_tab[] = { + {&__pyx_n_s_AbstractLinkable, __pyx_k_AbstractLinkable, sizeof(__pyx_k_AbstractLinkable), 0, 0, 1, 1}, + {&__pyx_n_s_BoundedSemaphore, __pyx_k_BoundedSemaphore, sizeof(__pyx_k_BoundedSemaphore), 0, 0, 1, 1}, + {&__pyx_n_s_BoundedSemaphore_release, __pyx_k_BoundedSemaphore_release, sizeof(__pyx_k_BoundedSemaphore_release), 0, 0, 1, 1}, + {&__pyx_n_s_OVER_RELEASE_ERROR, __pyx_k_OVER_RELEASE_ERROR, sizeof(__pyx_k_OVER_RELEASE_ERROR), 0, 0, 1, 1}, + {&__pyx_n_s_Semaphore, __pyx_k_Semaphore, sizeof(__pyx_k_Semaphore), 0, 0, 1, 1}, + {&__pyx_n_s_Semaphore___enter, __pyx_k_Semaphore___enter, sizeof(__pyx_k_Semaphore___enter), 0, 0, 1, 1}, + {&__pyx_n_s_Semaphore___exit, __pyx_k_Semaphore___exit, sizeof(__pyx_k_Semaphore___exit), 0, 0, 1, 1}, + {&__pyx_n_s_Semaphore__start_notify, __pyx_k_Semaphore__start_notify, sizeof(__pyx_k_Semaphore__start_notify), 0, 0, 1, 1}, + {&__pyx_n_s_Semaphore_acquire, __pyx_k_Semaphore_acquire, sizeof(__pyx_k_Semaphore_acquire), 0, 0, 1, 1}, + {&__pyx_n_s_Semaphore_locked, __pyx_k_Semaphore_locked, sizeof(__pyx_k_Semaphore_locked), 0, 0, 1, 1}, + {&__pyx_n_s_Semaphore_ready, __pyx_k_Semaphore_ready, sizeof(__pyx_k_Semaphore_ready), 0, 0, 1, 1}, + {&__pyx_n_s_Semaphore_release, __pyx_k_Semaphore_release, sizeof(__pyx_k_Semaphore_release), 0, 0, 1, 1}, + {&__pyx_kp_s_Semaphore_released_too_many_time, __pyx_k_Semaphore_released_too_many_time, sizeof(__pyx_k_Semaphore_released_too_many_time), 0, 0, 1, 0}, + {&__pyx_n_s_Semaphore_wait, __pyx_k_Semaphore_wait, sizeof(__pyx_k_Semaphore_wait), 0, 0, 1, 1}, + {&__pyx_n_s_Timeout, __pyx_k_Timeout, sizeof(__pyx_k_Timeout), 0, 0, 1, 1}, + {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1}, + {&__pyx_n_s_abstract_linkable, __pyx_k_abstract_linkable, sizeof(__pyx_k_abstract_linkable), 0, 0, 1, 1}, + {&__pyx_n_s_acquire, __pyx_k_acquire, sizeof(__pyx_k_acquire), 0, 0, 1, 1}, + {&__pyx_n_s_all, __pyx_k_all, sizeof(__pyx_k_all), 0, 0, 1, 1}, + {&__pyx_n_s_blocking, __pyx_k_blocking, sizeof(__pyx_k_blocking), 0, 0, 1, 1}, + {&__pyx_n_s_class, __pyx_k_class, sizeof(__pyx_k_class), 0, 0, 1, 1}, + {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, + {&__pyx_n_s_enter, __pyx_k_enter, sizeof(__pyx_k_enter), 0, 0, 1, 1}, + {&__pyx_n_s_exit, __pyx_k_exit, sizeof(__pyx_k_exit), 0, 0, 1, 1}, + {&__pyx_n_s_get_linkable, __pyx_k_get_linkable, sizeof(__pyx_k_get_linkable), 0, 0, 1, 1}, + {&__pyx_n_s_gevent___semaphore, __pyx_k_gevent___semaphore, sizeof(__pyx_k_gevent___semaphore), 0, 0, 1, 1}, + {&__pyx_kp_s_gevent__abstract_linkable, __pyx_k_gevent__abstract_linkable, sizeof(__pyx_k_gevent__abstract_linkable), 0, 0, 1, 0}, + {&__pyx_n_s_gevent__util, __pyx_k_gevent__util, sizeof(__pyx_k_gevent__util), 0, 0, 1, 1}, + {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, + {&__pyx_n_s_import_c_accel, __pyx_k_import_c_accel, sizeof(__pyx_k_import_c_accel), 0, 0, 1, 1}, + {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1}, + {&__pyx_n_s_linkcount, __pyx_k_linkcount, sizeof(__pyx_k_linkcount), 0, 0, 1, 1}, + {&__pyx_n_s_locked, __pyx_k_locked, sizeof(__pyx_k_locked), 0, 0, 1, 1}, + {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, + {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, + {&__pyx_n_s_py3k_acquire, __pyx_k_py3k_acquire, sizeof(__pyx_k_py3k_acquire), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_capi, __pyx_k_pyx_capi, sizeof(__pyx_k_pyx_capi), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1}, + {&__pyx_n_s_ready, __pyx_k_ready, sizeof(__pyx_k_ready), 0, 0, 1, 1}, + {&__pyx_n_s_release, __pyx_k_release, sizeof(__pyx_k_release), 0, 0, 1, 1}, + {&__pyx_kp_s_s_counter_s__links_s, __pyx_k_s_counter_s__links_s, sizeof(__pyx_k_s_counter_s__links_s), 0, 0, 1, 0}, + {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1}, + {&__pyx_kp_s_semaphore_initial_value_must_be, __pyx_k_semaphore_initial_value_must_be, sizeof(__pyx_k_semaphore_initial_value_must_be), 0, 0, 1, 0}, + {&__pyx_kp_s_src_gevent__semaphore_py, __pyx_k_src_gevent__semaphore_py, sizeof(__pyx_k_src_gevent__semaphore_py), 0, 0, 1, 0}, + {&__pyx_n_s_start_notify, __pyx_k_start_notify, sizeof(__pyx_k_start_notify), 0, 0, 1, 1}, + {&__pyx_n_s_super, __pyx_k_super, sizeof(__pyx_k_super), 0, 0, 1, 1}, + {&__pyx_n_s_t, __pyx_k_t, sizeof(__pyx_k_t), 0, 0, 1, 1}, + {&__pyx_n_s_tb, __pyx_k_tb, sizeof(__pyx_k_tb), 0, 0, 1, 1}, + {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, + {&__pyx_n_s_timeout, __pyx_k_timeout, sizeof(__pyx_k_timeout), 0, 0, 1, 1}, + {&__pyx_n_s_v, __pyx_k_v, sizeof(__pyx_k_v), 0, 0, 1, 1}, + {&__pyx_n_s_value, __pyx_k_value, sizeof(__pyx_k_value), 0, 0, 1, 1}, + {&__pyx_n_s_wait, __pyx_k_wait, sizeof(__pyx_k_wait), 0, 0, 1, 1}, + {&__pyx_n_s_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 0, 1, 1}, + {0, 0, 0, 0, 0, 0, 0} +}; +static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { + __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 162, __pyx_L1_error) + __pyx_builtin___import__ = __Pyx_GetBuiltinName(__pyx_n_s_import); if (!__pyx_builtin___import__) __PYX_ERR(0, 10, __pyx_L1_error) + __pyx_builtin_super = __Pyx_GetBuiltinName(__pyx_n_s_super); if (!__pyx_builtin_super) __PYX_ERR(0, 44, __pyx_L1_error) + return 0; + __pyx_L1_error:; + return -1; +} + +static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); + + /* "src/gevent/_semaphore.py":10 + * + * def _get_linkable(): + * x = __import__('gevent._abstract_linkable') # <<<<<<<<<<<<<< + * return x._abstract_linkable.AbstractLinkable + * locals()['AbstractLinkable'] = _get_linkable() + */ + __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_gevent__abstract_linkable); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple_); + __Pyx_GIVEREF(__pyx_tuple_); + + /* "src/gevent/_semaphore.py":43 + * def __init__(self, value=1): + * if value < 0: + * raise ValueError("semaphore initial value must be >= 0") # <<<<<<<<<<<<<< + * super(Semaphore, self).__init__() + * self.counter = value + */ + __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_semaphore_initial_value_must_be); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 43, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2); + __Pyx_GIVEREF(__pyx_tuple__2); + + /* "src/gevent/_semaphore.py":9 + * ] + * + * def _get_linkable(): # <<<<<<<<<<<<<< + * x = __import__('gevent._abstract_linkable') + * return x._abstract_linkable.AbstractLinkable + */ + __pyx_tuple__3 = PyTuple_Pack(1, __pyx_n_s_x); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 9, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__3); + __Pyx_GIVEREF(__pyx_tuple__3); + __pyx_codeobj__4 = (PyObject*)__Pyx_PyCode_New(0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__3, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__semaphore_py, __pyx_n_s_get_linkable, 9, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__4)) __PYX_ERR(0, 9, __pyx_L1_error) + + /* "src/gevent/_semaphore.py":52 + * return '<%s counter=%s _links[%s]>' % params + * + * def locked(self): # <<<<<<<<<<<<<< + * """Return a boolean indicating whether the semaphore can be acquired. + * Most useful with binary semaphores.""" + */ + __pyx_tuple__5 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 52, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__5); + __Pyx_GIVEREF(__pyx_tuple__5); + __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__5, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__semaphore_py, __pyx_n_s_locked, 52, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__6)) __PYX_ERR(0, 52, __pyx_L1_error) + + /* "src/gevent/_semaphore.py":57 + * return self.counter <= 0 + * + * def release(self): # <<<<<<<<<<<<<< + * """ + * Release the semaphore, notifying any waiters if needed. + */ + __pyx_tuple__7 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 57, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__7); + __Pyx_GIVEREF(__pyx_tuple__7); + __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__semaphore_py, __pyx_n_s_release, 57, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) __PYX_ERR(0, 57, __pyx_L1_error) + + /* "src/gevent/_semaphore.py":65 + * return self.counter + * + * def ready(self): # <<<<<<<<<<<<<< + * return self.counter > 0 + * + */ + __pyx_tuple__9 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 65, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__9); + __Pyx_GIVEREF(__pyx_tuple__9); + __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__9, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__semaphore_py, __pyx_n_s_ready, 65, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__10)) __PYX_ERR(0, 65, __pyx_L1_error) + + /* "src/gevent/_semaphore.py":68 + * return self.counter > 0 + * + * def _start_notify(self): # <<<<<<<<<<<<<< + * self._check_and_notify() + * + */ + __pyx_tuple__11 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 68, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__11); + __Pyx_GIVEREF(__pyx_tuple__11); + __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__11, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__semaphore_py, __pyx_n_s_start_notify, 68, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(0, 68, __pyx_L1_error) + + /* "src/gevent/_semaphore.py":79 + * return True + * + * def wait(self, timeout=None): # <<<<<<<<<<<<<< + * """ + * wait(timeout=None) -> int + */ + __pyx_tuple__13 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_timeout); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 79, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__13); + __Pyx_GIVEREF(__pyx_tuple__13); + __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__13, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__semaphore_py, __pyx_n_s_wait, 79, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__14)) __PYX_ERR(0, 79, __pyx_L1_error) + + /* "src/gevent/_semaphore.py":100 + * return self.counter + * + * def acquire(self, blocking=True, timeout=None): # <<<<<<<<<<<<<< + * """ + * acquire(blocking=True, timeout=None) -> bool + */ + __pyx_tuple__15 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_blocking, __pyx_n_s_timeout); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(0, 100, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__15); + __Pyx_GIVEREF(__pyx_tuple__15); + __pyx_codeobj__16 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__15, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__semaphore_py, __pyx_n_s_acquire, 100, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__16)) __PYX_ERR(0, 100, __pyx_L1_error) + + /* "src/gevent/_semaphore.py":141 + * _py3k_acquire = acquire # PyPy needs this; it must be static for Cython + * + * def __enter__(self): # <<<<<<<<<<<<<< + * self.acquire() + * + */ + __pyx_tuple__17 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(0, 141, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__17); + __Pyx_GIVEREF(__pyx_tuple__17); + __pyx_codeobj__18 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__17, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__semaphore_py, __pyx_n_s_enter, 141, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__18)) __PYX_ERR(0, 141, __pyx_L1_error) + + /* "src/gevent/_semaphore.py":144 + * self.acquire() + * + * def __exit__(self, t, v, tb): # <<<<<<<<<<<<<< + * self.release() + * + */ + __pyx_tuple__19 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_t, __pyx_n_s_v, __pyx_n_s_tb); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(0, 144, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__19); + __Pyx_GIVEREF(__pyx_tuple__19); + __pyx_codeobj__20 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__19, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__semaphore_py, __pyx_n_s_exit, 144, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__20)) __PYX_ERR(0, 144, __pyx_L1_error) + + /* "src/gevent/_semaphore.py":168 + * self._initial_value = self.counter + * + * def release(self): # <<<<<<<<<<<<<< + * if self.counter >= self._initial_value: + * raise self._OVER_RELEASE_ERROR("Semaphore released too many times") + */ + __pyx_tuple__21 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(0, 168, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__21); + __Pyx_GIVEREF(__pyx_tuple__21); + __pyx_codeobj__22 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__21, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__semaphore_py, __pyx_n_s_release, 168, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__22)) __PYX_ERR(0, 168, __pyx_L1_error) + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} + +static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { + if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error) + return 0; + __pyx_L1_error:; + return -1; +} + +static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/ + +static int __Pyx_modinit_global_init_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); + /*--- Global init code ---*/ + __pyx_v_6gevent_11__semaphore_Timeout = Py_None; Py_INCREF(Py_None); + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_variable_export_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); + /*--- Variable export code ---*/ + if (__Pyx_ExportVoidPtr(__pyx_n_s_Timeout, (void *)&__pyx_v_6gevent_11__semaphore_Timeout, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_modinit_function_export_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); + /*--- Function export code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_type_init_code(void) { + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); + /*--- Type init code ---*/ + __pyx_t_1 = PyImport_ImportModule("gevent.__abstract_linkable"); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_ptype_6gevent_19__abstract_linkable_AbstractLinkable = __Pyx_ImportType(__pyx_t_1, "gevent.__abstract_linkable", "AbstractLinkable", sizeof(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_19__abstract_linkable_AbstractLinkable) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_vtabptr_6gevent_19__abstract_linkable_AbstractLinkable = (struct __pyx_vtabstruct_6gevent_19__abstract_linkable_AbstractLinkable*)__Pyx_GetVtable(__pyx_ptype_6gevent_19__abstract_linkable_AbstractLinkable->tp_dict); if (unlikely(!__pyx_vtabptr_6gevent_19__abstract_linkable_AbstractLinkable)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_vtabptr_6gevent_11__semaphore_Semaphore = &__pyx_vtable_6gevent_11__semaphore_Semaphore; + __pyx_vtable_6gevent_11__semaphore_Semaphore.__pyx_base = *__pyx_vtabptr_6gevent_19__abstract_linkable_AbstractLinkable; + __pyx_vtable_6gevent_11__semaphore_Semaphore.__pyx_base.ready = (int (*)(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *, int __pyx_skip_dispatch))__pyx_f_6gevent_11__semaphore_9Semaphore_ready; + __pyx_vtable_6gevent_11__semaphore_Semaphore.__pyx_base._wait_return_value = (PyObject *(*)(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *, PyObject *, PyObject *))__pyx_f_6gevent_11__semaphore_9Semaphore__wait_return_value; + __pyx_vtable_6gevent_11__semaphore_Semaphore.locked = (int (*)(struct __pyx_obj_6gevent_11__semaphore_Semaphore *, int __pyx_skip_dispatch))__pyx_f_6gevent_11__semaphore_9Semaphore_locked; + __pyx_vtable_6gevent_11__semaphore_Semaphore.release = (int (*)(struct __pyx_obj_6gevent_11__semaphore_Semaphore *, int __pyx_skip_dispatch))__pyx_f_6gevent_11__semaphore_9Semaphore_release; + __pyx_vtable_6gevent_11__semaphore_Semaphore._start_notify = (PyObject *(*)(struct __pyx_obj_6gevent_11__semaphore_Semaphore *, int __pyx_skip_dispatch))__pyx_f_6gevent_11__semaphore_9Semaphore__start_notify; + __pyx_vtable_6gevent_11__semaphore_Semaphore.wait = (int (*)(struct __pyx_obj_6gevent_11__semaphore_Semaphore *, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_11__semaphore_9Semaphore_wait *__pyx_optional_args))__pyx_f_6gevent_11__semaphore_9Semaphore_wait; + __pyx_vtable_6gevent_11__semaphore_Semaphore.acquire = (int (*)(struct __pyx_obj_6gevent_11__semaphore_Semaphore *, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_11__semaphore_9Semaphore_acquire *__pyx_optional_args))__pyx_f_6gevent_11__semaphore_9Semaphore_acquire; + __pyx_vtable_6gevent_11__semaphore_Semaphore.__pyx___enter__ = (PyObject *(*)(struct __pyx_obj_6gevent_11__semaphore_Semaphore *, int __pyx_skip_dispatch))__pyx_f_6gevent_11__semaphore_9Semaphore___enter__; + __pyx_vtable_6gevent_11__semaphore_Semaphore.__pyx___exit__ = (PyObject *(*)(struct __pyx_obj_6gevent_11__semaphore_Semaphore *, PyObject *, PyObject *, PyObject *, int __pyx_skip_dispatch))__pyx_f_6gevent_11__semaphore_9Semaphore___exit__; + __pyx_type_6gevent_11__semaphore_Semaphore.tp_base = __pyx_ptype_6gevent_19__abstract_linkable_AbstractLinkable; + if (PyType_Ready(&__pyx_type_6gevent_11__semaphore_Semaphore) < 0) __PYX_ERR(0, 16, __pyx_L1_error) + __pyx_type_6gevent_11__semaphore_Semaphore.tp_print = 0; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6gevent_11__semaphore_Semaphore.tp_dictoffset && __pyx_type_6gevent_11__semaphore_Semaphore.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_type_6gevent_11__semaphore_Semaphore.tp_getattro = __Pyx_PyObject_GenericGetAttr; + } + if (__Pyx_SetVtable(__pyx_type_6gevent_11__semaphore_Semaphore.tp_dict, __pyx_vtabptr_6gevent_11__semaphore_Semaphore) < 0) __PYX_ERR(0, 16, __pyx_L1_error) + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Semaphore, (PyObject *)&__pyx_type_6gevent_11__semaphore_Semaphore) < 0) __PYX_ERR(0, 16, __pyx_L1_error) + if (__pyx_type_6gevent_11__semaphore_Semaphore.tp_weaklistoffset == 0) __pyx_type_6gevent_11__semaphore_Semaphore.tp_weaklistoffset = offsetof(struct __pyx_obj_6gevent_11__semaphore_Semaphore, __pyx_base.__weakref__); + __pyx_ptype_6gevent_11__semaphore_Semaphore = &__pyx_type_6gevent_11__semaphore_Semaphore; + __pyx_vtabptr_6gevent_11__semaphore_BoundedSemaphore = &__pyx_vtable_6gevent_11__semaphore_BoundedSemaphore; + __pyx_vtable_6gevent_11__semaphore_BoundedSemaphore.__pyx_base = *__pyx_vtabptr_6gevent_11__semaphore_Semaphore; + __pyx_vtable_6gevent_11__semaphore_BoundedSemaphore.__pyx_base.release = (int (*)(struct __pyx_obj_6gevent_11__semaphore_Semaphore *, int __pyx_skip_dispatch))__pyx_f_6gevent_11__semaphore_16BoundedSemaphore_release; + __pyx_type_6gevent_11__semaphore_BoundedSemaphore.tp_base = __pyx_ptype_6gevent_11__semaphore_Semaphore; + if (PyType_Ready(&__pyx_type_6gevent_11__semaphore_BoundedSemaphore) < 0) __PYX_ERR(0, 148, __pyx_L1_error) + __pyx_type_6gevent_11__semaphore_BoundedSemaphore.tp_print = 0; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6gevent_11__semaphore_BoundedSemaphore.tp_dictoffset && __pyx_type_6gevent_11__semaphore_BoundedSemaphore.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_type_6gevent_11__semaphore_BoundedSemaphore.tp_getattro = __Pyx_PyObject_GenericGetAttr; + } + if (__Pyx_SetVtable(__pyx_type_6gevent_11__semaphore_BoundedSemaphore.tp_dict, __pyx_vtabptr_6gevent_11__semaphore_BoundedSemaphore) < 0) __PYX_ERR(0, 148, __pyx_L1_error) + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_BoundedSemaphore, (PyObject *)&__pyx_type_6gevent_11__semaphore_BoundedSemaphore) < 0) __PYX_ERR(0, 148, __pyx_L1_error) + if (__pyx_type_6gevent_11__semaphore_BoundedSemaphore.tp_weaklistoffset == 0) __pyx_type_6gevent_11__semaphore_BoundedSemaphore.tp_weaklistoffset = offsetof(struct __pyx_obj_6gevent_11__semaphore_BoundedSemaphore, __pyx_base.__pyx_base.__weakref__); + __pyx_ptype_6gevent_11__semaphore_BoundedSemaphore = &__pyx_type_6gevent_11__semaphore_BoundedSemaphore; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_modinit_type_import_code(void) { + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); + /*--- Type import code ---*/ + __pyx_t_1 = PyImport_ImportModule("greenlet"); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_ptype_6gevent_21__greenlet_primitives_greenlet = __Pyx_ImportType(__pyx_t_1, "greenlet", "greenlet", sizeof(PyGreenlet), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_21__greenlet_primitives_greenlet) __PYX_ERR(2, 12, __pyx_L1_error) + __pyx_t_2 = PyImport_ImportModule("gevent.__greenlet_primitives"); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 37, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_ptype_6gevent_21__greenlet_primitives_TrackedRawGreenlet = __Pyx_ImportType(__pyx_t_2, "gevent.__greenlet_primitives", "TrackedRawGreenlet", sizeof(struct __pyx_obj_6gevent_21__greenlet_primitives_TrackedRawGreenlet), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_21__greenlet_primitives_TrackedRawGreenlet) __PYX_ERR(2, 37, __pyx_L1_error) + __pyx_ptype_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop = __Pyx_ImportType(__pyx_t_2, "gevent.__greenlet_primitives", "SwitchOutGreenletWithLoop", sizeof(struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop) __PYX_ERR(2, 40, __pyx_L1_error) + __pyx_vtabptr_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop = (struct __pyx_vtabstruct_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop*)__Pyx_GetVtable(__pyx_ptype_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop->tp_dict); if (unlikely(!__pyx_vtabptr_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop)) __PYX_ERR(2, 40, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyImport_ImportModule("greenlet"); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_ptype_6gevent_19__abstract_linkable_greenlet = __Pyx_ImportType(__pyx_t_2, "greenlet", "greenlet", sizeof(PyGreenlet), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_19__abstract_linkable_greenlet) __PYX_ERR(3, 12, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_modinit_variable_import_code(void) { + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); + /*--- Variable import code ---*/ + __pyx_t_1 = PyImport_ImportModule("gevent.__greenlet_primitives"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_1, "get_objects", (void **)&__pyx_vp_6gevent_21__greenlet_primitives_get_objects, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_1, "wref", (void **)&__pyx_vp_6gevent_21__greenlet_primitives_wref, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_1, "BlockingSwitchOutError", (void **)&__pyx_vp_6gevent_21__greenlet_primitives_BlockingSwitchOutError, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_1, "_greenlet_imported", (void **)&__pyx_vp_6gevent_21__greenlet_primitives__greenlet_imported, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + Py_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_2 = PyImport_ImportModule("gevent.__hub_local"); if (!__pyx_t_2) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_2, "_threadlocal", (void **)&__pyx_vp_6gevent_11__hub_local__threadlocal, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + Py_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_3 = PyImport_ImportModule("gevent.__abstract_linkable"); if (!__pyx_t_3) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_3, "InvalidSwitchError", (void **)&__pyx_vp_6gevent_19__abstract_linkable_InvalidSwitchError, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_3, "Timeout", (void **)&__pyx_vp_6gevent_19__abstract_linkable_Timeout, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_3, "_greenlet_imported", (void **)&__pyx_vp_6gevent_19__abstract_linkable__greenlet_imported, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + Py_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_modinit_function_import_code(void) { + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); + /*--- Function import code ---*/ + __pyx_t_1 = PyImport_ImportModule("gevent.__hub_local"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportFunction(__pyx_t_1, "get_hub_noargs", (void (**)(void))&__pyx_f_6gevent_11__hub_local_get_hub_noargs, "struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *(int __pyx_skip_dispatch)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + Py_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_RefNannyFinishContext(); + return -1; +} + + +#if PY_MAJOR_VERSION < 3 +#ifdef CYTHON_NO_PYINIT_EXPORT +#define __Pyx_PyMODINIT_FUNC void +#else +#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC +#endif +#else +#ifdef CYTHON_NO_PYINIT_EXPORT +#define __Pyx_PyMODINIT_FUNC PyObject * +#else +#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC +#endif +#endif + + +#if PY_MAJOR_VERSION < 3 +__Pyx_PyMODINIT_FUNC init__semaphore(void) CYTHON_SMALL_CODE; /*proto*/ +__Pyx_PyMODINIT_FUNC init__semaphore(void) +#else +__Pyx_PyMODINIT_FUNC PyInit___semaphore(void) CYTHON_SMALL_CODE; /*proto*/ +__Pyx_PyMODINIT_FUNC PyInit___semaphore(void) +#if CYTHON_PEP489_MULTI_PHASE_INIT +{ + return PyModuleDef_Init(&__pyx_moduledef); +} +static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { + #if PY_VERSION_HEX >= 0x030700A1 + static PY_INT64_T main_interpreter_id = -1; + PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); + if (main_interpreter_id == -1) { + main_interpreter_id = current_id; + return (unlikely(current_id == -1)) ? -1 : 0; + } else if (unlikely(main_interpreter_id != current_id)) + #else + static PyInterpreterState *main_interpreter = NULL; + PyInterpreterState *current_interpreter = PyThreadState_Get()->interp; + if (!main_interpreter) { + main_interpreter = current_interpreter; + } else if (unlikely(main_interpreter != current_interpreter)) + #endif + { + PyErr_SetString( + PyExc_ImportError, + "Interpreter change detected - this module can only be loaded into one interpreter per process."); + return -1; + } + return 0; +} +static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) { + PyObject *value = PyObject_GetAttrString(spec, from_name); + int result = 0; + if (likely(value)) { + if (allow_none || value != Py_None) { + result = PyDict_SetItemString(moddict, to_name, value); + } + Py_DECREF(value); + } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_Clear(); + } else { + result = -1; + } + return result; +} +static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) { + PyObject *module = NULL, *moddict, *modname; + if (__Pyx_check_single_interpreter()) + return NULL; + if (__pyx_m) + return __Pyx_NewRef(__pyx_m); + modname = PyObject_GetAttrString(spec, "name"); + if (unlikely(!modname)) goto bad; + module = PyModule_NewObject(modname); + Py_DECREF(modname); + if (unlikely(!module)) goto bad; + moddict = PyModule_GetDict(module); + if (unlikely(!moddict)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad; + return module; +bad: + Py_XDECREF(module); + return NULL; +} + + +static CYTHON_SMALL_CODE int __pyx_pymod_exec___semaphore(PyObject *__pyx_pyinit_module) +#endif +#endif +{ + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannyDeclarations + #if CYTHON_PEP489_MULTI_PHASE_INIT + if (__pyx_m) { + if (__pyx_m == __pyx_pyinit_module) return 0; + PyErr_SetString(PyExc_RuntimeError, "Module '__semaphore' has already been imported. Re-initialisation is not supported."); + return -1; + } + #elif PY_MAJOR_VERSION >= 3 + if (__pyx_m) return __Pyx_NewRef(__pyx_m); + #endif + #if CYTHON_REFNANNY +__Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); +if (!__Pyx_RefNanny) { + PyErr_Clear(); + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); + if (!__Pyx_RefNanny) + Py_FatalError("failed to import 'refnanny' module"); +} +#endif + __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit___semaphore(void)", 0); + if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #ifdef __Pxy_PyFrame_Initialize_Offsets + __Pxy_PyFrame_Initialize_Offsets(); + #endif + __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) + #ifdef __Pyx_CyFunction_USED + if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_FusedFunction_USED + if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_Coroutine_USED + if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_Generator_USED + if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_AsyncGen_USED + if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_StopAsyncIteration_USED + if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + /*--- Library function declarations ---*/ + /*--- Threads initialization code ---*/ + #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS + #ifdef WITH_THREAD /* Python build with threading support? */ + PyEval_InitThreads(); + #endif + #endif + /*--- Module creation code ---*/ + #if CYTHON_PEP489_MULTI_PHASE_INIT + __pyx_m = __pyx_pyinit_module; + Py_INCREF(__pyx_m); + #else + #if PY_MAJOR_VERSION < 3 + __pyx_m = Py_InitModule4("__semaphore", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); + #else + __pyx_m = PyModule_Create(&__pyx_moduledef); + #endif + if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) + Py_INCREF(__pyx_d); + __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) + #if CYTHON_COMPILING_IN_PYPY + Py_INCREF(__pyx_b); + #endif + if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + /*--- Initialize various global constants etc. ---*/ + if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) + if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + if (__pyx_module_is_main_gevent____semaphore) { + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + } + #if PY_MAJOR_VERSION >= 3 + { + PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) + if (!PyDict_GetItemString(modules, "gevent.__semaphore")) { + if (unlikely(PyDict_SetItemString(modules, "gevent.__semaphore", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error) + } + } + #endif + /*--- Builtin init code ---*/ + if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + /*--- Constants init code ---*/ + if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + /*--- Global type/function init code ---*/ + (void)__Pyx_modinit_global_init_code(); + if (unlikely(__Pyx_modinit_variable_export_code() != 0)) goto __pyx_L1_error; + (void)__Pyx_modinit_function_export_code(); + if (unlikely(__Pyx_modinit_type_init_code() != 0)) goto __pyx_L1_error; + if (unlikely(__Pyx_modinit_type_import_code() != 0)) goto __pyx_L1_error; + if (unlikely(__Pyx_modinit_variable_import_code() != 0)) goto __pyx_L1_error; + if (unlikely(__Pyx_modinit_function_import_code() != 0)) goto __pyx_L1_error; + /*--- Execution code ---*/ + #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) + if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + + /* "src/gevent/_semaphore.py":4 + * from __future__ import print_function, absolute_import, division + * + * __all__ = [ # <<<<<<<<<<<<<< + * 'Semaphore', + * 'BoundedSemaphore', + */ + __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_Semaphore); + __Pyx_GIVEREF(__pyx_n_s_Semaphore); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_Semaphore); + __Pyx_INCREF(__pyx_n_s_BoundedSemaphore); + __Pyx_GIVEREF(__pyx_n_s_BoundedSemaphore); + PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_BoundedSemaphore); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_all, __pyx_t_1) < 0) __PYX_ERR(0, 4, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_semaphore.py":9 + * ] + * + * def _get_linkable(): # <<<<<<<<<<<<<< + * x = __import__('gevent._abstract_linkable') + * return x._abstract_linkable.AbstractLinkable + */ + __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_11__semaphore_1_get_linkable, 0, __pyx_n_s_get_linkable, NULL, __pyx_n_s_gevent___semaphore, __pyx_d, ((PyObject *)__pyx_codeobj__4)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 9, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_linkable, __pyx_t_1) < 0) __PYX_ERR(0, 9, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_semaphore.py":12 + * x = __import__('gevent._abstract_linkable') + * return x._abstract_linkable.AbstractLinkable + * locals()['AbstractLinkable'] = _get_linkable() # <<<<<<<<<<<<<< + * del _get_linkable + * + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_get_linkable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_Globals(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (unlikely(PyDict_SetItem(__pyx_t_1, __pyx_n_s_AbstractLinkable, __pyx_t_2) < 0)) __PYX_ERR(0, 12, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/_semaphore.py":13 + * return x._abstract_linkable.AbstractLinkable + * locals()['AbstractLinkable'] = _get_linkable() + * del _get_linkable # <<<<<<<<<<<<<< + * + * + */ + if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_get_linkable) < 0) __PYX_ERR(0, 13, __pyx_L1_error) + + /* "src/gevent/_semaphore.py":52 + * return '<%s counter=%s _links[%s]>' % params + * + * def locked(self): # <<<<<<<<<<<<<< + * """Return a boolean indicating whether the semaphore can be acquired. + * Most useful with binary semaphores.""" + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_11__semaphore_9Semaphore_5locked, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Semaphore_locked, NULL, __pyx_n_s_gevent___semaphore, __pyx_d, ((PyObject *)__pyx_codeobj__6)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 52, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_11__semaphore_Semaphore->tp_dict, __pyx_n_s_locked, __pyx_t_2) < 0) __PYX_ERR(0, 52, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_11__semaphore_Semaphore); + + /* "src/gevent/_semaphore.py":57 + * return self.counter <= 0 + * + * def release(self): # <<<<<<<<<<<<<< + * """ + * Release the semaphore, notifying any waiters if needed. + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_11__semaphore_9Semaphore_7release, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Semaphore_release, NULL, __pyx_n_s_gevent___semaphore, __pyx_d, ((PyObject *)__pyx_codeobj__8)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 57, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_11__semaphore_Semaphore->tp_dict, __pyx_n_s_release, __pyx_t_2) < 0) __PYX_ERR(0, 57, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_11__semaphore_Semaphore); + + /* "src/gevent/_semaphore.py":65 + * return self.counter + * + * def ready(self): # <<<<<<<<<<<<<< + * return self.counter > 0 + * + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_11__semaphore_9Semaphore_9ready, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Semaphore_ready, NULL, __pyx_n_s_gevent___semaphore, __pyx_d, ((PyObject *)__pyx_codeobj__10)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 65, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_11__semaphore_Semaphore->tp_dict, __pyx_n_s_ready, __pyx_t_2) < 0) __PYX_ERR(0, 65, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_11__semaphore_Semaphore); + + /* "src/gevent/_semaphore.py":68 + * return self.counter > 0 + * + * def _start_notify(self): # <<<<<<<<<<<<<< + * self._check_and_notify() + * + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_11__semaphore_9Semaphore_11_start_notify, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Semaphore__start_notify, NULL, __pyx_n_s_gevent___semaphore, __pyx_d, ((PyObject *)__pyx_codeobj__12)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 68, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_11__semaphore_Semaphore->tp_dict, __pyx_n_s_start_notify, __pyx_t_2) < 0) __PYX_ERR(0, 68, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_11__semaphore_Semaphore); + + /* "src/gevent/_semaphore.py":79 + * return True + * + * def wait(self, timeout=None): # <<<<<<<<<<<<<< + * """ + * wait(timeout=None) -> int + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_11__semaphore_9Semaphore_13wait, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Semaphore_wait, NULL, __pyx_n_s_gevent___semaphore, __pyx_d, ((PyObject *)__pyx_codeobj__14)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 79, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_11__semaphore_Semaphore->tp_dict, __pyx_n_s_wait, __pyx_t_2) < 0) __PYX_ERR(0, 79, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_11__semaphore_Semaphore); + + /* "src/gevent/_semaphore.py":100 + * return self.counter + * + * def acquire(self, blocking=True, timeout=None): # <<<<<<<<<<<<<< + * """ + * acquire(blocking=True, timeout=None) -> bool + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_11__semaphore_9Semaphore_15acquire, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Semaphore_acquire, NULL, __pyx_n_s_gevent___semaphore, __pyx_d, ((PyObject *)__pyx_codeobj__16)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 100, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_11__semaphore_Semaphore->tp_dict, __pyx_n_s_acquire, __pyx_t_2) < 0) __PYX_ERR(0, 100, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_11__semaphore_Semaphore); + + /* "src/gevent/_semaphore.py":139 + * return True + * + * _py3k_acquire = acquire # PyPy needs this; it must be static for Cython # <<<<<<<<<<<<<< + * + * def __enter__(self): + */ + __Pyx_GetNameInClass(__pyx_t_2, (PyObject *)__pyx_ptype_6gevent_11__semaphore_Semaphore, __pyx_n_s_acquire); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 139, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_11__semaphore_Semaphore->tp_dict, __pyx_n_s_py3k_acquire, __pyx_t_2) < 0) __PYX_ERR(0, 139, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_11__semaphore_Semaphore); + + /* "src/gevent/_semaphore.py":141 + * _py3k_acquire = acquire # PyPy needs this; it must be static for Cython + * + * def __enter__(self): # <<<<<<<<<<<<<< + * self.acquire() + * + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_11__semaphore_9Semaphore_17__enter__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Semaphore___enter, NULL, __pyx_n_s_gevent___semaphore, __pyx_d, ((PyObject *)__pyx_codeobj__18)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 141, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_11__semaphore_Semaphore->tp_dict, __pyx_n_s_enter, __pyx_t_2) < 0) __PYX_ERR(0, 141, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_11__semaphore_Semaphore); + + /* "src/gevent/_semaphore.py":144 + * self.acquire() + * + * def __exit__(self, t, v, tb): # <<<<<<<<<<<<<< + * self.release() + * + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_11__semaphore_9Semaphore_19__exit__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Semaphore___exit, NULL, __pyx_n_s_gevent___semaphore, __pyx_d, ((PyObject *)__pyx_codeobj__20)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 144, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_11__semaphore_Semaphore->tp_dict, __pyx_n_s_exit, __pyx_t_2) < 0) __PYX_ERR(0, 144, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_11__semaphore_Semaphore); + + /* "src/gevent/_semaphore.py":162 + * + * #: For monkey-patching, allow changing the class of error we raise + * _OVER_RELEASE_ERROR = ValueError # <<<<<<<<<<<<<< + * + * def __init__(self, *args, **kwargs): + */ + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_11__semaphore_BoundedSemaphore->tp_dict, __pyx_n_s_OVER_RELEASE_ERROR, __pyx_builtin_ValueError) < 0) __PYX_ERR(0, 162, __pyx_L1_error) + PyType_Modified(__pyx_ptype_6gevent_11__semaphore_BoundedSemaphore); + + /* "src/gevent/_semaphore.py":168 + * self._initial_value = self.counter + * + * def release(self): # <<<<<<<<<<<<<< + * if self.counter >= self._initial_value: + * raise self._OVER_RELEASE_ERROR("Semaphore released too many times") + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_11__semaphore_16BoundedSemaphore_3release, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BoundedSemaphore_release, NULL, __pyx_n_s_gevent___semaphore, __pyx_d, ((PyObject *)__pyx_codeobj__22)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 168, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_11__semaphore_BoundedSemaphore->tp_dict, __pyx_n_s_release, __pyx_t_2) < 0) __PYX_ERR(0, 168, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_11__semaphore_BoundedSemaphore); + + /* "src/gevent/_semaphore.py":187 + * # for PyPy in all cases anyway, so this does nothing. + * + * from gevent._util import import_c_accel # <<<<<<<<<<<<<< + * import_c_accel(globals(), 'gevent.__semaphore') + */ + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 187, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_import_c_accel); + __Pyx_GIVEREF(__pyx_n_s_import_c_accel); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_import_c_accel); + __pyx_t_1 = __Pyx_Import(__pyx_n_s_gevent__util, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 187, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_import_c_accel); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 187, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_import_c_accel, __pyx_t_2) < 0) __PYX_ERR(0, 187, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_semaphore.py":188 + * + * from gevent._util import import_c_accel + * import_c_accel(globals(), 'gevent.__semaphore') # <<<<<<<<<<<<<< + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_import_c_accel); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 188, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_Globals(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 188, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 188, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __Pyx_INCREF(__pyx_n_s_gevent___semaphore); + __Pyx_GIVEREF(__pyx_n_s_gevent___semaphore); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_n_s_gevent___semaphore); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 188, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/_semaphore.py":1 + * # cython: auto_pickle=False,embedsignature=True,always_allow_keywords=False # <<<<<<<<<<<<<< + * from __future__ import print_function, absolute_import, division + * + */ + __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "gevent/__abstract_linkable.pxd":24 + * return PyGreenlet_GetCurrent() + * + * cdef inline void greenlet_init(): # <<<<<<<<<<<<<< + * global _greenlet_imported + * if not _greenlet_imported: + */ + + /*--- Wrapped vars code ---*/ + + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + if (__pyx_m) { + if (__pyx_d) { + __Pyx_AddTraceback("init gevent.__semaphore", __pyx_clineno, __pyx_lineno, __pyx_filename); + } + Py_CLEAR(__pyx_m); + } else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_ImportError, "init gevent.__semaphore"); + } + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + #if CYTHON_PEP489_MULTI_PHASE_INIT + return (__pyx_m != NULL) ? 0 : -1; + #elif PY_MAJOR_VERSION >= 3 + return __pyx_m; + #else + return; + #endif +} + +/* --- Runtime support code --- */ +/* Refnanny */ +#if CYTHON_REFNANNY +static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { + PyObject *m = NULL, *p = NULL; + void *r = NULL; + m = PyImport_ImportModule(modname); + if (!m) goto end; + p = PyObject_GetAttrString(m, "RefNannyAPI"); + if (!p) goto end; + r = PyLong_AsVoidPtr(p); +end: + Py_XDECREF(p); + Py_XDECREF(m); + return (__Pyx_RefNannyAPIStruct *)r; +} +#endif + +/* PyObjectGetAttrStr */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_getattro)) + return tp->tp_getattro(obj, attr_name); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_getattr)) + return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); +#endif + return PyObject_GetAttr(obj, attr_name); +} +#endif + +/* GetBuiltinName */ +static PyObject *__Pyx_GetBuiltinName(PyObject *name) { + PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name); + if (unlikely(!result)) { + PyErr_Format(PyExc_NameError, +#if PY_MAJOR_VERSION >= 3 + "name '%U' is not defined", name); +#else + "name '%.200s' is not defined", PyString_AS_STRING(name)); +#endif + } + return result; +} + +/* PyObjectCall */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { + PyObject *result; + ternaryfunc call = func->ob_type->tp_call; + if (unlikely(!call)) + return PyObject_Call(func, arg, kw); + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; + result = (*call)(func, arg, kw); + Py_LeaveRecursiveCall(); + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +/* RaiseDoubleKeywords */ +static void __Pyx_RaiseDoubleKeywordsError( + const char* func_name, + PyObject* kw_name) +{ + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION >= 3 + "%s() got multiple values for keyword argument '%U'", func_name, kw_name); + #else + "%s() got multiple values for keyword argument '%s'", func_name, + PyString_AsString(kw_name)); + #endif +} + +/* ParseKeywords */ +static int __Pyx_ParseOptionalKeywords( + PyObject *kwds, + PyObject **argnames[], + PyObject *kwds2, + PyObject *values[], + Py_ssize_t num_pos_args, + const char* function_name) +{ + PyObject *key = 0, *value = 0; + Py_ssize_t pos = 0; + PyObject*** name; + PyObject*** first_kw_arg = argnames + num_pos_args; + while (PyDict_Next(kwds, &pos, &key, &value)) { + name = first_kw_arg; + while (*name && (**name != key)) name++; + if (*name) { + values[name-argnames] = value; + continue; + } + name = first_kw_arg; + #if PY_MAJOR_VERSION < 3 + if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) { + while (*name) { + if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) + && _PyString_Eq(**name, key)) { + values[name-argnames] = value; + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + if ((**argname == key) || ( + (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) + && _PyString_Eq(**argname, key))) { + goto arg_passed_twice; + } + argname++; + } + } + } else + #endif + if (likely(PyUnicode_Check(key))) { + while (*name) { + int cmp = (**name == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 : + #endif + PyUnicode_Compare(**name, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) { + values[name-argnames] = value; + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + int cmp = (**argname == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 : + #endif + PyUnicode_Compare(**argname, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) goto arg_passed_twice; + argname++; + } + } + } else + goto invalid_keyword_type; + if (kwds2) { + if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; + } else { + goto invalid_keyword; + } + } + return 0; +arg_passed_twice: + __Pyx_RaiseDoubleKeywordsError(function_name, key); + goto bad; +invalid_keyword_type: + PyErr_Format(PyExc_TypeError, + "%.200s() keywords must be strings", function_name); + goto bad; +invalid_keyword: + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION < 3 + "%.200s() got an unexpected keyword argument '%.200s'", + function_name, PyString_AsString(key)); + #else + "%s() got an unexpected keyword argument '%U'", + function_name, key); + #endif +bad: + return -1; +} + +/* RaiseArgTupleInvalid */ +static void __Pyx_RaiseArgtupleInvalid( + const char* func_name, + int exact, + Py_ssize_t num_min, + Py_ssize_t num_max, + Py_ssize_t num_found) +{ + Py_ssize_t num_expected; + const char *more_or_less; + if (num_found < num_min) { + num_expected = num_min; + more_or_less = "at least"; + } else { + num_expected = num_max; + more_or_less = "at most"; + } + if (exact) { + more_or_less = "exactly"; + } + PyErr_Format(PyExc_TypeError, + "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", + func_name, more_or_less, num_expected, + (num_expected == 1) ? "" : "s", num_found); +} + +/* PyErrFetchRestore */ +#if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + tmp_type = tstate->curexc_type; + tmp_value = tstate->curexc_value; + tmp_tb = tstate->curexc_traceback; + tstate->curexc_type = type; + tstate->curexc_value = value; + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +} +static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { + *type = tstate->curexc_type; + *value = tstate->curexc_value; + *tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +} +#endif + +/* RaiseException */ +#if PY_MAJOR_VERSION < 3 +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, + CYTHON_UNUSED PyObject *cause) { + __Pyx_PyThreadState_declare + Py_XINCREF(type); + if (!value || value == Py_None) + value = NULL; + else + Py_INCREF(value); + if (!tb || tb == Py_None) + tb = NULL; + else { + Py_INCREF(tb); + if (!PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto raise_error; + } + } + if (PyType_Check(type)) { +#if CYTHON_COMPILING_IN_PYPY + if (!value) { + Py_INCREF(Py_None); + value = Py_None; + } +#endif + PyErr_NormalizeException(&type, &value, &tb); + } else { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto raise_error; + } + value = type; + type = (PyObject*) Py_TYPE(type); + Py_INCREF(type); + if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto raise_error; + } + } + __Pyx_PyThreadState_assign + __Pyx_ErrRestore(type, value, tb); + return; +raise_error: + Py_XDECREF(value); + Py_XDECREF(type); + Py_XDECREF(tb); + return; +} +#else +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { + PyObject* owned_instance = NULL; + if (tb == Py_None) { + tb = 0; + } else if (tb && !PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto bad; + } + if (value == Py_None) + value = 0; + if (PyExceptionInstance_Check(type)) { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto bad; + } + value = type; + type = (PyObject*) Py_TYPE(value); + } else if (PyExceptionClass_Check(type)) { + PyObject *instance_class = NULL; + if (value && PyExceptionInstance_Check(value)) { + instance_class = (PyObject*) Py_TYPE(value); + if (instance_class != type) { + int is_subclass = PyObject_IsSubclass(instance_class, type); + if (!is_subclass) { + instance_class = NULL; + } else if (unlikely(is_subclass == -1)) { + goto bad; + } else { + type = instance_class; + } + } + } + if (!instance_class) { + PyObject *args; + if (!value) + args = PyTuple_New(0); + else if (PyTuple_Check(value)) { + Py_INCREF(value); + args = value; + } else + args = PyTuple_Pack(1, value); + if (!args) + goto bad; + owned_instance = PyObject_Call(type, args, NULL); + Py_DECREF(args); + if (!owned_instance) + goto bad; + value = owned_instance; + if (!PyExceptionInstance_Check(value)) { + PyErr_Format(PyExc_TypeError, + "calling %R should have returned an instance of " + "BaseException, not %R", + type, Py_TYPE(value)); + goto bad; + } + } + } else { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto bad; + } + if (cause) { + PyObject *fixed_cause; + if (cause == Py_None) { + fixed_cause = NULL; + } else if (PyExceptionClass_Check(cause)) { + fixed_cause = PyObject_CallObject(cause, NULL); + if (fixed_cause == NULL) + goto bad; + } else if (PyExceptionInstance_Check(cause)) { + fixed_cause = cause; + Py_INCREF(fixed_cause); + } else { + PyErr_SetString(PyExc_TypeError, + "exception causes must derive from " + "BaseException"); + goto bad; + } + PyException_SetCause(value, fixed_cause); + } + PyErr_SetObject(type, value); + if (tb) { +#if CYTHON_COMPILING_IN_PYPY + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); + Py_INCREF(tb); + PyErr_Restore(tmp_type, tmp_value, tb); + Py_XDECREF(tmp_tb); +#else + PyThreadState *tstate = __Pyx_PyThreadState_Current; + PyObject* tmp_tb = tstate->curexc_traceback; + if (tb != tmp_tb) { + Py_INCREF(tb); + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_tb); + } +#endif + } +bad: + Py_XDECREF(owned_instance); + return; +} +#endif + +/* PyFunctionFastCall */ +#if CYTHON_FAST_PYCALL +static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, + PyObject *globals) { + PyFrameObject *f; + PyThreadState *tstate = __Pyx_PyThreadState_Current; + PyObject **fastlocals; + Py_ssize_t i; + PyObject *result; + assert(globals != NULL); + /* XXX Perhaps we should create a specialized + PyFrame_New() that doesn't take locals, but does + take builtins without sanity checking them. + */ + assert(tstate != NULL); + f = PyFrame_New(tstate, co, globals, NULL); + if (f == NULL) { + return NULL; + } + fastlocals = __Pyx_PyFrame_GetLocalsplus(f); + for (i = 0; i < na; i++) { + Py_INCREF(*args); + fastlocals[i] = *args++; + } + result = PyEval_EvalFrameEx(f,0); + ++tstate->recursion_depth; + Py_DECREF(f); + --tstate->recursion_depth; + return result; +} +#if 1 || PY_VERSION_HEX < 0x030600B1 +static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs) { + PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); + PyObject *globals = PyFunction_GET_GLOBALS(func); + PyObject *argdefs = PyFunction_GET_DEFAULTS(func); + PyObject *closure; +#if PY_MAJOR_VERSION >= 3 + PyObject *kwdefs; +#endif + PyObject *kwtuple, **k; + PyObject **d; + Py_ssize_t nd; + Py_ssize_t nk; + PyObject *result; + assert(kwargs == NULL || PyDict_Check(kwargs)); + nk = kwargs ? PyDict_Size(kwargs) : 0; + if (Py_EnterRecursiveCall((char*)" while calling a Python object")) { + return NULL; + } + if ( +#if PY_MAJOR_VERSION >= 3 + co->co_kwonlyargcount == 0 && +#endif + likely(kwargs == NULL || nk == 0) && + co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { + if (argdefs == NULL && co->co_argcount == nargs) { + result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); + goto done; + } + else if (nargs == 0 && argdefs != NULL + && co->co_argcount == Py_SIZE(argdefs)) { + /* function called with no arguments, but all parameters have + a default value: use default values as arguments .*/ + args = &PyTuple_GET_ITEM(argdefs, 0); + result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); + goto done; + } + } + if (kwargs != NULL) { + Py_ssize_t pos, i; + kwtuple = PyTuple_New(2 * nk); + if (kwtuple == NULL) { + result = NULL; + goto done; + } + k = &PyTuple_GET_ITEM(kwtuple, 0); + pos = i = 0; + while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { + Py_INCREF(k[i]); + Py_INCREF(k[i+1]); + i += 2; + } + nk = i / 2; + } + else { + kwtuple = NULL; + k = NULL; + } + closure = PyFunction_GET_CLOSURE(func); +#if PY_MAJOR_VERSION >= 3 + kwdefs = PyFunction_GET_KW_DEFAULTS(func); +#endif + if (argdefs != NULL) { + d = &PyTuple_GET_ITEM(argdefs, 0); + nd = Py_SIZE(argdefs); + } + else { + d = NULL; + nd = 0; + } +#if PY_MAJOR_VERSION >= 3 + result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, + args, nargs, + k, (int)nk, + d, (int)nd, kwdefs, closure); +#else + result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, + args, nargs, + k, (int)nk, + d, (int)nd, closure); +#endif + Py_XDECREF(kwtuple); +done: + Py_LeaveRecursiveCall(); + return result; +} +#endif +#endif + +/* PyObjectCallMethO */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { + PyObject *self, *result; + PyCFunction cfunc; + cfunc = PyCFunction_GET_FUNCTION(func); + self = PyCFunction_GET_SELF(func); + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; + result = cfunc(self, arg); + Py_LeaveRecursiveCall(); + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +/* PyObjectCallNoArg */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { +#if CYTHON_FAST_PYCALL + if (PyFunction_Check(func)) { + return __Pyx_PyFunction_FastCall(func, NULL, 0); + } +#endif +#ifdef __Pyx_CyFunction_USED + if (likely(PyCFunction_Check(func) || __Pyx_CyFunction_Check(func))) +#else + if (likely(PyCFunction_Check(func))) +#endif + { + if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) { + return __Pyx_PyObject_CallMethO(func, NULL); + } + } + return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL); +} +#endif + +/* PyCFunctionFastCall */ +#if CYTHON_FAST_PYCCALL +static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) { + PyCFunctionObject *func = (PyCFunctionObject*)func_obj; + PyCFunction meth = PyCFunction_GET_FUNCTION(func); + PyObject *self = PyCFunction_GET_SELF(func); + int flags = PyCFunction_GET_FLAGS(func); + assert(PyCFunction_Check(func)); + assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS))); + assert(nargs >= 0); + assert(nargs == 0 || args != NULL); + /* _PyCFunction_FastCallDict() must not be called with an exception set, + because it may clear it (directly or indirectly) and so the + caller loses its exception */ + assert(!PyErr_Occurred()); + if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) { + return (*((__Pyx_PyCFunctionFastWithKeywords)(void*)meth)) (self, args, nargs, NULL); + } else { + return (*((__Pyx_PyCFunctionFast)(void*)meth)) (self, args, nargs); + } +} +#endif + +/* PyObjectCallOneArg */ +#if CYTHON_COMPILING_IN_CPYTHON +static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) { + PyObject *result; + PyObject *args = PyTuple_New(1); + if (unlikely(!args)) return NULL; + Py_INCREF(arg); + PyTuple_SET_ITEM(args, 0, arg); + result = __Pyx_PyObject_Call(func, args, NULL); + Py_DECREF(args); + return result; +} +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { +#if CYTHON_FAST_PYCALL + if (PyFunction_Check(func)) { + return __Pyx_PyFunction_FastCall(func, &arg, 1); + } +#endif + if (likely(PyCFunction_Check(func))) { + if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) { + return __Pyx_PyObject_CallMethO(func, arg); +#if CYTHON_FAST_PYCCALL + } else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) { + return __Pyx_PyCFunction_FastCall(func, &arg, 1); +#endif + } + } + return __Pyx__PyObject_CallOneArg(func, arg); +} +#else +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { + PyObject *result; + PyObject *args = PyTuple_Pack(1, arg); + if (unlikely(!args)) return NULL; + result = __Pyx_PyObject_Call(func, args, NULL); + Py_DECREF(args); + return result; +} +#endif + +/* WriteUnraisableException */ +static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno, + CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename, + int full_traceback, CYTHON_UNUSED int nogil) { + PyObject *old_exc, *old_val, *old_tb; + PyObject *ctx; + __Pyx_PyThreadState_declare +#ifdef WITH_THREAD + PyGILState_STATE state; + if (nogil) + state = PyGILState_Ensure(); +#ifdef _MSC_VER + else state = (PyGILState_STATE)-1; +#endif +#endif + __Pyx_PyThreadState_assign + __Pyx_ErrFetch(&old_exc, &old_val, &old_tb); + if (full_traceback) { + Py_XINCREF(old_exc); + Py_XINCREF(old_val); + Py_XINCREF(old_tb); + __Pyx_ErrRestore(old_exc, old_val, old_tb); + PyErr_PrintEx(1); + } + #if PY_MAJOR_VERSION < 3 + ctx = PyString_FromString(name); + #else + ctx = PyUnicode_FromString(name); + #endif + __Pyx_ErrRestore(old_exc, old_val, old_tb); + if (!ctx) { + PyErr_WriteUnraisable(Py_None); + } else { + PyErr_WriteUnraisable(ctx); + Py_DECREF(ctx); + } +#ifdef WITH_THREAD + if (nogil) + PyGILState_Release(state); +#endif +} + +/* PyObjectCall2Args */ +static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) { + PyObject *args, *result = NULL; + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(function)) { + PyObject *args[2] = {arg1, arg2}; + return __Pyx_PyFunction_FastCall(function, args, 2); + } + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(function)) { + PyObject *args[2] = {arg1, arg2}; + return __Pyx_PyCFunction_FastCall(function, args, 2); + } + #endif + args = PyTuple_New(2); + if (unlikely(!args)) goto done; + Py_INCREF(arg1); + PyTuple_SET_ITEM(args, 0, arg1); + Py_INCREF(arg2); + PyTuple_SET_ITEM(args, 1, arg2); + Py_INCREF(function); + result = __Pyx_PyObject_Call(function, args, NULL); + Py_DECREF(args); + Py_DECREF(function); +done: + return result; +} + +/* KeywordStringCheck */ +static int __Pyx_CheckKeywordStrings( + PyObject *kwdict, + const char* function_name, + int kw_allowed) +{ + PyObject* key = 0; + Py_ssize_t pos = 0; +#if CYTHON_COMPILING_IN_PYPY + if (!kw_allowed && PyDict_Next(kwdict, &pos, &key, 0)) + goto invalid_keyword; + return 1; +#else + while (PyDict_Next(kwdict, &pos, &key, 0)) { + #if PY_MAJOR_VERSION < 3 + if (unlikely(!PyString_Check(key))) + #endif + if (unlikely(!PyUnicode_Check(key))) + goto invalid_keyword_type; + } + if ((!kw_allowed) && unlikely(key)) + goto invalid_keyword; + return 1; +invalid_keyword_type: + PyErr_Format(PyExc_TypeError, + "%.200s() keywords must be strings", function_name); + return 0; +#endif +invalid_keyword: + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION < 3 + "%.200s() got an unexpected keyword argument '%.200s'", + function_name, PyString_AsString(key)); + #else + "%s() got an unexpected keyword argument '%U'", + function_name, key); + #endif + return 0; +} + +/* CallNextTpDealloc */ +static void __Pyx_call_next_tp_dealloc(PyObject* obj, destructor current_tp_dealloc) { + PyTypeObject* type = Py_TYPE(obj); + while (type && type->tp_dealloc != current_tp_dealloc) + type = type->tp_base; + while (type && type->tp_dealloc == current_tp_dealloc) + type = type->tp_base; + if (type) + type->tp_dealloc(obj); +} + +/* CallNextTpTraverse */ +static int __Pyx_call_next_tp_traverse(PyObject* obj, visitproc v, void *a, traverseproc current_tp_traverse) { + PyTypeObject* type = Py_TYPE(obj); + while (type && type->tp_traverse != current_tp_traverse) + type = type->tp_base; + while (type && type->tp_traverse == current_tp_traverse) + type = type->tp_base; + if (type && type->tp_traverse) + return type->tp_traverse(obj, v, a); + return 0; +} + +/* CallNextTpClear */ +static void __Pyx_call_next_tp_clear(PyObject* obj, inquiry current_tp_clear) { + PyTypeObject* type = Py_TYPE(obj); + while (type && type->tp_clear != current_tp_clear) + type = type->tp_base; + while (type && type->tp_clear == current_tp_clear) + type = type->tp_base; + if (type && type->tp_clear) + type->tp_clear(obj); +} + +/* TypeImport */ +#ifndef __PYX_HAVE_RT_ImportType +#define __PYX_HAVE_RT_ImportType +static PyTypeObject *__Pyx_ImportType(PyObject *module, const char *module_name, const char *class_name, + size_t size, enum __Pyx_ImportType_CheckSize check_size) +{ + PyObject *result = 0; + char warning[200]; + Py_ssize_t basicsize; +#ifdef Py_LIMITED_API + PyObject *py_basicsize; +#endif + result = PyObject_GetAttrString(module, class_name); + if (!result) + goto bad; + if (!PyType_Check(result)) { + PyErr_Format(PyExc_TypeError, + "%.200s.%.200s is not a type object", + module_name, class_name); + goto bad; + } +#ifndef Py_LIMITED_API + basicsize = ((PyTypeObject *)result)->tp_basicsize; +#else + py_basicsize = PyObject_GetAttrString(result, "__basicsize__"); + if (!py_basicsize) + goto bad; + basicsize = PyLong_AsSsize_t(py_basicsize); + Py_DECREF(py_basicsize); + py_basicsize = 0; + if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred()) + goto bad; +#endif + if ((size_t)basicsize < size) { + PyErr_Format(PyExc_ValueError, + "%.200s.%.200s size changed, may indicate binary incompatibility. " + "Expected %zd from C header, got %zd from PyObject", + module_name, class_name, size, basicsize); + goto bad; + } + if (check_size == __Pyx_ImportType_CheckSize_Error && (size_t)basicsize != size) { + PyErr_Format(PyExc_ValueError, + "%.200s.%.200s size changed, may indicate binary incompatibility. " + "Expected %zd from C header, got %zd from PyObject", + module_name, class_name, size, basicsize); + goto bad; + } + else if (check_size == __Pyx_ImportType_CheckSize_Warn && (size_t)basicsize > size) { + PyOS_snprintf(warning, sizeof(warning), + "%s.%s size changed, may indicate binary incompatibility. " + "Expected %zd from C header, got %zd from PyObject", + module_name, class_name, size, basicsize); + if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad; + } + return (PyTypeObject *)result; +bad: + Py_XDECREF(result); + return NULL; +} +#endif + +/* GetVTable */ +static void* __Pyx_GetVtable(PyObject *dict) { + void* ptr; + PyObject *ob = PyObject_GetItem(dict, __pyx_n_s_pyx_vtable); + if (!ob) + goto bad; +#if PY_VERSION_HEX >= 0x02070000 + ptr = PyCapsule_GetPointer(ob, 0); +#else + ptr = PyCObject_AsVoidPtr(ob); +#endif + if (!ptr && !PyErr_Occurred()) + PyErr_SetString(PyExc_RuntimeError, "invalid vtable found for imported type"); + Py_DECREF(ob); + return ptr; +bad: + Py_XDECREF(ob); + return NULL; +} + +/* PyObject_GenericGetAttrNoDict */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) { + PyErr_Format(PyExc_AttributeError, +#if PY_MAJOR_VERSION >= 3 + "'%.50s' object has no attribute '%U'", + tp->tp_name, attr_name); +#else + "'%.50s' object has no attribute '%.400s'", + tp->tp_name, PyString_AS_STRING(attr_name)); +#endif + return NULL; +} +static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) { + PyObject *descr; + PyTypeObject *tp = Py_TYPE(obj); + if (unlikely(!PyString_Check(attr_name))) { + return PyObject_GenericGetAttr(obj, attr_name); + } + assert(!tp->tp_dictoffset); + descr = _PyType_Lookup(tp, attr_name); + if (unlikely(!descr)) { + return __Pyx_RaiseGenericGetAttributeError(tp, attr_name); + } + Py_INCREF(descr); + #if PY_MAJOR_VERSION < 3 + if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS))) + #endif + { + descrgetfunc f = Py_TYPE(descr)->tp_descr_get; + if (unlikely(f)) { + PyObject *res = f(descr, obj, (PyObject *)tp); + Py_DECREF(descr); + return res; + } + } + return descr; +} +#endif + +/* PyObject_GenericGetAttr */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) { + if (unlikely(Py_TYPE(obj)->tp_dictoffset)) { + return PyObject_GenericGetAttr(obj, attr_name); + } + return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name); +} +#endif + +/* SetVTable */ +static int __Pyx_SetVtable(PyObject *dict, void *vtable) { +#if PY_VERSION_HEX >= 0x02070000 + PyObject *ob = PyCapsule_New(vtable, 0, 0); +#else + PyObject *ob = PyCObject_FromVoidPtr(vtable, 0); +#endif + if (!ob) + goto bad; + if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0) + goto bad; + Py_DECREF(ob); + return 0; +bad: + Py_XDECREF(ob); + return -1; +} + +/* FetchCommonType */ +static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { + PyObject* fake_module; + PyTypeObject* cached_type = NULL; + fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI); + if (!fake_module) return NULL; + Py_INCREF(fake_module); + cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name); + if (cached_type) { + if (!PyType_Check((PyObject*)cached_type)) { + PyErr_Format(PyExc_TypeError, + "Shared Cython type %.200s is not a type object", + type->tp_name); + goto bad; + } + if (cached_type->tp_basicsize != type->tp_basicsize) { + PyErr_Format(PyExc_TypeError, + "Shared Cython type %.200s has the wrong size, try recompiling", + type->tp_name); + goto bad; + } + } else { + if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; + PyErr_Clear(); + if (PyType_Ready(type) < 0) goto bad; + if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0) + goto bad; + Py_INCREF(type); + cached_type = type; + } +done: + Py_DECREF(fake_module); + return cached_type; +bad: + Py_XDECREF(cached_type); + cached_type = NULL; + goto done; +} + +/* CythonFunction */ +#include +static PyObject * +__Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure) +{ + if (unlikely(op->func_doc == NULL)) { + if (op->func.m_ml->ml_doc) { +#if PY_MAJOR_VERSION >= 3 + op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc); +#else + op->func_doc = PyString_FromString(op->func.m_ml->ml_doc); +#endif + if (unlikely(op->func_doc == NULL)) + return NULL; + } else { + Py_INCREF(Py_None); + return Py_None; + } + } + Py_INCREF(op->func_doc); + return op->func_doc; +} +static int +__Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context) +{ + PyObject *tmp = op->func_doc; + if (value == NULL) { + value = Py_None; + } + Py_INCREF(value); + op->func_doc = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + if (unlikely(op->func_name == NULL)) { +#if PY_MAJOR_VERSION >= 3 + op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name); +#else + op->func_name = PyString_InternFromString(op->func.m_ml->ml_name); +#endif + if (unlikely(op->func_name == NULL)) + return NULL; + } + Py_INCREF(op->func_name); + return op->func_name; +} +static int +__Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context) +{ + PyObject *tmp; +#if PY_MAJOR_VERSION >= 3 + if (unlikely(value == NULL || !PyUnicode_Check(value))) +#else + if (unlikely(value == NULL || !PyString_Check(value))) +#endif + { + PyErr_SetString(PyExc_TypeError, + "__name__ must be set to a string object"); + return -1; + } + tmp = op->func_name; + Py_INCREF(value); + op->func_name = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + Py_INCREF(op->func_qualname); + return op->func_qualname; +} +static int +__Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context) +{ + PyObject *tmp; +#if PY_MAJOR_VERSION >= 3 + if (unlikely(value == NULL || !PyUnicode_Check(value))) +#else + if (unlikely(value == NULL || !PyString_Check(value))) +#endif + { + PyErr_SetString(PyExc_TypeError, + "__qualname__ must be set to a string object"); + return -1; + } + tmp = op->func_qualname; + Py_INCREF(value); + op->func_qualname = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED void *closure) +{ + PyObject *self; + self = m->func_closure; + if (self == NULL) + self = Py_None; + Py_INCREF(self); + return self; +} +static PyObject * +__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + if (unlikely(op->func_dict == NULL)) { + op->func_dict = PyDict_New(); + if (unlikely(op->func_dict == NULL)) + return NULL; + } + Py_INCREF(op->func_dict); + return op->func_dict; +} +static int +__Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context) +{ + PyObject *tmp; + if (unlikely(value == NULL)) { + PyErr_SetString(PyExc_TypeError, + "function's dictionary may not be deleted"); + return -1; + } + if (unlikely(!PyDict_Check(value))) { + PyErr_SetString(PyExc_TypeError, + "setting function's dictionary to a non-dict"); + return -1; + } + tmp = op->func_dict; + Py_INCREF(value); + op->func_dict = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + Py_INCREF(op->func_globals); + return op->func_globals; +} +static PyObject * +__Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + Py_INCREF(Py_None); + return Py_None; +} +static PyObject * +__Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + PyObject* result = (op->func_code) ? op->func_code : Py_None; + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { + int result = 0; + PyObject *res = op->defaults_getter((PyObject *) op); + if (unlikely(!res)) + return -1; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + op->defaults_tuple = PyTuple_GET_ITEM(res, 0); + Py_INCREF(op->defaults_tuple); + op->defaults_kwdict = PyTuple_GET_ITEM(res, 1); + Py_INCREF(op->defaults_kwdict); + #else + op->defaults_tuple = PySequence_ITEM(res, 0); + if (unlikely(!op->defaults_tuple)) result = -1; + else { + op->defaults_kwdict = PySequence_ITEM(res, 1); + if (unlikely(!op->defaults_kwdict)) result = -1; + } + #endif + Py_DECREF(res); + return result; +} +static int +__Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) { + PyObject* tmp; + if (!value) { + value = Py_None; + } else if (value != Py_None && !PyTuple_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__defaults__ must be set to a tuple object"); + return -1; + } + Py_INCREF(value); + tmp = op->defaults_tuple; + op->defaults_tuple = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) { + PyObject* result = op->defaults_tuple; + if (unlikely(!result)) { + if (op->defaults_getter) { + if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL; + result = op->defaults_tuple; + } else { + result = Py_None; + } + } + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) { + PyObject* tmp; + if (!value) { + value = Py_None; + } else if (value != Py_None && !PyDict_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__kwdefaults__ must be set to a dict object"); + return -1; + } + Py_INCREF(value); + tmp = op->defaults_kwdict; + op->defaults_kwdict = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) { + PyObject* result = op->defaults_kwdict; + if (unlikely(!result)) { + if (op->defaults_getter) { + if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL; + result = op->defaults_kwdict; + } else { + result = Py_None; + } + } + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) { + PyObject* tmp; + if (!value || value == Py_None) { + value = NULL; + } else if (!PyDict_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__annotations__ must be set to a dict object"); + return -1; + } + Py_XINCREF(value); + tmp = op->func_annotations; + op->func_annotations = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) { + PyObject* result = op->func_annotations; + if (unlikely(!result)) { + result = PyDict_New(); + if (unlikely(!result)) return NULL; + op->func_annotations = result; + } + Py_INCREF(result); + return result; +} +static PyGetSetDef __pyx_CyFunction_getsets[] = { + {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, + {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, + {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, + {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, + {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, + {(char *) "__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0}, + {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, + {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, + {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, + {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, + {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, + {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, + {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, + {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, + {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, + {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, + {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, + {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, + {0, 0, 0, 0, 0} +}; +static PyMemberDef __pyx_CyFunction_members[] = { + {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), PY_WRITE_RESTRICTED, 0}, + {0, 0, 0, 0, 0} +}; +static PyObject * +__Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args) +{ +#if PY_MAJOR_VERSION >= 3 + return PyUnicode_FromString(m->func.m_ml->ml_name); +#else + return PyString_FromString(m->func.m_ml->ml_name); +#endif +} +static PyMethodDef __pyx_CyFunction_methods[] = { + {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, + {0, 0, 0, 0} +}; +#if PY_VERSION_HEX < 0x030500A0 +#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist) +#else +#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func.m_weakreflist) +#endif +static PyObject *__Pyx_CyFunction_New(PyTypeObject *type, PyMethodDef *ml, int flags, PyObject* qualname, + PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { + __pyx_CyFunctionObject *op = PyObject_GC_New(__pyx_CyFunctionObject, type); + if (op == NULL) + return NULL; + op->flags = flags; + __Pyx_CyFunction_weakreflist(op) = NULL; + op->func.m_ml = ml; + op->func.m_self = (PyObject *) op; + Py_XINCREF(closure); + op->func_closure = closure; + Py_XINCREF(module); + op->func.m_module = module; + op->func_dict = NULL; + op->func_name = NULL; + Py_INCREF(qualname); + op->func_qualname = qualname; + op->func_doc = NULL; + op->func_classobj = NULL; + op->func_globals = globals; + Py_INCREF(op->func_globals); + Py_XINCREF(code); + op->func_code = code; + op->defaults_pyobjects = 0; + op->defaults = NULL; + op->defaults_tuple = NULL; + op->defaults_kwdict = NULL; + op->defaults_getter = NULL; + op->func_annotations = NULL; + PyObject_GC_Track(op); + return (PyObject *) op; +} +static int +__Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) +{ + Py_CLEAR(m->func_closure); + Py_CLEAR(m->func.m_module); + Py_CLEAR(m->func_dict); + Py_CLEAR(m->func_name); + Py_CLEAR(m->func_qualname); + Py_CLEAR(m->func_doc); + Py_CLEAR(m->func_globals); + Py_CLEAR(m->func_code); + Py_CLEAR(m->func_classobj); + Py_CLEAR(m->defaults_tuple); + Py_CLEAR(m->defaults_kwdict); + Py_CLEAR(m->func_annotations); + if (m->defaults) { + PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); + int i; + for (i = 0; i < m->defaults_pyobjects; i++) + Py_XDECREF(pydefaults[i]); + PyObject_Free(m->defaults); + m->defaults = NULL; + } + return 0; +} +static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m) +{ + if (__Pyx_CyFunction_weakreflist(m) != NULL) + PyObject_ClearWeakRefs((PyObject *) m); + __Pyx_CyFunction_clear(m); + PyObject_GC_Del(m); +} +static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) +{ + PyObject_GC_UnTrack(m); + __Pyx__CyFunction_dealloc(m); +} +static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) +{ + Py_VISIT(m->func_closure); + Py_VISIT(m->func.m_module); + Py_VISIT(m->func_dict); + Py_VISIT(m->func_name); + Py_VISIT(m->func_qualname); + Py_VISIT(m->func_doc); + Py_VISIT(m->func_globals); + Py_VISIT(m->func_code); + Py_VISIT(m->func_classobj); + Py_VISIT(m->defaults_tuple); + Py_VISIT(m->defaults_kwdict); + if (m->defaults) { + PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); + int i; + for (i = 0; i < m->defaults_pyobjects; i++) + Py_VISIT(pydefaults[i]); + } + return 0; +} +static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type) +{ + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) { + Py_INCREF(func); + return func; + } + if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) { + if (type == NULL) + type = (PyObject *)(Py_TYPE(obj)); + return __Pyx_PyMethod_New(func, type, (PyObject *)(Py_TYPE(type))); + } + if (obj == Py_None) + obj = NULL; + return __Pyx_PyMethod_New(func, obj, type); +} +static PyObject* +__Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) +{ +#if PY_MAJOR_VERSION >= 3 + return PyUnicode_FromFormat("", + op->func_qualname, (void *)op); +#else + return PyString_FromFormat("", + PyString_AsString(op->func_qualname), (void *)op); +#endif +} +static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) { + PyCFunctionObject* f = (PyCFunctionObject*)func; + PyCFunction meth = f->m_ml->ml_meth; + Py_ssize_t size; + switch (f->m_ml->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) { + case METH_VARARGS: + if (likely(kw == NULL || PyDict_Size(kw) == 0)) + return (*meth)(self, arg); + break; + case METH_VARARGS | METH_KEYWORDS: + return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw); + case METH_NOARGS: + if (likely(kw == NULL || PyDict_Size(kw) == 0)) { + size = PyTuple_GET_SIZE(arg); + if (likely(size == 0)) + return (*meth)(self, NULL); + PyErr_Format(PyExc_TypeError, + "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", + f->m_ml->ml_name, size); + return NULL; + } + break; + case METH_O: + if (likely(kw == NULL || PyDict_Size(kw) == 0)) { + size = PyTuple_GET_SIZE(arg); + if (likely(size == 1)) { + PyObject *result, *arg0; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + arg0 = PyTuple_GET_ITEM(arg, 0); + #else + arg0 = PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL; + #endif + result = (*meth)(self, arg0); + #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) + Py_DECREF(arg0); + #endif + return result; + } + PyErr_Format(PyExc_TypeError, + "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", + f->m_ml->ml_name, size); + return NULL; + } + break; + default: + PyErr_SetString(PyExc_SystemError, "Bad call flags in " + "__Pyx_CyFunction_Call. METH_OLDARGS is no " + "longer supported!"); + return NULL; + } + PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", + f->m_ml->ml_name); + return NULL; +} +static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { + return __Pyx_CyFunction_CallMethod(func, ((PyCFunctionObject*)func)->m_self, arg, kw); +} +static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) { + PyObject *result; + __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func; + if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { + Py_ssize_t argc; + PyObject *new_args; + PyObject *self; + argc = PyTuple_GET_SIZE(args); + new_args = PyTuple_GetSlice(args, 1, argc); + if (unlikely(!new_args)) + return NULL; + self = PyTuple_GetItem(args, 0); + if (unlikely(!self)) { + Py_DECREF(new_args); + return NULL; + } + result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw); + Py_DECREF(new_args); + } else { + result = __Pyx_CyFunction_Call(func, args, kw); + } + return result; +} +static PyTypeObject __pyx_CyFunctionType_type = { + PyVarObject_HEAD_INIT(0, 0) + "cython_function_or_method", + sizeof(__pyx_CyFunctionObject), + 0, + (destructor) __Pyx_CyFunction_dealloc, + 0, + 0, + 0, +#if PY_MAJOR_VERSION < 3 + 0, +#else + 0, +#endif + (reprfunc) __Pyx_CyFunction_repr, + 0, + 0, + 0, + 0, + __Pyx_CyFunction_CallAsMethod, + 0, + 0, + 0, + 0, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, + 0, + (traverseproc) __Pyx_CyFunction_traverse, + (inquiry) __Pyx_CyFunction_clear, + 0, +#if PY_VERSION_HEX < 0x030500A0 + offsetof(__pyx_CyFunctionObject, func_weakreflist), +#else + offsetof(PyCFunctionObject, m_weakreflist), +#endif + 0, + 0, + __pyx_CyFunction_methods, + __pyx_CyFunction_members, + __pyx_CyFunction_getsets, + 0, + 0, + __Pyx_CyFunction_descr_get, + 0, + offsetof(__pyx_CyFunctionObject, func_dict), + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, +#if PY_VERSION_HEX >= 0x030400a1 + 0, +#endif +}; +static int __pyx_CyFunction_init(void) { + __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); + if (unlikely(__pyx_CyFunctionType == NULL)) { + return -1; + } + return 0; +} +static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults = PyObject_Malloc(size); + if (unlikely(!m->defaults)) + return PyErr_NoMemory(); + memset(m->defaults, 0, size); + m->defaults_pyobjects = pyobjects; + return m->defaults; +} +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults_tuple = tuple; + Py_INCREF(tuple); +} +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults_kwdict = dict; + Py_INCREF(dict); +} +static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->func_annotations = dict; + Py_INCREF(dict); +} + +/* GetModuleGlobalName */ +#if CYTHON_USE_DICT_VERSIONS +static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value) +#else +static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) +#endif +{ + PyObject *result; +#if !CYTHON_AVOID_BORROWED_REFS +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 + result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } else if (unlikely(PyErr_Occurred())) { + return NULL; + } +#else + result = PyDict_GetItem(__pyx_d, name); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } +#endif +#else + result = PyObject_GetItem(__pyx_d, name); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } + PyErr_Clear(); +#endif + return __Pyx_GetBuiltinName(name); +} + +/* PyObjectSetAttrStr */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) { + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_setattro)) + return tp->tp_setattro(obj, attr_name, value); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_setattr)) + return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value); +#endif + return PyObject_SetAttr(obj, attr_name, value); +} +#endif + +/* PyErrExceptionMatches */ +#if CYTHON_FAST_THREAD_STATE +static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { + Py_ssize_t i, n; + n = PyTuple_GET_SIZE(tuple); +#if PY_MAJOR_VERSION >= 3 + for (i=0; icurexc_type; + if (exc_type == err) return 1; + if (unlikely(!exc_type)) return 0; + if (unlikely(PyTuple_Check(err))) + return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err); + return __Pyx_PyErr_GivenExceptionMatches(exc_type, err); +} +#endif + +/* GetNameInClass */ +static PyObject *__Pyx_GetGlobalNameAfterAttributeLookup(PyObject *name) { + PyObject *result; + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) + return NULL; + __Pyx_PyErr_Clear(); + __Pyx_GetModuleGlobalNameUncached(result, name); + return result; +} +static PyObject *__Pyx__GetNameInClass(PyObject *nmspace, PyObject *name) { + PyObject *result; + result = __Pyx_PyObject_GetAttrStr(nmspace, name); + if (!result) { + result = __Pyx_GetGlobalNameAfterAttributeLookup(name); + } + return result; +} + +/* Import */ +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { + PyObject *empty_list = 0; + PyObject *module = 0; + PyObject *global_dict = 0; + PyObject *empty_dict = 0; + PyObject *list; + #if PY_MAJOR_VERSION < 3 + PyObject *py_import; + py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); + if (!py_import) + goto bad; + #endif + if (from_list) + list = from_list; + else { + empty_list = PyList_New(0); + if (!empty_list) + goto bad; + list = empty_list; + } + global_dict = PyModule_GetDict(__pyx_m); + if (!global_dict) + goto bad; + empty_dict = PyDict_New(); + if (!empty_dict) + goto bad; + { + #if PY_MAJOR_VERSION >= 3 + if (level == -1) { + if (strchr(__Pyx_MODULE_NAME, '.')) { + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, 1); + if (!module) { + if (!PyErr_ExceptionMatches(PyExc_ImportError)) + goto bad; + PyErr_Clear(); + } + } + level = 0; + } + #endif + if (!module) { + #if PY_MAJOR_VERSION < 3 + PyObject *py_level = PyInt_FromLong(level); + if (!py_level) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, py_level, (PyObject *)NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, level); + #endif + } + } +bad: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(py_import); + #endif + Py_XDECREF(empty_list); + Py_XDECREF(empty_dict); + return module; +} + +/* ImportFrom */ +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { + PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); + if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_Format(PyExc_ImportError, + #if PY_MAJOR_VERSION < 3 + "cannot import name %.230s", PyString_AS_STRING(name)); + #else + "cannot import name %S", name); + #endif + } + return value; +} + +/* GetAttr */ +static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) { +#if CYTHON_USE_TYPE_SLOTS +#if PY_MAJOR_VERSION >= 3 + if (likely(PyUnicode_Check(n))) +#else + if (likely(PyString_Check(n))) +#endif + return __Pyx_PyObject_GetAttrStr(o, n); +#endif + return PyObject_GetAttr(o, n); +} + +/* Globals */ +static PyObject* __Pyx_Globals(void) { + Py_ssize_t i; + PyObject *names; + PyObject *globals = __pyx_d; + Py_INCREF(globals); + names = PyObject_Dir(__pyx_m); + if (!names) + goto bad; + for (i = PyList_GET_SIZE(names)-1; i >= 0; i--) { +#if CYTHON_COMPILING_IN_PYPY + PyObject* name = PySequence_ITEM(names, i); + if (!name) + goto bad; +#else + PyObject* name = PyList_GET_ITEM(names, i); +#endif + if (!PyDict_Contains(globals, name)) { + PyObject* value = __Pyx_GetAttr(__pyx_m, name); + if (!value) { +#if CYTHON_COMPILING_IN_PYPY + Py_DECREF(name); +#endif + goto bad; + } + if (PyDict_SetItem(globals, name, value) < 0) { +#if CYTHON_COMPILING_IN_PYPY + Py_DECREF(name); +#endif + Py_DECREF(value); + goto bad; + } + } +#if CYTHON_COMPILING_IN_PYPY + Py_DECREF(name); +#endif + } + Py_DECREF(names); + return globals; +bad: + Py_XDECREF(names); + Py_XDECREF(globals); + return NULL; +} + +/* CLineInTraceback */ +#ifndef CYTHON_CLINE_IN_TRACEBACK +static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { + PyObject *use_cline; + PyObject *ptype, *pvalue, *ptraceback; +#if CYTHON_COMPILING_IN_CPYTHON + PyObject **cython_runtime_dict; +#endif + if (unlikely(!__pyx_cython_runtime)) { + return c_line; + } + __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); +#if CYTHON_COMPILING_IN_CPYTHON + cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); + if (likely(cython_runtime_dict)) { + __PYX_PY_DICT_LOOKUP_IF_MODIFIED( + use_cline, *cython_runtime_dict, + __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback)) + } else +#endif + { + PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback); + if (use_cline_obj) { + use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; + Py_DECREF(use_cline_obj); + } else { + PyErr_Clear(); + use_cline = NULL; + } + } + if (!use_cline) { + c_line = 0; + PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); + } + else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { + c_line = 0; + } + __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); + return c_line; +} +#endif + +/* CodeObjectCache */ +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { + int start = 0, mid = 0, end = count - 1; + if (end >= 0 && code_line > entries[end].code_line) { + return count; + } + while (start < end) { + mid = start + (end - start) / 2; + if (code_line < entries[mid].code_line) { + end = mid; + } else if (code_line > entries[mid].code_line) { + start = mid + 1; + } else { + return mid; + } + } + if (code_line <= entries[mid].code_line) { + return mid; + } else { + return mid + 1; + } +} +static PyCodeObject *__pyx_find_code_object(int code_line) { + PyCodeObject* code_object; + int pos; + if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { + return NULL; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { + return NULL; + } + code_object = __pyx_code_cache.entries[pos].code_object; + Py_INCREF(code_object); + return code_object; +} +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { + int pos, i; + __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; + if (unlikely(!code_line)) { + return; + } + if (unlikely(!entries)) { + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); + if (likely(entries)) { + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = 64; + __pyx_code_cache.count = 1; + entries[0].code_line = code_line; + entries[0].code_object = code_object; + Py_INCREF(code_object); + } + return; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { + PyCodeObject* tmp = entries[pos].code_object; + entries[pos].code_object = code_object; + Py_DECREF(tmp); + return; + } + if (__pyx_code_cache.count == __pyx_code_cache.max_count) { + int new_max = __pyx_code_cache.max_count + 64; + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( + __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry)); + if (unlikely(!entries)) { + return; + } + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = new_max; + } + for (i=__pyx_code_cache.count; i>pos; i--) { + entries[i] = entries[i-1]; + } + entries[pos].code_line = code_line; + entries[pos].code_object = code_object; + __pyx_code_cache.count++; + Py_INCREF(code_object); +} + +/* AddTraceback */ +#include "compile.h" +#include "frameobject.h" +#include "traceback.h" +static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( + const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyObject *py_srcfile = 0; + PyObject *py_funcname = 0; + #if PY_MAJOR_VERSION < 3 + py_srcfile = PyString_FromString(filename); + #else + py_srcfile = PyUnicode_FromString(filename); + #endif + if (!py_srcfile) goto bad; + if (c_line) { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + #else + py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + #endif + } + else { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromString(funcname); + #else + py_funcname = PyUnicode_FromString(funcname); + #endif + } + if (!py_funcname) goto bad; + py_code = __Pyx_PyCode_New( + 0, + 0, + 0, + 0, + 0, + __pyx_empty_bytes, /*PyObject *code,*/ + __pyx_empty_tuple, /*PyObject *consts,*/ + __pyx_empty_tuple, /*PyObject *names,*/ + __pyx_empty_tuple, /*PyObject *varnames,*/ + __pyx_empty_tuple, /*PyObject *freevars,*/ + __pyx_empty_tuple, /*PyObject *cellvars,*/ + py_srcfile, /*PyObject *filename,*/ + py_funcname, /*PyObject *name,*/ + py_line, + __pyx_empty_bytes /*PyObject *lnotab*/ + ); + Py_DECREF(py_srcfile); + Py_DECREF(py_funcname); + return py_code; +bad: + Py_XDECREF(py_srcfile); + Py_XDECREF(py_funcname); + return NULL; +} +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyFrameObject *py_frame = 0; + PyThreadState *tstate = __Pyx_PyThreadState_Current; + if (c_line) { + c_line = __Pyx_CLineForTraceback(tstate, c_line); + } + py_code = __pyx_find_code_object(c_line ? -c_line : py_line); + if (!py_code) { + py_code = __Pyx_CreateCodeObjectForTraceback( + funcname, c_line, py_line, filename); + if (!py_code) goto bad; + __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); + } + py_frame = PyFrame_New( + tstate, /*PyThreadState *tstate,*/ + py_code, /*PyCodeObject *code,*/ + __pyx_d, /*PyObject *globals,*/ + 0 /*PyObject *locals*/ + ); + if (!py_frame) goto bad; + __Pyx_PyFrame_SetLineNumber(py_frame, py_line); + PyTraceBack_Here(py_frame); +bad: + Py_XDECREF(py_code); + Py_XDECREF(py_frame); +} + +/* CIntFromPyVerify */ +#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ + __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) +#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ + __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) +#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ + {\ + func_type value = func_value;\ + if (sizeof(target_type) < sizeof(func_type)) {\ + if (unlikely(value != (func_type) (target_type) value)) {\ + func_type zero = 0;\ + if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ + return (target_type) -1;\ + if (is_unsigned && unlikely(value < zero))\ + goto raise_neg_overflow;\ + else\ + goto raise_overflow;\ + }\ + }\ + return (target_type) value;\ + } + +/* CIntToPy */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { + const int neg_one = (int) ((int) 0 - (int) 1), const_zero = (int) 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(int) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(int) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(int) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(int), + little, !is_unsigned); + } +} + +/* CIntFromPy */ +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { + const int neg_one = (int) ((int) 0 - (int) 1), const_zero = (int) 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(int) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (int) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (int) 0; + case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0]) + case 2: + if (8 * sizeof(int) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) { + return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + case 3: + if (8 * sizeof(int) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) { + return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + case 4: + if (8 * sizeof(int) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) { + return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (int) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if (sizeof(int) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (int) 0; + case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0])) + case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0]) + case -2: + if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { + return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 2: + if (8 * sizeof(int) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { + return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case -3: + if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { + return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 3: + if (8 * sizeof(int) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { + return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case -4: + if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { + return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 4: + if (8 * sizeof(int) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { + return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + } +#endif + if (sizeof(int) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + int val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (int) -1; + } + } else { + int val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (int) -1; + val = __Pyx_PyInt_As_int(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to int"); + return (int) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to int"); + return (int) -1; +} + +/* CIntToPy */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { + const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(long) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(long) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(long) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(long), + little, !is_unsigned); + } +} + +/* CIntFromPy */ +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { + const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(long) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (long) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (long) 0; + case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0]) + case 2: + if (8 * sizeof(long) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) { + return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + case 3: + if (8 * sizeof(long) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) { + return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + case 4: + if (8 * sizeof(long) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) { + return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (long) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if (sizeof(long) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (long) 0; + case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0])) + case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0]) + case -2: + if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 2: + if (8 * sizeof(long) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case -3: + if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 3: + if (8 * sizeof(long) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case -4: + if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 4: + if (8 * sizeof(long) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + } +#endif + if (sizeof(long) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + long val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (long) -1; + } + } else { + long val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (long) -1; + val = __Pyx_PyInt_As_long(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to long"); + return (long) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to long"); + return (long) -1; +} + +/* FastTypeChecks */ +#if CYTHON_COMPILING_IN_CPYTHON +static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) { + while (a) { + a = a->tp_base; + if (a == b) + return 1; + } + return b == &PyBaseObject_Type; +} +static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) { + PyObject *mro; + if (a == b) return 1; + mro = a->tp_mro; + if (likely(mro)) { + Py_ssize_t i, n; + n = PyTuple_GET_SIZE(mro); + for (i = 0; i < n; i++) { + if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b) + return 1; + } + return 0; + } + return __Pyx_InBases(a, b); +} +#if PY_MAJOR_VERSION == 2 +static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { + PyObject *exception, *value, *tb; + int res; + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ErrFetch(&exception, &value, &tb); + res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; + if (unlikely(res == -1)) { + PyErr_WriteUnraisable(err); + res = 0; + } + if (!res) { + res = PyObject_IsSubclass(err, exc_type2); + if (unlikely(res == -1)) { + PyErr_WriteUnraisable(err); + res = 0; + } + } + __Pyx_ErrRestore(exception, value, tb); + return res; +} +#else +static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { + int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0; + if (!res) { + res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); + } + return res; +} +#endif +static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { + Py_ssize_t i, n; + assert(PyExceptionClass_Check(exc_type)); + n = PyTuple_GET_SIZE(tuple); +#if PY_MAJOR_VERSION >= 3 + for (i=0; i= 0x02070000 + cobj = PyCapsule_New(p, sig, 0); +#else + cobj = PyCObject_FromVoidPtrAndDesc(p, (void *)sig, 0); +#endif + if (!cobj) + goto bad; + if (PyDict_SetItem(d, name, cobj) < 0) + goto bad; + Py_DECREF(cobj); + Py_DECREF(d); + return 0; +bad: + Py_XDECREF(cobj); + Py_XDECREF(d); + return -1; +} + +/* VoidPtrImport */ +#ifndef __PYX_HAVE_RT_ImportVoidPtr +#define __PYX_HAVE_RT_ImportVoidPtr +static int __Pyx_ImportVoidPtr(PyObject *module, const char *name, void **p, const char *sig) { + PyObject *d = 0; + PyObject *cobj = 0; + d = PyObject_GetAttrString(module, (char *)"__pyx_capi__"); + if (!d) + goto bad; + cobj = PyDict_GetItemString(d, name); + if (!cobj) { + PyErr_Format(PyExc_ImportError, + "%.200s does not export expected C variable %.200s", + PyModule_GetName(module), name); + goto bad; + } +#if PY_VERSION_HEX >= 0x02070000 + if (!PyCapsule_IsValid(cobj, sig)) { + PyErr_Format(PyExc_TypeError, + "C variable %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", + PyModule_GetName(module), name, sig, PyCapsule_GetName(cobj)); + goto bad; + } + *p = PyCapsule_GetPointer(cobj, sig); +#else + {const char *desc, *s1, *s2; + desc = (const char *)PyCObject_GetDesc(cobj); + if (!desc) + goto bad; + s1 = desc; s2 = sig; + while (*s1 != '\0' && *s1 == *s2) { s1++; s2++; } + if (*s1 != *s2) { + PyErr_Format(PyExc_TypeError, + "C variable %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", + PyModule_GetName(module), name, sig, desc); + goto bad; + } + *p = PyCObject_AsVoidPtr(cobj);} +#endif + if (!(*p)) + goto bad; + Py_DECREF(d); + return 0; +bad: + Py_XDECREF(d); + return -1; +} +#endif + +/* FunctionImport */ +#ifndef __PYX_HAVE_RT_ImportFunction +#define __PYX_HAVE_RT_ImportFunction +static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig) { + PyObject *d = 0; + PyObject *cobj = 0; + union { + void (*fp)(void); + void *p; + } tmp; + d = PyObject_GetAttrString(module, (char *)"__pyx_capi__"); + if (!d) + goto bad; + cobj = PyDict_GetItemString(d, funcname); + if (!cobj) { + PyErr_Format(PyExc_ImportError, + "%.200s does not export expected C function %.200s", + PyModule_GetName(module), funcname); + goto bad; + } +#if PY_VERSION_HEX >= 0x02070000 + if (!PyCapsule_IsValid(cobj, sig)) { + PyErr_Format(PyExc_TypeError, + "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", + PyModule_GetName(module), funcname, sig, PyCapsule_GetName(cobj)); + goto bad; + } + tmp.p = PyCapsule_GetPointer(cobj, sig); +#else + {const char *desc, *s1, *s2; + desc = (const char *)PyCObject_GetDesc(cobj); + if (!desc) + goto bad; + s1 = desc; s2 = sig; + while (*s1 != '\0' && *s1 == *s2) { s1++; s2++; } + if (*s1 != *s2) { + PyErr_Format(PyExc_TypeError, + "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", + PyModule_GetName(module), funcname, sig, desc); + goto bad; + } + tmp.p = PyCObject_AsVoidPtr(cobj);} +#endif + *f = tmp.fp; + if (!(*f)) + goto bad; + Py_DECREF(d); + return 0; +bad: + Py_XDECREF(d); + return -1; +} +#endif + +/* InitStrings */ +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { + while (t->p) { + #if PY_MAJOR_VERSION < 3 + if (t->is_unicode) { + *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); + } else if (t->intern) { + *t->p = PyString_InternFromString(t->s); + } else { + *t->p = PyString_FromStringAndSize(t->s, t->n - 1); + } + #else + if (t->is_unicode | t->is_str) { + if (t->intern) { + *t->p = PyUnicode_InternFromString(t->s); + } else if (t->encoding) { + *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); + } else { + *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); + } + } else { + *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); + } + #endif + if (!*t->p) + return -1; + if (PyObject_Hash(*t->p) == -1) + return -1; + ++t; + } + return 0; +} + +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { + return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); +} +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { + Py_ssize_t ignore; + return __Pyx_PyObject_AsStringAndSize(o, &ignore); +} +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +#if !CYTHON_PEP393_ENABLED +static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { + char* defenc_c; + PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); + if (!defenc) return NULL; + defenc_c = PyBytes_AS_STRING(defenc); +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + { + char* end = defenc_c + PyBytes_GET_SIZE(defenc); + char* c; + for (c = defenc_c; c < end; c++) { + if ((unsigned char) (*c) >= 128) { + PyUnicode_AsASCIIString(o); + return NULL; + } + } + } +#endif + *length = PyBytes_GET_SIZE(defenc); + return defenc_c; +} +#else +static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { + if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + if (likely(PyUnicode_IS_ASCII(o))) { + *length = PyUnicode_GET_LENGTH(o); + return PyUnicode_AsUTF8(o); + } else { + PyUnicode_AsASCIIString(o); + return NULL; + } +#else + return PyUnicode_AsUTF8AndSize(o, length); +#endif +} +#endif +#endif +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT + if ( +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + __Pyx_sys_getdefaultencoding_not_ascii && +#endif + PyUnicode_Check(o)) { + return __Pyx_PyUnicode_AsStringAndSize(o, length); + } else +#endif +#if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) + if (PyByteArray_Check(o)) { + *length = PyByteArray_GET_SIZE(o); + return PyByteArray_AS_STRING(o); + } else +#endif + { + char* result; + int r = PyBytes_AsStringAndSize(o, &result, length); + if (unlikely(r < 0)) { + return NULL; + } else { + return result; + } + } +} +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { + int is_true = x == Py_True; + if (is_true | (x == Py_False) | (x == Py_None)) return is_true; + else return PyObject_IsTrue(x); +} +static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) { + int retval; + if (unlikely(!x)) return -1; + retval = __Pyx_PyObject_IsTrue(x); + Py_DECREF(x); + return retval; +} +static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) { +#if PY_MAJOR_VERSION >= 3 + if (PyLong_Check(result)) { + if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, + "__int__ returned non-int (type %.200s). " + "The ability to return an instance of a strict subclass of int " + "is deprecated, and may be removed in a future version of Python.", + Py_TYPE(result)->tp_name)) { + Py_DECREF(result); + return NULL; + } + return result; + } +#endif + PyErr_Format(PyExc_TypeError, + "__%.4s__ returned non-%.4s (type %.200s)", + type_name, type_name, Py_TYPE(result)->tp_name); + Py_DECREF(result); + return NULL; +} +static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { +#if CYTHON_USE_TYPE_SLOTS + PyNumberMethods *m; +#endif + const char *name = NULL; + PyObject *res = NULL; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x) || PyLong_Check(x))) +#else + if (likely(PyLong_Check(x))) +#endif + return __Pyx_NewRef(x); +#if CYTHON_USE_TYPE_SLOTS + m = Py_TYPE(x)->tp_as_number; + #if PY_MAJOR_VERSION < 3 + if (m && m->nb_int) { + name = "int"; + res = m->nb_int(x); + } + else if (m && m->nb_long) { + name = "long"; + res = m->nb_long(x); + } + #else + if (likely(m && m->nb_int)) { + name = "int"; + res = m->nb_int(x); + } + #endif +#else + if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { + res = PyNumber_Int(x); + } +#endif + if (likely(res)) { +#if PY_MAJOR_VERSION < 3 + if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) { +#else + if (unlikely(!PyLong_CheckExact(res))) { +#endif + return __Pyx_PyNumber_IntOrLongWrongResultType(res, name); + } + } + else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_TypeError, + "an integer is required"); + } + return res; +} +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { + Py_ssize_t ival; + PyObject *x; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_CheckExact(b))) { + if (sizeof(Py_ssize_t) >= sizeof(long)) + return PyInt_AS_LONG(b); + else + return PyInt_AsSsize_t(b); + } +#endif + if (likely(PyLong_CheckExact(b))) { + #if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)b)->ob_digit; + const Py_ssize_t size = Py_SIZE(b); + if (likely(__Pyx_sst_abs(size) <= 1)) { + ival = likely(size) ? digits[0] : 0; + if (size == -1) ival = -ival; + return ival; + } else { + switch (size) { + case 2: + if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { + return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -2: + if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case 3: + if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { + return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -3: + if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case 4: + if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { + return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -4: + if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + } + } + #endif + return PyLong_AsSsize_t(b); + } + x = PyNumber_Index(b); + if (!x) return -1; + ival = PyInt_AsSsize_t(x); + Py_DECREF(x); + return ival; +} +static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) { + return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False); +} +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { + return PyInt_FromSize_t(ival); +} + + +#endif /* Py_PYTHON_H */ diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_semaphore.html b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_semaphore.html new file mode 100644 index 00000000..afbe0304 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_semaphore.html @@ -0,0 +1,2285 @@ + + + + + + Cython: _semaphore.py + + + +

Generated by Cython 0.29.2

+

+ Yellow lines hint at Python interaction.
+ Click on a line that starts with a "+" to see the C code that Cython generated for it. +

+
+
+001: # cython: auto_pickle=False,embedsignature=True,always_allow_keywords=False
+
  __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
 002: from __future__ import print_function, absolute_import, division
+
 003: 
+
+004: __all__ = [
+
  __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(__pyx_n_s_Semaphore);
+  __Pyx_GIVEREF(__pyx_n_s_Semaphore);
+  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_Semaphore);
+  __Pyx_INCREF(__pyx_n_s_BoundedSemaphore);
+  __Pyx_GIVEREF(__pyx_n_s_BoundedSemaphore);
+  PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_BoundedSemaphore);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_all, __pyx_t_1) < 0) __PYX_ERR(0, 4, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 005:     'Semaphore',
+
 006:     'BoundedSemaphore',
+
 007: ]
+
 008: 
+
+009: def _get_linkable():
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_11__semaphore_1_get_linkable(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6gevent_11__semaphore__get_linkable[] = "_get_linkable()";
+static PyMethodDef __pyx_mdef_6gevent_11__semaphore_1_get_linkable = {"_get_linkable", (PyCFunction)__pyx_pw_6gevent_11__semaphore_1_get_linkable, METH_NOARGS, __pyx_doc_6gevent_11__semaphore__get_linkable};
+static PyObject *__pyx_pw_6gevent_11__semaphore_1_get_linkable(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_get_linkable (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_11__semaphore__get_linkable(__pyx_self);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_11__semaphore__get_linkable(CYTHON_UNUSED PyObject *__pyx_self) {
+  PyObject *__pyx_v_x = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_get_linkable", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_AddTraceback("gevent.__semaphore._get_linkable", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_x);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__3 = PyTuple_Pack(1, __pyx_n_s_x); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 9, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__3);
+  __Pyx_GIVEREF(__pyx_tuple__3);
+/* … */
+  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_11__semaphore_1_get_linkable, 0, __pyx_n_s_get_linkable, NULL, __pyx_n_s_gevent___semaphore, __pyx_d, ((PyObject *)__pyx_codeobj__4)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 9, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_linkable, __pyx_t_1) < 0) __PYX_ERR(0, 9, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_codeobj__4 = (PyObject*)__Pyx_PyCode_New(0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__3, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__semaphore_py, __pyx_n_s_get_linkable, 9, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__4)) __PYX_ERR(0, 9, __pyx_L1_error)
+
+010:     x = __import__('gevent._abstract_linkable')
+
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin___import__, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 10, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_v_x = __pyx_t_1;
+  __pyx_t_1 = 0;
+/* … */
+  __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_gevent__abstract_linkable); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 10, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple_);
+  __Pyx_GIVEREF(__pyx_tuple_);
+
+011:     return x._abstract_linkable.AbstractLinkable
+
  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_abstract_linkable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 11, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_AbstractLinkable); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 11, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_r = __pyx_t_2;
+  __pyx_t_2 = 0;
+  goto __pyx_L0;
+
+012: locals()['AbstractLinkable'] = _get_linkable()
+
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_get_linkable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 12, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 12, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_1 = __Pyx_Globals(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 12, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (unlikely(PyDict_SetItem(__pyx_t_1, __pyx_n_s_AbstractLinkable, __pyx_t_2) < 0)) __PYX_ERR(0, 12, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+013: del _get_linkable
+
  if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_get_linkable) < 0) __PYX_ERR(0, 13, __pyx_L1_error)
+
 014: 
+
 015: 
+
+016: class Semaphore(AbstractLinkable): # pylint:disable=undefined-variable
+
struct __pyx_vtabstruct_6gevent_11__semaphore_Semaphore {
+  struct __pyx_vtabstruct_6gevent_19__abstract_linkable_AbstractLinkable __pyx_base;
+  int (*locked)(struct __pyx_obj_6gevent_11__semaphore_Semaphore *, int __pyx_skip_dispatch);
+  int (*release)(struct __pyx_obj_6gevent_11__semaphore_Semaphore *, int __pyx_skip_dispatch);
+  PyObject *(*_start_notify)(struct __pyx_obj_6gevent_11__semaphore_Semaphore *, int __pyx_skip_dispatch);
+  int (*wait)(struct __pyx_obj_6gevent_11__semaphore_Semaphore *, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_11__semaphore_9Semaphore_wait *__pyx_optional_args);
+  int (*acquire)(struct __pyx_obj_6gevent_11__semaphore_Semaphore *, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_11__semaphore_9Semaphore_acquire *__pyx_optional_args);
+  PyObject *(*__pyx___enter__)(struct __pyx_obj_6gevent_11__semaphore_Semaphore *, int __pyx_skip_dispatch);
+  PyObject *(*__pyx___exit__)(struct __pyx_obj_6gevent_11__semaphore_Semaphore *, PyObject *, PyObject *, PyObject *, int __pyx_skip_dispatch);
+};
+static struct __pyx_vtabstruct_6gevent_11__semaphore_Semaphore *__pyx_vtabptr_6gevent_11__semaphore_Semaphore;
+
+
 017:     """
+
 018:     Semaphore(value=1) -> Semaphore
+
 019: 
+
 020:     A semaphore manages a counter representing the number of release()
+
 021:     calls minus the number of acquire() calls, plus an initial value.
+
 022:     The acquire() method blocks if necessary until it can return
+
 023:     without making the counter negative.
+
 024: 
+
 025:     If not given, ``value`` defaults to 1.
+
 026: 
+
 027:     The semaphore is a context manager and can be used in ``with`` statements.
+
 028: 
+
 029:     This Semaphore's ``__exit__`` method does not call the trace function
+
 030:     on CPython, but does under PyPy.
+
 031: 
+
 032:     .. seealso:: :class:`BoundedSemaphore` for a safer version that prevents
+
 033:        some classes of bugs.
+
 034: 
+
 035:     .. versionchanged:: 1.4.0
+
 036: 
+
 037:         The order in which waiters are awakened is not specified. It was not
+
 038:         specified previously, but usually went in FIFO order.
+
 039:     """
+
 040: 
+
+041:     def __init__(self, value=1):
+
/* Python wrapper */
+static int __pyx_pw_6gevent_11__semaphore_9Semaphore_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static int __pyx_pw_6gevent_11__semaphore_9Semaphore_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_value = 0;
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_value,0};
+    PyObject* values[1] = {0};
+    values[0] = ((PyObject *)__pyx_int_1);
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value);
+          if (value) { values[0] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 41, __pyx_L3_error)
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    __pyx_v_value = values[0];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 41, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.__semaphore.Semaphore.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return -1;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_11__semaphore_9Semaphore___init__(((struct __pyx_obj_6gevent_11__semaphore_Semaphore *)__pyx_v_self), __pyx_v_value);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_11__semaphore_9Semaphore___init__(struct __pyx_obj_6gevent_11__semaphore_Semaphore *__pyx_v_self, PyObject *__pyx_v_value) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = 0;
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_AddTraceback("gevent.__semaphore.Semaphore.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = -1;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+042:         if value < 0:
+
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_value, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 42, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 42, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  if (unlikely(__pyx_t_2)) {
+/* … */
+  }
+
+043:             raise ValueError("semaphore initial value must be >= 0")
+
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 43, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __PYX_ERR(0, 43, __pyx_L1_error)
+/* … */
+  __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_semaphore_initial_value_must_be); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 43, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__2);
+  __Pyx_GIVEREF(__pyx_tuple__2);
+
+044:         super(Semaphore, self).__init__()
+
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 44, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_INCREF(((PyObject *)__pyx_ptype_6gevent_11__semaphore_Semaphore));
+  __Pyx_GIVEREF(((PyObject *)__pyx_ptype_6gevent_11__semaphore_Semaphore));
+  PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_ptype_6gevent_11__semaphore_Semaphore));
+  __Pyx_INCREF(((PyObject *)__pyx_v_self));
+  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
+  PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_v_self));
+  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 44, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_4);
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_init); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 44, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __pyx_t_4 = NULL;
+  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
+    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+    if (likely(__pyx_t_4)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+      __Pyx_INCREF(__pyx_t_4);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_3, function);
+    }
+  }
+  __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 44, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+045:         self.counter = value
+
  __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 45, __pyx_L1_error)
+  __pyx_v_self->counter = __pyx_t_5;
+
+046:         self._notify_all = False
+
  __pyx_v_self->__pyx_base._notify_all = 0;
+
 047: 
+
+048:     def __str__(self):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_11__semaphore_9Semaphore_3__str__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_11__semaphore_9Semaphore_3__str__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_11__semaphore_9Semaphore_2__str__(((struct __pyx_obj_6gevent_11__semaphore_Semaphore *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_11__semaphore_9Semaphore_2__str__(struct __pyx_obj_6gevent_11__semaphore_Semaphore *__pyx_v_self) {
+  PyObject *__pyx_v_params = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__str__", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_AddTraceback("gevent.__semaphore.Semaphore.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_params);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+049:         params = (self.__class__.__name__, self.counter, self.linkcount())
+
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 49, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 49, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->counter); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 49, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_linkcount); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 49, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_4);
+  __pyx_t_5 = NULL;
+  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
+    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
+    if (likely(__pyx_t_5)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
+      __Pyx_INCREF(__pyx_t_5);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_4, function);
+    }
+  }
+  __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 49, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 49, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_4);
+  __Pyx_GIVEREF(__pyx_t_2);
+  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
+  __Pyx_GIVEREF(__pyx_t_1);
+  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_3);
+  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
+  __pyx_t_2 = 0;
+  __pyx_t_1 = 0;
+  __pyx_t_3 = 0;
+  __pyx_v_params = ((PyObject*)__pyx_t_4);
+  __pyx_t_4 = 0;
+
+050:         return '<%s counter=%s _links[%s]>' % params
+
  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_s_counter_s__links_s, __pyx_v_params); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 50, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_4);
+  __pyx_r = __pyx_t_4;
+  __pyx_t_4 = 0;
+  goto __pyx_L0;
+
 051: 
+
+052:     def locked(self):
+
static PyObject *__pyx_pw_6gevent_11__semaphore_9Semaphore_5locked(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static int __pyx_f_6gevent_11__semaphore_9Semaphore_locked(struct __pyx_obj_6gevent_11__semaphore_Semaphore *__pyx_v_self, int __pyx_skip_dispatch) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("locked", 0);
+  /* Check if called by wrapper */
+  if (unlikely(__pyx_skip_dispatch)) ;
+  /* Check if overridden in Python */
+  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
+    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
+    if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
+    else {
+      PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      #endif
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_locked); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 52, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_11__semaphore_9Semaphore_5locked)) {
+        __Pyx_INCREF(__pyx_t_1);
+        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+          if (likely(__pyx_t_4)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+            __Pyx_INCREF(__pyx_t_4);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_3, function);
+          }
+        }
+        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
+        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 52, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 52, __pyx_L1_error)
+        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+        __pyx_r = __pyx_t_5;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        goto __pyx_L0;
+      }
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+      tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
+      if (unlikely(type_dict_guard != tp_dict_version)) {
+        tp_dict_version = obj_dict_version = 0;
+      }
+      #endif
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    }
+    #endif
+  }
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_WriteUnraisable("gevent.__semaphore.Semaphore.locked", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_11__semaphore_9Semaphore_5locked(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6gevent_11__semaphore_9Semaphore_4locked[] = "Semaphore.locked(self) -> bool\nReturn a boolean indicating whether the semaphore can be acquired.\n        Most useful with binary semaphores.";
+static PyMethodDef __pyx_mdef_6gevent_11__semaphore_9Semaphore_5locked = {"locked", (PyCFunction)__pyx_pw_6gevent_11__semaphore_9Semaphore_5locked, METH_NOARGS, __pyx_doc_6gevent_11__semaphore_9Semaphore_4locked};
+static PyObject *__pyx_pw_6gevent_11__semaphore_9Semaphore_5locked(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("locked (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_11__semaphore_9Semaphore_4locked(((struct __pyx_obj_6gevent_11__semaphore_Semaphore *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_11__semaphore_9Semaphore_4locked(struct __pyx_obj_6gevent_11__semaphore_Semaphore *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("locked", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_f_6gevent_11__semaphore_9Semaphore_locked(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 52, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.__semaphore.Semaphore.locked", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__5 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 52, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__5);
+  __Pyx_GIVEREF(__pyx_tuple__5);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_11__semaphore_9Semaphore_5locked, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Semaphore_locked, NULL, __pyx_n_s_gevent___semaphore, __pyx_d, ((PyObject *)__pyx_codeobj__6)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 52, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_11__semaphore_Semaphore->tp_dict, __pyx_n_s_locked, __pyx_t_2) < 0) __PYX_ERR(0, 52, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_11__semaphore_Semaphore);
+  __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__5, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__semaphore_py, __pyx_n_s_locked, 52, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__6)) __PYX_ERR(0, 52, __pyx_L1_error)
+
 053:         """Return a boolean indicating whether the semaphore can be acquired.
+
 054:         Most useful with binary semaphores."""
+
+055:         return self.counter <= 0
+
  __pyx_r = (__pyx_v_self->counter <= 0);
+  goto __pyx_L0;
+
 056: 
+
+057:     def release(self):
+
static PyObject *__pyx_pw_6gevent_11__semaphore_9Semaphore_7release(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static int __pyx_f_6gevent_11__semaphore_9Semaphore_release(struct __pyx_obj_6gevent_11__semaphore_Semaphore *__pyx_v_self, int __pyx_skip_dispatch) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("release", 0);
+  /* Check if called by wrapper */
+  if (unlikely(__pyx_skip_dispatch)) ;
+  /* Check if overridden in Python */
+  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
+    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
+    if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
+    else {
+      PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      #endif
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_release); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 57, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_11__semaphore_9Semaphore_7release)) {
+        __Pyx_INCREF(__pyx_t_1);
+        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+          if (likely(__pyx_t_4)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+            __Pyx_INCREF(__pyx_t_4);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_3, function);
+          }
+        }
+        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
+        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 57, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 57, __pyx_L1_error)
+        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+        __pyx_r = __pyx_t_5;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        goto __pyx_L0;
+      }
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+      tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
+      if (unlikely(type_dict_guard != tp_dict_version)) {
+        tp_dict_version = obj_dict_version = 0;
+      }
+      #endif
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    }
+    #endif
+  }
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_AddTraceback("gevent.__semaphore.Semaphore.release", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = -1000;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_11__semaphore_9Semaphore_7release(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6gevent_11__semaphore_9Semaphore_6release[] = "Semaphore.release(self) -> int\n\n        Release the semaphore, notifying any waiters if needed.\n        ";
+static PyMethodDef __pyx_mdef_6gevent_11__semaphore_9Semaphore_7release = {"release", (PyCFunction)__pyx_pw_6gevent_11__semaphore_9Semaphore_7release, METH_NOARGS, __pyx_doc_6gevent_11__semaphore_9Semaphore_6release};
+static PyObject *__pyx_pw_6gevent_11__semaphore_9Semaphore_7release(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("release (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_11__semaphore_9Semaphore_6release(((struct __pyx_obj_6gevent_11__semaphore_Semaphore *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_11__semaphore_9Semaphore_6release(struct __pyx_obj_6gevent_11__semaphore_Semaphore *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("release", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __pyx_f_6gevent_11__semaphore_9Semaphore_release(__pyx_v_self, 1); if (unlikely(__pyx_t_1 == ((int)-1000))) __PYX_ERR(0, 57, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 57, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_r = __pyx_t_2;
+  __pyx_t_2 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_AddTraceback("gevent.__semaphore.Semaphore.release", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__7 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 57, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__7);
+  __Pyx_GIVEREF(__pyx_tuple__7);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_11__semaphore_9Semaphore_7release, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Semaphore_release, NULL, __pyx_n_s_gevent___semaphore, __pyx_d, ((PyObject *)__pyx_codeobj__8)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 57, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_11__semaphore_Semaphore->tp_dict, __pyx_n_s_release, __pyx_t_2) < 0) __PYX_ERR(0, 57, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_11__semaphore_Semaphore);
+  __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__semaphore_py, __pyx_n_s_release, 57, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) __PYX_ERR(0, 57, __pyx_L1_error)
+
 058:         """
+
 059:         Release the semaphore, notifying any waiters if needed.
+
 060:         """
+
+061:         self.counter += 1
+
  __pyx_v_self->counter = (__pyx_v_self->counter + 1);
+
+062:         self._check_and_notify()
+
  __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_11__semaphore_Semaphore *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._check_and_notify(((struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 62, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+063:         return self.counter
+
  __pyx_r = __pyx_v_self->counter;
+  goto __pyx_L0;
+
 064: 
+
+065:     def ready(self):
+
static PyObject *__pyx_pw_6gevent_11__semaphore_9Semaphore_9ready(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static int __pyx_f_6gevent_11__semaphore_9Semaphore_ready(struct __pyx_obj_6gevent_11__semaphore_Semaphore *__pyx_v_self, int __pyx_skip_dispatch) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("ready", 0);
+  /* Check if called by wrapper */
+  if (unlikely(__pyx_skip_dispatch)) ;
+  /* Check if overridden in Python */
+  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
+    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
+    if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
+    else {
+      PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      #endif
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_ready); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 65, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_11__semaphore_9Semaphore_9ready)) {
+        __Pyx_INCREF(__pyx_t_1);
+        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+          if (likely(__pyx_t_4)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+            __Pyx_INCREF(__pyx_t_4);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_3, function);
+          }
+        }
+        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
+        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 65, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 65, __pyx_L1_error)
+        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+        __pyx_r = __pyx_t_5;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        goto __pyx_L0;
+      }
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+      tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
+      if (unlikely(type_dict_guard != tp_dict_version)) {
+        tp_dict_version = obj_dict_version = 0;
+      }
+      #endif
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    }
+    #endif
+  }
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_WriteUnraisable("gevent.__semaphore.Semaphore.ready", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_11__semaphore_9Semaphore_9ready(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6gevent_11__semaphore_9Semaphore_8ready[] = "Semaphore.ready(self) -> bool";
+static PyMethodDef __pyx_mdef_6gevent_11__semaphore_9Semaphore_9ready = {"ready", (PyCFunction)__pyx_pw_6gevent_11__semaphore_9Semaphore_9ready, METH_NOARGS, __pyx_doc_6gevent_11__semaphore_9Semaphore_8ready};
+static PyObject *__pyx_pw_6gevent_11__semaphore_9Semaphore_9ready(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("ready (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_11__semaphore_9Semaphore_8ready(((struct __pyx_obj_6gevent_11__semaphore_Semaphore *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_11__semaphore_9Semaphore_8ready(struct __pyx_obj_6gevent_11__semaphore_Semaphore *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("ready", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_f_6gevent_11__semaphore_9Semaphore_ready(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 65, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.__semaphore.Semaphore.ready", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__9 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 65, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__9);
+  __Pyx_GIVEREF(__pyx_tuple__9);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_11__semaphore_9Semaphore_9ready, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Semaphore_ready, NULL, __pyx_n_s_gevent___semaphore, __pyx_d, ((PyObject *)__pyx_codeobj__10)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 65, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_11__semaphore_Semaphore->tp_dict, __pyx_n_s_ready, __pyx_t_2) < 0) __PYX_ERR(0, 65, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_11__semaphore_Semaphore);
+  __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__9, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__semaphore_py, __pyx_n_s_ready, 65, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__10)) __PYX_ERR(0, 65, __pyx_L1_error)
+
+066:         return self.counter > 0
+
  __pyx_r = (__pyx_v_self->counter > 0);
+  goto __pyx_L0;
+
 067: 
+
+068:     def _start_notify(self):
+
static PyObject *__pyx_pw_6gevent_11__semaphore_9Semaphore_11_start_notify(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyObject *__pyx_f_6gevent_11__semaphore_9Semaphore__start_notify(struct __pyx_obj_6gevent_11__semaphore_Semaphore *__pyx_v_self, int __pyx_skip_dispatch) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_start_notify", 0);
+  /* Check if called by wrapper */
+  if (unlikely(__pyx_skip_dispatch)) ;
+  /* Check if overridden in Python */
+  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
+    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
+    if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
+    else {
+      PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      #endif
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_start_notify); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 68, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_11__semaphore_9Semaphore_11_start_notify)) {
+        __Pyx_XDECREF(__pyx_r);
+        __Pyx_INCREF(__pyx_t_1);
+        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+          if (likely(__pyx_t_4)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+            __Pyx_INCREF(__pyx_t_4);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_3, function);
+          }
+        }
+        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
+        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 68, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __pyx_r = __pyx_t_2;
+        __pyx_t_2 = 0;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        goto __pyx_L0;
+      }
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+      tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
+      if (unlikely(type_dict_guard != tp_dict_version)) {
+        tp_dict_version = obj_dict_version = 0;
+      }
+      #endif
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    }
+    #endif
+  }
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_AddTraceback("gevent.__semaphore.Semaphore._start_notify", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_11__semaphore_9Semaphore_11_start_notify(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6gevent_11__semaphore_9Semaphore_10_start_notify[] = "Semaphore._start_notify(self)";
+static PyMethodDef __pyx_mdef_6gevent_11__semaphore_9Semaphore_11_start_notify = {"_start_notify", (PyCFunction)__pyx_pw_6gevent_11__semaphore_9Semaphore_11_start_notify, METH_NOARGS, __pyx_doc_6gevent_11__semaphore_9Semaphore_10_start_notify};
+static PyObject *__pyx_pw_6gevent_11__semaphore_9Semaphore_11_start_notify(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_start_notify (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_11__semaphore_9Semaphore_10_start_notify(((struct __pyx_obj_6gevent_11__semaphore_Semaphore *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_11__semaphore_9Semaphore_10_start_notify(struct __pyx_obj_6gevent_11__semaphore_Semaphore *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_start_notify", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __pyx_f_6gevent_11__semaphore_9Semaphore__start_notify(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 68, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.__semaphore.Semaphore._start_notify", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__11 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 68, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__11);
+  __Pyx_GIVEREF(__pyx_tuple__11);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_11__semaphore_9Semaphore_11_start_notify, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Semaphore__start_notify, NULL, __pyx_n_s_gevent___semaphore, __pyx_d, ((PyObject *)__pyx_codeobj__12)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 68, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_11__semaphore_Semaphore->tp_dict, __pyx_n_s_start_notify, __pyx_t_2) < 0) __PYX_ERR(0, 68, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_11__semaphore_Semaphore);
+  __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__11, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__semaphore_py, __pyx_n_s_start_notify, 68, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(0, 68, __pyx_L1_error)
+
+069:         self._check_and_notify()
+
  __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_11__semaphore_Semaphore *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._check_and_notify(((struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 69, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 070: 
+
+071:     def _wait_return_value(self, waited, wait_success):
+
static PyObject *__pyx_f_6gevent_11__semaphore_9Semaphore__wait_return_value(CYTHON_UNUSED struct __pyx_obj_6gevent_11__semaphore_Semaphore *__pyx_v_self, PyObject *__pyx_v_waited, PyObject *__pyx_v_wait_success) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_wait_return_value", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_AddTraceback("gevent.__semaphore.Semaphore._wait_return_value", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+072:         if waited:
+
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_waited); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 72, __pyx_L1_error)
+  if (__pyx_t_1) {
+/* … */
+  }
+
+073:             return wait_success
+
    __Pyx_XDECREF(__pyx_r);
+    __Pyx_INCREF(__pyx_v_wait_success);
+    __pyx_r = __pyx_v_wait_success;
+    goto __pyx_L0;
+
 074:         # We didn't even wait, we must be good to go.
+
 075:         # XXX: This is probably dead code, we're careful not to go into the wait
+
 076:         # state if we don't expect to need to
+
+077:         return True
+
  __Pyx_XDECREF(__pyx_r);
+  __Pyx_INCREF(Py_True);
+  __pyx_r = Py_True;
+  goto __pyx_L0;
+
 078: 
+
+079:     def wait(self, timeout=None):
+
static PyObject *__pyx_pw_6gevent_11__semaphore_9Semaphore_13wait(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static int __pyx_f_6gevent_11__semaphore_9Semaphore_wait(struct __pyx_obj_6gevent_11__semaphore_Semaphore *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_11__semaphore_9Semaphore_wait *__pyx_optional_args) {
+  PyObject *__pyx_v_timeout = ((PyObject *)Py_None);
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("wait", 0);
+  if (__pyx_optional_args) {
+    if (__pyx_optional_args->__pyx_n > 0) {
+      __pyx_v_timeout = __pyx_optional_args->timeout;
+    }
+  }
+  /* Check if called by wrapper */
+  if (unlikely(__pyx_skip_dispatch)) ;
+  /* Check if overridden in Python */
+  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
+    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
+    if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
+    else {
+      PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      #endif
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_wait); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 79, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_11__semaphore_9Semaphore_13wait)) {
+        __Pyx_INCREF(__pyx_t_1);
+        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+          if (likely(__pyx_t_4)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+            __Pyx_INCREF(__pyx_t_4);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_3, function);
+          }
+        }
+        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_timeout) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_timeout);
+        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 79, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 79, __pyx_L1_error)
+        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+        __pyx_r = __pyx_t_5;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        goto __pyx_L0;
+      }
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+      tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
+      if (unlikely(type_dict_guard != tp_dict_version)) {
+        tp_dict_version = obj_dict_version = 0;
+      }
+      #endif
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    }
+    #endif
+  }
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_AddTraceback("gevent.__semaphore.Semaphore.wait", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = -1000;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_11__semaphore_9Semaphore_13wait(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_6gevent_11__semaphore_9Semaphore_12wait[] = "Semaphore.wait(self, timeout=None) -> int\n\n        wait(timeout=None) -> int\n\n        Wait until it is possible to acquire this semaphore, or until the optional\n        *timeout* elapses.\n\n        .. caution:: If this semaphore was initialized with a size of 0,\n           this method will block forever if no timeout is given.\n\n        :keyword float timeout: If given, specifies the maximum amount of seconds\n           this method will block.\n        :return: A number indicating how many times the semaphore can be acquired\n            before blocking.\n        ";
+static PyMethodDef __pyx_mdef_6gevent_11__semaphore_9Semaphore_13wait = {"wait", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_11__semaphore_9Semaphore_13wait, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_11__semaphore_9Semaphore_12wait};
+static PyObject *__pyx_pw_6gevent_11__semaphore_9Semaphore_13wait(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_timeout = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("wait (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_timeout,0};
+    PyObject* values[1] = {0};
+    values[0] = ((PyObject *)Py_None);
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_timeout);
+          if (value) { values[0] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "wait") < 0)) __PYX_ERR(0, 79, __pyx_L3_error)
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    __pyx_v_timeout = values[0];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("wait", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 79, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.__semaphore.Semaphore.wait", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_11__semaphore_9Semaphore_12wait(((struct __pyx_obj_6gevent_11__semaphore_Semaphore *)__pyx_v_self), __pyx_v_timeout);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_11__semaphore_9Semaphore_12wait(struct __pyx_obj_6gevent_11__semaphore_Semaphore *__pyx_v_self, PyObject *__pyx_v_timeout) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("wait", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_2.__pyx_n = 1;
+  __pyx_t_2.timeout = __pyx_v_timeout;
+  __pyx_t_1 = __pyx_vtabptr_6gevent_11__semaphore_Semaphore->wait(__pyx_v_self, 1, &__pyx_t_2); if (unlikely(__pyx_t_1 == ((int)-1000))) __PYX_ERR(0, 79, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 79, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __pyx_r = __pyx_t_3;
+  __pyx_t_3 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_AddTraceback("gevent.__semaphore.Semaphore.wait", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__13 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_timeout); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 79, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__13);
+  __Pyx_GIVEREF(__pyx_tuple__13);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_11__semaphore_9Semaphore_13wait, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Semaphore_wait, NULL, __pyx_n_s_gevent___semaphore, __pyx_d, ((PyObject *)__pyx_codeobj__14)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 79, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_11__semaphore_Semaphore->tp_dict, __pyx_n_s_wait, __pyx_t_2) < 0) __PYX_ERR(0, 79, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_11__semaphore_Semaphore);
+  __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__13, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__semaphore_py, __pyx_n_s_wait, 79, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__14)) __PYX_ERR(0, 79, __pyx_L1_error)
+
 080:         """
+
 081:         wait(timeout=None) -> int
+
 082: 
+
 083:         Wait until it is possible to acquire this semaphore, or until the optional
+
 084:         *timeout* elapses.
+
 085: 
+
 086:         .. caution:: If this semaphore was initialized with a size of 0,
+
 087:            this method will block forever if no timeout is given.
+
 088: 
+
 089:         :keyword float timeout: If given, specifies the maximum amount of seconds
+
 090:            this method will block.
+
 091:         :return: A number indicating how many times the semaphore can be acquired
+
 092:             before blocking.
+
 093:         """
+
+094:         if self.counter > 0:
+
  __pyx_t_6 = ((__pyx_v_self->counter > 0) != 0);
+  if (__pyx_t_6) {
+/* … */
+  }
+
+095:             return self.counter
+
    __pyx_r = __pyx_v_self->counter;
+    goto __pyx_L0;
+
 096: 
+
+097:         self._wait(timeout) # return value irrelevant, whether we got it or got a timeout
+
  __pyx_t_7.__pyx_n = 1;
+  __pyx_t_7.timeout = __pyx_v_timeout;
+  __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_11__semaphore_Semaphore *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._wait(((struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *)__pyx_v_self), &__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 97, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+098:         return self.counter
+
  __pyx_r = __pyx_v_self->counter;
+  goto __pyx_L0;
+
 099: 
+
+100:     def acquire(self, blocking=True, timeout=None):
+
static PyObject *__pyx_pw_6gevent_11__semaphore_9Semaphore_15acquire(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static int __pyx_f_6gevent_11__semaphore_9Semaphore_acquire(struct __pyx_obj_6gevent_11__semaphore_Semaphore *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_11__semaphore_9Semaphore_acquire *__pyx_optional_args) {
+  int __pyx_v_blocking = ((int)1);
+  PyObject *__pyx_v_timeout = ((PyObject *)Py_None);
+  PyObject *__pyx_v_success = NULL;
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("acquire", 0);
+  if (__pyx_optional_args) {
+    if (__pyx_optional_args->__pyx_n > 0) {
+      __pyx_v_blocking = __pyx_optional_args->blocking;
+      if (__pyx_optional_args->__pyx_n > 1) {
+        __pyx_v_timeout = __pyx_optional_args->timeout;
+      }
+    }
+  }
+  /* Check if called by wrapper */
+  if (unlikely(__pyx_skip_dispatch)) ;
+  /* Check if overridden in Python */
+  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
+    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
+    if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
+    else {
+      PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      #endif
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_acquire); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 100, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_11__semaphore_9Semaphore_15acquire)) {
+        __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_blocking); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 100, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_3);
+        __Pyx_INCREF(__pyx_t_1);
+        __pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL;
+        __pyx_t_6 = 0;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
+          __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
+          if (likely(__pyx_t_5)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
+            __Pyx_INCREF(__pyx_t_5);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_4, function);
+            __pyx_t_6 = 1;
+          }
+        }
+        #if CYTHON_FAST_PYCALL
+        if (PyFunction_Check(__pyx_t_4)) {
+          PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_3, __pyx_v_timeout};
+          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 100, __pyx_L1_error)
+          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+          __Pyx_GOTREF(__pyx_t_2);
+          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        } else
+        #endif
+        #if CYTHON_FAST_PYCCALL
+        if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
+          PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_3, __pyx_v_timeout};
+          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 100, __pyx_L1_error)
+          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+          __Pyx_GOTREF(__pyx_t_2);
+          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        } else
+        #endif
+        {
+          __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 100, __pyx_L1_error)
+          __Pyx_GOTREF(__pyx_t_7);
+          if (__pyx_t_5) {
+            __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
+          }
+          __Pyx_GIVEREF(__pyx_t_3);
+          PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_t_3);
+          __Pyx_INCREF(__pyx_v_timeout);
+          __Pyx_GIVEREF(__pyx_v_timeout);
+          PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_timeout);
+          __pyx_t_3 = 0;
+          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 100, __pyx_L1_error)
+          __Pyx_GOTREF(__pyx_t_2);
+          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+        }
+        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+        __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 100, __pyx_L1_error)
+        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+        __pyx_r = __pyx_t_8;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        goto __pyx_L0;
+      }
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+      tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
+      if (unlikely(type_dict_guard != tp_dict_version)) {
+        tp_dict_version = obj_dict_version = 0;
+      }
+      #endif
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    }
+    #endif
+  }
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_XDECREF(__pyx_t_7);
+  __Pyx_AddTraceback("gevent.__semaphore.Semaphore.acquire", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = -1000;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_success);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_11__semaphore_9Semaphore_15acquire(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_6gevent_11__semaphore_9Semaphore_14acquire[] = "Semaphore.acquire(self, int blocking=True, timeout=None) -> bool\n\n        acquire(blocking=True, timeout=None) -> bool\n\n        Acquire the semaphore.\n\n        .. caution:: If this semaphore was initialized with a size of 0,\n           this method will block forever (unless a timeout is given or blocking is\n           set to false).\n\n        :keyword bool blocking: If True (the default), this function will block\n           until the semaphore is acquired.\n        :keyword float timeout: If given, specifies the maximum amount of seconds\n           this method will block.\n        :return: A boolean indicating whether the semaphore was acquired.\n           If ``blocking`` is True and ``timeout`` is None (the default), then\n           (so long as this semaphore was initialized with a size greater than 0)\n           this will always return True. If a timeout was given, and it expired before\n           the semaphore was acquired, False will be returned. (Note that this can still\n           raise a ``Timeout`` exception, if some other caller had already started a timer.)\n        ";
+static PyMethodDef __pyx_mdef_6gevent_11__semaphore_9Semaphore_15acquire = {"acquire", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_11__semaphore_9Semaphore_15acquire, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_11__semaphore_9Semaphore_14acquire};
+static PyObject *__pyx_pw_6gevent_11__semaphore_9Semaphore_15acquire(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  int __pyx_v_blocking;
+  PyObject *__pyx_v_timeout = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("acquire (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_blocking,&__pyx_n_s_timeout,0};
+    PyObject* values[2] = {0,0};
+    values[1] = ((PyObject *)Py_None);
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_blocking);
+          if (value) { values[0] = value; kw_args--; }
+        }
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_timeout);
+          if (value) { values[1] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "acquire") < 0)) __PYX_ERR(0, 100, __pyx_L3_error)
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    if (values[0]) {
+      __pyx_v_blocking = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_blocking == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 100, __pyx_L3_error)
+    } else {
+      __pyx_v_blocking = ((int)1);
+    }
+    __pyx_v_timeout = values[1];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("acquire", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 100, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.__semaphore.Semaphore.acquire", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_11__semaphore_9Semaphore_14acquire(((struct __pyx_obj_6gevent_11__semaphore_Semaphore *)__pyx_v_self), __pyx_v_blocking, __pyx_v_timeout);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_11__semaphore_9Semaphore_14acquire(struct __pyx_obj_6gevent_11__semaphore_Semaphore *__pyx_v_self, int __pyx_v_blocking, PyObject *__pyx_v_timeout) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("acquire", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_2.__pyx_n = 2;
+  __pyx_t_2.blocking = __pyx_v_blocking;
+  __pyx_t_2.timeout = __pyx_v_timeout;
+  __pyx_t_1 = __pyx_vtabptr_6gevent_11__semaphore_Semaphore->acquire(__pyx_v_self, 1, &__pyx_t_2); if (unlikely(__pyx_t_1 == ((int)-1000))) __PYX_ERR(0, 100, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 100, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __pyx_r = __pyx_t_3;
+  __pyx_t_3 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_AddTraceback("gevent.__semaphore.Semaphore.acquire", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__15 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_blocking, __pyx_n_s_timeout); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(0, 100, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__15);
+  __Pyx_GIVEREF(__pyx_tuple__15);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_11__semaphore_9Semaphore_15acquire, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Semaphore_acquire, NULL, __pyx_n_s_gevent___semaphore, __pyx_d, ((PyObject *)__pyx_codeobj__16)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 100, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_11__semaphore_Semaphore->tp_dict, __pyx_n_s_acquire, __pyx_t_2) < 0) __PYX_ERR(0, 100, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_11__semaphore_Semaphore);
+  __pyx_codeobj__16 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__15, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__semaphore_py, __pyx_n_s_acquire, 100, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__16)) __PYX_ERR(0, 100, __pyx_L1_error)
+
 101:         """
+
 102:         acquire(blocking=True, timeout=None) -> bool
+
 103: 
+
 104:         Acquire the semaphore.
+
 105: 
+
 106:         .. caution:: If this semaphore was initialized with a size of 0,
+
 107:            this method will block forever (unless a timeout is given or blocking is
+
 108:            set to false).
+
 109: 
+
 110:         :keyword bool blocking: If True (the default), this function will block
+
 111:            until the semaphore is acquired.
+
 112:         :keyword float timeout: If given, specifies the maximum amount of seconds
+
 113:            this method will block.
+
 114:         :return: A boolean indicating whether the semaphore was acquired.
+
 115:            If ``blocking`` is True and ``timeout`` is None (the default), then
+
 116:            (so long as this semaphore was initialized with a size greater than 0)
+
 117:            this will always return True. If a timeout was given, and it expired before
+
 118:            the semaphore was acquired, False will be returned. (Note that this can still
+
 119:            raise a ``Timeout`` exception, if some other caller had already started a timer.)
+
 120:         """
+
+121:         if self.counter > 0:
+
  __pyx_t_8 = ((__pyx_v_self->counter > 0) != 0);
+  if (__pyx_t_8) {
+/* … */
+  }
+
+122:             self.counter -= 1
+
    __pyx_v_self->counter = (__pyx_v_self->counter - 1);
+
+123:             return True
+
    __pyx_r = 1;
+    goto __pyx_L0;
+
 124: 
+
+125:         if not blocking:
+
  __pyx_t_8 = ((!(__pyx_v_blocking != 0)) != 0);
+  if (__pyx_t_8) {
+/* … */
+  }
+
+126:             return False
+
    __pyx_r = 0;
+    goto __pyx_L0;
+
 127: 
+
+128:         success = self._wait(timeout)
+
  __pyx_t_9.__pyx_n = 1;
+  __pyx_t_9.timeout = __pyx_v_timeout;
+  __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_11__semaphore_Semaphore *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._wait(((struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *)__pyx_v_self), &__pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 128, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_v_success = __pyx_t_1;
+  __pyx_t_1 = 0;
+
+129:         if not success:
+
  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_success); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 129, __pyx_L1_error)
+  __pyx_t_10 = ((!__pyx_t_8) != 0);
+  if (__pyx_t_10) {
+/* … */
+  }
+
 130:             # Our timer expired.
+
+131:             return False
+
    __pyx_r = 0;
+    goto __pyx_L0;
+
 132: 
+
 133:         # Neither our timer no another one expired, so we blocked until
+
 134:         # awoke. Therefore, the counter is ours
+
+135:         self.counter -= 1
+
  __pyx_v_self->counter = (__pyx_v_self->counter - 1);
+
+136:         assert self.counter >= 0
+
  #ifndef CYTHON_WITHOUT_ASSERTIONS
+  if (unlikely(!Py_OptimizeFlag)) {
+    if (unlikely(!((__pyx_v_self->counter >= 0) != 0))) {
+      PyErr_SetNone(PyExc_AssertionError);
+      __PYX_ERR(0, 136, __pyx_L1_error)
+    }
+  }
+  #endif
+
+137:         return True
+
  __pyx_r = 1;
+  goto __pyx_L0;
+
 138: 
+
+139:     _py3k_acquire = acquire # PyPy needs this; it must be static for Cython
+
  __Pyx_GetNameInClass(__pyx_t_2, (PyObject *)__pyx_ptype_6gevent_11__semaphore_Semaphore, __pyx_n_s_acquire); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 139, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_11__semaphore_Semaphore->tp_dict, __pyx_n_s_py3k_acquire, __pyx_t_2) < 0) __PYX_ERR(0, 139, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_11__semaphore_Semaphore);
+
 140: 
+
+141:     def __enter__(self):
+
static PyObject *__pyx_pw_6gevent_11__semaphore_9Semaphore_17__enter__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyObject *__pyx_f_6gevent_11__semaphore_9Semaphore___enter__(struct __pyx_obj_6gevent_11__semaphore_Semaphore *__pyx_v_self, int __pyx_skip_dispatch) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__enter__", 0);
+  /* Check if called by wrapper */
+  if (unlikely(__pyx_skip_dispatch)) ;
+  /* Check if overridden in Python */
+  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
+    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
+    if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
+    else {
+      PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      #endif
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_enter); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 141, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_11__semaphore_9Semaphore_17__enter__)) {
+        __Pyx_XDECREF(__pyx_r);
+        __Pyx_INCREF(__pyx_t_1);
+        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+          if (likely(__pyx_t_4)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+            __Pyx_INCREF(__pyx_t_4);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_3, function);
+          }
+        }
+        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
+        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 141, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __pyx_r = __pyx_t_2;
+        __pyx_t_2 = 0;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        goto __pyx_L0;
+      }
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+      tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
+      if (unlikely(type_dict_guard != tp_dict_version)) {
+        tp_dict_version = obj_dict_version = 0;
+      }
+      #endif
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    }
+    #endif
+  }
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_AddTraceback("gevent.__semaphore.Semaphore.__enter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_11__semaphore_9Semaphore_17__enter__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6gevent_11__semaphore_9Semaphore_16__enter__[] = "Semaphore.__enter__(self)";
+static PyMethodDef __pyx_mdef_6gevent_11__semaphore_9Semaphore_17__enter__ = {"__enter__", (PyCFunction)__pyx_pw_6gevent_11__semaphore_9Semaphore_17__enter__, METH_NOARGS, __pyx_doc_6gevent_11__semaphore_9Semaphore_16__enter__};
+static PyObject *__pyx_pw_6gevent_11__semaphore_9Semaphore_17__enter__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__enter__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_11__semaphore_9Semaphore_16__enter__(((struct __pyx_obj_6gevent_11__semaphore_Semaphore *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_11__semaphore_9Semaphore_16__enter__(struct __pyx_obj_6gevent_11__semaphore_Semaphore *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__enter__", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __pyx_f_6gevent_11__semaphore_9Semaphore___enter__(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 141, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.__semaphore.Semaphore.__enter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__17 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(0, 141, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__17);
+  __Pyx_GIVEREF(__pyx_tuple__17);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_11__semaphore_9Semaphore_17__enter__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Semaphore___enter, NULL, __pyx_n_s_gevent___semaphore, __pyx_d, ((PyObject *)__pyx_codeobj__18)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 141, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_11__semaphore_Semaphore->tp_dict, __pyx_n_s_enter, __pyx_t_2) < 0) __PYX_ERR(0, 141, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_11__semaphore_Semaphore);
+  __pyx_codeobj__18 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__17, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__semaphore_py, __pyx_n_s_enter, 141, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__18)) __PYX_ERR(0, 141, __pyx_L1_error)
+
+142:         self.acquire()
+
  __pyx_t_5 = ((struct __pyx_vtabstruct_6gevent_11__semaphore_Semaphore *)__pyx_v_self->__pyx_base.__pyx_vtab)->acquire(__pyx_v_self, 0, NULL); if (unlikely(__pyx_t_5 == ((int)-1000))) __PYX_ERR(0, 142, __pyx_L1_error)
+
 143: 
+
+144:     def __exit__(self, t, v, tb):
+
static PyObject *__pyx_pw_6gevent_11__semaphore_9Semaphore_19__exit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_f_6gevent_11__semaphore_9Semaphore___exit__(struct __pyx_obj_6gevent_11__semaphore_Semaphore *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_t, CYTHON_UNUSED PyObject *__pyx_v_v, CYTHON_UNUSED PyObject *__pyx_v_tb, int __pyx_skip_dispatch) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__exit__", 0);
+  /* Check if called by wrapper */
+  if (unlikely(__pyx_skip_dispatch)) ;
+  /* Check if overridden in Python */
+  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
+    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
+    if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
+    else {
+      PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      #endif
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_exit); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 144, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_11__semaphore_9Semaphore_19__exit__)) {
+        __Pyx_XDECREF(__pyx_r);
+        __Pyx_INCREF(__pyx_t_1);
+        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
+        __pyx_t_5 = 0;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+          if (likely(__pyx_t_4)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+            __Pyx_INCREF(__pyx_t_4);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_3, function);
+            __pyx_t_5 = 1;
+          }
+        }
+        #if CYTHON_FAST_PYCALL
+        if (PyFunction_Check(__pyx_t_3)) {
+          PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_t, __pyx_v_v, __pyx_v_tb};
+          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 144, __pyx_L1_error)
+          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+          __Pyx_GOTREF(__pyx_t_2);
+        } else
+        #endif
+        #if CYTHON_FAST_PYCCALL
+        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
+          PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_t, __pyx_v_v, __pyx_v_tb};
+          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 144, __pyx_L1_error)
+          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+          __Pyx_GOTREF(__pyx_t_2);
+        } else
+        #endif
+        {
+          __pyx_t_6 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 144, __pyx_L1_error)
+          __Pyx_GOTREF(__pyx_t_6);
+          if (__pyx_t_4) {
+            __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
+          }
+          __Pyx_INCREF(__pyx_v_t);
+          __Pyx_GIVEREF(__pyx_v_t);
+          PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_t);
+          __Pyx_INCREF(__pyx_v_v);
+          __Pyx_GIVEREF(__pyx_v_v);
+          PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_v);
+          __Pyx_INCREF(__pyx_v_tb);
+          __Pyx_GIVEREF(__pyx_v_tb);
+          PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_v_tb);
+          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 144, __pyx_L1_error)
+          __Pyx_GOTREF(__pyx_t_2);
+          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+        }
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __pyx_r = __pyx_t_2;
+        __pyx_t_2 = 0;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        goto __pyx_L0;
+      }
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+      tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
+      if (unlikely(type_dict_guard != tp_dict_version)) {
+        tp_dict_version = obj_dict_version = 0;
+      }
+      #endif
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    }
+    #endif
+  }
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_6);
+  __Pyx_AddTraceback("gevent.__semaphore.Semaphore.__exit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_11__semaphore_9Semaphore_19__exit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_6gevent_11__semaphore_9Semaphore_18__exit__[] = "Semaphore.__exit__(self, t, v, tb)";
+static PyMethodDef __pyx_mdef_6gevent_11__semaphore_9Semaphore_19__exit__ = {"__exit__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_11__semaphore_9Semaphore_19__exit__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_11__semaphore_9Semaphore_18__exit__};
+static PyObject *__pyx_pw_6gevent_11__semaphore_9Semaphore_19__exit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_t = 0;
+  PyObject *__pyx_v_v = 0;
+  PyObject *__pyx_v_tb = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__exit__ (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_t,&__pyx_n_s_v,&__pyx_n_s_tb,0};
+    PyObject* values[3] = {0,0,0};
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_v)) != 0)) kw_args--;
+        else {
+          __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, 1); __PYX_ERR(0, 144, __pyx_L3_error)
+        }
+        CYTHON_FALLTHROUGH;
+        case  2:
+        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tb)) != 0)) kw_args--;
+        else {
+          __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, 2); __PYX_ERR(0, 144, __pyx_L3_error)
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__exit__") < 0)) __PYX_ERR(0, 144, __pyx_L3_error)
+      }
+    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
+      goto __pyx_L5_argtuple_error;
+    } else {
+      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+    }
+    __pyx_v_t = values[0];
+    __pyx_v_v = values[1];
+    __pyx_v_tb = values[2];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 144, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.__semaphore.Semaphore.__exit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_11__semaphore_9Semaphore_18__exit__(((struct __pyx_obj_6gevent_11__semaphore_Semaphore *)__pyx_v_self), __pyx_v_t, __pyx_v_v, __pyx_v_tb);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_11__semaphore_9Semaphore_18__exit__(struct __pyx_obj_6gevent_11__semaphore_Semaphore *__pyx_v_self, PyObject *__pyx_v_t, PyObject *__pyx_v_v, PyObject *__pyx_v_tb) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__exit__", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __pyx_f_6gevent_11__semaphore_9Semaphore___exit__(__pyx_v_self, __pyx_v_t, __pyx_v_v, __pyx_v_tb, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 144, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.__semaphore.Semaphore.__exit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__19 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_t, __pyx_n_s_v, __pyx_n_s_tb); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(0, 144, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__19);
+  __Pyx_GIVEREF(__pyx_tuple__19);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_11__semaphore_9Semaphore_19__exit__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Semaphore___exit, NULL, __pyx_n_s_gevent___semaphore, __pyx_d, ((PyObject *)__pyx_codeobj__20)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 144, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_11__semaphore_Semaphore->tp_dict, __pyx_n_s_exit, __pyx_t_2) < 0) __PYX_ERR(0, 144, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_11__semaphore_Semaphore);
+  __pyx_codeobj__20 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__19, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__semaphore_py, __pyx_n_s_exit, 144, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__20)) __PYX_ERR(0, 144, __pyx_L1_error)
+
+145:         self.release()
+
  __pyx_t_5 = ((struct __pyx_vtabstruct_6gevent_11__semaphore_Semaphore *)__pyx_v_self->__pyx_base.__pyx_vtab)->release(__pyx_v_self, 0); if (unlikely(__pyx_t_5 == ((int)-1000))) __PYX_ERR(0, 145, __pyx_L1_error)
+
 146: 
+
 147: 
+
+148: class BoundedSemaphore(Semaphore):
+
struct __pyx_vtabstruct_6gevent_11__semaphore_BoundedSemaphore {
+  struct __pyx_vtabstruct_6gevent_11__semaphore_Semaphore __pyx_base;
+};
+static struct __pyx_vtabstruct_6gevent_11__semaphore_BoundedSemaphore *__pyx_vtabptr_6gevent_11__semaphore_BoundedSemaphore;
+
 149:     """
+
 150:     BoundedSemaphore(value=1) -> BoundedSemaphore
+
 151: 
+
 152:     A bounded semaphore checks to make sure its current value doesn't
+
 153:     exceed its initial value. If it does, :class:`ValueError` is
+
 154:     raised. In most situations semaphores are used to guard resources
+
 155:     with limited capacity. If the semaphore is released too many times
+
 156:     it's a sign of a bug.
+
 157: 
+
 158:     If not given, *value* defaults to 1.
+
 159:     """
+
 160: 
+
 161:     #: For monkey-patching, allow changing the class of error we raise
+
+162:     _OVER_RELEASE_ERROR = ValueError
+
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_11__semaphore_BoundedSemaphore->tp_dict, __pyx_n_s_OVER_RELEASE_ERROR, __pyx_builtin_ValueError) < 0) __PYX_ERR(0, 162, __pyx_L1_error)
+  PyType_Modified(__pyx_ptype_6gevent_11__semaphore_BoundedSemaphore);
+
 163: 
+
+164:     def __init__(self, *args, **kwargs):
+
/* Python wrapper */
+static int __pyx_pw_6gevent_11__semaphore_16BoundedSemaphore_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static int __pyx_pw_6gevent_11__semaphore_16BoundedSemaphore_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_args = 0;
+  PyObject *__pyx_v_kwargs = 0;
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
+  if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 1))) return -1;
+  if (unlikely(__pyx_kwds)) {
+    __pyx_v_kwargs = PyDict_Copy(__pyx_kwds); if (unlikely(!__pyx_v_kwargs)) return -1;
+    __Pyx_GOTREF(__pyx_v_kwargs);
+  } else {
+    __pyx_v_kwargs = NULL;
+  }
+  __Pyx_INCREF(__pyx_args);
+  __pyx_v_args = __pyx_args;
+  __pyx_r = __pyx_pf_6gevent_11__semaphore_16BoundedSemaphore___init__(((struct __pyx_obj_6gevent_11__semaphore_BoundedSemaphore *)__pyx_v_self), __pyx_v_args, __pyx_v_kwargs);
+
+  /* function exit code */
+  __Pyx_XDECREF(__pyx_v_args);
+  __Pyx_XDECREF(__pyx_v_kwargs);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_11__semaphore_16BoundedSemaphore___init__(struct __pyx_obj_6gevent_11__semaphore_BoundedSemaphore *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = 0;
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_AddTraceback("gevent.__semaphore.BoundedSemaphore.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = -1;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+165:         Semaphore.__init__(self, *args, **kwargs)
+
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_6gevent_11__semaphore_Semaphore), __pyx_n_s_init); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 165, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 165, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(((PyObject *)__pyx_v_self));
+  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
+  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self));
+  __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_v_args); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 165, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 165, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+166:         self._initial_value = self.counter
+
  __pyx_t_4 = __pyx_v_self->__pyx_base.counter;
+  __pyx_v_self->_initial_value = __pyx_t_4;
+
 167: 
+
+168:     def release(self):
+
static PyObject *__pyx_pw_6gevent_11__semaphore_16BoundedSemaphore_3release(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static int __pyx_f_6gevent_11__semaphore_16BoundedSemaphore_release(struct __pyx_obj_6gevent_11__semaphore_BoundedSemaphore *__pyx_v_self, int __pyx_skip_dispatch) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("release", 0);
+  /* Check if called by wrapper */
+  if (unlikely(__pyx_skip_dispatch)) ;
+  /* Check if overridden in Python */
+  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
+    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
+    if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
+    else {
+      PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      #endif
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_release); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 168, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_11__semaphore_16BoundedSemaphore_3release)) {
+        __Pyx_INCREF(__pyx_t_1);
+        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+          if (likely(__pyx_t_4)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+            __Pyx_INCREF(__pyx_t_4);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_3, function);
+          }
+        }
+        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
+        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 168, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 168, __pyx_L1_error)
+        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+        __pyx_r = __pyx_t_5;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        goto __pyx_L0;
+      }
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+      tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
+      if (unlikely(type_dict_guard != tp_dict_version)) {
+        tp_dict_version = obj_dict_version = 0;
+      }
+      #endif
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    }
+    #endif
+  }
+/* … */
+  /* function exit code */
+  __pyx_r = 0;
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_AddTraceback("gevent.__semaphore.BoundedSemaphore.release", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = -1000;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_11__semaphore_16BoundedSemaphore_3release(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6gevent_11__semaphore_16BoundedSemaphore_2release[] = "BoundedSemaphore.release(self) -> int";
+static PyMethodDef __pyx_mdef_6gevent_11__semaphore_16BoundedSemaphore_3release = {"release", (PyCFunction)__pyx_pw_6gevent_11__semaphore_16BoundedSemaphore_3release, METH_NOARGS, __pyx_doc_6gevent_11__semaphore_16BoundedSemaphore_2release};
+static PyObject *__pyx_pw_6gevent_11__semaphore_16BoundedSemaphore_3release(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("release (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_11__semaphore_16BoundedSemaphore_2release(((struct __pyx_obj_6gevent_11__semaphore_BoundedSemaphore *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_11__semaphore_16BoundedSemaphore_2release(struct __pyx_obj_6gevent_11__semaphore_BoundedSemaphore *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("release", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __pyx_f_6gevent_11__semaphore_16BoundedSemaphore_release(__pyx_v_self, 1); if (unlikely(__pyx_t_1 == ((int)-1000))) __PYX_ERR(0, 168, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 168, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_r = __pyx_t_2;
+  __pyx_t_2 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_AddTraceback("gevent.__semaphore.BoundedSemaphore.release", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__21 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(0, 168, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__21);
+  __Pyx_GIVEREF(__pyx_tuple__21);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_11__semaphore_16BoundedSemaphore_3release, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BoundedSemaphore_release, NULL, __pyx_n_s_gevent___semaphore, __pyx_d, ((PyObject *)__pyx_codeobj__22)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 168, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_11__semaphore_BoundedSemaphore->tp_dict, __pyx_n_s_release, __pyx_t_2) < 0) __PYX_ERR(0, 168, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_11__semaphore_BoundedSemaphore);
+
+169:         if self.counter >= self._initial_value:
+
  __pyx_t_6 = ((__pyx_v_self->__pyx_base.counter >= __pyx_v_self->_initial_value) != 0);
+  if (unlikely(__pyx_t_6)) {
+/* … */
+  }
+
+170:             raise self._OVER_RELEASE_ERROR("Semaphore released too many times")
+
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_OVER_RELEASE_ERROR); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 170, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_3 = NULL;
+    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+      if (likely(__pyx_t_3)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+        __Pyx_INCREF(__pyx_t_3);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_2, function);
+      }
+    }
+    __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_kp_s_Semaphore_released_too_many_time) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_kp_s_Semaphore_released_too_many_time);
+    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 170, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __PYX_ERR(0, 170, __pyx_L1_error)
+
+171:         Semaphore.release(self)
+
  __pyx_t_5 = __pyx_f_6gevent_11__semaphore_9Semaphore_release(((struct __pyx_obj_6gevent_11__semaphore_Semaphore *)__pyx_v_self), 1); if (unlikely(__pyx_t_5 == ((int)-1000))) __PYX_ERR(0, 171, __pyx_L1_error)
+
 172: 
+
 173: 
+
 174: 
+
 175: # By building the semaphore with Cython under PyPy, we get
+
 176: # atomic operations (specifically, exiting/releasing), at the
+
 177: # cost of some speed (one trivial semaphore micro-benchmark put the pure-python version
+
 178: # at around 1s and the compiled version at around 4s). Some clever subclassing
+
 179: # and having only the bare minimum be in cython might help reduce that penalty.
+
 180: # NOTE: You must use version 0.23.4 or later to avoid a memory leak.
+
 181: # https://mail.python.org/pipermail/cython-devel/2015-October/004571.html
+
 182: # However, that's all for naught on up to and including PyPy 4.0.1 which
+
 183: # have some serious crashing bugs with GC interacting with cython.
+
 184: # It hasn't been tested since then, and PURE_PYTHON is assumed to be true
+
 185: # for PyPy in all cases anyway, so this does nothing.
+
 186: 
+
+187: from gevent._util import import_c_accel
+
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 187, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_import_c_accel);
+  __Pyx_GIVEREF(__pyx_n_s_import_c_accel);
+  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_import_c_accel);
+  __pyx_t_1 = __Pyx_Import(__pyx_n_s_gevent__util, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 187, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_import_c_accel); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 187, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_import_c_accel, __pyx_t_2) < 0) __PYX_ERR(0, 187, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+188: import_c_accel(globals(), 'gevent.__semaphore')
+
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_import_c_accel); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 188, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = __Pyx_Globals(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 188, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 188, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_GIVEREF(__pyx_t_2);
+  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_gevent___semaphore);
+  __Pyx_GIVEREF(__pyx_n_s_gevent___semaphore);
+  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_n_s_gevent___semaphore);
+  __pyx_t_2 = 0;
+  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 188, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_semaphore.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_semaphore.py new file mode 100644 index 00000000..d55132e8 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_semaphore.py @@ -0,0 +1,188 @@ +# cython: auto_pickle=False,embedsignature=True,always_allow_keywords=False +from __future__ import print_function, absolute_import, division + +__all__ = [ + 'Semaphore', + 'BoundedSemaphore', +] + +def _get_linkable(): + x = __import__('gevent._abstract_linkable') + return x._abstract_linkable.AbstractLinkable +locals()['AbstractLinkable'] = _get_linkable() +del _get_linkable + + +class Semaphore(AbstractLinkable): # pylint:disable=undefined-variable + """ + Semaphore(value=1) -> Semaphore + + A semaphore manages a counter representing the number of release() + calls minus the number of acquire() calls, plus an initial value. + The acquire() method blocks if necessary until it can return + without making the counter negative. + + If not given, ``value`` defaults to 1. + + The semaphore is a context manager and can be used in ``with`` statements. + + This Semaphore's ``__exit__`` method does not call the trace function + on CPython, but does under PyPy. + + .. seealso:: :class:`BoundedSemaphore` for a safer version that prevents + some classes of bugs. + + .. versionchanged:: 1.4.0 + + The order in which waiters are awakened is not specified. It was not + specified previously, but usually went in FIFO order. + """ + + def __init__(self, value=1): + if value < 0: + raise ValueError("semaphore initial value must be >= 0") + super(Semaphore, self).__init__() + self.counter = value + self._notify_all = False + + def __str__(self): + params = (self.__class__.__name__, self.counter, self.linkcount()) + return '<%s counter=%s _links[%s]>' % params + + def locked(self): + """Return a boolean indicating whether the semaphore can be acquired. + Most useful with binary semaphores.""" + return self.counter <= 0 + + def release(self): + """ + Release the semaphore, notifying any waiters if needed. + """ + self.counter += 1 + self._check_and_notify() + return self.counter + + def ready(self): + return self.counter > 0 + + def _start_notify(self): + self._check_and_notify() + + def _wait_return_value(self, waited, wait_success): + if waited: + return wait_success + # We didn't even wait, we must be good to go. + # XXX: This is probably dead code, we're careful not to go into the wait + # state if we don't expect to need to + return True + + def wait(self, timeout=None): + """ + wait(timeout=None) -> int + + Wait until it is possible to acquire this semaphore, or until the optional + *timeout* elapses. + + .. caution:: If this semaphore was initialized with a size of 0, + this method will block forever if no timeout is given. + + :keyword float timeout: If given, specifies the maximum amount of seconds + this method will block. + :return: A number indicating how many times the semaphore can be acquired + before blocking. + """ + if self.counter > 0: + return self.counter + + self._wait(timeout) # return value irrelevant, whether we got it or got a timeout + return self.counter + + def acquire(self, blocking=True, timeout=None): + """ + acquire(blocking=True, timeout=None) -> bool + + Acquire the semaphore. + + .. caution:: If this semaphore was initialized with a size of 0, + this method will block forever (unless a timeout is given or blocking is + set to false). + + :keyword bool blocking: If True (the default), this function will block + until the semaphore is acquired. + :keyword float timeout: If given, specifies the maximum amount of seconds + this method will block. + :return: A boolean indicating whether the semaphore was acquired. + If ``blocking`` is True and ``timeout`` is None (the default), then + (so long as this semaphore was initialized with a size greater than 0) + this will always return True. If a timeout was given, and it expired before + the semaphore was acquired, False will be returned. (Note that this can still + raise a ``Timeout`` exception, if some other caller had already started a timer.) + """ + if self.counter > 0: + self.counter -= 1 + return True + + if not blocking: + return False + + success = self._wait(timeout) + if not success: + # Our timer expired. + return False + + # Neither our timer no another one expired, so we blocked until + # awoke. Therefore, the counter is ours + self.counter -= 1 + assert self.counter >= 0 + return True + + _py3k_acquire = acquire # PyPy needs this; it must be static for Cython + + def __enter__(self): + self.acquire() + + def __exit__(self, t, v, tb): + self.release() + + +class BoundedSemaphore(Semaphore): + """ + BoundedSemaphore(value=1) -> BoundedSemaphore + + A bounded semaphore checks to make sure its current value doesn't + exceed its initial value. If it does, :class:`ValueError` is + raised. In most situations semaphores are used to guard resources + with limited capacity. If the semaphore is released too many times + it's a sign of a bug. + + If not given, *value* defaults to 1. + """ + + #: For monkey-patching, allow changing the class of error we raise + _OVER_RELEASE_ERROR = ValueError + + def __init__(self, *args, **kwargs): + Semaphore.__init__(self, *args, **kwargs) + self._initial_value = self.counter + + def release(self): + if self.counter >= self._initial_value: + raise self._OVER_RELEASE_ERROR("Semaphore released too many times") + Semaphore.release(self) + + + +# By building the semaphore with Cython under PyPy, we get +# atomic operations (specifically, exiting/releasing), at the +# cost of some speed (one trivial semaphore micro-benchmark put the pure-python version +# at around 1s and the compiled version at around 4s). Some clever subclassing +# and having only the bare minimum be in cython might help reduce that penalty. +# NOTE: You must use version 0.23.4 or later to avoid a memory leak. +# https://mail.python.org/pipermail/cython-devel/2015-October/004571.html +# However, that's all for naught on up to and including PyPy 4.0.1 which +# have some serious crashing bugs with GC interacting with cython. +# It hasn't been tested since then, and PURE_PYTHON is assumed to be true +# for PyPy in all cases anyway, so this does nothing. + +from gevent._util import import_c_accel +import_c_accel(globals(), 'gevent.__semaphore') diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_socket2.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_socket2.py new file mode 100644 index 00000000..5acca41e --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_socket2.py @@ -0,0 +1,473 @@ +# Copyright (c) 2009-2014 Denis Bilenko and gevent contributors. See LICENSE for details. +""" +Python 2 socket module. +""" +from __future__ import absolute_import + +# Our import magic sadly makes this warning useless +# pylint: disable=undefined-variable + +from gevent import _socketcommon +from gevent._util import copy_globals +from gevent._compat import PYPY +from gevent.timeout import Timeout + +copy_globals(_socketcommon, globals(), + names_to_ignore=_socketcommon.__py3_imports__ + _socketcommon.__extensions__, + dunder_names_to_keep=()) + +__socket__ = _socketcommon.__socket__ +__implements__ = _socketcommon._implements +__extensions__ = _socketcommon.__extensions__ +__imports__ = [i for i in _socketcommon.__imports__ if i not in _socketcommon.__py3_imports__] +__dns__ = _socketcommon.__dns__ +try: + _fileobject = __socket__._fileobject + _socketmethods = __socket__._socketmethods +except AttributeError: + # Allow this module to be imported under Python 3 + # for building the docs + _fileobject = object + _socketmethods = ('bind', 'connect', 'connect_ex', + 'fileno', 'listen', 'getpeername', + 'getsockname', 'getsockopt', + 'setsockopt', 'sendall', + 'setblocking', 'settimeout', + 'gettimeout', 'shutdown') +else: + # Python 2 doesn't natively support with statements on _fileobject; + # but it eases our test cases if we can do the same with on both Py3 + # and Py2. Implementation copied from Python 3 + assert not hasattr(_fileobject, '__enter__') + # we could either patch in place: + #_fileobject.__enter__ = lambda self: self + #_fileobject.__exit__ = lambda self, *args: self.close() if not self.closed else None + # or we could subclass. subclassing has the benefit of not + # changing the behaviour of the stdlib if we're just imported; OTOH, + # under Python 2.6/2.7, test_urllib2net.py asserts that the class IS + # socket._fileobject (sigh), so we have to work around that. + + # We also make it call our custom socket closing method that disposes + # if IO watchers but not the actual socket itself. + + # Python 2 relies on reference counting to close sockets, so this is all + # very ugly and fragile. + + class _fileobject(_fileobject): # pylint:disable=function-redefined + + def __enter__(self): + return self + + def __exit__(self, *args): + if not self.closed: + self.close() + + def close(self): + if self._sock is not None: + self._sock._drop_events() + super(_fileobject, self).close() + + +def _get_memory(data): + try: + mv = memoryview(data) + if mv.shape: + return mv + # No shape, probably working with a ctypes object, + # or something else exotic that supports the buffer interface + return mv.tobytes() + except TypeError: + # fixes "python2.7 array.array doesn't support memoryview used in + # gevent.socket.send" issue + # (http://code.google.com/p/gevent/issues/detail?id=94) + return buffer(data) + + +class _closedsocket(object): + __slots__ = [] + + def _dummy(*args, **kwargs): # pylint:disable=no-method-argument,unused-argument + raise error(EBADF, 'Bad file descriptor') + # All _delegate_methods must also be initialized here. + send = recv = recv_into = sendto = recvfrom = recvfrom_into = _dummy + + if PYPY: + + def _drop(self): + pass + + def _reuse(self): + pass + + __getattr__ = _dummy + + +timeout_default = object() + +from gevent._hub_primitives import wait_on_socket as _wait_on_socket + +class socket(object): + """ + gevent `socket.socket `_ + for Python 2. + + This object should have the same API as the standard library socket linked to above. Not all + methods are specifically documented here; when they are they may point out a difference + to be aware of or may document a method the standard library does not. + """ + + # pylint:disable=too-many-public-methods + + def __init__(self, family=AF_INET, type=SOCK_STREAM, proto=0, _sock=None): + if _sock is None: + self._sock = _realsocket(family, type, proto) + self.timeout = _socket.getdefaulttimeout() + else: + if hasattr(_sock, '_sock'): + # passed a gevent socket + self._sock = _sock._sock + self.timeout = getattr(_sock, 'timeout', False) + if self.timeout is False: + self.timeout = _socket.getdefaulttimeout() + else: + # passed a native socket + self._sock = _sock + self.timeout = _socket.getdefaulttimeout() + if PYPY: + self._sock._reuse() + self._sock.setblocking(0) + fileno = self._sock.fileno() + self.hub = get_hub() + io = self.hub.loop.io + self._read_event = io(fileno, 1) + self._write_event = io(fileno, 2) + + def __repr__(self): + return '<%s at %s %s>' % (type(self).__name__, hex(id(self)), self._formatinfo()) + + def __str__(self): + return '<%s %s>' % (type(self).__name__, self._formatinfo()) + + def _formatinfo(self): + # pylint:disable=broad-except + try: + fileno = self.fileno() + except Exception as ex: + fileno = str(ex) + try: + sockname = self.getsockname() + sockname = '%s:%s' % sockname + except Exception: + sockname = None + try: + peername = self.getpeername() + peername = '%s:%s' % peername + except Exception: + peername = None + result = 'fileno=%s' % fileno + if sockname is not None: + result += ' sock=' + str(sockname) + if peername is not None: + result += ' peer=' + str(peername) + if getattr(self, 'timeout', None) is not None: + result += ' timeout=' + str(self.timeout) + return result + + def _get_ref(self): + return self._read_event.ref or self._write_event.ref + + def _set_ref(self, value): + self._read_event.ref = value + self._write_event.ref = value + + ref = property(_get_ref, _set_ref) + + _wait = _wait_on_socket + + def accept(self): + while 1: + try: + client_socket, address = self._sock.accept() + break + except error as ex: + if ex.args[0] != EWOULDBLOCK or self.timeout == 0.0: + raise + sys.exc_clear() + self._wait(self._read_event) + sockobj = socket(_sock=client_socket) + if PYPY: + client_socket._drop() + return sockobj, address + + def _drop_events(self, cancel_wait_ex=cancel_wait_ex): + if self._read_event is not None: + self.hub.cancel_wait(self._read_event, cancel_wait_ex, True) + self._read_event = None + if self._write_event is not None: + self.hub.cancel_wait(self._write_event, cancel_wait_ex, True) + self._write_event = None + + + def close(self, _closedsocket=_closedsocket): + # This function should not reference any globals. See Python issue #808164. + + # Also break any reference to the loop.io objects. Our fileno, + # which they were tied to, is now free to be reused, so these + # objects are no longer functional. + self._drop_events() + s = self._sock + + # Note that we change self._sock at this point. Methods *must not* + # cache `self._sock` separately from self._write_event/self._read_event, + # or they will be out of sync and we may get inappropriate errors. + # (See test__hub:TestCloseSocketWhilePolling for an example). + + self._sock = _closedsocket() + if PYPY: + s._drop() + + @property + def closed(self): + return isinstance(self._sock, _closedsocket) + + def connect(self, address): + if self.timeout == 0.0: + return self._sock.connect(address) + + address = _socketcommon._resolve_addr(self._sock, address) + + timer = Timeout._start_new_or_dummy(self.timeout, timeout('timed out')) + try: + while 1: + err = self._sock.getsockopt(SOL_SOCKET, SO_ERROR) + if err: + raise error(err, strerror(err)) + result = self._sock.connect_ex(address) + if not result or result == EISCONN: + break + elif (result in (EWOULDBLOCK, EINPROGRESS, EALREADY)) or (result == EINVAL and is_windows): + self._wait(self._write_event) + else: + raise error(result, strerror(result)) + finally: + timer.close() + + def connect_ex(self, address): + try: + return self.connect(address) or 0 + except timeout: + return EAGAIN + except error as ex: + if type(ex) is error: # pylint:disable=unidiomatic-typecheck + return ex.args[0] + raise # gaierror is not silenced by connect_ex + + def dup(self): + """dup() -> socket object + + Return a new socket object connected to the same system resource. + Note, that the new socket does not inherit the timeout.""" + return socket(_sock=self._sock) + + def makefile(self, mode='r', bufsize=-1): + # Two things to look out for: + # 1) Closing the original socket object should not close the + # fileobject (hence creating a new socket instance); + # An alternate approach is what _socket3.py does, which is to + # keep count of the times makefile objects have been opened (Py3's + # SocketIO helps with that). But the newly created socket, which + # has its own read/write watchers, does need those to be closed + # when the fileobject is; our custom subclass does that. Note that + # we can't pass the 'close=True' argument, as that causes reference counts + # to get screwed up, and Python2 sockets rely on those. + # 2) The resulting fileobject must keep the timeout in order + # to be compatible with the stdlib's socket.makefile. + # Pass self as _sock to preserve timeout. + fobj = _fileobject(type(self)(_sock=self), mode, bufsize) + if PYPY: + self._sock._drop() + return fobj + + def recv(self, *args): + while 1: + try: + return self._sock.recv(*args) + except error as ex: + if ex.args[0] != EWOULDBLOCK or self.timeout == 0.0: + raise + # QQQ without clearing exc_info test__refcount.test_clean_exit fails + sys.exc_clear() + self._wait(self._read_event) + + def recvfrom(self, *args): + while 1: + try: + return self._sock.recvfrom(*args) + except error as ex: + if ex.args[0] != EWOULDBLOCK or self.timeout == 0.0: + raise + sys.exc_clear() + self._wait(self._read_event) + + def recvfrom_into(self, *args): + while 1: + try: + return self._sock.recvfrom_into(*args) + except error as ex: + if ex.args[0] != EWOULDBLOCK or self.timeout == 0.0: + raise + sys.exc_clear() + self._wait(self._read_event) + + def recv_into(self, *args): + while 1: + try: + return self._sock.recv_into(*args) + except error as ex: + if ex.args[0] != EWOULDBLOCK or self.timeout == 0.0: + raise + sys.exc_clear() + self._wait(self._read_event) + + def send(self, data, flags=0, timeout=timeout_default): + if timeout is timeout_default: + timeout = self.timeout + try: + return self._sock.send(data, flags) + except error as ex: + if ex.args[0] not in _socketcommon.GSENDAGAIN or timeout == 0.0: + raise + sys.exc_clear() + self._wait(self._write_event) + try: + return self._sock.send(data, flags) + except error as ex2: + if ex2.args[0] == EWOULDBLOCK: + return 0 + raise + + def sendall(self, data, flags=0): + if isinstance(data, unicode): + data = data.encode() + # this sendall is also reused by gevent.ssl.SSLSocket subclass, + # so it should not call self._sock methods directly + data_memory = _get_memory(data) + return _socketcommon._sendall(self, data_memory, flags) + + def sendto(self, *args): + try: + return self._sock.sendto(*args) + except error as ex: + if ex.args[0] != EWOULDBLOCK or self.timeout == 0.0: + raise + sys.exc_clear() + self._wait(self._write_event) + try: + return self._sock.sendto(*args) + except error as ex2: + if ex2.args[0] == EWOULDBLOCK: + return 0 + raise + + def setblocking(self, flag): + if flag: + self.timeout = None + else: + self.timeout = 0.0 + + def settimeout(self, howlong): + if howlong is not None: + try: + f = howlong.__float__ + except AttributeError: + raise TypeError('a float is required') + howlong = f() + if howlong < 0.0: + raise ValueError('Timeout value out of range') + self.__dict__['timeout'] = howlong # avoid recursion with any property on self.timeout + + def gettimeout(self): + return self.__dict__['timeout'] # avoid recursion with any property on self.timeout + + def shutdown(self, how): + if how == 0: # SHUT_RD + self.hub.cancel_wait(self._read_event, cancel_wait_ex) + elif how == 1: # SHUT_WR + self.hub.cancel_wait(self._write_event, cancel_wait_ex) + else: + self.hub.cancel_wait(self._read_event, cancel_wait_ex) + self.hub.cancel_wait(self._write_event, cancel_wait_ex) + self._sock.shutdown(how) + + family = property(lambda self: self._sock.family) + type = property(lambda self: self._sock.type) + proto = property(lambda self: self._sock.proto) + + def fileno(self): + return self._sock.fileno() + + def getsockname(self): + return self._sock.getsockname() + + def getpeername(self): + return self._sock.getpeername() + + # delegate the functions that we haven't implemented to the real socket object + + _s = "def %s(self, *args): return self._sock.%s(*args)\n\n" + _m = None + for _m in set(_socketmethods) - set(locals()): + exec(_s % (_m, _m,)) + del _m, _s + + if PYPY: + + def _reuse(self): + self._sock._reuse() + + def _drop(self): + self._sock._drop() + + +SocketType = socket + +if hasattr(_socket, 'socketpair'): + + def socketpair(family=getattr(_socket, 'AF_UNIX', _socket.AF_INET), + type=_socket.SOCK_STREAM, proto=0): + one, two = _socket.socketpair(family, type, proto) + result = socket(_sock=one), socket(_sock=two) + if PYPY: + one._drop() + two._drop() + return result +elif 'socketpair' in __implements__: + __implements__.remove('socketpair') + +if hasattr(_socket, 'fromfd'): + + def fromfd(fd, family, type, proto=0): + s = _socket.fromfd(fd, family, type, proto) + result = socket(_sock=s) + if PYPY: + s._drop() + return result + +elif 'fromfd' in __implements__: + __implements__.remove('fromfd') + +if hasattr(__socket__, 'ssl'): + + def ssl(sock, keyfile=None, certfile=None): + # deprecated in 2.7.9 but still present; + # sometimes backported by distros. See ssl.py + # Note that we import gevent.ssl, not _ssl2, to get the correct + # version. + from gevent import ssl as _sslmod + # wrap_socket is 2.7.9/backport, sslwrap_simple is older. They take + # the same arguments. + wrap = getattr(_sslmod, 'wrap_socket', None) or getattr(_sslmod, 'sslwrap_simple') + return wrap(sock, keyfile, certfile) + __implements__.append('ssl') + +__all__ = __implements__ + __extensions__ + __imports__ diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_socket3.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_socket3.py new file mode 100644 index 00000000..973b5a96 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_socket3.py @@ -0,0 +1,756 @@ +# Port of Python 3.3's socket module to gevent +""" +Python 3 socket module. +""" +# Our import magic sadly makes this warning useless +# pylint: disable=undefined-variable +# pylint: disable=too-many-statements,too-many-branches +# pylint: disable=too-many-public-methods,unused-argument +from __future__ import absolute_import +import io +import os +import sys + +from gevent import _socketcommon +from gevent._util import copy_globals +from gevent._compat import PYPY +from gevent.timeout import Timeout +import _socket +from os import dup + + +copy_globals(_socketcommon, globals(), + names_to_ignore=_socketcommon.__extensions__, + dunder_names_to_keep=()) + +try: + from errno import EHOSTUNREACH + from errno import ECONNREFUSED +except ImportError: + EHOSTUNREACH = -1 + ECONNREFUSED = -1 + + +__socket__ = _socketcommon.__socket__ +__implements__ = _socketcommon._implements +__extensions__ = _socketcommon.__extensions__ +__imports__ = _socketcommon.__imports__ +__dns__ = _socketcommon.__dns__ + + +SocketIO = __socket__.SocketIO # pylint:disable=no-member + + +def _get_memory(data): + mv = memoryview(data) + if mv.shape: + return mv + # No shape, probably working with a ctypes object, + # or something else exotic that supports the buffer interface + return mv.tobytes() + +timeout_default = object() + + +class _wrefsocket(_socket.socket): + # Plain stdlib socket.socket objects subclass _socket.socket + # and add weakref ability. The ssl module, for one, counts on this. + # We don't create socket.socket objects (because they may have been + # monkey patched to be the object from this module), but we still + # need to make sure what we do create can be weakrefd. + + __slots__ = ("__weakref__", ) + + if PYPY: + # server.py unwraps the socket object to get the raw _sock; + # it depends on having a timeout property alias, which PyPy does not + # provide. + timeout = property(lambda s: s.gettimeout(), + lambda s, nv: s.settimeout(nv)) + +from gevent._hub_primitives import wait_on_socket as _wait_on_socket + +class socket(object): + """ + gevent `socket.socket `_ + for Python 3. + + This object should have the same API as the standard library socket linked to above. Not all + methods are specifically documented here; when they are they may point out a difference + to be aware of or may document a method the standard library does not. + """ + + # Subclasses can set this to customize the type of the + # native _socket.socket we create. It MUST be a subclass + # of _wrefsocket. (gevent internal usage only) + _gevent_sock_class = _wrefsocket + + _io_refs = 0 + _closed = False + _read_event = None + _write_event = None + + + # Take the same approach as socket2: wrap a real socket object, + # don't subclass it. This lets code that needs the raw _sock (not tied to the hub) + # get it. This shows up in tests like test__example_udp_server. + + if sys.version_info[:2] < (3, 7): + def __init__(self, family=AF_INET, type=SOCK_STREAM, proto=0, fileno=None): + self._sock = self._gevent_sock_class(family, type, proto, fileno) + self.timeout = None + self.__init_common() + else: + # In 3.7, socket changed to auto-detecting family, type, and proto + # when given a fileno. + def __init__(self, family=-1, type=-1, proto=-1, fileno=None): + if fileno is None: + if family == -1: + family = AF_INET + if type == -1: + type = SOCK_STREAM + if proto == -1: + proto = 0 + self._sock = self._gevent_sock_class(family, type, proto, fileno) + self.timeout = None + self.__init_common() + + def __init_common(self): + _socket.socket.setblocking(self._sock, False) + fileno = _socket.socket.fileno(self._sock) + self.hub = get_hub() + io_class = self.hub.loop.io + self._read_event = io_class(fileno, 1) + self._write_event = io_class(fileno, 2) + self.timeout = _socket.getdefaulttimeout() + + def __getattr__(self, name): + return getattr(self._sock, name) + + if hasattr(_socket, 'SOCK_NONBLOCK'): + # Only defined under Linux + @property + def type(self): + # See https://github.com/gevent/gevent/pull/399 + if self.timeout != 0.0: + return self._sock.type & ~_socket.SOCK_NONBLOCK # pylint:disable=no-member + return self._sock.type + + def getblocking(self): + """ + Returns whether the socket will approximate blocking + behaviour. + + .. versionadded:: 1.3a2 + Added in Python 3.7. + """ + return self.timeout != 0.0 + + def __enter__(self): + return self + + def __exit__(self, *args): + if not self._closed: + self.close() + + def __repr__(self): + """Wrap __repr__() to reveal the real class name.""" + try: + s = _socket.socket.__repr__(self._sock) + except Exception as ex: # pylint:disable=broad-except + # Observed on Windows Py3.3, printing the repr of a socket + # that just suffered a ConnectionResetError [WinError 10054]: + # "OverflowError: no printf formatter to display the socket descriptor in decimal" + # Not sure what the actual cause is or if there's a better way to handle this + s = '' % ex + + if s.startswith(" socket object + + Return a new socket object connected to the same system resource. + """ + fd = dup(self.fileno()) + sock = self.__class__(self.family, self.type, self.proto, fileno=fd) + sock.settimeout(self.gettimeout()) + return sock + + def accept(self): + """accept() -> (socket object, address info) + + Wait for an incoming connection. Return a new socket + representing the connection, and the address of the client. + For IP sockets, the address info is a pair (hostaddr, port). + """ + while True: + try: + fd, addr = self._accept() + break + except BlockingIOError: + if self.timeout == 0.0: + raise + self._wait(self._read_event) + sock = socket(self.family, self.type, self.proto, fileno=fd) + # Python Issue #7995: if no default timeout is set and the listening + # socket had a (non-zero) timeout, force the new socket in blocking + # mode to override platform-specific socket flags inheritance. + # XXX do we need to do this? + if getdefaulttimeout() is None and self.gettimeout(): + sock.setblocking(True) + return sock, addr + + def makefile(self, mode="r", buffering=None, *, + encoding=None, errors=None, newline=None): + """Return an I/O stream connected to the socket + + The arguments are as for io.open() after the filename, + except the only mode characters supported are 'r', 'w' and 'b'. + The semantics are similar too. + """ + # (XXX refactor to share code?) + for c in mode: + if c not in {"r", "w", "b"}: + raise ValueError("invalid mode %r (only r, w, b allowed)") + writing = "w" in mode + reading = "r" in mode or not writing + assert reading or writing + binary = "b" in mode + rawmode = "" + if reading: + rawmode += "r" + if writing: + rawmode += "w" + raw = SocketIO(self, rawmode) + self._io_refs += 1 + if buffering is None: + buffering = -1 + if buffering < 0: + buffering = io.DEFAULT_BUFFER_SIZE + if buffering == 0: + if not binary: + raise ValueError("unbuffered streams must be binary") + return raw + if reading and writing: + buffer = io.BufferedRWPair(raw, raw, buffering) + elif reading: + buffer = io.BufferedReader(raw, buffering) + else: + assert writing + buffer = io.BufferedWriter(raw, buffering) + if binary: + return buffer + text = io.TextIOWrapper(buffer, encoding, errors, newline) + text.mode = mode + return text + + def _decref_socketios(self): + # Called by SocketIO when it is closed. + if self._io_refs > 0: + self._io_refs -= 1 + if self._closed: + self.close() + + def _drop_events(self): + if self._read_event is not None: + self.hub.cancel_wait(self._read_event, cancel_wait_ex, True) + self._read_event = None + if self._write_event is not None: + self.hub.cancel_wait(self._write_event, cancel_wait_ex, True) + self._write_event = None + + def _real_close(self, _ss=_socket.socket, cancel_wait_ex=cancel_wait_ex): + # This function should not reference any globals. See Python issue #808164. + + # Break any reference to the loop.io objects. Our fileno, + # which they were tied to, is now free to be reused, so these + # objects are no longer functional. + self._drop_events() + + _ss.close(self._sock) + + # Break any references to the underlying socket object. Tested + # by test__refcount. (Why does this matter?). Be sure to + # preserve our same family/type/proto if possible (if we + # don't, we can get TypeError instead of OSError; see + # test_socket.SendmsgUDP6Test.testSendmsgAfterClose)... but + # this isn't always possible (see test_socket.test_unknown_socket_family_repr) + # TODO: Can we use a simpler proxy, like _socket2 does? + try: + self._sock = self._gevent_sock_class(self.family, self.type, self.proto) + except OSError: + pass + else: + _ss.close(self._sock) + + + def close(self): + # This function should not reference any globals. See Python issue #808164. + self._closed = True + if self._io_refs <= 0: + self._real_close() + + @property + def closed(self): + return self._closed + + def detach(self): + """detach() -> file descriptor + + Close the socket object without closing the underlying file descriptor. + The object cannot be used after this call, but the file descriptor + can be reused for other purposes. The file descriptor is returned. + """ + self._closed = True + return self._sock.detach() + + def connect(self, address): + if self.timeout == 0.0: + return _socket.socket.connect(self._sock, address) + address = _socketcommon._resolve_addr(self._sock, address) + + with Timeout._start_new_or_dummy(self.timeout, timeout("timed out")): + while True: + err = self.getsockopt(SOL_SOCKET, SO_ERROR) + if err: + raise error(err, strerror(err)) + result = _socket.socket.connect_ex(self._sock, address) + + if not result or result == EISCONN: + break + elif (result in (EWOULDBLOCK, EINPROGRESS, EALREADY)) or (result == EINVAL and is_windows): + self._wait(self._write_event) + else: + if (isinstance(address, tuple) + and address[0] == 'fe80::1' + and result == EHOSTUNREACH): + # On Python 3.7 on mac, we see EHOSTUNREACH + # returned for this link-local address, but it really is + # supposed to be ECONNREFUSED according to the standard library + # tests (test_socket.NetworkConnectionNoServer.test_create_connection) + # (On previous versions, that code passed the '127.0.0.1' IPv4 address, so + # ipv6 link locals were never a factor; 3.7 passes 'localhost'.) + # It is something of a mystery how the stdlib socket code doesn't + # produce EHOSTUNREACH---I (JAM) can't see how socketmodule.c would avoid + # that. The normal connect just calls connect_ex much like we do. + result = ECONNREFUSED + raise error(result, strerror(result)) + + def connect_ex(self, address): + try: + return self.connect(address) or 0 + except timeout: + return EAGAIN + except gaierror: # pylint:disable=try-except-raise + # gaierror/overflowerror/typerror is not silenced by connect_ex; + # gaierror extends OSError (aka error) so catch it first + raise + except error as ex: + # error is now OSError and it has various subclasses. + # Only those that apply to actually connecting are silenced by + # connect_ex. + if ex.errno: + return ex.errno + raise # pragma: no cover + + def recv(self, *args): + while True: + try: + return _socket.socket.recv(self._sock, *args) + except error as ex: + if ex.args[0] != EWOULDBLOCK or self.timeout == 0.0: + raise + self._wait(self._read_event) + + if hasattr(_socket.socket, 'recvmsg'): + # Only on Unix; PyPy 3.5 5.10.0 provides sendmsg and recvmsg, but not + # recvmsg_into (at least on os x) + + def recvmsg(self, *args): + while True: + try: + return _socket.socket.recvmsg(self._sock, *args) + except error as ex: + if ex.args[0] != EWOULDBLOCK or self.timeout == 0.0: + raise + self._wait(self._read_event) + + if hasattr(_socket.socket, 'recvmsg_into'): + + def recvmsg_into(self, *args): + while True: + try: + return _socket.socket.recvmsg_into(self._sock, *args) + except error as ex: + if ex.args[0] != EWOULDBLOCK or self.timeout == 0.0: + raise + self._wait(self._read_event) + + def recvfrom(self, *args): + while True: + try: + return _socket.socket.recvfrom(self._sock, *args) + except error as ex: + if ex.args[0] != EWOULDBLOCK or self.timeout == 0.0: + raise + self._wait(self._read_event) + + def recvfrom_into(self, *args): + while True: + try: + return _socket.socket.recvfrom_into(self._sock, *args) + except error as ex: + if ex.args[0] != EWOULDBLOCK or self.timeout == 0.0: + raise + self._wait(self._read_event) + + def recv_into(self, *args): + while True: + try: + return _socket.socket.recv_into(self._sock, *args) + except error as ex: + if ex.args[0] != EWOULDBLOCK or self.timeout == 0.0: + raise + self._wait(self._read_event) + + def send(self, data, flags=0, timeout=timeout_default): + if timeout is timeout_default: + timeout = self.timeout + try: + return _socket.socket.send(self._sock, data, flags) + except error as ex: + if ex.args[0] not in _socketcommon.GSENDAGAIN or timeout == 0.0: + raise + self._wait(self._write_event) + try: + return _socket.socket.send(self._sock, data, flags) + except error as ex2: + if ex2.args[0] == EWOULDBLOCK: + return 0 + raise + + def sendall(self, data, flags=0): + # XXX Now that we run on PyPy3, see the notes in _socket2.py's sendall() + # and implement that here if needed. + # PyPy3 is not optimized for performance yet, and is known to be slower than + # PyPy2, so it's possibly premature to do this. However, there is a 3.5 test case that + # possibly exposes this in a severe way. + data_memory = _get_memory(data) + return _socketcommon._sendall(self, data_memory, flags) + + def sendto(self, *args): + try: + return _socket.socket.sendto(self._sock, *args) + except error as ex: + if ex.args[0] != EWOULDBLOCK or self.timeout == 0.0: + raise + self._wait(self._write_event) + try: + return _socket.socket.sendto(self._sock, *args) + except error as ex2: + if ex2.args[0] == EWOULDBLOCK: + return 0 + raise + + if hasattr(_socket.socket, 'sendmsg'): + # Only on Unix + def sendmsg(self, buffers, ancdata=(), flags=0, address=None): + try: + return _socket.socket.sendmsg(self._sock, buffers, ancdata, flags, address) + except error as ex: + if flags & getattr(_socket, 'MSG_DONTWAIT', 0): + # Enable non-blocking behaviour + # XXX: Do all platforms that have sendmsg have MSG_DONTWAIT? + raise + + if ex.args[0] != EWOULDBLOCK or self.timeout == 0.0: + raise + self._wait(self._write_event) + try: + return _socket.socket.sendmsg(self._sock, buffers, ancdata, flags, address) + except error as ex2: + if ex2.args[0] == EWOULDBLOCK: + return 0 + raise + + def setblocking(self, flag): + # Beginning in 3.6.0b3 this is supposed to raise + # if the file descriptor is closed, but the test for it + # involves closing the fileno directly. Since we + # don't touch the fileno here, it doesn't make sense for + # us. + if flag: + self.timeout = None + else: + self.timeout = 0.0 + + def settimeout(self, howlong): + if howlong is not None: + try: + f = howlong.__float__ + except AttributeError: + raise TypeError('a float is required') + howlong = f() + if howlong < 0.0: + raise ValueError('Timeout value out of range') + self.__dict__['timeout'] = howlong + + def gettimeout(self): + return self.__dict__['timeout'] + + def shutdown(self, how): + if how == 0: # SHUT_RD + self.hub.cancel_wait(self._read_event, cancel_wait_ex) + elif how == 1: # SHUT_WR + self.hub.cancel_wait(self._write_event, cancel_wait_ex) + else: + self.hub.cancel_wait(self._read_event, cancel_wait_ex) + self.hub.cancel_wait(self._write_event, cancel_wait_ex) + self._sock.shutdown(how) + + # sendfile: new in 3.5. But there's no real reason to not + # support it everywhere. Note that we can't use os.sendfile() + # because it's not cooperative. + def _sendfile_use_sendfile(self, file, offset=0, count=None): + # This is called directly by tests + raise __socket__._GiveupOnSendfile() # pylint:disable=no-member + + def _sendfile_use_send(self, file, offset=0, count=None): + self._check_sendfile_params(file, offset, count) + if self.gettimeout() == 0: + raise ValueError("non-blocking sockets are not supported") + if offset: + file.seek(offset) + blocksize = min(count, 8192) if count else 8192 + total_sent = 0 + # localize variable access to minimize overhead + file_read = file.read + sock_send = self.send + try: + while True: + if count: + blocksize = min(count - total_sent, blocksize) + if blocksize <= 0: + break + data = memoryview(file_read(blocksize)) + if not data: + break # EOF + while True: + try: + sent = sock_send(data) + except BlockingIOError: + continue + else: + total_sent += sent + if sent < len(data): + data = data[sent:] + else: + break + return total_sent + finally: + if total_sent > 0 and hasattr(file, 'seek'): + file.seek(offset + total_sent) + + def _check_sendfile_params(self, file, offset, count): + if 'b' not in getattr(file, 'mode', 'b'): + raise ValueError("file should be opened in binary mode") + if not self.type & SOCK_STREAM: + raise ValueError("only SOCK_STREAM type sockets are supported") + if count is not None: + if not isinstance(count, int): + raise TypeError( + "count must be a positive integer (got {!r})".format(count)) + if count <= 0: + raise ValueError( + "count must be a positive integer (got {!r})".format(count)) + + def sendfile(self, file, offset=0, count=None): + """sendfile(file[, offset[, count]]) -> sent + + Send a file until EOF is reached by using high-performance + os.sendfile() and return the total number of bytes which + were sent. + *file* must be a regular file object opened in binary mode. + If os.sendfile() is not available (e.g. Windows) or file is + not a regular file socket.send() will be used instead. + *offset* tells from where to start reading the file. + If specified, *count* is the total number of bytes to transmit + as opposed to sending the file until EOF is reached. + File position is updated on return or also in case of error in + which case file.tell() can be used to figure out the number of + bytes which were sent. + The socket must be of SOCK_STREAM type. + Non-blocking sockets are not supported. + + .. versionadded:: 1.1rc4 + Added in Python 3.5, but available under all Python 3 versions in + gevent. + """ + return self._sendfile_use_send(file, offset, count) + + # get/set_inheritable new in 3.4 + if hasattr(os, 'get_inheritable') or hasattr(os, 'get_handle_inheritable'): + # pylint:disable=no-member + if os.name == 'nt': + def get_inheritable(self): + return os.get_handle_inheritable(self.fileno()) + + def set_inheritable(self, inheritable): + os.set_handle_inheritable(self.fileno(), inheritable) + else: + def get_inheritable(self): + return os.get_inheritable(self.fileno()) + + def set_inheritable(self, inheritable): + os.set_inheritable(self.fileno(), inheritable) + _added = "\n\n.. versionadded:: 1.1rc4 Added in Python 3.4" + get_inheritable.__doc__ = "Get the inheritable flag of the socket" + _added + set_inheritable.__doc__ = "Set the inheritable flag of the socket" + _added + del _added + + +if sys.version_info[:2] == (3, 4) and sys.version_info[:3] <= (3, 4, 2): + # Python 3.4, up to and including 3.4.2, had a bug where the + # SocketType enumeration overwrote the SocketType class imported + # from _socket. This was fixed in 3.4.3 (http://bugs.python.org/issue20386 + # and https://github.com/python/cpython/commit/0d2f85f38a9691efdfd1e7285c4262cab7f17db7). + # Prior to that, if we replace SocketType with our own class, the implementation + # of socket.type breaks with "OSError: [Errno 97] Address family not supported by protocol". + # Therefore, on these old versions, we must preserve it as an enum; while this + # seems like it could lead to non-green behaviour, code on those versions + # cannot possibly be using SocketType as a class anyway. + SocketType = __socket__.SocketType # pylint:disable=no-member + # Fixup __all__; note that we get exec'd multiple times during unit tests + if 'SocketType' in __implements__: + __implements__.remove('SocketType') + if 'SocketType' not in __imports__: + __imports__.append('SocketType') +else: + SocketType = socket + + +def fromfd(fd, family, type, proto=0): + """ fromfd(fd, family, type[, proto]) -> socket object + + Create a socket object from a duplicate of the given file + descriptor. The remaining arguments are the same as for socket(). + """ + nfd = dup(fd) + return socket(family, type, proto, nfd) + + +if hasattr(_socket.socket, "share"): + def fromshare(info): + """ fromshare(info) -> socket object + + Create a socket object from a the bytes object returned by + socket.share(pid). + """ + return socket(0, 0, 0, info) + + __implements__.append('fromshare') + +if hasattr(_socket, "socketpair"): + + def socketpair(family=None, type=SOCK_STREAM, proto=0): + """socketpair([family[, type[, proto]]]) -> (socket object, socket object) + + Create a pair of socket objects from the sockets returned by the platform + socketpair() function. + The arguments are the same as for socket() except the default family is + AF_UNIX if defined on the platform; otherwise, the default is AF_INET. + + .. versionchanged:: 1.2 + All Python 3 versions on Windows supply this function (natively + supplied by Python 3.5 and above). + """ + if family is None: + try: + family = AF_UNIX + except NameError: + family = AF_INET + a, b = _socket.socketpair(family, type, proto) + a = socket(family, type, proto, a.detach()) + b = socket(family, type, proto, b.detach()) + return a, b + +else: # pragma: no cover + # Origin: https://gist.github.com/4325783, by Geert Jansen. Public domain. + + # gevent: taken from 3.6 release. Expected to be used only on Win. Added to Win/3.5 + # gevent: for < 3.5, pass the default value of 128 to lsock.listen() + # (3.5+ uses this as a default and the original code passed no value) + + _LOCALHOST = '127.0.0.1' + _LOCALHOST_V6 = '::1' + + def socketpair(family=AF_INET, type=SOCK_STREAM, proto=0): + if family == AF_INET: + host = _LOCALHOST + elif family == AF_INET6: + host = _LOCALHOST_V6 + else: + raise ValueError("Only AF_INET and AF_INET6 socket address families " + "are supported") + if type != SOCK_STREAM: + raise ValueError("Only SOCK_STREAM socket type is supported") + if proto != 0: + raise ValueError("Only protocol zero is supported") + + # We create a connected TCP socket. Note the trick with + # setblocking(False) that prevents us from having to create a thread. + lsock = socket(family, type, proto) + try: + lsock.bind((host, 0)) + lsock.listen(128) + # On IPv6, ignore flow_info and scope_id + addr, port = lsock.getsockname()[:2] + csock = socket(family, type, proto) + try: + csock.setblocking(False) + try: + csock.connect((addr, port)) + except (BlockingIOError, InterruptedError): + pass + csock.setblocking(True) + ssock, _ = lsock.accept() + except: + csock.close() + raise + finally: + lsock.close() + return (ssock, csock) + + if sys.version_info[:2] < (3, 5): + # Not provided natively + if 'socketpair' in __implements__: + # Multiple imports can cause this to be missing if _socketcommon + # was successfully imported, leading to subsequent imports to cause + # ValueError + __implements__.remove('socketpair') + + +if hasattr(__socket__, 'close'): # Python 3.7b1+ + close = __socket__.close # pylint:disable=no-member + __imports__ += ['close'] + +__all__ = __implements__ + __extensions__ + __imports__ diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_socketcommon.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_socketcommon.py new file mode 100644 index 00000000..cd12ac1a --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_socketcommon.py @@ -0,0 +1,401 @@ +# Copyright (c) 2009-2014 Denis Bilenko and gevent contributors. See LICENSE for details. +from __future__ import absolute_import + +# standard functions and classes that this module re-implements in a gevent-aware way: +_implements = [ + 'create_connection', + 'socket', + 'SocketType', + 'fromfd', + 'socketpair', +] + +__dns__ = [ + 'getaddrinfo', + 'gethostbyname', + 'gethostbyname_ex', + 'gethostbyaddr', + 'getnameinfo', + 'getfqdn', +] + +_implements += __dns__ + +# non-standard functions that this module provides: +__extensions__ = [ + 'cancel_wait', + 'wait_read', + 'wait_write', + 'wait_readwrite', +] + +# standard functions and classes that this module re-imports +__imports__ = [ + 'error', + 'gaierror', + 'herror', + 'htonl', + 'htons', + 'ntohl', + 'ntohs', + 'inet_aton', + 'inet_ntoa', + 'inet_pton', + 'inet_ntop', + 'timeout', + 'gethostname', + 'getprotobyname', + 'getservbyname', + 'getservbyport', + 'getdefaulttimeout', + 'setdefaulttimeout', + # Windows: + 'errorTab', +] + +__py3_imports__ = [ + # Python 3 + 'AddressFamily', + 'SocketKind', + 'CMSG_LEN', + 'CMSG_SPACE', + 'dup', + 'if_indextoname', + 'if_nameindex', + 'if_nametoindex', + 'sethostname', +] + +__imports__.extend(__py3_imports__) + +import time +import sys +from gevent._hub_local import get_hub_noargs as get_hub +from gevent._compat import string_types, integer_types, PY3 +from gevent._util import copy_globals + +is_windows = sys.platform == 'win32' +is_macos = sys.platform == 'darwin' + +# pylint:disable=no-name-in-module,unused-import +if is_windows: + # no such thing as WSAEPERM or error code 10001 according to winsock.h or MSDN + from errno import WSAEINVAL as EINVAL + from errno import WSAEWOULDBLOCK as EWOULDBLOCK + from errno import WSAEINPROGRESS as EINPROGRESS + from errno import WSAEALREADY as EALREADY + from errno import WSAEISCONN as EISCONN + from gevent.win32util import formatError as strerror + EAGAIN = EWOULDBLOCK +else: + from errno import EINVAL + from errno import EWOULDBLOCK + from errno import EINPROGRESS + from errno import EALREADY + from errno import EAGAIN + from errno import EISCONN + from os import strerror + +try: + from errno import EBADF +except ImportError: + EBADF = 9 + +# macOS can return EPROTOTYPE when writing to a socket that is shutting +# Down. Retrying the write should return the expected EPIPE error. +# Downstream classes (like pywsgi) know how to handle/ignore EPIPE. +# This set is used by socket.send() to decide whether the write should +# be retried. The default is to retry only on EWOULDBLOCK. Here we add +# EPROTOTYPE on macOS to handle this platform-specific race condition. +GSENDAGAIN = (EWOULDBLOCK,) +if is_macos: + from errno import EPROTOTYPE + GSENDAGAIN += (EPROTOTYPE,) + +import _socket +_realsocket = _socket.socket +import socket as __socket__ + +_name = _value = None +__imports__ = copy_globals(__socket__, globals(), + only_names=__imports__, + ignore_missing_names=True) + +for _name in __socket__.__all__: + _value = getattr(__socket__, _name) + if isinstance(_value, (integer_types, string_types)): + globals()[_name] = _value + __imports__.append(_name) + +del _name, _value + +_timeout_error = timeout # pylint: disable=undefined-variable + +from gevent import _hub_primitives +_hub_primitives.set_default_timeout_error(_timeout_error) + +wait = _hub_primitives.wait_on_watcher +wait_read = _hub_primitives.wait_read +wait_write = _hub_primitives.wait_write +wait_readwrite = _hub_primitives.wait_readwrite + +#: The exception raised by default on a call to :func:`cancel_wait` +class cancel_wait_ex(error): # pylint: disable=undefined-variable + def __init__(self): + super(cancel_wait_ex, self).__init__( + EBADF, + 'File descriptor was closed in another greenlet') + + +def cancel_wait(watcher, error=cancel_wait_ex): + """See :meth:`gevent.hub.Hub.cancel_wait`""" + get_hub().cancel_wait(watcher, error) + + +def gethostbyname(hostname): + """ + gethostbyname(host) -> address + + Return the IP address (a string of the form '255.255.255.255') for a host. + + .. seealso:: :doc:`/dns` + """ + return get_hub().resolver.gethostbyname(hostname) + + +def gethostbyname_ex(hostname): + """ + gethostbyname_ex(host) -> (name, aliaslist, addresslist) + + Return the true host name, a list of aliases, and a list of IP addresses, + for a host. The host argument is a string giving a host name or IP number. + Resolve host and port into list of address info entries. + + .. seealso:: :doc:`/dns` + """ + return get_hub().resolver.gethostbyname_ex(hostname) + + +def getaddrinfo(host, port, family=0, socktype=0, proto=0, flags=0): + """ + Resolve host and port into list of address info entries. + + Translate the host/port argument into a sequence of 5-tuples that contain + all the necessary arguments for creating a socket connected to that service. + host is a domain name, a string representation of an IPv4/v6 address or + None. port is a string service name such as 'http', a numeric port number or + None. By passing None as the value of host and port, you can pass NULL to + the underlying C API. + + The family, type and proto arguments can be optionally specified in order to + narrow the list of addresses returned. Passing zero as a value for each of + these arguments selects the full range of results. + + .. seealso:: :doc:`/dns` + """ + return get_hub().resolver.getaddrinfo(host, port, family, socktype, proto, flags) + +if PY3: + # The name of the socktype param changed to type in Python 3. + # See https://github.com/gevent/gevent/issues/960 + # Using inspect here to directly detect the condition is painful because we have to + # wrap it with a try/except TypeError because not all Python 2 + # versions can get the args of a builtin; we also have to use a with to suppress + # the deprecation warning. + d = getaddrinfo.__doc__ + + def getaddrinfo(host, port, family=0, type=0, proto=0, flags=0): + # pylint:disable=function-redefined, undefined-variable + # Also, on Python 3, we need to translate into the special enums. + # Our lower-level resolvers, including the thread and blocking, which use _socket, + # function simply with integers. + addrlist = get_hub().resolver.getaddrinfo(host, port, family, type, proto, flags) + result = [ + (_intenum_converter(af, AddressFamily), + _intenum_converter(socktype, SocketKind), + proto, canonname, sa) + for af, socktype, proto, canonname, sa + in addrlist + ] + return result + + getaddrinfo.__doc__ = d + del d + + def _intenum_converter(value, enum_klass): + try: + return enum_klass(value) + except ValueError: # pragma: no cover + return value + + +def gethostbyaddr(ip_address): + """ + gethostbyaddr(ip_address) -> (name, aliaslist, addresslist) + + Return the true host name, a list of aliases, and a list of IP addresses, + for a host. The host argument is a string giving a host name or IP number. + + .. seealso:: :doc:`/dns` + """ + return get_hub().resolver.gethostbyaddr(ip_address) + + +def getnameinfo(sockaddr, flags): + """ + getnameinfo(sockaddr, flags) -> (host, port) + + Get host and port for a sockaddr. + + .. seealso:: :doc:`/dns` + """ + return get_hub().resolver.getnameinfo(sockaddr, flags) + + +def getfqdn(name=''): + """Get fully qualified domain name from name. + + An empty argument is interpreted as meaning the local host. + + First the hostname returned by gethostbyaddr() is checked, then + possibly existing aliases. In case no FQDN is available, hostname + from gethostname() is returned. + """ + # pylint: disable=undefined-variable + name = name.strip() + if not name or name == '0.0.0.0': + name = gethostname() + try: + hostname, aliases, _ = gethostbyaddr(name) + except error: + pass + else: + aliases.insert(0, hostname) + for name in aliases: # EWW! pylint:disable=redefined-argument-from-local + if isinstance(name, bytes): + if b'.' in name: + break + elif '.' in name: + break + else: + name = hostname + return name + +def __send_chunk(socket, data_memory, flags, timeleft, end, timeout=_timeout_error): + """ + Send the complete contents of ``data_memory`` before returning. + This is the core loop around :meth:`send`. + + :param timeleft: Either ``None`` if there is no timeout involved, + or a float indicating the timeout to use. + :param end: Either ``None`` if there is no timeout involved, or + a float giving the absolute end time. + :return: An updated value for ``timeleft`` (or None) + :raises timeout: If ``timeleft`` was given and elapsed while + sending this chunk. + """ + data_sent = 0 + len_data_memory = len(data_memory) + started_timer = 0 + while data_sent < len_data_memory: + chunk = data_memory[data_sent:] + if timeleft is None: + data_sent += socket.send(chunk, flags) + elif started_timer and timeleft <= 0: + # Check before sending to guarantee a check + # happens even if each chunk successfully sends its data + # (especially important for SSL sockets since they have large + # buffers). But only do this if we've actually tried to + # send something once to avoid spurious timeouts on non-blocking + # sockets. + raise timeout('timed out') + else: + started_timer = 1 + data_sent += socket.send(chunk, flags, timeout=timeleft) + timeleft = end - time.time() + + return timeleft + +def _sendall(socket, data_memory, flags, + SOL_SOCKET=__socket__.SOL_SOCKET, # pylint:disable=no-member + SO_SNDBUF=__socket__.SO_SNDBUF): # pylint:disable=no-member + """ + Send the *data_memory* (which should be a memoryview) + using the gevent *socket*, performing well on PyPy. + """ + + # On PyPy up through 5.10.0, both PyPy2 and PyPy3, subviews + # (slices) of a memoryview() object copy the underlying bytes the + # first time the builtin socket.send() method is called. On a + # non-blocking socket (that thus calls socket.send() many times) + # with a large input, this results in many repeated copies of an + # ever smaller string, depending on the networking buffering. For + # example, if each send() can process 1MB of a 50MB input, and we + # naively pass the entire remaining subview each time, we'd copy + # 49MB, 48MB, 47MB, etc, thus completely killing performance. To + # workaround this problem, we work in reasonable, fixed-size + # chunks. This results in a 10x improvement to bench_sendall.py, + # while having no measurable impact on CPython (since it doesn't + # copy at all the only extra overhead is a few python function + # calls, which is negligible for large inputs). + + # On one macOS machine, PyPy3 5.10.1 produced ~ 67.53 MB/s before this change, + # and ~ 616.01 MB/s after. + + # See https://bitbucket.org/pypy/pypy/issues/2091/non-blocking-socketsend-slow-gevent + + # Too small of a chunk (the socket's buf size is usually too + # small) results in reduced perf due to *too many* calls to send and too many + # small copies. With a buffer of 143K (the default on my system), for + # example, bench_sendall.py yields ~264MB/s, while using 1MB yields + # ~653MB/s (matching CPython). 1MB is arbitrary and might be better + # chosen, say, to match a page size? + + len_data_memory = len(data_memory) + if not len_data_memory: + # Don't try to send empty data at all, no point, and breaks ssl + # See issue 719 + return 0 + + + chunk_size = max(socket.getsockopt(SOL_SOCKET, SO_SNDBUF), 1024 * 1024) + + data_sent = 0 + end = None + timeleft = None + if socket.timeout is not None: + timeleft = socket.timeout + end = time.time() + timeleft + + while data_sent < len_data_memory: + chunk_end = min(data_sent + chunk_size, len_data_memory) + chunk = data_memory[data_sent:chunk_end] + + timeleft = __send_chunk(socket, chunk, flags, timeleft, end) + data_sent += len(chunk) # Guaranteed it sent the whole thing + +# pylint:disable=no-member +_RESOLVABLE_FAMILIES = (__socket__.AF_INET,) +if __socket__.has_ipv6: + _RESOLVABLE_FAMILIES += (__socket__.AF_INET6,) + +def _resolve_addr(sock, address): + # Internal method: resolve the AF_INET[6] address using + # getaddrinfo. + if sock.family not in _RESOLVABLE_FAMILIES or not isinstance(address, tuple): + return address + # address is (host, port) (ipv4) or (host, port, flowinfo, scopeid) (ipv6). + + # We don't pass the port to getaddrinfo because the C + # socket module doesn't either (on some systems its + # illegal to do that without also passing socket type and + # protocol). Instead we join the port back at the end. + # See https://github.com/gevent/gevent/issues/1252 + host, port = address[:2] + r = getaddrinfo(host, None, sock.family) + address = r[0][-1] + if len(address) == 2: + address = (address[0], port) + else: + address = (address[0], port, address[2], address[3]) + return address diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_ssl2.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_ssl2.py new file mode 100644 index 00000000..051e3645 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_ssl2.py @@ -0,0 +1,441 @@ +# Wrapper module for _ssl. Written by Bill Janssen. +# Ported to gevent by Denis Bilenko. +""" +SSL wrapper for socket objects on Python 2.7.8 and below. + +For the documentation, refer to :mod:`ssl` module manual. + +This module implements cooperative SSL socket wrappers. + +.. deprecated:: 1.3 + This module is not secure. Support for Python versions + with only this level of SSL will be dropped in gevent 1.4. +""" + +from __future__ import absolute_import +# Our import magic sadly makes this warning useless +# pylint: disable=undefined-variable,arguments-differ,no-member + +import ssl as __ssl__ + +_ssl = __ssl__._ssl + +import sys +import errno +from gevent._socket2 import socket +from gevent.socket import _fileobject, timeout_default +from gevent.socket import error as socket_error, EWOULDBLOCK +from gevent.socket import timeout as _socket_timeout +from gevent._compat import PYPY +from gevent._util import copy_globals + + +__implements__ = [ + 'SSLSocket', + 'wrap_socket', + 'get_server_certificate', + 'sslwrap_simple', +] + +# Import all symbols from Python's ssl.py, except those that we are implementing +# and "private" symbols. +__imports__ = copy_globals(__ssl__, globals(), + # SSLSocket *must* subclass gevent.socket.socket; see issue 597 + names_to_ignore=__implements__ + ['socket'], + dunder_names_to_keep=()) + + +# Py2.6 can get RAND_status added twice +__all__ = list(set(__implements__) | set(__imports__)) +if 'namedtuple' in __all__: + __all__.remove('namedtuple') + +class SSLSocket(socket): + """ + gevent `ssl.SSLSocket `_ + for Pythons < 2.7.9. + """ + + def __init__(self, sock, keyfile=None, certfile=None, + server_side=False, cert_reqs=CERT_NONE, + ssl_version=PROTOCOL_SSLv23, ca_certs=None, + do_handshake_on_connect=True, + suppress_ragged_eofs=True, + ciphers=None): + socket.__init__(self, _sock=sock) + + if PYPY: + sock._drop() + + if certfile and not keyfile: + keyfile = certfile + # see if it's connected + try: + socket.getpeername(self) + except socket_error as e: + if e.args[0] != errno.ENOTCONN: + raise + # no, no connection yet + self._sslobj = None + else: + # yes, create the SSL object + if ciphers is None: + self._sslobj = _ssl.sslwrap(self._sock, server_side, + keyfile, certfile, + cert_reqs, ssl_version, ca_certs) + else: + self._sslobj = _ssl.sslwrap(self._sock, server_side, + keyfile, certfile, + cert_reqs, ssl_version, ca_certs, + ciphers) + if do_handshake_on_connect: + self.do_handshake() + self.keyfile = keyfile + self.certfile = certfile + self.cert_reqs = cert_reqs + self.ssl_version = ssl_version + self.ca_certs = ca_certs + self.ciphers = ciphers + self.do_handshake_on_connect = do_handshake_on_connect + self.suppress_ragged_eofs = suppress_ragged_eofs + self._makefile_refs = 0 + + def read(self, len=1024): + """Read up to LEN bytes and return them. + Return zero-length string on EOF.""" + while True: + try: + return self._sslobj.read(len) + except SSLError as ex: + if ex.args[0] == SSL_ERROR_EOF and self.suppress_ragged_eofs: + return '' + if ex.args[0] == SSL_ERROR_WANT_READ: + if self.timeout == 0.0: + raise + sys.exc_clear() + self._wait(self._read_event, timeout_exc=_SSLErrorReadTimeout) + elif ex.args[0] == SSL_ERROR_WANT_WRITE: + if self.timeout == 0.0: + raise + sys.exc_clear() + # note: using _SSLErrorReadTimeout rather than _SSLErrorWriteTimeout below is intentional + self._wait(self._write_event, timeout_exc=_SSLErrorReadTimeout) + else: + raise + + def write(self, data): + """Write DATA to the underlying SSL channel. Returns + number of bytes of DATA actually transmitted.""" + while True: + try: + return self._sslobj.write(data) + except SSLError as ex: + if ex.args[0] == SSL_ERROR_WANT_READ: + if self.timeout == 0.0: + raise + sys.exc_clear() + self._wait(self._read_event, timeout_exc=_SSLErrorWriteTimeout) + elif ex.args[0] == SSL_ERROR_WANT_WRITE: + if self.timeout == 0.0: + raise + sys.exc_clear() + self._wait(self._write_event, timeout_exc=_SSLErrorWriteTimeout) + else: + raise + + def getpeercert(self, binary_form=False): + """Returns a formatted version of the data in the + certificate provided by the other end of the SSL channel. + Return None if no certificate was provided, {} if a + certificate was provided, but not validated.""" + return self._sslobj.peer_certificate(binary_form) + + def cipher(self): + if not self._sslobj: + return None + return self._sslobj.cipher() + + def send(self, data, flags=0, timeout=timeout_default): + if timeout is timeout_default: + timeout = self.timeout + if self._sslobj: + if flags != 0: + raise ValueError( + "non-zero flags not allowed in calls to send() on %s" % + self.__class__) + while True: + try: + v = self._sslobj.write(data) + except SSLError as x: + if x.args[0] == SSL_ERROR_WANT_READ: + if self.timeout == 0.0: + return 0 + sys.exc_clear() + self._wait(self._read_event) + elif x.args[0] == SSL_ERROR_WANT_WRITE: + if self.timeout == 0.0: + return 0 + sys.exc_clear() + self._wait(self._write_event) + else: + raise + else: + return v + else: + return socket.send(self, data, flags, timeout) + # is it possible for sendall() to send some data without encryption if another end shut down SSL? + + def sendall(self, data, flags=0): + try: + socket.sendall(self, data) + except _socket_timeout as ex: + if self.timeout == 0.0: + # Python 2 simply *hangs* in this case, which is bad, but + # Python 3 raises SSLWantWriteError. We do the same. + raise SSLError(SSL_ERROR_WANT_WRITE) + # Convert the socket.timeout back to the sslerror + raise SSLError(*ex.args) + + def sendto(self, *args): + if self._sslobj: + raise ValueError("sendto not allowed on instances of %s" % + self.__class__) + else: + return socket.sendto(self, *args) + + def recv(self, buflen=1024, flags=0): + if self._sslobj: + if flags != 0: + raise ValueError( + "non-zero flags not allowed in calls to recv() on %s" % + self.__class__) + # QQQ Shouldn't we wrap the SSL_WANT_READ errors as socket.timeout errors to match socket.recv's behavior? + return self.read(buflen) + return socket.recv(self, buflen, flags) + + def recv_into(self, buffer, nbytes=None, flags=0): + if buffer and (nbytes is None): + nbytes = len(buffer) + elif nbytes is None: + nbytes = 1024 + if self._sslobj: + if flags != 0: + raise ValueError( + "non-zero flags not allowed in calls to recv_into() on %s" % + self.__class__) + while True: + try: + tmp_buffer = self.read(nbytes) + v = len(tmp_buffer) + buffer[:v] = tmp_buffer + return v + except SSLError as x: + if x.args[0] == SSL_ERROR_WANT_READ: + if self.timeout == 0.0: + raise + sys.exc_clear() + self._wait(self._read_event) + continue + else: + raise + else: + return socket.recv_into(self, buffer, nbytes, flags) + + def recvfrom(self, *args): + if self._sslobj: + raise ValueError("recvfrom not allowed on instances of %s" % + self.__class__) + else: + return socket.recvfrom(self, *args) + + def recvfrom_into(self, *args): + if self._sslobj: + raise ValueError("recvfrom_into not allowed on instances of %s" % + self.__class__) + else: + return socket.recvfrom_into(self, *args) + + def pending(self): + if self._sslobj: + return self._sslobj.pending() + return 0 + + def _sslobj_shutdown(self): + while True: + try: + return self._sslobj.shutdown() + except SSLError as ex: + if ex.args[0] == SSL_ERROR_EOF and self.suppress_ragged_eofs: + return '' + if ex.args[0] == SSL_ERROR_WANT_READ: + if self.timeout == 0.0: + raise + sys.exc_clear() + self._wait(self._read_event, timeout_exc=_SSLErrorReadTimeout) + elif ex.args[0] == SSL_ERROR_WANT_WRITE: + if self.timeout == 0.0: + raise + sys.exc_clear() + self._wait(self._write_event, timeout_exc=_SSLErrorWriteTimeout) + else: + raise + + def unwrap(self): + if not self._sslobj: + raise ValueError("No SSL wrapper around " + str(self)) + s = self._sslobj_shutdown() + self._sslobj = None + return socket(_sock=s) + + def shutdown(self, how): + self._sslobj = None + socket.shutdown(self, how) + + def close(self): + if self._makefile_refs < 1: + self._sslobj = None + socket.close(self) + else: + self._makefile_refs -= 1 + + if PYPY: + + def _reuse(self): + self._makefile_refs += 1 + + def _drop(self): + if self._makefile_refs < 1: + self.close() + else: + self._makefile_refs -= 1 + + def do_handshake(self): + """Perform a TLS/SSL handshake.""" + while True: + try: + return self._sslobj.do_handshake() + except SSLError as ex: + if ex.args[0] == SSL_ERROR_WANT_READ: + if self.timeout == 0.0: + raise + sys.exc_clear() + self._wait(self._read_event, timeout_exc=_SSLErrorHandshakeTimeout) + elif ex.args[0] == SSL_ERROR_WANT_WRITE: + if self.timeout == 0.0: + raise + sys.exc_clear() + self._wait(self._write_event, timeout_exc=_SSLErrorHandshakeTimeout) + else: + raise + + def connect(self, addr): + """Connects to remote ADDR, and then wraps the connection in + an SSL channel.""" + # Here we assume that the socket is client-side, and not + # connected at the time of the call. We connect it, then wrap it. + if self._sslobj: + raise ValueError("attempt to connect already-connected SSLSocket!") + socket.connect(self, addr) + if self.ciphers is None: + self._sslobj = _ssl.sslwrap(self._sock, False, self.keyfile, self.certfile, + self.cert_reqs, self.ssl_version, + self.ca_certs) + else: + self._sslobj = _ssl.sslwrap(self._sock, False, self.keyfile, self.certfile, + self.cert_reqs, self.ssl_version, + self.ca_certs, self.ciphers) + if self.do_handshake_on_connect: + self.do_handshake() + + def accept(self): + """Accepts a new connection from a remote client, and returns + a tuple containing that new connection wrapped with a server-side + SSL channel, and the address of the remote client.""" + sock = self._sock + while True: + try: + client_socket, address = sock.accept() + break + except socket_error as ex: + if ex.args[0] != EWOULDBLOCK or self.timeout == 0.0: + raise + sys.exc_clear() + self._wait(self._read_event) + + sslobj = SSLSocket(client_socket, + keyfile=self.keyfile, + certfile=self.certfile, + server_side=True, + cert_reqs=self.cert_reqs, + ssl_version=self.ssl_version, + ca_certs=self.ca_certs, + do_handshake_on_connect=self.do_handshake_on_connect, + suppress_ragged_eofs=self.suppress_ragged_eofs, + ciphers=self.ciphers) + + return sslobj, address + + def makefile(self, mode='r', bufsize=-1): + """Make and return a file-like object that + works with the SSL connection. Just use the code + from the socket module.""" + if not PYPY: + self._makefile_refs += 1 + # close=True so as to decrement the reference count when done with + # the file-like object. + return _fileobject(self, mode, bufsize, close=True) + +if PYPY or not hasattr(SSLSocket, 'timeout'): + # PyPy (and certain versions of CPython) doesn't have a direct + # 'timeout' property on raw sockets, because that's not part of + # the documented specification. We may wind up wrapping a raw + # socket (when ssl is used with PyWSGI) or a gevent socket, which + # does have a read/write timeout property as an alias for + # get/settimeout, so make sure that's always the case because + # pywsgi can depend on that. + SSLSocket.timeout = property(lambda self: self.gettimeout(), + lambda self, value: self.settimeout(value)) + + +_SSLErrorReadTimeout = SSLError('The read operation timed out') +_SSLErrorWriteTimeout = SSLError('The write operation timed out') +_SSLErrorHandshakeTimeout = SSLError('The handshake operation timed out') + + +def wrap_socket(sock, keyfile=None, certfile=None, + server_side=False, cert_reqs=CERT_NONE, + ssl_version=PROTOCOL_SSLv23, ca_certs=None, + do_handshake_on_connect=True, + suppress_ragged_eofs=True, ciphers=None): + """Create a new :class:`SSLSocket` instance.""" + return SSLSocket(sock, keyfile=keyfile, certfile=certfile, + server_side=server_side, cert_reqs=cert_reqs, + ssl_version=ssl_version, ca_certs=ca_certs, + do_handshake_on_connect=do_handshake_on_connect, + suppress_ragged_eofs=suppress_ragged_eofs, + ciphers=ciphers) + + +def get_server_certificate(addr, ssl_version=PROTOCOL_SSLv23, ca_certs=None): + """Retrieve the certificate from the server at the specified address, + and return it as a PEM-encoded string. + If 'ca_certs' is specified, validate the server cert against it. + If 'ssl_version' is specified, use it in the connection attempt.""" + + if ca_certs is not None: + cert_reqs = CERT_REQUIRED + else: + cert_reqs = CERT_NONE + s = wrap_socket(socket(), ssl_version=ssl_version, + cert_reqs=cert_reqs, ca_certs=ca_certs) + s.connect(addr) + dercert = s.getpeercert(True) + s.close() + return DER_cert_to_PEM_cert(dercert) + + +def sslwrap_simple(sock, keyfile=None, certfile=None): + """A replacement for the old socket.ssl function. Designed + for compatibility with Python 2.5 and earlier. Will disappear in + Python 3.0.""" + return SSLSocket(sock, keyfile, certfile) diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_ssl3.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_ssl3.py new file mode 100644 index 00000000..aefc8236 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_ssl3.py @@ -0,0 +1,712 @@ +# Wrapper module for _ssl. Written by Bill Janssen. +# Ported to gevent by Denis Bilenko. +"""SSL wrapper for socket objects on Python 3. + +For the documentation, refer to :mod:`ssl` module manual. + +This module implements cooperative SSL socket wrappers. +""" +# Our import magic sadly makes this warning useless +# pylint: disable=undefined-variable +# pylint:disable=no-member + +from __future__ import absolute_import +import ssl as __ssl__ + +_ssl = __ssl__._ssl + +import errno +from gevent.socket import socket, timeout_default +from gevent.socket import error as socket_error +from gevent.socket import timeout as _socket_timeout +from gevent._util import copy_globals + +from weakref import ref as _wref + +__implements__ = [ + 'SSLContext', + 'SSLSocket', + 'wrap_socket', + 'get_server_certificate', +] + +# Import all symbols from Python's ssl.py, except those that we are implementing +# and "private" symbols. +__imports__ = copy_globals(__ssl__, globals(), + # SSLSocket *must* subclass gevent.socket.socket; see issue 597 + names_to_ignore=__implements__ + ['socket'], + dunder_names_to_keep=()) + +__all__ = __implements__ + __imports__ +if 'namedtuple' in __all__: + __all__.remove('namedtuple') + +orig_SSLContext = __ssl__.SSLContext # pylint:disable=no-member + + +class SSLContext(orig_SSLContext): + + # Added in Python 3.7 + sslsocket_class = None # SSLSocket is assigned later + + def wrap_socket(self, sock, server_side=False, + do_handshake_on_connect=True, + suppress_ragged_eofs=True, + server_hostname=None, + session=None): + # pylint:disable=arguments-differ,not-callable + # (3.6 adds session) + # Sadly, using *args and **kwargs doesn't work + return self.sslsocket_class( + sock=sock, server_side=server_side, + do_handshake_on_connect=do_handshake_on_connect, + suppress_ragged_eofs=suppress_ragged_eofs, + server_hostname=server_hostname, + _context=self, + _session=session) + + if not hasattr(orig_SSLContext, 'check_hostname'): + # Python 3.3 lacks this + check_hostname = False + + if hasattr(orig_SSLContext.options, 'setter'): + # In 3.6, these became properties. They want to access the + # property __set__ method in the superclass, and they do so by using + # super(SSLContext, SSLContext). But we rebind SSLContext when we monkey + # patch, which causes infinite recursion. + # https://github.com/python/cpython/commit/328067c468f82e4ec1b5c510a4e84509e010f296 + # pylint:disable=no-member + @orig_SSLContext.options.setter + def options(self, value): + super(orig_SSLContext, orig_SSLContext).options.__set__(self, value) + + @orig_SSLContext.verify_flags.setter + def verify_flags(self, value): + super(orig_SSLContext, orig_SSLContext).verify_flags.__set__(self, value) + + @orig_SSLContext.verify_mode.setter + def verify_mode(self, value): + super(orig_SSLContext, orig_SSLContext).verify_mode.__set__(self, value) + + if hasattr(orig_SSLContext, 'minimum_version'): + # Like the above, added in 3.7 + @orig_SSLContext.minimum_version.setter + def minimum_version(self, value): + super(orig_SSLContext, orig_SSLContext).minimum_version.__set__(self, value) + + @orig_SSLContext.maximum_version.setter + def maximum_version(self, value): + super(orig_SSLContext, orig_SSLContext).maximum_version.__set__(self, value) + + +class _contextawaresock(socket._gevent_sock_class): + # We have to pass the raw stdlib socket to SSLContext.wrap_socket. + # That method in turn can pass that object on to things like SNI callbacks. + # It wouldn't have access to any of the attributes on the SSLSocket, like + # context, that it's supposed to (see test_ssl.test_sni_callback). Our + # solution is to keep a weak reference to the SSLSocket on the raw + # socket and delegate. + + # We keep it in a slot to avoid having the ability to set any attributes + # we're not prepared for (because we don't know what to delegate.) + + __slots__ = ('_sslsock',) + + @property + def context(self): + return self._sslsock().context + + @context.setter + def context(self, ctx): + self._sslsock().context = ctx + + @property + def session(self): + """The SSLSession for client socket.""" + return self._sslsock().session + + @session.setter + def session(self, session): + self._sslsock().session = session + + def __getattr__(self, name): + try: + return getattr(self._sslsock(), name) + except RuntimeError: + # XXX: If the attribute doesn't exist, + # we infinitely recurse + pass + raise AttributeError(name) + +try: + _SSLObject_factory = SSLObject +except NameError: + # 3.4 and below do not have SSLObject, something + # we magically import through copy_globals + pass +else: + if hasattr(SSLObject, '_create'): + # 3.7 is making thing difficult and won't let you + # actually construct an object + def _SSLObject_factory(sslobj, owner=None, session=None): + s = SSLObject.__new__(SSLObject) + s._sslobj = sslobj + s._sslobj.owner = owner or s + if session is not None: + s._sslobj.session = session + return s + +class SSLSocket(socket): + """ + gevent `ssl.SSLSocket `_ + for Python 3. + """ + + # pylint:disable=too-many-instance-attributes,too-many-public-methods + + _gevent_sock_class = _contextawaresock + + def __init__(self, sock=None, keyfile=None, certfile=None, + server_side=False, cert_reqs=CERT_NONE, + ssl_version=PROTOCOL_SSLv23, ca_certs=None, + do_handshake_on_connect=True, + family=AF_INET, type=SOCK_STREAM, proto=0, fileno=None, + suppress_ragged_eofs=True, npn_protocols=None, ciphers=None, + server_hostname=None, + _session=None, # 3.6 + _context=None): + + # pylint:disable=too-many-locals,too-many-statements,too-many-branches + if _context: + self._context = _context + else: + if server_side and not certfile: + raise ValueError("certfile must be specified for server-side " + "operations") + if keyfile and not certfile: + raise ValueError("certfile must be specified") + if certfile and not keyfile: + keyfile = certfile + self._context = SSLContext(ssl_version) + self._context.verify_mode = cert_reqs + if ca_certs: + self._context.load_verify_locations(ca_certs) + if certfile: + self._context.load_cert_chain(certfile, keyfile) + if npn_protocols: + self._context.set_npn_protocols(npn_protocols) + if ciphers: + self._context.set_ciphers(ciphers) + self.keyfile = keyfile + self.certfile = certfile + self.cert_reqs = cert_reqs + self.ssl_version = ssl_version + self.ca_certs = ca_certs + self.ciphers = ciphers + # Can't use sock.type as other flags (such as SOCK_NONBLOCK) get + # mixed in. + if sock.getsockopt(SOL_SOCKET, SO_TYPE) != SOCK_STREAM: + raise NotImplementedError("only stream sockets are supported") + if server_side: + if server_hostname: + raise ValueError("server_hostname can only be specified " + "in client mode") + if _session is not None: + raise ValueError("session can only be specified " + "in client mode") + if self._context.check_hostname and not server_hostname: + raise ValueError("check_hostname requires server_hostname") + self._session = _session + self.server_side = server_side + self.server_hostname = server_hostname + self.do_handshake_on_connect = do_handshake_on_connect + self.suppress_ragged_eofs = suppress_ragged_eofs + connected = False + if sock is not None: + socket.__init__(self, + family=sock.family, + type=sock.type, + proto=sock.proto, + fileno=sock.fileno()) + self.settimeout(sock.gettimeout()) + # see if it's connected + try: + sock.getpeername() + except socket_error as e: + if e.errno != errno.ENOTCONN: + raise + else: + connected = True + sock.detach() + elif fileno is not None: + socket.__init__(self, fileno=fileno) + else: + socket.__init__(self, family=family, type=type, proto=proto) + + self._sock._sslsock = _wref(self) + self._closed = False + self._sslobj = None + self._connected = connected + if connected: + # create the SSL object + try: + self._sslobj = self._context._wrap_socket(self._sock, server_side, + server_hostname) + if _session is not None: # 3.6+ + self._sslobj = _SSLObject_factory(self._sslobj, owner=self, + session=self._session) + if do_handshake_on_connect: + timeout = self.gettimeout() + if timeout == 0.0: + # non-blocking + raise ValueError("do_handshake_on_connect should not be specified for non-blocking sockets") + self.do_handshake() + + except socket_error as x: + self.close() + raise x + + @property + def context(self): + return self._context + + @context.setter + def context(self, ctx): + self._context = ctx + self._sslobj.context = ctx + + @property + def session(self): + """The SSLSession for client socket.""" + if self._sslobj is not None: + return self._sslobj.session + + @session.setter + def session(self, session): + self._session = session + if self._sslobj is not None: + self._sslobj.session = session + + @property + def session_reused(self): + """Was the client session reused during handshake""" + if self._sslobj is not None: + return self._sslobj.session_reused + + def dup(self): + raise NotImplementedError("Can't dup() %s instances" % + self.__class__.__name__) + + def _checkClosed(self, msg=None): + # raise an exception here if you wish to check for spurious closes + pass + + def _check_connected(self): + if not self._connected: + # getpeername() will raise ENOTCONN if the socket is really + # not connected; note that we can be connected even without + # _connected being set, e.g. if connect() first returned + # EAGAIN. + self.getpeername() + + def read(self, len=1024, buffer=None): + """Read up to LEN bytes and return them. + Return zero-length string on EOF.""" + # pylint:disable=too-many-branches + self._checkClosed() + + while True: + if not self._sslobj: + raise ValueError("Read on closed or unwrapped SSL socket.") + if len == 0: + return b'' if buffer is None else 0 + # Negative lengths are handled natively when the buffer is None + # to raise a ValueError + try: + if buffer is not None: + return self._sslobj.read(len, buffer) + return self._sslobj.read(len or 1024) + except SSLWantReadError: + if self.timeout == 0.0: + raise + self._wait(self._read_event, timeout_exc=_SSLErrorReadTimeout) + except SSLWantWriteError: + if self.timeout == 0.0: + raise + # note: using _SSLErrorReadTimeout rather than _SSLErrorWriteTimeout below is intentional + self._wait(self._write_event, timeout_exc=_SSLErrorReadTimeout) + except SSLError as ex: + if ex.args[0] == SSL_ERROR_EOF and self.suppress_ragged_eofs: + if buffer is None: + return b'' + return 0 + raise + + def write(self, data): + """Write DATA to the underlying SSL channel. Returns + number of bytes of DATA actually transmitted.""" + self._checkClosed() + + while True: + if not self._sslobj: + raise ValueError("Write on closed or unwrapped SSL socket.") + + try: + return self._sslobj.write(data) + except SSLError as ex: + if ex.args[0] == SSL_ERROR_WANT_READ: + if self.timeout == 0.0: + raise + self._wait(self._read_event, timeout_exc=_SSLErrorWriteTimeout) + elif ex.args[0] == SSL_ERROR_WANT_WRITE: + if self.timeout == 0.0: + raise + self._wait(self._write_event, timeout_exc=_SSLErrorWriteTimeout) + else: + raise + + def getpeercert(self, binary_form=False): + """Returns a formatted version of the data in the + certificate provided by the other end of the SSL channel. + Return None if no certificate was provided, {} if a + certificate was provided, but not validated.""" + + self._checkClosed() + self._check_connected() + try: + c = self._sslobj.peer_certificate + except AttributeError: + # 3.6 + c = self._sslobj.getpeercert + + return c(binary_form) + + def selected_npn_protocol(self): + self._checkClosed() + if not self._sslobj or not _ssl.HAS_NPN: + return None + return self._sslobj.selected_npn_protocol() + + if hasattr(_ssl, 'HAS_ALPN'): + # 3.5+ + def selected_alpn_protocol(self): + self._checkClosed() + if not self._sslobj or not _ssl.HAS_ALPN: # pylint:disable=no-member + return None + return self._sslobj.selected_alpn_protocol() + + def shared_ciphers(self): + """Return a list of ciphers shared by the client during the handshake or + None if this is not a valid server connection. + """ + return self._sslobj.shared_ciphers() + + def version(self): + """Return a string identifying the protocol version used by the + current SSL channel. """ + if not self._sslobj: + return None + return self._sslobj.version() + + # We inherit sendfile from super(); it always uses `send` + + def cipher(self): + self._checkClosed() + if not self._sslobj: + return None + return self._sslobj.cipher() + + def compression(self): + self._checkClosed() + if not self._sslobj: + return None + return self._sslobj.compression() + + def send(self, data, flags=0, timeout=timeout_default): + self._checkClosed() + if timeout is timeout_default: + timeout = self.timeout + if self._sslobj: + if flags != 0: + raise ValueError( + "non-zero flags not allowed in calls to send() on %s" % + self.__class__) + while True: + try: + return self._sslobj.write(data) + except SSLWantReadError: + if self.timeout == 0.0: + return 0 + self._wait(self._read_event) + except SSLWantWriteError: + if self.timeout == 0.0: + return 0 + self._wait(self._write_event) + else: + return socket.send(self, data, flags, timeout) + + def sendto(self, data, flags_or_addr, addr=None): + self._checkClosed() + if self._sslobj: + raise ValueError("sendto not allowed on instances of %s" % + self.__class__) + elif addr is None: + return socket.sendto(self, data, flags_or_addr) + else: + return socket.sendto(self, data, flags_or_addr, addr) + + def sendmsg(self, *args, **kwargs): + # Ensure programs don't send data unencrypted if they try to + # use this method. + raise NotImplementedError("sendmsg not allowed on instances of %s" % + self.__class__) + + def sendall(self, data, flags=0): + self._checkClosed() + if self._sslobj: + if flags != 0: + raise ValueError( + "non-zero flags not allowed in calls to sendall() on %s" % + self.__class__) + + try: + return socket.sendall(self, data, flags) + except _socket_timeout: + if self.timeout == 0.0: + # Raised by the stdlib on non-blocking sockets + raise SSLWantWriteError("The operation did not complete (write)") + raise + + def recv(self, buflen=1024, flags=0): + self._checkClosed() + if self._sslobj: + if flags != 0: + raise ValueError( + "non-zero flags not allowed in calls to recv() on %s" % + self.__class__) + if buflen == 0: + # https://github.com/python/cpython/commit/00915577dd84ba75016400793bf547666e6b29b5 + # Python #23804 + return b'' + return self.read(buflen) + return socket.recv(self, buflen, flags) + + def recv_into(self, buffer, nbytes=None, flags=0): + self._checkClosed() + if buffer and (nbytes is None): + nbytes = len(buffer) + elif nbytes is None: + nbytes = 1024 + if self._sslobj: + if flags != 0: + raise ValueError("non-zero flags not allowed in calls to recv_into() on %s" % self.__class__) + return self.read(nbytes, buffer) + return socket.recv_into(self, buffer, nbytes, flags) + + def recvfrom(self, buflen=1024, flags=0): + self._checkClosed() + if self._sslobj: + raise ValueError("recvfrom not allowed on instances of %s" % + self.__class__) + else: + return socket.recvfrom(self, buflen, flags) + + def recvfrom_into(self, buffer, nbytes=None, flags=0): + self._checkClosed() + if self._sslobj: + raise ValueError("recvfrom_into not allowed on instances of %s" % + self.__class__) + else: + return socket.recvfrom_into(self, buffer, nbytes, flags) + + def recvmsg(self, *args, **kwargs): + raise NotImplementedError("recvmsg not allowed on instances of %s" % + self.__class__) + + def recvmsg_into(self, *args, **kwargs): + raise NotImplementedError("recvmsg_into not allowed on instances of " + "%s" % self.__class__) + + def pending(self): + self._checkClosed() + if self._sslobj: + return self._sslobj.pending() + return 0 + + def shutdown(self, how): + self._checkClosed() + self._sslobj = None + socket.shutdown(self, how) + + def unwrap(self): + if not self._sslobj: + raise ValueError("No SSL wrapper around " + str(self)) + + while True: + try: + s = self._sslobj.shutdown() + break + except SSLWantReadError: + # Callers of this method expect to get a socket + # back, so we can't simply return 0, we have + # to let these be raised + if self.timeout == 0.0: + raise + self._wait(self._read_event) + except SSLWantWriteError: + if self.timeout == 0.0: + raise + self._wait(self._write_event) + + self._sslobj = None + + # The return value of shutting down the SSLObject is the + # original wrapped socket passed to _wrap_socket, i.e., + # _contextawaresock. But that object doesn't have the + # gevent wrapper around it so it can't be used. We have to + # wrap it back up with a gevent wrapper. + assert s is self._sock + # In the stdlib, SSLSocket subclasses socket.socket and passes itself + # to _wrap_socket, so it gets itself back. We can't do that, we have to + # pass our subclass of _socket.socket, _contextawaresock. + # So ultimately we should return ourself. + + # See test_ftplib.py:TestTLS_FTPClass.test_ccc + return self + + def _real_close(self): + self._sslobj = None + # self._closed = True + socket._real_close(self) + + def do_handshake(self): + """Perform a TLS/SSL handshake.""" + self._check_connected() + while True: + try: + self._sslobj.do_handshake() + break + except SSLWantReadError: + if self.timeout == 0.0: + raise + self._wait(self._read_event, timeout_exc=_SSLErrorHandshakeTimeout) + except SSLWantWriteError: + if self.timeout == 0.0: + raise + self._wait(self._write_event, timeout_exc=_SSLErrorHandshakeTimeout) + + if sys.version_info[:2] < (3, 7) and self._context.check_hostname: + # In Python 3.7, the underlying OpenSSL name matching is used. + # The version implemented in Python doesn't understand IDNA encoding. + if not self.server_hostname: + raise ValueError("check_hostname needs server_hostname " + "argument") + match_hostname(self.getpeercert(), self.server_hostname) + + def _real_connect(self, addr, connect_ex): + if self.server_side: + raise ValueError("can't connect in server-side mode") + # Here we assume that the socket is client-side, and not + # connected at the time of the call. We connect it, then wrap it. + if self._connected: + raise ValueError("attempt to connect already-connected SSLSocket!") + self._sslobj = self._context._wrap_socket(self._sock, False, self.server_hostname) + if self._session is not None: # 3.6+ + self._sslobj = _SSLObject_factory(self._sslobj, owner=self, session=self._session) + try: + if connect_ex: + rc = socket.connect_ex(self, addr) + else: + rc = None + socket.connect(self, addr) + if not rc: + if self.do_handshake_on_connect: + self.do_handshake() + self._connected = True + return rc + except socket_error: + self._sslobj = None + raise + + def connect(self, addr): + """Connects to remote ADDR, and then wraps the connection in + an SSL channel.""" + self._real_connect(addr, False) + + def connect_ex(self, addr): + """Connects to remote ADDR, and then wraps the connection in + an SSL channel.""" + return self._real_connect(addr, True) + + def accept(self): + """Accepts a new connection from a remote client, and returns + a tuple containing that new connection wrapped with a server-side + SSL channel, and the address of the remote client.""" + + newsock, addr = socket.accept(self) + newsock._drop_events() + newsock = self._context.wrap_socket(newsock, + do_handshake_on_connect=self.do_handshake_on_connect, + suppress_ragged_eofs=self.suppress_ragged_eofs, + server_side=True) + return newsock, addr + + def get_channel_binding(self, cb_type="tls-unique"): + """Get channel binding data for current connection. Raise ValueError + if the requested `cb_type` is not supported. Return bytes of the data + or None if the data is not available (e.g. before the handshake). + """ + if hasattr(self._sslobj, 'get_channel_binding'): + # 3.7+, and sslobj is not None + return self._sslobj.get_channel_binding(cb_type) + if cb_type not in CHANNEL_BINDING_TYPES: + raise ValueError("Unsupported channel binding type") + if cb_type != "tls-unique": + raise NotImplementedError("{0} channel binding type not implemented".format(cb_type)) + if self._sslobj is None: + return None + return self._sslobj.tls_unique_cb() + + +# Python does not support forward declaration of types +SSLContext.sslsocket_class = SSLSocket + +# Python 3.2 onwards raise normal timeout errors, not SSLError. +# See https://bugs.python.org/issue10272 +_SSLErrorReadTimeout = _socket_timeout('The read operation timed out') +_SSLErrorWriteTimeout = _socket_timeout('The write operation timed out') +_SSLErrorHandshakeTimeout = _socket_timeout('The handshake operation timed out') + + +def wrap_socket(sock, keyfile=None, certfile=None, + server_side=False, cert_reqs=CERT_NONE, + ssl_version=PROTOCOL_SSLv23, ca_certs=None, + do_handshake_on_connect=True, + suppress_ragged_eofs=True, + ciphers=None): + + return SSLSocket(sock=sock, keyfile=keyfile, certfile=certfile, + server_side=server_side, cert_reqs=cert_reqs, + ssl_version=ssl_version, ca_certs=ca_certs, + do_handshake_on_connect=do_handshake_on_connect, + suppress_ragged_eofs=suppress_ragged_eofs, + ciphers=ciphers) + + +def get_server_certificate(addr, ssl_version=PROTOCOL_SSLv23, ca_certs=None): + """Retrieve the certificate from the server at the specified address, + and return it as a PEM-encoded string. + If 'ca_certs' is specified, validate the server cert against it. + If 'ssl_version' is specified, use it in the connection attempt.""" + + _, _ = addr + if ca_certs is not None: + cert_reqs = CERT_REQUIRED + else: + cert_reqs = CERT_NONE + s = create_connection(addr) + s = wrap_socket(s, ssl_version=ssl_version, + cert_reqs=cert_reqs, ca_certs=ca_certs) + dercert = s.getpeercert(True) + s.close() + return DER_cert_to_PEM_cert(dercert) diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_sslgte279.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_sslgte279.py new file mode 100644 index 00000000..5580762e --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_sslgte279.py @@ -0,0 +1,714 @@ +# Wrapper module for _ssl. Written by Bill Janssen. +# Ported to gevent by Denis Bilenko. +"""SSL wrapper for socket objects on Python 2.7.9 and above. + +For the documentation, refer to :mod:`ssl` module manual. + +This module implements cooperative SSL socket wrappers. +""" + +from __future__ import absolute_import +# Our import magic sadly makes this warning useless +# pylint: disable=undefined-variable +# pylint: disable=too-many-instance-attributes,too-many-locals,too-many-statements,too-many-branches +# pylint: disable=arguments-differ,too-many-public-methods + +import ssl as __ssl__ + +_ssl = __ssl__._ssl # pylint:disable=no-member + +import errno +from gevent._socket2 import socket +from gevent.socket import timeout_default +from gevent.socket import create_connection +from gevent.socket import error as socket_error +from gevent.socket import timeout as _socket_timeout +from gevent._compat import PYPY +from gevent._util import copy_globals + +__implements__ = [ + 'SSLContext', + 'SSLSocket', + 'wrap_socket', + 'get_server_certificate', + 'create_default_context', + '_create_unverified_context', + '_create_default_https_context', + '_create_stdlib_context', +] + +# Import all symbols from Python's ssl.py, except those that we are implementing +# and "private" symbols. +__imports__ = copy_globals(__ssl__, globals(), + # SSLSocket *must* subclass gevent.socket.socket; see issue 597 and 801 + names_to_ignore=__implements__ + ['socket', 'create_connection'], + dunder_names_to_keep=()) + +try: + _delegate_methods +except NameError: # PyPy doesn't expose this detail + _delegate_methods = ('recv', 'recvfrom', 'recv_into', 'recvfrom_into', 'send', 'sendto') + +__all__ = __implements__ + __imports__ +if 'namedtuple' in __all__: + __all__.remove('namedtuple') + +orig_SSLContext = __ssl__.SSLContext # pylint: disable=no-member + + +class SSLContext(orig_SSLContext): + def wrap_socket(self, sock, server_side=False, + do_handshake_on_connect=True, + suppress_ragged_eofs=True, + server_hostname=None): + return SSLSocket(sock=sock, server_side=server_side, + do_handshake_on_connect=do_handshake_on_connect, + suppress_ragged_eofs=suppress_ragged_eofs, + server_hostname=server_hostname, + _context=self) + + +def create_default_context(purpose=Purpose.SERVER_AUTH, cafile=None, + capath=None, cadata=None): + """Create a SSLContext object with default settings. + + NOTE: The protocol and settings may change anytime without prior + deprecation. The values represent a fair balance between maximum + compatibility and security. + """ + if not isinstance(purpose, _ASN1Object): + raise TypeError(purpose) + + context = SSLContext(PROTOCOL_SSLv23) + + # SSLv2 considered harmful. + context.options |= OP_NO_SSLv2 + + # SSLv3 has problematic security and is only required for really old + # clients such as IE6 on Windows XP + context.options |= OP_NO_SSLv3 + + # disable compression to prevent CRIME attacks (OpenSSL 1.0+) + context.options |= getattr(_ssl, "OP_NO_COMPRESSION", 0) + + if purpose == Purpose.SERVER_AUTH: + # verify certs and host name in client mode + context.verify_mode = CERT_REQUIRED + context.check_hostname = True # pylint: disable=attribute-defined-outside-init + elif purpose == Purpose.CLIENT_AUTH: + # Prefer the server's ciphers by default so that we get stronger + # encryption + context.options |= getattr(_ssl, "OP_CIPHER_SERVER_PREFERENCE", 0) + + # Use single use keys in order to improve forward secrecy + context.options |= getattr(_ssl, "OP_SINGLE_DH_USE", 0) + context.options |= getattr(_ssl, "OP_SINGLE_ECDH_USE", 0) + + # disallow ciphers with known vulnerabilities + context.set_ciphers(_RESTRICTED_SERVER_CIPHERS) + + if cafile or capath or cadata: + context.load_verify_locations(cafile, capath, cadata) + elif context.verify_mode != CERT_NONE: + # no explicit cafile, capath or cadata but the verify mode is + # CERT_OPTIONAL or CERT_REQUIRED. Let's try to load default system + # root CA certificates for the given purpose. This may fail silently. + context.load_default_certs(purpose) + return context + +def _create_unverified_context(protocol=PROTOCOL_SSLv23, cert_reqs=None, + check_hostname=False, purpose=Purpose.SERVER_AUTH, + certfile=None, keyfile=None, + cafile=None, capath=None, cadata=None): + """Create a SSLContext object for Python stdlib modules + + All Python stdlib modules shall use this function to create SSLContext + objects in order to keep common settings in one place. The configuration + is less restrict than create_default_context()'s to increase backward + compatibility. + """ + if not isinstance(purpose, _ASN1Object): + raise TypeError(purpose) + + context = SSLContext(protocol) + # SSLv2 considered harmful. + context.options |= OP_NO_SSLv2 + # SSLv3 has problematic security and is only required for really old + # clients such as IE6 on Windows XP + context.options |= OP_NO_SSLv3 + + if cert_reqs is not None: + context.verify_mode = cert_reqs + context.check_hostname = check_hostname # pylint: disable=attribute-defined-outside-init + + if keyfile and not certfile: + raise ValueError("certfile must be specified") + if certfile or keyfile: + context.load_cert_chain(certfile, keyfile) + + # load CA root certs + if cafile or capath or cadata: + context.load_verify_locations(cafile, capath, cadata) + elif context.verify_mode != CERT_NONE: + # no explicit cafile, capath or cadata but the verify mode is + # CERT_OPTIONAL or CERT_REQUIRED. Let's try to load default system + # root CA certificates for the given purpose. This may fail silently. + context.load_default_certs(purpose) + + return context + +# Used by http.client if no context is explicitly passed. +_create_default_https_context = create_default_context + + +# Backwards compatibility alias, even though it's not a public name. +_create_stdlib_context = _create_unverified_context + +class SSLSocket(socket): + """ + gevent `ssl.SSLSocket `_ + for Pythons >= 2.7.9 but less than 3. + """ + + def __init__(self, sock=None, keyfile=None, certfile=None, + server_side=False, cert_reqs=CERT_NONE, + ssl_version=PROTOCOL_SSLv23, ca_certs=None, + do_handshake_on_connect=True, + family=AF_INET, type=SOCK_STREAM, proto=0, fileno=None, + suppress_ragged_eofs=True, npn_protocols=None, ciphers=None, + server_hostname=None, + _context=None): + # fileno is ignored + # pylint: disable=unused-argument + if _context: + self._context = _context + else: + if server_side and not certfile: + raise ValueError("certfile must be specified for server-side " + "operations") + if keyfile and not certfile: + raise ValueError("certfile must be specified") + if certfile and not keyfile: + keyfile = certfile + self._context = SSLContext(ssl_version) + self._context.verify_mode = cert_reqs + if ca_certs: + self._context.load_verify_locations(ca_certs) + if certfile: + self._context.load_cert_chain(certfile, keyfile) + if npn_protocols: + self._context.set_npn_protocols(npn_protocols) + if ciphers: + self._context.set_ciphers(ciphers) + self.keyfile = keyfile + self.certfile = certfile + self.cert_reqs = cert_reqs + self.ssl_version = ssl_version + self.ca_certs = ca_certs + self.ciphers = ciphers + # Can't use sock.type as other flags (such as SOCK_NONBLOCK) get + # mixed in. + if sock.getsockopt(SOL_SOCKET, SO_TYPE) != SOCK_STREAM: + raise NotImplementedError("only stream sockets are supported") + + if PYPY: + socket.__init__(self, _sock=sock) + sock._drop() + else: + # CPython: XXX: Must pass the underlying socket, not our + # potential wrapper; test___example_servers fails the SSL test + # with a client-side EOF error. (Why?) + socket.__init__(self, _sock=sock._sock) + + # The initializer for socket overrides the methods send(), recv(), etc. + # in the instance, which we don't need -- but we want to provide the + # methods defined in SSLSocket. + for attr in _delegate_methods: + try: + delattr(self, attr) + except AttributeError: + pass + if server_side and server_hostname: + raise ValueError("server_hostname can only be specified " + "in client mode") + if self._context.check_hostname and not server_hostname: + raise ValueError("check_hostname requires server_hostname") + self.server_side = server_side + self.server_hostname = server_hostname + self.do_handshake_on_connect = do_handshake_on_connect + self.suppress_ragged_eofs = suppress_ragged_eofs + self.settimeout(sock.gettimeout()) + + # See if we are connected + try: + self.getpeername() + except socket_error as e: + if e.errno != errno.ENOTCONN: + raise + connected = False + else: + connected = True + + self._makefile_refs = 0 + self._closed = False + self._sslobj = None + self._connected = connected + if connected: + # create the SSL object + try: + self._sslobj = self._context._wrap_socket(self._sock, server_side, + server_hostname, ssl_sock=self) + if do_handshake_on_connect: + timeout = self.gettimeout() + if timeout == 0.0: + # non-blocking + raise ValueError("do_handshake_on_connect should not be specified for non-blocking sockets") + self.do_handshake() + + except socket_error as x: + self.close() + raise x + + + @property + def context(self): + return self._context + + @context.setter + def context(self, ctx): + self._context = ctx + self._sslobj.context = ctx + + def dup(self): + raise NotImplementedError("Can't dup() %s instances" % + self.__class__.__name__) + + def _checkClosed(self, msg=None): + # raise an exception here if you wish to check for spurious closes + pass + + def _check_connected(self): + if not self._connected: + # getpeername() will raise ENOTCONN if the socket is really + # not connected; note that we can be connected even without + # _connected being set, e.g. if connect() first returned + # EAGAIN. + self.getpeername() + + def read(self, len=1024, buffer=None): + """Read up to LEN bytes and return them. + Return zero-length string on EOF.""" + self._checkClosed() + + while 1: + if not self._sslobj: + raise ValueError("Read on closed or unwrapped SSL socket.") + if len == 0: + return b'' if buffer is None else 0 + if len < 0 and buffer is None: + # This is handled natively in python 2.7.12+ + raise ValueError("Negative read length") + try: + if buffer is not None: + return self._sslobj.read(len, buffer) + return self._sslobj.read(len or 1024) + except SSLWantReadError: + if self.timeout == 0.0: + raise + self._wait(self._read_event, timeout_exc=_SSLErrorReadTimeout) + except SSLWantWriteError: + if self.timeout == 0.0: + raise + # note: using _SSLErrorReadTimeout rather than _SSLErrorWriteTimeout below is intentional + self._wait(self._write_event, timeout_exc=_SSLErrorReadTimeout) + except SSLError as ex: + if ex.args[0] == SSL_ERROR_EOF and self.suppress_ragged_eofs: + if buffer is not None: + return 0 + return b'' + raise + + def write(self, data): + """Write DATA to the underlying SSL channel. Returns + number of bytes of DATA actually transmitted.""" + self._checkClosed() + + while 1: + if not self._sslobj: + raise ValueError("Write on closed or unwrapped SSL socket.") + + try: + return self._sslobj.write(data) + except SSLError as ex: + if ex.args[0] == SSL_ERROR_WANT_READ: + if self.timeout == 0.0: + raise + self._wait(self._read_event, timeout_exc=_SSLErrorWriteTimeout) + elif ex.args[0] == SSL_ERROR_WANT_WRITE: + if self.timeout == 0.0: + raise + self._wait(self._write_event, timeout_exc=_SSLErrorWriteTimeout) + else: + raise + + def getpeercert(self, binary_form=False): + """Returns a formatted version of the data in the + certificate provided by the other end of the SSL channel. + Return None if no certificate was provided, {} if a + certificate was provided, but not validated.""" + + self._checkClosed() + self._check_connected() + return self._sslobj.peer_certificate(binary_form) + + def selected_npn_protocol(self): + self._checkClosed() + if not self._sslobj or not _ssl.HAS_NPN: + return None + return self._sslobj.selected_npn_protocol() + + if hasattr(_ssl, 'HAS_ALPN'): + # 2.7.10+ + def selected_alpn_protocol(self): + self._checkClosed() + if not self._sslobj or not _ssl.HAS_ALPN: # pylint:disable=no-member + return None + return self._sslobj.selected_alpn_protocol() + + def cipher(self): + self._checkClosed() + if not self._sslobj: + return None + return self._sslobj.cipher() + + def compression(self): + self._checkClosed() + if not self._sslobj: + return None + return self._sslobj.compression() + + def __check_flags(self, meth, flags): + if flags != 0: + raise ValueError( + "non-zero flags not allowed in calls to %s on %s" % + (meth, self.__class__)) + + def send(self, data, flags=0, timeout=timeout_default): + self._checkClosed() + self.__check_flags('send', flags) + + if timeout is timeout_default: + timeout = self.timeout + + if not self._sslobj: + return socket.send(self, data, flags, timeout) + + while True: + try: + return self._sslobj.write(data) + except SSLWantReadError: + if self.timeout == 0.0: + return 0 + self._wait(self._read_event) + except SSLWantWriteError: + if self.timeout == 0.0: + return 0 + self._wait(self._write_event) + + def sendto(self, data, flags_or_addr, addr=None): + self._checkClosed() + if self._sslobj: + raise ValueError("sendto not allowed on instances of %s" % + self.__class__) + elif addr is None: + return socket.sendto(self, data, flags_or_addr) + else: + return socket.sendto(self, data, flags_or_addr, addr) + + def sendmsg(self, *args, **kwargs): + # Ensure programs don't send data unencrypted if they try to + # use this method. + raise NotImplementedError("sendmsg not allowed on instances of %s" % + self.__class__) + + def sendall(self, data, flags=0): + self._checkClosed() + self.__check_flags('sendall', flags) + + try: + socket.sendall(self, data) + except _socket_timeout as ex: + if self.timeout == 0.0: + # Python 2 simply *hangs* in this case, which is bad, but + # Python 3 raises SSLWantWriteError. We do the same. + raise SSLWantWriteError("The operation did not complete (write)") + # Convert the socket.timeout back to the sslerror + raise SSLError(*ex.args) + + def recv(self, buflen=1024, flags=0): + self._checkClosed() + if self._sslobj: + if flags != 0: + raise ValueError( + "non-zero flags not allowed in calls to recv() on %s" % + self.__class__) + if buflen == 0: + return b'' + return self.read(buflen) + return socket.recv(self, buflen, flags) + + def recv_into(self, buffer, nbytes=None, flags=0): + self._checkClosed() + if buffer is not None and (nbytes is None): + # Fix for python bug #23804: bool(bytearray()) is False, + # but we should read 0 bytes. + nbytes = len(buffer) + elif nbytes is None: + nbytes = 1024 + if self._sslobj: + if flags != 0: + raise ValueError( + "non-zero flags not allowed in calls to recv_into() on %s" % + self.__class__) + return self.read(nbytes, buffer) + return socket.recv_into(self, buffer, nbytes, flags) + + def recvfrom(self, buflen=1024, flags=0): + self._checkClosed() + if self._sslobj: + raise ValueError("recvfrom not allowed on instances of %s" % + self.__class__) + return socket.recvfrom(self, buflen, flags) + + def recvfrom_into(self, buffer, nbytes=None, flags=0): + self._checkClosed() + if self._sslobj: + raise ValueError("recvfrom_into not allowed on instances of %s" % + self.__class__) + else: + return socket.recvfrom_into(self, buffer, nbytes, flags) + + def recvmsg(self, *args, **kwargs): + raise NotImplementedError("recvmsg not allowed on instances of %s" % + self.__class__) + + def recvmsg_into(self, *args, **kwargs): + raise NotImplementedError("recvmsg_into not allowed on instances of " + "%s" % self.__class__) + + def pending(self): + self._checkClosed() + if self._sslobj: + return self._sslobj.pending() + return 0 + + def shutdown(self, how): + self._checkClosed() + self._sslobj = None + socket.shutdown(self, how) + + def close(self): + if self._makefile_refs < 1: + self._sslobj = None + socket.close(self) + else: + self._makefile_refs -= 1 + + if PYPY: + + def _reuse(self): + self._makefile_refs += 1 + + def _drop(self): + if self._makefile_refs < 1: + self.close() + else: + self._makefile_refs -= 1 + + def _sslobj_shutdown(self): + while True: + try: + return self._sslobj.shutdown() + except SSLError as ex: + if ex.args[0] == SSL_ERROR_EOF and self.suppress_ragged_eofs: + return '' + if ex.args[0] == SSL_ERROR_WANT_READ: + if self.timeout == 0.0: + raise + sys.exc_clear() + self._wait(self._read_event, timeout_exc=_SSLErrorReadTimeout) + elif ex.args[0] == SSL_ERROR_WANT_WRITE: + if self.timeout == 0.0: + raise + sys.exc_clear() + self._wait(self._write_event, timeout_exc=_SSLErrorWriteTimeout) + else: + raise + + def unwrap(self): + if not self._sslobj: + raise ValueError("No SSL wrapper around " + str(self)) + + s = self._sslobj_shutdown() + self._sslobj = None + # match _ssl2; critical to drop/reuse here on PyPy + # XXX: _ssl3 returns an SSLSocket. Is that what the standard lib does on + # Python 2? Should we do that? + return socket(_sock=s) + + def _real_close(self): + self._sslobj = None + socket._real_close(self) # pylint: disable=no-member + + def do_handshake(self): + """Perform a TLS/SSL handshake.""" + self._check_connected() + while True: + try: + self._sslobj.do_handshake() + break + except SSLWantReadError: + if self.timeout == 0.0: + raise + self._wait(self._read_event, timeout_exc=_SSLErrorHandshakeTimeout) + except SSLWantWriteError: + if self.timeout == 0.0: + raise + self._wait(self._write_event, timeout_exc=_SSLErrorHandshakeTimeout) + + if self._context.check_hostname: + if not self.server_hostname: + raise ValueError("check_hostname needs server_hostname " + "argument") + match_hostname(self.getpeercert(), self.server_hostname) + + def _real_connect(self, addr, connect_ex): + if self.server_side: + raise ValueError("can't connect in server-side mode") + # Here we assume that the socket is client-side, and not + # connected at the time of the call. We connect it, then wrap it. + if self._connected: + raise ValueError("attempt to connect already-connected SSLSocket!") + self._sslobj = self._context._wrap_socket(self._sock, False, self.server_hostname, ssl_sock=self) + try: + if connect_ex: + rc = socket.connect_ex(self, addr) + else: + rc = None + socket.connect(self, addr) + if not rc: + self._connected = True + if self.do_handshake_on_connect: + self.do_handshake() + return rc + except socket_error: + self._sslobj = None + raise + + def connect(self, addr): + """Connects to remote ADDR, and then wraps the connection in + an SSL channel.""" + self._real_connect(addr, False) + + def connect_ex(self, addr): + """Connects to remote ADDR, and then wraps the connection in + an SSL channel.""" + return self._real_connect(addr, True) + + def accept(self): + """Accepts a new connection from a remote client, and returns + a tuple containing that new connection wrapped with a server-side + SSL channel, and the address of the remote client.""" + + newsock, addr = socket.accept(self) + newsock._drop_events() + newsock = self._context.wrap_socket(newsock, + do_handshake_on_connect=self.do_handshake_on_connect, + suppress_ragged_eofs=self.suppress_ragged_eofs, + server_side=True) + return newsock, addr + + def makefile(self, mode='r', bufsize=-1): + + """Make and return a file-like object that + works with the SSL connection. Just use the code + from the socket module.""" + if not PYPY: + self._makefile_refs += 1 + # close=True so as to decrement the reference count when done with + # the file-like object. + return _fileobject(self, mode, bufsize, close=True) + + def get_channel_binding(self, cb_type="tls-unique"): + """Get channel binding data for current connection. Raise ValueError + if the requested `cb_type` is not supported. Return bytes of the data + or None if the data is not available (e.g. before the handshake). + """ + if cb_type not in CHANNEL_BINDING_TYPES: + raise ValueError("Unsupported channel binding type") + if cb_type != "tls-unique": + raise NotImplementedError( + "{0} channel binding type not implemented" + .format(cb_type)) + if self._sslobj is None: + return None + return self._sslobj.tls_unique_cb() + + def version(self): + """ + Return a string identifying the protocol version used by the + current SSL channel, or None if there is no established channel. + """ + if self._sslobj is None: + return None + return self._sslobj.version() + +if PYPY or not hasattr(SSLSocket, 'timeout'): + # PyPy (and certain versions of CPython) doesn't have a direct + # 'timeout' property on raw sockets, because that's not part of + # the documented specification. We may wind up wrapping a raw + # socket (when ssl is used with PyWSGI) or a gevent socket, which + # does have a read/write timeout property as an alias for + # get/settimeout, so make sure that's always the case because + # pywsgi can depend on that. + SSLSocket.timeout = property(lambda self: self.gettimeout(), + lambda self, value: self.settimeout(value)) + + + +_SSLErrorReadTimeout = SSLError('The read operation timed out') +_SSLErrorWriteTimeout = SSLError('The write operation timed out') +_SSLErrorHandshakeTimeout = SSLError('The handshake operation timed out') + +def wrap_socket(sock, keyfile=None, certfile=None, + server_side=False, cert_reqs=CERT_NONE, + ssl_version=PROTOCOL_SSLv23, ca_certs=None, + do_handshake_on_connect=True, + suppress_ragged_eofs=True, + ciphers=None): + + return SSLSocket(sock=sock, keyfile=keyfile, certfile=certfile, + server_side=server_side, cert_reqs=cert_reqs, + ssl_version=ssl_version, ca_certs=ca_certs, + do_handshake_on_connect=do_handshake_on_connect, + suppress_ragged_eofs=suppress_ragged_eofs, + ciphers=ciphers) + +def get_server_certificate(addr, ssl_version=PROTOCOL_SSLv23, ca_certs=None): + """Retrieve the certificate from the server at the specified address, + and return it as a PEM-encoded string. + If 'ca_certs' is specified, validate the server cert against it. + If 'ssl_version' is specified, use it in the connection attempt.""" + + _, _ = addr + if ca_certs is not None: + cert_reqs = CERT_REQUIRED + else: + cert_reqs = CERT_NONE + context = _create_stdlib_context(ssl_version, + cert_reqs=cert_reqs, + cafile=ca_certs) + with closing(create_connection(addr)) as sock: + with closing(context.wrap_socket(sock)) as sslsock: + dercert = sslsock.getpeercert(True) + return DER_cert_to_PEM_cert(dercert) diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_tblib.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_tblib.py new file mode 100644 index 00000000..13364012 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_tblib.py @@ -0,0 +1,432 @@ +# -*- coding: utf-8 -*- +# A vendored version of part of https://github.com/ionelmc/python-tblib +# pylint:disable=redefined-outer-name,reimported,function-redefined,bare-except,no-else-return,broad-except +#### +# Copyright (c) 2013-2016, Ionel Cristian Mărieș +# All rights reserved. + +# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the +# following conditions are met: + +# 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following +# disclaimer. + +# 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following +# disclaimer in the documentation and/or other materials provided with the distribution. + +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, +# INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#### + +# cpython.py + +""" +Taken verbatim from Jinja2. + +https://github.com/mitsuhiko/jinja2/blob/master/jinja2/debug.py#L267 +""" +# pylint:disable=consider-using-dict-comprehension +#import platform # XXX: gevent cannot import platform at the top level; interferes with monkey patching +import sys + + +def _init_ugly_crap(): + """This function implements a few ugly things so that we can patch the + traceback objects. The function returned allows resetting `tb_next` on + any python traceback object. Do not attempt to use this on non cpython + interpreters + """ + import ctypes + from types import TracebackType + + # figure out side of _Py_ssize_t + if hasattr(ctypes.pythonapi, 'Py_InitModule4_64'): + _Py_ssize_t = ctypes.c_int64 + else: + _Py_ssize_t = ctypes.c_int + + # regular python + class _PyObject(ctypes.Structure): + pass + + _PyObject._fields_ = [ + ('ob_refcnt', _Py_ssize_t), + ('ob_type', ctypes.POINTER(_PyObject)) + ] + + # python with trace + if hasattr(sys, 'getobjects'): + class _PyObject(ctypes.Structure): + pass + + _PyObject._fields_ = [ + ('_ob_next', ctypes.POINTER(_PyObject)), + ('_ob_prev', ctypes.POINTER(_PyObject)), + ('ob_refcnt', _Py_ssize_t), + ('ob_type', ctypes.POINTER(_PyObject)) + ] + + class _Traceback(_PyObject): + pass + + _Traceback._fields_ = [ + ('tb_next', ctypes.POINTER(_Traceback)), + ('tb_frame', ctypes.POINTER(_PyObject)), + ('tb_lasti', ctypes.c_int), + ('tb_lineno', ctypes.c_int) + ] + + def tb_set_next(tb, next): + """Set the tb_next attribute of a traceback object.""" + if not (isinstance(tb, TracebackType) and (next is None or isinstance(next, TracebackType))): + raise TypeError('tb_set_next arguments must be traceback objects') + obj = _Traceback.from_address(id(tb)) + if tb.tb_next is not None: + old = _Traceback.from_address(id(tb.tb_next)) + old.ob_refcnt -= 1 + if next is None: + obj.tb_next = ctypes.POINTER(_Traceback)() + else: + next = _Traceback.from_address(id(next)) + next.ob_refcnt += 1 + obj.tb_next = ctypes.pointer(next) + + return tb_set_next + + +tb_set_next = None +#try: +# if platform.python_implementation() == 'CPython': +# tb_set_next = _init_ugly_crap() +#except Exception as exc: +# sys.stderr.write("Failed to initialize cpython support: {!r}".format(exc)) +#del _init_ugly_crap + +# __init__.py +import re +from types import CodeType +from types import TracebackType + +try: + from __pypy__ import tproxy +except ImportError: + tproxy = None + +__version__ = '1.3.0' +__all__ = ('Traceback',) + +PY3 = sys.version_info[0] == 3 +FRAME_RE = re.compile(r'^\s*File "(?P.+)", line (?P\d+)(, in (?P.+))?$') + + +class _AttrDict(dict): + __slots__ = () + __getattr__ = dict.__getitem__ + + +# noinspection PyPep8Naming +class __traceback_maker(Exception): + pass + + +class TracebackParseError(Exception): + pass + + +class Code(object): + def __init__(self, code): + self.co_filename = code.co_filename + self.co_name = code.co_name + # gevent: copy more attributes + self.co_nlocals = code.co_nlocals + self.co_stacksize = code.co_stacksize + self.co_flags = code.co_flags + self.co_firstlineno = code.co_firstlineno + + +class Frame(object): + def __init__(self, frame): + self.f_globals = dict([ + (k, v) + for k, v in frame.f_globals.items() + if k in ("__file__", "__name__") + ]) + self.f_code = Code(frame.f_code) + + def clear(self): + # For compatibility with PyPy 3.5; + # clear was added to frame in Python 3.4 + # and is called by traceback.clear_frames(), which + # in turn is called by unittest.TestCase.assertRaises + pass + +class Traceback(object): + + tb_next = None + + def __init__(self, tb): + self.tb_frame = Frame(tb.tb_frame) + # noinspection SpellCheckingInspection + self.tb_lineno = int(tb.tb_lineno) + + # Build in place to avoid exceeding the recursion limit + tb = tb.tb_next + prev_traceback = self + cls = type(self) + while tb is not None: + traceback = object.__new__(cls) + traceback.tb_frame = Frame(tb.tb_frame) + traceback.tb_lineno = int(tb.tb_lineno) + prev_traceback.tb_next = traceback + prev_traceback = traceback + tb = tb.tb_next + + def as_traceback(self): + if tproxy: + return tproxy(TracebackType, self.__tproxy_handler) + if not tb_set_next: + raise RuntimeError("Cannot re-create traceback !") + + current = self + top_tb = None + tb = None + while current: + f_code = current.tb_frame.f_code + code = compile('\n' * (current.tb_lineno - 1) + 'raise __traceback_maker', current.tb_frame.f_code.co_filename, 'exec') + if PY3: + code = CodeType( + 0, code.co_kwonlyargcount, + code.co_nlocals, code.co_stacksize, code.co_flags, + code.co_code, code.co_consts, code.co_names, code.co_varnames, + f_code.co_filename, f_code.co_name, + code.co_firstlineno, code.co_lnotab, (), () + ) + else: + code = CodeType( + 0, + code.co_nlocals, code.co_stacksize, code.co_flags, + code.co_code, code.co_consts, code.co_names, code.co_varnames, + f_code.co_filename.encode(), f_code.co_name.encode(), + code.co_firstlineno, code.co_lnotab, (), () + ) + + # noinspection PyBroadException + try: + exec(code, current.tb_frame.f_globals, {}) + except: + next_tb = sys.exc_info()[2].tb_next + if top_tb is None: + top_tb = next_tb + if tb is not None: + tb_set_next(tb, next_tb) + tb = next_tb + del next_tb + + current = current.tb_next + try: + return top_tb + finally: + del top_tb + del tb + + + # noinspection SpellCheckingInspection + def __tproxy_handler(self, operation, *args, **kwargs): + if operation in ('__getattribute__', '__getattr__'): + if args[0] == 'tb_next': + return self.tb_next and self.tb_next.as_traceback() + else: + return getattr(self, args[0]) + else: + return getattr(self, operation)(*args, **kwargs) + + def to_dict(self): + """Convert a Traceback into a dictionary representation""" + if self.tb_next is None: + tb_next = None + else: + tb_next = self.tb_next.to_dict() + + code = { + 'co_filename': self.tb_frame.f_code.co_filename, + 'co_name': self.tb_frame.f_code.co_name, + } + frame = { + 'f_globals': self.tb_frame.f_globals, + 'f_code': code, + } + return { + 'tb_frame': frame, + 'tb_lineno': self.tb_lineno, + 'tb_next': tb_next, + } + + @classmethod + def from_dict(cls, dct): + if dct['tb_next']: + tb_next = cls.from_dict(dct['tb_next']) + else: + tb_next = None + + code = _AttrDict( + co_filename=dct['tb_frame']['f_code']['co_filename'], + co_name=dct['tb_frame']['f_code']['co_name'], + ) + frame = _AttrDict( + f_globals=dct['tb_frame']['f_globals'], + f_code=code, + ) + tb = _AttrDict( + tb_frame=frame, + tb_lineno=dct['tb_lineno'], + tb_next=tb_next, + ) + return cls(tb) + + @classmethod + def from_string(cls, string, strict=True): + frames = [] + header = strict + + for line in string.splitlines(): + line = line.rstrip() + if header: + if line == 'Traceback (most recent call last):': + header = False + continue + frame_match = FRAME_RE.match(line) + if frame_match: + frames.append(frame_match.groupdict()) + elif line.startswith(' '): + pass + elif strict: + break # traceback ended + + if frames: + previous = None + for frame in reversed(frames): + previous = _AttrDict( + frame, + tb_frame=_AttrDict( + frame, + f_globals=_AttrDict( + __file__=frame['co_filename'], + __name__='?', + ), + f_code=_AttrDict(frame), + ), + tb_next=previous, + ) + return cls(previous) + else: + raise TracebackParseError("Could not find any frames in %r." % string) + +# pickling_support.py + + +def unpickle_traceback(tb_frame, tb_lineno, tb_next): + ret = object.__new__(Traceback) + ret.tb_frame = tb_frame + ret.tb_lineno = tb_lineno + ret.tb_next = tb_next + return ret.as_traceback() + + +def pickle_traceback(tb): + return unpickle_traceback, (Frame(tb.tb_frame), tb.tb_lineno, tb.tb_next and Traceback(tb.tb_next)) + + +def install(): + try: + import copy_reg + except ImportError: + import copyreg as copy_reg + + copy_reg.pickle(TracebackType, pickle_traceback) + +# Added by gevent + +# We have to defer the initialization, and especially the import of platform, +# until runtime. If we're monkey patched, we need to be sure to use +# the original __import__ to avoid switching through the hub due to +# import locks on Python 2. See also builtins.py for details. + + +def _unlocked_imports(f): + def g(a): + if sys is None: # pragma: no cover + # interpreter shutdown on Py2 + return + + gb = None + if 'gevent.builtins' in sys.modules: + gb = sys.modules['gevent.builtins'] + gb._unlock_imports() + try: + return f(a) + finally: + if gb is not None: + gb._lock_imports() + g.__name__ = f.__name__ + g.__module__ = f.__module__ + return g + + +def _import_dump_load(): + global dumps + global loads + try: + import cPickle as pickle + except ImportError: + import pickle + dumps = pickle.dumps + loads = pickle.loads + +dumps = loads = None + +_installed = False + + +def _init(): + global _installed + global tb_set_next + if _installed: + return + + _installed = True + import platform + try: + if platform.python_implementation() == 'CPython': + tb_set_next = _init_ugly_crap() + except Exception as exc: + sys.stderr.write("Failed to initialize cpython support: {!r}".format(exc)) + + try: + from __pypy__ import tproxy + except ImportError: + tproxy = None + + if not tb_set_next and not tproxy: + raise ImportError("Cannot use tblib. Runtime not supported.") + _import_dump_load() + install() + + +@_unlocked_imports +def dump_traceback(tb): + # Both _init and dump/load have to be unlocked, because + # copy_reg and pickle can do imports to resolve class names; those + # class names are in this module and greenlet safe though + _init() + return dumps(tb) + + +@_unlocked_imports +def load_traceback(s): + _init() + return loads(s) diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_threading.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_threading.py new file mode 100644 index 00000000..9258dfbf --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_threading.py @@ -0,0 +1,168 @@ +"""A clone of threading module (version 2.7.2) that always +targets real OS threads. (Unlike 'threading' which flips between +green and OS threads based on whether the monkey patching is in effect +or not). + +This module is missing 'Thread' class, but includes 'Queue'. +""" +from __future__ import absolute_import + +from collections import deque + +from gevent import monkey +from gevent._compat import thread_mod_name + + +__all__ = [ + 'Lock', + 'Queue', +] + + +start_new_thread, Lock, get_thread_ident, = monkey.get_original(thread_mod_name, [ + 'start_new_thread', 'allocate_lock', 'get_ident', +]) + + +# pylint 2.0.dev2 things collections.dequeue.popleft() doesn't return +# pylint:disable=assignment-from-no-return + + +class _Condition(object): + # pylint:disable=method-hidden + + def __init__(self, lock): + self.__lock = lock + self.__waiters = [] + + # If the lock defines _release_save() and/or _acquire_restore(), + # these override the default implementations (which just call + # release() and acquire() on the lock). Ditto for _is_owned(). + try: + self._release_save = lock._release_save + except AttributeError: + pass + try: + self._acquire_restore = lock._acquire_restore + except AttributeError: + pass + try: + self._is_owned = lock._is_owned + except AttributeError: + pass + + def __enter__(self): + return self.__lock.__enter__() + + def __exit__(self, t, v, tb): + return self.__lock.__exit__(t, v, tb) + + def __repr__(self): + return "" % (self.__lock, len(self.__waiters)) + + def _release_save(self): + self.__lock.release() # No state to save + + def _acquire_restore(self, x): # pylint:disable=unused-argument + self.__lock.acquire() # Ignore saved state + + def _is_owned(self): + # Return True if lock is owned by current_thread. + # This method is called only if __lock doesn't have _is_owned(). + if self.__lock.acquire(0): + self.__lock.release() + return False + return True + + def wait(self): + # The condition MUST be owned, but we don't check that. + waiter = Lock() + waiter.acquire() + self.__waiters.append(waiter) + saved_state = self._release_save() + try: # restore state no matter what (e.g., KeyboardInterrupt) + waiter.acquire() # Block on the native lock + finally: + self._acquire_restore(saved_state) + + def notify_one(self): + # The condition MUST be owned, but we don't check that. + try: + waiter = self.__waiters.pop() + except IndexError: + # Nobody around + pass + else: + waiter.release() + + +class Queue(object): + """Create a queue object. + + The queue is always infinite size. + """ + + __slots__ = ('_queue', '_mutex', '_not_empty', 'unfinished_tasks') + + def __init__(self): + self._queue = deque() + # mutex must be held whenever the queue is mutating. All methods + # that acquire mutex must release it before returning. mutex + # is shared between the three conditions, so acquiring and + # releasing the conditions also acquires and releases mutex. + self._mutex = Lock() + # Notify not_empty whenever an item is added to the queue; a + # thread waiting to get is notified then. + self._not_empty = _Condition(self._mutex) + + self.unfinished_tasks = 0 + + def task_done(self): + """Indicate that a formerly enqueued task is complete. + + Used by Queue consumer threads. For each get() used to fetch a task, + a subsequent call to task_done() tells the queue that the processing + on the task is complete. + + If a join() is currently blocking, it will resume when all items + have been processed (meaning that a task_done() call was received + for every item that had been put() into the queue). + + Raises a ValueError if called more times than there were items + placed in the queue. + """ + with self._mutex: + unfinished = self.unfinished_tasks - 1 + if unfinished <= 0: + if unfinished < 0: + raise ValueError('task_done() called too many times') + self.unfinished_tasks = unfinished + + def qsize(self, len=len): + """Return the approximate size of the queue (not reliable!).""" + return len(self._queue) + + def empty(self): + """Return True if the queue is empty, False otherwise (not reliable!).""" + return not self.qsize() + + def full(self): + """Return True if the queue is full, False otherwise (not reliable!).""" + return False + + def put(self, item): + """Put an item into the queue. + """ + with self._not_empty: + self._queue.append(item) + self.unfinished_tasks += 1 + self._not_empty.notify_one() + + def get(self): + """Remove and return an item from the queue. + """ + with self._not_empty: + while not self._queue: + self._not_empty.wait() + item = self._queue.popleft() + return item diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_tracer.c b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_tracer.c new file mode 100644 index 00000000..6ec146e8 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_tracer.c @@ -0,0 +1,9661 @@ +/* Generated by Cython 0.29.2 */ + +/* BEGIN: Cython Metadata +{ + "distutils": { + "depends": [ + "src/gevent/__tracer.pxd", + "src\\gevent\\__tracer.pxd" + ], + "include_dirs": [ + "C:\\Python37-x64\\Include", + "deps" + ], + "name": "gevent.__tracer", + "sources": [ + "src/gevent/_tracer.py" + ] + }, + "module_name": "gevent.__tracer" +} +END: Cython Metadata */ + +#define PY_SSIZE_T_CLEAN +#include "Python.h" +#ifndef Py_PYTHON_H + #error Python headers needed to compile C extensions, please install development version of Python. +#elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) + #error Cython requires Python 2.6+ or Python 3.3+. +#else +#define CYTHON_ABI "0_29_2" +#define CYTHON_HEX_VERSION 0x001D02F0 +#define CYTHON_FUTURE_DIVISION 1 +#include +#ifndef offsetof + #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) +#endif +#if !defined(WIN32) && !defined(MS_WINDOWS) + #ifndef __stdcall + #define __stdcall + #endif + #ifndef __cdecl + #define __cdecl + #endif + #ifndef __fastcall + #define __fastcall + #endif +#endif +#ifndef DL_IMPORT + #define DL_IMPORT(t) t +#endif +#ifndef DL_EXPORT + #define DL_EXPORT(t) t +#endif +#define __PYX_COMMA , +#ifndef HAVE_LONG_LONG + #if PY_VERSION_HEX >= 0x02070000 + #define HAVE_LONG_LONG + #endif +#endif +#ifndef PY_LONG_LONG + #define PY_LONG_LONG LONG_LONG +#endif +#ifndef Py_HUGE_VAL + #define Py_HUGE_VAL HUGE_VAL +#endif +#ifdef PYPY_VERSION + #define CYTHON_COMPILING_IN_PYPY 1 + #define CYTHON_COMPILING_IN_PYSTON 0 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #undef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 0 + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #if PY_VERSION_HEX < 0x03050000 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #elif !defined(CYTHON_USE_ASYNC_SLOTS) + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #undef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 0 + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #undef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 1 + #undef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 0 + #undef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 0 + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #undef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE 0 + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 +#elif defined(PYSTON_VERSION) + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_PYSTON 1 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #ifndef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 1 + #endif + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #ifndef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 1 + #endif + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #ifndef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 0 + #endif + #ifndef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 1 + #endif + #ifndef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 1 + #endif + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #undef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE 0 + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 +#else + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_PYSTON 0 + #define CYTHON_COMPILING_IN_CPYTHON 1 + #ifndef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 1 + #endif + #if PY_VERSION_HEX < 0x02070000 + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #elif !defined(CYTHON_USE_PYTYPE_LOOKUP) + #define CYTHON_USE_PYTYPE_LOOKUP 1 + #endif + #if PY_MAJOR_VERSION < 3 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #elif !defined(CYTHON_USE_ASYNC_SLOTS) + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #if PY_VERSION_HEX < 0x02070000 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #elif !defined(CYTHON_USE_PYLONG_INTERNALS) + #define CYTHON_USE_PYLONG_INTERNALS 1 + #endif + #ifndef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 1 + #endif + #ifndef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 1 + #endif + #if PY_VERSION_HEX < 0x030300F0 + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #elif !defined(CYTHON_USE_UNICODE_WRITER) + #define CYTHON_USE_UNICODE_WRITER 1 + #endif + #ifndef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 0 + #endif + #ifndef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 1 + #endif + #ifndef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 1 + #endif + #ifndef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 1 + #endif + #ifndef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 1 + #endif + #ifndef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000) + #endif + #ifndef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1) + #endif + #ifndef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1) + #endif + #ifndef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3) + #endif +#endif +#if !defined(CYTHON_FAST_PYCCALL) +#define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) +#endif +#if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #undef SHIFT + #undef BASE + #undef MASK + #ifdef SIZEOF_VOID_P + enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) }; + #endif +#endif +#ifndef __has_attribute + #define __has_attribute(x) 0 +#endif +#ifndef __has_cpp_attribute + #define __has_cpp_attribute(x) 0 +#endif +#ifndef CYTHON_RESTRICT + #if defined(__GNUC__) + #define CYTHON_RESTRICT __restrict__ + #elif defined(_MSC_VER) && _MSC_VER >= 1400 + #define CYTHON_RESTRICT __restrict + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_RESTRICT restrict + #else + #define CYTHON_RESTRICT + #endif +#endif +#ifndef CYTHON_UNUSED +# if defined(__GNUC__) +# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +#endif +#ifndef CYTHON_MAYBE_UNUSED_VAR +# if defined(__cplusplus) + template void CYTHON_MAYBE_UNUSED_VAR( const T& ) { } +# else +# define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x) +# endif +#endif +#ifndef CYTHON_NCP_UNUSED +# if CYTHON_COMPILING_IN_CPYTHON +# define CYTHON_NCP_UNUSED +# else +# define CYTHON_NCP_UNUSED CYTHON_UNUSED +# endif +#endif +#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) +#ifdef _MSC_VER + #ifndef _MSC_STDINT_H_ + #if _MSC_VER < 1300 + typedef unsigned char uint8_t; + typedef unsigned int uint32_t; + #else + typedef unsigned __int8 uint8_t; + typedef unsigned __int32 uint32_t; + #endif + #endif +#else + #include +#endif +#ifndef CYTHON_FALLTHROUGH + #if defined(__cplusplus) && __cplusplus >= 201103L + #if __has_cpp_attribute(fallthrough) + #define CYTHON_FALLTHROUGH [[fallthrough]] + #elif __has_cpp_attribute(clang::fallthrough) + #define CYTHON_FALLTHROUGH [[clang::fallthrough]] + #elif __has_cpp_attribute(gnu::fallthrough) + #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] + #endif + #endif + #ifndef CYTHON_FALLTHROUGH + #if __has_attribute(fallthrough) + #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) + #else + #define CYTHON_FALLTHROUGH + #endif + #endif + #if defined(__clang__ ) && defined(__apple_build_version__) + #if __apple_build_version__ < 7000000 + #undef CYTHON_FALLTHROUGH + #define CYTHON_FALLTHROUGH + #endif + #endif +#endif + +#ifndef CYTHON_INLINE + #if defined(__clang__) + #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) + #elif defined(__GNUC__) + #define CYTHON_INLINE __inline__ + #elif defined(_MSC_VER) + #define CYTHON_INLINE __inline + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_INLINE inline + #else + #define CYTHON_INLINE + #endif +#endif + +#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) + #define Py_OptimizeFlag 0 +#endif +#define __PYX_BUILD_PY_SSIZE_T "n" +#define CYTHON_FORMAT_SSIZE_T "z" +#if PY_MAJOR_VERSION < 3 + #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyClass_Type +#else + #define __Pyx_BUILTIN_MODULE_NAME "builtins" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyType_Type +#endif +#ifndef Py_TPFLAGS_CHECKTYPES + #define Py_TPFLAGS_CHECKTYPES 0 +#endif +#ifndef Py_TPFLAGS_HAVE_INDEX + #define Py_TPFLAGS_HAVE_INDEX 0 +#endif +#ifndef Py_TPFLAGS_HAVE_NEWBUFFER + #define Py_TPFLAGS_HAVE_NEWBUFFER 0 +#endif +#ifndef Py_TPFLAGS_HAVE_FINALIZE + #define Py_TPFLAGS_HAVE_FINALIZE 0 +#endif +#ifndef METH_STACKLESS + #define METH_STACKLESS 0 +#endif +#if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) + #ifndef METH_FASTCALL + #define METH_FASTCALL 0x80 + #endif + typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs); + typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args, + Py_ssize_t nargs, PyObject *kwnames); +#else + #define __Pyx_PyCFunctionFast _PyCFunctionFast + #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords +#endif +#if CYTHON_FAST_PYCCALL +#define __Pyx_PyFastCFunction_Check(func)\ + ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS))))) +#else +#define __Pyx_PyFastCFunction_Check(func) 0 +#endif +#if CYTHON_USE_DICT_VERSIONS +#define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) +#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ + (version_var) = __PYX_GET_DICT_VERSION(dict);\ + (cache_var) = (value); +#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ + static PY_UINT64_T __pyx_dict_version = 0;\ + static PyObject *__pyx_dict_cached_value = NULL;\ + if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ + (VAR) = __pyx_dict_cached_value;\ + } else {\ + (VAR) = __pyx_dict_cached_value = (LOOKUP);\ + __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ + }\ + } +#else +#define __PYX_GET_DICT_VERSION(dict) (0) +#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) +#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) + #define PyObject_Malloc(s) PyMem_Malloc(s) + #define PyObject_Free(p) PyMem_Free(p) + #define PyObject_Realloc(p) PyMem_Realloc(p) +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1 + #define PyMem_RawMalloc(n) PyMem_Malloc(n) + #define PyMem_RawRealloc(p, n) PyMem_Realloc(p, n) + #define PyMem_RawFree(p) PyMem_Free(p) +#endif +#if CYTHON_COMPILING_IN_PYSTON + #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co) + #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno) +#else + #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) + #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) +#endif +#if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000 + #define __Pyx_PyThreadState_Current PyThreadState_GET() +#elif PY_VERSION_HEX >= 0x03060000 + #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() +#elif PY_VERSION_HEX >= 0x03000000 + #define __Pyx_PyThreadState_Current PyThreadState_GET() +#else + #define __Pyx_PyThreadState_Current _PyThreadState_Current +#endif +#if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) +#include "pythread.h" +#define Py_tss_NEEDS_INIT 0 +typedef int Py_tss_t; +static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) { + *key = PyThread_create_key(); + return 0; // PyThread_create_key reports success always +} +static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) { + Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t)); + *key = Py_tss_NEEDS_INIT; + return key; +} +static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) { + PyObject_Free(key); +} +static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) { + return *key != Py_tss_NEEDS_INIT; +} +static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) { + PyThread_delete_key(*key); + *key = Py_tss_NEEDS_INIT; +} +static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) { + return PyThread_set_key_value(*key, value); +} +static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { + return PyThread_get_key_value(*key); +} +#endif // TSS (Thread Specific Storage) API +#if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized) +#define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) +#else +#define __Pyx_PyDict_NewPresized(n) PyDict_New() +#endif +#if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION + #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) +#else + #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS +#define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) +#else +#define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name) +#endif +#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) + #define CYTHON_PEP393_ENABLED 1 + #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ + 0 : _PyUnicode_Ready((PyObject *)(op))) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) + #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) + #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) + #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) + #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) + #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch) + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) +#else + #define CYTHON_PEP393_ENABLED 0 + #define PyUnicode_1BYTE_KIND 1 + #define PyUnicode_2BYTE_KIND 2 + #define PyUnicode_4BYTE_KIND 4 + #define __Pyx_PyUnicode_READY(op) (0) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) + #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111) + #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) + #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) + #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) + #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch) + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) +#endif +#if CYTHON_COMPILING_IN_PYPY + #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) +#else + #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ + PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains) + #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check) + #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format) + #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) +#endif +#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) +#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) +#else + #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) +#endif +#if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) + #define PyObject_ASCII(o) PyObject_Repr(o) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBaseString_Type PyUnicode_Type + #define PyStringObject PyUnicodeObject + #define PyString_Type PyUnicode_Type + #define PyString_Check PyUnicode_Check + #define PyString_CheckExact PyUnicode_CheckExact + #define PyObject_Unicode PyObject_Str +#endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) + #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) +#else + #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) + #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) +#endif +#ifndef PySet_CheckExact + #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) +#endif +#if CYTHON_ASSUME_SAFE_MACROS + #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) +#else + #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyIntObject PyLongObject + #define PyInt_Type PyLong_Type + #define PyInt_Check(op) PyLong_Check(op) + #define PyInt_CheckExact(op) PyLong_CheckExact(op) + #define PyInt_FromString PyLong_FromString + #define PyInt_FromUnicode PyLong_FromUnicode + #define PyInt_FromLong PyLong_FromLong + #define PyInt_FromSize_t PyLong_FromSize_t + #define PyInt_FromSsize_t PyLong_FromSsize_t + #define PyInt_AsLong PyLong_AsLong + #define PyInt_AS_LONG PyLong_AS_LONG + #define PyInt_AsSsize_t PyLong_AsSsize_t + #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask + #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask + #define PyNumber_Int PyNumber_Long +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBoolObject PyLongObject +#endif +#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY + #ifndef PyUnicode_InternFromString + #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) + #endif +#endif +#if PY_VERSION_HEX < 0x030200A4 + typedef long Py_hash_t; + #define __Pyx_PyInt_FromHash_t PyInt_FromLong + #define __Pyx_PyInt_AsHash_t PyInt_AsLong +#else + #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t + #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t +#endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : (Py_INCREF(func), func)) +#else + #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) +#endif +#if CYTHON_USE_ASYNC_SLOTS + #if PY_VERSION_HEX >= 0x030500B1 + #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods + #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) + #else + #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) + #endif +#else + #define __Pyx_PyType_AsAsync(obj) NULL +#endif +#ifndef __Pyx_PyAsyncMethodsStruct + typedef struct { + unaryfunc am_await; + unaryfunc am_aiter; + unaryfunc am_anext; + } __Pyx_PyAsyncMethodsStruct; +#endif + +#if defined(WIN32) || defined(MS_WINDOWS) + #define _USE_MATH_DEFINES +#endif +#include +#ifdef NAN +#define __PYX_NAN() ((float) NAN) +#else +static CYTHON_INLINE float __PYX_NAN() { + float value; + memset(&value, 0xFF, sizeof(value)); + return value; +} +#endif +#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) +#define __Pyx_truncl trunc +#else +#define __Pyx_truncl truncl +#endif + + +#define __PYX_ERR(f_index, lineno, Ln_error) \ +{ \ + __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \ +} + +#ifndef __PYX_EXTERN_C + #ifdef __cplusplus + #define __PYX_EXTERN_C extern "C" + #else + #define __PYX_EXTERN_C extern + #endif +#endif + +#define __PYX_HAVE__gevent____tracer +#define __PYX_HAVE_API__gevent____tracer +/* Early includes */ +#ifdef _OPENMP +#include +#endif /* _OPENMP */ + +#if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) +#define CYTHON_WITHOUT_ASSERTIONS +#endif + +typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; + const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; + +#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 +#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0 +#define __PYX_DEFAULT_STRING_ENCODING "" +#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString +#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#define __Pyx_uchar_cast(c) ((unsigned char)c) +#define __Pyx_long_cast(x) ((long)x) +#define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ + (sizeof(type) < sizeof(Py_ssize_t)) ||\ + (sizeof(type) > sizeof(Py_ssize_t) &&\ + likely(v < (type)PY_SSIZE_T_MAX ||\ + v == (type)PY_SSIZE_T_MAX) &&\ + (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ + v == (type)PY_SSIZE_T_MIN))) ||\ + (sizeof(type) == sizeof(Py_ssize_t) &&\ + (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ + v == (type)PY_SSIZE_T_MAX))) ) +static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) { + return (size_t) i < (size_t) limit; +} +#if defined (__cplusplus) && __cplusplus >= 201103L + #include + #define __Pyx_sst_abs(value) std::abs(value) +#elif SIZEOF_INT >= SIZEOF_SIZE_T + #define __Pyx_sst_abs(value) abs(value) +#elif SIZEOF_LONG >= SIZEOF_SIZE_T + #define __Pyx_sst_abs(value) labs(value) +#elif defined (_MSC_VER) + #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) +#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define __Pyx_sst_abs(value) llabs(value) +#elif defined (__GNUC__) + #define __Pyx_sst_abs(value) __builtin_llabs(value) +#else + #define __Pyx_sst_abs(value) ((value<0) ? -value : value) +#endif +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*); +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); +#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) +#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) +#define __Pyx_PyBytes_FromString PyBytes_FromString +#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); +#if PY_MAJOR_VERSION < 3 + #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#else + #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize +#endif +#define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) +#define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) +#define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) +#define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) +#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) +static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) { + const Py_UNICODE *u_end = u; + while (*u_end++) ; + return (size_t)(u_end - u - 1); +} +#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) +#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode +#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode +#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) +#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) +static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); +static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*); +static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); +#define __Pyx_PySequence_Tuple(obj)\ + (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); +#if CYTHON_ASSUME_SAFE_MACROS +#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) +#else +#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) +#endif +#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) +#if PY_MAJOR_VERSION >= 3 +#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) +#else +#define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) +#endif +#define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x)) +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII +static int __Pyx_sys_getdefaultencoding_not_ascii; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + PyObject* ascii_chars_u = NULL; + PyObject* ascii_chars_b = NULL; + const char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + if (strcmp(default_encoding_c, "ascii") == 0) { + __Pyx_sys_getdefaultencoding_not_ascii = 0; + } else { + char ascii_chars[128]; + int c; + for (c = 0; c < 128; c++) { + ascii_chars[c] = c; + } + __Pyx_sys_getdefaultencoding_not_ascii = 1; + ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); + if (!ascii_chars_u) goto bad; + ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); + if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { + PyErr_Format( + PyExc_ValueError, + "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", + default_encoding_c); + goto bad; + } + Py_DECREF(ascii_chars_u); + Py_DECREF(ascii_chars_b); + } + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + Py_XDECREF(ascii_chars_u); + Py_XDECREF(ascii_chars_b); + return -1; +} +#endif +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) +#else +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +static char* __PYX_DEFAULT_STRING_ENCODING; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1); + if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; + strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + return -1; +} +#endif +#endif + + +/* Test for GCC > 2.95 */ +#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) + #define likely(x) __builtin_expect(!!(x), 1) + #define unlikely(x) __builtin_expect(!!(x), 0) +#else /* !__GNUC__ or GCC < 2.95 */ + #define likely(x) (x) + #define unlikely(x) (x) +#endif /* __GNUC__ */ +static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } + +static PyObject *__pyx_m = NULL; +static PyObject *__pyx_d; +static PyObject *__pyx_b; +static PyObject *__pyx_cython_runtime = NULL; +static PyObject *__pyx_empty_tuple; +static PyObject *__pyx_empty_bytes; +static PyObject *__pyx_empty_unicode; +static int __pyx_lineno; +static int __pyx_clineno = 0; +static const char * __pyx_cfilenm= __FILE__; +static const char *__pyx_filename; + + +static const char *__pyx_f[] = { + "src\\gevent\\_tracer.py", + "src\\gevent\\__tracer.pxd", +}; + +/*--- Type declarations ---*/ +struct __pyx_obj_6gevent_8__tracer_GreenletTracer; +struct __pyx_obj_6gevent_8__tracer__HubTracer; +struct __pyx_obj_6gevent_8__tracer_HubSwitchTracer; +struct __pyx_obj_6gevent_8__tracer_MaxSwitchTracer; + +/* "gevent/__tracer.pxd":15 + * + * + * cdef class GreenletTracer: # <<<<<<<<<<<<<< + * cpdef readonly object active_greenlet + * cpdef readonly object previous_trace_function + */ +struct __pyx_obj_6gevent_8__tracer_GreenletTracer { + PyObject_HEAD + struct __pyx_vtabstruct_6gevent_8__tracer_GreenletTracer *__pyx_vtab; + PyObject *active_greenlet; + PyObject *previous_trace_function; + Py_ssize_t greenlet_switch_counter; + int _killed; +}; + + +/* "gevent/__tracer.pxd":30 + * + * @cython.internal + * cdef class _HubTracer(GreenletTracer): # <<<<<<<<<<<<<< + * cpdef readonly object hub + * cpdef readonly double max_blocking_time + */ +struct __pyx_obj_6gevent_8__tracer__HubTracer { + struct __pyx_obj_6gevent_8__tracer_GreenletTracer __pyx_base; + PyObject *hub; + double max_blocking_time; +}; + + +/* "gevent/__tracer.pxd":35 + * + * + * cdef class HubSwitchTracer(_HubTracer): # <<<<<<<<<<<<<< + * cpdef readonly double last_entered_hub + * + */ +struct __pyx_obj_6gevent_8__tracer_HubSwitchTracer { + struct __pyx_obj_6gevent_8__tracer__HubTracer __pyx_base; + double last_entered_hub; +}; + + +/* "gevent/__tracer.pxd":38 + * cpdef readonly double last_entered_hub + * + * cdef class MaxSwitchTracer(_HubTracer): # <<<<<<<<<<<<<< + * cpdef readonly double max_blocking + * cpdef readonly double last_switch + */ +struct __pyx_obj_6gevent_8__tracer_MaxSwitchTracer { + struct __pyx_obj_6gevent_8__tracer__HubTracer __pyx_base; + double max_blocking; + double last_switch; +}; + + + +/* "src/gevent/_tracer.py":27 + * + * + * class GreenletTracer(object): # <<<<<<<<<<<<<< + * def __init__(self): + * # A counter, incremented by the greenlet trace function + */ + +struct __pyx_vtabstruct_6gevent_8__tracer_GreenletTracer { + PyObject *(*_trace)(struct __pyx_obj_6gevent_8__tracer_GreenletTracer *, PyObject *, PyObject *, int __pyx_skip_dispatch); + PyObject *(*did_block_hub)(struct __pyx_obj_6gevent_8__tracer_GreenletTracer *, PyObject *, int __pyx_skip_dispatch); + PyObject *(*kill)(struct __pyx_obj_6gevent_8__tracer_GreenletTracer *, int __pyx_skip_dispatch); +}; +static struct __pyx_vtabstruct_6gevent_8__tracer_GreenletTracer *__pyx_vtabptr_6gevent_8__tracer_GreenletTracer; + + +/* "src/gevent/_tracer.py":122 + * + * + * class _HubTracer(GreenletTracer): # <<<<<<<<<<<<<< + * def __init__(self, hub, max_blocking_time): + * GreenletTracer.__init__(self) + */ + +struct __pyx_vtabstruct_6gevent_8__tracer__HubTracer { + struct __pyx_vtabstruct_6gevent_8__tracer_GreenletTracer __pyx_base; +}; +static struct __pyx_vtabstruct_6gevent_8__tracer__HubTracer *__pyx_vtabptr_6gevent_8__tracer__HubTracer; + + +/* "src/gevent/_tracer.py":133 + * + * + * class HubSwitchTracer(_HubTracer): # <<<<<<<<<<<<<< + * # A greenlet tracer that records the last time we switched *into* the hub. + * + */ + +struct __pyx_vtabstruct_6gevent_8__tracer_HubSwitchTracer { + struct __pyx_vtabstruct_6gevent_8__tracer__HubTracer __pyx_base; +}; +static struct __pyx_vtabstruct_6gevent_8__tracer_HubSwitchTracer *__pyx_vtabptr_6gevent_8__tracer_HubSwitchTracer; + + +/* "src/gevent/_tracer.py":150 + * + * + * class MaxSwitchTracer(_HubTracer): # <<<<<<<<<<<<<< + * # A greenlet tracer that records the maximum time between switches, + * # not including time spent in the hub. + */ + +struct __pyx_vtabstruct_6gevent_8__tracer_MaxSwitchTracer { + struct __pyx_vtabstruct_6gevent_8__tracer__HubTracer __pyx_base; +}; +static struct __pyx_vtabstruct_6gevent_8__tracer_MaxSwitchTracer *__pyx_vtabptr_6gevent_8__tracer_MaxSwitchTracer; + +/* --- Runtime support code (head) --- */ +/* Refnanny.proto */ +#ifndef CYTHON_REFNANNY + #define CYTHON_REFNANNY 0 +#endif +#if CYTHON_REFNANNY + typedef struct { + void (*INCREF)(void*, PyObject*, int); + void (*DECREF)(void*, PyObject*, int); + void (*GOTREF)(void*, PyObject*, int); + void (*GIVEREF)(void*, PyObject*, int); + void* (*SetupContext)(const char*, int, const char*); + void (*FinishContext)(void**); + } __Pyx_RefNannyAPIStruct; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); + #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; +#ifdef WITH_THREAD + #define __Pyx_RefNannySetupContext(name, acquire_gil)\ + if (acquire_gil) {\ + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ + PyGILState_Release(__pyx_gilstate_save);\ + } else {\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ + } +#else + #define __Pyx_RefNannySetupContext(name, acquire_gil)\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) +#endif + #define __Pyx_RefNannyFinishContext()\ + __Pyx_RefNanny->FinishContext(&__pyx_refnanny) + #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0) + #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) + #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) + #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) +#else + #define __Pyx_RefNannyDeclarations + #define __Pyx_RefNannySetupContext(name, acquire_gil) + #define __Pyx_RefNannyFinishContext() + #define __Pyx_INCREF(r) Py_INCREF(r) + #define __Pyx_DECREF(r) Py_DECREF(r) + #define __Pyx_GOTREF(r) + #define __Pyx_GIVEREF(r) + #define __Pyx_XINCREF(r) Py_XINCREF(r) + #define __Pyx_XDECREF(r) Py_XDECREF(r) + #define __Pyx_XGOTREF(r) + #define __Pyx_XGIVEREF(r) +#endif +#define __Pyx_XDECREF_SET(r, v) do {\ + PyObject *tmp = (PyObject *) r;\ + r = v; __Pyx_XDECREF(tmp);\ + } while (0) +#define __Pyx_DECREF_SET(r, v) do {\ + PyObject *tmp = (PyObject *) r;\ + r = v; __Pyx_DECREF(tmp);\ + } while (0) +#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) +#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) + +/* PyObjectGetAttrStr.proto */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); +#else +#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) +#endif + +/* GetBuiltinName.proto */ +static PyObject *__Pyx_GetBuiltinName(PyObject *name); + +/* RaiseArgTupleInvalid.proto */ +static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, + Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); + +/* KeywordStringCheck.proto */ +static int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* function_name, int kw_allowed); + +/* PyCFunctionFastCall.proto */ +#if CYTHON_FAST_PYCCALL +static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs); +#else +#define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL) +#endif + +/* PyFunctionFastCall.proto */ +#if CYTHON_FAST_PYCALL +#define __Pyx_PyFunction_FastCall(func, args, nargs)\ + __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) +#if 1 || PY_VERSION_HEX < 0x030600B1 +static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs); +#else +#define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs) +#endif +#define __Pyx_BUILD_ASSERT_EXPR(cond)\ + (sizeof(char [1 - 2*!(cond)]) - 1) +#ifndef Py_MEMBER_SIZE +#define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member) +#endif + static size_t __pyx_pyframe_localsplus_offset = 0; + #include "frameobject.h" + #define __Pxy_PyFrame_Initialize_Offsets()\ + ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\ + (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus))) + #define __Pyx_PyFrame_GetLocalsplus(frame)\ + (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset)) +#endif + +/* PyObjectCall.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); +#else +#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) +#endif + +/* PyObjectCall2Args.proto */ +static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2); + +/* PyObjectCallMethO.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); +#endif + +/* PyObjectCallOneArg.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); + +/* PyObjectCallNoArg.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); +#else +#define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL) +#endif + +/* IncludeStringH.proto */ +#include + +/* BytesEquals.proto */ +static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); + +/* UnicodeEquals.proto */ +static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); + +/* StrEquals.proto */ +#if PY_MAJOR_VERSION >= 3 +#define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals +#else +#define __Pyx_PyString_Equals __Pyx_PyBytes_Equals +#endif + +/* GetItemInt.proto */ +#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ + __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\ + (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\ + __Pyx_GetItemInt_Generic(o, to_py_func(i)))) +#define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ + __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ + (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL)) +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, + int wraparound, int boundscheck); +#define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ + __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ + (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL)) +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, + int wraparound, int boundscheck); +static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j); +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, + int is_list, int wraparound, int boundscheck); + +/* RaiseDoubleKeywords.proto */ +static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); + +/* ParseKeywords.proto */ +static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\ + PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\ + const char* function_name); + +/* ArgTypeTest.proto */ +#define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\ + ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\ + __Pyx__ArgTypeTest(obj, type, name, exact)) +static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact); + +/* ListAppend.proto */ +#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS +static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) { + PyListObject* L = (PyListObject*) list; + Py_ssize_t len = Py_SIZE(list); + if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) { + Py_INCREF(x); + PyList_SET_ITEM(list, len, x); + Py_SIZE(list) = len+1; + return 0; + } + return PyList_Append(list, x); +} +#else +#define __Pyx_PyList_Append(L,x) PyList_Append(L,x) +#endif + +/* ObjectGetItem.proto */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key); +#else +#define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key) +#endif + +/* GetTopmostException.proto */ +#if CYTHON_USE_EXC_INFO_STACK +static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate); +#endif + +/* PyThreadStateGet.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; +#define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; +#define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type +#else +#define __Pyx_PyThreadState_declare +#define __Pyx_PyThreadState_assign +#define __Pyx_PyErr_Occurred() PyErr_Occurred() +#endif + +/* SaveResetException.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); +#else +#define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb) +#define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb) +#endif + +/* PyErrExceptionMatches.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) +static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); +#else +#define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) +#endif + +/* GetException.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb) +static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#else +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); +#endif + +/* StringJoin.proto */ +#if PY_MAJOR_VERSION < 3 +#define __Pyx_PyString_Join __Pyx_PyBytes_Join +#define __Pyx_PyBaseString_Join(s, v) (PyUnicode_CheckExact(s) ? PyUnicode_Join(s, v) : __Pyx_PyBytes_Join(s, v)) +#else +#define __Pyx_PyString_Join PyUnicode_Join +#define __Pyx_PyBaseString_Join PyUnicode_Join +#endif +#if CYTHON_COMPILING_IN_CPYTHON + #if PY_MAJOR_VERSION < 3 + #define __Pyx_PyBytes_Join _PyString_Join + #else + #define __Pyx_PyBytes_Join _PyBytes_Join + #endif +#else +static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values); +#endif + +/* ListExtend.proto */ +static CYTHON_INLINE int __Pyx_PyList_Extend(PyObject* L, PyObject* v) { +#if CYTHON_COMPILING_IN_CPYTHON + PyObject* none = _PyList_Extend((PyListObject*)L, v); + if (unlikely(!none)) + return -1; + Py_DECREF(none); + return 0; +#else + return PyList_SetSlice(L, PY_SSIZE_T_MAX, PY_SSIZE_T_MAX, v); +#endif +} + +/* PyObject_GenericGetAttrNoDict.proto */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name); +#else +#define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr +#endif + +/* PyObject_GenericGetAttr.proto */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name); +#else +#define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr +#endif + +/* SetVTable.proto */ +static int __Pyx_SetVtable(PyObject *dict, void *vtable); + +/* Import.proto */ +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); + +/* ImportFrom.proto */ +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); + +/* FetchCommonType.proto */ +static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); + +/* CythonFunction.proto */ +#define __Pyx_CyFunction_USED 1 +#define __Pyx_CYFUNCTION_STATICMETHOD 0x01 +#define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 +#define __Pyx_CYFUNCTION_CCLASS 0x04 +#define __Pyx_CyFunction_GetClosure(f)\ + (((__pyx_CyFunctionObject *) (f))->func_closure) +#define __Pyx_CyFunction_GetClassObj(f)\ + (((__pyx_CyFunctionObject *) (f))->func_classobj) +#define __Pyx_CyFunction_Defaults(type, f)\ + ((type *)(((__pyx_CyFunctionObject *) (f))->defaults)) +#define __Pyx_CyFunction_SetDefaultsGetter(f, g)\ + ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g) +typedef struct { + PyCFunctionObject func; +#if PY_VERSION_HEX < 0x030500A0 + PyObject *func_weakreflist; +#endif + PyObject *func_dict; + PyObject *func_name; + PyObject *func_qualname; + PyObject *func_doc; + PyObject *func_globals; + PyObject *func_code; + PyObject *func_closure; + PyObject *func_classobj; + void *defaults; + int defaults_pyobjects; + int flags; + PyObject *defaults_tuple; + PyObject *defaults_kwdict; + PyObject *(*defaults_getter)(PyObject *); + PyObject *func_annotations; +} __pyx_CyFunctionObject; +static PyTypeObject *__pyx_CyFunctionType = 0; +#define __Pyx_CyFunction_Check(obj) (__Pyx_TypeCheck(obj, __pyx_CyFunctionType)) +#define __Pyx_CyFunction_NewEx(ml, flags, qualname, self, module, globals, code)\ + __Pyx_CyFunction_New(__pyx_CyFunctionType, ml, flags, qualname, self, module, globals, code) +static PyObject *__Pyx_CyFunction_New(PyTypeObject *, PyMethodDef *ml, + int flags, PyObject* qualname, + PyObject *self, + PyObject *module, PyObject *globals, + PyObject* code); +static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, + size_t size, + int pyobjects); +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, + PyObject *tuple); +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, + PyObject *dict); +static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m, + PyObject *dict); +static int __pyx_CyFunction_init(void); + +/* GetModuleGlobalName.proto */ +#if CYTHON_USE_DICT_VERSIONS +#define __Pyx_GetModuleGlobalName(var, name) {\ + static PY_UINT64_T __pyx_dict_version = 0;\ + static PyObject *__pyx_dict_cached_value = NULL;\ + (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\ + (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\ + __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ +} +#define __Pyx_GetModuleGlobalNameUncached(var, name) {\ + PY_UINT64_T __pyx_dict_version;\ + PyObject *__pyx_dict_cached_value;\ + (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ +} +static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value); +#else +#define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name) +#define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name) +static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name); +#endif + +/* GetAttr.proto */ +static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *); + +/* Globals.proto */ +static PyObject* __Pyx_Globals(void); + +/* PyErrFetchRestore.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) +#define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) +#define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) +#define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) +#define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); +static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) +#else +#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) +#endif +#else +#define __Pyx_PyErr_Clear() PyErr_Clear() +#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) +#define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) +#define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb) +#define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) +#endif + +/* CLineInTraceback.proto */ +#ifdef CYTHON_CLINE_IN_TRACEBACK +#define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) +#else +static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line); +#endif + +/* CodeObjectCache.proto */ +typedef struct { + PyCodeObject* code_object; + int code_line; +} __Pyx_CodeObjectCacheEntry; +struct __Pyx_CodeObjectCache { + int count; + int max_count; + __Pyx_CodeObjectCacheEntry* entries; +}; +static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); +static PyCodeObject *__pyx_find_code_object(int code_line); +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); + +/* AddTraceback.proto */ +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename); + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); + +/* CIntFromPy.proto */ +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); + +/* CIntFromPy.proto */ +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); + +/* FastTypeChecks.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) +static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b); +static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type); +static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2); +#else +#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) +#define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) +#define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) +#endif +#define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) + +/* CheckBinaryVersion.proto */ +static int __Pyx_check_binary_version(void); + +/* PyObjectSetAttrStr.proto */ +#if CYTHON_USE_TYPE_SLOTS +#define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o, n, NULL) +static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value); +#else +#define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n) +#define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v) +#endif + +/* VoidPtrExport.proto */ +static int __Pyx_ExportVoidPtr(PyObject *name, void *p, const char *sig); + +/* InitStrings.proto */ +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); + +static PyObject *__pyx_f_6gevent_8__tracer_14GreenletTracer_kill(struct __pyx_obj_6gevent_8__tracer_GreenletTracer *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/ +static PyObject *__pyx_f_6gevent_8__tracer_14GreenletTracer__trace(struct __pyx_obj_6gevent_8__tracer_GreenletTracer *__pyx_v_self, PyObject *__pyx_v_event, PyObject *__pyx_v_args, int __pyx_skip_dispatch); /* proto*/ +static PyObject *__pyx_f_6gevent_8__tracer_14GreenletTracer_did_block_hub(struct __pyx_obj_6gevent_8__tracer_GreenletTracer *__pyx_v_self, PyObject *__pyx_v_hub, int __pyx_skip_dispatch); /* proto*/ +static PyObject *__pyx_f_6gevent_8__tracer_10_HubTracer_kill(struct __pyx_obj_6gevent_8__tracer__HubTracer *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/ +static PyObject *__pyx_f_6gevent_8__tracer_15HubSwitchTracer__trace(struct __pyx_obj_6gevent_8__tracer_HubSwitchTracer *__pyx_v_self, PyObject *__pyx_v_event, PyObject *__pyx_v_args, int __pyx_skip_dispatch); /* proto*/ +static PyObject *__pyx_f_6gevent_8__tracer_15HubSwitchTracer_did_block_hub(struct __pyx_obj_6gevent_8__tracer_HubSwitchTracer *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_hub, int __pyx_skip_dispatch); /* proto*/ +static PyObject *__pyx_f_6gevent_8__tracer_15MaxSwitchTracer__trace(struct __pyx_obj_6gevent_8__tracer_MaxSwitchTracer *__pyx_v_self, PyObject *__pyx_v_event, PyObject *__pyx_v_args, int __pyx_skip_dispatch); /* proto*/ +static PyObject *__pyx_f_6gevent_8__tracer_15MaxSwitchTracer_did_block_hub(struct __pyx_obj_6gevent_8__tracer_MaxSwitchTracer *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_hub, int __pyx_skip_dispatch); /* proto*/ + +/* Module declarations from 'cython' */ + +/* Module declarations from 'gevent.__tracer' */ +static PyTypeObject *__pyx_ptype_6gevent_8__tracer_GreenletTracer = 0; +static PyTypeObject *__pyx_ptype_6gevent_8__tracer__HubTracer = 0; +static PyTypeObject *__pyx_ptype_6gevent_8__tracer_HubSwitchTracer = 0; +static PyTypeObject *__pyx_ptype_6gevent_8__tracer_MaxSwitchTracer = 0; +static PyObject *__pyx_v_6gevent_8__tracer_sys = 0; +static PyObject *__pyx_v_6gevent_8__tracer_traceback = 0; +static PyObject *__pyx_v_6gevent_8__tracer_settrace = 0; +static PyObject *__pyx_v_6gevent_8__tracer_getcurrent = 0; +static PyObject *__pyx_v_6gevent_8__tracer_format_run_info = 0; +static PyObject *__pyx_v_6gevent_8__tracer_perf_counter = 0; +static PyObject *__pyx_v_6gevent_8__tracer_gmctime = 0; +#define __Pyx_MODULE_NAME "gevent.__tracer" +extern int __pyx_module_is_main_gevent____tracer; +int __pyx_module_is_main_gevent____tracer = 0; + +/* Implementation of 'gevent.__tracer' */ +static PyObject *__pyx_builtin_KeyError; +static PyObject *__pyx_builtin_hex; +#if PY_MAJOR_VERSION >= 3 +static const char __pyx_k_[] = "================================================================================"; +#endif +#if PY_MAJOR_VERSION < 3 +static const char __pyx_k_b[] = "b'================================================================================'"; +#endif +static const char __pyx_k__2[] = ""; +static const char __pyx_k_all[] = "__all__"; +static const char __pyx_k_hex[] = "hex"; +static const char __pyx_k_hub[] = "hub"; +static const char __pyx_k_sys[] = "sys"; +static const char __pyx_k_Info[] = "Info:"; +static const char __pyx_k_args[] = "args"; +static const char __pyx_k_init[] = "__init__"; +static const char __pyx_k_join[] = "join"; +static const char __pyx_k_kill[] = "kill"; +static const char __pyx_k_main[] = "__main__"; +static const char __pyx_k_name[] = "__name__"; +static const char __pyx_k_self[] = "self"; +static const char __pyx_k_test[] = "__test__"; +static const char __pyx_k_event[] = "event"; +static const char __pyx_k_frame[] = "frame"; +static const char __pyx_k_stack[] = "stack"; +static const char __pyx_k_throw[] = "throw"; +static const char __pyx_k_trace[] = "_trace"; +static const char __pyx_k_import[] = "__import__"; +static const char __pyx_k_report[] = "report"; +static const char __pyx_k_switch[] = "switch"; +static const char __pyx_k_gmctime[] = "gmctime"; +static const char __pyx_k_KeyError[] = "KeyError"; +static const char __pyx_k_greenlet[] = "greenlet"; +static const char __pyx_k_pyx_capi[] = "__pyx_capi__"; +static const char __pyx_k_settrace[] = "settrace"; +static const char __pyx_k_HubTracer[] = "_HubTracer"; +static const char __pyx_k_traceback[] = "traceback"; +static const char __pyx_k_getcurrent[] = "getcurrent"; +static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__"; +static const char __pyx_k_gevent_util[] = "gevent.util"; +static const char __pyx_k_format_stack[] = "format_stack"; +static const char __pyx_k_gevent__util[] = "gevent._util"; +static const char __pyx_k_perf_counter[] = "perf_counter"; +static const char __pyx_k_thread_ident[] = "thread_ident"; +static const char __pyx_k_Reported_by_s[] = " Reported by %s"; +static const char __pyx_k_did_block_hub[] = "did_block_hub"; +static const char __pyx_k_format_kwargs[] = "format_kwargs"; +static const char __pyx_k_GreenletTracer[] = "GreenletTracer"; +static const char __pyx_k_HubTracer_kill[] = "_HubTracer.kill"; +static const char __pyx_k_current_frames[] = "_current_frames"; +static const char __pyx_k_gevent__compat[] = "gevent._compat"; +static const char __pyx_k_import_c_accel[] = "import_c_accel"; +static const char __pyx_k_HubSwitchTracer[] = "HubSwitchTracer"; +static const char __pyx_k_MaxSwitchTracer[] = "MaxSwitchTracer"; +static const char __pyx_k_active_greenlet[] = "active_greenlet"; +static const char __pyx_k_format_run_info[] = "format_run_info"; +static const char __pyx_k_gevent___tracer[] = "gevent.__tracer"; +static const char __pyx_k_max_blocking_time[] = "max_blocking_time"; +static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; +static const char __pyx_k_GreenletTracer_kill[] = "GreenletTracer.kill"; +static const char __pyx_k_did_block_hub_report[] = "did_block_hub_report"; +static const char __pyx_k_GreenletTracer__trace[] = "GreenletTracer._trace"; +static const char __pyx_k_src_gevent__tracer_py[] = "src\\gevent\\_tracer.py"; +static const char __pyx_k_HubSwitchTracer__trace[] = "HubSwitchTracer._trace"; +static const char __pyx_k_MaxSwitchTracer__trace[] = "MaxSwitchTracer._trace"; +static const char __pyx_k_GreenletTracer_did_block_hub[] = "GreenletTracer.did_block_hub"; +static const char __pyx_k_Blocked_Stack_for_thread_id_s[] = "Blocked Stack (for thread id %s):"; +static const char __pyx_k_HubSwitchTracer_did_block_hub[] = "HubSwitchTracer.did_block_hub"; +static const char __pyx_k_MaxSwitchTracer_did_block_hub[] = "MaxSwitchTracer.did_block_hub"; +static const char __pyx_k_Unknown_No_thread_found_for_hub[] = "Unknown: No thread found for hub %r\n"; +static const char __pyx_k_s_Greenlet_s_appears_to_be_bloc[] = "\n%s : Greenlet %s appears to be blocked"; +static const char __pyx_k_GreenletTracer_did_block_hub_rep[] = "GreenletTracer.did_block_hub_report"; +static const char __pyx_k_GreenletTracer_ignore_current_gr[] = "GreenletTracer.ignore_current_greenlet_blocking"; +static const char __pyx_k_GreenletTracer_monitor_current_g[] = "GreenletTracer.monitor_current_greenlet_blocking"; +static const char __pyx_k_ignore_current_greenlet_blocking[] = "ignore_current_greenlet_blocking"; +static const char __pyx_k_monitor_current_greenlet_blockin[] = "monitor_current_greenlet_blocking"; +static PyObject *__pyx_kp_s_Blocked_Stack_for_thread_id_s; +static PyObject *__pyx_n_s_GreenletTracer; +static PyObject *__pyx_n_s_GreenletTracer__trace; +static PyObject *__pyx_n_s_GreenletTracer_did_block_hub; +static PyObject *__pyx_n_s_GreenletTracer_did_block_hub_rep; +static PyObject *__pyx_n_s_GreenletTracer_ignore_current_gr; +static PyObject *__pyx_n_s_GreenletTracer_kill; +static PyObject *__pyx_n_s_GreenletTracer_monitor_current_g; +static PyObject *__pyx_n_s_HubSwitchTracer; +static PyObject *__pyx_n_s_HubSwitchTracer__trace; +static PyObject *__pyx_n_s_HubSwitchTracer_did_block_hub; +static PyObject *__pyx_n_s_HubTracer; +static PyObject *__pyx_n_s_HubTracer_kill; +static PyObject *__pyx_kp_s_Info; +static PyObject *__pyx_n_s_KeyError; +static PyObject *__pyx_n_s_MaxSwitchTracer; +static PyObject *__pyx_n_s_MaxSwitchTracer__trace; +static PyObject *__pyx_n_s_MaxSwitchTracer_did_block_hub; +static PyObject *__pyx_kp_s_Reported_by_s; +static PyObject *__pyx_kp_s_Unknown_No_thread_found_for_hub; +static PyObject *__pyx_kp_s__2; +static PyObject *__pyx_n_s_active_greenlet; +static PyObject *__pyx_n_s_all; +static PyObject *__pyx_n_s_args; +static PyObject *__pyx_kp_s_b; +static PyObject *__pyx_n_s_cline_in_traceback; +static PyObject *__pyx_n_s_current_frames; +static PyObject *__pyx_n_s_did_block_hub; +static PyObject *__pyx_n_s_did_block_hub_report; +static PyObject *__pyx_n_s_event; +static PyObject *__pyx_n_s_format_kwargs; +static PyObject *__pyx_n_s_format_run_info; +static PyObject *__pyx_n_s_format_stack; +static PyObject *__pyx_n_s_frame; +static PyObject *__pyx_n_s_getcurrent; +static PyObject *__pyx_n_s_gevent___tracer; +static PyObject *__pyx_n_s_gevent__compat; +static PyObject *__pyx_n_s_gevent__util; +static PyObject *__pyx_n_s_gevent_util; +static PyObject *__pyx_n_s_gmctime; +static PyObject *__pyx_n_s_greenlet; +static PyObject *__pyx_n_s_hex; +static PyObject *__pyx_n_s_hub; +static PyObject *__pyx_n_s_ignore_current_greenlet_blocking; +static PyObject *__pyx_n_s_import; +static PyObject *__pyx_n_s_import_c_accel; +static PyObject *__pyx_n_s_init; +static PyObject *__pyx_n_s_join; +static PyObject *__pyx_n_s_kill; +static PyObject *__pyx_n_s_main; +static PyObject *__pyx_n_s_max_blocking_time; +static PyObject *__pyx_n_s_monitor_current_greenlet_blockin; +static PyObject *__pyx_n_s_name; +static PyObject *__pyx_n_s_perf_counter; +static PyObject *__pyx_n_s_pyx_capi; +static PyObject *__pyx_n_s_pyx_vtable; +static PyObject *__pyx_n_s_report; +static PyObject *__pyx_kp_s_s_Greenlet_s_appears_to_be_bloc; +static PyObject *__pyx_n_s_self; +static PyObject *__pyx_n_s_settrace; +static PyObject *__pyx_kp_s_src_gevent__tracer_py; +static PyObject *__pyx_n_s_stack; +static PyObject *__pyx_n_s_switch; +static PyObject *__pyx_n_s_sys; +static PyObject *__pyx_n_s_test; +static PyObject *__pyx_n_s_thread_ident; +static PyObject *__pyx_n_s_throw; +static PyObject *__pyx_n_s_trace; +static PyObject *__pyx_n_s_traceback; +static int __pyx_pf_6gevent_8__tracer_14GreenletTracer___init__(struct __pyx_obj_6gevent_8__tracer_GreenletTracer *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_8__tracer_14GreenletTracer_2kill(struct __pyx_obj_6gevent_8__tracer_GreenletTracer *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_8__tracer_14GreenletTracer_4_trace(struct __pyx_obj_6gevent_8__tracer_GreenletTracer *__pyx_v_self, PyObject *__pyx_v_event, PyObject *__pyx_v_args); /* proto */ +static PyObject *__pyx_pf_6gevent_8__tracer_14GreenletTracer_6__call__(struct __pyx_obj_6gevent_8__tracer_GreenletTracer *__pyx_v_self, PyObject *__pyx_v_event, PyObject *__pyx_v_args); /* proto */ +static PyObject *__pyx_pf_6gevent_8__tracer_14GreenletTracer_8did_block_hub(struct __pyx_obj_6gevent_8__tracer_GreenletTracer *__pyx_v_self, PyObject *__pyx_v_hub); /* proto */ +static PyObject *__pyx_pf_6gevent_8__tracer_14GreenletTracer_10ignore_current_greenlet_blocking(struct __pyx_obj_6gevent_8__tracer_GreenletTracer *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_8__tracer_14GreenletTracer_12monitor_current_greenlet_blocking(struct __pyx_obj_6gevent_8__tracer_GreenletTracer *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_8__tracer_14GreenletTracer_14did_block_hub_report(struct __pyx_obj_6gevent_8__tracer_GreenletTracer *__pyx_v_self, PyObject *__pyx_v_hub, PyObject *__pyx_v_active_greenlet, PyObject *__pyx_v_format_kwargs); /* proto */ +static PyObject *__pyx_pf_6gevent_8__tracer_14GreenletTracer_15active_greenlet___get__(struct __pyx_obj_6gevent_8__tracer_GreenletTracer *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_8__tracer_14GreenletTracer_23previous_trace_function___get__(struct __pyx_obj_6gevent_8__tracer_GreenletTracer *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_8__tracer_14GreenletTracer_23greenlet_switch_counter___get__(struct __pyx_obj_6gevent_8__tracer_GreenletTracer *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_8__tracer_10_HubTracer___init__(struct __pyx_obj_6gevent_8__tracer__HubTracer *__pyx_v_self, PyObject *__pyx_v_hub, PyObject *__pyx_v_max_blocking_time); /* proto */ +static PyObject *__pyx_pf_6gevent_8__tracer_10_HubTracer_2kill(struct __pyx_obj_6gevent_8__tracer__HubTracer *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_8__tracer_10_HubTracer_3hub___get__(struct __pyx_obj_6gevent_8__tracer__HubTracer *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_8__tracer_10_HubTracer_17max_blocking_time___get__(struct __pyx_obj_6gevent_8__tracer__HubTracer *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_8__tracer_15HubSwitchTracer___init__(struct __pyx_obj_6gevent_8__tracer_HubSwitchTracer *__pyx_v_self, PyObject *__pyx_v_hub, PyObject *__pyx_v_max_blocking_time); /* proto */ +static PyObject *__pyx_pf_6gevent_8__tracer_15HubSwitchTracer_2_trace(struct __pyx_obj_6gevent_8__tracer_HubSwitchTracer *__pyx_v_self, PyObject *__pyx_v_event, PyObject *__pyx_v_args); /* proto */ +static PyObject *__pyx_pf_6gevent_8__tracer_15HubSwitchTracer_4did_block_hub(struct __pyx_obj_6gevent_8__tracer_HubSwitchTracer *__pyx_v_self, PyObject *__pyx_v_hub); /* proto */ +static PyObject *__pyx_pf_6gevent_8__tracer_15HubSwitchTracer_16last_entered_hub___get__(struct __pyx_obj_6gevent_8__tracer_HubSwitchTracer *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_8__tracer_15MaxSwitchTracer___init__(struct __pyx_obj_6gevent_8__tracer_MaxSwitchTracer *__pyx_v_self, PyObject *__pyx_v_hub, PyObject *__pyx_v_max_blocking_time); /* proto */ +static PyObject *__pyx_pf_6gevent_8__tracer_15MaxSwitchTracer_2_trace(struct __pyx_obj_6gevent_8__tracer_MaxSwitchTracer *__pyx_v_self, PyObject *__pyx_v_event, PyObject *__pyx_v_args); /* proto */ +static PyObject *__pyx_pf_6gevent_8__tracer_15MaxSwitchTracer_4did_block_hub(struct __pyx_obj_6gevent_8__tracer_MaxSwitchTracer *__pyx_v_self, PyObject *__pyx_v_hub); /* proto */ +static PyObject *__pyx_pf_6gevent_8__tracer_15MaxSwitchTracer_12max_blocking___get__(struct __pyx_obj_6gevent_8__tracer_MaxSwitchTracer *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_8__tracer_15MaxSwitchTracer_11last_switch___get__(struct __pyx_obj_6gevent_8__tracer_MaxSwitchTracer *__pyx_v_self); /* proto */ +static PyObject *__pyx_tp_new_6gevent_8__tracer_GreenletTracer(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6gevent_8__tracer__HubTracer(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6gevent_8__tracer_HubSwitchTracer(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6gevent_8__tracer_MaxSwitchTracer(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tuple__3; +static PyObject *__pyx_tuple__5; +static PyObject *__pyx_tuple__7; +static PyObject *__pyx_tuple__9; +static PyObject *__pyx_tuple__11; +static PyObject *__pyx_tuple__13; +static PyObject *__pyx_tuple__15; +static PyObject *__pyx_tuple__17; +static PyObject *__pyx_tuple__19; +static PyObject *__pyx_tuple__21; +static PyObject *__pyx_tuple__23; +static PyObject *__pyx_codeobj__4; +static PyObject *__pyx_codeobj__6; +static PyObject *__pyx_codeobj__8; +static PyObject *__pyx_codeobj__10; +static PyObject *__pyx_codeobj__12; +static PyObject *__pyx_codeobj__14; +static PyObject *__pyx_codeobj__16; +static PyObject *__pyx_codeobj__18; +static PyObject *__pyx_codeobj__20; +static PyObject *__pyx_codeobj__22; +static PyObject *__pyx_codeobj__24; +/* Late includes */ + +/* "src/gevent/_tracer.py":28 + * + * class GreenletTracer(object): + * def __init__(self): # <<<<<<<<<<<<<< + * # A counter, incremented by the greenlet trace function + * # we install on every greenlet switch. This is reset when the + */ + +/* Python wrapper */ +static int __pyx_pw_6gevent_8__tracer_14GreenletTracer_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6gevent_8__tracer_14GreenletTracer_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { + __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;} + if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1; + __pyx_r = __pyx_pf_6gevent_8__tracer_14GreenletTracer___init__(((struct __pyx_obj_6gevent_8__tracer_GreenletTracer *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_8__tracer_14GreenletTracer___init__(struct __pyx_obj_6gevent_8__tracer_GreenletTracer *__pyx_v_self) { + PyObject *__pyx_v_prev_trace = NULL; + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "src/gevent/_tracer.py":33 + * # periodic monitoring thread runs. + * + * self.greenlet_switch_counter = 0 # <<<<<<<<<<<<<< + * + * # The greenlet last switched to. + */ + __pyx_v_self->greenlet_switch_counter = 0; + + /* "src/gevent/_tracer.py":36 + * + * # The greenlet last switched to. + * self.active_greenlet = None # <<<<<<<<<<<<<< + * + * # The trace function that was previously installed, + */ + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->active_greenlet); + __Pyx_DECREF(__pyx_v_self->active_greenlet); + __pyx_v_self->active_greenlet = Py_None; + + /* "src/gevent/_tracer.py":43 + * # calling a bound method (at least when compiled with cython) + * # even when it redirects to another function. + * prev_trace = settrace(self) # <<<<<<<<<<<<<< + * + * self.previous_trace_function = prev_trace + */ + __Pyx_INCREF(__pyx_v_6gevent_8__tracer_settrace); + __pyx_t_2 = __pyx_v_6gevent_8__tracer_settrace; __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, ((PyObject *)__pyx_v_self)) : __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_v_self)); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 43, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_prev_trace = __pyx_t_1; + __pyx_t_1 = 0; + + /* "src/gevent/_tracer.py":45 + * prev_trace = settrace(self) + * + * self.previous_trace_function = prev_trace # <<<<<<<<<<<<<< + * + * self._killed = False + */ + __Pyx_INCREF(__pyx_v_prev_trace); + __Pyx_GIVEREF(__pyx_v_prev_trace); + __Pyx_GOTREF(__pyx_v_self->previous_trace_function); + __Pyx_DECREF(__pyx_v_self->previous_trace_function); + __pyx_v_self->previous_trace_function = __pyx_v_prev_trace; + + /* "src/gevent/_tracer.py":47 + * self.previous_trace_function = prev_trace + * + * self._killed = False # <<<<<<<<<<<<<< + * + * def kill(self): + */ + __pyx_v_self->_killed = 0; + + /* "src/gevent/_tracer.py":28 + * + * class GreenletTracer(object): + * def __init__(self): # <<<<<<<<<<<<<< + * # A counter, incremented by the greenlet trace function + * # we install on every greenlet switch. This is reset when the + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("gevent.__tracer.GreenletTracer.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_prev_trace); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_tracer.py":49 + * self._killed = False + * + * def kill(self): # <<<<<<<<<<<<<< + * # Must be called in the monitored thread. + * if not self._killed: + */ + +static PyObject *__pyx_pw_6gevent_8__tracer_14GreenletTracer_3kill(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_f_6gevent_8__tracer_14GreenletTracer_kill(struct __pyx_obj_6gevent_8__tracer_GreenletTracer *__pyx_v_self, int __pyx_skip_dispatch) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + __Pyx_RefNannySetupContext("kill", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0; + if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self)))))); + else { + PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + #endif + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_kill); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 49, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_8__tracer_14GreenletTracer_3kill)) { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 49, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0; + if (unlikely(type_dict_guard != tp_dict_version)) { + tp_dict_version = obj_dict_version = 0; + } + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + } + #endif + } + + /* "src/gevent/_tracer.py":51 + * def kill(self): + * # Must be called in the monitored thread. + * if not self._killed: # <<<<<<<<<<<<<< + * self._killed = True + * settrace(self.previous_trace_function) + */ + __pyx_t_5 = ((!(__pyx_v_self->_killed != 0)) != 0); + if (__pyx_t_5) { + + /* "src/gevent/_tracer.py":52 + * # Must be called in the monitored thread. + * if not self._killed: + * self._killed = True # <<<<<<<<<<<<<< + * settrace(self.previous_trace_function) + * self.previous_trace_function = None + */ + __pyx_v_self->_killed = 1; + + /* "src/gevent/_tracer.py":53 + * if not self._killed: + * self._killed = True + * settrace(self.previous_trace_function) # <<<<<<<<<<<<<< + * self.previous_trace_function = None + * + */ + __Pyx_INCREF(__pyx_v_6gevent_8__tracer_settrace); + __pyx_t_2 = __pyx_v_6gevent_8__tracer_settrace; __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_self->previous_trace_function) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_self->previous_trace_function); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 53, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_tracer.py":54 + * self._killed = True + * settrace(self.previous_trace_function) + * self.previous_trace_function = None # <<<<<<<<<<<<<< + * + * def _trace(self, event, args): + */ + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->previous_trace_function); + __Pyx_DECREF(__pyx_v_self->previous_trace_function); + __pyx_v_self->previous_trace_function = Py_None; + + /* "src/gevent/_tracer.py":51 + * def kill(self): + * # Must be called in the monitored thread. + * if not self._killed: # <<<<<<<<<<<<<< + * self._killed = True + * settrace(self.previous_trace_function) + */ + } + + /* "src/gevent/_tracer.py":49 + * self._killed = False + * + * def kill(self): # <<<<<<<<<<<<<< + * # Must be called in the monitored thread. + * if not self._killed: + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("gevent.__tracer.GreenletTracer.kill", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_8__tracer_14GreenletTracer_3kill(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6gevent_8__tracer_14GreenletTracer_2kill[] = "GreenletTracer.kill(self)"; +static PyMethodDef __pyx_mdef_6gevent_8__tracer_14GreenletTracer_3kill = {"kill", (PyCFunction)__pyx_pw_6gevent_8__tracer_14GreenletTracer_3kill, METH_NOARGS, __pyx_doc_6gevent_8__tracer_14GreenletTracer_2kill}; +static PyObject *__pyx_pw_6gevent_8__tracer_14GreenletTracer_3kill(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("kill (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_8__tracer_14GreenletTracer_2kill(((struct __pyx_obj_6gevent_8__tracer_GreenletTracer *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_8__tracer_14GreenletTracer_2kill(struct __pyx_obj_6gevent_8__tracer_GreenletTracer *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("kill", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6gevent_8__tracer_14GreenletTracer_kill(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 49, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__tracer.GreenletTracer.kill", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_tracer.py":56 + * self.previous_trace_function = None + * + * def _trace(self, event, args): # <<<<<<<<<<<<<< + * # This function runs in the thread we are monitoring. + * self.greenlet_switch_counter += 1 + */ + +static PyObject *__pyx_pw_6gevent_8__tracer_14GreenletTracer_5_trace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_6gevent_8__tracer_14GreenletTracer__trace(struct __pyx_obj_6gevent_8__tracer_GreenletTracer *__pyx_v_self, PyObject *__pyx_v_event, PyObject *__pyx_v_args, int __pyx_skip_dispatch) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + int __pyx_t_8; + int __pyx_t_9; + int __pyx_t_10; + __Pyx_RefNannySetupContext("_trace", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0; + if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self)))))); + else { + PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + #endif + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_trace); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 56, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_8__tracer_14GreenletTracer_5_trace)) { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; + __pyx_t_5 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_5 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_3)) { + PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_event, __pyx_v_args}; + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 56, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GOTREF(__pyx_t_2); + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { + PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_event, __pyx_v_args}; + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 56, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GOTREF(__pyx_t_2); + } else + #endif + { + __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 56, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (__pyx_t_4) { + __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL; + } + __Pyx_INCREF(__pyx_v_event); + __Pyx_GIVEREF(__pyx_v_event); + PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_event); + __Pyx_INCREF(__pyx_v_args); + __Pyx_GIVEREF(__pyx_v_args); + PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_args); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 56, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0; + if (unlikely(type_dict_guard != tp_dict_version)) { + tp_dict_version = obj_dict_version = 0; + } + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + } + #endif + } + + /* "src/gevent/_tracer.py":58 + * def _trace(self, event, args): + * # This function runs in the thread we are monitoring. + * self.greenlet_switch_counter += 1 # <<<<<<<<<<<<<< + * if event in ('switch', 'throw'): + * # args is (origin, target). This is the only defined + */ + __pyx_v_self->greenlet_switch_counter = (__pyx_v_self->greenlet_switch_counter + 1); + + /* "src/gevent/_tracer.py":59 + * # This function runs in the thread we are monitoring. + * self.greenlet_switch_counter += 1 + * if event in ('switch', 'throw'): # <<<<<<<<<<<<<< + * # args is (origin, target). This is the only defined + * # case + */ + __Pyx_INCREF(__pyx_v_event); + __pyx_t_7 = __pyx_v_event; + __pyx_t_9 = (__Pyx_PyString_Equals(__pyx_t_7, __pyx_n_s_switch, Py_EQ)); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 59, __pyx_L1_error) + __pyx_t_10 = (__pyx_t_9 != 0); + if (!__pyx_t_10) { + } else { + __pyx_t_8 = __pyx_t_10; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_10 = (__Pyx_PyString_Equals(__pyx_t_7, __pyx_n_s_throw, Py_EQ)); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 59, __pyx_L1_error) + __pyx_t_9 = (__pyx_t_10 != 0); + __pyx_t_8 = __pyx_t_9; + __pyx_L4_bool_binop_done:; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_9 = (__pyx_t_8 != 0); + if (__pyx_t_9) { + + /* "src/gevent/_tracer.py":62 + * # args is (origin, target). This is the only defined + * # case + * self.active_greenlet = args[1] # <<<<<<<<<<<<<< + * else: + * self.active_greenlet = None + */ + if (unlikely(__pyx_v_args == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 62, __pyx_L1_error) + } + __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v_args, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 62, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_self->active_greenlet); + __Pyx_DECREF(__pyx_v_self->active_greenlet); + __pyx_v_self->active_greenlet = __pyx_t_1; + __pyx_t_1 = 0; + + /* "src/gevent/_tracer.py":59 + * # This function runs in the thread we are monitoring. + * self.greenlet_switch_counter += 1 + * if event in ('switch', 'throw'): # <<<<<<<<<<<<<< + * # args is (origin, target). This is the only defined + * # case + */ + goto __pyx_L3; + } + + /* "src/gevent/_tracer.py":64 + * self.active_greenlet = args[1] + * else: + * self.active_greenlet = None # <<<<<<<<<<<<<< + * if self.previous_trace_function is not None: + * self.previous_trace_function(event, args) + */ + /*else*/ { + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->active_greenlet); + __Pyx_DECREF(__pyx_v_self->active_greenlet); + __pyx_v_self->active_greenlet = Py_None; + } + __pyx_L3:; + + /* "src/gevent/_tracer.py":65 + * else: + * self.active_greenlet = None + * if self.previous_trace_function is not None: # <<<<<<<<<<<<<< + * self.previous_trace_function(event, args) + * + */ + __pyx_t_9 = (__pyx_v_self->previous_trace_function != Py_None); + __pyx_t_8 = (__pyx_t_9 != 0); + if (__pyx_t_8) { + + /* "src/gevent/_tracer.py":66 + * self.active_greenlet = None + * if self.previous_trace_function is not None: + * self.previous_trace_function(event, args) # <<<<<<<<<<<<<< + * + * def __call__(self, event, args): + */ + __Pyx_INCREF(__pyx_v_self->previous_trace_function); + __pyx_t_2 = __pyx_v_self->previous_trace_function; __pyx_t_3 = NULL; + __pyx_t_5 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_5 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_event, __pyx_v_args}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 66, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_event, __pyx_v_args}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 66, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else + #endif + { + __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 66, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (__pyx_t_3) { + __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); __pyx_t_3 = NULL; + } + __Pyx_INCREF(__pyx_v_event); + __Pyx_GIVEREF(__pyx_v_event); + PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_event); + __Pyx_INCREF(__pyx_v_args); + __Pyx_GIVEREF(__pyx_v_args); + PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_args); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 66, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_tracer.py":65 + * else: + * self.active_greenlet = None + * if self.previous_trace_function is not None: # <<<<<<<<<<<<<< + * self.previous_trace_function(event, args) + * + */ + } + + /* "src/gevent/_tracer.py":56 + * self.previous_trace_function = None + * + * def _trace(self, event, args): # <<<<<<<<<<<<<< + * # This function runs in the thread we are monitoring. + * self.greenlet_switch_counter += 1 + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("gevent.__tracer.GreenletTracer._trace", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_8__tracer_14GreenletTracer_5_trace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6gevent_8__tracer_14GreenletTracer_4_trace[] = "GreenletTracer._trace(self, str event, tuple args)"; +static PyMethodDef __pyx_mdef_6gevent_8__tracer_14GreenletTracer_5_trace = {"_trace", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_8__tracer_14GreenletTracer_5_trace, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_8__tracer_14GreenletTracer_4_trace}; +static PyObject *__pyx_pw_6gevent_8__tracer_14GreenletTracer_5_trace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_event = 0; + PyObject *__pyx_v_args = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_trace (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_event,&__pyx_n_s_args,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_event)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("_trace", 1, 2, 2, 1); __PYX_ERR(0, 56, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_trace") < 0)) __PYX_ERR(0, 56, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_event = ((PyObject*)values[0]); + __pyx_v_args = ((PyObject*)values[1]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("_trace", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 56, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.__tracer.GreenletTracer._trace", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_event), (&PyString_Type), 1, "event", 1))) __PYX_ERR(0, 56, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_args), (&PyTuple_Type), 1, "args", 1))) __PYX_ERR(0, 56, __pyx_L1_error) + __pyx_r = __pyx_pf_6gevent_8__tracer_14GreenletTracer_4_trace(((struct __pyx_obj_6gevent_8__tracer_GreenletTracer *)__pyx_v_self), __pyx_v_event, __pyx_v_args); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_8__tracer_14GreenletTracer_4_trace(struct __pyx_obj_6gevent_8__tracer_GreenletTracer *__pyx_v_self, PyObject *__pyx_v_event, PyObject *__pyx_v_args) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("_trace", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6gevent_8__tracer_14GreenletTracer__trace(__pyx_v_self, __pyx_v_event, __pyx_v_args, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 56, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__tracer.GreenletTracer._trace", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_tracer.py":68 + * self.previous_trace_function(event, args) + * + * def __call__(self, event, args): # <<<<<<<<<<<<<< + * return self._trace(event, args) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_8__tracer_14GreenletTracer_7__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6gevent_8__tracer_14GreenletTracer_7__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_event = 0; + PyObject *__pyx_v_args = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__call__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_event,&__pyx_n_s_args,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_event)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__call__", 1, 2, 2, 1); __PYX_ERR(0, 68, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__call__") < 0)) __PYX_ERR(0, 68, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_event = values[0]; + __pyx_v_args = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__call__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 68, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.__tracer.GreenletTracer.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_8__tracer_14GreenletTracer_6__call__(((struct __pyx_obj_6gevent_8__tracer_GreenletTracer *)__pyx_v_self), __pyx_v_event, __pyx_v_args); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_8__tracer_14GreenletTracer_6__call__(struct __pyx_obj_6gevent_8__tracer_GreenletTracer *__pyx_v_self, PyObject *__pyx_v_event, PyObject *__pyx_v_args) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__call__", 0); + + /* "src/gevent/_tracer.py":69 + * + * def __call__(self, event, args): + * return self._trace(event, args) # <<<<<<<<<<<<<< + * + * def did_block_hub(self, hub): + */ + __Pyx_XDECREF(__pyx_r); + if (!(likely(PyString_CheckExact(__pyx_v_event))||((__pyx_v_event) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_v_event)->tp_name), 0))) __PYX_ERR(0, 69, __pyx_L1_error) + if (!(likely(PyTuple_CheckExact(__pyx_v_args))||((__pyx_v_args) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v_args)->tp_name), 0))) __PYX_ERR(0, 69, __pyx_L1_error) + __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_8__tracer_GreenletTracer *)__pyx_v_self->__pyx_vtab)->_trace(__pyx_v_self, ((PyObject*)__pyx_v_event), ((PyObject*)__pyx_v_args), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 69, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "src/gevent/_tracer.py":68 + * self.previous_trace_function(event, args) + * + * def __call__(self, event, args): # <<<<<<<<<<<<<< + * return self._trace(event, args) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__tracer.GreenletTracer.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_tracer.py":71 + * return self._trace(event, args) + * + * def did_block_hub(self, hub): # <<<<<<<<<<<<<< + * # Check to see if we have blocked since the last call to this + * # method. Returns a true value if we blocked (not in the hub), + */ + +static PyObject *__pyx_pw_6gevent_8__tracer_14GreenletTracer_9did_block_hub(PyObject *__pyx_v_self, PyObject *__pyx_v_hub); /*proto*/ +static PyObject *__pyx_f_6gevent_8__tracer_14GreenletTracer_did_block_hub(struct __pyx_obj_6gevent_8__tracer_GreenletTracer *__pyx_v_self, PyObject *__pyx_v_hub, int __pyx_skip_dispatch) { + int __pyx_v_did_switch; + PyObject *__pyx_v_active_greenlet = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + int __pyx_t_6; + int __pyx_t_7; + __Pyx_RefNannySetupContext("did_block_hub", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0; + if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self)))))); + else { + PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + #endif + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_did_block_hub); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 71, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_8__tracer_14GreenletTracer_9did_block_hub)) { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_hub) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_hub); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 71, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0; + if (unlikely(type_dict_guard != tp_dict_version)) { + tp_dict_version = obj_dict_version = 0; + } + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + } + #endif + } + + /* "src/gevent/_tracer.py":82 + * # annoying false positives. + * + * active_greenlet = self.active_greenlet # <<<<<<<<<<<<<< + * did_switch = self.greenlet_switch_counter != 0 + * self.greenlet_switch_counter = 0 + */ + __pyx_t_1 = __pyx_v_self->active_greenlet; + __Pyx_INCREF(__pyx_t_1); + __pyx_v_active_greenlet = __pyx_t_1; + __pyx_t_1 = 0; + + /* "src/gevent/_tracer.py":83 + * + * active_greenlet = self.active_greenlet + * did_switch = self.greenlet_switch_counter != 0 # <<<<<<<<<<<<<< + * self.greenlet_switch_counter = 0 + * + */ + __pyx_v_did_switch = (__pyx_v_self->greenlet_switch_counter != 0); + + /* "src/gevent/_tracer.py":84 + * active_greenlet = self.active_greenlet + * did_switch = self.greenlet_switch_counter != 0 + * self.greenlet_switch_counter = 0 # <<<<<<<<<<<<<< + * + * if did_switch or active_greenlet is None or active_greenlet is hub: + */ + __pyx_v_self->greenlet_switch_counter = 0; + + /* "src/gevent/_tracer.py":86 + * self.greenlet_switch_counter = 0 + * + * if did_switch or active_greenlet is None or active_greenlet is hub: # <<<<<<<<<<<<<< + * # Either we switched, or nothing is running (we got a + * # trace event we don't know about or were requested to + */ + __pyx_t_6 = (__pyx_v_did_switch != 0); + if (!__pyx_t_6) { + } else { + __pyx_t_5 = __pyx_t_6; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_6 = (__pyx_v_active_greenlet == Py_None); + __pyx_t_7 = (__pyx_t_6 != 0); + if (!__pyx_t_7) { + } else { + __pyx_t_5 = __pyx_t_7; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_7 = (__pyx_v_active_greenlet == __pyx_v_hub); + __pyx_t_6 = (__pyx_t_7 != 0); + __pyx_t_5 = __pyx_t_6; + __pyx_L4_bool_binop_done:; + if (__pyx_t_5) { + + /* "src/gevent/_tracer.py":91 + * # ignore), or we spent the whole time in the hub, blocked + * # for IO. Nothing to report. + * return False # <<<<<<<<<<<<<< + * return True, active_greenlet + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + + /* "src/gevent/_tracer.py":86 + * self.greenlet_switch_counter = 0 + * + * if did_switch or active_greenlet is None or active_greenlet is hub: # <<<<<<<<<<<<<< + * # Either we switched, or nothing is running (we got a + * # trace event we don't know about or were requested to + */ + } + + /* "src/gevent/_tracer.py":92 + * # for IO. Nothing to report. + * return False + * return True, active_greenlet # <<<<<<<<<<<<<< + * + * def ignore_current_greenlet_blocking(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 92, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(Py_True); + __Pyx_GIVEREF(Py_True); + PyTuple_SET_ITEM(__pyx_t_1, 0, Py_True); + __Pyx_INCREF(__pyx_v_active_greenlet); + __Pyx_GIVEREF(__pyx_v_active_greenlet); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_active_greenlet); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "src/gevent/_tracer.py":71 + * return self._trace(event, args) + * + * def did_block_hub(self, hub): # <<<<<<<<<<<<<< + * # Check to see if we have blocked since the last call to this + * # method. Returns a true value if we blocked (not in the hub), + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("gevent.__tracer.GreenletTracer.did_block_hub", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_active_greenlet); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_8__tracer_14GreenletTracer_9did_block_hub(PyObject *__pyx_v_self, PyObject *__pyx_v_hub); /*proto*/ +static char __pyx_doc_6gevent_8__tracer_14GreenletTracer_8did_block_hub[] = "GreenletTracer.did_block_hub(self, hub)"; +static PyMethodDef __pyx_mdef_6gevent_8__tracer_14GreenletTracer_9did_block_hub = {"did_block_hub", (PyCFunction)__pyx_pw_6gevent_8__tracer_14GreenletTracer_9did_block_hub, METH_O, __pyx_doc_6gevent_8__tracer_14GreenletTracer_8did_block_hub}; +static PyObject *__pyx_pw_6gevent_8__tracer_14GreenletTracer_9did_block_hub(PyObject *__pyx_v_self, PyObject *__pyx_v_hub) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("did_block_hub (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_8__tracer_14GreenletTracer_8did_block_hub(((struct __pyx_obj_6gevent_8__tracer_GreenletTracer *)__pyx_v_self), ((PyObject *)__pyx_v_hub)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_8__tracer_14GreenletTracer_8did_block_hub(struct __pyx_obj_6gevent_8__tracer_GreenletTracer *__pyx_v_self, PyObject *__pyx_v_hub) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("did_block_hub", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6gevent_8__tracer_14GreenletTracer_did_block_hub(__pyx_v_self, __pyx_v_hub, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 71, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__tracer.GreenletTracer.did_block_hub", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_tracer.py":94 + * return True, active_greenlet + * + * def ignore_current_greenlet_blocking(self): # <<<<<<<<<<<<<< + * # Don't pay attention to the current greenlet. + * self.active_greenlet = None + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_8__tracer_14GreenletTracer_11ignore_current_greenlet_blocking(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6gevent_8__tracer_14GreenletTracer_10ignore_current_greenlet_blocking[] = "GreenletTracer.ignore_current_greenlet_blocking(self)"; +static PyMethodDef __pyx_mdef_6gevent_8__tracer_14GreenletTracer_11ignore_current_greenlet_blocking = {"ignore_current_greenlet_blocking", (PyCFunction)__pyx_pw_6gevent_8__tracer_14GreenletTracer_11ignore_current_greenlet_blocking, METH_NOARGS, __pyx_doc_6gevent_8__tracer_14GreenletTracer_10ignore_current_greenlet_blocking}; +static PyObject *__pyx_pw_6gevent_8__tracer_14GreenletTracer_11ignore_current_greenlet_blocking(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("ignore_current_greenlet_blocking (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_8__tracer_14GreenletTracer_10ignore_current_greenlet_blocking(((struct __pyx_obj_6gevent_8__tracer_GreenletTracer *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_8__tracer_14GreenletTracer_10ignore_current_greenlet_blocking(struct __pyx_obj_6gevent_8__tracer_GreenletTracer *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("ignore_current_greenlet_blocking", 0); + + /* "src/gevent/_tracer.py":96 + * def ignore_current_greenlet_blocking(self): + * # Don't pay attention to the current greenlet. + * self.active_greenlet = None # <<<<<<<<<<<<<< + * + * def monitor_current_greenlet_blocking(self): + */ + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->active_greenlet); + __Pyx_DECREF(__pyx_v_self->active_greenlet); + __pyx_v_self->active_greenlet = Py_None; + + /* "src/gevent/_tracer.py":94 + * return True, active_greenlet + * + * def ignore_current_greenlet_blocking(self): # <<<<<<<<<<<<<< + * # Don't pay attention to the current greenlet. + * self.active_greenlet = None + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_tracer.py":98 + * self.active_greenlet = None + * + * def monitor_current_greenlet_blocking(self): # <<<<<<<<<<<<<< + * self.active_greenlet = getcurrent() + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_8__tracer_14GreenletTracer_13monitor_current_greenlet_blocking(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6gevent_8__tracer_14GreenletTracer_12monitor_current_greenlet_blocking[] = "GreenletTracer.monitor_current_greenlet_blocking(self)"; +static PyMethodDef __pyx_mdef_6gevent_8__tracer_14GreenletTracer_13monitor_current_greenlet_blocking = {"monitor_current_greenlet_blocking", (PyCFunction)__pyx_pw_6gevent_8__tracer_14GreenletTracer_13monitor_current_greenlet_blocking, METH_NOARGS, __pyx_doc_6gevent_8__tracer_14GreenletTracer_12monitor_current_greenlet_blocking}; +static PyObject *__pyx_pw_6gevent_8__tracer_14GreenletTracer_13monitor_current_greenlet_blocking(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("monitor_current_greenlet_blocking (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_8__tracer_14GreenletTracer_12monitor_current_greenlet_blocking(((struct __pyx_obj_6gevent_8__tracer_GreenletTracer *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_8__tracer_14GreenletTracer_12monitor_current_greenlet_blocking(struct __pyx_obj_6gevent_8__tracer_GreenletTracer *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("monitor_current_greenlet_blocking", 0); + + /* "src/gevent/_tracer.py":99 + * + * def monitor_current_greenlet_blocking(self): + * self.active_greenlet = getcurrent() # <<<<<<<<<<<<<< + * + * def did_block_hub_report(self, hub, active_greenlet, format_kwargs): + */ + __Pyx_INCREF(__pyx_v_6gevent_8__tracer_getcurrent); + __pyx_t_2 = __pyx_v_6gevent_8__tracer_getcurrent; __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 99, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_self->active_greenlet); + __Pyx_DECREF(__pyx_v_self->active_greenlet); + __pyx_v_self->active_greenlet = __pyx_t_1; + __pyx_t_1 = 0; + + /* "src/gevent/_tracer.py":98 + * self.active_greenlet = None + * + * def monitor_current_greenlet_blocking(self): # <<<<<<<<<<<<<< + * self.active_greenlet = getcurrent() + * + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("gevent.__tracer.GreenletTracer.monitor_current_greenlet_blocking", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_tracer.py":101 + * self.active_greenlet = getcurrent() + * + * def did_block_hub_report(self, hub, active_greenlet, format_kwargs): # <<<<<<<<<<<<<< + * report = ['=' * 80, + * '\n%s : Greenlet %s appears to be blocked' % + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_8__tracer_14GreenletTracer_15did_block_hub_report(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6gevent_8__tracer_14GreenletTracer_14did_block_hub_report[] = "GreenletTracer.did_block_hub_report(self, hub, active_greenlet, format_kwargs)"; +static PyMethodDef __pyx_mdef_6gevent_8__tracer_14GreenletTracer_15did_block_hub_report = {"did_block_hub_report", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_8__tracer_14GreenletTracer_15did_block_hub_report, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_8__tracer_14GreenletTracer_14did_block_hub_report}; +static PyObject *__pyx_pw_6gevent_8__tracer_14GreenletTracer_15did_block_hub_report(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_hub = 0; + PyObject *__pyx_v_active_greenlet = 0; + PyObject *__pyx_v_format_kwargs = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("did_block_hub_report (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_hub,&__pyx_n_s_active_greenlet,&__pyx_n_s_format_kwargs,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_hub)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_active_greenlet)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("did_block_hub_report", 1, 3, 3, 1); __PYX_ERR(0, 101, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_format_kwargs)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("did_block_hub_report", 1, 3, 3, 2); __PYX_ERR(0, 101, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "did_block_hub_report") < 0)) __PYX_ERR(0, 101, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + } + __pyx_v_hub = values[0]; + __pyx_v_active_greenlet = values[1]; + __pyx_v_format_kwargs = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("did_block_hub_report", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 101, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.__tracer.GreenletTracer.did_block_hub_report", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_8__tracer_14GreenletTracer_14did_block_hub_report(((struct __pyx_obj_6gevent_8__tracer_GreenletTracer *)__pyx_v_self), __pyx_v_hub, __pyx_v_active_greenlet, __pyx_v_format_kwargs); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_8__tracer_14GreenletTracer_14did_block_hub_report(struct __pyx_obj_6gevent_8__tracer_GreenletTracer *__pyx_v_self, PyObject *__pyx_v_hub, PyObject *__pyx_v_active_greenlet, PyObject *__pyx_v_format_kwargs) { + PyObject *__pyx_v_report = NULL; + PyObject *__pyx_v_frame = NULL; + PyObject *__pyx_v_stack = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + __Pyx_RefNannySetupContext("did_block_hub_report", 0); + + /* "src/gevent/_tracer.py":104 + * report = ['=' * 80, + * '\n%s : Greenlet %s appears to be blocked' % + * (gmctime(), active_greenlet)] # <<<<<<<<<<<<<< + * report.append(" Reported by %s" % (self,)) + * try: + */ + __Pyx_INCREF(__pyx_v_6gevent_8__tracer_gmctime); + __pyx_t_2 = __pyx_v_6gevent_8__tracer_gmctime; __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 104, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 104, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); + __Pyx_INCREF(__pyx_v_active_greenlet); + __Pyx_GIVEREF(__pyx_v_active_greenlet); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_active_greenlet); + __pyx_t_1 = 0; + + /* "src/gevent/_tracer.py":103 + * def did_block_hub_report(self, hub, active_greenlet, format_kwargs): + * report = ['=' * 80, + * '\n%s : Greenlet %s appears to be blocked' % # <<<<<<<<<<<<<< + * (gmctime(), active_greenlet)] + * report.append(" Reported by %s" % (self,)) + */ + __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_s_Greenlet_s_appears_to_be_bloc, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 103, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/_tracer.py":102 + * + * def did_block_hub_report(self, hub, active_greenlet, format_kwargs): + * report = ['=' * 80, # <<<<<<<<<<<<<< + * '\n%s : Greenlet %s appears to be blocked' % + * (gmctime(), active_greenlet)] + */ + __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 102, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_kp_s_b); + __Pyx_GIVEREF(__pyx_kp_s_b); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_kp_s_b); + __Pyx_GIVEREF(__pyx_t_1); + PyList_SET_ITEM(__pyx_t_2, 1, __pyx_t_1); + __pyx_t_1 = 0; + __pyx_v_report = ((PyObject*)__pyx_t_2); + __pyx_t_2 = 0; + + /* "src/gevent/_tracer.py":105 + * '\n%s : Greenlet %s appears to be blocked' % + * (gmctime(), active_greenlet)] + * report.append(" Reported by %s" % (self,)) # <<<<<<<<<<<<<< + * try: + * frame = sys._current_frames()[hub.thread_ident] + */ + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 105, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self)); + __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_Reported_by_s, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 105, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_report, __pyx_t_1); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 105, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_tracer.py":106 + * (gmctime(), active_greenlet)] + * report.append(" Reported by %s" % (self,)) + * try: # <<<<<<<<<<<<<< + * frame = sys._current_frames()[hub.thread_ident] + * except KeyError: + */ + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7); + __Pyx_XGOTREF(__pyx_t_5); + __Pyx_XGOTREF(__pyx_t_6); + __Pyx_XGOTREF(__pyx_t_7); + /*try:*/ { + + /* "src/gevent/_tracer.py":107 + * report.append(" Reported by %s" % (self,)) + * try: + * frame = sys._current_frames()[hub.thread_ident] # <<<<<<<<<<<<<< + * except KeyError: + * # The thread holding the hub has died. Perhaps we shouldn't + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_6gevent_8__tracer_sys, __pyx_n_s_current_frames); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 107, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 107, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_hub, __pyx_n_s_thread_ident); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 107, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 107, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_frame = __pyx_t_3; + __pyx_t_3 = 0; + + /* "src/gevent/_tracer.py":106 + * (gmctime(), active_greenlet)] + * report.append(" Reported by %s" % (self,)) + * try: # <<<<<<<<<<<<<< + * frame = sys._current_frames()[hub.thread_ident] + * except KeyError: + */ + } + + /* "src/gevent/_tracer.py":113 + * stack = ["Unknown: No thread found for hub %r\n" % (hub,)] + * else: + * stack = traceback.format_stack(frame) # <<<<<<<<<<<<<< + * report.append('Blocked Stack (for thread id %s):' % (hex(hub.thread_ident),)) + * report.append(''.join(stack)) + */ + /*else:*/ { + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_6gevent_8__tracer_traceback, __pyx_n_s_format_stack); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 113, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_1)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_1); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_3 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_1, __pyx_v_frame) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_frame); + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 113, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_stack = __pyx_t_3; + __pyx_t_3 = 0; + } + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + goto __pyx_L8_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "src/gevent/_tracer.py":108 + * try: + * frame = sys._current_frames()[hub.thread_ident] + * except KeyError: # <<<<<<<<<<<<<< + * # The thread holding the hub has died. Perhaps we shouldn't + * # even report this? + */ + __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError); + if (__pyx_t_8) { + __Pyx_AddTraceback("gevent.__tracer.GreenletTracer.did_block_hub_report", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_2, &__pyx_t_1) < 0) __PYX_ERR(0, 108, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_t_1); + + /* "src/gevent/_tracer.py":111 + * # The thread holding the hub has died. Perhaps we shouldn't + * # even report this? + * stack = ["Unknown: No thread found for hub %r\n" % (hub,)] # <<<<<<<<<<<<<< + * else: + * stack = traceback.format_stack(frame) + */ + __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 111, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_INCREF(__pyx_v_hub); + __Pyx_GIVEREF(__pyx_v_hub); + PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_hub); + __pyx_t_10 = __Pyx_PyString_Format(__pyx_kp_s_Unknown_No_thread_found_for_hub, __pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 111, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = PyList_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 111, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_GIVEREF(__pyx_t_10); + PyList_SET_ITEM(__pyx_t_9, 0, __pyx_t_10); + __pyx_t_10 = 0; + __pyx_v_stack = __pyx_t_9; + __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + + /* "src/gevent/_tracer.py":106 + * (gmctime(), active_greenlet)] + * report.append(" Reported by %s" % (self,)) + * try: # <<<<<<<<<<<<<< + * frame = sys._current_frames()[hub.thread_ident] + * except KeyError: + */ + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7); + goto __pyx_L1_error; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7); + __pyx_L8_try_end:; + } + + /* "src/gevent/_tracer.py":114 + * else: + * stack = traceback.format_stack(frame) + * report.append('Blocked Stack (for thread id %s):' % (hex(hub.thread_ident),)) # <<<<<<<<<<<<<< + * report.append(''.join(stack)) + * report.append("Info:") + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_hub, __pyx_n_s_thread_ident); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 114, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_hex, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 114, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 114, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_Blocked_Stack_for_thread_id_s, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 114, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_report, __pyx_t_2); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 114, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/_tracer.py":115 + * stack = traceback.format_stack(frame) + * report.append('Blocked Stack (for thread id %s):' % (hex(hub.thread_ident),)) + * report.append(''.join(stack)) # <<<<<<<<<<<<<< + * report.append("Info:") + * report.extend(format_run_info(**format_kwargs)) + */ + __pyx_t_2 = __Pyx_PyString_Join(__pyx_kp_s__2, __pyx_v_stack); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 115, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_report, __pyx_t_2); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 115, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/_tracer.py":116 + * report.append('Blocked Stack (for thread id %s):' % (hex(hub.thread_ident),)) + * report.append(''.join(stack)) + * report.append("Info:") # <<<<<<<<<<<<<< + * report.extend(format_run_info(**format_kwargs)) + * + */ + __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_report, __pyx_kp_s_Info); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 116, __pyx_L1_error) + + /* "src/gevent/_tracer.py":117 + * report.append(''.join(stack)) + * report.append("Info:") + * report.extend(format_run_info(**format_kwargs)) # <<<<<<<<<<<<<< + * + * return report + */ + if (unlikely(__pyx_v_format_kwargs == Py_None)) { + PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); + __PYX_ERR(0, 117, __pyx_L1_error) + } + if (likely(PyDict_CheckExact(__pyx_v_format_kwargs))) { + __pyx_t_2 = PyDict_Copy(__pyx_v_format_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 117, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + } else { + __pyx_t_2 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_format_kwargs, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 117, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + } + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_6gevent_8__tracer_format_run_info, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 117, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_4 = __Pyx_PyList_Extend(__pyx_v_report, __pyx_t_1); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 117, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_tracer.py":119 + * report.extend(format_run_info(**format_kwargs)) + * + * return report # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_report); + __pyx_r = __pyx_v_report; + goto __pyx_L0; + + /* "src/gevent/_tracer.py":101 + * self.active_greenlet = getcurrent() + * + * def did_block_hub_report(self, hub, active_greenlet, format_kwargs): # <<<<<<<<<<<<<< + * report = ['=' * 80, + * '\n%s : Greenlet %s appears to be blocked' % + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_AddTraceback("gevent.__tracer.GreenletTracer.did_block_hub_report", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_report); + __Pyx_XDECREF(__pyx_v_frame); + __Pyx_XDECREF(__pyx_v_stack); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/__tracer.pxd":16 + * + * cdef class GreenletTracer: + * cpdef readonly object active_greenlet # <<<<<<<<<<<<<< + * cpdef readonly object previous_trace_function + * cpdef readonly Py_ssize_t greenlet_switch_counter + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_8__tracer_14GreenletTracer_15active_greenlet_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_8__tracer_14GreenletTracer_15active_greenlet_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_8__tracer_14GreenletTracer_15active_greenlet___get__(((struct __pyx_obj_6gevent_8__tracer_GreenletTracer *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_8__tracer_14GreenletTracer_15active_greenlet___get__(struct __pyx_obj_6gevent_8__tracer_GreenletTracer *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->active_greenlet); + __pyx_r = __pyx_v_self->active_greenlet; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/__tracer.pxd":17 + * cdef class GreenletTracer: + * cpdef readonly object active_greenlet + * cpdef readonly object previous_trace_function # <<<<<<<<<<<<<< + * cpdef readonly Py_ssize_t greenlet_switch_counter + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_8__tracer_14GreenletTracer_23previous_trace_function_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_8__tracer_14GreenletTracer_23previous_trace_function_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_8__tracer_14GreenletTracer_23previous_trace_function___get__(((struct __pyx_obj_6gevent_8__tracer_GreenletTracer *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_8__tracer_14GreenletTracer_23previous_trace_function___get__(struct __pyx_obj_6gevent_8__tracer_GreenletTracer *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->previous_trace_function); + __pyx_r = __pyx_v_self->previous_trace_function; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/__tracer.pxd":18 + * cpdef readonly object active_greenlet + * cpdef readonly object previous_trace_function + * cpdef readonly Py_ssize_t greenlet_switch_counter # <<<<<<<<<<<<<< + * + * cdef bint _killed + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_8__tracer_14GreenletTracer_23greenlet_switch_counter_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_8__tracer_14GreenletTracer_23greenlet_switch_counter_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_8__tracer_14GreenletTracer_23greenlet_switch_counter___get__(((struct __pyx_obj_6gevent_8__tracer_GreenletTracer *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_8__tracer_14GreenletTracer_23greenlet_switch_counter___get__(struct __pyx_obj_6gevent_8__tracer_GreenletTracer *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->greenlet_switch_counter); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 18, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__tracer.GreenletTracer.greenlet_switch_counter.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_tracer.py":123 + * + * class _HubTracer(GreenletTracer): + * def __init__(self, hub, max_blocking_time): # <<<<<<<<<<<<<< + * GreenletTracer.__init__(self) + * self.max_blocking_time = max_blocking_time + */ + +/* Python wrapper */ +static int __pyx_pw_6gevent_8__tracer_10_HubTracer_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6gevent_8__tracer_10_HubTracer_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_hub = 0; + PyObject *__pyx_v_max_blocking_time = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_hub,&__pyx_n_s_max_blocking_time,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_hub)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_max_blocking_time)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(0, 123, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 123, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_hub = values[0]; + __pyx_v_max_blocking_time = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 123, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.__tracer._HubTracer.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_8__tracer_10_HubTracer___init__(((struct __pyx_obj_6gevent_8__tracer__HubTracer *)__pyx_v_self), __pyx_v_hub, __pyx_v_max_blocking_time); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_8__tracer_10_HubTracer___init__(struct __pyx_obj_6gevent_8__tracer__HubTracer *__pyx_v_self, PyObject *__pyx_v_hub, PyObject *__pyx_v_max_blocking_time) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + double __pyx_t_4; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "src/gevent/_tracer.py":124 + * class _HubTracer(GreenletTracer): + * def __init__(self, hub, max_blocking_time): + * GreenletTracer.__init__(self) # <<<<<<<<<<<<<< + * self.max_blocking_time = max_blocking_time + * self.hub = hub + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_6gevent_8__tracer_GreenletTracer), __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 124, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, ((PyObject *)__pyx_v_self)) : __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_v_self)); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 124, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_tracer.py":125 + * def __init__(self, hub, max_blocking_time): + * GreenletTracer.__init__(self) + * self.max_blocking_time = max_blocking_time # <<<<<<<<<<<<<< + * self.hub = hub + * + */ + __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_v_max_blocking_time); if (unlikely((__pyx_t_4 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 125, __pyx_L1_error) + __pyx_v_self->max_blocking_time = __pyx_t_4; + + /* "src/gevent/_tracer.py":126 + * GreenletTracer.__init__(self) + * self.max_blocking_time = max_blocking_time + * self.hub = hub # <<<<<<<<<<<<<< + * + * def kill(self): + */ + __Pyx_INCREF(__pyx_v_hub); + __Pyx_GIVEREF(__pyx_v_hub); + __Pyx_GOTREF(__pyx_v_self->hub); + __Pyx_DECREF(__pyx_v_self->hub); + __pyx_v_self->hub = __pyx_v_hub; + + /* "src/gevent/_tracer.py":123 + * + * class _HubTracer(GreenletTracer): + * def __init__(self, hub, max_blocking_time): # <<<<<<<<<<<<<< + * GreenletTracer.__init__(self) + * self.max_blocking_time = max_blocking_time + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("gevent.__tracer._HubTracer.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_tracer.py":128 + * self.hub = hub + * + * def kill(self): # <<<<<<<<<<<<<< + * self.hub = None + * GreenletTracer.kill(self) + */ + +static PyObject *__pyx_pw_6gevent_8__tracer_10_HubTracer_3kill(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_f_6gevent_8__tracer_10_HubTracer_kill(struct __pyx_obj_6gevent_8__tracer__HubTracer *__pyx_v_self, int __pyx_skip_dispatch) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + __Pyx_RefNannySetupContext("kill", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0; + if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self)))))); + else { + PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + #endif + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_kill); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 128, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_8__tracer_10_HubTracer_3kill)) { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 128, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0; + if (unlikely(type_dict_guard != tp_dict_version)) { + tp_dict_version = obj_dict_version = 0; + } + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + } + #endif + } + + /* "src/gevent/_tracer.py":129 + * + * def kill(self): + * self.hub = None # <<<<<<<<<<<<<< + * GreenletTracer.kill(self) + * + */ + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->hub); + __Pyx_DECREF(__pyx_v_self->hub); + __pyx_v_self->hub = Py_None; + + /* "src/gevent/_tracer.py":130 + * def kill(self): + * self.hub = None + * GreenletTracer.kill(self) # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_1 = __pyx_f_6gevent_8__tracer_14GreenletTracer_kill(((struct __pyx_obj_6gevent_8__tracer_GreenletTracer *)__pyx_v_self), 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 130, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_tracer.py":128 + * self.hub = hub + * + * def kill(self): # <<<<<<<<<<<<<< + * self.hub = None + * GreenletTracer.kill(self) + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("gevent.__tracer._HubTracer.kill", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_8__tracer_10_HubTracer_3kill(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6gevent_8__tracer_10_HubTracer_2kill[] = "_HubTracer.kill(self)"; +static PyMethodDef __pyx_mdef_6gevent_8__tracer_10_HubTracer_3kill = {"kill", (PyCFunction)__pyx_pw_6gevent_8__tracer_10_HubTracer_3kill, METH_NOARGS, __pyx_doc_6gevent_8__tracer_10_HubTracer_2kill}; +static PyObject *__pyx_pw_6gevent_8__tracer_10_HubTracer_3kill(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("kill (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_8__tracer_10_HubTracer_2kill(((struct __pyx_obj_6gevent_8__tracer__HubTracer *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_8__tracer_10_HubTracer_2kill(struct __pyx_obj_6gevent_8__tracer__HubTracer *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("kill", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6gevent_8__tracer_10_HubTracer_kill(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 128, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__tracer._HubTracer.kill", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/__tracer.pxd":31 + * @cython.internal + * cdef class _HubTracer(GreenletTracer): + * cpdef readonly object hub # <<<<<<<<<<<<<< + * cpdef readonly double max_blocking_time + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_8__tracer_10_HubTracer_3hub_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_8__tracer_10_HubTracer_3hub_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_8__tracer_10_HubTracer_3hub___get__(((struct __pyx_obj_6gevent_8__tracer__HubTracer *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_8__tracer_10_HubTracer_3hub___get__(struct __pyx_obj_6gevent_8__tracer__HubTracer *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->hub); + __pyx_r = __pyx_v_self->hub; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/__tracer.pxd":32 + * cdef class _HubTracer(GreenletTracer): + * cpdef readonly object hub + * cpdef readonly double max_blocking_time # <<<<<<<<<<<<<< + * + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_8__tracer_10_HubTracer_17max_blocking_time_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_8__tracer_10_HubTracer_17max_blocking_time_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_8__tracer_10_HubTracer_17max_blocking_time___get__(((struct __pyx_obj_6gevent_8__tracer__HubTracer *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_8__tracer_10_HubTracer_17max_blocking_time___get__(struct __pyx_obj_6gevent_8__tracer__HubTracer *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->max_blocking_time); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 32, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__tracer._HubTracer.max_blocking_time.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_tracer.py":136 + * # A greenlet tracer that records the last time we switched *into* the hub. + * + * def __init__(self, hub, max_blocking_time): # <<<<<<<<<<<<<< + * _HubTracer.__init__(self, hub, max_blocking_time) + * self.last_entered_hub = 0 + */ + +/* Python wrapper */ +static int __pyx_pw_6gevent_8__tracer_15HubSwitchTracer_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6gevent_8__tracer_15HubSwitchTracer_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_hub = 0; + PyObject *__pyx_v_max_blocking_time = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_hub,&__pyx_n_s_max_blocking_time,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_hub)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_max_blocking_time)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(0, 136, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 136, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_hub = values[0]; + __pyx_v_max_blocking_time = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 136, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.__tracer.HubSwitchTracer.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_8__tracer_15HubSwitchTracer___init__(((struct __pyx_obj_6gevent_8__tracer_HubSwitchTracer *)__pyx_v_self), __pyx_v_hub, __pyx_v_max_blocking_time); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_8__tracer_15HubSwitchTracer___init__(struct __pyx_obj_6gevent_8__tracer_HubSwitchTracer *__pyx_v_self, PyObject *__pyx_v_hub, PyObject *__pyx_v_max_blocking_time) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "src/gevent/_tracer.py":137 + * + * def __init__(self, hub, max_blocking_time): + * _HubTracer.__init__(self, hub, max_blocking_time) # <<<<<<<<<<<<<< + * self.last_entered_hub = 0 + * + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_6gevent_8__tracer__HubTracer), __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 137, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + __pyx_t_4 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_4 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[4] = {__pyx_t_3, ((PyObject *)__pyx_v_self), __pyx_v_hub, __pyx_v_max_blocking_time}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 137, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[4] = {__pyx_t_3, ((PyObject *)__pyx_v_self), __pyx_v_hub, __pyx_v_max_blocking_time}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 137, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else + #endif + { + __pyx_t_5 = PyTuple_New(3+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 137, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (__pyx_t_3) { + __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL; + } + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, ((PyObject *)__pyx_v_self)); + __Pyx_INCREF(__pyx_v_hub); + __Pyx_GIVEREF(__pyx_v_hub); + PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_hub); + __Pyx_INCREF(__pyx_v_max_blocking_time); + __Pyx_GIVEREF(__pyx_v_max_blocking_time); + PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_4, __pyx_v_max_blocking_time); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 137, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_tracer.py":138 + * def __init__(self, hub, max_blocking_time): + * _HubTracer.__init__(self, hub, max_blocking_time) + * self.last_entered_hub = 0 # <<<<<<<<<<<<<< + * + * def _trace(self, event, args): + */ + __pyx_v_self->last_entered_hub = 0.0; + + /* "src/gevent/_tracer.py":136 + * # A greenlet tracer that records the last time we switched *into* the hub. + * + * def __init__(self, hub, max_blocking_time): # <<<<<<<<<<<<<< + * _HubTracer.__init__(self, hub, max_blocking_time) + * self.last_entered_hub = 0 + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("gevent.__tracer.HubSwitchTracer.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_tracer.py":140 + * self.last_entered_hub = 0 + * + * def _trace(self, event, args): # <<<<<<<<<<<<<< + * GreenletTracer._trace(self, event, args) + * if self.active_greenlet is self.hub: + */ + +static PyObject *__pyx_pw_6gevent_8__tracer_15HubSwitchTracer_3_trace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_6gevent_8__tracer_15HubSwitchTracer__trace(struct __pyx_obj_6gevent_8__tracer_HubSwitchTracer *__pyx_v_self, PyObject *__pyx_v_event, PyObject *__pyx_v_args, int __pyx_skip_dispatch) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + int __pyx_t_8; + double __pyx_t_9; + __Pyx_RefNannySetupContext("_trace", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0; + if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self)))))); + else { + PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + #endif + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_trace); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 140, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_8__tracer_15HubSwitchTracer_3_trace)) { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; + __pyx_t_5 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_5 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_3)) { + PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_event, __pyx_v_args}; + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 140, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GOTREF(__pyx_t_2); + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { + PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_event, __pyx_v_args}; + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 140, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GOTREF(__pyx_t_2); + } else + #endif + { + __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 140, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (__pyx_t_4) { + __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL; + } + __Pyx_INCREF(__pyx_v_event); + __Pyx_GIVEREF(__pyx_v_event); + PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_event); + __Pyx_INCREF(__pyx_v_args); + __Pyx_GIVEREF(__pyx_v_args); + PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_args); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 140, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0; + if (unlikely(type_dict_guard != tp_dict_version)) { + tp_dict_version = obj_dict_version = 0; + } + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + } + #endif + } + + /* "src/gevent/_tracer.py":141 + * + * def _trace(self, event, args): + * GreenletTracer._trace(self, event, args) # <<<<<<<<<<<<<< + * if self.active_greenlet is self.hub: + * self.last_entered_hub = perf_counter() + */ + __pyx_t_1 = __pyx_f_6gevent_8__tracer_14GreenletTracer__trace(((struct __pyx_obj_6gevent_8__tracer_GreenletTracer *)__pyx_v_self), __pyx_v_event, __pyx_v_args, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 141, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_tracer.py":142 + * def _trace(self, event, args): + * GreenletTracer._trace(self, event, args) + * if self.active_greenlet is self.hub: # <<<<<<<<<<<<<< + * self.last_entered_hub = perf_counter() + * + */ + __pyx_t_7 = (__pyx_v_self->__pyx_base.__pyx_base.active_greenlet == __pyx_v_self->__pyx_base.hub); + __pyx_t_8 = (__pyx_t_7 != 0); + if (__pyx_t_8) { + + /* "src/gevent/_tracer.py":143 + * GreenletTracer._trace(self, event, args) + * if self.active_greenlet is self.hub: + * self.last_entered_hub = perf_counter() # <<<<<<<<<<<<<< + * + * def did_block_hub(self, hub): + */ + __Pyx_INCREF(__pyx_v_6gevent_8__tracer_perf_counter); + __pyx_t_2 = __pyx_v_6gevent_8__tracer_perf_counter; __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 143, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 143, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_self->last_entered_hub = __pyx_t_9; + + /* "src/gevent/_tracer.py":142 + * def _trace(self, event, args): + * GreenletTracer._trace(self, event, args) + * if self.active_greenlet is self.hub: # <<<<<<<<<<<<<< + * self.last_entered_hub = perf_counter() + * + */ + } + + /* "src/gevent/_tracer.py":140 + * self.last_entered_hub = 0 + * + * def _trace(self, event, args): # <<<<<<<<<<<<<< + * GreenletTracer._trace(self, event, args) + * if self.active_greenlet is self.hub: + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("gevent.__tracer.HubSwitchTracer._trace", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_8__tracer_15HubSwitchTracer_3_trace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6gevent_8__tracer_15HubSwitchTracer_2_trace[] = "HubSwitchTracer._trace(self, str event, tuple args)"; +static PyMethodDef __pyx_mdef_6gevent_8__tracer_15HubSwitchTracer_3_trace = {"_trace", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_8__tracer_15HubSwitchTracer_3_trace, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_8__tracer_15HubSwitchTracer_2_trace}; +static PyObject *__pyx_pw_6gevent_8__tracer_15HubSwitchTracer_3_trace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_event = 0; + PyObject *__pyx_v_args = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_trace (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_event,&__pyx_n_s_args,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_event)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("_trace", 1, 2, 2, 1); __PYX_ERR(0, 140, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_trace") < 0)) __PYX_ERR(0, 140, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_event = ((PyObject*)values[0]); + __pyx_v_args = ((PyObject*)values[1]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("_trace", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 140, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.__tracer.HubSwitchTracer._trace", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_event), (&PyString_Type), 1, "event", 1))) __PYX_ERR(0, 140, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_args), (&PyTuple_Type), 1, "args", 1))) __PYX_ERR(0, 140, __pyx_L1_error) + __pyx_r = __pyx_pf_6gevent_8__tracer_15HubSwitchTracer_2_trace(((struct __pyx_obj_6gevent_8__tracer_HubSwitchTracer *)__pyx_v_self), __pyx_v_event, __pyx_v_args); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_8__tracer_15HubSwitchTracer_2_trace(struct __pyx_obj_6gevent_8__tracer_HubSwitchTracer *__pyx_v_self, PyObject *__pyx_v_event, PyObject *__pyx_v_args) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("_trace", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6gevent_8__tracer_15HubSwitchTracer__trace(__pyx_v_self, __pyx_v_event, __pyx_v_args, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 140, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__tracer.HubSwitchTracer._trace", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_tracer.py":145 + * self.last_entered_hub = perf_counter() + * + * def did_block_hub(self, hub): # <<<<<<<<<<<<<< + * if perf_counter() - self.last_entered_hub > self.max_blocking_time: + * return True, self.active_greenlet + */ + +static PyObject *__pyx_pw_6gevent_8__tracer_15HubSwitchTracer_5did_block_hub(PyObject *__pyx_v_self, PyObject *__pyx_v_hub); /*proto*/ +static PyObject *__pyx_f_6gevent_8__tracer_15HubSwitchTracer_did_block_hub(struct __pyx_obj_6gevent_8__tracer_HubSwitchTracer *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_hub, int __pyx_skip_dispatch) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + __Pyx_RefNannySetupContext("did_block_hub", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0; + if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self)))))); + else { + PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + #endif + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_did_block_hub); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 145, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_8__tracer_15HubSwitchTracer_5did_block_hub)) { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_hub) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_hub); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 145, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0; + if (unlikely(type_dict_guard != tp_dict_version)) { + tp_dict_version = obj_dict_version = 0; + } + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + } + #endif + } + + /* "src/gevent/_tracer.py":146 + * + * def did_block_hub(self, hub): + * if perf_counter() - self.last_entered_hub > self.max_blocking_time: # <<<<<<<<<<<<<< + * return True, self.active_greenlet + * + */ + __Pyx_INCREF(__pyx_v_6gevent_8__tracer_perf_counter); + __pyx_t_2 = __pyx_v_6gevent_8__tracer_perf_counter; __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 146, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_self->last_entered_hub); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 146, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyNumber_Subtract(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 146, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_self->__pyx_base.max_blocking_time); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 146, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 146, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 146, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_5) { + + /* "src/gevent/_tracer.py":147 + * def did_block_hub(self, hub): + * if perf_counter() - self.last_entered_hub > self.max_blocking_time: + * return True, self.active_greenlet # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 147, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(Py_True); + __Pyx_GIVEREF(Py_True); + PyTuple_SET_ITEM(__pyx_t_1, 0, Py_True); + __Pyx_INCREF(__pyx_v_self->__pyx_base.__pyx_base.active_greenlet); + __Pyx_GIVEREF(__pyx_v_self->__pyx_base.__pyx_base.active_greenlet); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_self->__pyx_base.__pyx_base.active_greenlet); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "src/gevent/_tracer.py":146 + * + * def did_block_hub(self, hub): + * if perf_counter() - self.last_entered_hub > self.max_blocking_time: # <<<<<<<<<<<<<< + * return True, self.active_greenlet + * + */ + } + + /* "src/gevent/_tracer.py":145 + * self.last_entered_hub = perf_counter() + * + * def did_block_hub(self, hub): # <<<<<<<<<<<<<< + * if perf_counter() - self.last_entered_hub > self.max_blocking_time: + * return True, self.active_greenlet + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("gevent.__tracer.HubSwitchTracer.did_block_hub", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_8__tracer_15HubSwitchTracer_5did_block_hub(PyObject *__pyx_v_self, PyObject *__pyx_v_hub); /*proto*/ +static char __pyx_doc_6gevent_8__tracer_15HubSwitchTracer_4did_block_hub[] = "HubSwitchTracer.did_block_hub(self, hub)"; +static PyMethodDef __pyx_mdef_6gevent_8__tracer_15HubSwitchTracer_5did_block_hub = {"did_block_hub", (PyCFunction)__pyx_pw_6gevent_8__tracer_15HubSwitchTracer_5did_block_hub, METH_O, __pyx_doc_6gevent_8__tracer_15HubSwitchTracer_4did_block_hub}; +static PyObject *__pyx_pw_6gevent_8__tracer_15HubSwitchTracer_5did_block_hub(PyObject *__pyx_v_self, PyObject *__pyx_v_hub) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("did_block_hub (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_8__tracer_15HubSwitchTracer_4did_block_hub(((struct __pyx_obj_6gevent_8__tracer_HubSwitchTracer *)__pyx_v_self), ((PyObject *)__pyx_v_hub)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_8__tracer_15HubSwitchTracer_4did_block_hub(struct __pyx_obj_6gevent_8__tracer_HubSwitchTracer *__pyx_v_self, PyObject *__pyx_v_hub) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("did_block_hub", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6gevent_8__tracer_15HubSwitchTracer_did_block_hub(__pyx_v_self, __pyx_v_hub, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 145, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__tracer.HubSwitchTracer.did_block_hub", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/__tracer.pxd":36 + * + * cdef class HubSwitchTracer(_HubTracer): + * cpdef readonly double last_entered_hub # <<<<<<<<<<<<<< + * + * cdef class MaxSwitchTracer(_HubTracer): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_8__tracer_15HubSwitchTracer_16last_entered_hub_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_8__tracer_15HubSwitchTracer_16last_entered_hub_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_8__tracer_15HubSwitchTracer_16last_entered_hub___get__(((struct __pyx_obj_6gevent_8__tracer_HubSwitchTracer *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_8__tracer_15HubSwitchTracer_16last_entered_hub___get__(struct __pyx_obj_6gevent_8__tracer_HubSwitchTracer *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->last_entered_hub); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 36, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__tracer.HubSwitchTracer.last_entered_hub.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_tracer.py":154 + * # not including time spent in the hub. + * + * def __init__(self, hub, max_blocking_time): # <<<<<<<<<<<<<< + * _HubTracer.__init__(self, hub, max_blocking_time) + * self.last_switch = perf_counter() + */ + +/* Python wrapper */ +static int __pyx_pw_6gevent_8__tracer_15MaxSwitchTracer_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6gevent_8__tracer_15MaxSwitchTracer_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_hub = 0; + PyObject *__pyx_v_max_blocking_time = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_hub,&__pyx_n_s_max_blocking_time,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_hub)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_max_blocking_time)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(0, 154, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 154, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_hub = values[0]; + __pyx_v_max_blocking_time = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 154, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.__tracer.MaxSwitchTracer.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_8__tracer_15MaxSwitchTracer___init__(((struct __pyx_obj_6gevent_8__tracer_MaxSwitchTracer *)__pyx_v_self), __pyx_v_hub, __pyx_v_max_blocking_time); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_8__tracer_15MaxSwitchTracer___init__(struct __pyx_obj_6gevent_8__tracer_MaxSwitchTracer *__pyx_v_self, PyObject *__pyx_v_hub, PyObject *__pyx_v_max_blocking_time) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + double __pyx_t_6; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "src/gevent/_tracer.py":155 + * + * def __init__(self, hub, max_blocking_time): + * _HubTracer.__init__(self, hub, max_blocking_time) # <<<<<<<<<<<<<< + * self.last_switch = perf_counter() + * self.max_blocking = 0 + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_6gevent_8__tracer__HubTracer), __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 155, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + __pyx_t_4 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_4 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[4] = {__pyx_t_3, ((PyObject *)__pyx_v_self), __pyx_v_hub, __pyx_v_max_blocking_time}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 155, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[4] = {__pyx_t_3, ((PyObject *)__pyx_v_self), __pyx_v_hub, __pyx_v_max_blocking_time}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 155, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else + #endif + { + __pyx_t_5 = PyTuple_New(3+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 155, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (__pyx_t_3) { + __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL; + } + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, ((PyObject *)__pyx_v_self)); + __Pyx_INCREF(__pyx_v_hub); + __Pyx_GIVEREF(__pyx_v_hub); + PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_hub); + __Pyx_INCREF(__pyx_v_max_blocking_time); + __Pyx_GIVEREF(__pyx_v_max_blocking_time); + PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_4, __pyx_v_max_blocking_time); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 155, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_tracer.py":156 + * def __init__(self, hub, max_blocking_time): + * _HubTracer.__init__(self, hub, max_blocking_time) + * self.last_switch = perf_counter() # <<<<<<<<<<<<<< + * self.max_blocking = 0 + * + */ + __Pyx_INCREF(__pyx_v_6gevent_8__tracer_perf_counter); + __pyx_t_2 = __pyx_v_6gevent_8__tracer_perf_counter; __pyx_t_5 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 156, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_6 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 156, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_self->last_switch = __pyx_t_6; + + /* "src/gevent/_tracer.py":157 + * _HubTracer.__init__(self, hub, max_blocking_time) + * self.last_switch = perf_counter() + * self.max_blocking = 0 # <<<<<<<<<<<<<< + * + * def _trace(self, event, args): + */ + __pyx_v_self->max_blocking = 0.0; + + /* "src/gevent/_tracer.py":154 + * # not including time spent in the hub. + * + * def __init__(self, hub, max_blocking_time): # <<<<<<<<<<<<<< + * _HubTracer.__init__(self, hub, max_blocking_time) + * self.last_switch = perf_counter() + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("gevent.__tracer.MaxSwitchTracer.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_tracer.py":159 + * self.max_blocking = 0 + * + * def _trace(self, event, args): # <<<<<<<<<<<<<< + * old_active = self.active_greenlet + * GreenletTracer._trace(self, event, args) + */ + +static PyObject *__pyx_pw_6gevent_8__tracer_15MaxSwitchTracer_3_trace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_6gevent_8__tracer_15MaxSwitchTracer__trace(struct __pyx_obj_6gevent_8__tracer_MaxSwitchTracer *__pyx_v_self, PyObject *__pyx_v_event, PyObject *__pyx_v_args, int __pyx_skip_dispatch) { + double __pyx_v_switched_at; + PyObject *__pyx_v_old_active = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + int __pyx_t_8; + int __pyx_t_9; + double __pyx_t_10; + double __pyx_t_11; + double __pyx_t_12; + __Pyx_RefNannySetupContext("_trace", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0; + if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self)))))); + else { + PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + #endif + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_trace); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 159, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_8__tracer_15MaxSwitchTracer_3_trace)) { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; + __pyx_t_5 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_5 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_3)) { + PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_event, __pyx_v_args}; + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 159, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GOTREF(__pyx_t_2); + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { + PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_event, __pyx_v_args}; + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 159, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GOTREF(__pyx_t_2); + } else + #endif + { + __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 159, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (__pyx_t_4) { + __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL; + } + __Pyx_INCREF(__pyx_v_event); + __Pyx_GIVEREF(__pyx_v_event); + PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_event); + __Pyx_INCREF(__pyx_v_args); + __Pyx_GIVEREF(__pyx_v_args); + PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_args); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 159, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0; + if (unlikely(type_dict_guard != tp_dict_version)) { + tp_dict_version = obj_dict_version = 0; + } + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + } + #endif + } + + /* "src/gevent/_tracer.py":160 + * + * def _trace(self, event, args): + * old_active = self.active_greenlet # <<<<<<<<<<<<<< + * GreenletTracer._trace(self, event, args) + * if old_active is not self.hub and old_active is not None: + */ + __pyx_t_1 = __pyx_v_self->__pyx_base.__pyx_base.active_greenlet; + __Pyx_INCREF(__pyx_t_1); + __pyx_v_old_active = __pyx_t_1; + __pyx_t_1 = 0; + + /* "src/gevent/_tracer.py":161 + * def _trace(self, event, args): + * old_active = self.active_greenlet + * GreenletTracer._trace(self, event, args) # <<<<<<<<<<<<<< + * if old_active is not self.hub and old_active is not None: + * # If we're switching out of the hub, the blocking + */ + __pyx_t_1 = __pyx_f_6gevent_8__tracer_14GreenletTracer__trace(((struct __pyx_obj_6gevent_8__tracer_GreenletTracer *)__pyx_v_self), __pyx_v_event, __pyx_v_args, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 161, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_tracer.py":162 + * old_active = self.active_greenlet + * GreenletTracer._trace(self, event, args) + * if old_active is not self.hub and old_active is not None: # <<<<<<<<<<<<<< + * # If we're switching out of the hub, the blocking + * # time doesn't count. + */ + __pyx_t_8 = (__pyx_v_old_active != __pyx_v_self->__pyx_base.hub); + __pyx_t_9 = (__pyx_t_8 != 0); + if (__pyx_t_9) { + } else { + __pyx_t_7 = __pyx_t_9; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_9 = (__pyx_v_old_active != Py_None); + __pyx_t_8 = (__pyx_t_9 != 0); + __pyx_t_7 = __pyx_t_8; + __pyx_L4_bool_binop_done:; + if (__pyx_t_7) { + + /* "src/gevent/_tracer.py":165 + * # If we're switching out of the hub, the blocking + * # time doesn't count. + * switched_at = perf_counter() # <<<<<<<<<<<<<< + * self.max_blocking = max(self.max_blocking, + * switched_at - self.last_switch) + */ + __Pyx_INCREF(__pyx_v_6gevent_8__tracer_perf_counter); + __pyx_t_2 = __pyx_v_6gevent_8__tracer_perf_counter; __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 165, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 165, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_switched_at = __pyx_t_10; + + /* "src/gevent/_tracer.py":167 + * switched_at = perf_counter() + * self.max_blocking = max(self.max_blocking, + * switched_at - self.last_switch) # <<<<<<<<<<<<<< + * + * def did_block_hub(self, hub): + */ + __pyx_t_10 = (__pyx_v_switched_at - __pyx_v_self->last_switch); + + /* "src/gevent/_tracer.py":166 + * # time doesn't count. + * switched_at = perf_counter() + * self.max_blocking = max(self.max_blocking, # <<<<<<<<<<<<<< + * switched_at - self.last_switch) + * + */ + __pyx_t_11 = __pyx_v_self->max_blocking; + + /* "src/gevent/_tracer.py":167 + * switched_at = perf_counter() + * self.max_blocking = max(self.max_blocking, + * switched_at - self.last_switch) # <<<<<<<<<<<<<< + * + * def did_block_hub(self, hub): + */ + if (((__pyx_t_10 > __pyx_t_11) != 0)) { + __pyx_t_12 = __pyx_t_10; + } else { + __pyx_t_12 = __pyx_t_11; + } + + /* "src/gevent/_tracer.py":166 + * # time doesn't count. + * switched_at = perf_counter() + * self.max_blocking = max(self.max_blocking, # <<<<<<<<<<<<<< + * switched_at - self.last_switch) + * + */ + __pyx_v_self->max_blocking = __pyx_t_12; + + /* "src/gevent/_tracer.py":162 + * old_active = self.active_greenlet + * GreenletTracer._trace(self, event, args) + * if old_active is not self.hub and old_active is not None: # <<<<<<<<<<<<<< + * # If we're switching out of the hub, the blocking + * # time doesn't count. + */ + } + + /* "src/gevent/_tracer.py":159 + * self.max_blocking = 0 + * + * def _trace(self, event, args): # <<<<<<<<<<<<<< + * old_active = self.active_greenlet + * GreenletTracer._trace(self, event, args) + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("gevent.__tracer.MaxSwitchTracer._trace", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_old_active); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_8__tracer_15MaxSwitchTracer_3_trace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6gevent_8__tracer_15MaxSwitchTracer_2_trace[] = "MaxSwitchTracer._trace(self, str event, tuple args)"; +static PyMethodDef __pyx_mdef_6gevent_8__tracer_15MaxSwitchTracer_3_trace = {"_trace", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_8__tracer_15MaxSwitchTracer_3_trace, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_8__tracer_15MaxSwitchTracer_2_trace}; +static PyObject *__pyx_pw_6gevent_8__tracer_15MaxSwitchTracer_3_trace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_event = 0; + PyObject *__pyx_v_args = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_trace (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_event,&__pyx_n_s_args,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_event)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("_trace", 1, 2, 2, 1); __PYX_ERR(0, 159, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_trace") < 0)) __PYX_ERR(0, 159, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_event = ((PyObject*)values[0]); + __pyx_v_args = ((PyObject*)values[1]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("_trace", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 159, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.__tracer.MaxSwitchTracer._trace", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_event), (&PyString_Type), 1, "event", 1))) __PYX_ERR(0, 159, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_args), (&PyTuple_Type), 1, "args", 1))) __PYX_ERR(0, 159, __pyx_L1_error) + __pyx_r = __pyx_pf_6gevent_8__tracer_15MaxSwitchTracer_2_trace(((struct __pyx_obj_6gevent_8__tracer_MaxSwitchTracer *)__pyx_v_self), __pyx_v_event, __pyx_v_args); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_8__tracer_15MaxSwitchTracer_2_trace(struct __pyx_obj_6gevent_8__tracer_MaxSwitchTracer *__pyx_v_self, PyObject *__pyx_v_event, PyObject *__pyx_v_args) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("_trace", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6gevent_8__tracer_15MaxSwitchTracer__trace(__pyx_v_self, __pyx_v_event, __pyx_v_args, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 159, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__tracer.MaxSwitchTracer._trace", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_tracer.py":169 + * switched_at - self.last_switch) + * + * def did_block_hub(self, hub): # <<<<<<<<<<<<<< + * if self.max_blocking == 0: + * # We never switched. Check the time now + */ + +static PyObject *__pyx_pw_6gevent_8__tracer_15MaxSwitchTracer_5did_block_hub(PyObject *__pyx_v_self, PyObject *__pyx_v_hub); /*proto*/ +static PyObject *__pyx_f_6gevent_8__tracer_15MaxSwitchTracer_did_block_hub(struct __pyx_obj_6gevent_8__tracer_MaxSwitchTracer *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_hub, int __pyx_skip_dispatch) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + double __pyx_t_6; + __Pyx_RefNannySetupContext("did_block_hub", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0; + if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self)))))); + else { + PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + #endif + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_did_block_hub); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 169, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_8__tracer_15MaxSwitchTracer_5did_block_hub)) { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_hub) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_hub); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 169, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0; + if (unlikely(type_dict_guard != tp_dict_version)) { + tp_dict_version = obj_dict_version = 0; + } + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + } + #endif + } + + /* "src/gevent/_tracer.py":170 + * + * def did_block_hub(self, hub): + * if self.max_blocking == 0: # <<<<<<<<<<<<<< + * # We never switched. Check the time now + * self.max_blocking = perf_counter() - self.last_switch + */ + __pyx_t_5 = ((__pyx_v_self->max_blocking == 0.0) != 0); + if (__pyx_t_5) { + + /* "src/gevent/_tracer.py":172 + * if self.max_blocking == 0: + * # We never switched. Check the time now + * self.max_blocking = perf_counter() - self.last_switch # <<<<<<<<<<<<<< + * + * if self.max_blocking > self.max_blocking_time: + */ + __Pyx_INCREF(__pyx_v_6gevent_8__tracer_perf_counter); + __pyx_t_2 = __pyx_v_6gevent_8__tracer_perf_counter; __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 172, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_self->last_switch); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 172, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyNumber_Subtract(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 172, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_6 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 172, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_self->max_blocking = __pyx_t_6; + + /* "src/gevent/_tracer.py":170 + * + * def did_block_hub(self, hub): + * if self.max_blocking == 0: # <<<<<<<<<<<<<< + * # We never switched. Check the time now + * self.max_blocking = perf_counter() - self.last_switch + */ + } + + /* "src/gevent/_tracer.py":174 + * self.max_blocking = perf_counter() - self.last_switch + * + * if self.max_blocking > self.max_blocking_time: # <<<<<<<<<<<<<< + * return True, self.active_greenlet + * + */ + __pyx_t_5 = ((__pyx_v_self->max_blocking > __pyx_v_self->__pyx_base.max_blocking_time) != 0); + if (__pyx_t_5) { + + /* "src/gevent/_tracer.py":175 + * + * if self.max_blocking > self.max_blocking_time: + * return True, self.active_greenlet # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 175, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(Py_True); + __Pyx_GIVEREF(Py_True); + PyTuple_SET_ITEM(__pyx_t_3, 0, Py_True); + __Pyx_INCREF(__pyx_v_self->__pyx_base.__pyx_base.active_greenlet); + __Pyx_GIVEREF(__pyx_v_self->__pyx_base.__pyx_base.active_greenlet); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_self->__pyx_base.__pyx_base.active_greenlet); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "src/gevent/_tracer.py":174 + * self.max_blocking = perf_counter() - self.last_switch + * + * if self.max_blocking > self.max_blocking_time: # <<<<<<<<<<<<<< + * return True, self.active_greenlet + * + */ + } + + /* "src/gevent/_tracer.py":169 + * switched_at - self.last_switch) + * + * def did_block_hub(self, hub): # <<<<<<<<<<<<<< + * if self.max_blocking == 0: + * # We never switched. Check the time now + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("gevent.__tracer.MaxSwitchTracer.did_block_hub", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_8__tracer_15MaxSwitchTracer_5did_block_hub(PyObject *__pyx_v_self, PyObject *__pyx_v_hub); /*proto*/ +static char __pyx_doc_6gevent_8__tracer_15MaxSwitchTracer_4did_block_hub[] = "MaxSwitchTracer.did_block_hub(self, hub)"; +static PyMethodDef __pyx_mdef_6gevent_8__tracer_15MaxSwitchTracer_5did_block_hub = {"did_block_hub", (PyCFunction)__pyx_pw_6gevent_8__tracer_15MaxSwitchTracer_5did_block_hub, METH_O, __pyx_doc_6gevent_8__tracer_15MaxSwitchTracer_4did_block_hub}; +static PyObject *__pyx_pw_6gevent_8__tracer_15MaxSwitchTracer_5did_block_hub(PyObject *__pyx_v_self, PyObject *__pyx_v_hub) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("did_block_hub (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_8__tracer_15MaxSwitchTracer_4did_block_hub(((struct __pyx_obj_6gevent_8__tracer_MaxSwitchTracer *)__pyx_v_self), ((PyObject *)__pyx_v_hub)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_8__tracer_15MaxSwitchTracer_4did_block_hub(struct __pyx_obj_6gevent_8__tracer_MaxSwitchTracer *__pyx_v_self, PyObject *__pyx_v_hub) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("did_block_hub", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6gevent_8__tracer_15MaxSwitchTracer_did_block_hub(__pyx_v_self, __pyx_v_hub, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 169, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__tracer.MaxSwitchTracer.did_block_hub", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/__tracer.pxd":39 + * + * cdef class MaxSwitchTracer(_HubTracer): + * cpdef readonly double max_blocking # <<<<<<<<<<<<<< + * cpdef readonly double last_switch + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_8__tracer_15MaxSwitchTracer_12max_blocking_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_8__tracer_15MaxSwitchTracer_12max_blocking_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_8__tracer_15MaxSwitchTracer_12max_blocking___get__(((struct __pyx_obj_6gevent_8__tracer_MaxSwitchTracer *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_8__tracer_15MaxSwitchTracer_12max_blocking___get__(struct __pyx_obj_6gevent_8__tracer_MaxSwitchTracer *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->max_blocking); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 39, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__tracer.MaxSwitchTracer.max_blocking.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/__tracer.pxd":40 + * cdef class MaxSwitchTracer(_HubTracer): + * cpdef readonly double max_blocking + * cpdef readonly double last_switch # <<<<<<<<<<<<<< + * + * @cython.locals(switched_at=double) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_8__tracer_15MaxSwitchTracer_11last_switch_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_8__tracer_15MaxSwitchTracer_11last_switch_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_8__tracer_15MaxSwitchTracer_11last_switch___get__(((struct __pyx_obj_6gevent_8__tracer_MaxSwitchTracer *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_8__tracer_15MaxSwitchTracer_11last_switch___get__(struct __pyx_obj_6gevent_8__tracer_MaxSwitchTracer *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->last_switch); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 40, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__tracer.MaxSwitchTracer.last_switch.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} +static struct __pyx_vtabstruct_6gevent_8__tracer_GreenletTracer __pyx_vtable_6gevent_8__tracer_GreenletTracer; + +static PyObject *__pyx_tp_new_6gevent_8__tracer_GreenletTracer(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + struct __pyx_obj_6gevent_8__tracer_GreenletTracer *p; + PyObject *o; + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_6gevent_8__tracer_GreenletTracer *)o); + p->__pyx_vtab = __pyx_vtabptr_6gevent_8__tracer_GreenletTracer; + p->active_greenlet = Py_None; Py_INCREF(Py_None); + p->previous_trace_function = Py_None; Py_INCREF(Py_None); + return o; +} + +static void __pyx_tp_dealloc_6gevent_8__tracer_GreenletTracer(PyObject *o) { + struct __pyx_obj_6gevent_8__tracer_GreenletTracer *p = (struct __pyx_obj_6gevent_8__tracer_GreenletTracer *)o; + #if CYTHON_USE_TP_FINALIZE + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + PyObject_GC_UnTrack(o); + Py_CLEAR(p->active_greenlet); + Py_CLEAR(p->previous_trace_function); + (*Py_TYPE(o)->tp_free)(o); +} + +static int __pyx_tp_traverse_6gevent_8__tracer_GreenletTracer(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_6gevent_8__tracer_GreenletTracer *p = (struct __pyx_obj_6gevent_8__tracer_GreenletTracer *)o; + if (p->active_greenlet) { + e = (*v)(p->active_greenlet, a); if (e) return e; + } + if (p->previous_trace_function) { + e = (*v)(p->previous_trace_function, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_6gevent_8__tracer_GreenletTracer(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_6gevent_8__tracer_GreenletTracer *p = (struct __pyx_obj_6gevent_8__tracer_GreenletTracer *)o; + tmp = ((PyObject*)p->active_greenlet); + p->active_greenlet = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->previous_trace_function); + p->previous_trace_function = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyObject *__pyx_getprop_6gevent_8__tracer_14GreenletTracer_active_greenlet(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_8__tracer_14GreenletTracer_15active_greenlet_1__get__(o); +} + +static PyObject *__pyx_getprop_6gevent_8__tracer_14GreenletTracer_previous_trace_function(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_8__tracer_14GreenletTracer_23previous_trace_function_1__get__(o); +} + +static PyObject *__pyx_getprop_6gevent_8__tracer_14GreenletTracer_greenlet_switch_counter(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_8__tracer_14GreenletTracer_23greenlet_switch_counter_1__get__(o); +} + +static PyMethodDef __pyx_methods_6gevent_8__tracer_GreenletTracer[] = { + {"ignore_current_greenlet_blocking", (PyCFunction)__pyx_pw_6gevent_8__tracer_14GreenletTracer_11ignore_current_greenlet_blocking, METH_NOARGS, __pyx_doc_6gevent_8__tracer_14GreenletTracer_10ignore_current_greenlet_blocking}, + {"monitor_current_greenlet_blocking", (PyCFunction)__pyx_pw_6gevent_8__tracer_14GreenletTracer_13monitor_current_greenlet_blocking, METH_NOARGS, __pyx_doc_6gevent_8__tracer_14GreenletTracer_12monitor_current_greenlet_blocking}, + {"did_block_hub_report", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_8__tracer_14GreenletTracer_15did_block_hub_report, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_8__tracer_14GreenletTracer_14did_block_hub_report}, + {0, 0, 0, 0} +}; + +static struct PyGetSetDef __pyx_getsets_6gevent_8__tracer_GreenletTracer[] = { + {(char *)"active_greenlet", __pyx_getprop_6gevent_8__tracer_14GreenletTracer_active_greenlet, 0, (char *)0, 0}, + {(char *)"previous_trace_function", __pyx_getprop_6gevent_8__tracer_14GreenletTracer_previous_trace_function, 0, (char *)0, 0}, + {(char *)"greenlet_switch_counter", __pyx_getprop_6gevent_8__tracer_14GreenletTracer_greenlet_switch_counter, 0, (char *)0, 0}, + {0, 0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_6gevent_8__tracer_GreenletTracer = { + PyVarObject_HEAD_INIT(0, 0) + "gevent.__tracer.GreenletTracer", /*tp_name*/ + sizeof(struct __pyx_obj_6gevent_8__tracer_GreenletTracer), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6gevent_8__tracer_GreenletTracer, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + __pyx_pw_6gevent_8__tracer_14GreenletTracer_7__call__, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + "GreenletTracer()", /*tp_doc*/ + __pyx_tp_traverse_6gevent_8__tracer_GreenletTracer, /*tp_traverse*/ + __pyx_tp_clear_6gevent_8__tracer_GreenletTracer, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6gevent_8__tracer_GreenletTracer, /*tp_methods*/ + 0, /*tp_members*/ + __pyx_getsets_6gevent_8__tracer_GreenletTracer, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_pw_6gevent_8__tracer_14GreenletTracer_1__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6gevent_8__tracer_GreenletTracer, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; +static struct __pyx_vtabstruct_6gevent_8__tracer__HubTracer __pyx_vtable_6gevent_8__tracer__HubTracer; + +static PyObject *__pyx_tp_new_6gevent_8__tracer__HubTracer(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_6gevent_8__tracer__HubTracer *p; + PyObject *o = __pyx_tp_new_6gevent_8__tracer_GreenletTracer(t, a, k); + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_6gevent_8__tracer__HubTracer *)o); + p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_6gevent_8__tracer_GreenletTracer*)__pyx_vtabptr_6gevent_8__tracer__HubTracer; + p->hub = Py_None; Py_INCREF(Py_None); + return o; +} + +static void __pyx_tp_dealloc_6gevent_8__tracer__HubTracer(PyObject *o) { + struct __pyx_obj_6gevent_8__tracer__HubTracer *p = (struct __pyx_obj_6gevent_8__tracer__HubTracer *)o; + #if CYTHON_USE_TP_FINALIZE + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + PyObject_GC_UnTrack(o); + Py_CLEAR(p->hub); + PyObject_GC_Track(o); + __pyx_tp_dealloc_6gevent_8__tracer_GreenletTracer(o); +} + +static int __pyx_tp_traverse_6gevent_8__tracer__HubTracer(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_6gevent_8__tracer__HubTracer *p = (struct __pyx_obj_6gevent_8__tracer__HubTracer *)o; + e = __pyx_tp_traverse_6gevent_8__tracer_GreenletTracer(o, v, a); if (e) return e; + if (p->hub) { + e = (*v)(p->hub, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_6gevent_8__tracer__HubTracer(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_6gevent_8__tracer__HubTracer *p = (struct __pyx_obj_6gevent_8__tracer__HubTracer *)o; + __pyx_tp_clear_6gevent_8__tracer_GreenletTracer(o); + tmp = ((PyObject*)p->hub); + p->hub = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyObject *__pyx_getprop_6gevent_8__tracer_10_HubTracer_hub(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_8__tracer_10_HubTracer_3hub_1__get__(o); +} + +static PyObject *__pyx_getprop_6gevent_8__tracer_10_HubTracer_max_blocking_time(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_8__tracer_10_HubTracer_17max_blocking_time_1__get__(o); +} + +static PyMethodDef __pyx_methods_6gevent_8__tracer__HubTracer[] = { + {0, 0, 0, 0} +}; + +static struct PyGetSetDef __pyx_getsets_6gevent_8__tracer__HubTracer[] = { + {(char *)"hub", __pyx_getprop_6gevent_8__tracer_10_HubTracer_hub, 0, (char *)0, 0}, + {(char *)"max_blocking_time", __pyx_getprop_6gevent_8__tracer_10_HubTracer_max_blocking_time, 0, (char *)0, 0}, + {0, 0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_6gevent_8__tracer__HubTracer = { + PyVarObject_HEAD_INIT(0, 0) + "gevent.__tracer._HubTracer", /*tp_name*/ + sizeof(struct __pyx_obj_6gevent_8__tracer__HubTracer), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6gevent_8__tracer__HubTracer, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_6gevent_8__tracer_14GreenletTracer_7__call__, /*tp_call*/ + #else + 0, /*tp_call*/ + #endif + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + "_HubTracer(hub, max_blocking_time)", /*tp_doc*/ + __pyx_tp_traverse_6gevent_8__tracer__HubTracer, /*tp_traverse*/ + __pyx_tp_clear_6gevent_8__tracer__HubTracer, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6gevent_8__tracer__HubTracer, /*tp_methods*/ + 0, /*tp_members*/ + __pyx_getsets_6gevent_8__tracer__HubTracer, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_pw_6gevent_8__tracer_10_HubTracer_1__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6gevent_8__tracer__HubTracer, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; +static struct __pyx_vtabstruct_6gevent_8__tracer_HubSwitchTracer __pyx_vtable_6gevent_8__tracer_HubSwitchTracer; + +static PyObject *__pyx_tp_new_6gevent_8__tracer_HubSwitchTracer(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_6gevent_8__tracer_HubSwitchTracer *p; + PyObject *o = __pyx_tp_new_6gevent_8__tracer__HubTracer(t, a, k); + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_6gevent_8__tracer_HubSwitchTracer *)o); + p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_6gevent_8__tracer_GreenletTracer*)__pyx_vtabptr_6gevent_8__tracer_HubSwitchTracer; + return o; +} + +static PyObject *__pyx_getprop_6gevent_8__tracer_15HubSwitchTracer_last_entered_hub(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_8__tracer_15HubSwitchTracer_16last_entered_hub_1__get__(o); +} + +static PyMethodDef __pyx_methods_6gevent_8__tracer_HubSwitchTracer[] = { + {0, 0, 0, 0} +}; + +static struct PyGetSetDef __pyx_getsets_6gevent_8__tracer_HubSwitchTracer[] = { + {(char *)"last_entered_hub", __pyx_getprop_6gevent_8__tracer_15HubSwitchTracer_last_entered_hub, 0, (char *)0, 0}, + {0, 0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_6gevent_8__tracer_HubSwitchTracer = { + PyVarObject_HEAD_INIT(0, 0) + "gevent.__tracer.HubSwitchTracer", /*tp_name*/ + sizeof(struct __pyx_obj_6gevent_8__tracer_HubSwitchTracer), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6gevent_8__tracer__HubTracer, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_6gevent_8__tracer_14GreenletTracer_7__call__, /*tp_call*/ + #else + 0, /*tp_call*/ + #endif + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + "HubSwitchTracer(hub, max_blocking_time)", /*tp_doc*/ + __pyx_tp_traverse_6gevent_8__tracer__HubTracer, /*tp_traverse*/ + __pyx_tp_clear_6gevent_8__tracer__HubTracer, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6gevent_8__tracer_HubSwitchTracer, /*tp_methods*/ + 0, /*tp_members*/ + __pyx_getsets_6gevent_8__tracer_HubSwitchTracer, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_pw_6gevent_8__tracer_15HubSwitchTracer_1__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6gevent_8__tracer_HubSwitchTracer, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; +static struct __pyx_vtabstruct_6gevent_8__tracer_MaxSwitchTracer __pyx_vtable_6gevent_8__tracer_MaxSwitchTracer; + +static PyObject *__pyx_tp_new_6gevent_8__tracer_MaxSwitchTracer(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_6gevent_8__tracer_MaxSwitchTracer *p; + PyObject *o = __pyx_tp_new_6gevent_8__tracer__HubTracer(t, a, k); + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_6gevent_8__tracer_MaxSwitchTracer *)o); + p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_6gevent_8__tracer_GreenletTracer*)__pyx_vtabptr_6gevent_8__tracer_MaxSwitchTracer; + return o; +} + +static PyObject *__pyx_getprop_6gevent_8__tracer_15MaxSwitchTracer_max_blocking(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_8__tracer_15MaxSwitchTracer_12max_blocking_1__get__(o); +} + +static PyObject *__pyx_getprop_6gevent_8__tracer_15MaxSwitchTracer_last_switch(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_8__tracer_15MaxSwitchTracer_11last_switch_1__get__(o); +} + +static PyMethodDef __pyx_methods_6gevent_8__tracer_MaxSwitchTracer[] = { + {0, 0, 0, 0} +}; + +static struct PyGetSetDef __pyx_getsets_6gevent_8__tracer_MaxSwitchTracer[] = { + {(char *)"max_blocking", __pyx_getprop_6gevent_8__tracer_15MaxSwitchTracer_max_blocking, 0, (char *)0, 0}, + {(char *)"last_switch", __pyx_getprop_6gevent_8__tracer_15MaxSwitchTracer_last_switch, 0, (char *)0, 0}, + {0, 0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_6gevent_8__tracer_MaxSwitchTracer = { + PyVarObject_HEAD_INIT(0, 0) + "gevent.__tracer.MaxSwitchTracer", /*tp_name*/ + sizeof(struct __pyx_obj_6gevent_8__tracer_MaxSwitchTracer), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6gevent_8__tracer__HubTracer, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_6gevent_8__tracer_14GreenletTracer_7__call__, /*tp_call*/ + #else + 0, /*tp_call*/ + #endif + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + "MaxSwitchTracer(hub, max_blocking_time)", /*tp_doc*/ + __pyx_tp_traverse_6gevent_8__tracer__HubTracer, /*tp_traverse*/ + __pyx_tp_clear_6gevent_8__tracer__HubTracer, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6gevent_8__tracer_MaxSwitchTracer, /*tp_methods*/ + 0, /*tp_members*/ + __pyx_getsets_6gevent_8__tracer_MaxSwitchTracer, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_pw_6gevent_8__tracer_15MaxSwitchTracer_1__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6gevent_8__tracer_MaxSwitchTracer, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static PyMethodDef __pyx_methods[] = { + {0, 0, 0, 0} +}; + +#if PY_MAJOR_VERSION >= 3 +#if CYTHON_PEP489_MULTI_PHASE_INIT +static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ +static int __pyx_pymod_exec___tracer(PyObject* module); /*proto*/ +static PyModuleDef_Slot __pyx_moduledef_slots[] = { + {Py_mod_create, (void*)__pyx_pymod_create}, + {Py_mod_exec, (void*)__pyx_pymod_exec___tracer}, + {0, NULL} +}; +#endif + +static struct PyModuleDef __pyx_moduledef = { + PyModuleDef_HEAD_INIT, + "__tracer", + 0, /* m_doc */ + #if CYTHON_PEP489_MULTI_PHASE_INIT + 0, /* m_size */ + #else + -1, /* m_size */ + #endif + __pyx_methods /* m_methods */, + #if CYTHON_PEP489_MULTI_PHASE_INIT + __pyx_moduledef_slots, /* m_slots */ + #else + NULL, /* m_reload */ + #endif + NULL, /* m_traverse */ + NULL, /* m_clear */ + NULL /* m_free */ +}; +#endif +#ifndef CYTHON_SMALL_CODE +#if defined(__clang__) + #define CYTHON_SMALL_CODE +#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) + #define CYTHON_SMALL_CODE __attribute__((cold)) +#else + #define CYTHON_SMALL_CODE +#endif +#endif + +static __Pyx_StringTabEntry __pyx_string_tab[] = { + {&__pyx_kp_s_Blocked_Stack_for_thread_id_s, __pyx_k_Blocked_Stack_for_thread_id_s, sizeof(__pyx_k_Blocked_Stack_for_thread_id_s), 0, 0, 1, 0}, + {&__pyx_n_s_GreenletTracer, __pyx_k_GreenletTracer, sizeof(__pyx_k_GreenletTracer), 0, 0, 1, 1}, + {&__pyx_n_s_GreenletTracer__trace, __pyx_k_GreenletTracer__trace, sizeof(__pyx_k_GreenletTracer__trace), 0, 0, 1, 1}, + {&__pyx_n_s_GreenletTracer_did_block_hub, __pyx_k_GreenletTracer_did_block_hub, sizeof(__pyx_k_GreenletTracer_did_block_hub), 0, 0, 1, 1}, + {&__pyx_n_s_GreenletTracer_did_block_hub_rep, __pyx_k_GreenletTracer_did_block_hub_rep, sizeof(__pyx_k_GreenletTracer_did_block_hub_rep), 0, 0, 1, 1}, + {&__pyx_n_s_GreenletTracer_ignore_current_gr, __pyx_k_GreenletTracer_ignore_current_gr, sizeof(__pyx_k_GreenletTracer_ignore_current_gr), 0, 0, 1, 1}, + {&__pyx_n_s_GreenletTracer_kill, __pyx_k_GreenletTracer_kill, sizeof(__pyx_k_GreenletTracer_kill), 0, 0, 1, 1}, + {&__pyx_n_s_GreenletTracer_monitor_current_g, __pyx_k_GreenletTracer_monitor_current_g, sizeof(__pyx_k_GreenletTracer_monitor_current_g), 0, 0, 1, 1}, + {&__pyx_n_s_HubSwitchTracer, __pyx_k_HubSwitchTracer, sizeof(__pyx_k_HubSwitchTracer), 0, 0, 1, 1}, + {&__pyx_n_s_HubSwitchTracer__trace, __pyx_k_HubSwitchTracer__trace, sizeof(__pyx_k_HubSwitchTracer__trace), 0, 0, 1, 1}, + {&__pyx_n_s_HubSwitchTracer_did_block_hub, __pyx_k_HubSwitchTracer_did_block_hub, sizeof(__pyx_k_HubSwitchTracer_did_block_hub), 0, 0, 1, 1}, + {&__pyx_n_s_HubTracer, __pyx_k_HubTracer, sizeof(__pyx_k_HubTracer), 0, 0, 1, 1}, + {&__pyx_n_s_HubTracer_kill, __pyx_k_HubTracer_kill, sizeof(__pyx_k_HubTracer_kill), 0, 0, 1, 1}, + {&__pyx_kp_s_Info, __pyx_k_Info, sizeof(__pyx_k_Info), 0, 0, 1, 0}, + {&__pyx_n_s_KeyError, __pyx_k_KeyError, sizeof(__pyx_k_KeyError), 0, 0, 1, 1}, + {&__pyx_n_s_MaxSwitchTracer, __pyx_k_MaxSwitchTracer, sizeof(__pyx_k_MaxSwitchTracer), 0, 0, 1, 1}, + {&__pyx_n_s_MaxSwitchTracer__trace, __pyx_k_MaxSwitchTracer__trace, sizeof(__pyx_k_MaxSwitchTracer__trace), 0, 0, 1, 1}, + {&__pyx_n_s_MaxSwitchTracer_did_block_hub, __pyx_k_MaxSwitchTracer_did_block_hub, sizeof(__pyx_k_MaxSwitchTracer_did_block_hub), 0, 0, 1, 1}, + {&__pyx_kp_s_Reported_by_s, __pyx_k_Reported_by_s, sizeof(__pyx_k_Reported_by_s), 0, 0, 1, 0}, + {&__pyx_kp_s_Unknown_No_thread_found_for_hub, __pyx_k_Unknown_No_thread_found_for_hub, sizeof(__pyx_k_Unknown_No_thread_found_for_hub), 0, 0, 1, 0}, + {&__pyx_kp_s__2, __pyx_k__2, sizeof(__pyx_k__2), 0, 0, 1, 0}, + {&__pyx_n_s_active_greenlet, __pyx_k_active_greenlet, sizeof(__pyx_k_active_greenlet), 0, 0, 1, 1}, + {&__pyx_n_s_all, __pyx_k_all, sizeof(__pyx_k_all), 0, 0, 1, 1}, + {&__pyx_n_s_args, __pyx_k_args, sizeof(__pyx_k_args), 0, 0, 1, 1}, + #if PY_MAJOR_VERSION >= 3 + {&__pyx_kp_s_b, __pyx_k_, sizeof(__pyx_k_), 0, 1, 0, 0}, + #else + {&__pyx_kp_s_b, __pyx_k_b, sizeof(__pyx_k_b), 0, 0, 1, 0}, + #endif + {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, + {&__pyx_n_s_current_frames, __pyx_k_current_frames, sizeof(__pyx_k_current_frames), 0, 0, 1, 1}, + {&__pyx_n_s_did_block_hub, __pyx_k_did_block_hub, sizeof(__pyx_k_did_block_hub), 0, 0, 1, 1}, + {&__pyx_n_s_did_block_hub_report, __pyx_k_did_block_hub_report, sizeof(__pyx_k_did_block_hub_report), 0, 0, 1, 1}, + {&__pyx_n_s_event, __pyx_k_event, sizeof(__pyx_k_event), 0, 0, 1, 1}, + {&__pyx_n_s_format_kwargs, __pyx_k_format_kwargs, sizeof(__pyx_k_format_kwargs), 0, 0, 1, 1}, + {&__pyx_n_s_format_run_info, __pyx_k_format_run_info, sizeof(__pyx_k_format_run_info), 0, 0, 1, 1}, + {&__pyx_n_s_format_stack, __pyx_k_format_stack, sizeof(__pyx_k_format_stack), 0, 0, 1, 1}, + {&__pyx_n_s_frame, __pyx_k_frame, sizeof(__pyx_k_frame), 0, 0, 1, 1}, + {&__pyx_n_s_getcurrent, __pyx_k_getcurrent, sizeof(__pyx_k_getcurrent), 0, 0, 1, 1}, + {&__pyx_n_s_gevent___tracer, __pyx_k_gevent___tracer, sizeof(__pyx_k_gevent___tracer), 0, 0, 1, 1}, + {&__pyx_n_s_gevent__compat, __pyx_k_gevent__compat, sizeof(__pyx_k_gevent__compat), 0, 0, 1, 1}, + {&__pyx_n_s_gevent__util, __pyx_k_gevent__util, sizeof(__pyx_k_gevent__util), 0, 0, 1, 1}, + {&__pyx_n_s_gevent_util, __pyx_k_gevent_util, sizeof(__pyx_k_gevent_util), 0, 0, 1, 1}, + {&__pyx_n_s_gmctime, __pyx_k_gmctime, sizeof(__pyx_k_gmctime), 0, 0, 1, 1}, + {&__pyx_n_s_greenlet, __pyx_k_greenlet, sizeof(__pyx_k_greenlet), 0, 0, 1, 1}, + {&__pyx_n_s_hex, __pyx_k_hex, sizeof(__pyx_k_hex), 0, 0, 1, 1}, + {&__pyx_n_s_hub, __pyx_k_hub, sizeof(__pyx_k_hub), 0, 0, 1, 1}, + {&__pyx_n_s_ignore_current_greenlet_blocking, __pyx_k_ignore_current_greenlet_blocking, sizeof(__pyx_k_ignore_current_greenlet_blocking), 0, 0, 1, 1}, + {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, + {&__pyx_n_s_import_c_accel, __pyx_k_import_c_accel, sizeof(__pyx_k_import_c_accel), 0, 0, 1, 1}, + {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1}, + {&__pyx_n_s_join, __pyx_k_join, sizeof(__pyx_k_join), 0, 0, 1, 1}, + {&__pyx_n_s_kill, __pyx_k_kill, sizeof(__pyx_k_kill), 0, 0, 1, 1}, + {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, + {&__pyx_n_s_max_blocking_time, __pyx_k_max_blocking_time, sizeof(__pyx_k_max_blocking_time), 0, 0, 1, 1}, + {&__pyx_n_s_monitor_current_greenlet_blockin, __pyx_k_monitor_current_greenlet_blockin, sizeof(__pyx_k_monitor_current_greenlet_blockin), 0, 0, 1, 1}, + {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, + {&__pyx_n_s_perf_counter, __pyx_k_perf_counter, sizeof(__pyx_k_perf_counter), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_capi, __pyx_k_pyx_capi, sizeof(__pyx_k_pyx_capi), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1}, + {&__pyx_n_s_report, __pyx_k_report, sizeof(__pyx_k_report), 0, 0, 1, 1}, + {&__pyx_kp_s_s_Greenlet_s_appears_to_be_bloc, __pyx_k_s_Greenlet_s_appears_to_be_bloc, sizeof(__pyx_k_s_Greenlet_s_appears_to_be_bloc), 0, 0, 1, 0}, + {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1}, + {&__pyx_n_s_settrace, __pyx_k_settrace, sizeof(__pyx_k_settrace), 0, 0, 1, 1}, + {&__pyx_kp_s_src_gevent__tracer_py, __pyx_k_src_gevent__tracer_py, sizeof(__pyx_k_src_gevent__tracer_py), 0, 0, 1, 0}, + {&__pyx_n_s_stack, __pyx_k_stack, sizeof(__pyx_k_stack), 0, 0, 1, 1}, + {&__pyx_n_s_switch, __pyx_k_switch, sizeof(__pyx_k_switch), 0, 0, 1, 1}, + {&__pyx_n_s_sys, __pyx_k_sys, sizeof(__pyx_k_sys), 0, 0, 1, 1}, + {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, + {&__pyx_n_s_thread_ident, __pyx_k_thread_ident, sizeof(__pyx_k_thread_ident), 0, 0, 1, 1}, + {&__pyx_n_s_throw, __pyx_k_throw, sizeof(__pyx_k_throw), 0, 0, 1, 1}, + {&__pyx_n_s_trace, __pyx_k_trace, sizeof(__pyx_k_trace), 0, 0, 1, 1}, + {&__pyx_n_s_traceback, __pyx_k_traceback, sizeof(__pyx_k_traceback), 0, 0, 1, 1}, + {0, 0, 0, 0, 0, 0, 0} +}; +static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { + __pyx_builtin_KeyError = __Pyx_GetBuiltinName(__pyx_n_s_KeyError); if (!__pyx_builtin_KeyError) __PYX_ERR(0, 108, __pyx_L1_error) + __pyx_builtin_hex = __Pyx_GetBuiltinName(__pyx_n_s_hex); if (!__pyx_builtin_hex) __PYX_ERR(0, 114, __pyx_L1_error) + return 0; + __pyx_L1_error:; + return -1; +} + +static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); + + /* "src/gevent/_tracer.py":49 + * self._killed = False + * + * def kill(self): # <<<<<<<<<<<<<< + * # Must be called in the monitored thread. + * if not self._killed: + */ + __pyx_tuple__3 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 49, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__3); + __Pyx_GIVEREF(__pyx_tuple__3); + __pyx_codeobj__4 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__3, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__tracer_py, __pyx_n_s_kill, 49, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__4)) __PYX_ERR(0, 49, __pyx_L1_error) + + /* "src/gevent/_tracer.py":56 + * self.previous_trace_function = None + * + * def _trace(self, event, args): # <<<<<<<<<<<<<< + * # This function runs in the thread we are monitoring. + * self.greenlet_switch_counter += 1 + */ + __pyx_tuple__5 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_event, __pyx_n_s_args); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 56, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__5); + __Pyx_GIVEREF(__pyx_tuple__5); + __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__5, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__tracer_py, __pyx_n_s_trace, 56, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__6)) __PYX_ERR(0, 56, __pyx_L1_error) + + /* "src/gevent/_tracer.py":71 + * return self._trace(event, args) + * + * def did_block_hub(self, hub): # <<<<<<<<<<<<<< + * # Check to see if we have blocked since the last call to this + * # method. Returns a true value if we blocked (not in the hub), + */ + __pyx_tuple__7 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_hub); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 71, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__7); + __Pyx_GIVEREF(__pyx_tuple__7); + __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__tracer_py, __pyx_n_s_did_block_hub, 71, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) __PYX_ERR(0, 71, __pyx_L1_error) + + /* "src/gevent/_tracer.py":94 + * return True, active_greenlet + * + * def ignore_current_greenlet_blocking(self): # <<<<<<<<<<<<<< + * # Don't pay attention to the current greenlet. + * self.active_greenlet = None + */ + __pyx_tuple__9 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 94, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__9); + __Pyx_GIVEREF(__pyx_tuple__9); + __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__9, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__tracer_py, __pyx_n_s_ignore_current_greenlet_blocking, 94, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__10)) __PYX_ERR(0, 94, __pyx_L1_error) + + /* "src/gevent/_tracer.py":98 + * self.active_greenlet = None + * + * def monitor_current_greenlet_blocking(self): # <<<<<<<<<<<<<< + * self.active_greenlet = getcurrent() + * + */ + __pyx_tuple__11 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 98, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__11); + __Pyx_GIVEREF(__pyx_tuple__11); + __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__11, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__tracer_py, __pyx_n_s_monitor_current_greenlet_blockin, 98, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(0, 98, __pyx_L1_error) + + /* "src/gevent/_tracer.py":101 + * self.active_greenlet = getcurrent() + * + * def did_block_hub_report(self, hub, active_greenlet, format_kwargs): # <<<<<<<<<<<<<< + * report = ['=' * 80, + * '\n%s : Greenlet %s appears to be blocked' % + */ + __pyx_tuple__13 = PyTuple_Pack(7, __pyx_n_s_self, __pyx_n_s_hub, __pyx_n_s_active_greenlet, __pyx_n_s_format_kwargs, __pyx_n_s_report, __pyx_n_s_frame, __pyx_n_s_stack); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 101, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__13); + __Pyx_GIVEREF(__pyx_tuple__13); + __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(4, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__13, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__tracer_py, __pyx_n_s_did_block_hub_report, 101, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__14)) __PYX_ERR(0, 101, __pyx_L1_error) + + /* "src/gevent/_tracer.py":128 + * self.hub = hub + * + * def kill(self): # <<<<<<<<<<<<<< + * self.hub = None + * GreenletTracer.kill(self) + */ + __pyx_tuple__15 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(0, 128, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__15); + __Pyx_GIVEREF(__pyx_tuple__15); + __pyx_codeobj__16 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__15, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__tracer_py, __pyx_n_s_kill, 128, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__16)) __PYX_ERR(0, 128, __pyx_L1_error) + + /* "src/gevent/_tracer.py":140 + * self.last_entered_hub = 0 + * + * def _trace(self, event, args): # <<<<<<<<<<<<<< + * GreenletTracer._trace(self, event, args) + * if self.active_greenlet is self.hub: + */ + __pyx_tuple__17 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_event, __pyx_n_s_args); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(0, 140, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__17); + __Pyx_GIVEREF(__pyx_tuple__17); + __pyx_codeobj__18 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__17, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__tracer_py, __pyx_n_s_trace, 140, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__18)) __PYX_ERR(0, 140, __pyx_L1_error) + + /* "src/gevent/_tracer.py":145 + * self.last_entered_hub = perf_counter() + * + * def did_block_hub(self, hub): # <<<<<<<<<<<<<< + * if perf_counter() - self.last_entered_hub > self.max_blocking_time: + * return True, self.active_greenlet + */ + __pyx_tuple__19 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_hub); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(0, 145, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__19); + __Pyx_GIVEREF(__pyx_tuple__19); + __pyx_codeobj__20 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__19, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__tracer_py, __pyx_n_s_did_block_hub, 145, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__20)) __PYX_ERR(0, 145, __pyx_L1_error) + + /* "src/gevent/_tracer.py":159 + * self.max_blocking = 0 + * + * def _trace(self, event, args): # <<<<<<<<<<<<<< + * old_active = self.active_greenlet + * GreenletTracer._trace(self, event, args) + */ + __pyx_tuple__21 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_event, __pyx_n_s_args); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(0, 159, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__21); + __Pyx_GIVEREF(__pyx_tuple__21); + __pyx_codeobj__22 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__21, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__tracer_py, __pyx_n_s_trace, 159, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__22)) __PYX_ERR(0, 159, __pyx_L1_error) + + /* "src/gevent/_tracer.py":169 + * switched_at - self.last_switch) + * + * def did_block_hub(self, hub): # <<<<<<<<<<<<<< + * if self.max_blocking == 0: + * # We never switched. Check the time now + */ + __pyx_tuple__23 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_hub); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(0, 169, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__23); + __Pyx_GIVEREF(__pyx_tuple__23); + __pyx_codeobj__24 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__23, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__tracer_py, __pyx_n_s_did_block_hub, 169, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__24)) __PYX_ERR(0, 169, __pyx_L1_error) + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} + +static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { + if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + return 0; + __pyx_L1_error:; + return -1; +} + +static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/ + +static int __Pyx_modinit_global_init_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); + /*--- Global init code ---*/ + __pyx_v_6gevent_8__tracer_sys = Py_None; Py_INCREF(Py_None); + __pyx_v_6gevent_8__tracer_traceback = Py_None; Py_INCREF(Py_None); + __pyx_v_6gevent_8__tracer_settrace = Py_None; Py_INCREF(Py_None); + __pyx_v_6gevent_8__tracer_getcurrent = Py_None; Py_INCREF(Py_None); + __pyx_v_6gevent_8__tracer_format_run_info = Py_None; Py_INCREF(Py_None); + __pyx_v_6gevent_8__tracer_perf_counter = Py_None; Py_INCREF(Py_None); + __pyx_v_6gevent_8__tracer_gmctime = Py_None; Py_INCREF(Py_None); + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_variable_export_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); + /*--- Variable export code ---*/ + if (__Pyx_ExportVoidPtr(__pyx_n_s_sys, (void *)&__pyx_v_6gevent_8__tracer_sys, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportVoidPtr(__pyx_n_s_traceback, (void *)&__pyx_v_6gevent_8__tracer_traceback, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportVoidPtr(__pyx_n_s_settrace, (void *)&__pyx_v_6gevent_8__tracer_settrace, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportVoidPtr(__pyx_n_s_getcurrent, (void *)&__pyx_v_6gevent_8__tracer_getcurrent, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportVoidPtr(__pyx_n_s_format_run_info, (void *)&__pyx_v_6gevent_8__tracer_format_run_info, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportVoidPtr(__pyx_n_s_perf_counter, (void *)&__pyx_v_6gevent_8__tracer_perf_counter, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportVoidPtr(__pyx_n_s_gmctime, (void *)&__pyx_v_6gevent_8__tracer_gmctime, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_modinit_function_export_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); + /*--- Function export code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_type_init_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); + /*--- Type init code ---*/ + __pyx_vtabptr_6gevent_8__tracer_GreenletTracer = &__pyx_vtable_6gevent_8__tracer_GreenletTracer; + __pyx_vtable_6gevent_8__tracer_GreenletTracer._trace = (PyObject *(*)(struct __pyx_obj_6gevent_8__tracer_GreenletTracer *, PyObject *, PyObject *, int __pyx_skip_dispatch))__pyx_f_6gevent_8__tracer_14GreenletTracer__trace; + __pyx_vtable_6gevent_8__tracer_GreenletTracer.did_block_hub = (PyObject *(*)(struct __pyx_obj_6gevent_8__tracer_GreenletTracer *, PyObject *, int __pyx_skip_dispatch))__pyx_f_6gevent_8__tracer_14GreenletTracer_did_block_hub; + __pyx_vtable_6gevent_8__tracer_GreenletTracer.kill = (PyObject *(*)(struct __pyx_obj_6gevent_8__tracer_GreenletTracer *, int __pyx_skip_dispatch))__pyx_f_6gevent_8__tracer_14GreenletTracer_kill; + if (PyType_Ready(&__pyx_type_6gevent_8__tracer_GreenletTracer) < 0) __PYX_ERR(0, 27, __pyx_L1_error) + __pyx_type_6gevent_8__tracer_GreenletTracer.tp_print = 0; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6gevent_8__tracer_GreenletTracer.tp_dictoffset && __pyx_type_6gevent_8__tracer_GreenletTracer.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_type_6gevent_8__tracer_GreenletTracer.tp_getattro = __Pyx_PyObject_GenericGetAttr; + } + if (__Pyx_SetVtable(__pyx_type_6gevent_8__tracer_GreenletTracer.tp_dict, __pyx_vtabptr_6gevent_8__tracer_GreenletTracer) < 0) __PYX_ERR(0, 27, __pyx_L1_error) + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_GreenletTracer, (PyObject *)&__pyx_type_6gevent_8__tracer_GreenletTracer) < 0) __PYX_ERR(0, 27, __pyx_L1_error) + __pyx_ptype_6gevent_8__tracer_GreenletTracer = &__pyx_type_6gevent_8__tracer_GreenletTracer; + __pyx_vtabptr_6gevent_8__tracer__HubTracer = &__pyx_vtable_6gevent_8__tracer__HubTracer; + __pyx_vtable_6gevent_8__tracer__HubTracer.__pyx_base = *__pyx_vtabptr_6gevent_8__tracer_GreenletTracer; + __pyx_vtable_6gevent_8__tracer__HubTracer.__pyx_base.kill = (PyObject *(*)(struct __pyx_obj_6gevent_8__tracer_GreenletTracer *, int __pyx_skip_dispatch))__pyx_f_6gevent_8__tracer_10_HubTracer_kill; + __pyx_type_6gevent_8__tracer__HubTracer.tp_base = __pyx_ptype_6gevent_8__tracer_GreenletTracer; + if (PyType_Ready(&__pyx_type_6gevent_8__tracer__HubTracer) < 0) __PYX_ERR(0, 122, __pyx_L1_error) + __pyx_type_6gevent_8__tracer__HubTracer.tp_print = 0; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6gevent_8__tracer__HubTracer.tp_dictoffset && __pyx_type_6gevent_8__tracer__HubTracer.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_type_6gevent_8__tracer__HubTracer.tp_getattro = __Pyx_PyObject_GenericGetAttr; + } + if (__Pyx_SetVtable(__pyx_type_6gevent_8__tracer__HubTracer.tp_dict, __pyx_vtabptr_6gevent_8__tracer__HubTracer) < 0) __PYX_ERR(0, 122, __pyx_L1_error) + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_HubTracer, (PyObject *)&__pyx_type_6gevent_8__tracer__HubTracer) < 0) __PYX_ERR(0, 122, __pyx_L1_error) + __pyx_ptype_6gevent_8__tracer__HubTracer = &__pyx_type_6gevent_8__tracer__HubTracer; + __pyx_vtabptr_6gevent_8__tracer_HubSwitchTracer = &__pyx_vtable_6gevent_8__tracer_HubSwitchTracer; + __pyx_vtable_6gevent_8__tracer_HubSwitchTracer.__pyx_base = *__pyx_vtabptr_6gevent_8__tracer__HubTracer; + __pyx_vtable_6gevent_8__tracer_HubSwitchTracer.__pyx_base.__pyx_base._trace = (PyObject *(*)(struct __pyx_obj_6gevent_8__tracer_GreenletTracer *, PyObject *, PyObject *, int __pyx_skip_dispatch))__pyx_f_6gevent_8__tracer_15HubSwitchTracer__trace; + __pyx_vtable_6gevent_8__tracer_HubSwitchTracer.__pyx_base.__pyx_base.did_block_hub = (PyObject *(*)(struct __pyx_obj_6gevent_8__tracer_GreenletTracer *, PyObject *, int __pyx_skip_dispatch))__pyx_f_6gevent_8__tracer_15HubSwitchTracer_did_block_hub; + __pyx_type_6gevent_8__tracer_HubSwitchTracer.tp_base = __pyx_ptype_6gevent_8__tracer__HubTracer; + if (PyType_Ready(&__pyx_type_6gevent_8__tracer_HubSwitchTracer) < 0) __PYX_ERR(0, 133, __pyx_L1_error) + __pyx_type_6gevent_8__tracer_HubSwitchTracer.tp_print = 0; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6gevent_8__tracer_HubSwitchTracer.tp_dictoffset && __pyx_type_6gevent_8__tracer_HubSwitchTracer.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_type_6gevent_8__tracer_HubSwitchTracer.tp_getattro = __Pyx_PyObject_GenericGetAttr; + } + if (__Pyx_SetVtable(__pyx_type_6gevent_8__tracer_HubSwitchTracer.tp_dict, __pyx_vtabptr_6gevent_8__tracer_HubSwitchTracer) < 0) __PYX_ERR(0, 133, __pyx_L1_error) + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_HubSwitchTracer, (PyObject *)&__pyx_type_6gevent_8__tracer_HubSwitchTracer) < 0) __PYX_ERR(0, 133, __pyx_L1_error) + __pyx_ptype_6gevent_8__tracer_HubSwitchTracer = &__pyx_type_6gevent_8__tracer_HubSwitchTracer; + __pyx_vtabptr_6gevent_8__tracer_MaxSwitchTracer = &__pyx_vtable_6gevent_8__tracer_MaxSwitchTracer; + __pyx_vtable_6gevent_8__tracer_MaxSwitchTracer.__pyx_base = *__pyx_vtabptr_6gevent_8__tracer__HubTracer; + __pyx_vtable_6gevent_8__tracer_MaxSwitchTracer.__pyx_base.__pyx_base._trace = (PyObject *(*)(struct __pyx_obj_6gevent_8__tracer_GreenletTracer *, PyObject *, PyObject *, int __pyx_skip_dispatch))__pyx_f_6gevent_8__tracer_15MaxSwitchTracer__trace; + __pyx_vtable_6gevent_8__tracer_MaxSwitchTracer.__pyx_base.__pyx_base.did_block_hub = (PyObject *(*)(struct __pyx_obj_6gevent_8__tracer_GreenletTracer *, PyObject *, int __pyx_skip_dispatch))__pyx_f_6gevent_8__tracer_15MaxSwitchTracer_did_block_hub; + __pyx_type_6gevent_8__tracer_MaxSwitchTracer.tp_base = __pyx_ptype_6gevent_8__tracer__HubTracer; + if (PyType_Ready(&__pyx_type_6gevent_8__tracer_MaxSwitchTracer) < 0) __PYX_ERR(0, 150, __pyx_L1_error) + __pyx_type_6gevent_8__tracer_MaxSwitchTracer.tp_print = 0; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6gevent_8__tracer_MaxSwitchTracer.tp_dictoffset && __pyx_type_6gevent_8__tracer_MaxSwitchTracer.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_type_6gevent_8__tracer_MaxSwitchTracer.tp_getattro = __Pyx_PyObject_GenericGetAttr; + } + if (__Pyx_SetVtable(__pyx_type_6gevent_8__tracer_MaxSwitchTracer.tp_dict, __pyx_vtabptr_6gevent_8__tracer_MaxSwitchTracer) < 0) __PYX_ERR(0, 150, __pyx_L1_error) + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_MaxSwitchTracer, (PyObject *)&__pyx_type_6gevent_8__tracer_MaxSwitchTracer) < 0) __PYX_ERR(0, 150, __pyx_L1_error) + __pyx_ptype_6gevent_8__tracer_MaxSwitchTracer = &__pyx_type_6gevent_8__tracer_MaxSwitchTracer; + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_modinit_type_import_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); + /*--- Type import code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_variable_import_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); + /*--- Variable import code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_function_import_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); + /*--- Function import code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + + +#if PY_MAJOR_VERSION < 3 +#ifdef CYTHON_NO_PYINIT_EXPORT +#define __Pyx_PyMODINIT_FUNC void +#else +#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC +#endif +#else +#ifdef CYTHON_NO_PYINIT_EXPORT +#define __Pyx_PyMODINIT_FUNC PyObject * +#else +#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC +#endif +#endif + + +#if PY_MAJOR_VERSION < 3 +__Pyx_PyMODINIT_FUNC init__tracer(void) CYTHON_SMALL_CODE; /*proto*/ +__Pyx_PyMODINIT_FUNC init__tracer(void) +#else +__Pyx_PyMODINIT_FUNC PyInit___tracer(void) CYTHON_SMALL_CODE; /*proto*/ +__Pyx_PyMODINIT_FUNC PyInit___tracer(void) +#if CYTHON_PEP489_MULTI_PHASE_INIT +{ + return PyModuleDef_Init(&__pyx_moduledef); +} +static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { + #if PY_VERSION_HEX >= 0x030700A1 + static PY_INT64_T main_interpreter_id = -1; + PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); + if (main_interpreter_id == -1) { + main_interpreter_id = current_id; + return (unlikely(current_id == -1)) ? -1 : 0; + } else if (unlikely(main_interpreter_id != current_id)) + #else + static PyInterpreterState *main_interpreter = NULL; + PyInterpreterState *current_interpreter = PyThreadState_Get()->interp; + if (!main_interpreter) { + main_interpreter = current_interpreter; + } else if (unlikely(main_interpreter != current_interpreter)) + #endif + { + PyErr_SetString( + PyExc_ImportError, + "Interpreter change detected - this module can only be loaded into one interpreter per process."); + return -1; + } + return 0; +} +static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) { + PyObject *value = PyObject_GetAttrString(spec, from_name); + int result = 0; + if (likely(value)) { + if (allow_none || value != Py_None) { + result = PyDict_SetItemString(moddict, to_name, value); + } + Py_DECREF(value); + } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_Clear(); + } else { + result = -1; + } + return result; +} +static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) { + PyObject *module = NULL, *moddict, *modname; + if (__Pyx_check_single_interpreter()) + return NULL; + if (__pyx_m) + return __Pyx_NewRef(__pyx_m); + modname = PyObject_GetAttrString(spec, "name"); + if (unlikely(!modname)) goto bad; + module = PyModule_NewObject(modname); + Py_DECREF(modname); + if (unlikely(!module)) goto bad; + moddict = PyModule_GetDict(module); + if (unlikely(!moddict)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad; + return module; +bad: + Py_XDECREF(module); + return NULL; +} + + +static CYTHON_SMALL_CODE int __pyx_pymod_exec___tracer(PyObject *__pyx_pyinit_module) +#endif +#endif +{ + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannyDeclarations + #if CYTHON_PEP489_MULTI_PHASE_INIT + if (__pyx_m) { + if (__pyx_m == __pyx_pyinit_module) return 0; + PyErr_SetString(PyExc_RuntimeError, "Module '__tracer' has already been imported. Re-initialisation is not supported."); + return -1; + } + #elif PY_MAJOR_VERSION >= 3 + if (__pyx_m) return __Pyx_NewRef(__pyx_m); + #endif + #if CYTHON_REFNANNY +__Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); +if (!__Pyx_RefNanny) { + PyErr_Clear(); + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); + if (!__Pyx_RefNanny) + Py_FatalError("failed to import 'refnanny' module"); +} +#endif + __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit___tracer(void)", 0); + if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #ifdef __Pxy_PyFrame_Initialize_Offsets + __Pxy_PyFrame_Initialize_Offsets(); + #endif + __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) + #ifdef __Pyx_CyFunction_USED + if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_FusedFunction_USED + if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_Coroutine_USED + if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_Generator_USED + if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_AsyncGen_USED + if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_StopAsyncIteration_USED + if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + /*--- Library function declarations ---*/ + /*--- Threads initialization code ---*/ + #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS + #ifdef WITH_THREAD /* Python build with threading support? */ + PyEval_InitThreads(); + #endif + #endif + /*--- Module creation code ---*/ + #if CYTHON_PEP489_MULTI_PHASE_INIT + __pyx_m = __pyx_pyinit_module; + Py_INCREF(__pyx_m); + #else + #if PY_MAJOR_VERSION < 3 + __pyx_m = Py_InitModule4("__tracer", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); + #else + __pyx_m = PyModule_Create(&__pyx_moduledef); + #endif + if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) + Py_INCREF(__pyx_d); + __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) + #if CYTHON_COMPILING_IN_PYPY + Py_INCREF(__pyx_b); + #endif + if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + /*--- Initialize various global constants etc. ---*/ + if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) + if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + if (__pyx_module_is_main_gevent____tracer) { + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + } + #if PY_MAJOR_VERSION >= 3 + { + PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) + if (!PyDict_GetItemString(modules, "gevent.__tracer")) { + if (unlikely(PyDict_SetItemString(modules, "gevent.__tracer", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error) + } + } + #endif + /*--- Builtin init code ---*/ + if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + /*--- Constants init code ---*/ + if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + /*--- Global type/function init code ---*/ + (void)__Pyx_modinit_global_init_code(); + if (unlikely(__Pyx_modinit_variable_export_code() != 0)) goto __pyx_L1_error; + (void)__Pyx_modinit_function_export_code(); + if (unlikely(__Pyx_modinit_type_init_code() != 0)) goto __pyx_L1_error; + (void)__Pyx_modinit_type_import_code(); + (void)__Pyx_modinit_variable_import_code(); + (void)__Pyx_modinit_function_import_code(); + /*--- Execution code ---*/ + #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) + if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + + /* "src/gevent/_tracer.py":5 + * from __future__ import print_function, absolute_import, division + * + * import sys # <<<<<<<<<<<<<< + * import traceback + * + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_sys, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_v_6gevent_8__tracer_sys); + __Pyx_DECREF_SET(__pyx_v_6gevent_8__tracer_sys, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + + /* "src/gevent/_tracer.py":6 + * + * import sys + * import traceback # <<<<<<<<<<<<<< + * + * from greenlet import settrace + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_traceback, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_v_6gevent_8__tracer_traceback); + __Pyx_DECREF_SET(__pyx_v_6gevent_8__tracer_traceback, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + + /* "src/gevent/_tracer.py":8 + * import traceback + * + * from greenlet import settrace # <<<<<<<<<<<<<< + * from greenlet import getcurrent + * + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 8, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_settrace); + __Pyx_GIVEREF(__pyx_n_s_settrace); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_settrace); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_greenlet, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_settrace); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 8, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_v_6gevent_8__tracer_settrace); + __Pyx_DECREF_SET(__pyx_v_6gevent_8__tracer_settrace, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/_tracer.py":9 + * + * from greenlet import settrace + * from greenlet import getcurrent # <<<<<<<<<<<<<< + * + * from gevent.util import format_run_info + */ + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_getcurrent); + __Pyx_GIVEREF(__pyx_n_s_getcurrent); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_getcurrent); + __pyx_t_1 = __Pyx_Import(__pyx_n_s_greenlet, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 9, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_getcurrent); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_v_6gevent_8__tracer_getcurrent); + __Pyx_DECREF_SET(__pyx_v_6gevent_8__tracer_getcurrent, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_tracer.py":11 + * from greenlet import getcurrent + * + * from gevent.util import format_run_info # <<<<<<<<<<<<<< + * + * from gevent._compat import perf_counter + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 11, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_format_run_info); + __Pyx_GIVEREF(__pyx_n_s_format_run_info); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_format_run_info); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_gevent_util, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 11, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_format_run_info); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 11, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_v_6gevent_8__tracer_format_run_info); + __Pyx_DECREF_SET(__pyx_v_6gevent_8__tracer_format_run_info, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/_tracer.py":13 + * from gevent.util import format_run_info + * + * from gevent._compat import perf_counter # <<<<<<<<<<<<<< + * from gevent._util import gmctime + * + */ + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_perf_counter); + __Pyx_GIVEREF(__pyx_n_s_perf_counter); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_perf_counter); + __pyx_t_1 = __Pyx_Import(__pyx_n_s_gevent__compat, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_perf_counter); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_v_6gevent_8__tracer_perf_counter); + __Pyx_DECREF_SET(__pyx_v_6gevent_8__tracer_perf_counter, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_tracer.py":14 + * + * from gevent._compat import perf_counter + * from gevent._util import gmctime # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 14, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_gmctime); + __Pyx_GIVEREF(__pyx_n_s_gmctime); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_gmctime); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_gevent__util, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 14, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_gmctime); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 14, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_v_6gevent_8__tracer_gmctime); + __Pyx_DECREF_SET(__pyx_v_6gevent_8__tracer_gmctime, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/_tracer.py":17 + * + * + * __all__ = [ # <<<<<<<<<<<<<< + * 'GreenletTracer', + * 'HubSwitchTracer', + */ + __pyx_t_2 = PyList_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 17, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_GreenletTracer); + __Pyx_GIVEREF(__pyx_n_s_GreenletTracer); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_GreenletTracer); + __Pyx_INCREF(__pyx_n_s_HubSwitchTracer); + __Pyx_GIVEREF(__pyx_n_s_HubSwitchTracer); + PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_HubSwitchTracer); + __Pyx_INCREF(__pyx_n_s_MaxSwitchTracer); + __Pyx_GIVEREF(__pyx_n_s_MaxSwitchTracer); + PyList_SET_ITEM(__pyx_t_2, 2, __pyx_n_s_MaxSwitchTracer); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_all, __pyx_t_2) < 0) __PYX_ERR(0, 17, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/_tracer.py":49 + * self._killed = False + * + * def kill(self): # <<<<<<<<<<<<<< + * # Must be called in the monitored thread. + * if not self._killed: + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_8__tracer_14GreenletTracer_3kill, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_GreenletTracer_kill, NULL, __pyx_n_s_gevent___tracer, __pyx_d, ((PyObject *)__pyx_codeobj__4)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 49, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_8__tracer_GreenletTracer->tp_dict, __pyx_n_s_kill, __pyx_t_2) < 0) __PYX_ERR(0, 49, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_8__tracer_GreenletTracer); + + /* "src/gevent/_tracer.py":56 + * self.previous_trace_function = None + * + * def _trace(self, event, args): # <<<<<<<<<<<<<< + * # This function runs in the thread we are monitoring. + * self.greenlet_switch_counter += 1 + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_8__tracer_14GreenletTracer_5_trace, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_GreenletTracer__trace, NULL, __pyx_n_s_gevent___tracer, __pyx_d, ((PyObject *)__pyx_codeobj__6)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 56, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_8__tracer_GreenletTracer->tp_dict, __pyx_n_s_trace, __pyx_t_2) < 0) __PYX_ERR(0, 56, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_8__tracer_GreenletTracer); + + /* "src/gevent/_tracer.py":71 + * return self._trace(event, args) + * + * def did_block_hub(self, hub): # <<<<<<<<<<<<<< + * # Check to see if we have blocked since the last call to this + * # method. Returns a true value if we blocked (not in the hub), + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_8__tracer_14GreenletTracer_9did_block_hub, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_GreenletTracer_did_block_hub, NULL, __pyx_n_s_gevent___tracer, __pyx_d, ((PyObject *)__pyx_codeobj__8)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 71, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_8__tracer_GreenletTracer->tp_dict, __pyx_n_s_did_block_hub, __pyx_t_2) < 0) __PYX_ERR(0, 71, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_8__tracer_GreenletTracer); + + /* "src/gevent/_tracer.py":94 + * return True, active_greenlet + * + * def ignore_current_greenlet_blocking(self): # <<<<<<<<<<<<<< + * # Don't pay attention to the current greenlet. + * self.active_greenlet = None + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_8__tracer_14GreenletTracer_11ignore_current_greenlet_blocking, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_GreenletTracer_ignore_current_gr, NULL, __pyx_n_s_gevent___tracer, __pyx_d, ((PyObject *)__pyx_codeobj__10)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 94, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_8__tracer_GreenletTracer->tp_dict, __pyx_n_s_ignore_current_greenlet_blocking, __pyx_t_2) < 0) __PYX_ERR(0, 94, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_8__tracer_GreenletTracer); + + /* "src/gevent/_tracer.py":98 + * self.active_greenlet = None + * + * def monitor_current_greenlet_blocking(self): # <<<<<<<<<<<<<< + * self.active_greenlet = getcurrent() + * + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_8__tracer_14GreenletTracer_13monitor_current_greenlet_blocking, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_GreenletTracer_monitor_current_g, NULL, __pyx_n_s_gevent___tracer, __pyx_d, ((PyObject *)__pyx_codeobj__12)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 98, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_8__tracer_GreenletTracer->tp_dict, __pyx_n_s_monitor_current_greenlet_blockin, __pyx_t_2) < 0) __PYX_ERR(0, 98, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_8__tracer_GreenletTracer); + + /* "src/gevent/_tracer.py":101 + * self.active_greenlet = getcurrent() + * + * def did_block_hub_report(self, hub, active_greenlet, format_kwargs): # <<<<<<<<<<<<<< + * report = ['=' * 80, + * '\n%s : Greenlet %s appears to be blocked' % + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_8__tracer_14GreenletTracer_15did_block_hub_report, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_GreenletTracer_did_block_hub_rep, NULL, __pyx_n_s_gevent___tracer, __pyx_d, ((PyObject *)__pyx_codeobj__14)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 101, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_8__tracer_GreenletTracer->tp_dict, __pyx_n_s_did_block_hub_report, __pyx_t_2) < 0) __PYX_ERR(0, 101, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_8__tracer_GreenletTracer); + + /* "src/gevent/_tracer.py":128 + * self.hub = hub + * + * def kill(self): # <<<<<<<<<<<<<< + * self.hub = None + * GreenletTracer.kill(self) + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_8__tracer_10_HubTracer_3kill, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_HubTracer_kill, NULL, __pyx_n_s_gevent___tracer, __pyx_d, ((PyObject *)__pyx_codeobj__16)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 128, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_8__tracer__HubTracer->tp_dict, __pyx_n_s_kill, __pyx_t_2) < 0) __PYX_ERR(0, 128, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_8__tracer__HubTracer); + + /* "src/gevent/_tracer.py":140 + * self.last_entered_hub = 0 + * + * def _trace(self, event, args): # <<<<<<<<<<<<<< + * GreenletTracer._trace(self, event, args) + * if self.active_greenlet is self.hub: + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_8__tracer_15HubSwitchTracer_3_trace, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_HubSwitchTracer__trace, NULL, __pyx_n_s_gevent___tracer, __pyx_d, ((PyObject *)__pyx_codeobj__18)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 140, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_8__tracer_HubSwitchTracer->tp_dict, __pyx_n_s_trace, __pyx_t_2) < 0) __PYX_ERR(0, 140, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_8__tracer_HubSwitchTracer); + + /* "src/gevent/_tracer.py":145 + * self.last_entered_hub = perf_counter() + * + * def did_block_hub(self, hub): # <<<<<<<<<<<<<< + * if perf_counter() - self.last_entered_hub > self.max_blocking_time: + * return True, self.active_greenlet + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_8__tracer_15HubSwitchTracer_5did_block_hub, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_HubSwitchTracer_did_block_hub, NULL, __pyx_n_s_gevent___tracer, __pyx_d, ((PyObject *)__pyx_codeobj__20)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 145, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_8__tracer_HubSwitchTracer->tp_dict, __pyx_n_s_did_block_hub, __pyx_t_2) < 0) __PYX_ERR(0, 145, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_8__tracer_HubSwitchTracer); + + /* "src/gevent/_tracer.py":159 + * self.max_blocking = 0 + * + * def _trace(self, event, args): # <<<<<<<<<<<<<< + * old_active = self.active_greenlet + * GreenletTracer._trace(self, event, args) + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_8__tracer_15MaxSwitchTracer_3_trace, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_MaxSwitchTracer__trace, NULL, __pyx_n_s_gevent___tracer, __pyx_d, ((PyObject *)__pyx_codeobj__22)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 159, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_8__tracer_MaxSwitchTracer->tp_dict, __pyx_n_s_trace, __pyx_t_2) < 0) __PYX_ERR(0, 159, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_8__tracer_MaxSwitchTracer); + + /* "src/gevent/_tracer.py":169 + * switched_at - self.last_switch) + * + * def did_block_hub(self, hub): # <<<<<<<<<<<<<< + * if self.max_blocking == 0: + * # We never switched. Check the time now + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_8__tracer_15MaxSwitchTracer_5did_block_hub, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_MaxSwitchTracer_did_block_hub, NULL, __pyx_n_s_gevent___tracer, __pyx_d, ((PyObject *)__pyx_codeobj__24)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 169, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_8__tracer_MaxSwitchTracer->tp_dict, __pyx_n_s_did_block_hub, __pyx_t_2) < 0) __PYX_ERR(0, 169, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_8__tracer_MaxSwitchTracer); + + /* "src/gevent/_tracer.py":178 + * + * + * from gevent._util import import_c_accel # <<<<<<<<<<<<<< + * import_c_accel(globals(), 'gevent.__tracer') + */ + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 178, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_import_c_accel); + __Pyx_GIVEREF(__pyx_n_s_import_c_accel); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_import_c_accel); + __pyx_t_1 = __Pyx_Import(__pyx_n_s_gevent__util, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 178, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_import_c_accel); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 178, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_import_c_accel, __pyx_t_2) < 0) __PYX_ERR(0, 178, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_tracer.py":179 + * + * from gevent._util import import_c_accel + * import_c_accel(globals(), 'gevent.__tracer') # <<<<<<<<<<<<<< + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_import_c_accel); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 179, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_Globals(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 179, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 179, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __Pyx_INCREF(__pyx_n_s_gevent___tracer); + __Pyx_GIVEREF(__pyx_n_s_gevent___tracer); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_n_s_gevent___tracer); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 179, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/_tracer.py":1 + * # Copyright (c) 2018 gevent. See LICENSE for details. # <<<<<<<<<<<<<< + * # cython: auto_pickle=False,embedsignature=True,always_allow_keywords=False + * from __future__ import print_function, absolute_import, division + */ + __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /*--- Wrapped vars code ---*/ + + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + if (__pyx_m) { + if (__pyx_d) { + __Pyx_AddTraceback("init gevent.__tracer", __pyx_clineno, __pyx_lineno, __pyx_filename); + } + Py_CLEAR(__pyx_m); + } else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_ImportError, "init gevent.__tracer"); + } + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + #if CYTHON_PEP489_MULTI_PHASE_INIT + return (__pyx_m != NULL) ? 0 : -1; + #elif PY_MAJOR_VERSION >= 3 + return __pyx_m; + #else + return; + #endif +} + +/* --- Runtime support code --- */ +/* Refnanny */ +#if CYTHON_REFNANNY +static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { + PyObject *m = NULL, *p = NULL; + void *r = NULL; + m = PyImport_ImportModule(modname); + if (!m) goto end; + p = PyObject_GetAttrString(m, "RefNannyAPI"); + if (!p) goto end; + r = PyLong_AsVoidPtr(p); +end: + Py_XDECREF(p); + Py_XDECREF(m); + return (__Pyx_RefNannyAPIStruct *)r; +} +#endif + +/* PyObjectGetAttrStr */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_getattro)) + return tp->tp_getattro(obj, attr_name); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_getattr)) + return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); +#endif + return PyObject_GetAttr(obj, attr_name); +} +#endif + +/* GetBuiltinName */ +static PyObject *__Pyx_GetBuiltinName(PyObject *name) { + PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name); + if (unlikely(!result)) { + PyErr_Format(PyExc_NameError, +#if PY_MAJOR_VERSION >= 3 + "name '%U' is not defined", name); +#else + "name '%.200s' is not defined", PyString_AS_STRING(name)); +#endif + } + return result; +} + +/* RaiseArgTupleInvalid */ +static void __Pyx_RaiseArgtupleInvalid( + const char* func_name, + int exact, + Py_ssize_t num_min, + Py_ssize_t num_max, + Py_ssize_t num_found) +{ + Py_ssize_t num_expected; + const char *more_or_less; + if (num_found < num_min) { + num_expected = num_min; + more_or_less = "at least"; + } else { + num_expected = num_max; + more_or_less = "at most"; + } + if (exact) { + more_or_less = "exactly"; + } + PyErr_Format(PyExc_TypeError, + "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", + func_name, more_or_less, num_expected, + (num_expected == 1) ? "" : "s", num_found); +} + +/* KeywordStringCheck */ +static int __Pyx_CheckKeywordStrings( + PyObject *kwdict, + const char* function_name, + int kw_allowed) +{ + PyObject* key = 0; + Py_ssize_t pos = 0; +#if CYTHON_COMPILING_IN_PYPY + if (!kw_allowed && PyDict_Next(kwdict, &pos, &key, 0)) + goto invalid_keyword; + return 1; +#else + while (PyDict_Next(kwdict, &pos, &key, 0)) { + #if PY_MAJOR_VERSION < 3 + if (unlikely(!PyString_Check(key))) + #endif + if (unlikely(!PyUnicode_Check(key))) + goto invalid_keyword_type; + } + if ((!kw_allowed) && unlikely(key)) + goto invalid_keyword; + return 1; +invalid_keyword_type: + PyErr_Format(PyExc_TypeError, + "%.200s() keywords must be strings", function_name); + return 0; +#endif +invalid_keyword: + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION < 3 + "%.200s() got an unexpected keyword argument '%.200s'", + function_name, PyString_AsString(key)); + #else + "%s() got an unexpected keyword argument '%U'", + function_name, key); + #endif + return 0; +} + +/* PyCFunctionFastCall */ +#if CYTHON_FAST_PYCCALL +static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) { + PyCFunctionObject *func = (PyCFunctionObject*)func_obj; + PyCFunction meth = PyCFunction_GET_FUNCTION(func); + PyObject *self = PyCFunction_GET_SELF(func); + int flags = PyCFunction_GET_FLAGS(func); + assert(PyCFunction_Check(func)); + assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS))); + assert(nargs >= 0); + assert(nargs == 0 || args != NULL); + /* _PyCFunction_FastCallDict() must not be called with an exception set, + because it may clear it (directly or indirectly) and so the + caller loses its exception */ + assert(!PyErr_Occurred()); + if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) { + return (*((__Pyx_PyCFunctionFastWithKeywords)(void*)meth)) (self, args, nargs, NULL); + } else { + return (*((__Pyx_PyCFunctionFast)(void*)meth)) (self, args, nargs); + } +} +#endif + +/* PyFunctionFastCall */ +#if CYTHON_FAST_PYCALL +static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, + PyObject *globals) { + PyFrameObject *f; + PyThreadState *tstate = __Pyx_PyThreadState_Current; + PyObject **fastlocals; + Py_ssize_t i; + PyObject *result; + assert(globals != NULL); + /* XXX Perhaps we should create a specialized + PyFrame_New() that doesn't take locals, but does + take builtins without sanity checking them. + */ + assert(tstate != NULL); + f = PyFrame_New(tstate, co, globals, NULL); + if (f == NULL) { + return NULL; + } + fastlocals = __Pyx_PyFrame_GetLocalsplus(f); + for (i = 0; i < na; i++) { + Py_INCREF(*args); + fastlocals[i] = *args++; + } + result = PyEval_EvalFrameEx(f,0); + ++tstate->recursion_depth; + Py_DECREF(f); + --tstate->recursion_depth; + return result; +} +#if 1 || PY_VERSION_HEX < 0x030600B1 +static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs) { + PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); + PyObject *globals = PyFunction_GET_GLOBALS(func); + PyObject *argdefs = PyFunction_GET_DEFAULTS(func); + PyObject *closure; +#if PY_MAJOR_VERSION >= 3 + PyObject *kwdefs; +#endif + PyObject *kwtuple, **k; + PyObject **d; + Py_ssize_t nd; + Py_ssize_t nk; + PyObject *result; + assert(kwargs == NULL || PyDict_Check(kwargs)); + nk = kwargs ? PyDict_Size(kwargs) : 0; + if (Py_EnterRecursiveCall((char*)" while calling a Python object")) { + return NULL; + } + if ( +#if PY_MAJOR_VERSION >= 3 + co->co_kwonlyargcount == 0 && +#endif + likely(kwargs == NULL || nk == 0) && + co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { + if (argdefs == NULL && co->co_argcount == nargs) { + result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); + goto done; + } + else if (nargs == 0 && argdefs != NULL + && co->co_argcount == Py_SIZE(argdefs)) { + /* function called with no arguments, but all parameters have + a default value: use default values as arguments .*/ + args = &PyTuple_GET_ITEM(argdefs, 0); + result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); + goto done; + } + } + if (kwargs != NULL) { + Py_ssize_t pos, i; + kwtuple = PyTuple_New(2 * nk); + if (kwtuple == NULL) { + result = NULL; + goto done; + } + k = &PyTuple_GET_ITEM(kwtuple, 0); + pos = i = 0; + while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { + Py_INCREF(k[i]); + Py_INCREF(k[i+1]); + i += 2; + } + nk = i / 2; + } + else { + kwtuple = NULL; + k = NULL; + } + closure = PyFunction_GET_CLOSURE(func); +#if PY_MAJOR_VERSION >= 3 + kwdefs = PyFunction_GET_KW_DEFAULTS(func); +#endif + if (argdefs != NULL) { + d = &PyTuple_GET_ITEM(argdefs, 0); + nd = Py_SIZE(argdefs); + } + else { + d = NULL; + nd = 0; + } +#if PY_MAJOR_VERSION >= 3 + result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, + args, nargs, + k, (int)nk, + d, (int)nd, kwdefs, closure); +#else + result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, + args, nargs, + k, (int)nk, + d, (int)nd, closure); +#endif + Py_XDECREF(kwtuple); +done: + Py_LeaveRecursiveCall(); + return result; +} +#endif +#endif + +/* PyObjectCall */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { + PyObject *result; + ternaryfunc call = func->ob_type->tp_call; + if (unlikely(!call)) + return PyObject_Call(func, arg, kw); + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; + result = (*call)(func, arg, kw); + Py_LeaveRecursiveCall(); + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +/* PyObjectCall2Args */ +static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) { + PyObject *args, *result = NULL; + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(function)) { + PyObject *args[2] = {arg1, arg2}; + return __Pyx_PyFunction_FastCall(function, args, 2); + } + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(function)) { + PyObject *args[2] = {arg1, arg2}; + return __Pyx_PyCFunction_FastCall(function, args, 2); + } + #endif + args = PyTuple_New(2); + if (unlikely(!args)) goto done; + Py_INCREF(arg1); + PyTuple_SET_ITEM(args, 0, arg1); + Py_INCREF(arg2); + PyTuple_SET_ITEM(args, 1, arg2); + Py_INCREF(function); + result = __Pyx_PyObject_Call(function, args, NULL); + Py_DECREF(args); + Py_DECREF(function); +done: + return result; +} + +/* PyObjectCallMethO */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { + PyObject *self, *result; + PyCFunction cfunc; + cfunc = PyCFunction_GET_FUNCTION(func); + self = PyCFunction_GET_SELF(func); + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; + result = cfunc(self, arg); + Py_LeaveRecursiveCall(); + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +/* PyObjectCallOneArg */ +#if CYTHON_COMPILING_IN_CPYTHON +static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) { + PyObject *result; + PyObject *args = PyTuple_New(1); + if (unlikely(!args)) return NULL; + Py_INCREF(arg); + PyTuple_SET_ITEM(args, 0, arg); + result = __Pyx_PyObject_Call(func, args, NULL); + Py_DECREF(args); + return result; +} +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { +#if CYTHON_FAST_PYCALL + if (PyFunction_Check(func)) { + return __Pyx_PyFunction_FastCall(func, &arg, 1); + } +#endif + if (likely(PyCFunction_Check(func))) { + if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) { + return __Pyx_PyObject_CallMethO(func, arg); +#if CYTHON_FAST_PYCCALL + } else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) { + return __Pyx_PyCFunction_FastCall(func, &arg, 1); +#endif + } + } + return __Pyx__PyObject_CallOneArg(func, arg); +} +#else +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { + PyObject *result; + PyObject *args = PyTuple_Pack(1, arg); + if (unlikely(!args)) return NULL; + result = __Pyx_PyObject_Call(func, args, NULL); + Py_DECREF(args); + return result; +} +#endif + +/* PyObjectCallNoArg */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { +#if CYTHON_FAST_PYCALL + if (PyFunction_Check(func)) { + return __Pyx_PyFunction_FastCall(func, NULL, 0); + } +#endif +#ifdef __Pyx_CyFunction_USED + if (likely(PyCFunction_Check(func) || __Pyx_CyFunction_Check(func))) +#else + if (likely(PyCFunction_Check(func))) +#endif + { + if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) { + return __Pyx_PyObject_CallMethO(func, NULL); + } + } + return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL); +} +#endif + +/* BytesEquals */ +static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { +#if CYTHON_COMPILING_IN_PYPY + return PyObject_RichCompareBool(s1, s2, equals); +#else + if (s1 == s2) { + return (equals == Py_EQ); + } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) { + const char *ps1, *ps2; + Py_ssize_t length = PyBytes_GET_SIZE(s1); + if (length != PyBytes_GET_SIZE(s2)) + return (equals == Py_NE); + ps1 = PyBytes_AS_STRING(s1); + ps2 = PyBytes_AS_STRING(s2); + if (ps1[0] != ps2[0]) { + return (equals == Py_NE); + } else if (length == 1) { + return (equals == Py_EQ); + } else { + int result; +#if CYTHON_USE_UNICODE_INTERNALS + Py_hash_t hash1, hash2; + hash1 = ((PyBytesObject*)s1)->ob_shash; + hash2 = ((PyBytesObject*)s2)->ob_shash; + if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { + return (equals == Py_NE); + } +#endif + result = memcmp(ps1, ps2, (size_t)length); + return (equals == Py_EQ) ? (result == 0) : (result != 0); + } + } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) { + return (equals == Py_NE); + } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) { + return (equals == Py_NE); + } else { + int result; + PyObject* py_result = PyObject_RichCompare(s1, s2, equals); + if (!py_result) + return -1; + result = __Pyx_PyObject_IsTrue(py_result); + Py_DECREF(py_result); + return result; + } +#endif +} + +/* UnicodeEquals */ +static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { +#if CYTHON_COMPILING_IN_PYPY + return PyObject_RichCompareBool(s1, s2, equals); +#else +#if PY_MAJOR_VERSION < 3 + PyObject* owned_ref = NULL; +#endif + int s1_is_unicode, s2_is_unicode; + if (s1 == s2) { + goto return_eq; + } + s1_is_unicode = PyUnicode_CheckExact(s1); + s2_is_unicode = PyUnicode_CheckExact(s2); +#if PY_MAJOR_VERSION < 3 + if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) { + owned_ref = PyUnicode_FromObject(s2); + if (unlikely(!owned_ref)) + return -1; + s2 = owned_ref; + s2_is_unicode = 1; + } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) { + owned_ref = PyUnicode_FromObject(s1); + if (unlikely(!owned_ref)) + return -1; + s1 = owned_ref; + s1_is_unicode = 1; + } else if (((!s2_is_unicode) & (!s1_is_unicode))) { + return __Pyx_PyBytes_Equals(s1, s2, equals); + } +#endif + if (s1_is_unicode & s2_is_unicode) { + Py_ssize_t length; + int kind; + void *data1, *data2; + if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0)) + return -1; + length = __Pyx_PyUnicode_GET_LENGTH(s1); + if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) { + goto return_ne; + } +#if CYTHON_USE_UNICODE_INTERNALS + { + Py_hash_t hash1, hash2; + #if CYTHON_PEP393_ENABLED + hash1 = ((PyASCIIObject*)s1)->hash; + hash2 = ((PyASCIIObject*)s2)->hash; + #else + hash1 = ((PyUnicodeObject*)s1)->hash; + hash2 = ((PyUnicodeObject*)s2)->hash; + #endif + if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { + goto return_ne; + } + } +#endif + kind = __Pyx_PyUnicode_KIND(s1); + if (kind != __Pyx_PyUnicode_KIND(s2)) { + goto return_ne; + } + data1 = __Pyx_PyUnicode_DATA(s1); + data2 = __Pyx_PyUnicode_DATA(s2); + if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) { + goto return_ne; + } else if (length == 1) { + goto return_eq; + } else { + int result = memcmp(data1, data2, (size_t)(length * kind)); + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_EQ) ? (result == 0) : (result != 0); + } + } else if ((s1 == Py_None) & s2_is_unicode) { + goto return_ne; + } else if ((s2 == Py_None) & s1_is_unicode) { + goto return_ne; + } else { + int result; + PyObject* py_result = PyObject_RichCompare(s1, s2, equals); + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + if (!py_result) + return -1; + result = __Pyx_PyObject_IsTrue(py_result); + Py_DECREF(py_result); + return result; + } +return_eq: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_EQ); +return_ne: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_NE); +#endif +} + +/* GetItemInt */ +static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { + PyObject *r; + if (!j) return NULL; + r = PyObject_GetItem(o, j); + Py_DECREF(j); + return r; +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, + CYTHON_NCP_UNUSED int wraparound, + CYTHON_NCP_UNUSED int boundscheck) { +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + Py_ssize_t wrapped_i = i; + if (wraparound & unlikely(i < 0)) { + wrapped_i += PyList_GET_SIZE(o); + } + if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) { + PyObject *r = PyList_GET_ITEM(o, wrapped_i); + Py_INCREF(r); + return r; + } + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +#else + return PySequence_GetItem(o, i); +#endif +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, + CYTHON_NCP_UNUSED int wraparound, + CYTHON_NCP_UNUSED int boundscheck) { +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + Py_ssize_t wrapped_i = i; + if (wraparound & unlikely(i < 0)) { + wrapped_i += PyTuple_GET_SIZE(o); + } + if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) { + PyObject *r = PyTuple_GET_ITEM(o, wrapped_i); + Py_INCREF(r); + return r; + } + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +#else + return PySequence_GetItem(o, i); +#endif +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, + CYTHON_NCP_UNUSED int wraparound, + CYTHON_NCP_UNUSED int boundscheck) { +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS + if (is_list || PyList_CheckExact(o)) { + Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); + if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) { + PyObject *r = PyList_GET_ITEM(o, n); + Py_INCREF(r); + return r; + } + } + else if (PyTuple_CheckExact(o)) { + Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o); + if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) { + PyObject *r = PyTuple_GET_ITEM(o, n); + Py_INCREF(r); + return r; + } + } else { + PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence; + if (likely(m && m->sq_item)) { + if (wraparound && unlikely(i < 0) && likely(m->sq_length)) { + Py_ssize_t l = m->sq_length(o); + if (likely(l >= 0)) { + i += l; + } else { + if (!PyErr_ExceptionMatches(PyExc_OverflowError)) + return NULL; + PyErr_Clear(); + } + } + return m->sq_item(o, i); + } + } +#else + if (is_list || PySequence_Check(o)) { + return PySequence_GetItem(o, i); + } +#endif + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +} + +/* RaiseDoubleKeywords */ +static void __Pyx_RaiseDoubleKeywordsError( + const char* func_name, + PyObject* kw_name) +{ + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION >= 3 + "%s() got multiple values for keyword argument '%U'", func_name, kw_name); + #else + "%s() got multiple values for keyword argument '%s'", func_name, + PyString_AsString(kw_name)); + #endif +} + +/* ParseKeywords */ +static int __Pyx_ParseOptionalKeywords( + PyObject *kwds, + PyObject **argnames[], + PyObject *kwds2, + PyObject *values[], + Py_ssize_t num_pos_args, + const char* function_name) +{ + PyObject *key = 0, *value = 0; + Py_ssize_t pos = 0; + PyObject*** name; + PyObject*** first_kw_arg = argnames + num_pos_args; + while (PyDict_Next(kwds, &pos, &key, &value)) { + name = first_kw_arg; + while (*name && (**name != key)) name++; + if (*name) { + values[name-argnames] = value; + continue; + } + name = first_kw_arg; + #if PY_MAJOR_VERSION < 3 + if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) { + while (*name) { + if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) + && _PyString_Eq(**name, key)) { + values[name-argnames] = value; + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + if ((**argname == key) || ( + (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) + && _PyString_Eq(**argname, key))) { + goto arg_passed_twice; + } + argname++; + } + } + } else + #endif + if (likely(PyUnicode_Check(key))) { + while (*name) { + int cmp = (**name == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 : + #endif + PyUnicode_Compare(**name, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) { + values[name-argnames] = value; + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + int cmp = (**argname == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 : + #endif + PyUnicode_Compare(**argname, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) goto arg_passed_twice; + argname++; + } + } + } else + goto invalid_keyword_type; + if (kwds2) { + if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; + } else { + goto invalid_keyword; + } + } + return 0; +arg_passed_twice: + __Pyx_RaiseDoubleKeywordsError(function_name, key); + goto bad; +invalid_keyword_type: + PyErr_Format(PyExc_TypeError, + "%.200s() keywords must be strings", function_name); + goto bad; +invalid_keyword: + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION < 3 + "%.200s() got an unexpected keyword argument '%.200s'", + function_name, PyString_AsString(key)); + #else + "%s() got an unexpected keyword argument '%U'", + function_name, key); + #endif +bad: + return -1; +} + +/* ArgTypeTest */ +static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact) +{ + if (unlikely(!type)) { + PyErr_SetString(PyExc_SystemError, "Missing type object"); + return 0; + } + else if (exact) { + #if PY_MAJOR_VERSION == 2 + if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1; + #endif + } + else { + if (likely(__Pyx_TypeCheck(obj, type))) return 1; + } + PyErr_Format(PyExc_TypeError, + "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)", + name, type->tp_name, Py_TYPE(obj)->tp_name); + return 0; +} + +/* ObjectGetItem */ +#if CYTHON_USE_TYPE_SLOTS +static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject* index) { + PyObject *runerr; + Py_ssize_t key_value; + PySequenceMethods *m = Py_TYPE(obj)->tp_as_sequence; + if (unlikely(!(m && m->sq_item))) { + PyErr_Format(PyExc_TypeError, "'%.200s' object is not subscriptable", Py_TYPE(obj)->tp_name); + return NULL; + } + key_value = __Pyx_PyIndex_AsSsize_t(index); + if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) { + return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1); + } + if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) { + PyErr_Clear(); + PyErr_Format(PyExc_IndexError, "cannot fit '%.200s' into an index-sized integer", Py_TYPE(index)->tp_name); + } + return NULL; +} +static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key) { + PyMappingMethods *m = Py_TYPE(obj)->tp_as_mapping; + if (likely(m && m->mp_subscript)) { + return m->mp_subscript(obj, key); + } + return __Pyx_PyObject_GetIndex(obj, key); +} +#endif + +/* GetTopmostException */ +#if CYTHON_USE_EXC_INFO_STACK +static _PyErr_StackItem * +__Pyx_PyErr_GetTopmostException(PyThreadState *tstate) +{ + _PyErr_StackItem *exc_info = tstate->exc_info; + while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) && + exc_info->previous_item != NULL) + { + exc_info = exc_info->previous_item; + } + return exc_info; +} +#endif + +/* SaveResetException */ +#if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { + #if CYTHON_USE_EXC_INFO_STACK + _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate); + *type = exc_info->exc_type; + *value = exc_info->exc_value; + *tb = exc_info->exc_traceback; + #else + *type = tstate->exc_type; + *value = tstate->exc_value; + *tb = tstate->exc_traceback; + #endif + Py_XINCREF(*type); + Py_XINCREF(*value); + Py_XINCREF(*tb); +} +static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + #if CYTHON_USE_EXC_INFO_STACK + _PyErr_StackItem *exc_info = tstate->exc_info; + tmp_type = exc_info->exc_type; + tmp_value = exc_info->exc_value; + tmp_tb = exc_info->exc_traceback; + exc_info->exc_type = type; + exc_info->exc_value = value; + exc_info->exc_traceback = tb; + #else + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = type; + tstate->exc_value = value; + tstate->exc_traceback = tb; + #endif + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +} +#endif + +/* PyErrExceptionMatches */ +#if CYTHON_FAST_THREAD_STATE +static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { + Py_ssize_t i, n; + n = PyTuple_GET_SIZE(tuple); +#if PY_MAJOR_VERSION >= 3 + for (i=0; icurexc_type; + if (exc_type == err) return 1; + if (unlikely(!exc_type)) return 0; + if (unlikely(PyTuple_Check(err))) + return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err); + return __Pyx_PyErr_GivenExceptionMatches(exc_type, err); +} +#endif + +/* GetException */ +#if CYTHON_FAST_THREAD_STATE +static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) +#else +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) +#endif +{ + PyObject *local_type, *local_value, *local_tb; +#if CYTHON_FAST_THREAD_STATE + PyObject *tmp_type, *tmp_value, *tmp_tb; + local_type = tstate->curexc_type; + local_value = tstate->curexc_value; + local_tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +#else + PyErr_Fetch(&local_type, &local_value, &local_tb); +#endif + PyErr_NormalizeException(&local_type, &local_value, &local_tb); +#if CYTHON_FAST_THREAD_STATE + if (unlikely(tstate->curexc_type)) +#else + if (unlikely(PyErr_Occurred())) +#endif + goto bad; + #if PY_MAJOR_VERSION >= 3 + if (local_tb) { + if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) + goto bad; + } + #endif + Py_XINCREF(local_tb); + Py_XINCREF(local_type); + Py_XINCREF(local_value); + *type = local_type; + *value = local_value; + *tb = local_tb; +#if CYTHON_FAST_THREAD_STATE + #if CYTHON_USE_EXC_INFO_STACK + { + _PyErr_StackItem *exc_info = tstate->exc_info; + tmp_type = exc_info->exc_type; + tmp_value = exc_info->exc_value; + tmp_tb = exc_info->exc_traceback; + exc_info->exc_type = local_type; + exc_info->exc_value = local_value; + exc_info->exc_traceback = local_tb; + } + #else + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = local_type; + tstate->exc_value = local_value; + tstate->exc_traceback = local_tb; + #endif + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#else + PyErr_SetExcInfo(local_type, local_value, local_tb); +#endif + return 0; +bad: + *type = 0; + *value = 0; + *tb = 0; + Py_XDECREF(local_type); + Py_XDECREF(local_value); + Py_XDECREF(local_tb); + return -1; +} + +/* StringJoin */ +#if !CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values) { + return PyObject_CallMethodObjArgs(sep, __pyx_n_s_join, values, NULL); +} +#endif + +/* PyObject_GenericGetAttrNoDict */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) { + PyErr_Format(PyExc_AttributeError, +#if PY_MAJOR_VERSION >= 3 + "'%.50s' object has no attribute '%U'", + tp->tp_name, attr_name); +#else + "'%.50s' object has no attribute '%.400s'", + tp->tp_name, PyString_AS_STRING(attr_name)); +#endif + return NULL; +} +static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) { + PyObject *descr; + PyTypeObject *tp = Py_TYPE(obj); + if (unlikely(!PyString_Check(attr_name))) { + return PyObject_GenericGetAttr(obj, attr_name); + } + assert(!tp->tp_dictoffset); + descr = _PyType_Lookup(tp, attr_name); + if (unlikely(!descr)) { + return __Pyx_RaiseGenericGetAttributeError(tp, attr_name); + } + Py_INCREF(descr); + #if PY_MAJOR_VERSION < 3 + if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS))) + #endif + { + descrgetfunc f = Py_TYPE(descr)->tp_descr_get; + if (unlikely(f)) { + PyObject *res = f(descr, obj, (PyObject *)tp); + Py_DECREF(descr); + return res; + } + } + return descr; +} +#endif + +/* PyObject_GenericGetAttr */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) { + if (unlikely(Py_TYPE(obj)->tp_dictoffset)) { + return PyObject_GenericGetAttr(obj, attr_name); + } + return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name); +} +#endif + +/* SetVTable */ +static int __Pyx_SetVtable(PyObject *dict, void *vtable) { +#if PY_VERSION_HEX >= 0x02070000 + PyObject *ob = PyCapsule_New(vtable, 0, 0); +#else + PyObject *ob = PyCObject_FromVoidPtr(vtable, 0); +#endif + if (!ob) + goto bad; + if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0) + goto bad; + Py_DECREF(ob); + return 0; +bad: + Py_XDECREF(ob); + return -1; +} + +/* Import */ +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { + PyObject *empty_list = 0; + PyObject *module = 0; + PyObject *global_dict = 0; + PyObject *empty_dict = 0; + PyObject *list; + #if PY_MAJOR_VERSION < 3 + PyObject *py_import; + py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); + if (!py_import) + goto bad; + #endif + if (from_list) + list = from_list; + else { + empty_list = PyList_New(0); + if (!empty_list) + goto bad; + list = empty_list; + } + global_dict = PyModule_GetDict(__pyx_m); + if (!global_dict) + goto bad; + empty_dict = PyDict_New(); + if (!empty_dict) + goto bad; + { + #if PY_MAJOR_VERSION >= 3 + if (level == -1) { + if (strchr(__Pyx_MODULE_NAME, '.')) { + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, 1); + if (!module) { + if (!PyErr_ExceptionMatches(PyExc_ImportError)) + goto bad; + PyErr_Clear(); + } + } + level = 0; + } + #endif + if (!module) { + #if PY_MAJOR_VERSION < 3 + PyObject *py_level = PyInt_FromLong(level); + if (!py_level) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, py_level, (PyObject *)NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, level); + #endif + } + } +bad: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(py_import); + #endif + Py_XDECREF(empty_list); + Py_XDECREF(empty_dict); + return module; +} + +/* ImportFrom */ +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { + PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); + if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_Format(PyExc_ImportError, + #if PY_MAJOR_VERSION < 3 + "cannot import name %.230s", PyString_AS_STRING(name)); + #else + "cannot import name %S", name); + #endif + } + return value; +} + +/* FetchCommonType */ +static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { + PyObject* fake_module; + PyTypeObject* cached_type = NULL; + fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI); + if (!fake_module) return NULL; + Py_INCREF(fake_module); + cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name); + if (cached_type) { + if (!PyType_Check((PyObject*)cached_type)) { + PyErr_Format(PyExc_TypeError, + "Shared Cython type %.200s is not a type object", + type->tp_name); + goto bad; + } + if (cached_type->tp_basicsize != type->tp_basicsize) { + PyErr_Format(PyExc_TypeError, + "Shared Cython type %.200s has the wrong size, try recompiling", + type->tp_name); + goto bad; + } + } else { + if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; + PyErr_Clear(); + if (PyType_Ready(type) < 0) goto bad; + if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0) + goto bad; + Py_INCREF(type); + cached_type = type; + } +done: + Py_DECREF(fake_module); + return cached_type; +bad: + Py_XDECREF(cached_type); + cached_type = NULL; + goto done; +} + +/* CythonFunction */ +#include +static PyObject * +__Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure) +{ + if (unlikely(op->func_doc == NULL)) { + if (op->func.m_ml->ml_doc) { +#if PY_MAJOR_VERSION >= 3 + op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc); +#else + op->func_doc = PyString_FromString(op->func.m_ml->ml_doc); +#endif + if (unlikely(op->func_doc == NULL)) + return NULL; + } else { + Py_INCREF(Py_None); + return Py_None; + } + } + Py_INCREF(op->func_doc); + return op->func_doc; +} +static int +__Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context) +{ + PyObject *tmp = op->func_doc; + if (value == NULL) { + value = Py_None; + } + Py_INCREF(value); + op->func_doc = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + if (unlikely(op->func_name == NULL)) { +#if PY_MAJOR_VERSION >= 3 + op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name); +#else + op->func_name = PyString_InternFromString(op->func.m_ml->ml_name); +#endif + if (unlikely(op->func_name == NULL)) + return NULL; + } + Py_INCREF(op->func_name); + return op->func_name; +} +static int +__Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context) +{ + PyObject *tmp; +#if PY_MAJOR_VERSION >= 3 + if (unlikely(value == NULL || !PyUnicode_Check(value))) +#else + if (unlikely(value == NULL || !PyString_Check(value))) +#endif + { + PyErr_SetString(PyExc_TypeError, + "__name__ must be set to a string object"); + return -1; + } + tmp = op->func_name; + Py_INCREF(value); + op->func_name = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + Py_INCREF(op->func_qualname); + return op->func_qualname; +} +static int +__Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context) +{ + PyObject *tmp; +#if PY_MAJOR_VERSION >= 3 + if (unlikely(value == NULL || !PyUnicode_Check(value))) +#else + if (unlikely(value == NULL || !PyString_Check(value))) +#endif + { + PyErr_SetString(PyExc_TypeError, + "__qualname__ must be set to a string object"); + return -1; + } + tmp = op->func_qualname; + Py_INCREF(value); + op->func_qualname = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED void *closure) +{ + PyObject *self; + self = m->func_closure; + if (self == NULL) + self = Py_None; + Py_INCREF(self); + return self; +} +static PyObject * +__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + if (unlikely(op->func_dict == NULL)) { + op->func_dict = PyDict_New(); + if (unlikely(op->func_dict == NULL)) + return NULL; + } + Py_INCREF(op->func_dict); + return op->func_dict; +} +static int +__Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context) +{ + PyObject *tmp; + if (unlikely(value == NULL)) { + PyErr_SetString(PyExc_TypeError, + "function's dictionary may not be deleted"); + return -1; + } + if (unlikely(!PyDict_Check(value))) { + PyErr_SetString(PyExc_TypeError, + "setting function's dictionary to a non-dict"); + return -1; + } + tmp = op->func_dict; + Py_INCREF(value); + op->func_dict = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + Py_INCREF(op->func_globals); + return op->func_globals; +} +static PyObject * +__Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + Py_INCREF(Py_None); + return Py_None; +} +static PyObject * +__Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + PyObject* result = (op->func_code) ? op->func_code : Py_None; + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { + int result = 0; + PyObject *res = op->defaults_getter((PyObject *) op); + if (unlikely(!res)) + return -1; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + op->defaults_tuple = PyTuple_GET_ITEM(res, 0); + Py_INCREF(op->defaults_tuple); + op->defaults_kwdict = PyTuple_GET_ITEM(res, 1); + Py_INCREF(op->defaults_kwdict); + #else + op->defaults_tuple = PySequence_ITEM(res, 0); + if (unlikely(!op->defaults_tuple)) result = -1; + else { + op->defaults_kwdict = PySequence_ITEM(res, 1); + if (unlikely(!op->defaults_kwdict)) result = -1; + } + #endif + Py_DECREF(res); + return result; +} +static int +__Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) { + PyObject* tmp; + if (!value) { + value = Py_None; + } else if (value != Py_None && !PyTuple_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__defaults__ must be set to a tuple object"); + return -1; + } + Py_INCREF(value); + tmp = op->defaults_tuple; + op->defaults_tuple = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) { + PyObject* result = op->defaults_tuple; + if (unlikely(!result)) { + if (op->defaults_getter) { + if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL; + result = op->defaults_tuple; + } else { + result = Py_None; + } + } + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) { + PyObject* tmp; + if (!value) { + value = Py_None; + } else if (value != Py_None && !PyDict_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__kwdefaults__ must be set to a dict object"); + return -1; + } + Py_INCREF(value); + tmp = op->defaults_kwdict; + op->defaults_kwdict = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) { + PyObject* result = op->defaults_kwdict; + if (unlikely(!result)) { + if (op->defaults_getter) { + if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL; + result = op->defaults_kwdict; + } else { + result = Py_None; + } + } + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) { + PyObject* tmp; + if (!value || value == Py_None) { + value = NULL; + } else if (!PyDict_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__annotations__ must be set to a dict object"); + return -1; + } + Py_XINCREF(value); + tmp = op->func_annotations; + op->func_annotations = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) { + PyObject* result = op->func_annotations; + if (unlikely(!result)) { + result = PyDict_New(); + if (unlikely(!result)) return NULL; + op->func_annotations = result; + } + Py_INCREF(result); + return result; +} +static PyGetSetDef __pyx_CyFunction_getsets[] = { + {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, + {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, + {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, + {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, + {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, + {(char *) "__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0}, + {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, + {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, + {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, + {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, + {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, + {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, + {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, + {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, + {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, + {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, + {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, + {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, + {0, 0, 0, 0, 0} +}; +static PyMemberDef __pyx_CyFunction_members[] = { + {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), PY_WRITE_RESTRICTED, 0}, + {0, 0, 0, 0, 0} +}; +static PyObject * +__Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args) +{ +#if PY_MAJOR_VERSION >= 3 + return PyUnicode_FromString(m->func.m_ml->ml_name); +#else + return PyString_FromString(m->func.m_ml->ml_name); +#endif +} +static PyMethodDef __pyx_CyFunction_methods[] = { + {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, + {0, 0, 0, 0} +}; +#if PY_VERSION_HEX < 0x030500A0 +#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist) +#else +#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func.m_weakreflist) +#endif +static PyObject *__Pyx_CyFunction_New(PyTypeObject *type, PyMethodDef *ml, int flags, PyObject* qualname, + PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { + __pyx_CyFunctionObject *op = PyObject_GC_New(__pyx_CyFunctionObject, type); + if (op == NULL) + return NULL; + op->flags = flags; + __Pyx_CyFunction_weakreflist(op) = NULL; + op->func.m_ml = ml; + op->func.m_self = (PyObject *) op; + Py_XINCREF(closure); + op->func_closure = closure; + Py_XINCREF(module); + op->func.m_module = module; + op->func_dict = NULL; + op->func_name = NULL; + Py_INCREF(qualname); + op->func_qualname = qualname; + op->func_doc = NULL; + op->func_classobj = NULL; + op->func_globals = globals; + Py_INCREF(op->func_globals); + Py_XINCREF(code); + op->func_code = code; + op->defaults_pyobjects = 0; + op->defaults = NULL; + op->defaults_tuple = NULL; + op->defaults_kwdict = NULL; + op->defaults_getter = NULL; + op->func_annotations = NULL; + PyObject_GC_Track(op); + return (PyObject *) op; +} +static int +__Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) +{ + Py_CLEAR(m->func_closure); + Py_CLEAR(m->func.m_module); + Py_CLEAR(m->func_dict); + Py_CLEAR(m->func_name); + Py_CLEAR(m->func_qualname); + Py_CLEAR(m->func_doc); + Py_CLEAR(m->func_globals); + Py_CLEAR(m->func_code); + Py_CLEAR(m->func_classobj); + Py_CLEAR(m->defaults_tuple); + Py_CLEAR(m->defaults_kwdict); + Py_CLEAR(m->func_annotations); + if (m->defaults) { + PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); + int i; + for (i = 0; i < m->defaults_pyobjects; i++) + Py_XDECREF(pydefaults[i]); + PyObject_Free(m->defaults); + m->defaults = NULL; + } + return 0; +} +static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m) +{ + if (__Pyx_CyFunction_weakreflist(m) != NULL) + PyObject_ClearWeakRefs((PyObject *) m); + __Pyx_CyFunction_clear(m); + PyObject_GC_Del(m); +} +static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) +{ + PyObject_GC_UnTrack(m); + __Pyx__CyFunction_dealloc(m); +} +static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) +{ + Py_VISIT(m->func_closure); + Py_VISIT(m->func.m_module); + Py_VISIT(m->func_dict); + Py_VISIT(m->func_name); + Py_VISIT(m->func_qualname); + Py_VISIT(m->func_doc); + Py_VISIT(m->func_globals); + Py_VISIT(m->func_code); + Py_VISIT(m->func_classobj); + Py_VISIT(m->defaults_tuple); + Py_VISIT(m->defaults_kwdict); + if (m->defaults) { + PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); + int i; + for (i = 0; i < m->defaults_pyobjects; i++) + Py_VISIT(pydefaults[i]); + } + return 0; +} +static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type) +{ + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) { + Py_INCREF(func); + return func; + } + if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) { + if (type == NULL) + type = (PyObject *)(Py_TYPE(obj)); + return __Pyx_PyMethod_New(func, type, (PyObject *)(Py_TYPE(type))); + } + if (obj == Py_None) + obj = NULL; + return __Pyx_PyMethod_New(func, obj, type); +} +static PyObject* +__Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) +{ +#if PY_MAJOR_VERSION >= 3 + return PyUnicode_FromFormat("", + op->func_qualname, (void *)op); +#else + return PyString_FromFormat("", + PyString_AsString(op->func_qualname), (void *)op); +#endif +} +static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) { + PyCFunctionObject* f = (PyCFunctionObject*)func; + PyCFunction meth = f->m_ml->ml_meth; + Py_ssize_t size; + switch (f->m_ml->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) { + case METH_VARARGS: + if (likely(kw == NULL || PyDict_Size(kw) == 0)) + return (*meth)(self, arg); + break; + case METH_VARARGS | METH_KEYWORDS: + return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw); + case METH_NOARGS: + if (likely(kw == NULL || PyDict_Size(kw) == 0)) { + size = PyTuple_GET_SIZE(arg); + if (likely(size == 0)) + return (*meth)(self, NULL); + PyErr_Format(PyExc_TypeError, + "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", + f->m_ml->ml_name, size); + return NULL; + } + break; + case METH_O: + if (likely(kw == NULL || PyDict_Size(kw) == 0)) { + size = PyTuple_GET_SIZE(arg); + if (likely(size == 1)) { + PyObject *result, *arg0; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + arg0 = PyTuple_GET_ITEM(arg, 0); + #else + arg0 = PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL; + #endif + result = (*meth)(self, arg0); + #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) + Py_DECREF(arg0); + #endif + return result; + } + PyErr_Format(PyExc_TypeError, + "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", + f->m_ml->ml_name, size); + return NULL; + } + break; + default: + PyErr_SetString(PyExc_SystemError, "Bad call flags in " + "__Pyx_CyFunction_Call. METH_OLDARGS is no " + "longer supported!"); + return NULL; + } + PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", + f->m_ml->ml_name); + return NULL; +} +static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { + return __Pyx_CyFunction_CallMethod(func, ((PyCFunctionObject*)func)->m_self, arg, kw); +} +static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) { + PyObject *result; + __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func; + if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { + Py_ssize_t argc; + PyObject *new_args; + PyObject *self; + argc = PyTuple_GET_SIZE(args); + new_args = PyTuple_GetSlice(args, 1, argc); + if (unlikely(!new_args)) + return NULL; + self = PyTuple_GetItem(args, 0); + if (unlikely(!self)) { + Py_DECREF(new_args); + return NULL; + } + result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw); + Py_DECREF(new_args); + } else { + result = __Pyx_CyFunction_Call(func, args, kw); + } + return result; +} +static PyTypeObject __pyx_CyFunctionType_type = { + PyVarObject_HEAD_INIT(0, 0) + "cython_function_or_method", + sizeof(__pyx_CyFunctionObject), + 0, + (destructor) __Pyx_CyFunction_dealloc, + 0, + 0, + 0, +#if PY_MAJOR_VERSION < 3 + 0, +#else + 0, +#endif + (reprfunc) __Pyx_CyFunction_repr, + 0, + 0, + 0, + 0, + __Pyx_CyFunction_CallAsMethod, + 0, + 0, + 0, + 0, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, + 0, + (traverseproc) __Pyx_CyFunction_traverse, + (inquiry) __Pyx_CyFunction_clear, + 0, +#if PY_VERSION_HEX < 0x030500A0 + offsetof(__pyx_CyFunctionObject, func_weakreflist), +#else + offsetof(PyCFunctionObject, m_weakreflist), +#endif + 0, + 0, + __pyx_CyFunction_methods, + __pyx_CyFunction_members, + __pyx_CyFunction_getsets, + 0, + 0, + __Pyx_CyFunction_descr_get, + 0, + offsetof(__pyx_CyFunctionObject, func_dict), + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, +#if PY_VERSION_HEX >= 0x030400a1 + 0, +#endif +}; +static int __pyx_CyFunction_init(void) { + __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); + if (unlikely(__pyx_CyFunctionType == NULL)) { + return -1; + } + return 0; +} +static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults = PyObject_Malloc(size); + if (unlikely(!m->defaults)) + return PyErr_NoMemory(); + memset(m->defaults, 0, size); + m->defaults_pyobjects = pyobjects; + return m->defaults; +} +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults_tuple = tuple; + Py_INCREF(tuple); +} +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults_kwdict = dict; + Py_INCREF(dict); +} +static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->func_annotations = dict; + Py_INCREF(dict); +} + +/* GetModuleGlobalName */ +#if CYTHON_USE_DICT_VERSIONS +static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value) +#else +static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) +#endif +{ + PyObject *result; +#if !CYTHON_AVOID_BORROWED_REFS +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 + result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } else if (unlikely(PyErr_Occurred())) { + return NULL; + } +#else + result = PyDict_GetItem(__pyx_d, name); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } +#endif +#else + result = PyObject_GetItem(__pyx_d, name); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } + PyErr_Clear(); +#endif + return __Pyx_GetBuiltinName(name); +} + +/* GetAttr */ +static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) { +#if CYTHON_USE_TYPE_SLOTS +#if PY_MAJOR_VERSION >= 3 + if (likely(PyUnicode_Check(n))) +#else + if (likely(PyString_Check(n))) +#endif + return __Pyx_PyObject_GetAttrStr(o, n); +#endif + return PyObject_GetAttr(o, n); +} + +/* Globals */ +static PyObject* __Pyx_Globals(void) { + Py_ssize_t i; + PyObject *names; + PyObject *globals = __pyx_d; + Py_INCREF(globals); + names = PyObject_Dir(__pyx_m); + if (!names) + goto bad; + for (i = PyList_GET_SIZE(names)-1; i >= 0; i--) { +#if CYTHON_COMPILING_IN_PYPY + PyObject* name = PySequence_ITEM(names, i); + if (!name) + goto bad; +#else + PyObject* name = PyList_GET_ITEM(names, i); +#endif + if (!PyDict_Contains(globals, name)) { + PyObject* value = __Pyx_GetAttr(__pyx_m, name); + if (!value) { +#if CYTHON_COMPILING_IN_PYPY + Py_DECREF(name); +#endif + goto bad; + } + if (PyDict_SetItem(globals, name, value) < 0) { +#if CYTHON_COMPILING_IN_PYPY + Py_DECREF(name); +#endif + Py_DECREF(value); + goto bad; + } + } +#if CYTHON_COMPILING_IN_PYPY + Py_DECREF(name); +#endif + } + Py_DECREF(names); + return globals; +bad: + Py_XDECREF(names); + Py_XDECREF(globals); + return NULL; +} + +/* PyErrFetchRestore */ +#if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + tmp_type = tstate->curexc_type; + tmp_value = tstate->curexc_value; + tmp_tb = tstate->curexc_traceback; + tstate->curexc_type = type; + tstate->curexc_value = value; + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +} +static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { + *type = tstate->curexc_type; + *value = tstate->curexc_value; + *tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +} +#endif + +/* CLineInTraceback */ +#ifndef CYTHON_CLINE_IN_TRACEBACK +static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { + PyObject *use_cline; + PyObject *ptype, *pvalue, *ptraceback; +#if CYTHON_COMPILING_IN_CPYTHON + PyObject **cython_runtime_dict; +#endif + if (unlikely(!__pyx_cython_runtime)) { + return c_line; + } + __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); +#if CYTHON_COMPILING_IN_CPYTHON + cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); + if (likely(cython_runtime_dict)) { + __PYX_PY_DICT_LOOKUP_IF_MODIFIED( + use_cline, *cython_runtime_dict, + __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback)) + } else +#endif + { + PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback); + if (use_cline_obj) { + use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; + Py_DECREF(use_cline_obj); + } else { + PyErr_Clear(); + use_cline = NULL; + } + } + if (!use_cline) { + c_line = 0; + PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); + } + else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { + c_line = 0; + } + __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); + return c_line; +} +#endif + +/* CodeObjectCache */ +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { + int start = 0, mid = 0, end = count - 1; + if (end >= 0 && code_line > entries[end].code_line) { + return count; + } + while (start < end) { + mid = start + (end - start) / 2; + if (code_line < entries[mid].code_line) { + end = mid; + } else if (code_line > entries[mid].code_line) { + start = mid + 1; + } else { + return mid; + } + } + if (code_line <= entries[mid].code_line) { + return mid; + } else { + return mid + 1; + } +} +static PyCodeObject *__pyx_find_code_object(int code_line) { + PyCodeObject* code_object; + int pos; + if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { + return NULL; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { + return NULL; + } + code_object = __pyx_code_cache.entries[pos].code_object; + Py_INCREF(code_object); + return code_object; +} +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { + int pos, i; + __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; + if (unlikely(!code_line)) { + return; + } + if (unlikely(!entries)) { + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); + if (likely(entries)) { + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = 64; + __pyx_code_cache.count = 1; + entries[0].code_line = code_line; + entries[0].code_object = code_object; + Py_INCREF(code_object); + } + return; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { + PyCodeObject* tmp = entries[pos].code_object; + entries[pos].code_object = code_object; + Py_DECREF(tmp); + return; + } + if (__pyx_code_cache.count == __pyx_code_cache.max_count) { + int new_max = __pyx_code_cache.max_count + 64; + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( + __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry)); + if (unlikely(!entries)) { + return; + } + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = new_max; + } + for (i=__pyx_code_cache.count; i>pos; i--) { + entries[i] = entries[i-1]; + } + entries[pos].code_line = code_line; + entries[pos].code_object = code_object; + __pyx_code_cache.count++; + Py_INCREF(code_object); +} + +/* AddTraceback */ +#include "compile.h" +#include "frameobject.h" +#include "traceback.h" +static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( + const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyObject *py_srcfile = 0; + PyObject *py_funcname = 0; + #if PY_MAJOR_VERSION < 3 + py_srcfile = PyString_FromString(filename); + #else + py_srcfile = PyUnicode_FromString(filename); + #endif + if (!py_srcfile) goto bad; + if (c_line) { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + #else + py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + #endif + } + else { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromString(funcname); + #else + py_funcname = PyUnicode_FromString(funcname); + #endif + } + if (!py_funcname) goto bad; + py_code = __Pyx_PyCode_New( + 0, + 0, + 0, + 0, + 0, + __pyx_empty_bytes, /*PyObject *code,*/ + __pyx_empty_tuple, /*PyObject *consts,*/ + __pyx_empty_tuple, /*PyObject *names,*/ + __pyx_empty_tuple, /*PyObject *varnames,*/ + __pyx_empty_tuple, /*PyObject *freevars,*/ + __pyx_empty_tuple, /*PyObject *cellvars,*/ + py_srcfile, /*PyObject *filename,*/ + py_funcname, /*PyObject *name,*/ + py_line, + __pyx_empty_bytes /*PyObject *lnotab*/ + ); + Py_DECREF(py_srcfile); + Py_DECREF(py_funcname); + return py_code; +bad: + Py_XDECREF(py_srcfile); + Py_XDECREF(py_funcname); + return NULL; +} +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyFrameObject *py_frame = 0; + PyThreadState *tstate = __Pyx_PyThreadState_Current; + if (c_line) { + c_line = __Pyx_CLineForTraceback(tstate, c_line); + } + py_code = __pyx_find_code_object(c_line ? -c_line : py_line); + if (!py_code) { + py_code = __Pyx_CreateCodeObjectForTraceback( + funcname, c_line, py_line, filename); + if (!py_code) goto bad; + __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); + } + py_frame = PyFrame_New( + tstate, /*PyThreadState *tstate,*/ + py_code, /*PyCodeObject *code,*/ + __pyx_d, /*PyObject *globals,*/ + 0 /*PyObject *locals*/ + ); + if (!py_frame) goto bad; + __Pyx_PyFrame_SetLineNumber(py_frame, py_line); + PyTraceBack_Here(py_frame); +bad: + Py_XDECREF(py_code); + Py_XDECREF(py_frame); +} + +/* CIntToPy */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { + const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(long) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(long) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(long) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(long), + little, !is_unsigned); + } +} + +/* CIntFromPyVerify */ +#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ + __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) +#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ + __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) +#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ + {\ + func_type value = func_value;\ + if (sizeof(target_type) < sizeof(func_type)) {\ + if (unlikely(value != (func_type) (target_type) value)) {\ + func_type zero = 0;\ + if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ + return (target_type) -1;\ + if (is_unsigned && unlikely(value < zero))\ + goto raise_neg_overflow;\ + else\ + goto raise_overflow;\ + }\ + }\ + return (target_type) value;\ + } + +/* CIntFromPy */ +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { + const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(long) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (long) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (long) 0; + case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0]) + case 2: + if (8 * sizeof(long) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) { + return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + case 3: + if (8 * sizeof(long) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) { + return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + case 4: + if (8 * sizeof(long) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) { + return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (long) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if (sizeof(long) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (long) 0; + case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0])) + case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0]) + case -2: + if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 2: + if (8 * sizeof(long) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case -3: + if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 3: + if (8 * sizeof(long) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case -4: + if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 4: + if (8 * sizeof(long) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + } +#endif + if (sizeof(long) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + long val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (long) -1; + } + } else { + long val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (long) -1; + val = __Pyx_PyInt_As_long(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to long"); + return (long) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to long"); + return (long) -1; +} + +/* CIntFromPy */ +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { + const int neg_one = (int) ((int) 0 - (int) 1), const_zero = (int) 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(int) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (int) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (int) 0; + case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0]) + case 2: + if (8 * sizeof(int) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) { + return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + case 3: + if (8 * sizeof(int) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) { + return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + case 4: + if (8 * sizeof(int) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) { + return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (int) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if (sizeof(int) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (int) 0; + case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0])) + case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0]) + case -2: + if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { + return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 2: + if (8 * sizeof(int) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { + return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case -3: + if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { + return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 3: + if (8 * sizeof(int) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { + return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case -4: + if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { + return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 4: + if (8 * sizeof(int) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { + return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + } +#endif + if (sizeof(int) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + int val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (int) -1; + } + } else { + int val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (int) -1; + val = __Pyx_PyInt_As_int(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to int"); + return (int) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to int"); + return (int) -1; +} + +/* FastTypeChecks */ +#if CYTHON_COMPILING_IN_CPYTHON +static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) { + while (a) { + a = a->tp_base; + if (a == b) + return 1; + } + return b == &PyBaseObject_Type; +} +static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) { + PyObject *mro; + if (a == b) return 1; + mro = a->tp_mro; + if (likely(mro)) { + Py_ssize_t i, n; + n = PyTuple_GET_SIZE(mro); + for (i = 0; i < n; i++) { + if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b) + return 1; + } + return 0; + } + return __Pyx_InBases(a, b); +} +#if PY_MAJOR_VERSION == 2 +static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { + PyObject *exception, *value, *tb; + int res; + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ErrFetch(&exception, &value, &tb); + res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; + if (unlikely(res == -1)) { + PyErr_WriteUnraisable(err); + res = 0; + } + if (!res) { + res = PyObject_IsSubclass(err, exc_type2); + if (unlikely(res == -1)) { + PyErr_WriteUnraisable(err); + res = 0; + } + } + __Pyx_ErrRestore(exception, value, tb); + return res; +} +#else +static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { + int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0; + if (!res) { + res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); + } + return res; +} +#endif +static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { + Py_ssize_t i, n; + assert(PyExceptionClass_Check(exc_type)); + n = PyTuple_GET_SIZE(tuple); +#if PY_MAJOR_VERSION >= 3 + for (i=0; itp_setattro)) + return tp->tp_setattro(obj, attr_name, value); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_setattr)) + return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value); +#endif + return PyObject_SetAttr(obj, attr_name, value); +} +#endif + +/* VoidPtrExport */ +static int __Pyx_ExportVoidPtr(PyObject *name, void *p, const char *sig) { + PyObject *d; + PyObject *cobj = 0; + d = PyDict_GetItem(__pyx_d, __pyx_n_s_pyx_capi); + Py_XINCREF(d); + if (!d) { + d = PyDict_New(); + if (!d) + goto bad; + if (__Pyx_PyObject_SetAttrStr(__pyx_m, __pyx_n_s_pyx_capi, d) < 0) + goto bad; + } +#if PY_VERSION_HEX >= 0x02070000 + cobj = PyCapsule_New(p, sig, 0); +#else + cobj = PyCObject_FromVoidPtrAndDesc(p, (void *)sig, 0); +#endif + if (!cobj) + goto bad; + if (PyDict_SetItem(d, name, cobj) < 0) + goto bad; + Py_DECREF(cobj); + Py_DECREF(d); + return 0; +bad: + Py_XDECREF(cobj); + Py_XDECREF(d); + return -1; +} + +/* InitStrings */ +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { + while (t->p) { + #if PY_MAJOR_VERSION < 3 + if (t->is_unicode) { + *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); + } else if (t->intern) { + *t->p = PyString_InternFromString(t->s); + } else { + *t->p = PyString_FromStringAndSize(t->s, t->n - 1); + } + #else + if (t->is_unicode | t->is_str) { + if (t->intern) { + *t->p = PyUnicode_InternFromString(t->s); + } else if (t->encoding) { + *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); + } else { + *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); + } + } else { + *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); + } + #endif + if (!*t->p) + return -1; + if (PyObject_Hash(*t->p) == -1) + return -1; + ++t; + } + return 0; +} + +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { + return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); +} +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { + Py_ssize_t ignore; + return __Pyx_PyObject_AsStringAndSize(o, &ignore); +} +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +#if !CYTHON_PEP393_ENABLED +static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { + char* defenc_c; + PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); + if (!defenc) return NULL; + defenc_c = PyBytes_AS_STRING(defenc); +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + { + char* end = defenc_c + PyBytes_GET_SIZE(defenc); + char* c; + for (c = defenc_c; c < end; c++) { + if ((unsigned char) (*c) >= 128) { + PyUnicode_AsASCIIString(o); + return NULL; + } + } + } +#endif + *length = PyBytes_GET_SIZE(defenc); + return defenc_c; +} +#else +static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { + if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + if (likely(PyUnicode_IS_ASCII(o))) { + *length = PyUnicode_GET_LENGTH(o); + return PyUnicode_AsUTF8(o); + } else { + PyUnicode_AsASCIIString(o); + return NULL; + } +#else + return PyUnicode_AsUTF8AndSize(o, length); +#endif +} +#endif +#endif +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT + if ( +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + __Pyx_sys_getdefaultencoding_not_ascii && +#endif + PyUnicode_Check(o)) { + return __Pyx_PyUnicode_AsStringAndSize(o, length); + } else +#endif +#if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) + if (PyByteArray_Check(o)) { + *length = PyByteArray_GET_SIZE(o); + return PyByteArray_AS_STRING(o); + } else +#endif + { + char* result; + int r = PyBytes_AsStringAndSize(o, &result, length); + if (unlikely(r < 0)) { + return NULL; + } else { + return result; + } + } +} +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { + int is_true = x == Py_True; + if (is_true | (x == Py_False) | (x == Py_None)) return is_true; + else return PyObject_IsTrue(x); +} +static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) { + int retval; + if (unlikely(!x)) return -1; + retval = __Pyx_PyObject_IsTrue(x); + Py_DECREF(x); + return retval; +} +static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) { +#if PY_MAJOR_VERSION >= 3 + if (PyLong_Check(result)) { + if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, + "__int__ returned non-int (type %.200s). " + "The ability to return an instance of a strict subclass of int " + "is deprecated, and may be removed in a future version of Python.", + Py_TYPE(result)->tp_name)) { + Py_DECREF(result); + return NULL; + } + return result; + } +#endif + PyErr_Format(PyExc_TypeError, + "__%.4s__ returned non-%.4s (type %.200s)", + type_name, type_name, Py_TYPE(result)->tp_name); + Py_DECREF(result); + return NULL; +} +static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { +#if CYTHON_USE_TYPE_SLOTS + PyNumberMethods *m; +#endif + const char *name = NULL; + PyObject *res = NULL; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x) || PyLong_Check(x))) +#else + if (likely(PyLong_Check(x))) +#endif + return __Pyx_NewRef(x); +#if CYTHON_USE_TYPE_SLOTS + m = Py_TYPE(x)->tp_as_number; + #if PY_MAJOR_VERSION < 3 + if (m && m->nb_int) { + name = "int"; + res = m->nb_int(x); + } + else if (m && m->nb_long) { + name = "long"; + res = m->nb_long(x); + } + #else + if (likely(m && m->nb_int)) { + name = "int"; + res = m->nb_int(x); + } + #endif +#else + if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { + res = PyNumber_Int(x); + } +#endif + if (likely(res)) { +#if PY_MAJOR_VERSION < 3 + if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) { +#else + if (unlikely(!PyLong_CheckExact(res))) { +#endif + return __Pyx_PyNumber_IntOrLongWrongResultType(res, name); + } + } + else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_TypeError, + "an integer is required"); + } + return res; +} +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { + Py_ssize_t ival; + PyObject *x; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_CheckExact(b))) { + if (sizeof(Py_ssize_t) >= sizeof(long)) + return PyInt_AS_LONG(b); + else + return PyInt_AsSsize_t(b); + } +#endif + if (likely(PyLong_CheckExact(b))) { + #if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)b)->ob_digit; + const Py_ssize_t size = Py_SIZE(b); + if (likely(__Pyx_sst_abs(size) <= 1)) { + ival = likely(size) ? digits[0] : 0; + if (size == -1) ival = -ival; + return ival; + } else { + switch (size) { + case 2: + if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { + return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -2: + if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case 3: + if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { + return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -3: + if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case 4: + if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { + return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -4: + if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + } + } + #endif + return PyLong_AsSsize_t(b); + } + x = PyNumber_Index(b); + if (!x) return -1; + ival = PyInt_AsSsize_t(x); + Py_DECREF(x); + return ival; +} +static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) { + return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False); +} +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { + return PyInt_FromSize_t(ival); +} + + +#endif /* Py_PYTHON_H */ diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_tracer.html b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_tracer.html new file mode 100644 index 00000000..ebd91095 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_tracer.html @@ -0,0 +1,3096 @@ + + + + + + Cython: _tracer.py + + + +

Generated by Cython 0.29.2

+

+ Yellow lines hint at Python interaction.
+ Click on a line that starts with a "+" to see the C code that Cython generated for it. +

+

Raw output: _tracer.c

+
 001: # Copyright (c) 2018 gevent. See LICENSE for details.
+
 002: # cython: auto_pickle=False,embedsignature=True,always_allow_keywords=False
+
 003: from __future__ import print_function, absolute_import, division
+
 004: 
+
+005: import sys
+
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_sys, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_XGOTREF(__pyx_v_6gevent_8__tracer_sys);
+  __Pyx_DECREF_SET(__pyx_v_6gevent_8__tracer_sys, __pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_1);
+  __pyx_t_1 = 0;
+
+006: import traceback
+
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_traceback, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_XGOTREF(__pyx_v_6gevent_8__tracer_traceback);
+  __Pyx_DECREF_SET(__pyx_v_6gevent_8__tracer_traceback, __pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_1);
+  __pyx_t_1 = 0;
+
 007: 
+
+008: from greenlet import settrace
+
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 8, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(__pyx_n_s_settrace);
+  __Pyx_GIVEREF(__pyx_n_s_settrace);
+  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_settrace);
+  __pyx_t_2 = __Pyx_Import(__pyx_n_s_greenlet, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_settrace); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 8, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(__pyx_t_1);
+  __Pyx_XGOTREF(__pyx_v_6gevent_8__tracer_settrace);
+  __Pyx_DECREF_SET(__pyx_v_6gevent_8__tracer_settrace, __pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+009: from greenlet import getcurrent
+
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_getcurrent);
+  __Pyx_GIVEREF(__pyx_n_s_getcurrent);
+  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_getcurrent);
+  __pyx_t_1 = __Pyx_Import(__pyx_n_s_greenlet, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 9, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_getcurrent); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(__pyx_t_2);
+  __Pyx_XGOTREF(__pyx_v_6gevent_8__tracer_getcurrent);
+  __Pyx_DECREF_SET(__pyx_v_6gevent_8__tracer_getcurrent, __pyx_t_2);
+  __Pyx_GIVEREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 010: 
+
+011: from gevent.util import format_run_info
+
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 11, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(__pyx_n_s_format_run_info);
+  __Pyx_GIVEREF(__pyx_n_s_format_run_info);
+  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_format_run_info);
+  __pyx_t_2 = __Pyx_Import(__pyx_n_s_gevent_util, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 11, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_format_run_info); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 11, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(__pyx_t_1);
+  __Pyx_XGOTREF(__pyx_v_6gevent_8__tracer_format_run_info);
+  __Pyx_DECREF_SET(__pyx_v_6gevent_8__tracer_format_run_info, __pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
 012: 
+
+013: from gevent._compat import perf_counter
+
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 13, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_perf_counter);
+  __Pyx_GIVEREF(__pyx_n_s_perf_counter);
+  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_perf_counter);
+  __pyx_t_1 = __Pyx_Import(__pyx_n_s_gevent__compat, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 13, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_perf_counter); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 13, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(__pyx_t_2);
+  __Pyx_XGOTREF(__pyx_v_6gevent_8__tracer_perf_counter);
+  __Pyx_DECREF_SET(__pyx_v_6gevent_8__tracer_perf_counter, __pyx_t_2);
+  __Pyx_GIVEREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+014: from gevent._util import gmctime
+
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 14, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(__pyx_n_s_gmctime);
+  __Pyx_GIVEREF(__pyx_n_s_gmctime);
+  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_gmctime);
+  __pyx_t_2 = __Pyx_Import(__pyx_n_s_gevent__util, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 14, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_gmctime); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 14, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(__pyx_t_1);
+  __Pyx_XGOTREF(__pyx_v_6gevent_8__tracer_gmctime);
+  __Pyx_DECREF_SET(__pyx_v_6gevent_8__tracer_gmctime, __pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
 015: 
+
 016: 
+
+017: __all__ = [
+
  __pyx_t_2 = PyList_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 17, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_GreenletTracer);
+  __Pyx_GIVEREF(__pyx_n_s_GreenletTracer);
+  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_GreenletTracer);
+  __Pyx_INCREF(__pyx_n_s_HubSwitchTracer);
+  __Pyx_GIVEREF(__pyx_n_s_HubSwitchTracer);
+  PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_HubSwitchTracer);
+  __Pyx_INCREF(__pyx_n_s_MaxSwitchTracer);
+  __Pyx_GIVEREF(__pyx_n_s_MaxSwitchTracer);
+  PyList_SET_ITEM(__pyx_t_2, 2, __pyx_n_s_MaxSwitchTracer);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_all, __pyx_t_2) < 0) __PYX_ERR(0, 17, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
 018:     'GreenletTracer',
+
 019:     'HubSwitchTracer',
+
 020:     'MaxSwitchTracer',
+
 021: ]
+
 022: 
+
 023: # Recall these classes are cython compiled, so
+
 024: # class variable declarations are bad.
+
 025: 
+
 026: 
+
+027: class GreenletTracer(object):
+
struct __pyx_vtabstruct_6gevent_8__tracer_GreenletTracer {
+  PyObject *(*_trace)(struct __pyx_obj_6gevent_8__tracer_GreenletTracer *, PyObject *, PyObject *, int __pyx_skip_dispatch);
+  PyObject *(*did_block_hub)(struct __pyx_obj_6gevent_8__tracer_GreenletTracer *, PyObject *, int __pyx_skip_dispatch);
+  PyObject *(*kill)(struct __pyx_obj_6gevent_8__tracer_GreenletTracer *, int __pyx_skip_dispatch);
+};
+static struct __pyx_vtabstruct_6gevent_8__tracer_GreenletTracer *__pyx_vtabptr_6gevent_8__tracer_GreenletTracer;
+
+
+028:     def __init__(self):
+
/* Python wrapper */
+static int __pyx_pw_6gevent_8__tracer_14GreenletTracer_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static int __pyx_pw_6gevent_8__tracer_14GreenletTracer_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
+  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
+    __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
+  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1;
+  __pyx_r = __pyx_pf_6gevent_8__tracer_14GreenletTracer___init__(((struct __pyx_obj_6gevent_8__tracer_GreenletTracer *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_8__tracer_14GreenletTracer___init__(struct __pyx_obj_6gevent_8__tracer_GreenletTracer *__pyx_v_self) {
+  PyObject *__pyx_v_prev_trace = NULL;
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = 0;
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_AddTraceback("gevent.__tracer.GreenletTracer.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = -1;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_prev_trace);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
 029:         # A counter, incremented by the greenlet trace function
+
 030:         # we install on every greenlet switch. This is reset when the
+
 031:         # periodic monitoring thread runs.
+
 032: 
+
+033:         self.greenlet_switch_counter = 0
+
  __pyx_v_self->greenlet_switch_counter = 0;
+
 034: 
+
 035:         # The greenlet last switched to.
+
+036:         self.active_greenlet = None
+
  __Pyx_INCREF(Py_None);
+  __Pyx_GIVEREF(Py_None);
+  __Pyx_GOTREF(__pyx_v_self->active_greenlet);
+  __Pyx_DECREF(__pyx_v_self->active_greenlet);
+  __pyx_v_self->active_greenlet = Py_None;
+
 037: 
+
 038:         # The trace function that was previously installed,
+
 039:         # if any.
+
 040:         # NOTE: Calling a class instance is cheaper than
+
 041:         # calling a bound method (at least when compiled with cython)
+
 042:         # even when it redirects to another function.
+
+043:         prev_trace = settrace(self)
+
  __Pyx_INCREF(__pyx_v_6gevent_8__tracer_settrace);
+  __pyx_t_2 = __pyx_v_6gevent_8__tracer_settrace; __pyx_t_3 = NULL;
+  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
+    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+    if (likely(__pyx_t_3)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+      __Pyx_INCREF(__pyx_t_3);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_2, function);
+    }
+  }
+  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, ((PyObject *)__pyx_v_self)) : __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_v_self));
+  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 43, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_v_prev_trace = __pyx_t_1;
+  __pyx_t_1 = 0;
+
 044: 
+
+045:         self.previous_trace_function = prev_trace
+
  __Pyx_INCREF(__pyx_v_prev_trace);
+  __Pyx_GIVEREF(__pyx_v_prev_trace);
+  __Pyx_GOTREF(__pyx_v_self->previous_trace_function);
+  __Pyx_DECREF(__pyx_v_self->previous_trace_function);
+  __pyx_v_self->previous_trace_function = __pyx_v_prev_trace;
+
 046: 
+
+047:         self._killed = False
+
  __pyx_v_self->_killed = 0;
+
 048: 
+
+049:     def kill(self):
+
static PyObject *__pyx_pw_6gevent_8__tracer_14GreenletTracer_3kill(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyObject *__pyx_f_6gevent_8__tracer_14GreenletTracer_kill(struct __pyx_obj_6gevent_8__tracer_GreenletTracer *__pyx_v_self, int __pyx_skip_dispatch) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("kill", 0);
+  /* Check if called by wrapper */
+  if (unlikely(__pyx_skip_dispatch)) ;
+  /* Check if overridden in Python */
+  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
+    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
+    if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
+    else {
+      PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      #endif
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_kill); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 49, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_8__tracer_14GreenletTracer_3kill)) {
+        __Pyx_XDECREF(__pyx_r);
+        __Pyx_INCREF(__pyx_t_1);
+        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+          if (likely(__pyx_t_4)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+            __Pyx_INCREF(__pyx_t_4);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_3, function);
+          }
+        }
+        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
+        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 49, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __pyx_r = __pyx_t_2;
+        __pyx_t_2 = 0;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        goto __pyx_L0;
+      }
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+      tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
+      if (unlikely(type_dict_guard != tp_dict_version)) {
+        tp_dict_version = obj_dict_version = 0;
+      }
+      #endif
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    }
+    #endif
+  }
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_AddTraceback("gevent.__tracer.GreenletTracer.kill", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_8__tracer_14GreenletTracer_3kill(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6gevent_8__tracer_14GreenletTracer_2kill[] = "GreenletTracer.kill(self)";
+static PyMethodDef __pyx_mdef_6gevent_8__tracer_14GreenletTracer_3kill = {"kill", (PyCFunction)__pyx_pw_6gevent_8__tracer_14GreenletTracer_3kill, METH_NOARGS, __pyx_doc_6gevent_8__tracer_14GreenletTracer_2kill};
+static PyObject *__pyx_pw_6gevent_8__tracer_14GreenletTracer_3kill(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("kill (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_8__tracer_14GreenletTracer_2kill(((struct __pyx_obj_6gevent_8__tracer_GreenletTracer *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_8__tracer_14GreenletTracer_2kill(struct __pyx_obj_6gevent_8__tracer_GreenletTracer *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("kill", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __pyx_f_6gevent_8__tracer_14GreenletTracer_kill(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 49, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.__tracer.GreenletTracer.kill", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__3 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 49, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__3);
+  __Pyx_GIVEREF(__pyx_tuple__3);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_8__tracer_14GreenletTracer_3kill, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_GreenletTracer_kill, NULL, __pyx_n_s_gevent___tracer, __pyx_d, ((PyObject *)__pyx_codeobj__4)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 49, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_8__tracer_GreenletTracer->tp_dict, __pyx_n_s_kill, __pyx_t_2) < 0) __PYX_ERR(0, 49, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_8__tracer_GreenletTracer);
+  __pyx_codeobj__4 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__3, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__tracer_py, __pyx_n_s_kill, 49, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__4)) __PYX_ERR(0, 49, __pyx_L1_error)
+
 050:         # Must be called in the monitored thread.
+
+051:         if not self._killed:
+
  __pyx_t_5 = ((!(__pyx_v_self->_killed != 0)) != 0);
+  if (__pyx_t_5) {
+/* … */
+  }
+
+052:             self._killed = True
+
    __pyx_v_self->_killed = 1;
+
+053:             settrace(self.previous_trace_function)
+
    __Pyx_INCREF(__pyx_v_6gevent_8__tracer_settrace);
+    __pyx_t_2 = __pyx_v_6gevent_8__tracer_settrace; __pyx_t_3 = NULL;
+    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
+      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+      if (likely(__pyx_t_3)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+        __Pyx_INCREF(__pyx_t_3);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_2, function);
+      }
+    }
+    __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_self->previous_trace_function) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_self->previous_trace_function);
+    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 53, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+054:             self.previous_trace_function = None
+
    __Pyx_INCREF(Py_None);
+    __Pyx_GIVEREF(Py_None);
+    __Pyx_GOTREF(__pyx_v_self->previous_trace_function);
+    __Pyx_DECREF(__pyx_v_self->previous_trace_function);
+    __pyx_v_self->previous_trace_function = Py_None;
+
 055: 
+
+056:     def _trace(self, event, args):
+
static PyObject *__pyx_pw_6gevent_8__tracer_14GreenletTracer_5_trace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_f_6gevent_8__tracer_14GreenletTracer__trace(struct __pyx_obj_6gevent_8__tracer_GreenletTracer *__pyx_v_self, PyObject *__pyx_v_event, PyObject *__pyx_v_args, int __pyx_skip_dispatch) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_trace", 0);
+  /* Check if called by wrapper */
+  if (unlikely(__pyx_skip_dispatch)) ;
+  /* Check if overridden in Python */
+  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
+    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
+    if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
+    else {
+      PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      #endif
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_trace); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 56, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_8__tracer_14GreenletTracer_5_trace)) {
+        __Pyx_XDECREF(__pyx_r);
+        __Pyx_INCREF(__pyx_t_1);
+        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
+        __pyx_t_5 = 0;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+          if (likely(__pyx_t_4)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+            __Pyx_INCREF(__pyx_t_4);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_3, function);
+            __pyx_t_5 = 1;
+          }
+        }
+        #if CYTHON_FAST_PYCALL
+        if (PyFunction_Check(__pyx_t_3)) {
+          PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_event, __pyx_v_args};
+          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 56, __pyx_L1_error)
+          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+          __Pyx_GOTREF(__pyx_t_2);
+        } else
+        #endif
+        #if CYTHON_FAST_PYCCALL
+        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
+          PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_event, __pyx_v_args};
+          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 56, __pyx_L1_error)
+          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+          __Pyx_GOTREF(__pyx_t_2);
+        } else
+        #endif
+        {
+          __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 56, __pyx_L1_error)
+          __Pyx_GOTREF(__pyx_t_6);
+          if (__pyx_t_4) {
+            __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
+          }
+          __Pyx_INCREF(__pyx_v_event);
+          __Pyx_GIVEREF(__pyx_v_event);
+          PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_event);
+          __Pyx_INCREF(__pyx_v_args);
+          __Pyx_GIVEREF(__pyx_v_args);
+          PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_args);
+          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 56, __pyx_L1_error)
+          __Pyx_GOTREF(__pyx_t_2);
+          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+        }
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __pyx_r = __pyx_t_2;
+        __pyx_t_2 = 0;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        goto __pyx_L0;
+      }
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+      tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
+      if (unlikely(type_dict_guard != tp_dict_version)) {
+        tp_dict_version = obj_dict_version = 0;
+      }
+      #endif
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    }
+    #endif
+  }
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_6);
+  __Pyx_XDECREF(__pyx_t_7);
+  __Pyx_AddTraceback("gevent.__tracer.GreenletTracer._trace", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_8__tracer_14GreenletTracer_5_trace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_6gevent_8__tracer_14GreenletTracer_4_trace[] = "GreenletTracer._trace(self, str event, tuple args)";
+static PyMethodDef __pyx_mdef_6gevent_8__tracer_14GreenletTracer_5_trace = {"_trace", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_8__tracer_14GreenletTracer_5_trace, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_8__tracer_14GreenletTracer_4_trace};
+static PyObject *__pyx_pw_6gevent_8__tracer_14GreenletTracer_5_trace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_event = 0;
+  PyObject *__pyx_v_args = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_trace (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_event,&__pyx_n_s_args,0};
+    PyObject* values[2] = {0,0};
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_event)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args)) != 0)) kw_args--;
+        else {
+          __Pyx_RaiseArgtupleInvalid("_trace", 1, 2, 2, 1); __PYX_ERR(0, 56, __pyx_L3_error)
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_trace") < 0)) __PYX_ERR(0, 56, __pyx_L3_error)
+      }
+    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
+      goto __pyx_L5_argtuple_error;
+    } else {
+      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+    }
+    __pyx_v_event = ((PyObject*)values[0]);
+    __pyx_v_args = ((PyObject*)values[1]);
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("_trace", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 56, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.__tracer.GreenletTracer._trace", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_event), (&PyString_Type), 1, "event", 1))) __PYX_ERR(0, 56, __pyx_L1_error)
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_args), (&PyTuple_Type), 1, "args", 1))) __PYX_ERR(0, 56, __pyx_L1_error)
+  __pyx_r = __pyx_pf_6gevent_8__tracer_14GreenletTracer_4_trace(((struct __pyx_obj_6gevent_8__tracer_GreenletTracer *)__pyx_v_self), __pyx_v_event, __pyx_v_args);
+
+  /* function exit code */
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_8__tracer_14GreenletTracer_4_trace(struct __pyx_obj_6gevent_8__tracer_GreenletTracer *__pyx_v_self, PyObject *__pyx_v_event, PyObject *__pyx_v_args) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_trace", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __pyx_f_6gevent_8__tracer_14GreenletTracer__trace(__pyx_v_self, __pyx_v_event, __pyx_v_args, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 56, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.__tracer.GreenletTracer._trace", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__5 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_event, __pyx_n_s_args); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 56, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__5);
+  __Pyx_GIVEREF(__pyx_tuple__5);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_8__tracer_14GreenletTracer_5_trace, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_GreenletTracer__trace, NULL, __pyx_n_s_gevent___tracer, __pyx_d, ((PyObject *)__pyx_codeobj__6)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 56, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_8__tracer_GreenletTracer->tp_dict, __pyx_n_s_trace, __pyx_t_2) < 0) __PYX_ERR(0, 56, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_8__tracer_GreenletTracer);
+  __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__5, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__tracer_py, __pyx_n_s_trace, 56, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__6)) __PYX_ERR(0, 56, __pyx_L1_error)
+
 057:         # This function runs in the thread we are monitoring.
+
+058:         self.greenlet_switch_counter += 1
+
  __pyx_v_self->greenlet_switch_counter = (__pyx_v_self->greenlet_switch_counter + 1);
+
+059:         if event in ('switch', 'throw'):
+
  __Pyx_INCREF(__pyx_v_event);
+  __pyx_t_7 = __pyx_v_event;
+  __pyx_t_9 = (__Pyx_PyString_Equals(__pyx_t_7, __pyx_n_s_switch, Py_EQ)); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 59, __pyx_L1_error)
+  __pyx_t_10 = (__pyx_t_9 != 0);
+  if (!__pyx_t_10) {
+  } else {
+    __pyx_t_8 = __pyx_t_10;
+    goto __pyx_L4_bool_binop_done;
+  }
+  __pyx_t_10 = (__Pyx_PyString_Equals(__pyx_t_7, __pyx_n_s_throw, Py_EQ)); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 59, __pyx_L1_error)
+  __pyx_t_9 = (__pyx_t_10 != 0);
+  __pyx_t_8 = __pyx_t_9;
+  __pyx_L4_bool_binop_done:;
+  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __pyx_t_9 = (__pyx_t_8 != 0);
+  if (__pyx_t_9) {
+/* … */
+    goto __pyx_L3;
+  }
+
 060:             # args is (origin, target). This is the only defined
+
 061:             # case
+
+062:             self.active_greenlet = args[1]
+
    if (unlikely(__pyx_v_args == Py_None)) {
+      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
+      __PYX_ERR(0, 62, __pyx_L1_error)
+    }
+    __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v_args, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 62, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_GIVEREF(__pyx_t_1);
+    __Pyx_GOTREF(__pyx_v_self->active_greenlet);
+    __Pyx_DECREF(__pyx_v_self->active_greenlet);
+    __pyx_v_self->active_greenlet = __pyx_t_1;
+    __pyx_t_1 = 0;
+
 063:         else:
+
+064:             self.active_greenlet = None
+
  /*else*/ {
+    __Pyx_INCREF(Py_None);
+    __Pyx_GIVEREF(Py_None);
+    __Pyx_GOTREF(__pyx_v_self->active_greenlet);
+    __Pyx_DECREF(__pyx_v_self->active_greenlet);
+    __pyx_v_self->active_greenlet = Py_None;
+  }
+  __pyx_L3:;
+
+065:         if self.previous_trace_function is not None:
+
  __pyx_t_9 = (__pyx_v_self->previous_trace_function != Py_None);
+  __pyx_t_8 = (__pyx_t_9 != 0);
+  if (__pyx_t_8) {
+/* … */
+  }
+
+066:             self.previous_trace_function(event, args)
+
    __Pyx_INCREF(__pyx_v_self->previous_trace_function);
+    __pyx_t_2 = __pyx_v_self->previous_trace_function; __pyx_t_3 = NULL;
+    __pyx_t_5 = 0;
+    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+      if (likely(__pyx_t_3)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+        __Pyx_INCREF(__pyx_t_3);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_2, function);
+        __pyx_t_5 = 1;
+      }
+    }
+    #if CYTHON_FAST_PYCALL
+    if (PyFunction_Check(__pyx_t_2)) {
+      PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_event, __pyx_v_args};
+      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 66, __pyx_L1_error)
+      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __Pyx_GOTREF(__pyx_t_1);
+    } else
+    #endif
+    #if CYTHON_FAST_PYCCALL
+    if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
+      PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_event, __pyx_v_args};
+      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 66, __pyx_L1_error)
+      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __Pyx_GOTREF(__pyx_t_1);
+    } else
+    #endif
+    {
+      __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 66, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_6);
+      if (__pyx_t_3) {
+        __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); __pyx_t_3 = NULL;
+      }
+      __Pyx_INCREF(__pyx_v_event);
+      __Pyx_GIVEREF(__pyx_v_event);
+      PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_event);
+      __Pyx_INCREF(__pyx_v_args);
+      __Pyx_GIVEREF(__pyx_v_args);
+      PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_args);
+      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 66, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+    }
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 067: 
+
+068:     def __call__(self, event, args):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_8__tracer_14GreenletTracer_7__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_pw_6gevent_8__tracer_14GreenletTracer_7__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_event = 0;
+  PyObject *__pyx_v_args = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__call__ (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_event,&__pyx_n_s_args,0};
+    PyObject* values[2] = {0,0};
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_event)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args)) != 0)) kw_args--;
+        else {
+          __Pyx_RaiseArgtupleInvalid("__call__", 1, 2, 2, 1); __PYX_ERR(0, 68, __pyx_L3_error)
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__call__") < 0)) __PYX_ERR(0, 68, __pyx_L3_error)
+      }
+    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
+      goto __pyx_L5_argtuple_error;
+    } else {
+      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+    }
+    __pyx_v_event = values[0];
+    __pyx_v_args = values[1];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("__call__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 68, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.__tracer.GreenletTracer.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_8__tracer_14GreenletTracer_6__call__(((struct __pyx_obj_6gevent_8__tracer_GreenletTracer *)__pyx_v_self), __pyx_v_event, __pyx_v_args);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_8__tracer_14GreenletTracer_6__call__(struct __pyx_obj_6gevent_8__tracer_GreenletTracer *__pyx_v_self, PyObject *__pyx_v_event, PyObject *__pyx_v_args) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__call__", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.__tracer.GreenletTracer.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+069:         return self._trace(event, args)
+
  __Pyx_XDECREF(__pyx_r);
+  if (!(likely(PyString_CheckExact(__pyx_v_event))||((__pyx_v_event) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_v_event)->tp_name), 0))) __PYX_ERR(0, 69, __pyx_L1_error)
+  if (!(likely(PyTuple_CheckExact(__pyx_v_args))||((__pyx_v_args) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v_args)->tp_name), 0))) __PYX_ERR(0, 69, __pyx_L1_error)
+  __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_8__tracer_GreenletTracer *)__pyx_v_self->__pyx_vtab)->_trace(__pyx_v_self, ((PyObject*)__pyx_v_event), ((PyObject*)__pyx_v_args), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 69, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
 070: 
+
+071:     def did_block_hub(self, hub):
+
static PyObject *__pyx_pw_6gevent_8__tracer_14GreenletTracer_9did_block_hub(PyObject *__pyx_v_self, PyObject *__pyx_v_hub); /*proto*/
+static PyObject *__pyx_f_6gevent_8__tracer_14GreenletTracer_did_block_hub(struct __pyx_obj_6gevent_8__tracer_GreenletTracer *__pyx_v_self, PyObject *__pyx_v_hub, int __pyx_skip_dispatch) {
+  int __pyx_v_did_switch;
+  PyObject *__pyx_v_active_greenlet = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("did_block_hub", 0);
+  /* Check if called by wrapper */
+  if (unlikely(__pyx_skip_dispatch)) ;
+  /* Check if overridden in Python */
+  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
+    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
+    if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
+    else {
+      PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      #endif
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_did_block_hub); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 71, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_8__tracer_14GreenletTracer_9did_block_hub)) {
+        __Pyx_XDECREF(__pyx_r);
+        __Pyx_INCREF(__pyx_t_1);
+        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+          if (likely(__pyx_t_4)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+            __Pyx_INCREF(__pyx_t_4);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_3, function);
+          }
+        }
+        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_hub) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_hub);
+        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 71, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __pyx_r = __pyx_t_2;
+        __pyx_t_2 = 0;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        goto __pyx_L0;
+      }
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+      tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
+      if (unlikely(type_dict_guard != tp_dict_version)) {
+        tp_dict_version = obj_dict_version = 0;
+      }
+      #endif
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    }
+    #endif
+  }
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_AddTraceback("gevent.__tracer.GreenletTracer.did_block_hub", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_active_greenlet);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_8__tracer_14GreenletTracer_9did_block_hub(PyObject *__pyx_v_self, PyObject *__pyx_v_hub); /*proto*/
+static char __pyx_doc_6gevent_8__tracer_14GreenletTracer_8did_block_hub[] = "GreenletTracer.did_block_hub(self, hub)";
+static PyMethodDef __pyx_mdef_6gevent_8__tracer_14GreenletTracer_9did_block_hub = {"did_block_hub", (PyCFunction)__pyx_pw_6gevent_8__tracer_14GreenletTracer_9did_block_hub, METH_O, __pyx_doc_6gevent_8__tracer_14GreenletTracer_8did_block_hub};
+static PyObject *__pyx_pw_6gevent_8__tracer_14GreenletTracer_9did_block_hub(PyObject *__pyx_v_self, PyObject *__pyx_v_hub) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("did_block_hub (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_8__tracer_14GreenletTracer_8did_block_hub(((struct __pyx_obj_6gevent_8__tracer_GreenletTracer *)__pyx_v_self), ((PyObject *)__pyx_v_hub));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_8__tracer_14GreenletTracer_8did_block_hub(struct __pyx_obj_6gevent_8__tracer_GreenletTracer *__pyx_v_self, PyObject *__pyx_v_hub) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("did_block_hub", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __pyx_f_6gevent_8__tracer_14GreenletTracer_did_block_hub(__pyx_v_self, __pyx_v_hub, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 71, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.__tracer.GreenletTracer.did_block_hub", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__7 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_hub); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 71, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__7);
+  __Pyx_GIVEREF(__pyx_tuple__7);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_8__tracer_14GreenletTracer_9did_block_hub, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_GreenletTracer_did_block_hub, NULL, __pyx_n_s_gevent___tracer, __pyx_d, ((PyObject *)__pyx_codeobj__8)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 71, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_8__tracer_GreenletTracer->tp_dict, __pyx_n_s_did_block_hub, __pyx_t_2) < 0) __PYX_ERR(0, 71, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_8__tracer_GreenletTracer);
+  __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__tracer_py, __pyx_n_s_did_block_hub, 71, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) __PYX_ERR(0, 71, __pyx_L1_error)
+
 072:         # Check to see if we have blocked since the last call to this
+
 073:         # method. Returns a true value if we blocked (not in the hub),
+
 074:         # a false value if everything is fine.
+
 075: 
+
 076:         # This may be called in the same thread being traced or a
+
 077:         # different thread; if a different thread, there is a race
+
 078:         # condition with this being incremented in the thread we're
+
 079:         # monitoring, but probably not often enough to lead to
+
 080:         # annoying false positives.
+
 081: 
+
+082:         active_greenlet = self.active_greenlet
+
  __pyx_t_1 = __pyx_v_self->active_greenlet;
+  __Pyx_INCREF(__pyx_t_1);
+  __pyx_v_active_greenlet = __pyx_t_1;
+  __pyx_t_1 = 0;
+
+083:         did_switch = self.greenlet_switch_counter != 0
+
  __pyx_v_did_switch = (__pyx_v_self->greenlet_switch_counter != 0);
+
+084:         self.greenlet_switch_counter = 0
+
  __pyx_v_self->greenlet_switch_counter = 0;
+
 085: 
+
+086:         if did_switch or active_greenlet is None or active_greenlet is hub:
+
  __pyx_t_6 = (__pyx_v_did_switch != 0);
+  if (!__pyx_t_6) {
+  } else {
+    __pyx_t_5 = __pyx_t_6;
+    goto __pyx_L4_bool_binop_done;
+  }
+  __pyx_t_6 = (__pyx_v_active_greenlet == Py_None);
+  __pyx_t_7 = (__pyx_t_6 != 0);
+  if (!__pyx_t_7) {
+  } else {
+    __pyx_t_5 = __pyx_t_7;
+    goto __pyx_L4_bool_binop_done;
+  }
+  __pyx_t_7 = (__pyx_v_active_greenlet == __pyx_v_hub);
+  __pyx_t_6 = (__pyx_t_7 != 0);
+  __pyx_t_5 = __pyx_t_6;
+  __pyx_L4_bool_binop_done:;
+  if (__pyx_t_5) {
+/* … */
+  }
+
 087:             # Either we switched, or nothing is running (we got a
+
 088:             # trace event we don't know about or were requested to
+
 089:             # ignore), or we spent the whole time in the hub, blocked
+
 090:             # for IO. Nothing to report.
+
+091:             return False
+
    __Pyx_XDECREF(__pyx_r);
+    __Pyx_INCREF(Py_False);
+    __pyx_r = Py_False;
+    goto __pyx_L0;
+
+092:         return True, active_greenlet
+
  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 92, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(Py_True);
+  __Pyx_GIVEREF(Py_True);
+  PyTuple_SET_ITEM(__pyx_t_1, 0, Py_True);
+  __Pyx_INCREF(__pyx_v_active_greenlet);
+  __Pyx_GIVEREF(__pyx_v_active_greenlet);
+  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_active_greenlet);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
 093: 
+
+094:     def ignore_current_greenlet_blocking(self):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_8__tracer_14GreenletTracer_11ignore_current_greenlet_blocking(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6gevent_8__tracer_14GreenletTracer_10ignore_current_greenlet_blocking[] = "GreenletTracer.ignore_current_greenlet_blocking(self)";
+static PyMethodDef __pyx_mdef_6gevent_8__tracer_14GreenletTracer_11ignore_current_greenlet_blocking = {"ignore_current_greenlet_blocking", (PyCFunction)__pyx_pw_6gevent_8__tracer_14GreenletTracer_11ignore_current_greenlet_blocking, METH_NOARGS, __pyx_doc_6gevent_8__tracer_14GreenletTracer_10ignore_current_greenlet_blocking};
+static PyObject *__pyx_pw_6gevent_8__tracer_14GreenletTracer_11ignore_current_greenlet_blocking(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("ignore_current_greenlet_blocking (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_8__tracer_14GreenletTracer_10ignore_current_greenlet_blocking(((struct __pyx_obj_6gevent_8__tracer_GreenletTracer *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_8__tracer_14GreenletTracer_10ignore_current_greenlet_blocking(struct __pyx_obj_6gevent_8__tracer_GreenletTracer *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("ignore_current_greenlet_blocking", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__9 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 94, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__9);
+  __Pyx_GIVEREF(__pyx_tuple__9);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_8__tracer_14GreenletTracer_11ignore_current_greenlet_blocking, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_GreenletTracer_ignore_current_gr, NULL, __pyx_n_s_gevent___tracer, __pyx_d, ((PyObject *)__pyx_codeobj__10)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 94, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_8__tracer_GreenletTracer->tp_dict, __pyx_n_s_ignore_current_greenlet_blocking, __pyx_t_2) < 0) __PYX_ERR(0, 94, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_8__tracer_GreenletTracer);
+  __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__9, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__tracer_py, __pyx_n_s_ignore_current_greenlet_blocking, 94, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__10)) __PYX_ERR(0, 94, __pyx_L1_error)
+
 095:         # Don't pay attention to the current greenlet.
+
+096:         self.active_greenlet = None
+
  __Pyx_INCREF(Py_None);
+  __Pyx_GIVEREF(Py_None);
+  __Pyx_GOTREF(__pyx_v_self->active_greenlet);
+  __Pyx_DECREF(__pyx_v_self->active_greenlet);
+  __pyx_v_self->active_greenlet = Py_None;
+
 097: 
+
+098:     def monitor_current_greenlet_blocking(self):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_8__tracer_14GreenletTracer_13monitor_current_greenlet_blocking(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6gevent_8__tracer_14GreenletTracer_12monitor_current_greenlet_blocking[] = "GreenletTracer.monitor_current_greenlet_blocking(self)";
+static PyMethodDef __pyx_mdef_6gevent_8__tracer_14GreenletTracer_13monitor_current_greenlet_blocking = {"monitor_current_greenlet_blocking", (PyCFunction)__pyx_pw_6gevent_8__tracer_14GreenletTracer_13monitor_current_greenlet_blocking, METH_NOARGS, __pyx_doc_6gevent_8__tracer_14GreenletTracer_12monitor_current_greenlet_blocking};
+static PyObject *__pyx_pw_6gevent_8__tracer_14GreenletTracer_13monitor_current_greenlet_blocking(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("monitor_current_greenlet_blocking (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_8__tracer_14GreenletTracer_12monitor_current_greenlet_blocking(((struct __pyx_obj_6gevent_8__tracer_GreenletTracer *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_8__tracer_14GreenletTracer_12monitor_current_greenlet_blocking(struct __pyx_obj_6gevent_8__tracer_GreenletTracer *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("monitor_current_greenlet_blocking", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_AddTraceback("gevent.__tracer.GreenletTracer.monitor_current_greenlet_blocking", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__11 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 98, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__11);
+  __Pyx_GIVEREF(__pyx_tuple__11);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_8__tracer_14GreenletTracer_13monitor_current_greenlet_blocking, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_GreenletTracer_monitor_current_g, NULL, __pyx_n_s_gevent___tracer, __pyx_d, ((PyObject *)__pyx_codeobj__12)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 98, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_8__tracer_GreenletTracer->tp_dict, __pyx_n_s_monitor_current_greenlet_blockin, __pyx_t_2) < 0) __PYX_ERR(0, 98, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_8__tracer_GreenletTracer);
+  __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__11, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__tracer_py, __pyx_n_s_monitor_current_greenlet_blockin, 98, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(0, 98, __pyx_L1_error)
+
+099:         self.active_greenlet = getcurrent()
+
  __Pyx_INCREF(__pyx_v_6gevent_8__tracer_getcurrent);
+  __pyx_t_2 = __pyx_v_6gevent_8__tracer_getcurrent; __pyx_t_3 = NULL;
+  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
+    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+    if (likely(__pyx_t_3)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+      __Pyx_INCREF(__pyx_t_3);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_2, function);
+    }
+  }
+  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 99, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_GIVEREF(__pyx_t_1);
+  __Pyx_GOTREF(__pyx_v_self->active_greenlet);
+  __Pyx_DECREF(__pyx_v_self->active_greenlet);
+  __pyx_v_self->active_greenlet = __pyx_t_1;
+  __pyx_t_1 = 0;
+
 100: 
+
+101:     def did_block_hub_report(self, hub, active_greenlet, format_kwargs):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_8__tracer_14GreenletTracer_15did_block_hub_report(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_6gevent_8__tracer_14GreenletTracer_14did_block_hub_report[] = "GreenletTracer.did_block_hub_report(self, hub, active_greenlet, format_kwargs)";
+static PyMethodDef __pyx_mdef_6gevent_8__tracer_14GreenletTracer_15did_block_hub_report = {"did_block_hub_report", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_8__tracer_14GreenletTracer_15did_block_hub_report, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_8__tracer_14GreenletTracer_14did_block_hub_report};
+static PyObject *__pyx_pw_6gevent_8__tracer_14GreenletTracer_15did_block_hub_report(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_hub = 0;
+  PyObject *__pyx_v_active_greenlet = 0;
+  PyObject *__pyx_v_format_kwargs = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("did_block_hub_report (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_hub,&__pyx_n_s_active_greenlet,&__pyx_n_s_format_kwargs,0};
+    PyObject* values[3] = {0,0,0};
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_hub)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_active_greenlet)) != 0)) kw_args--;
+        else {
+          __Pyx_RaiseArgtupleInvalid("did_block_hub_report", 1, 3, 3, 1); __PYX_ERR(0, 101, __pyx_L3_error)
+        }
+        CYTHON_FALLTHROUGH;
+        case  2:
+        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_format_kwargs)) != 0)) kw_args--;
+        else {
+          __Pyx_RaiseArgtupleInvalid("did_block_hub_report", 1, 3, 3, 2); __PYX_ERR(0, 101, __pyx_L3_error)
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "did_block_hub_report") < 0)) __PYX_ERR(0, 101, __pyx_L3_error)
+      }
+    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
+      goto __pyx_L5_argtuple_error;
+    } else {
+      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+    }
+    __pyx_v_hub = values[0];
+    __pyx_v_active_greenlet = values[1];
+    __pyx_v_format_kwargs = values[2];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("did_block_hub_report", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 101, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.__tracer.GreenletTracer.did_block_hub_report", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_8__tracer_14GreenletTracer_14did_block_hub_report(((struct __pyx_obj_6gevent_8__tracer_GreenletTracer *)__pyx_v_self), __pyx_v_hub, __pyx_v_active_greenlet, __pyx_v_format_kwargs);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_8__tracer_14GreenletTracer_14did_block_hub_report(struct __pyx_obj_6gevent_8__tracer_GreenletTracer *__pyx_v_self, PyObject *__pyx_v_hub, PyObject *__pyx_v_active_greenlet, PyObject *__pyx_v_format_kwargs) {
+  PyObject *__pyx_v_report = NULL;
+  PyObject *__pyx_v_frame = NULL;
+  PyObject *__pyx_v_stack = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("did_block_hub_report", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_9);
+  __Pyx_XDECREF(__pyx_t_10);
+  __Pyx_AddTraceback("gevent.__tracer.GreenletTracer.did_block_hub_report", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_report);
+  __Pyx_XDECREF(__pyx_v_frame);
+  __Pyx_XDECREF(__pyx_v_stack);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__13 = PyTuple_Pack(7, __pyx_n_s_self, __pyx_n_s_hub, __pyx_n_s_active_greenlet, __pyx_n_s_format_kwargs, __pyx_n_s_report, __pyx_n_s_frame, __pyx_n_s_stack); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 101, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__13);
+  __Pyx_GIVEREF(__pyx_tuple__13);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_8__tracer_14GreenletTracer_15did_block_hub_report, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_GreenletTracer_did_block_hub_rep, NULL, __pyx_n_s_gevent___tracer, __pyx_d, ((PyObject *)__pyx_codeobj__14)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 101, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_8__tracer_GreenletTracer->tp_dict, __pyx_n_s_did_block_hub_report, __pyx_t_2) < 0) __PYX_ERR(0, 101, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_8__tracer_GreenletTracer);
+  __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(4, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__13, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__tracer_py, __pyx_n_s_did_block_hub_report, 101, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__14)) __PYX_ERR(0, 101, __pyx_L1_error)
+
+102:         report = ['=' * 80,
+
  __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 102, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(__pyx_kp_s_b);
+  __Pyx_GIVEREF(__pyx_kp_s_b);
+  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_kp_s_b);
+  __Pyx_GIVEREF(__pyx_t_1);
+  PyList_SET_ITEM(__pyx_t_2, 1, __pyx_t_1);
+  __pyx_t_1 = 0;
+  __pyx_v_report = ((PyObject*)__pyx_t_2);
+  __pyx_t_2 = 0;
+
+103:                   '\n%s : Greenlet %s appears to be blocked' %
+
  __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_s_Greenlet_s_appears_to_be_bloc, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 103, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+104:                   (gmctime(), active_greenlet)]
+
  __Pyx_INCREF(__pyx_v_6gevent_8__tracer_gmctime);
+  __pyx_t_2 = __pyx_v_6gevent_8__tracer_gmctime; __pyx_t_3 = NULL;
+  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
+    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+    if (likely(__pyx_t_3)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+      __Pyx_INCREF(__pyx_t_3);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_2, function);
+    }
+  }
+  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 104, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 104, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_GIVEREF(__pyx_t_1);
+  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
+  __Pyx_INCREF(__pyx_v_active_greenlet);
+  __Pyx_GIVEREF(__pyx_v_active_greenlet);
+  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_active_greenlet);
+  __pyx_t_1 = 0;
+
+105:         report.append("    Reported by %s" % (self,))
+
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 105, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(((PyObject *)__pyx_v_self));
+  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
+  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self));
+  __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_Reported_by_s, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 105, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_report, __pyx_t_1); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 105, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+106:         try:
+
  {
+    /*try:*/ {
+/* … */
+    }
+/* … */
+    __Pyx_XGIVEREF(__pyx_t_5);
+    __Pyx_XGIVEREF(__pyx_t_6);
+    __Pyx_XGIVEREF(__pyx_t_7);
+    __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7);
+    goto __pyx_L1_error;
+    __pyx_L4_exception_handled:;
+    __Pyx_XGIVEREF(__pyx_t_5);
+    __Pyx_XGIVEREF(__pyx_t_6);
+    __Pyx_XGIVEREF(__pyx_t_7);
+    __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7);
+    __pyx_L8_try_end:;
+  }
+
+107:             frame = sys._current_frames()[hub.thread_ident]
+
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_6gevent_8__tracer_sys, __pyx_n_s_current_frames); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 107, __pyx_L3_error)
+      __Pyx_GOTREF(__pyx_t_2);
+      __pyx_t_3 = NULL;
+      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+        if (likely(__pyx_t_3)) {
+          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+          __Pyx_INCREF(__pyx_t_3);
+          __Pyx_INCREF(function);
+          __Pyx_DECREF_SET(__pyx_t_2, function);
+        }
+      }
+      __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
+      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 107, __pyx_L3_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_hub, __pyx_n_s_thread_ident); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 107, __pyx_L3_error)
+      __Pyx_GOTREF(__pyx_t_2);
+      __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 107, __pyx_L3_error)
+      __Pyx_GOTREF(__pyx_t_3);
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+      __pyx_v_frame = __pyx_t_3;
+      __pyx_t_3 = 0;
+
+108:         except KeyError:
+
    __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
+    if (__pyx_t_8) {
+      __Pyx_AddTraceback("gevent.__tracer.GreenletTracer.did_block_hub_report", __pyx_clineno, __pyx_lineno, __pyx_filename);
+      if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_2, &__pyx_t_1) < 0) __PYX_ERR(0, 108, __pyx_L5_except_error)
+      __Pyx_GOTREF(__pyx_t_3);
+      __Pyx_GOTREF(__pyx_t_2);
+      __Pyx_GOTREF(__pyx_t_1);
+
 109:             # The thread holding the hub has died. Perhaps we shouldn't
+
 110:             # even report this?
+
+111:             stack = ["Unknown: No thread found for hub %r\n" % (hub,)]
+
      __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 111, __pyx_L5_except_error)
+      __Pyx_GOTREF(__pyx_t_9);
+      __Pyx_INCREF(__pyx_v_hub);
+      __Pyx_GIVEREF(__pyx_v_hub);
+      PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_hub);
+      __pyx_t_10 = __Pyx_PyString_Format(__pyx_kp_s_Unknown_No_thread_found_for_hub, __pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 111, __pyx_L5_except_error)
+      __Pyx_GOTREF(__pyx_t_10);
+      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+      __pyx_t_9 = PyList_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 111, __pyx_L5_except_error)
+      __Pyx_GOTREF(__pyx_t_9);
+      __Pyx_GIVEREF(__pyx_t_10);
+      PyList_SET_ITEM(__pyx_t_9, 0, __pyx_t_10);
+      __pyx_t_10 = 0;
+      __pyx_v_stack = __pyx_t_9;
+      __pyx_t_9 = 0;
+      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+      goto __pyx_L4_exception_handled;
+    }
+    goto __pyx_L5_except_error;
+    __pyx_L5_except_error:;
+
 112:         else:
+
+113:             stack = traceback.format_stack(frame)
+
    /*else:*/ {
+      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_6gevent_8__tracer_traceback, __pyx_n_s_format_stack); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 113, __pyx_L5_except_error)
+      __Pyx_GOTREF(__pyx_t_2);
+      __pyx_t_1 = NULL;
+      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+        __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
+        if (likely(__pyx_t_1)) {
+          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+          __Pyx_INCREF(__pyx_t_1);
+          __Pyx_INCREF(function);
+          __Pyx_DECREF_SET(__pyx_t_2, function);
+        }
+      }
+      __pyx_t_3 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_1, __pyx_v_frame) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_frame);
+      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 113, __pyx_L5_except_error)
+      __Pyx_GOTREF(__pyx_t_3);
+      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+      __pyx_v_stack = __pyx_t_3;
+      __pyx_t_3 = 0;
+    }
+    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+    goto __pyx_L8_try_end;
+    __pyx_L3_error:;
+    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+
+114:         report.append('Blocked Stack (for thread id %s):' % (hex(hub.thread_ident),))
+
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_hub, __pyx_n_s_thread_ident); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 114, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_hex, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 114, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 114, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_2);
+  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
+  __pyx_t_2 = 0;
+  __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_Blocked_Stack_for_thread_id_s, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 114, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_report, __pyx_t_2); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 114, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+115:         report.append(''.join(stack))
+
  __pyx_t_2 = __Pyx_PyString_Join(__pyx_kp_s__2, __pyx_v_stack); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 115, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_report, __pyx_t_2); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 115, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+116:         report.append("Info:")
+
  __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_report, __pyx_kp_s_Info); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 116, __pyx_L1_error)
+
+117:         report.extend(format_run_info(**format_kwargs))
+
  if (unlikely(__pyx_v_format_kwargs == Py_None)) {
+    PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType");
+    __PYX_ERR(0, 117, __pyx_L1_error)
+  }
+  if (likely(PyDict_CheckExact(__pyx_v_format_kwargs))) {
+    __pyx_t_2 = PyDict_Copy(__pyx_v_format_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 117, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+  } else {
+    __pyx_t_2 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_format_kwargs, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 117, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+  }
+  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_6gevent_8__tracer_format_run_info, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 117, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_4 = __Pyx_PyList_Extend(__pyx_v_report, __pyx_t_1); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 117, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 118: 
+
+119:         return report
+
  __Pyx_XDECREF(__pyx_r);
+  __Pyx_INCREF(__pyx_v_report);
+  __pyx_r = __pyx_v_report;
+  goto __pyx_L0;
+
 120: 
+
 121: 
+
+122: class _HubTracer(GreenletTracer):
+
struct __pyx_vtabstruct_6gevent_8__tracer__HubTracer {
+  struct __pyx_vtabstruct_6gevent_8__tracer_GreenletTracer __pyx_base;
+};
+static struct __pyx_vtabstruct_6gevent_8__tracer__HubTracer *__pyx_vtabptr_6gevent_8__tracer__HubTracer;
+
+
+123:     def __init__(self, hub, max_blocking_time):
+
/* Python wrapper */
+static int __pyx_pw_6gevent_8__tracer_10_HubTracer_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static int __pyx_pw_6gevent_8__tracer_10_HubTracer_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_hub = 0;
+  PyObject *__pyx_v_max_blocking_time = 0;
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_hub,&__pyx_n_s_max_blocking_time,0};
+    PyObject* values[2] = {0,0};
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_hub)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_max_blocking_time)) != 0)) kw_args--;
+        else {
+          __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(0, 123, __pyx_L3_error)
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 123, __pyx_L3_error)
+      }
+    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
+      goto __pyx_L5_argtuple_error;
+    } else {
+      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+    }
+    __pyx_v_hub = values[0];
+    __pyx_v_max_blocking_time = values[1];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 123, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.__tracer._HubTracer.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return -1;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_8__tracer_10_HubTracer___init__(((struct __pyx_obj_6gevent_8__tracer__HubTracer *)__pyx_v_self), __pyx_v_hub, __pyx_v_max_blocking_time);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_8__tracer_10_HubTracer___init__(struct __pyx_obj_6gevent_8__tracer__HubTracer *__pyx_v_self, PyObject *__pyx_v_hub, PyObject *__pyx_v_max_blocking_time) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = 0;
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_AddTraceback("gevent.__tracer._HubTracer.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = -1;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+124:         GreenletTracer.__init__(self)
+
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_6gevent_8__tracer_GreenletTracer), __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 124, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = NULL;
+  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+    if (likely(__pyx_t_3)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+      __Pyx_INCREF(__pyx_t_3);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_2, function);
+    }
+  }
+  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, ((PyObject *)__pyx_v_self)) : __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_v_self));
+  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 124, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+125:         self.max_blocking_time = max_blocking_time
+
  __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_v_max_blocking_time); if (unlikely((__pyx_t_4 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 125, __pyx_L1_error)
+  __pyx_v_self->max_blocking_time = __pyx_t_4;
+
+126:         self.hub = hub
+
  __Pyx_INCREF(__pyx_v_hub);
+  __Pyx_GIVEREF(__pyx_v_hub);
+  __Pyx_GOTREF(__pyx_v_self->hub);
+  __Pyx_DECREF(__pyx_v_self->hub);
+  __pyx_v_self->hub = __pyx_v_hub;
+
 127: 
+
+128:     def kill(self):
+
static PyObject *__pyx_pw_6gevent_8__tracer_10_HubTracer_3kill(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyObject *__pyx_f_6gevent_8__tracer_10_HubTracer_kill(struct __pyx_obj_6gevent_8__tracer__HubTracer *__pyx_v_self, int __pyx_skip_dispatch) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("kill", 0);
+  /* Check if called by wrapper */
+  if (unlikely(__pyx_skip_dispatch)) ;
+  /* Check if overridden in Python */
+  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
+    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
+    if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
+    else {
+      PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      #endif
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_kill); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 128, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_8__tracer_10_HubTracer_3kill)) {
+        __Pyx_XDECREF(__pyx_r);
+        __Pyx_INCREF(__pyx_t_1);
+        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+          if (likely(__pyx_t_4)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+            __Pyx_INCREF(__pyx_t_4);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_3, function);
+          }
+        }
+        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
+        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 128, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __pyx_r = __pyx_t_2;
+        __pyx_t_2 = 0;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        goto __pyx_L0;
+      }
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+      tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
+      if (unlikely(type_dict_guard != tp_dict_version)) {
+        tp_dict_version = obj_dict_version = 0;
+      }
+      #endif
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    }
+    #endif
+  }
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_AddTraceback("gevent.__tracer._HubTracer.kill", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_8__tracer_10_HubTracer_3kill(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6gevent_8__tracer_10_HubTracer_2kill[] = "_HubTracer.kill(self)";
+static PyMethodDef __pyx_mdef_6gevent_8__tracer_10_HubTracer_3kill = {"kill", (PyCFunction)__pyx_pw_6gevent_8__tracer_10_HubTracer_3kill, METH_NOARGS, __pyx_doc_6gevent_8__tracer_10_HubTracer_2kill};
+static PyObject *__pyx_pw_6gevent_8__tracer_10_HubTracer_3kill(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("kill (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_8__tracer_10_HubTracer_2kill(((struct __pyx_obj_6gevent_8__tracer__HubTracer *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_8__tracer_10_HubTracer_2kill(struct __pyx_obj_6gevent_8__tracer__HubTracer *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("kill", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __pyx_f_6gevent_8__tracer_10_HubTracer_kill(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 128, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.__tracer._HubTracer.kill", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__15 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(0, 128, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__15);
+  __Pyx_GIVEREF(__pyx_tuple__15);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_8__tracer_10_HubTracer_3kill, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_HubTracer_kill, NULL, __pyx_n_s_gevent___tracer, __pyx_d, ((PyObject *)__pyx_codeobj__16)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 128, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_8__tracer__HubTracer->tp_dict, __pyx_n_s_kill, __pyx_t_2) < 0) __PYX_ERR(0, 128, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_8__tracer__HubTracer);
+  __pyx_codeobj__16 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__15, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__tracer_py, __pyx_n_s_kill, 128, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__16)) __PYX_ERR(0, 128, __pyx_L1_error)
+
+129:         self.hub = None
+
  __Pyx_INCREF(Py_None);
+  __Pyx_GIVEREF(Py_None);
+  __Pyx_GOTREF(__pyx_v_self->hub);
+  __Pyx_DECREF(__pyx_v_self->hub);
+  __pyx_v_self->hub = Py_None;
+
+130:         GreenletTracer.kill(self)
+
  __pyx_t_1 = __pyx_f_6gevent_8__tracer_14GreenletTracer_kill(((struct __pyx_obj_6gevent_8__tracer_GreenletTracer *)__pyx_v_self), 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 130, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 131: 
+
 132: 
+
+133: class HubSwitchTracer(_HubTracer):
+
struct __pyx_vtabstruct_6gevent_8__tracer_HubSwitchTracer {
+  struct __pyx_vtabstruct_6gevent_8__tracer__HubTracer __pyx_base;
+};
+static struct __pyx_vtabstruct_6gevent_8__tracer_HubSwitchTracer *__pyx_vtabptr_6gevent_8__tracer_HubSwitchTracer;
+
+
 134:     # A greenlet tracer that records the last time we switched *into* the hub.
+
 135: 
+
+136:     def __init__(self, hub, max_blocking_time):
+
/* Python wrapper */
+static int __pyx_pw_6gevent_8__tracer_15HubSwitchTracer_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static int __pyx_pw_6gevent_8__tracer_15HubSwitchTracer_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_hub = 0;
+  PyObject *__pyx_v_max_blocking_time = 0;
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_hub,&__pyx_n_s_max_blocking_time,0};
+    PyObject* values[2] = {0,0};
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_hub)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_max_blocking_time)) != 0)) kw_args--;
+        else {
+          __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(0, 136, __pyx_L3_error)
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 136, __pyx_L3_error)
+      }
+    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
+      goto __pyx_L5_argtuple_error;
+    } else {
+      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+    }
+    __pyx_v_hub = values[0];
+    __pyx_v_max_blocking_time = values[1];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 136, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.__tracer.HubSwitchTracer.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return -1;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_8__tracer_15HubSwitchTracer___init__(((struct __pyx_obj_6gevent_8__tracer_HubSwitchTracer *)__pyx_v_self), __pyx_v_hub, __pyx_v_max_blocking_time);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_8__tracer_15HubSwitchTracer___init__(struct __pyx_obj_6gevent_8__tracer_HubSwitchTracer *__pyx_v_self, PyObject *__pyx_v_hub, PyObject *__pyx_v_max_blocking_time) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = 0;
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_AddTraceback("gevent.__tracer.HubSwitchTracer.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = -1;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+137:         _HubTracer.__init__(self, hub, max_blocking_time)
+
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_6gevent_8__tracer__HubTracer), __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 137, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = NULL;
+  __pyx_t_4 = 0;
+  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+    if (likely(__pyx_t_3)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+      __Pyx_INCREF(__pyx_t_3);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_2, function);
+      __pyx_t_4 = 1;
+    }
+  }
+  #if CYTHON_FAST_PYCALL
+  if (PyFunction_Check(__pyx_t_2)) {
+    PyObject *__pyx_temp[4] = {__pyx_t_3, ((PyObject *)__pyx_v_self), __pyx_v_hub, __pyx_v_max_blocking_time};
+    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 137, __pyx_L1_error)
+    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __Pyx_GOTREF(__pyx_t_1);
+  } else
+  #endif
+  #if CYTHON_FAST_PYCCALL
+  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
+    PyObject *__pyx_temp[4] = {__pyx_t_3, ((PyObject *)__pyx_v_self), __pyx_v_hub, __pyx_v_max_blocking_time};
+    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 137, __pyx_L1_error)
+    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __Pyx_GOTREF(__pyx_t_1);
+  } else
+  #endif
+  {
+    __pyx_t_5 = PyTuple_New(3+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 137, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_5);
+    if (__pyx_t_3) {
+      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
+    }
+    __Pyx_INCREF(((PyObject *)__pyx_v_self));
+    __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
+    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, ((PyObject *)__pyx_v_self));
+    __Pyx_INCREF(__pyx_v_hub);
+    __Pyx_GIVEREF(__pyx_v_hub);
+    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_hub);
+    __Pyx_INCREF(__pyx_v_max_blocking_time);
+    __Pyx_GIVEREF(__pyx_v_max_blocking_time);
+    PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_4, __pyx_v_max_blocking_time);
+    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 137, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+  }
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+138:         self.last_entered_hub = 0
+
  __pyx_v_self->last_entered_hub = 0.0;
+
 139: 
+
+140:     def _trace(self, event, args):
+
static PyObject *__pyx_pw_6gevent_8__tracer_15HubSwitchTracer_3_trace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_f_6gevent_8__tracer_15HubSwitchTracer__trace(struct __pyx_obj_6gevent_8__tracer_HubSwitchTracer *__pyx_v_self, PyObject *__pyx_v_event, PyObject *__pyx_v_args, int __pyx_skip_dispatch) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_trace", 0);
+  /* Check if called by wrapper */
+  if (unlikely(__pyx_skip_dispatch)) ;
+  /* Check if overridden in Python */
+  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
+    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
+    if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
+    else {
+      PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      #endif
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_trace); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 140, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_8__tracer_15HubSwitchTracer_3_trace)) {
+        __Pyx_XDECREF(__pyx_r);
+        __Pyx_INCREF(__pyx_t_1);
+        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
+        __pyx_t_5 = 0;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+          if (likely(__pyx_t_4)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+            __Pyx_INCREF(__pyx_t_4);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_3, function);
+            __pyx_t_5 = 1;
+          }
+        }
+        #if CYTHON_FAST_PYCALL
+        if (PyFunction_Check(__pyx_t_3)) {
+          PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_event, __pyx_v_args};
+          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 140, __pyx_L1_error)
+          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+          __Pyx_GOTREF(__pyx_t_2);
+        } else
+        #endif
+        #if CYTHON_FAST_PYCCALL
+        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
+          PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_event, __pyx_v_args};
+          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 140, __pyx_L1_error)
+          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+          __Pyx_GOTREF(__pyx_t_2);
+        } else
+        #endif
+        {
+          __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 140, __pyx_L1_error)
+          __Pyx_GOTREF(__pyx_t_6);
+          if (__pyx_t_4) {
+            __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
+          }
+          __Pyx_INCREF(__pyx_v_event);
+          __Pyx_GIVEREF(__pyx_v_event);
+          PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_event);
+          __Pyx_INCREF(__pyx_v_args);
+          __Pyx_GIVEREF(__pyx_v_args);
+          PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_args);
+          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 140, __pyx_L1_error)
+          __Pyx_GOTREF(__pyx_t_2);
+          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+        }
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __pyx_r = __pyx_t_2;
+        __pyx_t_2 = 0;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        goto __pyx_L0;
+      }
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+      tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
+      if (unlikely(type_dict_guard != tp_dict_version)) {
+        tp_dict_version = obj_dict_version = 0;
+      }
+      #endif
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    }
+    #endif
+  }
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_6);
+  __Pyx_AddTraceback("gevent.__tracer.HubSwitchTracer._trace", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_8__tracer_15HubSwitchTracer_3_trace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_6gevent_8__tracer_15HubSwitchTracer_2_trace[] = "HubSwitchTracer._trace(self, str event, tuple args)";
+static PyMethodDef __pyx_mdef_6gevent_8__tracer_15HubSwitchTracer_3_trace = {"_trace", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_8__tracer_15HubSwitchTracer_3_trace, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_8__tracer_15HubSwitchTracer_2_trace};
+static PyObject *__pyx_pw_6gevent_8__tracer_15HubSwitchTracer_3_trace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_event = 0;
+  PyObject *__pyx_v_args = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_trace (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_event,&__pyx_n_s_args,0};
+    PyObject* values[2] = {0,0};
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_event)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args)) != 0)) kw_args--;
+        else {
+          __Pyx_RaiseArgtupleInvalid("_trace", 1, 2, 2, 1); __PYX_ERR(0, 140, __pyx_L3_error)
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_trace") < 0)) __PYX_ERR(0, 140, __pyx_L3_error)
+      }
+    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
+      goto __pyx_L5_argtuple_error;
+    } else {
+      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+    }
+    __pyx_v_event = ((PyObject*)values[0]);
+    __pyx_v_args = ((PyObject*)values[1]);
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("_trace", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 140, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.__tracer.HubSwitchTracer._trace", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_event), (&PyString_Type), 1, "event", 1))) __PYX_ERR(0, 140, __pyx_L1_error)
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_args), (&PyTuple_Type), 1, "args", 1))) __PYX_ERR(0, 140, __pyx_L1_error)
+  __pyx_r = __pyx_pf_6gevent_8__tracer_15HubSwitchTracer_2_trace(((struct __pyx_obj_6gevent_8__tracer_HubSwitchTracer *)__pyx_v_self), __pyx_v_event, __pyx_v_args);
+
+  /* function exit code */
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_8__tracer_15HubSwitchTracer_2_trace(struct __pyx_obj_6gevent_8__tracer_HubSwitchTracer *__pyx_v_self, PyObject *__pyx_v_event, PyObject *__pyx_v_args) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_trace", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __pyx_f_6gevent_8__tracer_15HubSwitchTracer__trace(__pyx_v_self, __pyx_v_event, __pyx_v_args, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 140, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.__tracer.HubSwitchTracer._trace", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__17 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_event, __pyx_n_s_args); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(0, 140, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__17);
+  __Pyx_GIVEREF(__pyx_tuple__17);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_8__tracer_15HubSwitchTracer_3_trace, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_HubSwitchTracer__trace, NULL, __pyx_n_s_gevent___tracer, __pyx_d, ((PyObject *)__pyx_codeobj__18)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 140, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_8__tracer_HubSwitchTracer->tp_dict, __pyx_n_s_trace, __pyx_t_2) < 0) __PYX_ERR(0, 140, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_8__tracer_HubSwitchTracer);
+  __pyx_codeobj__18 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__17, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__tracer_py, __pyx_n_s_trace, 140, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__18)) __PYX_ERR(0, 140, __pyx_L1_error)
+
+141:         GreenletTracer._trace(self, event, args)
+
  __pyx_t_1 = __pyx_f_6gevent_8__tracer_14GreenletTracer__trace(((struct __pyx_obj_6gevent_8__tracer_GreenletTracer *)__pyx_v_self), __pyx_v_event, __pyx_v_args, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 141, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+142:         if self.active_greenlet is self.hub:
+
  __pyx_t_7 = (__pyx_v_self->__pyx_base.__pyx_base.active_greenlet == __pyx_v_self->__pyx_base.hub);
+  __pyx_t_8 = (__pyx_t_7 != 0);
+  if (__pyx_t_8) {
+/* … */
+  }
+
+143:             self.last_entered_hub = perf_counter()
+
    __Pyx_INCREF(__pyx_v_6gevent_8__tracer_perf_counter);
+    __pyx_t_2 = __pyx_v_6gevent_8__tracer_perf_counter; __pyx_t_3 = NULL;
+    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
+      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+      if (likely(__pyx_t_3)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+        __Pyx_INCREF(__pyx_t_3);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_2, function);
+      }
+    }
+    __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
+    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 143, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 143, __pyx_L1_error)
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __pyx_v_self->last_entered_hub = __pyx_t_9;
+
 144: 
+
+145:     def did_block_hub(self, hub):
+
static PyObject *__pyx_pw_6gevent_8__tracer_15HubSwitchTracer_5did_block_hub(PyObject *__pyx_v_self, PyObject *__pyx_v_hub); /*proto*/
+static PyObject *__pyx_f_6gevent_8__tracer_15HubSwitchTracer_did_block_hub(struct __pyx_obj_6gevent_8__tracer_HubSwitchTracer *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_hub, int __pyx_skip_dispatch) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("did_block_hub", 0);
+  /* Check if called by wrapper */
+  if (unlikely(__pyx_skip_dispatch)) ;
+  /* Check if overridden in Python */
+  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
+    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
+    if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
+    else {
+      PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      #endif
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_did_block_hub); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 145, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_8__tracer_15HubSwitchTracer_5did_block_hub)) {
+        __Pyx_XDECREF(__pyx_r);
+        __Pyx_INCREF(__pyx_t_1);
+        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+          if (likely(__pyx_t_4)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+            __Pyx_INCREF(__pyx_t_4);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_3, function);
+          }
+        }
+        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_hub) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_hub);
+        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 145, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __pyx_r = __pyx_t_2;
+        __pyx_t_2 = 0;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        goto __pyx_L0;
+      }
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+      tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
+      if (unlikely(type_dict_guard != tp_dict_version)) {
+        tp_dict_version = obj_dict_version = 0;
+      }
+      #endif
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    }
+    #endif
+  }
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_AddTraceback("gevent.__tracer.HubSwitchTracer.did_block_hub", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_8__tracer_15HubSwitchTracer_5did_block_hub(PyObject *__pyx_v_self, PyObject *__pyx_v_hub); /*proto*/
+static char __pyx_doc_6gevent_8__tracer_15HubSwitchTracer_4did_block_hub[] = "HubSwitchTracer.did_block_hub(self, hub)";
+static PyMethodDef __pyx_mdef_6gevent_8__tracer_15HubSwitchTracer_5did_block_hub = {"did_block_hub", (PyCFunction)__pyx_pw_6gevent_8__tracer_15HubSwitchTracer_5did_block_hub, METH_O, __pyx_doc_6gevent_8__tracer_15HubSwitchTracer_4did_block_hub};
+static PyObject *__pyx_pw_6gevent_8__tracer_15HubSwitchTracer_5did_block_hub(PyObject *__pyx_v_self, PyObject *__pyx_v_hub) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("did_block_hub (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_8__tracer_15HubSwitchTracer_4did_block_hub(((struct __pyx_obj_6gevent_8__tracer_HubSwitchTracer *)__pyx_v_self), ((PyObject *)__pyx_v_hub));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_8__tracer_15HubSwitchTracer_4did_block_hub(struct __pyx_obj_6gevent_8__tracer_HubSwitchTracer *__pyx_v_self, PyObject *__pyx_v_hub) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("did_block_hub", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __pyx_f_6gevent_8__tracer_15HubSwitchTracer_did_block_hub(__pyx_v_self, __pyx_v_hub, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 145, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.__tracer.HubSwitchTracer.did_block_hub", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__19 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_hub); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(0, 145, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__19);
+  __Pyx_GIVEREF(__pyx_tuple__19);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_8__tracer_15HubSwitchTracer_5did_block_hub, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_HubSwitchTracer_did_block_hub, NULL, __pyx_n_s_gevent___tracer, __pyx_d, ((PyObject *)__pyx_codeobj__20)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 145, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_8__tracer_HubSwitchTracer->tp_dict, __pyx_n_s_did_block_hub, __pyx_t_2) < 0) __PYX_ERR(0, 145, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_8__tracer_HubSwitchTracer);
+  __pyx_codeobj__20 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__19, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__tracer_py, __pyx_n_s_did_block_hub, 145, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__20)) __PYX_ERR(0, 145, __pyx_L1_error)
+
+146:         if perf_counter() - self.last_entered_hub > self.max_blocking_time:
+
  __Pyx_INCREF(__pyx_v_6gevent_8__tracer_perf_counter);
+  __pyx_t_2 = __pyx_v_6gevent_8__tracer_perf_counter; __pyx_t_3 = NULL;
+  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
+    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+    if (likely(__pyx_t_3)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+      __Pyx_INCREF(__pyx_t_3);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_2, function);
+    }
+  }
+  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 146, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_2 = PyFloat_FromDouble(__pyx_v_self->last_entered_hub); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 146, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = PyNumber_Subtract(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 146, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_2 = PyFloat_FromDouble(__pyx_v_self->__pyx_base.max_blocking_time); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 146, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 146, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 146, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  if (__pyx_t_5) {
+/* … */
+  }
+
+147:             return True, self.active_greenlet
+
    __Pyx_XDECREF(__pyx_r);
+    __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 147, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_INCREF(Py_True);
+    __Pyx_GIVEREF(Py_True);
+    PyTuple_SET_ITEM(__pyx_t_1, 0, Py_True);
+    __Pyx_INCREF(__pyx_v_self->__pyx_base.__pyx_base.active_greenlet);
+    __Pyx_GIVEREF(__pyx_v_self->__pyx_base.__pyx_base.active_greenlet);
+    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_self->__pyx_base.__pyx_base.active_greenlet);
+    __pyx_r = __pyx_t_1;
+    __pyx_t_1 = 0;
+    goto __pyx_L0;
+
 148: 
+
 149: 
+
+150: class MaxSwitchTracer(_HubTracer):
+
struct __pyx_vtabstruct_6gevent_8__tracer_MaxSwitchTracer {
+  struct __pyx_vtabstruct_6gevent_8__tracer__HubTracer __pyx_base;
+};
+static struct __pyx_vtabstruct_6gevent_8__tracer_MaxSwitchTracer *__pyx_vtabptr_6gevent_8__tracer_MaxSwitchTracer;
+
 151:     # A greenlet tracer that records the maximum time between switches,
+
 152:     # not including time spent in the hub.
+
 153: 
+
+154:     def __init__(self, hub, max_blocking_time):
+
/* Python wrapper */
+static int __pyx_pw_6gevent_8__tracer_15MaxSwitchTracer_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static int __pyx_pw_6gevent_8__tracer_15MaxSwitchTracer_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_hub = 0;
+  PyObject *__pyx_v_max_blocking_time = 0;
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_hub,&__pyx_n_s_max_blocking_time,0};
+    PyObject* values[2] = {0,0};
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_hub)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_max_blocking_time)) != 0)) kw_args--;
+        else {
+          __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(0, 154, __pyx_L3_error)
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 154, __pyx_L3_error)
+      }
+    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
+      goto __pyx_L5_argtuple_error;
+    } else {
+      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+    }
+    __pyx_v_hub = values[0];
+    __pyx_v_max_blocking_time = values[1];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 154, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.__tracer.MaxSwitchTracer.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return -1;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_8__tracer_15MaxSwitchTracer___init__(((struct __pyx_obj_6gevent_8__tracer_MaxSwitchTracer *)__pyx_v_self), __pyx_v_hub, __pyx_v_max_blocking_time);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_8__tracer_15MaxSwitchTracer___init__(struct __pyx_obj_6gevent_8__tracer_MaxSwitchTracer *__pyx_v_self, PyObject *__pyx_v_hub, PyObject *__pyx_v_max_blocking_time) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = 0;
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_AddTraceback("gevent.__tracer.MaxSwitchTracer.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = -1;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+155:         _HubTracer.__init__(self, hub, max_blocking_time)
+
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_6gevent_8__tracer__HubTracer), __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 155, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = NULL;
+  __pyx_t_4 = 0;
+  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+    if (likely(__pyx_t_3)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+      __Pyx_INCREF(__pyx_t_3);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_2, function);
+      __pyx_t_4 = 1;
+    }
+  }
+  #if CYTHON_FAST_PYCALL
+  if (PyFunction_Check(__pyx_t_2)) {
+    PyObject *__pyx_temp[4] = {__pyx_t_3, ((PyObject *)__pyx_v_self), __pyx_v_hub, __pyx_v_max_blocking_time};
+    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 155, __pyx_L1_error)
+    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __Pyx_GOTREF(__pyx_t_1);
+  } else
+  #endif
+  #if CYTHON_FAST_PYCCALL
+  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
+    PyObject *__pyx_temp[4] = {__pyx_t_3, ((PyObject *)__pyx_v_self), __pyx_v_hub, __pyx_v_max_blocking_time};
+    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 155, __pyx_L1_error)
+    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __Pyx_GOTREF(__pyx_t_1);
+  } else
+  #endif
+  {
+    __pyx_t_5 = PyTuple_New(3+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 155, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_5);
+    if (__pyx_t_3) {
+      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
+    }
+    __Pyx_INCREF(((PyObject *)__pyx_v_self));
+    __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
+    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, ((PyObject *)__pyx_v_self));
+    __Pyx_INCREF(__pyx_v_hub);
+    __Pyx_GIVEREF(__pyx_v_hub);
+    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_hub);
+    __Pyx_INCREF(__pyx_v_max_blocking_time);
+    __Pyx_GIVEREF(__pyx_v_max_blocking_time);
+    PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_4, __pyx_v_max_blocking_time);
+    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 155, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+  }
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+156:         self.last_switch = perf_counter()
+
  __Pyx_INCREF(__pyx_v_6gevent_8__tracer_perf_counter);
+  __pyx_t_2 = __pyx_v_6gevent_8__tracer_perf_counter; __pyx_t_5 = NULL;
+  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
+    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
+    if (likely(__pyx_t_5)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+      __Pyx_INCREF(__pyx_t_5);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_2, function);
+    }
+  }
+  __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 156, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_6 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 156, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_v_self->last_switch = __pyx_t_6;
+
+157:         self.max_blocking = 0
+
  __pyx_v_self->max_blocking = 0.0;
+
 158: 
+
+159:     def _trace(self, event, args):
+
static PyObject *__pyx_pw_6gevent_8__tracer_15MaxSwitchTracer_3_trace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_f_6gevent_8__tracer_15MaxSwitchTracer__trace(struct __pyx_obj_6gevent_8__tracer_MaxSwitchTracer *__pyx_v_self, PyObject *__pyx_v_event, PyObject *__pyx_v_args, int __pyx_skip_dispatch) {
+  double __pyx_v_switched_at;
+  PyObject *__pyx_v_old_active = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_trace", 0);
+  /* Check if called by wrapper */
+  if (unlikely(__pyx_skip_dispatch)) ;
+  /* Check if overridden in Python */
+  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
+    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
+    if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
+    else {
+      PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      #endif
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_trace); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 159, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_8__tracer_15MaxSwitchTracer_3_trace)) {
+        __Pyx_XDECREF(__pyx_r);
+        __Pyx_INCREF(__pyx_t_1);
+        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
+        __pyx_t_5 = 0;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+          if (likely(__pyx_t_4)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+            __Pyx_INCREF(__pyx_t_4);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_3, function);
+            __pyx_t_5 = 1;
+          }
+        }
+        #if CYTHON_FAST_PYCALL
+        if (PyFunction_Check(__pyx_t_3)) {
+          PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_event, __pyx_v_args};
+          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 159, __pyx_L1_error)
+          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+          __Pyx_GOTREF(__pyx_t_2);
+        } else
+        #endif
+        #if CYTHON_FAST_PYCCALL
+        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
+          PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_event, __pyx_v_args};
+          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 159, __pyx_L1_error)
+          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+          __Pyx_GOTREF(__pyx_t_2);
+        } else
+        #endif
+        {
+          __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 159, __pyx_L1_error)
+          __Pyx_GOTREF(__pyx_t_6);
+          if (__pyx_t_4) {
+            __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
+          }
+          __Pyx_INCREF(__pyx_v_event);
+          __Pyx_GIVEREF(__pyx_v_event);
+          PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_event);
+          __Pyx_INCREF(__pyx_v_args);
+          __Pyx_GIVEREF(__pyx_v_args);
+          PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_args);
+          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 159, __pyx_L1_error)
+          __Pyx_GOTREF(__pyx_t_2);
+          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+        }
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __pyx_r = __pyx_t_2;
+        __pyx_t_2 = 0;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        goto __pyx_L0;
+      }
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+      tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
+      if (unlikely(type_dict_guard != tp_dict_version)) {
+        tp_dict_version = obj_dict_version = 0;
+      }
+      #endif
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    }
+    #endif
+  }
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_6);
+  __Pyx_AddTraceback("gevent.__tracer.MaxSwitchTracer._trace", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_old_active);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_8__tracer_15MaxSwitchTracer_3_trace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_6gevent_8__tracer_15MaxSwitchTracer_2_trace[] = "MaxSwitchTracer._trace(self, str event, tuple args)";
+static PyMethodDef __pyx_mdef_6gevent_8__tracer_15MaxSwitchTracer_3_trace = {"_trace", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_8__tracer_15MaxSwitchTracer_3_trace, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_8__tracer_15MaxSwitchTracer_2_trace};
+static PyObject *__pyx_pw_6gevent_8__tracer_15MaxSwitchTracer_3_trace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_event = 0;
+  PyObject *__pyx_v_args = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_trace (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_event,&__pyx_n_s_args,0};
+    PyObject* values[2] = {0,0};
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_event)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args)) != 0)) kw_args--;
+        else {
+          __Pyx_RaiseArgtupleInvalid("_trace", 1, 2, 2, 1); __PYX_ERR(0, 159, __pyx_L3_error)
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_trace") < 0)) __PYX_ERR(0, 159, __pyx_L3_error)
+      }
+    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
+      goto __pyx_L5_argtuple_error;
+    } else {
+      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+    }
+    __pyx_v_event = ((PyObject*)values[0]);
+    __pyx_v_args = ((PyObject*)values[1]);
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("_trace", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 159, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.__tracer.MaxSwitchTracer._trace", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_event), (&PyString_Type), 1, "event", 1))) __PYX_ERR(0, 159, __pyx_L1_error)
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_args), (&PyTuple_Type), 1, "args", 1))) __PYX_ERR(0, 159, __pyx_L1_error)
+  __pyx_r = __pyx_pf_6gevent_8__tracer_15MaxSwitchTracer_2_trace(((struct __pyx_obj_6gevent_8__tracer_MaxSwitchTracer *)__pyx_v_self), __pyx_v_event, __pyx_v_args);
+
+  /* function exit code */
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_8__tracer_15MaxSwitchTracer_2_trace(struct __pyx_obj_6gevent_8__tracer_MaxSwitchTracer *__pyx_v_self, PyObject *__pyx_v_event, PyObject *__pyx_v_args) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_trace", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __pyx_f_6gevent_8__tracer_15MaxSwitchTracer__trace(__pyx_v_self, __pyx_v_event, __pyx_v_args, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 159, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.__tracer.MaxSwitchTracer._trace", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__21 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_event, __pyx_n_s_args); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(0, 159, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__21);
+  __Pyx_GIVEREF(__pyx_tuple__21);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_8__tracer_15MaxSwitchTracer_3_trace, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_MaxSwitchTracer__trace, NULL, __pyx_n_s_gevent___tracer, __pyx_d, ((PyObject *)__pyx_codeobj__22)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 159, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_8__tracer_MaxSwitchTracer->tp_dict, __pyx_n_s_trace, __pyx_t_2) < 0) __PYX_ERR(0, 159, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_8__tracer_MaxSwitchTracer);
+  __pyx_codeobj__22 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__21, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__tracer_py, __pyx_n_s_trace, 159, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__22)) __PYX_ERR(0, 159, __pyx_L1_error)
+
+160:         old_active = self.active_greenlet
+
  __pyx_t_1 = __pyx_v_self->__pyx_base.__pyx_base.active_greenlet;
+  __Pyx_INCREF(__pyx_t_1);
+  __pyx_v_old_active = __pyx_t_1;
+  __pyx_t_1 = 0;
+
+161:         GreenletTracer._trace(self, event, args)
+
  __pyx_t_1 = __pyx_f_6gevent_8__tracer_14GreenletTracer__trace(((struct __pyx_obj_6gevent_8__tracer_GreenletTracer *)__pyx_v_self), __pyx_v_event, __pyx_v_args, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 161, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+162:         if old_active is not self.hub and old_active is not None:
+
  __pyx_t_8 = (__pyx_v_old_active != __pyx_v_self->__pyx_base.hub);
+  __pyx_t_9 = (__pyx_t_8 != 0);
+  if (__pyx_t_9) {
+  } else {
+    __pyx_t_7 = __pyx_t_9;
+    goto __pyx_L4_bool_binop_done;
+  }
+  __pyx_t_9 = (__pyx_v_old_active != Py_None);
+  __pyx_t_8 = (__pyx_t_9 != 0);
+  __pyx_t_7 = __pyx_t_8;
+  __pyx_L4_bool_binop_done:;
+  if (__pyx_t_7) {
+/* … */
+  }
+
 163:             # If we're switching out of the hub, the blocking
+
 164:             # time doesn't count.
+
+165:             switched_at = perf_counter()
+
    __Pyx_INCREF(__pyx_v_6gevent_8__tracer_perf_counter);
+    __pyx_t_2 = __pyx_v_6gevent_8__tracer_perf_counter; __pyx_t_3 = NULL;
+    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
+      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+      if (likely(__pyx_t_3)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+        __Pyx_INCREF(__pyx_t_3);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_2, function);
+      }
+    }
+    __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
+    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 165, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 165, __pyx_L1_error)
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __pyx_v_switched_at = __pyx_t_10;
+
+166:             self.max_blocking = max(self.max_blocking,
+
    __pyx_t_11 = __pyx_v_self->max_blocking;
+/* … */
+    __pyx_v_self->max_blocking = __pyx_t_12;
+
+167:                                     switched_at - self.last_switch)
+
    __pyx_t_10 = (__pyx_v_switched_at - __pyx_v_self->last_switch);
+/* … */
+    if (((__pyx_t_10 > __pyx_t_11) != 0)) {
+      __pyx_t_12 = __pyx_t_10;
+    } else {
+      __pyx_t_12 = __pyx_t_11;
+    }
+
 168: 
+
+169:     def did_block_hub(self, hub):
+
static PyObject *__pyx_pw_6gevent_8__tracer_15MaxSwitchTracer_5did_block_hub(PyObject *__pyx_v_self, PyObject *__pyx_v_hub); /*proto*/
+static PyObject *__pyx_f_6gevent_8__tracer_15MaxSwitchTracer_did_block_hub(struct __pyx_obj_6gevent_8__tracer_MaxSwitchTracer *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_hub, int __pyx_skip_dispatch) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("did_block_hub", 0);
+  /* Check if called by wrapper */
+  if (unlikely(__pyx_skip_dispatch)) ;
+  /* Check if overridden in Python */
+  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
+    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
+    if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
+    else {
+      PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      #endif
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_did_block_hub); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 169, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_8__tracer_15MaxSwitchTracer_5did_block_hub)) {
+        __Pyx_XDECREF(__pyx_r);
+        __Pyx_INCREF(__pyx_t_1);
+        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+          if (likely(__pyx_t_4)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+            __Pyx_INCREF(__pyx_t_4);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_3, function);
+          }
+        }
+        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_hub) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_hub);
+        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 169, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __pyx_r = __pyx_t_2;
+        __pyx_t_2 = 0;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        goto __pyx_L0;
+      }
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+      tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
+      if (unlikely(type_dict_guard != tp_dict_version)) {
+        tp_dict_version = obj_dict_version = 0;
+      }
+      #endif
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    }
+    #endif
+  }
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_AddTraceback("gevent.__tracer.MaxSwitchTracer.did_block_hub", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_8__tracer_15MaxSwitchTracer_5did_block_hub(PyObject *__pyx_v_self, PyObject *__pyx_v_hub); /*proto*/
+static char __pyx_doc_6gevent_8__tracer_15MaxSwitchTracer_4did_block_hub[] = "MaxSwitchTracer.did_block_hub(self, hub)";
+static PyMethodDef __pyx_mdef_6gevent_8__tracer_15MaxSwitchTracer_5did_block_hub = {"did_block_hub", (PyCFunction)__pyx_pw_6gevent_8__tracer_15MaxSwitchTracer_5did_block_hub, METH_O, __pyx_doc_6gevent_8__tracer_15MaxSwitchTracer_4did_block_hub};
+static PyObject *__pyx_pw_6gevent_8__tracer_15MaxSwitchTracer_5did_block_hub(PyObject *__pyx_v_self, PyObject *__pyx_v_hub) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("did_block_hub (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_8__tracer_15MaxSwitchTracer_4did_block_hub(((struct __pyx_obj_6gevent_8__tracer_MaxSwitchTracer *)__pyx_v_self), ((PyObject *)__pyx_v_hub));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_8__tracer_15MaxSwitchTracer_4did_block_hub(struct __pyx_obj_6gevent_8__tracer_MaxSwitchTracer *__pyx_v_self, PyObject *__pyx_v_hub) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("did_block_hub", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __pyx_f_6gevent_8__tracer_15MaxSwitchTracer_did_block_hub(__pyx_v_self, __pyx_v_hub, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 169, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.__tracer.MaxSwitchTracer.did_block_hub", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__23 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_hub); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(0, 169, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__23);
+  __Pyx_GIVEREF(__pyx_tuple__23);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_8__tracer_15MaxSwitchTracer_5did_block_hub, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_MaxSwitchTracer_did_block_hub, NULL, __pyx_n_s_gevent___tracer, __pyx_d, ((PyObject *)__pyx_codeobj__24)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 169, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_8__tracer_MaxSwitchTracer->tp_dict, __pyx_n_s_did_block_hub, __pyx_t_2) < 0) __PYX_ERR(0, 169, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_8__tracer_MaxSwitchTracer);
+
+170:         if self.max_blocking == 0:
+
  __pyx_t_5 = ((__pyx_v_self->max_blocking == 0.0) != 0);
+  if (__pyx_t_5) {
+/* … */
+  }
+
 171:             # We never switched. Check the time now
+
+172:             self.max_blocking = perf_counter() - self.last_switch
+
    __Pyx_INCREF(__pyx_v_6gevent_8__tracer_perf_counter);
+    __pyx_t_2 = __pyx_v_6gevent_8__tracer_perf_counter; __pyx_t_3 = NULL;
+    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
+      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+      if (likely(__pyx_t_3)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+        __Pyx_INCREF(__pyx_t_3);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_2, function);
+      }
+    }
+    __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
+    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 172, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __pyx_t_2 = PyFloat_FromDouble(__pyx_v_self->last_switch); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 172, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_3 = PyNumber_Subtract(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 172, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_6 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 172, __pyx_L1_error)
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __pyx_v_self->max_blocking = __pyx_t_6;
+
 173: 
+
+174:         if self.max_blocking > self.max_blocking_time:
+
  __pyx_t_5 = ((__pyx_v_self->max_blocking > __pyx_v_self->__pyx_base.max_blocking_time) != 0);
+  if (__pyx_t_5) {
+/* … */
+  }
+
+175:             return True, self.active_greenlet
+
    __Pyx_XDECREF(__pyx_r);
+    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 175, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_INCREF(Py_True);
+    __Pyx_GIVEREF(Py_True);
+    PyTuple_SET_ITEM(__pyx_t_3, 0, Py_True);
+    __Pyx_INCREF(__pyx_v_self->__pyx_base.__pyx_base.active_greenlet);
+    __Pyx_GIVEREF(__pyx_v_self->__pyx_base.__pyx_base.active_greenlet);
+    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_self->__pyx_base.__pyx_base.active_greenlet);
+    __pyx_r = __pyx_t_3;
+    __pyx_t_3 = 0;
+    goto __pyx_L0;
+
 176: 
+
 177: 
+
+178: from gevent._util import import_c_accel
+
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 178, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_import_c_accel);
+  __Pyx_GIVEREF(__pyx_n_s_import_c_accel);
+  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_import_c_accel);
+  __pyx_t_1 = __Pyx_Import(__pyx_n_s_gevent__util, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 178, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_import_c_accel); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 178, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_import_c_accel, __pyx_t_2) < 0) __PYX_ERR(0, 178, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+179: import_c_accel(globals(), 'gevent.__tracer')
+
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_import_c_accel); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 179, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = __Pyx_Globals(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 179, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 179, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_GIVEREF(__pyx_t_2);
+  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_gevent___tracer);
+  __Pyx_GIVEREF(__pyx_n_s_gevent___tracer);
+  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_n_s_gevent___tracer);
+  __pyx_t_2 = 0;
+  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 179, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_tracer.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_tracer.py new file mode 100644 index 00000000..98307ab5 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_tracer.py @@ -0,0 +1,179 @@ +# Copyright (c) 2018 gevent. See LICENSE for details. +# cython: auto_pickle=False,embedsignature=True,always_allow_keywords=False +from __future__ import print_function, absolute_import, division + +import sys +import traceback + +from greenlet import settrace +from greenlet import getcurrent + +from gevent.util import format_run_info + +from gevent._compat import perf_counter +from gevent._util import gmctime + + +__all__ = [ + 'GreenletTracer', + 'HubSwitchTracer', + 'MaxSwitchTracer', +] + +# Recall these classes are cython compiled, so +# class variable declarations are bad. + + +class GreenletTracer(object): + def __init__(self): + # A counter, incremented by the greenlet trace function + # we install on every greenlet switch. This is reset when the + # periodic monitoring thread runs. + + self.greenlet_switch_counter = 0 + + # The greenlet last switched to. + self.active_greenlet = None + + # The trace function that was previously installed, + # if any. + # NOTE: Calling a class instance is cheaper than + # calling a bound method (at least when compiled with cython) + # even when it redirects to another function. + prev_trace = settrace(self) + + self.previous_trace_function = prev_trace + + self._killed = False + + def kill(self): + # Must be called in the monitored thread. + if not self._killed: + self._killed = True + settrace(self.previous_trace_function) + self.previous_trace_function = None + + def _trace(self, event, args): + # This function runs in the thread we are monitoring. + self.greenlet_switch_counter += 1 + if event in ('switch', 'throw'): + # args is (origin, target). This is the only defined + # case + self.active_greenlet = args[1] + else: + self.active_greenlet = None + if self.previous_trace_function is not None: + self.previous_trace_function(event, args) + + def __call__(self, event, args): + return self._trace(event, args) + + def did_block_hub(self, hub): + # Check to see if we have blocked since the last call to this + # method. Returns a true value if we blocked (not in the hub), + # a false value if everything is fine. + + # This may be called in the same thread being traced or a + # different thread; if a different thread, there is a race + # condition with this being incremented in the thread we're + # monitoring, but probably not often enough to lead to + # annoying false positives. + + active_greenlet = self.active_greenlet + did_switch = self.greenlet_switch_counter != 0 + self.greenlet_switch_counter = 0 + + if did_switch or active_greenlet is None or active_greenlet is hub: + # Either we switched, or nothing is running (we got a + # trace event we don't know about or were requested to + # ignore), or we spent the whole time in the hub, blocked + # for IO. Nothing to report. + return False + return True, active_greenlet + + def ignore_current_greenlet_blocking(self): + # Don't pay attention to the current greenlet. + self.active_greenlet = None + + def monitor_current_greenlet_blocking(self): + self.active_greenlet = getcurrent() + + def did_block_hub_report(self, hub, active_greenlet, format_kwargs): + report = ['=' * 80, + '\n%s : Greenlet %s appears to be blocked' % + (gmctime(), active_greenlet)] + report.append(" Reported by %s" % (self,)) + try: + frame = sys._current_frames()[hub.thread_ident] + except KeyError: + # The thread holding the hub has died. Perhaps we shouldn't + # even report this? + stack = ["Unknown: No thread found for hub %r\n" % (hub,)] + else: + stack = traceback.format_stack(frame) + report.append('Blocked Stack (for thread id %s):' % (hex(hub.thread_ident),)) + report.append(''.join(stack)) + report.append("Info:") + report.extend(format_run_info(**format_kwargs)) + + return report + + +class _HubTracer(GreenletTracer): + def __init__(self, hub, max_blocking_time): + GreenletTracer.__init__(self) + self.max_blocking_time = max_blocking_time + self.hub = hub + + def kill(self): + self.hub = None + GreenletTracer.kill(self) + + +class HubSwitchTracer(_HubTracer): + # A greenlet tracer that records the last time we switched *into* the hub. + + def __init__(self, hub, max_blocking_time): + _HubTracer.__init__(self, hub, max_blocking_time) + self.last_entered_hub = 0 + + def _trace(self, event, args): + GreenletTracer._trace(self, event, args) + if self.active_greenlet is self.hub: + self.last_entered_hub = perf_counter() + + def did_block_hub(self, hub): + if perf_counter() - self.last_entered_hub > self.max_blocking_time: + return True, self.active_greenlet + + +class MaxSwitchTracer(_HubTracer): + # A greenlet tracer that records the maximum time between switches, + # not including time spent in the hub. + + def __init__(self, hub, max_blocking_time): + _HubTracer.__init__(self, hub, max_blocking_time) + self.last_switch = perf_counter() + self.max_blocking = 0 + + def _trace(self, event, args): + old_active = self.active_greenlet + GreenletTracer._trace(self, event, args) + if old_active is not self.hub and old_active is not None: + # If we're switching out of the hub, the blocking + # time doesn't count. + switched_at = perf_counter() + self.max_blocking = max(self.max_blocking, + switched_at - self.last_switch) + + def did_block_hub(self, hub): + if self.max_blocking == 0: + # We never switched. Check the time now + self.max_blocking = perf_counter() - self.last_switch + + if self.max_blocking > self.max_blocking_time: + return True, self.active_greenlet + + +from gevent._util import import_c_accel +import_c_accel(globals(), 'gevent.__tracer') diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_util.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_util.py new file mode 100644 index 00000000..4397aa3e --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_util.py @@ -0,0 +1,178 @@ +# -*- coding: utf-8 -*- +""" +internal gevent utilities, not for external use. +""" + +from __future__ import print_function, absolute_import, division + +from functools import update_wrapper + +from gevent._compat import iteritems + + +class _NONE(object): + """ + A special object you must never pass to any gevent API. + Used as a marker object for keyword arguments that cannot have the + builtin None (because that might be a valid value). + """ + __slots__ = () + + def __repr__(self): + return '' + +_NONE = _NONE() + +def copy_globals(source, + globs, + only_names=None, + ignore_missing_names=False, + names_to_ignore=(), + dunder_names_to_keep=('__implements__', '__all__', '__imports__'), + cleanup_globs=True): + """ + Copy attributes defined in ``source.__dict__`` to the dictionary + in globs (which should be the caller's :func:`globals`). + + Names that start with ``__`` are ignored (unless they are in + *dunder_names_to_keep*). Anything found in *names_to_ignore* is + also ignored. + + If *only_names* is given, only those attributes will be + considered. In this case, *ignore_missing_names* says whether or + not to raise an :exc:`AttributeError` if one of those names can't + be found. + + If *cleanup_globs* has a true value, then common things imported but + not used at runtime are removed, including this function. + + Returns a list of the names copied; this should be assigned to ``__imports__``. + """ + if only_names: + if ignore_missing_names: + items = ((k, getattr(source, k, _NONE)) for k in only_names) + else: + items = ((k, getattr(source, k)) for k in only_names) + else: + items = iteritems(source.__dict__) + + copied = [] + for key, value in items: + if value is _NONE: + continue + if key in names_to_ignore: + continue + if key.startswith("__") and key not in dunder_names_to_keep: + continue + globs[key] = value + copied.append(key) + + if cleanup_globs: + if 'copy_globals' in globs: + del globs['copy_globals'] + + return copied + +def import_c_accel(globs, cname): + """ + Import the C-accelerator for the __name__ + and copy its globals. + """ + + name = globs.get('__name__') + + if not name or name == cname: + # Do nothing if we're being exec'd as a file (no name) + # or we're running from the C extension + return + + + from gevent._compat import PURE_PYTHON + if PURE_PYTHON: + return + + import importlib + import warnings + with warnings.catch_warnings(): + # Python 3.7 likes to produce + # "ImportWarning: can't resolve + # package from __spec__ or __package__, falling back on + # __name__ and __path__" + # when we load cython compiled files. This is probably a bug in + # Cython, but it doesn't seem to have any consequences, it's + # just annoying to see and can mess up our unittests. + warnings.simplefilter('ignore', ImportWarning) + mod = importlib.import_module(cname) + + # By adopting the entire __dict__, we get a more accurate + # __file__ and module repr, plus we don't leak any imported + # things we no longer need. + globs.clear() + globs.update(mod.__dict__) + + if 'import_c_accel' in globs: + del globs['import_c_accel'] + + +class Lazy(object): + """ + A non-data descriptor used just like @property. The + difference is the function value is assigned to the instance + dict the first time it is accessed and then the function is never + called agoin. + """ + def __init__(self, func): + self.data = (func, func.__name__) + update_wrapper(self, func) + + def __get__(self, inst, class_): + if inst is None: + return self + + func, name = self.data + value = func(inst) + inst.__dict__[name] = value + return value + +class readproperty(object): + """ + A non-data descriptor like @property. The difference is that + when the property is assigned to, it is cached in the instance + and the function is not called on that instance again. + """ + + def __init__(self, func): + self.func = func + update_wrapper(self, func) + + def __get__(self, inst, class_): + if inst is None: + return self + + return self.func(inst) + +def gmctime(): + """ + Returns the current time as a string in RFC3339 format. + """ + import time + return time.strftime("%Y-%m-%dT%H:%M:%SZ", time.gmtime()) + +try: + from zope.interface import Interface + from zope.interface import implementer + from zope.interface import Attribute +except ImportError: + class Interface(object): + pass + def implementer(_iface): + def dec(c): + return c + return dec + + def Attribute(s): + return s + +Interface = Interface +implementer = implementer +Attribute = Attribute diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_util_py2.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_util_py2.py new file mode 100644 index 00000000..02332e37 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_util_py2.py @@ -0,0 +1,23 @@ +import sys + +__all__ = ['reraise'] + + +def exec_(_code_, _globs_=None, _locs_=None): + """Execute code in a namespace.""" + if _globs_ is None: + frame = sys._getframe(1) + _globs_ = frame.f_globals + if _locs_ is None: + _locs_ = frame.f_locals + del frame + elif _locs_ is None: + _locs_ = _globs_ + exec("""exec _code_ in _globs_, _locs_""") + +exec_("""def reraise(tp, value, tb=None): + try: + raise tp, value, tb + finally: + tb = None +""") diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_waiter.c b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_waiter.c new file mode 100644 index 00000000..f3d27c84 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_waiter.c @@ -0,0 +1,8893 @@ +/* Generated by Cython 0.29.2 */ + +/* BEGIN: Cython Metadata +{ + "distutils": { + "depends": [ + "src/gevent/__waiter.pxd", + "src\\gevent\\__waiter.pxd" + ], + "include_dirs": [ + "C:\\Python37-x64\\Include", + "deps" + ], + "name": "gevent.__waiter", + "sources": [ + "src/gevent/_waiter.py" + ] + }, + "module_name": "gevent.__waiter" +} +END: Cython Metadata */ + +#define PY_SSIZE_T_CLEAN +#include "Python.h" +#ifndef Py_PYTHON_H + #error Python headers needed to compile C extensions, please install development version of Python. +#elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) + #error Cython requires Python 2.6+ or Python 3.3+. +#else +#define CYTHON_ABI "0_29_2" +#define CYTHON_HEX_VERSION 0x001D02F0 +#define CYTHON_FUTURE_DIVISION 1 +#include +#ifndef offsetof + #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) +#endif +#if !defined(WIN32) && !defined(MS_WINDOWS) + #ifndef __stdcall + #define __stdcall + #endif + #ifndef __cdecl + #define __cdecl + #endif + #ifndef __fastcall + #define __fastcall + #endif +#endif +#ifndef DL_IMPORT + #define DL_IMPORT(t) t +#endif +#ifndef DL_EXPORT + #define DL_EXPORT(t) t +#endif +#define __PYX_COMMA , +#ifndef HAVE_LONG_LONG + #if PY_VERSION_HEX >= 0x02070000 + #define HAVE_LONG_LONG + #endif +#endif +#ifndef PY_LONG_LONG + #define PY_LONG_LONG LONG_LONG +#endif +#ifndef Py_HUGE_VAL + #define Py_HUGE_VAL HUGE_VAL +#endif +#ifdef PYPY_VERSION + #define CYTHON_COMPILING_IN_PYPY 1 + #define CYTHON_COMPILING_IN_PYSTON 0 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #undef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 0 + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #if PY_VERSION_HEX < 0x03050000 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #elif !defined(CYTHON_USE_ASYNC_SLOTS) + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #undef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 0 + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #undef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 1 + #undef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 0 + #undef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 0 + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #undef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE 0 + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 +#elif defined(PYSTON_VERSION) + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_PYSTON 1 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #ifndef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 1 + #endif + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #ifndef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 1 + #endif + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #ifndef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 0 + #endif + #ifndef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 1 + #endif + #ifndef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 1 + #endif + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #undef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE 0 + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 +#else + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_PYSTON 0 + #define CYTHON_COMPILING_IN_CPYTHON 1 + #ifndef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 1 + #endif + #if PY_VERSION_HEX < 0x02070000 + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #elif !defined(CYTHON_USE_PYTYPE_LOOKUP) + #define CYTHON_USE_PYTYPE_LOOKUP 1 + #endif + #if PY_MAJOR_VERSION < 3 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #elif !defined(CYTHON_USE_ASYNC_SLOTS) + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #if PY_VERSION_HEX < 0x02070000 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #elif !defined(CYTHON_USE_PYLONG_INTERNALS) + #define CYTHON_USE_PYLONG_INTERNALS 1 + #endif + #ifndef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 1 + #endif + #ifndef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 1 + #endif + #if PY_VERSION_HEX < 0x030300F0 + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #elif !defined(CYTHON_USE_UNICODE_WRITER) + #define CYTHON_USE_UNICODE_WRITER 1 + #endif + #ifndef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 0 + #endif + #ifndef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 1 + #endif + #ifndef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 1 + #endif + #ifndef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 1 + #endif + #ifndef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 1 + #endif + #ifndef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000) + #endif + #ifndef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1) + #endif + #ifndef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1) + #endif + #ifndef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3) + #endif +#endif +#if !defined(CYTHON_FAST_PYCCALL) +#define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) +#endif +#if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #undef SHIFT + #undef BASE + #undef MASK + #ifdef SIZEOF_VOID_P + enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) }; + #endif +#endif +#ifndef __has_attribute + #define __has_attribute(x) 0 +#endif +#ifndef __has_cpp_attribute + #define __has_cpp_attribute(x) 0 +#endif +#ifndef CYTHON_RESTRICT + #if defined(__GNUC__) + #define CYTHON_RESTRICT __restrict__ + #elif defined(_MSC_VER) && _MSC_VER >= 1400 + #define CYTHON_RESTRICT __restrict + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_RESTRICT restrict + #else + #define CYTHON_RESTRICT + #endif +#endif +#ifndef CYTHON_UNUSED +# if defined(__GNUC__) +# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +#endif +#ifndef CYTHON_MAYBE_UNUSED_VAR +# if defined(__cplusplus) + template void CYTHON_MAYBE_UNUSED_VAR( const T& ) { } +# else +# define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x) +# endif +#endif +#ifndef CYTHON_NCP_UNUSED +# if CYTHON_COMPILING_IN_CPYTHON +# define CYTHON_NCP_UNUSED +# else +# define CYTHON_NCP_UNUSED CYTHON_UNUSED +# endif +#endif +#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) +#ifdef _MSC_VER + #ifndef _MSC_STDINT_H_ + #if _MSC_VER < 1300 + typedef unsigned char uint8_t; + typedef unsigned int uint32_t; + #else + typedef unsigned __int8 uint8_t; + typedef unsigned __int32 uint32_t; + #endif + #endif +#else + #include +#endif +#ifndef CYTHON_FALLTHROUGH + #if defined(__cplusplus) && __cplusplus >= 201103L + #if __has_cpp_attribute(fallthrough) + #define CYTHON_FALLTHROUGH [[fallthrough]] + #elif __has_cpp_attribute(clang::fallthrough) + #define CYTHON_FALLTHROUGH [[clang::fallthrough]] + #elif __has_cpp_attribute(gnu::fallthrough) + #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] + #endif + #endif + #ifndef CYTHON_FALLTHROUGH + #if __has_attribute(fallthrough) + #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) + #else + #define CYTHON_FALLTHROUGH + #endif + #endif + #if defined(__clang__ ) && defined(__apple_build_version__) + #if __apple_build_version__ < 7000000 + #undef CYTHON_FALLTHROUGH + #define CYTHON_FALLTHROUGH + #endif + #endif +#endif + +#ifndef CYTHON_INLINE + #if defined(__clang__) + #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) + #elif defined(__GNUC__) + #define CYTHON_INLINE __inline__ + #elif defined(_MSC_VER) + #define CYTHON_INLINE __inline + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_INLINE inline + #else + #define CYTHON_INLINE + #endif +#endif + +#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) + #define Py_OptimizeFlag 0 +#endif +#define __PYX_BUILD_PY_SSIZE_T "n" +#define CYTHON_FORMAT_SSIZE_T "z" +#if PY_MAJOR_VERSION < 3 + #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyClass_Type +#else + #define __Pyx_BUILTIN_MODULE_NAME "builtins" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyType_Type +#endif +#ifndef Py_TPFLAGS_CHECKTYPES + #define Py_TPFLAGS_CHECKTYPES 0 +#endif +#ifndef Py_TPFLAGS_HAVE_INDEX + #define Py_TPFLAGS_HAVE_INDEX 0 +#endif +#ifndef Py_TPFLAGS_HAVE_NEWBUFFER + #define Py_TPFLAGS_HAVE_NEWBUFFER 0 +#endif +#ifndef Py_TPFLAGS_HAVE_FINALIZE + #define Py_TPFLAGS_HAVE_FINALIZE 0 +#endif +#ifndef METH_STACKLESS + #define METH_STACKLESS 0 +#endif +#if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) + #ifndef METH_FASTCALL + #define METH_FASTCALL 0x80 + #endif + typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs); + typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args, + Py_ssize_t nargs, PyObject *kwnames); +#else + #define __Pyx_PyCFunctionFast _PyCFunctionFast + #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords +#endif +#if CYTHON_FAST_PYCCALL +#define __Pyx_PyFastCFunction_Check(func)\ + ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS))))) +#else +#define __Pyx_PyFastCFunction_Check(func) 0 +#endif +#if CYTHON_USE_DICT_VERSIONS +#define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) +#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ + (version_var) = __PYX_GET_DICT_VERSION(dict);\ + (cache_var) = (value); +#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ + static PY_UINT64_T __pyx_dict_version = 0;\ + static PyObject *__pyx_dict_cached_value = NULL;\ + if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ + (VAR) = __pyx_dict_cached_value;\ + } else {\ + (VAR) = __pyx_dict_cached_value = (LOOKUP);\ + __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ + }\ + } +#else +#define __PYX_GET_DICT_VERSION(dict) (0) +#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) +#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) + #define PyObject_Malloc(s) PyMem_Malloc(s) + #define PyObject_Free(p) PyMem_Free(p) + #define PyObject_Realloc(p) PyMem_Realloc(p) +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1 + #define PyMem_RawMalloc(n) PyMem_Malloc(n) + #define PyMem_RawRealloc(p, n) PyMem_Realloc(p, n) + #define PyMem_RawFree(p) PyMem_Free(p) +#endif +#if CYTHON_COMPILING_IN_PYSTON + #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co) + #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno) +#else + #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) + #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) +#endif +#if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000 + #define __Pyx_PyThreadState_Current PyThreadState_GET() +#elif PY_VERSION_HEX >= 0x03060000 + #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() +#elif PY_VERSION_HEX >= 0x03000000 + #define __Pyx_PyThreadState_Current PyThreadState_GET() +#else + #define __Pyx_PyThreadState_Current _PyThreadState_Current +#endif +#if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) +#include "pythread.h" +#define Py_tss_NEEDS_INIT 0 +typedef int Py_tss_t; +static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) { + *key = PyThread_create_key(); + return 0; // PyThread_create_key reports success always +} +static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) { + Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t)); + *key = Py_tss_NEEDS_INIT; + return key; +} +static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) { + PyObject_Free(key); +} +static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) { + return *key != Py_tss_NEEDS_INIT; +} +static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) { + PyThread_delete_key(*key); + *key = Py_tss_NEEDS_INIT; +} +static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) { + return PyThread_set_key_value(*key, value); +} +static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { + return PyThread_get_key_value(*key); +} +#endif // TSS (Thread Specific Storage) API +#if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized) +#define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) +#else +#define __Pyx_PyDict_NewPresized(n) PyDict_New() +#endif +#if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION + #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) +#else + #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS +#define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) +#else +#define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name) +#endif +#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) + #define CYTHON_PEP393_ENABLED 1 + #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ + 0 : _PyUnicode_Ready((PyObject *)(op))) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) + #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) + #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) + #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) + #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) + #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch) + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) +#else + #define CYTHON_PEP393_ENABLED 0 + #define PyUnicode_1BYTE_KIND 1 + #define PyUnicode_2BYTE_KIND 2 + #define PyUnicode_4BYTE_KIND 4 + #define __Pyx_PyUnicode_READY(op) (0) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) + #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111) + #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) + #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) + #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) + #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch) + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) +#endif +#if CYTHON_COMPILING_IN_PYPY + #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) +#else + #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ + PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains) + #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check) + #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format) + #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) +#endif +#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) +#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) +#else + #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) +#endif +#if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) + #define PyObject_ASCII(o) PyObject_Repr(o) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBaseString_Type PyUnicode_Type + #define PyStringObject PyUnicodeObject + #define PyString_Type PyUnicode_Type + #define PyString_Check PyUnicode_Check + #define PyString_CheckExact PyUnicode_CheckExact + #define PyObject_Unicode PyObject_Str +#endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) + #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) +#else + #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) + #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) +#endif +#ifndef PySet_CheckExact + #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) +#endif +#if CYTHON_ASSUME_SAFE_MACROS + #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) +#else + #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyIntObject PyLongObject + #define PyInt_Type PyLong_Type + #define PyInt_Check(op) PyLong_Check(op) + #define PyInt_CheckExact(op) PyLong_CheckExact(op) + #define PyInt_FromString PyLong_FromString + #define PyInt_FromUnicode PyLong_FromUnicode + #define PyInt_FromLong PyLong_FromLong + #define PyInt_FromSize_t PyLong_FromSize_t + #define PyInt_FromSsize_t PyLong_FromSsize_t + #define PyInt_AsLong PyLong_AsLong + #define PyInt_AS_LONG PyLong_AS_LONG + #define PyInt_AsSsize_t PyLong_AsSsize_t + #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask + #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask + #define PyNumber_Int PyNumber_Long +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBoolObject PyLongObject +#endif +#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY + #ifndef PyUnicode_InternFromString + #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) + #endif +#endif +#if PY_VERSION_HEX < 0x030200A4 + typedef long Py_hash_t; + #define __Pyx_PyInt_FromHash_t PyInt_FromLong + #define __Pyx_PyInt_AsHash_t PyInt_AsLong +#else + #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t + #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t +#endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : (Py_INCREF(func), func)) +#else + #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) +#endif +#if CYTHON_USE_ASYNC_SLOTS + #if PY_VERSION_HEX >= 0x030500B1 + #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods + #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) + #else + #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) + #endif +#else + #define __Pyx_PyType_AsAsync(obj) NULL +#endif +#ifndef __Pyx_PyAsyncMethodsStruct + typedef struct { + unaryfunc am_await; + unaryfunc am_aiter; + unaryfunc am_anext; + } __Pyx_PyAsyncMethodsStruct; +#endif + +#if defined(WIN32) || defined(MS_WINDOWS) + #define _USE_MATH_DEFINES +#endif +#include +#ifdef NAN +#define __PYX_NAN() ((float) NAN) +#else +static CYTHON_INLINE float __PYX_NAN() { + float value; + memset(&value, 0xFF, sizeof(value)); + return value; +} +#endif +#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) +#define __Pyx_truncl trunc +#else +#define __Pyx_truncl truncl +#endif + + +#define __PYX_ERR(f_index, lineno, Ln_error) \ +{ \ + __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \ +} + +#ifndef __PYX_EXTERN_C + #ifdef __cplusplus + #define __PYX_EXTERN_C extern "C" + #else + #define __PYX_EXTERN_C extern + #endif +#endif + +#define __PYX_HAVE__gevent____waiter +#define __PYX_HAVE_API__gevent____waiter +/* Early includes */ +#include "greenlet/greenlet.h" +#ifdef _OPENMP +#include +#endif /* _OPENMP */ + +#if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) +#define CYTHON_WITHOUT_ASSERTIONS +#endif + +typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; + const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; + +#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 +#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0 +#define __PYX_DEFAULT_STRING_ENCODING "" +#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString +#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#define __Pyx_uchar_cast(c) ((unsigned char)c) +#define __Pyx_long_cast(x) ((long)x) +#define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ + (sizeof(type) < sizeof(Py_ssize_t)) ||\ + (sizeof(type) > sizeof(Py_ssize_t) &&\ + likely(v < (type)PY_SSIZE_T_MAX ||\ + v == (type)PY_SSIZE_T_MAX) &&\ + (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ + v == (type)PY_SSIZE_T_MIN))) ||\ + (sizeof(type) == sizeof(Py_ssize_t) &&\ + (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ + v == (type)PY_SSIZE_T_MAX))) ) +static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) { + return (size_t) i < (size_t) limit; +} +#if defined (__cplusplus) && __cplusplus >= 201103L + #include + #define __Pyx_sst_abs(value) std::abs(value) +#elif SIZEOF_INT >= SIZEOF_SIZE_T + #define __Pyx_sst_abs(value) abs(value) +#elif SIZEOF_LONG >= SIZEOF_SIZE_T + #define __Pyx_sst_abs(value) labs(value) +#elif defined (_MSC_VER) + #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) +#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define __Pyx_sst_abs(value) llabs(value) +#elif defined (__GNUC__) + #define __Pyx_sst_abs(value) __builtin_llabs(value) +#else + #define __Pyx_sst_abs(value) ((value<0) ? -value : value) +#endif +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*); +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); +#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) +#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) +#define __Pyx_PyBytes_FromString PyBytes_FromString +#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); +#if PY_MAJOR_VERSION < 3 + #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#else + #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize +#endif +#define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) +#define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) +#define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) +#define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) +#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) +static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) { + const Py_UNICODE *u_end = u; + while (*u_end++) ; + return (size_t)(u_end - u - 1); +} +#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) +#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode +#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode +#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) +#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) +static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); +static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*); +static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); +#define __Pyx_PySequence_Tuple(obj)\ + (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); +#if CYTHON_ASSUME_SAFE_MACROS +#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) +#else +#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) +#endif +#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) +#if PY_MAJOR_VERSION >= 3 +#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) +#else +#define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) +#endif +#define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x)) +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII +static int __Pyx_sys_getdefaultencoding_not_ascii; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + PyObject* ascii_chars_u = NULL; + PyObject* ascii_chars_b = NULL; + const char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + if (strcmp(default_encoding_c, "ascii") == 0) { + __Pyx_sys_getdefaultencoding_not_ascii = 0; + } else { + char ascii_chars[128]; + int c; + for (c = 0; c < 128; c++) { + ascii_chars[c] = c; + } + __Pyx_sys_getdefaultencoding_not_ascii = 1; + ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); + if (!ascii_chars_u) goto bad; + ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); + if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { + PyErr_Format( + PyExc_ValueError, + "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", + default_encoding_c); + goto bad; + } + Py_DECREF(ascii_chars_u); + Py_DECREF(ascii_chars_b); + } + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + Py_XDECREF(ascii_chars_u); + Py_XDECREF(ascii_chars_b); + return -1; +} +#endif +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) +#else +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +static char* __PYX_DEFAULT_STRING_ENCODING; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1); + if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; + strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + return -1; +} +#endif +#endif + + +/* Test for GCC > 2.95 */ +#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) + #define likely(x) __builtin_expect(!!(x), 1) + #define unlikely(x) __builtin_expect(!!(x), 0) +#else /* !__GNUC__ or GCC < 2.95 */ + #define likely(x) (x) + #define unlikely(x) (x) +#endif /* __GNUC__ */ +static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } + +static PyObject *__pyx_m = NULL; +static PyObject *__pyx_d; +static PyObject *__pyx_b; +static PyObject *__pyx_cython_runtime = NULL; +static PyObject *__pyx_empty_tuple; +static PyObject *__pyx_empty_bytes; +static PyObject *__pyx_empty_unicode; +static int __pyx_lineno; +static int __pyx_clineno = 0; +static const char * __pyx_cfilenm= __FILE__; +static const char *__pyx_filename; + + +static const char *__pyx_f[] = { + "src\\gevent\\_waiter.py", + "src\\gevent\\__greenlet_primitives.pxd", + "src\\gevent\\__waiter.pxd", +}; + +/*--- Type declarations ---*/ +struct __pyx_obj_6gevent_21__greenlet_primitives_TrackedRawGreenlet; +struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop; +struct __pyx_obj_6gevent_8__waiter_Waiter; +struct __pyx_obj_6gevent_8__waiter_MultipleWaiter; + +/* "gevent/__greenlet_primitives.pxd":37 + * return PyGreenlet_Switch(self, NULL, NULL) + * + * cdef class TrackedRawGreenlet(greenlet): # <<<<<<<<<<<<<< + * pass + * + */ +struct __pyx_obj_6gevent_21__greenlet_primitives_TrackedRawGreenlet { + PyGreenlet __pyx_base; +}; + + +/* "gevent/__greenlet_primitives.pxd":40 + * pass + * + * cdef class SwitchOutGreenletWithLoop(TrackedRawGreenlet): # <<<<<<<<<<<<<< + * cdef public loop + * + */ +struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop { + struct __pyx_obj_6gevent_21__greenlet_primitives_TrackedRawGreenlet __pyx_base; + struct __pyx_vtabstruct_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *__pyx_vtab; + PyObject *loop; +}; + + +/* "gevent/__waiter.pxd":33 + * _greenlet_imported = True + * + * cdef class Waiter: # <<<<<<<<<<<<<< + * cdef readonly SwitchOutGreenletWithLoop hub + * cdef readonly greenlet greenlet + */ +struct __pyx_obj_6gevent_8__waiter_Waiter { + PyObject_HEAD + struct __pyx_vtabstruct_6gevent_8__waiter_Waiter *__pyx_vtab; + struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *hub; + PyGreenlet *greenlet; + PyObject *value; + PyObject *_exception; +}; + + +/* "gevent/__waiter.pxd":47 + * @cython.final + * @cython.internal + * cdef class MultipleWaiter(Waiter): # <<<<<<<<<<<<<< + * cdef list _values + */ +struct __pyx_obj_6gevent_8__waiter_MultipleWaiter { + struct __pyx_obj_6gevent_8__waiter_Waiter __pyx_base; + PyObject *_values; +}; + + + +/* "gevent/__greenlet_primitives.pxd":40 + * pass + * + * cdef class SwitchOutGreenletWithLoop(TrackedRawGreenlet): # <<<<<<<<<<<<<< + * cdef public loop + * + */ + +struct __pyx_vtabstruct_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop { + PyObject *(*__pyx_switch)(struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *, int __pyx_skip_dispatch); + PyObject *(*switch_out)(struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *, int __pyx_skip_dispatch); +}; +static struct __pyx_vtabstruct_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *__pyx_vtabptr_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop; + + +/* "src/gevent/_waiter.py":27 + * + * + * class Waiter(object): # <<<<<<<<<<<<<< + * """ + * A low level communication utility for greenlets. + */ + +struct __pyx_vtabstruct_6gevent_8__waiter_Waiter { + PyObject *(*get)(struct __pyx_obj_6gevent_8__waiter_Waiter *, int __pyx_skip_dispatch); + PyObject *(*clear)(struct __pyx_obj_6gevent_8__waiter_Waiter *, int __pyx_skip_dispatch); +}; +static struct __pyx_vtabstruct_6gevent_8__waiter_Waiter *__pyx_vtabptr_6gevent_8__waiter_Waiter; + + +/* "src/gevent/_waiter.py":166 + * + * + * class MultipleWaiter(Waiter): # <<<<<<<<<<<<<< + * """ + * An internal extension of Waiter that can be used if multiple objects + */ + +struct __pyx_vtabstruct_6gevent_8__waiter_MultipleWaiter { + struct __pyx_vtabstruct_6gevent_8__waiter_Waiter __pyx_base; +}; +static struct __pyx_vtabstruct_6gevent_8__waiter_MultipleWaiter *__pyx_vtabptr_6gevent_8__waiter_MultipleWaiter; + +/* --- Runtime support code (head) --- */ +/* Refnanny.proto */ +#ifndef CYTHON_REFNANNY + #define CYTHON_REFNANNY 0 +#endif +#if CYTHON_REFNANNY + typedef struct { + void (*INCREF)(void*, PyObject*, int); + void (*DECREF)(void*, PyObject*, int); + void (*GOTREF)(void*, PyObject*, int); + void (*GIVEREF)(void*, PyObject*, int); + void* (*SetupContext)(const char*, int, const char*); + void (*FinishContext)(void**); + } __Pyx_RefNannyAPIStruct; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); + #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; +#ifdef WITH_THREAD + #define __Pyx_RefNannySetupContext(name, acquire_gil)\ + if (acquire_gil) {\ + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ + PyGILState_Release(__pyx_gilstate_save);\ + } else {\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ + } +#else + #define __Pyx_RefNannySetupContext(name, acquire_gil)\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) +#endif + #define __Pyx_RefNannyFinishContext()\ + __Pyx_RefNanny->FinishContext(&__pyx_refnanny) + #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0) + #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) + #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) + #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) +#else + #define __Pyx_RefNannyDeclarations + #define __Pyx_RefNannySetupContext(name, acquire_gil) + #define __Pyx_RefNannyFinishContext() + #define __Pyx_INCREF(r) Py_INCREF(r) + #define __Pyx_DECREF(r) Py_DECREF(r) + #define __Pyx_GOTREF(r) + #define __Pyx_GIVEREF(r) + #define __Pyx_XINCREF(r) Py_XINCREF(r) + #define __Pyx_XDECREF(r) Py_XDECREF(r) + #define __Pyx_XGOTREF(r) + #define __Pyx_XGIVEREF(r) +#endif +#define __Pyx_XDECREF_SET(r, v) do {\ + PyObject *tmp = (PyObject *) r;\ + r = v; __Pyx_XDECREF(tmp);\ + } while (0) +#define __Pyx_DECREF_SET(r, v) do {\ + PyObject *tmp = (PyObject *) r;\ + r = v; __Pyx_DECREF(tmp);\ + } while (0) +#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) +#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) + +/* PyObjectGetAttrStr.proto */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); +#else +#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) +#endif + +/* GetBuiltinName.proto */ +static PyObject *__Pyx_GetBuiltinName(PyObject *name); + +/* RaiseDoubleKeywords.proto */ +static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); + +/* ParseKeywords.proto */ +static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\ + PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\ + const char* function_name); + +/* RaiseArgTupleInvalid.proto */ +static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, + Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); + +/* ExtTypeTest.proto */ +static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); + +/* PyFunctionFastCall.proto */ +#if CYTHON_FAST_PYCALL +#define __Pyx_PyFunction_FastCall(func, args, nargs)\ + __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) +#if 1 || PY_VERSION_HEX < 0x030600B1 +static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs); +#else +#define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs) +#endif +#define __Pyx_BUILD_ASSERT_EXPR(cond)\ + (sizeof(char [1 - 2*!(cond)]) - 1) +#ifndef Py_MEMBER_SIZE +#define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member) +#endif + static size_t __pyx_pyframe_localsplus_offset = 0; + #include "frameobject.h" + #define __Pxy_PyFrame_Initialize_Offsets()\ + ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\ + (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus))) + #define __Pyx_PyFrame_GetLocalsplus(frame)\ + (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset)) +#endif + +/* PyObjectCall.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); +#else +#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) +#endif + +/* PyObjectCallMethO.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); +#endif + +/* PyObjectCallNoArg.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); +#else +#define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL) +#endif + +/* PyCFunctionFastCall.proto */ +#if CYTHON_FAST_PYCCALL +static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs); +#else +#define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL) +#endif + +/* PyObjectCallOneArg.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); + +/* PyThreadStateGet.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; +#define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; +#define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type +#else +#define __Pyx_PyThreadState_declare +#define __Pyx_PyThreadState_assign +#define __Pyx_PyErr_Occurred() PyErr_Occurred() +#endif + +/* PyErrFetchRestore.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) +#define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) +#define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) +#define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) +#define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); +static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) +#else +#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) +#endif +#else +#define __Pyx_PyErr_Clear() PyErr_Clear() +#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) +#define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) +#define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb) +#define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) +#endif + +/* RaiseException.proto */ +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); + +/* PyObjectCall2Args.proto */ +static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2); + +/* GetTopmostException.proto */ +#if CYTHON_USE_EXC_INFO_STACK +static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate); +#endif + +/* SaveResetException.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); +#else +#define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb) +#define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb) +#endif + +/* GetException.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb) +static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#else +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); +#endif + +/* KeywordStringCheck.proto */ +static int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* function_name, int kw_allowed); + +/* SwapException.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#else +static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb); +#endif + +/* ListAppend.proto */ +#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS +static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) { + PyListObject* L = (PyListObject*) list; + Py_ssize_t len = Py_SIZE(list); + if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) { + Py_INCREF(x); + PyList_SET_ITEM(list, len, x); + Py_SIZE(list) = len+1; + return 0; + } + return PyList_Append(list, x); +} +#else +#define __Pyx_PyList_Append(L,x) PyList_Append(L,x) +#endif + +/* PyObjectGetMethod.proto */ +static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method); + +/* PyObjectCallMethod1.proto */ +static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg); + +/* pop_index.proto */ +static PyObject* __Pyx__PyObject_PopNewIndex(PyObject* L, PyObject* py_ix); +static PyObject* __Pyx__PyObject_PopIndex(PyObject* L, PyObject* py_ix); +#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS +static PyObject* __Pyx__PyList_PopIndex(PyObject* L, PyObject* py_ix, Py_ssize_t ix); +#define __Pyx_PyObject_PopIndex(L, py_ix, ix, is_signed, type, to_py_func) (\ + (likely(PyList_CheckExact(L) && __Pyx_fits_Py_ssize_t(ix, type, is_signed))) ?\ + __Pyx__PyList_PopIndex(L, py_ix, ix) : (\ + (unlikely(py_ix == Py_None)) ? __Pyx__PyObject_PopNewIndex(L, to_py_func(ix)) :\ + __Pyx__PyObject_PopIndex(L, py_ix))) +#define __Pyx_PyList_PopIndex(L, py_ix, ix, is_signed, type, to_py_func) (\ + __Pyx_fits_Py_ssize_t(ix, type, is_signed) ?\ + __Pyx__PyList_PopIndex(L, py_ix, ix) : (\ + (unlikely(py_ix == Py_None)) ? __Pyx__PyObject_PopNewIndex(L, to_py_func(ix)) :\ + __Pyx__PyObject_PopIndex(L, py_ix))) +#else +#define __Pyx_PyList_PopIndex(L, py_ix, ix, is_signed, type, to_py_func)\ + __Pyx_PyObject_PopIndex(L, py_ix, ix, is_signed, type, to_py_func) +#define __Pyx_PyObject_PopIndex(L, py_ix, ix, is_signed, type, to_py_func) (\ + (unlikely(py_ix == Py_None)) ? __Pyx__PyObject_PopNewIndex(L, to_py_func(ix)) :\ + __Pyx__PyObject_PopIndex(L, py_ix)) +#endif + +/* TypeImport.proto */ +#ifndef __PYX_HAVE_RT_ImportType_proto +#define __PYX_HAVE_RT_ImportType_proto +enum __Pyx_ImportType_CheckSize { + __Pyx_ImportType_CheckSize_Error = 0, + __Pyx_ImportType_CheckSize_Warn = 1, + __Pyx_ImportType_CheckSize_Ignore = 2 +}; +static PyTypeObject *__Pyx_ImportType(PyObject* module, const char *module_name, const char *class_name, size_t size, enum __Pyx_ImportType_CheckSize check_size); +#endif + +/* PyObject_GenericGetAttrNoDict.proto */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name); +#else +#define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr +#endif + +/* PyObject_GenericGetAttr.proto */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name); +#else +#define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr +#endif + +/* SetVTable.proto */ +static int __Pyx_SetVtable(PyObject *dict, void *vtable); + +/* GetVTable.proto */ +static void* __Pyx_GetVtable(PyObject *dict); + +/* Import.proto */ +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); + +/* ImportFrom.proto */ +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); + +/* FetchCommonType.proto */ +static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); + +/* CythonFunction.proto */ +#define __Pyx_CyFunction_USED 1 +#define __Pyx_CYFUNCTION_STATICMETHOD 0x01 +#define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 +#define __Pyx_CYFUNCTION_CCLASS 0x04 +#define __Pyx_CyFunction_GetClosure(f)\ + (((__pyx_CyFunctionObject *) (f))->func_closure) +#define __Pyx_CyFunction_GetClassObj(f)\ + (((__pyx_CyFunctionObject *) (f))->func_classobj) +#define __Pyx_CyFunction_Defaults(type, f)\ + ((type *)(((__pyx_CyFunctionObject *) (f))->defaults)) +#define __Pyx_CyFunction_SetDefaultsGetter(f, g)\ + ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g) +typedef struct { + PyCFunctionObject func; +#if PY_VERSION_HEX < 0x030500A0 + PyObject *func_weakreflist; +#endif + PyObject *func_dict; + PyObject *func_name; + PyObject *func_qualname; + PyObject *func_doc; + PyObject *func_globals; + PyObject *func_code; + PyObject *func_closure; + PyObject *func_classobj; + void *defaults; + int defaults_pyobjects; + int flags; + PyObject *defaults_tuple; + PyObject *defaults_kwdict; + PyObject *(*defaults_getter)(PyObject *); + PyObject *func_annotations; +} __pyx_CyFunctionObject; +static PyTypeObject *__pyx_CyFunctionType = 0; +#define __Pyx_CyFunction_Check(obj) (__Pyx_TypeCheck(obj, __pyx_CyFunctionType)) +#define __Pyx_CyFunction_NewEx(ml, flags, qualname, self, module, globals, code)\ + __Pyx_CyFunction_New(__pyx_CyFunctionType, ml, flags, qualname, self, module, globals, code) +static PyObject *__Pyx_CyFunction_New(PyTypeObject *, PyMethodDef *ml, + int flags, PyObject* qualname, + PyObject *self, + PyObject *module, PyObject *globals, + PyObject* code); +static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, + size_t size, + int pyobjects); +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, + PyObject *tuple); +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, + PyObject *dict); +static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m, + PyObject *dict); +static int __pyx_CyFunction_init(void); + +/* GetModuleGlobalName.proto */ +#if CYTHON_USE_DICT_VERSIONS +#define __Pyx_GetModuleGlobalName(var, name) {\ + static PY_UINT64_T __pyx_dict_version = 0;\ + static PyObject *__pyx_dict_cached_value = NULL;\ + (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\ + (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\ + __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ +} +#define __Pyx_GetModuleGlobalNameUncached(var, name) {\ + PY_UINT64_T __pyx_dict_version;\ + PyObject *__pyx_dict_cached_value;\ + (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ +} +static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value); +#else +#define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name) +#define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name) +static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name); +#endif + +/* GetAttr.proto */ +static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *); + +/* Globals.proto */ +static PyObject* __Pyx_Globals(void); + +/* CLineInTraceback.proto */ +#ifdef CYTHON_CLINE_IN_TRACEBACK +#define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) +#else +static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line); +#endif + +/* CodeObjectCache.proto */ +typedef struct { + PyCodeObject* code_object; + int code_line; +} __Pyx_CodeObjectCacheEntry; +struct __Pyx_CodeObjectCache { + int count; + int max_count; + __Pyx_CodeObjectCacheEntry* entries; +}; +static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); +static PyCodeObject *__pyx_find_code_object(int code_line); +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); + +/* AddTraceback.proto */ +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename); + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); + +/* CIntFromPy.proto */ +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); + +/* CIntFromPy.proto */ +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); + +/* FastTypeChecks.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) +static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b); +static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type); +static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2); +#else +#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) +#define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) +#define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) +#endif +#define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) + +/* CheckBinaryVersion.proto */ +static int __Pyx_check_binary_version(void); + +/* PyObjectSetAttrStr.proto */ +#if CYTHON_USE_TYPE_SLOTS +#define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o, n, NULL) +static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value); +#else +#define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n) +#define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v) +#endif + +/* VoidPtrExport.proto */ +static int __Pyx_ExportVoidPtr(PyObject *name, void *p, const char *sig); + +/* VoidPtrImport.proto */ +static int __Pyx_ImportVoidPtr(PyObject *module, const char *name, void **p, const char *sig); + +/* FunctionImport.proto */ +static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig); + +/* InitStrings.proto */ +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); + +static PyObject *__pyx_f_6gevent_8__waiter_6Waiter_clear(struct __pyx_obj_6gevent_8__waiter_Waiter *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/ +static PyObject *__pyx_f_6gevent_8__waiter_6Waiter_get(struct __pyx_obj_6gevent_8__waiter_Waiter *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/ +static PyObject *__pyx_f_6gevent_8__waiter_14MultipleWaiter_get(struct __pyx_obj_6gevent_8__waiter_MultipleWaiter *__pyx_v_self, CYTHON_UNUSED int __pyx_skip_dispatch); /* proto*/ + +/* Module declarations from 'cython' */ + +/* Module declarations from 'greenlet' */ + +/* Module declarations from 'gevent.__greenlet_primitives' */ +static PyTypeObject *__pyx_ptype_6gevent_21__greenlet_primitives_greenlet = 0; +static PyTypeObject *__pyx_ptype_6gevent_21__greenlet_primitives_TrackedRawGreenlet = 0; +static PyTypeObject *__pyx_ptype_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop = 0; +static PyObject **__pyx_vp_6gevent_21__greenlet_primitives_get_objects = 0; +#define __pyx_v_6gevent_21__greenlet_primitives_get_objects (*__pyx_vp_6gevent_21__greenlet_primitives_get_objects) +static PyObject **__pyx_vp_6gevent_21__greenlet_primitives_wref = 0; +#define __pyx_v_6gevent_21__greenlet_primitives_wref (*__pyx_vp_6gevent_21__greenlet_primitives_wref) +static PyObject **__pyx_vp_6gevent_21__greenlet_primitives_BlockingSwitchOutError = 0; +#define __pyx_v_6gevent_21__greenlet_primitives_BlockingSwitchOutError (*__pyx_vp_6gevent_21__greenlet_primitives_BlockingSwitchOutError) +static int *__pyx_vp_6gevent_21__greenlet_primitives__greenlet_imported = 0; +#define __pyx_v_6gevent_21__greenlet_primitives__greenlet_imported (*__pyx_vp_6gevent_21__greenlet_primitives__greenlet_imported) + +/* Module declarations from 'gevent.__hub_local' */ +static PyObject **__pyx_vp_6gevent_11__hub_local__threadlocal = 0; +#define __pyx_v_6gevent_11__hub_local__threadlocal (*__pyx_vp_6gevent_11__hub_local__threadlocal) +static struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *(*__pyx_f_6gevent_11__hub_local_get_hub_noargs)(int __pyx_skip_dispatch); /*proto*/ + +/* Module declarations from 'gevent.__waiter' */ +static PyTypeObject *__pyx_ptype_6gevent_8__waiter_greenlet = 0; +static PyTypeObject *__pyx_ptype_6gevent_8__waiter_Waiter = 0; +static PyTypeObject *__pyx_ptype_6gevent_8__waiter_MultipleWaiter = 0; +static PyObject *__pyx_v_6gevent_8__waiter_sys = 0; +static PyObject *__pyx_v_6gevent_8__waiter_ConcurrentObjectUseError = 0; +static int __pyx_v_6gevent_8__waiter__greenlet_imported; +static PyObject *__pyx_v_6gevent_8__waiter__NONE = 0; +static CYTHON_INLINE PyGreenlet *__pyx_f_6gevent_8__waiter_getcurrent(void); /*proto*/ +static CYTHON_INLINE void __pyx_f_6gevent_8__waiter_greenlet_init(void); /*proto*/ +#define __Pyx_MODULE_NAME "gevent.__waiter" +extern int __pyx_module_is_main_gevent____waiter; +int __pyx_module_is_main_gevent____waiter = 0; + +/* Implementation of 'gevent.__waiter' */ +static PyObject *__pyx_builtin_object; +static PyObject *__pyx_builtin___import__; +static PyObject *__pyx_builtin_AssertionError; +static const char __pyx_k_all[] = "__all__"; +static const char __pyx_k_get[] = "get"; +static const char __pyx_k_hub[] = "hub"; +static const char __pyx_k_pop[] = "pop"; +static const char __pyx_k_sys[] = "sys"; +static const char __pyx_k_NONE[] = "_NONE"; +static const char __pyx_k_args[] = "args"; +static const char __pyx_k_init[] = "__init__"; +static const char __pyx_k_main[] = "__main__"; +static const char __pyx_k_name[] = "__name__"; +static const char __pyx_k_self[] = "self"; +static const char __pyx_k_test[] = "__test__"; +static const char __pyx_k_clear[] = "clear"; +static const char __pyx_k_ready[] = "ready"; +static const char __pyx_k_slots[] = "__slots__"; +static const char __pyx_k_throw[] = "throw"; +static const char __pyx_k_value[] = "value"; +static const char __pyx_k_Waiter[] = "Waiter"; +static const char __pyx_k_import[] = "__import__"; +static const char __pyx_k_init_2[] = "_init"; +static const char __pyx_k_lambda[] = ""; +static const char __pyx_k_object[] = "object"; +static const char __pyx_k_source[] = "source"; +static const char __pyx_k_switch[] = "switch"; +static const char __pyx_k_values[] = "_values"; +static const char __pyx_k_exc_info[] = "exc_info"; +static const char __pyx_k_greenlet[] = "greenlet"; +static const char __pyx_k_pyx_capi[] = "__pyx_capi__"; +static const char __pyx_k_exception[] = "exception"; +static const char __pyx_k_Waiter_get[] = "Waiter.get"; +static const char __pyx_k_getcurrent[] = "getcurrent"; +static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__"; +static const char __pyx_k_successful[] = "successful"; +static const char __pyx_k_throw_args[] = "throw_args"; +static const char __pyx_k_exception_2[] = "_exception"; +static const char __pyx_k_switch_args[] = "switch_args"; +static const char __pyx_k_Waiter_clear[] = "Waiter.clear"; +static const char __pyx_k_Waiter_ready[] = "Waiter.ready"; +static const char __pyx_k_Waiter_throw[] = "Waiter.throw"; +static const char __pyx_k_gevent__util[] = "gevent._util"; +static const char __pyx_k_handle_error[] = "handle_error"; +static const char __pyx_k_s_greenlet_s[] = "<%s greenlet=%s>"; +static const char __pyx_k_Waiter_switch[] = "Waiter.switch"; +static const char __pyx_k_greenlet_init[] = "greenlet_init"; +static const char __pyx_k_AssertionError[] = "AssertionError"; +static const char __pyx_k_MultipleWaiter[] = "MultipleWaiter"; +static const char __pyx_k_get_hub_noargs[] = "get_hub_noargs"; +static const char __pyx_k_import_c_accel[] = "import_c_accel"; +static const char __pyx_k_gevent___waiter[] = "gevent.__waiter"; +static const char __pyx_k_Waiter_successful[] = "Waiter.successful"; +static const char __pyx_k_gevent__hub_local[] = "gevent._hub_local"; +static const char __pyx_k_gevent_exceptions[] = "gevent.exceptions"; +static const char __pyx_k_greenlet_imported[] = "_greenlet_imported"; +static const char __pyx_k_MultipleWaiter_get[] = "MultipleWaiter.get"; +static const char __pyx_k_Waiter_switch_args[] = "Waiter.switch_args"; +static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; +static const char __pyx_k_s_greenlet_s_value_r[] = "<%s greenlet=%s value=%r>"; +static const char __pyx_k_MultipleWaiter_switch[] = "MultipleWaiter.switch"; +static const char __pyx_k_src_gevent__waiter_py[] = "src\\gevent\\_waiter.py"; +static const char __pyx_k_s_greenlet_s_exc_info_r[] = "<%s greenlet=%s exc_info=%r>"; +static const char __pyx_k_ConcurrentObjectUseError[] = "ConcurrentObjectUseError"; +static const char __pyx_k_Low_level_waiting_primitives[] = "\nLow-level waiting primitives.\n\n"; +static const char __pyx_k_Can_only_use_Waiter_switch_metho[] = "Can only use Waiter.switch method from the Hub greenlet"; +static const char __pyx_k_This_Waiter_is_already_used_by_r[] = "This Waiter is already used by %r"; +static PyObject *__pyx_n_s_AssertionError; +static PyObject *__pyx_kp_s_Can_only_use_Waiter_switch_metho; +static PyObject *__pyx_n_s_ConcurrentObjectUseError; +static PyObject *__pyx_n_s_MultipleWaiter; +static PyObject *__pyx_n_s_MultipleWaiter_get; +static PyObject *__pyx_n_s_MultipleWaiter_switch; +static PyObject *__pyx_n_s_NONE; +static PyObject *__pyx_kp_s_This_Waiter_is_already_used_by_r; +static PyObject *__pyx_n_s_Waiter; +static PyObject *__pyx_n_s_Waiter_clear; +static PyObject *__pyx_n_s_Waiter_get; +static PyObject *__pyx_n_s_Waiter_ready; +static PyObject *__pyx_n_s_Waiter_successful; +static PyObject *__pyx_n_s_Waiter_switch; +static PyObject *__pyx_n_s_Waiter_switch_args; +static PyObject *__pyx_n_s_Waiter_throw; +static PyObject *__pyx_n_s_all; +static PyObject *__pyx_n_s_args; +static PyObject *__pyx_n_s_clear; +static PyObject *__pyx_n_s_cline_in_traceback; +static PyObject *__pyx_n_s_exc_info; +static PyObject *__pyx_n_s_exception; +static PyObject *__pyx_n_s_exception_2; +static PyObject *__pyx_n_s_get; +static PyObject *__pyx_n_s_get_hub_noargs; +static PyObject *__pyx_n_s_getcurrent; +static PyObject *__pyx_n_s_gevent___waiter; +static PyObject *__pyx_n_s_gevent__hub_local; +static PyObject *__pyx_n_s_gevent__util; +static PyObject *__pyx_n_s_gevent_exceptions; +static PyObject *__pyx_n_s_greenlet; +static PyObject *__pyx_n_s_greenlet_imported; +static PyObject *__pyx_n_s_greenlet_init; +static PyObject *__pyx_n_s_handle_error; +static PyObject *__pyx_n_s_hub; +static PyObject *__pyx_n_s_import; +static PyObject *__pyx_n_s_import_c_accel; +static PyObject *__pyx_n_s_init; +static PyObject *__pyx_n_s_init_2; +static PyObject *__pyx_n_s_lambda; +static PyObject *__pyx_n_s_main; +static PyObject *__pyx_n_s_name; +static PyObject *__pyx_n_s_object; +static PyObject *__pyx_n_s_pop; +static PyObject *__pyx_n_s_pyx_capi; +static PyObject *__pyx_n_s_pyx_vtable; +static PyObject *__pyx_n_s_ready; +static PyObject *__pyx_kp_s_s_greenlet_s; +static PyObject *__pyx_kp_s_s_greenlet_s_exc_info_r; +static PyObject *__pyx_kp_s_s_greenlet_s_value_r; +static PyObject *__pyx_n_s_self; +static PyObject *__pyx_n_s_slots; +static PyObject *__pyx_n_s_source; +static PyObject *__pyx_kp_s_src_gevent__waiter_py; +static PyObject *__pyx_n_s_successful; +static PyObject *__pyx_n_s_switch; +static PyObject *__pyx_n_s_switch_args; +static PyObject *__pyx_n_s_sys; +static PyObject *__pyx_n_s_test; +static PyObject *__pyx_n_s_throw; +static PyObject *__pyx_n_s_throw_args; +static PyObject *__pyx_n_s_value; +static PyObject *__pyx_n_s_values; +static PyObject *__pyx_lambda_funcdef_6gevent_8__waiter_lambda(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static int __pyx_pf_6gevent_8__waiter_6Waiter___init__(struct __pyx_obj_6gevent_8__waiter_Waiter *__pyx_v_self, PyObject *__pyx_v_hub); /* proto */ +static PyObject *__pyx_pf_6gevent_8__waiter_6Waiter_2clear(struct __pyx_obj_6gevent_8__waiter_Waiter *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_8__waiter_6Waiter_4__str__(struct __pyx_obj_6gevent_8__waiter_Waiter *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_8__waiter_6Waiter_6ready(struct __pyx_obj_6gevent_8__waiter_Waiter *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_8__waiter_6Waiter_8successful(struct __pyx_obj_6gevent_8__waiter_Waiter *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_8__waiter_6Waiter_8exc_info___get__(struct __pyx_obj_6gevent_8__waiter_Waiter *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_8__waiter_6Waiter_10switch(struct __pyx_obj_6gevent_8__waiter_Waiter *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_6gevent_8__waiter_6Waiter_12switch_args(struct __pyx_obj_6gevent_8__waiter_Waiter *__pyx_v_self, PyObject *__pyx_v_args); /* proto */ +static PyObject *__pyx_pf_6gevent_8__waiter_6Waiter_14throw(struct __pyx_obj_6gevent_8__waiter_Waiter *__pyx_v_self, PyObject *__pyx_v_throw_args); /* proto */ +static PyObject *__pyx_pf_6gevent_8__waiter_6Waiter_16get(struct __pyx_obj_6gevent_8__waiter_Waiter *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_8__waiter_6Waiter_18__call__(struct __pyx_obj_6gevent_8__waiter_Waiter *__pyx_v_self, PyObject *__pyx_v_source); /* proto */ +static PyObject *__pyx_pf_6gevent_8__waiter_6Waiter_3hub___get__(struct __pyx_obj_6gevent_8__waiter_Waiter *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_8__waiter_6Waiter_8greenlet___get__(struct __pyx_obj_6gevent_8__waiter_Waiter *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_8__waiter_6Waiter_5value___get__(struct __pyx_obj_6gevent_8__waiter_Waiter *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_8__waiter_14MultipleWaiter___init__(struct __pyx_obj_6gevent_8__waiter_MultipleWaiter *__pyx_v_self, PyObject *__pyx_v_hub); /* proto */ +static PyObject *__pyx_pf_6gevent_8__waiter_14MultipleWaiter_2switch(struct __pyx_obj_6gevent_8__waiter_MultipleWaiter *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_6gevent_8__waiter_14MultipleWaiter_4get(struct __pyx_obj_6gevent_8__waiter_MultipleWaiter *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_8__waiter__init(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_tp_new_6gevent_8__waiter_Waiter(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6gevent_8__waiter_MultipleWaiter(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_int_0; +static PyObject *__pyx_tuple_; +static PyObject *__pyx_tuple__2; +static PyObject *__pyx_tuple__3; +static PyObject *__pyx_tuple__5; +static PyObject *__pyx_tuple__7; +static PyObject *__pyx_tuple__9; +static PyObject *__pyx_tuple__11; +static PyObject *__pyx_tuple__13; +static PyObject *__pyx_tuple__15; +static PyObject *__pyx_tuple__17; +static PyObject *__pyx_tuple__19; +static PyObject *__pyx_codeobj__4; +static PyObject *__pyx_codeobj__6; +static PyObject *__pyx_codeobj__8; +static PyObject *__pyx_codeobj__10; +static PyObject *__pyx_codeobj__12; +static PyObject *__pyx_codeobj__14; +static PyObject *__pyx_codeobj__16; +static PyObject *__pyx_codeobj__18; +static PyObject *__pyx_codeobj__20; +static PyObject *__pyx_codeobj__21; +/* Late includes */ + +/* "src/gevent/_waiter.py":24 + * + * locals()['getcurrent'] = __import__('greenlet').getcurrent + * locals()['greenlet_init'] = lambda: None # <<<<<<<<<<<<<< + * + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_8__waiter_2lambda(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyMethodDef __pyx_mdef_6gevent_8__waiter_2lambda = {"lambda", (PyCFunction)__pyx_pw_6gevent_8__waiter_2lambda, METH_NOARGS, 0}; +static PyObject *__pyx_pw_6gevent_8__waiter_2lambda(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("lambda (wrapper)", 0); + __pyx_r = __pyx_lambda_funcdef_6gevent_8__waiter_lambda(__pyx_self); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_lambda_funcdef_6gevent_8__waiter_lambda(CYTHON_UNUSED PyObject *__pyx_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("lambda", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_waiter.py":70 + * __slots__ = ['hub', 'greenlet', 'value', '_exception'] + * + * def __init__(self, hub=None): # <<<<<<<<<<<<<< + * self.hub = get_hub() if hub is None else hub + * self.greenlet = None + */ + +/* Python wrapper */ +static int __pyx_pw_6gevent_8__waiter_6Waiter_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6gevent_8__waiter_6Waiter_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_hub = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_hub,0}; + PyObject* values[1] = {0}; + values[0] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_hub); + if (value) { values[0] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 70, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_hub = values[0]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 70, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.__waiter.Waiter.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_8__waiter_6Waiter___init__(((struct __pyx_obj_6gevent_8__waiter_Waiter *)__pyx_v_self), __pyx_v_hub); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_8__waiter_6Waiter___init__(struct __pyx_obj_6gevent_8__waiter_Waiter *__pyx_v_self, PyObject *__pyx_v_hub) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "src/gevent/_waiter.py":71 + * + * def __init__(self, hub=None): + * self.hub = get_hub() if hub is None else hub # <<<<<<<<<<<<<< + * self.greenlet = None + * self.value = None + */ + __pyx_t_2 = (__pyx_v_hub == Py_None); + if ((__pyx_t_2 != 0)) { + __pyx_t_3 = ((PyObject *)__pyx_f_6gevent_11__hub_local_get_hub_noargs(0)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 71, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __pyx_t_3; + __pyx_t_3 = 0; + } else { + if (!(likely(((__pyx_v_hub) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_hub, __pyx_ptype_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop))))) __PYX_ERR(0, 71, __pyx_L1_error) + __Pyx_INCREF(__pyx_v_hub); + __pyx_t_1 = __pyx_v_hub; + } + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_self->hub); + __Pyx_DECREF(((PyObject *)__pyx_v_self->hub)); + __pyx_v_self->hub = ((struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "src/gevent/_waiter.py":72 + * def __init__(self, hub=None): + * self.hub = get_hub() if hub is None else hub + * self.greenlet = None # <<<<<<<<<<<<<< + * self.value = None + * self._exception = _NONE + */ + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->greenlet); + __Pyx_DECREF(((PyObject *)__pyx_v_self->greenlet)); + __pyx_v_self->greenlet = ((PyGreenlet *)Py_None); + + /* "src/gevent/_waiter.py":73 + * self.hub = get_hub() if hub is None else hub + * self.greenlet = None + * self.value = None # <<<<<<<<<<<<<< + * self._exception = _NONE + * + */ + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->value); + __Pyx_DECREF(__pyx_v_self->value); + __pyx_v_self->value = Py_None; + + /* "src/gevent/_waiter.py":74 + * self.greenlet = None + * self.value = None + * self._exception = _NONE # <<<<<<<<<<<<<< + * + * def clear(self): + */ + __Pyx_INCREF(__pyx_v_6gevent_8__waiter__NONE); + __Pyx_GIVEREF(__pyx_v_6gevent_8__waiter__NONE); + __Pyx_GOTREF(__pyx_v_self->_exception); + __Pyx_DECREF(__pyx_v_self->_exception); + __pyx_v_self->_exception = __pyx_v_6gevent_8__waiter__NONE; + + /* "src/gevent/_waiter.py":70 + * __slots__ = ['hub', 'greenlet', 'value', '_exception'] + * + * def __init__(self, hub=None): # <<<<<<<<<<<<<< + * self.hub = get_hub() if hub is None else hub + * self.greenlet = None + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("gevent.__waiter.Waiter.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_waiter.py":76 + * self._exception = _NONE + * + * def clear(self): # <<<<<<<<<<<<<< + * self.greenlet = None + * self.value = None + */ + +static PyObject *__pyx_pw_6gevent_8__waiter_6Waiter_3clear(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_f_6gevent_8__waiter_6Waiter_clear(struct __pyx_obj_6gevent_8__waiter_Waiter *__pyx_v_self, int __pyx_skip_dispatch) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + __Pyx_RefNannySetupContext("clear", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0; + if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self)))))); + else { + PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + #endif + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_clear); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 76, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_8__waiter_6Waiter_3clear)) { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 76, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0; + if (unlikely(type_dict_guard != tp_dict_version)) { + tp_dict_version = obj_dict_version = 0; + } + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + } + #endif + } + + /* "src/gevent/_waiter.py":77 + * + * def clear(self): + * self.greenlet = None # <<<<<<<<<<<<<< + * self.value = None + * self._exception = _NONE + */ + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->greenlet); + __Pyx_DECREF(((PyObject *)__pyx_v_self->greenlet)); + __pyx_v_self->greenlet = ((PyGreenlet *)Py_None); + + /* "src/gevent/_waiter.py":78 + * def clear(self): + * self.greenlet = None + * self.value = None # <<<<<<<<<<<<<< + * self._exception = _NONE + * + */ + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->value); + __Pyx_DECREF(__pyx_v_self->value); + __pyx_v_self->value = Py_None; + + /* "src/gevent/_waiter.py":79 + * self.greenlet = None + * self.value = None + * self._exception = _NONE # <<<<<<<<<<<<<< + * + * def __str__(self): + */ + __Pyx_INCREF(__pyx_v_6gevent_8__waiter__NONE); + __Pyx_GIVEREF(__pyx_v_6gevent_8__waiter__NONE); + __Pyx_GOTREF(__pyx_v_self->_exception); + __Pyx_DECREF(__pyx_v_self->_exception); + __pyx_v_self->_exception = __pyx_v_6gevent_8__waiter__NONE; + + /* "src/gevent/_waiter.py":76 + * self._exception = _NONE + * + * def clear(self): # <<<<<<<<<<<<<< + * self.greenlet = None + * self.value = None + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("gevent.__waiter.Waiter.clear", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_8__waiter_6Waiter_3clear(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6gevent_8__waiter_6Waiter_2clear[] = "Waiter.clear(self)"; +static PyMethodDef __pyx_mdef_6gevent_8__waiter_6Waiter_3clear = {"clear", (PyCFunction)__pyx_pw_6gevent_8__waiter_6Waiter_3clear, METH_NOARGS, __pyx_doc_6gevent_8__waiter_6Waiter_2clear}; +static PyObject *__pyx_pw_6gevent_8__waiter_6Waiter_3clear(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("clear (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_8__waiter_6Waiter_2clear(((struct __pyx_obj_6gevent_8__waiter_Waiter *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_8__waiter_6Waiter_2clear(struct __pyx_obj_6gevent_8__waiter_Waiter *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("clear", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6gevent_8__waiter_6Waiter_clear(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 76, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__waiter.Waiter.clear", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_waiter.py":81 + * self._exception = _NONE + * + * def __str__(self): # <<<<<<<<<<<<<< + * if self._exception is _NONE: + * return '<%s greenlet=%s>' % (type(self).__name__, self.greenlet) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_8__waiter_6Waiter_5__str__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_8__waiter_6Waiter_5__str__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__str__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_8__waiter_6Waiter_4__str__(((struct __pyx_obj_6gevent_8__waiter_Waiter *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_8__waiter_6Waiter_4__str__(struct __pyx_obj_6gevent_8__waiter_Waiter *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + __Pyx_RefNannySetupContext("__str__", 0); + + /* "src/gevent/_waiter.py":82 + * + * def __str__(self): + * if self._exception is _NONE: # <<<<<<<<<<<<<< + * return '<%s greenlet=%s>' % (type(self).__name__, self.greenlet) + * if self._exception is None: + */ + __pyx_t_1 = (__pyx_v_self->_exception == __pyx_v_6gevent_8__waiter__NONE); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "src/gevent/_waiter.py":83 + * def __str__(self): + * if self._exception is _NONE: + * return '<%s greenlet=%s>' % (type(self).__name__, self.greenlet) # <<<<<<<<<<<<<< + * if self._exception is None: + * return '<%s greenlet=%s value=%r>' % (type(self).__name__, self.greenlet, self.value) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))), __pyx_n_s_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 83, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 83, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); + __Pyx_INCREF(((PyObject *)__pyx_v_self->greenlet)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self->greenlet)); + PyTuple_SET_ITEM(__pyx_t_4, 1, ((PyObject *)__pyx_v_self->greenlet)); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_s_greenlet_s, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 83, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "src/gevent/_waiter.py":82 + * + * def __str__(self): + * if self._exception is _NONE: # <<<<<<<<<<<<<< + * return '<%s greenlet=%s>' % (type(self).__name__, self.greenlet) + * if self._exception is None: + */ + } + + /* "src/gevent/_waiter.py":84 + * if self._exception is _NONE: + * return '<%s greenlet=%s>' % (type(self).__name__, self.greenlet) + * if self._exception is None: # <<<<<<<<<<<<<< + * return '<%s greenlet=%s value=%r>' % (type(self).__name__, self.greenlet, self.value) + * return '<%s greenlet=%s exc_info=%r>' % (type(self).__name__, self.greenlet, self.exc_info) + */ + __pyx_t_2 = (__pyx_v_self->_exception == Py_None); + __pyx_t_1 = (__pyx_t_2 != 0); + if (__pyx_t_1) { + + /* "src/gevent/_waiter.py":85 + * return '<%s greenlet=%s>' % (type(self).__name__, self.greenlet) + * if self._exception is None: + * return '<%s greenlet=%s value=%r>' % (type(self).__name__, self.greenlet, self.value) # <<<<<<<<<<<<<< + * return '<%s greenlet=%s exc_info=%r>' % (type(self).__name__, self.greenlet, self.exc_info) + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))), __pyx_n_s_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 85, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 85, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); + __Pyx_INCREF(((PyObject *)__pyx_v_self->greenlet)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self->greenlet)); + PyTuple_SET_ITEM(__pyx_t_4, 1, ((PyObject *)__pyx_v_self->greenlet)); + __Pyx_INCREF(__pyx_v_self->value); + __Pyx_GIVEREF(__pyx_v_self->value); + PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_self->value); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_s_greenlet_s_value_r, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 85, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "src/gevent/_waiter.py":84 + * if self._exception is _NONE: + * return '<%s greenlet=%s>' % (type(self).__name__, self.greenlet) + * if self._exception is None: # <<<<<<<<<<<<<< + * return '<%s greenlet=%s value=%r>' % (type(self).__name__, self.greenlet, self.value) + * return '<%s greenlet=%s exc_info=%r>' % (type(self).__name__, self.greenlet, self.exc_info) + */ + } + + /* "src/gevent/_waiter.py":86 + * if self._exception is None: + * return '<%s greenlet=%s value=%r>' % (type(self).__name__, self.greenlet, self.value) + * return '<%s greenlet=%s exc_info=%r>' % (type(self).__name__, self.greenlet, self.exc_info) # <<<<<<<<<<<<<< + * + * def ready(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))), __pyx_n_s_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 86, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_exc_info); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 86, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 86, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); + __Pyx_INCREF(((PyObject *)__pyx_v_self->greenlet)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self->greenlet)); + PyTuple_SET_ITEM(__pyx_t_5, 1, ((PyObject *)__pyx_v_self->greenlet)); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_4); + __pyx_t_3 = 0; + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_s_greenlet_s_exc_info_r, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 86, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + + /* "src/gevent/_waiter.py":81 + * self._exception = _NONE + * + * def __str__(self): # <<<<<<<<<<<<<< + * if self._exception is _NONE: + * return '<%s greenlet=%s>' % (type(self).__name__, self.greenlet) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("gevent.__waiter.Waiter.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_waiter.py":88 + * return '<%s greenlet=%s exc_info=%r>' % (type(self).__name__, self.greenlet, self.exc_info) + * + * def ready(self): # <<<<<<<<<<<<<< + * """Return true if and only if it holds a value or an exception""" + * return self._exception is not _NONE + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_8__waiter_6Waiter_7ready(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6gevent_8__waiter_6Waiter_6ready[] = "Waiter.ready(self)\nReturn true if and only if it holds a value or an exception"; +static PyMethodDef __pyx_mdef_6gevent_8__waiter_6Waiter_7ready = {"ready", (PyCFunction)__pyx_pw_6gevent_8__waiter_6Waiter_7ready, METH_NOARGS, __pyx_doc_6gevent_8__waiter_6Waiter_6ready}; +static PyObject *__pyx_pw_6gevent_8__waiter_6Waiter_7ready(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("ready (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_8__waiter_6Waiter_6ready(((struct __pyx_obj_6gevent_8__waiter_Waiter *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_8__waiter_6Waiter_6ready(struct __pyx_obj_6gevent_8__waiter_Waiter *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("ready", 0); + + /* "src/gevent/_waiter.py":90 + * def ready(self): + * """Return true if and only if it holds a value or an exception""" + * return self._exception is not _NONE # <<<<<<<<<<<<<< + * + * def successful(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = (__pyx_v_self->_exception != __pyx_v_6gevent_8__waiter__NONE); + __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 90, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "src/gevent/_waiter.py":88 + * return '<%s greenlet=%s exc_info=%r>' % (type(self).__name__, self.greenlet, self.exc_info) + * + * def ready(self): # <<<<<<<<<<<<<< + * """Return true if and only if it holds a value or an exception""" + * return self._exception is not _NONE + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent.__waiter.Waiter.ready", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_waiter.py":92 + * return self._exception is not _NONE + * + * def successful(self): # <<<<<<<<<<<<<< + * """Return true if and only if it is ready and holds a value""" + * return self._exception is None + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_8__waiter_6Waiter_9successful(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6gevent_8__waiter_6Waiter_8successful[] = "Waiter.successful(self)\nReturn true if and only if it is ready and holds a value"; +static PyMethodDef __pyx_mdef_6gevent_8__waiter_6Waiter_9successful = {"successful", (PyCFunction)__pyx_pw_6gevent_8__waiter_6Waiter_9successful, METH_NOARGS, __pyx_doc_6gevent_8__waiter_6Waiter_8successful}; +static PyObject *__pyx_pw_6gevent_8__waiter_6Waiter_9successful(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("successful (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_8__waiter_6Waiter_8successful(((struct __pyx_obj_6gevent_8__waiter_Waiter *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_8__waiter_6Waiter_8successful(struct __pyx_obj_6gevent_8__waiter_Waiter *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("successful", 0); + + /* "src/gevent/_waiter.py":94 + * def successful(self): + * """Return true if and only if it is ready and holds a value""" + * return self._exception is None # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = (__pyx_v_self->_exception == Py_None); + __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 94, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "src/gevent/_waiter.py":92 + * return self._exception is not _NONE + * + * def successful(self): # <<<<<<<<<<<<<< + * """Return true if and only if it is ready and holds a value""" + * return self._exception is None + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent.__waiter.Waiter.successful", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_waiter.py":97 + * + * @property + * def exc_info(self): # <<<<<<<<<<<<<< + * "Holds the exception info passed to :meth:`throw` if :meth:`throw` was called. Otherwise ``None``." + * if self._exception is not _NONE: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_8__waiter_6Waiter_8exc_info_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_8__waiter_6Waiter_8exc_info_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_8__waiter_6Waiter_8exc_info___get__(((struct __pyx_obj_6gevent_8__waiter_Waiter *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_8__waiter_6Waiter_8exc_info___get__(struct __pyx_obj_6gevent_8__waiter_Waiter *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "src/gevent/_waiter.py":99 + * def exc_info(self): + * "Holds the exception info passed to :meth:`throw` if :meth:`throw` was called. Otherwise ``None``." + * if self._exception is not _NONE: # <<<<<<<<<<<<<< + * return self._exception + * + */ + __pyx_t_1 = (__pyx_v_self->_exception != __pyx_v_6gevent_8__waiter__NONE); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "src/gevent/_waiter.py":100 + * "Holds the exception info passed to :meth:`throw` if :meth:`throw` was called. Otherwise ``None``." + * if self._exception is not _NONE: + * return self._exception # <<<<<<<<<<<<<< + * + * def switch(self, value): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->_exception); + __pyx_r = __pyx_v_self->_exception; + goto __pyx_L0; + + /* "src/gevent/_waiter.py":99 + * def exc_info(self): + * "Holds the exception info passed to :meth:`throw` if :meth:`throw` was called. Otherwise ``None``." + * if self._exception is not _NONE: # <<<<<<<<<<<<<< + * return self._exception + * + */ + } + + /* "src/gevent/_waiter.py":97 + * + * @property + * def exc_info(self): # <<<<<<<<<<<<<< + * "Holds the exception info passed to :meth:`throw` if :meth:`throw` was called. Otherwise ``None``." + * if self._exception is not _NONE: + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_waiter.py":102 + * return self._exception + * + * def switch(self, value): # <<<<<<<<<<<<<< + * """ + * Switch to the greenlet if one's available. Otherwise store the + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_8__waiter_6Waiter_11switch(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static char __pyx_doc_6gevent_8__waiter_6Waiter_10switch[] = "Waiter.switch(self, value)\n\n Switch to the greenlet if one's available. Otherwise store the\n *value*.\n\n .. versionchanged:: 1.3b1\n The *value* is no longer optional.\n "; +static PyMethodDef __pyx_mdef_6gevent_8__waiter_6Waiter_11switch = {"switch", (PyCFunction)__pyx_pw_6gevent_8__waiter_6Waiter_11switch, METH_O, __pyx_doc_6gevent_8__waiter_6Waiter_10switch}; +static PyObject *__pyx_pw_6gevent_8__waiter_6Waiter_11switch(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("switch (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_8__waiter_6Waiter_10switch(((struct __pyx_obj_6gevent_8__waiter_Waiter *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_8__waiter_6Waiter_10switch(struct __pyx_obj_6gevent_8__waiter_Waiter *__pyx_v_self, PyObject *__pyx_v_value) { + PyGreenlet *__pyx_v_greenlet = NULL; + PyObject *__pyx_v_switch = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + __Pyx_RefNannySetupContext("switch", 0); + + /* "src/gevent/_waiter.py":110 + * The *value* is no longer optional. + * """ + * greenlet = self.greenlet # <<<<<<<<<<<<<< + * if greenlet is None: + * self.value = value + */ + __pyx_t_1 = ((PyObject *)__pyx_v_self->greenlet); + __Pyx_INCREF(__pyx_t_1); + __pyx_v_greenlet = ((PyGreenlet *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "src/gevent/_waiter.py":111 + * """ + * greenlet = self.greenlet + * if greenlet is None: # <<<<<<<<<<<<<< + * self.value = value + * self._exception = None + */ + __pyx_t_2 = (((PyObject *)__pyx_v_greenlet) == Py_None); + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "src/gevent/_waiter.py":112 + * greenlet = self.greenlet + * if greenlet is None: + * self.value = value # <<<<<<<<<<<<<< + * self._exception = None + * else: + */ + __Pyx_INCREF(__pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + __Pyx_GOTREF(__pyx_v_self->value); + __Pyx_DECREF(__pyx_v_self->value); + __pyx_v_self->value = __pyx_v_value; + + /* "src/gevent/_waiter.py":113 + * if greenlet is None: + * self.value = value + * self._exception = None # <<<<<<<<<<<<<< + * else: + * if getcurrent() is not self.hub: # pylint:disable=undefined-variable + */ + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->_exception); + __Pyx_DECREF(__pyx_v_self->_exception); + __pyx_v_self->_exception = Py_None; + + /* "src/gevent/_waiter.py":111 + * """ + * greenlet = self.greenlet + * if greenlet is None: # <<<<<<<<<<<<<< + * self.value = value + * self._exception = None + */ + goto __pyx_L3; + } + + /* "src/gevent/_waiter.py":115 + * self._exception = None + * else: + * if getcurrent() is not self.hub: # pylint:disable=undefined-variable # <<<<<<<<<<<<<< + * raise AssertionError("Can only use Waiter.switch method from the Hub greenlet") + * switch = greenlet.switch + */ + /*else*/ { + __pyx_t_1 = ((PyObject *)__pyx_f_6gevent_8__waiter_getcurrent()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 115, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = (__pyx_t_1 != ((PyObject *)__pyx_v_self->hub)); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_2 = (__pyx_t_3 != 0); + if (unlikely(__pyx_t_2)) { + + /* "src/gevent/_waiter.py":116 + * else: + * if getcurrent() is not self.hub: # pylint:disable=undefined-variable + * raise AssertionError("Can only use Waiter.switch method from the Hub greenlet") # <<<<<<<<<<<<<< + * switch = greenlet.switch + * try: + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_AssertionError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 116, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 116, __pyx_L1_error) + + /* "src/gevent/_waiter.py":115 + * self._exception = None + * else: + * if getcurrent() is not self.hub: # pylint:disable=undefined-variable # <<<<<<<<<<<<<< + * raise AssertionError("Can only use Waiter.switch method from the Hub greenlet") + * switch = greenlet.switch + */ + } + + /* "src/gevent/_waiter.py":117 + * if getcurrent() is not self.hub: # pylint:disable=undefined-variable + * raise AssertionError("Can only use Waiter.switch method from the Hub greenlet") + * switch = greenlet.switch # <<<<<<<<<<<<<< + * try: + * switch(value) + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_greenlet), __pyx_n_s_switch); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 117, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_switch = __pyx_t_1; + __pyx_t_1 = 0; + + /* "src/gevent/_waiter.py":118 + * raise AssertionError("Can only use Waiter.switch method from the Hub greenlet") + * switch = greenlet.switch + * try: # <<<<<<<<<<<<<< + * switch(value) + * except: # pylint:disable=bare-except + */ + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6); + __Pyx_XGOTREF(__pyx_t_4); + __Pyx_XGOTREF(__pyx_t_5); + __Pyx_XGOTREF(__pyx_t_6); + /*try:*/ { + + /* "src/gevent/_waiter.py":119 + * switch = greenlet.switch + * try: + * switch(value) # <<<<<<<<<<<<<< + * except: # pylint:disable=bare-except + * self.hub.handle_error(switch, *sys.exc_info()) + */ + __Pyx_INCREF(__pyx_v_switch); + __pyx_t_7 = __pyx_v_switch; __pyx_t_8 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) { + __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); + if (likely(__pyx_t_8)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); + __Pyx_INCREF(__pyx_t_8); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_7, function); + } + } + __pyx_t_1 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_8, __pyx_v_value) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_value); + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 119, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_waiter.py":118 + * raise AssertionError("Can only use Waiter.switch method from the Hub greenlet") + * switch = greenlet.switch + * try: # <<<<<<<<<<<<<< + * switch(value) + * except: # pylint:disable=bare-except + */ + } + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L10_try_end; + __pyx_L5_error:; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_waiter.py":120 + * try: + * switch(value) + * except: # pylint:disable=bare-except # <<<<<<<<<<<<<< + * self.hub.handle_error(switch, *sys.exc_info()) + * + */ + /*except:*/ { + __Pyx_AddTraceback("gevent.__waiter.Waiter.switch", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(0, 120, __pyx_L7_except_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GOTREF(__pyx_t_8); + + /* "src/gevent/_waiter.py":121 + * switch(value) + * except: # pylint:disable=bare-except + * self.hub.handle_error(switch, *sys.exc_info()) # <<<<<<<<<<<<<< + * + * def switch_args(self, *args): + */ + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->hub), __pyx_n_s_handle_error); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 121, __pyx_L7_except_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 121, __pyx_L7_except_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_INCREF(__pyx_v_switch); + __Pyx_GIVEREF(__pyx_v_switch); + PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v_switch); + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_6gevent_8__waiter_sys, __pyx_n_s_exc_info); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 121, __pyx_L7_except_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_13 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) { + __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_12); + if (likely(__pyx_t_13)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12); + __Pyx_INCREF(__pyx_t_13); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_12, function); + } + } + __pyx_t_11 = (__pyx_t_13) ? __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_13) : __Pyx_PyObject_CallNoArg(__pyx_t_12); + __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; + if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 121, __pyx_L7_except_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_12 = __Pyx_PySequence_Tuple(__pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 121, __pyx_L7_except_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_11 = PyNumber_Add(__pyx_t_10, __pyx_t_12); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 121, __pyx_L7_except_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_11, NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 121, __pyx_L7_except_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + goto __pyx_L6_exception_handled; + } + __pyx_L7_except_error:; + + /* "src/gevent/_waiter.py":118 + * raise AssertionError("Can only use Waiter.switch method from the Hub greenlet") + * switch = greenlet.switch + * try: # <<<<<<<<<<<<<< + * switch(value) + * except: # pylint:disable=bare-except + */ + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6); + goto __pyx_L1_error; + __pyx_L6_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6); + __pyx_L10_try_end:; + } + } + __pyx_L3:; + + /* "src/gevent/_waiter.py":102 + * return self._exception + * + * def switch(self, value): # <<<<<<<<<<<<<< + * """ + * Switch to the greenlet if one's available. Otherwise store the + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_XDECREF(__pyx_t_13); + __Pyx_AddTraceback("gevent.__waiter.Waiter.switch", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_greenlet); + __Pyx_XDECREF(__pyx_v_switch); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_waiter.py":123 + * self.hub.handle_error(switch, *sys.exc_info()) + * + * def switch_args(self, *args): # <<<<<<<<<<<<<< + * return self.switch(args) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_8__waiter_6Waiter_13switch_args(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6gevent_8__waiter_6Waiter_12switch_args[] = "Waiter.switch_args(self, *args)"; +static PyMethodDef __pyx_mdef_6gevent_8__waiter_6Waiter_13switch_args = {"switch_args", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_8__waiter_6Waiter_13switch_args, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_8__waiter_6Waiter_12switch_args}; +static PyObject *__pyx_pw_6gevent_8__waiter_6Waiter_13switch_args(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_args = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("switch_args (wrapper)", 0); + if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "switch_args", 0))) return NULL; + __Pyx_INCREF(__pyx_args); + __pyx_v_args = __pyx_args; + __pyx_r = __pyx_pf_6gevent_8__waiter_6Waiter_12switch_args(((struct __pyx_obj_6gevent_8__waiter_Waiter *)__pyx_v_self), __pyx_v_args); + + /* function exit code */ + __Pyx_XDECREF(__pyx_v_args); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_8__waiter_6Waiter_12switch_args(struct __pyx_obj_6gevent_8__waiter_Waiter *__pyx_v_self, PyObject *__pyx_v_args) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("switch_args", 0); + + /* "src/gevent/_waiter.py":124 + * + * def switch_args(self, *args): + * return self.switch(args) # <<<<<<<<<<<<<< + * + * def throw(self, *throw_args): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_switch); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 124, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_args) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_args); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 124, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "src/gevent/_waiter.py":123 + * self.hub.handle_error(switch, *sys.exc_info()) + * + * def switch_args(self, *args): # <<<<<<<<<<<<<< + * return self.switch(args) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("gevent.__waiter.Waiter.switch_args", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_waiter.py":126 + * return self.switch(args) + * + * def throw(self, *throw_args): # <<<<<<<<<<<<<< + * """Switch to the greenlet with the exception. If there's no greenlet, store the exception.""" + * greenlet = self.greenlet + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_8__waiter_6Waiter_15throw(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6gevent_8__waiter_6Waiter_14throw[] = "Waiter.throw(self, *throw_args)\nSwitch to the greenlet with the exception. If there's no greenlet, store the exception."; +static PyMethodDef __pyx_mdef_6gevent_8__waiter_6Waiter_15throw = {"throw", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_8__waiter_6Waiter_15throw, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_8__waiter_6Waiter_14throw}; +static PyObject *__pyx_pw_6gevent_8__waiter_6Waiter_15throw(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_throw_args = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("throw (wrapper)", 0); + if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "throw", 0))) return NULL; + __Pyx_INCREF(__pyx_args); + __pyx_v_throw_args = __pyx_args; + __pyx_r = __pyx_pf_6gevent_8__waiter_6Waiter_14throw(((struct __pyx_obj_6gevent_8__waiter_Waiter *)__pyx_v_self), __pyx_v_throw_args); + + /* function exit code */ + __Pyx_XDECREF(__pyx_v_throw_args); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_8__waiter_6Waiter_14throw(struct __pyx_obj_6gevent_8__waiter_Waiter *__pyx_v_self, PyObject *__pyx_v_throw_args) { + PyGreenlet *__pyx_v_greenlet = NULL; + PyObject *__pyx_v_throw = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + __Pyx_RefNannySetupContext("throw", 0); + + /* "src/gevent/_waiter.py":128 + * def throw(self, *throw_args): + * """Switch to the greenlet with the exception. If there's no greenlet, store the exception.""" + * greenlet = self.greenlet # <<<<<<<<<<<<<< + * if greenlet is None: + * self._exception = throw_args + */ + __pyx_t_1 = ((PyObject *)__pyx_v_self->greenlet); + __Pyx_INCREF(__pyx_t_1); + __pyx_v_greenlet = ((PyGreenlet *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "src/gevent/_waiter.py":129 + * """Switch to the greenlet with the exception. If there's no greenlet, store the exception.""" + * greenlet = self.greenlet + * if greenlet is None: # <<<<<<<<<<<<<< + * self._exception = throw_args + * else: + */ + __pyx_t_2 = (((PyObject *)__pyx_v_greenlet) == Py_None); + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "src/gevent/_waiter.py":130 + * greenlet = self.greenlet + * if greenlet is None: + * self._exception = throw_args # <<<<<<<<<<<<<< + * else: + * if getcurrent() is not self.hub: # pylint:disable=undefined-variable + */ + __Pyx_INCREF(__pyx_v_throw_args); + __Pyx_GIVEREF(__pyx_v_throw_args); + __Pyx_GOTREF(__pyx_v_self->_exception); + __Pyx_DECREF(__pyx_v_self->_exception); + __pyx_v_self->_exception = __pyx_v_throw_args; + + /* "src/gevent/_waiter.py":129 + * """Switch to the greenlet with the exception. If there's no greenlet, store the exception.""" + * greenlet = self.greenlet + * if greenlet is None: # <<<<<<<<<<<<<< + * self._exception = throw_args + * else: + */ + goto __pyx_L3; + } + + /* "src/gevent/_waiter.py":132 + * self._exception = throw_args + * else: + * if getcurrent() is not self.hub: # pylint:disable=undefined-variable # <<<<<<<<<<<<<< + * raise AssertionError("Can only use Waiter.switch method from the Hub greenlet") + * throw = greenlet.throw + */ + /*else*/ { + __pyx_t_1 = ((PyObject *)__pyx_f_6gevent_8__waiter_getcurrent()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 132, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = (__pyx_t_1 != ((PyObject *)__pyx_v_self->hub)); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_2 = (__pyx_t_3 != 0); + if (unlikely(__pyx_t_2)) { + + /* "src/gevent/_waiter.py":133 + * else: + * if getcurrent() is not self.hub: # pylint:disable=undefined-variable + * raise AssertionError("Can only use Waiter.switch method from the Hub greenlet") # <<<<<<<<<<<<<< + * throw = greenlet.throw + * try: + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_AssertionError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 133, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 133, __pyx_L1_error) + + /* "src/gevent/_waiter.py":132 + * self._exception = throw_args + * else: + * if getcurrent() is not self.hub: # pylint:disable=undefined-variable # <<<<<<<<<<<<<< + * raise AssertionError("Can only use Waiter.switch method from the Hub greenlet") + * throw = greenlet.throw + */ + } + + /* "src/gevent/_waiter.py":134 + * if getcurrent() is not self.hub: # pylint:disable=undefined-variable + * raise AssertionError("Can only use Waiter.switch method from the Hub greenlet") + * throw = greenlet.throw # <<<<<<<<<<<<<< + * try: + * throw(*throw_args) + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_greenlet), __pyx_n_s_throw); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 134, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_throw = __pyx_t_1; + __pyx_t_1 = 0; + + /* "src/gevent/_waiter.py":135 + * raise AssertionError("Can only use Waiter.switch method from the Hub greenlet") + * throw = greenlet.throw + * try: # <<<<<<<<<<<<<< + * throw(*throw_args) + * except: # pylint:disable=bare-except + */ + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6); + __Pyx_XGOTREF(__pyx_t_4); + __Pyx_XGOTREF(__pyx_t_5); + __Pyx_XGOTREF(__pyx_t_6); + /*try:*/ { + + /* "src/gevent/_waiter.py":136 + * throw = greenlet.throw + * try: + * throw(*throw_args) # <<<<<<<<<<<<<< + * except: # pylint:disable=bare-except + * self.hub.handle_error(throw, *sys.exc_info()) + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_throw, __pyx_v_throw_args, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 136, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_waiter.py":135 + * raise AssertionError("Can only use Waiter.switch method from the Hub greenlet") + * throw = greenlet.throw + * try: # <<<<<<<<<<<<<< + * throw(*throw_args) + * except: # pylint:disable=bare-except + */ + } + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L10_try_end; + __pyx_L5_error:; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_waiter.py":137 + * try: + * throw(*throw_args) + * except: # pylint:disable=bare-except # <<<<<<<<<<<<<< + * self.hub.handle_error(throw, *sys.exc_info()) + * + */ + /*except:*/ { + __Pyx_AddTraceback("gevent.__waiter.Waiter.throw", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(0, 137, __pyx_L7_except_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GOTREF(__pyx_t_8); + + /* "src/gevent/_waiter.py":138 + * throw(*throw_args) + * except: # pylint:disable=bare-except + * self.hub.handle_error(throw, *sys.exc_info()) # <<<<<<<<<<<<<< + * + * def get(self): + */ + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->hub), __pyx_n_s_handle_error); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 138, __pyx_L7_except_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 138, __pyx_L7_except_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_INCREF(__pyx_v_throw); + __Pyx_GIVEREF(__pyx_v_throw); + PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v_throw); + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_6gevent_8__waiter_sys, __pyx_n_s_exc_info); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 138, __pyx_L7_except_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_13 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) { + __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_12); + if (likely(__pyx_t_13)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12); + __Pyx_INCREF(__pyx_t_13); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_12, function); + } + } + __pyx_t_11 = (__pyx_t_13) ? __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_13) : __Pyx_PyObject_CallNoArg(__pyx_t_12); + __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; + if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 138, __pyx_L7_except_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_12 = __Pyx_PySequence_Tuple(__pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 138, __pyx_L7_except_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_11 = PyNumber_Add(__pyx_t_10, __pyx_t_12); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 138, __pyx_L7_except_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_11, NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 138, __pyx_L7_except_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + goto __pyx_L6_exception_handled; + } + __pyx_L7_except_error:; + + /* "src/gevent/_waiter.py":135 + * raise AssertionError("Can only use Waiter.switch method from the Hub greenlet") + * throw = greenlet.throw + * try: # <<<<<<<<<<<<<< + * throw(*throw_args) + * except: # pylint:disable=bare-except + */ + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6); + goto __pyx_L1_error; + __pyx_L6_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6); + __pyx_L10_try_end:; + } + } + __pyx_L3:; + + /* "src/gevent/_waiter.py":126 + * return self.switch(args) + * + * def throw(self, *throw_args): # <<<<<<<<<<<<<< + * """Switch to the greenlet with the exception. If there's no greenlet, store the exception.""" + * greenlet = self.greenlet + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_XDECREF(__pyx_t_13); + __Pyx_AddTraceback("gevent.__waiter.Waiter.throw", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_greenlet); + __Pyx_XDECREF(__pyx_v_throw); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_waiter.py":140 + * self.hub.handle_error(throw, *sys.exc_info()) + * + * def get(self): # <<<<<<<<<<<<<< + * """If a value/an exception is stored, return/raise it. Otherwise until switch() or throw() is called.""" + * if self._exception is not _NONE: + */ + +static PyObject *__pyx_pw_6gevent_8__waiter_6Waiter_17get(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_f_6gevent_8__waiter_6Waiter_get(struct __pyx_obj_6gevent_8__waiter_Waiter *__pyx_v_self, int __pyx_skip_dispatch) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + int __pyx_t_6; + int __pyx_t_7; + int __pyx_t_8; + char const *__pyx_t_9; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + PyObject *__pyx_t_14 = NULL; + PyObject *__pyx_t_15 = NULL; + __Pyx_RefNannySetupContext("get", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0; + if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self)))))); + else { + PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + #endif + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 140, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_8__waiter_6Waiter_17get)) { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 140, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0; + if (unlikely(type_dict_guard != tp_dict_version)) { + tp_dict_version = obj_dict_version = 0; + } + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + } + #endif + } + + /* "src/gevent/_waiter.py":142 + * def get(self): + * """If a value/an exception is stored, return/raise it. Otherwise until switch() or throw() is called.""" + * if self._exception is not _NONE: # <<<<<<<<<<<<<< + * if self._exception is None: + * return self.value + */ + __pyx_t_5 = (__pyx_v_self->_exception != __pyx_v_6gevent_8__waiter__NONE); + __pyx_t_6 = (__pyx_t_5 != 0); + if (__pyx_t_6) { + + /* "src/gevent/_waiter.py":143 + * """If a value/an exception is stored, return/raise it. Otherwise until switch() or throw() is called.""" + * if self._exception is not _NONE: + * if self._exception is None: # <<<<<<<<<<<<<< + * return self.value + * getcurrent().throw(*self._exception) # pylint:disable=undefined-variable + */ + __pyx_t_6 = (__pyx_v_self->_exception == Py_None); + __pyx_t_5 = (__pyx_t_6 != 0); + if (__pyx_t_5) { + + /* "src/gevent/_waiter.py":144 + * if self._exception is not _NONE: + * if self._exception is None: + * return self.value # <<<<<<<<<<<<<< + * getcurrent().throw(*self._exception) # pylint:disable=undefined-variable + * else: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->value); + __pyx_r = __pyx_v_self->value; + goto __pyx_L0; + + /* "src/gevent/_waiter.py":143 + * """If a value/an exception is stored, return/raise it. Otherwise until switch() or throw() is called.""" + * if self._exception is not _NONE: + * if self._exception is None: # <<<<<<<<<<<<<< + * return self.value + * getcurrent().throw(*self._exception) # pylint:disable=undefined-variable + */ + } + + /* "src/gevent/_waiter.py":145 + * if self._exception is None: + * return self.value + * getcurrent().throw(*self._exception) # pylint:disable=undefined-variable # <<<<<<<<<<<<<< + * else: + * if self.greenlet is not None: + */ + __pyx_t_1 = ((PyObject *)__pyx_f_6gevent_8__waiter_getcurrent()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 145, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_throw); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 145, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PySequence_Tuple(__pyx_v_self->_exception); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 145, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 145, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "src/gevent/_waiter.py":142 + * def get(self): + * """If a value/an exception is stored, return/raise it. Otherwise until switch() or throw() is called.""" + * if self._exception is not _NONE: # <<<<<<<<<<<<<< + * if self._exception is None: + * return self.value + */ + goto __pyx_L3; + } + + /* "src/gevent/_waiter.py":147 + * getcurrent().throw(*self._exception) # pylint:disable=undefined-variable + * else: + * if self.greenlet is not None: # <<<<<<<<<<<<<< + * raise ConcurrentObjectUseError('This Waiter is already used by %r' % (self.greenlet, )) + * self.greenlet = getcurrent() # pylint:disable=undefined-variable + */ + /*else*/ { + __pyx_t_5 = (((PyObject *)__pyx_v_self->greenlet) != Py_None); + __pyx_t_6 = (__pyx_t_5 != 0); + if (unlikely(__pyx_t_6)) { + + /* "src/gevent/_waiter.py":148 + * else: + * if self.greenlet is not None: + * raise ConcurrentObjectUseError('This Waiter is already used by %r' % (self.greenlet, )) # <<<<<<<<<<<<<< + * self.greenlet = getcurrent() # pylint:disable=undefined-variable + * try: + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 148, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_self->greenlet)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self->greenlet)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self->greenlet)); + __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_This_Waiter_is_already_used_by_r, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 148, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_INCREF(__pyx_v_6gevent_8__waiter_ConcurrentObjectUseError); + __pyx_t_1 = __pyx_v_6gevent_8__waiter_ConcurrentObjectUseError; __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_1, function); + } + } + __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_4, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_2); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 148, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(0, 148, __pyx_L1_error) + + /* "src/gevent/_waiter.py":147 + * getcurrent().throw(*self._exception) # pylint:disable=undefined-variable + * else: + * if self.greenlet is not None: # <<<<<<<<<<<<<< + * raise ConcurrentObjectUseError('This Waiter is already used by %r' % (self.greenlet, )) + * self.greenlet = getcurrent() # pylint:disable=undefined-variable + */ + } + + /* "src/gevent/_waiter.py":149 + * if self.greenlet is not None: + * raise ConcurrentObjectUseError('This Waiter is already used by %r' % (self.greenlet, )) + * self.greenlet = getcurrent() # pylint:disable=undefined-variable # <<<<<<<<<<<<<< + * try: + * return self.hub.switch() + */ + __pyx_t_3 = ((PyObject *)__pyx_f_6gevent_8__waiter_getcurrent()); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 149, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __Pyx_GOTREF(__pyx_v_self->greenlet); + __Pyx_DECREF(((PyObject *)__pyx_v_self->greenlet)); + __pyx_v_self->greenlet = ((PyGreenlet *)__pyx_t_3); + __pyx_t_3 = 0; + + /* "src/gevent/_waiter.py":150 + * raise ConcurrentObjectUseError('This Waiter is already used by %r' % (self.greenlet, )) + * self.greenlet = getcurrent() # pylint:disable=undefined-variable + * try: # <<<<<<<<<<<<<< + * return self.hub.switch() + * finally: + */ + /*try:*/ { + + /* "src/gevent/_waiter.py":151 + * self.greenlet = getcurrent() # pylint:disable=undefined-variable + * try: + * return self.hub.switch() # <<<<<<<<<<<<<< + * finally: + * self.greenlet = None + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = ((struct __pyx_vtabstruct_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *)__pyx_v_self->hub->__pyx_vtab)->__pyx_switch(__pyx_v_self->hub, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 151, __pyx_L7_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L6_return; + } + + /* "src/gevent/_waiter.py":153 + * return self.hub.switch() + * finally: + * self.greenlet = None # <<<<<<<<<<<<<< + * + * def __call__(self, source): + */ + /*finally:*/ { + __pyx_L7_error:; + /*exception exit:*/{ + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15); + if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12) < 0)) __Pyx_ErrFetch(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12); + __Pyx_XGOTREF(__pyx_t_10); + __Pyx_XGOTREF(__pyx_t_11); + __Pyx_XGOTREF(__pyx_t_12); + __Pyx_XGOTREF(__pyx_t_13); + __Pyx_XGOTREF(__pyx_t_14); + __Pyx_XGOTREF(__pyx_t_15); + __pyx_t_7 = __pyx_lineno; __pyx_t_8 = __pyx_clineno; __pyx_t_9 = __pyx_filename; + { + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->greenlet); + __Pyx_DECREF(((PyObject *)__pyx_v_self->greenlet)); + __pyx_v_self->greenlet = ((PyGreenlet *)Py_None); + } + if (PY_MAJOR_VERSION >= 3) { + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_XGIVEREF(__pyx_t_15); + __Pyx_ExceptionReset(__pyx_t_13, __pyx_t_14, __pyx_t_15); + } + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_XGIVEREF(__pyx_t_12); + __Pyx_ErrRestore(__pyx_t_10, __pyx_t_11, __pyx_t_12); + __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; + __pyx_lineno = __pyx_t_7; __pyx_clineno = __pyx_t_8; __pyx_filename = __pyx_t_9; + goto __pyx_L1_error; + } + __pyx_L6_return: { + __pyx_t_15 = __pyx_r; + __pyx_r = 0; + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->greenlet); + __Pyx_DECREF(((PyObject *)__pyx_v_self->greenlet)); + __pyx_v_self->greenlet = ((PyGreenlet *)Py_None); + __pyx_r = __pyx_t_15; + __pyx_t_15 = 0; + goto __pyx_L0; + } + } + } + __pyx_L3:; + + /* "src/gevent/_waiter.py":140 + * self.hub.handle_error(throw, *sys.exc_info()) + * + * def get(self): # <<<<<<<<<<<<<< + * """If a value/an exception is stored, return/raise it. Otherwise until switch() or throw() is called.""" + * if self._exception is not _NONE: + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("gevent.__waiter.Waiter.get", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_8__waiter_6Waiter_17get(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6gevent_8__waiter_6Waiter_16get[] = "Waiter.get(self)\nIf a value/an exception is stored, return/raise it. Otherwise until switch() or throw() is called."; +static PyMethodDef __pyx_mdef_6gevent_8__waiter_6Waiter_17get = {"get", (PyCFunction)__pyx_pw_6gevent_8__waiter_6Waiter_17get, METH_NOARGS, __pyx_doc_6gevent_8__waiter_6Waiter_16get}; +static PyObject *__pyx_pw_6gevent_8__waiter_6Waiter_17get(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_8__waiter_6Waiter_16get(((struct __pyx_obj_6gevent_8__waiter_Waiter *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_8__waiter_6Waiter_16get(struct __pyx_obj_6gevent_8__waiter_Waiter *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("get", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6gevent_8__waiter_6Waiter_get(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 140, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__waiter.Waiter.get", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_waiter.py":155 + * self.greenlet = None + * + * def __call__(self, source): # <<<<<<<<<<<<<< + * if source.exception is None: + * self.switch(source.value) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_8__waiter_6Waiter_19__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6gevent_8__waiter_6Waiter_19__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_source = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__call__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_source,0}; + PyObject* values[1] = {0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_source)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__call__") < 0)) __PYX_ERR(0, 155, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + } + __pyx_v_source = values[0]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__call__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 155, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.__waiter.Waiter.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_8__waiter_6Waiter_18__call__(((struct __pyx_obj_6gevent_8__waiter_Waiter *)__pyx_v_self), __pyx_v_source); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_8__waiter_6Waiter_18__call__(struct __pyx_obj_6gevent_8__waiter_Waiter *__pyx_v_self, PyObject *__pyx_v_source) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + __Pyx_RefNannySetupContext("__call__", 0); + + /* "src/gevent/_waiter.py":156 + * + * def __call__(self, source): + * if source.exception is None: # <<<<<<<<<<<<<< + * self.switch(source.value) + * else: + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_source, __pyx_n_s_exception); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 156, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = (__pyx_t_1 == Py_None); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "src/gevent/_waiter.py":157 + * def __call__(self, source): + * if source.exception is None: + * self.switch(source.value) # <<<<<<<<<<<<<< + * else: + * self.throw(source.exception) + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_switch); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 157, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_source, __pyx_n_s_value); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 157, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_6)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + } + } + __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_6, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 157, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_waiter.py":156 + * + * def __call__(self, source): + * if source.exception is None: # <<<<<<<<<<<<<< + * self.switch(source.value) + * else: + */ + goto __pyx_L3; + } + + /* "src/gevent/_waiter.py":159 + * self.switch(source.value) + * else: + * self.throw(source.exception) # <<<<<<<<<<<<<< + * + * # can also have a debugging version, that wraps the value in a tuple (self, value) in switch() + */ + /*else*/ { + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_throw); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 159, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_source, __pyx_n_s_exception); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 159, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_6)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + } + } + __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_6, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 159, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + __pyx_L3:; + + /* "src/gevent/_waiter.py":155 + * self.greenlet = None + * + * def __call__(self, source): # <<<<<<<<<<<<<< + * if source.exception is None: + * self.switch(source.value) + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("gevent.__waiter.Waiter.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/__waiter.pxd":34 + * + * cdef class Waiter: + * cdef readonly SwitchOutGreenletWithLoop hub # <<<<<<<<<<<<<< + * cdef readonly greenlet greenlet + * cdef readonly value + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_8__waiter_6Waiter_3hub_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_8__waiter_6Waiter_3hub_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_8__waiter_6Waiter_3hub___get__(((struct __pyx_obj_6gevent_8__waiter_Waiter *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_8__waiter_6Waiter_3hub___get__(struct __pyx_obj_6gevent_8__waiter_Waiter *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_self->hub)); + __pyx_r = ((PyObject *)__pyx_v_self->hub); + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/__waiter.pxd":35 + * cdef class Waiter: + * cdef readonly SwitchOutGreenletWithLoop hub + * cdef readonly greenlet greenlet # <<<<<<<<<<<<<< + * cdef readonly value + * cdef _exception + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_8__waiter_6Waiter_8greenlet_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_8__waiter_6Waiter_8greenlet_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_8__waiter_6Waiter_8greenlet___get__(((struct __pyx_obj_6gevent_8__waiter_Waiter *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_8__waiter_6Waiter_8greenlet___get__(struct __pyx_obj_6gevent_8__waiter_Waiter *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_self->greenlet)); + __pyx_r = ((PyObject *)__pyx_v_self->greenlet); + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/__waiter.pxd":36 + * cdef readonly SwitchOutGreenletWithLoop hub + * cdef readonly greenlet greenlet + * cdef readonly value # <<<<<<<<<<<<<< + * cdef _exception + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_8__waiter_6Waiter_5value_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_8__waiter_6Waiter_5value_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_8__waiter_6Waiter_5value___get__(((struct __pyx_obj_6gevent_8__waiter_Waiter *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_8__waiter_6Waiter_5value___get__(struct __pyx_obj_6gevent_8__waiter_Waiter *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->value); + __pyx_r = __pyx_v_self->value; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_waiter.py":177 + * __slots__ = ['_values'] + * + * def __init__(self, hub=None): # <<<<<<<<<<<<<< + * Waiter.__init__(self, hub) + * # we typically expect a relatively small number of these to be outstanding. + */ + +/* Python wrapper */ +static int __pyx_pw_6gevent_8__waiter_14MultipleWaiter_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6gevent_8__waiter_14MultipleWaiter_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_hub = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_hub,0}; + PyObject* values[1] = {0}; + values[0] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_hub); + if (value) { values[0] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 177, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_hub = values[0]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 177, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.__waiter.MultipleWaiter.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_8__waiter_14MultipleWaiter___init__(((struct __pyx_obj_6gevent_8__waiter_MultipleWaiter *)__pyx_v_self), __pyx_v_hub); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_8__waiter_14MultipleWaiter___init__(struct __pyx_obj_6gevent_8__waiter_MultipleWaiter *__pyx_v_self, PyObject *__pyx_v_hub) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "src/gevent/_waiter.py":178 + * + * def __init__(self, hub=None): + * Waiter.__init__(self, hub) # <<<<<<<<<<<<<< + * # we typically expect a relatively small number of these to be outstanding. + * # since we pop from the left, a deque might be slightly + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_6gevent_8__waiter_Waiter), __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 178, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + __pyx_t_4 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_4 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[3] = {__pyx_t_3, ((PyObject *)__pyx_v_self), __pyx_v_hub}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 178, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[3] = {__pyx_t_3, ((PyObject *)__pyx_v_self), __pyx_v_hub}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 178, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else + #endif + { + __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 178, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (__pyx_t_3) { + __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL; + } + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, ((PyObject *)__pyx_v_self)); + __Pyx_INCREF(__pyx_v_hub); + __Pyx_GIVEREF(__pyx_v_hub); + PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_hub); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 178, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_waiter.py":184 + * # we can help it to better support monkey-patching, and delaying the import + * # here can be impractical (see https://github.com/gevent/gevent/issues/652) + * self._values = list() # <<<<<<<<<<<<<< + * + * def switch(self, value): + */ + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 184, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_self->_values); + __Pyx_DECREF(__pyx_v_self->_values); + __pyx_v_self->_values = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "src/gevent/_waiter.py":177 + * __slots__ = ['_values'] + * + * def __init__(self, hub=None): # <<<<<<<<<<<<<< + * Waiter.__init__(self, hub) + * # we typically expect a relatively small number of these to be outstanding. + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("gevent.__waiter.MultipleWaiter.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_waiter.py":186 + * self._values = list() + * + * def switch(self, value): # <<<<<<<<<<<<<< + * self._values.append(value) + * Waiter.switch(self, True) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_8__waiter_14MultipleWaiter_3switch(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static char __pyx_doc_6gevent_8__waiter_14MultipleWaiter_2switch[] = "MultipleWaiter.switch(self, value)"; +static PyMethodDef __pyx_mdef_6gevent_8__waiter_14MultipleWaiter_3switch = {"switch", (PyCFunction)__pyx_pw_6gevent_8__waiter_14MultipleWaiter_3switch, METH_O, __pyx_doc_6gevent_8__waiter_14MultipleWaiter_2switch}; +static PyObject *__pyx_pw_6gevent_8__waiter_14MultipleWaiter_3switch(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("switch (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_8__waiter_14MultipleWaiter_2switch(((struct __pyx_obj_6gevent_8__waiter_MultipleWaiter *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_8__waiter_14MultipleWaiter_2switch(struct __pyx_obj_6gevent_8__waiter_MultipleWaiter *__pyx_v_self, PyObject *__pyx_v_value) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + __Pyx_RefNannySetupContext("switch", 0); + + /* "src/gevent/_waiter.py":187 + * + * def switch(self, value): + * self._values.append(value) # <<<<<<<<<<<<<< + * Waiter.switch(self, True) + * + */ + if (unlikely(__pyx_v_self->_values == Py_None)) { + PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "append"); + __PYX_ERR(0, 187, __pyx_L1_error) + } + __pyx_t_1 = __Pyx_PyList_Append(__pyx_v_self->_values, __pyx_v_value); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 187, __pyx_L1_error) + + /* "src/gevent/_waiter.py":188 + * def switch(self, value): + * self._values.append(value) + * Waiter.switch(self, True) # <<<<<<<<<<<<<< + * + * def get(self): + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_6gevent_8__waiter_Waiter), __pyx_n_s_switch); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 188, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = NULL; + __pyx_t_5 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_5 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_3)) { + PyObject *__pyx_temp[3] = {__pyx_t_4, ((PyObject *)__pyx_v_self), Py_True}; + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 188, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GOTREF(__pyx_t_2); + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { + PyObject *__pyx_temp[3] = {__pyx_t_4, ((PyObject *)__pyx_v_self), Py_True}; + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 188, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GOTREF(__pyx_t_2); + } else + #endif + { + __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 188, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (__pyx_t_4) { + __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL; + } + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, ((PyObject *)__pyx_v_self)); + __Pyx_INCREF(Py_True); + __Pyx_GIVEREF(Py_True); + PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, Py_True); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 188, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/_waiter.py":186 + * self._values = list() + * + * def switch(self, value): # <<<<<<<<<<<<<< + * self._values.append(value) + * Waiter.switch(self, True) + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("gevent.__waiter.MultipleWaiter.switch", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_waiter.py":190 + * Waiter.switch(self, True) + * + * def get(self): # <<<<<<<<<<<<<< + * if not self._values: + * Waiter.get(self) + */ + +static PyObject *__pyx_pw_6gevent_8__waiter_14MultipleWaiter_5get(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_f_6gevent_8__waiter_14MultipleWaiter_get(struct __pyx_obj_6gevent_8__waiter_MultipleWaiter *__pyx_v_self, CYTHON_UNUSED int __pyx_skip_dispatch) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("get", 0); + + /* "src/gevent/_waiter.py":191 + * + * def get(self): + * if not self._values: # <<<<<<<<<<<<<< + * Waiter.get(self) + * Waiter.clear(self) + */ + __pyx_t_1 = (__pyx_v_self->_values != Py_None)&&(PyList_GET_SIZE(__pyx_v_self->_values) != 0); + __pyx_t_2 = ((!__pyx_t_1) != 0); + if (__pyx_t_2) { + + /* "src/gevent/_waiter.py":192 + * def get(self): + * if not self._values: + * Waiter.get(self) # <<<<<<<<<<<<<< + * Waiter.clear(self) + * + */ + __pyx_t_3 = __pyx_f_6gevent_8__waiter_6Waiter_get(((struct __pyx_obj_6gevent_8__waiter_Waiter *)__pyx_v_self), 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 192, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "src/gevent/_waiter.py":193 + * if not self._values: + * Waiter.get(self) + * Waiter.clear(self) # <<<<<<<<<<<<<< + * + * return self._values.pop(0) + */ + __pyx_t_3 = __pyx_f_6gevent_8__waiter_6Waiter_clear(((struct __pyx_obj_6gevent_8__waiter_Waiter *)__pyx_v_self), 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 193, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "src/gevent/_waiter.py":191 + * + * def get(self): + * if not self._values: # <<<<<<<<<<<<<< + * Waiter.get(self) + * Waiter.clear(self) + */ + } + + /* "src/gevent/_waiter.py":195 + * Waiter.clear(self) + * + * return self._values.pop(0) # <<<<<<<<<<<<<< + * + * def _init(): + */ + __Pyx_XDECREF(__pyx_r); + if (unlikely(__pyx_v_self->_values == Py_None)) { + PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "pop"); + __PYX_ERR(0, 195, __pyx_L1_error) + } + __pyx_t_3 = __Pyx_PyList_PopIndex(__pyx_v_self->_values, __pyx_int_0, 0, 1, Py_ssize_t, PyInt_FromSsize_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 195, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "src/gevent/_waiter.py":190 + * Waiter.switch(self, True) + * + * def get(self): # <<<<<<<<<<<<<< + * if not self._values: + * Waiter.get(self) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("gevent.__waiter.MultipleWaiter.get", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_8__waiter_14MultipleWaiter_5get(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6gevent_8__waiter_14MultipleWaiter_4get[] = "MultipleWaiter.get(self)"; +static PyMethodDef __pyx_mdef_6gevent_8__waiter_14MultipleWaiter_5get = {"get", (PyCFunction)__pyx_pw_6gevent_8__waiter_14MultipleWaiter_5get, METH_NOARGS, __pyx_doc_6gevent_8__waiter_14MultipleWaiter_4get}; +static PyObject *__pyx_pw_6gevent_8__waiter_14MultipleWaiter_5get(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_8__waiter_14MultipleWaiter_4get(((struct __pyx_obj_6gevent_8__waiter_MultipleWaiter *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_8__waiter_14MultipleWaiter_4get(struct __pyx_obj_6gevent_8__waiter_MultipleWaiter *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("get", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6gevent_8__waiter_14MultipleWaiter_get(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 190, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__waiter.MultipleWaiter.get", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/_waiter.py":197 + * return self._values.pop(0) + * + * def _init(): # <<<<<<<<<<<<<< + * greenlet_init() # pylint:disable=undefined-variable + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_8__waiter_1_init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6gevent_8__waiter__init[] = "_init()"; +static PyMethodDef __pyx_mdef_6gevent_8__waiter_1_init = {"_init", (PyCFunction)__pyx_pw_6gevent_8__waiter_1_init, METH_NOARGS, __pyx_doc_6gevent_8__waiter__init}; +static PyObject *__pyx_pw_6gevent_8__waiter_1_init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_init (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_8__waiter__init(__pyx_self); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_8__waiter__init(CYTHON_UNUSED PyObject *__pyx_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_init", 0); + + /* "src/gevent/_waiter.py":198 + * + * def _init(): + * greenlet_init() # pylint:disable=undefined-variable # <<<<<<<<<<<<<< + * + * _init() + */ + __pyx_f_6gevent_8__waiter_greenlet_init(); + + /* "src/gevent/_waiter.py":197 + * return self._values.pop(0) + * + * def _init(): # <<<<<<<<<<<<<< + * greenlet_init() # pylint:disable=undefined-variable + * + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/__greenlet_primitives.pxd":23 + * + * @cython.final + * cdef inline greenlet getcurrent(): # <<<<<<<<<<<<<< + * return PyGreenlet_GetCurrent() + * + */ + +static CYTHON_INLINE PyGreenlet *__pyx_f_6gevent_21__greenlet_primitives_getcurrent(void) { + PyGreenlet *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("getcurrent", 0); + + /* "gevent/__greenlet_primitives.pxd":24 + * @cython.final + * cdef inline greenlet getcurrent(): + * return PyGreenlet_GetCurrent() # <<<<<<<<<<<<<< + * + * cdef bint _greenlet_imported + */ + __Pyx_XDECREF(((PyObject *)__pyx_r)); + __pyx_t_1 = ((PyObject *)PyGreenlet_GetCurrent()); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 24, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = ((PyGreenlet *)__pyx_t_1); + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "gevent/__greenlet_primitives.pxd":23 + * + * @cython.final + * cdef inline greenlet getcurrent(): # <<<<<<<<<<<<<< + * return PyGreenlet_GetCurrent() + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__greenlet_primitives.getcurrent", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF((PyObject *)__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/__greenlet_primitives.pxd":28 + * cdef bint _greenlet_imported + * + * cdef inline void greenlet_init(): # <<<<<<<<<<<<<< + * global _greenlet_imported + * if not _greenlet_imported: + */ + +static CYTHON_INLINE void __pyx_f_6gevent_21__greenlet_primitives_greenlet_init(void) { + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("greenlet_init", 0); + + /* "gevent/__greenlet_primitives.pxd":30 + * cdef inline void greenlet_init(): + * global _greenlet_imported + * if not _greenlet_imported: # <<<<<<<<<<<<<< + * PyGreenlet_Import() + * _greenlet_imported = True + */ + __pyx_t_1 = ((!(__pyx_v_6gevent_21__greenlet_primitives__greenlet_imported != 0)) != 0); + if (__pyx_t_1) { + + /* "gevent/__greenlet_primitives.pxd":31 + * global _greenlet_imported + * if not _greenlet_imported: + * PyGreenlet_Import() # <<<<<<<<<<<<<< + * _greenlet_imported = True + * + */ + PyGreenlet_Import(); + + /* "gevent/__greenlet_primitives.pxd":32 + * if not _greenlet_imported: + * PyGreenlet_Import() + * _greenlet_imported = True # <<<<<<<<<<<<<< + * + * cdef inline object _greenlet_switch(greenlet self): + */ + __pyx_v_6gevent_21__greenlet_primitives__greenlet_imported = 1; + + /* "gevent/__greenlet_primitives.pxd":30 + * cdef inline void greenlet_init(): + * global _greenlet_imported + * if not _greenlet_imported: # <<<<<<<<<<<<<< + * PyGreenlet_Import() + * _greenlet_imported = True + */ + } + + /* "gevent/__greenlet_primitives.pxd":28 + * cdef bint _greenlet_imported + * + * cdef inline void greenlet_init(): # <<<<<<<<<<<<<< + * global _greenlet_imported + * if not _greenlet_imported: + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "gevent/__greenlet_primitives.pxd":34 + * _greenlet_imported = True + * + * cdef inline object _greenlet_switch(greenlet self): # <<<<<<<<<<<<<< + * return PyGreenlet_Switch(self, NULL, NULL) + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_6gevent_21__greenlet_primitives__greenlet_switch(PyGreenlet *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("_greenlet_switch", 0); + + /* "gevent/__greenlet_primitives.pxd":35 + * + * cdef inline object _greenlet_switch(greenlet self): + * return PyGreenlet_Switch(self, NULL, NULL) # <<<<<<<<<<<<<< + * + * cdef class TrackedRawGreenlet(greenlet): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyGreenlet_Switch(__pyx_v_self, NULL, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 35, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "gevent/__greenlet_primitives.pxd":34 + * _greenlet_imported = True + * + * cdef inline object _greenlet_switch(greenlet self): # <<<<<<<<<<<<<< + * return PyGreenlet_Switch(self, NULL, NULL) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__greenlet_primitives._greenlet_switch", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/__waiter.pxd":24 + * void PyGreenlet_Import() + * + * cdef inline greenlet getcurrent(): # <<<<<<<<<<<<<< + * return PyGreenlet_GetCurrent() + * + */ + +static CYTHON_INLINE PyGreenlet *__pyx_f_6gevent_8__waiter_getcurrent(void) { + PyGreenlet *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("getcurrent", 0); + + /* "gevent/__waiter.pxd":25 + * + * cdef inline greenlet getcurrent(): + * return PyGreenlet_GetCurrent() # <<<<<<<<<<<<<< + * + * cdef inline void greenlet_init(): + */ + __Pyx_XDECREF(((PyObject *)__pyx_r)); + __pyx_t_1 = ((PyObject *)PyGreenlet_GetCurrent()); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 25, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = ((PyGreenlet *)__pyx_t_1); + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "gevent/__waiter.pxd":24 + * void PyGreenlet_Import() + * + * cdef inline greenlet getcurrent(): # <<<<<<<<<<<<<< + * return PyGreenlet_GetCurrent() + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__waiter.getcurrent", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF((PyObject *)__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/__waiter.pxd":27 + * return PyGreenlet_GetCurrent() + * + * cdef inline void greenlet_init(): # <<<<<<<<<<<<<< + * global _greenlet_imported + * if not _greenlet_imported: + */ + +static CYTHON_INLINE void __pyx_f_6gevent_8__waiter_greenlet_init(void) { + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("greenlet_init", 0); + + /* "gevent/__waiter.pxd":29 + * cdef inline void greenlet_init(): + * global _greenlet_imported + * if not _greenlet_imported: # <<<<<<<<<<<<<< + * PyGreenlet_Import() + * _greenlet_imported = True + */ + __pyx_t_1 = ((!(__pyx_v_6gevent_8__waiter__greenlet_imported != 0)) != 0); + if (__pyx_t_1) { + + /* "gevent/__waiter.pxd":30 + * global _greenlet_imported + * if not _greenlet_imported: + * PyGreenlet_Import() # <<<<<<<<<<<<<< + * _greenlet_imported = True + * + */ + PyGreenlet_Import(); + + /* "gevent/__waiter.pxd":31 + * if not _greenlet_imported: + * PyGreenlet_Import() + * _greenlet_imported = True # <<<<<<<<<<<<<< + * + * cdef class Waiter: + */ + __pyx_v_6gevent_8__waiter__greenlet_imported = 1; + + /* "gevent/__waiter.pxd":29 + * cdef inline void greenlet_init(): + * global _greenlet_imported + * if not _greenlet_imported: # <<<<<<<<<<<<<< + * PyGreenlet_Import() + * _greenlet_imported = True + */ + } + + /* "gevent/__waiter.pxd":27 + * return PyGreenlet_GetCurrent() + * + * cdef inline void greenlet_init(): # <<<<<<<<<<<<<< + * global _greenlet_imported + * if not _greenlet_imported: + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} +static struct __pyx_vtabstruct_6gevent_8__waiter_Waiter __pyx_vtable_6gevent_8__waiter_Waiter; + +static PyObject *__pyx_tp_new_6gevent_8__waiter_Waiter(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + struct __pyx_obj_6gevent_8__waiter_Waiter *p; + PyObject *o; + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_6gevent_8__waiter_Waiter *)o); + p->__pyx_vtab = __pyx_vtabptr_6gevent_8__waiter_Waiter; + p->hub = ((struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *)Py_None); Py_INCREF(Py_None); + p->greenlet = ((PyGreenlet *)Py_None); Py_INCREF(Py_None); + p->value = Py_None; Py_INCREF(Py_None); + p->_exception = Py_None; Py_INCREF(Py_None); + return o; +} + +static void __pyx_tp_dealloc_6gevent_8__waiter_Waiter(PyObject *o) { + struct __pyx_obj_6gevent_8__waiter_Waiter *p = (struct __pyx_obj_6gevent_8__waiter_Waiter *)o; + #if CYTHON_USE_TP_FINALIZE + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + PyObject_GC_UnTrack(o); + Py_CLEAR(p->hub); + Py_CLEAR(p->greenlet); + Py_CLEAR(p->value); + Py_CLEAR(p->_exception); + (*Py_TYPE(o)->tp_free)(o); +} + +static int __pyx_tp_traverse_6gevent_8__waiter_Waiter(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_6gevent_8__waiter_Waiter *p = (struct __pyx_obj_6gevent_8__waiter_Waiter *)o; + if (p->hub) { + e = (*v)(((PyObject *)p->hub), a); if (e) return e; + } + if (p->greenlet) { + e = (*v)(((PyObject *)p->greenlet), a); if (e) return e; + } + if (p->value) { + e = (*v)(p->value, a); if (e) return e; + } + if (p->_exception) { + e = (*v)(p->_exception, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_6gevent_8__waiter_Waiter(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_6gevent_8__waiter_Waiter *p = (struct __pyx_obj_6gevent_8__waiter_Waiter *)o; + tmp = ((PyObject*)p->hub); + p->hub = ((struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->greenlet); + p->greenlet = ((PyGreenlet *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->value); + p->value = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->_exception); + p->_exception = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyObject *__pyx_getprop_6gevent_8__waiter_6Waiter_exc_info(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_8__waiter_6Waiter_8exc_info_1__get__(o); +} + +static PyObject *__pyx_getprop_6gevent_8__waiter_6Waiter_hub(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_8__waiter_6Waiter_3hub_1__get__(o); +} + +static PyObject *__pyx_getprop_6gevent_8__waiter_6Waiter_greenlet(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_8__waiter_6Waiter_8greenlet_1__get__(o); +} + +static PyObject *__pyx_getprop_6gevent_8__waiter_6Waiter_value(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_8__waiter_6Waiter_5value_1__get__(o); +} + +static PyMethodDef __pyx_methods_6gevent_8__waiter_Waiter[] = { + {"ready", (PyCFunction)__pyx_pw_6gevent_8__waiter_6Waiter_7ready, METH_NOARGS, __pyx_doc_6gevent_8__waiter_6Waiter_6ready}, + {"successful", (PyCFunction)__pyx_pw_6gevent_8__waiter_6Waiter_9successful, METH_NOARGS, __pyx_doc_6gevent_8__waiter_6Waiter_8successful}, + {"switch", (PyCFunction)__pyx_pw_6gevent_8__waiter_6Waiter_11switch, METH_O, __pyx_doc_6gevent_8__waiter_6Waiter_10switch}, + {"switch_args", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_8__waiter_6Waiter_13switch_args, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_8__waiter_6Waiter_12switch_args}, + {"throw", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_8__waiter_6Waiter_15throw, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_8__waiter_6Waiter_14throw}, + {0, 0, 0, 0} +}; + +static struct PyGetSetDef __pyx_getsets_6gevent_8__waiter_Waiter[] = { + {(char *)"exc_info", __pyx_getprop_6gevent_8__waiter_6Waiter_exc_info, 0, (char *)"Holds the exception info passed to :meth:`throw` if :meth:`throw` was called. Otherwise ``None``.", 0}, + {(char *)"hub", __pyx_getprop_6gevent_8__waiter_6Waiter_hub, 0, (char *)0, 0}, + {(char *)"greenlet", __pyx_getprop_6gevent_8__waiter_6Waiter_greenlet, 0, (char *)0, 0}, + {(char *)"value", __pyx_getprop_6gevent_8__waiter_6Waiter_value, 0, (char *)0, 0}, + {0, 0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_6gevent_8__waiter_Waiter = { + PyVarObject_HEAD_INIT(0, 0) + "gevent.__waiter.Waiter", /*tp_name*/ + sizeof(struct __pyx_obj_6gevent_8__waiter_Waiter), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6gevent_8__waiter_Waiter, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + __pyx_pw_6gevent_8__waiter_6Waiter_19__call__, /*tp_call*/ + __pyx_pw_6gevent_8__waiter_6Waiter_5__str__, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + "Waiter(hub=None)\n\n A low level communication utility for greenlets.\n\n Waiter is a wrapper around greenlet's ``switch()`` and ``throw()`` calls that makes them somewhat safer:\n\n * switching will occur only if the waiting greenlet is executing :meth:`get` method currently;\n * any error raised in the greenlet is handled inside :meth:`switch` and :meth:`throw`\n * if :meth:`switch`/:meth:`throw` is called before the receiver calls :meth:`get`, then :class:`Waiter`\n will store the value/exception. The following :meth:`get` will return the value/raise the exception.\n\n The :meth:`switch` and :meth:`throw` methods must only be called from the :class:`Hub` greenlet.\n The :meth:`get` method must be called from a greenlet other than :class:`Hub`.\n\n >>> result = Waiter()\n >>> timer = get_hub().loop.timer(0.1)\n >>> timer.start(result.switch, 'hello from Waiter')\n >>> result.get() # blocks for 0.1 seconds\n 'hello from Waiter'\n >>> timer.close()\n\n If switch is called before the greenlet gets a chance to call :meth:`get` then\n :class:`Waiter` stores the value.\n\n >>> result = Waiter()\n >>> timer = get_hub().loop.timer(0.1)\n >>> timer.start(result.switch, 'hi from Waiter')\n >>> sleep(0.2)\n >>> result.get() # returns immediately without blocking\n 'hi from Waiter'\n >>> timer.close()\n\n .. warning::\n\n This a limited and dangerous way to communicate between\n greenlets. It can easily leave a greenlet unscheduled forever\n if used incorrectly. Consider using safer classes such as\n :class:`gevent.event.Event`, :class:`gevent.event.AsyncResult`,\n or :class:`gevent.queue.Queue`.\n ", /*tp_doc*/ + __pyx_tp_traverse_6gevent_8__waiter_Waiter, /*tp_traverse*/ + __pyx_tp_clear_6gevent_8__waiter_Waiter, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6gevent_8__waiter_Waiter, /*tp_methods*/ + 0, /*tp_members*/ + __pyx_getsets_6gevent_8__waiter_Waiter, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_pw_6gevent_8__waiter_6Waiter_1__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6gevent_8__waiter_Waiter, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; +static struct __pyx_vtabstruct_6gevent_8__waiter_MultipleWaiter __pyx_vtable_6gevent_8__waiter_MultipleWaiter; + +static PyObject *__pyx_tp_new_6gevent_8__waiter_MultipleWaiter(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_6gevent_8__waiter_MultipleWaiter *p; + PyObject *o = __pyx_tp_new_6gevent_8__waiter_Waiter(t, a, k); + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_6gevent_8__waiter_MultipleWaiter *)o); + p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_6gevent_8__waiter_Waiter*)__pyx_vtabptr_6gevent_8__waiter_MultipleWaiter; + p->_values = ((PyObject*)Py_None); Py_INCREF(Py_None); + return o; +} + +static void __pyx_tp_dealloc_6gevent_8__waiter_MultipleWaiter(PyObject *o) { + struct __pyx_obj_6gevent_8__waiter_MultipleWaiter *p = (struct __pyx_obj_6gevent_8__waiter_MultipleWaiter *)o; + PyObject_GC_UnTrack(o); + Py_CLEAR(p->_values); + PyObject_GC_Track(o); + __pyx_tp_dealloc_6gevent_8__waiter_Waiter(o); +} + +static int __pyx_tp_traverse_6gevent_8__waiter_MultipleWaiter(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_6gevent_8__waiter_MultipleWaiter *p = (struct __pyx_obj_6gevent_8__waiter_MultipleWaiter *)o; + e = __pyx_tp_traverse_6gevent_8__waiter_Waiter(o, v, a); if (e) return e; + if (p->_values) { + e = (*v)(p->_values, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_6gevent_8__waiter_MultipleWaiter(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_6gevent_8__waiter_MultipleWaiter *p = (struct __pyx_obj_6gevent_8__waiter_MultipleWaiter *)o; + __pyx_tp_clear_6gevent_8__waiter_Waiter(o); + tmp = ((PyObject*)p->_values); + p->_values = ((PyObject*)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyMethodDef __pyx_methods_6gevent_8__waiter_MultipleWaiter[] = { + {"switch", (PyCFunction)__pyx_pw_6gevent_8__waiter_14MultipleWaiter_3switch, METH_O, __pyx_doc_6gevent_8__waiter_14MultipleWaiter_2switch}, + {0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_6gevent_8__waiter_MultipleWaiter = { + PyVarObject_HEAD_INIT(0, 0) + "gevent.__waiter.MultipleWaiter", /*tp_name*/ + sizeof(struct __pyx_obj_6gevent_8__waiter_MultipleWaiter), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6gevent_8__waiter_MultipleWaiter, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_6gevent_8__waiter_6Waiter_19__call__, /*tp_call*/ + #else + 0, /*tp_call*/ + #endif + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_6gevent_8__waiter_6Waiter_5__str__, /*tp_str*/ + #else + 0, /*tp_str*/ + #endif + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + "MultipleWaiter(hub=None)\n\n An internal extension of Waiter that can be used if multiple objects\n must be waited on, and there is a chance that in between waits greenlets\n might be switched out. All greenlets that switch to this waiter\n will have their value returned.\n\n This does not handle exceptions or throw methods.\n ", /*tp_doc*/ + __pyx_tp_traverse_6gevent_8__waiter_MultipleWaiter, /*tp_traverse*/ + __pyx_tp_clear_6gevent_8__waiter_MultipleWaiter, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6gevent_8__waiter_MultipleWaiter, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_pw_6gevent_8__waiter_14MultipleWaiter_1__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6gevent_8__waiter_MultipleWaiter, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static PyMethodDef __pyx_methods[] = { + {0, 0, 0, 0} +}; + +#if PY_MAJOR_VERSION >= 3 +#if CYTHON_PEP489_MULTI_PHASE_INIT +static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ +static int __pyx_pymod_exec___waiter(PyObject* module); /*proto*/ +static PyModuleDef_Slot __pyx_moduledef_slots[] = { + {Py_mod_create, (void*)__pyx_pymod_create}, + {Py_mod_exec, (void*)__pyx_pymod_exec___waiter}, + {0, NULL} +}; +#endif + +static struct PyModuleDef __pyx_moduledef = { + PyModuleDef_HEAD_INIT, + "__waiter", + __pyx_k_Low_level_waiting_primitives, /* m_doc */ + #if CYTHON_PEP489_MULTI_PHASE_INIT + 0, /* m_size */ + #else + -1, /* m_size */ + #endif + __pyx_methods /* m_methods */, + #if CYTHON_PEP489_MULTI_PHASE_INIT + __pyx_moduledef_slots, /* m_slots */ + #else + NULL, /* m_reload */ + #endif + NULL, /* m_traverse */ + NULL, /* m_clear */ + NULL /* m_free */ +}; +#endif +#ifndef CYTHON_SMALL_CODE +#if defined(__clang__) + #define CYTHON_SMALL_CODE +#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) + #define CYTHON_SMALL_CODE __attribute__((cold)) +#else + #define CYTHON_SMALL_CODE +#endif +#endif + +static __Pyx_StringTabEntry __pyx_string_tab[] = { + {&__pyx_n_s_AssertionError, __pyx_k_AssertionError, sizeof(__pyx_k_AssertionError), 0, 0, 1, 1}, + {&__pyx_kp_s_Can_only_use_Waiter_switch_metho, __pyx_k_Can_only_use_Waiter_switch_metho, sizeof(__pyx_k_Can_only_use_Waiter_switch_metho), 0, 0, 1, 0}, + {&__pyx_n_s_ConcurrentObjectUseError, __pyx_k_ConcurrentObjectUseError, sizeof(__pyx_k_ConcurrentObjectUseError), 0, 0, 1, 1}, + {&__pyx_n_s_MultipleWaiter, __pyx_k_MultipleWaiter, sizeof(__pyx_k_MultipleWaiter), 0, 0, 1, 1}, + {&__pyx_n_s_MultipleWaiter_get, __pyx_k_MultipleWaiter_get, sizeof(__pyx_k_MultipleWaiter_get), 0, 0, 1, 1}, + {&__pyx_n_s_MultipleWaiter_switch, __pyx_k_MultipleWaiter_switch, sizeof(__pyx_k_MultipleWaiter_switch), 0, 0, 1, 1}, + {&__pyx_n_s_NONE, __pyx_k_NONE, sizeof(__pyx_k_NONE), 0, 0, 1, 1}, + {&__pyx_kp_s_This_Waiter_is_already_used_by_r, __pyx_k_This_Waiter_is_already_used_by_r, sizeof(__pyx_k_This_Waiter_is_already_used_by_r), 0, 0, 1, 0}, + {&__pyx_n_s_Waiter, __pyx_k_Waiter, sizeof(__pyx_k_Waiter), 0, 0, 1, 1}, + {&__pyx_n_s_Waiter_clear, __pyx_k_Waiter_clear, sizeof(__pyx_k_Waiter_clear), 0, 0, 1, 1}, + {&__pyx_n_s_Waiter_get, __pyx_k_Waiter_get, sizeof(__pyx_k_Waiter_get), 0, 0, 1, 1}, + {&__pyx_n_s_Waiter_ready, __pyx_k_Waiter_ready, sizeof(__pyx_k_Waiter_ready), 0, 0, 1, 1}, + {&__pyx_n_s_Waiter_successful, __pyx_k_Waiter_successful, sizeof(__pyx_k_Waiter_successful), 0, 0, 1, 1}, + {&__pyx_n_s_Waiter_switch, __pyx_k_Waiter_switch, sizeof(__pyx_k_Waiter_switch), 0, 0, 1, 1}, + {&__pyx_n_s_Waiter_switch_args, __pyx_k_Waiter_switch_args, sizeof(__pyx_k_Waiter_switch_args), 0, 0, 1, 1}, + {&__pyx_n_s_Waiter_throw, __pyx_k_Waiter_throw, sizeof(__pyx_k_Waiter_throw), 0, 0, 1, 1}, + {&__pyx_n_s_all, __pyx_k_all, sizeof(__pyx_k_all), 0, 0, 1, 1}, + {&__pyx_n_s_args, __pyx_k_args, sizeof(__pyx_k_args), 0, 0, 1, 1}, + {&__pyx_n_s_clear, __pyx_k_clear, sizeof(__pyx_k_clear), 0, 0, 1, 1}, + {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, + {&__pyx_n_s_exc_info, __pyx_k_exc_info, sizeof(__pyx_k_exc_info), 0, 0, 1, 1}, + {&__pyx_n_s_exception, __pyx_k_exception, sizeof(__pyx_k_exception), 0, 0, 1, 1}, + {&__pyx_n_s_exception_2, __pyx_k_exception_2, sizeof(__pyx_k_exception_2), 0, 0, 1, 1}, + {&__pyx_n_s_get, __pyx_k_get, sizeof(__pyx_k_get), 0, 0, 1, 1}, + {&__pyx_n_s_get_hub_noargs, __pyx_k_get_hub_noargs, sizeof(__pyx_k_get_hub_noargs), 0, 0, 1, 1}, + {&__pyx_n_s_getcurrent, __pyx_k_getcurrent, sizeof(__pyx_k_getcurrent), 0, 0, 1, 1}, + {&__pyx_n_s_gevent___waiter, __pyx_k_gevent___waiter, sizeof(__pyx_k_gevent___waiter), 0, 0, 1, 1}, + {&__pyx_n_s_gevent__hub_local, __pyx_k_gevent__hub_local, sizeof(__pyx_k_gevent__hub_local), 0, 0, 1, 1}, + {&__pyx_n_s_gevent__util, __pyx_k_gevent__util, sizeof(__pyx_k_gevent__util), 0, 0, 1, 1}, + {&__pyx_n_s_gevent_exceptions, __pyx_k_gevent_exceptions, sizeof(__pyx_k_gevent_exceptions), 0, 0, 1, 1}, + {&__pyx_n_s_greenlet, __pyx_k_greenlet, sizeof(__pyx_k_greenlet), 0, 0, 1, 1}, + {&__pyx_n_s_greenlet_imported, __pyx_k_greenlet_imported, sizeof(__pyx_k_greenlet_imported), 0, 0, 1, 1}, + {&__pyx_n_s_greenlet_init, __pyx_k_greenlet_init, sizeof(__pyx_k_greenlet_init), 0, 0, 1, 1}, + {&__pyx_n_s_handle_error, __pyx_k_handle_error, sizeof(__pyx_k_handle_error), 0, 0, 1, 1}, + {&__pyx_n_s_hub, __pyx_k_hub, sizeof(__pyx_k_hub), 0, 0, 1, 1}, + {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, + {&__pyx_n_s_import_c_accel, __pyx_k_import_c_accel, sizeof(__pyx_k_import_c_accel), 0, 0, 1, 1}, + {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1}, + {&__pyx_n_s_init_2, __pyx_k_init_2, sizeof(__pyx_k_init_2), 0, 0, 1, 1}, + {&__pyx_n_s_lambda, __pyx_k_lambda, sizeof(__pyx_k_lambda), 0, 0, 1, 1}, + {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, + {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, + {&__pyx_n_s_object, __pyx_k_object, sizeof(__pyx_k_object), 0, 0, 1, 1}, + {&__pyx_n_s_pop, __pyx_k_pop, sizeof(__pyx_k_pop), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_capi, __pyx_k_pyx_capi, sizeof(__pyx_k_pyx_capi), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1}, + {&__pyx_n_s_ready, __pyx_k_ready, sizeof(__pyx_k_ready), 0, 0, 1, 1}, + {&__pyx_kp_s_s_greenlet_s, __pyx_k_s_greenlet_s, sizeof(__pyx_k_s_greenlet_s), 0, 0, 1, 0}, + {&__pyx_kp_s_s_greenlet_s_exc_info_r, __pyx_k_s_greenlet_s_exc_info_r, sizeof(__pyx_k_s_greenlet_s_exc_info_r), 0, 0, 1, 0}, + {&__pyx_kp_s_s_greenlet_s_value_r, __pyx_k_s_greenlet_s_value_r, sizeof(__pyx_k_s_greenlet_s_value_r), 0, 0, 1, 0}, + {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1}, + {&__pyx_n_s_slots, __pyx_k_slots, sizeof(__pyx_k_slots), 0, 0, 1, 1}, + {&__pyx_n_s_source, __pyx_k_source, sizeof(__pyx_k_source), 0, 0, 1, 1}, + {&__pyx_kp_s_src_gevent__waiter_py, __pyx_k_src_gevent__waiter_py, sizeof(__pyx_k_src_gevent__waiter_py), 0, 0, 1, 0}, + {&__pyx_n_s_successful, __pyx_k_successful, sizeof(__pyx_k_successful), 0, 0, 1, 1}, + {&__pyx_n_s_switch, __pyx_k_switch, sizeof(__pyx_k_switch), 0, 0, 1, 1}, + {&__pyx_n_s_switch_args, __pyx_k_switch_args, sizeof(__pyx_k_switch_args), 0, 0, 1, 1}, + {&__pyx_n_s_sys, __pyx_k_sys, sizeof(__pyx_k_sys), 0, 0, 1, 1}, + {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, + {&__pyx_n_s_throw, __pyx_k_throw, sizeof(__pyx_k_throw), 0, 0, 1, 1}, + {&__pyx_n_s_throw_args, __pyx_k_throw_args, sizeof(__pyx_k_throw_args), 0, 0, 1, 1}, + {&__pyx_n_s_value, __pyx_k_value, sizeof(__pyx_k_value), 0, 0, 1, 1}, + {&__pyx_n_s_values, __pyx_k_values, sizeof(__pyx_k_values), 0, 0, 1, 1}, + {0, 0, 0, 0, 0, 0, 0} +}; +static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { + __pyx_builtin_object = __Pyx_GetBuiltinName(__pyx_n_s_object); if (!__pyx_builtin_object) __PYX_ERR(0, 21, __pyx_L1_error) + __pyx_builtin___import__ = __Pyx_GetBuiltinName(__pyx_n_s_import); if (!__pyx_builtin___import__) __PYX_ERR(0, 23, __pyx_L1_error) + __pyx_builtin_AssertionError = __Pyx_GetBuiltinName(__pyx_n_s_AssertionError); if (!__pyx_builtin_AssertionError) __PYX_ERR(0, 116, __pyx_L1_error) + return 0; + __pyx_L1_error:; + return -1; +} + +static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); + + /* "src/gevent/_waiter.py":116 + * else: + * if getcurrent() is not self.hub: # pylint:disable=undefined-variable + * raise AssertionError("Can only use Waiter.switch method from the Hub greenlet") # <<<<<<<<<<<<<< + * switch = greenlet.switch + * try: + */ + __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_Can_only_use_Waiter_switch_metho); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 116, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple_); + __Pyx_GIVEREF(__pyx_tuple_); + + /* "src/gevent/_waiter.py":23 + * _NONE = object() + * + * locals()['getcurrent'] = __import__('greenlet').getcurrent # <<<<<<<<<<<<<< + * locals()['greenlet_init'] = lambda: None + * + */ + __pyx_tuple__2 = PyTuple_Pack(1, __pyx_n_s_greenlet); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 23, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2); + __Pyx_GIVEREF(__pyx_tuple__2); + + /* "src/gevent/_waiter.py":76 + * self._exception = _NONE + * + * def clear(self): # <<<<<<<<<<<<<< + * self.greenlet = None + * self.value = None + */ + __pyx_tuple__3 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 76, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__3); + __Pyx_GIVEREF(__pyx_tuple__3); + __pyx_codeobj__4 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__3, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__waiter_py, __pyx_n_s_clear, 76, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__4)) __PYX_ERR(0, 76, __pyx_L1_error) + + /* "src/gevent/_waiter.py":88 + * return '<%s greenlet=%s exc_info=%r>' % (type(self).__name__, self.greenlet, self.exc_info) + * + * def ready(self): # <<<<<<<<<<<<<< + * """Return true if and only if it holds a value or an exception""" + * return self._exception is not _NONE + */ + __pyx_tuple__5 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 88, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__5); + __Pyx_GIVEREF(__pyx_tuple__5); + __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__5, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__waiter_py, __pyx_n_s_ready, 88, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__6)) __PYX_ERR(0, 88, __pyx_L1_error) + + /* "src/gevent/_waiter.py":92 + * return self._exception is not _NONE + * + * def successful(self): # <<<<<<<<<<<<<< + * """Return true if and only if it is ready and holds a value""" + * return self._exception is None + */ + __pyx_tuple__7 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 92, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__7); + __Pyx_GIVEREF(__pyx_tuple__7); + __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__waiter_py, __pyx_n_s_successful, 92, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) __PYX_ERR(0, 92, __pyx_L1_error) + + /* "src/gevent/_waiter.py":102 + * return self._exception + * + * def switch(self, value): # <<<<<<<<<<<<<< + * """ + * Switch to the greenlet if one's available. Otherwise store the + */ + __pyx_tuple__9 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_value, __pyx_n_s_greenlet, __pyx_n_s_switch); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 102, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__9); + __Pyx_GIVEREF(__pyx_tuple__9); + __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__9, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__waiter_py, __pyx_n_s_switch, 102, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__10)) __PYX_ERR(0, 102, __pyx_L1_error) + + /* "src/gevent/_waiter.py":123 + * self.hub.handle_error(switch, *sys.exc_info()) + * + * def switch_args(self, *args): # <<<<<<<<<<<<<< + * return self.switch(args) + * + */ + __pyx_tuple__11 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_args); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 123, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__11); + __Pyx_GIVEREF(__pyx_tuple__11); + __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__11, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__waiter_py, __pyx_n_s_switch_args, 123, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(0, 123, __pyx_L1_error) + + /* "src/gevent/_waiter.py":126 + * return self.switch(args) + * + * def throw(self, *throw_args): # <<<<<<<<<<<<<< + * """Switch to the greenlet with the exception. If there's no greenlet, store the exception.""" + * greenlet = self.greenlet + */ + __pyx_tuple__13 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_throw_args, __pyx_n_s_greenlet, __pyx_n_s_throw); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 126, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__13); + __Pyx_GIVEREF(__pyx_tuple__13); + __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__13, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__waiter_py, __pyx_n_s_throw, 126, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__14)) __PYX_ERR(0, 126, __pyx_L1_error) + + /* "src/gevent/_waiter.py":140 + * self.hub.handle_error(throw, *sys.exc_info()) + * + * def get(self): # <<<<<<<<<<<<<< + * """If a value/an exception is stored, return/raise it. Otherwise until switch() or throw() is called.""" + * if self._exception is not _NONE: + */ + __pyx_tuple__15 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(0, 140, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__15); + __Pyx_GIVEREF(__pyx_tuple__15); + __pyx_codeobj__16 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__15, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__waiter_py, __pyx_n_s_get, 140, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__16)) __PYX_ERR(0, 140, __pyx_L1_error) + + /* "src/gevent/_waiter.py":186 + * self._values = list() + * + * def switch(self, value): # <<<<<<<<<<<<<< + * self._values.append(value) + * Waiter.switch(self, True) + */ + __pyx_tuple__17 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_value); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(0, 186, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__17); + __Pyx_GIVEREF(__pyx_tuple__17); + __pyx_codeobj__18 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__17, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__waiter_py, __pyx_n_s_switch, 186, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__18)) __PYX_ERR(0, 186, __pyx_L1_error) + + /* "src/gevent/_waiter.py":190 + * Waiter.switch(self, True) + * + * def get(self): # <<<<<<<<<<<<<< + * if not self._values: + * Waiter.get(self) + */ + __pyx_tuple__19 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(0, 190, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__19); + __Pyx_GIVEREF(__pyx_tuple__19); + __pyx_codeobj__20 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__19, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__waiter_py, __pyx_n_s_get, 190, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__20)) __PYX_ERR(0, 190, __pyx_L1_error) + + /* "src/gevent/_waiter.py":197 + * return self._values.pop(0) + * + * def _init(): # <<<<<<<<<<<<<< + * greenlet_init() # pylint:disable=undefined-variable + * + */ + __pyx_codeobj__21 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__waiter_py, __pyx_n_s_init_2, 197, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__21)) __PYX_ERR(0, 197, __pyx_L1_error) + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} + +static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { + if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error) + return 0; + __pyx_L1_error:; + return -1; +} + +static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/ + +static int __Pyx_modinit_global_init_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); + /*--- Global init code ---*/ + __pyx_v_6gevent_8__waiter_sys = Py_None; Py_INCREF(Py_None); + __pyx_v_6gevent_8__waiter_ConcurrentObjectUseError = Py_None; Py_INCREF(Py_None); + __pyx_v_6gevent_8__waiter__NONE = Py_None; Py_INCREF(Py_None); + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_variable_export_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); + /*--- Variable export code ---*/ + if (__Pyx_ExportVoidPtr(__pyx_n_s_sys, (void *)&__pyx_v_6gevent_8__waiter_sys, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportVoidPtr(__pyx_n_s_ConcurrentObjectUseError, (void *)&__pyx_v_6gevent_8__waiter_ConcurrentObjectUseError, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportVoidPtr(__pyx_n_s_greenlet_imported, (void *)&__pyx_v_6gevent_8__waiter__greenlet_imported, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportVoidPtr(__pyx_n_s_NONE, (void *)&__pyx_v_6gevent_8__waiter__NONE, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_modinit_function_export_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); + /*--- Function export code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_type_init_code(void) { + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); + /*--- Type init code ---*/ + __pyx_t_1 = PyImport_ImportModule("greenlet"); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 15, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_ptype_6gevent_8__waiter_greenlet = __Pyx_ImportType(__pyx_t_1, "greenlet", "greenlet", sizeof(PyGreenlet), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_8__waiter_greenlet) __PYX_ERR(2, 15, __pyx_L1_error) + __pyx_vtabptr_6gevent_8__waiter_Waiter = &__pyx_vtable_6gevent_8__waiter_Waiter; + __pyx_vtable_6gevent_8__waiter_Waiter.get = (PyObject *(*)(struct __pyx_obj_6gevent_8__waiter_Waiter *, int __pyx_skip_dispatch))__pyx_f_6gevent_8__waiter_6Waiter_get; + __pyx_vtable_6gevent_8__waiter_Waiter.clear = (PyObject *(*)(struct __pyx_obj_6gevent_8__waiter_Waiter *, int __pyx_skip_dispatch))__pyx_f_6gevent_8__waiter_6Waiter_clear; + if (PyType_Ready(&__pyx_type_6gevent_8__waiter_Waiter) < 0) __PYX_ERR(0, 27, __pyx_L1_error) + __pyx_type_6gevent_8__waiter_Waiter.tp_print = 0; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6gevent_8__waiter_Waiter.tp_dictoffset && __pyx_type_6gevent_8__waiter_Waiter.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_type_6gevent_8__waiter_Waiter.tp_getattro = __Pyx_PyObject_GenericGetAttr; + } + if (__Pyx_SetVtable(__pyx_type_6gevent_8__waiter_Waiter.tp_dict, __pyx_vtabptr_6gevent_8__waiter_Waiter) < 0) __PYX_ERR(0, 27, __pyx_L1_error) + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Waiter, (PyObject *)&__pyx_type_6gevent_8__waiter_Waiter) < 0) __PYX_ERR(0, 27, __pyx_L1_error) + __pyx_ptype_6gevent_8__waiter_Waiter = &__pyx_type_6gevent_8__waiter_Waiter; + __pyx_vtabptr_6gevent_8__waiter_MultipleWaiter = &__pyx_vtable_6gevent_8__waiter_MultipleWaiter; + __pyx_vtable_6gevent_8__waiter_MultipleWaiter.__pyx_base = *__pyx_vtabptr_6gevent_8__waiter_Waiter; + __pyx_vtable_6gevent_8__waiter_MultipleWaiter.__pyx_base.get = (PyObject *(*)(struct __pyx_obj_6gevent_8__waiter_Waiter *, int __pyx_skip_dispatch))__pyx_f_6gevent_8__waiter_14MultipleWaiter_get; + __pyx_type_6gevent_8__waiter_MultipleWaiter.tp_base = __pyx_ptype_6gevent_8__waiter_Waiter; + if (PyType_Ready(&__pyx_type_6gevent_8__waiter_MultipleWaiter) < 0) __PYX_ERR(0, 166, __pyx_L1_error) + __pyx_type_6gevent_8__waiter_MultipleWaiter.tp_print = 0; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6gevent_8__waiter_MultipleWaiter.tp_dictoffset && __pyx_type_6gevent_8__waiter_MultipleWaiter.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_type_6gevent_8__waiter_MultipleWaiter.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + } + if (__Pyx_SetVtable(__pyx_type_6gevent_8__waiter_MultipleWaiter.tp_dict, __pyx_vtabptr_6gevent_8__waiter_MultipleWaiter) < 0) __PYX_ERR(0, 166, __pyx_L1_error) + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_MultipleWaiter, (PyObject *)&__pyx_type_6gevent_8__waiter_MultipleWaiter) < 0) __PYX_ERR(0, 166, __pyx_L1_error) + __pyx_ptype_6gevent_8__waiter_MultipleWaiter = &__pyx_type_6gevent_8__waiter_MultipleWaiter; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_modinit_type_import_code(void) { + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); + /*--- Type import code ---*/ + __pyx_t_1 = PyImport_ImportModule("greenlet"); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_ptype_6gevent_21__greenlet_primitives_greenlet = __Pyx_ImportType(__pyx_t_1, "greenlet", "greenlet", sizeof(PyGreenlet), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_21__greenlet_primitives_greenlet) __PYX_ERR(1, 12, __pyx_L1_error) + __pyx_t_2 = PyImport_ImportModule("gevent.__greenlet_primitives"); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 37, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_ptype_6gevent_21__greenlet_primitives_TrackedRawGreenlet = __Pyx_ImportType(__pyx_t_2, "gevent.__greenlet_primitives", "TrackedRawGreenlet", sizeof(struct __pyx_obj_6gevent_21__greenlet_primitives_TrackedRawGreenlet), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_21__greenlet_primitives_TrackedRawGreenlet) __PYX_ERR(1, 37, __pyx_L1_error) + __pyx_ptype_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop = __Pyx_ImportType(__pyx_t_2, "gevent.__greenlet_primitives", "SwitchOutGreenletWithLoop", sizeof(struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop) __PYX_ERR(1, 40, __pyx_L1_error) + __pyx_vtabptr_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop = (struct __pyx_vtabstruct_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop*)__Pyx_GetVtable(__pyx_ptype_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop->tp_dict); if (unlikely(!__pyx_vtabptr_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop)) __PYX_ERR(1, 40, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_modinit_variable_import_code(void) { + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); + /*--- Variable import code ---*/ + __pyx_t_1 = PyImport_ImportModule("gevent.__greenlet_primitives"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_1, "get_objects", (void **)&__pyx_vp_6gevent_21__greenlet_primitives_get_objects, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_1, "wref", (void **)&__pyx_vp_6gevent_21__greenlet_primitives_wref, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_1, "BlockingSwitchOutError", (void **)&__pyx_vp_6gevent_21__greenlet_primitives_BlockingSwitchOutError, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_1, "_greenlet_imported", (void **)&__pyx_vp_6gevent_21__greenlet_primitives__greenlet_imported, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + Py_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_2 = PyImport_ImportModule("gevent.__hub_local"); if (!__pyx_t_2) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_2, "_threadlocal", (void **)&__pyx_vp_6gevent_11__hub_local__threadlocal, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + Py_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_modinit_function_import_code(void) { + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); + /*--- Function import code ---*/ + __pyx_t_1 = PyImport_ImportModule("gevent.__hub_local"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportFunction(__pyx_t_1, "get_hub_noargs", (void (**)(void))&__pyx_f_6gevent_11__hub_local_get_hub_noargs, "struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *(int __pyx_skip_dispatch)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + Py_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_RefNannyFinishContext(); + return -1; +} + + +#if PY_MAJOR_VERSION < 3 +#ifdef CYTHON_NO_PYINIT_EXPORT +#define __Pyx_PyMODINIT_FUNC void +#else +#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC +#endif +#else +#ifdef CYTHON_NO_PYINIT_EXPORT +#define __Pyx_PyMODINIT_FUNC PyObject * +#else +#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC +#endif +#endif + + +#if PY_MAJOR_VERSION < 3 +__Pyx_PyMODINIT_FUNC init__waiter(void) CYTHON_SMALL_CODE; /*proto*/ +__Pyx_PyMODINIT_FUNC init__waiter(void) +#else +__Pyx_PyMODINIT_FUNC PyInit___waiter(void) CYTHON_SMALL_CODE; /*proto*/ +__Pyx_PyMODINIT_FUNC PyInit___waiter(void) +#if CYTHON_PEP489_MULTI_PHASE_INIT +{ + return PyModuleDef_Init(&__pyx_moduledef); +} +static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { + #if PY_VERSION_HEX >= 0x030700A1 + static PY_INT64_T main_interpreter_id = -1; + PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); + if (main_interpreter_id == -1) { + main_interpreter_id = current_id; + return (unlikely(current_id == -1)) ? -1 : 0; + } else if (unlikely(main_interpreter_id != current_id)) + #else + static PyInterpreterState *main_interpreter = NULL; + PyInterpreterState *current_interpreter = PyThreadState_Get()->interp; + if (!main_interpreter) { + main_interpreter = current_interpreter; + } else if (unlikely(main_interpreter != current_interpreter)) + #endif + { + PyErr_SetString( + PyExc_ImportError, + "Interpreter change detected - this module can only be loaded into one interpreter per process."); + return -1; + } + return 0; +} +static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) { + PyObject *value = PyObject_GetAttrString(spec, from_name); + int result = 0; + if (likely(value)) { + if (allow_none || value != Py_None) { + result = PyDict_SetItemString(moddict, to_name, value); + } + Py_DECREF(value); + } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_Clear(); + } else { + result = -1; + } + return result; +} +static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) { + PyObject *module = NULL, *moddict, *modname; + if (__Pyx_check_single_interpreter()) + return NULL; + if (__pyx_m) + return __Pyx_NewRef(__pyx_m); + modname = PyObject_GetAttrString(spec, "name"); + if (unlikely(!modname)) goto bad; + module = PyModule_NewObject(modname); + Py_DECREF(modname); + if (unlikely(!module)) goto bad; + moddict = PyModule_GetDict(module); + if (unlikely(!moddict)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad; + return module; +bad: + Py_XDECREF(module); + return NULL; +} + + +static CYTHON_SMALL_CODE int __pyx_pymod_exec___waiter(PyObject *__pyx_pyinit_module) +#endif +#endif +{ + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannyDeclarations + #if CYTHON_PEP489_MULTI_PHASE_INIT + if (__pyx_m) { + if (__pyx_m == __pyx_pyinit_module) return 0; + PyErr_SetString(PyExc_RuntimeError, "Module '__waiter' has already been imported. Re-initialisation is not supported."); + return -1; + } + #elif PY_MAJOR_VERSION >= 3 + if (__pyx_m) return __Pyx_NewRef(__pyx_m); + #endif + #if CYTHON_REFNANNY +__Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); +if (!__Pyx_RefNanny) { + PyErr_Clear(); + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); + if (!__Pyx_RefNanny) + Py_FatalError("failed to import 'refnanny' module"); +} +#endif + __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit___waiter(void)", 0); + if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #ifdef __Pxy_PyFrame_Initialize_Offsets + __Pxy_PyFrame_Initialize_Offsets(); + #endif + __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) + #ifdef __Pyx_CyFunction_USED + if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_FusedFunction_USED + if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_Coroutine_USED + if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_Generator_USED + if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_AsyncGen_USED + if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_StopAsyncIteration_USED + if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + /*--- Library function declarations ---*/ + /*--- Threads initialization code ---*/ + #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS + #ifdef WITH_THREAD /* Python build with threading support? */ + PyEval_InitThreads(); + #endif + #endif + /*--- Module creation code ---*/ + #if CYTHON_PEP489_MULTI_PHASE_INIT + __pyx_m = __pyx_pyinit_module; + Py_INCREF(__pyx_m); + #else + #if PY_MAJOR_VERSION < 3 + __pyx_m = Py_InitModule4("__waiter", __pyx_methods, __pyx_k_Low_level_waiting_primitives, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); + #else + __pyx_m = PyModule_Create(&__pyx_moduledef); + #endif + if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) + Py_INCREF(__pyx_d); + __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) + #if CYTHON_COMPILING_IN_PYPY + Py_INCREF(__pyx_b); + #endif + if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + /*--- Initialize various global constants etc. ---*/ + if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) + if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + if (__pyx_module_is_main_gevent____waiter) { + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + } + #if PY_MAJOR_VERSION >= 3 + { + PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) + if (!PyDict_GetItemString(modules, "gevent.__waiter")) { + if (unlikely(PyDict_SetItemString(modules, "gevent.__waiter", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error) + } + } + #endif + /*--- Builtin init code ---*/ + if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + /*--- Constants init code ---*/ + if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + /*--- Global type/function init code ---*/ + (void)__Pyx_modinit_global_init_code(); + if (unlikely(__Pyx_modinit_variable_export_code() != 0)) goto __pyx_L1_error; + (void)__Pyx_modinit_function_export_code(); + if (unlikely(__Pyx_modinit_type_init_code() != 0)) goto __pyx_L1_error; + if (unlikely(__Pyx_modinit_type_import_code() != 0)) goto __pyx_L1_error; + if (unlikely(__Pyx_modinit_variable_import_code() != 0)) goto __pyx_L1_error; + if (unlikely(__Pyx_modinit_function_import_code() != 0)) goto __pyx_L1_error; + /*--- Execution code ---*/ + #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) + if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + + /* "src/gevent/_waiter.py":12 + * from __future__ import print_function + * + * import sys # <<<<<<<<<<<<<< + * + * from gevent._hub_local import get_hub_noargs as get_hub + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_sys, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_v_6gevent_8__waiter_sys); + __Pyx_DECREF_SET(__pyx_v_6gevent_8__waiter_sys, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + + /* "src/gevent/_waiter.py":14 + * import sys + * + * from gevent._hub_local import get_hub_noargs as get_hub # <<<<<<<<<<<<<< + * from gevent.exceptions import ConcurrentObjectUseError + * + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 14, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_get_hub_noargs); + __Pyx_GIVEREF(__pyx_n_s_get_hub_noargs); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_get_hub_noargs); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_gevent__hub_local, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 14, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_get_hub_noargs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 14, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_hub_noargs, __pyx_t_1) < 0) __PYX_ERR(0, 14, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/_waiter.py":15 + * + * from gevent._hub_local import get_hub_noargs as get_hub + * from gevent.exceptions import ConcurrentObjectUseError # <<<<<<<<<<<<<< + * + * __all__ = [ + */ + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 15, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_ConcurrentObjectUseError); + __Pyx_GIVEREF(__pyx_n_s_ConcurrentObjectUseError); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_ConcurrentObjectUseError); + __pyx_t_1 = __Pyx_Import(__pyx_n_s_gevent_exceptions, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 15, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_ConcurrentObjectUseError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 15, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_v_6gevent_8__waiter_ConcurrentObjectUseError); + __Pyx_DECREF_SET(__pyx_v_6gevent_8__waiter_ConcurrentObjectUseError, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_waiter.py":17 + * from gevent.exceptions import ConcurrentObjectUseError + * + * __all__ = [ # <<<<<<<<<<<<<< + * 'Waiter', + * ] + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 17, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_Waiter); + __Pyx_GIVEREF(__pyx_n_s_Waiter); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_Waiter); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_all, __pyx_t_1) < 0) __PYX_ERR(0, 17, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_waiter.py":21 + * ] + * + * _NONE = object() # <<<<<<<<<<<<<< + * + * locals()['getcurrent'] = __import__('greenlet').getcurrent + */ + __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_builtin_object); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 21, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_v_6gevent_8__waiter__NONE); + __Pyx_DECREF_SET(__pyx_v_6gevent_8__waiter__NONE, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + + /* "src/gevent/_waiter.py":23 + * _NONE = object() + * + * locals()['getcurrent'] = __import__('greenlet').getcurrent # <<<<<<<<<<<<<< + * locals()['greenlet_init'] = lambda: None + * + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin___import__, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 23, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_getcurrent); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 23, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_Globals(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 23, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (unlikely(PyDict_SetItem(__pyx_t_1, __pyx_n_s_getcurrent, __pyx_t_2) < 0)) __PYX_ERR(0, 23, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/_waiter.py":24 + * + * locals()['getcurrent'] = __import__('greenlet').getcurrent + * locals()['greenlet_init'] = lambda: None # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_8__waiter_2lambda, 0, __pyx_n_s_lambda, NULL, __pyx_n_s_gevent___waiter, __pyx_d, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 24, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_Globals(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 24, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (unlikely(PyDict_SetItem(__pyx_t_1, __pyx_n_s_greenlet_init, __pyx_t_2) < 0)) __PYX_ERR(0, 24, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/_waiter.py":68 + * """ + * + * __slots__ = ['hub', 'greenlet', 'value', '_exception'] # <<<<<<<<<<<<<< + * + * def __init__(self, hub=None): + */ + __pyx_t_2 = PyList_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 68, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_hub); + __Pyx_GIVEREF(__pyx_n_s_hub); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_hub); + __Pyx_INCREF(__pyx_n_s_greenlet); + __Pyx_GIVEREF(__pyx_n_s_greenlet); + PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_greenlet); + __Pyx_INCREF(__pyx_n_s_value); + __Pyx_GIVEREF(__pyx_n_s_value); + PyList_SET_ITEM(__pyx_t_2, 2, __pyx_n_s_value); + __Pyx_INCREF(__pyx_n_s_exception_2); + __Pyx_GIVEREF(__pyx_n_s_exception_2); + PyList_SET_ITEM(__pyx_t_2, 3, __pyx_n_s_exception_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_8__waiter_Waiter->tp_dict, __pyx_n_s_slots, __pyx_t_2) < 0) __PYX_ERR(0, 68, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_8__waiter_Waiter); + + /* "src/gevent/_waiter.py":76 + * self._exception = _NONE + * + * def clear(self): # <<<<<<<<<<<<<< + * self.greenlet = None + * self.value = None + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_8__waiter_6Waiter_3clear, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Waiter_clear, NULL, __pyx_n_s_gevent___waiter, __pyx_d, ((PyObject *)__pyx_codeobj__4)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 76, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_8__waiter_Waiter->tp_dict, __pyx_n_s_clear, __pyx_t_2) < 0) __PYX_ERR(0, 76, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_8__waiter_Waiter); + + /* "src/gevent/_waiter.py":88 + * return '<%s greenlet=%s exc_info=%r>' % (type(self).__name__, self.greenlet, self.exc_info) + * + * def ready(self): # <<<<<<<<<<<<<< + * """Return true if and only if it holds a value or an exception""" + * return self._exception is not _NONE + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_8__waiter_6Waiter_7ready, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Waiter_ready, NULL, __pyx_n_s_gevent___waiter, __pyx_d, ((PyObject *)__pyx_codeobj__6)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 88, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_8__waiter_Waiter->tp_dict, __pyx_n_s_ready, __pyx_t_2) < 0) __PYX_ERR(0, 88, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_8__waiter_Waiter); + + /* "src/gevent/_waiter.py":92 + * return self._exception is not _NONE + * + * def successful(self): # <<<<<<<<<<<<<< + * """Return true if and only if it is ready and holds a value""" + * return self._exception is None + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_8__waiter_6Waiter_9successful, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Waiter_successful, NULL, __pyx_n_s_gevent___waiter, __pyx_d, ((PyObject *)__pyx_codeobj__8)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 92, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_8__waiter_Waiter->tp_dict, __pyx_n_s_successful, __pyx_t_2) < 0) __PYX_ERR(0, 92, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_8__waiter_Waiter); + + /* "src/gevent/_waiter.py":102 + * return self._exception + * + * def switch(self, value): # <<<<<<<<<<<<<< + * """ + * Switch to the greenlet if one's available. Otherwise store the + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_8__waiter_6Waiter_11switch, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Waiter_switch, NULL, __pyx_n_s_gevent___waiter, __pyx_d, ((PyObject *)__pyx_codeobj__10)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 102, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_8__waiter_Waiter->tp_dict, __pyx_n_s_switch, __pyx_t_2) < 0) __PYX_ERR(0, 102, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_8__waiter_Waiter); + + /* "src/gevent/_waiter.py":123 + * self.hub.handle_error(switch, *sys.exc_info()) + * + * def switch_args(self, *args): # <<<<<<<<<<<<<< + * return self.switch(args) + * + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_8__waiter_6Waiter_13switch_args, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Waiter_switch_args, NULL, __pyx_n_s_gevent___waiter, __pyx_d, ((PyObject *)__pyx_codeobj__12)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 123, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_8__waiter_Waiter->tp_dict, __pyx_n_s_switch_args, __pyx_t_2) < 0) __PYX_ERR(0, 123, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_8__waiter_Waiter); + + /* "src/gevent/_waiter.py":126 + * return self.switch(args) + * + * def throw(self, *throw_args): # <<<<<<<<<<<<<< + * """Switch to the greenlet with the exception. If there's no greenlet, store the exception.""" + * greenlet = self.greenlet + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_8__waiter_6Waiter_15throw, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Waiter_throw, NULL, __pyx_n_s_gevent___waiter, __pyx_d, ((PyObject *)__pyx_codeobj__14)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 126, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_8__waiter_Waiter->tp_dict, __pyx_n_s_throw, __pyx_t_2) < 0) __PYX_ERR(0, 126, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_8__waiter_Waiter); + + /* "src/gevent/_waiter.py":140 + * self.hub.handle_error(throw, *sys.exc_info()) + * + * def get(self): # <<<<<<<<<<<<<< + * """If a value/an exception is stored, return/raise it. Otherwise until switch() or throw() is called.""" + * if self._exception is not _NONE: + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_8__waiter_6Waiter_17get, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Waiter_get, NULL, __pyx_n_s_gevent___waiter, __pyx_d, ((PyObject *)__pyx_codeobj__16)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 140, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_8__waiter_Waiter->tp_dict, __pyx_n_s_get, __pyx_t_2) < 0) __PYX_ERR(0, 140, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_8__waiter_Waiter); + + /* "src/gevent/_waiter.py":175 + * This does not handle exceptions or throw methods. + * """ + * __slots__ = ['_values'] # <<<<<<<<<<<<<< + * + * def __init__(self, hub=None): + */ + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 175, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_values); + __Pyx_GIVEREF(__pyx_n_s_values); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_values); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_8__waiter_MultipleWaiter->tp_dict, __pyx_n_s_slots, __pyx_t_2) < 0) __PYX_ERR(0, 175, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_8__waiter_MultipleWaiter); + + /* "src/gevent/_waiter.py":186 + * self._values = list() + * + * def switch(self, value): # <<<<<<<<<<<<<< + * self._values.append(value) + * Waiter.switch(self, True) + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_8__waiter_14MultipleWaiter_3switch, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_MultipleWaiter_switch, NULL, __pyx_n_s_gevent___waiter, __pyx_d, ((PyObject *)__pyx_codeobj__18)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 186, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_8__waiter_MultipleWaiter->tp_dict, __pyx_n_s_switch, __pyx_t_2) < 0) __PYX_ERR(0, 186, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_8__waiter_MultipleWaiter); + + /* "src/gevent/_waiter.py":190 + * Waiter.switch(self, True) + * + * def get(self): # <<<<<<<<<<<<<< + * if not self._values: + * Waiter.get(self) + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_8__waiter_14MultipleWaiter_5get, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_MultipleWaiter_get, NULL, __pyx_n_s_gevent___waiter, __pyx_d, ((PyObject *)__pyx_codeobj__20)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 190, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_8__waiter_MultipleWaiter->tp_dict, __pyx_n_s_get, __pyx_t_2) < 0) __PYX_ERR(0, 190, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_8__waiter_MultipleWaiter); + + /* "src/gevent/_waiter.py":197 + * return self._values.pop(0) + * + * def _init(): # <<<<<<<<<<<<<< + * greenlet_init() # pylint:disable=undefined-variable + * + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_8__waiter_1_init, 0, __pyx_n_s_init_2, NULL, __pyx_n_s_gevent___waiter, __pyx_d, ((PyObject *)__pyx_codeobj__21)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 197, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_init_2, __pyx_t_2) < 0) __PYX_ERR(0, 197, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/_waiter.py":200 + * greenlet_init() # pylint:disable=undefined-variable + * + * _init() # <<<<<<<<<<<<<< + * + * + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_init_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 200, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 200, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_waiter.py":203 + * + * + * from gevent._util import import_c_accel # <<<<<<<<<<<<<< + * import_c_accel(globals(), 'gevent.__waiter') + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 203, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_import_c_accel); + __Pyx_GIVEREF(__pyx_n_s_import_c_accel); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_import_c_accel); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_gevent__util, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 203, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_import_c_accel); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 203, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_import_c_accel, __pyx_t_1) < 0) __PYX_ERR(0, 203, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/_waiter.py":204 + * + * from gevent._util import import_c_accel + * import_c_accel(globals(), 'gevent.__waiter') # <<<<<<<<<<<<<< + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_import_c_accel); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 204, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_Globals(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 204, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 204, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_INCREF(__pyx_n_s_gevent___waiter); + __Pyx_GIVEREF(__pyx_n_s_gevent___waiter); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_n_s_gevent___waiter); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 204, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/_waiter.py":1 + * # -*- coding: utf-8 -*- # <<<<<<<<<<<<<< + * # copyright 2018 gevent + * # cython: auto_pickle=False,embedsignature=True,always_allow_keywords=False + */ + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "gevent/__waiter.pxd":27 + * return PyGreenlet_GetCurrent() + * + * cdef inline void greenlet_init(): # <<<<<<<<<<<<<< + * global _greenlet_imported + * if not _greenlet_imported: + */ + + /*--- Wrapped vars code ---*/ + + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + if (__pyx_m) { + if (__pyx_d) { + __Pyx_AddTraceback("init gevent.__waiter", __pyx_clineno, __pyx_lineno, __pyx_filename); + } + Py_CLEAR(__pyx_m); + } else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_ImportError, "init gevent.__waiter"); + } + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + #if CYTHON_PEP489_MULTI_PHASE_INIT + return (__pyx_m != NULL) ? 0 : -1; + #elif PY_MAJOR_VERSION >= 3 + return __pyx_m; + #else + return; + #endif +} + +/* --- Runtime support code --- */ +/* Refnanny */ +#if CYTHON_REFNANNY +static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { + PyObject *m = NULL, *p = NULL; + void *r = NULL; + m = PyImport_ImportModule(modname); + if (!m) goto end; + p = PyObject_GetAttrString(m, "RefNannyAPI"); + if (!p) goto end; + r = PyLong_AsVoidPtr(p); +end: + Py_XDECREF(p); + Py_XDECREF(m); + return (__Pyx_RefNannyAPIStruct *)r; +} +#endif + +/* PyObjectGetAttrStr */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_getattro)) + return tp->tp_getattro(obj, attr_name); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_getattr)) + return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); +#endif + return PyObject_GetAttr(obj, attr_name); +} +#endif + +/* GetBuiltinName */ +static PyObject *__Pyx_GetBuiltinName(PyObject *name) { + PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name); + if (unlikely(!result)) { + PyErr_Format(PyExc_NameError, +#if PY_MAJOR_VERSION >= 3 + "name '%U' is not defined", name); +#else + "name '%.200s' is not defined", PyString_AS_STRING(name)); +#endif + } + return result; +} + +/* RaiseDoubleKeywords */ +static void __Pyx_RaiseDoubleKeywordsError( + const char* func_name, + PyObject* kw_name) +{ + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION >= 3 + "%s() got multiple values for keyword argument '%U'", func_name, kw_name); + #else + "%s() got multiple values for keyword argument '%s'", func_name, + PyString_AsString(kw_name)); + #endif +} + +/* ParseKeywords */ +static int __Pyx_ParseOptionalKeywords( + PyObject *kwds, + PyObject **argnames[], + PyObject *kwds2, + PyObject *values[], + Py_ssize_t num_pos_args, + const char* function_name) +{ + PyObject *key = 0, *value = 0; + Py_ssize_t pos = 0; + PyObject*** name; + PyObject*** first_kw_arg = argnames + num_pos_args; + while (PyDict_Next(kwds, &pos, &key, &value)) { + name = first_kw_arg; + while (*name && (**name != key)) name++; + if (*name) { + values[name-argnames] = value; + continue; + } + name = first_kw_arg; + #if PY_MAJOR_VERSION < 3 + if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) { + while (*name) { + if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) + && _PyString_Eq(**name, key)) { + values[name-argnames] = value; + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + if ((**argname == key) || ( + (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) + && _PyString_Eq(**argname, key))) { + goto arg_passed_twice; + } + argname++; + } + } + } else + #endif + if (likely(PyUnicode_Check(key))) { + while (*name) { + int cmp = (**name == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 : + #endif + PyUnicode_Compare(**name, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) { + values[name-argnames] = value; + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + int cmp = (**argname == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 : + #endif + PyUnicode_Compare(**argname, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) goto arg_passed_twice; + argname++; + } + } + } else + goto invalid_keyword_type; + if (kwds2) { + if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; + } else { + goto invalid_keyword; + } + } + return 0; +arg_passed_twice: + __Pyx_RaiseDoubleKeywordsError(function_name, key); + goto bad; +invalid_keyword_type: + PyErr_Format(PyExc_TypeError, + "%.200s() keywords must be strings", function_name); + goto bad; +invalid_keyword: + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION < 3 + "%.200s() got an unexpected keyword argument '%.200s'", + function_name, PyString_AsString(key)); + #else + "%s() got an unexpected keyword argument '%U'", + function_name, key); + #endif +bad: + return -1; +} + +/* RaiseArgTupleInvalid */ +static void __Pyx_RaiseArgtupleInvalid( + const char* func_name, + int exact, + Py_ssize_t num_min, + Py_ssize_t num_max, + Py_ssize_t num_found) +{ + Py_ssize_t num_expected; + const char *more_or_less; + if (num_found < num_min) { + num_expected = num_min; + more_or_less = "at least"; + } else { + num_expected = num_max; + more_or_less = "at most"; + } + if (exact) { + more_or_less = "exactly"; + } + PyErr_Format(PyExc_TypeError, + "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", + func_name, more_or_less, num_expected, + (num_expected == 1) ? "" : "s", num_found); +} + +/* ExtTypeTest */ +static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { + if (unlikely(!type)) { + PyErr_SetString(PyExc_SystemError, "Missing type object"); + return 0; + } + if (likely(__Pyx_TypeCheck(obj, type))) + return 1; + PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s", + Py_TYPE(obj)->tp_name, type->tp_name); + return 0; +} + +/* PyFunctionFastCall */ +#if CYTHON_FAST_PYCALL +static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, + PyObject *globals) { + PyFrameObject *f; + PyThreadState *tstate = __Pyx_PyThreadState_Current; + PyObject **fastlocals; + Py_ssize_t i; + PyObject *result; + assert(globals != NULL); + /* XXX Perhaps we should create a specialized + PyFrame_New() that doesn't take locals, but does + take builtins without sanity checking them. + */ + assert(tstate != NULL); + f = PyFrame_New(tstate, co, globals, NULL); + if (f == NULL) { + return NULL; + } + fastlocals = __Pyx_PyFrame_GetLocalsplus(f); + for (i = 0; i < na; i++) { + Py_INCREF(*args); + fastlocals[i] = *args++; + } + result = PyEval_EvalFrameEx(f,0); + ++tstate->recursion_depth; + Py_DECREF(f); + --tstate->recursion_depth; + return result; +} +#if 1 || PY_VERSION_HEX < 0x030600B1 +static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs) { + PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); + PyObject *globals = PyFunction_GET_GLOBALS(func); + PyObject *argdefs = PyFunction_GET_DEFAULTS(func); + PyObject *closure; +#if PY_MAJOR_VERSION >= 3 + PyObject *kwdefs; +#endif + PyObject *kwtuple, **k; + PyObject **d; + Py_ssize_t nd; + Py_ssize_t nk; + PyObject *result; + assert(kwargs == NULL || PyDict_Check(kwargs)); + nk = kwargs ? PyDict_Size(kwargs) : 0; + if (Py_EnterRecursiveCall((char*)" while calling a Python object")) { + return NULL; + } + if ( +#if PY_MAJOR_VERSION >= 3 + co->co_kwonlyargcount == 0 && +#endif + likely(kwargs == NULL || nk == 0) && + co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { + if (argdefs == NULL && co->co_argcount == nargs) { + result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); + goto done; + } + else if (nargs == 0 && argdefs != NULL + && co->co_argcount == Py_SIZE(argdefs)) { + /* function called with no arguments, but all parameters have + a default value: use default values as arguments .*/ + args = &PyTuple_GET_ITEM(argdefs, 0); + result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); + goto done; + } + } + if (kwargs != NULL) { + Py_ssize_t pos, i; + kwtuple = PyTuple_New(2 * nk); + if (kwtuple == NULL) { + result = NULL; + goto done; + } + k = &PyTuple_GET_ITEM(kwtuple, 0); + pos = i = 0; + while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { + Py_INCREF(k[i]); + Py_INCREF(k[i+1]); + i += 2; + } + nk = i / 2; + } + else { + kwtuple = NULL; + k = NULL; + } + closure = PyFunction_GET_CLOSURE(func); +#if PY_MAJOR_VERSION >= 3 + kwdefs = PyFunction_GET_KW_DEFAULTS(func); +#endif + if (argdefs != NULL) { + d = &PyTuple_GET_ITEM(argdefs, 0); + nd = Py_SIZE(argdefs); + } + else { + d = NULL; + nd = 0; + } +#if PY_MAJOR_VERSION >= 3 + result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, + args, nargs, + k, (int)nk, + d, (int)nd, kwdefs, closure); +#else + result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, + args, nargs, + k, (int)nk, + d, (int)nd, closure); +#endif + Py_XDECREF(kwtuple); +done: + Py_LeaveRecursiveCall(); + return result; +} +#endif +#endif + +/* PyObjectCall */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { + PyObject *result; + ternaryfunc call = func->ob_type->tp_call; + if (unlikely(!call)) + return PyObject_Call(func, arg, kw); + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; + result = (*call)(func, arg, kw); + Py_LeaveRecursiveCall(); + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +/* PyObjectCallMethO */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { + PyObject *self, *result; + PyCFunction cfunc; + cfunc = PyCFunction_GET_FUNCTION(func); + self = PyCFunction_GET_SELF(func); + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; + result = cfunc(self, arg); + Py_LeaveRecursiveCall(); + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +/* PyObjectCallNoArg */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { +#if CYTHON_FAST_PYCALL + if (PyFunction_Check(func)) { + return __Pyx_PyFunction_FastCall(func, NULL, 0); + } +#endif +#ifdef __Pyx_CyFunction_USED + if (likely(PyCFunction_Check(func) || __Pyx_CyFunction_Check(func))) +#else + if (likely(PyCFunction_Check(func))) +#endif + { + if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) { + return __Pyx_PyObject_CallMethO(func, NULL); + } + } + return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL); +} +#endif + +/* PyCFunctionFastCall */ +#if CYTHON_FAST_PYCCALL +static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) { + PyCFunctionObject *func = (PyCFunctionObject*)func_obj; + PyCFunction meth = PyCFunction_GET_FUNCTION(func); + PyObject *self = PyCFunction_GET_SELF(func); + int flags = PyCFunction_GET_FLAGS(func); + assert(PyCFunction_Check(func)); + assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS))); + assert(nargs >= 0); + assert(nargs == 0 || args != NULL); + /* _PyCFunction_FastCallDict() must not be called with an exception set, + because it may clear it (directly or indirectly) and so the + caller loses its exception */ + assert(!PyErr_Occurred()); + if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) { + return (*((__Pyx_PyCFunctionFastWithKeywords)(void*)meth)) (self, args, nargs, NULL); + } else { + return (*((__Pyx_PyCFunctionFast)(void*)meth)) (self, args, nargs); + } +} +#endif + +/* PyObjectCallOneArg */ +#if CYTHON_COMPILING_IN_CPYTHON +static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) { + PyObject *result; + PyObject *args = PyTuple_New(1); + if (unlikely(!args)) return NULL; + Py_INCREF(arg); + PyTuple_SET_ITEM(args, 0, arg); + result = __Pyx_PyObject_Call(func, args, NULL); + Py_DECREF(args); + return result; +} +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { +#if CYTHON_FAST_PYCALL + if (PyFunction_Check(func)) { + return __Pyx_PyFunction_FastCall(func, &arg, 1); + } +#endif + if (likely(PyCFunction_Check(func))) { + if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) { + return __Pyx_PyObject_CallMethO(func, arg); +#if CYTHON_FAST_PYCCALL + } else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) { + return __Pyx_PyCFunction_FastCall(func, &arg, 1); +#endif + } + } + return __Pyx__PyObject_CallOneArg(func, arg); +} +#else +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { + PyObject *result; + PyObject *args = PyTuple_Pack(1, arg); + if (unlikely(!args)) return NULL; + result = __Pyx_PyObject_Call(func, args, NULL); + Py_DECREF(args); + return result; +} +#endif + +/* PyErrFetchRestore */ +#if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + tmp_type = tstate->curexc_type; + tmp_value = tstate->curexc_value; + tmp_tb = tstate->curexc_traceback; + tstate->curexc_type = type; + tstate->curexc_value = value; + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +} +static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { + *type = tstate->curexc_type; + *value = tstate->curexc_value; + *tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +} +#endif + +/* RaiseException */ +#if PY_MAJOR_VERSION < 3 +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, + CYTHON_UNUSED PyObject *cause) { + __Pyx_PyThreadState_declare + Py_XINCREF(type); + if (!value || value == Py_None) + value = NULL; + else + Py_INCREF(value); + if (!tb || tb == Py_None) + tb = NULL; + else { + Py_INCREF(tb); + if (!PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto raise_error; + } + } + if (PyType_Check(type)) { +#if CYTHON_COMPILING_IN_PYPY + if (!value) { + Py_INCREF(Py_None); + value = Py_None; + } +#endif + PyErr_NormalizeException(&type, &value, &tb); + } else { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto raise_error; + } + value = type; + type = (PyObject*) Py_TYPE(type); + Py_INCREF(type); + if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto raise_error; + } + } + __Pyx_PyThreadState_assign + __Pyx_ErrRestore(type, value, tb); + return; +raise_error: + Py_XDECREF(value); + Py_XDECREF(type); + Py_XDECREF(tb); + return; +} +#else +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { + PyObject* owned_instance = NULL; + if (tb == Py_None) { + tb = 0; + } else if (tb && !PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto bad; + } + if (value == Py_None) + value = 0; + if (PyExceptionInstance_Check(type)) { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto bad; + } + value = type; + type = (PyObject*) Py_TYPE(value); + } else if (PyExceptionClass_Check(type)) { + PyObject *instance_class = NULL; + if (value && PyExceptionInstance_Check(value)) { + instance_class = (PyObject*) Py_TYPE(value); + if (instance_class != type) { + int is_subclass = PyObject_IsSubclass(instance_class, type); + if (!is_subclass) { + instance_class = NULL; + } else if (unlikely(is_subclass == -1)) { + goto bad; + } else { + type = instance_class; + } + } + } + if (!instance_class) { + PyObject *args; + if (!value) + args = PyTuple_New(0); + else if (PyTuple_Check(value)) { + Py_INCREF(value); + args = value; + } else + args = PyTuple_Pack(1, value); + if (!args) + goto bad; + owned_instance = PyObject_Call(type, args, NULL); + Py_DECREF(args); + if (!owned_instance) + goto bad; + value = owned_instance; + if (!PyExceptionInstance_Check(value)) { + PyErr_Format(PyExc_TypeError, + "calling %R should have returned an instance of " + "BaseException, not %R", + type, Py_TYPE(value)); + goto bad; + } + } + } else { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto bad; + } + if (cause) { + PyObject *fixed_cause; + if (cause == Py_None) { + fixed_cause = NULL; + } else if (PyExceptionClass_Check(cause)) { + fixed_cause = PyObject_CallObject(cause, NULL); + if (fixed_cause == NULL) + goto bad; + } else if (PyExceptionInstance_Check(cause)) { + fixed_cause = cause; + Py_INCREF(fixed_cause); + } else { + PyErr_SetString(PyExc_TypeError, + "exception causes must derive from " + "BaseException"); + goto bad; + } + PyException_SetCause(value, fixed_cause); + } + PyErr_SetObject(type, value); + if (tb) { +#if CYTHON_COMPILING_IN_PYPY + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); + Py_INCREF(tb); + PyErr_Restore(tmp_type, tmp_value, tb); + Py_XDECREF(tmp_tb); +#else + PyThreadState *tstate = __Pyx_PyThreadState_Current; + PyObject* tmp_tb = tstate->curexc_traceback; + if (tb != tmp_tb) { + Py_INCREF(tb); + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_tb); + } +#endif + } +bad: + Py_XDECREF(owned_instance); + return; +} +#endif + +/* PyObjectCall2Args */ +static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) { + PyObject *args, *result = NULL; + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(function)) { + PyObject *args[2] = {arg1, arg2}; + return __Pyx_PyFunction_FastCall(function, args, 2); + } + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(function)) { + PyObject *args[2] = {arg1, arg2}; + return __Pyx_PyCFunction_FastCall(function, args, 2); + } + #endif + args = PyTuple_New(2); + if (unlikely(!args)) goto done; + Py_INCREF(arg1); + PyTuple_SET_ITEM(args, 0, arg1); + Py_INCREF(arg2); + PyTuple_SET_ITEM(args, 1, arg2); + Py_INCREF(function); + result = __Pyx_PyObject_Call(function, args, NULL); + Py_DECREF(args); + Py_DECREF(function); +done: + return result; +} + +/* GetTopmostException */ +#if CYTHON_USE_EXC_INFO_STACK +static _PyErr_StackItem * +__Pyx_PyErr_GetTopmostException(PyThreadState *tstate) +{ + _PyErr_StackItem *exc_info = tstate->exc_info; + while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) && + exc_info->previous_item != NULL) + { + exc_info = exc_info->previous_item; + } + return exc_info; +} +#endif + +/* SaveResetException */ +#if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { + #if CYTHON_USE_EXC_INFO_STACK + _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate); + *type = exc_info->exc_type; + *value = exc_info->exc_value; + *tb = exc_info->exc_traceback; + #else + *type = tstate->exc_type; + *value = tstate->exc_value; + *tb = tstate->exc_traceback; + #endif + Py_XINCREF(*type); + Py_XINCREF(*value); + Py_XINCREF(*tb); +} +static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + #if CYTHON_USE_EXC_INFO_STACK + _PyErr_StackItem *exc_info = tstate->exc_info; + tmp_type = exc_info->exc_type; + tmp_value = exc_info->exc_value; + tmp_tb = exc_info->exc_traceback; + exc_info->exc_type = type; + exc_info->exc_value = value; + exc_info->exc_traceback = tb; + #else + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = type; + tstate->exc_value = value; + tstate->exc_traceback = tb; + #endif + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +} +#endif + +/* GetException */ +#if CYTHON_FAST_THREAD_STATE +static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) +#else +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) +#endif +{ + PyObject *local_type, *local_value, *local_tb; +#if CYTHON_FAST_THREAD_STATE + PyObject *tmp_type, *tmp_value, *tmp_tb; + local_type = tstate->curexc_type; + local_value = tstate->curexc_value; + local_tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +#else + PyErr_Fetch(&local_type, &local_value, &local_tb); +#endif + PyErr_NormalizeException(&local_type, &local_value, &local_tb); +#if CYTHON_FAST_THREAD_STATE + if (unlikely(tstate->curexc_type)) +#else + if (unlikely(PyErr_Occurred())) +#endif + goto bad; + #if PY_MAJOR_VERSION >= 3 + if (local_tb) { + if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) + goto bad; + } + #endif + Py_XINCREF(local_tb); + Py_XINCREF(local_type); + Py_XINCREF(local_value); + *type = local_type; + *value = local_value; + *tb = local_tb; +#if CYTHON_FAST_THREAD_STATE + #if CYTHON_USE_EXC_INFO_STACK + { + _PyErr_StackItem *exc_info = tstate->exc_info; + tmp_type = exc_info->exc_type; + tmp_value = exc_info->exc_value; + tmp_tb = exc_info->exc_traceback; + exc_info->exc_type = local_type; + exc_info->exc_value = local_value; + exc_info->exc_traceback = local_tb; + } + #else + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = local_type; + tstate->exc_value = local_value; + tstate->exc_traceback = local_tb; + #endif + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#else + PyErr_SetExcInfo(local_type, local_value, local_tb); +#endif + return 0; +bad: + *type = 0; + *value = 0; + *tb = 0; + Py_XDECREF(local_type); + Py_XDECREF(local_value); + Py_XDECREF(local_tb); + return -1; +} + +/* KeywordStringCheck */ +static int __Pyx_CheckKeywordStrings( + PyObject *kwdict, + const char* function_name, + int kw_allowed) +{ + PyObject* key = 0; + Py_ssize_t pos = 0; +#if CYTHON_COMPILING_IN_PYPY + if (!kw_allowed && PyDict_Next(kwdict, &pos, &key, 0)) + goto invalid_keyword; + return 1; +#else + while (PyDict_Next(kwdict, &pos, &key, 0)) { + #if PY_MAJOR_VERSION < 3 + if (unlikely(!PyString_Check(key))) + #endif + if (unlikely(!PyUnicode_Check(key))) + goto invalid_keyword_type; + } + if ((!kw_allowed) && unlikely(key)) + goto invalid_keyword; + return 1; +invalid_keyword_type: + PyErr_Format(PyExc_TypeError, + "%.200s() keywords must be strings", function_name); + return 0; +#endif +invalid_keyword: + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION < 3 + "%.200s() got an unexpected keyword argument '%.200s'", + function_name, PyString_AsString(key)); + #else + "%s() got an unexpected keyword argument '%U'", + function_name, key); + #endif + return 0; +} + +/* SwapException */ +#if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + #if CYTHON_USE_EXC_INFO_STACK + _PyErr_StackItem *exc_info = tstate->exc_info; + tmp_type = exc_info->exc_type; + tmp_value = exc_info->exc_value; + tmp_tb = exc_info->exc_traceback; + exc_info->exc_type = *type; + exc_info->exc_value = *value; + exc_info->exc_traceback = *tb; + #else + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = *type; + tstate->exc_value = *value; + tstate->exc_traceback = *tb; + #endif + *type = tmp_type; + *value = tmp_value; + *tb = tmp_tb; +} +#else +static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb); + PyErr_SetExcInfo(*type, *value, *tb); + *type = tmp_type; + *value = tmp_value; + *tb = tmp_tb; +} +#endif + +/* PyObjectGetMethod */ +static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method) { + PyObject *attr; +#if CYTHON_UNPACK_METHODS && CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_PYTYPE_LOOKUP + PyTypeObject *tp = Py_TYPE(obj); + PyObject *descr; + descrgetfunc f = NULL; + PyObject **dictptr, *dict; + int meth_found = 0; + assert (*method == NULL); + if (unlikely(tp->tp_getattro != PyObject_GenericGetAttr)) { + attr = __Pyx_PyObject_GetAttrStr(obj, name); + goto try_unpack; + } + if (unlikely(tp->tp_dict == NULL) && unlikely(PyType_Ready(tp) < 0)) { + return 0; + } + descr = _PyType_Lookup(tp, name); + if (likely(descr != NULL)) { + Py_INCREF(descr); +#if PY_MAJOR_VERSION >= 3 + #ifdef __Pyx_CyFunction_USED + if (likely(PyFunction_Check(descr) || (Py_TYPE(descr) == &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr))) + #else + if (likely(PyFunction_Check(descr) || (Py_TYPE(descr) == &PyMethodDescr_Type))) + #endif +#else + #ifdef __Pyx_CyFunction_USED + if (likely(PyFunction_Check(descr) || __Pyx_CyFunction_Check(descr))) + #else + if (likely(PyFunction_Check(descr))) + #endif +#endif + { + meth_found = 1; + } else { + f = Py_TYPE(descr)->tp_descr_get; + if (f != NULL && PyDescr_IsData(descr)) { + attr = f(descr, obj, (PyObject *)Py_TYPE(obj)); + Py_DECREF(descr); + goto try_unpack; + } + } + } + dictptr = _PyObject_GetDictPtr(obj); + if (dictptr != NULL && (dict = *dictptr) != NULL) { + Py_INCREF(dict); + attr = __Pyx_PyDict_GetItemStr(dict, name); + if (attr != NULL) { + Py_INCREF(attr); + Py_DECREF(dict); + Py_XDECREF(descr); + goto try_unpack; + } + Py_DECREF(dict); + } + if (meth_found) { + *method = descr; + return 1; + } + if (f != NULL) { + attr = f(descr, obj, (PyObject *)Py_TYPE(obj)); + Py_DECREF(descr); + goto try_unpack; + } + if (descr != NULL) { + *method = descr; + return 0; + } + PyErr_Format(PyExc_AttributeError, +#if PY_MAJOR_VERSION >= 3 + "'%.50s' object has no attribute '%U'", + tp->tp_name, name); +#else + "'%.50s' object has no attribute '%.400s'", + tp->tp_name, PyString_AS_STRING(name)); +#endif + return 0; +#else + attr = __Pyx_PyObject_GetAttrStr(obj, name); + goto try_unpack; +#endif +try_unpack: +#if CYTHON_UNPACK_METHODS + if (likely(attr) && PyMethod_Check(attr) && likely(PyMethod_GET_SELF(attr) == obj)) { + PyObject *function = PyMethod_GET_FUNCTION(attr); + Py_INCREF(function); + Py_DECREF(attr); + *method = function; + return 1; + } +#endif + *method = attr; + return 0; +} + +/* PyObjectCallMethod1 */ +static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg) { + PyObject *result = __Pyx_PyObject_CallOneArg(method, arg); + Py_DECREF(method); + return result; +} +static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) { + PyObject *method = NULL, *result; + int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method); + if (likely(is_method)) { + result = __Pyx_PyObject_Call2Args(method, obj, arg); + Py_DECREF(method); + return result; + } + if (unlikely(!method)) return NULL; + return __Pyx__PyObject_CallMethod1(method, arg); +} + +/* pop_index */ +static PyObject* __Pyx__PyObject_PopNewIndex(PyObject* L, PyObject* py_ix) { + PyObject *r; + if (unlikely(!py_ix)) return NULL; + r = __Pyx__PyObject_PopIndex(L, py_ix); + Py_DECREF(py_ix); + return r; +} +static PyObject* __Pyx__PyObject_PopIndex(PyObject* L, PyObject* py_ix) { + return __Pyx_PyObject_CallMethod1(L, __pyx_n_s_pop, py_ix); +} +#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS +static PyObject* __Pyx__PyList_PopIndex(PyObject* L, PyObject* py_ix, Py_ssize_t ix) { + Py_ssize_t size = PyList_GET_SIZE(L); + if (likely(size > (((PyListObject*)L)->allocated >> 1))) { + Py_ssize_t cix = ix; + if (cix < 0) { + cix += size; + } + if (likely(__Pyx_is_valid_index(cix, size))) { + PyObject* v = PyList_GET_ITEM(L, cix); + Py_SIZE(L) -= 1; + size -= 1; + memmove(&PyList_GET_ITEM(L, cix), &PyList_GET_ITEM(L, cix+1), (size_t)(size-cix)*sizeof(PyObject*)); + return v; + } + } + if (py_ix == Py_None) { + return __Pyx__PyObject_PopNewIndex(L, PyInt_FromSsize_t(ix)); + } else { + return __Pyx__PyObject_PopIndex(L, py_ix); + } +} +#endif + +/* TypeImport */ +#ifndef __PYX_HAVE_RT_ImportType +#define __PYX_HAVE_RT_ImportType +static PyTypeObject *__Pyx_ImportType(PyObject *module, const char *module_name, const char *class_name, + size_t size, enum __Pyx_ImportType_CheckSize check_size) +{ + PyObject *result = 0; + char warning[200]; + Py_ssize_t basicsize; +#ifdef Py_LIMITED_API + PyObject *py_basicsize; +#endif + result = PyObject_GetAttrString(module, class_name); + if (!result) + goto bad; + if (!PyType_Check(result)) { + PyErr_Format(PyExc_TypeError, + "%.200s.%.200s is not a type object", + module_name, class_name); + goto bad; + } +#ifndef Py_LIMITED_API + basicsize = ((PyTypeObject *)result)->tp_basicsize; +#else + py_basicsize = PyObject_GetAttrString(result, "__basicsize__"); + if (!py_basicsize) + goto bad; + basicsize = PyLong_AsSsize_t(py_basicsize); + Py_DECREF(py_basicsize); + py_basicsize = 0; + if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred()) + goto bad; +#endif + if ((size_t)basicsize < size) { + PyErr_Format(PyExc_ValueError, + "%.200s.%.200s size changed, may indicate binary incompatibility. " + "Expected %zd from C header, got %zd from PyObject", + module_name, class_name, size, basicsize); + goto bad; + } + if (check_size == __Pyx_ImportType_CheckSize_Error && (size_t)basicsize != size) { + PyErr_Format(PyExc_ValueError, + "%.200s.%.200s size changed, may indicate binary incompatibility. " + "Expected %zd from C header, got %zd from PyObject", + module_name, class_name, size, basicsize); + goto bad; + } + else if (check_size == __Pyx_ImportType_CheckSize_Warn && (size_t)basicsize > size) { + PyOS_snprintf(warning, sizeof(warning), + "%s.%s size changed, may indicate binary incompatibility. " + "Expected %zd from C header, got %zd from PyObject", + module_name, class_name, size, basicsize); + if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad; + } + return (PyTypeObject *)result; +bad: + Py_XDECREF(result); + return NULL; +} +#endif + +/* PyObject_GenericGetAttrNoDict */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) { + PyErr_Format(PyExc_AttributeError, +#if PY_MAJOR_VERSION >= 3 + "'%.50s' object has no attribute '%U'", + tp->tp_name, attr_name); +#else + "'%.50s' object has no attribute '%.400s'", + tp->tp_name, PyString_AS_STRING(attr_name)); +#endif + return NULL; +} +static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) { + PyObject *descr; + PyTypeObject *tp = Py_TYPE(obj); + if (unlikely(!PyString_Check(attr_name))) { + return PyObject_GenericGetAttr(obj, attr_name); + } + assert(!tp->tp_dictoffset); + descr = _PyType_Lookup(tp, attr_name); + if (unlikely(!descr)) { + return __Pyx_RaiseGenericGetAttributeError(tp, attr_name); + } + Py_INCREF(descr); + #if PY_MAJOR_VERSION < 3 + if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS))) + #endif + { + descrgetfunc f = Py_TYPE(descr)->tp_descr_get; + if (unlikely(f)) { + PyObject *res = f(descr, obj, (PyObject *)tp); + Py_DECREF(descr); + return res; + } + } + return descr; +} +#endif + +/* PyObject_GenericGetAttr */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) { + if (unlikely(Py_TYPE(obj)->tp_dictoffset)) { + return PyObject_GenericGetAttr(obj, attr_name); + } + return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name); +} +#endif + +/* SetVTable */ +static int __Pyx_SetVtable(PyObject *dict, void *vtable) { +#if PY_VERSION_HEX >= 0x02070000 + PyObject *ob = PyCapsule_New(vtable, 0, 0); +#else + PyObject *ob = PyCObject_FromVoidPtr(vtable, 0); +#endif + if (!ob) + goto bad; + if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0) + goto bad; + Py_DECREF(ob); + return 0; +bad: + Py_XDECREF(ob); + return -1; +} + +/* GetVTable */ +static void* __Pyx_GetVtable(PyObject *dict) { + void* ptr; + PyObject *ob = PyObject_GetItem(dict, __pyx_n_s_pyx_vtable); + if (!ob) + goto bad; +#if PY_VERSION_HEX >= 0x02070000 + ptr = PyCapsule_GetPointer(ob, 0); +#else + ptr = PyCObject_AsVoidPtr(ob); +#endif + if (!ptr && !PyErr_Occurred()) + PyErr_SetString(PyExc_RuntimeError, "invalid vtable found for imported type"); + Py_DECREF(ob); + return ptr; +bad: + Py_XDECREF(ob); + return NULL; +} + +/* Import */ +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { + PyObject *empty_list = 0; + PyObject *module = 0; + PyObject *global_dict = 0; + PyObject *empty_dict = 0; + PyObject *list; + #if PY_MAJOR_VERSION < 3 + PyObject *py_import; + py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); + if (!py_import) + goto bad; + #endif + if (from_list) + list = from_list; + else { + empty_list = PyList_New(0); + if (!empty_list) + goto bad; + list = empty_list; + } + global_dict = PyModule_GetDict(__pyx_m); + if (!global_dict) + goto bad; + empty_dict = PyDict_New(); + if (!empty_dict) + goto bad; + { + #if PY_MAJOR_VERSION >= 3 + if (level == -1) { + if (strchr(__Pyx_MODULE_NAME, '.')) { + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, 1); + if (!module) { + if (!PyErr_ExceptionMatches(PyExc_ImportError)) + goto bad; + PyErr_Clear(); + } + } + level = 0; + } + #endif + if (!module) { + #if PY_MAJOR_VERSION < 3 + PyObject *py_level = PyInt_FromLong(level); + if (!py_level) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, py_level, (PyObject *)NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, level); + #endif + } + } +bad: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(py_import); + #endif + Py_XDECREF(empty_list); + Py_XDECREF(empty_dict); + return module; +} + +/* ImportFrom */ +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { + PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); + if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_Format(PyExc_ImportError, + #if PY_MAJOR_VERSION < 3 + "cannot import name %.230s", PyString_AS_STRING(name)); + #else + "cannot import name %S", name); + #endif + } + return value; +} + +/* FetchCommonType */ +static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { + PyObject* fake_module; + PyTypeObject* cached_type = NULL; + fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI); + if (!fake_module) return NULL; + Py_INCREF(fake_module); + cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name); + if (cached_type) { + if (!PyType_Check((PyObject*)cached_type)) { + PyErr_Format(PyExc_TypeError, + "Shared Cython type %.200s is not a type object", + type->tp_name); + goto bad; + } + if (cached_type->tp_basicsize != type->tp_basicsize) { + PyErr_Format(PyExc_TypeError, + "Shared Cython type %.200s has the wrong size, try recompiling", + type->tp_name); + goto bad; + } + } else { + if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; + PyErr_Clear(); + if (PyType_Ready(type) < 0) goto bad; + if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0) + goto bad; + Py_INCREF(type); + cached_type = type; + } +done: + Py_DECREF(fake_module); + return cached_type; +bad: + Py_XDECREF(cached_type); + cached_type = NULL; + goto done; +} + +/* CythonFunction */ +#include +static PyObject * +__Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure) +{ + if (unlikely(op->func_doc == NULL)) { + if (op->func.m_ml->ml_doc) { +#if PY_MAJOR_VERSION >= 3 + op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc); +#else + op->func_doc = PyString_FromString(op->func.m_ml->ml_doc); +#endif + if (unlikely(op->func_doc == NULL)) + return NULL; + } else { + Py_INCREF(Py_None); + return Py_None; + } + } + Py_INCREF(op->func_doc); + return op->func_doc; +} +static int +__Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context) +{ + PyObject *tmp = op->func_doc; + if (value == NULL) { + value = Py_None; + } + Py_INCREF(value); + op->func_doc = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + if (unlikely(op->func_name == NULL)) { +#if PY_MAJOR_VERSION >= 3 + op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name); +#else + op->func_name = PyString_InternFromString(op->func.m_ml->ml_name); +#endif + if (unlikely(op->func_name == NULL)) + return NULL; + } + Py_INCREF(op->func_name); + return op->func_name; +} +static int +__Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context) +{ + PyObject *tmp; +#if PY_MAJOR_VERSION >= 3 + if (unlikely(value == NULL || !PyUnicode_Check(value))) +#else + if (unlikely(value == NULL || !PyString_Check(value))) +#endif + { + PyErr_SetString(PyExc_TypeError, + "__name__ must be set to a string object"); + return -1; + } + tmp = op->func_name; + Py_INCREF(value); + op->func_name = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + Py_INCREF(op->func_qualname); + return op->func_qualname; +} +static int +__Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context) +{ + PyObject *tmp; +#if PY_MAJOR_VERSION >= 3 + if (unlikely(value == NULL || !PyUnicode_Check(value))) +#else + if (unlikely(value == NULL || !PyString_Check(value))) +#endif + { + PyErr_SetString(PyExc_TypeError, + "__qualname__ must be set to a string object"); + return -1; + } + tmp = op->func_qualname; + Py_INCREF(value); + op->func_qualname = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED void *closure) +{ + PyObject *self; + self = m->func_closure; + if (self == NULL) + self = Py_None; + Py_INCREF(self); + return self; +} +static PyObject * +__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + if (unlikely(op->func_dict == NULL)) { + op->func_dict = PyDict_New(); + if (unlikely(op->func_dict == NULL)) + return NULL; + } + Py_INCREF(op->func_dict); + return op->func_dict; +} +static int +__Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context) +{ + PyObject *tmp; + if (unlikely(value == NULL)) { + PyErr_SetString(PyExc_TypeError, + "function's dictionary may not be deleted"); + return -1; + } + if (unlikely(!PyDict_Check(value))) { + PyErr_SetString(PyExc_TypeError, + "setting function's dictionary to a non-dict"); + return -1; + } + tmp = op->func_dict; + Py_INCREF(value); + op->func_dict = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + Py_INCREF(op->func_globals); + return op->func_globals; +} +static PyObject * +__Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + Py_INCREF(Py_None); + return Py_None; +} +static PyObject * +__Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + PyObject* result = (op->func_code) ? op->func_code : Py_None; + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { + int result = 0; + PyObject *res = op->defaults_getter((PyObject *) op); + if (unlikely(!res)) + return -1; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + op->defaults_tuple = PyTuple_GET_ITEM(res, 0); + Py_INCREF(op->defaults_tuple); + op->defaults_kwdict = PyTuple_GET_ITEM(res, 1); + Py_INCREF(op->defaults_kwdict); + #else + op->defaults_tuple = PySequence_ITEM(res, 0); + if (unlikely(!op->defaults_tuple)) result = -1; + else { + op->defaults_kwdict = PySequence_ITEM(res, 1); + if (unlikely(!op->defaults_kwdict)) result = -1; + } + #endif + Py_DECREF(res); + return result; +} +static int +__Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) { + PyObject* tmp; + if (!value) { + value = Py_None; + } else if (value != Py_None && !PyTuple_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__defaults__ must be set to a tuple object"); + return -1; + } + Py_INCREF(value); + tmp = op->defaults_tuple; + op->defaults_tuple = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) { + PyObject* result = op->defaults_tuple; + if (unlikely(!result)) { + if (op->defaults_getter) { + if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL; + result = op->defaults_tuple; + } else { + result = Py_None; + } + } + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) { + PyObject* tmp; + if (!value) { + value = Py_None; + } else if (value != Py_None && !PyDict_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__kwdefaults__ must be set to a dict object"); + return -1; + } + Py_INCREF(value); + tmp = op->defaults_kwdict; + op->defaults_kwdict = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) { + PyObject* result = op->defaults_kwdict; + if (unlikely(!result)) { + if (op->defaults_getter) { + if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL; + result = op->defaults_kwdict; + } else { + result = Py_None; + } + } + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) { + PyObject* tmp; + if (!value || value == Py_None) { + value = NULL; + } else if (!PyDict_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__annotations__ must be set to a dict object"); + return -1; + } + Py_XINCREF(value); + tmp = op->func_annotations; + op->func_annotations = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) { + PyObject* result = op->func_annotations; + if (unlikely(!result)) { + result = PyDict_New(); + if (unlikely(!result)) return NULL; + op->func_annotations = result; + } + Py_INCREF(result); + return result; +} +static PyGetSetDef __pyx_CyFunction_getsets[] = { + {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, + {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, + {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, + {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, + {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, + {(char *) "__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0}, + {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, + {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, + {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, + {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, + {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, + {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, + {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, + {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, + {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, + {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, + {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, + {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, + {0, 0, 0, 0, 0} +}; +static PyMemberDef __pyx_CyFunction_members[] = { + {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), PY_WRITE_RESTRICTED, 0}, + {0, 0, 0, 0, 0} +}; +static PyObject * +__Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args) +{ +#if PY_MAJOR_VERSION >= 3 + return PyUnicode_FromString(m->func.m_ml->ml_name); +#else + return PyString_FromString(m->func.m_ml->ml_name); +#endif +} +static PyMethodDef __pyx_CyFunction_methods[] = { + {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, + {0, 0, 0, 0} +}; +#if PY_VERSION_HEX < 0x030500A0 +#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist) +#else +#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func.m_weakreflist) +#endif +static PyObject *__Pyx_CyFunction_New(PyTypeObject *type, PyMethodDef *ml, int flags, PyObject* qualname, + PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { + __pyx_CyFunctionObject *op = PyObject_GC_New(__pyx_CyFunctionObject, type); + if (op == NULL) + return NULL; + op->flags = flags; + __Pyx_CyFunction_weakreflist(op) = NULL; + op->func.m_ml = ml; + op->func.m_self = (PyObject *) op; + Py_XINCREF(closure); + op->func_closure = closure; + Py_XINCREF(module); + op->func.m_module = module; + op->func_dict = NULL; + op->func_name = NULL; + Py_INCREF(qualname); + op->func_qualname = qualname; + op->func_doc = NULL; + op->func_classobj = NULL; + op->func_globals = globals; + Py_INCREF(op->func_globals); + Py_XINCREF(code); + op->func_code = code; + op->defaults_pyobjects = 0; + op->defaults = NULL; + op->defaults_tuple = NULL; + op->defaults_kwdict = NULL; + op->defaults_getter = NULL; + op->func_annotations = NULL; + PyObject_GC_Track(op); + return (PyObject *) op; +} +static int +__Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) +{ + Py_CLEAR(m->func_closure); + Py_CLEAR(m->func.m_module); + Py_CLEAR(m->func_dict); + Py_CLEAR(m->func_name); + Py_CLEAR(m->func_qualname); + Py_CLEAR(m->func_doc); + Py_CLEAR(m->func_globals); + Py_CLEAR(m->func_code); + Py_CLEAR(m->func_classobj); + Py_CLEAR(m->defaults_tuple); + Py_CLEAR(m->defaults_kwdict); + Py_CLEAR(m->func_annotations); + if (m->defaults) { + PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); + int i; + for (i = 0; i < m->defaults_pyobjects; i++) + Py_XDECREF(pydefaults[i]); + PyObject_Free(m->defaults); + m->defaults = NULL; + } + return 0; +} +static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m) +{ + if (__Pyx_CyFunction_weakreflist(m) != NULL) + PyObject_ClearWeakRefs((PyObject *) m); + __Pyx_CyFunction_clear(m); + PyObject_GC_Del(m); +} +static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) +{ + PyObject_GC_UnTrack(m); + __Pyx__CyFunction_dealloc(m); +} +static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) +{ + Py_VISIT(m->func_closure); + Py_VISIT(m->func.m_module); + Py_VISIT(m->func_dict); + Py_VISIT(m->func_name); + Py_VISIT(m->func_qualname); + Py_VISIT(m->func_doc); + Py_VISIT(m->func_globals); + Py_VISIT(m->func_code); + Py_VISIT(m->func_classobj); + Py_VISIT(m->defaults_tuple); + Py_VISIT(m->defaults_kwdict); + if (m->defaults) { + PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); + int i; + for (i = 0; i < m->defaults_pyobjects; i++) + Py_VISIT(pydefaults[i]); + } + return 0; +} +static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type) +{ + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) { + Py_INCREF(func); + return func; + } + if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) { + if (type == NULL) + type = (PyObject *)(Py_TYPE(obj)); + return __Pyx_PyMethod_New(func, type, (PyObject *)(Py_TYPE(type))); + } + if (obj == Py_None) + obj = NULL; + return __Pyx_PyMethod_New(func, obj, type); +} +static PyObject* +__Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) +{ +#if PY_MAJOR_VERSION >= 3 + return PyUnicode_FromFormat("", + op->func_qualname, (void *)op); +#else + return PyString_FromFormat("", + PyString_AsString(op->func_qualname), (void *)op); +#endif +} +static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) { + PyCFunctionObject* f = (PyCFunctionObject*)func; + PyCFunction meth = f->m_ml->ml_meth; + Py_ssize_t size; + switch (f->m_ml->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) { + case METH_VARARGS: + if (likely(kw == NULL || PyDict_Size(kw) == 0)) + return (*meth)(self, arg); + break; + case METH_VARARGS | METH_KEYWORDS: + return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw); + case METH_NOARGS: + if (likely(kw == NULL || PyDict_Size(kw) == 0)) { + size = PyTuple_GET_SIZE(arg); + if (likely(size == 0)) + return (*meth)(self, NULL); + PyErr_Format(PyExc_TypeError, + "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", + f->m_ml->ml_name, size); + return NULL; + } + break; + case METH_O: + if (likely(kw == NULL || PyDict_Size(kw) == 0)) { + size = PyTuple_GET_SIZE(arg); + if (likely(size == 1)) { + PyObject *result, *arg0; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + arg0 = PyTuple_GET_ITEM(arg, 0); + #else + arg0 = PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL; + #endif + result = (*meth)(self, arg0); + #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) + Py_DECREF(arg0); + #endif + return result; + } + PyErr_Format(PyExc_TypeError, + "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", + f->m_ml->ml_name, size); + return NULL; + } + break; + default: + PyErr_SetString(PyExc_SystemError, "Bad call flags in " + "__Pyx_CyFunction_Call. METH_OLDARGS is no " + "longer supported!"); + return NULL; + } + PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", + f->m_ml->ml_name); + return NULL; +} +static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { + return __Pyx_CyFunction_CallMethod(func, ((PyCFunctionObject*)func)->m_self, arg, kw); +} +static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) { + PyObject *result; + __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func; + if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { + Py_ssize_t argc; + PyObject *new_args; + PyObject *self; + argc = PyTuple_GET_SIZE(args); + new_args = PyTuple_GetSlice(args, 1, argc); + if (unlikely(!new_args)) + return NULL; + self = PyTuple_GetItem(args, 0); + if (unlikely(!self)) { + Py_DECREF(new_args); + return NULL; + } + result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw); + Py_DECREF(new_args); + } else { + result = __Pyx_CyFunction_Call(func, args, kw); + } + return result; +} +static PyTypeObject __pyx_CyFunctionType_type = { + PyVarObject_HEAD_INIT(0, 0) + "cython_function_or_method", + sizeof(__pyx_CyFunctionObject), + 0, + (destructor) __Pyx_CyFunction_dealloc, + 0, + 0, + 0, +#if PY_MAJOR_VERSION < 3 + 0, +#else + 0, +#endif + (reprfunc) __Pyx_CyFunction_repr, + 0, + 0, + 0, + 0, + __Pyx_CyFunction_CallAsMethod, + 0, + 0, + 0, + 0, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, + 0, + (traverseproc) __Pyx_CyFunction_traverse, + (inquiry) __Pyx_CyFunction_clear, + 0, +#if PY_VERSION_HEX < 0x030500A0 + offsetof(__pyx_CyFunctionObject, func_weakreflist), +#else + offsetof(PyCFunctionObject, m_weakreflist), +#endif + 0, + 0, + __pyx_CyFunction_methods, + __pyx_CyFunction_members, + __pyx_CyFunction_getsets, + 0, + 0, + __Pyx_CyFunction_descr_get, + 0, + offsetof(__pyx_CyFunctionObject, func_dict), + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, +#if PY_VERSION_HEX >= 0x030400a1 + 0, +#endif +}; +static int __pyx_CyFunction_init(void) { + __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); + if (unlikely(__pyx_CyFunctionType == NULL)) { + return -1; + } + return 0; +} +static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults = PyObject_Malloc(size); + if (unlikely(!m->defaults)) + return PyErr_NoMemory(); + memset(m->defaults, 0, size); + m->defaults_pyobjects = pyobjects; + return m->defaults; +} +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults_tuple = tuple; + Py_INCREF(tuple); +} +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults_kwdict = dict; + Py_INCREF(dict); +} +static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->func_annotations = dict; + Py_INCREF(dict); +} + +/* GetModuleGlobalName */ +#if CYTHON_USE_DICT_VERSIONS +static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value) +#else +static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) +#endif +{ + PyObject *result; +#if !CYTHON_AVOID_BORROWED_REFS +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 + result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } else if (unlikely(PyErr_Occurred())) { + return NULL; + } +#else + result = PyDict_GetItem(__pyx_d, name); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } +#endif +#else + result = PyObject_GetItem(__pyx_d, name); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } + PyErr_Clear(); +#endif + return __Pyx_GetBuiltinName(name); +} + +/* GetAttr */ +static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) { +#if CYTHON_USE_TYPE_SLOTS +#if PY_MAJOR_VERSION >= 3 + if (likely(PyUnicode_Check(n))) +#else + if (likely(PyString_Check(n))) +#endif + return __Pyx_PyObject_GetAttrStr(o, n); +#endif + return PyObject_GetAttr(o, n); +} + +/* Globals */ +static PyObject* __Pyx_Globals(void) { + Py_ssize_t i; + PyObject *names; + PyObject *globals = __pyx_d; + Py_INCREF(globals); + names = PyObject_Dir(__pyx_m); + if (!names) + goto bad; + for (i = PyList_GET_SIZE(names)-1; i >= 0; i--) { +#if CYTHON_COMPILING_IN_PYPY + PyObject* name = PySequence_ITEM(names, i); + if (!name) + goto bad; +#else + PyObject* name = PyList_GET_ITEM(names, i); +#endif + if (!PyDict_Contains(globals, name)) { + PyObject* value = __Pyx_GetAttr(__pyx_m, name); + if (!value) { +#if CYTHON_COMPILING_IN_PYPY + Py_DECREF(name); +#endif + goto bad; + } + if (PyDict_SetItem(globals, name, value) < 0) { +#if CYTHON_COMPILING_IN_PYPY + Py_DECREF(name); +#endif + Py_DECREF(value); + goto bad; + } + } +#if CYTHON_COMPILING_IN_PYPY + Py_DECREF(name); +#endif + } + Py_DECREF(names); + return globals; +bad: + Py_XDECREF(names); + Py_XDECREF(globals); + return NULL; +} + +/* CLineInTraceback */ +#ifndef CYTHON_CLINE_IN_TRACEBACK +static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { + PyObject *use_cline; + PyObject *ptype, *pvalue, *ptraceback; +#if CYTHON_COMPILING_IN_CPYTHON + PyObject **cython_runtime_dict; +#endif + if (unlikely(!__pyx_cython_runtime)) { + return c_line; + } + __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); +#if CYTHON_COMPILING_IN_CPYTHON + cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); + if (likely(cython_runtime_dict)) { + __PYX_PY_DICT_LOOKUP_IF_MODIFIED( + use_cline, *cython_runtime_dict, + __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback)) + } else +#endif + { + PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback); + if (use_cline_obj) { + use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; + Py_DECREF(use_cline_obj); + } else { + PyErr_Clear(); + use_cline = NULL; + } + } + if (!use_cline) { + c_line = 0; + PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); + } + else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { + c_line = 0; + } + __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); + return c_line; +} +#endif + +/* CodeObjectCache */ +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { + int start = 0, mid = 0, end = count - 1; + if (end >= 0 && code_line > entries[end].code_line) { + return count; + } + while (start < end) { + mid = start + (end - start) / 2; + if (code_line < entries[mid].code_line) { + end = mid; + } else if (code_line > entries[mid].code_line) { + start = mid + 1; + } else { + return mid; + } + } + if (code_line <= entries[mid].code_line) { + return mid; + } else { + return mid + 1; + } +} +static PyCodeObject *__pyx_find_code_object(int code_line) { + PyCodeObject* code_object; + int pos; + if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { + return NULL; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { + return NULL; + } + code_object = __pyx_code_cache.entries[pos].code_object; + Py_INCREF(code_object); + return code_object; +} +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { + int pos, i; + __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; + if (unlikely(!code_line)) { + return; + } + if (unlikely(!entries)) { + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); + if (likely(entries)) { + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = 64; + __pyx_code_cache.count = 1; + entries[0].code_line = code_line; + entries[0].code_object = code_object; + Py_INCREF(code_object); + } + return; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { + PyCodeObject* tmp = entries[pos].code_object; + entries[pos].code_object = code_object; + Py_DECREF(tmp); + return; + } + if (__pyx_code_cache.count == __pyx_code_cache.max_count) { + int new_max = __pyx_code_cache.max_count + 64; + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( + __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry)); + if (unlikely(!entries)) { + return; + } + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = new_max; + } + for (i=__pyx_code_cache.count; i>pos; i--) { + entries[i] = entries[i-1]; + } + entries[pos].code_line = code_line; + entries[pos].code_object = code_object; + __pyx_code_cache.count++; + Py_INCREF(code_object); +} + +/* AddTraceback */ +#include "compile.h" +#include "frameobject.h" +#include "traceback.h" +static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( + const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyObject *py_srcfile = 0; + PyObject *py_funcname = 0; + #if PY_MAJOR_VERSION < 3 + py_srcfile = PyString_FromString(filename); + #else + py_srcfile = PyUnicode_FromString(filename); + #endif + if (!py_srcfile) goto bad; + if (c_line) { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + #else + py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + #endif + } + else { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromString(funcname); + #else + py_funcname = PyUnicode_FromString(funcname); + #endif + } + if (!py_funcname) goto bad; + py_code = __Pyx_PyCode_New( + 0, + 0, + 0, + 0, + 0, + __pyx_empty_bytes, /*PyObject *code,*/ + __pyx_empty_tuple, /*PyObject *consts,*/ + __pyx_empty_tuple, /*PyObject *names,*/ + __pyx_empty_tuple, /*PyObject *varnames,*/ + __pyx_empty_tuple, /*PyObject *freevars,*/ + __pyx_empty_tuple, /*PyObject *cellvars,*/ + py_srcfile, /*PyObject *filename,*/ + py_funcname, /*PyObject *name,*/ + py_line, + __pyx_empty_bytes /*PyObject *lnotab*/ + ); + Py_DECREF(py_srcfile); + Py_DECREF(py_funcname); + return py_code; +bad: + Py_XDECREF(py_srcfile); + Py_XDECREF(py_funcname); + return NULL; +} +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyFrameObject *py_frame = 0; + PyThreadState *tstate = __Pyx_PyThreadState_Current; + if (c_line) { + c_line = __Pyx_CLineForTraceback(tstate, c_line); + } + py_code = __pyx_find_code_object(c_line ? -c_line : py_line); + if (!py_code) { + py_code = __Pyx_CreateCodeObjectForTraceback( + funcname, c_line, py_line, filename); + if (!py_code) goto bad; + __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); + } + py_frame = PyFrame_New( + tstate, /*PyThreadState *tstate,*/ + py_code, /*PyCodeObject *code,*/ + __pyx_d, /*PyObject *globals,*/ + 0 /*PyObject *locals*/ + ); + if (!py_frame) goto bad; + __Pyx_PyFrame_SetLineNumber(py_frame, py_line); + PyTraceBack_Here(py_frame); +bad: + Py_XDECREF(py_code); + Py_XDECREF(py_frame); +} + +/* CIntToPy */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { + const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(long) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(long) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(long) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(long), + little, !is_unsigned); + } +} + +/* CIntFromPyVerify */ +#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ + __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) +#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ + __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) +#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ + {\ + func_type value = func_value;\ + if (sizeof(target_type) < sizeof(func_type)) {\ + if (unlikely(value != (func_type) (target_type) value)) {\ + func_type zero = 0;\ + if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ + return (target_type) -1;\ + if (is_unsigned && unlikely(value < zero))\ + goto raise_neg_overflow;\ + else\ + goto raise_overflow;\ + }\ + }\ + return (target_type) value;\ + } + +/* CIntFromPy */ +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { + const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(long) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (long) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (long) 0; + case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0]) + case 2: + if (8 * sizeof(long) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) { + return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + case 3: + if (8 * sizeof(long) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) { + return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + case 4: + if (8 * sizeof(long) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) { + return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (long) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if (sizeof(long) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (long) 0; + case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0])) + case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0]) + case -2: + if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 2: + if (8 * sizeof(long) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case -3: + if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 3: + if (8 * sizeof(long) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case -4: + if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 4: + if (8 * sizeof(long) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + } +#endif + if (sizeof(long) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + long val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (long) -1; + } + } else { + long val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (long) -1; + val = __Pyx_PyInt_As_long(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to long"); + return (long) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to long"); + return (long) -1; +} + +/* CIntFromPy */ +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { + const int neg_one = (int) ((int) 0 - (int) 1), const_zero = (int) 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(int) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (int) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (int) 0; + case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0]) + case 2: + if (8 * sizeof(int) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) { + return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + case 3: + if (8 * sizeof(int) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) { + return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + case 4: + if (8 * sizeof(int) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) { + return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (int) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if (sizeof(int) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (int) 0; + case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0])) + case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0]) + case -2: + if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { + return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 2: + if (8 * sizeof(int) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { + return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case -3: + if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { + return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 3: + if (8 * sizeof(int) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { + return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case -4: + if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { + return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 4: + if (8 * sizeof(int) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { + return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + } +#endif + if (sizeof(int) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + int val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (int) -1; + } + } else { + int val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (int) -1; + val = __Pyx_PyInt_As_int(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to int"); + return (int) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to int"); + return (int) -1; +} + +/* FastTypeChecks */ +#if CYTHON_COMPILING_IN_CPYTHON +static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) { + while (a) { + a = a->tp_base; + if (a == b) + return 1; + } + return b == &PyBaseObject_Type; +} +static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) { + PyObject *mro; + if (a == b) return 1; + mro = a->tp_mro; + if (likely(mro)) { + Py_ssize_t i, n; + n = PyTuple_GET_SIZE(mro); + for (i = 0; i < n; i++) { + if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b) + return 1; + } + return 0; + } + return __Pyx_InBases(a, b); +} +#if PY_MAJOR_VERSION == 2 +static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { + PyObject *exception, *value, *tb; + int res; + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ErrFetch(&exception, &value, &tb); + res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; + if (unlikely(res == -1)) { + PyErr_WriteUnraisable(err); + res = 0; + } + if (!res) { + res = PyObject_IsSubclass(err, exc_type2); + if (unlikely(res == -1)) { + PyErr_WriteUnraisable(err); + res = 0; + } + } + __Pyx_ErrRestore(exception, value, tb); + return res; +} +#else +static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { + int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0; + if (!res) { + res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); + } + return res; +} +#endif +static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { + Py_ssize_t i, n; + assert(PyExceptionClass_Check(exc_type)); + n = PyTuple_GET_SIZE(tuple); +#if PY_MAJOR_VERSION >= 3 + for (i=0; itp_setattro)) + return tp->tp_setattro(obj, attr_name, value); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_setattr)) + return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value); +#endif + return PyObject_SetAttr(obj, attr_name, value); +} +#endif + +/* VoidPtrExport */ +static int __Pyx_ExportVoidPtr(PyObject *name, void *p, const char *sig) { + PyObject *d; + PyObject *cobj = 0; + d = PyDict_GetItem(__pyx_d, __pyx_n_s_pyx_capi); + Py_XINCREF(d); + if (!d) { + d = PyDict_New(); + if (!d) + goto bad; + if (__Pyx_PyObject_SetAttrStr(__pyx_m, __pyx_n_s_pyx_capi, d) < 0) + goto bad; + } +#if PY_VERSION_HEX >= 0x02070000 + cobj = PyCapsule_New(p, sig, 0); +#else + cobj = PyCObject_FromVoidPtrAndDesc(p, (void *)sig, 0); +#endif + if (!cobj) + goto bad; + if (PyDict_SetItem(d, name, cobj) < 0) + goto bad; + Py_DECREF(cobj); + Py_DECREF(d); + return 0; +bad: + Py_XDECREF(cobj); + Py_XDECREF(d); + return -1; +} + +/* VoidPtrImport */ +#ifndef __PYX_HAVE_RT_ImportVoidPtr +#define __PYX_HAVE_RT_ImportVoidPtr +static int __Pyx_ImportVoidPtr(PyObject *module, const char *name, void **p, const char *sig) { + PyObject *d = 0; + PyObject *cobj = 0; + d = PyObject_GetAttrString(module, (char *)"__pyx_capi__"); + if (!d) + goto bad; + cobj = PyDict_GetItemString(d, name); + if (!cobj) { + PyErr_Format(PyExc_ImportError, + "%.200s does not export expected C variable %.200s", + PyModule_GetName(module), name); + goto bad; + } +#if PY_VERSION_HEX >= 0x02070000 + if (!PyCapsule_IsValid(cobj, sig)) { + PyErr_Format(PyExc_TypeError, + "C variable %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", + PyModule_GetName(module), name, sig, PyCapsule_GetName(cobj)); + goto bad; + } + *p = PyCapsule_GetPointer(cobj, sig); +#else + {const char *desc, *s1, *s2; + desc = (const char *)PyCObject_GetDesc(cobj); + if (!desc) + goto bad; + s1 = desc; s2 = sig; + while (*s1 != '\0' && *s1 == *s2) { s1++; s2++; } + if (*s1 != *s2) { + PyErr_Format(PyExc_TypeError, + "C variable %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", + PyModule_GetName(module), name, sig, desc); + goto bad; + } + *p = PyCObject_AsVoidPtr(cobj);} +#endif + if (!(*p)) + goto bad; + Py_DECREF(d); + return 0; +bad: + Py_XDECREF(d); + return -1; +} +#endif + +/* FunctionImport */ +#ifndef __PYX_HAVE_RT_ImportFunction +#define __PYX_HAVE_RT_ImportFunction +static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig) { + PyObject *d = 0; + PyObject *cobj = 0; + union { + void (*fp)(void); + void *p; + } tmp; + d = PyObject_GetAttrString(module, (char *)"__pyx_capi__"); + if (!d) + goto bad; + cobj = PyDict_GetItemString(d, funcname); + if (!cobj) { + PyErr_Format(PyExc_ImportError, + "%.200s does not export expected C function %.200s", + PyModule_GetName(module), funcname); + goto bad; + } +#if PY_VERSION_HEX >= 0x02070000 + if (!PyCapsule_IsValid(cobj, sig)) { + PyErr_Format(PyExc_TypeError, + "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", + PyModule_GetName(module), funcname, sig, PyCapsule_GetName(cobj)); + goto bad; + } + tmp.p = PyCapsule_GetPointer(cobj, sig); +#else + {const char *desc, *s1, *s2; + desc = (const char *)PyCObject_GetDesc(cobj); + if (!desc) + goto bad; + s1 = desc; s2 = sig; + while (*s1 != '\0' && *s1 == *s2) { s1++; s2++; } + if (*s1 != *s2) { + PyErr_Format(PyExc_TypeError, + "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", + PyModule_GetName(module), funcname, sig, desc); + goto bad; + } + tmp.p = PyCObject_AsVoidPtr(cobj);} +#endif + *f = tmp.fp; + if (!(*f)) + goto bad; + Py_DECREF(d); + return 0; +bad: + Py_XDECREF(d); + return -1; +} +#endif + +/* InitStrings */ +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { + while (t->p) { + #if PY_MAJOR_VERSION < 3 + if (t->is_unicode) { + *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); + } else if (t->intern) { + *t->p = PyString_InternFromString(t->s); + } else { + *t->p = PyString_FromStringAndSize(t->s, t->n - 1); + } + #else + if (t->is_unicode | t->is_str) { + if (t->intern) { + *t->p = PyUnicode_InternFromString(t->s); + } else if (t->encoding) { + *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); + } else { + *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); + } + } else { + *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); + } + #endif + if (!*t->p) + return -1; + if (PyObject_Hash(*t->p) == -1) + return -1; + ++t; + } + return 0; +} + +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { + return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); +} +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { + Py_ssize_t ignore; + return __Pyx_PyObject_AsStringAndSize(o, &ignore); +} +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +#if !CYTHON_PEP393_ENABLED +static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { + char* defenc_c; + PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); + if (!defenc) return NULL; + defenc_c = PyBytes_AS_STRING(defenc); +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + { + char* end = defenc_c + PyBytes_GET_SIZE(defenc); + char* c; + for (c = defenc_c; c < end; c++) { + if ((unsigned char) (*c) >= 128) { + PyUnicode_AsASCIIString(o); + return NULL; + } + } + } +#endif + *length = PyBytes_GET_SIZE(defenc); + return defenc_c; +} +#else +static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { + if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + if (likely(PyUnicode_IS_ASCII(o))) { + *length = PyUnicode_GET_LENGTH(o); + return PyUnicode_AsUTF8(o); + } else { + PyUnicode_AsASCIIString(o); + return NULL; + } +#else + return PyUnicode_AsUTF8AndSize(o, length); +#endif +} +#endif +#endif +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT + if ( +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + __Pyx_sys_getdefaultencoding_not_ascii && +#endif + PyUnicode_Check(o)) { + return __Pyx_PyUnicode_AsStringAndSize(o, length); + } else +#endif +#if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) + if (PyByteArray_Check(o)) { + *length = PyByteArray_GET_SIZE(o); + return PyByteArray_AS_STRING(o); + } else +#endif + { + char* result; + int r = PyBytes_AsStringAndSize(o, &result, length); + if (unlikely(r < 0)) { + return NULL; + } else { + return result; + } + } +} +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { + int is_true = x == Py_True; + if (is_true | (x == Py_False) | (x == Py_None)) return is_true; + else return PyObject_IsTrue(x); +} +static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) { + int retval; + if (unlikely(!x)) return -1; + retval = __Pyx_PyObject_IsTrue(x); + Py_DECREF(x); + return retval; +} +static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) { +#if PY_MAJOR_VERSION >= 3 + if (PyLong_Check(result)) { + if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, + "__int__ returned non-int (type %.200s). " + "The ability to return an instance of a strict subclass of int " + "is deprecated, and may be removed in a future version of Python.", + Py_TYPE(result)->tp_name)) { + Py_DECREF(result); + return NULL; + } + return result; + } +#endif + PyErr_Format(PyExc_TypeError, + "__%.4s__ returned non-%.4s (type %.200s)", + type_name, type_name, Py_TYPE(result)->tp_name); + Py_DECREF(result); + return NULL; +} +static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { +#if CYTHON_USE_TYPE_SLOTS + PyNumberMethods *m; +#endif + const char *name = NULL; + PyObject *res = NULL; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x) || PyLong_Check(x))) +#else + if (likely(PyLong_Check(x))) +#endif + return __Pyx_NewRef(x); +#if CYTHON_USE_TYPE_SLOTS + m = Py_TYPE(x)->tp_as_number; + #if PY_MAJOR_VERSION < 3 + if (m && m->nb_int) { + name = "int"; + res = m->nb_int(x); + } + else if (m && m->nb_long) { + name = "long"; + res = m->nb_long(x); + } + #else + if (likely(m && m->nb_int)) { + name = "int"; + res = m->nb_int(x); + } + #endif +#else + if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { + res = PyNumber_Int(x); + } +#endif + if (likely(res)) { +#if PY_MAJOR_VERSION < 3 + if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) { +#else + if (unlikely(!PyLong_CheckExact(res))) { +#endif + return __Pyx_PyNumber_IntOrLongWrongResultType(res, name); + } + } + else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_TypeError, + "an integer is required"); + } + return res; +} +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { + Py_ssize_t ival; + PyObject *x; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_CheckExact(b))) { + if (sizeof(Py_ssize_t) >= sizeof(long)) + return PyInt_AS_LONG(b); + else + return PyInt_AsSsize_t(b); + } +#endif + if (likely(PyLong_CheckExact(b))) { + #if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)b)->ob_digit; + const Py_ssize_t size = Py_SIZE(b); + if (likely(__Pyx_sst_abs(size) <= 1)) { + ival = likely(size) ? digits[0] : 0; + if (size == -1) ival = -ival; + return ival; + } else { + switch (size) { + case 2: + if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { + return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -2: + if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case 3: + if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { + return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -3: + if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case 4: + if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { + return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -4: + if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + } + } + #endif + return PyLong_AsSsize_t(b); + } + x = PyNumber_Index(b); + if (!x) return -1; + ival = PyInt_AsSsize_t(x); + Py_DECREF(x); + return ival; +} +static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) { + return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False); +} +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { + return PyInt_FromSize_t(ival); +} + + +#endif /* Py_PYTHON_H */ diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_waiter.html b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_waiter.html new file mode 100644 index 00000000..20988936 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_waiter.html @@ -0,0 +1,2281 @@ + + + + + + Cython: _waiter.py + + + +

Generated by Cython 0.29.2

+

+ Yellow lines hint at Python interaction.
+ Click on a line that starts with a "+" to see the C code that Cython generated for it. +

+

Raw output: _waiter.c

+
+001: # -*- coding: utf-8 -*-
+
  __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 002: # copyright 2018 gevent
+
 003: # cython: auto_pickle=False,embedsignature=True,always_allow_keywords=False
+
 004: """
+
 005: Low-level waiting primitives.
+
 006: 
+
 007: """
+
 008: from __future__ import absolute_import
+
 009: from __future__ import division
+
 010: from __future__ import print_function
+
 011: 
+
+012: import sys
+
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_sys, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 12, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_XGOTREF(__pyx_v_6gevent_8__waiter_sys);
+  __Pyx_DECREF_SET(__pyx_v_6gevent_8__waiter_sys, __pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_1);
+  __pyx_t_1 = 0;
+
 013: 
+
+014: from gevent._hub_local import get_hub_noargs as get_hub
+
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 14, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(__pyx_n_s_get_hub_noargs);
+  __Pyx_GIVEREF(__pyx_n_s_get_hub_noargs);
+  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_get_hub_noargs);
+  __pyx_t_2 = __Pyx_Import(__pyx_n_s_gevent__hub_local, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 14, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_get_hub_noargs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 14, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_hub_noargs, __pyx_t_1) < 0) __PYX_ERR(0, 14, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+015: from gevent.exceptions import ConcurrentObjectUseError
+
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 15, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_ConcurrentObjectUseError);
+  __Pyx_GIVEREF(__pyx_n_s_ConcurrentObjectUseError);
+  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_ConcurrentObjectUseError);
+  __pyx_t_1 = __Pyx_Import(__pyx_n_s_gevent_exceptions, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 15, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_ConcurrentObjectUseError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 15, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(__pyx_t_2);
+  __Pyx_XGOTREF(__pyx_v_6gevent_8__waiter_ConcurrentObjectUseError);
+  __Pyx_DECREF_SET(__pyx_v_6gevent_8__waiter_ConcurrentObjectUseError, __pyx_t_2);
+  __Pyx_GIVEREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 016: 
+
+017: __all__ = [
+
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 17, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(__pyx_n_s_Waiter);
+  __Pyx_GIVEREF(__pyx_n_s_Waiter);
+  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_Waiter);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_all, __pyx_t_1) < 0) __PYX_ERR(0, 17, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 018:     'Waiter',
+
 019: ]
+
 020: 
+
+021: _NONE = object()
+
  __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_builtin_object); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 21, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_XGOTREF(__pyx_v_6gevent_8__waiter__NONE);
+  __Pyx_DECREF_SET(__pyx_v_6gevent_8__waiter__NONE, __pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_1);
+  __pyx_t_1 = 0;
+
 022: 
+
+023: locals()['getcurrent'] = __import__('greenlet').getcurrent
+
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin___import__, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 23, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_getcurrent); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 23, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_1 = __Pyx_Globals(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 23, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (unlikely(PyDict_SetItem(__pyx_t_1, __pyx_n_s_getcurrent, __pyx_t_2) < 0)) __PYX_ERR(0, 23, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+/* … */
+  __pyx_tuple__2 = PyTuple_Pack(1, __pyx_n_s_greenlet); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 23, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__2);
+  __Pyx_GIVEREF(__pyx_tuple__2);
+
+024: locals()['greenlet_init'] = lambda: None
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_8__waiter_2lambda(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyMethodDef __pyx_mdef_6gevent_8__waiter_2lambda = {"lambda", (PyCFunction)__pyx_pw_6gevent_8__waiter_2lambda, METH_NOARGS, 0};
+static PyObject *__pyx_pw_6gevent_8__waiter_2lambda(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("lambda (wrapper)", 0);
+  __pyx_r = __pyx_lambda_funcdef_6gevent_8__waiter_lambda(__pyx_self);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_lambda_funcdef_6gevent_8__waiter_lambda(CYTHON_UNUSED PyObject *__pyx_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("lambda", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_8__waiter_2lambda, 0, __pyx_n_s_lambda, NULL, __pyx_n_s_gevent___waiter, __pyx_d, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 24, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_1 = __Pyx_Globals(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 24, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (unlikely(PyDict_SetItem(__pyx_t_1, __pyx_n_s_greenlet_init, __pyx_t_2) < 0)) __PYX_ERR(0, 24, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
 025: 
+
 026: 
+
+027: class Waiter(object):
+
struct __pyx_vtabstruct_6gevent_8__waiter_Waiter {
+  PyObject *(*get)(struct __pyx_obj_6gevent_8__waiter_Waiter *, int __pyx_skip_dispatch);
+  PyObject *(*clear)(struct __pyx_obj_6gevent_8__waiter_Waiter *, int __pyx_skip_dispatch);
+};
+static struct __pyx_vtabstruct_6gevent_8__waiter_Waiter *__pyx_vtabptr_6gevent_8__waiter_Waiter;
+
+
 028:     """
+
 029:     A low level communication utility for greenlets.
+
 030: 
+
 031:     Waiter is a wrapper around greenlet's ``switch()`` and ``throw()`` calls that makes them somewhat safer:
+
 032: 
+
 033:     * switching will occur only if the waiting greenlet is executing :meth:`get` method currently;
+
 034:     * any error raised in the greenlet is handled inside :meth:`switch` and :meth:`throw`
+
 035:     * if :meth:`switch`/:meth:`throw` is called before the receiver calls :meth:`get`, then :class:`Waiter`
+
 036:       will store the value/exception. The following :meth:`get` will return the value/raise the exception.
+
 037: 
+
 038:     The :meth:`switch` and :meth:`throw` methods must only be called from the :class:`Hub` greenlet.
+
 039:     The :meth:`get` method must be called from a greenlet other than :class:`Hub`.
+
 040: 
+
 041:         >>> result = Waiter()
+
 042:         >>> timer = get_hub().loop.timer(0.1)
+
 043:         >>> timer.start(result.switch, 'hello from Waiter')
+
 044:         >>> result.get() # blocks for 0.1 seconds
+
 045:         'hello from Waiter'
+
 046:         >>> timer.close()
+
 047: 
+
 048:     If switch is called before the greenlet gets a chance to call :meth:`get` then
+
 049:     :class:`Waiter` stores the value.
+
 050: 
+
 051:         >>> result = Waiter()
+
 052:         >>> timer = get_hub().loop.timer(0.1)
+
 053:         >>> timer.start(result.switch, 'hi from Waiter')
+
 054:         >>> sleep(0.2)
+
 055:         >>> result.get() # returns immediately without blocking
+
 056:         'hi from Waiter'
+
 057:         >>> timer.close()
+
 058: 
+
 059:     .. warning::
+
 060: 
+
 061:         This a limited and dangerous way to communicate between
+
 062:         greenlets. It can easily leave a greenlet unscheduled forever
+
 063:         if used incorrectly. Consider using safer classes such as
+
 064:         :class:`gevent.event.Event`, :class:`gevent.event.AsyncResult`,
+
 065:         or :class:`gevent.queue.Queue`.
+
 066:     """
+
 067: 
+
+068:     __slots__ = ['hub', 'greenlet', 'value', '_exception']
+
  __pyx_t_2 = PyList_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 68, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_hub);
+  __Pyx_GIVEREF(__pyx_n_s_hub);
+  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_hub);
+  __Pyx_INCREF(__pyx_n_s_greenlet);
+  __Pyx_GIVEREF(__pyx_n_s_greenlet);
+  PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_greenlet);
+  __Pyx_INCREF(__pyx_n_s_value);
+  __Pyx_GIVEREF(__pyx_n_s_value);
+  PyList_SET_ITEM(__pyx_t_2, 2, __pyx_n_s_value);
+  __Pyx_INCREF(__pyx_n_s_exception_2);
+  __Pyx_GIVEREF(__pyx_n_s_exception_2);
+  PyList_SET_ITEM(__pyx_t_2, 3, __pyx_n_s_exception_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_8__waiter_Waiter->tp_dict, __pyx_n_s_slots, __pyx_t_2) < 0) __PYX_ERR(0, 68, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_8__waiter_Waiter);
+
 069: 
+
+070:     def __init__(self, hub=None):
+
/* Python wrapper */
+static int __pyx_pw_6gevent_8__waiter_6Waiter_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static int __pyx_pw_6gevent_8__waiter_6Waiter_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_hub = 0;
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_hub,0};
+    PyObject* values[1] = {0};
+    values[0] = ((PyObject *)Py_None);
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_hub);
+          if (value) { values[0] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 70, __pyx_L3_error)
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    __pyx_v_hub = values[0];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 70, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.__waiter.Waiter.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return -1;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_8__waiter_6Waiter___init__(((struct __pyx_obj_6gevent_8__waiter_Waiter *)__pyx_v_self), __pyx_v_hub);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_8__waiter_6Waiter___init__(struct __pyx_obj_6gevent_8__waiter_Waiter *__pyx_v_self, PyObject *__pyx_v_hub) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = 0;
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_AddTraceback("gevent.__waiter.Waiter.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = -1;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+071:         self.hub = get_hub() if hub is None else hub
+
  __pyx_t_2 = (__pyx_v_hub == Py_None);
+  if ((__pyx_t_2 != 0)) {
+    __pyx_t_3 = ((PyObject *)__pyx_f_6gevent_11__hub_local_get_hub_noargs(0)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 71, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __pyx_t_1 = __pyx_t_3;
+    __pyx_t_3 = 0;
+  } else {
+    if (!(likely(((__pyx_v_hub) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_hub, __pyx_ptype_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop))))) __PYX_ERR(0, 71, __pyx_L1_error)
+    __Pyx_INCREF(__pyx_v_hub);
+    __pyx_t_1 = __pyx_v_hub;
+  }
+  __Pyx_GIVEREF(__pyx_t_1);
+  __Pyx_GOTREF(__pyx_v_self->hub);
+  __Pyx_DECREF(((PyObject *)__pyx_v_self->hub));
+  __pyx_v_self->hub = ((struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *)__pyx_t_1);
+  __pyx_t_1 = 0;
+
+072:         self.greenlet = None
+
  __Pyx_INCREF(Py_None);
+  __Pyx_GIVEREF(Py_None);
+  __Pyx_GOTREF(__pyx_v_self->greenlet);
+  __Pyx_DECREF(((PyObject *)__pyx_v_self->greenlet));
+  __pyx_v_self->greenlet = ((PyGreenlet *)Py_None);
+
+073:         self.value = None
+
  __Pyx_INCREF(Py_None);
+  __Pyx_GIVEREF(Py_None);
+  __Pyx_GOTREF(__pyx_v_self->value);
+  __Pyx_DECREF(__pyx_v_self->value);
+  __pyx_v_self->value = Py_None;
+
+074:         self._exception = _NONE
+
  __Pyx_INCREF(__pyx_v_6gevent_8__waiter__NONE);
+  __Pyx_GIVEREF(__pyx_v_6gevent_8__waiter__NONE);
+  __Pyx_GOTREF(__pyx_v_self->_exception);
+  __Pyx_DECREF(__pyx_v_self->_exception);
+  __pyx_v_self->_exception = __pyx_v_6gevent_8__waiter__NONE;
+
 075: 
+
+076:     def clear(self):
+
static PyObject *__pyx_pw_6gevent_8__waiter_6Waiter_3clear(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyObject *__pyx_f_6gevent_8__waiter_6Waiter_clear(struct __pyx_obj_6gevent_8__waiter_Waiter *__pyx_v_self, int __pyx_skip_dispatch) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("clear", 0);
+  /* Check if called by wrapper */
+  if (unlikely(__pyx_skip_dispatch)) ;
+  /* Check if overridden in Python */
+  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
+    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
+    if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
+    else {
+      PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      #endif
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_clear); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 76, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_8__waiter_6Waiter_3clear)) {
+        __Pyx_XDECREF(__pyx_r);
+        __Pyx_INCREF(__pyx_t_1);
+        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+          if (likely(__pyx_t_4)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+            __Pyx_INCREF(__pyx_t_4);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_3, function);
+          }
+        }
+        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
+        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 76, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __pyx_r = __pyx_t_2;
+        __pyx_t_2 = 0;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        goto __pyx_L0;
+      }
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+      tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
+      if (unlikely(type_dict_guard != tp_dict_version)) {
+        tp_dict_version = obj_dict_version = 0;
+      }
+      #endif
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    }
+    #endif
+  }
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_AddTraceback("gevent.__waiter.Waiter.clear", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_8__waiter_6Waiter_3clear(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6gevent_8__waiter_6Waiter_2clear[] = "Waiter.clear(self)";
+static PyMethodDef __pyx_mdef_6gevent_8__waiter_6Waiter_3clear = {"clear", (PyCFunction)__pyx_pw_6gevent_8__waiter_6Waiter_3clear, METH_NOARGS, __pyx_doc_6gevent_8__waiter_6Waiter_2clear};
+static PyObject *__pyx_pw_6gevent_8__waiter_6Waiter_3clear(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("clear (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_8__waiter_6Waiter_2clear(((struct __pyx_obj_6gevent_8__waiter_Waiter *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_8__waiter_6Waiter_2clear(struct __pyx_obj_6gevent_8__waiter_Waiter *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("clear", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __pyx_f_6gevent_8__waiter_6Waiter_clear(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 76, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.__waiter.Waiter.clear", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__3 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 76, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__3);
+  __Pyx_GIVEREF(__pyx_tuple__3);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_8__waiter_6Waiter_3clear, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Waiter_clear, NULL, __pyx_n_s_gevent___waiter, __pyx_d, ((PyObject *)__pyx_codeobj__4)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 76, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_8__waiter_Waiter->tp_dict, __pyx_n_s_clear, __pyx_t_2) < 0) __PYX_ERR(0, 76, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_8__waiter_Waiter);
+  __pyx_codeobj__4 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__3, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__waiter_py, __pyx_n_s_clear, 76, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__4)) __PYX_ERR(0, 76, __pyx_L1_error)
+
+077:         self.greenlet = None
+
  __Pyx_INCREF(Py_None);
+  __Pyx_GIVEREF(Py_None);
+  __Pyx_GOTREF(__pyx_v_self->greenlet);
+  __Pyx_DECREF(((PyObject *)__pyx_v_self->greenlet));
+  __pyx_v_self->greenlet = ((PyGreenlet *)Py_None);
+
+078:         self.value = None
+
  __Pyx_INCREF(Py_None);
+  __Pyx_GIVEREF(Py_None);
+  __Pyx_GOTREF(__pyx_v_self->value);
+  __Pyx_DECREF(__pyx_v_self->value);
+  __pyx_v_self->value = Py_None;
+
+079:         self._exception = _NONE
+
  __Pyx_INCREF(__pyx_v_6gevent_8__waiter__NONE);
+  __Pyx_GIVEREF(__pyx_v_6gevent_8__waiter__NONE);
+  __Pyx_GOTREF(__pyx_v_self->_exception);
+  __Pyx_DECREF(__pyx_v_self->_exception);
+  __pyx_v_self->_exception = __pyx_v_6gevent_8__waiter__NONE;
+
 080: 
+
+081:     def __str__(self):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_8__waiter_6Waiter_5__str__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_8__waiter_6Waiter_5__str__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_8__waiter_6Waiter_4__str__(((struct __pyx_obj_6gevent_8__waiter_Waiter *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_8__waiter_6Waiter_4__str__(struct __pyx_obj_6gevent_8__waiter_Waiter *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__str__", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_AddTraceback("gevent.__waiter.Waiter.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+082:         if self._exception is _NONE:
+
  __pyx_t_1 = (__pyx_v_self->_exception == __pyx_v_6gevent_8__waiter__NONE);
+  __pyx_t_2 = (__pyx_t_1 != 0);
+  if (__pyx_t_2) {
+/* … */
+  }
+
+083:             return '<%s greenlet=%s>' % (type(self).__name__, self.greenlet)
+
    __Pyx_XDECREF(__pyx_r);
+    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))), __pyx_n_s_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 83, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 83, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_GIVEREF(__pyx_t_3);
+    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
+    __Pyx_INCREF(((PyObject *)__pyx_v_self->greenlet));
+    __Pyx_GIVEREF(((PyObject *)__pyx_v_self->greenlet));
+    PyTuple_SET_ITEM(__pyx_t_4, 1, ((PyObject *)__pyx_v_self->greenlet));
+    __pyx_t_3 = 0;
+    __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_s_greenlet_s, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 83, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __pyx_r = __pyx_t_3;
+    __pyx_t_3 = 0;
+    goto __pyx_L0;
+
+084:         if self._exception is None:
+
  __pyx_t_2 = (__pyx_v_self->_exception == Py_None);
+  __pyx_t_1 = (__pyx_t_2 != 0);
+  if (__pyx_t_1) {
+/* … */
+  }
+
+085:             return '<%s greenlet=%s value=%r>' % (type(self).__name__, self.greenlet, self.value)
+
    __Pyx_XDECREF(__pyx_r);
+    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))), __pyx_n_s_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 85, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 85, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_GIVEREF(__pyx_t_3);
+    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
+    __Pyx_INCREF(((PyObject *)__pyx_v_self->greenlet));
+    __Pyx_GIVEREF(((PyObject *)__pyx_v_self->greenlet));
+    PyTuple_SET_ITEM(__pyx_t_4, 1, ((PyObject *)__pyx_v_self->greenlet));
+    __Pyx_INCREF(__pyx_v_self->value);
+    __Pyx_GIVEREF(__pyx_v_self->value);
+    PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_self->value);
+    __pyx_t_3 = 0;
+    __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_s_greenlet_s_value_r, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 85, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __pyx_r = __pyx_t_3;
+    __pyx_t_3 = 0;
+    goto __pyx_L0;
+
+086:         return '<%s greenlet=%s exc_info=%r>' % (type(self).__name__, self.greenlet, self.exc_info)
+
  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))), __pyx_n_s_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 86, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_exc_info); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 86, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_4);
+  __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 86, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_5);
+  __Pyx_GIVEREF(__pyx_t_3);
+  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3);
+  __Pyx_INCREF(((PyObject *)__pyx_v_self->greenlet));
+  __Pyx_GIVEREF(((PyObject *)__pyx_v_self->greenlet));
+  PyTuple_SET_ITEM(__pyx_t_5, 1, ((PyObject *)__pyx_v_self->greenlet));
+  __Pyx_GIVEREF(__pyx_t_4);
+  PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_4);
+  __pyx_t_3 = 0;
+  __pyx_t_4 = 0;
+  __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_s_greenlet_s_exc_info_r, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 86, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_4);
+  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+  __pyx_r = __pyx_t_4;
+  __pyx_t_4 = 0;
+  goto __pyx_L0;
+
 087: 
+
+088:     def ready(self):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_8__waiter_6Waiter_7ready(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6gevent_8__waiter_6Waiter_6ready[] = "Waiter.ready(self)\nReturn true if and only if it holds a value or an exception";
+static PyMethodDef __pyx_mdef_6gevent_8__waiter_6Waiter_7ready = {"ready", (PyCFunction)__pyx_pw_6gevent_8__waiter_6Waiter_7ready, METH_NOARGS, __pyx_doc_6gevent_8__waiter_6Waiter_6ready};
+static PyObject *__pyx_pw_6gevent_8__waiter_6Waiter_7ready(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("ready (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_8__waiter_6Waiter_6ready(((struct __pyx_obj_6gevent_8__waiter_Waiter *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_8__waiter_6Waiter_6ready(struct __pyx_obj_6gevent_8__waiter_Waiter *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("ready", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_AddTraceback("gevent.__waiter.Waiter.ready", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__5 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 88, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__5);
+  __Pyx_GIVEREF(__pyx_tuple__5);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_8__waiter_6Waiter_7ready, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Waiter_ready, NULL, __pyx_n_s_gevent___waiter, __pyx_d, ((PyObject *)__pyx_codeobj__6)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 88, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_8__waiter_Waiter->tp_dict, __pyx_n_s_ready, __pyx_t_2) < 0) __PYX_ERR(0, 88, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_8__waiter_Waiter);
+  __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__5, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__waiter_py, __pyx_n_s_ready, 88, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__6)) __PYX_ERR(0, 88, __pyx_L1_error)
+
 089:         """Return true if and only if it holds a value or an exception"""
+
+090:         return self._exception is not _NONE
+
  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = (__pyx_v_self->_exception != __pyx_v_6gevent_8__waiter__NONE);
+  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 90, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_r = __pyx_t_2;
+  __pyx_t_2 = 0;
+  goto __pyx_L0;
+
 091: 
+
+092:     def successful(self):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_8__waiter_6Waiter_9successful(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6gevent_8__waiter_6Waiter_8successful[] = "Waiter.successful(self)\nReturn true if and only if it is ready and holds a value";
+static PyMethodDef __pyx_mdef_6gevent_8__waiter_6Waiter_9successful = {"successful", (PyCFunction)__pyx_pw_6gevent_8__waiter_6Waiter_9successful, METH_NOARGS, __pyx_doc_6gevent_8__waiter_6Waiter_8successful};
+static PyObject *__pyx_pw_6gevent_8__waiter_6Waiter_9successful(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("successful (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_8__waiter_6Waiter_8successful(((struct __pyx_obj_6gevent_8__waiter_Waiter *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_8__waiter_6Waiter_8successful(struct __pyx_obj_6gevent_8__waiter_Waiter *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("successful", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_AddTraceback("gevent.__waiter.Waiter.successful", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__7 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 92, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__7);
+  __Pyx_GIVEREF(__pyx_tuple__7);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_8__waiter_6Waiter_9successful, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Waiter_successful, NULL, __pyx_n_s_gevent___waiter, __pyx_d, ((PyObject *)__pyx_codeobj__8)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 92, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_8__waiter_Waiter->tp_dict, __pyx_n_s_successful, __pyx_t_2) < 0) __PYX_ERR(0, 92, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_8__waiter_Waiter);
+  __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__waiter_py, __pyx_n_s_successful, 92, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) __PYX_ERR(0, 92, __pyx_L1_error)
+
 093:         """Return true if and only if it is ready and holds a value"""
+
+094:         return self._exception is None
+
  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = (__pyx_v_self->_exception == Py_None);
+  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 94, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_r = __pyx_t_2;
+  __pyx_t_2 = 0;
+  goto __pyx_L0;
+
 095: 
+
 096:     @property
+
+097:     def exc_info(self):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_8__waiter_6Waiter_8exc_info_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_8__waiter_6Waiter_8exc_info_1__get__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_8__waiter_6Waiter_8exc_info___get__(((struct __pyx_obj_6gevent_8__waiter_Waiter *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_8__waiter_6Waiter_8exc_info___get__(struct __pyx_obj_6gevent_8__waiter_Waiter *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
 098:         "Holds the exception info passed to :meth:`throw` if :meth:`throw` was called. Otherwise ``None``."
+
+099:         if self._exception is not _NONE:
+
  __pyx_t_1 = (__pyx_v_self->_exception != __pyx_v_6gevent_8__waiter__NONE);
+  __pyx_t_2 = (__pyx_t_1 != 0);
+  if (__pyx_t_2) {
+/* … */
+  }
+
+100:             return self._exception
+
    __Pyx_XDECREF(__pyx_r);
+    __Pyx_INCREF(__pyx_v_self->_exception);
+    __pyx_r = __pyx_v_self->_exception;
+    goto __pyx_L0;
+
 101: 
+
+102:     def switch(self, value):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_8__waiter_6Waiter_11switch(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
+static char __pyx_doc_6gevent_8__waiter_6Waiter_10switch[] = "Waiter.switch(self, value)\n\n        Switch to the greenlet if one's available. Otherwise store the\n        *value*.\n\n        .. versionchanged:: 1.3b1\n           The *value* is no longer optional.\n        ";
+static PyMethodDef __pyx_mdef_6gevent_8__waiter_6Waiter_11switch = {"switch", (PyCFunction)__pyx_pw_6gevent_8__waiter_6Waiter_11switch, METH_O, __pyx_doc_6gevent_8__waiter_6Waiter_10switch};
+static PyObject *__pyx_pw_6gevent_8__waiter_6Waiter_11switch(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("switch (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_8__waiter_6Waiter_10switch(((struct __pyx_obj_6gevent_8__waiter_Waiter *)__pyx_v_self), ((PyObject *)__pyx_v_value));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_8__waiter_6Waiter_10switch(struct __pyx_obj_6gevent_8__waiter_Waiter *__pyx_v_self, PyObject *__pyx_v_value) {
+  PyGreenlet *__pyx_v_greenlet = NULL;
+  PyObject *__pyx_v_switch = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("switch", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_7);
+  __Pyx_XDECREF(__pyx_t_8);
+  __Pyx_XDECREF(__pyx_t_9);
+  __Pyx_XDECREF(__pyx_t_10);
+  __Pyx_XDECREF(__pyx_t_11);
+  __Pyx_XDECREF(__pyx_t_12);
+  __Pyx_XDECREF(__pyx_t_13);
+  __Pyx_AddTraceback("gevent.__waiter.Waiter.switch", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XDECREF((PyObject *)__pyx_v_greenlet);
+  __Pyx_XDECREF(__pyx_v_switch);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__9 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_value, __pyx_n_s_greenlet, __pyx_n_s_switch); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 102, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__9);
+  __Pyx_GIVEREF(__pyx_tuple__9);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_8__waiter_6Waiter_11switch, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Waiter_switch, NULL, __pyx_n_s_gevent___waiter, __pyx_d, ((PyObject *)__pyx_codeobj__10)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 102, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_8__waiter_Waiter->tp_dict, __pyx_n_s_switch, __pyx_t_2) < 0) __PYX_ERR(0, 102, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_8__waiter_Waiter);
+  __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__9, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__waiter_py, __pyx_n_s_switch, 102, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__10)) __PYX_ERR(0, 102, __pyx_L1_error)
+
 103:         """
+
 104:         Switch to the greenlet if one's available. Otherwise store the
+
 105:         *value*.
+
 106: 
+
 107:         .. versionchanged:: 1.3b1
+
 108:            The *value* is no longer optional.
+
 109:         """
+
+110:         greenlet = self.greenlet
+
  __pyx_t_1 = ((PyObject *)__pyx_v_self->greenlet);
+  __Pyx_INCREF(__pyx_t_1);
+  __pyx_v_greenlet = ((PyGreenlet *)__pyx_t_1);
+  __pyx_t_1 = 0;
+
+111:         if greenlet is None:
+
  __pyx_t_2 = (((PyObject *)__pyx_v_greenlet) == Py_None);
+  __pyx_t_3 = (__pyx_t_2 != 0);
+  if (__pyx_t_3) {
+/* … */
+    goto __pyx_L3;
+  }
+
+112:             self.value = value
+
    __Pyx_INCREF(__pyx_v_value);
+    __Pyx_GIVEREF(__pyx_v_value);
+    __Pyx_GOTREF(__pyx_v_self->value);
+    __Pyx_DECREF(__pyx_v_self->value);
+    __pyx_v_self->value = __pyx_v_value;
+
+113:             self._exception = None
+
    __Pyx_INCREF(Py_None);
+    __Pyx_GIVEREF(Py_None);
+    __Pyx_GOTREF(__pyx_v_self->_exception);
+    __Pyx_DECREF(__pyx_v_self->_exception);
+    __pyx_v_self->_exception = Py_None;
+
 114:         else:
+
+115:             if getcurrent() is not self.hub: # pylint:disable=undefined-variable
+
  /*else*/ {
+    __pyx_t_1 = ((PyObject *)__pyx_f_6gevent_8__waiter_getcurrent()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 115, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __pyx_t_3 = (__pyx_t_1 != ((PyObject *)__pyx_v_self->hub));
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __pyx_t_2 = (__pyx_t_3 != 0);
+    if (unlikely(__pyx_t_2)) {
+/* … */
+    }
+
+116:                 raise AssertionError("Can only use Waiter.switch method from the Hub greenlet")
+
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_AssertionError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 116, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      __Pyx_Raise(__pyx_t_1, 0, 0, 0);
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      __PYX_ERR(0, 116, __pyx_L1_error)
+/* … */
+  __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_Can_only_use_Waiter_switch_metho); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 116, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple_);
+  __Pyx_GIVEREF(__pyx_tuple_);
+
+117:             switch = greenlet.switch
+
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_greenlet), __pyx_n_s_switch); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 117, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __pyx_v_switch = __pyx_t_1;
+    __pyx_t_1 = 0;
+
+118:             try:
+
    {
+      /*try:*/ {
+/* … */
+      }
+      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+      goto __pyx_L10_try_end;
+      __pyx_L5_error:;
+      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
+      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+/* … */
+      __Pyx_XGIVEREF(__pyx_t_4);
+      __Pyx_XGIVEREF(__pyx_t_5);
+      __Pyx_XGIVEREF(__pyx_t_6);
+      __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
+      goto __pyx_L1_error;
+      __pyx_L6_exception_handled:;
+      __Pyx_XGIVEREF(__pyx_t_4);
+      __Pyx_XGIVEREF(__pyx_t_5);
+      __Pyx_XGIVEREF(__pyx_t_6);
+      __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
+      __pyx_L10_try_end:;
+    }
+  }
+  __pyx_L3:;
+
+119:                 switch(value)
+
        __Pyx_INCREF(__pyx_v_switch);
+        __pyx_t_7 = __pyx_v_switch; __pyx_t_8 = NULL;
+        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
+          __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
+          if (likely(__pyx_t_8)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
+            __Pyx_INCREF(__pyx_t_8);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_7, function);
+          }
+        }
+        __pyx_t_1 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_8, __pyx_v_value) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_value);
+        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
+        if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 119, __pyx_L5_error)
+        __Pyx_GOTREF(__pyx_t_1);
+        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+120:             except: # pylint:disable=bare-except
+
      /*except:*/ {
+        __Pyx_AddTraceback("gevent.__waiter.Waiter.switch", __pyx_clineno, __pyx_lineno, __pyx_filename);
+        if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(0, 120, __pyx_L7_except_error)
+        __Pyx_GOTREF(__pyx_t_1);
+        __Pyx_GOTREF(__pyx_t_7);
+        __Pyx_GOTREF(__pyx_t_8);
+
+121:                 self.hub.handle_error(switch, *sys.exc_info())
+
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->hub), __pyx_n_s_handle_error); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 121, __pyx_L7_except_error)
+        __Pyx_GOTREF(__pyx_t_9);
+        __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 121, __pyx_L7_except_error)
+        __Pyx_GOTREF(__pyx_t_10);
+        __Pyx_INCREF(__pyx_v_switch);
+        __Pyx_GIVEREF(__pyx_v_switch);
+        PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v_switch);
+        __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_6gevent_8__waiter_sys, __pyx_n_s_exc_info); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 121, __pyx_L7_except_error)
+        __Pyx_GOTREF(__pyx_t_12);
+        __pyx_t_13 = NULL;
+        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) {
+          __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_12);
+          if (likely(__pyx_t_13)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
+            __Pyx_INCREF(__pyx_t_13);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_12, function);
+          }
+        }
+        __pyx_t_11 = (__pyx_t_13) ? __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_13) : __Pyx_PyObject_CallNoArg(__pyx_t_12);
+        __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
+        if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 121, __pyx_L7_except_error)
+        __Pyx_GOTREF(__pyx_t_11);
+        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
+        __pyx_t_12 = __Pyx_PySequence_Tuple(__pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 121, __pyx_L7_except_error)
+        __Pyx_GOTREF(__pyx_t_12);
+        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+        __pyx_t_11 = PyNumber_Add(__pyx_t_10, __pyx_t_12); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 121, __pyx_L7_except_error)
+        __Pyx_GOTREF(__pyx_t_11);
+        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
+        __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_11, NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 121, __pyx_L7_except_error)
+        __Pyx_GOTREF(__pyx_t_12);
+        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
+        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
+        goto __pyx_L6_exception_handled;
+      }
+      __pyx_L7_except_error:;
+
 122: 
+
+123:     def switch_args(self, *args):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_8__waiter_6Waiter_13switch_args(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_6gevent_8__waiter_6Waiter_12switch_args[] = "Waiter.switch_args(self, *args)";
+static PyMethodDef __pyx_mdef_6gevent_8__waiter_6Waiter_13switch_args = {"switch_args", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_8__waiter_6Waiter_13switch_args, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_8__waiter_6Waiter_12switch_args};
+static PyObject *__pyx_pw_6gevent_8__waiter_6Waiter_13switch_args(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_args = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("switch_args (wrapper)", 0);
+  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "switch_args", 0))) return NULL;
+  __Pyx_INCREF(__pyx_args);
+  __pyx_v_args = __pyx_args;
+  __pyx_r = __pyx_pf_6gevent_8__waiter_6Waiter_12switch_args(((struct __pyx_obj_6gevent_8__waiter_Waiter *)__pyx_v_self), __pyx_v_args);
+
+  /* function exit code */
+  __Pyx_XDECREF(__pyx_v_args);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_8__waiter_6Waiter_12switch_args(struct __pyx_obj_6gevent_8__waiter_Waiter *__pyx_v_self, PyObject *__pyx_v_args) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("switch_args", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_AddTraceback("gevent.__waiter.Waiter.switch_args", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__11 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_args); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 123, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__11);
+  __Pyx_GIVEREF(__pyx_tuple__11);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_8__waiter_6Waiter_13switch_args, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Waiter_switch_args, NULL, __pyx_n_s_gevent___waiter, __pyx_d, ((PyObject *)__pyx_codeobj__12)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 123, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_8__waiter_Waiter->tp_dict, __pyx_n_s_switch_args, __pyx_t_2) < 0) __PYX_ERR(0, 123, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_8__waiter_Waiter);
+  __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__11, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__waiter_py, __pyx_n_s_switch_args, 123, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(0, 123, __pyx_L1_error)
+
+124:         return self.switch(args)
+
  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_switch); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 124, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = NULL;
+  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+    if (likely(__pyx_t_3)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+      __Pyx_INCREF(__pyx_t_3);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_2, function);
+    }
+  }
+  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_args) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_args);
+  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 124, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
 125: 
+
+126:     def throw(self, *throw_args):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_8__waiter_6Waiter_15throw(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_6gevent_8__waiter_6Waiter_14throw[] = "Waiter.throw(self, *throw_args)\nSwitch to the greenlet with the exception. If there's no greenlet, store the exception.";
+static PyMethodDef __pyx_mdef_6gevent_8__waiter_6Waiter_15throw = {"throw", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_8__waiter_6Waiter_15throw, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_8__waiter_6Waiter_14throw};
+static PyObject *__pyx_pw_6gevent_8__waiter_6Waiter_15throw(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_throw_args = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("throw (wrapper)", 0);
+  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "throw", 0))) return NULL;
+  __Pyx_INCREF(__pyx_args);
+  __pyx_v_throw_args = __pyx_args;
+  __pyx_r = __pyx_pf_6gevent_8__waiter_6Waiter_14throw(((struct __pyx_obj_6gevent_8__waiter_Waiter *)__pyx_v_self), __pyx_v_throw_args);
+
+  /* function exit code */
+  __Pyx_XDECREF(__pyx_v_throw_args);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_8__waiter_6Waiter_14throw(struct __pyx_obj_6gevent_8__waiter_Waiter *__pyx_v_self, PyObject *__pyx_v_throw_args) {
+  PyGreenlet *__pyx_v_greenlet = NULL;
+  PyObject *__pyx_v_throw = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("throw", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_7);
+  __Pyx_XDECREF(__pyx_t_8);
+  __Pyx_XDECREF(__pyx_t_9);
+  __Pyx_XDECREF(__pyx_t_10);
+  __Pyx_XDECREF(__pyx_t_11);
+  __Pyx_XDECREF(__pyx_t_12);
+  __Pyx_XDECREF(__pyx_t_13);
+  __Pyx_AddTraceback("gevent.__waiter.Waiter.throw", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XDECREF((PyObject *)__pyx_v_greenlet);
+  __Pyx_XDECREF(__pyx_v_throw);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__13 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_throw_args, __pyx_n_s_greenlet, __pyx_n_s_throw); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 126, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__13);
+  __Pyx_GIVEREF(__pyx_tuple__13);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_8__waiter_6Waiter_15throw, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Waiter_throw, NULL, __pyx_n_s_gevent___waiter, __pyx_d, ((PyObject *)__pyx_codeobj__14)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 126, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_8__waiter_Waiter->tp_dict, __pyx_n_s_throw, __pyx_t_2) < 0) __PYX_ERR(0, 126, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_8__waiter_Waiter);
+  __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__13, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__waiter_py, __pyx_n_s_throw, 126, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__14)) __PYX_ERR(0, 126, __pyx_L1_error)
+
 127:         """Switch to the greenlet with the exception. If there's no greenlet, store the exception."""
+
+128:         greenlet = self.greenlet
+
  __pyx_t_1 = ((PyObject *)__pyx_v_self->greenlet);
+  __Pyx_INCREF(__pyx_t_1);
+  __pyx_v_greenlet = ((PyGreenlet *)__pyx_t_1);
+  __pyx_t_1 = 0;
+
+129:         if greenlet is None:
+
  __pyx_t_2 = (((PyObject *)__pyx_v_greenlet) == Py_None);
+  __pyx_t_3 = (__pyx_t_2 != 0);
+  if (__pyx_t_3) {
+/* … */
+    goto __pyx_L3;
+  }
+
+130:             self._exception = throw_args
+
    __Pyx_INCREF(__pyx_v_throw_args);
+    __Pyx_GIVEREF(__pyx_v_throw_args);
+    __Pyx_GOTREF(__pyx_v_self->_exception);
+    __Pyx_DECREF(__pyx_v_self->_exception);
+    __pyx_v_self->_exception = __pyx_v_throw_args;
+
 131:         else:
+
+132:             if getcurrent() is not self.hub: # pylint:disable=undefined-variable
+
  /*else*/ {
+    __pyx_t_1 = ((PyObject *)__pyx_f_6gevent_8__waiter_getcurrent()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 132, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __pyx_t_3 = (__pyx_t_1 != ((PyObject *)__pyx_v_self->hub));
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __pyx_t_2 = (__pyx_t_3 != 0);
+    if (unlikely(__pyx_t_2)) {
+/* … */
+    }
+
+133:                 raise AssertionError("Can only use Waiter.switch method from the Hub greenlet")
+
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_AssertionError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 133, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      __Pyx_Raise(__pyx_t_1, 0, 0, 0);
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      __PYX_ERR(0, 133, __pyx_L1_error)
+
+134:             throw = greenlet.throw
+
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_greenlet), __pyx_n_s_throw); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 134, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __pyx_v_throw = __pyx_t_1;
+    __pyx_t_1 = 0;
+
+135:             try:
+
    {
+      /*try:*/ {
+/* … */
+      }
+      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+      goto __pyx_L10_try_end;
+      __pyx_L5_error:;
+      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+/* … */
+      __Pyx_XGIVEREF(__pyx_t_4);
+      __Pyx_XGIVEREF(__pyx_t_5);
+      __Pyx_XGIVEREF(__pyx_t_6);
+      __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
+      goto __pyx_L1_error;
+      __pyx_L6_exception_handled:;
+      __Pyx_XGIVEREF(__pyx_t_4);
+      __Pyx_XGIVEREF(__pyx_t_5);
+      __Pyx_XGIVEREF(__pyx_t_6);
+      __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
+      __pyx_L10_try_end:;
+    }
+  }
+  __pyx_L3:;
+
+136:                 throw(*throw_args)
+
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_throw, __pyx_v_throw_args, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 136, __pyx_L5_error)
+        __Pyx_GOTREF(__pyx_t_1);
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+137:             except: # pylint:disable=bare-except
+
      /*except:*/ {
+        __Pyx_AddTraceback("gevent.__waiter.Waiter.throw", __pyx_clineno, __pyx_lineno, __pyx_filename);
+        if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(0, 137, __pyx_L7_except_error)
+        __Pyx_GOTREF(__pyx_t_1);
+        __Pyx_GOTREF(__pyx_t_7);
+        __Pyx_GOTREF(__pyx_t_8);
+
+138:                 self.hub.handle_error(throw, *sys.exc_info())
+
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->hub), __pyx_n_s_handle_error); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 138, __pyx_L7_except_error)
+        __Pyx_GOTREF(__pyx_t_9);
+        __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 138, __pyx_L7_except_error)
+        __Pyx_GOTREF(__pyx_t_10);
+        __Pyx_INCREF(__pyx_v_throw);
+        __Pyx_GIVEREF(__pyx_v_throw);
+        PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v_throw);
+        __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_6gevent_8__waiter_sys, __pyx_n_s_exc_info); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 138, __pyx_L7_except_error)
+        __Pyx_GOTREF(__pyx_t_12);
+        __pyx_t_13 = NULL;
+        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) {
+          __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_12);
+          if (likely(__pyx_t_13)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
+            __Pyx_INCREF(__pyx_t_13);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_12, function);
+          }
+        }
+        __pyx_t_11 = (__pyx_t_13) ? __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_13) : __Pyx_PyObject_CallNoArg(__pyx_t_12);
+        __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
+        if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 138, __pyx_L7_except_error)
+        __Pyx_GOTREF(__pyx_t_11);
+        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
+        __pyx_t_12 = __Pyx_PySequence_Tuple(__pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 138, __pyx_L7_except_error)
+        __Pyx_GOTREF(__pyx_t_12);
+        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+        __pyx_t_11 = PyNumber_Add(__pyx_t_10, __pyx_t_12); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 138, __pyx_L7_except_error)
+        __Pyx_GOTREF(__pyx_t_11);
+        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
+        __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_11, NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 138, __pyx_L7_except_error)
+        __Pyx_GOTREF(__pyx_t_12);
+        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
+        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
+        goto __pyx_L6_exception_handled;
+      }
+      __pyx_L7_except_error:;
+
 139: 
+
+140:     def get(self):
+
static PyObject *__pyx_pw_6gevent_8__waiter_6Waiter_17get(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyObject *__pyx_f_6gevent_8__waiter_6Waiter_get(struct __pyx_obj_6gevent_8__waiter_Waiter *__pyx_v_self, int __pyx_skip_dispatch) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("get", 0);
+  /* Check if called by wrapper */
+  if (unlikely(__pyx_skip_dispatch)) ;
+  /* Check if overridden in Python */
+  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
+    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
+    if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
+    else {
+      PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      #endif
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 140, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_8__waiter_6Waiter_17get)) {
+        __Pyx_XDECREF(__pyx_r);
+        __Pyx_INCREF(__pyx_t_1);
+        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+          if (likely(__pyx_t_4)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+            __Pyx_INCREF(__pyx_t_4);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_3, function);
+          }
+        }
+        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
+        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 140, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __pyx_r = __pyx_t_2;
+        __pyx_t_2 = 0;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        goto __pyx_L0;
+      }
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+      tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
+      if (unlikely(type_dict_guard != tp_dict_version)) {
+        tp_dict_version = obj_dict_version = 0;
+      }
+      #endif
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    }
+    #endif
+  }
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_AddTraceback("gevent.__waiter.Waiter.get", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_8__waiter_6Waiter_17get(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6gevent_8__waiter_6Waiter_16get[] = "Waiter.get(self)\nIf a value/an exception is stored, return/raise it. Otherwise until switch() or throw() is called.";
+static PyMethodDef __pyx_mdef_6gevent_8__waiter_6Waiter_17get = {"get", (PyCFunction)__pyx_pw_6gevent_8__waiter_6Waiter_17get, METH_NOARGS, __pyx_doc_6gevent_8__waiter_6Waiter_16get};
+static PyObject *__pyx_pw_6gevent_8__waiter_6Waiter_17get(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("get (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_8__waiter_6Waiter_16get(((struct __pyx_obj_6gevent_8__waiter_Waiter *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_8__waiter_6Waiter_16get(struct __pyx_obj_6gevent_8__waiter_Waiter *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("get", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __pyx_f_6gevent_8__waiter_6Waiter_get(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 140, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.__waiter.Waiter.get", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__15 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(0, 140, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__15);
+  __Pyx_GIVEREF(__pyx_tuple__15);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_8__waiter_6Waiter_17get, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Waiter_get, NULL, __pyx_n_s_gevent___waiter, __pyx_d, ((PyObject *)__pyx_codeobj__16)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 140, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_8__waiter_Waiter->tp_dict, __pyx_n_s_get, __pyx_t_2) < 0) __PYX_ERR(0, 140, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_8__waiter_Waiter);
+  __pyx_codeobj__16 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__15, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__waiter_py, __pyx_n_s_get, 140, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__16)) __PYX_ERR(0, 140, __pyx_L1_error)
+
 141:         """If a value/an exception is stored, return/raise it. Otherwise until switch() or throw() is called."""
+
+142:         if self._exception is not _NONE:
+
  __pyx_t_5 = (__pyx_v_self->_exception != __pyx_v_6gevent_8__waiter__NONE);
+  __pyx_t_6 = (__pyx_t_5 != 0);
+  if (__pyx_t_6) {
+/* … */
+    goto __pyx_L3;
+  }
+
+143:             if self._exception is None:
+
    __pyx_t_6 = (__pyx_v_self->_exception == Py_None);
+    __pyx_t_5 = (__pyx_t_6 != 0);
+    if (__pyx_t_5) {
+/* … */
+    }
+
+144:                 return self.value
+
      __Pyx_XDECREF(__pyx_r);
+      __Pyx_INCREF(__pyx_v_self->value);
+      __pyx_r = __pyx_v_self->value;
+      goto __pyx_L0;
+
+145:             getcurrent().throw(*self._exception) # pylint:disable=undefined-variable
+
    __pyx_t_1 = ((PyObject *)__pyx_f_6gevent_8__waiter_getcurrent()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 145, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_throw); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 145, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __pyx_t_1 = __Pyx_PySequence_Tuple(__pyx_v_self->_exception); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 145, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 145, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+
 146:         else:
+
+147:             if self.greenlet is not None:
+
  /*else*/ {
+    __pyx_t_5 = (((PyObject *)__pyx_v_self->greenlet) != Py_None);
+    __pyx_t_6 = (__pyx_t_5 != 0);
+    if (unlikely(__pyx_t_6)) {
+/* … */
+    }
+
+148:                 raise ConcurrentObjectUseError('This Waiter is already used by %r' % (self.greenlet, ))
+
      __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 148, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      __Pyx_INCREF(((PyObject *)__pyx_v_self->greenlet));
+      __Pyx_GIVEREF(((PyObject *)__pyx_v_self->greenlet));
+      PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self->greenlet));
+      __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_This_Waiter_is_already_used_by_r, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 148, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_2);
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      __Pyx_INCREF(__pyx_v_6gevent_8__waiter_ConcurrentObjectUseError);
+      __pyx_t_1 = __pyx_v_6gevent_8__waiter_ConcurrentObjectUseError; __pyx_t_4 = NULL;
+      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
+        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1);
+        if (likely(__pyx_t_4)) {
+          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
+          __Pyx_INCREF(__pyx_t_4);
+          __Pyx_INCREF(function);
+          __Pyx_DECREF_SET(__pyx_t_1, function);
+        }
+      }
+      __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_4, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_2);
+      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 148, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_3);
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      __Pyx_Raise(__pyx_t_3, 0, 0, 0);
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __PYX_ERR(0, 148, __pyx_L1_error)
+
+149:             self.greenlet = getcurrent() # pylint:disable=undefined-variable
+
    __pyx_t_3 = ((PyObject *)__pyx_f_6gevent_8__waiter_getcurrent()); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 149, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_GIVEREF(__pyx_t_3);
+    __Pyx_GOTREF(__pyx_v_self->greenlet);
+    __Pyx_DECREF(((PyObject *)__pyx_v_self->greenlet));
+    __pyx_v_self->greenlet = ((PyGreenlet *)__pyx_t_3);
+    __pyx_t_3 = 0;
+
+150:             try:
+
    /*try:*/ {
+
+151:                 return self.hub.switch()
+
      __Pyx_XDECREF(__pyx_r);
+      __pyx_t_3 = ((struct __pyx_vtabstruct_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *)__pyx_v_self->hub->__pyx_vtab)->__pyx_switch(__pyx_v_self->hub, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 151, __pyx_L7_error)
+      __Pyx_GOTREF(__pyx_t_3);
+      __pyx_r = __pyx_t_3;
+      __pyx_t_3 = 0;
+      goto __pyx_L6_return;
+    }
+
 152:             finally:
+
+153:                 self.greenlet = None
+
    /*finally:*/ {
+      __pyx_L7_error:;
+      /*exception exit:*/{
+        __Pyx_PyThreadState_declare
+        __Pyx_PyThreadState_assign
+        __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0;
+        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+        if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15);
+        if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12) < 0)) __Pyx_ErrFetch(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
+        __Pyx_XGOTREF(__pyx_t_10);
+        __Pyx_XGOTREF(__pyx_t_11);
+        __Pyx_XGOTREF(__pyx_t_12);
+        __Pyx_XGOTREF(__pyx_t_13);
+        __Pyx_XGOTREF(__pyx_t_14);
+        __Pyx_XGOTREF(__pyx_t_15);
+        __pyx_t_7 = __pyx_lineno; __pyx_t_8 = __pyx_clineno; __pyx_t_9 = __pyx_filename;
+        {
+          __Pyx_INCREF(Py_None);
+          __Pyx_GIVEREF(Py_None);
+          __Pyx_GOTREF(__pyx_v_self->greenlet);
+          __Pyx_DECREF(((PyObject *)__pyx_v_self->greenlet));
+          __pyx_v_self->greenlet = ((PyGreenlet *)Py_None);
+        }
+        if (PY_MAJOR_VERSION >= 3) {
+          __Pyx_XGIVEREF(__pyx_t_13);
+          __Pyx_XGIVEREF(__pyx_t_14);
+          __Pyx_XGIVEREF(__pyx_t_15);
+          __Pyx_ExceptionReset(__pyx_t_13, __pyx_t_14, __pyx_t_15);
+        }
+        __Pyx_XGIVEREF(__pyx_t_10);
+        __Pyx_XGIVEREF(__pyx_t_11);
+        __Pyx_XGIVEREF(__pyx_t_12);
+        __Pyx_ErrRestore(__pyx_t_10, __pyx_t_11, __pyx_t_12);
+        __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0;
+        __pyx_lineno = __pyx_t_7; __pyx_clineno = __pyx_t_8; __pyx_filename = __pyx_t_9;
+        goto __pyx_L1_error;
+      }
+      __pyx_L6_return: {
+        __pyx_t_15 = __pyx_r;
+        __pyx_r = 0;
+        __Pyx_INCREF(Py_None);
+        __Pyx_GIVEREF(Py_None);
+        __Pyx_GOTREF(__pyx_v_self->greenlet);
+        __Pyx_DECREF(((PyObject *)__pyx_v_self->greenlet));
+        __pyx_v_self->greenlet = ((PyGreenlet *)Py_None);
+        __pyx_r = __pyx_t_15;
+        __pyx_t_15 = 0;
+        goto __pyx_L0;
+      }
+    }
+  }
+  __pyx_L3:;
+
 154: 
+
+155:     def __call__(self, source):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_8__waiter_6Waiter_19__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_pw_6gevent_8__waiter_6Waiter_19__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_source = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__call__ (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_source,0};
+    PyObject* values[1] = {0};
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_source)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__call__") < 0)) __PYX_ERR(0, 155, __pyx_L3_error)
+      }
+    } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
+      goto __pyx_L5_argtuple_error;
+    } else {
+      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+    }
+    __pyx_v_source = values[0];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("__call__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 155, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.__waiter.Waiter.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_8__waiter_6Waiter_18__call__(((struct __pyx_obj_6gevent_8__waiter_Waiter *)__pyx_v_self), __pyx_v_source);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_8__waiter_6Waiter_18__call__(struct __pyx_obj_6gevent_8__waiter_Waiter *__pyx_v_self, PyObject *__pyx_v_source) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__call__", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_XDECREF(__pyx_t_6);
+  __Pyx_AddTraceback("gevent.__waiter.Waiter.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+156:         if source.exception is None:
+
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_source, __pyx_n_s_exception); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 156, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = (__pyx_t_1 == Py_None);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_3 = (__pyx_t_2 != 0);
+  if (__pyx_t_3) {
+/* … */
+    goto __pyx_L3;
+  }
+
+157:             self.switch(source.value)
+
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_switch); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 157, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_source, __pyx_n_s_value); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 157, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_5);
+    __pyx_t_6 = NULL;
+    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
+      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
+      if (likely(__pyx_t_6)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
+        __Pyx_INCREF(__pyx_t_6);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_4, function);
+      }
+    }
+    __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_6, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5);
+    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 157, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 158:         else:
+
+159:             self.throw(source.exception)
+
  /*else*/ {
+    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_throw); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 159, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_source, __pyx_n_s_exception); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 159, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_5);
+    __pyx_t_6 = NULL;
+    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
+      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
+      if (likely(__pyx_t_6)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
+        __Pyx_INCREF(__pyx_t_6);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_4, function);
+      }
+    }
+    __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_6, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5);
+    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 159, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  }
+  __pyx_L3:;
+
 160: 
+
 161:     # can also have a debugging version, that wraps the value in a tuple (self, value) in switch()
+
 162:     # and unwraps it in wait() thus checking that switch() was indeed called
+
 163: 
+
 164: 
+
 165: 
+
+166: class MultipleWaiter(Waiter):
+
struct __pyx_vtabstruct_6gevent_8__waiter_MultipleWaiter {
+  struct __pyx_vtabstruct_6gevent_8__waiter_Waiter __pyx_base;
+};
+static struct __pyx_vtabstruct_6gevent_8__waiter_MultipleWaiter *__pyx_vtabptr_6gevent_8__waiter_MultipleWaiter;
+
 167:     """
+
 168:     An internal extension of Waiter that can be used if multiple objects
+
 169:     must be waited on, and there is a chance that in between waits greenlets
+
 170:     might be switched out. All greenlets that switch to this waiter
+
 171:     will have their value returned.
+
 172: 
+
 173:     This does not handle exceptions or throw methods.
+
 174:     """
+
+175:     __slots__ = ['_values']
+
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 175, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_values);
+  __Pyx_GIVEREF(__pyx_n_s_values);
+  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_values);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_8__waiter_MultipleWaiter->tp_dict, __pyx_n_s_slots, __pyx_t_2) < 0) __PYX_ERR(0, 175, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_8__waiter_MultipleWaiter);
+
 176: 
+
+177:     def __init__(self, hub=None):
+
/* Python wrapper */
+static int __pyx_pw_6gevent_8__waiter_14MultipleWaiter_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static int __pyx_pw_6gevent_8__waiter_14MultipleWaiter_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_hub = 0;
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_hub,0};
+    PyObject* values[1] = {0};
+    values[0] = ((PyObject *)Py_None);
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_hub);
+          if (value) { values[0] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 177, __pyx_L3_error)
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    __pyx_v_hub = values[0];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 177, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.__waiter.MultipleWaiter.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return -1;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_8__waiter_14MultipleWaiter___init__(((struct __pyx_obj_6gevent_8__waiter_MultipleWaiter *)__pyx_v_self), __pyx_v_hub);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_8__waiter_14MultipleWaiter___init__(struct __pyx_obj_6gevent_8__waiter_MultipleWaiter *__pyx_v_self, PyObject *__pyx_v_hub) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = 0;
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_AddTraceback("gevent.__waiter.MultipleWaiter.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = -1;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+178:         Waiter.__init__(self, hub)
+
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_6gevent_8__waiter_Waiter), __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 178, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = NULL;
+  __pyx_t_4 = 0;
+  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+    if (likely(__pyx_t_3)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+      __Pyx_INCREF(__pyx_t_3);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_2, function);
+      __pyx_t_4 = 1;
+    }
+  }
+  #if CYTHON_FAST_PYCALL
+  if (PyFunction_Check(__pyx_t_2)) {
+    PyObject *__pyx_temp[3] = {__pyx_t_3, ((PyObject *)__pyx_v_self), __pyx_v_hub};
+    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 178, __pyx_L1_error)
+    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __Pyx_GOTREF(__pyx_t_1);
+  } else
+  #endif
+  #if CYTHON_FAST_PYCCALL
+  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
+    PyObject *__pyx_temp[3] = {__pyx_t_3, ((PyObject *)__pyx_v_self), __pyx_v_hub};
+    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 178, __pyx_L1_error)
+    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __Pyx_GOTREF(__pyx_t_1);
+  } else
+  #endif
+  {
+    __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 178, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_5);
+    if (__pyx_t_3) {
+      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
+    }
+    __Pyx_INCREF(((PyObject *)__pyx_v_self));
+    __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
+    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, ((PyObject *)__pyx_v_self));
+    __Pyx_INCREF(__pyx_v_hub);
+    __Pyx_GIVEREF(__pyx_v_hub);
+    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_hub);
+    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 178, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+  }
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 179:         # we typically expect a relatively small number of these to be outstanding.
+
 180:         # since we pop from the left, a deque might be slightly
+
 181:         # more efficient, but since we're in the hub we avoid imports if
+
 182:         # we can help it to better support monkey-patching, and delaying the import
+
 183:         # here can be impractical (see https://github.com/gevent/gevent/issues/652)
+
+184:         self._values = list()
+
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 184, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_1);
+  __Pyx_GOTREF(__pyx_v_self->_values);
+  __Pyx_DECREF(__pyx_v_self->_values);
+  __pyx_v_self->_values = ((PyObject*)__pyx_t_1);
+  __pyx_t_1 = 0;
+
 185: 
+
+186:     def switch(self, value):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_8__waiter_14MultipleWaiter_3switch(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
+static char __pyx_doc_6gevent_8__waiter_14MultipleWaiter_2switch[] = "MultipleWaiter.switch(self, value)";
+static PyMethodDef __pyx_mdef_6gevent_8__waiter_14MultipleWaiter_3switch = {"switch", (PyCFunction)__pyx_pw_6gevent_8__waiter_14MultipleWaiter_3switch, METH_O, __pyx_doc_6gevent_8__waiter_14MultipleWaiter_2switch};
+static PyObject *__pyx_pw_6gevent_8__waiter_14MultipleWaiter_3switch(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("switch (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_8__waiter_14MultipleWaiter_2switch(((struct __pyx_obj_6gevent_8__waiter_MultipleWaiter *)__pyx_v_self), ((PyObject *)__pyx_v_value));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_8__waiter_14MultipleWaiter_2switch(struct __pyx_obj_6gevent_8__waiter_MultipleWaiter *__pyx_v_self, PyObject *__pyx_v_value) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("switch", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_6);
+  __Pyx_AddTraceback("gevent.__waiter.MultipleWaiter.switch", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__17 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_value); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(0, 186, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__17);
+  __Pyx_GIVEREF(__pyx_tuple__17);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_8__waiter_14MultipleWaiter_3switch, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_MultipleWaiter_switch, NULL, __pyx_n_s_gevent___waiter, __pyx_d, ((PyObject *)__pyx_codeobj__18)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 186, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_8__waiter_MultipleWaiter->tp_dict, __pyx_n_s_switch, __pyx_t_2) < 0) __PYX_ERR(0, 186, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_8__waiter_MultipleWaiter);
+  __pyx_codeobj__18 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__17, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__waiter_py, __pyx_n_s_switch, 186, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__18)) __PYX_ERR(0, 186, __pyx_L1_error)
+
+187:         self._values.append(value)
+
  if (unlikely(__pyx_v_self->_values == Py_None)) {
+    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "append");
+    __PYX_ERR(0, 187, __pyx_L1_error)
+  }
+  __pyx_t_1 = __Pyx_PyList_Append(__pyx_v_self->_values, __pyx_v_value); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 187, __pyx_L1_error)
+
+188:         Waiter.switch(self, True)
+
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_6gevent_8__waiter_Waiter), __pyx_n_s_switch); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 188, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __pyx_t_4 = NULL;
+  __pyx_t_5 = 0;
+  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
+    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+    if (likely(__pyx_t_4)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+      __Pyx_INCREF(__pyx_t_4);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_3, function);
+      __pyx_t_5 = 1;
+    }
+  }
+  #if CYTHON_FAST_PYCALL
+  if (PyFunction_Check(__pyx_t_3)) {
+    PyObject *__pyx_temp[3] = {__pyx_t_4, ((PyObject *)__pyx_v_self), Py_True};
+    __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 188, __pyx_L1_error)
+    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __Pyx_GOTREF(__pyx_t_2);
+  } else
+  #endif
+  #if CYTHON_FAST_PYCCALL
+  if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
+    PyObject *__pyx_temp[3] = {__pyx_t_4, ((PyObject *)__pyx_v_self), Py_True};
+    __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 188, __pyx_L1_error)
+    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __Pyx_GOTREF(__pyx_t_2);
+  } else
+  #endif
+  {
+    __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 188, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_6);
+    if (__pyx_t_4) {
+      __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
+    }
+    __Pyx_INCREF(((PyObject *)__pyx_v_self));
+    __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
+    PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, ((PyObject *)__pyx_v_self));
+    __Pyx_INCREF(Py_True);
+    __Pyx_GIVEREF(Py_True);
+    PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, Py_True);
+    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 188, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  }
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
 189: 
+
+190:     def get(self):
+
static PyObject *__pyx_pw_6gevent_8__waiter_14MultipleWaiter_5get(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyObject *__pyx_f_6gevent_8__waiter_14MultipleWaiter_get(struct __pyx_obj_6gevent_8__waiter_MultipleWaiter *__pyx_v_self, CYTHON_UNUSED int __pyx_skip_dispatch) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("get", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_AddTraceback("gevent.__waiter.MultipleWaiter.get", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_8__waiter_14MultipleWaiter_5get(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6gevent_8__waiter_14MultipleWaiter_4get[] = "MultipleWaiter.get(self)";
+static PyMethodDef __pyx_mdef_6gevent_8__waiter_14MultipleWaiter_5get = {"get", (PyCFunction)__pyx_pw_6gevent_8__waiter_14MultipleWaiter_5get, METH_NOARGS, __pyx_doc_6gevent_8__waiter_14MultipleWaiter_4get};
+static PyObject *__pyx_pw_6gevent_8__waiter_14MultipleWaiter_5get(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("get (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_8__waiter_14MultipleWaiter_4get(((struct __pyx_obj_6gevent_8__waiter_MultipleWaiter *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_8__waiter_14MultipleWaiter_4get(struct __pyx_obj_6gevent_8__waiter_MultipleWaiter *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("get", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __pyx_f_6gevent_8__waiter_14MultipleWaiter_get(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 190, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.__waiter.MultipleWaiter.get", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__19 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(0, 190, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__19);
+  __Pyx_GIVEREF(__pyx_tuple__19);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_8__waiter_14MultipleWaiter_5get, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_MultipleWaiter_get, NULL, __pyx_n_s_gevent___waiter, __pyx_d, ((PyObject *)__pyx_codeobj__20)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 190, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_8__waiter_MultipleWaiter->tp_dict, __pyx_n_s_get, __pyx_t_2) < 0) __PYX_ERR(0, 190, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_8__waiter_MultipleWaiter);
+  __pyx_codeobj__20 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__19, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__waiter_py, __pyx_n_s_get, 190, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__20)) __PYX_ERR(0, 190, __pyx_L1_error)
+
+191:         if not self._values:
+
  __pyx_t_1 = (__pyx_v_self->_values != Py_None)&&(PyList_GET_SIZE(__pyx_v_self->_values) != 0);
+  __pyx_t_2 = ((!__pyx_t_1) != 0);
+  if (__pyx_t_2) {
+/* … */
+  }
+
+192:             Waiter.get(self)
+
    __pyx_t_3 = __pyx_f_6gevent_8__waiter_6Waiter_get(((struct __pyx_obj_6gevent_8__waiter_Waiter *)__pyx_v_self), 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 192, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+
+193:             Waiter.clear(self)
+
    __pyx_t_3 = __pyx_f_6gevent_8__waiter_6Waiter_clear(((struct __pyx_obj_6gevent_8__waiter_Waiter *)__pyx_v_self), 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 193, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+
 194: 
+
+195:         return self._values.pop(0)
+
  __Pyx_XDECREF(__pyx_r);
+  if (unlikely(__pyx_v_self->_values == Py_None)) {
+    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "pop");
+    __PYX_ERR(0, 195, __pyx_L1_error)
+  }
+  __pyx_t_3 = __Pyx_PyList_PopIndex(__pyx_v_self->_values, __pyx_int_0, 0, 1, Py_ssize_t, PyInt_FromSsize_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 195, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __pyx_r = __pyx_t_3;
+  __pyx_t_3 = 0;
+  goto __pyx_L0;
+
 196: 
+
+197: def _init():
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_8__waiter_1_init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6gevent_8__waiter__init[] = "_init()";
+static PyMethodDef __pyx_mdef_6gevent_8__waiter_1_init = {"_init", (PyCFunction)__pyx_pw_6gevent_8__waiter_1_init, METH_NOARGS, __pyx_doc_6gevent_8__waiter__init};
+static PyObject *__pyx_pw_6gevent_8__waiter_1_init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_init (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_8__waiter__init(__pyx_self);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_8__waiter__init(CYTHON_UNUSED PyObject *__pyx_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_init", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_8__waiter_1_init, 0, __pyx_n_s_init_2, NULL, __pyx_n_s_gevent___waiter, __pyx_d, ((PyObject *)__pyx_codeobj__21)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 197, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_init_2, __pyx_t_2) < 0) __PYX_ERR(0, 197, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+198:     greenlet_init() # pylint:disable=undefined-variable
+
  __pyx_f_6gevent_8__waiter_greenlet_init();
+
 199: 
+
+200: _init()
+
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_init_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 200, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 200, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 201: 
+
 202: 
+
+203: from gevent._util import import_c_accel
+
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 203, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(__pyx_n_s_import_c_accel);
+  __Pyx_GIVEREF(__pyx_n_s_import_c_accel);
+  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_import_c_accel);
+  __pyx_t_2 = __Pyx_Import(__pyx_n_s_gevent__util, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 203, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_import_c_accel); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 203, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_import_c_accel, __pyx_t_1) < 0) __PYX_ERR(0, 203, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+204: import_c_accel(globals(), 'gevent.__waiter')
+
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_import_c_accel); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 204, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_1 = __Pyx_Globals(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 204, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 204, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_GIVEREF(__pyx_t_1);
+  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
+  __Pyx_INCREF(__pyx_n_s_gevent___waiter);
+  __Pyx_GIVEREF(__pyx_n_s_gevent___waiter);
+  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_n_s_gevent___waiter);
+  __pyx_t_1 = 0;
+  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 204, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_waiter.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_waiter.py new file mode 100644 index 00000000..b9ba3e8c --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/_waiter.py @@ -0,0 +1,204 @@ +# -*- coding: utf-8 -*- +# copyright 2018 gevent +# cython: auto_pickle=False,embedsignature=True,always_allow_keywords=False +""" +Low-level waiting primitives. + +""" +from __future__ import absolute_import +from __future__ import division +from __future__ import print_function + +import sys + +from gevent._hub_local import get_hub_noargs as get_hub +from gevent.exceptions import ConcurrentObjectUseError + +__all__ = [ + 'Waiter', +] + +_NONE = object() + +locals()['getcurrent'] = __import__('greenlet').getcurrent +locals()['greenlet_init'] = lambda: None + + +class Waiter(object): + """ + A low level communication utility for greenlets. + + Waiter is a wrapper around greenlet's ``switch()`` and ``throw()`` calls that makes them somewhat safer: + + * switching will occur only if the waiting greenlet is executing :meth:`get` method currently; + * any error raised in the greenlet is handled inside :meth:`switch` and :meth:`throw` + * if :meth:`switch`/:meth:`throw` is called before the receiver calls :meth:`get`, then :class:`Waiter` + will store the value/exception. The following :meth:`get` will return the value/raise the exception. + + The :meth:`switch` and :meth:`throw` methods must only be called from the :class:`Hub` greenlet. + The :meth:`get` method must be called from a greenlet other than :class:`Hub`. + + >>> result = Waiter() + >>> timer = get_hub().loop.timer(0.1) + >>> timer.start(result.switch, 'hello from Waiter') + >>> result.get() # blocks for 0.1 seconds + 'hello from Waiter' + >>> timer.close() + + If switch is called before the greenlet gets a chance to call :meth:`get` then + :class:`Waiter` stores the value. + + >>> result = Waiter() + >>> timer = get_hub().loop.timer(0.1) + >>> timer.start(result.switch, 'hi from Waiter') + >>> sleep(0.2) + >>> result.get() # returns immediately without blocking + 'hi from Waiter' + >>> timer.close() + + .. warning:: + + This a limited and dangerous way to communicate between + greenlets. It can easily leave a greenlet unscheduled forever + if used incorrectly. Consider using safer classes such as + :class:`gevent.event.Event`, :class:`gevent.event.AsyncResult`, + or :class:`gevent.queue.Queue`. + """ + + __slots__ = ['hub', 'greenlet', 'value', '_exception'] + + def __init__(self, hub=None): + self.hub = get_hub() if hub is None else hub + self.greenlet = None + self.value = None + self._exception = _NONE + + def clear(self): + self.greenlet = None + self.value = None + self._exception = _NONE + + def __str__(self): + if self._exception is _NONE: + return '<%s greenlet=%s>' % (type(self).__name__, self.greenlet) + if self._exception is None: + return '<%s greenlet=%s value=%r>' % (type(self).__name__, self.greenlet, self.value) + return '<%s greenlet=%s exc_info=%r>' % (type(self).__name__, self.greenlet, self.exc_info) + + def ready(self): + """Return true if and only if it holds a value or an exception""" + return self._exception is not _NONE + + def successful(self): + """Return true if and only if it is ready and holds a value""" + return self._exception is None + + @property + def exc_info(self): + "Holds the exception info passed to :meth:`throw` if :meth:`throw` was called. Otherwise ``None``." + if self._exception is not _NONE: + return self._exception + + def switch(self, value): + """ + Switch to the greenlet if one's available. Otherwise store the + *value*. + + .. versionchanged:: 1.3b1 + The *value* is no longer optional. + """ + greenlet = self.greenlet + if greenlet is None: + self.value = value + self._exception = None + else: + if getcurrent() is not self.hub: # pylint:disable=undefined-variable + raise AssertionError("Can only use Waiter.switch method from the Hub greenlet") + switch = greenlet.switch + try: + switch(value) + except: # pylint:disable=bare-except + self.hub.handle_error(switch, *sys.exc_info()) + + def switch_args(self, *args): + return self.switch(args) + + def throw(self, *throw_args): + """Switch to the greenlet with the exception. If there's no greenlet, store the exception.""" + greenlet = self.greenlet + if greenlet is None: + self._exception = throw_args + else: + if getcurrent() is not self.hub: # pylint:disable=undefined-variable + raise AssertionError("Can only use Waiter.switch method from the Hub greenlet") + throw = greenlet.throw + try: + throw(*throw_args) + except: # pylint:disable=bare-except + self.hub.handle_error(throw, *sys.exc_info()) + + def get(self): + """If a value/an exception is stored, return/raise it. Otherwise until switch() or throw() is called.""" + if self._exception is not _NONE: + if self._exception is None: + return self.value + getcurrent().throw(*self._exception) # pylint:disable=undefined-variable + else: + if self.greenlet is not None: + raise ConcurrentObjectUseError('This Waiter is already used by %r' % (self.greenlet, )) + self.greenlet = getcurrent() # pylint:disable=undefined-variable + try: + return self.hub.switch() + finally: + self.greenlet = None + + def __call__(self, source): + if source.exception is None: + self.switch(source.value) + else: + self.throw(source.exception) + + # can also have a debugging version, that wraps the value in a tuple (self, value) in switch() + # and unwraps it in wait() thus checking that switch() was indeed called + + + +class MultipleWaiter(Waiter): + """ + An internal extension of Waiter that can be used if multiple objects + must be waited on, and there is a chance that in between waits greenlets + might be switched out. All greenlets that switch to this waiter + will have their value returned. + + This does not handle exceptions or throw methods. + """ + __slots__ = ['_values'] + + def __init__(self, hub=None): + Waiter.__init__(self, hub) + # we typically expect a relatively small number of these to be outstanding. + # since we pop from the left, a deque might be slightly + # more efficient, but since we're in the hub we avoid imports if + # we can help it to better support monkey-patching, and delaying the import + # here can be impractical (see https://github.com/gevent/gevent/issues/652) + self._values = list() + + def switch(self, value): + self._values.append(value) + Waiter.switch(self, True) + + def get(self): + if not self._values: + Waiter.get(self) + Waiter.clear(self) + + return self._values.pop(0) + +def _init(): + greenlet_init() # pylint:disable=undefined-variable + +_init() + + +from gevent._util import import_c_accel +import_c_accel(globals(), 'gevent.__waiter') diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/ares.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/ares.py new file mode 100644 index 00000000..37980b32 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/ares.py @@ -0,0 +1,10 @@ +"""Backwards compatibility alias for :mod:`gevent.resolver.cares`. + +.. deprecated:: 1.3 + Use :mod:`gevent.resolver.cares` +""" + +from gevent.resolver.cares import * # pylint:disable=wildcard-import,unused-wildcard-import, +import gevent.resolver.cares as _cares +__all__ = _cares.__all__ # pylint:disable=c-extension-no-member +del _cares diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/backdoor.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/backdoor.py new file mode 100644 index 00000000..84894178 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/backdoor.py @@ -0,0 +1,210 @@ +# Copyright (c) 2009-2014, gevent contributors +# Based on eventlet.backdoor Copyright (c) 2005-2006, Bob Ippolito +""" +Interactive greenlet-based network console that can be used in any process. + +The :class:`BackdoorServer` provides a REPL inside a running process. As +long as the process is monkey-patched, the ``BackdoorServer`` can coexist +with other elements of the process. + +.. seealso:: :class:`code.InteractiveConsole` +""" +from __future__ import print_function, absolute_import +import sys +from code import InteractiveConsole + +from gevent.greenlet import Greenlet +from gevent.hub import getcurrent +from gevent.server import StreamServer +from gevent.pool import Pool + +__all__ = ['BackdoorServer'] + +try: + sys.ps1 +except AttributeError: + sys.ps1 = '>>> ' +try: + sys.ps2 +except AttributeError: + sys.ps2 = '... ' + +class _Greenlet_stdreplace(Greenlet): + # A greenlet that replaces sys.std[in/out/err] while running. + _fileobj = None + saved = None + + def switch(self, *args, **kw): + if self._fileobj is not None: + self.switch_in() + Greenlet.switch(self, *args, **kw) + + def switch_in(self): + self.saved = sys.stdin, sys.stderr, sys.stdout + sys.stdin = sys.stdout = sys.stderr = self._fileobj + + def switch_out(self): + sys.stdin, sys.stderr, sys.stdout = self.saved + self.saved = None + + def throw(self, *args, **kwargs): + # pylint:disable=arguments-differ + if self.saved is None and self._fileobj is not None: + self.switch_in() + Greenlet.throw(self, *args, **kwargs) + + def run(self): + try: + return Greenlet.run(self) + finally: + # Make sure to restore the originals. + self.switch_out() + + +class BackdoorServer(StreamServer): + """ + Provide a backdoor to a program for debugging purposes. + + .. warning:: This backdoor provides no authentication and makes no + attempt to limit what remote users can do. Anyone that + can access the server can take any action that the running + python process can. Thus, while you may bind to any interface, for + security purposes it is recommended that you bind to one + only accessible to the local machine, e.g., + 127.0.0.1/localhost. + + Basic usage:: + + from gevent.backdoor import BackdoorServer + server = BackdoorServer(('127.0.0.1', 5001), + banner="Hello from gevent backdoor!", + locals={'foo': "From defined scope!"}) + server.serve_forever() + + In a another terminal, connect with...:: + + $ telnet 127.0.0.1 5001 + Trying 127.0.0.1... + Connected to 127.0.0.1. + Escape character is '^]'. + Hello from gevent backdoor! + >> print(foo) + From defined scope! + + .. versionchanged:: 1.2a1 + Spawned greenlets are now tracked in a pool and killed when the server + is stopped. + """ + + def __init__(self, listener, locals=None, banner=None, **server_args): + """ + :keyword locals: If given, a dictionary of "builtin" values that will be available + at the top-level. + :keyword banner: If geven, a string that will be printed to each connecting user. + """ + group = Pool(greenlet_class=_Greenlet_stdreplace) # no limit on number + StreamServer.__init__(self, listener, spawn=group, **server_args) + _locals = {'__doc__': None, '__name__': '__console__'} + if locals: + _locals.update(locals) + self.locals = _locals + + self.banner = banner + self.stderr = sys.stderr + + def _create_interactive_locals(self): + # Create and return a *new* locals dictionary based on self.locals, + # and set any new entries in it. (InteractiveConsole does not + # copy its locals value) + _locals = self.locals.copy() + # __builtins__ may either be the __builtin__ module or + # __builtin__.__dict__; in the latter case typing + # locals() at the backdoor prompt spews out lots of + # useless stuff + try: + import __builtin__ + _locals["__builtins__"] = __builtin__ + except ImportError: + import builtins # pylint:disable=import-error + _locals["builtins"] = builtins + _locals['__builtins__'] = builtins + return _locals + + def handle(self, conn, _address): # pylint: disable=method-hidden + """ + Interact with one remote user. + + .. versionchanged:: 1.1b2 Each connection gets its own + ``locals`` dictionary. Previously they were shared in a + potentially unsafe manner. + """ + fobj = conn.makefile(mode="rw") + fobj = _fileobject(conn, fobj, self.stderr) + getcurrent()._fileobj = fobj + + getcurrent().switch_in() + try: + console = InteractiveConsole(self._create_interactive_locals()) + if sys.version_info[:3] >= (3, 6, 0): + # Beginning in 3.6, the console likes to print "now exiting " + # but probably our socket is already closed, so this just causes problems. + console.interact(banner=self.banner, exitmsg='') # pylint:disable=unexpected-keyword-arg + else: + console.interact(banner=self.banner) + except SystemExit: # raised by quit() + if hasattr(sys, 'exc_clear'): # py2 + sys.exc_clear() + finally: + conn.close() + fobj.close() + + +class _fileobject(object): + """ + A file-like object that wraps the result of socket.makefile (composition + instead of inheritance lets us work identically under CPython and PyPy). + + We write directly to the socket, avoiding the buffering that the text-oriented + makefile would want to do (otherwise we'd be at the mercy of waiting on a + flush() to get called for the remote user to see data); this beats putting + the file in binary mode and translating everywhere with a non-default + encoding. + """ + def __init__(self, sock, fobj, stderr): + self._sock = sock + self._fobj = fobj + self.stderr = stderr + + def __getattr__(self, name): + return getattr(self._fobj, name) + + def close(self): + self._fobj.close() + self._sock.close() + + def write(self, data): + if not isinstance(data, bytes): + data = data.encode('utf-8') + self._sock.sendall(data) + + def isatty(self): + return True + + def flush(self): + pass + + def readline(self, *a): + try: + return self._fobj.readline(*a).replace("\r\n", "\n") + except UnicodeError: + # Typically, under python 3, a ^C on the other end + return '' + + +if __name__ == '__main__': + if not sys.argv[1:]: + print('USAGE: %s PORT [banner]' % sys.argv[0]) + else: + BackdoorServer(('127.0.0.1', int(sys.argv[1])), + banner=(sys.argv[2] if len(sys.argv) > 2 else None), + locals={'hello': 'world'}).serve_forever() diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/baseserver.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/baseserver.py new file mode 100644 index 00000000..f987cc39 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/baseserver.py @@ -0,0 +1,409 @@ +"""Base class for implementing servers""" +# Copyright (c) 2009-2012 Denis Bilenko. See LICENSE for details. +import sys +import _socket +import errno +from gevent.greenlet import Greenlet +from gevent.event import Event +from gevent.hub import get_hub +from gevent._compat import string_types, integer_types, xrange + + +__all__ = ['BaseServer'] + + +# We define a helper function to handle closing the socket in +# do_handle; We'd like to bind it to a kwarg to avoid *any* lookups at +# all, but that's incompatible with the calling convention of +# do_handle. On CPython, this is ~20% faster than creating and calling +# a closure and ~10% faster than using a @staticmethod. (In theory, we +# could create a closure only once in set_handle, to wrap self._handle, +# but this is safer from a backwards compat standpoint.) +# we also avoid unpacking the *args tuple when calling/spawning this object +# for a tiny improvement (benchmark shows a wash) +def _handle_and_close_when_done(handle, close, args_tuple): + try: + return handle(*args_tuple) + finally: + close(*args_tuple) + + +class BaseServer(object): + """ + An abstract base class that implements some common functionality for the servers in gevent. + + :param listener: Either be an address that the server should bind + on or a :class:`gevent.socket.socket` instance that is already + bound (and put into listening mode in case of TCP socket). + + :keyword handle: If given, the request handler. The request + handler can be defined in a few ways. Most commonly, + subclasses will implement a ``handle`` method as an + instance method. Alternatively, a function can be passed + as the ``handle`` argument to the constructor. In either + case, the handler can later be changed by calling + :meth:`set_handle`. + + When the request handler returns, the socket used for the + request will be closed. Therefore, the handler must not return if + the socket is still in use (for example, by manually spawned greenlets). + + :keyword spawn: If provided, is called to create a new + greenlet to run the handler. By default, + :func:`gevent.spawn` is used (meaning there is no + artificial limit on the number of concurrent requests). Possible values for *spawn*: + + - a :class:`gevent.pool.Pool` instance -- ``handle`` will be executed + using :meth:`gevent.pool.Pool.spawn` only if the pool is not full. + While it is full, no new connections are accepted; + - :func:`gevent.spawn_raw` -- ``handle`` will be executed in a raw + greenlet which has a little less overhead then :class:`gevent.Greenlet` instances spawned by default; + - ``None`` -- ``handle`` will be executed right away, in the :class:`Hub` greenlet. + ``handle`` cannot use any blocking functions as it would mean switching to the :class:`Hub`. + - an integer -- a shortcut for ``gevent.pool.Pool(integer)`` + + .. versionchanged:: 1.1a1 + When the *handle* function returns from processing a connection, + the client socket will be closed. This resolves the non-deterministic + closing of the socket, fixing ResourceWarnings under Python 3 and PyPy. + + """ + # pylint: disable=too-many-instance-attributes,bare-except,broad-except + + #: the number of seconds to sleep in case there was an error in accept() call + #: for consecutive errors the delay will double until it reaches max_delay + #: when accept() finally succeeds the delay will be reset to min_delay again + min_delay = 0.01 + max_delay = 1 + + #: Sets the maximum number of consecutive accepts that a process may perform on + #: a single wake up. High values give higher priority to high connection rates, + #: while lower values give higher priority to already established connections. + #: Default is 100. Note, that in case of multiple working processes on the same + #: listening value, it should be set to a lower value. (pywsgi.WSGIServer sets it + #: to 1 when environ["wsgi.multiprocess"] is true) + max_accept = 100 + + _spawn = Greenlet.spawn + + #: the default timeout that we wait for the client connections to close in stop() + stop_timeout = 1 + + fatal_errors = (errno.EBADF, errno.EINVAL, errno.ENOTSOCK) + + def __init__(self, listener, handle=None, spawn='default'): + self._stop_event = Event() + self._stop_event.set() + self._watcher = None + self._timer = None + self._handle = None + # XXX: FIXME: Subclasses rely on the presence or absence of the + # `socket` attribute to determine whether we are open/should be opened. + # Instead, have it be None. + self.pool = None + try: + self.set_listener(listener) + self.set_spawn(spawn) + self.set_handle(handle) + self.delay = self.min_delay + self.loop = get_hub().loop + if self.max_accept < 1: + raise ValueError('max_accept must be positive int: %r' % (self.max_accept, )) + except: + self.close() + raise + + def set_listener(self, listener): + if hasattr(listener, 'accept'): + if hasattr(listener, 'do_handshake'): + raise TypeError('Expected a regular socket, not SSLSocket: %r' % (listener, )) + self.family = listener.family + self.address = listener.getsockname() + self.socket = listener + else: + self.family, self.address = parse_address(listener) + + def set_spawn(self, spawn): + if spawn == 'default': + self.pool = None + self._spawn = self._spawn + elif hasattr(spawn, 'spawn'): + self.pool = spawn + self._spawn = spawn.spawn + elif isinstance(spawn, integer_types): + from gevent.pool import Pool + self.pool = Pool(spawn) + self._spawn = self.pool.spawn + else: + self.pool = None + self._spawn = spawn + if hasattr(self.pool, 'full'): + self.full = self.pool.full + if self.pool is not None: + self.pool._semaphore.rawlink(self._start_accepting_if_started) + + def set_handle(self, handle): + if handle is not None: + self.handle = handle + if hasattr(self, 'handle'): + self._handle = self.handle + else: + raise TypeError("'handle' must be provided") + + def _start_accepting_if_started(self, _event=None): + if self.started: + self.start_accepting() + + def start_accepting(self): + if self._watcher is None: + # just stop watcher without creating a new one? + self._watcher = self.loop.io(self.socket.fileno(), 1) + self._watcher.start(self._do_read) + + def stop_accepting(self): + if self._watcher is not None: + self._watcher.stop() + self._watcher.close() + self._watcher = None + if self._timer is not None: + self._timer.stop() + self._timer.close() + self._timer = None + + def do_handle(self, *args): + spawn = self._spawn + handle = self._handle + close = self.do_close + + try: + if spawn is None: + _handle_and_close_when_done(handle, close, args) + else: + spawn(_handle_and_close_when_done, handle, close, args) + except: + close(*args) + raise + + def do_close(self, *args): + pass + + def do_read(self): + raise NotImplementedError() + + def _do_read(self): + for _ in xrange(self.max_accept): + if self.full(): + self.stop_accepting() + return + try: + args = self.do_read() + self.delay = self.min_delay + if not args: + return + except: + self.loop.handle_error(self, *sys.exc_info()) + ex = sys.exc_info()[1] + if self.is_fatal_error(ex): + self.close() + sys.stderr.write('ERROR: %s failed with %s\n' % (self, str(ex) or repr(ex))) + return + if self.delay >= 0: + self.stop_accepting() + self._timer = self.loop.timer(self.delay) + self._timer.start(self._start_accepting_if_started) + self.delay = min(self.max_delay, self.delay * 2) + break + else: + try: + self.do_handle(*args) + except: + self.loop.handle_error((args[1:], self), *sys.exc_info()) + if self.delay >= 0: + self.stop_accepting() + self._timer = self.loop.timer(self.delay) + self._timer.start(self._start_accepting_if_started) + self.delay = min(self.max_delay, self.delay * 2) + break + + def full(self): + # copied from self.pool + # pylint: disable=method-hidden + return False + + def __repr__(self): + return '<%s at %s %s>' % (type(self).__name__, hex(id(self)), self._formatinfo()) + + def __str__(self): + return '<%s %s>' % (type(self).__name__, self._formatinfo()) + + def _formatinfo(self): + if hasattr(self, 'socket'): + try: + fileno = self.socket.fileno() + except Exception as ex: + fileno = str(ex) + result = 'fileno=%s ' % fileno + else: + result = '' + try: + if isinstance(self.address, tuple) and len(self.address) == 2: + result += 'address=%s:%s' % self.address + else: + result += 'address=%s' % (self.address, ) + except Exception as ex: + result += str(ex) or '' + + handle = self.__dict__.get('handle') + if handle is not None: + fself = getattr(handle, '__self__', None) + try: + if fself is self: + # Checks the __self__ of the handle in case it is a bound + # method of self to prevent recursivly defined reprs. + handle_repr = '' % ( + self.__class__.__name__, + handle.__name__, + ) + else: + handle_repr = repr(handle) + + result += ' handle=' + handle_repr + except Exception as ex: + result += str(ex) or '' + + return result + + @property + def server_host(self): + """IP address that the server is bound to (string).""" + if isinstance(self.address, tuple): + return self.address[0] + + @property + def server_port(self): + """Port that the server is bound to (an integer).""" + if isinstance(self.address, tuple): + return self.address[1] + + def init_socket(self): + """If the user initialized the server with an address rather than socket, + then this function will create a socket, bind it and put it into listening mode. + + It is not supposed to be called by the user, it is called by :meth:`start` before starting + the accept loop.""" + + @property + def started(self): + return not self._stop_event.is_set() + + def start(self): + """Start accepting the connections. + + If an address was provided in the constructor, then also create a socket, + bind it and put it into the listening mode. + """ + self.init_socket() + self._stop_event.clear() + try: + self.start_accepting() + except: + self.close() + raise + + def close(self): + """Close the listener socket and stop accepting.""" + self._stop_event.set() + try: + self.stop_accepting() + finally: + try: + self.socket.close() + except Exception: + pass + finally: + self.__dict__.pop('socket', None) + self.__dict__.pop('handle', None) + self.__dict__.pop('_handle', None) + self.__dict__.pop('_spawn', None) + self.__dict__.pop('full', None) + if self.pool is not None: + self.pool._semaphore.unlink(self._start_accepting_if_started) + # If the pool's semaphore had a notifier already started, + # there's a reference cycle we're a part of + # (self->pool->semaphere-hub callback->semaphore) + # But we can't destroy self.pool, because self.stop() + # calls this method, and then wants to join self.pool() + + @property + def closed(self): + return not hasattr(self, 'socket') + + def stop(self, timeout=None): + """ + Stop accepting the connections and close the listening socket. + + If the server uses a pool to spawn the requests, then + :meth:`stop` also waits for all the handlers to exit. If there + are still handlers executing after *timeout* has expired + (default 1 second, :attr:`stop_timeout`), then the currently + running handlers in the pool are killed. + + If the server does not use a pool, then this merely stops accepting connections; + any spawned greenlets that are handling requests continue running until + they naturally complete. + """ + self.close() + if timeout is None: + timeout = self.stop_timeout + if self.pool: + self.pool.join(timeout=timeout) + self.pool.kill(block=True, timeout=1) + + + def serve_forever(self, stop_timeout=None): + """Start the server if it hasn't been already started and wait until it's stopped.""" + # add test that serve_forever exists on stop() + if not self.started: + self.start() + try: + self._stop_event.wait() + finally: + Greenlet.spawn(self.stop, timeout=stop_timeout).join() + + def is_fatal_error(self, ex): + return isinstance(ex, _socket.error) and ex.args[0] in self.fatal_errors + + +def _extract_family(host): + if host.startswith('[') and host.endswith(']'): + host = host[1:-1] + return _socket.AF_INET6, host + return _socket.AF_INET, host + + +def _parse_address(address): + if isinstance(address, tuple): + if not address[0] or ':' in address[0]: + return _socket.AF_INET6, address + return _socket.AF_INET, address + + if ((isinstance(address, string_types) and ':' not in address) + or isinstance(address, integer_types)): # noqa (pep8 E129) + # Just a port + return _socket.AF_INET6, ('', int(address)) + + if not isinstance(address, string_types): + raise TypeError('Expected tuple or string, got %s' % type(address)) + + host, port = address.rsplit(':', 1) + family, host = _extract_family(host) + if host == '*': + host = '' + return family, (host, int(port)) + + +def parse_address(address): + try: + return _parse_address(address) + except ValueError as ex: # pylint:disable=try-except-raise + raise ValueError('Failed to parse address %r: %s' % (address, ex)) diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/builtins.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/builtins.py new file mode 100644 index 00000000..389a6529 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/builtins.py @@ -0,0 +1,135 @@ +# Copyright (c) 2015 gevent contributors. See LICENSE for details. +"""gevent friendly implementations of builtin functions.""" +from __future__ import absolute_import + +import sys +import weakref + +from gevent.lock import RLock +from gevent._compat import imp_acquire_lock +from gevent._compat import imp_release_lock + + +# Normally we'd have the "expected" case inside the try +# (Python 3, because Python 3 is the way forward). But +# under Python 2, the popular `future` library *also* provides +# a `builtins` module---which lacks the __import__ attribute. +# So we test for the old, deprecated version first + +try: # Py2 + import __builtin__ as __gbuiltins__ + _allowed_module_name_types = (basestring,) # pylint:disable=undefined-variable + __target__ = '__builtin__' +except ImportError: + import builtins as __gbuiltins__ # pylint: disable=import-error + _allowed_module_name_types = (str,) + __target__ = 'builtins' + +_import = __gbuiltins__.__import__ + +# We need to protect imports both across threads and across greenlets. +# And the order matters. Note that under 3.4, the global import lock +# and imp module are deprecated. It seems that in all Py3 versions, a +# module lock is used such that this fix is not necessary. + +# We emulate the per-module locking system under Python 2 in order to +# avoid issues acquiring locks in multiple-level-deep imports +# that attempt to use the gevent blocking API at runtime; using one lock +# could lead to a LoopExit error as a greenlet attempts to block on it while +# it's already held by the main greenlet (issue #798). + +# We base this approach on a simplification of what `importlib._bootstrap` +# does; notably, we don't check for deadlocks + +_g_import_locks = {} # name -> wref of RLock + +__lock_imports = True + + +def __module_lock(name): + # Return the lock for the given module, creating it if necessary. + # It will be removed when no longer needed. + # Nothing in this function yields, so we're multi-greenlet safe + # (But not multi-threading safe.) + # XXX: What about on PyPy, where the GC is asynchronous (not ref-counting)? + # (Does it stop-the-world first?) + lock = None + try: + lock = _g_import_locks[name]() + except KeyError: + pass + + if lock is None: + lock = RLock() + + def cb(_): + # We've seen a KeyError on PyPy on RPi2 + _g_import_locks.pop(name, None) + _g_import_locks[name] = weakref.ref(lock, cb) + return lock + + +def __import__(*args, **kwargs): + """ + __import__(name, globals=None, locals=None, fromlist=(), level=0) -> object + + Normally python protects imports against concurrency by doing some locking + at the C level (at least, it does that in CPython). This function just + wraps the normal __import__ functionality in a recursive lock, ensuring that + we're protected against greenlet import concurrency as well. + """ + if args and not issubclass(type(args[0]), _allowed_module_name_types): + # if a builtin has been acquired as a bound instance method, + # python knows not to pass 'self' when the method is called. + # No such protection exists for monkey-patched builtins, + # however, so this is necessary. + args = args[1:] + + if not __lock_imports: + return _import(*args, **kwargs) + + module_lock = __module_lock(args[0]) # Get a lock for the module name + imp_acquire_lock() + try: + module_lock.acquire() + try: + result = _import(*args, **kwargs) + finally: + module_lock.release() + finally: + imp_release_lock() + return result + + +def _unlock_imports(): + """ + Internal function, called when gevent needs to perform imports + lazily, but does not know the state of the system. It may be impossible + to take the import lock because there are no other running greenlets, for + example. This causes a monkey-patched __import__ to avoid taking any locks. + until the corresponding call to lock_imports. This should only be done for limited + amounts of time and when the set of imports is statically known to be "safe". + """ + global __lock_imports + # This could easily become a list that we push/pop from or an integer + # we increment if we need to do this recursively, but we shouldn't get + # that complex. + __lock_imports = False + + +def _lock_imports(): + global __lock_imports + __lock_imports = True + +if sys.version_info[:2] >= (3, 3): + __implements__ = [] + __import__ = _import +else: + __implements__ = ['__import__'] +__all__ = __implements__ + + +from gevent._util import copy_globals + +__imports__ = copy_globals(__gbuiltins__, globals(), + names_to_ignore=__implements__) diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/core.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/core.py new file mode 100644 index 00000000..906e739e --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/core.py @@ -0,0 +1,20 @@ +# Copyright (c) 2009-2015 Denis Bilenko and gevent contributors. See LICENSE for details. +""" +Deprecated; this does not reflect all the possible options +and its interface varies. + +.. versionchanged:: 1.3a2 + Deprecated. +""" +from __future__ import absolute_import + +import sys + +from gevent._config import config +from gevent._util import copy_globals + +_core = sys.modules[config.loop.__module__] + +copy_globals(_core, globals()) + +__all__ = _core.__all__ # pylint:disable=no-member diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/event.c b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/event.c new file mode 100644 index 00000000..69475355 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/event.c @@ -0,0 +1,10734 @@ +/* Generated by Cython 0.29.2 */ + +/* BEGIN: Cython Metadata +{ + "distutils": { + "depends": [ + "src/gevent/_event.pxd", + "src\\gevent\\_event.pxd" + ], + "include_dirs": [ + "C:\\Python37-x64\\Include", + "deps" + ], + "name": "gevent._event", + "sources": [ + "src/gevent/event.py" + ] + }, + "module_name": "gevent._event" +} +END: Cython Metadata */ + +#define PY_SSIZE_T_CLEAN +#include "Python.h" +#ifndef Py_PYTHON_H + #error Python headers needed to compile C extensions, please install development version of Python. +#elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) + #error Cython requires Python 2.6+ or Python 3.3+. +#else +#define CYTHON_ABI "0_29_2" +#define CYTHON_HEX_VERSION 0x001D02F0 +#define CYTHON_FUTURE_DIVISION 1 +#include +#ifndef offsetof + #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) +#endif +#if !defined(WIN32) && !defined(MS_WINDOWS) + #ifndef __stdcall + #define __stdcall + #endif + #ifndef __cdecl + #define __cdecl + #endif + #ifndef __fastcall + #define __fastcall + #endif +#endif +#ifndef DL_IMPORT + #define DL_IMPORT(t) t +#endif +#ifndef DL_EXPORT + #define DL_EXPORT(t) t +#endif +#define __PYX_COMMA , +#ifndef HAVE_LONG_LONG + #if PY_VERSION_HEX >= 0x02070000 + #define HAVE_LONG_LONG + #endif +#endif +#ifndef PY_LONG_LONG + #define PY_LONG_LONG LONG_LONG +#endif +#ifndef Py_HUGE_VAL + #define Py_HUGE_VAL HUGE_VAL +#endif +#ifdef PYPY_VERSION + #define CYTHON_COMPILING_IN_PYPY 1 + #define CYTHON_COMPILING_IN_PYSTON 0 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #undef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 0 + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #if PY_VERSION_HEX < 0x03050000 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #elif !defined(CYTHON_USE_ASYNC_SLOTS) + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #undef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 0 + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #undef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 1 + #undef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 0 + #undef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 0 + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #undef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE 0 + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 +#elif defined(PYSTON_VERSION) + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_PYSTON 1 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #ifndef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 1 + #endif + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #ifndef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 1 + #endif + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #ifndef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 0 + #endif + #ifndef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 1 + #endif + #ifndef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 1 + #endif + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #undef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE 0 + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 +#else + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_PYSTON 0 + #define CYTHON_COMPILING_IN_CPYTHON 1 + #ifndef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 1 + #endif + #if PY_VERSION_HEX < 0x02070000 + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #elif !defined(CYTHON_USE_PYTYPE_LOOKUP) + #define CYTHON_USE_PYTYPE_LOOKUP 1 + #endif + #if PY_MAJOR_VERSION < 3 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #elif !defined(CYTHON_USE_ASYNC_SLOTS) + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #if PY_VERSION_HEX < 0x02070000 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #elif !defined(CYTHON_USE_PYLONG_INTERNALS) + #define CYTHON_USE_PYLONG_INTERNALS 1 + #endif + #ifndef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 1 + #endif + #ifndef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 1 + #endif + #if PY_VERSION_HEX < 0x030300F0 + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #elif !defined(CYTHON_USE_UNICODE_WRITER) + #define CYTHON_USE_UNICODE_WRITER 1 + #endif + #ifndef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 0 + #endif + #ifndef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 1 + #endif + #ifndef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 1 + #endif + #ifndef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 1 + #endif + #ifndef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 1 + #endif + #ifndef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000) + #endif + #ifndef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1) + #endif + #ifndef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1) + #endif + #ifndef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3) + #endif +#endif +#if !defined(CYTHON_FAST_PYCCALL) +#define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) +#endif +#if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #undef SHIFT + #undef BASE + #undef MASK + #ifdef SIZEOF_VOID_P + enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) }; + #endif +#endif +#ifndef __has_attribute + #define __has_attribute(x) 0 +#endif +#ifndef __has_cpp_attribute + #define __has_cpp_attribute(x) 0 +#endif +#ifndef CYTHON_RESTRICT + #if defined(__GNUC__) + #define CYTHON_RESTRICT __restrict__ + #elif defined(_MSC_VER) && _MSC_VER >= 1400 + #define CYTHON_RESTRICT __restrict + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_RESTRICT restrict + #else + #define CYTHON_RESTRICT + #endif +#endif +#ifndef CYTHON_UNUSED +# if defined(__GNUC__) +# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +#endif +#ifndef CYTHON_MAYBE_UNUSED_VAR +# if defined(__cplusplus) + template void CYTHON_MAYBE_UNUSED_VAR( const T& ) { } +# else +# define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x) +# endif +#endif +#ifndef CYTHON_NCP_UNUSED +# if CYTHON_COMPILING_IN_CPYTHON +# define CYTHON_NCP_UNUSED +# else +# define CYTHON_NCP_UNUSED CYTHON_UNUSED +# endif +#endif +#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) +#ifdef _MSC_VER + #ifndef _MSC_STDINT_H_ + #if _MSC_VER < 1300 + typedef unsigned char uint8_t; + typedef unsigned int uint32_t; + #else + typedef unsigned __int8 uint8_t; + typedef unsigned __int32 uint32_t; + #endif + #endif +#else + #include +#endif +#ifndef CYTHON_FALLTHROUGH + #if defined(__cplusplus) && __cplusplus >= 201103L + #if __has_cpp_attribute(fallthrough) + #define CYTHON_FALLTHROUGH [[fallthrough]] + #elif __has_cpp_attribute(clang::fallthrough) + #define CYTHON_FALLTHROUGH [[clang::fallthrough]] + #elif __has_cpp_attribute(gnu::fallthrough) + #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] + #endif + #endif + #ifndef CYTHON_FALLTHROUGH + #if __has_attribute(fallthrough) + #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) + #else + #define CYTHON_FALLTHROUGH + #endif + #endif + #if defined(__clang__ ) && defined(__apple_build_version__) + #if __apple_build_version__ < 7000000 + #undef CYTHON_FALLTHROUGH + #define CYTHON_FALLTHROUGH + #endif + #endif +#endif + +#ifndef CYTHON_INLINE + #if defined(__clang__) + #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) + #elif defined(__GNUC__) + #define CYTHON_INLINE __inline__ + #elif defined(_MSC_VER) + #define CYTHON_INLINE __inline + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_INLINE inline + #else + #define CYTHON_INLINE + #endif +#endif + +#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) + #define Py_OptimizeFlag 0 +#endif +#define __PYX_BUILD_PY_SSIZE_T "n" +#define CYTHON_FORMAT_SSIZE_T "z" +#if PY_MAJOR_VERSION < 3 + #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyClass_Type +#else + #define __Pyx_BUILTIN_MODULE_NAME "builtins" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyType_Type +#endif +#ifndef Py_TPFLAGS_CHECKTYPES + #define Py_TPFLAGS_CHECKTYPES 0 +#endif +#ifndef Py_TPFLAGS_HAVE_INDEX + #define Py_TPFLAGS_HAVE_INDEX 0 +#endif +#ifndef Py_TPFLAGS_HAVE_NEWBUFFER + #define Py_TPFLAGS_HAVE_NEWBUFFER 0 +#endif +#ifndef Py_TPFLAGS_HAVE_FINALIZE + #define Py_TPFLAGS_HAVE_FINALIZE 0 +#endif +#ifndef METH_STACKLESS + #define METH_STACKLESS 0 +#endif +#if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) + #ifndef METH_FASTCALL + #define METH_FASTCALL 0x80 + #endif + typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs); + typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args, + Py_ssize_t nargs, PyObject *kwnames); +#else + #define __Pyx_PyCFunctionFast _PyCFunctionFast + #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords +#endif +#if CYTHON_FAST_PYCCALL +#define __Pyx_PyFastCFunction_Check(func)\ + ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS))))) +#else +#define __Pyx_PyFastCFunction_Check(func) 0 +#endif +#if CYTHON_USE_DICT_VERSIONS +#define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) +#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ + (version_var) = __PYX_GET_DICT_VERSION(dict);\ + (cache_var) = (value); +#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ + static PY_UINT64_T __pyx_dict_version = 0;\ + static PyObject *__pyx_dict_cached_value = NULL;\ + if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ + (VAR) = __pyx_dict_cached_value;\ + } else {\ + (VAR) = __pyx_dict_cached_value = (LOOKUP);\ + __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ + }\ + } +#else +#define __PYX_GET_DICT_VERSION(dict) (0) +#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) +#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) + #define PyObject_Malloc(s) PyMem_Malloc(s) + #define PyObject_Free(p) PyMem_Free(p) + #define PyObject_Realloc(p) PyMem_Realloc(p) +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1 + #define PyMem_RawMalloc(n) PyMem_Malloc(n) + #define PyMem_RawRealloc(p, n) PyMem_Realloc(p, n) + #define PyMem_RawFree(p) PyMem_Free(p) +#endif +#if CYTHON_COMPILING_IN_PYSTON + #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co) + #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno) +#else + #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) + #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) +#endif +#if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000 + #define __Pyx_PyThreadState_Current PyThreadState_GET() +#elif PY_VERSION_HEX >= 0x03060000 + #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() +#elif PY_VERSION_HEX >= 0x03000000 + #define __Pyx_PyThreadState_Current PyThreadState_GET() +#else + #define __Pyx_PyThreadState_Current _PyThreadState_Current +#endif +#if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) +#include "pythread.h" +#define Py_tss_NEEDS_INIT 0 +typedef int Py_tss_t; +static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) { + *key = PyThread_create_key(); + return 0; // PyThread_create_key reports success always +} +static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) { + Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t)); + *key = Py_tss_NEEDS_INIT; + return key; +} +static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) { + PyObject_Free(key); +} +static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) { + return *key != Py_tss_NEEDS_INIT; +} +static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) { + PyThread_delete_key(*key); + *key = Py_tss_NEEDS_INIT; +} +static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) { + return PyThread_set_key_value(*key, value); +} +static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { + return PyThread_get_key_value(*key); +} +#endif // TSS (Thread Specific Storage) API +#if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized) +#define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) +#else +#define __Pyx_PyDict_NewPresized(n) PyDict_New() +#endif +#if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION + #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) +#else + #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS +#define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) +#else +#define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name) +#endif +#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) + #define CYTHON_PEP393_ENABLED 1 + #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ + 0 : _PyUnicode_Ready((PyObject *)(op))) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) + #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) + #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) + #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) + #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) + #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch) + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) +#else + #define CYTHON_PEP393_ENABLED 0 + #define PyUnicode_1BYTE_KIND 1 + #define PyUnicode_2BYTE_KIND 2 + #define PyUnicode_4BYTE_KIND 4 + #define __Pyx_PyUnicode_READY(op) (0) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) + #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111) + #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) + #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) + #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) + #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch) + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) +#endif +#if CYTHON_COMPILING_IN_PYPY + #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) +#else + #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ + PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains) + #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check) + #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format) + #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) +#endif +#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) +#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) +#else + #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) +#endif +#if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) + #define PyObject_ASCII(o) PyObject_Repr(o) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBaseString_Type PyUnicode_Type + #define PyStringObject PyUnicodeObject + #define PyString_Type PyUnicode_Type + #define PyString_Check PyUnicode_Check + #define PyString_CheckExact PyUnicode_CheckExact + #define PyObject_Unicode PyObject_Str +#endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) + #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) +#else + #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) + #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) +#endif +#ifndef PySet_CheckExact + #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) +#endif +#if CYTHON_ASSUME_SAFE_MACROS + #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) +#else + #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyIntObject PyLongObject + #define PyInt_Type PyLong_Type + #define PyInt_Check(op) PyLong_Check(op) + #define PyInt_CheckExact(op) PyLong_CheckExact(op) + #define PyInt_FromString PyLong_FromString + #define PyInt_FromUnicode PyLong_FromUnicode + #define PyInt_FromLong PyLong_FromLong + #define PyInt_FromSize_t PyLong_FromSize_t + #define PyInt_FromSsize_t PyLong_FromSsize_t + #define PyInt_AsLong PyLong_AsLong + #define PyInt_AS_LONG PyLong_AS_LONG + #define PyInt_AsSsize_t PyLong_AsSsize_t + #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask + #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask + #define PyNumber_Int PyNumber_Long +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBoolObject PyLongObject +#endif +#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY + #ifndef PyUnicode_InternFromString + #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) + #endif +#endif +#if PY_VERSION_HEX < 0x030200A4 + typedef long Py_hash_t; + #define __Pyx_PyInt_FromHash_t PyInt_FromLong + #define __Pyx_PyInt_AsHash_t PyInt_AsLong +#else + #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t + #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t +#endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : (Py_INCREF(func), func)) +#else + #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) +#endif +#if CYTHON_USE_ASYNC_SLOTS + #if PY_VERSION_HEX >= 0x030500B1 + #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods + #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) + #else + #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) + #endif +#else + #define __Pyx_PyType_AsAsync(obj) NULL +#endif +#ifndef __Pyx_PyAsyncMethodsStruct + typedef struct { + unaryfunc am_await; + unaryfunc am_aiter; + unaryfunc am_anext; + } __Pyx_PyAsyncMethodsStruct; +#endif + +#if defined(WIN32) || defined(MS_WINDOWS) + #define _USE_MATH_DEFINES +#endif +#include +#ifdef NAN +#define __PYX_NAN() ((float) NAN) +#else +static CYTHON_INLINE float __PYX_NAN() { + float value; + memset(&value, 0xFF, sizeof(value)); + return value; +} +#endif +#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) +#define __Pyx_truncl trunc +#else +#define __Pyx_truncl truncl +#endif + + +#define __PYX_ERR(f_index, lineno, Ln_error) \ +{ \ + __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \ +} + +#ifndef __PYX_EXTERN_C + #ifdef __cplusplus + #define __PYX_EXTERN_C extern "C" + #else + #define __PYX_EXTERN_C extern + #endif +#endif + +#define __PYX_HAVE__gevent___event +#define __PYX_HAVE_API__gevent___event +/* Early includes */ +#include "greenlet/greenlet.h" +#ifdef _OPENMP +#include +#endif /* _OPENMP */ + +#if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) +#define CYTHON_WITHOUT_ASSERTIONS +#endif + +typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; + const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; + +#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 +#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0 +#define __PYX_DEFAULT_STRING_ENCODING "" +#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString +#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#define __Pyx_uchar_cast(c) ((unsigned char)c) +#define __Pyx_long_cast(x) ((long)x) +#define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ + (sizeof(type) < sizeof(Py_ssize_t)) ||\ + (sizeof(type) > sizeof(Py_ssize_t) &&\ + likely(v < (type)PY_SSIZE_T_MAX ||\ + v == (type)PY_SSIZE_T_MAX) &&\ + (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ + v == (type)PY_SSIZE_T_MIN))) ||\ + (sizeof(type) == sizeof(Py_ssize_t) &&\ + (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ + v == (type)PY_SSIZE_T_MAX))) ) +static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) { + return (size_t) i < (size_t) limit; +} +#if defined (__cplusplus) && __cplusplus >= 201103L + #include + #define __Pyx_sst_abs(value) std::abs(value) +#elif SIZEOF_INT >= SIZEOF_SIZE_T + #define __Pyx_sst_abs(value) abs(value) +#elif SIZEOF_LONG >= SIZEOF_SIZE_T + #define __Pyx_sst_abs(value) labs(value) +#elif defined (_MSC_VER) + #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) +#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define __Pyx_sst_abs(value) llabs(value) +#elif defined (__GNUC__) + #define __Pyx_sst_abs(value) __builtin_llabs(value) +#else + #define __Pyx_sst_abs(value) ((value<0) ? -value : value) +#endif +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*); +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); +#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) +#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) +#define __Pyx_PyBytes_FromString PyBytes_FromString +#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); +#if PY_MAJOR_VERSION < 3 + #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#else + #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize +#endif +#define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) +#define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) +#define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) +#define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) +#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) +static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) { + const Py_UNICODE *u_end = u; + while (*u_end++) ; + return (size_t)(u_end - u - 1); +} +#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) +#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode +#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode +#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) +#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) +static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); +static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*); +static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); +#define __Pyx_PySequence_Tuple(obj)\ + (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); +#if CYTHON_ASSUME_SAFE_MACROS +#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) +#else +#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) +#endif +#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) +#if PY_MAJOR_VERSION >= 3 +#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) +#else +#define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) +#endif +#define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x)) +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII +static int __Pyx_sys_getdefaultencoding_not_ascii; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + PyObject* ascii_chars_u = NULL; + PyObject* ascii_chars_b = NULL; + const char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + if (strcmp(default_encoding_c, "ascii") == 0) { + __Pyx_sys_getdefaultencoding_not_ascii = 0; + } else { + char ascii_chars[128]; + int c; + for (c = 0; c < 128; c++) { + ascii_chars[c] = c; + } + __Pyx_sys_getdefaultencoding_not_ascii = 1; + ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); + if (!ascii_chars_u) goto bad; + ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); + if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { + PyErr_Format( + PyExc_ValueError, + "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", + default_encoding_c); + goto bad; + } + Py_DECREF(ascii_chars_u); + Py_DECREF(ascii_chars_b); + } + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + Py_XDECREF(ascii_chars_u); + Py_XDECREF(ascii_chars_b); + return -1; +} +#endif +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) +#else +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +static char* __PYX_DEFAULT_STRING_ENCODING; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1); + if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; + strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + return -1; +} +#endif +#endif + + +/* Test for GCC > 2.95 */ +#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) + #define likely(x) __builtin_expect(!!(x), 1) + #define unlikely(x) __builtin_expect(!!(x), 0) +#else /* !__GNUC__ or GCC < 2.95 */ + #define likely(x) (x) + #define unlikely(x) (x) +#endif /* __GNUC__ */ +static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } + +static PyObject *__pyx_m = NULL; +static PyObject *__pyx_d; +static PyObject *__pyx_b; +static PyObject *__pyx_cython_runtime = NULL; +static PyObject *__pyx_empty_tuple; +static PyObject *__pyx_empty_bytes; +static PyObject *__pyx_empty_unicode; +static int __pyx_lineno; +static int __pyx_clineno = 0; +static const char * __pyx_cfilenm= __FILE__; +static const char *__pyx_filename; + + +static const char *__pyx_f[] = { + "src\\gevent\\event.py", + "src\\gevent\\_event.pxd", + "src\\gevent\\__greenlet_primitives.pxd", + "src\\gevent\\__abstract_linkable.pxd", +}; + +/*--- Type declarations ---*/ +struct __pyx_obj_6gevent_21__greenlet_primitives_TrackedRawGreenlet; +struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop; +struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable; +struct __pyx_obj_6gevent_6_event_Event; +struct __pyx_obj_6gevent_6_event_AsyncResult; +struct __pyx_opt_args_6gevent_19__abstract_linkable_16AbstractLinkable__wait_core; +struct __pyx_opt_args_6gevent_19__abstract_linkable_16AbstractLinkable__wait; + +/* "gevent/__abstract_linkable.pxd":51 + * cdef _check_and_notify(self) + * cpdef _notify_links(self) + * cdef _wait_core(self, timeout, catch=*) # <<<<<<<<<<<<<< + * cdef _wait_return_value(self, waited, wait_success) + * cdef _wait(self, timeout=*) + */ +struct __pyx_opt_args_6gevent_19__abstract_linkable_16AbstractLinkable__wait_core { + int __pyx_n; + PyObject *catch; +}; + +/* "gevent/__abstract_linkable.pxd":53 + * cdef _wait_core(self, timeout, catch=*) + * cdef _wait_return_value(self, waited, wait_success) + * cdef _wait(self, timeout=*) # <<<<<<<<<<<<<< + */ +struct __pyx_opt_args_6gevent_19__abstract_linkable_16AbstractLinkable__wait { + int __pyx_n; + PyObject *timeout; +}; +struct __pyx_opt_args_6gevent_6_event_11AsyncResult_get; +struct __pyx_opt_args_6gevent_6_event_11AsyncResult_wait; + +/* "gevent/_event.pxd":23 + * cdef public int _imap_task_index + * + * cpdef get(self, block=*, timeout=*) # <<<<<<<<<<<<<< + * cpdef bint successful(self) + * + */ +struct __pyx_opt_args_6gevent_6_event_11AsyncResult_get { + int __pyx_n; + PyObject *block; + PyObject *timeout; +}; + +/* "gevent/_event.pxd":26 + * cpdef bint successful(self) + * + * cpdef wait(self, timeout=*) # <<<<<<<<<<<<<< + * cpdef bint done(self) + * + */ +struct __pyx_opt_args_6gevent_6_event_11AsyncResult_wait { + int __pyx_n; + PyObject *timeout; +}; + +/* "gevent/__greenlet_primitives.pxd":37 + * return PyGreenlet_Switch(self, NULL, NULL) + * + * cdef class TrackedRawGreenlet(greenlet): # <<<<<<<<<<<<<< + * pass + * + */ +struct __pyx_obj_6gevent_21__greenlet_primitives_TrackedRawGreenlet { + PyGreenlet __pyx_base; +}; + + +/* "gevent/__greenlet_primitives.pxd":40 + * pass + * + * cdef class SwitchOutGreenletWithLoop(TrackedRawGreenlet): # <<<<<<<<<<<<<< + * cdef public loop + * + */ +struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop { + struct __pyx_obj_6gevent_21__greenlet_primitives_TrackedRawGreenlet __pyx_base; + struct __pyx_vtabstruct_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *__pyx_vtab; + PyObject *loop; +}; + + +/* "gevent/__abstract_linkable.pxd":32 + * cdef void _init() + * + * cdef class AbstractLinkable(object): # <<<<<<<<<<<<<< + * # We declare the __weakref__ here in the base (even though + * # that's not really what we want) as a workaround for a Cython + */ +struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable { + PyObject_HEAD + struct __pyx_vtabstruct_6gevent_19__abstract_linkable_AbstractLinkable *__pyx_vtab; + PyObject *__weakref__; + struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *hub; + PyObject *_notifier; + PyObject *_links; + int _notify_all; +}; + + +/* "gevent/_event.pxd":13 + * cdef Timeout + * + * cdef class Event(AbstractLinkable): # <<<<<<<<<<<<<< + * cdef bint _flag + * + */ +struct __pyx_obj_6gevent_6_event_Event { + struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable __pyx_base; + int _flag; +}; + + +/* "gevent/_event.pxd":16 + * cdef bint _flag + * + * cdef class AsyncResult(AbstractLinkable): # <<<<<<<<<<<<<< + * cdef readonly _value + * cdef readonly tuple _exc_info + */ +struct __pyx_obj_6gevent_6_event_AsyncResult { + struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable __pyx_base; + PyObject *_value; + PyObject *_exc_info; + int _imap_task_index; +}; + + + +/* "gevent/__greenlet_primitives.pxd":40 + * pass + * + * cdef class SwitchOutGreenletWithLoop(TrackedRawGreenlet): # <<<<<<<<<<<<<< + * cdef public loop + * + */ + +struct __pyx_vtabstruct_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop { + PyObject *(*__pyx_switch)(struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *, int __pyx_skip_dispatch); + PyObject *(*switch_out)(struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *, int __pyx_skip_dispatch); +}; +static struct __pyx_vtabstruct_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *__pyx_vtabptr_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop; + + +/* "gevent/__abstract_linkable.pxd":32 + * cdef void _init() + * + * cdef class AbstractLinkable(object): # <<<<<<<<<<<<<< + * # We declare the __weakref__ here in the base (even though + * # that's not really what we want) as a workaround for a Cython + */ + +struct __pyx_vtabstruct_6gevent_19__abstract_linkable_AbstractLinkable { + PyObject *(*rawlink)(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *, PyObject *, int __pyx_skip_dispatch); + int (*ready)(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *, int __pyx_skip_dispatch); + PyObject *(*unlink)(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *, PyObject *, int __pyx_skip_dispatch); + PyObject *(*_check_and_notify)(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *); + PyObject *(*_notify_links)(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *, int __pyx_skip_dispatch); + PyObject *(*_wait_core)(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *, PyObject *, struct __pyx_opt_args_6gevent_19__abstract_linkable_16AbstractLinkable__wait_core *__pyx_optional_args); + PyObject *(*_wait_return_value)(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *, PyObject *, PyObject *); + PyObject *(*_wait)(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *, struct __pyx_opt_args_6gevent_19__abstract_linkable_16AbstractLinkable__wait *__pyx_optional_args); +}; +static struct __pyx_vtabstruct_6gevent_19__abstract_linkable_AbstractLinkable *__pyx_vtabptr_6gevent_19__abstract_linkable_AbstractLinkable; + + +/* "src/gevent/event.py":30 + * # pylint:disable=assigning-non-slot + * + * class Event(AbstractLinkable): # pylint:disable=undefined-variable # <<<<<<<<<<<<<< + * """A synchronization primitive that allows one greenlet to wake up one or more others. + * It has the same interface as :class:`threading.Event` but works across greenlets. + */ + +struct __pyx_vtabstruct_6gevent_6_event_Event { + struct __pyx_vtabstruct_6gevent_19__abstract_linkable_AbstractLinkable __pyx_base; +}; +static struct __pyx_vtabstruct_6gevent_6_event_Event *__pyx_vtabptr_6gevent_6_event_Event; + + +/* "src/gevent/event.py":136 + * + * + * class AsyncResult(AbstractLinkable): # pylint:disable=undefined-variable # <<<<<<<<<<<<<< + * """A one-time event that stores a value or an exception. + * + */ + +struct __pyx_vtabstruct_6gevent_6_event_AsyncResult { + struct __pyx_vtabstruct_6gevent_19__abstract_linkable_AbstractLinkable __pyx_base; + PyObject *(*get)(struct __pyx_obj_6gevent_6_event_AsyncResult *, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_6_event_11AsyncResult_get *__pyx_optional_args); + int (*successful)(struct __pyx_obj_6gevent_6_event_AsyncResult *, int __pyx_skip_dispatch); + PyObject *(*wait)(struct __pyx_obj_6gevent_6_event_AsyncResult *, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_6_event_11AsyncResult_wait *__pyx_optional_args); + int (*done)(struct __pyx_obj_6gevent_6_event_AsyncResult *, int __pyx_skip_dispatch); + int (*cancel)(struct __pyx_obj_6gevent_6_event_AsyncResult *, int __pyx_skip_dispatch); + int (*cancelled)(struct __pyx_obj_6gevent_6_event_AsyncResult *, int __pyx_skip_dispatch); +}; +static struct __pyx_vtabstruct_6gevent_6_event_AsyncResult *__pyx_vtabptr_6gevent_6_event_AsyncResult; + +/* --- Runtime support code (head) --- */ +/* Refnanny.proto */ +#ifndef CYTHON_REFNANNY + #define CYTHON_REFNANNY 0 +#endif +#if CYTHON_REFNANNY + typedef struct { + void (*INCREF)(void*, PyObject*, int); + void (*DECREF)(void*, PyObject*, int); + void (*GOTREF)(void*, PyObject*, int); + void (*GIVEREF)(void*, PyObject*, int); + void* (*SetupContext)(const char*, int, const char*); + void (*FinishContext)(void**); + } __Pyx_RefNannyAPIStruct; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); + #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; +#ifdef WITH_THREAD + #define __Pyx_RefNannySetupContext(name, acquire_gil)\ + if (acquire_gil) {\ + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ + PyGILState_Release(__pyx_gilstate_save);\ + } else {\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ + } +#else + #define __Pyx_RefNannySetupContext(name, acquire_gil)\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) +#endif + #define __Pyx_RefNannyFinishContext()\ + __Pyx_RefNanny->FinishContext(&__pyx_refnanny) + #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0) + #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) + #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) + #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) +#else + #define __Pyx_RefNannyDeclarations + #define __Pyx_RefNannySetupContext(name, acquire_gil) + #define __Pyx_RefNannyFinishContext() + #define __Pyx_INCREF(r) Py_INCREF(r) + #define __Pyx_DECREF(r) Py_DECREF(r) + #define __Pyx_GOTREF(r) + #define __Pyx_GIVEREF(r) + #define __Pyx_XINCREF(r) Py_XINCREF(r) + #define __Pyx_XDECREF(r) Py_XDECREF(r) + #define __Pyx_XGOTREF(r) + #define __Pyx_XGIVEREF(r) +#endif +#define __Pyx_XDECREF_SET(r, v) do {\ + PyObject *tmp = (PyObject *) r;\ + r = v; __Pyx_XDECREF(tmp);\ + } while (0) +#define __Pyx_DECREF_SET(r, v) do {\ + PyObject *tmp = (PyObject *) r;\ + r = v; __Pyx_DECREF(tmp);\ + } while (0) +#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) +#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) + +/* PyObjectGetAttrStr.proto */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); +#else +#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) +#endif + +/* GetBuiltinName.proto */ +static PyObject *__Pyx_GetBuiltinName(PyObject *name); + +/* PyObjectCall.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); +#else +#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) +#endif + +/* RaiseArgTupleInvalid.proto */ +static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, + Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); + +/* KeywordStringCheck.proto */ +static int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* function_name, int kw_allowed); + +/* PyFunctionFastCall.proto */ +#if CYTHON_FAST_PYCALL +#define __Pyx_PyFunction_FastCall(func, args, nargs)\ + __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) +#if 1 || PY_VERSION_HEX < 0x030600B1 +static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs); +#else +#define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs) +#endif +#define __Pyx_BUILD_ASSERT_EXPR(cond)\ + (sizeof(char [1 - 2*!(cond)]) - 1) +#ifndef Py_MEMBER_SIZE +#define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member) +#endif + static size_t __pyx_pyframe_localsplus_offset = 0; + #include "frameobject.h" + #define __Pxy_PyFrame_Initialize_Offsets()\ + ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\ + (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus))) + #define __Pyx_PyFrame_GetLocalsplus(frame)\ + (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset)) +#endif + +/* PyObjectCallMethO.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); +#endif + +/* PyObjectCallNoArg.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); +#else +#define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL) +#endif + +/* PyCFunctionFastCall.proto */ +#if CYTHON_FAST_PYCCALL +static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs); +#else +#define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL) +#endif + +/* PyObjectCallOneArg.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); + +/* PyThreadStateGet.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; +#define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; +#define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type +#else +#define __Pyx_PyThreadState_declare +#define __Pyx_PyThreadState_assign +#define __Pyx_PyErr_Occurred() PyErr_Occurred() +#endif + +/* PyErrFetchRestore.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) +#define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) +#define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) +#define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) +#define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); +static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) +#else +#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) +#endif +#else +#define __Pyx_PyErr_Clear() PyErr_Clear() +#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) +#define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) +#define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb) +#define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) +#endif + +/* WriteUnraisableException.proto */ +static void __Pyx_WriteUnraisable(const char *name, int clineno, + int lineno, const char *filename, + int full_traceback, int nogil); + +/* RaiseDoubleKeywords.proto */ +static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); + +/* ParseKeywords.proto */ +static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\ + PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\ + const char* function_name); + +/* GetModuleGlobalName.proto */ +#if CYTHON_USE_DICT_VERSIONS +#define __Pyx_GetModuleGlobalName(var, name) {\ + static PY_UINT64_T __pyx_dict_version = 0;\ + static PyObject *__pyx_dict_cached_value = NULL;\ + (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\ + (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\ + __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ +} +#define __Pyx_GetModuleGlobalNameUncached(var, name) {\ + PY_UINT64_T __pyx_dict_version;\ + PyObject *__pyx_dict_cached_value;\ + (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ +} +static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value); +#else +#define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name) +#define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name) +static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name); +#endif + +/* GetItemInt.proto */ +#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ + __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\ + (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\ + __Pyx_GetItemInt_Generic(o, to_py_func(i)))) +#define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ + __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ + (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL)) +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, + int wraparound, int boundscheck); +#define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ + __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ + (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL)) +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, + int wraparound, int boundscheck); +static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j); +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, + int is_list, int wraparound, int boundscheck); + +/* PyObjectCall2Args.proto */ +static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2); + +/* RaiseException.proto */ +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); + +/* PyErrExceptionMatches.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) +static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); +#else +#define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) +#endif + +/* GetAttr.proto */ +static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *); + +/* GetAttr3.proto */ +static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *); + +/* CallNextTpDealloc.proto */ +static void __Pyx_call_next_tp_dealloc(PyObject* obj, destructor current_tp_dealloc); + +/* CallNextTpTraverse.proto */ +static int __Pyx_call_next_tp_traverse(PyObject* obj, visitproc v, void *a, traverseproc current_tp_traverse); + +/* CallNextTpClear.proto */ +static void __Pyx_call_next_tp_clear(PyObject* obj, inquiry current_tp_dealloc); + +/* TypeImport.proto */ +#ifndef __PYX_HAVE_RT_ImportType_proto +#define __PYX_HAVE_RT_ImportType_proto +enum __Pyx_ImportType_CheckSize { + __Pyx_ImportType_CheckSize_Error = 0, + __Pyx_ImportType_CheckSize_Warn = 1, + __Pyx_ImportType_CheckSize_Ignore = 2 +}; +static PyTypeObject *__Pyx_ImportType(PyObject* module, const char *module_name, const char *class_name, size_t size, enum __Pyx_ImportType_CheckSize check_size); +#endif + +/* GetVTable.proto */ +static void* __Pyx_GetVtable(PyObject *dict); + +/* PyObject_GenericGetAttrNoDict.proto */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name); +#else +#define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr +#endif + +/* PyObject_GenericGetAttr.proto */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name); +#else +#define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr +#endif + +/* SetVTable.proto */ +static int __Pyx_SetVtable(PyObject *dict, void *vtable); + +/* Import.proto */ +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); + +/* ImportFrom.proto */ +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); + +/* FetchCommonType.proto */ +static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); + +/* CythonFunction.proto */ +#define __Pyx_CyFunction_USED 1 +#define __Pyx_CYFUNCTION_STATICMETHOD 0x01 +#define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 +#define __Pyx_CYFUNCTION_CCLASS 0x04 +#define __Pyx_CyFunction_GetClosure(f)\ + (((__pyx_CyFunctionObject *) (f))->func_closure) +#define __Pyx_CyFunction_GetClassObj(f)\ + (((__pyx_CyFunctionObject *) (f))->func_classobj) +#define __Pyx_CyFunction_Defaults(type, f)\ + ((type *)(((__pyx_CyFunctionObject *) (f))->defaults)) +#define __Pyx_CyFunction_SetDefaultsGetter(f, g)\ + ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g) +typedef struct { + PyCFunctionObject func; +#if PY_VERSION_HEX < 0x030500A0 + PyObject *func_weakreflist; +#endif + PyObject *func_dict; + PyObject *func_name; + PyObject *func_qualname; + PyObject *func_doc; + PyObject *func_globals; + PyObject *func_code; + PyObject *func_closure; + PyObject *func_classobj; + void *defaults; + int defaults_pyobjects; + int flags; + PyObject *defaults_tuple; + PyObject *defaults_kwdict; + PyObject *(*defaults_getter)(PyObject *); + PyObject *func_annotations; +} __pyx_CyFunctionObject; +static PyTypeObject *__pyx_CyFunctionType = 0; +#define __Pyx_CyFunction_Check(obj) (__Pyx_TypeCheck(obj, __pyx_CyFunctionType)) +#define __Pyx_CyFunction_NewEx(ml, flags, qualname, self, module, globals, code)\ + __Pyx_CyFunction_New(__pyx_CyFunctionType, ml, flags, qualname, self, module, globals, code) +static PyObject *__Pyx_CyFunction_New(PyTypeObject *, PyMethodDef *ml, + int flags, PyObject* qualname, + PyObject *self, + PyObject *module, PyObject *globals, + PyObject* code); +static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, + size_t size, + int pyobjects); +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, + PyObject *tuple); +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, + PyObject *dict); +static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m, + PyObject *dict); +static int __pyx_CyFunction_init(void); + +/* PyObjectSetAttrStr.proto */ +#if CYTHON_USE_TYPE_SLOTS +#define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o, n, NULL) +static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value); +#else +#define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n) +#define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v) +#endif + +/* GetNameInClass.proto */ +#define __Pyx_GetNameInClass(var, nmspace, name) (var) = __Pyx__GetNameInClass(nmspace, name) +static PyObject *__Pyx__GetNameInClass(PyObject *nmspace, PyObject *name); + +/* Globals.proto */ +static PyObject* __Pyx_Globals(void); + +/* CLineInTraceback.proto */ +#ifdef CYTHON_CLINE_IN_TRACEBACK +#define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) +#else +static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line); +#endif + +/* CodeObjectCache.proto */ +typedef struct { + PyCodeObject* code_object; + int code_line; +} __Pyx_CodeObjectCacheEntry; +struct __Pyx_CodeObjectCache { + int count; + int max_count; + __Pyx_CodeObjectCacheEntry* entries; +}; +static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); +static PyCodeObject *__pyx_find_code_object(int code_line); +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); + +/* AddTraceback.proto */ +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename); + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); + +/* CIntFromPy.proto */ +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); + +/* CIntFromPy.proto */ +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); + +/* FastTypeChecks.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) +static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b); +static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type); +static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2); +#else +#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) +#define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) +#define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) +#endif +#define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) + +/* CheckBinaryVersion.proto */ +static int __Pyx_check_binary_version(void); + +/* VoidPtrExport.proto */ +static int __Pyx_ExportVoidPtr(PyObject *name, void *p, const char *sig); + +/* VoidPtrImport.proto */ +static int __Pyx_ImportVoidPtr(PyObject *module, const char *name, void **p, const char *sig); + +/* FunctionImport.proto */ +static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig); + +/* InitStrings.proto */ +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); + +static int __pyx_f_6gevent_6_event_5Event_ready(struct __pyx_obj_6gevent_6_event_Event *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/ +static PyObject *__pyx_f_6gevent_6_event_5Event__wait_return_value(struct __pyx_obj_6gevent_6_event_Event *__pyx_v_self, PyObject *__pyx_v_waited, PyObject *__pyx_v_wait_success); /* proto*/ +static int __pyx_f_6gevent_6_event_11AsyncResult_ready(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/ +static int __pyx_f_6gevent_6_event_11AsyncResult_successful(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/ +static PyObject *__pyx_f_6gevent_6_event_11AsyncResult_get(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_6_event_11AsyncResult_get *__pyx_optional_args); /* proto*/ +static PyObject *__pyx_f_6gevent_6_event_11AsyncResult__wait_return_value(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_waited, CYTHON_UNUSED PyObject *__pyx_v_wait_success); /* proto*/ +static PyObject *__pyx_f_6gevent_6_event_11AsyncResult_wait(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_6_event_11AsyncResult_wait *__pyx_optional_args); /* proto*/ +static int __pyx_f_6gevent_6_event_11AsyncResult_done(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/ +static int __pyx_f_6gevent_6_event_11AsyncResult_cancel(CYTHON_UNUSED struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/ +static int __pyx_f_6gevent_6_event_11AsyncResult_cancelled(CYTHON_UNUSED struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/ + +/* Module declarations from 'cython' */ + +/* Module declarations from 'greenlet' */ + +/* Module declarations from 'gevent.__greenlet_primitives' */ +static PyTypeObject *__pyx_ptype_6gevent_21__greenlet_primitives_greenlet = 0; +static PyTypeObject *__pyx_ptype_6gevent_21__greenlet_primitives_TrackedRawGreenlet = 0; +static PyTypeObject *__pyx_ptype_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop = 0; +static PyObject **__pyx_vp_6gevent_21__greenlet_primitives_get_objects = 0; +#define __pyx_v_6gevent_21__greenlet_primitives_get_objects (*__pyx_vp_6gevent_21__greenlet_primitives_get_objects) +static PyObject **__pyx_vp_6gevent_21__greenlet_primitives_wref = 0; +#define __pyx_v_6gevent_21__greenlet_primitives_wref (*__pyx_vp_6gevent_21__greenlet_primitives_wref) +static PyObject **__pyx_vp_6gevent_21__greenlet_primitives_BlockingSwitchOutError = 0; +#define __pyx_v_6gevent_21__greenlet_primitives_BlockingSwitchOutError (*__pyx_vp_6gevent_21__greenlet_primitives_BlockingSwitchOutError) +static int *__pyx_vp_6gevent_21__greenlet_primitives__greenlet_imported = 0; +#define __pyx_v_6gevent_21__greenlet_primitives__greenlet_imported (*__pyx_vp_6gevent_21__greenlet_primitives__greenlet_imported) + +/* Module declarations from 'gevent.__hub_local' */ +static PyObject **__pyx_vp_6gevent_11__hub_local__threadlocal = 0; +#define __pyx_v_6gevent_11__hub_local__threadlocal (*__pyx_vp_6gevent_11__hub_local__threadlocal) +static struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *(*__pyx_f_6gevent_11__hub_local_get_hub_noargs)(int __pyx_skip_dispatch); /*proto*/ + +/* Module declarations from 'gevent.__abstract_linkable' */ +static PyTypeObject *__pyx_ptype_6gevent_19__abstract_linkable_greenlet = 0; +static PyTypeObject *__pyx_ptype_6gevent_19__abstract_linkable_AbstractLinkable = 0; +static PyObject **__pyx_vp_6gevent_19__abstract_linkable_InvalidSwitchError = 0; +#define __pyx_v_6gevent_19__abstract_linkable_InvalidSwitchError (*__pyx_vp_6gevent_19__abstract_linkable_InvalidSwitchError) +static PyObject **__pyx_vp_6gevent_19__abstract_linkable_Timeout = 0; +#define __pyx_v_6gevent_19__abstract_linkable_Timeout (*__pyx_vp_6gevent_19__abstract_linkable_Timeout) +static int *__pyx_vp_6gevent_19__abstract_linkable__greenlet_imported = 0; +#define __pyx_v_6gevent_19__abstract_linkable__greenlet_imported (*__pyx_vp_6gevent_19__abstract_linkable__greenlet_imported) + +/* Module declarations from 'gevent._event' */ +static PyTypeObject *__pyx_ptype_6gevent_6_event_Event = 0; +static PyTypeObject *__pyx_ptype_6gevent_6_event_AsyncResult = 0; +static PyObject *__pyx_v_6gevent_6_event__None = 0; +static PyObject *__pyx_v_6gevent_6_event_reraise = 0; +static PyObject *__pyx_v_6gevent_6_event_dump_traceback = 0; +static PyObject *__pyx_v_6gevent_6_event_load_traceback = 0; +static PyObject *__pyx_v_6gevent_6_event_Timeout = 0; +#define __Pyx_MODULE_NAME "gevent._event" +extern int __pyx_module_is_main_gevent___event; +int __pyx_module_is_main_gevent___event = 0; + +/* Implementation of 'gevent._event' */ +static PyObject *__pyx_builtin___import__; +static PyObject *__pyx_builtin_super; +static const char __pyx_k_s[] = "<%s "; +static const char __pyx_k_x[] = "x"; +static const char __pyx_k_all[] = "__all__"; +static const char __pyx_k_get[] = "get"; +static const char __pyx_k_set[] = "set"; +static const char __pyx_k_NONE[] = "_NONE"; +static const char __pyx_k_None[] = "_None"; +static const char __pyx_k_done[] = "done"; +static const char __pyx_k_flag[] = "_flag"; +static const char __pyx_k_init[] = "__init__"; +static const char __pyx_k_main[] = "__main__"; +static const char __pyx_k_name[] = "__name__"; +static const char __pyx_k_self[] = "self"; +static const char __pyx_k_test[] = "__test__"; +static const char __pyx_k_wait[] = "wait"; +static const char __pyx_k_Event[] = "Event"; +static const char __pyx_k_block[] = "block"; +static const char __pyx_k_class[] = "__class__"; +static const char __pyx_k_clear[] = "clear"; +static const char __pyx_k_isSet[] = "isSet"; +static const char __pyx_k_ready[] = "ready"; +static const char __pyx_k_slots[] = "__slots__"; +static const char __pyx_k_super[] = "super"; +static const char __pyx_k_unset[] = "unset "; +static const char __pyx_k_value[] = "value"; +static const char __pyx_k_cancel[] = "cancel"; +static const char __pyx_k_import[] = "__import__"; +static const char __pyx_k_is_set[] = "is_set"; +static const char __pyx_k_result[] = "result"; +static const char __pyx_k_source[] = "source"; +static const char __pyx_k_Timeout[] = "Timeout"; +static const char __pyx_k_links_s[] = " _links[%s]>"; +static const char __pyx_k_reraise[] = "reraise"; +static const char __pyx_k_timeout[] = "timeout"; +static const char __pyx_k_value_2[] = "_value"; +static const char __pyx_k_value_r[] = "value=%r "; +static const char __pyx_k_exc_info[] = "exc_info"; +static const char __pyx_k_pyx_capi[] = "__pyx_capi__"; +static const char __pyx_k_Event_set[] = "Event.set"; +static const char __pyx_k_cancelled[] = "cancelled"; +static const char __pyx_k_exception[] = "_exception"; +static const char __pyx_k_linkcount[] = "linkcount"; +static const char __pyx_k_Event_wait[] = "Event.wait"; +static const char __pyx_k_exc_info_2[] = "_exc_info"; +static const char __pyx_k_get_nowait[] = "get_nowait"; +static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__"; +static const char __pyx_k_set_result[] = "set_result"; +static const char __pyx_k_successful[] = "successful"; +static const char __pyx_k_AsyncResult[] = "AsyncResult"; +static const char __pyx_k_Event_clear[] = "Event.clear"; +static const char __pyx_k_Event_isSet[] = "Event.isSet"; +static const char __pyx_k_Event_ready[] = "Event.ready"; +static const char __pyx_k_exception_2[] = "exception"; +static const char __pyx_k_exception_r[] = "exception=%r "; +static const char __pyx_k_Event_is_set[] = "Event.is_set"; +static const char __pyx_k_get_linkable[] = "_get_linkable"; +static const char __pyx_k_gevent__util[] = "gevent._util"; +static const char __pyx_k_s_s__links_s[] = "<%s %s _links[%s]>"; +static const char __pyx_k_gevent__event[] = "gevent._event"; +static const char __pyx_k_gevent__tblib[] = "gevent._tblib"; +static const char __pyx_k_set_exception[] = "set_exception"; +static const char __pyx_k_dump_traceback[] = "dump_traceback"; +static const char __pyx_k_gevent__compat[] = "gevent._compat"; +static const char __pyx_k_gevent_timeout[] = "gevent.timeout"; +static const char __pyx_k_import_c_accel[] = "import_c_accel"; +static const char __pyx_k_load_traceback[] = "load_traceback"; +static const char __pyx_k_AsyncResult_get[] = "AsyncResult.get"; +static const char __pyx_k_AsyncResult_set[] = "AsyncResult.set"; +static const char __pyx_k_imap_task_index[] = "_imap_task_index"; +static const char __pyx_k_raise_exception[] = "_raise_exception"; +static const char __pyx_k_AbstractLinkable[] = "AbstractLinkable"; +static const char __pyx_k_AsyncResult_done[] = "AsyncResult.done"; +static const char __pyx_k_AsyncResult_wait[] = "AsyncResult.wait"; +static const char __pyx_k_AsyncResult_ready[] = "AsyncResult.ready"; +static const char __pyx_k_abstract_linkable[] = "_abstract_linkable"; +static const char __pyx_k_AsyncResult_cancel[] = "AsyncResult.cancel"; +static const char __pyx_k_AsyncResult_result[] = "AsyncResult.result"; +static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; +static const char __pyx_k_src_gevent_event_py[] = "src\\gevent\\event.py"; +static const char __pyx_k_reset_internal_locks[] = "_reset_internal_locks"; +static const char __pyx_k_AsyncResult_cancelled[] = "AsyncResult.cancelled"; +static const char __pyx_k_AsyncResult_get_nowait[] = "AsyncResult.get_nowait"; +static const char __pyx_k_AsyncResult_successful[] = "AsyncResult.successful"; +static const char __pyx_k_AsyncResult_set_exception[] = "AsyncResult.set_exception"; +static const char __pyx_k_gevent__abstract_linkable[] = "gevent._abstract_linkable"; +static const char __pyx_k_Event__reset_internal_locks[] = "Event._reset_internal_locks"; +static const char __pyx_k_AsyncResult__raise_exception[] = "AsyncResult._raise_exception"; +static const char __pyx_k_Basic_synchronization_primitives[] = "Basic synchronization primitives: Event and AsyncResult"; +static const char __pyx_k_if_we_didn_t_wait_we_should_alre[] = "if we didn't wait we should already be set"; +static PyObject *__pyx_n_s_AbstractLinkable; +static PyObject *__pyx_n_s_AsyncResult; +static PyObject *__pyx_n_s_AsyncResult__raise_exception; +static PyObject *__pyx_n_s_AsyncResult_cancel; +static PyObject *__pyx_n_s_AsyncResult_cancelled; +static PyObject *__pyx_n_s_AsyncResult_done; +static PyObject *__pyx_n_s_AsyncResult_get; +static PyObject *__pyx_n_s_AsyncResult_get_nowait; +static PyObject *__pyx_n_s_AsyncResult_ready; +static PyObject *__pyx_n_s_AsyncResult_result; +static PyObject *__pyx_n_s_AsyncResult_set; +static PyObject *__pyx_n_s_AsyncResult_set_exception; +static PyObject *__pyx_n_s_AsyncResult_successful; +static PyObject *__pyx_n_s_AsyncResult_wait; +static PyObject *__pyx_n_s_Event; +static PyObject *__pyx_n_s_Event__reset_internal_locks; +static PyObject *__pyx_n_s_Event_clear; +static PyObject *__pyx_n_s_Event_isSet; +static PyObject *__pyx_n_s_Event_is_set; +static PyObject *__pyx_n_s_Event_ready; +static PyObject *__pyx_n_s_Event_set; +static PyObject *__pyx_n_s_Event_wait; +static PyObject *__pyx_n_s_NONE; +static PyObject *__pyx_n_s_None; +static PyObject *__pyx_n_s_Timeout; +static PyObject *__pyx_n_s_abstract_linkable; +static PyObject *__pyx_n_s_all; +static PyObject *__pyx_n_s_block; +static PyObject *__pyx_n_s_cancel; +static PyObject *__pyx_n_s_cancelled; +static PyObject *__pyx_n_s_class; +static PyObject *__pyx_n_s_clear; +static PyObject *__pyx_n_s_cline_in_traceback; +static PyObject *__pyx_n_s_done; +static PyObject *__pyx_n_s_dump_traceback; +static PyObject *__pyx_n_s_exc_info; +static PyObject *__pyx_n_s_exc_info_2; +static PyObject *__pyx_n_s_exception; +static PyObject *__pyx_n_s_exception_2; +static PyObject *__pyx_kp_s_exception_r; +static PyObject *__pyx_n_s_flag; +static PyObject *__pyx_n_s_get; +static PyObject *__pyx_n_s_get_linkable; +static PyObject *__pyx_n_s_get_nowait; +static PyObject *__pyx_kp_s_gevent__abstract_linkable; +static PyObject *__pyx_n_s_gevent__compat; +static PyObject *__pyx_n_s_gevent__event; +static PyObject *__pyx_n_s_gevent__tblib; +static PyObject *__pyx_n_s_gevent__util; +static PyObject *__pyx_n_s_gevent_timeout; +static PyObject *__pyx_kp_s_if_we_didn_t_wait_we_should_alre; +static PyObject *__pyx_n_s_imap_task_index; +static PyObject *__pyx_n_s_import; +static PyObject *__pyx_n_s_import_c_accel; +static PyObject *__pyx_n_s_init; +static PyObject *__pyx_n_s_isSet; +static PyObject *__pyx_n_s_is_set; +static PyObject *__pyx_n_s_linkcount; +static PyObject *__pyx_kp_s_links_s; +static PyObject *__pyx_n_s_load_traceback; +static PyObject *__pyx_n_s_main; +static PyObject *__pyx_n_s_name; +static PyObject *__pyx_n_s_pyx_capi; +static PyObject *__pyx_n_s_pyx_vtable; +static PyObject *__pyx_n_s_raise_exception; +static PyObject *__pyx_n_s_ready; +static PyObject *__pyx_n_s_reraise; +static PyObject *__pyx_n_s_reset_internal_locks; +static PyObject *__pyx_n_s_result; +static PyObject *__pyx_kp_s_s; +static PyObject *__pyx_kp_s_s_s__links_s; +static PyObject *__pyx_n_s_self; +static PyObject *__pyx_n_s_set; +static PyObject *__pyx_n_s_set_exception; +static PyObject *__pyx_n_s_set_result; +static PyObject *__pyx_n_s_slots; +static PyObject *__pyx_n_s_source; +static PyObject *__pyx_kp_s_src_gevent_event_py; +static PyObject *__pyx_n_s_successful; +static PyObject *__pyx_n_s_super; +static PyObject *__pyx_n_s_test; +static PyObject *__pyx_n_s_timeout; +static PyObject *__pyx_kp_s_unset; +static PyObject *__pyx_n_s_value; +static PyObject *__pyx_n_s_value_2; +static PyObject *__pyx_kp_s_value_r; +static PyObject *__pyx_n_s_wait; +static PyObject *__pyx_n_s_x; +static PyObject *__pyx_pf_6gevent_6_event__get_linkable(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static int __pyx_pf_6gevent_6_event_5Event___init__(struct __pyx_obj_6gevent_6_event_Event *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_6_event_5Event_2__str__(struct __pyx_obj_6gevent_6_event_Event *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_6_event_5Event_4is_set(struct __pyx_obj_6gevent_6_event_Event *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_6_event_5Event_6isSet(struct __pyx_obj_6gevent_6_event_Event *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_6_event_5Event_8ready(struct __pyx_obj_6gevent_6_event_Event *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_6_event_5Event_10set(struct __pyx_obj_6gevent_6_event_Event *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_6_event_5Event_12clear(struct __pyx_obj_6gevent_6_event_Event *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_6_event_5Event_14wait(struct __pyx_obj_6gevent_6_event_Event *__pyx_v_self, PyObject *__pyx_v_timeout); /* proto */ +static PyObject *__pyx_pf_6gevent_6_event_5Event_16_reset_internal_locks(CYTHON_UNUSED struct __pyx_obj_6gevent_6_event_Event *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_6_event_11AsyncResult___init__(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_6_event_11AsyncResult_10_exception___get__(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_6_event_11AsyncResult_5value___get__(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_6_event_11AsyncResult_8exc_info___get__(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_6_event_11AsyncResult_2__str__(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_6_event_11AsyncResult_4ready(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_6_event_11AsyncResult_6successful(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_6_event_11AsyncResult_9exception___get__(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_6_event_11AsyncResult_8set(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_6gevent_6_event_11AsyncResult_10set_exception(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self, PyObject *__pyx_v_exception, PyObject *__pyx_v_exc_info); /* proto */ +static PyObject *__pyx_pf_6gevent_6_event_11AsyncResult_12_raise_exception(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_6_event_11AsyncResult_14get(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self, PyObject *__pyx_v_block, PyObject *__pyx_v_timeout); /* proto */ +static PyObject *__pyx_pf_6gevent_6_event_11AsyncResult_16get_nowait(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_6_event_11AsyncResult_18wait(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self, PyObject *__pyx_v_timeout); /* proto */ +static PyObject *__pyx_pf_6gevent_6_event_11AsyncResult_20__call__(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self, PyObject *__pyx_v_source); /* proto */ +static PyObject *__pyx_pf_6gevent_6_event_11AsyncResult_22result(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self, PyObject *__pyx_v_timeout); /* proto */ +static PyObject *__pyx_pf_6gevent_6_event_11AsyncResult_24done(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_6_event_11AsyncResult_26cancel(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_6_event_11AsyncResult_28cancelled(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_6_event_11AsyncResult_6_value___get__(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_6_event_11AsyncResult_9_exc_info___get__(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_6_event_11AsyncResult_16_imap_task_index___get__(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_6_event_11AsyncResult_16_imap_task_index_2__set__(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_tp_new_6gevent_6_event_Event(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6gevent_6_event_AsyncResult(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tuple_; +static PyObject *__pyx_tuple__2; +static PyObject *__pyx_tuple__4; +static PyObject *__pyx_tuple__5; +static PyObject *__pyx_tuple__7; +static PyObject *__pyx_tuple__9; +static PyObject *__pyx_tuple__11; +static PyObject *__pyx_tuple__13; +static PyObject *__pyx_tuple__15; +static PyObject *__pyx_tuple__17; +static PyObject *__pyx_tuple__19; +static PyObject *__pyx_tuple__20; +static PyObject *__pyx_tuple__22; +static PyObject *__pyx_tuple__24; +static PyObject *__pyx_tuple__26; +static PyObject *__pyx_tuple__28; +static PyObject *__pyx_tuple__30; +static PyObject *__pyx_tuple__32; +static PyObject *__pyx_tuple__34; +static PyObject *__pyx_tuple__36; +static PyObject *__pyx_tuple__38; +static PyObject *__pyx_tuple__40; +static PyObject *__pyx_tuple__42; +static PyObject *__pyx_codeobj__3; +static PyObject *__pyx_codeobj__6; +static PyObject *__pyx_codeobj__8; +static PyObject *__pyx_codeobj__10; +static PyObject *__pyx_codeobj__12; +static PyObject *__pyx_codeobj__14; +static PyObject *__pyx_codeobj__16; +static PyObject *__pyx_codeobj__18; +static PyObject *__pyx_codeobj__21; +static PyObject *__pyx_codeobj__23; +static PyObject *__pyx_codeobj__25; +static PyObject *__pyx_codeobj__27; +static PyObject *__pyx_codeobj__29; +static PyObject *__pyx_codeobj__31; +static PyObject *__pyx_codeobj__33; +static PyObject *__pyx_codeobj__35; +static PyObject *__pyx_codeobj__37; +static PyObject *__pyx_codeobj__39; +static PyObject *__pyx_codeobj__41; +static PyObject *__pyx_codeobj__43; +/* Late includes */ + +/* "src/gevent/event.py":19 + * ] + * + * def _get_linkable(): # <<<<<<<<<<<<<< + * x = __import__('gevent._abstract_linkable') + * return x._abstract_linkable.AbstractLinkable + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_event_1_get_linkable(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6gevent_6_event__get_linkable[] = "_get_linkable()"; +static PyMethodDef __pyx_mdef_6gevent_6_event_1_get_linkable = {"_get_linkable", (PyCFunction)__pyx_pw_6gevent_6_event_1_get_linkable, METH_NOARGS, __pyx_doc_6gevent_6_event__get_linkable}; +static PyObject *__pyx_pw_6gevent_6_event_1_get_linkable(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_get_linkable (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6_event__get_linkable(__pyx_self); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_event__get_linkable(CYTHON_UNUSED PyObject *__pyx_self) { + PyObject *__pyx_v_x = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("_get_linkable", 0); + + /* "src/gevent/event.py":20 + * + * def _get_linkable(): + * x = __import__('gevent._abstract_linkable') # <<<<<<<<<<<<<< + * return x._abstract_linkable.AbstractLinkable + * locals()['AbstractLinkable'] = _get_linkable() + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin___import__, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 20, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_x = __pyx_t_1; + __pyx_t_1 = 0; + + /* "src/gevent/event.py":21 + * def _get_linkable(): + * x = __import__('gevent._abstract_linkable') + * return x._abstract_linkable.AbstractLinkable # <<<<<<<<<<<<<< + * locals()['AbstractLinkable'] = _get_linkable() + * del _get_linkable + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_abstract_linkable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 21, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_AbstractLinkable); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 21, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "src/gevent/event.py":19 + * ] + * + * def _get_linkable(): # <<<<<<<<<<<<<< + * x = __import__('gevent._abstract_linkable') + * return x._abstract_linkable.AbstractLinkable + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent._event._get_linkable", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_x); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/event.py":48 + * __slots__ = ('_flag',) + * + * def __init__(self): # <<<<<<<<<<<<<< + * super(Event, self).__init__() + * self._flag = False + */ + +/* Python wrapper */ +static int __pyx_pw_6gevent_6_event_5Event_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6gevent_6_event_5Event_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { + __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;} + if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1; + __pyx_r = __pyx_pf_6gevent_6_event_5Event___init__(((struct __pyx_obj_6gevent_6_event_Event *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_6_event_5Event___init__(struct __pyx_obj_6gevent_6_event_Event *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "src/gevent/event.py":49 + * + * def __init__(self): + * super(Event, self).__init__() # <<<<<<<<<<<<<< + * self._flag = False + * + */ + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 49, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_ptype_6gevent_6_event_Event)); + __Pyx_GIVEREF(((PyObject *)__pyx_ptype_6gevent_6_event_Event)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_ptype_6gevent_6_event_Event)); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_self)); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 49, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 49, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 49, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/event.py":50 + * def __init__(self): + * super(Event, self).__init__() + * self._flag = False # <<<<<<<<<<<<<< + * + * def __str__(self): + */ + __pyx_v_self->_flag = 0; + + /* "src/gevent/event.py":48 + * __slots__ = ('_flag',) + * + * def __init__(self): # <<<<<<<<<<<<<< + * super(Event, self).__init__() + * self._flag = False + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("gevent._event.Event.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/event.py":52 + * self._flag = False + * + * def __str__(self): # <<<<<<<<<<<<<< + * return '<%s %s _links[%s]>' % (self.__class__.__name__, (self._flag and 'set') or 'clear', + * self.linkcount()) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_event_5Event_3__str__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_6_event_5Event_3__str__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__str__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6_event_5Event_2__str__(((struct __pyx_obj_6gevent_6_event_Event *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_event_5Event_2__str__(struct __pyx_obj_6gevent_6_event_Event *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + __Pyx_RefNannySetupContext("__str__", 0); + + /* "src/gevent/event.py":53 + * + * def __str__(self): + * return '<%s %s _links[%s]>' % (self.__class__.__name__, (self._flag and 'set') or 'clear', # <<<<<<<<<<<<<< + * self.linkcount()) + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 53, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 53, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!__pyx_v_self->_flag) { + goto __pyx_L4_next_or; + } else { + } + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_n_s_set); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 53, __pyx_L1_error) + if (!__pyx_t_3) { + } else { + __Pyx_INCREF(__pyx_n_s_set); + __pyx_t_1 = __pyx_n_s_set; + goto __pyx_L3_bool_binop_done; + } + __pyx_L4_next_or:; + __Pyx_INCREF(__pyx_n_s_clear); + __pyx_t_1 = __pyx_n_s_clear; + __pyx_L3_bool_binop_done:; + + /* "src/gevent/event.py":54 + * def __str__(self): + * return '<%s %s _links[%s]>' % (self.__class__.__name__, (self._flag and 'set') or 'clear', + * self.linkcount()) # <<<<<<<<<<<<<< + * + * def is_set(self): + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_linkcount); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 54, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); + if (likely(__pyx_t_6)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_5, function); + } + } + __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 54, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "src/gevent/event.py":53 + * + * def __str__(self): + * return '<%s %s _links[%s]>' % (self.__class__.__name__, (self._flag and 'set') or 'clear', # <<<<<<<<<<<<<< + * self.linkcount()) + * + */ + __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 53, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_4); + __pyx_t_2 = 0; + __pyx_t_1 = 0; + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_s_s__links_s, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 53, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + + /* "src/gevent/event.py":52 + * self._flag = False + * + * def __str__(self): # <<<<<<<<<<<<<< + * return '<%s %s _links[%s]>' % (self.__class__.__name__, (self._flag and 'set') or 'clear', + * self.linkcount()) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("gevent._event.Event.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/event.py":56 + * self.linkcount()) + * + * def is_set(self): # <<<<<<<<<<<<<< + * """Return true if and only if the internal flag is true.""" + * return self._flag + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_event_5Event_5is_set(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6gevent_6_event_5Event_4is_set[] = "Event.is_set(self)\nReturn true if and only if the internal flag is true."; +static PyMethodDef __pyx_mdef_6gevent_6_event_5Event_5is_set = {"is_set", (PyCFunction)__pyx_pw_6gevent_6_event_5Event_5is_set, METH_NOARGS, __pyx_doc_6gevent_6_event_5Event_4is_set}; +static PyObject *__pyx_pw_6gevent_6_event_5Event_5is_set(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("is_set (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6_event_5Event_4is_set(((struct __pyx_obj_6gevent_6_event_Event *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_event_5Event_4is_set(struct __pyx_obj_6gevent_6_event_Event *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("is_set", 0); + + /* "src/gevent/event.py":58 + * def is_set(self): + * """Return true if and only if the internal flag is true.""" + * return self._flag # <<<<<<<<<<<<<< + * + * def isSet(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->_flag); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 58, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "src/gevent/event.py":56 + * self.linkcount()) + * + * def is_set(self): # <<<<<<<<<<<<<< + * """Return true if and only if the internal flag is true.""" + * return self._flag + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent._event.Event.is_set", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/event.py":60 + * return self._flag + * + * def isSet(self): # <<<<<<<<<<<<<< + * # makes it a better drop-in replacement for threading.Event + * return self._flag + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_event_5Event_7isSet(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6gevent_6_event_5Event_6isSet[] = "Event.isSet(self)"; +static PyMethodDef __pyx_mdef_6gevent_6_event_5Event_7isSet = {"isSet", (PyCFunction)__pyx_pw_6gevent_6_event_5Event_7isSet, METH_NOARGS, __pyx_doc_6gevent_6_event_5Event_6isSet}; +static PyObject *__pyx_pw_6gevent_6_event_5Event_7isSet(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("isSet (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6_event_5Event_6isSet(((struct __pyx_obj_6gevent_6_event_Event *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_event_5Event_6isSet(struct __pyx_obj_6gevent_6_event_Event *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("isSet", 0); + + /* "src/gevent/event.py":62 + * def isSet(self): + * # makes it a better drop-in replacement for threading.Event + * return self._flag # <<<<<<<<<<<<<< + * + * def ready(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->_flag); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 62, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "src/gevent/event.py":60 + * return self._flag + * + * def isSet(self): # <<<<<<<<<<<<<< + * # makes it a better drop-in replacement for threading.Event + * return self._flag + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent._event.Event.isSet", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/event.py":64 + * return self._flag + * + * def ready(self): # <<<<<<<<<<<<<< + * # makes it compatible with AsyncResult and Greenlet (for + * # example in wait()) + */ + +static PyObject *__pyx_pw_6gevent_6_event_5Event_9ready(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static int __pyx_f_6gevent_6_event_5Event_ready(struct __pyx_obj_6gevent_6_event_Event *__pyx_v_self, int __pyx_skip_dispatch) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + __Pyx_RefNannySetupContext("ready", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0; + if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self)))))); + else { + PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + #endif + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_ready); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 64, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_6_event_5Event_9ready)) { + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 64, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 64, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_5; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0; + if (unlikely(type_dict_guard != tp_dict_version)) { + tp_dict_version = obj_dict_version = 0; + } + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + } + #endif + } + + /* "src/gevent/event.py":67 + * # makes it compatible with AsyncResult and Greenlet (for + * # example in wait()) + * return self._flag # <<<<<<<<<<<<<< + * + * def set(self): + */ + __pyx_r = __pyx_v_self->_flag; + goto __pyx_L0; + + /* "src/gevent/event.py":64 + * return self._flag + * + * def ready(self): # <<<<<<<<<<<<<< + * # makes it compatible with AsyncResult and Greenlet (for + * # example in wait()) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_WriteUnraisable("gevent._event.Event.ready", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_event_5Event_9ready(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6gevent_6_event_5Event_8ready[] = "Event.ready(self) -> bool"; +static PyMethodDef __pyx_mdef_6gevent_6_event_5Event_9ready = {"ready", (PyCFunction)__pyx_pw_6gevent_6_event_5Event_9ready, METH_NOARGS, __pyx_doc_6gevent_6_event_5Event_8ready}; +static PyObject *__pyx_pw_6gevent_6_event_5Event_9ready(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("ready (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6_event_5Event_8ready(((struct __pyx_obj_6gevent_6_event_Event *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_event_5Event_8ready(struct __pyx_obj_6gevent_6_event_Event *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("ready", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_f_6gevent_6_event_5Event_ready(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 64, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent._event.Event.ready", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/event.py":69 + * return self._flag + * + * def set(self): # <<<<<<<<<<<<<< + * """ + * Set the internal flag to true. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_event_5Event_11set(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6gevent_6_event_5Event_10set[] = "Event.set(self)\n\n Set the internal flag to true.\n\n All greenlets waiting for it to become true are awakened in\n some order at some time in the future. Greenlets that call\n :meth:`wait` once the flag is true will not block at all\n (until :meth:`clear` is called).\n "; +static PyMethodDef __pyx_mdef_6gevent_6_event_5Event_11set = {"set", (PyCFunction)__pyx_pw_6gevent_6_event_5Event_11set, METH_NOARGS, __pyx_doc_6gevent_6_event_5Event_10set}; +static PyObject *__pyx_pw_6gevent_6_event_5Event_11set(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("set (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6_event_5Event_10set(((struct __pyx_obj_6gevent_6_event_Event *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_event_5Event_10set(struct __pyx_obj_6gevent_6_event_Event *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("set", 0); + + /* "src/gevent/event.py":78 + * (until :meth:`clear` is called). + * """ + * self._flag = True # <<<<<<<<<<<<<< + * self._check_and_notify() + * + */ + __pyx_v_self->_flag = 1; + + /* "src/gevent/event.py":79 + * """ + * self._flag = True + * self._check_and_notify() # <<<<<<<<<<<<<< + * + * def clear(self): + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_6_event_Event *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._check_and_notify(((struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 79, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/event.py":69 + * return self._flag + * + * def set(self): # <<<<<<<<<<<<<< + * """ + * Set the internal flag to true. + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent._event.Event.set", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/event.py":81 + * self._check_and_notify() + * + * def clear(self): # <<<<<<<<<<<<<< + * """ + * Reset the internal flag to false. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_event_5Event_13clear(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6gevent_6_event_5Event_12clear[] = "Event.clear(self)\n\n Reset the internal flag to false.\n\n Subsequently, threads calling :meth:`wait` will block until\n :meth:`set` is called to set the internal flag to true again.\n "; +static PyMethodDef __pyx_mdef_6gevent_6_event_5Event_13clear = {"clear", (PyCFunction)__pyx_pw_6gevent_6_event_5Event_13clear, METH_NOARGS, __pyx_doc_6gevent_6_event_5Event_12clear}; +static PyObject *__pyx_pw_6gevent_6_event_5Event_13clear(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("clear (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6_event_5Event_12clear(((struct __pyx_obj_6gevent_6_event_Event *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_event_5Event_12clear(struct __pyx_obj_6gevent_6_event_Event *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("clear", 0); + + /* "src/gevent/event.py":88 + * :meth:`set` is called to set the internal flag to true again. + * """ + * self._flag = False # <<<<<<<<<<<<<< + * + * def _wait_return_value(self, waited, wait_success): + */ + __pyx_v_self->_flag = 0; + + /* "src/gevent/event.py":81 + * self._check_and_notify() + * + * def clear(self): # <<<<<<<<<<<<<< + * """ + * Reset the internal flag to false. + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/event.py":90 + * self._flag = False + * + * def _wait_return_value(self, waited, wait_success): # <<<<<<<<<<<<<< + * # To avoid the race condition outlined in http://bugs.python.org/issue13502, + * # if we had to wait, then we need to return whether or not + */ + +static PyObject *__pyx_f_6gevent_6_event_5Event__wait_return_value(struct __pyx_obj_6gevent_6_event_Event *__pyx_v_self, PyObject *__pyx_v_waited, PyObject *__pyx_v_wait_success) { + int __pyx_v_flag; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("_wait_return_value", 0); + + /* "src/gevent/event.py":95 + * # the condition got changed. Otherwise we simply echo + * # the current state of the flag (which should be true) + * if not waited: # <<<<<<<<<<<<<< + * flag = self._flag + * assert flag, "if we didn't wait we should already be set" + */ + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_waited); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 95, __pyx_L1_error) + __pyx_t_2 = ((!__pyx_t_1) != 0); + if (__pyx_t_2) { + + /* "src/gevent/event.py":96 + * # the current state of the flag (which should be true) + * if not waited: + * flag = self._flag # <<<<<<<<<<<<<< + * assert flag, "if we didn't wait we should already be set" + * return flag + */ + __pyx_t_2 = __pyx_v_self->_flag; + __pyx_v_flag = __pyx_t_2; + + /* "src/gevent/event.py":97 + * if not waited: + * flag = self._flag + * assert flag, "if we didn't wait we should already be set" # <<<<<<<<<<<<<< + * return flag + * + */ + #ifndef CYTHON_WITHOUT_ASSERTIONS + if (unlikely(!Py_OptimizeFlag)) { + if (unlikely(!(__pyx_v_flag != 0))) { + PyErr_SetObject(PyExc_AssertionError, __pyx_kp_s_if_we_didn_t_wait_we_should_alre); + __PYX_ERR(0, 97, __pyx_L1_error) + } + } + #endif + + /* "src/gevent/event.py":98 + * flag = self._flag + * assert flag, "if we didn't wait we should already be set" + * return flag # <<<<<<<<<<<<<< + * + * return wait_success + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_v_flag); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 98, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "src/gevent/event.py":95 + * # the condition got changed. Otherwise we simply echo + * # the current state of the flag (which should be true) + * if not waited: # <<<<<<<<<<<<<< + * flag = self._flag + * assert flag, "if we didn't wait we should already be set" + */ + } + + /* "src/gevent/event.py":100 + * return flag + * + * return wait_success # <<<<<<<<<<<<<< + * + * def wait(self, timeout=None): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_wait_success); + __pyx_r = __pyx_v_wait_success; + goto __pyx_L0; + + /* "src/gevent/event.py":90 + * self._flag = False + * + * def _wait_return_value(self, waited, wait_success): # <<<<<<<<<<<<<< + * # To avoid the race condition outlined in http://bugs.python.org/issue13502, + * # if we had to wait, then we need to return whether or not + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("gevent._event.Event._wait_return_value", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/event.py":102 + * return wait_success + * + * def wait(self, timeout=None): # <<<<<<<<<<<<<< + * """ + * Block until the internal flag is true. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_event_5Event_15wait(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6gevent_6_event_5Event_14wait[] = "Event.wait(self, timeout=None)\n\n Block until the internal flag is true.\n\n If the internal flag is true on entry, return immediately. Otherwise,\n block until another thread (greenlet) calls :meth:`set` to set the flag to true,\n or until the optional timeout occurs.\n\n When the *timeout* argument is present and not ``None``, it should be a\n floating point number specifying a timeout for the operation in seconds\n (or fractions thereof).\n\n :return: This method returns true if and only if the internal flag has been set to\n true, either before the wait call or after the wait starts, so it will\n always return ``True`` except if a timeout is given and the operation\n times out.\n\n .. versionchanged:: 1.1\n The return value represents the flag during the elapsed wait, not\n just after it elapses. This solves a race condition if one greenlet\n sets and then clears the flag without switching, while other greenlets\n are waiting. When the waiters wake up, this will return True; previously,\n they would still wake up, but the return value would be False. This is most\n noticeable when the *timeout* is present.\n "; +static PyMethodDef __pyx_mdef_6gevent_6_event_5Event_15wait = {"wait", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_6_event_5Event_15wait, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_6_event_5Event_14wait}; +static PyObject *__pyx_pw_6gevent_6_event_5Event_15wait(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_timeout = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("wait (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_timeout,0}; + PyObject* values[1] = {0}; + values[0] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_timeout); + if (value) { values[0] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "wait") < 0)) __PYX_ERR(0, 102, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_timeout = values[0]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("wait", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 102, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent._event.Event.wait", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_6_event_5Event_14wait(((struct __pyx_obj_6gevent_6_event_Event *)__pyx_v_self), __pyx_v_timeout); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_event_5Event_14wait(struct __pyx_obj_6gevent_6_event_Event *__pyx_v_self, PyObject *__pyx_v_timeout) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + struct __pyx_opt_args_6gevent_19__abstract_linkable_16AbstractLinkable__wait __pyx_t_2; + __Pyx_RefNannySetupContext("wait", 0); + + /* "src/gevent/event.py":127 + * noticeable when the *timeout* is present. + * """ + * return self._wait(timeout) # <<<<<<<<<<<<<< + * + * def _reset_internal_locks(self): # pragma: no cover + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2.__pyx_n = 1; + __pyx_t_2.timeout = __pyx_v_timeout; + __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_6_event_Event *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._wait(((struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *)__pyx_v_self), &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 127, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "src/gevent/event.py":102 + * return wait_success + * + * def wait(self, timeout=None): # <<<<<<<<<<<<<< + * """ + * Block until the internal flag is true. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent._event.Event.wait", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/event.py":129 + * return self._wait(timeout) + * + * def _reset_internal_locks(self): # pragma: no cover # <<<<<<<<<<<<<< + * # for compatibility with threading.Event + * # Exception AttributeError: AttributeError("'Event' object has no attribute '_reset_internal_locks'",) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_event_5Event_17_reset_internal_locks(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6gevent_6_event_5Event_16_reset_internal_locks[] = "Event._reset_internal_locks(self)"; +static PyMethodDef __pyx_mdef_6gevent_6_event_5Event_17_reset_internal_locks = {"_reset_internal_locks", (PyCFunction)__pyx_pw_6gevent_6_event_5Event_17_reset_internal_locks, METH_NOARGS, __pyx_doc_6gevent_6_event_5Event_16_reset_internal_locks}; +static PyObject *__pyx_pw_6gevent_6_event_5Event_17_reset_internal_locks(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_reset_internal_locks (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6_event_5Event_16_reset_internal_locks(((struct __pyx_obj_6gevent_6_event_Event *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_event_5Event_16_reset_internal_locks(CYTHON_UNUSED struct __pyx_obj_6gevent_6_event_Event *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_reset_internal_locks", 0); + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/event.py":188 + * __slots__ = ('_value', '_exc_info', '_imap_task_index') + * + * def __init__(self): # <<<<<<<<<<<<<< + * super(AsyncResult, self).__init__() + * self._value = _NONE + */ + +/* Python wrapper */ +static int __pyx_pw_6gevent_6_event_11AsyncResult_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6gevent_6_event_11AsyncResult_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { + __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;} + if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1; + __pyx_r = __pyx_pf_6gevent_6_event_11AsyncResult___init__(((struct __pyx_obj_6gevent_6_event_AsyncResult *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_6_event_11AsyncResult___init__(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "src/gevent/event.py":189 + * + * def __init__(self): + * super(AsyncResult, self).__init__() # <<<<<<<<<<<<<< + * self._value = _NONE + * self._exc_info = () + */ + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 189, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_ptype_6gevent_6_event_AsyncResult)); + __Pyx_GIVEREF(((PyObject *)__pyx_ptype_6gevent_6_event_AsyncResult)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_ptype_6gevent_6_event_AsyncResult)); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_self)); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 189, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 189, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 189, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/event.py":190 + * def __init__(self): + * super(AsyncResult, self).__init__() + * self._value = _NONE # <<<<<<<<<<<<<< + * self._exc_info = () + * + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_NONE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 190, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_self->_value); + __Pyx_DECREF(__pyx_v_self->_value); + __pyx_v_self->_value = __pyx_t_1; + __pyx_t_1 = 0; + + /* "src/gevent/event.py":191 + * super(AsyncResult, self).__init__() + * self._value = _NONE + * self._exc_info = () # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_INCREF(__pyx_empty_tuple); + __Pyx_GIVEREF(__pyx_empty_tuple); + __Pyx_GOTREF(__pyx_v_self->_exc_info); + __Pyx_DECREF(__pyx_v_self->_exc_info); + __pyx_v_self->_exc_info = __pyx_empty_tuple; + + /* "src/gevent/event.py":188 + * __slots__ = ('_value', '_exc_info', '_imap_task_index') + * + * def __init__(self): # <<<<<<<<<<<<<< + * super(AsyncResult, self).__init__() + * self._value = _NONE + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("gevent._event.AsyncResult.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/event.py":194 + * + * @property + * def _exception(self): # <<<<<<<<<<<<<< + * return self._exc_info[1] if self._exc_info else _NONE + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_10_exception_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_10_exception_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6_event_11AsyncResult_10_exception___get__(((struct __pyx_obj_6gevent_6_event_AsyncResult *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_event_11AsyncResult_10_exception___get__(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "src/gevent/event.py":195 + * @property + * def _exception(self): + * return self._exc_info[1] if self._exc_info else _NONE # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = (__pyx_v_self->_exc_info != Py_None)&&(PyTuple_GET_SIZE(__pyx_v_self->_exc_info) != 0); + if (__pyx_t_2) { + if (unlikely(__pyx_v_self->_exc_info == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 195, __pyx_L1_error) + } + __pyx_t_3 = __Pyx_GetItemInt_Tuple(__pyx_v_self->_exc_info, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 195, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __pyx_t_3; + __pyx_t_3 = 0; + } else { + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_NONE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 195, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __pyx_t_3; + __pyx_t_3 = 0; + } + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "src/gevent/event.py":194 + * + * @property + * def _exception(self): # <<<<<<<<<<<<<< + * return self._exc_info[1] if self._exc_info else _NONE + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("gevent._event.AsyncResult._exception.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/event.py":198 + * + * @property + * def value(self): # <<<<<<<<<<<<<< + * """ + * Holds the value passed to :meth:`set` if :meth:`set` was called. Otherwise, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_5value_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_5value_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6_event_11AsyncResult_5value___get__(((struct __pyx_obj_6gevent_6_event_AsyncResult *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_event_11AsyncResult_5value___get__(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "src/gevent/event.py":203 + * ``None`` + * """ + * return self._value if self._value is not _NONE else None # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_NONE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 203, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = (__pyx_v_self->_value != __pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if ((__pyx_t_3 != 0)) { + __Pyx_INCREF(__pyx_v_self->_value); + __pyx_t_1 = __pyx_v_self->_value; + } else { + __Pyx_INCREF(Py_None); + __pyx_t_1 = Py_None; + } + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "src/gevent/event.py":198 + * + * @property + * def value(self): # <<<<<<<<<<<<<< + * """ + * Holds the value passed to :meth:`set` if :meth:`set` was called. Otherwise, + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent._event.AsyncResult.value.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/event.py":206 + * + * @property + * def exc_info(self): # <<<<<<<<<<<<<< + * """ + * The three-tuple of exception information if :meth:`set_exception` was called. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_8exc_info_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_8exc_info_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6_event_11AsyncResult_8exc_info___get__(((struct __pyx_obj_6gevent_6_event_AsyncResult *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_event_11AsyncResult_8exc_info___get__(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "src/gevent/event.py":210 + * The three-tuple of exception information if :meth:`set_exception` was called. + * """ + * if self._exc_info: # <<<<<<<<<<<<<< + * return (self._exc_info[0], self._exc_info[1], load_traceback(self._exc_info[2])) + * return () + */ + __pyx_t_1 = (__pyx_v_self->_exc_info != Py_None)&&(PyTuple_GET_SIZE(__pyx_v_self->_exc_info) != 0); + if (__pyx_t_1) { + + /* "src/gevent/event.py":211 + * """ + * if self._exc_info: + * return (self._exc_info[0], self._exc_info[1], load_traceback(self._exc_info[2])) # <<<<<<<<<<<<<< + * return () + * + */ + __Pyx_XDECREF(__pyx_r); + if (unlikely(__pyx_v_self->_exc_info == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 211, __pyx_L1_error) + } + __pyx_t_2 = __Pyx_GetItemInt_Tuple(__pyx_v_self->_exc_info, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 211, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (unlikely(__pyx_v_self->_exc_info == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 211, __pyx_L1_error) + } + __pyx_t_3 = __Pyx_GetItemInt_Tuple(__pyx_v_self->_exc_info, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 211, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (unlikely(__pyx_v_self->_exc_info == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 211, __pyx_L1_error) + } + __pyx_t_5 = __Pyx_GetItemInt_Tuple(__pyx_v_self->_exc_info, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 211, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_6gevent_6_event_load_traceback); + __pyx_t_6 = __pyx_v_6gevent_6_event_load_traceback; __pyx_t_7 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) { + __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); + if (likely(__pyx_t_7)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); + __Pyx_INCREF(__pyx_t_7); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_6, function); + } + } + __pyx_t_4 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_5); + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 211, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 211, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_4); + __pyx_t_2 = 0; + __pyx_t_3 = 0; + __pyx_t_4 = 0; + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L0; + + /* "src/gevent/event.py":210 + * The three-tuple of exception information if :meth:`set_exception` was called. + * """ + * if self._exc_info: # <<<<<<<<<<<<<< + * return (self._exc_info[0], self._exc_info[1], load_traceback(self._exc_info[2])) + * return () + */ + } + + /* "src/gevent/event.py":212 + * if self._exc_info: + * return (self._exc_info[0], self._exc_info[1], load_traceback(self._exc_info[2])) + * return () # <<<<<<<<<<<<<< + * + * def __str__(self): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_empty_tuple); + __pyx_r = __pyx_empty_tuple; + goto __pyx_L0; + + /* "src/gevent/event.py":206 + * + * @property + * def exc_info(self): # <<<<<<<<<<<<<< + * """ + * The three-tuple of exception information if :meth:`set_exception` was called. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("gevent._event.AsyncResult.exc_info.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/event.py":214 + * return () + * + * def __str__(self): # <<<<<<<<<<<<<< + * result = '<%s ' % (self.__class__.__name__, ) + * if self.value is not None or self._exception is not _NONE: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_3__str__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_3__str__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__str__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6_event_11AsyncResult_2__str__(((struct __pyx_obj_6gevent_6_event_AsyncResult *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_event_11AsyncResult_2__str__(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self) { + PyObject *__pyx_v_result = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + __Pyx_RefNannySetupContext("__str__", 0); + + /* "src/gevent/event.py":215 + * + * def __str__(self): + * result = '<%s ' % (self.__class__.__name__, ) # <<<<<<<<<<<<<< + * if self.value is not None or self._exception is not _NONE: + * result += 'value=%r ' % self.value + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 215, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 215, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 215, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_s, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 215, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result = ((PyObject*)__pyx_t_2); + __pyx_t_2 = 0; + + /* "src/gevent/event.py":216 + * def __str__(self): + * result = '<%s ' % (self.__class__.__name__, ) + * if self.value is not None or self._exception is not _NONE: # <<<<<<<<<<<<<< + * result += 'value=%r ' % self.value + * if self._exception is not None and self._exception is not _NONE: + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 216, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = (__pyx_t_2 != Py_None); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_5 = (__pyx_t_4 != 0); + if (!__pyx_t_5) { + } else { + __pyx_t_3 = __pyx_t_5; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_exception); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 216, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_NONE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 216, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = (__pyx_t_2 != __pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_4 = (__pyx_t_5 != 0); + __pyx_t_3 = __pyx_t_4; + __pyx_L4_bool_binop_done:; + if (__pyx_t_3) { + + /* "src/gevent/event.py":217 + * result = '<%s ' % (self.__class__.__name__, ) + * if self.value is not None or self._exception is not _NONE: + * result += 'value=%r ' % self.value # <<<<<<<<<<<<<< + * if self._exception is not None and self._exception is not _NONE: + * result += 'exception=%r ' % self._exception + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 217, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyString_FormatSafe(__pyx_kp_s_value_r, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 217, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 217, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_1)); + __pyx_t_1 = 0; + + /* "src/gevent/event.py":216 + * def __str__(self): + * result = '<%s ' % (self.__class__.__name__, ) + * if self.value is not None or self._exception is not _NONE: # <<<<<<<<<<<<<< + * result += 'value=%r ' % self.value + * if self._exception is not None and self._exception is not _NONE: + */ + } + + /* "src/gevent/event.py":218 + * if self.value is not None or self._exception is not _NONE: + * result += 'value=%r ' % self.value + * if self._exception is not None and self._exception is not _NONE: # <<<<<<<<<<<<<< + * result += 'exception=%r ' % self._exception + * if self._exception is _NONE: + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_exception); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 218, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = (__pyx_t_1 != Py_None); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_5 = (__pyx_t_4 != 0); + if (__pyx_t_5) { + } else { + __pyx_t_3 = __pyx_t_5; + goto __pyx_L7_bool_binop_done; + } + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_exception); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 218, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_NONE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 218, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = (__pyx_t_1 != __pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_4 = (__pyx_t_5 != 0); + __pyx_t_3 = __pyx_t_4; + __pyx_L7_bool_binop_done:; + if (__pyx_t_3) { + + /* "src/gevent/event.py":219 + * result += 'value=%r ' % self.value + * if self._exception is not None and self._exception is not _NONE: + * result += 'exception=%r ' % self._exception # <<<<<<<<<<<<<< + * if self._exception is _NONE: + * result += 'unset ' + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_exception); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 219, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyString_FormatSafe(__pyx_kp_s_exception_r, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 219, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 219, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "src/gevent/event.py":218 + * if self.value is not None or self._exception is not _NONE: + * result += 'value=%r ' % self.value + * if self._exception is not None and self._exception is not _NONE: # <<<<<<<<<<<<<< + * result += 'exception=%r ' % self._exception + * if self._exception is _NONE: + */ + } + + /* "src/gevent/event.py":220 + * if self._exception is not None and self._exception is not _NONE: + * result += 'exception=%r ' % self._exception + * if self._exception is _NONE: # <<<<<<<<<<<<<< + * result += 'unset ' + * return result + ' _links[%s]>' % self.linkcount() + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_exception); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 220, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_NONE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 220, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = (__pyx_t_2 == __pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_4 = (__pyx_t_3 != 0); + if (__pyx_t_4) { + + /* "src/gevent/event.py":221 + * result += 'exception=%r ' % self._exception + * if self._exception is _NONE: + * result += 'unset ' # <<<<<<<<<<<<<< + * return result + ' _links[%s]>' % self.linkcount() + * + */ + __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_kp_s_unset); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 221, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_1)); + __pyx_t_1 = 0; + + /* "src/gevent/event.py":220 + * if self._exception is not None and self._exception is not _NONE: + * result += 'exception=%r ' % self._exception + * if self._exception is _NONE: # <<<<<<<<<<<<<< + * result += 'unset ' + * return result + ' _links[%s]>' % self.linkcount() + */ + } + + /* "src/gevent/event.py":222 + * if self._exception is _NONE: + * result += 'unset ' + * return result + ' _links[%s]>' % self.linkcount() # <<<<<<<<<<<<<< + * + * def ready(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_linkcount); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 222, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_6)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 222, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyString_FormatSafe(__pyx_kp_s_links_s, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 222, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyNumber_Add(__pyx_v_result, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 222, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "src/gevent/event.py":214 + * return () + * + * def __str__(self): # <<<<<<<<<<<<<< + * result = '<%s ' % (self.__class__.__name__, ) + * if self.value is not None or self._exception is not _NONE: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("gevent._event.AsyncResult.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/event.py":224 + * return result + ' _links[%s]>' % self.linkcount() + * + * def ready(self): # <<<<<<<<<<<<<< + * """Return true if and only if it holds a value or an exception""" + * return self._exc_info or self._value is not _NONE + */ + +static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_5ready(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static int __pyx_f_6gevent_6_event_11AsyncResult_ready(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self, int __pyx_skip_dispatch) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + int __pyx_t_6; + int __pyx_t_7; + __Pyx_RefNannySetupContext("ready", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0; + if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self)))))); + else { + PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + #endif + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_ready); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 224, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_6_event_11AsyncResult_5ready)) { + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 224, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 224, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_5; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0; + if (unlikely(type_dict_guard != tp_dict_version)) { + tp_dict_version = obj_dict_version = 0; + } + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + } + #endif + } + + /* "src/gevent/event.py":226 + * def ready(self): + * """Return true if and only if it holds a value or an exception""" + * return self._exc_info or self._value is not _NONE # <<<<<<<<<<<<<< + * + * def successful(self): + */ + __pyx_t_6 = (__pyx_v_self->_exc_info != Py_None)&&(PyTuple_GET_SIZE(__pyx_v_self->_exc_info) != 0); + if (!__pyx_t_6) { + } else { + __pyx_t_5 = __pyx_t_6; + goto __pyx_L3_bool_binop_done; + } + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_NONE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 226, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = (__pyx_v_self->_value != __pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_7 = (__pyx_t_6 != 0); + __pyx_t_5 = __pyx_t_7; + __pyx_L3_bool_binop_done:; + __pyx_r = __pyx_t_5; + goto __pyx_L0; + + /* "src/gevent/event.py":224 + * return result + ' _links[%s]>' % self.linkcount() + * + * def ready(self): # <<<<<<<<<<<<<< + * """Return true if and only if it holds a value or an exception""" + * return self._exc_info or self._value is not _NONE + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_WriteUnraisable("gevent._event.AsyncResult.ready", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_5ready(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6gevent_6_event_11AsyncResult_4ready[] = "AsyncResult.ready(self) -> bool\nReturn true if and only if it holds a value or an exception"; +static PyMethodDef __pyx_mdef_6gevent_6_event_11AsyncResult_5ready = {"ready", (PyCFunction)__pyx_pw_6gevent_6_event_11AsyncResult_5ready, METH_NOARGS, __pyx_doc_6gevent_6_event_11AsyncResult_4ready}; +static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_5ready(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("ready (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6_event_11AsyncResult_4ready(((struct __pyx_obj_6gevent_6_event_AsyncResult *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_event_11AsyncResult_4ready(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("ready", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_f_6gevent_6_event_11AsyncResult_ready(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 224, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent._event.AsyncResult.ready", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/event.py":228 + * return self._exc_info or self._value is not _NONE + * + * def successful(self): # <<<<<<<<<<<<<< + * """Return true if and only if it is ready and holds a value""" + * return self._value is not _NONE + */ + +static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_7successful(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static int __pyx_f_6gevent_6_event_11AsyncResult_successful(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self, int __pyx_skip_dispatch) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + __Pyx_RefNannySetupContext("successful", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0; + if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self)))))); + else { + PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + #endif + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_successful); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 228, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_6_event_11AsyncResult_7successful)) { + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 228, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 228, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_5; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0; + if (unlikely(type_dict_guard != tp_dict_version)) { + tp_dict_version = obj_dict_version = 0; + } + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + } + #endif + } + + /* "src/gevent/event.py":230 + * def successful(self): + * """Return true if and only if it is ready and holds a value""" + * return self._value is not _NONE # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_NONE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 230, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = (__pyx_v_self->_value != __pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_5; + goto __pyx_L0; + + /* "src/gevent/event.py":228 + * return self._exc_info or self._value is not _NONE + * + * def successful(self): # <<<<<<<<<<<<<< + * """Return true if and only if it is ready and holds a value""" + * return self._value is not _NONE + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_WriteUnraisable("gevent._event.AsyncResult.successful", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_7successful(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6gevent_6_event_11AsyncResult_6successful[] = "AsyncResult.successful(self) -> bool\nReturn true if and only if it is ready and holds a value"; +static PyMethodDef __pyx_mdef_6gevent_6_event_11AsyncResult_7successful = {"successful", (PyCFunction)__pyx_pw_6gevent_6_event_11AsyncResult_7successful, METH_NOARGS, __pyx_doc_6gevent_6_event_11AsyncResult_6successful}; +static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_7successful(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("successful (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6_event_11AsyncResult_6successful(((struct __pyx_obj_6gevent_6_event_AsyncResult *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_event_11AsyncResult_6successful(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("successful", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_f_6gevent_6_event_11AsyncResult_successful(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 228, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent._event.AsyncResult.successful", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/event.py":233 + * + * @property + * def exception(self): # <<<<<<<<<<<<<< + * """Holds the exception instance passed to :meth:`set_exception` if :meth:`set_exception` was called. + * Otherwise ``None``.""" + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_9exception_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_9exception_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6_event_11AsyncResult_9exception___get__(((struct __pyx_obj_6gevent_6_event_AsyncResult *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_event_11AsyncResult_9exception___get__(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "src/gevent/event.py":236 + * """Holds the exception instance passed to :meth:`set_exception` if :meth:`set_exception` was called. + * Otherwise ``None``.""" + * if self._exc_info: # <<<<<<<<<<<<<< + * return self._exc_info[1] + * + */ + __pyx_t_1 = (__pyx_v_self->_exc_info != Py_None)&&(PyTuple_GET_SIZE(__pyx_v_self->_exc_info) != 0); + if (__pyx_t_1) { + + /* "src/gevent/event.py":237 + * Otherwise ``None``.""" + * if self._exc_info: + * return self._exc_info[1] # <<<<<<<<<<<<<< + * + * def set(self, value=None): + */ + __Pyx_XDECREF(__pyx_r); + if (unlikely(__pyx_v_self->_exc_info == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 237, __pyx_L1_error) + } + __pyx_t_2 = __Pyx_GetItemInt_Tuple(__pyx_v_self->_exc_info, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 237, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "src/gevent/event.py":236 + * """Holds the exception instance passed to :meth:`set_exception` if :meth:`set_exception` was called. + * Otherwise ``None``.""" + * if self._exc_info: # <<<<<<<<<<<<<< + * return self._exc_info[1] + * + */ + } + + /* "src/gevent/event.py":233 + * + * @property + * def exception(self): # <<<<<<<<<<<<<< + * """Holds the exception instance passed to :meth:`set_exception` if :meth:`set_exception` was called. + * Otherwise ``None``.""" + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent._event.AsyncResult.exception.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/event.py":239 + * return self._exc_info[1] + * + * def set(self, value=None): # <<<<<<<<<<<<<< + * """Store the value and wake up any waiters. + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_9set(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6gevent_6_event_11AsyncResult_8set[] = "AsyncResult.set(self, value=None)\nStore the value and wake up any waiters.\n\n All greenlets blocking on :meth:`get` or :meth:`wait` are awakened.\n Subsequent calls to :meth:`wait` and :meth:`get` will not block at all.\n "; +static PyMethodDef __pyx_mdef_6gevent_6_event_11AsyncResult_9set = {"set", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_6_event_11AsyncResult_9set, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_6_event_11AsyncResult_8set}; +static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_9set(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_value = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("set (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_value,0}; + PyObject* values[1] = {0}; + values[0] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value); + if (value) { values[0] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set") < 0)) __PYX_ERR(0, 239, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_value = values[0]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("set", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 239, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent._event.AsyncResult.set", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_6_event_11AsyncResult_8set(((struct __pyx_obj_6gevent_6_event_AsyncResult *)__pyx_v_self), __pyx_v_value); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_event_11AsyncResult_8set(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self, PyObject *__pyx_v_value) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("set", 0); + + /* "src/gevent/event.py":245 + * Subsequent calls to :meth:`wait` and :meth:`get` will not block at all. + * """ + * self._value = value # <<<<<<<<<<<<<< + * self._check_and_notify() + * + */ + __Pyx_INCREF(__pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + __Pyx_GOTREF(__pyx_v_self->_value); + __Pyx_DECREF(__pyx_v_self->_value); + __pyx_v_self->_value = __pyx_v_value; + + /* "src/gevent/event.py":246 + * """ + * self._value = value + * self._check_and_notify() # <<<<<<<<<<<<<< + * + * def set_exception(self, exception, exc_info=None): + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_6_event_AsyncResult *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._check_and_notify(((struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 246, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/event.py":239 + * return self._exc_info[1] + * + * def set(self, value=None): # <<<<<<<<<<<<<< + * """Store the value and wake up any waiters. + * + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent._event.AsyncResult.set", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/event.py":248 + * self._check_and_notify() + * + * def set_exception(self, exception, exc_info=None): # <<<<<<<<<<<<<< + * """Store the exception and wake up any waiters. + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_11set_exception(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6gevent_6_event_11AsyncResult_10set_exception[] = "AsyncResult.set_exception(self, exception, exc_info=None)\nStore the exception and wake up any waiters.\n\n All greenlets blocking on :meth:`get` or :meth:`wait` are awakened.\n Subsequent calls to :meth:`wait` and :meth:`get` will not block at all.\n\n :keyword tuple exc_info: If given, a standard three-tuple of type, value, :class:`traceback`\n as returned by :func:`sys.exc_info`. This will be used when the exception\n is re-raised to propagate the correct traceback.\n "; +static PyMethodDef __pyx_mdef_6gevent_6_event_11AsyncResult_11set_exception = {"set_exception", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_6_event_11AsyncResult_11set_exception, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_6_event_11AsyncResult_10set_exception}; +static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_11set_exception(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_exception = 0; + PyObject *__pyx_v_exc_info = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("set_exception (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_exception_2,&__pyx_n_s_exc_info,0}; + PyObject* values[2] = {0,0}; + values[1] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_exception_2)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_exc_info); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_exception") < 0)) __PYX_ERR(0, 248, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_exception = values[0]; + __pyx_v_exc_info = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("set_exception", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 248, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent._event.AsyncResult.set_exception", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_6_event_11AsyncResult_10set_exception(((struct __pyx_obj_6gevent_6_event_AsyncResult *)__pyx_v_self), __pyx_v_exception, __pyx_v_exc_info); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_event_11AsyncResult_10set_exception(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self, PyObject *__pyx_v_exception, PyObject *__pyx_v_exc_info) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + __Pyx_RefNannySetupContext("set_exception", 0); + + /* "src/gevent/event.py":258 + * is re-raised to propagate the correct traceback. + * """ + * if exc_info: # <<<<<<<<<<<<<< + * self._exc_info = (exc_info[0], exc_info[1], dump_traceback(exc_info[2])) + * else: + */ + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_exc_info); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 258, __pyx_L1_error) + if (__pyx_t_1) { + + /* "src/gevent/event.py":259 + * """ + * if exc_info: + * self._exc_info = (exc_info[0], exc_info[1], dump_traceback(exc_info[2])) # <<<<<<<<<<<<<< + * else: + * self._exc_info = (type(exception), exception, dump_traceback(None)) + */ + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_exc_info, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 259, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_exc_info, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 259, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_exc_info, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 259, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_6gevent_6_event_dump_traceback); + __pyx_t_6 = __pyx_v_6gevent_6_event_dump_traceback; __pyx_t_7 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) { + __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); + if (likely(__pyx_t_7)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); + __Pyx_INCREF(__pyx_t_7); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_6, function); + } + } + __pyx_t_4 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_5); + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 259, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 259, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_4); + __pyx_t_2 = 0; + __pyx_t_3 = 0; + __pyx_t_4 = 0; + __Pyx_GIVEREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_v_self->_exc_info); + __Pyx_DECREF(__pyx_v_self->_exc_info); + __pyx_v_self->_exc_info = ((PyObject*)__pyx_t_6); + __pyx_t_6 = 0; + + /* "src/gevent/event.py":258 + * is re-raised to propagate the correct traceback. + * """ + * if exc_info: # <<<<<<<<<<<<<< + * self._exc_info = (exc_info[0], exc_info[1], dump_traceback(exc_info[2])) + * else: + */ + goto __pyx_L3; + } + + /* "src/gevent/event.py":261 + * self._exc_info = (exc_info[0], exc_info[1], dump_traceback(exc_info[2])) + * else: + * self._exc_info = (type(exception), exception, dump_traceback(None)) # <<<<<<<<<<<<<< + * + * self._check_and_notify() + */ + /*else*/ { + __Pyx_INCREF(__pyx_v_6gevent_6_event_dump_traceback); + __pyx_t_4 = __pyx_v_6gevent_6_event_dump_traceback; __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + } + } + __pyx_t_6 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_3, Py_None) : __Pyx_PyObject_CallOneArg(__pyx_t_4, Py_None); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 261, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 261, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_exception))); + __Pyx_GIVEREF(((PyObject *)Py_TYPE(__pyx_v_exception))); + PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)Py_TYPE(__pyx_v_exception))); + __Pyx_INCREF(__pyx_v_exception); + __Pyx_GIVEREF(__pyx_v_exception); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_exception); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_6); + __pyx_t_6 = 0; + __Pyx_GIVEREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_v_self->_exc_info); + __Pyx_DECREF(__pyx_v_self->_exc_info); + __pyx_v_self->_exc_info = ((PyObject*)__pyx_t_4); + __pyx_t_4 = 0; + } + __pyx_L3:; + + /* "src/gevent/event.py":263 + * self._exc_info = (type(exception), exception, dump_traceback(None)) + * + * self._check_and_notify() # <<<<<<<<<<<<<< + * + * def _raise_exception(self): + */ + __pyx_t_4 = ((struct __pyx_vtabstruct_6gevent_6_event_AsyncResult *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._check_and_notify(((struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *)__pyx_v_self)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 263, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "src/gevent/event.py":248 + * self._check_and_notify() + * + * def set_exception(self, exception, exc_info=None): # <<<<<<<<<<<<<< + * """Store the exception and wake up any waiters. + * + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("gevent._event.AsyncResult.set_exception", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/event.py":265 + * self._check_and_notify() + * + * def _raise_exception(self): # <<<<<<<<<<<<<< + * reraise(*self.exc_info) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_13_raise_exception(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6gevent_6_event_11AsyncResult_12_raise_exception[] = "AsyncResult._raise_exception(self)"; +static PyMethodDef __pyx_mdef_6gevent_6_event_11AsyncResult_13_raise_exception = {"_raise_exception", (PyCFunction)__pyx_pw_6gevent_6_event_11AsyncResult_13_raise_exception, METH_NOARGS, __pyx_doc_6gevent_6_event_11AsyncResult_12_raise_exception}; +static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_13_raise_exception(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_raise_exception (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6_event_11AsyncResult_12_raise_exception(((struct __pyx_obj_6gevent_6_event_AsyncResult *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_event_11AsyncResult_12_raise_exception(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("_raise_exception", 0); + + /* "src/gevent/event.py":266 + * + * def _raise_exception(self): + * reraise(*self.exc_info) # <<<<<<<<<<<<<< + * + * def get(self, block=True, timeout=None): + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_exc_info); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 266, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PySequence_Tuple(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 266, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_6gevent_6_event_reraise, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 266, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/event.py":265 + * self._check_and_notify() + * + * def _raise_exception(self): # <<<<<<<<<<<<<< + * reraise(*self.exc_info) + * + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent._event.AsyncResult._raise_exception", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/event.py":268 + * reraise(*self.exc_info) + * + * def get(self, block=True, timeout=None): # <<<<<<<<<<<<<< + * """Return the stored value or raise the exception. + * + */ + +static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_15get(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_6gevent_6_event_11AsyncResult_get(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_6_event_11AsyncResult_get *__pyx_optional_args) { + PyObject *__pyx_v_block = ((PyObject *)Py_True); + PyObject *__pyx_v_timeout = ((PyObject *)Py_None); + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + int __pyx_t_8; + struct __pyx_opt_args_6gevent_19__abstract_linkable_16AbstractLinkable__wait_core __pyx_t_9; + struct __pyx_opt_args_6gevent_6_event_11AsyncResult_get __pyx_t_10; + __Pyx_RefNannySetupContext("get", 0); + if (__pyx_optional_args) { + if (__pyx_optional_args->__pyx_n > 0) { + __pyx_v_block = __pyx_optional_args->block; + if (__pyx_optional_args->__pyx_n > 1) { + __pyx_v_timeout = __pyx_optional_args->timeout; + } + } + } + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0; + if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self)))))); + else { + PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + #endif + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 268, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_6_event_11AsyncResult_15get)) { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; + __pyx_t_5 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_5 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_3)) { + PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_block, __pyx_v_timeout}; + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 268, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GOTREF(__pyx_t_2); + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { + PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_block, __pyx_v_timeout}; + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 268, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GOTREF(__pyx_t_2); + } else + #endif + { + __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 268, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (__pyx_t_4) { + __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL; + } + __Pyx_INCREF(__pyx_v_block); + __Pyx_GIVEREF(__pyx_v_block); + PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_block); + __Pyx_INCREF(__pyx_v_timeout); + __Pyx_GIVEREF(__pyx_v_timeout); + PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_timeout); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 268, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0; + if (unlikely(type_dict_guard != tp_dict_version)) { + tp_dict_version = obj_dict_version = 0; + } + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + } + #endif + } + + /* "src/gevent/event.py":283 + * immediately raise a :class:`Timeout` exception. + * """ + * if self._value is not _NONE: # <<<<<<<<<<<<<< + * return self._value + * if self._exc_info: + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_NONE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 283, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = (__pyx_v_self->_value != __pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_8 = (__pyx_t_7 != 0); + if (__pyx_t_8) { + + /* "src/gevent/event.py":284 + * """ + * if self._value is not _NONE: + * return self._value # <<<<<<<<<<<<<< + * if self._exc_info: + * return self._raise_exception() + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->_value); + __pyx_r = __pyx_v_self->_value; + goto __pyx_L0; + + /* "src/gevent/event.py":283 + * immediately raise a :class:`Timeout` exception. + * """ + * if self._value is not _NONE: # <<<<<<<<<<<<<< + * return self._value + * if self._exc_info: + */ + } + + /* "src/gevent/event.py":285 + * if self._value is not _NONE: + * return self._value + * if self._exc_info: # <<<<<<<<<<<<<< + * return self._raise_exception() + * + */ + __pyx_t_8 = (__pyx_v_self->_exc_info != Py_None)&&(PyTuple_GET_SIZE(__pyx_v_self->_exc_info) != 0); + if (__pyx_t_8) { + + /* "src/gevent/event.py":286 + * return self._value + * if self._exc_info: + * return self._raise_exception() # <<<<<<<<<<<<<< + * + * if not block: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_raise_exception); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 286, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 286, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "src/gevent/event.py":285 + * if self._value is not _NONE: + * return self._value + * if self._exc_info: # <<<<<<<<<<<<<< + * return self._raise_exception() + * + */ + } + + /* "src/gevent/event.py":288 + * return self._raise_exception() + * + * if not block: # <<<<<<<<<<<<<< + * # Not ready and not blocking, so immediately timeout + * raise Timeout() + */ + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_block); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 288, __pyx_L1_error) + __pyx_t_7 = ((!__pyx_t_8) != 0); + if (unlikely(__pyx_t_7)) { + + /* "src/gevent/event.py":290 + * if not block: + * # Not ready and not blocking, so immediately timeout + * raise Timeout() # <<<<<<<<<<<<<< + * + * # Wait, raising a timeout that elapses + */ + __Pyx_INCREF(__pyx_v_6gevent_6_event_Timeout); + __pyx_t_2 = __pyx_v_6gevent_6_event_Timeout; __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 290, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 290, __pyx_L1_error) + + /* "src/gevent/event.py":288 + * return self._raise_exception() + * + * if not block: # <<<<<<<<<<<<<< + * # Not ready and not blocking, so immediately timeout + * raise Timeout() + */ + } + + /* "src/gevent/event.py":293 + * + * # Wait, raising a timeout that elapses + * self._wait_core(timeout, ()) # <<<<<<<<<<<<<< + * + * # by definition we are now ready + */ + __pyx_t_9.__pyx_n = 1; + __pyx_t_9.catch = __pyx_empty_tuple; + __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_6_event_AsyncResult *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._wait_core(((struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *)__pyx_v_self), __pyx_v_timeout, &__pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 293, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/event.py":296 + * + * # by definition we are now ready + * return self.get(block=False) # <<<<<<<<<<<<<< + * + * def get_nowait(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_10.__pyx_n = 1; + __pyx_t_10.block = Py_False; + __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_6_event_AsyncResult *)__pyx_v_self->__pyx_base.__pyx_vtab)->get(__pyx_v_self, 0, &__pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 296, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "src/gevent/event.py":268 + * reraise(*self.exc_info) + * + * def get(self, block=True, timeout=None): # <<<<<<<<<<<<<< + * """Return the stored value or raise the exception. + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("gevent._event.AsyncResult.get", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_15get(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6gevent_6_event_11AsyncResult_14get[] = "AsyncResult.get(self, block=True, timeout=None)\nReturn the stored value or raise the exception.\n\n If this instance already holds a value or an exception, return or raise it immediately.\n Otherwise, block until another greenlet calls :meth:`set` or :meth:`set_exception` or\n until the optional timeout occurs.\n\n When the *timeout* argument is present and not ``None``, it should be a\n floating point number specifying a timeout for the operation in seconds\n (or fractions thereof). If the *timeout* elapses, the *Timeout* exception will\n be raised.\n\n :keyword bool block: If set to ``False`` and this instance is not ready,\n immediately raise a :class:`Timeout` exception.\n "; +static PyMethodDef __pyx_mdef_6gevent_6_event_11AsyncResult_15get = {"get", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_6_event_11AsyncResult_15get, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_6_event_11AsyncResult_14get}; +static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_15get(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_block = 0; + PyObject *__pyx_v_timeout = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_block,&__pyx_n_s_timeout,0}; + PyObject* values[2] = {0,0}; + values[0] = ((PyObject *)Py_True); + values[1] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_block); + if (value) { values[0] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 1: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_timeout); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get") < 0)) __PYX_ERR(0, 268, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_block = values[0]; + __pyx_v_timeout = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("get", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 268, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent._event.AsyncResult.get", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_6_event_11AsyncResult_14get(((struct __pyx_obj_6gevent_6_event_AsyncResult *)__pyx_v_self), __pyx_v_block, __pyx_v_timeout); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_event_11AsyncResult_14get(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self, PyObject *__pyx_v_block, PyObject *__pyx_v_timeout) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + struct __pyx_opt_args_6gevent_6_event_11AsyncResult_get __pyx_t_2; + __Pyx_RefNannySetupContext("get", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_2.__pyx_n = 2; + __pyx_t_2.block = __pyx_v_block; + __pyx_t_2.timeout = __pyx_v_timeout; + __pyx_t_1 = __pyx_vtabptr_6gevent_6_event_AsyncResult->get(__pyx_v_self, 1, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 268, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent._event.AsyncResult.get", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/event.py":298 + * return self.get(block=False) + * + * def get_nowait(self): # <<<<<<<<<<<<<< + * """ + * Return the value or raise the exception without blocking. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_17get_nowait(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6gevent_6_event_11AsyncResult_16get_nowait[] = "AsyncResult.get_nowait(self)\n\n Return the value or raise the exception without blocking.\n\n If this object is not yet :meth:`ready `, raise\n :class:`gevent.Timeout` immediately.\n "; +static PyMethodDef __pyx_mdef_6gevent_6_event_11AsyncResult_17get_nowait = {"get_nowait", (PyCFunction)__pyx_pw_6gevent_6_event_11AsyncResult_17get_nowait, METH_NOARGS, __pyx_doc_6gevent_6_event_11AsyncResult_16get_nowait}; +static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_17get_nowait(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get_nowait (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6_event_11AsyncResult_16get_nowait(((struct __pyx_obj_6gevent_6_event_AsyncResult *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_event_11AsyncResult_16get_nowait(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + struct __pyx_opt_args_6gevent_6_event_11AsyncResult_get __pyx_t_2; + __Pyx_RefNannySetupContext("get_nowait", 0); + + /* "src/gevent/event.py":305 + * :class:`gevent.Timeout` immediately. + * """ + * return self.get(block=False) # <<<<<<<<<<<<<< + * + * def _wait_return_value(self, waited, wait_success): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2.__pyx_n = 1; + __pyx_t_2.block = Py_False; + __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_6_event_AsyncResult *)__pyx_v_self->__pyx_base.__pyx_vtab)->get(__pyx_v_self, 0, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 305, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "src/gevent/event.py":298 + * return self.get(block=False) + * + * def get_nowait(self): # <<<<<<<<<<<<<< + * """ + * Return the value or raise the exception without blocking. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent._event.AsyncResult.get_nowait", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/event.py":307 + * return self.get(block=False) + * + * def _wait_return_value(self, waited, wait_success): # <<<<<<<<<<<<<< + * # pylint:disable=unused-argument + * # Always return the value. Since this is a one-shot event, + */ + +static PyObject *__pyx_f_6gevent_6_event_11AsyncResult__wait_return_value(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_waited, CYTHON_UNUSED PyObject *__pyx_v_wait_success) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("_wait_return_value", 0); + + /* "src/gevent/event.py":311 + * # Always return the value. Since this is a one-shot event, + * # no race condition should reset it. + * return self.value # <<<<<<<<<<<<<< + * + * def wait(self, timeout=None): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 311, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "src/gevent/event.py":307 + * return self.get(block=False) + * + * def _wait_return_value(self, waited, wait_success): # <<<<<<<<<<<<<< + * # pylint:disable=unused-argument + * # Always return the value. Since this is a one-shot event, + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent._event.AsyncResult._wait_return_value", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/event.py":313 + * return self.value + * + * def wait(self, timeout=None): # <<<<<<<<<<<<<< + * """Block until the instance is ready. + * + */ + +static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_19wait(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_6gevent_6_event_11AsyncResult_wait(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_6_event_11AsyncResult_wait *__pyx_optional_args) { + PyObject *__pyx_v_timeout = ((PyObject *)Py_None); + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + struct __pyx_opt_args_6gevent_19__abstract_linkable_16AbstractLinkable__wait __pyx_t_5; + __Pyx_RefNannySetupContext("wait", 0); + if (__pyx_optional_args) { + if (__pyx_optional_args->__pyx_n > 0) { + __pyx_v_timeout = __pyx_optional_args->timeout; + } + } + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0; + if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self)))))); + else { + PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + #endif + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_wait); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 313, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_6_event_11AsyncResult_19wait)) { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_timeout) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_timeout); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 313, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0; + if (unlikely(type_dict_guard != tp_dict_version)) { + tp_dict_version = obj_dict_version = 0; + } + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + } + #endif + } + + /* "src/gevent/event.py":332 + * + * """ + * return self._wait(timeout) # <<<<<<<<<<<<<< + * + * # link protocol + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_5.__pyx_n = 1; + __pyx_t_5.timeout = __pyx_v_timeout; + __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_6_event_AsyncResult *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._wait(((struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *)__pyx_v_self), &__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 332, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "src/gevent/event.py":313 + * return self.value + * + * def wait(self, timeout=None): # <<<<<<<<<<<<<< + * """Block until the instance is ready. + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("gevent._event.AsyncResult.wait", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_19wait(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6gevent_6_event_11AsyncResult_18wait[] = "AsyncResult.wait(self, timeout=None)\nBlock until the instance is ready.\n\n If this instance already holds a value, it is returned immediately. If this\n instance already holds an exception, ``None`` is returned immediately.\n\n Otherwise, block until another greenlet calls :meth:`set` or :meth:`set_exception`\n (at which point either the value or ``None`` will be returned, respectively),\n or until the optional timeout expires (at which point ``None`` will also be\n returned).\n\n When the *timeout* argument is present and not ``None``, it should be a\n floating point number specifying a timeout for the operation in seconds\n (or fractions thereof).\n\n .. note:: If a timeout is given and expires, ``None`` will be returned\n (no timeout exception will be raised).\n\n "; +static PyMethodDef __pyx_mdef_6gevent_6_event_11AsyncResult_19wait = {"wait", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_6_event_11AsyncResult_19wait, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_6_event_11AsyncResult_18wait}; +static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_19wait(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_timeout = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("wait (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_timeout,0}; + PyObject* values[1] = {0}; + values[0] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_timeout); + if (value) { values[0] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "wait") < 0)) __PYX_ERR(0, 313, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_timeout = values[0]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("wait", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 313, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent._event.AsyncResult.wait", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_6_event_11AsyncResult_18wait(((struct __pyx_obj_6gevent_6_event_AsyncResult *)__pyx_v_self), __pyx_v_timeout); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_event_11AsyncResult_18wait(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self, PyObject *__pyx_v_timeout) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + struct __pyx_opt_args_6gevent_6_event_11AsyncResult_wait __pyx_t_2; + __Pyx_RefNannySetupContext("wait", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_2.__pyx_n = 1; + __pyx_t_2.timeout = __pyx_v_timeout; + __pyx_t_1 = __pyx_vtabptr_6gevent_6_event_AsyncResult->wait(__pyx_v_self, 1, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 313, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent._event.AsyncResult.wait", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/event.py":335 + * + * # link protocol + * def __call__(self, source): # <<<<<<<<<<<<<< + * if source.successful(): + * self.set(source.value) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_21__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_21__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_source = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__call__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_source,0}; + PyObject* values[1] = {0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_source)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__call__") < 0)) __PYX_ERR(0, 335, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + } + __pyx_v_source = values[0]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__call__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 335, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent._event.AsyncResult.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_6_event_11AsyncResult_20__call__(((struct __pyx_obj_6gevent_6_event_AsyncResult *)__pyx_v_self), __pyx_v_source); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_event_11AsyncResult_20__call__(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self, PyObject *__pyx_v_source) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + __Pyx_RefNannySetupContext("__call__", 0); + + /* "src/gevent/event.py":336 + * # link protocol + * def __call__(self, source): + * if source.successful(): # <<<<<<<<<<<<<< + * self.set(source.value) + * else: + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_source, __pyx_n_s_successful); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 336, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 336, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 336, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_4) { + + /* "src/gevent/event.py":337 + * def __call__(self, source): + * if source.successful(): + * self.set(source.value) # <<<<<<<<<<<<<< + * else: + * self.set_exception(source.exception, getattr(source, 'exc_info', None)) + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 337, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_source, __pyx_n_s_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 337, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 337, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/event.py":336 + * # link protocol + * def __call__(self, source): + * if source.successful(): # <<<<<<<<<<<<<< + * self.set(source.value) + * else: + */ + goto __pyx_L3; + } + + /* "src/gevent/event.py":339 + * self.set(source.value) + * else: + * self.set_exception(source.exception, getattr(source, 'exc_info', None)) # <<<<<<<<<<<<<< + * + * # Methods to make us more like concurrent.futures.Future + */ + /*else*/ { + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_exception); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 339, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_source, __pyx_n_s_exception_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 339, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = __Pyx_GetAttr3(__pyx_v_source, __pyx_n_s_exc_info, Py_None); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 339, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = NULL; + __pyx_t_7 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_6)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_7 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_3, __pyx_t_5}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 339, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_3, __pyx_t_5}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 339, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } else + #endif + { + __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 339, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + if (__pyx_t_6) { + __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL; + } + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_t_5); + __pyx_t_3 = 0; + __pyx_t_5 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 339, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + __pyx_L3:; + + /* "src/gevent/event.py":335 + * + * # link protocol + * def __call__(self, source): # <<<<<<<<<<<<<< + * if source.successful(): + * self.set(source.value) + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("gevent._event.AsyncResult.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/event.py":343 + * # Methods to make us more like concurrent.futures.Future + * + * def result(self, timeout=None): # <<<<<<<<<<<<<< + * return self.get(timeout=timeout) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_23result(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6gevent_6_event_11AsyncResult_22result[] = "AsyncResult.result(self, timeout=None)"; +static PyMethodDef __pyx_mdef_6gevent_6_event_11AsyncResult_23result = {"result", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_6_event_11AsyncResult_23result, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_6_event_11AsyncResult_22result}; +static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_23result(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_timeout = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("result (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_timeout,0}; + PyObject* values[1] = {0}; + values[0] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_timeout); + if (value) { values[0] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "result") < 0)) __PYX_ERR(0, 343, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_timeout = values[0]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("result", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 343, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent._event.AsyncResult.result", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_6_event_11AsyncResult_22result(((struct __pyx_obj_6gevent_6_event_AsyncResult *)__pyx_v_self), __pyx_v_timeout); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_event_11AsyncResult_22result(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self, PyObject *__pyx_v_timeout) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("result", 0); + + /* "src/gevent/event.py":344 + * + * def result(self, timeout=None): + * return self.get(timeout=timeout) # <<<<<<<<<<<<<< + * + * set_result = set + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 344, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 344, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_timeout, __pyx_v_timeout) < 0) __PYX_ERR(0, 344, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 344, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "src/gevent/event.py":343 + * # Methods to make us more like concurrent.futures.Future + * + * def result(self, timeout=None): # <<<<<<<<<<<<<< + * return self.get(timeout=timeout) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("gevent._event.AsyncResult.result", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/event.py":348 + * set_result = set + * + * def done(self): # <<<<<<<<<<<<<< + * return self.ready() + * + */ + +static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_25done(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static int __pyx_f_6gevent_6_event_11AsyncResult_done(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self, int __pyx_skip_dispatch) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + __Pyx_RefNannySetupContext("done", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0; + if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self)))))); + else { + PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + #endif + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_done); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 348, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_6_event_11AsyncResult_25done)) { + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 348, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 348, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_5; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0; + if (unlikely(type_dict_guard != tp_dict_version)) { + tp_dict_version = obj_dict_version = 0; + } + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + } + #endif + } + + /* "src/gevent/event.py":349 + * + * def done(self): + * return self.ready() # <<<<<<<<<<<<<< + * + * # we don't support cancelling + */ + __pyx_r = ((struct __pyx_vtabstruct_6gevent_6_event_AsyncResult *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.ready(((struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *)__pyx_v_self), 0); + goto __pyx_L0; + + /* "src/gevent/event.py":348 + * set_result = set + * + * def done(self): # <<<<<<<<<<<<<< + * return self.ready() + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_WriteUnraisable("gevent._event.AsyncResult.done", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_25done(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6gevent_6_event_11AsyncResult_24done[] = "AsyncResult.done(self) -> bool"; +static PyMethodDef __pyx_mdef_6gevent_6_event_11AsyncResult_25done = {"done", (PyCFunction)__pyx_pw_6gevent_6_event_11AsyncResult_25done, METH_NOARGS, __pyx_doc_6gevent_6_event_11AsyncResult_24done}; +static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_25done(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("done (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6_event_11AsyncResult_24done(((struct __pyx_obj_6gevent_6_event_AsyncResult *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_event_11AsyncResult_24done(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("done", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_f_6gevent_6_event_11AsyncResult_done(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 348, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent._event.AsyncResult.done", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/event.py":353 + * # we don't support cancelling + * + * def cancel(self): # <<<<<<<<<<<<<< + * return False + * + */ + +static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_27cancel(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static int __pyx_f_6gevent_6_event_11AsyncResult_cancel(CYTHON_UNUSED struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self, int __pyx_skip_dispatch) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + __Pyx_RefNannySetupContext("cancel", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0; + if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self)))))); + else { + PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + #endif + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_cancel); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 353, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_6_event_11AsyncResult_27cancel)) { + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 353, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 353, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_5; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0; + if (unlikely(type_dict_guard != tp_dict_version)) { + tp_dict_version = obj_dict_version = 0; + } + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + } + #endif + } + + /* "src/gevent/event.py":354 + * + * def cancel(self): + * return False # <<<<<<<<<<<<<< + * + * def cancelled(self): + */ + __pyx_r = 0; + goto __pyx_L0; + + /* "src/gevent/event.py":353 + * # we don't support cancelling + * + * def cancel(self): # <<<<<<<<<<<<<< + * return False + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_WriteUnraisable("gevent._event.AsyncResult.cancel", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_27cancel(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6gevent_6_event_11AsyncResult_26cancel[] = "AsyncResult.cancel(self) -> bool"; +static PyMethodDef __pyx_mdef_6gevent_6_event_11AsyncResult_27cancel = {"cancel", (PyCFunction)__pyx_pw_6gevent_6_event_11AsyncResult_27cancel, METH_NOARGS, __pyx_doc_6gevent_6_event_11AsyncResult_26cancel}; +static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_27cancel(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("cancel (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6_event_11AsyncResult_26cancel(((struct __pyx_obj_6gevent_6_event_AsyncResult *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_event_11AsyncResult_26cancel(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("cancel", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_f_6gevent_6_event_11AsyncResult_cancel(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 353, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent._event.AsyncResult.cancel", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/event.py":356 + * return False + * + * def cancelled(self): # <<<<<<<<<<<<<< + * return False + * + */ + +static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_29cancelled(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static int __pyx_f_6gevent_6_event_11AsyncResult_cancelled(CYTHON_UNUSED struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self, int __pyx_skip_dispatch) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + __Pyx_RefNannySetupContext("cancelled", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0; + if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self)))))); + else { + PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + #endif + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_cancelled); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 356, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_6_event_11AsyncResult_29cancelled)) { + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 356, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 356, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_5; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0; + if (unlikely(type_dict_guard != tp_dict_version)) { + tp_dict_version = obj_dict_version = 0; + } + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + } + #endif + } + + /* "src/gevent/event.py":357 + * + * def cancelled(self): + * return False # <<<<<<<<<<<<<< + * + * # exception is a method, we use it as a property + */ + __pyx_r = 0; + goto __pyx_L0; + + /* "src/gevent/event.py":356 + * return False + * + * def cancelled(self): # <<<<<<<<<<<<<< + * return False + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_WriteUnraisable("gevent._event.AsyncResult.cancelled", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_29cancelled(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6gevent_6_event_11AsyncResult_28cancelled[] = "AsyncResult.cancelled(self) -> bool"; +static PyMethodDef __pyx_mdef_6gevent_6_event_11AsyncResult_29cancelled = {"cancelled", (PyCFunction)__pyx_pw_6gevent_6_event_11AsyncResult_29cancelled, METH_NOARGS, __pyx_doc_6gevent_6_event_11AsyncResult_28cancelled}; +static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_29cancelled(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("cancelled (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6_event_11AsyncResult_28cancelled(((struct __pyx_obj_6gevent_6_event_AsyncResult *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_event_11AsyncResult_28cancelled(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("cancelled", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_f_6gevent_6_event_11AsyncResult_cancelled(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 356, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent._event.AsyncResult.cancelled", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/_event.pxd":17 + * + * cdef class AsyncResult(AbstractLinkable): + * cdef readonly _value # <<<<<<<<<<<<<< + * cdef readonly tuple _exc_info + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_6_value_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_6_value_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6_event_11AsyncResult_6_value___get__(((struct __pyx_obj_6gevent_6_event_AsyncResult *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_event_11AsyncResult_6_value___get__(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->_value); + __pyx_r = __pyx_v_self->_value; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/_event.pxd":18 + * cdef class AsyncResult(AbstractLinkable): + * cdef readonly _value + * cdef readonly tuple _exc_info # <<<<<<<<<<<<<< + * + * # For the use of _imap.py + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_9_exc_info_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_9_exc_info_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6_event_11AsyncResult_9_exc_info___get__(((struct __pyx_obj_6gevent_6_event_AsyncResult *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_event_11AsyncResult_9_exc_info___get__(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->_exc_info); + __pyx_r = __pyx_v_self->_exc_info; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/_event.pxd":21 + * + * # For the use of _imap.py + * cdef public int _imap_task_index # <<<<<<<<<<<<<< + * + * cpdef get(self, block=*, timeout=*) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_16_imap_task_index_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_16_imap_task_index_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6_event_11AsyncResult_16_imap_task_index___get__(((struct __pyx_obj_6gevent_6_event_AsyncResult *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_event_11AsyncResult_16_imap_task_index___get__(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->_imap_task_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 21, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent._event.AsyncResult._imap_task_index.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6gevent_6_event_11AsyncResult_16_imap_task_index_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6gevent_6_event_11AsyncResult_16_imap_task_index_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6_event_11AsyncResult_16_imap_task_index_2__set__(((struct __pyx_obj_6gevent_6_event_AsyncResult *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_6_event_11AsyncResult_16_imap_task_index_2__set__(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("__set__", 0); + __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 21, __pyx_L1_error) + __pyx_v_self->_imap_task_index = __pyx_t_1; + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("gevent._event.AsyncResult._imap_task_index.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/__greenlet_primitives.pxd":23 + * + * @cython.final + * cdef inline greenlet getcurrent(): # <<<<<<<<<<<<<< + * return PyGreenlet_GetCurrent() + * + */ + +static CYTHON_INLINE PyGreenlet *__pyx_f_6gevent_21__greenlet_primitives_getcurrent(void) { + PyGreenlet *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("getcurrent", 0); + + /* "gevent/__greenlet_primitives.pxd":24 + * @cython.final + * cdef inline greenlet getcurrent(): + * return PyGreenlet_GetCurrent() # <<<<<<<<<<<<<< + * + * cdef bint _greenlet_imported + */ + __Pyx_XDECREF(((PyObject *)__pyx_r)); + __pyx_t_1 = ((PyObject *)PyGreenlet_GetCurrent()); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 24, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = ((PyGreenlet *)__pyx_t_1); + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "gevent/__greenlet_primitives.pxd":23 + * + * @cython.final + * cdef inline greenlet getcurrent(): # <<<<<<<<<<<<<< + * return PyGreenlet_GetCurrent() + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__greenlet_primitives.getcurrent", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF((PyObject *)__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/__greenlet_primitives.pxd":28 + * cdef bint _greenlet_imported + * + * cdef inline void greenlet_init(): # <<<<<<<<<<<<<< + * global _greenlet_imported + * if not _greenlet_imported: + */ + +static CYTHON_INLINE void __pyx_f_6gevent_21__greenlet_primitives_greenlet_init(void) { + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("greenlet_init", 0); + + /* "gevent/__greenlet_primitives.pxd":30 + * cdef inline void greenlet_init(): + * global _greenlet_imported + * if not _greenlet_imported: # <<<<<<<<<<<<<< + * PyGreenlet_Import() + * _greenlet_imported = True + */ + __pyx_t_1 = ((!(__pyx_v_6gevent_21__greenlet_primitives__greenlet_imported != 0)) != 0); + if (__pyx_t_1) { + + /* "gevent/__greenlet_primitives.pxd":31 + * global _greenlet_imported + * if not _greenlet_imported: + * PyGreenlet_Import() # <<<<<<<<<<<<<< + * _greenlet_imported = True + * + */ + PyGreenlet_Import(); + + /* "gevent/__greenlet_primitives.pxd":32 + * if not _greenlet_imported: + * PyGreenlet_Import() + * _greenlet_imported = True # <<<<<<<<<<<<<< + * + * cdef inline object _greenlet_switch(greenlet self): + */ + __pyx_v_6gevent_21__greenlet_primitives__greenlet_imported = 1; + + /* "gevent/__greenlet_primitives.pxd":30 + * cdef inline void greenlet_init(): + * global _greenlet_imported + * if not _greenlet_imported: # <<<<<<<<<<<<<< + * PyGreenlet_Import() + * _greenlet_imported = True + */ + } + + /* "gevent/__greenlet_primitives.pxd":28 + * cdef bint _greenlet_imported + * + * cdef inline void greenlet_init(): # <<<<<<<<<<<<<< + * global _greenlet_imported + * if not _greenlet_imported: + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "gevent/__greenlet_primitives.pxd":34 + * _greenlet_imported = True + * + * cdef inline object _greenlet_switch(greenlet self): # <<<<<<<<<<<<<< + * return PyGreenlet_Switch(self, NULL, NULL) + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_6gevent_21__greenlet_primitives__greenlet_switch(PyGreenlet *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("_greenlet_switch", 0); + + /* "gevent/__greenlet_primitives.pxd":35 + * + * cdef inline object _greenlet_switch(greenlet self): + * return PyGreenlet_Switch(self, NULL, NULL) # <<<<<<<<<<<<<< + * + * cdef class TrackedRawGreenlet(greenlet): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyGreenlet_Switch(__pyx_v_self, NULL, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 35, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "gevent/__greenlet_primitives.pxd":34 + * _greenlet_imported = True + * + * cdef inline object _greenlet_switch(greenlet self): # <<<<<<<<<<<<<< + * return PyGreenlet_Switch(self, NULL, NULL) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__greenlet_primitives._greenlet_switch", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/__abstract_linkable.pxd":21 + * void PyGreenlet_Import() + * + * cdef inline greenlet getcurrent(): # <<<<<<<<<<<<<< + * return PyGreenlet_GetCurrent() + * + */ + +static CYTHON_INLINE PyGreenlet *__pyx_f_6gevent_19__abstract_linkable_getcurrent(void) { + PyGreenlet *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("getcurrent", 0); + + /* "gevent/__abstract_linkable.pxd":22 + * + * cdef inline greenlet getcurrent(): + * return PyGreenlet_GetCurrent() # <<<<<<<<<<<<<< + * + * cdef inline void greenlet_init(): + */ + __Pyx_XDECREF(((PyObject *)__pyx_r)); + __pyx_t_1 = ((PyObject *)PyGreenlet_GetCurrent()); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 22, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = ((PyGreenlet *)__pyx_t_1); + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "gevent/__abstract_linkable.pxd":21 + * void PyGreenlet_Import() + * + * cdef inline greenlet getcurrent(): # <<<<<<<<<<<<<< + * return PyGreenlet_GetCurrent() + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__abstract_linkable.getcurrent", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF((PyObject *)__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/__abstract_linkable.pxd":24 + * return PyGreenlet_GetCurrent() + * + * cdef inline void greenlet_init(): # <<<<<<<<<<<<<< + * global _greenlet_imported + * if not _greenlet_imported: + */ + +static CYTHON_INLINE void __pyx_f_6gevent_19__abstract_linkable_greenlet_init(void) { + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("greenlet_init", 0); + + /* "gevent/__abstract_linkable.pxd":26 + * cdef inline void greenlet_init(): + * global _greenlet_imported + * if not _greenlet_imported: # <<<<<<<<<<<<<< + * PyGreenlet_Import() + * _greenlet_imported = True + */ + __pyx_t_1 = ((!(__pyx_v_6gevent_19__abstract_linkable__greenlet_imported != 0)) != 0); + if (__pyx_t_1) { + + /* "gevent/__abstract_linkable.pxd":27 + * global _greenlet_imported + * if not _greenlet_imported: + * PyGreenlet_Import() # <<<<<<<<<<<<<< + * _greenlet_imported = True + * + */ + PyGreenlet_Import(); + + /* "gevent/__abstract_linkable.pxd":28 + * if not _greenlet_imported: + * PyGreenlet_Import() + * _greenlet_imported = True # <<<<<<<<<<<<<< + * + * cdef void _init() + */ + __pyx_v_6gevent_19__abstract_linkable__greenlet_imported = 1; + + /* "gevent/__abstract_linkable.pxd":26 + * cdef inline void greenlet_init(): + * global _greenlet_imported + * if not _greenlet_imported: # <<<<<<<<<<<<<< + * PyGreenlet_Import() + * _greenlet_imported = True + */ + } + + /* "gevent/__abstract_linkable.pxd":24 + * return PyGreenlet_GetCurrent() + * + * cdef inline void greenlet_init(): # <<<<<<<<<<<<<< + * global _greenlet_imported + * if not _greenlet_imported: + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} +static struct __pyx_vtabstruct_6gevent_6_event_Event __pyx_vtable_6gevent_6_event_Event; + +static PyObject *__pyx_tp_new_6gevent_6_event_Event(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_6gevent_6_event_Event *p; + PyObject *o = __pyx_ptype_6gevent_19__abstract_linkable_AbstractLinkable->tp_new(t, a, k); + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_6gevent_6_event_Event *)o); + p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_6gevent_19__abstract_linkable_AbstractLinkable*)__pyx_vtabptr_6gevent_6_event_Event; + return o; +} + +static void __pyx_tp_dealloc_6gevent_6_event_Event(PyObject *o) { + #if CYTHON_USE_TP_FINALIZE + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + PyObject_GC_UnTrack(o); + PyObject_GC_Track(o); + if (likely(__pyx_ptype_6gevent_19__abstract_linkable_AbstractLinkable)) __pyx_ptype_6gevent_19__abstract_linkable_AbstractLinkable->tp_dealloc(o); else __Pyx_call_next_tp_dealloc(o, __pyx_tp_dealloc_6gevent_6_event_Event); +} + +static int __pyx_tp_traverse_6gevent_6_event_Event(PyObject *o, visitproc v, void *a) { + int e; + e = ((likely(__pyx_ptype_6gevent_19__abstract_linkable_AbstractLinkable)) ? ((__pyx_ptype_6gevent_19__abstract_linkable_AbstractLinkable->tp_traverse) ? __pyx_ptype_6gevent_19__abstract_linkable_AbstractLinkable->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_6gevent_6_event_Event)); if (e) return e; + return 0; +} + +static int __pyx_tp_clear_6gevent_6_event_Event(PyObject *o) { + if (likely(__pyx_ptype_6gevent_19__abstract_linkable_AbstractLinkable)) { if (__pyx_ptype_6gevent_19__abstract_linkable_AbstractLinkable->tp_clear) __pyx_ptype_6gevent_19__abstract_linkable_AbstractLinkable->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_6gevent_6_event_Event); + return 0; +} + +static PyMethodDef __pyx_methods_6gevent_6_event_Event[] = { + {"is_set", (PyCFunction)__pyx_pw_6gevent_6_event_5Event_5is_set, METH_NOARGS, __pyx_doc_6gevent_6_event_5Event_4is_set}, + {"isSet", (PyCFunction)__pyx_pw_6gevent_6_event_5Event_7isSet, METH_NOARGS, __pyx_doc_6gevent_6_event_5Event_6isSet}, + {"set", (PyCFunction)__pyx_pw_6gevent_6_event_5Event_11set, METH_NOARGS, __pyx_doc_6gevent_6_event_5Event_10set}, + {"clear", (PyCFunction)__pyx_pw_6gevent_6_event_5Event_13clear, METH_NOARGS, __pyx_doc_6gevent_6_event_5Event_12clear}, + {"wait", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_6_event_5Event_15wait, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_6_event_5Event_14wait}, + {"_reset_internal_locks", (PyCFunction)__pyx_pw_6gevent_6_event_5Event_17_reset_internal_locks, METH_NOARGS, __pyx_doc_6gevent_6_event_5Event_16_reset_internal_locks}, + {0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_6gevent_6_event_Event = { + PyVarObject_HEAD_INIT(0, 0) + "gevent._event.Event", /*tp_name*/ + sizeof(struct __pyx_obj_6gevent_6_event_Event), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6gevent_6_event_Event, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + __pyx_pw_6gevent_6_event_5Event_3__str__, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + "Event()\nA synchronization primitive that allows one greenlet to wake up one or more others.\n It has the same interface as :class:`threading.Event` but works across greenlets.\n\n An event object manages an internal flag that can be set to true with the\n :meth:`set` method and reset to false with the :meth:`clear` method. The :meth:`wait` method\n blocks until the flag is true.\n\n .. note::\n The order and timing in which waiting greenlets are awakened is not determined.\n As an implementation note, in gevent 1.1 and 1.0, waiting greenlets are awakened in a\n undetermined order sometime *after* the current greenlet yields to the event loop. Other greenlets\n (those not waiting to be awakened) may run between the current greenlet yielding and\n the waiting greenlets being awakened. These details may change in the future.\n ", /*tp_doc*/ + __pyx_tp_traverse_6gevent_6_event_Event, /*tp_traverse*/ + __pyx_tp_clear_6gevent_6_event_Event, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6gevent_6_event_Event, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_pw_6gevent_6_event_5Event_1__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6gevent_6_event_Event, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; +static struct __pyx_vtabstruct_6gevent_6_event_AsyncResult __pyx_vtable_6gevent_6_event_AsyncResult; + +static PyObject *__pyx_tp_new_6gevent_6_event_AsyncResult(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_6gevent_6_event_AsyncResult *p; + PyObject *o = __pyx_ptype_6gevent_19__abstract_linkable_AbstractLinkable->tp_new(t, a, k); + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_6gevent_6_event_AsyncResult *)o); + p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_6gevent_19__abstract_linkable_AbstractLinkable*)__pyx_vtabptr_6gevent_6_event_AsyncResult; + p->_value = Py_None; Py_INCREF(Py_None); + p->_exc_info = ((PyObject*)Py_None); Py_INCREF(Py_None); + return o; +} + +static void __pyx_tp_dealloc_6gevent_6_event_AsyncResult(PyObject *o) { + struct __pyx_obj_6gevent_6_event_AsyncResult *p = (struct __pyx_obj_6gevent_6_event_AsyncResult *)o; + #if CYTHON_USE_TP_FINALIZE + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + PyObject_GC_UnTrack(o); + Py_CLEAR(p->_value); + Py_CLEAR(p->_exc_info); + PyObject_GC_Track(o); + if (likely(__pyx_ptype_6gevent_19__abstract_linkable_AbstractLinkable)) __pyx_ptype_6gevent_19__abstract_linkable_AbstractLinkable->tp_dealloc(o); else __Pyx_call_next_tp_dealloc(o, __pyx_tp_dealloc_6gevent_6_event_AsyncResult); +} + +static int __pyx_tp_traverse_6gevent_6_event_AsyncResult(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_6gevent_6_event_AsyncResult *p = (struct __pyx_obj_6gevent_6_event_AsyncResult *)o; + e = ((likely(__pyx_ptype_6gevent_19__abstract_linkable_AbstractLinkable)) ? ((__pyx_ptype_6gevent_19__abstract_linkable_AbstractLinkable->tp_traverse) ? __pyx_ptype_6gevent_19__abstract_linkable_AbstractLinkable->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_6gevent_6_event_AsyncResult)); if (e) return e; + if (p->_value) { + e = (*v)(p->_value, a); if (e) return e; + } + if (p->_exc_info) { + e = (*v)(p->_exc_info, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_6gevent_6_event_AsyncResult(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_6gevent_6_event_AsyncResult *p = (struct __pyx_obj_6gevent_6_event_AsyncResult *)o; + if (likely(__pyx_ptype_6gevent_19__abstract_linkable_AbstractLinkable)) { if (__pyx_ptype_6gevent_19__abstract_linkable_AbstractLinkable->tp_clear) __pyx_ptype_6gevent_19__abstract_linkable_AbstractLinkable->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_6gevent_6_event_AsyncResult); + tmp = ((PyObject*)p->_value); + p->_value = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->_exc_info); + p->_exc_info = ((PyObject*)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyObject *__pyx_getprop_6gevent_6_event_11AsyncResult__exception(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_6_event_11AsyncResult_10_exception_1__get__(o); +} + +static PyObject *__pyx_getprop_6gevent_6_event_11AsyncResult_value(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_6_event_11AsyncResult_5value_1__get__(o); +} + +static PyObject *__pyx_getprop_6gevent_6_event_11AsyncResult_exc_info(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_6_event_11AsyncResult_8exc_info_1__get__(o); +} + +static PyObject *__pyx_getprop_6gevent_6_event_11AsyncResult_exception(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_6_event_11AsyncResult_9exception_1__get__(o); +} + +static PyObject *__pyx_getprop_6gevent_6_event_11AsyncResult__value(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_6_event_11AsyncResult_6_value_1__get__(o); +} + +static PyObject *__pyx_getprop_6gevent_6_event_11AsyncResult__exc_info(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_6_event_11AsyncResult_9_exc_info_1__get__(o); +} + +static PyObject *__pyx_getprop_6gevent_6_event_11AsyncResult__imap_task_index(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_6_event_11AsyncResult_16_imap_task_index_1__get__(o); +} + +static int __pyx_setprop_6gevent_6_event_11AsyncResult__imap_task_index(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6gevent_6_event_11AsyncResult_16_imap_task_index_3__set__(o, v); + } + else { + PyErr_SetString(PyExc_NotImplementedError, "__del__"); + return -1; + } +} + +static PyMethodDef __pyx_methods_6gevent_6_event_AsyncResult[] = { + {"set", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_6_event_11AsyncResult_9set, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_6_event_11AsyncResult_8set}, + {"set_exception", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_6_event_11AsyncResult_11set_exception, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_6_event_11AsyncResult_10set_exception}, + {"_raise_exception", (PyCFunction)__pyx_pw_6gevent_6_event_11AsyncResult_13_raise_exception, METH_NOARGS, __pyx_doc_6gevent_6_event_11AsyncResult_12_raise_exception}, + {"get_nowait", (PyCFunction)__pyx_pw_6gevent_6_event_11AsyncResult_17get_nowait, METH_NOARGS, __pyx_doc_6gevent_6_event_11AsyncResult_16get_nowait}, + {"result", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_6_event_11AsyncResult_23result, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_6_event_11AsyncResult_22result}, + {0, 0, 0, 0} +}; + +static struct PyGetSetDef __pyx_getsets_6gevent_6_event_AsyncResult[] = { + {(char *)"_exception", __pyx_getprop_6gevent_6_event_11AsyncResult__exception, 0, (char *)0, 0}, + {(char *)"value", __pyx_getprop_6gevent_6_event_11AsyncResult_value, 0, (char *)"\n Holds the value passed to :meth:`set` if :meth:`set` was called. Otherwise,\n ``None``\n ", 0}, + {(char *)"exc_info", __pyx_getprop_6gevent_6_event_11AsyncResult_exc_info, 0, (char *)"\n The three-tuple of exception information if :meth:`set_exception` was called.\n ", 0}, + {(char *)"exception", __pyx_getprop_6gevent_6_event_11AsyncResult_exception, 0, (char *)"Holds the exception instance passed to :meth:`set_exception` if :meth:`set_exception` was called.\n Otherwise ``None``.", 0}, + {(char *)"_value", __pyx_getprop_6gevent_6_event_11AsyncResult__value, 0, (char *)0, 0}, + {(char *)"_exc_info", __pyx_getprop_6gevent_6_event_11AsyncResult__exc_info, 0, (char *)0, 0}, + {(char *)"_imap_task_index", __pyx_getprop_6gevent_6_event_11AsyncResult__imap_task_index, __pyx_setprop_6gevent_6_event_11AsyncResult__imap_task_index, (char *)"_imap_task_index: 'int'", 0}, + {0, 0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_6gevent_6_event_AsyncResult = { + PyVarObject_HEAD_INIT(0, 0) + "gevent._event.AsyncResult", /*tp_name*/ + sizeof(struct __pyx_obj_6gevent_6_event_AsyncResult), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6gevent_6_event_AsyncResult, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + __pyx_pw_6gevent_6_event_11AsyncResult_21__call__, /*tp_call*/ + __pyx_pw_6gevent_6_event_11AsyncResult_3__str__, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + "AsyncResult()\nA one-time event that stores a value or an exception.\n\n Like :class:`Event` it wakes up all the waiters when :meth:`set` or :meth:`set_exception`\n is called. Waiters may receive the passed value or exception by calling :meth:`get`\n instead of :meth:`wait`. An :class:`AsyncResult` instance cannot be reset.\n\n To pass a value call :meth:`set`. Calls to :meth:`get` (those that are currently blocking as well as\n those made in the future) will return the value:\n\n >>> result = AsyncResult()\n >>> result.set(100)\n >>> result.get()\n 100\n\n To pass an exception call :meth:`set_exception`. This will cause :meth:`get` to raise that exception:\n\n >>> result = AsyncResult()\n >>> result.set_exception(RuntimeError('failure'))\n >>> result.get()\n Traceback (most recent call last):\n ...\n RuntimeError: failure\n\n :class:`AsyncResult` implements :meth:`__call__` and thus can be used as :meth:`link` target:\n\n >>> import gevent\n >>> result = AsyncResult()\n >>> gevent.spawn(lambda : 1/0).link(result)\n >>> try:\n ... result.get()\n ... except ZeroDivisionError:\n ... print('ZeroDivisionError')\n ZeroDivisionError\n\n .. note::\n The order and timing in which waiting greenlets are awakened is not determined.\n As an implementation note, in gevent 1.1 and 1.0, waiting greenlets are awakened in a\n undetermined order sometime *after* the current greenlet yields to the event loop. Other greenlets\n (those not waiting to be awakened) may run between the current greenlet yielding and\n the waiting greenlets being awakened. These details may change in the future.\n\n .. versionchanged:: 1.1\n The exact order in which waiting greenlets are awakened is not the same\n as in 1.0.\n .. versionchanged:: 1.1\n Callbacks :meth:`linked ` to this"" object are required to be hashable, and duplicates are\n merged.\n ", /*tp_doc*/ + __pyx_tp_traverse_6gevent_6_event_AsyncResult, /*tp_traverse*/ + __pyx_tp_clear_6gevent_6_event_AsyncResult, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6gevent_6_event_AsyncResult, /*tp_methods*/ + 0, /*tp_members*/ + __pyx_getsets_6gevent_6_event_AsyncResult, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_pw_6gevent_6_event_11AsyncResult_1__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6gevent_6_event_AsyncResult, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static PyMethodDef __pyx_methods[] = { + {0, 0, 0, 0} +}; + +#if PY_MAJOR_VERSION >= 3 +#if CYTHON_PEP489_MULTI_PHASE_INIT +static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ +static int __pyx_pymod_exec__event(PyObject* module); /*proto*/ +static PyModuleDef_Slot __pyx_moduledef_slots[] = { + {Py_mod_create, (void*)__pyx_pymod_create}, + {Py_mod_exec, (void*)__pyx_pymod_exec__event}, + {0, NULL} +}; +#endif + +static struct PyModuleDef __pyx_moduledef = { + PyModuleDef_HEAD_INIT, + "_event", + __pyx_k_Basic_synchronization_primitives, /* m_doc */ + #if CYTHON_PEP489_MULTI_PHASE_INIT + 0, /* m_size */ + #else + -1, /* m_size */ + #endif + __pyx_methods /* m_methods */, + #if CYTHON_PEP489_MULTI_PHASE_INIT + __pyx_moduledef_slots, /* m_slots */ + #else + NULL, /* m_reload */ + #endif + NULL, /* m_traverse */ + NULL, /* m_clear */ + NULL /* m_free */ +}; +#endif +#ifndef CYTHON_SMALL_CODE +#if defined(__clang__) + #define CYTHON_SMALL_CODE +#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) + #define CYTHON_SMALL_CODE __attribute__((cold)) +#else + #define CYTHON_SMALL_CODE +#endif +#endif + +static __Pyx_StringTabEntry __pyx_string_tab[] = { + {&__pyx_n_s_AbstractLinkable, __pyx_k_AbstractLinkable, sizeof(__pyx_k_AbstractLinkable), 0, 0, 1, 1}, + {&__pyx_n_s_AsyncResult, __pyx_k_AsyncResult, sizeof(__pyx_k_AsyncResult), 0, 0, 1, 1}, + {&__pyx_n_s_AsyncResult__raise_exception, __pyx_k_AsyncResult__raise_exception, sizeof(__pyx_k_AsyncResult__raise_exception), 0, 0, 1, 1}, + {&__pyx_n_s_AsyncResult_cancel, __pyx_k_AsyncResult_cancel, sizeof(__pyx_k_AsyncResult_cancel), 0, 0, 1, 1}, + {&__pyx_n_s_AsyncResult_cancelled, __pyx_k_AsyncResult_cancelled, sizeof(__pyx_k_AsyncResult_cancelled), 0, 0, 1, 1}, + {&__pyx_n_s_AsyncResult_done, __pyx_k_AsyncResult_done, sizeof(__pyx_k_AsyncResult_done), 0, 0, 1, 1}, + {&__pyx_n_s_AsyncResult_get, __pyx_k_AsyncResult_get, sizeof(__pyx_k_AsyncResult_get), 0, 0, 1, 1}, + {&__pyx_n_s_AsyncResult_get_nowait, __pyx_k_AsyncResult_get_nowait, sizeof(__pyx_k_AsyncResult_get_nowait), 0, 0, 1, 1}, + {&__pyx_n_s_AsyncResult_ready, __pyx_k_AsyncResult_ready, sizeof(__pyx_k_AsyncResult_ready), 0, 0, 1, 1}, + {&__pyx_n_s_AsyncResult_result, __pyx_k_AsyncResult_result, sizeof(__pyx_k_AsyncResult_result), 0, 0, 1, 1}, + {&__pyx_n_s_AsyncResult_set, __pyx_k_AsyncResult_set, sizeof(__pyx_k_AsyncResult_set), 0, 0, 1, 1}, + {&__pyx_n_s_AsyncResult_set_exception, __pyx_k_AsyncResult_set_exception, sizeof(__pyx_k_AsyncResult_set_exception), 0, 0, 1, 1}, + {&__pyx_n_s_AsyncResult_successful, __pyx_k_AsyncResult_successful, sizeof(__pyx_k_AsyncResult_successful), 0, 0, 1, 1}, + {&__pyx_n_s_AsyncResult_wait, __pyx_k_AsyncResult_wait, sizeof(__pyx_k_AsyncResult_wait), 0, 0, 1, 1}, + {&__pyx_n_s_Event, __pyx_k_Event, sizeof(__pyx_k_Event), 0, 0, 1, 1}, + {&__pyx_n_s_Event__reset_internal_locks, __pyx_k_Event__reset_internal_locks, sizeof(__pyx_k_Event__reset_internal_locks), 0, 0, 1, 1}, + {&__pyx_n_s_Event_clear, __pyx_k_Event_clear, sizeof(__pyx_k_Event_clear), 0, 0, 1, 1}, + {&__pyx_n_s_Event_isSet, __pyx_k_Event_isSet, sizeof(__pyx_k_Event_isSet), 0, 0, 1, 1}, + {&__pyx_n_s_Event_is_set, __pyx_k_Event_is_set, sizeof(__pyx_k_Event_is_set), 0, 0, 1, 1}, + {&__pyx_n_s_Event_ready, __pyx_k_Event_ready, sizeof(__pyx_k_Event_ready), 0, 0, 1, 1}, + {&__pyx_n_s_Event_set, __pyx_k_Event_set, sizeof(__pyx_k_Event_set), 0, 0, 1, 1}, + {&__pyx_n_s_Event_wait, __pyx_k_Event_wait, sizeof(__pyx_k_Event_wait), 0, 0, 1, 1}, + {&__pyx_n_s_NONE, __pyx_k_NONE, sizeof(__pyx_k_NONE), 0, 0, 1, 1}, + {&__pyx_n_s_None, __pyx_k_None, sizeof(__pyx_k_None), 0, 0, 1, 1}, + {&__pyx_n_s_Timeout, __pyx_k_Timeout, sizeof(__pyx_k_Timeout), 0, 0, 1, 1}, + {&__pyx_n_s_abstract_linkable, __pyx_k_abstract_linkable, sizeof(__pyx_k_abstract_linkable), 0, 0, 1, 1}, + {&__pyx_n_s_all, __pyx_k_all, sizeof(__pyx_k_all), 0, 0, 1, 1}, + {&__pyx_n_s_block, __pyx_k_block, sizeof(__pyx_k_block), 0, 0, 1, 1}, + {&__pyx_n_s_cancel, __pyx_k_cancel, sizeof(__pyx_k_cancel), 0, 0, 1, 1}, + {&__pyx_n_s_cancelled, __pyx_k_cancelled, sizeof(__pyx_k_cancelled), 0, 0, 1, 1}, + {&__pyx_n_s_class, __pyx_k_class, sizeof(__pyx_k_class), 0, 0, 1, 1}, + {&__pyx_n_s_clear, __pyx_k_clear, sizeof(__pyx_k_clear), 0, 0, 1, 1}, + {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, + {&__pyx_n_s_done, __pyx_k_done, sizeof(__pyx_k_done), 0, 0, 1, 1}, + {&__pyx_n_s_dump_traceback, __pyx_k_dump_traceback, sizeof(__pyx_k_dump_traceback), 0, 0, 1, 1}, + {&__pyx_n_s_exc_info, __pyx_k_exc_info, sizeof(__pyx_k_exc_info), 0, 0, 1, 1}, + {&__pyx_n_s_exc_info_2, __pyx_k_exc_info_2, sizeof(__pyx_k_exc_info_2), 0, 0, 1, 1}, + {&__pyx_n_s_exception, __pyx_k_exception, sizeof(__pyx_k_exception), 0, 0, 1, 1}, + {&__pyx_n_s_exception_2, __pyx_k_exception_2, sizeof(__pyx_k_exception_2), 0, 0, 1, 1}, + {&__pyx_kp_s_exception_r, __pyx_k_exception_r, sizeof(__pyx_k_exception_r), 0, 0, 1, 0}, + {&__pyx_n_s_flag, __pyx_k_flag, sizeof(__pyx_k_flag), 0, 0, 1, 1}, + {&__pyx_n_s_get, __pyx_k_get, sizeof(__pyx_k_get), 0, 0, 1, 1}, + {&__pyx_n_s_get_linkable, __pyx_k_get_linkable, sizeof(__pyx_k_get_linkable), 0, 0, 1, 1}, + {&__pyx_n_s_get_nowait, __pyx_k_get_nowait, sizeof(__pyx_k_get_nowait), 0, 0, 1, 1}, + {&__pyx_kp_s_gevent__abstract_linkable, __pyx_k_gevent__abstract_linkable, sizeof(__pyx_k_gevent__abstract_linkable), 0, 0, 1, 0}, + {&__pyx_n_s_gevent__compat, __pyx_k_gevent__compat, sizeof(__pyx_k_gevent__compat), 0, 0, 1, 1}, + {&__pyx_n_s_gevent__event, __pyx_k_gevent__event, sizeof(__pyx_k_gevent__event), 0, 0, 1, 1}, + {&__pyx_n_s_gevent__tblib, __pyx_k_gevent__tblib, sizeof(__pyx_k_gevent__tblib), 0, 0, 1, 1}, + {&__pyx_n_s_gevent__util, __pyx_k_gevent__util, sizeof(__pyx_k_gevent__util), 0, 0, 1, 1}, + {&__pyx_n_s_gevent_timeout, __pyx_k_gevent_timeout, sizeof(__pyx_k_gevent_timeout), 0, 0, 1, 1}, + {&__pyx_kp_s_if_we_didn_t_wait_we_should_alre, __pyx_k_if_we_didn_t_wait_we_should_alre, sizeof(__pyx_k_if_we_didn_t_wait_we_should_alre), 0, 0, 1, 0}, + {&__pyx_n_s_imap_task_index, __pyx_k_imap_task_index, sizeof(__pyx_k_imap_task_index), 0, 0, 1, 1}, + {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, + {&__pyx_n_s_import_c_accel, __pyx_k_import_c_accel, sizeof(__pyx_k_import_c_accel), 0, 0, 1, 1}, + {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1}, + {&__pyx_n_s_isSet, __pyx_k_isSet, sizeof(__pyx_k_isSet), 0, 0, 1, 1}, + {&__pyx_n_s_is_set, __pyx_k_is_set, sizeof(__pyx_k_is_set), 0, 0, 1, 1}, + {&__pyx_n_s_linkcount, __pyx_k_linkcount, sizeof(__pyx_k_linkcount), 0, 0, 1, 1}, + {&__pyx_kp_s_links_s, __pyx_k_links_s, sizeof(__pyx_k_links_s), 0, 0, 1, 0}, + {&__pyx_n_s_load_traceback, __pyx_k_load_traceback, sizeof(__pyx_k_load_traceback), 0, 0, 1, 1}, + {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, + {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_capi, __pyx_k_pyx_capi, sizeof(__pyx_k_pyx_capi), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1}, + {&__pyx_n_s_raise_exception, __pyx_k_raise_exception, sizeof(__pyx_k_raise_exception), 0, 0, 1, 1}, + {&__pyx_n_s_ready, __pyx_k_ready, sizeof(__pyx_k_ready), 0, 0, 1, 1}, + {&__pyx_n_s_reraise, __pyx_k_reraise, sizeof(__pyx_k_reraise), 0, 0, 1, 1}, + {&__pyx_n_s_reset_internal_locks, __pyx_k_reset_internal_locks, sizeof(__pyx_k_reset_internal_locks), 0, 0, 1, 1}, + {&__pyx_n_s_result, __pyx_k_result, sizeof(__pyx_k_result), 0, 0, 1, 1}, + {&__pyx_kp_s_s, __pyx_k_s, sizeof(__pyx_k_s), 0, 0, 1, 0}, + {&__pyx_kp_s_s_s__links_s, __pyx_k_s_s__links_s, sizeof(__pyx_k_s_s__links_s), 0, 0, 1, 0}, + {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1}, + {&__pyx_n_s_set, __pyx_k_set, sizeof(__pyx_k_set), 0, 0, 1, 1}, + {&__pyx_n_s_set_exception, __pyx_k_set_exception, sizeof(__pyx_k_set_exception), 0, 0, 1, 1}, + {&__pyx_n_s_set_result, __pyx_k_set_result, sizeof(__pyx_k_set_result), 0, 0, 1, 1}, + {&__pyx_n_s_slots, __pyx_k_slots, sizeof(__pyx_k_slots), 0, 0, 1, 1}, + {&__pyx_n_s_source, __pyx_k_source, sizeof(__pyx_k_source), 0, 0, 1, 1}, + {&__pyx_kp_s_src_gevent_event_py, __pyx_k_src_gevent_event_py, sizeof(__pyx_k_src_gevent_event_py), 0, 0, 1, 0}, + {&__pyx_n_s_successful, __pyx_k_successful, sizeof(__pyx_k_successful), 0, 0, 1, 1}, + {&__pyx_n_s_super, __pyx_k_super, sizeof(__pyx_k_super), 0, 0, 1, 1}, + {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, + {&__pyx_n_s_timeout, __pyx_k_timeout, sizeof(__pyx_k_timeout), 0, 0, 1, 1}, + {&__pyx_kp_s_unset, __pyx_k_unset, sizeof(__pyx_k_unset), 0, 0, 1, 0}, + {&__pyx_n_s_value, __pyx_k_value, sizeof(__pyx_k_value), 0, 0, 1, 1}, + {&__pyx_n_s_value_2, __pyx_k_value_2, sizeof(__pyx_k_value_2), 0, 0, 1, 1}, + {&__pyx_kp_s_value_r, __pyx_k_value_r, sizeof(__pyx_k_value_r), 0, 0, 1, 0}, + {&__pyx_n_s_wait, __pyx_k_wait, sizeof(__pyx_k_wait), 0, 0, 1, 1}, + {&__pyx_n_s_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 0, 1, 1}, + {0, 0, 0, 0, 0, 0, 0} +}; +static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { + __pyx_builtin___import__ = __Pyx_GetBuiltinName(__pyx_n_s_import); if (!__pyx_builtin___import__) __PYX_ERR(0, 20, __pyx_L1_error) + __pyx_builtin_super = __Pyx_GetBuiltinName(__pyx_n_s_super); if (!__pyx_builtin_super) __PYX_ERR(0, 49, __pyx_L1_error) + return 0; + __pyx_L1_error:; + return -1; +} + +static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); + + /* "src/gevent/event.py":20 + * + * def _get_linkable(): + * x = __import__('gevent._abstract_linkable') # <<<<<<<<<<<<<< + * return x._abstract_linkable.AbstractLinkable + * locals()['AbstractLinkable'] = _get_linkable() + */ + __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_gevent__abstract_linkable); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 20, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple_); + __Pyx_GIVEREF(__pyx_tuple_); + + /* "src/gevent/event.py":19 + * ] + * + * def _get_linkable(): # <<<<<<<<<<<<<< + * x = __import__('gevent._abstract_linkable') + * return x._abstract_linkable.AbstractLinkable + */ + __pyx_tuple__2 = PyTuple_Pack(1, __pyx_n_s_x); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 19, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2); + __Pyx_GIVEREF(__pyx_tuple__2); + __pyx_codeobj__3 = (PyObject*)__Pyx_PyCode_New(0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_event_py, __pyx_n_s_get_linkable, 19, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__3)) __PYX_ERR(0, 19, __pyx_L1_error) + + /* "src/gevent/event.py":46 + * """ + * + * __slots__ = ('_flag',) # <<<<<<<<<<<<<< + * + * def __init__(self): + */ + __pyx_tuple__4 = PyTuple_Pack(1, __pyx_n_s_flag); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 46, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__4); + __Pyx_GIVEREF(__pyx_tuple__4); + + /* "src/gevent/event.py":56 + * self.linkcount()) + * + * def is_set(self): # <<<<<<<<<<<<<< + * """Return true if and only if the internal flag is true.""" + * return self._flag + */ + __pyx_tuple__5 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 56, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__5); + __Pyx_GIVEREF(__pyx_tuple__5); + __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__5, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_event_py, __pyx_n_s_is_set, 56, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__6)) __PYX_ERR(0, 56, __pyx_L1_error) + + /* "src/gevent/event.py":60 + * return self._flag + * + * def isSet(self): # <<<<<<<<<<<<<< + * # makes it a better drop-in replacement for threading.Event + * return self._flag + */ + __pyx_tuple__7 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 60, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__7); + __Pyx_GIVEREF(__pyx_tuple__7); + __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_event_py, __pyx_n_s_isSet, 60, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) __PYX_ERR(0, 60, __pyx_L1_error) + + /* "src/gevent/event.py":64 + * return self._flag + * + * def ready(self): # <<<<<<<<<<<<<< + * # makes it compatible with AsyncResult and Greenlet (for + * # example in wait()) + */ + __pyx_tuple__9 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 64, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__9); + __Pyx_GIVEREF(__pyx_tuple__9); + __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__9, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_event_py, __pyx_n_s_ready, 64, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__10)) __PYX_ERR(0, 64, __pyx_L1_error) + + /* "src/gevent/event.py":69 + * return self._flag + * + * def set(self): # <<<<<<<<<<<<<< + * """ + * Set the internal flag to true. + */ + __pyx_tuple__11 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 69, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__11); + __Pyx_GIVEREF(__pyx_tuple__11); + __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__11, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_event_py, __pyx_n_s_set, 69, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(0, 69, __pyx_L1_error) + + /* "src/gevent/event.py":81 + * self._check_and_notify() + * + * def clear(self): # <<<<<<<<<<<<<< + * """ + * Reset the internal flag to false. + */ + __pyx_tuple__13 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 81, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__13); + __Pyx_GIVEREF(__pyx_tuple__13); + __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__13, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_event_py, __pyx_n_s_clear, 81, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__14)) __PYX_ERR(0, 81, __pyx_L1_error) + + /* "src/gevent/event.py":102 + * return wait_success + * + * def wait(self, timeout=None): # <<<<<<<<<<<<<< + * """ + * Block until the internal flag is true. + */ + __pyx_tuple__15 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_timeout); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(0, 102, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__15); + __Pyx_GIVEREF(__pyx_tuple__15); + __pyx_codeobj__16 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__15, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_event_py, __pyx_n_s_wait, 102, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__16)) __PYX_ERR(0, 102, __pyx_L1_error) + + /* "src/gevent/event.py":129 + * return self._wait(timeout) + * + * def _reset_internal_locks(self): # pragma: no cover # <<<<<<<<<<<<<< + * # for compatibility with threading.Event + * # Exception AttributeError: AttributeError("'Event' object has no attribute '_reset_internal_locks'",) + */ + __pyx_tuple__17 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(0, 129, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__17); + __Pyx_GIVEREF(__pyx_tuple__17); + __pyx_codeobj__18 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__17, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_event_py, __pyx_n_s_reset_internal_locks, 129, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__18)) __PYX_ERR(0, 129, __pyx_L1_error) + + /* "src/gevent/event.py":186 + * """ + * + * __slots__ = ('_value', '_exc_info', '_imap_task_index') # <<<<<<<<<<<<<< + * + * def __init__(self): + */ + __pyx_tuple__19 = PyTuple_Pack(3, __pyx_n_s_value_2, __pyx_n_s_exc_info_2, __pyx_n_s_imap_task_index); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(0, 186, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__19); + __Pyx_GIVEREF(__pyx_tuple__19); + + /* "src/gevent/event.py":224 + * return result + ' _links[%s]>' % self.linkcount() + * + * def ready(self): # <<<<<<<<<<<<<< + * """Return true if and only if it holds a value or an exception""" + * return self._exc_info or self._value is not _NONE + */ + __pyx_tuple__20 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(0, 224, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__20); + __Pyx_GIVEREF(__pyx_tuple__20); + __pyx_codeobj__21 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__20, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_event_py, __pyx_n_s_ready, 224, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__21)) __PYX_ERR(0, 224, __pyx_L1_error) + + /* "src/gevent/event.py":228 + * return self._exc_info or self._value is not _NONE + * + * def successful(self): # <<<<<<<<<<<<<< + * """Return true if and only if it is ready and holds a value""" + * return self._value is not _NONE + */ + __pyx_tuple__22 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(0, 228, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__22); + __Pyx_GIVEREF(__pyx_tuple__22); + __pyx_codeobj__23 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__22, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_event_py, __pyx_n_s_successful, 228, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__23)) __PYX_ERR(0, 228, __pyx_L1_error) + + /* "src/gevent/event.py":239 + * return self._exc_info[1] + * + * def set(self, value=None): # <<<<<<<<<<<<<< + * """Store the value and wake up any waiters. + * + */ + __pyx_tuple__24 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_value); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(0, 239, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__24); + __Pyx_GIVEREF(__pyx_tuple__24); + __pyx_codeobj__25 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__24, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_event_py, __pyx_n_s_set, 239, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__25)) __PYX_ERR(0, 239, __pyx_L1_error) + + /* "src/gevent/event.py":248 + * self._check_and_notify() + * + * def set_exception(self, exception, exc_info=None): # <<<<<<<<<<<<<< + * """Store the exception and wake up any waiters. + * + */ + __pyx_tuple__26 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_exception_2, __pyx_n_s_exc_info); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(0, 248, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__26); + __Pyx_GIVEREF(__pyx_tuple__26); + __pyx_codeobj__27 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__26, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_event_py, __pyx_n_s_set_exception, 248, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__27)) __PYX_ERR(0, 248, __pyx_L1_error) + + /* "src/gevent/event.py":265 + * self._check_and_notify() + * + * def _raise_exception(self): # <<<<<<<<<<<<<< + * reraise(*self.exc_info) + * + */ + __pyx_tuple__28 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(0, 265, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__28); + __Pyx_GIVEREF(__pyx_tuple__28); + __pyx_codeobj__29 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__28, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_event_py, __pyx_n_s_raise_exception, 265, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__29)) __PYX_ERR(0, 265, __pyx_L1_error) + + /* "src/gevent/event.py":268 + * reraise(*self.exc_info) + * + * def get(self, block=True, timeout=None): # <<<<<<<<<<<<<< + * """Return the stored value or raise the exception. + * + */ + __pyx_tuple__30 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_block, __pyx_n_s_timeout); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(0, 268, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__30); + __Pyx_GIVEREF(__pyx_tuple__30); + __pyx_codeobj__31 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__30, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_event_py, __pyx_n_s_get, 268, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__31)) __PYX_ERR(0, 268, __pyx_L1_error) + + /* "src/gevent/event.py":298 + * return self.get(block=False) + * + * def get_nowait(self): # <<<<<<<<<<<<<< + * """ + * Return the value or raise the exception without blocking. + */ + __pyx_tuple__32 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(0, 298, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__32); + __Pyx_GIVEREF(__pyx_tuple__32); + __pyx_codeobj__33 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__32, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_event_py, __pyx_n_s_get_nowait, 298, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__33)) __PYX_ERR(0, 298, __pyx_L1_error) + + /* "src/gevent/event.py":313 + * return self.value + * + * def wait(self, timeout=None): # <<<<<<<<<<<<<< + * """Block until the instance is ready. + * + */ + __pyx_tuple__34 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_timeout); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(0, 313, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__34); + __Pyx_GIVEREF(__pyx_tuple__34); + __pyx_codeobj__35 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__34, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_event_py, __pyx_n_s_wait, 313, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__35)) __PYX_ERR(0, 313, __pyx_L1_error) + + /* "src/gevent/event.py":343 + * # Methods to make us more like concurrent.futures.Future + * + * def result(self, timeout=None): # <<<<<<<<<<<<<< + * return self.get(timeout=timeout) + * + */ + __pyx_tuple__36 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_timeout); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(0, 343, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__36); + __Pyx_GIVEREF(__pyx_tuple__36); + __pyx_codeobj__37 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__36, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_event_py, __pyx_n_s_result, 343, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__37)) __PYX_ERR(0, 343, __pyx_L1_error) + + /* "src/gevent/event.py":348 + * set_result = set + * + * def done(self): # <<<<<<<<<<<<<< + * return self.ready() + * + */ + __pyx_tuple__38 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(0, 348, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__38); + __Pyx_GIVEREF(__pyx_tuple__38); + __pyx_codeobj__39 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__38, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_event_py, __pyx_n_s_done, 348, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__39)) __PYX_ERR(0, 348, __pyx_L1_error) + + /* "src/gevent/event.py":353 + * # we don't support cancelling + * + * def cancel(self): # <<<<<<<<<<<<<< + * return False + * + */ + __pyx_tuple__40 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__40)) __PYX_ERR(0, 353, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__40); + __Pyx_GIVEREF(__pyx_tuple__40); + __pyx_codeobj__41 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_event_py, __pyx_n_s_cancel, 353, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__41)) __PYX_ERR(0, 353, __pyx_L1_error) + + /* "src/gevent/event.py":356 + * return False + * + * def cancelled(self): # <<<<<<<<<<<<<< + * return False + * + */ + __pyx_tuple__42 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(0, 356, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__42); + __Pyx_GIVEREF(__pyx_tuple__42); + __pyx_codeobj__43 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__42, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_event_py, __pyx_n_s_cancelled, 356, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__43)) __PYX_ERR(0, 356, __pyx_L1_error) + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} + +static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { + if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + return 0; + __pyx_L1_error:; + return -1; +} + +static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/ + +static int __Pyx_modinit_global_init_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); + /*--- Global init code ---*/ + __pyx_v_6gevent_6_event__None = Py_None; Py_INCREF(Py_None); + __pyx_v_6gevent_6_event_reraise = Py_None; Py_INCREF(Py_None); + __pyx_v_6gevent_6_event_dump_traceback = Py_None; Py_INCREF(Py_None); + __pyx_v_6gevent_6_event_load_traceback = Py_None; Py_INCREF(Py_None); + __pyx_v_6gevent_6_event_Timeout = Py_None; Py_INCREF(Py_None); + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_variable_export_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); + /*--- Variable export code ---*/ + if (__Pyx_ExportVoidPtr(__pyx_n_s_None, (void *)&__pyx_v_6gevent_6_event__None, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportVoidPtr(__pyx_n_s_reraise, (void *)&__pyx_v_6gevent_6_event_reraise, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportVoidPtr(__pyx_n_s_dump_traceback, (void *)&__pyx_v_6gevent_6_event_dump_traceback, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportVoidPtr(__pyx_n_s_load_traceback, (void *)&__pyx_v_6gevent_6_event_load_traceback, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportVoidPtr(__pyx_n_s_Timeout, (void *)&__pyx_v_6gevent_6_event_Timeout, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_modinit_function_export_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); + /*--- Function export code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_type_init_code(void) { + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); + /*--- Type init code ---*/ + __pyx_t_1 = PyImport_ImportModule("gevent.__abstract_linkable"); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_ptype_6gevent_19__abstract_linkable_AbstractLinkable = __Pyx_ImportType(__pyx_t_1, "gevent.__abstract_linkable", "AbstractLinkable", sizeof(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_19__abstract_linkable_AbstractLinkable) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_vtabptr_6gevent_19__abstract_linkable_AbstractLinkable = (struct __pyx_vtabstruct_6gevent_19__abstract_linkable_AbstractLinkable*)__Pyx_GetVtable(__pyx_ptype_6gevent_19__abstract_linkable_AbstractLinkable->tp_dict); if (unlikely(!__pyx_vtabptr_6gevent_19__abstract_linkable_AbstractLinkable)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_vtabptr_6gevent_6_event_Event = &__pyx_vtable_6gevent_6_event_Event; + __pyx_vtable_6gevent_6_event_Event.__pyx_base = *__pyx_vtabptr_6gevent_19__abstract_linkable_AbstractLinkable; + __pyx_vtable_6gevent_6_event_Event.__pyx_base.ready = (int (*)(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *, int __pyx_skip_dispatch))__pyx_f_6gevent_6_event_5Event_ready; + __pyx_vtable_6gevent_6_event_Event.__pyx_base._wait_return_value = (PyObject *(*)(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *, PyObject *, PyObject *))__pyx_f_6gevent_6_event_5Event__wait_return_value; + __pyx_type_6gevent_6_event_Event.tp_base = __pyx_ptype_6gevent_19__abstract_linkable_AbstractLinkable; + if (PyType_Ready(&__pyx_type_6gevent_6_event_Event) < 0) __PYX_ERR(0, 30, __pyx_L1_error) + __pyx_type_6gevent_6_event_Event.tp_print = 0; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6gevent_6_event_Event.tp_dictoffset && __pyx_type_6gevent_6_event_Event.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_type_6gevent_6_event_Event.tp_getattro = __Pyx_PyObject_GenericGetAttr; + } + if (__Pyx_SetVtable(__pyx_type_6gevent_6_event_Event.tp_dict, __pyx_vtabptr_6gevent_6_event_Event) < 0) __PYX_ERR(0, 30, __pyx_L1_error) + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Event, (PyObject *)&__pyx_type_6gevent_6_event_Event) < 0) __PYX_ERR(0, 30, __pyx_L1_error) + if (__pyx_type_6gevent_6_event_Event.tp_weaklistoffset == 0) __pyx_type_6gevent_6_event_Event.tp_weaklistoffset = offsetof(struct __pyx_obj_6gevent_6_event_Event, __pyx_base.__weakref__); + __pyx_ptype_6gevent_6_event_Event = &__pyx_type_6gevent_6_event_Event; + __pyx_vtabptr_6gevent_6_event_AsyncResult = &__pyx_vtable_6gevent_6_event_AsyncResult; + __pyx_vtable_6gevent_6_event_AsyncResult.__pyx_base = *__pyx_vtabptr_6gevent_19__abstract_linkable_AbstractLinkable; + __pyx_vtable_6gevent_6_event_AsyncResult.__pyx_base.ready = (int (*)(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *, int __pyx_skip_dispatch))__pyx_f_6gevent_6_event_11AsyncResult_ready; + __pyx_vtable_6gevent_6_event_AsyncResult.__pyx_base._wait_return_value = (PyObject *(*)(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *, PyObject *, PyObject *))__pyx_f_6gevent_6_event_11AsyncResult__wait_return_value; + __pyx_vtable_6gevent_6_event_AsyncResult.get = (PyObject *(*)(struct __pyx_obj_6gevent_6_event_AsyncResult *, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_6_event_11AsyncResult_get *__pyx_optional_args))__pyx_f_6gevent_6_event_11AsyncResult_get; + __pyx_vtable_6gevent_6_event_AsyncResult.successful = (int (*)(struct __pyx_obj_6gevent_6_event_AsyncResult *, int __pyx_skip_dispatch))__pyx_f_6gevent_6_event_11AsyncResult_successful; + __pyx_vtable_6gevent_6_event_AsyncResult.wait = (PyObject *(*)(struct __pyx_obj_6gevent_6_event_AsyncResult *, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_6_event_11AsyncResult_wait *__pyx_optional_args))__pyx_f_6gevent_6_event_11AsyncResult_wait; + __pyx_vtable_6gevent_6_event_AsyncResult.done = (int (*)(struct __pyx_obj_6gevent_6_event_AsyncResult *, int __pyx_skip_dispatch))__pyx_f_6gevent_6_event_11AsyncResult_done; + __pyx_vtable_6gevent_6_event_AsyncResult.cancel = (int (*)(struct __pyx_obj_6gevent_6_event_AsyncResult *, int __pyx_skip_dispatch))__pyx_f_6gevent_6_event_11AsyncResult_cancel; + __pyx_vtable_6gevent_6_event_AsyncResult.cancelled = (int (*)(struct __pyx_obj_6gevent_6_event_AsyncResult *, int __pyx_skip_dispatch))__pyx_f_6gevent_6_event_11AsyncResult_cancelled; + __pyx_type_6gevent_6_event_AsyncResult.tp_base = __pyx_ptype_6gevent_19__abstract_linkable_AbstractLinkable; + if (PyType_Ready(&__pyx_type_6gevent_6_event_AsyncResult) < 0) __PYX_ERR(0, 136, __pyx_L1_error) + __pyx_type_6gevent_6_event_AsyncResult.tp_print = 0; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6gevent_6_event_AsyncResult.tp_dictoffset && __pyx_type_6gevent_6_event_AsyncResult.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_type_6gevent_6_event_AsyncResult.tp_getattro = __Pyx_PyObject_GenericGetAttr; + } + if (__Pyx_SetVtable(__pyx_type_6gevent_6_event_AsyncResult.tp_dict, __pyx_vtabptr_6gevent_6_event_AsyncResult) < 0) __PYX_ERR(0, 136, __pyx_L1_error) + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_AsyncResult, (PyObject *)&__pyx_type_6gevent_6_event_AsyncResult) < 0) __PYX_ERR(0, 136, __pyx_L1_error) + if (__pyx_type_6gevent_6_event_AsyncResult.tp_weaklistoffset == 0) __pyx_type_6gevent_6_event_AsyncResult.tp_weaklistoffset = offsetof(struct __pyx_obj_6gevent_6_event_AsyncResult, __pyx_base.__weakref__); + __pyx_ptype_6gevent_6_event_AsyncResult = &__pyx_type_6gevent_6_event_AsyncResult; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_modinit_type_import_code(void) { + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); + /*--- Type import code ---*/ + __pyx_t_1 = PyImport_ImportModule("greenlet"); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_ptype_6gevent_21__greenlet_primitives_greenlet = __Pyx_ImportType(__pyx_t_1, "greenlet", "greenlet", sizeof(PyGreenlet), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_21__greenlet_primitives_greenlet) __PYX_ERR(2, 12, __pyx_L1_error) + __pyx_t_2 = PyImport_ImportModule("gevent.__greenlet_primitives"); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 37, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_ptype_6gevent_21__greenlet_primitives_TrackedRawGreenlet = __Pyx_ImportType(__pyx_t_2, "gevent.__greenlet_primitives", "TrackedRawGreenlet", sizeof(struct __pyx_obj_6gevent_21__greenlet_primitives_TrackedRawGreenlet), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_21__greenlet_primitives_TrackedRawGreenlet) __PYX_ERR(2, 37, __pyx_L1_error) + __pyx_ptype_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop = __Pyx_ImportType(__pyx_t_2, "gevent.__greenlet_primitives", "SwitchOutGreenletWithLoop", sizeof(struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop) __PYX_ERR(2, 40, __pyx_L1_error) + __pyx_vtabptr_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop = (struct __pyx_vtabstruct_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop*)__Pyx_GetVtable(__pyx_ptype_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop->tp_dict); if (unlikely(!__pyx_vtabptr_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop)) __PYX_ERR(2, 40, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyImport_ImportModule("greenlet"); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_ptype_6gevent_19__abstract_linkable_greenlet = __Pyx_ImportType(__pyx_t_2, "greenlet", "greenlet", sizeof(PyGreenlet), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_19__abstract_linkable_greenlet) __PYX_ERR(3, 12, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_modinit_variable_import_code(void) { + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); + /*--- Variable import code ---*/ + __pyx_t_1 = PyImport_ImportModule("gevent.__greenlet_primitives"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_1, "get_objects", (void **)&__pyx_vp_6gevent_21__greenlet_primitives_get_objects, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_1, "wref", (void **)&__pyx_vp_6gevent_21__greenlet_primitives_wref, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_1, "BlockingSwitchOutError", (void **)&__pyx_vp_6gevent_21__greenlet_primitives_BlockingSwitchOutError, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_1, "_greenlet_imported", (void **)&__pyx_vp_6gevent_21__greenlet_primitives__greenlet_imported, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + Py_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_2 = PyImport_ImportModule("gevent.__hub_local"); if (!__pyx_t_2) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_2, "_threadlocal", (void **)&__pyx_vp_6gevent_11__hub_local__threadlocal, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + Py_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_3 = PyImport_ImportModule("gevent.__abstract_linkable"); if (!__pyx_t_3) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_3, "InvalidSwitchError", (void **)&__pyx_vp_6gevent_19__abstract_linkable_InvalidSwitchError, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_3, "Timeout", (void **)&__pyx_vp_6gevent_19__abstract_linkable_Timeout, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_3, "_greenlet_imported", (void **)&__pyx_vp_6gevent_19__abstract_linkable__greenlet_imported, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + Py_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_modinit_function_import_code(void) { + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); + /*--- Function import code ---*/ + __pyx_t_1 = PyImport_ImportModule("gevent.__hub_local"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportFunction(__pyx_t_1, "get_hub_noargs", (void (**)(void))&__pyx_f_6gevent_11__hub_local_get_hub_noargs, "struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *(int __pyx_skip_dispatch)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + Py_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_RefNannyFinishContext(); + return -1; +} + + +#if PY_MAJOR_VERSION < 3 +#ifdef CYTHON_NO_PYINIT_EXPORT +#define __Pyx_PyMODINIT_FUNC void +#else +#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC +#endif +#else +#ifdef CYTHON_NO_PYINIT_EXPORT +#define __Pyx_PyMODINIT_FUNC PyObject * +#else +#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC +#endif +#endif + + +#if PY_MAJOR_VERSION < 3 +__Pyx_PyMODINIT_FUNC init_event(void) CYTHON_SMALL_CODE; /*proto*/ +__Pyx_PyMODINIT_FUNC init_event(void) +#else +__Pyx_PyMODINIT_FUNC PyInit__event(void) CYTHON_SMALL_CODE; /*proto*/ +__Pyx_PyMODINIT_FUNC PyInit__event(void) +#if CYTHON_PEP489_MULTI_PHASE_INIT +{ + return PyModuleDef_Init(&__pyx_moduledef); +} +static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { + #if PY_VERSION_HEX >= 0x030700A1 + static PY_INT64_T main_interpreter_id = -1; + PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); + if (main_interpreter_id == -1) { + main_interpreter_id = current_id; + return (unlikely(current_id == -1)) ? -1 : 0; + } else if (unlikely(main_interpreter_id != current_id)) + #else + static PyInterpreterState *main_interpreter = NULL; + PyInterpreterState *current_interpreter = PyThreadState_Get()->interp; + if (!main_interpreter) { + main_interpreter = current_interpreter; + } else if (unlikely(main_interpreter != current_interpreter)) + #endif + { + PyErr_SetString( + PyExc_ImportError, + "Interpreter change detected - this module can only be loaded into one interpreter per process."); + return -1; + } + return 0; +} +static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) { + PyObject *value = PyObject_GetAttrString(spec, from_name); + int result = 0; + if (likely(value)) { + if (allow_none || value != Py_None) { + result = PyDict_SetItemString(moddict, to_name, value); + } + Py_DECREF(value); + } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_Clear(); + } else { + result = -1; + } + return result; +} +static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) { + PyObject *module = NULL, *moddict, *modname; + if (__Pyx_check_single_interpreter()) + return NULL; + if (__pyx_m) + return __Pyx_NewRef(__pyx_m); + modname = PyObject_GetAttrString(spec, "name"); + if (unlikely(!modname)) goto bad; + module = PyModule_NewObject(modname); + Py_DECREF(modname); + if (unlikely(!module)) goto bad; + moddict = PyModule_GetDict(module); + if (unlikely(!moddict)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad; + return module; +bad: + Py_XDECREF(module); + return NULL; +} + + +static CYTHON_SMALL_CODE int __pyx_pymod_exec__event(PyObject *__pyx_pyinit_module) +#endif +#endif +{ + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannyDeclarations + #if CYTHON_PEP489_MULTI_PHASE_INIT + if (__pyx_m) { + if (__pyx_m == __pyx_pyinit_module) return 0; + PyErr_SetString(PyExc_RuntimeError, "Module '_event' has already been imported. Re-initialisation is not supported."); + return -1; + } + #elif PY_MAJOR_VERSION >= 3 + if (__pyx_m) return __Pyx_NewRef(__pyx_m); + #endif + #if CYTHON_REFNANNY +__Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); +if (!__Pyx_RefNanny) { + PyErr_Clear(); + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); + if (!__Pyx_RefNanny) + Py_FatalError("failed to import 'refnanny' module"); +} +#endif + __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit__event(void)", 0); + if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #ifdef __Pxy_PyFrame_Initialize_Offsets + __Pxy_PyFrame_Initialize_Offsets(); + #endif + __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) + #ifdef __Pyx_CyFunction_USED + if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_FusedFunction_USED + if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_Coroutine_USED + if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_Generator_USED + if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_AsyncGen_USED + if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_StopAsyncIteration_USED + if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + /*--- Library function declarations ---*/ + /*--- Threads initialization code ---*/ + #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS + #ifdef WITH_THREAD /* Python build with threading support? */ + PyEval_InitThreads(); + #endif + #endif + /*--- Module creation code ---*/ + #if CYTHON_PEP489_MULTI_PHASE_INIT + __pyx_m = __pyx_pyinit_module; + Py_INCREF(__pyx_m); + #else + #if PY_MAJOR_VERSION < 3 + __pyx_m = Py_InitModule4("_event", __pyx_methods, __pyx_k_Basic_synchronization_primitives, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); + #else + __pyx_m = PyModule_Create(&__pyx_moduledef); + #endif + if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) + Py_INCREF(__pyx_d); + __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) + #if CYTHON_COMPILING_IN_PYPY + Py_INCREF(__pyx_b); + #endif + if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + /*--- Initialize various global constants etc. ---*/ + if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) + if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + if (__pyx_module_is_main_gevent___event) { + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + } + #if PY_MAJOR_VERSION >= 3 + { + PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) + if (!PyDict_GetItemString(modules, "gevent._event")) { + if (unlikely(PyDict_SetItemString(modules, "gevent._event", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error) + } + } + #endif + /*--- Builtin init code ---*/ + if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + /*--- Constants init code ---*/ + if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + /*--- Global type/function init code ---*/ + (void)__Pyx_modinit_global_init_code(); + if (unlikely(__Pyx_modinit_variable_export_code() != 0)) goto __pyx_L1_error; + (void)__Pyx_modinit_function_export_code(); + if (unlikely(__Pyx_modinit_type_init_code() != 0)) goto __pyx_L1_error; + if (unlikely(__Pyx_modinit_type_import_code() != 0)) goto __pyx_L1_error; + if (unlikely(__Pyx_modinit_variable_import_code() != 0)) goto __pyx_L1_error; + if (unlikely(__Pyx_modinit_function_import_code() != 0)) goto __pyx_L1_error; + /*--- Execution code ---*/ + #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) + if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + + /* "src/gevent/event.py":7 + * from __future__ import print_function + * + * from gevent._util import _NONE # <<<<<<<<<<<<<< + * from gevent._compat import reraise + * from gevent._tblib import dump_traceback, load_traceback + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_NONE); + __Pyx_GIVEREF(__pyx_n_s_NONE); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_NONE); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_gevent__util, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_NONE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_NONE, __pyx_t_1) < 0) __PYX_ERR(0, 7, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/event.py":8 + * + * from gevent._util import _NONE + * from gevent._compat import reraise # <<<<<<<<<<<<<< + * from gevent._tblib import dump_traceback, load_traceback + * + */ + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_reraise); + __Pyx_GIVEREF(__pyx_n_s_reraise); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_reraise); + __pyx_t_1 = __Pyx_Import(__pyx_n_s_gevent__compat, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 8, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_reraise); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_v_6gevent_6_event_reraise); + __Pyx_DECREF_SET(__pyx_v_6gevent_6_event_reraise, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/event.py":9 + * from gevent._util import _NONE + * from gevent._compat import reraise + * from gevent._tblib import dump_traceback, load_traceback # <<<<<<<<<<<<<< + * + * from gevent.timeout import Timeout + */ + __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 9, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_dump_traceback); + __Pyx_GIVEREF(__pyx_n_s_dump_traceback); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_dump_traceback); + __Pyx_INCREF(__pyx_n_s_load_traceback); + __Pyx_GIVEREF(__pyx_n_s_load_traceback); + PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_load_traceback); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_gevent__tblib, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_dump_traceback); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 9, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_v_6gevent_6_event_dump_traceback); + __Pyx_DECREF_SET(__pyx_v_6gevent_6_event_dump_traceback, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_load_traceback); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 9, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_v_6gevent_6_event_load_traceback); + __Pyx_DECREF_SET(__pyx_v_6gevent_6_event_load_traceback, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/event.py":11 + * from gevent._tblib import dump_traceback, load_traceback + * + * from gevent.timeout import Timeout # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 11, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_Timeout); + __Pyx_GIVEREF(__pyx_n_s_Timeout); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_Timeout); + __pyx_t_1 = __Pyx_Import(__pyx_n_s_gevent_timeout, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 11, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_Timeout); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 11, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_v_6gevent_6_event_Timeout); + __Pyx_DECREF_SET(__pyx_v_6gevent_6_event_Timeout, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/event.py":14 + * + * + * __all__ = [ # <<<<<<<<<<<<<< + * 'Event', + * 'AsyncResult', + */ + __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 14, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_Event); + __Pyx_GIVEREF(__pyx_n_s_Event); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_Event); + __Pyx_INCREF(__pyx_n_s_AsyncResult); + __Pyx_GIVEREF(__pyx_n_s_AsyncResult); + PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_AsyncResult); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_all, __pyx_t_1) < 0) __PYX_ERR(0, 14, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/event.py":19 + * ] + * + * def _get_linkable(): # <<<<<<<<<<<<<< + * x = __import__('gevent._abstract_linkable') + * return x._abstract_linkable.AbstractLinkable + */ + __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_event_1_get_linkable, 0, __pyx_n_s_get_linkable, NULL, __pyx_n_s_gevent__event, __pyx_d, ((PyObject *)__pyx_codeobj__3)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 19, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_linkable, __pyx_t_1) < 0) __PYX_ERR(0, 19, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/event.py":22 + * x = __import__('gevent._abstract_linkable') + * return x._abstract_linkable.AbstractLinkable + * locals()['AbstractLinkable'] = _get_linkable() # <<<<<<<<<<<<<< + * del _get_linkable + * + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_get_linkable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 22, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 22, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_Globals(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 22, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (unlikely(PyDict_SetItem(__pyx_t_1, __pyx_n_s_AbstractLinkable, __pyx_t_2) < 0)) __PYX_ERR(0, 22, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/event.py":23 + * return x._abstract_linkable.AbstractLinkable + * locals()['AbstractLinkable'] = _get_linkable() + * del _get_linkable # <<<<<<<<<<<<<< + * + * # Sadly, something about the way we have to "import" AbstractLinkable + */ + if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_get_linkable) < 0) __PYX_ERR(0, 23, __pyx_L1_error) + + /* "src/gevent/event.py":46 + * """ + * + * __slots__ = ('_flag',) # <<<<<<<<<<<<<< + * + * def __init__(self): + */ + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_event_Event->tp_dict, __pyx_n_s_slots, __pyx_tuple__4) < 0) __PYX_ERR(0, 46, __pyx_L1_error) + PyType_Modified(__pyx_ptype_6gevent_6_event_Event); + + /* "src/gevent/event.py":56 + * self.linkcount()) + * + * def is_set(self): # <<<<<<<<<<<<<< + * """Return true if and only if the internal flag is true.""" + * return self._flag + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_event_5Event_5is_set, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Event_is_set, NULL, __pyx_n_s_gevent__event, __pyx_d, ((PyObject *)__pyx_codeobj__6)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 56, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_event_Event->tp_dict, __pyx_n_s_is_set, __pyx_t_2) < 0) __PYX_ERR(0, 56, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_6_event_Event); + + /* "src/gevent/event.py":60 + * return self._flag + * + * def isSet(self): # <<<<<<<<<<<<<< + * # makes it a better drop-in replacement for threading.Event + * return self._flag + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_event_5Event_7isSet, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Event_isSet, NULL, __pyx_n_s_gevent__event, __pyx_d, ((PyObject *)__pyx_codeobj__8)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 60, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_event_Event->tp_dict, __pyx_n_s_isSet, __pyx_t_2) < 0) __PYX_ERR(0, 60, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_6_event_Event); + + /* "src/gevent/event.py":64 + * return self._flag + * + * def ready(self): # <<<<<<<<<<<<<< + * # makes it compatible with AsyncResult and Greenlet (for + * # example in wait()) + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_event_5Event_9ready, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Event_ready, NULL, __pyx_n_s_gevent__event, __pyx_d, ((PyObject *)__pyx_codeobj__10)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 64, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_event_Event->tp_dict, __pyx_n_s_ready, __pyx_t_2) < 0) __PYX_ERR(0, 64, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_6_event_Event); + + /* "src/gevent/event.py":69 + * return self._flag + * + * def set(self): # <<<<<<<<<<<<<< + * """ + * Set the internal flag to true. + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_event_5Event_11set, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Event_set, NULL, __pyx_n_s_gevent__event, __pyx_d, ((PyObject *)__pyx_codeobj__12)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 69, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_event_Event->tp_dict, __pyx_n_s_set, __pyx_t_2) < 0) __PYX_ERR(0, 69, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_6_event_Event); + + /* "src/gevent/event.py":81 + * self._check_and_notify() + * + * def clear(self): # <<<<<<<<<<<<<< + * """ + * Reset the internal flag to false. + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_event_5Event_13clear, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Event_clear, NULL, __pyx_n_s_gevent__event, __pyx_d, ((PyObject *)__pyx_codeobj__14)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 81, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_event_Event->tp_dict, __pyx_n_s_clear, __pyx_t_2) < 0) __PYX_ERR(0, 81, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_6_event_Event); + + /* "src/gevent/event.py":102 + * return wait_success + * + * def wait(self, timeout=None): # <<<<<<<<<<<<<< + * """ + * Block until the internal flag is true. + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_event_5Event_15wait, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Event_wait, NULL, __pyx_n_s_gevent__event, __pyx_d, ((PyObject *)__pyx_codeobj__16)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 102, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_event_Event->tp_dict, __pyx_n_s_wait, __pyx_t_2) < 0) __PYX_ERR(0, 102, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_6_event_Event); + + /* "src/gevent/event.py":129 + * return self._wait(timeout) + * + * def _reset_internal_locks(self): # pragma: no cover # <<<<<<<<<<<<<< + * # for compatibility with threading.Event + * # Exception AttributeError: AttributeError("'Event' object has no attribute '_reset_internal_locks'",) + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_event_5Event_17_reset_internal_locks, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Event__reset_internal_locks, NULL, __pyx_n_s_gevent__event, __pyx_d, ((PyObject *)__pyx_codeobj__18)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 129, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_event_Event->tp_dict, __pyx_n_s_reset_internal_locks, __pyx_t_2) < 0) __PYX_ERR(0, 129, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_6_event_Event); + + /* "src/gevent/event.py":186 + * """ + * + * __slots__ = ('_value', '_exc_info', '_imap_task_index') # <<<<<<<<<<<<<< + * + * def __init__(self): + */ + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_event_AsyncResult->tp_dict, __pyx_n_s_slots, __pyx_tuple__19) < 0) __PYX_ERR(0, 186, __pyx_L1_error) + PyType_Modified(__pyx_ptype_6gevent_6_event_AsyncResult); + + /* "src/gevent/event.py":224 + * return result + ' _links[%s]>' % self.linkcount() + * + * def ready(self): # <<<<<<<<<<<<<< + * """Return true if and only if it holds a value or an exception""" + * return self._exc_info or self._value is not _NONE + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_event_11AsyncResult_5ready, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AsyncResult_ready, NULL, __pyx_n_s_gevent__event, __pyx_d, ((PyObject *)__pyx_codeobj__21)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 224, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_event_AsyncResult->tp_dict, __pyx_n_s_ready, __pyx_t_2) < 0) __PYX_ERR(0, 224, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_6_event_AsyncResult); + + /* "src/gevent/event.py":228 + * return self._exc_info or self._value is not _NONE + * + * def successful(self): # <<<<<<<<<<<<<< + * """Return true if and only if it is ready and holds a value""" + * return self._value is not _NONE + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_event_11AsyncResult_7successful, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AsyncResult_successful, NULL, __pyx_n_s_gevent__event, __pyx_d, ((PyObject *)__pyx_codeobj__23)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 228, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_event_AsyncResult->tp_dict, __pyx_n_s_successful, __pyx_t_2) < 0) __PYX_ERR(0, 228, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_6_event_AsyncResult); + + /* "src/gevent/event.py":239 + * return self._exc_info[1] + * + * def set(self, value=None): # <<<<<<<<<<<<<< + * """Store the value and wake up any waiters. + * + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_event_11AsyncResult_9set, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AsyncResult_set, NULL, __pyx_n_s_gevent__event, __pyx_d, ((PyObject *)__pyx_codeobj__25)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 239, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_event_AsyncResult->tp_dict, __pyx_n_s_set, __pyx_t_2) < 0) __PYX_ERR(0, 239, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_6_event_AsyncResult); + + /* "src/gevent/event.py":248 + * self._check_and_notify() + * + * def set_exception(self, exception, exc_info=None): # <<<<<<<<<<<<<< + * """Store the exception and wake up any waiters. + * + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_event_11AsyncResult_11set_exception, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AsyncResult_set_exception, NULL, __pyx_n_s_gevent__event, __pyx_d, ((PyObject *)__pyx_codeobj__27)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 248, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_event_AsyncResult->tp_dict, __pyx_n_s_set_exception, __pyx_t_2) < 0) __PYX_ERR(0, 248, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_6_event_AsyncResult); + + /* "src/gevent/event.py":265 + * self._check_and_notify() + * + * def _raise_exception(self): # <<<<<<<<<<<<<< + * reraise(*self.exc_info) + * + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_event_11AsyncResult_13_raise_exception, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AsyncResult__raise_exception, NULL, __pyx_n_s_gevent__event, __pyx_d, ((PyObject *)__pyx_codeobj__29)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 265, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_event_AsyncResult->tp_dict, __pyx_n_s_raise_exception, __pyx_t_2) < 0) __PYX_ERR(0, 265, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_6_event_AsyncResult); + + /* "src/gevent/event.py":268 + * reraise(*self.exc_info) + * + * def get(self, block=True, timeout=None): # <<<<<<<<<<<<<< + * """Return the stored value or raise the exception. + * + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_event_11AsyncResult_15get, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AsyncResult_get, NULL, __pyx_n_s_gevent__event, __pyx_d, ((PyObject *)__pyx_codeobj__31)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 268, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_event_AsyncResult->tp_dict, __pyx_n_s_get, __pyx_t_2) < 0) __PYX_ERR(0, 268, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_6_event_AsyncResult); + + /* "src/gevent/event.py":298 + * return self.get(block=False) + * + * def get_nowait(self): # <<<<<<<<<<<<<< + * """ + * Return the value or raise the exception without blocking. + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_event_11AsyncResult_17get_nowait, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AsyncResult_get_nowait, NULL, __pyx_n_s_gevent__event, __pyx_d, ((PyObject *)__pyx_codeobj__33)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 298, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_event_AsyncResult->tp_dict, __pyx_n_s_get_nowait, __pyx_t_2) < 0) __PYX_ERR(0, 298, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_6_event_AsyncResult); + + /* "src/gevent/event.py":313 + * return self.value + * + * def wait(self, timeout=None): # <<<<<<<<<<<<<< + * """Block until the instance is ready. + * + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_event_11AsyncResult_19wait, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AsyncResult_wait, NULL, __pyx_n_s_gevent__event, __pyx_d, ((PyObject *)__pyx_codeobj__35)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 313, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_event_AsyncResult->tp_dict, __pyx_n_s_wait, __pyx_t_2) < 0) __PYX_ERR(0, 313, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_6_event_AsyncResult); + + /* "src/gevent/event.py":343 + * # Methods to make us more like concurrent.futures.Future + * + * def result(self, timeout=None): # <<<<<<<<<<<<<< + * return self.get(timeout=timeout) + * + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_event_11AsyncResult_23result, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AsyncResult_result, NULL, __pyx_n_s_gevent__event, __pyx_d, ((PyObject *)__pyx_codeobj__37)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 343, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_event_AsyncResult->tp_dict, __pyx_n_s_result, __pyx_t_2) < 0) __PYX_ERR(0, 343, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_6_event_AsyncResult); + + /* "src/gevent/event.py":346 + * return self.get(timeout=timeout) + * + * set_result = set # <<<<<<<<<<<<<< + * + * def done(self): + */ + __Pyx_GetNameInClass(__pyx_t_2, (PyObject *)__pyx_ptype_6gevent_6_event_AsyncResult, __pyx_n_s_set); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 346, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_event_AsyncResult->tp_dict, __pyx_n_s_set_result, __pyx_t_2) < 0) __PYX_ERR(0, 346, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_6_event_AsyncResult); + + /* "src/gevent/event.py":348 + * set_result = set + * + * def done(self): # <<<<<<<<<<<<<< + * return self.ready() + * + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_event_11AsyncResult_25done, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AsyncResult_done, NULL, __pyx_n_s_gevent__event, __pyx_d, ((PyObject *)__pyx_codeobj__39)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 348, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_event_AsyncResult->tp_dict, __pyx_n_s_done, __pyx_t_2) < 0) __PYX_ERR(0, 348, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_6_event_AsyncResult); + + /* "src/gevent/event.py":353 + * # we don't support cancelling + * + * def cancel(self): # <<<<<<<<<<<<<< + * return False + * + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_event_11AsyncResult_27cancel, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AsyncResult_cancel, NULL, __pyx_n_s_gevent__event, __pyx_d, ((PyObject *)__pyx_codeobj__41)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 353, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_event_AsyncResult->tp_dict, __pyx_n_s_cancel, __pyx_t_2) < 0) __PYX_ERR(0, 353, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_6_event_AsyncResult); + + /* "src/gevent/event.py":356 + * return False + * + * def cancelled(self): # <<<<<<<<<<<<<< + * return False + * + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_event_11AsyncResult_29cancelled, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AsyncResult_cancelled, NULL, __pyx_n_s_gevent__event, __pyx_d, ((PyObject *)__pyx_codeobj__43)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 356, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_event_AsyncResult->tp_dict, __pyx_n_s_cancelled, __pyx_t_2) < 0) __PYX_ERR(0, 356, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_6_event_AsyncResult); + + /* "src/gevent/event.py":362 + * + * + * from gevent._util import import_c_accel # <<<<<<<<<<<<<< + * import_c_accel(globals(), 'gevent._event') + */ + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 362, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_import_c_accel); + __Pyx_GIVEREF(__pyx_n_s_import_c_accel); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_import_c_accel); + __pyx_t_1 = __Pyx_Import(__pyx_n_s_gevent__util, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 362, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_import_c_accel); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 362, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_import_c_accel, __pyx_t_2) < 0) __PYX_ERR(0, 362, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/event.py":363 + * + * from gevent._util import import_c_accel + * import_c_accel(globals(), 'gevent._event') # <<<<<<<<<<<<<< + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_import_c_accel); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 363, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_Globals(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 363, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 363, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __Pyx_INCREF(__pyx_n_s_gevent__event); + __Pyx_GIVEREF(__pyx_n_s_gevent__event); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_n_s_gevent__event); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 363, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/event.py":1 + * # Copyright (c) 2009-2016 Denis Bilenko, gevent contributors. See LICENSE for details. # <<<<<<<<<<<<<< + * # cython: auto_pickle=False,embedsignature=True,always_allow_keywords=False,infer_types=True + * + */ + __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "gevent/__abstract_linkable.pxd":24 + * return PyGreenlet_GetCurrent() + * + * cdef inline void greenlet_init(): # <<<<<<<<<<<<<< + * global _greenlet_imported + * if not _greenlet_imported: + */ + + /*--- Wrapped vars code ---*/ + + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + if (__pyx_m) { + if (__pyx_d) { + __Pyx_AddTraceback("init gevent._event", __pyx_clineno, __pyx_lineno, __pyx_filename); + } + Py_CLEAR(__pyx_m); + } else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_ImportError, "init gevent._event"); + } + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + #if CYTHON_PEP489_MULTI_PHASE_INIT + return (__pyx_m != NULL) ? 0 : -1; + #elif PY_MAJOR_VERSION >= 3 + return __pyx_m; + #else + return; + #endif +} + +/* --- Runtime support code --- */ +/* Refnanny */ +#if CYTHON_REFNANNY +static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { + PyObject *m = NULL, *p = NULL; + void *r = NULL; + m = PyImport_ImportModule(modname); + if (!m) goto end; + p = PyObject_GetAttrString(m, "RefNannyAPI"); + if (!p) goto end; + r = PyLong_AsVoidPtr(p); +end: + Py_XDECREF(p); + Py_XDECREF(m); + return (__Pyx_RefNannyAPIStruct *)r; +} +#endif + +/* PyObjectGetAttrStr */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_getattro)) + return tp->tp_getattro(obj, attr_name); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_getattr)) + return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); +#endif + return PyObject_GetAttr(obj, attr_name); +} +#endif + +/* GetBuiltinName */ +static PyObject *__Pyx_GetBuiltinName(PyObject *name) { + PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name); + if (unlikely(!result)) { + PyErr_Format(PyExc_NameError, +#if PY_MAJOR_VERSION >= 3 + "name '%U' is not defined", name); +#else + "name '%.200s' is not defined", PyString_AS_STRING(name)); +#endif + } + return result; +} + +/* PyObjectCall */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { + PyObject *result; + ternaryfunc call = func->ob_type->tp_call; + if (unlikely(!call)) + return PyObject_Call(func, arg, kw); + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; + result = (*call)(func, arg, kw); + Py_LeaveRecursiveCall(); + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +/* RaiseArgTupleInvalid */ +static void __Pyx_RaiseArgtupleInvalid( + const char* func_name, + int exact, + Py_ssize_t num_min, + Py_ssize_t num_max, + Py_ssize_t num_found) +{ + Py_ssize_t num_expected; + const char *more_or_less; + if (num_found < num_min) { + num_expected = num_min; + more_or_less = "at least"; + } else { + num_expected = num_max; + more_or_less = "at most"; + } + if (exact) { + more_or_less = "exactly"; + } + PyErr_Format(PyExc_TypeError, + "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", + func_name, more_or_less, num_expected, + (num_expected == 1) ? "" : "s", num_found); +} + +/* KeywordStringCheck */ +static int __Pyx_CheckKeywordStrings( + PyObject *kwdict, + const char* function_name, + int kw_allowed) +{ + PyObject* key = 0; + Py_ssize_t pos = 0; +#if CYTHON_COMPILING_IN_PYPY + if (!kw_allowed && PyDict_Next(kwdict, &pos, &key, 0)) + goto invalid_keyword; + return 1; +#else + while (PyDict_Next(kwdict, &pos, &key, 0)) { + #if PY_MAJOR_VERSION < 3 + if (unlikely(!PyString_Check(key))) + #endif + if (unlikely(!PyUnicode_Check(key))) + goto invalid_keyword_type; + } + if ((!kw_allowed) && unlikely(key)) + goto invalid_keyword; + return 1; +invalid_keyword_type: + PyErr_Format(PyExc_TypeError, + "%.200s() keywords must be strings", function_name); + return 0; +#endif +invalid_keyword: + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION < 3 + "%.200s() got an unexpected keyword argument '%.200s'", + function_name, PyString_AsString(key)); + #else + "%s() got an unexpected keyword argument '%U'", + function_name, key); + #endif + return 0; +} + +/* PyFunctionFastCall */ +#if CYTHON_FAST_PYCALL +static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, + PyObject *globals) { + PyFrameObject *f; + PyThreadState *tstate = __Pyx_PyThreadState_Current; + PyObject **fastlocals; + Py_ssize_t i; + PyObject *result; + assert(globals != NULL); + /* XXX Perhaps we should create a specialized + PyFrame_New() that doesn't take locals, but does + take builtins without sanity checking them. + */ + assert(tstate != NULL); + f = PyFrame_New(tstate, co, globals, NULL); + if (f == NULL) { + return NULL; + } + fastlocals = __Pyx_PyFrame_GetLocalsplus(f); + for (i = 0; i < na; i++) { + Py_INCREF(*args); + fastlocals[i] = *args++; + } + result = PyEval_EvalFrameEx(f,0); + ++tstate->recursion_depth; + Py_DECREF(f); + --tstate->recursion_depth; + return result; +} +#if 1 || PY_VERSION_HEX < 0x030600B1 +static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs) { + PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); + PyObject *globals = PyFunction_GET_GLOBALS(func); + PyObject *argdefs = PyFunction_GET_DEFAULTS(func); + PyObject *closure; +#if PY_MAJOR_VERSION >= 3 + PyObject *kwdefs; +#endif + PyObject *kwtuple, **k; + PyObject **d; + Py_ssize_t nd; + Py_ssize_t nk; + PyObject *result; + assert(kwargs == NULL || PyDict_Check(kwargs)); + nk = kwargs ? PyDict_Size(kwargs) : 0; + if (Py_EnterRecursiveCall((char*)" while calling a Python object")) { + return NULL; + } + if ( +#if PY_MAJOR_VERSION >= 3 + co->co_kwonlyargcount == 0 && +#endif + likely(kwargs == NULL || nk == 0) && + co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { + if (argdefs == NULL && co->co_argcount == nargs) { + result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); + goto done; + } + else if (nargs == 0 && argdefs != NULL + && co->co_argcount == Py_SIZE(argdefs)) { + /* function called with no arguments, but all parameters have + a default value: use default values as arguments .*/ + args = &PyTuple_GET_ITEM(argdefs, 0); + result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); + goto done; + } + } + if (kwargs != NULL) { + Py_ssize_t pos, i; + kwtuple = PyTuple_New(2 * nk); + if (kwtuple == NULL) { + result = NULL; + goto done; + } + k = &PyTuple_GET_ITEM(kwtuple, 0); + pos = i = 0; + while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { + Py_INCREF(k[i]); + Py_INCREF(k[i+1]); + i += 2; + } + nk = i / 2; + } + else { + kwtuple = NULL; + k = NULL; + } + closure = PyFunction_GET_CLOSURE(func); +#if PY_MAJOR_VERSION >= 3 + kwdefs = PyFunction_GET_KW_DEFAULTS(func); +#endif + if (argdefs != NULL) { + d = &PyTuple_GET_ITEM(argdefs, 0); + nd = Py_SIZE(argdefs); + } + else { + d = NULL; + nd = 0; + } +#if PY_MAJOR_VERSION >= 3 + result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, + args, nargs, + k, (int)nk, + d, (int)nd, kwdefs, closure); +#else + result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, + args, nargs, + k, (int)nk, + d, (int)nd, closure); +#endif + Py_XDECREF(kwtuple); +done: + Py_LeaveRecursiveCall(); + return result; +} +#endif +#endif + +/* PyObjectCallMethO */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { + PyObject *self, *result; + PyCFunction cfunc; + cfunc = PyCFunction_GET_FUNCTION(func); + self = PyCFunction_GET_SELF(func); + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; + result = cfunc(self, arg); + Py_LeaveRecursiveCall(); + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +/* PyObjectCallNoArg */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { +#if CYTHON_FAST_PYCALL + if (PyFunction_Check(func)) { + return __Pyx_PyFunction_FastCall(func, NULL, 0); + } +#endif +#ifdef __Pyx_CyFunction_USED + if (likely(PyCFunction_Check(func) || __Pyx_CyFunction_Check(func))) +#else + if (likely(PyCFunction_Check(func))) +#endif + { + if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) { + return __Pyx_PyObject_CallMethO(func, NULL); + } + } + return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL); +} +#endif + +/* PyCFunctionFastCall */ +#if CYTHON_FAST_PYCCALL +static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) { + PyCFunctionObject *func = (PyCFunctionObject*)func_obj; + PyCFunction meth = PyCFunction_GET_FUNCTION(func); + PyObject *self = PyCFunction_GET_SELF(func); + int flags = PyCFunction_GET_FLAGS(func); + assert(PyCFunction_Check(func)); + assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS))); + assert(nargs >= 0); + assert(nargs == 0 || args != NULL); + /* _PyCFunction_FastCallDict() must not be called with an exception set, + because it may clear it (directly or indirectly) and so the + caller loses its exception */ + assert(!PyErr_Occurred()); + if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) { + return (*((__Pyx_PyCFunctionFastWithKeywords)(void*)meth)) (self, args, nargs, NULL); + } else { + return (*((__Pyx_PyCFunctionFast)(void*)meth)) (self, args, nargs); + } +} +#endif + +/* PyObjectCallOneArg */ +#if CYTHON_COMPILING_IN_CPYTHON +static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) { + PyObject *result; + PyObject *args = PyTuple_New(1); + if (unlikely(!args)) return NULL; + Py_INCREF(arg); + PyTuple_SET_ITEM(args, 0, arg); + result = __Pyx_PyObject_Call(func, args, NULL); + Py_DECREF(args); + return result; +} +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { +#if CYTHON_FAST_PYCALL + if (PyFunction_Check(func)) { + return __Pyx_PyFunction_FastCall(func, &arg, 1); + } +#endif + if (likely(PyCFunction_Check(func))) { + if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) { + return __Pyx_PyObject_CallMethO(func, arg); +#if CYTHON_FAST_PYCCALL + } else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) { + return __Pyx_PyCFunction_FastCall(func, &arg, 1); +#endif + } + } + return __Pyx__PyObject_CallOneArg(func, arg); +} +#else +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { + PyObject *result; + PyObject *args = PyTuple_Pack(1, arg); + if (unlikely(!args)) return NULL; + result = __Pyx_PyObject_Call(func, args, NULL); + Py_DECREF(args); + return result; +} +#endif + +/* PyErrFetchRestore */ +#if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + tmp_type = tstate->curexc_type; + tmp_value = tstate->curexc_value; + tmp_tb = tstate->curexc_traceback; + tstate->curexc_type = type; + tstate->curexc_value = value; + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +} +static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { + *type = tstate->curexc_type; + *value = tstate->curexc_value; + *tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +} +#endif + +/* WriteUnraisableException */ +static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno, + CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename, + int full_traceback, CYTHON_UNUSED int nogil) { + PyObject *old_exc, *old_val, *old_tb; + PyObject *ctx; + __Pyx_PyThreadState_declare +#ifdef WITH_THREAD + PyGILState_STATE state; + if (nogil) + state = PyGILState_Ensure(); +#ifdef _MSC_VER + else state = (PyGILState_STATE)-1; +#endif +#endif + __Pyx_PyThreadState_assign + __Pyx_ErrFetch(&old_exc, &old_val, &old_tb); + if (full_traceback) { + Py_XINCREF(old_exc); + Py_XINCREF(old_val); + Py_XINCREF(old_tb); + __Pyx_ErrRestore(old_exc, old_val, old_tb); + PyErr_PrintEx(1); + } + #if PY_MAJOR_VERSION < 3 + ctx = PyString_FromString(name); + #else + ctx = PyUnicode_FromString(name); + #endif + __Pyx_ErrRestore(old_exc, old_val, old_tb); + if (!ctx) { + PyErr_WriteUnraisable(Py_None); + } else { + PyErr_WriteUnraisable(ctx); + Py_DECREF(ctx); + } +#ifdef WITH_THREAD + if (nogil) + PyGILState_Release(state); +#endif +} + +/* RaiseDoubleKeywords */ +static void __Pyx_RaiseDoubleKeywordsError( + const char* func_name, + PyObject* kw_name) +{ + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION >= 3 + "%s() got multiple values for keyword argument '%U'", func_name, kw_name); + #else + "%s() got multiple values for keyword argument '%s'", func_name, + PyString_AsString(kw_name)); + #endif +} + +/* ParseKeywords */ +static int __Pyx_ParseOptionalKeywords( + PyObject *kwds, + PyObject **argnames[], + PyObject *kwds2, + PyObject *values[], + Py_ssize_t num_pos_args, + const char* function_name) +{ + PyObject *key = 0, *value = 0; + Py_ssize_t pos = 0; + PyObject*** name; + PyObject*** first_kw_arg = argnames + num_pos_args; + while (PyDict_Next(kwds, &pos, &key, &value)) { + name = first_kw_arg; + while (*name && (**name != key)) name++; + if (*name) { + values[name-argnames] = value; + continue; + } + name = first_kw_arg; + #if PY_MAJOR_VERSION < 3 + if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) { + while (*name) { + if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) + && _PyString_Eq(**name, key)) { + values[name-argnames] = value; + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + if ((**argname == key) || ( + (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) + && _PyString_Eq(**argname, key))) { + goto arg_passed_twice; + } + argname++; + } + } + } else + #endif + if (likely(PyUnicode_Check(key))) { + while (*name) { + int cmp = (**name == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 : + #endif + PyUnicode_Compare(**name, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) { + values[name-argnames] = value; + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + int cmp = (**argname == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 : + #endif + PyUnicode_Compare(**argname, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) goto arg_passed_twice; + argname++; + } + } + } else + goto invalid_keyword_type; + if (kwds2) { + if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; + } else { + goto invalid_keyword; + } + } + return 0; +arg_passed_twice: + __Pyx_RaiseDoubleKeywordsError(function_name, key); + goto bad; +invalid_keyword_type: + PyErr_Format(PyExc_TypeError, + "%.200s() keywords must be strings", function_name); + goto bad; +invalid_keyword: + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION < 3 + "%.200s() got an unexpected keyword argument '%.200s'", + function_name, PyString_AsString(key)); + #else + "%s() got an unexpected keyword argument '%U'", + function_name, key); + #endif +bad: + return -1; +} + +/* GetModuleGlobalName */ +#if CYTHON_USE_DICT_VERSIONS +static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value) +#else +static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) +#endif +{ + PyObject *result; +#if !CYTHON_AVOID_BORROWED_REFS +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 + result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } else if (unlikely(PyErr_Occurred())) { + return NULL; + } +#else + result = PyDict_GetItem(__pyx_d, name); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } +#endif +#else + result = PyObject_GetItem(__pyx_d, name); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } + PyErr_Clear(); +#endif + return __Pyx_GetBuiltinName(name); +} + +/* GetItemInt */ +static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { + PyObject *r; + if (!j) return NULL; + r = PyObject_GetItem(o, j); + Py_DECREF(j); + return r; +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, + CYTHON_NCP_UNUSED int wraparound, + CYTHON_NCP_UNUSED int boundscheck) { +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + Py_ssize_t wrapped_i = i; + if (wraparound & unlikely(i < 0)) { + wrapped_i += PyList_GET_SIZE(o); + } + if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) { + PyObject *r = PyList_GET_ITEM(o, wrapped_i); + Py_INCREF(r); + return r; + } + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +#else + return PySequence_GetItem(o, i); +#endif +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, + CYTHON_NCP_UNUSED int wraparound, + CYTHON_NCP_UNUSED int boundscheck) { +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + Py_ssize_t wrapped_i = i; + if (wraparound & unlikely(i < 0)) { + wrapped_i += PyTuple_GET_SIZE(o); + } + if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) { + PyObject *r = PyTuple_GET_ITEM(o, wrapped_i); + Py_INCREF(r); + return r; + } + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +#else + return PySequence_GetItem(o, i); +#endif +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, + CYTHON_NCP_UNUSED int wraparound, + CYTHON_NCP_UNUSED int boundscheck) { +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS + if (is_list || PyList_CheckExact(o)) { + Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); + if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) { + PyObject *r = PyList_GET_ITEM(o, n); + Py_INCREF(r); + return r; + } + } + else if (PyTuple_CheckExact(o)) { + Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o); + if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) { + PyObject *r = PyTuple_GET_ITEM(o, n); + Py_INCREF(r); + return r; + } + } else { + PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence; + if (likely(m && m->sq_item)) { + if (wraparound && unlikely(i < 0) && likely(m->sq_length)) { + Py_ssize_t l = m->sq_length(o); + if (likely(l >= 0)) { + i += l; + } else { + if (!PyErr_ExceptionMatches(PyExc_OverflowError)) + return NULL; + PyErr_Clear(); + } + } + return m->sq_item(o, i); + } + } +#else + if (is_list || PySequence_Check(o)) { + return PySequence_GetItem(o, i); + } +#endif + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +} + +/* PyObjectCall2Args */ +static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) { + PyObject *args, *result = NULL; + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(function)) { + PyObject *args[2] = {arg1, arg2}; + return __Pyx_PyFunction_FastCall(function, args, 2); + } + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(function)) { + PyObject *args[2] = {arg1, arg2}; + return __Pyx_PyCFunction_FastCall(function, args, 2); + } + #endif + args = PyTuple_New(2); + if (unlikely(!args)) goto done; + Py_INCREF(arg1); + PyTuple_SET_ITEM(args, 0, arg1); + Py_INCREF(arg2); + PyTuple_SET_ITEM(args, 1, arg2); + Py_INCREF(function); + result = __Pyx_PyObject_Call(function, args, NULL); + Py_DECREF(args); + Py_DECREF(function); +done: + return result; +} + +/* RaiseException */ +#if PY_MAJOR_VERSION < 3 +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, + CYTHON_UNUSED PyObject *cause) { + __Pyx_PyThreadState_declare + Py_XINCREF(type); + if (!value || value == Py_None) + value = NULL; + else + Py_INCREF(value); + if (!tb || tb == Py_None) + tb = NULL; + else { + Py_INCREF(tb); + if (!PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto raise_error; + } + } + if (PyType_Check(type)) { +#if CYTHON_COMPILING_IN_PYPY + if (!value) { + Py_INCREF(Py_None); + value = Py_None; + } +#endif + PyErr_NormalizeException(&type, &value, &tb); + } else { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto raise_error; + } + value = type; + type = (PyObject*) Py_TYPE(type); + Py_INCREF(type); + if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto raise_error; + } + } + __Pyx_PyThreadState_assign + __Pyx_ErrRestore(type, value, tb); + return; +raise_error: + Py_XDECREF(value); + Py_XDECREF(type); + Py_XDECREF(tb); + return; +} +#else +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { + PyObject* owned_instance = NULL; + if (tb == Py_None) { + tb = 0; + } else if (tb && !PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto bad; + } + if (value == Py_None) + value = 0; + if (PyExceptionInstance_Check(type)) { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto bad; + } + value = type; + type = (PyObject*) Py_TYPE(value); + } else if (PyExceptionClass_Check(type)) { + PyObject *instance_class = NULL; + if (value && PyExceptionInstance_Check(value)) { + instance_class = (PyObject*) Py_TYPE(value); + if (instance_class != type) { + int is_subclass = PyObject_IsSubclass(instance_class, type); + if (!is_subclass) { + instance_class = NULL; + } else if (unlikely(is_subclass == -1)) { + goto bad; + } else { + type = instance_class; + } + } + } + if (!instance_class) { + PyObject *args; + if (!value) + args = PyTuple_New(0); + else if (PyTuple_Check(value)) { + Py_INCREF(value); + args = value; + } else + args = PyTuple_Pack(1, value); + if (!args) + goto bad; + owned_instance = PyObject_Call(type, args, NULL); + Py_DECREF(args); + if (!owned_instance) + goto bad; + value = owned_instance; + if (!PyExceptionInstance_Check(value)) { + PyErr_Format(PyExc_TypeError, + "calling %R should have returned an instance of " + "BaseException, not %R", + type, Py_TYPE(value)); + goto bad; + } + } + } else { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto bad; + } + if (cause) { + PyObject *fixed_cause; + if (cause == Py_None) { + fixed_cause = NULL; + } else if (PyExceptionClass_Check(cause)) { + fixed_cause = PyObject_CallObject(cause, NULL); + if (fixed_cause == NULL) + goto bad; + } else if (PyExceptionInstance_Check(cause)) { + fixed_cause = cause; + Py_INCREF(fixed_cause); + } else { + PyErr_SetString(PyExc_TypeError, + "exception causes must derive from " + "BaseException"); + goto bad; + } + PyException_SetCause(value, fixed_cause); + } + PyErr_SetObject(type, value); + if (tb) { +#if CYTHON_COMPILING_IN_PYPY + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); + Py_INCREF(tb); + PyErr_Restore(tmp_type, tmp_value, tb); + Py_XDECREF(tmp_tb); +#else + PyThreadState *tstate = __Pyx_PyThreadState_Current; + PyObject* tmp_tb = tstate->curexc_traceback; + if (tb != tmp_tb) { + Py_INCREF(tb); + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_tb); + } +#endif + } +bad: + Py_XDECREF(owned_instance); + return; +} +#endif + +/* PyErrExceptionMatches */ +#if CYTHON_FAST_THREAD_STATE +static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { + Py_ssize_t i, n; + n = PyTuple_GET_SIZE(tuple); +#if PY_MAJOR_VERSION >= 3 + for (i=0; icurexc_type; + if (exc_type == err) return 1; + if (unlikely(!exc_type)) return 0; + if (unlikely(PyTuple_Check(err))) + return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err); + return __Pyx_PyErr_GivenExceptionMatches(exc_type, err); +} +#endif + +/* GetAttr */ +static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) { +#if CYTHON_USE_TYPE_SLOTS +#if PY_MAJOR_VERSION >= 3 + if (likely(PyUnicode_Check(n))) +#else + if (likely(PyString_Check(n))) +#endif + return __Pyx_PyObject_GetAttrStr(o, n); +#endif + return PyObject_GetAttr(o, n); +} + +/* GetAttr3 */ +static PyObject *__Pyx_GetAttr3Default(PyObject *d) { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) + return NULL; + __Pyx_PyErr_Clear(); + Py_INCREF(d); + return d; +} +static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) { + PyObject *r = __Pyx_GetAttr(o, n); + return (likely(r)) ? r : __Pyx_GetAttr3Default(d); +} + +/* CallNextTpDealloc */ +static void __Pyx_call_next_tp_dealloc(PyObject* obj, destructor current_tp_dealloc) { + PyTypeObject* type = Py_TYPE(obj); + while (type && type->tp_dealloc != current_tp_dealloc) + type = type->tp_base; + while (type && type->tp_dealloc == current_tp_dealloc) + type = type->tp_base; + if (type) + type->tp_dealloc(obj); +} + +/* CallNextTpTraverse */ +static int __Pyx_call_next_tp_traverse(PyObject* obj, visitproc v, void *a, traverseproc current_tp_traverse) { + PyTypeObject* type = Py_TYPE(obj); + while (type && type->tp_traverse != current_tp_traverse) + type = type->tp_base; + while (type && type->tp_traverse == current_tp_traverse) + type = type->tp_base; + if (type && type->tp_traverse) + return type->tp_traverse(obj, v, a); + return 0; +} + +/* CallNextTpClear */ +static void __Pyx_call_next_tp_clear(PyObject* obj, inquiry current_tp_clear) { + PyTypeObject* type = Py_TYPE(obj); + while (type && type->tp_clear != current_tp_clear) + type = type->tp_base; + while (type && type->tp_clear == current_tp_clear) + type = type->tp_base; + if (type && type->tp_clear) + type->tp_clear(obj); +} + +/* TypeImport */ +#ifndef __PYX_HAVE_RT_ImportType +#define __PYX_HAVE_RT_ImportType +static PyTypeObject *__Pyx_ImportType(PyObject *module, const char *module_name, const char *class_name, + size_t size, enum __Pyx_ImportType_CheckSize check_size) +{ + PyObject *result = 0; + char warning[200]; + Py_ssize_t basicsize; +#ifdef Py_LIMITED_API + PyObject *py_basicsize; +#endif + result = PyObject_GetAttrString(module, class_name); + if (!result) + goto bad; + if (!PyType_Check(result)) { + PyErr_Format(PyExc_TypeError, + "%.200s.%.200s is not a type object", + module_name, class_name); + goto bad; + } +#ifndef Py_LIMITED_API + basicsize = ((PyTypeObject *)result)->tp_basicsize; +#else + py_basicsize = PyObject_GetAttrString(result, "__basicsize__"); + if (!py_basicsize) + goto bad; + basicsize = PyLong_AsSsize_t(py_basicsize); + Py_DECREF(py_basicsize); + py_basicsize = 0; + if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred()) + goto bad; +#endif + if ((size_t)basicsize < size) { + PyErr_Format(PyExc_ValueError, + "%.200s.%.200s size changed, may indicate binary incompatibility. " + "Expected %zd from C header, got %zd from PyObject", + module_name, class_name, size, basicsize); + goto bad; + } + if (check_size == __Pyx_ImportType_CheckSize_Error && (size_t)basicsize != size) { + PyErr_Format(PyExc_ValueError, + "%.200s.%.200s size changed, may indicate binary incompatibility. " + "Expected %zd from C header, got %zd from PyObject", + module_name, class_name, size, basicsize); + goto bad; + } + else if (check_size == __Pyx_ImportType_CheckSize_Warn && (size_t)basicsize > size) { + PyOS_snprintf(warning, sizeof(warning), + "%s.%s size changed, may indicate binary incompatibility. " + "Expected %zd from C header, got %zd from PyObject", + module_name, class_name, size, basicsize); + if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad; + } + return (PyTypeObject *)result; +bad: + Py_XDECREF(result); + return NULL; +} +#endif + +/* GetVTable */ +static void* __Pyx_GetVtable(PyObject *dict) { + void* ptr; + PyObject *ob = PyObject_GetItem(dict, __pyx_n_s_pyx_vtable); + if (!ob) + goto bad; +#if PY_VERSION_HEX >= 0x02070000 + ptr = PyCapsule_GetPointer(ob, 0); +#else + ptr = PyCObject_AsVoidPtr(ob); +#endif + if (!ptr && !PyErr_Occurred()) + PyErr_SetString(PyExc_RuntimeError, "invalid vtable found for imported type"); + Py_DECREF(ob); + return ptr; +bad: + Py_XDECREF(ob); + return NULL; +} + +/* PyObject_GenericGetAttrNoDict */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) { + PyErr_Format(PyExc_AttributeError, +#if PY_MAJOR_VERSION >= 3 + "'%.50s' object has no attribute '%U'", + tp->tp_name, attr_name); +#else + "'%.50s' object has no attribute '%.400s'", + tp->tp_name, PyString_AS_STRING(attr_name)); +#endif + return NULL; +} +static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) { + PyObject *descr; + PyTypeObject *tp = Py_TYPE(obj); + if (unlikely(!PyString_Check(attr_name))) { + return PyObject_GenericGetAttr(obj, attr_name); + } + assert(!tp->tp_dictoffset); + descr = _PyType_Lookup(tp, attr_name); + if (unlikely(!descr)) { + return __Pyx_RaiseGenericGetAttributeError(tp, attr_name); + } + Py_INCREF(descr); + #if PY_MAJOR_VERSION < 3 + if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS))) + #endif + { + descrgetfunc f = Py_TYPE(descr)->tp_descr_get; + if (unlikely(f)) { + PyObject *res = f(descr, obj, (PyObject *)tp); + Py_DECREF(descr); + return res; + } + } + return descr; +} +#endif + +/* PyObject_GenericGetAttr */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) { + if (unlikely(Py_TYPE(obj)->tp_dictoffset)) { + return PyObject_GenericGetAttr(obj, attr_name); + } + return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name); +} +#endif + +/* SetVTable */ +static int __Pyx_SetVtable(PyObject *dict, void *vtable) { +#if PY_VERSION_HEX >= 0x02070000 + PyObject *ob = PyCapsule_New(vtable, 0, 0); +#else + PyObject *ob = PyCObject_FromVoidPtr(vtable, 0); +#endif + if (!ob) + goto bad; + if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0) + goto bad; + Py_DECREF(ob); + return 0; +bad: + Py_XDECREF(ob); + return -1; +} + +/* Import */ +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { + PyObject *empty_list = 0; + PyObject *module = 0; + PyObject *global_dict = 0; + PyObject *empty_dict = 0; + PyObject *list; + #if PY_MAJOR_VERSION < 3 + PyObject *py_import; + py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); + if (!py_import) + goto bad; + #endif + if (from_list) + list = from_list; + else { + empty_list = PyList_New(0); + if (!empty_list) + goto bad; + list = empty_list; + } + global_dict = PyModule_GetDict(__pyx_m); + if (!global_dict) + goto bad; + empty_dict = PyDict_New(); + if (!empty_dict) + goto bad; + { + #if PY_MAJOR_VERSION >= 3 + if (level == -1) { + if (strchr(__Pyx_MODULE_NAME, '.')) { + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, 1); + if (!module) { + if (!PyErr_ExceptionMatches(PyExc_ImportError)) + goto bad; + PyErr_Clear(); + } + } + level = 0; + } + #endif + if (!module) { + #if PY_MAJOR_VERSION < 3 + PyObject *py_level = PyInt_FromLong(level); + if (!py_level) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, py_level, (PyObject *)NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, level); + #endif + } + } +bad: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(py_import); + #endif + Py_XDECREF(empty_list); + Py_XDECREF(empty_dict); + return module; +} + +/* ImportFrom */ +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { + PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); + if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_Format(PyExc_ImportError, + #if PY_MAJOR_VERSION < 3 + "cannot import name %.230s", PyString_AS_STRING(name)); + #else + "cannot import name %S", name); + #endif + } + return value; +} + +/* FetchCommonType */ +static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { + PyObject* fake_module; + PyTypeObject* cached_type = NULL; + fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI); + if (!fake_module) return NULL; + Py_INCREF(fake_module); + cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name); + if (cached_type) { + if (!PyType_Check((PyObject*)cached_type)) { + PyErr_Format(PyExc_TypeError, + "Shared Cython type %.200s is not a type object", + type->tp_name); + goto bad; + } + if (cached_type->tp_basicsize != type->tp_basicsize) { + PyErr_Format(PyExc_TypeError, + "Shared Cython type %.200s has the wrong size, try recompiling", + type->tp_name); + goto bad; + } + } else { + if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; + PyErr_Clear(); + if (PyType_Ready(type) < 0) goto bad; + if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0) + goto bad; + Py_INCREF(type); + cached_type = type; + } +done: + Py_DECREF(fake_module); + return cached_type; +bad: + Py_XDECREF(cached_type); + cached_type = NULL; + goto done; +} + +/* CythonFunction */ +#include +static PyObject * +__Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure) +{ + if (unlikely(op->func_doc == NULL)) { + if (op->func.m_ml->ml_doc) { +#if PY_MAJOR_VERSION >= 3 + op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc); +#else + op->func_doc = PyString_FromString(op->func.m_ml->ml_doc); +#endif + if (unlikely(op->func_doc == NULL)) + return NULL; + } else { + Py_INCREF(Py_None); + return Py_None; + } + } + Py_INCREF(op->func_doc); + return op->func_doc; +} +static int +__Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context) +{ + PyObject *tmp = op->func_doc; + if (value == NULL) { + value = Py_None; + } + Py_INCREF(value); + op->func_doc = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + if (unlikely(op->func_name == NULL)) { +#if PY_MAJOR_VERSION >= 3 + op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name); +#else + op->func_name = PyString_InternFromString(op->func.m_ml->ml_name); +#endif + if (unlikely(op->func_name == NULL)) + return NULL; + } + Py_INCREF(op->func_name); + return op->func_name; +} +static int +__Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context) +{ + PyObject *tmp; +#if PY_MAJOR_VERSION >= 3 + if (unlikely(value == NULL || !PyUnicode_Check(value))) +#else + if (unlikely(value == NULL || !PyString_Check(value))) +#endif + { + PyErr_SetString(PyExc_TypeError, + "__name__ must be set to a string object"); + return -1; + } + tmp = op->func_name; + Py_INCREF(value); + op->func_name = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + Py_INCREF(op->func_qualname); + return op->func_qualname; +} +static int +__Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context) +{ + PyObject *tmp; +#if PY_MAJOR_VERSION >= 3 + if (unlikely(value == NULL || !PyUnicode_Check(value))) +#else + if (unlikely(value == NULL || !PyString_Check(value))) +#endif + { + PyErr_SetString(PyExc_TypeError, + "__qualname__ must be set to a string object"); + return -1; + } + tmp = op->func_qualname; + Py_INCREF(value); + op->func_qualname = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED void *closure) +{ + PyObject *self; + self = m->func_closure; + if (self == NULL) + self = Py_None; + Py_INCREF(self); + return self; +} +static PyObject * +__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + if (unlikely(op->func_dict == NULL)) { + op->func_dict = PyDict_New(); + if (unlikely(op->func_dict == NULL)) + return NULL; + } + Py_INCREF(op->func_dict); + return op->func_dict; +} +static int +__Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context) +{ + PyObject *tmp; + if (unlikely(value == NULL)) { + PyErr_SetString(PyExc_TypeError, + "function's dictionary may not be deleted"); + return -1; + } + if (unlikely(!PyDict_Check(value))) { + PyErr_SetString(PyExc_TypeError, + "setting function's dictionary to a non-dict"); + return -1; + } + tmp = op->func_dict; + Py_INCREF(value); + op->func_dict = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + Py_INCREF(op->func_globals); + return op->func_globals; +} +static PyObject * +__Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + Py_INCREF(Py_None); + return Py_None; +} +static PyObject * +__Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + PyObject* result = (op->func_code) ? op->func_code : Py_None; + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { + int result = 0; + PyObject *res = op->defaults_getter((PyObject *) op); + if (unlikely(!res)) + return -1; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + op->defaults_tuple = PyTuple_GET_ITEM(res, 0); + Py_INCREF(op->defaults_tuple); + op->defaults_kwdict = PyTuple_GET_ITEM(res, 1); + Py_INCREF(op->defaults_kwdict); + #else + op->defaults_tuple = PySequence_ITEM(res, 0); + if (unlikely(!op->defaults_tuple)) result = -1; + else { + op->defaults_kwdict = PySequence_ITEM(res, 1); + if (unlikely(!op->defaults_kwdict)) result = -1; + } + #endif + Py_DECREF(res); + return result; +} +static int +__Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) { + PyObject* tmp; + if (!value) { + value = Py_None; + } else if (value != Py_None && !PyTuple_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__defaults__ must be set to a tuple object"); + return -1; + } + Py_INCREF(value); + tmp = op->defaults_tuple; + op->defaults_tuple = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) { + PyObject* result = op->defaults_tuple; + if (unlikely(!result)) { + if (op->defaults_getter) { + if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL; + result = op->defaults_tuple; + } else { + result = Py_None; + } + } + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) { + PyObject* tmp; + if (!value) { + value = Py_None; + } else if (value != Py_None && !PyDict_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__kwdefaults__ must be set to a dict object"); + return -1; + } + Py_INCREF(value); + tmp = op->defaults_kwdict; + op->defaults_kwdict = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) { + PyObject* result = op->defaults_kwdict; + if (unlikely(!result)) { + if (op->defaults_getter) { + if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL; + result = op->defaults_kwdict; + } else { + result = Py_None; + } + } + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) { + PyObject* tmp; + if (!value || value == Py_None) { + value = NULL; + } else if (!PyDict_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__annotations__ must be set to a dict object"); + return -1; + } + Py_XINCREF(value); + tmp = op->func_annotations; + op->func_annotations = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) { + PyObject* result = op->func_annotations; + if (unlikely(!result)) { + result = PyDict_New(); + if (unlikely(!result)) return NULL; + op->func_annotations = result; + } + Py_INCREF(result); + return result; +} +static PyGetSetDef __pyx_CyFunction_getsets[] = { + {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, + {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, + {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, + {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, + {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, + {(char *) "__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0}, + {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, + {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, + {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, + {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, + {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, + {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, + {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, + {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, + {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, + {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, + {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, + {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, + {0, 0, 0, 0, 0} +}; +static PyMemberDef __pyx_CyFunction_members[] = { + {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), PY_WRITE_RESTRICTED, 0}, + {0, 0, 0, 0, 0} +}; +static PyObject * +__Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args) +{ +#if PY_MAJOR_VERSION >= 3 + return PyUnicode_FromString(m->func.m_ml->ml_name); +#else + return PyString_FromString(m->func.m_ml->ml_name); +#endif +} +static PyMethodDef __pyx_CyFunction_methods[] = { + {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, + {0, 0, 0, 0} +}; +#if PY_VERSION_HEX < 0x030500A0 +#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist) +#else +#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func.m_weakreflist) +#endif +static PyObject *__Pyx_CyFunction_New(PyTypeObject *type, PyMethodDef *ml, int flags, PyObject* qualname, + PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { + __pyx_CyFunctionObject *op = PyObject_GC_New(__pyx_CyFunctionObject, type); + if (op == NULL) + return NULL; + op->flags = flags; + __Pyx_CyFunction_weakreflist(op) = NULL; + op->func.m_ml = ml; + op->func.m_self = (PyObject *) op; + Py_XINCREF(closure); + op->func_closure = closure; + Py_XINCREF(module); + op->func.m_module = module; + op->func_dict = NULL; + op->func_name = NULL; + Py_INCREF(qualname); + op->func_qualname = qualname; + op->func_doc = NULL; + op->func_classobj = NULL; + op->func_globals = globals; + Py_INCREF(op->func_globals); + Py_XINCREF(code); + op->func_code = code; + op->defaults_pyobjects = 0; + op->defaults = NULL; + op->defaults_tuple = NULL; + op->defaults_kwdict = NULL; + op->defaults_getter = NULL; + op->func_annotations = NULL; + PyObject_GC_Track(op); + return (PyObject *) op; +} +static int +__Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) +{ + Py_CLEAR(m->func_closure); + Py_CLEAR(m->func.m_module); + Py_CLEAR(m->func_dict); + Py_CLEAR(m->func_name); + Py_CLEAR(m->func_qualname); + Py_CLEAR(m->func_doc); + Py_CLEAR(m->func_globals); + Py_CLEAR(m->func_code); + Py_CLEAR(m->func_classobj); + Py_CLEAR(m->defaults_tuple); + Py_CLEAR(m->defaults_kwdict); + Py_CLEAR(m->func_annotations); + if (m->defaults) { + PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); + int i; + for (i = 0; i < m->defaults_pyobjects; i++) + Py_XDECREF(pydefaults[i]); + PyObject_Free(m->defaults); + m->defaults = NULL; + } + return 0; +} +static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m) +{ + if (__Pyx_CyFunction_weakreflist(m) != NULL) + PyObject_ClearWeakRefs((PyObject *) m); + __Pyx_CyFunction_clear(m); + PyObject_GC_Del(m); +} +static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) +{ + PyObject_GC_UnTrack(m); + __Pyx__CyFunction_dealloc(m); +} +static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) +{ + Py_VISIT(m->func_closure); + Py_VISIT(m->func.m_module); + Py_VISIT(m->func_dict); + Py_VISIT(m->func_name); + Py_VISIT(m->func_qualname); + Py_VISIT(m->func_doc); + Py_VISIT(m->func_globals); + Py_VISIT(m->func_code); + Py_VISIT(m->func_classobj); + Py_VISIT(m->defaults_tuple); + Py_VISIT(m->defaults_kwdict); + if (m->defaults) { + PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); + int i; + for (i = 0; i < m->defaults_pyobjects; i++) + Py_VISIT(pydefaults[i]); + } + return 0; +} +static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type) +{ + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) { + Py_INCREF(func); + return func; + } + if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) { + if (type == NULL) + type = (PyObject *)(Py_TYPE(obj)); + return __Pyx_PyMethod_New(func, type, (PyObject *)(Py_TYPE(type))); + } + if (obj == Py_None) + obj = NULL; + return __Pyx_PyMethod_New(func, obj, type); +} +static PyObject* +__Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) +{ +#if PY_MAJOR_VERSION >= 3 + return PyUnicode_FromFormat("", + op->func_qualname, (void *)op); +#else + return PyString_FromFormat("", + PyString_AsString(op->func_qualname), (void *)op); +#endif +} +static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) { + PyCFunctionObject* f = (PyCFunctionObject*)func; + PyCFunction meth = f->m_ml->ml_meth; + Py_ssize_t size; + switch (f->m_ml->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) { + case METH_VARARGS: + if (likely(kw == NULL || PyDict_Size(kw) == 0)) + return (*meth)(self, arg); + break; + case METH_VARARGS | METH_KEYWORDS: + return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw); + case METH_NOARGS: + if (likely(kw == NULL || PyDict_Size(kw) == 0)) { + size = PyTuple_GET_SIZE(arg); + if (likely(size == 0)) + return (*meth)(self, NULL); + PyErr_Format(PyExc_TypeError, + "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", + f->m_ml->ml_name, size); + return NULL; + } + break; + case METH_O: + if (likely(kw == NULL || PyDict_Size(kw) == 0)) { + size = PyTuple_GET_SIZE(arg); + if (likely(size == 1)) { + PyObject *result, *arg0; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + arg0 = PyTuple_GET_ITEM(arg, 0); + #else + arg0 = PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL; + #endif + result = (*meth)(self, arg0); + #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) + Py_DECREF(arg0); + #endif + return result; + } + PyErr_Format(PyExc_TypeError, + "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", + f->m_ml->ml_name, size); + return NULL; + } + break; + default: + PyErr_SetString(PyExc_SystemError, "Bad call flags in " + "__Pyx_CyFunction_Call. METH_OLDARGS is no " + "longer supported!"); + return NULL; + } + PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", + f->m_ml->ml_name); + return NULL; +} +static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { + return __Pyx_CyFunction_CallMethod(func, ((PyCFunctionObject*)func)->m_self, arg, kw); +} +static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) { + PyObject *result; + __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func; + if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { + Py_ssize_t argc; + PyObject *new_args; + PyObject *self; + argc = PyTuple_GET_SIZE(args); + new_args = PyTuple_GetSlice(args, 1, argc); + if (unlikely(!new_args)) + return NULL; + self = PyTuple_GetItem(args, 0); + if (unlikely(!self)) { + Py_DECREF(new_args); + return NULL; + } + result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw); + Py_DECREF(new_args); + } else { + result = __Pyx_CyFunction_Call(func, args, kw); + } + return result; +} +static PyTypeObject __pyx_CyFunctionType_type = { + PyVarObject_HEAD_INIT(0, 0) + "cython_function_or_method", + sizeof(__pyx_CyFunctionObject), + 0, + (destructor) __Pyx_CyFunction_dealloc, + 0, + 0, + 0, +#if PY_MAJOR_VERSION < 3 + 0, +#else + 0, +#endif + (reprfunc) __Pyx_CyFunction_repr, + 0, + 0, + 0, + 0, + __Pyx_CyFunction_CallAsMethod, + 0, + 0, + 0, + 0, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, + 0, + (traverseproc) __Pyx_CyFunction_traverse, + (inquiry) __Pyx_CyFunction_clear, + 0, +#if PY_VERSION_HEX < 0x030500A0 + offsetof(__pyx_CyFunctionObject, func_weakreflist), +#else + offsetof(PyCFunctionObject, m_weakreflist), +#endif + 0, + 0, + __pyx_CyFunction_methods, + __pyx_CyFunction_members, + __pyx_CyFunction_getsets, + 0, + 0, + __Pyx_CyFunction_descr_get, + 0, + offsetof(__pyx_CyFunctionObject, func_dict), + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, +#if PY_VERSION_HEX >= 0x030400a1 + 0, +#endif +}; +static int __pyx_CyFunction_init(void) { + __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); + if (unlikely(__pyx_CyFunctionType == NULL)) { + return -1; + } + return 0; +} +static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults = PyObject_Malloc(size); + if (unlikely(!m->defaults)) + return PyErr_NoMemory(); + memset(m->defaults, 0, size); + m->defaults_pyobjects = pyobjects; + return m->defaults; +} +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults_tuple = tuple; + Py_INCREF(tuple); +} +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults_kwdict = dict; + Py_INCREF(dict); +} +static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->func_annotations = dict; + Py_INCREF(dict); +} + +/* PyObjectSetAttrStr */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) { + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_setattro)) + return tp->tp_setattro(obj, attr_name, value); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_setattr)) + return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value); +#endif + return PyObject_SetAttr(obj, attr_name, value); +} +#endif + +/* GetNameInClass */ +static PyObject *__Pyx_GetGlobalNameAfterAttributeLookup(PyObject *name) { + PyObject *result; + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) + return NULL; + __Pyx_PyErr_Clear(); + __Pyx_GetModuleGlobalNameUncached(result, name); + return result; +} +static PyObject *__Pyx__GetNameInClass(PyObject *nmspace, PyObject *name) { + PyObject *result; + result = __Pyx_PyObject_GetAttrStr(nmspace, name); + if (!result) { + result = __Pyx_GetGlobalNameAfterAttributeLookup(name); + } + return result; +} + +/* Globals */ +static PyObject* __Pyx_Globals(void) { + Py_ssize_t i; + PyObject *names; + PyObject *globals = __pyx_d; + Py_INCREF(globals); + names = PyObject_Dir(__pyx_m); + if (!names) + goto bad; + for (i = PyList_GET_SIZE(names)-1; i >= 0; i--) { +#if CYTHON_COMPILING_IN_PYPY + PyObject* name = PySequence_ITEM(names, i); + if (!name) + goto bad; +#else + PyObject* name = PyList_GET_ITEM(names, i); +#endif + if (!PyDict_Contains(globals, name)) { + PyObject* value = __Pyx_GetAttr(__pyx_m, name); + if (!value) { +#if CYTHON_COMPILING_IN_PYPY + Py_DECREF(name); +#endif + goto bad; + } + if (PyDict_SetItem(globals, name, value) < 0) { +#if CYTHON_COMPILING_IN_PYPY + Py_DECREF(name); +#endif + Py_DECREF(value); + goto bad; + } + } +#if CYTHON_COMPILING_IN_PYPY + Py_DECREF(name); +#endif + } + Py_DECREF(names); + return globals; +bad: + Py_XDECREF(names); + Py_XDECREF(globals); + return NULL; +} + +/* CLineInTraceback */ +#ifndef CYTHON_CLINE_IN_TRACEBACK +static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { + PyObject *use_cline; + PyObject *ptype, *pvalue, *ptraceback; +#if CYTHON_COMPILING_IN_CPYTHON + PyObject **cython_runtime_dict; +#endif + if (unlikely(!__pyx_cython_runtime)) { + return c_line; + } + __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); +#if CYTHON_COMPILING_IN_CPYTHON + cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); + if (likely(cython_runtime_dict)) { + __PYX_PY_DICT_LOOKUP_IF_MODIFIED( + use_cline, *cython_runtime_dict, + __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback)) + } else +#endif + { + PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback); + if (use_cline_obj) { + use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; + Py_DECREF(use_cline_obj); + } else { + PyErr_Clear(); + use_cline = NULL; + } + } + if (!use_cline) { + c_line = 0; + PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); + } + else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { + c_line = 0; + } + __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); + return c_line; +} +#endif + +/* CodeObjectCache */ +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { + int start = 0, mid = 0, end = count - 1; + if (end >= 0 && code_line > entries[end].code_line) { + return count; + } + while (start < end) { + mid = start + (end - start) / 2; + if (code_line < entries[mid].code_line) { + end = mid; + } else if (code_line > entries[mid].code_line) { + start = mid + 1; + } else { + return mid; + } + } + if (code_line <= entries[mid].code_line) { + return mid; + } else { + return mid + 1; + } +} +static PyCodeObject *__pyx_find_code_object(int code_line) { + PyCodeObject* code_object; + int pos; + if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { + return NULL; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { + return NULL; + } + code_object = __pyx_code_cache.entries[pos].code_object; + Py_INCREF(code_object); + return code_object; +} +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { + int pos, i; + __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; + if (unlikely(!code_line)) { + return; + } + if (unlikely(!entries)) { + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); + if (likely(entries)) { + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = 64; + __pyx_code_cache.count = 1; + entries[0].code_line = code_line; + entries[0].code_object = code_object; + Py_INCREF(code_object); + } + return; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { + PyCodeObject* tmp = entries[pos].code_object; + entries[pos].code_object = code_object; + Py_DECREF(tmp); + return; + } + if (__pyx_code_cache.count == __pyx_code_cache.max_count) { + int new_max = __pyx_code_cache.max_count + 64; + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( + __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry)); + if (unlikely(!entries)) { + return; + } + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = new_max; + } + for (i=__pyx_code_cache.count; i>pos; i--) { + entries[i] = entries[i-1]; + } + entries[pos].code_line = code_line; + entries[pos].code_object = code_object; + __pyx_code_cache.count++; + Py_INCREF(code_object); +} + +/* AddTraceback */ +#include "compile.h" +#include "frameobject.h" +#include "traceback.h" +static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( + const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyObject *py_srcfile = 0; + PyObject *py_funcname = 0; + #if PY_MAJOR_VERSION < 3 + py_srcfile = PyString_FromString(filename); + #else + py_srcfile = PyUnicode_FromString(filename); + #endif + if (!py_srcfile) goto bad; + if (c_line) { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + #else + py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + #endif + } + else { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromString(funcname); + #else + py_funcname = PyUnicode_FromString(funcname); + #endif + } + if (!py_funcname) goto bad; + py_code = __Pyx_PyCode_New( + 0, + 0, + 0, + 0, + 0, + __pyx_empty_bytes, /*PyObject *code,*/ + __pyx_empty_tuple, /*PyObject *consts,*/ + __pyx_empty_tuple, /*PyObject *names,*/ + __pyx_empty_tuple, /*PyObject *varnames,*/ + __pyx_empty_tuple, /*PyObject *freevars,*/ + __pyx_empty_tuple, /*PyObject *cellvars,*/ + py_srcfile, /*PyObject *filename,*/ + py_funcname, /*PyObject *name,*/ + py_line, + __pyx_empty_bytes /*PyObject *lnotab*/ + ); + Py_DECREF(py_srcfile); + Py_DECREF(py_funcname); + return py_code; +bad: + Py_XDECREF(py_srcfile); + Py_XDECREF(py_funcname); + return NULL; +} +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyFrameObject *py_frame = 0; + PyThreadState *tstate = __Pyx_PyThreadState_Current; + if (c_line) { + c_line = __Pyx_CLineForTraceback(tstate, c_line); + } + py_code = __pyx_find_code_object(c_line ? -c_line : py_line); + if (!py_code) { + py_code = __Pyx_CreateCodeObjectForTraceback( + funcname, c_line, py_line, filename); + if (!py_code) goto bad; + __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); + } + py_frame = PyFrame_New( + tstate, /*PyThreadState *tstate,*/ + py_code, /*PyCodeObject *code,*/ + __pyx_d, /*PyObject *globals,*/ + 0 /*PyObject *locals*/ + ); + if (!py_frame) goto bad; + __Pyx_PyFrame_SetLineNumber(py_frame, py_line); + PyTraceBack_Here(py_frame); +bad: + Py_XDECREF(py_code); + Py_XDECREF(py_frame); +} + +/* CIntToPy */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { + const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(long) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(long) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(long) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(long), + little, !is_unsigned); + } +} + +/* CIntToPy */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { + const int neg_one = (int) ((int) 0 - (int) 1), const_zero = (int) 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(int) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(int) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(int) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(int), + little, !is_unsigned); + } +} + +/* CIntFromPyVerify */ +#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ + __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) +#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ + __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) +#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ + {\ + func_type value = func_value;\ + if (sizeof(target_type) < sizeof(func_type)) {\ + if (unlikely(value != (func_type) (target_type) value)) {\ + func_type zero = 0;\ + if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ + return (target_type) -1;\ + if (is_unsigned && unlikely(value < zero))\ + goto raise_neg_overflow;\ + else\ + goto raise_overflow;\ + }\ + }\ + return (target_type) value;\ + } + +/* CIntFromPy */ +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { + const int neg_one = (int) ((int) 0 - (int) 1), const_zero = (int) 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(int) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (int) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (int) 0; + case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0]) + case 2: + if (8 * sizeof(int) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) { + return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + case 3: + if (8 * sizeof(int) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) { + return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + case 4: + if (8 * sizeof(int) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) { + return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (int) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if (sizeof(int) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (int) 0; + case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0])) + case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0]) + case -2: + if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { + return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 2: + if (8 * sizeof(int) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { + return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case -3: + if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { + return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 3: + if (8 * sizeof(int) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { + return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case -4: + if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { + return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 4: + if (8 * sizeof(int) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { + return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + } +#endif + if (sizeof(int) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + int val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (int) -1; + } + } else { + int val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (int) -1; + val = __Pyx_PyInt_As_int(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to int"); + return (int) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to int"); + return (int) -1; +} + +/* CIntFromPy */ +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { + const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(long) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (long) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (long) 0; + case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0]) + case 2: + if (8 * sizeof(long) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) { + return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + case 3: + if (8 * sizeof(long) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) { + return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + case 4: + if (8 * sizeof(long) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) { + return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (long) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if (sizeof(long) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (long) 0; + case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0])) + case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0]) + case -2: + if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 2: + if (8 * sizeof(long) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case -3: + if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 3: + if (8 * sizeof(long) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case -4: + if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 4: + if (8 * sizeof(long) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + } +#endif + if (sizeof(long) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + long val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (long) -1; + } + } else { + long val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (long) -1; + val = __Pyx_PyInt_As_long(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to long"); + return (long) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to long"); + return (long) -1; +} + +/* FastTypeChecks */ +#if CYTHON_COMPILING_IN_CPYTHON +static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) { + while (a) { + a = a->tp_base; + if (a == b) + return 1; + } + return b == &PyBaseObject_Type; +} +static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) { + PyObject *mro; + if (a == b) return 1; + mro = a->tp_mro; + if (likely(mro)) { + Py_ssize_t i, n; + n = PyTuple_GET_SIZE(mro); + for (i = 0; i < n; i++) { + if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b) + return 1; + } + return 0; + } + return __Pyx_InBases(a, b); +} +#if PY_MAJOR_VERSION == 2 +static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { + PyObject *exception, *value, *tb; + int res; + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ErrFetch(&exception, &value, &tb); + res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; + if (unlikely(res == -1)) { + PyErr_WriteUnraisable(err); + res = 0; + } + if (!res) { + res = PyObject_IsSubclass(err, exc_type2); + if (unlikely(res == -1)) { + PyErr_WriteUnraisable(err); + res = 0; + } + } + __Pyx_ErrRestore(exception, value, tb); + return res; +} +#else +static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { + int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0; + if (!res) { + res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); + } + return res; +} +#endif +static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { + Py_ssize_t i, n; + assert(PyExceptionClass_Check(exc_type)); + n = PyTuple_GET_SIZE(tuple); +#if PY_MAJOR_VERSION >= 3 + for (i=0; i= 0x02070000 + cobj = PyCapsule_New(p, sig, 0); +#else + cobj = PyCObject_FromVoidPtrAndDesc(p, (void *)sig, 0); +#endif + if (!cobj) + goto bad; + if (PyDict_SetItem(d, name, cobj) < 0) + goto bad; + Py_DECREF(cobj); + Py_DECREF(d); + return 0; +bad: + Py_XDECREF(cobj); + Py_XDECREF(d); + return -1; +} + +/* VoidPtrImport */ +#ifndef __PYX_HAVE_RT_ImportVoidPtr +#define __PYX_HAVE_RT_ImportVoidPtr +static int __Pyx_ImportVoidPtr(PyObject *module, const char *name, void **p, const char *sig) { + PyObject *d = 0; + PyObject *cobj = 0; + d = PyObject_GetAttrString(module, (char *)"__pyx_capi__"); + if (!d) + goto bad; + cobj = PyDict_GetItemString(d, name); + if (!cobj) { + PyErr_Format(PyExc_ImportError, + "%.200s does not export expected C variable %.200s", + PyModule_GetName(module), name); + goto bad; + } +#if PY_VERSION_HEX >= 0x02070000 + if (!PyCapsule_IsValid(cobj, sig)) { + PyErr_Format(PyExc_TypeError, + "C variable %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", + PyModule_GetName(module), name, sig, PyCapsule_GetName(cobj)); + goto bad; + } + *p = PyCapsule_GetPointer(cobj, sig); +#else + {const char *desc, *s1, *s2; + desc = (const char *)PyCObject_GetDesc(cobj); + if (!desc) + goto bad; + s1 = desc; s2 = sig; + while (*s1 != '\0' && *s1 == *s2) { s1++; s2++; } + if (*s1 != *s2) { + PyErr_Format(PyExc_TypeError, + "C variable %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", + PyModule_GetName(module), name, sig, desc); + goto bad; + } + *p = PyCObject_AsVoidPtr(cobj);} +#endif + if (!(*p)) + goto bad; + Py_DECREF(d); + return 0; +bad: + Py_XDECREF(d); + return -1; +} +#endif + +/* FunctionImport */ +#ifndef __PYX_HAVE_RT_ImportFunction +#define __PYX_HAVE_RT_ImportFunction +static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig) { + PyObject *d = 0; + PyObject *cobj = 0; + union { + void (*fp)(void); + void *p; + } tmp; + d = PyObject_GetAttrString(module, (char *)"__pyx_capi__"); + if (!d) + goto bad; + cobj = PyDict_GetItemString(d, funcname); + if (!cobj) { + PyErr_Format(PyExc_ImportError, + "%.200s does not export expected C function %.200s", + PyModule_GetName(module), funcname); + goto bad; + } +#if PY_VERSION_HEX >= 0x02070000 + if (!PyCapsule_IsValid(cobj, sig)) { + PyErr_Format(PyExc_TypeError, + "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", + PyModule_GetName(module), funcname, sig, PyCapsule_GetName(cobj)); + goto bad; + } + tmp.p = PyCapsule_GetPointer(cobj, sig); +#else + {const char *desc, *s1, *s2; + desc = (const char *)PyCObject_GetDesc(cobj); + if (!desc) + goto bad; + s1 = desc; s2 = sig; + while (*s1 != '\0' && *s1 == *s2) { s1++; s2++; } + if (*s1 != *s2) { + PyErr_Format(PyExc_TypeError, + "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", + PyModule_GetName(module), funcname, sig, desc); + goto bad; + } + tmp.p = PyCObject_AsVoidPtr(cobj);} +#endif + *f = tmp.fp; + if (!(*f)) + goto bad; + Py_DECREF(d); + return 0; +bad: + Py_XDECREF(d); + return -1; +} +#endif + +/* InitStrings */ +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { + while (t->p) { + #if PY_MAJOR_VERSION < 3 + if (t->is_unicode) { + *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); + } else if (t->intern) { + *t->p = PyString_InternFromString(t->s); + } else { + *t->p = PyString_FromStringAndSize(t->s, t->n - 1); + } + #else + if (t->is_unicode | t->is_str) { + if (t->intern) { + *t->p = PyUnicode_InternFromString(t->s); + } else if (t->encoding) { + *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); + } else { + *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); + } + } else { + *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); + } + #endif + if (!*t->p) + return -1; + if (PyObject_Hash(*t->p) == -1) + return -1; + ++t; + } + return 0; +} + +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { + return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); +} +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { + Py_ssize_t ignore; + return __Pyx_PyObject_AsStringAndSize(o, &ignore); +} +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +#if !CYTHON_PEP393_ENABLED +static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { + char* defenc_c; + PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); + if (!defenc) return NULL; + defenc_c = PyBytes_AS_STRING(defenc); +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + { + char* end = defenc_c + PyBytes_GET_SIZE(defenc); + char* c; + for (c = defenc_c; c < end; c++) { + if ((unsigned char) (*c) >= 128) { + PyUnicode_AsASCIIString(o); + return NULL; + } + } + } +#endif + *length = PyBytes_GET_SIZE(defenc); + return defenc_c; +} +#else +static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { + if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + if (likely(PyUnicode_IS_ASCII(o))) { + *length = PyUnicode_GET_LENGTH(o); + return PyUnicode_AsUTF8(o); + } else { + PyUnicode_AsASCIIString(o); + return NULL; + } +#else + return PyUnicode_AsUTF8AndSize(o, length); +#endif +} +#endif +#endif +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT + if ( +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + __Pyx_sys_getdefaultencoding_not_ascii && +#endif + PyUnicode_Check(o)) { + return __Pyx_PyUnicode_AsStringAndSize(o, length); + } else +#endif +#if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) + if (PyByteArray_Check(o)) { + *length = PyByteArray_GET_SIZE(o); + return PyByteArray_AS_STRING(o); + } else +#endif + { + char* result; + int r = PyBytes_AsStringAndSize(o, &result, length); + if (unlikely(r < 0)) { + return NULL; + } else { + return result; + } + } +} +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { + int is_true = x == Py_True; + if (is_true | (x == Py_False) | (x == Py_None)) return is_true; + else return PyObject_IsTrue(x); +} +static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) { + int retval; + if (unlikely(!x)) return -1; + retval = __Pyx_PyObject_IsTrue(x); + Py_DECREF(x); + return retval; +} +static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) { +#if PY_MAJOR_VERSION >= 3 + if (PyLong_Check(result)) { + if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, + "__int__ returned non-int (type %.200s). " + "The ability to return an instance of a strict subclass of int " + "is deprecated, and may be removed in a future version of Python.", + Py_TYPE(result)->tp_name)) { + Py_DECREF(result); + return NULL; + } + return result; + } +#endif + PyErr_Format(PyExc_TypeError, + "__%.4s__ returned non-%.4s (type %.200s)", + type_name, type_name, Py_TYPE(result)->tp_name); + Py_DECREF(result); + return NULL; +} +static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { +#if CYTHON_USE_TYPE_SLOTS + PyNumberMethods *m; +#endif + const char *name = NULL; + PyObject *res = NULL; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x) || PyLong_Check(x))) +#else + if (likely(PyLong_Check(x))) +#endif + return __Pyx_NewRef(x); +#if CYTHON_USE_TYPE_SLOTS + m = Py_TYPE(x)->tp_as_number; + #if PY_MAJOR_VERSION < 3 + if (m && m->nb_int) { + name = "int"; + res = m->nb_int(x); + } + else if (m && m->nb_long) { + name = "long"; + res = m->nb_long(x); + } + #else + if (likely(m && m->nb_int)) { + name = "int"; + res = m->nb_int(x); + } + #endif +#else + if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { + res = PyNumber_Int(x); + } +#endif + if (likely(res)) { +#if PY_MAJOR_VERSION < 3 + if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) { +#else + if (unlikely(!PyLong_CheckExact(res))) { +#endif + return __Pyx_PyNumber_IntOrLongWrongResultType(res, name); + } + } + else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_TypeError, + "an integer is required"); + } + return res; +} +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { + Py_ssize_t ival; + PyObject *x; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_CheckExact(b))) { + if (sizeof(Py_ssize_t) >= sizeof(long)) + return PyInt_AS_LONG(b); + else + return PyInt_AsSsize_t(b); + } +#endif + if (likely(PyLong_CheckExact(b))) { + #if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)b)->ob_digit; + const Py_ssize_t size = Py_SIZE(b); + if (likely(__Pyx_sst_abs(size) <= 1)) { + ival = likely(size) ? digits[0] : 0; + if (size == -1) ival = -ival; + return ival; + } else { + switch (size) { + case 2: + if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { + return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -2: + if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case 3: + if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { + return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -3: + if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case 4: + if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { + return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -4: + if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + } + } + #endif + return PyLong_AsSsize_t(b); + } + x = PyNumber_Index(b); + if (!x) return -1; + ival = PyInt_AsSsize_t(x); + Py_DECREF(x); + return ival; +} +static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) { + return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False); +} +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { + return PyInt_FromSize_t(ival); +} + + +#endif /* Py_PYTHON_H */ diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/event.html b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/event.html new file mode 100644 index 00000000..1356c532 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/event.html @@ -0,0 +1,3680 @@ + + + + + + Cython: event.py + + + +

Generated by Cython 0.29.2

+

+ Yellow lines hint at Python interaction.
+ Click on a line that starts with a "+" to see the C code that Cython generated for it. +

+

Raw output: event.c

+
+001: # Copyright (c) 2009-2016 Denis Bilenko, gevent contributors. See LICENSE for details.
+
  __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
 002: # cython: auto_pickle=False,embedsignature=True,always_allow_keywords=False,infer_types=True
+
 003: 
+
 004: """Basic synchronization primitives: Event and AsyncResult"""
+
 005: from __future__ import print_function
+
 006: 
+
+007: from gevent._util import _NONE
+
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(__pyx_n_s_NONE);
+  __Pyx_GIVEREF(__pyx_n_s_NONE);
+  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_NONE);
+  __pyx_t_2 = __Pyx_Import(__pyx_n_s_gevent__util, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_NONE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_NONE, __pyx_t_1) < 0) __PYX_ERR(0, 7, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+008: from gevent._compat import reraise
+
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_reraise);
+  __Pyx_GIVEREF(__pyx_n_s_reraise);
+  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_reraise);
+  __pyx_t_1 = __Pyx_Import(__pyx_n_s_gevent__compat, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 8, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_reraise); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(__pyx_t_2);
+  __Pyx_XGOTREF(__pyx_v_6gevent_6_event_reraise);
+  __Pyx_DECREF_SET(__pyx_v_6gevent_6_event_reraise, __pyx_t_2);
+  __Pyx_GIVEREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+009: from gevent._tblib import dump_traceback, load_traceback
+
  __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 9, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(__pyx_n_s_dump_traceback);
+  __Pyx_GIVEREF(__pyx_n_s_dump_traceback);
+  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_dump_traceback);
+  __Pyx_INCREF(__pyx_n_s_load_traceback);
+  __Pyx_GIVEREF(__pyx_n_s_load_traceback);
+  PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_load_traceback);
+  __pyx_t_2 = __Pyx_Import(__pyx_n_s_gevent__tblib, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_dump_traceback); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 9, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(__pyx_t_1);
+  __Pyx_XGOTREF(__pyx_v_6gevent_6_event_dump_traceback);
+  __Pyx_DECREF_SET(__pyx_v_6gevent_6_event_dump_traceback, __pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_load_traceback); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 9, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(__pyx_t_1);
+  __Pyx_XGOTREF(__pyx_v_6gevent_6_event_load_traceback);
+  __Pyx_DECREF_SET(__pyx_v_6gevent_6_event_load_traceback, __pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
 010: 
+
+011: from gevent.timeout import Timeout
+
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 11, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_Timeout);
+  __Pyx_GIVEREF(__pyx_n_s_Timeout);
+  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_Timeout);
+  __pyx_t_1 = __Pyx_Import(__pyx_n_s_gevent_timeout, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 11, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_Timeout); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 11, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(__pyx_t_2);
+  __Pyx_XGOTREF(__pyx_v_6gevent_6_event_Timeout);
+  __Pyx_DECREF_SET(__pyx_v_6gevent_6_event_Timeout, __pyx_t_2);
+  __Pyx_GIVEREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 012: 
+
 013: 
+
+014: __all__ = [
+
  __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 14, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(__pyx_n_s_Event);
+  __Pyx_GIVEREF(__pyx_n_s_Event);
+  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_Event);
+  __Pyx_INCREF(__pyx_n_s_AsyncResult);
+  __Pyx_GIVEREF(__pyx_n_s_AsyncResult);
+  PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_AsyncResult);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_all, __pyx_t_1) < 0) __PYX_ERR(0, 14, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 015:     'Event',
+
 016:     'AsyncResult',
+
 017: ]
+
 018: 
+
+019: def _get_linkable():
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_event_1_get_linkable(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6gevent_6_event__get_linkable[] = "_get_linkable()";
+static PyMethodDef __pyx_mdef_6gevent_6_event_1_get_linkable = {"_get_linkable", (PyCFunction)__pyx_pw_6gevent_6_event_1_get_linkable, METH_NOARGS, __pyx_doc_6gevent_6_event__get_linkable};
+static PyObject *__pyx_pw_6gevent_6_event_1_get_linkable(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_get_linkable (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_6_event__get_linkable(__pyx_self);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_event__get_linkable(CYTHON_UNUSED PyObject *__pyx_self) {
+  PyObject *__pyx_v_x = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_get_linkable", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_AddTraceback("gevent._event._get_linkable", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_x);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__2 = PyTuple_Pack(1, __pyx_n_s_x); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 19, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__2);
+  __Pyx_GIVEREF(__pyx_tuple__2);
+/* … */
+  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_event_1_get_linkable, 0, __pyx_n_s_get_linkable, NULL, __pyx_n_s_gevent__event, __pyx_d, ((PyObject *)__pyx_codeobj__3)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 19, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_linkable, __pyx_t_1) < 0) __PYX_ERR(0, 19, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_codeobj__3 = (PyObject*)__Pyx_PyCode_New(0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_event_py, __pyx_n_s_get_linkable, 19, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__3)) __PYX_ERR(0, 19, __pyx_L1_error)
+
+020:     x = __import__('gevent._abstract_linkable')
+
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin___import__, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 20, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_v_x = __pyx_t_1;
+  __pyx_t_1 = 0;
+/* … */
+  __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_gevent__abstract_linkable); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 20, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple_);
+  __Pyx_GIVEREF(__pyx_tuple_);
+
+021:     return x._abstract_linkable.AbstractLinkable
+
  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_abstract_linkable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 21, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_AbstractLinkable); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 21, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_r = __pyx_t_2;
+  __pyx_t_2 = 0;
+  goto __pyx_L0;
+
+022: locals()['AbstractLinkable'] = _get_linkable()
+
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_get_linkable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 22, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 22, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_1 = __Pyx_Globals(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 22, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (unlikely(PyDict_SetItem(__pyx_t_1, __pyx_n_s_AbstractLinkable, __pyx_t_2) < 0)) __PYX_ERR(0, 22, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+023: del _get_linkable
+
  if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_get_linkable) < 0) __PYX_ERR(0, 23, __pyx_L1_error)
+
 024: 
+
 025: # Sadly, something about the way we have to "import" AbstractLinkable
+
 026: # breaks pylint's inference of slots, even though they're declared
+
 027: # right here.
+
 028: # pylint:disable=assigning-non-slot
+
 029: 
+
+030: class Event(AbstractLinkable): # pylint:disable=undefined-variable
+
struct __pyx_vtabstruct_6gevent_6_event_Event {
+  struct __pyx_vtabstruct_6gevent_19__abstract_linkable_AbstractLinkable __pyx_base;
+};
+static struct __pyx_vtabstruct_6gevent_6_event_Event *__pyx_vtabptr_6gevent_6_event_Event;
+
+
 031:     """A synchronization primitive that allows one greenlet to wake up one or more others.
+
 032:     It has the same interface as :class:`threading.Event` but works across greenlets.
+
 033: 
+
 034:     An event object manages an internal flag that can be set to true with the
+
 035:     :meth:`set` method and reset to false with the :meth:`clear` method. The :meth:`wait` method
+
 036:     blocks until the flag is true.
+
 037: 
+
 038:     .. note::
+
 039:         The order and timing in which waiting greenlets are awakened is not determined.
+
 040:         As an implementation note, in gevent 1.1 and 1.0, waiting greenlets are awakened in a
+
 041:         undetermined order sometime *after* the current greenlet yields to the event loop. Other greenlets
+
 042:         (those not waiting to be awakened) may run between the current greenlet yielding and
+
 043:         the waiting greenlets being awakened. These details may change in the future.
+
 044:     """
+
 045: 
+
+046:     __slots__ = ('_flag',)
+
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_event_Event->tp_dict, __pyx_n_s_slots, __pyx_tuple__4) < 0) __PYX_ERR(0, 46, __pyx_L1_error)
+  PyType_Modified(__pyx_ptype_6gevent_6_event_Event);
+/* … */
+  __pyx_tuple__4 = PyTuple_Pack(1, __pyx_n_s_flag); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 46, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__4);
+  __Pyx_GIVEREF(__pyx_tuple__4);
+
 047: 
+
+048:     def __init__(self):
+
/* Python wrapper */
+static int __pyx_pw_6gevent_6_event_5Event_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static int __pyx_pw_6gevent_6_event_5Event_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
+  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
+    __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
+  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1;
+  __pyx_r = __pyx_pf_6gevent_6_event_5Event___init__(((struct __pyx_obj_6gevent_6_event_Event *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_6_event_5Event___init__(struct __pyx_obj_6gevent_6_event_Event *__pyx_v_self) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = 0;
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_AddTraceback("gevent._event.Event.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = -1;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+049:         super(Event, self).__init__()
+
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 49, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(((PyObject *)__pyx_ptype_6gevent_6_event_Event));
+  __Pyx_GIVEREF(((PyObject *)__pyx_ptype_6gevent_6_event_Event));
+  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_ptype_6gevent_6_event_Event));
+  __Pyx_INCREF(((PyObject *)__pyx_v_self));
+  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
+  PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_self));
+  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 49, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 49, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __pyx_t_3 = NULL;
+  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+    if (likely(__pyx_t_3)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+      __Pyx_INCREF(__pyx_t_3);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_2, function);
+    }
+  }
+  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 49, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+050:         self._flag = False
+
  __pyx_v_self->_flag = 0;
+
 051: 
+
+052:     def __str__(self):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_event_5Event_3__str__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_6_event_5Event_3__str__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_6_event_5Event_2__str__(((struct __pyx_obj_6gevent_6_event_Event *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_event_5Event_2__str__(struct __pyx_obj_6gevent_6_event_Event *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__str__", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_XDECREF(__pyx_t_6);
+  __Pyx_AddTraceback("gevent._event.Event.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+053:         return '<%s %s _links[%s]>' % (self.__class__.__name__, (self._flag and 'set') or 'clear',
+
  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 53, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 53, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  if (!__pyx_v_self->_flag) {
+    goto __pyx_L4_next_or;
+  } else {
+  }
+  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_n_s_set); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 53, __pyx_L1_error)
+  if (!__pyx_t_3) {
+  } else {
+    __Pyx_INCREF(__pyx_n_s_set);
+    __pyx_t_1 = __pyx_n_s_set;
+    goto __pyx_L3_bool_binop_done;
+  }
+  __pyx_L4_next_or:;
+  __Pyx_INCREF(__pyx_n_s_clear);
+  __pyx_t_1 = __pyx_n_s_clear;
+  __pyx_L3_bool_binop_done:;
+/* … */
+  __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 53, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_5);
+  __Pyx_GIVEREF(__pyx_t_2);
+  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2);
+  __Pyx_GIVEREF(__pyx_t_1);
+  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_4);
+  PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_4);
+  __pyx_t_2 = 0;
+  __pyx_t_1 = 0;
+  __pyx_t_4 = 0;
+  __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_s_s__links_s, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 53, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_4);
+  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+  __pyx_r = __pyx_t_4;
+  __pyx_t_4 = 0;
+  goto __pyx_L0;
+
+054:                                        self.linkcount())
+
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_linkcount); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 54, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_5);
+  __pyx_t_6 = NULL;
+  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
+    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
+    if (likely(__pyx_t_6)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
+      __Pyx_INCREF(__pyx_t_6);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_5, function);
+    }
+  }
+  __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
+  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 54, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_4);
+  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+
 055: 
+
+056:     def is_set(self):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_event_5Event_5is_set(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6gevent_6_event_5Event_4is_set[] = "Event.is_set(self)\nReturn true if and only if the internal flag is true.";
+static PyMethodDef __pyx_mdef_6gevent_6_event_5Event_5is_set = {"is_set", (PyCFunction)__pyx_pw_6gevent_6_event_5Event_5is_set, METH_NOARGS, __pyx_doc_6gevent_6_event_5Event_4is_set};
+static PyObject *__pyx_pw_6gevent_6_event_5Event_5is_set(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("is_set (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_6_event_5Event_4is_set(((struct __pyx_obj_6gevent_6_event_Event *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_event_5Event_4is_set(struct __pyx_obj_6gevent_6_event_Event *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("is_set", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent._event.Event.is_set", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__5 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 56, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__5);
+  __Pyx_GIVEREF(__pyx_tuple__5);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_event_5Event_5is_set, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Event_is_set, NULL, __pyx_n_s_gevent__event, __pyx_d, ((PyObject *)__pyx_codeobj__6)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 56, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_event_Event->tp_dict, __pyx_n_s_is_set, __pyx_t_2) < 0) __PYX_ERR(0, 56, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_6_event_Event);
+  __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__5, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_event_py, __pyx_n_s_is_set, 56, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__6)) __PYX_ERR(0, 56, __pyx_L1_error)
+
 057:         """Return true if and only if the internal flag is true."""
+
+058:         return self._flag
+
  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->_flag); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 58, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
 059: 
+
+060:     def isSet(self):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_event_5Event_7isSet(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6gevent_6_event_5Event_6isSet[] = "Event.isSet(self)";
+static PyMethodDef __pyx_mdef_6gevent_6_event_5Event_7isSet = {"isSet", (PyCFunction)__pyx_pw_6gevent_6_event_5Event_7isSet, METH_NOARGS, __pyx_doc_6gevent_6_event_5Event_6isSet};
+static PyObject *__pyx_pw_6gevent_6_event_5Event_7isSet(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("isSet (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_6_event_5Event_6isSet(((struct __pyx_obj_6gevent_6_event_Event *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_event_5Event_6isSet(struct __pyx_obj_6gevent_6_event_Event *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("isSet", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent._event.Event.isSet", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__7 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 60, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__7);
+  __Pyx_GIVEREF(__pyx_tuple__7);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_event_5Event_7isSet, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Event_isSet, NULL, __pyx_n_s_gevent__event, __pyx_d, ((PyObject *)__pyx_codeobj__8)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 60, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_event_Event->tp_dict, __pyx_n_s_isSet, __pyx_t_2) < 0) __PYX_ERR(0, 60, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_6_event_Event);
+  __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_event_py, __pyx_n_s_isSet, 60, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) __PYX_ERR(0, 60, __pyx_L1_error)
+
 061:         # makes it a better drop-in replacement for threading.Event
+
+062:         return self._flag
+
  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->_flag); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 62, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
 063: 
+
+064:     def ready(self):
+
static PyObject *__pyx_pw_6gevent_6_event_5Event_9ready(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static int __pyx_f_6gevent_6_event_5Event_ready(struct __pyx_obj_6gevent_6_event_Event *__pyx_v_self, int __pyx_skip_dispatch) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("ready", 0);
+  /* Check if called by wrapper */
+  if (unlikely(__pyx_skip_dispatch)) ;
+  /* Check if overridden in Python */
+  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
+    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
+    if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
+    else {
+      PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      #endif
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_ready); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 64, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_6_event_5Event_9ready)) {
+        __Pyx_INCREF(__pyx_t_1);
+        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+          if (likely(__pyx_t_4)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+            __Pyx_INCREF(__pyx_t_4);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_3, function);
+          }
+        }
+        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
+        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 64, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 64, __pyx_L1_error)
+        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+        __pyx_r = __pyx_t_5;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        goto __pyx_L0;
+      }
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+      tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
+      if (unlikely(type_dict_guard != tp_dict_version)) {
+        tp_dict_version = obj_dict_version = 0;
+      }
+      #endif
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    }
+    #endif
+  }
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_WriteUnraisable("gevent._event.Event.ready", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_event_5Event_9ready(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6gevent_6_event_5Event_8ready[] = "Event.ready(self) -> bool";
+static PyMethodDef __pyx_mdef_6gevent_6_event_5Event_9ready = {"ready", (PyCFunction)__pyx_pw_6gevent_6_event_5Event_9ready, METH_NOARGS, __pyx_doc_6gevent_6_event_5Event_8ready};
+static PyObject *__pyx_pw_6gevent_6_event_5Event_9ready(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("ready (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_6_event_5Event_8ready(((struct __pyx_obj_6gevent_6_event_Event *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_event_5Event_8ready(struct __pyx_obj_6gevent_6_event_Event *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("ready", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_f_6gevent_6_event_5Event_ready(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 64, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent._event.Event.ready", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__9 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 64, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__9);
+  __Pyx_GIVEREF(__pyx_tuple__9);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_event_5Event_9ready, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Event_ready, NULL, __pyx_n_s_gevent__event, __pyx_d, ((PyObject *)__pyx_codeobj__10)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 64, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_event_Event->tp_dict, __pyx_n_s_ready, __pyx_t_2) < 0) __PYX_ERR(0, 64, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_6_event_Event);
+  __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__9, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_event_py, __pyx_n_s_ready, 64, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__10)) __PYX_ERR(0, 64, __pyx_L1_error)
+
 065:         # makes it compatible with AsyncResult and Greenlet (for
+
 066:         # example in wait())
+
+067:         return self._flag
+
  __pyx_r = __pyx_v_self->_flag;
+  goto __pyx_L0;
+
 068: 
+
+069:     def set(self):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_event_5Event_11set(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6gevent_6_event_5Event_10set[] = "Event.set(self)\n\n        Set the internal flag to true.\n\n        All greenlets waiting for it to become true are awakened in\n        some order at some time in the future. Greenlets that call\n        :meth:`wait` once the flag is true will not block at all\n        (until :meth:`clear` is called).\n        ";
+static PyMethodDef __pyx_mdef_6gevent_6_event_5Event_11set = {"set", (PyCFunction)__pyx_pw_6gevent_6_event_5Event_11set, METH_NOARGS, __pyx_doc_6gevent_6_event_5Event_10set};
+static PyObject *__pyx_pw_6gevent_6_event_5Event_11set(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("set (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_6_event_5Event_10set(((struct __pyx_obj_6gevent_6_event_Event *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_event_5Event_10set(struct __pyx_obj_6gevent_6_event_Event *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("set", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent._event.Event.set", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__11 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 69, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__11);
+  __Pyx_GIVEREF(__pyx_tuple__11);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_event_5Event_11set, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Event_set, NULL, __pyx_n_s_gevent__event, __pyx_d, ((PyObject *)__pyx_codeobj__12)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 69, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_event_Event->tp_dict, __pyx_n_s_set, __pyx_t_2) < 0) __PYX_ERR(0, 69, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_6_event_Event);
+  __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__11, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_event_py, __pyx_n_s_set, 69, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(0, 69, __pyx_L1_error)
+
 070:         """
+
 071:         Set the internal flag to true.
+
 072: 
+
 073:         All greenlets waiting for it to become true are awakened in
+
 074:         some order at some time in the future. Greenlets that call
+
 075:         :meth:`wait` once the flag is true will not block at all
+
 076:         (until :meth:`clear` is called).
+
 077:         """
+
+078:         self._flag = True
+
  __pyx_v_self->_flag = 1;
+
+079:         self._check_and_notify()
+
  __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_6_event_Event *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._check_and_notify(((struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 79, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 080: 
+
+081:     def clear(self):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_event_5Event_13clear(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6gevent_6_event_5Event_12clear[] = "Event.clear(self)\n\n        Reset the internal flag to false.\n\n        Subsequently, threads calling :meth:`wait` will block until\n        :meth:`set` is called to set the internal flag to true again.\n        ";
+static PyMethodDef __pyx_mdef_6gevent_6_event_5Event_13clear = {"clear", (PyCFunction)__pyx_pw_6gevent_6_event_5Event_13clear, METH_NOARGS, __pyx_doc_6gevent_6_event_5Event_12clear};
+static PyObject *__pyx_pw_6gevent_6_event_5Event_13clear(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("clear (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_6_event_5Event_12clear(((struct __pyx_obj_6gevent_6_event_Event *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_event_5Event_12clear(struct __pyx_obj_6gevent_6_event_Event *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("clear", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__13 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 81, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__13);
+  __Pyx_GIVEREF(__pyx_tuple__13);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_event_5Event_13clear, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Event_clear, NULL, __pyx_n_s_gevent__event, __pyx_d, ((PyObject *)__pyx_codeobj__14)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 81, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_event_Event->tp_dict, __pyx_n_s_clear, __pyx_t_2) < 0) __PYX_ERR(0, 81, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_6_event_Event);
+  __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__13, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_event_py, __pyx_n_s_clear, 81, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__14)) __PYX_ERR(0, 81, __pyx_L1_error)
+
 082:         """
+
 083:         Reset the internal flag to false.
+
 084: 
+
 085:         Subsequently, threads calling :meth:`wait` will block until
+
 086:         :meth:`set` is called to set the internal flag to true again.
+
 087:         """
+
+088:         self._flag = False
+
  __pyx_v_self->_flag = 0;
+
 089: 
+
+090:     def _wait_return_value(self, waited, wait_success):
+
static PyObject *__pyx_f_6gevent_6_event_5Event__wait_return_value(struct __pyx_obj_6gevent_6_event_Event *__pyx_v_self, PyObject *__pyx_v_waited, PyObject *__pyx_v_wait_success) {
+  int __pyx_v_flag;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_wait_return_value", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_AddTraceback("gevent._event.Event._wait_return_value", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
 091:         # To avoid the race condition outlined in http://bugs.python.org/issue13502,
+
 092:         # if we had to wait, then we need to return whether or not
+
 093:         # the condition got changed. Otherwise we simply echo
+
 094:         # the current state of the flag (which should be true)
+
+095:         if not waited:
+
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_waited); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 95, __pyx_L1_error)
+  __pyx_t_2 = ((!__pyx_t_1) != 0);
+  if (__pyx_t_2) {
+/* … */
+  }
+
+096:             flag = self._flag
+
    __pyx_t_2 = __pyx_v_self->_flag;
+    __pyx_v_flag = __pyx_t_2;
+
+097:             assert flag, "if we didn't wait we should already be set"
+
    #ifndef CYTHON_WITHOUT_ASSERTIONS
+    if (unlikely(!Py_OptimizeFlag)) {
+      if (unlikely(!(__pyx_v_flag != 0))) {
+        PyErr_SetObject(PyExc_AssertionError, __pyx_kp_s_if_we_didn_t_wait_we_should_alre);
+        __PYX_ERR(0, 97, __pyx_L1_error)
+      }
+    }
+    #endif
+
+098:             return flag
+
    __Pyx_XDECREF(__pyx_r);
+    __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_v_flag); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 98, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __pyx_r = __pyx_t_3;
+    __pyx_t_3 = 0;
+    goto __pyx_L0;
+
 099: 
+
+100:         return wait_success
+
  __Pyx_XDECREF(__pyx_r);
+  __Pyx_INCREF(__pyx_v_wait_success);
+  __pyx_r = __pyx_v_wait_success;
+  goto __pyx_L0;
+
 101: 
+
+102:     def wait(self, timeout=None):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_event_5Event_15wait(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_6gevent_6_event_5Event_14wait[] = "Event.wait(self, timeout=None)\n\n        Block until the internal flag is true.\n\n        If the internal flag is true on entry, return immediately. Otherwise,\n        block until another thread (greenlet) calls :meth:`set` to set the flag to true,\n        or until the optional timeout occurs.\n\n        When the *timeout* argument is present and not ``None``, it should be a\n        floating point number specifying a timeout for the operation in seconds\n        (or fractions thereof).\n\n        :return: This method returns true if and only if the internal flag has been set to\n            true, either before the wait call or after the wait starts, so it will\n            always return ``True`` except if a timeout is given and the operation\n            times out.\n\n        .. versionchanged:: 1.1\n            The return value represents the flag during the elapsed wait, not\n            just after it elapses. This solves a race condition if one greenlet\n            sets and then clears the flag without switching, while other greenlets\n            are waiting. When the waiters wake up, this will return True; previously,\n            they would still wake up, but the return value would be False. This is most\n            noticeable when the *timeout* is present.\n        ";
+static PyMethodDef __pyx_mdef_6gevent_6_event_5Event_15wait = {"wait", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_6_event_5Event_15wait, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_6_event_5Event_14wait};
+static PyObject *__pyx_pw_6gevent_6_event_5Event_15wait(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_timeout = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("wait (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_timeout,0};
+    PyObject* values[1] = {0};
+    values[0] = ((PyObject *)Py_None);
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_timeout);
+          if (value) { values[0] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "wait") < 0)) __PYX_ERR(0, 102, __pyx_L3_error)
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    __pyx_v_timeout = values[0];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("wait", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 102, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent._event.Event.wait", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_6_event_5Event_14wait(((struct __pyx_obj_6gevent_6_event_Event *)__pyx_v_self), __pyx_v_timeout);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_event_5Event_14wait(struct __pyx_obj_6gevent_6_event_Event *__pyx_v_self, PyObject *__pyx_v_timeout) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("wait", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent._event.Event.wait", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__15 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_timeout); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(0, 102, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__15);
+  __Pyx_GIVEREF(__pyx_tuple__15);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_event_5Event_15wait, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Event_wait, NULL, __pyx_n_s_gevent__event, __pyx_d, ((PyObject *)__pyx_codeobj__16)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 102, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_event_Event->tp_dict, __pyx_n_s_wait, __pyx_t_2) < 0) __PYX_ERR(0, 102, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_6_event_Event);
+  __pyx_codeobj__16 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__15, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_event_py, __pyx_n_s_wait, 102, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__16)) __PYX_ERR(0, 102, __pyx_L1_error)
+
 103:         """
+
 104:         Block until the internal flag is true.
+
 105: 
+
 106:         If the internal flag is true on entry, return immediately. Otherwise,
+
 107:         block until another thread (greenlet) calls :meth:`set` to set the flag to true,
+
 108:         or until the optional timeout occurs.
+
 109: 
+
 110:         When the *timeout* argument is present and not ``None``, it should be a
+
 111:         floating point number specifying a timeout for the operation in seconds
+
 112:         (or fractions thereof).
+
 113: 
+
 114:         :return: This method returns true if and only if the internal flag has been set to
+
 115:             true, either before the wait call or after the wait starts, so it will
+
 116:             always return ``True`` except if a timeout is given and the operation
+
 117:             times out.
+
 118: 
+
 119:         .. versionchanged:: 1.1
+
 120:             The return value represents the flag during the elapsed wait, not
+
 121:             just after it elapses. This solves a race condition if one greenlet
+
 122:             sets and then clears the flag without switching, while other greenlets
+
 123:             are waiting. When the waiters wake up, this will return True; previously,
+
 124:             they would still wake up, but the return value would be False. This is most
+
 125:             noticeable when the *timeout* is present.
+
 126:         """
+
+127:         return self._wait(timeout)
+
  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_2.__pyx_n = 1;
+  __pyx_t_2.timeout = __pyx_v_timeout;
+  __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_6_event_Event *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._wait(((struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *)__pyx_v_self), &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 127, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
 128: 
+
+129:     def _reset_internal_locks(self): # pragma: no cover
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_event_5Event_17_reset_internal_locks(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6gevent_6_event_5Event_16_reset_internal_locks[] = "Event._reset_internal_locks(self)";
+static PyMethodDef __pyx_mdef_6gevent_6_event_5Event_17_reset_internal_locks = {"_reset_internal_locks", (PyCFunction)__pyx_pw_6gevent_6_event_5Event_17_reset_internal_locks, METH_NOARGS, __pyx_doc_6gevent_6_event_5Event_16_reset_internal_locks};
+static PyObject *__pyx_pw_6gevent_6_event_5Event_17_reset_internal_locks(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_reset_internal_locks (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_6_event_5Event_16_reset_internal_locks(((struct __pyx_obj_6gevent_6_event_Event *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_event_5Event_16_reset_internal_locks(CYTHON_UNUSED struct __pyx_obj_6gevent_6_event_Event *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_reset_internal_locks", 0);
+
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__17 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(0, 129, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__17);
+  __Pyx_GIVEREF(__pyx_tuple__17);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_event_5Event_17_reset_internal_locks, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Event__reset_internal_locks, NULL, __pyx_n_s_gevent__event, __pyx_d, ((PyObject *)__pyx_codeobj__18)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 129, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_event_Event->tp_dict, __pyx_n_s_reset_internal_locks, __pyx_t_2) < 0) __PYX_ERR(0, 129, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_6_event_Event);
+  __pyx_codeobj__18 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__17, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_event_py, __pyx_n_s_reset_internal_locks, 129, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__18)) __PYX_ERR(0, 129, __pyx_L1_error)
+
 130:         # for compatibility with threading.Event
+
 131:         #  Exception AttributeError: AttributeError("'Event' object has no attribute '_reset_internal_locks'",)
+
 132:         # in <module 'threading' from '/usr/lib/python2.7/threading.pyc'> ignored
+
 133:         pass
+
 134: 
+
 135: 
+
+136: class AsyncResult(AbstractLinkable): # pylint:disable=undefined-variable
+
struct __pyx_vtabstruct_6gevent_6_event_AsyncResult {
+  struct __pyx_vtabstruct_6gevent_19__abstract_linkable_AbstractLinkable __pyx_base;
+  PyObject *(*get)(struct __pyx_obj_6gevent_6_event_AsyncResult *, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_6_event_11AsyncResult_get *__pyx_optional_args);
+  int (*successful)(struct __pyx_obj_6gevent_6_event_AsyncResult *, int __pyx_skip_dispatch);
+  PyObject *(*wait)(struct __pyx_obj_6gevent_6_event_AsyncResult *, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_6_event_11AsyncResult_wait *__pyx_optional_args);
+  int (*done)(struct __pyx_obj_6gevent_6_event_AsyncResult *, int __pyx_skip_dispatch);
+  int (*cancel)(struct __pyx_obj_6gevent_6_event_AsyncResult *, int __pyx_skip_dispatch);
+  int (*cancelled)(struct __pyx_obj_6gevent_6_event_AsyncResult *, int __pyx_skip_dispatch);
+};
+static struct __pyx_vtabstruct_6gevent_6_event_AsyncResult *__pyx_vtabptr_6gevent_6_event_AsyncResult;
+
 137:     """A one-time event that stores a value or an exception.
+
 138: 
+
 139:     Like :class:`Event` it wakes up all the waiters when :meth:`set` or :meth:`set_exception`
+
 140:     is called. Waiters may receive the passed value or exception by calling :meth:`get`
+
 141:     instead of :meth:`wait`. An :class:`AsyncResult` instance cannot be reset.
+
 142: 
+
 143:     To pass a value call :meth:`set`. Calls to :meth:`get` (those that are currently blocking as well as
+
 144:     those made in the future) will return the value:
+
 145: 
+
 146:         >>> result = AsyncResult()
+
 147:         >>> result.set(100)
+
 148:         >>> result.get()
+
 149:         100
+
 150: 
+
 151:     To pass an exception call :meth:`set_exception`. This will cause :meth:`get` to raise that exception:
+
 152: 
+
 153:         >>> result = AsyncResult()
+
 154:         >>> result.set_exception(RuntimeError('failure'))
+
 155:         >>> result.get()
+
 156:         Traceback (most recent call last):
+
 157:          ...
+
 158:         RuntimeError: failure
+
 159: 
+
 160:     :class:`AsyncResult` implements :meth:`__call__` and thus can be used as :meth:`link` target:
+
 161: 
+
 162:         >>> import gevent
+
 163:         >>> result = AsyncResult()
+
 164:         >>> gevent.spawn(lambda : 1/0).link(result)
+
 165:         >>> try:
+
 166:         ...     result.get()
+
 167:         ... except ZeroDivisionError:
+
 168:         ...     print('ZeroDivisionError')
+
 169:         ZeroDivisionError
+
 170: 
+
 171:     .. note::
+
 172:         The order and timing in which waiting greenlets are awakened is not determined.
+
 173:         As an implementation note, in gevent 1.1 and 1.0, waiting greenlets are awakened in a
+
 174:         undetermined order sometime *after* the current greenlet yields to the event loop. Other greenlets
+
 175:         (those not waiting to be awakened) may run between the current greenlet yielding and
+
 176:         the waiting greenlets being awakened. These details may change in the future.
+
 177: 
+
 178:     .. versionchanged:: 1.1
+
 179:        The exact order in which waiting greenlets are awakened is not the same
+
 180:        as in 1.0.
+
 181:     .. versionchanged:: 1.1
+
 182:        Callbacks :meth:`linked <rawlink>` to this object are required to be hashable, and duplicates are
+
 183:        merged.
+
 184:     """
+
 185: 
+
+186:     __slots__ = ('_value', '_exc_info', '_imap_task_index')
+
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_event_AsyncResult->tp_dict, __pyx_n_s_slots, __pyx_tuple__19) < 0) __PYX_ERR(0, 186, __pyx_L1_error)
+  PyType_Modified(__pyx_ptype_6gevent_6_event_AsyncResult);
+/* … */
+  __pyx_tuple__19 = PyTuple_Pack(3, __pyx_n_s_value_2, __pyx_n_s_exc_info_2, __pyx_n_s_imap_task_index); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(0, 186, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__19);
+  __Pyx_GIVEREF(__pyx_tuple__19);
+
 187: 
+
+188:     def __init__(self):
+
/* Python wrapper */
+static int __pyx_pw_6gevent_6_event_11AsyncResult_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static int __pyx_pw_6gevent_6_event_11AsyncResult_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
+  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
+    __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
+  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1;
+  __pyx_r = __pyx_pf_6gevent_6_event_11AsyncResult___init__(((struct __pyx_obj_6gevent_6_event_AsyncResult *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_6_event_11AsyncResult___init__(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = 0;
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_AddTraceback("gevent._event.AsyncResult.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = -1;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+189:         super(AsyncResult, self).__init__()
+
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 189, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(((PyObject *)__pyx_ptype_6gevent_6_event_AsyncResult));
+  __Pyx_GIVEREF(((PyObject *)__pyx_ptype_6gevent_6_event_AsyncResult));
+  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_ptype_6gevent_6_event_AsyncResult));
+  __Pyx_INCREF(((PyObject *)__pyx_v_self));
+  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
+  PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_self));
+  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 189, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 189, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __pyx_t_3 = NULL;
+  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+    if (likely(__pyx_t_3)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+      __Pyx_INCREF(__pyx_t_3);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_2, function);
+    }
+  }
+  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 189, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+190:         self._value = _NONE
+
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_NONE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 190, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_1);
+  __Pyx_GOTREF(__pyx_v_self->_value);
+  __Pyx_DECREF(__pyx_v_self->_value);
+  __pyx_v_self->_value = __pyx_t_1;
+  __pyx_t_1 = 0;
+
+191:         self._exc_info = ()
+
  __Pyx_INCREF(__pyx_empty_tuple);
+  __Pyx_GIVEREF(__pyx_empty_tuple);
+  __Pyx_GOTREF(__pyx_v_self->_exc_info);
+  __Pyx_DECREF(__pyx_v_self->_exc_info);
+  __pyx_v_self->_exc_info = __pyx_empty_tuple;
+
 192: 
+
 193:     @property
+
+194:     def _exception(self):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_10_exception_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_10_exception_1__get__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_6_event_11AsyncResult_10_exception___get__(((struct __pyx_obj_6gevent_6_event_AsyncResult *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_event_11AsyncResult_10_exception___get__(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_AddTraceback("gevent._event.AsyncResult._exception.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+195:         return self._exc_info[1] if self._exc_info else _NONE
+
  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_2 = (__pyx_v_self->_exc_info != Py_None)&&(PyTuple_GET_SIZE(__pyx_v_self->_exc_info) != 0);
+  if (__pyx_t_2) {
+    if (unlikely(__pyx_v_self->_exc_info == Py_None)) {
+      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
+      __PYX_ERR(0, 195, __pyx_L1_error)
+    }
+    __pyx_t_3 = __Pyx_GetItemInt_Tuple(__pyx_v_self->_exc_info, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 195, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __pyx_t_1 = __pyx_t_3;
+    __pyx_t_3 = 0;
+  } else {
+    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_NONE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 195, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __pyx_t_1 = __pyx_t_3;
+    __pyx_t_3 = 0;
+  }
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
 196: 
+
 197:     @property
+
+198:     def value(self):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_5value_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_5value_1__get__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_6_event_11AsyncResult_5value___get__(((struct __pyx_obj_6gevent_6_event_AsyncResult *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_event_11AsyncResult_5value___get__(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_AddTraceback("gevent._event.AsyncResult.value.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
 199:         """
+
 200:         Holds the value passed to :meth:`set` if :meth:`set` was called. Otherwise,
+
 201:         ``None``
+
 202:         """
+
+203:         return self._value if self._value is not _NONE else None
+
  __Pyx_XDECREF(__pyx_r);
+  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_NONE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 203, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = (__pyx_v_self->_value != __pyx_t_2);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  if ((__pyx_t_3 != 0)) {
+    __Pyx_INCREF(__pyx_v_self->_value);
+    __pyx_t_1 = __pyx_v_self->_value;
+  } else {
+    __Pyx_INCREF(Py_None);
+    __pyx_t_1 = Py_None;
+  }
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
 204: 
+
 205:     @property
+
+206:     def exc_info(self):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_8exc_info_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_8exc_info_1__get__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_6_event_11AsyncResult_8exc_info___get__(((struct __pyx_obj_6gevent_6_event_AsyncResult *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_event_11AsyncResult_8exc_info___get__(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_XDECREF(__pyx_t_6);
+  __Pyx_XDECREF(__pyx_t_7);
+  __Pyx_AddTraceback("gevent._event.AsyncResult.exc_info.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
 207:         """
+
 208:         The three-tuple of exception information if :meth:`set_exception` was called.
+
 209:         """
+
+210:         if self._exc_info:
+
  __pyx_t_1 = (__pyx_v_self->_exc_info != Py_None)&&(PyTuple_GET_SIZE(__pyx_v_self->_exc_info) != 0);
+  if (__pyx_t_1) {
+/* … */
+  }
+
+211:             return (self._exc_info[0], self._exc_info[1], load_traceback(self._exc_info[2]))
+
    __Pyx_XDECREF(__pyx_r);
+    if (unlikely(__pyx_v_self->_exc_info == Py_None)) {
+      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
+      __PYX_ERR(0, 211, __pyx_L1_error)
+    }
+    __pyx_t_2 = __Pyx_GetItemInt_Tuple(__pyx_v_self->_exc_info, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 211, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    if (unlikely(__pyx_v_self->_exc_info == Py_None)) {
+      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
+      __PYX_ERR(0, 211, __pyx_L1_error)
+    }
+    __pyx_t_3 = __Pyx_GetItemInt_Tuple(__pyx_v_self->_exc_info, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 211, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    if (unlikely(__pyx_v_self->_exc_info == Py_None)) {
+      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
+      __PYX_ERR(0, 211, __pyx_L1_error)
+    }
+    __pyx_t_5 = __Pyx_GetItemInt_Tuple(__pyx_v_self->_exc_info, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 211, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_5);
+    __Pyx_INCREF(__pyx_v_6gevent_6_event_load_traceback);
+    __pyx_t_6 = __pyx_v_6gevent_6_event_load_traceback; __pyx_t_7 = NULL;
+    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
+      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
+      if (likely(__pyx_t_7)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
+        __Pyx_INCREF(__pyx_t_7);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_6, function);
+      }
+    }
+    __pyx_t_4 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_5);
+    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 211, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+    __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 211, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_6);
+    __Pyx_GIVEREF(__pyx_t_2);
+    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2);
+    __Pyx_GIVEREF(__pyx_t_3);
+    PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_3);
+    __Pyx_GIVEREF(__pyx_t_4);
+    PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_4);
+    __pyx_t_2 = 0;
+    __pyx_t_3 = 0;
+    __pyx_t_4 = 0;
+    __pyx_r = __pyx_t_6;
+    __pyx_t_6 = 0;
+    goto __pyx_L0;
+
+212:         return ()
+
  __Pyx_XDECREF(__pyx_r);
+  __Pyx_INCREF(__pyx_empty_tuple);
+  __pyx_r = __pyx_empty_tuple;
+  goto __pyx_L0;
+
 213: 
+
+214:     def __str__(self):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_3__str__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_3__str__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_6_event_11AsyncResult_2__str__(((struct __pyx_obj_6gevent_6_event_AsyncResult *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_event_11AsyncResult_2__str__(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self) {
+  PyObject *__pyx_v_result = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__str__", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_6);
+  __Pyx_AddTraceback("gevent._event.AsyncResult.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_result);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+215:         result = '<%s ' % (self.__class__.__name__, )
+
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 215, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 215, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 215, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_2);
+  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
+  __pyx_t_2 = 0;
+  __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_s, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 215, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_v_result = ((PyObject*)__pyx_t_2);
+  __pyx_t_2 = 0;
+
+216:         if self.value is not None or self._exception is not _NONE:
+
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 216, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_4 = (__pyx_t_2 != Py_None);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_5 = (__pyx_t_4 != 0);
+  if (!__pyx_t_5) {
+  } else {
+    __pyx_t_3 = __pyx_t_5;
+    goto __pyx_L4_bool_binop_done;
+  }
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_exception); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 216, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_NONE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 216, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_5 = (__pyx_t_2 != __pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_4 = (__pyx_t_5 != 0);
+  __pyx_t_3 = __pyx_t_4;
+  __pyx_L4_bool_binop_done:;
+  if (__pyx_t_3) {
+/* … */
+  }
+
+217:             result += 'value=%r ' % self.value
+
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 217, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __pyx_t_2 = __Pyx_PyString_FormatSafe(__pyx_kp_s_value_r, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 217, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 217, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_1));
+    __pyx_t_1 = 0;
+
+218:         if self._exception is not None and self._exception is not _NONE:
+
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_exception); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 218, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_4 = (__pyx_t_1 != Py_None);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_5 = (__pyx_t_4 != 0);
+  if (__pyx_t_5) {
+  } else {
+    __pyx_t_3 = __pyx_t_5;
+    goto __pyx_L7_bool_binop_done;
+  }
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_exception); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 218, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_NONE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 218, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_5 = (__pyx_t_1 != __pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_4 = (__pyx_t_5 != 0);
+  __pyx_t_3 = __pyx_t_4;
+  __pyx_L7_bool_binop_done:;
+  if (__pyx_t_3) {
+/* … */
+  }
+
+219:             result += 'exception=%r ' % self._exception
+
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_exception); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 219, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_1 = __Pyx_PyString_FormatSafe(__pyx_kp_s_exception_r, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 219, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 219, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_2));
+    __pyx_t_2 = 0;
+
+220:         if self._exception is _NONE:
+
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_exception); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 220, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_NONE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 220, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_3 = (__pyx_t_2 == __pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_4 = (__pyx_t_3 != 0);
+  if (__pyx_t_4) {
+/* … */
+  }
+
+221:             result += 'unset '
+
    __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_kp_s_unset); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 221, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_1));
+    __pyx_t_1 = 0;
+
+222:         return result + ' _links[%s]>' % self.linkcount()
+
  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_linkcount); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 222, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_6 = NULL;
+  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
+    if (likely(__pyx_t_6)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+      __Pyx_INCREF(__pyx_t_6);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_2, function);
+    }
+  }
+  __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 222, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_2 = __Pyx_PyString_FormatSafe(__pyx_kp_s_links_s, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 222, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_1 = PyNumber_Add(__pyx_v_result, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 222, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
 223: 
+
+224:     def ready(self):
+
static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_5ready(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static int __pyx_f_6gevent_6_event_11AsyncResult_ready(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self, int __pyx_skip_dispatch) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("ready", 0);
+  /* Check if called by wrapper */
+  if (unlikely(__pyx_skip_dispatch)) ;
+  /* Check if overridden in Python */
+  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
+    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
+    if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
+    else {
+      PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      #endif
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_ready); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 224, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_6_event_11AsyncResult_5ready)) {
+        __Pyx_INCREF(__pyx_t_1);
+        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+          if (likely(__pyx_t_4)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+            __Pyx_INCREF(__pyx_t_4);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_3, function);
+          }
+        }
+        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
+        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 224, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 224, __pyx_L1_error)
+        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+        __pyx_r = __pyx_t_5;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        goto __pyx_L0;
+      }
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+      tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
+      if (unlikely(type_dict_guard != tp_dict_version)) {
+        tp_dict_version = obj_dict_version = 0;
+      }
+      #endif
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    }
+    #endif
+  }
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_WriteUnraisable("gevent._event.AsyncResult.ready", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_5ready(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6gevent_6_event_11AsyncResult_4ready[] = "AsyncResult.ready(self) -> bool\nReturn true if and only if it holds a value or an exception";
+static PyMethodDef __pyx_mdef_6gevent_6_event_11AsyncResult_5ready = {"ready", (PyCFunction)__pyx_pw_6gevent_6_event_11AsyncResult_5ready, METH_NOARGS, __pyx_doc_6gevent_6_event_11AsyncResult_4ready};
+static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_5ready(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("ready (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_6_event_11AsyncResult_4ready(((struct __pyx_obj_6gevent_6_event_AsyncResult *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_event_11AsyncResult_4ready(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("ready", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_f_6gevent_6_event_11AsyncResult_ready(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 224, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent._event.AsyncResult.ready", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__20 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(0, 224, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__20);
+  __Pyx_GIVEREF(__pyx_tuple__20);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_event_11AsyncResult_5ready, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AsyncResult_ready, NULL, __pyx_n_s_gevent__event, __pyx_d, ((PyObject *)__pyx_codeobj__21)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 224, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_event_AsyncResult->tp_dict, __pyx_n_s_ready, __pyx_t_2) < 0) __PYX_ERR(0, 224, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_6_event_AsyncResult);
+  __pyx_codeobj__21 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__20, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_event_py, __pyx_n_s_ready, 224, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__21)) __PYX_ERR(0, 224, __pyx_L1_error)
+
 225:         """Return true if and only if it holds a value or an exception"""
+
+226:         return self._exc_info or self._value is not _NONE
+
  __pyx_t_6 = (__pyx_v_self->_exc_info != Py_None)&&(PyTuple_GET_SIZE(__pyx_v_self->_exc_info) != 0);
+  if (!__pyx_t_6) {
+  } else {
+    __pyx_t_5 = __pyx_t_6;
+    goto __pyx_L3_bool_binop_done;
+  }
+  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_NONE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 226, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_6 = (__pyx_v_self->_value != __pyx_t_1);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_7 = (__pyx_t_6 != 0);
+  __pyx_t_5 = __pyx_t_7;
+  __pyx_L3_bool_binop_done:;
+  __pyx_r = __pyx_t_5;
+  goto __pyx_L0;
+
 227: 
+
+228:     def successful(self):
+
static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_7successful(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static int __pyx_f_6gevent_6_event_11AsyncResult_successful(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self, int __pyx_skip_dispatch) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("successful", 0);
+  /* Check if called by wrapper */
+  if (unlikely(__pyx_skip_dispatch)) ;
+  /* Check if overridden in Python */
+  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
+    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
+    if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
+    else {
+      PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      #endif
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_successful); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 228, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_6_event_11AsyncResult_7successful)) {
+        __Pyx_INCREF(__pyx_t_1);
+        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+          if (likely(__pyx_t_4)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+            __Pyx_INCREF(__pyx_t_4);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_3, function);
+          }
+        }
+        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
+        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 228, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 228, __pyx_L1_error)
+        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+        __pyx_r = __pyx_t_5;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        goto __pyx_L0;
+      }
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+      tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
+      if (unlikely(type_dict_guard != tp_dict_version)) {
+        tp_dict_version = obj_dict_version = 0;
+      }
+      #endif
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    }
+    #endif
+  }
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_WriteUnraisable("gevent._event.AsyncResult.successful", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_7successful(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6gevent_6_event_11AsyncResult_6successful[] = "AsyncResult.successful(self) -> bool\nReturn true if and only if it is ready and holds a value";
+static PyMethodDef __pyx_mdef_6gevent_6_event_11AsyncResult_7successful = {"successful", (PyCFunction)__pyx_pw_6gevent_6_event_11AsyncResult_7successful, METH_NOARGS, __pyx_doc_6gevent_6_event_11AsyncResult_6successful};
+static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_7successful(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("successful (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_6_event_11AsyncResult_6successful(((struct __pyx_obj_6gevent_6_event_AsyncResult *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_event_11AsyncResult_6successful(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("successful", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_f_6gevent_6_event_11AsyncResult_successful(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 228, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent._event.AsyncResult.successful", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__22 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(0, 228, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__22);
+  __Pyx_GIVEREF(__pyx_tuple__22);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_event_11AsyncResult_7successful, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AsyncResult_successful, NULL, __pyx_n_s_gevent__event, __pyx_d, ((PyObject *)__pyx_codeobj__23)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 228, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_event_AsyncResult->tp_dict, __pyx_n_s_successful, __pyx_t_2) < 0) __PYX_ERR(0, 228, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_6_event_AsyncResult);
+  __pyx_codeobj__23 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__22, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_event_py, __pyx_n_s_successful, 228, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__23)) __PYX_ERR(0, 228, __pyx_L1_error)
+
 229:         """Return true if and only if it is ready and holds a value"""
+
+230:         return self._value is not _NONE
+
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_NONE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 230, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_5 = (__pyx_v_self->_value != __pyx_t_1);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_r = __pyx_t_5;
+  goto __pyx_L0;
+
 231: 
+
 232:     @property
+
+233:     def exception(self):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_9exception_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_9exception_1__get__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_6_event_11AsyncResult_9exception___get__(((struct __pyx_obj_6gevent_6_event_AsyncResult *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_event_11AsyncResult_9exception___get__(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_AddTraceback("gevent._event.AsyncResult.exception.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
 234:         """Holds the exception instance passed to :meth:`set_exception` if :meth:`set_exception` was called.
+
 235:         Otherwise ``None``."""
+
+236:         if self._exc_info:
+
  __pyx_t_1 = (__pyx_v_self->_exc_info != Py_None)&&(PyTuple_GET_SIZE(__pyx_v_self->_exc_info) != 0);
+  if (__pyx_t_1) {
+/* … */
+  }
+
+237:             return self._exc_info[1]
+
    __Pyx_XDECREF(__pyx_r);
+    if (unlikely(__pyx_v_self->_exc_info == Py_None)) {
+      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
+      __PYX_ERR(0, 237, __pyx_L1_error)
+    }
+    __pyx_t_2 = __Pyx_GetItemInt_Tuple(__pyx_v_self->_exc_info, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 237, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_r = __pyx_t_2;
+    __pyx_t_2 = 0;
+    goto __pyx_L0;
+
 238: 
+
+239:     def set(self, value=None):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_9set(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_6gevent_6_event_11AsyncResult_8set[] = "AsyncResult.set(self, value=None)\nStore the value and wake up any waiters.\n\n        All greenlets blocking on :meth:`get` or :meth:`wait` are awakened.\n        Subsequent calls to :meth:`wait` and :meth:`get` will not block at all.\n        ";
+static PyMethodDef __pyx_mdef_6gevent_6_event_11AsyncResult_9set = {"set", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_6_event_11AsyncResult_9set, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_6_event_11AsyncResult_8set};
+static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_9set(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_value = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("set (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_value,0};
+    PyObject* values[1] = {0};
+    values[0] = ((PyObject *)Py_None);
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value);
+          if (value) { values[0] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set") < 0)) __PYX_ERR(0, 239, __pyx_L3_error)
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    __pyx_v_value = values[0];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("set", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 239, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent._event.AsyncResult.set", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_6_event_11AsyncResult_8set(((struct __pyx_obj_6gevent_6_event_AsyncResult *)__pyx_v_self), __pyx_v_value);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_event_11AsyncResult_8set(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self, PyObject *__pyx_v_value) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("set", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent._event.AsyncResult.set", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__24 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_value); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(0, 239, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__24);
+  __Pyx_GIVEREF(__pyx_tuple__24);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_event_11AsyncResult_9set, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AsyncResult_set, NULL, __pyx_n_s_gevent__event, __pyx_d, ((PyObject *)__pyx_codeobj__25)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 239, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_event_AsyncResult->tp_dict, __pyx_n_s_set, __pyx_t_2) < 0) __PYX_ERR(0, 239, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_6_event_AsyncResult);
+  __pyx_codeobj__25 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__24, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_event_py, __pyx_n_s_set, 239, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__25)) __PYX_ERR(0, 239, __pyx_L1_error)
+
 240:         """Store the value and wake up any waiters.
+
 241: 
+
 242:         All greenlets blocking on :meth:`get` or :meth:`wait` are awakened.
+
 243:         Subsequent calls to :meth:`wait` and :meth:`get` will not block at all.
+
 244:         """
+
+245:         self._value = value
+
  __Pyx_INCREF(__pyx_v_value);
+  __Pyx_GIVEREF(__pyx_v_value);
+  __Pyx_GOTREF(__pyx_v_self->_value);
+  __Pyx_DECREF(__pyx_v_self->_value);
+  __pyx_v_self->_value = __pyx_v_value;
+
+246:         self._check_and_notify()
+
  __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_6_event_AsyncResult *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._check_and_notify(((struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 246, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 247: 
+
+248:     def set_exception(self, exception, exc_info=None):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_11set_exception(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_6gevent_6_event_11AsyncResult_10set_exception[] = "AsyncResult.set_exception(self, exception, exc_info=None)\nStore the exception and wake up any waiters.\n\n        All greenlets blocking on :meth:`get` or :meth:`wait` are awakened.\n        Subsequent calls to :meth:`wait` and :meth:`get` will not block at all.\n\n        :keyword tuple exc_info: If given, a standard three-tuple of type, value, :class:`traceback`\n            as returned by :func:`sys.exc_info`. This will be used when the exception\n            is re-raised to propagate the correct traceback.\n        ";
+static PyMethodDef __pyx_mdef_6gevent_6_event_11AsyncResult_11set_exception = {"set_exception", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_6_event_11AsyncResult_11set_exception, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_6_event_11AsyncResult_10set_exception};
+static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_11set_exception(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_exception = 0;
+  PyObject *__pyx_v_exc_info = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("set_exception (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_exception_2,&__pyx_n_s_exc_info,0};
+    PyObject* values[2] = {0,0};
+    values[1] = ((PyObject *)Py_None);
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_exception_2)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_exc_info);
+          if (value) { values[1] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_exception") < 0)) __PYX_ERR(0, 248, __pyx_L3_error)
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    __pyx_v_exception = values[0];
+    __pyx_v_exc_info = values[1];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("set_exception", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 248, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent._event.AsyncResult.set_exception", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_6_event_11AsyncResult_10set_exception(((struct __pyx_obj_6gevent_6_event_AsyncResult *)__pyx_v_self), __pyx_v_exception, __pyx_v_exc_info);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_event_11AsyncResult_10set_exception(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self, PyObject *__pyx_v_exception, PyObject *__pyx_v_exc_info) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("set_exception", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_XDECREF(__pyx_t_6);
+  __Pyx_XDECREF(__pyx_t_7);
+  __Pyx_AddTraceback("gevent._event.AsyncResult.set_exception", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__26 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_exception_2, __pyx_n_s_exc_info); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(0, 248, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__26);
+  __Pyx_GIVEREF(__pyx_tuple__26);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_event_11AsyncResult_11set_exception, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AsyncResult_set_exception, NULL, __pyx_n_s_gevent__event, __pyx_d, ((PyObject *)__pyx_codeobj__27)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 248, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_event_AsyncResult->tp_dict, __pyx_n_s_set_exception, __pyx_t_2) < 0) __PYX_ERR(0, 248, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_6_event_AsyncResult);
+  __pyx_codeobj__27 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__26, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_event_py, __pyx_n_s_set_exception, 248, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__27)) __PYX_ERR(0, 248, __pyx_L1_error)
+
 249:         """Store the exception and wake up any waiters.
+
 250: 
+
 251:         All greenlets blocking on :meth:`get` or :meth:`wait` are awakened.
+
 252:         Subsequent calls to :meth:`wait` and :meth:`get` will not block at all.
+
 253: 
+
 254:         :keyword tuple exc_info: If given, a standard three-tuple of type, value, :class:`traceback`
+
 255:             as returned by :func:`sys.exc_info`. This will be used when the exception
+
 256:             is re-raised to propagate the correct traceback.
+
 257:         """
+
+258:         if exc_info:
+
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_exc_info); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 258, __pyx_L1_error)
+  if (__pyx_t_1) {
+/* … */
+    goto __pyx_L3;
+  }
+
+259:             self._exc_info = (exc_info[0], exc_info[1], dump_traceback(exc_info[2]))
+
    __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_exc_info, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 259, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_exc_info, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 259, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_exc_info, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 259, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_5);
+    __Pyx_INCREF(__pyx_v_6gevent_6_event_dump_traceback);
+    __pyx_t_6 = __pyx_v_6gevent_6_event_dump_traceback; __pyx_t_7 = NULL;
+    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
+      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
+      if (likely(__pyx_t_7)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
+        __Pyx_INCREF(__pyx_t_7);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_6, function);
+      }
+    }
+    __pyx_t_4 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_5);
+    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 259, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+    __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 259, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_6);
+    __Pyx_GIVEREF(__pyx_t_2);
+    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2);
+    __Pyx_GIVEREF(__pyx_t_3);
+    PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_3);
+    __Pyx_GIVEREF(__pyx_t_4);
+    PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_4);
+    __pyx_t_2 = 0;
+    __pyx_t_3 = 0;
+    __pyx_t_4 = 0;
+    __Pyx_GIVEREF(__pyx_t_6);
+    __Pyx_GOTREF(__pyx_v_self->_exc_info);
+    __Pyx_DECREF(__pyx_v_self->_exc_info);
+    __pyx_v_self->_exc_info = ((PyObject*)__pyx_t_6);
+    __pyx_t_6 = 0;
+
 260:         else:
+
+261:             self._exc_info = (type(exception), exception, dump_traceback(None))
+
  /*else*/ {
+    __Pyx_INCREF(__pyx_v_6gevent_6_event_dump_traceback);
+    __pyx_t_4 = __pyx_v_6gevent_6_event_dump_traceback; __pyx_t_3 = NULL;
+    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
+      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
+      if (likely(__pyx_t_3)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
+        __Pyx_INCREF(__pyx_t_3);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_4, function);
+      }
+    }
+    __pyx_t_6 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_3, Py_None) : __Pyx_PyObject_CallOneArg(__pyx_t_4, Py_None);
+    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+    if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 261, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_6);
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 261, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_exception)));
+    __Pyx_GIVEREF(((PyObject *)Py_TYPE(__pyx_v_exception)));
+    PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)Py_TYPE(__pyx_v_exception)));
+    __Pyx_INCREF(__pyx_v_exception);
+    __Pyx_GIVEREF(__pyx_v_exception);
+    PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_exception);
+    __Pyx_GIVEREF(__pyx_t_6);
+    PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_6);
+    __pyx_t_6 = 0;
+    __Pyx_GIVEREF(__pyx_t_4);
+    __Pyx_GOTREF(__pyx_v_self->_exc_info);
+    __Pyx_DECREF(__pyx_v_self->_exc_info);
+    __pyx_v_self->_exc_info = ((PyObject*)__pyx_t_4);
+    __pyx_t_4 = 0;
+  }
+  __pyx_L3:;
+
 262: 
+
+263:         self._check_and_notify()
+
  __pyx_t_4 = ((struct __pyx_vtabstruct_6gevent_6_event_AsyncResult *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._check_and_notify(((struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *)__pyx_v_self)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 263, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_4);
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+
 264: 
+
+265:     def _raise_exception(self):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_13_raise_exception(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6gevent_6_event_11AsyncResult_12_raise_exception[] = "AsyncResult._raise_exception(self)";
+static PyMethodDef __pyx_mdef_6gevent_6_event_11AsyncResult_13_raise_exception = {"_raise_exception", (PyCFunction)__pyx_pw_6gevent_6_event_11AsyncResult_13_raise_exception, METH_NOARGS, __pyx_doc_6gevent_6_event_11AsyncResult_12_raise_exception};
+static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_13_raise_exception(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_raise_exception (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_6_event_11AsyncResult_12_raise_exception(((struct __pyx_obj_6gevent_6_event_AsyncResult *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_event_11AsyncResult_12_raise_exception(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_raise_exception", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_AddTraceback("gevent._event.AsyncResult._raise_exception", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__28 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(0, 265, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__28);
+  __Pyx_GIVEREF(__pyx_tuple__28);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_event_11AsyncResult_13_raise_exception, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AsyncResult__raise_exception, NULL, __pyx_n_s_gevent__event, __pyx_d, ((PyObject *)__pyx_codeobj__29)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 265, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_event_AsyncResult->tp_dict, __pyx_n_s_raise_exception, __pyx_t_2) < 0) __PYX_ERR(0, 265, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_6_event_AsyncResult);
+  __pyx_codeobj__29 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__28, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_event_py, __pyx_n_s_raise_exception, 265, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__29)) __PYX_ERR(0, 265, __pyx_L1_error)
+
+266:         reraise(*self.exc_info)
+
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_exc_info); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 266, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = __Pyx_PySequence_Tuple(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 266, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_6gevent_6_event_reraise, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 266, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 267: 
+
+268:     def get(self, block=True, timeout=None):
+
static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_15get(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_f_6gevent_6_event_11AsyncResult_get(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_6_event_11AsyncResult_get *__pyx_optional_args) {
+  PyObject *__pyx_v_block = ((PyObject *)Py_True);
+  PyObject *__pyx_v_timeout = ((PyObject *)Py_None);
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("get", 0);
+  if (__pyx_optional_args) {
+    if (__pyx_optional_args->__pyx_n > 0) {
+      __pyx_v_block = __pyx_optional_args->block;
+      if (__pyx_optional_args->__pyx_n > 1) {
+        __pyx_v_timeout = __pyx_optional_args->timeout;
+      }
+    }
+  }
+  /* Check if called by wrapper */
+  if (unlikely(__pyx_skip_dispatch)) ;
+  /* Check if overridden in Python */
+  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
+    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
+    if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
+    else {
+      PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      #endif
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 268, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_6_event_11AsyncResult_15get)) {
+        __Pyx_XDECREF(__pyx_r);
+        __Pyx_INCREF(__pyx_t_1);
+        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
+        __pyx_t_5 = 0;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+          if (likely(__pyx_t_4)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+            __Pyx_INCREF(__pyx_t_4);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_3, function);
+            __pyx_t_5 = 1;
+          }
+        }
+        #if CYTHON_FAST_PYCALL
+        if (PyFunction_Check(__pyx_t_3)) {
+          PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_block, __pyx_v_timeout};
+          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 268, __pyx_L1_error)
+          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+          __Pyx_GOTREF(__pyx_t_2);
+        } else
+        #endif
+        #if CYTHON_FAST_PYCCALL
+        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
+          PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_block, __pyx_v_timeout};
+          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 268, __pyx_L1_error)
+          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+          __Pyx_GOTREF(__pyx_t_2);
+        } else
+        #endif
+        {
+          __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 268, __pyx_L1_error)
+          __Pyx_GOTREF(__pyx_t_6);
+          if (__pyx_t_4) {
+            __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
+          }
+          __Pyx_INCREF(__pyx_v_block);
+          __Pyx_GIVEREF(__pyx_v_block);
+          PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_block);
+          __Pyx_INCREF(__pyx_v_timeout);
+          __Pyx_GIVEREF(__pyx_v_timeout);
+          PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_timeout);
+          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 268, __pyx_L1_error)
+          __Pyx_GOTREF(__pyx_t_2);
+          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+        }
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __pyx_r = __pyx_t_2;
+        __pyx_t_2 = 0;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        goto __pyx_L0;
+      }
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+      tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
+      if (unlikely(type_dict_guard != tp_dict_version)) {
+        tp_dict_version = obj_dict_version = 0;
+      }
+      #endif
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    }
+    #endif
+  }
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_6);
+  __Pyx_AddTraceback("gevent._event.AsyncResult.get", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_15get(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_6gevent_6_event_11AsyncResult_14get[] = "AsyncResult.get(self, block=True, timeout=None)\nReturn the stored value or raise the exception.\n\n        If this instance already holds a value or an exception, return  or raise it immediately.\n        Otherwise, block until another greenlet calls :meth:`set` or :meth:`set_exception` or\n        until the optional timeout occurs.\n\n        When the *timeout* argument is present and not ``None``, it should be a\n        floating point number specifying a timeout for the operation in seconds\n        (or fractions thereof). If the *timeout* elapses, the *Timeout* exception will\n        be raised.\n\n        :keyword bool block: If set to ``False`` and this instance is not ready,\n            immediately raise a :class:`Timeout` exception.\n        ";
+static PyMethodDef __pyx_mdef_6gevent_6_event_11AsyncResult_15get = {"get", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_6_event_11AsyncResult_15get, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_6_event_11AsyncResult_14get};
+static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_15get(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_block = 0;
+  PyObject *__pyx_v_timeout = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("get (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_block,&__pyx_n_s_timeout,0};
+    PyObject* values[2] = {0,0};
+    values[0] = ((PyObject *)Py_True);
+    values[1] = ((PyObject *)Py_None);
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_block);
+          if (value) { values[0] = value; kw_args--; }
+        }
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_timeout);
+          if (value) { values[1] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get") < 0)) __PYX_ERR(0, 268, __pyx_L3_error)
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    __pyx_v_block = values[0];
+    __pyx_v_timeout = values[1];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("get", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 268, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent._event.AsyncResult.get", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_6_event_11AsyncResult_14get(((struct __pyx_obj_6gevent_6_event_AsyncResult *)__pyx_v_self), __pyx_v_block, __pyx_v_timeout);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_event_11AsyncResult_14get(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self, PyObject *__pyx_v_block, PyObject *__pyx_v_timeout) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("get", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_2.__pyx_n = 2;
+  __pyx_t_2.block = __pyx_v_block;
+  __pyx_t_2.timeout = __pyx_v_timeout;
+  __pyx_t_1 = __pyx_vtabptr_6gevent_6_event_AsyncResult->get(__pyx_v_self, 1, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 268, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent._event.AsyncResult.get", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__30 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_block, __pyx_n_s_timeout); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(0, 268, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__30);
+  __Pyx_GIVEREF(__pyx_tuple__30);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_event_11AsyncResult_15get, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AsyncResult_get, NULL, __pyx_n_s_gevent__event, __pyx_d, ((PyObject *)__pyx_codeobj__31)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 268, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_event_AsyncResult->tp_dict, __pyx_n_s_get, __pyx_t_2) < 0) __PYX_ERR(0, 268, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_6_event_AsyncResult);
+  __pyx_codeobj__31 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__30, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_event_py, __pyx_n_s_get, 268, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__31)) __PYX_ERR(0, 268, __pyx_L1_error)
+
 269:         """Return the stored value or raise the exception.
+
 270: 
+
 271:         If this instance already holds a value or an exception, return  or raise it immediately.
+
 272:         Otherwise, block until another greenlet calls :meth:`set` or :meth:`set_exception` or
+
 273:         until the optional timeout occurs.
+
 274: 
+
 275:         When the *timeout* argument is present and not ``None``, it should be a
+
 276:         floating point number specifying a timeout for the operation in seconds
+
 277:         (or fractions thereof). If the *timeout* elapses, the *Timeout* exception will
+
 278:         be raised.
+
 279: 
+
 280:         :keyword bool block: If set to ``False`` and this instance is not ready,
+
 281:             immediately raise a :class:`Timeout` exception.
+
 282:         """
+
+283:         if self._value is not _NONE:
+
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_NONE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 283, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_7 = (__pyx_v_self->_value != __pyx_t_1);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_8 = (__pyx_t_7 != 0);
+  if (__pyx_t_8) {
+/* … */
+  }
+
+284:             return self._value
+
    __Pyx_XDECREF(__pyx_r);
+    __Pyx_INCREF(__pyx_v_self->_value);
+    __pyx_r = __pyx_v_self->_value;
+    goto __pyx_L0;
+
+285:         if self._exc_info:
+
  __pyx_t_8 = (__pyx_v_self->_exc_info != Py_None)&&(PyTuple_GET_SIZE(__pyx_v_self->_exc_info) != 0);
+  if (__pyx_t_8) {
+/* … */
+  }
+
+286:             return self._raise_exception()
+
    __Pyx_XDECREF(__pyx_r);
+    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_raise_exception); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 286, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_3 = NULL;
+    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+      if (likely(__pyx_t_3)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+        __Pyx_INCREF(__pyx_t_3);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_2, function);
+      }
+    }
+    __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
+    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 286, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __pyx_r = __pyx_t_1;
+    __pyx_t_1 = 0;
+    goto __pyx_L0;
+
 287: 
+
+288:         if not block:
+
  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_block); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 288, __pyx_L1_error)
+  __pyx_t_7 = ((!__pyx_t_8) != 0);
+  if (unlikely(__pyx_t_7)) {
+/* … */
+  }
+
 289:             # Not ready and not blocking, so immediately timeout
+
+290:             raise Timeout()
+
    __Pyx_INCREF(__pyx_v_6gevent_6_event_Timeout);
+    __pyx_t_2 = __pyx_v_6gevent_6_event_Timeout; __pyx_t_3 = NULL;
+    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
+      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+      if (likely(__pyx_t_3)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+        __Pyx_INCREF(__pyx_t_3);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_2, function);
+      }
+    }
+    __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
+    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 290, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __PYX_ERR(0, 290, __pyx_L1_error)
+
 291: 
+
 292:         # Wait, raising a timeout that elapses
+
+293:         self._wait_core(timeout, ())
+
  __pyx_t_9.__pyx_n = 1;
+  __pyx_t_9.catch = __pyx_empty_tuple;
+  __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_6_event_AsyncResult *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._wait_core(((struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *)__pyx_v_self), __pyx_v_timeout, &__pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 293, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 294: 
+
 295:         # by definition we are now ready
+
+296:         return self.get(block=False)
+
  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_10.__pyx_n = 1;
+  __pyx_t_10.block = Py_False;
+  __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_6_event_AsyncResult *)__pyx_v_self->__pyx_base.__pyx_vtab)->get(__pyx_v_self, 0, &__pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 296, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
 297: 
+
+298:     def get_nowait(self):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_17get_nowait(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6gevent_6_event_11AsyncResult_16get_nowait[] = "AsyncResult.get_nowait(self)\n\n        Return the value or raise the exception without blocking.\n\n        If this object is not yet :meth:`ready <ready>`, raise\n        :class:`gevent.Timeout` immediately.\n        ";
+static PyMethodDef __pyx_mdef_6gevent_6_event_11AsyncResult_17get_nowait = {"get_nowait", (PyCFunction)__pyx_pw_6gevent_6_event_11AsyncResult_17get_nowait, METH_NOARGS, __pyx_doc_6gevent_6_event_11AsyncResult_16get_nowait};
+static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_17get_nowait(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("get_nowait (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_6_event_11AsyncResult_16get_nowait(((struct __pyx_obj_6gevent_6_event_AsyncResult *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_event_11AsyncResult_16get_nowait(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("get_nowait", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent._event.AsyncResult.get_nowait", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__32 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(0, 298, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__32);
+  __Pyx_GIVEREF(__pyx_tuple__32);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_event_11AsyncResult_17get_nowait, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AsyncResult_get_nowait, NULL, __pyx_n_s_gevent__event, __pyx_d, ((PyObject *)__pyx_codeobj__33)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 298, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_event_AsyncResult->tp_dict, __pyx_n_s_get_nowait, __pyx_t_2) < 0) __PYX_ERR(0, 298, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_6_event_AsyncResult);
+  __pyx_codeobj__33 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__32, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_event_py, __pyx_n_s_get_nowait, 298, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__33)) __PYX_ERR(0, 298, __pyx_L1_error)
+
 299:         """
+
 300:         Return the value or raise the exception without blocking.
+
 301: 
+
 302:         If this object is not yet :meth:`ready <ready>`, raise
+
 303:         :class:`gevent.Timeout` immediately.
+
 304:         """
+
+305:         return self.get(block=False)
+
  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_2.__pyx_n = 1;
+  __pyx_t_2.block = Py_False;
+  __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_6_event_AsyncResult *)__pyx_v_self->__pyx_base.__pyx_vtab)->get(__pyx_v_self, 0, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 305, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
 306: 
+
+307:     def _wait_return_value(self, waited, wait_success):
+
static PyObject *__pyx_f_6gevent_6_event_11AsyncResult__wait_return_value(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_waited, CYTHON_UNUSED PyObject *__pyx_v_wait_success) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_wait_return_value", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent._event.AsyncResult._wait_return_value", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
 308:         # pylint:disable=unused-argument
+
 309:         # Always return the value. Since this is a one-shot event,
+
 310:         # no race condition should reset it.
+
+311:         return self.value
+
  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 311, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
 312: 
+
+313:     def wait(self, timeout=None):
+
static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_19wait(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_f_6gevent_6_event_11AsyncResult_wait(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_6_event_11AsyncResult_wait *__pyx_optional_args) {
+  PyObject *__pyx_v_timeout = ((PyObject *)Py_None);
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("wait", 0);
+  if (__pyx_optional_args) {
+    if (__pyx_optional_args->__pyx_n > 0) {
+      __pyx_v_timeout = __pyx_optional_args->timeout;
+    }
+  }
+  /* Check if called by wrapper */
+  if (unlikely(__pyx_skip_dispatch)) ;
+  /* Check if overridden in Python */
+  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
+    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
+    if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
+    else {
+      PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      #endif
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_wait); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 313, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_6_event_11AsyncResult_19wait)) {
+        __Pyx_XDECREF(__pyx_r);
+        __Pyx_INCREF(__pyx_t_1);
+        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+          if (likely(__pyx_t_4)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+            __Pyx_INCREF(__pyx_t_4);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_3, function);
+          }
+        }
+        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_timeout) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_timeout);
+        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 313, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __pyx_r = __pyx_t_2;
+        __pyx_t_2 = 0;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        goto __pyx_L0;
+      }
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+      tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
+      if (unlikely(type_dict_guard != tp_dict_version)) {
+        tp_dict_version = obj_dict_version = 0;
+      }
+      #endif
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    }
+    #endif
+  }
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_AddTraceback("gevent._event.AsyncResult.wait", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_19wait(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_6gevent_6_event_11AsyncResult_18wait[] = "AsyncResult.wait(self, timeout=None)\nBlock until the instance is ready.\n\n        If this instance already holds a value, it is returned immediately. If this\n        instance already holds an exception, ``None`` is returned immediately.\n\n        Otherwise, block until another greenlet calls :meth:`set` or :meth:`set_exception`\n        (at which point either the value or ``None`` will be returned, respectively),\n        or until the optional timeout expires (at which point ``None`` will also be\n        returned).\n\n        When the *timeout* argument is present and not ``None``, it should be a\n        floating point number specifying a timeout for the operation in seconds\n        (or fractions thereof).\n\n        .. note:: If a timeout is given and expires, ``None`` will be returned\n            (no timeout exception will be raised).\n\n        ";
+static PyMethodDef __pyx_mdef_6gevent_6_event_11AsyncResult_19wait = {"wait", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_6_event_11AsyncResult_19wait, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_6_event_11AsyncResult_18wait};
+static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_19wait(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_timeout = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("wait (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_timeout,0};
+    PyObject* values[1] = {0};
+    values[0] = ((PyObject *)Py_None);
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_timeout);
+          if (value) { values[0] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "wait") < 0)) __PYX_ERR(0, 313, __pyx_L3_error)
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    __pyx_v_timeout = values[0];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("wait", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 313, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent._event.AsyncResult.wait", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_6_event_11AsyncResult_18wait(((struct __pyx_obj_6gevent_6_event_AsyncResult *)__pyx_v_self), __pyx_v_timeout);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_event_11AsyncResult_18wait(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self, PyObject *__pyx_v_timeout) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("wait", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_2.__pyx_n = 1;
+  __pyx_t_2.timeout = __pyx_v_timeout;
+  __pyx_t_1 = __pyx_vtabptr_6gevent_6_event_AsyncResult->wait(__pyx_v_self, 1, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 313, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent._event.AsyncResult.wait", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__34 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_timeout); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(0, 313, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__34);
+  __Pyx_GIVEREF(__pyx_tuple__34);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_event_11AsyncResult_19wait, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AsyncResult_wait, NULL, __pyx_n_s_gevent__event, __pyx_d, ((PyObject *)__pyx_codeobj__35)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 313, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_event_AsyncResult->tp_dict, __pyx_n_s_wait, __pyx_t_2) < 0) __PYX_ERR(0, 313, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_6_event_AsyncResult);
+  __pyx_codeobj__35 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__34, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_event_py, __pyx_n_s_wait, 313, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__35)) __PYX_ERR(0, 313, __pyx_L1_error)
+
 314:         """Block until the instance is ready.
+
 315: 
+
 316:         If this instance already holds a value, it is returned immediately. If this
+
 317:         instance already holds an exception, ``None`` is returned immediately.
+
 318: 
+
 319:         Otherwise, block until another greenlet calls :meth:`set` or :meth:`set_exception`
+
 320:         (at which point either the value or ``None`` will be returned, respectively),
+
 321:         or until the optional timeout expires (at which point ``None`` will also be
+
 322:         returned).
+
 323: 
+
 324:         When the *timeout* argument is present and not ``None``, it should be a
+
 325:         floating point number specifying a timeout for the operation in seconds
+
 326:         (or fractions thereof).
+
 327: 
+
 328:         .. note:: If a timeout is given and expires, ``None`` will be returned
+
 329:             (no timeout exception will be raised).
+
 330: 
+
 331:         """
+
+332:         return self._wait(timeout)
+
  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_5.__pyx_n = 1;
+  __pyx_t_5.timeout = __pyx_v_timeout;
+  __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_6_event_AsyncResult *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._wait(((struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *)__pyx_v_self), &__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 332, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
 333: 
+
 334:     # link protocol
+
+335:     def __call__(self, source):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_21__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_21__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_source = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__call__ (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_source,0};
+    PyObject* values[1] = {0};
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_source)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__call__") < 0)) __PYX_ERR(0, 335, __pyx_L3_error)
+      }
+    } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
+      goto __pyx_L5_argtuple_error;
+    } else {
+      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+    }
+    __pyx_v_source = values[0];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("__call__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 335, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent._event.AsyncResult.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_6_event_11AsyncResult_20__call__(((struct __pyx_obj_6gevent_6_event_AsyncResult *)__pyx_v_self), __pyx_v_source);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_event_11AsyncResult_20__call__(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self, PyObject *__pyx_v_source) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__call__", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_XDECREF(__pyx_t_6);
+  __Pyx_XDECREF(__pyx_t_8);
+  __Pyx_AddTraceback("gevent._event.AsyncResult.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+336:         if source.successful():
+
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_source, __pyx_n_s_successful); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 336, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = NULL;
+  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+    if (likely(__pyx_t_3)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+      __Pyx_INCREF(__pyx_t_3);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_2, function);
+    }
+  }
+  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 336, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 336, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  if (__pyx_t_4) {
+/* … */
+    goto __pyx_L3;
+  }
+
+337:             self.set(source.value)
+
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 337, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_source, __pyx_n_s_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 337, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __pyx_t_5 = NULL;
+    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
+      if (likely(__pyx_t_5)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+        __Pyx_INCREF(__pyx_t_5);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_2, function);
+      }
+    }
+    __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
+    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 337, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 338:         else:
+
+339:             self.set_exception(source.exception, getattr(source, 'exc_info', None))
+
  /*else*/ {
+    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_exception); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 339, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_source, __pyx_n_s_exception_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 339, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __pyx_t_5 = __Pyx_GetAttr3(__pyx_v_source, __pyx_n_s_exc_info, Py_None); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 339, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_5);
+    __pyx_t_6 = NULL;
+    __pyx_t_7 = 0;
+    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
+      if (likely(__pyx_t_6)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+        __Pyx_INCREF(__pyx_t_6);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_2, function);
+        __pyx_t_7 = 1;
+      }
+    }
+    #if CYTHON_FAST_PYCALL
+    if (PyFunction_Check(__pyx_t_2)) {
+      PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_3, __pyx_t_5};
+      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 339, __pyx_L1_error)
+      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+      __Pyx_GOTREF(__pyx_t_1);
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    } else
+    #endif
+    #if CYTHON_FAST_PYCCALL
+    if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
+      PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_3, __pyx_t_5};
+      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 339, __pyx_L1_error)
+      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+      __Pyx_GOTREF(__pyx_t_1);
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    } else
+    #endif
+    {
+      __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 339, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_8);
+      if (__pyx_t_6) {
+        __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL;
+      }
+      __Pyx_GIVEREF(__pyx_t_3);
+      PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_3);
+      __Pyx_GIVEREF(__pyx_t_5);
+      PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_t_5);
+      __pyx_t_3 = 0;
+      __pyx_t_5 = 0;
+      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 339, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+    }
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  }
+  __pyx_L3:;
+
 340: 
+
 341:     # Methods to make us more like concurrent.futures.Future
+
 342: 
+
+343:     def result(self, timeout=None):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_23result(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_6gevent_6_event_11AsyncResult_22result[] = "AsyncResult.result(self, timeout=None)";
+static PyMethodDef __pyx_mdef_6gevent_6_event_11AsyncResult_23result = {"result", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_6_event_11AsyncResult_23result, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_6_event_11AsyncResult_22result};
+static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_23result(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_timeout = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("result (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_timeout,0};
+    PyObject* values[1] = {0};
+    values[0] = ((PyObject *)Py_None);
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_timeout);
+          if (value) { values[0] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "result") < 0)) __PYX_ERR(0, 343, __pyx_L3_error)
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    __pyx_v_timeout = values[0];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("result", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 343, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent._event.AsyncResult.result", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_6_event_11AsyncResult_22result(((struct __pyx_obj_6gevent_6_event_AsyncResult *)__pyx_v_self), __pyx_v_timeout);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_event_11AsyncResult_22result(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self, PyObject *__pyx_v_timeout) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("result", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_AddTraceback("gevent._event.AsyncResult.result", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__36 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_timeout); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(0, 343, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__36);
+  __Pyx_GIVEREF(__pyx_tuple__36);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_event_11AsyncResult_23result, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AsyncResult_result, NULL, __pyx_n_s_gevent__event, __pyx_d, ((PyObject *)__pyx_codeobj__37)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 343, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_event_AsyncResult->tp_dict, __pyx_n_s_result, __pyx_t_2) < 0) __PYX_ERR(0, 343, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_6_event_AsyncResult);
+  __pyx_codeobj__37 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__36, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_event_py, __pyx_n_s_result, 343, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__37)) __PYX_ERR(0, 343, __pyx_L1_error)
+
+344:         return self.get(timeout=timeout)
+
  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 344, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 344, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_timeout, __pyx_v_timeout) < 0) __PYX_ERR(0, 344, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 344, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_r = __pyx_t_3;
+  __pyx_t_3 = 0;
+  goto __pyx_L0;
+
 345: 
+
+346:     set_result = set
+
  __Pyx_GetNameInClass(__pyx_t_2, (PyObject *)__pyx_ptype_6gevent_6_event_AsyncResult, __pyx_n_s_set); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 346, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_event_AsyncResult->tp_dict, __pyx_n_s_set_result, __pyx_t_2) < 0) __PYX_ERR(0, 346, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_6_event_AsyncResult);
+
 347: 
+
+348:     def done(self):
+
static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_25done(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static int __pyx_f_6gevent_6_event_11AsyncResult_done(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self, int __pyx_skip_dispatch) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("done", 0);
+  /* Check if called by wrapper */
+  if (unlikely(__pyx_skip_dispatch)) ;
+  /* Check if overridden in Python */
+  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
+    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
+    if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
+    else {
+      PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      #endif
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_done); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 348, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_6_event_11AsyncResult_25done)) {
+        __Pyx_INCREF(__pyx_t_1);
+        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+          if (likely(__pyx_t_4)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+            __Pyx_INCREF(__pyx_t_4);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_3, function);
+          }
+        }
+        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
+        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 348, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 348, __pyx_L1_error)
+        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+        __pyx_r = __pyx_t_5;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        goto __pyx_L0;
+      }
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+      tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
+      if (unlikely(type_dict_guard != tp_dict_version)) {
+        tp_dict_version = obj_dict_version = 0;
+      }
+      #endif
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    }
+    #endif
+  }
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_WriteUnraisable("gevent._event.AsyncResult.done", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_25done(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6gevent_6_event_11AsyncResult_24done[] = "AsyncResult.done(self) -> bool";
+static PyMethodDef __pyx_mdef_6gevent_6_event_11AsyncResult_25done = {"done", (PyCFunction)__pyx_pw_6gevent_6_event_11AsyncResult_25done, METH_NOARGS, __pyx_doc_6gevent_6_event_11AsyncResult_24done};
+static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_25done(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("done (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_6_event_11AsyncResult_24done(((struct __pyx_obj_6gevent_6_event_AsyncResult *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_event_11AsyncResult_24done(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("done", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_f_6gevent_6_event_11AsyncResult_done(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 348, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent._event.AsyncResult.done", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__38 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(0, 348, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__38);
+  __Pyx_GIVEREF(__pyx_tuple__38);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_event_11AsyncResult_25done, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AsyncResult_done, NULL, __pyx_n_s_gevent__event, __pyx_d, ((PyObject *)__pyx_codeobj__39)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 348, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_event_AsyncResult->tp_dict, __pyx_n_s_done, __pyx_t_2) < 0) __PYX_ERR(0, 348, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_6_event_AsyncResult);
+  __pyx_codeobj__39 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__38, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_event_py, __pyx_n_s_done, 348, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__39)) __PYX_ERR(0, 348, __pyx_L1_error)
+
+349:         return self.ready()
+
  __pyx_r = ((struct __pyx_vtabstruct_6gevent_6_event_AsyncResult *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.ready(((struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *)__pyx_v_self), 0);
+  goto __pyx_L0;
+
 350: 
+
 351:     # we don't support cancelling
+
 352: 
+
+353:     def cancel(self):
+
static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_27cancel(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static int __pyx_f_6gevent_6_event_11AsyncResult_cancel(CYTHON_UNUSED struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self, int __pyx_skip_dispatch) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("cancel", 0);
+  /* Check if called by wrapper */
+  if (unlikely(__pyx_skip_dispatch)) ;
+  /* Check if overridden in Python */
+  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
+    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
+    if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
+    else {
+      PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      #endif
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_cancel); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 353, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_6_event_11AsyncResult_27cancel)) {
+        __Pyx_INCREF(__pyx_t_1);
+        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+          if (likely(__pyx_t_4)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+            __Pyx_INCREF(__pyx_t_4);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_3, function);
+          }
+        }
+        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
+        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 353, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 353, __pyx_L1_error)
+        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+        __pyx_r = __pyx_t_5;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        goto __pyx_L0;
+      }
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+      tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
+      if (unlikely(type_dict_guard != tp_dict_version)) {
+        tp_dict_version = obj_dict_version = 0;
+      }
+      #endif
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    }
+    #endif
+  }
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_WriteUnraisable("gevent._event.AsyncResult.cancel", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_27cancel(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6gevent_6_event_11AsyncResult_26cancel[] = "AsyncResult.cancel(self) -> bool";
+static PyMethodDef __pyx_mdef_6gevent_6_event_11AsyncResult_27cancel = {"cancel", (PyCFunction)__pyx_pw_6gevent_6_event_11AsyncResult_27cancel, METH_NOARGS, __pyx_doc_6gevent_6_event_11AsyncResult_26cancel};
+static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_27cancel(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("cancel (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_6_event_11AsyncResult_26cancel(((struct __pyx_obj_6gevent_6_event_AsyncResult *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_event_11AsyncResult_26cancel(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("cancel", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_f_6gevent_6_event_11AsyncResult_cancel(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 353, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent._event.AsyncResult.cancel", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__40 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__40)) __PYX_ERR(0, 353, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__40);
+  __Pyx_GIVEREF(__pyx_tuple__40);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_event_11AsyncResult_27cancel, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AsyncResult_cancel, NULL, __pyx_n_s_gevent__event, __pyx_d, ((PyObject *)__pyx_codeobj__41)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 353, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_event_AsyncResult->tp_dict, __pyx_n_s_cancel, __pyx_t_2) < 0) __PYX_ERR(0, 353, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_6_event_AsyncResult);
+  __pyx_codeobj__41 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_event_py, __pyx_n_s_cancel, 353, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__41)) __PYX_ERR(0, 353, __pyx_L1_error)
+
+354:         return False
+
  __pyx_r = 0;
+  goto __pyx_L0;
+
 355: 
+
+356:     def cancelled(self):
+
static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_29cancelled(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static int __pyx_f_6gevent_6_event_11AsyncResult_cancelled(CYTHON_UNUSED struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self, int __pyx_skip_dispatch) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("cancelled", 0);
+  /* Check if called by wrapper */
+  if (unlikely(__pyx_skip_dispatch)) ;
+  /* Check if overridden in Python */
+  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
+    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
+    if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
+    else {
+      PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      #endif
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_cancelled); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 356, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_6_event_11AsyncResult_29cancelled)) {
+        __Pyx_INCREF(__pyx_t_1);
+        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+          if (likely(__pyx_t_4)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+            __Pyx_INCREF(__pyx_t_4);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_3, function);
+          }
+        }
+        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
+        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 356, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 356, __pyx_L1_error)
+        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+        __pyx_r = __pyx_t_5;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        goto __pyx_L0;
+      }
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+      tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
+      if (unlikely(type_dict_guard != tp_dict_version)) {
+        tp_dict_version = obj_dict_version = 0;
+      }
+      #endif
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    }
+    #endif
+  }
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_WriteUnraisable("gevent._event.AsyncResult.cancelled", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_29cancelled(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6gevent_6_event_11AsyncResult_28cancelled[] = "AsyncResult.cancelled(self) -> bool";
+static PyMethodDef __pyx_mdef_6gevent_6_event_11AsyncResult_29cancelled = {"cancelled", (PyCFunction)__pyx_pw_6gevent_6_event_11AsyncResult_29cancelled, METH_NOARGS, __pyx_doc_6gevent_6_event_11AsyncResult_28cancelled};
+static PyObject *__pyx_pw_6gevent_6_event_11AsyncResult_29cancelled(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("cancelled (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_6_event_11AsyncResult_28cancelled(((struct __pyx_obj_6gevent_6_event_AsyncResult *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_event_11AsyncResult_28cancelled(struct __pyx_obj_6gevent_6_event_AsyncResult *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("cancelled", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_f_6gevent_6_event_11AsyncResult_cancelled(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 356, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent._event.AsyncResult.cancelled", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__42 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(0, 356, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__42);
+  __Pyx_GIVEREF(__pyx_tuple__42);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_event_11AsyncResult_29cancelled, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AsyncResult_cancelled, NULL, __pyx_n_s_gevent__event, __pyx_d, ((PyObject *)__pyx_codeobj__43)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 356, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_event_AsyncResult->tp_dict, __pyx_n_s_cancelled, __pyx_t_2) < 0) __PYX_ERR(0, 356, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_6_event_AsyncResult);
+
+357:         return False
+
  __pyx_r = 0;
+  goto __pyx_L0;
+
 358: 
+
 359:     # exception is a method, we use it as a property
+
 360: 
+
 361: 
+
+362: from gevent._util import import_c_accel
+
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 362, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_import_c_accel);
+  __Pyx_GIVEREF(__pyx_n_s_import_c_accel);
+  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_import_c_accel);
+  __pyx_t_1 = __Pyx_Import(__pyx_n_s_gevent__util, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 362, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_import_c_accel); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 362, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_import_c_accel, __pyx_t_2) < 0) __PYX_ERR(0, 362, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+363: import_c_accel(globals(), 'gevent._event')
+
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_import_c_accel); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 363, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = __Pyx_Globals(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 363, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 363, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_GIVEREF(__pyx_t_2);
+  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_gevent__event);
+  __Pyx_GIVEREF(__pyx_n_s_gevent__event);
+  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_n_s_gevent__event);
+  __pyx_t_2 = 0;
+  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 363, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/event.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/event.py new file mode 100644 index 00000000..9a0d4024 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/event.py @@ -0,0 +1,363 @@ +# Copyright (c) 2009-2016 Denis Bilenko, gevent contributors. See LICENSE for details. +# cython: auto_pickle=False,embedsignature=True,always_allow_keywords=False,infer_types=True + +"""Basic synchronization primitives: Event and AsyncResult""" +from __future__ import print_function + +from gevent._util import _NONE +from gevent._compat import reraise +from gevent._tblib import dump_traceback, load_traceback + +from gevent.timeout import Timeout + + +__all__ = [ + 'Event', + 'AsyncResult', +] + +def _get_linkable(): + x = __import__('gevent._abstract_linkable') + return x._abstract_linkable.AbstractLinkable +locals()['AbstractLinkable'] = _get_linkable() +del _get_linkable + +# Sadly, something about the way we have to "import" AbstractLinkable +# breaks pylint's inference of slots, even though they're declared +# right here. +# pylint:disable=assigning-non-slot + +class Event(AbstractLinkable): # pylint:disable=undefined-variable + """A synchronization primitive that allows one greenlet to wake up one or more others. + It has the same interface as :class:`threading.Event` but works across greenlets. + + An event object manages an internal flag that can be set to true with the + :meth:`set` method and reset to false with the :meth:`clear` method. The :meth:`wait` method + blocks until the flag is true. + + .. note:: + The order and timing in which waiting greenlets are awakened is not determined. + As an implementation note, in gevent 1.1 and 1.0, waiting greenlets are awakened in a + undetermined order sometime *after* the current greenlet yields to the event loop. Other greenlets + (those not waiting to be awakened) may run between the current greenlet yielding and + the waiting greenlets being awakened. These details may change in the future. + """ + + __slots__ = ('_flag',) + + def __init__(self): + super(Event, self).__init__() + self._flag = False + + def __str__(self): + return '<%s %s _links[%s]>' % (self.__class__.__name__, (self._flag and 'set') or 'clear', + self.linkcount()) + + def is_set(self): + """Return true if and only if the internal flag is true.""" + return self._flag + + def isSet(self): + # makes it a better drop-in replacement for threading.Event + return self._flag + + def ready(self): + # makes it compatible with AsyncResult and Greenlet (for + # example in wait()) + return self._flag + + def set(self): + """ + Set the internal flag to true. + + All greenlets waiting for it to become true are awakened in + some order at some time in the future. Greenlets that call + :meth:`wait` once the flag is true will not block at all + (until :meth:`clear` is called). + """ + self._flag = True + self._check_and_notify() + + def clear(self): + """ + Reset the internal flag to false. + + Subsequently, threads calling :meth:`wait` will block until + :meth:`set` is called to set the internal flag to true again. + """ + self._flag = False + + def _wait_return_value(self, waited, wait_success): + # To avoid the race condition outlined in http://bugs.python.org/issue13502, + # if we had to wait, then we need to return whether or not + # the condition got changed. Otherwise we simply echo + # the current state of the flag (which should be true) + if not waited: + flag = self._flag + assert flag, "if we didn't wait we should already be set" + return flag + + return wait_success + + def wait(self, timeout=None): + """ + Block until the internal flag is true. + + If the internal flag is true on entry, return immediately. Otherwise, + block until another thread (greenlet) calls :meth:`set` to set the flag to true, + or until the optional timeout occurs. + + When the *timeout* argument is present and not ``None``, it should be a + floating point number specifying a timeout for the operation in seconds + (or fractions thereof). + + :return: This method returns true if and only if the internal flag has been set to + true, either before the wait call or after the wait starts, so it will + always return ``True`` except if a timeout is given and the operation + times out. + + .. versionchanged:: 1.1 + The return value represents the flag during the elapsed wait, not + just after it elapses. This solves a race condition if one greenlet + sets and then clears the flag without switching, while other greenlets + are waiting. When the waiters wake up, this will return True; previously, + they would still wake up, but the return value would be False. This is most + noticeable when the *timeout* is present. + """ + return self._wait(timeout) + + def _reset_internal_locks(self): # pragma: no cover + # for compatibility with threading.Event + # Exception AttributeError: AttributeError("'Event' object has no attribute '_reset_internal_locks'",) + # in ignored + pass + + +class AsyncResult(AbstractLinkable): # pylint:disable=undefined-variable + """A one-time event that stores a value or an exception. + + Like :class:`Event` it wakes up all the waiters when :meth:`set` or :meth:`set_exception` + is called. Waiters may receive the passed value or exception by calling :meth:`get` + instead of :meth:`wait`. An :class:`AsyncResult` instance cannot be reset. + + To pass a value call :meth:`set`. Calls to :meth:`get` (those that are currently blocking as well as + those made in the future) will return the value: + + >>> result = AsyncResult() + >>> result.set(100) + >>> result.get() + 100 + + To pass an exception call :meth:`set_exception`. This will cause :meth:`get` to raise that exception: + + >>> result = AsyncResult() + >>> result.set_exception(RuntimeError('failure')) + >>> result.get() + Traceback (most recent call last): + ... + RuntimeError: failure + + :class:`AsyncResult` implements :meth:`__call__` and thus can be used as :meth:`link` target: + + >>> import gevent + >>> result = AsyncResult() + >>> gevent.spawn(lambda : 1/0).link(result) + >>> try: + ... result.get() + ... except ZeroDivisionError: + ... print('ZeroDivisionError') + ZeroDivisionError + + .. note:: + The order and timing in which waiting greenlets are awakened is not determined. + As an implementation note, in gevent 1.1 and 1.0, waiting greenlets are awakened in a + undetermined order sometime *after* the current greenlet yields to the event loop. Other greenlets + (those not waiting to be awakened) may run between the current greenlet yielding and + the waiting greenlets being awakened. These details may change in the future. + + .. versionchanged:: 1.1 + The exact order in which waiting greenlets are awakened is not the same + as in 1.0. + .. versionchanged:: 1.1 + Callbacks :meth:`linked ` to this object are required to be hashable, and duplicates are + merged. + """ + + __slots__ = ('_value', '_exc_info', '_imap_task_index') + + def __init__(self): + super(AsyncResult, self).__init__() + self._value = _NONE + self._exc_info = () + + @property + def _exception(self): + return self._exc_info[1] if self._exc_info else _NONE + + @property + def value(self): + """ + Holds the value passed to :meth:`set` if :meth:`set` was called. Otherwise, + ``None`` + """ + return self._value if self._value is not _NONE else None + + @property + def exc_info(self): + """ + The three-tuple of exception information if :meth:`set_exception` was called. + """ + if self._exc_info: + return (self._exc_info[0], self._exc_info[1], load_traceback(self._exc_info[2])) + return () + + def __str__(self): + result = '<%s ' % (self.__class__.__name__, ) + if self.value is not None or self._exception is not _NONE: + result += 'value=%r ' % self.value + if self._exception is not None and self._exception is not _NONE: + result += 'exception=%r ' % self._exception + if self._exception is _NONE: + result += 'unset ' + return result + ' _links[%s]>' % self.linkcount() + + def ready(self): + """Return true if and only if it holds a value or an exception""" + return self._exc_info or self._value is not _NONE + + def successful(self): + """Return true if and only if it is ready and holds a value""" + return self._value is not _NONE + + @property + def exception(self): + """Holds the exception instance passed to :meth:`set_exception` if :meth:`set_exception` was called. + Otherwise ``None``.""" + if self._exc_info: + return self._exc_info[1] + + def set(self, value=None): + """Store the value and wake up any waiters. + + All greenlets blocking on :meth:`get` or :meth:`wait` are awakened. + Subsequent calls to :meth:`wait` and :meth:`get` will not block at all. + """ + self._value = value + self._check_and_notify() + + def set_exception(self, exception, exc_info=None): + """Store the exception and wake up any waiters. + + All greenlets blocking on :meth:`get` or :meth:`wait` are awakened. + Subsequent calls to :meth:`wait` and :meth:`get` will not block at all. + + :keyword tuple exc_info: If given, a standard three-tuple of type, value, :class:`traceback` + as returned by :func:`sys.exc_info`. This will be used when the exception + is re-raised to propagate the correct traceback. + """ + if exc_info: + self._exc_info = (exc_info[0], exc_info[1], dump_traceback(exc_info[2])) + else: + self._exc_info = (type(exception), exception, dump_traceback(None)) + + self._check_and_notify() + + def _raise_exception(self): + reraise(*self.exc_info) + + def get(self, block=True, timeout=None): + """Return the stored value or raise the exception. + + If this instance already holds a value or an exception, return or raise it immediately. + Otherwise, block until another greenlet calls :meth:`set` or :meth:`set_exception` or + until the optional timeout occurs. + + When the *timeout* argument is present and not ``None``, it should be a + floating point number specifying a timeout for the operation in seconds + (or fractions thereof). If the *timeout* elapses, the *Timeout* exception will + be raised. + + :keyword bool block: If set to ``False`` and this instance is not ready, + immediately raise a :class:`Timeout` exception. + """ + if self._value is not _NONE: + return self._value + if self._exc_info: + return self._raise_exception() + + if not block: + # Not ready and not blocking, so immediately timeout + raise Timeout() + + # Wait, raising a timeout that elapses + self._wait_core(timeout, ()) + + # by definition we are now ready + return self.get(block=False) + + def get_nowait(self): + """ + Return the value or raise the exception without blocking. + + If this object is not yet :meth:`ready `, raise + :class:`gevent.Timeout` immediately. + """ + return self.get(block=False) + + def _wait_return_value(self, waited, wait_success): + # pylint:disable=unused-argument + # Always return the value. Since this is a one-shot event, + # no race condition should reset it. + return self.value + + def wait(self, timeout=None): + """Block until the instance is ready. + + If this instance already holds a value, it is returned immediately. If this + instance already holds an exception, ``None`` is returned immediately. + + Otherwise, block until another greenlet calls :meth:`set` or :meth:`set_exception` + (at which point either the value or ``None`` will be returned, respectively), + or until the optional timeout expires (at which point ``None`` will also be + returned). + + When the *timeout* argument is present and not ``None``, it should be a + floating point number specifying a timeout for the operation in seconds + (or fractions thereof). + + .. note:: If a timeout is given and expires, ``None`` will be returned + (no timeout exception will be raised). + + """ + return self._wait(timeout) + + # link protocol + def __call__(self, source): + if source.successful(): + self.set(source.value) + else: + self.set_exception(source.exception, getattr(source, 'exc_info', None)) + + # Methods to make us more like concurrent.futures.Future + + def result(self, timeout=None): + return self.get(timeout=timeout) + + set_result = set + + def done(self): + return self.ready() + + # we don't support cancelling + + def cancel(self): + return False + + def cancelled(self): + return False + + # exception is a method, we use it as a property + + +from gevent._util import import_c_accel +import_c_accel(globals(), 'gevent._event') diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/events.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/events.py new file mode 100644 index 00000000..12c02ec9 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/events.py @@ -0,0 +1,480 @@ +# -*- coding: utf-8 -*- +# Copyright 2018 gevent. See LICENSE for details. +""" +Publish/subscribe event infrastructure. + +When certain "interesting" things happen during the lifetime of the +process, gevent will "publish" an event (an object). That event is +delivered to interested "subscribers" (functions that take one +parameter, the event object). + +Higher level frameworks may take this foundation and build richer +models on it. + +If :mod:`zope.event` is installed, then it will be used to provide the +functionality of `notify` and `subscribers`. See +:mod:`zope.event.classhandler` for a simple class-based approach to +subscribing to a filtered list of events, and see `zope.component +`_ for a +much higher-level, flexible system. If you are using one of these systems, +you generally will not want to directly modify `subscribers`. + +.. versionadded:: 1.3b1 +""" +from __future__ import absolute_import +from __future__ import division +from __future__ import print_function + + +__all__ = [ + 'subscribers', + + # monitor thread + 'IEventLoopBlocked', + 'EventLoopBlocked', + 'IMemoryUsageThresholdExceeded', + 'MemoryUsageThresholdExceeded', + 'IMemoryUsageUnderThreshold', + 'MemoryUsageUnderThreshold', + + # Hub + 'IPeriodicMonitorThread', + 'IPeriodicMonitorThreadStartedEvent', + 'PeriodicMonitorThreadStartedEvent', + + # monkey + 'IGeventPatchEvent', + 'GeventPatchEvent', + 'IGeventWillPatchEvent', + 'DoNotPatch', + 'GeventWillPatchEvent', + 'IGeventDidPatchEvent', + 'IGeventWillPatchModuleEvent', + 'GeventWillPatchModuleEvent', + 'IGeventDidPatchModuleEvent', + 'GeventDidPatchModuleEvent', + 'IGeventWillPatchAllEvent', + 'GeventWillPatchAllEvent', + 'IGeventDidPatchBuiltinModulesEvent', + 'GeventDidPatchBuiltinModulesEvent', + 'IGeventDidPatchAllEvent', + 'GeventDidPatchAllEvent', +] + +# pylint:disable=no-self-argument + +try: + from zope.event import subscribers + from zope.event import notify +except ImportError: + #: Applications may register for notification of events by appending a + #: callable to the ``subscribers`` list. + #: + #: Each subscriber takes a single argument, which is the event object + #: being published. + #: + #: Exceptions raised by subscribers will be propagated *without* running + #: any remaining subscribers. + subscribers = [] + + def notify(event): + """ + Notify all subscribers of ``event``. + """ + for subscriber in subscribers: + subscriber(event) + +notify = notify # export +try: + # pkg_resources is technically optional, we don't + # list a hard dependency on it. + __import__('pkg_resources') +except ImportError: + notify_and_call_entry_points = notify +else: + from pkg_resources import iter_entry_points + import platform + try: + # Cache the platform info. pkg_resources uses + # platform.machine() for environment markers, and + # platform.machine() wants to call os.popen('uname'), which is + # broken on Py2 when the gevent child signal handler is + # installed. (see test__monkey_sigchild_2.py) + platform.uname() + except: # pylint:disable=bare-except + pass + finally: + del platform + + def notify_and_call_entry_points(event): + notify(event) + for plugin in iter_entry_points(event.ENTRY_POINT_NAME): + subscriber = plugin.load() + subscriber(event) + +from gevent._util import Interface +from gevent._util import implementer +from gevent._util import Attribute + + +class IPeriodicMonitorThread(Interface): + """ + The contract for the periodic monitoring thread that is started + by the hub. + """ + + def add_monitoring_function(function, period): + """ + Schedule the *function* to be called approximately every *period* fractional seconds. + + The *function* receives one argument, the hub being monitored. It is called + in the monitoring thread, *not* the hub thread. It **must not** attempt to + use the gevent asynchronous API. + + If the *function* is already a monitoring function, then its *period* + will be updated for future runs. + + If the *period* is ``None``, then the function will be removed. + + A *period* less than or equal to zero is not allowed. + """ + +class IPeriodicMonitorThreadStartedEvent(Interface): + """ + The event emitted when a hub starts a periodic monitoring thread. + + You can use this event to add additional monitoring functions. + """ + + monitor = Attribute("The instance of `IPeriodicMonitorThread` that was started.") + +class PeriodicMonitorThreadStartedEvent(object): + """ + The implementation of :class:`IPeriodicMonitorThreadStartedEvent`. + """ + + #: The name of the setuptools entry point that is called when this + #: event is emitted. + ENTRY_POINT_NAME = 'gevent.plugins.hub.periodic_monitor_thread_started' + + def __init__(self, monitor): + self.monitor = monitor + +class IEventLoopBlocked(Interface): + """ + The event emitted when the event loop is blocked. + + This event is emitted in the monitor thread. + """ + + greenlet = Attribute("The greenlet that appeared to be blocking the loop.") + blocking_time = Attribute("The approximate time in seconds the loop has been blocked.") + info = Attribute("A sequence of string lines providing extra info.") + +@implementer(IEventLoopBlocked) +class EventLoopBlocked(object): + """ + The event emitted when the event loop is blocked. + + Implements `IEventLoopBlocked`. + """ + + def __init__(self, greenlet, blocking_time, info): + self.greenlet = greenlet + self.blocking_time = blocking_time + self.info = info + +class IMemoryUsageThresholdExceeded(Interface): + """ + The event emitted when the memory usage threshold is exceeded. + + This event is emitted only while memory continues to grow + above the threshold. Only if the condition or stabilized is corrected (memory + usage drops) will the event be emitted in the future. + + This event is emitted in the monitor thread. + """ + + mem_usage = Attribute("The current process memory usage, in bytes.") + max_allowed = Attribute("The maximum allowed memory usage, in bytes.") + memory_info = Attribute("The tuple of memory usage stats return by psutil.") + +class _AbstractMemoryEvent(object): + + def __init__(self, mem_usage, max_allowed, memory_info): + self.mem_usage = mem_usage + self.max_allowed = max_allowed + self.memory_info = memory_info + + def __repr__(self): + return "<%s used=%d max=%d details=%r>" % ( + self.__class__.__name__, + self.mem_usage, + self.max_allowed, + self.memory_info, + ) + +@implementer(IMemoryUsageThresholdExceeded) +class MemoryUsageThresholdExceeded(_AbstractMemoryEvent): + """ + Implementation of `IMemoryUsageThresholdExceeded`. + """ + + +class IMemoryUsageUnderThreshold(Interface): + """ + The event emitted when the memory usage drops below the + threshold after having previously been above it. + + This event is emitted only the first time memory usage is detected + to be below the threshold after having previously been above it. + If memory usage climbs again, a `IMemoryUsageThresholdExceeded` + event will be broadcast, and then this event could be broadcast again. + + This event is emitted in the monitor thread. + """ + + mem_usage = Attribute("The current process memory usage, in bytes.") + max_allowed = Attribute("The maximum allowed memory usage, in bytes.") + max_memory_usage = Attribute("The memory usage that caused the previous " + "IMemoryUsageThresholdExceeded event.") + memory_info = Attribute("The tuple of memory usage stats return by psutil.") + + +@implementer(IMemoryUsageUnderThreshold) +class MemoryUsageUnderThreshold(_AbstractMemoryEvent): + """ + Implementation of `IMemoryUsageUnderThreshold`. + """ + + def __init__(self, mem_usage, max_allowed, memory_info, max_usage): + super(MemoryUsageUnderThreshold, self).__init__(mem_usage, max_allowed, memory_info) + self.max_memory_usage = max_usage + + +class IGeventPatchEvent(Interface): + """ + The root for all monkey-patch events gevent emits. + """ + + source = Attribute("The source object containing the patches.") + target = Attribute("The destination object to be patched.") + +@implementer(IGeventPatchEvent) +class GeventPatchEvent(object): + """ + Implementation of `IGeventPatchEvent`. + """ + + def __init__(self, source, target): + self.source = source + self.target = target + + def __repr__(self): + return '<%s source=%r target=%r at %x>' % (self.__class__.__name__, + self.source, + self.target, + id(self)) + +class IGeventWillPatchEvent(IGeventPatchEvent): + """ + An event emitted *before* gevent monkey-patches something. + + If a subscriber raises `DoNotPatch`, then patching this particular + item will not take place. + """ + + +class DoNotPatch(BaseException): + """ + Subscribers to will-patch events can raise instances + of this class to tell gevent not to patch that particular item. + """ + + +@implementer(IGeventWillPatchEvent) +class GeventWillPatchEvent(GeventPatchEvent): + """ + Implementation of `IGeventWillPatchEvent`. + """ + +class IGeventDidPatchEvent(IGeventPatchEvent): + """ + An event emitted *after* gevent has patched something. + """ + +@implementer(IGeventDidPatchEvent) +class GeventDidPatchEvent(GeventPatchEvent): + """ + Implementation of `IGeventDidPatchEvent`. + """ + +class IGeventWillPatchModuleEvent(IGeventWillPatchEvent): + """ + An event emitted *before* gevent begins patching a specific module. + + Both *source* and *target* attributes are module objects. + """ + + module_name = Attribute("The name of the module being patched. " + "This is the same as ``target.__name__``.") + + target_item_names = Attribute("The list of item names to patch. " + "This can be modified in place with caution.") + +@implementer(IGeventWillPatchModuleEvent) +class GeventWillPatchModuleEvent(GeventWillPatchEvent): + """ + Implementation of `IGeventWillPatchModuleEvent`. + """ + + #: The name of the setuptools entry point that is called when this + #: event is emitted. + ENTRY_POINT_NAME = 'gevent.plugins.monkey.will_patch_module' + + def __init__(self, module_name, source, target, items): + super(GeventWillPatchModuleEvent, self).__init__(source, target) + self.module_name = module_name + self.target_item_names = items + + +class IGeventDidPatchModuleEvent(IGeventDidPatchEvent): + """ + An event emitted *after* gevent has completed patching a specific + module. + """ + + module_name = Attribute("The name of the module being patched. " + "This is the same as ``target.__name__``.") + + +@implementer(IGeventDidPatchModuleEvent) +class GeventDidPatchModuleEvent(GeventDidPatchEvent): + """ + Implementation of `IGeventDidPatchModuleEvent`. + """ + + #: The name of the setuptools entry point that is called when this + #: event is emitted. + ENTRY_POINT_NAME = 'gevent.plugins.monkey.did_patch_module' + + def __init__(self, module_name, source, target): + super(GeventDidPatchModuleEvent, self).__init__(source, target) + self.module_name = module_name + +# TODO: Maybe it would be useful for the the module patch events +# to have an attribute telling if they're being done during patch_all? + +class IGeventWillPatchAllEvent(IGeventWillPatchEvent): + """ + An event emitted *before* gevent begins patching the system. + + Following this event will be a series of + `IGeventWillPatchModuleEvent` and `IGeventDidPatchModuleEvent` for + each patched module. + + Once the gevent builtin modules have been processed, + `IGeventDidPatchBuiltinModulesEvent` will be emitted. Processing + this event is an ideal time for third-party modules to be imported + and patched (which may trigger its own will/did patch module + events). + + Finally, a `IGeventDidPatchAllEvent` will be sent. + + If a subscriber to this event raises `DoNotPatch`, no patching + will be done. + + The *source* and *target* attributes have undefined values. + """ + + patch_all_arguments = Attribute( + "A dictionary of all the arguments to `gevent.monkey.patch_all`. " + "This dictionary should not be modified. " + ) + + patch_all_kwargs = Attribute( + "A dictionary of the extra arguments to `gevent.monkey.patch_all`. " + "This dictionary should not be modified. " + ) + + def will_patch_module(module_name): + """ + Return whether the module named *module_name* will be patched. + """ + +class _PatchAllMixin(object): + def __init__(self, patch_all_arguments, patch_all_kwargs): + super(_PatchAllMixin, self).__init__(None, None) + self._patch_all_arguments = patch_all_arguments + self._patch_all_kwargs = patch_all_kwargs + + @property + def patch_all_arguments(self): + return self._patch_all_arguments.copy() + + @property + def patch_all_kwargs(self): + return self._patch_all_kwargs.copy() + + def __repr__(self): + return '<%s %r at %x>' % (self.__class__.__name__, + self._patch_all_arguments, + id(self)) + +@implementer(IGeventWillPatchAllEvent) +class GeventWillPatchAllEvent(_PatchAllMixin, GeventWillPatchEvent): + """ + Implementation of `IGeventWillPatchAllEvent`. + """ + + #: The name of the setuptools entry point that is called when this + #: event is emitted. + ENTRY_POINT_NAME = 'gevent.plugins.monkey.will_patch_all' + + def will_patch_module(self, module_name): + return self.patch_all_arguments.get(module_name) + +class IGeventDidPatchBuiltinModulesEvent(IGeventDidPatchEvent): + """ + Event emitted *after* the builtin modules have been patched. + + The values of the *source* and *target* attributes are undefined. + """ + + patch_all_arguments = Attribute( + "A dictionary of all the arguments to `gevent.monkey.patch_all`. " + "This dictionary should not be modified. " + ) + + patch_all_kwargs = Attribute( + "A dictionary of the extra arguments to `gevent.monkey.patch_all`. " + "This dictionary should not be modified. " + ) + +@implementer(IGeventDidPatchBuiltinModulesEvent) +class GeventDidPatchBuiltinModulesEvent(_PatchAllMixin, GeventDidPatchEvent): + """ + Implementation of `IGeventDidPatchBuiltinModulesEvent`. + """ + + #: The name of the setuptools entry point that is called when this + #: event is emitted. + ENTRY_POINT_NAME = 'gevent.plugins.monkey.did_patch_builtins' + +class IGeventDidPatchAllEvent(IGeventDidPatchEvent): + """ + Event emitted after gevent has patched all modules, both builtin + and those provided by plugins/subscribers. + + The values of the *source* and *target* attributes are undefined. + """ + +@implementer(IGeventDidPatchAllEvent) +class GeventDidPatchAllEvent(_PatchAllMixin, GeventDidPatchEvent): + """ + Implementation of `IGeventDidPatchAllEvent`. + """ + + #: The name of the setuptools entry point that is called when this + #: event is emitted. + ENTRY_POINT_NAME = 'gevent.plugins.monkey.did_patch_all' diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/exceptions.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/exceptions.py new file mode 100644 index 00000000..2c779ce6 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/exceptions.py @@ -0,0 +1,79 @@ +# -*- coding: utf-8 -*- +# copyright 2018 gevent +""" +Exceptions. + +.. versionadded:: 1.3b1 + +""" +from __future__ import absolute_import +from __future__ import division +from __future__ import print_function + + +__all__ = [ + 'LoopExit', +] + + +class LoopExit(Exception): + """ + Exception thrown when the hub finishes running (`gevent.hub.Hub.run` + would return). + + In a normal application, this is never thrown or caught + explicitly. The internal implementation of functions like + :meth:`gevent.hub.Hub.join` and :func:`gevent.joinall` may catch it, but user code + generally should not. + + .. caution:: + Errors in application programming can also lead to this exception being + raised. Some examples include (but are not limited too): + + - greenlets deadlocking on a lock; + - using a socket or other gevent object with native thread + affinity from a different thread + + """ + + def __repr__(self): + # pylint:disable=unsubscriptable-object + if len(self.args) == 3: # From the hub + import pprint + return "%s\n\tHub: %s\n\tHandles:\n%s" % ( + self.args[0], self.args[1], + pprint.pformat(self.args[2]) + ) + return Exception.__repr__(self) + + def __str__(self): + return repr(self) + +class BlockingSwitchOutError(AssertionError): + """ + Raised when a gevent synchronous function is called from a + low-level event loop callback. + + This is usually a programming error. + """ + + +class InvalidSwitchError(AssertionError): + """ + Raised when the event loop returns control to a greenlet in an + unexpected way. + + This is usually a bug in gevent, greenlet, or the event loop. + """ + +class ConcurrentObjectUseError(AssertionError): + """ + Raised when an object is used (waited on) by two greenlets + independently, meaning the object was entered into a blocking + state by one greenlet and then another while still blocking in the + first one. + + This is usually a programming error. + + .. seealso:: `gevent.socket.wait` + """ diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/fileobject.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/fileobject.py new file mode 100644 index 00000000..598f882c --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/fileobject.py @@ -0,0 +1,61 @@ +""" +Wrappers to make file-like objects cooperative. + +.. class:: FileObject + + The main entry point to the file-like gevent-compatible behaviour. It will be defined + to be the best available implementation. + +There are two main implementations of ``FileObject``. On all systems, +there is :class:`FileObjectThread` which uses the built-in native +threadpool to avoid blocking the entire interpreter. On UNIX systems +(those that support the :mod:`fcntl` module), there is also +:class:`FileObjectPosix` which uses native non-blocking semantics. + +A third class, :class:`FileObjectBlock`, is simply a wrapper that executes everything +synchronously (and so is not gevent-compatible). It is provided for testing and debugging +purposes. + +Configuration +============= + +You may change the default value for ``FileObject`` using the +``GEVENT_FILE`` environment variable. Set it to ``posix``, ``thread``, +or ``block`` to choose from :class:`FileObjectPosix`, +:class:`FileObjectThread` and :class:`FileObjectBlock`, respectively. +You may also set it to the fully qualified class name of another +object that implements the file interface to use one of your own +objects. + +.. note:: The environment variable must be set at the time this module + is first imported. + +Classes +======= +""" +from __future__ import absolute_import + +from gevent._config import config + +__all__ = [ + 'FileObjectPosix', + 'FileObjectThread', + 'FileObjectBlock', + 'FileObject', +] + +try: + from fcntl import fcntl +except ImportError: + __all__.remove("FileObjectPosix") +else: + del fcntl + from gevent._fileobjectposix import FileObjectPosix + +from gevent._fileobjectcommon import FileObjectThread +from gevent._fileobjectcommon import FileObjectBlock + + +# None of the possible objects can live in this module because +# we would get an import cycle and the config couldn't be set from code. +FileObject = config.fileobject diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/greenlet.c b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/greenlet.c new file mode 100644 index 00000000..a8f20a25 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/greenlet.c @@ -0,0 +1,24316 @@ +/* Generated by Cython 0.29.2 */ + +/* BEGIN: Cython Metadata +{ + "distutils": { + "depends": [ + "src/gevent/__ident.pxd", + "src/gevent/_greenlet.pxd", + "src/gevent/_ident.py", + "src\\gevent\\__ident.pxd", + "src\\gevent\\_greenlet.pxd", + "src\\gevent\\_ident.py" + ], + "include_dirs": [ + "C:\\Python37-x64\\Include", + "deps" + ], + "name": "gevent._greenlet", + "sources": [ + "src/gevent/greenlet.py" + ] + }, + "module_name": "gevent._greenlet" +} +END: Cython Metadata */ + +#define PY_SSIZE_T_CLEAN +#include "Python.h" +#ifndef Py_PYTHON_H + #error Python headers needed to compile C extensions, please install development version of Python. +#elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) + #error Cython requires Python 2.6+ or Python 3.3+. +#else +#define CYTHON_ABI "0_29_2" +#define CYTHON_HEX_VERSION 0x001D02F0 +#define CYTHON_FUTURE_DIVISION 1 +#include +#ifndef offsetof + #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) +#endif +#if !defined(WIN32) && !defined(MS_WINDOWS) + #ifndef __stdcall + #define __stdcall + #endif + #ifndef __cdecl + #define __cdecl + #endif + #ifndef __fastcall + #define __fastcall + #endif +#endif +#ifndef DL_IMPORT + #define DL_IMPORT(t) t +#endif +#ifndef DL_EXPORT + #define DL_EXPORT(t) t +#endif +#define __PYX_COMMA , +#ifndef HAVE_LONG_LONG + #if PY_VERSION_HEX >= 0x02070000 + #define HAVE_LONG_LONG + #endif +#endif +#ifndef PY_LONG_LONG + #define PY_LONG_LONG LONG_LONG +#endif +#ifndef Py_HUGE_VAL + #define Py_HUGE_VAL HUGE_VAL +#endif +#ifdef PYPY_VERSION + #define CYTHON_COMPILING_IN_PYPY 1 + #define CYTHON_COMPILING_IN_PYSTON 0 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #undef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 0 + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #if PY_VERSION_HEX < 0x03050000 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #elif !defined(CYTHON_USE_ASYNC_SLOTS) + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #undef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 0 + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #undef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 1 + #undef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 0 + #undef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 0 + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #undef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE 0 + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 +#elif defined(PYSTON_VERSION) + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_PYSTON 1 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #ifndef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 1 + #endif + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #ifndef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 1 + #endif + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #ifndef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 0 + #endif + #ifndef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 1 + #endif + #ifndef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 1 + #endif + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #undef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE 0 + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 +#else + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_PYSTON 0 + #define CYTHON_COMPILING_IN_CPYTHON 1 + #ifndef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 1 + #endif + #if PY_VERSION_HEX < 0x02070000 + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #elif !defined(CYTHON_USE_PYTYPE_LOOKUP) + #define CYTHON_USE_PYTYPE_LOOKUP 1 + #endif + #if PY_MAJOR_VERSION < 3 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #elif !defined(CYTHON_USE_ASYNC_SLOTS) + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #if PY_VERSION_HEX < 0x02070000 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #elif !defined(CYTHON_USE_PYLONG_INTERNALS) + #define CYTHON_USE_PYLONG_INTERNALS 1 + #endif + #ifndef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 1 + #endif + #ifndef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 1 + #endif + #if PY_VERSION_HEX < 0x030300F0 + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #elif !defined(CYTHON_USE_UNICODE_WRITER) + #define CYTHON_USE_UNICODE_WRITER 1 + #endif + #ifndef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 0 + #endif + #ifndef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 1 + #endif + #ifndef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 1 + #endif + #ifndef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 1 + #endif + #ifndef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 1 + #endif + #ifndef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000) + #endif + #ifndef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1) + #endif + #ifndef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1) + #endif + #ifndef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3) + #endif +#endif +#if !defined(CYTHON_FAST_PYCCALL) +#define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) +#endif +#if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #undef SHIFT + #undef BASE + #undef MASK + #ifdef SIZEOF_VOID_P + enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) }; + #endif +#endif +#ifndef __has_attribute + #define __has_attribute(x) 0 +#endif +#ifndef __has_cpp_attribute + #define __has_cpp_attribute(x) 0 +#endif +#ifndef CYTHON_RESTRICT + #if defined(__GNUC__) + #define CYTHON_RESTRICT __restrict__ + #elif defined(_MSC_VER) && _MSC_VER >= 1400 + #define CYTHON_RESTRICT __restrict + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_RESTRICT restrict + #else + #define CYTHON_RESTRICT + #endif +#endif +#ifndef CYTHON_UNUSED +# if defined(__GNUC__) +# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +#endif +#ifndef CYTHON_MAYBE_UNUSED_VAR +# if defined(__cplusplus) + template void CYTHON_MAYBE_UNUSED_VAR( const T& ) { } +# else +# define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x) +# endif +#endif +#ifndef CYTHON_NCP_UNUSED +# if CYTHON_COMPILING_IN_CPYTHON +# define CYTHON_NCP_UNUSED +# else +# define CYTHON_NCP_UNUSED CYTHON_UNUSED +# endif +#endif +#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) +#ifdef _MSC_VER + #ifndef _MSC_STDINT_H_ + #if _MSC_VER < 1300 + typedef unsigned char uint8_t; + typedef unsigned int uint32_t; + #else + typedef unsigned __int8 uint8_t; + typedef unsigned __int32 uint32_t; + #endif + #endif +#else + #include +#endif +#ifndef CYTHON_FALLTHROUGH + #if defined(__cplusplus) && __cplusplus >= 201103L + #if __has_cpp_attribute(fallthrough) + #define CYTHON_FALLTHROUGH [[fallthrough]] + #elif __has_cpp_attribute(clang::fallthrough) + #define CYTHON_FALLTHROUGH [[clang::fallthrough]] + #elif __has_cpp_attribute(gnu::fallthrough) + #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] + #endif + #endif + #ifndef CYTHON_FALLTHROUGH + #if __has_attribute(fallthrough) + #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) + #else + #define CYTHON_FALLTHROUGH + #endif + #endif + #if defined(__clang__ ) && defined(__apple_build_version__) + #if __apple_build_version__ < 7000000 + #undef CYTHON_FALLTHROUGH + #define CYTHON_FALLTHROUGH + #endif + #endif +#endif + +#ifndef CYTHON_INLINE + #if defined(__clang__) + #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) + #elif defined(__GNUC__) + #define CYTHON_INLINE __inline__ + #elif defined(_MSC_VER) + #define CYTHON_INLINE __inline + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_INLINE inline + #else + #define CYTHON_INLINE + #endif +#endif + +#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) + #define Py_OptimizeFlag 0 +#endif +#define __PYX_BUILD_PY_SSIZE_T "n" +#define CYTHON_FORMAT_SSIZE_T "z" +#if PY_MAJOR_VERSION < 3 + #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyClass_Type +#else + #define __Pyx_BUILTIN_MODULE_NAME "builtins" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyType_Type +#endif +#ifndef Py_TPFLAGS_CHECKTYPES + #define Py_TPFLAGS_CHECKTYPES 0 +#endif +#ifndef Py_TPFLAGS_HAVE_INDEX + #define Py_TPFLAGS_HAVE_INDEX 0 +#endif +#ifndef Py_TPFLAGS_HAVE_NEWBUFFER + #define Py_TPFLAGS_HAVE_NEWBUFFER 0 +#endif +#ifndef Py_TPFLAGS_HAVE_FINALIZE + #define Py_TPFLAGS_HAVE_FINALIZE 0 +#endif +#ifndef METH_STACKLESS + #define METH_STACKLESS 0 +#endif +#if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) + #ifndef METH_FASTCALL + #define METH_FASTCALL 0x80 + #endif + typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs); + typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args, + Py_ssize_t nargs, PyObject *kwnames); +#else + #define __Pyx_PyCFunctionFast _PyCFunctionFast + #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords +#endif +#if CYTHON_FAST_PYCCALL +#define __Pyx_PyFastCFunction_Check(func)\ + ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS))))) +#else +#define __Pyx_PyFastCFunction_Check(func) 0 +#endif +#if CYTHON_USE_DICT_VERSIONS +#define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) +#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ + (version_var) = __PYX_GET_DICT_VERSION(dict);\ + (cache_var) = (value); +#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ + static PY_UINT64_T __pyx_dict_version = 0;\ + static PyObject *__pyx_dict_cached_value = NULL;\ + if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ + (VAR) = __pyx_dict_cached_value;\ + } else {\ + (VAR) = __pyx_dict_cached_value = (LOOKUP);\ + __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ + }\ + } +#else +#define __PYX_GET_DICT_VERSION(dict) (0) +#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) +#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) + #define PyObject_Malloc(s) PyMem_Malloc(s) + #define PyObject_Free(p) PyMem_Free(p) + #define PyObject_Realloc(p) PyMem_Realloc(p) +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1 + #define PyMem_RawMalloc(n) PyMem_Malloc(n) + #define PyMem_RawRealloc(p, n) PyMem_Realloc(p, n) + #define PyMem_RawFree(p) PyMem_Free(p) +#endif +#if CYTHON_COMPILING_IN_PYSTON + #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co) + #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno) +#else + #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) + #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) +#endif +#if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000 + #define __Pyx_PyThreadState_Current PyThreadState_GET() +#elif PY_VERSION_HEX >= 0x03060000 + #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() +#elif PY_VERSION_HEX >= 0x03000000 + #define __Pyx_PyThreadState_Current PyThreadState_GET() +#else + #define __Pyx_PyThreadState_Current _PyThreadState_Current +#endif +#if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) +#include "pythread.h" +#define Py_tss_NEEDS_INIT 0 +typedef int Py_tss_t; +static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) { + *key = PyThread_create_key(); + return 0; // PyThread_create_key reports success always +} +static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) { + Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t)); + *key = Py_tss_NEEDS_INIT; + return key; +} +static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) { + PyObject_Free(key); +} +static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) { + return *key != Py_tss_NEEDS_INIT; +} +static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) { + PyThread_delete_key(*key); + *key = Py_tss_NEEDS_INIT; +} +static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) { + return PyThread_set_key_value(*key, value); +} +static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { + return PyThread_get_key_value(*key); +} +#endif // TSS (Thread Specific Storage) API +#if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized) +#define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) +#else +#define __Pyx_PyDict_NewPresized(n) PyDict_New() +#endif +#if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION + #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) +#else + #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS +#define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) +#else +#define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name) +#endif +#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) + #define CYTHON_PEP393_ENABLED 1 + #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ + 0 : _PyUnicode_Ready((PyObject *)(op))) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) + #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) + #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) + #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) + #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) + #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch) + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) +#else + #define CYTHON_PEP393_ENABLED 0 + #define PyUnicode_1BYTE_KIND 1 + #define PyUnicode_2BYTE_KIND 2 + #define PyUnicode_4BYTE_KIND 4 + #define __Pyx_PyUnicode_READY(op) (0) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) + #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111) + #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) + #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) + #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) + #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch) + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) +#endif +#if CYTHON_COMPILING_IN_PYPY + #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) +#else + #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ + PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains) + #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check) + #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format) + #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) +#endif +#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) +#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) +#else + #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) +#endif +#if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) + #define PyObject_ASCII(o) PyObject_Repr(o) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBaseString_Type PyUnicode_Type + #define PyStringObject PyUnicodeObject + #define PyString_Type PyUnicode_Type + #define PyString_Check PyUnicode_Check + #define PyString_CheckExact PyUnicode_CheckExact + #define PyObject_Unicode PyObject_Str +#endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) + #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) +#else + #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) + #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) +#endif +#ifndef PySet_CheckExact + #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) +#endif +#if CYTHON_ASSUME_SAFE_MACROS + #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) +#else + #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyIntObject PyLongObject + #define PyInt_Type PyLong_Type + #define PyInt_Check(op) PyLong_Check(op) + #define PyInt_CheckExact(op) PyLong_CheckExact(op) + #define PyInt_FromString PyLong_FromString + #define PyInt_FromUnicode PyLong_FromUnicode + #define PyInt_FromLong PyLong_FromLong + #define PyInt_FromSize_t PyLong_FromSize_t + #define PyInt_FromSsize_t PyLong_FromSsize_t + #define PyInt_AsLong PyLong_AsLong + #define PyInt_AS_LONG PyLong_AS_LONG + #define PyInt_AsSsize_t PyLong_AsSsize_t + #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask + #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask + #define PyNumber_Int PyNumber_Long +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBoolObject PyLongObject +#endif +#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY + #ifndef PyUnicode_InternFromString + #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) + #endif +#endif +#if PY_VERSION_HEX < 0x030200A4 + typedef long Py_hash_t; + #define __Pyx_PyInt_FromHash_t PyInt_FromLong + #define __Pyx_PyInt_AsHash_t PyInt_AsLong +#else + #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t + #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t +#endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : (Py_INCREF(func), func)) +#else + #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) +#endif +#if CYTHON_USE_ASYNC_SLOTS + #if PY_VERSION_HEX >= 0x030500B1 + #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods + #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) + #else + #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) + #endif +#else + #define __Pyx_PyType_AsAsync(obj) NULL +#endif +#ifndef __Pyx_PyAsyncMethodsStruct + typedef struct { + unaryfunc am_await; + unaryfunc am_aiter; + unaryfunc am_anext; + } __Pyx_PyAsyncMethodsStruct; +#endif + +#if defined(WIN32) || defined(MS_WINDOWS) + #define _USE_MATH_DEFINES +#endif +#include +#ifdef NAN +#define __PYX_NAN() ((float) NAN) +#else +static CYTHON_INLINE float __PYX_NAN() { + float value; + memset(&value, 0xFF, sizeof(value)); + return value; +} +#endif +#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) +#define __Pyx_truncl trunc +#else +#define __Pyx_truncl truncl +#endif + + +#define __PYX_ERR(f_index, lineno, Ln_error) \ +{ \ + __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \ +} + +#ifndef __PYX_EXTERN_C + #ifdef __cplusplus + #define __PYX_EXTERN_C extern "C" + #else + #define __PYX_EXTERN_C extern + #endif +#endif + +#define __PYX_HAVE__gevent___greenlet +#define __PYX_HAVE_API__gevent___greenlet +/* Early includes */ +#include "greenlet/greenlet.h" +#include "frameobject.h" +#ifdef _OPENMP +#include +#endif /* _OPENMP */ + +#if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) +#define CYTHON_WITHOUT_ASSERTIONS +#endif + +typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; + const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; + +#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 +#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0 +#define __PYX_DEFAULT_STRING_ENCODING "" +#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString +#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#define __Pyx_uchar_cast(c) ((unsigned char)c) +#define __Pyx_long_cast(x) ((long)x) +#define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ + (sizeof(type) < sizeof(Py_ssize_t)) ||\ + (sizeof(type) > sizeof(Py_ssize_t) &&\ + likely(v < (type)PY_SSIZE_T_MAX ||\ + v == (type)PY_SSIZE_T_MAX) &&\ + (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ + v == (type)PY_SSIZE_T_MIN))) ||\ + (sizeof(type) == sizeof(Py_ssize_t) &&\ + (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ + v == (type)PY_SSIZE_T_MAX))) ) +static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) { + return (size_t) i < (size_t) limit; +} +#if defined (__cplusplus) && __cplusplus >= 201103L + #include + #define __Pyx_sst_abs(value) std::abs(value) +#elif SIZEOF_INT >= SIZEOF_SIZE_T + #define __Pyx_sst_abs(value) abs(value) +#elif SIZEOF_LONG >= SIZEOF_SIZE_T + #define __Pyx_sst_abs(value) labs(value) +#elif defined (_MSC_VER) + #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) +#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define __Pyx_sst_abs(value) llabs(value) +#elif defined (__GNUC__) + #define __Pyx_sst_abs(value) __builtin_llabs(value) +#else + #define __Pyx_sst_abs(value) ((value<0) ? -value : value) +#endif +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*); +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); +#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) +#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) +#define __Pyx_PyBytes_FromString PyBytes_FromString +#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); +#if PY_MAJOR_VERSION < 3 + #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#else + #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize +#endif +#define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) +#define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) +#define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) +#define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) +#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) +static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) { + const Py_UNICODE *u_end = u; + while (*u_end++) ; + return (size_t)(u_end - u - 1); +} +#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) +#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode +#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode +#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) +#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) +static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); +static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*); +static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); +#define __Pyx_PySequence_Tuple(obj)\ + (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); +#if CYTHON_ASSUME_SAFE_MACROS +#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) +#else +#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) +#endif +#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) +#if PY_MAJOR_VERSION >= 3 +#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) +#else +#define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) +#endif +#define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x)) +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII +static int __Pyx_sys_getdefaultencoding_not_ascii; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + PyObject* ascii_chars_u = NULL; + PyObject* ascii_chars_b = NULL; + const char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + if (strcmp(default_encoding_c, "ascii") == 0) { + __Pyx_sys_getdefaultencoding_not_ascii = 0; + } else { + char ascii_chars[128]; + int c; + for (c = 0; c < 128; c++) { + ascii_chars[c] = c; + } + __Pyx_sys_getdefaultencoding_not_ascii = 1; + ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); + if (!ascii_chars_u) goto bad; + ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); + if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { + PyErr_Format( + PyExc_ValueError, + "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", + default_encoding_c); + goto bad; + } + Py_DECREF(ascii_chars_u); + Py_DECREF(ascii_chars_b); + } + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + Py_XDECREF(ascii_chars_u); + Py_XDECREF(ascii_chars_b); + return -1; +} +#endif +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) +#else +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +static char* __PYX_DEFAULT_STRING_ENCODING; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1); + if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; + strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + return -1; +} +#endif +#endif + + +/* Test for GCC > 2.95 */ +#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) + #define likely(x) __builtin_expect(!!(x), 1) + #define unlikely(x) __builtin_expect(!!(x), 0) +#else /* !__GNUC__ or GCC < 2.95 */ + #define likely(x) (x) + #define unlikely(x) (x) +#endif /* __GNUC__ */ +static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } + +static PyObject *__pyx_m = NULL; +static PyObject *__pyx_d; +static PyObject *__pyx_b; +static PyObject *__pyx_cython_runtime = NULL; +static PyObject *__pyx_empty_tuple; +static PyObject *__pyx_empty_bytes; +static PyObject *__pyx_empty_unicode; +static int __pyx_lineno; +static int __pyx_clineno = 0; +static const char * __pyx_cfilenm= __FILE__; +static const char *__pyx_filename; + + +static const char *__pyx_f[] = { + "src\\gevent\\greenlet.py", + "src\\gevent\\_greenlet.pxd", + "src\\gevent\\__greenlet_primitives.pxd", + "src\\gevent\\__waiter.pxd", + "stringsource", + "src\\gevent\\__ident.pxd", +}; + +/*--- Type declarations ---*/ +struct __pyx_obj_6gevent_7__ident_ValuedWeakRef; +struct __pyx_obj_6gevent_7__ident_IdentRegistry; +struct __pyx_obj_6gevent_21__greenlet_primitives_TrackedRawGreenlet; +struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop; +struct __pyx_obj_6gevent_8__waiter_Waiter; +struct __pyx_obj_6gevent_8__waiter_MultipleWaiter; +struct __pyx_obj_6gevent_9_greenlet_SpawnedLink; +struct __pyx_obj_6gevent_9_greenlet_SuccessSpawnedLink; +struct __pyx_obj_6gevent_9_greenlet_FailureSpawnedLink; +struct __pyx_obj_6gevent_9_greenlet__Frame; +struct __pyx_obj_6gevent_9_greenlet_Greenlet; +struct __pyx_obj_6gevent_9_greenlet__dummy_event; +struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_object____list____object____object___to_py; +struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_object____list____object___to_py; +struct __pyx_opt_args_6gevent_9_greenlet_8Greenlet_join; +struct __pyx_opt_args_6gevent_9_greenlet_joinall; +struct __pyx_defaults; +typedef struct __pyx_defaults __pyx_defaults; + +/* "gevent/_greenlet.pxd":105 + * + * cpdef bint has_links(self) + * cpdef join(self, timeout=*) # <<<<<<<<<<<<<< + * cpdef bint ready(self) + * cpdef bint successful(self) + */ +struct __pyx_opt_args_6gevent_9_greenlet_8Greenlet_join { + int __pyx_n; + PyObject *timeout; +}; + +/* "gevent/_greenlet.pxd":174 + * + * @cython.locals(done=list) + * cpdef joinall(greenlets, timeout=*, raise_error=*, count=*) # <<<<<<<<<<<<<< + * + * cdef set _spawn_callbacks + */ +struct __pyx_opt_args_6gevent_9_greenlet_joinall { + int __pyx_n; + PyObject *timeout; + PyObject *raise_error; + PyObject *count; +}; +struct __pyx_defaults { + PyObject *__pyx_arg_exception; +}; + +/* "gevent/__ident.pxd":15 + * @cython.internal + * @cython.final + * cdef class ValuedWeakRef(ref): # <<<<<<<<<<<<<< + * cdef object value + * + */ +struct __pyx_obj_6gevent_7__ident_ValuedWeakRef { + PyWeakReference __pyx_base; + PyObject *value; +}; + + +/* "gevent/__ident.pxd":19 + * + * @cython.final + * cdef class IdentRegistry: # <<<<<<<<<<<<<< + * cdef object _registry + * cdef list _available_idents + */ +struct __pyx_obj_6gevent_7__ident_IdentRegistry { + PyObject_HEAD + struct __pyx_vtabstruct_6gevent_7__ident_IdentRegistry *__pyx_vtab; + PyObject *_registry; + PyObject *_available_idents; +}; + + +/* "gevent/__greenlet_primitives.pxd":37 + * return PyGreenlet_Switch(self, NULL, NULL) + * + * cdef class TrackedRawGreenlet(greenlet): # <<<<<<<<<<<<<< + * pass + * + */ +struct __pyx_obj_6gevent_21__greenlet_primitives_TrackedRawGreenlet { + PyGreenlet __pyx_base; +}; + + +/* "gevent/__greenlet_primitives.pxd":40 + * pass + * + * cdef class SwitchOutGreenletWithLoop(TrackedRawGreenlet): # <<<<<<<<<<<<<< + * cdef public loop + * + */ +struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop { + struct __pyx_obj_6gevent_21__greenlet_primitives_TrackedRawGreenlet __pyx_base; + struct __pyx_vtabstruct_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *__pyx_vtab; + PyObject *loop; +}; + + +/* "gevent/__waiter.pxd":33 + * _greenlet_imported = True + * + * cdef class Waiter: # <<<<<<<<<<<<<< + * cdef readonly SwitchOutGreenletWithLoop hub + * cdef readonly greenlet greenlet + */ +struct __pyx_obj_6gevent_8__waiter_Waiter { + PyObject_HEAD + struct __pyx_vtabstruct_6gevent_8__waiter_Waiter *__pyx_vtab; + struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *hub; + PyGreenlet *greenlet; + PyObject *value; + PyObject *_exception; +}; + + +/* "gevent/__waiter.pxd":47 + * @cython.final + * @cython.internal + * cdef class MultipleWaiter(Waiter): # <<<<<<<<<<<<<< + * cdef list _values + */ +struct __pyx_obj_6gevent_8__waiter_MultipleWaiter { + struct __pyx_obj_6gevent_8__waiter_Waiter __pyx_base; + PyObject *_values; +}; + + +/* "gevent/_greenlet.pxd":56 + * cdef void _init() + * + * cdef class SpawnedLink: # <<<<<<<<<<<<<< + * cdef public object callback + * + */ +struct __pyx_obj_6gevent_9_greenlet_SpawnedLink { + PyObject_HEAD + PyObject *callback; +}; + + +/* "gevent/_greenlet.pxd":61 + * + * @cython.final + * cdef class SuccessSpawnedLink(SpawnedLink): # <<<<<<<<<<<<<< + * pass + * + */ +struct __pyx_obj_6gevent_9_greenlet_SuccessSpawnedLink { + struct __pyx_obj_6gevent_9_greenlet_SpawnedLink __pyx_base; +}; + + +/* "gevent/_greenlet.pxd":65 + * + * @cython.final + * cdef class FailureSpawnedLink(SpawnedLink): # <<<<<<<<<<<<<< + * pass + * + */ +struct __pyx_obj_6gevent_9_greenlet_FailureSpawnedLink { + struct __pyx_obj_6gevent_9_greenlet_SpawnedLink __pyx_base; +}; + + +/* "gevent/_greenlet.pxd":71 + * @cython.internal + * @cython.freelist(1000) + * cdef class _Frame: # <<<<<<<<<<<<<< + * cdef readonly CodeType f_code + * cdef readonly int f_lineno + */ +struct __pyx_obj_6gevent_9_greenlet__Frame { + PyObject_HEAD + PyCodeObject *f_code; + int f_lineno; + struct __pyx_obj_6gevent_9_greenlet__Frame *f_back; +}; + + +/* "gevent/_greenlet.pxd":86 + * + * + * cdef class Greenlet(greenlet): # <<<<<<<<<<<<<< + * cdef readonly object value + * cdef readonly tuple args + */ +struct __pyx_obj_6gevent_9_greenlet_Greenlet { + PyGreenlet __pyx_base; + struct __pyx_vtabstruct_6gevent_9_greenlet_Greenlet *__pyx_vtab; + PyObject *value; + PyObject *args; + PyObject *kwargs; + PyObject *spawning_greenlet; + PyObject *spawn_tree_locals; + PyObject *_spawning_stack_frames; + PyObject *_links; + PyObject *_exc_info; + PyObject *_notifier; + PyObject *_start_event; + PyObject *_formatted_info; + PyObject *_ident; +}; + + +/* "gevent/_greenlet.pxd":157 + * @cython.final + * @cython.internal + * cdef class _dummy_event: # <<<<<<<<<<<<<< + * cdef readonly bint pending + * cdef readonly bint active + */ +struct __pyx_obj_6gevent_9_greenlet__dummy_event { + PyObject_HEAD + struct __pyx_vtabstruct_6gevent_9_greenlet__dummy_event *__pyx_vtab; + int pending; + int active; +}; + + +/* "cfunc.to_py":64 + * + * @cname("__Pyx_CFunc_object____list____object____object___to_py") + * cdef object __Pyx_CFunc_object____list____object____object___to_py(object (*f)(list, object, object) ): # <<<<<<<<<<<<<< + * def wrap(list greenlets, object exception, object waiter): + * """wrap(greenlets: list, exception, waiter)""" + */ +struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_object____list____object____object___to_py { + PyObject_HEAD + PyObject *(*__pyx_v_f)(PyObject *, PyObject *, PyObject *); +}; + +struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_object____list____object___to_py { + PyObject_HEAD + PyObject *(*__pyx_v_f)(PyObject *, PyObject *); +}; + + + +/* "gevent/__ident.pxd":19 + * + * @cython.final + * cdef class IdentRegistry: # <<<<<<<<<<<<<< + * cdef object _registry + * cdef list _available_idents + */ + +struct __pyx_vtabstruct_6gevent_7__ident_IdentRegistry { + PyObject *(*get_ident)(struct __pyx_obj_6gevent_7__ident_IdentRegistry *, PyObject *, int __pyx_skip_dispatch); + PyObject *(*_return_ident)(struct __pyx_obj_6gevent_7__ident_IdentRegistry *, struct __pyx_obj_6gevent_7__ident_ValuedWeakRef *, int __pyx_skip_dispatch); +}; +static struct __pyx_vtabstruct_6gevent_7__ident_IdentRegistry *__pyx_vtabptr_6gevent_7__ident_IdentRegistry; + + +/* "gevent/__greenlet_primitives.pxd":40 + * pass + * + * cdef class SwitchOutGreenletWithLoop(TrackedRawGreenlet): # <<<<<<<<<<<<<< + * cdef public loop + * + */ + +struct __pyx_vtabstruct_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop { + PyObject *(*__pyx_switch)(struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *, int __pyx_skip_dispatch); + PyObject *(*switch_out)(struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *, int __pyx_skip_dispatch); +}; +static struct __pyx_vtabstruct_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *__pyx_vtabptr_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop; + + +/* "gevent/__waiter.pxd":33 + * _greenlet_imported = True + * + * cdef class Waiter: # <<<<<<<<<<<<<< + * cdef readonly SwitchOutGreenletWithLoop hub + * cdef readonly greenlet greenlet + */ + +struct __pyx_vtabstruct_6gevent_8__waiter_Waiter { + PyObject *(*get)(struct __pyx_obj_6gevent_8__waiter_Waiter *, int __pyx_skip_dispatch); + PyObject *(*clear)(struct __pyx_obj_6gevent_8__waiter_Waiter *, int __pyx_skip_dispatch); +}; +static struct __pyx_vtabstruct_6gevent_8__waiter_Waiter *__pyx_vtabptr_6gevent_8__waiter_Waiter; + + +/* "gevent/__waiter.pxd":47 + * @cython.final + * @cython.internal + * cdef class MultipleWaiter(Waiter): # <<<<<<<<<<<<<< + * cdef list _values + */ + +struct __pyx_vtabstruct_6gevent_8__waiter_MultipleWaiter { + struct __pyx_vtabstruct_6gevent_8__waiter_Waiter __pyx_base; +}; +static struct __pyx_vtabstruct_6gevent_8__waiter_MultipleWaiter *__pyx_vtabptr_6gevent_8__waiter_MultipleWaiter; + + +/* "src/gevent/greenlet.py":157 + * _greenlet__init__ = greenlet.__init__ + * + * class Greenlet(greenlet): # <<<<<<<<<<<<<< + * """ + * A light-weight cooperatively-scheduled execution unit. + */ + +struct __pyx_vtabstruct_6gevent_9_greenlet_Greenlet { + int (*has_links)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *, int __pyx_skip_dispatch); + PyObject *(*join)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_9_greenlet_8Greenlet_join *__pyx_optional_args); + int (*ready)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *, int __pyx_skip_dispatch); + int (*successful)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *, int __pyx_skip_dispatch); + PyObject *(*rawlink)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *, PyObject *, int __pyx_skip_dispatch); + PyObject *(*_formatinfo)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *, int __pyx_skip_dispatch); + PyObject *(*_get_minimal_ident)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *); + int (*__pyx___started_but_aborted)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *); + int (*__pyx___start_cancelled_by_kill)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *); + int (*__pyx___start_pending)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *); + int (*__pyx___never_started_or_killed)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *); + int (*__pyx___start_completed)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *); + PyObject *(*__pyx___handle_death_before_start)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *, PyObject *); + PyObject *(*__pyx___cancel_start)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *); + PyObject *(*_report_result)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *, PyObject *); + PyObject *(*_report_error)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *, PyObject *); + PyObject *(*_notify_links)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *, int __pyx_skip_dispatch); +}; +static struct __pyx_vtabstruct_6gevent_9_greenlet_Greenlet *__pyx_vtabptr_6gevent_9_greenlet_Greenlet; + + +/* "src/gevent/greenlet.py":870 + * + * + * class _dummy_event(object): # <<<<<<<<<<<<<< + * __slots__ = ('pending', 'active') + * + */ + +struct __pyx_vtabstruct_6gevent_9_greenlet__dummy_event { + PyObject *(*stop)(struct __pyx_obj_6gevent_9_greenlet__dummy_event *, int __pyx_skip_dispatch); + PyObject *(*start)(struct __pyx_obj_6gevent_9_greenlet__dummy_event *, PyObject *, int __pyx_skip_dispatch); + PyObject *(*close)(struct __pyx_obj_6gevent_9_greenlet__dummy_event *, int __pyx_skip_dispatch); +}; +static struct __pyx_vtabstruct_6gevent_9_greenlet__dummy_event *__pyx_vtabptr_6gevent_9_greenlet__dummy_event; +static PyObject *__pyx_f_6gevent_9_greenlet_12_dummy_event_stop(struct __pyx_obj_6gevent_9_greenlet__dummy_event *, int __pyx_skip_dispatch); +static PyObject *__pyx_f_6gevent_9_greenlet_12_dummy_event_start(struct __pyx_obj_6gevent_9_greenlet__dummy_event *, PyObject *, int __pyx_skip_dispatch); +static PyObject *__pyx_f_6gevent_9_greenlet_12_dummy_event_close(struct __pyx_obj_6gevent_9_greenlet__dummy_event *, int __pyx_skip_dispatch); + +/* --- Runtime support code (head) --- */ +/* Refnanny.proto */ +#ifndef CYTHON_REFNANNY + #define CYTHON_REFNANNY 0 +#endif +#if CYTHON_REFNANNY + typedef struct { + void (*INCREF)(void*, PyObject*, int); + void (*DECREF)(void*, PyObject*, int); + void (*GOTREF)(void*, PyObject*, int); + void (*GIVEREF)(void*, PyObject*, int); + void* (*SetupContext)(const char*, int, const char*); + void (*FinishContext)(void**); + } __Pyx_RefNannyAPIStruct; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); + #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; +#ifdef WITH_THREAD + #define __Pyx_RefNannySetupContext(name, acquire_gil)\ + if (acquire_gil) {\ + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ + PyGILState_Release(__pyx_gilstate_save);\ + } else {\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ + } +#else + #define __Pyx_RefNannySetupContext(name, acquire_gil)\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) +#endif + #define __Pyx_RefNannyFinishContext()\ + __Pyx_RefNanny->FinishContext(&__pyx_refnanny) + #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0) + #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) + #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) + #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) +#else + #define __Pyx_RefNannyDeclarations + #define __Pyx_RefNannySetupContext(name, acquire_gil) + #define __Pyx_RefNannyFinishContext() + #define __Pyx_INCREF(r) Py_INCREF(r) + #define __Pyx_DECREF(r) Py_DECREF(r) + #define __Pyx_GOTREF(r) + #define __Pyx_GIVEREF(r) + #define __Pyx_XINCREF(r) Py_XINCREF(r) + #define __Pyx_XDECREF(r) Py_XDECREF(r) + #define __Pyx_XGOTREF(r) + #define __Pyx_XGIVEREF(r) +#endif +#define __Pyx_XDECREF_SET(r, v) do {\ + PyObject *tmp = (PyObject *) r;\ + r = v; __Pyx_XDECREF(tmp);\ + } while (0) +#define __Pyx_DECREF_SET(r, v) do {\ + PyObject *tmp = (PyObject *) r;\ + r = v; __Pyx_DECREF(tmp);\ + } while (0) +#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) +#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) + +/* PyObjectGetAttrStr.proto */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); +#else +#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) +#endif + +/* GetBuiltinName.proto */ +static PyObject *__Pyx_GetBuiltinName(PyObject *name); + +/* RaiseDoubleKeywords.proto */ +static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); + +/* ParseKeywords.proto */ +static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\ + PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\ + const char* function_name); + +/* RaiseArgTupleInvalid.proto */ +static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, + Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); + +/* CallableCheck.proto */ +#if CYTHON_USE_TYPE_SLOTS && PY_MAJOR_VERSION >= 3 +#define __Pyx_PyCallable_Check(obj) ((obj)->ob_type->tp_call != NULL) +#else +#define __Pyx_PyCallable_Check(obj) PyCallable_Check(obj) +#endif + +/* PyCFunctionFastCall.proto */ +#if CYTHON_FAST_PYCCALL +static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs); +#else +#define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL) +#endif + +/* PyFunctionFastCall.proto */ +#if CYTHON_FAST_PYCALL +#define __Pyx_PyFunction_FastCall(func, args, nargs)\ + __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) +#if 1 || PY_VERSION_HEX < 0x030600B1 +static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs); +#else +#define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs) +#endif +#define __Pyx_BUILD_ASSERT_EXPR(cond)\ + (sizeof(char [1 - 2*!(cond)]) - 1) +#ifndef Py_MEMBER_SIZE +#define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member) +#endif + static size_t __pyx_pyframe_localsplus_offset = 0; + #include "frameobject.h" + #define __Pxy_PyFrame_Initialize_Offsets()\ + ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\ + (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus))) + #define __Pyx_PyFrame_GetLocalsplus(frame)\ + (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset)) +#endif + +/* PyObjectCall.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); +#else +#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) +#endif + +/* PyObjectCallMethO.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); +#endif + +/* PyObjectCallOneArg.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); + +/* PyThreadStateGet.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; +#define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; +#define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type +#else +#define __Pyx_PyThreadState_declare +#define __Pyx_PyThreadState_assign +#define __Pyx_PyErr_Occurred() PyErr_Occurred() +#endif + +/* PyErrFetchRestore.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) +#define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) +#define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) +#define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) +#define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); +static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) +#else +#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) +#endif +#else +#define __Pyx_PyErr_Clear() PyErr_Clear() +#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) +#define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) +#define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb) +#define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) +#endif + +/* RaiseException.proto */ +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); + +/* PyObjectCall2Args.proto */ +static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2); + +/* PyErrExceptionMatches.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) +static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); +#else +#define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) +#endif + +/* GetAttr.proto */ +static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *); + +/* GetAttr3.proto */ +static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *); + +/* IncludeStringH.proto */ +#include + +/* BytesEquals.proto */ +static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); + +/* UnicodeEquals.proto */ +static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); + +/* StrEquals.proto */ +#if PY_MAJOR_VERSION >= 3 +#define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals +#else +#define __Pyx_PyString_Equals __Pyx_PyBytes_Equals +#endif + +/* PyObjectCallNoArg.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); +#else +#define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL) +#endif + +/* ExtTypeTest.proto */ +static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); + +/* GetItemInt.proto */ +#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ + __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\ + (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\ + __Pyx_GetItemInt_Generic(o, to_py_func(i)))) +#define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ + __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ + (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL)) +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, + int wraparound, int boundscheck); +#define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ + __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ + (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL)) +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, + int wraparound, int boundscheck); +static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j); +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, + int is_list, int wraparound, int boundscheck); + +/* GetTopmostException.proto */ +#if CYTHON_USE_EXC_INFO_STACK +static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate); +#endif + +/* SaveResetException.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); +#else +#define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb) +#define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb) +#endif + +/* GetException.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb) +static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#else +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); +#endif + +/* ListAppend.proto */ +#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS +static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) { + PyListObject* L = (PyListObject*) list; + Py_ssize_t len = Py_SIZE(list); + if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) { + Py_INCREF(x); + PyList_SET_ITEM(list, len, x); + Py_SIZE(list) = len+1; + return 0; + } + return PyList_Append(list, x); +} +#else +#define __Pyx_PyList_Append(L,x) PyList_Append(L,x) +#endif + +/* PyObjectSetAttrStr.proto */ +#if CYTHON_USE_TYPE_SLOTS +#define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o, n, NULL) +static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value); +#else +#define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n) +#define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v) +#endif + +/* ListExtend.proto */ +static CYTHON_INLINE int __Pyx_PyList_Extend(PyObject* L, PyObject* v) { +#if CYTHON_COMPILING_IN_CPYTHON + PyObject* none = _PyList_Extend((PyListObject*)L, v); + if (unlikely(!none)) + return -1; + Py_DECREF(none); + return 0; +#else + return PyList_SetSlice(L, PY_SSIZE_T_MAX, PY_SSIZE_T_MAX, v); +#endif +} + +/* WriteUnraisableException.proto */ +static void __Pyx_WriteUnraisable(const char *name, int clineno, + int lineno, const char *filename, + int full_traceback, int nogil); + +/* PySequenceContains.proto */ +static CYTHON_INLINE int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* seq, int eq) { + int result = PySequence_Contains(seq, item); + return unlikely(result < 0) ? result : (result == (eq == Py_EQ)); +} + +/* ListCompAppend.proto */ +#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS +static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) { + PyListObject* L = (PyListObject*) list; + Py_ssize_t len = Py_SIZE(list); + if (likely(L->allocated > len)) { + Py_INCREF(x); + PyList_SET_ITEM(list, len, x); + Py_SIZE(list) = len+1; + return 0; + } + return PyList_Append(list, x); +} +#else +#define __Pyx_ListComp_Append(L,x) PyList_Append(L,x) +#endif + +/* IterFinish.proto */ +static CYTHON_INLINE int __Pyx_IterFinish(void); + +/* PyObjectGetMethod.proto */ +static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method); + +/* PyObjectCallMethod0.proto */ +static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name); + +/* RaiseNeedMoreValuesToUnpack.proto */ +static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); + +/* RaiseTooManyValuesToUnpack.proto */ +static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); + +/* UnpackItemEndCheck.proto */ +static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); + +/* RaiseNoneIterError.proto */ +static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void); + +/* UnpackTupleError.proto */ +static void __Pyx_UnpackTupleError(PyObject *, Py_ssize_t index); + +/* UnpackTuple2.proto */ +#define __Pyx_unpack_tuple2(tuple, value1, value2, is_tuple, has_known_size, decref_tuple)\ + (likely(is_tuple || PyTuple_Check(tuple)) ?\ + (likely(has_known_size || PyTuple_GET_SIZE(tuple) == 2) ?\ + __Pyx_unpack_tuple2_exact(tuple, value1, value2, decref_tuple) :\ + (__Pyx_UnpackTupleError(tuple, 2), -1)) :\ + __Pyx_unpack_tuple2_generic(tuple, value1, value2, has_known_size, decref_tuple)) +static CYTHON_INLINE int __Pyx_unpack_tuple2_exact( + PyObject* tuple, PyObject** value1, PyObject** value2, int decref_tuple); +static int __Pyx_unpack_tuple2_generic( + PyObject* tuple, PyObject** value1, PyObject** value2, int has_known_size, int decref_tuple); + +/* dict_iter.proto */ +static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* dict, int is_dict, PyObject* method_name, + Py_ssize_t* p_orig_length, int* p_is_dict); +static CYTHON_INLINE int __Pyx_dict_iter_next(PyObject* dict_or_iter, Py_ssize_t orig_length, Py_ssize_t* ppos, + PyObject** pkey, PyObject** pvalue, PyObject** pitem, int is_dict); + +/* StringJoin.proto */ +#if PY_MAJOR_VERSION < 3 +#define __Pyx_PyString_Join __Pyx_PyBytes_Join +#define __Pyx_PyBaseString_Join(s, v) (PyUnicode_CheckExact(s) ? PyUnicode_Join(s, v) : __Pyx_PyBytes_Join(s, v)) +#else +#define __Pyx_PyString_Join PyUnicode_Join +#define __Pyx_PyBaseString_Join PyUnicode_Join +#endif +#if CYTHON_COMPILING_IN_CPYTHON + #if PY_MAJOR_VERSION < 3 + #define __Pyx_PyBytes_Join _PyString_Join + #else + #define __Pyx_PyBytes_Join _PyBytes_Join + #endif +#else +static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values); +#endif + +/* KeywordStringCheck.proto */ +static int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* function_name, int kw_allowed); + +/* SwapException.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#else +static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb); +#endif + +/* pyfrozenset_new.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyFrozenSet_New(PyObject* it); + +/* py_set_discard.proto */ +static CYTHON_INLINE int __Pyx_PySet_Discard(PyObject *set, PyObject *key); + +/* PyDictContains.proto */ +static CYTHON_INLINE int __Pyx_PyDict_ContainsTF(PyObject* item, PyObject* dict, int eq) { + int result = PyDict_Contains(dict, item); + return unlikely(result < 0) ? result : (result == (eq == Py_EQ)); +} + +/* GetModuleGlobalName.proto */ +#if CYTHON_USE_DICT_VERSIONS +#define __Pyx_GetModuleGlobalName(var, name) {\ + static PY_UINT64_T __pyx_dict_version = 0;\ + static PyObject *__pyx_dict_cached_value = NULL;\ + (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\ + (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\ + __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ +} +#define __Pyx_GetModuleGlobalNameUncached(var, name) {\ + PY_UINT64_T __pyx_dict_version;\ + PyObject *__pyx_dict_cached_value;\ + (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ +} +static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value); +#else +#define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name) +#define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name) +static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name); +#endif + +/* None.proto */ +static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname); + +/* py_dict_clear.proto */ +#define __Pyx_PyDict_Clear(d) (PyDict_Clear(d), 0) + +/* SliceObject.proto */ +#define __Pyx_PyObject_DelSlice(obj, cstart, cstop, py_start, py_stop, py_slice, has_cstart, has_cstop, wraparound)\ + __Pyx_PyObject_SetSlice(obj, (PyObject*)NULL, cstart, cstop, py_start, py_stop, py_slice, has_cstart, has_cstop, wraparound) +static CYTHON_INLINE int __Pyx_PyObject_SetSlice( + PyObject* obj, PyObject* value, Py_ssize_t cstart, Py_ssize_t cstop, + PyObject** py_start, PyObject** py_stop, PyObject** py_slice, + int has_cstart, int has_cstop, int wraparound); + +/* PyObjectCallMethod1.proto */ +static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg); + +/* pop_index.proto */ +static PyObject* __Pyx__PyObject_PopNewIndex(PyObject* L, PyObject* py_ix); +static PyObject* __Pyx__PyObject_PopIndex(PyObject* L, PyObject* py_ix); +#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS +static PyObject* __Pyx__PyList_PopIndex(PyObject* L, PyObject* py_ix, Py_ssize_t ix); +#define __Pyx_PyObject_PopIndex(L, py_ix, ix, is_signed, type, to_py_func) (\ + (likely(PyList_CheckExact(L) && __Pyx_fits_Py_ssize_t(ix, type, is_signed))) ?\ + __Pyx__PyList_PopIndex(L, py_ix, ix) : (\ + (unlikely(py_ix == Py_None)) ? __Pyx__PyObject_PopNewIndex(L, to_py_func(ix)) :\ + __Pyx__PyObject_PopIndex(L, py_ix))) +#define __Pyx_PyList_PopIndex(L, py_ix, ix, is_signed, type, to_py_func) (\ + __Pyx_fits_Py_ssize_t(ix, type, is_signed) ?\ + __Pyx__PyList_PopIndex(L, py_ix, ix) : (\ + (unlikely(py_ix == Py_None)) ? __Pyx__PyObject_PopNewIndex(L, to_py_func(ix)) :\ + __Pyx__PyObject_PopIndex(L, py_ix))) +#else +#define __Pyx_PyList_PopIndex(L, py_ix, ix, is_signed, type, to_py_func)\ + __Pyx_PyObject_PopIndex(L, py_ix, ix, is_signed, type, to_py_func) +#define __Pyx_PyObject_PopIndex(L, py_ix, ix, is_signed, type, to_py_func) (\ + (unlikely(py_ix == Py_None)) ? __Pyx__PyObject_PopNewIndex(L, to_py_func(ix)) :\ + __Pyx__PyObject_PopIndex(L, py_ix)) +#endif + +/* HasAttr.proto */ +static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *); + +/* set_iter.proto */ +static CYTHON_INLINE PyObject* __Pyx_set_iterator(PyObject* iterable, int is_set, + Py_ssize_t* p_orig_length, int* p_source_is_set); +static CYTHON_INLINE int __Pyx_set_iter_next( + PyObject* iter_obj, Py_ssize_t orig_length, + Py_ssize_t* ppos, PyObject **value, + int source_is_set); + +/* ArgTypeTest.proto */ +#define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\ + ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\ + __Pyx__ArgTypeTest(obj, type, name, exact)) +static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact); + +/* FetchCommonType.proto */ +static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); + +/* CythonFunction.proto */ +#define __Pyx_CyFunction_USED 1 +#define __Pyx_CYFUNCTION_STATICMETHOD 0x01 +#define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 +#define __Pyx_CYFUNCTION_CCLASS 0x04 +#define __Pyx_CyFunction_GetClosure(f)\ + (((__pyx_CyFunctionObject *) (f))->func_closure) +#define __Pyx_CyFunction_GetClassObj(f)\ + (((__pyx_CyFunctionObject *) (f))->func_classobj) +#define __Pyx_CyFunction_Defaults(type, f)\ + ((type *)(((__pyx_CyFunctionObject *) (f))->defaults)) +#define __Pyx_CyFunction_SetDefaultsGetter(f, g)\ + ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g) +typedef struct { + PyCFunctionObject func; +#if PY_VERSION_HEX < 0x030500A0 + PyObject *func_weakreflist; +#endif + PyObject *func_dict; + PyObject *func_name; + PyObject *func_qualname; + PyObject *func_doc; + PyObject *func_globals; + PyObject *func_code; + PyObject *func_closure; + PyObject *func_classobj; + void *defaults; + int defaults_pyobjects; + int flags; + PyObject *defaults_tuple; + PyObject *defaults_kwdict; + PyObject *(*defaults_getter)(PyObject *); + PyObject *func_annotations; +} __pyx_CyFunctionObject; +static PyTypeObject *__pyx_CyFunctionType = 0; +#define __Pyx_CyFunction_Check(obj) (__Pyx_TypeCheck(obj, __pyx_CyFunctionType)) +#define __Pyx_CyFunction_NewEx(ml, flags, qualname, self, module, globals, code)\ + __Pyx_CyFunction_New(__pyx_CyFunctionType, ml, flags, qualname, self, module, globals, code) +static PyObject *__Pyx_CyFunction_New(PyTypeObject *, PyMethodDef *ml, + int flags, PyObject* qualname, + PyObject *self, + PyObject *module, PyObject *globals, + PyObject* code); +static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, + size_t size, + int pyobjects); +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, + PyObject *tuple); +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, + PyObject *dict); +static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m, + PyObject *dict); +static int __pyx_CyFunction_init(void); + +/* PyObject_GenericGetAttrNoDict.proto */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name); +#else +#define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr +#endif + +/* PyObject_GenericGetAttr.proto */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name); +#else +#define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr +#endif + +/* CallNextTpDealloc.proto */ +static void __Pyx_call_next_tp_dealloc(PyObject* obj, destructor current_tp_dealloc); + +/* CallNextTpTraverse.proto */ +static int __Pyx_call_next_tp_traverse(PyObject* obj, visitproc v, void *a, traverseproc current_tp_traverse); + +/* CallNextTpClear.proto */ +static void __Pyx_call_next_tp_clear(PyObject* obj, inquiry current_tp_dealloc); + +/* TypeImport.proto */ +#ifndef __PYX_HAVE_RT_ImportType_proto +#define __PYX_HAVE_RT_ImportType_proto +enum __Pyx_ImportType_CheckSize { + __Pyx_ImportType_CheckSize_Error = 0, + __Pyx_ImportType_CheckSize_Warn = 1, + __Pyx_ImportType_CheckSize_Ignore = 2 +}; +static PyTypeObject *__Pyx_ImportType(PyObject* module, const char *module_name, const char *class_name, size_t size, enum __Pyx_ImportType_CheckSize check_size); +#endif + +/* SetVTable.proto */ +static int __Pyx_SetVtable(PyObject *dict, void *vtable); + +/* GetVTable.proto */ +static void* __Pyx_GetVtable(PyObject *dict); + +/* Import.proto */ +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); + +/* ImportFrom.proto */ +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); + +/* GetNameInClass.proto */ +#define __Pyx_GetNameInClass(var, nmspace, name) (var) = __Pyx__GetNameInClass(nmspace, name) +static PyObject *__Pyx__GetNameInClass(PyObject *nmspace, PyObject *name); + +/* ClassMethod.proto */ +#include "descrobject.h" +static PyObject* __Pyx_Method_ClassMethod(PyObject *method); + +/* Globals.proto */ +static PyObject* __Pyx_Globals(void); + +/* CLineInTraceback.proto */ +#ifdef CYTHON_CLINE_IN_TRACEBACK +#define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) +#else +static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line); +#endif + +/* CodeObjectCache.proto */ +typedef struct { + PyCodeObject* code_object; + int code_line; +} __Pyx_CodeObjectCacheEntry; +struct __Pyx_CodeObjectCache { + int count; + int max_count; + __Pyx_CodeObjectCacheEntry* entries; +}; +static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); +static PyCodeObject *__pyx_find_code_object(int code_line); +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); + +/* AddTraceback.proto */ +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename); + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); + +/* CIntFromPy.proto */ +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); + +/* CIntFromPy.proto */ +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); + +/* FastTypeChecks.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) +static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b); +static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type); +static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2); +#else +#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) +#define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) +#define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) +#endif +#define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) + +/* CheckBinaryVersion.proto */ +static int __Pyx_check_binary_version(void); + +/* VoidPtrExport.proto */ +static int __Pyx_ExportVoidPtr(PyObject *name, void *p, const char *sig); + +/* FunctionExport.proto */ +static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig); + +/* VoidPtrImport.proto */ +static int __Pyx_ImportVoidPtr(PyObject *module, const char *name, void **p, const char *sig); + +/* FunctionImport.proto */ +static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig); + +/* InitStrings.proto */ +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); + +static PyObject *__pyx_f_6gevent_9_greenlet_8Greenlet__get_minimal_ident(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self); /* proto*/ +static int __pyx_f_6gevent_9_greenlet_8Greenlet___never_started_or_killed(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self); /* proto*/ +static int __pyx_f_6gevent_9_greenlet_8Greenlet___start_pending(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self); /* proto*/ +static int __pyx_f_6gevent_9_greenlet_8Greenlet___start_cancelled_by_kill(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self); /* proto*/ +static int __pyx_f_6gevent_9_greenlet_8Greenlet___start_completed(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self); /* proto*/ +static int __pyx_f_6gevent_9_greenlet_8Greenlet___started_but_aborted(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self); /* proto*/ +static PyObject *__pyx_f_6gevent_9_greenlet_8Greenlet___cancel_start(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self); /* proto*/ +static PyObject *__pyx_f_6gevent_9_greenlet_8Greenlet___handle_death_before_start(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self, PyObject *__pyx_v_args); /* proto*/ +static int __pyx_f_6gevent_9_greenlet_8Greenlet_ready(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/ +static int __pyx_f_6gevent_9_greenlet_8Greenlet_successful(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/ +static PyObject *__pyx_f_6gevent_9_greenlet_8Greenlet__formatinfo(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/ +static PyObject *__pyx_f_6gevent_9_greenlet_8Greenlet_join(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_9_greenlet_8Greenlet_join *__pyx_optional_args); /* proto*/ +static PyObject *__pyx_f_6gevent_9_greenlet_8Greenlet__report_result(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self, PyObject *__pyx_v_result); /* proto*/ +static PyObject *__pyx_f_6gevent_9_greenlet_8Greenlet__report_error(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self, PyObject *__pyx_v_exc_info); /* proto*/ +static int __pyx_f_6gevent_9_greenlet_8Greenlet_has_links(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/ +static PyObject *__pyx_f_6gevent_9_greenlet_8Greenlet_rawlink(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self, PyObject *__pyx_v_callback, int __pyx_skip_dispatch); /* proto*/ +static PyObject *__pyx_f_6gevent_9_greenlet_8Greenlet__notify_links(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/ +static PyObject *__pyx_f_6gevent_9_greenlet_12_dummy_event_stop(CYTHON_UNUSED struct __pyx_obj_6gevent_9_greenlet__dummy_event *__pyx_v_self, CYTHON_UNUSED int __pyx_skip_dispatch); /* proto*/ +static PyObject *__pyx_f_6gevent_9_greenlet_12_dummy_event_start(CYTHON_UNUSED struct __pyx_obj_6gevent_9_greenlet__dummy_event *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_cb, CYTHON_UNUSED int __pyx_skip_dispatch); /* proto*/ +static PyObject *__pyx_f_6gevent_9_greenlet_12_dummy_event_close(CYTHON_UNUSED struct __pyx_obj_6gevent_9_greenlet__dummy_event *__pyx_v_self, CYTHON_UNUSED int __pyx_skip_dispatch); /* proto*/ + +/* Module declarations from 'cython' */ + +/* Module declarations from 'weakref' */ + +/* Module declarations from 'gevent.__ident' */ +static PyTypeObject *__pyx_ptype_6gevent_7__ident_ref = 0; +static PyTypeObject *__pyx_ptype_6gevent_7__ident_ValuedWeakRef = 0; +static PyTypeObject *__pyx_ptype_6gevent_7__ident_IdentRegistry = 0; +static PyObject **__pyx_vp_6gevent_7__ident_heappop = 0; +#define __pyx_v_6gevent_7__ident_heappop (*__pyx_vp_6gevent_7__ident_heappop) +static PyObject **__pyx_vp_6gevent_7__ident_heappush = 0; +#define __pyx_v_6gevent_7__ident_heappush (*__pyx_vp_6gevent_7__ident_heappush) +static PyObject **__pyx_vp_6gevent_7__ident_WeakKeyDictionary = 0; +#define __pyx_v_6gevent_7__ident_WeakKeyDictionary (*__pyx_vp_6gevent_7__ident_WeakKeyDictionary) + +/* Module declarations from 'greenlet' */ + +/* Module declarations from 'gevent.__greenlet_primitives' */ +static PyTypeObject *__pyx_ptype_6gevent_21__greenlet_primitives_greenlet = 0; +static PyTypeObject *__pyx_ptype_6gevent_21__greenlet_primitives_TrackedRawGreenlet = 0; +static PyTypeObject *__pyx_ptype_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop = 0; +static PyObject **__pyx_vp_6gevent_21__greenlet_primitives_get_objects = 0; +#define __pyx_v_6gevent_21__greenlet_primitives_get_objects (*__pyx_vp_6gevent_21__greenlet_primitives_get_objects) +static PyObject **__pyx_vp_6gevent_21__greenlet_primitives_wref = 0; +#define __pyx_v_6gevent_21__greenlet_primitives_wref (*__pyx_vp_6gevent_21__greenlet_primitives_wref) +static PyObject **__pyx_vp_6gevent_21__greenlet_primitives_BlockingSwitchOutError = 0; +#define __pyx_v_6gevent_21__greenlet_primitives_BlockingSwitchOutError (*__pyx_vp_6gevent_21__greenlet_primitives_BlockingSwitchOutError) +static int *__pyx_vp_6gevent_21__greenlet_primitives__greenlet_imported = 0; +#define __pyx_v_6gevent_21__greenlet_primitives__greenlet_imported (*__pyx_vp_6gevent_21__greenlet_primitives__greenlet_imported) + +/* Module declarations from 'gevent.__hub_local' */ +static PyObject **__pyx_vp_6gevent_11__hub_local__threadlocal = 0; +#define __pyx_v_6gevent_11__hub_local__threadlocal (*__pyx_vp_6gevent_11__hub_local__threadlocal) +static struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *(*__pyx_f_6gevent_11__hub_local_get_hub_noargs)(int __pyx_skip_dispatch); /*proto*/ + +/* Module declarations from 'gevent.__waiter' */ +static PyTypeObject *__pyx_ptype_6gevent_8__waiter_greenlet = 0; +static PyTypeObject *__pyx_ptype_6gevent_8__waiter_Waiter = 0; +static PyTypeObject *__pyx_ptype_6gevent_8__waiter_MultipleWaiter = 0; +static PyObject **__pyx_vp_6gevent_8__waiter_sys = 0; +#define __pyx_v_6gevent_8__waiter_sys (*__pyx_vp_6gevent_8__waiter_sys) +static PyObject **__pyx_vp_6gevent_8__waiter_ConcurrentObjectUseError = 0; +#define __pyx_v_6gevent_8__waiter_ConcurrentObjectUseError (*__pyx_vp_6gevent_8__waiter_ConcurrentObjectUseError) +static int *__pyx_vp_6gevent_8__waiter__greenlet_imported = 0; +#define __pyx_v_6gevent_8__waiter__greenlet_imported (*__pyx_vp_6gevent_8__waiter__greenlet_imported) +static PyObject **__pyx_vp_6gevent_8__waiter__NONE = 0; +#define __pyx_v_6gevent_8__waiter__NONE (*__pyx_vp_6gevent_8__waiter__NONE) + +/* Module declarations from 'types' */ + +/* Module declarations from 'gevent._greenlet' */ +static PyTypeObject *__pyx_ptype_6gevent_9_greenlet_greenlet = 0; +static PyTypeObject *__pyx_ptype_6gevent_9_greenlet_CodeType = 0; +static PyTypeObject *__pyx_ptype_6gevent_9_greenlet_FrameType = 0; +static PyTypeObject *__pyx_ptype_6gevent_9_greenlet_SpawnedLink = 0; +static PyTypeObject *__pyx_ptype_6gevent_9_greenlet_SuccessSpawnedLink = 0; +static PyTypeObject *__pyx_ptype_6gevent_9_greenlet_FailureSpawnedLink = 0; +static PyTypeObject *__pyx_ptype_6gevent_9_greenlet__Frame = 0; +static PyTypeObject *__pyx_ptype_6gevent_9_greenlet_Greenlet = 0; +static PyTypeObject *__pyx_ptype_6gevent_9_greenlet__dummy_event = 0; +static PyTypeObject *__pyx_ptype___pyx_scope_struct____Pyx_CFunc_object____list____object____object___to_py = 0; +static PyTypeObject *__pyx_ptype___pyx_scope_struct____Pyx_CFunc_object____list____object___to_py = 0; +static int __pyx_v_6gevent_9_greenlet__PYPY; +static PyObject *__pyx_v_6gevent_9_greenlet_sys_getframe = 0; +static PyObject *__pyx_v_6gevent_9_greenlet_sys_exc_info = 0; +static PyObject *__pyx_v_6gevent_9_greenlet_Timeout = 0; +static PyObject *__pyx_v_6gevent_9_greenlet_GreenletExit = 0; +static PyObject *__pyx_v_6gevent_9_greenlet_InvalidSwitchError = 0; +static int __pyx_v_6gevent_9_greenlet__greenlet_imported; +static PyObject *__pyx_v_6gevent_9_greenlet__greenlet__init__ = 0; +static PyObject *__pyx_v_6gevent_9_greenlet__threadlocal = 0; +static PyObject *__pyx_v_6gevent_9_greenlet_get_hub_class = 0; +static PyObject *__pyx_v_6gevent_9_greenlet_wref = 0; +static PyObject *__pyx_v_6gevent_9_greenlet_dump_traceback = 0; +static PyObject *__pyx_v_6gevent_9_greenlet_load_traceback = 0; +static PyObject *__pyx_v_6gevent_9_greenlet_wait = 0; +static PyObject *__pyx_v_6gevent_9_greenlet_iwait = 0; +static PyObject *__pyx_v_6gevent_9_greenlet_reraise = 0; +static PyObject *__pyx_v_6gevent_9_greenlet_GEVENT_CONFIG = 0; +static struct __pyx_obj_6gevent_9_greenlet__dummy_event *__pyx_v_6gevent_9_greenlet__cancelled_start_event = 0; +static struct __pyx_obj_6gevent_9_greenlet__dummy_event *__pyx_v_6gevent_9_greenlet__start_completed_event = 0; +static PyObject *__pyx_v_6gevent_9_greenlet__spawn_callbacks = 0; +static CYTHON_INLINE PyGreenlet *__pyx_f_6gevent_9_greenlet_getcurrent(void); /*proto*/ +static CYTHON_INLINE void __pyx_f_6gevent_9_greenlet_greenlet_init(void); /*proto*/ +static void __pyx_f_6gevent_9_greenlet__init(void); /*proto*/ +static CYTHON_INLINE PyObject *__pyx_f_6gevent_9_greenlet__extract_stack(int); /*proto*/ +static struct __pyx_obj_6gevent_9_greenlet__Frame *__pyx_f_6gevent_9_greenlet__Frame_from_list(PyObject *); /*proto*/ +static PyObject *__pyx_f_6gevent_9_greenlet__killall3(PyObject *, PyObject *, PyObject *); /*proto*/ +static PyObject *__pyx_f_6gevent_9_greenlet__killall(PyObject *, PyObject *); /*proto*/ +static PyObject *__pyx_f_6gevent_9_greenlet_joinall(PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_9_greenlet_joinall *__pyx_optional_args); /*proto*/ +static void __pyx_f_6gevent_9_greenlet__call_spawn_callbacks(struct __pyx_obj_6gevent_9_greenlet_Greenlet *); /*proto*/ +static PyObject *__Pyx_CFunc_object____list____object____object___to_py(PyObject *(*)(PyObject *, PyObject *, PyObject *)); /*proto*/ +static PyObject *__Pyx_CFunc_object____list____object___to_py(PyObject *(*)(PyObject *, PyObject *)); /*proto*/ +#define __Pyx_MODULE_NAME "gevent._greenlet" +extern int __pyx_module_is_main_gevent___greenlet; +int __pyx_module_is_main_gevent___greenlet = 0; + +/* Implementation of 'gevent._greenlet' */ +static PyObject *__pyx_builtin___import__; +static PyObject *__pyx_builtin_NameError; +static PyObject *__pyx_builtin_staticmethod; +static PyObject *__pyx_builtin_TypeError; +static PyObject *__pyx_builtin_reversed; +static PyObject *__pyx_builtin_ValueError; +static PyObject *__pyx_builtin_AttributeError; +static PyObject *__pyx_builtin_hex; +static PyObject *__pyx_builtin_id; +static PyObject *__pyx_builtin_AssertionError; +static const char __pyx_k_g[] = "g"; +static const char __pyx_k_s[] = " \"%s\" "; +static const char __pyx_k_t[] = "t"; +static const char __pyx_k__2[] = " "; +static const char __pyx_k__3[] = ": "; +static const char __pyx_k__4[] = ">"; +static const char __pyx_k__5[] = ""; +static const char __pyx_k__6[] = "("; +static const char __pyx_k__7[] = ", "; +static const char __pyx_k__8[] = ")"; +static const char __pyx_k_cb[] = "cb"; +static const char __pyx_k_id[] = "id"; +static const char __pyx_k_all[] = "__all__"; +static const char __pyx_k_cls[] = "cls"; +static const char __pyx_k_get[] = "__get__"; +static const char __pyx_k_hex[] = "hex"; +static const char __pyx_k_pop[] = "pop"; +static const char __pyx_k_ref[] = "ref"; +static const char __pyx_k_run[] = "run"; +static const char __pyx_k_s_s[] = "%s=%s"; +static const char __pyx_k_sys[] = "sys"; +static const char __pyx_k_Lazy[] = "Lazy"; +static const char __pyx_k_PYPY[] = "_PYPY"; +static const char __pyx_k_args[] = "args"; +static const char __pyx_k_bool[] = "__bool__"; +static const char __pyx_k_call[] = "__call__"; +static const char __pyx_k_dead[] = "dead"; +static const char __pyx_k_dict[] = "__dict__"; +static const char __pyx_k_glet[] = "glet"; +static const char __pyx_k_init[] = "__init__"; +static const char __pyx_k_join[] = "join"; +static const char __pyx_k_kill[] = "_kill"; +static const char __pyx_k_link[] = "link"; +static const char __pyx_k_loop[] = "loop"; +static const char __pyx_k_main[] = "__main__"; +static const char __pyx_k_name[] = "__name__"; +static const char __pyx_k_self[] = "__self__"; +static const char __pyx_k_stop[] = "stop"; +static const char __pyx_k_test[] = "__test__"; +static const char __pyx_k_wait[] = "wait"; +static const char __pyx_k_wrap[] = "wrap"; +static const char __pyx_k_wref[] = "wref"; +static const char __pyx_k_Frame[] = "_Frame"; +static const char __pyx_k_alive[] = "alive"; +static const char __pyx_k_block[] = "block"; +static const char __pyx_k_class[] = "__class__"; +static const char __pyx_k_close[] = "close"; +static const char __pyx_k_count[] = "count"; +static const char __pyx_k_get_2[] = "get"; +static const char __pyx_k_items[] = "items"; +static const char __pyx_k_iwait[] = "iwait"; +static const char __pyx_k_ready[] = "ready"; +static const char __pyx_k_run_2[] = "_run"; +static const char __pyx_k_slots[] = "__slots__"; +static const char __pyx_k_spawn[] = "spawn"; +static const char __pyx_k_start[] = "start"; +static const char __pyx_k_throw[] = "throw"; +static const char __pyx_k_timer[] = "timer"; +static const char __pyx_k_PYPY_2[] = "PYPY"; +static const char __pyx_k_Waiter[] = "Waiter"; +static const char __pyx_k_active[] = "active"; +static const char __pyx_k_cancel[] = "cancel"; +static const char __pyx_k_config[] = "config"; +static const char __pyx_k_f_back[] = "f_back"; +static const char __pyx_k_f_code[] = "f_code"; +static const char __pyx_k_gevent[] = "gevent"; +static const char __pyx_k_import[] = "__import__"; +static const char __pyx_k_kill_2[] = "kill"; +static const char __pyx_k_kwargs[] = "kwargs"; +static const char __pyx_k_lambda[] = ""; +static const char __pyx_k_name_2[] = "name"; +static const char __pyx_k_parent[] = "parent"; +static const char __pyx_k_remove[] = "remove"; +static const char __pyx_k_result[] = "result"; +static const char __pyx_k_self_2[] = "self"; +static const char __pyx_k_source[] = "source"; +static const char __pyx_k_switch[] = "switch"; +static const char __pyx_k_unlink[] = "unlink"; +static const char __pyx_k_waiter[] = "waiter"; +static const char __pyx_k_Timeout[] = "Timeout"; +static const char __pyx_k_joinall[] = "joinall"; +static const char __pyx_k_killall[] = "killall"; +static const char __pyx_k_nonzero[] = "__nonzero__"; +static const char __pyx_k_pending[] = "pending"; +static const char __pyx_k_rawlink[] = "rawlink"; +static const char __pyx_k_reraise[] = "reraise"; +static const char __pyx_k_s_sat_s[] = "<%s%sat %s"; +static const char __pyx_k_seconds[] = "seconds"; +static const char __pyx_k_timeout[] = "timeout"; +static const char __pyx_k_weakref[] = "weakref"; +static const char __pyx_k_Greenlet[] = "Greenlet"; +static const char __pyx_k_callback[] = "callback"; +static const char __pyx_k_exc_info[] = "exc_info"; +static const char __pyx_k_f_lineno[] = "f_lineno"; +static const char __pyx_k_getframe[] = "_getframe"; +static const char __pyx_k_greenlet[] = "greenlet"; +static const char __pyx_k_pyx_capi[] = "__pyx_capi__"; +static const char __pyx_k_reversed[] = "reversed"; +static const char __pyx_k_waiter_2[] = "_waiter"; +static const char __pyx_k_NameError[] = "NameError"; +static const char __pyx_k_TypeError[] = "TypeError"; +static const char __pyx_k_exception[] = "exception"; +static const char __pyx_k_greenlets[] = "greenlets"; +static const char __pyx_k_has_links[] = "has_links"; +static const char __pyx_k_Greenlet_d[] = "Greenlet-%d"; +static const char __pyx_k_ValueError[] = "ValueError"; +static const char __pyx_k_continulet[] = "continulet"; +static const char __pyx_k_formatinfo[] = "_formatinfo"; +static const char __pyx_k_getcurrent[] = "getcurrent"; +static const char __pyx_k_link_value[] = "link_value"; +static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__"; +static const char __pyx_k_successful[] = "successful"; +static const char __pyx_k_unlink_all[] = "unlink_all"; +static const char __pyx_k_SpawnedLink[] = "SpawnedLink"; +static const char __pyx_k_cfunc_to_py[] = "cfunc.to_py"; +static const char __pyx_k_dummy_event[] = "_dummy_event"; +static const char __pyx_k_raise_error[] = "raise_error"; +static const char __pyx_k_spawn_later[] = "spawn_later"; +static const char __pyx_k_start_later[] = "start_later"; +static const char __pyx_k_threadlocal[] = "_threadlocal"; +static const char __pyx_k_GreenletExit[] = "GreenletExit"; +static const char __pyx_k_Greenlet_get[] = "Greenlet.get"; +static const char __pyx_k_Greenlet_run[] = "Greenlet.run"; +static const char __pyx_k_continuation[] = "_continuation"; +static const char __pyx_k_continulet_2[] = "_continulet"; +static const char __pyx_k_gevent__util[] = "gevent._util"; +static const char __pyx_k_handle_error[] = "handle_error"; +static const char __pyx_k_notify_links[] = "_notify_links"; +static const char __pyx_k_readproperty[] = "readproperty"; +static const char __pyx_k_run_callback[] = "run_callback"; +static const char __pyx_k_staticmethod[] = "staticmethod"; +static const char __pyx_k_stringsource[] = "stringsource"; +static const char __pyx_k_sys_exc_info[] = "sys_exc_info"; +static const char __pyx_k_sys_getframe[] = "sys_getframe"; +static const char __pyx_k_GEVENT_CONFIG[] = "GEVENT_CONFIG"; +static const char __pyx_k_Greenlet__run[] = "Greenlet._run"; +static const char __pyx_k_Greenlet_join[] = "Greenlet.join"; +static const char __pyx_k_Greenlet_kill[] = "Greenlet.kill"; +static const char __pyx_k_Greenlet_link[] = "Greenlet.link"; +static const char __pyx_k_Greenlet_name[] = "Greenlet.name"; +static const char __pyx_k_get_hub_class[] = "get_hub_class"; +static const char __pyx_k_gevent__tblib[] = "gevent._tblib"; +static const char __pyx_k_greenlet_init[] = "greenlet_init"; +static const char __pyx_k_minimal_ident[] = "minimal_ident"; +static const char __pyx_k_AssertionError[] = "AssertionError"; +static const char __pyx_k_AttributeError[] = "AttributeError"; +static const char __pyx_k_Greenlet_ready[] = "Greenlet.ready"; +static const char __pyx_k_Greenlet_spawn[] = "Greenlet.spawn"; +static const char __pyx_k_Greenlet_start[] = "Greenlet.start"; +static const char __pyx_k_Greenlet_throw[] = "Greenlet.throw"; +static const char __pyx_k_dump_traceback[] = "dump_traceback"; +static const char __pyx_k_get_hub_noargs[] = "get_hub_noargs"; +static const char __pyx_k_gevent__compat[] = "gevent._compat"; +static const char __pyx_k_gevent__config[] = "gevent._config"; +static const char __pyx_k_gevent_timeout[] = "gevent.timeout"; +static const char __pyx_k_greenlet__init[] = "_greenlet__init__"; +static const char __pyx_k_ident_registry[] = "ident_registry"; +static const char __pyx_k_import_c_accel[] = "import_c_accel"; +static const char __pyx_k_link_exception[] = "link_exception"; +static const char __pyx_k_load_traceback[] = "load_traceback"; +static const char __pyx_k_spawning_stack[] = "spawning_stack"; +static const char __pyx_k_Greenlet_unlink[] = "Greenlet.unlink"; +static const char __pyx_k_raise_exception[] = "_raise_exception"; +static const char __pyx_k_spawn_callbacks[] = "_spawn_callbacks"; +static const char __pyx_k_wait_on_objects[] = "wait_on_objects"; +static const char __pyx_k_Greenlet_rawlink[] = "Greenlet.rawlink"; +static const char __pyx_k_dummy_event_stop[] = "_dummy_event.stop"; +static const char __pyx_k_gevent__greenlet[] = "gevent._greenlet"; +static const char __pyx_k_iwait_on_objects[] = "iwait_on_objects"; +static const char __pyx_k_dummy_event_close[] = "_dummy_event.close"; +static const char __pyx_k_dummy_event_start[] = "_dummy_event.start"; +static const char __pyx_k_gevent__hub_local[] = "gevent._hub_local"; +static const char __pyx_k_gevent_exceptions[] = "gevent.exceptions"; +static const char __pyx_k_greenlet_imported[] = "_greenlet_imported"; +static const char __pyx_k_spawn_tree_locals[] = "spawn_tree_locals"; +static const char __pyx_k_FailureSpawnedLink[] = "FailureSpawnedLink"; +static const char __pyx_k_Greenlet_has_links[] = "Greenlet.has_links"; +static const char __pyx_k_InvalidSwitchError[] = "InvalidSwitchError"; +static const char __pyx_k_SuccessSpawnedLink[] = "SuccessSpawnedLink"; +static const char __pyx_k_add_spawn_callback[] = "add_spawn_callback"; +static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; +static const char __pyx_k_start_new_or_dummy[] = "_start_new_or_dummy"; +static const char __pyx_k_Expected_callable_r[] = "Expected callable: %r"; +static const char __pyx_k_Greenlet_link_value[] = "Greenlet.link_value"; +static const char __pyx_k_Greenlet_successful[] = "Greenlet.successful"; +static const char __pyx_k_Greenlet_unlink_all[] = "Greenlet.unlink_all"; +static const char __pyx_k_track_greenlet_tree[] = "track_greenlet_tree"; +static const char __pyx_k_Greenlet__formatinfo[] = "Greenlet._formatinfo"; +static const char __pyx_k_Greenlet_spawn_later[] = "Greenlet.spawn_later"; +static const char __pyx_k_Greenlet_start_later[] = "Greenlet.start_later"; +static const char __pyx_k_spawning_stack_limit[] = "spawning_stack_limit"; +static const char __pyx_k_cancelled_start_event[] = "_cancelled_start_event"; +static const char __pyx_k_remove_spawn_callback[] = "remove_spawn_callback"; +static const char __pyx_k_spawning_stack_frames[] = "_spawning_stack_frames"; +static const char __pyx_k_start_completed_event[] = "_start_completed_event"; +static const char __pyx_k_Greenlet__notify_links[] = "Greenlet._notify_links"; +static const char __pyx_k_gevent__hub_primitives[] = "gevent._hub_primitives"; +static const char __pyx_k_src_gevent_greenlet_py[] = "src\\gevent\\greenlet.py"; +static const char __pyx_k_Greenlet_link_exception[] = "Greenlet.link_exception"; +static const char __pyx_k_Greenlet_spawning_stack[] = "Greenlet.spawning_stack"; +static const char __pyx_k_Greenlet__raise_exception[] = "Greenlet._raise_exception"; +static const char __pyx_k_Greenlet_add_spawn_callback[] = "Greenlet.add_spawn_callback"; +static const char __pyx_k_Cannot_start_the_dummy_event[] = "Cannot start the dummy event"; +static const char __pyx_k_Greenlet_remove_spawn_callback[] = "Greenlet.remove_spawn_callback"; +static const char __pyx_k_Pyx_CFunc_object____list____ob[] = "__Pyx_CFunc_object____list____object____object___to_py..wrap"; +static const char __pyx_k_Invalid_switch_into_Greenlet_get[] = "Invalid switch into Greenlet.get(): %r"; +static const char __pyx_k_Invalid_switch_into_Greenlet_joi[] = "Invalid switch into Greenlet.join(): %r"; +static const char __pyx_k_Pyx_CFunc_object____list____ob_2[] = "__Pyx_CFunc_object____list____object___to_py..wrap"; +static const char __pyx_k_The_run_argument_or_self__run_mu[] = "The run argument or self._run must be callable"; +static PyObject *__pyx_n_s_AssertionError; +static PyObject *__pyx_n_s_AttributeError; +static PyObject *__pyx_kp_s_Cannot_start_the_dummy_event; +static PyObject *__pyx_kp_s_Expected_callable_r; +static PyObject *__pyx_n_s_FailureSpawnedLink; +static PyObject *__pyx_n_s_Frame; +static PyObject *__pyx_n_s_GEVENT_CONFIG; +static PyObject *__pyx_n_s_Greenlet; +static PyObject *__pyx_n_s_GreenletExit; +static PyObject *__pyx_n_s_Greenlet__formatinfo; +static PyObject *__pyx_n_s_Greenlet__notify_links; +static PyObject *__pyx_n_s_Greenlet__raise_exception; +static PyObject *__pyx_n_s_Greenlet__run; +static PyObject *__pyx_n_s_Greenlet_add_spawn_callback; +static PyObject *__pyx_kp_s_Greenlet_d; +static PyObject *__pyx_n_s_Greenlet_get; +static PyObject *__pyx_n_s_Greenlet_has_links; +static PyObject *__pyx_n_s_Greenlet_join; +static PyObject *__pyx_n_s_Greenlet_kill; +static PyObject *__pyx_n_s_Greenlet_link; +static PyObject *__pyx_n_s_Greenlet_link_exception; +static PyObject *__pyx_n_s_Greenlet_link_value; +static PyObject *__pyx_n_s_Greenlet_name; +static PyObject *__pyx_n_s_Greenlet_rawlink; +static PyObject *__pyx_n_s_Greenlet_ready; +static PyObject *__pyx_n_s_Greenlet_remove_spawn_callback; +static PyObject *__pyx_n_s_Greenlet_run; +static PyObject *__pyx_n_s_Greenlet_spawn; +static PyObject *__pyx_n_s_Greenlet_spawn_later; +static PyObject *__pyx_n_s_Greenlet_spawning_stack; +static PyObject *__pyx_n_s_Greenlet_start; +static PyObject *__pyx_n_s_Greenlet_start_later; +static PyObject *__pyx_n_s_Greenlet_successful; +static PyObject *__pyx_n_s_Greenlet_throw; +static PyObject *__pyx_n_s_Greenlet_unlink; +static PyObject *__pyx_n_s_Greenlet_unlink_all; +static PyObject *__pyx_n_s_InvalidSwitchError; +static PyObject *__pyx_kp_s_Invalid_switch_into_Greenlet_get; +static PyObject *__pyx_kp_s_Invalid_switch_into_Greenlet_joi; +static PyObject *__pyx_n_s_Lazy; +static PyObject *__pyx_n_s_NameError; +static PyObject *__pyx_n_s_PYPY; +static PyObject *__pyx_n_s_PYPY_2; +static PyObject *__pyx_n_s_Pyx_CFunc_object____list____ob; +static PyObject *__pyx_n_s_Pyx_CFunc_object____list____ob_2; +static PyObject *__pyx_n_s_SpawnedLink; +static PyObject *__pyx_n_s_SuccessSpawnedLink; +static PyObject *__pyx_kp_s_The_run_argument_or_self__run_mu; +static PyObject *__pyx_n_s_Timeout; +static PyObject *__pyx_n_s_TypeError; +static PyObject *__pyx_n_s_ValueError; +static PyObject *__pyx_n_s_Waiter; +static PyObject *__pyx_kp_s__2; +static PyObject *__pyx_kp_s__3; +static PyObject *__pyx_kp_s__4; +static PyObject *__pyx_kp_s__5; +static PyObject *__pyx_kp_s__6; +static PyObject *__pyx_kp_s__7; +static PyObject *__pyx_kp_s__8; +static PyObject *__pyx_n_s_active; +static PyObject *__pyx_n_s_add_spawn_callback; +static PyObject *__pyx_n_s_alive; +static PyObject *__pyx_n_s_all; +static PyObject *__pyx_n_s_args; +static PyObject *__pyx_n_s_block; +static PyObject *__pyx_n_s_bool; +static PyObject *__pyx_n_s_call; +static PyObject *__pyx_n_s_callback; +static PyObject *__pyx_n_s_cancel; +static PyObject *__pyx_n_s_cancelled_start_event; +static PyObject *__pyx_n_s_cb; +static PyObject *__pyx_n_s_cfunc_to_py; +static PyObject *__pyx_n_s_class; +static PyObject *__pyx_n_s_cline_in_traceback; +static PyObject *__pyx_n_s_close; +static PyObject *__pyx_n_s_cls; +static PyObject *__pyx_n_s_config; +static PyObject *__pyx_n_s_continuation; +static PyObject *__pyx_n_s_continulet; +static PyObject *__pyx_n_s_continulet_2; +static PyObject *__pyx_n_s_count; +static PyObject *__pyx_n_s_dead; +static PyObject *__pyx_n_s_dict; +static PyObject *__pyx_n_s_dummy_event; +static PyObject *__pyx_n_s_dummy_event_close; +static PyObject *__pyx_n_s_dummy_event_start; +static PyObject *__pyx_n_s_dummy_event_stop; +static PyObject *__pyx_n_s_dump_traceback; +static PyObject *__pyx_n_s_exc_info; +static PyObject *__pyx_n_s_exception; +static PyObject *__pyx_n_s_f_back; +static PyObject *__pyx_n_s_f_code; +static PyObject *__pyx_n_s_f_lineno; +static PyObject *__pyx_n_s_formatinfo; +static PyObject *__pyx_n_s_g; +static PyObject *__pyx_n_s_get; +static PyObject *__pyx_n_s_get_2; +static PyObject *__pyx_n_s_get_hub_class; +static PyObject *__pyx_n_s_get_hub_noargs; +static PyObject *__pyx_n_s_getcurrent; +static PyObject *__pyx_n_s_getframe; +static PyObject *__pyx_n_s_gevent; +static PyObject *__pyx_n_s_gevent__compat; +static PyObject *__pyx_n_s_gevent__config; +static PyObject *__pyx_n_s_gevent__greenlet; +static PyObject *__pyx_n_s_gevent__hub_local; +static PyObject *__pyx_n_s_gevent__hub_primitives; +static PyObject *__pyx_n_s_gevent__tblib; +static PyObject *__pyx_n_s_gevent__util; +static PyObject *__pyx_n_s_gevent_exceptions; +static PyObject *__pyx_n_s_gevent_timeout; +static PyObject *__pyx_n_s_glet; +static PyObject *__pyx_n_s_greenlet; +static PyObject *__pyx_n_s_greenlet__init; +static PyObject *__pyx_n_s_greenlet_imported; +static PyObject *__pyx_n_s_greenlet_init; +static PyObject *__pyx_n_s_greenlets; +static PyObject *__pyx_n_s_handle_error; +static PyObject *__pyx_n_s_has_links; +static PyObject *__pyx_n_s_hex; +static PyObject *__pyx_n_s_id; +static PyObject *__pyx_n_s_ident_registry; +static PyObject *__pyx_n_s_import; +static PyObject *__pyx_n_s_import_c_accel; +static PyObject *__pyx_n_s_init; +static PyObject *__pyx_n_s_items; +static PyObject *__pyx_n_s_iwait; +static PyObject *__pyx_n_s_iwait_on_objects; +static PyObject *__pyx_n_s_join; +static PyObject *__pyx_n_s_joinall; +static PyObject *__pyx_n_s_kill; +static PyObject *__pyx_n_s_kill_2; +static PyObject *__pyx_n_s_killall; +static PyObject *__pyx_n_s_kwargs; +static PyObject *__pyx_n_s_lambda; +static PyObject *__pyx_n_s_link; +static PyObject *__pyx_n_s_link_exception; +static PyObject *__pyx_n_s_link_value; +static PyObject *__pyx_n_s_load_traceback; +static PyObject *__pyx_n_s_loop; +static PyObject *__pyx_n_s_main; +static PyObject *__pyx_n_s_minimal_ident; +static PyObject *__pyx_n_s_name; +static PyObject *__pyx_n_s_name_2; +static PyObject *__pyx_n_s_nonzero; +static PyObject *__pyx_n_s_notify_links; +static PyObject *__pyx_n_s_parent; +static PyObject *__pyx_n_s_pending; +static PyObject *__pyx_n_s_pop; +static PyObject *__pyx_n_s_pyx_capi; +static PyObject *__pyx_n_s_pyx_vtable; +static PyObject *__pyx_n_s_raise_error; +static PyObject *__pyx_n_s_raise_exception; +static PyObject *__pyx_n_s_rawlink; +static PyObject *__pyx_n_s_readproperty; +static PyObject *__pyx_n_s_ready; +static PyObject *__pyx_n_s_ref; +static PyObject *__pyx_n_s_remove; +static PyObject *__pyx_n_s_remove_spawn_callback; +static PyObject *__pyx_n_s_reraise; +static PyObject *__pyx_n_s_result; +static PyObject *__pyx_n_s_reversed; +static PyObject *__pyx_n_s_run; +static PyObject *__pyx_n_s_run_2; +static PyObject *__pyx_n_s_run_callback; +static PyObject *__pyx_kp_s_s; +static PyObject *__pyx_kp_s_s_s; +static PyObject *__pyx_kp_s_s_sat_s; +static PyObject *__pyx_n_s_seconds; +static PyObject *__pyx_n_s_self; +static PyObject *__pyx_n_s_self_2; +static PyObject *__pyx_n_s_slots; +static PyObject *__pyx_n_s_source; +static PyObject *__pyx_n_s_spawn; +static PyObject *__pyx_n_s_spawn_callbacks; +static PyObject *__pyx_n_s_spawn_later; +static PyObject *__pyx_n_s_spawn_tree_locals; +static PyObject *__pyx_n_s_spawning_stack; +static PyObject *__pyx_n_s_spawning_stack_frames; +static PyObject *__pyx_n_s_spawning_stack_limit; +static PyObject *__pyx_kp_s_src_gevent_greenlet_py; +static PyObject *__pyx_n_s_start; +static PyObject *__pyx_n_s_start_completed_event; +static PyObject *__pyx_n_s_start_later; +static PyObject *__pyx_n_s_start_new_or_dummy; +static PyObject *__pyx_n_s_staticmethod; +static PyObject *__pyx_n_s_stop; +static PyObject *__pyx_kp_s_stringsource; +static PyObject *__pyx_n_s_successful; +static PyObject *__pyx_n_s_switch; +static PyObject *__pyx_n_s_sys; +static PyObject *__pyx_n_s_sys_exc_info; +static PyObject *__pyx_n_s_sys_getframe; +static PyObject *__pyx_n_s_t; +static PyObject *__pyx_n_s_test; +static PyObject *__pyx_n_s_threadlocal; +static PyObject *__pyx_n_s_throw; +static PyObject *__pyx_n_s_timeout; +static PyObject *__pyx_n_s_timer; +static PyObject *__pyx_n_s_track_greenlet_tree; +static PyObject *__pyx_n_s_unlink; +static PyObject *__pyx_n_s_unlink_all; +static PyObject *__pyx_n_s_wait; +static PyObject *__pyx_n_s_wait_on_objects; +static PyObject *__pyx_n_s_waiter; +static PyObject *__pyx_n_s_waiter_2; +static PyObject *__pyx_n_s_weakref; +static PyObject *__pyx_n_s_wrap; +static PyObject *__pyx_n_s_wref; +static PyObject *__pyx_lambda_funcdef_6gevent_9_greenlet_lambda(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static int __pyx_pf_6gevent_9_greenlet_11SpawnedLink___init__(struct __pyx_obj_6gevent_9_greenlet_SpawnedLink *__pyx_v_self, PyObject *__pyx_v_callback); /* proto */ +static PyObject *__pyx_pf_6gevent_9_greenlet_11SpawnedLink_2__call__(struct __pyx_obj_6gevent_9_greenlet_SpawnedLink *__pyx_v_self, PyObject *__pyx_v_source); /* proto */ +static Py_hash_t __pyx_pf_6gevent_9_greenlet_11SpawnedLink_4__hash__(struct __pyx_obj_6gevent_9_greenlet_SpawnedLink *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_9_greenlet_11SpawnedLink_6__eq__(struct __pyx_obj_6gevent_9_greenlet_SpawnedLink *__pyx_v_self, PyObject *__pyx_v_other); /* proto */ +static PyObject *__pyx_pf_6gevent_9_greenlet_11SpawnedLink_8__str__(struct __pyx_obj_6gevent_9_greenlet_SpawnedLink *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_9_greenlet_11SpawnedLink_10__repr__(struct __pyx_obj_6gevent_9_greenlet_SpawnedLink *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_9_greenlet_11SpawnedLink_12__getattr__(struct __pyx_obj_6gevent_9_greenlet_SpawnedLink *__pyx_v_self, PyObject *__pyx_v_item); /* proto */ +static PyObject *__pyx_pf_6gevent_9_greenlet_11SpawnedLink_8callback___get__(struct __pyx_obj_6gevent_9_greenlet_SpawnedLink *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_9_greenlet_11SpawnedLink_8callback_2__set__(struct __pyx_obj_6gevent_9_greenlet_SpawnedLink *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6gevent_9_greenlet_11SpawnedLink_8callback_4__del__(struct __pyx_obj_6gevent_9_greenlet_SpawnedLink *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_9_greenlet_18SuccessSpawnedLink___call__(struct __pyx_obj_6gevent_9_greenlet_SuccessSpawnedLink *__pyx_v_self, PyObject *__pyx_v_source); /* proto */ +static PyObject *__pyx_pf_6gevent_9_greenlet_18FailureSpawnedLink___call__(struct __pyx_obj_6gevent_9_greenlet_FailureSpawnedLink *__pyx_v_self, PyObject *__pyx_v_source); /* proto */ +static int __pyx_pf_6gevent_9_greenlet_6_Frame___init__(struct __pyx_obj_6gevent_9_greenlet__Frame *__pyx_v_self, PyObject *__pyx_v_f_code, PyObject *__pyx_v_f_lineno, PyObject *__pyx_v_f_back); /* proto */ +static PyObject *__pyx_pf_6gevent_9_greenlet_6_Frame_9f_globals___get__(CYTHON_UNUSED struct __pyx_obj_6gevent_9_greenlet__Frame *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_9_greenlet_6_Frame_6f_code___get__(struct __pyx_obj_6gevent_9_greenlet__Frame *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_9_greenlet_6_Frame_8f_lineno___get__(struct __pyx_obj_6gevent_9_greenlet__Frame *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_9_greenlet_6_Frame_6f_back___get__(struct __pyx_obj_6gevent_9_greenlet__Frame *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_9_greenlet_8Greenlet___init__(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self, PyObject *__pyx_v_run, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */ +static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_2spawning_stack(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_13minimal_ident___get__(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_4name(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_6_raise_exception(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_4loop___get__(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_9_greenlet_8Greenlet_8__nonzero__(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_4dead___get__(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_7started___get__(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_10ready(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_12successful(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_14__repr__(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_16_formatinfo(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_9exception___get__(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_8exc_info___get__(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_18throw(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self, PyObject *__pyx_v_args); /* proto */ +static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_20start(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_22start_later(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self, PyObject *__pyx_v_seconds); /* proto */ +static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_24add_spawn_callback(PyObject *__pyx_v_callback); /* proto */ +static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_26remove_spawn_callback(PyObject *__pyx_v_callback); /* proto */ +static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_28spawn(PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */ +static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_30spawn_later(PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_seconds, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */ +static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_32kill(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self, PyObject *__pyx_v_exception, PyObject *__pyx_v_block, PyObject *__pyx_v_timeout); /* proto */ +static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_34get(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self, PyObject *__pyx_v_block, PyObject *__pyx_v_timeout); /* proto */ +static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_36join(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self, PyObject *__pyx_v_timeout); /* proto */ +static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_38run(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_40_run(CYTHON_UNUSED struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_42has_links(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_44rawlink(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self, PyObject *__pyx_v_callback); /* proto */ +static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_46link(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self, PyObject *__pyx_v_callback, PyObject *__pyx_v_SpawnedLink); /* proto */ +static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_48unlink(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self, PyObject *__pyx_v_callback); /* proto */ +static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_50unlink_all(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_52link_value(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self, PyObject *__pyx_v_callback, PyObject *__pyx_v_SpawnedLink); /* proto */ +static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_54link_exception(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self, PyObject *__pyx_v_callback, PyObject *__pyx_v_SpawnedLink); /* proto */ +static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_56_notify_links(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_5value___get__(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_4args___get__(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_6kwargs___get__(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_17spawning_greenlet___get__(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_17spawn_tree_locals___get__(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_9_greenlet_8Greenlet_17spawn_tree_locals_2__set__(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6gevent_9_greenlet_8Greenlet_17spawn_tree_locals_4__del__(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_22_spawning_stack_frames___get__(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_9_greenlet_12_dummy_event___init__(struct __pyx_obj_6gevent_9_greenlet__dummy_event *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_9_greenlet_12_dummy_event_2stop(struct __pyx_obj_6gevent_9_greenlet__dummy_event *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_9_greenlet_12_dummy_event_4start(struct __pyx_obj_6gevent_9_greenlet__dummy_event *__pyx_v_self, PyObject *__pyx_v_cb); /* proto */ +static PyObject *__pyx_pf_6gevent_9_greenlet_12_dummy_event_6close(struct __pyx_obj_6gevent_9_greenlet__dummy_event *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_9_greenlet_12_dummy_event_7pending___get__(struct __pyx_obj_6gevent_9_greenlet__dummy_event *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_9_greenlet_12_dummy_event_6active___get__(struct __pyx_obj_6gevent_9_greenlet__dummy_event *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_9_greenlet__kill(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_glet, PyObject *__pyx_v_exception, PyObject *__pyx_v_waiter); /* proto */ +static PyObject *__pyx_pf_6gevent_9_greenlet_2joinall(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_greenlets, PyObject *__pyx_v_timeout, PyObject *__pyx_v_raise_error, PyObject *__pyx_v_count); /* proto */ +static PyObject *__pyx_pf_6gevent_9_greenlet_7__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_6gevent_9_greenlet_4killall(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_greenlets, PyObject *__pyx_v_exception, PyObject *__pyx_v_block, PyObject *__pyx_v_timeout); /* proto */ +static PyObject *__pyx_pf_11cfunc_dot_to_py_54__Pyx_CFunc_object____list____object____object___to_py_wrap(PyObject *__pyx_self, PyObject *__pyx_v_greenlets, PyObject *__pyx_v_exception, PyObject *__pyx_v_waiter); /* proto */ +static PyObject *__pyx_pf_11cfunc_dot_to_py_44__Pyx_CFunc_object____list____object___to_py_wrap(PyObject *__pyx_self, PyObject *__pyx_v_greenlets, PyObject *__pyx_v_exception); /* proto */ +static PyObject *__pyx_tp_new_6gevent_9_greenlet_SpawnedLink(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6gevent_9_greenlet_SuccessSpawnedLink(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6gevent_9_greenlet_FailureSpawnedLink(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6gevent_9_greenlet__Frame(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6gevent_9_greenlet_Greenlet(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6gevent_9_greenlet__dummy_event(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new___pyx_scope_struct____Pyx_CFunc_object____list____object____object___to_py(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new___pyx_scope_struct____Pyx_CFunc_object____list____object___to_py(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_int_0; +static PyObject *__pyx_int_10; +static PyObject *__pyx_k__10; +static PyObject *__pyx_k__13; +static PyObject *__pyx_k__14; +static PyObject *__pyx_k__15; +static PyObject *__pyx_tuple_; +static PyObject *__pyx_tuple__9; +static PyObject *__pyx_tuple__11; +static PyObject *__pyx_tuple__12; +static PyObject *__pyx_tuple__16; +static PyObject *__pyx_tuple__17; +static PyObject *__pyx_tuple__19; +static PyObject *__pyx_tuple__21; +static PyObject *__pyx_tuple__22; +static PyObject *__pyx_tuple__23; +static PyObject *__pyx_tuple__25; +static PyObject *__pyx_tuple__27; +static PyObject *__pyx_tuple__29; +static PyObject *__pyx_tuple__31; +static PyObject *__pyx_tuple__33; +static PyObject *__pyx_tuple__35; +static PyObject *__pyx_tuple__37; +static PyObject *__pyx_tuple__39; +static PyObject *__pyx_tuple__41; +static PyObject *__pyx_tuple__43; +static PyObject *__pyx_tuple__45; +static PyObject *__pyx_tuple__47; +static PyObject *__pyx_tuple__49; +static PyObject *__pyx_tuple__51; +static PyObject *__pyx_tuple__53; +static PyObject *__pyx_tuple__55; +static PyObject *__pyx_tuple__57; +static PyObject *__pyx_tuple__59; +static PyObject *__pyx_tuple__61; +static PyObject *__pyx_tuple__63; +static PyObject *__pyx_tuple__65; +static PyObject *__pyx_tuple__67; +static PyObject *__pyx_tuple__69; +static PyObject *__pyx_tuple__71; +static PyObject *__pyx_tuple__73; +static PyObject *__pyx_tuple__75; +static PyObject *__pyx_tuple__76; +static PyObject *__pyx_tuple__78; +static PyObject *__pyx_tuple__80; +static PyObject *__pyx_tuple__82; +static PyObject *__pyx_tuple__84; +static PyObject *__pyx_tuple__86; +static PyObject *__pyx_codeobj__18; +static PyObject *__pyx_codeobj__20; +static PyObject *__pyx_codeobj__24; +static PyObject *__pyx_codeobj__26; +static PyObject *__pyx_codeobj__28; +static PyObject *__pyx_codeobj__30; +static PyObject *__pyx_codeobj__32; +static PyObject *__pyx_codeobj__34; +static PyObject *__pyx_codeobj__36; +static PyObject *__pyx_codeobj__38; +static PyObject *__pyx_codeobj__40; +static PyObject *__pyx_codeobj__42; +static PyObject *__pyx_codeobj__44; +static PyObject *__pyx_codeobj__46; +static PyObject *__pyx_codeobj__48; +static PyObject *__pyx_codeobj__50; +static PyObject *__pyx_codeobj__52; +static PyObject *__pyx_codeobj__54; +static PyObject *__pyx_codeobj__56; +static PyObject *__pyx_codeobj__58; +static PyObject *__pyx_codeobj__60; +static PyObject *__pyx_codeobj__62; +static PyObject *__pyx_codeobj__64; +static PyObject *__pyx_codeobj__66; +static PyObject *__pyx_codeobj__68; +static PyObject *__pyx_codeobj__70; +static PyObject *__pyx_codeobj__72; +static PyObject *__pyx_codeobj__74; +static PyObject *__pyx_codeobj__77; +static PyObject *__pyx_codeobj__79; +static PyObject *__pyx_codeobj__81; +static PyObject *__pyx_codeobj__83; +static PyObject *__pyx_codeobj__85; +static PyObject *__pyx_codeobj__87; +/* Late includes */ + +/* "src/gevent/greenlet.py":46 + * # error. + * locals()['getcurrent'] = __import__('greenlet').getcurrent + * locals()['greenlet_init'] = lambda: None # <<<<<<<<<<<<<< + * locals()['Waiter'] = _waiter.Waiter + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_9_greenlet_6lambda(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyMethodDef __pyx_mdef_6gevent_9_greenlet_6lambda = {"lambda", (PyCFunction)__pyx_pw_6gevent_9_greenlet_6lambda, METH_NOARGS, 0}; +static PyObject *__pyx_pw_6gevent_9_greenlet_6lambda(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("lambda (wrapper)", 0); + __pyx_r = __pyx_lambda_funcdef_6gevent_9_greenlet_lambda(__pyx_self); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_lambda_funcdef_6gevent_9_greenlet_lambda(CYTHON_UNUSED PyObject *__pyx_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("lambda", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/greenlet.py":63 + * __slots__ = ['callback'] + * + * def __init__(self, callback): # <<<<<<<<<<<<<< + * if not callable(callback): + * raise TypeError("Expected callable: %r" % (callback, )) + */ + +/* Python wrapper */ +static int __pyx_pw_6gevent_9_greenlet_11SpawnedLink_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6gevent_9_greenlet_11SpawnedLink_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_callback = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_callback,0}; + PyObject* values[1] = {0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_callback)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 63, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + } + __pyx_v_callback = values[0]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 63, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent._greenlet.SpawnedLink.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_9_greenlet_11SpawnedLink___init__(((struct __pyx_obj_6gevent_9_greenlet_SpawnedLink *)__pyx_v_self), __pyx_v_callback); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_9_greenlet_11SpawnedLink___init__(struct __pyx_obj_6gevent_9_greenlet_SpawnedLink *__pyx_v_self, PyObject *__pyx_v_callback) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "src/gevent/greenlet.py":64 + * + * def __init__(self, callback): + * if not callable(callback): # <<<<<<<<<<<<<< + * raise TypeError("Expected callable: %r" % (callback, )) + * self.callback = callback + */ + __pyx_t_1 = __Pyx_PyCallable_Check(__pyx_v_callback); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 64, __pyx_L1_error) + __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0); + if (unlikely(__pyx_t_2)) { + + /* "src/gevent/greenlet.py":65 + * def __init__(self, callback): + * if not callable(callback): + * raise TypeError("Expected callable: %r" % (callback, )) # <<<<<<<<<<<<<< + * self.callback = callback + * + */ + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 65, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_callback); + __Pyx_GIVEREF(__pyx_v_callback); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_callback); + __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Expected_callable_r, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 65, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 65, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(0, 65, __pyx_L1_error) + + /* "src/gevent/greenlet.py":64 + * + * def __init__(self, callback): + * if not callable(callback): # <<<<<<<<<<<<<< + * raise TypeError("Expected callable: %r" % (callback, )) + * self.callback = callback + */ + } + + /* "src/gevent/greenlet.py":66 + * if not callable(callback): + * raise TypeError("Expected callable: %r" % (callback, )) + * self.callback = callback # <<<<<<<<<<<<<< + * + * def __call__(self, source): + */ + __Pyx_INCREF(__pyx_v_callback); + __Pyx_GIVEREF(__pyx_v_callback); + __Pyx_GOTREF(__pyx_v_self->callback); + __Pyx_DECREF(__pyx_v_self->callback); + __pyx_v_self->callback = __pyx_v_callback; + + /* "src/gevent/greenlet.py":63 + * __slots__ = ['callback'] + * + * def __init__(self, callback): # <<<<<<<<<<<<<< + * if not callable(callback): + * raise TypeError("Expected callable: %r" % (callback, )) + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("gevent._greenlet.SpawnedLink.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/greenlet.py":68 + * self.callback = callback + * + * def __call__(self, source): # <<<<<<<<<<<<<< + * g = greenlet(self.callback, get_hub()) + * g.switch(source) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_9_greenlet_11SpawnedLink_3__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6gevent_9_greenlet_11SpawnedLink_3__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_source = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__call__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_source,0}; + PyObject* values[1] = {0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_source)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__call__") < 0)) __PYX_ERR(0, 68, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + } + __pyx_v_source = values[0]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__call__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 68, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent._greenlet.SpawnedLink.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_9_greenlet_11SpawnedLink_2__call__(((struct __pyx_obj_6gevent_9_greenlet_SpawnedLink *)__pyx_v_self), __pyx_v_source); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_9_greenlet_11SpawnedLink_2__call__(struct __pyx_obj_6gevent_9_greenlet_SpawnedLink *__pyx_v_self, PyObject *__pyx_v_source) { + PyGreenlet *__pyx_v_g = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("__call__", 0); + + /* "src/gevent/greenlet.py":69 + * + * def __call__(self, source): + * g = greenlet(self.callback, get_hub()) # <<<<<<<<<<<<<< + * g.switch(source) + * + */ + __pyx_t_1 = ((PyObject *)__pyx_f_6gevent_11__hub_local_get_hub_noargs(0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 69, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 69, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_self->callback); + __Pyx_GIVEREF(__pyx_v_self->callback); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_self->callback); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6gevent_9_greenlet_greenlet), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 69, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_g = ((PyGreenlet *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "src/gevent/greenlet.py":70 + * def __call__(self, source): + * g = greenlet(self.callback, get_hub()) + * g.switch(source) # <<<<<<<<<<<<<< + * + * def __hash__(self): + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_g), __pyx_n_s_switch); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 70, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_source) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_source); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 70, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/greenlet.py":68 + * self.callback = callback + * + * def __call__(self, source): # <<<<<<<<<<<<<< + * g = greenlet(self.callback, get_hub()) + * g.switch(source) + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("gevent._greenlet.SpawnedLink.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_g); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/greenlet.py":72 + * g.switch(source) + * + * def __hash__(self): # <<<<<<<<<<<<<< + * return hash(self.callback) + * + */ + +/* Python wrapper */ +static Py_hash_t __pyx_pw_6gevent_9_greenlet_11SpawnedLink_5__hash__(PyObject *__pyx_v_self); /*proto*/ +static Py_hash_t __pyx_pw_6gevent_9_greenlet_11SpawnedLink_5__hash__(PyObject *__pyx_v_self) { + Py_hash_t __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__hash__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_9_greenlet_11SpawnedLink_4__hash__(((struct __pyx_obj_6gevent_9_greenlet_SpawnedLink *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static Py_hash_t __pyx_pf_6gevent_9_greenlet_11SpawnedLink_4__hash__(struct __pyx_obj_6gevent_9_greenlet_SpawnedLink *__pyx_v_self) { + Py_hash_t __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_hash_t __pyx_t_2; + __Pyx_RefNannySetupContext("__hash__", 0); + + /* "src/gevent/greenlet.py":73 + * + * def __hash__(self): + * return hash(self.callback) # <<<<<<<<<<<<<< + * + * def __eq__(self, other): + */ + __pyx_t_1 = __pyx_v_self->callback; + __Pyx_INCREF(__pyx_t_1); + __pyx_t_2 = PyObject_Hash(__pyx_t_1); if (unlikely(__pyx_t_2 == ((Py_hash_t)-1))) __PYX_ERR(0, 73, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + goto __pyx_L0; + + /* "src/gevent/greenlet.py":72 + * g.switch(source) + * + * def __hash__(self): # <<<<<<<<<<<<<< + * return hash(self.callback) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent._greenlet.SpawnedLink.__hash__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + if (unlikely(__pyx_r == -1) && !PyErr_Occurred()) __pyx_r = -2; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/greenlet.py":75 + * return hash(self.callback) + * + * def __eq__(self, other): # <<<<<<<<<<<<<< + * return self.callback == getattr(other, 'callback', other) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_9_greenlet_11SpawnedLink_7__eq__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/ +static PyObject *__pyx_pw_6gevent_9_greenlet_11SpawnedLink_7__eq__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__eq__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_9_greenlet_11SpawnedLink_6__eq__(((struct __pyx_obj_6gevent_9_greenlet_SpawnedLink *)__pyx_v_self), ((PyObject *)__pyx_v_other)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_9_greenlet_11SpawnedLink_6__eq__(struct __pyx_obj_6gevent_9_greenlet_SpawnedLink *__pyx_v_self, PyObject *__pyx_v_other) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("__eq__", 0); + + /* "src/gevent/greenlet.py":76 + * + * def __eq__(self, other): + * return self.callback == getattr(other, 'callback', other) # <<<<<<<<<<<<<< + * + * def __str__(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_GetAttr3(__pyx_v_other, __pyx_n_s_callback, __pyx_v_other); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 76, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyObject_RichCompare(__pyx_v_self->callback, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 76, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "src/gevent/greenlet.py":75 + * return hash(self.callback) + * + * def __eq__(self, other): # <<<<<<<<<<<<<< + * return self.callback == getattr(other, 'callback', other) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent._greenlet.SpawnedLink.__eq__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/greenlet.py":78 + * return self.callback == getattr(other, 'callback', other) + * + * def __str__(self): # <<<<<<<<<<<<<< + * return str(self.callback) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_9_greenlet_11SpawnedLink_9__str__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_9_greenlet_11SpawnedLink_9__str__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__str__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_9_greenlet_11SpawnedLink_8__str__(((struct __pyx_obj_6gevent_9_greenlet_SpawnedLink *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_9_greenlet_11SpawnedLink_8__str__(struct __pyx_obj_6gevent_9_greenlet_SpawnedLink *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__str__", 0); + + /* "src/gevent/greenlet.py":79 + * + * def __str__(self): + * return str(self.callback) # <<<<<<<<<<<<<< + * + * def __repr__(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyString_Type)), __pyx_v_self->callback); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 79, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "src/gevent/greenlet.py":78 + * return self.callback == getattr(other, 'callback', other) + * + * def __str__(self): # <<<<<<<<<<<<<< + * return str(self.callback) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent._greenlet.SpawnedLink.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/greenlet.py":81 + * return str(self.callback) + * + * def __repr__(self): # <<<<<<<<<<<<<< + * return repr(self.callback) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_9_greenlet_11SpawnedLink_11__repr__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_9_greenlet_11SpawnedLink_11__repr__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_9_greenlet_11SpawnedLink_10__repr__(((struct __pyx_obj_6gevent_9_greenlet_SpawnedLink *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_9_greenlet_11SpawnedLink_10__repr__(struct __pyx_obj_6gevent_9_greenlet_SpawnedLink *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("__repr__", 0); + + /* "src/gevent/greenlet.py":82 + * + * def __repr__(self): + * return repr(self.callback) # <<<<<<<<<<<<<< + * + * def __getattr__(self, item): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_v_self->callback; + __Pyx_INCREF(__pyx_t_1); + __pyx_t_2 = PyObject_Repr(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 82, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "src/gevent/greenlet.py":81 + * return str(self.callback) + * + * def __repr__(self): # <<<<<<<<<<<<<< + * return repr(self.callback) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent._greenlet.SpawnedLink.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/greenlet.py":84 + * return repr(self.callback) + * + * def __getattr__(self, item): # <<<<<<<<<<<<<< + * assert item != 'callback' + * return getattr(self.callback, item) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_9_greenlet_11SpawnedLink_13__getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_item); /*proto*/ +static PyObject *__pyx_pw_6gevent_9_greenlet_11SpawnedLink_13__getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_item) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__getattr__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_9_greenlet_11SpawnedLink_12__getattr__(((struct __pyx_obj_6gevent_9_greenlet_SpawnedLink *)__pyx_v_self), ((PyObject *)__pyx_v_item)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_9_greenlet_11SpawnedLink_12__getattr__(struct __pyx_obj_6gevent_9_greenlet_SpawnedLink *__pyx_v_self, PyObject *__pyx_v_item) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("__getattr__", 0); + + /* "src/gevent/greenlet.py":85 + * + * def __getattr__(self, item): + * assert item != 'callback' # <<<<<<<<<<<<<< + * return getattr(self.callback, item) + * + */ + #ifndef CYTHON_WITHOUT_ASSERTIONS + if (unlikely(!Py_OptimizeFlag)) { + __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_item, __pyx_n_s_callback, Py_NE)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 85, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) { + PyErr_SetNone(PyExc_AssertionError); + __PYX_ERR(0, 85, __pyx_L1_error) + } + } + #endif + + /* "src/gevent/greenlet.py":86 + * def __getattr__(self, item): + * assert item != 'callback' + * return getattr(self.callback, item) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __pyx_v_self->callback; + __Pyx_INCREF(__pyx_t_2); + __pyx_t_3 = __Pyx_GetAttr(__pyx_t_2, __pyx_v_item); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 86, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "src/gevent/greenlet.py":84 + * return repr(self.callback) + * + * def __getattr__(self, item): # <<<<<<<<<<<<<< + * assert item != 'callback' + * return getattr(self.callback, item) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("gevent._greenlet.SpawnedLink.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/_greenlet.pxd":57 + * + * cdef class SpawnedLink: + * cdef public object callback # <<<<<<<<<<<<<< + * + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_9_greenlet_11SpawnedLink_8callback_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_9_greenlet_11SpawnedLink_8callback_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_9_greenlet_11SpawnedLink_8callback___get__(((struct __pyx_obj_6gevent_9_greenlet_SpawnedLink *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_9_greenlet_11SpawnedLink_8callback___get__(struct __pyx_obj_6gevent_9_greenlet_SpawnedLink *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->callback); + __pyx_r = __pyx_v_self->callback; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6gevent_9_greenlet_11SpawnedLink_8callback_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6gevent_9_greenlet_11SpawnedLink_8callback_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_9_greenlet_11SpawnedLink_8callback_2__set__(((struct __pyx_obj_6gevent_9_greenlet_SpawnedLink *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_9_greenlet_11SpawnedLink_8callback_2__set__(struct __pyx_obj_6gevent_9_greenlet_SpawnedLink *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__", 0); + __Pyx_INCREF(__pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + __Pyx_GOTREF(__pyx_v_self->callback); + __Pyx_DECREF(__pyx_v_self->callback); + __pyx_v_self->callback = __pyx_v_value; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6gevent_9_greenlet_11SpawnedLink_8callback_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6gevent_9_greenlet_11SpawnedLink_8callback_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_9_greenlet_11SpawnedLink_8callback_4__del__(((struct __pyx_obj_6gevent_9_greenlet_SpawnedLink *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_9_greenlet_11SpawnedLink_8callback_4__del__(struct __pyx_obj_6gevent_9_greenlet_SpawnedLink *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->callback); + __Pyx_DECREF(__pyx_v_self->callback); + __pyx_v_self->callback = Py_None; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/greenlet.py":96 + * __slots__ = [] + * + * def __call__(self, source): # <<<<<<<<<<<<<< + * if source.successful(): + * return SpawnedLink.__call__(self, source) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_9_greenlet_18SuccessSpawnedLink_1__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6gevent_9_greenlet_18SuccessSpawnedLink_1__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_source = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__call__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_source,0}; + PyObject* values[1] = {0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_source)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__call__") < 0)) __PYX_ERR(0, 96, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + } + __pyx_v_source = values[0]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__call__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 96, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent._greenlet.SuccessSpawnedLink.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_9_greenlet_18SuccessSpawnedLink___call__(((struct __pyx_obj_6gevent_9_greenlet_SuccessSpawnedLink *)__pyx_v_self), __pyx_v_source); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_9_greenlet_18SuccessSpawnedLink___call__(struct __pyx_obj_6gevent_9_greenlet_SuccessSpawnedLink *__pyx_v_self, PyObject *__pyx_v_source) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + __Pyx_RefNannySetupContext("__call__", 0); + + /* "src/gevent/greenlet.py":97 + * + * def __call__(self, source): + * if source.successful(): # <<<<<<<<<<<<<< + * return SpawnedLink.__call__(self, source) + * + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_source, __pyx_n_s_successful); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 97, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 97, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 97, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_4) { + + /* "src/gevent/greenlet.py":98 + * def __call__(self, source): + * if source.successful(): + * return SpawnedLink.__call__(self, source) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_6gevent_9_greenlet_SpawnedLink), __pyx_n_s_call); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 98, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + __pyx_t_5 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_5 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[3] = {__pyx_t_3, ((PyObject *)__pyx_v_self), __pyx_v_source}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 98, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[3] = {__pyx_t_3, ((PyObject *)__pyx_v_self), __pyx_v_source}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 98, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else + #endif + { + __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 98, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (__pyx_t_3) { + __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); __pyx_t_3 = NULL; + } + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, ((PyObject *)__pyx_v_self)); + __Pyx_INCREF(__pyx_v_source); + __Pyx_GIVEREF(__pyx_v_source); + PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_source); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 98, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "src/gevent/greenlet.py":97 + * + * def __call__(self, source): + * if source.successful(): # <<<<<<<<<<<<<< + * return SpawnedLink.__call__(self, source) + * + */ + } + + /* "src/gevent/greenlet.py":96 + * __slots__ = [] + * + * def __call__(self, source): # <<<<<<<<<<<<<< + * if source.successful(): + * return SpawnedLink.__call__(self, source) + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("gevent._greenlet.SuccessSpawnedLink.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/greenlet.py":108 + * __slots__ = [] + * + * def __call__(self, source): # <<<<<<<<<<<<<< + * if not source.successful(): + * return SpawnedLink.__call__(self, source) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_9_greenlet_18FailureSpawnedLink_1__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6gevent_9_greenlet_18FailureSpawnedLink_1__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_source = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__call__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_source,0}; + PyObject* values[1] = {0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_source)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__call__") < 0)) __PYX_ERR(0, 108, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + } + __pyx_v_source = values[0]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__call__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 108, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent._greenlet.FailureSpawnedLink.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_9_greenlet_18FailureSpawnedLink___call__(((struct __pyx_obj_6gevent_9_greenlet_FailureSpawnedLink *)__pyx_v_self), __pyx_v_source); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_9_greenlet_18FailureSpawnedLink___call__(struct __pyx_obj_6gevent_9_greenlet_FailureSpawnedLink *__pyx_v_self, PyObject *__pyx_v_source) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_t_5; + int __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + __Pyx_RefNannySetupContext("__call__", 0); + + /* "src/gevent/greenlet.py":109 + * + * def __call__(self, source): + * if not source.successful(): # <<<<<<<<<<<<<< + * return SpawnedLink.__call__(self, source) + * + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_source, __pyx_n_s_successful); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 109, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 109, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 109, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_5 = ((!__pyx_t_4) != 0); + if (__pyx_t_5) { + + /* "src/gevent/greenlet.py":110 + * def __call__(self, source): + * if not source.successful(): + * return SpawnedLink.__call__(self, source) # <<<<<<<<<<<<<< + * + * class _Frame(object): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_6gevent_9_greenlet_SpawnedLink), __pyx_n_s_call); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 110, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + __pyx_t_6 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_6 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[3] = {__pyx_t_3, ((PyObject *)__pyx_v_self), __pyx_v_source}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 110, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[3] = {__pyx_t_3, ((PyObject *)__pyx_v_self), __pyx_v_source}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 110, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else + #endif + { + __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 110, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + if (__pyx_t_3) { + __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3); __pyx_t_3 = NULL; + } + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, ((PyObject *)__pyx_v_self)); + __Pyx_INCREF(__pyx_v_source); + __Pyx_GIVEREF(__pyx_v_source); + PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_source); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 110, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "src/gevent/greenlet.py":109 + * + * def __call__(self, source): + * if not source.successful(): # <<<<<<<<<<<<<< + * return SpawnedLink.__call__(self, source) + * + */ + } + + /* "src/gevent/greenlet.py":108 + * __slots__ = [] + * + * def __call__(self, source): # <<<<<<<<<<<<<< + * if not source.successful(): + * return SpawnedLink.__call__(self, source) + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("gevent._greenlet.FailureSpawnedLink.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/greenlet.py":116 + * __slots__ = ('f_code', 'f_lineno', 'f_back') + * + * def __init__(self, f_code, f_lineno, f_back): # <<<<<<<<<<<<<< + * self.f_code = f_code + * self.f_lineno = f_lineno + */ + +/* Python wrapper */ +static int __pyx_pw_6gevent_9_greenlet_6_Frame_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6gevent_9_greenlet_6_Frame_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_f_code = 0; + PyObject *__pyx_v_f_lineno = 0; + PyObject *__pyx_v_f_back = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_f_code,&__pyx_n_s_f_lineno,&__pyx_n_s_f_back,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_f_code)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_f_lineno)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 1); __PYX_ERR(0, 116, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_f_back)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 2); __PYX_ERR(0, 116, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 116, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + } + __pyx_v_f_code = values[0]; + __pyx_v_f_lineno = values[1]; + __pyx_v_f_back = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 116, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent._greenlet._Frame.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_9_greenlet_6_Frame___init__(((struct __pyx_obj_6gevent_9_greenlet__Frame *)__pyx_v_self), __pyx_v_f_code, __pyx_v_f_lineno, __pyx_v_f_back); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_9_greenlet_6_Frame___init__(struct __pyx_obj_6gevent_9_greenlet__Frame *__pyx_v_self, PyObject *__pyx_v_f_code, PyObject *__pyx_v_f_lineno, PyObject *__pyx_v_f_back) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "src/gevent/greenlet.py":117 + * + * def __init__(self, f_code, f_lineno, f_back): + * self.f_code = f_code # <<<<<<<<<<<<<< + * self.f_lineno = f_lineno + * self.f_back = f_back + */ + if (!(likely(((__pyx_v_f_code) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_f_code, __pyx_ptype_6gevent_9_greenlet_CodeType))))) __PYX_ERR(0, 117, __pyx_L1_error) + __pyx_t_1 = __pyx_v_f_code; + __Pyx_INCREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_self->f_code); + __Pyx_DECREF(((PyObject *)__pyx_v_self->f_code)); + __pyx_v_self->f_code = ((PyCodeObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "src/gevent/greenlet.py":118 + * def __init__(self, f_code, f_lineno, f_back): + * self.f_code = f_code + * self.f_lineno = f_lineno # <<<<<<<<<<<<<< + * self.f_back = f_back + * + */ + __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_f_lineno); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 118, __pyx_L1_error) + __pyx_v_self->f_lineno = __pyx_t_2; + + /* "src/gevent/greenlet.py":119 + * self.f_code = f_code + * self.f_lineno = f_lineno + * self.f_back = f_back # <<<<<<<<<<<<<< + * + * @property + */ + if (!(likely(((__pyx_v_f_back) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_f_back, __pyx_ptype_6gevent_9_greenlet__Frame))))) __PYX_ERR(0, 119, __pyx_L1_error) + __pyx_t_1 = __pyx_v_f_back; + __Pyx_INCREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_self->f_back); + __Pyx_DECREF(((PyObject *)__pyx_v_self->f_back)); + __pyx_v_self->f_back = ((struct __pyx_obj_6gevent_9_greenlet__Frame *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "src/gevent/greenlet.py":116 + * __slots__ = ('f_code', 'f_lineno', 'f_back') + * + * def __init__(self, f_code, f_lineno, f_back): # <<<<<<<<<<<<<< + * self.f_code = f_code + * self.f_lineno = f_lineno + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent._greenlet._Frame.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/greenlet.py":122 + * + * @property + * def f_globals(self): # <<<<<<<<<<<<<< + * return None + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_9_greenlet_6_Frame_9f_globals_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_9_greenlet_6_Frame_9f_globals_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_9_greenlet_6_Frame_9f_globals___get__(((struct __pyx_obj_6gevent_9_greenlet__Frame *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_9_greenlet_6_Frame_9f_globals___get__(CYTHON_UNUSED struct __pyx_obj_6gevent_9_greenlet__Frame *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + + /* "src/gevent/greenlet.py":123 + * @property + * def f_globals(self): + * return None # <<<<<<<<<<<<<< + * + * def _Frame_from_list(frames): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + + /* "src/gevent/greenlet.py":122 + * + * @property + * def f_globals(self): # <<<<<<<<<<<<<< + * return None + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/_greenlet.pxd":72 + * @cython.freelist(1000) + * cdef class _Frame: + * cdef readonly CodeType f_code # <<<<<<<<<<<<<< + * cdef readonly int f_lineno + * cdef readonly _Frame f_back + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_9_greenlet_6_Frame_6f_code_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_9_greenlet_6_Frame_6f_code_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_9_greenlet_6_Frame_6f_code___get__(((struct __pyx_obj_6gevent_9_greenlet__Frame *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_9_greenlet_6_Frame_6f_code___get__(struct __pyx_obj_6gevent_9_greenlet__Frame *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_self->f_code)); + __pyx_r = ((PyObject *)__pyx_v_self->f_code); + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/_greenlet.pxd":73 + * cdef class _Frame: + * cdef readonly CodeType f_code + * cdef readonly int f_lineno # <<<<<<<<<<<<<< + * cdef readonly _Frame f_back + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_9_greenlet_6_Frame_8f_lineno_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_9_greenlet_6_Frame_8f_lineno_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_9_greenlet_6_Frame_8f_lineno___get__(((struct __pyx_obj_6gevent_9_greenlet__Frame *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_9_greenlet_6_Frame_8f_lineno___get__(struct __pyx_obj_6gevent_9_greenlet__Frame *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->f_lineno); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 73, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent._greenlet._Frame.f_lineno.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/_greenlet.pxd":74 + * cdef readonly CodeType f_code + * cdef readonly int f_lineno + * cdef readonly _Frame f_back # <<<<<<<<<<<<<< + * + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_9_greenlet_6_Frame_6f_back_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_9_greenlet_6_Frame_6f_back_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_9_greenlet_6_Frame_6f_back___get__(((struct __pyx_obj_6gevent_9_greenlet__Frame *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_9_greenlet_6_Frame_6f_back___get__(struct __pyx_obj_6gevent_9_greenlet__Frame *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_self->f_back)); + __pyx_r = ((PyObject *)__pyx_v_self->f_back); + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/greenlet.py":125 + * return None + * + * def _Frame_from_list(frames): # <<<<<<<<<<<<<< + * previous = None + * for frame in reversed(frames): + */ + +static struct __pyx_obj_6gevent_9_greenlet__Frame *__pyx_f_6gevent_9_greenlet__Frame_from_list(PyObject *__pyx_v_frames) { + struct __pyx_obj_6gevent_9_greenlet__Frame *__pyx_v_previous = 0; + PyObject *__pyx_v_frame = 0; + struct __pyx_obj_6gevent_9_greenlet__Frame *__pyx_v_f = 0; + struct __pyx_obj_6gevent_9_greenlet__Frame *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + __Pyx_RefNannySetupContext("_Frame_from_list", 0); + + /* "src/gevent/greenlet.py":126 + * + * def _Frame_from_list(frames): + * previous = None # <<<<<<<<<<<<<< + * for frame in reversed(frames): + * f = _Frame(frame[0], frame[1], previous) + */ + __Pyx_INCREF(Py_None); + __pyx_v_previous = ((struct __pyx_obj_6gevent_9_greenlet__Frame *)Py_None); + + /* "src/gevent/greenlet.py":127 + * def _Frame_from_list(frames): + * previous = None + * for frame in reversed(frames): # <<<<<<<<<<<<<< + * f = _Frame(frame[0], frame[1], previous) + * previous = f + */ + if (unlikely(__pyx_v_frames == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); + __PYX_ERR(0, 127, __pyx_L1_error) + } + __pyx_t_1 = __pyx_v_frames; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = PyList_GET_SIZE(__pyx_t_1) - 1; + for (;;) { + if (__pyx_t_2 < 0) break; + if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2--; if (unlikely(0 < 0)) __PYX_ERR(0, 127, __pyx_L1_error) + #else + __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2--; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 127, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + #endif + if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(0, 127, __pyx_L1_error) + __Pyx_XDECREF_SET(__pyx_v_frame, ((PyObject*)__pyx_t_3)); + __pyx_t_3 = 0; + + /* "src/gevent/greenlet.py":128 + * previous = None + * for frame in reversed(frames): + * f = _Frame(frame[0], frame[1], previous) # <<<<<<<<<<<<<< + * previous = f + * return previous + */ + if (unlikely(__pyx_v_frame == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 128, __pyx_L1_error) + } + __pyx_t_3 = __Pyx_GetItemInt_Tuple(__pyx_v_frame, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 128, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (unlikely(__pyx_v_frame == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 128, __pyx_L1_error) + } + __pyx_t_4 = __Pyx_GetItemInt_Tuple(__pyx_v_frame, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 128, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 128, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4); + __Pyx_INCREF(((PyObject *)__pyx_v_previous)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_previous)); + PyTuple_SET_ITEM(__pyx_t_5, 2, ((PyObject *)__pyx_v_previous)); + __pyx_t_3 = 0; + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6gevent_9_greenlet__Frame), __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 128, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF_SET(__pyx_v_f, ((struct __pyx_obj_6gevent_9_greenlet__Frame *)__pyx_t_4)); + __pyx_t_4 = 0; + + /* "src/gevent/greenlet.py":129 + * for frame in reversed(frames): + * f = _Frame(frame[0], frame[1], previous) + * previous = f # <<<<<<<<<<<<<< + * return previous + * + */ + __Pyx_INCREF(((PyObject *)__pyx_v_f)); + __Pyx_DECREF_SET(__pyx_v_previous, __pyx_v_f); + + /* "src/gevent/greenlet.py":127 + * def _Frame_from_list(frames): + * previous = None + * for frame in reversed(frames): # <<<<<<<<<<<<<< + * f = _Frame(frame[0], frame[1], previous) + * previous = f + */ + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/greenlet.py":130 + * f = _Frame(frame[0], frame[1], previous) + * previous = f + * return previous # <<<<<<<<<<<<<< + * + * def _extract_stack(limit): + */ + __Pyx_XDECREF(((PyObject *)__pyx_r)); + __Pyx_INCREF(((PyObject *)__pyx_v_previous)); + __pyx_r = __pyx_v_previous; + goto __pyx_L0; + + /* "src/gevent/greenlet.py":125 + * return None + * + * def _Frame_from_list(frames): # <<<<<<<<<<<<<< + * previous = None + * for frame in reversed(frames): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("gevent._greenlet._Frame_from_list", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_previous); + __Pyx_XDECREF(__pyx_v_frame); + __Pyx_XDECREF((PyObject *)__pyx_v_f); + __Pyx_XGIVEREF((PyObject *)__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/greenlet.py":132 + * return previous + * + * def _extract_stack(limit): # <<<<<<<<<<<<<< + * try: + * frame = sys_getframe() + */ + +static CYTHON_INLINE PyObject *__pyx_f_6gevent_9_greenlet__extract_stack(int __pyx_v_limit) { + PyObject *__pyx_v_frames = 0; + PyFrameObject *__pyx_v_frame = 0; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + int __pyx_t_8; + int __pyx_t_9; + int __pyx_t_10; + int __pyx_t_11; + __Pyx_RefNannySetupContext("_extract_stack", 0); + + /* "src/gevent/greenlet.py":133 + * + * def _extract_stack(limit): + * try: # <<<<<<<<<<<<<< + * frame = sys_getframe() + * except ValueError: + */ + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "src/gevent/greenlet.py":134 + * def _extract_stack(limit): + * try: + * frame = sys_getframe() # <<<<<<<<<<<<<< + * except ValueError: + * # In certain embedded cases that directly use the Python C api + */ + __Pyx_INCREF(__pyx_v_6gevent_9_greenlet_sys_getframe); + __pyx_t_5 = __pyx_v_6gevent_9_greenlet_sys_getframe; __pyx_t_6 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); + if (likely(__pyx_t_6)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_5, function); + } + } + __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 134, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_6gevent_9_greenlet_FrameType))))) __PYX_ERR(0, 134, __pyx_L3_error) + __pyx_v_frame = ((PyFrameObject *)__pyx_t_4); + __pyx_t_4 = 0; + + /* "src/gevent/greenlet.py":133 + * + * def _extract_stack(limit): + * try: # <<<<<<<<<<<<<< + * frame = sys_getframe() + * except ValueError: + */ + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L8_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "src/gevent/greenlet.py":135 + * try: + * frame = sys_getframe() + * except ValueError: # <<<<<<<<<<<<<< + * # In certain embedded cases that directly use the Python C api + * # to call Greenlet.spawn (e.g., uwsgi) this can raise + */ + __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ValueError); + if (__pyx_t_7) { + __Pyx_AddTraceback("gevent._greenlet._extract_stack", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6) < 0) __PYX_ERR(0, 135, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_6); + + /* "src/gevent/greenlet.py":143 + * # not the Python level. + * # See https://github.com/gevent/gevent/issues/1212 + * frame = None # <<<<<<<<<<<<<< + * + * frames = [] + */ + __Pyx_INCREF(Py_None); + __Pyx_XDECREF_SET(__pyx_v_frame, ((PyFrameObject *)Py_None)); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + + /* "src/gevent/greenlet.py":133 + * + * def _extract_stack(limit): + * try: # <<<<<<<<<<<<<< + * frame = sys_getframe() + * except ValueError: + */ + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L8_try_end:; + } + + /* "src/gevent/greenlet.py":145 + * frame = None + * + * frames = [] # <<<<<<<<<<<<<< + * + * while limit and frame is not None: + */ + __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 145, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_v_frames = ((PyObject*)__pyx_t_6); + __pyx_t_6 = 0; + + /* "src/gevent/greenlet.py":147 + * frames = [] + * + * while limit and frame is not None: # <<<<<<<<<<<<<< + * limit -= 1 + * frames.append((frame.f_code, frame.f_lineno)) + */ + while (1) { + __pyx_t_9 = (__pyx_v_limit != 0); + if (__pyx_t_9) { + } else { + __pyx_t_8 = __pyx_t_9; + goto __pyx_L13_bool_binop_done; + } + __pyx_t_9 = (((PyObject *)__pyx_v_frame) != Py_None); + __pyx_t_10 = (__pyx_t_9 != 0); + __pyx_t_8 = __pyx_t_10; + __pyx_L13_bool_binop_done:; + if (!__pyx_t_8) break; + + /* "src/gevent/greenlet.py":148 + * + * while limit and frame is not None: + * limit -= 1 # <<<<<<<<<<<<<< + * frames.append((frame.f_code, frame.f_lineno)) + * frame = frame.f_back + */ + __pyx_v_limit = (__pyx_v_limit - 1); + + /* "src/gevent/greenlet.py":149 + * while limit and frame is not None: + * limit -= 1 + * frames.append((frame.f_code, frame.f_lineno)) # <<<<<<<<<<<<<< + * frame = frame.f_back + * + */ + __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_frame->f_lineno); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 149, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 149, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(((PyObject *)__pyx_v_frame->f_code)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_frame->f_code)); + PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_frame->f_code)); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_frames, __pyx_t_5); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 149, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "src/gevent/greenlet.py":150 + * limit -= 1 + * frames.append((frame.f_code, frame.f_lineno)) + * frame = frame.f_back # <<<<<<<<<<<<<< + * + * return frames + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_frame), __pyx_n_s_f_back); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 150, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_6gevent_9_greenlet_FrameType))))) __PYX_ERR(0, 150, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_frame, ((PyFrameObject *)__pyx_t_5)); + __pyx_t_5 = 0; + } + + /* "src/gevent/greenlet.py":152 + * frame = frame.f_back + * + * return frames # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_frames); + __pyx_r = __pyx_v_frames; + goto __pyx_L0; + + /* "src/gevent/greenlet.py":132 + * return previous + * + * def _extract_stack(limit): # <<<<<<<<<<<<<< + * try: + * frame = sys_getframe() + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("gevent._greenlet._extract_stack", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_frames); + __Pyx_XDECREF((PyObject *)__pyx_v_frame); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/greenlet.py":166 + * + * # pylint:disable=keyword-arg-before-vararg,super-init-not-called + * def __init__(self, run=None, *args, **kwargs): # <<<<<<<<<<<<<< + * """ + * :param args: The arguments passed to the ``run`` function. + */ + +/* Python wrapper */ +static int __pyx_pw_6gevent_9_greenlet_8Greenlet_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6gevent_9_greenlet_8Greenlet___init__[] = "\n :param args: The arguments passed to the ``run`` function.\n :param kwargs: The keyword arguments passed to the ``run`` function.\n :keyword callable run: The callable object to run. If not given, this object's\n `_run` method will be invoked (typically defined by subclasses).\n\n .. versionchanged:: 1.1b1\n The ``run`` argument to the constructor is now verified to be a callable\n object. Previously, passing a non-callable object would fail after the greenlet\n was spawned.\n\n .. versionchanged:: 1.3b1\n The ``GEVENT_TRACK_GREENLET_TREE`` configuration value may be set to\n a false value to disable ``spawn_tree_locals``, ``spawning_greenlet``,\n and ``spawning_stack``. The first two will be None in that case, and the\n latter will be empty.\n "; +#if CYTHON_COMPILING_IN_CPYTHON +struct wrapperbase __pyx_wrapperbase_6gevent_9_greenlet_8Greenlet___init__; +#endif +static int __pyx_pw_6gevent_9_greenlet_8Greenlet_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_run = 0; + PyObject *__pyx_v_args = 0; + PyObject *__pyx_v_kwargs = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return -1; + __Pyx_GOTREF(__pyx_v_kwargs); + if (PyTuple_GET_SIZE(__pyx_args) > 1) { + __pyx_v_args = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args)); + if (unlikely(!__pyx_v_args)) { + __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0; + __Pyx_RefNannyFinishContext(); + return -1; + } + __Pyx_GOTREF(__pyx_v_args); + } else { + __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple); + } + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_run,0}; + PyObject* values[1] = {0}; + values[0] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + default: + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_run); + if (value) { values[0] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, used_pos_args, "__init__") < 0)) __PYX_ERR(0, 166, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + default: + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + } + } + __pyx_v_run = values[0]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0; + __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0; + __Pyx_AddTraceback("gevent._greenlet.Greenlet.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_9_greenlet_8Greenlet___init__(((struct __pyx_obj_6gevent_9_greenlet_Greenlet *)__pyx_v_self), __pyx_v_run, __pyx_v_args, __pyx_v_kwargs); + + /* function exit code */ + __Pyx_XDECREF(__pyx_v_args); + __Pyx_XDECREF(__pyx_v_kwargs); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_9_greenlet_8Greenlet___init__(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self, PyObject *__pyx_v_run, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) { + PyGreenlet *__pyx_v_spawner = NULL; + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + int __pyx_t_12; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "src/gevent/greenlet.py":213 + * + * + * _greenlet__init__(self, None, get_hub()) # <<<<<<<<<<<<<< + * + * if run is not None: + */ + __pyx_t_2 = ((PyObject *)__pyx_f_6gevent_11__hub_local_get_hub_noargs(0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 213, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_6gevent_9_greenlet__greenlet__init__); + __pyx_t_3 = __pyx_v_6gevent_9_greenlet__greenlet__init__; __pyx_t_4 = NULL; + __pyx_t_5 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_5 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_3)) { + PyObject *__pyx_temp[4] = {__pyx_t_4, ((PyObject *)__pyx_v_self), Py_None, __pyx_t_2}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 213, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { + PyObject *__pyx_temp[4] = {__pyx_t_4, ((PyObject *)__pyx_v_self), Py_None, __pyx_t_2}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 213, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } else + #endif + { + __pyx_t_6 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 213, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (__pyx_t_4) { + __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL; + } + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, ((PyObject *)__pyx_v_self)); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, Py_None); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 213, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/greenlet.py":215 + * _greenlet__init__(self, None, get_hub()) + * + * if run is not None: # <<<<<<<<<<<<<< + * self._run = run + * + */ + __pyx_t_7 = (__pyx_v_run != Py_None); + __pyx_t_8 = (__pyx_t_7 != 0); + if (__pyx_t_8) { + + /* "src/gevent/greenlet.py":216 + * + * if run is not None: + * self._run = run # <<<<<<<<<<<<<< + * + * # If they didn't pass a callable at all, then they must + */ + if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_run_2, __pyx_v_run) < 0) __PYX_ERR(0, 216, __pyx_L1_error) + + /* "src/gevent/greenlet.py":215 + * _greenlet__init__(self, None, get_hub()) + * + * if run is not None: # <<<<<<<<<<<<<< + * self._run = run + * + */ + } + + /* "src/gevent/greenlet.py":221 + * # already have one. Note that subclassing to override the run() method + * # itself has never been documented or supported. + * if not callable(self._run): # <<<<<<<<<<<<<< + * raise TypeError("The run argument or self._run must be callable") + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_run_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 221, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_8 = __Pyx_PyCallable_Check(__pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 221, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_7 = ((!(__pyx_t_8 != 0)) != 0); + if (unlikely(__pyx_t_7)) { + + /* "src/gevent/greenlet.py":222 + * # itself has never been documented or supported. + * if not callable(self._run): + * raise TypeError("The run argument or self._run must be callable") # <<<<<<<<<<<<<< + * + * self.args = args + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 222, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 222, __pyx_L1_error) + + /* "src/gevent/greenlet.py":221 + * # already have one. Note that subclassing to override the run() method + * # itself has never been documented or supported. + * if not callable(self._run): # <<<<<<<<<<<<<< + * raise TypeError("The run argument or self._run must be callable") + * + */ + } + + /* "src/gevent/greenlet.py":224 + * raise TypeError("The run argument or self._run must be callable") + * + * self.args = args # <<<<<<<<<<<<<< + * self.kwargs = kwargs + * self.value = None + */ + __Pyx_INCREF(__pyx_v_args); + __Pyx_GIVEREF(__pyx_v_args); + __Pyx_GOTREF(__pyx_v_self->args); + __Pyx_DECREF(__pyx_v_self->args); + __pyx_v_self->args = __pyx_v_args; + + /* "src/gevent/greenlet.py":225 + * + * self.args = args + * self.kwargs = kwargs # <<<<<<<<<<<<<< + * self.value = None + * + */ + __Pyx_INCREF(__pyx_v_kwargs); + __Pyx_GIVEREF(__pyx_v_kwargs); + __Pyx_GOTREF(__pyx_v_self->kwargs); + __Pyx_DECREF(__pyx_v_self->kwargs); + __pyx_v_self->kwargs = __pyx_v_kwargs; + + /* "src/gevent/greenlet.py":226 + * self.args = args + * self.kwargs = kwargs + * self.value = None # <<<<<<<<<<<<<< + * + * #: An event, such as a timer or a callback that fires. It is established in + */ + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->value); + __Pyx_DECREF(__pyx_v_self->value); + __pyx_v_self->value = Py_None; + + /* "src/gevent/greenlet.py":234 + * #: scheduled for starting. A placeholder _dummy_event is assigned by them to prevent + * #: the greenlet from being started in the future, if necessary. + * self._start_event = None # <<<<<<<<<<<<<< + * + * self._notifier = None + */ + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->_start_event); + __Pyx_DECREF(__pyx_v_self->_start_event); + __pyx_v_self->_start_event = Py_None; + + /* "src/gevent/greenlet.py":236 + * self._start_event = None + * + * self._notifier = None # <<<<<<<<<<<<<< + * self._formatted_info = None + * self._links = [] + */ + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->_notifier); + __Pyx_DECREF(__pyx_v_self->_notifier); + __pyx_v_self->_notifier = Py_None; + + /* "src/gevent/greenlet.py":237 + * + * self._notifier = None + * self._formatted_info = None # <<<<<<<<<<<<<< + * self._links = [] + * self._ident = None + */ + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->_formatted_info); + __Pyx_DECREF(__pyx_v_self->_formatted_info); + __pyx_v_self->_formatted_info = ((PyObject*)Py_None); + + /* "src/gevent/greenlet.py":238 + * self._notifier = None + * self._formatted_info = None + * self._links = [] # <<<<<<<<<<<<<< + * self._ident = None + * + */ + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 238, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_self->_links); + __Pyx_DECREF(__pyx_v_self->_links); + __pyx_v_self->_links = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "src/gevent/greenlet.py":239 + * self._formatted_info = None + * self._links = [] + * self._ident = None # <<<<<<<<<<<<<< + * + * # Initial state: None. + */ + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->_ident); + __Pyx_DECREF(__pyx_v_self->_ident); + __pyx_v_self->_ident = Py_None; + + /* "src/gevent/greenlet.py":244 + * # Completed successfully: (None, None, None) + * # Failed with exception: (t, v, dump_traceback(tb))) + * self._exc_info = None # <<<<<<<<<<<<<< + * + * if GEVENT_CONFIG.track_greenlet_tree: + */ + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->_exc_info); + __Pyx_DECREF(__pyx_v_self->_exc_info); + __pyx_v_self->_exc_info = ((PyObject*)Py_None); + + /* "src/gevent/greenlet.py":246 + * self._exc_info = None + * + * if GEVENT_CONFIG.track_greenlet_tree: # <<<<<<<<<<<<<< + * spawner = getcurrent() # pylint:disable=undefined-variable + * self.spawning_greenlet = wref(spawner) + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_6gevent_9_greenlet_GEVENT_CONFIG, __pyx_n_s_track_greenlet_tree); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 246, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 246, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_7) { + + /* "src/gevent/greenlet.py":247 + * + * if GEVENT_CONFIG.track_greenlet_tree: + * spawner = getcurrent() # pylint:disable=undefined-variable # <<<<<<<<<<<<<< + * self.spawning_greenlet = wref(spawner) + * try: + */ + __pyx_t_1 = ((PyObject *)__pyx_f_6gevent_9_greenlet_getcurrent()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 247, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_spawner = ((PyGreenlet *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "src/gevent/greenlet.py":248 + * if GEVENT_CONFIG.track_greenlet_tree: + * spawner = getcurrent() # pylint:disable=undefined-variable + * self.spawning_greenlet = wref(spawner) # <<<<<<<<<<<<<< + * try: + * self.spawn_tree_locals = spawner.spawn_tree_locals + */ + __Pyx_INCREF(__pyx_v_6gevent_9_greenlet_wref); + __pyx_t_3 = __pyx_v_6gevent_9_greenlet_wref; __pyx_t_6 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_6)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_6, ((PyObject *)__pyx_v_spawner)) : __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_spawner)); + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 248, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_self->spawning_greenlet); + __Pyx_DECREF(__pyx_v_self->spawning_greenlet); + __pyx_v_self->spawning_greenlet = __pyx_t_1; + __pyx_t_1 = 0; + + /* "src/gevent/greenlet.py":249 + * spawner = getcurrent() # pylint:disable=undefined-variable + * self.spawning_greenlet = wref(spawner) + * try: # <<<<<<<<<<<<<< + * self.spawn_tree_locals = spawner.spawn_tree_locals + * except AttributeError: + */ + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); + __Pyx_XGOTREF(__pyx_t_9); + __Pyx_XGOTREF(__pyx_t_10); + __Pyx_XGOTREF(__pyx_t_11); + /*try:*/ { + + /* "src/gevent/greenlet.py":250 + * self.spawning_greenlet = wref(spawner) + * try: + * self.spawn_tree_locals = spawner.spawn_tree_locals # <<<<<<<<<<<<<< + * except AttributeError: + * self.spawn_tree_locals = {} + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_spawner), __pyx_n_s_spawn_tree_locals); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 250, __pyx_L6_error) + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(PyDict_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 250, __pyx_L6_error) + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_self->spawn_tree_locals); + __Pyx_DECREF(__pyx_v_self->spawn_tree_locals); + __pyx_v_self->spawn_tree_locals = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "src/gevent/greenlet.py":249 + * spawner = getcurrent() # pylint:disable=undefined-variable + * self.spawning_greenlet = wref(spawner) + * try: # <<<<<<<<<<<<<< + * self.spawn_tree_locals = spawner.spawn_tree_locals + * except AttributeError: + */ + } + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + goto __pyx_L11_try_end; + __pyx_L6_error:; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/greenlet.py":251 + * try: + * self.spawn_tree_locals = spawner.spawn_tree_locals + * except AttributeError: # <<<<<<<<<<<<<< + * self.spawn_tree_locals = {} + * if spawner.parent is not None: + */ + __pyx_t_5 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_AttributeError); + if (__pyx_t_5) { + __Pyx_AddTraceback("gevent._greenlet.Greenlet.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_3, &__pyx_t_6) < 0) __PYX_ERR(0, 251, __pyx_L8_except_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GOTREF(__pyx_t_6); + + /* "src/gevent/greenlet.py":252 + * self.spawn_tree_locals = spawner.spawn_tree_locals + * except AttributeError: + * self.spawn_tree_locals = {} # <<<<<<<<<<<<<< + * if spawner.parent is not None: + * # The main greenlet has no parent. + */ + __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 252, __pyx_L8_except_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_v_self->spawn_tree_locals); + __Pyx_DECREF(__pyx_v_self->spawn_tree_locals); + __pyx_v_self->spawn_tree_locals = ((PyObject*)__pyx_t_2); + __pyx_t_2 = 0; + + /* "src/gevent/greenlet.py":253 + * except AttributeError: + * self.spawn_tree_locals = {} + * if spawner.parent is not None: # <<<<<<<<<<<<<< + * # The main greenlet has no parent. + * # Its children get separate locals. + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_spawner), __pyx_n_s_parent); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 253, __pyx_L8_except_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_7 = (__pyx_t_2 != Py_None); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_8 = (__pyx_t_7 != 0); + if (__pyx_t_8) { + + /* "src/gevent/greenlet.py":256 + * # The main greenlet has no parent. + * # Its children get separate locals. + * spawner.spawn_tree_locals = self.spawn_tree_locals # <<<<<<<<<<<<<< + * + * self._spawning_stack_frames = _extract_stack(self.spawning_stack_limit) + */ + __pyx_t_2 = __pyx_v_self->spawn_tree_locals; + __Pyx_INCREF(__pyx_t_2); + if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_spawner), __pyx_n_s_spawn_tree_locals, __pyx_t_2) < 0) __PYX_ERR(0, 256, __pyx_L8_except_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/greenlet.py":253 + * except AttributeError: + * self.spawn_tree_locals = {} + * if spawner.parent is not None: # <<<<<<<<<<<<<< + * # The main greenlet has no parent. + * # Its children get separate locals. + */ + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L7_exception_handled; + } + goto __pyx_L8_except_error; + __pyx_L8_except_error:; + + /* "src/gevent/greenlet.py":249 + * spawner = getcurrent() # pylint:disable=undefined-variable + * self.spawning_greenlet = wref(spawner) + * try: # <<<<<<<<<<<<<< + * self.spawn_tree_locals = spawner.spawn_tree_locals + * except AttributeError: + */ + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11); + goto __pyx_L1_error; + __pyx_L7_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11); + __pyx_L11_try_end:; + } + + /* "src/gevent/greenlet.py":258 + * spawner.spawn_tree_locals = self.spawn_tree_locals + * + * self._spawning_stack_frames = _extract_stack(self.spawning_stack_limit) # <<<<<<<<<<<<<< + * self._spawning_stack_frames.extend(getattr(spawner, '_spawning_stack_frames', [])) + * else: + */ + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_spawning_stack_limit); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 258, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_6); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 258, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __pyx_f_6gevent_9_greenlet__extract_stack(__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 258, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_v_self->_spawning_stack_frames); + __Pyx_DECREF(__pyx_v_self->_spawning_stack_frames); + __pyx_v_self->_spawning_stack_frames = ((PyObject*)__pyx_t_6); + __pyx_t_6 = 0; + + /* "src/gevent/greenlet.py":259 + * + * self._spawning_stack_frames = _extract_stack(self.spawning_stack_limit) + * self._spawning_stack_frames.extend(getattr(spawner, '_spawning_stack_frames', [])) # <<<<<<<<<<<<<< + * else: + * # None is the default for all of these in Cython, but we + */ + if (unlikely(__pyx_v_self->_spawning_stack_frames == Py_None)) { + PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "extend"); + __PYX_ERR(0, 259, __pyx_L1_error) + } + __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 259, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_3 = __Pyx_GetAttr3(((PyObject *)__pyx_v_spawner), __pyx_n_s_spawning_stack_frames, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 259, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_12 = __Pyx_PyList_Extend(__pyx_v_self->_spawning_stack_frames, __pyx_t_3); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 259, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "src/gevent/greenlet.py":246 + * self._exc_info = None + * + * if GEVENT_CONFIG.track_greenlet_tree: # <<<<<<<<<<<<<< + * spawner = getcurrent() # pylint:disable=undefined-variable + * self.spawning_greenlet = wref(spawner) + */ + goto __pyx_L5; + } + + /* "src/gevent/greenlet.py":263 + * # None is the default for all of these in Cython, but we + * # need to declare them for pure-Python mode. + * self.spawning_greenlet = None # <<<<<<<<<<<<<< + * self.spawn_tree_locals = None + * self._spawning_stack_frames = None + */ + /*else*/ { + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->spawning_greenlet); + __Pyx_DECREF(__pyx_v_self->spawning_greenlet); + __pyx_v_self->spawning_greenlet = Py_None; + + /* "src/gevent/greenlet.py":264 + * # need to declare them for pure-Python mode. + * self.spawning_greenlet = None + * self.spawn_tree_locals = None # <<<<<<<<<<<<<< + * self._spawning_stack_frames = None + * + */ + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->spawn_tree_locals); + __Pyx_DECREF(__pyx_v_self->spawn_tree_locals); + __pyx_v_self->spawn_tree_locals = ((PyObject*)Py_None); + + /* "src/gevent/greenlet.py":265 + * self.spawning_greenlet = None + * self.spawn_tree_locals = None + * self._spawning_stack_frames = None # <<<<<<<<<<<<<< + * + * @Lazy + */ + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->_spawning_stack_frames); + __Pyx_DECREF(__pyx_v_self->_spawning_stack_frames); + __pyx_v_self->_spawning_stack_frames = ((PyObject*)Py_None); + } + __pyx_L5:; + + /* "src/gevent/greenlet.py":166 + * + * # pylint:disable=keyword-arg-before-vararg,super-init-not-called + * def __init__(self, run=None, *args, **kwargs): # <<<<<<<<<<<<<< + * """ + * :param args: The arguments passed to the ``run`` function. + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("gevent._greenlet.Greenlet.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_spawner); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/greenlet.py":268 + * + * @Lazy + * def spawning_stack(self): # <<<<<<<<<<<<<< + * # Store this in the __dict__. We don't use it from the C + * # code. It's tempting to discard _spawning_stack_frames + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_3spawning_stack(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6gevent_9_greenlet_8Greenlet_2spawning_stack[] = "Greenlet.spawning_stack(self)"; +static PyMethodDef __pyx_mdef_6gevent_9_greenlet_8Greenlet_3spawning_stack = {"spawning_stack", (PyCFunction)__pyx_pw_6gevent_9_greenlet_8Greenlet_3spawning_stack, METH_NOARGS, __pyx_doc_6gevent_9_greenlet_8Greenlet_2spawning_stack}; +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_3spawning_stack(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("spawning_stack (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_9_greenlet_8Greenlet_2spawning_stack(((struct __pyx_obj_6gevent_9_greenlet_Greenlet *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_2spawning_stack(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("spawning_stack", 0); + + /* "src/gevent/greenlet.py":273 + * # after this, but child greenlets may still be created + * # that need it. + * return _Frame_from_list(self._spawning_stack_frames or []) # <<<<<<<<<<<<<< + * + * def _get_minimal_ident(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_self->_spawning_stack_frames); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 273, __pyx_L1_error) + if (!__pyx_t_2) { + } else { + __Pyx_INCREF(__pyx_v_self->_spawning_stack_frames); + __pyx_t_1 = __pyx_v_self->_spawning_stack_frames; + goto __pyx_L3_bool_binop_done; + } + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 273, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_t_3); + __pyx_t_1 = __pyx_t_3; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_L3_bool_binop_done:; + __pyx_t_3 = ((PyObject *)__pyx_f_6gevent_9_greenlet__Frame_from_list(((PyObject*)__pyx_t_1))); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 273, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "src/gevent/greenlet.py":268 + * + * @Lazy + * def spawning_stack(self): # <<<<<<<<<<<<<< + * # Store this in the __dict__. We don't use it from the C + * # code. It's tempting to discard _spawning_stack_frames + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("gevent._greenlet.Greenlet.spawning_stack", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/greenlet.py":275 + * return _Frame_from_list(self._spawning_stack_frames or []) + * + * def _get_minimal_ident(self): # <<<<<<<<<<<<<< + * reg = self.parent.ident_registry + * return reg.get_ident(self) + */ + +static PyObject *__pyx_f_6gevent_9_greenlet_8Greenlet__get_minimal_ident(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self) { + struct __pyx_obj_6gevent_7__ident_IdentRegistry *__pyx_v_reg = 0; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("_get_minimal_ident", 0); + + /* "src/gevent/greenlet.py":276 + * + * def _get_minimal_ident(self): + * reg = self.parent.ident_registry # <<<<<<<<<<<<<< + * return reg.get_ident(self) + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_parent); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 276, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_ident_registry); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 276, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_6gevent_7__ident_IdentRegistry))))) __PYX_ERR(0, 276, __pyx_L1_error) + __pyx_v_reg = ((struct __pyx_obj_6gevent_7__ident_IdentRegistry *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "src/gevent/greenlet.py":277 + * def _get_minimal_ident(self): + * reg = self.parent.ident_registry + * return reg.get_ident(self) # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = ((struct __pyx_vtabstruct_6gevent_7__ident_IdentRegistry *)__pyx_v_reg->__pyx_vtab)->get_ident(__pyx_v_reg, ((PyObject *)__pyx_v_self), 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 277, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "src/gevent/greenlet.py":275 + * return _Frame_from_list(self._spawning_stack_frames or []) + * + * def _get_minimal_ident(self): # <<<<<<<<<<<<<< + * reg = self.parent.ident_registry + * return reg.get_ident(self) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent._greenlet.Greenlet._get_minimal_ident", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_reg); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/greenlet.py":280 + * + * @property + * def minimal_ident(self): # <<<<<<<<<<<<<< + * """ + * A small, unique integer that identifies this object. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_13minimal_ident_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_13minimal_ident_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_9_greenlet_8Greenlet_13minimal_ident___get__(((struct __pyx_obj_6gevent_9_greenlet_Greenlet *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_13minimal_ident___get__(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "src/gevent/greenlet.py":296 + * .. versionadded:: 1.3a2 + * """ + * if self._ident is None: # <<<<<<<<<<<<<< + * self._ident = self._get_minimal_ident() + * return self._ident + */ + __pyx_t_1 = (__pyx_v_self->_ident == Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "src/gevent/greenlet.py":297 + * """ + * if self._ident is None: + * self._ident = self._get_minimal_ident() # <<<<<<<<<<<<<< + * return self._ident + * + */ + __pyx_t_3 = ((struct __pyx_vtabstruct_6gevent_9_greenlet_Greenlet *)__pyx_v_self->__pyx_vtab)->_get_minimal_ident(__pyx_v_self); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 297, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __Pyx_GOTREF(__pyx_v_self->_ident); + __Pyx_DECREF(__pyx_v_self->_ident); + __pyx_v_self->_ident = __pyx_t_3; + __pyx_t_3 = 0; + + /* "src/gevent/greenlet.py":296 + * .. versionadded:: 1.3a2 + * """ + * if self._ident is None: # <<<<<<<<<<<<<< + * self._ident = self._get_minimal_ident() + * return self._ident + */ + } + + /* "src/gevent/greenlet.py":298 + * if self._ident is None: + * self._ident = self._get_minimal_ident() + * return self._ident # <<<<<<<<<<<<<< + * + * @readproperty + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->_ident); + __pyx_r = __pyx_v_self->_ident; + goto __pyx_L0; + + /* "src/gevent/greenlet.py":280 + * + * @property + * def minimal_ident(self): # <<<<<<<<<<<<<< + * """ + * A small, unique integer that identifies this object. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("gevent._greenlet.Greenlet.minimal_ident.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/greenlet.py":301 + * + * @readproperty + * def name(self): # <<<<<<<<<<<<<< + * """ + * The greenlet name. By default, a unique name is constructed using + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_5name(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6gevent_9_greenlet_8Greenlet_4name[] = "Greenlet.name(self)\n\n The greenlet name. By default, a unique name is constructed using\n the :attr:`minimal_ident`. You can assign a string to this\n value to change it. It is shown in the `repr` of this object if it\n has been assigned to or if the `minimal_ident` has already been generated.\n\n .. versionadded:: 1.3a2\n .. versionchanged:: 1.4\n Stop showing generated names in the `repr` when the ``minimal_ident``\n hasn't been requested. This reduces overhead and may be less confusing,\n since ``minimal_ident`` can get reused.\n "; +static PyMethodDef __pyx_mdef_6gevent_9_greenlet_8Greenlet_5name = {"name", (PyCFunction)__pyx_pw_6gevent_9_greenlet_8Greenlet_5name, METH_NOARGS, __pyx_doc_6gevent_9_greenlet_8Greenlet_4name}; +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_5name(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("name (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_9_greenlet_8Greenlet_4name(((struct __pyx_obj_6gevent_9_greenlet_Greenlet *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_4name(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("name", 0); + + /* "src/gevent/greenlet.py":314 + * since ``minimal_ident`` can get reused. + * """ + * return 'Greenlet-%d' % (self.minimal_ident,) # <<<<<<<<<<<<<< + * + * def _raise_exception(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_minimal_ident); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 314, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 314, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_Greenlet_d, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 314, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "src/gevent/greenlet.py":301 + * + * @readproperty + * def name(self): # <<<<<<<<<<<<<< + * """ + * The greenlet name. By default, a unique name is constructed using + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent._greenlet.Greenlet.name", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/greenlet.py":316 + * return 'Greenlet-%d' % (self.minimal_ident,) + * + * def _raise_exception(self): # <<<<<<<<<<<<<< + * reraise(*self.exc_info) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_7_raise_exception(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6gevent_9_greenlet_8Greenlet_6_raise_exception[] = "Greenlet._raise_exception(self)"; +static PyMethodDef __pyx_mdef_6gevent_9_greenlet_8Greenlet_7_raise_exception = {"_raise_exception", (PyCFunction)__pyx_pw_6gevent_9_greenlet_8Greenlet_7_raise_exception, METH_NOARGS, __pyx_doc_6gevent_9_greenlet_8Greenlet_6_raise_exception}; +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_7_raise_exception(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_raise_exception (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_9_greenlet_8Greenlet_6_raise_exception(((struct __pyx_obj_6gevent_9_greenlet_Greenlet *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_6_raise_exception(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("_raise_exception", 0); + + /* "src/gevent/greenlet.py":317 + * + * def _raise_exception(self): + * reraise(*self.exc_info) # <<<<<<<<<<<<<< + * + * @property + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_exc_info); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 317, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PySequence_Tuple(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 317, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_6gevent_9_greenlet_reraise, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 317, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/greenlet.py":316 + * return 'Greenlet-%d' % (self.minimal_ident,) + * + * def _raise_exception(self): # <<<<<<<<<<<<<< + * reraise(*self.exc_info) + * + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent._greenlet.Greenlet._raise_exception", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/greenlet.py":320 + * + * @property + * def loop(self): # <<<<<<<<<<<<<< + * # needed by killall + * return self.parent.loop + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_4loop_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_4loop_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_9_greenlet_8Greenlet_4loop___get__(((struct __pyx_obj_6gevent_9_greenlet_Greenlet *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_4loop___get__(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "src/gevent/greenlet.py":322 + * def loop(self): + * # needed by killall + * return self.parent.loop # <<<<<<<<<<<<<< + * + * def __nonzero__(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_parent); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 322, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_loop); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 322, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "src/gevent/greenlet.py":320 + * + * @property + * def loop(self): # <<<<<<<<<<<<<< + * # needed by killall + * return self.parent.loop + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent._greenlet.Greenlet.loop.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/greenlet.py":324 + * return self.parent.loop + * + * def __nonzero__(self): # <<<<<<<<<<<<<< + * return self._start_event is not None and self._exc_info is None + * try: + */ + +/* Python wrapper */ +static int __pyx_pw_6gevent_9_greenlet_8Greenlet_9__nonzero__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6gevent_9_greenlet_8Greenlet_9__nonzero__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__nonzero__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_9_greenlet_8Greenlet_8__nonzero__(((struct __pyx_obj_6gevent_9_greenlet_Greenlet *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_9_greenlet_8Greenlet_8__nonzero__(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + __Pyx_RefNannySetupContext("__nonzero__", 0); + + /* "src/gevent/greenlet.py":325 + * + * def __nonzero__(self): + * return self._start_event is not None and self._exc_info is None # <<<<<<<<<<<<<< + * try: + * __bool__ = __nonzero__ # Python 3 + */ + __pyx_t_2 = (__pyx_v_self->_start_event != Py_None); + if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L3_bool_binop_done; + } + __pyx_t_2 = (__pyx_v_self->_exc_info == ((PyObject*)Py_None)); + __pyx_t_1 = __pyx_t_2; + __pyx_L3_bool_binop_done:; + __pyx_r = __pyx_t_1; + goto __pyx_L0; + + /* "src/gevent/greenlet.py":324 + * return self.parent.loop + * + * def __nonzero__(self): # <<<<<<<<<<<<<< + * return self._start_event is not None and self._exc_info is None + * try: + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/greenlet.py":348 + * else: + * @property + * def dead(self): # <<<<<<<<<<<<<< + * "Boolean indicating that the greenlet is dead and will not run again." + * return self.__start_cancelled_by_kill() or self.__started_but_aborted() or greenlet.dead.__get__(self) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_4dead_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_4dead_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_9_greenlet_8Greenlet_4dead___get__(((struct __pyx_obj_6gevent_9_greenlet_Greenlet *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_4dead___get__(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "src/gevent/greenlet.py":350 + * def dead(self): + * "Boolean indicating that the greenlet is dead and will not run again." + * return self.__start_cancelled_by_kill() or self.__started_but_aborted() or greenlet.dead.__get__(self) # <<<<<<<<<<<<<< + * + * def __never_started_or_killed(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = ((struct __pyx_vtabstruct_6gevent_9_greenlet_Greenlet *)__pyx_v_self->__pyx_vtab)->__pyx___start_cancelled_by_kill(__pyx_v_self); + if (!__pyx_t_2) { + } else { + __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 350, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L3_bool_binop_done; + } + __pyx_t_2 = ((struct __pyx_vtabstruct_6gevent_9_greenlet_Greenlet *)__pyx_v_self->__pyx_vtab)->__pyx___started_but_aborted(__pyx_v_self); + if (!__pyx_t_2) { + } else { + __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 350, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L3_bool_binop_done; + } + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_6gevent_9_greenlet_greenlet), __pyx_n_s_dead); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 350, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_get); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 350, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_5, function); + } + } + __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_4, ((PyObject *)__pyx_v_self)) : __Pyx_PyObject_CallOneArg(__pyx_t_5, ((PyObject *)__pyx_v_self)); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 350, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_INCREF(__pyx_t_3); + __pyx_t_1 = __pyx_t_3; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_L3_bool_binop_done:; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "src/gevent/greenlet.py":348 + * else: + * @property + * def dead(self): # <<<<<<<<<<<<<< + * "Boolean indicating that the greenlet is dead and will not run again." + * return self.__start_cancelled_by_kill() or self.__started_but_aborted() or greenlet.dead.__get__(self) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("gevent._greenlet.Greenlet.dead.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/greenlet.py":352 + * return self.__start_cancelled_by_kill() or self.__started_but_aborted() or greenlet.dead.__get__(self) + * + * def __never_started_or_killed(self): # <<<<<<<<<<<<<< + * return self._start_event is None + * + */ + +static int __pyx_f_6gevent_9_greenlet_8Greenlet___never_started_or_killed(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("__never_started_or_killed", 0); + + /* "src/gevent/greenlet.py":353 + * + * def __never_started_or_killed(self): + * return self._start_event is None # <<<<<<<<<<<<<< + * + * def __start_pending(self): + */ + __pyx_t_1 = (__pyx_v_self->_start_event == Py_None); + __pyx_r = __pyx_t_1; + goto __pyx_L0; + + /* "src/gevent/greenlet.py":352 + * return self.__start_cancelled_by_kill() or self.__started_but_aborted() or greenlet.dead.__get__(self) + * + * def __never_started_or_killed(self): # <<<<<<<<<<<<<< + * return self._start_event is None + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/greenlet.py":355 + * return self._start_event is None + * + * def __start_pending(self): # <<<<<<<<<<<<<< + * return (self._start_event is not None + * and (self._start_event.pending or getattr(self._start_event, 'active', False))) + */ + +static int __pyx_f_6gevent_9_greenlet_8Greenlet___start_pending(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + __Pyx_RefNannySetupContext("__start_pending", 0); + + /* "src/gevent/greenlet.py":356 + * + * def __start_pending(self): + * return (self._start_event is not None # <<<<<<<<<<<<<< + * and (self._start_event.pending or getattr(self._start_event, 'active', False))) + * + */ + __pyx_t_2 = (__pyx_v_self->_start_event != Py_None); + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + } else { + __pyx_t_1 = __pyx_t_3; + goto __pyx_L3_bool_binop_done; + } + + /* "src/gevent/greenlet.py":357 + * def __start_pending(self): + * return (self._start_event is not None + * and (self._start_event.pending or getattr(self._start_event, 'active', False))) # <<<<<<<<<<<<<< + * + * def __start_cancelled_by_kill(self): + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_start_event, __pyx_n_s_pending); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 357, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 357, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (!__pyx_t_3) { + } else { + __pyx_t_1 = __pyx_t_3; + goto __pyx_L3_bool_binop_done; + } + __pyx_t_4 = __pyx_v_self->_start_event; + __Pyx_INCREF(__pyx_t_4); + __pyx_t_5 = __Pyx_GetAttr3(__pyx_t_4, __pyx_n_s_active, Py_False); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 357, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 357, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_1 = __pyx_t_3; + __pyx_L3_bool_binop_done:; + __pyx_r = __pyx_t_1; + goto __pyx_L0; + + /* "src/gevent/greenlet.py":355 + * return self._start_event is None + * + * def __start_pending(self): # <<<<<<<<<<<<<< + * return (self._start_event is not None + * and (self._start_event.pending or getattr(self._start_event, 'active', False))) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_WriteUnraisable("gevent._greenlet.Greenlet.__start_pending", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/greenlet.py":359 + * and (self._start_event.pending or getattr(self._start_event, 'active', False))) + * + * def __start_cancelled_by_kill(self): # <<<<<<<<<<<<<< + * return self._start_event is _cancelled_start_event + * + */ + +static int __pyx_f_6gevent_9_greenlet_8Greenlet___start_cancelled_by_kill(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("__start_cancelled_by_kill", 0); + + /* "src/gevent/greenlet.py":360 + * + * def __start_cancelled_by_kill(self): + * return self._start_event is _cancelled_start_event # <<<<<<<<<<<<<< + * + * def __start_completed(self): + */ + __pyx_t_1 = (__pyx_v_self->_start_event == ((PyObject *)__pyx_v_6gevent_9_greenlet__cancelled_start_event)); + __pyx_r = __pyx_t_1; + goto __pyx_L0; + + /* "src/gevent/greenlet.py":359 + * and (self._start_event.pending or getattr(self._start_event, 'active', False))) + * + * def __start_cancelled_by_kill(self): # <<<<<<<<<<<<<< + * return self._start_event is _cancelled_start_event + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/greenlet.py":362 + * return self._start_event is _cancelled_start_event + * + * def __start_completed(self): # <<<<<<<<<<<<<< + * return self._start_event is _start_completed_event + * + */ + +static int __pyx_f_6gevent_9_greenlet_8Greenlet___start_completed(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("__start_completed", 0); + + /* "src/gevent/greenlet.py":363 + * + * def __start_completed(self): + * return self._start_event is _start_completed_event # <<<<<<<<<<<<<< + * + * def __started_but_aborted(self): + */ + __pyx_t_1 = (__pyx_v_self->_start_event == ((PyObject *)__pyx_v_6gevent_9_greenlet__start_completed_event)); + __pyx_r = __pyx_t_1; + goto __pyx_L0; + + /* "src/gevent/greenlet.py":362 + * return self._start_event is _cancelled_start_event + * + * def __start_completed(self): # <<<<<<<<<<<<<< + * return self._start_event is _start_completed_event + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/greenlet.py":365 + * return self._start_event is _start_completed_event + * + * def __started_but_aborted(self): # <<<<<<<<<<<<<< + * return (not self.__never_started_or_killed() # we have been started or killed + * and not self.__start_cancelled_by_kill() # we weren't killed, so we must have been started + */ + +static int __pyx_f_6gevent_9_greenlet_8Greenlet___started_but_aborted(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + __Pyx_RefNannySetupContext("__started_but_aborted", 0); + + /* "src/gevent/greenlet.py":366 + * + * def __started_but_aborted(self): + * return (not self.__never_started_or_killed() # we have been started or killed # <<<<<<<<<<<<<< + * and not self.__start_cancelled_by_kill() # we weren't killed, so we must have been started + * and not self.__start_completed() # the start never completed + */ + __pyx_t_2 = ((!(((struct __pyx_vtabstruct_6gevent_9_greenlet_Greenlet *)__pyx_v_self->__pyx_vtab)->__pyx___never_started_or_killed(__pyx_v_self) != 0)) != 0); + if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L3_bool_binop_done; + } + + /* "src/gevent/greenlet.py":367 + * def __started_but_aborted(self): + * return (not self.__never_started_or_killed() # we have been started or killed + * and not self.__start_cancelled_by_kill() # we weren't killed, so we must have been started # <<<<<<<<<<<<<< + * and not self.__start_completed() # the start never completed + * and not self.__start_pending()) # and we're not pending, so we must have been aborted + */ + __pyx_t_2 = ((!(((struct __pyx_vtabstruct_6gevent_9_greenlet_Greenlet *)__pyx_v_self->__pyx_vtab)->__pyx___start_cancelled_by_kill(__pyx_v_self) != 0)) != 0); + if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L3_bool_binop_done; + } + + /* "src/gevent/greenlet.py":368 + * return (not self.__never_started_or_killed() # we have been started or killed + * and not self.__start_cancelled_by_kill() # we weren't killed, so we must have been started + * and not self.__start_completed() # the start never completed # <<<<<<<<<<<<<< + * and not self.__start_pending()) # and we're not pending, so we must have been aborted + * + */ + __pyx_t_2 = ((!(((struct __pyx_vtabstruct_6gevent_9_greenlet_Greenlet *)__pyx_v_self->__pyx_vtab)->__pyx___start_completed(__pyx_v_self) != 0)) != 0); + if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L3_bool_binop_done; + } + + /* "src/gevent/greenlet.py":369 + * and not self.__start_cancelled_by_kill() # we weren't killed, so we must have been started + * and not self.__start_completed() # the start never completed + * and not self.__start_pending()) # and we're not pending, so we must have been aborted # <<<<<<<<<<<<<< + * + * def __cancel_start(self): + */ + __pyx_t_2 = ((!(((struct __pyx_vtabstruct_6gevent_9_greenlet_Greenlet *)__pyx_v_self->__pyx_vtab)->__pyx___start_pending(__pyx_v_self) != 0)) != 0); + __pyx_t_1 = __pyx_t_2; + __pyx_L3_bool_binop_done:; + __pyx_r = __pyx_t_1; + goto __pyx_L0; + + /* "src/gevent/greenlet.py":365 + * return self._start_event is _start_completed_event + * + * def __started_but_aborted(self): # <<<<<<<<<<<<<< + * return (not self.__never_started_or_killed() # we have been started or killed + * and not self.__start_cancelled_by_kill() # we weren't killed, so we must have been started + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/greenlet.py":371 + * and not self.__start_pending()) # and we're not pending, so we must have been aborted + * + * def __cancel_start(self): # <<<<<<<<<<<<<< + * if self._start_event is None: + * # prevent self from ever being started in the future + */ + +static PyObject *__pyx_f_6gevent_9_greenlet_8Greenlet___cancel_start(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + __Pyx_RefNannySetupContext("__cancel_start", 0); + + /* "src/gevent/greenlet.py":372 + * + * def __cancel_start(self): + * if self._start_event is None: # <<<<<<<<<<<<<< + * # prevent self from ever being started in the future + * self._start_event = _cancelled_start_event + */ + __pyx_t_1 = (__pyx_v_self->_start_event == Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "src/gevent/greenlet.py":374 + * if self._start_event is None: + * # prevent self from ever being started in the future + * self._start_event = _cancelled_start_event # <<<<<<<<<<<<<< + * # cancel any pending start event + * # NOTE: If this was a real pending start event, this will leave a + */ + __Pyx_INCREF(((PyObject *)__pyx_v_6gevent_9_greenlet__cancelled_start_event)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_6gevent_9_greenlet__cancelled_start_event)); + __Pyx_GOTREF(__pyx_v_self->_start_event); + __Pyx_DECREF(__pyx_v_self->_start_event); + __pyx_v_self->_start_event = ((PyObject *)__pyx_v_6gevent_9_greenlet__cancelled_start_event); + + /* "src/gevent/greenlet.py":372 + * + * def __cancel_start(self): + * if self._start_event is None: # <<<<<<<<<<<<<< + * # prevent self from ever being started in the future + * self._start_event = _cancelled_start_event + */ + } + + /* "src/gevent/greenlet.py":381 + * # variable copy of that list (in _run_callbacks). This isn't a problem, + * # except for the leak-tests. + * self._start_event.stop() # <<<<<<<<<<<<<< + * self._start_event.close() + * + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_start_event, __pyx_n_s_stop); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 381, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + } + } + __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 381, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "src/gevent/greenlet.py":382 + * # except for the leak-tests. + * self._start_event.stop() + * self._start_event.close() # <<<<<<<<<<<<<< + * + * def __handle_death_before_start(self, args): + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_start_event, __pyx_n_s_close); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 382, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + } + } + __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 382, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "src/gevent/greenlet.py":371 + * and not self.__start_pending()) # and we're not pending, so we must have been aborted + * + * def __cancel_start(self): # <<<<<<<<<<<<<< + * if self._start_event is None: + * # prevent self from ever being started in the future + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("gevent._greenlet.Greenlet.__cancel_start", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/greenlet.py":384 + * self._start_event.close() + * + * def __handle_death_before_start(self, args): # <<<<<<<<<<<<<< + * # args is (t, v, tb) or simply t or v + * if self._exc_info is None and self.dead: + */ + +static PyObject *__pyx_f_6gevent_9_greenlet_8Greenlet___handle_death_before_start(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self, PyObject *__pyx_v_args) { + PyObject *__pyx_v_arg = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + Py_ssize_t __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + __Pyx_RefNannySetupContext("__handle_death_before_start", 0); + __Pyx_INCREF(__pyx_v_args); + + /* "src/gevent/greenlet.py":386 + * def __handle_death_before_start(self, args): + * # args is (t, v, tb) or simply t or v + * if self._exc_info is None and self.dead: # <<<<<<<<<<<<<< + * # the greenlet was never switched to before and it will never be, _report_error was not called + * # the result was not set and the links weren't notified. let's do it here. + */ + __pyx_t_2 = (__pyx_v_self->_exc_info == ((PyObject*)Py_None)); + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + } else { + __pyx_t_1 = __pyx_t_3; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_dead); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 386, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 386, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_1 = __pyx_t_3; + __pyx_L4_bool_binop_done:; + if (__pyx_t_1) { + + /* "src/gevent/greenlet.py":391 + * # checking that self.dead is true is essential, because throw() does not necessarily kill the greenlet + * # (if the exception raised by throw() is caught somewhere inside the greenlet). + * if len(args) == 1: # <<<<<<<<<<<<<< + * arg = args[0] + * #if isinstance(arg, type): + */ + if (unlikely(__pyx_v_args == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + __PYX_ERR(0, 391, __pyx_L1_error) + } + __pyx_t_5 = PyTuple_GET_SIZE(__pyx_v_args); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 391, __pyx_L1_error) + __pyx_t_1 = ((__pyx_t_5 == 1) != 0); + if (__pyx_t_1) { + + /* "src/gevent/greenlet.py":392 + * # (if the exception raised by throw() is caught somewhere inside the greenlet). + * if len(args) == 1: + * arg = args[0] # <<<<<<<<<<<<<< + * #if isinstance(arg, type): + * if type(arg) is type(Exception): + */ + if (unlikely(__pyx_v_args == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 392, __pyx_L1_error) + } + __pyx_t_4 = __Pyx_GetItemInt_Tuple(__pyx_v_args, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 392, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_v_arg = __pyx_t_4; + __pyx_t_4 = 0; + + /* "src/gevent/greenlet.py":394 + * arg = args[0] + * #if isinstance(arg, type): + * if type(arg) is type(Exception): # <<<<<<<<<<<<<< + * args = (arg, arg(), None) + * else: + */ + __pyx_t_1 = (((PyObject *)Py_TYPE(__pyx_v_arg)) == ((PyObject *)Py_TYPE(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))))); + __pyx_t_3 = (__pyx_t_1 != 0); + if (__pyx_t_3) { + + /* "src/gevent/greenlet.py":395 + * #if isinstance(arg, type): + * if type(arg) is type(Exception): + * args = (arg, arg(), None) # <<<<<<<<<<<<<< + * else: + * args = (type(arg), arg, None) + */ + __Pyx_INCREF(__pyx_v_arg); + __pyx_t_6 = __pyx_v_arg; __pyx_t_7 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) { + __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); + if (likely(__pyx_t_7)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); + __Pyx_INCREF(__pyx_t_7); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_6, function); + } + } + __pyx_t_4 = (__pyx_t_7) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7) : __Pyx_PyObject_CallNoArg(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 395, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 395, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(__pyx_v_arg); + __Pyx_GIVEREF(__pyx_v_arg); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_arg); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_4); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + PyTuple_SET_ITEM(__pyx_t_6, 2, Py_None); + __pyx_t_4 = 0; + __Pyx_DECREF_SET(__pyx_v_args, ((PyObject*)__pyx_t_6)); + __pyx_t_6 = 0; + + /* "src/gevent/greenlet.py":394 + * arg = args[0] + * #if isinstance(arg, type): + * if type(arg) is type(Exception): # <<<<<<<<<<<<<< + * args = (arg, arg(), None) + * else: + */ + goto __pyx_L7; + } + + /* "src/gevent/greenlet.py":397 + * args = (arg, arg(), None) + * else: + * args = (type(arg), arg, None) # <<<<<<<<<<<<<< + * elif not args: + * args = (GreenletExit, GreenletExit(), None) + */ + /*else*/ { + __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 397, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_arg))); + __Pyx_GIVEREF(((PyObject *)Py_TYPE(__pyx_v_arg))); + PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)Py_TYPE(__pyx_v_arg))); + __Pyx_INCREF(__pyx_v_arg); + __Pyx_GIVEREF(__pyx_v_arg); + PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_arg); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + PyTuple_SET_ITEM(__pyx_t_6, 2, Py_None); + __Pyx_DECREF_SET(__pyx_v_args, ((PyObject*)__pyx_t_6)); + __pyx_t_6 = 0; + } + __pyx_L7:; + + /* "src/gevent/greenlet.py":391 + * # checking that self.dead is true is essential, because throw() does not necessarily kill the greenlet + * # (if the exception raised by throw() is caught somewhere inside the greenlet). + * if len(args) == 1: # <<<<<<<<<<<<<< + * arg = args[0] + * #if isinstance(arg, type): + */ + goto __pyx_L6; + } + + /* "src/gevent/greenlet.py":398 + * else: + * args = (type(arg), arg, None) + * elif not args: # <<<<<<<<<<<<<< + * args = (GreenletExit, GreenletExit(), None) + * self._report_error(args) + */ + __pyx_t_3 = (__pyx_v_args != Py_None)&&(PyTuple_GET_SIZE(__pyx_v_args) != 0); + __pyx_t_1 = ((!__pyx_t_3) != 0); + if (__pyx_t_1) { + + /* "src/gevent/greenlet.py":399 + * args = (type(arg), arg, None) + * elif not args: + * args = (GreenletExit, GreenletExit(), None) # <<<<<<<<<<<<<< + * self._report_error(args) + * + */ + __Pyx_INCREF(__pyx_v_6gevent_9_greenlet_GreenletExit); + __pyx_t_4 = __pyx_v_6gevent_9_greenlet_GreenletExit; __pyx_t_7 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_7)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_7); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + } + } + __pyx_t_6 = (__pyx_t_7) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_7) : __Pyx_PyObject_CallNoArg(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 399, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 399, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_6gevent_9_greenlet_GreenletExit); + __Pyx_GIVEREF(__pyx_v_6gevent_9_greenlet_GreenletExit); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_6gevent_9_greenlet_GreenletExit); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_6); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + PyTuple_SET_ITEM(__pyx_t_4, 2, Py_None); + __pyx_t_6 = 0; + __Pyx_DECREF_SET(__pyx_v_args, ((PyObject*)__pyx_t_4)); + __pyx_t_4 = 0; + + /* "src/gevent/greenlet.py":398 + * else: + * args = (type(arg), arg, None) + * elif not args: # <<<<<<<<<<<<<< + * args = (GreenletExit, GreenletExit(), None) + * self._report_error(args) + */ + } + __pyx_L6:; + + /* "src/gevent/greenlet.py":400 + * elif not args: + * args = (GreenletExit, GreenletExit(), None) + * self._report_error(args) # <<<<<<<<<<<<<< + * + * @property + */ + __pyx_t_4 = ((struct __pyx_vtabstruct_6gevent_9_greenlet_Greenlet *)__pyx_v_self->__pyx_vtab)->_report_error(__pyx_v_self, __pyx_v_args); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 400, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "src/gevent/greenlet.py":386 + * def __handle_death_before_start(self, args): + * # args is (t, v, tb) or simply t or v + * if self._exc_info is None and self.dead: # <<<<<<<<<<<<<< + * # the greenlet was never switched to before and it will never be, _report_error was not called + * # the result was not set and the links weren't notified. let's do it here. + */ + } + + /* "src/gevent/greenlet.py":384 + * self._start_event.close() + * + * def __handle_death_before_start(self, args): # <<<<<<<<<<<<<< + * # args is (t, v, tb) or simply t or v + * if self._exc_info is None and self.dead: + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("gevent._greenlet.Greenlet.__handle_death_before_start", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_arg); + __Pyx_XDECREF(__pyx_v_args); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/greenlet.py":403 + * + * @property + * def started(self): # <<<<<<<<<<<<<< + * # DEPRECATED + * return bool(self) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_7started_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_7started_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_9_greenlet_8Greenlet_7started___get__(((struct __pyx_obj_6gevent_9_greenlet_Greenlet *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_7started___get__(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "src/gevent/greenlet.py":405 + * def started(self): + * # DEPRECATED + * return bool(self) # <<<<<<<<<<<<<< + * + * def ready(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_self)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 405, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBool_FromLong((!(!__pyx_t_1))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 405, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "src/gevent/greenlet.py":403 + * + * @property + * def started(self): # <<<<<<<<<<<<<< + * # DEPRECATED + * return bool(self) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent._greenlet.Greenlet.started.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/greenlet.py":407 + * return bool(self) + * + * def ready(self): # <<<<<<<<<<<<<< + * """ + * Return a true value if and only if the greenlet has finished + */ + +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_11ready(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static int __pyx_f_6gevent_9_greenlet_8Greenlet_ready(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self, int __pyx_skip_dispatch) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + int __pyx_t_6; + int __pyx_t_7; + __Pyx_RefNannySetupContext("ready", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0; + if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self)))))); + else { + PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + #endif + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_ready); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 407, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_9_greenlet_8Greenlet_11ready)) { + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 407, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 407, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_5; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0; + if (unlikely(type_dict_guard != tp_dict_version)) { + tp_dict_version = obj_dict_version = 0; + } + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + } + #endif + } + + /* "src/gevent/greenlet.py":416 + * necessarily the literal constants ``True`` or ``False``. + * """ + * return self.dead or self._exc_info is not None # <<<<<<<<<<<<<< + * + * def successful(self): + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_dead); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 416, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 416, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!__pyx_t_6) { + } else { + __pyx_t_5 = __pyx_t_6; + goto __pyx_L3_bool_binop_done; + } + __pyx_t_6 = (__pyx_v_self->_exc_info != ((PyObject*)Py_None)); + __pyx_t_7 = (__pyx_t_6 != 0); + __pyx_t_5 = __pyx_t_7; + __pyx_L3_bool_binop_done:; + __pyx_r = __pyx_t_5; + goto __pyx_L0; + + /* "src/gevent/greenlet.py":407 + * return bool(self) + * + * def ready(self): # <<<<<<<<<<<<<< + * """ + * Return a true value if and only if the greenlet has finished + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_WriteUnraisable("gevent._greenlet.Greenlet.ready", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_11ready(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6gevent_9_greenlet_8Greenlet_10ready[] = "Greenlet.ready(self) -> bool\n\n Return a true value if and only if the greenlet has finished\n execution.\n\n .. versionchanged:: 1.1\n This function is only guaranteed to return true or false *values*, not\n necessarily the literal constants ``True`` or ``False``.\n "; +static PyMethodDef __pyx_mdef_6gevent_9_greenlet_8Greenlet_11ready = {"ready", (PyCFunction)__pyx_pw_6gevent_9_greenlet_8Greenlet_11ready, METH_NOARGS, __pyx_doc_6gevent_9_greenlet_8Greenlet_10ready}; +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_11ready(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("ready (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_9_greenlet_8Greenlet_10ready(((struct __pyx_obj_6gevent_9_greenlet_Greenlet *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_10ready(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("ready", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_f_6gevent_9_greenlet_8Greenlet_ready(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 407, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent._greenlet.Greenlet.ready", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/greenlet.py":418 + * return self.dead or self._exc_info is not None + * + * def successful(self): # <<<<<<<<<<<<<< + * """ + * Return a true value if and only if the greenlet has finished execution + */ + +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_13successful(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static int __pyx_f_6gevent_9_greenlet_8Greenlet_successful(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self, int __pyx_skip_dispatch) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + int __pyx_t_6; + int __pyx_t_7; + __Pyx_RefNannySetupContext("successful", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0; + if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self)))))); + else { + PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + #endif + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_successful); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 418, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_9_greenlet_8Greenlet_13successful)) { + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 418, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 418, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_5; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0; + if (unlikely(type_dict_guard != tp_dict_version)) { + tp_dict_version = obj_dict_version = 0; + } + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + } + #endif + } + + /* "src/gevent/greenlet.py":430 + * not necessarily the literal constants ``True`` or ``False``. + * """ + * return self._exc_info is not None and self._exc_info[1] is None # <<<<<<<<<<<<<< + * + * def __repr__(self): + */ + __pyx_t_6 = (__pyx_v_self->_exc_info != ((PyObject*)Py_None)); + __pyx_t_7 = (__pyx_t_6 != 0); + if (__pyx_t_7) { + } else { + __pyx_t_5 = __pyx_t_7; + goto __pyx_L3_bool_binop_done; + } + if (unlikely(__pyx_v_self->_exc_info == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 430, __pyx_L1_error) + } + __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v_self->_exc_info, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 430, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = (__pyx_t_1 == Py_None); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_6 = (__pyx_t_7 != 0); + __pyx_t_5 = __pyx_t_6; + __pyx_L3_bool_binop_done:; + __pyx_r = __pyx_t_5; + goto __pyx_L0; + + /* "src/gevent/greenlet.py":418 + * return self.dead or self._exc_info is not None + * + * def successful(self): # <<<<<<<<<<<<<< + * """ + * Return a true value if and only if the greenlet has finished execution + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_WriteUnraisable("gevent._greenlet.Greenlet.successful", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_13successful(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6gevent_9_greenlet_8Greenlet_12successful[] = "Greenlet.successful(self) -> bool\n\n Return a true value if and only if the greenlet has finished execution\n successfully, that is, without raising an error.\n\n .. tip:: A greenlet that has been killed with the default\n :class:`GreenletExit` exception is considered successful.\n That is, ``GreenletExit`` is not considered an error.\n\n .. note:: This function is only guaranteed to return true or false *values*,\n not necessarily the literal constants ``True`` or ``False``.\n "; +static PyMethodDef __pyx_mdef_6gevent_9_greenlet_8Greenlet_13successful = {"successful", (PyCFunction)__pyx_pw_6gevent_9_greenlet_8Greenlet_13successful, METH_NOARGS, __pyx_doc_6gevent_9_greenlet_8Greenlet_12successful}; +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_13successful(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("successful (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_9_greenlet_8Greenlet_12successful(((struct __pyx_obj_6gevent_9_greenlet_Greenlet *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_12successful(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("successful", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_f_6gevent_9_greenlet_8Greenlet_successful(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 418, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent._greenlet.Greenlet.successful", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/greenlet.py":432 + * return self._exc_info is not None and self._exc_info[1] is None + * + * def __repr__(self): # <<<<<<<<<<<<<< + * classname = self.__class__.__name__ + * # If no name has been assigned, don't generate one, including a minimal_ident, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_15__repr__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_15__repr__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_9_greenlet_8Greenlet_14__repr__(((struct __pyx_obj_6gevent_9_greenlet_Greenlet *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_14__repr__(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self) { + PyObject *__pyx_v_classname = NULL; + PyObject *__pyx_v_name = NULL; + PyObject *__pyx_v_result = NULL; + PyObject *__pyx_v_formatted = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + __Pyx_RefNannySetupContext("__repr__", 0); + + /* "src/gevent/greenlet.py":433 + * + * def __repr__(self): + * classname = self.__class__.__name__ # <<<<<<<<<<<<<< + * # If no name has been assigned, don't generate one, including a minimal_ident, + * # if not necessary. This reduces the use of weak references and associated + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 433, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 433, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_classname = __pyx_t_2; + __pyx_t_2 = 0; + + /* "src/gevent/greenlet.py":437 + * # if not necessary. This reduces the use of weak references and associated + * # overhead. + * if 'name' not in self.__dict__ and self._ident is None: # <<<<<<<<<<<<<< + * name = ' ' + * else: + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_dict); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 437, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = (__Pyx_PySequence_ContainsTF(__pyx_n_s_name_2, __pyx_t_2, Py_NE)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 437, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_5 = (__pyx_t_4 != 0); + if (__pyx_t_5) { + } else { + __pyx_t_3 = __pyx_t_5; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_5 = (__pyx_v_self->_ident == Py_None); + __pyx_t_4 = (__pyx_t_5 != 0); + __pyx_t_3 = __pyx_t_4; + __pyx_L4_bool_binop_done:; + if (__pyx_t_3) { + + /* "src/gevent/greenlet.py":438 + * # overhead. + * if 'name' not in self.__dict__ and self._ident is None: + * name = ' ' # <<<<<<<<<<<<<< + * else: + * name = ' "%s" ' % (self.name,) + */ + __Pyx_INCREF(__pyx_kp_s__2); + __pyx_v_name = __pyx_kp_s__2; + + /* "src/gevent/greenlet.py":437 + * # if not necessary. This reduces the use of weak references and associated + * # overhead. + * if 'name' not in self.__dict__ and self._ident is None: # <<<<<<<<<<<<<< + * name = ' ' + * else: + */ + goto __pyx_L3; + } + + /* "src/gevent/greenlet.py":440 + * name = ' ' + * else: + * name = ' "%s" ' % (self.name,) # <<<<<<<<<<<<<< + * result = '<%s%sat %s' % (classname, name, hex(id(self))) + * formatted = self._formatinfo() + */ + /*else*/ { + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_name_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 440, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 440, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_s, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 440, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_name = __pyx_t_2; + __pyx_t_2 = 0; + } + __pyx_L3:; + + /* "src/gevent/greenlet.py":441 + * else: + * name = ' "%s" ' % (self.name,) + * result = '<%s%sat %s' % (classname, name, hex(id(self))) # <<<<<<<<<<<<<< + * formatted = self._formatinfo() + * if formatted: + */ + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 441, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_hex, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 441, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 441, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_classname); + __Pyx_GIVEREF(__pyx_v_classname); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_classname); + __Pyx_INCREF(__pyx_v_name); + __Pyx_GIVEREF(__pyx_v_name); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_name); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_s_sat_s, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 441, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_result = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "src/gevent/greenlet.py":442 + * name = ' "%s" ' % (self.name,) + * result = '<%s%sat %s' % (classname, name, hex(id(self))) + * formatted = self._formatinfo() # <<<<<<<<<<<<<< + * if formatted: + * result += ': ' + formatted + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_9_greenlet_Greenlet *)__pyx_v_self->__pyx_vtab)->_formatinfo(__pyx_v_self, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 442, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_formatted = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "src/gevent/greenlet.py":443 + * result = '<%s%sat %s' % (classname, name, hex(id(self))) + * formatted = self._formatinfo() + * if formatted: # <<<<<<<<<<<<<< + * result += ': ' + formatted + * return result + '>' + */ + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_formatted); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 443, __pyx_L1_error) + if (__pyx_t_3) { + + /* "src/gevent/greenlet.py":444 + * formatted = self._formatinfo() + * if formatted: + * result += ': ' + formatted # <<<<<<<<<<<<<< + * return result + '>' + * + */ + __pyx_t_1 = PyNumber_Add(__pyx_kp_s__3, __pyx_v_formatted); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 444, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 444, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "src/gevent/greenlet.py":443 + * result = '<%s%sat %s' % (classname, name, hex(id(self))) + * formatted = self._formatinfo() + * if formatted: # <<<<<<<<<<<<<< + * result += ': ' + formatted + * return result + '>' + */ + } + + /* "src/gevent/greenlet.py":445 + * if formatted: + * result += ': ' + formatted + * return result + '>' # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyNumber_Add(__pyx_v_result, __pyx_kp_s__4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 445, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "src/gevent/greenlet.py":432 + * return self._exc_info is not None and self._exc_info[1] is None + * + * def __repr__(self): # <<<<<<<<<<<<<< + * classname = self.__class__.__name__ + * # If no name has been assigned, don't generate one, including a minimal_ident, + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent._greenlet.Greenlet.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_classname); + __Pyx_XDECREF(__pyx_v_name); + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XDECREF(__pyx_v_formatted); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/greenlet.py":448 + * + * + * def _formatinfo(self): # <<<<<<<<<<<<<< + * info = self._formatted_info + * if info is not None: + */ + +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_17_formatinfo(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_f_6gevent_9_greenlet_8Greenlet__formatinfo(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self, int __pyx_skip_dispatch) { + PyObject *__pyx_v_info = NULL; + PyObject *__pyx_v_func = NULL; + PyObject *__pyx_v_im_self = NULL; + PyObject *__pyx_v_funcname = NULL; + PyObject *__pyx_v_result = NULL; + PyObject *__pyx_v_args = NULL; + PyObject *__pyx_7genexpr__pyx_v_x = NULL; + PyObject *__pyx_8genexpr1__pyx_v_key = NULL; + PyObject *__pyx_8genexpr1__pyx_v_value = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + int __pyx_t_6; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + int __pyx_t_9; + int __pyx_t_10; + int __pyx_t_11; + __Pyx_RefNannySetupContext("_formatinfo", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0; + if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self)))))); + else { + PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + #endif + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_formatinfo); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 448, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_9_greenlet_8Greenlet_17_formatinfo)) { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 448, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (!(likely(PyString_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(0, 448, __pyx_L1_error) + __pyx_r = ((PyObject*)__pyx_t_2); + __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0; + if (unlikely(type_dict_guard != tp_dict_version)) { + tp_dict_version = obj_dict_version = 0; + } + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + } + #endif + } + + /* "src/gevent/greenlet.py":449 + * + * def _formatinfo(self): + * info = self._formatted_info # <<<<<<<<<<<<<< + * if info is not None: + * return info + */ + __pyx_t_1 = __pyx_v_self->_formatted_info; + __Pyx_INCREF(__pyx_t_1); + __pyx_v_info = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "src/gevent/greenlet.py":450 + * def _formatinfo(self): + * info = self._formatted_info + * if info is not None: # <<<<<<<<<<<<<< + * return info + * + */ + __pyx_t_5 = (__pyx_v_info != ((PyObject*)Py_None)); + __pyx_t_6 = (__pyx_t_5 != 0); + if (__pyx_t_6) { + + /* "src/gevent/greenlet.py":451 + * info = self._formatted_info + * if info is not None: + * return info # <<<<<<<<<<<<<< + * + * # Are we running an arbitrary function provided to the constructor, + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_info); + __pyx_r = __pyx_v_info; + goto __pyx_L0; + + /* "src/gevent/greenlet.py":450 + * def _formatinfo(self): + * info = self._formatted_info + * if info is not None: # <<<<<<<<<<<<<< + * return info + * + */ + } + + /* "src/gevent/greenlet.py":455 + * # Are we running an arbitrary function provided to the constructor, + * # or did a subclass override _run? + * func = self._run # <<<<<<<<<<<<<< + * im_self = getattr(func, '__self__', None) + * if im_self is self: + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_run_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 455, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_func = __pyx_t_1; + __pyx_t_1 = 0; + + /* "src/gevent/greenlet.py":456 + * # or did a subclass override _run? + * func = self._run + * im_self = getattr(func, '__self__', None) # <<<<<<<<<<<<<< + * if im_self is self: + * funcname = '_run' + */ + __pyx_t_1 = __Pyx_GetAttr3(__pyx_v_func, __pyx_n_s_self, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 456, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_im_self = __pyx_t_1; + __pyx_t_1 = 0; + + /* "src/gevent/greenlet.py":457 + * func = self._run + * im_self = getattr(func, '__self__', None) + * if im_self is self: # <<<<<<<<<<<<<< + * funcname = '_run' + * elif im_self is not None: + */ + __pyx_t_6 = (__pyx_v_im_self == ((PyObject *)__pyx_v_self)); + __pyx_t_5 = (__pyx_t_6 != 0); + if (__pyx_t_5) { + + /* "src/gevent/greenlet.py":458 + * im_self = getattr(func, '__self__', None) + * if im_self is self: + * funcname = '_run' # <<<<<<<<<<<<<< + * elif im_self is not None: + * funcname = repr(func) + */ + __Pyx_INCREF(__pyx_n_s_run_2); + __pyx_v_funcname = __pyx_n_s_run_2; + + /* "src/gevent/greenlet.py":457 + * func = self._run + * im_self = getattr(func, '__self__', None) + * if im_self is self: # <<<<<<<<<<<<<< + * funcname = '_run' + * elif im_self is not None: + */ + goto __pyx_L4; + } + + /* "src/gevent/greenlet.py":459 + * if im_self is self: + * funcname = '_run' + * elif im_self is not None: # <<<<<<<<<<<<<< + * funcname = repr(func) + * else: + */ + __pyx_t_5 = (__pyx_v_im_self != Py_None); + __pyx_t_6 = (__pyx_t_5 != 0); + if (__pyx_t_6) { + + /* "src/gevent/greenlet.py":460 + * funcname = '_run' + * elif im_self is not None: + * funcname = repr(func) # <<<<<<<<<<<<<< + * else: + * funcname = getattr(func, '__name__', '') or repr(func) + */ + __pyx_t_1 = PyObject_Repr(__pyx_v_func); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 460, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_funcname = __pyx_t_1; + __pyx_t_1 = 0; + + /* "src/gevent/greenlet.py":459 + * if im_self is self: + * funcname = '_run' + * elif im_self is not None: # <<<<<<<<<<<<<< + * funcname = repr(func) + * else: + */ + goto __pyx_L4; + } + + /* "src/gevent/greenlet.py":462 + * funcname = repr(func) + * else: + * funcname = getattr(func, '__name__', '') or repr(func) # <<<<<<<<<<<<<< + * + * result = funcname + */ + /*else*/ { + __pyx_t_2 = __Pyx_GetAttr3(__pyx_v_func, __pyx_n_s_name, __pyx_kp_s__5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 462, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 462, __pyx_L1_error) + if (!__pyx_t_6) { + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } else { + __Pyx_INCREF(__pyx_t_2); + __pyx_t_1 = __pyx_t_2; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + goto __pyx_L5_bool_binop_done; + } + __pyx_t_2 = PyObject_Repr(__pyx_v_func); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 462, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_2); + __pyx_t_1 = __pyx_t_2; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_L5_bool_binop_done:; + __pyx_v_funcname = __pyx_t_1; + __pyx_t_1 = 0; + } + __pyx_L4:; + + /* "src/gevent/greenlet.py":464 + * funcname = getattr(func, '__name__', '') or repr(func) + * + * result = funcname # <<<<<<<<<<<<<< + * args = [] + * if self.args: + */ + __Pyx_INCREF(__pyx_v_funcname); + __pyx_v_result = __pyx_v_funcname; + + /* "src/gevent/greenlet.py":465 + * + * result = funcname + * args = [] # <<<<<<<<<<<<<< + * if self.args: + * args = [repr(x)[:50] for x in self.args] + */ + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 465, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_args = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "src/gevent/greenlet.py":466 + * result = funcname + * args = [] + * if self.args: # <<<<<<<<<<<<<< + * args = [repr(x)[:50] for x in self.args] + * if self.kwargs: + */ + __pyx_t_6 = (__pyx_v_self->args != Py_None)&&(PyTuple_GET_SIZE(__pyx_v_self->args) != 0); + if (__pyx_t_6) { + + /* "src/gevent/greenlet.py":467 + * args = [] + * if self.args: + * args = [repr(x)[:50] for x in self.args] # <<<<<<<<<<<<<< + * if self.kwargs: + * args.extend(['%s=%s' % (key, repr(value)[:50]) for (key, value) in self.kwargs.items()]) + */ + { /* enter inner scope */ + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 467, __pyx_L10_error) + __Pyx_GOTREF(__pyx_t_1); + if (unlikely(__pyx_v_self->args == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); + __PYX_ERR(0, 467, __pyx_L10_error) + } + __pyx_t_2 = __pyx_v_self->args; __Pyx_INCREF(__pyx_t_2); __pyx_t_7 = 0; + for (;;) { + if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_3); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 467, __pyx_L10_error) + #else + __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 467, __pyx_L10_error) + __Pyx_GOTREF(__pyx_t_3); + #endif + __Pyx_XDECREF_SET(__pyx_7genexpr__pyx_v_x, __pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = PyObject_Repr(__pyx_7genexpr__pyx_v_x); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 467, __pyx_L10_error) + __Pyx_GOTREF(__pyx_t_3); + if (unlikely(__pyx_t_3 == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 467, __pyx_L10_error) + } + __pyx_t_4 = PySequence_GetSlice(__pyx_t_3, 0, 50); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 467, __pyx_L10_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_4))) __PYX_ERR(0, 467, __pyx_L10_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_7genexpr__pyx_v_x); __pyx_7genexpr__pyx_v_x = 0; + goto __pyx_L13_exit_scope; + __pyx_L10_error:; + __Pyx_XDECREF(__pyx_7genexpr__pyx_v_x); __pyx_7genexpr__pyx_v_x = 0; + goto __pyx_L1_error; + __pyx_L13_exit_scope:; + } /* exit inner scope */ + __Pyx_DECREF_SET(__pyx_v_args, ((PyObject*)__pyx_t_1)); + __pyx_t_1 = 0; + + /* "src/gevent/greenlet.py":466 + * result = funcname + * args = [] + * if self.args: # <<<<<<<<<<<<<< + * args = [repr(x)[:50] for x in self.args] + * if self.kwargs: + */ + } + + /* "src/gevent/greenlet.py":468 + * if self.args: + * args = [repr(x)[:50] for x in self.args] + * if self.kwargs: # <<<<<<<<<<<<<< + * args.extend(['%s=%s' % (key, repr(value)[:50]) for (key, value) in self.kwargs.items()]) + * if args: + */ + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_self->kwargs); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 468, __pyx_L1_error) + if (__pyx_t_6) { + + /* "src/gevent/greenlet.py":469 + * args = [repr(x)[:50] for x in self.args] + * if self.kwargs: + * args.extend(['%s=%s' % (key, repr(value)[:50]) for (key, value) in self.kwargs.items()]) # <<<<<<<<<<<<<< + * if args: + * result += '(' + ', '.join(args) + ')' + */ + { /* enter inner scope */ + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 469, __pyx_L17_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = 0; + if (unlikely(__pyx_v_self->kwargs == Py_None)) { + PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items"); + __PYX_ERR(0, 469, __pyx_L17_error) + } + __pyx_t_4 = __Pyx_dict_iterator(__pyx_v_self->kwargs, 1, __pyx_n_s_items, (&__pyx_t_8), (&__pyx_t_9)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 469, __pyx_L17_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_2); + __pyx_t_2 = __pyx_t_4; + __pyx_t_4 = 0; + while (1) { + __pyx_t_10 = __Pyx_dict_iter_next(__pyx_t_2, __pyx_t_8, &__pyx_t_7, &__pyx_t_4, &__pyx_t_3, NULL, __pyx_t_9); + if (unlikely(__pyx_t_10 == 0)) break; + if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 469, __pyx_L17_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_3); + __Pyx_XDECREF_SET(__pyx_8genexpr1__pyx_v_key, __pyx_t_4); + __pyx_t_4 = 0; + __Pyx_XDECREF_SET(__pyx_8genexpr1__pyx_v_value, __pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = PyObject_Repr(__pyx_8genexpr1__pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 469, __pyx_L17_error) + __Pyx_GOTREF(__pyx_t_3); + if (unlikely(__pyx_t_3 == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 469, __pyx_L17_error) + } + __pyx_t_4 = PySequence_GetSlice(__pyx_t_3, 0, 50); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 469, __pyx_L17_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 469, __pyx_L17_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_8genexpr1__pyx_v_key); + __Pyx_GIVEREF(__pyx_8genexpr1__pyx_v_key); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_8genexpr1__pyx_v_key); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_s_s, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 469, __pyx_L17_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_4))) __PYX_ERR(0, 469, __pyx_L17_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_key); __pyx_8genexpr1__pyx_v_key = 0; + __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_value); __pyx_8genexpr1__pyx_v_value = 0; + goto __pyx_L20_exit_scope; + __pyx_L17_error:; + __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_key); __pyx_8genexpr1__pyx_v_key = 0; + __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_value); __pyx_8genexpr1__pyx_v_value = 0; + goto __pyx_L1_error; + __pyx_L20_exit_scope:; + } /* exit inner scope */ + __pyx_t_11 = __Pyx_PyList_Extend(__pyx_v_args, __pyx_t_1); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 469, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/greenlet.py":468 + * if self.args: + * args = [repr(x)[:50] for x in self.args] + * if self.kwargs: # <<<<<<<<<<<<<< + * args.extend(['%s=%s' % (key, repr(value)[:50]) for (key, value) in self.kwargs.items()]) + * if args: + */ + } + + /* "src/gevent/greenlet.py":470 + * if self.kwargs: + * args.extend(['%s=%s' % (key, repr(value)[:50]) for (key, value) in self.kwargs.items()]) + * if args: # <<<<<<<<<<<<<< + * result += '(' + ', '.join(args) + ')' + * # it is important to save the result here, because once the greenlet exits '_run' attribute will be removed + */ + __pyx_t_6 = (PyList_GET_SIZE(__pyx_v_args) != 0); + if (__pyx_t_6) { + + /* "src/gevent/greenlet.py":471 + * args.extend(['%s=%s' % (key, repr(value)[:50]) for (key, value) in self.kwargs.items()]) + * if args: + * result += '(' + ', '.join(args) + ')' # <<<<<<<<<<<<<< + * # it is important to save the result here, because once the greenlet exits '_run' attribute will be removed + * self._formatted_info = result + */ + __pyx_t_1 = __Pyx_PyString_Join(__pyx_kp_s__7, __pyx_v_args); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 471, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyNumber_Add(__pyx_kp_s__6, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 471, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyNumber_Add(__pyx_t_2, __pyx_kp_s__8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 471, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 471, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_2); + __pyx_t_2 = 0; + + /* "src/gevent/greenlet.py":470 + * if self.kwargs: + * args.extend(['%s=%s' % (key, repr(value)[:50]) for (key, value) in self.kwargs.items()]) + * if args: # <<<<<<<<<<<<<< + * result += '(' + ', '.join(args) + ')' + * # it is important to save the result here, because once the greenlet exits '_run' attribute will be removed + */ + } + + /* "src/gevent/greenlet.py":473 + * result += '(' + ', '.join(args) + ')' + * # it is important to save the result here, because once the greenlet exits '_run' attribute will be removed + * self._formatted_info = result # <<<<<<<<<<<<<< + * return result + * + */ + if (!(likely(PyString_CheckExact(__pyx_v_result))||((__pyx_v_result) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_v_result)->tp_name), 0))) __PYX_ERR(0, 473, __pyx_L1_error) + __pyx_t_2 = __pyx_v_result; + __Pyx_INCREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_v_self->_formatted_info); + __Pyx_DECREF(__pyx_v_self->_formatted_info); + __pyx_v_self->_formatted_info = ((PyObject*)__pyx_t_2); + __pyx_t_2 = 0; + + /* "src/gevent/greenlet.py":474 + * # it is important to save the result here, because once the greenlet exits '_run' attribute will be removed + * self._formatted_info = result + * return result # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_XDECREF(__pyx_r); + if (!(likely(PyString_CheckExact(__pyx_v_result))||((__pyx_v_result) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_v_result)->tp_name), 0))) __PYX_ERR(0, 474, __pyx_L1_error) + __Pyx_INCREF(__pyx_v_result); + __pyx_r = ((PyObject*)__pyx_v_result); + goto __pyx_L0; + + /* "src/gevent/greenlet.py":448 + * + * + * def _formatinfo(self): # <<<<<<<<<<<<<< + * info = self._formatted_info + * if info is not None: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("gevent._greenlet.Greenlet._formatinfo", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_info); + __Pyx_XDECREF(__pyx_v_func); + __Pyx_XDECREF(__pyx_v_im_self); + __Pyx_XDECREF(__pyx_v_funcname); + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XDECREF(__pyx_v_args); + __Pyx_XDECREF(__pyx_7genexpr__pyx_v_x); + __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_key); + __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_value); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_17_formatinfo(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6gevent_9_greenlet_8Greenlet_16_formatinfo[] = "Greenlet._formatinfo(self) -> str"; +static PyMethodDef __pyx_mdef_6gevent_9_greenlet_8Greenlet_17_formatinfo = {"_formatinfo", (PyCFunction)__pyx_pw_6gevent_9_greenlet_8Greenlet_17_formatinfo, METH_NOARGS, __pyx_doc_6gevent_9_greenlet_8Greenlet_16_formatinfo}; +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_17_formatinfo(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_formatinfo (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_9_greenlet_8Greenlet_16_formatinfo(((struct __pyx_obj_6gevent_9_greenlet_Greenlet *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_16_formatinfo(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("_formatinfo", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6gevent_9_greenlet_8Greenlet__formatinfo(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 448, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent._greenlet.Greenlet._formatinfo", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/greenlet.py":477 + * + * @property + * def exception(self): # <<<<<<<<<<<<<< + * """ + * Holds the exception instance raised by the function if the + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_9exception_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_9exception_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_9_greenlet_8Greenlet_9exception___get__(((struct __pyx_obj_6gevent_9_greenlet_Greenlet *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_9exception___get__(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "src/gevent/greenlet.py":482 + * greenlet has finished with an error. Otherwise ``None``. + * """ + * return self._exc_info[1] if self._exc_info is not None else None # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = (__pyx_v_self->_exc_info != ((PyObject*)Py_None)); + if ((__pyx_t_2 != 0)) { + if (unlikely(__pyx_v_self->_exc_info == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 482, __pyx_L1_error) + } + __pyx_t_3 = __Pyx_GetItemInt_Tuple(__pyx_v_self->_exc_info, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 482, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __pyx_t_3; + __pyx_t_3 = 0; + } else { + __Pyx_INCREF(Py_None); + __pyx_t_1 = Py_None; + } + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "src/gevent/greenlet.py":477 + * + * @property + * def exception(self): # <<<<<<<<<<<<<< + * """ + * Holds the exception instance raised by the function if the + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("gevent._greenlet.Greenlet.exception.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/greenlet.py":485 + * + * @property + * def exc_info(self): # <<<<<<<<<<<<<< + * """ + * Holds the exc_info three-tuple raised by the function if the + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_8exc_info_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_8exc_info_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_9_greenlet_8Greenlet_8exc_info___get__(((struct __pyx_obj_6gevent_9_greenlet_Greenlet *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_8exc_info___get__(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self) { + PyObject *__pyx_v_ei = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "src/gevent/greenlet.py":494 + * .. versionadded:: 1.1 + * """ + * ei = self._exc_info # <<<<<<<<<<<<<< + * if ei is not None and ei[0] is not None: + * return (ei[0], ei[1], load_traceback(ei[2])) + */ + __pyx_t_1 = __pyx_v_self->_exc_info; + __Pyx_INCREF(__pyx_t_1); + __pyx_v_ei = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "src/gevent/greenlet.py":495 + * """ + * ei = self._exc_info + * if ei is not None and ei[0] is not None: # <<<<<<<<<<<<<< + * return (ei[0], ei[1], load_traceback(ei[2])) + * + */ + __pyx_t_3 = (__pyx_v_ei != ((PyObject*)Py_None)); + __pyx_t_4 = (__pyx_t_3 != 0); + if (__pyx_t_4) { + } else { + __pyx_t_2 = __pyx_t_4; + goto __pyx_L4_bool_binop_done; + } + if (unlikely(__pyx_v_ei == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 495, __pyx_L1_error) + } + __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v_ei, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 495, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = (__pyx_t_1 != Py_None); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = (__pyx_t_4 != 0); + __pyx_t_2 = __pyx_t_3; + __pyx_L4_bool_binop_done:; + if (__pyx_t_2) { + + /* "src/gevent/greenlet.py":496 + * ei = self._exc_info + * if ei is not None and ei[0] is not None: + * return (ei[0], ei[1], load_traceback(ei[2])) # <<<<<<<<<<<<<< + * + * def throw(self, *args): + */ + __Pyx_XDECREF(__pyx_r); + if (unlikely(__pyx_v_ei == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 496, __pyx_L1_error) + } + __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v_ei, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 496, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (unlikely(__pyx_v_ei == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 496, __pyx_L1_error) + } + __pyx_t_5 = __Pyx_GetItemInt_Tuple(__pyx_v_ei, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 496, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (unlikely(__pyx_v_ei == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 496, __pyx_L1_error) + } + __pyx_t_7 = __Pyx_GetItemInt_Tuple(__pyx_v_ei, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 496, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_INCREF(__pyx_v_6gevent_9_greenlet_load_traceback); + __pyx_t_8 = __pyx_v_6gevent_9_greenlet_load_traceback; __pyx_t_9 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) { + __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8); + if (likely(__pyx_t_9)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); + __Pyx_INCREF(__pyx_t_9); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_8, function); + } + } + __pyx_t_6 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_9, __pyx_t_7) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_7); + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 496, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 496, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_6); + __pyx_t_1 = 0; + __pyx_t_5 = 0; + __pyx_t_6 = 0; + __pyx_r = __pyx_t_8; + __pyx_t_8 = 0; + goto __pyx_L0; + + /* "src/gevent/greenlet.py":495 + * """ + * ei = self._exc_info + * if ei is not None and ei[0] is not None: # <<<<<<<<<<<<<< + * return (ei[0], ei[1], load_traceback(ei[2])) + * + */ + } + + /* "src/gevent/greenlet.py":485 + * + * @property + * def exc_info(self): # <<<<<<<<<<<<<< + * """ + * Holds the exc_info three-tuple raised by the function if the + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_AddTraceback("gevent._greenlet.Greenlet.exc_info.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_ei); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/greenlet.py":498 + * return (ei[0], ei[1], load_traceback(ei[2])) + * + * def throw(self, *args): # <<<<<<<<<<<<<< + * """Immediately switch into the greenlet and raise an exception in it. + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_19throw(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6gevent_9_greenlet_8Greenlet_18throw[] = "Greenlet.throw(self, *args)\nImmediately switch into the greenlet and raise an exception in it.\n\n Should only be called from the HUB, otherwise the current greenlet is left unscheduled forever.\n To raise an exception in a safe manner from any greenlet, use :meth:`kill`.\n\n If a greenlet was started but never switched to yet, then also\n a) cancel the event that will start it\n b) fire the notifications as if an exception was raised in a greenlet\n "; +static PyMethodDef __pyx_mdef_6gevent_9_greenlet_8Greenlet_19throw = {"throw", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_9_greenlet_8Greenlet_19throw, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_9_greenlet_8Greenlet_18throw}; +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_19throw(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_args = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("throw (wrapper)", 0); + if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "throw", 0))) return NULL; + __Pyx_INCREF(__pyx_args); + __pyx_v_args = __pyx_args; + __pyx_r = __pyx_pf_6gevent_9_greenlet_8Greenlet_18throw(((struct __pyx_obj_6gevent_9_greenlet_Greenlet *)__pyx_v_self), __pyx_v_args); + + /* function exit code */ + __Pyx_XDECREF(__pyx_v_args); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_18throw(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self, PyObject *__pyx_v_args) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + int __pyx_t_7; + char const *__pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + PyObject *__pyx_t_14 = NULL; + __Pyx_RefNannySetupContext("throw", 0); + + /* "src/gevent/greenlet.py":508 + * b) fire the notifications as if an exception was raised in a greenlet + * """ + * self.__cancel_start() # <<<<<<<<<<<<<< + * + * try: + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_9_greenlet_Greenlet *)__pyx_v_self->__pyx_vtab)->__pyx___cancel_start(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 508, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/greenlet.py":510 + * self.__cancel_start() + * + * try: # <<<<<<<<<<<<<< + * if not self.dead: + * # Prevent switching into a greenlet *at all* if we had never + */ + /*try:*/ { + + /* "src/gevent/greenlet.py":511 + * + * try: + * if not self.dead: # <<<<<<<<<<<<<< + * # Prevent switching into a greenlet *at all* if we had never + * # started it. Usually this is the same thing that happens by throwing, + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_dead); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 511, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 511, __pyx_L4_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = ((!__pyx_t_2) != 0); + if (__pyx_t_3) { + + /* "src/gevent/greenlet.py":516 + * # but if this is done from the hub with nothing else running, prevents a + * # LoopExit. + * greenlet.throw(self, *args) # <<<<<<<<<<<<<< + * finally: + * self.__handle_death_before_start(args) + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_6gevent_9_greenlet_greenlet), __pyx_n_s_throw); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 516, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 516, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_self)); + __pyx_t_5 = PyNumber_Add(__pyx_t_4, __pyx_v_args); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 516, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 516, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "src/gevent/greenlet.py":511 + * + * try: + * if not self.dead: # <<<<<<<<<<<<<< + * # Prevent switching into a greenlet *at all* if we had never + * # started it. Usually this is the same thing that happens by throwing, + */ + } + } + + /* "src/gevent/greenlet.py":518 + * greenlet.throw(self, *args) + * finally: + * self.__handle_death_before_start(args) # <<<<<<<<<<<<<< + * + * def start(self): + */ + /*finally:*/ { + /*normal exit:*/{ + __pyx_t_4 = ((struct __pyx_vtabstruct_6gevent_9_greenlet_Greenlet *)__pyx_v_self->__pyx_vtab)->__pyx___handle_death_before_start(__pyx_v_self, __pyx_v_args); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 518, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L5; + } + __pyx_L4_error:; + /*exception exit:*/{ + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14); + if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11) < 0)) __Pyx_ErrFetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); + __Pyx_XGOTREF(__pyx_t_9); + __Pyx_XGOTREF(__pyx_t_10); + __Pyx_XGOTREF(__pyx_t_11); + __Pyx_XGOTREF(__pyx_t_12); + __Pyx_XGOTREF(__pyx_t_13); + __Pyx_XGOTREF(__pyx_t_14); + __pyx_t_6 = __pyx_lineno; __pyx_t_7 = __pyx_clineno; __pyx_t_8 = __pyx_filename; + { + __pyx_t_4 = ((struct __pyx_vtabstruct_6gevent_9_greenlet_Greenlet *)__pyx_v_self->__pyx_vtab)->__pyx___handle_death_before_start(__pyx_v_self, __pyx_v_args); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 518, __pyx_L8_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + if (PY_MAJOR_VERSION >= 3) { + __Pyx_XGIVEREF(__pyx_t_12); + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14); + } + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_ErrRestore(__pyx_t_9, __pyx_t_10, __pyx_t_11); + __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; + __pyx_lineno = __pyx_t_6; __pyx_clineno = __pyx_t_7; __pyx_filename = __pyx_t_8; + goto __pyx_L1_error; + __pyx_L8_error:; + if (PY_MAJOR_VERSION >= 3) { + __Pyx_XGIVEREF(__pyx_t_12); + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14); + } + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; + goto __pyx_L1_error; + } + __pyx_L5:; + } + + /* "src/gevent/greenlet.py":498 + * return (ei[0], ei[1], load_traceback(ei[2])) + * + * def throw(self, *args): # <<<<<<<<<<<<<< + * """Immediately switch into the greenlet and raise an exception in it. + * + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("gevent._greenlet.Greenlet.throw", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/greenlet.py":520 + * self.__handle_death_before_start(args) + * + * def start(self): # <<<<<<<<<<<<<< + * """Schedule the greenlet to run in this loop iteration""" + * if self._start_event is None: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_21start(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6gevent_9_greenlet_8Greenlet_20start[] = "Greenlet.start(self)\nSchedule the greenlet to run in this loop iteration"; +static PyMethodDef __pyx_mdef_6gevent_9_greenlet_8Greenlet_21start = {"start", (PyCFunction)__pyx_pw_6gevent_9_greenlet_8Greenlet_21start, METH_NOARGS, __pyx_doc_6gevent_9_greenlet_8Greenlet_20start}; +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_21start(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("start (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_9_greenlet_8Greenlet_20start(((struct __pyx_obj_6gevent_9_greenlet_Greenlet *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_20start(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + __Pyx_RefNannySetupContext("start", 0); + + /* "src/gevent/greenlet.py":522 + * def start(self): + * """Schedule the greenlet to run in this loop iteration""" + * if self._start_event is None: # <<<<<<<<<<<<<< + * _call_spawn_callbacks(self) + * self._start_event = self.parent.loop.run_callback(self.switch) + */ + __pyx_t_1 = (__pyx_v_self->_start_event == Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "src/gevent/greenlet.py":523 + * """Schedule the greenlet to run in this loop iteration""" + * if self._start_event is None: + * _call_spawn_callbacks(self) # <<<<<<<<<<<<<< + * self._start_event = self.parent.loop.run_callback(self.switch) + * + */ + __pyx_f_6gevent_9_greenlet__call_spawn_callbacks(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 523, __pyx_L1_error) + + /* "src/gevent/greenlet.py":524 + * if self._start_event is None: + * _call_spawn_callbacks(self) + * self._start_event = self.parent.loop.run_callback(self.switch) # <<<<<<<<<<<<<< + * + * def start_later(self, seconds): + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_parent); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 524, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_loop); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 524, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_run_callback); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 524, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_switch); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 524, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_6)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + } + } + __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_6, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 524, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GIVEREF(__pyx_t_3); + __Pyx_GOTREF(__pyx_v_self->_start_event); + __Pyx_DECREF(__pyx_v_self->_start_event); + __pyx_v_self->_start_event = __pyx_t_3; + __pyx_t_3 = 0; + + /* "src/gevent/greenlet.py":522 + * def start(self): + * """Schedule the greenlet to run in this loop iteration""" + * if self._start_event is None: # <<<<<<<<<<<<<< + * _call_spawn_callbacks(self) + * self._start_event = self.parent.loop.run_callback(self.switch) + */ + } + + /* "src/gevent/greenlet.py":520 + * self.__handle_death_before_start(args) + * + * def start(self): # <<<<<<<<<<<<<< + * """Schedule the greenlet to run in this loop iteration""" + * if self._start_event is None: + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("gevent._greenlet.Greenlet.start", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/greenlet.py":526 + * self._start_event = self.parent.loop.run_callback(self.switch) + * + * def start_later(self, seconds): # <<<<<<<<<<<<<< + * """ + * start_later(seconds) -> None + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_23start_later(PyObject *__pyx_v_self, PyObject *__pyx_v_seconds); /*proto*/ +static char __pyx_doc_6gevent_9_greenlet_8Greenlet_22start_later[] = "Greenlet.start_later(self, seconds)\n\n start_later(seconds) -> None\n\n Schedule the greenlet to run in the future loop iteration\n *seconds* later\n "; +static PyMethodDef __pyx_mdef_6gevent_9_greenlet_8Greenlet_23start_later = {"start_later", (PyCFunction)__pyx_pw_6gevent_9_greenlet_8Greenlet_23start_later, METH_O, __pyx_doc_6gevent_9_greenlet_8Greenlet_22start_later}; +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_23start_later(PyObject *__pyx_v_self, PyObject *__pyx_v_seconds) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("start_later (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_9_greenlet_8Greenlet_22start_later(((struct __pyx_obj_6gevent_9_greenlet_Greenlet *)__pyx_v_self), ((PyObject *)__pyx_v_seconds)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_22start_later(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self, PyObject *__pyx_v_seconds) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + __Pyx_RefNannySetupContext("start_later", 0); + + /* "src/gevent/greenlet.py":533 + * *seconds* later + * """ + * if self._start_event is None: # <<<<<<<<<<<<<< + * _call_spawn_callbacks(self) + * self._start_event = self.parent.loop.timer(seconds) + */ + __pyx_t_1 = (__pyx_v_self->_start_event == Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "src/gevent/greenlet.py":534 + * """ + * if self._start_event is None: + * _call_spawn_callbacks(self) # <<<<<<<<<<<<<< + * self._start_event = self.parent.loop.timer(seconds) + * self._start_event.start(self.switch) + */ + __pyx_f_6gevent_9_greenlet__call_spawn_callbacks(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 534, __pyx_L1_error) + + /* "src/gevent/greenlet.py":535 + * if self._start_event is None: + * _call_spawn_callbacks(self) + * self._start_event = self.parent.loop.timer(seconds) # <<<<<<<<<<<<<< + * self._start_event.start(self.switch) + * + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_parent); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 535, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_loop); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 535, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_timer); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 535, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + } + } + __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_v_seconds) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_seconds); + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 535, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GIVEREF(__pyx_t_3); + __Pyx_GOTREF(__pyx_v_self->_start_event); + __Pyx_DECREF(__pyx_v_self->_start_event); + __pyx_v_self->_start_event = __pyx_t_3; + __pyx_t_3 = 0; + + /* "src/gevent/greenlet.py":536 + * _call_spawn_callbacks(self) + * self._start_event = self.parent.loop.timer(seconds) + * self._start_event.start(self.switch) # <<<<<<<<<<<<<< + * + * @staticmethod + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_start_event, __pyx_n_s_start); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 536, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_switch); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 536, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_6)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + } + } + __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_6, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 536, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "src/gevent/greenlet.py":533 + * *seconds* later + * """ + * if self._start_event is None: # <<<<<<<<<<<<<< + * _call_spawn_callbacks(self) + * self._start_event = self.parent.loop.timer(seconds) + */ + } + + /* "src/gevent/greenlet.py":526 + * self._start_event = self.parent.loop.run_callback(self.switch) + * + * def start_later(self, seconds): # <<<<<<<<<<<<<< + * """ + * start_later(seconds) -> None + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("gevent._greenlet.Greenlet.start_later", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/greenlet.py":539 + * + * @staticmethod + * def add_spawn_callback(callback): # <<<<<<<<<<<<<< + * """ + * add_spawn_callback(callback) -> None + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_25add_spawn_callback(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6gevent_9_greenlet_8Greenlet_24add_spawn_callback[] = "Greenlet.add_spawn_callback(callback)\n\n add_spawn_callback(callback) -> None\n\n Set up a *callback* to be invoked when :class:`Greenlet` objects\n are started.\n\n The invocation order of spawn callbacks is unspecified. Adding the\n same callback more than one time will not cause it to be called more\n than once.\n\n .. versionadded:: 1.4.0\n "; +static PyMethodDef __pyx_mdef_6gevent_9_greenlet_8Greenlet_25add_spawn_callback = {"add_spawn_callback", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_9_greenlet_8Greenlet_25add_spawn_callback, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_9_greenlet_8Greenlet_24add_spawn_callback}; +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_25add_spawn_callback(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_callback = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("add_spawn_callback (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_callback,0}; + PyObject* values[1] = {0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_callback)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "add_spawn_callback") < 0)) __PYX_ERR(0, 539, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + } + __pyx_v_callback = values[0]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("add_spawn_callback", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 539, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent._greenlet.Greenlet.add_spawn_callback", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_9_greenlet_8Greenlet_24add_spawn_callback(__pyx_v_callback); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_24add_spawn_callback(PyObject *__pyx_v_callback) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + __Pyx_RefNannySetupContext("add_spawn_callback", 0); + + /* "src/gevent/greenlet.py":553 + * """ + * global _spawn_callbacks + * if _spawn_callbacks is None: # pylint:disable=used-before-assignment # <<<<<<<<<<<<<< + * _spawn_callbacks = set() + * _spawn_callbacks.add(callback) + */ + __pyx_t_1 = (__pyx_v_6gevent_9_greenlet__spawn_callbacks == ((PyObject*)Py_None)); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "src/gevent/greenlet.py":554 + * global _spawn_callbacks + * if _spawn_callbacks is None: # pylint:disable=used-before-assignment + * _spawn_callbacks = set() # <<<<<<<<<<<<<< + * _spawn_callbacks.add(callback) + * + */ + __pyx_t_3 = PySet_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 554, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_XGOTREF(__pyx_v_6gevent_9_greenlet__spawn_callbacks); + __Pyx_DECREF_SET(__pyx_v_6gevent_9_greenlet__spawn_callbacks, ((PyObject*)__pyx_t_3)); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + + /* "src/gevent/greenlet.py":553 + * """ + * global _spawn_callbacks + * if _spawn_callbacks is None: # pylint:disable=used-before-assignment # <<<<<<<<<<<<<< + * _spawn_callbacks = set() + * _spawn_callbacks.add(callback) + */ + } + + /* "src/gevent/greenlet.py":555 + * if _spawn_callbacks is None: # pylint:disable=used-before-assignment + * _spawn_callbacks = set() + * _spawn_callbacks.add(callback) # <<<<<<<<<<<<<< + * + * @staticmethod + */ + if (unlikely(__pyx_v_6gevent_9_greenlet__spawn_callbacks == Py_None)) { + PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "add"); + __PYX_ERR(0, 555, __pyx_L1_error) + } + __pyx_t_4 = PySet_Add(__pyx_v_6gevent_9_greenlet__spawn_callbacks, __pyx_v_callback); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 555, __pyx_L1_error) + + /* "src/gevent/greenlet.py":539 + * + * @staticmethod + * def add_spawn_callback(callback): # <<<<<<<<<<<<<< + * """ + * add_spawn_callback(callback) -> None + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("gevent._greenlet.Greenlet.add_spawn_callback", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/greenlet.py":558 + * + * @staticmethod + * def remove_spawn_callback(callback): # <<<<<<<<<<<<<< + * """ + * remove_spawn_callback(callback) -> None + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_27remove_spawn_callback(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6gevent_9_greenlet_8Greenlet_26remove_spawn_callback[] = "Greenlet.remove_spawn_callback(callback)\n\n remove_spawn_callback(callback) -> None\n\n Remove *callback* function added with :meth:`Greenlet.add_spawn_callback`.\n This function will not fail if *callback* has been already removed or\n if *callback* was never added.\n\n .. versionadded:: 1.4.0\n "; +static PyMethodDef __pyx_mdef_6gevent_9_greenlet_8Greenlet_27remove_spawn_callback = {"remove_spawn_callback", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_9_greenlet_8Greenlet_27remove_spawn_callback, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_9_greenlet_8Greenlet_26remove_spawn_callback}; +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_27remove_spawn_callback(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_callback = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("remove_spawn_callback (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_callback,0}; + PyObject* values[1] = {0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_callback)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "remove_spawn_callback") < 0)) __PYX_ERR(0, 558, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + } + __pyx_v_callback = values[0]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("remove_spawn_callback", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 558, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent._greenlet.Greenlet.remove_spawn_callback", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_9_greenlet_8Greenlet_26remove_spawn_callback(__pyx_v_callback); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_26remove_spawn_callback(PyObject *__pyx_v_callback) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + __Pyx_RefNannySetupContext("remove_spawn_callback", 0); + + /* "src/gevent/greenlet.py":569 + * """ + * global _spawn_callbacks + * if _spawn_callbacks is not None: # <<<<<<<<<<<<<< + * _spawn_callbacks.discard(callback) + * if not _spawn_callbacks: + */ + __pyx_t_1 = (__pyx_v_6gevent_9_greenlet__spawn_callbacks != ((PyObject*)Py_None)); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "src/gevent/greenlet.py":570 + * global _spawn_callbacks + * if _spawn_callbacks is not None: + * _spawn_callbacks.discard(callback) # <<<<<<<<<<<<<< + * if not _spawn_callbacks: + * _spawn_callbacks = None + */ + if (unlikely(__pyx_v_6gevent_9_greenlet__spawn_callbacks == Py_None)) { + PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "discard"); + __PYX_ERR(0, 570, __pyx_L1_error) + } + __pyx_t_3 = __Pyx_PySet_Discard(__pyx_v_6gevent_9_greenlet__spawn_callbacks, __pyx_v_callback); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 570, __pyx_L1_error) + + /* "src/gevent/greenlet.py":571 + * if _spawn_callbacks is not None: + * _spawn_callbacks.discard(callback) + * if not _spawn_callbacks: # <<<<<<<<<<<<<< + * _spawn_callbacks = None + * + */ + __pyx_t_2 = (__pyx_v_6gevent_9_greenlet__spawn_callbacks != Py_None)&&(PySet_GET_SIZE(__pyx_v_6gevent_9_greenlet__spawn_callbacks) != 0); + __pyx_t_1 = ((!__pyx_t_2) != 0); + if (__pyx_t_1) { + + /* "src/gevent/greenlet.py":572 + * _spawn_callbacks.discard(callback) + * if not _spawn_callbacks: + * _spawn_callbacks = None # <<<<<<<<<<<<<< + * + * @classmethod + */ + __Pyx_INCREF(Py_None); + __Pyx_XGOTREF(__pyx_v_6gevent_9_greenlet__spawn_callbacks); + __Pyx_DECREF_SET(__pyx_v_6gevent_9_greenlet__spawn_callbacks, ((PyObject*)Py_None)); + __Pyx_GIVEREF(Py_None); + + /* "src/gevent/greenlet.py":571 + * if _spawn_callbacks is not None: + * _spawn_callbacks.discard(callback) + * if not _spawn_callbacks: # <<<<<<<<<<<<<< + * _spawn_callbacks = None + * + */ + } + + /* "src/gevent/greenlet.py":569 + * """ + * global _spawn_callbacks + * if _spawn_callbacks is not None: # <<<<<<<<<<<<<< + * _spawn_callbacks.discard(callback) + * if not _spawn_callbacks: + */ + } + + /* "src/gevent/greenlet.py":558 + * + * @staticmethod + * def remove_spawn_callback(callback): # <<<<<<<<<<<<<< + * """ + * remove_spawn_callback(callback) -> None + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("gevent._greenlet.Greenlet.remove_spawn_callback", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/greenlet.py":575 + * + * @classmethod + * def spawn(cls, *args, **kwargs): # <<<<<<<<<<<<<< + * """ + * spawn(function, *args, **kwargs) -> Greenlet + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_29spawn(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6gevent_9_greenlet_8Greenlet_28spawn[] = "Greenlet.spawn(type cls, *args, **kwargs)\n\n spawn(function, *args, **kwargs) -> Greenlet\n\n Create a new :class:`Greenlet` object and schedule it to run ``function(*args, **kwargs)``.\n This can be used as ``gevent.spawn`` or ``Greenlet.spawn``.\n\n The arguments are passed to :meth:`Greenlet.__init__`.\n\n .. versionchanged:: 1.1b1\n If a *function* is given that is not callable, immediately raise a :exc:`TypeError`\n instead of spawning a greenlet that will raise an uncaught TypeError.\n "; +static PyMethodDef __pyx_mdef_6gevent_9_greenlet_8Greenlet_29spawn = {"spawn", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_9_greenlet_8Greenlet_29spawn, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_9_greenlet_8Greenlet_28spawn}; +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_29spawn(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_args = 0; + PyObject *__pyx_v_kwargs = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("spawn (wrapper)", 0); + if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "spawn", 1))) return NULL; + if (unlikely(__pyx_kwds)) { + __pyx_v_kwargs = PyDict_Copy(__pyx_kwds); if (unlikely(!__pyx_v_kwargs)) return NULL; + __Pyx_GOTREF(__pyx_v_kwargs); + } else { + __pyx_v_kwargs = NULL; + } + __Pyx_INCREF(__pyx_args); + __pyx_v_args = __pyx_args; + __pyx_r = __pyx_pf_6gevent_9_greenlet_8Greenlet_28spawn(((PyTypeObject*)__pyx_v_cls), __pyx_v_args, __pyx_v_kwargs); + + /* function exit code */ + __Pyx_XDECREF(__pyx_v_args); + __Pyx_XDECREF(__pyx_v_kwargs); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_28spawn(PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) { + PyObject *__pyx_v_g = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("spawn", 0); + + /* "src/gevent/greenlet.py":588 + * instead of spawning a greenlet that will raise an uncaught TypeError. + * """ + * g = cls(*args, **kwargs) # <<<<<<<<<<<<<< + * g.start() + * return g + */ + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_v_cls), __pyx_v_args, __pyx_v_kwargs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 588, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_g = __pyx_t_1; + __pyx_t_1 = 0; + + /* "src/gevent/greenlet.py":589 + * """ + * g = cls(*args, **kwargs) + * g.start() # <<<<<<<<<<<<<< + * return g + * + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_g, __pyx_n_s_start); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 589, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 589, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/greenlet.py":590 + * g = cls(*args, **kwargs) + * g.start() + * return g # <<<<<<<<<<<<<< + * + * @classmethod + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_g); + __pyx_r = __pyx_v_g; + goto __pyx_L0; + + /* "src/gevent/greenlet.py":575 + * + * @classmethod + * def spawn(cls, *args, **kwargs): # <<<<<<<<<<<<<< + * """ + * spawn(function, *args, **kwargs) -> Greenlet + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("gevent._greenlet.Greenlet.spawn", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_g); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/greenlet.py":593 + * + * @classmethod + * def spawn_later(cls, seconds, *args, **kwargs): # <<<<<<<<<<<<<< + * """ + * spawn_later(seconds, function, *args, **kwargs) -> Greenlet + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_31spawn_later(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6gevent_9_greenlet_8Greenlet_30spawn_later[] = "Greenlet.spawn_later(type cls, seconds, *args, **kwargs)\n\n spawn_later(seconds, function, *args, **kwargs) -> Greenlet\n\n Create and return a new `Greenlet` object scheduled to run ``function(*args, **kwargs)``\n in a future loop iteration *seconds* later. This can be used as ``Greenlet.spawn_later``\n or ``gevent.spawn_later``.\n\n The arguments are passed to :meth:`Greenlet.__init__`.\n\n .. versionchanged:: 1.1b1\n If an argument that's meant to be a function (the first argument in *args*, or the ``run`` keyword )\n is given to this classmethod (and not a classmethod of a subclass),\n it is verified to be callable. Previously, the spawned greenlet would have failed\n when it started running.\n "; +static PyMethodDef __pyx_mdef_6gevent_9_greenlet_8Greenlet_31spawn_later = {"spawn_later", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_9_greenlet_8Greenlet_31spawn_later, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_9_greenlet_8Greenlet_30spawn_later}; +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_31spawn_later(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_seconds = 0; + PyObject *__pyx_v_args = 0; + PyObject *__pyx_v_kwargs = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("spawn_later (wrapper)", 0); + __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL; + __Pyx_GOTREF(__pyx_v_kwargs); + if (PyTuple_GET_SIZE(__pyx_args) > 1) { + __pyx_v_args = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args)); + if (unlikely(!__pyx_v_args)) { + __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0; + __Pyx_RefNannyFinishContext(); + return NULL; + } + __Pyx_GOTREF(__pyx_v_args); + } else { + __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple); + } + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_seconds,0}; + PyObject* values[1] = {0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + default: + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_seconds)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, used_pos_args, "spawn_later") < 0)) __PYX_ERR(0, 593, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) < 1) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + } + __pyx_v_seconds = values[0]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("spawn_later", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 593, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0; + __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0; + __Pyx_AddTraceback("gevent._greenlet.Greenlet.spawn_later", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_9_greenlet_8Greenlet_30spawn_later(((PyTypeObject*)__pyx_v_cls), __pyx_v_seconds, __pyx_v_args, __pyx_v_kwargs); + + /* function exit code */ + __Pyx_XDECREF(__pyx_v_args); + __Pyx_XDECREF(__pyx_v_kwargs); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_30spawn_later(PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_seconds, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) { + PyObject *__pyx_v_g = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + __Pyx_RefNannySetupContext("spawn_later", 0); + + /* "src/gevent/greenlet.py":609 + * when it started running. + * """ + * if cls is Greenlet and not args and 'run' not in kwargs: # <<<<<<<<<<<<<< + * raise TypeError("") + * g = cls(*args, **kwargs) + */ + __pyx_t_2 = (__pyx_v_cls == __pyx_ptype_6gevent_9_greenlet_Greenlet); + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + } else { + __pyx_t_1 = __pyx_t_3; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_3 = (PyTuple_GET_SIZE(__pyx_v_args) != 0); + __pyx_t_2 = ((!__pyx_t_3) != 0); + if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_2 = (__Pyx_PyDict_ContainsTF(__pyx_n_s_run, __pyx_v_kwargs, Py_NE)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 609, __pyx_L1_error) + __pyx_t_3 = (__pyx_t_2 != 0); + __pyx_t_1 = __pyx_t_3; + __pyx_L4_bool_binop_done:; + if (unlikely(__pyx_t_1)) { + + /* "src/gevent/greenlet.py":610 + * """ + * if cls is Greenlet and not args and 'run' not in kwargs: + * raise TypeError("") # <<<<<<<<<<<<<< + * g = cls(*args, **kwargs) + * g.start_later(seconds) + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 610, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __PYX_ERR(0, 610, __pyx_L1_error) + + /* "src/gevent/greenlet.py":609 + * when it started running. + * """ + * if cls is Greenlet and not args and 'run' not in kwargs: # <<<<<<<<<<<<<< + * raise TypeError("") + * g = cls(*args, **kwargs) + */ + } + + /* "src/gevent/greenlet.py":611 + * if cls is Greenlet and not args and 'run' not in kwargs: + * raise TypeError("") + * g = cls(*args, **kwargs) # <<<<<<<<<<<<<< + * g.start_later(seconds) + * return g + */ + __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_v_cls), __pyx_v_args, __pyx_v_kwargs); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 611, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_v_g = __pyx_t_4; + __pyx_t_4 = 0; + + /* "src/gevent/greenlet.py":612 + * raise TypeError("") + * g = cls(*args, **kwargs) + * g.start_later(seconds) # <<<<<<<<<<<<<< + * return g + * + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_g, __pyx_n_s_start_later); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 612, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); + if (likely(__pyx_t_6)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_5, function); + } + } + __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_v_seconds) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_seconds); + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 612, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "src/gevent/greenlet.py":613 + * g = cls(*args, **kwargs) + * g.start_later(seconds) + * return g # <<<<<<<<<<<<<< + * + * def kill(self, exception=GreenletExit, block=True, timeout=None): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_g); + __pyx_r = __pyx_v_g; + goto __pyx_L0; + + /* "src/gevent/greenlet.py":593 + * + * @classmethod + * def spawn_later(cls, seconds, *args, **kwargs): # <<<<<<<<<<<<<< + * """ + * spawn_later(seconds, function, *args, **kwargs) -> Greenlet + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("gevent._greenlet.Greenlet.spawn_later", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_g); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/greenlet.py":615 + * return g + * + * def kill(self, exception=GreenletExit, block=True, timeout=None): # <<<<<<<<<<<<<< + * """ + * Raise the ``exception`` in the greenlet. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_33kill(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6gevent_9_greenlet_8Greenlet_32kill[] = "Greenlet.kill(self, exception=GreenletExit, block=True, timeout=None)\n\n Raise the ``exception`` in the greenlet.\n\n If ``block`` is ``True`` (the default), wait until the greenlet dies or the optional timeout expires.\n If block is ``False``, the current greenlet is not unscheduled.\n\n The function always returns ``None`` and never raises an error.\n\n .. note::\n\n Depending on what this greenlet is executing and the state\n of the event loop, the exception may or may not be raised\n immediately when this greenlet resumes execution. It may\n be raised on a subsequent green call, or, if this greenlet\n exits before making such a call, it may not be raised at\n all. As of 1.1, an example where the exception is raised\n later is if this greenlet had called :func:`sleep(0)\n `; an example where the exception is raised\n immediately is if this greenlet had called\n :func:`sleep(0.1) `.\n\n .. caution::\n\n Use care when killing greenlets. If the code executing is not\n exception safe (e.g., makes proper use of ``finally``) then an\n unexpected exception could result in corrupted state.\n\n See also :func:`gevent.kill`.\n\n :keyword type exception: The type of exception to raise in the greenlet. The default\n is :class:`GreenletExit`, which indicates a :meth:`successful` completion\n of the greenlet.\n\n .. versionchanged:: 0.13.0\n *block* is now ``True`` by default.\n .. versionchanged:: 1.1a2\n If this greenlet had never been switched to, killing it will prevent it from ever being switched to.\n "; +static PyMethodDef __pyx_mdef_6gevent_9_greenlet_8Greenlet_33kill = {"kill", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_9_greenlet_8Greenlet_33kill, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_9_greenlet_8Greenlet_32kill}; +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_33kill(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_exception = 0; + PyObject *__pyx_v_block = 0; + PyObject *__pyx_v_timeout = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("kill (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_exception,&__pyx_n_s_block,&__pyx_n_s_timeout,0}; + PyObject* values[3] = {0,0,0}; + values[0] = __pyx_k__10; + values[1] = ((PyObject *)Py_True); + values[2] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_exception); + if (value) { values[0] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 1: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_block); + if (value) { values[1] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 2: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_timeout); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "kill") < 0)) __PYX_ERR(0, 615, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_exception = values[0]; + __pyx_v_block = values[1]; + __pyx_v_timeout = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("kill", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 615, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent._greenlet.Greenlet.kill", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_9_greenlet_8Greenlet_32kill(((struct __pyx_obj_6gevent_9_greenlet_Greenlet *)__pyx_v_self), __pyx_v_exception, __pyx_v_block, __pyx_v_timeout); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_32kill(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self, PyObject *__pyx_v_exception, PyObject *__pyx_v_block, PyObject *__pyx_v_timeout) { + PyObject *__pyx_v_waiter = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + struct __pyx_opt_args_6gevent_9_greenlet_8Greenlet_join __pyx_t_8; + __Pyx_RefNannySetupContext("kill", 0); + + /* "src/gevent/greenlet.py":654 + * If this greenlet had never been switched to, killing it will prevent it from ever being switched to. + * """ + * self.__cancel_start() # <<<<<<<<<<<<<< + * + * if self.dead: + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_9_greenlet_Greenlet *)__pyx_v_self->__pyx_vtab)->__pyx___cancel_start(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 654, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/greenlet.py":656 + * self.__cancel_start() + * + * if self.dead: # <<<<<<<<<<<<<< + * self.__handle_death_before_start((exception,)) + * else: + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_dead); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 656, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 656, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_2) { + + /* "src/gevent/greenlet.py":657 + * + * if self.dead: + * self.__handle_death_before_start((exception,)) # <<<<<<<<<<<<<< + * else: + * waiter = Waiter() if block else None # pylint:disable=undefined-variable + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 657, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_exception); + __Pyx_GIVEREF(__pyx_v_exception); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_exception); + __pyx_t_3 = ((struct __pyx_vtabstruct_6gevent_9_greenlet_Greenlet *)__pyx_v_self->__pyx_vtab)->__pyx___handle_death_before_start(__pyx_v_self, ((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 657, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "src/gevent/greenlet.py":656 + * self.__cancel_start() + * + * if self.dead: # <<<<<<<<<<<<<< + * self.__handle_death_before_start((exception,)) + * else: + */ + goto __pyx_L3; + } + + /* "src/gevent/greenlet.py":659 + * self.__handle_death_before_start((exception,)) + * else: + * waiter = Waiter() if block else None # pylint:disable=undefined-variable # <<<<<<<<<<<<<< + * self.parent.loop.run_callback(_kill, self, exception, waiter) + * if block: + */ + /*else*/ { + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_block); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 659, __pyx_L1_error) + if (__pyx_t_2) { + __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_6gevent_8__waiter_Waiter)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 659, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __pyx_t_1; + __pyx_t_1 = 0; + } else { + __Pyx_INCREF(Py_None); + __pyx_t_3 = Py_None; + } + __pyx_v_waiter = __pyx_t_3; + __pyx_t_3 = 0; + + /* "src/gevent/greenlet.py":660 + * else: + * waiter = Waiter() if block else None # pylint:disable=undefined-variable + * self.parent.loop.run_callback(_kill, self, exception, waiter) # <<<<<<<<<<<<<< + * if block: + * waiter.get() + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_parent); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 660, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_loop); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 660, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_run_callback); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 660, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_kill); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 660, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = NULL; + __pyx_t_6 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_1, function); + __pyx_t_6 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_1)) { + PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_t_4, ((PyObject *)__pyx_v_self), __pyx_v_exception, __pyx_v_waiter}; + __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_6, 4+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 660, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) { + PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_t_4, ((PyObject *)__pyx_v_self), __pyx_v_exception, __pyx_v_waiter}; + __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_6, 4+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 660, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } else + #endif + { + __pyx_t_7 = PyTuple_New(4+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 660, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + if (__pyx_t_5) { + __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL; + } + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_t_4); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, ((PyObject *)__pyx_v_self)); + __Pyx_INCREF(__pyx_v_exception); + __Pyx_GIVEREF(__pyx_v_exception); + PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_6, __pyx_v_exception); + __Pyx_INCREF(__pyx_v_waiter); + __Pyx_GIVEREF(__pyx_v_waiter); + PyTuple_SET_ITEM(__pyx_t_7, 3+__pyx_t_6, __pyx_v_waiter); + __pyx_t_4 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 660, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "src/gevent/greenlet.py":661 + * waiter = Waiter() if block else None # pylint:disable=undefined-variable + * self.parent.loop.run_callback(_kill, self, exception, waiter) + * if block: # <<<<<<<<<<<<<< + * waiter.get() + * self.join(timeout) + */ + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_block); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 661, __pyx_L1_error) + if (__pyx_t_2) { + + /* "src/gevent/greenlet.py":662 + * self.parent.loop.run_callback(_kill, self, exception, waiter) + * if block: + * waiter.get() # <<<<<<<<<<<<<< + * self.join(timeout) + * # it should be OK to use kill() in finally or kill a greenlet from more than one place; + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_waiter, __pyx_n_s_get_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 662, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { + __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_1); + if (likely(__pyx_t_7)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); + __Pyx_INCREF(__pyx_t_7); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_1, function); + } + } + __pyx_t_3 = (__pyx_t_7) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_7) : __Pyx_PyObject_CallNoArg(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 662, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "src/gevent/greenlet.py":663 + * if block: + * waiter.get() + * self.join(timeout) # <<<<<<<<<<<<<< + * # it should be OK to use kill() in finally or kill a greenlet from more than one place; + * # thus it should not raise when the greenlet is already killed (= not started) + */ + __pyx_t_8.__pyx_n = 1; + __pyx_t_8.timeout = __pyx_v_timeout; + __pyx_t_3 = ((struct __pyx_vtabstruct_6gevent_9_greenlet_Greenlet *)__pyx_v_self->__pyx_vtab)->join(__pyx_v_self, 0, &__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 663, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "src/gevent/greenlet.py":661 + * waiter = Waiter() if block else None # pylint:disable=undefined-variable + * self.parent.loop.run_callback(_kill, self, exception, waiter) + * if block: # <<<<<<<<<<<<<< + * waiter.get() + * self.join(timeout) + */ + } + } + __pyx_L3:; + + /* "src/gevent/greenlet.py":615 + * return g + * + * def kill(self, exception=GreenletExit, block=True, timeout=None): # <<<<<<<<<<<<<< + * """ + * Raise the ``exception`` in the greenlet. + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("gevent._greenlet.Greenlet.kill", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_waiter); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/greenlet.py":667 + * # thus it should not raise when the greenlet is already killed (= not started) + * + * def get(self, block=True, timeout=None): # <<<<<<<<<<<<<< + * """ + * get(block=True, timeout=None) -> object + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_35get(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6gevent_9_greenlet_8Greenlet_34get[] = "Greenlet.get(self, block=True, timeout=None)\n\n get(block=True, timeout=None) -> object\n\n Return the result the greenlet has returned or re-raise the\n exception it has raised.\n\n If block is ``False``, raise :class:`gevent.Timeout` if the\n greenlet is still alive. If block is ``True``, unschedule the\n current greenlet until the result is available or the timeout\n expires. In the latter case, :class:`gevent.Timeout` is\n raised.\n "; +static PyMethodDef __pyx_mdef_6gevent_9_greenlet_8Greenlet_35get = {"get", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_9_greenlet_8Greenlet_35get, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_9_greenlet_8Greenlet_34get}; +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_35get(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_block = 0; + PyObject *__pyx_v_timeout = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_block,&__pyx_n_s_timeout,0}; + PyObject* values[2] = {0,0}; + values[0] = ((PyObject *)Py_True); + values[1] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_block); + if (value) { values[0] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 1: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_timeout); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get") < 0)) __PYX_ERR(0, 667, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_block = values[0]; + __pyx_v_timeout = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("get", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 667, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent._greenlet.Greenlet.get", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_9_greenlet_8Greenlet_34get(((struct __pyx_obj_6gevent_9_greenlet_Greenlet *)__pyx_v_self), __pyx_v_block, __pyx_v_timeout); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_34get(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self, PyObject *__pyx_v_block, PyObject *__pyx_v_timeout) { + PyObject *__pyx_v_switch = NULL; + PyObject *__pyx_v_t = NULL; + PyObject *__pyx_v_result = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + int __pyx_t_10; + int __pyx_t_11; + char const *__pyx_t_12; + PyObject *__pyx_t_13 = NULL; + PyObject *__pyx_t_14 = NULL; + PyObject *__pyx_t_15 = NULL; + PyObject *__pyx_t_16 = NULL; + PyObject *__pyx_t_17 = NULL; + PyObject *__pyx_t_18 = NULL; + PyObject *__pyx_t_19 = NULL; + PyObject *__pyx_t_20 = NULL; + __Pyx_RefNannySetupContext("get", 0); + + /* "src/gevent/greenlet.py":680 + * raised. + * """ + * if self.ready(): # <<<<<<<<<<<<<< + * if self.successful(): + * return self.value + */ + __pyx_t_1 = (((struct __pyx_vtabstruct_6gevent_9_greenlet_Greenlet *)__pyx_v_self->__pyx_vtab)->ready(__pyx_v_self, 0) != 0); + if (__pyx_t_1) { + + /* "src/gevent/greenlet.py":681 + * """ + * if self.ready(): + * if self.successful(): # <<<<<<<<<<<<<< + * return self.value + * self._raise_exception() + */ + __pyx_t_1 = (((struct __pyx_vtabstruct_6gevent_9_greenlet_Greenlet *)__pyx_v_self->__pyx_vtab)->successful(__pyx_v_self, 0) != 0); + if (__pyx_t_1) { + + /* "src/gevent/greenlet.py":682 + * if self.ready(): + * if self.successful(): + * return self.value # <<<<<<<<<<<<<< + * self._raise_exception() + * if not block: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->value); + __pyx_r = __pyx_v_self->value; + goto __pyx_L0; + + /* "src/gevent/greenlet.py":681 + * """ + * if self.ready(): + * if self.successful(): # <<<<<<<<<<<<<< + * return self.value + * self._raise_exception() + */ + } + + /* "src/gevent/greenlet.py":683 + * if self.successful(): + * return self.value + * self._raise_exception() # <<<<<<<<<<<<<< + * if not block: + * raise Timeout() + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_raise_exception); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 683, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 683, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/greenlet.py":680 + * raised. + * """ + * if self.ready(): # <<<<<<<<<<<<<< + * if self.successful(): + * return self.value + */ + } + + /* "src/gevent/greenlet.py":684 + * return self.value + * self._raise_exception() + * if not block: # <<<<<<<<<<<<<< + * raise Timeout() + * + */ + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_block); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 684, __pyx_L1_error) + __pyx_t_5 = ((!__pyx_t_1) != 0); + if (unlikely(__pyx_t_5)) { + + /* "src/gevent/greenlet.py":685 + * self._raise_exception() + * if not block: + * raise Timeout() # <<<<<<<<<<<<<< + * + * switch = getcurrent().switch # pylint:disable=undefined-variable + */ + __Pyx_INCREF(__pyx_v_6gevent_9_greenlet_Timeout); + __pyx_t_3 = __pyx_v_6gevent_9_greenlet_Timeout; __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 685, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 685, __pyx_L1_error) + + /* "src/gevent/greenlet.py":684 + * return self.value + * self._raise_exception() + * if not block: # <<<<<<<<<<<<<< + * raise Timeout() + * + */ + } + + /* "src/gevent/greenlet.py":687 + * raise Timeout() + * + * switch = getcurrent().switch # pylint:disable=undefined-variable # <<<<<<<<<<<<<< + * self.rawlink(switch) + * try: + */ + __pyx_t_2 = ((PyObject *)__pyx_f_6gevent_9_greenlet_getcurrent()); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 687, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_switch); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 687, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_switch = __pyx_t_3; + __pyx_t_3 = 0; + + /* "src/gevent/greenlet.py":688 + * + * switch = getcurrent().switch # pylint:disable=undefined-variable + * self.rawlink(switch) # <<<<<<<<<<<<<< + * try: + * t = Timeout._start_new_or_dummy(timeout) + */ + __pyx_t_3 = ((struct __pyx_vtabstruct_6gevent_9_greenlet_Greenlet *)__pyx_v_self->__pyx_vtab)->rawlink(__pyx_v_self, __pyx_v_switch, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 688, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "src/gevent/greenlet.py":689 + * switch = getcurrent().switch # pylint:disable=undefined-variable + * self.rawlink(switch) + * try: # <<<<<<<<<<<<<< + * t = Timeout._start_new_or_dummy(timeout) + * try: + */ + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); + __Pyx_XGOTREF(__pyx_t_6); + __Pyx_XGOTREF(__pyx_t_7); + __Pyx_XGOTREF(__pyx_t_8); + /*try:*/ { + + /* "src/gevent/greenlet.py":690 + * self.rawlink(switch) + * try: + * t = Timeout._start_new_or_dummy(timeout) # <<<<<<<<<<<<<< + * try: + * result = self.parent.switch() + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_6gevent_9_greenlet_Timeout, __pyx_n_s_start_new_or_dummy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 690, __pyx_L6_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_v_timeout) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_timeout); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 690, __pyx_L6_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_t = __pyx_t_3; + __pyx_t_3 = 0; + + /* "src/gevent/greenlet.py":691 + * try: + * t = Timeout._start_new_or_dummy(timeout) + * try: # <<<<<<<<<<<<<< + * result = self.parent.switch() + * if result is not self: + */ + /*try:*/ { + + /* "src/gevent/greenlet.py":692 + * t = Timeout._start_new_or_dummy(timeout) + * try: + * result = self.parent.switch() # <<<<<<<<<<<<<< + * if result is not self: + * raise InvalidSwitchError('Invalid switch into Greenlet.get(): %r' % (result, )) + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_parent); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 692, __pyx_L13_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_switch); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 692, __pyx_L13_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_2)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + } + } + __pyx_t_3 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 692, __pyx_L13_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_result = __pyx_t_3; + __pyx_t_3 = 0; + + /* "src/gevent/greenlet.py":693 + * try: + * result = self.parent.switch() + * if result is not self: # <<<<<<<<<<<<<< + * raise InvalidSwitchError('Invalid switch into Greenlet.get(): %r' % (result, )) + * finally: + */ + __pyx_t_5 = (__pyx_v_result != ((PyObject *)__pyx_v_self)); + __pyx_t_1 = (__pyx_t_5 != 0); + if (unlikely(__pyx_t_1)) { + + /* "src/gevent/greenlet.py":694 + * result = self.parent.switch() + * if result is not self: + * raise InvalidSwitchError('Invalid switch into Greenlet.get(): %r' % (result, )) # <<<<<<<<<<<<<< + * finally: + * t.cancel() + */ + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 694, __pyx_L13_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_result); + __Pyx_GIVEREF(__pyx_v_result); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_result); + __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_switch_into_Greenlet_get, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 694, __pyx_L13_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_INCREF(__pyx_v_6gevent_9_greenlet_InvalidSwitchError); + __pyx_t_4 = __pyx_v_6gevent_9_greenlet_InvalidSwitchError; __pyx_t_9 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_9)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_9); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + } + } + __pyx_t_3 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_9, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_2); + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 694, __pyx_L13_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(0, 694, __pyx_L13_error) + + /* "src/gevent/greenlet.py":693 + * try: + * result = self.parent.switch() + * if result is not self: # <<<<<<<<<<<<<< + * raise InvalidSwitchError('Invalid switch into Greenlet.get(): %r' % (result, )) + * finally: + */ + } + } + + /* "src/gevent/greenlet.py":696 + * raise InvalidSwitchError('Invalid switch into Greenlet.get(): %r' % (result, )) + * finally: + * t.cancel() # <<<<<<<<<<<<<< + * except: + * # unlinking in 'except' instead of finally is an optimization: + */ + /*finally:*/ { + /*normal exit:*/{ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_t, __pyx_n_s_cancel); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 696, __pyx_L6_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_2)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + } + } + __pyx_t_3 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 696, __pyx_L6_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L14; + } + __pyx_L13_error:; + /*exception exit:*/{ + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18); + if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15) < 0)) __Pyx_ErrFetch(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15); + __Pyx_XGOTREF(__pyx_t_13); + __Pyx_XGOTREF(__pyx_t_14); + __Pyx_XGOTREF(__pyx_t_15); + __Pyx_XGOTREF(__pyx_t_16); + __Pyx_XGOTREF(__pyx_t_17); + __Pyx_XGOTREF(__pyx_t_18); + __pyx_t_10 = __pyx_lineno; __pyx_t_11 = __pyx_clineno; __pyx_t_12 = __pyx_filename; + { + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_t, __pyx_n_s_cancel); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 696, __pyx_L17_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_2)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + } + } + __pyx_t_3 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 696, __pyx_L17_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + if (PY_MAJOR_VERSION >= 3) { + __Pyx_XGIVEREF(__pyx_t_16); + __Pyx_XGIVEREF(__pyx_t_17); + __Pyx_XGIVEREF(__pyx_t_18); + __Pyx_ExceptionReset(__pyx_t_16, __pyx_t_17, __pyx_t_18); + } + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_XGIVEREF(__pyx_t_15); + __Pyx_ErrRestore(__pyx_t_13, __pyx_t_14, __pyx_t_15); + __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; + __pyx_lineno = __pyx_t_10; __pyx_clineno = __pyx_t_11; __pyx_filename = __pyx_t_12; + goto __pyx_L6_error; + __pyx_L17_error:; + if (PY_MAJOR_VERSION >= 3) { + __Pyx_XGIVEREF(__pyx_t_16); + __Pyx_XGIVEREF(__pyx_t_17); + __Pyx_XGIVEREF(__pyx_t_18); + __Pyx_ExceptionReset(__pyx_t_16, __pyx_t_17, __pyx_t_18); + } + __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; + __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; + goto __pyx_L6_error; + } + __pyx_L14:; + } + + /* "src/gevent/greenlet.py":689 + * switch = getcurrent().switch # pylint:disable=undefined-variable + * self.rawlink(switch) + * try: # <<<<<<<<<<<<<< + * t = Timeout._start_new_or_dummy(timeout) + * try: + */ + } + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + goto __pyx_L11_try_end; + __pyx_L6_error:; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "src/gevent/greenlet.py":697 + * finally: + * t.cancel() + * except: # <<<<<<<<<<<<<< + * # unlinking in 'except' instead of finally is an optimization: + * # if switch occurred normally then link was already removed in _notify_links + */ + /*except:*/ { + __Pyx_AddTraceback("gevent._greenlet.Greenlet.get", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_4, &__pyx_t_2) < 0) __PYX_ERR(0, 697, __pyx_L8_except_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_2); + + /* "src/gevent/greenlet.py":703 + * # Note, however, that if "Invalid switch" assert was removed and invalid switch + * # did happen, the link would remain, causing another invalid switch later in this greenlet. + * self.unlink(switch) # <<<<<<<<<<<<<< + * raise + * + */ + __pyx_t_19 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_unlink); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 703, __pyx_L8_except_error) + __Pyx_GOTREF(__pyx_t_19); + __pyx_t_20 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_19))) { + __pyx_t_20 = PyMethod_GET_SELF(__pyx_t_19); + if (likely(__pyx_t_20)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_19); + __Pyx_INCREF(__pyx_t_20); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_19, function); + } + } + __pyx_t_9 = (__pyx_t_20) ? __Pyx_PyObject_Call2Args(__pyx_t_19, __pyx_t_20, __pyx_v_switch) : __Pyx_PyObject_CallOneArg(__pyx_t_19, __pyx_v_switch); + __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0; + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 703, __pyx_L8_except_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "src/gevent/greenlet.py":704 + * # did happen, the link would remain, causing another invalid switch later in this greenlet. + * self.unlink(switch) + * raise # <<<<<<<<<<<<<< + * + * if self.ready(): + */ + __Pyx_GIVEREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_ErrRestoreWithState(__pyx_t_3, __pyx_t_4, __pyx_t_2); + __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_t_2 = 0; + __PYX_ERR(0, 704, __pyx_L8_except_error) + } + __pyx_L8_except_error:; + + /* "src/gevent/greenlet.py":689 + * switch = getcurrent().switch # pylint:disable=undefined-variable + * self.rawlink(switch) + * try: # <<<<<<<<<<<<<< + * t = Timeout._start_new_or_dummy(timeout) + * try: + */ + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); + goto __pyx_L1_error; + __pyx_L11_try_end:; + } + + /* "src/gevent/greenlet.py":706 + * raise + * + * if self.ready(): # <<<<<<<<<<<<<< + * if self.successful(): + * return self.value + */ + __pyx_t_1 = (((struct __pyx_vtabstruct_6gevent_9_greenlet_Greenlet *)__pyx_v_self->__pyx_vtab)->ready(__pyx_v_self, 0) != 0); + if (__pyx_t_1) { + + /* "src/gevent/greenlet.py":707 + * + * if self.ready(): + * if self.successful(): # <<<<<<<<<<<<<< + * return self.value + * self._raise_exception() + */ + __pyx_t_1 = (((struct __pyx_vtabstruct_6gevent_9_greenlet_Greenlet *)__pyx_v_self->__pyx_vtab)->successful(__pyx_v_self, 0) != 0); + if (__pyx_t_1) { + + /* "src/gevent/greenlet.py":708 + * if self.ready(): + * if self.successful(): + * return self.value # <<<<<<<<<<<<<< + * self._raise_exception() + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->value); + __pyx_r = __pyx_v_self->value; + goto __pyx_L0; + + /* "src/gevent/greenlet.py":707 + * + * if self.ready(): + * if self.successful(): # <<<<<<<<<<<<<< + * return self.value + * self._raise_exception() + */ + } + + /* "src/gevent/greenlet.py":709 + * if self.successful(): + * return self.value + * self._raise_exception() # <<<<<<<<<<<<<< + * + * def join(self, timeout=None): + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_raise_exception); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 709, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + } + } + __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 709, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/greenlet.py":706 + * raise + * + * if self.ready(): # <<<<<<<<<<<<<< + * if self.successful(): + * return self.value + */ + } + + /* "src/gevent/greenlet.py":667 + * # thus it should not raise when the greenlet is already killed (= not started) + * + * def get(self, block=True, timeout=None): # <<<<<<<<<<<<<< + * """ + * get(block=True, timeout=None) -> object + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_19); + __Pyx_XDECREF(__pyx_t_20); + __Pyx_AddTraceback("gevent._greenlet.Greenlet.get", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_switch); + __Pyx_XDECREF(__pyx_v_t); + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/greenlet.py":711 + * self._raise_exception() + * + * def join(self, timeout=None): # <<<<<<<<<<<<<< + * """ + * join(timeout=None) -> None + */ + +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_37join(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_6gevent_9_greenlet_8Greenlet_join(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_9_greenlet_8Greenlet_join *__pyx_optional_args) { + PyObject *__pyx_v_timeout = ((PyObject *)Py_None); + PyObject *__pyx_v_switch = NULL; + PyObject *__pyx_v_t = NULL; + PyObject *__pyx_v_result = NULL; + PyObject *__pyx_v_ex = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + int __pyx_t_9; + int __pyx_t_10; + int __pyx_t_11; + char const *__pyx_t_12; + PyObject *__pyx_t_13 = NULL; + PyObject *__pyx_t_14 = NULL; + PyObject *__pyx_t_15 = NULL; + PyObject *__pyx_t_16 = NULL; + PyObject *__pyx_t_17 = NULL; + PyObject *__pyx_t_18 = NULL; + PyObject *__pyx_t_19 = NULL; + PyObject *__pyx_t_20 = NULL; + char const *__pyx_t_21; + __Pyx_RefNannySetupContext("join", 0); + if (__pyx_optional_args) { + if (__pyx_optional_args->__pyx_n > 0) { + __pyx_v_timeout = __pyx_optional_args->timeout; + } + } + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0; + if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self)))))); + else { + PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + #endif + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_join); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 711, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_9_greenlet_8Greenlet_37join)) { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_timeout) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_timeout); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 711, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0; + if (unlikely(type_dict_guard != tp_dict_version)) { + tp_dict_version = obj_dict_version = 0; + } + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + } + #endif + } + + /* "src/gevent/greenlet.py":718 + * ``None`` regardless. + * """ + * if self.ready(): # <<<<<<<<<<<<<< + * return + * + */ + __pyx_t_5 = (((struct __pyx_vtabstruct_6gevent_9_greenlet_Greenlet *)__pyx_v_self->__pyx_vtab)->ready(__pyx_v_self, 0) != 0); + if (__pyx_t_5) { + + /* "src/gevent/greenlet.py":719 + * """ + * if self.ready(): + * return # <<<<<<<<<<<<<< + * + * switch = getcurrent().switch # pylint:disable=undefined-variable + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + + /* "src/gevent/greenlet.py":718 + * ``None`` regardless. + * """ + * if self.ready(): # <<<<<<<<<<<<<< + * return + * + */ + } + + /* "src/gevent/greenlet.py":721 + * return + * + * switch = getcurrent().switch # pylint:disable=undefined-variable # <<<<<<<<<<<<<< + * self.rawlink(switch) + * try: + */ + __pyx_t_1 = ((PyObject *)__pyx_f_6gevent_9_greenlet_getcurrent()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 721, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_switch); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 721, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_switch = __pyx_t_2; + __pyx_t_2 = 0; + + /* "src/gevent/greenlet.py":722 + * + * switch = getcurrent().switch # pylint:disable=undefined-variable + * self.rawlink(switch) # <<<<<<<<<<<<<< + * try: + * t = Timeout._start_new_or_dummy(timeout) + */ + __pyx_t_2 = ((struct __pyx_vtabstruct_6gevent_9_greenlet_Greenlet *)__pyx_v_self->__pyx_vtab)->rawlink(__pyx_v_self, __pyx_v_switch, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 722, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/greenlet.py":723 + * switch = getcurrent().switch # pylint:disable=undefined-variable + * self.rawlink(switch) + * try: # <<<<<<<<<<<<<< + * t = Timeout._start_new_or_dummy(timeout) + * try: + */ + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); + __Pyx_XGOTREF(__pyx_t_6); + __Pyx_XGOTREF(__pyx_t_7); + __Pyx_XGOTREF(__pyx_t_8); + /*try:*/ { + + /* "src/gevent/greenlet.py":724 + * self.rawlink(switch) + * try: + * t = Timeout._start_new_or_dummy(timeout) # <<<<<<<<<<<<<< + * try: + * result = self.parent.switch() + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_6gevent_9_greenlet_Timeout, __pyx_n_s_start_new_or_dummy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 724, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_1, function); + } + } + __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_3, __pyx_v_timeout) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_timeout); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 724, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_t = __pyx_t_2; + __pyx_t_2 = 0; + + /* "src/gevent/greenlet.py":725 + * try: + * t = Timeout._start_new_or_dummy(timeout) + * try: # <<<<<<<<<<<<<< + * result = self.parent.switch() + * if result is not self: + */ + /*try:*/ { + + /* "src/gevent/greenlet.py":726 + * t = Timeout._start_new_or_dummy(timeout) + * try: + * result = self.parent.switch() # <<<<<<<<<<<<<< + * if result is not self: + * raise InvalidSwitchError('Invalid switch into Greenlet.join(): %r' % (result, )) + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_parent); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 726, __pyx_L11_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_switch); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 726, __pyx_L11_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_1)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_1); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_1) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1) : __Pyx_PyObject_CallNoArg(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 726, __pyx_L11_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_result = __pyx_t_2; + __pyx_t_2 = 0; + + /* "src/gevent/greenlet.py":727 + * try: + * result = self.parent.switch() + * if result is not self: # <<<<<<<<<<<<<< + * raise InvalidSwitchError('Invalid switch into Greenlet.join(): %r' % (result, )) + * finally: + */ + __pyx_t_5 = (__pyx_v_result != ((PyObject *)__pyx_v_self)); + __pyx_t_9 = (__pyx_t_5 != 0); + if (unlikely(__pyx_t_9)) { + + /* "src/gevent/greenlet.py":728 + * result = self.parent.switch() + * if result is not self: + * raise InvalidSwitchError('Invalid switch into Greenlet.join(): %r' % (result, )) # <<<<<<<<<<<<<< + * finally: + * t.cancel() + */ + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 728, __pyx_L11_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_result); + __Pyx_GIVEREF(__pyx_v_result); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_result); + __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_switch_into_Greenlet_joi, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 728, __pyx_L11_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_INCREF(__pyx_v_6gevent_9_greenlet_InvalidSwitchError); + __pyx_t_3 = __pyx_v_6gevent_9_greenlet_InvalidSwitchError; __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_t_1) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 728, __pyx_L11_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 728, __pyx_L11_error) + + /* "src/gevent/greenlet.py":727 + * try: + * result = self.parent.switch() + * if result is not self: # <<<<<<<<<<<<<< + * raise InvalidSwitchError('Invalid switch into Greenlet.join(): %r' % (result, )) + * finally: + */ + } + } + + /* "src/gevent/greenlet.py":730 + * raise InvalidSwitchError('Invalid switch into Greenlet.join(): %r' % (result, )) + * finally: + * t.cancel() # <<<<<<<<<<<<<< + * except Timeout as ex: + * self.unlink(switch) + */ + /*finally:*/ { + /*normal exit:*/{ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_t, __pyx_n_s_cancel); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 730, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_1)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_1); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_1) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1) : __Pyx_PyObject_CallNoArg(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 730, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + goto __pyx_L12; + } + __pyx_L11_error:; + /*exception exit:*/{ + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18); + if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15) < 0)) __Pyx_ErrFetch(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15); + __Pyx_XGOTREF(__pyx_t_13); + __Pyx_XGOTREF(__pyx_t_14); + __Pyx_XGOTREF(__pyx_t_15); + __Pyx_XGOTREF(__pyx_t_16); + __Pyx_XGOTREF(__pyx_t_17); + __Pyx_XGOTREF(__pyx_t_18); + __pyx_t_10 = __pyx_lineno; __pyx_t_11 = __pyx_clineno; __pyx_t_12 = __pyx_filename; + { + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_t, __pyx_n_s_cancel); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 730, __pyx_L15_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_1)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_1); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_1) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1) : __Pyx_PyObject_CallNoArg(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 730, __pyx_L15_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + if (PY_MAJOR_VERSION >= 3) { + __Pyx_XGIVEREF(__pyx_t_16); + __Pyx_XGIVEREF(__pyx_t_17); + __Pyx_XGIVEREF(__pyx_t_18); + __Pyx_ExceptionReset(__pyx_t_16, __pyx_t_17, __pyx_t_18); + } + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_XGIVEREF(__pyx_t_15); + __Pyx_ErrRestore(__pyx_t_13, __pyx_t_14, __pyx_t_15); + __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; + __pyx_lineno = __pyx_t_10; __pyx_clineno = __pyx_t_11; __pyx_filename = __pyx_t_12; + goto __pyx_L4_error; + __pyx_L15_error:; + if (PY_MAJOR_VERSION >= 3) { + __Pyx_XGIVEREF(__pyx_t_16); + __Pyx_XGIVEREF(__pyx_t_17); + __Pyx_XGIVEREF(__pyx_t_18); + __Pyx_ExceptionReset(__pyx_t_16, __pyx_t_17, __pyx_t_18); + } + __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; + __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; + goto __pyx_L4_error; + } + __pyx_L12:; + } + + /* "src/gevent/greenlet.py":723 + * switch = getcurrent().switch # pylint:disable=undefined-variable + * self.rawlink(switch) + * try: # <<<<<<<<<<<<<< + * t = Timeout._start_new_or_dummy(timeout) + * try: + */ + } + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + goto __pyx_L9_try_end; + __pyx_L4_error:; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/greenlet.py":731 + * finally: + * t.cancel() + * except Timeout as ex: # <<<<<<<<<<<<<< + * self.unlink(switch) + * if ex is not t: + */ + __pyx_t_11 = __Pyx_PyErr_ExceptionMatches(__pyx_v_6gevent_9_greenlet_Timeout); + if (__pyx_t_11) { + __Pyx_AddTraceback("gevent._greenlet.Greenlet.join", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_3, &__pyx_t_1) < 0) __PYX_ERR(0, 731, __pyx_L6_except_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_t_3); + __pyx_v_ex = __pyx_t_3; + /*try:*/ { + + /* "src/gevent/greenlet.py":732 + * t.cancel() + * except Timeout as ex: + * self.unlink(switch) # <<<<<<<<<<<<<< + * if ex is not t: + * raise + */ + __pyx_t_19 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_unlink); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 732, __pyx_L21_error) + __Pyx_GOTREF(__pyx_t_19); + __pyx_t_20 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_19))) { + __pyx_t_20 = PyMethod_GET_SELF(__pyx_t_19); + if (likely(__pyx_t_20)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_19); + __Pyx_INCREF(__pyx_t_20); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_19, function); + } + } + __pyx_t_4 = (__pyx_t_20) ? __Pyx_PyObject_Call2Args(__pyx_t_19, __pyx_t_20, __pyx_v_switch) : __Pyx_PyObject_CallOneArg(__pyx_t_19, __pyx_v_switch); + __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 732, __pyx_L21_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "src/gevent/greenlet.py":733 + * except Timeout as ex: + * self.unlink(switch) + * if ex is not t: # <<<<<<<<<<<<<< + * raise + * except: + */ + if (unlikely(!__pyx_v_t)) { __Pyx_RaiseUnboundLocalError("t"); __PYX_ERR(0, 733, __pyx_L21_error) } + __pyx_t_9 = (__pyx_v_ex != __pyx_v_t); + __pyx_t_5 = (__pyx_t_9 != 0); + if (unlikely(__pyx_t_5)) { + + /* "src/gevent/greenlet.py":734 + * self.unlink(switch) + * if ex is not t: + * raise # <<<<<<<<<<<<<< + * except: + * self.unlink(switch) + */ + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_ErrRestoreWithState(__pyx_t_2, __pyx_t_3, __pyx_t_1); + __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_1 = 0; + __PYX_ERR(0, 734, __pyx_L21_error) + + /* "src/gevent/greenlet.py":733 + * except Timeout as ex: + * self.unlink(switch) + * if ex is not t: # <<<<<<<<<<<<<< + * raise + * except: + */ + } + } + + /* "src/gevent/greenlet.py":731 + * finally: + * t.cancel() + * except Timeout as ex: # <<<<<<<<<<<<<< + * self.unlink(switch) + * if ex is not t: + */ + /*finally:*/ { + /*normal exit:*/{ + __Pyx_DECREF(__pyx_v_ex); + __pyx_v_ex = NULL; + goto __pyx_L22; + } + __pyx_L21_error:; + /*exception exit:*/{ + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __pyx_t_18 = 0; __pyx_t_17 = 0; __pyx_t_16 = 0; __pyx_t_15 = 0; __pyx_t_14 = 0; __pyx_t_13 = 0; + __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0; + __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_15, &__pyx_t_14, &__pyx_t_13); + if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_18, &__pyx_t_17, &__pyx_t_16) < 0)) __Pyx_ErrFetch(&__pyx_t_18, &__pyx_t_17, &__pyx_t_16); + __Pyx_XGOTREF(__pyx_t_18); + __Pyx_XGOTREF(__pyx_t_17); + __Pyx_XGOTREF(__pyx_t_16); + __Pyx_XGOTREF(__pyx_t_15); + __Pyx_XGOTREF(__pyx_t_14); + __Pyx_XGOTREF(__pyx_t_13); + __pyx_t_11 = __pyx_lineno; __pyx_t_10 = __pyx_clineno; __pyx_t_21 = __pyx_filename; + { + __Pyx_DECREF(__pyx_v_ex); + __pyx_v_ex = NULL; + } + if (PY_MAJOR_VERSION >= 3) { + __Pyx_XGIVEREF(__pyx_t_15); + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_ExceptionReset(__pyx_t_15, __pyx_t_14, __pyx_t_13); + } + __Pyx_XGIVEREF(__pyx_t_18); + __Pyx_XGIVEREF(__pyx_t_17); + __Pyx_XGIVEREF(__pyx_t_16); + __Pyx_ErrRestore(__pyx_t_18, __pyx_t_17, __pyx_t_16); + __pyx_t_18 = 0; __pyx_t_17 = 0; __pyx_t_16 = 0; __pyx_t_15 = 0; __pyx_t_14 = 0; __pyx_t_13 = 0; + __pyx_lineno = __pyx_t_11; __pyx_clineno = __pyx_t_10; __pyx_filename = __pyx_t_21; + goto __pyx_L6_except_error; + } + __pyx_L22:; + } + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L5_exception_handled; + } + + /* "src/gevent/greenlet.py":735 + * if ex is not t: + * raise + * except: # <<<<<<<<<<<<<< + * self.unlink(switch) + * raise + */ + /*except:*/ { + __Pyx_AddTraceback("gevent._greenlet.Greenlet.join", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_3, &__pyx_t_2) < 0) __PYX_ERR(0, 735, __pyx_L6_except_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GOTREF(__pyx_t_2); + + /* "src/gevent/greenlet.py":736 + * raise + * except: + * self.unlink(switch) # <<<<<<<<<<<<<< + * raise + * + */ + __pyx_t_19 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_unlink); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 736, __pyx_L6_except_error) + __Pyx_GOTREF(__pyx_t_19); + __pyx_t_20 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_19))) { + __pyx_t_20 = PyMethod_GET_SELF(__pyx_t_19); + if (likely(__pyx_t_20)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_19); + __Pyx_INCREF(__pyx_t_20); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_19, function); + } + } + __pyx_t_4 = (__pyx_t_20) ? __Pyx_PyObject_Call2Args(__pyx_t_19, __pyx_t_20, __pyx_v_switch) : __Pyx_PyObject_CallOneArg(__pyx_t_19, __pyx_v_switch); + __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 736, __pyx_L6_except_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "src/gevent/greenlet.py":737 + * except: + * self.unlink(switch) + * raise # <<<<<<<<<<<<<< + * + * def _report_result(self, result): + */ + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_ErrRestoreWithState(__pyx_t_1, __pyx_t_3, __pyx_t_2); + __pyx_t_1 = 0; __pyx_t_3 = 0; __pyx_t_2 = 0; + __PYX_ERR(0, 737, __pyx_L6_except_error) + } + __pyx_L6_except_error:; + + /* "src/gevent/greenlet.py":723 + * switch = getcurrent().switch # pylint:disable=undefined-variable + * self.rawlink(switch) + * try: # <<<<<<<<<<<<<< + * t = Timeout._start_new_or_dummy(timeout) + * try: + */ + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); + goto __pyx_L1_error; + __pyx_L5_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); + __pyx_L9_try_end:; + } + + /* "src/gevent/greenlet.py":711 + * self._raise_exception() + * + * def join(self, timeout=None): # <<<<<<<<<<<<<< + * """ + * join(timeout=None) -> None + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_19); + __Pyx_XDECREF(__pyx_t_20); + __Pyx_AddTraceback("gevent._greenlet.Greenlet.join", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_switch); + __Pyx_XDECREF(__pyx_v_t); + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XDECREF(__pyx_v_ex); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_37join(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6gevent_9_greenlet_8Greenlet_36join[] = "Greenlet.join(self, timeout=None)\n\n join(timeout=None) -> None\n\n Wait until the greenlet finishes or *timeout* expires. Return\n ``None`` regardless.\n "; +static PyMethodDef __pyx_mdef_6gevent_9_greenlet_8Greenlet_37join = {"join", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_9_greenlet_8Greenlet_37join, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_9_greenlet_8Greenlet_36join}; +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_37join(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_timeout = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("join (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_timeout,0}; + PyObject* values[1] = {0}; + values[0] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_timeout); + if (value) { values[0] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "join") < 0)) __PYX_ERR(0, 711, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_timeout = values[0]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("join", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 711, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent._greenlet.Greenlet.join", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_9_greenlet_8Greenlet_36join(((struct __pyx_obj_6gevent_9_greenlet_Greenlet *)__pyx_v_self), __pyx_v_timeout); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_36join(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self, PyObject *__pyx_v_timeout) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + struct __pyx_opt_args_6gevent_9_greenlet_8Greenlet_join __pyx_t_2; + __Pyx_RefNannySetupContext("join", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_2.__pyx_n = 1; + __pyx_t_2.timeout = __pyx_v_timeout; + __pyx_t_1 = __pyx_vtabptr_6gevent_9_greenlet_Greenlet->join(__pyx_v_self, 1, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 711, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent._greenlet.Greenlet.join", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/greenlet.py":739 + * raise + * + * def _report_result(self, result): # <<<<<<<<<<<<<< + * self._exc_info = (None, None, None) + * self.value = result + */ + +static PyObject *__pyx_f_6gevent_9_greenlet_8Greenlet__report_result(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self, PyObject *__pyx_v_result) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + __Pyx_RefNannySetupContext("_report_result", 0); + + /* "src/gevent/greenlet.py":740 + * + * def _report_result(self, result): + * self._exc_info = (None, None, None) # <<<<<<<<<<<<<< + * self.value = result + * if self._links and not self._notifier: + */ + __Pyx_INCREF(__pyx_tuple__11); + __Pyx_GIVEREF(__pyx_tuple__11); + __Pyx_GOTREF(__pyx_v_self->_exc_info); + __Pyx_DECREF(__pyx_v_self->_exc_info); + __pyx_v_self->_exc_info = __pyx_tuple__11; + + /* "src/gevent/greenlet.py":741 + * def _report_result(self, result): + * self._exc_info = (None, None, None) + * self.value = result # <<<<<<<<<<<<<< + * if self._links and not self._notifier: + * self._notifier = self.parent.loop.run_callback(self._notify_links) + */ + __Pyx_INCREF(__pyx_v_result); + __Pyx_GIVEREF(__pyx_v_result); + __Pyx_GOTREF(__pyx_v_self->value); + __Pyx_DECREF(__pyx_v_self->value); + __pyx_v_self->value = __pyx_v_result; + + /* "src/gevent/greenlet.py":742 + * self._exc_info = (None, None, None) + * self.value = result + * if self._links and not self._notifier: # <<<<<<<<<<<<<< + * self._notifier = self.parent.loop.run_callback(self._notify_links) + * + */ + __pyx_t_2 = (__pyx_v_self->_links != Py_None)&&(PyList_GET_SIZE(__pyx_v_self->_links) != 0); + if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_self->_notifier); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 742, __pyx_L1_error) + __pyx_t_3 = ((!__pyx_t_2) != 0); + __pyx_t_1 = __pyx_t_3; + __pyx_L4_bool_binop_done:; + if (__pyx_t_1) { + + /* "src/gevent/greenlet.py":743 + * self.value = result + * if self._links and not self._notifier: + * self._notifier = self.parent.loop.run_callback(self._notify_links) # <<<<<<<<<<<<<< + * + * def _report_error(self, exc_info): + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_parent); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 743, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_loop); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 743, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_run_callback); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 743, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_notify_links); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 743, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5); + if (likely(__pyx_t_7)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_7); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_5, function); + } + } + __pyx_t_4 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_7, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 743, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GIVEREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_v_self->_notifier); + __Pyx_DECREF(__pyx_v_self->_notifier); + __pyx_v_self->_notifier = __pyx_t_4; + __pyx_t_4 = 0; + + /* "src/gevent/greenlet.py":742 + * self._exc_info = (None, None, None) + * self.value = result + * if self._links and not self._notifier: # <<<<<<<<<<<<<< + * self._notifier = self.parent.loop.run_callback(self._notify_links) + * + */ + } + + /* "src/gevent/greenlet.py":739 + * raise + * + * def _report_result(self, result): # <<<<<<<<<<<<<< + * self._exc_info = (None, None, None) + * self.value = result + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("gevent._greenlet.Greenlet._report_result", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/greenlet.py":745 + * self._notifier = self.parent.loop.run_callback(self._notify_links) + * + * def _report_error(self, exc_info): # <<<<<<<<<<<<<< + * if isinstance(exc_info[1], GreenletExit): + * self._report_result(exc_info[1]) + */ + +static PyObject *__pyx_f_6gevent_9_greenlet_8Greenlet__report_error(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self, PyObject *__pyx_v_exc_info) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + int __pyx_t_9; + int __pyx_t_10; + int __pyx_t_11; + char const *__pyx_t_12; + PyObject *__pyx_t_13 = NULL; + PyObject *__pyx_t_14 = NULL; + PyObject *__pyx_t_15 = NULL; + PyObject *__pyx_t_16 = NULL; + PyObject *__pyx_t_17 = NULL; + PyObject *__pyx_t_18 = NULL; + __Pyx_RefNannySetupContext("_report_error", 0); + __Pyx_INCREF(__pyx_v_exc_info); + + /* "src/gevent/greenlet.py":746 + * + * def _report_error(self, exc_info): + * if isinstance(exc_info[1], GreenletExit): # <<<<<<<<<<<<<< + * self._report_result(exc_info[1]) + * return + */ + if (unlikely(__pyx_v_exc_info == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 746, __pyx_L1_error) + } + __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v_exc_info, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 746, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __pyx_v_6gevent_9_greenlet_GreenletExit; + __Pyx_INCREF(__pyx_t_2); + __pyx_t_3 = PyObject_IsInstance(__pyx_t_1, __pyx_t_2); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 746, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_4 = (__pyx_t_3 != 0); + if (__pyx_t_4) { + + /* "src/gevent/greenlet.py":747 + * def _report_error(self, exc_info): + * if isinstance(exc_info[1], GreenletExit): + * self._report_result(exc_info[1]) # <<<<<<<<<<<<<< + * return + * + */ + if (unlikely(__pyx_v_exc_info == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 747, __pyx_L1_error) + } + __pyx_t_2 = __Pyx_GetItemInt_Tuple(__pyx_v_exc_info, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 747, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_9_greenlet_Greenlet *)__pyx_v_self->__pyx_vtab)->_report_result(__pyx_v_self, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 747, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/greenlet.py":748 + * if isinstance(exc_info[1], GreenletExit): + * self._report_result(exc_info[1]) + * return # <<<<<<<<<<<<<< + * + * self._exc_info = exc_info[0], exc_info[1], dump_traceback(exc_info[2]) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + + /* "src/gevent/greenlet.py":746 + * + * def _report_error(self, exc_info): + * if isinstance(exc_info[1], GreenletExit): # <<<<<<<<<<<<<< + * self._report_result(exc_info[1]) + * return + */ + } + + /* "src/gevent/greenlet.py":750 + * return + * + * self._exc_info = exc_info[0], exc_info[1], dump_traceback(exc_info[2]) # <<<<<<<<<<<<<< + * + * if self._links and not self._notifier: + */ + if (unlikely(__pyx_v_exc_info == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 750, __pyx_L1_error) + } + __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v_exc_info, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 750, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (unlikely(__pyx_v_exc_info == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 750, __pyx_L1_error) + } + __pyx_t_2 = __Pyx_GetItemInt_Tuple(__pyx_v_exc_info, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 750, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (unlikely(__pyx_v_exc_info == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 750, __pyx_L1_error) + } + __pyx_t_6 = __Pyx_GetItemInt_Tuple(__pyx_v_exc_info, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 750, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(__pyx_v_6gevent_9_greenlet_dump_traceback); + __pyx_t_7 = __pyx_v_6gevent_9_greenlet_dump_traceback; __pyx_t_8 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) { + __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); + if (likely(__pyx_t_8)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); + __Pyx_INCREF(__pyx_t_8); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_7, function); + } + } + __pyx_t_5 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_8, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6); + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 750, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 750, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_5); + __pyx_t_1 = 0; + __pyx_t_2 = 0; + __pyx_t_5 = 0; + __Pyx_GIVEREF(__pyx_t_7); + __Pyx_GOTREF(__pyx_v_self->_exc_info); + __Pyx_DECREF(__pyx_v_self->_exc_info); + __pyx_v_self->_exc_info = ((PyObject*)__pyx_t_7); + __pyx_t_7 = 0; + + /* "src/gevent/greenlet.py":752 + * self._exc_info = exc_info[0], exc_info[1], dump_traceback(exc_info[2]) + * + * if self._links and not self._notifier: # <<<<<<<<<<<<<< + * self._notifier = self.parent.loop.run_callback(self._notify_links) + * + */ + __pyx_t_3 = (__pyx_v_self->_links != Py_None)&&(PyList_GET_SIZE(__pyx_v_self->_links) != 0); + if (__pyx_t_3) { + } else { + __pyx_t_4 = __pyx_t_3; + goto __pyx_L5_bool_binop_done; + } + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_self->_notifier); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 752, __pyx_L1_error) + __pyx_t_9 = ((!__pyx_t_3) != 0); + __pyx_t_4 = __pyx_t_9; + __pyx_L5_bool_binop_done:; + if (__pyx_t_4) { + + /* "src/gevent/greenlet.py":753 + * + * if self._links and not self._notifier: + * self._notifier = self.parent.loop.run_callback(self._notify_links) # <<<<<<<<<<<<<< + * + * try: + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_parent); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 753, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_loop); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 753, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_run_callback); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 753, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_notify_links); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 753, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_5); + if (likely(__pyx_t_1)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_1); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_5, function); + } + } + __pyx_t_7 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_1, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_2); + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 753, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GIVEREF(__pyx_t_7); + __Pyx_GOTREF(__pyx_v_self->_notifier); + __Pyx_DECREF(__pyx_v_self->_notifier); + __pyx_v_self->_notifier = __pyx_t_7; + __pyx_t_7 = 0; + + /* "src/gevent/greenlet.py":752 + * self._exc_info = exc_info[0], exc_info[1], dump_traceback(exc_info[2]) + * + * if self._links and not self._notifier: # <<<<<<<<<<<<<< + * self._notifier = self.parent.loop.run_callback(self._notify_links) + * + */ + } + + /* "src/gevent/greenlet.py":755 + * self._notifier = self.parent.loop.run_callback(self._notify_links) + * + * try: # <<<<<<<<<<<<<< + * self.parent.handle_error(self, *exc_info) + * finally: + */ + /*try:*/ { + + /* "src/gevent/greenlet.py":756 + * + * try: + * self.parent.handle_error(self, *exc_info) # <<<<<<<<<<<<<< + * finally: + * del exc_info + */ + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_parent); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 756, __pyx_L8_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_handle_error); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 756, __pyx_L8_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 756, __pyx_L8_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)__pyx_v_self)); + if (unlikely(__pyx_v_exc_info == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); + __PYX_ERR(0, 756, __pyx_L8_error) + } + __pyx_t_2 = PyNumber_Add(__pyx_t_7, __pyx_v_exc_info); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 756, __pyx_L8_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_2, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 756, __pyx_L8_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } + + /* "src/gevent/greenlet.py":758 + * self.parent.handle_error(self, *exc_info) + * finally: + * del exc_info # <<<<<<<<<<<<<< + * + * def run(self): + */ + /*finally:*/ { + /*normal exit:*/{ + __Pyx_DECREF(__pyx_v_exc_info); + __pyx_v_exc_info = NULL; + goto __pyx_L9; + } + __pyx_L8_error:; + /*exception exit:*/{ + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18); + if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15) < 0)) __Pyx_ErrFetch(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15); + __Pyx_XGOTREF(__pyx_t_13); + __Pyx_XGOTREF(__pyx_t_14); + __Pyx_XGOTREF(__pyx_t_15); + __Pyx_XGOTREF(__pyx_t_16); + __Pyx_XGOTREF(__pyx_t_17); + __Pyx_XGOTREF(__pyx_t_18); + __pyx_t_10 = __pyx_lineno; __pyx_t_11 = __pyx_clineno; __pyx_t_12 = __pyx_filename; + { + __Pyx_DECREF(__pyx_v_exc_info); + __pyx_v_exc_info = NULL; + } + if (PY_MAJOR_VERSION >= 3) { + __Pyx_XGIVEREF(__pyx_t_16); + __Pyx_XGIVEREF(__pyx_t_17); + __Pyx_XGIVEREF(__pyx_t_18); + __Pyx_ExceptionReset(__pyx_t_16, __pyx_t_17, __pyx_t_18); + } + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_XGIVEREF(__pyx_t_15); + __Pyx_ErrRestore(__pyx_t_13, __pyx_t_14, __pyx_t_15); + __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; + __pyx_lineno = __pyx_t_10; __pyx_clineno = __pyx_t_11; __pyx_filename = __pyx_t_12; + goto __pyx_L1_error; + } + __pyx_L9:; + } + + /* "src/gevent/greenlet.py":745 + * self._notifier = self.parent.loop.run_callback(self._notify_links) + * + * def _report_error(self, exc_info): # <<<<<<<<<<<<<< + * if isinstance(exc_info[1], GreenletExit): + * self._report_result(exc_info[1]) + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("gevent._greenlet.Greenlet._report_error", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_exc_info); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/greenlet.py":760 + * del exc_info + * + * def run(self): # <<<<<<<<<<<<<< + * try: + * self.__cancel_start() + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_39run(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6gevent_9_greenlet_8Greenlet_38run[] = "Greenlet.run(self)"; +static PyMethodDef __pyx_mdef_6gevent_9_greenlet_8Greenlet_39run = {"run", (PyCFunction)__pyx_pw_6gevent_9_greenlet_8Greenlet_39run, METH_NOARGS, __pyx_doc_6gevent_9_greenlet_8Greenlet_38run}; +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_39run(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("run (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_9_greenlet_8Greenlet_38run(((struct __pyx_obj_6gevent_9_greenlet_Greenlet *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_38run(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self) { + PyObject *__pyx_v_result = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + int __pyx_t_10; + int __pyx_t_11; + int __pyx_t_12; + char const *__pyx_t_13; + PyObject *__pyx_t_14 = NULL; + PyObject *__pyx_t_15 = NULL; + PyObject *__pyx_t_16 = NULL; + __Pyx_RefNannySetupContext("run", 0); + + /* "src/gevent/greenlet.py":761 + * + * def run(self): + * try: # <<<<<<<<<<<<<< + * self.__cancel_start() + * self._start_event = _start_completed_event + */ + /*try:*/ { + + /* "src/gevent/greenlet.py":762 + * def run(self): + * try: + * self.__cancel_start() # <<<<<<<<<<<<<< + * self._start_event = _start_completed_event + * + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_9_greenlet_Greenlet *)__pyx_v_self->__pyx_vtab)->__pyx___cancel_start(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 762, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/greenlet.py":763 + * try: + * self.__cancel_start() + * self._start_event = _start_completed_event # <<<<<<<<<<<<<< + * + * try: + */ + __Pyx_INCREF(((PyObject *)__pyx_v_6gevent_9_greenlet__start_completed_event)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_6gevent_9_greenlet__start_completed_event)); + __Pyx_GOTREF(__pyx_v_self->_start_event); + __Pyx_DECREF(__pyx_v_self->_start_event); + __pyx_v_self->_start_event = ((PyObject *)__pyx_v_6gevent_9_greenlet__start_completed_event); + + /* "src/gevent/greenlet.py":765 + * self._start_event = _start_completed_event + * + * try: # <<<<<<<<<<<<<< + * result = self._run(*self.args, **self.kwargs) + * except: # pylint:disable=bare-except + */ + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_4); + /*try:*/ { + + /* "src/gevent/greenlet.py":766 + * + * try: + * result = self._run(*self.args, **self.kwargs) # <<<<<<<<<<<<<< + * except: # pylint:disable=bare-except + * self._report_error(sys_exc_info()) + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_run_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 766, __pyx_L6_error) + __Pyx_GOTREF(__pyx_t_1); + if (unlikely(__pyx_v_self->args == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); + __PYX_ERR(0, 766, __pyx_L6_error) + } + if (unlikely(__pyx_v_self->kwargs == Py_None)) { + PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); + __PYX_ERR(0, 766, __pyx_L6_error) + } + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_v_self->args, __pyx_v_self->kwargs); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 766, __pyx_L6_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_result = __pyx_t_5; + __pyx_t_5 = 0; + + /* "src/gevent/greenlet.py":765 + * self._start_event = _start_completed_event + * + * try: # <<<<<<<<<<<<<< + * result = self._run(*self.args, **self.kwargs) + * except: # pylint:disable=bare-except + */ + } + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L11_try_end; + __pyx_L6_error:; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "src/gevent/greenlet.py":767 + * try: + * result = self._run(*self.args, **self.kwargs) + * except: # pylint:disable=bare-except # <<<<<<<<<<<<<< + * self._report_error(sys_exc_info()) + * return + */ + /*except:*/ { + __Pyx_AddTraceback("gevent._greenlet.Greenlet.run", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_1, &__pyx_t_6) < 0) __PYX_ERR(0, 767, __pyx_L8_except_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_t_6); + + /* "src/gevent/greenlet.py":768 + * result = self._run(*self.args, **self.kwargs) + * except: # pylint:disable=bare-except + * self._report_error(sys_exc_info()) # <<<<<<<<<<<<<< + * return + * self._report_result(result) + */ + __Pyx_INCREF(__pyx_v_6gevent_9_greenlet_sys_exc_info); + __pyx_t_8 = __pyx_v_6gevent_9_greenlet_sys_exc_info; __pyx_t_9 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) { + __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8); + if (likely(__pyx_t_9)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); + __Pyx_INCREF(__pyx_t_9); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_8, function); + } + } + __pyx_t_7 = (__pyx_t_9) ? __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_9) : __Pyx_PyObject_CallNoArg(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 768, __pyx_L8_except_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (!(likely(PyTuple_CheckExact(__pyx_t_7))||((__pyx_t_7) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_7)->tp_name), 0))) __PYX_ERR(0, 768, __pyx_L8_except_error) + __pyx_t_8 = ((struct __pyx_vtabstruct_6gevent_9_greenlet_Greenlet *)__pyx_v_self->__pyx_vtab)->_report_error(__pyx_v_self, ((PyObject*)__pyx_t_7)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 768, __pyx_L8_except_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + + /* "src/gevent/greenlet.py":769 + * except: # pylint:disable=bare-except + * self._report_error(sys_exc_info()) + * return # <<<<<<<<<<<<<< + * self._report_result(result) + * finally: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L9_except_return; + } + __pyx_L8_except_error:; + + /* "src/gevent/greenlet.py":765 + * self._start_event = _start_completed_event + * + * try: # <<<<<<<<<<<<<< + * result = self._run(*self.args, **self.kwargs) + * except: # pylint:disable=bare-except + */ + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4); + goto __pyx_L4_error; + __pyx_L9_except_return:; + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4); + goto __pyx_L3_return; + __pyx_L11_try_end:; + } + + /* "src/gevent/greenlet.py":770 + * self._report_error(sys_exc_info()) + * return + * self._report_result(result) # <<<<<<<<<<<<<< + * finally: + * self.__dict__.pop('_run', None) + */ + __pyx_t_6 = ((struct __pyx_vtabstruct_6gevent_9_greenlet_Greenlet *)__pyx_v_self->__pyx_vtab)->_report_result(__pyx_v_self, __pyx_v_result); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 770, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + + /* "src/gevent/greenlet.py":772 + * self._report_result(result) + * finally: + * self.__dict__.pop('_run', None) # <<<<<<<<<<<<<< + * self.args = () + * self.kwargs.clear() + */ + /*finally:*/ { + /*normal exit:*/{ + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_dict); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 772, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_pop); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 772, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 772, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "src/gevent/greenlet.py":773 + * finally: + * self.__dict__.pop('_run', None) + * self.args = () # <<<<<<<<<<<<<< + * self.kwargs.clear() + * + */ + __Pyx_INCREF(__pyx_empty_tuple); + __Pyx_GIVEREF(__pyx_empty_tuple); + __Pyx_GOTREF(__pyx_v_self->args); + __Pyx_DECREF(__pyx_v_self->args); + __pyx_v_self->args = __pyx_empty_tuple; + + /* "src/gevent/greenlet.py":774 + * self.__dict__.pop('_run', None) + * self.args = () + * self.kwargs.clear() # <<<<<<<<<<<<<< + * + * def _run(self): + */ + if (unlikely(__pyx_v_self->kwargs == Py_None)) { + PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "clear"); + __PYX_ERR(0, 774, __pyx_L1_error) + } + __pyx_t_10 = __Pyx_PyDict_Clear(__pyx_v_self->kwargs); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(0, 774, __pyx_L1_error) + goto __pyx_L5; + } + __pyx_L4_error:; + /*exception exit:*/{ + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __pyx_t_4 = 0; __pyx_t_3 = 0; __pyx_t_2 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_14, &__pyx_t_15, &__pyx_t_16); + if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_4, &__pyx_t_3, &__pyx_t_2) < 0)) __Pyx_ErrFetch(&__pyx_t_4, &__pyx_t_3, &__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_4); + __Pyx_XGOTREF(__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_14); + __Pyx_XGOTREF(__pyx_t_15); + __Pyx_XGOTREF(__pyx_t_16); + __pyx_t_11 = __pyx_lineno; __pyx_t_12 = __pyx_clineno; __pyx_t_13 = __pyx_filename; + { + + /* "src/gevent/greenlet.py":772 + * self._report_result(result) + * finally: + * self.__dict__.pop('_run', None) # <<<<<<<<<<<<<< + * self.args = () + * self.kwargs.clear() + */ + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_dict); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 772, __pyx_L15_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_pop); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 772, __pyx_L15_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 772, __pyx_L15_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "src/gevent/greenlet.py":773 + * finally: + * self.__dict__.pop('_run', None) + * self.args = () # <<<<<<<<<<<<<< + * self.kwargs.clear() + * + */ + __Pyx_INCREF(__pyx_empty_tuple); + __Pyx_GIVEREF(__pyx_empty_tuple); + __Pyx_GOTREF(__pyx_v_self->args); + __Pyx_DECREF(__pyx_v_self->args); + __pyx_v_self->args = __pyx_empty_tuple; + + /* "src/gevent/greenlet.py":774 + * self.__dict__.pop('_run', None) + * self.args = () + * self.kwargs.clear() # <<<<<<<<<<<<<< + * + * def _run(self): + */ + if (unlikely(__pyx_v_self->kwargs == Py_None)) { + PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "clear"); + __PYX_ERR(0, 774, __pyx_L15_error) + } + __pyx_t_10 = __Pyx_PyDict_Clear(__pyx_v_self->kwargs); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(0, 774, __pyx_L15_error) + } + if (PY_MAJOR_VERSION >= 3) { + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_XGIVEREF(__pyx_t_15); + __Pyx_XGIVEREF(__pyx_t_16); + __Pyx_ExceptionReset(__pyx_t_14, __pyx_t_15, __pyx_t_16); + } + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_ErrRestore(__pyx_t_4, __pyx_t_3, __pyx_t_2); + __pyx_t_4 = 0; __pyx_t_3 = 0; __pyx_t_2 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; + __pyx_lineno = __pyx_t_11; __pyx_clineno = __pyx_t_12; __pyx_filename = __pyx_t_13; + goto __pyx_L1_error; + __pyx_L15_error:; + if (PY_MAJOR_VERSION >= 3) { + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_XGIVEREF(__pyx_t_15); + __Pyx_XGIVEREF(__pyx_t_16); + __Pyx_ExceptionReset(__pyx_t_14, __pyx_t_15, __pyx_t_16); + } + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; + goto __pyx_L1_error; + } + __pyx_L3_return: { + __pyx_t_16 = __pyx_r; + __pyx_r = 0; + + /* "src/gevent/greenlet.py":772 + * self._report_result(result) + * finally: + * self.__dict__.pop('_run', None) # <<<<<<<<<<<<<< + * self.args = () + * self.kwargs.clear() + */ + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_dict); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 772, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_pop); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 772, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 772, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "src/gevent/greenlet.py":773 + * finally: + * self.__dict__.pop('_run', None) + * self.args = () # <<<<<<<<<<<<<< + * self.kwargs.clear() + * + */ + __Pyx_INCREF(__pyx_empty_tuple); + __Pyx_GIVEREF(__pyx_empty_tuple); + __Pyx_GOTREF(__pyx_v_self->args); + __Pyx_DECREF(__pyx_v_self->args); + __pyx_v_self->args = __pyx_empty_tuple; + + /* "src/gevent/greenlet.py":774 + * self.__dict__.pop('_run', None) + * self.args = () + * self.kwargs.clear() # <<<<<<<<<<<<<< + * + * def _run(self): + */ + if (unlikely(__pyx_v_self->kwargs == Py_None)) { + PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "clear"); + __PYX_ERR(0, 774, __pyx_L1_error) + } + __pyx_t_10 = __Pyx_PyDict_Clear(__pyx_v_self->kwargs); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(0, 774, __pyx_L1_error) + __pyx_r = __pyx_t_16; + __pyx_t_16 = 0; + goto __pyx_L0; + } + __pyx_L5:; + } + + /* "src/gevent/greenlet.py":760 + * del exc_info + * + * def run(self): # <<<<<<<<<<<<<< + * try: + * self.__cancel_start() + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_AddTraceback("gevent._greenlet.Greenlet.run", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/greenlet.py":776 + * self.kwargs.clear() + * + * def _run(self): # <<<<<<<<<<<<<< + * """ + * Subclasses may override this method to take any number of + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_41_run(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6gevent_9_greenlet_8Greenlet_40_run[] = "Greenlet._run(self)\n\n Subclasses may override this method to take any number of\n arguments and keyword arguments.\n\n .. versionadded:: 1.1a3\n Previously, if no callable object was\n passed to the constructor, the spawned greenlet would later\n fail with an AttributeError.\n "; +static PyMethodDef __pyx_mdef_6gevent_9_greenlet_8Greenlet_41_run = {"_run", (PyCFunction)__pyx_pw_6gevent_9_greenlet_8Greenlet_41_run, METH_NOARGS, __pyx_doc_6gevent_9_greenlet_8Greenlet_40_run}; +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_41_run(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_run (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_9_greenlet_8Greenlet_40_run(((struct __pyx_obj_6gevent_9_greenlet_Greenlet *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_40_run(CYTHON_UNUSED struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_run", 0); + + /* "src/gevent/greenlet.py":788 + * # We usually override this in __init__ + * # pylint: disable=method-hidden + * return # <<<<<<<<<<<<<< + * + * def has_links(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + + /* "src/gevent/greenlet.py":776 + * self.kwargs.clear() + * + * def _run(self): # <<<<<<<<<<<<<< + * """ + * Subclasses may override this method to take any number of + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/greenlet.py":790 + * return + * + * def has_links(self): # <<<<<<<<<<<<<< + * return len(self._links) + * + */ + +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_43has_links(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static int __pyx_f_6gevent_9_greenlet_8Greenlet_has_links(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self, int __pyx_skip_dispatch) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + Py_ssize_t __pyx_t_6; + __Pyx_RefNannySetupContext("has_links", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0; + if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self)))))); + else { + PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + #endif + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_has_links); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 790, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_9_greenlet_8Greenlet_43has_links)) { + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 790, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 790, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_5; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0; + if (unlikely(type_dict_guard != tp_dict_version)) { + tp_dict_version = obj_dict_version = 0; + } + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + } + #endif + } + + /* "src/gevent/greenlet.py":791 + * + * def has_links(self): + * return len(self._links) # <<<<<<<<<<<<<< + * + * def rawlink(self, callback): + */ + __pyx_t_1 = __pyx_v_self->_links; + __Pyx_INCREF(__pyx_t_1); + if (unlikely(__pyx_t_1 == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + __PYX_ERR(0, 791, __pyx_L1_error) + } + __pyx_t_6 = PyList_GET_SIZE(__pyx_t_1); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 791, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_6; + goto __pyx_L0; + + /* "src/gevent/greenlet.py":790 + * return + * + * def has_links(self): # <<<<<<<<<<<<<< + * return len(self._links) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_WriteUnraisable("gevent._greenlet.Greenlet.has_links", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_43has_links(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6gevent_9_greenlet_8Greenlet_42has_links[] = "Greenlet.has_links(self) -> bool"; +static PyMethodDef __pyx_mdef_6gevent_9_greenlet_8Greenlet_43has_links = {"has_links", (PyCFunction)__pyx_pw_6gevent_9_greenlet_8Greenlet_43has_links, METH_NOARGS, __pyx_doc_6gevent_9_greenlet_8Greenlet_42has_links}; +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_43has_links(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("has_links (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_9_greenlet_8Greenlet_42has_links(((struct __pyx_obj_6gevent_9_greenlet_Greenlet *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_42has_links(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("has_links", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_f_6gevent_9_greenlet_8Greenlet_has_links(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 790, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent._greenlet.Greenlet.has_links", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/greenlet.py":793 + * return len(self._links) + * + * def rawlink(self, callback): # <<<<<<<<<<<<<< + * """ + * Register a callable to be executed when the greenlet finishes + */ + +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_45rawlink(PyObject *__pyx_v_self, PyObject *__pyx_v_callback); /*proto*/ +static PyObject *__pyx_f_6gevent_9_greenlet_8Greenlet_rawlink(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self, PyObject *__pyx_v_callback, int __pyx_skip_dispatch) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + int __pyx_t_6; + int __pyx_t_7; + int __pyx_t_8; + __Pyx_RefNannySetupContext("rawlink", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0; + if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self)))))); + else { + PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + #endif + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_rawlink); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 793, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_9_greenlet_8Greenlet_45rawlink)) { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_callback) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_callback); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 793, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0; + if (unlikely(type_dict_guard != tp_dict_version)) { + tp_dict_version = obj_dict_version = 0; + } + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + } + #endif + } + + /* "src/gevent/greenlet.py":803 + * .. caution:: The callable will be called in the HUB greenlet. + * """ + * if not callable(callback): # <<<<<<<<<<<<<< + * raise TypeError('Expected callable: %r' % (callback, )) + * self._links.append(callback) # pylint:disable=no-member + */ + __pyx_t_5 = __Pyx_PyCallable_Check(__pyx_v_callback); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 803, __pyx_L1_error) + __pyx_t_6 = ((!(__pyx_t_5 != 0)) != 0); + if (unlikely(__pyx_t_6)) { + + /* "src/gevent/greenlet.py":804 + * """ + * if not callable(callback): + * raise TypeError('Expected callable: %r' % (callback, )) # <<<<<<<<<<<<<< + * self._links.append(callback) # pylint:disable=no-member + * if self.ready() and self._links and not self._notifier: + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 804, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_callback); + __Pyx_GIVEREF(__pyx_v_callback); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_callback); + __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_Expected_callable_r, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 804, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 804, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 804, __pyx_L1_error) + + /* "src/gevent/greenlet.py":803 + * .. caution:: The callable will be called in the HUB greenlet. + * """ + * if not callable(callback): # <<<<<<<<<<<<<< + * raise TypeError('Expected callable: %r' % (callback, )) + * self._links.append(callback) # pylint:disable=no-member + */ + } + + /* "src/gevent/greenlet.py":805 + * if not callable(callback): + * raise TypeError('Expected callable: %r' % (callback, )) + * self._links.append(callback) # pylint:disable=no-member # <<<<<<<<<<<<<< + * if self.ready() and self._links and not self._notifier: + * self._notifier = self.parent.loop.run_callback(self._notify_links) + */ + if (unlikely(__pyx_v_self->_links == Py_None)) { + PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "append"); + __PYX_ERR(0, 805, __pyx_L1_error) + } + __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_self->_links, __pyx_v_callback); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 805, __pyx_L1_error) + + /* "src/gevent/greenlet.py":806 + * raise TypeError('Expected callable: %r' % (callback, )) + * self._links.append(callback) # pylint:disable=no-member + * if self.ready() and self._links and not self._notifier: # <<<<<<<<<<<<<< + * self._notifier = self.parent.loop.run_callback(self._notify_links) + * + */ + __pyx_t_5 = (((struct __pyx_vtabstruct_6gevent_9_greenlet_Greenlet *)__pyx_v_self->__pyx_vtab)->ready(__pyx_v_self, 0) != 0); + if (__pyx_t_5) { + } else { + __pyx_t_6 = __pyx_t_5; + goto __pyx_L5_bool_binop_done; + } + __pyx_t_5 = (__pyx_v_self->_links != Py_None)&&(PyList_GET_SIZE(__pyx_v_self->_links) != 0); + if (__pyx_t_5) { + } else { + __pyx_t_6 = __pyx_t_5; + goto __pyx_L5_bool_binop_done; + } + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_self->_notifier); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 806, __pyx_L1_error) + __pyx_t_8 = ((!__pyx_t_5) != 0); + __pyx_t_6 = __pyx_t_8; + __pyx_L5_bool_binop_done:; + if (__pyx_t_6) { + + /* "src/gevent/greenlet.py":807 + * self._links.append(callback) # pylint:disable=no-member + * if self.ready() and self._links and not self._notifier: + * self._notifier = self.parent.loop.run_callback(self._notify_links) # <<<<<<<<<<<<<< + * + * def link(self, callback, SpawnedLink=SpawnedLink): + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_parent); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 807, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_loop); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 807, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_run_callback); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 807, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_notify_links); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 807, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 807, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_self->_notifier); + __Pyx_DECREF(__pyx_v_self->_notifier); + __pyx_v_self->_notifier = __pyx_t_1; + __pyx_t_1 = 0; + + /* "src/gevent/greenlet.py":806 + * raise TypeError('Expected callable: %r' % (callback, )) + * self._links.append(callback) # pylint:disable=no-member + * if self.ready() and self._links and not self._notifier: # <<<<<<<<<<<<<< + * self._notifier = self.parent.loop.run_callback(self._notify_links) + * + */ + } + + /* "src/gevent/greenlet.py":793 + * return len(self._links) + * + * def rawlink(self, callback): # <<<<<<<<<<<<<< + * """ + * Register a callable to be executed when the greenlet finishes + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("gevent._greenlet.Greenlet.rawlink", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_45rawlink(PyObject *__pyx_v_self, PyObject *__pyx_v_callback); /*proto*/ +static char __pyx_doc_6gevent_9_greenlet_8Greenlet_44rawlink[] = "Greenlet.rawlink(self, callback)\n\n Register a callable to be executed when the greenlet finishes\n execution.\n\n The *callback* will be called with this instance as an\n argument.\n\n .. caution:: The callable will be called in the HUB greenlet.\n "; +static PyMethodDef __pyx_mdef_6gevent_9_greenlet_8Greenlet_45rawlink = {"rawlink", (PyCFunction)__pyx_pw_6gevent_9_greenlet_8Greenlet_45rawlink, METH_O, __pyx_doc_6gevent_9_greenlet_8Greenlet_44rawlink}; +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_45rawlink(PyObject *__pyx_v_self, PyObject *__pyx_v_callback) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("rawlink (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_9_greenlet_8Greenlet_44rawlink(((struct __pyx_obj_6gevent_9_greenlet_Greenlet *)__pyx_v_self), ((PyObject *)__pyx_v_callback)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_44rawlink(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self, PyObject *__pyx_v_callback) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("rawlink", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6gevent_9_greenlet_8Greenlet_rawlink(__pyx_v_self, __pyx_v_callback, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 793, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent._greenlet.Greenlet.rawlink", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/greenlet.py":809 + * self._notifier = self.parent.loop.run_callback(self._notify_links) + * + * def link(self, callback, SpawnedLink=SpawnedLink): # <<<<<<<<<<<<<< + * """ + * Link greenlet's completion to a callable. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_47link(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6gevent_9_greenlet_8Greenlet_46link[] = "Greenlet.link(self, callback, SpawnedLink=SpawnedLink)\n\n Link greenlet's completion to a callable.\n\n The *callback* will be called with this instance as an\n argument once this greenlet is dead. A callable is called in\n its own :class:`greenlet.greenlet` (*not* a\n :class:`Greenlet`).\n "; +static PyMethodDef __pyx_mdef_6gevent_9_greenlet_8Greenlet_47link = {"link", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_9_greenlet_8Greenlet_47link, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_9_greenlet_8Greenlet_46link}; +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_47link(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_callback = 0; + PyObject *__pyx_v_SpawnedLink = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("link (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_callback,&__pyx_n_s_SpawnedLink,0}; + PyObject* values[2] = {0,0}; + values[1] = __pyx_k__13; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_callback)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_SpawnedLink); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "link") < 0)) __PYX_ERR(0, 809, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_callback = values[0]; + __pyx_v_SpawnedLink = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("link", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 809, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent._greenlet.Greenlet.link", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_9_greenlet_8Greenlet_46link(((struct __pyx_obj_6gevent_9_greenlet_Greenlet *)__pyx_v_self), __pyx_v_callback, __pyx_v_SpawnedLink); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_46link(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self, PyObject *__pyx_v_callback, PyObject *__pyx_v_SpawnedLink) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("link", 0); + + /* "src/gevent/greenlet.py":821 + * # optimization, or do people use it? It's not documented + * # pylint:disable=redefined-outer-name + * self.rawlink(SpawnedLink(callback)) # <<<<<<<<<<<<<< + * + * def unlink(self, callback): + */ + __Pyx_INCREF(__pyx_v_SpawnedLink); + __pyx_t_2 = __pyx_v_SpawnedLink; __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_callback) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_callback); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 821, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = ((struct __pyx_vtabstruct_6gevent_9_greenlet_Greenlet *)__pyx_v_self->__pyx_vtab)->rawlink(__pyx_v_self, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 821, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/greenlet.py":809 + * self._notifier = self.parent.loop.run_callback(self._notify_links) + * + * def link(self, callback, SpawnedLink=SpawnedLink): # <<<<<<<<<<<<<< + * """ + * Link greenlet's completion to a callable. + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("gevent._greenlet.Greenlet.link", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/greenlet.py":823 + * self.rawlink(SpawnedLink(callback)) + * + * def unlink(self, callback): # <<<<<<<<<<<<<< + * """Remove the callback set by :meth:`link` or :meth:`rawlink`""" + * try: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_49unlink(PyObject *__pyx_v_self, PyObject *__pyx_v_callback); /*proto*/ +static char __pyx_doc_6gevent_9_greenlet_8Greenlet_48unlink[] = "Greenlet.unlink(self, callback)\nRemove the callback set by :meth:`link` or :meth:`rawlink`"; +static PyMethodDef __pyx_mdef_6gevent_9_greenlet_8Greenlet_49unlink = {"unlink", (PyCFunction)__pyx_pw_6gevent_9_greenlet_8Greenlet_49unlink, METH_O, __pyx_doc_6gevent_9_greenlet_8Greenlet_48unlink}; +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_49unlink(PyObject *__pyx_v_self, PyObject *__pyx_v_callback) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("unlink (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_9_greenlet_8Greenlet_48unlink(((struct __pyx_obj_6gevent_9_greenlet_Greenlet *)__pyx_v_self), ((PyObject *)__pyx_v_callback)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_48unlink(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self, PyObject *__pyx_v_callback) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + __Pyx_RefNannySetupContext("unlink", 0); + + /* "src/gevent/greenlet.py":825 + * def unlink(self, callback): + * """Remove the callback set by :meth:`link` or :meth:`rawlink`""" + * try: # <<<<<<<<<<<<<< + * self._links.remove(callback) # pylint:disable=no-member + * except ValueError: + */ + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "src/gevent/greenlet.py":826 + * """Remove the callback set by :meth:`link` or :meth:`rawlink`""" + * try: + * self._links.remove(callback) # pylint:disable=no-member # <<<<<<<<<<<<<< + * except ValueError: + * pass + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_links, __pyx_n_s_remove); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 826, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); + if (likely(__pyx_t_6)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_5, function); + } + } + __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_v_callback) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_callback); + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 826, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "src/gevent/greenlet.py":825 + * def unlink(self, callback): + * """Remove the callback set by :meth:`link` or :meth:`rawlink`""" + * try: # <<<<<<<<<<<<<< + * self._links.remove(callback) # pylint:disable=no-member + * except ValueError: + */ + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L8_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "src/gevent/greenlet.py":827 + * try: + * self._links.remove(callback) # pylint:disable=no-member + * except ValueError: # <<<<<<<<<<<<<< + * pass + * + */ + __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ValueError); + if (__pyx_t_7) { + __Pyx_ErrRestore(0,0,0); + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + + /* "src/gevent/greenlet.py":825 + * def unlink(self, callback): + * """Remove the callback set by :meth:`link` or :meth:`rawlink`""" + * try: # <<<<<<<<<<<<<< + * self._links.remove(callback) # pylint:disable=no-member + * except ValueError: + */ + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L8_try_end:; + } + + /* "src/gevent/greenlet.py":823 + * self.rawlink(SpawnedLink(callback)) + * + * def unlink(self, callback): # <<<<<<<<<<<<<< + * """Remove the callback set by :meth:`link` or :meth:`rawlink`""" + * try: + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("gevent._greenlet.Greenlet.unlink", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/greenlet.py":830 + * pass + * + * def unlink_all(self): # <<<<<<<<<<<<<< + * """ + * Remove all the callbacks. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_51unlink_all(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6gevent_9_greenlet_8Greenlet_50unlink_all[] = "Greenlet.unlink_all(self)\n\n Remove all the callbacks.\n\n .. versionadded:: 1.3a2\n "; +static PyMethodDef __pyx_mdef_6gevent_9_greenlet_8Greenlet_51unlink_all = {"unlink_all", (PyCFunction)__pyx_pw_6gevent_9_greenlet_8Greenlet_51unlink_all, METH_NOARGS, __pyx_doc_6gevent_9_greenlet_8Greenlet_50unlink_all}; +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_51unlink_all(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("unlink_all (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_9_greenlet_8Greenlet_50unlink_all(((struct __pyx_obj_6gevent_9_greenlet_Greenlet *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_50unlink_all(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("unlink_all", 0); + + /* "src/gevent/greenlet.py":836 + * .. versionadded:: 1.3a2 + * """ + * del self._links[:] # <<<<<<<<<<<<<< + * + * def link_value(self, callback, SpawnedLink=SuccessSpawnedLink): + */ + if (unlikely(__pyx_v_self->_links == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 836, __pyx_L1_error) + } + if (__Pyx_PyObject_DelSlice(__pyx_v_self->_links, 0, 0, NULL, NULL, NULL, 0, 0, 1) < 0) __PYX_ERR(0, 836, __pyx_L1_error) + + /* "src/gevent/greenlet.py":830 + * pass + * + * def unlink_all(self): # <<<<<<<<<<<<<< + * """ + * Remove all the callbacks. + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("gevent._greenlet.Greenlet.unlink_all", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/greenlet.py":838 + * del self._links[:] + * + * def link_value(self, callback, SpawnedLink=SuccessSpawnedLink): # <<<<<<<<<<<<<< + * """ + * Like :meth:`link` but *callback* is only notified when the greenlet + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_53link_value(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6gevent_9_greenlet_8Greenlet_52link_value[] = "Greenlet.link_value(self, callback, SpawnedLink=SuccessSpawnedLink)\n\n Like :meth:`link` but *callback* is only notified when the greenlet\n has completed successfully.\n "; +static PyMethodDef __pyx_mdef_6gevent_9_greenlet_8Greenlet_53link_value = {"link_value", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_9_greenlet_8Greenlet_53link_value, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_9_greenlet_8Greenlet_52link_value}; +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_53link_value(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_callback = 0; + PyObject *__pyx_v_SpawnedLink = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("link_value (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_callback,&__pyx_n_s_SpawnedLink,0}; + PyObject* values[2] = {0,0}; + values[1] = __pyx_k__14; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_callback)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_SpawnedLink); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "link_value") < 0)) __PYX_ERR(0, 838, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_callback = values[0]; + __pyx_v_SpawnedLink = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("link_value", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 838, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent._greenlet.Greenlet.link_value", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_9_greenlet_8Greenlet_52link_value(((struct __pyx_obj_6gevent_9_greenlet_Greenlet *)__pyx_v_self), __pyx_v_callback, __pyx_v_SpawnedLink); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_52link_value(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self, PyObject *__pyx_v_callback, PyObject *__pyx_v_SpawnedLink) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + __Pyx_RefNannySetupContext("link_value", 0); + + /* "src/gevent/greenlet.py":844 + * """ + * # pylint:disable=redefined-outer-name + * self.link(callback, SpawnedLink=SpawnedLink) # <<<<<<<<<<<<<< + * + * def link_exception(self, callback, SpawnedLink=FailureSpawnedLink): + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_link); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 844, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 844, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_callback); + __Pyx_GIVEREF(__pyx_v_callback); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_callback); + __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 844, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_SpawnedLink, __pyx_v_SpawnedLink) < 0) __PYX_ERR(0, 844, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 844, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "src/gevent/greenlet.py":838 + * del self._links[:] + * + * def link_value(self, callback, SpawnedLink=SuccessSpawnedLink): # <<<<<<<<<<<<<< + * """ + * Like :meth:`link` but *callback* is only notified when the greenlet + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("gevent._greenlet.Greenlet.link_value", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/greenlet.py":846 + * self.link(callback, SpawnedLink=SpawnedLink) + * + * def link_exception(self, callback, SpawnedLink=FailureSpawnedLink): # <<<<<<<<<<<<<< + * """ + * Like :meth:`link` but *callback* is only notified when the + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_55link_exception(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6gevent_9_greenlet_8Greenlet_54link_exception[] = "Greenlet.link_exception(self, callback, SpawnedLink=FailureSpawnedLink)\n\n Like :meth:`link` but *callback* is only notified when the\n greenlet dies because of an unhandled exception.\n "; +static PyMethodDef __pyx_mdef_6gevent_9_greenlet_8Greenlet_55link_exception = {"link_exception", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_9_greenlet_8Greenlet_55link_exception, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_9_greenlet_8Greenlet_54link_exception}; +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_55link_exception(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_callback = 0; + PyObject *__pyx_v_SpawnedLink = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("link_exception (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_callback,&__pyx_n_s_SpawnedLink,0}; + PyObject* values[2] = {0,0}; + values[1] = __pyx_k__15; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_callback)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_SpawnedLink); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "link_exception") < 0)) __PYX_ERR(0, 846, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_callback = values[0]; + __pyx_v_SpawnedLink = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("link_exception", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 846, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent._greenlet.Greenlet.link_exception", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_9_greenlet_8Greenlet_54link_exception(((struct __pyx_obj_6gevent_9_greenlet_Greenlet *)__pyx_v_self), __pyx_v_callback, __pyx_v_SpawnedLink); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_54link_exception(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self, PyObject *__pyx_v_callback, PyObject *__pyx_v_SpawnedLink) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + __Pyx_RefNannySetupContext("link_exception", 0); + + /* "src/gevent/greenlet.py":852 + * """ + * # pylint:disable=redefined-outer-name + * self.link(callback, SpawnedLink=SpawnedLink) # <<<<<<<<<<<<<< + * + * def _notify_links(self): + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_link); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 852, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 852, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_callback); + __Pyx_GIVEREF(__pyx_v_callback); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_callback); + __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 852, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_SpawnedLink, __pyx_v_SpawnedLink) < 0) __PYX_ERR(0, 852, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 852, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "src/gevent/greenlet.py":846 + * self.link(callback, SpawnedLink=SpawnedLink) + * + * def link_exception(self, callback, SpawnedLink=FailureSpawnedLink): # <<<<<<<<<<<<<< + * """ + * Like :meth:`link` but *callback* is only notified when the + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("gevent._greenlet.Greenlet.link_exception", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/greenlet.py":854 + * self.link(callback, SpawnedLink=SpawnedLink) + * + * def _notify_links(self): # <<<<<<<<<<<<<< + * while self._links: + * # Early links are allowed to remove later links + */ + +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_57_notify_links(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_f_6gevent_9_greenlet_8Greenlet__notify_links(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self, int __pyx_skip_dispatch) { + PyObject *__pyx_v_link = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + __Pyx_RefNannySetupContext("_notify_links", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0; + if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self)))))); + else { + PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + #endif + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_notify_links); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 854, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_9_greenlet_8Greenlet_57_notify_links)) { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 854, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0; + if (unlikely(type_dict_guard != tp_dict_version)) { + tp_dict_version = obj_dict_version = 0; + } + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + } + #endif + } + + /* "src/gevent/greenlet.py":855 + * + * def _notify_links(self): + * while self._links: # <<<<<<<<<<<<<< + * # Early links are allowed to remove later links + * # before we get to them, and they're also allowed to + */ + while (1) { + __pyx_t_5 = (__pyx_v_self->_links != Py_None)&&(PyList_GET_SIZE(__pyx_v_self->_links) != 0); + if (!__pyx_t_5) break; + + /* "src/gevent/greenlet.py":863 + * # manipulating it should be small. a deque is probably not justified. + * # Cython has optimizations to transform this into a memmove anyway. + * link = self._links.pop(0) # <<<<<<<<<<<<<< + * try: + * link(self) + */ + if (unlikely(__pyx_v_self->_links == Py_None)) { + PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "pop"); + __PYX_ERR(0, 863, __pyx_L1_error) + } + __pyx_t_1 = __Pyx_PyList_PopIndex(__pyx_v_self->_links, __pyx_int_0, 0, 1, Py_ssize_t, PyInt_FromSsize_t); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 863, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XDECREF_SET(__pyx_v_link, __pyx_t_1); + __pyx_t_1 = 0; + + /* "src/gevent/greenlet.py":864 + * # Cython has optimizations to transform this into a memmove anyway. + * link = self._links.pop(0) + * try: # <<<<<<<<<<<<<< + * link(self) + * except: # pylint:disable=bare-except + */ + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); + __Pyx_XGOTREF(__pyx_t_6); + __Pyx_XGOTREF(__pyx_t_7); + __Pyx_XGOTREF(__pyx_t_8); + /*try:*/ { + + /* "src/gevent/greenlet.py":865 + * link = self._links.pop(0) + * try: + * link(self) # <<<<<<<<<<<<<< + * except: # pylint:disable=bare-except + * self.parent.handle_error((link, self), *sys_exc_info()) + */ + __Pyx_INCREF(__pyx_v_link); + __pyx_t_2 = __pyx_v_link; __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, ((PyObject *)__pyx_v_self)) : __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_v_self)); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 865, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/greenlet.py":864 + * # Cython has optimizations to transform this into a memmove anyway. + * link = self._links.pop(0) + * try: # <<<<<<<<<<<<<< + * link(self) + * except: # pylint:disable=bare-except + */ + } + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + goto __pyx_L12_try_end; + __pyx_L5_error:; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/greenlet.py":866 + * try: + * link(self) + * except: # pylint:disable=bare-except # <<<<<<<<<<<<<< + * self.parent.handle_error((link, self), *sys_exc_info()) + * + */ + /*except:*/ { + __Pyx_AddTraceback("gevent._greenlet.Greenlet._notify_links", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3) < 0) __PYX_ERR(0, 866, __pyx_L7_except_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_t_3); + + /* "src/gevent/greenlet.py":867 + * link(self) + * except: # pylint:disable=bare-except + * self.parent.handle_error((link, self), *sys_exc_info()) # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_parent); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 867, __pyx_L7_except_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_handle_error); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 867, __pyx_L7_except_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 867, __pyx_L7_except_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_link); + __Pyx_GIVEREF(__pyx_v_link); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_link); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_4, 1, ((PyObject *)__pyx_v_self)); + __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 867, __pyx_L7_except_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_4); + __pyx_t_4 = 0; + __Pyx_INCREF(__pyx_v_6gevent_9_greenlet_sys_exc_info); + __pyx_t_11 = __pyx_v_6gevent_9_greenlet_sys_exc_info; __pyx_t_12 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_11))) { + __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_11); + if (likely(__pyx_t_12)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11); + __Pyx_INCREF(__pyx_t_12); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_11, function); + } + } + __pyx_t_4 = (__pyx_t_12) ? __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_t_12) : __Pyx_PyObject_CallNoArg(__pyx_t_11); + __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 867, __pyx_L7_except_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_11 = __Pyx_PySequence_Tuple(__pyx_t_4); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 867, __pyx_L7_except_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyNumber_Add(__pyx_t_10, __pyx_t_11); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 867, __pyx_L7_except_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_4, NULL); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 867, __pyx_L7_except_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L6_exception_handled; + } + __pyx_L7_except_error:; + + /* "src/gevent/greenlet.py":864 + * # Cython has optimizations to transform this into a memmove anyway. + * link = self._links.pop(0) + * try: # <<<<<<<<<<<<<< + * link(self) + * except: # pylint:disable=bare-except + */ + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); + goto __pyx_L1_error; + __pyx_L6_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); + __pyx_L12_try_end:; + } + } + + /* "src/gevent/greenlet.py":854 + * self.link(callback, SpawnedLink=SpawnedLink) + * + * def _notify_links(self): # <<<<<<<<<<<<<< + * while self._links: + * # Early links are allowed to remove later links + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_AddTraceback("gevent._greenlet.Greenlet._notify_links", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_link); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_57_notify_links(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6gevent_9_greenlet_8Greenlet_56_notify_links[] = "Greenlet._notify_links(self)"; +static PyMethodDef __pyx_mdef_6gevent_9_greenlet_8Greenlet_57_notify_links = {"_notify_links", (PyCFunction)__pyx_pw_6gevent_9_greenlet_8Greenlet_57_notify_links, METH_NOARGS, __pyx_doc_6gevent_9_greenlet_8Greenlet_56_notify_links}; +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_57_notify_links(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_notify_links (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_9_greenlet_8Greenlet_56_notify_links(((struct __pyx_obj_6gevent_9_greenlet_Greenlet *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_56_notify_links(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("_notify_links", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6gevent_9_greenlet_8Greenlet__notify_links(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 854, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent._greenlet.Greenlet._notify_links", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/_greenlet.pxd":87 + * + * cdef class Greenlet(greenlet): + * cdef readonly object value # <<<<<<<<<<<<<< + * cdef readonly tuple args + * cdef readonly dict kwargs + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_5value_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_5value_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_9_greenlet_8Greenlet_5value___get__(((struct __pyx_obj_6gevent_9_greenlet_Greenlet *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_5value___get__(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->value); + __pyx_r = __pyx_v_self->value; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/_greenlet.pxd":88 + * cdef class Greenlet(greenlet): + * cdef readonly object value + * cdef readonly tuple args # <<<<<<<<<<<<<< + * cdef readonly dict kwargs + * cdef readonly object spawning_greenlet + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_4args_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_4args_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_9_greenlet_8Greenlet_4args___get__(((struct __pyx_obj_6gevent_9_greenlet_Greenlet *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_4args___get__(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->args); + __pyx_r = __pyx_v_self->args; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/_greenlet.pxd":89 + * cdef readonly object value + * cdef readonly tuple args + * cdef readonly dict kwargs # <<<<<<<<<<<<<< + * cdef readonly object spawning_greenlet + * cdef public dict spawn_tree_locals + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_6kwargs_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_6kwargs_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_9_greenlet_8Greenlet_6kwargs___get__(((struct __pyx_obj_6gevent_9_greenlet_Greenlet *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_6kwargs___get__(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->kwargs); + __pyx_r = __pyx_v_self->kwargs; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/_greenlet.pxd":90 + * cdef readonly tuple args + * cdef readonly dict kwargs + * cdef readonly object spawning_greenlet # <<<<<<<<<<<<<< + * cdef public dict spawn_tree_locals + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_17spawning_greenlet_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_17spawning_greenlet_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_9_greenlet_8Greenlet_17spawning_greenlet___get__(((struct __pyx_obj_6gevent_9_greenlet_Greenlet *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_17spawning_greenlet___get__(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->spawning_greenlet); + __pyx_r = __pyx_v_self->spawning_greenlet; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/_greenlet.pxd":91 + * cdef readonly dict kwargs + * cdef readonly object spawning_greenlet + * cdef public dict spawn_tree_locals # <<<<<<<<<<<<<< + * + * # This is accessed with getattr() dynamically so it + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_17spawn_tree_locals_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_17spawn_tree_locals_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_9_greenlet_8Greenlet_17spawn_tree_locals___get__(((struct __pyx_obj_6gevent_9_greenlet_Greenlet *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_17spawn_tree_locals___get__(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->spawn_tree_locals); + __pyx_r = __pyx_v_self->spawn_tree_locals; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6gevent_9_greenlet_8Greenlet_17spawn_tree_locals_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6gevent_9_greenlet_8Greenlet_17spawn_tree_locals_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_9_greenlet_8Greenlet_17spawn_tree_locals_2__set__(((struct __pyx_obj_6gevent_9_greenlet_Greenlet *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_9_greenlet_8Greenlet_17spawn_tree_locals_2__set__(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__set__", 0); + if (!(likely(PyDict_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_v_value)->tp_name), 0))) __PYX_ERR(1, 91, __pyx_L1_error) + __pyx_t_1 = __pyx_v_value; + __Pyx_INCREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_self->spawn_tree_locals); + __Pyx_DECREF(__pyx_v_self->spawn_tree_locals); + __pyx_v_self->spawn_tree_locals = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent._greenlet.Greenlet.spawn_tree_locals.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6gevent_9_greenlet_8Greenlet_17spawn_tree_locals_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6gevent_9_greenlet_8Greenlet_17spawn_tree_locals_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_9_greenlet_8Greenlet_17spawn_tree_locals_4__del__(((struct __pyx_obj_6gevent_9_greenlet_Greenlet *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_9_greenlet_8Greenlet_17spawn_tree_locals_4__del__(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->spawn_tree_locals); + __Pyx_DECREF(__pyx_v_self->spawn_tree_locals); + __pyx_v_self->spawn_tree_locals = ((PyObject*)Py_None); + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/_greenlet.pxd":95 + * # This is accessed with getattr() dynamically so it + * # must be visible to Python + * cdef readonly list _spawning_stack_frames # <<<<<<<<<<<<<< + * + * cdef list _links + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_22_spawning_stack_frames_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_22_spawning_stack_frames_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_9_greenlet_8Greenlet_22_spawning_stack_frames___get__(((struct __pyx_obj_6gevent_9_greenlet_Greenlet *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_22_spawning_stack_frames___get__(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->_spawning_stack_frames); + __pyx_r = __pyx_v_self->_spawning_stack_frames; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/greenlet.py":873 + * __slots__ = ('pending', 'active') + * + * def __init__(self): # <<<<<<<<<<<<<< + * self.pending = self.active = False + * + */ + +/* Python wrapper */ +static int __pyx_pw_6gevent_9_greenlet_12_dummy_event_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6gevent_9_greenlet_12_dummy_event_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { + __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;} + if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1; + __pyx_r = __pyx_pf_6gevent_9_greenlet_12_dummy_event___init__(((struct __pyx_obj_6gevent_9_greenlet__dummy_event *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_9_greenlet_12_dummy_event___init__(struct __pyx_obj_6gevent_9_greenlet__dummy_event *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__", 0); + + /* "src/gevent/greenlet.py":874 + * + * def __init__(self): + * self.pending = self.active = False # <<<<<<<<<<<<<< + * + * def stop(self): + */ + __pyx_v_self->pending = 0; + __pyx_v_self->active = 0; + + /* "src/gevent/greenlet.py":873 + * __slots__ = ('pending', 'active') + * + * def __init__(self): # <<<<<<<<<<<<<< + * self.pending = self.active = False + * + */ + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/greenlet.py":876 + * self.pending = self.active = False + * + * def stop(self): # <<<<<<<<<<<<<< + * pass + * + */ + +static PyObject *__pyx_pw_6gevent_9_greenlet_12_dummy_event_3stop(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_f_6gevent_9_greenlet_12_dummy_event_stop(CYTHON_UNUSED struct __pyx_obj_6gevent_9_greenlet__dummy_event *__pyx_v_self, CYTHON_UNUSED int __pyx_skip_dispatch) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stop", 0); + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_9_greenlet_12_dummy_event_3stop(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6gevent_9_greenlet_12_dummy_event_2stop[] = "_dummy_event.stop(self)"; +static PyMethodDef __pyx_mdef_6gevent_9_greenlet_12_dummy_event_3stop = {"stop", (PyCFunction)__pyx_pw_6gevent_9_greenlet_12_dummy_event_3stop, METH_NOARGS, __pyx_doc_6gevent_9_greenlet_12_dummy_event_2stop}; +static PyObject *__pyx_pw_6gevent_9_greenlet_12_dummy_event_3stop(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stop (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_9_greenlet_12_dummy_event_2stop(((struct __pyx_obj_6gevent_9_greenlet__dummy_event *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_9_greenlet_12_dummy_event_2stop(struct __pyx_obj_6gevent_9_greenlet__dummy_event *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("stop", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6gevent_9_greenlet_12_dummy_event_stop(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 876, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent._greenlet._dummy_event.stop", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/greenlet.py":879 + * pass + * + * def start(self, cb): # pylint:disable=unused-argument # <<<<<<<<<<<<<< + * raise AssertionError("Cannot start the dummy event") + * + */ + +static PyObject *__pyx_pw_6gevent_9_greenlet_12_dummy_event_5start(PyObject *__pyx_v_self, PyObject *__pyx_v_cb); /*proto*/ +static PyObject *__pyx_f_6gevent_9_greenlet_12_dummy_event_start(CYTHON_UNUSED struct __pyx_obj_6gevent_9_greenlet__dummy_event *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_cb, CYTHON_UNUSED int __pyx_skip_dispatch) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("start", 0); + + /* "src/gevent/greenlet.py":880 + * + * def start(self, cb): # pylint:disable=unused-argument + * raise AssertionError("Cannot start the dummy event") # <<<<<<<<<<<<<< + * + * def close(self): + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_AssertionError, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 880, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 880, __pyx_L1_error) + + /* "src/gevent/greenlet.py":879 + * pass + * + * def start(self, cb): # pylint:disable=unused-argument # <<<<<<<<<<<<<< + * raise AssertionError("Cannot start the dummy event") + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent._greenlet._dummy_event.start", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_9_greenlet_12_dummy_event_5start(PyObject *__pyx_v_self, PyObject *__pyx_v_cb); /*proto*/ +static char __pyx_doc_6gevent_9_greenlet_12_dummy_event_4start[] = "_dummy_event.start(self, cb)"; +static PyMethodDef __pyx_mdef_6gevent_9_greenlet_12_dummy_event_5start = {"start", (PyCFunction)__pyx_pw_6gevent_9_greenlet_12_dummy_event_5start, METH_O, __pyx_doc_6gevent_9_greenlet_12_dummy_event_4start}; +static PyObject *__pyx_pw_6gevent_9_greenlet_12_dummy_event_5start(PyObject *__pyx_v_self, PyObject *__pyx_v_cb) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("start (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_9_greenlet_12_dummy_event_4start(((struct __pyx_obj_6gevent_9_greenlet__dummy_event *)__pyx_v_self), ((PyObject *)__pyx_v_cb)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_9_greenlet_12_dummy_event_4start(struct __pyx_obj_6gevent_9_greenlet__dummy_event *__pyx_v_self, PyObject *__pyx_v_cb) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("start", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6gevent_9_greenlet_12_dummy_event_start(__pyx_v_self, __pyx_v_cb, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 879, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent._greenlet._dummy_event.start", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/greenlet.py":882 + * raise AssertionError("Cannot start the dummy event") + * + * def close(self): # <<<<<<<<<<<<<< + * pass + * + */ + +static PyObject *__pyx_pw_6gevent_9_greenlet_12_dummy_event_7close(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_f_6gevent_9_greenlet_12_dummy_event_close(CYTHON_UNUSED struct __pyx_obj_6gevent_9_greenlet__dummy_event *__pyx_v_self, CYTHON_UNUSED int __pyx_skip_dispatch) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("close", 0); + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_9_greenlet_12_dummy_event_7close(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6gevent_9_greenlet_12_dummy_event_6close[] = "_dummy_event.close(self)"; +static PyMethodDef __pyx_mdef_6gevent_9_greenlet_12_dummy_event_7close = {"close", (PyCFunction)__pyx_pw_6gevent_9_greenlet_12_dummy_event_7close, METH_NOARGS, __pyx_doc_6gevent_9_greenlet_12_dummy_event_6close}; +static PyObject *__pyx_pw_6gevent_9_greenlet_12_dummy_event_7close(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("close (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_9_greenlet_12_dummy_event_6close(((struct __pyx_obj_6gevent_9_greenlet__dummy_event *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_9_greenlet_12_dummy_event_6close(struct __pyx_obj_6gevent_9_greenlet__dummy_event *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("close", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6gevent_9_greenlet_12_dummy_event_close(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 882, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent._greenlet._dummy_event.close", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/_greenlet.pxd":158 + * @cython.internal + * cdef class _dummy_event: + * cdef readonly bint pending # <<<<<<<<<<<<<< + * cdef readonly bint active + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_9_greenlet_12_dummy_event_7pending_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_9_greenlet_12_dummy_event_7pending_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_9_greenlet_12_dummy_event_7pending___get__(((struct __pyx_obj_6gevent_9_greenlet__dummy_event *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_9_greenlet_12_dummy_event_7pending___get__(struct __pyx_obj_6gevent_9_greenlet__dummy_event *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->pending); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 158, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent._greenlet._dummy_event.pending.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/_greenlet.pxd":159 + * cdef class _dummy_event: + * cdef readonly bint pending + * cdef readonly bint active # <<<<<<<<<<<<<< + * + * cpdef stop(self) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_9_greenlet_12_dummy_event_6active_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_9_greenlet_12_dummy_event_6active_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_9_greenlet_12_dummy_event_6active___get__(((struct __pyx_obj_6gevent_9_greenlet__dummy_event *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_9_greenlet_12_dummy_event_6active___get__(struct __pyx_obj_6gevent_9_greenlet__dummy_event *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->active); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 159, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent._greenlet._dummy_event.active.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/greenlet.py":889 + * + * + * def _kill(glet, exception, waiter): # <<<<<<<<<<<<<< + * try: + * glet.throw(exception) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_9_greenlet_1_kill(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6gevent_9_greenlet__kill[] = "_kill(glet, exception, waiter)"; +static PyMethodDef __pyx_mdef_6gevent_9_greenlet_1_kill = {"_kill", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_9_greenlet_1_kill, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_9_greenlet__kill}; +static PyObject *__pyx_pw_6gevent_9_greenlet_1_kill(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_glet = 0; + PyObject *__pyx_v_exception = 0; + PyObject *__pyx_v_waiter = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_kill (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_glet,&__pyx_n_s_exception,&__pyx_n_s_waiter,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_glet)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_exception)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("_kill", 1, 3, 3, 1); __PYX_ERR(0, 889, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_waiter)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("_kill", 1, 3, 3, 2); __PYX_ERR(0, 889, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_kill") < 0)) __PYX_ERR(0, 889, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + } + __pyx_v_glet = values[0]; + __pyx_v_exception = values[1]; + __pyx_v_waiter = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("_kill", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 889, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent._greenlet._kill", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_9_greenlet__kill(__pyx_self, __pyx_v_glet, __pyx_v_exception, __pyx_v_waiter); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_9_greenlet__kill(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_glet, PyObject *__pyx_v_exception, PyObject *__pyx_v_waiter) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + int __pyx_t_12; + int __pyx_t_13; + __Pyx_RefNannySetupContext("_kill", 0); + + /* "src/gevent/greenlet.py":890 + * + * def _kill(glet, exception, waiter): + * try: # <<<<<<<<<<<<<< + * glet.throw(exception) + * except: # pylint:disable=bare-except + */ + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "src/gevent/greenlet.py":891 + * def _kill(glet, exception, waiter): + * try: + * glet.throw(exception) # <<<<<<<<<<<<<< + * except: # pylint:disable=bare-except + * # XXX do we need this here? + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_glet, __pyx_n_s_throw); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 891, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); + if (likely(__pyx_t_6)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_5, function); + } + } + __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_v_exception) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_exception); + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 891, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "src/gevent/greenlet.py":890 + * + * def _kill(glet, exception, waiter): + * try: # <<<<<<<<<<<<<< + * glet.throw(exception) + * except: # pylint:disable=bare-except + */ + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L8_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "src/gevent/greenlet.py":892 + * try: + * glet.throw(exception) + * except: # pylint:disable=bare-except # <<<<<<<<<<<<<< + * # XXX do we need this here? + * glet.parent.handle_error(glet, *sys_exc_info()) + */ + /*except:*/ { + __Pyx_AddTraceback("gevent._greenlet._kill", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6) < 0) __PYX_ERR(0, 892, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_6); + + /* "src/gevent/greenlet.py":894 + * except: # pylint:disable=bare-except + * # XXX do we need this here? + * glet.parent.handle_error(glet, *sys_exc_info()) # <<<<<<<<<<<<<< + * if waiter is not None: + * waiter.switch(None) + */ + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_glet, __pyx_n_s_parent); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 894, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_handle_error); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 894, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 894, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_INCREF(__pyx_v_glet); + __Pyx_GIVEREF(__pyx_v_glet); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_glet); + __Pyx_INCREF(__pyx_v_6gevent_9_greenlet_sys_exc_info); + __pyx_t_10 = __pyx_v_6gevent_9_greenlet_sys_exc_info; __pyx_t_11 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_10))) { + __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_10); + if (likely(__pyx_t_11)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10); + __Pyx_INCREF(__pyx_t_11); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_10, function); + } + } + __pyx_t_9 = (__pyx_t_11) ? __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_t_11) : __Pyx_PyObject_CallNoArg(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 894, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PySequence_Tuple(__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 894, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = PyNumber_Add(__pyx_t_7, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 894, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_9, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 894, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L4_exception_handled; + } + __pyx_L5_except_error:; + + /* "src/gevent/greenlet.py":890 + * + * def _kill(glet, exception, waiter): + * try: # <<<<<<<<<<<<<< + * glet.throw(exception) + * except: # pylint:disable=bare-except + */ + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L8_try_end:; + } + + /* "src/gevent/greenlet.py":895 + * # XXX do we need this here? + * glet.parent.handle_error(glet, *sys_exc_info()) + * if waiter is not None: # <<<<<<<<<<<<<< + * waiter.switch(None) + * + */ + __pyx_t_12 = (__pyx_v_waiter != Py_None); + __pyx_t_13 = (__pyx_t_12 != 0); + if (__pyx_t_13) { + + /* "src/gevent/greenlet.py":896 + * glet.parent.handle_error(glet, *sys_exc_info()) + * if waiter is not None: + * waiter.switch(None) # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_waiter, __pyx_n_s_switch); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 896, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_5, function); + } + } + __pyx_t_6 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_4, Py_None) : __Pyx_PyObject_CallOneArg(__pyx_t_5, Py_None); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 896, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "src/gevent/greenlet.py":895 + * # XXX do we need this here? + * glet.parent.handle_error(glet, *sys_exc_info()) + * if waiter is not None: # <<<<<<<<<<<<<< + * waiter.switch(None) + * + */ + } + + /* "src/gevent/greenlet.py":889 + * + * + * def _kill(glet, exception, waiter): # <<<<<<<<<<<<<< + * try: + * glet.throw(exception) + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_AddTraceback("gevent._greenlet._kill", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/greenlet.py":899 + * + * + * def joinall(greenlets, timeout=None, raise_error=False, count=None): # <<<<<<<<<<<<<< + * """ + * Wait for the ``greenlets`` to finish. + */ + +static PyObject *__pyx_pw_6gevent_9_greenlet_3joinall(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_6gevent_9_greenlet_joinall(PyObject *__pyx_v_greenlets, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_9_greenlet_joinall *__pyx_optional_args) { + PyObject *__pyx_v_timeout = ((PyObject *)Py_None); + PyObject *__pyx_v_raise_error = ((PyObject *)Py_False); + PyObject *__pyx_v_count = ((PyObject *)Py_None); + PyObject *__pyx_v_done = 0; + PyObject *__pyx_v_obj = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + Py_ssize_t __pyx_t_6; + PyObject *(*__pyx_t_7)(PyObject *); + PyObject *__pyx_t_8 = NULL; + int __pyx_t_9; + __Pyx_RefNannySetupContext("joinall", 0); + if (__pyx_optional_args) { + if (__pyx_optional_args->__pyx_n > 0) { + __pyx_v_timeout = __pyx_optional_args->timeout; + if (__pyx_optional_args->__pyx_n > 1) { + __pyx_v_raise_error = __pyx_optional_args->raise_error; + if (__pyx_optional_args->__pyx_n > 2) { + __pyx_v_count = __pyx_optional_args->count; + } + } + } + } + + /* "src/gevent/greenlet.py":908 + * expired. + * """ + * if not raise_error: # <<<<<<<<<<<<<< + * return wait(greenlets, timeout=timeout, count=count) + * + */ + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_raise_error); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 908, __pyx_L1_error) + __pyx_t_2 = ((!__pyx_t_1) != 0); + if (__pyx_t_2) { + + /* "src/gevent/greenlet.py":909 + * """ + * if not raise_error: + * return wait(greenlets, timeout=timeout, count=count) # <<<<<<<<<<<<<< + * + * done = [] + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 909, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_greenlets); + __Pyx_GIVEREF(__pyx_v_greenlets); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_greenlets); + __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 909, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_timeout, __pyx_v_timeout) < 0) __PYX_ERR(0, 909, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_count, __pyx_v_count) < 0) __PYX_ERR(0, 909, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_v_6gevent_9_greenlet_wait, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 909, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L0; + + /* "src/gevent/greenlet.py":908 + * expired. + * """ + * if not raise_error: # <<<<<<<<<<<<<< + * return wait(greenlets, timeout=timeout, count=count) + * + */ + } + + /* "src/gevent/greenlet.py":911 + * return wait(greenlets, timeout=timeout, count=count) + * + * done = [] # <<<<<<<<<<<<<< + * for obj in iwait(greenlets, timeout=timeout, count=count): + * if getattr(obj, 'exception', None) is not None: + */ + __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 911, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_v_done = ((PyObject*)__pyx_t_5); + __pyx_t_5 = 0; + + /* "src/gevent/greenlet.py":912 + * + * done = [] + * for obj in iwait(greenlets, timeout=timeout, count=count): # <<<<<<<<<<<<<< + * if getattr(obj, 'exception', None) is not None: + * if hasattr(obj, '_raise_exception'): + */ + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 912, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_greenlets); + __Pyx_GIVEREF(__pyx_v_greenlets); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_greenlets); + __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 912, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_timeout, __pyx_v_timeout) < 0) __PYX_ERR(0, 912, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_count, __pyx_v_count) < 0) __PYX_ERR(0, 912, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_v_6gevent_9_greenlet_iwait, __pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 912, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) { + __pyx_t_4 = __pyx_t_3; __Pyx_INCREF(__pyx_t_4); __pyx_t_6 = 0; + __pyx_t_7 = NULL; + } else { + __pyx_t_6 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 912, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_7 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 912, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + for (;;) { + if (likely(!__pyx_t_7)) { + if (likely(PyList_CheckExact(__pyx_t_4))) { + if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_3 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_6); __Pyx_INCREF(__pyx_t_3); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 912, __pyx_L1_error) + #else + __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 912, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + #endif + } else { + if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_6); __Pyx_INCREF(__pyx_t_3); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 912, __pyx_L1_error) + #else + __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 912, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + #endif + } + } else { + __pyx_t_3 = __pyx_t_7(__pyx_t_4); + if (unlikely(!__pyx_t_3)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(0, 912, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_3); + } + __Pyx_XDECREF_SET(__pyx_v_obj, __pyx_t_3); + __pyx_t_3 = 0; + + /* "src/gevent/greenlet.py":913 + * done = [] + * for obj in iwait(greenlets, timeout=timeout, count=count): + * if getattr(obj, 'exception', None) is not None: # <<<<<<<<<<<<<< + * if hasattr(obj, '_raise_exception'): + * obj._raise_exception() + */ + __pyx_t_3 = __Pyx_GetAttr3(__pyx_v_obj, __pyx_n_s_exception, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 913, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = (__pyx_t_3 != Py_None); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_1 = (__pyx_t_2 != 0); + if (__pyx_t_1) { + + /* "src/gevent/greenlet.py":914 + * for obj in iwait(greenlets, timeout=timeout, count=count): + * if getattr(obj, 'exception', None) is not None: + * if hasattr(obj, '_raise_exception'): # <<<<<<<<<<<<<< + * obj._raise_exception() + * else: + */ + __pyx_t_1 = __Pyx_HasAttr(__pyx_v_obj, __pyx_n_s_raise_exception); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 914, __pyx_L1_error) + __pyx_t_2 = (__pyx_t_1 != 0); + if (likely(__pyx_t_2)) { + + /* "src/gevent/greenlet.py":915 + * if getattr(obj, 'exception', None) is not None: + * if hasattr(obj, '_raise_exception'): + * obj._raise_exception() # <<<<<<<<<<<<<< + * else: + * raise obj.exception + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_raise_exception); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 915, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_8 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5); + if (likely(__pyx_t_8)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_8); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_5, function); + } + } + __pyx_t_3 = (__pyx_t_8) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_8) : __Pyx_PyObject_CallNoArg(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 915, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "src/gevent/greenlet.py":914 + * for obj in iwait(greenlets, timeout=timeout, count=count): + * if getattr(obj, 'exception', None) is not None: + * if hasattr(obj, '_raise_exception'): # <<<<<<<<<<<<<< + * obj._raise_exception() + * else: + */ + goto __pyx_L7; + } + + /* "src/gevent/greenlet.py":917 + * obj._raise_exception() + * else: + * raise obj.exception # <<<<<<<<<<<<<< + * done.append(obj) + * return done + */ + /*else*/ { + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_exception); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 917, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(0, 917, __pyx_L1_error) + } + __pyx_L7:; + + /* "src/gevent/greenlet.py":913 + * done = [] + * for obj in iwait(greenlets, timeout=timeout, count=count): + * if getattr(obj, 'exception', None) is not None: # <<<<<<<<<<<<<< + * if hasattr(obj, '_raise_exception'): + * obj._raise_exception() + */ + } + + /* "src/gevent/greenlet.py":918 + * else: + * raise obj.exception + * done.append(obj) # <<<<<<<<<<<<<< + * return done + * + */ + __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_done, __pyx_v_obj); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 918, __pyx_L1_error) + + /* "src/gevent/greenlet.py":912 + * + * done = [] + * for obj in iwait(greenlets, timeout=timeout, count=count): # <<<<<<<<<<<<<< + * if getattr(obj, 'exception', None) is not None: + * if hasattr(obj, '_raise_exception'): + */ + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "src/gevent/greenlet.py":919 + * raise obj.exception + * done.append(obj) + * return done # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_done); + __pyx_r = __pyx_v_done; + goto __pyx_L0; + + /* "src/gevent/greenlet.py":899 + * + * + * def joinall(greenlets, timeout=None, raise_error=False, count=None): # <<<<<<<<<<<<<< + * """ + * Wait for the ``greenlets`` to finish. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("gevent._greenlet.joinall", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_done); + __Pyx_XDECREF(__pyx_v_obj); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_9_greenlet_3joinall(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6gevent_9_greenlet_2joinall[] = "joinall(greenlets, timeout=None, raise_error=False, count=None)\n\n Wait for the ``greenlets`` to finish.\n\n :param greenlets: A sequence (supporting :func:`len`) of greenlets to wait for.\n :keyword float timeout: If given, the maximum number of seconds to wait.\n :return: A sequence of the greenlets that finished before the timeout (if any)\n expired.\n "; +static PyMethodDef __pyx_mdef_6gevent_9_greenlet_3joinall = {"joinall", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_9_greenlet_3joinall, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_9_greenlet_2joinall}; +static PyObject *__pyx_pw_6gevent_9_greenlet_3joinall(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_greenlets = 0; + PyObject *__pyx_v_timeout = 0; + PyObject *__pyx_v_raise_error = 0; + PyObject *__pyx_v_count = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("joinall (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_greenlets,&__pyx_n_s_timeout,&__pyx_n_s_raise_error,&__pyx_n_s_count,0}; + PyObject* values[4] = {0,0,0,0}; + values[1] = ((PyObject *)Py_None); + values[2] = ((PyObject *)Py_False); + values[3] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_greenlets)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_timeout); + if (value) { values[1] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 2: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_raise_error); + if (value) { values[2] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 3: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_count); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "joinall") < 0)) __PYX_ERR(0, 899, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_greenlets = values[0]; + __pyx_v_timeout = values[1]; + __pyx_v_raise_error = values[2]; + __pyx_v_count = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("joinall", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 899, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent._greenlet.joinall", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_9_greenlet_2joinall(__pyx_self, __pyx_v_greenlets, __pyx_v_timeout, __pyx_v_raise_error, __pyx_v_count); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_9_greenlet_2joinall(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_greenlets, PyObject *__pyx_v_timeout, PyObject *__pyx_v_raise_error, PyObject *__pyx_v_count) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + struct __pyx_opt_args_6gevent_9_greenlet_joinall __pyx_t_2; + __Pyx_RefNannySetupContext("joinall", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_2.__pyx_n = 3; + __pyx_t_2.timeout = __pyx_v_timeout; + __pyx_t_2.raise_error = __pyx_v_raise_error; + __pyx_t_2.count = __pyx_v_count; + __pyx_t_1 = __pyx_f_6gevent_9_greenlet_joinall(__pyx_v_greenlets, 0, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 899, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent._greenlet.joinall", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/greenlet.py":922 + * + * + * def _killall3(greenlets, exception, waiter): # <<<<<<<<<<<<<< + * diehards = [] + * for g in greenlets: + */ + +static PyObject *__pyx_f_6gevent_9_greenlet__killall3(PyObject *__pyx_v_greenlets, PyObject *__pyx_v_exception, PyObject *__pyx_v_waiter) { + PyObject *__pyx_v_diehards = 0; + PyObject *__pyx_v_g = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + PyObject *__pyx_t_14 = NULL; + PyObject *__pyx_t_15 = NULL; + int __pyx_t_16; + __Pyx_RefNannySetupContext("_killall3", 0); + + /* "src/gevent/greenlet.py":923 + * + * def _killall3(greenlets, exception, waiter): + * diehards = [] # <<<<<<<<<<<<<< + * for g in greenlets: + * if not g.dead: + */ + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 923, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_diehards = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "src/gevent/greenlet.py":924 + * def _killall3(greenlets, exception, waiter): + * diehards = [] + * for g in greenlets: # <<<<<<<<<<<<<< + * if not g.dead: + * try: + */ + if (unlikely(__pyx_v_greenlets == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); + __PYX_ERR(0, 924, __pyx_L1_error) + } + __pyx_t_1 = __pyx_v_greenlets; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; + for (;;) { + if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 924, __pyx_L1_error) + #else + __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 924, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + #endif + __Pyx_XDECREF_SET(__pyx_v_g, __pyx_t_3); + __pyx_t_3 = 0; + + /* "src/gevent/greenlet.py":925 + * diehards = [] + * for g in greenlets: + * if not g.dead: # <<<<<<<<<<<<<< + * try: + * g.throw(exception) + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_g, __pyx_n_s_dead); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 925, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 925, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_5 = ((!__pyx_t_4) != 0); + if (__pyx_t_5) { + + /* "src/gevent/greenlet.py":926 + * for g in greenlets: + * if not g.dead: + * try: # <<<<<<<<<<<<<< + * g.throw(exception) + * except: # pylint:disable=bare-except + */ + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); + __Pyx_XGOTREF(__pyx_t_6); + __Pyx_XGOTREF(__pyx_t_7); + __Pyx_XGOTREF(__pyx_t_8); + /*try:*/ { + + /* "src/gevent/greenlet.py":927 + * if not g.dead: + * try: + * g.throw(exception) # <<<<<<<<<<<<<< + * except: # pylint:disable=bare-except + * g.parent.handle_error(g, *sys_exc_info()) + */ + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_g, __pyx_n_s_throw); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 927, __pyx_L6_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) { + __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9); + if (likely(__pyx_t_10)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); + __Pyx_INCREF(__pyx_t_10); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_9, function); + } + } + __pyx_t_3 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_10, __pyx_v_exception) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_v_exception); + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 927, __pyx_L6_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "src/gevent/greenlet.py":926 + * for g in greenlets: + * if not g.dead: + * try: # <<<<<<<<<<<<<< + * g.throw(exception) + * except: # pylint:disable=bare-except + */ + } + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + goto __pyx_L13_try_end; + __pyx_L6_error:; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "src/gevent/greenlet.py":928 + * try: + * g.throw(exception) + * except: # pylint:disable=bare-except # <<<<<<<<<<<<<< + * g.parent.handle_error(g, *sys_exc_info()) + * if not g.dead: + */ + /*except:*/ { + __Pyx_AddTraceback("gevent._greenlet._killall3", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_9, &__pyx_t_10) < 0) __PYX_ERR(0, 928, __pyx_L8_except_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GOTREF(__pyx_t_9); + __Pyx_GOTREF(__pyx_t_10); + + /* "src/gevent/greenlet.py":929 + * g.throw(exception) + * except: # pylint:disable=bare-except + * g.parent.handle_error(g, *sys_exc_info()) # <<<<<<<<<<<<<< + * if not g.dead: + * diehards.append(g) + */ + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_g, __pyx_n_s_parent); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 929, __pyx_L8_except_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_handle_error); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 929, __pyx_L8_except_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 929, __pyx_L8_except_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_INCREF(__pyx_v_g); + __Pyx_GIVEREF(__pyx_v_g); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_v_g); + __Pyx_INCREF(__pyx_v_6gevent_9_greenlet_sys_exc_info); + __pyx_t_14 = __pyx_v_6gevent_9_greenlet_sys_exc_info; __pyx_t_15 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_14))) { + __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_14); + if (likely(__pyx_t_15)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14); + __Pyx_INCREF(__pyx_t_15); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_14, function); + } + } + __pyx_t_13 = (__pyx_t_15) ? __Pyx_PyObject_CallOneArg(__pyx_t_14, __pyx_t_15) : __Pyx_PyObject_CallNoArg(__pyx_t_14); + __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; + if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 929, __pyx_L8_except_error) + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __pyx_t_14 = __Pyx_PySequence_Tuple(__pyx_t_13); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 929, __pyx_L8_except_error) + __Pyx_GOTREF(__pyx_t_14); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_13 = PyNumber_Add(__pyx_t_11, __pyx_t_14); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 929, __pyx_L8_except_error) + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_13, NULL); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 929, __pyx_L8_except_error) + __Pyx_GOTREF(__pyx_t_14); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + goto __pyx_L7_exception_handled; + } + __pyx_L8_except_error:; + + /* "src/gevent/greenlet.py":926 + * for g in greenlets: + * if not g.dead: + * try: # <<<<<<<<<<<<<< + * g.throw(exception) + * except: # pylint:disable=bare-except + */ + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); + goto __pyx_L1_error; + __pyx_L7_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); + __pyx_L13_try_end:; + } + + /* "src/gevent/greenlet.py":930 + * except: # pylint:disable=bare-except + * g.parent.handle_error(g, *sys_exc_info()) + * if not g.dead: # <<<<<<<<<<<<<< + * diehards.append(g) + * waiter.switch(diehards) + */ + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_g, __pyx_n_s_dead); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 930, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 930, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_4 = ((!__pyx_t_5) != 0); + if (__pyx_t_4) { + + /* "src/gevent/greenlet.py":931 + * g.parent.handle_error(g, *sys_exc_info()) + * if not g.dead: + * diehards.append(g) # <<<<<<<<<<<<<< + * waiter.switch(diehards) + * + */ + __pyx_t_16 = __Pyx_PyList_Append(__pyx_v_diehards, __pyx_v_g); if (unlikely(__pyx_t_16 == ((int)-1))) __PYX_ERR(0, 931, __pyx_L1_error) + + /* "src/gevent/greenlet.py":930 + * except: # pylint:disable=bare-except + * g.parent.handle_error(g, *sys_exc_info()) + * if not g.dead: # <<<<<<<<<<<<<< + * diehards.append(g) + * waiter.switch(diehards) + */ + } + + /* "src/gevent/greenlet.py":925 + * diehards = [] + * for g in greenlets: + * if not g.dead: # <<<<<<<<<<<<<< + * try: + * g.throw(exception) + */ + } + + /* "src/gevent/greenlet.py":924 + * def _killall3(greenlets, exception, waiter): + * diehards = [] + * for g in greenlets: # <<<<<<<<<<<<<< + * if not g.dead: + * try: + */ + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/greenlet.py":932 + * if not g.dead: + * diehards.append(g) + * waiter.switch(diehards) # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_waiter, __pyx_n_s_switch); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 932, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_9 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_10))) { + __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_10); + if (likely(__pyx_t_9)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10); + __Pyx_INCREF(__pyx_t_9); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_10, function); + } + } + __pyx_t_1 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_10, __pyx_t_9, __pyx_v_diehards) : __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_v_diehards); + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 932, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/greenlet.py":922 + * + * + * def _killall3(greenlets, exception, waiter): # <<<<<<<<<<<<<< + * diehards = [] + * for g in greenlets: + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_XDECREF(__pyx_t_13); + __Pyx_XDECREF(__pyx_t_14); + __Pyx_XDECREF(__pyx_t_15); + __Pyx_AddTraceback("gevent._greenlet._killall3", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_diehards); + __Pyx_XDECREF(__pyx_v_g); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/greenlet.py":935 + * + * + * def _killall(greenlets, exception): # <<<<<<<<<<<<<< + * for g in greenlets: + * if not g.dead: + */ + +static PyObject *__pyx_f_6gevent_9_greenlet__killall(PyObject *__pyx_v_greenlets, PyObject *__pyx_v_exception) { + PyObject *__pyx_v_g = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + PyObject *__pyx_t_14 = NULL; + PyObject *__pyx_t_15 = NULL; + __Pyx_RefNannySetupContext("_killall", 0); + + /* "src/gevent/greenlet.py":936 + * + * def _killall(greenlets, exception): + * for g in greenlets: # <<<<<<<<<<<<<< + * if not g.dead: + * try: + */ + if (unlikely(__pyx_v_greenlets == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); + __PYX_ERR(0, 936, __pyx_L1_error) + } + __pyx_t_1 = __pyx_v_greenlets; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; + for (;;) { + if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 936, __pyx_L1_error) + #else + __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 936, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + #endif + __Pyx_XDECREF_SET(__pyx_v_g, __pyx_t_3); + __pyx_t_3 = 0; + + /* "src/gevent/greenlet.py":937 + * def _killall(greenlets, exception): + * for g in greenlets: + * if not g.dead: # <<<<<<<<<<<<<< + * try: + * g.throw(exception) + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_g, __pyx_n_s_dead); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 937, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 937, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_5 = ((!__pyx_t_4) != 0); + if (__pyx_t_5) { + + /* "src/gevent/greenlet.py":938 + * for g in greenlets: + * if not g.dead: + * try: # <<<<<<<<<<<<<< + * g.throw(exception) + * except: # pylint:disable=bare-except + */ + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); + __Pyx_XGOTREF(__pyx_t_6); + __Pyx_XGOTREF(__pyx_t_7); + __Pyx_XGOTREF(__pyx_t_8); + /*try:*/ { + + /* "src/gevent/greenlet.py":939 + * if not g.dead: + * try: + * g.throw(exception) # <<<<<<<<<<<<<< + * except: # pylint:disable=bare-except + * g.parent.handle_error(g, *sys_exc_info()) + */ + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_g, __pyx_n_s_throw); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 939, __pyx_L6_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) { + __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9); + if (likely(__pyx_t_10)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); + __Pyx_INCREF(__pyx_t_10); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_9, function); + } + } + __pyx_t_3 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_10, __pyx_v_exception) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_v_exception); + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 939, __pyx_L6_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "src/gevent/greenlet.py":938 + * for g in greenlets: + * if not g.dead: + * try: # <<<<<<<<<<<<<< + * g.throw(exception) + * except: # pylint:disable=bare-except + */ + } + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + goto __pyx_L13_try_end; + __pyx_L6_error:; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "src/gevent/greenlet.py":940 + * try: + * g.throw(exception) + * except: # pylint:disable=bare-except # <<<<<<<<<<<<<< + * g.parent.handle_error(g, *sys_exc_info()) + * + */ + /*except:*/ { + __Pyx_AddTraceback("gevent._greenlet._killall", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_9, &__pyx_t_10) < 0) __PYX_ERR(0, 940, __pyx_L8_except_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GOTREF(__pyx_t_9); + __Pyx_GOTREF(__pyx_t_10); + + /* "src/gevent/greenlet.py":941 + * g.throw(exception) + * except: # pylint:disable=bare-except + * g.parent.handle_error(g, *sys_exc_info()) # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_g, __pyx_n_s_parent); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 941, __pyx_L8_except_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_handle_error); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 941, __pyx_L8_except_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 941, __pyx_L8_except_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_INCREF(__pyx_v_g); + __Pyx_GIVEREF(__pyx_v_g); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_v_g); + __Pyx_INCREF(__pyx_v_6gevent_9_greenlet_sys_exc_info); + __pyx_t_14 = __pyx_v_6gevent_9_greenlet_sys_exc_info; __pyx_t_15 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_14))) { + __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_14); + if (likely(__pyx_t_15)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14); + __Pyx_INCREF(__pyx_t_15); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_14, function); + } + } + __pyx_t_13 = (__pyx_t_15) ? __Pyx_PyObject_CallOneArg(__pyx_t_14, __pyx_t_15) : __Pyx_PyObject_CallNoArg(__pyx_t_14); + __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; + if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 941, __pyx_L8_except_error) + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __pyx_t_14 = __Pyx_PySequence_Tuple(__pyx_t_13); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 941, __pyx_L8_except_error) + __Pyx_GOTREF(__pyx_t_14); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_13 = PyNumber_Add(__pyx_t_11, __pyx_t_14); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 941, __pyx_L8_except_error) + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_13, NULL); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 941, __pyx_L8_except_error) + __Pyx_GOTREF(__pyx_t_14); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + goto __pyx_L7_exception_handled; + } + __pyx_L8_except_error:; + + /* "src/gevent/greenlet.py":938 + * for g in greenlets: + * if not g.dead: + * try: # <<<<<<<<<<<<<< + * g.throw(exception) + * except: # pylint:disable=bare-except + */ + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); + goto __pyx_L1_error; + __pyx_L7_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); + __pyx_L13_try_end:; + } + + /* "src/gevent/greenlet.py":937 + * def _killall(greenlets, exception): + * for g in greenlets: + * if not g.dead: # <<<<<<<<<<<<<< + * try: + * g.throw(exception) + */ + } + + /* "src/gevent/greenlet.py":936 + * + * def _killall(greenlets, exception): + * for g in greenlets: # <<<<<<<<<<<<<< + * if not g.dead: + * try: + */ + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/greenlet.py":935 + * + * + * def _killall(greenlets, exception): # <<<<<<<<<<<<<< + * for g in greenlets: + * if not g.dead: + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_XDECREF(__pyx_t_13); + __Pyx_XDECREF(__pyx_t_14); + __Pyx_XDECREF(__pyx_t_15); + __Pyx_AddTraceback("gevent._greenlet._killall", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_g); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/greenlet.py":944 + * + * + * def _call_spawn_callbacks(gr): # <<<<<<<<<<<<<< + * if _spawn_callbacks is not None: + * for cb in _spawn_callbacks: + */ + +static void __pyx_f_6gevent_9_greenlet__call_spawn_callbacks(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_gr) { + PyObject *__pyx_v_cb = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + Py_ssize_t __pyx_t_4; + Py_ssize_t __pyx_t_5; + int __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + __Pyx_RefNannySetupContext("_call_spawn_callbacks", 0); + + /* "src/gevent/greenlet.py":945 + * + * def _call_spawn_callbacks(gr): + * if _spawn_callbacks is not None: # <<<<<<<<<<<<<< + * for cb in _spawn_callbacks: + * cb(gr) + */ + __pyx_t_1 = (__pyx_v_6gevent_9_greenlet__spawn_callbacks != ((PyObject*)Py_None)); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "src/gevent/greenlet.py":946 + * def _call_spawn_callbacks(gr): + * if _spawn_callbacks is not None: + * for cb in _spawn_callbacks: # <<<<<<<<<<<<<< + * cb(gr) + * + */ + __pyx_t_4 = 0; + __pyx_t_7 = __Pyx_set_iterator(__pyx_v_6gevent_9_greenlet__spawn_callbacks, 1, (&__pyx_t_5), (&__pyx_t_6)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 946, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_3); + __pyx_t_3 = __pyx_t_7; + __pyx_t_7 = 0; + while (1) { + __pyx_t_8 = __Pyx_set_iter_next(__pyx_t_3, __pyx_t_5, &__pyx_t_4, &__pyx_t_7, __pyx_t_6); + if (unlikely(__pyx_t_8 == 0)) break; + if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(0, 946, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_XDECREF_SET(__pyx_v_cb, __pyx_t_7); + __pyx_t_7 = 0; + + /* "src/gevent/greenlet.py":947 + * if _spawn_callbacks is not None: + * for cb in _spawn_callbacks: + * cb(gr) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_INCREF(__pyx_v_cb); + __pyx_t_9 = __pyx_v_cb; __pyx_t_10 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) { + __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9); + if (likely(__pyx_t_10)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); + __Pyx_INCREF(__pyx_t_10); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_9, function); + } + } + __pyx_t_7 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_10, ((PyObject *)__pyx_v_gr)) : __Pyx_PyObject_CallOneArg(__pyx_t_9, ((PyObject *)__pyx_v_gr)); + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 947, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "src/gevent/greenlet.py":945 + * + * def _call_spawn_callbacks(gr): + * if _spawn_callbacks is not None: # <<<<<<<<<<<<<< + * for cb in _spawn_callbacks: + * cb(gr) + */ + } + + /* "src/gevent/greenlet.py":944 + * + * + * def _call_spawn_callbacks(gr): # <<<<<<<<<<<<<< + * if _spawn_callbacks is not None: + * for cb in _spawn_callbacks: + */ + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_AddTraceback("gevent._greenlet._call_spawn_callbacks", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_cb); + __Pyx_RefNannyFinishContext(); +} + +/* "src/gevent/greenlet.py":953 + * + * + * def killall(greenlets, exception=GreenletExit, block=True, timeout=None): # <<<<<<<<<<<<<< + * """ + * Forceably terminate all the ``greenlets`` by causing them to raise ``exception``. + */ + +static PyObject *__pyx_pf_6gevent_9_greenlet_7__defaults__(CYTHON_UNUSED PyObject *__pyx_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("__defaults__", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 953, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_exception); + __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_exception); + PyTuple_SET_ITEM(__pyx_t_1, 0, __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_exception); + __Pyx_INCREF(((PyObject *)Py_True)); + __Pyx_GIVEREF(((PyObject *)Py_True)); + PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)Py_True)); + __Pyx_INCREF(((PyObject *)Py_None)); + __Pyx_GIVEREF(((PyObject *)Py_None)); + PyTuple_SET_ITEM(__pyx_t_1, 2, ((PyObject *)Py_None)); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 953, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None); + __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent._greenlet.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_9_greenlet_5killall(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6gevent_9_greenlet_4killall[] = "killall(greenlets, exception=GreenletExit, block=True, timeout=None)\n\n Forceably terminate all the ``greenlets`` by causing them to raise ``exception``.\n\n .. caution:: Use care when killing greenlets. If they are not prepared for exceptions,\n this could result in corrupted state.\n\n :param greenlets: A **bounded** iterable of the non-None greenlets to terminate.\n *All* the items in this iterable must be greenlets that belong to the same thread.\n :keyword exception: The exception to raise in the greenlets. By default this is\n :class:`GreenletExit`.\n :keyword bool block: If True (the default) then this function only returns when all the\n greenlets are dead; the current greenlet is unscheduled during that process.\n If greenlets ignore the initial exception raised in them,\n then they will be joined (with :func:`gevent.joinall`) and allowed to die naturally.\n If False, this function returns immediately and greenlets will raise\n the exception asynchronously.\n :keyword float timeout: A time in seconds to wait for greenlets to die. If given, it is\n only honored when ``block`` is True.\n :raise Timeout: If blocking and a timeout is given that elapses before\n all the greenlets are dead.\n\n .. versionchanged:: 1.1a2\n *greenlets* can be any iterable of greenlets, like an iterator or a set.\n Previously it had to be a list or tuple.\n "; +static PyMethodDef __pyx_mdef_6gevent_9_greenlet_5killall = {"killall", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_9_greenlet_5killall, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_9_greenlet_4killall}; +static PyObject *__pyx_pw_6gevent_9_greenlet_5killall(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_greenlets = 0; + PyObject *__pyx_v_exception = 0; + PyObject *__pyx_v_block = 0; + PyObject *__pyx_v_timeout = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("killall (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_greenlets,&__pyx_n_s_exception,&__pyx_n_s_block,&__pyx_n_s_timeout,0}; + PyObject* values[4] = {0,0,0,0}; + __pyx_defaults *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self); + values[1] = __pyx_dynamic_args->__pyx_arg_exception; + values[2] = ((PyObject *)((PyObject *)Py_True)); + values[3] = ((PyObject *)((PyObject *)Py_None)); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_greenlets)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_exception); + if (value) { values[1] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 2: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_block); + if (value) { values[2] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 3: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_timeout); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "killall") < 0)) __PYX_ERR(0, 953, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_greenlets = values[0]; + __pyx_v_exception = values[1]; + __pyx_v_block = values[2]; + __pyx_v_timeout = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("killall", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 953, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent._greenlet.killall", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_9_greenlet_4killall(__pyx_self, __pyx_v_greenlets, __pyx_v_exception, __pyx_v_block, __pyx_v_timeout); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_9_greenlet_4killall(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_greenlets, PyObject *__pyx_v_exception, PyObject *__pyx_v_block, PyObject *__pyx_v_timeout) { + PyObject *__pyx_v_loop = NULL; + struct __pyx_obj_6gevent_8__waiter_Waiter *__pyx_v_waiter = NULL; + PyObject *__pyx_v_t = NULL; + PyObject *__pyx_v_alive = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + int __pyx_t_9; + char const *__pyx_t_10; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + PyObject *__pyx_t_14 = NULL; + PyObject *__pyx_t_15 = NULL; + PyObject *__pyx_t_16 = NULL; + __Pyx_RefNannySetupContext("killall", 0); + __Pyx_INCREF(__pyx_v_greenlets); + + /* "src/gevent/greenlet.py":980 + * """ + * # support non-indexable containers like iterators or set objects + * greenlets = list(greenlets) # <<<<<<<<<<<<<< + * if not greenlets: + * return + */ + __pyx_t_1 = PySequence_List(__pyx_v_greenlets); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 980, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF_SET(__pyx_v_greenlets, __pyx_t_1); + __pyx_t_1 = 0; + + /* "src/gevent/greenlet.py":981 + * # support non-indexable containers like iterators or set objects + * greenlets = list(greenlets) + * if not greenlets: # <<<<<<<<<<<<<< + * return + * loop = greenlets[0].loop + */ + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_greenlets); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 981, __pyx_L1_error) + __pyx_t_3 = ((!__pyx_t_2) != 0); + if (__pyx_t_3) { + + /* "src/gevent/greenlet.py":982 + * greenlets = list(greenlets) + * if not greenlets: + * return # <<<<<<<<<<<<<< + * loop = greenlets[0].loop + * if block: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + + /* "src/gevent/greenlet.py":981 + * # support non-indexable containers like iterators or set objects + * greenlets = list(greenlets) + * if not greenlets: # <<<<<<<<<<<<<< + * return + * loop = greenlets[0].loop + */ + } + + /* "src/gevent/greenlet.py":983 + * if not greenlets: + * return + * loop = greenlets[0].loop # <<<<<<<<<<<<<< + * if block: + * waiter = Waiter() # pylint:disable=undefined-variable + */ + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_greenlets, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 983, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_loop); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 983, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_loop = __pyx_t_4; + __pyx_t_4 = 0; + + /* "src/gevent/greenlet.py":984 + * return + * loop = greenlets[0].loop + * if block: # <<<<<<<<<<<<<< + * waiter = Waiter() # pylint:disable=undefined-variable + * loop.run_callback(_killall3, greenlets, exception, waiter) + */ + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_block); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 984, __pyx_L1_error) + if (__pyx_t_3) { + + /* "src/gevent/greenlet.py":985 + * loop = greenlets[0].loop + * if block: + * waiter = Waiter() # pylint:disable=undefined-variable # <<<<<<<<<<<<<< + * loop.run_callback(_killall3, greenlets, exception, waiter) + * t = Timeout._start_new_or_dummy(timeout) + */ + __pyx_t_4 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_6gevent_8__waiter_Waiter)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 985, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_v_waiter = ((struct __pyx_obj_6gevent_8__waiter_Waiter *)__pyx_t_4); + __pyx_t_4 = 0; + + /* "src/gevent/greenlet.py":986 + * if block: + * waiter = Waiter() # pylint:disable=undefined-variable + * loop.run_callback(_killall3, greenlets, exception, waiter) # <<<<<<<<<<<<<< + * t = Timeout._start_new_or_dummy(timeout) + * try: + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_loop, __pyx_n_s_run_callback); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 986, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_CFunc_object____list____object____object___to_py(__pyx_f_6gevent_9_greenlet__killall3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 986, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = NULL; + __pyx_t_7 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1); + if (likely(__pyx_t_6)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_1, function); + __pyx_t_7 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_1)) { + PyObject *__pyx_temp[5] = {__pyx_t_6, __pyx_t_5, __pyx_v_greenlets, __pyx_v_exception, ((PyObject *)__pyx_v_waiter)}; + __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_7, 4+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 986, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) { + PyObject *__pyx_temp[5] = {__pyx_t_6, __pyx_t_5, __pyx_v_greenlets, __pyx_v_exception, ((PyObject *)__pyx_v_waiter)}; + __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_7, 4+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 986, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } else + #endif + { + __pyx_t_8 = PyTuple_New(4+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 986, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + if (__pyx_t_6) { + __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL; + } + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_5); + __Pyx_INCREF(__pyx_v_greenlets); + __Pyx_GIVEREF(__pyx_v_greenlets); + PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_greenlets); + __Pyx_INCREF(__pyx_v_exception); + __Pyx_GIVEREF(__pyx_v_exception); + PyTuple_SET_ITEM(__pyx_t_8, 2+__pyx_t_7, __pyx_v_exception); + __Pyx_INCREF(((PyObject *)__pyx_v_waiter)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_waiter)); + PyTuple_SET_ITEM(__pyx_t_8, 3+__pyx_t_7, ((PyObject *)__pyx_v_waiter)); + __pyx_t_5 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 986, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "src/gevent/greenlet.py":987 + * waiter = Waiter() # pylint:disable=undefined-variable + * loop.run_callback(_killall3, greenlets, exception, waiter) + * t = Timeout._start_new_or_dummy(timeout) # <<<<<<<<<<<<<< + * try: + * alive = waiter.get() + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_6gevent_9_greenlet_Timeout, __pyx_n_s_start_new_or_dummy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 987, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_8 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { + __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_1); + if (likely(__pyx_t_8)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); + __Pyx_INCREF(__pyx_t_8); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_1, function); + } + } + __pyx_t_4 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_8, __pyx_v_timeout) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_timeout); + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 987, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_t = __pyx_t_4; + __pyx_t_4 = 0; + + /* "src/gevent/greenlet.py":988 + * loop.run_callback(_killall3, greenlets, exception, waiter) + * t = Timeout._start_new_or_dummy(timeout) + * try: # <<<<<<<<<<<<<< + * alive = waiter.get() + * if alive: + */ + /*try:*/ { + + /* "src/gevent/greenlet.py":989 + * t = Timeout._start_new_or_dummy(timeout) + * try: + * alive = waiter.get() # <<<<<<<<<<<<<< + * if alive: + * joinall(alive, raise_error=False) + */ + __pyx_t_4 = ((struct __pyx_vtabstruct_6gevent_8__waiter_Waiter *)__pyx_v_waiter->__pyx_vtab)->get(__pyx_v_waiter, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 989, __pyx_L6_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_v_alive = __pyx_t_4; + __pyx_t_4 = 0; + + /* "src/gevent/greenlet.py":990 + * try: + * alive = waiter.get() + * if alive: # <<<<<<<<<<<<<< + * joinall(alive, raise_error=False) + * finally: + */ + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_alive); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 990, __pyx_L6_error) + if (__pyx_t_3) { + + /* "src/gevent/greenlet.py":991 + * alive = waiter.get() + * if alive: + * joinall(alive, raise_error=False) # <<<<<<<<<<<<<< + * finally: + * t.cancel() + */ + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_joinall); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 991, __pyx_L6_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 991, __pyx_L6_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_alive); + __Pyx_GIVEREF(__pyx_v_alive); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_alive); + __pyx_t_8 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 991, __pyx_L6_error) + __Pyx_GOTREF(__pyx_t_8); + if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_raise_error, Py_False) < 0) __PYX_ERR(0, 991, __pyx_L6_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_1, __pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 991, __pyx_L6_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "src/gevent/greenlet.py":990 + * try: + * alive = waiter.get() + * if alive: # <<<<<<<<<<<<<< + * joinall(alive, raise_error=False) + * finally: + */ + } + } + + /* "src/gevent/greenlet.py":993 + * joinall(alive, raise_error=False) + * finally: + * t.cancel() # <<<<<<<<<<<<<< + * else: + * loop.run_callback(_killall, greenlets, exception) + */ + /*finally:*/ { + /*normal exit:*/{ + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_t, __pyx_n_s_cancel); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 993, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_1 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) { + __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_8); + if (likely(__pyx_t_1)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); + __Pyx_INCREF(__pyx_t_1); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_8, function); + } + } + __pyx_t_5 = (__pyx_t_1) ? __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_1) : __Pyx_PyObject_CallNoArg(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 993, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + goto __pyx_L7; + } + __pyx_L6_error:; + /*exception exit:*/{ + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_14, &__pyx_t_15, &__pyx_t_16); + if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13) < 0)) __Pyx_ErrFetch(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13); + __Pyx_XGOTREF(__pyx_t_11); + __Pyx_XGOTREF(__pyx_t_12); + __Pyx_XGOTREF(__pyx_t_13); + __Pyx_XGOTREF(__pyx_t_14); + __Pyx_XGOTREF(__pyx_t_15); + __Pyx_XGOTREF(__pyx_t_16); + __pyx_t_7 = __pyx_lineno; __pyx_t_9 = __pyx_clineno; __pyx_t_10 = __pyx_filename; + { + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_t, __pyx_n_s_cancel); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 993, __pyx_L10_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_1 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) { + __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_8); + if (likely(__pyx_t_1)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); + __Pyx_INCREF(__pyx_t_1); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_8, function); + } + } + __pyx_t_5 = (__pyx_t_1) ? __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_1) : __Pyx_PyObject_CallNoArg(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 993, __pyx_L10_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + if (PY_MAJOR_VERSION >= 3) { + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_XGIVEREF(__pyx_t_15); + __Pyx_XGIVEREF(__pyx_t_16); + __Pyx_ExceptionReset(__pyx_t_14, __pyx_t_15, __pyx_t_16); + } + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_XGIVEREF(__pyx_t_12); + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_ErrRestore(__pyx_t_11, __pyx_t_12, __pyx_t_13); + __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; + __pyx_lineno = __pyx_t_7; __pyx_clineno = __pyx_t_9; __pyx_filename = __pyx_t_10; + goto __pyx_L1_error; + __pyx_L10_error:; + if (PY_MAJOR_VERSION >= 3) { + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_XGIVEREF(__pyx_t_15); + __Pyx_XGIVEREF(__pyx_t_16); + __Pyx_ExceptionReset(__pyx_t_14, __pyx_t_15, __pyx_t_16); + } + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; + goto __pyx_L1_error; + } + __pyx_L7:; + } + + /* "src/gevent/greenlet.py":984 + * return + * loop = greenlets[0].loop + * if block: # <<<<<<<<<<<<<< + * waiter = Waiter() # pylint:disable=undefined-variable + * loop.run_callback(_killall3, greenlets, exception, waiter) + */ + goto __pyx_L4; + } + + /* "src/gevent/greenlet.py":995 + * t.cancel() + * else: + * loop.run_callback(_killall, greenlets, exception) # <<<<<<<<<<<<<< + * + * def _init(): + */ + /*else*/ { + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_loop, __pyx_n_s_run_callback); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 995, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_1 = __Pyx_CFunc_object____list____object___to_py(__pyx_f_6gevent_9_greenlet__killall); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 995, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = NULL; + __pyx_t_9 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_8); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_8, function); + __pyx_t_9 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_8)) { + PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_t_1, __pyx_v_greenlets, __pyx_v_exception}; + __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_9, 3+__pyx_t_9); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 995, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_8)) { + PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_t_1, __pyx_v_greenlets, __pyx_v_exception}; + __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_9, 3+__pyx_t_9); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 995, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else + #endif + { + __pyx_t_6 = PyTuple_New(3+__pyx_t_9); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 995, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (__pyx_t_4) { + __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL; + } + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_9, __pyx_t_1); + __Pyx_INCREF(__pyx_v_greenlets); + __Pyx_GIVEREF(__pyx_v_greenlets); + PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_9, __pyx_v_greenlets); + __Pyx_INCREF(__pyx_v_exception); + __Pyx_GIVEREF(__pyx_v_exception); + PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_9, __pyx_v_exception); + __pyx_t_1 = 0; + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 995, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + __pyx_L4:; + + /* "src/gevent/greenlet.py":953 + * + * + * def killall(greenlets, exception=GreenletExit, block=True, timeout=None): # <<<<<<<<<<<<<< + * """ + * Forceably terminate all the ``greenlets`` by causing them to raise ``exception``. + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("gevent._greenlet.killall", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_loop); + __Pyx_XDECREF((PyObject *)__pyx_v_waiter); + __Pyx_XDECREF(__pyx_v_t); + __Pyx_XDECREF(__pyx_v_alive); + __Pyx_XDECREF(__pyx_v_greenlets); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/greenlet.py":997 + * loop.run_callback(_killall, greenlets, exception) + * + * def _init(): # <<<<<<<<<<<<<< + * greenlet_init() # pylint:disable=undefined-variable + * + */ + +static void __pyx_f_6gevent_9_greenlet__init(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_init", 0); + + /* "src/gevent/greenlet.py":998 + * + * def _init(): + * greenlet_init() # pylint:disable=undefined-variable # <<<<<<<<<<<<<< + * + * _init() + */ + __pyx_f_6gevent_9_greenlet_greenlet_init(); + + /* "src/gevent/greenlet.py":997 + * loop.run_callback(_killall, greenlets, exception) + * + * def _init(): # <<<<<<<<<<<<<< + * greenlet_init() # pylint:disable=undefined-variable + * + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "gevent/__greenlet_primitives.pxd":23 + * + * @cython.final + * cdef inline greenlet getcurrent(): # <<<<<<<<<<<<<< + * return PyGreenlet_GetCurrent() + * + */ + +static CYTHON_INLINE PyGreenlet *__pyx_f_6gevent_21__greenlet_primitives_getcurrent(void) { + PyGreenlet *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("getcurrent", 0); + + /* "gevent/__greenlet_primitives.pxd":24 + * @cython.final + * cdef inline greenlet getcurrent(): + * return PyGreenlet_GetCurrent() # <<<<<<<<<<<<<< + * + * cdef bint _greenlet_imported + */ + __Pyx_XDECREF(((PyObject *)__pyx_r)); + __pyx_t_1 = ((PyObject *)PyGreenlet_GetCurrent()); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 24, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = ((PyGreenlet *)__pyx_t_1); + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "gevent/__greenlet_primitives.pxd":23 + * + * @cython.final + * cdef inline greenlet getcurrent(): # <<<<<<<<<<<<<< + * return PyGreenlet_GetCurrent() + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__greenlet_primitives.getcurrent", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF((PyObject *)__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/__greenlet_primitives.pxd":28 + * cdef bint _greenlet_imported + * + * cdef inline void greenlet_init(): # <<<<<<<<<<<<<< + * global _greenlet_imported + * if not _greenlet_imported: + */ + +static CYTHON_INLINE void __pyx_f_6gevent_21__greenlet_primitives_greenlet_init(void) { + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("greenlet_init", 0); + + /* "gevent/__greenlet_primitives.pxd":30 + * cdef inline void greenlet_init(): + * global _greenlet_imported + * if not _greenlet_imported: # <<<<<<<<<<<<<< + * PyGreenlet_Import() + * _greenlet_imported = True + */ + __pyx_t_1 = ((!(__pyx_v_6gevent_21__greenlet_primitives__greenlet_imported != 0)) != 0); + if (__pyx_t_1) { + + /* "gevent/__greenlet_primitives.pxd":31 + * global _greenlet_imported + * if not _greenlet_imported: + * PyGreenlet_Import() # <<<<<<<<<<<<<< + * _greenlet_imported = True + * + */ + PyGreenlet_Import(); + + /* "gevent/__greenlet_primitives.pxd":32 + * if not _greenlet_imported: + * PyGreenlet_Import() + * _greenlet_imported = True # <<<<<<<<<<<<<< + * + * cdef inline object _greenlet_switch(greenlet self): + */ + __pyx_v_6gevent_21__greenlet_primitives__greenlet_imported = 1; + + /* "gevent/__greenlet_primitives.pxd":30 + * cdef inline void greenlet_init(): + * global _greenlet_imported + * if not _greenlet_imported: # <<<<<<<<<<<<<< + * PyGreenlet_Import() + * _greenlet_imported = True + */ + } + + /* "gevent/__greenlet_primitives.pxd":28 + * cdef bint _greenlet_imported + * + * cdef inline void greenlet_init(): # <<<<<<<<<<<<<< + * global _greenlet_imported + * if not _greenlet_imported: + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "gevent/__greenlet_primitives.pxd":34 + * _greenlet_imported = True + * + * cdef inline object _greenlet_switch(greenlet self): # <<<<<<<<<<<<<< + * return PyGreenlet_Switch(self, NULL, NULL) + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_6gevent_21__greenlet_primitives__greenlet_switch(PyGreenlet *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("_greenlet_switch", 0); + + /* "gevent/__greenlet_primitives.pxd":35 + * + * cdef inline object _greenlet_switch(greenlet self): + * return PyGreenlet_Switch(self, NULL, NULL) # <<<<<<<<<<<<<< + * + * cdef class TrackedRawGreenlet(greenlet): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyGreenlet_Switch(__pyx_v_self, NULL, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 35, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "gevent/__greenlet_primitives.pxd":34 + * _greenlet_imported = True + * + * cdef inline object _greenlet_switch(greenlet self): # <<<<<<<<<<<<<< + * return PyGreenlet_Switch(self, NULL, NULL) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__greenlet_primitives._greenlet_switch", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/__waiter.pxd":24 + * void PyGreenlet_Import() + * + * cdef inline greenlet getcurrent(): # <<<<<<<<<<<<<< + * return PyGreenlet_GetCurrent() + * + */ + +static CYTHON_INLINE PyGreenlet *__pyx_f_6gevent_8__waiter_getcurrent(void) { + PyGreenlet *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("getcurrent", 0); + + /* "gevent/__waiter.pxd":25 + * + * cdef inline greenlet getcurrent(): + * return PyGreenlet_GetCurrent() # <<<<<<<<<<<<<< + * + * cdef inline void greenlet_init(): + */ + __Pyx_XDECREF(((PyObject *)__pyx_r)); + __pyx_t_1 = ((PyObject *)PyGreenlet_GetCurrent()); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 25, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = ((PyGreenlet *)__pyx_t_1); + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "gevent/__waiter.pxd":24 + * void PyGreenlet_Import() + * + * cdef inline greenlet getcurrent(): # <<<<<<<<<<<<<< + * return PyGreenlet_GetCurrent() + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__waiter.getcurrent", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF((PyObject *)__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/__waiter.pxd":27 + * return PyGreenlet_GetCurrent() + * + * cdef inline void greenlet_init(): # <<<<<<<<<<<<<< + * global _greenlet_imported + * if not _greenlet_imported: + */ + +static CYTHON_INLINE void __pyx_f_6gevent_8__waiter_greenlet_init(void) { + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("greenlet_init", 0); + + /* "gevent/__waiter.pxd":29 + * cdef inline void greenlet_init(): + * global _greenlet_imported + * if not _greenlet_imported: # <<<<<<<<<<<<<< + * PyGreenlet_Import() + * _greenlet_imported = True + */ + __pyx_t_1 = ((!(__pyx_v_6gevent_8__waiter__greenlet_imported != 0)) != 0); + if (__pyx_t_1) { + + /* "gevent/__waiter.pxd":30 + * global _greenlet_imported + * if not _greenlet_imported: + * PyGreenlet_Import() # <<<<<<<<<<<<<< + * _greenlet_imported = True + * + */ + PyGreenlet_Import(); + + /* "gevent/__waiter.pxd":31 + * if not _greenlet_imported: + * PyGreenlet_Import() + * _greenlet_imported = True # <<<<<<<<<<<<<< + * + * cdef class Waiter: + */ + __pyx_v_6gevent_8__waiter__greenlet_imported = 1; + + /* "gevent/__waiter.pxd":29 + * cdef inline void greenlet_init(): + * global _greenlet_imported + * if not _greenlet_imported: # <<<<<<<<<<<<<< + * PyGreenlet_Import() + * _greenlet_imported = True + */ + } + + /* "gevent/__waiter.pxd":27 + * return PyGreenlet_GetCurrent() + * + * cdef inline void greenlet_init(): # <<<<<<<<<<<<<< + * global _greenlet_imported + * if not _greenlet_imported: + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "gevent/_greenlet.pxd":27 + * + * @cython.final + * cdef inline greenlet getcurrent(): # <<<<<<<<<<<<<< + * return PyGreenlet_GetCurrent() + * + */ + +static CYTHON_INLINE PyGreenlet *__pyx_f_6gevent_9_greenlet_getcurrent(void) { + PyGreenlet *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("getcurrent", 0); + + /* "gevent/_greenlet.pxd":28 + * @cython.final + * cdef inline greenlet getcurrent(): + * return PyGreenlet_GetCurrent() # <<<<<<<<<<<<<< + * + * cdef bint _greenlet_imported + */ + __Pyx_XDECREF(((PyObject *)__pyx_r)); + __pyx_t_1 = ((PyObject *)PyGreenlet_GetCurrent()); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 28, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = ((PyGreenlet *)__pyx_t_1); + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "gevent/_greenlet.pxd":27 + * + * @cython.final + * cdef inline greenlet getcurrent(): # <<<<<<<<<<<<<< + * return PyGreenlet_GetCurrent() + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent._greenlet.getcurrent", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF((PyObject *)__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/_greenlet.pxd":32 + * cdef bint _greenlet_imported + * + * cdef inline void greenlet_init(): # <<<<<<<<<<<<<< + * global _greenlet_imported + * if not _greenlet_imported: + */ + +static CYTHON_INLINE void __pyx_f_6gevent_9_greenlet_greenlet_init(void) { + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("greenlet_init", 0); + + /* "gevent/_greenlet.pxd":34 + * cdef inline void greenlet_init(): + * global _greenlet_imported + * if not _greenlet_imported: # <<<<<<<<<<<<<< + * PyGreenlet_Import() + * _greenlet_imported = True + */ + __pyx_t_1 = ((!(__pyx_v_6gevent_9_greenlet__greenlet_imported != 0)) != 0); + if (__pyx_t_1) { + + /* "gevent/_greenlet.pxd":35 + * global _greenlet_imported + * if not _greenlet_imported: + * PyGreenlet_Import() # <<<<<<<<<<<<<< + * _greenlet_imported = True + * + */ + PyGreenlet_Import(); + + /* "gevent/_greenlet.pxd":36 + * if not _greenlet_imported: + * PyGreenlet_Import() + * _greenlet_imported = True # <<<<<<<<<<<<<< + * + * cdef extern from "Python.h": + */ + __pyx_v_6gevent_9_greenlet__greenlet_imported = 1; + + /* "gevent/_greenlet.pxd":34 + * cdef inline void greenlet_init(): + * global _greenlet_imported + * if not _greenlet_imported: # <<<<<<<<<<<<<< + * PyGreenlet_Import() + * _greenlet_imported = True + */ + } + + /* "gevent/_greenlet.pxd":32 + * cdef bint _greenlet_imported + * + * cdef inline void greenlet_init(): # <<<<<<<<<<<<<< + * global _greenlet_imported + * if not _greenlet_imported: + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "cfunc.to_py":65 + * @cname("__Pyx_CFunc_object____list____object____object___to_py") + * cdef object __Pyx_CFunc_object____list____object____object___to_py(object (*f)(list, object, object) ): + * def wrap(list greenlets, object exception, object waiter): # <<<<<<<<<<<<<< + * """wrap(greenlets: list, exception, waiter)""" + * return f(greenlets, exception, waiter) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_11cfunc_dot_to_py_54__Pyx_CFunc_object____list____object____object___to_py_1wrap(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_11cfunc_dot_to_py_54__Pyx_CFunc_object____list____object____object___to_py_wrap[] = "wrap(greenlets: list, exception, waiter)"; +static PyMethodDef __pyx_mdef_11cfunc_dot_to_py_54__Pyx_CFunc_object____list____object____object___to_py_1wrap = {"wrap", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11cfunc_dot_to_py_54__Pyx_CFunc_object____list____object____object___to_py_1wrap, METH_VARARGS|METH_KEYWORDS, __pyx_doc_11cfunc_dot_to_py_54__Pyx_CFunc_object____list____object____object___to_py_wrap}; +static PyObject *__pyx_pw_11cfunc_dot_to_py_54__Pyx_CFunc_object____list____object____object___to_py_1wrap(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_greenlets = 0; + PyObject *__pyx_v_exception = 0; + PyObject *__pyx_v_waiter = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("wrap (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_greenlets,&__pyx_n_s_exception,&__pyx_n_s_waiter,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_greenlets)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_exception)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("wrap", 1, 3, 3, 1); __PYX_ERR(4, 65, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_waiter)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("wrap", 1, 3, 3, 2); __PYX_ERR(4, 65, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "wrap") < 0)) __PYX_ERR(4, 65, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + } + __pyx_v_greenlets = ((PyObject*)values[0]); + __pyx_v_exception = values[1]; + __pyx_v_waiter = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("wrap", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(4, 65, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("cfunc.to_py.__Pyx_CFunc_object____list____object____object___to_py.wrap", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_greenlets), (&PyList_Type), 1, "greenlets", 1))) __PYX_ERR(4, 65, __pyx_L1_error) + __pyx_r = __pyx_pf_11cfunc_dot_to_py_54__Pyx_CFunc_object____list____object____object___to_py_wrap(__pyx_self, __pyx_v_greenlets, __pyx_v_exception, __pyx_v_waiter); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_11cfunc_dot_to_py_54__Pyx_CFunc_object____list____object____object___to_py_wrap(PyObject *__pyx_self, PyObject *__pyx_v_greenlets, PyObject *__pyx_v_exception, PyObject *__pyx_v_waiter) { + struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_object____list____object____object___to_py *__pyx_cur_scope; + struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_object____list____object____object___to_py *__pyx_outer_scope; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("wrap", 0); + __pyx_outer_scope = (struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_object____list____object____object___to_py *) __Pyx_CyFunction_GetClosure(__pyx_self); + __pyx_cur_scope = __pyx_outer_scope; + + /* "cfunc.to_py":67 + * def wrap(list greenlets, object exception, object waiter): + * """wrap(greenlets: list, exception, waiter)""" + * return f(greenlets, exception, waiter) # <<<<<<<<<<<<<< + * return wrap + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_cur_scope->__pyx_v_f(__pyx_v_greenlets, __pyx_v_exception, __pyx_v_waiter); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 67, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "cfunc.to_py":65 + * @cname("__Pyx_CFunc_object____list____object____object___to_py") + * cdef object __Pyx_CFunc_object____list____object____object___to_py(object (*f)(list, object, object) ): + * def wrap(list greenlets, object exception, object waiter): # <<<<<<<<<<<<<< + * """wrap(greenlets: list, exception, waiter)""" + * return f(greenlets, exception, waiter) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("cfunc.to_py.__Pyx_CFunc_object____list____object____object___to_py.wrap", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "cfunc.to_py":64 + * + * @cname("__Pyx_CFunc_object____list____object____object___to_py") + * cdef object __Pyx_CFunc_object____list____object____object___to_py(object (*f)(list, object, object) ): # <<<<<<<<<<<<<< + * def wrap(list greenlets, object exception, object waiter): + * """wrap(greenlets: list, exception, waiter)""" + */ + +static PyObject *__Pyx_CFunc_object____list____object____object___to_py(PyObject *(*__pyx_v_f)(PyObject *, PyObject *, PyObject *)) { + struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_object____list____object____object___to_py *__pyx_cur_scope; + PyObject *__pyx_v_wrap = 0; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__Pyx_CFunc_object____list____object____object___to_py", 0); + __pyx_cur_scope = (struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_object____list____object____object___to_py *)__pyx_tp_new___pyx_scope_struct____Pyx_CFunc_object____list____object____object___to_py(__pyx_ptype___pyx_scope_struct____Pyx_CFunc_object____list____object____object___to_py, __pyx_empty_tuple, NULL); + if (unlikely(!__pyx_cur_scope)) { + __pyx_cur_scope = ((struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_object____list____object____object___to_py *)Py_None); + __Pyx_INCREF(Py_None); + __PYX_ERR(4, 64, __pyx_L1_error) + } else { + __Pyx_GOTREF(__pyx_cur_scope); + } + __pyx_cur_scope->__pyx_v_f = __pyx_v_f; + + /* "cfunc.to_py":65 + * @cname("__Pyx_CFunc_object____list____object____object___to_py") + * cdef object __Pyx_CFunc_object____list____object____object___to_py(object (*f)(list, object, object) ): + * def wrap(list greenlets, object exception, object waiter): # <<<<<<<<<<<<<< + * """wrap(greenlets: list, exception, waiter)""" + * return f(greenlets, exception, waiter) + */ + __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_11cfunc_dot_to_py_54__Pyx_CFunc_object____list____object____object___to_py_1wrap, 0, __pyx_n_s_Pyx_CFunc_object____list____ob, ((PyObject*)__pyx_cur_scope), __pyx_n_s_cfunc_to_py, __pyx_d, ((PyObject *)__pyx_codeobj__18)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 65, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_wrap = __pyx_t_1; + __pyx_t_1 = 0; + + /* "cfunc.to_py":68 + * """wrap(greenlets: list, exception, waiter)""" + * return f(greenlets, exception, waiter) + * return wrap # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_wrap); + __pyx_r = __pyx_v_wrap; + goto __pyx_L0; + + /* "cfunc.to_py":64 + * + * @cname("__Pyx_CFunc_object____list____object____object___to_py") + * cdef object __Pyx_CFunc_object____list____object____object___to_py(object (*f)(list, object, object) ): # <<<<<<<<<<<<<< + * def wrap(list greenlets, object exception, object waiter): + * """wrap(greenlets: list, exception, waiter)""" + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("cfunc.to_py.__Pyx_CFunc_object____list____object____object___to_py", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_wrap); + __Pyx_DECREF(((PyObject *)__pyx_cur_scope)); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "cfunc.to_py":65 + * @cname("__Pyx_CFunc_object____list____object___to_py") + * cdef object __Pyx_CFunc_object____list____object___to_py(object (*f)(list, object) ): + * def wrap(list greenlets, object exception): # <<<<<<<<<<<<<< + * """wrap(greenlets: list, exception)""" + * return f(greenlets, exception) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_11cfunc_dot_to_py_44__Pyx_CFunc_object____list____object___to_py_1wrap(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_11cfunc_dot_to_py_44__Pyx_CFunc_object____list____object___to_py_wrap[] = "wrap(greenlets: list, exception)"; +static PyMethodDef __pyx_mdef_11cfunc_dot_to_py_44__Pyx_CFunc_object____list____object___to_py_1wrap = {"wrap", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11cfunc_dot_to_py_44__Pyx_CFunc_object____list____object___to_py_1wrap, METH_VARARGS|METH_KEYWORDS, __pyx_doc_11cfunc_dot_to_py_44__Pyx_CFunc_object____list____object___to_py_wrap}; +static PyObject *__pyx_pw_11cfunc_dot_to_py_44__Pyx_CFunc_object____list____object___to_py_1wrap(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_greenlets = 0; + PyObject *__pyx_v_exception = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("wrap (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_greenlets,&__pyx_n_s_exception,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_greenlets)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_exception)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("wrap", 1, 2, 2, 1); __PYX_ERR(4, 65, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "wrap") < 0)) __PYX_ERR(4, 65, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_greenlets = ((PyObject*)values[0]); + __pyx_v_exception = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("wrap", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(4, 65, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("cfunc.to_py.__Pyx_CFunc_object____list____object___to_py.wrap", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_greenlets), (&PyList_Type), 1, "greenlets", 1))) __PYX_ERR(4, 65, __pyx_L1_error) + __pyx_r = __pyx_pf_11cfunc_dot_to_py_44__Pyx_CFunc_object____list____object___to_py_wrap(__pyx_self, __pyx_v_greenlets, __pyx_v_exception); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_11cfunc_dot_to_py_44__Pyx_CFunc_object____list____object___to_py_wrap(PyObject *__pyx_self, PyObject *__pyx_v_greenlets, PyObject *__pyx_v_exception) { + struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_object____list____object___to_py *__pyx_cur_scope; + struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_object____list____object___to_py *__pyx_outer_scope; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("wrap", 0); + __pyx_outer_scope = (struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_object____list____object___to_py *) __Pyx_CyFunction_GetClosure(__pyx_self); + __pyx_cur_scope = __pyx_outer_scope; + + /* "cfunc.to_py":67 + * def wrap(list greenlets, object exception): + * """wrap(greenlets: list, exception)""" + * return f(greenlets, exception) # <<<<<<<<<<<<<< + * return wrap + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_cur_scope->__pyx_v_f(__pyx_v_greenlets, __pyx_v_exception); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 67, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "cfunc.to_py":65 + * @cname("__Pyx_CFunc_object____list____object___to_py") + * cdef object __Pyx_CFunc_object____list____object___to_py(object (*f)(list, object) ): + * def wrap(list greenlets, object exception): # <<<<<<<<<<<<<< + * """wrap(greenlets: list, exception)""" + * return f(greenlets, exception) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("cfunc.to_py.__Pyx_CFunc_object____list____object___to_py.wrap", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "cfunc.to_py":64 + * + * @cname("__Pyx_CFunc_object____list____object___to_py") + * cdef object __Pyx_CFunc_object____list____object___to_py(object (*f)(list, object) ): # <<<<<<<<<<<<<< + * def wrap(list greenlets, object exception): + * """wrap(greenlets: list, exception)""" + */ + +static PyObject *__Pyx_CFunc_object____list____object___to_py(PyObject *(*__pyx_v_f)(PyObject *, PyObject *)) { + struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_object____list____object___to_py *__pyx_cur_scope; + PyObject *__pyx_v_wrap = 0; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__Pyx_CFunc_object____list____object___to_py", 0); + __pyx_cur_scope = (struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_object____list____object___to_py *)__pyx_tp_new___pyx_scope_struct____Pyx_CFunc_object____list____object___to_py(__pyx_ptype___pyx_scope_struct____Pyx_CFunc_object____list____object___to_py, __pyx_empty_tuple, NULL); + if (unlikely(!__pyx_cur_scope)) { + __pyx_cur_scope = ((struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_object____list____object___to_py *)Py_None); + __Pyx_INCREF(Py_None); + __PYX_ERR(4, 64, __pyx_L1_error) + } else { + __Pyx_GOTREF(__pyx_cur_scope); + } + __pyx_cur_scope->__pyx_v_f = __pyx_v_f; + + /* "cfunc.to_py":65 + * @cname("__Pyx_CFunc_object____list____object___to_py") + * cdef object __Pyx_CFunc_object____list____object___to_py(object (*f)(list, object) ): + * def wrap(list greenlets, object exception): # <<<<<<<<<<<<<< + * """wrap(greenlets: list, exception)""" + * return f(greenlets, exception) + */ + __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_11cfunc_dot_to_py_44__Pyx_CFunc_object____list____object___to_py_1wrap, 0, __pyx_n_s_Pyx_CFunc_object____list____ob_2, ((PyObject*)__pyx_cur_scope), __pyx_n_s_cfunc_to_py, __pyx_d, ((PyObject *)__pyx_codeobj__20)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 65, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_wrap = __pyx_t_1; + __pyx_t_1 = 0; + + /* "cfunc.to_py":68 + * """wrap(greenlets: list, exception)""" + * return f(greenlets, exception) + * return wrap # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_wrap); + __pyx_r = __pyx_v_wrap; + goto __pyx_L0; + + /* "cfunc.to_py":64 + * + * @cname("__Pyx_CFunc_object____list____object___to_py") + * cdef object __Pyx_CFunc_object____list____object___to_py(object (*f)(list, object) ): # <<<<<<<<<<<<<< + * def wrap(list greenlets, object exception): + * """wrap(greenlets: list, exception)""" + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("cfunc.to_py.__Pyx_CFunc_object____list____object___to_py", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_wrap); + __Pyx_DECREF(((PyObject *)__pyx_cur_scope)); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_tp_new_6gevent_9_greenlet_SpawnedLink(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + struct __pyx_obj_6gevent_9_greenlet_SpawnedLink *p; + PyObject *o; + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_6gevent_9_greenlet_SpawnedLink *)o); + p->callback = Py_None; Py_INCREF(Py_None); + return o; +} + +static void __pyx_tp_dealloc_6gevent_9_greenlet_SpawnedLink(PyObject *o) { + struct __pyx_obj_6gevent_9_greenlet_SpawnedLink *p = (struct __pyx_obj_6gevent_9_greenlet_SpawnedLink *)o; + #if CYTHON_USE_TP_FINALIZE + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + PyObject_GC_UnTrack(o); + Py_CLEAR(p->callback); + (*Py_TYPE(o)->tp_free)(o); +} + +static int __pyx_tp_traverse_6gevent_9_greenlet_SpawnedLink(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_6gevent_9_greenlet_SpawnedLink *p = (struct __pyx_obj_6gevent_9_greenlet_SpawnedLink *)o; + if (p->callback) { + e = (*v)(p->callback, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_6gevent_9_greenlet_SpawnedLink(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_6gevent_9_greenlet_SpawnedLink *p = (struct __pyx_obj_6gevent_9_greenlet_SpawnedLink *)o; + tmp = ((PyObject*)p->callback); + p->callback = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyObject *__pyx_tp_getattro_6gevent_9_greenlet_SpawnedLink(PyObject *o, PyObject *n) { + PyObject *v = __Pyx_PyObject_GenericGetAttr(o, n); + if (!v && PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_Clear(); + v = __pyx_pw_6gevent_9_greenlet_11SpawnedLink_13__getattr__(o, n); + } + return v; +} + +static PyObject *__pyx_tp_richcompare_6gevent_9_greenlet_SpawnedLink(PyObject *o1, PyObject *o2, int op) { + switch (op) { + case Py_EQ: { + return __pyx_pw_6gevent_9_greenlet_11SpawnedLink_7__eq__(o1, o2); + } + case Py_NE: { + PyObject *ret; + ret = __pyx_pw_6gevent_9_greenlet_11SpawnedLink_7__eq__(o1, o2); + if (likely(ret && ret != Py_NotImplemented)) { + int b = __Pyx_PyObject_IsTrue(ret); Py_DECREF(ret); + if (unlikely(b < 0)) return NULL; + ret = (b) ? Py_False : Py_True; + Py_INCREF(ret); + } + return ret; + } + default: { + return __Pyx_NewRef(Py_NotImplemented); + } + } +} + +static PyObject *__pyx_getprop_6gevent_9_greenlet_11SpawnedLink_callback(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_9_greenlet_11SpawnedLink_8callback_1__get__(o); +} + +static int __pyx_setprop_6gevent_9_greenlet_11SpawnedLink_callback(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6gevent_9_greenlet_11SpawnedLink_8callback_3__set__(o, v); + } + else { + return __pyx_pw_6gevent_9_greenlet_11SpawnedLink_8callback_5__del__(o); + } +} + +static PyMethodDef __pyx_methods_6gevent_9_greenlet_SpawnedLink[] = { + {"__getattr__", (PyCFunction)__pyx_pw_6gevent_9_greenlet_11SpawnedLink_13__getattr__, METH_O|METH_COEXIST, 0}, + {0, 0, 0, 0} +}; + +static struct PyGetSetDef __pyx_getsets_6gevent_9_greenlet_SpawnedLink[] = { + {(char *)"callback", __pyx_getprop_6gevent_9_greenlet_11SpawnedLink_callback, __pyx_setprop_6gevent_9_greenlet_11SpawnedLink_callback, (char *)"callback: object", 0}, + {0, 0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_6gevent_9_greenlet_SpawnedLink = { + PyVarObject_HEAD_INIT(0, 0) + "gevent._greenlet.SpawnedLink", /*tp_name*/ + sizeof(struct __pyx_obj_6gevent_9_greenlet_SpawnedLink), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6gevent_9_greenlet_SpawnedLink, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + __pyx_pw_6gevent_9_greenlet_11SpawnedLink_11__repr__, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + __pyx_pw_6gevent_9_greenlet_11SpawnedLink_5__hash__, /*tp_hash*/ + __pyx_pw_6gevent_9_greenlet_11SpawnedLink_3__call__, /*tp_call*/ + __pyx_pw_6gevent_9_greenlet_11SpawnedLink_9__str__, /*tp_str*/ + __pyx_tp_getattro_6gevent_9_greenlet_SpawnedLink, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + "SpawnedLink(callback)\n\n A wrapper around link that calls it in another greenlet.\n\n Can be called only from main loop.\n ", /*tp_doc*/ + __pyx_tp_traverse_6gevent_9_greenlet_SpawnedLink, /*tp_traverse*/ + __pyx_tp_clear_6gevent_9_greenlet_SpawnedLink, /*tp_clear*/ + __pyx_tp_richcompare_6gevent_9_greenlet_SpawnedLink, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6gevent_9_greenlet_SpawnedLink, /*tp_methods*/ + 0, /*tp_members*/ + __pyx_getsets_6gevent_9_greenlet_SpawnedLink, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_pw_6gevent_9_greenlet_11SpawnedLink_1__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6gevent_9_greenlet_SpawnedLink, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static PyObject *__pyx_tp_new_6gevent_9_greenlet_SuccessSpawnedLink(PyTypeObject *t, PyObject *a, PyObject *k) { + PyObject *o = __pyx_tp_new_6gevent_9_greenlet_SpawnedLink(t, a, k); + if (unlikely(!o)) return 0; + return o; +} + +static PyMethodDef __pyx_methods_6gevent_9_greenlet_SuccessSpawnedLink[] = { + {0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_6gevent_9_greenlet_SuccessSpawnedLink = { + PyVarObject_HEAD_INIT(0, 0) + "gevent._greenlet.SuccessSpawnedLink", /*tp_name*/ + sizeof(struct __pyx_obj_6gevent_9_greenlet_SuccessSpawnedLink), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6gevent_9_greenlet_SpawnedLink, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_6gevent_9_greenlet_11SpawnedLink_11__repr__, /*tp_repr*/ + #else + 0, /*tp_repr*/ + #endif + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + __pyx_pw_6gevent_9_greenlet_18SuccessSpawnedLink_1__call__, /*tp_call*/ + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_6gevent_9_greenlet_11SpawnedLink_9__str__, /*tp_str*/ + #else + 0, /*tp_str*/ + #endif + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + "A wrapper around link that calls it in another greenlet only if source succeed.\n\n Can be called only from main loop.\n ", /*tp_doc*/ + __pyx_tp_traverse_6gevent_9_greenlet_SpawnedLink, /*tp_traverse*/ + __pyx_tp_clear_6gevent_9_greenlet_SpawnedLink, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6gevent_9_greenlet_SuccessSpawnedLink, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_6gevent_9_greenlet_11SpawnedLink_1__init__, /*tp_init*/ + #else + 0, /*tp_init*/ + #endif + 0, /*tp_alloc*/ + __pyx_tp_new_6gevent_9_greenlet_SuccessSpawnedLink, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static PyObject *__pyx_tp_new_6gevent_9_greenlet_FailureSpawnedLink(PyTypeObject *t, PyObject *a, PyObject *k) { + PyObject *o = __pyx_tp_new_6gevent_9_greenlet_SpawnedLink(t, a, k); + if (unlikely(!o)) return 0; + return o; +} + +static PyMethodDef __pyx_methods_6gevent_9_greenlet_FailureSpawnedLink[] = { + {0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_6gevent_9_greenlet_FailureSpawnedLink = { + PyVarObject_HEAD_INIT(0, 0) + "gevent._greenlet.FailureSpawnedLink", /*tp_name*/ + sizeof(struct __pyx_obj_6gevent_9_greenlet_FailureSpawnedLink), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6gevent_9_greenlet_SpawnedLink, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_6gevent_9_greenlet_11SpawnedLink_11__repr__, /*tp_repr*/ + #else + 0, /*tp_repr*/ + #endif + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + __pyx_pw_6gevent_9_greenlet_18FailureSpawnedLink_1__call__, /*tp_call*/ + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_6gevent_9_greenlet_11SpawnedLink_9__str__, /*tp_str*/ + #else + 0, /*tp_str*/ + #endif + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + "A wrapper around link that calls it in another greenlet only if source failed.\n\n Can be called only from main loop.\n ", /*tp_doc*/ + __pyx_tp_traverse_6gevent_9_greenlet_SpawnedLink, /*tp_traverse*/ + __pyx_tp_clear_6gevent_9_greenlet_SpawnedLink, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6gevent_9_greenlet_FailureSpawnedLink, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_6gevent_9_greenlet_11SpawnedLink_1__init__, /*tp_init*/ + #else + 0, /*tp_init*/ + #endif + 0, /*tp_alloc*/ + __pyx_tp_new_6gevent_9_greenlet_FailureSpawnedLink, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static PyObject *__pyx_tp_new_6gevent_9_greenlet__Frame(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + struct __pyx_obj_6gevent_9_greenlet__Frame *p; + PyObject *o; + o = (*t->tp_alloc)(t, 0); + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_6gevent_9_greenlet__Frame *)o); + p->f_code = ((PyCodeObject *)Py_None); Py_INCREF(Py_None); + p->f_back = ((struct __pyx_obj_6gevent_9_greenlet__Frame *)Py_None); Py_INCREF(Py_None); + return o; +} + +static void __pyx_tp_dealloc_6gevent_9_greenlet__Frame(PyObject *o) { + struct __pyx_obj_6gevent_9_greenlet__Frame *p = (struct __pyx_obj_6gevent_9_greenlet__Frame *)o; + PyObject_GC_UnTrack(o); + Py_CLEAR(p->f_code); + Py_CLEAR(p->f_back); + (*Py_TYPE(o)->tp_free)(o); +} + +static int __pyx_tp_traverse_6gevent_9_greenlet__Frame(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_6gevent_9_greenlet__Frame *p = (struct __pyx_obj_6gevent_9_greenlet__Frame *)o; + if (p->f_code) { + e = (*v)(((PyObject *)p->f_code), a); if (e) return e; + } + if (p->f_back) { + e = (*v)(((PyObject *)p->f_back), a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_6gevent_9_greenlet__Frame(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_6gevent_9_greenlet__Frame *p = (struct __pyx_obj_6gevent_9_greenlet__Frame *)o; + tmp = ((PyObject*)p->f_code); + p->f_code = ((PyCodeObject *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->f_back); + p->f_back = ((struct __pyx_obj_6gevent_9_greenlet__Frame *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyObject *__pyx_getprop_6gevent_9_greenlet_6_Frame_f_globals(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_9_greenlet_6_Frame_9f_globals_1__get__(o); +} + +static PyObject *__pyx_getprop_6gevent_9_greenlet_6_Frame_f_code(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_9_greenlet_6_Frame_6f_code_1__get__(o); +} + +static PyObject *__pyx_getprop_6gevent_9_greenlet_6_Frame_f_lineno(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_9_greenlet_6_Frame_8f_lineno_1__get__(o); +} + +static PyObject *__pyx_getprop_6gevent_9_greenlet_6_Frame_f_back(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_9_greenlet_6_Frame_6f_back_1__get__(o); +} + +static PyMethodDef __pyx_methods_6gevent_9_greenlet__Frame[] = { + {0, 0, 0, 0} +}; + +static struct PyGetSetDef __pyx_getsets_6gevent_9_greenlet__Frame[] = { + {(char *)"f_globals", __pyx_getprop_6gevent_9_greenlet_6_Frame_f_globals, 0, (char *)0, 0}, + {(char *)"f_code", __pyx_getprop_6gevent_9_greenlet_6_Frame_f_code, 0, (char *)0, 0}, + {(char *)"f_lineno", __pyx_getprop_6gevent_9_greenlet_6_Frame_f_lineno, 0, (char *)0, 0}, + {(char *)"f_back", __pyx_getprop_6gevent_9_greenlet_6_Frame_f_back, 0, (char *)0, 0}, + {0, 0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_6gevent_9_greenlet__Frame = { + PyVarObject_HEAD_INIT(0, 0) + "gevent._greenlet._Frame", /*tp_name*/ + sizeof(struct __pyx_obj_6gevent_9_greenlet__Frame), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6gevent_9_greenlet__Frame, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + "_Frame(f_code, f_lineno, f_back)", /*tp_doc*/ + __pyx_tp_traverse_6gevent_9_greenlet__Frame, /*tp_traverse*/ + __pyx_tp_clear_6gevent_9_greenlet__Frame, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6gevent_9_greenlet__Frame, /*tp_methods*/ + 0, /*tp_members*/ + __pyx_getsets_6gevent_9_greenlet__Frame, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_pw_6gevent_9_greenlet_6_Frame_1__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6gevent_9_greenlet__Frame, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; +static struct __pyx_vtabstruct_6gevent_9_greenlet_Greenlet __pyx_vtable_6gevent_9_greenlet_Greenlet; + +static PyObject *__pyx_tp_new_6gevent_9_greenlet_Greenlet(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_6gevent_9_greenlet_Greenlet *p; + PyObject *o = __pyx_ptype_6gevent_9_greenlet_greenlet->tp_new(t, a, k); + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_6gevent_9_greenlet_Greenlet *)o); + p->__pyx_vtab = __pyx_vtabptr_6gevent_9_greenlet_Greenlet; + p->value = Py_None; Py_INCREF(Py_None); + p->args = ((PyObject*)Py_None); Py_INCREF(Py_None); + p->kwargs = ((PyObject*)Py_None); Py_INCREF(Py_None); + p->spawning_greenlet = Py_None; Py_INCREF(Py_None); + p->spawn_tree_locals = ((PyObject*)Py_None); Py_INCREF(Py_None); + p->_spawning_stack_frames = ((PyObject*)Py_None); Py_INCREF(Py_None); + p->_links = ((PyObject*)Py_None); Py_INCREF(Py_None); + p->_exc_info = ((PyObject*)Py_None); Py_INCREF(Py_None); + p->_notifier = Py_None; Py_INCREF(Py_None); + p->_start_event = Py_None; Py_INCREF(Py_None); + p->_formatted_info = ((PyObject*)Py_None); Py_INCREF(Py_None); + p->_ident = Py_None; Py_INCREF(Py_None); + return o; +} + +static void __pyx_tp_dealloc_6gevent_9_greenlet_Greenlet(PyObject *o) { + struct __pyx_obj_6gevent_9_greenlet_Greenlet *p = (struct __pyx_obj_6gevent_9_greenlet_Greenlet *)o; + #if CYTHON_USE_TP_FINALIZE + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + PyObject_GC_UnTrack(o); + Py_CLEAR(p->value); + Py_CLEAR(p->args); + Py_CLEAR(p->kwargs); + Py_CLEAR(p->spawning_greenlet); + Py_CLEAR(p->spawn_tree_locals); + Py_CLEAR(p->_spawning_stack_frames); + Py_CLEAR(p->_links); + Py_CLEAR(p->_exc_info); + Py_CLEAR(p->_notifier); + Py_CLEAR(p->_start_event); + Py_CLEAR(p->_formatted_info); + Py_CLEAR(p->_ident); + #if CYTHON_USE_TYPE_SLOTS + if (PyType_IS_GC(Py_TYPE(o)->tp_base)) + #endif + PyObject_GC_Track(o); + if (likely(__pyx_ptype_6gevent_9_greenlet_greenlet)) __pyx_ptype_6gevent_9_greenlet_greenlet->tp_dealloc(o); else __Pyx_call_next_tp_dealloc(o, __pyx_tp_dealloc_6gevent_9_greenlet_Greenlet); +} + +static int __pyx_tp_traverse_6gevent_9_greenlet_Greenlet(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_6gevent_9_greenlet_Greenlet *p = (struct __pyx_obj_6gevent_9_greenlet_Greenlet *)o; + e = ((likely(__pyx_ptype_6gevent_9_greenlet_greenlet)) ? ((__pyx_ptype_6gevent_9_greenlet_greenlet->tp_traverse) ? __pyx_ptype_6gevent_9_greenlet_greenlet->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_6gevent_9_greenlet_Greenlet)); if (e) return e; + if (p->value) { + e = (*v)(p->value, a); if (e) return e; + } + if (p->args) { + e = (*v)(p->args, a); if (e) return e; + } + if (p->kwargs) { + e = (*v)(p->kwargs, a); if (e) return e; + } + if (p->spawning_greenlet) { + e = (*v)(p->spawning_greenlet, a); if (e) return e; + } + if (p->spawn_tree_locals) { + e = (*v)(p->spawn_tree_locals, a); if (e) return e; + } + if (p->_spawning_stack_frames) { + e = (*v)(p->_spawning_stack_frames, a); if (e) return e; + } + if (p->_links) { + e = (*v)(p->_links, a); if (e) return e; + } + if (p->_exc_info) { + e = (*v)(p->_exc_info, a); if (e) return e; + } + if (p->_notifier) { + e = (*v)(p->_notifier, a); if (e) return e; + } + if (p->_start_event) { + e = (*v)(p->_start_event, a); if (e) return e; + } + if (p->_ident) { + e = (*v)(p->_ident, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_6gevent_9_greenlet_Greenlet(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_6gevent_9_greenlet_Greenlet *p = (struct __pyx_obj_6gevent_9_greenlet_Greenlet *)o; + if (likely(__pyx_ptype_6gevent_9_greenlet_greenlet)) { if (__pyx_ptype_6gevent_9_greenlet_greenlet->tp_clear) __pyx_ptype_6gevent_9_greenlet_greenlet->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_6gevent_9_greenlet_Greenlet); + tmp = ((PyObject*)p->value); + p->value = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->args); + p->args = ((PyObject*)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->kwargs); + p->kwargs = ((PyObject*)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->spawning_greenlet); + p->spawning_greenlet = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->spawn_tree_locals); + p->spawn_tree_locals = ((PyObject*)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->_spawning_stack_frames); + p->_spawning_stack_frames = ((PyObject*)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->_links); + p->_links = ((PyObject*)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->_exc_info); + p->_exc_info = ((PyObject*)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->_notifier); + p->_notifier = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->_start_event); + p->_start_event = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->_ident); + p->_ident = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyObject *__pyx_getprop_6gevent_9_greenlet_8Greenlet_minimal_ident(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_9_greenlet_8Greenlet_13minimal_ident_1__get__(o); +} + +static PyObject *__pyx_getprop_6gevent_9_greenlet_8Greenlet_loop(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_9_greenlet_8Greenlet_4loop_1__get__(o); +} + +static PyObject *__pyx_getprop_6gevent_9_greenlet_8Greenlet_dead(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_9_greenlet_8Greenlet_4dead_1__get__(o); +} + +static PyObject *__pyx_getprop_6gevent_9_greenlet_8Greenlet_started(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_9_greenlet_8Greenlet_7started_1__get__(o); +} + +static PyObject *__pyx_getprop_6gevent_9_greenlet_8Greenlet_exception(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_9_greenlet_8Greenlet_9exception_1__get__(o); +} + +static PyObject *__pyx_getprop_6gevent_9_greenlet_8Greenlet_exc_info(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_9_greenlet_8Greenlet_8exc_info_1__get__(o); +} + +static PyObject *__pyx_getprop_6gevent_9_greenlet_8Greenlet_value(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_9_greenlet_8Greenlet_5value_1__get__(o); +} + +static PyObject *__pyx_getprop_6gevent_9_greenlet_8Greenlet_args(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_9_greenlet_8Greenlet_4args_1__get__(o); +} + +static PyObject *__pyx_getprop_6gevent_9_greenlet_8Greenlet_kwargs(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_9_greenlet_8Greenlet_6kwargs_1__get__(o); +} + +static PyObject *__pyx_getprop_6gevent_9_greenlet_8Greenlet_spawning_greenlet(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_9_greenlet_8Greenlet_17spawning_greenlet_1__get__(o); +} + +static PyObject *__pyx_getprop_6gevent_9_greenlet_8Greenlet_spawn_tree_locals(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_9_greenlet_8Greenlet_17spawn_tree_locals_1__get__(o); +} + +static int __pyx_setprop_6gevent_9_greenlet_8Greenlet_spawn_tree_locals(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6gevent_9_greenlet_8Greenlet_17spawn_tree_locals_3__set__(o, v); + } + else { + return __pyx_pw_6gevent_9_greenlet_8Greenlet_17spawn_tree_locals_5__del__(o); + } +} + +static PyObject *__pyx_getprop_6gevent_9_greenlet_8Greenlet__spawning_stack_frames(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_9_greenlet_8Greenlet_22_spawning_stack_frames_1__get__(o); +} + +static PyMethodDef __pyx_methods_6gevent_9_greenlet_Greenlet[] = { + {"spawning_stack", (PyCFunction)__pyx_pw_6gevent_9_greenlet_8Greenlet_3spawning_stack, METH_NOARGS, __pyx_doc_6gevent_9_greenlet_8Greenlet_2spawning_stack}, + {"name", (PyCFunction)__pyx_pw_6gevent_9_greenlet_8Greenlet_5name, METH_NOARGS, __pyx_doc_6gevent_9_greenlet_8Greenlet_4name}, + {"_raise_exception", (PyCFunction)__pyx_pw_6gevent_9_greenlet_8Greenlet_7_raise_exception, METH_NOARGS, __pyx_doc_6gevent_9_greenlet_8Greenlet_6_raise_exception}, + {"throw", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_9_greenlet_8Greenlet_19throw, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_9_greenlet_8Greenlet_18throw}, + {"start", (PyCFunction)__pyx_pw_6gevent_9_greenlet_8Greenlet_21start, METH_NOARGS, __pyx_doc_6gevent_9_greenlet_8Greenlet_20start}, + {"start_later", (PyCFunction)__pyx_pw_6gevent_9_greenlet_8Greenlet_23start_later, METH_O, __pyx_doc_6gevent_9_greenlet_8Greenlet_22start_later}, + {"add_spawn_callback", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_9_greenlet_8Greenlet_25add_spawn_callback, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_9_greenlet_8Greenlet_24add_spawn_callback}, + {"remove_spawn_callback", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_9_greenlet_8Greenlet_27remove_spawn_callback, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_9_greenlet_8Greenlet_26remove_spawn_callback}, + {"spawn", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_9_greenlet_8Greenlet_29spawn, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_9_greenlet_8Greenlet_28spawn}, + {"spawn_later", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_9_greenlet_8Greenlet_31spawn_later, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_9_greenlet_8Greenlet_30spawn_later}, + {"kill", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_9_greenlet_8Greenlet_33kill, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_9_greenlet_8Greenlet_32kill}, + {"get", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_9_greenlet_8Greenlet_35get, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_9_greenlet_8Greenlet_34get}, + {"run", (PyCFunction)__pyx_pw_6gevent_9_greenlet_8Greenlet_39run, METH_NOARGS, __pyx_doc_6gevent_9_greenlet_8Greenlet_38run}, + {"_run", (PyCFunction)__pyx_pw_6gevent_9_greenlet_8Greenlet_41_run, METH_NOARGS, __pyx_doc_6gevent_9_greenlet_8Greenlet_40_run}, + {"link", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_9_greenlet_8Greenlet_47link, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_9_greenlet_8Greenlet_46link}, + {"unlink", (PyCFunction)__pyx_pw_6gevent_9_greenlet_8Greenlet_49unlink, METH_O, __pyx_doc_6gevent_9_greenlet_8Greenlet_48unlink}, + {"unlink_all", (PyCFunction)__pyx_pw_6gevent_9_greenlet_8Greenlet_51unlink_all, METH_NOARGS, __pyx_doc_6gevent_9_greenlet_8Greenlet_50unlink_all}, + {"link_value", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_9_greenlet_8Greenlet_53link_value, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_9_greenlet_8Greenlet_52link_value}, + {"link_exception", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_9_greenlet_8Greenlet_55link_exception, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_9_greenlet_8Greenlet_54link_exception}, + {0, 0, 0, 0} +}; + +static struct PyGetSetDef __pyx_getsets_6gevent_9_greenlet_Greenlet[] = { + {(char *)"minimal_ident", __pyx_getprop_6gevent_9_greenlet_8Greenlet_minimal_ident, 0, (char *)"\n A small, unique integer that identifies this object.\n\n This is similar to :attr:`threading.Thread.ident` (and `id`)\n in that as long as this object is alive, no other greenlet *in\n this hub* will have the same id, but it makes a stronger\n guarantee that the assigned values will be small and\n sequential. Sometime after this object has died, the value\n will be available for reuse.\n\n To get ids that are unique across all hubs, combine this with\n the hub's ``minimal_ident``.\n\n .. versionadded:: 1.3a2\n ", 0}, + {(char *)"loop", __pyx_getprop_6gevent_9_greenlet_8Greenlet_loop, 0, (char *)0, 0}, + {(char *)"dead", __pyx_getprop_6gevent_9_greenlet_8Greenlet_dead, 0, (char *)"Boolean indicating that the greenlet is dead and will not run again.", 0}, + {(char *)"started", __pyx_getprop_6gevent_9_greenlet_8Greenlet_started, 0, (char *)0, 0}, + {(char *)"exception", __pyx_getprop_6gevent_9_greenlet_8Greenlet_exception, 0, (char *)"\n Holds the exception instance raised by the function if the\n greenlet has finished with an error. Otherwise ``None``.\n ", 0}, + {(char *)"exc_info", __pyx_getprop_6gevent_9_greenlet_8Greenlet_exc_info, 0, (char *)"\n Holds the exc_info three-tuple raised by the function if the\n greenlet finished with an error. Otherwise a false value.\n\n .. note:: This is a provisional API and may change.\n\n .. versionadded:: 1.1\n ", 0}, + {(char *)"value", __pyx_getprop_6gevent_9_greenlet_8Greenlet_value, 0, (char *)0, 0}, + {(char *)"args", __pyx_getprop_6gevent_9_greenlet_8Greenlet_args, 0, (char *)0, 0}, + {(char *)"kwargs", __pyx_getprop_6gevent_9_greenlet_8Greenlet_kwargs, 0, (char *)0, 0}, + {(char *)"spawning_greenlet", __pyx_getprop_6gevent_9_greenlet_8Greenlet_spawning_greenlet, 0, (char *)0, 0}, + {(char *)"spawn_tree_locals", __pyx_getprop_6gevent_9_greenlet_8Greenlet_spawn_tree_locals, __pyx_setprop_6gevent_9_greenlet_8Greenlet_spawn_tree_locals, (char *)"spawn_tree_locals: dict", 0}, + {(char *)"_spawning_stack_frames", __pyx_getprop_6gevent_9_greenlet_8Greenlet__spawning_stack_frames, 0, (char *)0, 0}, + {0, 0, 0, 0, 0} +}; + +static PyNumberMethods __pyx_tp_as_number_Greenlet = { + 0, /*nb_add*/ + 0, /*nb_subtract*/ + 0, /*nb_multiply*/ + #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) + 0, /*nb_divide*/ + #endif + 0, /*nb_remainder*/ + 0, /*nb_divmod*/ + 0, /*nb_power*/ + 0, /*nb_negative*/ + 0, /*nb_positive*/ + 0, /*nb_absolute*/ + __pyx_pw_6gevent_9_greenlet_8Greenlet_9__nonzero__, /*nb_nonzero*/ + 0, /*nb_invert*/ + 0, /*nb_lshift*/ + 0, /*nb_rshift*/ + 0, /*nb_and*/ + 0, /*nb_xor*/ + 0, /*nb_or*/ + #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) + 0, /*nb_coerce*/ + #endif + 0, /*nb_int*/ + #if PY_MAJOR_VERSION < 3 + 0, /*nb_long*/ + #else + 0, /*reserved*/ + #endif + 0, /*nb_float*/ + #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) + 0, /*nb_oct*/ + #endif + #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) + 0, /*nb_hex*/ + #endif + 0, /*nb_inplace_add*/ + 0, /*nb_inplace_subtract*/ + 0, /*nb_inplace_multiply*/ + #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) + 0, /*nb_inplace_divide*/ + #endif + 0, /*nb_inplace_remainder*/ + 0, /*nb_inplace_power*/ + 0, /*nb_inplace_lshift*/ + 0, /*nb_inplace_rshift*/ + 0, /*nb_inplace_and*/ + 0, /*nb_inplace_xor*/ + 0, /*nb_inplace_or*/ + 0, /*nb_floor_divide*/ + 0, /*nb_true_divide*/ + 0, /*nb_inplace_floor_divide*/ + 0, /*nb_inplace_true_divide*/ + 0, /*nb_index*/ + #if PY_VERSION_HEX >= 0x03050000 + 0, /*nb_matrix_multiply*/ + #endif + #if PY_VERSION_HEX >= 0x03050000 + 0, /*nb_inplace_matrix_multiply*/ + #endif +}; + +static PyTypeObject __pyx_type_6gevent_9_greenlet_Greenlet = { + PyVarObject_HEAD_INIT(0, 0) + "gevent._greenlet.Greenlet", /*tp_name*/ + sizeof(struct __pyx_obj_6gevent_9_greenlet_Greenlet), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6gevent_9_greenlet_Greenlet, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + __pyx_pw_6gevent_9_greenlet_8Greenlet_15__repr__, /*tp_repr*/ + &__pyx_tp_as_number_Greenlet, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + "Greenlet(run=None, *args, **kwargs)\n\n A light-weight cooperatively-scheduled execution unit.\n ", /*tp_doc*/ + __pyx_tp_traverse_6gevent_9_greenlet_Greenlet, /*tp_traverse*/ + __pyx_tp_clear_6gevent_9_greenlet_Greenlet, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6gevent_9_greenlet_Greenlet, /*tp_methods*/ + 0, /*tp_members*/ + __pyx_getsets_6gevent_9_greenlet_Greenlet, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_pw_6gevent_9_greenlet_8Greenlet_1__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6gevent_9_greenlet_Greenlet, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; +static struct __pyx_vtabstruct_6gevent_9_greenlet__dummy_event __pyx_vtable_6gevent_9_greenlet__dummy_event; + +static PyObject *__pyx_tp_new_6gevent_9_greenlet__dummy_event(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + struct __pyx_obj_6gevent_9_greenlet__dummy_event *p; + PyObject *o; + o = (*t->tp_alloc)(t, 0); + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_6gevent_9_greenlet__dummy_event *)o); + p->__pyx_vtab = __pyx_vtabptr_6gevent_9_greenlet__dummy_event; + return o; +} + +static void __pyx_tp_dealloc_6gevent_9_greenlet__dummy_event(PyObject *o) { + (*Py_TYPE(o)->tp_free)(o); +} + +static PyObject *__pyx_getprop_6gevent_9_greenlet_12_dummy_event_pending(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_9_greenlet_12_dummy_event_7pending_1__get__(o); +} + +static PyObject *__pyx_getprop_6gevent_9_greenlet_12_dummy_event_active(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_9_greenlet_12_dummy_event_6active_1__get__(o); +} + +static PyMethodDef __pyx_methods_6gevent_9_greenlet__dummy_event[] = { + {0, 0, 0, 0} +}; + +static struct PyGetSetDef __pyx_getsets_6gevent_9_greenlet__dummy_event[] = { + {(char *)"pending", __pyx_getprop_6gevent_9_greenlet_12_dummy_event_pending, 0, (char *)0, 0}, + {(char *)"active", __pyx_getprop_6gevent_9_greenlet_12_dummy_event_active, 0, (char *)0, 0}, + {0, 0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_6gevent_9_greenlet__dummy_event = { + PyVarObject_HEAD_INIT(0, 0) + "gevent._greenlet._dummy_event", /*tp_name*/ + sizeof(struct __pyx_obj_6gevent_9_greenlet__dummy_event), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6gevent_9_greenlet__dummy_event, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER, /*tp_flags*/ + "_dummy_event()", /*tp_doc*/ + 0, /*tp_traverse*/ + 0, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6gevent_9_greenlet__dummy_event, /*tp_methods*/ + 0, /*tp_members*/ + __pyx_getsets_6gevent_9_greenlet__dummy_event, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_pw_6gevent_9_greenlet_12_dummy_event_1__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6gevent_9_greenlet__dummy_event, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_object____list____object____object___to_py *__pyx_freelist___pyx_scope_struct____Pyx_CFunc_object____list____object____object___to_py[8]; +static int __pyx_freecount___pyx_scope_struct____Pyx_CFunc_object____list____object____object___to_py = 0; + +static PyObject *__pyx_tp_new___pyx_scope_struct____Pyx_CFunc_object____list____object____object___to_py(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + PyObject *o; + if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount___pyx_scope_struct____Pyx_CFunc_object____list____object____object___to_py > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_object____list____object____object___to_py)))) { + o = (PyObject*)__pyx_freelist___pyx_scope_struct____Pyx_CFunc_object____list____object____object___to_py[--__pyx_freecount___pyx_scope_struct____Pyx_CFunc_object____list____object____object___to_py]; + memset(o, 0, sizeof(struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_object____list____object____object___to_py)); + (void) PyObject_INIT(o, t); + } else { + o = (*t->tp_alloc)(t, 0); + if (unlikely(!o)) return 0; + } + return o; +} + +static void __pyx_tp_dealloc___pyx_scope_struct____Pyx_CFunc_object____list____object____object___to_py(PyObject *o) { + if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount___pyx_scope_struct____Pyx_CFunc_object____list____object____object___to_py < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_object____list____object____object___to_py)))) { + __pyx_freelist___pyx_scope_struct____Pyx_CFunc_object____list____object____object___to_py[__pyx_freecount___pyx_scope_struct____Pyx_CFunc_object____list____object____object___to_py++] = ((struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_object____list____object____object___to_py *)o); + } else { + (*Py_TYPE(o)->tp_free)(o); + } +} + +static PyTypeObject __pyx_scope_struct____Pyx_CFunc_object____list____object____object___to_py = { + PyVarObject_HEAD_INIT(0, 0) + "gevent._greenlet.__pyx_scope_struct____Pyx_CFunc_object____list____object____object___to_py", /*tp_name*/ + sizeof(struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_object____list____object____object___to_py), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc___pyx_scope_struct____Pyx_CFunc_object____list____object____object___to_py, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER, /*tp_flags*/ + 0, /*tp_doc*/ + 0, /*tp_traverse*/ + 0, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + 0, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new___pyx_scope_struct____Pyx_CFunc_object____list____object____object___to_py, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_object____list____object___to_py *__pyx_freelist___pyx_scope_struct____Pyx_CFunc_object____list____object___to_py[8]; +static int __pyx_freecount___pyx_scope_struct____Pyx_CFunc_object____list____object___to_py = 0; + +static PyObject *__pyx_tp_new___pyx_scope_struct____Pyx_CFunc_object____list____object___to_py(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + PyObject *o; + if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount___pyx_scope_struct____Pyx_CFunc_object____list____object___to_py > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_object____list____object___to_py)))) { + o = (PyObject*)__pyx_freelist___pyx_scope_struct____Pyx_CFunc_object____list____object___to_py[--__pyx_freecount___pyx_scope_struct____Pyx_CFunc_object____list____object___to_py]; + memset(o, 0, sizeof(struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_object____list____object___to_py)); + (void) PyObject_INIT(o, t); + } else { + o = (*t->tp_alloc)(t, 0); + if (unlikely(!o)) return 0; + } + return o; +} + +static void __pyx_tp_dealloc___pyx_scope_struct____Pyx_CFunc_object____list____object___to_py(PyObject *o) { + if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount___pyx_scope_struct____Pyx_CFunc_object____list____object___to_py < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_object____list____object___to_py)))) { + __pyx_freelist___pyx_scope_struct____Pyx_CFunc_object____list____object___to_py[__pyx_freecount___pyx_scope_struct____Pyx_CFunc_object____list____object___to_py++] = ((struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_object____list____object___to_py *)o); + } else { + (*Py_TYPE(o)->tp_free)(o); + } +} + +static PyTypeObject __pyx_scope_struct____Pyx_CFunc_object____list____object___to_py = { + PyVarObject_HEAD_INIT(0, 0) + "gevent._greenlet.__pyx_scope_struct____Pyx_CFunc_object____list____object___to_py", /*tp_name*/ + sizeof(struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_object____list____object___to_py), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc___pyx_scope_struct____Pyx_CFunc_object____list____object___to_py, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER, /*tp_flags*/ + 0, /*tp_doc*/ + 0, /*tp_traverse*/ + 0, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + 0, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new___pyx_scope_struct____Pyx_CFunc_object____list____object___to_py, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static PyMethodDef __pyx_methods[] = { + {0, 0, 0, 0} +}; + +#if PY_MAJOR_VERSION >= 3 +#if CYTHON_PEP489_MULTI_PHASE_INIT +static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ +static int __pyx_pymod_exec__greenlet(PyObject* module); /*proto*/ +static PyModuleDef_Slot __pyx_moduledef_slots[] = { + {Py_mod_create, (void*)__pyx_pymod_create}, + {Py_mod_exec, (void*)__pyx_pymod_exec__greenlet}, + {0, NULL} +}; +#endif + +static struct PyModuleDef __pyx_moduledef = { + PyModuleDef_HEAD_INIT, + "_greenlet", + 0, /* m_doc */ + #if CYTHON_PEP489_MULTI_PHASE_INIT + 0, /* m_size */ + #else + -1, /* m_size */ + #endif + __pyx_methods /* m_methods */, + #if CYTHON_PEP489_MULTI_PHASE_INIT + __pyx_moduledef_slots, /* m_slots */ + #else + NULL, /* m_reload */ + #endif + NULL, /* m_traverse */ + NULL, /* m_clear */ + NULL /* m_free */ +}; +#endif +#ifndef CYTHON_SMALL_CODE +#if defined(__clang__) + #define CYTHON_SMALL_CODE +#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) + #define CYTHON_SMALL_CODE __attribute__((cold)) +#else + #define CYTHON_SMALL_CODE +#endif +#endif + +static __Pyx_StringTabEntry __pyx_string_tab[] = { + {&__pyx_n_s_AssertionError, __pyx_k_AssertionError, sizeof(__pyx_k_AssertionError), 0, 0, 1, 1}, + {&__pyx_n_s_AttributeError, __pyx_k_AttributeError, sizeof(__pyx_k_AttributeError), 0, 0, 1, 1}, + {&__pyx_kp_s_Cannot_start_the_dummy_event, __pyx_k_Cannot_start_the_dummy_event, sizeof(__pyx_k_Cannot_start_the_dummy_event), 0, 0, 1, 0}, + {&__pyx_kp_s_Expected_callable_r, __pyx_k_Expected_callable_r, sizeof(__pyx_k_Expected_callable_r), 0, 0, 1, 0}, + {&__pyx_n_s_FailureSpawnedLink, __pyx_k_FailureSpawnedLink, sizeof(__pyx_k_FailureSpawnedLink), 0, 0, 1, 1}, + {&__pyx_n_s_Frame, __pyx_k_Frame, sizeof(__pyx_k_Frame), 0, 0, 1, 1}, + {&__pyx_n_s_GEVENT_CONFIG, __pyx_k_GEVENT_CONFIG, sizeof(__pyx_k_GEVENT_CONFIG), 0, 0, 1, 1}, + {&__pyx_n_s_Greenlet, __pyx_k_Greenlet, sizeof(__pyx_k_Greenlet), 0, 0, 1, 1}, + {&__pyx_n_s_GreenletExit, __pyx_k_GreenletExit, sizeof(__pyx_k_GreenletExit), 0, 0, 1, 1}, + {&__pyx_n_s_Greenlet__formatinfo, __pyx_k_Greenlet__formatinfo, sizeof(__pyx_k_Greenlet__formatinfo), 0, 0, 1, 1}, + {&__pyx_n_s_Greenlet__notify_links, __pyx_k_Greenlet__notify_links, sizeof(__pyx_k_Greenlet__notify_links), 0, 0, 1, 1}, + {&__pyx_n_s_Greenlet__raise_exception, __pyx_k_Greenlet__raise_exception, sizeof(__pyx_k_Greenlet__raise_exception), 0, 0, 1, 1}, + {&__pyx_n_s_Greenlet__run, __pyx_k_Greenlet__run, sizeof(__pyx_k_Greenlet__run), 0, 0, 1, 1}, + {&__pyx_n_s_Greenlet_add_spawn_callback, __pyx_k_Greenlet_add_spawn_callback, sizeof(__pyx_k_Greenlet_add_spawn_callback), 0, 0, 1, 1}, + {&__pyx_kp_s_Greenlet_d, __pyx_k_Greenlet_d, sizeof(__pyx_k_Greenlet_d), 0, 0, 1, 0}, + {&__pyx_n_s_Greenlet_get, __pyx_k_Greenlet_get, sizeof(__pyx_k_Greenlet_get), 0, 0, 1, 1}, + {&__pyx_n_s_Greenlet_has_links, __pyx_k_Greenlet_has_links, sizeof(__pyx_k_Greenlet_has_links), 0, 0, 1, 1}, + {&__pyx_n_s_Greenlet_join, __pyx_k_Greenlet_join, sizeof(__pyx_k_Greenlet_join), 0, 0, 1, 1}, + {&__pyx_n_s_Greenlet_kill, __pyx_k_Greenlet_kill, sizeof(__pyx_k_Greenlet_kill), 0, 0, 1, 1}, + {&__pyx_n_s_Greenlet_link, __pyx_k_Greenlet_link, sizeof(__pyx_k_Greenlet_link), 0, 0, 1, 1}, + {&__pyx_n_s_Greenlet_link_exception, __pyx_k_Greenlet_link_exception, sizeof(__pyx_k_Greenlet_link_exception), 0, 0, 1, 1}, + {&__pyx_n_s_Greenlet_link_value, __pyx_k_Greenlet_link_value, sizeof(__pyx_k_Greenlet_link_value), 0, 0, 1, 1}, + {&__pyx_n_s_Greenlet_name, __pyx_k_Greenlet_name, sizeof(__pyx_k_Greenlet_name), 0, 0, 1, 1}, + {&__pyx_n_s_Greenlet_rawlink, __pyx_k_Greenlet_rawlink, sizeof(__pyx_k_Greenlet_rawlink), 0, 0, 1, 1}, + {&__pyx_n_s_Greenlet_ready, __pyx_k_Greenlet_ready, sizeof(__pyx_k_Greenlet_ready), 0, 0, 1, 1}, + {&__pyx_n_s_Greenlet_remove_spawn_callback, __pyx_k_Greenlet_remove_spawn_callback, sizeof(__pyx_k_Greenlet_remove_spawn_callback), 0, 0, 1, 1}, + {&__pyx_n_s_Greenlet_run, __pyx_k_Greenlet_run, sizeof(__pyx_k_Greenlet_run), 0, 0, 1, 1}, + {&__pyx_n_s_Greenlet_spawn, __pyx_k_Greenlet_spawn, sizeof(__pyx_k_Greenlet_spawn), 0, 0, 1, 1}, + {&__pyx_n_s_Greenlet_spawn_later, __pyx_k_Greenlet_spawn_later, sizeof(__pyx_k_Greenlet_spawn_later), 0, 0, 1, 1}, + {&__pyx_n_s_Greenlet_spawning_stack, __pyx_k_Greenlet_spawning_stack, sizeof(__pyx_k_Greenlet_spawning_stack), 0, 0, 1, 1}, + {&__pyx_n_s_Greenlet_start, __pyx_k_Greenlet_start, sizeof(__pyx_k_Greenlet_start), 0, 0, 1, 1}, + {&__pyx_n_s_Greenlet_start_later, __pyx_k_Greenlet_start_later, sizeof(__pyx_k_Greenlet_start_later), 0, 0, 1, 1}, + {&__pyx_n_s_Greenlet_successful, __pyx_k_Greenlet_successful, sizeof(__pyx_k_Greenlet_successful), 0, 0, 1, 1}, + {&__pyx_n_s_Greenlet_throw, __pyx_k_Greenlet_throw, sizeof(__pyx_k_Greenlet_throw), 0, 0, 1, 1}, + {&__pyx_n_s_Greenlet_unlink, __pyx_k_Greenlet_unlink, sizeof(__pyx_k_Greenlet_unlink), 0, 0, 1, 1}, + {&__pyx_n_s_Greenlet_unlink_all, __pyx_k_Greenlet_unlink_all, sizeof(__pyx_k_Greenlet_unlink_all), 0, 0, 1, 1}, + {&__pyx_n_s_InvalidSwitchError, __pyx_k_InvalidSwitchError, sizeof(__pyx_k_InvalidSwitchError), 0, 0, 1, 1}, + {&__pyx_kp_s_Invalid_switch_into_Greenlet_get, __pyx_k_Invalid_switch_into_Greenlet_get, sizeof(__pyx_k_Invalid_switch_into_Greenlet_get), 0, 0, 1, 0}, + {&__pyx_kp_s_Invalid_switch_into_Greenlet_joi, __pyx_k_Invalid_switch_into_Greenlet_joi, sizeof(__pyx_k_Invalid_switch_into_Greenlet_joi), 0, 0, 1, 0}, + {&__pyx_n_s_Lazy, __pyx_k_Lazy, sizeof(__pyx_k_Lazy), 0, 0, 1, 1}, + {&__pyx_n_s_NameError, __pyx_k_NameError, sizeof(__pyx_k_NameError), 0, 0, 1, 1}, + {&__pyx_n_s_PYPY, __pyx_k_PYPY, sizeof(__pyx_k_PYPY), 0, 0, 1, 1}, + {&__pyx_n_s_PYPY_2, __pyx_k_PYPY_2, sizeof(__pyx_k_PYPY_2), 0, 0, 1, 1}, + {&__pyx_n_s_Pyx_CFunc_object____list____ob, __pyx_k_Pyx_CFunc_object____list____ob, sizeof(__pyx_k_Pyx_CFunc_object____list____ob), 0, 0, 1, 1}, + {&__pyx_n_s_Pyx_CFunc_object____list____ob_2, __pyx_k_Pyx_CFunc_object____list____ob_2, sizeof(__pyx_k_Pyx_CFunc_object____list____ob_2), 0, 0, 1, 1}, + {&__pyx_n_s_SpawnedLink, __pyx_k_SpawnedLink, sizeof(__pyx_k_SpawnedLink), 0, 0, 1, 1}, + {&__pyx_n_s_SuccessSpawnedLink, __pyx_k_SuccessSpawnedLink, sizeof(__pyx_k_SuccessSpawnedLink), 0, 0, 1, 1}, + {&__pyx_kp_s_The_run_argument_or_self__run_mu, __pyx_k_The_run_argument_or_self__run_mu, sizeof(__pyx_k_The_run_argument_or_self__run_mu), 0, 0, 1, 0}, + {&__pyx_n_s_Timeout, __pyx_k_Timeout, sizeof(__pyx_k_Timeout), 0, 0, 1, 1}, + {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1}, + {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1}, + {&__pyx_n_s_Waiter, __pyx_k_Waiter, sizeof(__pyx_k_Waiter), 0, 0, 1, 1}, + {&__pyx_kp_s__2, __pyx_k__2, sizeof(__pyx_k__2), 0, 0, 1, 0}, + {&__pyx_kp_s__3, __pyx_k__3, sizeof(__pyx_k__3), 0, 0, 1, 0}, + {&__pyx_kp_s__4, __pyx_k__4, sizeof(__pyx_k__4), 0, 0, 1, 0}, + {&__pyx_kp_s__5, __pyx_k__5, sizeof(__pyx_k__5), 0, 0, 1, 0}, + {&__pyx_kp_s__6, __pyx_k__6, sizeof(__pyx_k__6), 0, 0, 1, 0}, + {&__pyx_kp_s__7, __pyx_k__7, sizeof(__pyx_k__7), 0, 0, 1, 0}, + {&__pyx_kp_s__8, __pyx_k__8, sizeof(__pyx_k__8), 0, 0, 1, 0}, + {&__pyx_n_s_active, __pyx_k_active, sizeof(__pyx_k_active), 0, 0, 1, 1}, + {&__pyx_n_s_add_spawn_callback, __pyx_k_add_spawn_callback, sizeof(__pyx_k_add_spawn_callback), 0, 0, 1, 1}, + {&__pyx_n_s_alive, __pyx_k_alive, sizeof(__pyx_k_alive), 0, 0, 1, 1}, + {&__pyx_n_s_all, __pyx_k_all, sizeof(__pyx_k_all), 0, 0, 1, 1}, + {&__pyx_n_s_args, __pyx_k_args, sizeof(__pyx_k_args), 0, 0, 1, 1}, + {&__pyx_n_s_block, __pyx_k_block, sizeof(__pyx_k_block), 0, 0, 1, 1}, + {&__pyx_n_s_bool, __pyx_k_bool, sizeof(__pyx_k_bool), 0, 0, 1, 1}, + {&__pyx_n_s_call, __pyx_k_call, sizeof(__pyx_k_call), 0, 0, 1, 1}, + {&__pyx_n_s_callback, __pyx_k_callback, sizeof(__pyx_k_callback), 0, 0, 1, 1}, + {&__pyx_n_s_cancel, __pyx_k_cancel, sizeof(__pyx_k_cancel), 0, 0, 1, 1}, + {&__pyx_n_s_cancelled_start_event, __pyx_k_cancelled_start_event, sizeof(__pyx_k_cancelled_start_event), 0, 0, 1, 1}, + {&__pyx_n_s_cb, __pyx_k_cb, sizeof(__pyx_k_cb), 0, 0, 1, 1}, + {&__pyx_n_s_cfunc_to_py, __pyx_k_cfunc_to_py, sizeof(__pyx_k_cfunc_to_py), 0, 0, 1, 1}, + {&__pyx_n_s_class, __pyx_k_class, sizeof(__pyx_k_class), 0, 0, 1, 1}, + {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, + {&__pyx_n_s_close, __pyx_k_close, sizeof(__pyx_k_close), 0, 0, 1, 1}, + {&__pyx_n_s_cls, __pyx_k_cls, sizeof(__pyx_k_cls), 0, 0, 1, 1}, + {&__pyx_n_s_config, __pyx_k_config, sizeof(__pyx_k_config), 0, 0, 1, 1}, + {&__pyx_n_s_continuation, __pyx_k_continuation, sizeof(__pyx_k_continuation), 0, 0, 1, 1}, + {&__pyx_n_s_continulet, __pyx_k_continulet, sizeof(__pyx_k_continulet), 0, 0, 1, 1}, + {&__pyx_n_s_continulet_2, __pyx_k_continulet_2, sizeof(__pyx_k_continulet_2), 0, 0, 1, 1}, + {&__pyx_n_s_count, __pyx_k_count, sizeof(__pyx_k_count), 0, 0, 1, 1}, + {&__pyx_n_s_dead, __pyx_k_dead, sizeof(__pyx_k_dead), 0, 0, 1, 1}, + {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1}, + {&__pyx_n_s_dummy_event, __pyx_k_dummy_event, sizeof(__pyx_k_dummy_event), 0, 0, 1, 1}, + {&__pyx_n_s_dummy_event_close, __pyx_k_dummy_event_close, sizeof(__pyx_k_dummy_event_close), 0, 0, 1, 1}, + {&__pyx_n_s_dummy_event_start, __pyx_k_dummy_event_start, sizeof(__pyx_k_dummy_event_start), 0, 0, 1, 1}, + {&__pyx_n_s_dummy_event_stop, __pyx_k_dummy_event_stop, sizeof(__pyx_k_dummy_event_stop), 0, 0, 1, 1}, + {&__pyx_n_s_dump_traceback, __pyx_k_dump_traceback, sizeof(__pyx_k_dump_traceback), 0, 0, 1, 1}, + {&__pyx_n_s_exc_info, __pyx_k_exc_info, sizeof(__pyx_k_exc_info), 0, 0, 1, 1}, + {&__pyx_n_s_exception, __pyx_k_exception, sizeof(__pyx_k_exception), 0, 0, 1, 1}, + {&__pyx_n_s_f_back, __pyx_k_f_back, sizeof(__pyx_k_f_back), 0, 0, 1, 1}, + {&__pyx_n_s_f_code, __pyx_k_f_code, sizeof(__pyx_k_f_code), 0, 0, 1, 1}, + {&__pyx_n_s_f_lineno, __pyx_k_f_lineno, sizeof(__pyx_k_f_lineno), 0, 0, 1, 1}, + {&__pyx_n_s_formatinfo, __pyx_k_formatinfo, sizeof(__pyx_k_formatinfo), 0, 0, 1, 1}, + {&__pyx_n_s_g, __pyx_k_g, sizeof(__pyx_k_g), 0, 0, 1, 1}, + {&__pyx_n_s_get, __pyx_k_get, sizeof(__pyx_k_get), 0, 0, 1, 1}, + {&__pyx_n_s_get_2, __pyx_k_get_2, sizeof(__pyx_k_get_2), 0, 0, 1, 1}, + {&__pyx_n_s_get_hub_class, __pyx_k_get_hub_class, sizeof(__pyx_k_get_hub_class), 0, 0, 1, 1}, + {&__pyx_n_s_get_hub_noargs, __pyx_k_get_hub_noargs, sizeof(__pyx_k_get_hub_noargs), 0, 0, 1, 1}, + {&__pyx_n_s_getcurrent, __pyx_k_getcurrent, sizeof(__pyx_k_getcurrent), 0, 0, 1, 1}, + {&__pyx_n_s_getframe, __pyx_k_getframe, sizeof(__pyx_k_getframe), 0, 0, 1, 1}, + {&__pyx_n_s_gevent, __pyx_k_gevent, sizeof(__pyx_k_gevent), 0, 0, 1, 1}, + {&__pyx_n_s_gevent__compat, __pyx_k_gevent__compat, sizeof(__pyx_k_gevent__compat), 0, 0, 1, 1}, + {&__pyx_n_s_gevent__config, __pyx_k_gevent__config, sizeof(__pyx_k_gevent__config), 0, 0, 1, 1}, + {&__pyx_n_s_gevent__greenlet, __pyx_k_gevent__greenlet, sizeof(__pyx_k_gevent__greenlet), 0, 0, 1, 1}, + {&__pyx_n_s_gevent__hub_local, __pyx_k_gevent__hub_local, sizeof(__pyx_k_gevent__hub_local), 0, 0, 1, 1}, + {&__pyx_n_s_gevent__hub_primitives, __pyx_k_gevent__hub_primitives, sizeof(__pyx_k_gevent__hub_primitives), 0, 0, 1, 1}, + {&__pyx_n_s_gevent__tblib, __pyx_k_gevent__tblib, sizeof(__pyx_k_gevent__tblib), 0, 0, 1, 1}, + {&__pyx_n_s_gevent__util, __pyx_k_gevent__util, sizeof(__pyx_k_gevent__util), 0, 0, 1, 1}, + {&__pyx_n_s_gevent_exceptions, __pyx_k_gevent_exceptions, sizeof(__pyx_k_gevent_exceptions), 0, 0, 1, 1}, + {&__pyx_n_s_gevent_timeout, __pyx_k_gevent_timeout, sizeof(__pyx_k_gevent_timeout), 0, 0, 1, 1}, + {&__pyx_n_s_glet, __pyx_k_glet, sizeof(__pyx_k_glet), 0, 0, 1, 1}, + {&__pyx_n_s_greenlet, __pyx_k_greenlet, sizeof(__pyx_k_greenlet), 0, 0, 1, 1}, + {&__pyx_n_s_greenlet__init, __pyx_k_greenlet__init, sizeof(__pyx_k_greenlet__init), 0, 0, 1, 1}, + {&__pyx_n_s_greenlet_imported, __pyx_k_greenlet_imported, sizeof(__pyx_k_greenlet_imported), 0, 0, 1, 1}, + {&__pyx_n_s_greenlet_init, __pyx_k_greenlet_init, sizeof(__pyx_k_greenlet_init), 0, 0, 1, 1}, + {&__pyx_n_s_greenlets, __pyx_k_greenlets, sizeof(__pyx_k_greenlets), 0, 0, 1, 1}, + {&__pyx_n_s_handle_error, __pyx_k_handle_error, sizeof(__pyx_k_handle_error), 0, 0, 1, 1}, + {&__pyx_n_s_has_links, __pyx_k_has_links, sizeof(__pyx_k_has_links), 0, 0, 1, 1}, + {&__pyx_n_s_hex, __pyx_k_hex, sizeof(__pyx_k_hex), 0, 0, 1, 1}, + {&__pyx_n_s_id, __pyx_k_id, sizeof(__pyx_k_id), 0, 0, 1, 1}, + {&__pyx_n_s_ident_registry, __pyx_k_ident_registry, sizeof(__pyx_k_ident_registry), 0, 0, 1, 1}, + {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, + {&__pyx_n_s_import_c_accel, __pyx_k_import_c_accel, sizeof(__pyx_k_import_c_accel), 0, 0, 1, 1}, + {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1}, + {&__pyx_n_s_items, __pyx_k_items, sizeof(__pyx_k_items), 0, 0, 1, 1}, + {&__pyx_n_s_iwait, __pyx_k_iwait, sizeof(__pyx_k_iwait), 0, 0, 1, 1}, + {&__pyx_n_s_iwait_on_objects, __pyx_k_iwait_on_objects, sizeof(__pyx_k_iwait_on_objects), 0, 0, 1, 1}, + {&__pyx_n_s_join, __pyx_k_join, sizeof(__pyx_k_join), 0, 0, 1, 1}, + {&__pyx_n_s_joinall, __pyx_k_joinall, sizeof(__pyx_k_joinall), 0, 0, 1, 1}, + {&__pyx_n_s_kill, __pyx_k_kill, sizeof(__pyx_k_kill), 0, 0, 1, 1}, + {&__pyx_n_s_kill_2, __pyx_k_kill_2, sizeof(__pyx_k_kill_2), 0, 0, 1, 1}, + {&__pyx_n_s_killall, __pyx_k_killall, sizeof(__pyx_k_killall), 0, 0, 1, 1}, + {&__pyx_n_s_kwargs, __pyx_k_kwargs, sizeof(__pyx_k_kwargs), 0, 0, 1, 1}, + {&__pyx_n_s_lambda, __pyx_k_lambda, sizeof(__pyx_k_lambda), 0, 0, 1, 1}, + {&__pyx_n_s_link, __pyx_k_link, sizeof(__pyx_k_link), 0, 0, 1, 1}, + {&__pyx_n_s_link_exception, __pyx_k_link_exception, sizeof(__pyx_k_link_exception), 0, 0, 1, 1}, + {&__pyx_n_s_link_value, __pyx_k_link_value, sizeof(__pyx_k_link_value), 0, 0, 1, 1}, + {&__pyx_n_s_load_traceback, __pyx_k_load_traceback, sizeof(__pyx_k_load_traceback), 0, 0, 1, 1}, + {&__pyx_n_s_loop, __pyx_k_loop, sizeof(__pyx_k_loop), 0, 0, 1, 1}, + {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, + {&__pyx_n_s_minimal_ident, __pyx_k_minimal_ident, sizeof(__pyx_k_minimal_ident), 0, 0, 1, 1}, + {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, + {&__pyx_n_s_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 0, 1, 1}, + {&__pyx_n_s_nonzero, __pyx_k_nonzero, sizeof(__pyx_k_nonzero), 0, 0, 1, 1}, + {&__pyx_n_s_notify_links, __pyx_k_notify_links, sizeof(__pyx_k_notify_links), 0, 0, 1, 1}, + {&__pyx_n_s_parent, __pyx_k_parent, sizeof(__pyx_k_parent), 0, 0, 1, 1}, + {&__pyx_n_s_pending, __pyx_k_pending, sizeof(__pyx_k_pending), 0, 0, 1, 1}, + {&__pyx_n_s_pop, __pyx_k_pop, sizeof(__pyx_k_pop), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_capi, __pyx_k_pyx_capi, sizeof(__pyx_k_pyx_capi), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1}, + {&__pyx_n_s_raise_error, __pyx_k_raise_error, sizeof(__pyx_k_raise_error), 0, 0, 1, 1}, + {&__pyx_n_s_raise_exception, __pyx_k_raise_exception, sizeof(__pyx_k_raise_exception), 0, 0, 1, 1}, + {&__pyx_n_s_rawlink, __pyx_k_rawlink, sizeof(__pyx_k_rawlink), 0, 0, 1, 1}, + {&__pyx_n_s_readproperty, __pyx_k_readproperty, sizeof(__pyx_k_readproperty), 0, 0, 1, 1}, + {&__pyx_n_s_ready, __pyx_k_ready, sizeof(__pyx_k_ready), 0, 0, 1, 1}, + {&__pyx_n_s_ref, __pyx_k_ref, sizeof(__pyx_k_ref), 0, 0, 1, 1}, + {&__pyx_n_s_remove, __pyx_k_remove, sizeof(__pyx_k_remove), 0, 0, 1, 1}, + {&__pyx_n_s_remove_spawn_callback, __pyx_k_remove_spawn_callback, sizeof(__pyx_k_remove_spawn_callback), 0, 0, 1, 1}, + {&__pyx_n_s_reraise, __pyx_k_reraise, sizeof(__pyx_k_reraise), 0, 0, 1, 1}, + {&__pyx_n_s_result, __pyx_k_result, sizeof(__pyx_k_result), 0, 0, 1, 1}, + {&__pyx_n_s_reversed, __pyx_k_reversed, sizeof(__pyx_k_reversed), 0, 0, 1, 1}, + {&__pyx_n_s_run, __pyx_k_run, sizeof(__pyx_k_run), 0, 0, 1, 1}, + {&__pyx_n_s_run_2, __pyx_k_run_2, sizeof(__pyx_k_run_2), 0, 0, 1, 1}, + {&__pyx_n_s_run_callback, __pyx_k_run_callback, sizeof(__pyx_k_run_callback), 0, 0, 1, 1}, + {&__pyx_kp_s_s, __pyx_k_s, sizeof(__pyx_k_s), 0, 0, 1, 0}, + {&__pyx_kp_s_s_s, __pyx_k_s_s, sizeof(__pyx_k_s_s), 0, 0, 1, 0}, + {&__pyx_kp_s_s_sat_s, __pyx_k_s_sat_s, sizeof(__pyx_k_s_sat_s), 0, 0, 1, 0}, + {&__pyx_n_s_seconds, __pyx_k_seconds, sizeof(__pyx_k_seconds), 0, 0, 1, 1}, + {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1}, + {&__pyx_n_s_self_2, __pyx_k_self_2, sizeof(__pyx_k_self_2), 0, 0, 1, 1}, + {&__pyx_n_s_slots, __pyx_k_slots, sizeof(__pyx_k_slots), 0, 0, 1, 1}, + {&__pyx_n_s_source, __pyx_k_source, sizeof(__pyx_k_source), 0, 0, 1, 1}, + {&__pyx_n_s_spawn, __pyx_k_spawn, sizeof(__pyx_k_spawn), 0, 0, 1, 1}, + {&__pyx_n_s_spawn_callbacks, __pyx_k_spawn_callbacks, sizeof(__pyx_k_spawn_callbacks), 0, 0, 1, 1}, + {&__pyx_n_s_spawn_later, __pyx_k_spawn_later, sizeof(__pyx_k_spawn_later), 0, 0, 1, 1}, + {&__pyx_n_s_spawn_tree_locals, __pyx_k_spawn_tree_locals, sizeof(__pyx_k_spawn_tree_locals), 0, 0, 1, 1}, + {&__pyx_n_s_spawning_stack, __pyx_k_spawning_stack, sizeof(__pyx_k_spawning_stack), 0, 0, 1, 1}, + {&__pyx_n_s_spawning_stack_frames, __pyx_k_spawning_stack_frames, sizeof(__pyx_k_spawning_stack_frames), 0, 0, 1, 1}, + {&__pyx_n_s_spawning_stack_limit, __pyx_k_spawning_stack_limit, sizeof(__pyx_k_spawning_stack_limit), 0, 0, 1, 1}, + {&__pyx_kp_s_src_gevent_greenlet_py, __pyx_k_src_gevent_greenlet_py, sizeof(__pyx_k_src_gevent_greenlet_py), 0, 0, 1, 0}, + {&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1}, + {&__pyx_n_s_start_completed_event, __pyx_k_start_completed_event, sizeof(__pyx_k_start_completed_event), 0, 0, 1, 1}, + {&__pyx_n_s_start_later, __pyx_k_start_later, sizeof(__pyx_k_start_later), 0, 0, 1, 1}, + {&__pyx_n_s_start_new_or_dummy, __pyx_k_start_new_or_dummy, sizeof(__pyx_k_start_new_or_dummy), 0, 0, 1, 1}, + {&__pyx_n_s_staticmethod, __pyx_k_staticmethod, sizeof(__pyx_k_staticmethod), 0, 0, 1, 1}, + {&__pyx_n_s_stop, __pyx_k_stop, sizeof(__pyx_k_stop), 0, 0, 1, 1}, + {&__pyx_kp_s_stringsource, __pyx_k_stringsource, sizeof(__pyx_k_stringsource), 0, 0, 1, 0}, + {&__pyx_n_s_successful, __pyx_k_successful, sizeof(__pyx_k_successful), 0, 0, 1, 1}, + {&__pyx_n_s_switch, __pyx_k_switch, sizeof(__pyx_k_switch), 0, 0, 1, 1}, + {&__pyx_n_s_sys, __pyx_k_sys, sizeof(__pyx_k_sys), 0, 0, 1, 1}, + {&__pyx_n_s_sys_exc_info, __pyx_k_sys_exc_info, sizeof(__pyx_k_sys_exc_info), 0, 0, 1, 1}, + {&__pyx_n_s_sys_getframe, __pyx_k_sys_getframe, sizeof(__pyx_k_sys_getframe), 0, 0, 1, 1}, + {&__pyx_n_s_t, __pyx_k_t, sizeof(__pyx_k_t), 0, 0, 1, 1}, + {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, + {&__pyx_n_s_threadlocal, __pyx_k_threadlocal, sizeof(__pyx_k_threadlocal), 0, 0, 1, 1}, + {&__pyx_n_s_throw, __pyx_k_throw, sizeof(__pyx_k_throw), 0, 0, 1, 1}, + {&__pyx_n_s_timeout, __pyx_k_timeout, sizeof(__pyx_k_timeout), 0, 0, 1, 1}, + {&__pyx_n_s_timer, __pyx_k_timer, sizeof(__pyx_k_timer), 0, 0, 1, 1}, + {&__pyx_n_s_track_greenlet_tree, __pyx_k_track_greenlet_tree, sizeof(__pyx_k_track_greenlet_tree), 0, 0, 1, 1}, + {&__pyx_n_s_unlink, __pyx_k_unlink, sizeof(__pyx_k_unlink), 0, 0, 1, 1}, + {&__pyx_n_s_unlink_all, __pyx_k_unlink_all, sizeof(__pyx_k_unlink_all), 0, 0, 1, 1}, + {&__pyx_n_s_wait, __pyx_k_wait, sizeof(__pyx_k_wait), 0, 0, 1, 1}, + {&__pyx_n_s_wait_on_objects, __pyx_k_wait_on_objects, sizeof(__pyx_k_wait_on_objects), 0, 0, 1, 1}, + {&__pyx_n_s_waiter, __pyx_k_waiter, sizeof(__pyx_k_waiter), 0, 0, 1, 1}, + {&__pyx_n_s_waiter_2, __pyx_k_waiter_2, sizeof(__pyx_k_waiter_2), 0, 0, 1, 1}, + {&__pyx_n_s_weakref, __pyx_k_weakref, sizeof(__pyx_k_weakref), 0, 0, 1, 1}, + {&__pyx_n_s_wrap, __pyx_k_wrap, sizeof(__pyx_k_wrap), 0, 0, 1, 1}, + {&__pyx_n_s_wref, __pyx_k_wref, sizeof(__pyx_k_wref), 0, 0, 1, 1}, + {0, 0, 0, 0, 0, 0, 0} +}; +static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { + __pyx_builtin___import__ = __Pyx_GetBuiltinName(__pyx_n_s_import); if (!__pyx_builtin___import__) __PYX_ERR(0, 45, __pyx_L1_error) + __pyx_builtin_NameError = __Pyx_GetBuiltinName(__pyx_n_s_NameError); if (!__pyx_builtin_NameError) __PYX_ERR(0, 328, __pyx_L1_error) + __pyx_builtin_staticmethod = __Pyx_GetBuiltinName(__pyx_n_s_staticmethod); if (!__pyx_builtin_staticmethod) __PYX_ERR(0, 538, __pyx_L1_error) + __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(0, 65, __pyx_L1_error) + __pyx_builtin_reversed = __Pyx_GetBuiltinName(__pyx_n_s_reversed); if (!__pyx_builtin_reversed) __PYX_ERR(0, 127, __pyx_L1_error) + __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 135, __pyx_L1_error) + __pyx_builtin_AttributeError = __Pyx_GetBuiltinName(__pyx_n_s_AttributeError); if (!__pyx_builtin_AttributeError) __PYX_ERR(0, 251, __pyx_L1_error) + __pyx_builtin_hex = __Pyx_GetBuiltinName(__pyx_n_s_hex); if (!__pyx_builtin_hex) __PYX_ERR(0, 441, __pyx_L1_error) + __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(0, 441, __pyx_L1_error) + __pyx_builtin_AssertionError = __Pyx_GetBuiltinName(__pyx_n_s_AssertionError); if (!__pyx_builtin_AssertionError) __PYX_ERR(0, 880, __pyx_L1_error) + return 0; + __pyx_L1_error:; + return -1; +} + +static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); + + /* "src/gevent/greenlet.py":222 + * # itself has never been documented or supported. + * if not callable(self._run): + * raise TypeError("The run argument or self._run must be callable") # <<<<<<<<<<<<<< + * + * self.args = args + */ + __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_The_run_argument_or_self__run_mu); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 222, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple_); + __Pyx_GIVEREF(__pyx_tuple_); + + /* "src/gevent/greenlet.py":610 + * """ + * if cls is Greenlet and not args and 'run' not in kwargs: + * raise TypeError("") # <<<<<<<<<<<<<< + * g = cls(*args, **kwargs) + * g.start_later(seconds) + */ + __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_s__5); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 610, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__9); + __Pyx_GIVEREF(__pyx_tuple__9); + + /* "src/gevent/greenlet.py":740 + * + * def _report_result(self, result): + * self._exc_info = (None, None, None) # <<<<<<<<<<<<<< + * self.value = result + * if self._links and not self._notifier: + */ + __pyx_tuple__11 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 740, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__11); + __Pyx_GIVEREF(__pyx_tuple__11); + + /* "src/gevent/greenlet.py":772 + * self._report_result(result) + * finally: + * self.__dict__.pop('_run', None) # <<<<<<<<<<<<<< + * self.args = () + * self.kwargs.clear() + */ + __pyx_tuple__12 = PyTuple_Pack(2, __pyx_n_s_run_2, Py_None); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 772, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__12); + __Pyx_GIVEREF(__pyx_tuple__12); + + /* "src/gevent/greenlet.py":880 + * + * def start(self, cb): # pylint:disable=unused-argument + * raise AssertionError("Cannot start the dummy event") # <<<<<<<<<<<<<< + * + * def close(self): + */ + __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s_Cannot_start_the_dummy_event); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(0, 880, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__16); + __Pyx_GIVEREF(__pyx_tuple__16); + + /* "cfunc.to_py":65 + * @cname("__Pyx_CFunc_object____list____object____object___to_py") + * cdef object __Pyx_CFunc_object____list____object____object___to_py(object (*f)(list, object, object) ): + * def wrap(list greenlets, object exception, object waiter): # <<<<<<<<<<<<<< + * """wrap(greenlets: list, exception, waiter)""" + * return f(greenlets, exception, waiter) + */ + __pyx_tuple__17 = PyTuple_Pack(3, __pyx_n_s_greenlets, __pyx_n_s_exception, __pyx_n_s_waiter); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(4, 65, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__17); + __Pyx_GIVEREF(__pyx_tuple__17); + __pyx_codeobj__18 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__17, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_wrap, 65, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__18)) __PYX_ERR(4, 65, __pyx_L1_error) + __pyx_tuple__19 = PyTuple_Pack(2, __pyx_n_s_greenlets, __pyx_n_s_exception); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(4, 65, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__19); + __Pyx_GIVEREF(__pyx_tuple__19); + __pyx_codeobj__20 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__19, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_wrap, 65, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__20)) __PYX_ERR(4, 65, __pyx_L1_error) + + /* "src/gevent/greenlet.py":45 + * # is assignment) without generating a 'lvalue is not valid target' + * # error. + * locals()['getcurrent'] = __import__('greenlet').getcurrent # <<<<<<<<<<<<<< + * locals()['greenlet_init'] = lambda: None + * locals()['Waiter'] = _waiter.Waiter + */ + __pyx_tuple__21 = PyTuple_Pack(1, __pyx_n_s_greenlet); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(0, 45, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__21); + __Pyx_GIVEREF(__pyx_tuple__21); + + /* "src/gevent/greenlet.py":114 + * class _Frame(object): + * + * __slots__ = ('f_code', 'f_lineno', 'f_back') # <<<<<<<<<<<<<< + * + * def __init__(self, f_code, f_lineno, f_back): + */ + __pyx_tuple__22 = PyTuple_Pack(3, __pyx_n_s_f_code, __pyx_n_s_f_lineno, __pyx_n_s_f_back); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(0, 114, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__22); + __Pyx_GIVEREF(__pyx_tuple__22); + + /* "src/gevent/greenlet.py":268 + * + * @Lazy + * def spawning_stack(self): # <<<<<<<<<<<<<< + * # Store this in the __dict__. We don't use it from the C + * # code. It's tempting to discard _spawning_stack_frames + */ + __pyx_tuple__23 = PyTuple_Pack(1, __pyx_n_s_self_2); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(0, 268, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__23); + __Pyx_GIVEREF(__pyx_tuple__23); + __pyx_codeobj__24 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__23, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_greenlet_py, __pyx_n_s_spawning_stack, 268, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__24)) __PYX_ERR(0, 268, __pyx_L1_error) + + /* "src/gevent/greenlet.py":301 + * + * @readproperty + * def name(self): # <<<<<<<<<<<<<< + * """ + * The greenlet name. By default, a unique name is constructed using + */ + __pyx_tuple__25 = PyTuple_Pack(1, __pyx_n_s_self_2); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(0, 301, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__25); + __Pyx_GIVEREF(__pyx_tuple__25); + __pyx_codeobj__26 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__25, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_greenlet_py, __pyx_n_s_name_2, 301, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__26)) __PYX_ERR(0, 301, __pyx_L1_error) + + /* "src/gevent/greenlet.py":316 + * return 'Greenlet-%d' % (self.minimal_ident,) + * + * def _raise_exception(self): # <<<<<<<<<<<<<< + * reraise(*self.exc_info) + * + */ + __pyx_tuple__27 = PyTuple_Pack(1, __pyx_n_s_self_2); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(0, 316, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__27); + __Pyx_GIVEREF(__pyx_tuple__27); + __pyx_codeobj__28 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__27, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_greenlet_py, __pyx_n_s_raise_exception, 316, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__28)) __PYX_ERR(0, 316, __pyx_L1_error) + + /* "src/gevent/greenlet.py":407 + * return bool(self) + * + * def ready(self): # <<<<<<<<<<<<<< + * """ + * Return a true value if and only if the greenlet has finished + */ + __pyx_tuple__29 = PyTuple_Pack(1, __pyx_n_s_self_2); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(0, 407, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__29); + __Pyx_GIVEREF(__pyx_tuple__29); + __pyx_codeobj__30 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__29, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_greenlet_py, __pyx_n_s_ready, 407, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__30)) __PYX_ERR(0, 407, __pyx_L1_error) + + /* "src/gevent/greenlet.py":418 + * return self.dead or self._exc_info is not None + * + * def successful(self): # <<<<<<<<<<<<<< + * """ + * Return a true value if and only if the greenlet has finished execution + */ + __pyx_tuple__31 = PyTuple_Pack(1, __pyx_n_s_self_2); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(0, 418, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__31); + __Pyx_GIVEREF(__pyx_tuple__31); + __pyx_codeobj__32 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__31, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_greenlet_py, __pyx_n_s_successful, 418, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__32)) __PYX_ERR(0, 418, __pyx_L1_error) + + /* "src/gevent/greenlet.py":448 + * + * + * def _formatinfo(self): # <<<<<<<<<<<<<< + * info = self._formatted_info + * if info is not None: + */ + __pyx_tuple__33 = PyTuple_Pack(1, __pyx_n_s_self_2); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(0, 448, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__33); + __Pyx_GIVEREF(__pyx_tuple__33); + __pyx_codeobj__34 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__33, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_greenlet_py, __pyx_n_s_formatinfo, 448, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__34)) __PYX_ERR(0, 448, __pyx_L1_error) + + /* "src/gevent/greenlet.py":498 + * return (ei[0], ei[1], load_traceback(ei[2])) + * + * def throw(self, *args): # <<<<<<<<<<<<<< + * """Immediately switch into the greenlet and raise an exception in it. + * + */ + __pyx_tuple__35 = PyTuple_Pack(2, __pyx_n_s_self_2, __pyx_n_s_args); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(0, 498, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__35); + __Pyx_GIVEREF(__pyx_tuple__35); + __pyx_codeobj__36 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__35, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_greenlet_py, __pyx_n_s_throw, 498, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__36)) __PYX_ERR(0, 498, __pyx_L1_error) + + /* "src/gevent/greenlet.py":520 + * self.__handle_death_before_start(args) + * + * def start(self): # <<<<<<<<<<<<<< + * """Schedule the greenlet to run in this loop iteration""" + * if self._start_event is None: + */ + __pyx_tuple__37 = PyTuple_Pack(1, __pyx_n_s_self_2); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(0, 520, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__37); + __Pyx_GIVEREF(__pyx_tuple__37); + __pyx_codeobj__38 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__37, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_greenlet_py, __pyx_n_s_start, 520, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__38)) __PYX_ERR(0, 520, __pyx_L1_error) + + /* "src/gevent/greenlet.py":526 + * self._start_event = self.parent.loop.run_callback(self.switch) + * + * def start_later(self, seconds): # <<<<<<<<<<<<<< + * """ + * start_later(seconds) -> None + */ + __pyx_tuple__39 = PyTuple_Pack(2, __pyx_n_s_self_2, __pyx_n_s_seconds); if (unlikely(!__pyx_tuple__39)) __PYX_ERR(0, 526, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__39); + __Pyx_GIVEREF(__pyx_tuple__39); + __pyx_codeobj__40 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__39, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_greenlet_py, __pyx_n_s_start_later, 526, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__40)) __PYX_ERR(0, 526, __pyx_L1_error) + + /* "src/gevent/greenlet.py":539 + * + * @staticmethod + * def add_spawn_callback(callback): # <<<<<<<<<<<<<< + * """ + * add_spawn_callback(callback) -> None + */ + __pyx_tuple__41 = PyTuple_Pack(1, __pyx_n_s_callback); if (unlikely(!__pyx_tuple__41)) __PYX_ERR(0, 539, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__41); + __Pyx_GIVEREF(__pyx_tuple__41); + __pyx_codeobj__42 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__41, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_greenlet_py, __pyx_n_s_add_spawn_callback, 539, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__42)) __PYX_ERR(0, 539, __pyx_L1_error) + + /* "src/gevent/greenlet.py":558 + * + * @staticmethod + * def remove_spawn_callback(callback): # <<<<<<<<<<<<<< + * """ + * remove_spawn_callback(callback) -> None + */ + __pyx_tuple__43 = PyTuple_Pack(1, __pyx_n_s_callback); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(0, 558, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__43); + __Pyx_GIVEREF(__pyx_tuple__43); + __pyx_codeobj__44 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__43, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_greenlet_py, __pyx_n_s_remove_spawn_callback, 558, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__44)) __PYX_ERR(0, 558, __pyx_L1_error) + + /* "src/gevent/greenlet.py":575 + * + * @classmethod + * def spawn(cls, *args, **kwargs): # <<<<<<<<<<<<<< + * """ + * spawn(function, *args, **kwargs) -> Greenlet + */ + __pyx_tuple__45 = PyTuple_Pack(4, __pyx_n_s_cls, __pyx_n_s_args, __pyx_n_s_kwargs, __pyx_n_s_g); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(0, 575, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__45); + __Pyx_GIVEREF(__pyx_tuple__45); + __pyx_codeobj__46 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__45, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_greenlet_py, __pyx_n_s_spawn, 575, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__46)) __PYX_ERR(0, 575, __pyx_L1_error) + + /* "src/gevent/greenlet.py":593 + * + * @classmethod + * def spawn_later(cls, seconds, *args, **kwargs): # <<<<<<<<<<<<<< + * """ + * spawn_later(seconds, function, *args, **kwargs) -> Greenlet + */ + __pyx_tuple__47 = PyTuple_Pack(5, __pyx_n_s_cls, __pyx_n_s_seconds, __pyx_n_s_args, __pyx_n_s_kwargs, __pyx_n_s_g); if (unlikely(!__pyx_tuple__47)) __PYX_ERR(0, 593, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__47); + __Pyx_GIVEREF(__pyx_tuple__47); + __pyx_codeobj__48 = (PyObject*)__Pyx_PyCode_New(2, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__47, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_greenlet_py, __pyx_n_s_spawn_later, 593, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__48)) __PYX_ERR(0, 593, __pyx_L1_error) + + /* "src/gevent/greenlet.py":615 + * return g + * + * def kill(self, exception=GreenletExit, block=True, timeout=None): # <<<<<<<<<<<<<< + * """ + * Raise the ``exception`` in the greenlet. + */ + __pyx_tuple__49 = PyTuple_Pack(5, __pyx_n_s_self_2, __pyx_n_s_exception, __pyx_n_s_block, __pyx_n_s_timeout, __pyx_n_s_waiter); if (unlikely(!__pyx_tuple__49)) __PYX_ERR(0, 615, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__49); + __Pyx_GIVEREF(__pyx_tuple__49); + __pyx_codeobj__50 = (PyObject*)__Pyx_PyCode_New(4, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__49, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_greenlet_py, __pyx_n_s_kill_2, 615, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__50)) __PYX_ERR(0, 615, __pyx_L1_error) + + /* "src/gevent/greenlet.py":667 + * # thus it should not raise when the greenlet is already killed (= not started) + * + * def get(self, block=True, timeout=None): # <<<<<<<<<<<<<< + * """ + * get(block=True, timeout=None) -> object + */ + __pyx_tuple__51 = PyTuple_Pack(6, __pyx_n_s_self_2, __pyx_n_s_block, __pyx_n_s_timeout, __pyx_n_s_switch, __pyx_n_s_t, __pyx_n_s_result); if (unlikely(!__pyx_tuple__51)) __PYX_ERR(0, 667, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__51); + __Pyx_GIVEREF(__pyx_tuple__51); + __pyx_codeobj__52 = (PyObject*)__Pyx_PyCode_New(3, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__51, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_greenlet_py, __pyx_n_s_get_2, 667, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__52)) __PYX_ERR(0, 667, __pyx_L1_error) + + /* "src/gevent/greenlet.py":711 + * self._raise_exception() + * + * def join(self, timeout=None): # <<<<<<<<<<<<<< + * """ + * join(timeout=None) -> None + */ + __pyx_tuple__53 = PyTuple_Pack(2, __pyx_n_s_self_2, __pyx_n_s_timeout); if (unlikely(!__pyx_tuple__53)) __PYX_ERR(0, 711, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__53); + __Pyx_GIVEREF(__pyx_tuple__53); + __pyx_codeobj__54 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__53, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_greenlet_py, __pyx_n_s_join, 711, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__54)) __PYX_ERR(0, 711, __pyx_L1_error) + + /* "src/gevent/greenlet.py":760 + * del exc_info + * + * def run(self): # <<<<<<<<<<<<<< + * try: + * self.__cancel_start() + */ + __pyx_tuple__55 = PyTuple_Pack(2, __pyx_n_s_self_2, __pyx_n_s_result); if (unlikely(!__pyx_tuple__55)) __PYX_ERR(0, 760, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__55); + __Pyx_GIVEREF(__pyx_tuple__55); + __pyx_codeobj__56 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__55, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_greenlet_py, __pyx_n_s_run, 760, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__56)) __PYX_ERR(0, 760, __pyx_L1_error) + + /* "src/gevent/greenlet.py":776 + * self.kwargs.clear() + * + * def _run(self): # <<<<<<<<<<<<<< + * """ + * Subclasses may override this method to take any number of + */ + __pyx_tuple__57 = PyTuple_Pack(1, __pyx_n_s_self_2); if (unlikely(!__pyx_tuple__57)) __PYX_ERR(0, 776, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__57); + __Pyx_GIVEREF(__pyx_tuple__57); + __pyx_codeobj__58 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__57, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_greenlet_py, __pyx_n_s_run_2, 776, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__58)) __PYX_ERR(0, 776, __pyx_L1_error) + + /* "src/gevent/greenlet.py":790 + * return + * + * def has_links(self): # <<<<<<<<<<<<<< + * return len(self._links) + * + */ + __pyx_tuple__59 = PyTuple_Pack(1, __pyx_n_s_self_2); if (unlikely(!__pyx_tuple__59)) __PYX_ERR(0, 790, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__59); + __Pyx_GIVEREF(__pyx_tuple__59); + __pyx_codeobj__60 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__59, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_greenlet_py, __pyx_n_s_has_links, 790, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__60)) __PYX_ERR(0, 790, __pyx_L1_error) + + /* "src/gevent/greenlet.py":793 + * return len(self._links) + * + * def rawlink(self, callback): # <<<<<<<<<<<<<< + * """ + * Register a callable to be executed when the greenlet finishes + */ + __pyx_tuple__61 = PyTuple_Pack(2, __pyx_n_s_self_2, __pyx_n_s_callback); if (unlikely(!__pyx_tuple__61)) __PYX_ERR(0, 793, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__61); + __Pyx_GIVEREF(__pyx_tuple__61); + __pyx_codeobj__62 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__61, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_greenlet_py, __pyx_n_s_rawlink, 793, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__62)) __PYX_ERR(0, 793, __pyx_L1_error) + + /* "src/gevent/greenlet.py":809 + * self._notifier = self.parent.loop.run_callback(self._notify_links) + * + * def link(self, callback, SpawnedLink=SpawnedLink): # <<<<<<<<<<<<<< + * """ + * Link greenlet's completion to a callable. + */ + __pyx_tuple__63 = PyTuple_Pack(3, __pyx_n_s_self_2, __pyx_n_s_callback, __pyx_n_s_SpawnedLink); if (unlikely(!__pyx_tuple__63)) __PYX_ERR(0, 809, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__63); + __Pyx_GIVEREF(__pyx_tuple__63); + __pyx_codeobj__64 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__63, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_greenlet_py, __pyx_n_s_link, 809, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__64)) __PYX_ERR(0, 809, __pyx_L1_error) + + /* "src/gevent/greenlet.py":823 + * self.rawlink(SpawnedLink(callback)) + * + * def unlink(self, callback): # <<<<<<<<<<<<<< + * """Remove the callback set by :meth:`link` or :meth:`rawlink`""" + * try: + */ + __pyx_tuple__65 = PyTuple_Pack(2, __pyx_n_s_self_2, __pyx_n_s_callback); if (unlikely(!__pyx_tuple__65)) __PYX_ERR(0, 823, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__65); + __Pyx_GIVEREF(__pyx_tuple__65); + __pyx_codeobj__66 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__65, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_greenlet_py, __pyx_n_s_unlink, 823, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__66)) __PYX_ERR(0, 823, __pyx_L1_error) + + /* "src/gevent/greenlet.py":830 + * pass + * + * def unlink_all(self): # <<<<<<<<<<<<<< + * """ + * Remove all the callbacks. + */ + __pyx_tuple__67 = PyTuple_Pack(1, __pyx_n_s_self_2); if (unlikely(!__pyx_tuple__67)) __PYX_ERR(0, 830, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__67); + __Pyx_GIVEREF(__pyx_tuple__67); + __pyx_codeobj__68 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__67, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_greenlet_py, __pyx_n_s_unlink_all, 830, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__68)) __PYX_ERR(0, 830, __pyx_L1_error) + + /* "src/gevent/greenlet.py":838 + * del self._links[:] + * + * def link_value(self, callback, SpawnedLink=SuccessSpawnedLink): # <<<<<<<<<<<<<< + * """ + * Like :meth:`link` but *callback* is only notified when the greenlet + */ + __pyx_tuple__69 = PyTuple_Pack(3, __pyx_n_s_self_2, __pyx_n_s_callback, __pyx_n_s_SpawnedLink); if (unlikely(!__pyx_tuple__69)) __PYX_ERR(0, 838, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__69); + __Pyx_GIVEREF(__pyx_tuple__69); + __pyx_codeobj__70 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__69, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_greenlet_py, __pyx_n_s_link_value, 838, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__70)) __PYX_ERR(0, 838, __pyx_L1_error) + + /* "src/gevent/greenlet.py":846 + * self.link(callback, SpawnedLink=SpawnedLink) + * + * def link_exception(self, callback, SpawnedLink=FailureSpawnedLink): # <<<<<<<<<<<<<< + * """ + * Like :meth:`link` but *callback* is only notified when the + */ + __pyx_tuple__71 = PyTuple_Pack(3, __pyx_n_s_self_2, __pyx_n_s_callback, __pyx_n_s_SpawnedLink); if (unlikely(!__pyx_tuple__71)) __PYX_ERR(0, 846, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__71); + __Pyx_GIVEREF(__pyx_tuple__71); + __pyx_codeobj__72 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__71, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_greenlet_py, __pyx_n_s_link_exception, 846, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__72)) __PYX_ERR(0, 846, __pyx_L1_error) + + /* "src/gevent/greenlet.py":854 + * self.link(callback, SpawnedLink=SpawnedLink) + * + * def _notify_links(self): # <<<<<<<<<<<<<< + * while self._links: + * # Early links are allowed to remove later links + */ + __pyx_tuple__73 = PyTuple_Pack(1, __pyx_n_s_self_2); if (unlikely(!__pyx_tuple__73)) __PYX_ERR(0, 854, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__73); + __Pyx_GIVEREF(__pyx_tuple__73); + __pyx_codeobj__74 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__73, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_greenlet_py, __pyx_n_s_notify_links, 854, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__74)) __PYX_ERR(0, 854, __pyx_L1_error) + + /* "src/gevent/greenlet.py":871 + * + * class _dummy_event(object): + * __slots__ = ('pending', 'active') # <<<<<<<<<<<<<< + * + * def __init__(self): + */ + __pyx_tuple__75 = PyTuple_Pack(2, __pyx_n_s_pending, __pyx_n_s_active); if (unlikely(!__pyx_tuple__75)) __PYX_ERR(0, 871, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__75); + __Pyx_GIVEREF(__pyx_tuple__75); + + /* "src/gevent/greenlet.py":876 + * self.pending = self.active = False + * + * def stop(self): # <<<<<<<<<<<<<< + * pass + * + */ + __pyx_tuple__76 = PyTuple_Pack(1, __pyx_n_s_self_2); if (unlikely(!__pyx_tuple__76)) __PYX_ERR(0, 876, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__76); + __Pyx_GIVEREF(__pyx_tuple__76); + __pyx_codeobj__77 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__76, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_greenlet_py, __pyx_n_s_stop, 876, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__77)) __PYX_ERR(0, 876, __pyx_L1_error) + + /* "src/gevent/greenlet.py":879 + * pass + * + * def start(self, cb): # pylint:disable=unused-argument # <<<<<<<<<<<<<< + * raise AssertionError("Cannot start the dummy event") + * + */ + __pyx_tuple__78 = PyTuple_Pack(2, __pyx_n_s_self_2, __pyx_n_s_cb); if (unlikely(!__pyx_tuple__78)) __PYX_ERR(0, 879, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__78); + __Pyx_GIVEREF(__pyx_tuple__78); + __pyx_codeobj__79 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__78, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_greenlet_py, __pyx_n_s_start, 879, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__79)) __PYX_ERR(0, 879, __pyx_L1_error) + + /* "src/gevent/greenlet.py":882 + * raise AssertionError("Cannot start the dummy event") + * + * def close(self): # <<<<<<<<<<<<<< + * pass + * + */ + __pyx_tuple__80 = PyTuple_Pack(1, __pyx_n_s_self_2); if (unlikely(!__pyx_tuple__80)) __PYX_ERR(0, 882, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__80); + __Pyx_GIVEREF(__pyx_tuple__80); + __pyx_codeobj__81 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__80, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_greenlet_py, __pyx_n_s_close, 882, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__81)) __PYX_ERR(0, 882, __pyx_L1_error) + + /* "src/gevent/greenlet.py":889 + * + * + * def _kill(glet, exception, waiter): # <<<<<<<<<<<<<< + * try: + * glet.throw(exception) + */ + __pyx_tuple__82 = PyTuple_Pack(3, __pyx_n_s_glet, __pyx_n_s_exception, __pyx_n_s_waiter); if (unlikely(!__pyx_tuple__82)) __PYX_ERR(0, 889, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__82); + __Pyx_GIVEREF(__pyx_tuple__82); + __pyx_codeobj__83 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__82, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_greenlet_py, __pyx_n_s_kill, 889, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__83)) __PYX_ERR(0, 889, __pyx_L1_error) + + /* "src/gevent/greenlet.py":899 + * + * + * def joinall(greenlets, timeout=None, raise_error=False, count=None): # <<<<<<<<<<<<<< + * """ + * Wait for the ``greenlets`` to finish. + */ + __pyx_tuple__84 = PyTuple_Pack(4, __pyx_n_s_greenlets, __pyx_n_s_timeout, __pyx_n_s_raise_error, __pyx_n_s_count); if (unlikely(!__pyx_tuple__84)) __PYX_ERR(0, 899, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__84); + __Pyx_GIVEREF(__pyx_tuple__84); + __pyx_codeobj__85 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__84, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_greenlet_py, __pyx_n_s_joinall, 899, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__85)) __PYX_ERR(0, 899, __pyx_L1_error) + + /* "src/gevent/greenlet.py":953 + * + * + * def killall(greenlets, exception=GreenletExit, block=True, timeout=None): # <<<<<<<<<<<<<< + * """ + * Forceably terminate all the ``greenlets`` by causing them to raise ``exception``. + */ + __pyx_tuple__86 = PyTuple_Pack(8, __pyx_n_s_greenlets, __pyx_n_s_exception, __pyx_n_s_block, __pyx_n_s_timeout, __pyx_n_s_loop, __pyx_n_s_waiter, __pyx_n_s_t, __pyx_n_s_alive); if (unlikely(!__pyx_tuple__86)) __PYX_ERR(0, 953, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__86); + __Pyx_GIVEREF(__pyx_tuple__86); + __pyx_codeobj__87 = (PyObject*)__Pyx_PyCode_New(4, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__86, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_greenlet_py, __pyx_n_s_killall, 953, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__87)) __PYX_ERR(0, 953, __pyx_L1_error) + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} + +static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { + if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_10 = PyInt_FromLong(10); if (unlikely(!__pyx_int_10)) __PYX_ERR(0, 1, __pyx_L1_error) + return 0; + __pyx_L1_error:; + return -1; +} + +static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/ + +static int __Pyx_modinit_global_init_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); + /*--- Global init code ---*/ + __pyx_v_6gevent_9_greenlet_sys_getframe = Py_None; Py_INCREF(Py_None); + __pyx_v_6gevent_9_greenlet_sys_exc_info = Py_None; Py_INCREF(Py_None); + __pyx_v_6gevent_9_greenlet_Timeout = Py_None; Py_INCREF(Py_None); + __pyx_v_6gevent_9_greenlet_GreenletExit = Py_None; Py_INCREF(Py_None); + __pyx_v_6gevent_9_greenlet_InvalidSwitchError = Py_None; Py_INCREF(Py_None); + __pyx_v_6gevent_9_greenlet__greenlet__init__ = Py_None; Py_INCREF(Py_None); + __pyx_v_6gevent_9_greenlet__threadlocal = Py_None; Py_INCREF(Py_None); + __pyx_v_6gevent_9_greenlet_get_hub_class = Py_None; Py_INCREF(Py_None); + __pyx_v_6gevent_9_greenlet_wref = Py_None; Py_INCREF(Py_None); + __pyx_v_6gevent_9_greenlet_dump_traceback = Py_None; Py_INCREF(Py_None); + __pyx_v_6gevent_9_greenlet_load_traceback = Py_None; Py_INCREF(Py_None); + __pyx_v_6gevent_9_greenlet_wait = Py_None; Py_INCREF(Py_None); + __pyx_v_6gevent_9_greenlet_iwait = Py_None; Py_INCREF(Py_None); + __pyx_v_6gevent_9_greenlet_reraise = Py_None; Py_INCREF(Py_None); + __pyx_v_6gevent_9_greenlet_GEVENT_CONFIG = Py_None; Py_INCREF(Py_None); + __pyx_v_6gevent_9_greenlet__cancelled_start_event = ((struct __pyx_obj_6gevent_9_greenlet__dummy_event *)Py_None); Py_INCREF(Py_None); + __pyx_v_6gevent_9_greenlet__start_completed_event = ((struct __pyx_obj_6gevent_9_greenlet__dummy_event *)Py_None); Py_INCREF(Py_None); + __pyx_v_6gevent_9_greenlet__spawn_callbacks = ((PyObject*)Py_None); Py_INCREF(Py_None); + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_variable_export_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); + /*--- Variable export code ---*/ + if (__Pyx_ExportVoidPtr(__pyx_n_s_PYPY, (void *)&__pyx_v_6gevent_9_greenlet__PYPY, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportVoidPtr(__pyx_n_s_sys_getframe, (void *)&__pyx_v_6gevent_9_greenlet_sys_getframe, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportVoidPtr(__pyx_n_s_sys_exc_info, (void *)&__pyx_v_6gevent_9_greenlet_sys_exc_info, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportVoidPtr(__pyx_n_s_Timeout, (void *)&__pyx_v_6gevent_9_greenlet_Timeout, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportVoidPtr(__pyx_n_s_GreenletExit, (void *)&__pyx_v_6gevent_9_greenlet_GreenletExit, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportVoidPtr(__pyx_n_s_InvalidSwitchError, (void *)&__pyx_v_6gevent_9_greenlet_InvalidSwitchError, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportVoidPtr(__pyx_n_s_greenlet_imported, (void *)&__pyx_v_6gevent_9_greenlet__greenlet_imported, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportVoidPtr(__pyx_n_s_greenlet__init, (void *)&__pyx_v_6gevent_9_greenlet__greenlet__init__, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportVoidPtr(__pyx_n_s_threadlocal, (void *)&__pyx_v_6gevent_9_greenlet__threadlocal, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportVoidPtr(__pyx_n_s_get_hub_class, (void *)&__pyx_v_6gevent_9_greenlet_get_hub_class, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportVoidPtr(__pyx_n_s_wref, (void *)&__pyx_v_6gevent_9_greenlet_wref, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportVoidPtr(__pyx_n_s_dump_traceback, (void *)&__pyx_v_6gevent_9_greenlet_dump_traceback, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportVoidPtr(__pyx_n_s_load_traceback, (void *)&__pyx_v_6gevent_9_greenlet_load_traceback, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportVoidPtr(__pyx_n_s_wait, (void *)&__pyx_v_6gevent_9_greenlet_wait, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportVoidPtr(__pyx_n_s_iwait, (void *)&__pyx_v_6gevent_9_greenlet_iwait, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportVoidPtr(__pyx_n_s_reraise, (void *)&__pyx_v_6gevent_9_greenlet_reraise, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportVoidPtr(__pyx_n_s_GEVENT_CONFIG, (void *)&__pyx_v_6gevent_9_greenlet_GEVENT_CONFIG, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportVoidPtr(__pyx_n_s_cancelled_start_event, (void *)&__pyx_v_6gevent_9_greenlet__cancelled_start_event, "struct __pyx_obj_6gevent_9_greenlet__dummy_event *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportVoidPtr(__pyx_n_s_start_completed_event, (void *)&__pyx_v_6gevent_9_greenlet__start_completed_event, "struct __pyx_obj_6gevent_9_greenlet__dummy_event *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportVoidPtr(__pyx_n_s_spawn_callbacks, (void *)&__pyx_v_6gevent_9_greenlet__spawn_callbacks, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_modinit_function_export_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); + /*--- Function export code ---*/ + if (__Pyx_ExportFunction("_init", (void (*)(void))__pyx_f_6gevent_9_greenlet__init, "void (void)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportFunction("_extract_stack", (void (*)(void))__pyx_f_6gevent_9_greenlet__extract_stack, "PyObject *(int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportFunction("_Frame_from_list", (void (*)(void))__pyx_f_6gevent_9_greenlet__Frame_from_list, "struct __pyx_obj_6gevent_9_greenlet__Frame *(PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportFunction("_killall3", (void (*)(void))__pyx_f_6gevent_9_greenlet__killall3, "PyObject *(PyObject *, PyObject *, PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportFunction("_killall", (void (*)(void))__pyx_f_6gevent_9_greenlet__killall, "PyObject *(PyObject *, PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportFunction("joinall", (void (*)(void))__pyx_f_6gevent_9_greenlet_joinall, "PyObject *(PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_9_greenlet_joinall *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportFunction("_call_spawn_callbacks", (void (*)(void))__pyx_f_6gevent_9_greenlet__call_spawn_callbacks, "void (struct __pyx_obj_6gevent_9_greenlet_Greenlet *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_modinit_type_init_code(void) { + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); + /*--- Type init code ---*/ + __pyx_t_1 = PyImport_ImportModule("greenlet"); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_ptype_6gevent_9_greenlet_greenlet = __Pyx_ImportType(__pyx_t_1, "greenlet", "greenlet", sizeof(PyGreenlet), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_9_greenlet_greenlet) __PYX_ERR(1, 17, __pyx_L1_error) + __pyx_t_2 = PyImport_ImportModule("types"); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 40, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_ptype_6gevent_9_greenlet_CodeType = __Pyx_ImportType(__pyx_t_2, "types", "CodeType", sizeof(PyCodeObject), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_9_greenlet_CodeType) __PYX_ERR(1, 40, __pyx_L1_error) + __pyx_ptype_6gevent_9_greenlet_FrameType = __Pyx_ImportType(__pyx_t_2, "types", "FrameType", sizeof(PyFrameObject), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_9_greenlet_FrameType) __PYX_ERR(1, 45, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_6gevent_9_greenlet_SpawnedLink) < 0) __PYX_ERR(0, 55, __pyx_L1_error) + __pyx_type_6gevent_9_greenlet_SpawnedLink.tp_print = 0; + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_SpawnedLink, (PyObject *)&__pyx_type_6gevent_9_greenlet_SpawnedLink) < 0) __PYX_ERR(0, 55, __pyx_L1_error) + __pyx_ptype_6gevent_9_greenlet_SpawnedLink = &__pyx_type_6gevent_9_greenlet_SpawnedLink; + __pyx_type_6gevent_9_greenlet_SuccessSpawnedLink.tp_base = __pyx_ptype_6gevent_9_greenlet_SpawnedLink; + if (PyType_Ready(&__pyx_type_6gevent_9_greenlet_SuccessSpawnedLink) < 0) __PYX_ERR(0, 89, __pyx_L1_error) + __pyx_type_6gevent_9_greenlet_SuccessSpawnedLink.tp_print = 0; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6gevent_9_greenlet_SuccessSpawnedLink.tp_dictoffset && __pyx_type_6gevent_9_greenlet_SuccessSpawnedLink.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_type_6gevent_9_greenlet_SuccessSpawnedLink.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + } + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_SuccessSpawnedLink, (PyObject *)&__pyx_type_6gevent_9_greenlet_SuccessSpawnedLink) < 0) __PYX_ERR(0, 89, __pyx_L1_error) + __pyx_ptype_6gevent_9_greenlet_SuccessSpawnedLink = &__pyx_type_6gevent_9_greenlet_SuccessSpawnedLink; + __pyx_type_6gevent_9_greenlet_FailureSpawnedLink.tp_base = __pyx_ptype_6gevent_9_greenlet_SpawnedLink; + if (PyType_Ready(&__pyx_type_6gevent_9_greenlet_FailureSpawnedLink) < 0) __PYX_ERR(0, 101, __pyx_L1_error) + __pyx_type_6gevent_9_greenlet_FailureSpawnedLink.tp_print = 0; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6gevent_9_greenlet_FailureSpawnedLink.tp_dictoffset && __pyx_type_6gevent_9_greenlet_FailureSpawnedLink.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_type_6gevent_9_greenlet_FailureSpawnedLink.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + } + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_FailureSpawnedLink, (PyObject *)&__pyx_type_6gevent_9_greenlet_FailureSpawnedLink) < 0) __PYX_ERR(0, 101, __pyx_L1_error) + __pyx_ptype_6gevent_9_greenlet_FailureSpawnedLink = &__pyx_type_6gevent_9_greenlet_FailureSpawnedLink; + if (PyType_Ready(&__pyx_type_6gevent_9_greenlet__Frame) < 0) __PYX_ERR(0, 112, __pyx_L1_error) + __pyx_type_6gevent_9_greenlet__Frame.tp_print = 0; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6gevent_9_greenlet__Frame.tp_dictoffset && __pyx_type_6gevent_9_greenlet__Frame.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_type_6gevent_9_greenlet__Frame.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + } + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Frame, (PyObject *)&__pyx_type_6gevent_9_greenlet__Frame) < 0) __PYX_ERR(0, 112, __pyx_L1_error) + __pyx_ptype_6gevent_9_greenlet__Frame = &__pyx_type_6gevent_9_greenlet__Frame; + __pyx_vtabptr_6gevent_9_greenlet_Greenlet = &__pyx_vtable_6gevent_9_greenlet_Greenlet; + __pyx_vtable_6gevent_9_greenlet_Greenlet.has_links = (int (*)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *, int __pyx_skip_dispatch))__pyx_f_6gevent_9_greenlet_8Greenlet_has_links; + __pyx_vtable_6gevent_9_greenlet_Greenlet.join = (PyObject *(*)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_9_greenlet_8Greenlet_join *__pyx_optional_args))__pyx_f_6gevent_9_greenlet_8Greenlet_join; + __pyx_vtable_6gevent_9_greenlet_Greenlet.ready = (int (*)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *, int __pyx_skip_dispatch))__pyx_f_6gevent_9_greenlet_8Greenlet_ready; + __pyx_vtable_6gevent_9_greenlet_Greenlet.successful = (int (*)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *, int __pyx_skip_dispatch))__pyx_f_6gevent_9_greenlet_8Greenlet_successful; + __pyx_vtable_6gevent_9_greenlet_Greenlet.rawlink = (PyObject *(*)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *, PyObject *, int __pyx_skip_dispatch))__pyx_f_6gevent_9_greenlet_8Greenlet_rawlink; + __pyx_vtable_6gevent_9_greenlet_Greenlet._formatinfo = (PyObject *(*)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *, int __pyx_skip_dispatch))__pyx_f_6gevent_9_greenlet_8Greenlet__formatinfo; + __pyx_vtable_6gevent_9_greenlet_Greenlet._get_minimal_ident = (PyObject *(*)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *))__pyx_f_6gevent_9_greenlet_8Greenlet__get_minimal_ident; + __pyx_vtable_6gevent_9_greenlet_Greenlet.__pyx___started_but_aborted = (int (*)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *))__pyx_f_6gevent_9_greenlet_8Greenlet___started_but_aborted; + __pyx_vtable_6gevent_9_greenlet_Greenlet.__pyx___start_cancelled_by_kill = (int (*)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *))__pyx_f_6gevent_9_greenlet_8Greenlet___start_cancelled_by_kill; + __pyx_vtable_6gevent_9_greenlet_Greenlet.__pyx___start_pending = (int (*)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *))__pyx_f_6gevent_9_greenlet_8Greenlet___start_pending; + __pyx_vtable_6gevent_9_greenlet_Greenlet.__pyx___never_started_or_killed = (int (*)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *))__pyx_f_6gevent_9_greenlet_8Greenlet___never_started_or_killed; + __pyx_vtable_6gevent_9_greenlet_Greenlet.__pyx___start_completed = (int (*)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *))__pyx_f_6gevent_9_greenlet_8Greenlet___start_completed; + __pyx_vtable_6gevent_9_greenlet_Greenlet.__pyx___handle_death_before_start = (PyObject *(*)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *, PyObject *))__pyx_f_6gevent_9_greenlet_8Greenlet___handle_death_before_start; + __pyx_vtable_6gevent_9_greenlet_Greenlet.__pyx___cancel_start = (PyObject *(*)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *))__pyx_f_6gevent_9_greenlet_8Greenlet___cancel_start; + __pyx_vtable_6gevent_9_greenlet_Greenlet._report_result = (PyObject *(*)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *, PyObject *))__pyx_f_6gevent_9_greenlet_8Greenlet__report_result; + __pyx_vtable_6gevent_9_greenlet_Greenlet._report_error = (PyObject *(*)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *, PyObject *))__pyx_f_6gevent_9_greenlet_8Greenlet__report_error; + __pyx_vtable_6gevent_9_greenlet_Greenlet._notify_links = (PyObject *(*)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *, int __pyx_skip_dispatch))__pyx_f_6gevent_9_greenlet_8Greenlet__notify_links; + __pyx_type_6gevent_9_greenlet_Greenlet.tp_base = __pyx_ptype_6gevent_9_greenlet_greenlet; + if (PyType_Ready(&__pyx_type_6gevent_9_greenlet_Greenlet) < 0) __PYX_ERR(0, 157, __pyx_L1_error) + __pyx_type_6gevent_9_greenlet_Greenlet.tp_print = 0; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6gevent_9_greenlet_Greenlet.tp_dictoffset && __pyx_type_6gevent_9_greenlet_Greenlet.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_type_6gevent_9_greenlet_Greenlet.tp_getattro = __Pyx_PyObject_GenericGetAttr; + } + #if CYTHON_COMPILING_IN_CPYTHON + { + PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_6gevent_9_greenlet_Greenlet, "__init__"); if (unlikely(!wrapper)) __PYX_ERR(0, 157, __pyx_L1_error) + if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) { + __pyx_wrapperbase_6gevent_9_greenlet_8Greenlet___init__ = *((PyWrapperDescrObject *)wrapper)->d_base; + __pyx_wrapperbase_6gevent_9_greenlet_8Greenlet___init__.doc = __pyx_doc_6gevent_9_greenlet_8Greenlet___init__; + ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_6gevent_9_greenlet_8Greenlet___init__; + } + } + #endif + if (__Pyx_SetVtable(__pyx_type_6gevent_9_greenlet_Greenlet.tp_dict, __pyx_vtabptr_6gevent_9_greenlet_Greenlet) < 0) __PYX_ERR(0, 157, __pyx_L1_error) + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Greenlet, (PyObject *)&__pyx_type_6gevent_9_greenlet_Greenlet) < 0) __PYX_ERR(0, 157, __pyx_L1_error) + __pyx_ptype_6gevent_9_greenlet_Greenlet = &__pyx_type_6gevent_9_greenlet_Greenlet; + __pyx_vtabptr_6gevent_9_greenlet__dummy_event = &__pyx_vtable_6gevent_9_greenlet__dummy_event; + __pyx_vtable_6gevent_9_greenlet__dummy_event.stop = (PyObject *(*)(struct __pyx_obj_6gevent_9_greenlet__dummy_event *, int __pyx_skip_dispatch))__pyx_f_6gevent_9_greenlet_12_dummy_event_stop; + __pyx_vtable_6gevent_9_greenlet__dummy_event.start = (PyObject *(*)(struct __pyx_obj_6gevent_9_greenlet__dummy_event *, PyObject *, int __pyx_skip_dispatch))__pyx_f_6gevent_9_greenlet_12_dummy_event_start; + __pyx_vtable_6gevent_9_greenlet__dummy_event.close = (PyObject *(*)(struct __pyx_obj_6gevent_9_greenlet__dummy_event *, int __pyx_skip_dispatch))__pyx_f_6gevent_9_greenlet_12_dummy_event_close; + if (PyType_Ready(&__pyx_type_6gevent_9_greenlet__dummy_event) < 0) __PYX_ERR(0, 870, __pyx_L1_error) + __pyx_type_6gevent_9_greenlet__dummy_event.tp_print = 0; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6gevent_9_greenlet__dummy_event.tp_dictoffset && __pyx_type_6gevent_9_greenlet__dummy_event.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_type_6gevent_9_greenlet__dummy_event.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + } + if (__Pyx_SetVtable(__pyx_type_6gevent_9_greenlet__dummy_event.tp_dict, __pyx_vtabptr_6gevent_9_greenlet__dummy_event) < 0) __PYX_ERR(0, 870, __pyx_L1_error) + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_dummy_event, (PyObject *)&__pyx_type_6gevent_9_greenlet__dummy_event) < 0) __PYX_ERR(0, 870, __pyx_L1_error) + __pyx_ptype_6gevent_9_greenlet__dummy_event = &__pyx_type_6gevent_9_greenlet__dummy_event; + if (PyType_Ready(&__pyx_scope_struct____Pyx_CFunc_object____list____object____object___to_py) < 0) __PYX_ERR(4, 64, __pyx_L1_error) + __pyx_scope_struct____Pyx_CFunc_object____list____object____object___to_py.tp_print = 0; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_scope_struct____Pyx_CFunc_object____list____object____object___to_py.tp_dictoffset && __pyx_scope_struct____Pyx_CFunc_object____list____object____object___to_py.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_scope_struct____Pyx_CFunc_object____list____object____object___to_py.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + } + __pyx_ptype___pyx_scope_struct____Pyx_CFunc_object____list____object____object___to_py = &__pyx_scope_struct____Pyx_CFunc_object____list____object____object___to_py; + if (PyType_Ready(&__pyx_scope_struct____Pyx_CFunc_object____list____object___to_py) < 0) __PYX_ERR(4, 64, __pyx_L1_error) + __pyx_scope_struct____Pyx_CFunc_object____list____object___to_py.tp_print = 0; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_scope_struct____Pyx_CFunc_object____list____object___to_py.tp_dictoffset && __pyx_scope_struct____Pyx_CFunc_object____list____object___to_py.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_scope_struct____Pyx_CFunc_object____list____object___to_py.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + } + __pyx_ptype___pyx_scope_struct____Pyx_CFunc_object____list____object___to_py = &__pyx_scope_struct____Pyx_CFunc_object____list____object___to_py; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_modinit_type_import_code(void) { + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); + /*--- Type import code ---*/ + __pyx_t_1 = PyImport_ImportModule("weakref"); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 5, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_ptype_6gevent_7__ident_ref = __Pyx_ImportType(__pyx_t_1, "weakref", "ref", sizeof(PyWeakReference), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_7__ident_ref) __PYX_ERR(5, 5, __pyx_L1_error) + __pyx_t_2 = PyImport_ImportModule("gevent.__ident"); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 15, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_ptype_6gevent_7__ident_ValuedWeakRef = __Pyx_ImportType(__pyx_t_2, "gevent.__ident", "ValuedWeakRef", sizeof(struct __pyx_obj_6gevent_7__ident_ValuedWeakRef), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_7__ident_ValuedWeakRef) __PYX_ERR(5, 15, __pyx_L1_error) + __pyx_ptype_6gevent_7__ident_IdentRegistry = __Pyx_ImportType(__pyx_t_2, "gevent.__ident", "IdentRegistry", sizeof(struct __pyx_obj_6gevent_7__ident_IdentRegistry), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_7__ident_IdentRegistry) __PYX_ERR(5, 19, __pyx_L1_error) + __pyx_vtabptr_6gevent_7__ident_IdentRegistry = (struct __pyx_vtabstruct_6gevent_7__ident_IdentRegistry*)__Pyx_GetVtable(__pyx_ptype_6gevent_7__ident_IdentRegistry->tp_dict); if (unlikely(!__pyx_vtabptr_6gevent_7__ident_IdentRegistry)) __PYX_ERR(5, 19, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyImport_ImportModule("greenlet"); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_ptype_6gevent_21__greenlet_primitives_greenlet = __Pyx_ImportType(__pyx_t_2, "greenlet", "greenlet", sizeof(PyGreenlet), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_21__greenlet_primitives_greenlet) __PYX_ERR(2, 12, __pyx_L1_error) + __pyx_t_1 = PyImport_ImportModule("gevent.__greenlet_primitives"); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 37, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_ptype_6gevent_21__greenlet_primitives_TrackedRawGreenlet = __Pyx_ImportType(__pyx_t_1, "gevent.__greenlet_primitives", "TrackedRawGreenlet", sizeof(struct __pyx_obj_6gevent_21__greenlet_primitives_TrackedRawGreenlet), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_21__greenlet_primitives_TrackedRawGreenlet) __PYX_ERR(2, 37, __pyx_L1_error) + __pyx_ptype_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop = __Pyx_ImportType(__pyx_t_1, "gevent.__greenlet_primitives", "SwitchOutGreenletWithLoop", sizeof(struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop) __PYX_ERR(2, 40, __pyx_L1_error) + __pyx_vtabptr_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop = (struct __pyx_vtabstruct_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop*)__Pyx_GetVtable(__pyx_ptype_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop->tp_dict); if (unlikely(!__pyx_vtabptr_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop)) __PYX_ERR(2, 40, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyImport_ImportModule("greenlet"); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 15, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_ptype_6gevent_8__waiter_greenlet = __Pyx_ImportType(__pyx_t_1, "greenlet", "greenlet", sizeof(PyGreenlet), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_8__waiter_greenlet) __PYX_ERR(3, 15, __pyx_L1_error) + __pyx_t_2 = PyImport_ImportModule("gevent.__waiter"); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 33, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_ptype_6gevent_8__waiter_Waiter = __Pyx_ImportType(__pyx_t_2, "gevent.__waiter", "Waiter", sizeof(struct __pyx_obj_6gevent_8__waiter_Waiter), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_8__waiter_Waiter) __PYX_ERR(3, 33, __pyx_L1_error) + __pyx_vtabptr_6gevent_8__waiter_Waiter = (struct __pyx_vtabstruct_6gevent_8__waiter_Waiter*)__Pyx_GetVtable(__pyx_ptype_6gevent_8__waiter_Waiter->tp_dict); if (unlikely(!__pyx_vtabptr_6gevent_8__waiter_Waiter)) __PYX_ERR(3, 33, __pyx_L1_error) + __pyx_ptype_6gevent_8__waiter_MultipleWaiter = __Pyx_ImportType(__pyx_t_2, "gevent.__waiter", "MultipleWaiter", sizeof(struct __pyx_obj_6gevent_8__waiter_MultipleWaiter), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_8__waiter_MultipleWaiter) __PYX_ERR(3, 47, __pyx_L1_error) + __pyx_vtabptr_6gevent_8__waiter_MultipleWaiter = (struct __pyx_vtabstruct_6gevent_8__waiter_MultipleWaiter*)__Pyx_GetVtable(__pyx_ptype_6gevent_8__waiter_MultipleWaiter->tp_dict); if (unlikely(!__pyx_vtabptr_6gevent_8__waiter_MultipleWaiter)) __PYX_ERR(3, 47, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_modinit_variable_import_code(void) { + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); + /*--- Variable import code ---*/ + __pyx_t_1 = PyImport_ImportModule("gevent.__ident"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_1, "heappop", (void **)&__pyx_vp_6gevent_7__ident_heappop, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_1, "heappush", (void **)&__pyx_vp_6gevent_7__ident_heappush, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_1, "WeakKeyDictionary", (void **)&__pyx_vp_6gevent_7__ident_WeakKeyDictionary, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + Py_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_2 = PyImport_ImportModule("gevent.__greenlet_primitives"); if (!__pyx_t_2) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_2, "get_objects", (void **)&__pyx_vp_6gevent_21__greenlet_primitives_get_objects, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_2, "wref", (void **)&__pyx_vp_6gevent_21__greenlet_primitives_wref, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_2, "BlockingSwitchOutError", (void **)&__pyx_vp_6gevent_21__greenlet_primitives_BlockingSwitchOutError, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_2, "_greenlet_imported", (void **)&__pyx_vp_6gevent_21__greenlet_primitives__greenlet_imported, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + Py_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_3 = PyImport_ImportModule("gevent.__hub_local"); if (!__pyx_t_3) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_3, "_threadlocal", (void **)&__pyx_vp_6gevent_11__hub_local__threadlocal, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + Py_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_4 = PyImport_ImportModule("gevent.__waiter"); if (!__pyx_t_4) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_4, "sys", (void **)&__pyx_vp_6gevent_8__waiter_sys, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_4, "ConcurrentObjectUseError", (void **)&__pyx_vp_6gevent_8__waiter_ConcurrentObjectUseError, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_4, "_greenlet_imported", (void **)&__pyx_vp_6gevent_8__waiter__greenlet_imported, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_4, "_NONE", (void **)&__pyx_vp_6gevent_8__waiter__NONE, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + Py_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_modinit_function_import_code(void) { + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); + /*--- Function import code ---*/ + __pyx_t_1 = PyImport_ImportModule("gevent.__hub_local"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportFunction(__pyx_t_1, "get_hub_noargs", (void (**)(void))&__pyx_f_6gevent_11__hub_local_get_hub_noargs, "struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *(int __pyx_skip_dispatch)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + Py_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_RefNannyFinishContext(); + return -1; +} + + +#if PY_MAJOR_VERSION < 3 +#ifdef CYTHON_NO_PYINIT_EXPORT +#define __Pyx_PyMODINIT_FUNC void +#else +#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC +#endif +#else +#ifdef CYTHON_NO_PYINIT_EXPORT +#define __Pyx_PyMODINIT_FUNC PyObject * +#else +#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC +#endif +#endif + + +#if PY_MAJOR_VERSION < 3 +__Pyx_PyMODINIT_FUNC init_greenlet(void) CYTHON_SMALL_CODE; /*proto*/ +__Pyx_PyMODINIT_FUNC init_greenlet(void) +#else +__Pyx_PyMODINIT_FUNC PyInit__greenlet(void) CYTHON_SMALL_CODE; /*proto*/ +__Pyx_PyMODINIT_FUNC PyInit__greenlet(void) +#if CYTHON_PEP489_MULTI_PHASE_INIT +{ + return PyModuleDef_Init(&__pyx_moduledef); +} +static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { + #if PY_VERSION_HEX >= 0x030700A1 + static PY_INT64_T main_interpreter_id = -1; + PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); + if (main_interpreter_id == -1) { + main_interpreter_id = current_id; + return (unlikely(current_id == -1)) ? -1 : 0; + } else if (unlikely(main_interpreter_id != current_id)) + #else + static PyInterpreterState *main_interpreter = NULL; + PyInterpreterState *current_interpreter = PyThreadState_Get()->interp; + if (!main_interpreter) { + main_interpreter = current_interpreter; + } else if (unlikely(main_interpreter != current_interpreter)) + #endif + { + PyErr_SetString( + PyExc_ImportError, + "Interpreter change detected - this module can only be loaded into one interpreter per process."); + return -1; + } + return 0; +} +static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) { + PyObject *value = PyObject_GetAttrString(spec, from_name); + int result = 0; + if (likely(value)) { + if (allow_none || value != Py_None) { + result = PyDict_SetItemString(moddict, to_name, value); + } + Py_DECREF(value); + } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_Clear(); + } else { + result = -1; + } + return result; +} +static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) { + PyObject *module = NULL, *moddict, *modname; + if (__Pyx_check_single_interpreter()) + return NULL; + if (__pyx_m) + return __Pyx_NewRef(__pyx_m); + modname = PyObject_GetAttrString(spec, "name"); + if (unlikely(!modname)) goto bad; + module = PyModule_NewObject(modname); + Py_DECREF(modname); + if (unlikely(!module)) goto bad; + moddict = PyModule_GetDict(module); + if (unlikely(!moddict)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad; + return module; +bad: + Py_XDECREF(module); + return NULL; +} + + +static CYTHON_SMALL_CODE int __pyx_pymod_exec__greenlet(PyObject *__pyx_pyinit_module) +#endif +#endif +{ + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + int __pyx_t_9; + __Pyx_RefNannyDeclarations + #if CYTHON_PEP489_MULTI_PHASE_INIT + if (__pyx_m) { + if (__pyx_m == __pyx_pyinit_module) return 0; + PyErr_SetString(PyExc_RuntimeError, "Module '_greenlet' has already been imported. Re-initialisation is not supported."); + return -1; + } + #elif PY_MAJOR_VERSION >= 3 + if (__pyx_m) return __Pyx_NewRef(__pyx_m); + #endif + #if CYTHON_REFNANNY +__Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); +if (!__Pyx_RefNanny) { + PyErr_Clear(); + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); + if (!__Pyx_RefNanny) + Py_FatalError("failed to import 'refnanny' module"); +} +#endif + __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit__greenlet(void)", 0); + if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #ifdef __Pxy_PyFrame_Initialize_Offsets + __Pxy_PyFrame_Initialize_Offsets(); + #endif + __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) + #ifdef __Pyx_CyFunction_USED + if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_FusedFunction_USED + if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_Coroutine_USED + if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_Generator_USED + if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_AsyncGen_USED + if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_StopAsyncIteration_USED + if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + /*--- Library function declarations ---*/ + /*--- Threads initialization code ---*/ + #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS + #ifdef WITH_THREAD /* Python build with threading support? */ + PyEval_InitThreads(); + #endif + #endif + /*--- Module creation code ---*/ + #if CYTHON_PEP489_MULTI_PHASE_INIT + __pyx_m = __pyx_pyinit_module; + Py_INCREF(__pyx_m); + #else + #if PY_MAJOR_VERSION < 3 + __pyx_m = Py_InitModule4("_greenlet", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); + #else + __pyx_m = PyModule_Create(&__pyx_moduledef); + #endif + if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) + Py_INCREF(__pyx_d); + __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) + #if CYTHON_COMPILING_IN_PYPY + Py_INCREF(__pyx_b); + #endif + if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + /*--- Initialize various global constants etc. ---*/ + if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) + if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + if (__pyx_module_is_main_gevent___greenlet) { + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + } + #if PY_MAJOR_VERSION >= 3 + { + PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) + if (!PyDict_GetItemString(modules, "gevent._greenlet")) { + if (unlikely(PyDict_SetItemString(modules, "gevent._greenlet", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error) + } + } + #endif + /*--- Builtin init code ---*/ + if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + /*--- Constants init code ---*/ + if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + /*--- Global type/function init code ---*/ + (void)__Pyx_modinit_global_init_code(); + if (unlikely(__Pyx_modinit_variable_export_code() != 0)) goto __pyx_L1_error; + if (unlikely(__Pyx_modinit_function_export_code() != 0)) goto __pyx_L1_error; + if (unlikely(__Pyx_modinit_type_init_code() != 0)) goto __pyx_L1_error; + if (unlikely(__Pyx_modinit_type_import_code() != 0)) goto __pyx_L1_error; + if (unlikely(__Pyx_modinit_variable_import_code() != 0)) goto __pyx_L1_error; + if (unlikely(__Pyx_modinit_function_import_code() != 0)) goto __pyx_L1_error; + /*--- Execution code ---*/ + #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) + if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + + /* "src/gevent/greenlet.py":6 + * from __future__ import absolute_import, print_function, division + * + * from sys import _getframe as sys_getframe # <<<<<<<<<<<<<< + * from sys import exc_info as sys_exc_info + * from weakref import ref as wref + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_getframe); + __Pyx_GIVEREF(__pyx_n_s_getframe); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_getframe); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_sys, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_getframe); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_v_6gevent_9_greenlet_sys_getframe); + __Pyx_DECREF_SET(__pyx_v_6gevent_9_greenlet_sys_getframe, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/greenlet.py":7 + * + * from sys import _getframe as sys_getframe + * from sys import exc_info as sys_exc_info # <<<<<<<<<<<<<< + * from weakref import ref as wref + * + */ + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_exc_info); + __Pyx_GIVEREF(__pyx_n_s_exc_info); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_exc_info); + __pyx_t_1 = __Pyx_Import(__pyx_n_s_sys, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_exc_info); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_v_6gevent_9_greenlet_sys_exc_info); + __Pyx_DECREF_SET(__pyx_v_6gevent_9_greenlet_sys_exc_info, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/greenlet.py":8 + * from sys import _getframe as sys_getframe + * from sys import exc_info as sys_exc_info + * from weakref import ref as wref # <<<<<<<<<<<<<< + * + * # XXX: How to get cython to let us rename this as RawGreenlet + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 8, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_ref); + __Pyx_GIVEREF(__pyx_n_s_ref); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_ref); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_weakref, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_ref); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 8, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_v_6gevent_9_greenlet_wref); + __Pyx_DECREF_SET(__pyx_v_6gevent_9_greenlet_wref, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/greenlet.py":12 + * # XXX: How to get cython to let us rename this as RawGreenlet + * # like we prefer? + * from greenlet import greenlet # <<<<<<<<<<<<<< + * from greenlet import GreenletExit + * + */ + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_greenlet); + __Pyx_GIVEREF(__pyx_n_s_greenlet); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_greenlet); + __pyx_t_1 = __Pyx_Import(__pyx_n_s_greenlet, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/greenlet.py":13 + * # like we prefer? + * from greenlet import greenlet + * from greenlet import GreenletExit # <<<<<<<<<<<<<< + * + * from gevent._compat import reraise + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_GreenletExit); + __Pyx_GIVEREF(__pyx_n_s_GreenletExit); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_GreenletExit); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_greenlet, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_GreenletExit); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_v_6gevent_9_greenlet_GreenletExit); + __Pyx_DECREF_SET(__pyx_v_6gevent_9_greenlet_GreenletExit, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/greenlet.py":15 + * from greenlet import GreenletExit + * + * from gevent._compat import reraise # <<<<<<<<<<<<<< + * from gevent._compat import PYPY as _PYPY + * from gevent._tblib import dump_traceback + */ + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 15, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_reraise); + __Pyx_GIVEREF(__pyx_n_s_reraise); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_reraise); + __pyx_t_1 = __Pyx_Import(__pyx_n_s_gevent__compat, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 15, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_reraise); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 15, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_v_6gevent_9_greenlet_reraise); + __Pyx_DECREF_SET(__pyx_v_6gevent_9_greenlet_reraise, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/greenlet.py":16 + * + * from gevent._compat import reraise + * from gevent._compat import PYPY as _PYPY # <<<<<<<<<<<<<< + * from gevent._tblib import dump_traceback + * from gevent._tblib import load_traceback + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 16, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_PYPY_2); + __Pyx_GIVEREF(__pyx_n_s_PYPY_2); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_PYPY_2); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_gevent__compat, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 16, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_PYPY_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 16, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 16, __pyx_L1_error) + __pyx_v_6gevent_9_greenlet__PYPY = __pyx_t_3; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/greenlet.py":17 + * from gevent._compat import reraise + * from gevent._compat import PYPY as _PYPY + * from gevent._tblib import dump_traceback # <<<<<<<<<<<<<< + * from gevent._tblib import load_traceback + * + */ + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 17, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_dump_traceback); + __Pyx_GIVEREF(__pyx_n_s_dump_traceback); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_dump_traceback); + __pyx_t_1 = __Pyx_Import(__pyx_n_s_gevent__tblib, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 17, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_dump_traceback); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 17, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_v_6gevent_9_greenlet_dump_traceback); + __Pyx_DECREF_SET(__pyx_v_6gevent_9_greenlet_dump_traceback, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/greenlet.py":18 + * from gevent._compat import PYPY as _PYPY + * from gevent._tblib import dump_traceback + * from gevent._tblib import load_traceback # <<<<<<<<<<<<<< + * + * from gevent.exceptions import InvalidSwitchError + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 18, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_load_traceback); + __Pyx_GIVEREF(__pyx_n_s_load_traceback); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_load_traceback); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_gevent__tblib, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 18, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_load_traceback); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 18, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_v_6gevent_9_greenlet_load_traceback); + __Pyx_DECREF_SET(__pyx_v_6gevent_9_greenlet_load_traceback, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/greenlet.py":20 + * from gevent._tblib import load_traceback + * + * from gevent.exceptions import InvalidSwitchError # <<<<<<<<<<<<<< + * + * from gevent._hub_primitives import iwait_on_objects as iwait + */ + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 20, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_InvalidSwitchError); + __Pyx_GIVEREF(__pyx_n_s_InvalidSwitchError); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_InvalidSwitchError); + __pyx_t_1 = __Pyx_Import(__pyx_n_s_gevent_exceptions, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 20, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_InvalidSwitchError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 20, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_v_6gevent_9_greenlet_InvalidSwitchError); + __Pyx_DECREF_SET(__pyx_v_6gevent_9_greenlet_InvalidSwitchError, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/greenlet.py":22 + * from gevent.exceptions import InvalidSwitchError + * + * from gevent._hub_primitives import iwait_on_objects as iwait # <<<<<<<<<<<<<< + * from gevent._hub_primitives import wait_on_objects as wait + * + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 22, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_iwait_on_objects); + __Pyx_GIVEREF(__pyx_n_s_iwait_on_objects); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_iwait_on_objects); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_gevent__hub_primitives, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 22, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_iwait_on_objects); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 22, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_v_6gevent_9_greenlet_iwait); + __Pyx_DECREF_SET(__pyx_v_6gevent_9_greenlet_iwait, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/greenlet.py":23 + * + * from gevent._hub_primitives import iwait_on_objects as iwait + * from gevent._hub_primitives import wait_on_objects as wait # <<<<<<<<<<<<<< + * + * from gevent.timeout import Timeout + */ + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 23, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_wait_on_objects); + __Pyx_GIVEREF(__pyx_n_s_wait_on_objects); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_wait_on_objects); + __pyx_t_1 = __Pyx_Import(__pyx_n_s_gevent__hub_primitives, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 23, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_wait_on_objects); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 23, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_v_6gevent_9_greenlet_wait); + __Pyx_DECREF_SET(__pyx_v_6gevent_9_greenlet_wait, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/greenlet.py":25 + * from gevent._hub_primitives import wait_on_objects as wait + * + * from gevent.timeout import Timeout # <<<<<<<<<<<<<< + * + * from gevent._config import config as GEVENT_CONFIG + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 25, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_Timeout); + __Pyx_GIVEREF(__pyx_n_s_Timeout); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_Timeout); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_gevent_timeout, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 25, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_Timeout); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 25, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_v_6gevent_9_greenlet_Timeout); + __Pyx_DECREF_SET(__pyx_v_6gevent_9_greenlet_Timeout, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/greenlet.py":27 + * from gevent.timeout import Timeout + * + * from gevent._config import config as GEVENT_CONFIG # <<<<<<<<<<<<<< + * from gevent._util import Lazy + * from gevent._util import readproperty + */ + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 27, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_config); + __Pyx_GIVEREF(__pyx_n_s_config); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_config); + __pyx_t_1 = __Pyx_Import(__pyx_n_s_gevent__config, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 27, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_config); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 27, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_v_6gevent_9_greenlet_GEVENT_CONFIG); + __Pyx_DECREF_SET(__pyx_v_6gevent_9_greenlet_GEVENT_CONFIG, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/greenlet.py":28 + * + * from gevent._config import config as GEVENT_CONFIG + * from gevent._util import Lazy # <<<<<<<<<<<<<< + * from gevent._util import readproperty + * from gevent._hub_local import get_hub_noargs as get_hub + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 28, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_Lazy); + __Pyx_GIVEREF(__pyx_n_s_Lazy); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_Lazy); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_gevent__util, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 28, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_Lazy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 28, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_Lazy, __pyx_t_1) < 0) __PYX_ERR(0, 28, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/greenlet.py":29 + * from gevent._config import config as GEVENT_CONFIG + * from gevent._util import Lazy + * from gevent._util import readproperty # <<<<<<<<<<<<<< + * from gevent._hub_local import get_hub_noargs as get_hub + * from gevent import _waiter + */ + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 29, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_readproperty); + __Pyx_GIVEREF(__pyx_n_s_readproperty); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_readproperty); + __pyx_t_1 = __Pyx_Import(__pyx_n_s_gevent__util, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 29, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_readproperty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 29, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_readproperty, __pyx_t_2) < 0) __PYX_ERR(0, 29, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/greenlet.py":30 + * from gevent._util import Lazy + * from gevent._util import readproperty + * from gevent._hub_local import get_hub_noargs as get_hub # <<<<<<<<<<<<<< + * from gevent import _waiter + * + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 30, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_get_hub_noargs); + __Pyx_GIVEREF(__pyx_n_s_get_hub_noargs); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_get_hub_noargs); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_gevent__hub_local, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 30, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_get_hub_noargs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 30, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_hub_noargs, __pyx_t_1) < 0) __PYX_ERR(0, 30, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/greenlet.py":31 + * from gevent._util import readproperty + * from gevent._hub_local import get_hub_noargs as get_hub + * from gevent import _waiter # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 31, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_waiter_2); + __Pyx_GIVEREF(__pyx_n_s_waiter_2); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_waiter_2); + __pyx_t_1 = __Pyx_Import(__pyx_n_s_gevent, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 31, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_waiter_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 31, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_waiter_2, __pyx_t_2) < 0) __PYX_ERR(0, 31, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/greenlet.py":34 + * + * + * __all__ = [ # <<<<<<<<<<<<<< + * 'Greenlet', + * 'joinall', + */ + __pyx_t_1 = PyList_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 34, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_Greenlet); + __Pyx_GIVEREF(__pyx_n_s_Greenlet); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_Greenlet); + __Pyx_INCREF(__pyx_n_s_joinall); + __Pyx_GIVEREF(__pyx_n_s_joinall); + PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_joinall); + __Pyx_INCREF(__pyx_n_s_killall); + __Pyx_GIVEREF(__pyx_n_s_killall); + PyList_SET_ITEM(__pyx_t_1, 2, __pyx_n_s_killall); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_all, __pyx_t_1) < 0) __PYX_ERR(0, 34, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/greenlet.py":45 + * # is assignment) without generating a 'lvalue is not valid target' + * # error. + * locals()['getcurrent'] = __import__('greenlet').getcurrent # <<<<<<<<<<<<<< + * locals()['greenlet_init'] = lambda: None + * locals()['Waiter'] = _waiter.Waiter + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin___import__, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 45, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_getcurrent); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 45, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_Globals(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 45, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (unlikely(PyDict_SetItem(__pyx_t_1, __pyx_n_s_getcurrent, __pyx_t_2) < 0)) __PYX_ERR(0, 45, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/greenlet.py":46 + * # error. + * locals()['getcurrent'] = __import__('greenlet').getcurrent + * locals()['greenlet_init'] = lambda: None # <<<<<<<<<<<<<< + * locals()['Waiter'] = _waiter.Waiter + * + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_9_greenlet_6lambda, 0, __pyx_n_s_lambda, NULL, __pyx_n_s_gevent__greenlet, __pyx_d, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 46, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_Globals(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 46, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (unlikely(PyDict_SetItem(__pyx_t_1, __pyx_n_s_greenlet_init, __pyx_t_2) < 0)) __PYX_ERR(0, 46, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/greenlet.py":47 + * locals()['getcurrent'] = __import__('greenlet').getcurrent + * locals()['greenlet_init'] = lambda: None + * locals()['Waiter'] = _waiter.Waiter # <<<<<<<<<<<<<< + * + * + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_waiter_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 47, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_Waiter); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 47, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_Globals(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 47, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (unlikely(PyDict_SetItem(__pyx_t_2, __pyx_n_s_Waiter, __pyx_t_1) < 0)) __PYX_ERR(0, 47, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/greenlet.py":50 + * + * + * if _PYPY: # <<<<<<<<<<<<<< + * import _continuation # pylint:disable=import-error + * _continulet = _continuation.continulet + */ + __pyx_t_3 = (__pyx_v_6gevent_9_greenlet__PYPY != 0); + if (__pyx_t_3) { + + /* "src/gevent/greenlet.py":51 + * + * if _PYPY: + * import _continuation # pylint:disable=import-error # <<<<<<<<<<<<<< + * _continulet = _continuation.continulet + * + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_continuation, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 51, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_continuation, __pyx_t_1) < 0) __PYX_ERR(0, 51, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/greenlet.py":52 + * if _PYPY: + * import _continuation # pylint:disable=import-error + * _continulet = _continuation.continulet # <<<<<<<<<<<<<< + * + * + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_continuation); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 52, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_continulet); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 52, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_continulet_2, __pyx_t_2) < 0) __PYX_ERR(0, 52, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/greenlet.py":50 + * + * + * if _PYPY: # <<<<<<<<<<<<<< + * import _continuation # pylint:disable=import-error + * _continulet = _continuation.continulet + */ + } + + /* "src/gevent/greenlet.py":61 + * Can be called only from main loop. + * """ + * __slots__ = ['callback'] # <<<<<<<<<<<<<< + * + * def __init__(self, callback): + */ + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 61, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_callback); + __Pyx_GIVEREF(__pyx_n_s_callback); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_callback); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet_SpawnedLink->tp_dict, __pyx_n_s_slots, __pyx_t_2) < 0) __PYX_ERR(0, 61, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_9_greenlet_SpawnedLink); + + /* "src/gevent/greenlet.py":94 + * Can be called only from main loop. + * """ + * __slots__ = [] # <<<<<<<<<<<<<< + * + * def __call__(self, source): + */ + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 94, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet_SuccessSpawnedLink->tp_dict, __pyx_n_s_slots, __pyx_t_2) < 0) __PYX_ERR(0, 94, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_9_greenlet_SuccessSpawnedLink); + + /* "src/gevent/greenlet.py":106 + * Can be called only from main loop. + * """ + * __slots__ = [] # <<<<<<<<<<<<<< + * + * def __call__(self, source): + */ + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 106, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet_FailureSpawnedLink->tp_dict, __pyx_n_s_slots, __pyx_t_2) < 0) __PYX_ERR(0, 106, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_9_greenlet_FailureSpawnedLink); + + /* "src/gevent/greenlet.py":114 + * class _Frame(object): + * + * __slots__ = ('f_code', 'f_lineno', 'f_back') # <<<<<<<<<<<<<< + * + * def __init__(self, f_code, f_lineno, f_back): + */ + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet__Frame->tp_dict, __pyx_n_s_slots, __pyx_tuple__22) < 0) __PYX_ERR(0, 114, __pyx_L1_error) + PyType_Modified(__pyx_ptype_6gevent_9_greenlet__Frame); + + /* "src/gevent/greenlet.py":155 + * + * + * _greenlet__init__ = greenlet.__init__ # <<<<<<<<<<<<<< + * + * class Greenlet(greenlet): + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_6gevent_9_greenlet_greenlet), __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 155, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_v_6gevent_9_greenlet__greenlet__init__); + __Pyx_DECREF_SET(__pyx_v_6gevent_9_greenlet__greenlet__init__, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + + /* "src/gevent/greenlet.py":163 + * # pylint:disable=too-many-public-methods,too-many-instance-attributes + * + * spawning_stack_limit = 10 # <<<<<<<<<<<<<< + * + * # pylint:disable=keyword-arg-before-vararg,super-init-not-called + */ + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet->tp_dict, __pyx_n_s_spawning_stack_limit, __pyx_int_10) < 0) __PYX_ERR(0, 163, __pyx_L1_error) + PyType_Modified(__pyx_ptype_6gevent_9_greenlet_Greenlet); + + /* "src/gevent/greenlet.py":268 + * + * @Lazy + * def spawning_stack(self): # <<<<<<<<<<<<<< + * # Store this in the __dict__. We don't use it from the C + * # code. It's tempting to discard _spawning_stack_frames + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_9_greenlet_8Greenlet_3spawning_stack, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Greenlet_spawning_stack, NULL, __pyx_n_s_gevent__greenlet, __pyx_d, ((PyObject *)__pyx_codeobj__24)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 268, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet->tp_dict, __pyx_n_s_spawning_stack, __pyx_t_2) < 0) __PYX_ERR(0, 268, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_9_greenlet_Greenlet); + + /* "src/gevent/greenlet.py":267 + * self._spawning_stack_frames = None + * + * @Lazy # <<<<<<<<<<<<<< + * def spawning_stack(self): + * # Store this in the __dict__. We don't use it from the C + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Lazy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 267, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + + /* "src/gevent/greenlet.py":268 + * + * @Lazy + * def spawning_stack(self): # <<<<<<<<<<<<<< + * # Store this in the __dict__. We don't use it from the C + * # code. It's tempting to discard _spawning_stack_frames + */ + __Pyx_GetNameInClass(__pyx_t_4, (PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet, __pyx_n_s_spawning_stack); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 268, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_1, function); + } + } + __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 267, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet->tp_dict, __pyx_n_s_spawning_stack, __pyx_t_2) < 0) __PYX_ERR(0, 268, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_9_greenlet_Greenlet); + + /* "src/gevent/greenlet.py":301 + * + * @readproperty + * def name(self): # <<<<<<<<<<<<<< + * """ + * The greenlet name. By default, a unique name is constructed using + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_9_greenlet_8Greenlet_5name, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Greenlet_name, NULL, __pyx_n_s_gevent__greenlet, __pyx_d, ((PyObject *)__pyx_codeobj__26)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 301, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet->tp_dict, __pyx_n_s_name_2, __pyx_t_2) < 0) __PYX_ERR(0, 301, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_9_greenlet_Greenlet); + + /* "src/gevent/greenlet.py":300 + * return self._ident + * + * @readproperty # <<<<<<<<<<<<<< + * def name(self): + * """ + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_readproperty); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 300, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + + /* "src/gevent/greenlet.py":301 + * + * @readproperty + * def name(self): # <<<<<<<<<<<<<< + * """ + * The greenlet name. By default, a unique name is constructed using + */ + __Pyx_GetNameInClass(__pyx_t_4, (PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet, __pyx_n_s_name_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 301, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_1, function); + } + } + __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 300, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet->tp_dict, __pyx_n_s_name_2, __pyx_t_2) < 0) __PYX_ERR(0, 301, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_9_greenlet_Greenlet); + + /* "src/gevent/greenlet.py":316 + * return 'Greenlet-%d' % (self.minimal_ident,) + * + * def _raise_exception(self): # <<<<<<<<<<<<<< + * reraise(*self.exc_info) + * + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_9_greenlet_8Greenlet_7_raise_exception, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Greenlet__raise_exception, NULL, __pyx_n_s_gevent__greenlet, __pyx_d, ((PyObject *)__pyx_codeobj__28)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 316, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet->tp_dict, __pyx_n_s_raise_exception, __pyx_t_2) < 0) __PYX_ERR(0, 316, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_9_greenlet_Greenlet); + + /* "src/gevent/greenlet.py":326 + * def __nonzero__(self): + * return self._start_event is not None and self._exc_info is None + * try: # <<<<<<<<<<<<<< + * __bool__ = __nonzero__ # Python 3 + * except NameError: # pragma: no cover + */ + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); + __Pyx_XGOTREF(__pyx_t_6); + __Pyx_XGOTREF(__pyx_t_7); + __Pyx_XGOTREF(__pyx_t_8); + /*try:*/ { + + /* "src/gevent/greenlet.py":327 + * return self._start_event is not None and self._exc_info is None + * try: + * __bool__ = __nonzero__ # Python 3 # <<<<<<<<<<<<<< + * except NameError: # pragma: no cover + * # When we're compiled with Cython, the __nonzero__ function + */ + __Pyx_GetNameInClass(__pyx_t_2, (PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet, __pyx_n_s_nonzero); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 327, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet->tp_dict, __pyx_n_s_bool, __pyx_t_2) < 0) __PYX_ERR(0, 327, __pyx_L3_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_9_greenlet_Greenlet); + + /* "src/gevent/greenlet.py":326 + * def __nonzero__(self): + * return self._start_event is not None and self._exc_info is None + * try: # <<<<<<<<<<<<<< + * __bool__ = __nonzero__ # Python 3 + * except NameError: # pragma: no cover + */ + } + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + goto __pyx_L8_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/greenlet.py":328 + * try: + * __bool__ = __nonzero__ # Python 3 + * except NameError: # pragma: no cover # <<<<<<<<<<<<<< + * # When we're compiled with Cython, the __nonzero__ function + * # goes directly into the slot and can't be accessed by name. + */ + __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_NameError); + if (__pyx_t_9) { + __Pyx_ErrRestore(0,0,0); + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + + /* "src/gevent/greenlet.py":326 + * def __nonzero__(self): + * return self._start_event is not None and self._exc_info is None + * try: # <<<<<<<<<<<<<< + * __bool__ = __nonzero__ # Python 3 + * except NameError: # pragma: no cover + */ + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); + goto __pyx_L1_error; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); + __pyx_L8_try_end:; + } + + /* "src/gevent/greenlet.py":335 + * ### Lifecycle + * + * if _PYPY: # <<<<<<<<<<<<<< + * # oops - pypy's .dead relies on __nonzero__ which we overriden above + * @property + */ + __pyx_t_3 = (__pyx_v_6gevent_9_greenlet__PYPY != 0); + if (__pyx_t_3) { + + /* "src/gevent/greenlet.py":348 + * else: + * @property + * def dead(self): # <<<<<<<<<<<<<< + * "Boolean indicating that the greenlet is dead and will not run again." + * return self.__start_cancelled_by_kill() or self.__started_but_aborted() or greenlet.dead.__get__(self) + */ + goto __pyx_L9; + } + /*else*/ { + } + __pyx_L9:; + + /* "src/gevent/greenlet.py":407 + * return bool(self) + * + * def ready(self): # <<<<<<<<<<<<<< + * """ + * Return a true value if and only if the greenlet has finished + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_9_greenlet_8Greenlet_11ready, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Greenlet_ready, NULL, __pyx_n_s_gevent__greenlet, __pyx_d, ((PyObject *)__pyx_codeobj__30)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 407, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet->tp_dict, __pyx_n_s_ready, __pyx_t_2) < 0) __PYX_ERR(0, 407, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_9_greenlet_Greenlet); + + /* "src/gevent/greenlet.py":418 + * return self.dead or self._exc_info is not None + * + * def successful(self): # <<<<<<<<<<<<<< + * """ + * Return a true value if and only if the greenlet has finished execution + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_9_greenlet_8Greenlet_13successful, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Greenlet_successful, NULL, __pyx_n_s_gevent__greenlet, __pyx_d, ((PyObject *)__pyx_codeobj__32)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 418, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet->tp_dict, __pyx_n_s_successful, __pyx_t_2) < 0) __PYX_ERR(0, 418, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_9_greenlet_Greenlet); + + /* "src/gevent/greenlet.py":448 + * + * + * def _formatinfo(self): # <<<<<<<<<<<<<< + * info = self._formatted_info + * if info is not None: + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_9_greenlet_8Greenlet_17_formatinfo, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Greenlet__formatinfo, NULL, __pyx_n_s_gevent__greenlet, __pyx_d, ((PyObject *)__pyx_codeobj__34)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 448, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet->tp_dict, __pyx_n_s_formatinfo, __pyx_t_2) < 0) __PYX_ERR(0, 448, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_9_greenlet_Greenlet); + + /* "src/gevent/greenlet.py":498 + * return (ei[0], ei[1], load_traceback(ei[2])) + * + * def throw(self, *args): # <<<<<<<<<<<<<< + * """Immediately switch into the greenlet and raise an exception in it. + * + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_9_greenlet_8Greenlet_19throw, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Greenlet_throw, NULL, __pyx_n_s_gevent__greenlet, __pyx_d, ((PyObject *)__pyx_codeobj__36)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 498, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet->tp_dict, __pyx_n_s_throw, __pyx_t_2) < 0) __PYX_ERR(0, 498, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_9_greenlet_Greenlet); + + /* "src/gevent/greenlet.py":520 + * self.__handle_death_before_start(args) + * + * def start(self): # <<<<<<<<<<<<<< + * """Schedule the greenlet to run in this loop iteration""" + * if self._start_event is None: + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_9_greenlet_8Greenlet_21start, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Greenlet_start, NULL, __pyx_n_s_gevent__greenlet, __pyx_d, ((PyObject *)__pyx_codeobj__38)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 520, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet->tp_dict, __pyx_n_s_start, __pyx_t_2) < 0) __PYX_ERR(0, 520, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_9_greenlet_Greenlet); + + /* "src/gevent/greenlet.py":526 + * self._start_event = self.parent.loop.run_callback(self.switch) + * + * def start_later(self, seconds): # <<<<<<<<<<<<<< + * """ + * start_later(seconds) -> None + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_9_greenlet_8Greenlet_23start_later, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Greenlet_start_later, NULL, __pyx_n_s_gevent__greenlet, __pyx_d, ((PyObject *)__pyx_codeobj__40)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 526, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet->tp_dict, __pyx_n_s_start_later, __pyx_t_2) < 0) __PYX_ERR(0, 526, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_9_greenlet_Greenlet); + + /* "src/gevent/greenlet.py":539 + * + * @staticmethod + * def add_spawn_callback(callback): # <<<<<<<<<<<<<< + * """ + * add_spawn_callback(callback) -> None + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_9_greenlet_8Greenlet_25add_spawn_callback, __Pyx_CYFUNCTION_STATICMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Greenlet_add_spawn_callback, NULL, __pyx_n_s_gevent__greenlet, __pyx_d, ((PyObject *)__pyx_codeobj__42)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 539, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet->tp_dict, __pyx_n_s_add_spawn_callback, __pyx_t_2) < 0) __PYX_ERR(0, 539, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_9_greenlet_Greenlet); + + /* "src/gevent/greenlet.py":538 + * self._start_event.start(self.switch) + * + * @staticmethod # <<<<<<<<<<<<<< + * def add_spawn_callback(callback): + * """ + */ + __Pyx_GetNameInClass(__pyx_t_2, (PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet, __pyx_n_s_add_spawn_callback); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 539, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_staticmethod, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 538, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet->tp_dict, __pyx_n_s_add_spawn_callback, __pyx_t_1) < 0) __PYX_ERR(0, 539, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + PyType_Modified(__pyx_ptype_6gevent_9_greenlet_Greenlet); + + /* "src/gevent/greenlet.py":558 + * + * @staticmethod + * def remove_spawn_callback(callback): # <<<<<<<<<<<<<< + * """ + * remove_spawn_callback(callback) -> None + */ + __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_9_greenlet_8Greenlet_27remove_spawn_callback, __Pyx_CYFUNCTION_STATICMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Greenlet_remove_spawn_callback, NULL, __pyx_n_s_gevent__greenlet, __pyx_d, ((PyObject *)__pyx_codeobj__44)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 558, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet->tp_dict, __pyx_n_s_remove_spawn_callback, __pyx_t_1) < 0) __PYX_ERR(0, 558, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + PyType_Modified(__pyx_ptype_6gevent_9_greenlet_Greenlet); + + /* "src/gevent/greenlet.py":557 + * _spawn_callbacks.add(callback) + * + * @staticmethod # <<<<<<<<<<<<<< + * def remove_spawn_callback(callback): + * """ + */ + __Pyx_GetNameInClass(__pyx_t_1, (PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet, __pyx_n_s_remove_spawn_callback); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 558, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_staticmethod, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 557, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet->tp_dict, __pyx_n_s_remove_spawn_callback, __pyx_t_2) < 0) __PYX_ERR(0, 558, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_9_greenlet_Greenlet); + + /* "src/gevent/greenlet.py":575 + * + * @classmethod + * def spawn(cls, *args, **kwargs): # <<<<<<<<<<<<<< + * """ + * spawn(function, *args, **kwargs) -> Greenlet + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_9_greenlet_8Greenlet_29spawn, __Pyx_CYFUNCTION_CLASSMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Greenlet_spawn, NULL, __pyx_n_s_gevent__greenlet, __pyx_d, ((PyObject *)__pyx_codeobj__46)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 575, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet->tp_dict, __pyx_n_s_spawn, __pyx_t_2) < 0) __PYX_ERR(0, 575, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_9_greenlet_Greenlet); + + /* "src/gevent/greenlet.py":574 + * _spawn_callbacks = None + * + * @classmethod # <<<<<<<<<<<<<< + * def spawn(cls, *args, **kwargs): + * """ + */ + __Pyx_GetNameInClass(__pyx_t_2, (PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet, __pyx_n_s_spawn); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 575, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_Method_ClassMethod(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 574, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet->tp_dict, __pyx_n_s_spawn, __pyx_t_1) < 0) __PYX_ERR(0, 575, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + PyType_Modified(__pyx_ptype_6gevent_9_greenlet_Greenlet); + + /* "src/gevent/greenlet.py":593 + * + * @classmethod + * def spawn_later(cls, seconds, *args, **kwargs): # <<<<<<<<<<<<<< + * """ + * spawn_later(seconds, function, *args, **kwargs) -> Greenlet + */ + __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_9_greenlet_8Greenlet_31spawn_later, __Pyx_CYFUNCTION_CLASSMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Greenlet_spawn_later, NULL, __pyx_n_s_gevent__greenlet, __pyx_d, ((PyObject *)__pyx_codeobj__48)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 593, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet->tp_dict, __pyx_n_s_spawn_later, __pyx_t_1) < 0) __PYX_ERR(0, 593, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + PyType_Modified(__pyx_ptype_6gevent_9_greenlet_Greenlet); + + /* "src/gevent/greenlet.py":592 + * return g + * + * @classmethod # <<<<<<<<<<<<<< + * def spawn_later(cls, seconds, *args, **kwargs): + * """ + */ + __Pyx_GetNameInClass(__pyx_t_1, (PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet, __pyx_n_s_spawn_later); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 593, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_Method_ClassMethod(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 592, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet->tp_dict, __pyx_n_s_spawn_later, __pyx_t_2) < 0) __PYX_ERR(0, 593, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_9_greenlet_Greenlet); + + /* "src/gevent/greenlet.py":615 + * return g + * + * def kill(self, exception=GreenletExit, block=True, timeout=None): # <<<<<<<<<<<<<< + * """ + * Raise the ``exception`` in the greenlet. + */ + __Pyx_INCREF(__pyx_v_6gevent_9_greenlet_GreenletExit); + __pyx_k__10 = __pyx_v_6gevent_9_greenlet_GreenletExit; + __Pyx_GIVEREF(__pyx_v_6gevent_9_greenlet_GreenletExit); + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_9_greenlet_8Greenlet_33kill, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Greenlet_kill, NULL, __pyx_n_s_gevent__greenlet, __pyx_d, ((PyObject *)__pyx_codeobj__50)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 615, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet->tp_dict, __pyx_n_s_kill_2, __pyx_t_2) < 0) __PYX_ERR(0, 615, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_9_greenlet_Greenlet); + + /* "src/gevent/greenlet.py":667 + * # thus it should not raise when the greenlet is already killed (= not started) + * + * def get(self, block=True, timeout=None): # <<<<<<<<<<<<<< + * """ + * get(block=True, timeout=None) -> object + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_9_greenlet_8Greenlet_35get, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Greenlet_get, NULL, __pyx_n_s_gevent__greenlet, __pyx_d, ((PyObject *)__pyx_codeobj__52)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 667, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet->tp_dict, __pyx_n_s_get_2, __pyx_t_2) < 0) __PYX_ERR(0, 667, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_9_greenlet_Greenlet); + + /* "src/gevent/greenlet.py":711 + * self._raise_exception() + * + * def join(self, timeout=None): # <<<<<<<<<<<<<< + * """ + * join(timeout=None) -> None + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_9_greenlet_8Greenlet_37join, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Greenlet_join, NULL, __pyx_n_s_gevent__greenlet, __pyx_d, ((PyObject *)__pyx_codeobj__54)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 711, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet->tp_dict, __pyx_n_s_join, __pyx_t_2) < 0) __PYX_ERR(0, 711, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_9_greenlet_Greenlet); + + /* "src/gevent/greenlet.py":760 + * del exc_info + * + * def run(self): # <<<<<<<<<<<<<< + * try: + * self.__cancel_start() + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_9_greenlet_8Greenlet_39run, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Greenlet_run, NULL, __pyx_n_s_gevent__greenlet, __pyx_d, ((PyObject *)__pyx_codeobj__56)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 760, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet->tp_dict, __pyx_n_s_run, __pyx_t_2) < 0) __PYX_ERR(0, 760, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_9_greenlet_Greenlet); + + /* "src/gevent/greenlet.py":776 + * self.kwargs.clear() + * + * def _run(self): # <<<<<<<<<<<<<< + * """ + * Subclasses may override this method to take any number of + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_9_greenlet_8Greenlet_41_run, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Greenlet__run, NULL, __pyx_n_s_gevent__greenlet, __pyx_d, ((PyObject *)__pyx_codeobj__58)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 776, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet->tp_dict, __pyx_n_s_run_2, __pyx_t_2) < 0) __PYX_ERR(0, 776, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_9_greenlet_Greenlet); + + /* "src/gevent/greenlet.py":790 + * return + * + * def has_links(self): # <<<<<<<<<<<<<< + * return len(self._links) + * + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_9_greenlet_8Greenlet_43has_links, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Greenlet_has_links, NULL, __pyx_n_s_gevent__greenlet, __pyx_d, ((PyObject *)__pyx_codeobj__60)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 790, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet->tp_dict, __pyx_n_s_has_links, __pyx_t_2) < 0) __PYX_ERR(0, 790, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_9_greenlet_Greenlet); + + /* "src/gevent/greenlet.py":793 + * return len(self._links) + * + * def rawlink(self, callback): # <<<<<<<<<<<<<< + * """ + * Register a callable to be executed when the greenlet finishes + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_9_greenlet_8Greenlet_45rawlink, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Greenlet_rawlink, NULL, __pyx_n_s_gevent__greenlet, __pyx_d, ((PyObject *)__pyx_codeobj__62)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 793, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet->tp_dict, __pyx_n_s_rawlink, __pyx_t_2) < 0) __PYX_ERR(0, 793, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_9_greenlet_Greenlet); + + /* "src/gevent/greenlet.py":809 + * self._notifier = self.parent.loop.run_callback(self._notify_links) + * + * def link(self, callback, SpawnedLink=SpawnedLink): # <<<<<<<<<<<<<< + * """ + * Link greenlet's completion to a callable. + */ + __Pyx_INCREF(((PyObject *)__pyx_ptype_6gevent_9_greenlet_SpawnedLink)); + __pyx_k__13 = ((PyObject *)__pyx_ptype_6gevent_9_greenlet_SpawnedLink); + __Pyx_GIVEREF(__pyx_ptype_6gevent_9_greenlet_SpawnedLink); + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_9_greenlet_8Greenlet_47link, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Greenlet_link, NULL, __pyx_n_s_gevent__greenlet, __pyx_d, ((PyObject *)__pyx_codeobj__64)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 809, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet->tp_dict, __pyx_n_s_link, __pyx_t_2) < 0) __PYX_ERR(0, 809, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_9_greenlet_Greenlet); + + /* "src/gevent/greenlet.py":823 + * self.rawlink(SpawnedLink(callback)) + * + * def unlink(self, callback): # <<<<<<<<<<<<<< + * """Remove the callback set by :meth:`link` or :meth:`rawlink`""" + * try: + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_9_greenlet_8Greenlet_49unlink, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Greenlet_unlink, NULL, __pyx_n_s_gevent__greenlet, __pyx_d, ((PyObject *)__pyx_codeobj__66)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 823, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet->tp_dict, __pyx_n_s_unlink, __pyx_t_2) < 0) __PYX_ERR(0, 823, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_9_greenlet_Greenlet); + + /* "src/gevent/greenlet.py":830 + * pass + * + * def unlink_all(self): # <<<<<<<<<<<<<< + * """ + * Remove all the callbacks. + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_9_greenlet_8Greenlet_51unlink_all, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Greenlet_unlink_all, NULL, __pyx_n_s_gevent__greenlet, __pyx_d, ((PyObject *)__pyx_codeobj__68)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 830, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet->tp_dict, __pyx_n_s_unlink_all, __pyx_t_2) < 0) __PYX_ERR(0, 830, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_9_greenlet_Greenlet); + + /* "src/gevent/greenlet.py":838 + * del self._links[:] + * + * def link_value(self, callback, SpawnedLink=SuccessSpawnedLink): # <<<<<<<<<<<<<< + * """ + * Like :meth:`link` but *callback* is only notified when the greenlet + */ + __Pyx_INCREF(((PyObject *)__pyx_ptype_6gevent_9_greenlet_SuccessSpawnedLink)); + __pyx_k__14 = ((PyObject *)__pyx_ptype_6gevent_9_greenlet_SuccessSpawnedLink); + __Pyx_GIVEREF(__pyx_ptype_6gevent_9_greenlet_SuccessSpawnedLink); + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_9_greenlet_8Greenlet_53link_value, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Greenlet_link_value, NULL, __pyx_n_s_gevent__greenlet, __pyx_d, ((PyObject *)__pyx_codeobj__70)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 838, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet->tp_dict, __pyx_n_s_link_value, __pyx_t_2) < 0) __PYX_ERR(0, 838, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_9_greenlet_Greenlet); + + /* "src/gevent/greenlet.py":846 + * self.link(callback, SpawnedLink=SpawnedLink) + * + * def link_exception(self, callback, SpawnedLink=FailureSpawnedLink): # <<<<<<<<<<<<<< + * """ + * Like :meth:`link` but *callback* is only notified when the + */ + __Pyx_INCREF(((PyObject *)__pyx_ptype_6gevent_9_greenlet_FailureSpawnedLink)); + __pyx_k__15 = ((PyObject *)__pyx_ptype_6gevent_9_greenlet_FailureSpawnedLink); + __Pyx_GIVEREF(__pyx_ptype_6gevent_9_greenlet_FailureSpawnedLink); + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_9_greenlet_8Greenlet_55link_exception, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Greenlet_link_exception, NULL, __pyx_n_s_gevent__greenlet, __pyx_d, ((PyObject *)__pyx_codeobj__72)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 846, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet->tp_dict, __pyx_n_s_link_exception, __pyx_t_2) < 0) __PYX_ERR(0, 846, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_9_greenlet_Greenlet); + + /* "src/gevent/greenlet.py":854 + * self.link(callback, SpawnedLink=SpawnedLink) + * + * def _notify_links(self): # <<<<<<<<<<<<<< + * while self._links: + * # Early links are allowed to remove later links + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_9_greenlet_8Greenlet_57_notify_links, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Greenlet__notify_links, NULL, __pyx_n_s_gevent__greenlet, __pyx_d, ((PyObject *)__pyx_codeobj__74)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 854, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet->tp_dict, __pyx_n_s_notify_links, __pyx_t_2) < 0) __PYX_ERR(0, 854, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_9_greenlet_Greenlet); + + /* "src/gevent/greenlet.py":871 + * + * class _dummy_event(object): + * __slots__ = ('pending', 'active') # <<<<<<<<<<<<<< + * + * def __init__(self): + */ + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet__dummy_event->tp_dict, __pyx_n_s_slots, __pyx_tuple__75) < 0) __PYX_ERR(0, 871, __pyx_L1_error) + PyType_Modified(__pyx_ptype_6gevent_9_greenlet__dummy_event); + + /* "src/gevent/greenlet.py":876 + * self.pending = self.active = False + * + * def stop(self): # <<<<<<<<<<<<<< + * pass + * + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_9_greenlet_12_dummy_event_3stop, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_dummy_event_stop, NULL, __pyx_n_s_gevent__greenlet, __pyx_d, ((PyObject *)__pyx_codeobj__77)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 876, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet__dummy_event->tp_dict, __pyx_n_s_stop, __pyx_t_2) < 0) __PYX_ERR(0, 876, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_9_greenlet__dummy_event); + + /* "src/gevent/greenlet.py":879 + * pass + * + * def start(self, cb): # pylint:disable=unused-argument # <<<<<<<<<<<<<< + * raise AssertionError("Cannot start the dummy event") + * + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_9_greenlet_12_dummy_event_5start, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_dummy_event_start, NULL, __pyx_n_s_gevent__greenlet, __pyx_d, ((PyObject *)__pyx_codeobj__79)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 879, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet__dummy_event->tp_dict, __pyx_n_s_start, __pyx_t_2) < 0) __PYX_ERR(0, 879, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_9_greenlet__dummy_event); + + /* "src/gevent/greenlet.py":882 + * raise AssertionError("Cannot start the dummy event") + * + * def close(self): # <<<<<<<<<<<<<< + * pass + * + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_9_greenlet_12_dummy_event_7close, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_dummy_event_close, NULL, __pyx_n_s_gevent__greenlet, __pyx_d, ((PyObject *)__pyx_codeobj__81)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 882, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet__dummy_event->tp_dict, __pyx_n_s_close, __pyx_t_2) < 0) __PYX_ERR(0, 882, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_9_greenlet__dummy_event); + + /* "src/gevent/greenlet.py":885 + * pass + * + * _cancelled_start_event = _dummy_event() # <<<<<<<<<<<<<< + * _start_completed_event = _dummy_event() + * + */ + __pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_6gevent_9_greenlet__dummy_event)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 885, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_XGOTREF(((PyObject *)__pyx_v_6gevent_9_greenlet__cancelled_start_event)); + __Pyx_DECREF_SET(__pyx_v_6gevent_9_greenlet__cancelled_start_event, ((struct __pyx_obj_6gevent_9_greenlet__dummy_event *)__pyx_t_2)); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + + /* "src/gevent/greenlet.py":886 + * + * _cancelled_start_event = _dummy_event() + * _start_completed_event = _dummy_event() # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_6gevent_9_greenlet__dummy_event)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 886, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_XGOTREF(((PyObject *)__pyx_v_6gevent_9_greenlet__start_completed_event)); + __Pyx_DECREF_SET(__pyx_v_6gevent_9_greenlet__start_completed_event, ((struct __pyx_obj_6gevent_9_greenlet__dummy_event *)__pyx_t_2)); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + + /* "src/gevent/greenlet.py":889 + * + * + * def _kill(glet, exception, waiter): # <<<<<<<<<<<<<< + * try: + * glet.throw(exception) + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_9_greenlet_1_kill, 0, __pyx_n_s_kill, NULL, __pyx_n_s_gevent__greenlet, __pyx_d, ((PyObject *)__pyx_codeobj__83)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 889, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_kill, __pyx_t_2) < 0) __PYX_ERR(0, 889, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/greenlet.py":899 + * + * + * def joinall(greenlets, timeout=None, raise_error=False, count=None): # <<<<<<<<<<<<<< + * """ + * Wait for the ``greenlets`` to finish. + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_9_greenlet_3joinall, 0, __pyx_n_s_joinall, NULL, __pyx_n_s_gevent__greenlet, __pyx_d, ((PyObject *)__pyx_codeobj__85)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 899, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_joinall, __pyx_t_2) < 0) __PYX_ERR(0, 899, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/greenlet.py":950 + * + * + * _spawn_callbacks = None # <<<<<<<<<<<<<< + * + * + */ + __Pyx_INCREF(Py_None); + __Pyx_XGOTREF(__pyx_v_6gevent_9_greenlet__spawn_callbacks); + __Pyx_DECREF_SET(__pyx_v_6gevent_9_greenlet__spawn_callbacks, ((PyObject*)Py_None)); + __Pyx_GIVEREF(Py_None); + + /* "src/gevent/greenlet.py":953 + * + * + * def killall(greenlets, exception=GreenletExit, block=True, timeout=None): # <<<<<<<<<<<<<< + * """ + * Forceably terminate all the ``greenlets`` by causing them to raise ``exception``. + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_9_greenlet_5killall, 0, __pyx_n_s_killall, NULL, __pyx_n_s_gevent__greenlet, __pyx_d, ((PyObject *)__pyx_codeobj__87)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 953, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (!__Pyx_CyFunction_InitDefaults(__pyx_t_2, sizeof(__pyx_defaults), 1)) __PYX_ERR(0, 953, __pyx_L1_error) + __Pyx_INCREF(__pyx_v_6gevent_9_greenlet_GreenletExit); + __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_t_2)->__pyx_arg_exception = __pyx_v_6gevent_9_greenlet_GreenletExit; + __Pyx_GIVEREF(__pyx_v_6gevent_9_greenlet_GreenletExit); + __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_2, __pyx_pf_6gevent_9_greenlet_7__defaults__); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_killall, __pyx_t_2) < 0) __PYX_ERR(0, 953, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/greenlet.py":1000 + * greenlet_init() # pylint:disable=undefined-variable + * + * _init() # <<<<<<<<<<<<<< + * + * from gevent._util import import_c_accel + */ + __pyx_f_6gevent_9_greenlet__init(); + + /* "src/gevent/greenlet.py":1002 + * _init() + * + * from gevent._util import import_c_accel # <<<<<<<<<<<<<< + * import_c_accel(globals(), 'gevent._greenlet') + */ + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1002, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_import_c_accel); + __Pyx_GIVEREF(__pyx_n_s_import_c_accel); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_import_c_accel); + __pyx_t_1 = __Pyx_Import(__pyx_n_s_gevent__util, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1002, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_import_c_accel); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1002, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_import_c_accel, __pyx_t_2) < 0) __PYX_ERR(0, 1002, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/greenlet.py":1003 + * + * from gevent._util import import_c_accel + * import_c_accel(globals(), 'gevent._greenlet') # <<<<<<<<<<<<<< + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_import_c_accel); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1003, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_Globals(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1003, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1003, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_INCREF(__pyx_n_s_gevent__greenlet); + __Pyx_GIVEREF(__pyx_n_s_gevent__greenlet); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_n_s_gevent__greenlet); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1003, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/greenlet.py":1 + * # Copyright (c) 2009-2012 Denis Bilenko. See LICENSE for details. # <<<<<<<<<<<<<< + * # cython: auto_pickle=False,embedsignature=True,always_allow_keywords=False + * + */ + __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "cfunc.to_py":64 + * + * @cname("__Pyx_CFunc_object____list____object___to_py") + * cdef object __Pyx_CFunc_object____list____object___to_py(object (*f)(list, object) ): # <<<<<<<<<<<<<< + * def wrap(list greenlets, object exception): + * """wrap(greenlets: list, exception)""" + */ + + /*--- Wrapped vars code ---*/ + + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + if (__pyx_m) { + if (__pyx_d) { + __Pyx_AddTraceback("init gevent._greenlet", __pyx_clineno, __pyx_lineno, __pyx_filename); + } + Py_CLEAR(__pyx_m); + } else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_ImportError, "init gevent._greenlet"); + } + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + #if CYTHON_PEP489_MULTI_PHASE_INIT + return (__pyx_m != NULL) ? 0 : -1; + #elif PY_MAJOR_VERSION >= 3 + return __pyx_m; + #else + return; + #endif +} + +/* --- Runtime support code --- */ +/* Refnanny */ +#if CYTHON_REFNANNY +static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { + PyObject *m = NULL, *p = NULL; + void *r = NULL; + m = PyImport_ImportModule(modname); + if (!m) goto end; + p = PyObject_GetAttrString(m, "RefNannyAPI"); + if (!p) goto end; + r = PyLong_AsVoidPtr(p); +end: + Py_XDECREF(p); + Py_XDECREF(m); + return (__Pyx_RefNannyAPIStruct *)r; +} +#endif + +/* PyObjectGetAttrStr */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_getattro)) + return tp->tp_getattro(obj, attr_name); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_getattr)) + return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); +#endif + return PyObject_GetAttr(obj, attr_name); +} +#endif + +/* GetBuiltinName */ +static PyObject *__Pyx_GetBuiltinName(PyObject *name) { + PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name); + if (unlikely(!result)) { + PyErr_Format(PyExc_NameError, +#if PY_MAJOR_VERSION >= 3 + "name '%U' is not defined", name); +#else + "name '%.200s' is not defined", PyString_AS_STRING(name)); +#endif + } + return result; +} + +/* RaiseDoubleKeywords */ +static void __Pyx_RaiseDoubleKeywordsError( + const char* func_name, + PyObject* kw_name) +{ + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION >= 3 + "%s() got multiple values for keyword argument '%U'", func_name, kw_name); + #else + "%s() got multiple values for keyword argument '%s'", func_name, + PyString_AsString(kw_name)); + #endif +} + +/* ParseKeywords */ +static int __Pyx_ParseOptionalKeywords( + PyObject *kwds, + PyObject **argnames[], + PyObject *kwds2, + PyObject *values[], + Py_ssize_t num_pos_args, + const char* function_name) +{ + PyObject *key = 0, *value = 0; + Py_ssize_t pos = 0; + PyObject*** name; + PyObject*** first_kw_arg = argnames + num_pos_args; + while (PyDict_Next(kwds, &pos, &key, &value)) { + name = first_kw_arg; + while (*name && (**name != key)) name++; + if (*name) { + values[name-argnames] = value; + continue; + } + name = first_kw_arg; + #if PY_MAJOR_VERSION < 3 + if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) { + while (*name) { + if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) + && _PyString_Eq(**name, key)) { + values[name-argnames] = value; + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + if ((**argname == key) || ( + (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) + && _PyString_Eq(**argname, key))) { + goto arg_passed_twice; + } + argname++; + } + } + } else + #endif + if (likely(PyUnicode_Check(key))) { + while (*name) { + int cmp = (**name == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 : + #endif + PyUnicode_Compare(**name, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) { + values[name-argnames] = value; + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + int cmp = (**argname == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 : + #endif + PyUnicode_Compare(**argname, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) goto arg_passed_twice; + argname++; + } + } + } else + goto invalid_keyword_type; + if (kwds2) { + if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; + } else { + goto invalid_keyword; + } + } + return 0; +arg_passed_twice: + __Pyx_RaiseDoubleKeywordsError(function_name, key); + goto bad; +invalid_keyword_type: + PyErr_Format(PyExc_TypeError, + "%.200s() keywords must be strings", function_name); + goto bad; +invalid_keyword: + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION < 3 + "%.200s() got an unexpected keyword argument '%.200s'", + function_name, PyString_AsString(key)); + #else + "%s() got an unexpected keyword argument '%U'", + function_name, key); + #endif +bad: + return -1; +} + +/* RaiseArgTupleInvalid */ +static void __Pyx_RaiseArgtupleInvalid( + const char* func_name, + int exact, + Py_ssize_t num_min, + Py_ssize_t num_max, + Py_ssize_t num_found) +{ + Py_ssize_t num_expected; + const char *more_or_less; + if (num_found < num_min) { + num_expected = num_min; + more_or_less = "at least"; + } else { + num_expected = num_max; + more_or_less = "at most"; + } + if (exact) { + more_or_less = "exactly"; + } + PyErr_Format(PyExc_TypeError, + "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", + func_name, more_or_less, num_expected, + (num_expected == 1) ? "" : "s", num_found); +} + +/* PyCFunctionFastCall */ +#if CYTHON_FAST_PYCCALL +static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) { + PyCFunctionObject *func = (PyCFunctionObject*)func_obj; + PyCFunction meth = PyCFunction_GET_FUNCTION(func); + PyObject *self = PyCFunction_GET_SELF(func); + int flags = PyCFunction_GET_FLAGS(func); + assert(PyCFunction_Check(func)); + assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS))); + assert(nargs >= 0); + assert(nargs == 0 || args != NULL); + /* _PyCFunction_FastCallDict() must not be called with an exception set, + because it may clear it (directly or indirectly) and so the + caller loses its exception */ + assert(!PyErr_Occurred()); + if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) { + return (*((__Pyx_PyCFunctionFastWithKeywords)(void*)meth)) (self, args, nargs, NULL); + } else { + return (*((__Pyx_PyCFunctionFast)(void*)meth)) (self, args, nargs); + } +} +#endif + +/* PyFunctionFastCall */ +#if CYTHON_FAST_PYCALL +static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, + PyObject *globals) { + PyFrameObject *f; + PyThreadState *tstate = __Pyx_PyThreadState_Current; + PyObject **fastlocals; + Py_ssize_t i; + PyObject *result; + assert(globals != NULL); + /* XXX Perhaps we should create a specialized + PyFrame_New() that doesn't take locals, but does + take builtins without sanity checking them. + */ + assert(tstate != NULL); + f = PyFrame_New(tstate, co, globals, NULL); + if (f == NULL) { + return NULL; + } + fastlocals = __Pyx_PyFrame_GetLocalsplus(f); + for (i = 0; i < na; i++) { + Py_INCREF(*args); + fastlocals[i] = *args++; + } + result = PyEval_EvalFrameEx(f,0); + ++tstate->recursion_depth; + Py_DECREF(f); + --tstate->recursion_depth; + return result; +} +#if 1 || PY_VERSION_HEX < 0x030600B1 +static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs) { + PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); + PyObject *globals = PyFunction_GET_GLOBALS(func); + PyObject *argdefs = PyFunction_GET_DEFAULTS(func); + PyObject *closure; +#if PY_MAJOR_VERSION >= 3 + PyObject *kwdefs; +#endif + PyObject *kwtuple, **k; + PyObject **d; + Py_ssize_t nd; + Py_ssize_t nk; + PyObject *result; + assert(kwargs == NULL || PyDict_Check(kwargs)); + nk = kwargs ? PyDict_Size(kwargs) : 0; + if (Py_EnterRecursiveCall((char*)" while calling a Python object")) { + return NULL; + } + if ( +#if PY_MAJOR_VERSION >= 3 + co->co_kwonlyargcount == 0 && +#endif + likely(kwargs == NULL || nk == 0) && + co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { + if (argdefs == NULL && co->co_argcount == nargs) { + result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); + goto done; + } + else if (nargs == 0 && argdefs != NULL + && co->co_argcount == Py_SIZE(argdefs)) { + /* function called with no arguments, but all parameters have + a default value: use default values as arguments .*/ + args = &PyTuple_GET_ITEM(argdefs, 0); + result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); + goto done; + } + } + if (kwargs != NULL) { + Py_ssize_t pos, i; + kwtuple = PyTuple_New(2 * nk); + if (kwtuple == NULL) { + result = NULL; + goto done; + } + k = &PyTuple_GET_ITEM(kwtuple, 0); + pos = i = 0; + while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { + Py_INCREF(k[i]); + Py_INCREF(k[i+1]); + i += 2; + } + nk = i / 2; + } + else { + kwtuple = NULL; + k = NULL; + } + closure = PyFunction_GET_CLOSURE(func); +#if PY_MAJOR_VERSION >= 3 + kwdefs = PyFunction_GET_KW_DEFAULTS(func); +#endif + if (argdefs != NULL) { + d = &PyTuple_GET_ITEM(argdefs, 0); + nd = Py_SIZE(argdefs); + } + else { + d = NULL; + nd = 0; + } +#if PY_MAJOR_VERSION >= 3 + result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, + args, nargs, + k, (int)nk, + d, (int)nd, kwdefs, closure); +#else + result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, + args, nargs, + k, (int)nk, + d, (int)nd, closure); +#endif + Py_XDECREF(kwtuple); +done: + Py_LeaveRecursiveCall(); + return result; +} +#endif +#endif + +/* PyObjectCall */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { + PyObject *result; + ternaryfunc call = func->ob_type->tp_call; + if (unlikely(!call)) + return PyObject_Call(func, arg, kw); + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; + result = (*call)(func, arg, kw); + Py_LeaveRecursiveCall(); + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +/* PyObjectCallMethO */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { + PyObject *self, *result; + PyCFunction cfunc; + cfunc = PyCFunction_GET_FUNCTION(func); + self = PyCFunction_GET_SELF(func); + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; + result = cfunc(self, arg); + Py_LeaveRecursiveCall(); + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +/* PyObjectCallOneArg */ +#if CYTHON_COMPILING_IN_CPYTHON +static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) { + PyObject *result; + PyObject *args = PyTuple_New(1); + if (unlikely(!args)) return NULL; + Py_INCREF(arg); + PyTuple_SET_ITEM(args, 0, arg); + result = __Pyx_PyObject_Call(func, args, NULL); + Py_DECREF(args); + return result; +} +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { +#if CYTHON_FAST_PYCALL + if (PyFunction_Check(func)) { + return __Pyx_PyFunction_FastCall(func, &arg, 1); + } +#endif + if (likely(PyCFunction_Check(func))) { + if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) { + return __Pyx_PyObject_CallMethO(func, arg); +#if CYTHON_FAST_PYCCALL + } else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) { + return __Pyx_PyCFunction_FastCall(func, &arg, 1); +#endif + } + } + return __Pyx__PyObject_CallOneArg(func, arg); +} +#else +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { + PyObject *result; + PyObject *args = PyTuple_Pack(1, arg); + if (unlikely(!args)) return NULL; + result = __Pyx_PyObject_Call(func, args, NULL); + Py_DECREF(args); + return result; +} +#endif + +/* PyErrFetchRestore */ +#if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + tmp_type = tstate->curexc_type; + tmp_value = tstate->curexc_value; + tmp_tb = tstate->curexc_traceback; + tstate->curexc_type = type; + tstate->curexc_value = value; + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +} +static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { + *type = tstate->curexc_type; + *value = tstate->curexc_value; + *tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +} +#endif + +/* RaiseException */ +#if PY_MAJOR_VERSION < 3 +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, + CYTHON_UNUSED PyObject *cause) { + __Pyx_PyThreadState_declare + Py_XINCREF(type); + if (!value || value == Py_None) + value = NULL; + else + Py_INCREF(value); + if (!tb || tb == Py_None) + tb = NULL; + else { + Py_INCREF(tb); + if (!PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto raise_error; + } + } + if (PyType_Check(type)) { +#if CYTHON_COMPILING_IN_PYPY + if (!value) { + Py_INCREF(Py_None); + value = Py_None; + } +#endif + PyErr_NormalizeException(&type, &value, &tb); + } else { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto raise_error; + } + value = type; + type = (PyObject*) Py_TYPE(type); + Py_INCREF(type); + if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto raise_error; + } + } + __Pyx_PyThreadState_assign + __Pyx_ErrRestore(type, value, tb); + return; +raise_error: + Py_XDECREF(value); + Py_XDECREF(type); + Py_XDECREF(tb); + return; +} +#else +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { + PyObject* owned_instance = NULL; + if (tb == Py_None) { + tb = 0; + } else if (tb && !PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto bad; + } + if (value == Py_None) + value = 0; + if (PyExceptionInstance_Check(type)) { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto bad; + } + value = type; + type = (PyObject*) Py_TYPE(value); + } else if (PyExceptionClass_Check(type)) { + PyObject *instance_class = NULL; + if (value && PyExceptionInstance_Check(value)) { + instance_class = (PyObject*) Py_TYPE(value); + if (instance_class != type) { + int is_subclass = PyObject_IsSubclass(instance_class, type); + if (!is_subclass) { + instance_class = NULL; + } else if (unlikely(is_subclass == -1)) { + goto bad; + } else { + type = instance_class; + } + } + } + if (!instance_class) { + PyObject *args; + if (!value) + args = PyTuple_New(0); + else if (PyTuple_Check(value)) { + Py_INCREF(value); + args = value; + } else + args = PyTuple_Pack(1, value); + if (!args) + goto bad; + owned_instance = PyObject_Call(type, args, NULL); + Py_DECREF(args); + if (!owned_instance) + goto bad; + value = owned_instance; + if (!PyExceptionInstance_Check(value)) { + PyErr_Format(PyExc_TypeError, + "calling %R should have returned an instance of " + "BaseException, not %R", + type, Py_TYPE(value)); + goto bad; + } + } + } else { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto bad; + } + if (cause) { + PyObject *fixed_cause; + if (cause == Py_None) { + fixed_cause = NULL; + } else if (PyExceptionClass_Check(cause)) { + fixed_cause = PyObject_CallObject(cause, NULL); + if (fixed_cause == NULL) + goto bad; + } else if (PyExceptionInstance_Check(cause)) { + fixed_cause = cause; + Py_INCREF(fixed_cause); + } else { + PyErr_SetString(PyExc_TypeError, + "exception causes must derive from " + "BaseException"); + goto bad; + } + PyException_SetCause(value, fixed_cause); + } + PyErr_SetObject(type, value); + if (tb) { +#if CYTHON_COMPILING_IN_PYPY + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); + Py_INCREF(tb); + PyErr_Restore(tmp_type, tmp_value, tb); + Py_XDECREF(tmp_tb); +#else + PyThreadState *tstate = __Pyx_PyThreadState_Current; + PyObject* tmp_tb = tstate->curexc_traceback; + if (tb != tmp_tb) { + Py_INCREF(tb); + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_tb); + } +#endif + } +bad: + Py_XDECREF(owned_instance); + return; +} +#endif + +/* PyObjectCall2Args */ +static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) { + PyObject *args, *result = NULL; + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(function)) { + PyObject *args[2] = {arg1, arg2}; + return __Pyx_PyFunction_FastCall(function, args, 2); + } + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(function)) { + PyObject *args[2] = {arg1, arg2}; + return __Pyx_PyCFunction_FastCall(function, args, 2); + } + #endif + args = PyTuple_New(2); + if (unlikely(!args)) goto done; + Py_INCREF(arg1); + PyTuple_SET_ITEM(args, 0, arg1); + Py_INCREF(arg2); + PyTuple_SET_ITEM(args, 1, arg2); + Py_INCREF(function); + result = __Pyx_PyObject_Call(function, args, NULL); + Py_DECREF(args); + Py_DECREF(function); +done: + return result; +} + +/* PyErrExceptionMatches */ +#if CYTHON_FAST_THREAD_STATE +static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { + Py_ssize_t i, n; + n = PyTuple_GET_SIZE(tuple); +#if PY_MAJOR_VERSION >= 3 + for (i=0; icurexc_type; + if (exc_type == err) return 1; + if (unlikely(!exc_type)) return 0; + if (unlikely(PyTuple_Check(err))) + return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err); + return __Pyx_PyErr_GivenExceptionMatches(exc_type, err); +} +#endif + +/* GetAttr */ +static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) { +#if CYTHON_USE_TYPE_SLOTS +#if PY_MAJOR_VERSION >= 3 + if (likely(PyUnicode_Check(n))) +#else + if (likely(PyString_Check(n))) +#endif + return __Pyx_PyObject_GetAttrStr(o, n); +#endif + return PyObject_GetAttr(o, n); +} + +/* GetAttr3 */ +static PyObject *__Pyx_GetAttr3Default(PyObject *d) { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) + return NULL; + __Pyx_PyErr_Clear(); + Py_INCREF(d); + return d; +} +static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) { + PyObject *r = __Pyx_GetAttr(o, n); + return (likely(r)) ? r : __Pyx_GetAttr3Default(d); +} + +/* BytesEquals */ +static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { +#if CYTHON_COMPILING_IN_PYPY + return PyObject_RichCompareBool(s1, s2, equals); +#else + if (s1 == s2) { + return (equals == Py_EQ); + } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) { + const char *ps1, *ps2; + Py_ssize_t length = PyBytes_GET_SIZE(s1); + if (length != PyBytes_GET_SIZE(s2)) + return (equals == Py_NE); + ps1 = PyBytes_AS_STRING(s1); + ps2 = PyBytes_AS_STRING(s2); + if (ps1[0] != ps2[0]) { + return (equals == Py_NE); + } else if (length == 1) { + return (equals == Py_EQ); + } else { + int result; +#if CYTHON_USE_UNICODE_INTERNALS + Py_hash_t hash1, hash2; + hash1 = ((PyBytesObject*)s1)->ob_shash; + hash2 = ((PyBytesObject*)s2)->ob_shash; + if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { + return (equals == Py_NE); + } +#endif + result = memcmp(ps1, ps2, (size_t)length); + return (equals == Py_EQ) ? (result == 0) : (result != 0); + } + } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) { + return (equals == Py_NE); + } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) { + return (equals == Py_NE); + } else { + int result; + PyObject* py_result = PyObject_RichCompare(s1, s2, equals); + if (!py_result) + return -1; + result = __Pyx_PyObject_IsTrue(py_result); + Py_DECREF(py_result); + return result; + } +#endif +} + +/* UnicodeEquals */ +static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { +#if CYTHON_COMPILING_IN_PYPY + return PyObject_RichCompareBool(s1, s2, equals); +#else +#if PY_MAJOR_VERSION < 3 + PyObject* owned_ref = NULL; +#endif + int s1_is_unicode, s2_is_unicode; + if (s1 == s2) { + goto return_eq; + } + s1_is_unicode = PyUnicode_CheckExact(s1); + s2_is_unicode = PyUnicode_CheckExact(s2); +#if PY_MAJOR_VERSION < 3 + if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) { + owned_ref = PyUnicode_FromObject(s2); + if (unlikely(!owned_ref)) + return -1; + s2 = owned_ref; + s2_is_unicode = 1; + } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) { + owned_ref = PyUnicode_FromObject(s1); + if (unlikely(!owned_ref)) + return -1; + s1 = owned_ref; + s1_is_unicode = 1; + } else if (((!s2_is_unicode) & (!s1_is_unicode))) { + return __Pyx_PyBytes_Equals(s1, s2, equals); + } +#endif + if (s1_is_unicode & s2_is_unicode) { + Py_ssize_t length; + int kind; + void *data1, *data2; + if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0)) + return -1; + length = __Pyx_PyUnicode_GET_LENGTH(s1); + if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) { + goto return_ne; + } +#if CYTHON_USE_UNICODE_INTERNALS + { + Py_hash_t hash1, hash2; + #if CYTHON_PEP393_ENABLED + hash1 = ((PyASCIIObject*)s1)->hash; + hash2 = ((PyASCIIObject*)s2)->hash; + #else + hash1 = ((PyUnicodeObject*)s1)->hash; + hash2 = ((PyUnicodeObject*)s2)->hash; + #endif + if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { + goto return_ne; + } + } +#endif + kind = __Pyx_PyUnicode_KIND(s1); + if (kind != __Pyx_PyUnicode_KIND(s2)) { + goto return_ne; + } + data1 = __Pyx_PyUnicode_DATA(s1); + data2 = __Pyx_PyUnicode_DATA(s2); + if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) { + goto return_ne; + } else if (length == 1) { + goto return_eq; + } else { + int result = memcmp(data1, data2, (size_t)(length * kind)); + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_EQ) ? (result == 0) : (result != 0); + } + } else if ((s1 == Py_None) & s2_is_unicode) { + goto return_ne; + } else if ((s2 == Py_None) & s1_is_unicode) { + goto return_ne; + } else { + int result; + PyObject* py_result = PyObject_RichCompare(s1, s2, equals); + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + if (!py_result) + return -1; + result = __Pyx_PyObject_IsTrue(py_result); + Py_DECREF(py_result); + return result; + } +return_eq: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_EQ); +return_ne: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_NE); +#endif +} + +/* PyObjectCallNoArg */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { +#if CYTHON_FAST_PYCALL + if (PyFunction_Check(func)) { + return __Pyx_PyFunction_FastCall(func, NULL, 0); + } +#endif +#ifdef __Pyx_CyFunction_USED + if (likely(PyCFunction_Check(func) || __Pyx_CyFunction_Check(func))) +#else + if (likely(PyCFunction_Check(func))) +#endif + { + if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) { + return __Pyx_PyObject_CallMethO(func, NULL); + } + } + return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL); +} +#endif + +/* ExtTypeTest */ +static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { + if (unlikely(!type)) { + PyErr_SetString(PyExc_SystemError, "Missing type object"); + return 0; + } + if (likely(__Pyx_TypeCheck(obj, type))) + return 1; + PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s", + Py_TYPE(obj)->tp_name, type->tp_name); + return 0; +} + +/* GetItemInt */ +static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { + PyObject *r; + if (!j) return NULL; + r = PyObject_GetItem(o, j); + Py_DECREF(j); + return r; +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, + CYTHON_NCP_UNUSED int wraparound, + CYTHON_NCP_UNUSED int boundscheck) { +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + Py_ssize_t wrapped_i = i; + if (wraparound & unlikely(i < 0)) { + wrapped_i += PyList_GET_SIZE(o); + } + if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) { + PyObject *r = PyList_GET_ITEM(o, wrapped_i); + Py_INCREF(r); + return r; + } + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +#else + return PySequence_GetItem(o, i); +#endif +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, + CYTHON_NCP_UNUSED int wraparound, + CYTHON_NCP_UNUSED int boundscheck) { +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + Py_ssize_t wrapped_i = i; + if (wraparound & unlikely(i < 0)) { + wrapped_i += PyTuple_GET_SIZE(o); + } + if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) { + PyObject *r = PyTuple_GET_ITEM(o, wrapped_i); + Py_INCREF(r); + return r; + } + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +#else + return PySequence_GetItem(o, i); +#endif +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, + CYTHON_NCP_UNUSED int wraparound, + CYTHON_NCP_UNUSED int boundscheck) { +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS + if (is_list || PyList_CheckExact(o)) { + Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); + if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) { + PyObject *r = PyList_GET_ITEM(o, n); + Py_INCREF(r); + return r; + } + } + else if (PyTuple_CheckExact(o)) { + Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o); + if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) { + PyObject *r = PyTuple_GET_ITEM(o, n); + Py_INCREF(r); + return r; + } + } else { + PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence; + if (likely(m && m->sq_item)) { + if (wraparound && unlikely(i < 0) && likely(m->sq_length)) { + Py_ssize_t l = m->sq_length(o); + if (likely(l >= 0)) { + i += l; + } else { + if (!PyErr_ExceptionMatches(PyExc_OverflowError)) + return NULL; + PyErr_Clear(); + } + } + return m->sq_item(o, i); + } + } +#else + if (is_list || PySequence_Check(o)) { + return PySequence_GetItem(o, i); + } +#endif + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +} + +/* GetTopmostException */ +#if CYTHON_USE_EXC_INFO_STACK +static _PyErr_StackItem * +__Pyx_PyErr_GetTopmostException(PyThreadState *tstate) +{ + _PyErr_StackItem *exc_info = tstate->exc_info; + while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) && + exc_info->previous_item != NULL) + { + exc_info = exc_info->previous_item; + } + return exc_info; +} +#endif + +/* SaveResetException */ +#if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { + #if CYTHON_USE_EXC_INFO_STACK + _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate); + *type = exc_info->exc_type; + *value = exc_info->exc_value; + *tb = exc_info->exc_traceback; + #else + *type = tstate->exc_type; + *value = tstate->exc_value; + *tb = tstate->exc_traceback; + #endif + Py_XINCREF(*type); + Py_XINCREF(*value); + Py_XINCREF(*tb); +} +static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + #if CYTHON_USE_EXC_INFO_STACK + _PyErr_StackItem *exc_info = tstate->exc_info; + tmp_type = exc_info->exc_type; + tmp_value = exc_info->exc_value; + tmp_tb = exc_info->exc_traceback; + exc_info->exc_type = type; + exc_info->exc_value = value; + exc_info->exc_traceback = tb; + #else + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = type; + tstate->exc_value = value; + tstate->exc_traceback = tb; + #endif + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +} +#endif + +/* GetException */ +#if CYTHON_FAST_THREAD_STATE +static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) +#else +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) +#endif +{ + PyObject *local_type, *local_value, *local_tb; +#if CYTHON_FAST_THREAD_STATE + PyObject *tmp_type, *tmp_value, *tmp_tb; + local_type = tstate->curexc_type; + local_value = tstate->curexc_value; + local_tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +#else + PyErr_Fetch(&local_type, &local_value, &local_tb); +#endif + PyErr_NormalizeException(&local_type, &local_value, &local_tb); +#if CYTHON_FAST_THREAD_STATE + if (unlikely(tstate->curexc_type)) +#else + if (unlikely(PyErr_Occurred())) +#endif + goto bad; + #if PY_MAJOR_VERSION >= 3 + if (local_tb) { + if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) + goto bad; + } + #endif + Py_XINCREF(local_tb); + Py_XINCREF(local_type); + Py_XINCREF(local_value); + *type = local_type; + *value = local_value; + *tb = local_tb; +#if CYTHON_FAST_THREAD_STATE + #if CYTHON_USE_EXC_INFO_STACK + { + _PyErr_StackItem *exc_info = tstate->exc_info; + tmp_type = exc_info->exc_type; + tmp_value = exc_info->exc_value; + tmp_tb = exc_info->exc_traceback; + exc_info->exc_type = local_type; + exc_info->exc_value = local_value; + exc_info->exc_traceback = local_tb; + } + #else + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = local_type; + tstate->exc_value = local_value; + tstate->exc_traceback = local_tb; + #endif + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#else + PyErr_SetExcInfo(local_type, local_value, local_tb); +#endif + return 0; +bad: + *type = 0; + *value = 0; + *tb = 0; + Py_XDECREF(local_type); + Py_XDECREF(local_value); + Py_XDECREF(local_tb); + return -1; +} + +/* PyObjectSetAttrStr */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) { + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_setattro)) + return tp->tp_setattro(obj, attr_name, value); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_setattr)) + return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value); +#endif + return PyObject_SetAttr(obj, attr_name, value); +} +#endif + +/* WriteUnraisableException */ +static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno, + CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename, + int full_traceback, CYTHON_UNUSED int nogil) { + PyObject *old_exc, *old_val, *old_tb; + PyObject *ctx; + __Pyx_PyThreadState_declare +#ifdef WITH_THREAD + PyGILState_STATE state; + if (nogil) + state = PyGILState_Ensure(); +#ifdef _MSC_VER + else state = (PyGILState_STATE)-1; +#endif +#endif + __Pyx_PyThreadState_assign + __Pyx_ErrFetch(&old_exc, &old_val, &old_tb); + if (full_traceback) { + Py_XINCREF(old_exc); + Py_XINCREF(old_val); + Py_XINCREF(old_tb); + __Pyx_ErrRestore(old_exc, old_val, old_tb); + PyErr_PrintEx(1); + } + #if PY_MAJOR_VERSION < 3 + ctx = PyString_FromString(name); + #else + ctx = PyUnicode_FromString(name); + #endif + __Pyx_ErrRestore(old_exc, old_val, old_tb); + if (!ctx) { + PyErr_WriteUnraisable(Py_None); + } else { + PyErr_WriteUnraisable(ctx); + Py_DECREF(ctx); + } +#ifdef WITH_THREAD + if (nogil) + PyGILState_Release(state); +#endif +} + +/* IterFinish */ +static CYTHON_INLINE int __Pyx_IterFinish(void) { +#if CYTHON_FAST_THREAD_STATE + PyThreadState *tstate = __Pyx_PyThreadState_Current; + PyObject* exc_type = tstate->curexc_type; + if (unlikely(exc_type)) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) { + PyObject *exc_value, *exc_tb; + exc_value = tstate->curexc_value; + exc_tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; + Py_DECREF(exc_type); + Py_XDECREF(exc_value); + Py_XDECREF(exc_tb); + return 0; + } else { + return -1; + } + } + return 0; +#else + if (unlikely(PyErr_Occurred())) { + if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) { + PyErr_Clear(); + return 0; + } else { + return -1; + } + } + return 0; +#endif +} + +/* PyObjectGetMethod */ +static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method) { + PyObject *attr; +#if CYTHON_UNPACK_METHODS && CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_PYTYPE_LOOKUP + PyTypeObject *tp = Py_TYPE(obj); + PyObject *descr; + descrgetfunc f = NULL; + PyObject **dictptr, *dict; + int meth_found = 0; + assert (*method == NULL); + if (unlikely(tp->tp_getattro != PyObject_GenericGetAttr)) { + attr = __Pyx_PyObject_GetAttrStr(obj, name); + goto try_unpack; + } + if (unlikely(tp->tp_dict == NULL) && unlikely(PyType_Ready(tp) < 0)) { + return 0; + } + descr = _PyType_Lookup(tp, name); + if (likely(descr != NULL)) { + Py_INCREF(descr); +#if PY_MAJOR_VERSION >= 3 + #ifdef __Pyx_CyFunction_USED + if (likely(PyFunction_Check(descr) || (Py_TYPE(descr) == &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr))) + #else + if (likely(PyFunction_Check(descr) || (Py_TYPE(descr) == &PyMethodDescr_Type))) + #endif +#else + #ifdef __Pyx_CyFunction_USED + if (likely(PyFunction_Check(descr) || __Pyx_CyFunction_Check(descr))) + #else + if (likely(PyFunction_Check(descr))) + #endif +#endif + { + meth_found = 1; + } else { + f = Py_TYPE(descr)->tp_descr_get; + if (f != NULL && PyDescr_IsData(descr)) { + attr = f(descr, obj, (PyObject *)Py_TYPE(obj)); + Py_DECREF(descr); + goto try_unpack; + } + } + } + dictptr = _PyObject_GetDictPtr(obj); + if (dictptr != NULL && (dict = *dictptr) != NULL) { + Py_INCREF(dict); + attr = __Pyx_PyDict_GetItemStr(dict, name); + if (attr != NULL) { + Py_INCREF(attr); + Py_DECREF(dict); + Py_XDECREF(descr); + goto try_unpack; + } + Py_DECREF(dict); + } + if (meth_found) { + *method = descr; + return 1; + } + if (f != NULL) { + attr = f(descr, obj, (PyObject *)Py_TYPE(obj)); + Py_DECREF(descr); + goto try_unpack; + } + if (descr != NULL) { + *method = descr; + return 0; + } + PyErr_Format(PyExc_AttributeError, +#if PY_MAJOR_VERSION >= 3 + "'%.50s' object has no attribute '%U'", + tp->tp_name, name); +#else + "'%.50s' object has no attribute '%.400s'", + tp->tp_name, PyString_AS_STRING(name)); +#endif + return 0; +#else + attr = __Pyx_PyObject_GetAttrStr(obj, name); + goto try_unpack; +#endif +try_unpack: +#if CYTHON_UNPACK_METHODS + if (likely(attr) && PyMethod_Check(attr) && likely(PyMethod_GET_SELF(attr) == obj)) { + PyObject *function = PyMethod_GET_FUNCTION(attr); + Py_INCREF(function); + Py_DECREF(attr); + *method = function; + return 1; + } +#endif + *method = attr; + return 0; +} + +/* PyObjectCallMethod0 */ +static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) { + PyObject *method = NULL, *result = NULL; + int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method); + if (likely(is_method)) { + result = __Pyx_PyObject_CallOneArg(method, obj); + Py_DECREF(method); + return result; + } + if (unlikely(!method)) goto bad; + result = __Pyx_PyObject_CallNoArg(method); + Py_DECREF(method); +bad: + return result; +} + +/* RaiseNeedMoreValuesToUnpack */ +static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { + PyErr_Format(PyExc_ValueError, + "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack", + index, (index == 1) ? "" : "s"); +} + +/* RaiseTooManyValuesToUnpack */ +static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { + PyErr_Format(PyExc_ValueError, + "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected); +} + +/* UnpackItemEndCheck */ +static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { + if (unlikely(retval)) { + Py_DECREF(retval); + __Pyx_RaiseTooManyValuesError(expected); + return -1; + } else { + return __Pyx_IterFinish(); + } + return 0; +} + +/* RaiseNoneIterError */ +static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); +} + +/* UnpackTupleError */ +static void __Pyx_UnpackTupleError(PyObject *t, Py_ssize_t index) { + if (t == Py_None) { + __Pyx_RaiseNoneNotIterableError(); + } else if (PyTuple_GET_SIZE(t) < index) { + __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(t)); + } else { + __Pyx_RaiseTooManyValuesError(index); + } +} + +/* UnpackTuple2 */ +static CYTHON_INLINE int __Pyx_unpack_tuple2_exact( + PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2, int decref_tuple) { + PyObject *value1 = NULL, *value2 = NULL; +#if CYTHON_COMPILING_IN_PYPY + value1 = PySequence_ITEM(tuple, 0); if (unlikely(!value1)) goto bad; + value2 = PySequence_ITEM(tuple, 1); if (unlikely(!value2)) goto bad; +#else + value1 = PyTuple_GET_ITEM(tuple, 0); Py_INCREF(value1); + value2 = PyTuple_GET_ITEM(tuple, 1); Py_INCREF(value2); +#endif + if (decref_tuple) { + Py_DECREF(tuple); + } + *pvalue1 = value1; + *pvalue2 = value2; + return 0; +#if CYTHON_COMPILING_IN_PYPY +bad: + Py_XDECREF(value1); + Py_XDECREF(value2); + if (decref_tuple) { Py_XDECREF(tuple); } + return -1; +#endif +} +static int __Pyx_unpack_tuple2_generic(PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2, + int has_known_size, int decref_tuple) { + Py_ssize_t index; + PyObject *value1 = NULL, *value2 = NULL, *iter = NULL; + iternextfunc iternext; + iter = PyObject_GetIter(tuple); + if (unlikely(!iter)) goto bad; + if (decref_tuple) { Py_DECREF(tuple); tuple = NULL; } + iternext = Py_TYPE(iter)->tp_iternext; + value1 = iternext(iter); if (unlikely(!value1)) { index = 0; goto unpacking_failed; } + value2 = iternext(iter); if (unlikely(!value2)) { index = 1; goto unpacking_failed; } + if (!has_known_size && unlikely(__Pyx_IternextUnpackEndCheck(iternext(iter), 2))) goto bad; + Py_DECREF(iter); + *pvalue1 = value1; + *pvalue2 = value2; + return 0; +unpacking_failed: + if (!has_known_size && __Pyx_IterFinish() == 0) + __Pyx_RaiseNeedMoreValuesError(index); +bad: + Py_XDECREF(iter); + Py_XDECREF(value1); + Py_XDECREF(value2); + if (decref_tuple) { Py_XDECREF(tuple); } + return -1; +} + +/* dict_iter */ +static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* iterable, int is_dict, PyObject* method_name, + Py_ssize_t* p_orig_length, int* p_source_is_dict) { + is_dict = is_dict || likely(PyDict_CheckExact(iterable)); + *p_source_is_dict = is_dict; + if (is_dict) { +#if !CYTHON_COMPILING_IN_PYPY + *p_orig_length = PyDict_Size(iterable); + Py_INCREF(iterable); + return iterable; +#elif PY_MAJOR_VERSION >= 3 + static PyObject *py_items = NULL, *py_keys = NULL, *py_values = NULL; + PyObject **pp = NULL; + if (method_name) { + const char *name = PyUnicode_AsUTF8(method_name); + if (strcmp(name, "iteritems") == 0) pp = &py_items; + else if (strcmp(name, "iterkeys") == 0) pp = &py_keys; + else if (strcmp(name, "itervalues") == 0) pp = &py_values; + if (pp) { + if (!*pp) { + *pp = PyUnicode_FromString(name + 4); + if (!*pp) + return NULL; + } + method_name = *pp; + } + } +#endif + } + *p_orig_length = 0; + if (method_name) { + PyObject* iter; + iterable = __Pyx_PyObject_CallMethod0(iterable, method_name); + if (!iterable) + return NULL; +#if !CYTHON_COMPILING_IN_PYPY + if (PyTuple_CheckExact(iterable) || PyList_CheckExact(iterable)) + return iterable; +#endif + iter = PyObject_GetIter(iterable); + Py_DECREF(iterable); + return iter; + } + return PyObject_GetIter(iterable); +} +static CYTHON_INLINE int __Pyx_dict_iter_next( + PyObject* iter_obj, CYTHON_NCP_UNUSED Py_ssize_t orig_length, CYTHON_NCP_UNUSED Py_ssize_t* ppos, + PyObject** pkey, PyObject** pvalue, PyObject** pitem, int source_is_dict) { + PyObject* next_item; +#if !CYTHON_COMPILING_IN_PYPY + if (source_is_dict) { + PyObject *key, *value; + if (unlikely(orig_length != PyDict_Size(iter_obj))) { + PyErr_SetString(PyExc_RuntimeError, "dictionary changed size during iteration"); + return -1; + } + if (unlikely(!PyDict_Next(iter_obj, ppos, &key, &value))) { + return 0; + } + if (pitem) { + PyObject* tuple = PyTuple_New(2); + if (unlikely(!tuple)) { + return -1; + } + Py_INCREF(key); + Py_INCREF(value); + PyTuple_SET_ITEM(tuple, 0, key); + PyTuple_SET_ITEM(tuple, 1, value); + *pitem = tuple; + } else { + if (pkey) { + Py_INCREF(key); + *pkey = key; + } + if (pvalue) { + Py_INCREF(value); + *pvalue = value; + } + } + return 1; + } else if (PyTuple_CheckExact(iter_obj)) { + Py_ssize_t pos = *ppos; + if (unlikely(pos >= PyTuple_GET_SIZE(iter_obj))) return 0; + *ppos = pos + 1; + next_item = PyTuple_GET_ITEM(iter_obj, pos); + Py_INCREF(next_item); + } else if (PyList_CheckExact(iter_obj)) { + Py_ssize_t pos = *ppos; + if (unlikely(pos >= PyList_GET_SIZE(iter_obj))) return 0; + *ppos = pos + 1; + next_item = PyList_GET_ITEM(iter_obj, pos); + Py_INCREF(next_item); + } else +#endif + { + next_item = PyIter_Next(iter_obj); + if (unlikely(!next_item)) { + return __Pyx_IterFinish(); + } + } + if (pitem) { + *pitem = next_item; + } else if (pkey && pvalue) { + if (__Pyx_unpack_tuple2(next_item, pkey, pvalue, source_is_dict, source_is_dict, 1)) + return -1; + } else if (pkey) { + *pkey = next_item; + } else { + *pvalue = next_item; + } + return 1; +} + +/* StringJoin */ +#if !CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values) { + return PyObject_CallMethodObjArgs(sep, __pyx_n_s_join, values, NULL); +} +#endif + +/* KeywordStringCheck */ +static int __Pyx_CheckKeywordStrings( + PyObject *kwdict, + const char* function_name, + int kw_allowed) +{ + PyObject* key = 0; + Py_ssize_t pos = 0; +#if CYTHON_COMPILING_IN_PYPY + if (!kw_allowed && PyDict_Next(kwdict, &pos, &key, 0)) + goto invalid_keyword; + return 1; +#else + while (PyDict_Next(kwdict, &pos, &key, 0)) { + #if PY_MAJOR_VERSION < 3 + if (unlikely(!PyString_Check(key))) + #endif + if (unlikely(!PyUnicode_Check(key))) + goto invalid_keyword_type; + } + if ((!kw_allowed) && unlikely(key)) + goto invalid_keyword; + return 1; +invalid_keyword_type: + PyErr_Format(PyExc_TypeError, + "%.200s() keywords must be strings", function_name); + return 0; +#endif +invalid_keyword: + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION < 3 + "%.200s() got an unexpected keyword argument '%.200s'", + function_name, PyString_AsString(key)); + #else + "%s() got an unexpected keyword argument '%U'", + function_name, key); + #endif + return 0; +} + +/* SwapException */ +#if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + #if CYTHON_USE_EXC_INFO_STACK + _PyErr_StackItem *exc_info = tstate->exc_info; + tmp_type = exc_info->exc_type; + tmp_value = exc_info->exc_value; + tmp_tb = exc_info->exc_traceback; + exc_info->exc_type = *type; + exc_info->exc_value = *value; + exc_info->exc_traceback = *tb; + #else + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = *type; + tstate->exc_value = *value; + tstate->exc_traceback = *tb; + #endif + *type = tmp_type; + *value = tmp_value; + *tb = tmp_tb; +} +#else +static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb); + PyErr_SetExcInfo(*type, *value, *tb); + *type = tmp_type; + *value = tmp_value; + *tb = tmp_tb; +} +#endif + +/* pyfrozenset_new */ +static CYTHON_INLINE PyObject* __Pyx_PyFrozenSet_New(PyObject* it) { + if (it) { + PyObject* result; +#if CYTHON_COMPILING_IN_PYPY + PyObject* args; + args = PyTuple_Pack(1, it); + if (unlikely(!args)) + return NULL; + result = PyObject_Call((PyObject*)&PyFrozenSet_Type, args, NULL); + Py_DECREF(args); + return result; +#else + if (PyFrozenSet_CheckExact(it)) { + Py_INCREF(it); + return it; + } + result = PyFrozenSet_New(it); + if (unlikely(!result)) + return NULL; + if (likely(PySet_GET_SIZE(result))) + return result; + Py_DECREF(result); +#endif + } +#if CYTHON_USE_TYPE_SLOTS + return PyFrozenSet_Type.tp_new(&PyFrozenSet_Type, __pyx_empty_tuple, NULL); +#else + return PyObject_Call((PyObject*)&PyFrozenSet_Type, __pyx_empty_tuple, NULL); +#endif +} + +/* py_set_discard_unhashable */ +static int __Pyx_PySet_DiscardUnhashable(PyObject *set, PyObject *key) { + PyObject *tmpkey; + int rv; + if (likely(!PySet_Check(key) || !PyErr_ExceptionMatches(PyExc_TypeError))) + return -1; + PyErr_Clear(); + tmpkey = __Pyx_PyFrozenSet_New(key); + if (tmpkey == NULL) + return -1; + rv = PySet_Discard(set, tmpkey); + Py_DECREF(tmpkey); + return rv; +} + +/* py_set_discard */ +static CYTHON_INLINE int __Pyx_PySet_Discard(PyObject *set, PyObject *key) { + int found = PySet_Discard(set, key); + if (unlikely(found < 0)) { + found = __Pyx_PySet_DiscardUnhashable(set, key); + } + return found; +} + +/* GetModuleGlobalName */ +#if CYTHON_USE_DICT_VERSIONS +static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value) +#else +static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) +#endif +{ + PyObject *result; +#if !CYTHON_AVOID_BORROWED_REFS +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 + result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } else if (unlikely(PyErr_Occurred())) { + return NULL; + } +#else + result = PyDict_GetItem(__pyx_d, name); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } +#endif +#else + result = PyObject_GetItem(__pyx_d, name); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } + PyErr_Clear(); +#endif + return __Pyx_GetBuiltinName(name); +} + +/* None */ +static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) { + PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname); +} + +/* SliceObject */ +static CYTHON_INLINE int __Pyx_PyObject_SetSlice(PyObject* obj, PyObject* value, + Py_ssize_t cstart, Py_ssize_t cstop, + PyObject** _py_start, PyObject** _py_stop, PyObject** _py_slice, + int has_cstart, int has_cstop, CYTHON_UNUSED int wraparound) { +#if CYTHON_USE_TYPE_SLOTS + PyMappingMethods* mp; +#if PY_MAJOR_VERSION < 3 + PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence; + if (likely(ms && ms->sq_ass_slice)) { + if (!has_cstart) { + if (_py_start && (*_py_start != Py_None)) { + cstart = __Pyx_PyIndex_AsSsize_t(*_py_start); + if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; + } else + cstart = 0; + } + if (!has_cstop) { + if (_py_stop && (*_py_stop != Py_None)) { + cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop); + if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; + } else + cstop = PY_SSIZE_T_MAX; + } + if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) { + Py_ssize_t l = ms->sq_length(obj); + if (likely(l >= 0)) { + if (cstop < 0) { + cstop += l; + if (cstop < 0) cstop = 0; + } + if (cstart < 0) { + cstart += l; + if (cstart < 0) cstart = 0; + } + } else { + if (!PyErr_ExceptionMatches(PyExc_OverflowError)) + goto bad; + PyErr_Clear(); + } + } + return ms->sq_ass_slice(obj, cstart, cstop, value); + } +#endif + mp = Py_TYPE(obj)->tp_as_mapping; + if (likely(mp && mp->mp_ass_subscript)) +#endif + { + int result; + PyObject *py_slice, *py_start, *py_stop; + if (_py_slice) { + py_slice = *_py_slice; + } else { + PyObject* owned_start = NULL; + PyObject* owned_stop = NULL; + if (_py_start) { + py_start = *_py_start; + } else { + if (has_cstart) { + owned_start = py_start = PyInt_FromSsize_t(cstart); + if (unlikely(!py_start)) goto bad; + } else + py_start = Py_None; + } + if (_py_stop) { + py_stop = *_py_stop; + } else { + if (has_cstop) { + owned_stop = py_stop = PyInt_FromSsize_t(cstop); + if (unlikely(!py_stop)) { + Py_XDECREF(owned_start); + goto bad; + } + } else + py_stop = Py_None; + } + py_slice = PySlice_New(py_start, py_stop, Py_None); + Py_XDECREF(owned_start); + Py_XDECREF(owned_stop); + if (unlikely(!py_slice)) goto bad; + } +#if CYTHON_USE_TYPE_SLOTS + result = mp->mp_ass_subscript(obj, py_slice, value); +#else + result = value ? PyObject_SetItem(obj, py_slice, value) : PyObject_DelItem(obj, py_slice); +#endif + if (!_py_slice) { + Py_DECREF(py_slice); + } + return result; + } + PyErr_Format(PyExc_TypeError, + "'%.200s' object does not support slice %.10s", + Py_TYPE(obj)->tp_name, value ? "assignment" : "deletion"); +bad: + return -1; +} + +/* PyObjectCallMethod1 */ +static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg) { + PyObject *result = __Pyx_PyObject_CallOneArg(method, arg); + Py_DECREF(method); + return result; +} +static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) { + PyObject *method = NULL, *result; + int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method); + if (likely(is_method)) { + result = __Pyx_PyObject_Call2Args(method, obj, arg); + Py_DECREF(method); + return result; + } + if (unlikely(!method)) return NULL; + return __Pyx__PyObject_CallMethod1(method, arg); +} + +/* pop_index */ +static PyObject* __Pyx__PyObject_PopNewIndex(PyObject* L, PyObject* py_ix) { + PyObject *r; + if (unlikely(!py_ix)) return NULL; + r = __Pyx__PyObject_PopIndex(L, py_ix); + Py_DECREF(py_ix); + return r; +} +static PyObject* __Pyx__PyObject_PopIndex(PyObject* L, PyObject* py_ix) { + return __Pyx_PyObject_CallMethod1(L, __pyx_n_s_pop, py_ix); +} +#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS +static PyObject* __Pyx__PyList_PopIndex(PyObject* L, PyObject* py_ix, Py_ssize_t ix) { + Py_ssize_t size = PyList_GET_SIZE(L); + if (likely(size > (((PyListObject*)L)->allocated >> 1))) { + Py_ssize_t cix = ix; + if (cix < 0) { + cix += size; + } + if (likely(__Pyx_is_valid_index(cix, size))) { + PyObject* v = PyList_GET_ITEM(L, cix); + Py_SIZE(L) -= 1; + size -= 1; + memmove(&PyList_GET_ITEM(L, cix), &PyList_GET_ITEM(L, cix+1), (size_t)(size-cix)*sizeof(PyObject*)); + return v; + } + } + if (py_ix == Py_None) { + return __Pyx__PyObject_PopNewIndex(L, PyInt_FromSsize_t(ix)); + } else { + return __Pyx__PyObject_PopIndex(L, py_ix); + } +} +#endif + +/* HasAttr */ +static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) { + PyObject *r; + if (unlikely(!__Pyx_PyBaseString_Check(n))) { + PyErr_SetString(PyExc_TypeError, + "hasattr(): attribute name must be string"); + return -1; + } + r = __Pyx_GetAttr(o, n); + if (unlikely(!r)) { + PyErr_Clear(); + return 0; + } else { + Py_DECREF(r); + return 1; + } +} + +/* set_iter */ +static CYTHON_INLINE PyObject* __Pyx_set_iterator(PyObject* iterable, int is_set, + Py_ssize_t* p_orig_length, int* p_source_is_set) { +#if CYTHON_COMPILING_IN_CPYTHON + is_set = is_set || likely(PySet_CheckExact(iterable) || PyFrozenSet_CheckExact(iterable)); + *p_source_is_set = is_set; + if (likely(is_set)) { + *p_orig_length = PySet_Size(iterable); + Py_INCREF(iterable); + return iterable; + } +#else + (void)is_set; + *p_source_is_set = 0; +#endif + *p_orig_length = 0; + return PyObject_GetIter(iterable); +} +static CYTHON_INLINE int __Pyx_set_iter_next( + PyObject* iter_obj, Py_ssize_t orig_length, + Py_ssize_t* ppos, PyObject **value, + int source_is_set) { + if (!CYTHON_COMPILING_IN_CPYTHON || unlikely(!source_is_set)) { + *value = PyIter_Next(iter_obj); + if (unlikely(!*value)) { + return __Pyx_IterFinish(); + } + (void)orig_length; + (void)ppos; + return 1; + } +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(PySet_GET_SIZE(iter_obj) != orig_length)) { + PyErr_SetString( + PyExc_RuntimeError, + "set changed size during iteration"); + return -1; + } + { + Py_hash_t hash; + int ret = _PySet_NextEntry(iter_obj, ppos, value, &hash); + assert (ret != -1); + if (likely(ret)) { + Py_INCREF(*value); + return 1; + } + } +#endif + return 0; +} + +/* ArgTypeTest */ +static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact) +{ + if (unlikely(!type)) { + PyErr_SetString(PyExc_SystemError, "Missing type object"); + return 0; + } + else if (exact) { + #if PY_MAJOR_VERSION == 2 + if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1; + #endif + } + else { + if (likely(__Pyx_TypeCheck(obj, type))) return 1; + } + PyErr_Format(PyExc_TypeError, + "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)", + name, type->tp_name, Py_TYPE(obj)->tp_name); + return 0; +} + +/* FetchCommonType */ +static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { + PyObject* fake_module; + PyTypeObject* cached_type = NULL; + fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI); + if (!fake_module) return NULL; + Py_INCREF(fake_module); + cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name); + if (cached_type) { + if (!PyType_Check((PyObject*)cached_type)) { + PyErr_Format(PyExc_TypeError, + "Shared Cython type %.200s is not a type object", + type->tp_name); + goto bad; + } + if (cached_type->tp_basicsize != type->tp_basicsize) { + PyErr_Format(PyExc_TypeError, + "Shared Cython type %.200s has the wrong size, try recompiling", + type->tp_name); + goto bad; + } + } else { + if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; + PyErr_Clear(); + if (PyType_Ready(type) < 0) goto bad; + if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0) + goto bad; + Py_INCREF(type); + cached_type = type; + } +done: + Py_DECREF(fake_module); + return cached_type; +bad: + Py_XDECREF(cached_type); + cached_type = NULL; + goto done; +} + +/* CythonFunction */ +#include +static PyObject * +__Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure) +{ + if (unlikely(op->func_doc == NULL)) { + if (op->func.m_ml->ml_doc) { +#if PY_MAJOR_VERSION >= 3 + op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc); +#else + op->func_doc = PyString_FromString(op->func.m_ml->ml_doc); +#endif + if (unlikely(op->func_doc == NULL)) + return NULL; + } else { + Py_INCREF(Py_None); + return Py_None; + } + } + Py_INCREF(op->func_doc); + return op->func_doc; +} +static int +__Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context) +{ + PyObject *tmp = op->func_doc; + if (value == NULL) { + value = Py_None; + } + Py_INCREF(value); + op->func_doc = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + if (unlikely(op->func_name == NULL)) { +#if PY_MAJOR_VERSION >= 3 + op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name); +#else + op->func_name = PyString_InternFromString(op->func.m_ml->ml_name); +#endif + if (unlikely(op->func_name == NULL)) + return NULL; + } + Py_INCREF(op->func_name); + return op->func_name; +} +static int +__Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context) +{ + PyObject *tmp; +#if PY_MAJOR_VERSION >= 3 + if (unlikely(value == NULL || !PyUnicode_Check(value))) +#else + if (unlikely(value == NULL || !PyString_Check(value))) +#endif + { + PyErr_SetString(PyExc_TypeError, + "__name__ must be set to a string object"); + return -1; + } + tmp = op->func_name; + Py_INCREF(value); + op->func_name = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + Py_INCREF(op->func_qualname); + return op->func_qualname; +} +static int +__Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context) +{ + PyObject *tmp; +#if PY_MAJOR_VERSION >= 3 + if (unlikely(value == NULL || !PyUnicode_Check(value))) +#else + if (unlikely(value == NULL || !PyString_Check(value))) +#endif + { + PyErr_SetString(PyExc_TypeError, + "__qualname__ must be set to a string object"); + return -1; + } + tmp = op->func_qualname; + Py_INCREF(value); + op->func_qualname = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED void *closure) +{ + PyObject *self; + self = m->func_closure; + if (self == NULL) + self = Py_None; + Py_INCREF(self); + return self; +} +static PyObject * +__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + if (unlikely(op->func_dict == NULL)) { + op->func_dict = PyDict_New(); + if (unlikely(op->func_dict == NULL)) + return NULL; + } + Py_INCREF(op->func_dict); + return op->func_dict; +} +static int +__Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context) +{ + PyObject *tmp; + if (unlikely(value == NULL)) { + PyErr_SetString(PyExc_TypeError, + "function's dictionary may not be deleted"); + return -1; + } + if (unlikely(!PyDict_Check(value))) { + PyErr_SetString(PyExc_TypeError, + "setting function's dictionary to a non-dict"); + return -1; + } + tmp = op->func_dict; + Py_INCREF(value); + op->func_dict = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + Py_INCREF(op->func_globals); + return op->func_globals; +} +static PyObject * +__Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + Py_INCREF(Py_None); + return Py_None; +} +static PyObject * +__Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + PyObject* result = (op->func_code) ? op->func_code : Py_None; + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { + int result = 0; + PyObject *res = op->defaults_getter((PyObject *) op); + if (unlikely(!res)) + return -1; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + op->defaults_tuple = PyTuple_GET_ITEM(res, 0); + Py_INCREF(op->defaults_tuple); + op->defaults_kwdict = PyTuple_GET_ITEM(res, 1); + Py_INCREF(op->defaults_kwdict); + #else + op->defaults_tuple = PySequence_ITEM(res, 0); + if (unlikely(!op->defaults_tuple)) result = -1; + else { + op->defaults_kwdict = PySequence_ITEM(res, 1); + if (unlikely(!op->defaults_kwdict)) result = -1; + } + #endif + Py_DECREF(res); + return result; +} +static int +__Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) { + PyObject* tmp; + if (!value) { + value = Py_None; + } else if (value != Py_None && !PyTuple_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__defaults__ must be set to a tuple object"); + return -1; + } + Py_INCREF(value); + tmp = op->defaults_tuple; + op->defaults_tuple = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) { + PyObject* result = op->defaults_tuple; + if (unlikely(!result)) { + if (op->defaults_getter) { + if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL; + result = op->defaults_tuple; + } else { + result = Py_None; + } + } + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) { + PyObject* tmp; + if (!value) { + value = Py_None; + } else if (value != Py_None && !PyDict_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__kwdefaults__ must be set to a dict object"); + return -1; + } + Py_INCREF(value); + tmp = op->defaults_kwdict; + op->defaults_kwdict = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) { + PyObject* result = op->defaults_kwdict; + if (unlikely(!result)) { + if (op->defaults_getter) { + if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL; + result = op->defaults_kwdict; + } else { + result = Py_None; + } + } + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) { + PyObject* tmp; + if (!value || value == Py_None) { + value = NULL; + } else if (!PyDict_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__annotations__ must be set to a dict object"); + return -1; + } + Py_XINCREF(value); + tmp = op->func_annotations; + op->func_annotations = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) { + PyObject* result = op->func_annotations; + if (unlikely(!result)) { + result = PyDict_New(); + if (unlikely(!result)) return NULL; + op->func_annotations = result; + } + Py_INCREF(result); + return result; +} +static PyGetSetDef __pyx_CyFunction_getsets[] = { + {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, + {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, + {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, + {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, + {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, + {(char *) "__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0}, + {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, + {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, + {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, + {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, + {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, + {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, + {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, + {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, + {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, + {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, + {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, + {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, + {0, 0, 0, 0, 0} +}; +static PyMemberDef __pyx_CyFunction_members[] = { + {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), PY_WRITE_RESTRICTED, 0}, + {0, 0, 0, 0, 0} +}; +static PyObject * +__Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args) +{ +#if PY_MAJOR_VERSION >= 3 + return PyUnicode_FromString(m->func.m_ml->ml_name); +#else + return PyString_FromString(m->func.m_ml->ml_name); +#endif +} +static PyMethodDef __pyx_CyFunction_methods[] = { + {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, + {0, 0, 0, 0} +}; +#if PY_VERSION_HEX < 0x030500A0 +#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist) +#else +#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func.m_weakreflist) +#endif +static PyObject *__Pyx_CyFunction_New(PyTypeObject *type, PyMethodDef *ml, int flags, PyObject* qualname, + PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { + __pyx_CyFunctionObject *op = PyObject_GC_New(__pyx_CyFunctionObject, type); + if (op == NULL) + return NULL; + op->flags = flags; + __Pyx_CyFunction_weakreflist(op) = NULL; + op->func.m_ml = ml; + op->func.m_self = (PyObject *) op; + Py_XINCREF(closure); + op->func_closure = closure; + Py_XINCREF(module); + op->func.m_module = module; + op->func_dict = NULL; + op->func_name = NULL; + Py_INCREF(qualname); + op->func_qualname = qualname; + op->func_doc = NULL; + op->func_classobj = NULL; + op->func_globals = globals; + Py_INCREF(op->func_globals); + Py_XINCREF(code); + op->func_code = code; + op->defaults_pyobjects = 0; + op->defaults = NULL; + op->defaults_tuple = NULL; + op->defaults_kwdict = NULL; + op->defaults_getter = NULL; + op->func_annotations = NULL; + PyObject_GC_Track(op); + return (PyObject *) op; +} +static int +__Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) +{ + Py_CLEAR(m->func_closure); + Py_CLEAR(m->func.m_module); + Py_CLEAR(m->func_dict); + Py_CLEAR(m->func_name); + Py_CLEAR(m->func_qualname); + Py_CLEAR(m->func_doc); + Py_CLEAR(m->func_globals); + Py_CLEAR(m->func_code); + Py_CLEAR(m->func_classobj); + Py_CLEAR(m->defaults_tuple); + Py_CLEAR(m->defaults_kwdict); + Py_CLEAR(m->func_annotations); + if (m->defaults) { + PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); + int i; + for (i = 0; i < m->defaults_pyobjects; i++) + Py_XDECREF(pydefaults[i]); + PyObject_Free(m->defaults); + m->defaults = NULL; + } + return 0; +} +static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m) +{ + if (__Pyx_CyFunction_weakreflist(m) != NULL) + PyObject_ClearWeakRefs((PyObject *) m); + __Pyx_CyFunction_clear(m); + PyObject_GC_Del(m); +} +static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) +{ + PyObject_GC_UnTrack(m); + __Pyx__CyFunction_dealloc(m); +} +static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) +{ + Py_VISIT(m->func_closure); + Py_VISIT(m->func.m_module); + Py_VISIT(m->func_dict); + Py_VISIT(m->func_name); + Py_VISIT(m->func_qualname); + Py_VISIT(m->func_doc); + Py_VISIT(m->func_globals); + Py_VISIT(m->func_code); + Py_VISIT(m->func_classobj); + Py_VISIT(m->defaults_tuple); + Py_VISIT(m->defaults_kwdict); + if (m->defaults) { + PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); + int i; + for (i = 0; i < m->defaults_pyobjects; i++) + Py_VISIT(pydefaults[i]); + } + return 0; +} +static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type) +{ + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) { + Py_INCREF(func); + return func; + } + if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) { + if (type == NULL) + type = (PyObject *)(Py_TYPE(obj)); + return __Pyx_PyMethod_New(func, type, (PyObject *)(Py_TYPE(type))); + } + if (obj == Py_None) + obj = NULL; + return __Pyx_PyMethod_New(func, obj, type); +} +static PyObject* +__Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) +{ +#if PY_MAJOR_VERSION >= 3 + return PyUnicode_FromFormat("", + op->func_qualname, (void *)op); +#else + return PyString_FromFormat("", + PyString_AsString(op->func_qualname), (void *)op); +#endif +} +static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) { + PyCFunctionObject* f = (PyCFunctionObject*)func; + PyCFunction meth = f->m_ml->ml_meth; + Py_ssize_t size; + switch (f->m_ml->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) { + case METH_VARARGS: + if (likely(kw == NULL || PyDict_Size(kw) == 0)) + return (*meth)(self, arg); + break; + case METH_VARARGS | METH_KEYWORDS: + return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw); + case METH_NOARGS: + if (likely(kw == NULL || PyDict_Size(kw) == 0)) { + size = PyTuple_GET_SIZE(arg); + if (likely(size == 0)) + return (*meth)(self, NULL); + PyErr_Format(PyExc_TypeError, + "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", + f->m_ml->ml_name, size); + return NULL; + } + break; + case METH_O: + if (likely(kw == NULL || PyDict_Size(kw) == 0)) { + size = PyTuple_GET_SIZE(arg); + if (likely(size == 1)) { + PyObject *result, *arg0; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + arg0 = PyTuple_GET_ITEM(arg, 0); + #else + arg0 = PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL; + #endif + result = (*meth)(self, arg0); + #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) + Py_DECREF(arg0); + #endif + return result; + } + PyErr_Format(PyExc_TypeError, + "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", + f->m_ml->ml_name, size); + return NULL; + } + break; + default: + PyErr_SetString(PyExc_SystemError, "Bad call flags in " + "__Pyx_CyFunction_Call. METH_OLDARGS is no " + "longer supported!"); + return NULL; + } + PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", + f->m_ml->ml_name); + return NULL; +} +static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { + return __Pyx_CyFunction_CallMethod(func, ((PyCFunctionObject*)func)->m_self, arg, kw); +} +static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) { + PyObject *result; + __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func; + if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { + Py_ssize_t argc; + PyObject *new_args; + PyObject *self; + argc = PyTuple_GET_SIZE(args); + new_args = PyTuple_GetSlice(args, 1, argc); + if (unlikely(!new_args)) + return NULL; + self = PyTuple_GetItem(args, 0); + if (unlikely(!self)) { + Py_DECREF(new_args); + return NULL; + } + result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw); + Py_DECREF(new_args); + } else { + result = __Pyx_CyFunction_Call(func, args, kw); + } + return result; +} +static PyTypeObject __pyx_CyFunctionType_type = { + PyVarObject_HEAD_INIT(0, 0) + "cython_function_or_method", + sizeof(__pyx_CyFunctionObject), + 0, + (destructor) __Pyx_CyFunction_dealloc, + 0, + 0, + 0, +#if PY_MAJOR_VERSION < 3 + 0, +#else + 0, +#endif + (reprfunc) __Pyx_CyFunction_repr, + 0, + 0, + 0, + 0, + __Pyx_CyFunction_CallAsMethod, + 0, + 0, + 0, + 0, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, + 0, + (traverseproc) __Pyx_CyFunction_traverse, + (inquiry) __Pyx_CyFunction_clear, + 0, +#if PY_VERSION_HEX < 0x030500A0 + offsetof(__pyx_CyFunctionObject, func_weakreflist), +#else + offsetof(PyCFunctionObject, m_weakreflist), +#endif + 0, + 0, + __pyx_CyFunction_methods, + __pyx_CyFunction_members, + __pyx_CyFunction_getsets, + 0, + 0, + __Pyx_CyFunction_descr_get, + 0, + offsetof(__pyx_CyFunctionObject, func_dict), + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, +#if PY_VERSION_HEX >= 0x030400a1 + 0, +#endif +}; +static int __pyx_CyFunction_init(void) { + __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); + if (unlikely(__pyx_CyFunctionType == NULL)) { + return -1; + } + return 0; +} +static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults = PyObject_Malloc(size); + if (unlikely(!m->defaults)) + return PyErr_NoMemory(); + memset(m->defaults, 0, size); + m->defaults_pyobjects = pyobjects; + return m->defaults; +} +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults_tuple = tuple; + Py_INCREF(tuple); +} +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults_kwdict = dict; + Py_INCREF(dict); +} +static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->func_annotations = dict; + Py_INCREF(dict); +} + +/* PyObject_GenericGetAttrNoDict */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) { + PyErr_Format(PyExc_AttributeError, +#if PY_MAJOR_VERSION >= 3 + "'%.50s' object has no attribute '%U'", + tp->tp_name, attr_name); +#else + "'%.50s' object has no attribute '%.400s'", + tp->tp_name, PyString_AS_STRING(attr_name)); +#endif + return NULL; +} +static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) { + PyObject *descr; + PyTypeObject *tp = Py_TYPE(obj); + if (unlikely(!PyString_Check(attr_name))) { + return PyObject_GenericGetAttr(obj, attr_name); + } + assert(!tp->tp_dictoffset); + descr = _PyType_Lookup(tp, attr_name); + if (unlikely(!descr)) { + return __Pyx_RaiseGenericGetAttributeError(tp, attr_name); + } + Py_INCREF(descr); + #if PY_MAJOR_VERSION < 3 + if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS))) + #endif + { + descrgetfunc f = Py_TYPE(descr)->tp_descr_get; + if (unlikely(f)) { + PyObject *res = f(descr, obj, (PyObject *)tp); + Py_DECREF(descr); + return res; + } + } + return descr; +} +#endif + +/* PyObject_GenericGetAttr */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) { + if (unlikely(Py_TYPE(obj)->tp_dictoffset)) { + return PyObject_GenericGetAttr(obj, attr_name); + } + return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name); +} +#endif + +/* CallNextTpDealloc */ +static void __Pyx_call_next_tp_dealloc(PyObject* obj, destructor current_tp_dealloc) { + PyTypeObject* type = Py_TYPE(obj); + while (type && type->tp_dealloc != current_tp_dealloc) + type = type->tp_base; + while (type && type->tp_dealloc == current_tp_dealloc) + type = type->tp_base; + if (type) + type->tp_dealloc(obj); +} + +/* CallNextTpTraverse */ +static int __Pyx_call_next_tp_traverse(PyObject* obj, visitproc v, void *a, traverseproc current_tp_traverse) { + PyTypeObject* type = Py_TYPE(obj); + while (type && type->tp_traverse != current_tp_traverse) + type = type->tp_base; + while (type && type->tp_traverse == current_tp_traverse) + type = type->tp_base; + if (type && type->tp_traverse) + return type->tp_traverse(obj, v, a); + return 0; +} + +/* CallNextTpClear */ +static void __Pyx_call_next_tp_clear(PyObject* obj, inquiry current_tp_clear) { + PyTypeObject* type = Py_TYPE(obj); + while (type && type->tp_clear != current_tp_clear) + type = type->tp_base; + while (type && type->tp_clear == current_tp_clear) + type = type->tp_base; + if (type && type->tp_clear) + type->tp_clear(obj); +} + +/* TypeImport */ +#ifndef __PYX_HAVE_RT_ImportType +#define __PYX_HAVE_RT_ImportType +static PyTypeObject *__Pyx_ImportType(PyObject *module, const char *module_name, const char *class_name, + size_t size, enum __Pyx_ImportType_CheckSize check_size) +{ + PyObject *result = 0; + char warning[200]; + Py_ssize_t basicsize; +#ifdef Py_LIMITED_API + PyObject *py_basicsize; +#endif + result = PyObject_GetAttrString(module, class_name); + if (!result) + goto bad; + if (!PyType_Check(result)) { + PyErr_Format(PyExc_TypeError, + "%.200s.%.200s is not a type object", + module_name, class_name); + goto bad; + } +#ifndef Py_LIMITED_API + basicsize = ((PyTypeObject *)result)->tp_basicsize; +#else + py_basicsize = PyObject_GetAttrString(result, "__basicsize__"); + if (!py_basicsize) + goto bad; + basicsize = PyLong_AsSsize_t(py_basicsize); + Py_DECREF(py_basicsize); + py_basicsize = 0; + if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred()) + goto bad; +#endif + if ((size_t)basicsize < size) { + PyErr_Format(PyExc_ValueError, + "%.200s.%.200s size changed, may indicate binary incompatibility. " + "Expected %zd from C header, got %zd from PyObject", + module_name, class_name, size, basicsize); + goto bad; + } + if (check_size == __Pyx_ImportType_CheckSize_Error && (size_t)basicsize != size) { + PyErr_Format(PyExc_ValueError, + "%.200s.%.200s size changed, may indicate binary incompatibility. " + "Expected %zd from C header, got %zd from PyObject", + module_name, class_name, size, basicsize); + goto bad; + } + else if (check_size == __Pyx_ImportType_CheckSize_Warn && (size_t)basicsize > size) { + PyOS_snprintf(warning, sizeof(warning), + "%s.%s size changed, may indicate binary incompatibility. " + "Expected %zd from C header, got %zd from PyObject", + module_name, class_name, size, basicsize); + if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad; + } + return (PyTypeObject *)result; +bad: + Py_XDECREF(result); + return NULL; +} +#endif + +/* SetVTable */ +static int __Pyx_SetVtable(PyObject *dict, void *vtable) { +#if PY_VERSION_HEX >= 0x02070000 + PyObject *ob = PyCapsule_New(vtable, 0, 0); +#else + PyObject *ob = PyCObject_FromVoidPtr(vtable, 0); +#endif + if (!ob) + goto bad; + if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0) + goto bad; + Py_DECREF(ob); + return 0; +bad: + Py_XDECREF(ob); + return -1; +} + +/* GetVTable */ +static void* __Pyx_GetVtable(PyObject *dict) { + void* ptr; + PyObject *ob = PyObject_GetItem(dict, __pyx_n_s_pyx_vtable); + if (!ob) + goto bad; +#if PY_VERSION_HEX >= 0x02070000 + ptr = PyCapsule_GetPointer(ob, 0); +#else + ptr = PyCObject_AsVoidPtr(ob); +#endif + if (!ptr && !PyErr_Occurred()) + PyErr_SetString(PyExc_RuntimeError, "invalid vtable found for imported type"); + Py_DECREF(ob); + return ptr; +bad: + Py_XDECREF(ob); + return NULL; +} + +/* Import */ +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { + PyObject *empty_list = 0; + PyObject *module = 0; + PyObject *global_dict = 0; + PyObject *empty_dict = 0; + PyObject *list; + #if PY_MAJOR_VERSION < 3 + PyObject *py_import; + py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); + if (!py_import) + goto bad; + #endif + if (from_list) + list = from_list; + else { + empty_list = PyList_New(0); + if (!empty_list) + goto bad; + list = empty_list; + } + global_dict = PyModule_GetDict(__pyx_m); + if (!global_dict) + goto bad; + empty_dict = PyDict_New(); + if (!empty_dict) + goto bad; + { + #if PY_MAJOR_VERSION >= 3 + if (level == -1) { + if (strchr(__Pyx_MODULE_NAME, '.')) { + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, 1); + if (!module) { + if (!PyErr_ExceptionMatches(PyExc_ImportError)) + goto bad; + PyErr_Clear(); + } + } + level = 0; + } + #endif + if (!module) { + #if PY_MAJOR_VERSION < 3 + PyObject *py_level = PyInt_FromLong(level); + if (!py_level) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, py_level, (PyObject *)NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, level); + #endif + } + } +bad: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(py_import); + #endif + Py_XDECREF(empty_list); + Py_XDECREF(empty_dict); + return module; +} + +/* ImportFrom */ +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { + PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); + if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_Format(PyExc_ImportError, + #if PY_MAJOR_VERSION < 3 + "cannot import name %.230s", PyString_AS_STRING(name)); + #else + "cannot import name %S", name); + #endif + } + return value; +} + +/* GetNameInClass */ +static PyObject *__Pyx_GetGlobalNameAfterAttributeLookup(PyObject *name) { + PyObject *result; + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) + return NULL; + __Pyx_PyErr_Clear(); + __Pyx_GetModuleGlobalNameUncached(result, name); + return result; +} +static PyObject *__Pyx__GetNameInClass(PyObject *nmspace, PyObject *name) { + PyObject *result; + result = __Pyx_PyObject_GetAttrStr(nmspace, name); + if (!result) { + result = __Pyx_GetGlobalNameAfterAttributeLookup(name); + } + return result; +} + +/* ClassMethod */ +static PyObject* __Pyx_Method_ClassMethod(PyObject *method) { +#if CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM <= 0x05080000 + if (PyObject_TypeCheck(method, &PyWrapperDescr_Type)) { + return PyClassMethod_New(method); + } +#else +#if CYTHON_COMPILING_IN_PYSTON || CYTHON_COMPILING_IN_PYPY + if (PyMethodDescr_Check(method)) +#else + static PyTypeObject *methoddescr_type = NULL; + if (methoddescr_type == NULL) { + PyObject *meth = PyObject_GetAttrString((PyObject*)&PyList_Type, "append"); + if (!meth) return NULL; + methoddescr_type = Py_TYPE(meth); + Py_DECREF(meth); + } + if (__Pyx_TypeCheck(method, methoddescr_type)) +#endif + { + PyMethodDescrObject *descr = (PyMethodDescrObject *)method; + #if PY_VERSION_HEX < 0x03020000 + PyTypeObject *d_type = descr->d_type; + #else + PyTypeObject *d_type = descr->d_common.d_type; + #endif + return PyDescr_NewClassMethod(d_type, descr->d_method); + } +#endif + else if (PyMethod_Check(method)) { + return PyClassMethod_New(PyMethod_GET_FUNCTION(method)); + } + else if (PyCFunction_Check(method)) { + return PyClassMethod_New(method); + } +#ifdef __Pyx_CyFunction_USED + else if (__Pyx_CyFunction_Check(method)) { + return PyClassMethod_New(method); + } +#endif + PyErr_SetString(PyExc_TypeError, + "Class-level classmethod() can only be called on " + "a method_descriptor or instance method."); + return NULL; +} + +/* Globals */ +static PyObject* __Pyx_Globals(void) { + Py_ssize_t i; + PyObject *names; + PyObject *globals = __pyx_d; + Py_INCREF(globals); + names = PyObject_Dir(__pyx_m); + if (!names) + goto bad; + for (i = PyList_GET_SIZE(names)-1; i >= 0; i--) { +#if CYTHON_COMPILING_IN_PYPY + PyObject* name = PySequence_ITEM(names, i); + if (!name) + goto bad; +#else + PyObject* name = PyList_GET_ITEM(names, i); +#endif + if (!PyDict_Contains(globals, name)) { + PyObject* value = __Pyx_GetAttr(__pyx_m, name); + if (!value) { +#if CYTHON_COMPILING_IN_PYPY + Py_DECREF(name); +#endif + goto bad; + } + if (PyDict_SetItem(globals, name, value) < 0) { +#if CYTHON_COMPILING_IN_PYPY + Py_DECREF(name); +#endif + Py_DECREF(value); + goto bad; + } + } +#if CYTHON_COMPILING_IN_PYPY + Py_DECREF(name); +#endif + } + Py_DECREF(names); + return globals; +bad: + Py_XDECREF(names); + Py_XDECREF(globals); + return NULL; +} + +/* CLineInTraceback */ +#ifndef CYTHON_CLINE_IN_TRACEBACK +static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { + PyObject *use_cline; + PyObject *ptype, *pvalue, *ptraceback; +#if CYTHON_COMPILING_IN_CPYTHON + PyObject **cython_runtime_dict; +#endif + if (unlikely(!__pyx_cython_runtime)) { + return c_line; + } + __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); +#if CYTHON_COMPILING_IN_CPYTHON + cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); + if (likely(cython_runtime_dict)) { + __PYX_PY_DICT_LOOKUP_IF_MODIFIED( + use_cline, *cython_runtime_dict, + __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback)) + } else +#endif + { + PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback); + if (use_cline_obj) { + use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; + Py_DECREF(use_cline_obj); + } else { + PyErr_Clear(); + use_cline = NULL; + } + } + if (!use_cline) { + c_line = 0; + PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); + } + else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { + c_line = 0; + } + __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); + return c_line; +} +#endif + +/* CodeObjectCache */ +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { + int start = 0, mid = 0, end = count - 1; + if (end >= 0 && code_line > entries[end].code_line) { + return count; + } + while (start < end) { + mid = start + (end - start) / 2; + if (code_line < entries[mid].code_line) { + end = mid; + } else if (code_line > entries[mid].code_line) { + start = mid + 1; + } else { + return mid; + } + } + if (code_line <= entries[mid].code_line) { + return mid; + } else { + return mid + 1; + } +} +static PyCodeObject *__pyx_find_code_object(int code_line) { + PyCodeObject* code_object; + int pos; + if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { + return NULL; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { + return NULL; + } + code_object = __pyx_code_cache.entries[pos].code_object; + Py_INCREF(code_object); + return code_object; +} +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { + int pos, i; + __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; + if (unlikely(!code_line)) { + return; + } + if (unlikely(!entries)) { + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); + if (likely(entries)) { + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = 64; + __pyx_code_cache.count = 1; + entries[0].code_line = code_line; + entries[0].code_object = code_object; + Py_INCREF(code_object); + } + return; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { + PyCodeObject* tmp = entries[pos].code_object; + entries[pos].code_object = code_object; + Py_DECREF(tmp); + return; + } + if (__pyx_code_cache.count == __pyx_code_cache.max_count) { + int new_max = __pyx_code_cache.max_count + 64; + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( + __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry)); + if (unlikely(!entries)) { + return; + } + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = new_max; + } + for (i=__pyx_code_cache.count; i>pos; i--) { + entries[i] = entries[i-1]; + } + entries[pos].code_line = code_line; + entries[pos].code_object = code_object; + __pyx_code_cache.count++; + Py_INCREF(code_object); +} + +/* AddTraceback */ +#include "compile.h" +#include "frameobject.h" +#include "traceback.h" +static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( + const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyObject *py_srcfile = 0; + PyObject *py_funcname = 0; + #if PY_MAJOR_VERSION < 3 + py_srcfile = PyString_FromString(filename); + #else + py_srcfile = PyUnicode_FromString(filename); + #endif + if (!py_srcfile) goto bad; + if (c_line) { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + #else + py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + #endif + } + else { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromString(funcname); + #else + py_funcname = PyUnicode_FromString(funcname); + #endif + } + if (!py_funcname) goto bad; + py_code = __Pyx_PyCode_New( + 0, + 0, + 0, + 0, + 0, + __pyx_empty_bytes, /*PyObject *code,*/ + __pyx_empty_tuple, /*PyObject *consts,*/ + __pyx_empty_tuple, /*PyObject *names,*/ + __pyx_empty_tuple, /*PyObject *varnames,*/ + __pyx_empty_tuple, /*PyObject *freevars,*/ + __pyx_empty_tuple, /*PyObject *cellvars,*/ + py_srcfile, /*PyObject *filename,*/ + py_funcname, /*PyObject *name,*/ + py_line, + __pyx_empty_bytes /*PyObject *lnotab*/ + ); + Py_DECREF(py_srcfile); + Py_DECREF(py_funcname); + return py_code; +bad: + Py_XDECREF(py_srcfile); + Py_XDECREF(py_funcname); + return NULL; +} +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyFrameObject *py_frame = 0; + PyThreadState *tstate = __Pyx_PyThreadState_Current; + if (c_line) { + c_line = __Pyx_CLineForTraceback(tstate, c_line); + } + py_code = __pyx_find_code_object(c_line ? -c_line : py_line); + if (!py_code) { + py_code = __Pyx_CreateCodeObjectForTraceback( + funcname, c_line, py_line, filename); + if (!py_code) goto bad; + __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); + } + py_frame = PyFrame_New( + tstate, /*PyThreadState *tstate,*/ + py_code, /*PyCodeObject *code,*/ + __pyx_d, /*PyObject *globals,*/ + 0 /*PyObject *locals*/ + ); + if (!py_frame) goto bad; + __Pyx_PyFrame_SetLineNumber(py_frame, py_line); + PyTraceBack_Here(py_frame); +bad: + Py_XDECREF(py_code); + Py_XDECREF(py_frame); +} + +/* CIntFromPyVerify */ +#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ + __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) +#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ + __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) +#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ + {\ + func_type value = func_value;\ + if (sizeof(target_type) < sizeof(func_type)) {\ + if (unlikely(value != (func_type) (target_type) value)) {\ + func_type zero = 0;\ + if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ + return (target_type) -1;\ + if (is_unsigned && unlikely(value < zero))\ + goto raise_neg_overflow;\ + else\ + goto raise_overflow;\ + }\ + }\ + return (target_type) value;\ + } + +/* CIntToPy */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { + const int neg_one = (int) ((int) 0 - (int) 1), const_zero = (int) 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(int) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(int) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(int) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(int), + little, !is_unsigned); + } +} + +/* CIntToPy */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { + const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(long) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(long) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(long) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(long), + little, !is_unsigned); + } +} + +/* CIntFromPy */ +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { + const int neg_one = (int) ((int) 0 - (int) 1), const_zero = (int) 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(int) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (int) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (int) 0; + case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0]) + case 2: + if (8 * sizeof(int) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) { + return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + case 3: + if (8 * sizeof(int) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) { + return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + case 4: + if (8 * sizeof(int) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) { + return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (int) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if (sizeof(int) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (int) 0; + case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0])) + case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0]) + case -2: + if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { + return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 2: + if (8 * sizeof(int) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { + return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case -3: + if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { + return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 3: + if (8 * sizeof(int) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { + return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case -4: + if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { + return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 4: + if (8 * sizeof(int) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { + return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + } +#endif + if (sizeof(int) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + int val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (int) -1; + } + } else { + int val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (int) -1; + val = __Pyx_PyInt_As_int(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to int"); + return (int) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to int"); + return (int) -1; +} + +/* CIntFromPy */ +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { + const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(long) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (long) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (long) 0; + case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0]) + case 2: + if (8 * sizeof(long) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) { + return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + case 3: + if (8 * sizeof(long) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) { + return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + case 4: + if (8 * sizeof(long) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) { + return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (long) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if (sizeof(long) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (long) 0; + case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0])) + case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0]) + case -2: + if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 2: + if (8 * sizeof(long) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case -3: + if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 3: + if (8 * sizeof(long) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case -4: + if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 4: + if (8 * sizeof(long) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + } +#endif + if (sizeof(long) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + long val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (long) -1; + } + } else { + long val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (long) -1; + val = __Pyx_PyInt_As_long(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to long"); + return (long) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to long"); + return (long) -1; +} + +/* FastTypeChecks */ +#if CYTHON_COMPILING_IN_CPYTHON +static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) { + while (a) { + a = a->tp_base; + if (a == b) + return 1; + } + return b == &PyBaseObject_Type; +} +static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) { + PyObject *mro; + if (a == b) return 1; + mro = a->tp_mro; + if (likely(mro)) { + Py_ssize_t i, n; + n = PyTuple_GET_SIZE(mro); + for (i = 0; i < n; i++) { + if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b) + return 1; + } + return 0; + } + return __Pyx_InBases(a, b); +} +#if PY_MAJOR_VERSION == 2 +static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { + PyObject *exception, *value, *tb; + int res; + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ErrFetch(&exception, &value, &tb); + res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; + if (unlikely(res == -1)) { + PyErr_WriteUnraisable(err); + res = 0; + } + if (!res) { + res = PyObject_IsSubclass(err, exc_type2); + if (unlikely(res == -1)) { + PyErr_WriteUnraisable(err); + res = 0; + } + } + __Pyx_ErrRestore(exception, value, tb); + return res; +} +#else +static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { + int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0; + if (!res) { + res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); + } + return res; +} +#endif +static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { + Py_ssize_t i, n; + assert(PyExceptionClass_Check(exc_type)); + n = PyTuple_GET_SIZE(tuple); +#if PY_MAJOR_VERSION >= 3 + for (i=0; i= 0x02070000 + cobj = PyCapsule_New(p, sig, 0); +#else + cobj = PyCObject_FromVoidPtrAndDesc(p, (void *)sig, 0); +#endif + if (!cobj) + goto bad; + if (PyDict_SetItem(d, name, cobj) < 0) + goto bad; + Py_DECREF(cobj); + Py_DECREF(d); + return 0; +bad: + Py_XDECREF(cobj); + Py_XDECREF(d); + return -1; +} + +/* FunctionExport */ +static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig) { + PyObject *d = 0; + PyObject *cobj = 0; + union { + void (*fp)(void); + void *p; + } tmp; + d = PyObject_GetAttrString(__pyx_m, (char *)"__pyx_capi__"); + if (!d) { + PyErr_Clear(); + d = PyDict_New(); + if (!d) + goto bad; + Py_INCREF(d); + if (PyModule_AddObject(__pyx_m, (char *)"__pyx_capi__", d) < 0) + goto bad; + } + tmp.fp = f; +#if PY_VERSION_HEX >= 0x02070000 + cobj = PyCapsule_New(tmp.p, sig, 0); +#else + cobj = PyCObject_FromVoidPtrAndDesc(tmp.p, (void *)sig, 0); +#endif + if (!cobj) + goto bad; + if (PyDict_SetItemString(d, name, cobj) < 0) + goto bad; + Py_DECREF(cobj); + Py_DECREF(d); + return 0; +bad: + Py_XDECREF(cobj); + Py_XDECREF(d); + return -1; +} + +/* VoidPtrImport */ +#ifndef __PYX_HAVE_RT_ImportVoidPtr +#define __PYX_HAVE_RT_ImportVoidPtr +static int __Pyx_ImportVoidPtr(PyObject *module, const char *name, void **p, const char *sig) { + PyObject *d = 0; + PyObject *cobj = 0; + d = PyObject_GetAttrString(module, (char *)"__pyx_capi__"); + if (!d) + goto bad; + cobj = PyDict_GetItemString(d, name); + if (!cobj) { + PyErr_Format(PyExc_ImportError, + "%.200s does not export expected C variable %.200s", + PyModule_GetName(module), name); + goto bad; + } +#if PY_VERSION_HEX >= 0x02070000 + if (!PyCapsule_IsValid(cobj, sig)) { + PyErr_Format(PyExc_TypeError, + "C variable %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", + PyModule_GetName(module), name, sig, PyCapsule_GetName(cobj)); + goto bad; + } + *p = PyCapsule_GetPointer(cobj, sig); +#else + {const char *desc, *s1, *s2; + desc = (const char *)PyCObject_GetDesc(cobj); + if (!desc) + goto bad; + s1 = desc; s2 = sig; + while (*s1 != '\0' && *s1 == *s2) { s1++; s2++; } + if (*s1 != *s2) { + PyErr_Format(PyExc_TypeError, + "C variable %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", + PyModule_GetName(module), name, sig, desc); + goto bad; + } + *p = PyCObject_AsVoidPtr(cobj);} +#endif + if (!(*p)) + goto bad; + Py_DECREF(d); + return 0; +bad: + Py_XDECREF(d); + return -1; +} +#endif + +/* FunctionImport */ +#ifndef __PYX_HAVE_RT_ImportFunction +#define __PYX_HAVE_RT_ImportFunction +static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig) { + PyObject *d = 0; + PyObject *cobj = 0; + union { + void (*fp)(void); + void *p; + } tmp; + d = PyObject_GetAttrString(module, (char *)"__pyx_capi__"); + if (!d) + goto bad; + cobj = PyDict_GetItemString(d, funcname); + if (!cobj) { + PyErr_Format(PyExc_ImportError, + "%.200s does not export expected C function %.200s", + PyModule_GetName(module), funcname); + goto bad; + } +#if PY_VERSION_HEX >= 0x02070000 + if (!PyCapsule_IsValid(cobj, sig)) { + PyErr_Format(PyExc_TypeError, + "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", + PyModule_GetName(module), funcname, sig, PyCapsule_GetName(cobj)); + goto bad; + } + tmp.p = PyCapsule_GetPointer(cobj, sig); +#else + {const char *desc, *s1, *s2; + desc = (const char *)PyCObject_GetDesc(cobj); + if (!desc) + goto bad; + s1 = desc; s2 = sig; + while (*s1 != '\0' && *s1 == *s2) { s1++; s2++; } + if (*s1 != *s2) { + PyErr_Format(PyExc_TypeError, + "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", + PyModule_GetName(module), funcname, sig, desc); + goto bad; + } + tmp.p = PyCObject_AsVoidPtr(cobj);} +#endif + *f = tmp.fp; + if (!(*f)) + goto bad; + Py_DECREF(d); + return 0; +bad: + Py_XDECREF(d); + return -1; +} +#endif + +/* InitStrings */ +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { + while (t->p) { + #if PY_MAJOR_VERSION < 3 + if (t->is_unicode) { + *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); + } else if (t->intern) { + *t->p = PyString_InternFromString(t->s); + } else { + *t->p = PyString_FromStringAndSize(t->s, t->n - 1); + } + #else + if (t->is_unicode | t->is_str) { + if (t->intern) { + *t->p = PyUnicode_InternFromString(t->s); + } else if (t->encoding) { + *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); + } else { + *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); + } + } else { + *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); + } + #endif + if (!*t->p) + return -1; + if (PyObject_Hash(*t->p) == -1) + return -1; + ++t; + } + return 0; +} + +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { + return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); +} +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { + Py_ssize_t ignore; + return __Pyx_PyObject_AsStringAndSize(o, &ignore); +} +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +#if !CYTHON_PEP393_ENABLED +static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { + char* defenc_c; + PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); + if (!defenc) return NULL; + defenc_c = PyBytes_AS_STRING(defenc); +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + { + char* end = defenc_c + PyBytes_GET_SIZE(defenc); + char* c; + for (c = defenc_c; c < end; c++) { + if ((unsigned char) (*c) >= 128) { + PyUnicode_AsASCIIString(o); + return NULL; + } + } + } +#endif + *length = PyBytes_GET_SIZE(defenc); + return defenc_c; +} +#else +static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { + if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + if (likely(PyUnicode_IS_ASCII(o))) { + *length = PyUnicode_GET_LENGTH(o); + return PyUnicode_AsUTF8(o); + } else { + PyUnicode_AsASCIIString(o); + return NULL; + } +#else + return PyUnicode_AsUTF8AndSize(o, length); +#endif +} +#endif +#endif +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT + if ( +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + __Pyx_sys_getdefaultencoding_not_ascii && +#endif + PyUnicode_Check(o)) { + return __Pyx_PyUnicode_AsStringAndSize(o, length); + } else +#endif +#if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) + if (PyByteArray_Check(o)) { + *length = PyByteArray_GET_SIZE(o); + return PyByteArray_AS_STRING(o); + } else +#endif + { + char* result; + int r = PyBytes_AsStringAndSize(o, &result, length); + if (unlikely(r < 0)) { + return NULL; + } else { + return result; + } + } +} +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { + int is_true = x == Py_True; + if (is_true | (x == Py_False) | (x == Py_None)) return is_true; + else return PyObject_IsTrue(x); +} +static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) { + int retval; + if (unlikely(!x)) return -1; + retval = __Pyx_PyObject_IsTrue(x); + Py_DECREF(x); + return retval; +} +static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) { +#if PY_MAJOR_VERSION >= 3 + if (PyLong_Check(result)) { + if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, + "__int__ returned non-int (type %.200s). " + "The ability to return an instance of a strict subclass of int " + "is deprecated, and may be removed in a future version of Python.", + Py_TYPE(result)->tp_name)) { + Py_DECREF(result); + return NULL; + } + return result; + } +#endif + PyErr_Format(PyExc_TypeError, + "__%.4s__ returned non-%.4s (type %.200s)", + type_name, type_name, Py_TYPE(result)->tp_name); + Py_DECREF(result); + return NULL; +} +static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { +#if CYTHON_USE_TYPE_SLOTS + PyNumberMethods *m; +#endif + const char *name = NULL; + PyObject *res = NULL; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x) || PyLong_Check(x))) +#else + if (likely(PyLong_Check(x))) +#endif + return __Pyx_NewRef(x); +#if CYTHON_USE_TYPE_SLOTS + m = Py_TYPE(x)->tp_as_number; + #if PY_MAJOR_VERSION < 3 + if (m && m->nb_int) { + name = "int"; + res = m->nb_int(x); + } + else if (m && m->nb_long) { + name = "long"; + res = m->nb_long(x); + } + #else + if (likely(m && m->nb_int)) { + name = "int"; + res = m->nb_int(x); + } + #endif +#else + if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { + res = PyNumber_Int(x); + } +#endif + if (likely(res)) { +#if PY_MAJOR_VERSION < 3 + if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) { +#else + if (unlikely(!PyLong_CheckExact(res))) { +#endif + return __Pyx_PyNumber_IntOrLongWrongResultType(res, name); + } + } + else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_TypeError, + "an integer is required"); + } + return res; +} +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { + Py_ssize_t ival; + PyObject *x; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_CheckExact(b))) { + if (sizeof(Py_ssize_t) >= sizeof(long)) + return PyInt_AS_LONG(b); + else + return PyInt_AsSsize_t(b); + } +#endif + if (likely(PyLong_CheckExact(b))) { + #if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)b)->ob_digit; + const Py_ssize_t size = Py_SIZE(b); + if (likely(__Pyx_sst_abs(size) <= 1)) { + ival = likely(size) ? digits[0] : 0; + if (size == -1) ival = -ival; + return ival; + } else { + switch (size) { + case 2: + if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { + return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -2: + if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case 3: + if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { + return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -3: + if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case 4: + if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { + return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -4: + if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + } + } + #endif + return PyLong_AsSsize_t(b); + } + x = PyNumber_Index(b); + if (!x) return -1; + ival = PyInt_AsSsize_t(x); + Py_DECREF(x); + return ival; +} +static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) { + return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False); +} +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { + return PyInt_FromSize_t(ival); +} + + +#endif /* Py_PYTHON_H */ diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/greenlet.html b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/greenlet.html new file mode 100644 index 00000000..1761ea1e --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/greenlet.html @@ -0,0 +1,10062 @@ + + + + + + Cython: greenlet.py + + + +

Generated by Cython 0.29.2

+

+ Yellow lines hint at Python interaction.
+ Click on a line that starts with a "+" to see the C code that Cython generated for it. +

+

Raw output: greenlet.c

+
+0001: # Copyright (c) 2009-2012 Denis Bilenko. See LICENSE for details.
+
  __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
 0002: # cython: auto_pickle=False,embedsignature=True,always_allow_keywords=False
+
 0003: 
+
 0004: from __future__ import absolute_import, print_function, division
+
 0005: 
+
+0006: from sys import _getframe as sys_getframe
+
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(__pyx_n_s_getframe);
+  __Pyx_GIVEREF(__pyx_n_s_getframe);
+  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_getframe);
+  __pyx_t_2 = __Pyx_Import(__pyx_n_s_sys, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_getframe); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(__pyx_t_1);
+  __Pyx_XGOTREF(__pyx_v_6gevent_9_greenlet_sys_getframe);
+  __Pyx_DECREF_SET(__pyx_v_6gevent_9_greenlet_sys_getframe, __pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+0007: from sys import exc_info as sys_exc_info
+
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_exc_info);
+  __Pyx_GIVEREF(__pyx_n_s_exc_info);
+  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_exc_info);
+  __pyx_t_1 = __Pyx_Import(__pyx_n_s_sys, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_exc_info); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(__pyx_t_2);
+  __Pyx_XGOTREF(__pyx_v_6gevent_9_greenlet_sys_exc_info);
+  __Pyx_DECREF_SET(__pyx_v_6gevent_9_greenlet_sys_exc_info, __pyx_t_2);
+  __Pyx_GIVEREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+0008: from weakref import ref as wref
+
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 8, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(__pyx_n_s_ref);
+  __Pyx_GIVEREF(__pyx_n_s_ref);
+  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_ref);
+  __pyx_t_2 = __Pyx_Import(__pyx_n_s_weakref, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_ref); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 8, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(__pyx_t_1);
+  __Pyx_XGOTREF(__pyx_v_6gevent_9_greenlet_wref);
+  __Pyx_DECREF_SET(__pyx_v_6gevent_9_greenlet_wref, __pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
 0009: 
+
 0010: # XXX: How to get cython to let us rename this as RawGreenlet
+
 0011: # like we prefer?
+
+0012: from greenlet import greenlet
+
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 12, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_greenlet);
+  __Pyx_GIVEREF(__pyx_n_s_greenlet);
+  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_greenlet);
+  __pyx_t_1 = __Pyx_Import(__pyx_n_s_greenlet, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 12, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+0013: from greenlet import GreenletExit
+
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 13, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(__pyx_n_s_GreenletExit);
+  __Pyx_GIVEREF(__pyx_n_s_GreenletExit);
+  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_GreenletExit);
+  __pyx_t_2 = __Pyx_Import(__pyx_n_s_greenlet, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 13, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_GreenletExit); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 13, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(__pyx_t_1);
+  __Pyx_XGOTREF(__pyx_v_6gevent_9_greenlet_GreenletExit);
+  __Pyx_DECREF_SET(__pyx_v_6gevent_9_greenlet_GreenletExit, __pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
 0014: 
+
+0015: from gevent._compat import reraise
+
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 15, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_reraise);
+  __Pyx_GIVEREF(__pyx_n_s_reraise);
+  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_reraise);
+  __pyx_t_1 = __Pyx_Import(__pyx_n_s_gevent__compat, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 15, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_reraise); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 15, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(__pyx_t_2);
+  __Pyx_XGOTREF(__pyx_v_6gevent_9_greenlet_reraise);
+  __Pyx_DECREF_SET(__pyx_v_6gevent_9_greenlet_reraise, __pyx_t_2);
+  __Pyx_GIVEREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+0016: from gevent._compat import PYPY as _PYPY
+
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 16, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(__pyx_n_s_PYPY_2);
+  __Pyx_GIVEREF(__pyx_n_s_PYPY_2);
+  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_PYPY_2);
+  __pyx_t_2 = __Pyx_Import(__pyx_n_s_gevent__compat, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 16, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_PYPY_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 16, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 16, __pyx_L1_error)
+  __pyx_v_6gevent_9_greenlet__PYPY = __pyx_t_3;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+0017: from gevent._tblib import dump_traceback
+
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 17, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_dump_traceback);
+  __Pyx_GIVEREF(__pyx_n_s_dump_traceback);
+  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_dump_traceback);
+  __pyx_t_1 = __Pyx_Import(__pyx_n_s_gevent__tblib, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 17, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_dump_traceback); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 17, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(__pyx_t_2);
+  __Pyx_XGOTREF(__pyx_v_6gevent_9_greenlet_dump_traceback);
+  __Pyx_DECREF_SET(__pyx_v_6gevent_9_greenlet_dump_traceback, __pyx_t_2);
+  __Pyx_GIVEREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+0018: from gevent._tblib import load_traceback
+
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 18, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(__pyx_n_s_load_traceback);
+  __Pyx_GIVEREF(__pyx_n_s_load_traceback);
+  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_load_traceback);
+  __pyx_t_2 = __Pyx_Import(__pyx_n_s_gevent__tblib, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 18, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_load_traceback); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 18, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(__pyx_t_1);
+  __Pyx_XGOTREF(__pyx_v_6gevent_9_greenlet_load_traceback);
+  __Pyx_DECREF_SET(__pyx_v_6gevent_9_greenlet_load_traceback, __pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
 0019: 
+
+0020: from gevent.exceptions import InvalidSwitchError
+
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 20, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_InvalidSwitchError);
+  __Pyx_GIVEREF(__pyx_n_s_InvalidSwitchError);
+  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_InvalidSwitchError);
+  __pyx_t_1 = __Pyx_Import(__pyx_n_s_gevent_exceptions, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 20, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_InvalidSwitchError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 20, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(__pyx_t_2);
+  __Pyx_XGOTREF(__pyx_v_6gevent_9_greenlet_InvalidSwitchError);
+  __Pyx_DECREF_SET(__pyx_v_6gevent_9_greenlet_InvalidSwitchError, __pyx_t_2);
+  __Pyx_GIVEREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 0021: 
+
+0022: from gevent._hub_primitives import iwait_on_objects as iwait
+
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 22, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(__pyx_n_s_iwait_on_objects);
+  __Pyx_GIVEREF(__pyx_n_s_iwait_on_objects);
+  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_iwait_on_objects);
+  __pyx_t_2 = __Pyx_Import(__pyx_n_s_gevent__hub_primitives, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 22, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_iwait_on_objects); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 22, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(__pyx_t_1);
+  __Pyx_XGOTREF(__pyx_v_6gevent_9_greenlet_iwait);
+  __Pyx_DECREF_SET(__pyx_v_6gevent_9_greenlet_iwait, __pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+0023: from gevent._hub_primitives import wait_on_objects as wait
+
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 23, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_wait_on_objects);
+  __Pyx_GIVEREF(__pyx_n_s_wait_on_objects);
+  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_wait_on_objects);
+  __pyx_t_1 = __Pyx_Import(__pyx_n_s_gevent__hub_primitives, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 23, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_wait_on_objects); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 23, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(__pyx_t_2);
+  __Pyx_XGOTREF(__pyx_v_6gevent_9_greenlet_wait);
+  __Pyx_DECREF_SET(__pyx_v_6gevent_9_greenlet_wait, __pyx_t_2);
+  __Pyx_GIVEREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 0024: 
+
+0025: from gevent.timeout import Timeout
+
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 25, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(__pyx_n_s_Timeout);
+  __Pyx_GIVEREF(__pyx_n_s_Timeout);
+  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_Timeout);
+  __pyx_t_2 = __Pyx_Import(__pyx_n_s_gevent_timeout, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 25, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_Timeout); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 25, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(__pyx_t_1);
+  __Pyx_XGOTREF(__pyx_v_6gevent_9_greenlet_Timeout);
+  __Pyx_DECREF_SET(__pyx_v_6gevent_9_greenlet_Timeout, __pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
 0026: 
+
+0027: from gevent._config import config as GEVENT_CONFIG
+
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 27, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_config);
+  __Pyx_GIVEREF(__pyx_n_s_config);
+  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_config);
+  __pyx_t_1 = __Pyx_Import(__pyx_n_s_gevent__config, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 27, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_config); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 27, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(__pyx_t_2);
+  __Pyx_XGOTREF(__pyx_v_6gevent_9_greenlet_GEVENT_CONFIG);
+  __Pyx_DECREF_SET(__pyx_v_6gevent_9_greenlet_GEVENT_CONFIG, __pyx_t_2);
+  __Pyx_GIVEREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+0028: from gevent._util import Lazy
+
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 28, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(__pyx_n_s_Lazy);
+  __Pyx_GIVEREF(__pyx_n_s_Lazy);
+  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_Lazy);
+  __pyx_t_2 = __Pyx_Import(__pyx_n_s_gevent__util, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 28, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_Lazy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 28, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Lazy, __pyx_t_1) < 0) __PYX_ERR(0, 28, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+0029: from gevent._util import readproperty
+
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 29, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_readproperty);
+  __Pyx_GIVEREF(__pyx_n_s_readproperty);
+  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_readproperty);
+  __pyx_t_1 = __Pyx_Import(__pyx_n_s_gevent__util, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 29, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_readproperty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 29, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_readproperty, __pyx_t_2) < 0) __PYX_ERR(0, 29, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+0030: from gevent._hub_local import get_hub_noargs as get_hub
+
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 30, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(__pyx_n_s_get_hub_noargs);
+  __Pyx_GIVEREF(__pyx_n_s_get_hub_noargs);
+  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_get_hub_noargs);
+  __pyx_t_2 = __Pyx_Import(__pyx_n_s_gevent__hub_local, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 30, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_get_hub_noargs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 30, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_hub_noargs, __pyx_t_1) < 0) __PYX_ERR(0, 30, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+0031: from gevent import _waiter
+
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 31, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_waiter_2);
+  __Pyx_GIVEREF(__pyx_n_s_waiter_2);
+  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_waiter_2);
+  __pyx_t_1 = __Pyx_Import(__pyx_n_s_gevent, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 31, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_waiter_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 31, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_waiter_2, __pyx_t_2) < 0) __PYX_ERR(0, 31, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 0032: 
+
 0033: 
+
+0034: __all__ = [
+
  __pyx_t_1 = PyList_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 34, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(__pyx_n_s_Greenlet);
+  __Pyx_GIVEREF(__pyx_n_s_Greenlet);
+  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_Greenlet);
+  __Pyx_INCREF(__pyx_n_s_joinall);
+  __Pyx_GIVEREF(__pyx_n_s_joinall);
+  PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_joinall);
+  __Pyx_INCREF(__pyx_n_s_killall);
+  __Pyx_GIVEREF(__pyx_n_s_killall);
+  PyList_SET_ITEM(__pyx_t_1, 2, __pyx_n_s_killall);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_all, __pyx_t_1) < 0) __PYX_ERR(0, 34, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 0035:     'Greenlet',
+
 0036:     'joinall',
+
 0037:     'killall',
+
 0038: ]
+
 0039: 
+
 0040: 
+
 0041: # In Cython, we define these as 'cdef inline' functions. The
+
 0042: # compilation unit cannot have a direct assignment to them (import
+
 0043: # is assignment) without generating a 'lvalue is not valid target'
+
 0044: # error.
+
+0045: locals()['getcurrent'] = __import__('greenlet').getcurrent
+
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin___import__, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 45, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_getcurrent); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 45, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_1 = __Pyx_Globals(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 45, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (unlikely(PyDict_SetItem(__pyx_t_1, __pyx_n_s_getcurrent, __pyx_t_2) < 0)) __PYX_ERR(0, 45, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+/* … */
+  __pyx_tuple__21 = PyTuple_Pack(1, __pyx_n_s_greenlet); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(0, 45, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__21);
+  __Pyx_GIVEREF(__pyx_tuple__21);
+
+0046: locals()['greenlet_init'] = lambda: None
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_9_greenlet_6lambda(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyMethodDef __pyx_mdef_6gevent_9_greenlet_6lambda = {"lambda", (PyCFunction)__pyx_pw_6gevent_9_greenlet_6lambda, METH_NOARGS, 0};
+static PyObject *__pyx_pw_6gevent_9_greenlet_6lambda(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("lambda (wrapper)", 0);
+  __pyx_r = __pyx_lambda_funcdef_6gevent_9_greenlet_lambda(__pyx_self);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_lambda_funcdef_6gevent_9_greenlet_lambda(CYTHON_UNUSED PyObject *__pyx_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("lambda", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_9_greenlet_6lambda, 0, __pyx_n_s_lambda, NULL, __pyx_n_s_gevent__greenlet, __pyx_d, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 46, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_1 = __Pyx_Globals(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 46, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (unlikely(PyDict_SetItem(__pyx_t_1, __pyx_n_s_greenlet_init, __pyx_t_2) < 0)) __PYX_ERR(0, 46, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+0047: locals()['Waiter'] = _waiter.Waiter
+
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_waiter_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 47, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_Waiter); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 47, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_2 = __Pyx_Globals(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 47, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (unlikely(PyDict_SetItem(__pyx_t_2, __pyx_n_s_Waiter, __pyx_t_1) < 0)) __PYX_ERR(0, 47, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 0048: 
+
 0049: 
+
+0050: if _PYPY:
+
  __pyx_t_3 = (__pyx_v_6gevent_9_greenlet__PYPY != 0);
+  if (__pyx_t_3) {
+/* … */
+  }
+
+0051:     import _continuation # pylint:disable=import-error
+
    __pyx_t_1 = __Pyx_Import(__pyx_n_s_continuation, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 51, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    if (PyDict_SetItem(__pyx_d, __pyx_n_s_continuation, __pyx_t_1) < 0) __PYX_ERR(0, 51, __pyx_L1_error)
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+0052:     _continulet = _continuation.continulet
+
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_continuation); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 52, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_continulet); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 52, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    if (PyDict_SetItem(__pyx_d, __pyx_n_s_continulet_2, __pyx_t_2) < 0) __PYX_ERR(0, 52, __pyx_L1_error)
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
 0053: 
+
 0054: 
+
 0055: class SpawnedLink(object):
+
 0056:     """
+
 0057:     A wrapper around link that calls it in another greenlet.
+
 0058: 
+
 0059:     Can be called only from main loop.
+
 0060:     """
+
+0061:     __slots__ = ['callback']
+
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 61, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_callback);
+  __Pyx_GIVEREF(__pyx_n_s_callback);
+  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_callback);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet_SpawnedLink->tp_dict, __pyx_n_s_slots, __pyx_t_2) < 0) __PYX_ERR(0, 61, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_9_greenlet_SpawnedLink);
+
 0062: 
+
+0063:     def __init__(self, callback):
+
/* Python wrapper */
+static int __pyx_pw_6gevent_9_greenlet_11SpawnedLink_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static int __pyx_pw_6gevent_9_greenlet_11SpawnedLink_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_callback = 0;
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_callback,0};
+    PyObject* values[1] = {0};
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_callback)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 63, __pyx_L3_error)
+      }
+    } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
+      goto __pyx_L5_argtuple_error;
+    } else {
+      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+    }
+    __pyx_v_callback = values[0];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 63, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent._greenlet.SpawnedLink.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return -1;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_9_greenlet_11SpawnedLink___init__(((struct __pyx_obj_6gevent_9_greenlet_SpawnedLink *)__pyx_v_self), __pyx_v_callback);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_9_greenlet_11SpawnedLink___init__(struct __pyx_obj_6gevent_9_greenlet_SpawnedLink *__pyx_v_self, PyObject *__pyx_v_callback) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = 0;
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_AddTraceback("gevent._greenlet.SpawnedLink.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = -1;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0064:         if not callable(callback):
+
  __pyx_t_1 = __Pyx_PyCallable_Check(__pyx_v_callback); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 64, __pyx_L1_error)
+  __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
+  if (unlikely(__pyx_t_2)) {
+/* … */
+  }
+
+0065:             raise TypeError("Expected callable: %r" % (callback, ))
+
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 65, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_INCREF(__pyx_v_callback);
+    __Pyx_GIVEREF(__pyx_v_callback);
+    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_callback);
+    __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Expected_callable_r, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 65, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 65, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __PYX_ERR(0, 65, __pyx_L1_error)
+
+0066:         self.callback = callback
+
  __Pyx_INCREF(__pyx_v_callback);
+  __Pyx_GIVEREF(__pyx_v_callback);
+  __Pyx_GOTREF(__pyx_v_self->callback);
+  __Pyx_DECREF(__pyx_v_self->callback);
+  __pyx_v_self->callback = __pyx_v_callback;
+
 0067: 
+
+0068:     def __call__(self, source):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_9_greenlet_11SpawnedLink_3__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_pw_6gevent_9_greenlet_11SpawnedLink_3__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_source = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__call__ (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_source,0};
+    PyObject* values[1] = {0};
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_source)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__call__") < 0)) __PYX_ERR(0, 68, __pyx_L3_error)
+      }
+    } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
+      goto __pyx_L5_argtuple_error;
+    } else {
+      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+    }
+    __pyx_v_source = values[0];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("__call__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 68, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent._greenlet.SpawnedLink.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_9_greenlet_11SpawnedLink_2__call__(((struct __pyx_obj_6gevent_9_greenlet_SpawnedLink *)__pyx_v_self), __pyx_v_source);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_9_greenlet_11SpawnedLink_2__call__(struct __pyx_obj_6gevent_9_greenlet_SpawnedLink *__pyx_v_self, PyObject *__pyx_v_source) {
+  PyGreenlet *__pyx_v_g = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__call__", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_AddTraceback("gevent._greenlet.SpawnedLink.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XDECREF((PyObject *)__pyx_v_g);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0069:         g = greenlet(self.callback, get_hub())
+
  __pyx_t_1 = ((PyObject *)__pyx_f_6gevent_11__hub_local_get_hub_noargs(0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 69, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 69, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(__pyx_v_self->callback);
+  __Pyx_GIVEREF(__pyx_v_self->callback);
+  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_self->callback);
+  __Pyx_GIVEREF(__pyx_t_1);
+  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1);
+  __pyx_t_1 = 0;
+  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6gevent_9_greenlet_greenlet), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 69, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_v_g = ((PyGreenlet *)__pyx_t_1);
+  __pyx_t_1 = 0;
+
+0070:         g.switch(source)
+
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_g), __pyx_n_s_switch); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 70, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = NULL;
+  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+    if (likely(__pyx_t_3)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+      __Pyx_INCREF(__pyx_t_3);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_2, function);
+    }
+  }
+  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_source) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_source);
+  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 70, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 0071: 
+
+0072:     def __hash__(self):
+
/* Python wrapper */
+static Py_hash_t __pyx_pw_6gevent_9_greenlet_11SpawnedLink_5__hash__(PyObject *__pyx_v_self); /*proto*/
+static Py_hash_t __pyx_pw_6gevent_9_greenlet_11SpawnedLink_5__hash__(PyObject *__pyx_v_self) {
+  Py_hash_t __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__hash__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_9_greenlet_11SpawnedLink_4__hash__(((struct __pyx_obj_6gevent_9_greenlet_SpawnedLink *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static Py_hash_t __pyx_pf_6gevent_9_greenlet_11SpawnedLink_4__hash__(struct __pyx_obj_6gevent_9_greenlet_SpawnedLink *__pyx_v_self) {
+  Py_hash_t __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__hash__", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent._greenlet.SpawnedLink.__hash__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = -1;
+  __pyx_L0:;
+  if (unlikely(__pyx_r == -1) && !PyErr_Occurred()) __pyx_r = -2;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0073:         return hash(self.callback)
+
  __pyx_t_1 = __pyx_v_self->callback;
+  __Pyx_INCREF(__pyx_t_1);
+  __pyx_t_2 = PyObject_Hash(__pyx_t_1); if (unlikely(__pyx_t_2 == ((Py_hash_t)-1))) __PYX_ERR(0, 73, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_r = __pyx_t_2;
+  goto __pyx_L0;
+
 0074: 
+
+0075:     def __eq__(self, other):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_9_greenlet_11SpawnedLink_7__eq__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
+static PyObject *__pyx_pw_6gevent_9_greenlet_11SpawnedLink_7__eq__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__eq__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_9_greenlet_11SpawnedLink_6__eq__(((struct __pyx_obj_6gevent_9_greenlet_SpawnedLink *)__pyx_v_self), ((PyObject *)__pyx_v_other));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_9_greenlet_11SpawnedLink_6__eq__(struct __pyx_obj_6gevent_9_greenlet_SpawnedLink *__pyx_v_self, PyObject *__pyx_v_other) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__eq__", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_AddTraceback("gevent._greenlet.SpawnedLink.__eq__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0076:         return self.callback == getattr(other, 'callback', other)
+
  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __Pyx_GetAttr3(__pyx_v_other, __pyx_n_s_callback, __pyx_v_other); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 76, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = PyObject_RichCompare(__pyx_v_self->callback, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 76, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_r = __pyx_t_2;
+  __pyx_t_2 = 0;
+  goto __pyx_L0;
+
 0077: 
+
+0078:     def __str__(self):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_9_greenlet_11SpawnedLink_9__str__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_9_greenlet_11SpawnedLink_9__str__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_9_greenlet_11SpawnedLink_8__str__(((struct __pyx_obj_6gevent_9_greenlet_SpawnedLink *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_9_greenlet_11SpawnedLink_8__str__(struct __pyx_obj_6gevent_9_greenlet_SpawnedLink *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__str__", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent._greenlet.SpawnedLink.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0079:         return str(self.callback)
+
  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyString_Type)), __pyx_v_self->callback); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 79, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
 0080: 
+
+0081:     def __repr__(self):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_9_greenlet_11SpawnedLink_11__repr__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_9_greenlet_11SpawnedLink_11__repr__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_9_greenlet_11SpawnedLink_10__repr__(((struct __pyx_obj_6gevent_9_greenlet_SpawnedLink *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_9_greenlet_11SpawnedLink_10__repr__(struct __pyx_obj_6gevent_9_greenlet_SpawnedLink *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__repr__", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_AddTraceback("gevent._greenlet.SpawnedLink.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0082:         return repr(self.callback)
+
  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __pyx_v_self->callback;
+  __Pyx_INCREF(__pyx_t_1);
+  __pyx_t_2 = PyObject_Repr(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 82, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_r = __pyx_t_2;
+  __pyx_t_2 = 0;
+  goto __pyx_L0;
+
 0083: 
+
+0084:     def __getattr__(self, item):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_9_greenlet_11SpawnedLink_13__getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_item); /*proto*/
+static PyObject *__pyx_pw_6gevent_9_greenlet_11SpawnedLink_13__getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_item) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__getattr__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_9_greenlet_11SpawnedLink_12__getattr__(((struct __pyx_obj_6gevent_9_greenlet_SpawnedLink *)__pyx_v_self), ((PyObject *)__pyx_v_item));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_9_greenlet_11SpawnedLink_12__getattr__(struct __pyx_obj_6gevent_9_greenlet_SpawnedLink *__pyx_v_self, PyObject *__pyx_v_item) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__getattr__", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_AddTraceback("gevent._greenlet.SpawnedLink.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0085:         assert item != 'callback'
+
  #ifndef CYTHON_WITHOUT_ASSERTIONS
+  if (unlikely(!Py_OptimizeFlag)) {
+    __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_item, __pyx_n_s_callback, Py_NE)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 85, __pyx_L1_error)
+    if (unlikely(!__pyx_t_1)) {
+      PyErr_SetNone(PyExc_AssertionError);
+      __PYX_ERR(0, 85, __pyx_L1_error)
+    }
+  }
+  #endif
+
+0086:         return getattr(self.callback, item)
+
  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_2 = __pyx_v_self->callback;
+  __Pyx_INCREF(__pyx_t_2);
+  __pyx_t_3 = __Pyx_GetAttr(__pyx_t_2, __pyx_v_item); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 86, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_r = __pyx_t_3;
+  __pyx_t_3 = 0;
+  goto __pyx_L0;
+
 0087: 
+
 0088: 
+
 0089: class SuccessSpawnedLink(SpawnedLink):
+
 0090:     """A wrapper around link that calls it in another greenlet only if source succeed.
+
 0091: 
+
 0092:     Can be called only from main loop.
+
 0093:     """
+
+0094:     __slots__ = []
+
  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 94, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet_SuccessSpawnedLink->tp_dict, __pyx_n_s_slots, __pyx_t_2) < 0) __PYX_ERR(0, 94, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_9_greenlet_SuccessSpawnedLink);
+
 0095: 
+
+0096:     def __call__(self, source):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_9_greenlet_18SuccessSpawnedLink_1__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_pw_6gevent_9_greenlet_18SuccessSpawnedLink_1__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_source = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__call__ (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_source,0};
+    PyObject* values[1] = {0};
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_source)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__call__") < 0)) __PYX_ERR(0, 96, __pyx_L3_error)
+      }
+    } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
+      goto __pyx_L5_argtuple_error;
+    } else {
+      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+    }
+    __pyx_v_source = values[0];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("__call__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 96, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent._greenlet.SuccessSpawnedLink.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_9_greenlet_18SuccessSpawnedLink___call__(((struct __pyx_obj_6gevent_9_greenlet_SuccessSpawnedLink *)__pyx_v_self), __pyx_v_source);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_9_greenlet_18SuccessSpawnedLink___call__(struct __pyx_obj_6gevent_9_greenlet_SuccessSpawnedLink *__pyx_v_self, PyObject *__pyx_v_source) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__call__", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_6);
+  __Pyx_AddTraceback("gevent._greenlet.SuccessSpawnedLink.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0097:         if source.successful():
+
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_source, __pyx_n_s_successful); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 97, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = NULL;
+  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+    if (likely(__pyx_t_3)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+      __Pyx_INCREF(__pyx_t_3);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_2, function);
+    }
+  }
+  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 97, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 97, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  if (__pyx_t_4) {
+/* … */
+  }
+
+0098:             return SpawnedLink.__call__(self, source)
+
    __Pyx_XDECREF(__pyx_r);
+    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_6gevent_9_greenlet_SpawnedLink), __pyx_n_s_call); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 98, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_3 = NULL;
+    __pyx_t_5 = 0;
+    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+      if (likely(__pyx_t_3)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+        __Pyx_INCREF(__pyx_t_3);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_2, function);
+        __pyx_t_5 = 1;
+      }
+    }
+    #if CYTHON_FAST_PYCALL
+    if (PyFunction_Check(__pyx_t_2)) {
+      PyObject *__pyx_temp[3] = {__pyx_t_3, ((PyObject *)__pyx_v_self), __pyx_v_source};
+      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 98, __pyx_L1_error)
+      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __Pyx_GOTREF(__pyx_t_1);
+    } else
+    #endif
+    #if CYTHON_FAST_PYCCALL
+    if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
+      PyObject *__pyx_temp[3] = {__pyx_t_3, ((PyObject *)__pyx_v_self), __pyx_v_source};
+      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 98, __pyx_L1_error)
+      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __Pyx_GOTREF(__pyx_t_1);
+    } else
+    #endif
+    {
+      __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 98, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_6);
+      if (__pyx_t_3) {
+        __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); __pyx_t_3 = NULL;
+      }
+      __Pyx_INCREF(((PyObject *)__pyx_v_self));
+      __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
+      PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, ((PyObject *)__pyx_v_self));
+      __Pyx_INCREF(__pyx_v_source);
+      __Pyx_GIVEREF(__pyx_v_source);
+      PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_source);
+      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 98, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+    }
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __pyx_r = __pyx_t_1;
+    __pyx_t_1 = 0;
+    goto __pyx_L0;
+
 0099: 
+
 0100: 
+
 0101: class FailureSpawnedLink(SpawnedLink):
+
 0102:     """A wrapper around link that calls it in another greenlet only if source failed.
+
 0103: 
+
 0104:     Can be called only from main loop.
+
 0105:     """
+
+0106:     __slots__ = []
+
  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 106, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet_FailureSpawnedLink->tp_dict, __pyx_n_s_slots, __pyx_t_2) < 0) __PYX_ERR(0, 106, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_9_greenlet_FailureSpawnedLink);
+
 0107: 
+
+0108:     def __call__(self, source):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_9_greenlet_18FailureSpawnedLink_1__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_pw_6gevent_9_greenlet_18FailureSpawnedLink_1__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_source = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__call__ (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_source,0};
+    PyObject* values[1] = {0};
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_source)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__call__") < 0)) __PYX_ERR(0, 108, __pyx_L3_error)
+      }
+    } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
+      goto __pyx_L5_argtuple_error;
+    } else {
+      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+    }
+    __pyx_v_source = values[0];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("__call__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 108, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent._greenlet.FailureSpawnedLink.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_9_greenlet_18FailureSpawnedLink___call__(((struct __pyx_obj_6gevent_9_greenlet_FailureSpawnedLink *)__pyx_v_self), __pyx_v_source);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_9_greenlet_18FailureSpawnedLink___call__(struct __pyx_obj_6gevent_9_greenlet_FailureSpawnedLink *__pyx_v_self, PyObject *__pyx_v_source) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__call__", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_7);
+  __Pyx_AddTraceback("gevent._greenlet.FailureSpawnedLink.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0109:         if not source.successful():
+
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_source, __pyx_n_s_successful); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 109, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = NULL;
+  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+    if (likely(__pyx_t_3)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+      __Pyx_INCREF(__pyx_t_3);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_2, function);
+    }
+  }
+  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 109, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 109, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_5 = ((!__pyx_t_4) != 0);
+  if (__pyx_t_5) {
+/* … */
+  }
+
+0110:             return SpawnedLink.__call__(self, source)
+
    __Pyx_XDECREF(__pyx_r);
+    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_6gevent_9_greenlet_SpawnedLink), __pyx_n_s_call); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 110, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_3 = NULL;
+    __pyx_t_6 = 0;
+    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+      if (likely(__pyx_t_3)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+        __Pyx_INCREF(__pyx_t_3);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_2, function);
+        __pyx_t_6 = 1;
+      }
+    }
+    #if CYTHON_FAST_PYCALL
+    if (PyFunction_Check(__pyx_t_2)) {
+      PyObject *__pyx_temp[3] = {__pyx_t_3, ((PyObject *)__pyx_v_self), __pyx_v_source};
+      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 110, __pyx_L1_error)
+      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __Pyx_GOTREF(__pyx_t_1);
+    } else
+    #endif
+    #if CYTHON_FAST_PYCCALL
+    if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
+      PyObject *__pyx_temp[3] = {__pyx_t_3, ((PyObject *)__pyx_v_self), __pyx_v_source};
+      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 110, __pyx_L1_error)
+      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __Pyx_GOTREF(__pyx_t_1);
+    } else
+    #endif
+    {
+      __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 110, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_7);
+      if (__pyx_t_3) {
+        __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3); __pyx_t_3 = NULL;
+      }
+      __Pyx_INCREF(((PyObject *)__pyx_v_self));
+      __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
+      PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, ((PyObject *)__pyx_v_self));
+      __Pyx_INCREF(__pyx_v_source);
+      __Pyx_GIVEREF(__pyx_v_source);
+      PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_source);
+      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 110, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+    }
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __pyx_r = __pyx_t_1;
+    __pyx_t_1 = 0;
+    goto __pyx_L0;
+
 0111: 
+
 0112: class _Frame(object):
+
 0113: 
+
+0114:     __slots__ = ('f_code', 'f_lineno', 'f_back')
+
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet__Frame->tp_dict, __pyx_n_s_slots, __pyx_tuple__22) < 0) __PYX_ERR(0, 114, __pyx_L1_error)
+  PyType_Modified(__pyx_ptype_6gevent_9_greenlet__Frame);
+/* … */
+  __pyx_tuple__22 = PyTuple_Pack(3, __pyx_n_s_f_code, __pyx_n_s_f_lineno, __pyx_n_s_f_back); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(0, 114, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__22);
+  __Pyx_GIVEREF(__pyx_tuple__22);
+
 0115: 
+
+0116:     def __init__(self, f_code, f_lineno, f_back):
+
/* Python wrapper */
+static int __pyx_pw_6gevent_9_greenlet_6_Frame_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static int __pyx_pw_6gevent_9_greenlet_6_Frame_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_f_code = 0;
+  PyObject *__pyx_v_f_lineno = 0;
+  PyObject *__pyx_v_f_back = 0;
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_f_code,&__pyx_n_s_f_lineno,&__pyx_n_s_f_back,0};
+    PyObject* values[3] = {0,0,0};
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_f_code)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_f_lineno)) != 0)) kw_args--;
+        else {
+          __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 1); __PYX_ERR(0, 116, __pyx_L3_error)
+        }
+        CYTHON_FALLTHROUGH;
+        case  2:
+        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_f_back)) != 0)) kw_args--;
+        else {
+          __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 2); __PYX_ERR(0, 116, __pyx_L3_error)
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 116, __pyx_L3_error)
+      }
+    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
+      goto __pyx_L5_argtuple_error;
+    } else {
+      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+    }
+    __pyx_v_f_code = values[0];
+    __pyx_v_f_lineno = values[1];
+    __pyx_v_f_back = values[2];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 116, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent._greenlet._Frame.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return -1;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_9_greenlet_6_Frame___init__(((struct __pyx_obj_6gevent_9_greenlet__Frame *)__pyx_v_self), __pyx_v_f_code, __pyx_v_f_lineno, __pyx_v_f_back);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_9_greenlet_6_Frame___init__(struct __pyx_obj_6gevent_9_greenlet__Frame *__pyx_v_self, PyObject *__pyx_v_f_code, PyObject *__pyx_v_f_lineno, PyObject *__pyx_v_f_back) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = 0;
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent._greenlet._Frame.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = -1;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0117:         self.f_code = f_code
+
  if (!(likely(((__pyx_v_f_code) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_f_code, __pyx_ptype_6gevent_9_greenlet_CodeType))))) __PYX_ERR(0, 117, __pyx_L1_error)
+  __pyx_t_1 = __pyx_v_f_code;
+  __Pyx_INCREF(__pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_1);
+  __Pyx_GOTREF(__pyx_v_self->f_code);
+  __Pyx_DECREF(((PyObject *)__pyx_v_self->f_code));
+  __pyx_v_self->f_code = ((PyCodeObject *)__pyx_t_1);
+  __pyx_t_1 = 0;
+
+0118:         self.f_lineno = f_lineno
+
  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_f_lineno); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 118, __pyx_L1_error)
+  __pyx_v_self->f_lineno = __pyx_t_2;
+
+0119:         self.f_back = f_back
+
  if (!(likely(((__pyx_v_f_back) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_f_back, __pyx_ptype_6gevent_9_greenlet__Frame))))) __PYX_ERR(0, 119, __pyx_L1_error)
+  __pyx_t_1 = __pyx_v_f_back;
+  __Pyx_INCREF(__pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_1);
+  __Pyx_GOTREF(__pyx_v_self->f_back);
+  __Pyx_DECREF(((PyObject *)__pyx_v_self->f_back));
+  __pyx_v_self->f_back = ((struct __pyx_obj_6gevent_9_greenlet__Frame *)__pyx_t_1);
+  __pyx_t_1 = 0;
+
 0120: 
+
 0121:     @property
+
+0122:     def f_globals(self):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_9_greenlet_6_Frame_9f_globals_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_9_greenlet_6_Frame_9f_globals_1__get__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_9_greenlet_6_Frame_9f_globals___get__(((struct __pyx_obj_6gevent_9_greenlet__Frame *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_9_greenlet_6_Frame_9f_globals___get__(CYTHON_UNUSED struct __pyx_obj_6gevent_9_greenlet__Frame *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__", 0);
+/* … */
+  /* function exit code */
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0123:         return None
+
  __Pyx_XDECREF(__pyx_r);
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+
 0124: 
+
+0125: def _Frame_from_list(frames):
+
static struct __pyx_obj_6gevent_9_greenlet__Frame *__pyx_f_6gevent_9_greenlet__Frame_from_list(PyObject *__pyx_v_frames) {
+  struct __pyx_obj_6gevent_9_greenlet__Frame *__pyx_v_previous = 0;
+  PyObject *__pyx_v_frame = 0;
+  struct __pyx_obj_6gevent_9_greenlet__Frame *__pyx_v_f = 0;
+  struct __pyx_obj_6gevent_9_greenlet__Frame *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_Frame_from_list", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_AddTraceback("gevent._greenlet._Frame_from_list", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XDECREF((PyObject *)__pyx_v_previous);
+  __Pyx_XDECREF(__pyx_v_frame);
+  __Pyx_XDECREF((PyObject *)__pyx_v_f);
+  __Pyx_XGIVEREF((PyObject *)__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0126:     previous = None
+
  __Pyx_INCREF(Py_None);
+  __pyx_v_previous = ((struct __pyx_obj_6gevent_9_greenlet__Frame *)Py_None);
+
+0127:     for frame in reversed(frames):
+
  if (unlikely(__pyx_v_frames == Py_None)) {
+    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
+    __PYX_ERR(0, 127, __pyx_L1_error)
+  }
+  __pyx_t_1 = __pyx_v_frames; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = PyList_GET_SIZE(__pyx_t_1) - 1;
+  for (;;) {
+    if (__pyx_t_2 < 0) break;
+    if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
+    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+    __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2--; if (unlikely(0 < 0)) __PYX_ERR(0, 127, __pyx_L1_error)
+    #else
+    __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2--; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 127, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    #endif
+    if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(0, 127, __pyx_L1_error)
+    __Pyx_XDECREF_SET(__pyx_v_frame, ((PyObject*)__pyx_t_3));
+    __pyx_t_3 = 0;
+/* … */
+  }
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+0128:         f = _Frame(frame[0], frame[1], previous)
+
    if (unlikely(__pyx_v_frame == Py_None)) {
+      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
+      __PYX_ERR(0, 128, __pyx_L1_error)
+    }
+    __pyx_t_3 = __Pyx_GetItemInt_Tuple(__pyx_v_frame, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 128, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    if (unlikely(__pyx_v_frame == Py_None)) {
+      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
+      __PYX_ERR(0, 128, __pyx_L1_error)
+    }
+    __pyx_t_4 = __Pyx_GetItemInt_Tuple(__pyx_v_frame, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 128, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 128, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_5);
+    __Pyx_GIVEREF(__pyx_t_3);
+    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3);
+    __Pyx_GIVEREF(__pyx_t_4);
+    PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4);
+    __Pyx_INCREF(((PyObject *)__pyx_v_previous));
+    __Pyx_GIVEREF(((PyObject *)__pyx_v_previous));
+    PyTuple_SET_ITEM(__pyx_t_5, 2, ((PyObject *)__pyx_v_previous));
+    __pyx_t_3 = 0;
+    __pyx_t_4 = 0;
+    __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6gevent_9_greenlet__Frame), __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 128, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __Pyx_XDECREF_SET(__pyx_v_f, ((struct __pyx_obj_6gevent_9_greenlet__Frame *)__pyx_t_4));
+    __pyx_t_4 = 0;
+
+0129:         previous = f
+
    __Pyx_INCREF(((PyObject *)__pyx_v_f));
+    __Pyx_DECREF_SET(__pyx_v_previous, __pyx_v_f);
+
+0130:     return previous
+
  __Pyx_XDECREF(((PyObject *)__pyx_r));
+  __Pyx_INCREF(((PyObject *)__pyx_v_previous));
+  __pyx_r = __pyx_v_previous;
+  goto __pyx_L0;
+
 0131: 
+
+0132: def _extract_stack(limit):
+
static CYTHON_INLINE PyObject *__pyx_f_6gevent_9_greenlet__extract_stack(int __pyx_v_limit) {
+  PyObject *__pyx_v_frames = 0;
+  PyFrameObject *__pyx_v_frame = 0;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_extract_stack", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_XDECREF(__pyx_t_6);
+  __Pyx_AddTraceback("gevent._greenlet._extract_stack", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_frames);
+  __Pyx_XDECREF((PyObject *)__pyx_v_frame);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0133:     try:
+
  {
+    /*try:*/ {
+/* … */
+    }
+    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+    goto __pyx_L8_try_end;
+    __pyx_L3_error:;
+    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+/* … */
+    __Pyx_XGIVEREF(__pyx_t_1);
+    __Pyx_XGIVEREF(__pyx_t_2);
+    __Pyx_XGIVEREF(__pyx_t_3);
+    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
+    goto __pyx_L1_error;
+    __pyx_L4_exception_handled:;
+    __Pyx_XGIVEREF(__pyx_t_1);
+    __Pyx_XGIVEREF(__pyx_t_2);
+    __Pyx_XGIVEREF(__pyx_t_3);
+    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
+    __pyx_L8_try_end:;
+  }
+
+0134:         frame = sys_getframe()
+
      __Pyx_INCREF(__pyx_v_6gevent_9_greenlet_sys_getframe);
+      __pyx_t_5 = __pyx_v_6gevent_9_greenlet_sys_getframe; __pyx_t_6 = NULL;
+      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
+        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
+        if (likely(__pyx_t_6)) {
+          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
+          __Pyx_INCREF(__pyx_t_6);
+          __Pyx_INCREF(function);
+          __Pyx_DECREF_SET(__pyx_t_5, function);
+        }
+      }
+      __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
+      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 134, __pyx_L3_error)
+      __Pyx_GOTREF(__pyx_t_4);
+      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+      if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_6gevent_9_greenlet_FrameType))))) __PYX_ERR(0, 134, __pyx_L3_error)
+      __pyx_v_frame = ((PyFrameObject *)__pyx_t_4);
+      __pyx_t_4 = 0;
+
+0135:     except ValueError:
+
    __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ValueError);
+    if (__pyx_t_7) {
+      __Pyx_AddTraceback("gevent._greenlet._extract_stack", __pyx_clineno, __pyx_lineno, __pyx_filename);
+      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6) < 0) __PYX_ERR(0, 135, __pyx_L5_except_error)
+      __Pyx_GOTREF(__pyx_t_4);
+      __Pyx_GOTREF(__pyx_t_5);
+      __Pyx_GOTREF(__pyx_t_6);
+
 0136:         # In certain embedded cases that directly use the Python C api
+
 0137:         # to call Greenlet.spawn (e.g., uwsgi) this can raise
+
 0138:         # `ValueError: call stack is not deep enough`. This is because
+
 0139:         # the Cython stack frames for Greenlet.spawn ->
+
 0140:         # Greenlet.__init__ -> _extract_stack are all on the C level,
+
 0141:         # not the Python level.
+
 0142:         # See https://github.com/gevent/gevent/issues/1212
+
+0143:         frame = None
+
      __Pyx_INCREF(Py_None);
+      __Pyx_XDECREF_SET(__pyx_v_frame, ((PyFrameObject *)Py_None));
+      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+      goto __pyx_L4_exception_handled;
+    }
+    goto __pyx_L5_except_error;
+    __pyx_L5_except_error:;
+
 0144: 
+
+0145:     frames = []
+
  __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 145, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  __pyx_v_frames = ((PyObject*)__pyx_t_6);
+  __pyx_t_6 = 0;
+
 0146: 
+
+0147:     while limit and frame is not None:
+
  while (1) {
+    __pyx_t_9 = (__pyx_v_limit != 0);
+    if (__pyx_t_9) {
+    } else {
+      __pyx_t_8 = __pyx_t_9;
+      goto __pyx_L13_bool_binop_done;
+    }
+    __pyx_t_9 = (((PyObject *)__pyx_v_frame) != Py_None);
+    __pyx_t_10 = (__pyx_t_9 != 0);
+    __pyx_t_8 = __pyx_t_10;
+    __pyx_L13_bool_binop_done:;
+    if (!__pyx_t_8) break;
+
+0148:         limit -= 1
+
    __pyx_v_limit = (__pyx_v_limit - 1);
+
+0149:         frames.append((frame.f_code, frame.f_lineno))
+
    __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_frame->f_lineno); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 149, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_6);
+    __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 149, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_5);
+    __Pyx_INCREF(((PyObject *)__pyx_v_frame->f_code));
+    __Pyx_GIVEREF(((PyObject *)__pyx_v_frame->f_code));
+    PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_frame->f_code));
+    __Pyx_GIVEREF(__pyx_t_6);
+    PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_6);
+    __pyx_t_6 = 0;
+    __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_frames, __pyx_t_5); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 149, __pyx_L1_error)
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+
+0150:         frame = frame.f_back
+
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_frame), __pyx_n_s_f_back); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 150, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_5);
+    if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_6gevent_9_greenlet_FrameType))))) __PYX_ERR(0, 150, __pyx_L1_error)
+    __Pyx_DECREF_SET(__pyx_v_frame, ((PyFrameObject *)__pyx_t_5));
+    __pyx_t_5 = 0;
+  }
+
 0151: 
+
+0152:     return frames
+
  __Pyx_XDECREF(__pyx_r);
+  __Pyx_INCREF(__pyx_v_frames);
+  __pyx_r = __pyx_v_frames;
+  goto __pyx_L0;
+
 0153: 
+
 0154: 
+
+0155: _greenlet__init__ = greenlet.__init__
+
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_6gevent_9_greenlet_greenlet), __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 155, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_XGOTREF(__pyx_v_6gevent_9_greenlet__greenlet__init__);
+  __Pyx_DECREF_SET(__pyx_v_6gevent_9_greenlet__greenlet__init__, __pyx_t_2);
+  __Pyx_GIVEREF(__pyx_t_2);
+  __pyx_t_2 = 0;
+
 0156: 
+
+0157: class Greenlet(greenlet):
+
struct __pyx_vtabstruct_6gevent_9_greenlet_Greenlet {
+  int (*has_links)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *, int __pyx_skip_dispatch);
+  PyObject *(*join)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_9_greenlet_8Greenlet_join *__pyx_optional_args);
+  int (*ready)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *, int __pyx_skip_dispatch);
+  int (*successful)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *, int __pyx_skip_dispatch);
+  PyObject *(*rawlink)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *, PyObject *, int __pyx_skip_dispatch);
+  PyObject *(*_formatinfo)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *, int __pyx_skip_dispatch);
+  PyObject *(*_get_minimal_ident)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *);
+  int (*__pyx___started_but_aborted)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *);
+  int (*__pyx___start_cancelled_by_kill)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *);
+  int (*__pyx___start_pending)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *);
+  int (*__pyx___never_started_or_killed)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *);
+  int (*__pyx___start_completed)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *);
+  PyObject *(*__pyx___handle_death_before_start)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *, PyObject *);
+  PyObject *(*__pyx___cancel_start)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *);
+  PyObject *(*_report_result)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *, PyObject *);
+  PyObject *(*_report_error)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *, PyObject *);
+  PyObject *(*_notify_links)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *, int __pyx_skip_dispatch);
+};
+static struct __pyx_vtabstruct_6gevent_9_greenlet_Greenlet *__pyx_vtabptr_6gevent_9_greenlet_Greenlet;
+
+
 0158:     """
+
 0159:     A light-weight cooperatively-scheduled execution unit.
+
 0160:     """
+
 0161:     # pylint:disable=too-many-public-methods,too-many-instance-attributes
+
 0162: 
+
+0163:     spawning_stack_limit = 10
+
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet->tp_dict, __pyx_n_s_spawning_stack_limit, __pyx_int_10) < 0) __PYX_ERR(0, 163, __pyx_L1_error)
+  PyType_Modified(__pyx_ptype_6gevent_9_greenlet_Greenlet);
+
 0164: 
+
 0165:     # pylint:disable=keyword-arg-before-vararg,super-init-not-called
+
+0166:     def __init__(self, run=None, *args, **kwargs):
+
/* Python wrapper */
+static int __pyx_pw_6gevent_9_greenlet_8Greenlet_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_6gevent_9_greenlet_8Greenlet___init__[] = "\n        :param args: The arguments passed to the ``run`` function.\n        :param kwargs: The keyword arguments passed to the ``run`` function.\n        :keyword callable run: The callable object to run. If not given, this object's\n            `_run` method will be invoked (typically defined by subclasses).\n\n        .. versionchanged:: 1.1b1\n            The ``run`` argument to the constructor is now verified to be a callable\n            object. Previously, passing a non-callable object would fail after the greenlet\n            was spawned.\n\n        .. versionchanged:: 1.3b1\n           The ``GEVENT_TRACK_GREENLET_TREE`` configuration value may be set to\n           a false value to disable ``spawn_tree_locals``, ``spawning_greenlet``,\n           and ``spawning_stack``. The first two will be None in that case, and the\n           latter will be empty.\n        ";
+#if CYTHON_COMPILING_IN_CPYTHON
+struct wrapperbase __pyx_wrapperbase_6gevent_9_greenlet_8Greenlet___init__;
+#endif
+static int __pyx_pw_6gevent_9_greenlet_8Greenlet_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_run = 0;
+  PyObject *__pyx_v_args = 0;
+  PyObject *__pyx_v_kwargs = 0;
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
+  __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return -1;
+  __Pyx_GOTREF(__pyx_v_kwargs);
+  if (PyTuple_GET_SIZE(__pyx_args) > 1) {
+    __pyx_v_args = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args));
+    if (unlikely(!__pyx_v_args)) {
+      __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
+      __Pyx_RefNannyFinishContext();
+      return -1;
+    }
+    __Pyx_GOTREF(__pyx_v_args);
+  } else {
+    __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple);
+  }
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_run,0};
+    PyObject* values[1] = {0};
+    values[0] = ((PyObject *)Py_None);
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        default:
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_run);
+          if (value) { values[0] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1;
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, used_pos_args, "__init__") < 0)) __PYX_ERR(0, 166, __pyx_L3_error)
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        default:
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+      }
+    }
+    __pyx_v_run = values[0];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L3_error:;
+  __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0;
+  __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
+  __Pyx_AddTraceback("gevent._greenlet.Greenlet.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return -1;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_9_greenlet_8Greenlet___init__(((struct __pyx_obj_6gevent_9_greenlet_Greenlet *)__pyx_v_self), __pyx_v_run, __pyx_v_args, __pyx_v_kwargs);
+
+  /* function exit code */
+  __Pyx_XDECREF(__pyx_v_args);
+  __Pyx_XDECREF(__pyx_v_kwargs);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_9_greenlet_8Greenlet___init__(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self, PyObject *__pyx_v_run, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) {
+  PyGreenlet *__pyx_v_spawner = NULL;
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = 0;
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_6);
+  __Pyx_AddTraceback("gevent._greenlet.Greenlet.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = -1;
+  __pyx_L0:;
+  __Pyx_XDECREF((PyObject *)__pyx_v_spawner);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
 0167:         """
+
 0168:         :param args: The arguments passed to the ``run`` function.
+
 0169:         :param kwargs: The keyword arguments passed to the ``run`` function.
+
 0170:         :keyword callable run: The callable object to run. If not given, this object's
+
 0171:             `_run` method will be invoked (typically defined by subclasses).
+
 0172: 
+
 0173:         .. versionchanged:: 1.1b1
+
 0174:             The ``run`` argument to the constructor is now verified to be a callable
+
 0175:             object. Previously, passing a non-callable object would fail after the greenlet
+
 0176:             was spawned.
+
 0177: 
+
 0178:         .. versionchanged:: 1.3b1
+
 0179:            The ``GEVENT_TRACK_GREENLET_TREE`` configuration value may be set to
+
 0180:            a false value to disable ``spawn_tree_locals``, ``spawning_greenlet``,
+
 0181:            and ``spawning_stack``. The first two will be None in that case, and the
+
 0182:            latter will be empty.
+
 0183:         """
+
 0184:         # The attributes are documented in the .rst file
+
 0185: 
+
 0186:         # greenlet.greenlet(run=None, parent=None)
+
 0187:         # Calling it with both positional arguments instead of a keyword
+
 0188:         # argument (parent=get_hub()) speeds up creation of this object ~30%:
+
 0189:         # python -m timeit -s 'import gevent' 'gevent.Greenlet()'
+
 0190:         # Python 3.5: 2.70usec with keywords vs 1.94usec with positional
+
 0191:         # Python 3.4: 2.32usec with keywords vs 1.74usec with positional
+
 0192:         # Python 3.3: 2.55usec with keywords vs 1.92usec with positional
+
 0193:         # Python 2.7: 1.73usec with keywords vs 1.40usec with positional
+
 0194: 
+
 0195:         # Timings taken Feb 21 2018 prior to integration of #755
+
 0196:         # python -m perf timeit -s 'import gevent' 'gevent.Greenlet()'
+
 0197:         # 3.6.4       : Mean +- std dev: 1.08 us +- 0.05 us
+
 0198:         # 2.7.14      : Mean +- std dev: 1.44 us +- 0.06 us
+
 0199:         # PyPy2 5.10.0: Mean +- std dev: 2.14 ns +- 0.08 ns
+
 0200: 
+
 0201:         # After the integration of spawning_stack, spawning_greenlet,
+
 0202:         # and spawn_tree_locals on that same date:
+
 0203:         # 3.6.4       : Mean +- std dev: 8.92 us +- 0.36 us ->  8.2x
+
 0204:         # 2.7.14      : Mean +- std dev: 14.8 us +- 0.5 us  -> 10.2x
+
 0205:         # PyPy2 5.10.0: Mean +- std dev: 3.24 us +- 0.17 us ->  1.5x
+
 0206: 
+
 0207:         # Compiling with Cython gets us to these numbers:
+
 0208:         # 3.6.4        : Mean +- std dev: 3.63 us +- 0.14 us
+
 0209:         # 2.7.14       : Mean +- std dev: 3.37 us +- 0.20 us
+
 0210:         # PyPy2 5.10.0 : Mean +- std dev: 4.44 us +- 0.28 us
+
 0211: 
+
 0212: 
+
+0213:         _greenlet__init__(self, None, get_hub())
+
  __pyx_t_2 = ((PyObject *)__pyx_f_6gevent_11__hub_local_get_hub_noargs(0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 213, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(__pyx_v_6gevent_9_greenlet__greenlet__init__);
+  __pyx_t_3 = __pyx_v_6gevent_9_greenlet__greenlet__init__; __pyx_t_4 = NULL;
+  __pyx_t_5 = 0;
+  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+    if (likely(__pyx_t_4)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+      __Pyx_INCREF(__pyx_t_4);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_3, function);
+      __pyx_t_5 = 1;
+    }
+  }
+  #if CYTHON_FAST_PYCALL
+  if (PyFunction_Check(__pyx_t_3)) {
+    PyObject *__pyx_temp[4] = {__pyx_t_4, ((PyObject *)__pyx_v_self), Py_None, __pyx_t_2};
+    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 213, __pyx_L1_error)
+    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  } else
+  #endif
+  #if CYTHON_FAST_PYCCALL
+  if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
+    PyObject *__pyx_temp[4] = {__pyx_t_4, ((PyObject *)__pyx_v_self), Py_None, __pyx_t_2};
+    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 213, __pyx_L1_error)
+    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  } else
+  #endif
+  {
+    __pyx_t_6 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 213, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_6);
+    if (__pyx_t_4) {
+      __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
+    }
+    __Pyx_INCREF(((PyObject *)__pyx_v_self));
+    __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
+    PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, ((PyObject *)__pyx_v_self));
+    __Pyx_INCREF(Py_None);
+    __Pyx_GIVEREF(Py_None);
+    PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, Py_None);
+    __Pyx_GIVEREF(__pyx_t_2);
+    PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_t_2);
+    __pyx_t_2 = 0;
+    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 213, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  }
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 0214: 
+
+0215:         if run is not None:
+
  __pyx_t_7 = (__pyx_v_run != Py_None);
+  __pyx_t_8 = (__pyx_t_7 != 0);
+  if (__pyx_t_8) {
+/* … */
+  }
+
+0216:             self._run = run
+
    if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_run_2, __pyx_v_run) < 0) __PYX_ERR(0, 216, __pyx_L1_error)
+
 0217: 
+
 0218:         # If they didn't pass a callable at all, then they must
+
 0219:         # already have one. Note that subclassing to override the run() method
+
 0220:         # itself has never been documented or supported.
+
+0221:         if not callable(self._run):
+
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_run_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 221, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_8 = __Pyx_PyCallable_Check(__pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 221, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_7 = ((!(__pyx_t_8 != 0)) != 0);
+  if (unlikely(__pyx_t_7)) {
+/* … */
+  }
+
+0222:             raise TypeError("The run argument or self._run must be callable")
+
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 222, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __PYX_ERR(0, 222, __pyx_L1_error)
+/* … */
+  __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_The_run_argument_or_self__run_mu); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 222, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple_);
+  __Pyx_GIVEREF(__pyx_tuple_);
+
 0223: 
+
+0224:         self.args = args
+
  __Pyx_INCREF(__pyx_v_args);
+  __Pyx_GIVEREF(__pyx_v_args);
+  __Pyx_GOTREF(__pyx_v_self->args);
+  __Pyx_DECREF(__pyx_v_self->args);
+  __pyx_v_self->args = __pyx_v_args;
+
+0225:         self.kwargs = kwargs
+
  __Pyx_INCREF(__pyx_v_kwargs);
+  __Pyx_GIVEREF(__pyx_v_kwargs);
+  __Pyx_GOTREF(__pyx_v_self->kwargs);
+  __Pyx_DECREF(__pyx_v_self->kwargs);
+  __pyx_v_self->kwargs = __pyx_v_kwargs;
+
+0226:         self.value = None
+
  __Pyx_INCREF(Py_None);
+  __Pyx_GIVEREF(Py_None);
+  __Pyx_GOTREF(__pyx_v_self->value);
+  __Pyx_DECREF(__pyx_v_self->value);
+  __pyx_v_self->value = Py_None;
+
 0227: 
+
 0228:         #: An event, such as a timer or a callback that fires. It is established in
+
 0229:         #: start() and start_later() as those two objects, respectively.
+
 0230:         #: Once this becomes non-None, the Greenlet cannot be started again. Conversely,
+
 0231:         #: kill() and throw() check for non-None to determine if this object has ever been
+
 0232:         #: scheduled for starting. A placeholder _dummy_event is assigned by them to prevent
+
 0233:         #: the greenlet from being started in the future, if necessary.
+
+0234:         self._start_event = None
+
  __Pyx_INCREF(Py_None);
+  __Pyx_GIVEREF(Py_None);
+  __Pyx_GOTREF(__pyx_v_self->_start_event);
+  __Pyx_DECREF(__pyx_v_self->_start_event);
+  __pyx_v_self->_start_event = Py_None;
+
 0235: 
+
+0236:         self._notifier = None
+
  __Pyx_INCREF(Py_None);
+  __Pyx_GIVEREF(Py_None);
+  __Pyx_GOTREF(__pyx_v_self->_notifier);
+  __Pyx_DECREF(__pyx_v_self->_notifier);
+  __pyx_v_self->_notifier = Py_None;
+
+0237:         self._formatted_info = None
+
  __Pyx_INCREF(Py_None);
+  __Pyx_GIVEREF(Py_None);
+  __Pyx_GOTREF(__pyx_v_self->_formatted_info);
+  __Pyx_DECREF(__pyx_v_self->_formatted_info);
+  __pyx_v_self->_formatted_info = ((PyObject*)Py_None);
+
+0238:         self._links = []
+
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 238, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_1);
+  __Pyx_GOTREF(__pyx_v_self->_links);
+  __Pyx_DECREF(__pyx_v_self->_links);
+  __pyx_v_self->_links = ((PyObject*)__pyx_t_1);
+  __pyx_t_1 = 0;
+
+0239:         self._ident = None
+
  __Pyx_INCREF(Py_None);
+  __Pyx_GIVEREF(Py_None);
+  __Pyx_GOTREF(__pyx_v_self->_ident);
+  __Pyx_DECREF(__pyx_v_self->_ident);
+  __pyx_v_self->_ident = Py_None;
+
 0240: 
+
 0241:         # Initial state: None.
+
 0242:         # Completed successfully: (None, None, None)
+
 0243:         # Failed with exception: (t, v, dump_traceback(tb)))
+
+0244:         self._exc_info = None
+
  __Pyx_INCREF(Py_None);
+  __Pyx_GIVEREF(Py_None);
+  __Pyx_GOTREF(__pyx_v_self->_exc_info);
+  __Pyx_DECREF(__pyx_v_self->_exc_info);
+  __pyx_v_self->_exc_info = ((PyObject*)Py_None);
+
 0245: 
+
+0246:         if GEVENT_CONFIG.track_greenlet_tree:
+
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_6gevent_9_greenlet_GEVENT_CONFIG, __pyx_n_s_track_greenlet_tree); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 246, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 246, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  if (__pyx_t_7) {
+/* … */
+    goto __pyx_L5;
+  }
+
+0247:             spawner = getcurrent() # pylint:disable=undefined-variable
+
    __pyx_t_1 = ((PyObject *)__pyx_f_6gevent_9_greenlet_getcurrent()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 247, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __pyx_v_spawner = ((PyGreenlet *)__pyx_t_1);
+    __pyx_t_1 = 0;
+
+0248:             self.spawning_greenlet = wref(spawner)
+
    __Pyx_INCREF(__pyx_v_6gevent_9_greenlet_wref);
+    __pyx_t_3 = __pyx_v_6gevent_9_greenlet_wref; __pyx_t_6 = NULL;
+    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
+      if (likely(__pyx_t_6)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+        __Pyx_INCREF(__pyx_t_6);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_3, function);
+      }
+    }
+    __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_6, ((PyObject *)__pyx_v_spawner)) : __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_spawner));
+    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 248, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __Pyx_GIVEREF(__pyx_t_1);
+    __Pyx_GOTREF(__pyx_v_self->spawning_greenlet);
+    __Pyx_DECREF(__pyx_v_self->spawning_greenlet);
+    __pyx_v_self->spawning_greenlet = __pyx_t_1;
+    __pyx_t_1 = 0;
+
+0249:             try:
+
    {
+      /*try:*/ {
+/* … */
+      }
+      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
+      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
+      __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
+      goto __pyx_L11_try_end;
+      __pyx_L6_error:;
+      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+/* … */
+      __Pyx_XGIVEREF(__pyx_t_9);
+      __Pyx_XGIVEREF(__pyx_t_10);
+      __Pyx_XGIVEREF(__pyx_t_11);
+      __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
+      goto __pyx_L1_error;
+      __pyx_L7_exception_handled:;
+      __Pyx_XGIVEREF(__pyx_t_9);
+      __Pyx_XGIVEREF(__pyx_t_10);
+      __Pyx_XGIVEREF(__pyx_t_11);
+      __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
+      __pyx_L11_try_end:;
+    }
+
+0250:                 self.spawn_tree_locals = spawner.spawn_tree_locals
+
        __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_spawner), __pyx_n_s_spawn_tree_locals); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 250, __pyx_L6_error)
+        __Pyx_GOTREF(__pyx_t_1);
+        if (!(likely(PyDict_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 250, __pyx_L6_error)
+        __Pyx_GIVEREF(__pyx_t_1);
+        __Pyx_GOTREF(__pyx_v_self->spawn_tree_locals);
+        __Pyx_DECREF(__pyx_v_self->spawn_tree_locals);
+        __pyx_v_self->spawn_tree_locals = ((PyObject*)__pyx_t_1);
+        __pyx_t_1 = 0;
+
+0251:             except AttributeError:
+
      __pyx_t_5 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_AttributeError);
+      if (__pyx_t_5) {
+        __Pyx_AddTraceback("gevent._greenlet.Greenlet.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+        if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_3, &__pyx_t_6) < 0) __PYX_ERR(0, 251, __pyx_L8_except_error)
+        __Pyx_GOTREF(__pyx_t_1);
+        __Pyx_GOTREF(__pyx_t_3);
+        __Pyx_GOTREF(__pyx_t_6);
+
+0252:                 self.spawn_tree_locals = {}
+
        __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 252, __pyx_L8_except_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        __Pyx_GIVEREF(__pyx_t_2);
+        __Pyx_GOTREF(__pyx_v_self->spawn_tree_locals);
+        __Pyx_DECREF(__pyx_v_self->spawn_tree_locals);
+        __pyx_v_self->spawn_tree_locals = ((PyObject*)__pyx_t_2);
+        __pyx_t_2 = 0;
+
+0253:                 if spawner.parent is not None:
+
        __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_spawner), __pyx_n_s_parent); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 253, __pyx_L8_except_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        __pyx_t_7 = (__pyx_t_2 != Py_None);
+        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+        __pyx_t_8 = (__pyx_t_7 != 0);
+        if (__pyx_t_8) {
+/* … */
+        }
+        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+        goto __pyx_L7_exception_handled;
+      }
+      goto __pyx_L8_except_error;
+      __pyx_L8_except_error:;
+
 0254:                     # The main greenlet has no parent.
+
 0255:                     # Its children get separate locals.
+
+0256:                     spawner.spawn_tree_locals = self.spawn_tree_locals
+
          __pyx_t_2 = __pyx_v_self->spawn_tree_locals;
+          __Pyx_INCREF(__pyx_t_2);
+          if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_spawner), __pyx_n_s_spawn_tree_locals, __pyx_t_2) < 0) __PYX_ERR(0, 256, __pyx_L8_except_error)
+          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
 0257: 
+
+0258:             self._spawning_stack_frames = _extract_stack(self.spawning_stack_limit)
+
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_spawning_stack_limit); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 258, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_6);
+    __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_6); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 258, __pyx_L1_error)
+    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+    __pyx_t_6 = __pyx_f_6gevent_9_greenlet__extract_stack(__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 258, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_6);
+    __Pyx_GIVEREF(__pyx_t_6);
+    __Pyx_GOTREF(__pyx_v_self->_spawning_stack_frames);
+    __Pyx_DECREF(__pyx_v_self->_spawning_stack_frames);
+    __pyx_v_self->_spawning_stack_frames = ((PyObject*)__pyx_t_6);
+    __pyx_t_6 = 0;
+
+0259:             self._spawning_stack_frames.extend(getattr(spawner, '_spawning_stack_frames', []))
+
    if (unlikely(__pyx_v_self->_spawning_stack_frames == Py_None)) {
+      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "extend");
+      __PYX_ERR(0, 259, __pyx_L1_error)
+    }
+    __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 259, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_6);
+    __pyx_t_3 = __Pyx_GetAttr3(((PyObject *)__pyx_v_spawner), __pyx_n_s_spawning_stack_frames, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 259, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+    __pyx_t_12 = __Pyx_PyList_Extend(__pyx_v_self->_spawning_stack_frames, __pyx_t_3); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 259, __pyx_L1_error)
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+
 0260:         else:
+
 0261:             # None is the default for all of these in Cython, but we
+
 0262:             # need to declare them for pure-Python mode.
+
+0263:             self.spawning_greenlet = None
+
  /*else*/ {
+    __Pyx_INCREF(Py_None);
+    __Pyx_GIVEREF(Py_None);
+    __Pyx_GOTREF(__pyx_v_self->spawning_greenlet);
+    __Pyx_DECREF(__pyx_v_self->spawning_greenlet);
+    __pyx_v_self->spawning_greenlet = Py_None;
+
+0264:             self.spawn_tree_locals = None
+
    __Pyx_INCREF(Py_None);
+    __Pyx_GIVEREF(Py_None);
+    __Pyx_GOTREF(__pyx_v_self->spawn_tree_locals);
+    __Pyx_DECREF(__pyx_v_self->spawn_tree_locals);
+    __pyx_v_self->spawn_tree_locals = ((PyObject*)Py_None);
+
+0265:             self._spawning_stack_frames = None
+
    __Pyx_INCREF(Py_None);
+    __Pyx_GIVEREF(Py_None);
+    __Pyx_GOTREF(__pyx_v_self->_spawning_stack_frames);
+    __Pyx_DECREF(__pyx_v_self->_spawning_stack_frames);
+    __pyx_v_self->_spawning_stack_frames = ((PyObject*)Py_None);
+  }
+  __pyx_L5:;
+
 0266: 
+
+0267:     @Lazy
+
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Lazy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 267, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+
+0268:     def spawning_stack(self):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_3spawning_stack(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6gevent_9_greenlet_8Greenlet_2spawning_stack[] = "Greenlet.spawning_stack(self)";
+static PyMethodDef __pyx_mdef_6gevent_9_greenlet_8Greenlet_3spawning_stack = {"spawning_stack", (PyCFunction)__pyx_pw_6gevent_9_greenlet_8Greenlet_3spawning_stack, METH_NOARGS, __pyx_doc_6gevent_9_greenlet_8Greenlet_2spawning_stack};
+static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_3spawning_stack(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("spawning_stack (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_9_greenlet_8Greenlet_2spawning_stack(((struct __pyx_obj_6gevent_9_greenlet_Greenlet *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_2spawning_stack(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("spawning_stack", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_AddTraceback("gevent._greenlet.Greenlet.spawning_stack", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__23 = PyTuple_Pack(1, __pyx_n_s_self_2); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(0, 268, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__23);
+  __Pyx_GIVEREF(__pyx_tuple__23);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_9_greenlet_8Greenlet_3spawning_stack, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Greenlet_spawning_stack, NULL, __pyx_n_s_gevent__greenlet, __pyx_d, ((PyObject *)__pyx_codeobj__24)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 268, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet->tp_dict, __pyx_n_s_spawning_stack, __pyx_t_2) < 0) __PYX_ERR(0, 268, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_9_greenlet_Greenlet);
+/* … */
+  __Pyx_GetNameInClass(__pyx_t_4, (PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet, __pyx_n_s_spawning_stack); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 268, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_4);
+  __pyx_t_5 = NULL;
+  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
+    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
+    if (likely(__pyx_t_5)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
+      __Pyx_INCREF(__pyx_t_5);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_1, function);
+    }
+  }
+  __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 267, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet->tp_dict, __pyx_n_s_spawning_stack, __pyx_t_2) < 0) __PYX_ERR(0, 268, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_9_greenlet_Greenlet);
+  __pyx_codeobj__24 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__23, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_greenlet_py, __pyx_n_s_spawning_stack, 268, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__24)) __PYX_ERR(0, 268, __pyx_L1_error)
+
 0269:         # Store this in the __dict__. We don't use it from the C
+
 0270:         # code. It's tempting to discard _spawning_stack_frames
+
 0271:         # after this, but child greenlets may still be created
+
 0272:         # that need it.
+
+0273:         return _Frame_from_list(self._spawning_stack_frames or [])
+
  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_self->_spawning_stack_frames); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 273, __pyx_L1_error)
+  if (!__pyx_t_2) {
+  } else {
+    __Pyx_INCREF(__pyx_v_self->_spawning_stack_frames);
+    __pyx_t_1 = __pyx_v_self->_spawning_stack_frames;
+    goto __pyx_L3_bool_binop_done;
+  }
+  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 273, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_INCREF(__pyx_t_3);
+  __pyx_t_1 = __pyx_t_3;
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __pyx_L3_bool_binop_done:;
+  __pyx_t_3 = ((PyObject *)__pyx_f_6gevent_9_greenlet__Frame_from_list(((PyObject*)__pyx_t_1))); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 273, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_r = __pyx_t_3;
+  __pyx_t_3 = 0;
+  goto __pyx_L0;
+
 0274: 
+
+0275:     def _get_minimal_ident(self):
+
static PyObject *__pyx_f_6gevent_9_greenlet_8Greenlet__get_minimal_ident(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self) {
+  struct __pyx_obj_6gevent_7__ident_IdentRegistry *__pyx_v_reg = 0;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_get_minimal_ident", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_AddTraceback("gevent._greenlet.Greenlet._get_minimal_ident", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XDECREF((PyObject *)__pyx_v_reg);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0276:         reg = self.parent.ident_registry
+
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_parent); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 276, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_ident_registry); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 276, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_6gevent_7__ident_IdentRegistry))))) __PYX_ERR(0, 276, __pyx_L1_error)
+  __pyx_v_reg = ((struct __pyx_obj_6gevent_7__ident_IdentRegistry *)__pyx_t_2);
+  __pyx_t_2 = 0;
+
+0277:         return reg.get_ident(self)
+
  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_2 = ((struct __pyx_vtabstruct_6gevent_7__ident_IdentRegistry *)__pyx_v_reg->__pyx_vtab)->get_ident(__pyx_v_reg, ((PyObject *)__pyx_v_self), 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 277, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_r = __pyx_t_2;
+  __pyx_t_2 = 0;
+  goto __pyx_L0;
+
 0278: 
+
 0279:     @property
+
+0280:     def minimal_ident(self):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_13minimal_ident_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_13minimal_ident_1__get__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_9_greenlet_8Greenlet_13minimal_ident___get__(((struct __pyx_obj_6gevent_9_greenlet_Greenlet *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_13minimal_ident___get__(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_AddTraceback("gevent._greenlet.Greenlet.minimal_ident.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
 0281:         """
+
 0282:         A small, unique integer that identifies this object.
+
 0283: 
+
 0284:         This is similar to :attr:`threading.Thread.ident` (and `id`)
+
 0285:         in that as long as this object is alive, no other greenlet *in
+
 0286:         this hub* will have the same id, but it makes a stronger
+
 0287:         guarantee that the assigned values will be small and
+
 0288:         sequential. Sometime after this object has died, the value
+
 0289:         will be available for reuse.
+
 0290: 
+
 0291:         To get ids that are unique across all hubs, combine this with
+
 0292:         the hub's ``minimal_ident``.
+
 0293: 
+
 0294:         .. versionadded:: 1.3a2
+
 0295:         """
+
+0296:         if self._ident is None:
+
  __pyx_t_1 = (__pyx_v_self->_ident == Py_None);
+  __pyx_t_2 = (__pyx_t_1 != 0);
+  if (__pyx_t_2) {
+/* … */
+  }
+
+0297:             self._ident = self._get_minimal_ident()
+
    __pyx_t_3 = ((struct __pyx_vtabstruct_6gevent_9_greenlet_Greenlet *)__pyx_v_self->__pyx_vtab)->_get_minimal_ident(__pyx_v_self); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 297, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_GIVEREF(__pyx_t_3);
+    __Pyx_GOTREF(__pyx_v_self->_ident);
+    __Pyx_DECREF(__pyx_v_self->_ident);
+    __pyx_v_self->_ident = __pyx_t_3;
+    __pyx_t_3 = 0;
+
+0298:         return self._ident
+
  __Pyx_XDECREF(__pyx_r);
+  __Pyx_INCREF(__pyx_v_self->_ident);
+  __pyx_r = __pyx_v_self->_ident;
+  goto __pyx_L0;
+
 0299: 
+
+0300:     @readproperty
+
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_readproperty); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 300, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+
+0301:     def name(self):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_5name(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6gevent_9_greenlet_8Greenlet_4name[] = "Greenlet.name(self)\n\n        The greenlet name. By default, a unique name is constructed using\n        the :attr:`minimal_ident`. You can assign a string to this\n        value to change it. It is shown in the `repr` of this object if it\n        has been assigned to or if the `minimal_ident` has already been generated.\n\n        .. versionadded:: 1.3a2\n        .. versionchanged:: 1.4\n           Stop showing generated names in the `repr` when the ``minimal_ident``\n           hasn't been requested. This reduces overhead and may be less confusing,\n           since ``minimal_ident`` can get reused.\n        ";
+static PyMethodDef __pyx_mdef_6gevent_9_greenlet_8Greenlet_5name = {"name", (PyCFunction)__pyx_pw_6gevent_9_greenlet_8Greenlet_5name, METH_NOARGS, __pyx_doc_6gevent_9_greenlet_8Greenlet_4name};
+static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_5name(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("name (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_9_greenlet_8Greenlet_4name(((struct __pyx_obj_6gevent_9_greenlet_Greenlet *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_4name(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("name", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_AddTraceback("gevent._greenlet.Greenlet.name", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__25 = PyTuple_Pack(1, __pyx_n_s_self_2); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(0, 301, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__25);
+  __Pyx_GIVEREF(__pyx_tuple__25);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_9_greenlet_8Greenlet_5name, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Greenlet_name, NULL, __pyx_n_s_gevent__greenlet, __pyx_d, ((PyObject *)__pyx_codeobj__26)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 301, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet->tp_dict, __pyx_n_s_name_2, __pyx_t_2) < 0) __PYX_ERR(0, 301, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_9_greenlet_Greenlet);
+/* … */
+  __Pyx_GetNameInClass(__pyx_t_4, (PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet, __pyx_n_s_name_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 301, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_4);
+  __pyx_t_5 = NULL;
+  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
+    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
+    if (likely(__pyx_t_5)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
+      __Pyx_INCREF(__pyx_t_5);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_1, function);
+    }
+  }
+  __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 300, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet->tp_dict, __pyx_n_s_name_2, __pyx_t_2) < 0) __PYX_ERR(0, 301, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_9_greenlet_Greenlet);
+  __pyx_codeobj__26 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__25, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_greenlet_py, __pyx_n_s_name_2, 301, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__26)) __PYX_ERR(0, 301, __pyx_L1_error)
+
 0302:         """
+
 0303:         The greenlet name. By default, a unique name is constructed using
+
 0304:         the :attr:`minimal_ident`. You can assign a string to this
+
 0305:         value to change it. It is shown in the `repr` of this object if it
+
 0306:         has been assigned to or if the `minimal_ident` has already been generated.
+
 0307: 
+
 0308:         .. versionadded:: 1.3a2
+
 0309:         .. versionchanged:: 1.4
+
 0310:            Stop showing generated names in the `repr` when the ``minimal_ident``
+
 0311:            hasn't been requested. This reduces overhead and may be less confusing,
+
 0312:            since ``minimal_ident`` can get reused.
+
 0313:         """
+
+0314:         return 'Greenlet-%d' % (self.minimal_ident,)
+
  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_minimal_ident); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 314, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 314, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_GIVEREF(__pyx_t_1);
+  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
+  __pyx_t_1 = 0;
+  __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_Greenlet_d, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 314, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
 0315: 
+
+0316:     def _raise_exception(self):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_7_raise_exception(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6gevent_9_greenlet_8Greenlet_6_raise_exception[] = "Greenlet._raise_exception(self)";
+static PyMethodDef __pyx_mdef_6gevent_9_greenlet_8Greenlet_7_raise_exception = {"_raise_exception", (PyCFunction)__pyx_pw_6gevent_9_greenlet_8Greenlet_7_raise_exception, METH_NOARGS, __pyx_doc_6gevent_9_greenlet_8Greenlet_6_raise_exception};
+static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_7_raise_exception(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_raise_exception (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_9_greenlet_8Greenlet_6_raise_exception(((struct __pyx_obj_6gevent_9_greenlet_Greenlet *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_6_raise_exception(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_raise_exception", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_AddTraceback("gevent._greenlet.Greenlet._raise_exception", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__27 = PyTuple_Pack(1, __pyx_n_s_self_2); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(0, 316, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__27);
+  __Pyx_GIVEREF(__pyx_tuple__27);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_9_greenlet_8Greenlet_7_raise_exception, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Greenlet__raise_exception, NULL, __pyx_n_s_gevent__greenlet, __pyx_d, ((PyObject *)__pyx_codeobj__28)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 316, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet->tp_dict, __pyx_n_s_raise_exception, __pyx_t_2) < 0) __PYX_ERR(0, 316, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_9_greenlet_Greenlet);
+  __pyx_codeobj__28 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__27, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_greenlet_py, __pyx_n_s_raise_exception, 316, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__28)) __PYX_ERR(0, 316, __pyx_L1_error)
+
+0317:         reraise(*self.exc_info)
+
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_exc_info); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 317, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = __Pyx_PySequence_Tuple(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 317, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_6gevent_9_greenlet_reraise, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 317, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 0318: 
+
 0319:     @property
+
+0320:     def loop(self):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_4loop_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_4loop_1__get__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_9_greenlet_8Greenlet_4loop___get__(((struct __pyx_obj_6gevent_9_greenlet_Greenlet *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_4loop___get__(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_AddTraceback("gevent._greenlet.Greenlet.loop.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
 0321:         # needed by killall
+
+0322:         return self.parent.loop
+
  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_parent); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 322, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_loop); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 322, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_r = __pyx_t_2;
+  __pyx_t_2 = 0;
+  goto __pyx_L0;
+
 0323: 
+
+0324:     def __nonzero__(self):
+
/* Python wrapper */
+static int __pyx_pw_6gevent_9_greenlet_8Greenlet_9__nonzero__(PyObject *__pyx_v_self); /*proto*/
+static int __pyx_pw_6gevent_9_greenlet_8Greenlet_9__nonzero__(PyObject *__pyx_v_self) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__nonzero__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_9_greenlet_8Greenlet_8__nonzero__(((struct __pyx_obj_6gevent_9_greenlet_Greenlet *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_9_greenlet_8Greenlet_8__nonzero__(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__nonzero__", 0);
+/* … */
+  /* function exit code */
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0325:         return self._start_event is not None and self._exc_info is None
+
  __pyx_t_2 = (__pyx_v_self->_start_event != Py_None);
+  if (__pyx_t_2) {
+  } else {
+    __pyx_t_1 = __pyx_t_2;
+    goto __pyx_L3_bool_binop_done;
+  }
+  __pyx_t_2 = (__pyx_v_self->_exc_info == ((PyObject*)Py_None));
+  __pyx_t_1 = __pyx_t_2;
+  __pyx_L3_bool_binop_done:;
+  __pyx_r = __pyx_t_1;
+  goto __pyx_L0;
+
+0326:     try:
+
  {
+    /*try:*/ {
+/* … */
+    }
+    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
+    goto __pyx_L8_try_end;
+    __pyx_L3_error:;
+    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+/* … */
+    __Pyx_XGIVEREF(__pyx_t_6);
+    __Pyx_XGIVEREF(__pyx_t_7);
+    __Pyx_XGIVEREF(__pyx_t_8);
+    __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
+    goto __pyx_L1_error;
+    __pyx_L4_exception_handled:;
+    __Pyx_XGIVEREF(__pyx_t_6);
+    __Pyx_XGIVEREF(__pyx_t_7);
+    __Pyx_XGIVEREF(__pyx_t_8);
+    __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
+    __pyx_L8_try_end:;
+  }
+
+0327:         __bool__ = __nonzero__ # Python 3
+
      __Pyx_GetNameInClass(__pyx_t_2, (PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet, __pyx_n_s_nonzero); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 327, __pyx_L3_error)
+      __Pyx_GOTREF(__pyx_t_2);
+      if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet->tp_dict, __pyx_n_s_bool, __pyx_t_2) < 0) __PYX_ERR(0, 327, __pyx_L3_error)
+      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+      PyType_Modified(__pyx_ptype_6gevent_9_greenlet_Greenlet);
+
+0328:     except NameError: # pragma: no cover
+
    __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_NameError);
+    if (__pyx_t_9) {
+      __Pyx_ErrRestore(0,0,0);
+      goto __pyx_L4_exception_handled;
+    }
+    goto __pyx_L5_except_error;
+    __pyx_L5_except_error:;
+
 0329:         # When we're compiled with Cython, the __nonzero__ function
+
 0330:         # goes directly into the slot and can't be accessed by name.
+
 0331:         pass
+
 0332: 
+
 0333:     ### Lifecycle
+
 0334: 
+
+0335:     if _PYPY:
+
  __pyx_t_3 = (__pyx_v_6gevent_9_greenlet__PYPY != 0);
+  if (__pyx_t_3) {
+/* … */
+    goto __pyx_L9;
+  }
+
 0336:         # oops - pypy's .dead relies on __nonzero__ which we overriden above
+
 0337:         @property
+
 0338:         def dead(self):
+
 0339:             "Boolean indicating that the greenlet is dead and will not run again."
+
 0340:             if self._greenlet__main:
+
 0341:                 return False
+
 0342:             if self.__start_cancelled_by_kill() or self.__started_but_aborted():
+
 0343:                 return True
+
 0344: 
+
 0345:             return self._greenlet__started and not _continulet.is_pending(self)
+
 0346:     else:
+
 0347:         @property
+
+0348:         def dead(self):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_4dead_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_4dead_1__get__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_9_greenlet_8Greenlet_4dead___get__(((struct __pyx_obj_6gevent_9_greenlet_Greenlet *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_4dead___get__(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_AddTraceback("gevent._greenlet.Greenlet.dead.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+  /*else*/ {
+  }
+  __pyx_L9:;
+
 0349:             "Boolean indicating that the greenlet is dead and will not run again."
+
+0350:             return self.__start_cancelled_by_kill() or self.__started_but_aborted() or greenlet.dead.__get__(self)
+
  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_2 = ((struct __pyx_vtabstruct_6gevent_9_greenlet_Greenlet *)__pyx_v_self->__pyx_vtab)->__pyx___start_cancelled_by_kill(__pyx_v_self);
+  if (!__pyx_t_2) {
+  } else {
+    __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 350, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __pyx_t_1 = __pyx_t_3;
+    __pyx_t_3 = 0;
+    goto __pyx_L3_bool_binop_done;
+  }
+  __pyx_t_2 = ((struct __pyx_vtabstruct_6gevent_9_greenlet_Greenlet *)__pyx_v_self->__pyx_vtab)->__pyx___started_but_aborted(__pyx_v_self);
+  if (!__pyx_t_2) {
+  } else {
+    __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 350, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __pyx_t_1 = __pyx_t_3;
+    __pyx_t_3 = 0;
+    goto __pyx_L3_bool_binop_done;
+  }
+  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_6gevent_9_greenlet_greenlet), __pyx_n_s_dead); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 350, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_4);
+  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_get); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 350, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_5);
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __pyx_t_4 = NULL;
+  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
+    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
+    if (likely(__pyx_t_4)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
+      __Pyx_INCREF(__pyx_t_4);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_5, function);
+    }
+  }
+  __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_4, ((PyObject *)__pyx_v_self)) : __Pyx_PyObject_CallOneArg(__pyx_t_5, ((PyObject *)__pyx_v_self));
+  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 350, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+  __Pyx_INCREF(__pyx_t_3);
+  __pyx_t_1 = __pyx_t_3;
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __pyx_L3_bool_binop_done:;
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
 0351: 
+
+0352:     def __never_started_or_killed(self):
+
static int __pyx_f_6gevent_9_greenlet_8Greenlet___never_started_or_killed(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__never_started_or_killed", 0);
+/* … */
+  /* function exit code */
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0353:         return self._start_event is None
+
  __pyx_t_1 = (__pyx_v_self->_start_event == Py_None);
+  __pyx_r = __pyx_t_1;
+  goto __pyx_L0;
+
 0354: 
+
+0355:     def __start_pending(self):
+
static int __pyx_f_6gevent_9_greenlet_8Greenlet___start_pending(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__start_pending", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_WriteUnraisable("gevent._greenlet.Greenlet.__start_pending", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0356:         return (self._start_event is not None
+
  __pyx_t_2 = (__pyx_v_self->_start_event != Py_None);
+  __pyx_t_3 = (__pyx_t_2 != 0);
+  if (__pyx_t_3) {
+  } else {
+    __pyx_t_1 = __pyx_t_3;
+    goto __pyx_L3_bool_binop_done;
+  }
+
+0357:                 and (self._start_event.pending or getattr(self._start_event, 'active', False)))
+
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_start_event, __pyx_n_s_pending); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 357, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_4);
+  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 357, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  if (!__pyx_t_3) {
+  } else {
+    __pyx_t_1 = __pyx_t_3;
+    goto __pyx_L3_bool_binop_done;
+  }
+  __pyx_t_4 = __pyx_v_self->_start_event;
+  __Pyx_INCREF(__pyx_t_4);
+  __pyx_t_5 = __Pyx_GetAttr3(__pyx_t_4, __pyx_n_s_active, Py_False); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 357, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_5);
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 357, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+  __pyx_t_1 = __pyx_t_3;
+  __pyx_L3_bool_binop_done:;
+  __pyx_r = __pyx_t_1;
+  goto __pyx_L0;
+
 0358: 
+
+0359:     def __start_cancelled_by_kill(self):
+
static int __pyx_f_6gevent_9_greenlet_8Greenlet___start_cancelled_by_kill(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__start_cancelled_by_kill", 0);
+/* … */
+  /* function exit code */
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0360:         return self._start_event is _cancelled_start_event
+
  __pyx_t_1 = (__pyx_v_self->_start_event == ((PyObject *)__pyx_v_6gevent_9_greenlet__cancelled_start_event));
+  __pyx_r = __pyx_t_1;
+  goto __pyx_L0;
+
 0361: 
+
+0362:     def __start_completed(self):
+
static int __pyx_f_6gevent_9_greenlet_8Greenlet___start_completed(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__start_completed", 0);
+/* … */
+  /* function exit code */
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0363:         return self._start_event is _start_completed_event
+
  __pyx_t_1 = (__pyx_v_self->_start_event == ((PyObject *)__pyx_v_6gevent_9_greenlet__start_completed_event));
+  __pyx_r = __pyx_t_1;
+  goto __pyx_L0;
+
 0364: 
+
+0365:     def __started_but_aborted(self):
+
static int __pyx_f_6gevent_9_greenlet_8Greenlet___started_but_aborted(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__started_but_aborted", 0);
+/* … */
+  /* function exit code */
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0366:         return (not self.__never_started_or_killed() # we have been started or killed
+
  __pyx_t_2 = ((!(((struct __pyx_vtabstruct_6gevent_9_greenlet_Greenlet *)__pyx_v_self->__pyx_vtab)->__pyx___never_started_or_killed(__pyx_v_self) != 0)) != 0);
+  if (__pyx_t_2) {
+  } else {
+    __pyx_t_1 = __pyx_t_2;
+    goto __pyx_L3_bool_binop_done;
+  }
+
+0367:                 and not self.__start_cancelled_by_kill() # we weren't killed, so we must have been started
+
  __pyx_t_2 = ((!(((struct __pyx_vtabstruct_6gevent_9_greenlet_Greenlet *)__pyx_v_self->__pyx_vtab)->__pyx___start_cancelled_by_kill(__pyx_v_self) != 0)) != 0);
+  if (__pyx_t_2) {
+  } else {
+    __pyx_t_1 = __pyx_t_2;
+    goto __pyx_L3_bool_binop_done;
+  }
+
+0368:                 and not self.__start_completed() # the start never completed
+
  __pyx_t_2 = ((!(((struct __pyx_vtabstruct_6gevent_9_greenlet_Greenlet *)__pyx_v_self->__pyx_vtab)->__pyx___start_completed(__pyx_v_self) != 0)) != 0);
+  if (__pyx_t_2) {
+  } else {
+    __pyx_t_1 = __pyx_t_2;
+    goto __pyx_L3_bool_binop_done;
+  }
+
+0369:                 and not self.__start_pending()) # and we're not pending, so we must have been aborted
+
  __pyx_t_2 = ((!(((struct __pyx_vtabstruct_6gevent_9_greenlet_Greenlet *)__pyx_v_self->__pyx_vtab)->__pyx___start_pending(__pyx_v_self) != 0)) != 0);
+  __pyx_t_1 = __pyx_t_2;
+  __pyx_L3_bool_binop_done:;
+  __pyx_r = __pyx_t_1;
+  goto __pyx_L0;
+
 0370: 
+
+0371:     def __cancel_start(self):
+
static PyObject *__pyx_f_6gevent_9_greenlet_8Greenlet___cancel_start(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__cancel_start", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_AddTraceback("gevent._greenlet.Greenlet.__cancel_start", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0372:         if self._start_event is None:
+
  __pyx_t_1 = (__pyx_v_self->_start_event == Py_None);
+  __pyx_t_2 = (__pyx_t_1 != 0);
+  if (__pyx_t_2) {
+/* … */
+  }
+
 0373:             # prevent self from ever being started in the future
+
+0374:             self._start_event = _cancelled_start_event
+
    __Pyx_INCREF(((PyObject *)__pyx_v_6gevent_9_greenlet__cancelled_start_event));
+    __Pyx_GIVEREF(((PyObject *)__pyx_v_6gevent_9_greenlet__cancelled_start_event));
+    __Pyx_GOTREF(__pyx_v_self->_start_event);
+    __Pyx_DECREF(__pyx_v_self->_start_event);
+    __pyx_v_self->_start_event = ((PyObject *)__pyx_v_6gevent_9_greenlet__cancelled_start_event);
+
 0375:         # cancel any pending start event
+
 0376:         # NOTE: If this was a real pending start event, this will leave a
+
 0377:         # "dangling" callback/timer object in the hub.loop.callbacks list;
+
 0378:         # depending on where we are in the event loop, it may even be in a local
+
 0379:         # variable copy of that list (in _run_callbacks). This isn't a problem,
+
 0380:         # except for the leak-tests.
+
+0381:         self._start_event.stop()
+
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_start_event, __pyx_n_s_stop); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 381, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_4);
+  __pyx_t_5 = NULL;
+  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
+    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
+    if (likely(__pyx_t_5)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
+      __Pyx_INCREF(__pyx_t_5);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_4, function);
+    }
+  }
+  __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 381, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+
+0382:         self._start_event.close()
+
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_start_event, __pyx_n_s_close); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 382, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_4);
+  __pyx_t_5 = NULL;
+  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
+    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
+    if (likely(__pyx_t_5)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
+      __Pyx_INCREF(__pyx_t_5);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_4, function);
+    }
+  }
+  __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 382, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+
 0383: 
+
+0384:     def __handle_death_before_start(self, args):
+
static PyObject *__pyx_f_6gevent_9_greenlet_8Greenlet___handle_death_before_start(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self, PyObject *__pyx_v_args) {
+  PyObject *__pyx_v_arg = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__handle_death_before_start", 0);
+  __Pyx_INCREF(__pyx_v_args);
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_6);
+  __Pyx_XDECREF(__pyx_t_7);
+  __Pyx_AddTraceback("gevent._greenlet.Greenlet.__handle_death_before_start", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_arg);
+  __Pyx_XDECREF(__pyx_v_args);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
 0385:         # args is (t, v, tb) or simply t or v
+
+0386:         if self._exc_info is None and self.dead:
+
  __pyx_t_2 = (__pyx_v_self->_exc_info == ((PyObject*)Py_None));
+  __pyx_t_3 = (__pyx_t_2 != 0);
+  if (__pyx_t_3) {
+  } else {
+    __pyx_t_1 = __pyx_t_3;
+    goto __pyx_L4_bool_binop_done;
+  }
+  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_dead); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 386, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_4);
+  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 386, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __pyx_t_1 = __pyx_t_3;
+  __pyx_L4_bool_binop_done:;
+  if (__pyx_t_1) {
+/* … */
+  }
+
 0387:             # the greenlet was never switched to before and it will never be, _report_error was not called
+
 0388:             # the result was not set and the links weren't notified. let's do it here.
+
 0389:             # checking that self.dead is true is essential, because throw() does not necessarily kill the greenlet
+
 0390:             # (if the exception raised by throw() is caught somewhere inside the greenlet).
+
+0391:             if len(args) == 1:
+
    if (unlikely(__pyx_v_args == Py_None)) {
+      PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
+      __PYX_ERR(0, 391, __pyx_L1_error)
+    }
+    __pyx_t_5 = PyTuple_GET_SIZE(__pyx_v_args); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 391, __pyx_L1_error)
+    __pyx_t_1 = ((__pyx_t_5 == 1) != 0);
+    if (__pyx_t_1) {
+/* … */
+      goto __pyx_L6;
+    }
+
+0392:                 arg = args[0]
+
      if (unlikely(__pyx_v_args == Py_None)) {
+        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
+        __PYX_ERR(0, 392, __pyx_L1_error)
+      }
+      __pyx_t_4 = __Pyx_GetItemInt_Tuple(__pyx_v_args, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 392, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_4);
+      __pyx_v_arg = __pyx_t_4;
+      __pyx_t_4 = 0;
+
 0393:                 #if isinstance(arg, type):
+
+0394:                 if type(arg) is type(Exception):
+
      __pyx_t_1 = (((PyObject *)Py_TYPE(__pyx_v_arg)) == ((PyObject *)Py_TYPE(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])))));
+      __pyx_t_3 = (__pyx_t_1 != 0);
+      if (__pyx_t_3) {
+/* … */
+        goto __pyx_L7;
+      }
+
+0395:                     args = (arg, arg(), None)
+
        __Pyx_INCREF(__pyx_v_arg);
+        __pyx_t_6 = __pyx_v_arg; __pyx_t_7 = NULL;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
+          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
+          if (likely(__pyx_t_7)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
+            __Pyx_INCREF(__pyx_t_7);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_6, function);
+          }
+        }
+        __pyx_t_4 = (__pyx_t_7) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7) : __Pyx_PyObject_CallNoArg(__pyx_t_6);
+        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+        if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 395, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_4);
+        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+        __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 395, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_6);
+        __Pyx_INCREF(__pyx_v_arg);
+        __Pyx_GIVEREF(__pyx_v_arg);
+        PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_arg);
+        __Pyx_GIVEREF(__pyx_t_4);
+        PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_4);
+        __Pyx_INCREF(Py_None);
+        __Pyx_GIVEREF(Py_None);
+        PyTuple_SET_ITEM(__pyx_t_6, 2, Py_None);
+        __pyx_t_4 = 0;
+        __Pyx_DECREF_SET(__pyx_v_args, ((PyObject*)__pyx_t_6));
+        __pyx_t_6 = 0;
+
 0396:                 else:
+
+0397:                     args = (type(arg), arg, None)
+
      /*else*/ {
+        __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 397, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_6);
+        __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_arg)));
+        __Pyx_GIVEREF(((PyObject *)Py_TYPE(__pyx_v_arg)));
+        PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)Py_TYPE(__pyx_v_arg)));
+        __Pyx_INCREF(__pyx_v_arg);
+        __Pyx_GIVEREF(__pyx_v_arg);
+        PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_arg);
+        __Pyx_INCREF(Py_None);
+        __Pyx_GIVEREF(Py_None);
+        PyTuple_SET_ITEM(__pyx_t_6, 2, Py_None);
+        __Pyx_DECREF_SET(__pyx_v_args, ((PyObject*)__pyx_t_6));
+        __pyx_t_6 = 0;
+      }
+      __pyx_L7:;
+
+0398:             elif not args:
+
    __pyx_t_3 = (__pyx_v_args != Py_None)&&(PyTuple_GET_SIZE(__pyx_v_args) != 0);
+    __pyx_t_1 = ((!__pyx_t_3) != 0);
+    if (__pyx_t_1) {
+/* … */
+    }
+    __pyx_L6:;
+
+0399:                 args = (GreenletExit, GreenletExit(), None)
+
      __Pyx_INCREF(__pyx_v_6gevent_9_greenlet_GreenletExit);
+      __pyx_t_4 = __pyx_v_6gevent_9_greenlet_GreenletExit; __pyx_t_7 = NULL;
+      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
+        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4);
+        if (likely(__pyx_t_7)) {
+          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
+          __Pyx_INCREF(__pyx_t_7);
+          __Pyx_INCREF(function);
+          __Pyx_DECREF_SET(__pyx_t_4, function);
+        }
+      }
+      __pyx_t_6 = (__pyx_t_7) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_7) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
+      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+      if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 399, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_6);
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 399, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_4);
+      __Pyx_INCREF(__pyx_v_6gevent_9_greenlet_GreenletExit);
+      __Pyx_GIVEREF(__pyx_v_6gevent_9_greenlet_GreenletExit);
+      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_6gevent_9_greenlet_GreenletExit);
+      __Pyx_GIVEREF(__pyx_t_6);
+      PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_6);
+      __Pyx_INCREF(Py_None);
+      __Pyx_GIVEREF(Py_None);
+      PyTuple_SET_ITEM(__pyx_t_4, 2, Py_None);
+      __pyx_t_6 = 0;
+      __Pyx_DECREF_SET(__pyx_v_args, ((PyObject*)__pyx_t_4));
+      __pyx_t_4 = 0;
+
+0400:             self._report_error(args)
+
    __pyx_t_4 = ((struct __pyx_vtabstruct_6gevent_9_greenlet_Greenlet *)__pyx_v_self->__pyx_vtab)->_report_error(__pyx_v_self, __pyx_v_args); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 400, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+
 0401: 
+
 0402:     @property
+
+0403:     def started(self):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_7started_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_7started_1__get__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_9_greenlet_8Greenlet_7started___get__(((struct __pyx_obj_6gevent_9_greenlet_Greenlet *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_7started___get__(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_AddTraceback("gevent._greenlet.Greenlet.started.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
 0404:         # DEPRECATED
+
+0405:         return bool(self)
+
  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_self)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 405, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyBool_FromLong((!(!__pyx_t_1))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 405, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_r = __pyx_t_2;
+  __pyx_t_2 = 0;
+  goto __pyx_L0;
+
 0406: 
+
+0407:     def ready(self):
+
static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_11ready(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static int __pyx_f_6gevent_9_greenlet_8Greenlet_ready(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self, int __pyx_skip_dispatch) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("ready", 0);
+  /* Check if called by wrapper */
+  if (unlikely(__pyx_skip_dispatch)) ;
+  /* Check if overridden in Python */
+  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
+    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
+    if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
+    else {
+      PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      #endif
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_ready); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 407, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_9_greenlet_8Greenlet_11ready)) {
+        __Pyx_INCREF(__pyx_t_1);
+        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+          if (likely(__pyx_t_4)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+            __Pyx_INCREF(__pyx_t_4);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_3, function);
+          }
+        }
+        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
+        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 407, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 407, __pyx_L1_error)
+        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+        __pyx_r = __pyx_t_5;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        goto __pyx_L0;
+      }
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+      tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
+      if (unlikely(type_dict_guard != tp_dict_version)) {
+        tp_dict_version = obj_dict_version = 0;
+      }
+      #endif
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    }
+    #endif
+  }
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_WriteUnraisable("gevent._greenlet.Greenlet.ready", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_11ready(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6gevent_9_greenlet_8Greenlet_10ready[] = "Greenlet.ready(self) -> bool\n\n        Return a true value if and only if the greenlet has finished\n        execution.\n\n        .. versionchanged:: 1.1\n            This function is only guaranteed to return true or false *values*, not\n            necessarily the literal constants ``True`` or ``False``.\n        ";
+static PyMethodDef __pyx_mdef_6gevent_9_greenlet_8Greenlet_11ready = {"ready", (PyCFunction)__pyx_pw_6gevent_9_greenlet_8Greenlet_11ready, METH_NOARGS, __pyx_doc_6gevent_9_greenlet_8Greenlet_10ready};
+static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_11ready(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("ready (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_9_greenlet_8Greenlet_10ready(((struct __pyx_obj_6gevent_9_greenlet_Greenlet *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_10ready(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("ready", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_f_6gevent_9_greenlet_8Greenlet_ready(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 407, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent._greenlet.Greenlet.ready", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__29 = PyTuple_Pack(1, __pyx_n_s_self_2); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(0, 407, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__29);
+  __Pyx_GIVEREF(__pyx_tuple__29);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_9_greenlet_8Greenlet_11ready, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Greenlet_ready, NULL, __pyx_n_s_gevent__greenlet, __pyx_d, ((PyObject *)__pyx_codeobj__30)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 407, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet->tp_dict, __pyx_n_s_ready, __pyx_t_2) < 0) __PYX_ERR(0, 407, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_9_greenlet_Greenlet);
+  __pyx_codeobj__30 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__29, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_greenlet_py, __pyx_n_s_ready, 407, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__30)) __PYX_ERR(0, 407, __pyx_L1_error)
+
 0408:         """
+
 0409:         Return a true value if and only if the greenlet has finished
+
 0410:         execution.
+
 0411: 
+
 0412:         .. versionchanged:: 1.1
+
 0413:             This function is only guaranteed to return true or false *values*, not
+
 0414:             necessarily the literal constants ``True`` or ``False``.
+
 0415:         """
+
+0416:         return self.dead or self._exc_info is not None
+
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_dead); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 416, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 416, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  if (!__pyx_t_6) {
+  } else {
+    __pyx_t_5 = __pyx_t_6;
+    goto __pyx_L3_bool_binop_done;
+  }
+  __pyx_t_6 = (__pyx_v_self->_exc_info != ((PyObject*)Py_None));
+  __pyx_t_7 = (__pyx_t_6 != 0);
+  __pyx_t_5 = __pyx_t_7;
+  __pyx_L3_bool_binop_done:;
+  __pyx_r = __pyx_t_5;
+  goto __pyx_L0;
+
 0417: 
+
+0418:     def successful(self):
+
static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_13successful(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static int __pyx_f_6gevent_9_greenlet_8Greenlet_successful(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self, int __pyx_skip_dispatch) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("successful", 0);
+  /* Check if called by wrapper */
+  if (unlikely(__pyx_skip_dispatch)) ;
+  /* Check if overridden in Python */
+  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
+    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
+    if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
+    else {
+      PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      #endif
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_successful); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 418, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_9_greenlet_8Greenlet_13successful)) {
+        __Pyx_INCREF(__pyx_t_1);
+        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+          if (likely(__pyx_t_4)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+            __Pyx_INCREF(__pyx_t_4);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_3, function);
+          }
+        }
+        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
+        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 418, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 418, __pyx_L1_error)
+        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+        __pyx_r = __pyx_t_5;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        goto __pyx_L0;
+      }
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+      tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
+      if (unlikely(type_dict_guard != tp_dict_version)) {
+        tp_dict_version = obj_dict_version = 0;
+      }
+      #endif
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    }
+    #endif
+  }
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_WriteUnraisable("gevent._greenlet.Greenlet.successful", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_13successful(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6gevent_9_greenlet_8Greenlet_12successful[] = "Greenlet.successful(self) -> bool\n\n        Return a true value if and only if the greenlet has finished execution\n        successfully, that is, without raising an error.\n\n        .. tip:: A greenlet that has been killed with the default\n            :class:`GreenletExit` exception is considered successful.\n            That is, ``GreenletExit`` is not considered an error.\n\n        .. note:: This function is only guaranteed to return true or false *values*,\n              not necessarily the literal constants ``True`` or ``False``.\n        ";
+static PyMethodDef __pyx_mdef_6gevent_9_greenlet_8Greenlet_13successful = {"successful", (PyCFunction)__pyx_pw_6gevent_9_greenlet_8Greenlet_13successful, METH_NOARGS, __pyx_doc_6gevent_9_greenlet_8Greenlet_12successful};
+static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_13successful(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("successful (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_9_greenlet_8Greenlet_12successful(((struct __pyx_obj_6gevent_9_greenlet_Greenlet *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_12successful(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("successful", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_f_6gevent_9_greenlet_8Greenlet_successful(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 418, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent._greenlet.Greenlet.successful", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__31 = PyTuple_Pack(1, __pyx_n_s_self_2); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(0, 418, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__31);
+  __Pyx_GIVEREF(__pyx_tuple__31);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_9_greenlet_8Greenlet_13successful, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Greenlet_successful, NULL, __pyx_n_s_gevent__greenlet, __pyx_d, ((PyObject *)__pyx_codeobj__32)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 418, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet->tp_dict, __pyx_n_s_successful, __pyx_t_2) < 0) __PYX_ERR(0, 418, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_9_greenlet_Greenlet);
+  __pyx_codeobj__32 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__31, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_greenlet_py, __pyx_n_s_successful, 418, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__32)) __PYX_ERR(0, 418, __pyx_L1_error)
+
 0419:         """
+
 0420:         Return a true value if and only if the greenlet has finished execution
+
 0421:         successfully, that is, without raising an error.
+
 0422: 
+
 0423:         .. tip:: A greenlet that has been killed with the default
+
 0424:             :class:`GreenletExit` exception is considered successful.
+
 0425:             That is, ``GreenletExit`` is not considered an error.
+
 0426: 
+
 0427:         .. note:: This function is only guaranteed to return true or false *values*,
+
 0428:               not necessarily the literal constants ``True`` or ``False``.
+
 0429:         """
+
+0430:         return self._exc_info is not None and self._exc_info[1] is None
+
  __pyx_t_6 = (__pyx_v_self->_exc_info != ((PyObject*)Py_None));
+  __pyx_t_7 = (__pyx_t_6 != 0);
+  if (__pyx_t_7) {
+  } else {
+    __pyx_t_5 = __pyx_t_7;
+    goto __pyx_L3_bool_binop_done;
+  }
+  if (unlikely(__pyx_v_self->_exc_info == Py_None)) {
+    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
+    __PYX_ERR(0, 430, __pyx_L1_error)
+  }
+  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v_self->_exc_info, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 430, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_7 = (__pyx_t_1 == Py_None);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_6 = (__pyx_t_7 != 0);
+  __pyx_t_5 = __pyx_t_6;
+  __pyx_L3_bool_binop_done:;
+  __pyx_r = __pyx_t_5;
+  goto __pyx_L0;
+
 0431: 
+
+0432:     def __repr__(self):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_15__repr__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_15__repr__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_9_greenlet_8Greenlet_14__repr__(((struct __pyx_obj_6gevent_9_greenlet_Greenlet *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_14__repr__(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self) {
+  PyObject *__pyx_v_classname = NULL;
+  PyObject *__pyx_v_name = NULL;
+  PyObject *__pyx_v_result = NULL;
+  PyObject *__pyx_v_formatted = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__repr__", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_AddTraceback("gevent._greenlet.Greenlet.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_classname);
+  __Pyx_XDECREF(__pyx_v_name);
+  __Pyx_XDECREF(__pyx_v_result);
+  __Pyx_XDECREF(__pyx_v_formatted);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0433:         classname = self.__class__.__name__
+
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 433, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 433, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_v_classname = __pyx_t_2;
+  __pyx_t_2 = 0;
+
 0434:         # If no name has been assigned, don't generate one, including a minimal_ident,
+
 0435:         # if not necessary. This reduces the use of weak references and associated
+
 0436:         # overhead.
+
+0437:         if 'name' not in self.__dict__ and self._ident is None:
+
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_dict); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 437, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_4 = (__Pyx_PySequence_ContainsTF(__pyx_n_s_name_2, __pyx_t_2, Py_NE)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 437, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_5 = (__pyx_t_4 != 0);
+  if (__pyx_t_5) {
+  } else {
+    __pyx_t_3 = __pyx_t_5;
+    goto __pyx_L4_bool_binop_done;
+  }
+  __pyx_t_5 = (__pyx_v_self->_ident == Py_None);
+  __pyx_t_4 = (__pyx_t_5 != 0);
+  __pyx_t_3 = __pyx_t_4;
+  __pyx_L4_bool_binop_done:;
+  if (__pyx_t_3) {
+/* … */
+    goto __pyx_L3;
+  }
+
+0438:             name = ' '
+
    __Pyx_INCREF(__pyx_kp_s__2);
+    __pyx_v_name = __pyx_kp_s__2;
+
 0439:         else:
+
+0440:             name = ' "%s" ' % (self.name,)
+
  /*else*/ {
+    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_name_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 440, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 440, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_GIVEREF(__pyx_t_2);
+    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
+    __pyx_t_2 = 0;
+    __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_s, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 440, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __pyx_v_name = __pyx_t_2;
+    __pyx_t_2 = 0;
+  }
+  __pyx_L3:;
+
+0441:         result = '<%s%sat %s' % (classname, name, hex(id(self)))
+
  __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 441, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_hex, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 441, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 441, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(__pyx_v_classname);
+  __Pyx_GIVEREF(__pyx_v_classname);
+  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_classname);
+  __Pyx_INCREF(__pyx_v_name);
+  __Pyx_GIVEREF(__pyx_v_name);
+  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_name);
+  __Pyx_GIVEREF(__pyx_t_1);
+  PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_1);
+  __pyx_t_1 = 0;
+  __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_s_sat_s, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 441, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_v_result = ((PyObject*)__pyx_t_1);
+  __pyx_t_1 = 0;
+
+0442:         formatted = self._formatinfo()
+
  __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_9_greenlet_Greenlet *)__pyx_v_self->__pyx_vtab)->_formatinfo(__pyx_v_self, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 442, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_v_formatted = ((PyObject*)__pyx_t_1);
+  __pyx_t_1 = 0;
+
+0443:         if formatted:
+
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_formatted); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 443, __pyx_L1_error)
+  if (__pyx_t_3) {
+/* … */
+  }
+
+0444:             result += ': ' + formatted
+
    __pyx_t_1 = PyNumber_Add(__pyx_kp_s__3, __pyx_v_formatted); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 444, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 444, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_2));
+    __pyx_t_2 = 0;
+
+0445:         return result + '>'
+
  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_2 = PyNumber_Add(__pyx_v_result, __pyx_kp_s__4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 445, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_r = __pyx_t_2;
+  __pyx_t_2 = 0;
+  goto __pyx_L0;
+
 0446: 
+
 0447: 
+
+0448:     def _formatinfo(self):
+
static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_17_formatinfo(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyObject *__pyx_f_6gevent_9_greenlet_8Greenlet__formatinfo(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self, int __pyx_skip_dispatch) {
+  PyObject *__pyx_v_info = NULL;
+  PyObject *__pyx_v_func = NULL;
+  PyObject *__pyx_v_im_self = NULL;
+  PyObject *__pyx_v_funcname = NULL;
+  PyObject *__pyx_v_result = NULL;
+  PyObject *__pyx_v_args = NULL;
+  PyObject *__pyx_7genexpr__pyx_v_x = NULL;
+  PyObject *__pyx_8genexpr1__pyx_v_key = NULL;
+  PyObject *__pyx_8genexpr1__pyx_v_value = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_formatinfo", 0);
+  /* Check if called by wrapper */
+  if (unlikely(__pyx_skip_dispatch)) ;
+  /* Check if overridden in Python */
+  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
+    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
+    if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
+    else {
+      PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      #endif
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_formatinfo); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 448, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_9_greenlet_8Greenlet_17_formatinfo)) {
+        __Pyx_XDECREF(__pyx_r);
+        __Pyx_INCREF(__pyx_t_1);
+        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+          if (likely(__pyx_t_4)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+            __Pyx_INCREF(__pyx_t_4);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_3, function);
+          }
+        }
+        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
+        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 448, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        if (!(likely(PyString_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(0, 448, __pyx_L1_error)
+        __pyx_r = ((PyObject*)__pyx_t_2);
+        __pyx_t_2 = 0;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        goto __pyx_L0;
+      }
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+      tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
+      if (unlikely(type_dict_guard != tp_dict_version)) {
+        tp_dict_version = obj_dict_version = 0;
+      }
+      #endif
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    }
+    #endif
+  }
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_AddTraceback("gevent._greenlet.Greenlet._formatinfo", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_info);
+  __Pyx_XDECREF(__pyx_v_func);
+  __Pyx_XDECREF(__pyx_v_im_self);
+  __Pyx_XDECREF(__pyx_v_funcname);
+  __Pyx_XDECREF(__pyx_v_result);
+  __Pyx_XDECREF(__pyx_v_args);
+  __Pyx_XDECREF(__pyx_7genexpr__pyx_v_x);
+  __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_key);
+  __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_value);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_17_formatinfo(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6gevent_9_greenlet_8Greenlet_16_formatinfo[] = "Greenlet._formatinfo(self) -> str";
+static PyMethodDef __pyx_mdef_6gevent_9_greenlet_8Greenlet_17_formatinfo = {"_formatinfo", (PyCFunction)__pyx_pw_6gevent_9_greenlet_8Greenlet_17_formatinfo, METH_NOARGS, __pyx_doc_6gevent_9_greenlet_8Greenlet_16_formatinfo};
+static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_17_formatinfo(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_formatinfo (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_9_greenlet_8Greenlet_16_formatinfo(((struct __pyx_obj_6gevent_9_greenlet_Greenlet *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_16_formatinfo(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_formatinfo", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __pyx_f_6gevent_9_greenlet_8Greenlet__formatinfo(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 448, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent._greenlet.Greenlet._formatinfo", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__33 = PyTuple_Pack(1, __pyx_n_s_self_2); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(0, 448, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__33);
+  __Pyx_GIVEREF(__pyx_tuple__33);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_9_greenlet_8Greenlet_17_formatinfo, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Greenlet__formatinfo, NULL, __pyx_n_s_gevent__greenlet, __pyx_d, ((PyObject *)__pyx_codeobj__34)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 448, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet->tp_dict, __pyx_n_s_formatinfo, __pyx_t_2) < 0) __PYX_ERR(0, 448, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_9_greenlet_Greenlet);
+  __pyx_codeobj__34 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__33, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_greenlet_py, __pyx_n_s_formatinfo, 448, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__34)) __PYX_ERR(0, 448, __pyx_L1_error)
+
+0449:         info = self._formatted_info
+
  __pyx_t_1 = __pyx_v_self->_formatted_info;
+  __Pyx_INCREF(__pyx_t_1);
+  __pyx_v_info = ((PyObject*)__pyx_t_1);
+  __pyx_t_1 = 0;
+
+0450:         if info is not None:
+
  __pyx_t_5 = (__pyx_v_info != ((PyObject*)Py_None));
+  __pyx_t_6 = (__pyx_t_5 != 0);
+  if (__pyx_t_6) {
+/* … */
+  }
+
+0451:             return info
+
    __Pyx_XDECREF(__pyx_r);
+    __Pyx_INCREF(__pyx_v_info);
+    __pyx_r = __pyx_v_info;
+    goto __pyx_L0;
+
 0452: 
+
 0453:         # Are we running an arbitrary function provided to the constructor,
+
 0454:         # or did a subclass override _run?
+
+0455:         func = self._run
+
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_run_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 455, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_v_func = __pyx_t_1;
+  __pyx_t_1 = 0;
+
+0456:         im_self = getattr(func, '__self__', None)
+
  __pyx_t_1 = __Pyx_GetAttr3(__pyx_v_func, __pyx_n_s_self, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 456, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_v_im_self = __pyx_t_1;
+  __pyx_t_1 = 0;
+
+0457:         if im_self is self:
+
  __pyx_t_6 = (__pyx_v_im_self == ((PyObject *)__pyx_v_self));
+  __pyx_t_5 = (__pyx_t_6 != 0);
+  if (__pyx_t_5) {
+/* … */
+    goto __pyx_L4;
+  }
+
+0458:             funcname = '_run'
+
    __Pyx_INCREF(__pyx_n_s_run_2);
+    __pyx_v_funcname = __pyx_n_s_run_2;
+
+0459:         elif im_self is not None:
+
  __pyx_t_5 = (__pyx_v_im_self != Py_None);
+  __pyx_t_6 = (__pyx_t_5 != 0);
+  if (__pyx_t_6) {
+/* … */
+    goto __pyx_L4;
+  }
+
+0460:             funcname = repr(func)
+
    __pyx_t_1 = PyObject_Repr(__pyx_v_func); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 460, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __pyx_v_funcname = __pyx_t_1;
+    __pyx_t_1 = 0;
+
 0461:         else:
+
+0462:             funcname = getattr(func, '__name__', '') or repr(func)
+
  /*else*/ {
+    __pyx_t_2 = __Pyx_GetAttr3(__pyx_v_func, __pyx_n_s_name, __pyx_kp_s__5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 462, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 462, __pyx_L1_error)
+    if (!__pyx_t_6) {
+      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    } else {
+      __Pyx_INCREF(__pyx_t_2);
+      __pyx_t_1 = __pyx_t_2;
+      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+      goto __pyx_L5_bool_binop_done;
+    }
+    __pyx_t_2 = PyObject_Repr(__pyx_v_func); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 462, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_INCREF(__pyx_t_2);
+    __pyx_t_1 = __pyx_t_2;
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __pyx_L5_bool_binop_done:;
+    __pyx_v_funcname = __pyx_t_1;
+    __pyx_t_1 = 0;
+  }
+  __pyx_L4:;
+
 0463: 
+
+0464:         result = funcname
+
  __Pyx_INCREF(__pyx_v_funcname);
+  __pyx_v_result = __pyx_v_funcname;
+
+0465:         args = []
+
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 465, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_v_args = ((PyObject*)__pyx_t_1);
+  __pyx_t_1 = 0;
+
+0466:         if self.args:
+
  __pyx_t_6 = (__pyx_v_self->args != Py_None)&&(PyTuple_GET_SIZE(__pyx_v_self->args) != 0);
+  if (__pyx_t_6) {
+/* … */
+  }
+
+0467:             args = [repr(x)[:50] for x in self.args]
+
    { /* enter inner scope */
+      __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 467, __pyx_L10_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      if (unlikely(__pyx_v_self->args == Py_None)) {
+        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
+        __PYX_ERR(0, 467, __pyx_L10_error)
+      }
+      __pyx_t_2 = __pyx_v_self->args; __Pyx_INCREF(__pyx_t_2); __pyx_t_7 = 0;
+      for (;;) {
+        if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
+        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+        __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_3); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 467, __pyx_L10_error)
+        #else
+        __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 467, __pyx_L10_error)
+        __Pyx_GOTREF(__pyx_t_3);
+        #endif
+        __Pyx_XDECREF_SET(__pyx_7genexpr__pyx_v_x, __pyx_t_3);
+        __pyx_t_3 = 0;
+        __pyx_t_3 = PyObject_Repr(__pyx_7genexpr__pyx_v_x); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 467, __pyx_L10_error)
+        __Pyx_GOTREF(__pyx_t_3);
+        if (unlikely(__pyx_t_3 == Py_None)) {
+          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
+          __PYX_ERR(0, 467, __pyx_L10_error)
+        }
+        __pyx_t_4 = PySequence_GetSlice(__pyx_t_3, 0, 50); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 467, __pyx_L10_error)
+        __Pyx_GOTREF(__pyx_t_4);
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_4))) __PYX_ERR(0, 467, __pyx_L10_error)
+        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      }
+      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+      __Pyx_XDECREF(__pyx_7genexpr__pyx_v_x); __pyx_7genexpr__pyx_v_x = 0;
+      goto __pyx_L13_exit_scope;
+      __pyx_L10_error:;
+      __Pyx_XDECREF(__pyx_7genexpr__pyx_v_x); __pyx_7genexpr__pyx_v_x = 0;
+      goto __pyx_L1_error;
+      __pyx_L13_exit_scope:;
+    } /* exit inner scope */
+    __Pyx_DECREF_SET(__pyx_v_args, ((PyObject*)__pyx_t_1));
+    __pyx_t_1 = 0;
+
+0468:         if self.kwargs:
+
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_self->kwargs); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 468, __pyx_L1_error)
+  if (__pyx_t_6) {
+/* … */
+  }
+
+0469:             args.extend(['%s=%s' % (key, repr(value)[:50]) for (key, value) in self.kwargs.items()])
+
    { /* enter inner scope */
+      __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 469, __pyx_L17_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      __pyx_t_7 = 0;
+      if (unlikely(__pyx_v_self->kwargs == Py_None)) {
+        PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items");
+        __PYX_ERR(0, 469, __pyx_L17_error)
+      }
+      __pyx_t_4 = __Pyx_dict_iterator(__pyx_v_self->kwargs, 1, __pyx_n_s_items, (&__pyx_t_8), (&__pyx_t_9)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 469, __pyx_L17_error)
+      __Pyx_GOTREF(__pyx_t_4);
+      __Pyx_XDECREF(__pyx_t_2);
+      __pyx_t_2 = __pyx_t_4;
+      __pyx_t_4 = 0;
+      while (1) {
+        __pyx_t_10 = __Pyx_dict_iter_next(__pyx_t_2, __pyx_t_8, &__pyx_t_7, &__pyx_t_4, &__pyx_t_3, NULL, __pyx_t_9);
+        if (unlikely(__pyx_t_10 == 0)) break;
+        if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 469, __pyx_L17_error)
+        __Pyx_GOTREF(__pyx_t_4);
+        __Pyx_GOTREF(__pyx_t_3);
+        __Pyx_XDECREF_SET(__pyx_8genexpr1__pyx_v_key, __pyx_t_4);
+        __pyx_t_4 = 0;
+        __Pyx_XDECREF_SET(__pyx_8genexpr1__pyx_v_value, __pyx_t_3);
+        __pyx_t_3 = 0;
+        __pyx_t_3 = PyObject_Repr(__pyx_8genexpr1__pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 469, __pyx_L17_error)
+        __Pyx_GOTREF(__pyx_t_3);
+        if (unlikely(__pyx_t_3 == Py_None)) {
+          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
+          __PYX_ERR(0, 469, __pyx_L17_error)
+        }
+        __pyx_t_4 = PySequence_GetSlice(__pyx_t_3, 0, 50); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 469, __pyx_L17_error)
+        __Pyx_GOTREF(__pyx_t_4);
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 469, __pyx_L17_error)
+        __Pyx_GOTREF(__pyx_t_3);
+        __Pyx_INCREF(__pyx_8genexpr1__pyx_v_key);
+        __Pyx_GIVEREF(__pyx_8genexpr1__pyx_v_key);
+        PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_8genexpr1__pyx_v_key);
+        __Pyx_GIVEREF(__pyx_t_4);
+        PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_4);
+        __pyx_t_4 = 0;
+        __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_s_s, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 469, __pyx_L17_error)
+        __Pyx_GOTREF(__pyx_t_4);
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_4))) __PYX_ERR(0, 469, __pyx_L17_error)
+        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      }
+      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+      __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_key); __pyx_8genexpr1__pyx_v_key = 0;
+      __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_value); __pyx_8genexpr1__pyx_v_value = 0;
+      goto __pyx_L20_exit_scope;
+      __pyx_L17_error:;
+      __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_key); __pyx_8genexpr1__pyx_v_key = 0;
+      __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_value); __pyx_8genexpr1__pyx_v_value = 0;
+      goto __pyx_L1_error;
+      __pyx_L20_exit_scope:;
+    } /* exit inner scope */
+    __pyx_t_11 = __Pyx_PyList_Extend(__pyx_v_args, __pyx_t_1); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 469, __pyx_L1_error)
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+0470:         if args:
+
  __pyx_t_6 = (PyList_GET_SIZE(__pyx_v_args) != 0);
+  if (__pyx_t_6) {
+/* … */
+  }
+
+0471:             result += '(' + ', '.join(args) + ')'
+
    __pyx_t_1 = __Pyx_PyString_Join(__pyx_kp_s__7, __pyx_v_args); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 471, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __pyx_t_2 = PyNumber_Add(__pyx_kp_s__6, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 471, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __pyx_t_1 = PyNumber_Add(__pyx_t_2, __pyx_kp_s__8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 471, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 471, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_2);
+    __pyx_t_2 = 0;
+
 0472:         # it is important to save the result here, because once the greenlet exits '_run' attribute will be removed
+
+0473:         self._formatted_info = result
+
  if (!(likely(PyString_CheckExact(__pyx_v_result))||((__pyx_v_result) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_v_result)->tp_name), 0))) __PYX_ERR(0, 473, __pyx_L1_error)
+  __pyx_t_2 = __pyx_v_result;
+  __Pyx_INCREF(__pyx_t_2);
+  __Pyx_GIVEREF(__pyx_t_2);
+  __Pyx_GOTREF(__pyx_v_self->_formatted_info);
+  __Pyx_DECREF(__pyx_v_self->_formatted_info);
+  __pyx_v_self->_formatted_info = ((PyObject*)__pyx_t_2);
+  __pyx_t_2 = 0;
+
+0474:         return result
+
  __Pyx_XDECREF(__pyx_r);
+  if (!(likely(PyString_CheckExact(__pyx_v_result))||((__pyx_v_result) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_v_result)->tp_name), 0))) __PYX_ERR(0, 474, __pyx_L1_error)
+  __Pyx_INCREF(__pyx_v_result);
+  __pyx_r = ((PyObject*)__pyx_v_result);
+  goto __pyx_L0;
+
 0475: 
+
 0476:     @property
+
+0477:     def exception(self):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_9exception_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_9exception_1__get__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_9_greenlet_8Greenlet_9exception___get__(((struct __pyx_obj_6gevent_9_greenlet_Greenlet *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_9exception___get__(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_AddTraceback("gevent._greenlet.Greenlet.exception.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
 0478:         """
+
 0479:         Holds the exception instance raised by the function if the
+
 0480:         greenlet has finished with an error. Otherwise ``None``.
+
 0481:         """
+
+0482:         return self._exc_info[1] if self._exc_info is not None else None
+
  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_2 = (__pyx_v_self->_exc_info != ((PyObject*)Py_None));
+  if ((__pyx_t_2 != 0)) {
+    if (unlikely(__pyx_v_self->_exc_info == Py_None)) {
+      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
+      __PYX_ERR(0, 482, __pyx_L1_error)
+    }
+    __pyx_t_3 = __Pyx_GetItemInt_Tuple(__pyx_v_self->_exc_info, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 482, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __pyx_t_1 = __pyx_t_3;
+    __pyx_t_3 = 0;
+  } else {
+    __Pyx_INCREF(Py_None);
+    __pyx_t_1 = Py_None;
+  }
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
 0483: 
+
 0484:     @property
+
+0485:     def exc_info(self):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_8exc_info_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_8exc_info_1__get__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_9_greenlet_8Greenlet_8exc_info___get__(((struct __pyx_obj_6gevent_9_greenlet_Greenlet *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_8exc_info___get__(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self) {
+  PyObject *__pyx_v_ei = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_XDECREF(__pyx_t_6);
+  __Pyx_XDECREF(__pyx_t_7);
+  __Pyx_XDECREF(__pyx_t_8);
+  __Pyx_XDECREF(__pyx_t_9);
+  __Pyx_AddTraceback("gevent._greenlet.Greenlet.exc_info.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_ei);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
 0486:         """
+
 0487:         Holds the exc_info three-tuple raised by the function if the
+
 0488:         greenlet finished with an error. Otherwise a false value.
+
 0489: 
+
 0490:         .. note:: This is a provisional API and may change.
+
 0491: 
+
 0492:         .. versionadded:: 1.1
+
 0493:         """
+
+0494:         ei = self._exc_info
+
  __pyx_t_1 = __pyx_v_self->_exc_info;
+  __Pyx_INCREF(__pyx_t_1);
+  __pyx_v_ei = ((PyObject*)__pyx_t_1);
+  __pyx_t_1 = 0;
+
+0495:         if ei is not None and ei[0] is not None:
+
  __pyx_t_3 = (__pyx_v_ei != ((PyObject*)Py_None));
+  __pyx_t_4 = (__pyx_t_3 != 0);
+  if (__pyx_t_4) {
+  } else {
+    __pyx_t_2 = __pyx_t_4;
+    goto __pyx_L4_bool_binop_done;
+  }
+  if (unlikely(__pyx_v_ei == Py_None)) {
+    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
+    __PYX_ERR(0, 495, __pyx_L1_error)
+  }
+  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v_ei, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 495, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_4 = (__pyx_t_1 != Py_None);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_3 = (__pyx_t_4 != 0);
+  __pyx_t_2 = __pyx_t_3;
+  __pyx_L4_bool_binop_done:;
+  if (__pyx_t_2) {
+/* … */
+  }
+
+0496:             return (ei[0], ei[1], load_traceback(ei[2]))
+
    __Pyx_XDECREF(__pyx_r);
+    if (unlikely(__pyx_v_ei == Py_None)) {
+      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
+      __PYX_ERR(0, 496, __pyx_L1_error)
+    }
+    __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v_ei, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 496, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    if (unlikely(__pyx_v_ei == Py_None)) {
+      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
+      __PYX_ERR(0, 496, __pyx_L1_error)
+    }
+    __pyx_t_5 = __Pyx_GetItemInt_Tuple(__pyx_v_ei, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 496, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_5);
+    if (unlikely(__pyx_v_ei == Py_None)) {
+      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
+      __PYX_ERR(0, 496, __pyx_L1_error)
+    }
+    __pyx_t_7 = __Pyx_GetItemInt_Tuple(__pyx_v_ei, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 496, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_7);
+    __Pyx_INCREF(__pyx_v_6gevent_9_greenlet_load_traceback);
+    __pyx_t_8 = __pyx_v_6gevent_9_greenlet_load_traceback; __pyx_t_9 = NULL;
+    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
+      __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8);
+      if (likely(__pyx_t_9)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
+        __Pyx_INCREF(__pyx_t_9);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_8, function);
+      }
+    }
+    __pyx_t_6 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_9, __pyx_t_7) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_7);
+    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
+    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+    if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 496, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_6);
+    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+    __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 496, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_8);
+    __Pyx_GIVEREF(__pyx_t_1);
+    PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_1);
+    __Pyx_GIVEREF(__pyx_t_5);
+    PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_5);
+    __Pyx_GIVEREF(__pyx_t_6);
+    PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_6);
+    __pyx_t_1 = 0;
+    __pyx_t_5 = 0;
+    __pyx_t_6 = 0;
+    __pyx_r = __pyx_t_8;
+    __pyx_t_8 = 0;
+    goto __pyx_L0;
+
 0497: 
+
+0498:     def throw(self, *args):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_19throw(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_6gevent_9_greenlet_8Greenlet_18throw[] = "Greenlet.throw(self, *args)\nImmediately switch into the greenlet and raise an exception in it.\n\n        Should only be called from the HUB, otherwise the current greenlet is left unscheduled forever.\n        To raise an exception in a safe manner from any greenlet, use :meth:`kill`.\n\n        If a greenlet was started but never switched to yet, then also\n        a) cancel the event that will start it\n        b) fire the notifications as if an exception was raised in a greenlet\n        ";
+static PyMethodDef __pyx_mdef_6gevent_9_greenlet_8Greenlet_19throw = {"throw", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_9_greenlet_8Greenlet_19throw, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_9_greenlet_8Greenlet_18throw};
+static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_19throw(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_args = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("throw (wrapper)", 0);
+  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "throw", 0))) return NULL;
+  __Pyx_INCREF(__pyx_args);
+  __pyx_v_args = __pyx_args;
+  __pyx_r = __pyx_pf_6gevent_9_greenlet_8Greenlet_18throw(((struct __pyx_obj_6gevent_9_greenlet_Greenlet *)__pyx_v_self), __pyx_v_args);
+
+  /* function exit code */
+  __Pyx_XDECREF(__pyx_v_args);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_18throw(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self, PyObject *__pyx_v_args) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("throw", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_AddTraceback("gevent._greenlet.Greenlet.throw", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__35 = PyTuple_Pack(2, __pyx_n_s_self_2, __pyx_n_s_args); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(0, 498, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__35);
+  __Pyx_GIVEREF(__pyx_tuple__35);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_9_greenlet_8Greenlet_19throw, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Greenlet_throw, NULL, __pyx_n_s_gevent__greenlet, __pyx_d, ((PyObject *)__pyx_codeobj__36)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 498, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet->tp_dict, __pyx_n_s_throw, __pyx_t_2) < 0) __PYX_ERR(0, 498, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_9_greenlet_Greenlet);
+  __pyx_codeobj__36 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__35, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_greenlet_py, __pyx_n_s_throw, 498, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__36)) __PYX_ERR(0, 498, __pyx_L1_error)
+
 0499:         """Immediately switch into the greenlet and raise an exception in it.
+
 0500: 
+
 0501:         Should only be called from the HUB, otherwise the current greenlet is left unscheduled forever.
+
 0502:         To raise an exception in a safe manner from any greenlet, use :meth:`kill`.
+
 0503: 
+
 0504:         If a greenlet was started but never switched to yet, then also
+
 0505:         a) cancel the event that will start it
+
 0506:         b) fire the notifications as if an exception was raised in a greenlet
+
 0507:         """
+
+0508:         self.__cancel_start()
+
  __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_9_greenlet_Greenlet *)__pyx_v_self->__pyx_vtab)->__pyx___cancel_start(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 508, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 0509: 
+
+0510:         try:
+
  /*try:*/ {
+
+0511:             if not self.dead:
+
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_dead); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 511, __pyx_L4_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 511, __pyx_L4_error)
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __pyx_t_3 = ((!__pyx_t_2) != 0);
+    if (__pyx_t_3) {
+/* … */
+    }
+  }
+
 0512:                 # Prevent switching into a greenlet *at all* if we had never
+
 0513:                 # started it. Usually this is the same thing that happens by throwing,
+
 0514:                 # but if this is done from the hub with nothing else running, prevents a
+
 0515:                 # LoopExit.
+
+0516:                 greenlet.throw(self, *args)
+
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_6gevent_9_greenlet_greenlet), __pyx_n_s_throw); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 516, __pyx_L4_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 516, __pyx_L4_error)
+      __Pyx_GOTREF(__pyx_t_4);
+      __Pyx_INCREF(((PyObject *)__pyx_v_self));
+      __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
+      PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_self));
+      __pyx_t_5 = PyNumber_Add(__pyx_t_4, __pyx_v_args); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 516, __pyx_L4_error)
+      __Pyx_GOTREF(__pyx_t_5);
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 516, __pyx_L4_error)
+      __Pyx_GOTREF(__pyx_t_4);
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+
 0517:         finally:
+
+0518:             self.__handle_death_before_start(args)
+
  /*finally:*/ {
+    /*normal exit:*/{
+      __pyx_t_4 = ((struct __pyx_vtabstruct_6gevent_9_greenlet_Greenlet *)__pyx_v_self->__pyx_vtab)->__pyx___handle_death_before_start(__pyx_v_self, __pyx_v_args); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 518, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_4);
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      goto __pyx_L5;
+    }
+    __pyx_L4_error:;
+    /*exception exit:*/{
+      __Pyx_PyThreadState_declare
+      __Pyx_PyThreadState_assign
+      __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0;
+      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+      if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14);
+      if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11) < 0)) __Pyx_ErrFetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
+      __Pyx_XGOTREF(__pyx_t_9);
+      __Pyx_XGOTREF(__pyx_t_10);
+      __Pyx_XGOTREF(__pyx_t_11);
+      __Pyx_XGOTREF(__pyx_t_12);
+      __Pyx_XGOTREF(__pyx_t_13);
+      __Pyx_XGOTREF(__pyx_t_14);
+      __pyx_t_6 = __pyx_lineno; __pyx_t_7 = __pyx_clineno; __pyx_t_8 = __pyx_filename;
+      {
+        __pyx_t_4 = ((struct __pyx_vtabstruct_6gevent_9_greenlet_Greenlet *)__pyx_v_self->__pyx_vtab)->__pyx___handle_death_before_start(__pyx_v_self, __pyx_v_args); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 518, __pyx_L8_error)
+        __Pyx_GOTREF(__pyx_t_4);
+        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      }
+      if (PY_MAJOR_VERSION >= 3) {
+        __Pyx_XGIVEREF(__pyx_t_12);
+        __Pyx_XGIVEREF(__pyx_t_13);
+        __Pyx_XGIVEREF(__pyx_t_14);
+        __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14);
+      }
+      __Pyx_XGIVEREF(__pyx_t_9);
+      __Pyx_XGIVEREF(__pyx_t_10);
+      __Pyx_XGIVEREF(__pyx_t_11);
+      __Pyx_ErrRestore(__pyx_t_9, __pyx_t_10, __pyx_t_11);
+      __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0;
+      __pyx_lineno = __pyx_t_6; __pyx_clineno = __pyx_t_7; __pyx_filename = __pyx_t_8;
+      goto __pyx_L1_error;
+      __pyx_L8_error:;
+      if (PY_MAJOR_VERSION >= 3) {
+        __Pyx_XGIVEREF(__pyx_t_12);
+        __Pyx_XGIVEREF(__pyx_t_13);
+        __Pyx_XGIVEREF(__pyx_t_14);
+        __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14);
+      }
+      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
+      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
+      __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
+      __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0;
+      goto __pyx_L1_error;
+    }
+    __pyx_L5:;
+  }
+
 0519: 
+
+0520:     def start(self):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_21start(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6gevent_9_greenlet_8Greenlet_20start[] = "Greenlet.start(self)\nSchedule the greenlet to run in this loop iteration";
+static PyMethodDef __pyx_mdef_6gevent_9_greenlet_8Greenlet_21start = {"start", (PyCFunction)__pyx_pw_6gevent_9_greenlet_8Greenlet_21start, METH_NOARGS, __pyx_doc_6gevent_9_greenlet_8Greenlet_20start};
+static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_21start(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("start (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_9_greenlet_8Greenlet_20start(((struct __pyx_obj_6gevent_9_greenlet_Greenlet *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_20start(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("start", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_XDECREF(__pyx_t_6);
+  __Pyx_AddTraceback("gevent._greenlet.Greenlet.start", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__37 = PyTuple_Pack(1, __pyx_n_s_self_2); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(0, 520, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__37);
+  __Pyx_GIVEREF(__pyx_tuple__37);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_9_greenlet_8Greenlet_21start, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Greenlet_start, NULL, __pyx_n_s_gevent__greenlet, __pyx_d, ((PyObject *)__pyx_codeobj__38)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 520, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet->tp_dict, __pyx_n_s_start, __pyx_t_2) < 0) __PYX_ERR(0, 520, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_9_greenlet_Greenlet);
+  __pyx_codeobj__38 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__37, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_greenlet_py, __pyx_n_s_start, 520, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__38)) __PYX_ERR(0, 520, __pyx_L1_error)
+
 0521:         """Schedule the greenlet to run in this loop iteration"""
+
+0522:         if self._start_event is None:
+
  __pyx_t_1 = (__pyx_v_self->_start_event == Py_None);
+  __pyx_t_2 = (__pyx_t_1 != 0);
+  if (__pyx_t_2) {
+/* … */
+  }
+
+0523:             _call_spawn_callbacks(self)
+
    __pyx_f_6gevent_9_greenlet__call_spawn_callbacks(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 523, __pyx_L1_error)
+
+0524:             self._start_event = self.parent.loop.run_callback(self.switch)
+
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_parent); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 524, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_loop); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 524, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_5);
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_run_callback); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 524, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_switch); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 524, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_5);
+    __pyx_t_6 = NULL;
+    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
+      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
+      if (likely(__pyx_t_6)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
+        __Pyx_INCREF(__pyx_t_6);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_4, function);
+      }
+    }
+    __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_6, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5);
+    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 524, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __Pyx_GIVEREF(__pyx_t_3);
+    __Pyx_GOTREF(__pyx_v_self->_start_event);
+    __Pyx_DECREF(__pyx_v_self->_start_event);
+    __pyx_v_self->_start_event = __pyx_t_3;
+    __pyx_t_3 = 0;
+
 0525: 
+
+0526:     def start_later(self, seconds):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_23start_later(PyObject *__pyx_v_self, PyObject *__pyx_v_seconds); /*proto*/
+static char __pyx_doc_6gevent_9_greenlet_8Greenlet_22start_later[] = "Greenlet.start_later(self, seconds)\n\n        start_later(seconds) -> None\n\n        Schedule the greenlet to run in the future loop iteration\n        *seconds* later\n        ";
+static PyMethodDef __pyx_mdef_6gevent_9_greenlet_8Greenlet_23start_later = {"start_later", (PyCFunction)__pyx_pw_6gevent_9_greenlet_8Greenlet_23start_later, METH_O, __pyx_doc_6gevent_9_greenlet_8Greenlet_22start_later};
+static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_23start_later(PyObject *__pyx_v_self, PyObject *__pyx_v_seconds) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("start_later (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_9_greenlet_8Greenlet_22start_later(((struct __pyx_obj_6gevent_9_greenlet_Greenlet *)__pyx_v_self), ((PyObject *)__pyx_v_seconds));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_22start_later(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self, PyObject *__pyx_v_seconds) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("start_later", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_XDECREF(__pyx_t_6);
+  __Pyx_AddTraceback("gevent._greenlet.Greenlet.start_later", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__39 = PyTuple_Pack(2, __pyx_n_s_self_2, __pyx_n_s_seconds); if (unlikely(!__pyx_tuple__39)) __PYX_ERR(0, 526, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__39);
+  __Pyx_GIVEREF(__pyx_tuple__39);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_9_greenlet_8Greenlet_23start_later, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Greenlet_start_later, NULL, __pyx_n_s_gevent__greenlet, __pyx_d, ((PyObject *)__pyx_codeobj__40)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 526, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet->tp_dict, __pyx_n_s_start_later, __pyx_t_2) < 0) __PYX_ERR(0, 526, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_9_greenlet_Greenlet);
+  __pyx_codeobj__40 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__39, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_greenlet_py, __pyx_n_s_start_later, 526, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__40)) __PYX_ERR(0, 526, __pyx_L1_error)
+
 0527:         """
+
 0528:         start_later(seconds) -> None
+
 0529: 
+
 0530:         Schedule the greenlet to run in the future loop iteration
+
 0531:         *seconds* later
+
 0532:         """
+
+0533:         if self._start_event is None:
+
  __pyx_t_1 = (__pyx_v_self->_start_event == Py_None);
+  __pyx_t_2 = (__pyx_t_1 != 0);
+  if (__pyx_t_2) {
+/* … */
+  }
+
+0534:             _call_spawn_callbacks(self)
+
    __pyx_f_6gevent_9_greenlet__call_spawn_callbacks(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 534, __pyx_L1_error)
+
+0535:             self._start_event = self.parent.loop.timer(seconds)
+
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_parent); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 535, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_loop); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 535, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_5);
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_timer); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 535, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __pyx_t_5 = NULL;
+    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
+      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
+      if (likely(__pyx_t_5)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
+        __Pyx_INCREF(__pyx_t_5);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_4, function);
+      }
+    }
+    __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_v_seconds) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_seconds);
+    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 535, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __Pyx_GIVEREF(__pyx_t_3);
+    __Pyx_GOTREF(__pyx_v_self->_start_event);
+    __Pyx_DECREF(__pyx_v_self->_start_event);
+    __pyx_v_self->_start_event = __pyx_t_3;
+    __pyx_t_3 = 0;
+
+0536:             self._start_event.start(self.switch)
+
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_start_event, __pyx_n_s_start); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 536, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_switch); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 536, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_5);
+    __pyx_t_6 = NULL;
+    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
+      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
+      if (likely(__pyx_t_6)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
+        __Pyx_INCREF(__pyx_t_6);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_4, function);
+      }
+    }
+    __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_6, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5);
+    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 536, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+
 0537: 
+
+0538:     @staticmethod
+
  __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_staticmethod, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 538, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet->tp_dict, __pyx_n_s_add_spawn_callback, __pyx_t_1) < 0) __PYX_ERR(0, 539, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_9_greenlet_Greenlet);
+
+0539:     def add_spawn_callback(callback):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_25add_spawn_callback(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_6gevent_9_greenlet_8Greenlet_24add_spawn_callback[] = "Greenlet.add_spawn_callback(callback)\n\n        add_spawn_callback(callback) -> None\n\n        Set up a *callback* to be invoked when :class:`Greenlet` objects\n        are started.\n\n        The invocation order of spawn callbacks is unspecified.  Adding the\n        same callback more than one time will not cause it to be called more\n        than once.\n\n        .. versionadded:: 1.4.0\n        ";
+static PyMethodDef __pyx_mdef_6gevent_9_greenlet_8Greenlet_25add_spawn_callback = {"add_spawn_callback", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_9_greenlet_8Greenlet_25add_spawn_callback, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_9_greenlet_8Greenlet_24add_spawn_callback};
+static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_25add_spawn_callback(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_callback = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("add_spawn_callback (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_callback,0};
+    PyObject* values[1] = {0};
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_callback)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "add_spawn_callback") < 0)) __PYX_ERR(0, 539, __pyx_L3_error)
+      }
+    } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
+      goto __pyx_L5_argtuple_error;
+    } else {
+      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+    }
+    __pyx_v_callback = values[0];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("add_spawn_callback", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 539, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent._greenlet.Greenlet.add_spawn_callback", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_9_greenlet_8Greenlet_24add_spawn_callback(__pyx_v_callback);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_24add_spawn_callback(PyObject *__pyx_v_callback) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("add_spawn_callback", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_AddTraceback("gevent._greenlet.Greenlet.add_spawn_callback", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__41 = PyTuple_Pack(1, __pyx_n_s_callback); if (unlikely(!__pyx_tuple__41)) __PYX_ERR(0, 539, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__41);
+  __Pyx_GIVEREF(__pyx_tuple__41);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_9_greenlet_8Greenlet_25add_spawn_callback, __Pyx_CYFUNCTION_STATICMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Greenlet_add_spawn_callback, NULL, __pyx_n_s_gevent__greenlet, __pyx_d, ((PyObject *)__pyx_codeobj__42)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 539, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet->tp_dict, __pyx_n_s_add_spawn_callback, __pyx_t_2) < 0) __PYX_ERR(0, 539, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_9_greenlet_Greenlet);
+/* … */
+  __Pyx_GetNameInClass(__pyx_t_2, (PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet, __pyx_n_s_add_spawn_callback); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 539, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_codeobj__42 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__41, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_greenlet_py, __pyx_n_s_add_spawn_callback, 539, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__42)) __PYX_ERR(0, 539, __pyx_L1_error)
+
 0540:         """
+
 0541:         add_spawn_callback(callback) -> None
+
 0542: 
+
 0543:         Set up a *callback* to be invoked when :class:`Greenlet` objects
+
 0544:         are started.
+
 0545: 
+
 0546:         The invocation order of spawn callbacks is unspecified.  Adding the
+
 0547:         same callback more than one time will not cause it to be called more
+
 0548:         than once.
+
 0549: 
+
 0550:         .. versionadded:: 1.4.0
+
 0551:         """
+
 0552:         global _spawn_callbacks
+
+0553:         if _spawn_callbacks is None:  # pylint:disable=used-before-assignment
+
  __pyx_t_1 = (__pyx_v_6gevent_9_greenlet__spawn_callbacks == ((PyObject*)Py_None));
+  __pyx_t_2 = (__pyx_t_1 != 0);
+  if (__pyx_t_2) {
+/* … */
+  }
+
+0554:             _spawn_callbacks = set()
+
    __pyx_t_3 = PySet_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 554, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_XGOTREF(__pyx_v_6gevent_9_greenlet__spawn_callbacks);
+    __Pyx_DECREF_SET(__pyx_v_6gevent_9_greenlet__spawn_callbacks, ((PyObject*)__pyx_t_3));
+    __Pyx_GIVEREF(__pyx_t_3);
+    __pyx_t_3 = 0;
+
+0555:         _spawn_callbacks.add(callback)
+
  if (unlikely(__pyx_v_6gevent_9_greenlet__spawn_callbacks == Py_None)) {
+    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "add");
+    __PYX_ERR(0, 555, __pyx_L1_error)
+  }
+  __pyx_t_4 = PySet_Add(__pyx_v_6gevent_9_greenlet__spawn_callbacks, __pyx_v_callback); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 555, __pyx_L1_error)
+
 0556: 
+
+0557:     @staticmethod
+
  __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_staticmethod, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 557, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet->tp_dict, __pyx_n_s_remove_spawn_callback, __pyx_t_2) < 0) __PYX_ERR(0, 558, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_9_greenlet_Greenlet);
+
+0558:     def remove_spawn_callback(callback):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_27remove_spawn_callback(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_6gevent_9_greenlet_8Greenlet_26remove_spawn_callback[] = "Greenlet.remove_spawn_callback(callback)\n\n        remove_spawn_callback(callback) -> None\n\n        Remove *callback* function added with :meth:`Greenlet.add_spawn_callback`.\n        This function will not fail if *callback* has been already removed or\n        if *callback* was never added.\n\n        .. versionadded:: 1.4.0\n        ";
+static PyMethodDef __pyx_mdef_6gevent_9_greenlet_8Greenlet_27remove_spawn_callback = {"remove_spawn_callback", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_9_greenlet_8Greenlet_27remove_spawn_callback, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_9_greenlet_8Greenlet_26remove_spawn_callback};
+static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_27remove_spawn_callback(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_callback = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("remove_spawn_callback (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_callback,0};
+    PyObject* values[1] = {0};
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_callback)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "remove_spawn_callback") < 0)) __PYX_ERR(0, 558, __pyx_L3_error)
+      }
+    } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
+      goto __pyx_L5_argtuple_error;
+    } else {
+      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+    }
+    __pyx_v_callback = values[0];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("remove_spawn_callback", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 558, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent._greenlet.Greenlet.remove_spawn_callback", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_9_greenlet_8Greenlet_26remove_spawn_callback(__pyx_v_callback);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_26remove_spawn_callback(PyObject *__pyx_v_callback) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("remove_spawn_callback", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_AddTraceback("gevent._greenlet.Greenlet.remove_spawn_callback", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__43 = PyTuple_Pack(1, __pyx_n_s_callback); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(0, 558, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__43);
+  __Pyx_GIVEREF(__pyx_tuple__43);
+/* … */
+  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_9_greenlet_8Greenlet_27remove_spawn_callback, __Pyx_CYFUNCTION_STATICMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Greenlet_remove_spawn_callback, NULL, __pyx_n_s_gevent__greenlet, __pyx_d, ((PyObject *)__pyx_codeobj__44)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 558, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet->tp_dict, __pyx_n_s_remove_spawn_callback, __pyx_t_1) < 0) __PYX_ERR(0, 558, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_9_greenlet_Greenlet);
+/* … */
+  __Pyx_GetNameInClass(__pyx_t_1, (PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet, __pyx_n_s_remove_spawn_callback); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 558, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_codeobj__44 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__43, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_greenlet_py, __pyx_n_s_remove_spawn_callback, 558, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__44)) __PYX_ERR(0, 558, __pyx_L1_error)
+
 0559:         """
+
 0560:         remove_spawn_callback(callback) -> None
+
 0561: 
+
 0562:         Remove *callback* function added with :meth:`Greenlet.add_spawn_callback`.
+
 0563:         This function will not fail if *callback* has been already removed or
+
 0564:         if *callback* was never added.
+
 0565: 
+
 0566:         .. versionadded:: 1.4.0
+
 0567:         """
+
 0568:         global _spawn_callbacks
+
+0569:         if _spawn_callbacks is not None:
+
  __pyx_t_1 = (__pyx_v_6gevent_9_greenlet__spawn_callbacks != ((PyObject*)Py_None));
+  __pyx_t_2 = (__pyx_t_1 != 0);
+  if (__pyx_t_2) {
+/* … */
+  }
+
+0570:             _spawn_callbacks.discard(callback)
+
    if (unlikely(__pyx_v_6gevent_9_greenlet__spawn_callbacks == Py_None)) {
+      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "discard");
+      __PYX_ERR(0, 570, __pyx_L1_error)
+    }
+    __pyx_t_3 = __Pyx_PySet_Discard(__pyx_v_6gevent_9_greenlet__spawn_callbacks, __pyx_v_callback); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 570, __pyx_L1_error)
+
+0571:             if not _spawn_callbacks:
+
    __pyx_t_2 = (__pyx_v_6gevent_9_greenlet__spawn_callbacks != Py_None)&&(PySet_GET_SIZE(__pyx_v_6gevent_9_greenlet__spawn_callbacks) != 0);
+    __pyx_t_1 = ((!__pyx_t_2) != 0);
+    if (__pyx_t_1) {
+/* … */
+    }
+
+0572:                 _spawn_callbacks = None
+
      __Pyx_INCREF(Py_None);
+      __Pyx_XGOTREF(__pyx_v_6gevent_9_greenlet__spawn_callbacks);
+      __Pyx_DECREF_SET(__pyx_v_6gevent_9_greenlet__spawn_callbacks, ((PyObject*)Py_None));
+      __Pyx_GIVEREF(Py_None);
+
 0573: 
+
+0574:     @classmethod
+
  __pyx_t_1 = __Pyx_Method_ClassMethod(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 574, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet->tp_dict, __pyx_n_s_spawn, __pyx_t_1) < 0) __PYX_ERR(0, 575, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_9_greenlet_Greenlet);
+
+0575:     def spawn(cls, *args, **kwargs):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_29spawn(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_6gevent_9_greenlet_8Greenlet_28spawn[] = "Greenlet.spawn(type cls, *args, **kwargs)\n\n        spawn(function, *args, **kwargs) -> Greenlet\n\n        Create a new :class:`Greenlet` object and schedule it to run ``function(*args, **kwargs)``.\n        This can be used as ``gevent.spawn`` or ``Greenlet.spawn``.\n\n        The arguments are passed to :meth:`Greenlet.__init__`.\n\n        .. versionchanged:: 1.1b1\n            If a *function* is given that is not callable, immediately raise a :exc:`TypeError`\n            instead of spawning a greenlet that will raise an uncaught TypeError.\n        ";
+static PyMethodDef __pyx_mdef_6gevent_9_greenlet_8Greenlet_29spawn = {"spawn", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_9_greenlet_8Greenlet_29spawn, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_9_greenlet_8Greenlet_28spawn};
+static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_29spawn(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_args = 0;
+  PyObject *__pyx_v_kwargs = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("spawn (wrapper)", 0);
+  if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "spawn", 1))) return NULL;
+  if (unlikely(__pyx_kwds)) {
+    __pyx_v_kwargs = PyDict_Copy(__pyx_kwds); if (unlikely(!__pyx_v_kwargs)) return NULL;
+    __Pyx_GOTREF(__pyx_v_kwargs);
+  } else {
+    __pyx_v_kwargs = NULL;
+  }
+  __Pyx_INCREF(__pyx_args);
+  __pyx_v_args = __pyx_args;
+  __pyx_r = __pyx_pf_6gevent_9_greenlet_8Greenlet_28spawn(((PyTypeObject*)__pyx_v_cls), __pyx_v_args, __pyx_v_kwargs);
+
+  /* function exit code */
+  __Pyx_XDECREF(__pyx_v_args);
+  __Pyx_XDECREF(__pyx_v_kwargs);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_28spawn(PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) {
+  PyObject *__pyx_v_g = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("spawn", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_AddTraceback("gevent._greenlet.Greenlet.spawn", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_g);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__45 = PyTuple_Pack(4, __pyx_n_s_cls, __pyx_n_s_args, __pyx_n_s_kwargs, __pyx_n_s_g); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(0, 575, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__45);
+  __Pyx_GIVEREF(__pyx_tuple__45);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_9_greenlet_8Greenlet_29spawn, __Pyx_CYFUNCTION_CLASSMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Greenlet_spawn, NULL, __pyx_n_s_gevent__greenlet, __pyx_d, ((PyObject *)__pyx_codeobj__46)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 575, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet->tp_dict, __pyx_n_s_spawn, __pyx_t_2) < 0) __PYX_ERR(0, 575, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_9_greenlet_Greenlet);
+/* … */
+  __Pyx_GetNameInClass(__pyx_t_2, (PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet, __pyx_n_s_spawn); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 575, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_codeobj__46 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__45, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_greenlet_py, __pyx_n_s_spawn, 575, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__46)) __PYX_ERR(0, 575, __pyx_L1_error)
+
 0576:         """
+
 0577:         spawn(function, *args, **kwargs) -> Greenlet
+
 0578: 
+
 0579:         Create a new :class:`Greenlet` object and schedule it to run ``function(*args, **kwargs)``.
+
 0580:         This can be used as ``gevent.spawn`` or ``Greenlet.spawn``.
+
 0581: 
+
 0582:         The arguments are passed to :meth:`Greenlet.__init__`.
+
 0583: 
+
 0584:         .. versionchanged:: 1.1b1
+
 0585:             If a *function* is given that is not callable, immediately raise a :exc:`TypeError`
+
 0586:             instead of spawning a greenlet that will raise an uncaught TypeError.
+
 0587:         """
+
+0588:         g = cls(*args, **kwargs)
+
  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_v_cls), __pyx_v_args, __pyx_v_kwargs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 588, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_v_g = __pyx_t_1;
+  __pyx_t_1 = 0;
+
+0589:         g.start()
+
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_g, __pyx_n_s_start); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 589, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = NULL;
+  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+    if (likely(__pyx_t_3)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+      __Pyx_INCREF(__pyx_t_3);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_2, function);
+    }
+  }
+  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 589, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+0590:         return g
+
  __Pyx_XDECREF(__pyx_r);
+  __Pyx_INCREF(__pyx_v_g);
+  __pyx_r = __pyx_v_g;
+  goto __pyx_L0;
+
 0591: 
+
+0592:     @classmethod
+
  __pyx_t_2 = __Pyx_Method_ClassMethod(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 592, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet->tp_dict, __pyx_n_s_spawn_later, __pyx_t_2) < 0) __PYX_ERR(0, 593, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_9_greenlet_Greenlet);
+
+0593:     def spawn_later(cls, seconds, *args, **kwargs):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_31spawn_later(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_6gevent_9_greenlet_8Greenlet_30spawn_later[] = "Greenlet.spawn_later(type cls, seconds, *args, **kwargs)\n\n        spawn_later(seconds, function, *args, **kwargs) -> Greenlet\n\n        Create and return a new `Greenlet` object scheduled to run ``function(*args, **kwargs)``\n        in a future loop iteration *seconds* later. This can be used as ``Greenlet.spawn_later``\n        or ``gevent.spawn_later``.\n\n        The arguments are passed to :meth:`Greenlet.__init__`.\n\n        .. versionchanged:: 1.1b1\n           If an argument that's meant to be a function (the first argument in *args*, or the ``run`` keyword )\n           is given to this classmethod (and not a classmethod of a subclass),\n           it is verified to be callable. Previously, the spawned greenlet would have failed\n           when it started running.\n        ";
+static PyMethodDef __pyx_mdef_6gevent_9_greenlet_8Greenlet_31spawn_later = {"spawn_later", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_9_greenlet_8Greenlet_31spawn_later, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_9_greenlet_8Greenlet_30spawn_later};
+static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_31spawn_later(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_seconds = 0;
+  PyObject *__pyx_v_args = 0;
+  PyObject *__pyx_v_kwargs = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("spawn_later (wrapper)", 0);
+  __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL;
+  __Pyx_GOTREF(__pyx_v_kwargs);
+  if (PyTuple_GET_SIZE(__pyx_args) > 1) {
+    __pyx_v_args = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args));
+    if (unlikely(!__pyx_v_args)) {
+      __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
+      __Pyx_RefNannyFinishContext();
+      return NULL;
+    }
+    __Pyx_GOTREF(__pyx_v_args);
+  } else {
+    __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple);
+  }
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_seconds,0};
+    PyObject* values[1] = {0};
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        default:
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_seconds)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+      }
+      if (unlikely(kw_args > 0)) {
+        const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1;
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, used_pos_args, "spawn_later") < 0)) __PYX_ERR(0, 593, __pyx_L3_error)
+      }
+    } else if (PyTuple_GET_SIZE(__pyx_args) < 1) {
+      goto __pyx_L5_argtuple_error;
+    } else {
+      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+    }
+    __pyx_v_seconds = values[0];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("spawn_later", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 593, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0;
+  __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
+  __Pyx_AddTraceback("gevent._greenlet.Greenlet.spawn_later", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_9_greenlet_8Greenlet_30spawn_later(((PyTypeObject*)__pyx_v_cls), __pyx_v_seconds, __pyx_v_args, __pyx_v_kwargs);
+
+  /* function exit code */
+  __Pyx_XDECREF(__pyx_v_args);
+  __Pyx_XDECREF(__pyx_v_kwargs);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_30spawn_later(PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_seconds, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) {
+  PyObject *__pyx_v_g = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("spawn_later", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_XDECREF(__pyx_t_6);
+  __Pyx_AddTraceback("gevent._greenlet.Greenlet.spawn_later", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_g);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__47 = PyTuple_Pack(5, __pyx_n_s_cls, __pyx_n_s_seconds, __pyx_n_s_args, __pyx_n_s_kwargs, __pyx_n_s_g); if (unlikely(!__pyx_tuple__47)) __PYX_ERR(0, 593, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__47);
+  __Pyx_GIVEREF(__pyx_tuple__47);
+/* … */
+  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_9_greenlet_8Greenlet_31spawn_later, __Pyx_CYFUNCTION_CLASSMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Greenlet_spawn_later, NULL, __pyx_n_s_gevent__greenlet, __pyx_d, ((PyObject *)__pyx_codeobj__48)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 593, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet->tp_dict, __pyx_n_s_spawn_later, __pyx_t_1) < 0) __PYX_ERR(0, 593, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_9_greenlet_Greenlet);
+/* … */
+  __Pyx_GetNameInClass(__pyx_t_1, (PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet, __pyx_n_s_spawn_later); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 593, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_codeobj__48 = (PyObject*)__Pyx_PyCode_New(2, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__47, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_greenlet_py, __pyx_n_s_spawn_later, 593, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__48)) __PYX_ERR(0, 593, __pyx_L1_error)
+
 0594:         """
+
 0595:         spawn_later(seconds, function, *args, **kwargs) -> Greenlet
+
 0596: 
+
 0597:         Create and return a new `Greenlet` object scheduled to run ``function(*args, **kwargs)``
+
 0598:         in a future loop iteration *seconds* later. This can be used as ``Greenlet.spawn_later``
+
 0599:         or ``gevent.spawn_later``.
+
 0600: 
+
 0601:         The arguments are passed to :meth:`Greenlet.__init__`.
+
 0602: 
+
 0603:         .. versionchanged:: 1.1b1
+
 0604:            If an argument that's meant to be a function (the first argument in *args*, or the ``run`` keyword )
+
 0605:            is given to this classmethod (and not a classmethod of a subclass),
+
 0606:            it is verified to be callable. Previously, the spawned greenlet would have failed
+
 0607:            when it started running.
+
 0608:         """
+
+0609:         if cls is Greenlet and not args and 'run' not in kwargs:
+
  __pyx_t_2 = (__pyx_v_cls == __pyx_ptype_6gevent_9_greenlet_Greenlet);
+  __pyx_t_3 = (__pyx_t_2 != 0);
+  if (__pyx_t_3) {
+  } else {
+    __pyx_t_1 = __pyx_t_3;
+    goto __pyx_L4_bool_binop_done;
+  }
+  __pyx_t_3 = (PyTuple_GET_SIZE(__pyx_v_args) != 0);
+  __pyx_t_2 = ((!__pyx_t_3) != 0);
+  if (__pyx_t_2) {
+  } else {
+    __pyx_t_1 = __pyx_t_2;
+    goto __pyx_L4_bool_binop_done;
+  }
+  __pyx_t_2 = (__Pyx_PyDict_ContainsTF(__pyx_n_s_run, __pyx_v_kwargs, Py_NE)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 609, __pyx_L1_error)
+  __pyx_t_3 = (__pyx_t_2 != 0);
+  __pyx_t_1 = __pyx_t_3;
+  __pyx_L4_bool_binop_done:;
+  if (unlikely(__pyx_t_1)) {
+/* … */
+  }
+
+0610:             raise TypeError("")
+
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 610, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __PYX_ERR(0, 610, __pyx_L1_error)
+/* … */
+  __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_s__5); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 610, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__9);
+  __Pyx_GIVEREF(__pyx_tuple__9);
+
+0611:         g = cls(*args, **kwargs)
+
  __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_v_cls), __pyx_v_args, __pyx_v_kwargs); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 611, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_4);
+  __pyx_v_g = __pyx_t_4;
+  __pyx_t_4 = 0;
+
+0612:         g.start_later(seconds)
+
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_g, __pyx_n_s_start_later); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 612, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_5);
+  __pyx_t_6 = NULL;
+  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
+    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
+    if (likely(__pyx_t_6)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
+      __Pyx_INCREF(__pyx_t_6);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_5, function);
+    }
+  }
+  __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_v_seconds) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_seconds);
+  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 612, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_4);
+  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+
+0613:         return g
+
  __Pyx_XDECREF(__pyx_r);
+  __Pyx_INCREF(__pyx_v_g);
+  __pyx_r = __pyx_v_g;
+  goto __pyx_L0;
+
 0614: 
+
+0615:     def kill(self, exception=GreenletExit, block=True, timeout=None):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_33kill(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_6gevent_9_greenlet_8Greenlet_32kill[] = "Greenlet.kill(self, exception=GreenletExit, block=True, timeout=None)\n\n        Raise the ``exception`` in the greenlet.\n\n        If ``block`` is ``True`` (the default), wait until the greenlet dies or the optional timeout expires.\n        If block is ``False``, the current greenlet is not unscheduled.\n\n        The function always returns ``None`` and never raises an error.\n\n        .. note::\n\n            Depending on what this greenlet is executing and the state\n            of the event loop, the exception may or may not be raised\n            immediately when this greenlet resumes execution. It may\n            be raised on a subsequent green call, or, if this greenlet\n            exits before making such a call, it may not be raised at\n            all. As of 1.1, an example where the exception is raised\n            later is if this greenlet had called :func:`sleep(0)\n            <gevent.sleep>`; an example where the exception is raised\n            immediately is if this greenlet had called\n            :func:`sleep(0.1) <gevent.sleep>`.\n\n        .. caution::\n\n            Use care when killing greenlets. If the code executing is not\n            exception safe (e.g., makes proper use of ``finally``) then an\n            unexpected exception could result in corrupted state.\n\n        See also :func:`gevent.kill`.\n\n        :keyword type exception: The type of exception to raise in the greenlet. The default\n            is :class:`GreenletExit`, which indicates a :meth:`successful` completion\n            of the greenlet.\n\n        .. versionchanged:: 0.13.0\n            *block* is now ``True`` by default.\n        .. versionchanged:: 1.1a2\n            If this greenlet had never been switched to, killing it will prevent it from ever being switched to.\n        ";
+static PyMethodDef __pyx_mdef_6gevent_9_greenlet_8Greenlet_33kill = {"kill", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_9_greenlet_8Greenlet_33kill, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_9_greenlet_8Greenlet_32kill};
+static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_33kill(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_exception = 0;
+  PyObject *__pyx_v_block = 0;
+  PyObject *__pyx_v_timeout = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("kill (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_exception,&__pyx_n_s_block,&__pyx_n_s_timeout,0};
+    PyObject* values[3] = {0,0,0};
+    values[0] = __pyx_k__10;
+    values[1] = ((PyObject *)Py_True);
+    values[2] = ((PyObject *)Py_None);
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_exception);
+          if (value) { values[0] = value; kw_args--; }
+        }
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_block);
+          if (value) { values[1] = value; kw_args--; }
+        }
+        CYTHON_FALLTHROUGH;
+        case  2:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_timeout);
+          if (value) { values[2] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "kill") < 0)) __PYX_ERR(0, 615, __pyx_L3_error)
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    __pyx_v_exception = values[0];
+    __pyx_v_block = values[1];
+    __pyx_v_timeout = values[2];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("kill", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 615, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent._greenlet.Greenlet.kill", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_9_greenlet_8Greenlet_32kill(((struct __pyx_obj_6gevent_9_greenlet_Greenlet *)__pyx_v_self), __pyx_v_exception, __pyx_v_block, __pyx_v_timeout);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_32kill(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self, PyObject *__pyx_v_exception, PyObject *__pyx_v_block, PyObject *__pyx_v_timeout) {
+  PyObject *__pyx_v_waiter = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("kill", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_XDECREF(__pyx_t_7);
+  __Pyx_AddTraceback("gevent._greenlet.Greenlet.kill", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_waiter);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __Pyx_INCREF(__pyx_v_6gevent_9_greenlet_GreenletExit);
+  __pyx_k__10 = __pyx_v_6gevent_9_greenlet_GreenletExit;
+  __Pyx_GIVEREF(__pyx_v_6gevent_9_greenlet_GreenletExit);
+/* … */
+  __pyx_tuple__49 = PyTuple_Pack(5, __pyx_n_s_self_2, __pyx_n_s_exception, __pyx_n_s_block, __pyx_n_s_timeout, __pyx_n_s_waiter); if (unlikely(!__pyx_tuple__49)) __PYX_ERR(0, 615, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__49);
+  __Pyx_GIVEREF(__pyx_tuple__49);
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_9_greenlet_8Greenlet_33kill, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Greenlet_kill, NULL, __pyx_n_s_gevent__greenlet, __pyx_d, ((PyObject *)__pyx_codeobj__50)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 615, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet->tp_dict, __pyx_n_s_kill_2, __pyx_t_2) < 0) __PYX_ERR(0, 615, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_9_greenlet_Greenlet);
+  __pyx_codeobj__50 = (PyObject*)__Pyx_PyCode_New(4, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__49, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_greenlet_py, __pyx_n_s_kill_2, 615, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__50)) __PYX_ERR(0, 615, __pyx_L1_error)
+
 0616:         """
+
 0617:         Raise the ``exception`` in the greenlet.
+
 0618: 
+
 0619:         If ``block`` is ``True`` (the default), wait until the greenlet dies or the optional timeout expires.
+
 0620:         If block is ``False``, the current greenlet is not unscheduled.
+
 0621: 
+
 0622:         The function always returns ``None`` and never raises an error.
+
 0623: 
+
 0624:         .. note::
+
 0625: 
+
 0626:             Depending on what this greenlet is executing and the state
+
 0627:             of the event loop, the exception may or may not be raised
+
 0628:             immediately when this greenlet resumes execution. It may
+
 0629:             be raised on a subsequent green call, or, if this greenlet
+
 0630:             exits before making such a call, it may not be raised at
+
 0631:             all. As of 1.1, an example where the exception is raised
+
 0632:             later is if this greenlet had called :func:`sleep(0)
+
 0633:             <gevent.sleep>`; an example where the exception is raised
+
 0634:             immediately is if this greenlet had called
+
 0635:             :func:`sleep(0.1) <gevent.sleep>`.
+
 0636: 
+
 0637:         .. caution::
+
 0638: 
+
 0639:             Use care when killing greenlets. If the code executing is not
+
 0640:             exception safe (e.g., makes proper use of ``finally``) then an
+
 0641:             unexpected exception could result in corrupted state.
+
 0642: 
+
 0643:         See also :func:`gevent.kill`.
+
 0644: 
+
 0645:         :keyword type exception: The type of exception to raise in the greenlet. The default
+
 0646:             is :class:`GreenletExit`, which indicates a :meth:`successful` completion
+
 0647:             of the greenlet.
+
 0648: 
+
 0649:         .. versionchanged:: 0.13.0
+
 0650:             *block* is now ``True`` by default.
+
 0651:         .. versionchanged:: 1.1a2
+
 0652:             If this greenlet had never been switched to, killing it will prevent it from ever being switched to.
+
 0653:         """
+
+0654:         self.__cancel_start()
+
  __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_9_greenlet_Greenlet *)__pyx_v_self->__pyx_vtab)->__pyx___cancel_start(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 654, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 0655: 
+
+0656:         if self.dead:
+
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_dead); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 656, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 656, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  if (__pyx_t_2) {
+/* … */
+    goto __pyx_L3;
+  }
+
+0657:             self.__handle_death_before_start((exception,))
+
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 657, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_INCREF(__pyx_v_exception);
+    __Pyx_GIVEREF(__pyx_v_exception);
+    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_exception);
+    __pyx_t_3 = ((struct __pyx_vtabstruct_6gevent_9_greenlet_Greenlet *)__pyx_v_self->__pyx_vtab)->__pyx___handle_death_before_start(__pyx_v_self, ((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 657, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+
 0658:         else:
+
+0659:             waiter = Waiter() if block else None # pylint:disable=undefined-variable
+
  /*else*/ {
+    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_block); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 659, __pyx_L1_error)
+    if (__pyx_t_2) {
+      __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_6gevent_8__waiter_Waiter)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 659, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      __pyx_t_3 = __pyx_t_1;
+      __pyx_t_1 = 0;
+    } else {
+      __Pyx_INCREF(Py_None);
+      __pyx_t_3 = Py_None;
+    }
+    __pyx_v_waiter = __pyx_t_3;
+    __pyx_t_3 = 0;
+
+0660:             self.parent.loop.run_callback(_kill, self, exception, waiter)
+
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_parent); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 660, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_loop); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 660, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_run_callback); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 660, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_kill); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 660, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    __pyx_t_5 = NULL;
+    __pyx_t_6 = 0;
+    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
+      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
+      if (likely(__pyx_t_5)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
+        __Pyx_INCREF(__pyx_t_5);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_1, function);
+        __pyx_t_6 = 1;
+      }
+    }
+    #if CYTHON_FAST_PYCALL
+    if (PyFunction_Check(__pyx_t_1)) {
+      PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_t_4, ((PyObject *)__pyx_v_self), __pyx_v_exception, __pyx_v_waiter};
+      __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_6, 4+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 660, __pyx_L1_error)
+      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+      __Pyx_GOTREF(__pyx_t_3);
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    } else
+    #endif
+    #if CYTHON_FAST_PYCCALL
+    if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
+      PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_t_4, ((PyObject *)__pyx_v_self), __pyx_v_exception, __pyx_v_waiter};
+      __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_6, 4+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 660, __pyx_L1_error)
+      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+      __Pyx_GOTREF(__pyx_t_3);
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    } else
+    #endif
+    {
+      __pyx_t_7 = PyTuple_New(4+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 660, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_7);
+      if (__pyx_t_5) {
+        __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
+      }
+      __Pyx_GIVEREF(__pyx_t_4);
+      PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_t_4);
+      __Pyx_INCREF(((PyObject *)__pyx_v_self));
+      __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
+      PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, ((PyObject *)__pyx_v_self));
+      __Pyx_INCREF(__pyx_v_exception);
+      __Pyx_GIVEREF(__pyx_v_exception);
+      PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_6, __pyx_v_exception);
+      __Pyx_INCREF(__pyx_v_waiter);
+      __Pyx_GIVEREF(__pyx_v_waiter);
+      PyTuple_SET_ITEM(__pyx_t_7, 3+__pyx_t_6, __pyx_v_waiter);
+      __pyx_t_4 = 0;
+      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 660, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_3);
+      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+    }
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+
+0661:             if block:
+
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_block); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 661, __pyx_L1_error)
+    if (__pyx_t_2) {
+/* … */
+    }
+  }
+  __pyx_L3:;
+
+0662:                 waiter.get()
+
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_waiter, __pyx_n_s_get_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 662, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      __pyx_t_7 = NULL;
+      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
+        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_1);
+        if (likely(__pyx_t_7)) {
+          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
+          __Pyx_INCREF(__pyx_t_7);
+          __Pyx_INCREF(function);
+          __Pyx_DECREF_SET(__pyx_t_1, function);
+        }
+      }
+      __pyx_t_3 = (__pyx_t_7) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_7) : __Pyx_PyObject_CallNoArg(__pyx_t_1);
+      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 662, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_3);
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+
+0663:                 self.join(timeout)
+
      __pyx_t_8.__pyx_n = 1;
+      __pyx_t_8.timeout = __pyx_v_timeout;
+      __pyx_t_3 = ((struct __pyx_vtabstruct_6gevent_9_greenlet_Greenlet *)__pyx_v_self->__pyx_vtab)->join(__pyx_v_self, 0, &__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 663, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_3);
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+
 0664:         # it should be OK to use kill() in finally or kill a greenlet from more than one place;
+
 0665:         # thus it should not raise when the greenlet is already killed (= not started)
+
 0666: 
+
+0667:     def get(self, block=True, timeout=None):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_35get(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_6gevent_9_greenlet_8Greenlet_34get[] = "Greenlet.get(self, block=True, timeout=None)\n\n        get(block=True, timeout=None) -> object\n\n        Return the result the greenlet has returned or re-raise the\n        exception it has raised.\n\n        If block is ``False``, raise :class:`gevent.Timeout` if the\n        greenlet is still alive. If block is ``True``, unschedule the\n        current greenlet until the result is available or the timeout\n        expires. In the latter case, :class:`gevent.Timeout` is\n        raised.\n        ";
+static PyMethodDef __pyx_mdef_6gevent_9_greenlet_8Greenlet_35get = {"get", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_9_greenlet_8Greenlet_35get, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_9_greenlet_8Greenlet_34get};
+static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_35get(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_block = 0;
+  PyObject *__pyx_v_timeout = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("get (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_block,&__pyx_n_s_timeout,0};
+    PyObject* values[2] = {0,0};
+    values[0] = ((PyObject *)Py_True);
+    values[1] = ((PyObject *)Py_None);
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_block);
+          if (value) { values[0] = value; kw_args--; }
+        }
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_timeout);
+          if (value) { values[1] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get") < 0)) __PYX_ERR(0, 667, __pyx_L3_error)
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    __pyx_v_block = values[0];
+    __pyx_v_timeout = values[1];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("get", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 667, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent._greenlet.Greenlet.get", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_9_greenlet_8Greenlet_34get(((struct __pyx_obj_6gevent_9_greenlet_Greenlet *)__pyx_v_self), __pyx_v_block, __pyx_v_timeout);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_34get(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self, PyObject *__pyx_v_block, PyObject *__pyx_v_timeout) {
+  PyObject *__pyx_v_switch = NULL;
+  PyObject *__pyx_v_t = NULL;
+  PyObject *__pyx_v_result = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("get", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_9);
+  __Pyx_XDECREF(__pyx_t_19);
+  __Pyx_XDECREF(__pyx_t_20);
+  __Pyx_AddTraceback("gevent._greenlet.Greenlet.get", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_switch);
+  __Pyx_XDECREF(__pyx_v_t);
+  __Pyx_XDECREF(__pyx_v_result);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__51 = PyTuple_Pack(6, __pyx_n_s_self_2, __pyx_n_s_block, __pyx_n_s_timeout, __pyx_n_s_switch, __pyx_n_s_t, __pyx_n_s_result); if (unlikely(!__pyx_tuple__51)) __PYX_ERR(0, 667, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__51);
+  __Pyx_GIVEREF(__pyx_tuple__51);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_9_greenlet_8Greenlet_35get, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Greenlet_get, NULL, __pyx_n_s_gevent__greenlet, __pyx_d, ((PyObject *)__pyx_codeobj__52)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 667, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet->tp_dict, __pyx_n_s_get_2, __pyx_t_2) < 0) __PYX_ERR(0, 667, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_9_greenlet_Greenlet);
+  __pyx_codeobj__52 = (PyObject*)__Pyx_PyCode_New(3, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__51, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_greenlet_py, __pyx_n_s_get_2, 667, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__52)) __PYX_ERR(0, 667, __pyx_L1_error)
+
 0668:         """
+
 0669:         get(block=True, timeout=None) -> object
+
 0670: 
+
 0671:         Return the result the greenlet has returned or re-raise the
+
 0672:         exception it has raised.
+
 0673: 
+
 0674:         If block is ``False``, raise :class:`gevent.Timeout` if the
+
 0675:         greenlet is still alive. If block is ``True``, unschedule the
+
 0676:         current greenlet until the result is available or the timeout
+
 0677:         expires. In the latter case, :class:`gevent.Timeout` is
+
 0678:         raised.
+
 0679:         """
+
+0680:         if self.ready():
+
  __pyx_t_1 = (((struct __pyx_vtabstruct_6gevent_9_greenlet_Greenlet *)__pyx_v_self->__pyx_vtab)->ready(__pyx_v_self, 0) != 0);
+  if (__pyx_t_1) {
+/* … */
+  }
+
+0681:             if self.successful():
+
    __pyx_t_1 = (((struct __pyx_vtabstruct_6gevent_9_greenlet_Greenlet *)__pyx_v_self->__pyx_vtab)->successful(__pyx_v_self, 0) != 0);
+    if (__pyx_t_1) {
+/* … */
+    }
+
+0682:                 return self.value
+
      __Pyx_XDECREF(__pyx_r);
+      __Pyx_INCREF(__pyx_v_self->value);
+      __pyx_r = __pyx_v_self->value;
+      goto __pyx_L0;
+
+0683:             self._raise_exception()
+
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_raise_exception); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 683, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __pyx_t_4 = NULL;
+    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
+      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+      if (likely(__pyx_t_4)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+        __Pyx_INCREF(__pyx_t_4);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_3, function);
+      }
+    }
+    __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
+    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 683, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+0684:         if not block:
+
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_block); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 684, __pyx_L1_error)
+  __pyx_t_5 = ((!__pyx_t_1) != 0);
+  if (unlikely(__pyx_t_5)) {
+/* … */
+  }
+
+0685:             raise Timeout()
+
    __Pyx_INCREF(__pyx_v_6gevent_9_greenlet_Timeout);
+    __pyx_t_3 = __pyx_v_6gevent_9_greenlet_Timeout; __pyx_t_4 = NULL;
+    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+      if (likely(__pyx_t_4)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+        __Pyx_INCREF(__pyx_t_4);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_3, function);
+      }
+    }
+    __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
+    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 685, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __PYX_ERR(0, 685, __pyx_L1_error)
+
 0686: 
+
+0687:         switch = getcurrent().switch # pylint:disable=undefined-variable
+
  __pyx_t_2 = ((PyObject *)__pyx_f_6gevent_9_greenlet_getcurrent()); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 687, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_switch); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 687, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_v_switch = __pyx_t_3;
+  __pyx_t_3 = 0;
+
+0688:         self.rawlink(switch)
+
  __pyx_t_3 = ((struct __pyx_vtabstruct_6gevent_9_greenlet_Greenlet *)__pyx_v_self->__pyx_vtab)->rawlink(__pyx_v_self, __pyx_v_switch, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 688, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+
+0689:         try:
+
  {
+    /*try:*/ {
+/* … */
+    }
+    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
+    goto __pyx_L11_try_end;
+    __pyx_L6_error:;
+    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
+    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+/* … */
+    __Pyx_XGIVEREF(__pyx_t_6);
+    __Pyx_XGIVEREF(__pyx_t_7);
+    __Pyx_XGIVEREF(__pyx_t_8);
+    __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
+    goto __pyx_L1_error;
+    __pyx_L11_try_end:;
+  }
+
+0690:             t = Timeout._start_new_or_dummy(timeout)
+
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_6gevent_9_greenlet_Timeout, __pyx_n_s_start_new_or_dummy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 690, __pyx_L6_error)
+      __Pyx_GOTREF(__pyx_t_2);
+      __pyx_t_4 = NULL;
+      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
+        if (likely(__pyx_t_4)) {
+          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+          __Pyx_INCREF(__pyx_t_4);
+          __Pyx_INCREF(function);
+          __Pyx_DECREF_SET(__pyx_t_2, function);
+        }
+      }
+      __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_v_timeout) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_timeout);
+      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 690, __pyx_L6_error)
+      __Pyx_GOTREF(__pyx_t_3);
+      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+      __pyx_v_t = __pyx_t_3;
+      __pyx_t_3 = 0;
+
+0691:             try:
+
      /*try:*/ {
+
+0692:                 result = self.parent.switch()
+
        __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_parent); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 692, __pyx_L13_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_switch); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 692, __pyx_L13_error)
+        __Pyx_GOTREF(__pyx_t_4);
+        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+        __pyx_t_2 = NULL;
+        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
+          __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
+          if (likely(__pyx_t_2)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
+            __Pyx_INCREF(__pyx_t_2);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_4, function);
+          }
+        }
+        __pyx_t_3 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
+        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+        if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 692, __pyx_L13_error)
+        __Pyx_GOTREF(__pyx_t_3);
+        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+        __pyx_v_result = __pyx_t_3;
+        __pyx_t_3 = 0;
+
+0693:                 if result is not self:
+
        __pyx_t_5 = (__pyx_v_result != ((PyObject *)__pyx_v_self));
+        __pyx_t_1 = (__pyx_t_5 != 0);
+        if (unlikely(__pyx_t_1)) {
+/* … */
+        }
+      }
+
+0694:                     raise InvalidSwitchError('Invalid switch into Greenlet.get(): %r' % (result, ))
+
          __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 694, __pyx_L13_error)
+          __Pyx_GOTREF(__pyx_t_4);
+          __Pyx_INCREF(__pyx_v_result);
+          __Pyx_GIVEREF(__pyx_v_result);
+          PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_result);
+          __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_switch_into_Greenlet_get, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 694, __pyx_L13_error)
+          __Pyx_GOTREF(__pyx_t_2);
+          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+          __Pyx_INCREF(__pyx_v_6gevent_9_greenlet_InvalidSwitchError);
+          __pyx_t_4 = __pyx_v_6gevent_9_greenlet_InvalidSwitchError; __pyx_t_9 = NULL;
+          if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
+            __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_4);
+            if (likely(__pyx_t_9)) {
+              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
+              __Pyx_INCREF(__pyx_t_9);
+              __Pyx_INCREF(function);
+              __Pyx_DECREF_SET(__pyx_t_4, function);
+            }
+          }
+          __pyx_t_3 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_9, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_2);
+          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
+          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+          if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 694, __pyx_L13_error)
+          __Pyx_GOTREF(__pyx_t_3);
+          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+          __Pyx_Raise(__pyx_t_3, 0, 0, 0);
+          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+          __PYX_ERR(0, 694, __pyx_L13_error)
+
 0695:             finally:
+
+0696:                 t.cancel()
+
      /*finally:*/ {
+        /*normal exit:*/{
+          __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_t, __pyx_n_s_cancel); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 696, __pyx_L6_error)
+          __Pyx_GOTREF(__pyx_t_4);
+          __pyx_t_2 = NULL;
+          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
+            __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
+            if (likely(__pyx_t_2)) {
+              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
+              __Pyx_INCREF(__pyx_t_2);
+              __Pyx_INCREF(function);
+              __Pyx_DECREF_SET(__pyx_t_4, function);
+            }
+          }
+          __pyx_t_3 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
+          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+          if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 696, __pyx_L6_error)
+          __Pyx_GOTREF(__pyx_t_3);
+          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+          goto __pyx_L14;
+        }
+        __pyx_L13_error:;
+        /*exception exit:*/{
+          __Pyx_PyThreadState_declare
+          __Pyx_PyThreadState_assign
+          __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0;
+          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
+          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18);
+          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15) < 0)) __Pyx_ErrFetch(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15);
+          __Pyx_XGOTREF(__pyx_t_13);
+          __Pyx_XGOTREF(__pyx_t_14);
+          __Pyx_XGOTREF(__pyx_t_15);
+          __Pyx_XGOTREF(__pyx_t_16);
+          __Pyx_XGOTREF(__pyx_t_17);
+          __Pyx_XGOTREF(__pyx_t_18);
+          __pyx_t_10 = __pyx_lineno; __pyx_t_11 = __pyx_clineno; __pyx_t_12 = __pyx_filename;
+          {
+            __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_t, __pyx_n_s_cancel); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 696, __pyx_L17_error)
+            __Pyx_GOTREF(__pyx_t_4);
+            __pyx_t_2 = NULL;
+            if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
+              __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
+              if (likely(__pyx_t_2)) {
+                PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
+                __Pyx_INCREF(__pyx_t_2);
+                __Pyx_INCREF(function);
+                __Pyx_DECREF_SET(__pyx_t_4, function);
+              }
+            }
+            __pyx_t_3 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
+            __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+            if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 696, __pyx_L17_error)
+            __Pyx_GOTREF(__pyx_t_3);
+            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+          }
+          if (PY_MAJOR_VERSION >= 3) {
+            __Pyx_XGIVEREF(__pyx_t_16);
+            __Pyx_XGIVEREF(__pyx_t_17);
+            __Pyx_XGIVEREF(__pyx_t_18);
+            __Pyx_ExceptionReset(__pyx_t_16, __pyx_t_17, __pyx_t_18);
+          }
+          __Pyx_XGIVEREF(__pyx_t_13);
+          __Pyx_XGIVEREF(__pyx_t_14);
+          __Pyx_XGIVEREF(__pyx_t_15);
+          __Pyx_ErrRestore(__pyx_t_13, __pyx_t_14, __pyx_t_15);
+          __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0;
+          __pyx_lineno = __pyx_t_10; __pyx_clineno = __pyx_t_11; __pyx_filename = __pyx_t_12;
+          goto __pyx_L6_error;
+          __pyx_L17_error:;
+          if (PY_MAJOR_VERSION >= 3) {
+            __Pyx_XGIVEREF(__pyx_t_16);
+            __Pyx_XGIVEREF(__pyx_t_17);
+            __Pyx_XGIVEREF(__pyx_t_18);
+            __Pyx_ExceptionReset(__pyx_t_16, __pyx_t_17, __pyx_t_18);
+          }
+          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
+          __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
+          __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
+          __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0;
+          goto __pyx_L6_error;
+        }
+        __pyx_L14:;
+      }
+
+0697:         except:
+
    /*except:*/ {
+      __Pyx_AddTraceback("gevent._greenlet.Greenlet.get", __pyx_clineno, __pyx_lineno, __pyx_filename);
+      if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_4, &__pyx_t_2) < 0) __PYX_ERR(0, 697, __pyx_L8_except_error)
+      __Pyx_GOTREF(__pyx_t_3);
+      __Pyx_GOTREF(__pyx_t_4);
+      __Pyx_GOTREF(__pyx_t_2);
+
 0698:             # unlinking in 'except' instead of finally is an optimization:
+
 0699:             # if switch occurred normally then link was already removed in _notify_links
+
 0700:             # and there's no need to touch the links set.
+
 0701:             # Note, however, that if "Invalid switch" assert was removed and invalid switch
+
 0702:             # did happen, the link would remain, causing another invalid switch later in this greenlet.
+
+0703:             self.unlink(switch)
+
      __pyx_t_19 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_unlink); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 703, __pyx_L8_except_error)
+      __Pyx_GOTREF(__pyx_t_19);
+      __pyx_t_20 = NULL;
+      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_19))) {
+        __pyx_t_20 = PyMethod_GET_SELF(__pyx_t_19);
+        if (likely(__pyx_t_20)) {
+          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_19);
+          __Pyx_INCREF(__pyx_t_20);
+          __Pyx_INCREF(function);
+          __Pyx_DECREF_SET(__pyx_t_19, function);
+        }
+      }
+      __pyx_t_9 = (__pyx_t_20) ? __Pyx_PyObject_Call2Args(__pyx_t_19, __pyx_t_20, __pyx_v_switch) : __Pyx_PyObject_CallOneArg(__pyx_t_19, __pyx_v_switch);
+      __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
+      if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 703, __pyx_L8_except_error)
+      __Pyx_GOTREF(__pyx_t_9);
+      __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
+      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+
+0704:             raise
+
      __Pyx_GIVEREF(__pyx_t_3);
+      __Pyx_GIVEREF(__pyx_t_4);
+      __Pyx_XGIVEREF(__pyx_t_2);
+      __Pyx_ErrRestoreWithState(__pyx_t_3, __pyx_t_4, __pyx_t_2);
+      __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_t_2 = 0; 
+      __PYX_ERR(0, 704, __pyx_L8_except_error)
+    }
+    __pyx_L8_except_error:;
+
 0705: 
+
+0706:         if self.ready():
+
  __pyx_t_1 = (((struct __pyx_vtabstruct_6gevent_9_greenlet_Greenlet *)__pyx_v_self->__pyx_vtab)->ready(__pyx_v_self, 0) != 0);
+  if (__pyx_t_1) {
+/* … */
+  }
+
+0707:             if self.successful():
+
    __pyx_t_1 = (((struct __pyx_vtabstruct_6gevent_9_greenlet_Greenlet *)__pyx_v_self->__pyx_vtab)->successful(__pyx_v_self, 0) != 0);
+    if (__pyx_t_1) {
+/* … */
+    }
+
+0708:                 return self.value
+
      __Pyx_XDECREF(__pyx_r);
+      __Pyx_INCREF(__pyx_v_self->value);
+      __pyx_r = __pyx_v_self->value;
+      goto __pyx_L0;
+
+0709:             self._raise_exception()
+
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_raise_exception); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 709, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    __pyx_t_3 = NULL;
+    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
+      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
+      if (likely(__pyx_t_3)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
+        __Pyx_INCREF(__pyx_t_3);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_4, function);
+      }
+    }
+    __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
+    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 709, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
 0710: 
+
+0711:     def join(self, timeout=None):
+
static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_37join(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_f_6gevent_9_greenlet_8Greenlet_join(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_9_greenlet_8Greenlet_join *__pyx_optional_args) {
+  PyObject *__pyx_v_timeout = ((PyObject *)Py_None);
+  PyObject *__pyx_v_switch = NULL;
+  PyObject *__pyx_v_t = NULL;
+  PyObject *__pyx_v_result = NULL;
+  PyObject *__pyx_v_ex = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("join", 0);
+  if (__pyx_optional_args) {
+    if (__pyx_optional_args->__pyx_n > 0) {
+      __pyx_v_timeout = __pyx_optional_args->timeout;
+    }
+  }
+  /* Check if called by wrapper */
+  if (unlikely(__pyx_skip_dispatch)) ;
+  /* Check if overridden in Python */
+  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
+    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
+    if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
+    else {
+      PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      #endif
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_join); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 711, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_9_greenlet_8Greenlet_37join)) {
+        __Pyx_XDECREF(__pyx_r);
+        __Pyx_INCREF(__pyx_t_1);
+        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+          if (likely(__pyx_t_4)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+            __Pyx_INCREF(__pyx_t_4);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_3, function);
+          }
+        }
+        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_timeout) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_timeout);
+        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 711, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __pyx_r = __pyx_t_2;
+        __pyx_t_2 = 0;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        goto __pyx_L0;
+      }
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+      tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
+      if (unlikely(type_dict_guard != tp_dict_version)) {
+        tp_dict_version = obj_dict_version = 0;
+      }
+      #endif
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    }
+    #endif
+  }
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_19);
+  __Pyx_XDECREF(__pyx_t_20);
+  __Pyx_AddTraceback("gevent._greenlet.Greenlet.join", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_switch);
+  __Pyx_XDECREF(__pyx_v_t);
+  __Pyx_XDECREF(__pyx_v_result);
+  __Pyx_XDECREF(__pyx_v_ex);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_37join(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_6gevent_9_greenlet_8Greenlet_36join[] = "Greenlet.join(self, timeout=None)\n\n        join(timeout=None) -> None\n\n        Wait until the greenlet finishes or *timeout* expires. Return\n        ``None`` regardless.\n        ";
+static PyMethodDef __pyx_mdef_6gevent_9_greenlet_8Greenlet_37join = {"join", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_9_greenlet_8Greenlet_37join, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_9_greenlet_8Greenlet_36join};
+static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_37join(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_timeout = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("join (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_timeout,0};
+    PyObject* values[1] = {0};
+    values[0] = ((PyObject *)Py_None);
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_timeout);
+          if (value) { values[0] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "join") < 0)) __PYX_ERR(0, 711, __pyx_L3_error)
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    __pyx_v_timeout = values[0];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("join", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 711, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent._greenlet.Greenlet.join", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_9_greenlet_8Greenlet_36join(((struct __pyx_obj_6gevent_9_greenlet_Greenlet *)__pyx_v_self), __pyx_v_timeout);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_36join(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self, PyObject *__pyx_v_timeout) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("join", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_2.__pyx_n = 1;
+  __pyx_t_2.timeout = __pyx_v_timeout;
+  __pyx_t_1 = __pyx_vtabptr_6gevent_9_greenlet_Greenlet->join(__pyx_v_self, 1, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 711, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent._greenlet.Greenlet.join", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__53 = PyTuple_Pack(2, __pyx_n_s_self_2, __pyx_n_s_timeout); if (unlikely(!__pyx_tuple__53)) __PYX_ERR(0, 711, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__53);
+  __Pyx_GIVEREF(__pyx_tuple__53);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_9_greenlet_8Greenlet_37join, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Greenlet_join, NULL, __pyx_n_s_gevent__greenlet, __pyx_d, ((PyObject *)__pyx_codeobj__54)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 711, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet->tp_dict, __pyx_n_s_join, __pyx_t_2) < 0) __PYX_ERR(0, 711, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_9_greenlet_Greenlet);
+  __pyx_codeobj__54 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__53, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_greenlet_py, __pyx_n_s_join, 711, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__54)) __PYX_ERR(0, 711, __pyx_L1_error)
+
 0712:         """
+
 0713:         join(timeout=None) -> None
+
 0714: 
+
 0715:         Wait until the greenlet finishes or *timeout* expires. Return
+
 0716:         ``None`` regardless.
+
 0717:         """
+
+0718:         if self.ready():
+
  __pyx_t_5 = (((struct __pyx_vtabstruct_6gevent_9_greenlet_Greenlet *)__pyx_v_self->__pyx_vtab)->ready(__pyx_v_self, 0) != 0);
+  if (__pyx_t_5) {
+/* … */
+  }
+
+0719:             return
+
    __Pyx_XDECREF(__pyx_r);
+    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+    goto __pyx_L0;
+
 0720: 
+
+0721:         switch = getcurrent().switch # pylint:disable=undefined-variable
+
  __pyx_t_1 = ((PyObject *)__pyx_f_6gevent_9_greenlet_getcurrent()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 721, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_switch); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 721, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_v_switch = __pyx_t_2;
+  __pyx_t_2 = 0;
+
+0722:         self.rawlink(switch)
+
  __pyx_t_2 = ((struct __pyx_vtabstruct_6gevent_9_greenlet_Greenlet *)__pyx_v_self->__pyx_vtab)->rawlink(__pyx_v_self, __pyx_v_switch, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 722, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+0723:         try:
+
  {
+    /*try:*/ {
+/* … */
+    }
+    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
+    goto __pyx_L9_try_end;
+    __pyx_L4_error:;
+    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+/* … */
+    __Pyx_XGIVEREF(__pyx_t_6);
+    __Pyx_XGIVEREF(__pyx_t_7);
+    __Pyx_XGIVEREF(__pyx_t_8);
+    __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
+    goto __pyx_L1_error;
+    __pyx_L5_exception_handled:;
+    __Pyx_XGIVEREF(__pyx_t_6);
+    __Pyx_XGIVEREF(__pyx_t_7);
+    __Pyx_XGIVEREF(__pyx_t_8);
+    __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
+    __pyx_L9_try_end:;
+  }
+
+0724:             t = Timeout._start_new_or_dummy(timeout)
+
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_6gevent_9_greenlet_Timeout, __pyx_n_s_start_new_or_dummy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 724, __pyx_L4_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      __pyx_t_3 = NULL;
+      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
+        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
+        if (likely(__pyx_t_3)) {
+          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
+          __Pyx_INCREF(__pyx_t_3);
+          __Pyx_INCREF(function);
+          __Pyx_DECREF_SET(__pyx_t_1, function);
+        }
+      }
+      __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_3, __pyx_v_timeout) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_timeout);
+      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 724, __pyx_L4_error)
+      __Pyx_GOTREF(__pyx_t_2);
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      __pyx_v_t = __pyx_t_2;
+      __pyx_t_2 = 0;
+
+0725:             try:
+
      /*try:*/ {
+
+0726:                 result = self.parent.switch()
+
        __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_parent); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 726, __pyx_L11_error)
+        __Pyx_GOTREF(__pyx_t_1);
+        __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_switch); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 726, __pyx_L11_error)
+        __Pyx_GOTREF(__pyx_t_3);
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        __pyx_t_1 = NULL;
+        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
+          __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
+          if (likely(__pyx_t_1)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+            __Pyx_INCREF(__pyx_t_1);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_3, function);
+          }
+        }
+        __pyx_t_2 = (__pyx_t_1) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
+        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 726, __pyx_L11_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __pyx_v_result = __pyx_t_2;
+        __pyx_t_2 = 0;
+
+0727:                 if result is not self:
+
        __pyx_t_5 = (__pyx_v_result != ((PyObject *)__pyx_v_self));
+        __pyx_t_9 = (__pyx_t_5 != 0);
+        if (unlikely(__pyx_t_9)) {
+/* … */
+        }
+      }
+
+0728:                     raise InvalidSwitchError('Invalid switch into Greenlet.join(): %r' % (result, ))
+
          __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 728, __pyx_L11_error)
+          __Pyx_GOTREF(__pyx_t_3);
+          __Pyx_INCREF(__pyx_v_result);
+          __Pyx_GIVEREF(__pyx_v_result);
+          PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_result);
+          __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_switch_into_Greenlet_joi, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 728, __pyx_L11_error)
+          __Pyx_GOTREF(__pyx_t_1);
+          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+          __Pyx_INCREF(__pyx_v_6gevent_9_greenlet_InvalidSwitchError);
+          __pyx_t_3 = __pyx_v_6gevent_9_greenlet_InvalidSwitchError; __pyx_t_4 = NULL;
+          if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+            __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+            if (likely(__pyx_t_4)) {
+              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+              __Pyx_INCREF(__pyx_t_4);
+              __Pyx_INCREF(function);
+              __Pyx_DECREF_SET(__pyx_t_3, function);
+            }
+          }
+          __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_t_1) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1);
+          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 728, __pyx_L11_error)
+          __Pyx_GOTREF(__pyx_t_2);
+          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+          __Pyx_Raise(__pyx_t_2, 0, 0, 0);
+          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+          __PYX_ERR(0, 728, __pyx_L11_error)
+
 0729:             finally:
+
+0730:                 t.cancel()
+
      /*finally:*/ {
+        /*normal exit:*/{
+          __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_t, __pyx_n_s_cancel); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 730, __pyx_L4_error)
+          __Pyx_GOTREF(__pyx_t_3);
+          __pyx_t_1 = NULL;
+          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
+            __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
+            if (likely(__pyx_t_1)) {
+              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+              __Pyx_INCREF(__pyx_t_1);
+              __Pyx_INCREF(function);
+              __Pyx_DECREF_SET(__pyx_t_3, function);
+            }
+          }
+          __pyx_t_2 = (__pyx_t_1) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
+          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 730, __pyx_L4_error)
+          __Pyx_GOTREF(__pyx_t_2);
+          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+          goto __pyx_L12;
+        }
+        __pyx_L11_error:;
+        /*exception exit:*/{
+          __Pyx_PyThreadState_declare
+          __Pyx_PyThreadState_assign
+          __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0;
+          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18);
+          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15) < 0)) __Pyx_ErrFetch(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15);
+          __Pyx_XGOTREF(__pyx_t_13);
+          __Pyx_XGOTREF(__pyx_t_14);
+          __Pyx_XGOTREF(__pyx_t_15);
+          __Pyx_XGOTREF(__pyx_t_16);
+          __Pyx_XGOTREF(__pyx_t_17);
+          __Pyx_XGOTREF(__pyx_t_18);
+          __pyx_t_10 = __pyx_lineno; __pyx_t_11 = __pyx_clineno; __pyx_t_12 = __pyx_filename;
+          {
+            __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_t, __pyx_n_s_cancel); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 730, __pyx_L15_error)
+            __Pyx_GOTREF(__pyx_t_3);
+            __pyx_t_1 = NULL;
+            if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
+              __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
+              if (likely(__pyx_t_1)) {
+                PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+                __Pyx_INCREF(__pyx_t_1);
+                __Pyx_INCREF(function);
+                __Pyx_DECREF_SET(__pyx_t_3, function);
+              }
+            }
+            __pyx_t_2 = (__pyx_t_1) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
+            __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+            if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 730, __pyx_L15_error)
+            __Pyx_GOTREF(__pyx_t_2);
+            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+          }
+          if (PY_MAJOR_VERSION >= 3) {
+            __Pyx_XGIVEREF(__pyx_t_16);
+            __Pyx_XGIVEREF(__pyx_t_17);
+            __Pyx_XGIVEREF(__pyx_t_18);
+            __Pyx_ExceptionReset(__pyx_t_16, __pyx_t_17, __pyx_t_18);
+          }
+          __Pyx_XGIVEREF(__pyx_t_13);
+          __Pyx_XGIVEREF(__pyx_t_14);
+          __Pyx_XGIVEREF(__pyx_t_15);
+          __Pyx_ErrRestore(__pyx_t_13, __pyx_t_14, __pyx_t_15);
+          __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0;
+          __pyx_lineno = __pyx_t_10; __pyx_clineno = __pyx_t_11; __pyx_filename = __pyx_t_12;
+          goto __pyx_L4_error;
+          __pyx_L15_error:;
+          if (PY_MAJOR_VERSION >= 3) {
+            __Pyx_XGIVEREF(__pyx_t_16);
+            __Pyx_XGIVEREF(__pyx_t_17);
+            __Pyx_XGIVEREF(__pyx_t_18);
+            __Pyx_ExceptionReset(__pyx_t_16, __pyx_t_17, __pyx_t_18);
+          }
+          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
+          __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
+          __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
+          __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0;
+          goto __pyx_L4_error;
+        }
+        __pyx_L12:;
+      }
+
+0731:         except Timeout as ex:
+
    __pyx_t_11 = __Pyx_PyErr_ExceptionMatches(__pyx_v_6gevent_9_greenlet_Timeout);
+    if (__pyx_t_11) {
+      __Pyx_AddTraceback("gevent._greenlet.Greenlet.join", __pyx_clineno, __pyx_lineno, __pyx_filename);
+      if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_3, &__pyx_t_1) < 0) __PYX_ERR(0, 731, __pyx_L6_except_error)
+      __Pyx_GOTREF(__pyx_t_2);
+      __Pyx_GOTREF(__pyx_t_3);
+      __Pyx_GOTREF(__pyx_t_1);
+      __Pyx_INCREF(__pyx_t_3);
+      __pyx_v_ex = __pyx_t_3;
+      /*try:*/ {
+/* … */
+      /*finally:*/ {
+        /*normal exit:*/{
+          __Pyx_DECREF(__pyx_v_ex);
+          __pyx_v_ex = NULL;
+          goto __pyx_L22;
+        }
+        __pyx_L21_error:;
+        /*exception exit:*/{
+          __Pyx_PyThreadState_declare
+          __Pyx_PyThreadState_assign
+          __pyx_t_18 = 0; __pyx_t_17 = 0; __pyx_t_16 = 0; __pyx_t_15 = 0; __pyx_t_14 = 0; __pyx_t_13 = 0;
+          __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
+          __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
+          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_15, &__pyx_t_14, &__pyx_t_13);
+          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_18, &__pyx_t_17, &__pyx_t_16) < 0)) __Pyx_ErrFetch(&__pyx_t_18, &__pyx_t_17, &__pyx_t_16);
+          __Pyx_XGOTREF(__pyx_t_18);
+          __Pyx_XGOTREF(__pyx_t_17);
+          __Pyx_XGOTREF(__pyx_t_16);
+          __Pyx_XGOTREF(__pyx_t_15);
+          __Pyx_XGOTREF(__pyx_t_14);
+          __Pyx_XGOTREF(__pyx_t_13);
+          __pyx_t_11 = __pyx_lineno; __pyx_t_10 = __pyx_clineno; __pyx_t_21 = __pyx_filename;
+          {
+            __Pyx_DECREF(__pyx_v_ex);
+            __pyx_v_ex = NULL;
+          }
+          if (PY_MAJOR_VERSION >= 3) {
+            __Pyx_XGIVEREF(__pyx_t_15);
+            __Pyx_XGIVEREF(__pyx_t_14);
+            __Pyx_XGIVEREF(__pyx_t_13);
+            __Pyx_ExceptionReset(__pyx_t_15, __pyx_t_14, __pyx_t_13);
+          }
+          __Pyx_XGIVEREF(__pyx_t_18);
+          __Pyx_XGIVEREF(__pyx_t_17);
+          __Pyx_XGIVEREF(__pyx_t_16);
+          __Pyx_ErrRestore(__pyx_t_18, __pyx_t_17, __pyx_t_16);
+          __pyx_t_18 = 0; __pyx_t_17 = 0; __pyx_t_16 = 0; __pyx_t_15 = 0; __pyx_t_14 = 0; __pyx_t_13 = 0;
+          __pyx_lineno = __pyx_t_11; __pyx_clineno = __pyx_t_10; __pyx_filename = __pyx_t_21;
+          goto __pyx_L6_except_error;
+        }
+        __pyx_L22:;
+      }
+      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+      goto __pyx_L5_exception_handled;
+    }
+
+0732:             self.unlink(switch)
+
        __pyx_t_19 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_unlink); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 732, __pyx_L21_error)
+        __Pyx_GOTREF(__pyx_t_19);
+        __pyx_t_20 = NULL;
+        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_19))) {
+          __pyx_t_20 = PyMethod_GET_SELF(__pyx_t_19);
+          if (likely(__pyx_t_20)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_19);
+            __Pyx_INCREF(__pyx_t_20);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_19, function);
+          }
+        }
+        __pyx_t_4 = (__pyx_t_20) ? __Pyx_PyObject_Call2Args(__pyx_t_19, __pyx_t_20, __pyx_v_switch) : __Pyx_PyObject_CallOneArg(__pyx_t_19, __pyx_v_switch);
+        __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
+        if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 732, __pyx_L21_error)
+        __Pyx_GOTREF(__pyx_t_4);
+        __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
+        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+
+0733:             if ex is not t:
+
        if (unlikely(!__pyx_v_t)) { __Pyx_RaiseUnboundLocalError("t"); __PYX_ERR(0, 733, __pyx_L21_error) }
+        __pyx_t_9 = (__pyx_v_ex != __pyx_v_t);
+        __pyx_t_5 = (__pyx_t_9 != 0);
+        if (unlikely(__pyx_t_5)) {
+/* … */
+        }
+      }
+
+0734:                 raise
+
          __Pyx_GIVEREF(__pyx_t_2);
+          __Pyx_GIVEREF(__pyx_t_3);
+          __Pyx_XGIVEREF(__pyx_t_1);
+          __Pyx_ErrRestoreWithState(__pyx_t_2, __pyx_t_3, __pyx_t_1);
+          __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_1 = 0; 
+          __PYX_ERR(0, 734, __pyx_L21_error)
+
+0735:         except:
+
    /*except:*/ {
+      __Pyx_AddTraceback("gevent._greenlet.Greenlet.join", __pyx_clineno, __pyx_lineno, __pyx_filename);
+      if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_3, &__pyx_t_2) < 0) __PYX_ERR(0, 735, __pyx_L6_except_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      __Pyx_GOTREF(__pyx_t_3);
+      __Pyx_GOTREF(__pyx_t_2);
+
+0736:             self.unlink(switch)
+
      __pyx_t_19 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_unlink); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 736, __pyx_L6_except_error)
+      __Pyx_GOTREF(__pyx_t_19);
+      __pyx_t_20 = NULL;
+      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_19))) {
+        __pyx_t_20 = PyMethod_GET_SELF(__pyx_t_19);
+        if (likely(__pyx_t_20)) {
+          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_19);
+          __Pyx_INCREF(__pyx_t_20);
+          __Pyx_INCREF(function);
+          __Pyx_DECREF_SET(__pyx_t_19, function);
+        }
+      }
+      __pyx_t_4 = (__pyx_t_20) ? __Pyx_PyObject_Call2Args(__pyx_t_19, __pyx_t_20, __pyx_v_switch) : __Pyx_PyObject_CallOneArg(__pyx_t_19, __pyx_v_switch);
+      __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
+      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 736, __pyx_L6_except_error)
+      __Pyx_GOTREF(__pyx_t_4);
+      __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+
+0737:             raise
+
      __Pyx_GIVEREF(__pyx_t_1);
+      __Pyx_GIVEREF(__pyx_t_3);
+      __Pyx_XGIVEREF(__pyx_t_2);
+      __Pyx_ErrRestoreWithState(__pyx_t_1, __pyx_t_3, __pyx_t_2);
+      __pyx_t_1 = 0; __pyx_t_3 = 0; __pyx_t_2 = 0; 
+      __PYX_ERR(0, 737, __pyx_L6_except_error)
+    }
+    __pyx_L6_except_error:;
+
 0738: 
+
+0739:     def _report_result(self, result):
+
static PyObject *__pyx_f_6gevent_9_greenlet_8Greenlet__report_result(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self, PyObject *__pyx_v_result) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_report_result", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_XDECREF(__pyx_t_6);
+  __Pyx_XDECREF(__pyx_t_7);
+  __Pyx_AddTraceback("gevent._greenlet.Greenlet._report_result", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0740:         self._exc_info = (None, None, None)
+
  __Pyx_INCREF(__pyx_tuple__11);
+  __Pyx_GIVEREF(__pyx_tuple__11);
+  __Pyx_GOTREF(__pyx_v_self->_exc_info);
+  __Pyx_DECREF(__pyx_v_self->_exc_info);
+  __pyx_v_self->_exc_info = __pyx_tuple__11;
+/* … */
+  __pyx_tuple__11 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 740, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__11);
+  __Pyx_GIVEREF(__pyx_tuple__11);
+
+0741:         self.value = result
+
  __Pyx_INCREF(__pyx_v_result);
+  __Pyx_GIVEREF(__pyx_v_result);
+  __Pyx_GOTREF(__pyx_v_self->value);
+  __Pyx_DECREF(__pyx_v_self->value);
+  __pyx_v_self->value = __pyx_v_result;
+
+0742:         if self._links and not self._notifier:
+
  __pyx_t_2 = (__pyx_v_self->_links != Py_None)&&(PyList_GET_SIZE(__pyx_v_self->_links) != 0);
+  if (__pyx_t_2) {
+  } else {
+    __pyx_t_1 = __pyx_t_2;
+    goto __pyx_L4_bool_binop_done;
+  }
+  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_self->_notifier); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 742, __pyx_L1_error)
+  __pyx_t_3 = ((!__pyx_t_2) != 0);
+  __pyx_t_1 = __pyx_t_3;
+  __pyx_L4_bool_binop_done:;
+  if (__pyx_t_1) {
+/* … */
+  }
+
+0743:             self._notifier = self.parent.loop.run_callback(self._notify_links)
+
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_parent); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 743, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_5);
+    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_loop); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 743, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_6);
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_run_callback); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 743, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_5);
+    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_notify_links); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 743, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_6);
+    __pyx_t_7 = NULL;
+    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
+      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
+      if (likely(__pyx_t_7)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
+        __Pyx_INCREF(__pyx_t_7);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_5, function);
+      }
+    }
+    __pyx_t_4 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_7, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6);
+    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 743, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __Pyx_GIVEREF(__pyx_t_4);
+    __Pyx_GOTREF(__pyx_v_self->_notifier);
+    __Pyx_DECREF(__pyx_v_self->_notifier);
+    __pyx_v_self->_notifier = __pyx_t_4;
+    __pyx_t_4 = 0;
+
 0744: 
+
+0745:     def _report_error(self, exc_info):
+
static PyObject *__pyx_f_6gevent_9_greenlet_8Greenlet__report_error(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self, PyObject *__pyx_v_exc_info) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_report_error", 0);
+  __Pyx_INCREF(__pyx_v_exc_info);
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_XDECREF(__pyx_t_6);
+  __Pyx_XDECREF(__pyx_t_7);
+  __Pyx_XDECREF(__pyx_t_8);
+  __Pyx_AddTraceback("gevent._greenlet.Greenlet._report_error", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_exc_info);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0746:         if isinstance(exc_info[1], GreenletExit):
+
  if (unlikely(__pyx_v_exc_info == Py_None)) {
+    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
+    __PYX_ERR(0, 746, __pyx_L1_error)
+  }
+  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v_exc_info, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 746, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = __pyx_v_6gevent_9_greenlet_GreenletExit;
+  __Pyx_INCREF(__pyx_t_2);
+  __pyx_t_3 = PyObject_IsInstance(__pyx_t_1, __pyx_t_2); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 746, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_4 = (__pyx_t_3 != 0);
+  if (__pyx_t_4) {
+/* … */
+  }
+
+0747:             self._report_result(exc_info[1])
+
    if (unlikely(__pyx_v_exc_info == Py_None)) {
+      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
+      __PYX_ERR(0, 747, __pyx_L1_error)
+    }
+    __pyx_t_2 = __Pyx_GetItemInt_Tuple(__pyx_v_exc_info, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 747, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_9_greenlet_Greenlet *)__pyx_v_self->__pyx_vtab)->_report_result(__pyx_v_self, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 747, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+0748:             return
+
    __Pyx_XDECREF(__pyx_r);
+    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+    goto __pyx_L0;
+
 0749: 
+
+0750:         self._exc_info = exc_info[0], exc_info[1], dump_traceback(exc_info[2])
+
  if (unlikely(__pyx_v_exc_info == Py_None)) {
+    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
+    __PYX_ERR(0, 750, __pyx_L1_error)
+  }
+  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v_exc_info, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 750, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (unlikely(__pyx_v_exc_info == Py_None)) {
+    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
+    __PYX_ERR(0, 750, __pyx_L1_error)
+  }
+  __pyx_t_2 = __Pyx_GetItemInt_Tuple(__pyx_v_exc_info, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 750, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (unlikely(__pyx_v_exc_info == Py_None)) {
+    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
+    __PYX_ERR(0, 750, __pyx_L1_error)
+  }
+  __pyx_t_6 = __Pyx_GetItemInt_Tuple(__pyx_v_exc_info, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 750, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  __Pyx_INCREF(__pyx_v_6gevent_9_greenlet_dump_traceback);
+  __pyx_t_7 = __pyx_v_6gevent_9_greenlet_dump_traceback; __pyx_t_8 = NULL;
+  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
+    __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
+    if (likely(__pyx_t_8)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
+      __Pyx_INCREF(__pyx_t_8);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_7, function);
+    }
+  }
+  __pyx_t_5 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_8, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6);
+  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 750, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_5);
+  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 750, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_7);
+  __Pyx_GIVEREF(__pyx_t_1);
+  PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_2);
+  PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_2);
+  __Pyx_GIVEREF(__pyx_t_5);
+  PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_5);
+  __pyx_t_1 = 0;
+  __pyx_t_2 = 0;
+  __pyx_t_5 = 0;
+  __Pyx_GIVEREF(__pyx_t_7);
+  __Pyx_GOTREF(__pyx_v_self->_exc_info);
+  __Pyx_DECREF(__pyx_v_self->_exc_info);
+  __pyx_v_self->_exc_info = ((PyObject*)__pyx_t_7);
+  __pyx_t_7 = 0;
+
 0751: 
+
+0752:         if self._links and not self._notifier:
+
  __pyx_t_3 = (__pyx_v_self->_links != Py_None)&&(PyList_GET_SIZE(__pyx_v_self->_links) != 0);
+  if (__pyx_t_3) {
+  } else {
+    __pyx_t_4 = __pyx_t_3;
+    goto __pyx_L5_bool_binop_done;
+  }
+  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_self->_notifier); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 752, __pyx_L1_error)
+  __pyx_t_9 = ((!__pyx_t_3) != 0);
+  __pyx_t_4 = __pyx_t_9;
+  __pyx_L5_bool_binop_done:;
+  if (__pyx_t_4) {
+/* … */
+  }
+
+0753:             self._notifier = self.parent.loop.run_callback(self._notify_links)
+
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_parent); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 753, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_5);
+    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_loop); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 753, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_run_callback); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 753, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_5);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_notify_links); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 753, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_1 = NULL;
+    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
+      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_5);
+      if (likely(__pyx_t_1)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
+        __Pyx_INCREF(__pyx_t_1);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_5, function);
+      }
+    }
+    __pyx_t_7 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_1, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_2);
+    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 753, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_7);
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __Pyx_GIVEREF(__pyx_t_7);
+    __Pyx_GOTREF(__pyx_v_self->_notifier);
+    __Pyx_DECREF(__pyx_v_self->_notifier);
+    __pyx_v_self->_notifier = __pyx_t_7;
+    __pyx_t_7 = 0;
+
 0754: 
+
+0755:         try:
+
  /*try:*/ {
+
+0756:             self.parent.handle_error(self, *exc_info)
+
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_parent); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 756, __pyx_L8_error)
+    __Pyx_GOTREF(__pyx_t_7);
+    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_handle_error); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 756, __pyx_L8_error)
+    __Pyx_GOTREF(__pyx_t_5);
+    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+    __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 756, __pyx_L8_error)
+    __Pyx_GOTREF(__pyx_t_7);
+    __Pyx_INCREF(((PyObject *)__pyx_v_self));
+    __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
+    PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)__pyx_v_self));
+    if (unlikely(__pyx_v_exc_info == Py_None)) {
+      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
+      __PYX_ERR(0, 756, __pyx_L8_error)
+    }
+    __pyx_t_2 = PyNumber_Add(__pyx_t_7, __pyx_v_exc_info); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 756, __pyx_L8_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+    __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_2, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 756, __pyx_L8_error)
+    __Pyx_GOTREF(__pyx_t_7);
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  }
+
 0757:         finally:
+
+0758:             del exc_info
+
  /*finally:*/ {
+    /*normal exit:*/{
+      __Pyx_DECREF(__pyx_v_exc_info);
+      __pyx_v_exc_info = NULL;
+      goto __pyx_L9;
+    }
+    __pyx_L8_error:;
+    /*exception exit:*/{
+      __Pyx_PyThreadState_declare
+      __Pyx_PyThreadState_assign
+      __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0;
+      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
+      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+      if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18);
+      if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15) < 0)) __Pyx_ErrFetch(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15);
+      __Pyx_XGOTREF(__pyx_t_13);
+      __Pyx_XGOTREF(__pyx_t_14);
+      __Pyx_XGOTREF(__pyx_t_15);
+      __Pyx_XGOTREF(__pyx_t_16);
+      __Pyx_XGOTREF(__pyx_t_17);
+      __Pyx_XGOTREF(__pyx_t_18);
+      __pyx_t_10 = __pyx_lineno; __pyx_t_11 = __pyx_clineno; __pyx_t_12 = __pyx_filename;
+      {
+        __Pyx_DECREF(__pyx_v_exc_info);
+        __pyx_v_exc_info = NULL;
+      }
+      if (PY_MAJOR_VERSION >= 3) {
+        __Pyx_XGIVEREF(__pyx_t_16);
+        __Pyx_XGIVEREF(__pyx_t_17);
+        __Pyx_XGIVEREF(__pyx_t_18);
+        __Pyx_ExceptionReset(__pyx_t_16, __pyx_t_17, __pyx_t_18);
+      }
+      __Pyx_XGIVEREF(__pyx_t_13);
+      __Pyx_XGIVEREF(__pyx_t_14);
+      __Pyx_XGIVEREF(__pyx_t_15);
+      __Pyx_ErrRestore(__pyx_t_13, __pyx_t_14, __pyx_t_15);
+      __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0;
+      __pyx_lineno = __pyx_t_10; __pyx_clineno = __pyx_t_11; __pyx_filename = __pyx_t_12;
+      goto __pyx_L1_error;
+    }
+    __pyx_L9:;
+  }
+
 0759: 
+
+0760:     def run(self):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_39run(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6gevent_9_greenlet_8Greenlet_38run[] = "Greenlet.run(self)";
+static PyMethodDef __pyx_mdef_6gevent_9_greenlet_8Greenlet_39run = {"run", (PyCFunction)__pyx_pw_6gevent_9_greenlet_8Greenlet_39run, METH_NOARGS, __pyx_doc_6gevent_9_greenlet_8Greenlet_38run};
+static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_39run(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("run (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_9_greenlet_8Greenlet_38run(((struct __pyx_obj_6gevent_9_greenlet_Greenlet *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_38run(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self) {
+  PyObject *__pyx_v_result = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("run", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_XDECREF(__pyx_t_6);
+  __Pyx_XDECREF(__pyx_t_7);
+  __Pyx_XDECREF(__pyx_t_8);
+  __Pyx_XDECREF(__pyx_t_9);
+  __Pyx_AddTraceback("gevent._greenlet.Greenlet.run", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_result);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__55 = PyTuple_Pack(2, __pyx_n_s_self_2, __pyx_n_s_result); if (unlikely(!__pyx_tuple__55)) __PYX_ERR(0, 760, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__55);
+  __Pyx_GIVEREF(__pyx_tuple__55);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_9_greenlet_8Greenlet_39run, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Greenlet_run, NULL, __pyx_n_s_gevent__greenlet, __pyx_d, ((PyObject *)__pyx_codeobj__56)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 760, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet->tp_dict, __pyx_n_s_run, __pyx_t_2) < 0) __PYX_ERR(0, 760, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_9_greenlet_Greenlet);
+  __pyx_codeobj__56 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__55, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_greenlet_py, __pyx_n_s_run, 760, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__56)) __PYX_ERR(0, 760, __pyx_L1_error)
+
+0761:         try:
+
  /*try:*/ {
+
+0762:             self.__cancel_start()
+
    __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_9_greenlet_Greenlet *)__pyx_v_self->__pyx_vtab)->__pyx___cancel_start(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 762, __pyx_L4_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+0763:             self._start_event = _start_completed_event
+
    __Pyx_INCREF(((PyObject *)__pyx_v_6gevent_9_greenlet__start_completed_event));
+    __Pyx_GIVEREF(((PyObject *)__pyx_v_6gevent_9_greenlet__start_completed_event));
+    __Pyx_GOTREF(__pyx_v_self->_start_event);
+    __Pyx_DECREF(__pyx_v_self->_start_event);
+    __pyx_v_self->_start_event = ((PyObject *)__pyx_v_6gevent_9_greenlet__start_completed_event);
+
 0764: 
+
+0765:             try:
+
    {
+      /*try:*/ {
+/* … */
+      }
+      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+      goto __pyx_L11_try_end;
+      __pyx_L6_error:;
+      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+/* … */
+      __Pyx_XGIVEREF(__pyx_t_2);
+      __Pyx_XGIVEREF(__pyx_t_3);
+      __Pyx_XGIVEREF(__pyx_t_4);
+      __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
+      goto __pyx_L4_error;
+      __pyx_L9_except_return:;
+      __Pyx_XGIVEREF(__pyx_t_2);
+      __Pyx_XGIVEREF(__pyx_t_3);
+      __Pyx_XGIVEREF(__pyx_t_4);
+      __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
+      goto __pyx_L3_return;
+      __pyx_L11_try_end:;
+    }
+
+0766:                 result = self._run(*self.args, **self.kwargs)
+
        __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_run_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 766, __pyx_L6_error)
+        __Pyx_GOTREF(__pyx_t_1);
+        if (unlikely(__pyx_v_self->args == Py_None)) {
+          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
+          __PYX_ERR(0, 766, __pyx_L6_error)
+        }
+        if (unlikely(__pyx_v_self->kwargs == Py_None)) {
+          PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType");
+          __PYX_ERR(0, 766, __pyx_L6_error)
+        }
+        __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_v_self->args, __pyx_v_self->kwargs); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 766, __pyx_L6_error)
+        __Pyx_GOTREF(__pyx_t_5);
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        __pyx_v_result = __pyx_t_5;
+        __pyx_t_5 = 0;
+
+0767:             except: # pylint:disable=bare-except
+
      /*except:*/ {
+        __Pyx_AddTraceback("gevent._greenlet.Greenlet.run", __pyx_clineno, __pyx_lineno, __pyx_filename);
+        if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_1, &__pyx_t_6) < 0) __PYX_ERR(0, 767, __pyx_L8_except_error)
+        __Pyx_GOTREF(__pyx_t_5);
+        __Pyx_GOTREF(__pyx_t_1);
+        __Pyx_GOTREF(__pyx_t_6);
+
+0768:                 self._report_error(sys_exc_info())
+
        __Pyx_INCREF(__pyx_v_6gevent_9_greenlet_sys_exc_info);
+        __pyx_t_8 = __pyx_v_6gevent_9_greenlet_sys_exc_info; __pyx_t_9 = NULL;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
+          __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8);
+          if (likely(__pyx_t_9)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
+            __Pyx_INCREF(__pyx_t_9);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_8, function);
+          }
+        }
+        __pyx_t_7 = (__pyx_t_9) ? __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_9) : __Pyx_PyObject_CallNoArg(__pyx_t_8);
+        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
+        if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 768, __pyx_L8_except_error)
+        __Pyx_GOTREF(__pyx_t_7);
+        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+        if (!(likely(PyTuple_CheckExact(__pyx_t_7))||((__pyx_t_7) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_7)->tp_name), 0))) __PYX_ERR(0, 768, __pyx_L8_except_error)
+        __pyx_t_8 = ((struct __pyx_vtabstruct_6gevent_9_greenlet_Greenlet *)__pyx_v_self->__pyx_vtab)->_report_error(__pyx_v_self, ((PyObject*)__pyx_t_7)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 768, __pyx_L8_except_error)
+        __Pyx_GOTREF(__pyx_t_8);
+        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+
+0769:                 return
+
        __Pyx_XDECREF(__pyx_r);
+        __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+        goto __pyx_L9_except_return;
+      }
+      __pyx_L8_except_error:;
+
+0770:             self._report_result(result)
+
    __pyx_t_6 = ((struct __pyx_vtabstruct_6gevent_9_greenlet_Greenlet *)__pyx_v_self->__pyx_vtab)->_report_result(__pyx_v_self, __pyx_v_result); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 770, __pyx_L4_error)
+    __Pyx_GOTREF(__pyx_t_6);
+    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  }
+
 0771:         finally:
+
+0772:             self.__dict__.pop('_run', None)
+
  /*finally:*/ {
+    /*normal exit:*/{
+      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_dict); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 772, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_6);
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_pop); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 772, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+      __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 772, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_6);
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+/* … */
+        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_dict); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 772, __pyx_L15_error)
+        __Pyx_GOTREF(__pyx_t_6);
+        __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_pop); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 772, __pyx_L15_error)
+        __Pyx_GOTREF(__pyx_t_1);
+        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+        __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 772, __pyx_L15_error)
+        __Pyx_GOTREF(__pyx_t_6);
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+/* … */
+      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_dict); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 772, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_6);
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_pop); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 772, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+      __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 772, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_6);
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+/* … */
+  __pyx_tuple__12 = PyTuple_Pack(2, __pyx_n_s_run_2, Py_None); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 772, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__12);
+  __Pyx_GIVEREF(__pyx_tuple__12);
+
+0773:             self.args = ()
+
      __Pyx_INCREF(__pyx_empty_tuple);
+      __Pyx_GIVEREF(__pyx_empty_tuple);
+      __Pyx_GOTREF(__pyx_v_self->args);
+      __Pyx_DECREF(__pyx_v_self->args);
+      __pyx_v_self->args = __pyx_empty_tuple;
+/* … */
+        __Pyx_INCREF(__pyx_empty_tuple);
+        __Pyx_GIVEREF(__pyx_empty_tuple);
+        __Pyx_GOTREF(__pyx_v_self->args);
+        __Pyx_DECREF(__pyx_v_self->args);
+        __pyx_v_self->args = __pyx_empty_tuple;
+/* … */
+      __Pyx_INCREF(__pyx_empty_tuple);
+      __Pyx_GIVEREF(__pyx_empty_tuple);
+      __Pyx_GOTREF(__pyx_v_self->args);
+      __Pyx_DECREF(__pyx_v_self->args);
+      __pyx_v_self->args = __pyx_empty_tuple;
+
+0774:             self.kwargs.clear()
+
      if (unlikely(__pyx_v_self->kwargs == Py_None)) {
+        PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "clear");
+        __PYX_ERR(0, 774, __pyx_L1_error)
+      }
+      __pyx_t_10 = __Pyx_PyDict_Clear(__pyx_v_self->kwargs); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(0, 774, __pyx_L1_error)
+      goto __pyx_L5;
+    }
+    __pyx_L4_error:;
+    /*exception exit:*/{
+      __Pyx_PyThreadState_declare
+      __Pyx_PyThreadState_assign
+      __pyx_t_4 = 0; __pyx_t_3 = 0; __pyx_t_2 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0;
+      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
+      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
+      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+      if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_14, &__pyx_t_15, &__pyx_t_16);
+      if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_4, &__pyx_t_3, &__pyx_t_2) < 0)) __Pyx_ErrFetch(&__pyx_t_4, &__pyx_t_3, &__pyx_t_2);
+      __Pyx_XGOTREF(__pyx_t_4);
+      __Pyx_XGOTREF(__pyx_t_3);
+      __Pyx_XGOTREF(__pyx_t_2);
+      __Pyx_XGOTREF(__pyx_t_14);
+      __Pyx_XGOTREF(__pyx_t_15);
+      __Pyx_XGOTREF(__pyx_t_16);
+      __pyx_t_11 = __pyx_lineno; __pyx_t_12 = __pyx_clineno; __pyx_t_13 = __pyx_filename;
+      {
+/* … */
+        if (unlikely(__pyx_v_self->kwargs == Py_None)) {
+          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "clear");
+          __PYX_ERR(0, 774, __pyx_L15_error)
+        }
+        __pyx_t_10 = __Pyx_PyDict_Clear(__pyx_v_self->kwargs); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(0, 774, __pyx_L15_error)
+      }
+      if (PY_MAJOR_VERSION >= 3) {
+        __Pyx_XGIVEREF(__pyx_t_14);
+        __Pyx_XGIVEREF(__pyx_t_15);
+        __Pyx_XGIVEREF(__pyx_t_16);
+        __Pyx_ExceptionReset(__pyx_t_14, __pyx_t_15, __pyx_t_16);
+      }
+      __Pyx_XGIVEREF(__pyx_t_4);
+      __Pyx_XGIVEREF(__pyx_t_3);
+      __Pyx_XGIVEREF(__pyx_t_2);
+      __Pyx_ErrRestore(__pyx_t_4, __pyx_t_3, __pyx_t_2);
+      __pyx_t_4 = 0; __pyx_t_3 = 0; __pyx_t_2 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0;
+      __pyx_lineno = __pyx_t_11; __pyx_clineno = __pyx_t_12; __pyx_filename = __pyx_t_13;
+      goto __pyx_L1_error;
+      __pyx_L15_error:;
+      if (PY_MAJOR_VERSION >= 3) {
+        __Pyx_XGIVEREF(__pyx_t_14);
+        __Pyx_XGIVEREF(__pyx_t_15);
+        __Pyx_XGIVEREF(__pyx_t_16);
+        __Pyx_ExceptionReset(__pyx_t_14, __pyx_t_15, __pyx_t_16);
+      }
+      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+      __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0;
+      goto __pyx_L1_error;
+    }
+    __pyx_L3_return: {
+      __pyx_t_16 = __pyx_r;
+      __pyx_r = 0;
+/* … */
+      if (unlikely(__pyx_v_self->kwargs == Py_None)) {
+        PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "clear");
+        __PYX_ERR(0, 774, __pyx_L1_error)
+      }
+      __pyx_t_10 = __Pyx_PyDict_Clear(__pyx_v_self->kwargs); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(0, 774, __pyx_L1_error)
+      __pyx_r = __pyx_t_16;
+      __pyx_t_16 = 0;
+      goto __pyx_L0;
+    }
+    __pyx_L5:;
+  }
+
 0775: 
+
+0776:     def _run(self):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_41_run(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6gevent_9_greenlet_8Greenlet_40_run[] = "Greenlet._run(self)\n\n        Subclasses may override this method to take any number of\n        arguments and keyword arguments.\n\n        .. versionadded:: 1.1a3\n            Previously, if no callable object was\n            passed to the constructor, the spawned greenlet would later\n            fail with an AttributeError.\n        ";
+static PyMethodDef __pyx_mdef_6gevent_9_greenlet_8Greenlet_41_run = {"_run", (PyCFunction)__pyx_pw_6gevent_9_greenlet_8Greenlet_41_run, METH_NOARGS, __pyx_doc_6gevent_9_greenlet_8Greenlet_40_run};
+static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_41_run(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_run (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_9_greenlet_8Greenlet_40_run(((struct __pyx_obj_6gevent_9_greenlet_Greenlet *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_40_run(CYTHON_UNUSED struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_run", 0);
+/* … */
+  /* function exit code */
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__57 = PyTuple_Pack(1, __pyx_n_s_self_2); if (unlikely(!__pyx_tuple__57)) __PYX_ERR(0, 776, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__57);
+  __Pyx_GIVEREF(__pyx_tuple__57);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_9_greenlet_8Greenlet_41_run, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Greenlet__run, NULL, __pyx_n_s_gevent__greenlet, __pyx_d, ((PyObject *)__pyx_codeobj__58)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 776, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet->tp_dict, __pyx_n_s_run_2, __pyx_t_2) < 0) __PYX_ERR(0, 776, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_9_greenlet_Greenlet);
+  __pyx_codeobj__58 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__57, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_greenlet_py, __pyx_n_s_run_2, 776, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__58)) __PYX_ERR(0, 776, __pyx_L1_error)
+
 0777:         """
+
 0778:         Subclasses may override this method to take any number of
+
 0779:         arguments and keyword arguments.
+
 0780: 
+
 0781:         .. versionadded:: 1.1a3
+
 0782:             Previously, if no callable object was
+
 0783:             passed to the constructor, the spawned greenlet would later
+
 0784:             fail with an AttributeError.
+
 0785:         """
+
 0786:         # We usually override this in __init__
+
 0787:         # pylint: disable=method-hidden
+
+0788:         return
+
  __Pyx_XDECREF(__pyx_r);
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+
 0789: 
+
+0790:     def has_links(self):
+
static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_43has_links(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static int __pyx_f_6gevent_9_greenlet_8Greenlet_has_links(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self, int __pyx_skip_dispatch) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("has_links", 0);
+  /* Check if called by wrapper */
+  if (unlikely(__pyx_skip_dispatch)) ;
+  /* Check if overridden in Python */
+  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
+    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
+    if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
+    else {
+      PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      #endif
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_has_links); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 790, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_9_greenlet_8Greenlet_43has_links)) {
+        __Pyx_INCREF(__pyx_t_1);
+        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+          if (likely(__pyx_t_4)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+            __Pyx_INCREF(__pyx_t_4);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_3, function);
+          }
+        }
+        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
+        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 790, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 790, __pyx_L1_error)
+        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+        __pyx_r = __pyx_t_5;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        goto __pyx_L0;
+      }
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+      tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
+      if (unlikely(type_dict_guard != tp_dict_version)) {
+        tp_dict_version = obj_dict_version = 0;
+      }
+      #endif
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    }
+    #endif
+  }
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_WriteUnraisable("gevent._greenlet.Greenlet.has_links", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_43has_links(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6gevent_9_greenlet_8Greenlet_42has_links[] = "Greenlet.has_links(self) -> bool";
+static PyMethodDef __pyx_mdef_6gevent_9_greenlet_8Greenlet_43has_links = {"has_links", (PyCFunction)__pyx_pw_6gevent_9_greenlet_8Greenlet_43has_links, METH_NOARGS, __pyx_doc_6gevent_9_greenlet_8Greenlet_42has_links};
+static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_43has_links(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("has_links (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_9_greenlet_8Greenlet_42has_links(((struct __pyx_obj_6gevent_9_greenlet_Greenlet *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_42has_links(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("has_links", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_f_6gevent_9_greenlet_8Greenlet_has_links(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 790, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent._greenlet.Greenlet.has_links", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__59 = PyTuple_Pack(1, __pyx_n_s_self_2); if (unlikely(!__pyx_tuple__59)) __PYX_ERR(0, 790, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__59);
+  __Pyx_GIVEREF(__pyx_tuple__59);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_9_greenlet_8Greenlet_43has_links, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Greenlet_has_links, NULL, __pyx_n_s_gevent__greenlet, __pyx_d, ((PyObject *)__pyx_codeobj__60)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 790, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet->tp_dict, __pyx_n_s_has_links, __pyx_t_2) < 0) __PYX_ERR(0, 790, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_9_greenlet_Greenlet);
+  __pyx_codeobj__60 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__59, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_greenlet_py, __pyx_n_s_has_links, 790, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__60)) __PYX_ERR(0, 790, __pyx_L1_error)
+
+0791:         return len(self._links)
+
  __pyx_t_1 = __pyx_v_self->_links;
+  __Pyx_INCREF(__pyx_t_1);
+  if (unlikely(__pyx_t_1 == Py_None)) {
+    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
+    __PYX_ERR(0, 791, __pyx_L1_error)
+  }
+  __pyx_t_6 = PyList_GET_SIZE(__pyx_t_1); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 791, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_r = __pyx_t_6;
+  goto __pyx_L0;
+
 0792: 
+
+0793:     def rawlink(self, callback):
+
static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_45rawlink(PyObject *__pyx_v_self, PyObject *__pyx_v_callback); /*proto*/
+static PyObject *__pyx_f_6gevent_9_greenlet_8Greenlet_rawlink(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self, PyObject *__pyx_v_callback, int __pyx_skip_dispatch) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("rawlink", 0);
+  /* Check if called by wrapper */
+  if (unlikely(__pyx_skip_dispatch)) ;
+  /* Check if overridden in Python */
+  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
+    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
+    if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
+    else {
+      PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      #endif
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_rawlink); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 793, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_9_greenlet_8Greenlet_45rawlink)) {
+        __Pyx_XDECREF(__pyx_r);
+        __Pyx_INCREF(__pyx_t_1);
+        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+          if (likely(__pyx_t_4)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+            __Pyx_INCREF(__pyx_t_4);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_3, function);
+          }
+        }
+        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_callback) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_callback);
+        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 793, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __pyx_r = __pyx_t_2;
+        __pyx_t_2 = 0;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        goto __pyx_L0;
+      }
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+      tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
+      if (unlikely(type_dict_guard != tp_dict_version)) {
+        tp_dict_version = obj_dict_version = 0;
+      }
+      #endif
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    }
+    #endif
+  }
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_AddTraceback("gevent._greenlet.Greenlet.rawlink", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_45rawlink(PyObject *__pyx_v_self, PyObject *__pyx_v_callback); /*proto*/
+static char __pyx_doc_6gevent_9_greenlet_8Greenlet_44rawlink[] = "Greenlet.rawlink(self, callback)\n\n        Register a callable to be executed when the greenlet finishes\n        execution.\n\n        The *callback* will be called with this instance as an\n        argument.\n\n        .. caution:: The callable will be called in the HUB greenlet.\n        ";
+static PyMethodDef __pyx_mdef_6gevent_9_greenlet_8Greenlet_45rawlink = {"rawlink", (PyCFunction)__pyx_pw_6gevent_9_greenlet_8Greenlet_45rawlink, METH_O, __pyx_doc_6gevent_9_greenlet_8Greenlet_44rawlink};
+static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_45rawlink(PyObject *__pyx_v_self, PyObject *__pyx_v_callback) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("rawlink (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_9_greenlet_8Greenlet_44rawlink(((struct __pyx_obj_6gevent_9_greenlet_Greenlet *)__pyx_v_self), ((PyObject *)__pyx_v_callback));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_44rawlink(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self, PyObject *__pyx_v_callback) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("rawlink", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __pyx_f_6gevent_9_greenlet_8Greenlet_rawlink(__pyx_v_self, __pyx_v_callback, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 793, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent._greenlet.Greenlet.rawlink", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__61 = PyTuple_Pack(2, __pyx_n_s_self_2, __pyx_n_s_callback); if (unlikely(!__pyx_tuple__61)) __PYX_ERR(0, 793, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__61);
+  __Pyx_GIVEREF(__pyx_tuple__61);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_9_greenlet_8Greenlet_45rawlink, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Greenlet_rawlink, NULL, __pyx_n_s_gevent__greenlet, __pyx_d, ((PyObject *)__pyx_codeobj__62)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 793, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet->tp_dict, __pyx_n_s_rawlink, __pyx_t_2) < 0) __PYX_ERR(0, 793, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_9_greenlet_Greenlet);
+  __pyx_codeobj__62 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__61, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_greenlet_py, __pyx_n_s_rawlink, 793, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__62)) __PYX_ERR(0, 793, __pyx_L1_error)
+
 0794:         """
+
 0795:         Register a callable to be executed when the greenlet finishes
+
 0796:         execution.
+
 0797: 
+
 0798:         The *callback* will be called with this instance as an
+
 0799:         argument.
+
 0800: 
+
 0801:         .. caution:: The callable will be called in the HUB greenlet.
+
 0802:         """
+
+0803:         if not callable(callback):
+
  __pyx_t_5 = __Pyx_PyCallable_Check(__pyx_v_callback); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 803, __pyx_L1_error)
+  __pyx_t_6 = ((!(__pyx_t_5 != 0)) != 0);
+  if (unlikely(__pyx_t_6)) {
+/* … */
+  }
+
+0804:             raise TypeError('Expected callable: %r' % (callback, ))
+
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 804, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_INCREF(__pyx_v_callback);
+    __Pyx_GIVEREF(__pyx_v_callback);
+    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_callback);
+    __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_Expected_callable_r, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 804, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 804, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __PYX_ERR(0, 804, __pyx_L1_error)
+
+0805:         self._links.append(callback) # pylint:disable=no-member
+
  if (unlikely(__pyx_v_self->_links == Py_None)) {
+    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "append");
+    __PYX_ERR(0, 805, __pyx_L1_error)
+  }
+  __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_self->_links, __pyx_v_callback); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 805, __pyx_L1_error)
+
+0806:         if self.ready() and self._links and not self._notifier:
+
  __pyx_t_5 = (((struct __pyx_vtabstruct_6gevent_9_greenlet_Greenlet *)__pyx_v_self->__pyx_vtab)->ready(__pyx_v_self, 0) != 0);
+  if (__pyx_t_5) {
+  } else {
+    __pyx_t_6 = __pyx_t_5;
+    goto __pyx_L5_bool_binop_done;
+  }
+  __pyx_t_5 = (__pyx_v_self->_links != Py_None)&&(PyList_GET_SIZE(__pyx_v_self->_links) != 0);
+  if (__pyx_t_5) {
+  } else {
+    __pyx_t_6 = __pyx_t_5;
+    goto __pyx_L5_bool_binop_done;
+  }
+  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_self->_notifier); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 806, __pyx_L1_error)
+  __pyx_t_8 = ((!__pyx_t_5) != 0);
+  __pyx_t_6 = __pyx_t_8;
+  __pyx_L5_bool_binop_done:;
+  if (__pyx_t_6) {
+/* … */
+  }
+
+0807:             self._notifier = self.parent.loop.run_callback(self._notify_links)
+
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_parent); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 807, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_loop); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 807, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_run_callback); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 807, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_notify_links); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 807, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __pyx_t_4 = NULL;
+    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
+      if (likely(__pyx_t_4)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+        __Pyx_INCREF(__pyx_t_4);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_2, function);
+      }
+    }
+    __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
+    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 807, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __Pyx_GIVEREF(__pyx_t_1);
+    __Pyx_GOTREF(__pyx_v_self->_notifier);
+    __Pyx_DECREF(__pyx_v_self->_notifier);
+    __pyx_v_self->_notifier = __pyx_t_1;
+    __pyx_t_1 = 0;
+
 0808: 
+
+0809:     def link(self, callback, SpawnedLink=SpawnedLink):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_47link(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_6gevent_9_greenlet_8Greenlet_46link[] = "Greenlet.link(self, callback, SpawnedLink=SpawnedLink)\n\n        Link greenlet's completion to a callable.\n\n        The *callback* will be called with this instance as an\n        argument once this greenlet is dead. A callable is called in\n        its own :class:`greenlet.greenlet` (*not* a\n        :class:`Greenlet`).\n        ";
+static PyMethodDef __pyx_mdef_6gevent_9_greenlet_8Greenlet_47link = {"link", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_9_greenlet_8Greenlet_47link, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_9_greenlet_8Greenlet_46link};
+static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_47link(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_callback = 0;
+  PyObject *__pyx_v_SpawnedLink = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("link (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_callback,&__pyx_n_s_SpawnedLink,0};
+    PyObject* values[2] = {0,0};
+    values[1] = __pyx_k__13;
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_callback)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_SpawnedLink);
+          if (value) { values[1] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "link") < 0)) __PYX_ERR(0, 809, __pyx_L3_error)
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    __pyx_v_callback = values[0];
+    __pyx_v_SpawnedLink = values[1];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("link", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 809, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent._greenlet.Greenlet.link", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_9_greenlet_8Greenlet_46link(((struct __pyx_obj_6gevent_9_greenlet_Greenlet *)__pyx_v_self), __pyx_v_callback, __pyx_v_SpawnedLink);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_46link(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self, PyObject *__pyx_v_callback, PyObject *__pyx_v_SpawnedLink) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("link", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_AddTraceback("gevent._greenlet.Greenlet.link", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __Pyx_INCREF(((PyObject *)__pyx_ptype_6gevent_9_greenlet_SpawnedLink));
+  __pyx_k__13 = ((PyObject *)__pyx_ptype_6gevent_9_greenlet_SpawnedLink);
+  __Pyx_GIVEREF(__pyx_ptype_6gevent_9_greenlet_SpawnedLink);
+/* … */
+  __pyx_tuple__63 = PyTuple_Pack(3, __pyx_n_s_self_2, __pyx_n_s_callback, __pyx_n_s_SpawnedLink); if (unlikely(!__pyx_tuple__63)) __PYX_ERR(0, 809, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__63);
+  __Pyx_GIVEREF(__pyx_tuple__63);
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_9_greenlet_8Greenlet_47link, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Greenlet_link, NULL, __pyx_n_s_gevent__greenlet, __pyx_d, ((PyObject *)__pyx_codeobj__64)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 809, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet->tp_dict, __pyx_n_s_link, __pyx_t_2) < 0) __PYX_ERR(0, 809, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_9_greenlet_Greenlet);
+  __pyx_codeobj__64 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__63, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_greenlet_py, __pyx_n_s_link, 809, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__64)) __PYX_ERR(0, 809, __pyx_L1_error)
+
 0810:         """
+
 0811:         Link greenlet's completion to a callable.
+
 0812: 
+
 0813:         The *callback* will be called with this instance as an
+
 0814:         argument once this greenlet is dead. A callable is called in
+
 0815:         its own :class:`greenlet.greenlet` (*not* a
+
 0816:         :class:`Greenlet`).
+
 0817:         """
+
 0818:         # XXX: Is the redefinition of SpawnedLink supposed to just be an
+
 0819:         # optimization, or do people use it? It's not documented
+
 0820:         # pylint:disable=redefined-outer-name
+
+0821:         self.rawlink(SpawnedLink(callback))
+
  __Pyx_INCREF(__pyx_v_SpawnedLink);
+  __pyx_t_2 = __pyx_v_SpawnedLink; __pyx_t_3 = NULL;
+  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
+    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+    if (likely(__pyx_t_3)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+      __Pyx_INCREF(__pyx_t_3);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_2, function);
+    }
+  }
+  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_callback) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_callback);
+  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 821, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_2 = ((struct __pyx_vtabstruct_6gevent_9_greenlet_Greenlet *)__pyx_v_self->__pyx_vtab)->rawlink(__pyx_v_self, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 821, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
 0822: 
+
+0823:     def unlink(self, callback):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_49unlink(PyObject *__pyx_v_self, PyObject *__pyx_v_callback); /*proto*/
+static char __pyx_doc_6gevent_9_greenlet_8Greenlet_48unlink[] = "Greenlet.unlink(self, callback)\nRemove the callback set by :meth:`link` or :meth:`rawlink`";
+static PyMethodDef __pyx_mdef_6gevent_9_greenlet_8Greenlet_49unlink = {"unlink", (PyCFunction)__pyx_pw_6gevent_9_greenlet_8Greenlet_49unlink, METH_O, __pyx_doc_6gevent_9_greenlet_8Greenlet_48unlink};
+static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_49unlink(PyObject *__pyx_v_self, PyObject *__pyx_v_callback) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("unlink (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_9_greenlet_8Greenlet_48unlink(((struct __pyx_obj_6gevent_9_greenlet_Greenlet *)__pyx_v_self), ((PyObject *)__pyx_v_callback));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_48unlink(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self, PyObject *__pyx_v_callback) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("unlink", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_XDECREF(__pyx_t_6);
+  __Pyx_AddTraceback("gevent._greenlet.Greenlet.unlink", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__65 = PyTuple_Pack(2, __pyx_n_s_self_2, __pyx_n_s_callback); if (unlikely(!__pyx_tuple__65)) __PYX_ERR(0, 823, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__65);
+  __Pyx_GIVEREF(__pyx_tuple__65);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_9_greenlet_8Greenlet_49unlink, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Greenlet_unlink, NULL, __pyx_n_s_gevent__greenlet, __pyx_d, ((PyObject *)__pyx_codeobj__66)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 823, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet->tp_dict, __pyx_n_s_unlink, __pyx_t_2) < 0) __PYX_ERR(0, 823, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_9_greenlet_Greenlet);
+  __pyx_codeobj__66 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__65, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_greenlet_py, __pyx_n_s_unlink, 823, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__66)) __PYX_ERR(0, 823, __pyx_L1_error)
+
 0824:         """Remove the callback set by :meth:`link` or :meth:`rawlink`"""
+
+0825:         try:
+
  {
+    /*try:*/ {
+/* … */
+    }
+    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+    goto __pyx_L8_try_end;
+    __pyx_L3_error:;
+    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+/* … */
+    __Pyx_XGIVEREF(__pyx_t_1);
+    __Pyx_XGIVEREF(__pyx_t_2);
+    __Pyx_XGIVEREF(__pyx_t_3);
+    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
+    goto __pyx_L1_error;
+    __pyx_L4_exception_handled:;
+    __Pyx_XGIVEREF(__pyx_t_1);
+    __Pyx_XGIVEREF(__pyx_t_2);
+    __Pyx_XGIVEREF(__pyx_t_3);
+    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
+    __pyx_L8_try_end:;
+  }
+
+0826:             self._links.remove(callback) # pylint:disable=no-member
+
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_links, __pyx_n_s_remove); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 826, __pyx_L3_error)
+      __Pyx_GOTREF(__pyx_t_5);
+      __pyx_t_6 = NULL;
+      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
+        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
+        if (likely(__pyx_t_6)) {
+          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
+          __Pyx_INCREF(__pyx_t_6);
+          __Pyx_INCREF(function);
+          __Pyx_DECREF_SET(__pyx_t_5, function);
+        }
+      }
+      __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_v_callback) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_callback);
+      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 826, __pyx_L3_error)
+      __Pyx_GOTREF(__pyx_t_4);
+      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+
+0827:         except ValueError:
+
    __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ValueError);
+    if (__pyx_t_7) {
+      __Pyx_ErrRestore(0,0,0);
+      goto __pyx_L4_exception_handled;
+    }
+    goto __pyx_L5_except_error;
+    __pyx_L5_except_error:;
+
 0828:             pass
+
 0829: 
+
+0830:     def unlink_all(self):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_51unlink_all(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6gevent_9_greenlet_8Greenlet_50unlink_all[] = "Greenlet.unlink_all(self)\n\n        Remove all the callbacks.\n\n        .. versionadded:: 1.3a2\n        ";
+static PyMethodDef __pyx_mdef_6gevent_9_greenlet_8Greenlet_51unlink_all = {"unlink_all", (PyCFunction)__pyx_pw_6gevent_9_greenlet_8Greenlet_51unlink_all, METH_NOARGS, __pyx_doc_6gevent_9_greenlet_8Greenlet_50unlink_all};
+static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_51unlink_all(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("unlink_all (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_9_greenlet_8Greenlet_50unlink_all(((struct __pyx_obj_6gevent_9_greenlet_Greenlet *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_50unlink_all(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("unlink_all", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_AddTraceback("gevent._greenlet.Greenlet.unlink_all", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__67 = PyTuple_Pack(1, __pyx_n_s_self_2); if (unlikely(!__pyx_tuple__67)) __PYX_ERR(0, 830, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__67);
+  __Pyx_GIVEREF(__pyx_tuple__67);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_9_greenlet_8Greenlet_51unlink_all, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Greenlet_unlink_all, NULL, __pyx_n_s_gevent__greenlet, __pyx_d, ((PyObject *)__pyx_codeobj__68)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 830, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet->tp_dict, __pyx_n_s_unlink_all, __pyx_t_2) < 0) __PYX_ERR(0, 830, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_9_greenlet_Greenlet);
+  __pyx_codeobj__68 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__67, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_greenlet_py, __pyx_n_s_unlink_all, 830, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__68)) __PYX_ERR(0, 830, __pyx_L1_error)
+
 0831:         """
+
 0832:         Remove all the callbacks.
+
 0833: 
+
 0834:         .. versionadded:: 1.3a2
+
 0835:         """
+
+0836:         del self._links[:]
+
  if (unlikely(__pyx_v_self->_links == Py_None)) {
+    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
+    __PYX_ERR(0, 836, __pyx_L1_error)
+  }
+  if (__Pyx_PyObject_DelSlice(__pyx_v_self->_links, 0, 0, NULL, NULL, NULL, 0, 0, 1) < 0) __PYX_ERR(0, 836, __pyx_L1_error)
+
 0837: 
+
+0838:     def link_value(self, callback, SpawnedLink=SuccessSpawnedLink):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_53link_value(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_6gevent_9_greenlet_8Greenlet_52link_value[] = "Greenlet.link_value(self, callback, SpawnedLink=SuccessSpawnedLink)\n\n        Like :meth:`link` but *callback* is only notified when the greenlet\n        has completed successfully.\n        ";
+static PyMethodDef __pyx_mdef_6gevent_9_greenlet_8Greenlet_53link_value = {"link_value", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_9_greenlet_8Greenlet_53link_value, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_9_greenlet_8Greenlet_52link_value};
+static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_53link_value(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_callback = 0;
+  PyObject *__pyx_v_SpawnedLink = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("link_value (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_callback,&__pyx_n_s_SpawnedLink,0};
+    PyObject* values[2] = {0,0};
+    values[1] = __pyx_k__14;
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_callback)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_SpawnedLink);
+          if (value) { values[1] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "link_value") < 0)) __PYX_ERR(0, 838, __pyx_L3_error)
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    __pyx_v_callback = values[0];
+    __pyx_v_SpawnedLink = values[1];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("link_value", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 838, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent._greenlet.Greenlet.link_value", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_9_greenlet_8Greenlet_52link_value(((struct __pyx_obj_6gevent_9_greenlet_Greenlet *)__pyx_v_self), __pyx_v_callback, __pyx_v_SpawnedLink);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_52link_value(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self, PyObject *__pyx_v_callback, PyObject *__pyx_v_SpawnedLink) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("link_value", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_AddTraceback("gevent._greenlet.Greenlet.link_value", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __Pyx_INCREF(((PyObject *)__pyx_ptype_6gevent_9_greenlet_SuccessSpawnedLink));
+  __pyx_k__14 = ((PyObject *)__pyx_ptype_6gevent_9_greenlet_SuccessSpawnedLink);
+  __Pyx_GIVEREF(__pyx_ptype_6gevent_9_greenlet_SuccessSpawnedLink);
+/* … */
+  __pyx_tuple__69 = PyTuple_Pack(3, __pyx_n_s_self_2, __pyx_n_s_callback, __pyx_n_s_SpawnedLink); if (unlikely(!__pyx_tuple__69)) __PYX_ERR(0, 838, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__69);
+  __Pyx_GIVEREF(__pyx_tuple__69);
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_9_greenlet_8Greenlet_53link_value, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Greenlet_link_value, NULL, __pyx_n_s_gevent__greenlet, __pyx_d, ((PyObject *)__pyx_codeobj__70)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 838, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet->tp_dict, __pyx_n_s_link_value, __pyx_t_2) < 0) __PYX_ERR(0, 838, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_9_greenlet_Greenlet);
+  __pyx_codeobj__70 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__69, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_greenlet_py, __pyx_n_s_link_value, 838, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__70)) __PYX_ERR(0, 838, __pyx_L1_error)
+
 0839:         """
+
 0840:         Like :meth:`link` but *callback* is only notified when the greenlet
+
 0841:         has completed successfully.
+
 0842:         """
+
 0843:         # pylint:disable=redefined-outer-name
+
+0844:         self.link(callback, SpawnedLink=SpawnedLink)
+
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_link); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 844, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 844, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(__pyx_v_callback);
+  __Pyx_GIVEREF(__pyx_v_callback);
+  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_callback);
+  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 844, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_SpawnedLink, __pyx_v_SpawnedLink) < 0) __PYX_ERR(0, 844, __pyx_L1_error)
+  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 844, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_4);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+
 0845: 
+
+0846:     def link_exception(self, callback, SpawnedLink=FailureSpawnedLink):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_55link_exception(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_6gevent_9_greenlet_8Greenlet_54link_exception[] = "Greenlet.link_exception(self, callback, SpawnedLink=FailureSpawnedLink)\n\n        Like :meth:`link` but *callback* is only notified when the\n        greenlet dies because of an unhandled exception.\n        ";
+static PyMethodDef __pyx_mdef_6gevent_9_greenlet_8Greenlet_55link_exception = {"link_exception", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_9_greenlet_8Greenlet_55link_exception, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_9_greenlet_8Greenlet_54link_exception};
+static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_55link_exception(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_callback = 0;
+  PyObject *__pyx_v_SpawnedLink = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("link_exception (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_callback,&__pyx_n_s_SpawnedLink,0};
+    PyObject* values[2] = {0,0};
+    values[1] = __pyx_k__15;
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_callback)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_SpawnedLink);
+          if (value) { values[1] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "link_exception") < 0)) __PYX_ERR(0, 846, __pyx_L3_error)
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    __pyx_v_callback = values[0];
+    __pyx_v_SpawnedLink = values[1];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("link_exception", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 846, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent._greenlet.Greenlet.link_exception", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_9_greenlet_8Greenlet_54link_exception(((struct __pyx_obj_6gevent_9_greenlet_Greenlet *)__pyx_v_self), __pyx_v_callback, __pyx_v_SpawnedLink);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_54link_exception(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self, PyObject *__pyx_v_callback, PyObject *__pyx_v_SpawnedLink) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("link_exception", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_AddTraceback("gevent._greenlet.Greenlet.link_exception", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __Pyx_INCREF(((PyObject *)__pyx_ptype_6gevent_9_greenlet_FailureSpawnedLink));
+  __pyx_k__15 = ((PyObject *)__pyx_ptype_6gevent_9_greenlet_FailureSpawnedLink);
+  __Pyx_GIVEREF(__pyx_ptype_6gevent_9_greenlet_FailureSpawnedLink);
+/* … */
+  __pyx_tuple__71 = PyTuple_Pack(3, __pyx_n_s_self_2, __pyx_n_s_callback, __pyx_n_s_SpawnedLink); if (unlikely(!__pyx_tuple__71)) __PYX_ERR(0, 846, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__71);
+  __Pyx_GIVEREF(__pyx_tuple__71);
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_9_greenlet_8Greenlet_55link_exception, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Greenlet_link_exception, NULL, __pyx_n_s_gevent__greenlet, __pyx_d, ((PyObject *)__pyx_codeobj__72)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 846, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet->tp_dict, __pyx_n_s_link_exception, __pyx_t_2) < 0) __PYX_ERR(0, 846, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_9_greenlet_Greenlet);
+  __pyx_codeobj__72 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__71, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_greenlet_py, __pyx_n_s_link_exception, 846, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__72)) __PYX_ERR(0, 846, __pyx_L1_error)
+
 0847:         """
+
 0848:         Like :meth:`link` but *callback* is only notified when the
+
 0849:         greenlet dies because of an unhandled exception.
+
 0850:         """
+
 0851:         # pylint:disable=redefined-outer-name
+
+0852:         self.link(callback, SpawnedLink=SpawnedLink)
+
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_link); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 852, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 852, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(__pyx_v_callback);
+  __Pyx_GIVEREF(__pyx_v_callback);
+  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_callback);
+  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 852, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_SpawnedLink, __pyx_v_SpawnedLink) < 0) __PYX_ERR(0, 852, __pyx_L1_error)
+  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 852, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_4);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+
 0853: 
+
+0854:     def _notify_links(self):
+
static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_57_notify_links(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyObject *__pyx_f_6gevent_9_greenlet_8Greenlet__notify_links(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self, int __pyx_skip_dispatch) {
+  PyObject *__pyx_v_link = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_notify_links", 0);
+  /* Check if called by wrapper */
+  if (unlikely(__pyx_skip_dispatch)) ;
+  /* Check if overridden in Python */
+  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
+    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
+    if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
+    else {
+      PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      #endif
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_notify_links); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 854, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_9_greenlet_8Greenlet_57_notify_links)) {
+        __Pyx_XDECREF(__pyx_r);
+        __Pyx_INCREF(__pyx_t_1);
+        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+          if (likely(__pyx_t_4)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+            __Pyx_INCREF(__pyx_t_4);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_3, function);
+          }
+        }
+        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
+        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 854, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __pyx_r = __pyx_t_2;
+        __pyx_t_2 = 0;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        goto __pyx_L0;
+      }
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+      tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
+      if (unlikely(type_dict_guard != tp_dict_version)) {
+        tp_dict_version = obj_dict_version = 0;
+      }
+      #endif
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    }
+    #endif
+  }
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_9);
+  __Pyx_XDECREF(__pyx_t_10);
+  __Pyx_XDECREF(__pyx_t_11);
+  __Pyx_XDECREF(__pyx_t_12);
+  __Pyx_AddTraceback("gevent._greenlet.Greenlet._notify_links", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_link);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_57_notify_links(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6gevent_9_greenlet_8Greenlet_56_notify_links[] = "Greenlet._notify_links(self)";
+static PyMethodDef __pyx_mdef_6gevent_9_greenlet_8Greenlet_57_notify_links = {"_notify_links", (PyCFunction)__pyx_pw_6gevent_9_greenlet_8Greenlet_57_notify_links, METH_NOARGS, __pyx_doc_6gevent_9_greenlet_8Greenlet_56_notify_links};
+static PyObject *__pyx_pw_6gevent_9_greenlet_8Greenlet_57_notify_links(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_notify_links (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_9_greenlet_8Greenlet_56_notify_links(((struct __pyx_obj_6gevent_9_greenlet_Greenlet *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_9_greenlet_8Greenlet_56_notify_links(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_notify_links", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __pyx_f_6gevent_9_greenlet_8Greenlet__notify_links(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 854, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent._greenlet.Greenlet._notify_links", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__73 = PyTuple_Pack(1, __pyx_n_s_self_2); if (unlikely(!__pyx_tuple__73)) __PYX_ERR(0, 854, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__73);
+  __Pyx_GIVEREF(__pyx_tuple__73);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_9_greenlet_8Greenlet_57_notify_links, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Greenlet__notify_links, NULL, __pyx_n_s_gevent__greenlet, __pyx_d, ((PyObject *)__pyx_codeobj__74)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 854, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet_Greenlet->tp_dict, __pyx_n_s_notify_links, __pyx_t_2) < 0) __PYX_ERR(0, 854, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_9_greenlet_Greenlet);
+  __pyx_codeobj__74 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__73, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_greenlet_py, __pyx_n_s_notify_links, 854, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__74)) __PYX_ERR(0, 854, __pyx_L1_error)
+
+0855:         while self._links:
+
  while (1) {
+    __pyx_t_5 = (__pyx_v_self->_links != Py_None)&&(PyList_GET_SIZE(__pyx_v_self->_links) != 0);
+    if (!__pyx_t_5) break;
+
 0856:             # Early links are allowed to remove later links
+
 0857:             # before we get to them, and they're also allowed to
+
 0858:             # add new links, so we have to be careful about iterating.
+
 0859: 
+
 0860:             # We don't expect this list to be very large, so the time spent
+
 0861:             # manipulating it should be small. a deque is probably not justified.
+
 0862:             # Cython has optimizations to transform this into a memmove anyway.
+
+0863:             link = self._links.pop(0)
+
    if (unlikely(__pyx_v_self->_links == Py_None)) {
+      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "pop");
+      __PYX_ERR(0, 863, __pyx_L1_error)
+    }
+    __pyx_t_1 = __Pyx_PyList_PopIndex(__pyx_v_self->_links, __pyx_int_0, 0, 1, Py_ssize_t, PyInt_FromSsize_t); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 863, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_XDECREF_SET(__pyx_v_link, __pyx_t_1);
+    __pyx_t_1 = 0;
+
+0864:             try:
+
    {
+      /*try:*/ {
+/* … */
+      }
+      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
+      goto __pyx_L12_try_end;
+      __pyx_L5_error:;
+      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+/* … */
+      __Pyx_XGIVEREF(__pyx_t_6);
+      __Pyx_XGIVEREF(__pyx_t_7);
+      __Pyx_XGIVEREF(__pyx_t_8);
+      __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
+      goto __pyx_L1_error;
+      __pyx_L6_exception_handled:;
+      __Pyx_XGIVEREF(__pyx_t_6);
+      __Pyx_XGIVEREF(__pyx_t_7);
+      __Pyx_XGIVEREF(__pyx_t_8);
+      __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
+      __pyx_L12_try_end:;
+    }
+  }
+
+0865:                 link(self)
+
        __Pyx_INCREF(__pyx_v_link);
+        __pyx_t_2 = __pyx_v_link; __pyx_t_3 = NULL;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
+          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+          if (likely(__pyx_t_3)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+            __Pyx_INCREF(__pyx_t_3);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_2, function);
+          }
+        }
+        __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, ((PyObject *)__pyx_v_self)) : __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_v_self));
+        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+        if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 865, __pyx_L5_error)
+        __Pyx_GOTREF(__pyx_t_1);
+        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+0866:             except: # pylint:disable=bare-except
+
      /*except:*/ {
+        __Pyx_AddTraceback("gevent._greenlet.Greenlet._notify_links", __pyx_clineno, __pyx_lineno, __pyx_filename);
+        if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3) < 0) __PYX_ERR(0, 866, __pyx_L7_except_error)
+        __Pyx_GOTREF(__pyx_t_1);
+        __Pyx_GOTREF(__pyx_t_2);
+        __Pyx_GOTREF(__pyx_t_3);
+
+0867:                 self.parent.handle_error((link, self), *sys_exc_info())
+
        __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_parent); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 867, __pyx_L7_except_error)
+        __Pyx_GOTREF(__pyx_t_4);
+        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_handle_error); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 867, __pyx_L7_except_error)
+        __Pyx_GOTREF(__pyx_t_9);
+        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+        __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 867, __pyx_L7_except_error)
+        __Pyx_GOTREF(__pyx_t_4);
+        __Pyx_INCREF(__pyx_v_link);
+        __Pyx_GIVEREF(__pyx_v_link);
+        PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_link);
+        __Pyx_INCREF(((PyObject *)__pyx_v_self));
+        __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
+        PyTuple_SET_ITEM(__pyx_t_4, 1, ((PyObject *)__pyx_v_self));
+        __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 867, __pyx_L7_except_error)
+        __Pyx_GOTREF(__pyx_t_10);
+        __Pyx_GIVEREF(__pyx_t_4);
+        PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_4);
+        __pyx_t_4 = 0;
+        __Pyx_INCREF(__pyx_v_6gevent_9_greenlet_sys_exc_info);
+        __pyx_t_11 = __pyx_v_6gevent_9_greenlet_sys_exc_info; __pyx_t_12 = NULL;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_11))) {
+          __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_11);
+          if (likely(__pyx_t_12)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
+            __Pyx_INCREF(__pyx_t_12);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_11, function);
+          }
+        }
+        __pyx_t_4 = (__pyx_t_12) ? __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_t_12) : __Pyx_PyObject_CallNoArg(__pyx_t_11);
+        __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
+        if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 867, __pyx_L7_except_error)
+        __Pyx_GOTREF(__pyx_t_4);
+        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+        __pyx_t_11 = __Pyx_PySequence_Tuple(__pyx_t_4); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 867, __pyx_L7_except_error)
+        __Pyx_GOTREF(__pyx_t_11);
+        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+        __pyx_t_4 = PyNumber_Add(__pyx_t_10, __pyx_t_11); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 867, __pyx_L7_except_error)
+        __Pyx_GOTREF(__pyx_t_4);
+        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+        __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_4, NULL); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 867, __pyx_L7_except_error)
+        __Pyx_GOTREF(__pyx_t_11);
+        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+        goto __pyx_L6_exception_handled;
+      }
+      __pyx_L7_except_error:;
+
 0868: 
+
 0869: 
+
+0870: class _dummy_event(object):
+
struct __pyx_vtabstruct_6gevent_9_greenlet__dummy_event {
+  PyObject *(*stop)(struct __pyx_obj_6gevent_9_greenlet__dummy_event *, int __pyx_skip_dispatch);
+  PyObject *(*start)(struct __pyx_obj_6gevent_9_greenlet__dummy_event *, PyObject *, int __pyx_skip_dispatch);
+  PyObject *(*close)(struct __pyx_obj_6gevent_9_greenlet__dummy_event *, int __pyx_skip_dispatch);
+};
+static struct __pyx_vtabstruct_6gevent_9_greenlet__dummy_event *__pyx_vtabptr_6gevent_9_greenlet__dummy_event;
+
+0871:     __slots__ = ('pending', 'active')
+
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet__dummy_event->tp_dict, __pyx_n_s_slots, __pyx_tuple__75) < 0) __PYX_ERR(0, 871, __pyx_L1_error)
+  PyType_Modified(__pyx_ptype_6gevent_9_greenlet__dummy_event);
+/* … */
+  __pyx_tuple__75 = PyTuple_Pack(2, __pyx_n_s_pending, __pyx_n_s_active); if (unlikely(!__pyx_tuple__75)) __PYX_ERR(0, 871, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__75);
+  __Pyx_GIVEREF(__pyx_tuple__75);
+
 0872: 
+
+0873:     def __init__(self):
+
/* Python wrapper */
+static int __pyx_pw_6gevent_9_greenlet_12_dummy_event_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static int __pyx_pw_6gevent_9_greenlet_12_dummy_event_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
+  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
+    __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
+  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1;
+  __pyx_r = __pyx_pf_6gevent_9_greenlet_12_dummy_event___init__(((struct __pyx_obj_6gevent_9_greenlet__dummy_event *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_9_greenlet_12_dummy_event___init__(struct __pyx_obj_6gevent_9_greenlet__dummy_event *__pyx_v_self) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = 0;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0874:         self.pending = self.active = False
+
  __pyx_v_self->pending = 0;
+  __pyx_v_self->active = 0;
+
 0875: 
+
+0876:     def stop(self):
+
static PyObject *__pyx_pw_6gevent_9_greenlet_12_dummy_event_3stop(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyObject *__pyx_f_6gevent_9_greenlet_12_dummy_event_stop(CYTHON_UNUSED struct __pyx_obj_6gevent_9_greenlet__dummy_event *__pyx_v_self, CYTHON_UNUSED int __pyx_skip_dispatch) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("stop", 0);
+
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_9_greenlet_12_dummy_event_3stop(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6gevent_9_greenlet_12_dummy_event_2stop[] = "_dummy_event.stop(self)";
+static PyMethodDef __pyx_mdef_6gevent_9_greenlet_12_dummy_event_3stop = {"stop", (PyCFunction)__pyx_pw_6gevent_9_greenlet_12_dummy_event_3stop, METH_NOARGS, __pyx_doc_6gevent_9_greenlet_12_dummy_event_2stop};
+static PyObject *__pyx_pw_6gevent_9_greenlet_12_dummy_event_3stop(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("stop (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_9_greenlet_12_dummy_event_2stop(((struct __pyx_obj_6gevent_9_greenlet__dummy_event *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_9_greenlet_12_dummy_event_2stop(struct __pyx_obj_6gevent_9_greenlet__dummy_event *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("stop", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __pyx_f_6gevent_9_greenlet_12_dummy_event_stop(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 876, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent._greenlet._dummy_event.stop", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__76 = PyTuple_Pack(1, __pyx_n_s_self_2); if (unlikely(!__pyx_tuple__76)) __PYX_ERR(0, 876, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__76);
+  __Pyx_GIVEREF(__pyx_tuple__76);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_9_greenlet_12_dummy_event_3stop, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_dummy_event_stop, NULL, __pyx_n_s_gevent__greenlet, __pyx_d, ((PyObject *)__pyx_codeobj__77)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 876, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet__dummy_event->tp_dict, __pyx_n_s_stop, __pyx_t_2) < 0) __PYX_ERR(0, 876, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_9_greenlet__dummy_event);
+  __pyx_codeobj__77 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__76, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_greenlet_py, __pyx_n_s_stop, 876, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__77)) __PYX_ERR(0, 876, __pyx_L1_error)
+
 0877:         pass
+
 0878: 
+
+0879:     def start(self, cb): # pylint:disable=unused-argument
+
static PyObject *__pyx_pw_6gevent_9_greenlet_12_dummy_event_5start(PyObject *__pyx_v_self, PyObject *__pyx_v_cb); /*proto*/
+static PyObject *__pyx_f_6gevent_9_greenlet_12_dummy_event_start(CYTHON_UNUSED struct __pyx_obj_6gevent_9_greenlet__dummy_event *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_cb, CYTHON_UNUSED int __pyx_skip_dispatch) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("start", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent._greenlet._dummy_event.start", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_9_greenlet_12_dummy_event_5start(PyObject *__pyx_v_self, PyObject *__pyx_v_cb); /*proto*/
+static char __pyx_doc_6gevent_9_greenlet_12_dummy_event_4start[] = "_dummy_event.start(self, cb)";
+static PyMethodDef __pyx_mdef_6gevent_9_greenlet_12_dummy_event_5start = {"start", (PyCFunction)__pyx_pw_6gevent_9_greenlet_12_dummy_event_5start, METH_O, __pyx_doc_6gevent_9_greenlet_12_dummy_event_4start};
+static PyObject *__pyx_pw_6gevent_9_greenlet_12_dummy_event_5start(PyObject *__pyx_v_self, PyObject *__pyx_v_cb) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("start (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_9_greenlet_12_dummy_event_4start(((struct __pyx_obj_6gevent_9_greenlet__dummy_event *)__pyx_v_self), ((PyObject *)__pyx_v_cb));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_9_greenlet_12_dummy_event_4start(struct __pyx_obj_6gevent_9_greenlet__dummy_event *__pyx_v_self, PyObject *__pyx_v_cb) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("start", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __pyx_f_6gevent_9_greenlet_12_dummy_event_start(__pyx_v_self, __pyx_v_cb, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 879, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent._greenlet._dummy_event.start", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__78 = PyTuple_Pack(2, __pyx_n_s_self_2, __pyx_n_s_cb); if (unlikely(!__pyx_tuple__78)) __PYX_ERR(0, 879, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__78);
+  __Pyx_GIVEREF(__pyx_tuple__78);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_9_greenlet_12_dummy_event_5start, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_dummy_event_start, NULL, __pyx_n_s_gevent__greenlet, __pyx_d, ((PyObject *)__pyx_codeobj__79)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 879, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet__dummy_event->tp_dict, __pyx_n_s_start, __pyx_t_2) < 0) __PYX_ERR(0, 879, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_9_greenlet__dummy_event);
+  __pyx_codeobj__79 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__78, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_greenlet_py, __pyx_n_s_start, 879, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__79)) __PYX_ERR(0, 879, __pyx_L1_error)
+
+0880:         raise AssertionError("Cannot start the dummy event")
+
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_AssertionError, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 880, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __PYX_ERR(0, 880, __pyx_L1_error)
+/* … */
+  __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s_Cannot_start_the_dummy_event); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(0, 880, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__16);
+  __Pyx_GIVEREF(__pyx_tuple__16);
+
 0881: 
+
+0882:     def close(self):
+
static PyObject *__pyx_pw_6gevent_9_greenlet_12_dummy_event_7close(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyObject *__pyx_f_6gevent_9_greenlet_12_dummy_event_close(CYTHON_UNUSED struct __pyx_obj_6gevent_9_greenlet__dummy_event *__pyx_v_self, CYTHON_UNUSED int __pyx_skip_dispatch) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("close", 0);
+
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_9_greenlet_12_dummy_event_7close(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6gevent_9_greenlet_12_dummy_event_6close[] = "_dummy_event.close(self)";
+static PyMethodDef __pyx_mdef_6gevent_9_greenlet_12_dummy_event_7close = {"close", (PyCFunction)__pyx_pw_6gevent_9_greenlet_12_dummy_event_7close, METH_NOARGS, __pyx_doc_6gevent_9_greenlet_12_dummy_event_6close};
+static PyObject *__pyx_pw_6gevent_9_greenlet_12_dummy_event_7close(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("close (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_9_greenlet_12_dummy_event_6close(((struct __pyx_obj_6gevent_9_greenlet__dummy_event *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_9_greenlet_12_dummy_event_6close(struct __pyx_obj_6gevent_9_greenlet__dummy_event *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("close", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __pyx_f_6gevent_9_greenlet_12_dummy_event_close(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 882, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent._greenlet._dummy_event.close", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__80 = PyTuple_Pack(1, __pyx_n_s_self_2); if (unlikely(!__pyx_tuple__80)) __PYX_ERR(0, 882, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__80);
+  __Pyx_GIVEREF(__pyx_tuple__80);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_9_greenlet_12_dummy_event_7close, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_dummy_event_close, NULL, __pyx_n_s_gevent__greenlet, __pyx_d, ((PyObject *)__pyx_codeobj__81)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 882, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_9_greenlet__dummy_event->tp_dict, __pyx_n_s_close, __pyx_t_2) < 0) __PYX_ERR(0, 882, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_9_greenlet__dummy_event);
+  __pyx_codeobj__81 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__80, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_greenlet_py, __pyx_n_s_close, 882, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__81)) __PYX_ERR(0, 882, __pyx_L1_error)
+
 0883:         pass
+
 0884: 
+
+0885: _cancelled_start_event = _dummy_event()
+
  __pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_6gevent_9_greenlet__dummy_event)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 885, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_XGOTREF(((PyObject *)__pyx_v_6gevent_9_greenlet__cancelled_start_event));
+  __Pyx_DECREF_SET(__pyx_v_6gevent_9_greenlet__cancelled_start_event, ((struct __pyx_obj_6gevent_9_greenlet__dummy_event *)__pyx_t_2));
+  __Pyx_GIVEREF(__pyx_t_2);
+  __pyx_t_2 = 0;
+
+0886: _start_completed_event = _dummy_event()
+
  __pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_6gevent_9_greenlet__dummy_event)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 886, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_XGOTREF(((PyObject *)__pyx_v_6gevent_9_greenlet__start_completed_event));
+  __Pyx_DECREF_SET(__pyx_v_6gevent_9_greenlet__start_completed_event, ((struct __pyx_obj_6gevent_9_greenlet__dummy_event *)__pyx_t_2));
+  __Pyx_GIVEREF(__pyx_t_2);
+  __pyx_t_2 = 0;
+
 0887: 
+
 0888: 
+
+0889: def _kill(glet, exception, waiter):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_9_greenlet_1_kill(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_6gevent_9_greenlet__kill[] = "_kill(glet, exception, waiter)";
+static PyMethodDef __pyx_mdef_6gevent_9_greenlet_1_kill = {"_kill", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_9_greenlet_1_kill, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_9_greenlet__kill};
+static PyObject *__pyx_pw_6gevent_9_greenlet_1_kill(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_glet = 0;
+  PyObject *__pyx_v_exception = 0;
+  PyObject *__pyx_v_waiter = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_kill (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_glet,&__pyx_n_s_exception,&__pyx_n_s_waiter,0};
+    PyObject* values[3] = {0,0,0};
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_glet)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_exception)) != 0)) kw_args--;
+        else {
+          __Pyx_RaiseArgtupleInvalid("_kill", 1, 3, 3, 1); __PYX_ERR(0, 889, __pyx_L3_error)
+        }
+        CYTHON_FALLTHROUGH;
+        case  2:
+        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_waiter)) != 0)) kw_args--;
+        else {
+          __Pyx_RaiseArgtupleInvalid("_kill", 1, 3, 3, 2); __PYX_ERR(0, 889, __pyx_L3_error)
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_kill") < 0)) __PYX_ERR(0, 889, __pyx_L3_error)
+      }
+    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
+      goto __pyx_L5_argtuple_error;
+    } else {
+      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+    }
+    __pyx_v_glet = values[0];
+    __pyx_v_exception = values[1];
+    __pyx_v_waiter = values[2];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("_kill", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 889, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent._greenlet._kill", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_9_greenlet__kill(__pyx_self, __pyx_v_glet, __pyx_v_exception, __pyx_v_waiter);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_9_greenlet__kill(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_glet, PyObject *__pyx_v_exception, PyObject *__pyx_v_waiter) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_kill", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_XDECREF(__pyx_t_6);
+  __Pyx_XDECREF(__pyx_t_7);
+  __Pyx_XDECREF(__pyx_t_8);
+  __Pyx_XDECREF(__pyx_t_9);
+  __Pyx_XDECREF(__pyx_t_10);
+  __Pyx_XDECREF(__pyx_t_11);
+  __Pyx_AddTraceback("gevent._greenlet._kill", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__82 = PyTuple_Pack(3, __pyx_n_s_glet, __pyx_n_s_exception, __pyx_n_s_waiter); if (unlikely(!__pyx_tuple__82)) __PYX_ERR(0, 889, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__82);
+  __Pyx_GIVEREF(__pyx_tuple__82);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_9_greenlet_1_kill, 0, __pyx_n_s_kill, NULL, __pyx_n_s_gevent__greenlet, __pyx_d, ((PyObject *)__pyx_codeobj__83)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 889, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_kill, __pyx_t_2) < 0) __PYX_ERR(0, 889, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_codeobj__83 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__82, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_greenlet_py, __pyx_n_s_kill, 889, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__83)) __PYX_ERR(0, 889, __pyx_L1_error)
+
+0890:     try:
+
  {
+    /*try:*/ {
+/* … */
+    }
+    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+    goto __pyx_L8_try_end;
+    __pyx_L3_error:;
+    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+/* … */
+    __Pyx_XGIVEREF(__pyx_t_1);
+    __Pyx_XGIVEREF(__pyx_t_2);
+    __Pyx_XGIVEREF(__pyx_t_3);
+    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
+    goto __pyx_L1_error;
+    __pyx_L4_exception_handled:;
+    __Pyx_XGIVEREF(__pyx_t_1);
+    __Pyx_XGIVEREF(__pyx_t_2);
+    __Pyx_XGIVEREF(__pyx_t_3);
+    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
+    __pyx_L8_try_end:;
+  }
+
+0891:         glet.throw(exception)
+
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_glet, __pyx_n_s_throw); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 891, __pyx_L3_error)
+      __Pyx_GOTREF(__pyx_t_5);
+      __pyx_t_6 = NULL;
+      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
+        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
+        if (likely(__pyx_t_6)) {
+          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
+          __Pyx_INCREF(__pyx_t_6);
+          __Pyx_INCREF(function);
+          __Pyx_DECREF_SET(__pyx_t_5, function);
+        }
+      }
+      __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_v_exception) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_exception);
+      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 891, __pyx_L3_error)
+      __Pyx_GOTREF(__pyx_t_4);
+      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+
+0892:     except: # pylint:disable=bare-except
+
    /*except:*/ {
+      __Pyx_AddTraceback("gevent._greenlet._kill", __pyx_clineno, __pyx_lineno, __pyx_filename);
+      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6) < 0) __PYX_ERR(0, 892, __pyx_L5_except_error)
+      __Pyx_GOTREF(__pyx_t_4);
+      __Pyx_GOTREF(__pyx_t_5);
+      __Pyx_GOTREF(__pyx_t_6);
+
 0893:         # XXX do we need this here?
+
+0894:         glet.parent.handle_error(glet, *sys_exc_info())
+
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_glet, __pyx_n_s_parent); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 894, __pyx_L5_except_error)
+      __Pyx_GOTREF(__pyx_t_7);
+      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_handle_error); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 894, __pyx_L5_except_error)
+      __Pyx_GOTREF(__pyx_t_8);
+      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+      __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 894, __pyx_L5_except_error)
+      __Pyx_GOTREF(__pyx_t_7);
+      __Pyx_INCREF(__pyx_v_glet);
+      __Pyx_GIVEREF(__pyx_v_glet);
+      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_glet);
+      __Pyx_INCREF(__pyx_v_6gevent_9_greenlet_sys_exc_info);
+      __pyx_t_10 = __pyx_v_6gevent_9_greenlet_sys_exc_info; __pyx_t_11 = NULL;
+      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_10))) {
+        __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_10);
+        if (likely(__pyx_t_11)) {
+          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
+          __Pyx_INCREF(__pyx_t_11);
+          __Pyx_INCREF(function);
+          __Pyx_DECREF_SET(__pyx_t_10, function);
+        }
+      }
+      __pyx_t_9 = (__pyx_t_11) ? __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_t_11) : __Pyx_PyObject_CallNoArg(__pyx_t_10);
+      __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
+      if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 894, __pyx_L5_except_error)
+      __Pyx_GOTREF(__pyx_t_9);
+      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+      __pyx_t_10 = __Pyx_PySequence_Tuple(__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 894, __pyx_L5_except_error)
+      __Pyx_GOTREF(__pyx_t_10);
+      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+      __pyx_t_9 = PyNumber_Add(__pyx_t_7, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 894, __pyx_L5_except_error)
+      __Pyx_GOTREF(__pyx_t_9);
+      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+      __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_9, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 894, __pyx_L5_except_error)
+      __Pyx_GOTREF(__pyx_t_10);
+      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+      goto __pyx_L4_exception_handled;
+    }
+    __pyx_L5_except_error:;
+
+0895:     if waiter is not None:
+
  __pyx_t_12 = (__pyx_v_waiter != Py_None);
+  __pyx_t_13 = (__pyx_t_12 != 0);
+  if (__pyx_t_13) {
+/* … */
+  }
+
+0896:         waiter.switch(None)
+
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_waiter, __pyx_n_s_switch); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 896, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_5);
+    __pyx_t_4 = NULL;
+    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
+      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
+      if (likely(__pyx_t_4)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
+        __Pyx_INCREF(__pyx_t_4);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_5, function);
+      }
+    }
+    __pyx_t_6 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_4, Py_None) : __Pyx_PyObject_CallOneArg(__pyx_t_5, Py_None);
+    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+    if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 896, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_6);
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+
 0897: 
+
 0898: 
+
+0899: def joinall(greenlets, timeout=None, raise_error=False, count=None):
+
static PyObject *__pyx_pw_6gevent_9_greenlet_3joinall(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_f_6gevent_9_greenlet_joinall(PyObject *__pyx_v_greenlets, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_9_greenlet_joinall *__pyx_optional_args) {
+  PyObject *__pyx_v_timeout = ((PyObject *)Py_None);
+  PyObject *__pyx_v_raise_error = ((PyObject *)Py_False);
+  PyObject *__pyx_v_count = ((PyObject *)Py_None);
+  PyObject *__pyx_v_done = 0;
+  PyObject *__pyx_v_obj = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("joinall", 0);
+  if (__pyx_optional_args) {
+    if (__pyx_optional_args->__pyx_n > 0) {
+      __pyx_v_timeout = __pyx_optional_args->timeout;
+      if (__pyx_optional_args->__pyx_n > 1) {
+        __pyx_v_raise_error = __pyx_optional_args->raise_error;
+        if (__pyx_optional_args->__pyx_n > 2) {
+          __pyx_v_count = __pyx_optional_args->count;
+        }
+      }
+    }
+  }
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_XDECREF(__pyx_t_8);
+  __Pyx_AddTraceback("gevent._greenlet.joinall", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_done);
+  __Pyx_XDECREF(__pyx_v_obj);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_9_greenlet_3joinall(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_6gevent_9_greenlet_2joinall[] = "joinall(greenlets, timeout=None, raise_error=False, count=None)\n\n    Wait for the ``greenlets`` to finish.\n\n    :param greenlets: A sequence (supporting :func:`len`) of greenlets to wait for.\n    :keyword float timeout: If given, the maximum number of seconds to wait.\n    :return: A sequence of the greenlets that finished before the timeout (if any)\n        expired.\n    ";
+static PyMethodDef __pyx_mdef_6gevent_9_greenlet_3joinall = {"joinall", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_9_greenlet_3joinall, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_9_greenlet_2joinall};
+static PyObject *__pyx_pw_6gevent_9_greenlet_3joinall(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_greenlets = 0;
+  PyObject *__pyx_v_timeout = 0;
+  PyObject *__pyx_v_raise_error = 0;
+  PyObject *__pyx_v_count = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("joinall (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_greenlets,&__pyx_n_s_timeout,&__pyx_n_s_raise_error,&__pyx_n_s_count,0};
+    PyObject* values[4] = {0,0,0,0};
+    values[1] = ((PyObject *)Py_None);
+    values[2] = ((PyObject *)Py_False);
+    values[3] = ((PyObject *)Py_None);
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
+        CYTHON_FALLTHROUGH;
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_greenlets)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_timeout);
+          if (value) { values[1] = value; kw_args--; }
+        }
+        CYTHON_FALLTHROUGH;
+        case  2:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_raise_error);
+          if (value) { values[2] = value; kw_args--; }
+        }
+        CYTHON_FALLTHROUGH;
+        case  3:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_count);
+          if (value) { values[3] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "joinall") < 0)) __PYX_ERR(0, 899, __pyx_L3_error)
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
+        CYTHON_FALLTHROUGH;
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    __pyx_v_greenlets = values[0];
+    __pyx_v_timeout = values[1];
+    __pyx_v_raise_error = values[2];
+    __pyx_v_count = values[3];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("joinall", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 899, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent._greenlet.joinall", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_9_greenlet_2joinall(__pyx_self, __pyx_v_greenlets, __pyx_v_timeout, __pyx_v_raise_error, __pyx_v_count);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_9_greenlet_2joinall(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_greenlets, PyObject *__pyx_v_timeout, PyObject *__pyx_v_raise_error, PyObject *__pyx_v_count) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("joinall", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_2.__pyx_n = 3;
+  __pyx_t_2.timeout = __pyx_v_timeout;
+  __pyx_t_2.raise_error = __pyx_v_raise_error;
+  __pyx_t_2.count = __pyx_v_count;
+  __pyx_t_1 = __pyx_f_6gevent_9_greenlet_joinall(__pyx_v_greenlets, 0, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 899, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent._greenlet.joinall", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__84 = PyTuple_Pack(4, __pyx_n_s_greenlets, __pyx_n_s_timeout, __pyx_n_s_raise_error, __pyx_n_s_count); if (unlikely(!__pyx_tuple__84)) __PYX_ERR(0, 899, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__84);
+  __Pyx_GIVEREF(__pyx_tuple__84);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_9_greenlet_3joinall, 0, __pyx_n_s_joinall, NULL, __pyx_n_s_gevent__greenlet, __pyx_d, ((PyObject *)__pyx_codeobj__85)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 899, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_joinall, __pyx_t_2) < 0) __PYX_ERR(0, 899, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_codeobj__85 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__84, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_greenlet_py, __pyx_n_s_joinall, 899, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__85)) __PYX_ERR(0, 899, __pyx_L1_error)
+
 0900:     """
+
 0901:     Wait for the ``greenlets`` to finish.
+
 0902: 
+
 0903:     :param greenlets: A sequence (supporting :func:`len`) of greenlets to wait for.
+
 0904:     :keyword float timeout: If given, the maximum number of seconds to wait.
+
 0905:     :return: A sequence of the greenlets that finished before the timeout (if any)
+
 0906:         expired.
+
 0907:     """
+
+0908:     if not raise_error:
+
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_raise_error); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 908, __pyx_L1_error)
+  __pyx_t_2 = ((!__pyx_t_1) != 0);
+  if (__pyx_t_2) {
+/* … */
+  }
+
+0909:         return wait(greenlets, timeout=timeout, count=count)
+
    __Pyx_XDECREF(__pyx_r);
+    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 909, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_INCREF(__pyx_v_greenlets);
+    __Pyx_GIVEREF(__pyx_v_greenlets);
+    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_greenlets);
+    __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 909, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_timeout, __pyx_v_timeout) < 0) __PYX_ERR(0, 909, __pyx_L1_error)
+    if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_count, __pyx_v_count) < 0) __PYX_ERR(0, 909, __pyx_L1_error)
+    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_v_6gevent_9_greenlet_wait, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 909, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_5);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __pyx_r = __pyx_t_5;
+    __pyx_t_5 = 0;
+    goto __pyx_L0;
+
 0910: 
+
+0911:     done = []
+
  __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 911, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_5);
+  __pyx_v_done = ((PyObject*)__pyx_t_5);
+  __pyx_t_5 = 0;
+
+0912:     for obj in iwait(greenlets, timeout=timeout, count=count):
+
  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 912, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_5);
+  __Pyx_INCREF(__pyx_v_greenlets);
+  __Pyx_GIVEREF(__pyx_v_greenlets);
+  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_greenlets);
+  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 912, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_4);
+  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_timeout, __pyx_v_timeout) < 0) __PYX_ERR(0, 912, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_count, __pyx_v_count) < 0) __PYX_ERR(0, 912, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_v_6gevent_9_greenlet_iwait, __pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 912, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
+    __pyx_t_4 = __pyx_t_3; __Pyx_INCREF(__pyx_t_4); __pyx_t_6 = 0;
+    __pyx_t_7 = NULL;
+  } else {
+    __pyx_t_6 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 912, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    __pyx_t_7 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 912, __pyx_L1_error)
+  }
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  for (;;) {
+    if (likely(!__pyx_t_7)) {
+      if (likely(PyList_CheckExact(__pyx_t_4))) {
+        if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_4)) break;
+        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+        __pyx_t_3 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_6); __Pyx_INCREF(__pyx_t_3); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 912, __pyx_L1_error)
+        #else
+        __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 912, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_3);
+        #endif
+      } else {
+        if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
+        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+        __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_6); __Pyx_INCREF(__pyx_t_3); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 912, __pyx_L1_error)
+        #else
+        __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 912, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_3);
+        #endif
+      }
+    } else {
+      __pyx_t_3 = __pyx_t_7(__pyx_t_4);
+      if (unlikely(!__pyx_t_3)) {
+        PyObject* exc_type = PyErr_Occurred();
+        if (exc_type) {
+          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+          else __PYX_ERR(0, 912, __pyx_L1_error)
+        }
+        break;
+      }
+      __Pyx_GOTREF(__pyx_t_3);
+    }
+    __Pyx_XDECREF_SET(__pyx_v_obj, __pyx_t_3);
+    __pyx_t_3 = 0;
+/* … */
+  }
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+
+0913:         if getattr(obj, 'exception', None) is not None:
+
    __pyx_t_3 = __Pyx_GetAttr3(__pyx_v_obj, __pyx_n_s_exception, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 913, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __pyx_t_2 = (__pyx_t_3 != Py_None);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __pyx_t_1 = (__pyx_t_2 != 0);
+    if (__pyx_t_1) {
+/* … */
+    }
+
+0914:             if hasattr(obj, '_raise_exception'):
+
      __pyx_t_1 = __Pyx_HasAttr(__pyx_v_obj, __pyx_n_s_raise_exception); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 914, __pyx_L1_error)
+      __pyx_t_2 = (__pyx_t_1 != 0);
+      if (likely(__pyx_t_2)) {
+/* … */
+        goto __pyx_L7;
+      }
+
+0915:                 obj._raise_exception()
+
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_raise_exception); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 915, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_5);
+        __pyx_t_8 = NULL;
+        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
+          __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5);
+          if (likely(__pyx_t_8)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
+            __Pyx_INCREF(__pyx_t_8);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_5, function);
+          }
+        }
+        __pyx_t_3 = (__pyx_t_8) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_8) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
+        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
+        if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 915, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_3);
+        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+
 0916:             else:
+
+0917:                 raise obj.exception
+
      /*else*/ {
+        __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_exception); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 917, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_3);
+        __Pyx_Raise(__pyx_t_3, 0, 0, 0);
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __PYX_ERR(0, 917, __pyx_L1_error)
+      }
+      __pyx_L7:;
+
+0918:         done.append(obj)
+
    __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_done, __pyx_v_obj); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 918, __pyx_L1_error)
+
+0919:     return done
+
  __Pyx_XDECREF(__pyx_r);
+  __Pyx_INCREF(__pyx_v_done);
+  __pyx_r = __pyx_v_done;
+  goto __pyx_L0;
+
 0920: 
+
 0921: 
+
+0922: def _killall3(greenlets, exception, waiter):
+
static PyObject *__pyx_f_6gevent_9_greenlet__killall3(PyObject *__pyx_v_greenlets, PyObject *__pyx_v_exception, PyObject *__pyx_v_waiter) {
+  PyObject *__pyx_v_diehards = 0;
+  PyObject *__pyx_v_g = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_killall3", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_9);
+  __Pyx_XDECREF(__pyx_t_10);
+  __Pyx_XDECREF(__pyx_t_11);
+  __Pyx_XDECREF(__pyx_t_12);
+  __Pyx_XDECREF(__pyx_t_13);
+  __Pyx_XDECREF(__pyx_t_14);
+  __Pyx_XDECREF(__pyx_t_15);
+  __Pyx_AddTraceback("gevent._greenlet._killall3", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_diehards);
+  __Pyx_XDECREF(__pyx_v_g);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0923:     diehards = []
+
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 923, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_v_diehards = ((PyObject*)__pyx_t_1);
+  __pyx_t_1 = 0;
+
+0924:     for g in greenlets:
+
  if (unlikely(__pyx_v_greenlets == Py_None)) {
+    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
+    __PYX_ERR(0, 924, __pyx_L1_error)
+  }
+  __pyx_t_1 = __pyx_v_greenlets; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
+  for (;;) {
+    if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
+    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+    __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 924, __pyx_L1_error)
+    #else
+    __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 924, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    #endif
+    __Pyx_XDECREF_SET(__pyx_v_g, __pyx_t_3);
+    __pyx_t_3 = 0;
+/* … */
+  }
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+0925:         if not g.dead:
+
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_g, __pyx_n_s_dead); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 925, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 925, __pyx_L1_error)
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __pyx_t_5 = ((!__pyx_t_4) != 0);
+    if (__pyx_t_5) {
+/* … */
+    }
+
+0926:             try:
+
      {
+        /*try:*/ {
+/* … */
+        }
+        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
+        goto __pyx_L13_try_end;
+        __pyx_L6_error:;
+        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
+        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
+        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+/* … */
+        __Pyx_XGIVEREF(__pyx_t_6);
+        __Pyx_XGIVEREF(__pyx_t_7);
+        __Pyx_XGIVEREF(__pyx_t_8);
+        __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
+        goto __pyx_L1_error;
+        __pyx_L7_exception_handled:;
+        __Pyx_XGIVEREF(__pyx_t_6);
+        __Pyx_XGIVEREF(__pyx_t_7);
+        __Pyx_XGIVEREF(__pyx_t_8);
+        __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
+        __pyx_L13_try_end:;
+      }
+
+0927:                 g.throw(exception)
+
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_g, __pyx_n_s_throw); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 927, __pyx_L6_error)
+          __Pyx_GOTREF(__pyx_t_9);
+          __pyx_t_10 = NULL;
+          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
+            __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9);
+            if (likely(__pyx_t_10)) {
+              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
+              __Pyx_INCREF(__pyx_t_10);
+              __Pyx_INCREF(function);
+              __Pyx_DECREF_SET(__pyx_t_9, function);
+            }
+          }
+          __pyx_t_3 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_10, __pyx_v_exception) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_v_exception);
+          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
+          if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 927, __pyx_L6_error)
+          __Pyx_GOTREF(__pyx_t_3);
+          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+
+0928:             except: # pylint:disable=bare-except
+
        /*except:*/ {
+          __Pyx_AddTraceback("gevent._greenlet._killall3", __pyx_clineno, __pyx_lineno, __pyx_filename);
+          if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_9, &__pyx_t_10) < 0) __PYX_ERR(0, 928, __pyx_L8_except_error)
+          __Pyx_GOTREF(__pyx_t_3);
+          __Pyx_GOTREF(__pyx_t_9);
+          __Pyx_GOTREF(__pyx_t_10);
+
+0929:                 g.parent.handle_error(g, *sys_exc_info())
+
          __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_g, __pyx_n_s_parent); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 929, __pyx_L8_except_error)
+          __Pyx_GOTREF(__pyx_t_11);
+          __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_handle_error); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 929, __pyx_L8_except_error)
+          __Pyx_GOTREF(__pyx_t_12);
+          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+          __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 929, __pyx_L8_except_error)
+          __Pyx_GOTREF(__pyx_t_11);
+          __Pyx_INCREF(__pyx_v_g);
+          __Pyx_GIVEREF(__pyx_v_g);
+          PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_v_g);
+          __Pyx_INCREF(__pyx_v_6gevent_9_greenlet_sys_exc_info);
+          __pyx_t_14 = __pyx_v_6gevent_9_greenlet_sys_exc_info; __pyx_t_15 = NULL;
+          if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_14))) {
+            __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_14);
+            if (likely(__pyx_t_15)) {
+              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14);
+              __Pyx_INCREF(__pyx_t_15);
+              __Pyx_INCREF(function);
+              __Pyx_DECREF_SET(__pyx_t_14, function);
+            }
+          }
+          __pyx_t_13 = (__pyx_t_15) ? __Pyx_PyObject_CallOneArg(__pyx_t_14, __pyx_t_15) : __Pyx_PyObject_CallNoArg(__pyx_t_14);
+          __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
+          if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 929, __pyx_L8_except_error)
+          __Pyx_GOTREF(__pyx_t_13);
+          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
+          __pyx_t_14 = __Pyx_PySequence_Tuple(__pyx_t_13); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 929, __pyx_L8_except_error)
+          __Pyx_GOTREF(__pyx_t_14);
+          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+          __pyx_t_13 = PyNumber_Add(__pyx_t_11, __pyx_t_14); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 929, __pyx_L8_except_error)
+          __Pyx_GOTREF(__pyx_t_13);
+          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
+          __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_13, NULL); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 929, __pyx_L8_except_error)
+          __Pyx_GOTREF(__pyx_t_14);
+          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
+          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
+          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
+          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
+          goto __pyx_L7_exception_handled;
+        }
+        __pyx_L8_except_error:;
+
+0930:             if not g.dead:
+
      __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_g, __pyx_n_s_dead); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 930, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_10);
+      __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 930, __pyx_L1_error)
+      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+      __pyx_t_4 = ((!__pyx_t_5) != 0);
+      if (__pyx_t_4) {
+/* … */
+      }
+
+0931:                 diehards.append(g)
+
        __pyx_t_16 = __Pyx_PyList_Append(__pyx_v_diehards, __pyx_v_g); if (unlikely(__pyx_t_16 == ((int)-1))) __PYX_ERR(0, 931, __pyx_L1_error)
+
+0932:     waiter.switch(diehards)
+
  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_waiter, __pyx_n_s_switch); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 932, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_10);
+  __pyx_t_9 = NULL;
+  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_10))) {
+    __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_10);
+    if (likely(__pyx_t_9)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
+      __Pyx_INCREF(__pyx_t_9);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_10, function);
+    }
+  }
+  __pyx_t_1 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_10, __pyx_t_9, __pyx_v_diehards) : __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_v_diehards);
+  __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
+  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 932, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 0933: 
+
 0934: 
+
+0935: def _killall(greenlets, exception):
+
static PyObject *__pyx_f_6gevent_9_greenlet__killall(PyObject *__pyx_v_greenlets, PyObject *__pyx_v_exception) {
+  PyObject *__pyx_v_g = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_killall", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_9);
+  __Pyx_XDECREF(__pyx_t_10);
+  __Pyx_XDECREF(__pyx_t_11);
+  __Pyx_XDECREF(__pyx_t_12);
+  __Pyx_XDECREF(__pyx_t_13);
+  __Pyx_XDECREF(__pyx_t_14);
+  __Pyx_XDECREF(__pyx_t_15);
+  __Pyx_AddTraceback("gevent._greenlet._killall", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_g);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0936:     for g in greenlets:
+
  if (unlikely(__pyx_v_greenlets == Py_None)) {
+    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
+    __PYX_ERR(0, 936, __pyx_L1_error)
+  }
+  __pyx_t_1 = __pyx_v_greenlets; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
+  for (;;) {
+    if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
+    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+    __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 936, __pyx_L1_error)
+    #else
+    __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 936, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    #endif
+    __Pyx_XDECREF_SET(__pyx_v_g, __pyx_t_3);
+    __pyx_t_3 = 0;
+/* … */
+  }
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+0937:         if not g.dead:
+
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_g, __pyx_n_s_dead); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 937, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 937, __pyx_L1_error)
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __pyx_t_5 = ((!__pyx_t_4) != 0);
+    if (__pyx_t_5) {
+/* … */
+    }
+
+0938:             try:
+
      {
+        /*try:*/ {
+/* … */
+        }
+        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
+        goto __pyx_L13_try_end;
+        __pyx_L6_error:;
+        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
+        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
+        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+/* … */
+        __Pyx_XGIVEREF(__pyx_t_6);
+        __Pyx_XGIVEREF(__pyx_t_7);
+        __Pyx_XGIVEREF(__pyx_t_8);
+        __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
+        goto __pyx_L1_error;
+        __pyx_L7_exception_handled:;
+        __Pyx_XGIVEREF(__pyx_t_6);
+        __Pyx_XGIVEREF(__pyx_t_7);
+        __Pyx_XGIVEREF(__pyx_t_8);
+        __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
+        __pyx_L13_try_end:;
+      }
+
+0939:                 g.throw(exception)
+
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_g, __pyx_n_s_throw); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 939, __pyx_L6_error)
+          __Pyx_GOTREF(__pyx_t_9);
+          __pyx_t_10 = NULL;
+          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
+            __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9);
+            if (likely(__pyx_t_10)) {
+              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
+              __Pyx_INCREF(__pyx_t_10);
+              __Pyx_INCREF(function);
+              __Pyx_DECREF_SET(__pyx_t_9, function);
+            }
+          }
+          __pyx_t_3 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_10, __pyx_v_exception) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_v_exception);
+          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
+          if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 939, __pyx_L6_error)
+          __Pyx_GOTREF(__pyx_t_3);
+          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+
+0940:             except: # pylint:disable=bare-except
+
        /*except:*/ {
+          __Pyx_AddTraceback("gevent._greenlet._killall", __pyx_clineno, __pyx_lineno, __pyx_filename);
+          if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_9, &__pyx_t_10) < 0) __PYX_ERR(0, 940, __pyx_L8_except_error)
+          __Pyx_GOTREF(__pyx_t_3);
+          __Pyx_GOTREF(__pyx_t_9);
+          __Pyx_GOTREF(__pyx_t_10);
+
+0941:                 g.parent.handle_error(g, *sys_exc_info())
+
          __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_g, __pyx_n_s_parent); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 941, __pyx_L8_except_error)
+          __Pyx_GOTREF(__pyx_t_11);
+          __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_handle_error); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 941, __pyx_L8_except_error)
+          __Pyx_GOTREF(__pyx_t_12);
+          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+          __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 941, __pyx_L8_except_error)
+          __Pyx_GOTREF(__pyx_t_11);
+          __Pyx_INCREF(__pyx_v_g);
+          __Pyx_GIVEREF(__pyx_v_g);
+          PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_v_g);
+          __Pyx_INCREF(__pyx_v_6gevent_9_greenlet_sys_exc_info);
+          __pyx_t_14 = __pyx_v_6gevent_9_greenlet_sys_exc_info; __pyx_t_15 = NULL;
+          if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_14))) {
+            __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_14);
+            if (likely(__pyx_t_15)) {
+              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14);
+              __Pyx_INCREF(__pyx_t_15);
+              __Pyx_INCREF(function);
+              __Pyx_DECREF_SET(__pyx_t_14, function);
+            }
+          }
+          __pyx_t_13 = (__pyx_t_15) ? __Pyx_PyObject_CallOneArg(__pyx_t_14, __pyx_t_15) : __Pyx_PyObject_CallNoArg(__pyx_t_14);
+          __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
+          if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 941, __pyx_L8_except_error)
+          __Pyx_GOTREF(__pyx_t_13);
+          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
+          __pyx_t_14 = __Pyx_PySequence_Tuple(__pyx_t_13); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 941, __pyx_L8_except_error)
+          __Pyx_GOTREF(__pyx_t_14);
+          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+          __pyx_t_13 = PyNumber_Add(__pyx_t_11, __pyx_t_14); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 941, __pyx_L8_except_error)
+          __Pyx_GOTREF(__pyx_t_13);
+          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
+          __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_13, NULL); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 941, __pyx_L8_except_error)
+          __Pyx_GOTREF(__pyx_t_14);
+          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
+          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
+          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
+          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
+          goto __pyx_L7_exception_handled;
+        }
+        __pyx_L8_except_error:;
+
 0942: 
+
 0943: 
+
+0944: def _call_spawn_callbacks(gr):
+
static void __pyx_f_6gevent_9_greenlet__call_spawn_callbacks(struct __pyx_obj_6gevent_9_greenlet_Greenlet *__pyx_v_gr) {
+  PyObject *__pyx_v_cb = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_call_spawn_callbacks", 0);
+/* … */
+  /* function exit code */
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_7);
+  __Pyx_XDECREF(__pyx_t_9);
+  __Pyx_XDECREF(__pyx_t_10);
+  __Pyx_AddTraceback("gevent._greenlet._call_spawn_callbacks", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_cb);
+  __Pyx_RefNannyFinishContext();
+}
+
+0945:     if _spawn_callbacks is not None:
+
  __pyx_t_1 = (__pyx_v_6gevent_9_greenlet__spawn_callbacks != ((PyObject*)Py_None));
+  __pyx_t_2 = (__pyx_t_1 != 0);
+  if (__pyx_t_2) {
+/* … */
+  }
+
+0946:         for cb in _spawn_callbacks:
+
    __pyx_t_4 = 0;
+    __pyx_t_7 = __Pyx_set_iterator(__pyx_v_6gevent_9_greenlet__spawn_callbacks, 1, (&__pyx_t_5), (&__pyx_t_6)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 946, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_7);
+    __Pyx_XDECREF(__pyx_t_3);
+    __pyx_t_3 = __pyx_t_7;
+    __pyx_t_7 = 0;
+    while (1) {
+      __pyx_t_8 = __Pyx_set_iter_next(__pyx_t_3, __pyx_t_5, &__pyx_t_4, &__pyx_t_7, __pyx_t_6);
+      if (unlikely(__pyx_t_8 == 0)) break;
+      if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(0, 946, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_7);
+      __Pyx_XDECREF_SET(__pyx_v_cb, __pyx_t_7);
+      __pyx_t_7 = 0;
+
+0947:             cb(gr)
+
      __Pyx_INCREF(__pyx_v_cb);
+      __pyx_t_9 = __pyx_v_cb; __pyx_t_10 = NULL;
+      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
+        __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9);
+        if (likely(__pyx_t_10)) {
+          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
+          __Pyx_INCREF(__pyx_t_10);
+          __Pyx_INCREF(function);
+          __Pyx_DECREF_SET(__pyx_t_9, function);
+        }
+      }
+      __pyx_t_7 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_10, ((PyObject *)__pyx_v_gr)) : __Pyx_PyObject_CallOneArg(__pyx_t_9, ((PyObject *)__pyx_v_gr));
+      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
+      if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 947, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_7);
+      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+    }
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+
 0948: 
+
 0949: 
+
+0950: _spawn_callbacks = None
+
  __Pyx_INCREF(Py_None);
+  __Pyx_XGOTREF(__pyx_v_6gevent_9_greenlet__spawn_callbacks);
+  __Pyx_DECREF_SET(__pyx_v_6gevent_9_greenlet__spawn_callbacks, ((PyObject*)Py_None));
+  __Pyx_GIVEREF(Py_None);
+
 0951: 
+
 0952: 
+
+0953: def killall(greenlets, exception=GreenletExit, block=True, timeout=None):
+
static PyObject *__pyx_pf_6gevent_9_greenlet_7__defaults__(CYTHON_UNUSED PyObject *__pyx_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__defaults__", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 953, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_exception);
+  __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_exception);
+  PyTuple_SET_ITEM(__pyx_t_1, 0, __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_exception);
+  __Pyx_INCREF(((PyObject *)Py_True));
+  __Pyx_GIVEREF(((PyObject *)Py_True));
+  PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)Py_True));
+  __Pyx_INCREF(((PyObject *)Py_None));
+  __Pyx_GIVEREF(((PyObject *)Py_None));
+  PyTuple_SET_ITEM(__pyx_t_1, 2, ((PyObject *)Py_None));
+  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 953, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_GIVEREF(__pyx_t_1);
+  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
+  __Pyx_INCREF(Py_None);
+  __Pyx_GIVEREF(Py_None);
+  PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None);
+  __pyx_t_1 = 0;
+  __pyx_r = __pyx_t_2;
+  __pyx_t_2 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_AddTraceback("gevent._greenlet.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_9_greenlet_5killall(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_6gevent_9_greenlet_4killall[] = "killall(greenlets, exception=GreenletExit, block=True, timeout=None)\n\n    Forceably terminate all the ``greenlets`` by causing them to raise ``exception``.\n\n    .. caution:: Use care when killing greenlets. If they are not prepared for exceptions,\n       this could result in corrupted state.\n\n    :param greenlets: A **bounded** iterable of the non-None greenlets to terminate.\n       *All* the items in this iterable must be greenlets that belong to the same thread.\n    :keyword exception: The exception to raise in the greenlets. By default this is\n        :class:`GreenletExit`.\n    :keyword bool block: If True (the default) then this function only returns when all the\n        greenlets are dead; the current greenlet is unscheduled during that process.\n        If greenlets ignore the initial exception raised in them,\n        then they will be joined (with :func:`gevent.joinall`) and allowed to die naturally.\n        If False, this function returns immediately and greenlets will raise\n        the exception asynchronously.\n    :keyword float timeout: A time in seconds to wait for greenlets to die. If given, it is\n        only honored when ``block`` is True.\n    :raise Timeout: If blocking and a timeout is given that elapses before\n        all the greenlets are dead.\n\n    .. versionchanged:: 1.1a2\n        *greenlets* can be any iterable of greenlets, like an iterator or a set.\n        Previously it had to be a list or tuple.\n    ";
+static PyMethodDef __pyx_mdef_6gevent_9_greenlet_5killall = {"killall", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_9_greenlet_5killall, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_9_greenlet_4killall};
+static PyObject *__pyx_pw_6gevent_9_greenlet_5killall(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_greenlets = 0;
+  PyObject *__pyx_v_exception = 0;
+  PyObject *__pyx_v_block = 0;
+  PyObject *__pyx_v_timeout = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("killall (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_greenlets,&__pyx_n_s_exception,&__pyx_n_s_block,&__pyx_n_s_timeout,0};
+    PyObject* values[4] = {0,0,0,0};
+    __pyx_defaults *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self);
+    values[1] = __pyx_dynamic_args->__pyx_arg_exception;
+    values[2] = ((PyObject *)((PyObject *)Py_True));
+    values[3] = ((PyObject *)((PyObject *)Py_None));
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
+        CYTHON_FALLTHROUGH;
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_greenlets)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_exception);
+          if (value) { values[1] = value; kw_args--; }
+        }
+        CYTHON_FALLTHROUGH;
+        case  2:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_block);
+          if (value) { values[2] = value; kw_args--; }
+        }
+        CYTHON_FALLTHROUGH;
+        case  3:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_timeout);
+          if (value) { values[3] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "killall") < 0)) __PYX_ERR(0, 953, __pyx_L3_error)
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
+        CYTHON_FALLTHROUGH;
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    __pyx_v_greenlets = values[0];
+    __pyx_v_exception = values[1];
+    __pyx_v_block = values[2];
+    __pyx_v_timeout = values[3];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("killall", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 953, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent._greenlet.killall", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_9_greenlet_4killall(__pyx_self, __pyx_v_greenlets, __pyx_v_exception, __pyx_v_block, __pyx_v_timeout);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_9_greenlet_4killall(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_greenlets, PyObject *__pyx_v_exception, PyObject *__pyx_v_block, PyObject *__pyx_v_timeout) {
+  PyObject *__pyx_v_loop = NULL;
+  struct __pyx_obj_6gevent_8__waiter_Waiter *__pyx_v_waiter = NULL;
+  PyObject *__pyx_v_t = NULL;
+  PyObject *__pyx_v_alive = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("killall", 0);
+  __Pyx_INCREF(__pyx_v_greenlets);
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_XDECREF(__pyx_t_6);
+  __Pyx_XDECREF(__pyx_t_8);
+  __Pyx_AddTraceback("gevent._greenlet.killall", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_loop);
+  __Pyx_XDECREF((PyObject *)__pyx_v_waiter);
+  __Pyx_XDECREF(__pyx_v_t);
+  __Pyx_XDECREF(__pyx_v_alive);
+  __Pyx_XDECREF(__pyx_v_greenlets);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__86 = PyTuple_Pack(8, __pyx_n_s_greenlets, __pyx_n_s_exception, __pyx_n_s_block, __pyx_n_s_timeout, __pyx_n_s_loop, __pyx_n_s_waiter, __pyx_n_s_t, __pyx_n_s_alive); if (unlikely(!__pyx_tuple__86)) __PYX_ERR(0, 953, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__86);
+  __Pyx_GIVEREF(__pyx_tuple__86);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_9_greenlet_5killall, 0, __pyx_n_s_killall, NULL, __pyx_n_s_gevent__greenlet, __pyx_d, ((PyObject *)__pyx_codeobj__87)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 953, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (!__Pyx_CyFunction_InitDefaults(__pyx_t_2, sizeof(__pyx_defaults), 1)) __PYX_ERR(0, 953, __pyx_L1_error)
+  __Pyx_INCREF(__pyx_v_6gevent_9_greenlet_GreenletExit);
+  __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_t_2)->__pyx_arg_exception = __pyx_v_6gevent_9_greenlet_GreenletExit;
+  __Pyx_GIVEREF(__pyx_v_6gevent_9_greenlet_GreenletExit);
+  __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_2, __pyx_pf_6gevent_9_greenlet_7__defaults__);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_killall, __pyx_t_2) < 0) __PYX_ERR(0, 953, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
 0954:     """
+
 0955:     Forceably terminate all the ``greenlets`` by causing them to raise ``exception``.
+
 0956: 
+
 0957:     .. caution:: Use care when killing greenlets. If they are not prepared for exceptions,
+
 0958:        this could result in corrupted state.
+
 0959: 
+
 0960:     :param greenlets: A **bounded** iterable of the non-None greenlets to terminate.
+
 0961:        *All* the items in this iterable must be greenlets that belong to the same thread.
+
 0962:     :keyword exception: The exception to raise in the greenlets. By default this is
+
 0963:         :class:`GreenletExit`.
+
 0964:     :keyword bool block: If True (the default) then this function only returns when all the
+
 0965:         greenlets are dead; the current greenlet is unscheduled during that process.
+
 0966:         If greenlets ignore the initial exception raised in them,
+
 0967:         then they will be joined (with :func:`gevent.joinall`) and allowed to die naturally.
+
 0968:         If False, this function returns immediately and greenlets will raise
+
 0969:         the exception asynchronously.
+
 0970:     :keyword float timeout: A time in seconds to wait for greenlets to die. If given, it is
+
 0971:         only honored when ``block`` is True.
+
 0972:     :raise Timeout: If blocking and a timeout is given that elapses before
+
 0973:         all the greenlets are dead.
+
 0974: 
+
 0975:     .. versionchanged:: 1.1a2
+
 0976:         *greenlets* can be any iterable of greenlets, like an iterator or a set.
+
 0977:         Previously it had to be a list or tuple.
+
 0978:     """
+
 0979:     # support non-indexable containers like iterators or set objects
+
+0980:     greenlets = list(greenlets)
+
  __pyx_t_1 = PySequence_List(__pyx_v_greenlets); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 980, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF_SET(__pyx_v_greenlets, __pyx_t_1);
+  __pyx_t_1 = 0;
+
+0981:     if not greenlets:
+
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_greenlets); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 981, __pyx_L1_error)
+  __pyx_t_3 = ((!__pyx_t_2) != 0);
+  if (__pyx_t_3) {
+/* … */
+  }
+
+0982:         return
+
    __Pyx_XDECREF(__pyx_r);
+    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+    goto __pyx_L0;
+
+0983:     loop = greenlets[0].loop
+
  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_greenlets, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 983, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_loop); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 983, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_4);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_v_loop = __pyx_t_4;
+  __pyx_t_4 = 0;
+
+0984:     if block:
+
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_block); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 984, __pyx_L1_error)
+  if (__pyx_t_3) {
+/* … */
+    goto __pyx_L4;
+  }
+
+0985:         waiter = Waiter() # pylint:disable=undefined-variable
+
    __pyx_t_4 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_6gevent_8__waiter_Waiter)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 985, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    __pyx_v_waiter = ((struct __pyx_obj_6gevent_8__waiter_Waiter *)__pyx_t_4);
+    __pyx_t_4 = 0;
+
+0986:         loop.run_callback(_killall3, greenlets, exception, waiter)
+
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_loop, __pyx_n_s_run_callback); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 986, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __pyx_t_5 = __Pyx_CFunc_object____list____object____object___to_py(__pyx_f_6gevent_9_greenlet__killall3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 986, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_5);
+    __pyx_t_6 = NULL;
+    __pyx_t_7 = 0;
+    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
+      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1);
+      if (likely(__pyx_t_6)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
+        __Pyx_INCREF(__pyx_t_6);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_1, function);
+        __pyx_t_7 = 1;
+      }
+    }
+    #if CYTHON_FAST_PYCALL
+    if (PyFunction_Check(__pyx_t_1)) {
+      PyObject *__pyx_temp[5] = {__pyx_t_6, __pyx_t_5, __pyx_v_greenlets, __pyx_v_exception, ((PyObject *)__pyx_v_waiter)};
+      __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_7, 4+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 986, __pyx_L1_error)
+      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+      __Pyx_GOTREF(__pyx_t_4);
+      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    } else
+    #endif
+    #if CYTHON_FAST_PYCCALL
+    if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
+      PyObject *__pyx_temp[5] = {__pyx_t_6, __pyx_t_5, __pyx_v_greenlets, __pyx_v_exception, ((PyObject *)__pyx_v_waiter)};
+      __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_7, 4+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 986, __pyx_L1_error)
+      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+      __Pyx_GOTREF(__pyx_t_4);
+      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    } else
+    #endif
+    {
+      __pyx_t_8 = PyTuple_New(4+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 986, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_8);
+      if (__pyx_t_6) {
+        __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL;
+      }
+      __Pyx_GIVEREF(__pyx_t_5);
+      PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_5);
+      __Pyx_INCREF(__pyx_v_greenlets);
+      __Pyx_GIVEREF(__pyx_v_greenlets);
+      PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_greenlets);
+      __Pyx_INCREF(__pyx_v_exception);
+      __Pyx_GIVEREF(__pyx_v_exception);
+      PyTuple_SET_ITEM(__pyx_t_8, 2+__pyx_t_7, __pyx_v_exception);
+      __Pyx_INCREF(((PyObject *)__pyx_v_waiter));
+      __Pyx_GIVEREF(((PyObject *)__pyx_v_waiter));
+      PyTuple_SET_ITEM(__pyx_t_8, 3+__pyx_t_7, ((PyObject *)__pyx_v_waiter));
+      __pyx_t_5 = 0;
+      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 986, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_4);
+      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+    }
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+
+0987:         t = Timeout._start_new_or_dummy(timeout)
+
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_6gevent_9_greenlet_Timeout, __pyx_n_s_start_new_or_dummy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 987, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __pyx_t_8 = NULL;
+    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
+      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_1);
+      if (likely(__pyx_t_8)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
+        __Pyx_INCREF(__pyx_t_8);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_1, function);
+      }
+    }
+    __pyx_t_4 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_8, __pyx_v_timeout) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_timeout);
+    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
+    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 987, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __pyx_v_t = __pyx_t_4;
+    __pyx_t_4 = 0;
+
+0988:         try:
+
    /*try:*/ {
+
+0989:             alive = waiter.get()
+
      __pyx_t_4 = ((struct __pyx_vtabstruct_6gevent_8__waiter_Waiter *)__pyx_v_waiter->__pyx_vtab)->get(__pyx_v_waiter, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 989, __pyx_L6_error)
+      __Pyx_GOTREF(__pyx_t_4);
+      __pyx_v_alive = __pyx_t_4;
+      __pyx_t_4 = 0;
+
+0990:             if alive:
+
      __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_alive); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 990, __pyx_L6_error)
+      if (__pyx_t_3) {
+/* … */
+      }
+    }
+
+0991:                 joinall(alive, raise_error=False)
+
        __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_joinall); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 991, __pyx_L6_error)
+        __Pyx_GOTREF(__pyx_t_4);
+        __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 991, __pyx_L6_error)
+        __Pyx_GOTREF(__pyx_t_1);
+        __Pyx_INCREF(__pyx_v_alive);
+        __Pyx_GIVEREF(__pyx_v_alive);
+        PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_alive);
+        __pyx_t_8 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 991, __pyx_L6_error)
+        __Pyx_GOTREF(__pyx_t_8);
+        if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_raise_error, Py_False) < 0) __PYX_ERR(0, 991, __pyx_L6_error)
+        __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_1, __pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 991, __pyx_L6_error)
+        __Pyx_GOTREF(__pyx_t_5);
+        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+
 0992:         finally:
+
+0993:             t.cancel()
+
    /*finally:*/ {
+      /*normal exit:*/{
+        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_t, __pyx_n_s_cancel); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 993, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_8);
+        __pyx_t_1 = NULL;
+        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
+          __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_8);
+          if (likely(__pyx_t_1)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
+            __Pyx_INCREF(__pyx_t_1);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_8, function);
+          }
+        }
+        __pyx_t_5 = (__pyx_t_1) ? __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_1) : __Pyx_PyObject_CallNoArg(__pyx_t_8);
+        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+        if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 993, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_5);
+        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+        goto __pyx_L7;
+      }
+      __pyx_L6_error:;
+      /*exception exit:*/{
+        __Pyx_PyThreadState_declare
+        __Pyx_PyThreadState_assign
+        __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0;
+        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
+        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+        if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_14, &__pyx_t_15, &__pyx_t_16);
+        if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13) < 0)) __Pyx_ErrFetch(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13);
+        __Pyx_XGOTREF(__pyx_t_11);
+        __Pyx_XGOTREF(__pyx_t_12);
+        __Pyx_XGOTREF(__pyx_t_13);
+        __Pyx_XGOTREF(__pyx_t_14);
+        __Pyx_XGOTREF(__pyx_t_15);
+        __Pyx_XGOTREF(__pyx_t_16);
+        __pyx_t_7 = __pyx_lineno; __pyx_t_9 = __pyx_clineno; __pyx_t_10 = __pyx_filename;
+        {
+          __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_t, __pyx_n_s_cancel); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 993, __pyx_L10_error)
+          __Pyx_GOTREF(__pyx_t_8);
+          __pyx_t_1 = NULL;
+          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
+            __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_8);
+            if (likely(__pyx_t_1)) {
+              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
+              __Pyx_INCREF(__pyx_t_1);
+              __Pyx_INCREF(function);
+              __Pyx_DECREF_SET(__pyx_t_8, function);
+            }
+          }
+          __pyx_t_5 = (__pyx_t_1) ? __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_1) : __Pyx_PyObject_CallNoArg(__pyx_t_8);
+          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+          if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 993, __pyx_L10_error)
+          __Pyx_GOTREF(__pyx_t_5);
+          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+        }
+        if (PY_MAJOR_VERSION >= 3) {
+          __Pyx_XGIVEREF(__pyx_t_14);
+          __Pyx_XGIVEREF(__pyx_t_15);
+          __Pyx_XGIVEREF(__pyx_t_16);
+          __Pyx_ExceptionReset(__pyx_t_14, __pyx_t_15, __pyx_t_16);
+        }
+        __Pyx_XGIVEREF(__pyx_t_11);
+        __Pyx_XGIVEREF(__pyx_t_12);
+        __Pyx_XGIVEREF(__pyx_t_13);
+        __Pyx_ErrRestore(__pyx_t_11, __pyx_t_12, __pyx_t_13);
+        __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0;
+        __pyx_lineno = __pyx_t_7; __pyx_clineno = __pyx_t_9; __pyx_filename = __pyx_t_10;
+        goto __pyx_L1_error;
+        __pyx_L10_error:;
+        if (PY_MAJOR_VERSION >= 3) {
+          __Pyx_XGIVEREF(__pyx_t_14);
+          __Pyx_XGIVEREF(__pyx_t_15);
+          __Pyx_XGIVEREF(__pyx_t_16);
+          __Pyx_ExceptionReset(__pyx_t_14, __pyx_t_15, __pyx_t_16);
+        }
+        __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
+        __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
+        __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
+        __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0;
+        goto __pyx_L1_error;
+      }
+      __pyx_L7:;
+    }
+
 0994:     else:
+
+0995:         loop.run_callback(_killall, greenlets, exception)
+
  /*else*/ {
+    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_loop, __pyx_n_s_run_callback); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 995, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_8);
+    __pyx_t_1 = __Pyx_CFunc_object____list____object___to_py(__pyx_f_6gevent_9_greenlet__killall); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 995, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __pyx_t_4 = NULL;
+    __pyx_t_9 = 0;
+    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
+      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_8);
+      if (likely(__pyx_t_4)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
+        __Pyx_INCREF(__pyx_t_4);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_8, function);
+        __pyx_t_9 = 1;
+      }
+    }
+    #if CYTHON_FAST_PYCALL
+    if (PyFunction_Check(__pyx_t_8)) {
+      PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_t_1, __pyx_v_greenlets, __pyx_v_exception};
+      __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_9, 3+__pyx_t_9); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 995, __pyx_L1_error)
+      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __Pyx_GOTREF(__pyx_t_5);
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    } else
+    #endif
+    #if CYTHON_FAST_PYCCALL
+    if (__Pyx_PyFastCFunction_Check(__pyx_t_8)) {
+      PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_t_1, __pyx_v_greenlets, __pyx_v_exception};
+      __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_9, 3+__pyx_t_9); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 995, __pyx_L1_error)
+      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __Pyx_GOTREF(__pyx_t_5);
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    } else
+    #endif
+    {
+      __pyx_t_6 = PyTuple_New(3+__pyx_t_9); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 995, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_6);
+      if (__pyx_t_4) {
+        __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
+      }
+      __Pyx_GIVEREF(__pyx_t_1);
+      PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_9, __pyx_t_1);
+      __Pyx_INCREF(__pyx_v_greenlets);
+      __Pyx_GIVEREF(__pyx_v_greenlets);
+      PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_9, __pyx_v_greenlets);
+      __Pyx_INCREF(__pyx_v_exception);
+      __Pyx_GIVEREF(__pyx_v_exception);
+      PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_9, __pyx_v_exception);
+      __pyx_t_1 = 0;
+      __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 995, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_5);
+      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+    }
+    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+  }
+  __pyx_L4:;
+
 0996: 
+
+0997: def _init():
+
static void __pyx_f_6gevent_9_greenlet__init(void) {
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_init", 0);
+/* … */
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+}
+
+0998:     greenlet_init() # pylint:disable=undefined-variable
+
  __pyx_f_6gevent_9_greenlet_greenlet_init();
+
 0999: 
+
+1000: _init()
+
  __pyx_f_6gevent_9_greenlet__init();
+
 1001: 
+
+1002: from gevent._util import import_c_accel
+
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1002, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_import_c_accel);
+  __Pyx_GIVEREF(__pyx_n_s_import_c_accel);
+  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_import_c_accel);
+  __pyx_t_1 = __Pyx_Import(__pyx_n_s_gevent__util, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1002, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_import_c_accel); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1002, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_import_c_accel, __pyx_t_2) < 0) __PYX_ERR(0, 1002, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+1003: import_c_accel(globals(), 'gevent._greenlet')
+
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_import_c_accel); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1003, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = __Pyx_Globals(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1003, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1003, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_4);
+  __Pyx_GIVEREF(__pyx_t_2);
+  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_gevent__greenlet);
+  __Pyx_GIVEREF(__pyx_n_s_gevent__greenlet);
+  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_n_s_gevent__greenlet);
+  __pyx_t_2 = 0;
+  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1003, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/greenlet.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/greenlet.py new file mode 100644 index 00000000..a2268567 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/greenlet.py @@ -0,0 +1,1003 @@ +# Copyright (c) 2009-2012 Denis Bilenko. See LICENSE for details. +# cython: auto_pickle=False,embedsignature=True,always_allow_keywords=False + +from __future__ import absolute_import, print_function, division + +from sys import _getframe as sys_getframe +from sys import exc_info as sys_exc_info +from weakref import ref as wref + +# XXX: How to get cython to let us rename this as RawGreenlet +# like we prefer? +from greenlet import greenlet +from greenlet import GreenletExit + +from gevent._compat import reraise +from gevent._compat import PYPY as _PYPY +from gevent._tblib import dump_traceback +from gevent._tblib import load_traceback + +from gevent.exceptions import InvalidSwitchError + +from gevent._hub_primitives import iwait_on_objects as iwait +from gevent._hub_primitives import wait_on_objects as wait + +from gevent.timeout import Timeout + +from gevent._config import config as GEVENT_CONFIG +from gevent._util import Lazy +from gevent._util import readproperty +from gevent._hub_local import get_hub_noargs as get_hub +from gevent import _waiter + + +__all__ = [ + 'Greenlet', + 'joinall', + 'killall', +] + + +# In Cython, we define these as 'cdef inline' functions. The +# compilation unit cannot have a direct assignment to them (import +# is assignment) without generating a 'lvalue is not valid target' +# error. +locals()['getcurrent'] = __import__('greenlet').getcurrent +locals()['greenlet_init'] = lambda: None +locals()['Waiter'] = _waiter.Waiter + + +if _PYPY: + import _continuation # pylint:disable=import-error + _continulet = _continuation.continulet + + +class SpawnedLink(object): + """ + A wrapper around link that calls it in another greenlet. + + Can be called only from main loop. + """ + __slots__ = ['callback'] + + def __init__(self, callback): + if not callable(callback): + raise TypeError("Expected callable: %r" % (callback, )) + self.callback = callback + + def __call__(self, source): + g = greenlet(self.callback, get_hub()) + g.switch(source) + + def __hash__(self): + return hash(self.callback) + + def __eq__(self, other): + return self.callback == getattr(other, 'callback', other) + + def __str__(self): + return str(self.callback) + + def __repr__(self): + return repr(self.callback) + + def __getattr__(self, item): + assert item != 'callback' + return getattr(self.callback, item) + + +class SuccessSpawnedLink(SpawnedLink): + """A wrapper around link that calls it in another greenlet only if source succeed. + + Can be called only from main loop. + """ + __slots__ = [] + + def __call__(self, source): + if source.successful(): + return SpawnedLink.__call__(self, source) + + +class FailureSpawnedLink(SpawnedLink): + """A wrapper around link that calls it in another greenlet only if source failed. + + Can be called only from main loop. + """ + __slots__ = [] + + def __call__(self, source): + if not source.successful(): + return SpawnedLink.__call__(self, source) + +class _Frame(object): + + __slots__ = ('f_code', 'f_lineno', 'f_back') + + def __init__(self, f_code, f_lineno, f_back): + self.f_code = f_code + self.f_lineno = f_lineno + self.f_back = f_back + + @property + def f_globals(self): + return None + +def _Frame_from_list(frames): + previous = None + for frame in reversed(frames): + f = _Frame(frame[0], frame[1], previous) + previous = f + return previous + +def _extract_stack(limit): + try: + frame = sys_getframe() + except ValueError: + # In certain embedded cases that directly use the Python C api + # to call Greenlet.spawn (e.g., uwsgi) this can raise + # `ValueError: call stack is not deep enough`. This is because + # the Cython stack frames for Greenlet.spawn -> + # Greenlet.__init__ -> _extract_stack are all on the C level, + # not the Python level. + # See https://github.com/gevent/gevent/issues/1212 + frame = None + + frames = [] + + while limit and frame is not None: + limit -= 1 + frames.append((frame.f_code, frame.f_lineno)) + frame = frame.f_back + + return frames + + +_greenlet__init__ = greenlet.__init__ + +class Greenlet(greenlet): + """ + A light-weight cooperatively-scheduled execution unit. + """ + # pylint:disable=too-many-public-methods,too-many-instance-attributes + + spawning_stack_limit = 10 + + # pylint:disable=keyword-arg-before-vararg,super-init-not-called + def __init__(self, run=None, *args, **kwargs): + """ + :param args: The arguments passed to the ``run`` function. + :param kwargs: The keyword arguments passed to the ``run`` function. + :keyword callable run: The callable object to run. If not given, this object's + `_run` method will be invoked (typically defined by subclasses). + + .. versionchanged:: 1.1b1 + The ``run`` argument to the constructor is now verified to be a callable + object. Previously, passing a non-callable object would fail after the greenlet + was spawned. + + .. versionchanged:: 1.3b1 + The ``GEVENT_TRACK_GREENLET_TREE`` configuration value may be set to + a false value to disable ``spawn_tree_locals``, ``spawning_greenlet``, + and ``spawning_stack``. The first two will be None in that case, and the + latter will be empty. + """ + # The attributes are documented in the .rst file + + # greenlet.greenlet(run=None, parent=None) + # Calling it with both positional arguments instead of a keyword + # argument (parent=get_hub()) speeds up creation of this object ~30%: + # python -m timeit -s 'import gevent' 'gevent.Greenlet()' + # Python 3.5: 2.70usec with keywords vs 1.94usec with positional + # Python 3.4: 2.32usec with keywords vs 1.74usec with positional + # Python 3.3: 2.55usec with keywords vs 1.92usec with positional + # Python 2.7: 1.73usec with keywords vs 1.40usec with positional + + # Timings taken Feb 21 2018 prior to integration of #755 + # python -m perf timeit -s 'import gevent' 'gevent.Greenlet()' + # 3.6.4 : Mean +- std dev: 1.08 us +- 0.05 us + # 2.7.14 : Mean +- std dev: 1.44 us +- 0.06 us + # PyPy2 5.10.0: Mean +- std dev: 2.14 ns +- 0.08 ns + + # After the integration of spawning_stack, spawning_greenlet, + # and spawn_tree_locals on that same date: + # 3.6.4 : Mean +- std dev: 8.92 us +- 0.36 us -> 8.2x + # 2.7.14 : Mean +- std dev: 14.8 us +- 0.5 us -> 10.2x + # PyPy2 5.10.0: Mean +- std dev: 3.24 us +- 0.17 us -> 1.5x + + # Compiling with Cython gets us to these numbers: + # 3.6.4 : Mean +- std dev: 3.63 us +- 0.14 us + # 2.7.14 : Mean +- std dev: 3.37 us +- 0.20 us + # PyPy2 5.10.0 : Mean +- std dev: 4.44 us +- 0.28 us + + + _greenlet__init__(self, None, get_hub()) + + if run is not None: + self._run = run + + # If they didn't pass a callable at all, then they must + # already have one. Note that subclassing to override the run() method + # itself has never been documented or supported. + if not callable(self._run): + raise TypeError("The run argument or self._run must be callable") + + self.args = args + self.kwargs = kwargs + self.value = None + + #: An event, such as a timer or a callback that fires. It is established in + #: start() and start_later() as those two objects, respectively. + #: Once this becomes non-None, the Greenlet cannot be started again. Conversely, + #: kill() and throw() check for non-None to determine if this object has ever been + #: scheduled for starting. A placeholder _dummy_event is assigned by them to prevent + #: the greenlet from being started in the future, if necessary. + self._start_event = None + + self._notifier = None + self._formatted_info = None + self._links = [] + self._ident = None + + # Initial state: None. + # Completed successfully: (None, None, None) + # Failed with exception: (t, v, dump_traceback(tb))) + self._exc_info = None + + if GEVENT_CONFIG.track_greenlet_tree: + spawner = getcurrent() # pylint:disable=undefined-variable + self.spawning_greenlet = wref(spawner) + try: + self.spawn_tree_locals = spawner.spawn_tree_locals + except AttributeError: + self.spawn_tree_locals = {} + if spawner.parent is not None: + # The main greenlet has no parent. + # Its children get separate locals. + spawner.spawn_tree_locals = self.spawn_tree_locals + + self._spawning_stack_frames = _extract_stack(self.spawning_stack_limit) + self._spawning_stack_frames.extend(getattr(spawner, '_spawning_stack_frames', [])) + else: + # None is the default for all of these in Cython, but we + # need to declare them for pure-Python mode. + self.spawning_greenlet = None + self.spawn_tree_locals = None + self._spawning_stack_frames = None + + @Lazy + def spawning_stack(self): + # Store this in the __dict__. We don't use it from the C + # code. It's tempting to discard _spawning_stack_frames + # after this, but child greenlets may still be created + # that need it. + return _Frame_from_list(self._spawning_stack_frames or []) + + def _get_minimal_ident(self): + reg = self.parent.ident_registry + return reg.get_ident(self) + + @property + def minimal_ident(self): + """ + A small, unique integer that identifies this object. + + This is similar to :attr:`threading.Thread.ident` (and `id`) + in that as long as this object is alive, no other greenlet *in + this hub* will have the same id, but it makes a stronger + guarantee that the assigned values will be small and + sequential. Sometime after this object has died, the value + will be available for reuse. + + To get ids that are unique across all hubs, combine this with + the hub's ``minimal_ident``. + + .. versionadded:: 1.3a2 + """ + if self._ident is None: + self._ident = self._get_minimal_ident() + return self._ident + + @readproperty + def name(self): + """ + The greenlet name. By default, a unique name is constructed using + the :attr:`minimal_ident`. You can assign a string to this + value to change it. It is shown in the `repr` of this object if it + has been assigned to or if the `minimal_ident` has already been generated. + + .. versionadded:: 1.3a2 + .. versionchanged:: 1.4 + Stop showing generated names in the `repr` when the ``minimal_ident`` + hasn't been requested. This reduces overhead and may be less confusing, + since ``minimal_ident`` can get reused. + """ + return 'Greenlet-%d' % (self.minimal_ident,) + + def _raise_exception(self): + reraise(*self.exc_info) + + @property + def loop(self): + # needed by killall + return self.parent.loop + + def __nonzero__(self): + return self._start_event is not None and self._exc_info is None + try: + __bool__ = __nonzero__ # Python 3 + except NameError: # pragma: no cover + # When we're compiled with Cython, the __nonzero__ function + # goes directly into the slot and can't be accessed by name. + pass + + ### Lifecycle + + if _PYPY: + # oops - pypy's .dead relies on __nonzero__ which we overriden above + @property + def dead(self): + "Boolean indicating that the greenlet is dead and will not run again." + if self._greenlet__main: + return False + if self.__start_cancelled_by_kill() or self.__started_but_aborted(): + return True + + return self._greenlet__started and not _continulet.is_pending(self) + else: + @property + def dead(self): + "Boolean indicating that the greenlet is dead and will not run again." + return self.__start_cancelled_by_kill() or self.__started_but_aborted() or greenlet.dead.__get__(self) + + def __never_started_or_killed(self): + return self._start_event is None + + def __start_pending(self): + return (self._start_event is not None + and (self._start_event.pending or getattr(self._start_event, 'active', False))) + + def __start_cancelled_by_kill(self): + return self._start_event is _cancelled_start_event + + def __start_completed(self): + return self._start_event is _start_completed_event + + def __started_but_aborted(self): + return (not self.__never_started_or_killed() # we have been started or killed + and not self.__start_cancelled_by_kill() # we weren't killed, so we must have been started + and not self.__start_completed() # the start never completed + and not self.__start_pending()) # and we're not pending, so we must have been aborted + + def __cancel_start(self): + if self._start_event is None: + # prevent self from ever being started in the future + self._start_event = _cancelled_start_event + # cancel any pending start event + # NOTE: If this was a real pending start event, this will leave a + # "dangling" callback/timer object in the hub.loop.callbacks list; + # depending on where we are in the event loop, it may even be in a local + # variable copy of that list (in _run_callbacks). This isn't a problem, + # except for the leak-tests. + self._start_event.stop() + self._start_event.close() + + def __handle_death_before_start(self, args): + # args is (t, v, tb) or simply t or v + if self._exc_info is None and self.dead: + # the greenlet was never switched to before and it will never be, _report_error was not called + # the result was not set and the links weren't notified. let's do it here. + # checking that self.dead is true is essential, because throw() does not necessarily kill the greenlet + # (if the exception raised by throw() is caught somewhere inside the greenlet). + if len(args) == 1: + arg = args[0] + #if isinstance(arg, type): + if type(arg) is type(Exception): + args = (arg, arg(), None) + else: + args = (type(arg), arg, None) + elif not args: + args = (GreenletExit, GreenletExit(), None) + self._report_error(args) + + @property + def started(self): + # DEPRECATED + return bool(self) + + def ready(self): + """ + Return a true value if and only if the greenlet has finished + execution. + + .. versionchanged:: 1.1 + This function is only guaranteed to return true or false *values*, not + necessarily the literal constants ``True`` or ``False``. + """ + return self.dead or self._exc_info is not None + + def successful(self): + """ + Return a true value if and only if the greenlet has finished execution + successfully, that is, without raising an error. + + .. tip:: A greenlet that has been killed with the default + :class:`GreenletExit` exception is considered successful. + That is, ``GreenletExit`` is not considered an error. + + .. note:: This function is only guaranteed to return true or false *values*, + not necessarily the literal constants ``True`` or ``False``. + """ + return self._exc_info is not None and self._exc_info[1] is None + + def __repr__(self): + classname = self.__class__.__name__ + # If no name has been assigned, don't generate one, including a minimal_ident, + # if not necessary. This reduces the use of weak references and associated + # overhead. + if 'name' not in self.__dict__ and self._ident is None: + name = ' ' + else: + name = ' "%s" ' % (self.name,) + result = '<%s%sat %s' % (classname, name, hex(id(self))) + formatted = self._formatinfo() + if formatted: + result += ': ' + formatted + return result + '>' + + + def _formatinfo(self): + info = self._formatted_info + if info is not None: + return info + + # Are we running an arbitrary function provided to the constructor, + # or did a subclass override _run? + func = self._run + im_self = getattr(func, '__self__', None) + if im_self is self: + funcname = '_run' + elif im_self is not None: + funcname = repr(func) + else: + funcname = getattr(func, '__name__', '') or repr(func) + + result = funcname + args = [] + if self.args: + args = [repr(x)[:50] for x in self.args] + if self.kwargs: + args.extend(['%s=%s' % (key, repr(value)[:50]) for (key, value) in self.kwargs.items()]) + if args: + result += '(' + ', '.join(args) + ')' + # it is important to save the result here, because once the greenlet exits '_run' attribute will be removed + self._formatted_info = result + return result + + @property + def exception(self): + """ + Holds the exception instance raised by the function if the + greenlet has finished with an error. Otherwise ``None``. + """ + return self._exc_info[1] if self._exc_info is not None else None + + @property + def exc_info(self): + """ + Holds the exc_info three-tuple raised by the function if the + greenlet finished with an error. Otherwise a false value. + + .. note:: This is a provisional API and may change. + + .. versionadded:: 1.1 + """ + ei = self._exc_info + if ei is not None and ei[0] is not None: + return (ei[0], ei[1], load_traceback(ei[2])) + + def throw(self, *args): + """Immediately switch into the greenlet and raise an exception in it. + + Should only be called from the HUB, otherwise the current greenlet is left unscheduled forever. + To raise an exception in a safe manner from any greenlet, use :meth:`kill`. + + If a greenlet was started but never switched to yet, then also + a) cancel the event that will start it + b) fire the notifications as if an exception was raised in a greenlet + """ + self.__cancel_start() + + try: + if not self.dead: + # Prevent switching into a greenlet *at all* if we had never + # started it. Usually this is the same thing that happens by throwing, + # but if this is done from the hub with nothing else running, prevents a + # LoopExit. + greenlet.throw(self, *args) + finally: + self.__handle_death_before_start(args) + + def start(self): + """Schedule the greenlet to run in this loop iteration""" + if self._start_event is None: + _call_spawn_callbacks(self) + self._start_event = self.parent.loop.run_callback(self.switch) + + def start_later(self, seconds): + """ + start_later(seconds) -> None + + Schedule the greenlet to run in the future loop iteration + *seconds* later + """ + if self._start_event is None: + _call_spawn_callbacks(self) + self._start_event = self.parent.loop.timer(seconds) + self._start_event.start(self.switch) + + @staticmethod + def add_spawn_callback(callback): + """ + add_spawn_callback(callback) -> None + + Set up a *callback* to be invoked when :class:`Greenlet` objects + are started. + + The invocation order of spawn callbacks is unspecified. Adding the + same callback more than one time will not cause it to be called more + than once. + + .. versionadded:: 1.4.0 + """ + global _spawn_callbacks + if _spawn_callbacks is None: # pylint:disable=used-before-assignment + _spawn_callbacks = set() + _spawn_callbacks.add(callback) + + @staticmethod + def remove_spawn_callback(callback): + """ + remove_spawn_callback(callback) -> None + + Remove *callback* function added with :meth:`Greenlet.add_spawn_callback`. + This function will not fail if *callback* has been already removed or + if *callback* was never added. + + .. versionadded:: 1.4.0 + """ + global _spawn_callbacks + if _spawn_callbacks is not None: + _spawn_callbacks.discard(callback) + if not _spawn_callbacks: + _spawn_callbacks = None + + @classmethod + def spawn(cls, *args, **kwargs): + """ + spawn(function, *args, **kwargs) -> Greenlet + + Create a new :class:`Greenlet` object and schedule it to run ``function(*args, **kwargs)``. + This can be used as ``gevent.spawn`` or ``Greenlet.spawn``. + + The arguments are passed to :meth:`Greenlet.__init__`. + + .. versionchanged:: 1.1b1 + If a *function* is given that is not callable, immediately raise a :exc:`TypeError` + instead of spawning a greenlet that will raise an uncaught TypeError. + """ + g = cls(*args, **kwargs) + g.start() + return g + + @classmethod + def spawn_later(cls, seconds, *args, **kwargs): + """ + spawn_later(seconds, function, *args, **kwargs) -> Greenlet + + Create and return a new `Greenlet` object scheduled to run ``function(*args, **kwargs)`` + in a future loop iteration *seconds* later. This can be used as ``Greenlet.spawn_later`` + or ``gevent.spawn_later``. + + The arguments are passed to :meth:`Greenlet.__init__`. + + .. versionchanged:: 1.1b1 + If an argument that's meant to be a function (the first argument in *args*, or the ``run`` keyword ) + is given to this classmethod (and not a classmethod of a subclass), + it is verified to be callable. Previously, the spawned greenlet would have failed + when it started running. + """ + if cls is Greenlet and not args and 'run' not in kwargs: + raise TypeError("") + g = cls(*args, **kwargs) + g.start_later(seconds) + return g + + def kill(self, exception=GreenletExit, block=True, timeout=None): + """ + Raise the ``exception`` in the greenlet. + + If ``block`` is ``True`` (the default), wait until the greenlet dies or the optional timeout expires. + If block is ``False``, the current greenlet is not unscheduled. + + The function always returns ``None`` and never raises an error. + + .. note:: + + Depending on what this greenlet is executing and the state + of the event loop, the exception may or may not be raised + immediately when this greenlet resumes execution. It may + be raised on a subsequent green call, or, if this greenlet + exits before making such a call, it may not be raised at + all. As of 1.1, an example where the exception is raised + later is if this greenlet had called :func:`sleep(0) + `; an example where the exception is raised + immediately is if this greenlet had called + :func:`sleep(0.1) `. + + .. caution:: + + Use care when killing greenlets. If the code executing is not + exception safe (e.g., makes proper use of ``finally``) then an + unexpected exception could result in corrupted state. + + See also :func:`gevent.kill`. + + :keyword type exception: The type of exception to raise in the greenlet. The default + is :class:`GreenletExit`, which indicates a :meth:`successful` completion + of the greenlet. + + .. versionchanged:: 0.13.0 + *block* is now ``True`` by default. + .. versionchanged:: 1.1a2 + If this greenlet had never been switched to, killing it will prevent it from ever being switched to. + """ + self.__cancel_start() + + if self.dead: + self.__handle_death_before_start((exception,)) + else: + waiter = Waiter() if block else None # pylint:disable=undefined-variable + self.parent.loop.run_callback(_kill, self, exception, waiter) + if block: + waiter.get() + self.join(timeout) + # it should be OK to use kill() in finally or kill a greenlet from more than one place; + # thus it should not raise when the greenlet is already killed (= not started) + + def get(self, block=True, timeout=None): + """ + get(block=True, timeout=None) -> object + + Return the result the greenlet has returned or re-raise the + exception it has raised. + + If block is ``False``, raise :class:`gevent.Timeout` if the + greenlet is still alive. If block is ``True``, unschedule the + current greenlet until the result is available or the timeout + expires. In the latter case, :class:`gevent.Timeout` is + raised. + """ + if self.ready(): + if self.successful(): + return self.value + self._raise_exception() + if not block: + raise Timeout() + + switch = getcurrent().switch # pylint:disable=undefined-variable + self.rawlink(switch) + try: + t = Timeout._start_new_or_dummy(timeout) + try: + result = self.parent.switch() + if result is not self: + raise InvalidSwitchError('Invalid switch into Greenlet.get(): %r' % (result, )) + finally: + t.cancel() + except: + # unlinking in 'except' instead of finally is an optimization: + # if switch occurred normally then link was already removed in _notify_links + # and there's no need to touch the links set. + # Note, however, that if "Invalid switch" assert was removed and invalid switch + # did happen, the link would remain, causing another invalid switch later in this greenlet. + self.unlink(switch) + raise + + if self.ready(): + if self.successful(): + return self.value + self._raise_exception() + + def join(self, timeout=None): + """ + join(timeout=None) -> None + + Wait until the greenlet finishes or *timeout* expires. Return + ``None`` regardless. + """ + if self.ready(): + return + + switch = getcurrent().switch # pylint:disable=undefined-variable + self.rawlink(switch) + try: + t = Timeout._start_new_or_dummy(timeout) + try: + result = self.parent.switch() + if result is not self: + raise InvalidSwitchError('Invalid switch into Greenlet.join(): %r' % (result, )) + finally: + t.cancel() + except Timeout as ex: + self.unlink(switch) + if ex is not t: + raise + except: + self.unlink(switch) + raise + + def _report_result(self, result): + self._exc_info = (None, None, None) + self.value = result + if self._links and not self._notifier: + self._notifier = self.parent.loop.run_callback(self._notify_links) + + def _report_error(self, exc_info): + if isinstance(exc_info[1], GreenletExit): + self._report_result(exc_info[1]) + return + + self._exc_info = exc_info[0], exc_info[1], dump_traceback(exc_info[2]) + + if self._links and not self._notifier: + self._notifier = self.parent.loop.run_callback(self._notify_links) + + try: + self.parent.handle_error(self, *exc_info) + finally: + del exc_info + + def run(self): + try: + self.__cancel_start() + self._start_event = _start_completed_event + + try: + result = self._run(*self.args, **self.kwargs) + except: # pylint:disable=bare-except + self._report_error(sys_exc_info()) + return + self._report_result(result) + finally: + self.__dict__.pop('_run', None) + self.args = () + self.kwargs.clear() + + def _run(self): + """ + Subclasses may override this method to take any number of + arguments and keyword arguments. + + .. versionadded:: 1.1a3 + Previously, if no callable object was + passed to the constructor, the spawned greenlet would later + fail with an AttributeError. + """ + # We usually override this in __init__ + # pylint: disable=method-hidden + return + + def has_links(self): + return len(self._links) + + def rawlink(self, callback): + """ + Register a callable to be executed when the greenlet finishes + execution. + + The *callback* will be called with this instance as an + argument. + + .. caution:: The callable will be called in the HUB greenlet. + """ + if not callable(callback): + raise TypeError('Expected callable: %r' % (callback, )) + self._links.append(callback) # pylint:disable=no-member + if self.ready() and self._links and not self._notifier: + self._notifier = self.parent.loop.run_callback(self._notify_links) + + def link(self, callback, SpawnedLink=SpawnedLink): + """ + Link greenlet's completion to a callable. + + The *callback* will be called with this instance as an + argument once this greenlet is dead. A callable is called in + its own :class:`greenlet.greenlet` (*not* a + :class:`Greenlet`). + """ + # XXX: Is the redefinition of SpawnedLink supposed to just be an + # optimization, or do people use it? It's not documented + # pylint:disable=redefined-outer-name + self.rawlink(SpawnedLink(callback)) + + def unlink(self, callback): + """Remove the callback set by :meth:`link` or :meth:`rawlink`""" + try: + self._links.remove(callback) # pylint:disable=no-member + except ValueError: + pass + + def unlink_all(self): + """ + Remove all the callbacks. + + .. versionadded:: 1.3a2 + """ + del self._links[:] + + def link_value(self, callback, SpawnedLink=SuccessSpawnedLink): + """ + Like :meth:`link` but *callback* is only notified when the greenlet + has completed successfully. + """ + # pylint:disable=redefined-outer-name + self.link(callback, SpawnedLink=SpawnedLink) + + def link_exception(self, callback, SpawnedLink=FailureSpawnedLink): + """ + Like :meth:`link` but *callback* is only notified when the + greenlet dies because of an unhandled exception. + """ + # pylint:disable=redefined-outer-name + self.link(callback, SpawnedLink=SpawnedLink) + + def _notify_links(self): + while self._links: + # Early links are allowed to remove later links + # before we get to them, and they're also allowed to + # add new links, so we have to be careful about iterating. + + # We don't expect this list to be very large, so the time spent + # manipulating it should be small. a deque is probably not justified. + # Cython has optimizations to transform this into a memmove anyway. + link = self._links.pop(0) + try: + link(self) + except: # pylint:disable=bare-except + self.parent.handle_error((link, self), *sys_exc_info()) + + +class _dummy_event(object): + __slots__ = ('pending', 'active') + + def __init__(self): + self.pending = self.active = False + + def stop(self): + pass + + def start(self, cb): # pylint:disable=unused-argument + raise AssertionError("Cannot start the dummy event") + + def close(self): + pass + +_cancelled_start_event = _dummy_event() +_start_completed_event = _dummy_event() + + +def _kill(glet, exception, waiter): + try: + glet.throw(exception) + except: # pylint:disable=bare-except + # XXX do we need this here? + glet.parent.handle_error(glet, *sys_exc_info()) + if waiter is not None: + waiter.switch(None) + + +def joinall(greenlets, timeout=None, raise_error=False, count=None): + """ + Wait for the ``greenlets`` to finish. + + :param greenlets: A sequence (supporting :func:`len`) of greenlets to wait for. + :keyword float timeout: If given, the maximum number of seconds to wait. + :return: A sequence of the greenlets that finished before the timeout (if any) + expired. + """ + if not raise_error: + return wait(greenlets, timeout=timeout, count=count) + + done = [] + for obj in iwait(greenlets, timeout=timeout, count=count): + if getattr(obj, 'exception', None) is not None: + if hasattr(obj, '_raise_exception'): + obj._raise_exception() + else: + raise obj.exception + done.append(obj) + return done + + +def _killall3(greenlets, exception, waiter): + diehards = [] + for g in greenlets: + if not g.dead: + try: + g.throw(exception) + except: # pylint:disable=bare-except + g.parent.handle_error(g, *sys_exc_info()) + if not g.dead: + diehards.append(g) + waiter.switch(diehards) + + +def _killall(greenlets, exception): + for g in greenlets: + if not g.dead: + try: + g.throw(exception) + except: # pylint:disable=bare-except + g.parent.handle_error(g, *sys_exc_info()) + + +def _call_spawn_callbacks(gr): + if _spawn_callbacks is not None: + for cb in _spawn_callbacks: + cb(gr) + + +_spawn_callbacks = None + + +def killall(greenlets, exception=GreenletExit, block=True, timeout=None): + """ + Forceably terminate all the ``greenlets`` by causing them to raise ``exception``. + + .. caution:: Use care when killing greenlets. If they are not prepared for exceptions, + this could result in corrupted state. + + :param greenlets: A **bounded** iterable of the non-None greenlets to terminate. + *All* the items in this iterable must be greenlets that belong to the same thread. + :keyword exception: The exception to raise in the greenlets. By default this is + :class:`GreenletExit`. + :keyword bool block: If True (the default) then this function only returns when all the + greenlets are dead; the current greenlet is unscheduled during that process. + If greenlets ignore the initial exception raised in them, + then they will be joined (with :func:`gevent.joinall`) and allowed to die naturally. + If False, this function returns immediately and greenlets will raise + the exception asynchronously. + :keyword float timeout: A time in seconds to wait for greenlets to die. If given, it is + only honored when ``block`` is True. + :raise Timeout: If blocking and a timeout is given that elapses before + all the greenlets are dead. + + .. versionchanged:: 1.1a2 + *greenlets* can be any iterable of greenlets, like an iterator or a set. + Previously it had to be a list or tuple. + """ + # support non-indexable containers like iterators or set objects + greenlets = list(greenlets) + if not greenlets: + return + loop = greenlets[0].loop + if block: + waiter = Waiter() # pylint:disable=undefined-variable + loop.run_callback(_killall3, greenlets, exception, waiter) + t = Timeout._start_new_or_dummy(timeout) + try: + alive = waiter.get() + if alive: + joinall(alive, raise_error=False) + finally: + t.cancel() + else: + loop.run_callback(_killall, greenlets, exception) + +def _init(): + greenlet_init() # pylint:disable=undefined-variable + +_init() + +from gevent._util import import_c_accel +import_c_accel(globals(), 'gevent._greenlet') diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/hub.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/hub.py new file mode 100644 index 00000000..2e26fa3a --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/hub.py @@ -0,0 +1,750 @@ +# Copyright (c) 2009-2015 Denis Bilenko. See LICENSE for details. +""" +Event-loop hub. +""" +from __future__ import absolute_import, print_function +# XXX: FIXME: Refactor to make this smaller +# pylint:disable=too-many-lines +from functools import partial as _functools_partial + +import sys +import traceback + + +from greenlet import greenlet as RawGreenlet +from greenlet import getcurrent +from greenlet import GreenletExit + + + +__all__ = [ + 'getcurrent', + 'GreenletExit', + 'spawn_raw', + 'sleep', + 'kill', + 'signal', + 'reinit', + 'get_hub', + 'Hub', + 'Waiter', +] + +from gevent._config import config as GEVENT_CONFIG +from gevent._compat import thread_mod_name +from gevent._util import readproperty +from gevent._util import Lazy +from gevent._util import gmctime +from gevent._ident import IdentRegistry + +from gevent._hub_local import get_hub +from gevent._hub_local import get_loop +from gevent._hub_local import set_hub +from gevent._hub_local import set_loop +from gevent._hub_local import get_hub_if_exists as _get_hub +from gevent._hub_local import get_hub_noargs as _get_hub_noargs +from gevent._hub_local import set_default_hub_class + +from gevent._greenlet_primitives import TrackedRawGreenlet +from gevent._hub_primitives import WaitOperationsGreenlet + +# Export +from gevent import _hub_primitives +wait = _hub_primitives.wait_on_objects +iwait = _hub_primitives.iwait_on_objects + + +from gevent.exceptions import LoopExit + +from gevent._waiter import Waiter + +# Need the real get_ident. We're imported early enough (by gevent/__init__.py) +# that we can be sure nothing is monkey patched yet. +get_thread_ident = __import__(thread_mod_name).get_ident +MAIN_THREAD_IDENT = get_thread_ident() # XXX: Assuming import is done on the main thread. + + +def spawn_raw(function, *args, **kwargs): + """ + Create a new :class:`greenlet.greenlet` object and schedule it to + run ``function(*args, **kwargs)``. + + This returns a raw :class:`~greenlet.greenlet` which does not have all the useful + methods that :class:`gevent.Greenlet` has. Typically, applications + should prefer :func:`~gevent.spawn`, but this method may + occasionally be useful as an optimization if there are many + greenlets involved. + + .. versionchanged:: 1.1a3 + Verify that ``function`` is callable, raising a TypeError if not. Previously, + the spawned greenlet would have failed the first time it was switched to. + + .. versionchanged:: 1.1b1 + If *function* is not callable, immediately raise a :exc:`TypeError` + instead of spawning a greenlet that will raise an uncaught TypeError. + + .. versionchanged:: 1.1rc2 + Accept keyword arguments for ``function`` as previously (incorrectly) + documented. Note that this may incur an additional expense. + + .. versionchanged:: 1.3a2 + Populate the ``spawning_greenlet`` and ``spawn_tree_locals`` + attributes of the returned greenlet. + + .. versionchanged:: 1.3b1 + *Only* populate ``spawning_greenlet`` and ``spawn_tree_locals`` + if ``GEVENT_TRACK_GREENLET_TREE`` is enabled (the default). If not enabled, + those attributes will not be set. + + """ + if not callable(function): + raise TypeError("function must be callable") + + # The hub is always the parent. + hub = _get_hub_noargs() + + factory = TrackedRawGreenlet if GEVENT_CONFIG.track_greenlet_tree else RawGreenlet + + # The callback class object that we use to run this doesn't + # accept kwargs (and those objects are heavily used, as well as being + # implemented twice in core.ppyx and corecffi.py) so do it with a partial + if kwargs: + function = _functools_partial(function, *args, **kwargs) + g = factory(function, hub) + hub.loop.run_callback(g.switch) + else: + g = factory(function, hub) + hub.loop.run_callback(g.switch, *args) + + return g + + +def sleep(seconds=0, ref=True): + """ + Put the current greenlet to sleep for at least *seconds*. + + *seconds* may be specified as an integer, or a float if fractional + seconds are desired. + + .. tip:: In the current implementation, a value of 0 (the default) + means to yield execution to any other runnable greenlets, but + this greenlet may be scheduled again before the event loop + cycles (in an extreme case, a greenlet that repeatedly sleeps + with 0 can prevent greenlets that are ready to do I/O from + being scheduled for some (small) period of time); a value greater than + 0, on the other hand, will delay running this greenlet until + the next iteration of the loop. + + If *ref* is False, the greenlet running ``sleep()`` will not prevent :func:`gevent.wait` + from exiting. + + .. versionchanged:: 1.3a1 + Sleeping with a value of 0 will now be bounded to approximately block the + loop for no longer than :func:`gevent.getswitchinterval`. + + .. seealso:: :func:`idle` + """ + hub = _get_hub_noargs() + loop = hub.loop + if seconds <= 0: + waiter = Waiter(hub) + loop.run_callback(waiter.switch, None) + waiter.get() + else: + with loop.timer(seconds, ref=ref) as t: + # Sleeping is expected to be an "absolute" measure with + # respect to time.time(), not a relative measure, so it's + # important to update the loop's notion of now before we start + loop.update_now() + hub.wait(t) + + +def idle(priority=0): + """ + Cause the calling greenlet to wait until the event loop is idle. + + Idle is defined as having no other events of the same or higher + *priority* pending. That is, as long as sockets, timeouts or even + signals of the same or higher priority are being processed, the loop + is not idle. + + .. seealso:: :func:`sleep` + """ + hub = _get_hub_noargs() + watcher = hub.loop.idle() + if priority: + watcher.priority = priority + hub.wait(watcher) + + +def kill(greenlet, exception=GreenletExit): + """ + Kill greenlet asynchronously. The current greenlet is not unscheduled. + + .. note:: + + The method :meth:`Greenlet.kill` method does the same and + more (and the same caveats listed there apply here). However, the MAIN + greenlet - the one that exists initially - does not have a + ``kill()`` method, and neither do any created with :func:`spawn_raw`, + so you have to use this function. + + .. caution:: Use care when killing greenlets. If they are not prepared for + exceptions, this could result in corrupted state. + + .. versionchanged:: 1.1a2 + If the ``greenlet`` has a :meth:`kill ` method, calls it. This prevents a + greenlet from being switched to for the first time after it's been + killed but not yet executed. + """ + if not greenlet.dead: + if hasattr(greenlet, 'kill'): + # dealing with gevent.greenlet.Greenlet. Use it, especially + # to avoid allowing one to be switched to for the first time + # after it's been killed + greenlet.kill(exception=exception, block=False) + else: + _get_hub_noargs().loop.run_callback(greenlet.throw, exception) + + +class signal(object): + """ + Call the *handler* with the *args* and *kwargs* when the process + receives the signal *signalnum*. + + The *handler* will be run in a new greenlet when the signal is delivered. + + This returns an object with the useful method ``cancel``, which, when called, + will prevent future deliveries of *signalnum* from calling *handler*. + + .. note:: + + This may not operate correctly with SIGCHLD if libev child watchers + are used (as they are by default with os.fork). + + .. versionchanged:: 1.2a1 + The ``handler`` argument is required to be callable at construction time. + """ + + # XXX: This is manually documented in gevent.rst while it is aliased in + # the gevent module. + + greenlet_class = None + + def __init__(self, signalnum, handler, *args, **kwargs): + if not callable(handler): + raise TypeError("signal handler must be callable.") + + self.hub = _get_hub_noargs() + self.watcher = self.hub.loop.signal(signalnum, ref=False) + self.watcher.start(self._start) + self.handler = handler + self.args = args + self.kwargs = kwargs + if self.greenlet_class is None: + from gevent import Greenlet + self.greenlet_class = Greenlet + + def _get_ref(self): + return self.watcher.ref + + def _set_ref(self, value): + self.watcher.ref = value + + ref = property(_get_ref, _set_ref) + del _get_ref, _set_ref + + def cancel(self): + self.watcher.stop() + + def _start(self): + try: + greenlet = self.greenlet_class(self.handle) + greenlet.switch() + except: # pylint:disable=bare-except + self.hub.handle_error(None, *sys._exc_info()) # pylint:disable=no-member + + def handle(self): + try: + self.handler(*self.args, **self.kwargs) + except: # pylint:disable=bare-except + self.hub.handle_error(None, *sys.exc_info()) + + +def reinit(hub=None): + """ + reinit() -> None + + Prepare the gevent hub to run in a new (forked) process. + + This should be called *immediately* after :func:`os.fork` in the + child process. This is done automatically by + :func:`gevent.os.fork` or if the :mod:`os` module has been + monkey-patched. If this function is not called in a forked + process, symptoms may include hanging of functions like + :func:`socket.getaddrinfo`, and the hub's threadpool is unlikely + to work. + + .. note:: Registered fork watchers may or may not run before + this function (and thus ``gevent.os.fork``) return. If they have + not run, they will run "soon", after an iteration of the event loop. + You can force this by inserting a few small (but non-zero) calls to :func:`sleep` + after fork returns. (As of gevent 1.1 and before, fork watchers will + not have run, but this may change in the future.) + + .. note:: This function may be removed in a future major release + if the fork process can be more smoothly managed. + + .. warning:: See remarks in :func:`gevent.os.fork` about greenlets + and event loop watchers in the child process. + """ + # Note the signature line in the docstring: hub is not a public param. + + # The loop reinit function in turn calls libev's ev_loop_fork + # function. + hub = _get_hub() if hub is None else hub + if hub is None: + return + + # Note that we reinit the existing loop, not destroy it. + # See https://github.com/gevent/gevent/issues/200. + hub.loop.reinit() + # libev's fork watchers are slow to fire because the only fire + # at the beginning of a loop; due to our use of callbacks that + # run at the end of the loop, that may be too late. The + # threadpool and resolvers depend on the fork handlers being + # run (specifically, the threadpool will fail in the forked + # child if there were any threads in it, which there will be + # if the resolver_thread was in use (the default) before the + # fork.) + # + # If the forked process wants to use the threadpool or + # resolver immediately (in a queued callback), it would hang. + # + # The below is a workaround. Fortunately, all of these + # methods are idempotent and can be called multiple times + # following a fork if the suddenly started working, or were + # already working on some platforms. Other threadpools and fork handlers + # will be called at an arbitrary time later ('soon') + for obj in (hub._threadpool, hub._resolver, hub.periodic_monitoring_thread): + getattr(obj, '_on_fork', lambda: None)() + + # TODO: We'd like to sleep for a non-zero amount of time to force the loop to make a + # pass around before returning to this greenlet. That will allow any + # user-provided fork watchers to run. (Two calls are necessary.) HOWEVER, if + # we do this, certain tests that heavily mix threads and forking, + # like 2.7/test_threading:test_reinit_tls_after_fork, fail. It's not immediately clear + # why. + #sleep(0.00001) + #sleep(0.00001) + + +class Hub(WaitOperationsGreenlet): + """ + A greenlet that runs the event loop. + + It is created automatically by :func:`get_hub`. + + .. rubric:: Switching + + Every time this greenlet (i.e., the event loop) is switched *to*, + if the current greenlet has a ``switch_out`` method, it will be + called. This allows a greenlet to take some cleanup actions before + yielding control. This method should not call any gevent blocking + functions. + """ + + #: If instances of these classes are raised into the event loop, + #: they will be propagated out to the main greenlet (where they will + #: usually be caught by Python itself) + SYSTEM_ERROR = (KeyboardInterrupt, SystemExit, SystemError) + + #: Instances of these classes are not considered to be errors and + #: do not get logged/printed when raised by the event loop. + NOT_ERROR = (GreenletExit, SystemExit) + + #: The size we use for our threadpool. Either use a subclass + #: for this, or change it immediately after creating the hub. + threadpool_size = 10 + + # An instance of PeriodicMonitoringThread, if started. + periodic_monitoring_thread = None + + # The ident of the thread we were created in, which should be the + # thread that we run in. + thread_ident = None + + #: A string giving the name of this hub. Useful for associating hubs + #: with particular threads. Printed as part of the default repr. + #: + #: .. versionadded:: 1.3b1 + name = '' + + # NOTE: We cannot define a class-level 'loop' attribute + # because that conflicts with the slot we inherit from the + # Cythonized-bases. + + # This is the source for our 'minimal_ident' property. We don't use a + # IdentRegistry because we've seen some crashes having to do with + # clearing weak references on shutdown in Windows (see known_failures.py). + # This gives us slightly different semantics than a greenlet's minimal_ident + # (notably, there can be holes) but we never documented this object's minimal_ident, + # and there should be few enough hub's over the lifetime of a process so as not + # to matter much. + _hub_counter = 0 + + def __init__(self, loop=None, default=None): + WaitOperationsGreenlet.__init__(self, None, None) + self.thread_ident = get_thread_ident() + if hasattr(loop, 'run'): + if default is not None: + raise TypeError("Unexpected argument: default") + self.loop = loop + elif get_loop() is not None: + # Reuse a loop instance previously set by + # destroying a hub without destroying the associated + # loop. See #237 and #238. + self.loop = get_loop() + else: + if default is None and self.thread_ident != MAIN_THREAD_IDENT: + default = False + + if loop is None: + loop = self.backend + self.loop = self.loop_class(flags=loop, default=default) # pylint:disable=not-callable + self._resolver = None + self._threadpool = None + self.format_context = GEVENT_CONFIG.format_context + + Hub._hub_counter += 1 + self.minimal_ident = Hub._hub_counter + + @Lazy + def ident_registry(self): + return IdentRegistry() + + @property + def loop_class(self): + return GEVENT_CONFIG.loop + + @property + def backend(self): + return GEVENT_CONFIG.libev_backend + + @property + def main_hub(self): + """ + Is this the hub for the main thread? + + .. versionadded:: 1.3b1 + """ + return self.thread_ident == MAIN_THREAD_IDENT + + def __repr__(self): + if self.loop is None: + info = 'destroyed' + else: + try: + info = self.loop._format() + except Exception as ex: # pylint:disable=broad-except + info = str(ex) or repr(ex) or 'error' + result = '<%s %r at 0x%x %s' % ( + self.__class__.__name__, + self.name, + id(self), + info) + if self._resolver is not None: + result += ' resolver=%r' % self._resolver + if self._threadpool is not None: + result += ' threadpool=%r' % self._threadpool + result += ' thread_ident=%s' % (hex(self.thread_ident), ) + return result + '>' + + def handle_error(self, context, type, value, tb): + """ + Called by the event loop when an error occurs. The arguments + type, value, and tb are the standard tuple returned by :func:`sys.exc_info`. + + Applications can set a property on the hub with this same signature + to override the error handling provided by this class. + + Errors that are :attr:`system errors ` are passed + to :meth:`handle_system_error`. + + :param context: If this is ``None``, indicates a system error that + should generally result in exiting the loop and being thrown to the + parent greenlet. + """ + if isinstance(value, str): + # Cython can raise errors where the value is a plain string + # e.g., AttributeError, "_semaphore.Semaphore has no attr", + value = type(value) + if not issubclass(type, self.NOT_ERROR): + self.print_exception(context, type, value, tb) + if context is None or issubclass(type, self.SYSTEM_ERROR): + self.handle_system_error(type, value) + + def handle_system_error(self, type, value): + """ + Called from `handle_error` when the exception type is determined + to be a :attr:`system error `. + + System errors cause the exception to be raised in the main + greenlet (the parent of this hub). + """ + current = getcurrent() + if current is self or current is self.parent or self.loop is None: + self.parent.throw(type, value) + else: + # in case system error was handled and life goes on + # switch back to this greenlet as well + cb = None + try: + cb = self.loop.run_callback(current.switch) + except: # pylint:disable=bare-except + traceback.print_exc(file=self.exception_stream) + try: + self.parent.throw(type, value) + finally: + if cb is not None: + cb.stop() + + @readproperty + def exception_stream(self): + """ + The stream to which exceptions will be written. + Defaults to ``sys.stderr`` unless assigned to. + + .. versionadded:: 1.2a1 + """ + # Unwrap any FileObjectThread we have thrown around sys.stderr + # (because it can't be used in the hub). Tricky because we are + # called in error situations when it's not safe to import. + # Be careful not to access sys if we're in the process of interpreter + # shutdown. + stderr = sys.stderr if sys else None # pylint:disable=using-constant-test + if type(stderr).__name__ == 'FileObjectThread': + stderr = stderr.io # pylint:disable=no-member + return stderr + + def print_exception(self, context, type, value, tb): + # Python 3 does not gracefully handle None value or tb in + # traceback.print_exception() as previous versions did. + # pylint:disable=no-member + errstream = self.exception_stream + if not errstream: # pragma: no cover + # If the error stream is gone, such as when the sys dict + # gets cleared during interpreter shutdown, + # don't cause follow-on errors. + # See https://github.com/gevent/gevent/issues/1295 + return + + if value is None: + errstream.write('%s\n' % type.__name__) + else: + traceback.print_exception(type, value, tb, file=errstream) + del tb + + try: + errstream.write(gmctime()) + errstream.write(' ' if context is not None else '\n') + except: # pylint:disable=bare-except + # Possible not safe to import under certain + # error conditions in Python 2 + pass + + if context is not None: + if not isinstance(context, str): + try: + context = self.format_context(context) + except: # pylint:disable=bare-except + traceback.print_exc(file=self.exception_stream) + context = repr(context) + errstream.write('%s failed with %s\n\n' % (context, getattr(type, '__name__', 'exception'), )) + + + def run(self): + """ + Entry-point to running the loop. This method is called automatically + when the hub greenlet is scheduled; do not call it directly. + + :raises gevent.exceptions.LoopExit: If the loop finishes running. This means + that there are no other scheduled greenlets, and no active + watchers or servers. In some situations, this indicates a + programming error. + """ + assert self is getcurrent(), 'Do not call Hub.run() directly' + self.start_periodic_monitoring_thread() + while 1: + loop = self.loop + loop.error_handler = self + try: + loop.run() + finally: + loop.error_handler = None # break the refcount cycle + debug = [] + if hasattr(loop, 'debug'): + debug = loop.debug() + self.parent.throw(LoopExit('This operation would block forever', self, debug)) + # this function must never return, as it will cause switch() in the parent greenlet + # to return an unexpected value + # It is still possible to kill this greenlet with throw. However, in that case + # switching to it is no longer safe, as switch will return immediately + + def start_periodic_monitoring_thread(self): + if self.periodic_monitoring_thread is None and GEVENT_CONFIG.monitor_thread: + # Note that it is possible for one real thread to + # (temporarily) wind up with multiple monitoring threads, + # if hubs are started and stopped within the thread. This shows up + # in the threadpool tests. The monitoring threads will eventually notice their + # hub object is gone. + from gevent._monitor import PeriodicMonitoringThread + from gevent.events import PeriodicMonitorThreadStartedEvent + from gevent.events import notify_and_call_entry_points + self.periodic_monitoring_thread = PeriodicMonitoringThread(self) + + if self.main_hub: + self.periodic_monitoring_thread.install_monitor_memory_usage() + + notify_and_call_entry_points(PeriodicMonitorThreadStartedEvent( + self.periodic_monitoring_thread)) + + return self.periodic_monitoring_thread + + def join(self, timeout=None): + """Wait for the event loop to finish. Exits only when there are + no more spawned greenlets, started servers, active timeouts or watchers. + + If *timeout* is provided, wait no longer for the specified number of seconds. + + Returns True if exited because the loop finished execution. + Returns False if exited because of timeout expired. + """ + assert getcurrent() is self.parent, "only possible from the MAIN greenlet" + if self.dead: + return True + + waiter = Waiter(self) + + if timeout is not None: + timeout = self.loop.timer(timeout, ref=False) + timeout.start(waiter.switch, None) + + try: + try: + waiter.get() + except LoopExit: + return True + finally: + if timeout is not None: + timeout.stop() + timeout.close() + return False + + def destroy(self, destroy_loop=None): + """ + Destroy this hub and clean up its resources. + + If you manually create hubs, you *should* call this + method before disposing of the hub object reference. + """ + if self.periodic_monitoring_thread is not None: + self.periodic_monitoring_thread.kill() + self.periodic_monitoring_thread = None + if self._resolver is not None: + self._resolver.close() + del self._resolver + if self._threadpool is not None: + self._threadpool.kill() + del self._threadpool + if destroy_loop is None: + destroy_loop = not self.loop.default + if destroy_loop: + if get_loop() is self.loop: + # Don't let anyone try to reuse this + set_loop(None) + self.loop.destroy() + else: + # Store in case another hub is created for this + # thread. + set_loop(self.loop) + + + self.loop = None + if _get_hub() is self: + set_hub(None) + + + # XXX: We can probably simplify the resolver and threadpool properties. + + @property + def resolver_class(self): + return GEVENT_CONFIG.resolver + + def _get_resolver(self): + if self._resolver is None: + self._resolver = self.resolver_class(hub=self) # pylint:disable=not-callable + return self._resolver + + def _set_resolver(self, value): + self._resolver = value + + def _del_resolver(self): + self._resolver = None + + resolver = property(_get_resolver, _set_resolver, _del_resolver, + """ + The DNS resolver that the socket functions will use. + + .. seealso:: :doc:`/dns` + """) + + + @property + def threadpool_class(self): + return GEVENT_CONFIG.threadpool + + def _get_threadpool(self): + if self._threadpool is None: + # pylint:disable=not-callable + self._threadpool = self.threadpool_class(self.threadpool_size, hub=self) + return self._threadpool + + def _set_threadpool(self, value): + self._threadpool = value + + def _del_threadpool(self): + self._threadpool = None + + threadpool = property(_get_threadpool, _set_threadpool, _del_threadpool, + """ + The threadpool associated with this hub. + + Usually this is a + :class:`gevent.threadpool.ThreadPool`, but + you :attr:`can customize that + `. + + Use this object to schedule blocking + (non-cooperative) operations in a different + thread to prevent them from halting the event loop. + """) + + +set_default_hub_class(Hub) + + + +class linkproxy(object): + __slots__ = ['callback', 'obj'] + + def __init__(self, callback, obj): + self.callback = callback + self.obj = obj + + def __call__(self, *args): + callback = self.callback + obj = self.obj + self.callback = None + self.obj = None + callback(obj) diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/libev/__init__.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/libev/__init__.py new file mode 100644 index 00000000..412d64ce --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/libev/__init__.py @@ -0,0 +1,7 @@ +# -*- coding: utf-8 -*- +from __future__ import absolute_import +from __future__ import division +from __future__ import print_function + +# Nothing public here +__all__ = [] diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/libev/_corecffi_build.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/libev/_corecffi_build.py new file mode 100644 index 00000000..a6025fc4 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/libev/_corecffi_build.py @@ -0,0 +1,75 @@ +# pylint: disable=no-member + +# This module is only used to create and compile the gevent._corecffi module; +# nothing should be directly imported from it except `ffi`, which should only be +# used for `ffi.compile()`; programs should import gevent._corecfffi. +# However, because we are using "out-of-line" mode, it is necessary to examine +# this file to know what functions are created and available on the generated +# module. +from __future__ import absolute_import, print_function +import sys +import os +import os.path # pylint:disable=no-name-in-module +import struct + +__all__ = [] + + +def system_bits(): + return struct.calcsize('P') * 8 + + +def st_nlink_type(): + if sys.platform == "darwin" or sys.platform.startswith("freebsd"): + return "short" + if system_bits() == 32: + return "unsigned long" + return "long long" + + +from cffi import FFI +ffi = FFI() + +thisdir = os.path.dirname(os.path.abspath(__file__)) +def read_source(name): + with open(os.path.join(thisdir, name), 'r') as f: + return f.read() + +_cdef = read_source('_corecffi_cdef.c') +_source = read_source('_corecffi_source.c') + +_cdef = _cdef.replace('#define GEVENT_ST_NLINK_T int', '') +_cdef = _cdef.replace('#define GEVENT_STRUCT_DONE int', '') +_cdef = _cdef.replace('GEVENT_ST_NLINK_T', st_nlink_type()) +_cdef = _cdef.replace("GEVENT_STRUCT_DONE _;", '...;') + + +if sys.platform.startswith('win'): + # We must have the vfd_open, etc, functions on + # Windows. But on other platforms, going through + # CFFI to just return the file-descriptor is slower + # than just doing it in Python, so we check for and + # workaround their absence in corecffi.py + _cdef += """ +typedef int... vfd_socket_t; +int vfd_open(vfd_socket_t); +vfd_socket_t vfd_get(int); +void vfd_free(int); +""" + + + +include_dirs = [ + thisdir, # libev_vfd.h + os.path.abspath(os.path.join(thisdir, '..', '..', '..', 'deps', 'libev')), +] +ffi.cdef(_cdef) +ffi.set_source('gevent.libev._corecffi', _source, include_dirs=include_dirs) + +if __name__ == '__main__': + # XXX: Note, on Windows, we would need to specify the external libraries + # that should be linked in, such as ws2_32 and (because libev_vfd.h makes + # Python.h calls) the proper Python library---at least for PyPy. I never got + # that to work though, and calling python functions is strongly discouraged + # from CFFI code. + ffi.compile() diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/libev/_corecffi_cdef.c b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/libev/_corecffi_cdef.c new file mode 100644 index 00000000..3280e991 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/libev/_corecffi_cdef.c @@ -0,0 +1,243 @@ +/* libev interface */ + +#define EV_MINPRI ... +#define EV_MAXPRI ... + +#define EV_VERSION_MAJOR ... +#define EV_VERSION_MINOR ... + +#define EV_UNDEF ... +#define EV_NONE ... +#define EV_READ ... +#define EV_WRITE ... +#define EV__IOFDSET ... +#define EV_TIMER ... +#define EV_PERIODIC ... +#define EV_SIGNAL ... +#define EV_CHILD ... +#define EV_STAT ... +#define EV_IDLE ... +#define EV_PREPARE ... +#define EV_CHECK ... +#define EV_EMBED ... +#define EV_FORK ... +#define EV_CLEANUP ... +#define EV_ASYNC ... +#define EV_CUSTOM ... +#define EV_ERROR ... + +#define EVFLAG_AUTO ... +#define EVFLAG_NOENV ... +#define EVFLAG_FORKCHECK ... +#define EVFLAG_NOINOTIFY ... +#define EVFLAG_SIGNALFD ... +#define EVFLAG_NOSIGMASK ... + +#define EVBACKEND_SELECT ... +#define EVBACKEND_POLL ... +#define EVBACKEND_EPOLL ... +#define EVBACKEND_KQUEUE ... +#define EVBACKEND_DEVPOLL ... +#define EVBACKEND_PORT ... +/* #define EVBACKEND_IOCP ... */ + +#define EVBACKEND_ALL ... +#define EVBACKEND_MASK ... + +#define EVRUN_NOWAIT ... +#define EVRUN_ONCE ... + +#define EVBREAK_CANCEL ... +#define EVBREAK_ONE ... +#define EVBREAK_ALL ... + +/* markers for the CFFI parser. Replaced when the string is read. */ +#define GEVENT_STRUCT_DONE int +#define GEVENT_ST_NLINK_T int + +struct ev_loop { + int backend_fd; + int activecnt; + GEVENT_STRUCT_DONE _; +}; + +// Watcher types +// base for all watchers +struct ev_watcher{ + void* data; + GEVENT_STRUCT_DONE _; +}; + +struct ev_io { + int fd; + int events; + void* data; + GEVENT_STRUCT_DONE _; +}; +struct ev_timer { + double at; + void* data; + GEVENT_STRUCT_DONE _; +}; +struct ev_signal { + void* data; + GEVENT_STRUCT_DONE _; +}; +struct ev_idle { + void* data; + GEVENT_STRUCT_DONE _; +}; +struct ev_prepare { + void* data; + GEVENT_STRUCT_DONE _; +}; +struct ev_check { + void* data; + GEVENT_STRUCT_DONE _; +}; +struct ev_fork { + void* data; + GEVENT_STRUCT_DONE _; +}; +struct ev_async { + void* data; + GEVENT_STRUCT_DONE _; +}; + +struct ev_child { + int pid; + int rpid; + int rstatus; + void* data; + GEVENT_STRUCT_DONE _; +}; + +struct stat { + GEVENT_ST_NLINK_T st_nlink; + GEVENT_STRUCT_DONE _; +}; + +struct ev_stat { + struct stat attr; + const char* path; + struct stat prev; + double interval; + void* data; + GEVENT_STRUCT_DONE _; +}; + +typedef double ev_tstamp; + +int ev_version_major(); +int ev_version_minor(); + +unsigned int ev_supported_backends (void); +unsigned int ev_recommended_backends (void); +unsigned int ev_embeddable_backends (void); + +ev_tstamp ev_time (void); +void ev_set_syserr_cb(void *); + +void ev_set_userdata(struct ev_loop*, void*); +void* ev_userdata(struct ev_loop*); + +int ev_priority(void*); +void ev_set_priority(void*, int); + +int ev_is_pending(void*); +int ev_is_active(void*); +void ev_io_init(struct ev_io*, void* callback, int fd, int events); +void ev_io_start(struct ev_loop*, struct ev_io*); +void ev_io_stop(struct ev_loop*, struct ev_io*); +void ev_feed_event(struct ev_loop*, void*, int); + +void ev_timer_init(struct ev_timer*, void *callback, double, double); +void ev_timer_start(struct ev_loop*, struct ev_timer*); +void ev_timer_stop(struct ev_loop*, struct ev_timer*); +void ev_timer_again(struct ev_loop*, struct ev_timer*); + +void ev_signal_init(struct ev_signal*, void* callback, int); +void ev_signal_start(struct ev_loop*, struct ev_signal*); +void ev_signal_stop(struct ev_loop*, struct ev_signal*); + +void ev_idle_init(struct ev_idle*, void* callback); +void ev_idle_start(struct ev_loop*, struct ev_idle*); +void ev_idle_stop(struct ev_loop*, struct ev_idle*); + +void ev_prepare_init(struct ev_prepare*, void* callback); +void ev_prepare_start(struct ev_loop*, struct ev_prepare*); +void ev_prepare_stop(struct ev_loop*, struct ev_prepare*); + +void ev_check_init(struct ev_check*, void* callback); +void ev_check_start(struct ev_loop*, struct ev_check*); +void ev_check_stop(struct ev_loop*, struct ev_check*); + +void ev_fork_init(struct ev_fork*, void* callback); +void ev_fork_start(struct ev_loop*, struct ev_fork*); +void ev_fork_stop(struct ev_loop*, struct ev_fork*); + +void ev_async_init(struct ev_async*, void* callback); +void ev_async_start(struct ev_loop*, struct ev_async*); +void ev_async_stop(struct ev_loop*, struct ev_async*); +void ev_async_send(struct ev_loop*, struct ev_async*); +int ev_async_pending(struct ev_async*); + +void ev_child_init(struct ev_child*, void* callback, int, int); +void ev_child_start(struct ev_loop*, struct ev_child*); +void ev_child_stop(struct ev_loop*, struct ev_child*); + +void ev_stat_init(struct ev_stat*, void* callback, char*, double); +void ev_stat_start(struct ev_loop*, struct ev_stat*); +void ev_stat_stop(struct ev_loop*, struct ev_stat*); + +struct ev_loop *ev_default_loop (unsigned int flags); +struct ev_loop* ev_loop_new(unsigned int flags); +void ev_loop_destroy(struct ev_loop*); +void ev_loop_fork(struct ev_loop*); +int ev_is_default_loop (struct ev_loop *); +unsigned int ev_iteration(struct ev_loop*); +unsigned int ev_depth(struct ev_loop*); +unsigned int ev_backend(struct ev_loop*); +void ev_verify(struct ev_loop*); +void ev_run(struct ev_loop*, int flags); + +ev_tstamp ev_now (struct ev_loop *); +void ev_now_update (struct ev_loop *); /* update event loop time */ +void ev_ref(struct ev_loop*); +void ev_unref(struct ev_loop*); +void ev_break(struct ev_loop*, int); +unsigned int ev_pending_count(struct ev_loop*); + +struct ev_loop* gevent_ev_default_loop(unsigned int flags); +void gevent_install_sigchld_handler(); +void gevent_reset_sigchld_handler(); + +void (*gevent_noop)(struct ev_loop *_loop, struct ev_timer *w, int revents); +void ev_sleep (ev_tstamp delay); /* sleep for a while */ + +/* gevent callbacks */ +/* These will be created as static functions at the end of the + * _source.c and must be declared there too. + */ +extern "Python" { + int python_callback(void* handle, int revents); + void python_handle_error(void* handle, int revents); + void python_stop(void* handle); + void python_check_callback(struct ev_loop*, void*, int); + void python_prepare_callback(struct ev_loop*, void*, int); + + // libev specific + void _syserr_cb(char*); +} +/* + * We use a single C callback for every watcher type, which in turn calls the + * Python callbacks. The ev_watcher pointer type can be used for every watcher type + * because they all start with the same members---libev itself relies on this. Each + * watcher types has a 'void* data' that stores the CFFI handle to the Python watcher + * object. + */ +static void _gevent_generic_callback(struct ev_loop* loop, struct ev_watcher* watcher, int revents); + +static void gevent_zero_check(struct ev_check* handle); +static void gevent_zero_timer(struct ev_timer* handle); +static void gevent_zero_prepare(struct ev_prepare* handle); diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/libev/_corecffi_source.c b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/libev/_corecffi_source.c new file mode 100644 index 00000000..63b216e5 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/libev/_corecffi_source.c @@ -0,0 +1,69 @@ +// passed to the real C compiler +#define LIBEV_EMBED 1 + +#ifdef _WIN32 +#define EV_STANDALONE 1 +#include "libev_vfd.h" +#endif + + +#include "libev.h" + +static void +_gevent_noop(struct ev_loop *_loop, struct ev_timer *w, int revents) { } + +void (*gevent_noop)(struct ev_loop *, struct ev_timer *, int) = &_gevent_noop; + +static int python_callback(void* handle, int revents); +static void python_handle_error(void* handle, int revents); +static void python_stop(void* handle); + +static void _gevent_generic_callback(struct ev_loop* loop, + struct ev_watcher* watcher, + int revents) +{ + void* handle = watcher->data; + int cb_result = python_callback(handle, revents); + switch(cb_result) { + case -1: + // in case of exception, call self.loop.handle_error; + // this function is also responsible for stopping the watcher + // and allowing memory to be freed + python_handle_error(handle, revents); + break; + case 1: + // Code to stop the event. Note that if python_callback + // has disposed of the last reference to the handle, + // `watcher` could now be invalid/disposed memory! + if (!ev_is_active(watcher)) { + python_stop(handle); + } + break; + case 2: + // watcher is already stopped and dead, nothing to do. + break; + default: + fprintf(stderr, + "WARNING: gevent: Unexpected return value %d from Python callback " + "for watcher %p and handle %d\n", + cb_result, + watcher, handle); + // XXX: Possible leaking of resources here? Should we be + // closing the watcher? + } +} + +static void gevent_zero_timer(struct ev_timer* handle) +{ + memset(handle, 0, sizeof(struct ev_timer)); +} + +static void gevent_zero_check(struct ev_check* handle) +{ + memset(handle, 0, sizeof(struct ev_check)); +} + +static void gevent_zero_prepare(struct ev_prepare* handle) +{ + memset(handle, 0, sizeof(struct ev_prepare)); +} diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/libev/callbacks.c b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/libev/callbacks.c new file mode 100644 index 00000000..751b4258 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/libev/callbacks.c @@ -0,0 +1,216 @@ +/* Copyright (c) 2011-2012 Denis Bilenko. See LICENSE for details. */ +#include +#include "Python.h" +#include "ev.h" +#include "corecext.h" +#include "callbacks.h" +#ifdef Py_PYTHON_H + +#if PY_MAJOR_VERSION >= 3 + #define PyInt_FromLong PyLong_FromLong +#endif + + +#ifndef CYTHON_INLINE + #if defined(__clang__) + #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) + #elif defined(__GNUC__) + #define CYTHON_INLINE __inline__ + #elif defined(_MSC_VER) + #define CYTHON_INLINE __inline + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_INLINE inline + #else + #define CYTHON_INLINE + #endif +#endif + + +static CYTHON_INLINE void gevent_check_signals(struct PyGeventLoopObject* loop) { + if (!ev_is_default_loop(loop->_ptr)) { + /* only reporting signals on the default loop */ + return; + } + PyErr_CheckSignals(); + if (PyErr_Occurred()) gevent_handle_error(loop, Py_None); +} + +#define GET_OBJECT(PY_TYPE, EV_PTR, MEMBER) \ + ((struct PY_TYPE *)(((char *)EV_PTR) - offsetof(struct PY_TYPE, MEMBER))) + + +#ifdef WITH_THREAD +#define GIL_DECLARE PyGILState_STATE ___save +#define GIL_ENSURE ___save = PyGILState_Ensure(); +#define GIL_RELEASE PyGILState_Release(___save); +#else +#define GIL_DECLARE +#define GIL_ENSURE +#define GIL_RELEASE +#endif + + +static void gevent_stop(PyObject* watcher, struct PyGeventLoopObject* loop) { + PyObject *result, *method; + int error; + error = 1; + method = PyObject_GetAttrString(watcher, "stop"); + if (method) { + result = PyObject_Call(method, _empty_tuple, NULL); + if (result) { + Py_DECREF(result); + error = 0; + } + Py_DECREF(method); + } + if (error) { + gevent_handle_error(loop, watcher); + } +} + + +static void gevent_callback(struct PyGeventLoopObject* loop, PyObject* callback, PyObject* args, PyObject* watcher, void *c_watcher, int revents) { + GIL_DECLARE; + PyObject *result, *py_events; + long length; + py_events = 0; + GIL_ENSURE; + Py_INCREF(loop); + Py_INCREF(callback); + Py_INCREF(args); + Py_INCREF(watcher); + gevent_check_signals(loop); + if (args == Py_None) { + args = _empty_tuple; + } + length = PyTuple_Size(args); + if (length < 0) { + gevent_handle_error(loop, watcher); + goto end; + } + if (length > 0 && PyTuple_GET_ITEM(args, 0) == GEVENT_CORE_EVENTS) { + py_events = PyInt_FromLong(revents); + if (!py_events) { + gevent_handle_error(loop, watcher); + goto end; + } + PyTuple_SET_ITEM(args, 0, py_events); + } + else { + py_events = NULL; + } + result = PyObject_Call(callback, args, NULL); + if (result) { + Py_DECREF(result); + } + else { + gevent_handle_error(loop, watcher); + if (revents & (EV_READ|EV_WRITE)) { + /* io watcher: not stopping it may cause the failing callback to be called repeatedly */ + gevent_stop(watcher, loop); + goto end; + } + } + if (!ev_is_active(c_watcher)) { + /* Watcher was stopped, maybe by libev. Let's call stop() to clean up + * 'callback' and 'args' properties, do Py_DECREF() and ev_ref() if necessary. + * BTW, we don't need to check for EV_ERROR, because libev stops the watcher in that case. */ + gevent_stop(watcher, loop); + } +end: + if (py_events) { + Py_DECREF(py_events); + PyTuple_SET_ITEM(args, 0, GEVENT_CORE_EVENTS); + } + Py_DECREF(watcher); + Py_DECREF(args); + Py_DECREF(callback); + Py_DECREF(loop); + GIL_RELEASE; +} + + +void gevent_call(struct PyGeventLoopObject* loop, struct PyGeventCallbackObject* cb) { + /* no need for GIL here because it is only called from run_callbacks which already has GIL */ + PyObject *result, *callback, *args; + if (!loop || !cb) + return; + callback = cb->callback; + args = cb->args; + if (!callback || !args) + return; + if (callback == Py_None || args == Py_None) + return; + Py_INCREF(loop); + Py_INCREF(callback); + Py_INCREF(args); + + Py_INCREF(Py_None); + Py_DECREF(cb->callback); + cb->callback = Py_None; + + result = PyObject_Call(callback, args, NULL); + if (result) { + Py_DECREF(result); + } + else { + gevent_handle_error(loop, (PyObject*)cb); + } + + Py_INCREF(Py_None); + Py_DECREF(cb->args); + cb->args = Py_None; + + Py_DECREF(callback); + Py_DECREF(args); + Py_DECREF(loop); +} + +/* + * PyGeventWatcherObject is the first member of all the structs, so + * it is the same in all of them and they can all safely be cast to + * it. We could also use the *data member of the libev watcher objects. + */ + +#undef DEFINE_CALLBACK +#define DEFINE_CALLBACK(WATCHER_LC, WATCHER_TYPE) \ + void gevent_callback_##WATCHER_LC(struct ev_loop *_loop, void *c_watcher, int revents) { \ + struct PyGeventWatcherObject* watcher = (struct PyGeventWatcherObject*)GET_OBJECT(PyGevent##WATCHER_TYPE##Object, c_watcher, _watcher); \ + gevent_callback(watcher->loop, watcher->_callback, watcher->args, (PyObject*)watcher, c_watcher, revents); \ + } + + +DEFINE_CALLBACKS + + +void gevent_run_callbacks(struct ev_loop *_loop, void *watcher, int revents) { + struct PyGeventLoopObject* loop; + PyObject *result; + GIL_DECLARE; + GIL_ENSURE; + loop = GET_OBJECT(PyGeventLoopObject, watcher, _prepare); + Py_INCREF(loop); + gevent_check_signals(loop); + result = gevent_loop_run_callbacks(loop); + if (result) { + Py_DECREF(result); + } + else { + PyErr_Print(); + PyErr_Clear(); + } + Py_DECREF(loop); + GIL_RELEASE; +} + +/* This is only used on Win32 */ + +void gevent_periodic_signal_check(struct ev_loop *_loop, void *watcher, int revents) { + GIL_DECLARE; + GIL_ENSURE; + gevent_check_signals(GET_OBJECT(PyGeventLoopObject, watcher, _periodic_signal_checker)); + GIL_RELEASE; +} + + +#endif /* Py_PYTHON_H */ diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/libev/callbacks.h b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/libev/callbacks.h new file mode 100644 index 00000000..ed872247 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/libev/callbacks.h @@ -0,0 +1,38 @@ +struct ev_loop; +struct PyGeventLoopObject; +struct PyGeventCallbackObject; + +#define DEFINE_CALLBACK(WATCHER_LC, WATCHER_TYPE) \ + void gevent_callback_##WATCHER_LC(struct ev_loop *, void *, int); + + +#define DEFINE_CALLBACKS0 \ + DEFINE_CALLBACK(io, IO); \ + DEFINE_CALLBACK(timer, Timer); \ + DEFINE_CALLBACK(signal, Signal); \ + DEFINE_CALLBACK(idle, Idle); \ + DEFINE_CALLBACK(prepare, Prepare); \ + DEFINE_CALLBACK(check, Check); \ + DEFINE_CALLBACK(fork, Fork); \ + DEFINE_CALLBACK(async, Async); \ + DEFINE_CALLBACK(stat, Stat); \ + DEFINE_CALLBACK(child, Child); + + +#define DEFINE_CALLBACKS DEFINE_CALLBACKS0 + + +DEFINE_CALLBACKS + + +void gevent_run_callbacks(struct ev_loop *, void *, int); + + + +void gevent_call(struct PyGeventLoopObject* loop, struct PyGeventCallbackObject* cb); + +static void gevent_noop(struct ev_loop *_loop, void *watcher, int revents) { +} + +/* Only used on Win32 */ +void gevent_periodic_signal_check(struct ev_loop *, void *, int); diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/libev/corecext.c b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/libev/corecext.c new file mode 100644 index 00000000..f46acd1f --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/libev/corecext.c @@ -0,0 +1,23545 @@ +/* Generated by Cython 0.29.2 */ + +/* BEGIN: Cython Metadata +{ + "distutils": { + "define_macros": [ + [ + "FD_SETSIZE", + "1024" + ], + [ + "_WIN32", + "1" + ], + [ + "EV_STANDALONE", + "1" + ], + [ + "LIBEV_EMBED", + "1" + ], + [ + "EV_COMMON", + "" + ], + [ + "EV_CLEANUP_ENABLE", + "0" + ], + [ + "EV_EMBED_ENABLE", + "0" + ], + [ + "EV_PERIODIC_ENABLE", + "0" + ] + ], + "depends": [ + "deps/libev\\ev++.h", + "deps/libev\\ev.c", + "deps/libev\\ev.h", + "deps/libev\\ev_epoll.c", + "deps/libev\\ev_kqueue.c", + "deps/libev\\ev_poll.c", + "deps/libev\\ev_port.c", + "deps/libev\\ev_select.c", + "deps/libev\\ev_vars.h", + "deps/libev\\ev_win32.c", + "deps/libev\\ev_wrap.h", + "deps/libev\\event.c", + "deps/libev\\event.h", + "deps\\libev\\ev++.h", + "deps\\libev\\ev.c", + "deps\\libev\\ev.h", + "deps\\libev\\ev_epoll.c", + "deps\\libev\\ev_kqueue.c", + "deps\\libev\\ev_poll.c", + "deps\\libev\\ev_port.c", + "deps\\libev\\ev_select.c", + "deps\\libev\\ev_vars.h", + "deps\\libev\\ev_win32.c", + "deps\\libev\\ev_wrap.h", + "deps\\libev\\event.c", + "deps\\libev\\event.h", + "src/gevent/libev/stathelper.c", + "src/gevent/libev\\callbacks.c", + "src/gevent/libev\\callbacks.h", + "src/gevent/libev\\libev.h", + "src/gevent/libev\\libev_vfd.h", + "src\\gevent\\libev\\callbacks.c", + "src\\gevent\\libev\\callbacks.h", + "src\\gevent\\libev\\libev.h", + "src\\gevent\\libev\\libev_vfd.h", + "src\\gevent\\libev\\stathelper.c" + ], + "include_dirs": [ + "src/gevent/libev", + "C:\\Users\\appveyor\\AppData\\Local\\Temp\\1\\pip-req-build-23dcp19e\\deps\\libev" + ], + "libraries": [ + "ws2_32" + ], + "name": "gevent.libev.corecext", + "sources": [ + "src/gevent/libev/corecext.pyx", + "src/gevent/libev/callbacks.c" + ] + }, + "module_name": "gevent.libev.corecext" +} +END: Cython Metadata */ + +#define PY_SSIZE_T_CLEAN +#include "Python.h" +#ifndef Py_PYTHON_H + #error Python headers needed to compile C extensions, please install development version of Python. +#elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) + #error Cython requires Python 2.6+ or Python 3.3+. +#else +#define CYTHON_ABI "0_29_2" +#define CYTHON_HEX_VERSION 0x001D02F0 +#define CYTHON_FUTURE_DIVISION 1 +#include +#ifndef offsetof + #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) +#endif +#if !defined(WIN32) && !defined(MS_WINDOWS) + #ifndef __stdcall + #define __stdcall + #endif + #ifndef __cdecl + #define __cdecl + #endif + #ifndef __fastcall + #define __fastcall + #endif +#endif +#ifndef DL_IMPORT + #define DL_IMPORT(t) t +#endif +#ifndef DL_EXPORT + #define DL_EXPORT(t) t +#endif +#define __PYX_COMMA , +#ifndef HAVE_LONG_LONG + #if PY_VERSION_HEX >= 0x02070000 + #define HAVE_LONG_LONG + #endif +#endif +#ifndef PY_LONG_LONG + #define PY_LONG_LONG LONG_LONG +#endif +#ifndef Py_HUGE_VAL + #define Py_HUGE_VAL HUGE_VAL +#endif +#ifdef PYPY_VERSION + #define CYTHON_COMPILING_IN_PYPY 1 + #define CYTHON_COMPILING_IN_PYSTON 0 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #undef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 0 + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #if PY_VERSION_HEX < 0x03050000 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #elif !defined(CYTHON_USE_ASYNC_SLOTS) + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #undef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 0 + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #undef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 1 + #undef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 0 + #undef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 0 + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #undef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE 0 + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 +#elif defined(PYSTON_VERSION) + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_PYSTON 1 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #ifndef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 1 + #endif + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #ifndef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 1 + #endif + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #ifndef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 0 + #endif + #ifndef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 1 + #endif + #ifndef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 1 + #endif + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #undef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE 0 + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 +#else + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_PYSTON 0 + #define CYTHON_COMPILING_IN_CPYTHON 1 + #ifndef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 1 + #endif + #if PY_VERSION_HEX < 0x02070000 + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #elif !defined(CYTHON_USE_PYTYPE_LOOKUP) + #define CYTHON_USE_PYTYPE_LOOKUP 1 + #endif + #if PY_MAJOR_VERSION < 3 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #elif !defined(CYTHON_USE_ASYNC_SLOTS) + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #if PY_VERSION_HEX < 0x02070000 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #elif !defined(CYTHON_USE_PYLONG_INTERNALS) + #define CYTHON_USE_PYLONG_INTERNALS 1 + #endif + #ifndef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 1 + #endif + #ifndef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 1 + #endif + #if PY_VERSION_HEX < 0x030300F0 + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #elif !defined(CYTHON_USE_UNICODE_WRITER) + #define CYTHON_USE_UNICODE_WRITER 1 + #endif + #ifndef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 0 + #endif + #ifndef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 1 + #endif + #ifndef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 1 + #endif + #ifndef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 1 + #endif + #ifndef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 1 + #endif + #ifndef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000) + #endif + #ifndef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1) + #endif + #ifndef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1) + #endif + #ifndef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3) + #endif +#endif +#if !defined(CYTHON_FAST_PYCCALL) +#define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) +#endif +#if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #undef SHIFT + #undef BASE + #undef MASK + #ifdef SIZEOF_VOID_P + enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) }; + #endif +#endif +#ifndef __has_attribute + #define __has_attribute(x) 0 +#endif +#ifndef __has_cpp_attribute + #define __has_cpp_attribute(x) 0 +#endif +#ifndef CYTHON_RESTRICT + #if defined(__GNUC__) + #define CYTHON_RESTRICT __restrict__ + #elif defined(_MSC_VER) && _MSC_VER >= 1400 + #define CYTHON_RESTRICT __restrict + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_RESTRICT restrict + #else + #define CYTHON_RESTRICT + #endif +#endif +#ifndef CYTHON_UNUSED +# if defined(__GNUC__) +# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +#endif +#ifndef CYTHON_MAYBE_UNUSED_VAR +# if defined(__cplusplus) + template void CYTHON_MAYBE_UNUSED_VAR( const T& ) { } +# else +# define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x) +# endif +#endif +#ifndef CYTHON_NCP_UNUSED +# if CYTHON_COMPILING_IN_CPYTHON +# define CYTHON_NCP_UNUSED +# else +# define CYTHON_NCP_UNUSED CYTHON_UNUSED +# endif +#endif +#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) +#ifdef _MSC_VER + #ifndef _MSC_STDINT_H_ + #if _MSC_VER < 1300 + typedef unsigned char uint8_t; + typedef unsigned int uint32_t; + #else + typedef unsigned __int8 uint8_t; + typedef unsigned __int32 uint32_t; + #endif + #endif +#else + #include +#endif +#ifndef CYTHON_FALLTHROUGH + #if defined(__cplusplus) && __cplusplus >= 201103L + #if __has_cpp_attribute(fallthrough) + #define CYTHON_FALLTHROUGH [[fallthrough]] + #elif __has_cpp_attribute(clang::fallthrough) + #define CYTHON_FALLTHROUGH [[clang::fallthrough]] + #elif __has_cpp_attribute(gnu::fallthrough) + #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] + #endif + #endif + #ifndef CYTHON_FALLTHROUGH + #if __has_attribute(fallthrough) + #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) + #else + #define CYTHON_FALLTHROUGH + #endif + #endif + #if defined(__clang__ ) && defined(__apple_build_version__) + #if __apple_build_version__ < 7000000 + #undef CYTHON_FALLTHROUGH + #define CYTHON_FALLTHROUGH + #endif + #endif +#endif + +#ifndef CYTHON_INLINE + #if defined(__clang__) + #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) + #elif defined(__GNUC__) + #define CYTHON_INLINE __inline__ + #elif defined(_MSC_VER) + #define CYTHON_INLINE __inline + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_INLINE inline + #else + #define CYTHON_INLINE + #endif +#endif + +#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) + #define Py_OptimizeFlag 0 +#endif +#define __PYX_BUILD_PY_SSIZE_T "n" +#define CYTHON_FORMAT_SSIZE_T "z" +#if PY_MAJOR_VERSION < 3 + #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyClass_Type +#else + #define __Pyx_BUILTIN_MODULE_NAME "builtins" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyType_Type +#endif +#ifndef Py_TPFLAGS_CHECKTYPES + #define Py_TPFLAGS_CHECKTYPES 0 +#endif +#ifndef Py_TPFLAGS_HAVE_INDEX + #define Py_TPFLAGS_HAVE_INDEX 0 +#endif +#ifndef Py_TPFLAGS_HAVE_NEWBUFFER + #define Py_TPFLAGS_HAVE_NEWBUFFER 0 +#endif +#ifndef Py_TPFLAGS_HAVE_FINALIZE + #define Py_TPFLAGS_HAVE_FINALIZE 0 +#endif +#ifndef METH_STACKLESS + #define METH_STACKLESS 0 +#endif +#if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) + #ifndef METH_FASTCALL + #define METH_FASTCALL 0x80 + #endif + typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs); + typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args, + Py_ssize_t nargs, PyObject *kwnames); +#else + #define __Pyx_PyCFunctionFast _PyCFunctionFast + #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords +#endif +#if CYTHON_FAST_PYCCALL +#define __Pyx_PyFastCFunction_Check(func)\ + ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS))))) +#else +#define __Pyx_PyFastCFunction_Check(func) 0 +#endif +#if CYTHON_USE_DICT_VERSIONS +#define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) +#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ + (version_var) = __PYX_GET_DICT_VERSION(dict);\ + (cache_var) = (value); +#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ + static PY_UINT64_T __pyx_dict_version = 0;\ + static PyObject *__pyx_dict_cached_value = NULL;\ + if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ + (VAR) = __pyx_dict_cached_value;\ + } else {\ + (VAR) = __pyx_dict_cached_value = (LOOKUP);\ + __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ + }\ + } +#else +#define __PYX_GET_DICT_VERSION(dict) (0) +#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) +#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) + #define PyObject_Malloc(s) PyMem_Malloc(s) + #define PyObject_Free(p) PyMem_Free(p) + #define PyObject_Realloc(p) PyMem_Realloc(p) +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1 + #define PyMem_RawMalloc(n) PyMem_Malloc(n) + #define PyMem_RawRealloc(p, n) PyMem_Realloc(p, n) + #define PyMem_RawFree(p) PyMem_Free(p) +#endif +#if CYTHON_COMPILING_IN_PYSTON + #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co) + #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno) +#else + #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) + #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) +#endif +#if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000 + #define __Pyx_PyThreadState_Current PyThreadState_GET() +#elif PY_VERSION_HEX >= 0x03060000 + #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() +#elif PY_VERSION_HEX >= 0x03000000 + #define __Pyx_PyThreadState_Current PyThreadState_GET() +#else + #define __Pyx_PyThreadState_Current _PyThreadState_Current +#endif +#if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) +#include "pythread.h" +#define Py_tss_NEEDS_INIT 0 +typedef int Py_tss_t; +static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) { + *key = PyThread_create_key(); + return 0; // PyThread_create_key reports success always +} +static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) { + Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t)); + *key = Py_tss_NEEDS_INIT; + return key; +} +static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) { + PyObject_Free(key); +} +static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) { + return *key != Py_tss_NEEDS_INIT; +} +static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) { + PyThread_delete_key(*key); + *key = Py_tss_NEEDS_INIT; +} +static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) { + return PyThread_set_key_value(*key, value); +} +static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { + return PyThread_get_key_value(*key); +} +#endif // TSS (Thread Specific Storage) API +#if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized) +#define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) +#else +#define __Pyx_PyDict_NewPresized(n) PyDict_New() +#endif +#if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION + #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) +#else + #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS +#define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) +#else +#define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name) +#endif +#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) + #define CYTHON_PEP393_ENABLED 1 + #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ + 0 : _PyUnicode_Ready((PyObject *)(op))) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) + #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) + #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) + #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) + #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) + #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch) + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) +#else + #define CYTHON_PEP393_ENABLED 0 + #define PyUnicode_1BYTE_KIND 1 + #define PyUnicode_2BYTE_KIND 2 + #define PyUnicode_4BYTE_KIND 4 + #define __Pyx_PyUnicode_READY(op) (0) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) + #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111) + #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) + #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) + #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) + #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch) + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) +#endif +#if CYTHON_COMPILING_IN_PYPY + #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) +#else + #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ + PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains) + #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check) + #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format) + #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) +#endif +#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) +#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) +#else + #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) +#endif +#if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) + #define PyObject_ASCII(o) PyObject_Repr(o) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBaseString_Type PyUnicode_Type + #define PyStringObject PyUnicodeObject + #define PyString_Type PyUnicode_Type + #define PyString_Check PyUnicode_Check + #define PyString_CheckExact PyUnicode_CheckExact + #define PyObject_Unicode PyObject_Str +#endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) + #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) +#else + #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) + #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) +#endif +#ifndef PySet_CheckExact + #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) +#endif +#if CYTHON_ASSUME_SAFE_MACROS + #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) +#else + #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyIntObject PyLongObject + #define PyInt_Type PyLong_Type + #define PyInt_Check(op) PyLong_Check(op) + #define PyInt_CheckExact(op) PyLong_CheckExact(op) + #define PyInt_FromString PyLong_FromString + #define PyInt_FromUnicode PyLong_FromUnicode + #define PyInt_FromLong PyLong_FromLong + #define PyInt_FromSize_t PyLong_FromSize_t + #define PyInt_FromSsize_t PyLong_FromSsize_t + #define PyInt_AsLong PyLong_AsLong + #define PyInt_AS_LONG PyLong_AS_LONG + #define PyInt_AsSsize_t PyLong_AsSsize_t + #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask + #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask + #define PyNumber_Int PyNumber_Long +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBoolObject PyLongObject +#endif +#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY + #ifndef PyUnicode_InternFromString + #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) + #endif +#endif +#if PY_VERSION_HEX < 0x030200A4 + typedef long Py_hash_t; + #define __Pyx_PyInt_FromHash_t PyInt_FromLong + #define __Pyx_PyInt_AsHash_t PyInt_AsLong +#else + #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t + #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t +#endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : (Py_INCREF(func), func)) +#else + #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) +#endif +#if CYTHON_USE_ASYNC_SLOTS + #if PY_VERSION_HEX >= 0x030500B1 + #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods + #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) + #else + #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) + #endif +#else + #define __Pyx_PyType_AsAsync(obj) NULL +#endif +#ifndef __Pyx_PyAsyncMethodsStruct + typedef struct { + unaryfunc am_await; + unaryfunc am_aiter; + unaryfunc am_anext; + } __Pyx_PyAsyncMethodsStruct; +#endif + +#if defined(WIN32) || defined(MS_WINDOWS) + #define _USE_MATH_DEFINES +#endif +#include +#ifdef NAN +#define __PYX_NAN() ((float) NAN) +#else +static CYTHON_INLINE float __PYX_NAN() { + float value; + memset(&value, 0xFF, sizeof(value)); + return value; +} +#endif +#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) +#define __Pyx_truncl trunc +#else +#define __Pyx_truncl truncl +#endif + + +#define __PYX_ERR(f_index, lineno, Ln_error) \ +{ \ + __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \ +} + +#ifndef __PYX_EXTERN_C + #ifdef __cplusplus + #define __PYX_EXTERN_C extern "C" + #else + #define __PYX_EXTERN_C extern + #endif +#endif + +#define __PYX_HAVE__gevent__libev__corecext +#define __PYX_HAVE_API__gevent__libev__corecext +/* Early includes */ +#include "libev_vfd.h" +#include "libev.h" +#include +#include +#include +#include "callbacks.h" +#include "stathelper.c" +#include "pythread.h" +#ifdef _OPENMP +#include +#endif /* _OPENMP */ + +#if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) +#define CYTHON_WITHOUT_ASSERTIONS +#endif + +typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; + const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; + +#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 +#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0 +#define __PYX_DEFAULT_STRING_ENCODING "" +#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString +#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#define __Pyx_uchar_cast(c) ((unsigned char)c) +#define __Pyx_long_cast(x) ((long)x) +#define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ + (sizeof(type) < sizeof(Py_ssize_t)) ||\ + (sizeof(type) > sizeof(Py_ssize_t) &&\ + likely(v < (type)PY_SSIZE_T_MAX ||\ + v == (type)PY_SSIZE_T_MAX) &&\ + (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ + v == (type)PY_SSIZE_T_MIN))) ||\ + (sizeof(type) == sizeof(Py_ssize_t) &&\ + (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ + v == (type)PY_SSIZE_T_MAX))) ) +static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) { + return (size_t) i < (size_t) limit; +} +#if defined (__cplusplus) && __cplusplus >= 201103L + #include + #define __Pyx_sst_abs(value) std::abs(value) +#elif SIZEOF_INT >= SIZEOF_SIZE_T + #define __Pyx_sst_abs(value) abs(value) +#elif SIZEOF_LONG >= SIZEOF_SIZE_T + #define __Pyx_sst_abs(value) labs(value) +#elif defined (_MSC_VER) + #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) +#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define __Pyx_sst_abs(value) llabs(value) +#elif defined (__GNUC__) + #define __Pyx_sst_abs(value) __builtin_llabs(value) +#else + #define __Pyx_sst_abs(value) ((value<0) ? -value : value) +#endif +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*); +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); +#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) +#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) +#define __Pyx_PyBytes_FromString PyBytes_FromString +#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); +#if PY_MAJOR_VERSION < 3 + #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#else + #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize +#endif +#define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) +#define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) +#define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) +#define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) +#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) +static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) { + const Py_UNICODE *u_end = u; + while (*u_end++) ; + return (size_t)(u_end - u - 1); +} +#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) +#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode +#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode +#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) +#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) +static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); +static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*); +static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); +#define __Pyx_PySequence_Tuple(obj)\ + (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); +#if CYTHON_ASSUME_SAFE_MACROS +#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) +#else +#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) +#endif +#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) +#if PY_MAJOR_VERSION >= 3 +#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) +#else +#define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) +#endif +#define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x)) +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII +static int __Pyx_sys_getdefaultencoding_not_ascii; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + PyObject* ascii_chars_u = NULL; + PyObject* ascii_chars_b = NULL; + const char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + if (strcmp(default_encoding_c, "ascii") == 0) { + __Pyx_sys_getdefaultencoding_not_ascii = 0; + } else { + char ascii_chars[128]; + int c; + for (c = 0; c < 128; c++) { + ascii_chars[c] = c; + } + __Pyx_sys_getdefaultencoding_not_ascii = 1; + ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); + if (!ascii_chars_u) goto bad; + ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); + if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { + PyErr_Format( + PyExc_ValueError, + "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", + default_encoding_c); + goto bad; + } + Py_DECREF(ascii_chars_u); + Py_DECREF(ascii_chars_b); + } + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + Py_XDECREF(ascii_chars_u); + Py_XDECREF(ascii_chars_b); + return -1; +} +#endif +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) +#else +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +static char* __PYX_DEFAULT_STRING_ENCODING; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1); + if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; + strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + return -1; +} +#endif +#endif + + +/* Test for GCC > 2.95 */ +#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) + #define likely(x) __builtin_expect(!!(x), 1) + #define unlikely(x) __builtin_expect(!!(x), 0) +#else /* !__GNUC__ or GCC < 2.95 */ + #define likely(x) (x) + #define unlikely(x) (x) +#endif /* __GNUC__ */ +static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } + +static PyObject *__pyx_m = NULL; +static PyObject *__pyx_d; +static PyObject *__pyx_b; +static PyObject *__pyx_cython_runtime = NULL; +static PyObject *__pyx_empty_tuple; +static PyObject *__pyx_empty_bytes; +static PyObject *__pyx_empty_unicode; +static int __pyx_lineno; +static int __pyx_clineno = 0; +static const char * __pyx_cfilenm= __FILE__; +static const char *__pyx_filename; + + +static const char *__pyx_f[] = { + "src\\gevent\\libev\\corecext.pyx", + "type.pxd", + "bool.pxd", + "complex.pxd", +}; +/* NoFastGil.proto */ +#define __Pyx_PyGILState_Ensure PyGILState_Ensure +#define __Pyx_PyGILState_Release PyGILState_Release +#define __Pyx_FastGIL_Remember() +#define __Pyx_FastGIL_Forget() +#define __Pyx_FastGilFuncInit() + +/* ForceInitThreads.proto */ +#ifndef __PYX_FORCE_INIT_THREADS + #define __PYX_FORCE_INIT_THREADS 0 +#endif + + +/*--- Type declarations ---*/ +struct __pyx_obj_6gevent_5libev_8corecext__EVENTSType; +struct PyGeventCallbackObject; +struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO; +struct PyGeventLoopObject; +struct PyGeventWatcherObject; +struct PyGeventIOObject; +struct PyGeventTimerObject; +struct PyGeventSignalObject; +struct PyGeventIdleObject; +struct PyGeventPrepareObject; +struct PyGeventCheckObject; +struct PyGeventForkObject; +struct PyGeventAsyncObject; +struct PyGeventChildObject; +struct PyGeventStatObject; +struct __pyx_obj_6gevent_5libev_8corecext___pyx_scope_struct__genexpr; +struct __pyx_t_6gevent_5libev_8corecext_start_and_stop; + +typedef void (*__pyx_t_6gevent_5libev_8corecext_start_stop_func)(struct ev_loop *, void *); + +struct __pyx_t_6gevent_5libev_8corecext_start_and_stop { + __pyx_t_6gevent_5libev_8corecext_start_stop_func start; + __pyx_t_6gevent_5libev_8corecext_start_stop_func stop; +}; + +struct __pyx_obj_6gevent_5libev_8corecext__EVENTSType { + PyObject_HEAD +}; + + +struct PyGeventCallbackObject { + PyObject_HEAD + PyObject *callback; + PyObject *args; + struct PyGeventCallbackObject *next; +}; + +__PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyGeventCallback_Type; + +struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO { + PyObject_HEAD + struct __pyx_vtabstruct_6gevent_5libev_8corecext_CallbackFIFO *__pyx_vtab; + struct PyGeventCallbackObject *head; + struct PyGeventCallbackObject *tail; +}; + + +struct PyGeventLoopObject { + PyObject_HEAD + struct __pyx_vtabstruct_6gevent_5libev_8corecext_loop *__pyx_vtab; + struct ev_prepare _prepare; + struct ev_timer _timer0; + struct ev_timer _periodic_signal_checker; + PyObject *error_handler; + struct ev_loop *_ptr; + struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *_callbacks; + int starting_timer_may_update_loop_time; + int _default; + double approx_timer_resolution; +}; + +__PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyGeventLoop_Type; + +struct PyGeventWatcherObject { + PyObject_HEAD + struct PyGeventLoopObject *loop; + PyObject *_callback; + PyObject *args; + struct ev_watcher *__pyx___watcher; + struct __pyx_t_6gevent_5libev_8corecext_start_and_stop *__pyx___ss; + unsigned int _flags; +}; + +__PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyGeventWatcher_Type; + +struct PyGeventIOObject { + struct PyGeventWatcherObject __pyx_base; + struct ev_io _watcher; +}; + +__PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyGeventIO_Type; + +struct PyGeventTimerObject { + struct PyGeventWatcherObject __pyx_base; + struct ev_timer _watcher; +}; + +__PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyGeventTimer_Type; + +struct PyGeventSignalObject { + struct PyGeventWatcherObject __pyx_base; + struct ev_signal _watcher; +}; + +__PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyGeventSignal_Type; + +struct PyGeventIdleObject { + struct PyGeventWatcherObject __pyx_base; + struct ev_idle _watcher; +}; + +__PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyGeventIdle_Type; + +struct PyGeventPrepareObject { + struct PyGeventWatcherObject __pyx_base; + struct ev_prepare _watcher; +}; + +__PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyGeventPrepare_Type; + +struct PyGeventCheckObject { + struct PyGeventWatcherObject __pyx_base; + struct ev_check _watcher; +}; + +__PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyGeventCheck_Type; + +struct PyGeventForkObject { + struct PyGeventWatcherObject __pyx_base; + struct ev_fork _watcher; +}; + +__PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyGeventFork_Type; + +struct PyGeventAsyncObject { + struct PyGeventWatcherObject __pyx_base; + struct ev_async _watcher; +}; + +__PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyGeventAsync_Type; + +struct PyGeventChildObject { + struct PyGeventWatcherObject __pyx_base; + struct ev_child _watcher; +}; + +__PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyGeventChild_Type; + +struct PyGeventStatObject { + struct PyGeventWatcherObject __pyx_base; + struct ev_stat _watcher; + PyObject *path; + PyObject *_paths; +}; + +__PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyGeventStat_Type; + +struct __pyx_obj_6gevent_5libev_8corecext___pyx_scope_struct__genexpr { + PyObject_HEAD + PyObject *__pyx_v_flag; + PyObject *__pyx_v_string; +}; + + + + +struct __pyx_vtabstruct_6gevent_5libev_8corecext_CallbackFIFO { + struct PyGeventCallbackObject *(*popleft)(struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *); + PyObject *(*append)(struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *, struct PyGeventCallbackObject *); + int (*has_callbacks)(struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *); +}; +static struct __pyx_vtabstruct_6gevent_5libev_8corecext_CallbackFIFO *__pyx_vtabptr_6gevent_5libev_8corecext_CallbackFIFO; +static CYTHON_INLINE struct PyGeventCallbackObject *__pyx_f_6gevent_5libev_8corecext_12CallbackFIFO_popleft(struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *); +static CYTHON_INLINE PyObject *__pyx_f_6gevent_5libev_8corecext_12CallbackFIFO_append(struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *, struct PyGeventCallbackObject *); +static int __pyx_f_6gevent_5libev_8corecext_12CallbackFIFO_has_callbacks(struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *); + +__PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyGeventLoop_Type; + + +struct __pyx_vtabstruct_6gevent_5libev_8corecext_loop { + PyObject *(*_run_callbacks)(struct PyGeventLoopObject *); + PyObject *(*_stop_watchers)(struct PyGeventLoopObject *, struct ev_loop *); + PyObject *(*handle_error)(struct PyGeventLoopObject *, PyObject *, PyObject *, PyObject *, PyObject *, int __pyx_skip_dispatch); + PyObject *(*_default_handle_error)(struct PyGeventLoopObject *, PyObject *, PyObject *, PyObject *, PyObject *, int __pyx_skip_dispatch); + ev_tstamp (*now)(struct PyGeventLoopObject *, int __pyx_skip_dispatch); + void (*update_now)(struct PyGeventLoopObject *, int __pyx_skip_dispatch); +}; +static struct __pyx_vtabstruct_6gevent_5libev_8corecext_loop *__pyx_vtabptr_6gevent_5libev_8corecext_loop; + +/* --- Runtime support code (head) --- */ +/* Refnanny.proto */ +#ifndef CYTHON_REFNANNY + #define CYTHON_REFNANNY 0 +#endif +#if CYTHON_REFNANNY + typedef struct { + void (*INCREF)(void*, PyObject*, int); + void (*DECREF)(void*, PyObject*, int); + void (*GOTREF)(void*, PyObject*, int); + void (*GIVEREF)(void*, PyObject*, int); + void* (*SetupContext)(const char*, int, const char*); + void (*FinishContext)(void**); + } __Pyx_RefNannyAPIStruct; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); + #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; +#ifdef WITH_THREAD + #define __Pyx_RefNannySetupContext(name, acquire_gil)\ + if (acquire_gil) {\ + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ + PyGILState_Release(__pyx_gilstate_save);\ + } else {\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ + } +#else + #define __Pyx_RefNannySetupContext(name, acquire_gil)\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) +#endif + #define __Pyx_RefNannyFinishContext()\ + __Pyx_RefNanny->FinishContext(&__pyx_refnanny) + #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0) + #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) + #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) + #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) +#else + #define __Pyx_RefNannyDeclarations + #define __Pyx_RefNannySetupContext(name, acquire_gil) + #define __Pyx_RefNannyFinishContext() + #define __Pyx_INCREF(r) Py_INCREF(r) + #define __Pyx_DECREF(r) Py_DECREF(r) + #define __Pyx_GOTREF(r) + #define __Pyx_GIVEREF(r) + #define __Pyx_XINCREF(r) Py_XINCREF(r) + #define __Pyx_XDECREF(r) Py_XDECREF(r) + #define __Pyx_XGOTREF(r) + #define __Pyx_XGIVEREF(r) +#endif +#define __Pyx_XDECREF_SET(r, v) do {\ + PyObject *tmp = (PyObject *) r;\ + r = v; __Pyx_XDECREF(tmp);\ + } while (0) +#define __Pyx_DECREF_SET(r, v) do {\ + PyObject *tmp = (PyObject *) r;\ + r = v; __Pyx_DECREF(tmp);\ + } while (0) +#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) +#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) + +/* PyObjectGetAttrStr.proto */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); +#else +#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) +#endif + +/* GetBuiltinName.proto */ +static PyObject *__Pyx_GetBuiltinName(PyObject *name); + +/* GetModuleGlobalName.proto */ +#if CYTHON_USE_DICT_VERSIONS +#define __Pyx_GetModuleGlobalName(var, name) {\ + static PY_UINT64_T __pyx_dict_version = 0;\ + static PyObject *__pyx_dict_cached_value = NULL;\ + (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\ + (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\ + __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ +} +#define __Pyx_GetModuleGlobalNameUncached(var, name) {\ + PY_UINT64_T __pyx_dict_version;\ + PyObject *__pyx_dict_cached_value;\ + (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ +} +static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value); +#else +#define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name) +#define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name) +static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name); +#endif + +/* RaiseTooManyValuesToUnpack.proto */ +static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); + +/* RaiseNeedMoreValuesToUnpack.proto */ +static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); + +/* IterFinish.proto */ +static CYTHON_INLINE int __Pyx_IterFinish(void); + +/* UnpackItemEndCheck.proto */ +static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); + +/* ListAppend.proto */ +#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS +static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) { + PyListObject* L = (PyListObject*) list; + Py_ssize_t len = Py_SIZE(list); + if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) { + Py_INCREF(x); + PyList_SET_ITEM(list, len, x); + Py_SIZE(list) = len+1; + return 0; + } + return PyList_Append(list, x); +} +#else +#define __Pyx_PyList_Append(L,x) PyList_Append(L,x) +#endif + +/* PyCFunctionFastCall.proto */ +#if CYTHON_FAST_PYCCALL +static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs); +#else +#define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL) +#endif + +/* PyFunctionFastCall.proto */ +#if CYTHON_FAST_PYCALL +#define __Pyx_PyFunction_FastCall(func, args, nargs)\ + __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) +#if 1 || PY_VERSION_HEX < 0x030600B1 +static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs); +#else +#define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs) +#endif +#define __Pyx_BUILD_ASSERT_EXPR(cond)\ + (sizeof(char [1 - 2*!(cond)]) - 1) +#ifndef Py_MEMBER_SIZE +#define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member) +#endif + static size_t __pyx_pyframe_localsplus_offset = 0; + #include "frameobject.h" + #define __Pxy_PyFrame_Initialize_Offsets()\ + ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\ + (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus))) + #define __Pyx_PyFrame_GetLocalsplus(frame)\ + (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset)) +#endif + +/* PyObjectCall.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); +#else +#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) +#endif + +/* PyObjectCall2Args.proto */ +static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2); + +/* PyObjectCallMethO.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); +#endif + +/* PyObjectCallOneArg.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); + +/* PyObjectCallNoArg.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); +#else +#define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL) +#endif + +/* GetItemInt.proto */ +#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ + __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\ + (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\ + __Pyx_GetItemInt_Generic(o, to_py_func(i)))) +#define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ + __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ + (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL)) +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, + int wraparound, int boundscheck); +#define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ + __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ + (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL)) +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, + int wraparound, int boundscheck); +static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j); +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, + int is_list, int wraparound, int boundscheck); + +/* ObjectGetItem.proto */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key); +#else +#define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key) +#endif + +/* GetTopmostException.proto */ +#if CYTHON_USE_EXC_INFO_STACK +static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate); +#endif + +/* PyThreadStateGet.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; +#define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; +#define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type +#else +#define __Pyx_PyThreadState_declare +#define __Pyx_PyThreadState_assign +#define __Pyx_PyErr_Occurred() PyErr_Occurred() +#endif + +/* SaveResetException.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); +#else +#define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb) +#define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb) +#endif + +/* PyErrExceptionMatches.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) +static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); +#else +#define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) +#endif + +/* GetException.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb) +static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#else +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); +#endif + +/* StringJoin.proto */ +#if PY_MAJOR_VERSION < 3 +#define __Pyx_PyString_Join __Pyx_PyBytes_Join +#define __Pyx_PyBaseString_Join(s, v) (PyUnicode_CheckExact(s) ? PyUnicode_Join(s, v) : __Pyx_PyBytes_Join(s, v)) +#else +#define __Pyx_PyString_Join PyUnicode_Join +#define __Pyx_PyBaseString_Join PyUnicode_Join +#endif +#if CYTHON_COMPILING_IN_CPYTHON + #if PY_MAJOR_VERSION < 3 + #define __Pyx_PyBytes_Join _PyString_Join + #else + #define __Pyx_PyBytes_Join _PyBytes_Join + #endif +#else +static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values); +#endif + +/* PyErrFetchRestore.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) +#define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) +#define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) +#define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) +#define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); +static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) +#else +#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) +#endif +#else +#define __Pyx_PyErr_Clear() PyErr_Clear() +#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) +#define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) +#define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb) +#define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) +#endif + +/* RaiseException.proto */ +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); + +/* SwapException.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#else +static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb); +#endif + +/* ListCompAppend.proto */ +#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS +static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) { + PyListObject* L = (PyListObject*) list; + Py_ssize_t len = Py_SIZE(list); + if (likely(L->allocated > len)) { + Py_INCREF(x); + PyList_SET_ITEM(list, len, x); + Py_SIZE(list) = len+1; + return 0; + } + return PyList_Append(list, x); +} +#else +#define __Pyx_ListComp_Append(L,x) PyList_Append(L,x) +#endif + +/* RaiseArgTupleInvalid.proto */ +static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, + Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); + +/* RaiseDoubleKeywords.proto */ +static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); + +/* ParseKeywords.proto */ +static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\ + PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\ + const char* function_name); + +/* KeywordStringCheck.proto */ +static int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* function_name, int kw_allowed); + +/* WriteUnraisableException.proto */ +static void __Pyx_WriteUnraisable(const char *name, int clineno, + int lineno, const char *filename, + int full_traceback, int nogil); + +/* IncludeStringH.proto */ +#include + +/* BytesEquals.proto */ +static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); + +/* UnicodeEquals.proto */ +static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); + +/* StrEquals.proto */ +#if PY_MAJOR_VERSION >= 3 +#define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals +#else +#define __Pyx_PyString_Equals __Pyx_PyBytes_Equals +#endif + +/* GetAttr.proto */ +static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *); + +/* GetAttr3.proto */ +static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *); + +/* ArgTypeTest.proto */ +#define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\ + ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\ + __Pyx__ArgTypeTest(obj, type, name, exact)) +static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact); + +/* ExtTypeTest.proto */ +static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); + +/* CallableCheck.proto */ +#if CYTHON_USE_TYPE_SLOTS && PY_MAJOR_VERSION >= 3 +#define __Pyx_PyCallable_Check(obj) ((obj)->ob_type->tp_call != NULL) +#else +#define __Pyx_PyCallable_Check(obj) PyCallable_Check(obj) +#endif + +/* PyObjectSetAttrStr.proto */ +#if CYTHON_USE_TYPE_SLOTS +#define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o, n, NULL) +static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value); +#else +#define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n) +#define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v) +#endif + +/* PyObject_GenericGetAttrNoDict.proto */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name); +#else +#define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr +#endif + +/* PyObject_GenericGetAttr.proto */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name); +#else +#define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr +#endif + +/* SetVTable.proto */ +static int __Pyx_SetVtable(PyObject *dict, void *vtable); + +/* TypeImport.proto */ +#ifndef __PYX_HAVE_RT_ImportType_proto +#define __PYX_HAVE_RT_ImportType_proto +enum __Pyx_ImportType_CheckSize { + __Pyx_ImportType_CheckSize_Error = 0, + __Pyx_ImportType_CheckSize_Warn = 1, + __Pyx_ImportType_CheckSize_Ignore = 2 +}; +static PyTypeObject *__Pyx_ImportType(PyObject* module, const char *module_name, const char *class_name, size_t size, enum __Pyx_ImportType_CheckSize check_size); +#endif + +/* GetNameInClass.proto */ +#define __Pyx_GetNameInClass(var, nmspace, name) (var) = __Pyx__GetNameInClass(nmspace, name) +static PyObject *__Pyx__GetNameInClass(PyObject *nmspace, PyObject *name); + +/* Import.proto */ +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); + +/* ImportFrom.proto */ +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); + +/* CLineInTraceback.proto */ +#ifdef CYTHON_CLINE_IN_TRACEBACK +#define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) +#else +static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line); +#endif + +/* CodeObjectCache.proto */ +typedef struct { + PyCodeObject* code_object; + int code_line; +} __Pyx_CodeObjectCacheEntry; +struct __Pyx_CodeObjectCache { + int count; + int max_count; + __Pyx_CodeObjectCacheEntry* entries; +}; +static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); +static PyCodeObject *__pyx_find_code_object(int code_line); +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); + +/* AddTraceback.proto */ +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename); + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_int(unsigned int value); + +/* CIntFromPy.proto */ +static CYTHON_INLINE unsigned int __Pyx_PyInt_As_unsigned_int(PyObject *); + +/* CIntFromPy.proto */ +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); + +/* CIntFromPy.proto */ +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); + +/* FastTypeChecks.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) +static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b); +static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type); +static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2); +#else +#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) +#define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) +#define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) +#endif +#define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) + +/* FetchCommonType.proto */ +static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); + +/* PyObjectGetMethod.proto */ +static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method); + +/* PyObjectCallMethod1.proto */ +static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg); + +/* CoroutineBase.proto */ +typedef PyObject *(*__pyx_coroutine_body_t)(PyObject *, PyThreadState *, PyObject *); +#if CYTHON_USE_EXC_INFO_STACK +#define __Pyx_ExcInfoStruct _PyErr_StackItem +#else +typedef struct { + PyObject *exc_type; + PyObject *exc_value; + PyObject *exc_traceback; +} __Pyx_ExcInfoStruct; +#endif +typedef struct { + PyObject_HEAD + __pyx_coroutine_body_t body; + PyObject *closure; + __Pyx_ExcInfoStruct gi_exc_state; + PyObject *gi_weakreflist; + PyObject *classobj; + PyObject *yieldfrom; + PyObject *gi_name; + PyObject *gi_qualname; + PyObject *gi_modulename; + PyObject *gi_code; + int resume_label; + char is_running; +} __pyx_CoroutineObject; +static __pyx_CoroutineObject *__Pyx__Coroutine_New( + PyTypeObject *type, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure, + PyObject *name, PyObject *qualname, PyObject *module_name); +static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit( + __pyx_CoroutineObject *gen, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure, + PyObject *name, PyObject *qualname, PyObject *module_name); +static CYTHON_INLINE void __Pyx_Coroutine_ExceptionClear(__Pyx_ExcInfoStruct *self); +static int __Pyx_Coroutine_clear(PyObject *self); +static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value); +static PyObject *__Pyx_Coroutine_Close(PyObject *self); +static PyObject *__Pyx_Coroutine_Throw(PyObject *gen, PyObject *args); +#if CYTHON_USE_EXC_INFO_STACK +#define __Pyx_Coroutine_SwapException(self) +#define __Pyx_Coroutine_ResetAndClearException(self) __Pyx_Coroutine_ExceptionClear(&(self)->gi_exc_state) +#else +#define __Pyx_Coroutine_SwapException(self) {\ + __Pyx_ExceptionSwap(&(self)->gi_exc_state.exc_type, &(self)->gi_exc_state.exc_value, &(self)->gi_exc_state.exc_traceback);\ + __Pyx_Coroutine_ResetFrameBackpointer(&(self)->gi_exc_state);\ + } +#define __Pyx_Coroutine_ResetAndClearException(self) {\ + __Pyx_ExceptionReset((self)->gi_exc_state.exc_type, (self)->gi_exc_state.exc_value, (self)->gi_exc_state.exc_traceback);\ + (self)->gi_exc_state.exc_type = (self)->gi_exc_state.exc_value = (self)->gi_exc_state.exc_traceback = NULL;\ + } +#endif +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyGen_FetchStopIterationValue(pvalue)\ + __Pyx_PyGen__FetchStopIterationValue(__pyx_tstate, pvalue) +#else +#define __Pyx_PyGen_FetchStopIterationValue(pvalue)\ + __Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, pvalue) +#endif +static int __Pyx_PyGen__FetchStopIterationValue(PyThreadState *tstate, PyObject **pvalue); +static CYTHON_INLINE void __Pyx_Coroutine_ResetFrameBackpointer(__Pyx_ExcInfoStruct *exc_state); + +/* PatchModuleWithCoroutine.proto */ +static PyObject* __Pyx_Coroutine_patch_module(PyObject* module, const char* py_code); + +/* PatchGeneratorABC.proto */ +static int __Pyx_patch_abc(void); + +/* Generator.proto */ +#define __Pyx_Generator_USED +static PyTypeObject *__pyx_GeneratorType = 0; +#define __Pyx_Generator_CheckExact(obj) (Py_TYPE(obj) == __pyx_GeneratorType) +#define __Pyx_Generator_New(body, code, closure, name, qualname, module_name)\ + __Pyx__Coroutine_New(__pyx_GeneratorType, body, code, closure, name, qualname, module_name) +static PyObject *__Pyx_Generator_Next(PyObject *self); +static int __pyx_Generator_init(void); + +/* CheckBinaryVersion.proto */ +static int __Pyx_check_binary_version(void); + +/* InitStrings.proto */ +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); + +static CYTHON_INLINE struct PyGeventCallbackObject *__pyx_f_6gevent_5libev_8corecext_12CallbackFIFO_popleft(struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *__pyx_v_self); /* proto*/ +static CYTHON_INLINE PyObject *__pyx_f_6gevent_5libev_8corecext_12CallbackFIFO_append(struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *__pyx_v_self, struct PyGeventCallbackObject *__pyx_v_new_tail); /* proto*/ +static int __pyx_f_6gevent_5libev_8corecext_12CallbackFIFO_has_callbacks(struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *__pyx_v_self); /* proto*/ +static PyObject *__pyx_f_6gevent_5libev_8corecext_4loop__run_callbacks(struct PyGeventLoopObject *__pyx_v_self); /* proto*/ +static PyObject *__pyx_f_6gevent_5libev_8corecext_4loop__stop_watchers(struct PyGeventLoopObject *__pyx_v_self, struct ev_loop *__pyx_v_ptr); /* proto*/ +static PyObject *__pyx_f_6gevent_5libev_8corecext_4loop_handle_error(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_context, PyObject *__pyx_v_type, PyObject *__pyx_v_value, PyObject *__pyx_v_tb, int __pyx_skip_dispatch); /* proto*/ +static PyObject *__pyx_f_6gevent_5libev_8corecext_4loop__default_handle_error(struct PyGeventLoopObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_context, PyObject *__pyx_v_type, PyObject *__pyx_v_value, PyObject *__pyx_v_tb, int __pyx_skip_dispatch); /* proto*/ +static ev_tstamp __pyx_f_6gevent_5libev_8corecext_4loop_now(struct PyGeventLoopObject *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/ +static void __pyx_f_6gevent_5libev_8corecext_4loop_update_now(struct PyGeventLoopObject *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/ + +/* Module declarations from 'cython' */ + +/* Module declarations from 'libev' */ + +/* Module declarations from 'libc.string' */ + +/* Module declarations from 'libc.stdio' */ + +/* Module declarations from '__builtin__' */ + +/* Module declarations from 'cpython.type' */ +static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0; + +/* Module declarations from 'cpython.version' */ + +/* Module declarations from 'cpython.exc' */ + +/* Module declarations from 'cpython.module' */ + +/* Module declarations from 'cpython.mem' */ + +/* Module declarations from 'cpython.tuple' */ + +/* Module declarations from 'cpython.list' */ + +/* Module declarations from 'cpython.sequence' */ + +/* Module declarations from 'cpython.mapping' */ + +/* Module declarations from 'cpython.iterator' */ + +/* Module declarations from 'cpython.number' */ + +/* Module declarations from 'cpython.int' */ + +/* Module declarations from '__builtin__' */ + +/* Module declarations from 'cpython.bool' */ +static PyTypeObject *__pyx_ptype_7cpython_4bool_bool = 0; + +/* Module declarations from 'cpython.long' */ + +/* Module declarations from 'cpython.float' */ + +/* Module declarations from '__builtin__' */ + +/* Module declarations from 'cpython.complex' */ +static PyTypeObject *__pyx_ptype_7cpython_7complex_complex = 0; + +/* Module declarations from 'cpython.string' */ + +/* Module declarations from 'cpython.unicode' */ + +/* Module declarations from 'cpython.dict' */ + +/* Module declarations from 'cpython.instance' */ + +/* Module declarations from 'cpython.function' */ + +/* Module declarations from 'cpython.method' */ + +/* Module declarations from 'cpython.weakref' */ + +/* Module declarations from 'cpython.getargs' */ + +/* Module declarations from 'cpython.pythread' */ + +/* Module declarations from 'cpython.pystate' */ + +/* Module declarations from 'cpython.cobject' */ + +/* Module declarations from 'cpython.oldbuffer' */ + +/* Module declarations from 'cpython.set' */ + +/* Module declarations from 'cpython.buffer' */ + +/* Module declarations from 'cpython.bytes' */ + +/* Module declarations from 'cpython.pycapsule' */ + +/* Module declarations from 'cpython' */ + +/* Module declarations from 'cpython.object' */ + +/* Module declarations from 'cpython.ref' */ + +/* Module declarations from 'libc.errno' */ + +/* Module declarations from 'gevent.libev.corecext' */ +static PyTypeObject *__pyx_ptype_6gevent_5libev_8corecext__EVENTSType = 0; +static PyTypeObject *__pyx_ptype_6gevent_5libev_8corecext_callback = 0; +static PyTypeObject *__pyx_ptype_6gevent_5libev_8corecext_CallbackFIFO = 0; +static PyTypeObject *__pyx_ptype_6gevent_5libev_8corecext_loop = 0; +static PyTypeObject *__pyx_ptype_6gevent_5libev_8corecext_watcher = 0; +static PyTypeObject *__pyx_ptype_6gevent_5libev_8corecext_io = 0; +static PyTypeObject *__pyx_ptype_6gevent_5libev_8corecext_timer = 0; +static PyTypeObject *__pyx_ptype_6gevent_5libev_8corecext_signal = 0; +static PyTypeObject *__pyx_ptype_6gevent_5libev_8corecext_idle = 0; +static PyTypeObject *__pyx_ptype_6gevent_5libev_8corecext_prepare = 0; +static PyTypeObject *__pyx_ptype_6gevent_5libev_8corecext_check = 0; +static PyTypeObject *__pyx_ptype_6gevent_5libev_8corecext_fork = 0; +static PyTypeObject *__pyx_ptype_6gevent_5libev_8corecext_async_ = 0; +static PyTypeObject *__pyx_ptype_6gevent_5libev_8corecext_child = 0; +static PyTypeObject *__pyx_ptype_6gevent_5libev_8corecext_stat = 0; +static PyTypeObject *__pyx_ptype_6gevent_5libev_8corecext___pyx_scope_struct__genexpr = 0; +static PyObject *__pyx_v_6gevent_5libev_8corecext_integer_types = 0; +__PYX_EXTERN_C DL_EXPORT(PyObject) *GEVENT_CORE_EVENTS; +static struct __pyx_t_6gevent_5libev_8corecext_start_and_stop __pyx_v_6gevent_5libev_8corecext_io_ss; +static struct __pyx_t_6gevent_5libev_8corecext_start_and_stop __pyx_v_6gevent_5libev_8corecext_timer_ss; +static struct __pyx_t_6gevent_5libev_8corecext_start_and_stop __pyx_v_6gevent_5libev_8corecext_signal_ss; +static struct __pyx_t_6gevent_5libev_8corecext_start_and_stop __pyx_v_6gevent_5libev_8corecext_idle_ss; +static struct __pyx_t_6gevent_5libev_8corecext_start_and_stop __pyx_v_6gevent_5libev_8corecext_prepare_ss; +static struct __pyx_t_6gevent_5libev_8corecext_start_and_stop __pyx_v_6gevent_5libev_8corecext_check_ss; +static struct __pyx_t_6gevent_5libev_8corecext_start_and_stop __pyx_v_6gevent_5libev_8corecext_fork_ss; +static struct __pyx_t_6gevent_5libev_8corecext_start_and_stop __pyx_v_6gevent_5libev_8corecext_async_ss; +static struct __pyx_t_6gevent_5libev_8corecext_start_and_stop __pyx_v_6gevent_5libev_8corecext_child_ss; +static struct __pyx_t_6gevent_5libev_8corecext_start_and_stop __pyx_v_6gevent_5libev_8corecext_stat_ss; +__PYX_EXTERN_C DL_EXPORT(PyObject) *_empty_tuple; +static PyObject *__pyx_f_6gevent_5libev_8corecext__flags_to_list(unsigned int, int __pyx_skip_dispatch); /*proto*/ +static unsigned int __pyx_f_6gevent_5libev_8corecext__flags_to_int(PyObject *, int __pyx_skip_dispatch); /*proto*/ +static PyObject *__pyx_f_6gevent_5libev_8corecext__str_hex(PyObject *); /*proto*/ +static PyObject *__pyx_f_6gevent_5libev_8corecext__check_flags(unsigned int, int __pyx_skip_dispatch); /*proto*/ +static PyObject *__pyx_f_6gevent_5libev_8corecext__events_to_str(int, int __pyx_skip_dispatch); /*proto*/ +static int __pyx_f_6gevent_5libev_8corecext__check_loop(struct PyGeventLoopObject *); /*proto*/ +static void __pyx_f_6gevent_5libev_8corecext__python_incref(struct PyGeventWatcherObject *); /*proto*/ +static void __pyx_f_6gevent_5libev_8corecext__python_decref(struct PyGeventWatcherObject *); /*proto*/ +static void __pyx_f_6gevent_5libev_8corecext__libev_ref(struct PyGeventWatcherObject *); /*proto*/ +static void __pyx_f_6gevent_5libev_8corecext__libev_unref(struct PyGeventWatcherObject *); /*proto*/ +static struct __pyx_t_6gevent_5libev_8corecext_start_and_stop __pyx_f_6gevent_5libev_8corecext_make_ss(void *, void *); /*proto*/ +static int __pyx_f_6gevent_5libev_8corecext__watcher_start(struct PyGeventWatcherObject *, PyObject *, PyObject *); /*proto*/ +static void __pyx_f_6gevent_5libev_8corecext__syserr_cb(char *); /*proto*/ +static PyObject *__pyx_f_6gevent_5libev_8corecext_set_syserr_cb(PyObject *, int __pyx_skip_dispatch); /*proto*/ +__PYX_EXTERN_C void gevent_handle_error(struct PyGeventLoopObject *, PyObject *); /*proto*/ +__PYX_EXTERN_C PyObject *gevent_loop_run_callbacks(struct PyGeventLoopObject *); /*proto*/ +#define __Pyx_MODULE_NAME "gevent.libev.corecext" +extern int __pyx_module_is_main_gevent__libev__corecext; +int __pyx_module_is_main_gevent__libev__corecext = 0; + +/* Implementation of 'gevent.libev.corecext' */ +static PyObject *__pyx_builtin___import__; +static PyObject *__pyx_builtin_ImportError; +static PyObject *__pyx_builtin_KeyError; +static PyObject *__pyx_builtin_ValueError; +static PyObject *__pyx_builtin_hex; +static PyObject *__pyx_builtin_id; +static PyObject *__pyx_builtin_SystemError; +static PyObject *__pyx_builtin_AttributeError; +static PyObject *__pyx_builtin_TypeError; +static const char __pyx_k_[] = ","; +static const char __pyx_k_t[] = "t"; +static const char __pyx_k_v[] = "v"; +static const char __pyx_k__2[] = ", "; +static const char __pyx_k__3[] = "|"; +static const char __pyx_k__5[] = "<...>"; +static const char __pyx_k__6[] = ">"; +static const char __pyx_k__7[] = ""; +static const char __pyx_k__8[] = ": "; +static const char __pyx_k_fd[] = "fd"; +static const char __pyx_k_id[] = "id"; +static const char __pyx_k_io[] = "io"; +static const char __pyx_k_os[] = "os"; +static const char __pyx_k_tb[] = "tb"; +static const char __pyx_k_all[] = "__all__"; +static const char __pyx_k_hex[] = "hex"; +static const char __pyx_k_how[] = "how"; +static const char __pyx_k_now[] = "now"; +static const char __pyx_k_pid[] = "pid"; +static const char __pyx_k_ptr[] = "ptr"; +static const char __pyx_k_ref[] = "ref"; +static const char __pyx_k_sys[] = "sys"; +static const char __pyx_k_FORK[] = "FORK"; +static const char __pyx_k_IDLE[] = "IDLE"; +static const char __pyx_k_NONE[] = "NONE"; +static const char __pyx_k_NSIG[] = "NSIG"; +static const char __pyx_k_READ[] = "READ"; +static const char __pyx_k_STAT[] = "STAT"; +static const char __pyx_k_args[] = "args"; +static const char __pyx_k_fork[] = "fork"; +static const char __pyx_k_func[] = "func"; +static const char __pyx_k_idle[] = "idle"; +static const char __pyx_k_init[] = "__init__"; +static const char __pyx_k_join[] = "join"; +static const char __pyx_k_keys[] = "keys"; +static const char __pyx_k_loop[] = "loop"; +static const char __pyx_k_main[] = "__main__"; +static const char __pyx_k_name[] = "__name__"; +static const char __pyx_k_once[] = "once"; +static const char __pyx_k_path[] = "path"; +static const char __pyx_k_poll[] = "poll"; +static const char __pyx_k_port[] = "port"; +static const char __pyx_k_send[] = "send"; +static const char __pyx_k_stat[] = "stat"; +static const char __pyx_k_stop[] = "stop"; +static const char __pyx_k_test[] = "__test__"; +static const char __pyx_k_time[] = "time"; +static const char __pyx_k_type[] = "type"; +static const char __pyx_k_ASYNC[] = "ASYNC"; +static const char __pyx_k_CHECK[] = "CHECK"; +static const char __pyx_k_CHILD[] = "CHILD"; +static const char __pyx_k_EMBED[] = "EMBED"; +static const char __pyx_k_ERROR[] = "ERROR"; +static const char __pyx_k_ILoop[] = "ILoop"; +static const char __pyx_k_TIMER[] = "TIMER"; +static const char __pyx_k_UNDEF[] = "UNDEF"; +static const char __pyx_k_WRITE[] = "WRITE"; +static const char __pyx_k_after[] = "after"; +static const char __pyx_k_async[] = "async_"; +static const char __pyx_k_check[] = "check"; +static const char __pyx_k_child[] = "child"; +static const char __pyx_k_class[] = "__class__"; +static const char __pyx_k_close[] = "close"; +static const char __pyx_k_epoll[] = "epoll"; +static const char __pyx_k_errno[] = "errno"; +static const char __pyx_k_flags[] = "_flags"; +static const char __pyx_k_level[] = "level"; +static const char __pyx_k_lower[] = "lower"; +static const char __pyx_k_noenv[] = "noenv"; +static const char __pyx_k_ref_2[] = " ref="; +static const char __pyx_k_sigfd[] = "sigfd"; +static const char __pyx_k_split[] = "split"; +static const char __pyx_k_start[] = "start"; +static const char __pyx_k_strip[] = "strip"; +static const char __pyx_k_throw[] = "throw"; +static const char __pyx_k_timer[] = "timer"; +static const char __pyx_k_trace[] = "trace"; +static const char __pyx_k_value[] = "value"; +static const char __pyx_k_win32[] = "win32"; +static const char __pyx_k_CUSTOM[] = "CUSTOM"; +static const char __pyx_k_EVENTS[] = "EVENTS"; +static const char __pyx_k_MAXPRI[] = "MAXPRI"; +static const char __pyx_k_MINPRI[] = "MINPRI"; +static const char __pyx_k_SIGNAL[] = "SIGNAL"; +static const char __pyx_k_active[] = "active"; +static const char __pyx_k_args_r[] = " args=%r"; +static const char __pyx_k_decode[] = "decode"; +static const char __pyx_k_encode[] = "encode"; +static const char __pyx_k_events[] = "_events"; +static const char __pyx_k_fileno[] = "fileno"; +static const char __pyx_k_format[] = "_format"; +static const char __pyx_k_gevent[] = "gevent"; +static const char __pyx_k_import[] = "__import__"; +static const char __pyx_k_kqueue[] = "kqueue"; +static const char __pyx_k_nowait[] = "nowait"; +static const char __pyx_k_repeat[] = "repeat"; +static const char __pyx_k_select[] = "select"; +static const char __pyx_k_signal[] = "signal"; +static const char __pyx_k_signum[] = "signum"; +static const char __pyx_k_update[] = "update"; +static const char __pyx_k_CLEANUP[] = "CLEANUP"; +static const char __pyx_k_IOFDSET[] = "_IOFDSET"; +static const char __pyx_k_PREPARE[] = "PREPARE"; +static const char __pyx_k_async_2[] = "async"; +static const char __pyx_k_backend[] = "backend"; +static const char __pyx_k_context[] = "context"; +static const char __pyx_k_default[] = "default"; +static const char __pyx_k_flags_2[] = "flags"; +static const char __pyx_k_genexpr[] = "genexpr"; +static const char __pyx_k_message[] = "message"; +static const char __pyx_k_pending[] = "pending"; +static const char __pyx_k_prepare[] = "prepare"; +static const char __pyx_k_revents[] = "revents"; +static const char __pyx_k_rstatus[] = "rstatus"; +static const char __pyx_k_stopped[] = " stopped"; +static const char __pyx_k_watcher[] = "watcher"; +static const char __pyx_k_KeyError[] = "KeyError"; +static const char __pyx_k_PERIODIC[] = "PERIODIC"; +static const char __pyx_k_SIGNALFD[] = "SIGNALFD"; +static const char __pyx_k_active_2[] = " active"; +static const char __pyx_k_builtins[] = "__builtins__"; +static const char __pyx_k_callback[] = "callback"; +static const char __pyx_k_events_2[] = "events"; +static const char __pyx_k_fileno_2[] = " fileno="; +static const char __pyx_k_interval[] = "interval"; +static const char __pyx_k_platform[] = "platform"; +static const char __pyx_k_priority[] = "priority"; +static const char __pyx_k_signalfd[] = "signalfd"; +static const char __pyx_k_strerror[] = "strerror"; +static const char __pyx_k_FORKCHECK[] = "FORKCHECK"; +static const char __pyx_k_NOINOTIFY[] = "NOINOTIFY"; +static const char __pyx_k_NOSIGMASK[] = "NOSIGMASK"; +static const char __pyx_k_READWRITE[] = "READWRITE"; +static const char __pyx_k_TypeError[] = "TypeError"; +static const char __pyx_k_activecnt[] = "activecnt"; +static const char __pyx_k_default_2[] = " default"; +static const char __pyx_k_destroyed[] = "destroyed"; +static const char __pyx_k_forkcheck[] = "forkcheck"; +static const char __pyx_k_noinotify[] = "noinotify"; +static const char __pyx_k_nosigmask[] = "nosigmask"; +static const char __pyx_k_pending_2[] = " pending"; +static const char __pyx_k_pending_s[] = " pending=%s"; +static const char __pyx_k_print_exc[] = "print_exc"; +static const char __pyx_k_signalnum[] = "signalnum"; +static const char __pyx_k_traceback[] = "traceback"; +static const char __pyx_k_ValueError[] = "ValueError"; +static const char __pyx_k_basestring[] = "basestring"; +static const char __pyx_k_callback_r[] = " callback=%r"; +static const char __pyx_k_events_str[] = "events_str"; +static const char __pyx_k_pendingcnt[] = "pendingcnt"; +static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__"; +static const char __pyx_k_update_now[] = "update_now"; +static const char __pyx_k_ImportError[] = "ImportError"; +static const char __pyx_k_LIBEV_EMBED[] = "LIBEV_EMBED"; +static const char __pyx_k_SystemError[] = "SystemError"; +static const char __pyx_k_get_version[] = "get_version"; +static const char __pyx_k_libev_d_02d[] = "libev-%d.%02d"; +static const char __pyx_k_pass_events[] = "pass_events"; +static const char __pyx_k_s_at_0x_x_s[] = "<%s at 0x%x%s"; +static const char __pyx_k_BACKEND_POLL[] = "BACKEND_POLL"; +static const char __pyx_k_BACKEND_PORT[] = "BACKEND_PORT"; +static const char __pyx_k_EV_USE_4HEAP[] = "EV_USE_4HEAP"; +static const char __pyx_k_EV_USE_FLOOR[] = "EV_USE_FLOOR"; +static const char __pyx_k_handle_error[] = "handle_error"; +static const char __pyx_k_signalmodule[] = "signalmodule"; +static const char __pyx_k_version_info[] = "version_info"; +static const char __pyx_k_BACKEND_EPOLL[] = "BACKEND_EPOLL"; +static const char __pyx_k_fd_s_events_s[] = " fd=%s events=%s"; +static const char __pyx_k_flags_str2int[] = "_flags_str2int"; +static const char __pyx_k_handle_syserr[] = "_handle_syserr"; +static const char __pyx_k_origflags_int[] = "origflags_int"; +static const char __pyx_k_s_at_0x_x_s_2[] = "<%s at 0x%x %s>"; +static const char __pyx_k_AttributeError[] = "AttributeError"; +static const char __pyx_k_BACKEND_KQUEUE[] = "BACKEND_KQUEUE"; +static const char __pyx_k_BACKEND_SELECT[] = "BACKEND_SELECT"; +static const char __pyx_k_EV_USE_EVENTFD[] = "EV_USE_EVENTFD"; +static const char __pyx_k_EV_USE_INOTIFY[] = "EV_USE_INOTIFY"; +static const char __pyx_k_format_details[] = "_format_details"; +static const char __pyx_k_zope_interface[] = "zope.interface"; +static const char __pyx_k_EV_USE_REALTIME[] = "EV_USE_REALTIME"; +static const char __pyx_k_EV_USE_SIGNALFD[] = "EV_USE_SIGNALFD"; +static const char __pyx_k_SYSERR_CALLBACK[] = "__SYSERR_CALLBACK"; +static const char __pyx_k_classImplements[] = "classImplements"; +static const char __pyx_k_pid_r_rstatus_r[] = " pid=%r rstatus=%r"; +static const char __pyx_k_print_exception[] = "print_exception"; +static const char __pyx_k_EV_USE_MONOTONIC[] = "EV_USE_MONOTONIC"; +static const char __pyx_k_EV_USE_NANOSLEEP[] = "EV_USE_NANOSLEEP"; +static const char __pyx_k_getswitchinterval[] = "getswitchinterval"; +static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; +static const char __pyx_k_get_header_version[] = "get_header_version"; +static const char __pyx_k_gevent__interfaces[] = "gevent._interfaces"; +static const char __pyx_k_gevent_core_EVENTS[] = "gevent.core.EVENTS"; +static const char __pyx_k_supported_backends[] = "supported_backends"; +static const char __pyx_k_embeddable_backends[] = "embeddable_backends"; +static const char __pyx_k_EV_USE_CLOCK_SYSCALL[] = "EV_USE_CLOCK_SYSCALL"; +static const char __pyx_k_default_handle_error[] = "_default_handle_error"; +static const char __pyx_k_ev_loop_new_s_failed[] = "ev_loop_new(%s) failed"; +static const char __pyx_k_illegal_event_mask_r[] = "illegal event mask: %r"; +static const char __pyx_k_recommended_backends[] = "recommended_backends"; +static const char __pyx_k_Unsupported_backend_s[] = "Unsupported backend: %s"; +static const char __pyx_k_getfilesystemencoding[] = "getfilesystemencoding"; +static const char __pyx_k_gevent_libev_corecext[] = "gevent.libev.corecext"; +static const char __pyx_k_Expected_callable_not_r[] = "Expected callable, not %r"; +static const char __pyx_k_illegal_signal_number_r[] = "illegal signal number: %r"; +static const char __pyx_k_ev_default_loop_s_failed[] = "ev_default_loop(%s) failed"; +static const char __pyx_k_fd_must_be_non_negative_r[] = "fd must be non-negative: %r"; +static const char __pyx_k_operation_on_destroyed_loop[] = "operation on destroyed loop"; +static const char __pyx_k_src_gevent_libev_corecext_pyx[] = "src\\gevent\\libev\\corecext.pyx"; +static const char __pyx_k_Invalid_value_for_backend_0x_x[] = "Invalid value for backend: 0x%x"; +static const char __pyx_k_io_watcher_attribute_events_is[] = "'io' watcher attribute 'events' is read-only while watcher is active"; +static const char __pyx_k_Cannot_construct_a_bare_watcher[] = "Cannot construct a bare watcher"; +static const char __pyx_k_Expected_callable_or_None_got_r[] = "Expected callable or None, got %r"; +static const char __pyx_k_callbacks_r_len_d_head_r_tail_r[] = ""; +static const char __pyx_k_io_watcher_attribute_fd_is_read[] = "'io' watcher attribute 'fd' is read-only while watcher is active"; +static const char __pyx_k_repeat_must_be_positive_or_zero[] = "repeat must be positive or zero: %r"; +static const char __pyx_k_Cannot_set_priority_of_an_active[] = "Cannot set priority of an active watcher"; +static const char __pyx_k_Child_watchers_are_not_supported[] = "Child watchers are not supported on Windows"; +static const char __pyx_k_Invalid_backend_or_flag_s_Possib[] = "Invalid backend or flag: %s\nPossible values: %s"; +static const char __pyx_k_child_watchers_are_only_availabl[] = "child watchers are only available on the default loop"; +static PyObject *__pyx_kp_s_; +static PyObject *__pyx_n_s_ASYNC; +static PyObject *__pyx_n_s_AttributeError; +static PyObject *__pyx_n_s_BACKEND_EPOLL; +static PyObject *__pyx_n_s_BACKEND_KQUEUE; +static PyObject *__pyx_n_s_BACKEND_POLL; +static PyObject *__pyx_n_s_BACKEND_PORT; +static PyObject *__pyx_n_s_BACKEND_SELECT; +static PyObject *__pyx_n_s_CHECK; +static PyObject *__pyx_n_s_CHILD; +static PyObject *__pyx_n_s_CLEANUP; +static PyObject *__pyx_n_s_CUSTOM; +static PyObject *__pyx_kp_s_Cannot_construct_a_bare_watcher; +static PyObject *__pyx_kp_s_Cannot_set_priority_of_an_active; +static PyObject *__pyx_kp_s_Child_watchers_are_not_supported; +static PyObject *__pyx_n_s_EMBED; +static PyObject *__pyx_n_s_ERROR; +static PyObject *__pyx_n_s_EVENTS; +static PyObject *__pyx_n_s_EV_USE_4HEAP; +static PyObject *__pyx_n_s_EV_USE_CLOCK_SYSCALL; +static PyObject *__pyx_n_s_EV_USE_EVENTFD; +static PyObject *__pyx_n_s_EV_USE_FLOOR; +static PyObject *__pyx_n_s_EV_USE_INOTIFY; +static PyObject *__pyx_n_s_EV_USE_MONOTONIC; +static PyObject *__pyx_n_s_EV_USE_NANOSLEEP; +static PyObject *__pyx_n_s_EV_USE_REALTIME; +static PyObject *__pyx_n_s_EV_USE_SIGNALFD; +static PyObject *__pyx_kp_s_Expected_callable_not_r; +static PyObject *__pyx_kp_s_Expected_callable_or_None_got_r; +static PyObject *__pyx_n_s_FORK; +static PyObject *__pyx_n_s_FORKCHECK; +static PyObject *__pyx_n_s_IDLE; +static PyObject *__pyx_n_s_ILoop; +static PyObject *__pyx_n_s_IOFDSET; +static PyObject *__pyx_n_s_ImportError; +static PyObject *__pyx_kp_s_Invalid_backend_or_flag_s_Possib; +static PyObject *__pyx_kp_s_Invalid_value_for_backend_0x_x; +static PyObject *__pyx_n_s_KeyError; +static PyObject *__pyx_n_s_LIBEV_EMBED; +static PyObject *__pyx_n_s_MAXPRI; +static PyObject *__pyx_n_s_MINPRI; +static PyObject *__pyx_n_s_NOINOTIFY; +static PyObject *__pyx_n_s_NONE; +static PyObject *__pyx_n_s_NOSIGMASK; +static PyObject *__pyx_n_s_NSIG; +static PyObject *__pyx_n_s_PERIODIC; +static PyObject *__pyx_n_s_PREPARE; +static PyObject *__pyx_n_s_READ; +static PyObject *__pyx_n_s_READWRITE; +static PyObject *__pyx_n_s_SIGNAL; +static PyObject *__pyx_n_s_SIGNALFD; +static PyObject *__pyx_n_s_STAT; +static PyObject *__pyx_n_s_SYSERR_CALLBACK; +static PyObject *__pyx_n_s_SystemError; +static PyObject *__pyx_n_s_TIMER; +static PyObject *__pyx_n_s_TypeError; +static PyObject *__pyx_n_s_UNDEF; +static PyObject *__pyx_kp_s_Unsupported_backend_s; +static PyObject *__pyx_n_s_ValueError; +static PyObject *__pyx_n_s_WRITE; +static PyObject *__pyx_kp_s__2; +static PyObject *__pyx_kp_s__3; +static PyObject *__pyx_kp_s__5; +static PyObject *__pyx_kp_s__6; +static PyObject *__pyx_kp_s__7; +static PyObject *__pyx_kp_s__8; +static PyObject *__pyx_n_s_active; +static PyObject *__pyx_kp_s_active_2; +static PyObject *__pyx_n_s_activecnt; +static PyObject *__pyx_n_s_after; +static PyObject *__pyx_n_s_all; +static PyObject *__pyx_n_s_args; +static PyObject *__pyx_kp_s_args_r; +static PyObject *__pyx_n_s_async; +static PyObject *__pyx_n_s_async_2; +static PyObject *__pyx_n_s_backend; +static PyObject *__pyx_n_s_basestring; +static PyObject *__pyx_n_s_builtins; +static PyObject *__pyx_n_s_callback; +static PyObject *__pyx_kp_s_callback_r; +static PyObject *__pyx_kp_s_callbacks_r_len_d_head_r_tail_r; +static PyObject *__pyx_n_s_check; +static PyObject *__pyx_n_s_child; +static PyObject *__pyx_kp_s_child_watchers_are_only_availabl; +static PyObject *__pyx_n_s_class; +static PyObject *__pyx_n_s_classImplements; +static PyObject *__pyx_n_s_cline_in_traceback; +static PyObject *__pyx_n_s_close; +static PyObject *__pyx_n_s_context; +static PyObject *__pyx_n_s_decode; +static PyObject *__pyx_n_s_default; +static PyObject *__pyx_kp_s_default_2; +static PyObject *__pyx_n_s_default_handle_error; +static PyObject *__pyx_n_s_destroyed; +static PyObject *__pyx_n_s_embeddable_backends; +static PyObject *__pyx_n_s_encode; +static PyObject *__pyx_n_s_epoll; +static PyObject *__pyx_n_s_errno; +static PyObject *__pyx_kp_s_ev_default_loop_s_failed; +static PyObject *__pyx_kp_s_ev_loop_new_s_failed; +static PyObject *__pyx_n_s_events; +static PyObject *__pyx_n_s_events_2; +static PyObject *__pyx_n_s_events_str; +static PyObject *__pyx_n_s_fd; +static PyObject *__pyx_kp_s_fd_must_be_non_negative_r; +static PyObject *__pyx_kp_s_fd_s_events_s; +static PyObject *__pyx_n_s_fileno; +static PyObject *__pyx_kp_s_fileno_2; +static PyObject *__pyx_n_s_flags; +static PyObject *__pyx_n_s_flags_2; +static PyObject *__pyx_n_s_flags_str2int; +static PyObject *__pyx_n_s_fork; +static PyObject *__pyx_n_s_forkcheck; +static PyObject *__pyx_n_s_format; +static PyObject *__pyx_n_s_format_details; +static PyObject *__pyx_n_s_func; +static PyObject *__pyx_n_s_genexpr; +static PyObject *__pyx_n_s_get_header_version; +static PyObject *__pyx_n_s_get_version; +static PyObject *__pyx_n_s_getfilesystemencoding; +static PyObject *__pyx_n_s_getswitchinterval; +static PyObject *__pyx_n_s_gevent; +static PyObject *__pyx_n_s_gevent__interfaces; +static PyObject *__pyx_kp_s_gevent_core_EVENTS; +static PyObject *__pyx_n_s_gevent_libev_corecext; +static PyObject *__pyx_n_s_handle_error; +static PyObject *__pyx_n_s_handle_syserr; +static PyObject *__pyx_n_s_hex; +static PyObject *__pyx_n_s_how; +static PyObject *__pyx_n_s_id; +static PyObject *__pyx_n_s_idle; +static PyObject *__pyx_kp_s_illegal_event_mask_r; +static PyObject *__pyx_kp_s_illegal_signal_number_r; +static PyObject *__pyx_n_s_import; +static PyObject *__pyx_n_s_init; +static PyObject *__pyx_n_s_interval; +static PyObject *__pyx_n_s_io; +static PyObject *__pyx_kp_s_io_watcher_attribute_events_is; +static PyObject *__pyx_kp_s_io_watcher_attribute_fd_is_read; +static PyObject *__pyx_n_s_join; +static PyObject *__pyx_n_s_keys; +static PyObject *__pyx_n_s_kqueue; +static PyObject *__pyx_n_s_level; +static PyObject *__pyx_kp_s_libev_d_02d; +static PyObject *__pyx_n_s_loop; +static PyObject *__pyx_n_s_lower; +static PyObject *__pyx_n_s_main; +static PyObject *__pyx_n_s_message; +static PyObject *__pyx_n_s_name; +static PyObject *__pyx_n_s_noenv; +static PyObject *__pyx_n_s_noinotify; +static PyObject *__pyx_n_s_nosigmask; +static PyObject *__pyx_n_s_now; +static PyObject *__pyx_n_s_nowait; +static PyObject *__pyx_n_s_once; +static PyObject *__pyx_kp_s_operation_on_destroyed_loop; +static PyObject *__pyx_n_s_origflags_int; +static PyObject *__pyx_n_s_os; +static PyObject *__pyx_n_s_pass_events; +static PyObject *__pyx_n_s_path; +static PyObject *__pyx_n_s_pending; +static PyObject *__pyx_kp_s_pending_2; +static PyObject *__pyx_kp_s_pending_s; +static PyObject *__pyx_n_s_pendingcnt; +static PyObject *__pyx_n_s_pid; +static PyObject *__pyx_kp_s_pid_r_rstatus_r; +static PyObject *__pyx_n_s_platform; +static PyObject *__pyx_n_s_poll; +static PyObject *__pyx_n_s_port; +static PyObject *__pyx_n_s_prepare; +static PyObject *__pyx_n_s_print_exc; +static PyObject *__pyx_n_s_print_exception; +static PyObject *__pyx_n_s_priority; +static PyObject *__pyx_n_s_ptr; +static PyObject *__pyx_n_s_pyx_vtable; +static PyObject *__pyx_n_s_recommended_backends; +static PyObject *__pyx_n_s_ref; +static PyObject *__pyx_kp_s_ref_2; +static PyObject *__pyx_n_s_repeat; +static PyObject *__pyx_kp_s_repeat_must_be_positive_or_zero; +static PyObject *__pyx_n_s_revents; +static PyObject *__pyx_n_s_rstatus; +static PyObject *__pyx_kp_s_s_at_0x_x_s; +static PyObject *__pyx_kp_s_s_at_0x_x_s_2; +static PyObject *__pyx_n_s_select; +static PyObject *__pyx_n_s_send; +static PyObject *__pyx_n_s_sigfd; +static PyObject *__pyx_n_s_signal; +static PyObject *__pyx_n_s_signalfd; +static PyObject *__pyx_n_s_signalmodule; +static PyObject *__pyx_n_s_signalnum; +static PyObject *__pyx_n_s_signum; +static PyObject *__pyx_n_s_split; +static PyObject *__pyx_kp_s_src_gevent_libev_corecext_pyx; +static PyObject *__pyx_n_s_start; +static PyObject *__pyx_n_s_stat; +static PyObject *__pyx_n_s_stop; +static PyObject *__pyx_kp_s_stopped; +static PyObject *__pyx_n_s_strerror; +static PyObject *__pyx_n_s_strip; +static PyObject *__pyx_n_s_supported_backends; +static PyObject *__pyx_n_s_sys; +static PyObject *__pyx_n_s_t; +static PyObject *__pyx_n_s_tb; +static PyObject *__pyx_n_s_test; +static PyObject *__pyx_n_s_throw; +static PyObject *__pyx_n_s_time; +static PyObject *__pyx_n_s_timer; +static PyObject *__pyx_n_s_trace; +static PyObject *__pyx_n_s_traceback; +static PyObject *__pyx_n_s_type; +static PyObject *__pyx_n_s_update; +static PyObject *__pyx_n_s_update_now; +static PyObject *__pyx_n_s_v; +static PyObject *__pyx_n_s_value; +static PyObject *__pyx_n_s_version_info; +static PyObject *__pyx_n_s_watcher; +static PyObject *__pyx_n_s_win32; +static PyObject *__pyx_n_s_zope_interface; +static PyObject *__pyx_pf_6gevent_5libev_8corecext_22genexpr(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_11_EVENTSType___repr__(CYTHON_UNUSED struct __pyx_obj_6gevent_5libev_8corecext__EVENTSType *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_get_version(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_2get_header_version(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4_flags_to_list(CYTHON_UNUSED PyObject *__pyx_self, unsigned int __pyx_v_flags); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_6_flags_to_int(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_flags); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_8_check_flags(CYTHON_UNUSED PyObject *__pyx_self, unsigned int __pyx_v_flags); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_10_events_to_str(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_events); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_12supported_backends(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_14recommended_backends(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_16embeddable_backends(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_18time(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_8callback___init__(struct PyGeventCallbackObject *__pyx_v_self, PyObject *__pyx_v_callback, PyObject *__pyx_v_args); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_8callback_2stop(struct PyGeventCallbackObject *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_8callback_4__nonzero__(struct PyGeventCallbackObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_8callback_7pending___get__(struct PyGeventCallbackObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_8callback_6__repr__(struct PyGeventCallbackObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_8callback_8_format(CYTHON_UNUSED struct PyGeventCallbackObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_8callback_8callback___get__(struct PyGeventCallbackObject *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_8callback_8callback_2__set__(struct PyGeventCallbackObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_8callback_8callback_4__del__(struct PyGeventCallbackObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_8callback_4args___get__(struct PyGeventCallbackObject *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_8callback_4args_2__set__(struct PyGeventCallbackObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_8callback_4args_4__del__(struct PyGeventCallbackObject *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_12CallbackFIFO___init__(struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_12CallbackFIFO_2__nonzero__(struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *__pyx_v_self); /* proto */ +static Py_ssize_t __pyx_pf_6gevent_5libev_8corecext_12CallbackFIFO_4__len__(struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_12CallbackFIFO_6__iter__(struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_12CallbackFIFO_8__repr__(struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_4loop___cinit__(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_flags, PyObject *__pyx_v_default, intptr_t __pyx_v_ptr); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_4loop_2__init__(struct PyGeventLoopObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_flags, CYTHON_UNUSED PyObject *__pyx_v_default, CYTHON_UNUSED intptr_t __pyx_v_ptr); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_4destroy(struct PyGeventLoopObject *__pyx_v_self); /* proto */ +static void __pyx_pf_6gevent_5libev_8corecext_4loop_6__dealloc__(struct PyGeventLoopObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_3ptr___get__(struct PyGeventLoopObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_11WatcherType___get__(CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_6MAXPRI___get__(CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_6MINPRI___get__(CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_8_handle_syserr(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_message, PyObject *__pyx_v_errno); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_10handle_error(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_context, PyObject *__pyx_v_type, PyObject *__pyx_v_value, PyObject *__pyx_v_tb); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_12_default_handle_error(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_context, PyObject *__pyx_v_type, PyObject *__pyx_v_value, PyObject *__pyx_v_tb); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_14run(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_nowait, PyObject *__pyx_v_once); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_16reinit(struct PyGeventLoopObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_18ref(struct PyGeventLoopObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_20unref(struct PyGeventLoopObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_22break_(struct PyGeventLoopObject *__pyx_v_self, int __pyx_v_how); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_24verify(struct PyGeventLoopObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_26now(struct PyGeventLoopObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_28update_now(struct PyGeventLoopObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_30__repr__(struct PyGeventLoopObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_7default___get__(struct PyGeventLoopObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_9iteration___get__(struct PyGeventLoopObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_5depth___get__(struct PyGeventLoopObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_11backend_int___get__(struct PyGeventLoopObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_7backend___get__(struct PyGeventLoopObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_10pendingcnt___get__(struct PyGeventLoopObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_32io(struct PyGeventLoopObject *__pyx_v_self, vfd_socket_t __pyx_v_fd, int __pyx_v_events, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_34timer(struct PyGeventLoopObject *__pyx_v_self, double __pyx_v_after, double __pyx_v_repeat, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_36signal(struct PyGeventLoopObject *__pyx_v_self, int __pyx_v_signum, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_38idle(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_40prepare(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_42check(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_44fork(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_46async_(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_48child(struct PyGeventLoopObject *__pyx_v_self, int __pyx_v_pid, int __pyx_v_trace, PyObject *__pyx_v_ref); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_50install_sigchld(CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_52reset_sigchld(CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_54stat(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_path, float __pyx_v_interval, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_56run_callback(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_func, PyObject *__pyx_v_args); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_58_format(struct PyGeventLoopObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_60_format_details(struct PyGeventLoopObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_62fileno(struct PyGeventLoopObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_9activecnt___get__(struct PyGeventLoopObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_11sig_pending___get__(struct PyGeventLoopObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_9origflags___get__(struct PyGeventLoopObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_13origflags_int___get__(struct PyGeventLoopObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_5sigfd___get__(struct PyGeventLoopObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_13error_handler___get__(struct PyGeventLoopObject *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_4loop_13error_handler_2__set__(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_4loop_13error_handler_4__del__(struct PyGeventLoopObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_10_callbacks___get__(struct PyGeventLoopObject *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_4loop_10_callbacks_2__set__(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_4loop_10_callbacks_4__del__(struct PyGeventLoopObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_23approx_timer_resolution___get__(struct PyGeventLoopObject *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_7watcher___init__(struct PyGeventWatcherObject *__pyx_v_self, struct PyGeventLoopObject *__pyx_v_loop, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_7watcher_3ref___get__(struct PyGeventWatcherObject *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_7watcher_3ref_2__set__(struct PyGeventWatcherObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_7watcher_8callback___get__(struct PyGeventWatcherObject *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_7watcher_8callback_2__set__(struct PyGeventWatcherObject *__pyx_v_self, PyObject *__pyx_v_callback); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_7watcher_8priority___get__(struct PyGeventWatcherObject *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_7watcher_8priority_2__set__(struct PyGeventWatcherObject *__pyx_v_self, int __pyx_v_priority); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_7watcher_6active___get__(struct PyGeventWatcherObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_7watcher_7pending___get__(struct PyGeventWatcherObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_7watcher_2start(struct PyGeventWatcherObject *__pyx_v_self, PyObject *__pyx_v_callback, PyObject *__pyx_v_args); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_7watcher_4stop(struct PyGeventWatcherObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_7watcher_6feed(struct PyGeventWatcherObject *__pyx_v_self, int __pyx_v_revents, PyObject *__pyx_v_callback, PyObject *__pyx_v_args); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_7watcher_8__repr__(struct PyGeventWatcherObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_7watcher_10_format(CYTHON_UNUSED struct PyGeventWatcherObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_7watcher_12close(struct PyGeventWatcherObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_7watcher_14__enter__(struct PyGeventWatcherObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_7watcher_16__exit__(struct PyGeventWatcherObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_t, CYTHON_UNUSED PyObject *__pyx_v_v, CYTHON_UNUSED PyObject *__pyx_v_tb); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_7watcher_4loop___get__(struct PyGeventWatcherObject *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_7watcher_4loop_2__set__(struct PyGeventWatcherObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_7watcher_4loop_4__del__(struct PyGeventWatcherObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_7watcher_4args___get__(struct PyGeventWatcherObject *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_7watcher_4args_2__set__(struct PyGeventWatcherObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_7watcher_4args_4__del__(struct PyGeventWatcherObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_7watcher_6_flags___get__(struct PyGeventWatcherObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_2io_start(struct PyGeventIOObject *__pyx_v_self, PyObject *__pyx_v_callback, PyObject *__pyx_v_pass_events, PyObject *__pyx_v_args); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_2io_2__init__(struct PyGeventIOObject *__pyx_v_self, struct PyGeventLoopObject *__pyx_v_loop, CYTHON_UNUSED vfd_socket_t __pyx_v_fd, CYTHON_UNUSED int __pyx_v_events, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_2io_4__cinit__(struct PyGeventIOObject *__pyx_v_self, CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_loop, vfd_socket_t __pyx_v_fd, int __pyx_v_events, CYTHON_UNUSED PyObject *__pyx_v_ref, CYTHON_UNUSED PyObject *__pyx_v_priority); /* proto */ +static void __pyx_pf_6gevent_5libev_8corecext_2io_6__dealloc__(struct PyGeventIOObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_2io_2fd___get__(struct PyGeventIOObject *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_2io_2fd_2__set__(struct PyGeventIOObject *__pyx_v_self, long __pyx_v_fd); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_2io_6events___get__(struct PyGeventIOObject *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_2io_6events_2__set__(struct PyGeventIOObject *__pyx_v_self, int __pyx_v_events); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_2io_10events_str___get__(struct PyGeventIOObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_2io_8_format(struct PyGeventIOObject *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_5timer___cinit__(struct PyGeventTimerObject *__pyx_v_self, CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_loop, double __pyx_v_after, double __pyx_v_repeat, CYTHON_UNUSED PyObject *__pyx_v_ref, CYTHON_UNUSED PyObject *__pyx_v_priority); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_5timer_2__init__(struct PyGeventTimerObject *__pyx_v_self, struct PyGeventLoopObject *__pyx_v_loop, CYTHON_UNUSED double __pyx_v_after, CYTHON_UNUSED double __pyx_v_repeat, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_5timer_4start(struct PyGeventTimerObject *__pyx_v_self, PyObject *__pyx_v_callback, PyObject *__pyx_v_update, PyObject *__pyx_v_args); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_5timer_2at___get__(struct PyGeventTimerObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_5timer_6again(struct PyGeventTimerObject *__pyx_v_self, PyObject *__pyx_v_callback, PyObject *__pyx_v_update, PyObject *__pyx_v_args); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_6signal___cinit__(struct PyGeventSignalObject *__pyx_v_self, CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_loop, int __pyx_v_signalnum, CYTHON_UNUSED PyObject *__pyx_v_ref, CYTHON_UNUSED PyObject *__pyx_v_priority); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_6signal_2__init__(struct PyGeventSignalObject *__pyx_v_self, struct PyGeventLoopObject *__pyx_v_loop, CYTHON_UNUSED int __pyx_v_signalnum, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_4idle___cinit__(struct PyGeventIdleObject *__pyx_v_self, CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_loop, CYTHON_UNUSED PyObject *__pyx_v_ref, CYTHON_UNUSED PyObject *__pyx_v_priority); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_7prepare___cinit__(struct PyGeventPrepareObject *__pyx_v_self, CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_loop, CYTHON_UNUSED PyObject *__pyx_v_ref, CYTHON_UNUSED PyObject *__pyx_v_priority); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_5check___cinit__(struct PyGeventCheckObject *__pyx_v_self, CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_loop, CYTHON_UNUSED PyObject *__pyx_v_ref, CYTHON_UNUSED PyObject *__pyx_v_priority); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_4fork___cinit__(struct PyGeventForkObject *__pyx_v_self, CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_loop, CYTHON_UNUSED PyObject *__pyx_v_ref, CYTHON_UNUSED PyObject *__pyx_v_priority); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_6async__7pending___get__(struct PyGeventAsyncObject *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_6async____cinit__(struct PyGeventAsyncObject *__pyx_v_self, CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_loop, CYTHON_UNUSED PyObject *__pyx_v_ref, CYTHON_UNUSED PyObject *__pyx_v_priority); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_6async__2send(struct PyGeventAsyncObject *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_5child___cinit__(struct PyGeventChildObject *__pyx_v_self, struct PyGeventLoopObject *__pyx_v_loop, int __pyx_v_pid, int __pyx_v_trace, CYTHON_UNUSED PyObject *__pyx_v_ref); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_5child_2__init__(struct PyGeventChildObject *__pyx_v_self, struct PyGeventLoopObject *__pyx_v_loop, CYTHON_UNUSED int __pyx_v_pid, CYTHON_UNUSED int __pyx_v_trace, PyObject *__pyx_v_ref); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_5child_4_format(struct PyGeventChildObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_5child_3pid___get__(struct PyGeventChildObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_5child_4rpid___get__(struct PyGeventChildObject *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_5child_4rpid_2__set__(struct PyGeventChildObject *__pyx_v_self, int __pyx_v_value); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_5child_7rstatus___get__(struct PyGeventChildObject *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_5child_7rstatus_2__set__(struct PyGeventChildObject *__pyx_v_self, int __pyx_v_value); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_4stat___cinit__(struct PyGeventStatObject *__pyx_v_self, CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_loop, PyObject *__pyx_v_path, float __pyx_v_interval, CYTHON_UNUSED PyObject *__pyx_v_ref, CYTHON_UNUSED PyObject *__pyx_v_priority); /* proto */ +static int __pyx_pf_6gevent_5libev_8corecext_4stat_2__init__(struct PyGeventStatObject *__pyx_v_self, struct PyGeventLoopObject *__pyx_v_loop, CYTHON_UNUSED PyObject *__pyx_v_path, CYTHON_UNUSED float __pyx_v_interval, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4stat_4attr___get__(struct PyGeventStatObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4stat_4prev___get__(struct PyGeventStatObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4stat_8interval___get__(struct PyGeventStatObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4stat_4path___get__(struct PyGeventStatObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4stat_6_paths___get__(struct PyGeventStatObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_5libev_8corecext_20set_syserr_cb(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_callback); /* proto */ +static PyObject *__pyx_tp_new_6gevent_5libev_8corecext__EVENTSType(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6gevent_5libev_8corecext_callback(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6gevent_5libev_8corecext_CallbackFIFO(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6gevent_5libev_8corecext_loop(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6gevent_5libev_8corecext_watcher(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6gevent_5libev_8corecext_io(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6gevent_5libev_8corecext_timer(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6gevent_5libev_8corecext_signal(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6gevent_5libev_8corecext_idle(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6gevent_5libev_8corecext_prepare(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6gevent_5libev_8corecext_check(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6gevent_5libev_8corecext_fork(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6gevent_5libev_8corecext_async_(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6gevent_5libev_8corecext_child(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6gevent_5libev_8corecext_stat(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6gevent_5libev_8corecext___pyx_scope_struct__genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_int_0; +static PyObject *__pyx_int_3; +static int __pyx_k__9; +static PyObject *__pyx_tuple__4; +static PyObject *__pyx_tuple__10; +static PyObject *__pyx_tuple__11; +static PyObject *__pyx_tuple__12; +static PyObject *__pyx_tuple__13; +static PyObject *__pyx_tuple__14; +static PyObject *__pyx_tuple__15; +static PyObject *__pyx_tuple__16; +static PyObject *__pyx_tuple__17; +static PyObject *__pyx_tuple__18; +static PyObject *__pyx_tuple__19; +static PyObject *__pyx_tuple__20; +static PyObject *__pyx_tuple__21; +static PyObject *__pyx_codeobj__22; +static PyObject *__pyx_codeobj__23; +static PyObject *__pyx_codeobj__24; +static PyObject *__pyx_codeobj__25; +static PyObject *__pyx_codeobj__26; +static PyObject *__pyx_codeobj__27; +/* Late includes */ +static PyObject *__pyx_gb_6gevent_5libev_8corecext_24generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ + + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_22genexpr(CYTHON_UNUSED PyObject *__pyx_self) { + struct __pyx_obj_6gevent_5libev_8corecext___pyx_scope_struct__genexpr *__pyx_cur_scope; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("genexpr", 0); + __pyx_cur_scope = (struct __pyx_obj_6gevent_5libev_8corecext___pyx_scope_struct__genexpr *)__pyx_tp_new_6gevent_5libev_8corecext___pyx_scope_struct__genexpr(__pyx_ptype_6gevent_5libev_8corecext___pyx_scope_struct__genexpr, __pyx_empty_tuple, NULL); + if (unlikely(!__pyx_cur_scope)) { + __pyx_cur_scope = ((struct __pyx_obj_6gevent_5libev_8corecext___pyx_scope_struct__genexpr *)Py_None); + __Pyx_INCREF(Py_None); + __PYX_ERR(0, 149, __pyx_L1_error) + } else { + __Pyx_GOTREF(__pyx_cur_scope); + } + { + __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_6gevent_5libev_8corecext_24generator, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_genexpr, __pyx_n_s_gevent_libev_corecext); if (unlikely(!gen)) __PYX_ERR(0, 149, __pyx_L1_error) + __Pyx_DECREF(__pyx_cur_scope); + __Pyx_RefNannyFinishContext(); + return (PyObject *) gen; + } + + /* function exit code */ + __pyx_L1_error:; + __Pyx_AddTraceback("gevent.libev.corecext.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_DECREF(((PyObject *)__pyx_cur_scope)); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_gb_6gevent_5libev_8corecext_24generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ +{ + struct __pyx_obj_6gevent_5libev_8corecext___pyx_scope_struct__genexpr *__pyx_cur_scope = ((struct __pyx_obj_6gevent_5libev_8corecext___pyx_scope_struct__genexpr *)__pyx_generator->closure); + PyObject *__pyx_r = NULL; + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + PyObject *(*__pyx_t_4)(PyObject *); + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *(*__pyx_t_8)(PyObject *); + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("genexpr", 0); + switch (__pyx_generator->resume_label) { + case 0: goto __pyx_L3_first_run; + default: /* CPython raises the right error here */ + __Pyx_RefNannyFinishContext(); + return NULL; + } + __pyx_L3_first_run:; + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 149, __pyx_L1_error) + __pyx_r = PyDict_New(); if (unlikely(!__pyx_r)) __PYX_ERR(0, 149, __pyx_L1_error) + __Pyx_GOTREF(__pyx_r); + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 149, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { + __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; + __pyx_t_4 = NULL; + } else { + __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 149, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 149, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + for (;;) { + if (likely(!__pyx_t_4)) { + if (likely(PyList_CheckExact(__pyx_t_2))) { + if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 149, __pyx_L1_error) + #else + __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 149, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + #endif + } else { + if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 149, __pyx_L1_error) + #else + __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 149, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + #endif + } + } else { + __pyx_t_1 = __pyx_t_4(__pyx_t_2); + if (unlikely(!__pyx_t_1)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(0, 149, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_1); + } + if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { + PyObject* sequence = __pyx_t_1; + Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + __PYX_ERR(0, 149, __pyx_L1_error) + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_5 = PyList_GET_ITEM(sequence, 0); + __pyx_t_6 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(__pyx_t_6); + #else + __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 149, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 149, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_7 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 149, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; + index = 0; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L6_unpacking_failed; + __Pyx_GOTREF(__pyx_t_5); + index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L6_unpacking_failed; + __Pyx_GOTREF(__pyx_t_6); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(0, 149, __pyx_L1_error) + __pyx_t_8 = NULL; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + goto __pyx_L7_unpacking_done; + __pyx_L6_unpacking_failed:; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_8 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + __PYX_ERR(0, 149, __pyx_L1_error) + __pyx_L7_unpacking_done:; + } + __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_flag); + __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_flag, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_string); + __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_string, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __pyx_t_6 = 0; + if (unlikely(PyDict_SetItem(__pyx_r, (PyObject*)__pyx_cur_scope->__pyx_v_string, (PyObject*)__pyx_cur_scope->__pyx_v_flag))) __PYX_ERR(0, 149, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_r); __pyx_r = 0; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + #if !CYTHON_USE_EXC_INFO_STACK + __Pyx_Coroutine_ResetAndClearException(__pyx_generator); + #endif + __pyx_generator->resume_label = -1; + __Pyx_Coroutine_clear((PyObject*)__pyx_generator); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} +PyObject *GEVENT_CORE_EVENTS = 0; +PyObject *_empty_tuple = 0; + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_11_EVENTSType_1__repr__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_11_EVENTSType_1__repr__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_11_EVENTSType___repr__(((struct __pyx_obj_6gevent_5libev_8corecext__EVENTSType *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_11_EVENTSType___repr__(CYTHON_UNUSED struct __pyx_obj_6gevent_5libev_8corecext__EVENTSType *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__repr__", 0); + + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_kp_s_gevent_core_EVENTS); + __pyx_r = __pyx_kp_s_gevent_core_EVENTS; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_1get_version(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyMethodDef __pyx_mdef_6gevent_5libev_8corecext_1get_version = {"get_version", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_1get_version, METH_NOARGS, 0}; +static PyObject *__pyx_pw_6gevent_5libev_8corecext_1get_version(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get_version (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_get_version(__pyx_self); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_get_version(CYTHON_UNUSED PyObject *__pyx_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("get_version", 0); + + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_int(ev_version_major()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 129, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyInt_From_int(ev_version_minor()); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 129, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 129, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); + __pyx_t_1 = 0; + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_libev_d_02d, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 129, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("gevent.libev.corecext.get_version", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_3get_header_version(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyMethodDef __pyx_mdef_6gevent_5libev_8corecext_3get_header_version = {"get_header_version", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_3get_header_version, METH_NOARGS, 0}; +static PyObject *__pyx_pw_6gevent_5libev_8corecext_3get_header_version(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get_header_version (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_2get_header_version(__pyx_self); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_2get_header_version(CYTHON_UNUSED PyObject *__pyx_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("get_header_version", 0); + + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_int(EV_VERSION_MAJOR); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 133, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyInt_From_int(EV_VERSION_MINOR); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 133, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 133, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); + __pyx_t_1 = 0; + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_libev_d_02d, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 133, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("gevent.libev.corecext.get_header_version", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +static PyObject *__pyx_pw_6gevent_5libev_8corecext_5_flags_to_list(PyObject *__pyx_self, PyObject *__pyx_arg_flags); /*proto*/ +static PyObject *__pyx_f_6gevent_5libev_8corecext__flags_to_list(unsigned int __pyx_v_flags, CYTHON_UNUSED int __pyx_skip_dispatch) { + PyObject *__pyx_v_result = 0; + PyObject *__pyx_v_code = NULL; + PyObject *__pyx_v_value = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + PyObject *(*__pyx_t_4)(PyObject *); + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *(*__pyx_t_8)(PyObject *); + int __pyx_t_9; + int __pyx_t_10; + unsigned int __pyx_t_11; + __Pyx_RefNannySetupContext("_flags_to_list", 0); + + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 171, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_result = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 172, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { + __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; + __pyx_t_4 = NULL; + } else { + __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 172, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 172, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + for (;;) { + if (likely(!__pyx_t_4)) { + if (likely(PyList_CheckExact(__pyx_t_2))) { + if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 172, __pyx_L1_error) + #else + __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 172, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + #endif + } else { + if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 172, __pyx_L1_error) + #else + __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 172, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + #endif + } + } else { + __pyx_t_1 = __pyx_t_4(__pyx_t_2); + if (unlikely(!__pyx_t_1)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(0, 172, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_1); + } + if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { + PyObject* sequence = __pyx_t_1; + Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + __PYX_ERR(0, 172, __pyx_L1_error) + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_5 = PyList_GET_ITEM(sequence, 0); + __pyx_t_6 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(__pyx_t_6); + #else + __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 172, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 172, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_7 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 172, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; + index = 0; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L5_unpacking_failed; + __Pyx_GOTREF(__pyx_t_5); + index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed; + __Pyx_GOTREF(__pyx_t_6); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(0, 172, __pyx_L1_error) + __pyx_t_8 = NULL; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + goto __pyx_L6_unpacking_done; + __pyx_L5_unpacking_failed:; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_8 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + __PYX_ERR(0, 172, __pyx_L1_error) + __pyx_L6_unpacking_done:; + } + __Pyx_XDECREF_SET(__pyx_v_code, __pyx_t_5); + __pyx_t_5 = 0; + __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_6); + __pyx_t_6 = 0; + + __pyx_t_1 = __Pyx_PyInt_From_unsigned_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 173, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = PyNumber_And(__pyx_t_1, __pyx_v_code); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 173, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 173, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (__pyx_t_9) { + + __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_value); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(0, 174, __pyx_L1_error) + + } + + __pyx_t_6 = __Pyx_PyInt_From_unsigned_int(__pyx_v_flags); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 175, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_1 = PyNumber_Invert(__pyx_v_code); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 175, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = PyNumber_InPlaceAnd(__pyx_t_6, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 175, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_11 = __Pyx_PyInt_As_unsigned_int(__pyx_t_5); if (unlikely((__pyx_t_11 == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 175, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_flags = __pyx_t_11; + + __pyx_t_9 = ((!(__pyx_v_flags != 0)) != 0); + if (__pyx_t_9) { + + goto __pyx_L4_break; + + } + + } + __pyx_L4_break:; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + __pyx_t_9 = (__pyx_v_flags != 0); + if (__pyx_t_9) { + + __pyx_t_2 = __Pyx_PyInt_From_unsigned_int(__pyx_v_flags); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 179, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_2); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(0, 179, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + } + + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("gevent.libev.corecext._flags_to_list", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XDECREF(__pyx_v_code); + __Pyx_XDECREF(__pyx_v_value); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_5_flags_to_list(PyObject *__pyx_self, PyObject *__pyx_arg_flags); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_5_flags_to_list(PyObject *__pyx_self, PyObject *__pyx_arg_flags) { + unsigned int __pyx_v_flags; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_flags_to_list (wrapper)", 0); + assert(__pyx_arg_flags); { + __pyx_v_flags = __Pyx_PyInt_As_unsigned_int(__pyx_arg_flags); if (unlikely((__pyx_v_flags == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 170, __pyx_L3_error) + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.libev.corecext._flags_to_list", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4_flags_to_list(__pyx_self, ((unsigned int)__pyx_v_flags)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4_flags_to_list(CYTHON_UNUSED PyObject *__pyx_self, unsigned int __pyx_v_flags) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("_flags_to_list", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6gevent_5libev_8corecext__flags_to_list(__pyx_v_flags, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 170, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.libev.corecext._flags_to_list", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +static PyObject *__pyx_pw_6gevent_5libev_8corecext_7_flags_to_int(PyObject *__pyx_self, PyObject *__pyx_v_flags); /*proto*/ +static unsigned int __pyx_f_6gevent_5libev_8corecext__flags_to_int(PyObject *__pyx_v_flags, CYTHON_UNUSED int __pyx_skip_dispatch) { + unsigned int __pyx_v_result; + PyObject *__pyx_v_value = NULL; + PyObject *__pyx_v_ex = NULL; + unsigned int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + unsigned int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + Py_ssize_t __pyx_t_10; + PyObject *(*__pyx_t_11)(PyObject *); + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + int __pyx_t_14; + PyObject *__pyx_t_15 = NULL; + PyObject *__pyx_t_16 = NULL; + int __pyx_t_17; + int __pyx_t_18; + char const *__pyx_t_19; + PyObject *__pyx_t_20 = NULL; + PyObject *__pyx_t_21 = NULL; + PyObject *__pyx_t_22 = NULL; + PyObject *__pyx_t_23 = NULL; + PyObject *__pyx_t_24 = NULL; + PyObject *__pyx_t_25 = NULL; + __Pyx_RefNannySetupContext("_flags_to_int", 0); + __Pyx_INCREF(__pyx_v_flags); + + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_flags); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 191, __pyx_L1_error) + __pyx_t_2 = ((!__pyx_t_1) != 0); + if (__pyx_t_2) { + + __pyx_r = 0; + goto __pyx_L0; + + } + + __pyx_t_3 = __pyx_v_6gevent_5libev_8corecext_integer_types; + __Pyx_INCREF(__pyx_t_3); + __pyx_t_2 = PyObject_IsInstance(__pyx_v_flags, __pyx_t_3); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 193, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_1 = (__pyx_t_2 != 0); + if (__pyx_t_1) { + + __pyx_t_4 = __Pyx_PyInt_As_unsigned_int(__pyx_v_flags); if (unlikely((__pyx_t_4 == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 194, __pyx_L1_error) + __pyx_r = __pyx_t_4; + goto __pyx_L0; + + } + + __pyx_v_result = 0; + + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7); + __Pyx_XGOTREF(__pyx_t_5); + __Pyx_XGOTREF(__pyx_t_6); + __Pyx_XGOTREF(__pyx_t_7); + /*try:*/ { + + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_basestring); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 197, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = PyObject_IsInstance(__pyx_v_flags, __pyx_t_3); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 197, __pyx_L5_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_flags, __pyx_n_s_split); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 198, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) { + __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8); + if (likely(__pyx_t_9)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); + __Pyx_INCREF(__pyx_t_9); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_8, function); + } + } + __pyx_t_3 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_9, __pyx_kp_s_) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_kp_s_); + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 198, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF_SET(__pyx_v_flags, __pyx_t_3); + __pyx_t_3 = 0; + + } + + if (likely(PyList_CheckExact(__pyx_v_flags)) || PyTuple_CheckExact(__pyx_v_flags)) { + __pyx_t_3 = __pyx_v_flags; __Pyx_INCREF(__pyx_t_3); __pyx_t_10 = 0; + __pyx_t_11 = NULL; + } else { + __pyx_t_10 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_flags); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 199, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_11 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 199, __pyx_L5_error) + } + for (;;) { + if (likely(!__pyx_t_11)) { + if (likely(PyList_CheckExact(__pyx_t_3))) { + if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_8 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_10); __Pyx_INCREF(__pyx_t_8); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 199, __pyx_L5_error) + #else + __pyx_t_8 = PySequence_ITEM(__pyx_t_3, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 199, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_8); + #endif + } else { + if (__pyx_t_10 >= PyTuple_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_10); __Pyx_INCREF(__pyx_t_8); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 199, __pyx_L5_error) + #else + __pyx_t_8 = PySequence_ITEM(__pyx_t_3, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 199, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_8); + #endif + } + } else { + __pyx_t_8 = __pyx_t_11(__pyx_t_3); + if (unlikely(!__pyx_t_8)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(0, 199, __pyx_L5_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_8); + } + __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_8); + __pyx_t_8 = 0; + + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_value, __pyx_n_s_strip); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 200, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_13 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) { + __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_12); + if (likely(__pyx_t_13)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12); + __Pyx_INCREF(__pyx_t_13); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_12, function); + } + } + __pyx_t_9 = (__pyx_t_13) ? __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_13) : __Pyx_PyObject_CallNoArg(__pyx_t_12); + __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 200, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_lower); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 200, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) { + __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_12); + if (likely(__pyx_t_9)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12); + __Pyx_INCREF(__pyx_t_9); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_12, function); + } + } + __pyx_t_8 = (__pyx_t_9) ? __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_9) : __Pyx_PyObject_CallNoArg(__pyx_t_12); + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 200, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_8); + __pyx_t_8 = 0; + + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_value); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 201, __pyx_L5_error) + if (__pyx_t_2) { + + __pyx_t_8 = __Pyx_PyInt_From_unsigned_int(__pyx_v_result); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 202, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_flags_str2int); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 202, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_9 = __Pyx_PyObject_GetItem(__pyx_t_12, __pyx_v_value); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 202, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_12 = PyNumber_InPlaceOr(__pyx_t_8, __pyx_t_9); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 202, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_4 = __Pyx_PyInt_As_unsigned_int(__pyx_t_12); if (unlikely((__pyx_t_4 == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 202, __pyx_L5_error) + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_v_result = __pyx_t_4; + + } + + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + } + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + goto __pyx_L10_try_end; + __pyx_L5_error:; + __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + + __pyx_t_14 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError); + if (__pyx_t_14) { + __Pyx_AddTraceback("gevent.libev.corecext._flags_to_int", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_12, &__pyx_t_9) < 0) __PYX_ERR(0, 203, __pyx_L7_except_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GOTREF(__pyx_t_12); + __Pyx_GOTREF(__pyx_t_9); + __Pyx_INCREF(__pyx_t_12); + __pyx_v_ex = __pyx_t_12; + /*try:*/ { + + __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_n_s_flags_str2int); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 204, __pyx_L20_error) + __Pyx_GOTREF(__pyx_t_15); + __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_n_s_keys); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 204, __pyx_L20_error) + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + __pyx_t_15 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_16))) { + __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_16); + if (likely(__pyx_t_15)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_16); + __Pyx_INCREF(__pyx_t_15); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_16, function); + } + } + __pyx_t_13 = (__pyx_t_15) ? __Pyx_PyObject_CallOneArg(__pyx_t_16, __pyx_t_15) : __Pyx_PyObject_CallNoArg(__pyx_t_16); + __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; + if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 204, __pyx_L20_error) + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __pyx_t_16 = PySequence_List(__pyx_t_13); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 204, __pyx_L20_error) + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_8 = ((PyObject*)__pyx_t_16); + __pyx_t_16 = 0; + __pyx_t_17 = PyList_Sort(__pyx_t_8); if (unlikely(__pyx_t_17 == ((int)-1))) __PYX_ERR(0, 204, __pyx_L20_error) + __pyx_t_16 = __Pyx_PyString_Join(__pyx_kp_s__2, __pyx_t_8); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 204, __pyx_L20_error) + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 204, __pyx_L20_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(__pyx_v_ex); + __Pyx_GIVEREF(__pyx_v_ex); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_ex); + __Pyx_GIVEREF(__pyx_t_16); + PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_16); + __pyx_t_16 = 0; + __pyx_t_16 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_backend_or_flag_s_Possib, __pyx_t_8); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 204, __pyx_L20_error) + __Pyx_GOTREF(__pyx_t_16); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_16); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 204, __pyx_L20_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __Pyx_Raise(__pyx_t_8, 0, 0, 0); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __PYX_ERR(0, 204, __pyx_L20_error) + } + + /*finally:*/ { + __pyx_L20_error:; + /*exception exit:*/{ + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_t_23 = 0; __pyx_t_24 = 0; __pyx_t_25 = 0; + __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; + __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_23, &__pyx_t_24, &__pyx_t_25); + if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22) < 0)) __Pyx_ErrFetch(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22); + __Pyx_XGOTREF(__pyx_t_20); + __Pyx_XGOTREF(__pyx_t_21); + __Pyx_XGOTREF(__pyx_t_22); + __Pyx_XGOTREF(__pyx_t_23); + __Pyx_XGOTREF(__pyx_t_24); + __Pyx_XGOTREF(__pyx_t_25); + __pyx_t_14 = __pyx_lineno; __pyx_t_18 = __pyx_clineno; __pyx_t_19 = __pyx_filename; + { + __Pyx_DECREF(__pyx_v_ex); + __pyx_v_ex = NULL; + } + if (PY_MAJOR_VERSION >= 3) { + __Pyx_XGIVEREF(__pyx_t_23); + __Pyx_XGIVEREF(__pyx_t_24); + __Pyx_XGIVEREF(__pyx_t_25); + __Pyx_ExceptionReset(__pyx_t_23, __pyx_t_24, __pyx_t_25); + } + __Pyx_XGIVEREF(__pyx_t_20); + __Pyx_XGIVEREF(__pyx_t_21); + __Pyx_XGIVEREF(__pyx_t_22); + __Pyx_ErrRestore(__pyx_t_20, __pyx_t_21, __pyx_t_22); + __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_t_23 = 0; __pyx_t_24 = 0; __pyx_t_25 = 0; + __pyx_lineno = __pyx_t_14; __pyx_clineno = __pyx_t_18; __pyx_filename = __pyx_t_19; + goto __pyx_L7_except_error; + } + } + } + goto __pyx_L7_except_error; + __pyx_L7_except_error:; + + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7); + goto __pyx_L1_error; + __pyx_L10_try_end:; + } + + __pyx_r = __pyx_v_result; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_XDECREF(__pyx_t_13); + __Pyx_XDECREF(__pyx_t_15); + __Pyx_XDECREF(__pyx_t_16); + __Pyx_AddTraceback("gevent.libev.corecext._flags_to_int", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_value); + __Pyx_XDECREF(__pyx_v_ex); + __Pyx_XDECREF(__pyx_v_flags); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_7_flags_to_int(PyObject *__pyx_self, PyObject *__pyx_v_flags); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_7_flags_to_int(PyObject *__pyx_self, PyObject *__pyx_v_flags) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_flags_to_int (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_6_flags_to_int(__pyx_self, ((PyObject *)__pyx_v_flags)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_6_flags_to_int(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_flags) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + unsigned int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("_flags_to_int", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6gevent_5libev_8corecext__flags_to_int(__pyx_v_flags, 0); if (unlikely(__pyx_t_1 == ((unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 189, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_unsigned_int(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 189, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent.libev.corecext._flags_to_int", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +static PyObject *__pyx_f_6gevent_5libev_8corecext__str_hex(PyObject *__pyx_v_flag) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + __Pyx_RefNannySetupContext("_str_hex", 0); + + __pyx_t_1 = __pyx_v_6gevent_5libev_8corecext_integer_types; + __Pyx_INCREF(__pyx_t_1); + __pyx_t_2 = PyObject_IsInstance(__pyx_v_flag, __pyx_t_1); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 209, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_hex, __pyx_v_flag); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 210, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(PyString_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 210, __pyx_L1_error) + __pyx_r = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + goto __pyx_L0; + + } + + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyString_Type)), __pyx_v_flag); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 211, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(PyString_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 211, __pyx_L1_error) + __pyx_r = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.libev.corecext._str_hex", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +static PyObject *__pyx_pw_6gevent_5libev_8corecext_9_check_flags(PyObject *__pyx_self, PyObject *__pyx_arg_flags); /*proto*/ +static PyObject *__pyx_f_6gevent_5libev_8corecext__check_flags(unsigned int __pyx_v_flags, CYTHON_UNUSED int __pyx_skip_dispatch) { + PyObject *__pyx_v_as_list = 0; + PyObject *__pyx_8genexpr1__pyx_v_x = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + Py_ssize_t __pyx_t_5; + PyObject *(*__pyx_t_6)(PyObject *); + __Pyx_RefNannySetupContext("_check_flags", 0); + + __pyx_v_flags = (__pyx_v_flags & EVBACKEND_MASK); + + __pyx_t_1 = ((!(__pyx_v_flags != 0)) != 0); + if (__pyx_t_1) { + + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + + } + + __pyx_t_1 = ((!((__pyx_v_flags & EVBACKEND_ALL) != 0)) != 0); + if (unlikely(__pyx_t_1)) { + + __pyx_t_2 = __Pyx_PyInt_From_unsigned_int(__pyx_v_flags); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 220, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_value_for_backend_0x_x, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 220, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 220, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 220, __pyx_L1_error) + + } + + __pyx_t_1 = ((!((__pyx_v_flags & ev_supported_backends()) != 0)) != 0); + if (unlikely(__pyx_t_1)) { + + { /* enter inner scope */ + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 222, __pyx_L8_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __pyx_f_6gevent_5libev_8corecext__flags_to_list(__pyx_v_flags, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 222, __pyx_L8_error) + __Pyx_GOTREF(__pyx_t_3); + if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) { + __pyx_t_4 = __pyx_t_3; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0; + __pyx_t_6 = NULL; + } else { + __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 222, __pyx_L8_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 222, __pyx_L8_error) + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + for (;;) { + if (likely(!__pyx_t_6)) { + if (likely(PyList_CheckExact(__pyx_t_4))) { + if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_3 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 222, __pyx_L8_error) + #else + __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 222, __pyx_L8_error) + __Pyx_GOTREF(__pyx_t_3); + #endif + } else { + if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 222, __pyx_L8_error) + #else + __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 222, __pyx_L8_error) + __Pyx_GOTREF(__pyx_t_3); + #endif + } + } else { + __pyx_t_3 = __pyx_t_6(__pyx_t_4); + if (unlikely(!__pyx_t_3)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(0, 222, __pyx_L8_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_3); + } + __Pyx_XDECREF_SET(__pyx_8genexpr1__pyx_v_x, __pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __pyx_f_6gevent_5libev_8corecext__str_hex(__pyx_8genexpr1__pyx_v_x); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 222, __pyx_L8_error) + __Pyx_GOTREF(__pyx_t_3); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 222, __pyx_L8_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_x); __pyx_8genexpr1__pyx_v_x = 0; + goto __pyx_L11_exit_scope; + __pyx_L8_error:; + __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_x); __pyx_8genexpr1__pyx_v_x = 0; + goto __pyx_L1_error; + __pyx_L11_exit_scope:; + } /* exit inner scope */ + __pyx_v_as_list = ((PyObject*)__pyx_t_2); + __pyx_t_2 = 0; + + __pyx_t_2 = __Pyx_PyString_Join(__pyx_kp_s__3, __pyx_v_as_list); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 223, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Unsupported_backend_s, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 223, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 223, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 223, __pyx_L1_error) + + } + + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("gevent.libev.corecext._check_flags", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_as_list); + __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_x); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_9_check_flags(PyObject *__pyx_self, PyObject *__pyx_arg_flags); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_9_check_flags(PyObject *__pyx_self, PyObject *__pyx_arg_flags) { + unsigned int __pyx_v_flags; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_check_flags (wrapper)", 0); + assert(__pyx_arg_flags); { + __pyx_v_flags = __Pyx_PyInt_As_unsigned_int(__pyx_arg_flags); if (unlikely((__pyx_v_flags == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 214, __pyx_L3_error) + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.libev.corecext._check_flags", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_8_check_flags(__pyx_self, ((unsigned int)__pyx_v_flags)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_8_check_flags(CYTHON_UNUSED PyObject *__pyx_self, unsigned int __pyx_v_flags) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("_check_flags", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6gevent_5libev_8corecext__check_flags(__pyx_v_flags, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 214, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.libev.corecext._check_flags", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +static PyObject *__pyx_pw_6gevent_5libev_8corecext_11_events_to_str(PyObject *__pyx_self, PyObject *__pyx_arg_events); /*proto*/ +static PyObject *__pyx_f_6gevent_5libev_8corecext__events_to_str(int __pyx_v_events, CYTHON_UNUSED int __pyx_skip_dispatch) { + PyObject *__pyx_v_result = 0; + int __pyx_v_c_flag; + PyObject *__pyx_v_flag = NULL; + PyObject *__pyx_v_string = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + PyObject *(*__pyx_t_4)(PyObject *); + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *(*__pyx_t_8)(PyObject *); + int __pyx_t_9; + int __pyx_t_10; + int __pyx_t_11; + __Pyx_RefNannySetupContext("_events_to_str", 0); + + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 227, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_result = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_events); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 229, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { + __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; + __pyx_t_4 = NULL; + } else { + __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 229, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 229, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + for (;;) { + if (likely(!__pyx_t_4)) { + if (likely(PyList_CheckExact(__pyx_t_2))) { + if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 229, __pyx_L1_error) + #else + __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 229, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + #endif + } else { + if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 229, __pyx_L1_error) + #else + __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 229, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + #endif + } + } else { + __pyx_t_1 = __pyx_t_4(__pyx_t_2); + if (unlikely(!__pyx_t_1)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(0, 229, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_1); + } + if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { + PyObject* sequence = __pyx_t_1; + Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + __PYX_ERR(0, 229, __pyx_L1_error) + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_5 = PyList_GET_ITEM(sequence, 0); + __pyx_t_6 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(__pyx_t_6); + #else + __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 229, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 229, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_7 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 229, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; + index = 0; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L5_unpacking_failed; + __Pyx_GOTREF(__pyx_t_5); + index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed; + __Pyx_GOTREF(__pyx_t_6); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(0, 229, __pyx_L1_error) + __pyx_t_8 = NULL; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + goto __pyx_L6_unpacking_done; + __pyx_L5_unpacking_failed:; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_8 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + __PYX_ERR(0, 229, __pyx_L1_error) + __pyx_L6_unpacking_done:; + } + __Pyx_XDECREF_SET(__pyx_v_flag, __pyx_t_5); + __pyx_t_5 = 0; + __Pyx_XDECREF_SET(__pyx_v_string, __pyx_t_6); + __pyx_t_6 = 0; + + __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_v_flag); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 230, __pyx_L1_error) + __pyx_v_c_flag = __pyx_t_9; + + __pyx_t_10 = ((__pyx_v_events & __pyx_v_c_flag) != 0); + if (__pyx_t_10) { + + __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_string); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 232, __pyx_L1_error) + + __pyx_v_events = (__pyx_v_events & (~__pyx_v_c_flag)); + + } + + __pyx_t_10 = ((!(__pyx_v_events != 0)) != 0); + if (__pyx_t_10) { + + goto __pyx_L4_break; + + } + + } + __pyx_L4_break:; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + __pyx_t_10 = (__pyx_v_events != 0); + if (__pyx_t_10) { + + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_events); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 237, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_hex, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 237, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_1); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 237, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + } + + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyString_Join(__pyx_kp_s__3, __pyx_v_result); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 238, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("gevent.libev.corecext._events_to_str", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XDECREF(__pyx_v_flag); + __Pyx_XDECREF(__pyx_v_string); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_11_events_to_str(PyObject *__pyx_self, PyObject *__pyx_arg_events); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_11_events_to_str(PyObject *__pyx_self, PyObject *__pyx_arg_events) { + int __pyx_v_events; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_events_to_str (wrapper)", 0); + assert(__pyx_arg_events); { + __pyx_v_events = __Pyx_PyInt_As_int(__pyx_arg_events); if (unlikely((__pyx_v_events == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 226, __pyx_L3_error) + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.libev.corecext._events_to_str", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_10_events_to_str(__pyx_self, ((int)__pyx_v_events)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_10_events_to_str(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_events) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("_events_to_str", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6gevent_5libev_8corecext__events_to_str(__pyx_v_events, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 226, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.libev.corecext._events_to_str", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_13supported_backends(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyMethodDef __pyx_mdef_6gevent_5libev_8corecext_13supported_backends = {"supported_backends", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_13supported_backends, METH_NOARGS, 0}; +static PyObject *__pyx_pw_6gevent_5libev_8corecext_13supported_backends(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("supported_backends (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_12supported_backends(__pyx_self); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_12supported_backends(CYTHON_UNUSED PyObject *__pyx_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("supported_backends", 0); + + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6gevent_5libev_8corecext__flags_to_list(ev_supported_backends(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 242, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.libev.corecext.supported_backends", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_15recommended_backends(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyMethodDef __pyx_mdef_6gevent_5libev_8corecext_15recommended_backends = {"recommended_backends", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_15recommended_backends, METH_NOARGS, 0}; +static PyObject *__pyx_pw_6gevent_5libev_8corecext_15recommended_backends(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("recommended_backends (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_14recommended_backends(__pyx_self); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_14recommended_backends(CYTHON_UNUSED PyObject *__pyx_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("recommended_backends", 0); + + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6gevent_5libev_8corecext__flags_to_list(ev_recommended_backends(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 246, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.libev.corecext.recommended_backends", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_17embeddable_backends(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyMethodDef __pyx_mdef_6gevent_5libev_8corecext_17embeddable_backends = {"embeddable_backends", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_17embeddable_backends, METH_NOARGS, 0}; +static PyObject *__pyx_pw_6gevent_5libev_8corecext_17embeddable_backends(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("embeddable_backends (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_16embeddable_backends(__pyx_self); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_16embeddable_backends(CYTHON_UNUSED PyObject *__pyx_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("embeddable_backends", 0); + + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6gevent_5libev_8corecext__flags_to_list(ev_embeddable_backends(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 250, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.libev.corecext.embeddable_backends", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_19time(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyMethodDef __pyx_mdef_6gevent_5libev_8corecext_19time = {"time", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_19time, METH_NOARGS, 0}; +static PyObject *__pyx_pw_6gevent_5libev_8corecext_19time(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("time (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_18time(__pyx_self); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_18time(CYTHON_UNUSED PyObject *__pyx_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("time", 0); + + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyFloat_FromDouble(ev_time()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 254, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.libev.corecext.time", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +static int __pyx_f_6gevent_5libev_8corecext__check_loop(struct PyGeventLoopObject *__pyx_v_loop) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("_check_loop", 0); + + __pyx_t_1 = ((!(__pyx_v_loop->_ptr != 0)) != 0); + if (unlikely(__pyx_t_1)) { + + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 258, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 258, __pyx_L1_error) + + } + + __pyx_r = 1; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent.libev.corecext._check_loop", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_8callback_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_8callback_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_callback = 0; + PyObject *__pyx_v_args = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_callback,&__pyx_n_s_args,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_callback)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(0, 268, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 268, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_callback = values[0]; + __pyx_v_args = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 268, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.libev.corecext.callback.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_8callback___init__(((struct PyGeventCallbackObject *)__pyx_v_self), __pyx_v_callback, __pyx_v_args); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_8callback___init__(struct PyGeventCallbackObject *__pyx_v_self, PyObject *__pyx_v_callback, PyObject *__pyx_v_args) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__init__", 0); + + __Pyx_INCREF(__pyx_v_callback); + __Pyx_GIVEREF(__pyx_v_callback); + __Pyx_GOTREF(__pyx_v_self->callback); + __Pyx_DECREF(__pyx_v_self->callback); + __pyx_v_self->callback = __pyx_v_callback; + + if (!(likely(PyTuple_CheckExact(__pyx_v_args))||((__pyx_v_args) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v_args)->tp_name), 0))) __PYX_ERR(0, 270, __pyx_L1_error) + __pyx_t_1 = __pyx_v_args; + __Pyx_INCREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_self->args); + __Pyx_DECREF(__pyx_v_self->args); + __pyx_v_self->args = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.libev.corecext.callback.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_8callback_3stop(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_8callback_3stop(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stop (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_8callback_2stop(((struct PyGeventCallbackObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_8callback_2stop(struct PyGeventCallbackObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stop", 0); + + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->callback); + __Pyx_DECREF(__pyx_v_self->callback); + __pyx_v_self->callback = Py_None; + + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->args); + __Pyx_DECREF(__pyx_v_self->args); + __pyx_v_self->args = ((PyObject*)Py_None); + + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_8callback_5__nonzero__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_8callback_5__nonzero__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__nonzero__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_8callback_4__nonzero__(((struct PyGeventCallbackObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_8callback_4__nonzero__(struct PyGeventCallbackObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("__nonzero__", 0); + + __pyx_t_1 = (__pyx_v_self->args != ((PyObject*)Py_None)); + __pyx_r = __pyx_t_1; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_8callback_7pending_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_8callback_7pending_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_8callback_7pending___get__(((struct PyGeventCallbackObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_8callback_7pending___get__(struct PyGeventCallbackObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = (__pyx_v_self->callback != Py_None); + __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 289, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent.libev.corecext.callback.pending.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_8callback_7__repr__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_8callback_7__repr__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_8callback_6__repr__(((struct PyGeventCallbackObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_8callback_6__repr__(struct PyGeventCallbackObject *__pyx_v_self) { + PyObject *__pyx_v_format = NULL; + PyObject *__pyx_v_result = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + int __pyx_t_6; + int __pyx_t_7; + int __pyx_t_8; + char const *__pyx_t_9; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + PyObject *__pyx_t_14 = NULL; + PyObject *__pyx_t_15 = NULL; + __Pyx_RefNannySetupContext("__repr__", 0); + + __pyx_t_1 = ((Py_ReprEnter(((PyObject *)__pyx_v_self)) != 0) != 0); + if (__pyx_t_1) { + + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_kp_s__5); + __pyx_r = __pyx_kp_s__5; + goto __pyx_L0; + + } + + /*try:*/ { + + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 295, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 295, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_format = __pyx_t_2; + __pyx_t_2 = 0; + + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 296, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 296, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 296, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 296, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2); + __Pyx_INCREF(__pyx_v_format); + __Pyx_GIVEREF(__pyx_v_format); + PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_format); + __pyx_t_3 = 0; + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_s_at_0x_x_s, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 296, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_result = ((PyObject*)__pyx_t_2); + __pyx_t_2 = 0; + + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_pending); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 297, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 297, __pyx_L5_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_1) { + + __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_kp_s_pending_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 298, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_2)); + __pyx_t_2 = 0; + + } + + __pyx_t_1 = (__pyx_v_self->callback != Py_None); + __pyx_t_5 = (__pyx_t_1 != 0); + if (__pyx_t_5) { + + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 300, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_self->callback); + __Pyx_GIVEREF(__pyx_v_self->callback); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_self->callback); + __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_callback_r, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 300, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 300, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_2)); + __pyx_t_2 = 0; + + } + + __pyx_t_5 = (__pyx_v_self->args != ((PyObject*)Py_None)); + __pyx_t_1 = (__pyx_t_5 != 0); + if (__pyx_t_1) { + + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 302, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_self->args); + __Pyx_GIVEREF(__pyx_v_self->args); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_self->args); + __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_args_r, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 302, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 302, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_2)); + __pyx_t_2 = 0; + + } + + __pyx_t_5 = (__pyx_v_self->callback == Py_None); + __pyx_t_6 = (__pyx_t_5 != 0); + if (__pyx_t_6) { + } else { + __pyx_t_1 = __pyx_t_6; + goto __pyx_L11_bool_binop_done; + } + __pyx_t_6 = (__pyx_v_self->args == ((PyObject*)Py_None)); + __pyx_t_5 = (__pyx_t_6 != 0); + __pyx_t_1 = __pyx_t_5; + __pyx_L11_bool_binop_done:; + if (__pyx_t_1) { + + __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_kp_s_stopped); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 304, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_2)); + __pyx_t_2 = 0; + + } + + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyNumber_Add(__pyx_v_result, __pyx_kp_s__6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 305, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L4_return; + } + + /*finally:*/ { + __pyx_L5_error:; + /*exception exit:*/{ + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15); + if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12) < 0)) __Pyx_ErrFetch(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12); + __Pyx_XGOTREF(__pyx_t_10); + __Pyx_XGOTREF(__pyx_t_11); + __Pyx_XGOTREF(__pyx_t_12); + __Pyx_XGOTREF(__pyx_t_13); + __Pyx_XGOTREF(__pyx_t_14); + __Pyx_XGOTREF(__pyx_t_15); + __pyx_t_7 = __pyx_lineno; __pyx_t_8 = __pyx_clineno; __pyx_t_9 = __pyx_filename; + { + Py_ReprLeave(((PyObject *)__pyx_v_self)); + } + if (PY_MAJOR_VERSION >= 3) { + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_XGIVEREF(__pyx_t_15); + __Pyx_ExceptionReset(__pyx_t_13, __pyx_t_14, __pyx_t_15); + } + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_XGIVEREF(__pyx_t_12); + __Pyx_ErrRestore(__pyx_t_10, __pyx_t_11, __pyx_t_12); + __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; + __pyx_lineno = __pyx_t_7; __pyx_clineno = __pyx_t_8; __pyx_filename = __pyx_t_9; + goto __pyx_L1_error; + } + __pyx_L4_return: { + __pyx_t_15 = __pyx_r; + __pyx_r = 0; + Py_ReprLeave(((PyObject *)__pyx_v_self)); + __pyx_r = __pyx_t_15; + __pyx_t_15 = 0; + goto __pyx_L0; + } + } + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("gevent.libev.corecext.callback.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_format); + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_8callback_9_format(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_8callback_9_format(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_format (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_8callback_8_format(((struct PyGeventCallbackObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_8callback_8_format(CYTHON_UNUSED struct PyGeventCallbackObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_format", 0); + + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_kp_s__7); + __pyx_r = __pyx_kp_s__7; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_8callback_8callback_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_8callback_8callback_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_8callback_8callback___get__(((struct PyGeventCallbackObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_8callback_8callback___get__(struct PyGeventCallbackObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->callback); + __pyx_r = __pyx_v_self->callback; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_8callback_8callback_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_8callback_8callback_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_8callback_8callback_2__set__(((struct PyGeventCallbackObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_8callback_8callback_2__set__(struct PyGeventCallbackObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__", 0); + __Pyx_INCREF(__pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + __Pyx_GOTREF(__pyx_v_self->callback); + __Pyx_DECREF(__pyx_v_self->callback); + __pyx_v_self->callback = __pyx_v_value; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_8callback_8callback_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_8callback_8callback_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_8callback_8callback_4__del__(((struct PyGeventCallbackObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_8callback_8callback_4__del__(struct PyGeventCallbackObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->callback); + __Pyx_DECREF(__pyx_v_self->callback); + __pyx_v_self->callback = Py_None; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_8callback_4args_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_8callback_4args_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_8callback_4args___get__(((struct PyGeventCallbackObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_8callback_4args___get__(struct PyGeventCallbackObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->args); + __pyx_r = __pyx_v_self->args; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_8callback_4args_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_8callback_4args_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_8callback_4args_2__set__(((struct PyGeventCallbackObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_8callback_4args_2__set__(struct PyGeventCallbackObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__set__", 0); + if (!(likely(PyTuple_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v_value)->tp_name), 0))) __PYX_ERR(0, 265, __pyx_L1_error) + __pyx_t_1 = __pyx_v_value; + __Pyx_INCREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_self->args); + __Pyx_DECREF(__pyx_v_self->args); + __pyx_v_self->args = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.libev.corecext.callback.args.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_8callback_4args_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_8callback_4args_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_8callback_4args_4__del__(((struct PyGeventCallbackObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_8callback_4args_4__del__(struct PyGeventCallbackObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->args); + __Pyx_DECREF(__pyx_v_self->args); + __pyx_v_self->args = ((PyObject*)Py_None); + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_12CallbackFIFO_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_12CallbackFIFO_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { + __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;} + if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1; + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_12CallbackFIFO___init__(((struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_12CallbackFIFO___init__(struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__", 0); + + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->head); + __Pyx_DECREF(((PyObject *)__pyx_v_self->head)); + __pyx_v_self->head = ((struct PyGeventCallbackObject *)Py_None); + + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->tail); + __Pyx_DECREF(((PyObject *)__pyx_v_self->tail)); + __pyx_v_self->tail = ((struct PyGeventCallbackObject *)Py_None); + + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +static CYTHON_INLINE struct PyGeventCallbackObject *__pyx_f_6gevent_5libev_8corecext_12CallbackFIFO_popleft(struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *__pyx_v_self) { + struct PyGeventCallbackObject *__pyx_v_head = 0; + struct PyGeventCallbackObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + __Pyx_RefNannySetupContext("popleft", 0); + + __pyx_t_1 = ((PyObject *)__pyx_v_self->head); + __Pyx_INCREF(__pyx_t_1); + __pyx_v_head = ((struct PyGeventCallbackObject *)__pyx_t_1); + __pyx_t_1 = 0; + + __pyx_t_1 = ((PyObject *)__pyx_v_head->next); + __Pyx_INCREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_self->head); + __Pyx_DECREF(((PyObject *)__pyx_v_self->head)); + __pyx_v_self->head = ((struct PyGeventCallbackObject *)__pyx_t_1); + __pyx_t_1 = 0; + + __pyx_t_3 = (__pyx_v_self->head == __pyx_v_self->tail); + __pyx_t_4 = (__pyx_t_3 != 0); + if (!__pyx_t_4) { + } else { + __pyx_t_2 = __pyx_t_4; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_4 = (((PyObject *)__pyx_v_self->head) == Py_None); + __pyx_t_3 = (__pyx_t_4 != 0); + __pyx_t_2 = __pyx_t_3; + __pyx_L4_bool_binop_done:; + if (__pyx_t_2) { + + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->tail); + __Pyx_DECREF(((PyObject *)__pyx_v_self->tail)); + __pyx_v_self->tail = ((struct PyGeventCallbackObject *)Py_None); + + } + + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_head->next); + __Pyx_DECREF(((PyObject *)__pyx_v_head->next)); + __pyx_v_head->next = ((struct PyGeventCallbackObject *)Py_None); + + __Pyx_XDECREF(((PyObject *)__pyx_r)); + __Pyx_INCREF(((PyObject *)__pyx_v_head)); + __pyx_r = __pyx_v_head; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_head); + __Pyx_XGIVEREF((PyObject *)__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +static CYTHON_INLINE PyObject *__pyx_f_6gevent_5libev_8corecext_12CallbackFIFO_append(struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *__pyx_v_self, struct PyGeventCallbackObject *__pyx_v_new_tail) { + struct PyGeventCallbackObject *__pyx_v_old_tail = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("append", 0); + + #ifndef CYTHON_WITHOUT_ASSERTIONS + if (unlikely(!Py_OptimizeFlag)) { + __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_new_tail->next)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 334, __pyx_L1_error) + if (unlikely(!((!__pyx_t_1) != 0))) { + PyErr_SetNone(PyExc_AssertionError); + __PYX_ERR(0, 334, __pyx_L1_error) + } + } + #endif + + __pyx_t_1 = (((PyObject *)__pyx_v_self->tail) == Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + __pyx_t_2 = (((PyObject *)__pyx_v_self->head) == Py_None); + __pyx_t_1 = (__pyx_t_2 != 0); + if (__pyx_t_1) { + + __Pyx_INCREF(((PyObject *)__pyx_v_new_tail)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_new_tail)); + __Pyx_GOTREF(__pyx_v_self->head); + __Pyx_DECREF(((PyObject *)__pyx_v_self->head)); + __pyx_v_self->head = __pyx_v_new_tail; + + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + + } + + __pyx_t_3 = ((PyObject *)__pyx_v_self->head); + __Pyx_INCREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __Pyx_GOTREF(__pyx_v_self->tail); + __Pyx_DECREF(((PyObject *)__pyx_v_self->tail)); + __pyx_v_self->tail = ((struct PyGeventCallbackObject *)__pyx_t_3); + __pyx_t_3 = 0; + + } + + #ifndef CYTHON_WITHOUT_ASSERTIONS + if (unlikely(!Py_OptimizeFlag)) { + __pyx_t_1 = (((PyObject *)__pyx_v_self->head) != Py_None); + if (unlikely(!(__pyx_t_1 != 0))) { + PyErr_SetNone(PyExc_AssertionError); + __PYX_ERR(0, 344, __pyx_L1_error) + } + } + #endif + + __pyx_t_3 = ((PyObject *)__pyx_v_self->tail); + __Pyx_INCREF(__pyx_t_3); + __pyx_v_old_tail = ((struct PyGeventCallbackObject *)__pyx_t_3); + __pyx_t_3 = 0; + + __Pyx_INCREF(((PyObject *)__pyx_v_new_tail)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_new_tail)); + __Pyx_GOTREF(__pyx_v_old_tail->next); + __Pyx_DECREF(((PyObject *)__pyx_v_old_tail->next)); + __pyx_v_old_tail->next = __pyx_v_new_tail; + + __Pyx_INCREF(((PyObject *)__pyx_v_new_tail)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_new_tail)); + __Pyx_GOTREF(__pyx_v_self->tail); + __Pyx_DECREF(((PyObject *)__pyx_v_self->tail)); + __pyx_v_self->tail = __pyx_v_new_tail; + + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("gevent.libev.corecext.CallbackFIFO.append", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_old_tail); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_12CallbackFIFO_3__nonzero__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_12CallbackFIFO_3__nonzero__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__nonzero__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_12CallbackFIFO_2__nonzero__(((struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_12CallbackFIFO_2__nonzero__(struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("__nonzero__", 0); + + __pyx_t_1 = (((PyObject *)__pyx_v_self->head) != Py_None); + __pyx_r = __pyx_t_1; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static Py_ssize_t __pyx_pw_6gevent_5libev_8corecext_12CallbackFIFO_5__len__(PyObject *__pyx_v_self); /*proto*/ +static Py_ssize_t __pyx_pw_6gevent_5libev_8corecext_12CallbackFIFO_5__len__(PyObject *__pyx_v_self) { + Py_ssize_t __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__len__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_12CallbackFIFO_4__len__(((struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static Py_ssize_t __pyx_pf_6gevent_5libev_8corecext_12CallbackFIFO_4__len__(struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *__pyx_v_self) { + Py_ssize_t __pyx_v_count; + struct PyGeventCallbackObject *__pyx_v_head = NULL; + Py_ssize_t __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + __Pyx_RefNannySetupContext("__len__", 0); + + __pyx_v_count = 0; + + __pyx_t_1 = ((PyObject *)__pyx_v_self->head); + __Pyx_INCREF(__pyx_t_1); + __pyx_v_head = ((struct PyGeventCallbackObject *)__pyx_t_1); + __pyx_t_1 = 0; + + while (1) { + __pyx_t_2 = (((PyObject *)__pyx_v_head) != Py_None); + __pyx_t_3 = (__pyx_t_2 != 0); + if (!__pyx_t_3) break; + + __pyx_v_count = (__pyx_v_count + 1); + + __pyx_t_1 = ((PyObject *)__pyx_v_head->next); + __Pyx_INCREF(__pyx_t_1); + __Pyx_DECREF_SET(__pyx_v_head, ((struct PyGeventCallbackObject *)__pyx_t_1)); + __pyx_t_1 = 0; + } + + __pyx_r = __pyx_v_count; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_head); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_12CallbackFIFO_7__iter__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_12CallbackFIFO_7__iter__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_12CallbackFIFO_6__iter__(((struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_12CallbackFIFO_6__iter__(struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *__pyx_v_self) { + PyObject *__pyx_v_objects = 0; + struct PyGeventCallbackObject *__pyx_v_head = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + __Pyx_RefNannySetupContext("__iter__", 0); + + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 361, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_objects = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + __pyx_t_1 = ((PyObject *)__pyx_v_self->head); + __Pyx_INCREF(__pyx_t_1); + __pyx_v_head = ((struct PyGeventCallbackObject *)__pyx_t_1); + __pyx_t_1 = 0; + + while (1) { + __pyx_t_2 = (((PyObject *)__pyx_v_head) != Py_None); + __pyx_t_3 = (__pyx_t_2 != 0); + if (!__pyx_t_3) break; + + __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_objects, ((PyObject *)__pyx_v_head)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 364, __pyx_L1_error) + + __pyx_t_1 = ((PyObject *)__pyx_v_head->next); + __Pyx_INCREF(__pyx_t_1); + __Pyx_DECREF_SET(__pyx_v_head, ((struct PyGeventCallbackObject *)__pyx_t_1)); + __pyx_t_1 = 0; + } + + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyObject_GetIter(__pyx_v_objects); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 366, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.libev.corecext.CallbackFIFO.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_objects); + __Pyx_XDECREF((PyObject *)__pyx_v_head); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +static int __pyx_f_6gevent_5libev_8corecext_12CallbackFIFO_has_callbacks(struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("has_callbacks", 0); + + __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_self->head)); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 369, __pyx_L1_error) + __pyx_r = __pyx_t_1; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_WriteUnraisable("gevent.libev.corecext.CallbackFIFO.has_callbacks", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_12CallbackFIFO_9__repr__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_12CallbackFIFO_9__repr__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_12CallbackFIFO_8__repr__(((struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_12CallbackFIFO_8__repr__(struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + __Pyx_RefNannySetupContext("__repr__", 0); + + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 372, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_self)); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 372, __pyx_L1_error) + __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 372, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 372, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); + __Pyx_INCREF(((PyObject *)__pyx_v_self->head)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self->head)); + PyTuple_SET_ITEM(__pyx_t_4, 2, ((PyObject *)__pyx_v_self->head)); + __Pyx_INCREF(((PyObject *)__pyx_v_self->tail)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self->tail)); + PyTuple_SET_ITEM(__pyx_t_4, 3, ((PyObject *)__pyx_v_self->tail)); + __pyx_t_1 = 0; + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_callbacks_r_len_d_head_r_tail_r, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 372, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("gevent.libev.corecext.CallbackFIFO.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_4loop_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_4loop_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_flags = 0; + PyObject *__pyx_v_default = 0; + intptr_t __pyx_v_ptr; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_flags_2,&__pyx_n_s_default,&__pyx_n_s_ptr,0}; + PyObject* values[3] = {0,0,0}; + values[0] = ((PyObject *)Py_None); + values[1] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flags_2); + if (value) { values[0] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 1: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_default); + if (value) { values[1] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 2: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ptr); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 397, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_flags = values[0]; + __pyx_v_default = values[1]; + if (values[2]) { + __pyx_v_ptr = __Pyx_PyIndex_AsSsize_t(values[2]); if (unlikely((__pyx_v_ptr == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 397, __pyx_L3_error) + } else { + __pyx_v_ptr = ((intptr_t)0); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 397, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.libev.corecext.loop.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop___cinit__(((struct PyGeventLoopObject *)__pyx_v_self), __pyx_v_flags, __pyx_v_default, __pyx_v_ptr); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_4loop___cinit__(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_flags, PyObject *__pyx_v_default, intptr_t __pyx_v_ptr) { + unsigned int __pyx_v_c_flags; + CYTHON_UNUSED PyObject *__pyx_v_old_handler = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + unsigned int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + __Pyx_RefNannySetupContext("__cinit__", 0); + __Pyx_INCREF(__pyx_v_default); + + __pyx_v_self->starting_timer_may_update_loop_time = 0; + + __pyx_v_self->_default = 0; + + ev_prepare_init((&__pyx_v_self->_prepare), ((void *)gevent_run_callbacks)); + + ev_timer_init((&__pyx_v_self->_periodic_signal_checker), ((void *)gevent_periodic_signal_check), 0.3, 0.3); + + ev_timer_init((&__pyx_v_self->_timer0), ((void *)gevent_noop), 0.0, 0.0); + + __Pyx_INCREF(Py_None); + __pyx_v_old_handler = Py_None; + + __pyx_t_1 = (__pyx_v_ptr != 0); + if (__pyx_t_1) { + + __pyx_v_self->_ptr = ((struct ev_loop *)__pyx_v_ptr); + + __pyx_v_self->_default = ev_is_default_loop(__pyx_v_self->_ptr); + + goto __pyx_L3; + } + + /*else*/ { + __pyx_t_2 = __pyx_f_6gevent_5libev_8corecext__flags_to_int(__pyx_v_flags, 0); if (unlikely(__pyx_t_2 == ((unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 415, __pyx_L1_error) + __pyx_v_c_flags = __pyx_t_2; + + __pyx_t_3 = __pyx_f_6gevent_5libev_8corecext__check_flags(__pyx_v_c_flags, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 416, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + __pyx_v_c_flags = (__pyx_v_c_flags | EVFLAG_NOENV); + + __pyx_v_c_flags = (__pyx_v_c_flags | EVFLAG_FORKCHECK); + + __pyx_t_1 = (__pyx_v_default == Py_None); + __pyx_t_4 = (__pyx_t_1 != 0); + if (__pyx_t_4) { + + __Pyx_INCREF(Py_True); + __Pyx_DECREF_SET(__pyx_v_default, Py_True); + + } + + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_default); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 421, __pyx_L1_error) + if (__pyx_t_4) { + + __pyx_v_self->_default = 1; + + __pyx_v_self->_ptr = gevent_ev_default_loop(__pyx_v_c_flags); + + __pyx_t_4 = ((!(__pyx_v_self->_ptr != 0)) != 0); + if (unlikely(__pyx_t_4)) { + + __pyx_t_3 = __Pyx_PyInt_From_unsigned_int(__pyx_v_c_flags); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 425, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 425, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_ev_default_loop_s_failed, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 425, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_SystemError, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 425, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __PYX_ERR(0, 425, __pyx_L1_error) + + } + + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_sys); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 426, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_platform); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 426, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_t_3, __pyx_n_s_win32, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 426, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_4) { + + ev_timer_start(__pyx_v_self->_ptr, (&__pyx_v_self->_periodic_signal_checker)); + + ev_unref(__pyx_v_self->_ptr); + + } + + goto __pyx_L5; + } + + /*else*/ { + __pyx_v_self->_ptr = ev_loop_new(__pyx_v_c_flags); + + __pyx_t_4 = ((!(__pyx_v_self->_ptr != 0)) != 0); + if (unlikely(__pyx_t_4)) { + + __pyx_t_3 = __Pyx_PyInt_From_unsigned_int(__pyx_v_c_flags); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 432, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 432, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_ev_loop_new_s_failed, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 432, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_SystemError, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 432, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_5, 0, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __PYX_ERR(0, 432, __pyx_L1_error) + + } + } + __pyx_L5:; + + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_default); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 433, __pyx_L1_error) + if (!__pyx_t_1) { + } else { + __pyx_t_4 = __pyx_t_1; + goto __pyx_L10_bool_binop_done; + } + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_SYSERR_CALLBACK); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 433, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_1 = (__pyx_t_5 == Py_None); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = (__pyx_t_1 != 0); + __pyx_t_4 = __pyx_t_6; + __pyx_L10_bool_binop_done:; + if (__pyx_t_4) { + + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_handle_syserr); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 434, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = __pyx_f_6gevent_5libev_8corecext_set_syserr_cb(__pyx_t_5, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 434, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + } + } + __pyx_L3:; + + ev_set_userdata(__pyx_v_self->_ptr, __pyx_v_self->_ptr); + + ev_prepare_start(__pyx_v_self->_ptr, (&__pyx_v_self->_prepare)); + + ev_unref(__pyx_v_self->_ptr); + + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("gevent.libev.corecext.loop.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_old_handler); + __Pyx_XDECREF(__pyx_v_default); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_4loop_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_4loop_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + CYTHON_UNUSED PyObject *__pyx_v_flags = 0; + CYTHON_UNUSED PyObject *__pyx_v_default = 0; + CYTHON_UNUSED intptr_t __pyx_v_ptr; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_flags_2,&__pyx_n_s_default,&__pyx_n_s_ptr,0}; + PyObject* values[3] = {0,0,0}; + values[0] = ((PyObject *)Py_None); + values[1] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flags_2); + if (value) { values[0] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 1: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_default); + if (value) { values[1] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 2: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ptr); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 442, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_flags = values[0]; + __pyx_v_default = values[1]; + if (values[2]) { + __pyx_v_ptr = __Pyx_PyIndex_AsSsize_t(values[2]); if (unlikely((__pyx_v_ptr == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 442, __pyx_L3_error) + } else { + __pyx_v_ptr = ((intptr_t)0); + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 442, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.libev.corecext.loop.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_2__init__(((struct PyGeventLoopObject *)__pyx_v_self), __pyx_v_flags, __pyx_v_default, __pyx_v_ptr); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_4loop_2__init__(struct PyGeventLoopObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_flags, CYTHON_UNUSED PyObject *__pyx_v_default, CYTHON_UNUSED intptr_t __pyx_v_ptr) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__init__", 0); + + __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_6gevent_5libev_8corecext_CallbackFIFO)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 443, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_self->_callbacks); + __Pyx_DECREF(((PyObject *)__pyx_v_self->_callbacks)); + __pyx_v_self->_callbacks = ((struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *)__pyx_t_1); + __pyx_t_1 = 0; + + __pyx_v_self->approx_timer_resolution = 0.00001; + + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.libev.corecext.loop.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +static PyObject *__pyx_f_6gevent_5libev_8corecext_4loop__run_callbacks(struct PyGeventLoopObject *__pyx_v_self) { + struct PyGeventCallbackObject *__pyx_v_cb = 0; + int __pyx_v_count; + ev_tstamp __pyx_v_now; + ev_tstamp __pyx_v_expiration; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + ev_tstamp __pyx_t_4; + int __pyx_t_5; + int __pyx_t_6; + int __pyx_t_7; + int __pyx_t_8; + int __pyx_t_9; + char const *__pyx_t_10; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + PyObject *__pyx_t_14 = NULL; + PyObject *__pyx_t_15 = NULL; + PyObject *__pyx_t_16 = NULL; + __Pyx_RefNannySetupContext("_run_callbacks", 0); + + __pyx_v_count = 50; + + __pyx_v_self->starting_timer_may_update_loop_time = 1; + + __pyx_v_now = ev_now(__pyx_v_self->_ptr); + + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_getswitchinterval); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 453, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 453, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_4 == ((ev_tstamp)-1)) && PyErr_Occurred())) __PYX_ERR(0, 453, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_expiration = (__pyx_v_now + ((ev_tstamp)__pyx_t_4)); + + /*try:*/ { + + ev_timer_stop(__pyx_v_self->_ptr, (&__pyx_v_self->_timer0)); + + while (1) { + __pyx_t_5 = (((PyObject *)__pyx_v_self->_callbacks->head) != Py_None); + __pyx_t_6 = (__pyx_t_5 != 0); + if (!__pyx_t_6) break; + + __pyx_t_1 = ((PyObject *)__pyx_f_6gevent_5libev_8corecext_12CallbackFIFO_popleft(__pyx_v_self->_callbacks)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 458, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XDECREF_SET(__pyx_v_cb, ((struct PyGeventCallbackObject *)__pyx_t_1)); + __pyx_t_1 = 0; + + ev_unref(__pyx_v_self->_ptr); + + gevent_call(__pyx_v_self, __pyx_v_cb); + + __pyx_v_count = (__pyx_v_count - 1); + + __pyx_t_5 = ((__pyx_v_count == 0) != 0); + if (__pyx_t_5) { + } else { + __pyx_t_6 = __pyx_t_5; + goto __pyx_L9_bool_binop_done; + } + __pyx_t_5 = (((PyObject *)__pyx_v_self->_callbacks->head) != Py_None); + __pyx_t_7 = (__pyx_t_5 != 0); + __pyx_t_6 = __pyx_t_7; + __pyx_L9_bool_binop_done:; + if (__pyx_t_6) { + + __pyx_v_count = 50; + + ev_now_update(__pyx_v_self->_ptr); + + __pyx_t_6 = ((ev_now(__pyx_v_self->_ptr) >= __pyx_v_expiration) != 0); + if (__pyx_t_6) { + + __pyx_v_now = 0.0; + + goto __pyx_L7_break; + + } + + } + } + __pyx_L7_break:; + + __pyx_t_6 = ((__pyx_v_now != 0.0) != 0); + if (__pyx_t_6) { + + ev_now_update(__pyx_v_self->_ptr); + + } + + __pyx_t_6 = (((PyObject *)__pyx_v_self->_callbacks->head) != Py_None); + __pyx_t_7 = (__pyx_t_6 != 0); + if (__pyx_t_7) { + + ev_timer_start(__pyx_v_self->_ptr, (&__pyx_v_self->_timer0)); + + } + } + + /*finally:*/ { + /*normal exit:*/{ + __pyx_v_self->starting_timer_may_update_loop_time = 0; + goto __pyx_L5; + } + __pyx_L4_error:; + /*exception exit:*/{ + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_14, &__pyx_t_15, &__pyx_t_16); + if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13) < 0)) __Pyx_ErrFetch(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13); + __Pyx_XGOTREF(__pyx_t_11); + __Pyx_XGOTREF(__pyx_t_12); + __Pyx_XGOTREF(__pyx_t_13); + __Pyx_XGOTREF(__pyx_t_14); + __Pyx_XGOTREF(__pyx_t_15); + __Pyx_XGOTREF(__pyx_t_16); + __pyx_t_8 = __pyx_lineno; __pyx_t_9 = __pyx_clineno; __pyx_t_10 = __pyx_filename; + { + __pyx_v_self->starting_timer_may_update_loop_time = 0; + } + if (PY_MAJOR_VERSION >= 3) { + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_XGIVEREF(__pyx_t_15); + __Pyx_XGIVEREF(__pyx_t_16); + __Pyx_ExceptionReset(__pyx_t_14, __pyx_t_15, __pyx_t_16); + } + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_XGIVEREF(__pyx_t_12); + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_ErrRestore(__pyx_t_11, __pyx_t_12, __pyx_t_13); + __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; + __pyx_lineno = __pyx_t_8; __pyx_clineno = __pyx_t_9; __pyx_filename = __pyx_t_10; + goto __pyx_L1_error; + } + __pyx_L5:; + } + + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("gevent.libev.corecext.loop._run_callbacks", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_cb); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +static PyObject *__pyx_f_6gevent_5libev_8corecext_4loop__stop_watchers(struct PyGeventLoopObject *__pyx_v_self, struct ev_loop *__pyx_v_ptr) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("_stop_watchers", 0); + + __pyx_t_1 = ((!(__pyx_v_ptr != 0)) != 0); + if (__pyx_t_1) { + + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + + } + + __pyx_t_1 = (ev_is_active((&__pyx_v_self->_prepare)) != 0); + if (__pyx_t_1) { + + ev_ref(__pyx_v_ptr); + + ev_prepare_stop(__pyx_v_ptr, (&__pyx_v_self->_prepare)); + + } + + __pyx_t_1 = (ev_is_active((&__pyx_v_self->_periodic_signal_checker)) != 0); + if (__pyx_t_1) { + + ev_ref(__pyx_v_ptr); + + ev_timer_stop(__pyx_v_ptr, (&__pyx_v_self->_periodic_signal_checker)); + + } + + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_5destroy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_5destroy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("destroy (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_4destroy(((struct PyGeventLoopObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_4destroy(struct PyGeventLoopObject *__pyx_v_self) { + struct ev_loop *__pyx_v_ptr; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + struct ev_loop *__pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + __Pyx_RefNannySetupContext("destroy", 0); + + __pyx_t_1 = __pyx_v_self->_ptr; + __pyx_v_ptr = __pyx_t_1; + + __pyx_v_self->_ptr = NULL; + + __pyx_t_2 = (__pyx_v_ptr != 0); + if (__pyx_t_2) { + + __pyx_t_2 = ((!(ev_userdata(__pyx_v_ptr) != 0)) != 0); + if (__pyx_t_2) { + + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + + } + + ev_set_userdata(__pyx_v_ptr, NULL); + + __pyx_t_3 = ((struct __pyx_vtabstruct_6gevent_5libev_8corecext_loop *)__pyx_v_self->__pyx_vtab)->_stop_watchers(__pyx_v_self, __pyx_v_ptr); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 505, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_SYSERR_CALLBACK); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 506, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_handle_syserr); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 506, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 506, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 506, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_2) { + + __pyx_t_5 = __pyx_f_6gevent_5libev_8corecext_set_syserr_cb(Py_None, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 507, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + } + + ev_loop_destroy(__pyx_v_ptr); + + } + + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("gevent.libev.corecext.loop.destroy", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static void __pyx_pw_6gevent_5libev_8corecext_4loop_7__dealloc__(PyObject *__pyx_v_self); /*proto*/ +static void __pyx_pw_6gevent_5libev_8corecext_4loop_7__dealloc__(PyObject *__pyx_v_self) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); + __pyx_pf_6gevent_5libev_8corecext_4loop_6__dealloc__(((struct PyGeventLoopObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +static void __pyx_pf_6gevent_5libev_8corecext_4loop_6__dealloc__(struct PyGeventLoopObject *__pyx_v_self) { + struct ev_loop *__pyx_v_ptr; + __Pyx_RefNannyDeclarations + struct ev_loop *__pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("__dealloc__", 0); + + __pyx_t_1 = __pyx_v_self->_ptr; + __pyx_v_ptr = __pyx_t_1; + + __pyx_v_self->_ptr = NULL; + + __pyx_t_2 = ((__pyx_v_ptr != NULL) != 0); + if (__pyx_t_2) { + + __pyx_t_2 = ((!(ev_userdata(__pyx_v_ptr) != 0)) != 0); + if (__pyx_t_2) { + + goto __pyx_L0; + + } + + __pyx_t_3 = ((struct __pyx_vtabstruct_6gevent_5libev_8corecext_loop *)__pyx_v_self->__pyx_vtab)->_stop_watchers(__pyx_v_self, __pyx_v_ptr); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 517, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + __pyx_t_2 = ((!(__pyx_v_self->_default != 0)) != 0); + if (__pyx_t_2) { + + ev_loop_destroy(__pyx_v_ptr); + + ev_set_userdata(__pyx_v_ptr, NULL); + + } + + } + + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_WriteUnraisable("gevent.libev.corecext.loop.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); + __pyx_L0:; + __Pyx_RefNannyFinishContext(); +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_3ptr_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_3ptr_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_3ptr___get__(((struct PyGeventLoopObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_3ptr___get__(struct PyGeventLoopObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_self->_ptr)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 525, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.libev.corecext.loop.ptr.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_11WatcherType_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_11WatcherType_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_11WatcherType___get__(((struct PyGeventLoopObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_11WatcherType___get__(CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_ptype_6gevent_5libev_8corecext_watcher)); + __pyx_r = ((PyObject *)__pyx_ptype_6gevent_5libev_8corecext_watcher); + goto __pyx_L0; + + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_6MAXPRI_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_6MAXPRI_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_6MAXPRI___get__(((struct PyGeventLoopObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_6MAXPRI___get__(CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_int(EV_MAXPRI); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 533, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.libev.corecext.loop.MAXPRI.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_6MINPRI_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_6MINPRI_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_6MINPRI___get__(((struct PyGeventLoopObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_6MINPRI___get__(CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_int(EV_MINPRI); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 537, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.libev.corecext.loop.MINPRI.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_9_handle_syserr(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_9_handle_syserr(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_message = 0; + PyObject *__pyx_v_errno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_handle_syserr (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_message,&__pyx_n_s_errno,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_message)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_errno)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("_handle_syserr", 1, 2, 2, 1); __PYX_ERR(0, 539, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_handle_syserr") < 0)) __PYX_ERR(0, 539, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_message = values[0]; + __pyx_v_errno = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("_handle_syserr", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 539, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.libev.corecext.loop._handle_syserr", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_8_handle_syserr(((struct PyGeventLoopObject *)__pyx_v_self), __pyx_v_message, __pyx_v_errno); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_8_handle_syserr(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_message, PyObject *__pyx_v_errno) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + __Pyx_RefNannySetupContext("_handle_syserr", 0); + __Pyx_INCREF(__pyx_v_message); + + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_sys); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 540, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_version_info); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 540, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 540, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_int_3, Py_GE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 540, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 540, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_3) { + + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_message, __pyx_n_s_decode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 541, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_1, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 541, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF_SET(__pyx_v_message, __pyx_t_2); + __pyx_t_2 = 0; + + } + + __pyx_t_2 = PyNumber_Add(__pyx_v_message, __pyx_kp_s__8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 542, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_os); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 542, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_strerror); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 542, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_5, function); + } + } + __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_4, __pyx_v_errno) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_errno); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 542, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyNumber_Add(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 542, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_SystemError, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 542, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = ((struct __pyx_vtabstruct_6gevent_5libev_8corecext_loop *)__pyx_v_self->__pyx_vtab)->handle_error(__pyx_v_self, Py_None, __pyx_builtin_SystemError, __pyx_t_1, Py_None, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 542, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("gevent.libev.corecext.loop._handle_syserr", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_message); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_11handle_error(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_6gevent_5libev_8corecext_4loop_handle_error(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_context, PyObject *__pyx_v_type, PyObject *__pyx_v_value, PyObject *__pyx_v_tb, int __pyx_skip_dispatch) { + PyObject *__pyx_v_handle_error = 0; + PyObject *__pyx_v_error_handler = 0; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + int __pyx_t_8; + __Pyx_RefNannySetupContext("handle_error", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0; + if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self)))))); + else { + PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + #endif + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_handle_error); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 544, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_5libev_8corecext_4loop_11handle_error)) { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; + __pyx_t_5 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_5 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_3)) { + PyObject *__pyx_temp[5] = {__pyx_t_4, __pyx_v_context, __pyx_v_type, __pyx_v_value, __pyx_v_tb}; + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 4+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 544, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GOTREF(__pyx_t_2); + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { + PyObject *__pyx_temp[5] = {__pyx_t_4, __pyx_v_context, __pyx_v_type, __pyx_v_value, __pyx_v_tb}; + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 4+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 544, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GOTREF(__pyx_t_2); + } else + #endif + { + __pyx_t_6 = PyTuple_New(4+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 544, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (__pyx_t_4) { + __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL; + } + __Pyx_INCREF(__pyx_v_context); + __Pyx_GIVEREF(__pyx_v_context); + PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_context); + __Pyx_INCREF(__pyx_v_type); + __Pyx_GIVEREF(__pyx_v_type); + PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_type); + __Pyx_INCREF(__pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_v_value); + __Pyx_INCREF(__pyx_v_tb); + __Pyx_GIVEREF(__pyx_v_tb); + PyTuple_SET_ITEM(__pyx_t_6, 3+__pyx_t_5, __pyx_v_tb); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 544, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0; + if (unlikely(type_dict_guard != tp_dict_version)) { + tp_dict_version = obj_dict_version = 0; + } + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + } + #endif + } + + __pyx_t_1 = __pyx_v_self->error_handler; + __Pyx_INCREF(__pyx_t_1); + __pyx_v_error_handler = __pyx_t_1; + __pyx_t_1 = 0; + + __pyx_t_7 = (__pyx_v_error_handler != Py_None); + __pyx_t_8 = (__pyx_t_7 != 0); + if (__pyx_t_8) { + + __pyx_t_1 = __Pyx_GetAttr3(__pyx_v_error_handler, __pyx_n_s_handle_error, __pyx_v_error_handler); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 549, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_handle_error = __pyx_t_1; + __pyx_t_1 = 0; + + __Pyx_INCREF(__pyx_v_handle_error); + __pyx_t_2 = __pyx_v_handle_error; __pyx_t_3 = NULL; + __pyx_t_5 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_5 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[5] = {__pyx_t_3, __pyx_v_context, __pyx_v_type, __pyx_v_value, __pyx_v_tb}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 4+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 550, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[5] = {__pyx_t_3, __pyx_v_context, __pyx_v_type, __pyx_v_value, __pyx_v_tb}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 4+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 550, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else + #endif + { + __pyx_t_6 = PyTuple_New(4+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 550, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (__pyx_t_3) { + __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); __pyx_t_3 = NULL; + } + __Pyx_INCREF(__pyx_v_context); + __Pyx_GIVEREF(__pyx_v_context); + PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_context); + __Pyx_INCREF(__pyx_v_type); + __Pyx_GIVEREF(__pyx_v_type); + PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_type); + __Pyx_INCREF(__pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_v_value); + __Pyx_INCREF(__pyx_v_tb); + __Pyx_GIVEREF(__pyx_v_tb); + PyTuple_SET_ITEM(__pyx_t_6, 3+__pyx_t_5, __pyx_v_tb); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 550, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + goto __pyx_L3; + } + + /*else*/ { + __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_5libev_8corecext_loop *)__pyx_v_self->__pyx_vtab)->_default_handle_error(__pyx_v_self, __pyx_v_context, __pyx_v_type, __pyx_v_value, __pyx_v_tb, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 552, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + __pyx_L3:; + + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("gevent.libev.corecext.loop.handle_error", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_handle_error); + __Pyx_XDECREF(__pyx_v_error_handler); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_11handle_error(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_11handle_error(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_context = 0; + PyObject *__pyx_v_type = 0; + PyObject *__pyx_v_value = 0; + PyObject *__pyx_v_tb = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("handle_error (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_context,&__pyx_n_s_type,&__pyx_n_s_value,&__pyx_n_s_tb,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_context)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_type)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("handle_error", 1, 4, 4, 1); __PYX_ERR(0, 544, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("handle_error", 1, 4, 4, 2); __PYX_ERR(0, 544, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 3: + if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tb)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("handle_error", 1, 4, 4, 3); __PYX_ERR(0, 544, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "handle_error") < 0)) __PYX_ERR(0, 544, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_context = values[0]; + __pyx_v_type = values[1]; + __pyx_v_value = values[2]; + __pyx_v_tb = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("handle_error", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 544, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.libev.corecext.loop.handle_error", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_10handle_error(((struct PyGeventLoopObject *)__pyx_v_self), __pyx_v_context, __pyx_v_type, __pyx_v_value, __pyx_v_tb); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_10handle_error(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_context, PyObject *__pyx_v_type, PyObject *__pyx_v_value, PyObject *__pyx_v_tb) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("handle_error", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6gevent_5libev_8corecext_4loop_handle_error(__pyx_v_self, __pyx_v_context, __pyx_v_type, __pyx_v_value, __pyx_v_tb, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 544, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.libev.corecext.loop.handle_error", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_13_default_handle_error(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_6gevent_5libev_8corecext_4loop__default_handle_error(struct PyGeventLoopObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_context, PyObject *__pyx_v_type, PyObject *__pyx_v_value, PyObject *__pyx_v_tb, int __pyx_skip_dispatch) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + __Pyx_RefNannySetupContext("_default_handle_error", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0; + if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self)))))); + else { + PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + #endif + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_default_handle_error); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 554, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_5libev_8corecext_4loop_13_default_handle_error)) { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; + __pyx_t_5 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_5 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_3)) { + PyObject *__pyx_temp[5] = {__pyx_t_4, __pyx_v_context, __pyx_v_type, __pyx_v_value, __pyx_v_tb}; + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 4+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 554, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GOTREF(__pyx_t_2); + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { + PyObject *__pyx_temp[5] = {__pyx_t_4, __pyx_v_context, __pyx_v_type, __pyx_v_value, __pyx_v_tb}; + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 4+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 554, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GOTREF(__pyx_t_2); + } else + #endif + { + __pyx_t_6 = PyTuple_New(4+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 554, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (__pyx_t_4) { + __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL; + } + __Pyx_INCREF(__pyx_v_context); + __Pyx_GIVEREF(__pyx_v_context); + PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_context); + __Pyx_INCREF(__pyx_v_type); + __Pyx_GIVEREF(__pyx_v_type); + PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_type); + __Pyx_INCREF(__pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_v_value); + __Pyx_INCREF(__pyx_v_tb); + __Pyx_GIVEREF(__pyx_v_tb); + PyTuple_SET_ITEM(__pyx_t_6, 3+__pyx_t_5, __pyx_v_tb); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 554, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0; + if (unlikely(type_dict_guard != tp_dict_version)) { + tp_dict_version = obj_dict_version = 0; + } + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + } + #endif + } + + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_traceback); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 557, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_print_exception); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 557, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = NULL; + __pyx_t_5 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_2)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_5 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_3)) { + PyObject *__pyx_temp[4] = {__pyx_t_2, __pyx_v_type, __pyx_v_value, __pyx_v_tb}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 557, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { + PyObject *__pyx_temp[4] = {__pyx_t_2, __pyx_v_type, __pyx_v_value, __pyx_v_tb}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 557, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else + #endif + { + __pyx_t_6 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 557, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (__pyx_t_2) { + __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); __pyx_t_2 = NULL; + } + __Pyx_INCREF(__pyx_v_type); + __Pyx_GIVEREF(__pyx_v_type); + PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_type); + __Pyx_INCREF(__pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_value); + __Pyx_INCREF(__pyx_v_tb); + __Pyx_GIVEREF(__pyx_v_tb); + PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_v_tb); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 557, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + __pyx_t_7 = (__pyx_v_self->_ptr != 0); + if (__pyx_t_7) { + + ev_break(__pyx_v_self->_ptr, EVBREAK_ONE); + + } + + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("gevent.libev.corecext.loop._default_handle_error", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_13_default_handle_error(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_13_default_handle_error(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_context = 0; + PyObject *__pyx_v_type = 0; + PyObject *__pyx_v_value = 0; + PyObject *__pyx_v_tb = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_default_handle_error (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_context,&__pyx_n_s_type,&__pyx_n_s_value,&__pyx_n_s_tb,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_context)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_type)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("_default_handle_error", 1, 4, 4, 1); __PYX_ERR(0, 554, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("_default_handle_error", 1, 4, 4, 2); __PYX_ERR(0, 554, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 3: + if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tb)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("_default_handle_error", 1, 4, 4, 3); __PYX_ERR(0, 554, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_default_handle_error") < 0)) __PYX_ERR(0, 554, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_context = values[0]; + __pyx_v_type = values[1]; + __pyx_v_value = values[2]; + __pyx_v_tb = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("_default_handle_error", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 554, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.libev.corecext.loop._default_handle_error", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_12_default_handle_error(((struct PyGeventLoopObject *)__pyx_v_self), __pyx_v_context, __pyx_v_type, __pyx_v_value, __pyx_v_tb); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_12_default_handle_error(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_context, PyObject *__pyx_v_type, PyObject *__pyx_v_value, PyObject *__pyx_v_tb) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("_default_handle_error", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6gevent_5libev_8corecext_4loop__default_handle_error(__pyx_v_self, __pyx_v_context, __pyx_v_type, __pyx_v_value, __pyx_v_tb, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 554, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.libev.corecext.loop._default_handle_error", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_15run(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_15run(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_nowait = 0; + PyObject *__pyx_v_once = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("run (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_nowait,&__pyx_n_s_once,0}; + PyObject* values[2] = {0,0}; + values[0] = ((PyObject *)Py_False); + values[1] = ((PyObject *)Py_False); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nowait); + if (value) { values[0] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 1: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_once); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "run") < 0)) __PYX_ERR(0, 561, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_nowait = values[0]; + __pyx_v_once = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("run", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 561, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.libev.corecext.loop.run", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_14run(((struct PyGeventLoopObject *)__pyx_v_self), __pyx_v_nowait, __pyx_v_once); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_14run(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_nowait, PyObject *__pyx_v_once) { + unsigned int __pyx_v_flags; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("run", 0); + + __pyx_t_1 = __pyx_f_6gevent_5libev_8corecext__check_loop(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 562, __pyx_L1_error) + + __pyx_v_flags = 0; + + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_nowait); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 564, __pyx_L1_error) + if (__pyx_t_1) { + + __pyx_v_flags = (__pyx_v_flags | EVRUN_NOWAIT); + + } + + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_once); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 566, __pyx_L1_error) + if (__pyx_t_1) { + + __pyx_v_flags = (__pyx_v_flags | EVRUN_ONCE); + + } + + { + #ifdef WITH_THREAD + PyThreadState *_save; + Py_UNBLOCK_THREADS + __Pyx_FastGIL_Remember(); + #endif + /*try:*/ { + + ev_run(__pyx_v_self->_ptr, __pyx_v_flags); + } + + /*finally:*/ { + /*normal exit:*/{ + #ifdef WITH_THREAD + __Pyx_FastGIL_Forget(); + Py_BLOCK_THREADS + #endif + goto __pyx_L7; + } + __pyx_L7:; + } + } + + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("gevent.libev.corecext.loop.run", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_17reinit(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_17reinit(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("reinit (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_16reinit(((struct PyGeventLoopObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_16reinit(struct PyGeventLoopObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("reinit", 0); + + __pyx_t_1 = (__pyx_v_self->_ptr != 0); + if (__pyx_t_1) { + + ev_loop_fork(__pyx_v_self->_ptr); + + } + + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_19ref(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_19ref(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("ref (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_18ref(((struct PyGeventLoopObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_18ref(struct PyGeventLoopObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("ref", 0); + + __pyx_t_1 = __pyx_f_6gevent_5libev_8corecext__check_loop(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 576, __pyx_L1_error) + + ev_ref(__pyx_v_self->_ptr); + + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("gevent.libev.corecext.loop.ref", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_21unref(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_21unref(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("unref (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_20unref(((struct PyGeventLoopObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_20unref(struct PyGeventLoopObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("unref", 0); + + __pyx_t_1 = __pyx_f_6gevent_5libev_8corecext__check_loop(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 580, __pyx_L1_error) + + ev_unref(__pyx_v_self->_ptr); + + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("gevent.libev.corecext.loop.unref", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_23break_(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_23break_(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + int __pyx_v_how; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("break_ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_how,0}; + PyObject* values[1] = {0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_how); + if (value) { values[0] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "break_") < 0)) __PYX_ERR(0, 583, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + } + if (values[0]) { + __pyx_v_how = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_how == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 583, __pyx_L3_error) + } else { + __pyx_v_how = __pyx_k__9; + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("break_", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 583, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.libev.corecext.loop.break_", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_22break_(((struct PyGeventLoopObject *)__pyx_v_self), __pyx_v_how); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_22break_(struct PyGeventLoopObject *__pyx_v_self, int __pyx_v_how) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("break_", 0); + + __pyx_t_1 = __pyx_f_6gevent_5libev_8corecext__check_loop(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 584, __pyx_L1_error) + + ev_break(__pyx_v_self->_ptr, __pyx_v_how); + + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("gevent.libev.corecext.loop.break_", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_25verify(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_25verify(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("verify (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_24verify(((struct PyGeventLoopObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_24verify(struct PyGeventLoopObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("verify", 0); + + __pyx_t_1 = __pyx_f_6gevent_5libev_8corecext__check_loop(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 588, __pyx_L1_error) + + ev_verify(__pyx_v_self->_ptr); + + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("gevent.libev.corecext.loop.verify", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_27now(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static ev_tstamp __pyx_f_6gevent_5libev_8corecext_4loop_now(struct PyGeventLoopObject *__pyx_v_self, int __pyx_skip_dispatch) { + ev_tstamp __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + ev_tstamp __pyx_t_5; + int __pyx_t_6; + __Pyx_RefNannySetupContext("now", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0; + if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self)))))); + else { + PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + #endif + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_now); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 591, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_5libev_8corecext_4loop_27now)) { + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 591, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_5 == ((ev_tstamp)-1)) && PyErr_Occurred())) __PYX_ERR(0, 591, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_5; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0; + if (unlikely(type_dict_guard != tp_dict_version)) { + tp_dict_version = obj_dict_version = 0; + } + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + } + #endif + } + + __pyx_t_6 = __pyx_f_6gevent_5libev_8corecext__check_loop(__pyx_v_self); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 592, __pyx_L1_error) + + __pyx_r = ev_now(__pyx_v_self->_ptr); + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("gevent.libev.corecext.loop.now", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_27now(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_27now(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("now (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_26now(((struct PyGeventLoopObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_26now(struct PyGeventLoopObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + ev_tstamp __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("now", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6gevent_5libev_8corecext_4loop_now(__pyx_v_self, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 591, __pyx_L1_error) + __pyx_t_2 = PyFloat_FromDouble(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 591, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent.libev.corecext.loop.now", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_29update_now(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static void __pyx_f_6gevent_5libev_8corecext_4loop_update_now(struct PyGeventLoopObject *__pyx_v_self, int __pyx_skip_dispatch) { + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + __Pyx_RefNannySetupContext("update_now", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0; + if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self)))))); + else { + PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + #endif + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_update_now); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 595, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_5libev_8corecext_4loop_29update_now)) { + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 595, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0; + if (unlikely(type_dict_guard != tp_dict_version)) { + tp_dict_version = obj_dict_version = 0; + } + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + } + #endif + } + + __pyx_t_5 = __pyx_f_6gevent_5libev_8corecext__check_loop(__pyx_v_self); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 596, __pyx_L1_error) + + ev_now_update(__pyx_v_self->_ptr); + + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("gevent.libev.corecext.loop.update_now", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_L0:; + __Pyx_RefNannyFinishContext(); +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_29update_now(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_29update_now(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("update_now (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_28update_now(((struct PyGeventLoopObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_28update_now(struct PyGeventLoopObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("update_now", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_f_6gevent_5libev_8corecext_4loop_update_now(__pyx_v_self, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 595, __pyx_L1_error) + __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 595, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.libev.corecext.loop.update_now", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_31__repr__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_31__repr__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_30__repr__(((struct PyGeventLoopObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_30__repr__(struct PyGeventLoopObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + __Pyx_RefNannySetupContext("__repr__", 0); + + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 602, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 602, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 602, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 602, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + } + } + __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 602, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 602, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3); + __pyx_t_2 = 0; + __pyx_t_1 = 0; + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_s_at_0x_x_s_2, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 602, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("gevent.libev.corecext.loop.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_7default_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_7default_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_7default___get__(((struct PyGeventLoopObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_7default___get__(struct PyGeventLoopObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + __Pyx_XDECREF(__pyx_r); + if ((__pyx_v_self->_ptr != 0)) { + __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->_default); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 608, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __pyx_t_2; + __pyx_t_2 = 0; + } else { + __Pyx_INCREF(Py_False); + __pyx_t_1 = Py_False; + } + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent.libev.corecext.loop.default.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_9iteration_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_9iteration_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_9iteration___get__(((struct PyGeventLoopObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_9iteration___get__(struct PyGeventLoopObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + __pyx_t_1 = __pyx_f_6gevent_5libev_8corecext__check_loop(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 612, __pyx_L1_error) + + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_unsigned_int(ev_iteration(__pyx_v_self->_ptr)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 613, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent.libev.corecext.loop.iteration.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_5depth_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_5depth_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_5depth___get__(((struct PyGeventLoopObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_5depth___get__(struct PyGeventLoopObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + __pyx_t_1 = __pyx_f_6gevent_5libev_8corecext__check_loop(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 617, __pyx_L1_error) + + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_unsigned_int(ev_depth(__pyx_v_self->_ptr)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 618, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent.libev.corecext.loop.depth.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_11backend_int_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_11backend_int_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_11backend_int___get__(((struct PyGeventLoopObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_11backend_int___get__(struct PyGeventLoopObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + __pyx_t_1 = __pyx_f_6gevent_5libev_8corecext__check_loop(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 622, __pyx_L1_error) + + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_unsigned_int(ev_backend(__pyx_v_self->_ptr)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 623, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent.libev.corecext.loop.backend_int.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_7backend_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_7backend_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_7backend___get__(((struct PyGeventLoopObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_7backend___get__(struct PyGeventLoopObject *__pyx_v_self) { + unsigned int __pyx_v_backend; + PyObject *__pyx_v_key = NULL; + PyObject *__pyx_v_value = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + Py_ssize_t __pyx_t_4; + PyObject *(*__pyx_t_5)(PyObject *); + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *(*__pyx_t_9)(PyObject *); + __Pyx_RefNannySetupContext("__get__", 0); + + __pyx_t_1 = __pyx_f_6gevent_5libev_8corecext__check_loop(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 627, __pyx_L1_error) + + __pyx_v_backend = ev_backend(__pyx_v_self->_ptr); + + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_flags); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 629, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) { + __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0; + __pyx_t_5 = NULL; + } else { + __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 629, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 629, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + for (;;) { + if (likely(!__pyx_t_5)) { + if (likely(PyList_CheckExact(__pyx_t_3))) { + if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 629, __pyx_L1_error) + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 629, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + #endif + } else { + if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 629, __pyx_L1_error) + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 629, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + #endif + } + } else { + __pyx_t_2 = __pyx_t_5(__pyx_t_3); + if (unlikely(!__pyx_t_2)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(0, 629, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_2); + } + if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) { + PyObject* sequence = __pyx_t_2; + Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + __PYX_ERR(0, 629, __pyx_L1_error) + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_6 = PyList_GET_ITEM(sequence, 0); + __pyx_t_7 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(__pyx_t_7); + #else + __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 629, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 629, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + #endif + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_8 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 629, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_9 = Py_TYPE(__pyx_t_8)->tp_iternext; + index = 0; __pyx_t_6 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed; + __Pyx_GOTREF(__pyx_t_6); + index = 1; __pyx_t_7 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_7)) goto __pyx_L5_unpacking_failed; + __Pyx_GOTREF(__pyx_t_7); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 2) < 0) __PYX_ERR(0, 629, __pyx_L1_error) + __pyx_t_9 = NULL; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + goto __pyx_L6_unpacking_done; + __pyx_L5_unpacking_failed:; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_9 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + __PYX_ERR(0, 629, __pyx_L1_error) + __pyx_L6_unpacking_done:; + } + __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_6); + __pyx_t_6 = 0; + __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_7); + __pyx_t_7 = 0; + + __pyx_t_2 = __Pyx_PyInt_From_unsigned_int(__pyx_v_backend); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 630, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_7 = PyObject_RichCompare(__pyx_v_key, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 630, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 630, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (__pyx_t_1) { + + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_value); + __pyx_r = __pyx_v_value; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L0; + + } + + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyInt_From_unsigned_int(__pyx_v_backend); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 632, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("gevent.libev.corecext.loop.backend.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_key); + __Pyx_XDECREF(__pyx_v_value); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_10pendingcnt_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_10pendingcnt_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_10pendingcnt___get__(((struct PyGeventLoopObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_10pendingcnt___get__(struct PyGeventLoopObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + __pyx_t_1 = __pyx_f_6gevent_5libev_8corecext__check_loop(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 636, __pyx_L1_error) + + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_unsigned_int(ev_pending_count(__pyx_v_self->_ptr)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 637, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent.libev.corecext.loop.pendingcnt.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_33io(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_33io(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + vfd_socket_t __pyx_v_fd; + int __pyx_v_events; + PyObject *__pyx_v_ref = 0; + PyObject *__pyx_v_priority = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("io (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_fd,&__pyx_n_s_events_2,&__pyx_n_s_ref,&__pyx_n_s_priority,0}; + PyObject* values[4] = {0,0,0,0}; + values[2] = ((PyObject *)Py_True); + values[3] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_fd)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_events_2)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("io", 0, 2, 4, 1); __PYX_ERR(0, 639, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ref); + if (value) { values[2] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 3: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_priority); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "io") < 0)) __PYX_ERR(0, 639, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_fd = __Pyx_PyIndex_AsSsize_t(values[0]); if (unlikely((__pyx_v_fd == ((vfd_socket_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 639, __pyx_L3_error) + __pyx_v_events = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_events == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 639, __pyx_L3_error) + __pyx_v_ref = values[2]; + __pyx_v_priority = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("io", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 639, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.libev.corecext.loop.io", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_32io(((struct PyGeventLoopObject *)__pyx_v_self), __pyx_v_fd, __pyx_v_events, __pyx_v_ref, __pyx_v_priority); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_32io(struct PyGeventLoopObject *__pyx_v_self, vfd_socket_t __pyx_v_fd, int __pyx_v_events, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("io", 0); + + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_fd); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 640, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_events); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 640, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 640, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2); + __Pyx_INCREF(__pyx_v_ref); + __Pyx_GIVEREF(__pyx_v_ref); + PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_v_ref); + __Pyx_INCREF(__pyx_v_priority); + __Pyx_GIVEREF(__pyx_v_priority); + PyTuple_SET_ITEM(__pyx_t_3, 4, __pyx_v_priority); + __pyx_t_1 = 0; + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6gevent_5libev_8corecext_io), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 640, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("gevent.libev.corecext.loop.io", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_35timer(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_35timer(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + double __pyx_v_after; + double __pyx_v_repeat; + PyObject *__pyx_v_ref = 0; + PyObject *__pyx_v_priority = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("timer (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_after,&__pyx_n_s_repeat,&__pyx_n_s_ref,&__pyx_n_s_priority,0}; + PyObject* values[4] = {0,0,0,0}; + values[2] = ((PyObject *)Py_True); + values[3] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_after)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_repeat); + if (value) { values[1] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 2: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ref); + if (value) { values[2] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 3: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_priority); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "timer") < 0)) __PYX_ERR(0, 642, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_after = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_after == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 642, __pyx_L3_error) + if (values[1]) { + __pyx_v_repeat = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_repeat == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 642, __pyx_L3_error) + } else { + __pyx_v_repeat = ((double)0.0); + } + __pyx_v_ref = values[2]; + __pyx_v_priority = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("timer", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 642, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.libev.corecext.loop.timer", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_34timer(((struct PyGeventLoopObject *)__pyx_v_self), __pyx_v_after, __pyx_v_repeat, __pyx_v_ref, __pyx_v_priority); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_34timer(struct PyGeventLoopObject *__pyx_v_self, double __pyx_v_after, double __pyx_v_repeat, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("timer", 0); + + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyFloat_FromDouble(__pyx_v_after); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 643, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_repeat); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 643, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 643, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2); + __Pyx_INCREF(__pyx_v_ref); + __Pyx_GIVEREF(__pyx_v_ref); + PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_v_ref); + __Pyx_INCREF(__pyx_v_priority); + __Pyx_GIVEREF(__pyx_v_priority); + PyTuple_SET_ITEM(__pyx_t_3, 4, __pyx_v_priority); + __pyx_t_1 = 0; + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6gevent_5libev_8corecext_timer), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 643, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("gevent.libev.corecext.loop.timer", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_37signal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_37signal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + int __pyx_v_signum; + PyObject *__pyx_v_ref = 0; + PyObject *__pyx_v_priority = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("signal (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_signum,&__pyx_n_s_ref,&__pyx_n_s_priority,0}; + PyObject* values[3] = {0,0,0}; + values[1] = ((PyObject *)Py_True); + values[2] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_signum)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ref); + if (value) { values[1] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 2: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_priority); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "signal") < 0)) __PYX_ERR(0, 645, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_signum = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_signum == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 645, __pyx_L3_error) + __pyx_v_ref = values[1]; + __pyx_v_priority = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("signal", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 645, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.libev.corecext.loop.signal", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_36signal(((struct PyGeventLoopObject *)__pyx_v_self), __pyx_v_signum, __pyx_v_ref, __pyx_v_priority); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_36signal(struct PyGeventLoopObject *__pyx_v_self, int __pyx_v_signum, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("signal", 0); + + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_signum); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 646, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 646, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1); + __Pyx_INCREF(__pyx_v_ref); + __Pyx_GIVEREF(__pyx_v_ref); + PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_ref); + __Pyx_INCREF(__pyx_v_priority); + __Pyx_GIVEREF(__pyx_v_priority); + PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_v_priority); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6gevent_5libev_8corecext_signal), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 646, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent.libev.corecext.loop.signal", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_39idle(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_39idle(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_ref = 0; + PyObject *__pyx_v_priority = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("idle (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ref,&__pyx_n_s_priority,0}; + PyObject* values[2] = {0,0}; + values[0] = ((PyObject *)Py_True); + values[1] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ref); + if (value) { values[0] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 1: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_priority); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "idle") < 0)) __PYX_ERR(0, 648, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_ref = values[0]; + __pyx_v_priority = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("idle", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 648, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.libev.corecext.loop.idle", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_38idle(((struct PyGeventLoopObject *)__pyx_v_self), __pyx_v_ref, __pyx_v_priority); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_38idle(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("idle", 0); + + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 649, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self)); + __Pyx_INCREF(__pyx_v_ref); + __Pyx_GIVEREF(__pyx_v_ref); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_ref); + __Pyx_INCREF(__pyx_v_priority); + __Pyx_GIVEREF(__pyx_v_priority); + PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_priority); + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6gevent_5libev_8corecext_idle), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 649, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent.libev.corecext.loop.idle", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_41prepare(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_41prepare(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_ref = 0; + PyObject *__pyx_v_priority = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("prepare (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ref,&__pyx_n_s_priority,0}; + PyObject* values[2] = {0,0}; + values[0] = ((PyObject *)Py_True); + values[1] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ref); + if (value) { values[0] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 1: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_priority); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "prepare") < 0)) __PYX_ERR(0, 651, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_ref = values[0]; + __pyx_v_priority = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("prepare", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 651, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.libev.corecext.loop.prepare", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_40prepare(((struct PyGeventLoopObject *)__pyx_v_self), __pyx_v_ref, __pyx_v_priority); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_40prepare(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("prepare", 0); + + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 652, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self)); + __Pyx_INCREF(__pyx_v_ref); + __Pyx_GIVEREF(__pyx_v_ref); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_ref); + __Pyx_INCREF(__pyx_v_priority); + __Pyx_GIVEREF(__pyx_v_priority); + PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_priority); + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6gevent_5libev_8corecext_prepare), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 652, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent.libev.corecext.loop.prepare", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_43check(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_43check(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_ref = 0; + PyObject *__pyx_v_priority = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("check (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ref,&__pyx_n_s_priority,0}; + PyObject* values[2] = {0,0}; + values[0] = ((PyObject *)Py_True); + values[1] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ref); + if (value) { values[0] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 1: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_priority); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "check") < 0)) __PYX_ERR(0, 654, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_ref = values[0]; + __pyx_v_priority = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("check", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 654, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.libev.corecext.loop.check", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_42check(((struct PyGeventLoopObject *)__pyx_v_self), __pyx_v_ref, __pyx_v_priority); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_42check(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("check", 0); + + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 655, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self)); + __Pyx_INCREF(__pyx_v_ref); + __Pyx_GIVEREF(__pyx_v_ref); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_ref); + __Pyx_INCREF(__pyx_v_priority); + __Pyx_GIVEREF(__pyx_v_priority); + PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_priority); + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6gevent_5libev_8corecext_check), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 655, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent.libev.corecext.loop.check", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_45fork(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_45fork(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_ref = 0; + PyObject *__pyx_v_priority = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("fork (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ref,&__pyx_n_s_priority,0}; + PyObject* values[2] = {0,0}; + values[0] = ((PyObject *)Py_True); + values[1] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ref); + if (value) { values[0] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 1: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_priority); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "fork") < 0)) __PYX_ERR(0, 657, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_ref = values[0]; + __pyx_v_priority = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("fork", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 657, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.libev.corecext.loop.fork", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_44fork(((struct PyGeventLoopObject *)__pyx_v_self), __pyx_v_ref, __pyx_v_priority); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_44fork(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("fork", 0); + + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 658, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self)); + __Pyx_INCREF(__pyx_v_ref); + __Pyx_GIVEREF(__pyx_v_ref); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_ref); + __Pyx_INCREF(__pyx_v_priority); + __Pyx_GIVEREF(__pyx_v_priority); + PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_priority); + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6gevent_5libev_8corecext_fork), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 658, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent.libev.corecext.loop.fork", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_47async_(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_47async_(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_ref = 0; + PyObject *__pyx_v_priority = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("async_ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ref,&__pyx_n_s_priority,0}; + PyObject* values[2] = {0,0}; + values[0] = ((PyObject *)Py_True); + values[1] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ref); + if (value) { values[0] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 1: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_priority); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "async_") < 0)) __PYX_ERR(0, 660, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_ref = values[0]; + __pyx_v_priority = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("async_", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 660, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.libev.corecext.loop.async_", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_46async_(((struct PyGeventLoopObject *)__pyx_v_self), __pyx_v_ref, __pyx_v_priority); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_46async_(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("async_", 0); + + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 661, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self)); + __Pyx_INCREF(__pyx_v_ref); + __Pyx_GIVEREF(__pyx_v_ref); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_ref); + __Pyx_INCREF(__pyx_v_priority); + __Pyx_GIVEREF(__pyx_v_priority); + PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_priority); + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6gevent_5libev_8corecext_async_), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 661, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent.libev.corecext.loop.async_", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_49child(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_49child(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + int __pyx_v_pid; + int __pyx_v_trace; + PyObject *__pyx_v_ref = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("child (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pid,&__pyx_n_s_trace,&__pyx_n_s_ref,0}; + PyObject* values[3] = {0,0,0}; + values[2] = ((PyObject *)Py_True); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pid)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_trace); + if (value) { values[1] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 2: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ref); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "child") < 0)) __PYX_ERR(0, 666, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_pid = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_pid == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 666, __pyx_L3_error) + if (values[1]) { + __pyx_v_trace = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_trace == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 666, __pyx_L3_error) + } else { + __pyx_v_trace = ((int)0); + } + __pyx_v_ref = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("child", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 666, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.libev.corecext.loop.child", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_48child(((struct PyGeventLoopObject *)__pyx_v_self), __pyx_v_pid, __pyx_v_trace, __pyx_v_ref); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_48child(struct PyGeventLoopObject *__pyx_v_self, int __pyx_v_pid, int __pyx_v_trace, PyObject *__pyx_v_ref) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + __Pyx_RefNannySetupContext("child", 0); + + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_sys); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 667, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_platform); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 667, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_t_2, __pyx_n_s_win32, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 667, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(__pyx_t_3)) { + + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_AttributeError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 668, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 668, __pyx_L1_error) + + } + + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_pid); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 669, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_trace); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 669, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = PyTuple_New(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 669, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_1); + __Pyx_INCREF(__pyx_v_ref); + __Pyx_GIVEREF(__pyx_v_ref); + PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_v_ref); + __pyx_t_2 = 0; + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6gevent_5libev_8corecext_child), __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 669, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("gevent.libev.corecext.loop.child", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_51install_sigchld(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_51install_sigchld(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("install_sigchld (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_50install_sigchld(((struct PyGeventLoopObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_50install_sigchld(CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("install_sigchld", 0); + + gevent_install_sigchld_handler(); + + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_53reset_sigchld(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_53reset_sigchld(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("reset_sigchld (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_52reset_sigchld(((struct PyGeventLoopObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_52reset_sigchld(CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("reset_sigchld", 0); + + gevent_reset_sigchld_handler(); + + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_55stat(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_55stat(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_path = 0; + float __pyx_v_interval; + PyObject *__pyx_v_ref = 0; + PyObject *__pyx_v_priority = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stat (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_path,&__pyx_n_s_interval,&__pyx_n_s_ref,&__pyx_n_s_priority,0}; + PyObject* values[4] = {0,0,0,0}; + values[2] = ((PyObject *)Py_True); + values[3] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_path)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_interval); + if (value) { values[1] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 2: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ref); + if (value) { values[2] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 3: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_priority); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stat") < 0)) __PYX_ERR(0, 677, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_path = ((PyObject*)values[0]); + if (values[1]) { + __pyx_v_interval = __pyx_PyFloat_AsFloat(values[1]); if (unlikely((__pyx_v_interval == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 677, __pyx_L3_error) + } else { + __pyx_v_interval = ((float)0.0); + } + __pyx_v_ref = values[2]; + __pyx_v_priority = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("stat", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 677, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.libev.corecext.loop.stat", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_path), (&PyString_Type), 1, "path", 1))) __PYX_ERR(0, 677, __pyx_L1_error) + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_54stat(((struct PyGeventLoopObject *)__pyx_v_self), __pyx_v_path, __pyx_v_interval, __pyx_v_ref, __pyx_v_priority); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_54stat(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_path, float __pyx_v_interval, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("stat", 0); + + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyFloat_FromDouble(__pyx_v_interval); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 678, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 678, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self)); + __Pyx_INCREF(__pyx_v_path); + __Pyx_GIVEREF(__pyx_v_path); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_path); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_1); + __Pyx_INCREF(__pyx_v_ref); + __Pyx_GIVEREF(__pyx_v_ref); + PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_v_ref); + __Pyx_INCREF(__pyx_v_priority); + __Pyx_GIVEREF(__pyx_v_priority); + PyTuple_SET_ITEM(__pyx_t_2, 4, __pyx_v_priority); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6gevent_5libev_8corecext_stat), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 678, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent.libev.corecext.loop.stat", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_57run_callback(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_57run_callback(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_func = 0; + PyObject *__pyx_v_args = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("run_callback (wrapper)", 0); + if (PyTuple_GET_SIZE(__pyx_args) > 1) { + __pyx_v_args = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args)); + if (unlikely(!__pyx_v_args)) { + __Pyx_RefNannyFinishContext(); + return NULL; + } + __Pyx_GOTREF(__pyx_v_args); + } else { + __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple); + } + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_func,0}; + PyObject* values[1] = {0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + default: + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_func)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "run_callback") < 0)) __PYX_ERR(0, 680, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) < 1) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + } + __pyx_v_func = values[0]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("run_callback", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 680, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0; + __Pyx_AddTraceback("gevent.libev.corecext.loop.run_callback", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_56run_callback(((struct PyGeventLoopObject *)__pyx_v_self), __pyx_v_func, __pyx_v_args); + + /* function exit code */ + __Pyx_XDECREF(__pyx_v_args); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_56run_callback(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_func, PyObject *__pyx_v_args) { + struct PyGeventCallbackObject *__pyx_v_cb = 0; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("run_callback", 0); + + __pyx_t_1 = __pyx_f_6gevent_5libev_8corecext__check_loop(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 681, __pyx_L1_error) + + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 682, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_func); + __Pyx_GIVEREF(__pyx_v_func); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_func); + __Pyx_INCREF(__pyx_v_args); + __Pyx_GIVEREF(__pyx_v_args); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_args); + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6gevent_5libev_8corecext_callback), __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 682, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_cb = ((struct PyGeventCallbackObject *)__pyx_t_3); + __pyx_t_3 = 0; + + __pyx_t_3 = __pyx_f_6gevent_5libev_8corecext_12CallbackFIFO_append(__pyx_v_self->_callbacks, __pyx_v_cb); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 683, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + ev_ref(__pyx_v_self->_ptr); + + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_cb)); + __pyx_r = ((PyObject *)__pyx_v_cb); + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("gevent.libev.corecext.loop.run_callback", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_cb); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_59_format(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_59_format(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_format (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_58_format(((struct PyGeventLoopObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_58_format(struct PyGeventLoopObject *__pyx_v_self) { + PyObject *__pyx_v_msg = 0; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + __Pyx_RefNannySetupContext("_format", 0); + + __pyx_t_1 = ((!(__pyx_v_self->_ptr != 0)) != 0); + if (__pyx_t_1) { + + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_n_s_destroyed); + __pyx_r = __pyx_n_s_destroyed; + goto __pyx_L0; + + } + + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_backend); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 690, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_msg = __pyx_t_2; + __pyx_t_2 = 0; + + __pyx_t_1 = (__pyx_v_self->_default != 0); + if (__pyx_t_1) { + + __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_msg, __pyx_kp_s_default_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 692, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF_SET(__pyx_v_msg, __pyx_t_2); + __pyx_t_2 = 0; + + } + + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_pendingcnt); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 693, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyString_FormatSafe(__pyx_kp_s_pending_s, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 693, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_msg, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 693, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF_SET(__pyx_v_msg, __pyx_t_2); + __pyx_t_2 = 0; + + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_format_details); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 694, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 694, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_msg, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 694, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF_SET(__pyx_v_msg, __pyx_t_3); + __pyx_t_3 = 0; + + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_msg); + __pyx_r = __pyx_v_msg; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("gevent.libev.corecext.loop._format", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_msg); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_61_format_details(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_61_format_details(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_format_details (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_60_format_details(((struct PyGeventLoopObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_60_format_details(struct PyGeventLoopObject *__pyx_v_self) { + PyObject *__pyx_v_msg = 0; + PyObject *__pyx_v_fileno = 0; + PyObject *__pyx_v_activecnt = 0; + CYTHON_UNUSED PyObject *__pyx_v_sigfd = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + int __pyx_t_8; + int __pyx_t_9; + __Pyx_RefNannySetupContext("_format_details", 0); + + __Pyx_INCREF(__pyx_kp_s__7); + __pyx_v_msg = __pyx_kp_s__7; + + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_fileno); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 699, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 699, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_fileno = __pyx_t_1; + __pyx_t_1 = 0; + + __Pyx_INCREF(Py_None); + __pyx_v_activecnt = Py_None; + + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6); + __Pyx_XGOTREF(__pyx_t_4); + __Pyx_XGOTREF(__pyx_t_5); + __Pyx_XGOTREF(__pyx_t_6); + /*try:*/ { + + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_sigfd); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 702, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_sigfd = __pyx_t_1; + __pyx_t_1 = 0; + + } + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L8_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + + __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_AttributeError); + if (__pyx_t_7) { + __Pyx_AddTraceback("gevent.libev.corecext.loop._format_details", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3) < 0) __PYX_ERR(0, 703, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_t_3); + + __Pyx_INCREF(Py_None); + __Pyx_XDECREF_SET(__pyx_v_sigfd, Py_None); + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6); + goto __pyx_L1_error; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6); + __pyx_L8_try_end:; + } + + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4); + __Pyx_XGOTREF(__pyx_t_6); + __Pyx_XGOTREF(__pyx_t_5); + __Pyx_XGOTREF(__pyx_t_4); + /*try:*/ { + + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_activecnt); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 706, __pyx_L11_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF_SET(__pyx_v_activecnt, __pyx_t_3); + __pyx_t_3 = 0; + + } + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L16_try_end; + __pyx_L11_error:; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + + __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_AttributeError); + if (__pyx_t_7) { + __Pyx_ErrRestore(0,0,0); + goto __pyx_L12_exception_handled; + } + goto __pyx_L13_except_error; + __pyx_L13_except_error:; + + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_5, __pyx_t_4); + goto __pyx_L1_error; + __pyx_L12_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_5, __pyx_t_4); + __pyx_L16_try_end:; + } + + __pyx_t_8 = (__pyx_v_activecnt != Py_None); + __pyx_t_9 = (__pyx_t_8 != 0); + if (__pyx_t_9) { + + __pyx_t_3 = PyObject_Repr(__pyx_v_activecnt); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 710, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyNumber_Add(__pyx_kp_s_ref_2, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 710, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_msg, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 710, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF_SET(__pyx_v_msg, ((PyObject*)__pyx_t_3)); + __pyx_t_3 = 0; + + } + + __pyx_t_9 = (__pyx_v_fileno != Py_None); + __pyx_t_8 = (__pyx_t_9 != 0); + if (__pyx_t_8) { + + __pyx_t_3 = PyObject_Repr(__pyx_v_fileno); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 712, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyNumber_Add(__pyx_kp_s_fileno_2, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 712, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_msg, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 712, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF_SET(__pyx_v_msg, ((PyObject*)__pyx_t_3)); + __pyx_t_3 = 0; + + } + + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_msg); + __pyx_r = __pyx_v_msg; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("gevent.libev.corecext.loop._format_details", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_msg); + __Pyx_XDECREF(__pyx_v_fileno); + __Pyx_XDECREF(__pyx_v_activecnt); + __Pyx_XDECREF(__pyx_v_sigfd); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_63fileno(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_63fileno(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("fileno (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_62fileno(((struct PyGeventLoopObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_62fileno(struct PyGeventLoopObject *__pyx_v_self) { + int __pyx_v_fd; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("fileno", 0); + + __pyx_t_1 = (__pyx_v_self->_ptr != 0); + if (__pyx_t_1) { + + __pyx_v_fd = gevent_ev_loop_backend_fd(__pyx_v_self->_ptr); + + __pyx_t_1 = ((__pyx_v_fd >= 0) != 0); + if (__pyx_t_1) { + + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_fd); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 720, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + } + + } + + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent.libev.corecext.loop.fileno", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_9activecnt_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_9activecnt_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_9activecnt___get__(((struct PyGeventLoopObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_9activecnt___get__(struct PyGeventLoopObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + __pyx_t_1 = __pyx_f_6gevent_5libev_8corecext__check_loop(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 724, __pyx_L1_error) + + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(gevent_ev_loop_activecnt(__pyx_v_self->_ptr)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 725, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent.libev.corecext.loop.activecnt.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_11sig_pending_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_11sig_pending_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_11sig_pending___get__(((struct PyGeventLoopObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_11sig_pending___get__(struct PyGeventLoopObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + __pyx_t_1 = __pyx_f_6gevent_5libev_8corecext__check_loop(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 729, __pyx_L1_error) + + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(gevent_ev_loop_sig_pending(__pyx_v_self->_ptr)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 730, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent.libev.corecext.loop.sig_pending.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_9origflags_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_9origflags_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_9origflags___get__(((struct PyGeventLoopObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_9origflags___get__(struct PyGeventLoopObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + unsigned int __pyx_t_2; + __Pyx_RefNannySetupContext("__get__", 0); + + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_origflags_int); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 734, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyInt_As_unsigned_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 734, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __pyx_f_6gevent_5libev_8corecext__flags_to_list(__pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 734, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.libev.corecext.loop.origflags.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_13origflags_int_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_13origflags_int_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_13origflags_int___get__(((struct PyGeventLoopObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_13origflags_int___get__(struct PyGeventLoopObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + __pyx_t_1 = __pyx_f_6gevent_5libev_8corecext__check_loop(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 738, __pyx_L1_error) + + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_unsigned_int(gevent_ev_loop_origflags(__pyx_v_self->_ptr)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 739, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent.libev.corecext.loop.origflags_int.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_5sigfd_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_5sigfd_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_5sigfd___get__(((struct PyGeventLoopObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_5sigfd___get__(struct PyGeventLoopObject *__pyx_v_self) { + int __pyx_v_fd; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + __pyx_t_1 = __pyx_f_6gevent_5libev_8corecext__check_loop(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 743, __pyx_L1_error) + + __pyx_v_fd = gevent_ev_loop_sigfd(__pyx_v_self->_ptr); + + __pyx_t_1 = ((__pyx_v_fd >= 0) != 0); + if (__pyx_t_1) { + + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_fd); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 746, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + } + + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_AttributeError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 749, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 749, __pyx_L1_error) + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent.libev.corecext.loop.sigfd.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_13error_handler_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_13error_handler_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_13error_handler___get__(((struct PyGeventLoopObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_13error_handler___get__(struct PyGeventLoopObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->error_handler); + __pyx_r = __pyx_v_self->error_handler; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_4loop_13error_handler_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_4loop_13error_handler_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_13error_handler_2__set__(((struct PyGeventLoopObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_4loop_13error_handler_2__set__(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__", 0); + __Pyx_INCREF(__pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + __Pyx_GOTREF(__pyx_v_self->error_handler); + __Pyx_DECREF(__pyx_v_self->error_handler); + __pyx_v_self->error_handler = __pyx_v_value; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_4loop_13error_handler_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_4loop_13error_handler_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_13error_handler_4__del__(((struct PyGeventLoopObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_4loop_13error_handler_4__del__(struct PyGeventLoopObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->error_handler); + __Pyx_DECREF(__pyx_v_self->error_handler); + __pyx_v_self->error_handler = Py_None; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_10_callbacks_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_10_callbacks_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_10_callbacks___get__(((struct PyGeventLoopObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_10_callbacks___get__(struct PyGeventLoopObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_self->_callbacks)); + __pyx_r = ((PyObject *)__pyx_v_self->_callbacks); + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_4loop_10_callbacks_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_4loop_10_callbacks_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_10_callbacks_2__set__(((struct PyGeventLoopObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_4loop_10_callbacks_2__set__(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__set__", 0); + if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_6gevent_5libev_8corecext_CallbackFIFO))))) __PYX_ERR(0, 386, __pyx_L1_error) + __pyx_t_1 = __pyx_v_value; + __Pyx_INCREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_self->_callbacks); + __Pyx_DECREF(((PyObject *)__pyx_v_self->_callbacks)); + __pyx_v_self->_callbacks = ((struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *)__pyx_t_1); + __pyx_t_1 = 0; + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.libev.corecext.loop._callbacks.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_4loop_10_callbacks_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_4loop_10_callbacks_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_10_callbacks_4__del__(((struct PyGeventLoopObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_4loop_10_callbacks_4__del__(struct PyGeventLoopObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->_callbacks); + __Pyx_DECREF(((PyObject *)__pyx_v_self->_callbacks)); + __pyx_v_self->_callbacks = ((struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *)Py_None); + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_23approx_timer_resolution_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_23approx_timer_resolution_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_23approx_timer_resolution___get__(((struct PyGeventLoopObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_23approx_timer_resolution___get__(struct PyGeventLoopObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->approx_timer_resolution); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 395, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.libev.corecext.loop.approx_timer_resolution.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +static void __pyx_f_6gevent_5libev_8corecext__python_incref(struct PyGeventWatcherObject *__pyx_v_self) { + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("_python_incref", 0); + + __pyx_t_1 = ((!((__pyx_v_self->_flags & 1) != 0)) != 0); + if (__pyx_t_1) { + + Py_INCREF(((PyObject *)__pyx_v_self)); + + __pyx_v_self->_flags = (__pyx_v_self->_flags | 1); + + } + + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + + +static void __pyx_f_6gevent_5libev_8corecext__python_decref(struct PyGeventWatcherObject *__pyx_v_self) { + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("_python_decref", 0); + + __pyx_t_1 = ((__pyx_v_self->_flags & 1) != 0); + if (__pyx_t_1) { + + Py_DECREF(((PyObject *)__pyx_v_self)); + + __pyx_v_self->_flags = (__pyx_v_self->_flags & (~1)); + + } + + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + + +static void __pyx_f_6gevent_5libev_8corecext__libev_ref(struct PyGeventWatcherObject *__pyx_v_self) { + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("_libev_ref", 0); + + __pyx_t_1 = ((__pyx_v_self->_flags & 2) != 0); + if (__pyx_t_1) { + + ev_ref(__pyx_v_self->loop->_ptr); + + __pyx_v_self->_flags = (__pyx_v_self->_flags & (~2)); + + } + + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + + +static void __pyx_f_6gevent_5libev_8corecext__libev_unref(struct PyGeventWatcherObject *__pyx_v_self) { + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("_libev_unref", 0); + + __pyx_t_1 = (((__pyx_v_self->_flags & 6) == 4) != 0); + if (__pyx_t_1) { + + ev_unref(__pyx_v_self->loop->_ptr); + + __pyx_v_self->_flags = (__pyx_v_self->_flags | 2); + + } + + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + + +static struct __pyx_t_6gevent_5libev_8corecext_start_and_stop __pyx_f_6gevent_5libev_8corecext_make_ss(void *__pyx_v_start, void *__pyx_v_stop) { + struct __pyx_t_6gevent_5libev_8corecext_start_and_stop __pyx_v_result; + struct __pyx_t_6gevent_5libev_8corecext_start_and_stop __pyx_r; + __Pyx_RefNannyDeclarations + struct __pyx_t_6gevent_5libev_8corecext_start_and_stop __pyx_t_1; + __Pyx_RefNannySetupContext("make_ss", 0); + + __pyx_t_1.start = ((__pyx_t_6gevent_5libev_8corecext_start_stop_func)__pyx_v_start); + __pyx_t_1.stop = ((__pyx_t_6gevent_5libev_8corecext_start_stop_func)__pyx_v_stop); + __pyx_v_result = __pyx_t_1; + + __pyx_r = __pyx_v_result; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +static int __pyx_f_6gevent_5libev_8corecext__watcher_start(struct PyGeventWatcherObject *__pyx_v_self, PyObject *__pyx_v_callback, PyObject *__pyx_v_args) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + __Pyx_RefNannySetupContext("_watcher_start", 0); + + __pyx_t_1 = ((PyObject *)__pyx_v_self->loop); + __Pyx_INCREF(__pyx_t_1); + __pyx_t_2 = __pyx_f_6gevent_5libev_8corecext__check_loop(((struct PyGeventLoopObject *)__pyx_t_1)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 817, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + __pyx_t_3 = (__pyx_v_callback == Py_None); + __pyx_t_4 = (__pyx_t_3 != 0); + if (!__pyx_t_4) { + } else { + __pyx_t_2 = __pyx_t_4; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_4 = __Pyx_PyCallable_Check(__pyx_v_callback); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 818, __pyx_L1_error) + __pyx_t_3 = ((!(__pyx_t_4 != 0)) != 0); + __pyx_t_2 = __pyx_t_3; + __pyx_L4_bool_binop_done:; + if (unlikely(__pyx_t_2)) { + + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 819, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_callback); + __Pyx_GIVEREF(__pyx_v_callback); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_callback); + __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_Expected_callable_not_r, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 819, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 819, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 819, __pyx_L1_error) + + } + + __Pyx_INCREF(__pyx_v_callback); + __Pyx_GIVEREF(__pyx_v_callback); + __Pyx_GOTREF(__pyx_v_self->_callback); + __Pyx_DECREF(__pyx_v_self->_callback); + __pyx_v_self->_callback = __pyx_v_callback; + + __Pyx_INCREF(__pyx_v_args); + __Pyx_GIVEREF(__pyx_v_args); + __Pyx_GOTREF(__pyx_v_self->args); + __Pyx_DECREF(__pyx_v_self->args); + __pyx_v_self->args = __pyx_v_args; + + __pyx_f_6gevent_5libev_8corecext__libev_unref(__pyx_v_self); + + __pyx_f_6gevent_5libev_8corecext__python_incref(__pyx_v_self); + + __pyx_v_self->__pyx___ss->start(__pyx_v_self->loop->_ptr, __pyx_v_self->__pyx___watcher); + + __pyx_r = 1; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("gevent.libev.corecext._watcher_start", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_7watcher_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_7watcher_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + struct PyGeventLoopObject *__pyx_v_loop = 0; + PyObject *__pyx_v_ref = 0; + PyObject *__pyx_v_priority = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_loop,&__pyx_n_s_ref,&__pyx_n_s_priority,0}; + PyObject* values[3] = {0,0,0}; + values[1] = ((PyObject *)Py_True); + values[2] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_loop)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ref); + if (value) { values[1] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 2: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_priority); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 872, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_loop = ((struct PyGeventLoopObject *)values[0]); + __pyx_v_ref = values[1]; + __pyx_v_priority = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 872, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.libev.corecext.watcher.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_loop), __pyx_ptype_6gevent_5libev_8corecext_loop, 1, "loop", 0))) __PYX_ERR(0, 872, __pyx_L1_error) + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_7watcher___init__(((struct PyGeventWatcherObject *)__pyx_v_self), __pyx_v_loop, __pyx_v_ref, __pyx_v_priority); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_7watcher___init__(struct PyGeventWatcherObject *__pyx_v_self, struct PyGeventLoopObject *__pyx_v_loop, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + unsigned int __pyx_t_4; + int __pyx_t_5; + __Pyx_RefNannySetupContext("__init__", 0); + + __pyx_t_2 = ((!(__pyx_v_self->__pyx___watcher != 0)) != 0); + if (!__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_2 = ((!(__pyx_v_self->__pyx___ss->start != 0)) != 0); + if (!__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_2 = ((!(__pyx_v_self->__pyx___ss->stop != 0)) != 0); + __pyx_t_1 = __pyx_t_2; + __pyx_L4_bool_binop_done:; + if (unlikely(__pyx_t_1)) { + + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 874, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(0, 874, __pyx_L1_error) + + } + + __Pyx_INCREF(((PyObject *)__pyx_v_loop)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_loop)); + __Pyx_GOTREF(__pyx_v_self->loop); + __Pyx_DECREF(((PyObject *)__pyx_v_self->loop)); + __pyx_v_self->loop = __pyx_v_loop; + + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_ref); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 876, __pyx_L1_error) + if (__pyx_t_1) { + __pyx_t_4 = 0; + } else { + __pyx_t_4 = 4; + } + __pyx_v_self->_flags = __pyx_t_4; + + __pyx_t_1 = (__pyx_v_priority != Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_v_priority); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 878, __pyx_L1_error) + ev_set_priority(__pyx_v_self->__pyx___watcher, __pyx_t_5); + + } + + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("gevent.libev.corecext.watcher.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_3ref_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_3ref_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_7watcher_3ref___get__(((struct PyGeventWatcherObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_7watcher_3ref___get__(struct PyGeventWatcherObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + __Pyx_XDECREF(__pyx_r); + if (((__pyx_v_self->_flags & 4) != 0)) { + __Pyx_INCREF(Py_False); + __pyx_t_1 = Py_False; + } else { + __Pyx_INCREF(Py_True); + __pyx_t_1 = Py_True; + } + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_7watcher_3ref_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_7watcher_3ref_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_7watcher_3ref_2__set__(((struct PyGeventWatcherObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_7watcher_3ref_2__set__(struct PyGeventWatcherObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + __Pyx_RefNannySetupContext("__set__", 0); + + __pyx_t_1 = ((PyObject *)__pyx_v_self->loop); + __Pyx_INCREF(__pyx_t_1); + __pyx_t_2 = __pyx_f_6gevent_5libev_8corecext__check_loop(((struct PyGeventLoopObject *)__pyx_t_1)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 886, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_value); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 887, __pyx_L1_error) + if (__pyx_t_2) { + + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_ref); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 889, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 889, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_2) { + + __pyx_r = 0; + goto __pyx_L0; + + } + + __pyx_t_2 = ((__pyx_v_self->_flags & 2) != 0); + if (__pyx_t_2) { + + ev_ref(__pyx_v_self->loop->_ptr); + + } + + __pyx_v_self->_flags = (__pyx_v_self->_flags & (~6)); + + goto __pyx_L3; + } + + /*else*/ { + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_ref); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 898, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 898, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = ((!__pyx_t_2) != 0); + if (__pyx_t_3) { + + __pyx_r = 0; + goto __pyx_L0; + + } + + __pyx_v_self->_flags = (__pyx_v_self->_flags | 4); + + __pyx_t_2 = ((!((__pyx_v_self->_flags & 2) != 0)) != 0); + if (__pyx_t_2) { + } else { + __pyx_t_3 = __pyx_t_2; + goto __pyx_L8_bool_binop_done; + } + __pyx_t_2 = (ev_is_active(__pyx_v_self->__pyx___watcher) != 0); + __pyx_t_3 = __pyx_t_2; + __pyx_L8_bool_binop_done:; + if (__pyx_t_3) { + + ev_unref(__pyx_v_self->loop->_ptr); + + __pyx_v_self->_flags = (__pyx_v_self->_flags | 2); + + } + } + __pyx_L3:; + + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.libev.corecext.watcher.ref.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_8callback_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_8callback_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_7watcher_8callback___get__(((struct PyGeventWatcherObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_7watcher_8callback___get__(struct PyGeventWatcherObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->_callback); + __pyx_r = __pyx_v_self->_callback; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_7watcher_8callback_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_callback); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_7watcher_8callback_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_callback) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_7watcher_8callback_2__set__(((struct PyGeventWatcherObject *)__pyx_v_self), ((PyObject *)__pyx_v_callback)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_7watcher_8callback_2__set__(struct PyGeventWatcherObject *__pyx_v_self, PyObject *__pyx_v_callback) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + __Pyx_RefNannySetupContext("__set__", 0); + + __pyx_t_2 = (__pyx_v_callback != Py_None); + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + } else { + __pyx_t_1 = __pyx_t_3; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_3 = __Pyx_PyCallable_Check(__pyx_v_callback); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 911, __pyx_L1_error) + __pyx_t_2 = ((!(__pyx_t_3 != 0)) != 0); + __pyx_t_1 = __pyx_t_2; + __pyx_L4_bool_binop_done:; + if (unlikely(__pyx_t_1)) { + + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 912, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_callback); + __Pyx_GIVEREF(__pyx_v_callback); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_callback); + __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_Expected_callable_not_r, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 912, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 912, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __PYX_ERR(0, 912, __pyx_L1_error) + + } + + __Pyx_INCREF(__pyx_v_callback); + __Pyx_GIVEREF(__pyx_v_callback); + __Pyx_GOTREF(__pyx_v_self->_callback); + __Pyx_DECREF(__pyx_v_self->_callback); + __pyx_v_self->_callback = __pyx_v_callback; + + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("gevent.libev.corecext.watcher.callback.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_8priority_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_8priority_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_7watcher_8priority___get__(((struct PyGeventWatcherObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_7watcher_8priority___get__(struct PyGeventWatcherObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_int(ev_priority(__pyx_v_self->__pyx___watcher)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 917, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.libev.corecext.watcher.priority.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_7watcher_8priority_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_priority); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_7watcher_8priority_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_priority) { + int __pyx_v_priority; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + assert(__pyx_arg_priority); { + __pyx_v_priority = __Pyx_PyInt_As_int(__pyx_arg_priority); if (unlikely((__pyx_v_priority == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 920, __pyx_L3_error) + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.libev.corecext.watcher.priority.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_7watcher_8priority_2__set__(((struct PyGeventWatcherObject *)__pyx_v_self), ((int)__pyx_v_priority)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_7watcher_8priority_2__set__(struct PyGeventWatcherObject *__pyx_v_self, int __pyx_v_priority) { + struct ev_watcher *__pyx_v_w; + int __pyx_r; + __Pyx_RefNannyDeclarations + struct ev_watcher *__pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("__set__", 0); + + __pyx_t_1 = __pyx_v_self->__pyx___watcher; + __pyx_v_w = __pyx_t_1; + + __pyx_t_2 = (ev_is_active(__pyx_v_w) != 0); + if (unlikely(__pyx_t_2)) { + + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_AttributeError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 923, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(0, 923, __pyx_L1_error) + + } + + ev_set_priority(__pyx_v_w, __pyx_v_priority); + + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("gevent.libev.corecext.watcher.priority.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_6active_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_6active_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_7watcher_6active___get__(((struct PyGeventWatcherObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_7watcher_6active___get__(struct PyGeventWatcherObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + __Pyx_XDECREF(__pyx_r); + if ((ev_is_active(__pyx_v_self->__pyx___watcher) != 0)) { + __Pyx_INCREF(Py_True); + __pyx_t_1 = Py_True; + } else { + __Pyx_INCREF(Py_False); + __pyx_t_1 = Py_False; + } + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_7pending_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_7pending_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_7watcher_7pending___get__(((struct PyGeventWatcherObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_7watcher_7pending___get__(struct PyGeventWatcherObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + __Pyx_XDECREF(__pyx_r); + if ((ev_is_pending(__pyx_v_self->__pyx___watcher) != 0)) { + __Pyx_INCREF(Py_True); + __pyx_t_1 = Py_True; + } else { + __Pyx_INCREF(Py_False); + __pyx_t_1 = Py_False; + } + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_3start(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_3start(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_callback = 0; + PyObject *__pyx_v_args = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("start (wrapper)", 0); + if (PyTuple_GET_SIZE(__pyx_args) > 1) { + __pyx_v_args = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args)); + if (unlikely(!__pyx_v_args)) { + __Pyx_RefNannyFinishContext(); + return NULL; + } + __Pyx_GOTREF(__pyx_v_args); + } else { + __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple); + } + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_callback,0}; + PyObject* values[1] = {0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + default: + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_callback)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "start") < 0)) __PYX_ERR(0, 934, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) < 1) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + } + __pyx_v_callback = values[0]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("start", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 934, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0; + __Pyx_AddTraceback("gevent.libev.corecext.watcher.start", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_7watcher_2start(((struct PyGeventWatcherObject *)__pyx_v_self), __pyx_v_callback, __pyx_v_args); + + /* function exit code */ + __Pyx_XDECREF(__pyx_v_args); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_7watcher_2start(struct PyGeventWatcherObject *__pyx_v_self, PyObject *__pyx_v_callback, PyObject *__pyx_v_args) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("start", 0); + + __pyx_t_1 = __pyx_f_6gevent_5libev_8corecext__watcher_start(__pyx_v_self, __pyx_v_callback, __pyx_v_args); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 935, __pyx_L1_error) + + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("gevent.libev.corecext.watcher.start", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_5stop(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_5stop(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("stop (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_7watcher_4stop(((struct PyGeventWatcherObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_7watcher_4stop(struct PyGeventWatcherObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + __Pyx_RefNannySetupContext("stop", 0); + + __pyx_t_1 = ((PyObject *)__pyx_v_self->loop); + __Pyx_INCREF(__pyx_t_1); + __pyx_t_2 = __pyx_f_6gevent_5libev_8corecext__check_loop(((struct PyGeventLoopObject *)__pyx_t_1)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 938, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + __pyx_f_6gevent_5libev_8corecext__libev_ref(__pyx_v_self); + + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->_callback); + __Pyx_DECREF(__pyx_v_self->_callback); + __pyx_v_self->_callback = Py_None; + + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->args); + __Pyx_DECREF(__pyx_v_self->args); + __pyx_v_self->args = ((PyObject*)Py_None); + + __pyx_v_self->__pyx___ss->stop(__pyx_v_self->loop->_ptr, __pyx_v_self->__pyx___watcher); + + __pyx_f_6gevent_5libev_8corecext__python_decref(__pyx_v_self); + + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.libev.corecext.watcher.stop", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_7feed(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_7feed(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + int __pyx_v_revents; + PyObject *__pyx_v_callback = 0; + PyObject *__pyx_v_args = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("feed (wrapper)", 0); + if (PyTuple_GET_SIZE(__pyx_args) > 2) { + __pyx_v_args = PyTuple_GetSlice(__pyx_args, 2, PyTuple_GET_SIZE(__pyx_args)); + if (unlikely(!__pyx_v_args)) { + __Pyx_RefNannyFinishContext(); + return NULL; + } + __Pyx_GOTREF(__pyx_v_args); + } else { + __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple); + } + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_revents,&__pyx_n_s_callback,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + default: + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_revents)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_callback)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("feed", 0, 2, 2, 1); __PYX_ERR(0, 947, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t used_pos_args = (pos_args < 2) ? pos_args : 2; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "feed") < 0)) __PYX_ERR(0, 947, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) < 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_revents = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_revents == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 947, __pyx_L3_error) + __pyx_v_callback = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("feed", 0, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 947, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0; + __Pyx_AddTraceback("gevent.libev.corecext.watcher.feed", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_7watcher_6feed(((struct PyGeventWatcherObject *)__pyx_v_self), __pyx_v_revents, __pyx_v_callback, __pyx_v_args); + + /* function exit code */ + __Pyx_XDECREF(__pyx_v_args); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_7watcher_6feed(struct PyGeventWatcherObject *__pyx_v_self, int __pyx_v_revents, PyObject *__pyx_v_callback, PyObject *__pyx_v_args) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + __Pyx_RefNannySetupContext("feed", 0); + + __pyx_t_1 = ((PyObject *)__pyx_v_self->loop); + __Pyx_INCREF(__pyx_t_1); + __pyx_t_2 = __pyx_f_6gevent_5libev_8corecext__check_loop(((struct PyGeventLoopObject *)__pyx_t_1)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 948, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_callback, __pyx_v_callback) < 0) __PYX_ERR(0, 949, __pyx_L1_error) + + __Pyx_INCREF(__pyx_v_args); + __Pyx_GIVEREF(__pyx_v_args); + __Pyx_GOTREF(__pyx_v_self->args); + __Pyx_DECREF(__pyx_v_self->args); + __pyx_v_self->args = __pyx_v_args; + + __pyx_f_6gevent_5libev_8corecext__libev_unref(__pyx_v_self); + + ev_feed_event(__pyx_v_self->loop->_ptr, __pyx_v_self->__pyx___watcher, __pyx_v_revents); + + __pyx_f_6gevent_5libev_8corecext__python_incref(__pyx_v_self); + + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.libev.corecext.watcher.feed", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_9__repr__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_9__repr__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_7watcher_8__repr__(((struct PyGeventWatcherObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_7watcher_8__repr__(struct PyGeventWatcherObject *__pyx_v_self) { + PyObject *__pyx_v_format = NULL; + PyObject *__pyx_v_result = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + int __pyx_t_6; + int __pyx_t_7; + char const *__pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + PyObject *__pyx_t_14 = NULL; + __Pyx_RefNannySetupContext("__repr__", 0); + + __pyx_t_1 = ((Py_ReprEnter(((PyObject *)__pyx_v_self)) != 0) != 0); + if (__pyx_t_1) { + + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_kp_s__5); + __pyx_r = __pyx_kp_s__5; + goto __pyx_L0; + + } + + /*try:*/ { + + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 959, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 959, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_format = __pyx_t_2; + __pyx_t_2 = 0; + + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 960, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 960, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 960, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 960, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2); + __Pyx_INCREF(__pyx_v_format); + __Pyx_GIVEREF(__pyx_v_format); + PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_format); + __pyx_t_3 = 0; + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_s_at_0x_x_s, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 960, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_result = ((PyObject*)__pyx_t_2); + __pyx_t_2 = 0; + + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_active); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 961, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 961, __pyx_L5_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_1) { + + __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_kp_s_active_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 962, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_2)); + __pyx_t_2 = 0; + + } + + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_pending); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 963, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 963, __pyx_L5_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_1) { + + __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_kp_s_pending_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 964, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_2)); + __pyx_t_2 = 0; + + } + + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_callback); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 965, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = (__pyx_t_2 != Py_None); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_5 = (__pyx_t_1 != 0); + if (__pyx_t_5) { + + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_callback); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 966, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 966, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_callback_r, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 966, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 966, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_4)); + __pyx_t_4 = 0; + + } + + __pyx_t_5 = (__pyx_v_self->args != ((PyObject*)Py_None)); + __pyx_t_1 = (__pyx_t_5 != 0); + if (__pyx_t_1) { + + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 968, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_self->args); + __Pyx_GIVEREF(__pyx_v_self->args); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_self->args); + __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_args_r, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 968, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 968, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_4)); + __pyx_t_4 = 0; + + } + + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = PyNumber_Add(__pyx_v_result, __pyx_kp_s__6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 969, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L4_return; + } + + /*finally:*/ { + __pyx_L5_error:; + /*exception exit:*/{ + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14); + if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11) < 0)) __Pyx_ErrFetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); + __Pyx_XGOTREF(__pyx_t_9); + __Pyx_XGOTREF(__pyx_t_10); + __Pyx_XGOTREF(__pyx_t_11); + __Pyx_XGOTREF(__pyx_t_12); + __Pyx_XGOTREF(__pyx_t_13); + __Pyx_XGOTREF(__pyx_t_14); + __pyx_t_6 = __pyx_lineno; __pyx_t_7 = __pyx_clineno; __pyx_t_8 = __pyx_filename; + { + Py_ReprLeave(((PyObject *)__pyx_v_self)); + } + if (PY_MAJOR_VERSION >= 3) { + __Pyx_XGIVEREF(__pyx_t_12); + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14); + } + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_ErrRestore(__pyx_t_9, __pyx_t_10, __pyx_t_11); + __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; + __pyx_lineno = __pyx_t_6; __pyx_clineno = __pyx_t_7; __pyx_filename = __pyx_t_8; + goto __pyx_L1_error; + } + __pyx_L4_return: { + __pyx_t_14 = __pyx_r; + __pyx_r = 0; + Py_ReprLeave(((PyObject *)__pyx_v_self)); + __pyx_r = __pyx_t_14; + __pyx_t_14 = 0; + goto __pyx_L0; + } + } + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("gevent.libev.corecext.watcher.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_format); + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_11_format(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_11_format(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_format (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_7watcher_10_format(((struct PyGeventWatcherObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_7watcher_10_format(CYTHON_UNUSED struct PyGeventWatcherObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_format", 0); + + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_kp_s__7); + __pyx_r = __pyx_kp_s__7; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_13close(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_13close(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("close (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_7watcher_12close(((struct PyGeventWatcherObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_7watcher_12close(struct PyGeventWatcherObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("close", 0); + + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_stop); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 977, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 977, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("gevent.libev.corecext.watcher.close", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_15__enter__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_15__enter__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__enter__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_7watcher_14__enter__(((struct PyGeventWatcherObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_7watcher_14__enter__(struct PyGeventWatcherObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__enter__", 0); + + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __pyx_r = ((PyObject *)__pyx_v_self); + goto __pyx_L0; + + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_17__exit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_17__exit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + CYTHON_UNUSED PyObject *__pyx_v_t = 0; + CYTHON_UNUSED PyObject *__pyx_v_v = 0; + CYTHON_UNUSED PyObject *__pyx_v_tb = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__exit__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_t,&__pyx_n_s_v,&__pyx_n_s_tb,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_v)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, 1); __PYX_ERR(0, 982, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tb)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, 2); __PYX_ERR(0, 982, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__exit__") < 0)) __PYX_ERR(0, 982, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + } + __pyx_v_t = values[0]; + __pyx_v_v = values[1]; + __pyx_v_tb = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 982, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.libev.corecext.watcher.__exit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_7watcher_16__exit__(((struct PyGeventWatcherObject *)__pyx_v_self), __pyx_v_t, __pyx_v_v, __pyx_v_tb); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_7watcher_16__exit__(struct PyGeventWatcherObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_t, CYTHON_UNUSED PyObject *__pyx_v_v, CYTHON_UNUSED PyObject *__pyx_v_tb) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("__exit__", 0); + + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 983, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 983, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("gevent.libev.corecext.watcher.__exit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_4loop_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_4loop_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_7watcher_4loop___get__(((struct PyGeventWatcherObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_7watcher_4loop___get__(struct PyGeventWatcherObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_self->loop)); + __pyx_r = ((PyObject *)__pyx_v_self->loop); + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_7watcher_4loop_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_7watcher_4loop_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_7watcher_4loop_2__set__(((struct PyGeventWatcherObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_7watcher_4loop_2__set__(struct PyGeventWatcherObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__set__", 0); + if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_6gevent_5libev_8corecext_loop))))) __PYX_ERR(0, 830, __pyx_L1_error) + __pyx_t_1 = __pyx_v_value; + __Pyx_INCREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_self->loop); + __Pyx_DECREF(((PyObject *)__pyx_v_self->loop)); + __pyx_v_self->loop = ((struct PyGeventLoopObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.libev.corecext.watcher.loop.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_7watcher_4loop_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_7watcher_4loop_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_7watcher_4loop_4__del__(((struct PyGeventWatcherObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_7watcher_4loop_4__del__(struct PyGeventWatcherObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->loop); + __Pyx_DECREF(((PyObject *)__pyx_v_self->loop)); + __pyx_v_self->loop = ((struct PyGeventLoopObject *)Py_None); + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_4args_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_4args_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_7watcher_4args___get__(((struct PyGeventWatcherObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_7watcher_4args___get__(struct PyGeventWatcherObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->args); + __pyx_r = __pyx_v_self->args; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_7watcher_4args_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_7watcher_4args_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_7watcher_4args_2__set__(((struct PyGeventWatcherObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_7watcher_4args_2__set__(struct PyGeventWatcherObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__set__", 0); + if (!(likely(PyTuple_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v_value)->tp_name), 0))) __PYX_ERR(0, 832, __pyx_L1_error) + __pyx_t_1 = __pyx_v_value; + __Pyx_INCREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_self->args); + __Pyx_DECREF(__pyx_v_self->args); + __pyx_v_self->args = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.libev.corecext.watcher.args.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_7watcher_4args_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_7watcher_4args_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_7watcher_4args_4__del__(((struct PyGeventWatcherObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_7watcher_4args_4__del__(struct PyGeventWatcherObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->args); + __Pyx_DECREF(__pyx_v_self->args); + __pyx_v_self->args = ((PyObject*)Py_None); + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_6_flags_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_6_flags_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_7watcher_6_flags___get__(((struct PyGeventWatcherObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_7watcher_6_flags___get__(struct PyGeventWatcherObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_unsigned_int(__pyx_v_self->_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 870, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.libev.corecext.watcher._flags.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_2io_1start(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_2io_1start(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_callback = 0; + PyObject *__pyx_v_pass_events = 0; + PyObject *__pyx_v_args = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("start (wrapper)", 0); + if (PyTuple_GET_SIZE(__pyx_args) > 1) { + __pyx_v_args = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args)); + if (unlikely(!__pyx_v_args)) { + __Pyx_RefNannyFinishContext(); + return NULL; + } + __Pyx_GOTREF(__pyx_v_args); + } else { + __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple); + } + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_callback,&__pyx_n_s_pass_events,0}; + PyObject* values[2] = {0,0}; + values[1] = ((PyObject *)Py_False); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + default: + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_callback)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + } + if (kw_args == 1) { + const Py_ssize_t index = 1; + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, *__pyx_pyargnames[index]); + if (value) { values[index] = value; kw_args--; } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "start") < 0)) __PYX_ERR(0, 992, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) < 1) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + } + __pyx_v_callback = values[0]; + __pyx_v_pass_events = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("start", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 992, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0; + __Pyx_AddTraceback("gevent.libev.corecext.io.start", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_2io_start(((struct PyGeventIOObject *)__pyx_v_self), __pyx_v_callback, __pyx_v_pass_events, __pyx_v_args); + + /* function exit code */ + __Pyx_XDECREF(__pyx_v_args); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_2io_start(struct PyGeventIOObject *__pyx_v_self, PyObject *__pyx_v_callback, PyObject *__pyx_v_pass_events, PyObject *__pyx_v_args) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("start", 0); + __Pyx_INCREF(__pyx_v_args); + + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_pass_events); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 993, __pyx_L1_error) + if (__pyx_t_1) { + + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 994, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(GEVENT_CORE_EVENTS); + __Pyx_GIVEREF(GEVENT_CORE_EVENTS); + PyTuple_SET_ITEM(__pyx_t_2, 0, GEVENT_CORE_EVENTS); + __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_v_args); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 994, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF_SET(__pyx_v_args, ((PyObject*)__pyx_t_3)); + __pyx_t_3 = 0; + + } + + __pyx_t_1 = __pyx_f_6gevent_5libev_8corecext__watcher_start(((struct PyGeventWatcherObject *)__pyx_v_self), __pyx_v_callback, __pyx_v_args); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 995, __pyx_L1_error) + + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("gevent.libev.corecext.io.start", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_args); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_2io_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_2io_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + struct PyGeventLoopObject *__pyx_v_loop = 0; + CYTHON_UNUSED vfd_socket_t __pyx_v_fd; + CYTHON_UNUSED int __pyx_v_events; + PyObject *__pyx_v_ref = 0; + PyObject *__pyx_v_priority = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_loop,&__pyx_n_s_fd,&__pyx_n_s_events_2,&__pyx_n_s_ref,&__pyx_n_s_priority,0}; + PyObject* values[5] = {0,0,0,0,0}; + values[3] = ((PyObject *)Py_True); + values[4] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + CYTHON_FALLTHROUGH; + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_loop)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_fd)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 5, 1); __PYX_ERR(0, 997, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_events_2)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 5, 2); __PYX_ERR(0, 997, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 3: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ref); + if (value) { values[3] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 4: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_priority); + if (value) { values[4] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 997, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + CYTHON_FALLTHROUGH; + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_loop = ((struct PyGeventLoopObject *)values[0]); + __pyx_v_fd = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_fd == ((vfd_socket_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 997, __pyx_L3_error) + __pyx_v_events = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_events == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 997, __pyx_L3_error) + __pyx_v_ref = values[3]; + __pyx_v_priority = values[4]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 997, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.libev.corecext.io.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_loop), __pyx_ptype_6gevent_5libev_8corecext_loop, 1, "loop", 0))) __PYX_ERR(0, 997, __pyx_L1_error) + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_2io_2__init__(((struct PyGeventIOObject *)__pyx_v_self), __pyx_v_loop, __pyx_v_fd, __pyx_v_events, __pyx_v_ref, __pyx_v_priority); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_2io_2__init__(struct PyGeventIOObject *__pyx_v_self, struct PyGeventLoopObject *__pyx_v_loop, CYTHON_UNUSED vfd_socket_t __pyx_v_fd, CYTHON_UNUSED int __pyx_v_events, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + __Pyx_RefNannySetupContext("__init__", 0); + + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_6gevent_5libev_8corecext_watcher), __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 998, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + __pyx_t_4 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_4 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[5] = {__pyx_t_3, ((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_loop), __pyx_v_ref, __pyx_v_priority}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 4+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 998, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[5] = {__pyx_t_3, ((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_loop), __pyx_v_ref, __pyx_v_priority}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 4+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 998, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else + #endif + { + __pyx_t_5 = PyTuple_New(4+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 998, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (__pyx_t_3) { + __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL; + } + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, ((PyObject *)__pyx_v_self)); + __Pyx_INCREF(((PyObject *)__pyx_v_loop)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_loop)); + PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, ((PyObject *)__pyx_v_loop)); + __Pyx_INCREF(__pyx_v_ref); + __Pyx_GIVEREF(__pyx_v_ref); + PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_4, __pyx_v_ref); + __Pyx_INCREF(__pyx_v_priority); + __Pyx_GIVEREF(__pyx_v_priority); + PyTuple_SET_ITEM(__pyx_t_5, 3+__pyx_t_4, __pyx_v_priority); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 998, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("gevent.libev.corecext.io.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_2io_5__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_2io_5__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_loop = 0; + vfd_socket_t __pyx_v_fd; + int __pyx_v_events; + CYTHON_UNUSED PyObject *__pyx_v_ref = 0; + CYTHON_UNUSED PyObject *__pyx_v_priority = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_loop,&__pyx_n_s_fd,&__pyx_n_s_events_2,&__pyx_n_s_ref,&__pyx_n_s_priority,0}; + PyObject* values[5] = {0,0,0,0,0}; + values[3] = ((PyObject *)Py_True); + values[4] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + CYTHON_FALLTHROUGH; + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_loop)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_fd)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 1); __PYX_ERR(0, 1000, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_events_2)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 2); __PYX_ERR(0, 1000, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 3: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ref); + if (value) { values[3] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 4: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_priority); + if (value) { values[4] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 1000, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + CYTHON_FALLTHROUGH; + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_loop = ((struct PyGeventLoopObject *)values[0]); + __pyx_v_fd = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_fd == ((vfd_socket_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1000, __pyx_L3_error) + __pyx_v_events = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_events == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1000, __pyx_L3_error) + __pyx_v_ref = values[3]; + __pyx_v_priority = values[4]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1000, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.libev.corecext.io.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_loop), __pyx_ptype_6gevent_5libev_8corecext_loop, 1, "loop", 0))) __PYX_ERR(0, 1000, __pyx_L1_error) + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_2io_4__cinit__(((struct PyGeventIOObject *)__pyx_v_self), __pyx_v_loop, __pyx_v_fd, __pyx_v_events, __pyx_v_ref, __pyx_v_priority); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_2io_4__cinit__(struct PyGeventIOObject *__pyx_v_self, CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_loop, vfd_socket_t __pyx_v_fd, int __pyx_v_events, CYTHON_UNUSED PyObject *__pyx_v_ref, CYTHON_UNUSED PyObject *__pyx_v_priority) { + int __pyx_v_vfd; + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + __Pyx_RefNannySetupContext("__cinit__", 0); + + __pyx_t_1 = ((__pyx_v_fd < 0) != 0); + if (unlikely(__pyx_t_1)) { + + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_fd); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1002, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_fd_must_be_non_negative_r, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1002, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1002, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 1002, __pyx_L1_error) + + } + + __pyx_t_1 = ((__pyx_v_events & (~((EV__IOFDSET | EV_READ) | EV_WRITE))) != 0); + if (unlikely(__pyx_t_1)) { + + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_events); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1004, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_illegal_event_mask_r, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1004, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1004, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 1004, __pyx_L1_error) + + } + + __pyx_t_4 = vfd_open(__pyx_v_fd); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 1006, __pyx_L1_error) + __pyx_v_vfd = __pyx_t_4; + + ev_io_init((&__pyx_v_self->_watcher), ((void *)gevent_callback_io), __pyx_v_vfd, __pyx_v_events); + + __pyx_v_self->__pyx_base.__pyx___watcher = ((struct ev_watcher *)(&__pyx_v_self->_watcher)); + + __pyx_v_self->__pyx_base.__pyx___ss = (&__pyx_v_6gevent_5libev_8corecext_io_ss); + + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("gevent.libev.corecext.io.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static void __pyx_pw_6gevent_5libev_8corecext_2io_7__dealloc__(PyObject *__pyx_v_self); /*proto*/ +static void __pyx_pw_6gevent_5libev_8corecext_2io_7__dealloc__(PyObject *__pyx_v_self) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); + __pyx_pf_6gevent_5libev_8corecext_2io_6__dealloc__(((struct PyGeventIOObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +static void __pyx_pf_6gevent_5libev_8corecext_2io_6__dealloc__(struct PyGeventIOObject *__pyx_v_self) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__dealloc__", 0); + + vfd_free(__pyx_v_self->_watcher.fd); + + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_2io_2fd_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_2io_2fd_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_2io_2fd___get__(((struct PyGeventIOObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_2io_2fd___get__(struct PyGeventIOObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyInt_FromSsize_t(vfd_get(__pyx_v_self->_watcher.fd)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1016, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.libev.corecext.io.fd.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_2io_2fd_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_fd); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_2io_2fd_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_fd) { + long __pyx_v_fd; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + assert(__pyx_arg_fd); { + __pyx_v_fd = __Pyx_PyInt_As_long(__pyx_arg_fd); if (unlikely((__pyx_v_fd == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 1019, __pyx_L3_error) + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.libev.corecext.io.fd.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_2io_2fd_2__set__(((struct PyGeventIOObject *)__pyx_v_self), ((long)__pyx_v_fd)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_2io_2fd_2__set__(struct PyGeventIOObject *__pyx_v_self, long __pyx_v_fd) { + int __pyx_v_vfd; + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + __Pyx_RefNannySetupContext("__set__", 0); + + __pyx_t_1 = (ev_is_active((&__pyx_v_self->_watcher)) != 0); + if (unlikely(__pyx_t_1)) { + + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_AttributeError, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1021, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 1021, __pyx_L1_error) + + } + + __pyx_t_3 = vfd_open(__pyx_v_fd); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 1022, __pyx_L1_error) + __pyx_v_vfd = __pyx_t_3; + + vfd_free(__pyx_v_self->_watcher.fd); + + ev_io_init((&__pyx_v_self->_watcher), ((void *)gevent_callback_io), __pyx_v_vfd, __pyx_v_self->_watcher.events); + + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent.libev.corecext.io.fd.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_2io_6events_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_2io_6events_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_2io_6events___get__(((struct PyGeventIOObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_2io_6events___get__(struct PyGeventIOObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->_watcher.events); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1028, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.libev.corecext.io.events.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_2io_6events_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_events); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_2io_6events_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_events) { + int __pyx_v_events; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + assert(__pyx_arg_events); { + __pyx_v_events = __Pyx_PyInt_As_int(__pyx_arg_events); if (unlikely((__pyx_v_events == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1031, __pyx_L3_error) + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.libev.corecext.io.events.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_2io_6events_2__set__(((struct PyGeventIOObject *)__pyx_v_self), ((int)__pyx_v_events)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_2io_6events_2__set__(struct PyGeventIOObject *__pyx_v_self, int __pyx_v_events) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("__set__", 0); + + __pyx_t_1 = (ev_is_active((&__pyx_v_self->_watcher)) != 0); + if (unlikely(__pyx_t_1)) { + + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_AttributeError, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1033, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 1033, __pyx_L1_error) + + } + + ev_io_init((&__pyx_v_self->_watcher), ((void *)gevent_callback_io), __pyx_v_self->_watcher.fd, __pyx_v_events); + + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent.libev.corecext.io.events.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_2io_10events_str_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_2io_10events_str_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_2io_10events_str___get__(((struct PyGeventIOObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_2io_10events_str___get__(struct PyGeventIOObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6gevent_5libev_8corecext__events_to_str(__pyx_v_self->_watcher.events, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1038, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.libev.corecext.io.events_str.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_2io_9_format(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_2io_9_format(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_format (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_2io_8_format(((struct PyGeventIOObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_2io_8_format(struct PyGeventIOObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("_format", 0); + + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_fd); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1041, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_events_str); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1041, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1041, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); + __pyx_t_1 = 0; + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_fd_s_events_s, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1041, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("gevent.libev.corecext.io._format", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_5timer_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_5timer_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_loop = 0; + double __pyx_v_after; + double __pyx_v_repeat; + CYTHON_UNUSED PyObject *__pyx_v_ref = 0; + CYTHON_UNUSED PyObject *__pyx_v_priority = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_loop,&__pyx_n_s_after,&__pyx_n_s_repeat,&__pyx_n_s_ref,&__pyx_n_s_priority,0}; + PyObject* values[5] = {0,0,0,0,0}; + values[3] = ((PyObject *)Py_True); + values[4] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + CYTHON_FALLTHROUGH; + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_loop)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_after); + if (value) { values[1] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 2: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_repeat); + if (value) { values[2] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 3: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ref); + if (value) { values[3] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 4: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_priority); + if (value) { values[4] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 1049, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + CYTHON_FALLTHROUGH; + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_loop = ((struct PyGeventLoopObject *)values[0]); + if (values[1]) { + __pyx_v_after = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_after == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1049, __pyx_L3_error) + } else { + __pyx_v_after = ((double)0.0); + } + if (values[2]) { + __pyx_v_repeat = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_repeat == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1049, __pyx_L3_error) + } else { + __pyx_v_repeat = ((double)0.0); + } + __pyx_v_ref = values[3]; + __pyx_v_priority = values[4]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1049, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.libev.corecext.timer.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_loop), __pyx_ptype_6gevent_5libev_8corecext_loop, 1, "loop", 0))) __PYX_ERR(0, 1049, __pyx_L1_error) + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_5timer___cinit__(((struct PyGeventTimerObject *)__pyx_v_self), __pyx_v_loop, __pyx_v_after, __pyx_v_repeat, __pyx_v_ref, __pyx_v_priority); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_5timer___cinit__(struct PyGeventTimerObject *__pyx_v_self, CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_loop, double __pyx_v_after, double __pyx_v_repeat, CYTHON_UNUSED PyObject *__pyx_v_ref, CYTHON_UNUSED PyObject *__pyx_v_priority) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("__cinit__", 0); + + __pyx_t_1 = ((__pyx_v_repeat < 0.0) != 0); + if (unlikely(__pyx_t_1)) { + + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_repeat); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1051, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_repeat_must_be_positive_or_zero, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1051, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1051, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 1051, __pyx_L1_error) + + } + + ev_timer_init((&__pyx_v_self->_watcher), ((void *)gevent_callback_timer), __pyx_v_after, __pyx_v_repeat); + + __pyx_v_self->__pyx_base.__pyx___watcher = ((struct ev_watcher *)(&__pyx_v_self->_watcher)); + + __pyx_v_self->__pyx_base.__pyx___ss = (&__pyx_v_6gevent_5libev_8corecext_timer_ss); + + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("gevent.libev.corecext.timer.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_5timer_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_5timer_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + struct PyGeventLoopObject *__pyx_v_loop = 0; + CYTHON_UNUSED double __pyx_v_after; + CYTHON_UNUSED double __pyx_v_repeat; + PyObject *__pyx_v_ref = 0; + PyObject *__pyx_v_priority = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_loop,&__pyx_n_s_after,&__pyx_n_s_repeat,&__pyx_n_s_ref,&__pyx_n_s_priority,0}; + PyObject* values[5] = {0,0,0,0,0}; + values[3] = ((PyObject *)Py_True); + values[4] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + CYTHON_FALLTHROUGH; + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_loop)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_after); + if (value) { values[1] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 2: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_repeat); + if (value) { values[2] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 3: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ref); + if (value) { values[3] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 4: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_priority); + if (value) { values[4] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 1056, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + CYTHON_FALLTHROUGH; + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_loop = ((struct PyGeventLoopObject *)values[0]); + if (values[1]) { + __pyx_v_after = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_after == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1056, __pyx_L3_error) + } else { + __pyx_v_after = ((double)0.0); + } + if (values[2]) { + __pyx_v_repeat = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_repeat == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1056, __pyx_L3_error) + } else { + __pyx_v_repeat = ((double)0.0); + } + __pyx_v_ref = values[3]; + __pyx_v_priority = values[4]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1056, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.libev.corecext.timer.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_loop), __pyx_ptype_6gevent_5libev_8corecext_loop, 1, "loop", 0))) __PYX_ERR(0, 1056, __pyx_L1_error) + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_5timer_2__init__(((struct PyGeventTimerObject *)__pyx_v_self), __pyx_v_loop, __pyx_v_after, __pyx_v_repeat, __pyx_v_ref, __pyx_v_priority); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_5timer_2__init__(struct PyGeventTimerObject *__pyx_v_self, struct PyGeventLoopObject *__pyx_v_loop, CYTHON_UNUSED double __pyx_v_after, CYTHON_UNUSED double __pyx_v_repeat, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + __Pyx_RefNannySetupContext("__init__", 0); + + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_6gevent_5libev_8corecext_watcher), __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1057, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + __pyx_t_4 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_4 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[5] = {__pyx_t_3, ((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_loop), __pyx_v_ref, __pyx_v_priority}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 4+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1057, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[5] = {__pyx_t_3, ((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_loop), __pyx_v_ref, __pyx_v_priority}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 4+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1057, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else + #endif + { + __pyx_t_5 = PyTuple_New(4+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1057, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (__pyx_t_3) { + __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL; + } + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, ((PyObject *)__pyx_v_self)); + __Pyx_INCREF(((PyObject *)__pyx_v_loop)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_loop)); + PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, ((PyObject *)__pyx_v_loop)); + __Pyx_INCREF(__pyx_v_ref); + __Pyx_GIVEREF(__pyx_v_ref); + PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_4, __pyx_v_ref); + __Pyx_INCREF(__pyx_v_priority); + __Pyx_GIVEREF(__pyx_v_priority); + PyTuple_SET_ITEM(__pyx_t_5, 3+__pyx_t_4, __pyx_v_priority); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1057, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("gevent.libev.corecext.timer.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_5timer_5start(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_5timer_5start(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_callback = 0; + PyObject *__pyx_v_update = 0; + PyObject *__pyx_v_args = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("start (wrapper)", 0); + if (PyTuple_GET_SIZE(__pyx_args) > 1) { + __pyx_v_args = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args)); + if (unlikely(!__pyx_v_args)) { + __Pyx_RefNannyFinishContext(); + return NULL; + } + __Pyx_GOTREF(__pyx_v_args); + } else { + __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple); + } + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_callback,&__pyx_n_s_update,0}; + PyObject* values[2] = {0,0}; + values[1] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + default: + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_callback)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + } + if (kw_args == 1) { + const Py_ssize_t index = 1; + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, *__pyx_pyargnames[index]); + if (value) { values[index] = value; kw_args--; } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "start") < 0)) __PYX_ERR(0, 1059, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) < 1) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + } + __pyx_v_callback = values[0]; + __pyx_v_update = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("start", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1059, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0; + __Pyx_AddTraceback("gevent.libev.corecext.timer.start", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_5timer_4start(((struct PyGeventTimerObject *)__pyx_v_self), __pyx_v_callback, __pyx_v_update, __pyx_v_args); + + /* function exit code */ + __Pyx_XDECREF(__pyx_v_args); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_5timer_4start(struct PyGeventTimerObject *__pyx_v_self, PyObject *__pyx_v_callback, PyObject *__pyx_v_update, PyObject *__pyx_v_args) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("start", 0); + __Pyx_INCREF(__pyx_v_update); + + __pyx_t_2 = (__pyx_v_update != Py_None); + if ((__pyx_t_2 != 0)) { + __Pyx_INCREF(__pyx_v_update); + __pyx_t_1 = __pyx_v_update; + } else { + __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_v_self->__pyx_base.loop->starting_timer_may_update_loop_time); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1060, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __pyx_t_3; + __pyx_t_3 = 0; + } + __Pyx_DECREF_SET(__pyx_v_update, __pyx_t_1); + __pyx_t_1 = 0; + + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_update); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1061, __pyx_L1_error) + if (__pyx_t_2) { + + ((struct __pyx_vtabstruct_6gevent_5libev_8corecext_loop *)__pyx_v_self->__pyx_base.loop->__pyx_vtab)->update_now(__pyx_v_self->__pyx_base.loop, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1062, __pyx_L1_error) + + } + + __pyx_t_2 = __pyx_f_6gevent_5libev_8corecext__watcher_start(((struct PyGeventWatcherObject *)__pyx_v_self), __pyx_v_callback, __pyx_v_args); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 1063, __pyx_L1_error) + + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("gevent.libev.corecext.timer.start", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_update); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_5timer_2at_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_5timer_2at_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_5timer_2at___get__(((struct PyGeventTimerObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_5timer_2at___get__(struct PyGeventTimerObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->_watcher.at); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1067, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.libev.corecext.timer.at.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_5timer_7again(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_5timer_7again(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_callback = 0; + PyObject *__pyx_v_update = 0; + PyObject *__pyx_v_args = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("again (wrapper)", 0); + if (PyTuple_GET_SIZE(__pyx_args) > 1) { + __pyx_v_args = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args)); + if (unlikely(!__pyx_v_args)) { + __Pyx_RefNannyFinishContext(); + return NULL; + } + __Pyx_GOTREF(__pyx_v_args); + } else { + __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple); + } + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_callback,&__pyx_n_s_update,0}; + PyObject* values[2] = {0,0}; + values[1] = ((PyObject *)Py_True); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + default: + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_callback)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + } + if (kw_args == 1) { + const Py_ssize_t index = 1; + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, *__pyx_pyargnames[index]); + if (value) { values[index] = value; kw_args--; } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "again") < 0)) __PYX_ERR(0, 1071, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) < 1) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + } + __pyx_v_callback = values[0]; + __pyx_v_update = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("again", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1071, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0; + __Pyx_AddTraceback("gevent.libev.corecext.timer.again", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_5timer_6again(((struct PyGeventTimerObject *)__pyx_v_self), __pyx_v_callback, __pyx_v_update, __pyx_v_args); + + /* function exit code */ + __Pyx_XDECREF(__pyx_v_args); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_5timer_6again(struct PyGeventTimerObject *__pyx_v_self, PyObject *__pyx_v_callback, PyObject *__pyx_v_update, PyObject *__pyx_v_args) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + __Pyx_RefNannySetupContext("again", 0); + + __pyx_t_1 = ((PyObject *)__pyx_v_self->__pyx_base.loop); + __Pyx_INCREF(__pyx_t_1); + __pyx_t_2 = __pyx_f_6gevent_5libev_8corecext__check_loop(((struct PyGeventLoopObject *)__pyx_t_1)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 1072, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_callback, __pyx_v_callback) < 0) __PYX_ERR(0, 1073, __pyx_L1_error) + + __Pyx_INCREF(__pyx_v_args); + __Pyx_GIVEREF(__pyx_v_args); + __Pyx_GOTREF(__pyx_v_self->__pyx_base.args); + __Pyx_DECREF(__pyx_v_self->__pyx_base.args); + __pyx_v_self->__pyx_base.args = __pyx_v_args; + + __pyx_f_6gevent_5libev_8corecext__libev_unref(((struct PyGeventWatcherObject *)__pyx_v_self)); + + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_update); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1076, __pyx_L1_error) + if (__pyx_t_2) { + + ev_now_update(__pyx_v_self->__pyx_base.loop->_ptr); + + } + + ev_timer_again(__pyx_v_self->__pyx_base.loop->_ptr, (&__pyx_v_self->_watcher)); + + __pyx_f_6gevent_5libev_8corecext__python_incref(((struct PyGeventWatcherObject *)__pyx_v_self)); + + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.libev.corecext.timer.again", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_6signal_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_6signal_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_loop = 0; + int __pyx_v_signalnum; + CYTHON_UNUSED PyObject *__pyx_v_ref = 0; + CYTHON_UNUSED PyObject *__pyx_v_priority = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_loop,&__pyx_n_s_signalnum,&__pyx_n_s_ref,&__pyx_n_s_priority,0}; + PyObject* values[4] = {0,0,0,0}; + values[2] = ((PyObject *)Py_True); + values[3] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_loop)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_signalnum)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 4, 1); __PYX_ERR(0, 1089, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ref); + if (value) { values[2] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 3: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_priority); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 1089, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_loop = ((struct PyGeventLoopObject *)values[0]); + __pyx_v_signalnum = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_signalnum == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1089, __pyx_L3_error) + __pyx_v_ref = values[2]; + __pyx_v_priority = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1089, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.libev.corecext.signal.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_loop), __pyx_ptype_6gevent_5libev_8corecext_loop, 1, "loop", 0))) __PYX_ERR(0, 1089, __pyx_L1_error) + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_6signal___cinit__(((struct PyGeventSignalObject *)__pyx_v_self), __pyx_v_loop, __pyx_v_signalnum, __pyx_v_ref, __pyx_v_priority); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_6signal___cinit__(struct PyGeventSignalObject *__pyx_v_self, CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_loop, int __pyx_v_signalnum, CYTHON_UNUSED PyObject *__pyx_v_ref, CYTHON_UNUSED PyObject *__pyx_v_priority) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + __Pyx_RefNannySetupContext("__cinit__", 0); + + __pyx_t_2 = ((__pyx_v_signalnum < 1) != 0); + if (!__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_signalnum); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1090, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_signalmodule); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1090, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_NSIG); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1090, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_t_5, Py_GE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1090, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1090, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_1 = __pyx_t_2; + __pyx_L4_bool_binop_done:; + if (unlikely(__pyx_t_1)) { + + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_signalnum); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1091, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_illegal_signal_number_r, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1091, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1091, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __PYX_ERR(0, 1091, __pyx_L1_error) + + } + + ev_signal_init((&__pyx_v_self->_watcher), ((void *)gevent_callback_signal), __pyx_v_signalnum); + + __pyx_v_self->__pyx_base.__pyx___watcher = ((struct ev_watcher *)(&__pyx_v_self->_watcher)); + + __pyx_v_self->__pyx_base.__pyx___ss = (&__pyx_v_6gevent_5libev_8corecext_signal_ss); + + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("gevent.libev.corecext.signal.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_6signal_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_6signal_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + struct PyGeventLoopObject *__pyx_v_loop = 0; + CYTHON_UNUSED int __pyx_v_signalnum; + PyObject *__pyx_v_ref = 0; + PyObject *__pyx_v_priority = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_loop,&__pyx_n_s_signalnum,&__pyx_n_s_ref,&__pyx_n_s_priority,0}; + PyObject* values[4] = {0,0,0,0}; + values[2] = ((PyObject *)Py_True); + values[3] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_loop)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_signalnum)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 4, 1); __PYX_ERR(0, 1101, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ref); + if (value) { values[2] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 3: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_priority); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 1101, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_loop = ((struct PyGeventLoopObject *)values[0]); + __pyx_v_signalnum = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_signalnum == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1101, __pyx_L3_error) + __pyx_v_ref = values[2]; + __pyx_v_priority = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1101, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.libev.corecext.signal.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_loop), __pyx_ptype_6gevent_5libev_8corecext_loop, 1, "loop", 0))) __PYX_ERR(0, 1101, __pyx_L1_error) + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_6signal_2__init__(((struct PyGeventSignalObject *)__pyx_v_self), __pyx_v_loop, __pyx_v_signalnum, __pyx_v_ref, __pyx_v_priority); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_6signal_2__init__(struct PyGeventSignalObject *__pyx_v_self, struct PyGeventLoopObject *__pyx_v_loop, CYTHON_UNUSED int __pyx_v_signalnum, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + __Pyx_RefNannySetupContext("__init__", 0); + + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_6gevent_5libev_8corecext_watcher), __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1102, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + __pyx_t_4 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_4 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[5] = {__pyx_t_3, ((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_loop), __pyx_v_ref, __pyx_v_priority}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 4+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1102, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[5] = {__pyx_t_3, ((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_loop), __pyx_v_ref, __pyx_v_priority}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 4+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1102, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else + #endif + { + __pyx_t_5 = PyTuple_New(4+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1102, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (__pyx_t_3) { + __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL; + } + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, ((PyObject *)__pyx_v_self)); + __Pyx_INCREF(((PyObject *)__pyx_v_loop)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_loop)); + PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, ((PyObject *)__pyx_v_loop)); + __Pyx_INCREF(__pyx_v_ref); + __Pyx_GIVEREF(__pyx_v_ref); + PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_4, __pyx_v_ref); + __Pyx_INCREF(__pyx_v_priority); + __Pyx_GIVEREF(__pyx_v_priority); + PyTuple_SET_ITEM(__pyx_t_5, 3+__pyx_t_4, __pyx_v_priority); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1102, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("gevent.libev.corecext.signal.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_4idle_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_4idle_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_loop = 0; + CYTHON_UNUSED PyObject *__pyx_v_ref = 0; + CYTHON_UNUSED PyObject *__pyx_v_priority = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_loop,&__pyx_n_s_ref,&__pyx_n_s_priority,0}; + PyObject* values[3] = {0,0,0}; + values[1] = ((PyObject *)Py_True); + values[2] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_loop)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ref); + if (value) { values[1] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 2: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_priority); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 1112, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_loop = ((struct PyGeventLoopObject *)values[0]); + __pyx_v_ref = values[1]; + __pyx_v_priority = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1112, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.libev.corecext.idle.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_loop), __pyx_ptype_6gevent_5libev_8corecext_loop, 1, "loop", 0))) __PYX_ERR(0, 1112, __pyx_L1_error) + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4idle___cinit__(((struct PyGeventIdleObject *)__pyx_v_self), __pyx_v_loop, __pyx_v_ref, __pyx_v_priority); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_4idle___cinit__(struct PyGeventIdleObject *__pyx_v_self, CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_loop, CYTHON_UNUSED PyObject *__pyx_v_ref, CYTHON_UNUSED PyObject *__pyx_v_priority) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__cinit__", 0); + + ev_idle_init((&__pyx_v_self->_watcher), ((void *)gevent_callback_idle)); + + __pyx_v_self->__pyx_base.__pyx___watcher = ((struct ev_watcher *)(&__pyx_v_self->_watcher)); + + __pyx_v_self->__pyx_base.__pyx___ss = (&__pyx_v_6gevent_5libev_8corecext_idle_ss); + + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_7prepare_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_7prepare_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_loop = 0; + CYTHON_UNUSED PyObject *__pyx_v_ref = 0; + CYTHON_UNUSED PyObject *__pyx_v_priority = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_loop,&__pyx_n_s_ref,&__pyx_n_s_priority,0}; + PyObject* values[3] = {0,0,0}; + values[1] = ((PyObject *)Py_True); + values[2] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_loop)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ref); + if (value) { values[1] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 2: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_priority); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 1125, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_loop = ((struct PyGeventLoopObject *)values[0]); + __pyx_v_ref = values[1]; + __pyx_v_priority = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1125, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.libev.corecext.prepare.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_loop), __pyx_ptype_6gevent_5libev_8corecext_loop, 1, "loop", 0))) __PYX_ERR(0, 1125, __pyx_L1_error) + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_7prepare___cinit__(((struct PyGeventPrepareObject *)__pyx_v_self), __pyx_v_loop, __pyx_v_ref, __pyx_v_priority); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_7prepare___cinit__(struct PyGeventPrepareObject *__pyx_v_self, CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_loop, CYTHON_UNUSED PyObject *__pyx_v_ref, CYTHON_UNUSED PyObject *__pyx_v_priority) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__cinit__", 0); + + ev_prepare_init((&__pyx_v_self->_watcher), ((void *)gevent_callback_prepare)); + + __pyx_v_self->__pyx_base.__pyx___watcher = ((struct ev_watcher *)(&__pyx_v_self->_watcher)); + + __pyx_v_self->__pyx_base.__pyx___ss = (&__pyx_v_6gevent_5libev_8corecext_prepare_ss); + + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_5check_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_5check_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_loop = 0; + CYTHON_UNUSED PyObject *__pyx_v_ref = 0; + CYTHON_UNUSED PyObject *__pyx_v_priority = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_loop,&__pyx_n_s_ref,&__pyx_n_s_priority,0}; + PyObject* values[3] = {0,0,0}; + values[1] = ((PyObject *)Py_True); + values[2] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_loop)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ref); + if (value) { values[1] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 2: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_priority); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 1138, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_loop = ((struct PyGeventLoopObject *)values[0]); + __pyx_v_ref = values[1]; + __pyx_v_priority = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1138, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.libev.corecext.check.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_loop), __pyx_ptype_6gevent_5libev_8corecext_loop, 1, "loop", 0))) __PYX_ERR(0, 1138, __pyx_L1_error) + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_5check___cinit__(((struct PyGeventCheckObject *)__pyx_v_self), __pyx_v_loop, __pyx_v_ref, __pyx_v_priority); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_5check___cinit__(struct PyGeventCheckObject *__pyx_v_self, CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_loop, CYTHON_UNUSED PyObject *__pyx_v_ref, CYTHON_UNUSED PyObject *__pyx_v_priority) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__cinit__", 0); + + ev_check_init((&__pyx_v_self->_watcher), ((void *)gevent_callback_check)); + + __pyx_v_self->__pyx_base.__pyx___watcher = ((struct ev_watcher *)(&__pyx_v_self->_watcher)); + + __pyx_v_self->__pyx_base.__pyx___ss = (&__pyx_v_6gevent_5libev_8corecext_check_ss); + + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_4fork_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_4fork_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_loop = 0; + CYTHON_UNUSED PyObject *__pyx_v_ref = 0; + CYTHON_UNUSED PyObject *__pyx_v_priority = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_loop,&__pyx_n_s_ref,&__pyx_n_s_priority,0}; + PyObject* values[3] = {0,0,0}; + values[1] = ((PyObject *)Py_True); + values[2] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_loop)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ref); + if (value) { values[1] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 2: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_priority); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 1151, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_loop = ((struct PyGeventLoopObject *)values[0]); + __pyx_v_ref = values[1]; + __pyx_v_priority = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1151, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.libev.corecext.fork.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_loop), __pyx_ptype_6gevent_5libev_8corecext_loop, 1, "loop", 0))) __PYX_ERR(0, 1151, __pyx_L1_error) + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4fork___cinit__(((struct PyGeventForkObject *)__pyx_v_self), __pyx_v_loop, __pyx_v_ref, __pyx_v_priority); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_4fork___cinit__(struct PyGeventForkObject *__pyx_v_self, CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_loop, CYTHON_UNUSED PyObject *__pyx_v_ref, CYTHON_UNUSED PyObject *__pyx_v_priority) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__cinit__", 0); + + ev_fork_init((&__pyx_v_self->_watcher), ((void *)gevent_callback_fork)); + + __pyx_v_self->__pyx_base.__pyx___watcher = ((struct ev_watcher *)(&__pyx_v_self->_watcher)); + + __pyx_v_self->__pyx_base.__pyx___ss = (&__pyx_v_6gevent_5libev_8corecext_fork_ss); + + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_6async__7pending_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_6async__7pending_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_6async__7pending___get__(((struct PyGeventAsyncObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_6async__7pending___get__(struct PyGeventAsyncObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + __Pyx_XDECREF(__pyx_r); + if ((ev_async_pending((&__pyx_v_self->_watcher)) != 0)) { + __Pyx_INCREF(Py_True); + __pyx_t_1 = Py_True; + } else { + __Pyx_INCREF(Py_False); + __pyx_t_1 = Py_False; + } + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_6async__1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_6async__1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_loop = 0; + CYTHON_UNUSED PyObject *__pyx_v_ref = 0; + CYTHON_UNUSED PyObject *__pyx_v_priority = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_loop,&__pyx_n_s_ref,&__pyx_n_s_priority,0}; + PyObject* values[3] = {0,0,0}; + values[1] = ((PyObject *)Py_True); + values[2] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_loop)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ref); + if (value) { values[1] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 2: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_priority); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 1168, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_loop = ((struct PyGeventLoopObject *)values[0]); + __pyx_v_ref = values[1]; + __pyx_v_priority = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1168, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.libev.corecext.async_.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_loop), __pyx_ptype_6gevent_5libev_8corecext_loop, 1, "loop", 0))) __PYX_ERR(0, 1168, __pyx_L1_error) + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_6async____cinit__(((struct PyGeventAsyncObject *)__pyx_v_self), __pyx_v_loop, __pyx_v_ref, __pyx_v_priority); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_6async____cinit__(struct PyGeventAsyncObject *__pyx_v_self, CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_loop, CYTHON_UNUSED PyObject *__pyx_v_ref, CYTHON_UNUSED PyObject *__pyx_v_priority) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__cinit__", 0); + + ev_async_init((&__pyx_v_self->_watcher), ((void *)gevent_callback_async)); + + __pyx_v_self->__pyx_base.__pyx___watcher = ((struct ev_watcher *)(&__pyx_v_self->_watcher)); + + __pyx_v_self->__pyx_base.__pyx___ss = (&__pyx_v_6gevent_5libev_8corecext_async_ss); + + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_6async__3send(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_6async__3send(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("send (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_6async__2send(((struct PyGeventAsyncObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_6async__2send(struct PyGeventAsyncObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + __Pyx_RefNannySetupContext("send", 0); + + __pyx_t_1 = ((PyObject *)__pyx_v_self->__pyx_base.loop); + __Pyx_INCREF(__pyx_t_1); + __pyx_t_2 = __pyx_f_6gevent_5libev_8corecext__check_loop(((struct PyGeventLoopObject *)__pyx_t_1)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 1175, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + ev_async_send(__pyx_v_self->__pyx_base.loop->_ptr, (&__pyx_v_self->_watcher)); + + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.libev.corecext.async_.send", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_5child_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_5child_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + struct PyGeventLoopObject *__pyx_v_loop = 0; + int __pyx_v_pid; + int __pyx_v_trace; + CYTHON_UNUSED PyObject *__pyx_v_ref = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_loop,&__pyx_n_s_pid,&__pyx_n_s_trace,&__pyx_n_s_ref,0}; + PyObject* values[4] = {0,0,0,0}; + values[3] = ((PyObject *)Py_True); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_loop)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pid)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 4, 1); __PYX_ERR(0, 1186, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_trace); + if (value) { values[2] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 3: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ref); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 1186, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_loop = ((struct PyGeventLoopObject *)values[0]); + __pyx_v_pid = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_pid == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1186, __pyx_L3_error) + if (values[2]) { + __pyx_v_trace = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_trace == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1186, __pyx_L3_error) + } else { + __pyx_v_trace = ((int)0); + } + __pyx_v_ref = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1186, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.libev.corecext.child.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_loop), __pyx_ptype_6gevent_5libev_8corecext_loop, 1, "loop", 0))) __PYX_ERR(0, 1186, __pyx_L1_error) + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_5child___cinit__(((struct PyGeventChildObject *)__pyx_v_self), __pyx_v_loop, __pyx_v_pid, __pyx_v_trace, __pyx_v_ref); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_5child___cinit__(struct PyGeventChildObject *__pyx_v_self, struct PyGeventLoopObject *__pyx_v_loop, int __pyx_v_pid, int __pyx_v_trace, CYTHON_UNUSED PyObject *__pyx_v_ref) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + int __pyx_t_4; + __Pyx_RefNannySetupContext("__cinit__", 0); + + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_sys); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1187, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_platform); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1187, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_t_2, __pyx_n_s_win32, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1187, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(__pyx_t_3)) { + + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_AttributeError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1188, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 1188, __pyx_L1_error) + + } + + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_loop), __pyx_n_s_default); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1189, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1189, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_4 = ((!__pyx_t_3) != 0); + if (unlikely(__pyx_t_4)) { + + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1190, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 1190, __pyx_L1_error) + + } + + gevent_install_sigchld_handler(); + + ev_child_init((&__pyx_v_self->_watcher), ((void *)gevent_callback_child), __pyx_v_pid, __pyx_v_trace); + + __pyx_v_self->__pyx_base.__pyx___watcher = ((struct ev_watcher *)(&__pyx_v_self->_watcher)); + + __pyx_v_self->__pyx_base.__pyx___ss = (&__pyx_v_6gevent_5libev_8corecext_child_ss); + + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent.libev.corecext.child.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_5child_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_5child_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + struct PyGeventLoopObject *__pyx_v_loop = 0; + CYTHON_UNUSED int __pyx_v_pid; + CYTHON_UNUSED int __pyx_v_trace; + PyObject *__pyx_v_ref = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_loop,&__pyx_n_s_pid,&__pyx_n_s_trace,&__pyx_n_s_ref,0}; + PyObject* values[4] = {0,0,0,0}; + values[3] = ((PyObject *)Py_True); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_loop)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pid)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 4, 1); __PYX_ERR(0, 1196, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_trace); + if (value) { values[2] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 3: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ref); + if (value) { values[3] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 1196, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_loop = ((struct PyGeventLoopObject *)values[0]); + __pyx_v_pid = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_pid == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1196, __pyx_L3_error) + if (values[2]) { + __pyx_v_trace = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_trace == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1196, __pyx_L3_error) + } else { + __pyx_v_trace = ((int)0); + } + __pyx_v_ref = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1196, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.libev.corecext.child.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_loop), __pyx_ptype_6gevent_5libev_8corecext_loop, 1, "loop", 0))) __PYX_ERR(0, 1196, __pyx_L1_error) + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_5child_2__init__(((struct PyGeventChildObject *)__pyx_v_self), __pyx_v_loop, __pyx_v_pid, __pyx_v_trace, __pyx_v_ref); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_5child_2__init__(struct PyGeventChildObject *__pyx_v_self, struct PyGeventLoopObject *__pyx_v_loop, CYTHON_UNUSED int __pyx_v_pid, CYTHON_UNUSED int __pyx_v_trace, PyObject *__pyx_v_ref) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + __Pyx_RefNannySetupContext("__init__", 0); + + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_6gevent_5libev_8corecext_watcher), __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1197, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + __pyx_t_4 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_4 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[5] = {__pyx_t_3, ((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_loop), __pyx_v_ref, Py_None}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 4+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1197, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[5] = {__pyx_t_3, ((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_loop), __pyx_v_ref, Py_None}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 4+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1197, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else + #endif + { + __pyx_t_5 = PyTuple_New(4+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1197, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (__pyx_t_3) { + __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL; + } + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, ((PyObject *)__pyx_v_self)); + __Pyx_INCREF(((PyObject *)__pyx_v_loop)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_loop)); + PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, ((PyObject *)__pyx_v_loop)); + __Pyx_INCREF(__pyx_v_ref); + __Pyx_GIVEREF(__pyx_v_ref); + PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_4, __pyx_v_ref); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + PyTuple_SET_ITEM(__pyx_t_5, 3+__pyx_t_4, Py_None); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1197, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("gevent.libev.corecext.child.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_5child_5_format(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_5child_5_format(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_format (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_5child_4_format(((struct PyGeventChildObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_5child_4_format(struct PyGeventChildObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("_format", 0); + + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_pid); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1201, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_rstatus); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1201, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1201, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); + __pyx_t_1 = 0; + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_pid_r_rstatus_r, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1201, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("gevent.libev.corecext.child._format", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_5child_3pid_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_5child_3pid_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_5child_3pid___get__(((struct PyGeventChildObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_5child_3pid___get__(struct PyGeventChildObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->_watcher.pid); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1205, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.libev.corecext.child.pid.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_5child_4rpid_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_5child_4rpid_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_5child_4rpid___get__(((struct PyGeventChildObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_5child_4rpid___get__(struct PyGeventChildObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->_watcher.rpid); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1209, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.libev.corecext.child.rpid.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_5child_4rpid_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_value); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_5child_4rpid_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_value) { + int __pyx_v_value; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + assert(__pyx_arg_value); { + __pyx_v_value = __Pyx_PyInt_As_int(__pyx_arg_value); if (unlikely((__pyx_v_value == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1212, __pyx_L3_error) + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.libev.corecext.child.rpid.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_5child_4rpid_2__set__(((struct PyGeventChildObject *)__pyx_v_self), ((int)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_5child_4rpid_2__set__(struct PyGeventChildObject *__pyx_v_self, int __pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__", 0); + + __pyx_v_self->_watcher.rpid = __pyx_v_value; + + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_5child_7rstatus_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_5child_7rstatus_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_5child_7rstatus___get__(((struct PyGeventChildObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_5child_7rstatus___get__(struct PyGeventChildObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->_watcher.rstatus); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1217, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.libev.corecext.child.rstatus.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_5child_7rstatus_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_value); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_5child_7rstatus_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_value) { + int __pyx_v_value; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + assert(__pyx_arg_value); { + __pyx_v_value = __Pyx_PyInt_As_int(__pyx_arg_value); if (unlikely((__pyx_v_value == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1220, __pyx_L3_error) + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.libev.corecext.child.rstatus.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_5child_7rstatus_2__set__(((struct PyGeventChildObject *)__pyx_v_self), ((int)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_5child_7rstatus_2__set__(struct PyGeventChildObject *__pyx_v_self, int __pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__", 0); + + __pyx_v_self->_watcher.rstatus = __pyx_v_value; + + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_4stat_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_4stat_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_loop = 0; + PyObject *__pyx_v_path = 0; + float __pyx_v_interval; + CYTHON_UNUSED PyObject *__pyx_v_ref = 0; + CYTHON_UNUSED PyObject *__pyx_v_priority = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_loop,&__pyx_n_s_path,&__pyx_n_s_interval,&__pyx_n_s_ref,&__pyx_n_s_priority,0}; + PyObject* values[5] = {0,0,0,0,0}; + values[3] = ((PyObject *)Py_True); + values[4] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + CYTHON_FALLTHROUGH; + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_loop)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_path)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 5, 1); __PYX_ERR(0, 1231, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_interval); + if (value) { values[2] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 3: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ref); + if (value) { values[3] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 4: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_priority); + if (value) { values[4] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 1231, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + CYTHON_FALLTHROUGH; + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_loop = ((struct PyGeventLoopObject *)values[0]); + __pyx_v_path = ((PyObject*)values[1]); + if (values[2]) { + __pyx_v_interval = __pyx_PyFloat_AsFloat(values[2]); if (unlikely((__pyx_v_interval == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 1231, __pyx_L3_error) + } else { + __pyx_v_interval = ((float)0.0); + } + __pyx_v_ref = values[3]; + __pyx_v_priority = values[4]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1231, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.libev.corecext.stat.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_loop), __pyx_ptype_6gevent_5libev_8corecext_loop, 1, "loop", 0))) __PYX_ERR(0, 1231, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_path), (&PyString_Type), 1, "path", 1))) __PYX_ERR(0, 1231, __pyx_L1_error) + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4stat___cinit__(((struct PyGeventStatObject *)__pyx_v_self), __pyx_v_loop, __pyx_v_path, __pyx_v_interval, __pyx_v_ref, __pyx_v_priority); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_4stat___cinit__(struct PyGeventStatObject *__pyx_v_self, CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_loop, PyObject *__pyx_v_path, float __pyx_v_interval, CYTHON_UNUSED PyObject *__pyx_v_ref, CYTHON_UNUSED PyObject *__pyx_v_priority) { + PyObject *__pyx_v_paths = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + char *__pyx_t_8; + __Pyx_RefNannySetupContext("__cinit__", 0); + + __Pyx_INCREF(__pyx_v_path); + __Pyx_GIVEREF(__pyx_v_path); + __Pyx_GOTREF(__pyx_v_self->path); + __Pyx_DECREF(__pyx_v_self->path); + __pyx_v_self->path = __pyx_v_path; + + __pyx_t_1 = PyUnicode_Check(__pyx_v_path); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_path, __pyx_n_s_encode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1238, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_sys); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1238, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_getfilesystemencoding); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1238, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7); + if (likely(__pyx_t_6)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_7, function); + } + } + __pyx_t_5 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1238, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_7)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_7); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + } + } + __pyx_t_3 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_7, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1238, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (!(likely(PyBytes_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(0, 1238, __pyx_L1_error) + __pyx_v_paths = ((PyObject*)__pyx_t_3); + __pyx_t_3 = 0; + + __Pyx_INCREF(__pyx_v_paths); + __Pyx_GIVEREF(__pyx_v_paths); + __Pyx_GOTREF(__pyx_v_self->_paths); + __Pyx_DECREF(__pyx_v_self->_paths); + __pyx_v_self->_paths = __pyx_v_paths; + + goto __pyx_L3; + } + + /*else*/ { + __pyx_t_3 = __pyx_v_path; + __Pyx_INCREF(__pyx_t_3); + __pyx_v_paths = ((PyObject*)__pyx_t_3); + __pyx_t_3 = 0; + + __Pyx_INCREF(__pyx_v_paths); + __Pyx_GIVEREF(__pyx_v_paths); + __Pyx_GOTREF(__pyx_v_self->_paths); + __Pyx_DECREF(__pyx_v_self->_paths); + __pyx_v_self->_paths = __pyx_v_paths; + } + __pyx_L3:; + + if (unlikely(__pyx_v_paths == Py_None)) { + PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); + __PYX_ERR(0, 1243, __pyx_L1_error) + } + __pyx_t_8 = __Pyx_PyBytes_AsWritableString(__pyx_v_paths); if (unlikely((!__pyx_t_8) && PyErr_Occurred())) __PYX_ERR(0, 1243, __pyx_L1_error) + ev_stat_init((&__pyx_v_self->_watcher), ((void *)gevent_callback_stat), ((char *)__pyx_t_8), __pyx_v_interval); + + __pyx_v_self->__pyx_base.__pyx___watcher = ((struct ev_watcher *)(&__pyx_v_self->_watcher)); + + __pyx_v_self->__pyx_base.__pyx___ss = (&__pyx_v_6gevent_5libev_8corecext_stat_ss); + + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("gevent.libev.corecext.stat.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_paths); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static int __pyx_pw_6gevent_5libev_8corecext_4stat_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6gevent_5libev_8corecext_4stat_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + struct PyGeventLoopObject *__pyx_v_loop = 0; + CYTHON_UNUSED PyObject *__pyx_v_path = 0; + CYTHON_UNUSED float __pyx_v_interval; + PyObject *__pyx_v_ref = 0; + PyObject *__pyx_v_priority = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_loop,&__pyx_n_s_path,&__pyx_n_s_interval,&__pyx_n_s_ref,&__pyx_n_s_priority,0}; + PyObject* values[5] = {0,0,0,0,0}; + values[3] = ((PyObject *)Py_True); + values[4] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + CYTHON_FALLTHROUGH; + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_loop)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_path)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 5, 1); __PYX_ERR(0, 1247, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_interval); + if (value) { values[2] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 3: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ref); + if (value) { values[3] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 4: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_priority); + if (value) { values[4] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 1247, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + CYTHON_FALLTHROUGH; + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_loop = ((struct PyGeventLoopObject *)values[0]); + __pyx_v_path = ((PyObject*)values[1]); + if (values[2]) { + __pyx_v_interval = __pyx_PyFloat_AsFloat(values[2]); if (unlikely((__pyx_v_interval == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 1247, __pyx_L3_error) + } else { + __pyx_v_interval = ((float)0.0); + } + __pyx_v_ref = values[3]; + __pyx_v_priority = values[4]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1247, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.libev.corecext.stat.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_loop), __pyx_ptype_6gevent_5libev_8corecext_loop, 1, "loop", 0))) __PYX_ERR(0, 1247, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_path), (&PyString_Type), 1, "path", 1))) __PYX_ERR(0, 1247, __pyx_L1_error) + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4stat_2__init__(((struct PyGeventStatObject *)__pyx_v_self), __pyx_v_loop, __pyx_v_path, __pyx_v_interval, __pyx_v_ref, __pyx_v_priority); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_5libev_8corecext_4stat_2__init__(struct PyGeventStatObject *__pyx_v_self, struct PyGeventLoopObject *__pyx_v_loop, CYTHON_UNUSED PyObject *__pyx_v_path, CYTHON_UNUSED float __pyx_v_interval, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + __Pyx_RefNannySetupContext("__init__", 0); + + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_6gevent_5libev_8corecext_watcher), __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1248, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + __pyx_t_4 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_4 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[5] = {__pyx_t_3, ((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_loop), __pyx_v_ref, __pyx_v_priority}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 4+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1248, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[5] = {__pyx_t_3, ((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_loop), __pyx_v_ref, __pyx_v_priority}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 4+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1248, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else + #endif + { + __pyx_t_5 = PyTuple_New(4+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1248, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (__pyx_t_3) { + __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL; + } + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, ((PyObject *)__pyx_v_self)); + __Pyx_INCREF(((PyObject *)__pyx_v_loop)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_loop)); + PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, ((PyObject *)__pyx_v_loop)); + __Pyx_INCREF(__pyx_v_ref); + __Pyx_GIVEREF(__pyx_v_ref); + PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_4, __pyx_v_ref); + __Pyx_INCREF(__pyx_v_priority); + __Pyx_GIVEREF(__pyx_v_priority); + PyTuple_SET_ITEM(__pyx_t_5, 3+__pyx_t_4, __pyx_v_priority); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1248, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("gevent.libev.corecext.stat.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4stat_4attr_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4stat_4attr_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4stat_4attr___get__(((struct PyGeventStatObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4stat_4attr___get__(struct PyGeventStatObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + __pyx_t_1 = ((!(__pyx_v_self->_watcher.attr.st_nlink != 0)) != 0); + if (__pyx_t_1) { + + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + + } + + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = _pystat_fromstructstat((&__pyx_v_self->_watcher.attr)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1255, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent.libev.corecext.stat.attr.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4stat_4prev_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4stat_4prev_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4stat_4prev___get__(((struct PyGeventStatObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4stat_4prev___get__(struct PyGeventStatObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + __pyx_t_1 = ((!(__pyx_v_self->_watcher.prev.st_nlink != 0)) != 0); + if (__pyx_t_1) { + + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + + } + + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = _pystat_fromstructstat((&__pyx_v_self->_watcher.prev)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1261, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent.libev.corecext.stat.prev.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4stat_8interval_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4stat_8interval_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4stat_8interval___get__(((struct PyGeventStatObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4stat_8interval___get__(struct PyGeventStatObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->_watcher.interval); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1265, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.libev.corecext.stat.interval.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4stat_4path_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4stat_4path_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4stat_4path___get__(((struct PyGeventStatObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4stat_4path___get__(struct PyGeventStatObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->path); + __pyx_r = __pyx_v_self->path; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4stat_6_paths_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_4stat_6_paths_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4stat_6_paths___get__(((struct PyGeventStatObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_4stat_6_paths___get__(struct PyGeventStatObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->_paths); + __pyx_r = __pyx_v_self->_paths; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +static void __pyx_f_6gevent_5libev_8corecext__syserr_cb(char *__pyx_v_msg) { + PyObject *__pyx_v_print_exc = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + int __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + int __pyx_t_11; + int __pyx_t_12; + #ifdef WITH_THREAD + PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); + #endif + __Pyx_RefNannySetupContext("_syserr_cb", 0); + + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_SYSERR_CALLBACK); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1274, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_msg); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1274, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = __Pyx_PyInt_From_int(errno); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1274, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = NULL; + __pyx_t_9 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5); + if (likely(__pyx_t_8)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_8); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_5, function); + __pyx_t_9 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_5)) { + PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_t_6, __pyx_t_7}; + __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1274, __pyx_L3_error) + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { + PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_t_6, __pyx_t_7}; + __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1274, __pyx_L3_error) + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } else + #endif + { + __pyx_t_10 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1274, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_10); + if (__pyx_t_8) { + __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_8); __pyx_t_8 = NULL; + } + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_9, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_9, __pyx_t_7); + __pyx_t_6 = 0; + __pyx_t_7 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_10, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1274, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + } + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L8_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + + /*except:*/ { + __Pyx_AddTraceback("gevent.libev.corecext._syserr_cb", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_5, &__pyx_t_10) < 0) __PYX_ERR(0, 1275, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_10); + + __pyx_t_7 = __pyx_f_6gevent_5libev_8corecext_set_syserr_cb(Py_None, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1276, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_traceback); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1277, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_6 = __Pyx_GetAttr3(__pyx_t_7, __pyx_n_s_print_exc, Py_None); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1277, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_v_print_exc = __pyx_t_6; + __pyx_t_6 = 0; + + __pyx_t_11 = (__pyx_v_print_exc != Py_None); + __pyx_t_12 = (__pyx_t_11 != 0); + if (__pyx_t_12) { + + __Pyx_INCREF(__pyx_v_print_exc); + __pyx_t_7 = __pyx_v_print_exc; __pyx_t_8 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) { + __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); + if (likely(__pyx_t_8)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); + __Pyx_INCREF(__pyx_t_8); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_7, function); + } + } + __pyx_t_6 = (__pyx_t_8) ? __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_8) : __Pyx_PyObject_CallNoArg(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1279, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + } + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + goto __pyx_L4_exception_handled; + } + __pyx_L5_except_error:; + + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L8_try_end:; + } + + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_WriteUnraisable("gevent.libev.corecext._syserr_cb", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_print_exc); + __Pyx_RefNannyFinishContext(); + #ifdef WITH_THREAD + __Pyx_PyGILState_Release(__pyx_gilstate_save); + #endif +} + + +static PyObject *__pyx_pw_6gevent_5libev_8corecext_21set_syserr_cb(PyObject *__pyx_self, PyObject *__pyx_v_callback); /*proto*/ +static PyObject *__pyx_f_6gevent_5libev_8corecext_set_syserr_cb(PyObject *__pyx_v_callback, CYTHON_UNUSED int __pyx_skip_dispatch) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + __Pyx_RefNannySetupContext("set_syserr_cb", 0); + + __pyx_t_1 = (__pyx_v_callback == Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + ev_set_syserr_cb(NULL); + + if (PyDict_SetItem(__pyx_d, __pyx_n_s_SYSERR_CALLBACK, Py_None) < 0) __PYX_ERR(0, 1286, __pyx_L1_error) + + goto __pyx_L3; + } + + __pyx_t_2 = __Pyx_PyCallable_Check(__pyx_v_callback); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 1287, __pyx_L1_error) + __pyx_t_1 = (__pyx_t_2 != 0); + if (likely(__pyx_t_1)) { + + ev_set_syserr_cb(((void *)__pyx_f_6gevent_5libev_8corecext__syserr_cb)); + + if (PyDict_SetItem(__pyx_d, __pyx_n_s_SYSERR_CALLBACK, __pyx_v_callback) < 0) __PYX_ERR(0, 1289, __pyx_L1_error) + + goto __pyx_L3; + } + + /*else*/ { + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1291, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_callback); + __Pyx_GIVEREF(__pyx_v_callback); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_callback); + __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Expected_callable_or_None_got_r, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1291, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1291, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(0, 1291, __pyx_L1_error) + } + __pyx_L3:; + + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("gevent.libev.corecext.set_syserr_cb", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_21set_syserr_cb(PyObject *__pyx_self, PyObject *__pyx_v_callback); /*proto*/ +static PyObject *__pyx_pw_6gevent_5libev_8corecext_21set_syserr_cb(PyObject *__pyx_self, PyObject *__pyx_v_callback) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("set_syserr_cb (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_5libev_8corecext_20set_syserr_cb(__pyx_self, ((PyObject *)__pyx_v_callback)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_5libev_8corecext_20set_syserr_cb(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_callback) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("set_syserr_cb", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6gevent_5libev_8corecext_set_syserr_cb(__pyx_v_callback, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1282, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.libev.corecext.set_syserr_cb", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + + +void gevent_handle_error(struct PyGeventLoopObject *__pyx_v_loop, PyObject *__pyx_v_context) { + PyObject *__pyx_v_typep; + PyObject *__pyx_v_valuep; + PyObject *__pyx_v_tracebackp; + PyObject *__pyx_v_type = 0; + PyObject *__pyx_v_value = 0; + PyObject *__pyx_v_traceback = 0; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("gevent_handle_error", 0); + + __Pyx_INCREF(Py_None); + __pyx_v_value = Py_None; + + __Pyx_INCREF(Py_None); + __pyx_v_traceback = Py_None; + + PyErr_Fetch((&__pyx_v_typep), (&__pyx_v_valuep), (&__pyx_v_tracebackp)); + + __pyx_t_1 = ((!(__pyx_v_typep != 0)) != 0); + if (__pyx_t_1) { + + goto __pyx_L0; + + } + + __pyx_t_2 = ((PyObject *)__pyx_v_typep); + __Pyx_INCREF(__pyx_t_2); + __pyx_v_type = __pyx_t_2; + __pyx_t_2 = 0; + + Py_DECREF(__pyx_v_type); + + __pyx_t_1 = (__pyx_v_valuep != 0); + if (__pyx_t_1) { + + __pyx_t_2 = ((PyObject *)__pyx_v_valuep); + __Pyx_INCREF(__pyx_t_2); + __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_2); + __pyx_t_2 = 0; + + Py_DECREF(__pyx_v_value); + + } + + __pyx_t_1 = (__pyx_v_tracebackp != 0); + if (__pyx_t_1) { + + __pyx_t_2 = ((PyObject *)__pyx_v_tracebackp); + __Pyx_INCREF(__pyx_t_2); + __Pyx_DECREF_SET(__pyx_v_traceback, __pyx_t_2); + __pyx_t_2 = 0; + + Py_DECREF(__pyx_v_traceback); + + } + + __pyx_t_2 = ((struct __pyx_vtabstruct_6gevent_5libev_8corecext_loop *)__pyx_v_loop->__pyx_vtab)->handle_error(__pyx_v_loop, __pyx_v_context, __pyx_v_type, __pyx_v_value, __pyx_v_traceback, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1347, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_WriteUnraisable("gevent.libev.corecext.gevent_handle_error", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_type); + __Pyx_XDECREF(__pyx_v_value); + __Pyx_XDECREF(__pyx_v_traceback); + __Pyx_RefNannyFinishContext(); +} + + +PyObject *gevent_loop_run_callbacks(struct PyGeventLoopObject *__pyx_v_loop) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("gevent_loop_run_callbacks", 0); + + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_5libev_8corecext_loop *)__pyx_v_loop->__pyx_vtab)->_run_callbacks(__pyx_v_loop); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1352, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.libev.corecext.gevent_loop_run_callbacks", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_tp_new_6gevent_5libev_8corecext__EVENTSType(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + PyObject *o; + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + return o; +} + +static void __pyx_tp_dealloc_6gevent_5libev_8corecext__EVENTSType(PyObject *o) { + #if CYTHON_USE_TP_FINALIZE + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + (*Py_TYPE(o)->tp_free)(o); +} + +static PyMethodDef __pyx_methods_6gevent_5libev_8corecext__EVENTSType[] = { + {0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_6gevent_5libev_8corecext__EVENTSType = { + PyVarObject_HEAD_INIT(0, 0) + "gevent.libev.corecext._EVENTSType", /*tp_name*/ + sizeof(struct __pyx_obj_6gevent_5libev_8corecext__EVENTSType), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6gevent_5libev_8corecext__EVENTSType, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + __pyx_pw_6gevent_5libev_8corecext_11_EVENTSType_1__repr__, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ + 0, /*tp_doc*/ + 0, /*tp_traverse*/ + 0, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6gevent_5libev_8corecext__EVENTSType, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6gevent_5libev_8corecext__EVENTSType, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static PyObject *__pyx_tp_new_6gevent_5libev_8corecext_callback(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + struct PyGeventCallbackObject *p; + PyObject *o; + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + p = ((struct PyGeventCallbackObject *)o); + p->callback = Py_None; Py_INCREF(Py_None); + p->args = ((PyObject*)Py_None); Py_INCREF(Py_None); + p->next = ((struct PyGeventCallbackObject *)Py_None); Py_INCREF(Py_None); + return o; +} + +static void __pyx_tp_dealloc_6gevent_5libev_8corecext_callback(PyObject *o) { + struct PyGeventCallbackObject *p = (struct PyGeventCallbackObject *)o; + #if CYTHON_USE_TP_FINALIZE + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + PyObject_GC_UnTrack(o); + Py_CLEAR(p->callback); + Py_CLEAR(p->args); + Py_CLEAR(p->next); + (*Py_TYPE(o)->tp_free)(o); +} + +static int __pyx_tp_traverse_6gevent_5libev_8corecext_callback(PyObject *o, visitproc v, void *a) { + int e; + struct PyGeventCallbackObject *p = (struct PyGeventCallbackObject *)o; + if (p->callback) { + e = (*v)(p->callback, a); if (e) return e; + } + if (p->args) { + e = (*v)(p->args, a); if (e) return e; + } + if (p->next) { + e = (*v)(((PyObject *)p->next), a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_6gevent_5libev_8corecext_callback(PyObject *o) { + PyObject* tmp; + struct PyGeventCallbackObject *p = (struct PyGeventCallbackObject *)o; + tmp = ((PyObject*)p->callback); + p->callback = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->args); + p->args = ((PyObject*)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->next); + p->next = ((struct PyGeventCallbackObject *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_8callback_pending(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_8callback_7pending_1__get__(o); +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_8callback_callback(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_8callback_8callback_1__get__(o); +} + +static int __pyx_setprop_6gevent_5libev_8corecext_8callback_callback(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6gevent_5libev_8corecext_8callback_8callback_3__set__(o, v); + } + else { + return __pyx_pw_6gevent_5libev_8corecext_8callback_8callback_5__del__(o); + } +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_8callback_args(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_8callback_4args_1__get__(o); +} + +static int __pyx_setprop_6gevent_5libev_8corecext_8callback_args(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6gevent_5libev_8corecext_8callback_4args_3__set__(o, v); + } + else { + return __pyx_pw_6gevent_5libev_8corecext_8callback_4args_5__del__(o); + } +} + +static PyMethodDef __pyx_methods_6gevent_5libev_8corecext_callback[] = { + {"stop", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_8callback_3stop, METH_NOARGS, 0}, + {"_format", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_8callback_9_format, METH_NOARGS, 0}, + {0, 0, 0, 0} +}; + +static struct PyGetSetDef __pyx_getsets_6gevent_5libev_8corecext_callback[] = { + {(char *)"pending", __pyx_getprop_6gevent_5libev_8corecext_8callback_pending, 0, (char *)0, 0}, + {(char *)"callback", __pyx_getprop_6gevent_5libev_8corecext_8callback_callback, __pyx_setprop_6gevent_5libev_8corecext_8callback_callback, (char *)0, 0}, + {(char *)"args", __pyx_getprop_6gevent_5libev_8corecext_8callback_args, __pyx_setprop_6gevent_5libev_8corecext_8callback_args, (char *)0, 0}, + {0, 0, 0, 0, 0} +}; + +static PyNumberMethods __pyx_tp_as_number_callback = { + 0, /*nb_add*/ + 0, /*nb_subtract*/ + 0, /*nb_multiply*/ + #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) + 0, /*nb_divide*/ + #endif + 0, /*nb_remainder*/ + 0, /*nb_divmod*/ + 0, /*nb_power*/ + 0, /*nb_negative*/ + 0, /*nb_positive*/ + 0, /*nb_absolute*/ + __pyx_pw_6gevent_5libev_8corecext_8callback_5__nonzero__, /*nb_nonzero*/ + 0, /*nb_invert*/ + 0, /*nb_lshift*/ + 0, /*nb_rshift*/ + 0, /*nb_and*/ + 0, /*nb_xor*/ + 0, /*nb_or*/ + #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) + 0, /*nb_coerce*/ + #endif + 0, /*nb_int*/ + #if PY_MAJOR_VERSION < 3 + 0, /*nb_long*/ + #else + 0, /*reserved*/ + #endif + 0, /*nb_float*/ + #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) + 0, /*nb_oct*/ + #endif + #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) + 0, /*nb_hex*/ + #endif + 0, /*nb_inplace_add*/ + 0, /*nb_inplace_subtract*/ + 0, /*nb_inplace_multiply*/ + #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) + 0, /*nb_inplace_divide*/ + #endif + 0, /*nb_inplace_remainder*/ + 0, /*nb_inplace_power*/ + 0, /*nb_inplace_lshift*/ + 0, /*nb_inplace_rshift*/ + 0, /*nb_inplace_and*/ + 0, /*nb_inplace_xor*/ + 0, /*nb_inplace_or*/ + 0, /*nb_floor_divide*/ + 0, /*nb_true_divide*/ + 0, /*nb_inplace_floor_divide*/ + 0, /*nb_inplace_true_divide*/ + 0, /*nb_index*/ + #if PY_VERSION_HEX >= 0x03050000 + 0, /*nb_matrix_multiply*/ + #endif + #if PY_VERSION_HEX >= 0x03050000 + 0, /*nb_inplace_matrix_multiply*/ + #endif +}; + +DL_EXPORT(PyTypeObject) PyGeventCallback_Type = { + PyVarObject_HEAD_INIT(0, 0) + "gevent.libev.corecext.callback", /*tp_name*/ + sizeof(struct PyGeventCallbackObject), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6gevent_5libev_8corecext_callback, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + __pyx_pw_6gevent_5libev_8corecext_8callback_7__repr__, /*tp_repr*/ + &__pyx_tp_as_number_callback, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_6gevent_5libev_8corecext_callback, /*tp_traverse*/ + __pyx_tp_clear_6gevent_5libev_8corecext_callback, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6gevent_5libev_8corecext_callback, /*tp_methods*/ + 0, /*tp_members*/ + __pyx_getsets_6gevent_5libev_8corecext_callback, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_pw_6gevent_5libev_8corecext_8callback_1__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6gevent_5libev_8corecext_callback, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; +static struct __pyx_vtabstruct_6gevent_5libev_8corecext_CallbackFIFO __pyx_vtable_6gevent_5libev_8corecext_CallbackFIFO; + +static PyObject *__pyx_tp_new_6gevent_5libev_8corecext_CallbackFIFO(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *p; + PyObject *o; + o = (*t->tp_alloc)(t, 0); + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *)o); + p->__pyx_vtab = __pyx_vtabptr_6gevent_5libev_8corecext_CallbackFIFO; + p->head = ((struct PyGeventCallbackObject *)Py_None); Py_INCREF(Py_None); + p->tail = ((struct PyGeventCallbackObject *)Py_None); Py_INCREF(Py_None); + return o; +} + +static void __pyx_tp_dealloc_6gevent_5libev_8corecext_CallbackFIFO(PyObject *o) { + struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *p = (struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *)o; + PyObject_GC_UnTrack(o); + Py_CLEAR(p->head); + Py_CLEAR(p->tail); + (*Py_TYPE(o)->tp_free)(o); +} + +static int __pyx_tp_traverse_6gevent_5libev_8corecext_CallbackFIFO(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *p = (struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *)o; + if (p->head) { + e = (*v)(((PyObject *)p->head), a); if (e) return e; + } + if (p->tail) { + e = (*v)(((PyObject *)p->tail), a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_6gevent_5libev_8corecext_CallbackFIFO(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *p = (struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *)o; + tmp = ((PyObject*)p->head); + p->head = ((struct PyGeventCallbackObject *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->tail); + p->tail = ((struct PyGeventCallbackObject *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyMethodDef __pyx_methods_6gevent_5libev_8corecext_CallbackFIFO[] = { + {0, 0, 0, 0} +}; + +static PyNumberMethods __pyx_tp_as_number_CallbackFIFO = { + 0, /*nb_add*/ + 0, /*nb_subtract*/ + 0, /*nb_multiply*/ + #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) + 0, /*nb_divide*/ + #endif + 0, /*nb_remainder*/ + 0, /*nb_divmod*/ + 0, /*nb_power*/ + 0, /*nb_negative*/ + 0, /*nb_positive*/ + 0, /*nb_absolute*/ + __pyx_pw_6gevent_5libev_8corecext_12CallbackFIFO_3__nonzero__, /*nb_nonzero*/ + 0, /*nb_invert*/ + 0, /*nb_lshift*/ + 0, /*nb_rshift*/ + 0, /*nb_and*/ + 0, /*nb_xor*/ + 0, /*nb_or*/ + #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) + 0, /*nb_coerce*/ + #endif + 0, /*nb_int*/ + #if PY_MAJOR_VERSION < 3 + 0, /*nb_long*/ + #else + 0, /*reserved*/ + #endif + 0, /*nb_float*/ + #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) + 0, /*nb_oct*/ + #endif + #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) + 0, /*nb_hex*/ + #endif + 0, /*nb_inplace_add*/ + 0, /*nb_inplace_subtract*/ + 0, /*nb_inplace_multiply*/ + #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) + 0, /*nb_inplace_divide*/ + #endif + 0, /*nb_inplace_remainder*/ + 0, /*nb_inplace_power*/ + 0, /*nb_inplace_lshift*/ + 0, /*nb_inplace_rshift*/ + 0, /*nb_inplace_and*/ + 0, /*nb_inplace_xor*/ + 0, /*nb_inplace_or*/ + 0, /*nb_floor_divide*/ + 0, /*nb_true_divide*/ + 0, /*nb_inplace_floor_divide*/ + 0, /*nb_inplace_true_divide*/ + 0, /*nb_index*/ + #if PY_VERSION_HEX >= 0x03050000 + 0, /*nb_matrix_multiply*/ + #endif + #if PY_VERSION_HEX >= 0x03050000 + 0, /*nb_inplace_matrix_multiply*/ + #endif +}; + +static PySequenceMethods __pyx_tp_as_sequence_CallbackFIFO = { + __pyx_pw_6gevent_5libev_8corecext_12CallbackFIFO_5__len__, /*sq_length*/ + 0, /*sq_concat*/ + 0, /*sq_repeat*/ + 0, /*sq_item*/ + 0, /*sq_slice*/ + 0, /*sq_ass_item*/ + 0, /*sq_ass_slice*/ + 0, /*sq_contains*/ + 0, /*sq_inplace_concat*/ + 0, /*sq_inplace_repeat*/ +}; + +static PyMappingMethods __pyx_tp_as_mapping_CallbackFIFO = { + __pyx_pw_6gevent_5libev_8corecext_12CallbackFIFO_5__len__, /*mp_length*/ + 0, /*mp_subscript*/ + 0, /*mp_ass_subscript*/ +}; + +static PyTypeObject __pyx_type_6gevent_5libev_8corecext_CallbackFIFO = { + PyVarObject_HEAD_INIT(0, 0) + "gevent.libev.corecext.CallbackFIFO", /*tp_name*/ + sizeof(struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6gevent_5libev_8corecext_CallbackFIFO, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + __pyx_pw_6gevent_5libev_8corecext_12CallbackFIFO_9__repr__, /*tp_repr*/ + &__pyx_tp_as_number_CallbackFIFO, /*tp_as_number*/ + &__pyx_tp_as_sequence_CallbackFIFO, /*tp_as_sequence*/ + &__pyx_tp_as_mapping_CallbackFIFO, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_6gevent_5libev_8corecext_CallbackFIFO, /*tp_traverse*/ + __pyx_tp_clear_6gevent_5libev_8corecext_CallbackFIFO, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + __pyx_pw_6gevent_5libev_8corecext_12CallbackFIFO_7__iter__, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6gevent_5libev_8corecext_CallbackFIFO, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_pw_6gevent_5libev_8corecext_12CallbackFIFO_1__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6gevent_5libev_8corecext_CallbackFIFO, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; +static struct __pyx_vtabstruct_6gevent_5libev_8corecext_loop __pyx_vtable_6gevent_5libev_8corecext_loop; + +static PyObject *__pyx_tp_new_6gevent_5libev_8corecext_loop(PyTypeObject *t, PyObject *a, PyObject *k) { + struct PyGeventLoopObject *p; + PyObject *o; + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + p = ((struct PyGeventLoopObject *)o); + p->__pyx_vtab = __pyx_vtabptr_6gevent_5libev_8corecext_loop; + p->error_handler = Py_None; Py_INCREF(Py_None); + p->_callbacks = ((struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *)Py_None); Py_INCREF(Py_None); + if (unlikely(__pyx_pw_6gevent_5libev_8corecext_4loop_1__cinit__(o, a, k) < 0)) goto bad; + return o; + bad: + Py_DECREF(o); o = 0; + return NULL; +} + +static void __pyx_tp_dealloc_6gevent_5libev_8corecext_loop(PyObject *o) { + struct PyGeventLoopObject *p = (struct PyGeventLoopObject *)o; + #if CYTHON_USE_TP_FINALIZE + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + PyObject_GC_UnTrack(o); + { + PyObject *etype, *eval, *etb; + PyErr_Fetch(&etype, &eval, &etb); + ++Py_REFCNT(o); + __pyx_pw_6gevent_5libev_8corecext_4loop_7__dealloc__(o); + --Py_REFCNT(o); + PyErr_Restore(etype, eval, etb); + } + Py_CLEAR(p->error_handler); + Py_CLEAR(p->_callbacks); + (*Py_TYPE(o)->tp_free)(o); +} + +static int __pyx_tp_traverse_6gevent_5libev_8corecext_loop(PyObject *o, visitproc v, void *a) { + int e; + struct PyGeventLoopObject *p = (struct PyGeventLoopObject *)o; + if (p->error_handler) { + e = (*v)(p->error_handler, a); if (e) return e; + } + if (p->_callbacks) { + e = (*v)(((PyObject *)p->_callbacks), a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_6gevent_5libev_8corecext_loop(PyObject *o) { + PyObject* tmp; + struct PyGeventLoopObject *p = (struct PyGeventLoopObject *)o; + tmp = ((PyObject*)p->error_handler); + p->error_handler = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->_callbacks); + p->_callbacks = ((struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_4loop_ptr(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_4loop_3ptr_1__get__(o); +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_4loop_WatcherType(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_4loop_11WatcherType_1__get__(o); +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_4loop_MAXPRI(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_4loop_6MAXPRI_1__get__(o); +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_4loop_MINPRI(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_4loop_6MINPRI_1__get__(o); +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_4loop_default(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_4loop_7default_1__get__(o); +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_4loop_iteration(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_4loop_9iteration_1__get__(o); +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_4loop_depth(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_4loop_5depth_1__get__(o); +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_4loop_backend_int(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_4loop_11backend_int_1__get__(o); +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_4loop_backend(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_4loop_7backend_1__get__(o); +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_4loop_pendingcnt(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_4loop_10pendingcnt_1__get__(o); +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_4loop_activecnt(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_4loop_9activecnt_1__get__(o); +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_4loop_sig_pending(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_4loop_11sig_pending_1__get__(o); +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_4loop_origflags(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_4loop_9origflags_1__get__(o); +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_4loop_origflags_int(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_4loop_13origflags_int_1__get__(o); +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_4loop_sigfd(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_4loop_5sigfd_1__get__(o); +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_4loop_error_handler(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_4loop_13error_handler_1__get__(o); +} + +static int __pyx_setprop_6gevent_5libev_8corecext_4loop_error_handler(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6gevent_5libev_8corecext_4loop_13error_handler_3__set__(o, v); + } + else { + return __pyx_pw_6gevent_5libev_8corecext_4loop_13error_handler_5__del__(o); + } +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_4loop__callbacks(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_4loop_10_callbacks_1__get__(o); +} + +static int __pyx_setprop_6gevent_5libev_8corecext_4loop__callbacks(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6gevent_5libev_8corecext_4loop_10_callbacks_3__set__(o, v); + } + else { + return __pyx_pw_6gevent_5libev_8corecext_4loop_10_callbacks_5__del__(o); + } +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_4loop_approx_timer_resolution(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_4loop_23approx_timer_resolution_1__get__(o); +} + +static PyMethodDef __pyx_methods_6gevent_5libev_8corecext_loop[] = { + {"destroy", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_4loop_5destroy, METH_NOARGS, 0}, + {"_handle_syserr", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_5libev_8corecext_4loop_9_handle_syserr, METH_VARARGS|METH_KEYWORDS, 0}, + {"handle_error", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_5libev_8corecext_4loop_11handle_error, METH_VARARGS|METH_KEYWORDS, 0}, + {"_default_handle_error", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_5libev_8corecext_4loop_13_default_handle_error, METH_VARARGS|METH_KEYWORDS, 0}, + {"run", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_5libev_8corecext_4loop_15run, METH_VARARGS|METH_KEYWORDS, 0}, + {"reinit", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_4loop_17reinit, METH_NOARGS, 0}, + {"ref", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_4loop_19ref, METH_NOARGS, 0}, + {"unref", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_4loop_21unref, METH_NOARGS, 0}, + {"break_", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_5libev_8corecext_4loop_23break_, METH_VARARGS|METH_KEYWORDS, 0}, + {"verify", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_4loop_25verify, METH_NOARGS, 0}, + {"now", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_4loop_27now, METH_NOARGS, 0}, + {"update_now", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_4loop_29update_now, METH_NOARGS, 0}, + {"io", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_5libev_8corecext_4loop_33io, METH_VARARGS|METH_KEYWORDS, 0}, + {"timer", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_5libev_8corecext_4loop_35timer, METH_VARARGS|METH_KEYWORDS, 0}, + {"signal", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_5libev_8corecext_4loop_37signal, METH_VARARGS|METH_KEYWORDS, 0}, + {"idle", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_5libev_8corecext_4loop_39idle, METH_VARARGS|METH_KEYWORDS, 0}, + {"prepare", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_5libev_8corecext_4loop_41prepare, METH_VARARGS|METH_KEYWORDS, 0}, + {"check", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_5libev_8corecext_4loop_43check, METH_VARARGS|METH_KEYWORDS, 0}, + {"fork", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_5libev_8corecext_4loop_45fork, METH_VARARGS|METH_KEYWORDS, 0}, + {"async_", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_5libev_8corecext_4loop_47async_, METH_VARARGS|METH_KEYWORDS, 0}, + {"child", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_5libev_8corecext_4loop_49child, METH_VARARGS|METH_KEYWORDS, 0}, + {"install_sigchld", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_4loop_51install_sigchld, METH_NOARGS, 0}, + {"reset_sigchld", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_4loop_53reset_sigchld, METH_NOARGS, 0}, + {"stat", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_5libev_8corecext_4loop_55stat, METH_VARARGS|METH_KEYWORDS, 0}, + {"run_callback", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_5libev_8corecext_4loop_57run_callback, METH_VARARGS|METH_KEYWORDS, 0}, + {"_format", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_4loop_59_format, METH_NOARGS, 0}, + {"_format_details", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_4loop_61_format_details, METH_NOARGS, 0}, + {"fileno", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_4loop_63fileno, METH_NOARGS, 0}, + {0, 0, 0, 0} +}; + +static struct PyGetSetDef __pyx_getsets_6gevent_5libev_8corecext_loop[] = { + {(char *)"ptr", __pyx_getprop_6gevent_5libev_8corecext_4loop_ptr, 0, (char *)0, 0}, + {(char *)"WatcherType", __pyx_getprop_6gevent_5libev_8corecext_4loop_WatcherType, 0, (char *)0, 0}, + {(char *)"MAXPRI", __pyx_getprop_6gevent_5libev_8corecext_4loop_MAXPRI, 0, (char *)0, 0}, + {(char *)"MINPRI", __pyx_getprop_6gevent_5libev_8corecext_4loop_MINPRI, 0, (char *)0, 0}, + {(char *)"default", __pyx_getprop_6gevent_5libev_8corecext_4loop_default, 0, (char *)0, 0}, + {(char *)"iteration", __pyx_getprop_6gevent_5libev_8corecext_4loop_iteration, 0, (char *)0, 0}, + {(char *)"depth", __pyx_getprop_6gevent_5libev_8corecext_4loop_depth, 0, (char *)0, 0}, + {(char *)"backend_int", __pyx_getprop_6gevent_5libev_8corecext_4loop_backend_int, 0, (char *)0, 0}, + {(char *)"backend", __pyx_getprop_6gevent_5libev_8corecext_4loop_backend, 0, (char *)0, 0}, + {(char *)"pendingcnt", __pyx_getprop_6gevent_5libev_8corecext_4loop_pendingcnt, 0, (char *)0, 0}, + {(char *)"activecnt", __pyx_getprop_6gevent_5libev_8corecext_4loop_activecnt, 0, (char *)0, 0}, + {(char *)"sig_pending", __pyx_getprop_6gevent_5libev_8corecext_4loop_sig_pending, 0, (char *)0, 0}, + {(char *)"origflags", __pyx_getprop_6gevent_5libev_8corecext_4loop_origflags, 0, (char *)0, 0}, + {(char *)"origflags_int", __pyx_getprop_6gevent_5libev_8corecext_4loop_origflags_int, 0, (char *)0, 0}, + {(char *)"sigfd", __pyx_getprop_6gevent_5libev_8corecext_4loop_sigfd, 0, (char *)0, 0}, + {(char *)"error_handler", __pyx_getprop_6gevent_5libev_8corecext_4loop_error_handler, __pyx_setprop_6gevent_5libev_8corecext_4loop_error_handler, (char *)0, 0}, + {(char *)"_callbacks", __pyx_getprop_6gevent_5libev_8corecext_4loop__callbacks, __pyx_setprop_6gevent_5libev_8corecext_4loop__callbacks, (char *)0, 0}, + {(char *)"approx_timer_resolution", __pyx_getprop_6gevent_5libev_8corecext_4loop_approx_timer_resolution, 0, (char *)0, 0}, + {0, 0, 0, 0, 0} +}; + +DL_EXPORT(PyTypeObject) PyGeventLoop_Type = { + PyVarObject_HEAD_INIT(0, 0) + "gevent.libev.corecext.loop", /*tp_name*/ + sizeof(struct PyGeventLoopObject), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6gevent_5libev_8corecext_loop, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + __pyx_pw_6gevent_5libev_8corecext_4loop_31__repr__, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_6gevent_5libev_8corecext_loop, /*tp_traverse*/ + __pyx_tp_clear_6gevent_5libev_8corecext_loop, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6gevent_5libev_8corecext_loop, /*tp_methods*/ + 0, /*tp_members*/ + __pyx_getsets_6gevent_5libev_8corecext_loop, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_pw_6gevent_5libev_8corecext_4loop_3__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6gevent_5libev_8corecext_loop, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static PyObject *__pyx_tp_new_6gevent_5libev_8corecext_watcher(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + struct PyGeventWatcherObject *p; + PyObject *o; + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + p = ((struct PyGeventWatcherObject *)o); + p->loop = ((struct PyGeventLoopObject *)Py_None); Py_INCREF(Py_None); + p->_callback = Py_None; Py_INCREF(Py_None); + p->args = ((PyObject*)Py_None); Py_INCREF(Py_None); + return o; +} + +static void __pyx_tp_dealloc_6gevent_5libev_8corecext_watcher(PyObject *o) { + struct PyGeventWatcherObject *p = (struct PyGeventWatcherObject *)o; + #if CYTHON_USE_TP_FINALIZE + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + PyObject_GC_UnTrack(o); + Py_CLEAR(p->loop); + Py_CLEAR(p->_callback); + Py_CLEAR(p->args); + (*Py_TYPE(o)->tp_free)(o); +} + +static int __pyx_tp_traverse_6gevent_5libev_8corecext_watcher(PyObject *o, visitproc v, void *a) { + int e; + struct PyGeventWatcherObject *p = (struct PyGeventWatcherObject *)o; + if (p->loop) { + e = (*v)(((PyObject *)p->loop), a); if (e) return e; + } + if (p->_callback) { + e = (*v)(p->_callback, a); if (e) return e; + } + if (p->args) { + e = (*v)(p->args, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_6gevent_5libev_8corecext_watcher(PyObject *o) { + PyObject* tmp; + struct PyGeventWatcherObject *p = (struct PyGeventWatcherObject *)o; + tmp = ((PyObject*)p->loop); + p->loop = ((struct PyGeventLoopObject *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->_callback); + p->_callback = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->args); + p->args = ((PyObject*)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_7watcher_ref(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_7watcher_3ref_1__get__(o); +} + +static int __pyx_setprop_6gevent_5libev_8corecext_7watcher_ref(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6gevent_5libev_8corecext_7watcher_3ref_3__set__(o, v); + } + else { + PyErr_SetString(PyExc_NotImplementedError, "__del__"); + return -1; + } +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_7watcher_callback(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_7watcher_8callback_1__get__(o); +} + +static int __pyx_setprop_6gevent_5libev_8corecext_7watcher_callback(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6gevent_5libev_8corecext_7watcher_8callback_3__set__(o, v); + } + else { + PyErr_SetString(PyExc_NotImplementedError, "__del__"); + return -1; + } +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_7watcher_priority(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_7watcher_8priority_1__get__(o); +} + +static int __pyx_setprop_6gevent_5libev_8corecext_7watcher_priority(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6gevent_5libev_8corecext_7watcher_8priority_3__set__(o, v); + } + else { + PyErr_SetString(PyExc_NotImplementedError, "__del__"); + return -1; + } +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_7watcher_active(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_7watcher_6active_1__get__(o); +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_7watcher_pending(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_7watcher_7pending_1__get__(o); +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_7watcher_loop(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_7watcher_4loop_1__get__(o); +} + +static int __pyx_setprop_6gevent_5libev_8corecext_7watcher_loop(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6gevent_5libev_8corecext_7watcher_4loop_3__set__(o, v); + } + else { + return __pyx_pw_6gevent_5libev_8corecext_7watcher_4loop_5__del__(o); + } +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_7watcher_args(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_7watcher_4args_1__get__(o); +} + +static int __pyx_setprop_6gevent_5libev_8corecext_7watcher_args(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6gevent_5libev_8corecext_7watcher_4args_3__set__(o, v); + } + else { + return __pyx_pw_6gevent_5libev_8corecext_7watcher_4args_5__del__(o); + } +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_7watcher__flags(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_7watcher_6_flags_1__get__(o); +} + +static PyMethodDef __pyx_methods_6gevent_5libev_8corecext_watcher[] = { + {"start", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_5libev_8corecext_7watcher_3start, METH_VARARGS|METH_KEYWORDS, 0}, + {"stop", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_7watcher_5stop, METH_NOARGS, 0}, + {"feed", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_5libev_8corecext_7watcher_7feed, METH_VARARGS|METH_KEYWORDS, 0}, + {"_format", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_7watcher_11_format, METH_NOARGS, 0}, + {"close", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_7watcher_13close, METH_NOARGS, 0}, + {"__enter__", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_7watcher_15__enter__, METH_NOARGS, 0}, + {"__exit__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_5libev_8corecext_7watcher_17__exit__, METH_VARARGS|METH_KEYWORDS, 0}, + {0, 0, 0, 0} +}; + +static struct PyGetSetDef __pyx_getsets_6gevent_5libev_8corecext_watcher[] = { + {(char *)"ref", __pyx_getprop_6gevent_5libev_8corecext_7watcher_ref, __pyx_setprop_6gevent_5libev_8corecext_7watcher_ref, (char *)0, 0}, + {(char *)"callback", __pyx_getprop_6gevent_5libev_8corecext_7watcher_callback, __pyx_setprop_6gevent_5libev_8corecext_7watcher_callback, (char *)0, 0}, + {(char *)"priority", __pyx_getprop_6gevent_5libev_8corecext_7watcher_priority, __pyx_setprop_6gevent_5libev_8corecext_7watcher_priority, (char *)0, 0}, + {(char *)"active", __pyx_getprop_6gevent_5libev_8corecext_7watcher_active, 0, (char *)0, 0}, + {(char *)"pending", __pyx_getprop_6gevent_5libev_8corecext_7watcher_pending, 0, (char *)0, 0}, + {(char *)"loop", __pyx_getprop_6gevent_5libev_8corecext_7watcher_loop, __pyx_setprop_6gevent_5libev_8corecext_7watcher_loop, (char *)0, 0}, + {(char *)"args", __pyx_getprop_6gevent_5libev_8corecext_7watcher_args, __pyx_setprop_6gevent_5libev_8corecext_7watcher_args, (char *)0, 0}, + {(char *)"_flags", __pyx_getprop_6gevent_5libev_8corecext_7watcher__flags, 0, (char *)0, 0}, + {0, 0, 0, 0, 0} +}; + +DL_EXPORT(PyTypeObject) PyGeventWatcher_Type = { + PyVarObject_HEAD_INIT(0, 0) + "gevent.libev.corecext.watcher", /*tp_name*/ + sizeof(struct PyGeventWatcherObject), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6gevent_5libev_8corecext_watcher, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + __pyx_pw_6gevent_5libev_8corecext_7watcher_9__repr__, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + "Abstract base class for all the watchers", /*tp_doc*/ + __pyx_tp_traverse_6gevent_5libev_8corecext_watcher, /*tp_traverse*/ + __pyx_tp_clear_6gevent_5libev_8corecext_watcher, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6gevent_5libev_8corecext_watcher, /*tp_methods*/ + 0, /*tp_members*/ + __pyx_getsets_6gevent_5libev_8corecext_watcher, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_pw_6gevent_5libev_8corecext_7watcher_1__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6gevent_5libev_8corecext_watcher, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static PyObject *__pyx_tp_new_6gevent_5libev_8corecext_io(PyTypeObject *t, PyObject *a, PyObject *k) { + PyObject *o = __pyx_tp_new_6gevent_5libev_8corecext_watcher(t, a, k); + if (unlikely(!o)) return 0; + if (unlikely(__pyx_pw_6gevent_5libev_8corecext_2io_5__cinit__(o, a, k) < 0)) goto bad; + return o; + bad: + Py_DECREF(o); o = 0; + return NULL; +} + +static void __pyx_tp_dealloc_6gevent_5libev_8corecext_io(PyObject *o) { + #if CYTHON_USE_TP_FINALIZE + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + PyObject_GC_UnTrack(o); + { + PyObject *etype, *eval, *etb; + PyErr_Fetch(&etype, &eval, &etb); + ++Py_REFCNT(o); + __pyx_pw_6gevent_5libev_8corecext_2io_7__dealloc__(o); + --Py_REFCNT(o); + PyErr_Restore(etype, eval, etb); + } + PyObject_GC_Track(o); + __pyx_tp_dealloc_6gevent_5libev_8corecext_watcher(o); +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_2io_fd(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_2io_2fd_1__get__(o); +} + +static int __pyx_setprop_6gevent_5libev_8corecext_2io_fd(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6gevent_5libev_8corecext_2io_2fd_3__set__(o, v); + } + else { + PyErr_SetString(PyExc_NotImplementedError, "__del__"); + return -1; + } +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_2io_events(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_2io_6events_1__get__(o); +} + +static int __pyx_setprop_6gevent_5libev_8corecext_2io_events(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6gevent_5libev_8corecext_2io_6events_3__set__(o, v); + } + else { + PyErr_SetString(PyExc_NotImplementedError, "__del__"); + return -1; + } +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_2io_events_str(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_2io_10events_str_1__get__(o); +} + +static PyMethodDef __pyx_methods_6gevent_5libev_8corecext_io[] = { + {"start", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_5libev_8corecext_2io_1start, METH_VARARGS|METH_KEYWORDS, 0}, + {"_format", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_2io_9_format, METH_NOARGS, 0}, + {0, 0, 0, 0} +}; + +static struct PyGetSetDef __pyx_getsets_6gevent_5libev_8corecext_io[] = { + {(char *)"fd", __pyx_getprop_6gevent_5libev_8corecext_2io_fd, __pyx_setprop_6gevent_5libev_8corecext_2io_fd, (char *)0, 0}, + {(char *)"events", __pyx_getprop_6gevent_5libev_8corecext_2io_events, __pyx_setprop_6gevent_5libev_8corecext_2io_events, (char *)0, 0}, + {(char *)"events_str", __pyx_getprop_6gevent_5libev_8corecext_2io_events_str, 0, (char *)0, 0}, + {0, 0, 0, 0, 0} +}; + +DL_EXPORT(PyTypeObject) PyGeventIO_Type = { + PyVarObject_HEAD_INIT(0, 0) + "gevent.libev.corecext.io", /*tp_name*/ + sizeof(struct PyGeventIOObject), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6gevent_5libev_8corecext_io, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_6gevent_5libev_8corecext_7watcher_9__repr__, /*tp_repr*/ + #else + 0, /*tp_repr*/ + #endif + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_6gevent_5libev_8corecext_watcher, /*tp_traverse*/ + __pyx_tp_clear_6gevent_5libev_8corecext_watcher, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6gevent_5libev_8corecext_io, /*tp_methods*/ + 0, /*tp_members*/ + __pyx_getsets_6gevent_5libev_8corecext_io, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_pw_6gevent_5libev_8corecext_2io_3__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6gevent_5libev_8corecext_io, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static PyObject *__pyx_tp_new_6gevent_5libev_8corecext_timer(PyTypeObject *t, PyObject *a, PyObject *k) { + PyObject *o = __pyx_tp_new_6gevent_5libev_8corecext_watcher(t, a, k); + if (unlikely(!o)) return 0; + if (unlikely(__pyx_pw_6gevent_5libev_8corecext_5timer_1__cinit__(o, a, k) < 0)) goto bad; + return o; + bad: + Py_DECREF(o); o = 0; + return NULL; +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_5timer_at(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_5timer_2at_1__get__(o); +} + +static PyMethodDef __pyx_methods_6gevent_5libev_8corecext_timer[] = { + {"start", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_5libev_8corecext_5timer_5start, METH_VARARGS|METH_KEYWORDS, 0}, + {"again", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_5libev_8corecext_5timer_7again, METH_VARARGS|METH_KEYWORDS, 0}, + {0, 0, 0, 0} +}; + +static struct PyGetSetDef __pyx_getsets_6gevent_5libev_8corecext_timer[] = { + {(char *)"at", __pyx_getprop_6gevent_5libev_8corecext_5timer_at, 0, (char *)0, 0}, + {0, 0, 0, 0, 0} +}; + +DL_EXPORT(PyTypeObject) PyGeventTimer_Type = { + PyVarObject_HEAD_INIT(0, 0) + "gevent.libev.corecext.timer", /*tp_name*/ + sizeof(struct PyGeventTimerObject), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6gevent_5libev_8corecext_watcher, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_6gevent_5libev_8corecext_7watcher_9__repr__, /*tp_repr*/ + #else + 0, /*tp_repr*/ + #endif + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_6gevent_5libev_8corecext_watcher, /*tp_traverse*/ + __pyx_tp_clear_6gevent_5libev_8corecext_watcher, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6gevent_5libev_8corecext_timer, /*tp_methods*/ + 0, /*tp_members*/ + __pyx_getsets_6gevent_5libev_8corecext_timer, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_pw_6gevent_5libev_8corecext_5timer_3__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6gevent_5libev_8corecext_timer, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static PyObject *__pyx_tp_new_6gevent_5libev_8corecext_signal(PyTypeObject *t, PyObject *a, PyObject *k) { + PyObject *o = __pyx_tp_new_6gevent_5libev_8corecext_watcher(t, a, k); + if (unlikely(!o)) return 0; + if (unlikely(__pyx_pw_6gevent_5libev_8corecext_6signal_1__cinit__(o, a, k) < 0)) goto bad; + return o; + bad: + Py_DECREF(o); o = 0; + return NULL; +} + +static PyMethodDef __pyx_methods_6gevent_5libev_8corecext_signal[] = { + {0, 0, 0, 0} +}; + +DL_EXPORT(PyTypeObject) PyGeventSignal_Type = { + PyVarObject_HEAD_INIT(0, 0) + "gevent.libev.corecext.signal", /*tp_name*/ + sizeof(struct PyGeventSignalObject), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6gevent_5libev_8corecext_watcher, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_6gevent_5libev_8corecext_7watcher_9__repr__, /*tp_repr*/ + #else + 0, /*tp_repr*/ + #endif + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_6gevent_5libev_8corecext_watcher, /*tp_traverse*/ + __pyx_tp_clear_6gevent_5libev_8corecext_watcher, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6gevent_5libev_8corecext_signal, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_pw_6gevent_5libev_8corecext_6signal_3__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6gevent_5libev_8corecext_signal, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static PyObject *__pyx_tp_new_6gevent_5libev_8corecext_idle(PyTypeObject *t, PyObject *a, PyObject *k) { + PyObject *o = __pyx_tp_new_6gevent_5libev_8corecext_watcher(t, a, k); + if (unlikely(!o)) return 0; + if (unlikely(__pyx_pw_6gevent_5libev_8corecext_4idle_1__cinit__(o, a, k) < 0)) goto bad; + return o; + bad: + Py_DECREF(o); o = 0; + return NULL; +} + +static PyMethodDef __pyx_methods_6gevent_5libev_8corecext_idle[] = { + {0, 0, 0, 0} +}; + +DL_EXPORT(PyTypeObject) PyGeventIdle_Type = { + PyVarObject_HEAD_INIT(0, 0) + "gevent.libev.corecext.idle", /*tp_name*/ + sizeof(struct PyGeventIdleObject), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6gevent_5libev_8corecext_watcher, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_6gevent_5libev_8corecext_7watcher_9__repr__, /*tp_repr*/ + #else + 0, /*tp_repr*/ + #endif + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_6gevent_5libev_8corecext_watcher, /*tp_traverse*/ + __pyx_tp_clear_6gevent_5libev_8corecext_watcher, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6gevent_5libev_8corecext_idle, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_6gevent_5libev_8corecext_7watcher_1__init__, /*tp_init*/ + #else + 0, /*tp_init*/ + #endif + 0, /*tp_alloc*/ + __pyx_tp_new_6gevent_5libev_8corecext_idle, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static PyObject *__pyx_tp_new_6gevent_5libev_8corecext_prepare(PyTypeObject *t, PyObject *a, PyObject *k) { + PyObject *o = __pyx_tp_new_6gevent_5libev_8corecext_watcher(t, a, k); + if (unlikely(!o)) return 0; + if (unlikely(__pyx_pw_6gevent_5libev_8corecext_7prepare_1__cinit__(o, a, k) < 0)) goto bad; + return o; + bad: + Py_DECREF(o); o = 0; + return NULL; +} + +static PyMethodDef __pyx_methods_6gevent_5libev_8corecext_prepare[] = { + {0, 0, 0, 0} +}; + +DL_EXPORT(PyTypeObject) PyGeventPrepare_Type = { + PyVarObject_HEAD_INIT(0, 0) + "gevent.libev.corecext.prepare", /*tp_name*/ + sizeof(struct PyGeventPrepareObject), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6gevent_5libev_8corecext_watcher, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_6gevent_5libev_8corecext_7watcher_9__repr__, /*tp_repr*/ + #else + 0, /*tp_repr*/ + #endif + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_6gevent_5libev_8corecext_watcher, /*tp_traverse*/ + __pyx_tp_clear_6gevent_5libev_8corecext_watcher, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6gevent_5libev_8corecext_prepare, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_6gevent_5libev_8corecext_7watcher_1__init__, /*tp_init*/ + #else + 0, /*tp_init*/ + #endif + 0, /*tp_alloc*/ + __pyx_tp_new_6gevent_5libev_8corecext_prepare, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static PyObject *__pyx_tp_new_6gevent_5libev_8corecext_check(PyTypeObject *t, PyObject *a, PyObject *k) { + PyObject *o = __pyx_tp_new_6gevent_5libev_8corecext_watcher(t, a, k); + if (unlikely(!o)) return 0; + if (unlikely(__pyx_pw_6gevent_5libev_8corecext_5check_1__cinit__(o, a, k) < 0)) goto bad; + return o; + bad: + Py_DECREF(o); o = 0; + return NULL; +} + +static PyMethodDef __pyx_methods_6gevent_5libev_8corecext_check[] = { + {0, 0, 0, 0} +}; + +DL_EXPORT(PyTypeObject) PyGeventCheck_Type = { + PyVarObject_HEAD_INIT(0, 0) + "gevent.libev.corecext.check", /*tp_name*/ + sizeof(struct PyGeventCheckObject), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6gevent_5libev_8corecext_watcher, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_6gevent_5libev_8corecext_7watcher_9__repr__, /*tp_repr*/ + #else + 0, /*tp_repr*/ + #endif + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_6gevent_5libev_8corecext_watcher, /*tp_traverse*/ + __pyx_tp_clear_6gevent_5libev_8corecext_watcher, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6gevent_5libev_8corecext_check, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_6gevent_5libev_8corecext_7watcher_1__init__, /*tp_init*/ + #else + 0, /*tp_init*/ + #endif + 0, /*tp_alloc*/ + __pyx_tp_new_6gevent_5libev_8corecext_check, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static PyObject *__pyx_tp_new_6gevent_5libev_8corecext_fork(PyTypeObject *t, PyObject *a, PyObject *k) { + PyObject *o = __pyx_tp_new_6gevent_5libev_8corecext_watcher(t, a, k); + if (unlikely(!o)) return 0; + if (unlikely(__pyx_pw_6gevent_5libev_8corecext_4fork_1__cinit__(o, a, k) < 0)) goto bad; + return o; + bad: + Py_DECREF(o); o = 0; + return NULL; +} + +static PyMethodDef __pyx_methods_6gevent_5libev_8corecext_fork[] = { + {0, 0, 0, 0} +}; + +DL_EXPORT(PyTypeObject) PyGeventFork_Type = { + PyVarObject_HEAD_INIT(0, 0) + "gevent.libev.corecext.fork", /*tp_name*/ + sizeof(struct PyGeventForkObject), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6gevent_5libev_8corecext_watcher, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_6gevent_5libev_8corecext_7watcher_9__repr__, /*tp_repr*/ + #else + 0, /*tp_repr*/ + #endif + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_6gevent_5libev_8corecext_watcher, /*tp_traverse*/ + __pyx_tp_clear_6gevent_5libev_8corecext_watcher, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6gevent_5libev_8corecext_fork, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_6gevent_5libev_8corecext_7watcher_1__init__, /*tp_init*/ + #else + 0, /*tp_init*/ + #endif + 0, /*tp_alloc*/ + __pyx_tp_new_6gevent_5libev_8corecext_fork, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static PyObject *__pyx_tp_new_6gevent_5libev_8corecext_async_(PyTypeObject *t, PyObject *a, PyObject *k) { + PyObject *o = __pyx_tp_new_6gevent_5libev_8corecext_watcher(t, a, k); + if (unlikely(!o)) return 0; + if (unlikely(__pyx_pw_6gevent_5libev_8corecext_6async__1__cinit__(o, a, k) < 0)) goto bad; + return o; + bad: + Py_DECREF(o); o = 0; + return NULL; +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_6async__pending(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_6async__7pending_1__get__(o); +} + +static PyMethodDef __pyx_methods_6gevent_5libev_8corecext_async_[] = { + {"send", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_6async__3send, METH_NOARGS, 0}, + {0, 0, 0, 0} +}; + +static struct PyGetSetDef __pyx_getsets_6gevent_5libev_8corecext_async_[] = { + {(char *)"pending", __pyx_getprop_6gevent_5libev_8corecext_6async__pending, 0, (char *)0, 0}, + {0, 0, 0, 0, 0} +}; + +DL_EXPORT(PyTypeObject) PyGeventAsync_Type = { + PyVarObject_HEAD_INIT(0, 0) + "gevent.libev.corecext.async_", /*tp_name*/ + sizeof(struct PyGeventAsyncObject), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6gevent_5libev_8corecext_watcher, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_6gevent_5libev_8corecext_7watcher_9__repr__, /*tp_repr*/ + #else + 0, /*tp_repr*/ + #endif + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_6gevent_5libev_8corecext_watcher, /*tp_traverse*/ + __pyx_tp_clear_6gevent_5libev_8corecext_watcher, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6gevent_5libev_8corecext_async_, /*tp_methods*/ + 0, /*tp_members*/ + __pyx_getsets_6gevent_5libev_8corecext_async_, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_6gevent_5libev_8corecext_7watcher_1__init__, /*tp_init*/ + #else + 0, /*tp_init*/ + #endif + 0, /*tp_alloc*/ + __pyx_tp_new_6gevent_5libev_8corecext_async_, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static PyObject *__pyx_tp_new_6gevent_5libev_8corecext_child(PyTypeObject *t, PyObject *a, PyObject *k) { + PyObject *o = __pyx_tp_new_6gevent_5libev_8corecext_watcher(t, a, k); + if (unlikely(!o)) return 0; + if (unlikely(__pyx_pw_6gevent_5libev_8corecext_5child_1__cinit__(o, a, k) < 0)) goto bad; + return o; + bad: + Py_DECREF(o); o = 0; + return NULL; +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_5child_pid(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_5child_3pid_1__get__(o); +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_5child_rpid(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_5child_4rpid_1__get__(o); +} + +static int __pyx_setprop_6gevent_5libev_8corecext_5child_rpid(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6gevent_5libev_8corecext_5child_4rpid_3__set__(o, v); + } + else { + PyErr_SetString(PyExc_NotImplementedError, "__del__"); + return -1; + } +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_5child_rstatus(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_5child_7rstatus_1__get__(o); +} + +static int __pyx_setprop_6gevent_5libev_8corecext_5child_rstatus(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6gevent_5libev_8corecext_5child_7rstatus_3__set__(o, v); + } + else { + PyErr_SetString(PyExc_NotImplementedError, "__del__"); + return -1; + } +} + +static PyMethodDef __pyx_methods_6gevent_5libev_8corecext_child[] = { + {"_format", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_5child_5_format, METH_NOARGS, 0}, + {0, 0, 0, 0} +}; + +static struct PyGetSetDef __pyx_getsets_6gevent_5libev_8corecext_child[] = { + {(char *)"pid", __pyx_getprop_6gevent_5libev_8corecext_5child_pid, 0, (char *)0, 0}, + {(char *)"rpid", __pyx_getprop_6gevent_5libev_8corecext_5child_rpid, __pyx_setprop_6gevent_5libev_8corecext_5child_rpid, (char *)0, 0}, + {(char *)"rstatus", __pyx_getprop_6gevent_5libev_8corecext_5child_rstatus, __pyx_setprop_6gevent_5libev_8corecext_5child_rstatus, (char *)0, 0}, + {0, 0, 0, 0, 0} +}; + +DL_EXPORT(PyTypeObject) PyGeventChild_Type = { + PyVarObject_HEAD_INIT(0, 0) + "gevent.libev.corecext.child", /*tp_name*/ + sizeof(struct PyGeventChildObject), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6gevent_5libev_8corecext_watcher, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_6gevent_5libev_8corecext_7watcher_9__repr__, /*tp_repr*/ + #else + 0, /*tp_repr*/ + #endif + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_6gevent_5libev_8corecext_watcher, /*tp_traverse*/ + __pyx_tp_clear_6gevent_5libev_8corecext_watcher, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6gevent_5libev_8corecext_child, /*tp_methods*/ + 0, /*tp_members*/ + __pyx_getsets_6gevent_5libev_8corecext_child, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_pw_6gevent_5libev_8corecext_5child_3__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6gevent_5libev_8corecext_child, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static PyObject *__pyx_tp_new_6gevent_5libev_8corecext_stat(PyTypeObject *t, PyObject *a, PyObject *k) { + struct PyGeventStatObject *p; + PyObject *o = __pyx_tp_new_6gevent_5libev_8corecext_watcher(t, a, k); + if (unlikely(!o)) return 0; + p = ((struct PyGeventStatObject *)o); + p->path = ((PyObject*)Py_None); Py_INCREF(Py_None); + p->_paths = ((PyObject*)Py_None); Py_INCREF(Py_None); + if (unlikely(__pyx_pw_6gevent_5libev_8corecext_4stat_1__cinit__(o, a, k) < 0)) goto bad; + return o; + bad: + Py_DECREF(o); o = 0; + return NULL; +} + +static void __pyx_tp_dealloc_6gevent_5libev_8corecext_stat(PyObject *o) { + struct PyGeventStatObject *p = (struct PyGeventStatObject *)o; + #if CYTHON_USE_TP_FINALIZE + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + PyObject_GC_UnTrack(o); + Py_CLEAR(p->path); + Py_CLEAR(p->_paths); + PyObject_GC_Track(o); + __pyx_tp_dealloc_6gevent_5libev_8corecext_watcher(o); +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_4stat_attr(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_4stat_4attr_1__get__(o); +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_4stat_prev(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_4stat_4prev_1__get__(o); +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_4stat_interval(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_4stat_8interval_1__get__(o); +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_4stat_path(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_4stat_4path_1__get__(o); +} + +static PyObject *__pyx_getprop_6gevent_5libev_8corecext_4stat__paths(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_5libev_8corecext_4stat_6_paths_1__get__(o); +} + +static PyMethodDef __pyx_methods_6gevent_5libev_8corecext_stat[] = { + {0, 0, 0, 0} +}; + +static struct PyGetSetDef __pyx_getsets_6gevent_5libev_8corecext_stat[] = { + {(char *)"attr", __pyx_getprop_6gevent_5libev_8corecext_4stat_attr, 0, (char *)0, 0}, + {(char *)"prev", __pyx_getprop_6gevent_5libev_8corecext_4stat_prev, 0, (char *)0, 0}, + {(char *)"interval", __pyx_getprop_6gevent_5libev_8corecext_4stat_interval, 0, (char *)0, 0}, + {(char *)"path", __pyx_getprop_6gevent_5libev_8corecext_4stat_path, 0, (char *)0, 0}, + {(char *)"_paths", __pyx_getprop_6gevent_5libev_8corecext_4stat__paths, 0, (char *)0, 0}, + {0, 0, 0, 0, 0} +}; + +DL_EXPORT(PyTypeObject) PyGeventStat_Type = { + PyVarObject_HEAD_INIT(0, 0) + "gevent.libev.corecext.stat", /*tp_name*/ + sizeof(struct PyGeventStatObject), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6gevent_5libev_8corecext_stat, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_6gevent_5libev_8corecext_7watcher_9__repr__, /*tp_repr*/ + #else + 0, /*tp_repr*/ + #endif + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_6gevent_5libev_8corecext_watcher, /*tp_traverse*/ + __pyx_tp_clear_6gevent_5libev_8corecext_watcher, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6gevent_5libev_8corecext_stat, /*tp_methods*/ + 0, /*tp_members*/ + __pyx_getsets_6gevent_5libev_8corecext_stat, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_pw_6gevent_5libev_8corecext_4stat_3__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6gevent_5libev_8corecext_stat, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static struct __pyx_obj_6gevent_5libev_8corecext___pyx_scope_struct__genexpr *__pyx_freelist_6gevent_5libev_8corecext___pyx_scope_struct__genexpr[8]; +static int __pyx_freecount_6gevent_5libev_8corecext___pyx_scope_struct__genexpr = 0; + +static PyObject *__pyx_tp_new_6gevent_5libev_8corecext___pyx_scope_struct__genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + PyObject *o; + if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_6gevent_5libev_8corecext___pyx_scope_struct__genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_6gevent_5libev_8corecext___pyx_scope_struct__genexpr)))) { + o = (PyObject*)__pyx_freelist_6gevent_5libev_8corecext___pyx_scope_struct__genexpr[--__pyx_freecount_6gevent_5libev_8corecext___pyx_scope_struct__genexpr]; + memset(o, 0, sizeof(struct __pyx_obj_6gevent_5libev_8corecext___pyx_scope_struct__genexpr)); + (void) PyObject_INIT(o, t); + PyObject_GC_Track(o); + } else { + o = (*t->tp_alloc)(t, 0); + if (unlikely(!o)) return 0; + } + return o; +} + +static void __pyx_tp_dealloc_6gevent_5libev_8corecext___pyx_scope_struct__genexpr(PyObject *o) { + struct __pyx_obj_6gevent_5libev_8corecext___pyx_scope_struct__genexpr *p = (struct __pyx_obj_6gevent_5libev_8corecext___pyx_scope_struct__genexpr *)o; + PyObject_GC_UnTrack(o); + Py_CLEAR(p->__pyx_v_flag); + Py_CLEAR(p->__pyx_v_string); + if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_6gevent_5libev_8corecext___pyx_scope_struct__genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_6gevent_5libev_8corecext___pyx_scope_struct__genexpr)))) { + __pyx_freelist_6gevent_5libev_8corecext___pyx_scope_struct__genexpr[__pyx_freecount_6gevent_5libev_8corecext___pyx_scope_struct__genexpr++] = ((struct __pyx_obj_6gevent_5libev_8corecext___pyx_scope_struct__genexpr *)o); + } else { + (*Py_TYPE(o)->tp_free)(o); + } +} + +static int __pyx_tp_traverse_6gevent_5libev_8corecext___pyx_scope_struct__genexpr(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_6gevent_5libev_8corecext___pyx_scope_struct__genexpr *p = (struct __pyx_obj_6gevent_5libev_8corecext___pyx_scope_struct__genexpr *)o; + if (p->__pyx_v_flag) { + e = (*v)(p->__pyx_v_flag, a); if (e) return e; + } + if (p->__pyx_v_string) { + e = (*v)(p->__pyx_v_string, a); if (e) return e; + } + return 0; +} + +static PyTypeObject __pyx_type_6gevent_5libev_8corecext___pyx_scope_struct__genexpr = { + PyVarObject_HEAD_INIT(0, 0) + "gevent.libev.corecext.__pyx_scope_struct__genexpr", /*tp_name*/ + sizeof(struct __pyx_obj_6gevent_5libev_8corecext___pyx_scope_struct__genexpr), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6gevent_5libev_8corecext___pyx_scope_struct__genexpr, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_6gevent_5libev_8corecext___pyx_scope_struct__genexpr, /*tp_traverse*/ + 0, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + 0, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6gevent_5libev_8corecext___pyx_scope_struct__genexpr, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static PyMethodDef __pyx_methods[] = { + {"_flags_to_list", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_5_flags_to_list, METH_O, 0}, + {"_flags_to_int", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_7_flags_to_int, METH_O, 0}, + {"_check_flags", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_9_check_flags, METH_O, 0}, + {"_events_to_str", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_11_events_to_str, METH_O, 0}, + {"set_syserr_cb", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_21set_syserr_cb, METH_O, 0}, + {0, 0, 0, 0} +}; + +#if PY_MAJOR_VERSION >= 3 +#if CYTHON_PEP489_MULTI_PHASE_INIT +static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ +static int __pyx_pymod_exec_corecext(PyObject* module); /*proto*/ +static PyModuleDef_Slot __pyx_moduledef_slots[] = { + {Py_mod_create, (void*)__pyx_pymod_create}, + {Py_mod_exec, (void*)__pyx_pymod_exec_corecext}, + {0, NULL} +}; +#endif + +static struct PyModuleDef __pyx_moduledef = { + PyModuleDef_HEAD_INIT, + "corecext", + 0, /* m_doc */ + #if CYTHON_PEP489_MULTI_PHASE_INIT + 0, /* m_size */ + #else + -1, /* m_size */ + #endif + __pyx_methods /* m_methods */, + #if CYTHON_PEP489_MULTI_PHASE_INIT + __pyx_moduledef_slots, /* m_slots */ + #else + NULL, /* m_reload */ + #endif + NULL, /* m_traverse */ + NULL, /* m_clear */ + NULL /* m_free */ +}; +#endif +#ifndef CYTHON_SMALL_CODE +#if defined(__clang__) + #define CYTHON_SMALL_CODE +#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) + #define CYTHON_SMALL_CODE __attribute__((cold)) +#else + #define CYTHON_SMALL_CODE +#endif +#endif + +static __Pyx_StringTabEntry __pyx_string_tab[] = { + {&__pyx_kp_s_, __pyx_k_, sizeof(__pyx_k_), 0, 0, 1, 0}, + {&__pyx_n_s_ASYNC, __pyx_k_ASYNC, sizeof(__pyx_k_ASYNC), 0, 0, 1, 1}, + {&__pyx_n_s_AttributeError, __pyx_k_AttributeError, sizeof(__pyx_k_AttributeError), 0, 0, 1, 1}, + {&__pyx_n_s_BACKEND_EPOLL, __pyx_k_BACKEND_EPOLL, sizeof(__pyx_k_BACKEND_EPOLL), 0, 0, 1, 1}, + {&__pyx_n_s_BACKEND_KQUEUE, __pyx_k_BACKEND_KQUEUE, sizeof(__pyx_k_BACKEND_KQUEUE), 0, 0, 1, 1}, + {&__pyx_n_s_BACKEND_POLL, __pyx_k_BACKEND_POLL, sizeof(__pyx_k_BACKEND_POLL), 0, 0, 1, 1}, + {&__pyx_n_s_BACKEND_PORT, __pyx_k_BACKEND_PORT, sizeof(__pyx_k_BACKEND_PORT), 0, 0, 1, 1}, + {&__pyx_n_s_BACKEND_SELECT, __pyx_k_BACKEND_SELECT, sizeof(__pyx_k_BACKEND_SELECT), 0, 0, 1, 1}, + {&__pyx_n_s_CHECK, __pyx_k_CHECK, sizeof(__pyx_k_CHECK), 0, 0, 1, 1}, + {&__pyx_n_s_CHILD, __pyx_k_CHILD, sizeof(__pyx_k_CHILD), 0, 0, 1, 1}, + {&__pyx_n_s_CLEANUP, __pyx_k_CLEANUP, sizeof(__pyx_k_CLEANUP), 0, 0, 1, 1}, + {&__pyx_n_s_CUSTOM, __pyx_k_CUSTOM, sizeof(__pyx_k_CUSTOM), 0, 0, 1, 1}, + {&__pyx_kp_s_Cannot_construct_a_bare_watcher, __pyx_k_Cannot_construct_a_bare_watcher, sizeof(__pyx_k_Cannot_construct_a_bare_watcher), 0, 0, 1, 0}, + {&__pyx_kp_s_Cannot_set_priority_of_an_active, __pyx_k_Cannot_set_priority_of_an_active, sizeof(__pyx_k_Cannot_set_priority_of_an_active), 0, 0, 1, 0}, + {&__pyx_kp_s_Child_watchers_are_not_supported, __pyx_k_Child_watchers_are_not_supported, sizeof(__pyx_k_Child_watchers_are_not_supported), 0, 0, 1, 0}, + {&__pyx_n_s_EMBED, __pyx_k_EMBED, sizeof(__pyx_k_EMBED), 0, 0, 1, 1}, + {&__pyx_n_s_ERROR, __pyx_k_ERROR, sizeof(__pyx_k_ERROR), 0, 0, 1, 1}, + {&__pyx_n_s_EVENTS, __pyx_k_EVENTS, sizeof(__pyx_k_EVENTS), 0, 0, 1, 1}, + {&__pyx_n_s_EV_USE_4HEAP, __pyx_k_EV_USE_4HEAP, sizeof(__pyx_k_EV_USE_4HEAP), 0, 0, 1, 1}, + {&__pyx_n_s_EV_USE_CLOCK_SYSCALL, __pyx_k_EV_USE_CLOCK_SYSCALL, sizeof(__pyx_k_EV_USE_CLOCK_SYSCALL), 0, 0, 1, 1}, + {&__pyx_n_s_EV_USE_EVENTFD, __pyx_k_EV_USE_EVENTFD, sizeof(__pyx_k_EV_USE_EVENTFD), 0, 0, 1, 1}, + {&__pyx_n_s_EV_USE_FLOOR, __pyx_k_EV_USE_FLOOR, sizeof(__pyx_k_EV_USE_FLOOR), 0, 0, 1, 1}, + {&__pyx_n_s_EV_USE_INOTIFY, __pyx_k_EV_USE_INOTIFY, sizeof(__pyx_k_EV_USE_INOTIFY), 0, 0, 1, 1}, + {&__pyx_n_s_EV_USE_MONOTONIC, __pyx_k_EV_USE_MONOTONIC, sizeof(__pyx_k_EV_USE_MONOTONIC), 0, 0, 1, 1}, + {&__pyx_n_s_EV_USE_NANOSLEEP, __pyx_k_EV_USE_NANOSLEEP, sizeof(__pyx_k_EV_USE_NANOSLEEP), 0, 0, 1, 1}, + {&__pyx_n_s_EV_USE_REALTIME, __pyx_k_EV_USE_REALTIME, sizeof(__pyx_k_EV_USE_REALTIME), 0, 0, 1, 1}, + {&__pyx_n_s_EV_USE_SIGNALFD, __pyx_k_EV_USE_SIGNALFD, sizeof(__pyx_k_EV_USE_SIGNALFD), 0, 0, 1, 1}, + {&__pyx_kp_s_Expected_callable_not_r, __pyx_k_Expected_callable_not_r, sizeof(__pyx_k_Expected_callable_not_r), 0, 0, 1, 0}, + {&__pyx_kp_s_Expected_callable_or_None_got_r, __pyx_k_Expected_callable_or_None_got_r, sizeof(__pyx_k_Expected_callable_or_None_got_r), 0, 0, 1, 0}, + {&__pyx_n_s_FORK, __pyx_k_FORK, sizeof(__pyx_k_FORK), 0, 0, 1, 1}, + {&__pyx_n_s_FORKCHECK, __pyx_k_FORKCHECK, sizeof(__pyx_k_FORKCHECK), 0, 0, 1, 1}, + {&__pyx_n_s_IDLE, __pyx_k_IDLE, sizeof(__pyx_k_IDLE), 0, 0, 1, 1}, + {&__pyx_n_s_ILoop, __pyx_k_ILoop, sizeof(__pyx_k_ILoop), 0, 0, 1, 1}, + {&__pyx_n_s_IOFDSET, __pyx_k_IOFDSET, sizeof(__pyx_k_IOFDSET), 0, 0, 1, 1}, + {&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1}, + {&__pyx_kp_s_Invalid_backend_or_flag_s_Possib, __pyx_k_Invalid_backend_or_flag_s_Possib, sizeof(__pyx_k_Invalid_backend_or_flag_s_Possib), 0, 0, 1, 0}, + {&__pyx_kp_s_Invalid_value_for_backend_0x_x, __pyx_k_Invalid_value_for_backend_0x_x, sizeof(__pyx_k_Invalid_value_for_backend_0x_x), 0, 0, 1, 0}, + {&__pyx_n_s_KeyError, __pyx_k_KeyError, sizeof(__pyx_k_KeyError), 0, 0, 1, 1}, + {&__pyx_n_s_LIBEV_EMBED, __pyx_k_LIBEV_EMBED, sizeof(__pyx_k_LIBEV_EMBED), 0, 0, 1, 1}, + {&__pyx_n_s_MAXPRI, __pyx_k_MAXPRI, sizeof(__pyx_k_MAXPRI), 0, 0, 1, 1}, + {&__pyx_n_s_MINPRI, __pyx_k_MINPRI, sizeof(__pyx_k_MINPRI), 0, 0, 1, 1}, + {&__pyx_n_s_NOINOTIFY, __pyx_k_NOINOTIFY, sizeof(__pyx_k_NOINOTIFY), 0, 0, 1, 1}, + {&__pyx_n_s_NONE, __pyx_k_NONE, sizeof(__pyx_k_NONE), 0, 0, 1, 1}, + {&__pyx_n_s_NOSIGMASK, __pyx_k_NOSIGMASK, sizeof(__pyx_k_NOSIGMASK), 0, 0, 1, 1}, + {&__pyx_n_s_NSIG, __pyx_k_NSIG, sizeof(__pyx_k_NSIG), 0, 0, 1, 1}, + {&__pyx_n_s_PERIODIC, __pyx_k_PERIODIC, sizeof(__pyx_k_PERIODIC), 0, 0, 1, 1}, + {&__pyx_n_s_PREPARE, __pyx_k_PREPARE, sizeof(__pyx_k_PREPARE), 0, 0, 1, 1}, + {&__pyx_n_s_READ, __pyx_k_READ, sizeof(__pyx_k_READ), 0, 0, 1, 1}, + {&__pyx_n_s_READWRITE, __pyx_k_READWRITE, sizeof(__pyx_k_READWRITE), 0, 0, 1, 1}, + {&__pyx_n_s_SIGNAL, __pyx_k_SIGNAL, sizeof(__pyx_k_SIGNAL), 0, 0, 1, 1}, + {&__pyx_n_s_SIGNALFD, __pyx_k_SIGNALFD, sizeof(__pyx_k_SIGNALFD), 0, 0, 1, 1}, + {&__pyx_n_s_STAT, __pyx_k_STAT, sizeof(__pyx_k_STAT), 0, 0, 1, 1}, + {&__pyx_n_s_SYSERR_CALLBACK, __pyx_k_SYSERR_CALLBACK, sizeof(__pyx_k_SYSERR_CALLBACK), 0, 0, 1, 1}, + {&__pyx_n_s_SystemError, __pyx_k_SystemError, sizeof(__pyx_k_SystemError), 0, 0, 1, 1}, + {&__pyx_n_s_TIMER, __pyx_k_TIMER, sizeof(__pyx_k_TIMER), 0, 0, 1, 1}, + {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1}, + {&__pyx_n_s_UNDEF, __pyx_k_UNDEF, sizeof(__pyx_k_UNDEF), 0, 0, 1, 1}, + {&__pyx_kp_s_Unsupported_backend_s, __pyx_k_Unsupported_backend_s, sizeof(__pyx_k_Unsupported_backend_s), 0, 0, 1, 0}, + {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1}, + {&__pyx_n_s_WRITE, __pyx_k_WRITE, sizeof(__pyx_k_WRITE), 0, 0, 1, 1}, + {&__pyx_kp_s__2, __pyx_k__2, sizeof(__pyx_k__2), 0, 0, 1, 0}, + {&__pyx_kp_s__3, __pyx_k__3, sizeof(__pyx_k__3), 0, 0, 1, 0}, + {&__pyx_kp_s__5, __pyx_k__5, sizeof(__pyx_k__5), 0, 0, 1, 0}, + {&__pyx_kp_s__6, __pyx_k__6, sizeof(__pyx_k__6), 0, 0, 1, 0}, + {&__pyx_kp_s__7, __pyx_k__7, sizeof(__pyx_k__7), 0, 0, 1, 0}, + {&__pyx_kp_s__8, __pyx_k__8, sizeof(__pyx_k__8), 0, 0, 1, 0}, + {&__pyx_n_s_active, __pyx_k_active, sizeof(__pyx_k_active), 0, 0, 1, 1}, + {&__pyx_kp_s_active_2, __pyx_k_active_2, sizeof(__pyx_k_active_2), 0, 0, 1, 0}, + {&__pyx_n_s_activecnt, __pyx_k_activecnt, sizeof(__pyx_k_activecnt), 0, 0, 1, 1}, + {&__pyx_n_s_after, __pyx_k_after, sizeof(__pyx_k_after), 0, 0, 1, 1}, + {&__pyx_n_s_all, __pyx_k_all, sizeof(__pyx_k_all), 0, 0, 1, 1}, + {&__pyx_n_s_args, __pyx_k_args, sizeof(__pyx_k_args), 0, 0, 1, 1}, + {&__pyx_kp_s_args_r, __pyx_k_args_r, sizeof(__pyx_k_args_r), 0, 0, 1, 0}, + {&__pyx_n_s_async, __pyx_k_async, sizeof(__pyx_k_async), 0, 0, 1, 1}, + {&__pyx_n_s_async_2, __pyx_k_async_2, sizeof(__pyx_k_async_2), 0, 0, 1, 1}, + {&__pyx_n_s_backend, __pyx_k_backend, sizeof(__pyx_k_backend), 0, 0, 1, 1}, + {&__pyx_n_s_basestring, __pyx_k_basestring, sizeof(__pyx_k_basestring), 0, 0, 1, 1}, + {&__pyx_n_s_builtins, __pyx_k_builtins, sizeof(__pyx_k_builtins), 0, 0, 1, 1}, + {&__pyx_n_s_callback, __pyx_k_callback, sizeof(__pyx_k_callback), 0, 0, 1, 1}, + {&__pyx_kp_s_callback_r, __pyx_k_callback_r, sizeof(__pyx_k_callback_r), 0, 0, 1, 0}, + {&__pyx_kp_s_callbacks_r_len_d_head_r_tail_r, __pyx_k_callbacks_r_len_d_head_r_tail_r, sizeof(__pyx_k_callbacks_r_len_d_head_r_tail_r), 0, 0, 1, 0}, + {&__pyx_n_s_check, __pyx_k_check, sizeof(__pyx_k_check), 0, 0, 1, 1}, + {&__pyx_n_s_child, __pyx_k_child, sizeof(__pyx_k_child), 0, 0, 1, 1}, + {&__pyx_kp_s_child_watchers_are_only_availabl, __pyx_k_child_watchers_are_only_availabl, sizeof(__pyx_k_child_watchers_are_only_availabl), 0, 0, 1, 0}, + {&__pyx_n_s_class, __pyx_k_class, sizeof(__pyx_k_class), 0, 0, 1, 1}, + {&__pyx_n_s_classImplements, __pyx_k_classImplements, sizeof(__pyx_k_classImplements), 0, 0, 1, 1}, + {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, + {&__pyx_n_s_close, __pyx_k_close, sizeof(__pyx_k_close), 0, 0, 1, 1}, + {&__pyx_n_s_context, __pyx_k_context, sizeof(__pyx_k_context), 0, 0, 1, 1}, + {&__pyx_n_s_decode, __pyx_k_decode, sizeof(__pyx_k_decode), 0, 0, 1, 1}, + {&__pyx_n_s_default, __pyx_k_default, sizeof(__pyx_k_default), 0, 0, 1, 1}, + {&__pyx_kp_s_default_2, __pyx_k_default_2, sizeof(__pyx_k_default_2), 0, 0, 1, 0}, + {&__pyx_n_s_default_handle_error, __pyx_k_default_handle_error, sizeof(__pyx_k_default_handle_error), 0, 0, 1, 1}, + {&__pyx_n_s_destroyed, __pyx_k_destroyed, sizeof(__pyx_k_destroyed), 0, 0, 1, 1}, + {&__pyx_n_s_embeddable_backends, __pyx_k_embeddable_backends, sizeof(__pyx_k_embeddable_backends), 0, 0, 1, 1}, + {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1}, + {&__pyx_n_s_epoll, __pyx_k_epoll, sizeof(__pyx_k_epoll), 0, 0, 1, 1}, + {&__pyx_n_s_errno, __pyx_k_errno, sizeof(__pyx_k_errno), 0, 0, 1, 1}, + {&__pyx_kp_s_ev_default_loop_s_failed, __pyx_k_ev_default_loop_s_failed, sizeof(__pyx_k_ev_default_loop_s_failed), 0, 0, 1, 0}, + {&__pyx_kp_s_ev_loop_new_s_failed, __pyx_k_ev_loop_new_s_failed, sizeof(__pyx_k_ev_loop_new_s_failed), 0, 0, 1, 0}, + {&__pyx_n_s_events, __pyx_k_events, sizeof(__pyx_k_events), 0, 0, 1, 1}, + {&__pyx_n_s_events_2, __pyx_k_events_2, sizeof(__pyx_k_events_2), 0, 0, 1, 1}, + {&__pyx_n_s_events_str, __pyx_k_events_str, sizeof(__pyx_k_events_str), 0, 0, 1, 1}, + {&__pyx_n_s_fd, __pyx_k_fd, sizeof(__pyx_k_fd), 0, 0, 1, 1}, + {&__pyx_kp_s_fd_must_be_non_negative_r, __pyx_k_fd_must_be_non_negative_r, sizeof(__pyx_k_fd_must_be_non_negative_r), 0, 0, 1, 0}, + {&__pyx_kp_s_fd_s_events_s, __pyx_k_fd_s_events_s, sizeof(__pyx_k_fd_s_events_s), 0, 0, 1, 0}, + {&__pyx_n_s_fileno, __pyx_k_fileno, sizeof(__pyx_k_fileno), 0, 0, 1, 1}, + {&__pyx_kp_s_fileno_2, __pyx_k_fileno_2, sizeof(__pyx_k_fileno_2), 0, 0, 1, 0}, + {&__pyx_n_s_flags, __pyx_k_flags, sizeof(__pyx_k_flags), 0, 0, 1, 1}, + {&__pyx_n_s_flags_2, __pyx_k_flags_2, sizeof(__pyx_k_flags_2), 0, 0, 1, 1}, + {&__pyx_n_s_flags_str2int, __pyx_k_flags_str2int, sizeof(__pyx_k_flags_str2int), 0, 0, 1, 1}, + {&__pyx_n_s_fork, __pyx_k_fork, sizeof(__pyx_k_fork), 0, 0, 1, 1}, + {&__pyx_n_s_forkcheck, __pyx_k_forkcheck, sizeof(__pyx_k_forkcheck), 0, 0, 1, 1}, + {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1}, + {&__pyx_n_s_format_details, __pyx_k_format_details, sizeof(__pyx_k_format_details), 0, 0, 1, 1}, + {&__pyx_n_s_func, __pyx_k_func, sizeof(__pyx_k_func), 0, 0, 1, 1}, + {&__pyx_n_s_genexpr, __pyx_k_genexpr, sizeof(__pyx_k_genexpr), 0, 0, 1, 1}, + {&__pyx_n_s_get_header_version, __pyx_k_get_header_version, sizeof(__pyx_k_get_header_version), 0, 0, 1, 1}, + {&__pyx_n_s_get_version, __pyx_k_get_version, sizeof(__pyx_k_get_version), 0, 0, 1, 1}, + {&__pyx_n_s_getfilesystemencoding, __pyx_k_getfilesystemencoding, sizeof(__pyx_k_getfilesystemencoding), 0, 0, 1, 1}, + {&__pyx_n_s_getswitchinterval, __pyx_k_getswitchinterval, sizeof(__pyx_k_getswitchinterval), 0, 0, 1, 1}, + {&__pyx_n_s_gevent, __pyx_k_gevent, sizeof(__pyx_k_gevent), 0, 0, 1, 1}, + {&__pyx_n_s_gevent__interfaces, __pyx_k_gevent__interfaces, sizeof(__pyx_k_gevent__interfaces), 0, 0, 1, 1}, + {&__pyx_kp_s_gevent_core_EVENTS, __pyx_k_gevent_core_EVENTS, sizeof(__pyx_k_gevent_core_EVENTS), 0, 0, 1, 0}, + {&__pyx_n_s_gevent_libev_corecext, __pyx_k_gevent_libev_corecext, sizeof(__pyx_k_gevent_libev_corecext), 0, 0, 1, 1}, + {&__pyx_n_s_handle_error, __pyx_k_handle_error, sizeof(__pyx_k_handle_error), 0, 0, 1, 1}, + {&__pyx_n_s_handle_syserr, __pyx_k_handle_syserr, sizeof(__pyx_k_handle_syserr), 0, 0, 1, 1}, + {&__pyx_n_s_hex, __pyx_k_hex, sizeof(__pyx_k_hex), 0, 0, 1, 1}, + {&__pyx_n_s_how, __pyx_k_how, sizeof(__pyx_k_how), 0, 0, 1, 1}, + {&__pyx_n_s_id, __pyx_k_id, sizeof(__pyx_k_id), 0, 0, 1, 1}, + {&__pyx_n_s_idle, __pyx_k_idle, sizeof(__pyx_k_idle), 0, 0, 1, 1}, + {&__pyx_kp_s_illegal_event_mask_r, __pyx_k_illegal_event_mask_r, sizeof(__pyx_k_illegal_event_mask_r), 0, 0, 1, 0}, + {&__pyx_kp_s_illegal_signal_number_r, __pyx_k_illegal_signal_number_r, sizeof(__pyx_k_illegal_signal_number_r), 0, 0, 1, 0}, + {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, + {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1}, + {&__pyx_n_s_interval, __pyx_k_interval, sizeof(__pyx_k_interval), 0, 0, 1, 1}, + {&__pyx_n_s_io, __pyx_k_io, sizeof(__pyx_k_io), 0, 0, 1, 1}, + {&__pyx_kp_s_io_watcher_attribute_events_is, __pyx_k_io_watcher_attribute_events_is, sizeof(__pyx_k_io_watcher_attribute_events_is), 0, 0, 1, 0}, + {&__pyx_kp_s_io_watcher_attribute_fd_is_read, __pyx_k_io_watcher_attribute_fd_is_read, sizeof(__pyx_k_io_watcher_attribute_fd_is_read), 0, 0, 1, 0}, + {&__pyx_n_s_join, __pyx_k_join, sizeof(__pyx_k_join), 0, 0, 1, 1}, + {&__pyx_n_s_keys, __pyx_k_keys, sizeof(__pyx_k_keys), 0, 0, 1, 1}, + {&__pyx_n_s_kqueue, __pyx_k_kqueue, sizeof(__pyx_k_kqueue), 0, 0, 1, 1}, + {&__pyx_n_s_level, __pyx_k_level, sizeof(__pyx_k_level), 0, 0, 1, 1}, + {&__pyx_kp_s_libev_d_02d, __pyx_k_libev_d_02d, sizeof(__pyx_k_libev_d_02d), 0, 0, 1, 0}, + {&__pyx_n_s_loop, __pyx_k_loop, sizeof(__pyx_k_loop), 0, 0, 1, 1}, + {&__pyx_n_s_lower, __pyx_k_lower, sizeof(__pyx_k_lower), 0, 0, 1, 1}, + {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, + {&__pyx_n_s_message, __pyx_k_message, sizeof(__pyx_k_message), 0, 0, 1, 1}, + {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, + {&__pyx_n_s_noenv, __pyx_k_noenv, sizeof(__pyx_k_noenv), 0, 0, 1, 1}, + {&__pyx_n_s_noinotify, __pyx_k_noinotify, sizeof(__pyx_k_noinotify), 0, 0, 1, 1}, + {&__pyx_n_s_nosigmask, __pyx_k_nosigmask, sizeof(__pyx_k_nosigmask), 0, 0, 1, 1}, + {&__pyx_n_s_now, __pyx_k_now, sizeof(__pyx_k_now), 0, 0, 1, 1}, + {&__pyx_n_s_nowait, __pyx_k_nowait, sizeof(__pyx_k_nowait), 0, 0, 1, 1}, + {&__pyx_n_s_once, __pyx_k_once, sizeof(__pyx_k_once), 0, 0, 1, 1}, + {&__pyx_kp_s_operation_on_destroyed_loop, __pyx_k_operation_on_destroyed_loop, sizeof(__pyx_k_operation_on_destroyed_loop), 0, 0, 1, 0}, + {&__pyx_n_s_origflags_int, __pyx_k_origflags_int, sizeof(__pyx_k_origflags_int), 0, 0, 1, 1}, + {&__pyx_n_s_os, __pyx_k_os, sizeof(__pyx_k_os), 0, 0, 1, 1}, + {&__pyx_n_s_pass_events, __pyx_k_pass_events, sizeof(__pyx_k_pass_events), 0, 0, 1, 1}, + {&__pyx_n_s_path, __pyx_k_path, sizeof(__pyx_k_path), 0, 0, 1, 1}, + {&__pyx_n_s_pending, __pyx_k_pending, sizeof(__pyx_k_pending), 0, 0, 1, 1}, + {&__pyx_kp_s_pending_2, __pyx_k_pending_2, sizeof(__pyx_k_pending_2), 0, 0, 1, 0}, + {&__pyx_kp_s_pending_s, __pyx_k_pending_s, sizeof(__pyx_k_pending_s), 0, 0, 1, 0}, + {&__pyx_n_s_pendingcnt, __pyx_k_pendingcnt, sizeof(__pyx_k_pendingcnt), 0, 0, 1, 1}, + {&__pyx_n_s_pid, __pyx_k_pid, sizeof(__pyx_k_pid), 0, 0, 1, 1}, + {&__pyx_kp_s_pid_r_rstatus_r, __pyx_k_pid_r_rstatus_r, sizeof(__pyx_k_pid_r_rstatus_r), 0, 0, 1, 0}, + {&__pyx_n_s_platform, __pyx_k_platform, sizeof(__pyx_k_platform), 0, 0, 1, 1}, + {&__pyx_n_s_poll, __pyx_k_poll, sizeof(__pyx_k_poll), 0, 0, 1, 1}, + {&__pyx_n_s_port, __pyx_k_port, sizeof(__pyx_k_port), 0, 0, 1, 1}, + {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1}, + {&__pyx_n_s_print_exc, __pyx_k_print_exc, sizeof(__pyx_k_print_exc), 0, 0, 1, 1}, + {&__pyx_n_s_print_exception, __pyx_k_print_exception, sizeof(__pyx_k_print_exception), 0, 0, 1, 1}, + {&__pyx_n_s_priority, __pyx_k_priority, sizeof(__pyx_k_priority), 0, 0, 1, 1}, + {&__pyx_n_s_ptr, __pyx_k_ptr, sizeof(__pyx_k_ptr), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1}, + {&__pyx_n_s_recommended_backends, __pyx_k_recommended_backends, sizeof(__pyx_k_recommended_backends), 0, 0, 1, 1}, + {&__pyx_n_s_ref, __pyx_k_ref, sizeof(__pyx_k_ref), 0, 0, 1, 1}, + {&__pyx_kp_s_ref_2, __pyx_k_ref_2, sizeof(__pyx_k_ref_2), 0, 0, 1, 0}, + {&__pyx_n_s_repeat, __pyx_k_repeat, sizeof(__pyx_k_repeat), 0, 0, 1, 1}, + {&__pyx_kp_s_repeat_must_be_positive_or_zero, __pyx_k_repeat_must_be_positive_or_zero, sizeof(__pyx_k_repeat_must_be_positive_or_zero), 0, 0, 1, 0}, + {&__pyx_n_s_revents, __pyx_k_revents, sizeof(__pyx_k_revents), 0, 0, 1, 1}, + {&__pyx_n_s_rstatus, __pyx_k_rstatus, sizeof(__pyx_k_rstatus), 0, 0, 1, 1}, + {&__pyx_kp_s_s_at_0x_x_s, __pyx_k_s_at_0x_x_s, sizeof(__pyx_k_s_at_0x_x_s), 0, 0, 1, 0}, + {&__pyx_kp_s_s_at_0x_x_s_2, __pyx_k_s_at_0x_x_s_2, sizeof(__pyx_k_s_at_0x_x_s_2), 0, 0, 1, 0}, + {&__pyx_n_s_select, __pyx_k_select, sizeof(__pyx_k_select), 0, 0, 1, 1}, + {&__pyx_n_s_send, __pyx_k_send, sizeof(__pyx_k_send), 0, 0, 1, 1}, + {&__pyx_n_s_sigfd, __pyx_k_sigfd, sizeof(__pyx_k_sigfd), 0, 0, 1, 1}, + {&__pyx_n_s_signal, __pyx_k_signal, sizeof(__pyx_k_signal), 0, 0, 1, 1}, + {&__pyx_n_s_signalfd, __pyx_k_signalfd, sizeof(__pyx_k_signalfd), 0, 0, 1, 1}, + {&__pyx_n_s_signalmodule, __pyx_k_signalmodule, sizeof(__pyx_k_signalmodule), 0, 0, 1, 1}, + {&__pyx_n_s_signalnum, __pyx_k_signalnum, sizeof(__pyx_k_signalnum), 0, 0, 1, 1}, + {&__pyx_n_s_signum, __pyx_k_signum, sizeof(__pyx_k_signum), 0, 0, 1, 1}, + {&__pyx_n_s_split, __pyx_k_split, sizeof(__pyx_k_split), 0, 0, 1, 1}, + {&__pyx_kp_s_src_gevent_libev_corecext_pyx, __pyx_k_src_gevent_libev_corecext_pyx, sizeof(__pyx_k_src_gevent_libev_corecext_pyx), 0, 0, 1, 0}, + {&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1}, + {&__pyx_n_s_stat, __pyx_k_stat, sizeof(__pyx_k_stat), 0, 0, 1, 1}, + {&__pyx_n_s_stop, __pyx_k_stop, sizeof(__pyx_k_stop), 0, 0, 1, 1}, + {&__pyx_kp_s_stopped, __pyx_k_stopped, sizeof(__pyx_k_stopped), 0, 0, 1, 0}, + {&__pyx_n_s_strerror, __pyx_k_strerror, sizeof(__pyx_k_strerror), 0, 0, 1, 1}, + {&__pyx_n_s_strip, __pyx_k_strip, sizeof(__pyx_k_strip), 0, 0, 1, 1}, + {&__pyx_n_s_supported_backends, __pyx_k_supported_backends, sizeof(__pyx_k_supported_backends), 0, 0, 1, 1}, + {&__pyx_n_s_sys, __pyx_k_sys, sizeof(__pyx_k_sys), 0, 0, 1, 1}, + {&__pyx_n_s_t, __pyx_k_t, sizeof(__pyx_k_t), 0, 0, 1, 1}, + {&__pyx_n_s_tb, __pyx_k_tb, sizeof(__pyx_k_tb), 0, 0, 1, 1}, + {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, + {&__pyx_n_s_throw, __pyx_k_throw, sizeof(__pyx_k_throw), 0, 0, 1, 1}, + {&__pyx_n_s_time, __pyx_k_time, sizeof(__pyx_k_time), 0, 0, 1, 1}, + {&__pyx_n_s_timer, __pyx_k_timer, sizeof(__pyx_k_timer), 0, 0, 1, 1}, + {&__pyx_n_s_trace, __pyx_k_trace, sizeof(__pyx_k_trace), 0, 0, 1, 1}, + {&__pyx_n_s_traceback, __pyx_k_traceback, sizeof(__pyx_k_traceback), 0, 0, 1, 1}, + {&__pyx_n_s_type, __pyx_k_type, sizeof(__pyx_k_type), 0, 0, 1, 1}, + {&__pyx_n_s_update, __pyx_k_update, sizeof(__pyx_k_update), 0, 0, 1, 1}, + {&__pyx_n_s_update_now, __pyx_k_update_now, sizeof(__pyx_k_update_now), 0, 0, 1, 1}, + {&__pyx_n_s_v, __pyx_k_v, sizeof(__pyx_k_v), 0, 0, 1, 1}, + {&__pyx_n_s_value, __pyx_k_value, sizeof(__pyx_k_value), 0, 0, 1, 1}, + {&__pyx_n_s_version_info, __pyx_k_version_info, sizeof(__pyx_k_version_info), 0, 0, 1, 1}, + {&__pyx_n_s_watcher, __pyx_k_watcher, sizeof(__pyx_k_watcher), 0, 0, 1, 1}, + {&__pyx_n_s_win32, __pyx_k_win32, sizeof(__pyx_k_win32), 0, 0, 1, 1}, + {&__pyx_n_s_zope_interface, __pyx_k_zope_interface, sizeof(__pyx_k_zope_interface), 0, 0, 1, 1}, + {0, 0, 0, 0, 0, 0, 0} +}; +static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { + __pyx_builtin___import__ = __Pyx_GetBuiltinName(__pyx_n_s_import); if (!__pyx_builtin___import__) __PYX_ERR(0, 39, __pyx_L1_error) + __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(0, 753, __pyx_L1_error) + __pyx_builtin_KeyError = __Pyx_GetBuiltinName(__pyx_n_s_KeyError); if (!__pyx_builtin_KeyError) __PYX_ERR(0, 203, __pyx_L1_error) + __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 204, __pyx_L1_error) + __pyx_builtin_hex = __Pyx_GetBuiltinName(__pyx_n_s_hex); if (!__pyx_builtin_hex) __PYX_ERR(0, 210, __pyx_L1_error) + __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(0, 296, __pyx_L1_error) + __pyx_builtin_SystemError = __Pyx_GetBuiltinName(__pyx_n_s_SystemError); if (!__pyx_builtin_SystemError) __PYX_ERR(0, 425, __pyx_L1_error) + __pyx_builtin_AttributeError = __Pyx_GetBuiltinName(__pyx_n_s_AttributeError); if (!__pyx_builtin_AttributeError) __PYX_ERR(0, 668, __pyx_L1_error) + __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(0, 819, __pyx_L1_error) + return 0; + __pyx_L1_error:; + return -1; +} + +static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); + + __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 258, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__4); + __Pyx_GIVEREF(__pyx_tuple__4); + + __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_Child_watchers_are_not_supported); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 668, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__10); + __Pyx_GIVEREF(__pyx_tuple__10); + + __pyx_tuple__11 = PyTuple_Pack(1, __pyx_n_s_sigfd); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 749, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__11); + __Pyx_GIVEREF(__pyx_tuple__11); + + __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_s_Cannot_construct_a_bare_watcher); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 874, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__12); + __Pyx_GIVEREF(__pyx_tuple__12); + + __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_s_Cannot_set_priority_of_an_active); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 923, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__13); + __Pyx_GIVEREF(__pyx_tuple__13); + + __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_s_io_watcher_attribute_fd_is_read); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(0, 1021, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__14); + __Pyx_GIVEREF(__pyx_tuple__14); + + __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_io_watcher_attribute_events_is); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(0, 1033, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__15); + __Pyx_GIVEREF(__pyx_tuple__15); + + __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s_child_watchers_are_only_availabl); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(0, 1190, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__16); + __Pyx_GIVEREF(__pyx_tuple__16); + + __pyx_tuple__17 = PyTuple_Pack(1, __pyx_n_s_sys); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(0, 39, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__17); + __Pyx_GIVEREF(__pyx_tuple__17); + + __pyx_tuple__18 = PyTuple_Pack(1, __pyx_n_s_os); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(0, 40, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__18); + __Pyx_GIVEREF(__pyx_tuple__18); + + __pyx_tuple__19 = PyTuple_Pack(1, __pyx_n_s_traceback); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(0, 41, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__19); + __Pyx_GIVEREF(__pyx_tuple__19); + + __pyx_tuple__20 = PyTuple_Pack(1, __pyx_n_s_signal); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(0, 42, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__20); + __Pyx_GIVEREF(__pyx_tuple__20); + + __pyx_tuple__21 = PyTuple_Pack(1, __pyx_n_s_gevent); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(0, 43, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__21); + __Pyx_GIVEREF(__pyx_tuple__21); + + __pyx_codeobj__22 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_libev_corecext_pyx, __pyx_n_s_get_version, 128, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__22)) __PYX_ERR(0, 128, __pyx_L1_error) + + __pyx_codeobj__23 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_libev_corecext_pyx, __pyx_n_s_get_header_version, 132, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__23)) __PYX_ERR(0, 132, __pyx_L1_error) + + __pyx_codeobj__24 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_libev_corecext_pyx, __pyx_n_s_supported_backends, 241, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__24)) __PYX_ERR(0, 241, __pyx_L1_error) + + __pyx_codeobj__25 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_libev_corecext_pyx, __pyx_n_s_recommended_backends, 245, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__25)) __PYX_ERR(0, 245, __pyx_L1_error) + + __pyx_codeobj__26 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_libev_corecext_pyx, __pyx_n_s_embeddable_backends, 249, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__26)) __PYX_ERR(0, 249, __pyx_L1_error) + + __pyx_codeobj__27 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_libev_corecext_pyx, __pyx_n_s_time, 253, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__27)) __PYX_ERR(0, 253, __pyx_L1_error) + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} + +static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { + if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) __PYX_ERR(0, 1, __pyx_L1_error) + return 0; + __pyx_L1_error:; + return -1; +} + +static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/ + +static int __Pyx_modinit_global_init_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); + /*--- Global init code ---*/ + __pyx_v_6gevent_5libev_8corecext_integer_types = ((PyObject*)Py_None); Py_INCREF(Py_None); + GEVENT_CORE_EVENTS = Py_None; Py_INCREF(Py_None); + _empty_tuple = ((PyObject*)Py_None); Py_INCREF(Py_None); + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_variable_export_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); + /*--- Variable export code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_function_export_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); + /*--- Function export code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_type_init_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); + /*--- Type init code ---*/ + if (PyType_Ready(&__pyx_type_6gevent_5libev_8corecext__EVENTSType) < 0) __PYX_ERR(0, 118, __pyx_L1_error) + __pyx_type_6gevent_5libev_8corecext__EVENTSType.tp_print = 0; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6gevent_5libev_8corecext__EVENTSType.tp_dictoffset && __pyx_type_6gevent_5libev_8corecext__EVENTSType.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_type_6gevent_5libev_8corecext__EVENTSType.tp_getattro = __Pyx_PyObject_GenericGetAttr; + } + __pyx_ptype_6gevent_5libev_8corecext__EVENTSType = &__pyx_type_6gevent_5libev_8corecext__EVENTSType; + if (PyType_Ready(&PyGeventCallback_Type) < 0) __PYX_ERR(0, 263, __pyx_L1_error) + PyGeventCallback_Type.tp_print = 0; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!PyGeventCallback_Type.tp_dictoffset && PyGeventCallback_Type.tp_getattro == PyObject_GenericGetAttr)) { + PyGeventCallback_Type.tp_getattro = __Pyx_PyObject_GenericGetAttr; + } + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_callback, (PyObject *)&PyGeventCallback_Type) < 0) __PYX_ERR(0, 263, __pyx_L1_error) + __pyx_ptype_6gevent_5libev_8corecext_callback = &PyGeventCallback_Type; + __pyx_vtabptr_6gevent_5libev_8corecext_CallbackFIFO = &__pyx_vtable_6gevent_5libev_8corecext_CallbackFIFO; + __pyx_vtable_6gevent_5libev_8corecext_CallbackFIFO.popleft = (struct PyGeventCallbackObject *(*)(struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *))__pyx_f_6gevent_5libev_8corecext_12CallbackFIFO_popleft; + __pyx_vtable_6gevent_5libev_8corecext_CallbackFIFO.append = (PyObject *(*)(struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *, struct PyGeventCallbackObject *))__pyx_f_6gevent_5libev_8corecext_12CallbackFIFO_append; + __pyx_vtable_6gevent_5libev_8corecext_CallbackFIFO.has_callbacks = (int (*)(struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *))__pyx_f_6gevent_5libev_8corecext_12CallbackFIFO_has_callbacks; + if (PyType_Ready(&__pyx_type_6gevent_5libev_8corecext_CallbackFIFO) < 0) __PYX_ERR(0, 316, __pyx_L1_error) + __pyx_type_6gevent_5libev_8corecext_CallbackFIFO.tp_print = 0; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6gevent_5libev_8corecext_CallbackFIFO.tp_dictoffset && __pyx_type_6gevent_5libev_8corecext_CallbackFIFO.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_type_6gevent_5libev_8corecext_CallbackFIFO.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + } + if (__Pyx_SetVtable(__pyx_type_6gevent_5libev_8corecext_CallbackFIFO.tp_dict, __pyx_vtabptr_6gevent_5libev_8corecext_CallbackFIFO) < 0) __PYX_ERR(0, 316, __pyx_L1_error) + __pyx_ptype_6gevent_5libev_8corecext_CallbackFIFO = &__pyx_type_6gevent_5libev_8corecext_CallbackFIFO; + __pyx_vtabptr_6gevent_5libev_8corecext_loop = &__pyx_vtable_6gevent_5libev_8corecext_loop; + __pyx_vtable_6gevent_5libev_8corecext_loop._run_callbacks = (PyObject *(*)(struct PyGeventLoopObject *))__pyx_f_6gevent_5libev_8corecext_4loop__run_callbacks; + __pyx_vtable_6gevent_5libev_8corecext_loop._stop_watchers = (PyObject *(*)(struct PyGeventLoopObject *, struct ev_loop *))__pyx_f_6gevent_5libev_8corecext_4loop__stop_watchers; + __pyx_vtable_6gevent_5libev_8corecext_loop.handle_error = (PyObject *(*)(struct PyGeventLoopObject *, PyObject *, PyObject *, PyObject *, PyObject *, int __pyx_skip_dispatch))__pyx_f_6gevent_5libev_8corecext_4loop_handle_error; + __pyx_vtable_6gevent_5libev_8corecext_loop._default_handle_error = (PyObject *(*)(struct PyGeventLoopObject *, PyObject *, PyObject *, PyObject *, PyObject *, int __pyx_skip_dispatch))__pyx_f_6gevent_5libev_8corecext_4loop__default_handle_error; + __pyx_vtable_6gevent_5libev_8corecext_loop.now = (ev_tstamp (*)(struct PyGeventLoopObject *, int __pyx_skip_dispatch))__pyx_f_6gevent_5libev_8corecext_4loop_now; + __pyx_vtable_6gevent_5libev_8corecext_loop.update_now = (void (*)(struct PyGeventLoopObject *, int __pyx_skip_dispatch))__pyx_f_6gevent_5libev_8corecext_4loop_update_now; + if (PyType_Ready(&PyGeventLoop_Type) < 0) __PYX_ERR(0, 375, __pyx_L1_error) + PyGeventLoop_Type.tp_print = 0; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!PyGeventLoop_Type.tp_dictoffset && PyGeventLoop_Type.tp_getattro == PyObject_GenericGetAttr)) { + PyGeventLoop_Type.tp_getattro = __Pyx_PyObject_GenericGetAttr; + } + if (__Pyx_SetVtable(PyGeventLoop_Type.tp_dict, __pyx_vtabptr_6gevent_5libev_8corecext_loop) < 0) __PYX_ERR(0, 375, __pyx_L1_error) + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_loop, (PyObject *)&PyGeventLoop_Type) < 0) __PYX_ERR(0, 375, __pyx_L1_error) + __pyx_ptype_6gevent_5libev_8corecext_loop = &PyGeventLoop_Type; + if (PyType_Ready(&PyGeventWatcher_Type) < 0) __PYX_ERR(0, 827, __pyx_L1_error) + PyGeventWatcher_Type.tp_print = 0; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!PyGeventWatcher_Type.tp_dictoffset && PyGeventWatcher_Type.tp_getattro == PyObject_GenericGetAttr)) { + PyGeventWatcher_Type.tp_getattro = __Pyx_PyObject_GenericGetAttr; + } + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_watcher, (PyObject *)&PyGeventWatcher_Type) < 0) __PYX_ERR(0, 827, __pyx_L1_error) + __pyx_ptype_6gevent_5libev_8corecext_watcher = &PyGeventWatcher_Type; + PyGeventIO_Type.tp_base = __pyx_ptype_6gevent_5libev_8corecext_watcher; + if (PyType_Ready(&PyGeventIO_Type) < 0) __PYX_ERR(0, 988, __pyx_L1_error) + PyGeventIO_Type.tp_print = 0; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!PyGeventIO_Type.tp_dictoffset && PyGeventIO_Type.tp_getattro == PyObject_GenericGetAttr)) { + PyGeventIO_Type.tp_getattro = __Pyx_PyObject_GenericGetAttr; + } + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_io, (PyObject *)&PyGeventIO_Type) < 0) __PYX_ERR(0, 988, __pyx_L1_error) + __pyx_ptype_6gevent_5libev_8corecext_io = &PyGeventIO_Type; + PyGeventTimer_Type.tp_base = __pyx_ptype_6gevent_5libev_8corecext_watcher; + if (PyType_Ready(&PyGeventTimer_Type) < 0) __PYX_ERR(0, 1045, __pyx_L1_error) + PyGeventTimer_Type.tp_print = 0; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!PyGeventTimer_Type.tp_dictoffset && PyGeventTimer_Type.tp_getattro == PyObject_GenericGetAttr)) { + PyGeventTimer_Type.tp_getattro = __Pyx_PyObject_GenericGetAttr; + } + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_timer, (PyObject *)&PyGeventTimer_Type) < 0) __PYX_ERR(0, 1045, __pyx_L1_error) + __pyx_ptype_6gevent_5libev_8corecext_timer = &PyGeventTimer_Type; + PyGeventSignal_Type.tp_base = __pyx_ptype_6gevent_5libev_8corecext_watcher; + if (PyType_Ready(&PyGeventSignal_Type) < 0) __PYX_ERR(0, 1085, __pyx_L1_error) + PyGeventSignal_Type.tp_print = 0; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!PyGeventSignal_Type.tp_dictoffset && PyGeventSignal_Type.tp_getattro == PyObject_GenericGetAttr)) { + PyGeventSignal_Type.tp_getattro = __Pyx_PyObject_GenericGetAttr; + } + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_signal, (PyObject *)&PyGeventSignal_Type) < 0) __PYX_ERR(0, 1085, __pyx_L1_error) + __pyx_ptype_6gevent_5libev_8corecext_signal = &PyGeventSignal_Type; + PyGeventIdle_Type.tp_base = __pyx_ptype_6gevent_5libev_8corecext_watcher; + if (PyType_Ready(&PyGeventIdle_Type) < 0) __PYX_ERR(0, 1108, __pyx_L1_error) + PyGeventIdle_Type.tp_print = 0; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!PyGeventIdle_Type.tp_dictoffset && PyGeventIdle_Type.tp_getattro == PyObject_GenericGetAttr)) { + PyGeventIdle_Type.tp_getattro = __Pyx_PyObject_GenericGetAttr; + } + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_idle, (PyObject *)&PyGeventIdle_Type) < 0) __PYX_ERR(0, 1108, __pyx_L1_error) + __pyx_ptype_6gevent_5libev_8corecext_idle = &PyGeventIdle_Type; + PyGeventPrepare_Type.tp_base = __pyx_ptype_6gevent_5libev_8corecext_watcher; + if (PyType_Ready(&PyGeventPrepare_Type) < 0) __PYX_ERR(0, 1121, __pyx_L1_error) + PyGeventPrepare_Type.tp_print = 0; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!PyGeventPrepare_Type.tp_dictoffset && PyGeventPrepare_Type.tp_getattro == PyObject_GenericGetAttr)) { + PyGeventPrepare_Type.tp_getattro = __Pyx_PyObject_GenericGetAttr; + } + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_prepare, (PyObject *)&PyGeventPrepare_Type) < 0) __PYX_ERR(0, 1121, __pyx_L1_error) + __pyx_ptype_6gevent_5libev_8corecext_prepare = &PyGeventPrepare_Type; + PyGeventCheck_Type.tp_base = __pyx_ptype_6gevent_5libev_8corecext_watcher; + if (PyType_Ready(&PyGeventCheck_Type) < 0) __PYX_ERR(0, 1134, __pyx_L1_error) + PyGeventCheck_Type.tp_print = 0; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!PyGeventCheck_Type.tp_dictoffset && PyGeventCheck_Type.tp_getattro == PyObject_GenericGetAttr)) { + PyGeventCheck_Type.tp_getattro = __Pyx_PyObject_GenericGetAttr; + } + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_check, (PyObject *)&PyGeventCheck_Type) < 0) __PYX_ERR(0, 1134, __pyx_L1_error) + __pyx_ptype_6gevent_5libev_8corecext_check = &PyGeventCheck_Type; + PyGeventFork_Type.tp_base = __pyx_ptype_6gevent_5libev_8corecext_watcher; + if (PyType_Ready(&PyGeventFork_Type) < 0) __PYX_ERR(0, 1147, __pyx_L1_error) + PyGeventFork_Type.tp_print = 0; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!PyGeventFork_Type.tp_dictoffset && PyGeventFork_Type.tp_getattro == PyObject_GenericGetAttr)) { + PyGeventFork_Type.tp_getattro = __Pyx_PyObject_GenericGetAttr; + } + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_fork, (PyObject *)&PyGeventFork_Type) < 0) __PYX_ERR(0, 1147, __pyx_L1_error) + __pyx_ptype_6gevent_5libev_8corecext_fork = &PyGeventFork_Type; + PyGeventAsync_Type.tp_base = __pyx_ptype_6gevent_5libev_8corecext_watcher; + if (PyType_Ready(&PyGeventAsync_Type) < 0) __PYX_ERR(0, 1159, __pyx_L1_error) + PyGeventAsync_Type.tp_print = 0; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!PyGeventAsync_Type.tp_dictoffset && PyGeventAsync_Type.tp_getattro == PyObject_GenericGetAttr)) { + PyGeventAsync_Type.tp_getattro = __Pyx_PyObject_GenericGetAttr; + } + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_async, (PyObject *)&PyGeventAsync_Type) < 0) __PYX_ERR(0, 1159, __pyx_L1_error) + __pyx_ptype_6gevent_5libev_8corecext_async_ = &PyGeventAsync_Type; + PyGeventChild_Type.tp_base = __pyx_ptype_6gevent_5libev_8corecext_watcher; + if (PyType_Ready(&PyGeventChild_Type) < 0) __PYX_ERR(0, 1182, __pyx_L1_error) + PyGeventChild_Type.tp_print = 0; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!PyGeventChild_Type.tp_dictoffset && PyGeventChild_Type.tp_getattro == PyObject_GenericGetAttr)) { + PyGeventChild_Type.tp_getattro = __Pyx_PyObject_GenericGetAttr; + } + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_child, (PyObject *)&PyGeventChild_Type) < 0) __PYX_ERR(0, 1182, __pyx_L1_error) + __pyx_ptype_6gevent_5libev_8corecext_child = &PyGeventChild_Type; + PyGeventStat_Type.tp_base = __pyx_ptype_6gevent_5libev_8corecext_watcher; + if (PyType_Ready(&PyGeventStat_Type) < 0) __PYX_ERR(0, 1225, __pyx_L1_error) + PyGeventStat_Type.tp_print = 0; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!PyGeventStat_Type.tp_dictoffset && PyGeventStat_Type.tp_getattro == PyObject_GenericGetAttr)) { + PyGeventStat_Type.tp_getattro = __Pyx_PyObject_GenericGetAttr; + } + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_stat, (PyObject *)&PyGeventStat_Type) < 0) __PYX_ERR(0, 1225, __pyx_L1_error) + __pyx_ptype_6gevent_5libev_8corecext_stat = &PyGeventStat_Type; + if (PyType_Ready(&__pyx_type_6gevent_5libev_8corecext___pyx_scope_struct__genexpr) < 0) __PYX_ERR(0, 149, __pyx_L1_error) + __pyx_type_6gevent_5libev_8corecext___pyx_scope_struct__genexpr.tp_print = 0; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6gevent_5libev_8corecext___pyx_scope_struct__genexpr.tp_dictoffset && __pyx_type_6gevent_5libev_8corecext___pyx_scope_struct__genexpr.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_type_6gevent_5libev_8corecext___pyx_scope_struct__genexpr.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + } + __pyx_ptype_6gevent_5libev_8corecext___pyx_scope_struct__genexpr = &__pyx_type_6gevent_5libev_8corecext___pyx_scope_struct__genexpr; + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_modinit_type_import_code(void) { + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); + /*--- Type import code ---*/ + __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 9, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type", + #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000 + sizeof(PyTypeObject), + #else + sizeof(PyHeapTypeObject), + #endif + __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(1, 9, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 8, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_ptype_7cpython_4bool_bool = __Pyx_ImportType(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "bool", sizeof(PyBoolObject), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_7cpython_4bool_bool) __PYX_ERR(2, 8, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 15, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_ptype_7cpython_7complex_complex = __Pyx_ImportType(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "complex", sizeof(PyComplexObject), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_7cpython_7complex_complex) __PYX_ERR(3, 15, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_modinit_variable_import_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); + /*--- Variable import code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_function_import_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); + /*--- Function import code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + + +#if PY_MAJOR_VERSION < 3 +#ifdef CYTHON_NO_PYINIT_EXPORT +#define __Pyx_PyMODINIT_FUNC void +#else +#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC +#endif +#else +#ifdef CYTHON_NO_PYINIT_EXPORT +#define __Pyx_PyMODINIT_FUNC PyObject * +#else +#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC +#endif +#endif + + +#if PY_MAJOR_VERSION < 3 +__Pyx_PyMODINIT_FUNC initcorecext(void) CYTHON_SMALL_CODE; /*proto*/ +__Pyx_PyMODINIT_FUNC initcorecext(void) +#else +__Pyx_PyMODINIT_FUNC PyInit_corecext(void) CYTHON_SMALL_CODE; /*proto*/ +__Pyx_PyMODINIT_FUNC PyInit_corecext(void) +#if CYTHON_PEP489_MULTI_PHASE_INIT +{ + return PyModuleDef_Init(&__pyx_moduledef); +} +static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { + #if PY_VERSION_HEX >= 0x030700A1 + static PY_INT64_T main_interpreter_id = -1; + PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); + if (main_interpreter_id == -1) { + main_interpreter_id = current_id; + return (unlikely(current_id == -1)) ? -1 : 0; + } else if (unlikely(main_interpreter_id != current_id)) + #else + static PyInterpreterState *main_interpreter = NULL; + PyInterpreterState *current_interpreter = PyThreadState_Get()->interp; + if (!main_interpreter) { + main_interpreter = current_interpreter; + } else if (unlikely(main_interpreter != current_interpreter)) + #endif + { + PyErr_SetString( + PyExc_ImportError, + "Interpreter change detected - this module can only be loaded into one interpreter per process."); + return -1; + } + return 0; +} +static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) { + PyObject *value = PyObject_GetAttrString(spec, from_name); + int result = 0; + if (likely(value)) { + if (allow_none || value != Py_None) { + result = PyDict_SetItemString(moddict, to_name, value); + } + Py_DECREF(value); + } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_Clear(); + } else { + result = -1; + } + return result; +} +static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) { + PyObject *module = NULL, *moddict, *modname; + if (__Pyx_check_single_interpreter()) + return NULL; + if (__pyx_m) + return __Pyx_NewRef(__pyx_m); + modname = PyObject_GetAttrString(spec, "name"); + if (unlikely(!modname)) goto bad; + module = PyModule_NewObject(modname); + Py_DECREF(modname); + if (unlikely(!module)) goto bad; + moddict = PyModule_GetDict(module); + if (unlikely(!moddict)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad; + return module; +bad: + Py_XDECREF(module); + return NULL; +} + + +static CYTHON_SMALL_CODE int __pyx_pymod_exec_corecext(PyObject *__pyx_pyinit_module) +#endif +#endif +{ + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + PyObject *__pyx_t_14 = NULL; + PyObject *__pyx_t_15 = NULL; + PyObject *__pyx_t_16 = NULL; + PyObject *__pyx_t_17 = NULL; + PyObject *__pyx_t_18 = NULL; + PyObject *__pyx_t_19 = NULL; + PyObject *__pyx_t_20 = NULL; + PyObject *__pyx_t_21 = NULL; + int __pyx_t_22; + __Pyx_RefNannyDeclarations + #if CYTHON_PEP489_MULTI_PHASE_INIT + if (__pyx_m) { + if (__pyx_m == __pyx_pyinit_module) return 0; + PyErr_SetString(PyExc_RuntimeError, "Module 'corecext' has already been imported. Re-initialisation is not supported."); + return -1; + } + #elif PY_MAJOR_VERSION >= 3 + if (__pyx_m) return __Pyx_NewRef(__pyx_m); + #endif + #if CYTHON_REFNANNY +__Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); +if (!__Pyx_RefNanny) { + PyErr_Clear(); + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); + if (!__Pyx_RefNanny) + Py_FatalError("failed to import 'refnanny' module"); +} +#endif + __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_corecext(void)", 0); + if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #ifdef __Pxy_PyFrame_Initialize_Offsets + __Pxy_PyFrame_Initialize_Offsets(); + #endif + __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) + #ifdef __Pyx_CyFunction_USED + if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_FusedFunction_USED + if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_Coroutine_USED + if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_Generator_USED + if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_AsyncGen_USED + if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_StopAsyncIteration_USED + if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + /*--- Library function declarations ---*/ + /*--- Threads initialization code ---*/ + #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS + #ifdef WITH_THREAD /* Python build with threading support? */ + PyEval_InitThreads(); + #endif + #endif + /*--- Module creation code ---*/ + #if CYTHON_PEP489_MULTI_PHASE_INIT + __pyx_m = __pyx_pyinit_module; + Py_INCREF(__pyx_m); + #else + #if PY_MAJOR_VERSION < 3 + __pyx_m = Py_InitModule4("corecext", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); + #else + __pyx_m = PyModule_Create(&__pyx_moduledef); + #endif + if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) + Py_INCREF(__pyx_d); + __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) + #if CYTHON_COMPILING_IN_PYPY + Py_INCREF(__pyx_b); + #endif + if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + /*--- Initialize various global constants etc. ---*/ + if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) + if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + if (__pyx_module_is_main_gevent__libev__corecext) { + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + } + #if PY_MAJOR_VERSION >= 3 + { + PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) + if (!PyDict_GetItemString(modules, "gevent.libev.corecext")) { + if (unlikely(PyDict_SetItemString(modules, "gevent.libev.corecext", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error) + } + } + #endif + /*--- Builtin init code ---*/ + if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + /*--- Constants init code ---*/ + if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + /*--- Global type/function init code ---*/ + (void)__Pyx_modinit_global_init_code(); + (void)__Pyx_modinit_variable_export_code(); + (void)__Pyx_modinit_function_export_code(); + if (unlikely(__Pyx_modinit_type_init_code() != 0)) goto __pyx_L1_error; + if (unlikely(__Pyx_modinit_type_import_code() != 0)) goto __pyx_L1_error; + (void)__Pyx_modinit_variable_import_code(); + (void)__Pyx_modinit_function_import_code(); + /*--- Execution code ---*/ + #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) + if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + + __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 39, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_level, __pyx_int_0) < 0) __PYX_ERR(0, 39, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin___import__, __pyx_tuple__17, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 39, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_sys, __pyx_t_2) < 0) __PYX_ERR(0, 39, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 40, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_level, __pyx_int_0) < 0) __PYX_ERR(0, 40, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin___import__, __pyx_tuple__18, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 40, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_os, __pyx_t_1) < 0) __PYX_ERR(0, 40, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 41, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_level, __pyx_int_0) < 0) __PYX_ERR(0, 41, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin___import__, __pyx_tuple__19, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 41, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_traceback, __pyx_t_2) < 0) __PYX_ERR(0, 41, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 42, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_level, __pyx_int_0) < 0) __PYX_ERR(0, 42, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin___import__, __pyx_tuple__20, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 42, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_signalmodule, __pyx_t_1) < 0) __PYX_ERR(0, 42, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 43, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_level, __pyx_int_0) < 0) __PYX_ERR(0, 43, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin___import__, __pyx_tuple__21, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 43, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_getswitchinterval); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 43, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_getswitchinterval, __pyx_t_1) < 0) __PYX_ERR(0, 43, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + __pyx_t_1 = PyList_New(7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 46, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_get_version); + __Pyx_GIVEREF(__pyx_n_s_get_version); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_get_version); + __Pyx_INCREF(__pyx_n_s_get_header_version); + __Pyx_GIVEREF(__pyx_n_s_get_header_version); + PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_get_header_version); + __Pyx_INCREF(__pyx_n_s_supported_backends); + __Pyx_GIVEREF(__pyx_n_s_supported_backends); + PyList_SET_ITEM(__pyx_t_1, 2, __pyx_n_s_supported_backends); + __Pyx_INCREF(__pyx_n_s_recommended_backends); + __Pyx_GIVEREF(__pyx_n_s_recommended_backends); + PyList_SET_ITEM(__pyx_t_1, 3, __pyx_n_s_recommended_backends); + __Pyx_INCREF(__pyx_n_s_embeddable_backends); + __Pyx_GIVEREF(__pyx_n_s_embeddable_backends); + PyList_SET_ITEM(__pyx_t_1, 4, __pyx_n_s_embeddable_backends); + __Pyx_INCREF(__pyx_n_s_time); + __Pyx_GIVEREF(__pyx_n_s_time); + PyList_SET_ITEM(__pyx_t_1, 5, __pyx_n_s_time); + __Pyx_INCREF(__pyx_n_s_loop); + __Pyx_GIVEREF(__pyx_n_s_loop); + PyList_SET_ITEM(__pyx_t_1, 6, __pyx_n_s_loop); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_all, __pyx_t_1) < 0) __PYX_ERR(0, 46, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_sys); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 56, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_version_info); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 56, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 56, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_int_3, Py_GE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 56, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 56, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_3) { + + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 57, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)(&PyInt_Type))); + __Pyx_GIVEREF(((PyObject *)(&PyInt_Type))); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)(&PyInt_Type))); + __Pyx_XGOTREF(__pyx_v_6gevent_5libev_8corecext_integer_types); + __Pyx_DECREF_SET(__pyx_v_6gevent_5libev_8corecext_integer_types, ((PyObject*)__pyx_t_2)); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + + goto __pyx_L2; + } + + /*else*/ { + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 59, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)(&PyInt_Type))); + __Pyx_GIVEREF(((PyObject *)(&PyInt_Type))); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)(&PyInt_Type))); + __Pyx_INCREF(((PyObject *)(&PyLong_Type))); + __Pyx_GIVEREF(((PyObject *)(&PyLong_Type))); + PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)(&PyLong_Type))); + __Pyx_XGOTREF(__pyx_v_6gevent_5libev_8corecext_integer_types); + __Pyx_DECREF_SET(__pyx_v_6gevent_5libev_8corecext_integer_types, ((PyObject*)__pyx_t_2)); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + } + __pyx_L2:; + + __pyx_t_2 = __Pyx_PyInt_From_int(EV_UNDEF); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 82, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_UNDEF, __pyx_t_2) < 0) __PYX_ERR(0, 82, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + __pyx_t_2 = __Pyx_PyInt_From_int(EV_NONE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 83, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_NONE, __pyx_t_2) < 0) __PYX_ERR(0, 83, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + __pyx_t_2 = __Pyx_PyInt_From_int(EV_READ); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 84, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_READ, __pyx_t_2) < 0) __PYX_ERR(0, 84, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + __pyx_t_2 = __Pyx_PyInt_From_int(EV_WRITE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 85, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_WRITE, __pyx_t_2) < 0) __PYX_ERR(0, 85, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + __pyx_t_2 = __Pyx_PyInt_From_int(EV_TIMER); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 86, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_TIMER, __pyx_t_2) < 0) __PYX_ERR(0, 86, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + __pyx_t_2 = __Pyx_PyInt_From_int(EV_PERIODIC); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 87, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_PERIODIC, __pyx_t_2) < 0) __PYX_ERR(0, 87, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + __pyx_t_2 = __Pyx_PyInt_From_int(EV_SIGNAL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 88, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_SIGNAL, __pyx_t_2) < 0) __PYX_ERR(0, 88, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + __pyx_t_2 = __Pyx_PyInt_From_int(EV_CHILD); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 89, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_CHILD, __pyx_t_2) < 0) __PYX_ERR(0, 89, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + __pyx_t_2 = __Pyx_PyInt_From_int(EV_STAT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 90, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_STAT, __pyx_t_2) < 0) __PYX_ERR(0, 90, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + __pyx_t_2 = __Pyx_PyInt_From_int(EV_IDLE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 91, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_IDLE, __pyx_t_2) < 0) __PYX_ERR(0, 91, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + __pyx_t_2 = __Pyx_PyInt_From_int(EV_PREPARE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 92, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_PREPARE, __pyx_t_2) < 0) __PYX_ERR(0, 92, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + __pyx_t_2 = __Pyx_PyInt_From_int(EV_CHECK); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 93, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_CHECK, __pyx_t_2) < 0) __PYX_ERR(0, 93, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + __pyx_t_2 = __Pyx_PyInt_From_int(EV_EMBED); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 94, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_EMBED, __pyx_t_2) < 0) __PYX_ERR(0, 94, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + __pyx_t_2 = __Pyx_PyInt_From_int(EV_FORK); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 95, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_FORK, __pyx_t_2) < 0) __PYX_ERR(0, 95, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + __pyx_t_2 = __Pyx_PyInt_From_int(EV_CLEANUP); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 96, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_CLEANUP, __pyx_t_2) < 0) __PYX_ERR(0, 96, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + __pyx_t_2 = __Pyx_PyInt_From_int(EV_ASYNC); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 97, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ASYNC, __pyx_t_2) < 0) __PYX_ERR(0, 97, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + __pyx_t_2 = __Pyx_PyInt_From_int(EV_CUSTOM); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 98, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_CUSTOM, __pyx_t_2) < 0) __PYX_ERR(0, 98, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + __pyx_t_2 = __Pyx_PyInt_From_int(EV_ERROR); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 99, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ERROR, __pyx_t_2) < 0) __PYX_ERR(0, 99, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + __pyx_t_2 = __Pyx_PyInt_From_int((EV_READ | EV_WRITE)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 101, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_READWRITE, __pyx_t_2) < 0) __PYX_ERR(0, 101, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + __pyx_t_2 = __Pyx_PyInt_From_int(EV_MINPRI); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 103, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_MINPRI, __pyx_t_2) < 0) __PYX_ERR(0, 103, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + __pyx_t_2 = __Pyx_PyInt_From_int(EV_MAXPRI); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 104, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_MAXPRI, __pyx_t_2) < 0) __PYX_ERR(0, 104, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + __pyx_t_2 = __Pyx_PyInt_From_int(EVBACKEND_PORT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 106, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_BACKEND_PORT, __pyx_t_2) < 0) __PYX_ERR(0, 106, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + __pyx_t_2 = __Pyx_PyInt_From_int(EVBACKEND_KQUEUE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 107, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_BACKEND_KQUEUE, __pyx_t_2) < 0) __PYX_ERR(0, 107, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + __pyx_t_2 = __Pyx_PyInt_From_int(EVBACKEND_EPOLL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 108, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_BACKEND_EPOLL, __pyx_t_2) < 0) __PYX_ERR(0, 108, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + __pyx_t_2 = __Pyx_PyInt_From_int(EVBACKEND_POLL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 109, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_BACKEND_POLL, __pyx_t_2) < 0) __PYX_ERR(0, 109, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + __pyx_t_2 = __Pyx_PyInt_From_int(EVBACKEND_SELECT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 110, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_BACKEND_SELECT, __pyx_t_2) < 0) __PYX_ERR(0, 110, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + __pyx_t_2 = __Pyx_PyInt_From_int(EVFLAG_FORKCHECK); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 111, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_FORKCHECK, __pyx_t_2) < 0) __PYX_ERR(0, 111, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + __pyx_t_2 = __Pyx_PyInt_From_int(EVFLAG_NOINOTIFY); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 112, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_NOINOTIFY, __pyx_t_2) < 0) __PYX_ERR(0, 112, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + __pyx_t_2 = __Pyx_PyInt_From_int(EVFLAG_SIGNALFD); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 113, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_SIGNALFD, __pyx_t_2) < 0) __PYX_ERR(0, 113, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + __pyx_t_2 = __Pyx_PyInt_From_int(EVFLAG_NOSIGMASK); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 114, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_NOSIGMASK, __pyx_t_2) < 0) __PYX_ERR(0, 114, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + __pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_6gevent_5libev_8corecext__EVENTSType)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 124, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_XGOTREF(GEVENT_CORE_EVENTS); + __Pyx_DECREF_SET(GEVENT_CORE_EVENTS, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + + if (PyDict_SetItem(__pyx_d, __pyx_n_s_EVENTS, GEVENT_CORE_EVENTS) < 0) __PYX_ERR(0, 125, __pyx_L1_error) + + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6gevent_5libev_8corecext_1get_version, NULL, __pyx_n_s_gevent_libev_corecext); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 128, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_version, __pyx_t_2) < 0) __PYX_ERR(0, 128, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6gevent_5libev_8corecext_3get_header_version, NULL, __pyx_n_s_gevent_libev_corecext); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 132, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_header_version, __pyx_t_2) < 0) __PYX_ERR(0, 132, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + __pyx_t_2 = __Pyx_PyInt_From_int(EVBACKEND_PORT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 137, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 137, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); + __Pyx_INCREF(__pyx_n_s_port); + __Pyx_GIVEREF(__pyx_n_s_port); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_port); + __pyx_t_2 = 0; + + __pyx_t_2 = __Pyx_PyInt_From_int(EVBACKEND_KQUEUE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 138, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 138, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_INCREF(__pyx_n_s_kqueue); + __Pyx_GIVEREF(__pyx_n_s_kqueue); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_n_s_kqueue); + __pyx_t_2 = 0; + + __pyx_t_2 = __Pyx_PyInt_From_int(EVBACKEND_EPOLL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 139, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 139, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); + __Pyx_INCREF(__pyx_n_s_epoll); + __Pyx_GIVEREF(__pyx_n_s_epoll); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_n_s_epoll); + __pyx_t_2 = 0; + + __pyx_t_2 = __Pyx_PyInt_From_int(EVBACKEND_POLL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 140, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 140, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); + __Pyx_INCREF(__pyx_n_s_poll); + __Pyx_GIVEREF(__pyx_n_s_poll); + PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_n_s_poll); + __pyx_t_2 = 0; + + __pyx_t_2 = __Pyx_PyInt_From_int(EVBACKEND_SELECT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 141, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 141, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2); + __Pyx_INCREF(__pyx_n_s_select); + __Pyx_GIVEREF(__pyx_n_s_select); + PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_n_s_select); + __pyx_t_2 = 0; + + __pyx_t_2 = __Pyx_PyInt_From_int(EVFLAG_NOENV); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 142, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 142, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_2); + __Pyx_INCREF(__pyx_n_s_noenv); + __Pyx_GIVEREF(__pyx_n_s_noenv); + PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_n_s_noenv); + __pyx_t_2 = 0; + + __pyx_t_2 = __Pyx_PyInt_From_int(EVFLAG_FORKCHECK); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 143, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 143, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_2); + __Pyx_INCREF(__pyx_n_s_forkcheck); + __Pyx_GIVEREF(__pyx_n_s_forkcheck); + PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_n_s_forkcheck); + __pyx_t_2 = 0; + + __pyx_t_2 = __Pyx_PyInt_From_int(EVFLAG_NOINOTIFY); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 144, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 144, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_2); + __Pyx_INCREF(__pyx_n_s_noinotify); + __Pyx_GIVEREF(__pyx_n_s_noinotify); + PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_n_s_noinotify); + __pyx_t_2 = 0; + + __pyx_t_2 = __Pyx_PyInt_From_int(EVFLAG_SIGNALFD); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 145, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 145, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_2); + __Pyx_INCREF(__pyx_n_s_signalfd); + __Pyx_GIVEREF(__pyx_n_s_signalfd); + PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_n_s_signalfd); + __pyx_t_2 = 0; + + __pyx_t_2 = __Pyx_PyInt_From_int(EVFLAG_NOSIGMASK); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 146, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 146, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_2); + __Pyx_INCREF(__pyx_n_s_nosigmask); + __Pyx_GIVEREF(__pyx_n_s_nosigmask); + PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_n_s_nosigmask); + __pyx_t_2 = 0; + + __pyx_t_2 = PyList_New(10); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 137, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_1); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_4); + PyList_SET_ITEM(__pyx_t_2, 1, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_5); + PyList_SET_ITEM(__pyx_t_2, 2, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_6); + PyList_SET_ITEM(__pyx_t_2, 3, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_7); + PyList_SET_ITEM(__pyx_t_2, 4, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_8); + PyList_SET_ITEM(__pyx_t_2, 5, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_9); + PyList_SET_ITEM(__pyx_t_2, 6, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_10); + PyList_SET_ITEM(__pyx_t_2, 7, __pyx_t_10); + __Pyx_GIVEREF(__pyx_t_11); + PyList_SET_ITEM(__pyx_t_2, 8, __pyx_t_11); + __Pyx_GIVEREF(__pyx_t_12); + PyList_SET_ITEM(__pyx_t_2, 9, __pyx_t_12); + __pyx_t_1 = 0; + __pyx_t_4 = 0; + __pyx_t_5 = 0; + __pyx_t_6 = 0; + __pyx_t_7 = 0; + __pyx_t_8 = 0; + __pyx_t_9 = 0; + __pyx_t_10 = 0; + __pyx_t_11 = 0; + __pyx_t_12 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_flags, __pyx_t_2) < 0) __PYX_ERR(0, 137, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + __pyx_t_2 = __pyx_pf_6gevent_5libev_8corecext_22genexpr(NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 149, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_12 = __Pyx_Generator_Next(__pyx_t_2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 149, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_flags_str2int, __pyx_t_12) < 0) __PYX_ERR(0, 149, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + + __pyx_t_12 = __Pyx_PyInt_From_int(EV_READ); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 152, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 152, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_12); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_12); + __Pyx_INCREF(__pyx_n_s_READ); + __Pyx_GIVEREF(__pyx_n_s_READ); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_READ); + __pyx_t_12 = 0; + + __pyx_t_12 = __Pyx_PyInt_From_int(EV_WRITE); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 153, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 153, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_GIVEREF(__pyx_t_12); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_12); + __Pyx_INCREF(__pyx_n_s_WRITE); + __Pyx_GIVEREF(__pyx_n_s_WRITE); + PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_n_s_WRITE); + __pyx_t_12 = 0; + + __pyx_t_12 = __Pyx_PyInt_From_int(EV__IOFDSET); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 154, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 154, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_GIVEREF(__pyx_t_12); + PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_12); + __Pyx_INCREF(__pyx_n_s_IOFDSET); + __Pyx_GIVEREF(__pyx_n_s_IOFDSET); + PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_n_s_IOFDSET); + __pyx_t_12 = 0; + + __pyx_t_12 = __Pyx_PyInt_From_int(EV_PERIODIC); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 155, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 155, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_GIVEREF(__pyx_t_12); + PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_12); + __Pyx_INCREF(__pyx_n_s_PERIODIC); + __Pyx_GIVEREF(__pyx_n_s_PERIODIC); + PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_n_s_PERIODIC); + __pyx_t_12 = 0; + + __pyx_t_12 = __Pyx_PyInt_From_int(EV_SIGNAL); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 156, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 156, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_GIVEREF(__pyx_t_12); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_12); + __Pyx_INCREF(__pyx_n_s_SIGNAL); + __Pyx_GIVEREF(__pyx_n_s_SIGNAL); + PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_n_s_SIGNAL); + __pyx_t_12 = 0; + + __pyx_t_12 = __Pyx_PyInt_From_int(EV_CHILD); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 157, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 157, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GIVEREF(__pyx_t_12); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_12); + __Pyx_INCREF(__pyx_n_s_CHILD); + __Pyx_GIVEREF(__pyx_n_s_CHILD); + PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_n_s_CHILD); + __pyx_t_12 = 0; + + __pyx_t_12 = __Pyx_PyInt_From_int(EV_STAT); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 158, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 158, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GIVEREF(__pyx_t_12); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_12); + __Pyx_INCREF(__pyx_n_s_STAT); + __Pyx_GIVEREF(__pyx_n_s_STAT); + PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_n_s_STAT); + __pyx_t_12 = 0; + + __pyx_t_12 = __Pyx_PyInt_From_int(EV_IDLE); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 159, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 159, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_12); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_12); + __Pyx_INCREF(__pyx_n_s_IDLE); + __Pyx_GIVEREF(__pyx_n_s_IDLE); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_n_s_IDLE); + __pyx_t_12 = 0; + + __pyx_t_12 = __Pyx_PyInt_From_int(EV_PREPARE); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 160, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 160, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_12); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_12); + __Pyx_INCREF(__pyx_n_s_PREPARE); + __Pyx_GIVEREF(__pyx_n_s_PREPARE); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_n_s_PREPARE); + __pyx_t_12 = 0; + + __pyx_t_12 = __Pyx_PyInt_From_int(EV_CHECK); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 161, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 161, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_12); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_12); + __Pyx_INCREF(__pyx_n_s_CHECK); + __Pyx_GIVEREF(__pyx_n_s_CHECK); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_CHECK); + __pyx_t_12 = 0; + + __pyx_t_12 = __Pyx_PyInt_From_int(EV_EMBED); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 162, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_13 = PyTuple_New(2); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 162, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + __Pyx_GIVEREF(__pyx_t_12); + PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_12); + __Pyx_INCREF(__pyx_n_s_EMBED); + __Pyx_GIVEREF(__pyx_n_s_EMBED); + PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_n_s_EMBED); + __pyx_t_12 = 0; + + __pyx_t_12 = __Pyx_PyInt_From_int(EV_FORK); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 163, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_14 = PyTuple_New(2); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 163, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_14); + __Pyx_GIVEREF(__pyx_t_12); + PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_12); + __Pyx_INCREF(__pyx_n_s_FORK); + __Pyx_GIVEREF(__pyx_n_s_FORK); + PyTuple_SET_ITEM(__pyx_t_14, 1, __pyx_n_s_FORK); + __pyx_t_12 = 0; + + __pyx_t_12 = __Pyx_PyInt_From_int(EV_CLEANUP); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 164, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_15 = PyTuple_New(2); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 164, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_15); + __Pyx_GIVEREF(__pyx_t_12); + PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_12); + __Pyx_INCREF(__pyx_n_s_CLEANUP); + __Pyx_GIVEREF(__pyx_n_s_CLEANUP); + PyTuple_SET_ITEM(__pyx_t_15, 1, __pyx_n_s_CLEANUP); + __pyx_t_12 = 0; + + __pyx_t_12 = __Pyx_PyInt_From_int(EV_ASYNC); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 165, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_16 = PyTuple_New(2); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 165, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_16); + __Pyx_GIVEREF(__pyx_t_12); + PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_12); + __Pyx_INCREF(__pyx_n_s_ASYNC); + __Pyx_GIVEREF(__pyx_n_s_ASYNC); + PyTuple_SET_ITEM(__pyx_t_16, 1, __pyx_n_s_ASYNC); + __pyx_t_12 = 0; + + __pyx_t_12 = __Pyx_PyInt_From_int(EV_CUSTOM); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 166, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_17 = PyTuple_New(2); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 166, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_17); + __Pyx_GIVEREF(__pyx_t_12); + PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_12); + __Pyx_INCREF(__pyx_n_s_CUSTOM); + __Pyx_GIVEREF(__pyx_n_s_CUSTOM); + PyTuple_SET_ITEM(__pyx_t_17, 1, __pyx_n_s_CUSTOM); + __pyx_t_12 = 0; + + __pyx_t_12 = __Pyx_PyInt_From_int(EV_ERROR); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 167, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_18 = PyTuple_New(2); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 167, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_18); + __Pyx_GIVEREF(__pyx_t_12); + PyTuple_SET_ITEM(__pyx_t_18, 0, __pyx_t_12); + __Pyx_INCREF(__pyx_n_s_ERROR); + __Pyx_GIVEREF(__pyx_n_s_ERROR); + PyTuple_SET_ITEM(__pyx_t_18, 1, __pyx_n_s_ERROR); + __pyx_t_12 = 0; + + __pyx_t_12 = PyList_New(16); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 152, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_GIVEREF(__pyx_t_2); + PyList_SET_ITEM(__pyx_t_12, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_11); + PyList_SET_ITEM(__pyx_t_12, 1, __pyx_t_11); + __Pyx_GIVEREF(__pyx_t_10); + PyList_SET_ITEM(__pyx_t_12, 2, __pyx_t_10); + __Pyx_GIVEREF(__pyx_t_9); + PyList_SET_ITEM(__pyx_t_12, 3, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_8); + PyList_SET_ITEM(__pyx_t_12, 4, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_7); + PyList_SET_ITEM(__pyx_t_12, 5, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_6); + PyList_SET_ITEM(__pyx_t_12, 6, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_5); + PyList_SET_ITEM(__pyx_t_12, 7, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_4); + PyList_SET_ITEM(__pyx_t_12, 8, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_1); + PyList_SET_ITEM(__pyx_t_12, 9, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_13); + PyList_SET_ITEM(__pyx_t_12, 10, __pyx_t_13); + __Pyx_GIVEREF(__pyx_t_14); + PyList_SET_ITEM(__pyx_t_12, 11, __pyx_t_14); + __Pyx_GIVEREF(__pyx_t_15); + PyList_SET_ITEM(__pyx_t_12, 12, __pyx_t_15); + __Pyx_GIVEREF(__pyx_t_16); + PyList_SET_ITEM(__pyx_t_12, 13, __pyx_t_16); + __Pyx_GIVEREF(__pyx_t_17); + PyList_SET_ITEM(__pyx_t_12, 14, __pyx_t_17); + __Pyx_GIVEREF(__pyx_t_18); + PyList_SET_ITEM(__pyx_t_12, 15, __pyx_t_18); + __pyx_t_2 = 0; + __pyx_t_11 = 0; + __pyx_t_10 = 0; + __pyx_t_9 = 0; + __pyx_t_8 = 0; + __pyx_t_7 = 0; + __pyx_t_6 = 0; + __pyx_t_5 = 0; + __pyx_t_4 = 0; + __pyx_t_1 = 0; + __pyx_t_13 = 0; + __pyx_t_14 = 0; + __pyx_t_15 = 0; + __pyx_t_16 = 0; + __pyx_t_17 = 0; + __pyx_t_18 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_events, __pyx_t_12) < 0) __PYX_ERR(0, 152, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + + __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_sys); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 183, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_version_info); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 183, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_18); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_12 = __Pyx_GetItemInt(__pyx_t_18, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 183, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + __pyx_t_18 = PyObject_RichCompare(__pyx_t_12, __pyx_int_3, Py_GE); __Pyx_XGOTREF(__pyx_t_18); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 183, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_18); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 183, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + if (__pyx_t_3) { + + __pyx_t_18 = PyTuple_New(2); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 184, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_18); + __Pyx_INCREF(((PyObject *)(&PyBytes_Type))); + __Pyx_GIVEREF(((PyObject *)(&PyBytes_Type))); + PyTuple_SET_ITEM(__pyx_t_18, 0, ((PyObject *)(&PyBytes_Type))); + __Pyx_INCREF(((PyObject *)(&PyString_Type))); + __Pyx_GIVEREF(((PyObject *)(&PyString_Type))); + PyTuple_SET_ITEM(__pyx_t_18, 1, ((PyObject *)(&PyString_Type))); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_basestring, __pyx_t_18) < 0) __PYX_ERR(0, 184, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + + goto __pyx_L3; + } + + /*else*/ { + __Pyx_GetModuleGlobalName(__pyx_t_18, __pyx_n_s_builtins); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 186, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_18); + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_18, __pyx_n_s_basestring); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 186, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_basestring, __pyx_t_12) < 0) __PYX_ERR(0, 186, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + } + __pyx_L3:; + + __pyx_t_12 = PyCFunction_NewEx(&__pyx_mdef_6gevent_5libev_8corecext_13supported_backends, NULL, __pyx_n_s_gevent_libev_corecext); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 241, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_supported_backends, __pyx_t_12) < 0) __PYX_ERR(0, 241, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + + __pyx_t_12 = PyCFunction_NewEx(&__pyx_mdef_6gevent_5libev_8corecext_15recommended_backends, NULL, __pyx_n_s_gevent_libev_corecext); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 245, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_recommended_backends, __pyx_t_12) < 0) __PYX_ERR(0, 245, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + + __pyx_t_12 = PyCFunction_NewEx(&__pyx_mdef_6gevent_5libev_8corecext_17embeddable_backends, NULL, __pyx_n_s_gevent_libev_corecext); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 249, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_embeddable_backends, __pyx_t_12) < 0) __PYX_ERR(0, 249, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + + __pyx_t_12 = PyCFunction_NewEx(&__pyx_mdef_6gevent_5libev_8corecext_19time, NULL, __pyx_n_s_gevent_libev_corecext); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 253, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_time, __pyx_t_12) < 0) __PYX_ERR(0, 253, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + + __Pyx_GetNameInClass(__pyx_t_12, (PyObject *)__pyx_ptype_6gevent_5libev_8corecext_callback, __pyx_n_s_stop); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 276, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_5libev_8corecext_callback->tp_dict, __pyx_n_s_close, __pyx_t_12) < 0) __PYX_ERR(0, 276, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + PyType_Modified(__pyx_ptype_6gevent_5libev_8corecext_callback); + + __pyx_k__9 = EVBREAK_ONE; + + __Pyx_GetNameInClass(__pyx_t_12, (PyObject *)__pyx_ptype_6gevent_5libev_8corecext_loop, __pyx_n_s_update_now); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 599, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_5libev_8corecext_loop->tp_dict, __pyx_n_s_update, __pyx_t_12) < 0) __PYX_ERR(0, 599, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + PyType_Modified(__pyx_ptype_6gevent_5libev_8corecext_loop); + + __Pyx_GetNameInClass(__pyx_t_12, (PyObject *)__pyx_ptype_6gevent_5libev_8corecext_loop, __pyx_n_s_async); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 664, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_5libev_8corecext_loop->tp_dict, __pyx_n_s_async_2, __pyx_t_12) < 0) __PYX_ERR(0, 664, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + PyType_Modified(__pyx_ptype_6gevent_5libev_8corecext_loop); + + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_19, &__pyx_t_20, &__pyx_t_21); + __Pyx_XGOTREF(__pyx_t_19); + __Pyx_XGOTREF(__pyx_t_20); + __Pyx_XGOTREF(__pyx_t_21); + /*try:*/ { + + __pyx_t_12 = PyList_New(1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 752, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_INCREF(__pyx_n_s_classImplements); + __Pyx_GIVEREF(__pyx_n_s_classImplements); + PyList_SET_ITEM(__pyx_t_12, 0, __pyx_n_s_classImplements); + __pyx_t_18 = __Pyx_Import(__pyx_n_s_zope_interface, __pyx_t_12, 0); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 752, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_18); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_12 = __Pyx_ImportFrom(__pyx_t_18, __pyx_n_s_classImplements); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 752, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_12); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_classImplements, __pyx_t_12) < 0) __PYX_ERR(0, 752, __pyx_L4_error) + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + + } + + /*else:*/ { + __pyx_t_18 = PyList_New(1); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 758, __pyx_L6_except_error) + __Pyx_GOTREF(__pyx_t_18); + __Pyx_INCREF(__pyx_n_s_ILoop); + __Pyx_GIVEREF(__pyx_n_s_ILoop); + PyList_SET_ITEM(__pyx_t_18, 0, __pyx_n_s_ILoop); + __pyx_t_12 = __Pyx_Import(__pyx_n_s_gevent__interfaces, __pyx_t_18, 0); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 758, __pyx_L6_except_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + __pyx_t_18 = __Pyx_ImportFrom(__pyx_t_12, __pyx_n_s_ILoop); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 758, __pyx_L6_except_error) + __Pyx_GOTREF(__pyx_t_18); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ILoop, __pyx_t_18) < 0) __PYX_ERR(0, 758, __pyx_L6_except_error) + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + + __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_classImplements); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 759, __pyx_L6_except_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_GetModuleGlobalName(__pyx_t_18, __pyx_n_s_ILoop); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 759, __pyx_L6_except_error) + __Pyx_GOTREF(__pyx_t_18); + __pyx_t_17 = PyTuple_New(2); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 759, __pyx_L6_except_error) + __Pyx_GOTREF(__pyx_t_17); + __Pyx_INCREF(((PyObject *)__pyx_ptype_6gevent_5libev_8corecext_loop)); + __Pyx_GIVEREF(((PyObject *)__pyx_ptype_6gevent_5libev_8corecext_loop)); + PyTuple_SET_ITEM(__pyx_t_17, 0, ((PyObject *)__pyx_ptype_6gevent_5libev_8corecext_loop)); + __Pyx_GIVEREF(__pyx_t_18); + PyTuple_SET_ITEM(__pyx_t_17, 1, __pyx_t_18); + __pyx_t_18 = 0; + __pyx_t_18 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_17, NULL); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 759, __pyx_L6_except_error) + __Pyx_GOTREF(__pyx_t_18); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + } + __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0; + __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0; + __Pyx_XDECREF(__pyx_t_21); __pyx_t_21 = 0; + goto __pyx_L9_try_end; + __pyx_L4_error:; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; + __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; + __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0; + __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0; + + __pyx_t_22 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ImportError); + if (__pyx_t_22) { + __Pyx_ErrRestore(0,0,0); + goto __pyx_L5_exception_handled; + } + goto __pyx_L6_except_error; + __pyx_L6_except_error:; + + __Pyx_XGIVEREF(__pyx_t_19); + __Pyx_XGIVEREF(__pyx_t_20); + __Pyx_XGIVEREF(__pyx_t_21); + __Pyx_ExceptionReset(__pyx_t_19, __pyx_t_20, __pyx_t_21); + goto __pyx_L1_error; + __pyx_L5_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_19); + __Pyx_XGIVEREF(__pyx_t_20); + __Pyx_XGIVEREF(__pyx_t_21); + __Pyx_ExceptionReset(__pyx_t_19, __pyx_t_20, __pyx_t_21); + __pyx_L9_try_end:; + } + + __pyx_v_6gevent_5libev_8corecext_io_ss = __pyx_f_6gevent_5libev_8corecext_make_ss(((void *)ev_io_start), ((void *)ev_io_stop)); + + __pyx_v_6gevent_5libev_8corecext_timer_ss = __pyx_f_6gevent_5libev_8corecext_make_ss(((void *)ev_timer_start), ((void *)ev_timer_stop)); + + __pyx_v_6gevent_5libev_8corecext_signal_ss = __pyx_f_6gevent_5libev_8corecext_make_ss(((void *)ev_signal_start), ((void *)ev_signal_stop)); + + __pyx_v_6gevent_5libev_8corecext_idle_ss = __pyx_f_6gevent_5libev_8corecext_make_ss(((void *)ev_idle_start), ((void *)ev_idle_stop)); + + __pyx_v_6gevent_5libev_8corecext_prepare_ss = __pyx_f_6gevent_5libev_8corecext_make_ss(((void *)ev_prepare_start), ((void *)ev_prepare_stop)); + + __pyx_v_6gevent_5libev_8corecext_check_ss = __pyx_f_6gevent_5libev_8corecext_make_ss(((void *)ev_check_start), ((void *)ev_check_stop)); + + __pyx_v_6gevent_5libev_8corecext_fork_ss = __pyx_f_6gevent_5libev_8corecext_make_ss(((void *)ev_fork_start), ((void *)ev_fork_stop)); + + __pyx_v_6gevent_5libev_8corecext_async_ss = __pyx_f_6gevent_5libev_8corecext_make_ss(((void *)ev_async_start), ((void *)ev_async_stop)); + + if (PyDict_SetItem(__pyx_d, __pyx_n_s_async_2, ((PyObject *)__pyx_ptype_6gevent_5libev_8corecext_async_)) < 0) __PYX_ERR(0, 1178, __pyx_L1_error) + + __pyx_v_6gevent_5libev_8corecext_child_ss = __pyx_f_6gevent_5libev_8corecext_make_ss(((void *)ev_child_start), ((void *)ev_child_stop)); + + __pyx_v_6gevent_5libev_8corecext_stat_ss = __pyx_f_6gevent_5libev_8corecext_make_ss(((void *)ev_stat_start), ((void *)ev_stat_stop)); + + if (PyDict_SetItem(__pyx_d, __pyx_n_s_SYSERR_CALLBACK, Py_None) < 0) __PYX_ERR(0, 1269, __pyx_L1_error) + + __pyx_t_18 = __Pyx_PyInt_From_int(LIBEV_EMBED); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1295, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_18); + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_18); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1295, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + __pyx_t_18 = __Pyx_PyBool_FromLong((!(!__pyx_t_3))); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1295, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_18); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBEV_EMBED, __pyx_t_18) < 0) __PYX_ERR(0, 1295, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + + __pyx_t_18 = __Pyx_PyInt_From_int(EV_USE_FLOOR); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1296, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_18); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_EV_USE_FLOOR, __pyx_t_18) < 0) __PYX_ERR(0, 1296, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + + __pyx_t_18 = __Pyx_PyInt_From_int(EV_USE_CLOCK_SYSCALL); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1297, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_18); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_EV_USE_CLOCK_SYSCALL, __pyx_t_18) < 0) __PYX_ERR(0, 1297, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + + __pyx_t_18 = __Pyx_PyInt_From_int(EV_USE_REALTIME); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1298, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_18); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_EV_USE_REALTIME, __pyx_t_18) < 0) __PYX_ERR(0, 1298, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + + __pyx_t_18 = __Pyx_PyInt_From_int(EV_USE_MONOTONIC); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1299, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_18); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_EV_USE_MONOTONIC, __pyx_t_18) < 0) __PYX_ERR(0, 1299, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + + __pyx_t_18 = __Pyx_PyInt_From_int(EV_USE_NANOSLEEP); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1300, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_18); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_EV_USE_NANOSLEEP, __pyx_t_18) < 0) __PYX_ERR(0, 1300, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + + __pyx_t_18 = __Pyx_PyInt_From_int(EV_USE_INOTIFY); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1301, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_18); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_EV_USE_INOTIFY, __pyx_t_18) < 0) __PYX_ERR(0, 1301, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + + __pyx_t_18 = __Pyx_PyInt_From_int(EV_USE_SIGNALFD); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1302, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_18); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_EV_USE_SIGNALFD, __pyx_t_18) < 0) __PYX_ERR(0, 1302, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + + __pyx_t_18 = __Pyx_PyInt_From_int(EV_USE_EVENTFD); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1303, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_18); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_EV_USE_EVENTFD, __pyx_t_18) < 0) __PYX_ERR(0, 1303, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + + __pyx_t_18 = __Pyx_PyInt_From_int(EV_USE_4HEAP); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1304, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_18); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_EV_USE_4HEAP, __pyx_t_18) < 0) __PYX_ERR(0, 1304, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + + __Pyx_INCREF(__pyx_empty_tuple); + __Pyx_XGOTREF(_empty_tuple); + __Pyx_DECREF_SET(_empty_tuple, __pyx_empty_tuple); + __Pyx_GIVEREF(__pyx_empty_tuple); + + __pyx_t_18 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_18); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_18) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + + /*--- Wrapped vars code ---*/ + + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_XDECREF(__pyx_t_13); + __Pyx_XDECREF(__pyx_t_14); + __Pyx_XDECREF(__pyx_t_15); + __Pyx_XDECREF(__pyx_t_16); + __Pyx_XDECREF(__pyx_t_17); + __Pyx_XDECREF(__pyx_t_18); + if (__pyx_m) { + if (__pyx_d) { + __Pyx_AddTraceback("init gevent.libev.corecext", __pyx_clineno, __pyx_lineno, __pyx_filename); + } + Py_CLEAR(__pyx_m); + } else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_ImportError, "init gevent.libev.corecext"); + } + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + #if CYTHON_PEP489_MULTI_PHASE_INIT + return (__pyx_m != NULL) ? 0 : -1; + #elif PY_MAJOR_VERSION >= 3 + return __pyx_m; + #else + return; + #endif +} + +/* --- Runtime support code --- */ +/* Refnanny */ +#if CYTHON_REFNANNY +static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { + PyObject *m = NULL, *p = NULL; + void *r = NULL; + m = PyImport_ImportModule(modname); + if (!m) goto end; + p = PyObject_GetAttrString(m, "RefNannyAPI"); + if (!p) goto end; + r = PyLong_AsVoidPtr(p); +end: + Py_XDECREF(p); + Py_XDECREF(m); + return (__Pyx_RefNannyAPIStruct *)r; +} +#endif + +/* PyObjectGetAttrStr */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_getattro)) + return tp->tp_getattro(obj, attr_name); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_getattr)) + return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); +#endif + return PyObject_GetAttr(obj, attr_name); +} +#endif + +/* GetBuiltinName */ +static PyObject *__Pyx_GetBuiltinName(PyObject *name) { + PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name); + if (unlikely(!result)) { + PyErr_Format(PyExc_NameError, +#if PY_MAJOR_VERSION >= 3 + "name '%U' is not defined", name); +#else + "name '%.200s' is not defined", PyString_AS_STRING(name)); +#endif + } + return result; +} + +/* GetModuleGlobalName */ +#if CYTHON_USE_DICT_VERSIONS +static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value) +#else +static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) +#endif +{ + PyObject *result; +#if !CYTHON_AVOID_BORROWED_REFS +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 + result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } else if (unlikely(PyErr_Occurred())) { + return NULL; + } +#else + result = PyDict_GetItem(__pyx_d, name); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } +#endif +#else + result = PyObject_GetItem(__pyx_d, name); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } + PyErr_Clear(); +#endif + return __Pyx_GetBuiltinName(name); +} + +/* RaiseTooManyValuesToUnpack */ +static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { + PyErr_Format(PyExc_ValueError, + "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected); +} + +/* RaiseNeedMoreValuesToUnpack */ +static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { + PyErr_Format(PyExc_ValueError, + "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack", + index, (index == 1) ? "" : "s"); +} + +/* IterFinish */ +static CYTHON_INLINE int __Pyx_IterFinish(void) { +#if CYTHON_FAST_THREAD_STATE + PyThreadState *tstate = __Pyx_PyThreadState_Current; + PyObject* exc_type = tstate->curexc_type; + if (unlikely(exc_type)) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) { + PyObject *exc_value, *exc_tb; + exc_value = tstate->curexc_value; + exc_tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; + Py_DECREF(exc_type); + Py_XDECREF(exc_value); + Py_XDECREF(exc_tb); + return 0; + } else { + return -1; + } + } + return 0; +#else + if (unlikely(PyErr_Occurred())) { + if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) { + PyErr_Clear(); + return 0; + } else { + return -1; + } + } + return 0; +#endif +} + +/* UnpackItemEndCheck */ +static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { + if (unlikely(retval)) { + Py_DECREF(retval); + __Pyx_RaiseTooManyValuesError(expected); + return -1; + } else { + return __Pyx_IterFinish(); + } + return 0; +} + +/* PyCFunctionFastCall */ +#if CYTHON_FAST_PYCCALL +static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) { + PyCFunctionObject *func = (PyCFunctionObject*)func_obj; + PyCFunction meth = PyCFunction_GET_FUNCTION(func); + PyObject *self = PyCFunction_GET_SELF(func); + int flags = PyCFunction_GET_FLAGS(func); + assert(PyCFunction_Check(func)); + assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS))); + assert(nargs >= 0); + assert(nargs == 0 || args != NULL); + /* _PyCFunction_FastCallDict() must not be called with an exception set, + because it may clear it (directly or indirectly) and so the + caller loses its exception */ + assert(!PyErr_Occurred()); + if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) { + return (*((__Pyx_PyCFunctionFastWithKeywords)(void*)meth)) (self, args, nargs, NULL); + } else { + return (*((__Pyx_PyCFunctionFast)(void*)meth)) (self, args, nargs); + } +} +#endif + +/* PyFunctionFastCall */ +#if CYTHON_FAST_PYCALL +static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, + PyObject *globals) { + PyFrameObject *f; + PyThreadState *tstate = __Pyx_PyThreadState_Current; + PyObject **fastlocals; + Py_ssize_t i; + PyObject *result; + assert(globals != NULL); + /* XXX Perhaps we should create a specialized + PyFrame_New() that doesn't take locals, but does + take builtins without sanity checking them. + */ + assert(tstate != NULL); + f = PyFrame_New(tstate, co, globals, NULL); + if (f == NULL) { + return NULL; + } + fastlocals = __Pyx_PyFrame_GetLocalsplus(f); + for (i = 0; i < na; i++) { + Py_INCREF(*args); + fastlocals[i] = *args++; + } + result = PyEval_EvalFrameEx(f,0); + ++tstate->recursion_depth; + Py_DECREF(f); + --tstate->recursion_depth; + return result; +} +#if 1 || PY_VERSION_HEX < 0x030600B1 +static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs) { + PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); + PyObject *globals = PyFunction_GET_GLOBALS(func); + PyObject *argdefs = PyFunction_GET_DEFAULTS(func); + PyObject *closure; +#if PY_MAJOR_VERSION >= 3 + PyObject *kwdefs; +#endif + PyObject *kwtuple, **k; + PyObject **d; + Py_ssize_t nd; + Py_ssize_t nk; + PyObject *result; + assert(kwargs == NULL || PyDict_Check(kwargs)); + nk = kwargs ? PyDict_Size(kwargs) : 0; + if (Py_EnterRecursiveCall((char*)" while calling a Python object")) { + return NULL; + } + if ( +#if PY_MAJOR_VERSION >= 3 + co->co_kwonlyargcount == 0 && +#endif + likely(kwargs == NULL || nk == 0) && + co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { + if (argdefs == NULL && co->co_argcount == nargs) { + result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); + goto done; + } + else if (nargs == 0 && argdefs != NULL + && co->co_argcount == Py_SIZE(argdefs)) { + /* function called with no arguments, but all parameters have + a default value: use default values as arguments .*/ + args = &PyTuple_GET_ITEM(argdefs, 0); + result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); + goto done; + } + } + if (kwargs != NULL) { + Py_ssize_t pos, i; + kwtuple = PyTuple_New(2 * nk); + if (kwtuple == NULL) { + result = NULL; + goto done; + } + k = &PyTuple_GET_ITEM(kwtuple, 0); + pos = i = 0; + while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { + Py_INCREF(k[i]); + Py_INCREF(k[i+1]); + i += 2; + } + nk = i / 2; + } + else { + kwtuple = NULL; + k = NULL; + } + closure = PyFunction_GET_CLOSURE(func); +#if PY_MAJOR_VERSION >= 3 + kwdefs = PyFunction_GET_KW_DEFAULTS(func); +#endif + if (argdefs != NULL) { + d = &PyTuple_GET_ITEM(argdefs, 0); + nd = Py_SIZE(argdefs); + } + else { + d = NULL; + nd = 0; + } +#if PY_MAJOR_VERSION >= 3 + result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, + args, nargs, + k, (int)nk, + d, (int)nd, kwdefs, closure); +#else + result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, + args, nargs, + k, (int)nk, + d, (int)nd, closure); +#endif + Py_XDECREF(kwtuple); +done: + Py_LeaveRecursiveCall(); + return result; +} +#endif +#endif + +/* PyObjectCall */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { + PyObject *result; + ternaryfunc call = func->ob_type->tp_call; + if (unlikely(!call)) + return PyObject_Call(func, arg, kw); + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; + result = (*call)(func, arg, kw); + Py_LeaveRecursiveCall(); + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +/* PyObjectCall2Args */ +static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) { + PyObject *args, *result = NULL; + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(function)) { + PyObject *args[2] = {arg1, arg2}; + return __Pyx_PyFunction_FastCall(function, args, 2); + } + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(function)) { + PyObject *args[2] = {arg1, arg2}; + return __Pyx_PyCFunction_FastCall(function, args, 2); + } + #endif + args = PyTuple_New(2); + if (unlikely(!args)) goto done; + Py_INCREF(arg1); + PyTuple_SET_ITEM(args, 0, arg1); + Py_INCREF(arg2); + PyTuple_SET_ITEM(args, 1, arg2); + Py_INCREF(function); + result = __Pyx_PyObject_Call(function, args, NULL); + Py_DECREF(args); + Py_DECREF(function); +done: + return result; +} + +/* PyObjectCallMethO */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { + PyObject *self, *result; + PyCFunction cfunc; + cfunc = PyCFunction_GET_FUNCTION(func); + self = PyCFunction_GET_SELF(func); + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; + result = cfunc(self, arg); + Py_LeaveRecursiveCall(); + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +/* PyObjectCallOneArg */ +#if CYTHON_COMPILING_IN_CPYTHON +static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) { + PyObject *result; + PyObject *args = PyTuple_New(1); + if (unlikely(!args)) return NULL; + Py_INCREF(arg); + PyTuple_SET_ITEM(args, 0, arg); + result = __Pyx_PyObject_Call(func, args, NULL); + Py_DECREF(args); + return result; +} +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { +#if CYTHON_FAST_PYCALL + if (PyFunction_Check(func)) { + return __Pyx_PyFunction_FastCall(func, &arg, 1); + } +#endif + if (likely(PyCFunction_Check(func))) { + if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) { + return __Pyx_PyObject_CallMethO(func, arg); +#if CYTHON_FAST_PYCCALL + } else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) { + return __Pyx_PyCFunction_FastCall(func, &arg, 1); +#endif + } + } + return __Pyx__PyObject_CallOneArg(func, arg); +} +#else +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { + PyObject *result; + PyObject *args = PyTuple_Pack(1, arg); + if (unlikely(!args)) return NULL; + result = __Pyx_PyObject_Call(func, args, NULL); + Py_DECREF(args); + return result; +} +#endif + +/* PyObjectCallNoArg */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { +#if CYTHON_FAST_PYCALL + if (PyFunction_Check(func)) { + return __Pyx_PyFunction_FastCall(func, NULL, 0); + } +#endif +#ifdef __Pyx_CyFunction_USED + if (likely(PyCFunction_Check(func) || __Pyx_CyFunction_Check(func))) +#else + if (likely(PyCFunction_Check(func))) +#endif + { + if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) { + return __Pyx_PyObject_CallMethO(func, NULL); + } + } + return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL); +} +#endif + +/* GetItemInt */ +static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { + PyObject *r; + if (!j) return NULL; + r = PyObject_GetItem(o, j); + Py_DECREF(j); + return r; +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, + CYTHON_NCP_UNUSED int wraparound, + CYTHON_NCP_UNUSED int boundscheck) { +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + Py_ssize_t wrapped_i = i; + if (wraparound & unlikely(i < 0)) { + wrapped_i += PyList_GET_SIZE(o); + } + if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) { + PyObject *r = PyList_GET_ITEM(o, wrapped_i); + Py_INCREF(r); + return r; + } + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +#else + return PySequence_GetItem(o, i); +#endif +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, + CYTHON_NCP_UNUSED int wraparound, + CYTHON_NCP_UNUSED int boundscheck) { +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + Py_ssize_t wrapped_i = i; + if (wraparound & unlikely(i < 0)) { + wrapped_i += PyTuple_GET_SIZE(o); + } + if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) { + PyObject *r = PyTuple_GET_ITEM(o, wrapped_i); + Py_INCREF(r); + return r; + } + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +#else + return PySequence_GetItem(o, i); +#endif +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, + CYTHON_NCP_UNUSED int wraparound, + CYTHON_NCP_UNUSED int boundscheck) { +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS + if (is_list || PyList_CheckExact(o)) { + Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); + if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) { + PyObject *r = PyList_GET_ITEM(o, n); + Py_INCREF(r); + return r; + } + } + else if (PyTuple_CheckExact(o)) { + Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o); + if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) { + PyObject *r = PyTuple_GET_ITEM(o, n); + Py_INCREF(r); + return r; + } + } else { + PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence; + if (likely(m && m->sq_item)) { + if (wraparound && unlikely(i < 0) && likely(m->sq_length)) { + Py_ssize_t l = m->sq_length(o); + if (likely(l >= 0)) { + i += l; + } else { + if (!PyErr_ExceptionMatches(PyExc_OverflowError)) + return NULL; + PyErr_Clear(); + } + } + return m->sq_item(o, i); + } + } +#else + if (is_list || PySequence_Check(o)) { + return PySequence_GetItem(o, i); + } +#endif + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +} + +/* ObjectGetItem */ +#if CYTHON_USE_TYPE_SLOTS +static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject* index) { + PyObject *runerr; + Py_ssize_t key_value; + PySequenceMethods *m = Py_TYPE(obj)->tp_as_sequence; + if (unlikely(!(m && m->sq_item))) { + PyErr_Format(PyExc_TypeError, "'%.200s' object is not subscriptable", Py_TYPE(obj)->tp_name); + return NULL; + } + key_value = __Pyx_PyIndex_AsSsize_t(index); + if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) { + return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1); + } + if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) { + PyErr_Clear(); + PyErr_Format(PyExc_IndexError, "cannot fit '%.200s' into an index-sized integer", Py_TYPE(index)->tp_name); + } + return NULL; +} +static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key) { + PyMappingMethods *m = Py_TYPE(obj)->tp_as_mapping; + if (likely(m && m->mp_subscript)) { + return m->mp_subscript(obj, key); + } + return __Pyx_PyObject_GetIndex(obj, key); +} +#endif + +/* GetTopmostException */ +#if CYTHON_USE_EXC_INFO_STACK +static _PyErr_StackItem * +__Pyx_PyErr_GetTopmostException(PyThreadState *tstate) +{ + _PyErr_StackItem *exc_info = tstate->exc_info; + while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) && + exc_info->previous_item != NULL) + { + exc_info = exc_info->previous_item; + } + return exc_info; +} +#endif + +/* SaveResetException */ +#if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { + #if CYTHON_USE_EXC_INFO_STACK + _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate); + *type = exc_info->exc_type; + *value = exc_info->exc_value; + *tb = exc_info->exc_traceback; + #else + *type = tstate->exc_type; + *value = tstate->exc_value; + *tb = tstate->exc_traceback; + #endif + Py_XINCREF(*type); + Py_XINCREF(*value); + Py_XINCREF(*tb); +} +static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + #if CYTHON_USE_EXC_INFO_STACK + _PyErr_StackItem *exc_info = tstate->exc_info; + tmp_type = exc_info->exc_type; + tmp_value = exc_info->exc_value; + tmp_tb = exc_info->exc_traceback; + exc_info->exc_type = type; + exc_info->exc_value = value; + exc_info->exc_traceback = tb; + #else + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = type; + tstate->exc_value = value; + tstate->exc_traceback = tb; + #endif + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +} +#endif + +/* PyErrExceptionMatches */ +#if CYTHON_FAST_THREAD_STATE +static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { + Py_ssize_t i, n; + n = PyTuple_GET_SIZE(tuple); +#if PY_MAJOR_VERSION >= 3 + for (i=0; icurexc_type; + if (exc_type == err) return 1; + if (unlikely(!exc_type)) return 0; + if (unlikely(PyTuple_Check(err))) + return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err); + return __Pyx_PyErr_GivenExceptionMatches(exc_type, err); +} +#endif + +/* GetException */ +#if CYTHON_FAST_THREAD_STATE +static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) +#else +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) +#endif +{ + PyObject *local_type, *local_value, *local_tb; +#if CYTHON_FAST_THREAD_STATE + PyObject *tmp_type, *tmp_value, *tmp_tb; + local_type = tstate->curexc_type; + local_value = tstate->curexc_value; + local_tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +#else + PyErr_Fetch(&local_type, &local_value, &local_tb); +#endif + PyErr_NormalizeException(&local_type, &local_value, &local_tb); +#if CYTHON_FAST_THREAD_STATE + if (unlikely(tstate->curexc_type)) +#else + if (unlikely(PyErr_Occurred())) +#endif + goto bad; + #if PY_MAJOR_VERSION >= 3 + if (local_tb) { + if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) + goto bad; + } + #endif + Py_XINCREF(local_tb); + Py_XINCREF(local_type); + Py_XINCREF(local_value); + *type = local_type; + *value = local_value; + *tb = local_tb; +#if CYTHON_FAST_THREAD_STATE + #if CYTHON_USE_EXC_INFO_STACK + { + _PyErr_StackItem *exc_info = tstate->exc_info; + tmp_type = exc_info->exc_type; + tmp_value = exc_info->exc_value; + tmp_tb = exc_info->exc_traceback; + exc_info->exc_type = local_type; + exc_info->exc_value = local_value; + exc_info->exc_traceback = local_tb; + } + #else + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = local_type; + tstate->exc_value = local_value; + tstate->exc_traceback = local_tb; + #endif + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#else + PyErr_SetExcInfo(local_type, local_value, local_tb); +#endif + return 0; +bad: + *type = 0; + *value = 0; + *tb = 0; + Py_XDECREF(local_type); + Py_XDECREF(local_value); + Py_XDECREF(local_tb); + return -1; +} + +/* StringJoin */ +#if !CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values) { + return PyObject_CallMethodObjArgs(sep, __pyx_n_s_join, values, NULL); +} +#endif + +/* PyErrFetchRestore */ +#if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + tmp_type = tstate->curexc_type; + tmp_value = tstate->curexc_value; + tmp_tb = tstate->curexc_traceback; + tstate->curexc_type = type; + tstate->curexc_value = value; + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +} +static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { + *type = tstate->curexc_type; + *value = tstate->curexc_value; + *tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +} +#endif + +/* RaiseException */ +#if PY_MAJOR_VERSION < 3 +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, + CYTHON_UNUSED PyObject *cause) { + __Pyx_PyThreadState_declare + Py_XINCREF(type); + if (!value || value == Py_None) + value = NULL; + else + Py_INCREF(value); + if (!tb || tb == Py_None) + tb = NULL; + else { + Py_INCREF(tb); + if (!PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto raise_error; + } + } + if (PyType_Check(type)) { +#if CYTHON_COMPILING_IN_PYPY + if (!value) { + Py_INCREF(Py_None); + value = Py_None; + } +#endif + PyErr_NormalizeException(&type, &value, &tb); + } else { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto raise_error; + } + value = type; + type = (PyObject*) Py_TYPE(type); + Py_INCREF(type); + if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto raise_error; + } + } + __Pyx_PyThreadState_assign + __Pyx_ErrRestore(type, value, tb); + return; +raise_error: + Py_XDECREF(value); + Py_XDECREF(type); + Py_XDECREF(tb); + return; +} +#else +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { + PyObject* owned_instance = NULL; + if (tb == Py_None) { + tb = 0; + } else if (tb && !PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto bad; + } + if (value == Py_None) + value = 0; + if (PyExceptionInstance_Check(type)) { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto bad; + } + value = type; + type = (PyObject*) Py_TYPE(value); + } else if (PyExceptionClass_Check(type)) { + PyObject *instance_class = NULL; + if (value && PyExceptionInstance_Check(value)) { + instance_class = (PyObject*) Py_TYPE(value); + if (instance_class != type) { + int is_subclass = PyObject_IsSubclass(instance_class, type); + if (!is_subclass) { + instance_class = NULL; + } else if (unlikely(is_subclass == -1)) { + goto bad; + } else { + type = instance_class; + } + } + } + if (!instance_class) { + PyObject *args; + if (!value) + args = PyTuple_New(0); + else if (PyTuple_Check(value)) { + Py_INCREF(value); + args = value; + } else + args = PyTuple_Pack(1, value); + if (!args) + goto bad; + owned_instance = PyObject_Call(type, args, NULL); + Py_DECREF(args); + if (!owned_instance) + goto bad; + value = owned_instance; + if (!PyExceptionInstance_Check(value)) { + PyErr_Format(PyExc_TypeError, + "calling %R should have returned an instance of " + "BaseException, not %R", + type, Py_TYPE(value)); + goto bad; + } + } + } else { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto bad; + } + if (cause) { + PyObject *fixed_cause; + if (cause == Py_None) { + fixed_cause = NULL; + } else if (PyExceptionClass_Check(cause)) { + fixed_cause = PyObject_CallObject(cause, NULL); + if (fixed_cause == NULL) + goto bad; + } else if (PyExceptionInstance_Check(cause)) { + fixed_cause = cause; + Py_INCREF(fixed_cause); + } else { + PyErr_SetString(PyExc_TypeError, + "exception causes must derive from " + "BaseException"); + goto bad; + } + PyException_SetCause(value, fixed_cause); + } + PyErr_SetObject(type, value); + if (tb) { +#if CYTHON_COMPILING_IN_PYPY + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); + Py_INCREF(tb); + PyErr_Restore(tmp_type, tmp_value, tb); + Py_XDECREF(tmp_tb); +#else + PyThreadState *tstate = __Pyx_PyThreadState_Current; + PyObject* tmp_tb = tstate->curexc_traceback; + if (tb != tmp_tb) { + Py_INCREF(tb); + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_tb); + } +#endif + } +bad: + Py_XDECREF(owned_instance); + return; +} +#endif + +/* SwapException */ +#if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + #if CYTHON_USE_EXC_INFO_STACK + _PyErr_StackItem *exc_info = tstate->exc_info; + tmp_type = exc_info->exc_type; + tmp_value = exc_info->exc_value; + tmp_tb = exc_info->exc_traceback; + exc_info->exc_type = *type; + exc_info->exc_value = *value; + exc_info->exc_traceback = *tb; + #else + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = *type; + tstate->exc_value = *value; + tstate->exc_traceback = *tb; + #endif + *type = tmp_type; + *value = tmp_value; + *tb = tmp_tb; +} +#else +static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb); + PyErr_SetExcInfo(*type, *value, *tb); + *type = tmp_type; + *value = tmp_value; + *tb = tmp_tb; +} +#endif + +/* RaiseArgTupleInvalid */ +static void __Pyx_RaiseArgtupleInvalid( + const char* func_name, + int exact, + Py_ssize_t num_min, + Py_ssize_t num_max, + Py_ssize_t num_found) +{ + Py_ssize_t num_expected; + const char *more_or_less; + if (num_found < num_min) { + num_expected = num_min; + more_or_less = "at least"; + } else { + num_expected = num_max; + more_or_less = "at most"; + } + if (exact) { + more_or_less = "exactly"; + } + PyErr_Format(PyExc_TypeError, + "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", + func_name, more_or_less, num_expected, + (num_expected == 1) ? "" : "s", num_found); +} + +/* RaiseDoubleKeywords */ +static void __Pyx_RaiseDoubleKeywordsError( + const char* func_name, + PyObject* kw_name) +{ + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION >= 3 + "%s() got multiple values for keyword argument '%U'", func_name, kw_name); + #else + "%s() got multiple values for keyword argument '%s'", func_name, + PyString_AsString(kw_name)); + #endif +} + +/* ParseKeywords */ +static int __Pyx_ParseOptionalKeywords( + PyObject *kwds, + PyObject **argnames[], + PyObject *kwds2, + PyObject *values[], + Py_ssize_t num_pos_args, + const char* function_name) +{ + PyObject *key = 0, *value = 0; + Py_ssize_t pos = 0; + PyObject*** name; + PyObject*** first_kw_arg = argnames + num_pos_args; + while (PyDict_Next(kwds, &pos, &key, &value)) { + name = first_kw_arg; + while (*name && (**name != key)) name++; + if (*name) { + values[name-argnames] = value; + continue; + } + name = first_kw_arg; + #if PY_MAJOR_VERSION < 3 + if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) { + while (*name) { + if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) + && _PyString_Eq(**name, key)) { + values[name-argnames] = value; + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + if ((**argname == key) || ( + (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) + && _PyString_Eq(**argname, key))) { + goto arg_passed_twice; + } + argname++; + } + } + } else + #endif + if (likely(PyUnicode_Check(key))) { + while (*name) { + int cmp = (**name == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 : + #endif + PyUnicode_Compare(**name, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) { + values[name-argnames] = value; + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + int cmp = (**argname == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 : + #endif + PyUnicode_Compare(**argname, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) goto arg_passed_twice; + argname++; + } + } + } else + goto invalid_keyword_type; + if (kwds2) { + if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; + } else { + goto invalid_keyword; + } + } + return 0; +arg_passed_twice: + __Pyx_RaiseDoubleKeywordsError(function_name, key); + goto bad; +invalid_keyword_type: + PyErr_Format(PyExc_TypeError, + "%.200s() keywords must be strings", function_name); + goto bad; +invalid_keyword: + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION < 3 + "%.200s() got an unexpected keyword argument '%.200s'", + function_name, PyString_AsString(key)); + #else + "%s() got an unexpected keyword argument '%U'", + function_name, key); + #endif +bad: + return -1; +} + +/* KeywordStringCheck */ +static int __Pyx_CheckKeywordStrings( + PyObject *kwdict, + const char* function_name, + int kw_allowed) +{ + PyObject* key = 0; + Py_ssize_t pos = 0; +#if CYTHON_COMPILING_IN_PYPY + if (!kw_allowed && PyDict_Next(kwdict, &pos, &key, 0)) + goto invalid_keyword; + return 1; +#else + while (PyDict_Next(kwdict, &pos, &key, 0)) { + #if PY_MAJOR_VERSION < 3 + if (unlikely(!PyString_Check(key))) + #endif + if (unlikely(!PyUnicode_Check(key))) + goto invalid_keyword_type; + } + if ((!kw_allowed) && unlikely(key)) + goto invalid_keyword; + return 1; +invalid_keyword_type: + PyErr_Format(PyExc_TypeError, + "%.200s() keywords must be strings", function_name); + return 0; +#endif +invalid_keyword: + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION < 3 + "%.200s() got an unexpected keyword argument '%.200s'", + function_name, PyString_AsString(key)); + #else + "%s() got an unexpected keyword argument '%U'", + function_name, key); + #endif + return 0; +} + +/* WriteUnraisableException */ +static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno, + CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename, + int full_traceback, CYTHON_UNUSED int nogil) { + PyObject *old_exc, *old_val, *old_tb; + PyObject *ctx; + __Pyx_PyThreadState_declare +#ifdef WITH_THREAD + PyGILState_STATE state; + if (nogil) + state = PyGILState_Ensure(); +#ifdef _MSC_VER + else state = (PyGILState_STATE)-1; +#endif +#endif + __Pyx_PyThreadState_assign + __Pyx_ErrFetch(&old_exc, &old_val, &old_tb); + if (full_traceback) { + Py_XINCREF(old_exc); + Py_XINCREF(old_val); + Py_XINCREF(old_tb); + __Pyx_ErrRestore(old_exc, old_val, old_tb); + PyErr_PrintEx(1); + } + #if PY_MAJOR_VERSION < 3 + ctx = PyString_FromString(name); + #else + ctx = PyUnicode_FromString(name); + #endif + __Pyx_ErrRestore(old_exc, old_val, old_tb); + if (!ctx) { + PyErr_WriteUnraisable(Py_None); + } else { + PyErr_WriteUnraisable(ctx); + Py_DECREF(ctx); + } +#ifdef WITH_THREAD + if (nogil) + PyGILState_Release(state); +#endif +} + +/* BytesEquals */ +static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { +#if CYTHON_COMPILING_IN_PYPY + return PyObject_RichCompareBool(s1, s2, equals); +#else + if (s1 == s2) { + return (equals == Py_EQ); + } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) { + const char *ps1, *ps2; + Py_ssize_t length = PyBytes_GET_SIZE(s1); + if (length != PyBytes_GET_SIZE(s2)) + return (equals == Py_NE); + ps1 = PyBytes_AS_STRING(s1); + ps2 = PyBytes_AS_STRING(s2); + if (ps1[0] != ps2[0]) { + return (equals == Py_NE); + } else if (length == 1) { + return (equals == Py_EQ); + } else { + int result; +#if CYTHON_USE_UNICODE_INTERNALS + Py_hash_t hash1, hash2; + hash1 = ((PyBytesObject*)s1)->ob_shash; + hash2 = ((PyBytesObject*)s2)->ob_shash; + if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { + return (equals == Py_NE); + } +#endif + result = memcmp(ps1, ps2, (size_t)length); + return (equals == Py_EQ) ? (result == 0) : (result != 0); + } + } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) { + return (equals == Py_NE); + } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) { + return (equals == Py_NE); + } else { + int result; + PyObject* py_result = PyObject_RichCompare(s1, s2, equals); + if (!py_result) + return -1; + result = __Pyx_PyObject_IsTrue(py_result); + Py_DECREF(py_result); + return result; + } +#endif +} + +/* UnicodeEquals */ +static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { +#if CYTHON_COMPILING_IN_PYPY + return PyObject_RichCompareBool(s1, s2, equals); +#else +#if PY_MAJOR_VERSION < 3 + PyObject* owned_ref = NULL; +#endif + int s1_is_unicode, s2_is_unicode; + if (s1 == s2) { + goto return_eq; + } + s1_is_unicode = PyUnicode_CheckExact(s1); + s2_is_unicode = PyUnicode_CheckExact(s2); +#if PY_MAJOR_VERSION < 3 + if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) { + owned_ref = PyUnicode_FromObject(s2); + if (unlikely(!owned_ref)) + return -1; + s2 = owned_ref; + s2_is_unicode = 1; + } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) { + owned_ref = PyUnicode_FromObject(s1); + if (unlikely(!owned_ref)) + return -1; + s1 = owned_ref; + s1_is_unicode = 1; + } else if (((!s2_is_unicode) & (!s1_is_unicode))) { + return __Pyx_PyBytes_Equals(s1, s2, equals); + } +#endif + if (s1_is_unicode & s2_is_unicode) { + Py_ssize_t length; + int kind; + void *data1, *data2; + if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0)) + return -1; + length = __Pyx_PyUnicode_GET_LENGTH(s1); + if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) { + goto return_ne; + } +#if CYTHON_USE_UNICODE_INTERNALS + { + Py_hash_t hash1, hash2; + #if CYTHON_PEP393_ENABLED + hash1 = ((PyASCIIObject*)s1)->hash; + hash2 = ((PyASCIIObject*)s2)->hash; + #else + hash1 = ((PyUnicodeObject*)s1)->hash; + hash2 = ((PyUnicodeObject*)s2)->hash; + #endif + if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { + goto return_ne; + } + } +#endif + kind = __Pyx_PyUnicode_KIND(s1); + if (kind != __Pyx_PyUnicode_KIND(s2)) { + goto return_ne; + } + data1 = __Pyx_PyUnicode_DATA(s1); + data2 = __Pyx_PyUnicode_DATA(s2); + if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) { + goto return_ne; + } else if (length == 1) { + goto return_eq; + } else { + int result = memcmp(data1, data2, (size_t)(length * kind)); + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_EQ) ? (result == 0) : (result != 0); + } + } else if ((s1 == Py_None) & s2_is_unicode) { + goto return_ne; + } else if ((s2 == Py_None) & s1_is_unicode) { + goto return_ne; + } else { + int result; + PyObject* py_result = PyObject_RichCompare(s1, s2, equals); + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + if (!py_result) + return -1; + result = __Pyx_PyObject_IsTrue(py_result); + Py_DECREF(py_result); + return result; + } +return_eq: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_EQ); +return_ne: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_NE); +#endif +} + +/* GetAttr */ +static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) { +#if CYTHON_USE_TYPE_SLOTS +#if PY_MAJOR_VERSION >= 3 + if (likely(PyUnicode_Check(n))) +#else + if (likely(PyString_Check(n))) +#endif + return __Pyx_PyObject_GetAttrStr(o, n); +#endif + return PyObject_GetAttr(o, n); +} + +/* GetAttr3 */ +static PyObject *__Pyx_GetAttr3Default(PyObject *d) { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) + return NULL; + __Pyx_PyErr_Clear(); + Py_INCREF(d); + return d; +} +static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) { + PyObject *r = __Pyx_GetAttr(o, n); + return (likely(r)) ? r : __Pyx_GetAttr3Default(d); +} + +/* ArgTypeTest */ +static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact) +{ + if (unlikely(!type)) { + PyErr_SetString(PyExc_SystemError, "Missing type object"); + return 0; + } + else if (exact) { + #if PY_MAJOR_VERSION == 2 + if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1; + #endif + } + else { + if (likely(__Pyx_TypeCheck(obj, type))) return 1; + } + PyErr_Format(PyExc_TypeError, + "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)", + name, type->tp_name, Py_TYPE(obj)->tp_name); + return 0; +} + +/* ExtTypeTest */ +static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { + if (unlikely(!type)) { + PyErr_SetString(PyExc_SystemError, "Missing type object"); + return 0; + } + if (likely(__Pyx_TypeCheck(obj, type))) + return 1; + PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s", + Py_TYPE(obj)->tp_name, type->tp_name); + return 0; +} + +/* PyObjectSetAttrStr */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) { + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_setattro)) + return tp->tp_setattro(obj, attr_name, value); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_setattr)) + return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value); +#endif + return PyObject_SetAttr(obj, attr_name, value); +} +#endif + +/* PyObject_GenericGetAttrNoDict */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) { + PyErr_Format(PyExc_AttributeError, +#if PY_MAJOR_VERSION >= 3 + "'%.50s' object has no attribute '%U'", + tp->tp_name, attr_name); +#else + "'%.50s' object has no attribute '%.400s'", + tp->tp_name, PyString_AS_STRING(attr_name)); +#endif + return NULL; +} +static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) { + PyObject *descr; + PyTypeObject *tp = Py_TYPE(obj); + if (unlikely(!PyString_Check(attr_name))) { + return PyObject_GenericGetAttr(obj, attr_name); + } + assert(!tp->tp_dictoffset); + descr = _PyType_Lookup(tp, attr_name); + if (unlikely(!descr)) { + return __Pyx_RaiseGenericGetAttributeError(tp, attr_name); + } + Py_INCREF(descr); + #if PY_MAJOR_VERSION < 3 + if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS))) + #endif + { + descrgetfunc f = Py_TYPE(descr)->tp_descr_get; + if (unlikely(f)) { + PyObject *res = f(descr, obj, (PyObject *)tp); + Py_DECREF(descr); + return res; + } + } + return descr; +} +#endif + +/* PyObject_GenericGetAttr */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) { + if (unlikely(Py_TYPE(obj)->tp_dictoffset)) { + return PyObject_GenericGetAttr(obj, attr_name); + } + return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name); +} +#endif + +/* SetVTable */ +static int __Pyx_SetVtable(PyObject *dict, void *vtable) { +#if PY_VERSION_HEX >= 0x02070000 + PyObject *ob = PyCapsule_New(vtable, 0, 0); +#else + PyObject *ob = PyCObject_FromVoidPtr(vtable, 0); +#endif + if (!ob) + goto bad; + if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0) + goto bad; + Py_DECREF(ob); + return 0; +bad: + Py_XDECREF(ob); + return -1; +} + +/* TypeImport */ +#ifndef __PYX_HAVE_RT_ImportType +#define __PYX_HAVE_RT_ImportType +static PyTypeObject *__Pyx_ImportType(PyObject *module, const char *module_name, const char *class_name, + size_t size, enum __Pyx_ImportType_CheckSize check_size) +{ + PyObject *result = 0; + char warning[200]; + Py_ssize_t basicsize; +#ifdef Py_LIMITED_API + PyObject *py_basicsize; +#endif + result = PyObject_GetAttrString(module, class_name); + if (!result) + goto bad; + if (!PyType_Check(result)) { + PyErr_Format(PyExc_TypeError, + "%.200s.%.200s is not a type object", + module_name, class_name); + goto bad; + } +#ifndef Py_LIMITED_API + basicsize = ((PyTypeObject *)result)->tp_basicsize; +#else + py_basicsize = PyObject_GetAttrString(result, "__basicsize__"); + if (!py_basicsize) + goto bad; + basicsize = PyLong_AsSsize_t(py_basicsize); + Py_DECREF(py_basicsize); + py_basicsize = 0; + if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred()) + goto bad; +#endif + if ((size_t)basicsize < size) { + PyErr_Format(PyExc_ValueError, + "%.200s.%.200s size changed, may indicate binary incompatibility. " + "Expected %zd from C header, got %zd from PyObject", + module_name, class_name, size, basicsize); + goto bad; + } + if (check_size == __Pyx_ImportType_CheckSize_Error && (size_t)basicsize != size) { + PyErr_Format(PyExc_ValueError, + "%.200s.%.200s size changed, may indicate binary incompatibility. " + "Expected %zd from C header, got %zd from PyObject", + module_name, class_name, size, basicsize); + goto bad; + } + else if (check_size == __Pyx_ImportType_CheckSize_Warn && (size_t)basicsize > size) { + PyOS_snprintf(warning, sizeof(warning), + "%s.%s size changed, may indicate binary incompatibility. " + "Expected %zd from C header, got %zd from PyObject", + module_name, class_name, size, basicsize); + if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad; + } + return (PyTypeObject *)result; +bad: + Py_XDECREF(result); + return NULL; +} +#endif + +/* GetNameInClass */ +static PyObject *__Pyx_GetGlobalNameAfterAttributeLookup(PyObject *name) { + PyObject *result; + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) + return NULL; + __Pyx_PyErr_Clear(); + __Pyx_GetModuleGlobalNameUncached(result, name); + return result; +} +static PyObject *__Pyx__GetNameInClass(PyObject *nmspace, PyObject *name) { + PyObject *result; + result = __Pyx_PyObject_GetAttrStr(nmspace, name); + if (!result) { + result = __Pyx_GetGlobalNameAfterAttributeLookup(name); + } + return result; +} + +/* Import */ +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { + PyObject *empty_list = 0; + PyObject *module = 0; + PyObject *global_dict = 0; + PyObject *empty_dict = 0; + PyObject *list; + #if PY_MAJOR_VERSION < 3 + PyObject *py_import; + py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); + if (!py_import) + goto bad; + #endif + if (from_list) + list = from_list; + else { + empty_list = PyList_New(0); + if (!empty_list) + goto bad; + list = empty_list; + } + global_dict = PyModule_GetDict(__pyx_m); + if (!global_dict) + goto bad; + empty_dict = PyDict_New(); + if (!empty_dict) + goto bad; + { + #if PY_MAJOR_VERSION >= 3 + if (level == -1) { + if (strchr(__Pyx_MODULE_NAME, '.')) { + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, 1); + if (!module) { + if (!PyErr_ExceptionMatches(PyExc_ImportError)) + goto bad; + PyErr_Clear(); + } + } + level = 0; + } + #endif + if (!module) { + #if PY_MAJOR_VERSION < 3 + PyObject *py_level = PyInt_FromLong(level); + if (!py_level) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, py_level, (PyObject *)NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, level); + #endif + } + } +bad: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(py_import); + #endif + Py_XDECREF(empty_list); + Py_XDECREF(empty_dict); + return module; +} + +/* ImportFrom */ +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { + PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); + if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_Format(PyExc_ImportError, + #if PY_MAJOR_VERSION < 3 + "cannot import name %.230s", PyString_AS_STRING(name)); + #else + "cannot import name %S", name); + #endif + } + return value; +} + +/* CLineInTraceback */ +#ifndef CYTHON_CLINE_IN_TRACEBACK +static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { + PyObject *use_cline; + PyObject *ptype, *pvalue, *ptraceback; +#if CYTHON_COMPILING_IN_CPYTHON + PyObject **cython_runtime_dict; +#endif + if (unlikely(!__pyx_cython_runtime)) { + return c_line; + } + __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); +#if CYTHON_COMPILING_IN_CPYTHON + cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); + if (likely(cython_runtime_dict)) { + __PYX_PY_DICT_LOOKUP_IF_MODIFIED( + use_cline, *cython_runtime_dict, + __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback)) + } else +#endif + { + PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback); + if (use_cline_obj) { + use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; + Py_DECREF(use_cline_obj); + } else { + PyErr_Clear(); + use_cline = NULL; + } + } + if (!use_cline) { + c_line = 0; + PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); + } + else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { + c_line = 0; + } + __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); + return c_line; +} +#endif + +/* CodeObjectCache */ +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { + int start = 0, mid = 0, end = count - 1; + if (end >= 0 && code_line > entries[end].code_line) { + return count; + } + while (start < end) { + mid = start + (end - start) / 2; + if (code_line < entries[mid].code_line) { + end = mid; + } else if (code_line > entries[mid].code_line) { + start = mid + 1; + } else { + return mid; + } + } + if (code_line <= entries[mid].code_line) { + return mid; + } else { + return mid + 1; + } +} +static PyCodeObject *__pyx_find_code_object(int code_line) { + PyCodeObject* code_object; + int pos; + if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { + return NULL; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { + return NULL; + } + code_object = __pyx_code_cache.entries[pos].code_object; + Py_INCREF(code_object); + return code_object; +} +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { + int pos, i; + __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; + if (unlikely(!code_line)) { + return; + } + if (unlikely(!entries)) { + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); + if (likely(entries)) { + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = 64; + __pyx_code_cache.count = 1; + entries[0].code_line = code_line; + entries[0].code_object = code_object; + Py_INCREF(code_object); + } + return; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { + PyCodeObject* tmp = entries[pos].code_object; + entries[pos].code_object = code_object; + Py_DECREF(tmp); + return; + } + if (__pyx_code_cache.count == __pyx_code_cache.max_count) { + int new_max = __pyx_code_cache.max_count + 64; + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( + __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry)); + if (unlikely(!entries)) { + return; + } + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = new_max; + } + for (i=__pyx_code_cache.count; i>pos; i--) { + entries[i] = entries[i-1]; + } + entries[pos].code_line = code_line; + entries[pos].code_object = code_object; + __pyx_code_cache.count++; + Py_INCREF(code_object); +} + +/* AddTraceback */ +#include "compile.h" +#include "frameobject.h" +#include "traceback.h" +static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( + const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyObject *py_srcfile = 0; + PyObject *py_funcname = 0; + #if PY_MAJOR_VERSION < 3 + py_srcfile = PyString_FromString(filename); + #else + py_srcfile = PyUnicode_FromString(filename); + #endif + if (!py_srcfile) goto bad; + if (c_line) { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + #else + py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + #endif + } + else { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromString(funcname); + #else + py_funcname = PyUnicode_FromString(funcname); + #endif + } + if (!py_funcname) goto bad; + py_code = __Pyx_PyCode_New( + 0, + 0, + 0, + 0, + 0, + __pyx_empty_bytes, /*PyObject *code,*/ + __pyx_empty_tuple, /*PyObject *consts,*/ + __pyx_empty_tuple, /*PyObject *names,*/ + __pyx_empty_tuple, /*PyObject *varnames,*/ + __pyx_empty_tuple, /*PyObject *freevars,*/ + __pyx_empty_tuple, /*PyObject *cellvars,*/ + py_srcfile, /*PyObject *filename,*/ + py_funcname, /*PyObject *name,*/ + py_line, + __pyx_empty_bytes /*PyObject *lnotab*/ + ); + Py_DECREF(py_srcfile); + Py_DECREF(py_funcname); + return py_code; +bad: + Py_XDECREF(py_srcfile); + Py_XDECREF(py_funcname); + return NULL; +} +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyFrameObject *py_frame = 0; + PyThreadState *tstate = __Pyx_PyThreadState_Current; + if (c_line) { + c_line = __Pyx_CLineForTraceback(tstate, c_line); + } + py_code = __pyx_find_code_object(c_line ? -c_line : py_line); + if (!py_code) { + py_code = __Pyx_CreateCodeObjectForTraceback( + funcname, c_line, py_line, filename); + if (!py_code) goto bad; + __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); + } + py_frame = PyFrame_New( + tstate, /*PyThreadState *tstate,*/ + py_code, /*PyCodeObject *code,*/ + __pyx_d, /*PyObject *globals,*/ + 0 /*PyObject *locals*/ + ); + if (!py_frame) goto bad; + __Pyx_PyFrame_SetLineNumber(py_frame, py_line); + PyTraceBack_Here(py_frame); +bad: + Py_XDECREF(py_code); + Py_XDECREF(py_frame); +} + +/* CIntToPy */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { + const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(long) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(long) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(long) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(long), + little, !is_unsigned); + } +} + +/* CIntToPy */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { + const int neg_one = (int) ((int) 0 - (int) 1), const_zero = (int) 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(int) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(int) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(int) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(int), + little, !is_unsigned); + } +} + +/* CIntFromPyVerify */ +#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ + __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) +#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ + __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) +#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ + {\ + func_type value = func_value;\ + if (sizeof(target_type) < sizeof(func_type)) {\ + if (unlikely(value != (func_type) (target_type) value)) {\ + func_type zero = 0;\ + if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ + return (target_type) -1;\ + if (is_unsigned && unlikely(value < zero))\ + goto raise_neg_overflow;\ + else\ + goto raise_overflow;\ + }\ + }\ + return (target_type) value;\ + } + +/* CIntToPy */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_int(unsigned int value) { + const unsigned int neg_one = (unsigned int) ((unsigned int) 0 - (unsigned int) 1), const_zero = (unsigned int) 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(unsigned int) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(unsigned int) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(unsigned int) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(unsigned int) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(unsigned int) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(unsigned int), + little, !is_unsigned); + } +} + +/* CIntFromPy */ +static CYTHON_INLINE unsigned int __Pyx_PyInt_As_unsigned_int(PyObject *x) { + const unsigned int neg_one = (unsigned int) ((unsigned int) 0 - (unsigned int) 1), const_zero = (unsigned int) 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(unsigned int) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(unsigned int, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (unsigned int) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (unsigned int) 0; + case 1: __PYX_VERIFY_RETURN_INT(unsigned int, digit, digits[0]) + case 2: + if (8 * sizeof(unsigned int) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(unsigned int) >= 2 * PyLong_SHIFT) { + return (unsigned int) (((((unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0])); + } + } + break; + case 3: + if (8 * sizeof(unsigned int) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(unsigned int) >= 3 * PyLong_SHIFT) { + return (unsigned int) (((((((unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0])); + } + } + break; + case 4: + if (8 * sizeof(unsigned int) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(unsigned int) >= 4 * PyLong_SHIFT) { + return (unsigned int) (((((((((unsigned int)digits[3]) << PyLong_SHIFT) | (unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0])); + } + } + break; + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (unsigned int) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if (sizeof(unsigned int) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(unsigned int, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(unsigned int) <= sizeof(unsigned PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(unsigned int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (unsigned int) 0; + case -1: __PYX_VERIFY_RETURN_INT(unsigned int, sdigit, (sdigit) (-(sdigit)digits[0])) + case 1: __PYX_VERIFY_RETURN_INT(unsigned int, digit, +digits[0]) + case -2: + if (8 * sizeof(unsigned int) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(unsigned int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(unsigned int) - 1 > 2 * PyLong_SHIFT) { + return (unsigned int) (((unsigned int)-1)*(((((unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0]))); + } + } + break; + case 2: + if (8 * sizeof(unsigned int) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(unsigned int) - 1 > 2 * PyLong_SHIFT) { + return (unsigned int) ((((((unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0]))); + } + } + break; + case -3: + if (8 * sizeof(unsigned int) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(unsigned int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(unsigned int) - 1 > 3 * PyLong_SHIFT) { + return (unsigned int) (((unsigned int)-1)*(((((((unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0]))); + } + } + break; + case 3: + if (8 * sizeof(unsigned int) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(unsigned int) - 1 > 3 * PyLong_SHIFT) { + return (unsigned int) ((((((((unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0]))); + } + } + break; + case -4: + if (8 * sizeof(unsigned int) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(unsigned int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(unsigned int) - 1 > 4 * PyLong_SHIFT) { + return (unsigned int) (((unsigned int)-1)*(((((((((unsigned int)digits[3]) << PyLong_SHIFT) | (unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0]))); + } + } + break; + case 4: + if (8 * sizeof(unsigned int) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(unsigned int) - 1 > 4 * PyLong_SHIFT) { + return (unsigned int) ((((((((((unsigned int)digits[3]) << PyLong_SHIFT) | (unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0]))); + } + } + break; + } +#endif + if (sizeof(unsigned int) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(unsigned int, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(unsigned int) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(unsigned int, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + unsigned int val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (unsigned int) -1; + } + } else { + unsigned int val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (unsigned int) -1; + val = __Pyx_PyInt_As_unsigned_int(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to unsigned int"); + return (unsigned int) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to unsigned int"); + return (unsigned int) -1; +} + +/* CIntFromPy */ +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { + const int neg_one = (int) ((int) 0 - (int) 1), const_zero = (int) 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(int) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (int) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (int) 0; + case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0]) + case 2: + if (8 * sizeof(int) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) { + return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + case 3: + if (8 * sizeof(int) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) { + return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + case 4: + if (8 * sizeof(int) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) { + return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (int) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if (sizeof(int) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (int) 0; + case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0])) + case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0]) + case -2: + if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { + return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 2: + if (8 * sizeof(int) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { + return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case -3: + if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { + return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 3: + if (8 * sizeof(int) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { + return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case -4: + if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { + return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 4: + if (8 * sizeof(int) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { + return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + } +#endif + if (sizeof(int) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + int val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (int) -1; + } + } else { + int val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (int) -1; + val = __Pyx_PyInt_As_int(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to int"); + return (int) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to int"); + return (int) -1; +} + +/* CIntFromPy */ +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { + const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(long) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (long) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (long) 0; + case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0]) + case 2: + if (8 * sizeof(long) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) { + return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + case 3: + if (8 * sizeof(long) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) { + return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + case 4: + if (8 * sizeof(long) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) { + return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (long) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if (sizeof(long) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (long) 0; + case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0])) + case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0]) + case -2: + if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 2: + if (8 * sizeof(long) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case -3: + if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 3: + if (8 * sizeof(long) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case -4: + if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 4: + if (8 * sizeof(long) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + } +#endif + if (sizeof(long) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + long val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (long) -1; + } + } else { + long val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (long) -1; + val = __Pyx_PyInt_As_long(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to long"); + return (long) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to long"); + return (long) -1; +} + +/* FastTypeChecks */ +#if CYTHON_COMPILING_IN_CPYTHON +static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) { + while (a) { + a = a->tp_base; + if (a == b) + return 1; + } + return b == &PyBaseObject_Type; +} +static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) { + PyObject *mro; + if (a == b) return 1; + mro = a->tp_mro; + if (likely(mro)) { + Py_ssize_t i, n; + n = PyTuple_GET_SIZE(mro); + for (i = 0; i < n; i++) { + if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b) + return 1; + } + return 0; + } + return __Pyx_InBases(a, b); +} +#if PY_MAJOR_VERSION == 2 +static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { + PyObject *exception, *value, *tb; + int res; + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ErrFetch(&exception, &value, &tb); + res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; + if (unlikely(res == -1)) { + PyErr_WriteUnraisable(err); + res = 0; + } + if (!res) { + res = PyObject_IsSubclass(err, exc_type2); + if (unlikely(res == -1)) { + PyErr_WriteUnraisable(err); + res = 0; + } + } + __Pyx_ErrRestore(exception, value, tb); + return res; +} +#else +static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { + int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0; + if (!res) { + res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); + } + return res; +} +#endif +static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { + Py_ssize_t i, n; + assert(PyExceptionClass_Check(exc_type)); + n = PyTuple_GET_SIZE(tuple); +#if PY_MAJOR_VERSION >= 3 + for (i=0; itp_name); + if (cached_type) { + if (!PyType_Check((PyObject*)cached_type)) { + PyErr_Format(PyExc_TypeError, + "Shared Cython type %.200s is not a type object", + type->tp_name); + goto bad; + } + if (cached_type->tp_basicsize != type->tp_basicsize) { + PyErr_Format(PyExc_TypeError, + "Shared Cython type %.200s has the wrong size, try recompiling", + type->tp_name); + goto bad; + } + } else { + if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; + PyErr_Clear(); + if (PyType_Ready(type) < 0) goto bad; + if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0) + goto bad; + Py_INCREF(type); + cached_type = type; + } +done: + Py_DECREF(fake_module); + return cached_type; +bad: + Py_XDECREF(cached_type); + cached_type = NULL; + goto done; +} + +/* PyObjectGetMethod */ +static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method) { + PyObject *attr; +#if CYTHON_UNPACK_METHODS && CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_PYTYPE_LOOKUP + PyTypeObject *tp = Py_TYPE(obj); + PyObject *descr; + descrgetfunc f = NULL; + PyObject **dictptr, *dict; + int meth_found = 0; + assert (*method == NULL); + if (unlikely(tp->tp_getattro != PyObject_GenericGetAttr)) { + attr = __Pyx_PyObject_GetAttrStr(obj, name); + goto try_unpack; + } + if (unlikely(tp->tp_dict == NULL) && unlikely(PyType_Ready(tp) < 0)) { + return 0; + } + descr = _PyType_Lookup(tp, name); + if (likely(descr != NULL)) { + Py_INCREF(descr); +#if PY_MAJOR_VERSION >= 3 + #ifdef __Pyx_CyFunction_USED + if (likely(PyFunction_Check(descr) || (Py_TYPE(descr) == &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr))) + #else + if (likely(PyFunction_Check(descr) || (Py_TYPE(descr) == &PyMethodDescr_Type))) + #endif +#else + #ifdef __Pyx_CyFunction_USED + if (likely(PyFunction_Check(descr) || __Pyx_CyFunction_Check(descr))) + #else + if (likely(PyFunction_Check(descr))) + #endif +#endif + { + meth_found = 1; + } else { + f = Py_TYPE(descr)->tp_descr_get; + if (f != NULL && PyDescr_IsData(descr)) { + attr = f(descr, obj, (PyObject *)Py_TYPE(obj)); + Py_DECREF(descr); + goto try_unpack; + } + } + } + dictptr = _PyObject_GetDictPtr(obj); + if (dictptr != NULL && (dict = *dictptr) != NULL) { + Py_INCREF(dict); + attr = __Pyx_PyDict_GetItemStr(dict, name); + if (attr != NULL) { + Py_INCREF(attr); + Py_DECREF(dict); + Py_XDECREF(descr); + goto try_unpack; + } + Py_DECREF(dict); + } + if (meth_found) { + *method = descr; + return 1; + } + if (f != NULL) { + attr = f(descr, obj, (PyObject *)Py_TYPE(obj)); + Py_DECREF(descr); + goto try_unpack; + } + if (descr != NULL) { + *method = descr; + return 0; + } + PyErr_Format(PyExc_AttributeError, +#if PY_MAJOR_VERSION >= 3 + "'%.50s' object has no attribute '%U'", + tp->tp_name, name); +#else + "'%.50s' object has no attribute '%.400s'", + tp->tp_name, PyString_AS_STRING(name)); +#endif + return 0; +#else + attr = __Pyx_PyObject_GetAttrStr(obj, name); + goto try_unpack; +#endif +try_unpack: +#if CYTHON_UNPACK_METHODS + if (likely(attr) && PyMethod_Check(attr) && likely(PyMethod_GET_SELF(attr) == obj)) { + PyObject *function = PyMethod_GET_FUNCTION(attr); + Py_INCREF(function); + Py_DECREF(attr); + *method = function; + return 1; + } +#endif + *method = attr; + return 0; +} + +/* PyObjectCallMethod1 */ +static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg) { + PyObject *result = __Pyx_PyObject_CallOneArg(method, arg); + Py_DECREF(method); + return result; +} +static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) { + PyObject *method = NULL, *result; + int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method); + if (likely(is_method)) { + result = __Pyx_PyObject_Call2Args(method, obj, arg); + Py_DECREF(method); + return result; + } + if (unlikely(!method)) return NULL; + return __Pyx__PyObject_CallMethod1(method, arg); +} + +/* CoroutineBase */ +#include +#include +#define __Pyx_Coroutine_Undelegate(gen) Py_CLEAR((gen)->yieldfrom) +static int __Pyx_PyGen__FetchStopIterationValue(CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject **pvalue) { + PyObject *et, *ev, *tb; + PyObject *value = NULL; + __Pyx_ErrFetch(&et, &ev, &tb); + if (!et) { + Py_XDECREF(tb); + Py_XDECREF(ev); + Py_INCREF(Py_None); + *pvalue = Py_None; + return 0; + } + if (likely(et == PyExc_StopIteration)) { + if (!ev) { + Py_INCREF(Py_None); + value = Py_None; + } +#if PY_VERSION_HEX >= 0x030300A0 + else if (Py_TYPE(ev) == (PyTypeObject*)PyExc_StopIteration) { + value = ((PyStopIterationObject *)ev)->value; + Py_INCREF(value); + Py_DECREF(ev); + } +#endif + else if (unlikely(PyTuple_Check(ev))) { + if (PyTuple_GET_SIZE(ev) >= 1) { +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + value = PyTuple_GET_ITEM(ev, 0); + Py_INCREF(value); +#else + value = PySequence_ITEM(ev, 0); +#endif + } else { + Py_INCREF(Py_None); + value = Py_None; + } + Py_DECREF(ev); + } + else if (!__Pyx_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration)) { + value = ev; + } + if (likely(value)) { + Py_XDECREF(tb); + Py_DECREF(et); + *pvalue = value; + return 0; + } + } else if (!__Pyx_PyErr_GivenExceptionMatches(et, PyExc_StopIteration)) { + __Pyx_ErrRestore(et, ev, tb); + return -1; + } + PyErr_NormalizeException(&et, &ev, &tb); + if (unlikely(!PyObject_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration))) { + __Pyx_ErrRestore(et, ev, tb); + return -1; + } + Py_XDECREF(tb); + Py_DECREF(et); +#if PY_VERSION_HEX >= 0x030300A0 + value = ((PyStopIterationObject *)ev)->value; + Py_INCREF(value); + Py_DECREF(ev); +#else + { + PyObject* args = __Pyx_PyObject_GetAttrStr(ev, __pyx_n_s_args); + Py_DECREF(ev); + if (likely(args)) { + value = PySequence_GetItem(args, 0); + Py_DECREF(args); + } + if (unlikely(!value)) { + __Pyx_ErrRestore(NULL, NULL, NULL); + Py_INCREF(Py_None); + value = Py_None; + } + } +#endif + *pvalue = value; + return 0; +} +static CYTHON_INLINE +void __Pyx_Coroutine_ExceptionClear(__Pyx_ExcInfoStruct *exc_state) { + PyObject *t, *v, *tb; + t = exc_state->exc_type; + v = exc_state->exc_value; + tb = exc_state->exc_traceback; + exc_state->exc_type = NULL; + exc_state->exc_value = NULL; + exc_state->exc_traceback = NULL; + Py_XDECREF(t); + Py_XDECREF(v); + Py_XDECREF(tb); +} +#define __Pyx_Coroutine_AlreadyRunningError(gen) (__Pyx__Coroutine_AlreadyRunningError(gen), (PyObject*)NULL) +static void __Pyx__Coroutine_AlreadyRunningError(CYTHON_UNUSED __pyx_CoroutineObject *gen) { + const char *msg; + if ((0)) { + #ifdef __Pyx_Coroutine_USED + } else if (__Pyx_Coroutine_Check((PyObject*)gen)) { + msg = "coroutine already executing"; + #endif + #ifdef __Pyx_AsyncGen_USED + } else if (__Pyx_AsyncGen_CheckExact((PyObject*)gen)) { + msg = "async generator already executing"; + #endif + } else { + msg = "generator already executing"; + } + PyErr_SetString(PyExc_ValueError, msg); +} +#define __Pyx_Coroutine_NotStartedError(gen) (__Pyx__Coroutine_NotStartedError(gen), (PyObject*)NULL) +static void __Pyx__Coroutine_NotStartedError(CYTHON_UNUSED PyObject *gen) { + const char *msg; + if ((0)) { + #ifdef __Pyx_Coroutine_USED + } else if (__Pyx_Coroutine_Check(gen)) { + msg = "can't send non-None value to a just-started coroutine"; + #endif + #ifdef __Pyx_AsyncGen_USED + } else if (__Pyx_AsyncGen_CheckExact(gen)) { + msg = "can't send non-None value to a just-started async generator"; + #endif + } else { + msg = "can't send non-None value to a just-started generator"; + } + PyErr_SetString(PyExc_TypeError, msg); +} +#define __Pyx_Coroutine_AlreadyTerminatedError(gen, value, closing) (__Pyx__Coroutine_AlreadyTerminatedError(gen, value, closing), (PyObject*)NULL) +static void __Pyx__Coroutine_AlreadyTerminatedError(CYTHON_UNUSED PyObject *gen, PyObject *value, CYTHON_UNUSED int closing) { + #ifdef __Pyx_Coroutine_USED + if (!closing && __Pyx_Coroutine_Check(gen)) { + PyErr_SetString(PyExc_RuntimeError, "cannot reuse already awaited coroutine"); + } else + #endif + if (value) { + #ifdef __Pyx_AsyncGen_USED + if (__Pyx_AsyncGen_CheckExact(gen)) + PyErr_SetNone(__Pyx_PyExc_StopAsyncIteration); + else + #endif + PyErr_SetNone(PyExc_StopIteration); + } +} +static +PyObject *__Pyx_Coroutine_SendEx(__pyx_CoroutineObject *self, PyObject *value, int closing) { + __Pyx_PyThreadState_declare + PyThreadState *tstate; + __Pyx_ExcInfoStruct *exc_state; + PyObject *retval; + assert(!self->is_running); + if (unlikely(self->resume_label == 0)) { + if (unlikely(value && value != Py_None)) { + return __Pyx_Coroutine_NotStartedError((PyObject*)self); + } + } + if (unlikely(self->resume_label == -1)) { + return __Pyx_Coroutine_AlreadyTerminatedError((PyObject*)self, value, closing); + } +#if CYTHON_FAST_THREAD_STATE + __Pyx_PyThreadState_assign + tstate = __pyx_tstate; +#else + tstate = __Pyx_PyThreadState_Current; +#endif + exc_state = &self->gi_exc_state; + if (exc_state->exc_type) { + #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_PYSTON + #else + if (exc_state->exc_traceback) { + PyTracebackObject *tb = (PyTracebackObject *) exc_state->exc_traceback; + PyFrameObject *f = tb->tb_frame; + Py_XINCREF(tstate->frame); + assert(f->f_back == NULL); + f->f_back = tstate->frame; + } + #endif + } +#if CYTHON_USE_EXC_INFO_STACK + exc_state->previous_item = tstate->exc_info; + tstate->exc_info = exc_state; +#else + if (exc_state->exc_type) { + __Pyx_ExceptionSwap(&exc_state->exc_type, &exc_state->exc_value, &exc_state->exc_traceback); + } else { + __Pyx_Coroutine_ExceptionClear(exc_state); + __Pyx_ExceptionSave(&exc_state->exc_type, &exc_state->exc_value, &exc_state->exc_traceback); + } +#endif + self->is_running = 1; + retval = self->body((PyObject *) self, tstate, value); + self->is_running = 0; +#if CYTHON_USE_EXC_INFO_STACK + exc_state = &self->gi_exc_state; + tstate->exc_info = exc_state->previous_item; + exc_state->previous_item = NULL; + __Pyx_Coroutine_ResetFrameBackpointer(exc_state); +#endif + return retval; +} +static CYTHON_INLINE void __Pyx_Coroutine_ResetFrameBackpointer(__Pyx_ExcInfoStruct *exc_state) { + PyObject *exc_tb = exc_state->exc_traceback; + if (likely(exc_tb)) { +#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_PYSTON +#else + PyTracebackObject *tb = (PyTracebackObject *) exc_tb; + PyFrameObject *f = tb->tb_frame; + Py_CLEAR(f->f_back); +#endif + } +} +static CYTHON_INLINE +PyObject *__Pyx_Coroutine_MethodReturn(CYTHON_UNUSED PyObject* gen, PyObject *retval) { + if (unlikely(!retval)) { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + if (!__Pyx_PyErr_Occurred()) { + PyObject *exc = PyExc_StopIteration; + #ifdef __Pyx_AsyncGen_USED + if (__Pyx_AsyncGen_CheckExact(gen)) + exc = __Pyx_PyExc_StopAsyncIteration; + #endif + __Pyx_PyErr_SetNone(exc); + } + } + return retval; +} +static CYTHON_INLINE +PyObject *__Pyx_Coroutine_FinishDelegation(__pyx_CoroutineObject *gen) { + PyObject *ret; + PyObject *val = NULL; + __Pyx_Coroutine_Undelegate(gen); + __Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, &val); + ret = __Pyx_Coroutine_SendEx(gen, val, 0); + Py_XDECREF(val); + return ret; +} +static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value) { + PyObject *retval; + __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self; + PyObject *yf = gen->yieldfrom; + if (unlikely(gen->is_running)) + return __Pyx_Coroutine_AlreadyRunningError(gen); + if (yf) { + PyObject *ret; + gen->is_running = 1; + #ifdef __Pyx_Generator_USED + if (__Pyx_Generator_CheckExact(yf)) { + ret = __Pyx_Coroutine_Send(yf, value); + } else + #endif + #ifdef __Pyx_Coroutine_USED + if (__Pyx_Coroutine_Check(yf)) { + ret = __Pyx_Coroutine_Send(yf, value); + } else + #endif + #ifdef __Pyx_AsyncGen_USED + if (__pyx_PyAsyncGenASend_CheckExact(yf)) { + ret = __Pyx_async_gen_asend_send(yf, value); + } else + #endif + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3) + if (PyGen_CheckExact(yf)) { + ret = _PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value); + } else + #endif + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03050000 && defined(PyCoro_CheckExact) && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3) + if (PyCoro_CheckExact(yf)) { + ret = _PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value); + } else + #endif + { + if (value == Py_None) + ret = Py_TYPE(yf)->tp_iternext(yf); + else + ret = __Pyx_PyObject_CallMethod1(yf, __pyx_n_s_send, value); + } + gen->is_running = 0; + if (likely(ret)) { + return ret; + } + retval = __Pyx_Coroutine_FinishDelegation(gen); + } else { + retval = __Pyx_Coroutine_SendEx(gen, value, 0); + } + return __Pyx_Coroutine_MethodReturn(self, retval); +} +static int __Pyx_Coroutine_CloseIter(__pyx_CoroutineObject *gen, PyObject *yf) { + PyObject *retval = NULL; + int err = 0; + #ifdef __Pyx_Generator_USED + if (__Pyx_Generator_CheckExact(yf)) { + retval = __Pyx_Coroutine_Close(yf); + if (!retval) + return -1; + } else + #endif + #ifdef __Pyx_Coroutine_USED + if (__Pyx_Coroutine_Check(yf)) { + retval = __Pyx_Coroutine_Close(yf); + if (!retval) + return -1; + } else + if (__Pyx_CoroutineAwait_CheckExact(yf)) { + retval = __Pyx_CoroutineAwait_Close((__pyx_CoroutineAwaitObject*)yf, NULL); + if (!retval) + return -1; + } else + #endif + #ifdef __Pyx_AsyncGen_USED + if (__pyx_PyAsyncGenASend_CheckExact(yf)) { + retval = __Pyx_async_gen_asend_close(yf, NULL); + } else + if (__pyx_PyAsyncGenAThrow_CheckExact(yf)) { + retval = __Pyx_async_gen_athrow_close(yf, NULL); + } else + #endif + { + PyObject *meth; + gen->is_running = 1; + meth = __Pyx_PyObject_GetAttrStr(yf, __pyx_n_s_close); + if (unlikely(!meth)) { + if (!PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_WriteUnraisable(yf); + } + PyErr_Clear(); + } else { + retval = PyObject_CallFunction(meth, NULL); + Py_DECREF(meth); + if (!retval) + err = -1; + } + gen->is_running = 0; + } + Py_XDECREF(retval); + return err; +} +static PyObject *__Pyx_Generator_Next(PyObject *self) { + __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self; + PyObject *yf = gen->yieldfrom; + if (unlikely(gen->is_running)) + return __Pyx_Coroutine_AlreadyRunningError(gen); + if (yf) { + PyObject *ret; + gen->is_running = 1; + #ifdef __Pyx_Generator_USED + if (__Pyx_Generator_CheckExact(yf)) { + ret = __Pyx_Generator_Next(yf); + } else + #endif + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3) + if (PyGen_CheckExact(yf)) { + ret = _PyGen_Send((PyGenObject*)yf, NULL); + } else + #endif + #ifdef __Pyx_Coroutine_USED + if (__Pyx_Coroutine_Check(yf)) { + ret = __Pyx_Coroutine_Send(yf, Py_None); + } else + #endif + ret = Py_TYPE(yf)->tp_iternext(yf); + gen->is_running = 0; + if (likely(ret)) { + return ret; + } + return __Pyx_Coroutine_FinishDelegation(gen); + } + return __Pyx_Coroutine_SendEx(gen, Py_None, 0); +} +static PyObject *__Pyx_Coroutine_Close_Method(PyObject *self, CYTHON_UNUSED PyObject *arg) { + return __Pyx_Coroutine_Close(self); +} +static PyObject *__Pyx_Coroutine_Close(PyObject *self) { + __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self; + PyObject *retval, *raised_exception; + PyObject *yf = gen->yieldfrom; + int err = 0; + if (unlikely(gen->is_running)) + return __Pyx_Coroutine_AlreadyRunningError(gen); + if (yf) { + Py_INCREF(yf); + err = __Pyx_Coroutine_CloseIter(gen, yf); + __Pyx_Coroutine_Undelegate(gen); + Py_DECREF(yf); + } + if (err == 0) + PyErr_SetNone(PyExc_GeneratorExit); + retval = __Pyx_Coroutine_SendEx(gen, NULL, 1); + if (unlikely(retval)) { + const char *msg; + Py_DECREF(retval); + if ((0)) { + #ifdef __Pyx_Coroutine_USED + } else if (__Pyx_Coroutine_Check(self)) { + msg = "coroutine ignored GeneratorExit"; + #endif + #ifdef __Pyx_AsyncGen_USED + } else if (__Pyx_AsyncGen_CheckExact(self)) { +#if PY_VERSION_HEX < 0x03060000 + msg = "async generator ignored GeneratorExit - might require Python 3.6+ finalisation (PEP 525)"; +#else + msg = "async generator ignored GeneratorExit"; +#endif + #endif + } else { + msg = "generator ignored GeneratorExit"; + } + PyErr_SetString(PyExc_RuntimeError, msg); + return NULL; + } + raised_exception = PyErr_Occurred(); + if (likely(!raised_exception || __Pyx_PyErr_GivenExceptionMatches2(raised_exception, PyExc_GeneratorExit, PyExc_StopIteration))) { + if (raised_exception) PyErr_Clear(); + Py_INCREF(Py_None); + return Py_None; + } + return NULL; +} +static PyObject *__Pyx__Coroutine_Throw(PyObject *self, PyObject *typ, PyObject *val, PyObject *tb, + PyObject *args, int close_on_genexit) { + __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self; + PyObject *yf = gen->yieldfrom; + if (unlikely(gen->is_running)) + return __Pyx_Coroutine_AlreadyRunningError(gen); + if (yf) { + PyObject *ret; + Py_INCREF(yf); + if (__Pyx_PyErr_GivenExceptionMatches(typ, PyExc_GeneratorExit) && close_on_genexit) { + int err = __Pyx_Coroutine_CloseIter(gen, yf); + Py_DECREF(yf); + __Pyx_Coroutine_Undelegate(gen); + if (err < 0) + return __Pyx_Coroutine_MethodReturn(self, __Pyx_Coroutine_SendEx(gen, NULL, 0)); + goto throw_here; + } + gen->is_running = 1; + if (0 + #ifdef __Pyx_Generator_USED + || __Pyx_Generator_CheckExact(yf) + #endif + #ifdef __Pyx_Coroutine_USED + || __Pyx_Coroutine_Check(yf) + #endif + ) { + ret = __Pyx__Coroutine_Throw(yf, typ, val, tb, args, close_on_genexit); + #ifdef __Pyx_Coroutine_USED + } else if (__Pyx_CoroutineAwait_CheckExact(yf)) { + ret = __Pyx__Coroutine_Throw(((__pyx_CoroutineAwaitObject*)yf)->coroutine, typ, val, tb, args, close_on_genexit); + #endif + } else { + PyObject *meth = __Pyx_PyObject_GetAttrStr(yf, __pyx_n_s_throw); + if (unlikely(!meth)) { + Py_DECREF(yf); + if (!PyErr_ExceptionMatches(PyExc_AttributeError)) { + gen->is_running = 0; + return NULL; + } + PyErr_Clear(); + __Pyx_Coroutine_Undelegate(gen); + gen->is_running = 0; + goto throw_here; + } + if (likely(args)) { + ret = PyObject_CallObject(meth, args); + } else { + ret = PyObject_CallFunctionObjArgs(meth, typ, val, tb, NULL); + } + Py_DECREF(meth); + } + gen->is_running = 0; + Py_DECREF(yf); + if (!ret) { + ret = __Pyx_Coroutine_FinishDelegation(gen); + } + return __Pyx_Coroutine_MethodReturn(self, ret); + } +throw_here: + __Pyx_Raise(typ, val, tb, NULL); + return __Pyx_Coroutine_MethodReturn(self, __Pyx_Coroutine_SendEx(gen, NULL, 0)); +} +static PyObject *__Pyx_Coroutine_Throw(PyObject *self, PyObject *args) { + PyObject *typ; + PyObject *val = NULL; + PyObject *tb = NULL; + if (!PyArg_UnpackTuple(args, (char *)"throw", 1, 3, &typ, &val, &tb)) + return NULL; + return __Pyx__Coroutine_Throw(self, typ, val, tb, args, 1); +} +static CYTHON_INLINE int __Pyx_Coroutine_traverse_excstate(__Pyx_ExcInfoStruct *exc_state, visitproc visit, void *arg) { + Py_VISIT(exc_state->exc_type); + Py_VISIT(exc_state->exc_value); + Py_VISIT(exc_state->exc_traceback); + return 0; +} +static int __Pyx_Coroutine_traverse(__pyx_CoroutineObject *gen, visitproc visit, void *arg) { + Py_VISIT(gen->closure); + Py_VISIT(gen->classobj); + Py_VISIT(gen->yieldfrom); + return __Pyx_Coroutine_traverse_excstate(&gen->gi_exc_state, visit, arg); +} +static int __Pyx_Coroutine_clear(PyObject *self) { + __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self; + Py_CLEAR(gen->closure); + Py_CLEAR(gen->classobj); + Py_CLEAR(gen->yieldfrom); + __Pyx_Coroutine_ExceptionClear(&gen->gi_exc_state); +#ifdef __Pyx_AsyncGen_USED + if (__Pyx_AsyncGen_CheckExact(self)) { + Py_CLEAR(((__pyx_PyAsyncGenObject*)gen)->ag_finalizer); + } +#endif + Py_CLEAR(gen->gi_code); + Py_CLEAR(gen->gi_name); + Py_CLEAR(gen->gi_qualname); + Py_CLEAR(gen->gi_modulename); + return 0; +} +static void __Pyx_Coroutine_dealloc(PyObject *self) { + __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self; + PyObject_GC_UnTrack(gen); + if (gen->gi_weakreflist != NULL) + PyObject_ClearWeakRefs(self); + if (gen->resume_label >= 0) { + PyObject_GC_Track(self); +#if PY_VERSION_HEX >= 0x030400a1 && CYTHON_USE_TP_FINALIZE + if (PyObject_CallFinalizerFromDealloc(self)) +#else + Py_TYPE(gen)->tp_del(self); + if (self->ob_refcnt > 0) +#endif + { + return; + } + PyObject_GC_UnTrack(self); + } +#ifdef __Pyx_AsyncGen_USED + if (__Pyx_AsyncGen_CheckExact(self)) { + /* We have to handle this case for asynchronous generators + right here, because this code has to be between UNTRACK + and GC_Del. */ + Py_CLEAR(((__pyx_PyAsyncGenObject*)self)->ag_finalizer); + } +#endif + __Pyx_Coroutine_clear(self); + PyObject_GC_Del(gen); +} +static void __Pyx_Coroutine_del(PyObject *self) { + PyObject *error_type, *error_value, *error_traceback; + __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self; + __Pyx_PyThreadState_declare + if (gen->resume_label < 0) { + return; + } +#if !CYTHON_USE_TP_FINALIZE + assert(self->ob_refcnt == 0); + self->ob_refcnt = 1; +#endif + __Pyx_PyThreadState_assign + __Pyx_ErrFetch(&error_type, &error_value, &error_traceback); +#ifdef __Pyx_AsyncGen_USED + if (__Pyx_AsyncGen_CheckExact(self)) { + __pyx_PyAsyncGenObject *agen = (__pyx_PyAsyncGenObject*)self; + PyObject *finalizer = agen->ag_finalizer; + if (finalizer && !agen->ag_closed) { + PyObject *res = __Pyx_PyObject_CallOneArg(finalizer, self); + if (unlikely(!res)) { + PyErr_WriteUnraisable(self); + } else { + Py_DECREF(res); + } + __Pyx_ErrRestore(error_type, error_value, error_traceback); + return; + } + } +#endif + if (unlikely(gen->resume_label == 0 && !error_value)) { +#ifdef __Pyx_Coroutine_USED +#ifdef __Pyx_Generator_USED + if (!__Pyx_Generator_CheckExact(self)) +#endif + { + PyObject_GC_UnTrack(self); +#if PY_MAJOR_VERSION >= 3 || defined(PyErr_WarnFormat) + if (unlikely(PyErr_WarnFormat(PyExc_RuntimeWarning, 1, "coroutine '%.50S' was never awaited", gen->gi_qualname) < 0)) + PyErr_WriteUnraisable(self); +#else + {PyObject *msg; + char *cmsg; + #if CYTHON_COMPILING_IN_PYPY + msg = NULL; + cmsg = (char*) "coroutine was never awaited"; + #else + char *cname; + PyObject *qualname; + qualname = gen->gi_qualname; + cname = PyString_AS_STRING(qualname); + msg = PyString_FromFormat("coroutine '%.50s' was never awaited", cname); + if (unlikely(!msg)) { + PyErr_Clear(); + cmsg = (char*) "coroutine was never awaited"; + } else { + cmsg = PyString_AS_STRING(msg); + } + #endif + if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, cmsg, 1) < 0)) + PyErr_WriteUnraisable(self); + Py_XDECREF(msg);} +#endif + PyObject_GC_Track(self); + } +#endif + } else { + PyObject *res = __Pyx_Coroutine_Close(self); + if (unlikely(!res)) { + if (PyErr_Occurred()) + PyErr_WriteUnraisable(self); + } else { + Py_DECREF(res); + } + } + __Pyx_ErrRestore(error_type, error_value, error_traceback); +#if !CYTHON_USE_TP_FINALIZE + assert(self->ob_refcnt > 0); + if (--self->ob_refcnt == 0) { + return; + } + { + Py_ssize_t refcnt = self->ob_refcnt; + _Py_NewReference(self); + self->ob_refcnt = refcnt; + } +#if CYTHON_COMPILING_IN_CPYTHON + assert(PyType_IS_GC(self->ob_type) && + _Py_AS_GC(self)->gc.gc_refs != _PyGC_REFS_UNTRACKED); + _Py_DEC_REFTOTAL; +#endif +#ifdef COUNT_ALLOCS + --Py_TYPE(self)->tp_frees; + --Py_TYPE(self)->tp_allocs; +#endif +#endif +} +static PyObject * +__Pyx_Coroutine_get_name(__pyx_CoroutineObject *self, CYTHON_UNUSED void *context) +{ + PyObject *name = self->gi_name; + if (unlikely(!name)) name = Py_None; + Py_INCREF(name); + return name; +} +static int +__Pyx_Coroutine_set_name(__pyx_CoroutineObject *self, PyObject *value, CYTHON_UNUSED void *context) +{ + PyObject *tmp; +#if PY_MAJOR_VERSION >= 3 + if (unlikely(value == NULL || !PyUnicode_Check(value))) +#else + if (unlikely(value == NULL || !PyString_Check(value))) +#endif + { + PyErr_SetString(PyExc_TypeError, + "__name__ must be set to a string object"); + return -1; + } + tmp = self->gi_name; + Py_INCREF(value); + self->gi_name = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_Coroutine_get_qualname(__pyx_CoroutineObject *self, CYTHON_UNUSED void *context) +{ + PyObject *name = self->gi_qualname; + if (unlikely(!name)) name = Py_None; + Py_INCREF(name); + return name; +} +static int +__Pyx_Coroutine_set_qualname(__pyx_CoroutineObject *self, PyObject *value, CYTHON_UNUSED void *context) +{ + PyObject *tmp; +#if PY_MAJOR_VERSION >= 3 + if (unlikely(value == NULL || !PyUnicode_Check(value))) +#else + if (unlikely(value == NULL || !PyString_Check(value))) +#endif + { + PyErr_SetString(PyExc_TypeError, + "__qualname__ must be set to a string object"); + return -1; + } + tmp = self->gi_qualname; + Py_INCREF(value); + self->gi_qualname = value; + Py_XDECREF(tmp); + return 0; +} +static __pyx_CoroutineObject *__Pyx__Coroutine_New( + PyTypeObject* type, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure, + PyObject *name, PyObject *qualname, PyObject *module_name) { + __pyx_CoroutineObject *gen = PyObject_GC_New(__pyx_CoroutineObject, type); + if (unlikely(!gen)) + return NULL; + return __Pyx__Coroutine_NewInit(gen, body, code, closure, name, qualname, module_name); +} +static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit( + __pyx_CoroutineObject *gen, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure, + PyObject *name, PyObject *qualname, PyObject *module_name) { + gen->body = body; + gen->closure = closure; + Py_XINCREF(closure); + gen->is_running = 0; + gen->resume_label = 0; + gen->classobj = NULL; + gen->yieldfrom = NULL; + gen->gi_exc_state.exc_type = NULL; + gen->gi_exc_state.exc_value = NULL; + gen->gi_exc_state.exc_traceback = NULL; +#if CYTHON_USE_EXC_INFO_STACK + gen->gi_exc_state.previous_item = NULL; +#endif + gen->gi_weakreflist = NULL; + Py_XINCREF(qualname); + gen->gi_qualname = qualname; + Py_XINCREF(name); + gen->gi_name = name; + Py_XINCREF(module_name); + gen->gi_modulename = module_name; + Py_XINCREF(code); + gen->gi_code = code; + PyObject_GC_Track(gen); + return gen; +} + +/* PatchModuleWithCoroutine */ +static PyObject* __Pyx_Coroutine_patch_module(PyObject* module, const char* py_code) { +#if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) + int result; + PyObject *globals, *result_obj; + globals = PyDict_New(); if (unlikely(!globals)) goto ignore; + result = PyDict_SetItemString(globals, "_cython_coroutine_type", + #ifdef __Pyx_Coroutine_USED + (PyObject*)__pyx_CoroutineType); + #else + Py_None); + #endif + if (unlikely(result < 0)) goto ignore; + result = PyDict_SetItemString(globals, "_cython_generator_type", + #ifdef __Pyx_Generator_USED + (PyObject*)__pyx_GeneratorType); + #else + Py_None); + #endif + if (unlikely(result < 0)) goto ignore; + if (unlikely(PyDict_SetItemString(globals, "_module", module) < 0)) goto ignore; + if (unlikely(PyDict_SetItemString(globals, "__builtins__", __pyx_b) < 0)) goto ignore; + result_obj = PyRun_String(py_code, Py_file_input, globals, globals); + if (unlikely(!result_obj)) goto ignore; + Py_DECREF(result_obj); + Py_DECREF(globals); + return module; +ignore: + Py_XDECREF(globals); + PyErr_WriteUnraisable(module); + if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, "Cython module failed to patch module with custom type", 1) < 0)) { + Py_DECREF(module); + module = NULL; + } +#else + py_code++; +#endif + return module; +} + +/* PatchGeneratorABC */ +#ifndef CYTHON_REGISTER_ABCS +#define CYTHON_REGISTER_ABCS 1 +#endif +#if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) +static PyObject* __Pyx_patch_abc_module(PyObject *module); +static PyObject* __Pyx_patch_abc_module(PyObject *module) { + module = __Pyx_Coroutine_patch_module( + module, "" +"if _cython_generator_type is not None:\n" +" try: Generator = _module.Generator\n" +" except AttributeError: pass\n" +" else: Generator.register(_cython_generator_type)\n" +"if _cython_coroutine_type is not None:\n" +" try: Coroutine = _module.Coroutine\n" +" except AttributeError: pass\n" +" else: Coroutine.register(_cython_coroutine_type)\n" + ); + return module; +} +#endif +static int __Pyx_patch_abc(void) { +#if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) + static int abc_patched = 0; + if (CYTHON_REGISTER_ABCS && !abc_patched) { + PyObject *module; + module = PyImport_ImportModule((PY_MAJOR_VERSION >= 3) ? "collections.abc" : "collections"); + if (!module) { + PyErr_WriteUnraisable(NULL); + if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, + ((PY_MAJOR_VERSION >= 3) ? + "Cython module failed to register with collections.abc module" : + "Cython module failed to register with collections module"), 1) < 0)) { + return -1; + } + } else { + module = __Pyx_patch_abc_module(module); + abc_patched = 1; + if (unlikely(!module)) + return -1; + Py_DECREF(module); + } + module = PyImport_ImportModule("backports_abc"); + if (module) { + module = __Pyx_patch_abc_module(module); + Py_XDECREF(module); + } + if (!module) { + PyErr_Clear(); + } + } +#else + if ((0)) __Pyx_Coroutine_patch_module(NULL, NULL); +#endif + return 0; +} + +/* Generator */ +static PyMethodDef __pyx_Generator_methods[] = { + {"send", (PyCFunction) __Pyx_Coroutine_Send, METH_O, + (char*) PyDoc_STR("send(arg) -> send 'arg' into generator,\nreturn next yielded value or raise StopIteration.")}, + {"throw", (PyCFunction) __Pyx_Coroutine_Throw, METH_VARARGS, + (char*) PyDoc_STR("throw(typ[,val[,tb]]) -> raise exception in generator,\nreturn next yielded value or raise StopIteration.")}, + {"close", (PyCFunction) __Pyx_Coroutine_Close_Method, METH_NOARGS, + (char*) PyDoc_STR("close() -> raise GeneratorExit inside generator.")}, + {0, 0, 0, 0} +}; +static PyMemberDef __pyx_Generator_memberlist[] = { + {(char *) "gi_running", T_BOOL, offsetof(__pyx_CoroutineObject, is_running), READONLY, NULL}, + {(char*) "gi_yieldfrom", T_OBJECT, offsetof(__pyx_CoroutineObject, yieldfrom), READONLY, + (char*) PyDoc_STR("object being iterated by 'yield from', or None")}, + {(char*) "gi_code", T_OBJECT, offsetof(__pyx_CoroutineObject, gi_code), READONLY, NULL}, + {0, 0, 0, 0, 0} +}; +static PyGetSetDef __pyx_Generator_getsets[] = { + {(char *) "__name__", (getter)__Pyx_Coroutine_get_name, (setter)__Pyx_Coroutine_set_name, + (char*) PyDoc_STR("name of the generator"), 0}, + {(char *) "__qualname__", (getter)__Pyx_Coroutine_get_qualname, (setter)__Pyx_Coroutine_set_qualname, + (char*) PyDoc_STR("qualified name of the generator"), 0}, + {0, 0, 0, 0, 0} +}; +static PyTypeObject __pyx_GeneratorType_type = { + PyVarObject_HEAD_INIT(0, 0) + "generator", + sizeof(__pyx_CoroutineObject), + 0, + (destructor) __Pyx_Coroutine_dealloc, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_FINALIZE, + 0, + (traverseproc) __Pyx_Coroutine_traverse, + 0, + 0, + offsetof(__pyx_CoroutineObject, gi_weakreflist), + 0, + (iternextfunc) __Pyx_Generator_Next, + __pyx_Generator_methods, + __pyx_Generator_memberlist, + __pyx_Generator_getsets, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, +#if CYTHON_USE_TP_FINALIZE + 0, +#else + __Pyx_Coroutine_del, +#endif + 0, +#if CYTHON_USE_TP_FINALIZE + __Pyx_Coroutine_del, +#elif PY_VERSION_HEX >= 0x030400a1 + 0, +#endif +}; +static int __pyx_Generator_init(void) { + __pyx_GeneratorType_type.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + __pyx_GeneratorType_type.tp_iter = PyObject_SelfIter; + __pyx_GeneratorType = __Pyx_FetchCommonType(&__pyx_GeneratorType_type); + if (unlikely(!__pyx_GeneratorType)) { + return -1; + } + return 0; +} + +/* CheckBinaryVersion */ +static int __Pyx_check_binary_version(void) { + char ctversion[4], rtversion[4]; + PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION); + PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion()); + if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) { + char message[200]; + PyOS_snprintf(message, sizeof(message), + "compiletime version %s of module '%.100s' " + "does not match runtime version %s", + ctversion, __Pyx_MODULE_NAME, rtversion); + return PyErr_WarnEx(NULL, message, 1); + } + return 0; +} + +/* InitStrings */ +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { + while (t->p) { + #if PY_MAJOR_VERSION < 3 + if (t->is_unicode) { + *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); + } else if (t->intern) { + *t->p = PyString_InternFromString(t->s); + } else { + *t->p = PyString_FromStringAndSize(t->s, t->n - 1); + } + #else + if (t->is_unicode | t->is_str) { + if (t->intern) { + *t->p = PyUnicode_InternFromString(t->s); + } else if (t->encoding) { + *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); + } else { + *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); + } + } else { + *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); + } + #endif + if (!*t->p) + return -1; + if (PyObject_Hash(*t->p) == -1) + return -1; + ++t; + } + return 0; +} + +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { + return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); +} +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { + Py_ssize_t ignore; + return __Pyx_PyObject_AsStringAndSize(o, &ignore); +} +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +#if !CYTHON_PEP393_ENABLED +static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { + char* defenc_c; + PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); + if (!defenc) return NULL; + defenc_c = PyBytes_AS_STRING(defenc); +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + { + char* end = defenc_c + PyBytes_GET_SIZE(defenc); + char* c; + for (c = defenc_c; c < end; c++) { + if ((unsigned char) (*c) >= 128) { + PyUnicode_AsASCIIString(o); + return NULL; + } + } + } +#endif + *length = PyBytes_GET_SIZE(defenc); + return defenc_c; +} +#else +static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { + if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + if (likely(PyUnicode_IS_ASCII(o))) { + *length = PyUnicode_GET_LENGTH(o); + return PyUnicode_AsUTF8(o); + } else { + PyUnicode_AsASCIIString(o); + return NULL; + } +#else + return PyUnicode_AsUTF8AndSize(o, length); +#endif +} +#endif +#endif +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT + if ( +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + __Pyx_sys_getdefaultencoding_not_ascii && +#endif + PyUnicode_Check(o)) { + return __Pyx_PyUnicode_AsStringAndSize(o, length); + } else +#endif +#if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) + if (PyByteArray_Check(o)) { + *length = PyByteArray_GET_SIZE(o); + return PyByteArray_AS_STRING(o); + } else +#endif + { + char* result; + int r = PyBytes_AsStringAndSize(o, &result, length); + if (unlikely(r < 0)) { + return NULL; + } else { + return result; + } + } +} +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { + int is_true = x == Py_True; + if (is_true | (x == Py_False) | (x == Py_None)) return is_true; + else return PyObject_IsTrue(x); +} +static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) { + int retval; + if (unlikely(!x)) return -1; + retval = __Pyx_PyObject_IsTrue(x); + Py_DECREF(x); + return retval; +} +static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) { +#if PY_MAJOR_VERSION >= 3 + if (PyLong_Check(result)) { + if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, + "__int__ returned non-int (type %.200s). " + "The ability to return an instance of a strict subclass of int " + "is deprecated, and may be removed in a future version of Python.", + Py_TYPE(result)->tp_name)) { + Py_DECREF(result); + return NULL; + } + return result; + } +#endif + PyErr_Format(PyExc_TypeError, + "__%.4s__ returned non-%.4s (type %.200s)", + type_name, type_name, Py_TYPE(result)->tp_name); + Py_DECREF(result); + return NULL; +} +static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { +#if CYTHON_USE_TYPE_SLOTS + PyNumberMethods *m; +#endif + const char *name = NULL; + PyObject *res = NULL; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x) || PyLong_Check(x))) +#else + if (likely(PyLong_Check(x))) +#endif + return __Pyx_NewRef(x); +#if CYTHON_USE_TYPE_SLOTS + m = Py_TYPE(x)->tp_as_number; + #if PY_MAJOR_VERSION < 3 + if (m && m->nb_int) { + name = "int"; + res = m->nb_int(x); + } + else if (m && m->nb_long) { + name = "long"; + res = m->nb_long(x); + } + #else + if (likely(m && m->nb_int)) { + name = "int"; + res = m->nb_int(x); + } + #endif +#else + if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { + res = PyNumber_Int(x); + } +#endif + if (likely(res)) { +#if PY_MAJOR_VERSION < 3 + if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) { +#else + if (unlikely(!PyLong_CheckExact(res))) { +#endif + return __Pyx_PyNumber_IntOrLongWrongResultType(res, name); + } + } + else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_TypeError, + "an integer is required"); + } + return res; +} +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { + Py_ssize_t ival; + PyObject *x; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_CheckExact(b))) { + if (sizeof(Py_ssize_t) >= sizeof(long)) + return PyInt_AS_LONG(b); + else + return PyInt_AsSsize_t(b); + } +#endif + if (likely(PyLong_CheckExact(b))) { + #if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)b)->ob_digit; + const Py_ssize_t size = Py_SIZE(b); + if (likely(__Pyx_sst_abs(size) <= 1)) { + ival = likely(size) ? digits[0] : 0; + if (size == -1) ival = -ival; + return ival; + } else { + switch (size) { + case 2: + if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { + return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -2: + if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case 3: + if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { + return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -3: + if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case 4: + if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { + return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -4: + if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + } + } + #endif + return PyLong_AsSsize_t(b); + } + x = PyNumber_Index(b); + if (!x) return -1; + ival = PyInt_AsSsize_t(x); + Py_DECREF(x); + return ival; +} +static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) { + return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False); +} +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { + return PyInt_FromSize_t(ival); +} + + +#endif /* Py_PYTHON_H */ diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/libev/corecext.cp37-win_amd64.pyd b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/libev/corecext.cp37-win_amd64.pyd new file mode 100644 index 0000000000000000000000000000000000000000..fafd9bbdb782637261e19d944c227d9593a9f8e9 GIT binary patch literal 262144 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

Os{R}pE_1Uq`D_6MMc%tKR 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 E1;lO5;{X5v literal 0 HcmV?d00001 diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/libev/corecext.h b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/libev/corecext.h new file mode 100644 index 00000000..804ccefb --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/libev/corecext.h @@ -0,0 +1,148 @@ +/* Generated by Cython 0.29.2 */ + +#ifndef __PYX_HAVE__gevent__libev__corecext +#define __PYX_HAVE__gevent__libev__corecext + +struct PyGeventCallbackObject; +struct PyGeventLoopObject; +struct PyGeventWatcherObject; +struct PyGeventIOObject; +struct PyGeventTimerObject; +struct PyGeventSignalObject; +struct PyGeventIdleObject; +struct PyGeventPrepareObject; +struct PyGeventCheckObject; +struct PyGeventForkObject; +struct PyGeventAsyncObject; +struct PyGeventChildObject; +struct PyGeventStatObject; + +struct PyGeventCallbackObject { + PyObject_HEAD + PyObject *callback; + PyObject *args; + struct PyGeventCallbackObject *next; +}; + +struct PyGeventLoopObject { + PyObject_HEAD + struct __pyx_vtabstruct_6gevent_5libev_8corecext_loop *__pyx_vtab; + struct ev_prepare _prepare; + struct ev_timer _timer0; + struct ev_timer _periodic_signal_checker; + PyObject *error_handler; + struct ev_loop *_ptr; + struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *_callbacks; + int starting_timer_may_update_loop_time; + int _default; + double approx_timer_resolution; +}; + +struct PyGeventWatcherObject { + PyObject_HEAD + struct PyGeventLoopObject *loop; + PyObject *_callback; + PyObject *args; + struct ev_watcher *__pyx___watcher; + struct __pyx_t_6gevent_5libev_8corecext_start_and_stop *__pyx___ss; + unsigned int _flags; +}; + +struct PyGeventIOObject { + struct PyGeventWatcherObject __pyx_base; + struct ev_io _watcher; +}; + +struct PyGeventTimerObject { + struct PyGeventWatcherObject __pyx_base; + struct ev_timer _watcher; +}; + +struct PyGeventSignalObject { + struct PyGeventWatcherObject __pyx_base; + struct ev_signal _watcher; +}; + +struct PyGeventIdleObject { + struct PyGeventWatcherObject __pyx_base; + struct ev_idle _watcher; +}; + +struct PyGeventPrepareObject { + struct PyGeventWatcherObject __pyx_base; + struct ev_prepare _watcher; +}; + +struct PyGeventCheckObject { + struct PyGeventWatcherObject __pyx_base; + struct ev_check _watcher; +}; + +struct PyGeventForkObject { + struct PyGeventWatcherObject __pyx_base; + struct ev_fork _watcher; +}; + +struct PyGeventAsyncObject { + struct PyGeventWatcherObject __pyx_base; + struct ev_async _watcher; +}; + +struct PyGeventChildObject { + struct PyGeventWatcherObject __pyx_base; + struct ev_child _watcher; +}; + +struct PyGeventStatObject { + struct PyGeventWatcherObject __pyx_base; + struct ev_stat _watcher; + PyObject *path; + PyObject *_paths; +}; + +#ifndef __PYX_HAVE_API__gevent__libev__corecext + +#ifndef __PYX_EXTERN_C + #ifdef __cplusplus + #define __PYX_EXTERN_C extern "C" + #else + #define __PYX_EXTERN_C extern + #endif +#endif + +#ifndef DL_IMPORT + #define DL_IMPORT(_T) _T +#endif + +__PYX_EXTERN_C DL_IMPORT(PyTypeObject) PyGeventCallback_Type; +__PYX_EXTERN_C DL_IMPORT(PyTypeObject) PyGeventLoop_Type; +__PYX_EXTERN_C DL_IMPORT(PyTypeObject) PyGeventWatcher_Type; +__PYX_EXTERN_C DL_IMPORT(PyTypeObject) PyGeventIO_Type; +__PYX_EXTERN_C DL_IMPORT(PyTypeObject) PyGeventTimer_Type; +__PYX_EXTERN_C DL_IMPORT(PyTypeObject) PyGeventSignal_Type; +__PYX_EXTERN_C DL_IMPORT(PyTypeObject) PyGeventIdle_Type; +__PYX_EXTERN_C DL_IMPORT(PyTypeObject) PyGeventPrepare_Type; +__PYX_EXTERN_C DL_IMPORT(PyTypeObject) PyGeventCheck_Type; +__PYX_EXTERN_C DL_IMPORT(PyTypeObject) PyGeventFork_Type; +__PYX_EXTERN_C DL_IMPORT(PyTypeObject) PyGeventAsync_Type; +__PYX_EXTERN_C DL_IMPORT(PyTypeObject) PyGeventChild_Type; +__PYX_EXTERN_C DL_IMPORT(PyTypeObject) PyGeventStat_Type; + +__PYX_EXTERN_C void gevent_handle_error(struct PyGeventLoopObject *, PyObject *); +__PYX_EXTERN_C PyObject *gevent_loop_run_callbacks(struct PyGeventLoopObject *); + +__PYX_EXTERN_C PyObject *GEVENT_CORE_EVENTS; +__PYX_EXTERN_C PyObject *_empty_tuple; + +#endif /* !__PYX_HAVE_API__gevent__libev__corecext */ + +/* WARNING: the interface of the module init function changed in CPython 3.5. */ +/* It now returns a PyModuleDef instance instead of a PyModule instance. */ + +#if PY_MAJOR_VERSION < 3 +PyMODINIT_FUNC initcorecext(void); +#else +PyMODINIT_FUNC PyInit_corecext(void); +#endif + +#endif /* !__PYX_HAVE__gevent__libev__corecext */ diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/libev/corecext.html b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/libev/corecext.html new file mode 100644 index 00000000..f4aad72e --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/libev/corecext.html @@ -0,0 +1,15651 @@ + + + + + + Cython: corecext.pyx + + + +

Generated by Cython 0.29.2

+

+ Yellow lines hint at Python interaction.
+ Click on a line that starts with a "+" to see the C code that Cython generated for it. +

+

Raw output: corecext.c

+
 0001: # Copyright (c) 2009-2012 Denis Bilenko. See LICENSE for details.
+
 0002: 
+
 0003: # This first directive, supported in Cython 0.24+, causes sources
+
 0004: # files to be *much* smaller when it's false (139,027 LOC vs 35,000
+
 0005: # LOC) and thus cythonpp.py (and probably the compiler; also Visual C
+
 0006: # has limits on source file sizes) to be faster (73s vs 46s). But it does
+
 0007: # make debugging more difficult. Auto-pickling was added in 0.26, and
+
 0008: # that's a new feature that we don't need or want to allow in a gevent
+
 0009: # point release.
+
 0010: 
+
 0011: # cython: emit_code_comments=False, auto_pickle=False
+
 0012: 
+
 0013: # NOTE: We generally cannot use the Cython IF directive as documented
+
 0014: # at
+
 0015: # http://cython.readthedocs.io/en/latest/src/userguide/language_basics.html#conditional-compilation
+
 0016: # (e.g., IF UNAME_SYSNAME == "Windows") because when Cython says
+
 0017: # "compilation", it means when *Cython* compiles, not when the C
+
 0018: # compiler compiles. We distribute an sdist with a single pre-compiled
+
 0019: # C file for all platforms so that end users that don't use a binary
+
 0020: # wheel don't have to sit through cythonpp and other steps the Makefile does.
+
 0021: # See https://github.com/gevent/gevent/issues/1076
+
 0022: 
+
 0023: cimport cython
+
 0024: cimport libev
+
 0025: 
+
 0026: from cpython.ref cimport Py_INCREF
+
 0027: from cpython.ref cimport Py_DECREF
+
 0028: from cpython.mem cimport PyMem_Malloc
+
 0029: from cpython.mem cimport PyMem_Free
+
 0030: from libc.errno cimport errno
+
 0031: 
+
 0032: cdef extern from "Python.h":
+
 0033:     int    Py_ReprEnter(object)
+
 0034:     void   Py_ReprLeave(object)
+
 0035: 
+
 0036: # Work around lack of absolute_import in Cython
+
 0037: # Note for PY3: not doing so will leave reference to locals() on import
+
 0038: # (reproducible under Python 3.3, not under Python 3.4; see test__refcount_core.py)
+
+0039: sys = __import__('sys', level=0)
+
+  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 39, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_level, __pyx_int_0) < 0) __PYX_ERR(0, 39, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin___import__, __pyx_tuple__17, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 39, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_sys, __pyx_t_2) < 0) __PYX_ERR(0, 39, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+  __pyx_tuple__17 = PyTuple_Pack(1, __pyx_n_s_sys); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(0, 39, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__17);
+  __Pyx_GIVEREF(__pyx_tuple__17);
+
+0040: os = __import__('os', level=0)
+
+  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 40, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_level, __pyx_int_0) < 0) __PYX_ERR(0, 40, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin___import__, __pyx_tuple__18, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 40, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_os, __pyx_t_1) < 0) __PYX_ERR(0, 40, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+  __pyx_tuple__18 = PyTuple_Pack(1, __pyx_n_s_os); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(0, 40, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__18);
+  __Pyx_GIVEREF(__pyx_tuple__18);
+
+0041: traceback = __import__('traceback', level=0)
+
+  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 41, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_level, __pyx_int_0) < 0) __PYX_ERR(0, 41, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin___import__, __pyx_tuple__19, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 41, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_traceback, __pyx_t_2) < 0) __PYX_ERR(0, 41, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+  __pyx_tuple__19 = PyTuple_Pack(1, __pyx_n_s_traceback); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(0, 41, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__19);
+  __Pyx_GIVEREF(__pyx_tuple__19);
+
+0042: signalmodule = __import__('signal', level=0)
+
+  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 42, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_level, __pyx_int_0) < 0) __PYX_ERR(0, 42, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin___import__, __pyx_tuple__20, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 42, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_signalmodule, __pyx_t_1) < 0) __PYX_ERR(0, 42, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+  __pyx_tuple__20 = PyTuple_Pack(1, __pyx_n_s_signal); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(0, 42, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__20);
+  __Pyx_GIVEREF(__pyx_tuple__20);
+
+0043: getswitchinterval = __import__('gevent', level=0).getswitchinterval
+
+  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 43, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_level, __pyx_int_0) < 0) __PYX_ERR(0, 43, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin___import__, __pyx_tuple__21, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 43, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_getswitchinterval); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 43, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_getswitchinterval, __pyx_t_1) < 0) __PYX_ERR(0, 43, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+  __pyx_tuple__21 = PyTuple_Pack(1, __pyx_n_s_gevent); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(0, 43, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__21);
+  __Pyx_GIVEREF(__pyx_tuple__21);
+
 0044: 
+
 0045: 
+
+0046: __all__ = ['get_version',
+
+  __pyx_t_1 = PyList_New(7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 46, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(__pyx_n_s_get_version);
+  __Pyx_GIVEREF(__pyx_n_s_get_version);
+  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_get_version);
+  __Pyx_INCREF(__pyx_n_s_get_header_version);
+  __Pyx_GIVEREF(__pyx_n_s_get_header_version);
+  PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_get_header_version);
+  __Pyx_INCREF(__pyx_n_s_supported_backends);
+  __Pyx_GIVEREF(__pyx_n_s_supported_backends);
+  PyList_SET_ITEM(__pyx_t_1, 2, __pyx_n_s_supported_backends);
+  __Pyx_INCREF(__pyx_n_s_recommended_backends);
+  __Pyx_GIVEREF(__pyx_n_s_recommended_backends);
+  PyList_SET_ITEM(__pyx_t_1, 3, __pyx_n_s_recommended_backends);
+  __Pyx_INCREF(__pyx_n_s_embeddable_backends);
+  __Pyx_GIVEREF(__pyx_n_s_embeddable_backends);
+  PyList_SET_ITEM(__pyx_t_1, 4, __pyx_n_s_embeddable_backends);
+  __Pyx_INCREF(__pyx_n_s_time);
+  __Pyx_GIVEREF(__pyx_n_s_time);
+  PyList_SET_ITEM(__pyx_t_1, 5, __pyx_n_s_time);
+  __Pyx_INCREF(__pyx_n_s_loop);
+  __Pyx_GIVEREF(__pyx_n_s_loop);
+  PyList_SET_ITEM(__pyx_t_1, 6, __pyx_n_s_loop);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_all, __pyx_t_1) < 0) __PYX_ERR(0, 46, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 0047:            'get_header_version',
+
 0048:            'supported_backends',
+
 0049:            'recommended_backends',
+
 0050:            'embeddable_backends',
+
 0051:            'time',
+
 0052:            'loop']
+
 0053: 
+
 0054: cdef tuple integer_types
+
 0055: 
+
+0056: if sys.version_info[0] >= 3:
+
+  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_sys); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 56, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_version_info); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 56, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 56, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_int_3, Py_GE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 56, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 56, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  if (__pyx_t_3) {
+
+    goto __pyx_L2;
+  }
+
+0057:     integer_types = int,
+
+    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 57, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_INCREF(((PyObject *)(&PyInt_Type)));
+    __Pyx_GIVEREF(((PyObject *)(&PyInt_Type)));
+    PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)(&PyInt_Type)));
+    __Pyx_XGOTREF(__pyx_v_6gevent_5libev_8corecext_integer_types);
+    __Pyx_DECREF_SET(__pyx_v_6gevent_5libev_8corecext_integer_types, ((PyObject*)__pyx_t_2));
+    __Pyx_GIVEREF(__pyx_t_2);
+    __pyx_t_2 = 0;
+
 0058: else:
+
+0059:     integer_types = (int, long)
+
+  /*else*/ {
+    __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 59, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_INCREF(((PyObject *)(&PyInt_Type)));
+    __Pyx_GIVEREF(((PyObject *)(&PyInt_Type)));
+    PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)(&PyInt_Type)));
+    __Pyx_INCREF(((PyObject *)(&PyLong_Type)));
+    __Pyx_GIVEREF(((PyObject *)(&PyLong_Type)));
+    PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)(&PyLong_Type)));
+    __Pyx_XGOTREF(__pyx_v_6gevent_5libev_8corecext_integer_types);
+    __Pyx_DECREF_SET(__pyx_v_6gevent_5libev_8corecext_integer_types, ((PyObject*)__pyx_t_2));
+    __Pyx_GIVEREF(__pyx_t_2);
+    __pyx_t_2 = 0;
+  }
+  __pyx_L2:;
+
 0060: 
+
 0061: 
+
 0062: cdef extern from "callbacks.h":
+
 0063:     void gevent_callback_io(libev.ev_loop, void*, int)
+
 0064:     void gevent_callback_timer(libev.ev_loop, void*, int)
+
 0065:     void gevent_callback_signal(libev.ev_loop, void*, int)
+
 0066:     void gevent_callback_idle(libev.ev_loop, void*, int)
+
 0067:     void gevent_callback_prepare(libev.ev_loop, void*, int)
+
 0068:     void gevent_callback_check(libev.ev_loop, void*, int)
+
 0069:     void gevent_callback_fork(libev.ev_loop, void*, int)
+
 0070:     void gevent_callback_async(libev.ev_loop, void*, int)
+
 0071:     void gevent_callback_child(libev.ev_loop, void*, int)
+
 0072:     void gevent_callback_stat(libev.ev_loop, void*, int)
+
 0073:     void gevent_run_callbacks(libev.ev_loop, void*, int)
+
 0074:     void gevent_periodic_signal_check(libev.ev_loop, void*, int)
+
 0075:     void gevent_call(loop, callback)
+
 0076:     void gevent_noop(libev.ev_loop, void*, int)
+
 0077: 
+
 0078: cdef extern from "stathelper.c":
+
 0079:     object _pystat_fromstructstat(void*)
+
 0080: 
+
 0081: 
+
+0082: UNDEF = libev.EV_UNDEF
+
+  __pyx_t_2 = __Pyx_PyInt_From_int(EV_UNDEF); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 82, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_UNDEF, __pyx_t_2) < 0) __PYX_ERR(0, 82, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+0083: NONE = libev.EV_NONE
+
+  __pyx_t_2 = __Pyx_PyInt_From_int(EV_NONE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 83, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_NONE, __pyx_t_2) < 0) __PYX_ERR(0, 83, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+0084: READ = libev.EV_READ
+
+  __pyx_t_2 = __Pyx_PyInt_From_int(EV_READ); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 84, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_READ, __pyx_t_2) < 0) __PYX_ERR(0, 84, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+0085: WRITE = libev.EV_WRITE
+
+  __pyx_t_2 = __Pyx_PyInt_From_int(EV_WRITE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 85, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_WRITE, __pyx_t_2) < 0) __PYX_ERR(0, 85, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+0086: TIMER = libev.EV_TIMER
+
+  __pyx_t_2 = __Pyx_PyInt_From_int(EV_TIMER); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 86, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_TIMER, __pyx_t_2) < 0) __PYX_ERR(0, 86, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+0087: PERIODIC = libev.EV_PERIODIC
+
+  __pyx_t_2 = __Pyx_PyInt_From_int(EV_PERIODIC); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 87, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_PERIODIC, __pyx_t_2) < 0) __PYX_ERR(0, 87, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+0088: SIGNAL = libev.EV_SIGNAL
+
+  __pyx_t_2 = __Pyx_PyInt_From_int(EV_SIGNAL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 88, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_SIGNAL, __pyx_t_2) < 0) __PYX_ERR(0, 88, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+0089: CHILD = libev.EV_CHILD
+
+  __pyx_t_2 = __Pyx_PyInt_From_int(EV_CHILD); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 89, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_CHILD, __pyx_t_2) < 0) __PYX_ERR(0, 89, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+0090: STAT = libev.EV_STAT
+
+  __pyx_t_2 = __Pyx_PyInt_From_int(EV_STAT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 90, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_STAT, __pyx_t_2) < 0) __PYX_ERR(0, 90, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+0091: IDLE = libev.EV_IDLE
+
+  __pyx_t_2 = __Pyx_PyInt_From_int(EV_IDLE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 91, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_IDLE, __pyx_t_2) < 0) __PYX_ERR(0, 91, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+0092: PREPARE = libev.EV_PREPARE
+
+  __pyx_t_2 = __Pyx_PyInt_From_int(EV_PREPARE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 92, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_PREPARE, __pyx_t_2) < 0) __PYX_ERR(0, 92, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+0093: CHECK = libev.EV_CHECK
+
+  __pyx_t_2 = __Pyx_PyInt_From_int(EV_CHECK); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 93, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_CHECK, __pyx_t_2) < 0) __PYX_ERR(0, 93, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+0094: EMBED = libev.EV_EMBED
+
+  __pyx_t_2 = __Pyx_PyInt_From_int(EV_EMBED); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 94, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_EMBED, __pyx_t_2) < 0) __PYX_ERR(0, 94, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+0095: FORK = libev.EV_FORK
+
+  __pyx_t_2 = __Pyx_PyInt_From_int(EV_FORK); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 95, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_FORK, __pyx_t_2) < 0) __PYX_ERR(0, 95, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+0096: CLEANUP = libev.EV_CLEANUP
+
+  __pyx_t_2 = __Pyx_PyInt_From_int(EV_CLEANUP); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 96, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_CLEANUP, __pyx_t_2) < 0) __PYX_ERR(0, 96, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+0097: ASYNC = libev.EV_ASYNC
+
+  __pyx_t_2 = __Pyx_PyInt_From_int(EV_ASYNC); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 97, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ASYNC, __pyx_t_2) < 0) __PYX_ERR(0, 97, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+0098: CUSTOM = libev.EV_CUSTOM
+
+  __pyx_t_2 = __Pyx_PyInt_From_int(EV_CUSTOM); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 98, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_CUSTOM, __pyx_t_2) < 0) __PYX_ERR(0, 98, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+0099: ERROR = libev.EV_ERROR
+
+  __pyx_t_2 = __Pyx_PyInt_From_int(EV_ERROR); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 99, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ERROR, __pyx_t_2) < 0) __PYX_ERR(0, 99, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
 0100: 
+
+0101: READWRITE = libev.EV_READ | libev.EV_WRITE
+
+  __pyx_t_2 = __Pyx_PyInt_From_int((EV_READ | EV_WRITE)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 101, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_READWRITE, __pyx_t_2) < 0) __PYX_ERR(0, 101, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
 0102: 
+
+0103: MINPRI = libev.EV_MINPRI
+
+  __pyx_t_2 = __Pyx_PyInt_From_int(EV_MINPRI); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 103, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_MINPRI, __pyx_t_2) < 0) __PYX_ERR(0, 103, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+0104: MAXPRI = libev.EV_MAXPRI
+
+  __pyx_t_2 = __Pyx_PyInt_From_int(EV_MAXPRI); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 104, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_MAXPRI, __pyx_t_2) < 0) __PYX_ERR(0, 104, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
 0105: 
+
+0106: BACKEND_PORT = libev.EVBACKEND_PORT
+
+  __pyx_t_2 = __Pyx_PyInt_From_int(EVBACKEND_PORT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 106, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_BACKEND_PORT, __pyx_t_2) < 0) __PYX_ERR(0, 106, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+0107: BACKEND_KQUEUE = libev.EVBACKEND_KQUEUE
+
+  __pyx_t_2 = __Pyx_PyInt_From_int(EVBACKEND_KQUEUE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 107, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_BACKEND_KQUEUE, __pyx_t_2) < 0) __PYX_ERR(0, 107, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+0108: BACKEND_EPOLL = libev.EVBACKEND_EPOLL
+
+  __pyx_t_2 = __Pyx_PyInt_From_int(EVBACKEND_EPOLL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 108, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_BACKEND_EPOLL, __pyx_t_2) < 0) __PYX_ERR(0, 108, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+0109: BACKEND_POLL = libev.EVBACKEND_POLL
+
+  __pyx_t_2 = __Pyx_PyInt_From_int(EVBACKEND_POLL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 109, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_BACKEND_POLL, __pyx_t_2) < 0) __PYX_ERR(0, 109, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+0110: BACKEND_SELECT = libev.EVBACKEND_SELECT
+
+  __pyx_t_2 = __Pyx_PyInt_From_int(EVBACKEND_SELECT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 110, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_BACKEND_SELECT, __pyx_t_2) < 0) __PYX_ERR(0, 110, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+0111: FORKCHECK = libev.EVFLAG_FORKCHECK
+
+  __pyx_t_2 = __Pyx_PyInt_From_int(EVFLAG_FORKCHECK); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 111, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_FORKCHECK, __pyx_t_2) < 0) __PYX_ERR(0, 111, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+0112: NOINOTIFY = libev.EVFLAG_NOINOTIFY
+
+  __pyx_t_2 = __Pyx_PyInt_From_int(EVFLAG_NOINOTIFY); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 112, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_NOINOTIFY, __pyx_t_2) < 0) __PYX_ERR(0, 112, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+0113: SIGNALFD = libev.EVFLAG_SIGNALFD
+
+  __pyx_t_2 = __Pyx_PyInt_From_int(EVFLAG_SIGNALFD); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 113, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_SIGNALFD, __pyx_t_2) < 0) __PYX_ERR(0, 113, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+0114: NOSIGMASK = libev.EVFLAG_NOSIGMASK
+
+  __pyx_t_2 = __Pyx_PyInt_From_int(EVFLAG_NOSIGMASK); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 114, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_NOSIGMASK, __pyx_t_2) < 0) __PYX_ERR(0, 114, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
 0115: 
+
 0116: 
+
 0117: @cython.internal
+
+0118: cdef class _EVENTSType:
+
+struct __pyx_obj_6gevent_5libev_8corecext__EVENTSType {
+  PyObject_HEAD
+};
+
+
 0119: 
+
+0120:     def __repr__(self):
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_11_EVENTSType_1__repr__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_11_EVENTSType_1__repr__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_11_EVENTSType___repr__(((struct __pyx_obj_6gevent_5libev_8corecext__EVENTSType *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_11_EVENTSType___repr__(CYTHON_UNUSED struct __pyx_obj_6gevent_5libev_8corecext__EVENTSType *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__repr__", 0);
+
+
+  /* function exit code */
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0121:         return 'gevent.core.EVENTS'
+
+  __Pyx_XDECREF(__pyx_r);
+  __Pyx_INCREF(__pyx_kp_s_gevent_core_EVENTS);
+  __pyx_r = __pyx_kp_s_gevent_core_EVENTS;
+  goto __pyx_L0;
+
 0122: 
+
 0123: 
+
+0124: cdef public object GEVENT_CORE_EVENTS = _EVENTSType()
+
+  __pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_6gevent_5libev_8corecext__EVENTSType)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 124, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_XGOTREF(GEVENT_CORE_EVENTS);
+  __Pyx_DECREF_SET(GEVENT_CORE_EVENTS, __pyx_t_2);
+  __Pyx_GIVEREF(__pyx_t_2);
+  __pyx_t_2 = 0;
+
+0125: EVENTS = GEVENT_CORE_EVENTS
+
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_EVENTS, GEVENT_CORE_EVENTS) < 0) __PYX_ERR(0, 125, __pyx_L1_error)
+
 0126: 
+
 0127: 
+
+0128: def get_version():
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_1get_version(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyMethodDef __pyx_mdef_6gevent_5libev_8corecext_1get_version = {"get_version", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_1get_version, METH_NOARGS, 0};
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_1get_version(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("get_version (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_get_version(__pyx_self);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_get_version(CYTHON_UNUSED PyObject *__pyx_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("get_version", 0);
+
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_AddTraceback("gevent.libev.corecext.get_version", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6gevent_5libev_8corecext_1get_version, NULL, __pyx_n_s_gevent_libev_corecext); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 128, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_version, __pyx_t_2) < 0) __PYX_ERR(0, 128, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+  __pyx_codeobj__22 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_libev_corecext_pyx, __pyx_n_s_get_version, 128, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__22)) __PYX_ERR(0, 128, __pyx_L1_error)
+
+0129:     return 'libev-%d.%02d' % (libev.ev_version_major(), libev.ev_version_minor())
+
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __Pyx_PyInt_From_int(ev_version_major()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 129, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = __Pyx_PyInt_From_int(ev_version_minor()); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 129, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 129, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_GIVEREF(__pyx_t_1);
+  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_2);
+  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
+  __pyx_t_1 = 0;
+  __pyx_t_2 = 0;
+  __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_libev_d_02d, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 129, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __pyx_r = __pyx_t_2;
+  __pyx_t_2 = 0;
+  goto __pyx_L0;
+
 0130: 
+
 0131: 
+
+0132: def get_header_version():
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_3get_header_version(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyMethodDef __pyx_mdef_6gevent_5libev_8corecext_3get_header_version = {"get_header_version", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_3get_header_version, METH_NOARGS, 0};
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_3get_header_version(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("get_header_version (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_2get_header_version(__pyx_self);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_2get_header_version(CYTHON_UNUSED PyObject *__pyx_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("get_header_version", 0);
+
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_AddTraceback("gevent.libev.corecext.get_header_version", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6gevent_5libev_8corecext_3get_header_version, NULL, __pyx_n_s_gevent_libev_corecext); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 132, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_header_version, __pyx_t_2) < 0) __PYX_ERR(0, 132, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+  __pyx_codeobj__23 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_libev_corecext_pyx, __pyx_n_s_get_header_version, 132, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__23)) __PYX_ERR(0, 132, __pyx_L1_error)
+
+0133:     return 'libev-%d.%02d' % (libev.EV_VERSION_MAJOR, libev.EV_VERSION_MINOR)
+
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __Pyx_PyInt_From_int(EV_VERSION_MAJOR); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 133, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = __Pyx_PyInt_From_int(EV_VERSION_MINOR); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 133, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 133, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_GIVEREF(__pyx_t_1);
+  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_2);
+  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
+  __pyx_t_1 = 0;
+  __pyx_t_2 = 0;
+  __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_libev_d_02d, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 133, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __pyx_r = __pyx_t_2;
+  __pyx_t_2 = 0;
+  goto __pyx_L0;
+
 0134: 
+
 0135: 
+
 0136: # This list backends in the order they are actually tried by libev
+
+0137: _flags = [(libev.EVBACKEND_PORT, 'port'),
+
+  __pyx_t_2 = __Pyx_PyInt_From_int(EVBACKEND_PORT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 137, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 137, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_2);
+  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_port);
+  __Pyx_GIVEREF(__pyx_n_s_port);
+  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_port);
+  __pyx_t_2 = 0;
+
+  __pyx_t_2 = PyList_New(10); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 137, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_GIVEREF(__pyx_t_1);
+  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_4);
+  PyList_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
+  __Pyx_GIVEREF(__pyx_t_5);
+  PyList_SET_ITEM(__pyx_t_2, 2, __pyx_t_5);
+  __Pyx_GIVEREF(__pyx_t_6);
+  PyList_SET_ITEM(__pyx_t_2, 3, __pyx_t_6);
+  __Pyx_GIVEREF(__pyx_t_7);
+  PyList_SET_ITEM(__pyx_t_2, 4, __pyx_t_7);
+  __Pyx_GIVEREF(__pyx_t_8);
+  PyList_SET_ITEM(__pyx_t_2, 5, __pyx_t_8);
+  __Pyx_GIVEREF(__pyx_t_9);
+  PyList_SET_ITEM(__pyx_t_2, 6, __pyx_t_9);
+  __Pyx_GIVEREF(__pyx_t_10);
+  PyList_SET_ITEM(__pyx_t_2, 7, __pyx_t_10);
+  __Pyx_GIVEREF(__pyx_t_11);
+  PyList_SET_ITEM(__pyx_t_2, 8, __pyx_t_11);
+  __Pyx_GIVEREF(__pyx_t_12);
+  PyList_SET_ITEM(__pyx_t_2, 9, __pyx_t_12);
+  __pyx_t_1 = 0;
+  __pyx_t_4 = 0;
+  __pyx_t_5 = 0;
+  __pyx_t_6 = 0;
+  __pyx_t_7 = 0;
+  __pyx_t_8 = 0;
+  __pyx_t_9 = 0;
+  __pyx_t_10 = 0;
+  __pyx_t_11 = 0;
+  __pyx_t_12 = 0;
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_flags, __pyx_t_2) < 0) __PYX_ERR(0, 137, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+0138:           (libev.EVBACKEND_KQUEUE, 'kqueue'),
+
+  __pyx_t_2 = __Pyx_PyInt_From_int(EVBACKEND_KQUEUE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 138, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 138, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_4);
+  __Pyx_GIVEREF(__pyx_t_2);
+  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_kqueue);
+  __Pyx_GIVEREF(__pyx_n_s_kqueue);
+  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_n_s_kqueue);
+  __pyx_t_2 = 0;
+
+0139:           (libev.EVBACKEND_EPOLL, 'epoll'),
+
+  __pyx_t_2 = __Pyx_PyInt_From_int(EVBACKEND_EPOLL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 139, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 139, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_5);
+  __Pyx_GIVEREF(__pyx_t_2);
+  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_epoll);
+  __Pyx_GIVEREF(__pyx_n_s_epoll);
+  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_n_s_epoll);
+  __pyx_t_2 = 0;
+
+0140:           (libev.EVBACKEND_POLL, 'poll'),
+
+  __pyx_t_2 = __Pyx_PyInt_From_int(EVBACKEND_POLL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 140, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 140, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  __Pyx_GIVEREF(__pyx_t_2);
+  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_poll);
+  __Pyx_GIVEREF(__pyx_n_s_poll);
+  PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_n_s_poll);
+  __pyx_t_2 = 0;
+
+0141:           (libev.EVBACKEND_SELECT, 'select'),
+
+  __pyx_t_2 = __Pyx_PyInt_From_int(EVBACKEND_SELECT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 141, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 141, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_7);
+  __Pyx_GIVEREF(__pyx_t_2);
+  PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_select);
+  __Pyx_GIVEREF(__pyx_n_s_select);
+  PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_n_s_select);
+  __pyx_t_2 = 0;
+
+0142:           (libev.EVFLAG_NOENV, 'noenv'),
+
+  __pyx_t_2 = __Pyx_PyInt_From_int(EVFLAG_NOENV); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 142, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 142, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_8);
+  __Pyx_GIVEREF(__pyx_t_2);
+  PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_noenv);
+  __Pyx_GIVEREF(__pyx_n_s_noenv);
+  PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_n_s_noenv);
+  __pyx_t_2 = 0;
+
+0143:           (libev.EVFLAG_FORKCHECK, 'forkcheck'),
+
+  __pyx_t_2 = __Pyx_PyInt_From_int(EVFLAG_FORKCHECK); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 143, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 143, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_9);
+  __Pyx_GIVEREF(__pyx_t_2);
+  PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_forkcheck);
+  __Pyx_GIVEREF(__pyx_n_s_forkcheck);
+  PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_n_s_forkcheck);
+  __pyx_t_2 = 0;
+
+0144:           (libev.EVFLAG_NOINOTIFY, 'noinotify'),
+
+  __pyx_t_2 = __Pyx_PyInt_From_int(EVFLAG_NOINOTIFY); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 144, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 144, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_10);
+  __Pyx_GIVEREF(__pyx_t_2);
+  PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_noinotify);
+  __Pyx_GIVEREF(__pyx_n_s_noinotify);
+  PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_n_s_noinotify);
+  __pyx_t_2 = 0;
+
+0145:           (libev.EVFLAG_SIGNALFD, 'signalfd'),
+
+  __pyx_t_2 = __Pyx_PyInt_From_int(EVFLAG_SIGNALFD); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 145, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 145, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_11);
+  __Pyx_GIVEREF(__pyx_t_2);
+  PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_signalfd);
+  __Pyx_GIVEREF(__pyx_n_s_signalfd);
+  PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_n_s_signalfd);
+  __pyx_t_2 = 0;
+
+0146:           (libev.EVFLAG_NOSIGMASK, 'nosigmask')]
+
+  __pyx_t_2 = __Pyx_PyInt_From_int(EVFLAG_NOSIGMASK); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 146, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 146, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_12);
+  __Pyx_GIVEREF(__pyx_t_2);
+  PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_nosigmask);
+  __Pyx_GIVEREF(__pyx_n_s_nosigmask);
+  PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_n_s_nosigmask);
+  __pyx_t_2 = 0;
+
 0147: 
+
 0148: 
+
+0149: _flags_str2int = dict((string, flag) for (flag, string) in _flags)
+
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_22genexpr(CYTHON_UNUSED PyObject *__pyx_self) {
+  struct __pyx_obj_6gevent_5libev_8corecext___pyx_scope_struct__genexpr *__pyx_cur_scope;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("genexpr", 0);
+  __pyx_cur_scope = (struct __pyx_obj_6gevent_5libev_8corecext___pyx_scope_struct__genexpr *)__pyx_tp_new_6gevent_5libev_8corecext___pyx_scope_struct__genexpr(__pyx_ptype_6gevent_5libev_8corecext___pyx_scope_struct__genexpr, __pyx_empty_tuple, NULL);
+  if (unlikely(!__pyx_cur_scope)) {
+    __pyx_cur_scope = ((struct __pyx_obj_6gevent_5libev_8corecext___pyx_scope_struct__genexpr *)Py_None);
+    __Pyx_INCREF(Py_None);
+    __PYX_ERR(0, 149, __pyx_L1_error)
+  } else {
+    __Pyx_GOTREF(__pyx_cur_scope);
+  }
+  {
+    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_6gevent_5libev_8corecext_24generator, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_genexpr, __pyx_n_s_gevent_libev_corecext); if (unlikely(!gen)) __PYX_ERR(0, 149, __pyx_L1_error)
+    __Pyx_DECREF(__pyx_cur_scope);
+    __Pyx_RefNannyFinishContext();
+    return (PyObject *) gen;
+  }
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_AddTraceback("gevent.libev.corecext.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_gb_6gevent_5libev_8corecext_24generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
+{
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("genexpr", 0);
+  __pyx_L3_first_run:;
+  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 149, __pyx_L1_error)
+  __pyx_r = PyDict_New(); if (unlikely(!__pyx_r)) __PYX_ERR(0, 149, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_r);
+  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 149, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
+    __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
+    __pyx_t_4 = NULL;
+  } else {
+    __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 149, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 149, __pyx_L1_error)
+  }
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  for (;;) {
+    if (likely(!__pyx_t_4)) {
+      if (likely(PyList_CheckExact(__pyx_t_2))) {
+        if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
+        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 149, __pyx_L1_error)
+        #else
+        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 149, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_1);
+        #endif
+      } else {
+        if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
+        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 149, __pyx_L1_error)
+        #else
+        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 149, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_1);
+        #endif
+      }
+    } else {
+      __pyx_t_1 = __pyx_t_4(__pyx_t_2);
+      if (unlikely(!__pyx_t_1)) {
+        PyObject* exc_type = PyErr_Occurred();
+        if (exc_type) {
+          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+          else __PYX_ERR(0, 149, __pyx_L1_error)
+        }
+        break;
+      }
+      __Pyx_GOTREF(__pyx_t_1);
+    }
+    if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
+      PyObject* sequence = __pyx_t_1;
+      Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
+      if (unlikely(size != 2)) {
+        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
+        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
+        __PYX_ERR(0, 149, __pyx_L1_error)
+      }
+      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+      if (likely(PyTuple_CheckExact(sequence))) {
+        __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); 
+        __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); 
+      } else {
+        __pyx_t_5 = PyList_GET_ITEM(sequence, 0); 
+        __pyx_t_6 = PyList_GET_ITEM(sequence, 1); 
+      }
+      __Pyx_INCREF(__pyx_t_5);
+      __Pyx_INCREF(__pyx_t_6);
+      #else
+      __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 149, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_5);
+      __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 149, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_6);
+      #endif
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    } else {
+      Py_ssize_t index = -1;
+      __pyx_t_7 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 149, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_7);
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
+      index = 0; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L6_unpacking_failed;
+      __Pyx_GOTREF(__pyx_t_5);
+      index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L6_unpacking_failed;
+      __Pyx_GOTREF(__pyx_t_6);
+      if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(0, 149, __pyx_L1_error)
+      __pyx_t_8 = NULL;
+      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+      goto __pyx_L7_unpacking_done;
+      __pyx_L6_unpacking_failed:;
+      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+      __pyx_t_8 = NULL;
+      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
+      __PYX_ERR(0, 149, __pyx_L1_error)
+      __pyx_L7_unpacking_done:;
+    }
+    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_flag);
+    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_flag, __pyx_t_5);
+    __Pyx_GIVEREF(__pyx_t_5);
+    __pyx_t_5 = 0;
+    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_string);
+    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_string, __pyx_t_6);
+    __Pyx_GIVEREF(__pyx_t_6);
+    __pyx_t_6 = 0;
+    if (unlikely(PyDict_SetItem(__pyx_r, (PyObject*)__pyx_cur_scope->__pyx_v_string, (PyObject*)__pyx_cur_scope->__pyx_v_flag))) __PYX_ERR(0, 149, __pyx_L1_error)
+  }
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);
+
+  /* function exit code */
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_XDECREF(__pyx_t_6);
+  __Pyx_XDECREF(__pyx_t_7);
+  __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  #if !CYTHON_USE_EXC_INFO_STACK
+  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
+  #endif
+  __pyx_generator->resume_label = -1;
+  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+PyObject *GEVENT_CORE_EVENTS = 0;
+PyObject *_empty_tuple = 0;
+
+  __pyx_t_2 = __pyx_pf_6gevent_5libev_8corecext_22genexpr(NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 149, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_12 = __Pyx_Generator_Next(__pyx_t_2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 149, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_12);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_flags_str2int, __pyx_t_12) < 0) __PYX_ERR(0, 149, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
+
+struct __pyx_obj_6gevent_5libev_8corecext___pyx_scope_struct__genexpr {
+  PyObject_HEAD
+  PyObject *__pyx_v_flag;
+  PyObject *__pyx_v_string;
+};
+
+
+
 0150: 
+
 0151: 
+
+0152: _events = [(libev.EV_READ,     'READ'),
+
+  __pyx_t_12 = __Pyx_PyInt_From_int(EV_READ); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 152, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_12);
+  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 152, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_GIVEREF(__pyx_t_12);
+  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_12);
+  __Pyx_INCREF(__pyx_n_s_READ);
+  __Pyx_GIVEREF(__pyx_n_s_READ);
+  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_READ);
+  __pyx_t_12 = 0;
+
+  __pyx_t_12 = PyList_New(16); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 152, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_12);
+  __Pyx_GIVEREF(__pyx_t_2);
+  PyList_SET_ITEM(__pyx_t_12, 0, __pyx_t_2);
+  __Pyx_GIVEREF(__pyx_t_11);
+  PyList_SET_ITEM(__pyx_t_12, 1, __pyx_t_11);
+  __Pyx_GIVEREF(__pyx_t_10);
+  PyList_SET_ITEM(__pyx_t_12, 2, __pyx_t_10);
+  __Pyx_GIVEREF(__pyx_t_9);
+  PyList_SET_ITEM(__pyx_t_12, 3, __pyx_t_9);
+  __Pyx_GIVEREF(__pyx_t_8);
+  PyList_SET_ITEM(__pyx_t_12, 4, __pyx_t_8);
+  __Pyx_GIVEREF(__pyx_t_7);
+  PyList_SET_ITEM(__pyx_t_12, 5, __pyx_t_7);
+  __Pyx_GIVEREF(__pyx_t_6);
+  PyList_SET_ITEM(__pyx_t_12, 6, __pyx_t_6);
+  __Pyx_GIVEREF(__pyx_t_5);
+  PyList_SET_ITEM(__pyx_t_12, 7, __pyx_t_5);
+  __Pyx_GIVEREF(__pyx_t_4);
+  PyList_SET_ITEM(__pyx_t_12, 8, __pyx_t_4);
+  __Pyx_GIVEREF(__pyx_t_1);
+  PyList_SET_ITEM(__pyx_t_12, 9, __pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_13);
+  PyList_SET_ITEM(__pyx_t_12, 10, __pyx_t_13);
+  __Pyx_GIVEREF(__pyx_t_14);
+  PyList_SET_ITEM(__pyx_t_12, 11, __pyx_t_14);
+  __Pyx_GIVEREF(__pyx_t_15);
+  PyList_SET_ITEM(__pyx_t_12, 12, __pyx_t_15);
+  __Pyx_GIVEREF(__pyx_t_16);
+  PyList_SET_ITEM(__pyx_t_12, 13, __pyx_t_16);
+  __Pyx_GIVEREF(__pyx_t_17);
+  PyList_SET_ITEM(__pyx_t_12, 14, __pyx_t_17);
+  __Pyx_GIVEREF(__pyx_t_18);
+  PyList_SET_ITEM(__pyx_t_12, 15, __pyx_t_18);
+  __pyx_t_2 = 0;
+  __pyx_t_11 = 0;
+  __pyx_t_10 = 0;
+  __pyx_t_9 = 0;
+  __pyx_t_8 = 0;
+  __pyx_t_7 = 0;
+  __pyx_t_6 = 0;
+  __pyx_t_5 = 0;
+  __pyx_t_4 = 0;
+  __pyx_t_1 = 0;
+  __pyx_t_13 = 0;
+  __pyx_t_14 = 0;
+  __pyx_t_15 = 0;
+  __pyx_t_16 = 0;
+  __pyx_t_17 = 0;
+  __pyx_t_18 = 0;
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_events, __pyx_t_12) < 0) __PYX_ERR(0, 152, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
+
+0153:            (libev.EV_WRITE,    'WRITE'),
+
+  __pyx_t_12 = __Pyx_PyInt_From_int(EV_WRITE); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 153, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_12);
+  __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 153, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_11);
+  __Pyx_GIVEREF(__pyx_t_12);
+  PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_12);
+  __Pyx_INCREF(__pyx_n_s_WRITE);
+  __Pyx_GIVEREF(__pyx_n_s_WRITE);
+  PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_n_s_WRITE);
+  __pyx_t_12 = 0;
+
+0154:            (libev.EV__IOFDSET, '_IOFDSET'),
+
+  __pyx_t_12 = __Pyx_PyInt_From_int(EV__IOFDSET); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 154, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_12);
+  __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 154, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_10);
+  __Pyx_GIVEREF(__pyx_t_12);
+  PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_12);
+  __Pyx_INCREF(__pyx_n_s_IOFDSET);
+  __Pyx_GIVEREF(__pyx_n_s_IOFDSET);
+  PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_n_s_IOFDSET);
+  __pyx_t_12 = 0;
+
+0155:            (libev.EV_PERIODIC, 'PERIODIC'),
+
+  __pyx_t_12 = __Pyx_PyInt_From_int(EV_PERIODIC); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 155, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_12);
+  __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 155, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_9);
+  __Pyx_GIVEREF(__pyx_t_12);
+  PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_12);
+  __Pyx_INCREF(__pyx_n_s_PERIODIC);
+  __Pyx_GIVEREF(__pyx_n_s_PERIODIC);
+  PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_n_s_PERIODIC);
+  __pyx_t_12 = 0;
+
+0156:            (libev.EV_SIGNAL,   'SIGNAL'),
+
+  __pyx_t_12 = __Pyx_PyInt_From_int(EV_SIGNAL); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 156, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_12);
+  __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 156, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_8);
+  __Pyx_GIVEREF(__pyx_t_12);
+  PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_12);
+  __Pyx_INCREF(__pyx_n_s_SIGNAL);
+  __Pyx_GIVEREF(__pyx_n_s_SIGNAL);
+  PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_n_s_SIGNAL);
+  __pyx_t_12 = 0;
+
+0157:            (libev.EV_CHILD,    'CHILD'),
+
+  __pyx_t_12 = __Pyx_PyInt_From_int(EV_CHILD); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 157, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_12);
+  __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 157, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_7);
+  __Pyx_GIVEREF(__pyx_t_12);
+  PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_12);
+  __Pyx_INCREF(__pyx_n_s_CHILD);
+  __Pyx_GIVEREF(__pyx_n_s_CHILD);
+  PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_n_s_CHILD);
+  __pyx_t_12 = 0;
+
+0158:            (libev.EV_STAT,     'STAT'),
+
+  __pyx_t_12 = __Pyx_PyInt_From_int(EV_STAT); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 158, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_12);
+  __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 158, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  __Pyx_GIVEREF(__pyx_t_12);
+  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_12);
+  __Pyx_INCREF(__pyx_n_s_STAT);
+  __Pyx_GIVEREF(__pyx_n_s_STAT);
+  PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_n_s_STAT);
+  __pyx_t_12 = 0;
+
+0159:            (libev.EV_IDLE,     'IDLE'),
+
+  __pyx_t_12 = __Pyx_PyInt_From_int(EV_IDLE); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 159, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_12);
+  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 159, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_5);
+  __Pyx_GIVEREF(__pyx_t_12);
+  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_12);
+  __Pyx_INCREF(__pyx_n_s_IDLE);
+  __Pyx_GIVEREF(__pyx_n_s_IDLE);
+  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_n_s_IDLE);
+  __pyx_t_12 = 0;
+
+0160:            (libev.EV_PREPARE,  'PREPARE'),
+
+  __pyx_t_12 = __Pyx_PyInt_From_int(EV_PREPARE); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 160, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_12);
+  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 160, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_4);
+  __Pyx_GIVEREF(__pyx_t_12);
+  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_12);
+  __Pyx_INCREF(__pyx_n_s_PREPARE);
+  __Pyx_GIVEREF(__pyx_n_s_PREPARE);
+  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_n_s_PREPARE);
+  __pyx_t_12 = 0;
+
+0161:            (libev.EV_CHECK,    'CHECK'),
+
+  __pyx_t_12 = __Pyx_PyInt_From_int(EV_CHECK); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 161, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_12);
+  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 161, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_12);
+  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_12);
+  __Pyx_INCREF(__pyx_n_s_CHECK);
+  __Pyx_GIVEREF(__pyx_n_s_CHECK);
+  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_CHECK);
+  __pyx_t_12 = 0;
+
+0162:            (libev.EV_EMBED,    'EMBED'),
+
+  __pyx_t_12 = __Pyx_PyInt_From_int(EV_EMBED); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 162, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_12);
+  __pyx_t_13 = PyTuple_New(2); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 162, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_13);
+  __Pyx_GIVEREF(__pyx_t_12);
+  PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_12);
+  __Pyx_INCREF(__pyx_n_s_EMBED);
+  __Pyx_GIVEREF(__pyx_n_s_EMBED);
+  PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_n_s_EMBED);
+  __pyx_t_12 = 0;
+
+0163:            (libev.EV_FORK,     'FORK'),
+
+  __pyx_t_12 = __Pyx_PyInt_From_int(EV_FORK); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 163, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_12);
+  __pyx_t_14 = PyTuple_New(2); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 163, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_14);
+  __Pyx_GIVEREF(__pyx_t_12);
+  PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_12);
+  __Pyx_INCREF(__pyx_n_s_FORK);
+  __Pyx_GIVEREF(__pyx_n_s_FORK);
+  PyTuple_SET_ITEM(__pyx_t_14, 1, __pyx_n_s_FORK);
+  __pyx_t_12 = 0;
+
+0164:            (libev.EV_CLEANUP,  'CLEANUP'),
+
+  __pyx_t_12 = __Pyx_PyInt_From_int(EV_CLEANUP); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 164, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_12);
+  __pyx_t_15 = PyTuple_New(2); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 164, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_15);
+  __Pyx_GIVEREF(__pyx_t_12);
+  PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_12);
+  __Pyx_INCREF(__pyx_n_s_CLEANUP);
+  __Pyx_GIVEREF(__pyx_n_s_CLEANUP);
+  PyTuple_SET_ITEM(__pyx_t_15, 1, __pyx_n_s_CLEANUP);
+  __pyx_t_12 = 0;
+
+0165:            (libev.EV_ASYNC,    'ASYNC'),
+
+  __pyx_t_12 = __Pyx_PyInt_From_int(EV_ASYNC); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 165, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_12);
+  __pyx_t_16 = PyTuple_New(2); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 165, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_16);
+  __Pyx_GIVEREF(__pyx_t_12);
+  PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_12);
+  __Pyx_INCREF(__pyx_n_s_ASYNC);
+  __Pyx_GIVEREF(__pyx_n_s_ASYNC);
+  PyTuple_SET_ITEM(__pyx_t_16, 1, __pyx_n_s_ASYNC);
+  __pyx_t_12 = 0;
+
+0166:            (libev.EV_CUSTOM,   'CUSTOM'),
+
+  __pyx_t_12 = __Pyx_PyInt_From_int(EV_CUSTOM); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 166, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_12);
+  __pyx_t_17 = PyTuple_New(2); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 166, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_17);
+  __Pyx_GIVEREF(__pyx_t_12);
+  PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_12);
+  __Pyx_INCREF(__pyx_n_s_CUSTOM);
+  __Pyx_GIVEREF(__pyx_n_s_CUSTOM);
+  PyTuple_SET_ITEM(__pyx_t_17, 1, __pyx_n_s_CUSTOM);
+  __pyx_t_12 = 0;
+
+0167:            (libev.EV_ERROR,    'ERROR')]
+
+  __pyx_t_12 = __Pyx_PyInt_From_int(EV_ERROR); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 167, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_12);
+  __pyx_t_18 = PyTuple_New(2); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 167, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_18);
+  __Pyx_GIVEREF(__pyx_t_12);
+  PyTuple_SET_ITEM(__pyx_t_18, 0, __pyx_t_12);
+  __Pyx_INCREF(__pyx_n_s_ERROR);
+  __Pyx_GIVEREF(__pyx_n_s_ERROR);
+  PyTuple_SET_ITEM(__pyx_t_18, 1, __pyx_n_s_ERROR);
+  __pyx_t_12 = 0;
+
 0168: 
+
 0169: 
+
+0170: cpdef _flags_to_list(unsigned int flags):
+
+
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_5_flags_to_list(PyObject *__pyx_self, PyObject *__pyx_arg_flags); /*proto*/
+static PyObject *__pyx_f_6gevent_5libev_8corecext__flags_to_list(unsigned int __pyx_v_flags, CYTHON_UNUSED int __pyx_skip_dispatch) {
+  PyObject *__pyx_v_result = 0;
+  PyObject *__pyx_v_code = NULL;
+  PyObject *__pyx_v_value = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_flags_to_list", 0);
+
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_XDECREF(__pyx_t_6);
+  __Pyx_XDECREF(__pyx_t_7);
+  __Pyx_AddTraceback("gevent.libev.corecext._flags_to_list", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_result);
+  __Pyx_XDECREF(__pyx_v_code);
+  __Pyx_XDECREF(__pyx_v_value);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_5_flags_to_list(PyObject *__pyx_self, PyObject *__pyx_arg_flags); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_5_flags_to_list(PyObject *__pyx_self, PyObject *__pyx_arg_flags) {
+  unsigned int __pyx_v_flags;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_flags_to_list (wrapper)", 0);
+  assert(__pyx_arg_flags); {
+    __pyx_v_flags = __Pyx_PyInt_As_unsigned_int(__pyx_arg_flags); if (unlikely((__pyx_v_flags == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 170, __pyx_L3_error)
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.libev.corecext._flags_to_list", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4_flags_to_list(__pyx_self, ((unsigned int)__pyx_v_flags));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_4_flags_to_list(CYTHON_UNUSED PyObject *__pyx_self, unsigned int __pyx_v_flags) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_flags_to_list", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __pyx_f_6gevent_5libev_8corecext__flags_to_list(__pyx_v_flags, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 170, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.libev.corecext._flags_to_list", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0171:     cdef list result = []
+
+  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 171, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_v_result = ((PyObject*)__pyx_t_1);
+  __pyx_t_1 = 0;
+
+0172:     for code, value in _flags:
+
+  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 172, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
+    __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
+    __pyx_t_4 = NULL;
+  } else {
+    __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 172, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 172, __pyx_L1_error)
+  }
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  for (;;) {
+    if (likely(!__pyx_t_4)) {
+      if (likely(PyList_CheckExact(__pyx_t_2))) {
+        if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
+        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 172, __pyx_L1_error)
+        #else
+        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 172, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_1);
+        #endif
+      } else {
+        if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
+        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 172, __pyx_L1_error)
+        #else
+        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 172, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_1);
+        #endif
+      }
+    } else {
+      __pyx_t_1 = __pyx_t_4(__pyx_t_2);
+      if (unlikely(!__pyx_t_1)) {
+        PyObject* exc_type = PyErr_Occurred();
+        if (exc_type) {
+          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+          else __PYX_ERR(0, 172, __pyx_L1_error)
+        }
+        break;
+      }
+      __Pyx_GOTREF(__pyx_t_1);
+    }
+    if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
+      PyObject* sequence = __pyx_t_1;
+      Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
+      if (unlikely(size != 2)) {
+        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
+        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
+        __PYX_ERR(0, 172, __pyx_L1_error)
+      }
+      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+      if (likely(PyTuple_CheckExact(sequence))) {
+        __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); 
+        __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); 
+      } else {
+        __pyx_t_5 = PyList_GET_ITEM(sequence, 0); 
+        __pyx_t_6 = PyList_GET_ITEM(sequence, 1); 
+      }
+      __Pyx_INCREF(__pyx_t_5);
+      __Pyx_INCREF(__pyx_t_6);
+      #else
+      __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 172, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_5);
+      __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 172, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_6);
+      #endif
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    } else {
+      Py_ssize_t index = -1;
+      __pyx_t_7 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 172, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_7);
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
+      index = 0; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L5_unpacking_failed;
+      __Pyx_GOTREF(__pyx_t_5);
+      index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed;
+      __Pyx_GOTREF(__pyx_t_6);
+      if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(0, 172, __pyx_L1_error)
+      __pyx_t_8 = NULL;
+      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+      goto __pyx_L6_unpacking_done;
+      __pyx_L5_unpacking_failed:;
+      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+      __pyx_t_8 = NULL;
+      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
+      __PYX_ERR(0, 172, __pyx_L1_error)
+      __pyx_L6_unpacking_done:;
+    }
+    __Pyx_XDECREF_SET(__pyx_v_code, __pyx_t_5);
+    __pyx_t_5 = 0;
+    __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_6);
+    __pyx_t_6 = 0;
+
+  }
+  __pyx_L4_break:;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+0173:         if flags & code:
+
+    __pyx_t_1 = __Pyx_PyInt_From_unsigned_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 173, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __pyx_t_6 = PyNumber_And(__pyx_t_1, __pyx_v_code); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 173, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_6);
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 173, __pyx_L1_error)
+    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+    if (__pyx_t_9) {
+
+    }
+
+0174:             result.append(value)
+
+      __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_value); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(0, 174, __pyx_L1_error)
+
+0175:         flags &= ~code
+
+    __pyx_t_6 = __Pyx_PyInt_From_unsigned_int(__pyx_v_flags); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 175, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_6);
+    __pyx_t_1 = PyNumber_Invert(__pyx_v_code); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 175, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __pyx_t_5 = PyNumber_InPlaceAnd(__pyx_t_6, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 175, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_5);
+    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __pyx_t_11 = __Pyx_PyInt_As_unsigned_int(__pyx_t_5); if (unlikely((__pyx_t_11 == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 175, __pyx_L1_error)
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __pyx_v_flags = __pyx_t_11;
+
+0176:         if not flags:
+
+    __pyx_t_9 = ((!(__pyx_v_flags != 0)) != 0);
+    if (__pyx_t_9) {
+
+    }
+
+0177:             break
+
+      goto __pyx_L4_break;
+
+0178:     if flags:
+
+  __pyx_t_9 = (__pyx_v_flags != 0);
+  if (__pyx_t_9) {
+
+  }
+
+0179:         result.append(flags)
+
+    __pyx_t_2 = __Pyx_PyInt_From_unsigned_int(__pyx_v_flags); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 179, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_2); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(0, 179, __pyx_L1_error)
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+0180:     return result
+
+  __Pyx_XDECREF(__pyx_r);
+  __Pyx_INCREF(__pyx_v_result);
+  __pyx_r = __pyx_v_result;
+  goto __pyx_L0;
+
 0181: 
+
 0182: 
+
+0183: if sys.version_info[0] >= 3:
+
+  __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_sys); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 183, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_12);
+  __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_version_info); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 183, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_18);
+  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
+  __pyx_t_12 = __Pyx_GetItemInt(__pyx_t_18, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 183, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_12);
+  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
+  __pyx_t_18 = PyObject_RichCompare(__pyx_t_12, __pyx_int_3, Py_GE); __Pyx_XGOTREF(__pyx_t_18); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 183, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
+  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_18); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 183, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
+  if (__pyx_t_3) {
+
+    goto __pyx_L3;
+  }
+
+0184:     basestring = (bytes, str)
+
+    __pyx_t_18 = PyTuple_New(2); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 184, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_18);
+    __Pyx_INCREF(((PyObject *)(&PyBytes_Type)));
+    __Pyx_GIVEREF(((PyObject *)(&PyBytes_Type)));
+    PyTuple_SET_ITEM(__pyx_t_18, 0, ((PyObject *)(&PyBytes_Type)));
+    __Pyx_INCREF(((PyObject *)(&PyString_Type)));
+    __Pyx_GIVEREF(((PyObject *)(&PyString_Type)));
+    PyTuple_SET_ITEM(__pyx_t_18, 1, ((PyObject *)(&PyString_Type)));
+    if (PyDict_SetItem(__pyx_d, __pyx_n_s_basestring, __pyx_t_18) < 0) __PYX_ERR(0, 184, __pyx_L1_error)
+    __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
+
 0185: else:
+
+0186:     basestring = __builtins__.basestring
+
+  /*else*/ {
+    __Pyx_GetModuleGlobalName(__pyx_t_18, __pyx_n_s_builtins); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 186, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_18);
+    __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_18, __pyx_n_s_basestring); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 186, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_12);
+    __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
+    if (PyDict_SetItem(__pyx_d, __pyx_n_s_basestring, __pyx_t_12) < 0) __PYX_ERR(0, 186, __pyx_L1_error)
+    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
+  }
+  __pyx_L3:;
+
 0187: 
+
 0188: 
+
+0189: cpdef unsigned int _flags_to_int(object flags) except? -1:
+
+
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_7_flags_to_int(PyObject *__pyx_self, PyObject *__pyx_v_flags); /*proto*/
+static unsigned int __pyx_f_6gevent_5libev_8corecext__flags_to_int(PyObject *__pyx_v_flags, CYTHON_UNUSED int __pyx_skip_dispatch) {
+  unsigned int __pyx_v_result;
+  PyObject *__pyx_v_value = NULL;
+  PyObject *__pyx_v_ex = NULL;
+  unsigned int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_flags_to_int", 0);
+  __Pyx_INCREF(__pyx_v_flags);
+
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_8);
+  __Pyx_XDECREF(__pyx_t_9);
+  __Pyx_XDECREF(__pyx_t_12);
+  __Pyx_XDECREF(__pyx_t_13);
+  __Pyx_XDECREF(__pyx_t_15);
+  __Pyx_XDECREF(__pyx_t_16);
+  __Pyx_AddTraceback("gevent.libev.corecext._flags_to_int", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = -1;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_value);
+  __Pyx_XDECREF(__pyx_v_ex);
+  __Pyx_XDECREF(__pyx_v_flags);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_7_flags_to_int(PyObject *__pyx_self, PyObject *__pyx_v_flags); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_7_flags_to_int(PyObject *__pyx_self, PyObject *__pyx_v_flags) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_flags_to_int (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_6_flags_to_int(__pyx_self, ((PyObject *)__pyx_v_flags));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_6_flags_to_int(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_flags) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_flags_to_int", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __pyx_f_6gevent_5libev_8corecext__flags_to_int(__pyx_v_flags, 0); if (unlikely(__pyx_t_1 == ((unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 189, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyInt_From_unsigned_int(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 189, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_r = __pyx_t_2;
+  __pyx_t_2 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_AddTraceback("gevent.libev.corecext._flags_to_int", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
 0190:     # Note, that order does not matter, libev has its own predefined order
+
+0191:     if not flags:
+
+  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_flags); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 191, __pyx_L1_error)
+  __pyx_t_2 = ((!__pyx_t_1) != 0);
+  if (__pyx_t_2) {
+
+  }
+
+0192:         return 0
+
+    __pyx_r = 0;
+    goto __pyx_L0;
+
+0193:     if isinstance(flags, integer_types):
+
+  __pyx_t_3 = __pyx_v_6gevent_5libev_8corecext_integer_types;
+  __Pyx_INCREF(__pyx_t_3);
+  __pyx_t_2 = PyObject_IsInstance(__pyx_v_flags, __pyx_t_3); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 193, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __pyx_t_1 = (__pyx_t_2 != 0);
+  if (__pyx_t_1) {
+
+  }
+
+0194:         return flags
+
+    __pyx_t_4 = __Pyx_PyInt_As_unsigned_int(__pyx_v_flags); if (unlikely((__pyx_t_4 == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 194, __pyx_L1_error)
+    __pyx_r = __pyx_t_4;
+    goto __pyx_L0;
+
+0195:     cdef unsigned int result = 0
+
+  __pyx_v_result = 0;
+
+0196:     try:
+
+  {
+    /*try:*/ {
+
+    }
+    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+    goto __pyx_L10_try_end;
+    __pyx_L5_error:;
+    __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
+    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
+    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
+    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
+    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+
+    __Pyx_XGIVEREF(__pyx_t_5);
+    __Pyx_XGIVEREF(__pyx_t_6);
+    __Pyx_XGIVEREF(__pyx_t_7);
+    __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7);
+    goto __pyx_L1_error;
+    __pyx_L10_try_end:;
+  }
+
+0197:         if isinstance(flags, basestring):
+
+      __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_basestring); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 197, __pyx_L5_error)
+      __Pyx_GOTREF(__pyx_t_3);
+      __pyx_t_1 = PyObject_IsInstance(__pyx_v_flags, __pyx_t_3); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 197, __pyx_L5_error)
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __pyx_t_2 = (__pyx_t_1 != 0);
+      if (__pyx_t_2) {
+
+      }
+
+0198:             flags = flags.split(',')
+
+        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_flags, __pyx_n_s_split); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 198, __pyx_L5_error)
+        __Pyx_GOTREF(__pyx_t_8);
+        __pyx_t_9 = NULL;
+        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
+          __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8);
+          if (likely(__pyx_t_9)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
+            __Pyx_INCREF(__pyx_t_9);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_8, function);
+          }
+        }
+        __pyx_t_3 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_9, __pyx_kp_s_) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_kp_s_);
+        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
+        if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 198, __pyx_L5_error)
+        __Pyx_GOTREF(__pyx_t_3);
+        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+        __Pyx_DECREF_SET(__pyx_v_flags, __pyx_t_3);
+        __pyx_t_3 = 0;
+
+0199:         for value in flags:
+
+      if (likely(PyList_CheckExact(__pyx_v_flags)) || PyTuple_CheckExact(__pyx_v_flags)) {
+        __pyx_t_3 = __pyx_v_flags; __Pyx_INCREF(__pyx_t_3); __pyx_t_10 = 0;
+        __pyx_t_11 = NULL;
+      } else {
+        __pyx_t_10 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_flags); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 199, __pyx_L5_error)
+        __Pyx_GOTREF(__pyx_t_3);
+        __pyx_t_11 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 199, __pyx_L5_error)
+      }
+      for (;;) {
+        if (likely(!__pyx_t_11)) {
+          if (likely(PyList_CheckExact(__pyx_t_3))) {
+            if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_3)) break;
+            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+            __pyx_t_8 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_10); __Pyx_INCREF(__pyx_t_8); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 199, __pyx_L5_error)
+            #else
+            __pyx_t_8 = PySequence_ITEM(__pyx_t_3, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 199, __pyx_L5_error)
+            __Pyx_GOTREF(__pyx_t_8);
+            #endif
+          } else {
+            if (__pyx_t_10 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
+            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+            __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_10); __Pyx_INCREF(__pyx_t_8); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 199, __pyx_L5_error)
+            #else
+            __pyx_t_8 = PySequence_ITEM(__pyx_t_3, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 199, __pyx_L5_error)
+            __Pyx_GOTREF(__pyx_t_8);
+            #endif
+          }
+        } else {
+          __pyx_t_8 = __pyx_t_11(__pyx_t_3);
+          if (unlikely(!__pyx_t_8)) {
+            PyObject* exc_type = PyErr_Occurred();
+            if (exc_type) {
+              if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+              else __PYX_ERR(0, 199, __pyx_L5_error)
+            }
+            break;
+          }
+          __Pyx_GOTREF(__pyx_t_8);
+        }
+        __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_8);
+        __pyx_t_8 = 0;
+
+      }
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+
+0200:             value = value.strip().lower()
+
+        __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_value, __pyx_n_s_strip); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 200, __pyx_L5_error)
+        __Pyx_GOTREF(__pyx_t_12);
+        __pyx_t_13 = NULL;
+        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) {
+          __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_12);
+          if (likely(__pyx_t_13)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
+            __Pyx_INCREF(__pyx_t_13);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_12, function);
+          }
+        }
+        __pyx_t_9 = (__pyx_t_13) ? __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_13) : __Pyx_PyObject_CallNoArg(__pyx_t_12);
+        __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
+        if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 200, __pyx_L5_error)
+        __Pyx_GOTREF(__pyx_t_9);
+        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
+        __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_lower); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 200, __pyx_L5_error)
+        __Pyx_GOTREF(__pyx_t_12);
+        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+        __pyx_t_9 = NULL;
+        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) {
+          __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_12);
+          if (likely(__pyx_t_9)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
+            __Pyx_INCREF(__pyx_t_9);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_12, function);
+          }
+        }
+        __pyx_t_8 = (__pyx_t_9) ? __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_9) : __Pyx_PyObject_CallNoArg(__pyx_t_12);
+        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
+        if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 200, __pyx_L5_error)
+        __Pyx_GOTREF(__pyx_t_8);
+        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
+        __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_8);
+        __pyx_t_8 = 0;
+
+0201:             if value:
+
+        __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_value); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 201, __pyx_L5_error)
+        if (__pyx_t_2) {
+
+        }
+
+0202:                 result |= _flags_str2int[value]
+
+          __pyx_t_8 = __Pyx_PyInt_From_unsigned_int(__pyx_v_result); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 202, __pyx_L5_error)
+          __Pyx_GOTREF(__pyx_t_8);
+          __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_flags_str2int); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 202, __pyx_L5_error)
+          __Pyx_GOTREF(__pyx_t_12);
+          __pyx_t_9 = __Pyx_PyObject_GetItem(__pyx_t_12, __pyx_v_value); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 202, __pyx_L5_error)
+          __Pyx_GOTREF(__pyx_t_9);
+          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
+          __pyx_t_12 = PyNumber_InPlaceOr(__pyx_t_8, __pyx_t_9); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 202, __pyx_L5_error)
+          __Pyx_GOTREF(__pyx_t_12);
+          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+          __pyx_t_4 = __Pyx_PyInt_As_unsigned_int(__pyx_t_12); if (unlikely((__pyx_t_4 == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 202, __pyx_L5_error)
+          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
+          __pyx_v_result = __pyx_t_4;
+
+0203:     except KeyError as ex:
+
+    __pyx_t_14 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
+    if (__pyx_t_14) {
+      __Pyx_AddTraceback("gevent.libev.corecext._flags_to_int", __pyx_clineno, __pyx_lineno, __pyx_filename);
+      if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_12, &__pyx_t_9) < 0) __PYX_ERR(0, 203, __pyx_L7_except_error)
+      __Pyx_GOTREF(__pyx_t_3);
+      __Pyx_GOTREF(__pyx_t_12);
+      __Pyx_GOTREF(__pyx_t_9);
+      __Pyx_INCREF(__pyx_t_12);
+      __pyx_v_ex = __pyx_t_12;
+      /*try:*/ {
+
+      /*finally:*/ {
+        __pyx_L20_error:;
+        /*exception exit:*/{
+          __Pyx_PyThreadState_declare
+          __Pyx_PyThreadState_assign
+          __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_t_23 = 0; __pyx_t_24 = 0; __pyx_t_25 = 0;
+          __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
+          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
+          __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
+          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
+          if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_23, &__pyx_t_24, &__pyx_t_25);
+          if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22) < 0)) __Pyx_ErrFetch(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22);
+          __Pyx_XGOTREF(__pyx_t_20);
+          __Pyx_XGOTREF(__pyx_t_21);
+          __Pyx_XGOTREF(__pyx_t_22);
+          __Pyx_XGOTREF(__pyx_t_23);
+          __Pyx_XGOTREF(__pyx_t_24);
+          __Pyx_XGOTREF(__pyx_t_25);
+          __pyx_t_14 = __pyx_lineno; __pyx_t_18 = __pyx_clineno; __pyx_t_19 = __pyx_filename;
+          {
+            __Pyx_DECREF(__pyx_v_ex);
+            __pyx_v_ex = NULL;
+          }
+          if (PY_MAJOR_VERSION >= 3) {
+            __Pyx_XGIVEREF(__pyx_t_23);
+            __Pyx_XGIVEREF(__pyx_t_24);
+            __Pyx_XGIVEREF(__pyx_t_25);
+            __Pyx_ExceptionReset(__pyx_t_23, __pyx_t_24, __pyx_t_25);
+          }
+          __Pyx_XGIVEREF(__pyx_t_20);
+          __Pyx_XGIVEREF(__pyx_t_21);
+          __Pyx_XGIVEREF(__pyx_t_22);
+          __Pyx_ErrRestore(__pyx_t_20, __pyx_t_21, __pyx_t_22);
+          __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_t_23 = 0; __pyx_t_24 = 0; __pyx_t_25 = 0;
+          __pyx_lineno = __pyx_t_14; __pyx_clineno = __pyx_t_18; __pyx_filename = __pyx_t_19;
+          goto __pyx_L7_except_error;
+        }
+      }
+    }
+    goto __pyx_L7_except_error;
+    __pyx_L7_except_error:;
+
+0204:         raise ValueError('Invalid backend or flag: %s\nPossible values: %s' % (ex, ', '.join(sorted(_flags_str2int.keys()))))
+
+        __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_n_s_flags_str2int); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 204, __pyx_L20_error)
+        __Pyx_GOTREF(__pyx_t_15);
+        __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_n_s_keys); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 204, __pyx_L20_error)
+        __Pyx_GOTREF(__pyx_t_16);
+        __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
+        __pyx_t_15 = NULL;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_16))) {
+          __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_16);
+          if (likely(__pyx_t_15)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_16);
+            __Pyx_INCREF(__pyx_t_15);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_16, function);
+          }
+        }
+        __pyx_t_13 = (__pyx_t_15) ? __Pyx_PyObject_CallOneArg(__pyx_t_16, __pyx_t_15) : __Pyx_PyObject_CallNoArg(__pyx_t_16);
+        __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
+        if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 204, __pyx_L20_error)
+        __Pyx_GOTREF(__pyx_t_13);
+        __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
+        __pyx_t_16 = PySequence_List(__pyx_t_13); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 204, __pyx_L20_error)
+        __Pyx_GOTREF(__pyx_t_16);
+        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+        __pyx_t_8 = ((PyObject*)__pyx_t_16);
+        __pyx_t_16 = 0;
+        __pyx_t_17 = PyList_Sort(__pyx_t_8); if (unlikely(__pyx_t_17 == ((int)-1))) __PYX_ERR(0, 204, __pyx_L20_error)
+        __pyx_t_16 = __Pyx_PyString_Join(__pyx_kp_s__2, __pyx_t_8); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 204, __pyx_L20_error)
+        __Pyx_GOTREF(__pyx_t_16);
+        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+        __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 204, __pyx_L20_error)
+        __Pyx_GOTREF(__pyx_t_8);
+        __Pyx_INCREF(__pyx_v_ex);
+        __Pyx_GIVEREF(__pyx_v_ex);
+        PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_ex);
+        __Pyx_GIVEREF(__pyx_t_16);
+        PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_16);
+        __pyx_t_16 = 0;
+        __pyx_t_16 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_backend_or_flag_s_Possib, __pyx_t_8); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 204, __pyx_L20_error)
+        __Pyx_GOTREF(__pyx_t_16);
+        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+        __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_16); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 204, __pyx_L20_error)
+        __Pyx_GOTREF(__pyx_t_8);
+        __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
+        __Pyx_Raise(__pyx_t_8, 0, 0, 0);
+        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+        __PYX_ERR(0, 204, __pyx_L20_error)
+      }
+
+0205:     return result
+
+  __pyx_r = __pyx_v_result;
+  goto __pyx_L0;
+
 0206: 
+
 0207: 
+
+0208: cdef str _str_hex(object flag):
+
+
+static PyObject *__pyx_f_6gevent_5libev_8corecext__str_hex(PyObject *__pyx_v_flag) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_str_hex", 0);
+
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.libev.corecext._str_hex", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0209:     if isinstance(flag, integer_types):
+
+  __pyx_t_1 = __pyx_v_6gevent_5libev_8corecext_integer_types;
+  __Pyx_INCREF(__pyx_t_1);
+  __pyx_t_2 = PyObject_IsInstance(__pyx_v_flag, __pyx_t_1); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 209, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_3 = (__pyx_t_2 != 0);
+  if (__pyx_t_3) {
+
+  }
+
+0210:         return hex(flag)
+
+    __Pyx_XDECREF(__pyx_r);
+    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_hex, __pyx_v_flag); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 210, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    if (!(likely(PyString_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 210, __pyx_L1_error)
+    __pyx_r = ((PyObject*)__pyx_t_1);
+    __pyx_t_1 = 0;
+    goto __pyx_L0;
+
+0211:     return str(flag)
+
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyString_Type)), __pyx_v_flag); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 211, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (!(likely(PyString_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 211, __pyx_L1_error)
+  __pyx_r = ((PyObject*)__pyx_t_1);
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
 0212: 
+
 0213: 
+
+0214: cpdef _check_flags(unsigned int flags):
+
+
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_9_check_flags(PyObject *__pyx_self, PyObject *__pyx_arg_flags); /*proto*/
+static PyObject *__pyx_f_6gevent_5libev_8corecext__check_flags(unsigned int __pyx_v_flags, CYTHON_UNUSED int __pyx_skip_dispatch) {
+  PyObject *__pyx_v_as_list = 0;
+  PyObject *__pyx_8genexpr1__pyx_v_x = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_check_flags", 0);
+
+
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_AddTraceback("gevent.libev.corecext._check_flags", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_as_list);
+  __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_x);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_9_check_flags(PyObject *__pyx_self, PyObject *__pyx_arg_flags); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_9_check_flags(PyObject *__pyx_self, PyObject *__pyx_arg_flags) {
+  unsigned int __pyx_v_flags;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_check_flags (wrapper)", 0);
+  assert(__pyx_arg_flags); {
+    __pyx_v_flags = __Pyx_PyInt_As_unsigned_int(__pyx_arg_flags); if (unlikely((__pyx_v_flags == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 214, __pyx_L3_error)
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.libev.corecext._check_flags", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_8_check_flags(__pyx_self, ((unsigned int)__pyx_v_flags));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_8_check_flags(CYTHON_UNUSED PyObject *__pyx_self, unsigned int __pyx_v_flags) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_check_flags", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __pyx_f_6gevent_5libev_8corecext__check_flags(__pyx_v_flags, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 214, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.libev.corecext._check_flags", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
 0215:     cdef list as_list
+
+0216:     flags &= libev.EVBACKEND_MASK
+
+  __pyx_v_flags = (__pyx_v_flags & EVBACKEND_MASK);
+
+0217:     if not flags:
+
+  __pyx_t_1 = ((!(__pyx_v_flags != 0)) != 0);
+  if (__pyx_t_1) {
+
+  }
+
+0218:         return
+
+    __Pyx_XDECREF(__pyx_r);
+    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+    goto __pyx_L0;
+
+0219:     if not (flags & libev.EVBACKEND_ALL):
+
+  __pyx_t_1 = ((!((__pyx_v_flags & EVBACKEND_ALL) != 0)) != 0);
+  if (unlikely(__pyx_t_1)) {
+
+  }
+
+0220:         raise ValueError('Invalid value for backend: 0x%x' % flags)
+
+    __pyx_t_2 = __Pyx_PyInt_From_unsigned_int(__pyx_v_flags); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 220, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_value_for_backend_0x_x, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 220, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 220, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __PYX_ERR(0, 220, __pyx_L1_error)
+
+0221:     if not (flags & libev.ev_supported_backends()):
+
+  __pyx_t_1 = ((!((__pyx_v_flags & ev_supported_backends()) != 0)) != 0);
+  if (unlikely(__pyx_t_1)) {
+
+  }
+
+0222:         as_list = [_str_hex(x) for x in _flags_to_list(flags)]
+
+    { /* enter inner scope */
+      __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 222, __pyx_L8_error)
+      __Pyx_GOTREF(__pyx_t_2);
+      __pyx_t_3 = __pyx_f_6gevent_5libev_8corecext__flags_to_list(__pyx_v_flags, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 222, __pyx_L8_error)
+      __Pyx_GOTREF(__pyx_t_3);
+      if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
+        __pyx_t_4 = __pyx_t_3; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0;
+        __pyx_t_6 = NULL;
+      } else {
+        __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 222, __pyx_L8_error)
+        __Pyx_GOTREF(__pyx_t_4);
+        __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 222, __pyx_L8_error)
+      }
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+      for (;;) {
+        if (likely(!__pyx_t_6)) {
+          if (likely(PyList_CheckExact(__pyx_t_4))) {
+            if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break;
+            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+            __pyx_t_3 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 222, __pyx_L8_error)
+            #else
+            __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 222, __pyx_L8_error)
+            __Pyx_GOTREF(__pyx_t_3);
+            #endif
+          } else {
+            if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
+            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+            __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 222, __pyx_L8_error)
+            #else
+            __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 222, __pyx_L8_error)
+            __Pyx_GOTREF(__pyx_t_3);
+            #endif
+          }
+        } else {
+          __pyx_t_3 = __pyx_t_6(__pyx_t_4);
+          if (unlikely(!__pyx_t_3)) {
+            PyObject* exc_type = PyErr_Occurred();
+            if (exc_type) {
+              if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+              else __PYX_ERR(0, 222, __pyx_L8_error)
+            }
+            break;
+          }
+          __Pyx_GOTREF(__pyx_t_3);
+        }
+        __Pyx_XDECREF_SET(__pyx_8genexpr1__pyx_v_x, __pyx_t_3);
+        __pyx_t_3 = 0;
+        __pyx_t_3 = __pyx_f_6gevent_5libev_8corecext__str_hex(__pyx_8genexpr1__pyx_v_x); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 222, __pyx_L8_error)
+        __Pyx_GOTREF(__pyx_t_3);
+        if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 222, __pyx_L8_error)
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+      }
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_x); __pyx_8genexpr1__pyx_v_x = 0;
+      goto __pyx_L11_exit_scope;
+      __pyx_L8_error:;
+      __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_x); __pyx_8genexpr1__pyx_v_x = 0;
+      goto __pyx_L1_error;
+      __pyx_L11_exit_scope:;
+    } /* exit inner scope */
+    __pyx_v_as_list = ((PyObject*)__pyx_t_2);
+    __pyx_t_2 = 0;
+
+0223:         raise ValueError('Unsupported backend: %s' % '|'.join(as_list))
+
+    __pyx_t_2 = __Pyx_PyString_Join(__pyx_kp_s__3, __pyx_v_as_list); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 223, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Unsupported_backend_s, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 223, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 223, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __PYX_ERR(0, 223, __pyx_L1_error)
+
 0224: 
+
 0225: 
+
+0226: cpdef _events_to_str(int events):
+
+
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_11_events_to_str(PyObject *__pyx_self, PyObject *__pyx_arg_events); /*proto*/
+static PyObject *__pyx_f_6gevent_5libev_8corecext__events_to_str(int __pyx_v_events, CYTHON_UNUSED int __pyx_skip_dispatch) {
+  PyObject *__pyx_v_result = 0;
+  int __pyx_v_c_flag;
+  PyObject *__pyx_v_flag = NULL;
+  PyObject *__pyx_v_string = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_events_to_str", 0);
+
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_XDECREF(__pyx_t_6);
+  __Pyx_XDECREF(__pyx_t_7);
+  __Pyx_AddTraceback("gevent.libev.corecext._events_to_str", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_result);
+  __Pyx_XDECREF(__pyx_v_flag);
+  __Pyx_XDECREF(__pyx_v_string);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_11_events_to_str(PyObject *__pyx_self, PyObject *__pyx_arg_events); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_11_events_to_str(PyObject *__pyx_self, PyObject *__pyx_arg_events) {
+  int __pyx_v_events;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_events_to_str (wrapper)", 0);
+  assert(__pyx_arg_events); {
+    __pyx_v_events = __Pyx_PyInt_As_int(__pyx_arg_events); if (unlikely((__pyx_v_events == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 226, __pyx_L3_error)
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.libev.corecext._events_to_str", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_10_events_to_str(__pyx_self, ((int)__pyx_v_events));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_10_events_to_str(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_events) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_events_to_str", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __pyx_f_6gevent_5libev_8corecext__events_to_str(__pyx_v_events, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 226, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.libev.corecext._events_to_str", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0227:     cdef list result = []
+
+  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 227, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_v_result = ((PyObject*)__pyx_t_1);
+  __pyx_t_1 = 0;
+
 0228:     cdef int c_flag
+
+0229:     for (flag, string) in _events:
+
+  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_events); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 229, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
+    __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
+    __pyx_t_4 = NULL;
+  } else {
+    __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 229, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 229, __pyx_L1_error)
+  }
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  for (;;) {
+    if (likely(!__pyx_t_4)) {
+      if (likely(PyList_CheckExact(__pyx_t_2))) {
+        if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
+        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 229, __pyx_L1_error)
+        #else
+        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 229, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_1);
+        #endif
+      } else {
+        if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
+        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 229, __pyx_L1_error)
+        #else
+        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 229, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_1);
+        #endif
+      }
+    } else {
+      __pyx_t_1 = __pyx_t_4(__pyx_t_2);
+      if (unlikely(!__pyx_t_1)) {
+        PyObject* exc_type = PyErr_Occurred();
+        if (exc_type) {
+          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+          else __PYX_ERR(0, 229, __pyx_L1_error)
+        }
+        break;
+      }
+      __Pyx_GOTREF(__pyx_t_1);
+    }
+    if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
+      PyObject* sequence = __pyx_t_1;
+      Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
+      if (unlikely(size != 2)) {
+        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
+        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
+        __PYX_ERR(0, 229, __pyx_L1_error)
+      }
+      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+      if (likely(PyTuple_CheckExact(sequence))) {
+        __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); 
+        __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); 
+      } else {
+        __pyx_t_5 = PyList_GET_ITEM(sequence, 0); 
+        __pyx_t_6 = PyList_GET_ITEM(sequence, 1); 
+      }
+      __Pyx_INCREF(__pyx_t_5);
+      __Pyx_INCREF(__pyx_t_6);
+      #else
+      __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 229, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_5);
+      __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 229, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_6);
+      #endif
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    } else {
+      Py_ssize_t index = -1;
+      __pyx_t_7 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 229, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_7);
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
+      index = 0; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L5_unpacking_failed;
+      __Pyx_GOTREF(__pyx_t_5);
+      index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed;
+      __Pyx_GOTREF(__pyx_t_6);
+      if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(0, 229, __pyx_L1_error)
+      __pyx_t_8 = NULL;
+      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+      goto __pyx_L6_unpacking_done;
+      __pyx_L5_unpacking_failed:;
+      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+      __pyx_t_8 = NULL;
+      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
+      __PYX_ERR(0, 229, __pyx_L1_error)
+      __pyx_L6_unpacking_done:;
+    }
+    __Pyx_XDECREF_SET(__pyx_v_flag, __pyx_t_5);
+    __pyx_t_5 = 0;
+    __Pyx_XDECREF_SET(__pyx_v_string, __pyx_t_6);
+    __pyx_t_6 = 0;
+
+  }
+  __pyx_L4_break:;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+0230:         c_flag = flag
+
+    __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_v_flag); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 230, __pyx_L1_error)
+    __pyx_v_c_flag = __pyx_t_9;
+
+0231:         if events & c_flag:
+
+    __pyx_t_10 = ((__pyx_v_events & __pyx_v_c_flag) != 0);
+    if (__pyx_t_10) {
+
+    }
+
+0232:             result.append(string)
+
+      __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_string); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 232, __pyx_L1_error)
+
+0233:             events = events & (~c_flag)
+
+      __pyx_v_events = (__pyx_v_events & (~__pyx_v_c_flag));
+
+0234:         if not events:
+
+    __pyx_t_10 = ((!(__pyx_v_events != 0)) != 0);
+    if (__pyx_t_10) {
+
+    }
+
+0235:             break
+
+      goto __pyx_L4_break;
+
+0236:     if events:
+
+  __pyx_t_10 = (__pyx_v_events != 0);
+  if (__pyx_t_10) {
+
+  }
+
+0237:         result.append(hex(events))
+
+    __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_events); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 237, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_hex, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 237, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_1); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 237, __pyx_L1_error)
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+0238:     return '|'.join(result)
+
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __Pyx_PyString_Join(__pyx_kp_s__3, __pyx_v_result); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 238, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
 0239: 
+
 0240: 
+
+0241: def supported_backends():
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_13supported_backends(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyMethodDef __pyx_mdef_6gevent_5libev_8corecext_13supported_backends = {"supported_backends", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_13supported_backends, METH_NOARGS, 0};
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_13supported_backends(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("supported_backends (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_12supported_backends(__pyx_self);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_12supported_backends(CYTHON_UNUSED PyObject *__pyx_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("supported_backends", 0);
+
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.libev.corecext.supported_backends", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+  __pyx_t_12 = PyCFunction_NewEx(&__pyx_mdef_6gevent_5libev_8corecext_13supported_backends, NULL, __pyx_n_s_gevent_libev_corecext); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 241, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_12);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_supported_backends, __pyx_t_12) < 0) __PYX_ERR(0, 241, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
+
+  __pyx_codeobj__24 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_libev_corecext_pyx, __pyx_n_s_supported_backends, 241, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__24)) __PYX_ERR(0, 241, __pyx_L1_error)
+
+0242:     return _flags_to_list(libev.ev_supported_backends())
+
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __pyx_f_6gevent_5libev_8corecext__flags_to_list(ev_supported_backends(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 242, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
 0243: 
+
 0244: 
+
+0245: def recommended_backends():
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_15recommended_backends(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyMethodDef __pyx_mdef_6gevent_5libev_8corecext_15recommended_backends = {"recommended_backends", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_15recommended_backends, METH_NOARGS, 0};
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_15recommended_backends(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("recommended_backends (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_14recommended_backends(__pyx_self);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_14recommended_backends(CYTHON_UNUSED PyObject *__pyx_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("recommended_backends", 0);
+
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.libev.corecext.recommended_backends", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+  __pyx_t_12 = PyCFunction_NewEx(&__pyx_mdef_6gevent_5libev_8corecext_15recommended_backends, NULL, __pyx_n_s_gevent_libev_corecext); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 245, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_12);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_recommended_backends, __pyx_t_12) < 0) __PYX_ERR(0, 245, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
+
+  __pyx_codeobj__25 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_libev_corecext_pyx, __pyx_n_s_recommended_backends, 245, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__25)) __PYX_ERR(0, 245, __pyx_L1_error)
+
+0246:     return _flags_to_list(libev.ev_recommended_backends())
+
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __pyx_f_6gevent_5libev_8corecext__flags_to_list(ev_recommended_backends(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 246, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
 0247: 
+
 0248: 
+
+0249: def embeddable_backends():
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_17embeddable_backends(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyMethodDef __pyx_mdef_6gevent_5libev_8corecext_17embeddable_backends = {"embeddable_backends", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_17embeddable_backends, METH_NOARGS, 0};
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_17embeddable_backends(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("embeddable_backends (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_16embeddable_backends(__pyx_self);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_16embeddable_backends(CYTHON_UNUSED PyObject *__pyx_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("embeddable_backends", 0);
+
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.libev.corecext.embeddable_backends", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+  __pyx_t_12 = PyCFunction_NewEx(&__pyx_mdef_6gevent_5libev_8corecext_17embeddable_backends, NULL, __pyx_n_s_gevent_libev_corecext); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 249, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_12);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_embeddable_backends, __pyx_t_12) < 0) __PYX_ERR(0, 249, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
+
+  __pyx_codeobj__26 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_libev_corecext_pyx, __pyx_n_s_embeddable_backends, 249, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__26)) __PYX_ERR(0, 249, __pyx_L1_error)
+
+0250:     return _flags_to_list(libev.ev_embeddable_backends())
+
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __pyx_f_6gevent_5libev_8corecext__flags_to_list(ev_embeddable_backends(), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 250, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
 0251: 
+
 0252: 
+
+0253: def time():
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_19time(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyMethodDef __pyx_mdef_6gevent_5libev_8corecext_19time = {"time", (PyCFunction)__pyx_pw_6gevent_5libev_8corecext_19time, METH_NOARGS, 0};
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_19time(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("time (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_18time(__pyx_self);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_18time(CYTHON_UNUSED PyObject *__pyx_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("time", 0);
+
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.libev.corecext.time", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+  __pyx_t_12 = PyCFunction_NewEx(&__pyx_mdef_6gevent_5libev_8corecext_19time, NULL, __pyx_n_s_gevent_libev_corecext); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 253, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_12);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_time, __pyx_t_12) < 0) __PYX_ERR(0, 253, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
+
+0254:     return libev.ev_time()
+
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = PyFloat_FromDouble(ev_time()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 254, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
 0255: 
+
+0256: cdef bint _check_loop(loop loop) except -1:
+
+
+static int __pyx_f_6gevent_5libev_8corecext__check_loop(struct PyGeventLoopObject *__pyx_v_loop) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_check_loop", 0);
+
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_AddTraceback("gevent.libev.corecext._check_loop", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = -1;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0257:     if not loop._ptr:
+
+  __pyx_t_1 = ((!(__pyx_v_loop->_ptr != 0)) != 0);
+  if (unlikely(__pyx_t_1)) {
+
+  }
+
+0258:         raise ValueError('operation on destroyed loop')
+
+    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 258, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __PYX_ERR(0, 258, __pyx_L1_error)
+
+  __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 258, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__4);
+  __Pyx_GIVEREF(__pyx_tuple__4);
+
+0259:     return 1
+
+  __pyx_r = 1;
+  goto __pyx_L0;
+
 0260: 
+
 0261: 
+
 0262: 
+
+0263: cdef public class callback [object PyGeventCallbackObject, type PyGeventCallback_Type]:
+
+struct PyGeventCallbackObject {
+  PyObject_HEAD
+  PyObject *callback;
+  PyObject *args;
+  struct PyGeventCallbackObject *next;
+};
+
+__PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyGeventCallback_Type;
+
+0264:     cdef public object callback
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_8callback_8callback_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_8callback_8callback_1__get__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_8callback_8callback___get__(((struct PyGeventCallbackObject *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_8callback_8callback___get__(struct PyGeventCallbackObject *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __Pyx_INCREF(__pyx_v_self->callback);
+  __pyx_r = __pyx_v_self->callback;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static int __pyx_pw_6gevent_5libev_8corecext_8callback_8callback_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
+static int __pyx_pw_6gevent_5libev_8corecext_8callback_8callback_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_8callback_8callback_2__set__(((struct PyGeventCallbackObject *)__pyx_v_self), ((PyObject *)__pyx_v_value));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_5libev_8corecext_8callback_8callback_2__set__(struct PyGeventCallbackObject *__pyx_v_self, PyObject *__pyx_v_value) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__set__", 0);
+  __Pyx_INCREF(__pyx_v_value);
+  __Pyx_GIVEREF(__pyx_v_value);
+  __Pyx_GOTREF(__pyx_v_self->callback);
+  __Pyx_DECREF(__pyx_v_self->callback);
+  __pyx_v_self->callback = __pyx_v_value;
+
+  /* function exit code */
+  __pyx_r = 0;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static int __pyx_pw_6gevent_5libev_8corecext_8callback_8callback_5__del__(PyObject *__pyx_v_self); /*proto*/
+static int __pyx_pw_6gevent_5libev_8corecext_8callback_8callback_5__del__(PyObject *__pyx_v_self) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_8callback_8callback_4__del__(((struct PyGeventCallbackObject *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_5libev_8corecext_8callback_8callback_4__del__(struct PyGeventCallbackObject *__pyx_v_self) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__del__", 0);
+  __Pyx_INCREF(Py_None);
+  __Pyx_GIVEREF(Py_None);
+  __Pyx_GOTREF(__pyx_v_self->callback);
+  __Pyx_DECREF(__pyx_v_self->callback);
+  __pyx_v_self->callback = Py_None;
+
+  /* function exit code */
+  __pyx_r = 0;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0265:     cdef public tuple args
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_8callback_4args_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_8callback_4args_1__get__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_8callback_4args___get__(((struct PyGeventCallbackObject *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_8callback_4args___get__(struct PyGeventCallbackObject *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __Pyx_INCREF(__pyx_v_self->args);
+  __pyx_r = __pyx_v_self->args;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static int __pyx_pw_6gevent_5libev_8corecext_8callback_4args_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
+static int __pyx_pw_6gevent_5libev_8corecext_8callback_4args_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_8callback_4args_2__set__(((struct PyGeventCallbackObject *)__pyx_v_self), ((PyObject *)__pyx_v_value));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_5libev_8corecext_8callback_4args_2__set__(struct PyGeventCallbackObject *__pyx_v_self, PyObject *__pyx_v_value) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__set__", 0);
+  if (!(likely(PyTuple_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v_value)->tp_name), 0))) __PYX_ERR(0, 265, __pyx_L1_error)
+  __pyx_t_1 = __pyx_v_value;
+  __Pyx_INCREF(__pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_1);
+  __Pyx_GOTREF(__pyx_v_self->args);
+  __Pyx_DECREF(__pyx_v_self->args);
+  __pyx_v_self->args = ((PyObject*)__pyx_t_1);
+  __pyx_t_1 = 0;
+
+  /* function exit code */
+  __pyx_r = 0;
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.libev.corecext.callback.args.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = -1;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static int __pyx_pw_6gevent_5libev_8corecext_8callback_4args_5__del__(PyObject *__pyx_v_self); /*proto*/
+static int __pyx_pw_6gevent_5libev_8corecext_8callback_4args_5__del__(PyObject *__pyx_v_self) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_8callback_4args_4__del__(((struct PyGeventCallbackObject *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_5libev_8corecext_8callback_4args_4__del__(struct PyGeventCallbackObject *__pyx_v_self) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__del__", 0);
+  __Pyx_INCREF(Py_None);
+  __Pyx_GIVEREF(Py_None);
+  __Pyx_GOTREF(__pyx_v_self->args);
+  __Pyx_DECREF(__pyx_v_self->args);
+  __pyx_v_self->args = ((PyObject*)Py_None);
+
+  /* function exit code */
+  __pyx_r = 0;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
 0266:     cdef callback next
+
 0267: 
+
+0268:     def __init__(self, callback, args):
+
+
+/* Python wrapper */
+static int __pyx_pw_6gevent_5libev_8corecext_8callback_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static int __pyx_pw_6gevent_5libev_8corecext_8callback_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_callback = 0;
+  PyObject *__pyx_v_args = 0;
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_callback,&__pyx_n_s_args,0};
+    PyObject* values[2] = {0,0};
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_callback)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args)) != 0)) kw_args--;
+        else {
+          __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(0, 268, __pyx_L3_error)
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 268, __pyx_L3_error)
+      }
+    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
+      goto __pyx_L5_argtuple_error;
+    } else {
+      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+    }
+    __pyx_v_callback = values[0];
+    __pyx_v_args = values[1];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 268, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.libev.corecext.callback.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return -1;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_8callback___init__(((struct PyGeventCallbackObject *)__pyx_v_self), __pyx_v_callback, __pyx_v_args);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_5libev_8corecext_8callback___init__(struct PyGeventCallbackObject *__pyx_v_self, PyObject *__pyx_v_callback, PyObject *__pyx_v_args) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__", 0);
+
+
+  /* function exit code */
+  __pyx_r = 0;
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.libev.corecext.callback.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = -1;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0269:         self.callback = callback
+
+  __Pyx_INCREF(__pyx_v_callback);
+  __Pyx_GIVEREF(__pyx_v_callback);
+  __Pyx_GOTREF(__pyx_v_self->callback);
+  __Pyx_DECREF(__pyx_v_self->callback);
+  __pyx_v_self->callback = __pyx_v_callback;
+
+0270:         self.args = args
+
+  if (!(likely(PyTuple_CheckExact(__pyx_v_args))||((__pyx_v_args) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v_args)->tp_name), 0))) __PYX_ERR(0, 270, __pyx_L1_error)
+  __pyx_t_1 = __pyx_v_args;
+  __Pyx_INCREF(__pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_1);
+  __Pyx_GOTREF(__pyx_v_self->args);
+  __Pyx_DECREF(__pyx_v_self->args);
+  __pyx_v_self->args = ((PyObject*)__pyx_t_1);
+  __pyx_t_1 = 0;
+
 0271: 
+
+0272:     def stop(self):
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_8callback_3stop(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_8callback_3stop(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("stop (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_8callback_2stop(((struct PyGeventCallbackObject *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_8callback_2stop(struct PyGeventCallbackObject *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("stop", 0);
+
+
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0273:         self.callback = None
+
+  __Pyx_INCREF(Py_None);
+  __Pyx_GIVEREF(Py_None);
+  __Pyx_GOTREF(__pyx_v_self->callback);
+  __Pyx_DECREF(__pyx_v_self->callback);
+  __pyx_v_self->callback = Py_None;
+
+0274:         self.args = None
+
+  __Pyx_INCREF(Py_None);
+  __Pyx_GIVEREF(Py_None);
+  __Pyx_GOTREF(__pyx_v_self->args);
+  __Pyx_DECREF(__pyx_v_self->args);
+  __pyx_v_self->args = ((PyObject*)Py_None);
+
 0275: 
+
+0276:     close = stop
+
+  __Pyx_GetNameInClass(__pyx_t_12, (PyObject *)__pyx_ptype_6gevent_5libev_8corecext_callback, __pyx_n_s_stop); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 276, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_12);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_5libev_8corecext_callback->tp_dict, __pyx_n_s_close, __pyx_t_12) < 0) __PYX_ERR(0, 276, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_5libev_8corecext_callback);
+
 0277: 
+
 0278:     # Note, that __nonzero__ and pending are different
+
 0279:     # nonzero is used in contexts where we need to know whether to schedule another callback,
+
 0280:     # so it's true if it's pending or currently running
+
 0281:     # 'pending' has the same meaning as libev watchers: it is cleared before entering callback
+
 0282: 
+
+0283:     def __nonzero__(self):
+
+
+/* Python wrapper */
+static int __pyx_pw_6gevent_5libev_8corecext_8callback_5__nonzero__(PyObject *__pyx_v_self); /*proto*/
+static int __pyx_pw_6gevent_5libev_8corecext_8callback_5__nonzero__(PyObject *__pyx_v_self) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__nonzero__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_8callback_4__nonzero__(((struct PyGeventCallbackObject *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_5libev_8corecext_8callback_4__nonzero__(struct PyGeventCallbackObject *__pyx_v_self) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__nonzero__", 0);
+
+
+  /* function exit code */
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
 0284:         # it's nonzero if it's pending or currently executing
+
+0285:         return self.args is not None
+
+  __pyx_t_1 = (__pyx_v_self->args != ((PyObject*)Py_None));
+  __pyx_r = __pyx_t_1;
+  goto __pyx_L0;
+
 0286: 
+
 0287:     @property
+
+0288:     def pending(self):
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_8callback_7pending_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_8callback_7pending_1__get__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_8callback_7pending___get__(((struct PyGeventCallbackObject *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_8callback_7pending___get__(struct PyGeventCallbackObject *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__", 0);
+
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_AddTraceback("gevent.libev.corecext.callback.pending.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0289:         return self.callback is not None
+
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = (__pyx_v_self->callback != Py_None);
+  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 289, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_r = __pyx_t_2;
+  __pyx_t_2 = 0;
+  goto __pyx_L0;
+
 0290: 
+
+0291:     def __repr__(self):
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_8callback_7__repr__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_8callback_7__repr__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_8callback_6__repr__(((struct PyGeventCallbackObject *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_8callback_6__repr__(struct PyGeventCallbackObject *__pyx_v_self) {
+  PyObject *__pyx_v_format = NULL;
+  PyObject *__pyx_v_result = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__repr__", 0);
+
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_AddTraceback("gevent.libev.corecext.callback.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_format);
+  __Pyx_XDECREF(__pyx_v_result);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0292:         if Py_ReprEnter(self) != 0:
+
+  __pyx_t_1 = ((Py_ReprEnter(((PyObject *)__pyx_v_self)) != 0) != 0);
+  if (__pyx_t_1) {
+
+  }
+
+0293:             return "<...>"
+
+    __Pyx_XDECREF(__pyx_r);
+    __Pyx_INCREF(__pyx_kp_s__5);
+    __pyx_r = __pyx_kp_s__5;
+    goto __pyx_L0;
+
+0294:         try:
+
+  /*try:*/ {
+
+0295:             format = self._format()
+
+    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 295, __pyx_L5_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __pyx_t_4 = NULL;
+    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
+      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+      if (likely(__pyx_t_4)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+        __Pyx_INCREF(__pyx_t_4);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_3, function);
+      }
+    }
+    __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
+    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 295, __pyx_L5_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __pyx_v_format = __pyx_t_2;
+    __pyx_t_2 = 0;
+
+0296:             result = "<%s at 0x%x%s" % (self.__class__.__name__, id(self), format)
+
+    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 296, __pyx_L5_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 296, __pyx_L5_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 296, __pyx_L5_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 296, __pyx_L5_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_GIVEREF(__pyx_t_3);
+    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
+    __Pyx_GIVEREF(__pyx_t_2);
+    PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
+    __Pyx_INCREF(__pyx_v_format);
+    __Pyx_GIVEREF(__pyx_v_format);
+    PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_format);
+    __pyx_t_3 = 0;
+    __pyx_t_2 = 0;
+    __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_s_at_0x_x_s, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 296, __pyx_L5_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __pyx_v_result = ((PyObject*)__pyx_t_2);
+    __pyx_t_2 = 0;
+
+0297:             if self.pending:
+
+    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_pending); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 297, __pyx_L5_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 297, __pyx_L5_error)
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    if (__pyx_t_1) {
+
+    }
+
+0298:                 result += " pending"
+
+      __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_kp_s_pending_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 298, __pyx_L5_error)
+      __Pyx_GOTREF(__pyx_t_2);
+      __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_2));
+      __pyx_t_2 = 0;
+
+0299:             if self.callback is not None:
+
+    __pyx_t_1 = (__pyx_v_self->callback != Py_None);
+    __pyx_t_5 = (__pyx_t_1 != 0);
+    if (__pyx_t_5) {
+
+    }
+
+0300:                 result += " callback=%r" % (self.callback, )
+
+      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 300, __pyx_L5_error)
+      __Pyx_GOTREF(__pyx_t_2);
+      __Pyx_INCREF(__pyx_v_self->callback);
+      __Pyx_GIVEREF(__pyx_v_self->callback);
+      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_self->callback);
+      __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_callback_r, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 300, __pyx_L5_error)
+      __Pyx_GOTREF(__pyx_t_4);
+      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+      __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 300, __pyx_L5_error)
+      __Pyx_GOTREF(__pyx_t_2);
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_2));
+      __pyx_t_2 = 0;
+
+0301:             if self.args is not None:
+
+    __pyx_t_5 = (__pyx_v_self->args != ((PyObject*)Py_None));
+    __pyx_t_1 = (__pyx_t_5 != 0);
+    if (__pyx_t_1) {
+
+    }
+
+0302:                 result += " args=%r" % (self.args, )
+
+      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 302, __pyx_L5_error)
+      __Pyx_GOTREF(__pyx_t_2);
+      __Pyx_INCREF(__pyx_v_self->args);
+      __Pyx_GIVEREF(__pyx_v_self->args);
+      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_self->args);
+      __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_args_r, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 302, __pyx_L5_error)
+      __Pyx_GOTREF(__pyx_t_4);
+      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+      __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 302, __pyx_L5_error)
+      __Pyx_GOTREF(__pyx_t_2);
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_2));
+      __pyx_t_2 = 0;
+
+0303:             if self.callback is None and self.args is None:
+
+    __pyx_t_5 = (__pyx_v_self->callback == Py_None);
+    __pyx_t_6 = (__pyx_t_5 != 0);
+    if (__pyx_t_6) {
+    } else {
+      __pyx_t_1 = __pyx_t_6;
+      goto __pyx_L11_bool_binop_done;
+    }
+    __pyx_t_6 = (__pyx_v_self->args == ((PyObject*)Py_None));
+    __pyx_t_5 = (__pyx_t_6 != 0);
+    __pyx_t_1 = __pyx_t_5;
+    __pyx_L11_bool_binop_done:;
+    if (__pyx_t_1) {
+
+    }
+
+0304:                 result += " stopped"
+
+      __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_kp_s_stopped); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 304, __pyx_L5_error)
+      __Pyx_GOTREF(__pyx_t_2);
+      __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_2));
+      __pyx_t_2 = 0;
+
+0305:             return result + ">"
+
+    __Pyx_XDECREF(__pyx_r);
+    __pyx_t_2 = PyNumber_Add(__pyx_v_result, __pyx_kp_s__6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 305, __pyx_L5_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_r = __pyx_t_2;
+    __pyx_t_2 = 0;
+    goto __pyx_L4_return;
+  }
+
 0306:         finally:
+
+0307:             Py_ReprLeave(self)
+
+  /*finally:*/ {
+    __pyx_L5_error:;
+    /*exception exit:*/{
+      __Pyx_PyThreadState_declare
+      __Pyx_PyThreadState_assign
+      __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0;
+      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+      if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15);
+      if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12) < 0)) __Pyx_ErrFetch(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
+      __Pyx_XGOTREF(__pyx_t_10);
+      __Pyx_XGOTREF(__pyx_t_11);
+      __Pyx_XGOTREF(__pyx_t_12);
+      __Pyx_XGOTREF(__pyx_t_13);
+      __Pyx_XGOTREF(__pyx_t_14);
+      __Pyx_XGOTREF(__pyx_t_15);
+      __pyx_t_7 = __pyx_lineno; __pyx_t_8 = __pyx_clineno; __pyx_t_9 = __pyx_filename;
+      {
+        Py_ReprLeave(((PyObject *)__pyx_v_self));
+      }
+      if (PY_MAJOR_VERSION >= 3) {
+        __Pyx_XGIVEREF(__pyx_t_13);
+        __Pyx_XGIVEREF(__pyx_t_14);
+        __Pyx_XGIVEREF(__pyx_t_15);
+        __Pyx_ExceptionReset(__pyx_t_13, __pyx_t_14, __pyx_t_15);
+      }
+      __Pyx_XGIVEREF(__pyx_t_10);
+      __Pyx_XGIVEREF(__pyx_t_11);
+      __Pyx_XGIVEREF(__pyx_t_12);
+      __Pyx_ErrRestore(__pyx_t_10, __pyx_t_11, __pyx_t_12);
+      __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0;
+      __pyx_lineno = __pyx_t_7; __pyx_clineno = __pyx_t_8; __pyx_filename = __pyx_t_9;
+      goto __pyx_L1_error;
+    }
+    __pyx_L4_return: {
+      __pyx_t_15 = __pyx_r;
+      __pyx_r = 0;
+      Py_ReprLeave(((PyObject *)__pyx_v_self));
+      __pyx_r = __pyx_t_15;
+      __pyx_t_15 = 0;
+      goto __pyx_L0;
+    }
+  }
+
 0308: 
+
+0309:     def _format(self):
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_8callback_9_format(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_8callback_9_format(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_format (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_8callback_8_format(((struct PyGeventCallbackObject *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_8callback_8_format(CYTHON_UNUSED struct PyGeventCallbackObject *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_format", 0);
+
+
+  /* function exit code */
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0310:         return ''
+
+  __Pyx_XDECREF(__pyx_r);
+  __Pyx_INCREF(__pyx_kp_s__7);
+  __pyx_r = __pyx_kp_s__7;
+  goto __pyx_L0;
+
 0311: 
+
 0312: DEF CALLBACK_CHECK_COUNT = 50
+
 0313: 
+
 0314: @cython.final
+
 0315: @cython.internal
+
+0316: cdef class CallbackFIFO(object):
+
+struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO {
+  PyObject_HEAD
+  struct __pyx_vtabstruct_6gevent_5libev_8corecext_CallbackFIFO *__pyx_vtab;
+  struct PyGeventCallbackObject *head;
+  struct PyGeventCallbackObject *tail;
+};
+
+
+
+struct __pyx_vtabstruct_6gevent_5libev_8corecext_CallbackFIFO {
+  struct PyGeventCallbackObject *(*popleft)(struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *);
+  PyObject *(*append)(struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *, struct PyGeventCallbackObject *);
+  int (*has_callbacks)(struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *);
+};
+static struct __pyx_vtabstruct_6gevent_5libev_8corecext_CallbackFIFO *__pyx_vtabptr_6gevent_5libev_8corecext_CallbackFIFO;
+static CYTHON_INLINE struct PyGeventCallbackObject *__pyx_f_6gevent_5libev_8corecext_12CallbackFIFO_popleft(struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *);
+static CYTHON_INLINE PyObject *__pyx_f_6gevent_5libev_8corecext_12CallbackFIFO_append(struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *, struct PyGeventCallbackObject *);
+static int __pyx_f_6gevent_5libev_8corecext_12CallbackFIFO_has_callbacks(struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *);
+
+__PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyGeventLoop_Type;
+
 0317:     cdef callback head
+
 0318:     cdef callback tail
+
 0319: 
+
+0320:     def __init__(self):
+
+
+/* Python wrapper */
+static int __pyx_pw_6gevent_5libev_8corecext_12CallbackFIFO_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static int __pyx_pw_6gevent_5libev_8corecext_12CallbackFIFO_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
+  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
+    __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
+  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1;
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_12CallbackFIFO___init__(((struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_5libev_8corecext_12CallbackFIFO___init__(struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *__pyx_v_self) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__", 0);
+
+
+  /* function exit code */
+  __pyx_r = 0;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0321:         self.head = None
+
+  __Pyx_INCREF(Py_None);
+  __Pyx_GIVEREF(Py_None);
+  __Pyx_GOTREF(__pyx_v_self->head);
+  __Pyx_DECREF(((PyObject *)__pyx_v_self->head));
+  __pyx_v_self->head = ((struct PyGeventCallbackObject *)Py_None);
+
+0322:         self.tail = None
+
+  __Pyx_INCREF(Py_None);
+  __Pyx_GIVEREF(Py_None);
+  __Pyx_GOTREF(__pyx_v_self->tail);
+  __Pyx_DECREF(((PyObject *)__pyx_v_self->tail));
+  __pyx_v_self->tail = ((struct PyGeventCallbackObject *)Py_None);
+
 0323: 
+
+0324:     cdef inline callback popleft(self):
+
+
+static CYTHON_INLINE struct PyGeventCallbackObject *__pyx_f_6gevent_5libev_8corecext_12CallbackFIFO_popleft(struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *__pyx_v_self) {
+  struct PyGeventCallbackObject *__pyx_v_head = 0;
+  struct PyGeventCallbackObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("popleft", 0);
+
+
+  /* function exit code */
+  __pyx_L0:;
+  __Pyx_XDECREF((PyObject *)__pyx_v_head);
+  __Pyx_XGIVEREF((PyObject *)__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0325:         cdef callback head = self.head
+
+  __pyx_t_1 = ((PyObject *)__pyx_v_self->head);
+  __Pyx_INCREF(__pyx_t_1);
+  __pyx_v_head = ((struct PyGeventCallbackObject *)__pyx_t_1);
+  __pyx_t_1 = 0;
+
+0326:         self.head = head.next
+
+  __pyx_t_1 = ((PyObject *)__pyx_v_head->next);
+  __Pyx_INCREF(__pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_1);
+  __Pyx_GOTREF(__pyx_v_self->head);
+  __Pyx_DECREF(((PyObject *)__pyx_v_self->head));
+  __pyx_v_self->head = ((struct PyGeventCallbackObject *)__pyx_t_1);
+  __pyx_t_1 = 0;
+
+0327:         if self.head is self.tail or self.head is None:
+
+  __pyx_t_3 = (__pyx_v_self->head == __pyx_v_self->tail);
+  __pyx_t_4 = (__pyx_t_3 != 0);
+  if (!__pyx_t_4) {
+  } else {
+    __pyx_t_2 = __pyx_t_4;
+    goto __pyx_L4_bool_binop_done;
+  }
+  __pyx_t_4 = (((PyObject *)__pyx_v_self->head) == Py_None);
+  __pyx_t_3 = (__pyx_t_4 != 0);
+  __pyx_t_2 = __pyx_t_3;
+  __pyx_L4_bool_binop_done:;
+  if (__pyx_t_2) {
+
+  }
+
+0328:             self.tail = None
+
+    __Pyx_INCREF(Py_None);
+    __Pyx_GIVEREF(Py_None);
+    __Pyx_GOTREF(__pyx_v_self->tail);
+    __Pyx_DECREF(((PyObject *)__pyx_v_self->tail));
+    __pyx_v_self->tail = ((struct PyGeventCallbackObject *)Py_None);
+
+0329:         head.next = None
+
+  __Pyx_INCREF(Py_None);
+  __Pyx_GIVEREF(Py_None);
+  __Pyx_GOTREF(__pyx_v_head->next);
+  __Pyx_DECREF(((PyObject *)__pyx_v_head->next));
+  __pyx_v_head->next = ((struct PyGeventCallbackObject *)Py_None);
+
+0330:         return head
+
+  __Pyx_XDECREF(((PyObject *)__pyx_r));
+  __Pyx_INCREF(((PyObject *)__pyx_v_head));
+  __pyx_r = __pyx_v_head;
+  goto __pyx_L0;
+
 0331: 
+
 0332: 
+
+0333:     cdef inline append(self, callback new_tail):
+
+
+static CYTHON_INLINE PyObject *__pyx_f_6gevent_5libev_8corecext_12CallbackFIFO_append(struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *__pyx_v_self, struct PyGeventCallbackObject *__pyx_v_new_tail) {
+  struct PyGeventCallbackObject *__pyx_v_old_tail = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("append", 0);
+
+
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_AddTraceback("gevent.libev.corecext.CallbackFIFO.append", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XDECREF((PyObject *)__pyx_v_old_tail);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0334:         assert not new_tail.next
+
+  #ifndef CYTHON_WITHOUT_ASSERTIONS
+  if (unlikely(!Py_OptimizeFlag)) {
+    __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_new_tail->next)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 334, __pyx_L1_error)
+    if (unlikely(!((!__pyx_t_1) != 0))) {
+      PyErr_SetNone(PyExc_AssertionError);
+      __PYX_ERR(0, 334, __pyx_L1_error)
+    }
+  }
+  #endif
+
+0335:         if self.tail is None:
+
+  __pyx_t_1 = (((PyObject *)__pyx_v_self->tail) == Py_None);
+  __pyx_t_2 = (__pyx_t_1 != 0);
+  if (__pyx_t_2) {
+
+  }
+
+0336:             if self.head is None:
+
+    __pyx_t_2 = (((PyObject *)__pyx_v_self->head) == Py_None);
+    __pyx_t_1 = (__pyx_t_2 != 0);
+    if (__pyx_t_1) {
+
+    }
+
 0337:                 # Completely empty, so this
+
 0338:                 # is now our head
+
+0339:                 self.head = new_tail
+
+      __Pyx_INCREF(((PyObject *)__pyx_v_new_tail));
+      __Pyx_GIVEREF(((PyObject *)__pyx_v_new_tail));
+      __Pyx_GOTREF(__pyx_v_self->head);
+      __Pyx_DECREF(((PyObject *)__pyx_v_self->head));
+      __pyx_v_self->head = __pyx_v_new_tail;
+
+0340:                 return
+
+      __Pyx_XDECREF(__pyx_r);
+      __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+      goto __pyx_L0;
+
+0341:             self.tail = self.head
+
+    __pyx_t_3 = ((PyObject *)__pyx_v_self->head);
+    __Pyx_INCREF(__pyx_t_3);
+    __Pyx_GIVEREF(__pyx_t_3);
+    __Pyx_GOTREF(__pyx_v_self->tail);
+    __Pyx_DECREF(((PyObject *)__pyx_v_self->tail));
+    __pyx_v_self->tail = ((struct PyGeventCallbackObject *)__pyx_t_3);
+    __pyx_t_3 = 0;
+
 0342: 
+
 0343: 
+
+0344:         assert self.head is not None
+
+  #ifndef CYTHON_WITHOUT_ASSERTIONS
+  if (unlikely(!Py_OptimizeFlag)) {
+    __pyx_t_1 = (((PyObject *)__pyx_v_self->head) != Py_None);
+    if (unlikely(!(__pyx_t_1 != 0))) {
+      PyErr_SetNone(PyExc_AssertionError);
+      __PYX_ERR(0, 344, __pyx_L1_error)
+    }
+  }
+  #endif
+
+0345:         old_tail = self.tail
+
+  __pyx_t_3 = ((PyObject *)__pyx_v_self->tail);
+  __Pyx_INCREF(__pyx_t_3);
+  __pyx_v_old_tail = ((struct PyGeventCallbackObject *)__pyx_t_3);
+  __pyx_t_3 = 0;
+
+0346:         old_tail.next = new_tail
+
+  __Pyx_INCREF(((PyObject *)__pyx_v_new_tail));
+  __Pyx_GIVEREF(((PyObject *)__pyx_v_new_tail));
+  __Pyx_GOTREF(__pyx_v_old_tail->next);
+  __Pyx_DECREF(((PyObject *)__pyx_v_old_tail->next));
+  __pyx_v_old_tail->next = __pyx_v_new_tail;
+
+0347:         self.tail = new_tail
+
+  __Pyx_INCREF(((PyObject *)__pyx_v_new_tail));
+  __Pyx_GIVEREF(((PyObject *)__pyx_v_new_tail));
+  __Pyx_GOTREF(__pyx_v_self->tail);
+  __Pyx_DECREF(((PyObject *)__pyx_v_self->tail));
+  __pyx_v_self->tail = __pyx_v_new_tail;
+
 0348: 
+
+0349:     def __nonzero__(self):
+
+
+/* Python wrapper */
+static int __pyx_pw_6gevent_5libev_8corecext_12CallbackFIFO_3__nonzero__(PyObject *__pyx_v_self); /*proto*/
+static int __pyx_pw_6gevent_5libev_8corecext_12CallbackFIFO_3__nonzero__(PyObject *__pyx_v_self) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__nonzero__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_12CallbackFIFO_2__nonzero__(((struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_5libev_8corecext_12CallbackFIFO_2__nonzero__(struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *__pyx_v_self) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__nonzero__", 0);
+
+
+  /* function exit code */
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0350:         return self.head is not None
+
+  __pyx_t_1 = (((PyObject *)__pyx_v_self->head) != Py_None);
+  __pyx_r = __pyx_t_1;
+  goto __pyx_L0;
+
 0351: 
+
+0352:     def __len__(self):
+
+
+/* Python wrapper */
+static Py_ssize_t __pyx_pw_6gevent_5libev_8corecext_12CallbackFIFO_5__len__(PyObject *__pyx_v_self); /*proto*/
+static Py_ssize_t __pyx_pw_6gevent_5libev_8corecext_12CallbackFIFO_5__len__(PyObject *__pyx_v_self) {
+  Py_ssize_t __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_12CallbackFIFO_4__len__(((struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static Py_ssize_t __pyx_pf_6gevent_5libev_8corecext_12CallbackFIFO_4__len__(struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *__pyx_v_self) {
+  Py_ssize_t __pyx_v_count;
+  struct PyGeventCallbackObject *__pyx_v_head = NULL;
+  Py_ssize_t __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__len__", 0);
+
+
+  /* function exit code */
+  __pyx_L0:;
+  __Pyx_XDECREF((PyObject *)__pyx_v_head);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0353:         cdef Py_ssize_t count = 0
+
+  __pyx_v_count = 0;
+
+0354:         head = self.head
+
+  __pyx_t_1 = ((PyObject *)__pyx_v_self->head);
+  __Pyx_INCREF(__pyx_t_1);
+  __pyx_v_head = ((struct PyGeventCallbackObject *)__pyx_t_1);
+  __pyx_t_1 = 0;
+
+0355:         while head is not None:
+
+  while (1) {
+    __pyx_t_2 = (((PyObject *)__pyx_v_head) != Py_None);
+    __pyx_t_3 = (__pyx_t_2 != 0);
+    if (!__pyx_t_3) break;
+
+0356:             count += 1
+
+    __pyx_v_count = (__pyx_v_count + 1);
+
+0357:             head = head.next
+
+    __pyx_t_1 = ((PyObject *)__pyx_v_head->next);
+    __Pyx_INCREF(__pyx_t_1);
+    __Pyx_DECREF_SET(__pyx_v_head, ((struct PyGeventCallbackObject *)__pyx_t_1));
+    __pyx_t_1 = 0;
+  }
+
+0358:         return count
+
+  __pyx_r = __pyx_v_count;
+  goto __pyx_L0;
+
 0359: 
+
+0360:     def __iter__(self):
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_12CallbackFIFO_7__iter__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_12CallbackFIFO_7__iter__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_12CallbackFIFO_6__iter__(((struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_12CallbackFIFO_6__iter__(struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *__pyx_v_self) {
+  PyObject *__pyx_v_objects = 0;
+  struct PyGeventCallbackObject *__pyx_v_head = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__iter__", 0);
+
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.libev.corecext.CallbackFIFO.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_objects);
+  __Pyx_XDECREF((PyObject *)__pyx_v_head);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0361:         cdef list objects = []
+
+  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 361, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_v_objects = ((PyObject*)__pyx_t_1);
+  __pyx_t_1 = 0;
+
+0362:         head = self.head
+
+  __pyx_t_1 = ((PyObject *)__pyx_v_self->head);
+  __Pyx_INCREF(__pyx_t_1);
+  __pyx_v_head = ((struct PyGeventCallbackObject *)__pyx_t_1);
+  __pyx_t_1 = 0;
+
+0363:         while head is not None:
+
+  while (1) {
+    __pyx_t_2 = (((PyObject *)__pyx_v_head) != Py_None);
+    __pyx_t_3 = (__pyx_t_2 != 0);
+    if (!__pyx_t_3) break;
+
+0364:             objects.append(head)
+
+    __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_objects, ((PyObject *)__pyx_v_head)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 364, __pyx_L1_error)
+
+0365:             head = head.next
+
+    __pyx_t_1 = ((PyObject *)__pyx_v_head->next);
+    __Pyx_INCREF(__pyx_t_1);
+    __Pyx_DECREF_SET(__pyx_v_head, ((struct PyGeventCallbackObject *)__pyx_t_1));
+    __pyx_t_1 = 0;
+  }
+
+0366:         return iter(objects)
+
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = PyObject_GetIter(__pyx_v_objects); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 366, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
 0367: 
+
+0368:     cdef bint has_callbacks(self):
+
+
+static int __pyx_f_6gevent_5libev_8corecext_12CallbackFIFO_has_callbacks(struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *__pyx_v_self) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("has_callbacks", 0);
+
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_WriteUnraisable("gevent.libev.corecext.CallbackFIFO.has_callbacks", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0369:         return self.head
+
+  __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_self->head)); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 369, __pyx_L1_error)
+  __pyx_r = __pyx_t_1;
+  goto __pyx_L0;
+
 0370: 
+
+0371:     def __repr__(self):
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_12CallbackFIFO_9__repr__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_12CallbackFIFO_9__repr__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_12CallbackFIFO_8__repr__(((struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_12CallbackFIFO_8__repr__(struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__repr__", 0);
+
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_AddTraceback("gevent.libev.corecext.CallbackFIFO.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0372:         return "<callbacks@%r len=%d head=%r tail=%r>" % (id(self), len(self), self.head, self.tail)
+
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 372, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_self)); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 372, __pyx_L1_error)
+  __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 372, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __pyx_t_4 = PyTuple_New(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 372, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_4);
+  __Pyx_GIVEREF(__pyx_t_1);
+  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_3);
+  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
+  __Pyx_INCREF(((PyObject *)__pyx_v_self->head));
+  __Pyx_GIVEREF(((PyObject *)__pyx_v_self->head));
+  PyTuple_SET_ITEM(__pyx_t_4, 2, ((PyObject *)__pyx_v_self->head));
+  __Pyx_INCREF(((PyObject *)__pyx_v_self->tail));
+  __Pyx_GIVEREF(((PyObject *)__pyx_v_self->tail));
+  PyTuple_SET_ITEM(__pyx_t_4, 3, ((PyObject *)__pyx_v_self->tail));
+  __pyx_t_1 = 0;
+  __pyx_t_3 = 0;
+  __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_callbacks_r_len_d_head_r_tail_r, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 372, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __pyx_r = __pyx_t_3;
+  __pyx_t_3 = 0;
+  goto __pyx_L0;
+
 0373: 
+
 0374: 
+
+0375: cdef public class loop [object PyGeventLoopObject, type PyGeventLoop_Type]:
+
+struct PyGeventLoopObject {
+  PyObject_HEAD
+  struct __pyx_vtabstruct_6gevent_5libev_8corecext_loop *__pyx_vtab;
+  struct ev_prepare _prepare;
+  struct ev_timer _timer0;
+  struct ev_timer _periodic_signal_checker;
+  PyObject *error_handler;
+  struct ev_loop *_ptr;
+  struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *_callbacks;
+  int starting_timer_may_update_loop_time;
+  int _default;
+  double approx_timer_resolution;
+};
+
+__PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyGeventLoop_Type;
+
+
+struct __pyx_vtabstruct_6gevent_5libev_8corecext_loop {
+  PyObject *(*_run_callbacks)(struct PyGeventLoopObject *);
+  PyObject *(*_stop_watchers)(struct PyGeventLoopObject *, struct ev_loop *);
+  PyObject *(*handle_error)(struct PyGeventLoopObject *, PyObject *, PyObject *, PyObject *, PyObject *, int __pyx_skip_dispatch);
+  PyObject *(*_default_handle_error)(struct PyGeventLoopObject *, PyObject *, PyObject *, PyObject *, PyObject *, int __pyx_skip_dispatch);
+  ev_tstamp (*now)(struct PyGeventLoopObject *, int __pyx_skip_dispatch);
+  void (*update_now)(struct PyGeventLoopObject *, int __pyx_skip_dispatch);
+};
+static struct __pyx_vtabstruct_6gevent_5libev_8corecext_loop *__pyx_vtabptr_6gevent_5libev_8corecext_loop;
+
 0376:     ## embedded struct members
+
 0377:     cdef libev.ev_prepare _prepare
+
 0378:     cdef libev.ev_timer _timer0
+
 0379:     # We'll only actually start this timer if we're on Windows,
+
 0380:     # but it doesn't hurt to compile it in on all platforms.
+
 0381:     cdef libev.ev_timer _periodic_signal_checker
+
 0382: 
+
 0383:     ## pointer members
+
+0384:     cdef public object error_handler
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_13error_handler_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_13error_handler_1__get__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_13error_handler___get__(((struct PyGeventLoopObject *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_13error_handler___get__(struct PyGeventLoopObject *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __Pyx_INCREF(__pyx_v_self->error_handler);
+  __pyx_r = __pyx_v_self->error_handler;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static int __pyx_pw_6gevent_5libev_8corecext_4loop_13error_handler_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
+static int __pyx_pw_6gevent_5libev_8corecext_4loop_13error_handler_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_13error_handler_2__set__(((struct PyGeventLoopObject *)__pyx_v_self), ((PyObject *)__pyx_v_value));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_5libev_8corecext_4loop_13error_handler_2__set__(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_value) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__set__", 0);
+  __Pyx_INCREF(__pyx_v_value);
+  __Pyx_GIVEREF(__pyx_v_value);
+  __Pyx_GOTREF(__pyx_v_self->error_handler);
+  __Pyx_DECREF(__pyx_v_self->error_handler);
+  __pyx_v_self->error_handler = __pyx_v_value;
+
+  /* function exit code */
+  __pyx_r = 0;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static int __pyx_pw_6gevent_5libev_8corecext_4loop_13error_handler_5__del__(PyObject *__pyx_v_self); /*proto*/
+static int __pyx_pw_6gevent_5libev_8corecext_4loop_13error_handler_5__del__(PyObject *__pyx_v_self) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_13error_handler_4__del__(((struct PyGeventLoopObject *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_5libev_8corecext_4loop_13error_handler_4__del__(struct PyGeventLoopObject *__pyx_v_self) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__del__", 0);
+  __Pyx_INCREF(Py_None);
+  __Pyx_GIVEREF(Py_None);
+  __Pyx_GOTREF(__pyx_v_self->error_handler);
+  __Pyx_DECREF(__pyx_v_self->error_handler);
+  __pyx_v_self->error_handler = Py_None;
+
+  /* function exit code */
+  __pyx_r = 0;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
 0385:     cdef libev.ev_loop* _ptr
+
+0386:     cdef public CallbackFIFO _callbacks
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_10_callbacks_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_10_callbacks_1__get__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_10_callbacks___get__(((struct PyGeventLoopObject *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_10_callbacks___get__(struct PyGeventLoopObject *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __Pyx_INCREF(((PyObject *)__pyx_v_self->_callbacks));
+  __pyx_r = ((PyObject *)__pyx_v_self->_callbacks);
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static int __pyx_pw_6gevent_5libev_8corecext_4loop_10_callbacks_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
+static int __pyx_pw_6gevent_5libev_8corecext_4loop_10_callbacks_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_10_callbacks_2__set__(((struct PyGeventLoopObject *)__pyx_v_self), ((PyObject *)__pyx_v_value));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_5libev_8corecext_4loop_10_callbacks_2__set__(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_value) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__set__", 0);
+  if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_6gevent_5libev_8corecext_CallbackFIFO))))) __PYX_ERR(0, 386, __pyx_L1_error)
+  __pyx_t_1 = __pyx_v_value;
+  __Pyx_INCREF(__pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_1);
+  __Pyx_GOTREF(__pyx_v_self->_callbacks);
+  __Pyx_DECREF(((PyObject *)__pyx_v_self->_callbacks));
+  __pyx_v_self->_callbacks = ((struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *)__pyx_t_1);
+  __pyx_t_1 = 0;
+
+  /* function exit code */
+  __pyx_r = 0;
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.libev.corecext.loop._callbacks.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = -1;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static int __pyx_pw_6gevent_5libev_8corecext_4loop_10_callbacks_5__del__(PyObject *__pyx_v_self); /*proto*/
+static int __pyx_pw_6gevent_5libev_8corecext_4loop_10_callbacks_5__del__(PyObject *__pyx_v_self) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_10_callbacks_4__del__(((struct PyGeventLoopObject *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_5libev_8corecext_4loop_10_callbacks_4__del__(struct PyGeventLoopObject *__pyx_v_self) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__del__", 0);
+  __Pyx_INCREF(Py_None);
+  __Pyx_GIVEREF(Py_None);
+  __Pyx_GOTREF(__pyx_v_self->_callbacks);
+  __Pyx_DECREF(((PyObject *)__pyx_v_self->_callbacks));
+  __pyx_v_self->_callbacks = ((struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *)Py_None);
+
+  /* function exit code */
+  __pyx_r = 0;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
 0387: 
+
 0388:     ## data members
+
 0389:     cdef bint starting_timer_may_update_loop_time
+
 0390:     # We must capture the 'default' state at initialiaztion
+
 0391:     # time. Destroying the default loop in libev sets
+
 0392:     # the libev internal pointer to 0, and ev_is_default_loop will
+
 0393:     # no longer work.
+
 0394:     cdef bint _default
+
+0395:     cdef readonly double approx_timer_resolution
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_23approx_timer_resolution_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_23approx_timer_resolution_1__get__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_23approx_timer_resolution___get__(((struct PyGeventLoopObject *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_23approx_timer_resolution___get__(struct PyGeventLoopObject *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->approx_timer_resolution); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 395, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.libev.corecext.loop.approx_timer_resolution.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
 0396: 
+
+0397:     def __cinit__(self, object flags=None, object default=None, libev.intptr_t ptr=0):
+
+
+/* Python wrapper */
+static int __pyx_pw_6gevent_5libev_8corecext_4loop_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static int __pyx_pw_6gevent_5libev_8corecext_4loop_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_flags = 0;
+  PyObject *__pyx_v_default = 0;
+  intptr_t __pyx_v_ptr;
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_flags_2,&__pyx_n_s_default,&__pyx_n_s_ptr,0};
+    PyObject* values[3] = {0,0,0};
+    values[0] = ((PyObject *)Py_None);
+    values[1] = ((PyObject *)Py_None);
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flags_2);
+          if (value) { values[0] = value; kw_args--; }
+        }
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_default);
+          if (value) { values[1] = value; kw_args--; }
+        }
+        CYTHON_FALLTHROUGH;
+        case  2:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ptr);
+          if (value) { values[2] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 397, __pyx_L3_error)
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    __pyx_v_flags = values[0];
+    __pyx_v_default = values[1];
+    if (values[2]) {
+      __pyx_v_ptr = __Pyx_PyIndex_AsSsize_t(values[2]); if (unlikely((__pyx_v_ptr == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 397, __pyx_L3_error)
+    } else {
+      __pyx_v_ptr = ((intptr_t)0);
+    }
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 397, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.libev.corecext.loop.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return -1;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop___cinit__(((struct PyGeventLoopObject *)__pyx_v_self), __pyx_v_flags, __pyx_v_default, __pyx_v_ptr);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_5libev_8corecext_4loop___cinit__(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_flags, PyObject *__pyx_v_default, intptr_t __pyx_v_ptr) {
+  unsigned int __pyx_v_c_flags;
+  CYTHON_UNUSED PyObject *__pyx_v_old_handler = 0;
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__cinit__", 0);
+  __Pyx_INCREF(__pyx_v_default);
+
+
+  /* function exit code */
+  __pyx_r = 0;
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_AddTraceback("gevent.libev.corecext.loop.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = -1;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_old_handler);
+  __Pyx_XDECREF(__pyx_v_default);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0398:         self.starting_timer_may_update_loop_time = 0
+
+  __pyx_v_self->starting_timer_may_update_loop_time = 0;
+
+0399:         self._default = 0
+
+  __pyx_v_self->_default = 0;
+
+0400:         libev.ev_prepare_init(&self._prepare,
+
+  ev_prepare_init((&__pyx_v_self->_prepare), ((void *)gevent_run_callbacks));
+
 0401:                               <void*>gevent_run_callbacks)
+
+0402:         libev.ev_timer_init(&self._periodic_signal_checker,
+
+  ev_timer_init((&__pyx_v_self->_periodic_signal_checker), ((void *)gevent_periodic_signal_check), 0.3, 0.3);
+
 0403:                             <void*>gevent_periodic_signal_check,
+
 0404:                             0.3, 0.3)
+
+0405:         libev.ev_timer_init(&self._timer0,
+
+  ev_timer_init((&__pyx_v_self->_timer0), ((void *)gevent_noop), 0.0, 0.0);
+
 0406:                             <void*>gevent_noop,
+
 0407:                             0.0, 0.0)
+
 0408: 
+
 0409:         cdef unsigned int c_flags
+
+0410:         cdef object old_handler = None
+
+  __Pyx_INCREF(Py_None);
+  __pyx_v_old_handler = Py_None;
+
+0411:         if ptr:
+
+  __pyx_t_1 = (__pyx_v_ptr != 0);
+  if (__pyx_t_1) {
+
+    goto __pyx_L3;
+  }
+
+0412:             self._ptr = <libev.ev_loop*>ptr
+
+    __pyx_v_self->_ptr = ((struct ev_loop *)__pyx_v_ptr);
+
+0413:             self._default = libev.ev_is_default_loop(self._ptr)
+
+    __pyx_v_self->_default = ev_is_default_loop(__pyx_v_self->_ptr);
+
 0414:         else:
+
+0415:             c_flags = _flags_to_int(flags)
+
+  /*else*/ {
+    __pyx_t_2 = __pyx_f_6gevent_5libev_8corecext__flags_to_int(__pyx_v_flags, 0); if (unlikely(__pyx_t_2 == ((unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 415, __pyx_L1_error)
+    __pyx_v_c_flags = __pyx_t_2;
+
+0416:             _check_flags(c_flags)
+
+    __pyx_t_3 = __pyx_f_6gevent_5libev_8corecext__check_flags(__pyx_v_c_flags, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 416, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+
+0417:             c_flags |= libev.EVFLAG_NOENV
+
+    __pyx_v_c_flags = (__pyx_v_c_flags | EVFLAG_NOENV);
+
+0418:             c_flags |= libev.EVFLAG_FORKCHECK
+
+    __pyx_v_c_flags = (__pyx_v_c_flags | EVFLAG_FORKCHECK);
+
+0419:             if default is None:
+
+    __pyx_t_1 = (__pyx_v_default == Py_None);
+    __pyx_t_4 = (__pyx_t_1 != 0);
+    if (__pyx_t_4) {
+
+    }
+
+0420:                 default = True
+
+      __Pyx_INCREF(Py_True);
+      __Pyx_DECREF_SET(__pyx_v_default, Py_True);
+
+0421:             if default:
+
+    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_default); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 421, __pyx_L1_error)
+    if (__pyx_t_4) {
+
+      goto __pyx_L5;
+    }
+
+0422:                 self._default = 1
+
+      __pyx_v_self->_default = 1;
+
+0423:                 self._ptr = libev.gevent_ev_default_loop(c_flags)
+
+      __pyx_v_self->_ptr = gevent_ev_default_loop(__pyx_v_c_flags);
+
+0424:                 if not self._ptr:
+
+      __pyx_t_4 = ((!(__pyx_v_self->_ptr != 0)) != 0);
+      if (unlikely(__pyx_t_4)) {
+
+      }
+
+0425:                     raise SystemError("ev_default_loop(%s) failed" % (c_flags, ))
+
+        __pyx_t_3 = __Pyx_PyInt_From_unsigned_int(__pyx_v_c_flags); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 425, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_3);
+        __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 425, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_5);
+        __Pyx_GIVEREF(__pyx_t_3);
+        PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3);
+        __pyx_t_3 = 0;
+        __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_ev_default_loop_s_failed, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 425, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_3);
+        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+        __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_SystemError, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 425, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_5);
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __Pyx_Raise(__pyx_t_5, 0, 0, 0);
+        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+        __PYX_ERR(0, 425, __pyx_L1_error)
+
+0426:                 if sys.platform == "win32":
+
+      __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_sys); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 426, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_5);
+      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_platform); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 426, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_3);
+      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+      __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_t_3, __pyx_n_s_win32, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 426, __pyx_L1_error)
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+      if (__pyx_t_4) {
+
+      }
+
+0427:                     libev.ev_timer_start(self._ptr, &self._periodic_signal_checker)
+
+        ev_timer_start(__pyx_v_self->_ptr, (&__pyx_v_self->_periodic_signal_checker));
+
+0428:                     libev.ev_unref(self._ptr)
+
+        ev_unref(__pyx_v_self->_ptr);
+
 0429:             else:
+
+0430:                 self._ptr = libev.ev_loop_new(c_flags)
+
+    /*else*/ {
+      __pyx_v_self->_ptr = ev_loop_new(__pyx_v_c_flags);
+
+0431:                 if not self._ptr:
+
+      __pyx_t_4 = ((!(__pyx_v_self->_ptr != 0)) != 0);
+      if (unlikely(__pyx_t_4)) {
+
+      }
+    }
+    __pyx_L5:;
+
+0432:                     raise SystemError("ev_loop_new(%s) failed" % (c_flags, ))
+
+        __pyx_t_3 = __Pyx_PyInt_From_unsigned_int(__pyx_v_c_flags); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 432, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_3);
+        __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 432, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_5);
+        __Pyx_GIVEREF(__pyx_t_3);
+        PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3);
+        __pyx_t_3 = 0;
+        __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_ev_loop_new_s_failed, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 432, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_3);
+        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+        __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_SystemError, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 432, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_5);
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __Pyx_Raise(__pyx_t_5, 0, 0, 0);
+        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+        __PYX_ERR(0, 432, __pyx_L1_error)
+
+0433:             if default or __SYSERR_CALLBACK is None:
+
+    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_default); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 433, __pyx_L1_error)
+    if (!__pyx_t_1) {
+    } else {
+      __pyx_t_4 = __pyx_t_1;
+      goto __pyx_L10_bool_binop_done;
+    }
+    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_SYSERR_CALLBACK); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 433, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_5);
+    __pyx_t_1 = (__pyx_t_5 == Py_None);
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __pyx_t_6 = (__pyx_t_1 != 0);
+    __pyx_t_4 = __pyx_t_6;
+    __pyx_L10_bool_binop_done:;
+    if (__pyx_t_4) {
+
+    }
+  }
+  __pyx_L3:;
+
+0434:                 set_syserr_cb(self._handle_syserr)
+
+      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_handle_syserr); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 434, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_5);
+      __pyx_t_3 = __pyx_f_6gevent_5libev_8corecext_set_syserr_cb(__pyx_t_5, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 434, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_3);
+      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+
 0435: 
+
 0436:         # Mark as not destroyed
+
+0437:         libev.ev_set_userdata(self._ptr, self._ptr)
+
+  ev_set_userdata(__pyx_v_self->_ptr, __pyx_v_self->_ptr);
+
 0438: 
+
+0439:         libev.ev_prepare_start(self._ptr, &self._prepare)
+
+  ev_prepare_start(__pyx_v_self->_ptr, (&__pyx_v_self->_prepare));
+
+0440:         libev.ev_unref(self._ptr)
+
+  ev_unref(__pyx_v_self->_ptr);
+
 0441: 
+
+0442:     def __init__(self, object flags=None, object default=None, libev.intptr_t ptr=0):
+
+
+/* Python wrapper */
+static int __pyx_pw_6gevent_5libev_8corecext_4loop_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static int __pyx_pw_6gevent_5libev_8corecext_4loop_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  CYTHON_UNUSED PyObject *__pyx_v_flags = 0;
+  CYTHON_UNUSED PyObject *__pyx_v_default = 0;
+  CYTHON_UNUSED intptr_t __pyx_v_ptr;
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_flags_2,&__pyx_n_s_default,&__pyx_n_s_ptr,0};
+    PyObject* values[3] = {0,0,0};
+    values[0] = ((PyObject *)Py_None);
+    values[1] = ((PyObject *)Py_None);
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flags_2);
+          if (value) { values[0] = value; kw_args--; }
+        }
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_default);
+          if (value) { values[1] = value; kw_args--; }
+        }
+        CYTHON_FALLTHROUGH;
+        case  2:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ptr);
+          if (value) { values[2] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 442, __pyx_L3_error)
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    __pyx_v_flags = values[0];
+    __pyx_v_default = values[1];
+    if (values[2]) {
+      __pyx_v_ptr = __Pyx_PyIndex_AsSsize_t(values[2]); if (unlikely((__pyx_v_ptr == ((intptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 442, __pyx_L3_error)
+    } else {
+      __pyx_v_ptr = ((intptr_t)0);
+    }
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 442, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.libev.corecext.loop.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return -1;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_2__init__(((struct PyGeventLoopObject *)__pyx_v_self), __pyx_v_flags, __pyx_v_default, __pyx_v_ptr);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_5libev_8corecext_4loop_2__init__(struct PyGeventLoopObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_flags, CYTHON_UNUSED PyObject *__pyx_v_default, CYTHON_UNUSED intptr_t __pyx_v_ptr) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__", 0);
+
+
+  /* function exit code */
+  __pyx_r = 0;
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.libev.corecext.loop.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = -1;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0443:         self._callbacks = CallbackFIFO()
+
+  __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_6gevent_5libev_8corecext_CallbackFIFO)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 443, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_1);
+  __Pyx_GOTREF(__pyx_v_self->_callbacks);
+  __Pyx_DECREF(((PyObject *)__pyx_v_self->_callbacks));
+  __pyx_v_self->_callbacks = ((struct __pyx_obj_6gevent_5libev_8corecext_CallbackFIFO *)__pyx_t_1);
+  __pyx_t_1 = 0;
+
 0444:         # See libev.corecffi for this attribute.
+
+0445:         self.approx_timer_resolution = 0.00001
+
+  __pyx_v_self->approx_timer_resolution = 0.00001;
+
 0446: 
+
+0447:     cdef _run_callbacks(self):
+
+
+static PyObject *__pyx_f_6gevent_5libev_8corecext_4loop__run_callbacks(struct PyGeventLoopObject *__pyx_v_self) {
+  struct PyGeventCallbackObject *__pyx_v_cb = 0;
+  int __pyx_v_count;
+  ev_tstamp __pyx_v_now;
+  ev_tstamp __pyx_v_expiration;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_run_callbacks", 0);
+
+
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_AddTraceback("gevent.libev.corecext.loop._run_callbacks", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XDECREF((PyObject *)__pyx_v_cb);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
 0448:         cdef callback cb
+
 0449:         cdef object callbacks
+
+0450:         cdef int count = CALLBACK_CHECK_COUNT
+
+  __pyx_v_count = 50;
+
+0451:         self.starting_timer_may_update_loop_time = True
+
+  __pyx_v_self->starting_timer_may_update_loop_time = 1;
+
+0452:         cdef libev.ev_tstamp now = libev.ev_now(self._ptr)
+
+  __pyx_v_now = ev_now(__pyx_v_self->_ptr);
+
+0453:         cdef libev.ev_tstamp expiration = now + <libev.ev_tstamp>getswitchinterval()
+
+  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_getswitchinterval); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 453, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = NULL;
+  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
+    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+    if (likely(__pyx_t_3)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+      __Pyx_INCREF(__pyx_t_3);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_2, function);
+    }
+  }
+  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 453, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_4 == ((ev_tstamp)-1)) && PyErr_Occurred())) __PYX_ERR(0, 453, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_v_expiration = (__pyx_v_now + ((ev_tstamp)__pyx_t_4));
+
 0454: 
+
+0455:         try:
+
+  /*try:*/ {
+
+0456:             libev.ev_timer_stop(self._ptr, &self._timer0)
+
+    ev_timer_stop(__pyx_v_self->_ptr, (&__pyx_v_self->_timer0));
+
+0457:             while self._callbacks.head is not None:
+
+    while (1) {
+      __pyx_t_5 = (((PyObject *)__pyx_v_self->_callbacks->head) != Py_None);
+      __pyx_t_6 = (__pyx_t_5 != 0);
+      if (!__pyx_t_6) break;
+
+0458:                 cb = self._callbacks.popleft()
+
+      __pyx_t_1 = ((PyObject *)__pyx_f_6gevent_5libev_8corecext_12CallbackFIFO_popleft(__pyx_v_self->_callbacks)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 458, __pyx_L4_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      __Pyx_XDECREF_SET(__pyx_v_cb, ((struct PyGeventCallbackObject *)__pyx_t_1));
+      __pyx_t_1 = 0;
+
 0459: 
+
+0460:                 libev.ev_unref(self._ptr)
+
+      ev_unref(__pyx_v_self->_ptr);
+
+0461:                 gevent_call(self, cb) # XXX: Why is this a C callback, not cython?
+
+      gevent_call(__pyx_v_self, __pyx_v_cb);
+
+0462:                 count -= 1
+
+      __pyx_v_count = (__pyx_v_count - 1);
+
 0463: 
+
+0464:                 if count == 0 and self._callbacks.head is not None:
+
+      __pyx_t_5 = ((__pyx_v_count == 0) != 0);
+      if (__pyx_t_5) {
+      } else {
+        __pyx_t_6 = __pyx_t_5;
+        goto __pyx_L9_bool_binop_done;
+      }
+      __pyx_t_5 = (((PyObject *)__pyx_v_self->_callbacks->head) != Py_None);
+      __pyx_t_7 = (__pyx_t_5 != 0);
+      __pyx_t_6 = __pyx_t_7;
+      __pyx_L9_bool_binop_done:;
+      if (__pyx_t_6) {
+
+      }
+    }
+    __pyx_L7_break:;
+
 0465:                     # We still have more to run but we've reached
+
 0466:                     # the end of one check group
+
+0467:                     count = CALLBACK_CHECK_COUNT
+
+        __pyx_v_count = 50;
+
 0468: 
+
+0469:                     libev.ev_now_update(self._ptr)
+
+        ev_now_update(__pyx_v_self->_ptr);
+
+0470:                     if libev.ev_now(self._ptr) >= expiration:
+
+        __pyx_t_6 = ((ev_now(__pyx_v_self->_ptr) >= __pyx_v_expiration) != 0);
+        if (__pyx_t_6) {
+
+        }
+
+0471:                         now = 0
+
+          __pyx_v_now = 0.0;
+
+0472:                         break
+
+          goto __pyx_L7_break;
+
 0473: 
+
+0474:             if now != 0:
+
+    __pyx_t_6 = ((__pyx_v_now != 0.0) != 0);
+    if (__pyx_t_6) {
+
+    }
+
+0475:                 libev.ev_now_update(self._ptr)
+
+      ev_now_update(__pyx_v_self->_ptr);
+
+0476:             if self._callbacks.head is not None:
+
+    __pyx_t_6 = (((PyObject *)__pyx_v_self->_callbacks->head) != Py_None);
+    __pyx_t_7 = (__pyx_t_6 != 0);
+    if (__pyx_t_7) {
+
+    }
+  }
+
+0477:                 libev.ev_timer_start(self._ptr, &self._timer0)
+
+      ev_timer_start(__pyx_v_self->_ptr, (&__pyx_v_self->_timer0));
+
 0478:         finally:
+
+0479:             self.starting_timer_may_update_loop_time = False
+
+  /*finally:*/ {
+    /*normal exit:*/{
+      __pyx_v_self->starting_timer_may_update_loop_time = 0;
+      goto __pyx_L5;
+    }
+    __pyx_L4_error:;
+    /*exception exit:*/{
+      __Pyx_PyThreadState_declare
+      __Pyx_PyThreadState_assign
+      __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0;
+      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+      if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_14, &__pyx_t_15, &__pyx_t_16);
+      if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13) < 0)) __Pyx_ErrFetch(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13);
+      __Pyx_XGOTREF(__pyx_t_11);
+      __Pyx_XGOTREF(__pyx_t_12);
+      __Pyx_XGOTREF(__pyx_t_13);
+      __Pyx_XGOTREF(__pyx_t_14);
+      __Pyx_XGOTREF(__pyx_t_15);
+      __Pyx_XGOTREF(__pyx_t_16);
+      __pyx_t_8 = __pyx_lineno; __pyx_t_9 = __pyx_clineno; __pyx_t_10 = __pyx_filename;
+      {
+        __pyx_v_self->starting_timer_may_update_loop_time = 0;
+      }
+      if (PY_MAJOR_VERSION >= 3) {
+        __Pyx_XGIVEREF(__pyx_t_14);
+        __Pyx_XGIVEREF(__pyx_t_15);
+        __Pyx_XGIVEREF(__pyx_t_16);
+        __Pyx_ExceptionReset(__pyx_t_14, __pyx_t_15, __pyx_t_16);
+      }
+      __Pyx_XGIVEREF(__pyx_t_11);
+      __Pyx_XGIVEREF(__pyx_t_12);
+      __Pyx_XGIVEREF(__pyx_t_13);
+      __Pyx_ErrRestore(__pyx_t_11, __pyx_t_12, __pyx_t_13);
+      __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0;
+      __pyx_lineno = __pyx_t_8; __pyx_clineno = __pyx_t_9; __pyx_filename = __pyx_t_10;
+      goto __pyx_L1_error;
+    }
+    __pyx_L5:;
+  }
+
 0480: 
+
+0481:     cdef _stop_watchers(self, libev.ev_loop* ptr):
+
+
+static PyObject *__pyx_f_6gevent_5libev_8corecext_4loop__stop_watchers(struct PyGeventLoopObject *__pyx_v_self, struct ev_loop *__pyx_v_ptr) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_stop_watchers", 0);
+
+
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0482:         if not ptr:
+
+  __pyx_t_1 = ((!(__pyx_v_ptr != 0)) != 0);
+  if (__pyx_t_1) {
+
+  }
+
+0483:             return
+
+    __Pyx_XDECREF(__pyx_r);
+    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+    goto __pyx_L0;
+
 0484: 
+
+0485:         if libev.ev_is_active(&self._prepare):
+
+  __pyx_t_1 = (ev_is_active((&__pyx_v_self->_prepare)) != 0);
+  if (__pyx_t_1) {
+
+  }
+
+0486:             libev.ev_ref(ptr)
+
+    ev_ref(__pyx_v_ptr);
+
+0487:             libev.ev_prepare_stop(ptr, &self._prepare)
+
+    ev_prepare_stop(__pyx_v_ptr, (&__pyx_v_self->_prepare));
+
+0488:         if libev.ev_is_active(&self._periodic_signal_checker):
+
+  __pyx_t_1 = (ev_is_active((&__pyx_v_self->_periodic_signal_checker)) != 0);
+  if (__pyx_t_1) {
+
+  }
+
+0489:             libev.ev_ref(ptr)
+
+    ev_ref(__pyx_v_ptr);
+
+0490:             libev.ev_timer_stop(ptr, &self._periodic_signal_checker)
+
+    ev_timer_stop(__pyx_v_ptr, (&__pyx_v_self->_periodic_signal_checker));
+
 0491: 
+
+0492:     def destroy(self):
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_5destroy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_5destroy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("destroy (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_4destroy(((struct PyGeventLoopObject *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_4destroy(struct PyGeventLoopObject *__pyx_v_self) {
+  struct ev_loop *__pyx_v_ptr;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("destroy", 0);
+
+
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_AddTraceback("gevent.libev.corecext.loop.destroy", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0493:         cdef libev.ev_loop* ptr = self._ptr
+
+  __pyx_t_1 = __pyx_v_self->_ptr;
+  __pyx_v_ptr = __pyx_t_1;
+
+0494:         self._ptr = NULL
+
+  __pyx_v_self->_ptr = NULL;
+
 0495: 
+
+0496:         if ptr:
+
+  __pyx_t_2 = (__pyx_v_ptr != 0);
+  if (__pyx_t_2) {
+
+  }
+
+0497:             if not libev.ev_userdata(ptr):
+
+    __pyx_t_2 = ((!(ev_userdata(__pyx_v_ptr) != 0)) != 0);
+    if (__pyx_t_2) {
+
+    }
+
 0498:                 # Whoops! Program error. They destroyed the loop,
+
 0499:                 # using a different loop object. Our _ptr is still
+
 0500:                 # valid, but the libev loop is gone. Doing anything
+
 0501:                 # else with it will likely cause a crash.
+
+0502:                 return
+
+      __Pyx_XDECREF(__pyx_r);
+      __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+      goto __pyx_L0;
+
 0503:             # Mark as destroyed
+
+0504:             libev.ev_set_userdata(ptr, NULL)
+
+    ev_set_userdata(__pyx_v_ptr, NULL);
+
+0505:             self._stop_watchers(ptr)
+
+    __pyx_t_3 = ((struct __pyx_vtabstruct_6gevent_5libev_8corecext_loop *)__pyx_v_self->__pyx_vtab)->_stop_watchers(__pyx_v_self, __pyx_v_ptr); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 505, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+
+0506:             if __SYSERR_CALLBACK == self._handle_syserr:
+
+    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_SYSERR_CALLBACK); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 506, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_handle_syserr); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 506, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 506, __pyx_L1_error)
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 506, __pyx_L1_error)
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    if (__pyx_t_2) {
+
+    }
+
+0507:                 set_syserr_cb(None)
+
+      __pyx_t_5 = __pyx_f_6gevent_5libev_8corecext_set_syserr_cb(Py_None, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 507, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_5);
+      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+
+0508:             libev.ev_loop_destroy(ptr)
+
+    ev_loop_destroy(__pyx_v_ptr);
+
 0509: 
+
+0510:     def __dealloc__(self):
+
+
+/* Python wrapper */
+static void __pyx_pw_6gevent_5libev_8corecext_4loop_7__dealloc__(PyObject *__pyx_v_self); /*proto*/
+static void __pyx_pw_6gevent_5libev_8corecext_4loop_7__dealloc__(PyObject *__pyx_v_self) {
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
+  __pyx_pf_6gevent_5libev_8corecext_4loop_6__dealloc__(((struct PyGeventLoopObject *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+}
+
+static void __pyx_pf_6gevent_5libev_8corecext_4loop_6__dealloc__(struct PyGeventLoopObject *__pyx_v_self) {
+  struct ev_loop *__pyx_v_ptr;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__dealloc__", 0);
+
+
+  /* function exit code */
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_WriteUnraisable("gevent.libev.corecext.loop.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+}
+
+0511:         cdef libev.ev_loop* ptr = self._ptr
+
+  __pyx_t_1 = __pyx_v_self->_ptr;
+  __pyx_v_ptr = __pyx_t_1;
+
+0512:         self._ptr = NULL
+
+  __pyx_v_self->_ptr = NULL;
+
+0513:         if ptr != NULL:
+
+  __pyx_t_2 = ((__pyx_v_ptr != NULL) != 0);
+  if (__pyx_t_2) {
+
+  }
+
+0514:             if not libev.ev_userdata(ptr):
+
+    __pyx_t_2 = ((!(ev_userdata(__pyx_v_ptr) != 0)) != 0);
+    if (__pyx_t_2) {
+
+    }
+
 0515:                 # See destroy(). This is a bug in the caller.
+
+0516:                 return
+
+      goto __pyx_L0;
+
+0517:             self._stop_watchers(ptr)
+
+    __pyx_t_3 = ((struct __pyx_vtabstruct_6gevent_5libev_8corecext_loop *)__pyx_v_self->__pyx_vtab)->_stop_watchers(__pyx_v_self, __pyx_v_ptr); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 517, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+
+0518:             if not self._default:
+
+    __pyx_t_2 = ((!(__pyx_v_self->_default != 0)) != 0);
+    if (__pyx_t_2) {
+
+    }
+
+0519:                 libev.ev_loop_destroy(ptr)
+
+      ev_loop_destroy(__pyx_v_ptr);
+
 0520:                 # Mark as destroyed
+
+0521:                 libev.ev_set_userdata(ptr, NULL)
+
+      ev_set_userdata(__pyx_v_ptr, NULL);
+
 0522: 
+
 0523:     @property
+
+0524:     def ptr(self):
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_3ptr_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_3ptr_1__get__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_3ptr___get__(((struct PyGeventLoopObject *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_3ptr___get__(struct PyGeventLoopObject *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__", 0);
+
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.libev.corecext.loop.ptr.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0525:         return <size_t>self._ptr
+
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_self->_ptr)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 525, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
 0526: 
+
 0527:     @property
+
+0528:     def WatcherType(self):
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_11WatcherType_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_11WatcherType_1__get__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_11WatcherType___get__(((struct PyGeventLoopObject *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_11WatcherType___get__(CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__", 0);
+
+
+  /* function exit code */
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0529:         return watcher
+
+  __Pyx_XDECREF(__pyx_r);
+  __Pyx_INCREF(((PyObject *)__pyx_ptype_6gevent_5libev_8corecext_watcher));
+  __pyx_r = ((PyObject *)__pyx_ptype_6gevent_5libev_8corecext_watcher);
+  goto __pyx_L0;
+
 0530: 
+
 0531:     @property
+
+0532:     def MAXPRI(self):
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_6MAXPRI_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_6MAXPRI_1__get__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_6MAXPRI___get__(((struct PyGeventLoopObject *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_6MAXPRI___get__(CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__", 0);
+
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.libev.corecext.loop.MAXPRI.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0533:         return libev.EV_MAXPRI
+
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __Pyx_PyInt_From_int(EV_MAXPRI); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 533, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
 0534: 
+
 0535:     @property
+
+0536:     def MINPRI(self):
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_6MINPRI_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_6MINPRI_1__get__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_6MINPRI___get__(((struct PyGeventLoopObject *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_6MINPRI___get__(CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__", 0);
+
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.libev.corecext.loop.MINPRI.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0537:         return libev.EV_MINPRI
+
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __Pyx_PyInt_From_int(EV_MINPRI); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 537, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
 0538: 
+
+0539:     def _handle_syserr(self, message, errno):
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_9_handle_syserr(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_9_handle_syserr(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_message = 0;
+  PyObject *__pyx_v_errno = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_handle_syserr (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_message,&__pyx_n_s_errno,0};
+    PyObject* values[2] = {0,0};
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_message)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_errno)) != 0)) kw_args--;
+        else {
+          __Pyx_RaiseArgtupleInvalid("_handle_syserr", 1, 2, 2, 1); __PYX_ERR(0, 539, __pyx_L3_error)
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_handle_syserr") < 0)) __PYX_ERR(0, 539, __pyx_L3_error)
+      }
+    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
+      goto __pyx_L5_argtuple_error;
+    } else {
+      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+    }
+    __pyx_v_message = values[0];
+    __pyx_v_errno = values[1];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("_handle_syserr", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 539, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.libev.corecext.loop._handle_syserr", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_8_handle_syserr(((struct PyGeventLoopObject *)__pyx_v_self), __pyx_v_message, __pyx_v_errno);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_8_handle_syserr(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_message, PyObject *__pyx_v_errno) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_handle_syserr", 0);
+  __Pyx_INCREF(__pyx_v_message);
+
+
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_AddTraceback("gevent.libev.corecext.loop._handle_syserr", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_message);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0540:         if sys.version_info[0] >= 3:
+
+  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_sys); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 540, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_version_info); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 540, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 540, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_int_3, Py_GE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 540, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 540, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  if (__pyx_t_3) {
+
+  }
+
+0541:             message = message.decode()
+
+    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_message, __pyx_n_s_decode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 541, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __pyx_t_4 = NULL;
+    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
+      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1);
+      if (likely(__pyx_t_4)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
+        __Pyx_INCREF(__pyx_t_4);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_1, function);
+      }
+    }
+    __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_1);
+    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 541, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __Pyx_DECREF_SET(__pyx_v_message, __pyx_t_2);
+    __pyx_t_2 = 0;
+
+0542:         self.handle_error(None, SystemError, SystemError(message + ': ' + os.strerror(errno)), None)
+
+  __pyx_t_2 = PyNumber_Add(__pyx_v_message, __pyx_kp_s__8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 542, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_os); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 542, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_4);
+  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_strerror); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 542, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_5);
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __pyx_t_4 = NULL;
+  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
+    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
+    if (likely(__pyx_t_4)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
+      __Pyx_INCREF(__pyx_t_4);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_5, function);
+    }
+  }
+  __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_4, __pyx_v_errno) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_errno);
+  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 542, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+  __pyx_t_5 = PyNumber_Add(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 542, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_5);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_SystemError, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 542, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+  __pyx_t_5 = ((struct __pyx_vtabstruct_6gevent_5libev_8corecext_loop *)__pyx_v_self->__pyx_vtab)->handle_error(__pyx_v_self, Py_None, __pyx_builtin_SystemError, __pyx_t_1, Py_None, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 542, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_5);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+
 0543: 
+
+0544:     cpdef handle_error(self, context, type, value, tb):
+
+
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_11handle_error(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_f_6gevent_5libev_8corecext_4loop_handle_error(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_context, PyObject *__pyx_v_type, PyObject *__pyx_v_value, PyObject *__pyx_v_tb, int __pyx_skip_dispatch) {
+  PyObject *__pyx_v_handle_error = 0;
+  PyObject *__pyx_v_error_handler = 0;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("handle_error", 0);
+  /* Check if called by wrapper */
+  if (unlikely(__pyx_skip_dispatch)) ;
+  /* Check if overridden in Python */
+  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
+    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
+    if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
+    else {
+      PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      #endif
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_handle_error); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 544, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_5libev_8corecext_4loop_11handle_error)) {
+        __Pyx_XDECREF(__pyx_r);
+        __Pyx_INCREF(__pyx_t_1);
+        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
+        __pyx_t_5 = 0;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+          if (likely(__pyx_t_4)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+            __Pyx_INCREF(__pyx_t_4);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_3, function);
+            __pyx_t_5 = 1;
+          }
+        }
+        #if CYTHON_FAST_PYCALL
+        if (PyFunction_Check(__pyx_t_3)) {
+          PyObject *__pyx_temp[5] = {__pyx_t_4, __pyx_v_context, __pyx_v_type, __pyx_v_value, __pyx_v_tb};
+          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 4+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 544, __pyx_L1_error)
+          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+          __Pyx_GOTREF(__pyx_t_2);
+        } else
+        #endif
+        #if CYTHON_FAST_PYCCALL
+        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
+          PyObject *__pyx_temp[5] = {__pyx_t_4, __pyx_v_context, __pyx_v_type, __pyx_v_value, __pyx_v_tb};
+          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 4+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 544, __pyx_L1_error)
+          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+          __Pyx_GOTREF(__pyx_t_2);
+        } else
+        #endif
+        {
+          __pyx_t_6 = PyTuple_New(4+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 544, __pyx_L1_error)
+          __Pyx_GOTREF(__pyx_t_6);
+          if (__pyx_t_4) {
+            __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
+          }
+          __Pyx_INCREF(__pyx_v_context);
+          __Pyx_GIVEREF(__pyx_v_context);
+          PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_context);
+          __Pyx_INCREF(__pyx_v_type);
+          __Pyx_GIVEREF(__pyx_v_type);
+          PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_type);
+          __Pyx_INCREF(__pyx_v_value);
+          __Pyx_GIVEREF(__pyx_v_value);
+          PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_v_value);
+          __Pyx_INCREF(__pyx_v_tb);
+          __Pyx_GIVEREF(__pyx_v_tb);
+          PyTuple_SET_ITEM(__pyx_t_6, 3+__pyx_t_5, __pyx_v_tb);
+          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 544, __pyx_L1_error)
+          __Pyx_GOTREF(__pyx_t_2);
+          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+        }
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __pyx_r = __pyx_t_2;
+        __pyx_t_2 = 0;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        goto __pyx_L0;
+      }
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+      tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
+      if (unlikely(type_dict_guard != tp_dict_version)) {
+        tp_dict_version = obj_dict_version = 0;
+      }
+      #endif
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    }
+    #endif
+  }
+
+
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_6);
+  __Pyx_AddTraceback("gevent.libev.corecext.loop.handle_error", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_handle_error);
+  __Pyx_XDECREF(__pyx_v_error_handler);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_11handle_error(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_11handle_error(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_context = 0;
+  PyObject *__pyx_v_type = 0;
+  PyObject *__pyx_v_value = 0;
+  PyObject *__pyx_v_tb = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("handle_error (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_context,&__pyx_n_s_type,&__pyx_n_s_value,&__pyx_n_s_tb,0};
+    PyObject* values[4] = {0,0,0,0};
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
+        CYTHON_FALLTHROUGH;
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_context)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_type)) != 0)) kw_args--;
+        else {
+          __Pyx_RaiseArgtupleInvalid("handle_error", 1, 4, 4, 1); __PYX_ERR(0, 544, __pyx_L3_error)
+        }
+        CYTHON_FALLTHROUGH;
+        case  2:
+        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
+        else {
+          __Pyx_RaiseArgtupleInvalid("handle_error", 1, 4, 4, 2); __PYX_ERR(0, 544, __pyx_L3_error)
+        }
+        CYTHON_FALLTHROUGH;
+        case  3:
+        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tb)) != 0)) kw_args--;
+        else {
+          __Pyx_RaiseArgtupleInvalid("handle_error", 1, 4, 4, 3); __PYX_ERR(0, 544, __pyx_L3_error)
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "handle_error") < 0)) __PYX_ERR(0, 544, __pyx_L3_error)
+      }
+    } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
+      goto __pyx_L5_argtuple_error;
+    } else {
+      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
+    }
+    __pyx_v_context = values[0];
+    __pyx_v_type = values[1];
+    __pyx_v_value = values[2];
+    __pyx_v_tb = values[3];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("handle_error", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 544, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.libev.corecext.loop.handle_error", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_10handle_error(((struct PyGeventLoopObject *)__pyx_v_self), __pyx_v_context, __pyx_v_type, __pyx_v_value, __pyx_v_tb);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_10handle_error(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_context, PyObject *__pyx_v_type, PyObject *__pyx_v_value, PyObject *__pyx_v_tb) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("handle_error", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __pyx_f_6gevent_5libev_8corecext_4loop_handle_error(__pyx_v_self, __pyx_v_context, __pyx_v_type, __pyx_v_value, __pyx_v_tb, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 544, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.libev.corecext.loop.handle_error", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
 0545:         cdef object handle_error
+
+0546:         cdef object error_handler = self.error_handler
+
+  __pyx_t_1 = __pyx_v_self->error_handler;
+  __Pyx_INCREF(__pyx_t_1);
+  __pyx_v_error_handler = __pyx_t_1;
+  __pyx_t_1 = 0;
+
+0547:         if error_handler is not None:
+
+  __pyx_t_7 = (__pyx_v_error_handler != Py_None);
+  __pyx_t_8 = (__pyx_t_7 != 0);
+  if (__pyx_t_8) {
+
+    goto __pyx_L3;
+  }
+
 0548:             # we do want to do getattr every time so that setting Hub.handle_error property just works
+
+0549:             handle_error = getattr(error_handler, 'handle_error', error_handler)
+
+    __pyx_t_1 = __Pyx_GetAttr3(__pyx_v_error_handler, __pyx_n_s_handle_error, __pyx_v_error_handler); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 549, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __pyx_v_handle_error = __pyx_t_1;
+    __pyx_t_1 = 0;
+
+0550:             handle_error(context, type, value, tb)
+
+    __Pyx_INCREF(__pyx_v_handle_error);
+    __pyx_t_2 = __pyx_v_handle_error; __pyx_t_3 = NULL;
+    __pyx_t_5 = 0;
+    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
+      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+      if (likely(__pyx_t_3)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+        __Pyx_INCREF(__pyx_t_3);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_2, function);
+        __pyx_t_5 = 1;
+      }
+    }
+    #if CYTHON_FAST_PYCALL
+    if (PyFunction_Check(__pyx_t_2)) {
+      PyObject *__pyx_temp[5] = {__pyx_t_3, __pyx_v_context, __pyx_v_type, __pyx_v_value, __pyx_v_tb};
+      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 4+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 550, __pyx_L1_error)
+      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __Pyx_GOTREF(__pyx_t_1);
+    } else
+    #endif
+    #if CYTHON_FAST_PYCCALL
+    if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
+      PyObject *__pyx_temp[5] = {__pyx_t_3, __pyx_v_context, __pyx_v_type, __pyx_v_value, __pyx_v_tb};
+      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 4+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 550, __pyx_L1_error)
+      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __Pyx_GOTREF(__pyx_t_1);
+    } else
+    #endif
+    {
+      __pyx_t_6 = PyTuple_New(4+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 550, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_6);
+      if (__pyx_t_3) {
+        __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); __pyx_t_3 = NULL;
+      }
+      __Pyx_INCREF(__pyx_v_context);
+      __Pyx_GIVEREF(__pyx_v_context);
+      PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_context);
+      __Pyx_INCREF(__pyx_v_type);
+      __Pyx_GIVEREF(__pyx_v_type);
+      PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_type);
+      __Pyx_INCREF(__pyx_v_value);
+      __Pyx_GIVEREF(__pyx_v_value);
+      PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_v_value);
+      __Pyx_INCREF(__pyx_v_tb);
+      __Pyx_GIVEREF(__pyx_v_tb);
+      PyTuple_SET_ITEM(__pyx_t_6, 3+__pyx_t_5, __pyx_v_tb);
+      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 550, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+    }
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 0551:         else:
+
+0552:             self._default_handle_error(context, type, value, tb)
+
+  /*else*/ {
+    __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_5libev_8corecext_loop *)__pyx_v_self->__pyx_vtab)->_default_handle_error(__pyx_v_self, __pyx_v_context, __pyx_v_type, __pyx_v_value, __pyx_v_tb, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 552, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  }
+  __pyx_L3:;
+
 0553: 
+
+0554:     cpdef _default_handle_error(self, context, type, value, tb):
+
+
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_13_default_handle_error(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_f_6gevent_5libev_8corecext_4loop__default_handle_error(struct PyGeventLoopObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_context, PyObject *__pyx_v_type, PyObject *__pyx_v_value, PyObject *__pyx_v_tb, int __pyx_skip_dispatch) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_default_handle_error", 0);
+  /* Check if called by wrapper */
+  if (unlikely(__pyx_skip_dispatch)) ;
+  /* Check if overridden in Python */
+  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
+    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
+    if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
+    else {
+      PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      #endif
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_default_handle_error); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 554, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_5libev_8corecext_4loop_13_default_handle_error)) {
+        __Pyx_XDECREF(__pyx_r);
+        __Pyx_INCREF(__pyx_t_1);
+        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
+        __pyx_t_5 = 0;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+          if (likely(__pyx_t_4)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+            __Pyx_INCREF(__pyx_t_4);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_3, function);
+            __pyx_t_5 = 1;
+          }
+        }
+        #if CYTHON_FAST_PYCALL
+        if (PyFunction_Check(__pyx_t_3)) {
+          PyObject *__pyx_temp[5] = {__pyx_t_4, __pyx_v_context, __pyx_v_type, __pyx_v_value, __pyx_v_tb};
+          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 4+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 554, __pyx_L1_error)
+          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+          __Pyx_GOTREF(__pyx_t_2);
+        } else
+        #endif
+        #if CYTHON_FAST_PYCCALL
+        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
+          PyObject *__pyx_temp[5] = {__pyx_t_4, __pyx_v_context, __pyx_v_type, __pyx_v_value, __pyx_v_tb};
+          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 4+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 554, __pyx_L1_error)
+          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+          __Pyx_GOTREF(__pyx_t_2);
+        } else
+        #endif
+        {
+          __pyx_t_6 = PyTuple_New(4+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 554, __pyx_L1_error)
+          __Pyx_GOTREF(__pyx_t_6);
+          if (__pyx_t_4) {
+            __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
+          }
+          __Pyx_INCREF(__pyx_v_context);
+          __Pyx_GIVEREF(__pyx_v_context);
+          PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_context);
+          __Pyx_INCREF(__pyx_v_type);
+          __Pyx_GIVEREF(__pyx_v_type);
+          PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_type);
+          __Pyx_INCREF(__pyx_v_value);
+          __Pyx_GIVEREF(__pyx_v_value);
+          PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_v_value);
+          __Pyx_INCREF(__pyx_v_tb);
+          __Pyx_GIVEREF(__pyx_v_tb);
+          PyTuple_SET_ITEM(__pyx_t_6, 3+__pyx_t_5, __pyx_v_tb);
+          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 554, __pyx_L1_error)
+          __Pyx_GOTREF(__pyx_t_2);
+          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+        }
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __pyx_r = __pyx_t_2;
+        __pyx_t_2 = 0;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        goto __pyx_L0;
+      }
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+      tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
+      if (unlikely(type_dict_guard != tp_dict_version)) {
+        tp_dict_version = obj_dict_version = 0;
+      }
+      #endif
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    }
+    #endif
+  }
+
+
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_6);
+  __Pyx_AddTraceback("gevent.libev.corecext.loop._default_handle_error", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_13_default_handle_error(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_13_default_handle_error(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_context = 0;
+  PyObject *__pyx_v_type = 0;
+  PyObject *__pyx_v_value = 0;
+  PyObject *__pyx_v_tb = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_default_handle_error (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_context,&__pyx_n_s_type,&__pyx_n_s_value,&__pyx_n_s_tb,0};
+    PyObject* values[4] = {0,0,0,0};
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
+        CYTHON_FALLTHROUGH;
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_context)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_type)) != 0)) kw_args--;
+        else {
+          __Pyx_RaiseArgtupleInvalid("_default_handle_error", 1, 4, 4, 1); __PYX_ERR(0, 554, __pyx_L3_error)
+        }
+        CYTHON_FALLTHROUGH;
+        case  2:
+        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
+        else {
+          __Pyx_RaiseArgtupleInvalid("_default_handle_error", 1, 4, 4, 2); __PYX_ERR(0, 554, __pyx_L3_error)
+        }
+        CYTHON_FALLTHROUGH;
+        case  3:
+        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tb)) != 0)) kw_args--;
+        else {
+          __Pyx_RaiseArgtupleInvalid("_default_handle_error", 1, 4, 4, 3); __PYX_ERR(0, 554, __pyx_L3_error)
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_default_handle_error") < 0)) __PYX_ERR(0, 554, __pyx_L3_error)
+      }
+    } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
+      goto __pyx_L5_argtuple_error;
+    } else {
+      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
+    }
+    __pyx_v_context = values[0];
+    __pyx_v_type = values[1];
+    __pyx_v_value = values[2];
+    __pyx_v_tb = values[3];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("_default_handle_error", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 554, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.libev.corecext.loop._default_handle_error", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_12_default_handle_error(((struct PyGeventLoopObject *)__pyx_v_self), __pyx_v_context, __pyx_v_type, __pyx_v_value, __pyx_v_tb);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_12_default_handle_error(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_context, PyObject *__pyx_v_type, PyObject *__pyx_v_value, PyObject *__pyx_v_tb) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_default_handle_error", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __pyx_f_6gevent_5libev_8corecext_4loop__default_handle_error(__pyx_v_self, __pyx_v_context, __pyx_v_type, __pyx_v_value, __pyx_v_tb, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 554, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.libev.corecext.loop._default_handle_error", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
 0555:         # note: Hub sets its own error handler so this is not used by gevent
+
 0556:         # this is here to make core.loop usable without the rest of gevent
+
+0557:         traceback.print_exception(type, value, tb)
+
+  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_traceback); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 557, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_print_exception); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 557, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_2 = NULL;
+  __pyx_t_5 = 0;
+  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
+    if (likely(__pyx_t_2)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+      __Pyx_INCREF(__pyx_t_2);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_3, function);
+      __pyx_t_5 = 1;
+    }
+  }
+  #if CYTHON_FAST_PYCALL
+  if (PyFunction_Check(__pyx_t_3)) {
+    PyObject *__pyx_temp[4] = {__pyx_t_2, __pyx_v_type, __pyx_v_value, __pyx_v_tb};
+    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 557, __pyx_L1_error)
+    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __Pyx_GOTREF(__pyx_t_1);
+  } else
+  #endif
+  #if CYTHON_FAST_PYCCALL
+  if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
+    PyObject *__pyx_temp[4] = {__pyx_t_2, __pyx_v_type, __pyx_v_value, __pyx_v_tb};
+    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 557, __pyx_L1_error)
+    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __Pyx_GOTREF(__pyx_t_1);
+  } else
+  #endif
+  {
+    __pyx_t_6 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 557, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_6);
+    if (__pyx_t_2) {
+      __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); __pyx_t_2 = NULL;
+    }
+    __Pyx_INCREF(__pyx_v_type);
+    __Pyx_GIVEREF(__pyx_v_type);
+    PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_type);
+    __Pyx_INCREF(__pyx_v_value);
+    __Pyx_GIVEREF(__pyx_v_value);
+    PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_value);
+    __Pyx_INCREF(__pyx_v_tb);
+    __Pyx_GIVEREF(__pyx_v_tb);
+    PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_v_tb);
+    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 557, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  }
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+0558:         if self._ptr:
+
+  __pyx_t_7 = (__pyx_v_self->_ptr != 0);
+  if (__pyx_t_7) {
+
+  }
+
+0559:             libev.ev_break(self._ptr, libev.EVBREAK_ONE)
+
+    ev_break(__pyx_v_self->_ptr, EVBREAK_ONE);
+
 0560: 
+
+0561:     def run(self, nowait=False, once=False):
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_15run(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_15run(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_nowait = 0;
+  PyObject *__pyx_v_once = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("run (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_nowait,&__pyx_n_s_once,0};
+    PyObject* values[2] = {0,0};
+    values[0] = ((PyObject *)Py_False);
+    values[1] = ((PyObject *)Py_False);
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nowait);
+          if (value) { values[0] = value; kw_args--; }
+        }
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_once);
+          if (value) { values[1] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "run") < 0)) __PYX_ERR(0, 561, __pyx_L3_error)
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    __pyx_v_nowait = values[0];
+    __pyx_v_once = values[1];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("run", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 561, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.libev.corecext.loop.run", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_14run(((struct PyGeventLoopObject *)__pyx_v_self), __pyx_v_nowait, __pyx_v_once);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_14run(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_nowait, PyObject *__pyx_v_once) {
+  unsigned int __pyx_v_flags;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("run", 0);
+
+
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_AddTraceback("gevent.libev.corecext.loop.run", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0562:         _check_loop(self)
+
+  __pyx_t_1 = __pyx_f_6gevent_5libev_8corecext__check_loop(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 562, __pyx_L1_error)
+
+0563:         cdef unsigned int flags = 0
+
+  __pyx_v_flags = 0;
+
+0564:         if nowait:
+
+  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_nowait); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 564, __pyx_L1_error)
+  if (__pyx_t_1) {
+
+  }
+
+0565:             flags |= libev.EVRUN_NOWAIT
+
+    __pyx_v_flags = (__pyx_v_flags | EVRUN_NOWAIT);
+
+0566:         if once:
+
+  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_once); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 566, __pyx_L1_error)
+  if (__pyx_t_1) {
+
+  }
+
+0567:             flags |= libev.EVRUN_ONCE
+
+    __pyx_v_flags = (__pyx_v_flags | EVRUN_ONCE);
+
+0568:         with nogil:
+
+  {
+      #ifdef WITH_THREAD
+      PyThreadState *_save;
+      Py_UNBLOCK_THREADS
+      __Pyx_FastGIL_Remember();
+      #endif
+      /*try:*/ {
+
+      /*finally:*/ {
+        /*normal exit:*/{
+          #ifdef WITH_THREAD
+          __Pyx_FastGIL_Forget();
+          Py_BLOCK_THREADS
+          #endif
+          goto __pyx_L7;
+        }
+        __pyx_L7:;
+      }
+  }
+
+0569:             libev.ev_run(self._ptr, flags)
+
+        ev_run(__pyx_v_self->_ptr, __pyx_v_flags);
+      }
+
 0570: 
+
+0571:     def reinit(self):
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_17reinit(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_17reinit(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("reinit (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_16reinit(((struct PyGeventLoopObject *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_16reinit(struct PyGeventLoopObject *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("reinit", 0);
+
+
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0572:         if self._ptr:
+
+  __pyx_t_1 = (__pyx_v_self->_ptr != 0);
+  if (__pyx_t_1) {
+
+  }
+
+0573:             libev.ev_loop_fork(self._ptr)
+
+    ev_loop_fork(__pyx_v_self->_ptr);
+
 0574: 
+
+0575:     def ref(self):
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_19ref(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_19ref(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("ref (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_18ref(((struct PyGeventLoopObject *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_18ref(struct PyGeventLoopObject *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("ref", 0);
+
+
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_AddTraceback("gevent.libev.corecext.loop.ref", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0576:         _check_loop(self)
+
+  __pyx_t_1 = __pyx_f_6gevent_5libev_8corecext__check_loop(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 576, __pyx_L1_error)
+
+0577:         libev.ev_ref(self._ptr)
+
+  ev_ref(__pyx_v_self->_ptr);
+
 0578: 
+
+0579:     def unref(self):
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_21unref(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_21unref(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("unref (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_20unref(((struct PyGeventLoopObject *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_20unref(struct PyGeventLoopObject *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("unref", 0);
+
+
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_AddTraceback("gevent.libev.corecext.loop.unref", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0580:         _check_loop(self)
+
+  __pyx_t_1 = __pyx_f_6gevent_5libev_8corecext__check_loop(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 580, __pyx_L1_error)
+
+0581:         libev.ev_unref(self._ptr)
+
+  ev_unref(__pyx_v_self->_ptr);
+
 0582: 
+
+0583:     def break_(self, int how=libev.EVBREAK_ONE):
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_23break_(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_23break_(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  int __pyx_v_how;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("break_ (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_how,0};
+    PyObject* values[1] = {0};
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_how);
+          if (value) { values[0] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "break_") < 0)) __PYX_ERR(0, 583, __pyx_L3_error)
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    if (values[0]) {
+      __pyx_v_how = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_how == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 583, __pyx_L3_error)
+    } else {
+      __pyx_v_how = __pyx_k__9;
+    }
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("break_", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 583, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.libev.corecext.loop.break_", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_22break_(((struct PyGeventLoopObject *)__pyx_v_self), __pyx_v_how);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_22break_(struct PyGeventLoopObject *__pyx_v_self, int __pyx_v_how) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("break_", 0);
+
+
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_AddTraceback("gevent.libev.corecext.loop.break_", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+  __pyx_k__9 = EVBREAK_ONE;
+
+0584:         _check_loop(self)
+
+  __pyx_t_1 = __pyx_f_6gevent_5libev_8corecext__check_loop(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 584, __pyx_L1_error)
+
+0585:         libev.ev_break(self._ptr, how)
+
+  ev_break(__pyx_v_self->_ptr, __pyx_v_how);
+
 0586: 
+
+0587:     def verify(self):
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_25verify(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_25verify(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("verify (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_24verify(((struct PyGeventLoopObject *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_24verify(struct PyGeventLoopObject *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("verify", 0);
+
+
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_AddTraceback("gevent.libev.corecext.loop.verify", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0588:         _check_loop(self)
+
+  __pyx_t_1 = __pyx_f_6gevent_5libev_8corecext__check_loop(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 588, __pyx_L1_error)
+
+0589:         libev.ev_verify(self._ptr)
+
+  ev_verify(__pyx_v_self->_ptr);
+
 0590: 
+
+0591:     cpdef libev.ev_tstamp now(self) except *:
+
+
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_27now(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static ev_tstamp __pyx_f_6gevent_5libev_8corecext_4loop_now(struct PyGeventLoopObject *__pyx_v_self, int __pyx_skip_dispatch) {
+  ev_tstamp __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("now", 0);
+  /* Check if called by wrapper */
+  if (unlikely(__pyx_skip_dispatch)) ;
+  /* Check if overridden in Python */
+  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
+    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
+    if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
+    else {
+      PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      #endif
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_now); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 591, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_5libev_8corecext_4loop_27now)) {
+        __Pyx_INCREF(__pyx_t_1);
+        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+          if (likely(__pyx_t_4)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+            __Pyx_INCREF(__pyx_t_4);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_3, function);
+          }
+        }
+        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
+        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 591, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_5 == ((ev_tstamp)-1)) && PyErr_Occurred())) __PYX_ERR(0, 591, __pyx_L1_error)
+        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+        __pyx_r = __pyx_t_5;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        goto __pyx_L0;
+      }
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+      tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
+      if (unlikely(type_dict_guard != tp_dict_version)) {
+        tp_dict_version = obj_dict_version = 0;
+      }
+      #endif
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    }
+    #endif
+  }
+
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_AddTraceback("gevent.libev.corecext.loop.now", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_27now(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_27now(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("now (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_26now(((struct PyGeventLoopObject *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_26now(struct PyGeventLoopObject *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("now", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __pyx_f_6gevent_5libev_8corecext_4loop_now(__pyx_v_self, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 591, __pyx_L1_error)
+  __pyx_t_2 = PyFloat_FromDouble(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 591, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_r = __pyx_t_2;
+  __pyx_t_2 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_AddTraceback("gevent.libev.corecext.loop.now", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0592:         _check_loop(self)
+
+  __pyx_t_6 = __pyx_f_6gevent_5libev_8corecext__check_loop(__pyx_v_self); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 592, __pyx_L1_error)
+
+0593:         return libev.ev_now(self._ptr)
+
+  __pyx_r = ev_now(__pyx_v_self->_ptr);
+  goto __pyx_L0;
+
 0594: 
+
+0595:     cpdef void update_now(self) except *:
+
+
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_29update_now(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static void __pyx_f_6gevent_5libev_8corecext_4loop_update_now(struct PyGeventLoopObject *__pyx_v_self, int __pyx_skip_dispatch) {
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("update_now", 0);
+  /* Check if called by wrapper */
+  if (unlikely(__pyx_skip_dispatch)) ;
+  /* Check if overridden in Python */
+  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
+    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
+    if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
+    else {
+      PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      #endif
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_update_now); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 595, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_5libev_8corecext_4loop_29update_now)) {
+        __Pyx_INCREF(__pyx_t_1);
+        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+          if (likely(__pyx_t_4)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+            __Pyx_INCREF(__pyx_t_4);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_3, function);
+          }
+        }
+        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
+        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 595, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        goto __pyx_L0;
+      }
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+      tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
+      if (unlikely(type_dict_guard != tp_dict_version)) {
+        tp_dict_version = obj_dict_version = 0;
+      }
+      #endif
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    }
+    #endif
+  }
+
+
+  /* function exit code */
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_AddTraceback("gevent.libev.corecext.loop.update_now", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_29update_now(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_29update_now(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("update_now (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_28update_now(((struct PyGeventLoopObject *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_28update_now(struct PyGeventLoopObject *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("update_now", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_f_6gevent_5libev_8corecext_4loop_update_now(__pyx_v_self, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 595, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 595, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.libev.corecext.loop.update_now", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0596:         _check_loop(self)
+
+  __pyx_t_5 = __pyx_f_6gevent_5libev_8corecext__check_loop(__pyx_v_self); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 596, __pyx_L1_error)
+
+0597:         libev.ev_now_update(self._ptr)
+
+  ev_now_update(__pyx_v_self->_ptr);
+
 0598: 
+
+0599:     update = update_now # Old name, deprecated.
+
+  __Pyx_GetNameInClass(__pyx_t_12, (PyObject *)__pyx_ptype_6gevent_5libev_8corecext_loop, __pyx_n_s_update_now); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 599, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_12);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_5libev_8corecext_loop->tp_dict, __pyx_n_s_update, __pyx_t_12) < 0) __PYX_ERR(0, 599, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_5libev_8corecext_loop);
+
 0600: 
+
+0601:     def __repr__(self):
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_31__repr__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_31__repr__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_30__repr__(((struct PyGeventLoopObject *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_30__repr__(struct PyGeventLoopObject *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__repr__", 0);
+
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_AddTraceback("gevent.libev.corecext.loop.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0602:         return '<%s at 0x%x %s>' % (self.__class__.__name__, id(self), self._format())
+
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 602, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 602, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 602, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 602, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_4);
+  __pyx_t_5 = NULL;
+  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
+    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
+    if (likely(__pyx_t_5)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
+      __Pyx_INCREF(__pyx_t_5);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_4, function);
+    }
+  }
+  __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 602, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 602, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_4);
+  __Pyx_GIVEREF(__pyx_t_2);
+  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
+  __Pyx_GIVEREF(__pyx_t_1);
+  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_3);
+  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
+  __pyx_t_2 = 0;
+  __pyx_t_1 = 0;
+  __pyx_t_3 = 0;
+  __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_s_at_0x_x_s_2, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 602, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __pyx_r = __pyx_t_3;
+  __pyx_t_3 = 0;
+  goto __pyx_L0;
+
 0603: 
+
 0604:     @property
+
+0605:     def default(self):
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_7default_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_7default_1__get__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_7default___get__(((struct PyGeventLoopObject *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_7default___get__(struct PyGeventLoopObject *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__", 0);
+
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_AddTraceback("gevent.libev.corecext.loop.default.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
 0606:         # If we're destroyed, we are not the default loop anymore,
+
 0607:         # as far as Python is concerned.
+
+0608:         return self._default if self._ptr else False
+
+  __Pyx_XDECREF(__pyx_r);
+  if ((__pyx_v_self->_ptr != 0)) {
+    __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->_default); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 608, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_1 = __pyx_t_2;
+    __pyx_t_2 = 0;
+  } else {
+    __Pyx_INCREF(Py_False);
+    __pyx_t_1 = Py_False;
+  }
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
 0609: 
+
 0610:     @property
+
+0611:     def iteration(self):
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_9iteration_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_9iteration_1__get__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_9iteration___get__(((struct PyGeventLoopObject *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_9iteration___get__(struct PyGeventLoopObject *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__", 0);
+
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_AddTraceback("gevent.libev.corecext.loop.iteration.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0612:         _check_loop(self)
+
+  __pyx_t_1 = __pyx_f_6gevent_5libev_8corecext__check_loop(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 612, __pyx_L1_error)
+
+0613:         return libev.ev_iteration(self._ptr)
+
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_2 = __Pyx_PyInt_From_unsigned_int(ev_iteration(__pyx_v_self->_ptr)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 613, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_r = __pyx_t_2;
+  __pyx_t_2 = 0;
+  goto __pyx_L0;
+
 0614: 
+
 0615:     @property
+
+0616:     def depth(self):
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_5depth_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_5depth_1__get__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_5depth___get__(((struct PyGeventLoopObject *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_5depth___get__(struct PyGeventLoopObject *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__", 0);
+
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_AddTraceback("gevent.libev.corecext.loop.depth.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0617:         _check_loop(self)
+
+  __pyx_t_1 = __pyx_f_6gevent_5libev_8corecext__check_loop(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 617, __pyx_L1_error)
+
+0618:         return libev.ev_depth(self._ptr)
+
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_2 = __Pyx_PyInt_From_unsigned_int(ev_depth(__pyx_v_self->_ptr)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 618, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_r = __pyx_t_2;
+  __pyx_t_2 = 0;
+  goto __pyx_L0;
+
 0619: 
+
 0620:     @property
+
+0621:     def backend_int(self):
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_11backend_int_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_11backend_int_1__get__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_11backend_int___get__(((struct PyGeventLoopObject *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_11backend_int___get__(struct PyGeventLoopObject *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__", 0);
+
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_AddTraceback("gevent.libev.corecext.loop.backend_int.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0622:         _check_loop(self)
+
+  __pyx_t_1 = __pyx_f_6gevent_5libev_8corecext__check_loop(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 622, __pyx_L1_error)
+
+0623:         return libev.ev_backend(self._ptr)
+
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_2 = __Pyx_PyInt_From_unsigned_int(ev_backend(__pyx_v_self->_ptr)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 623, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_r = __pyx_t_2;
+  __pyx_t_2 = 0;
+  goto __pyx_L0;
+
 0624: 
+
 0625:     @property
+
+0626:     def backend(self):
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_7backend_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_7backend_1__get__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_7backend___get__(((struct PyGeventLoopObject *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_7backend___get__(struct PyGeventLoopObject *__pyx_v_self) {
+  unsigned int __pyx_v_backend;
+  PyObject *__pyx_v_key = NULL;
+  PyObject *__pyx_v_value = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__", 0);
+
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_6);
+  __Pyx_XDECREF(__pyx_t_7);
+  __Pyx_XDECREF(__pyx_t_8);
+  __Pyx_AddTraceback("gevent.libev.corecext.loop.backend.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_key);
+  __Pyx_XDECREF(__pyx_v_value);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0627:         _check_loop(self)
+
+  __pyx_t_1 = __pyx_f_6gevent_5libev_8corecext__check_loop(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 627, __pyx_L1_error)
+
+0628:         cdef unsigned int backend = libev.ev_backend(self._ptr)
+
+  __pyx_v_backend = ev_backend(__pyx_v_self->_ptr);
+
+0629:         for key, value in _flags:
+
+  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_flags); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 629, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
+    __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0;
+    __pyx_t_5 = NULL;
+  } else {
+    __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 629, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 629, __pyx_L1_error)
+  }
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  for (;;) {
+    if (likely(!__pyx_t_5)) {
+      if (likely(PyList_CheckExact(__pyx_t_3))) {
+        if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break;
+        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+        __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 629, __pyx_L1_error)
+        #else
+        __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 629, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        #endif
+      } else {
+        if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
+        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+        __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 629, __pyx_L1_error)
+        #else
+        __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 629, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        #endif
+      }
+    } else {
+      __pyx_t_2 = __pyx_t_5(__pyx_t_3);
+      if (unlikely(!__pyx_t_2)) {
+        PyObject* exc_type = PyErr_Occurred();
+        if (exc_type) {
+          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+          else __PYX_ERR(0, 629, __pyx_L1_error)
+        }
+        break;
+      }
+      __Pyx_GOTREF(__pyx_t_2);
+    }
+    if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) {
+      PyObject* sequence = __pyx_t_2;
+      Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
+      if (unlikely(size != 2)) {
+        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
+        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
+        __PYX_ERR(0, 629, __pyx_L1_error)
+      }
+      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+      if (likely(PyTuple_CheckExact(sequence))) {
+        __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); 
+        __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1); 
+      } else {
+        __pyx_t_6 = PyList_GET_ITEM(sequence, 0); 
+        __pyx_t_7 = PyList_GET_ITEM(sequence, 1); 
+      }
+      __Pyx_INCREF(__pyx_t_6);
+      __Pyx_INCREF(__pyx_t_7);
+      #else
+      __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 629, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_6);
+      __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 629, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_7);
+      #endif
+      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    } else {
+      Py_ssize_t index = -1;
+      __pyx_t_8 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 629, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_8);
+      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+      __pyx_t_9 = Py_TYPE(__pyx_t_8)->tp_iternext;
+      index = 0; __pyx_t_6 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed;
+      __Pyx_GOTREF(__pyx_t_6);
+      index = 1; __pyx_t_7 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_7)) goto __pyx_L5_unpacking_failed;
+      __Pyx_GOTREF(__pyx_t_7);
+      if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 2) < 0) __PYX_ERR(0, 629, __pyx_L1_error)
+      __pyx_t_9 = NULL;
+      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+      goto __pyx_L6_unpacking_done;
+      __pyx_L5_unpacking_failed:;
+      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+      __pyx_t_9 = NULL;
+      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
+      __PYX_ERR(0, 629, __pyx_L1_error)
+      __pyx_L6_unpacking_done:;
+    }
+    __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_6);
+    __pyx_t_6 = 0;
+    __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_7);
+    __pyx_t_7 = 0;
+
+  }
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+
+0630:             if key == backend:
+
+    __pyx_t_2 = __Pyx_PyInt_From_unsigned_int(__pyx_v_backend); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 630, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_7 = PyObject_RichCompare(__pyx_v_key, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 630, __pyx_L1_error)
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 630, __pyx_L1_error)
+    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+    if (__pyx_t_1) {
+
+    }
+
+0631:                 return value
+
+      __Pyx_XDECREF(__pyx_r);
+      __Pyx_INCREF(__pyx_v_value);
+      __pyx_r = __pyx_v_value;
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+      goto __pyx_L0;
+
+0632:         return backend
+
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_3 = __Pyx_PyInt_From_unsigned_int(__pyx_v_backend); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 632, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __pyx_r = __pyx_t_3;
+  __pyx_t_3 = 0;
+  goto __pyx_L0;
+
 0633: 
+
 0634:     @property
+
+0635:     def pendingcnt(self):
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_10pendingcnt_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_10pendingcnt_1__get__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_10pendingcnt___get__(((struct PyGeventLoopObject *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_10pendingcnt___get__(struct PyGeventLoopObject *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__", 0);
+
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_AddTraceback("gevent.libev.corecext.loop.pendingcnt.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0636:         _check_loop(self)
+
+  __pyx_t_1 = __pyx_f_6gevent_5libev_8corecext__check_loop(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 636, __pyx_L1_error)
+
+0637:         return libev.ev_pending_count(self._ptr)
+
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_2 = __Pyx_PyInt_From_unsigned_int(ev_pending_count(__pyx_v_self->_ptr)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 637, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_r = __pyx_t_2;
+  __pyx_t_2 = 0;
+  goto __pyx_L0;
+
 0638: 
+
+0639:     def io(self, libev.vfd_socket_t fd, int events, ref=True, priority=None):
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_33io(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_33io(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  vfd_socket_t __pyx_v_fd;
+  int __pyx_v_events;
+  PyObject *__pyx_v_ref = 0;
+  PyObject *__pyx_v_priority = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("io (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_fd,&__pyx_n_s_events_2,&__pyx_n_s_ref,&__pyx_n_s_priority,0};
+    PyObject* values[4] = {0,0,0,0};
+    values[2] = ((PyObject *)Py_True);
+    values[3] = ((PyObject *)Py_None);
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
+        CYTHON_FALLTHROUGH;
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_fd)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_events_2)) != 0)) kw_args--;
+        else {
+          __Pyx_RaiseArgtupleInvalid("io", 0, 2, 4, 1); __PYX_ERR(0, 639, __pyx_L3_error)
+        }
+        CYTHON_FALLTHROUGH;
+        case  2:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ref);
+          if (value) { values[2] = value; kw_args--; }
+        }
+        CYTHON_FALLTHROUGH;
+        case  3:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_priority);
+          if (value) { values[3] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "io") < 0)) __PYX_ERR(0, 639, __pyx_L3_error)
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
+        CYTHON_FALLTHROUGH;
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    __pyx_v_fd = __Pyx_PyIndex_AsSsize_t(values[0]); if (unlikely((__pyx_v_fd == ((vfd_socket_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 639, __pyx_L3_error)
+    __pyx_v_events = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_events == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 639, __pyx_L3_error)
+    __pyx_v_ref = values[2];
+    __pyx_v_priority = values[3];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("io", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 639, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.libev.corecext.loop.io", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_32io(((struct PyGeventLoopObject *)__pyx_v_self), __pyx_v_fd, __pyx_v_events, __pyx_v_ref, __pyx_v_priority);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_32io(struct PyGeventLoopObject *__pyx_v_self, vfd_socket_t __pyx_v_fd, int __pyx_v_events, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("io", 0);
+
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_AddTraceback("gevent.libev.corecext.loop.io", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0640:         return io(self, fd, events, ref, priority)
+
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_fd); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 640, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_events); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 640, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = PyTuple_New(5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 640, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_INCREF(((PyObject *)__pyx_v_self));
+  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
+  PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self));
+  __Pyx_GIVEREF(__pyx_t_1);
+  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_2);
+  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
+  __Pyx_INCREF(__pyx_v_ref);
+  __Pyx_GIVEREF(__pyx_v_ref);
+  PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_v_ref);
+  __Pyx_INCREF(__pyx_v_priority);
+  __Pyx_GIVEREF(__pyx_v_priority);
+  PyTuple_SET_ITEM(__pyx_t_3, 4, __pyx_v_priority);
+  __pyx_t_1 = 0;
+  __pyx_t_2 = 0;
+  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6gevent_5libev_8corecext_io), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 640, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __pyx_r = __pyx_t_2;
+  __pyx_t_2 = 0;
+  goto __pyx_L0;
+
 0641: 
+
+0642:     def timer(self, double after, double repeat=0.0, ref=True, priority=None):
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_35timer(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_35timer(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  double __pyx_v_after;
+  double __pyx_v_repeat;
+  PyObject *__pyx_v_ref = 0;
+  PyObject *__pyx_v_priority = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("timer (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_after,&__pyx_n_s_repeat,&__pyx_n_s_ref,&__pyx_n_s_priority,0};
+    PyObject* values[4] = {0,0,0,0};
+    values[2] = ((PyObject *)Py_True);
+    values[3] = ((PyObject *)Py_None);
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
+        CYTHON_FALLTHROUGH;
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_after)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_repeat);
+          if (value) { values[1] = value; kw_args--; }
+        }
+        CYTHON_FALLTHROUGH;
+        case  2:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ref);
+          if (value) { values[2] = value; kw_args--; }
+        }
+        CYTHON_FALLTHROUGH;
+        case  3:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_priority);
+          if (value) { values[3] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "timer") < 0)) __PYX_ERR(0, 642, __pyx_L3_error)
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
+        CYTHON_FALLTHROUGH;
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    __pyx_v_after = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_after == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 642, __pyx_L3_error)
+    if (values[1]) {
+      __pyx_v_repeat = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_repeat == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 642, __pyx_L3_error)
+    } else {
+      __pyx_v_repeat = ((double)0.0);
+    }
+    __pyx_v_ref = values[2];
+    __pyx_v_priority = values[3];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("timer", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 642, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.libev.corecext.loop.timer", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_34timer(((struct PyGeventLoopObject *)__pyx_v_self), __pyx_v_after, __pyx_v_repeat, __pyx_v_ref, __pyx_v_priority);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_34timer(struct PyGeventLoopObject *__pyx_v_self, double __pyx_v_after, double __pyx_v_repeat, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("timer", 0);
+
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_AddTraceback("gevent.libev.corecext.loop.timer", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0643:         return timer(self, after, repeat, ref, priority)
+
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_after); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 643, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = PyFloat_FromDouble(__pyx_v_repeat); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 643, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = PyTuple_New(5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 643, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_INCREF(((PyObject *)__pyx_v_self));
+  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
+  PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self));
+  __Pyx_GIVEREF(__pyx_t_1);
+  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_2);
+  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
+  __Pyx_INCREF(__pyx_v_ref);
+  __Pyx_GIVEREF(__pyx_v_ref);
+  PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_v_ref);
+  __Pyx_INCREF(__pyx_v_priority);
+  __Pyx_GIVEREF(__pyx_v_priority);
+  PyTuple_SET_ITEM(__pyx_t_3, 4, __pyx_v_priority);
+  __pyx_t_1 = 0;
+  __pyx_t_2 = 0;
+  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6gevent_5libev_8corecext_timer), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 643, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __pyx_r = __pyx_t_2;
+  __pyx_t_2 = 0;
+  goto __pyx_L0;
+
 0644: 
+
+0645:     def signal(self, int signum, ref=True, priority=None):
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_37signal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_37signal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  int __pyx_v_signum;
+  PyObject *__pyx_v_ref = 0;
+  PyObject *__pyx_v_priority = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("signal (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_signum,&__pyx_n_s_ref,&__pyx_n_s_priority,0};
+    PyObject* values[3] = {0,0,0};
+    values[1] = ((PyObject *)Py_True);
+    values[2] = ((PyObject *)Py_None);
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_signum)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ref);
+          if (value) { values[1] = value; kw_args--; }
+        }
+        CYTHON_FALLTHROUGH;
+        case  2:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_priority);
+          if (value) { values[2] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "signal") < 0)) __PYX_ERR(0, 645, __pyx_L3_error)
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    __pyx_v_signum = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_signum == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 645, __pyx_L3_error)
+    __pyx_v_ref = values[1];
+    __pyx_v_priority = values[2];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("signal", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 645, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.libev.corecext.loop.signal", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_36signal(((struct PyGeventLoopObject *)__pyx_v_self), __pyx_v_signum, __pyx_v_ref, __pyx_v_priority);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_36signal(struct PyGeventLoopObject *__pyx_v_self, int __pyx_v_signum, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("signal", 0);
+
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_AddTraceback("gevent.libev.corecext.loop.signal", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0646:         return signal(self, signum, ref, priority)
+
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_signum); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 646, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 646, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(((PyObject *)__pyx_v_self));
+  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
+  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self));
+  __Pyx_GIVEREF(__pyx_t_1);
+  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1);
+  __Pyx_INCREF(__pyx_v_ref);
+  __Pyx_GIVEREF(__pyx_v_ref);
+  PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_ref);
+  __Pyx_INCREF(__pyx_v_priority);
+  __Pyx_GIVEREF(__pyx_v_priority);
+  PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_v_priority);
+  __pyx_t_1 = 0;
+  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6gevent_5libev_8corecext_signal), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 646, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
 0647: 
+
+0648:     def idle(self, ref=True, priority=None):
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_39idle(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_39idle(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_ref = 0;
+  PyObject *__pyx_v_priority = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("idle (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ref,&__pyx_n_s_priority,0};
+    PyObject* values[2] = {0,0};
+    values[0] = ((PyObject *)Py_True);
+    values[1] = ((PyObject *)Py_None);
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ref);
+          if (value) { values[0] = value; kw_args--; }
+        }
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_priority);
+          if (value) { values[1] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "idle") < 0)) __PYX_ERR(0, 648, __pyx_L3_error)
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    __pyx_v_ref = values[0];
+    __pyx_v_priority = values[1];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("idle", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 648, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.libev.corecext.loop.idle", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_38idle(((struct PyGeventLoopObject *)__pyx_v_self), __pyx_v_ref, __pyx_v_priority);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_38idle(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("idle", 0);
+
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_AddTraceback("gevent.libev.corecext.loop.idle", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0649:         return idle(self, ref, priority)
+
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 649, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(((PyObject *)__pyx_v_self));
+  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
+  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self));
+  __Pyx_INCREF(__pyx_v_ref);
+  __Pyx_GIVEREF(__pyx_v_ref);
+  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_ref);
+  __Pyx_INCREF(__pyx_v_priority);
+  __Pyx_GIVEREF(__pyx_v_priority);
+  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_priority);
+  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6gevent_5libev_8corecext_idle), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 649, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_r = __pyx_t_2;
+  __pyx_t_2 = 0;
+  goto __pyx_L0;
+
 0650: 
+
+0651:     def prepare(self, ref=True, priority=None):
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_41prepare(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_41prepare(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_ref = 0;
+  PyObject *__pyx_v_priority = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("prepare (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ref,&__pyx_n_s_priority,0};
+    PyObject* values[2] = {0,0};
+    values[0] = ((PyObject *)Py_True);
+    values[1] = ((PyObject *)Py_None);
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ref);
+          if (value) { values[0] = value; kw_args--; }
+        }
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_priority);
+          if (value) { values[1] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "prepare") < 0)) __PYX_ERR(0, 651, __pyx_L3_error)
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    __pyx_v_ref = values[0];
+    __pyx_v_priority = values[1];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("prepare", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 651, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.libev.corecext.loop.prepare", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_40prepare(((struct PyGeventLoopObject *)__pyx_v_self), __pyx_v_ref, __pyx_v_priority);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_40prepare(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("prepare", 0);
+
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_AddTraceback("gevent.libev.corecext.loop.prepare", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0652:         return prepare(self, ref, priority)
+
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 652, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(((PyObject *)__pyx_v_self));
+  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
+  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self));
+  __Pyx_INCREF(__pyx_v_ref);
+  __Pyx_GIVEREF(__pyx_v_ref);
+  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_ref);
+  __Pyx_INCREF(__pyx_v_priority);
+  __Pyx_GIVEREF(__pyx_v_priority);
+  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_priority);
+  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6gevent_5libev_8corecext_prepare), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 652, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_r = __pyx_t_2;
+  __pyx_t_2 = 0;
+  goto __pyx_L0;
+
 0653: 
+
+0654:     def check(self, ref=True, priority=None):
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_43check(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_43check(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_ref = 0;
+  PyObject *__pyx_v_priority = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("check (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ref,&__pyx_n_s_priority,0};
+    PyObject* values[2] = {0,0};
+    values[0] = ((PyObject *)Py_True);
+    values[1] = ((PyObject *)Py_None);
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ref);
+          if (value) { values[0] = value; kw_args--; }
+        }
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_priority);
+          if (value) { values[1] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "check") < 0)) __PYX_ERR(0, 654, __pyx_L3_error)
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    __pyx_v_ref = values[0];
+    __pyx_v_priority = values[1];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("check", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 654, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.libev.corecext.loop.check", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_42check(((struct PyGeventLoopObject *)__pyx_v_self), __pyx_v_ref, __pyx_v_priority);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_42check(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("check", 0);
+
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_AddTraceback("gevent.libev.corecext.loop.check", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0655:         return check(self, ref, priority)
+
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 655, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(((PyObject *)__pyx_v_self));
+  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
+  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self));
+  __Pyx_INCREF(__pyx_v_ref);
+  __Pyx_GIVEREF(__pyx_v_ref);
+  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_ref);
+  __Pyx_INCREF(__pyx_v_priority);
+  __Pyx_GIVEREF(__pyx_v_priority);
+  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_priority);
+  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6gevent_5libev_8corecext_check), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 655, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_r = __pyx_t_2;
+  __pyx_t_2 = 0;
+  goto __pyx_L0;
+
 0656: 
+
+0657:     def fork(self, ref=True, priority=None):
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_45fork(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_45fork(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_ref = 0;
+  PyObject *__pyx_v_priority = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("fork (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ref,&__pyx_n_s_priority,0};
+    PyObject* values[2] = {0,0};
+    values[0] = ((PyObject *)Py_True);
+    values[1] = ((PyObject *)Py_None);
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ref);
+          if (value) { values[0] = value; kw_args--; }
+        }
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_priority);
+          if (value) { values[1] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "fork") < 0)) __PYX_ERR(0, 657, __pyx_L3_error)
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    __pyx_v_ref = values[0];
+    __pyx_v_priority = values[1];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("fork", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 657, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.libev.corecext.loop.fork", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_44fork(((struct PyGeventLoopObject *)__pyx_v_self), __pyx_v_ref, __pyx_v_priority);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_44fork(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("fork", 0);
+
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_AddTraceback("gevent.libev.corecext.loop.fork", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0658:         return fork(self, ref, priority)
+
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 658, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(((PyObject *)__pyx_v_self));
+  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
+  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self));
+  __Pyx_INCREF(__pyx_v_ref);
+  __Pyx_GIVEREF(__pyx_v_ref);
+  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_ref);
+  __Pyx_INCREF(__pyx_v_priority);
+  __Pyx_GIVEREF(__pyx_v_priority);
+  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_priority);
+  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6gevent_5libev_8corecext_fork), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 658, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_r = __pyx_t_2;
+  __pyx_t_2 = 0;
+  goto __pyx_L0;
+
 0659: 
+
+0660:     def async_(self, ref=True, priority=None):
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_47async_(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_47async_(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_ref = 0;
+  PyObject *__pyx_v_priority = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("async_ (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ref,&__pyx_n_s_priority,0};
+    PyObject* values[2] = {0,0};
+    values[0] = ((PyObject *)Py_True);
+    values[1] = ((PyObject *)Py_None);
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ref);
+          if (value) { values[0] = value; kw_args--; }
+        }
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_priority);
+          if (value) { values[1] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "async_") < 0)) __PYX_ERR(0, 660, __pyx_L3_error)
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    __pyx_v_ref = values[0];
+    __pyx_v_priority = values[1];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("async_", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 660, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.libev.corecext.loop.async_", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_46async_(((struct PyGeventLoopObject *)__pyx_v_self), __pyx_v_ref, __pyx_v_priority);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_46async_(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("async_", 0);
+
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_AddTraceback("gevent.libev.corecext.loop.async_", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0661:         return async_(self, ref, priority)
+
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 661, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(((PyObject *)__pyx_v_self));
+  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
+  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self));
+  __Pyx_INCREF(__pyx_v_ref);
+  __Pyx_GIVEREF(__pyx_v_ref);
+  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_ref);
+  __Pyx_INCREF(__pyx_v_priority);
+  __Pyx_GIVEREF(__pyx_v_priority);
+  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_priority);
+  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6gevent_5libev_8corecext_async_), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 661, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_r = __pyx_t_2;
+  __pyx_t_2 = 0;
+  goto __pyx_L0;
+
 0662: 
+
 0663:     # cython doesn't enforce async as a keyword
+
+0664:     async = async_
+
+  __Pyx_GetNameInClass(__pyx_t_12, (PyObject *)__pyx_ptype_6gevent_5libev_8corecext_loop, __pyx_n_s_async); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 664, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_12);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_5libev_8corecext_loop->tp_dict, __pyx_n_s_async_2, __pyx_t_12) < 0) __PYX_ERR(0, 664, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_5libev_8corecext_loop);
+
 0665: 
+
+0666:     def child(self, int pid, bint trace=0, ref=True):
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_49child(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_49child(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  int __pyx_v_pid;
+  int __pyx_v_trace;
+  PyObject *__pyx_v_ref = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("child (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pid,&__pyx_n_s_trace,&__pyx_n_s_ref,0};
+    PyObject* values[3] = {0,0,0};
+    values[2] = ((PyObject *)Py_True);
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pid)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_trace);
+          if (value) { values[1] = value; kw_args--; }
+        }
+        CYTHON_FALLTHROUGH;
+        case  2:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ref);
+          if (value) { values[2] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "child") < 0)) __PYX_ERR(0, 666, __pyx_L3_error)
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    __pyx_v_pid = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_pid == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 666, __pyx_L3_error)
+    if (values[1]) {
+      __pyx_v_trace = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_trace == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 666, __pyx_L3_error)
+    } else {
+      __pyx_v_trace = ((int)0);
+    }
+    __pyx_v_ref = values[2];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("child", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 666, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.libev.corecext.loop.child", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_48child(((struct PyGeventLoopObject *)__pyx_v_self), __pyx_v_pid, __pyx_v_trace, __pyx_v_ref);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_48child(struct PyGeventLoopObject *__pyx_v_self, int __pyx_v_pid, int __pyx_v_trace, PyObject *__pyx_v_ref) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("child", 0);
+
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_AddTraceback("gevent.libev.corecext.loop.child", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0667:         if sys.platform == 'win32':
+
+  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_sys); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 667, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_platform); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 667, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_t_2, __pyx_n_s_win32, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 667, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  if (unlikely(__pyx_t_3)) {
+
+  }
+
+0668:             raise AttributeError("Child watchers are not supported on Windows")
+
+    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_AttributeError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 668, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __PYX_ERR(0, 668, __pyx_L1_error)
+
+  __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_Child_watchers_are_not_supported); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 668, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__10);
+  __Pyx_GIVEREF(__pyx_tuple__10);
+
+0669:         return child(self, pid, trace, ref)
+
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_pid); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 669, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_trace); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 669, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_4 = PyTuple_New(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 669, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_4);
+  __Pyx_INCREF(((PyObject *)__pyx_v_self));
+  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
+  PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_self));
+  __Pyx_GIVEREF(__pyx_t_2);
+  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
+  __Pyx_GIVEREF(__pyx_t_1);
+  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_1);
+  __Pyx_INCREF(__pyx_v_ref);
+  __Pyx_GIVEREF(__pyx_v_ref);
+  PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_v_ref);
+  __pyx_t_2 = 0;
+  __pyx_t_1 = 0;
+  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6gevent_5libev_8corecext_child), __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 669, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
 0670: 
+
+0671:     def install_sigchld(self):
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_51install_sigchld(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_51install_sigchld(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("install_sigchld (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_50install_sigchld(((struct PyGeventLoopObject *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_50install_sigchld(CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("install_sigchld", 0);
+
+
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0672:         libev.gevent_install_sigchld_handler()
+
+  gevent_install_sigchld_handler();
+
 0673: 
+
+0674:     def reset_sigchld(self):
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_53reset_sigchld(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_53reset_sigchld(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("reset_sigchld (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_52reset_sigchld(((struct PyGeventLoopObject *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_52reset_sigchld(CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("reset_sigchld", 0);
+
+
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0675:         libev.gevent_reset_sigchld_handler()
+
+  gevent_reset_sigchld_handler();
+
 0676: 
+
+0677:     def stat(self, str path, float interval=0.0, ref=True, priority=None):
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_55stat(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_55stat(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_path = 0;
+  float __pyx_v_interval;
+  PyObject *__pyx_v_ref = 0;
+  PyObject *__pyx_v_priority = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("stat (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_path,&__pyx_n_s_interval,&__pyx_n_s_ref,&__pyx_n_s_priority,0};
+    PyObject* values[4] = {0,0,0,0};
+    values[2] = ((PyObject *)Py_True);
+    values[3] = ((PyObject *)Py_None);
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
+        CYTHON_FALLTHROUGH;
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_path)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_interval);
+          if (value) { values[1] = value; kw_args--; }
+        }
+        CYTHON_FALLTHROUGH;
+        case  2:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ref);
+          if (value) { values[2] = value; kw_args--; }
+        }
+        CYTHON_FALLTHROUGH;
+        case  3:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_priority);
+          if (value) { values[3] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stat") < 0)) __PYX_ERR(0, 677, __pyx_L3_error)
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
+        CYTHON_FALLTHROUGH;
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    __pyx_v_path = ((PyObject*)values[0]);
+    if (values[1]) {
+      __pyx_v_interval = __pyx_PyFloat_AsFloat(values[1]); if (unlikely((__pyx_v_interval == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 677, __pyx_L3_error)
+    } else {
+      __pyx_v_interval = ((float)0.0);
+    }
+    __pyx_v_ref = values[2];
+    __pyx_v_priority = values[3];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("stat", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 677, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.libev.corecext.loop.stat", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_path), (&PyString_Type), 1, "path", 1))) __PYX_ERR(0, 677, __pyx_L1_error)
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_54stat(((struct PyGeventLoopObject *)__pyx_v_self), __pyx_v_path, __pyx_v_interval, __pyx_v_ref, __pyx_v_priority);
+
+  /* function exit code */
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_54stat(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_path, float __pyx_v_interval, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("stat", 0);
+
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_AddTraceback("gevent.libev.corecext.loop.stat", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0678:         return stat(self, path, interval, ref, priority)
+
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_interval); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 678, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = PyTuple_New(5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 678, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(((PyObject *)__pyx_v_self));
+  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
+  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self));
+  __Pyx_INCREF(__pyx_v_path);
+  __Pyx_GIVEREF(__pyx_v_path);
+  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_path);
+  __Pyx_GIVEREF(__pyx_t_1);
+  PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_1);
+  __Pyx_INCREF(__pyx_v_ref);
+  __Pyx_GIVEREF(__pyx_v_ref);
+  PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_v_ref);
+  __Pyx_INCREF(__pyx_v_priority);
+  __Pyx_GIVEREF(__pyx_v_priority);
+  PyTuple_SET_ITEM(__pyx_t_2, 4, __pyx_v_priority);
+  __pyx_t_1 = 0;
+  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6gevent_5libev_8corecext_stat), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 678, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
 0679: 
+
+0680:     def run_callback(self, func, *args):
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_57run_callback(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_57run_callback(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_func = 0;
+  PyObject *__pyx_v_args = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("run_callback (wrapper)", 0);
+  if (PyTuple_GET_SIZE(__pyx_args) > 1) {
+    __pyx_v_args = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args));
+    if (unlikely(!__pyx_v_args)) {
+      __Pyx_RefNannyFinishContext();
+      return NULL;
+    }
+    __Pyx_GOTREF(__pyx_v_args);
+  } else {
+    __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple);
+  }
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_func,0};
+    PyObject* values[1] = {0};
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        default:
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_func)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+      }
+      if (unlikely(kw_args > 0)) {
+        const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1;
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "run_callback") < 0)) __PYX_ERR(0, 680, __pyx_L3_error)
+      }
+    } else if (PyTuple_GET_SIZE(__pyx_args) < 1) {
+      goto __pyx_L5_argtuple_error;
+    } else {
+      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+    }
+    __pyx_v_func = values[0];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("run_callback", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 680, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0;
+  __Pyx_AddTraceback("gevent.libev.corecext.loop.run_callback", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_56run_callback(((struct PyGeventLoopObject *)__pyx_v_self), __pyx_v_func, __pyx_v_args);
+
+  /* function exit code */
+  __Pyx_XDECREF(__pyx_v_args);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_56run_callback(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_func, PyObject *__pyx_v_args) {
+  struct PyGeventCallbackObject *__pyx_v_cb = 0;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("run_callback", 0);
+
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_AddTraceback("gevent.libev.corecext.loop.run_callback", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XDECREF((PyObject *)__pyx_v_cb);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0681:         _check_loop(self)
+
+  __pyx_t_1 = __pyx_f_6gevent_5libev_8corecext__check_loop(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 681, __pyx_L1_error)
+
+0682:         cdef callback cb = callback(func, args)
+
+  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 682, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(__pyx_v_func);
+  __Pyx_GIVEREF(__pyx_v_func);
+  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_func);
+  __Pyx_INCREF(__pyx_v_args);
+  __Pyx_GIVEREF(__pyx_v_args);
+  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_args);
+  __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6gevent_5libev_8corecext_callback), __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 682, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_v_cb = ((struct PyGeventCallbackObject *)__pyx_t_3);
+  __pyx_t_3 = 0;
+
+0683:         self._callbacks.append(cb)
+
+  __pyx_t_3 = __pyx_f_6gevent_5libev_8corecext_12CallbackFIFO_append(__pyx_v_self->_callbacks, __pyx_v_cb); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 683, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+
+0684:         libev.ev_ref(self._ptr)
+
+  ev_ref(__pyx_v_self->_ptr);
+
+0685:         return cb
+
+  __Pyx_XDECREF(__pyx_r);
+  __Pyx_INCREF(((PyObject *)__pyx_v_cb));
+  __pyx_r = ((PyObject *)__pyx_v_cb);
+  goto __pyx_L0;
+
 0686: 
+
+0687:     def _format(self):
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_59_format(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_59_format(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_format (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_58_format(((struct PyGeventLoopObject *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_58_format(struct PyGeventLoopObject *__pyx_v_self) {
+  PyObject *__pyx_v_msg = 0;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_format", 0);
+
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_AddTraceback("gevent.libev.corecext.loop._format", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_msg);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0688:         if not self._ptr:
+
+  __pyx_t_1 = ((!(__pyx_v_self->_ptr != 0)) != 0);
+  if (__pyx_t_1) {
+
+  }
+
+0689:             return 'destroyed'
+
+    __Pyx_XDECREF(__pyx_r);
+    __Pyx_INCREF(__pyx_n_s_destroyed);
+    __pyx_r = __pyx_n_s_destroyed;
+    goto __pyx_L0;
+
+0690:         cdef object msg = self.backend
+
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_backend); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 690, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_v_msg = __pyx_t_2;
+  __pyx_t_2 = 0;
+
+0691:         if self._default:
+
+  __pyx_t_1 = (__pyx_v_self->_default != 0);
+  if (__pyx_t_1) {
+
+  }
+
+0692:             msg += ' default'
+
+    __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_msg, __pyx_kp_s_default_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 692, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_DECREF_SET(__pyx_v_msg, __pyx_t_2);
+    __pyx_t_2 = 0;
+
+0693:         msg += ' pending=%s' % self.pendingcnt
+
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_pendingcnt); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 693, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = __Pyx_PyString_FormatSafe(__pyx_kp_s_pending_s, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 693, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_msg, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 693, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __Pyx_DECREF_SET(__pyx_v_msg, __pyx_t_2);
+  __pyx_t_2 = 0;
+
+0694:         msg += self._format_details()
+
+  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_format_details); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 694, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __pyx_t_4 = NULL;
+  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
+    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+    if (likely(__pyx_t_4)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+      __Pyx_INCREF(__pyx_t_4);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_3, function);
+    }
+  }
+  __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 694, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_msg, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 694, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF_SET(__pyx_v_msg, __pyx_t_3);
+  __pyx_t_3 = 0;
+
+0695:         return msg
+
+  __Pyx_XDECREF(__pyx_r);
+  __Pyx_INCREF(__pyx_v_msg);
+  __pyx_r = __pyx_v_msg;
+  goto __pyx_L0;
+
 0696: 
+
+0697:     def _format_details(self):
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_61_format_details(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_61_format_details(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_format_details (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_60_format_details(((struct PyGeventLoopObject *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_60_format_details(struct PyGeventLoopObject *__pyx_v_self) {
+  PyObject *__pyx_v_msg = 0;
+  PyObject *__pyx_v_fileno = 0;
+  PyObject *__pyx_v_activecnt = 0;
+  CYTHON_UNUSED PyObject *__pyx_v_sigfd = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_format_details", 0);
+
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_AddTraceback("gevent.libev.corecext.loop._format_details", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_msg);
+  __Pyx_XDECREF(__pyx_v_fileno);
+  __Pyx_XDECREF(__pyx_v_activecnt);
+  __Pyx_XDECREF(__pyx_v_sigfd);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0698:         cdef str msg = ''
+
+  __Pyx_INCREF(__pyx_kp_s__7);
+  __pyx_v_msg = __pyx_kp_s__7;
+
+0699:         cdef object fileno = self.fileno()
+
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_fileno); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 699, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = NULL;
+  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+    if (likely(__pyx_t_3)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+      __Pyx_INCREF(__pyx_t_3);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_2, function);
+    }
+  }
+  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 699, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_v_fileno = __pyx_t_1;
+  __pyx_t_1 = 0;
+
+0700:         cdef object activecnt = None
+
+  __Pyx_INCREF(Py_None);
+  __pyx_v_activecnt = Py_None;
+
+0701:         try:
+
+  {
+    /*try:*/ {
+
+    }
+    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+    goto __pyx_L8_try_end;
+    __pyx_L3_error:;
+    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+    __Pyx_XGIVEREF(__pyx_t_4);
+    __Pyx_XGIVEREF(__pyx_t_5);
+    __Pyx_XGIVEREF(__pyx_t_6);
+    __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
+    goto __pyx_L1_error;
+    __pyx_L4_exception_handled:;
+    __Pyx_XGIVEREF(__pyx_t_4);
+    __Pyx_XGIVEREF(__pyx_t_5);
+    __Pyx_XGIVEREF(__pyx_t_6);
+    __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
+    __pyx_L8_try_end:;
+  }
+
+0702:             sigfd = self.sigfd
+
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_sigfd); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 702, __pyx_L3_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      __pyx_v_sigfd = __pyx_t_1;
+      __pyx_t_1 = 0;
+
+0703:         except AttributeError:
+
+    __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_AttributeError);
+    if (__pyx_t_7) {
+      __Pyx_AddTraceback("gevent.libev.corecext.loop._format_details", __pyx_clineno, __pyx_lineno, __pyx_filename);
+      if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3) < 0) __PYX_ERR(0, 703, __pyx_L5_except_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      __Pyx_GOTREF(__pyx_t_2);
+      __Pyx_GOTREF(__pyx_t_3);
+
+0704:             sigfd = None
+
+      __Pyx_INCREF(Py_None);
+      __Pyx_XDECREF_SET(__pyx_v_sigfd, Py_None);
+      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+      goto __pyx_L4_exception_handled;
+    }
+    goto __pyx_L5_except_error;
+    __pyx_L5_except_error:;
+
+0705:         try:
+
+  {
+    /*try:*/ {
+
+    }
+    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+    goto __pyx_L16_try_end;
+    __pyx_L11_error:;
+    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+
+    __Pyx_XGIVEREF(__pyx_t_6);
+    __Pyx_XGIVEREF(__pyx_t_5);
+    __Pyx_XGIVEREF(__pyx_t_4);
+    __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_5, __pyx_t_4);
+    goto __pyx_L1_error;
+    __pyx_L12_exception_handled:;
+    __Pyx_XGIVEREF(__pyx_t_6);
+    __Pyx_XGIVEREF(__pyx_t_5);
+    __Pyx_XGIVEREF(__pyx_t_4);
+    __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_5, __pyx_t_4);
+    __pyx_L16_try_end:;
+  }
+
+0706:             activecnt = self.activecnt
+
+      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_activecnt); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 706, __pyx_L11_error)
+      __Pyx_GOTREF(__pyx_t_3);
+      __Pyx_DECREF_SET(__pyx_v_activecnt, __pyx_t_3);
+      __pyx_t_3 = 0;
+
+0707:         except AttributeError:
+
+    __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_AttributeError);
+    if (__pyx_t_7) {
+      __Pyx_ErrRestore(0,0,0);
+      goto __pyx_L12_exception_handled;
+    }
+    goto __pyx_L13_except_error;
+    __pyx_L13_except_error:;
+
 0708:             pass
+
+0709:         if activecnt is not None:
+
+  __pyx_t_8 = (__pyx_v_activecnt != Py_None);
+  __pyx_t_9 = (__pyx_t_8 != 0);
+  if (__pyx_t_9) {
+
+  }
+
+0710:             msg += ' ref=' + repr(activecnt)
+
+    __pyx_t_3 = PyObject_Repr(__pyx_v_activecnt); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 710, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __pyx_t_2 = PyNumber_Add(__pyx_kp_s_ref_2, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 710, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_msg, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 710, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __Pyx_DECREF_SET(__pyx_v_msg, ((PyObject*)__pyx_t_3));
+    __pyx_t_3 = 0;
+
+0711:         if fileno is not None:
+
+  __pyx_t_9 = (__pyx_v_fileno != Py_None);
+  __pyx_t_8 = (__pyx_t_9 != 0);
+  if (__pyx_t_8) {
+
+  }
+
+0712:             msg += ' fileno=' + repr(fileno)
+
+    __pyx_t_3 = PyObject_Repr(__pyx_v_fileno); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 712, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __pyx_t_2 = PyNumber_Add(__pyx_kp_s_fileno_2, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 712, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_msg, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 712, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __Pyx_DECREF_SET(__pyx_v_msg, ((PyObject*)__pyx_t_3));
+    __pyx_t_3 = 0;
+
+0713:         return msg
+
+  __Pyx_XDECREF(__pyx_r);
+  __Pyx_INCREF(__pyx_v_msg);
+  __pyx_r = __pyx_v_msg;
+  goto __pyx_L0;
+
 0714: 
+
+0715:     def fileno(self):
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_63fileno(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_63fileno(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("fileno (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_62fileno(((struct PyGeventLoopObject *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_62fileno(struct PyGeventLoopObject *__pyx_v_self) {
+  int __pyx_v_fd;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("fileno", 0);
+
+
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_AddTraceback("gevent.libev.corecext.loop.fileno", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
 0716:         cdef int fd
+
+0717:         if self._ptr:
+
+  __pyx_t_1 = (__pyx_v_self->_ptr != 0);
+  if (__pyx_t_1) {
+
+  }
+
+0718:             fd = libev.gevent_ev_loop_backend_fd(self._ptr)
+
+    __pyx_v_fd = gevent_ev_loop_backend_fd(__pyx_v_self->_ptr);
+
+0719:             if fd >= 0:
+
+    __pyx_t_1 = ((__pyx_v_fd >= 0) != 0);
+    if (__pyx_t_1) {
+
+    }
+
+0720:                 return fd
+
+      __Pyx_XDECREF(__pyx_r);
+      __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_fd); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 720, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_2);
+      __pyx_r = __pyx_t_2;
+      __pyx_t_2 = 0;
+      goto __pyx_L0;
+
 0721: 
+
 0722:     @property
+
+0723:     def activecnt(self):
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_9activecnt_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_9activecnt_1__get__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_9activecnt___get__(((struct PyGeventLoopObject *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_9activecnt___get__(struct PyGeventLoopObject *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__", 0);
+
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_AddTraceback("gevent.libev.corecext.loop.activecnt.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0724:         _check_loop(self)
+
+  __pyx_t_1 = __pyx_f_6gevent_5libev_8corecext__check_loop(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 724, __pyx_L1_error)
+
+0725:         return libev.gevent_ev_loop_activecnt(self._ptr)
+
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_2 = __Pyx_PyInt_From_int(gevent_ev_loop_activecnt(__pyx_v_self->_ptr)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 725, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_r = __pyx_t_2;
+  __pyx_t_2 = 0;
+  goto __pyx_L0;
+
 0726: 
+
 0727:     @property
+
+0728:     def sig_pending(self):
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_11sig_pending_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_11sig_pending_1__get__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_11sig_pending___get__(((struct PyGeventLoopObject *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_11sig_pending___get__(struct PyGeventLoopObject *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__", 0);
+
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_AddTraceback("gevent.libev.corecext.loop.sig_pending.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0729:         _check_loop(self)
+
+  __pyx_t_1 = __pyx_f_6gevent_5libev_8corecext__check_loop(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 729, __pyx_L1_error)
+
+0730:         return libev.gevent_ev_loop_sig_pending(self._ptr)
+
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_2 = __Pyx_PyInt_From_int(gevent_ev_loop_sig_pending(__pyx_v_self->_ptr)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 730, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_r = __pyx_t_2;
+  __pyx_t_2 = 0;
+  goto __pyx_L0;
+
 0731: 
+
 0732:     @property
+
+0733:     def origflags(self):
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_9origflags_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_9origflags_1__get__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_9origflags___get__(((struct PyGeventLoopObject *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_9origflags___get__(struct PyGeventLoopObject *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__", 0);
+
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.libev.corecext.loop.origflags.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0734:         return _flags_to_list(self.origflags_int)
+
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_origflags_int); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 734, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = __Pyx_PyInt_As_unsigned_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 734, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_1 = __pyx_f_6gevent_5libev_8corecext__flags_to_list(__pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 734, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
 0735: 
+
 0736:     @property
+
+0737:     def origflags_int(self):
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_13origflags_int_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_13origflags_int_1__get__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_13origflags_int___get__(((struct PyGeventLoopObject *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_13origflags_int___get__(struct PyGeventLoopObject *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__", 0);
+
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_AddTraceback("gevent.libev.corecext.loop.origflags_int.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0738:         _check_loop(self)
+
+  __pyx_t_1 = __pyx_f_6gevent_5libev_8corecext__check_loop(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 738, __pyx_L1_error)
+
+0739:         return libev.gevent_ev_loop_origflags(self._ptr)
+
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_2 = __Pyx_PyInt_From_unsigned_int(gevent_ev_loop_origflags(__pyx_v_self->_ptr)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 739, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_r = __pyx_t_2;
+  __pyx_t_2 = 0;
+  goto __pyx_L0;
+
 0740: 
+
 0741:     @property
+
+0742:     def sigfd(self):
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_5sigfd_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4loop_5sigfd_1__get__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4loop_5sigfd___get__(((struct PyGeventLoopObject *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_4loop_5sigfd___get__(struct PyGeventLoopObject *__pyx_v_self) {
+  int __pyx_v_fd;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__", 0);
+
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_AddTraceback("gevent.libev.corecext.loop.sigfd.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0743:         _check_loop(self)
+
+  __pyx_t_1 = __pyx_f_6gevent_5libev_8corecext__check_loop(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 743, __pyx_L1_error)
+
+0744:         fd = libev.gevent_ev_loop_sigfd(self._ptr)
+
+  __pyx_v_fd = gevent_ev_loop_sigfd(__pyx_v_self->_ptr);
+
+0745:         if fd >= 0:
+
+  __pyx_t_1 = ((__pyx_v_fd >= 0) != 0);
+  if (__pyx_t_1) {
+
+  }
+
+0746:             return fd
+
+    __Pyx_XDECREF(__pyx_r);
+    __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_fd); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 746, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_r = __pyx_t_2;
+    __pyx_t_2 = 0;
+    goto __pyx_L0;
+
 0747: 
+
 0748:         # Explicitly not EV_USE_SIGNALFD
+
+0749:         raise AttributeError("sigfd")
+
+  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_AttributeError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 749, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_Raise(__pyx_t_2, 0, 0, 0);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __PYX_ERR(0, 749, __pyx_L1_error)
+
+  __pyx_tuple__11 = PyTuple_Pack(1, __pyx_n_s_sigfd); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 749, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__11);
+  __Pyx_GIVEREF(__pyx_tuple__11);
+
 0750: 
+
+0751: try:
+
+  {
+    /*try:*/ {
+
+    }
+
+    __Pyx_XGIVEREF(__pyx_t_19);
+    __Pyx_XGIVEREF(__pyx_t_20);
+    __Pyx_XGIVEREF(__pyx_t_21);
+    __Pyx_ExceptionReset(__pyx_t_19, __pyx_t_20, __pyx_t_21);
+    goto __pyx_L1_error;
+    __pyx_L5_exception_handled:;
+    __Pyx_XGIVEREF(__pyx_t_19);
+    __Pyx_XGIVEREF(__pyx_t_20);
+    __Pyx_XGIVEREF(__pyx_t_21);
+    __Pyx_ExceptionReset(__pyx_t_19, __pyx_t_20, __pyx_t_21);
+    __pyx_L9_try_end:;
+  }
+
+0752:     from zope.interface import classImplements
+
+      __pyx_t_12 = PyList_New(1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 752, __pyx_L4_error)
+      __Pyx_GOTREF(__pyx_t_12);
+      __Pyx_INCREF(__pyx_n_s_classImplements);
+      __Pyx_GIVEREF(__pyx_n_s_classImplements);
+      PyList_SET_ITEM(__pyx_t_12, 0, __pyx_n_s_classImplements);
+      __pyx_t_18 = __Pyx_Import(__pyx_n_s_zope_interface, __pyx_t_12, 0); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 752, __pyx_L4_error)
+      __Pyx_GOTREF(__pyx_t_18);
+      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
+      __pyx_t_12 = __Pyx_ImportFrom(__pyx_t_18, __pyx_n_s_classImplements); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 752, __pyx_L4_error)
+      __Pyx_GOTREF(__pyx_t_12);
+      if (PyDict_SetItem(__pyx_d, __pyx_n_s_classImplements, __pyx_t_12) < 0) __PYX_ERR(0, 752, __pyx_L4_error)
+      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
+      __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
+
+0753: except ImportError:
+
+    __pyx_t_22 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ImportError);
+    if (__pyx_t_22) {
+      __Pyx_ErrRestore(0,0,0);
+      goto __pyx_L5_exception_handled;
+    }
+    goto __pyx_L6_except_error;
+    __pyx_L6_except_error:;
+
 0754:     pass
+
 0755: else:
+
 0756:     # XXX: This invokes the side-table lookup, we would
+
 0757:     # prefer to have it stored directly on the class.
+
+0758:     from gevent._interfaces import ILoop
+
+    /*else:*/ {
+      __pyx_t_18 = PyList_New(1); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 758, __pyx_L6_except_error)
+      __Pyx_GOTREF(__pyx_t_18);
+      __Pyx_INCREF(__pyx_n_s_ILoop);
+      __Pyx_GIVEREF(__pyx_n_s_ILoop);
+      PyList_SET_ITEM(__pyx_t_18, 0, __pyx_n_s_ILoop);
+      __pyx_t_12 = __Pyx_Import(__pyx_n_s_gevent__interfaces, __pyx_t_18, 0); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 758, __pyx_L6_except_error)
+      __Pyx_GOTREF(__pyx_t_12);
+      __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
+      __pyx_t_18 = __Pyx_ImportFrom(__pyx_t_12, __pyx_n_s_ILoop); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 758, __pyx_L6_except_error)
+      __Pyx_GOTREF(__pyx_t_18);
+      if (PyDict_SetItem(__pyx_d, __pyx_n_s_ILoop, __pyx_t_18) < 0) __PYX_ERR(0, 758, __pyx_L6_except_error)
+      __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
+      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
+
+0759:     classImplements(loop, ILoop)
+
+      __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_classImplements); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 759, __pyx_L6_except_error)
+      __Pyx_GOTREF(__pyx_t_12);
+      __Pyx_GetModuleGlobalName(__pyx_t_18, __pyx_n_s_ILoop); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 759, __pyx_L6_except_error)
+      __Pyx_GOTREF(__pyx_t_18);
+      __pyx_t_17 = PyTuple_New(2); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 759, __pyx_L6_except_error)
+      __Pyx_GOTREF(__pyx_t_17);
+      __Pyx_INCREF(((PyObject *)__pyx_ptype_6gevent_5libev_8corecext_loop));
+      __Pyx_GIVEREF(((PyObject *)__pyx_ptype_6gevent_5libev_8corecext_loop));
+      PyTuple_SET_ITEM(__pyx_t_17, 0, ((PyObject *)__pyx_ptype_6gevent_5libev_8corecext_loop));
+      __Pyx_GIVEREF(__pyx_t_18);
+      PyTuple_SET_ITEM(__pyx_t_17, 1, __pyx_t_18);
+      __pyx_t_18 = 0;
+      __pyx_t_18 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_17, NULL); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 759, __pyx_L6_except_error)
+      __Pyx_GOTREF(__pyx_t_18);
+      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
+      __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
+      __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
+    }
+    __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
+    __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
+    __Pyx_XDECREF(__pyx_t_21); __pyx_t_21 = 0;
+    goto __pyx_L9_try_end;
+    __pyx_L4_error:;
+    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
+    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
+    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
+    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
+    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
+    __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
+    __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
+    __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
+    __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
+    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
+    __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
+
 0760: 
+
 0761: # about readonly _flags attribute:
+
 0762: # bit #1 set if object owns Python reference to itself (Py_INCREF was
+
 0763: # called and we must call Py_DECREF later)
+
 0764: DEF FLAG_WATCHER_OWNS_PYREF = 1 << 0 # 0x1
+
 0765: # bit #2 set if ev_unref() was called and we must call ev_ref() later
+
 0766: DEF FLAG_WATCHER_NEEDS_EVREF = 1 << 1 # 0x2
+
 0767: # bit #3 set if user wants to call ev_unref() before start()
+
 0768: DEF FLAG_WATCHER_UNREF_BEFORE_START = 1 << 2 # 0x4
+
 0769: # bits 2 and 3 are *both* set when we are active, but the user
+
 0770: # request us not to be ref'd anymore. We unref us (because going active will
+
 0771: # ref us) and then make a note of this in the future
+
 0772: DEF FLAG_WATCHER_MASK_UNREF_NEEDS_REF = 0x6
+
 0773: 
+
 0774: 
+
+0775: cdef void _python_incref(watcher self):
+
+
+static void __pyx_f_6gevent_5libev_8corecext__python_incref(struct PyGeventWatcherObject *__pyx_v_self) {
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_python_incref", 0);
+
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+}
+
+0776:     if not self._flags & FLAG_WATCHER_OWNS_PYREF:
+
+  __pyx_t_1 = ((!((__pyx_v_self->_flags & 1) != 0)) != 0);
+  if (__pyx_t_1) {
+
+  }
+
+0777:         Py_INCREF(self)
+
+    Py_INCREF(((PyObject *)__pyx_v_self));
+
+0778:         self._flags |= FLAG_WATCHER_OWNS_PYREF
+
+    __pyx_v_self->_flags = (__pyx_v_self->_flags | 1);
+
 0779: 
+
+0780: cdef void _python_decref(watcher self):
+
+
+static void __pyx_f_6gevent_5libev_8corecext__python_decref(struct PyGeventWatcherObject *__pyx_v_self) {
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_python_decref", 0);
+
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+}
+
+0781:     if self._flags & FLAG_WATCHER_OWNS_PYREF:
+
+  __pyx_t_1 = ((__pyx_v_self->_flags & 1) != 0);
+  if (__pyx_t_1) {
+
+  }
+
+0782:         Py_DECREF(self)
+
+    Py_DECREF(((PyObject *)__pyx_v_self));
+
+0783:         self._flags &= ~FLAG_WATCHER_OWNS_PYREF
+
+    __pyx_v_self->_flags = (__pyx_v_self->_flags & (~1));
+
 0784: 
+
+0785: cdef void _libev_ref(watcher self):
+
+
+static void __pyx_f_6gevent_5libev_8corecext__libev_ref(struct PyGeventWatcherObject *__pyx_v_self) {
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_libev_ref", 0);
+
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+}
+
+0786:     if self._flags & FLAG_WATCHER_NEEDS_EVREF:
+
+  __pyx_t_1 = ((__pyx_v_self->_flags & 2) != 0);
+  if (__pyx_t_1) {
+
+  }
+
+0787:         libev.ev_ref(self.loop._ptr)
+
+    ev_ref(__pyx_v_self->loop->_ptr);
+
+0788:         self._flags &= ~FLAG_WATCHER_NEEDS_EVREF
+
+    __pyx_v_self->_flags = (__pyx_v_self->_flags & (~2));
+
 0789: 
+
+0790: cdef void _libev_unref(watcher self):
+
+
+static void __pyx_f_6gevent_5libev_8corecext__libev_unref(struct PyGeventWatcherObject *__pyx_v_self) {
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_libev_unref", 0);
+
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+}
+
+0791:     if self._flags & FLAG_WATCHER_MASK_UNREF_NEEDS_REF == FLAG_WATCHER_UNREF_BEFORE_START:
+
+  __pyx_t_1 = (((__pyx_v_self->_flags & 6) == 4) != 0);
+  if (__pyx_t_1) {
+
+  }
+
+0792:         libev.ev_unref(self.loop._ptr)
+
+    ev_unref(__pyx_v_self->loop->_ptr);
+
+0793:         self._flags |= FLAG_WATCHER_NEEDS_EVREF
+
+    __pyx_v_self->_flags = (__pyx_v_self->_flags | 2);
+
 0794: 
+
 0795: 
+
+0796: ctypedef void (*start_stop_func)(libev.ev_loop*, void*) nogil
+
+typedef void (*__pyx_t_6gevent_5libev_8corecext_start_stop_func)(struct ev_loop *, void *);
+
 0797: 
+
+0798: cdef struct start_and_stop:
+
+struct __pyx_t_6gevent_5libev_8corecext_start_and_stop {
+  __pyx_t_6gevent_5libev_8corecext_start_stop_func start;
+  __pyx_t_6gevent_5libev_8corecext_start_stop_func stop;
+};
+
 0799:     start_stop_func start
+
 0800:     start_stop_func stop
+
 0801: 
+
+0802: cdef start_and_stop make_ss(void* start, void* stop):
+
+
+static struct __pyx_t_6gevent_5libev_8corecext_start_and_stop __pyx_f_6gevent_5libev_8corecext_make_ss(void *__pyx_v_start, void *__pyx_v_stop) {
+  struct __pyx_t_6gevent_5libev_8corecext_start_and_stop __pyx_v_result;
+  struct __pyx_t_6gevent_5libev_8corecext_start_and_stop __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("make_ss", 0);
+
+
+  /* function exit code */
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0803:     cdef start_and_stop result = start_and_stop(<start_stop_func>start, <start_stop_func>stop)
+
+  __pyx_t_1.start = ((__pyx_t_6gevent_5libev_8corecext_start_stop_func)__pyx_v_start);
+  __pyx_t_1.stop = ((__pyx_t_6gevent_5libev_8corecext_start_stop_func)__pyx_v_stop);
+  __pyx_v_result = __pyx_t_1;
+
+0804:     return result
+
+  __pyx_r = __pyx_v_result;
+  goto __pyx_L0;
+
 0805: 
+
+0806: cdef bint _watcher_start(watcher self, object callback, tuple args) except -1:
+
+
+static int __pyx_f_6gevent_5libev_8corecext__watcher_start(struct PyGeventWatcherObject *__pyx_v_self, PyObject *__pyx_v_callback, PyObject *__pyx_v_args) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_watcher_start", 0);
+
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_AddTraceback("gevent.libev.corecext._watcher_start", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = -1;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
 0807:     # This method should be called by subclasses of watcher, if they
+
 0808:     # override the python-level `start` function: they've already paid
+
 0809:     # for argument unpacking, and `start` cannot be cpdef since it
+
 0810:     # uses varargs.
+
 0811: 
+
 0812:     # We keep this as a function, not a cdef method of watcher.
+
 0813:     # If it's a cdef method, it could potentially be overridden
+
 0814:     # by a subclass, which means that the watcher gains a pointer to a
+
 0815:     # function table (vtable), making each object 8 bytes larger.
+
 0816: 
+
+0817:     _check_loop(self.loop)
+
+  __pyx_t_1 = ((PyObject *)__pyx_v_self->loop);
+  __Pyx_INCREF(__pyx_t_1);
+  __pyx_t_2 = __pyx_f_6gevent_5libev_8corecext__check_loop(((struct PyGeventLoopObject *)__pyx_t_1)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 817, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+0818:     if callback is None or not callable(callback):
+
+  __pyx_t_3 = (__pyx_v_callback == Py_None);
+  __pyx_t_4 = (__pyx_t_3 != 0);
+  if (!__pyx_t_4) {
+  } else {
+    __pyx_t_2 = __pyx_t_4;
+    goto __pyx_L4_bool_binop_done;
+  }
+  __pyx_t_4 = __Pyx_PyCallable_Check(__pyx_v_callback); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 818, __pyx_L1_error)
+  __pyx_t_3 = ((!(__pyx_t_4 != 0)) != 0);
+  __pyx_t_2 = __pyx_t_3;
+  __pyx_L4_bool_binop_done:;
+  if (unlikely(__pyx_t_2)) {
+
+  }
+
+0819:         raise TypeError("Expected callable, not %r" % (callback, ))
+
+    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 819, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_INCREF(__pyx_v_callback);
+    __Pyx_GIVEREF(__pyx_v_callback);
+    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_callback);
+    __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_Expected_callable_not_r, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 819, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_5);
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 819, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __PYX_ERR(0, 819, __pyx_L1_error)
+
+0820:     self._callback = callback
+
+  __Pyx_INCREF(__pyx_v_callback);
+  __Pyx_GIVEREF(__pyx_v_callback);
+  __Pyx_GOTREF(__pyx_v_self->_callback);
+  __Pyx_DECREF(__pyx_v_self->_callback);
+  __pyx_v_self->_callback = __pyx_v_callback;
+
+0821:     self.args = args
+
+  __Pyx_INCREF(__pyx_v_args);
+  __Pyx_GIVEREF(__pyx_v_args);
+  __Pyx_GOTREF(__pyx_v_self->args);
+  __Pyx_DECREF(__pyx_v_self->args);
+  __pyx_v_self->args = __pyx_v_args;
+
+0822:     _libev_unref(self)
+
+  __pyx_f_6gevent_5libev_8corecext__libev_unref(__pyx_v_self);
+
+0823:     _python_incref(self)
+
+  __pyx_f_6gevent_5libev_8corecext__python_incref(__pyx_v_self);
+
+0824:     self.__ss.start(self.loop._ptr, self.__watcher)
+
+  __pyx_v_self->__pyx___ss->start(__pyx_v_self->loop->_ptr, __pyx_v_self->__pyx___watcher);
+
+0825:     return 1
+
+  __pyx_r = 1;
+  goto __pyx_L0;
+
 0826: 
+
+0827: cdef public class watcher [object PyGeventWatcherObject, type PyGeventWatcher_Type]:
+
+struct PyGeventWatcherObject {
+  PyObject_HEAD
+  struct PyGeventLoopObject *loop;
+  PyObject *_callback;
+  PyObject *args;
+  struct ev_watcher *__pyx___watcher;
+  struct __pyx_t_6gevent_5libev_8corecext_start_and_stop *__pyx___ss;
+  unsigned int _flags;
+};
+
+__PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyGeventWatcher_Type;
+
 0828:     """Abstract base class for all the watchers"""
+
 0829:     ## pointer members
+
+0830:     cdef public loop loop
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_4loop_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_4loop_1__get__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_7watcher_4loop___get__(((struct PyGeventWatcherObject *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_7watcher_4loop___get__(struct PyGeventWatcherObject *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __Pyx_INCREF(((PyObject *)__pyx_v_self->loop));
+  __pyx_r = ((PyObject *)__pyx_v_self->loop);
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static int __pyx_pw_6gevent_5libev_8corecext_7watcher_4loop_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
+static int __pyx_pw_6gevent_5libev_8corecext_7watcher_4loop_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_7watcher_4loop_2__set__(((struct PyGeventWatcherObject *)__pyx_v_self), ((PyObject *)__pyx_v_value));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_5libev_8corecext_7watcher_4loop_2__set__(struct PyGeventWatcherObject *__pyx_v_self, PyObject *__pyx_v_value) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__set__", 0);
+  if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_6gevent_5libev_8corecext_loop))))) __PYX_ERR(0, 830, __pyx_L1_error)
+  __pyx_t_1 = __pyx_v_value;
+  __Pyx_INCREF(__pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_1);
+  __Pyx_GOTREF(__pyx_v_self->loop);
+  __Pyx_DECREF(((PyObject *)__pyx_v_self->loop));
+  __pyx_v_self->loop = ((struct PyGeventLoopObject *)__pyx_t_1);
+  __pyx_t_1 = 0;
+
+  /* function exit code */
+  __pyx_r = 0;
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.libev.corecext.watcher.loop.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = -1;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static int __pyx_pw_6gevent_5libev_8corecext_7watcher_4loop_5__del__(PyObject *__pyx_v_self); /*proto*/
+static int __pyx_pw_6gevent_5libev_8corecext_7watcher_4loop_5__del__(PyObject *__pyx_v_self) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_7watcher_4loop_4__del__(((struct PyGeventWatcherObject *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_5libev_8corecext_7watcher_4loop_4__del__(struct PyGeventWatcherObject *__pyx_v_self) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__del__", 0);
+  __Pyx_INCREF(Py_None);
+  __Pyx_GIVEREF(Py_None);
+  __Pyx_GOTREF(__pyx_v_self->loop);
+  __Pyx_DECREF(((PyObject *)__pyx_v_self->loop));
+  __pyx_v_self->loop = ((struct PyGeventLoopObject *)Py_None);
+
+  /* function exit code */
+  __pyx_r = 0;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
 0831:     cdef object _callback
+
+0832:     cdef public tuple args
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_4args_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_4args_1__get__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_7watcher_4args___get__(((struct PyGeventWatcherObject *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_7watcher_4args___get__(struct PyGeventWatcherObject *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __Pyx_INCREF(__pyx_v_self->args);
+  __pyx_r = __pyx_v_self->args;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static int __pyx_pw_6gevent_5libev_8corecext_7watcher_4args_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
+static int __pyx_pw_6gevent_5libev_8corecext_7watcher_4args_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_7watcher_4args_2__set__(((struct PyGeventWatcherObject *)__pyx_v_self), ((PyObject *)__pyx_v_value));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_5libev_8corecext_7watcher_4args_2__set__(struct PyGeventWatcherObject *__pyx_v_self, PyObject *__pyx_v_value) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__set__", 0);
+  if (!(likely(PyTuple_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v_value)->tp_name), 0))) __PYX_ERR(0, 832, __pyx_L1_error)
+  __pyx_t_1 = __pyx_v_value;
+  __Pyx_INCREF(__pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_1);
+  __Pyx_GOTREF(__pyx_v_self->args);
+  __Pyx_DECREF(__pyx_v_self->args);
+  __pyx_v_self->args = ((PyObject*)__pyx_t_1);
+  __pyx_t_1 = 0;
+
+  /* function exit code */
+  __pyx_r = 0;
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.libev.corecext.watcher.args.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = -1;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static int __pyx_pw_6gevent_5libev_8corecext_7watcher_4args_5__del__(PyObject *__pyx_v_self); /*proto*/
+static int __pyx_pw_6gevent_5libev_8corecext_7watcher_4args_5__del__(PyObject *__pyx_v_self) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_7watcher_4args_4__del__(((struct PyGeventWatcherObject *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_5libev_8corecext_7watcher_4args_4__del__(struct PyGeventWatcherObject *__pyx_v_self) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__del__", 0);
+  __Pyx_INCREF(Py_None);
+  __Pyx_GIVEREF(Py_None);
+  __Pyx_GOTREF(__pyx_v_self->args);
+  __Pyx_DECREF(__pyx_v_self->args);
+  __pyx_v_self->args = ((PyObject*)Py_None);
+
+  /* function exit code */
+  __pyx_r = 0;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
 0833: 
+
 0834:     # By keeping a __watcher cached, the size of the io and timer
+
 0835:     # structs becomes 152 bytes and child is 160 and stat is 512 (when
+
 0836:     # the start_and_stop is inlined). On 64-bit macOS CPython 2.7. I
+
 0837:     # hoped that using libev's data pointer and allocating the
+
 0838:     # watchers directly and not as inline members would result in
+
 0839:     # overall savings thanks to better padding, but it didn't. And it
+
 0840:     # added lots of casts, making the code ugly.
+
 0841: 
+
 0842:     # Table:
+
 0843:     # gevent ver   | 1.2 | This | +data
+
 0844:     # Watcher Kind |     |      |
+
 0845:     # Timer        | 120 | 152  | 160
+
 0846:     # IO           | 120 | 152  | 160
+
 0847:     # Child        | 128 | 160  | 168
+
 0848:     # Stat         | 480 | 512  | 512
+
 0849:     cdef libev.ev_watcher* __watcher
+
 0850: 
+
 0851:     # By inlining the start_and_stop struct, instead of taking the address
+
 0852:     # of a static struct or using the watcher's data pointer, we
+
 0853:     # use an additional pointer of memory and incur an additional pointer copy
+
 0854:     # on creation.
+
 0855:     # But we use fewer pointer accesses for start/stop, and they have
+
 0856:     # better cache locality. (Then again, we're bigger).
+
 0857:     # Right now we're going for size, so we use the pointer. IO/Timer objects
+
 0858:     # are then 144 bytes.
+
 0859:     cdef start_and_stop* __ss
+
 0860: 
+
 0861:     ## Int members
+
 0862: 
+
 0863:     # Our subclasses will declare the ev_X struct
+
 0864:     # as an inline member. This is good for locality, but
+
 0865:     # probably bad for alignment, as it will get tacked on
+
 0866:     # immediately after our data.
+
 0867: 
+
 0868:     # But all ev_watchers start with some ints, so maybe we can help that
+
 0869:     # out by putting our ints here.
+
+0870:     cdef readonly unsigned int _flags
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_6_flags_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_6_flags_1__get__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_7watcher_6_flags___get__(((struct PyGeventWatcherObject *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_7watcher_6_flags___get__(struct PyGeventWatcherObject *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __Pyx_PyInt_From_unsigned_int(__pyx_v_self->_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 870, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.libev.corecext.watcher._flags.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
 0871: 
+
+0872:     def __init__(self, loop loop, ref=True, priority=None):
+
+
+/* Python wrapper */
+static int __pyx_pw_6gevent_5libev_8corecext_7watcher_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static int __pyx_pw_6gevent_5libev_8corecext_7watcher_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  struct PyGeventLoopObject *__pyx_v_loop = 0;
+  PyObject *__pyx_v_ref = 0;
+  PyObject *__pyx_v_priority = 0;
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_loop,&__pyx_n_s_ref,&__pyx_n_s_priority,0};
+    PyObject* values[3] = {0,0,0};
+    values[1] = ((PyObject *)Py_True);
+    values[2] = ((PyObject *)Py_None);
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_loop)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ref);
+          if (value) { values[1] = value; kw_args--; }
+        }
+        CYTHON_FALLTHROUGH;
+        case  2:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_priority);
+          if (value) { values[2] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 872, __pyx_L3_error)
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    __pyx_v_loop = ((struct PyGeventLoopObject *)values[0]);
+    __pyx_v_ref = values[1];
+    __pyx_v_priority = values[2];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 872, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.libev.corecext.watcher.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return -1;
+  __pyx_L4_argument_unpacking_done:;
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_loop), __pyx_ptype_6gevent_5libev_8corecext_loop, 1, "loop", 0))) __PYX_ERR(0, 872, __pyx_L1_error)
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_7watcher___init__(((struct PyGeventWatcherObject *)__pyx_v_self), __pyx_v_loop, __pyx_v_ref, __pyx_v_priority);
+
+  /* function exit code */
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __pyx_r = -1;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_5libev_8corecext_7watcher___init__(struct PyGeventWatcherObject *__pyx_v_self, struct PyGeventLoopObject *__pyx_v_loop, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__", 0);
+
+
+  /* function exit code */
+  __pyx_r = 0;
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_AddTraceback("gevent.libev.corecext.watcher.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = -1;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0873:         if not self.__watcher or not self.__ss.start or not self.__ss.stop:
+
+  __pyx_t_2 = ((!(__pyx_v_self->__pyx___watcher != 0)) != 0);
+  if (!__pyx_t_2) {
+  } else {
+    __pyx_t_1 = __pyx_t_2;
+    goto __pyx_L4_bool_binop_done;
+  }
+  __pyx_t_2 = ((!(__pyx_v_self->__pyx___ss->start != 0)) != 0);
+  if (!__pyx_t_2) {
+  } else {
+    __pyx_t_1 = __pyx_t_2;
+    goto __pyx_L4_bool_binop_done;
+  }
+  __pyx_t_2 = ((!(__pyx_v_self->__pyx___ss->stop != 0)) != 0);
+  __pyx_t_1 = __pyx_t_2;
+  __pyx_L4_bool_binop_done:;
+  if (unlikely(__pyx_t_1)) {
+
+  }
+
+0874:             raise ValueError("Cannot construct a bare watcher")
+
+    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 874, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __PYX_ERR(0, 874, __pyx_L1_error)
+
+  __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_s_Cannot_construct_a_bare_watcher); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 874, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__12);
+  __Pyx_GIVEREF(__pyx_tuple__12);
+
+0875:         self.loop = loop
+
+  __Pyx_INCREF(((PyObject *)__pyx_v_loop));
+  __Pyx_GIVEREF(((PyObject *)__pyx_v_loop));
+  __Pyx_GOTREF(__pyx_v_self->loop);
+  __Pyx_DECREF(((PyObject *)__pyx_v_self->loop));
+  __pyx_v_self->loop = __pyx_v_loop;
+
+0876:         self._flags = 0 if ref else FLAG_WATCHER_UNREF_BEFORE_START
+
+  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_ref); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 876, __pyx_L1_error)
+  if (__pyx_t_1) {
+    __pyx_t_4 = 0;
+  } else {
+    __pyx_t_4 = 4;
+  }
+  __pyx_v_self->_flags = __pyx_t_4;
+
+0877:         if priority is not None:
+
+  __pyx_t_1 = (__pyx_v_priority != Py_None);
+  __pyx_t_2 = (__pyx_t_1 != 0);
+  if (__pyx_t_2) {
+
+  }
+
+0878:             libev.ev_set_priority(self.__watcher, priority)
+
+    __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_v_priority); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 878, __pyx_L1_error)
+    ev_set_priority(__pyx_v_self->__pyx___watcher, __pyx_t_5);
+
 0879: 
+
 0880:     @property
+
+0881:     def ref(self):
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_3ref_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_3ref_1__get__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_7watcher_3ref___get__(((struct PyGeventWatcherObject *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_7watcher_3ref___get__(struct PyGeventWatcherObject *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__", 0);
+
+
+  /* function exit code */
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0882:         return False if self._flags & 4 else True
+
+  __Pyx_XDECREF(__pyx_r);
+  if (((__pyx_v_self->_flags & 4) != 0)) {
+    __Pyx_INCREF(Py_False);
+    __pyx_t_1 = Py_False;
+  } else {
+    __Pyx_INCREF(Py_True);
+    __pyx_t_1 = Py_True;
+  }
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
 0883: 
+
 0884:     @ref.setter
+
+0885:     def ref(self, object value):
+
+
+/* Python wrapper */
+static int __pyx_pw_6gevent_5libev_8corecext_7watcher_3ref_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
+static int __pyx_pw_6gevent_5libev_8corecext_7watcher_3ref_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_7watcher_3ref_2__set__(((struct PyGeventWatcherObject *)__pyx_v_self), ((PyObject *)__pyx_v_value));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_5libev_8corecext_7watcher_3ref_2__set__(struct PyGeventWatcherObject *__pyx_v_self, PyObject *__pyx_v_value) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__set__", 0);
+
+
+  /* function exit code */
+  __pyx_r = 0;
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.libev.corecext.watcher.ref.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = -1;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0886:         _check_loop(self.loop)
+
+  __pyx_t_1 = ((PyObject *)__pyx_v_self->loop);
+  __Pyx_INCREF(__pyx_t_1);
+  __pyx_t_2 = __pyx_f_6gevent_5libev_8corecext__check_loop(((struct PyGeventLoopObject *)__pyx_t_1)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 886, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+0887:         if value:
+
+  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_value); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 887, __pyx_L1_error)
+  if (__pyx_t_2) {
+
+    goto __pyx_L3;
+  }
+
 0888:             # self.ref should be true after this.
+
+0889:             if self.ref:
+
+    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_ref); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 889, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 889, __pyx_L1_error)
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    if (__pyx_t_2) {
+
+    }
+
+0890:                return  # ref is already True
+
+      __pyx_r = 0;
+      goto __pyx_L0;
+
 0891: 
+
+0892:             if self._flags & FLAG_WATCHER_NEEDS_EVREF:  # ev_unref was called, undo
+
+    __pyx_t_2 = ((__pyx_v_self->_flags & 2) != 0);
+    if (__pyx_t_2) {
+
+    }
+
+0893:                libev.ev_ref(self.loop._ptr)
+
+      ev_ref(__pyx_v_self->loop->_ptr);
+
 0894: 			# do not want unref, no outstanding unref
+
+0895:             self._flags &= ~FLAG_WATCHER_MASK_UNREF_NEEDS_REF
+
+    __pyx_v_self->_flags = (__pyx_v_self->_flags & (~6));
+
 0896:         else:
+
 0897: 			# self.ref must be false after this
+
+0898:             if not self.ref:
+
+  /*else*/ {
+    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_ref); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 898, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 898, __pyx_L1_error)
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __pyx_t_3 = ((!__pyx_t_2) != 0);
+    if (__pyx_t_3) {
+
+    }
+
+0899:                return  # ref is already False
+
+      __pyx_r = 0;
+      goto __pyx_L0;
+
+0900:             self._flags |= FLAG_WATCHER_UNREF_BEFORE_START
+
+    __pyx_v_self->_flags = (__pyx_v_self->_flags | 4);
+
+0901:             if not self._flags & FLAG_WATCHER_NEEDS_EVREF and libev.ev_is_active(self.__watcher):
+
+    __pyx_t_2 = ((!((__pyx_v_self->_flags & 2) != 0)) != 0);
+    if (__pyx_t_2) {
+    } else {
+      __pyx_t_3 = __pyx_t_2;
+      goto __pyx_L8_bool_binop_done;
+    }
+    __pyx_t_2 = (ev_is_active(__pyx_v_self->__pyx___watcher) != 0);
+    __pyx_t_3 = __pyx_t_2;
+    __pyx_L8_bool_binop_done:;
+    if (__pyx_t_3) {
+
+    }
+  }
+  __pyx_L3:;
+
+0902:                libev.ev_unref(self.loop._ptr)
+
+      ev_unref(__pyx_v_self->loop->_ptr);
+
+0903:                self._flags |= FLAG_WATCHER_NEEDS_EVREF
+
+      __pyx_v_self->_flags = (__pyx_v_self->_flags | 2);
+
 0904: 
+
 0905:     @property
+
+0906:     def callback(self):
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_8callback_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_8callback_1__get__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_7watcher_8callback___get__(((struct PyGeventWatcherObject *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_7watcher_8callback___get__(struct PyGeventWatcherObject *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__", 0);
+
+
+  /* function exit code */
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0907:         return self._callback
+
+  __Pyx_XDECREF(__pyx_r);
+  __Pyx_INCREF(__pyx_v_self->_callback);
+  __pyx_r = __pyx_v_self->_callback;
+  goto __pyx_L0;
+
 0908: 
+
 0909:     @callback.setter
+
+0910:     def callback(self, object callback):
+
+
+/* Python wrapper */
+static int __pyx_pw_6gevent_5libev_8corecext_7watcher_8callback_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_callback); /*proto*/
+static int __pyx_pw_6gevent_5libev_8corecext_7watcher_8callback_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_callback) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_7watcher_8callback_2__set__(((struct PyGeventWatcherObject *)__pyx_v_self), ((PyObject *)__pyx_v_callback));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_5libev_8corecext_7watcher_8callback_2__set__(struct PyGeventWatcherObject *__pyx_v_self, PyObject *__pyx_v_callback) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__set__", 0);
+
+
+  /* function exit code */
+  __pyx_r = 0;
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_AddTraceback("gevent.libev.corecext.watcher.callback.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = -1;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0911:         if callback is not None and not callable(callback):
+
+  __pyx_t_2 = (__pyx_v_callback != Py_None);
+  __pyx_t_3 = (__pyx_t_2 != 0);
+  if (__pyx_t_3) {
+  } else {
+    __pyx_t_1 = __pyx_t_3;
+    goto __pyx_L4_bool_binop_done;
+  }
+  __pyx_t_3 = __Pyx_PyCallable_Check(__pyx_v_callback); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 911, __pyx_L1_error)
+  __pyx_t_2 = ((!(__pyx_t_3 != 0)) != 0);
+  __pyx_t_1 = __pyx_t_2;
+  __pyx_L4_bool_binop_done:;
+  if (unlikely(__pyx_t_1)) {
+
+  }
+
+0912:            raise TypeError("Expected callable, not %r" % (callback, ))
+
+    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 912, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_INCREF(__pyx_v_callback);
+    __Pyx_GIVEREF(__pyx_v_callback);
+    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_callback);
+    __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_Expected_callable_not_r, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 912, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_5);
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 912, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __PYX_ERR(0, 912, __pyx_L1_error)
+
+0913:         self._callback = callback
+
+  __Pyx_INCREF(__pyx_v_callback);
+  __Pyx_GIVEREF(__pyx_v_callback);
+  __Pyx_GOTREF(__pyx_v_self->_callback);
+  __Pyx_DECREF(__pyx_v_self->_callback);
+  __pyx_v_self->_callback = __pyx_v_callback;
+
 0914: 
+
 0915:     @property
+
+0916:     def priority(self):
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_8priority_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_8priority_1__get__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_7watcher_8priority___get__(((struct PyGeventWatcherObject *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_7watcher_8priority___get__(struct PyGeventWatcherObject *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__", 0);
+
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.libev.corecext.watcher.priority.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0917:         return libev.ev_priority(self.__watcher)
+
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __Pyx_PyInt_From_int(ev_priority(__pyx_v_self->__pyx___watcher)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 917, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
 0918: 
+
 0919:     @priority.setter
+
+0920:     def priority(self, int priority):
+
+
+/* Python wrapper */
+static int __pyx_pw_6gevent_5libev_8corecext_7watcher_8priority_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_priority); /*proto*/
+static int __pyx_pw_6gevent_5libev_8corecext_7watcher_8priority_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_priority) {
+  int __pyx_v_priority;
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
+  assert(__pyx_arg_priority); {
+    __pyx_v_priority = __Pyx_PyInt_As_int(__pyx_arg_priority); if (unlikely((__pyx_v_priority == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 920, __pyx_L3_error)
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.libev.corecext.watcher.priority.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return -1;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_7watcher_8priority_2__set__(((struct PyGeventWatcherObject *)__pyx_v_self), ((int)__pyx_v_priority));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_5libev_8corecext_7watcher_8priority_2__set__(struct PyGeventWatcherObject *__pyx_v_self, int __pyx_v_priority) {
+  struct ev_watcher *__pyx_v_w;
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__set__", 0);
+
+
+  /* function exit code */
+  __pyx_r = 0;
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_AddTraceback("gevent.libev.corecext.watcher.priority.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = -1;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0921:         cdef libev.ev_watcher* w = self.__watcher
+
+  __pyx_t_1 = __pyx_v_self->__pyx___watcher;
+  __pyx_v_w = __pyx_t_1;
+
+0922:         if libev.ev_is_active(w):
+
+  __pyx_t_2 = (ev_is_active(__pyx_v_w) != 0);
+  if (unlikely(__pyx_t_2)) {
+
+  }
+
+0923:            raise AttributeError("Cannot set priority of an active watcher")
+
+    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_AttributeError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 923, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __PYX_ERR(0, 923, __pyx_L1_error)
+
+  __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_s_Cannot_set_priority_of_an_active); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 923, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__13);
+  __Pyx_GIVEREF(__pyx_tuple__13);
+
+0924:         libev.ev_set_priority(w, priority)
+
+  ev_set_priority(__pyx_v_w, __pyx_v_priority);
+
 0925: 
+
 0926:     @property
+
+0927:     def active(self):
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_6active_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_6active_1__get__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_7watcher_6active___get__(((struct PyGeventWatcherObject *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_7watcher_6active___get__(struct PyGeventWatcherObject *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__", 0);
+
+
+  /* function exit code */
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0928:         return True if libev.ev_is_active(self.__watcher) else False
+
+  __Pyx_XDECREF(__pyx_r);
+  if ((ev_is_active(__pyx_v_self->__pyx___watcher) != 0)) {
+    __Pyx_INCREF(Py_True);
+    __pyx_t_1 = Py_True;
+  } else {
+    __Pyx_INCREF(Py_False);
+    __pyx_t_1 = Py_False;
+  }
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
 0929: 
+
 0930:     @property
+
+0931:     def pending(self):
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_7pending_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_7pending_1__get__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_7watcher_7pending___get__(((struct PyGeventWatcherObject *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_7watcher_7pending___get__(struct PyGeventWatcherObject *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__", 0);
+
+
+  /* function exit code */
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0932:         return True if libev.ev_is_pending(self.__watcher) else False
+
+  __Pyx_XDECREF(__pyx_r);
+  if ((ev_is_pending(__pyx_v_self->__pyx___watcher) != 0)) {
+    __Pyx_INCREF(Py_True);
+    __pyx_t_1 = Py_True;
+  } else {
+    __Pyx_INCREF(Py_False);
+    __pyx_t_1 = Py_False;
+  }
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
 0933: 
+
+0934:     def start(self, object callback, *args):
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_3start(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_3start(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_callback = 0;
+  PyObject *__pyx_v_args = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("start (wrapper)", 0);
+  if (PyTuple_GET_SIZE(__pyx_args) > 1) {
+    __pyx_v_args = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args));
+    if (unlikely(!__pyx_v_args)) {
+      __Pyx_RefNannyFinishContext();
+      return NULL;
+    }
+    __Pyx_GOTREF(__pyx_v_args);
+  } else {
+    __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple);
+  }
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_callback,0};
+    PyObject* values[1] = {0};
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        default:
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_callback)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+      }
+      if (unlikely(kw_args > 0)) {
+        const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1;
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "start") < 0)) __PYX_ERR(0, 934, __pyx_L3_error)
+      }
+    } else if (PyTuple_GET_SIZE(__pyx_args) < 1) {
+      goto __pyx_L5_argtuple_error;
+    } else {
+      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+    }
+    __pyx_v_callback = values[0];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("start", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 934, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0;
+  __Pyx_AddTraceback("gevent.libev.corecext.watcher.start", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_7watcher_2start(((struct PyGeventWatcherObject *)__pyx_v_self), __pyx_v_callback, __pyx_v_args);
+
+  /* function exit code */
+  __Pyx_XDECREF(__pyx_v_args);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_7watcher_2start(struct PyGeventWatcherObject *__pyx_v_self, PyObject *__pyx_v_callback, PyObject *__pyx_v_args) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("start", 0);
+
+
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_AddTraceback("gevent.libev.corecext.watcher.start", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0935:         _watcher_start(self, callback, args)
+
+  __pyx_t_1 = __pyx_f_6gevent_5libev_8corecext__watcher_start(__pyx_v_self, __pyx_v_callback, __pyx_v_args); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 935, __pyx_L1_error)
+
 0936: 
+
+0937:     def stop(self):
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_5stop(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_5stop(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("stop (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_7watcher_4stop(((struct PyGeventWatcherObject *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_7watcher_4stop(struct PyGeventWatcherObject *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("stop", 0);
+
+
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.libev.corecext.watcher.stop", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0938:         _check_loop(self.loop)
+
+  __pyx_t_1 = ((PyObject *)__pyx_v_self->loop);
+  __Pyx_INCREF(__pyx_t_1);
+  __pyx_t_2 = __pyx_f_6gevent_5libev_8corecext__check_loop(((struct PyGeventLoopObject *)__pyx_t_1)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 938, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+0939:         _libev_ref(self)
+
+  __pyx_f_6gevent_5libev_8corecext__libev_ref(__pyx_v_self);
+
 0940:         # The callback cannot possibly fire while we are executing,
+
 0941:         # so this is safe.
+
+0942:         self._callback = None
+
+  __Pyx_INCREF(Py_None);
+  __Pyx_GIVEREF(Py_None);
+  __Pyx_GOTREF(__pyx_v_self->_callback);
+  __Pyx_DECREF(__pyx_v_self->_callback);
+  __pyx_v_self->_callback = Py_None;
+
+0943:         self.args = None
+
+  __Pyx_INCREF(Py_None);
+  __Pyx_GIVEREF(Py_None);
+  __Pyx_GOTREF(__pyx_v_self->args);
+  __Pyx_DECREF(__pyx_v_self->args);
+  __pyx_v_self->args = ((PyObject*)Py_None);
+
+0944:         self.__ss.stop(self.loop._ptr, self.__watcher)
+
+  __pyx_v_self->__pyx___ss->stop(__pyx_v_self->loop->_ptr, __pyx_v_self->__pyx___watcher);
+
+0945:         _python_decref(self)
+
+  __pyx_f_6gevent_5libev_8corecext__python_decref(__pyx_v_self);
+
 0946: 
+
+0947:     def feed(self, int revents, object callback, *args):
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_7feed(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_7feed(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  int __pyx_v_revents;
+  PyObject *__pyx_v_callback = 0;
+  PyObject *__pyx_v_args = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("feed (wrapper)", 0);
+  if (PyTuple_GET_SIZE(__pyx_args) > 2) {
+    __pyx_v_args = PyTuple_GetSlice(__pyx_args, 2, PyTuple_GET_SIZE(__pyx_args));
+    if (unlikely(!__pyx_v_args)) {
+      __Pyx_RefNannyFinishContext();
+      return NULL;
+    }
+    __Pyx_GOTREF(__pyx_v_args);
+  } else {
+    __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple);
+  }
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_revents,&__pyx_n_s_callback,0};
+    PyObject* values[2] = {0,0};
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        default:
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_revents)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_callback)) != 0)) kw_args--;
+        else {
+          __Pyx_RaiseArgtupleInvalid("feed", 0, 2, 2, 1); __PYX_ERR(0, 947, __pyx_L3_error)
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        const Py_ssize_t used_pos_args = (pos_args < 2) ? pos_args : 2;
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "feed") < 0)) __PYX_ERR(0, 947, __pyx_L3_error)
+      }
+    } else if (PyTuple_GET_SIZE(__pyx_args) < 2) {
+      goto __pyx_L5_argtuple_error;
+    } else {
+      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+    }
+    __pyx_v_revents = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_revents == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 947, __pyx_L3_error)
+    __pyx_v_callback = values[1];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("feed", 0, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 947, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0;
+  __Pyx_AddTraceback("gevent.libev.corecext.watcher.feed", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_7watcher_6feed(((struct PyGeventWatcherObject *)__pyx_v_self), __pyx_v_revents, __pyx_v_callback, __pyx_v_args);
+
+  /* function exit code */
+  __Pyx_XDECREF(__pyx_v_args);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_7watcher_6feed(struct PyGeventWatcherObject *__pyx_v_self, int __pyx_v_revents, PyObject *__pyx_v_callback, PyObject *__pyx_v_args) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("feed", 0);
+
+
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.libev.corecext.watcher.feed", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0948:         _check_loop(self.loop)
+
+  __pyx_t_1 = ((PyObject *)__pyx_v_self->loop);
+  __Pyx_INCREF(__pyx_t_1);
+  __pyx_t_2 = __pyx_f_6gevent_5libev_8corecext__check_loop(((struct PyGeventLoopObject *)__pyx_t_1)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 948, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+0949:         self.callback = callback
+
+  if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_callback, __pyx_v_callback) < 0) __PYX_ERR(0, 949, __pyx_L1_error)
+
+0950:         self.args = args
+
+  __Pyx_INCREF(__pyx_v_args);
+  __Pyx_GIVEREF(__pyx_v_args);
+  __Pyx_GOTREF(__pyx_v_self->args);
+  __Pyx_DECREF(__pyx_v_self->args);
+  __pyx_v_self->args = __pyx_v_args;
+
+0951:         _libev_unref(self)
+
+  __pyx_f_6gevent_5libev_8corecext__libev_unref(__pyx_v_self);
+
+0952:         libev.ev_feed_event(self.loop._ptr, self.__watcher, revents)
+
+  ev_feed_event(__pyx_v_self->loop->_ptr, __pyx_v_self->__pyx___watcher, __pyx_v_revents);
+
+0953:         _python_incref(self)
+
+  __pyx_f_6gevent_5libev_8corecext__python_incref(__pyx_v_self);
+
 0954: 
+
+0955:     def __repr__(self):
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_9__repr__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_9__repr__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_7watcher_8__repr__(((struct PyGeventWatcherObject *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_7watcher_8__repr__(struct PyGeventWatcherObject *__pyx_v_self) {
+  PyObject *__pyx_v_format = NULL;
+  PyObject *__pyx_v_result = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__repr__", 0);
+
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_AddTraceback("gevent.libev.corecext.watcher.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_format);
+  __Pyx_XDECREF(__pyx_v_result);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0956:         if Py_ReprEnter(self) != 0:
+
+  __pyx_t_1 = ((Py_ReprEnter(((PyObject *)__pyx_v_self)) != 0) != 0);
+  if (__pyx_t_1) {
+
+  }
+
+0957:             return "<...>"
+
+    __Pyx_XDECREF(__pyx_r);
+    __Pyx_INCREF(__pyx_kp_s__5);
+    __pyx_r = __pyx_kp_s__5;
+    goto __pyx_L0;
+
+0958:         try:
+
+  /*try:*/ {
+
+0959:             format = self._format()
+
+    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 959, __pyx_L5_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __pyx_t_4 = NULL;
+    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
+      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+      if (likely(__pyx_t_4)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+        __Pyx_INCREF(__pyx_t_4);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_3, function);
+      }
+    }
+    __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
+    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 959, __pyx_L5_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __pyx_v_format = __pyx_t_2;
+    __pyx_t_2 = 0;
+
+0960:             result = "<%s at 0x%x%s" % (self.__class__.__name__, id(self), format)
+
+    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 960, __pyx_L5_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 960, __pyx_L5_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 960, __pyx_L5_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 960, __pyx_L5_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_GIVEREF(__pyx_t_3);
+    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
+    __Pyx_GIVEREF(__pyx_t_2);
+    PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
+    __Pyx_INCREF(__pyx_v_format);
+    __Pyx_GIVEREF(__pyx_v_format);
+    PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_format);
+    __pyx_t_3 = 0;
+    __pyx_t_2 = 0;
+    __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_s_at_0x_x_s, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 960, __pyx_L5_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __pyx_v_result = ((PyObject*)__pyx_t_2);
+    __pyx_t_2 = 0;
+
+0961:             if self.active:
+
+    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_active); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 961, __pyx_L5_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 961, __pyx_L5_error)
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    if (__pyx_t_1) {
+
+    }
+
+0962:                 result += " active"
+
+      __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_kp_s_active_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 962, __pyx_L5_error)
+      __Pyx_GOTREF(__pyx_t_2);
+      __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_2));
+      __pyx_t_2 = 0;
+
+0963:             if self.pending:
+
+    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_pending); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 963, __pyx_L5_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 963, __pyx_L5_error)
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    if (__pyx_t_1) {
+
+    }
+
+0964:                 result += " pending"
+
+      __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_kp_s_pending_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 964, __pyx_L5_error)
+      __Pyx_GOTREF(__pyx_t_2);
+      __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_2));
+      __pyx_t_2 = 0;
+
+0965:             if self.callback is not None:
+
+    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_callback); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 965, __pyx_L5_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_1 = (__pyx_t_2 != Py_None);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __pyx_t_5 = (__pyx_t_1 != 0);
+    if (__pyx_t_5) {
+
+    }
+
+0966:                 result += " callback=%r" % (self.callback, )
+
+      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_callback); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 966, __pyx_L5_error)
+      __Pyx_GOTREF(__pyx_t_2);
+      __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 966, __pyx_L5_error)
+      __Pyx_GOTREF(__pyx_t_4);
+      __Pyx_GIVEREF(__pyx_t_2);
+      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
+      __pyx_t_2 = 0;
+      __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_callback_r, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 966, __pyx_L5_error)
+      __Pyx_GOTREF(__pyx_t_2);
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 966, __pyx_L5_error)
+      __Pyx_GOTREF(__pyx_t_4);
+      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+      __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_4));
+      __pyx_t_4 = 0;
+
+0967:             if self.args is not None:
+
+    __pyx_t_5 = (__pyx_v_self->args != ((PyObject*)Py_None));
+    __pyx_t_1 = (__pyx_t_5 != 0);
+    if (__pyx_t_1) {
+
+    }
+
+0968:                 result += " args=%r" % (self.args, )
+
+      __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 968, __pyx_L5_error)
+      __Pyx_GOTREF(__pyx_t_4);
+      __Pyx_INCREF(__pyx_v_self->args);
+      __Pyx_GIVEREF(__pyx_v_self->args);
+      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_self->args);
+      __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_args_r, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 968, __pyx_L5_error)
+      __Pyx_GOTREF(__pyx_t_2);
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 968, __pyx_L5_error)
+      __Pyx_GOTREF(__pyx_t_4);
+      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+      __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_4));
+      __pyx_t_4 = 0;
+
+0969:             return result + ">"
+
+    __Pyx_XDECREF(__pyx_r);
+    __pyx_t_4 = PyNumber_Add(__pyx_v_result, __pyx_kp_s__6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 969, __pyx_L5_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    __pyx_r = __pyx_t_4;
+    __pyx_t_4 = 0;
+    goto __pyx_L4_return;
+  }
+
 0970:         finally:
+
+0971:             Py_ReprLeave(self)
+
+  /*finally:*/ {
+    __pyx_L5_error:;
+    /*exception exit:*/{
+      __Pyx_PyThreadState_declare
+      __Pyx_PyThreadState_assign
+      __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0;
+      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+      if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14);
+      if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11) < 0)) __Pyx_ErrFetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
+      __Pyx_XGOTREF(__pyx_t_9);
+      __Pyx_XGOTREF(__pyx_t_10);
+      __Pyx_XGOTREF(__pyx_t_11);
+      __Pyx_XGOTREF(__pyx_t_12);
+      __Pyx_XGOTREF(__pyx_t_13);
+      __Pyx_XGOTREF(__pyx_t_14);
+      __pyx_t_6 = __pyx_lineno; __pyx_t_7 = __pyx_clineno; __pyx_t_8 = __pyx_filename;
+      {
+        Py_ReprLeave(((PyObject *)__pyx_v_self));
+      }
+      if (PY_MAJOR_VERSION >= 3) {
+        __Pyx_XGIVEREF(__pyx_t_12);
+        __Pyx_XGIVEREF(__pyx_t_13);
+        __Pyx_XGIVEREF(__pyx_t_14);
+        __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14);
+      }
+      __Pyx_XGIVEREF(__pyx_t_9);
+      __Pyx_XGIVEREF(__pyx_t_10);
+      __Pyx_XGIVEREF(__pyx_t_11);
+      __Pyx_ErrRestore(__pyx_t_9, __pyx_t_10, __pyx_t_11);
+      __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0;
+      __pyx_lineno = __pyx_t_6; __pyx_clineno = __pyx_t_7; __pyx_filename = __pyx_t_8;
+      goto __pyx_L1_error;
+    }
+    __pyx_L4_return: {
+      __pyx_t_14 = __pyx_r;
+      __pyx_r = 0;
+      Py_ReprLeave(((PyObject *)__pyx_v_self));
+      __pyx_r = __pyx_t_14;
+      __pyx_t_14 = 0;
+      goto __pyx_L0;
+    }
+  }
+
 0972: 
+
+0973:     def _format(self):
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_11_format(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_11_format(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_format (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_7watcher_10_format(((struct PyGeventWatcherObject *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_7watcher_10_format(CYTHON_UNUSED struct PyGeventWatcherObject *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_format", 0);
+
+
+  /* function exit code */
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0974:         return ''
+
+  __Pyx_XDECREF(__pyx_r);
+  __Pyx_INCREF(__pyx_kp_s__7);
+  __pyx_r = __pyx_kp_s__7;
+  goto __pyx_L0;
+
 0975: 
+
+0976:     def close(self):
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_13close(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_13close(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("close (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_7watcher_12close(((struct PyGeventWatcherObject *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_7watcher_12close(struct PyGeventWatcherObject *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("close", 0);
+
+
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_AddTraceback("gevent.libev.corecext.watcher.close", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0977:         self.stop()
+
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_stop); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 977, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = NULL;
+  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+    if (likely(__pyx_t_3)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+      __Pyx_INCREF(__pyx_t_3);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_2, function);
+    }
+  }
+  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 977, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 0978: 
+
+0979:     def __enter__(self):
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_15__enter__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_15__enter__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__enter__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_7watcher_14__enter__(((struct PyGeventWatcherObject *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_7watcher_14__enter__(struct PyGeventWatcherObject *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__enter__", 0);
+
+
+  /* function exit code */
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0980:         return self
+
+  __Pyx_XDECREF(__pyx_r);
+  __Pyx_INCREF(((PyObject *)__pyx_v_self));
+  __pyx_r = ((PyObject *)__pyx_v_self);
+  goto __pyx_L0;
+
 0981: 
+
+0982:     def __exit__(self, t, v, tb):
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_17__exit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_7watcher_17__exit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  CYTHON_UNUSED PyObject *__pyx_v_t = 0;
+  CYTHON_UNUSED PyObject *__pyx_v_v = 0;
+  CYTHON_UNUSED PyObject *__pyx_v_tb = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__exit__ (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_t,&__pyx_n_s_v,&__pyx_n_s_tb,0};
+    PyObject* values[3] = {0,0,0};
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_v)) != 0)) kw_args--;
+        else {
+          __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, 1); __PYX_ERR(0, 982, __pyx_L3_error)
+        }
+        CYTHON_FALLTHROUGH;
+        case  2:
+        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tb)) != 0)) kw_args--;
+        else {
+          __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, 2); __PYX_ERR(0, 982, __pyx_L3_error)
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__exit__") < 0)) __PYX_ERR(0, 982, __pyx_L3_error)
+      }
+    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
+      goto __pyx_L5_argtuple_error;
+    } else {
+      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+    }
+    __pyx_v_t = values[0];
+    __pyx_v_v = values[1];
+    __pyx_v_tb = values[2];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 982, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.libev.corecext.watcher.__exit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_7watcher_16__exit__(((struct PyGeventWatcherObject *)__pyx_v_self), __pyx_v_t, __pyx_v_v, __pyx_v_tb);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_7watcher_16__exit__(struct PyGeventWatcherObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_t, CYTHON_UNUSED PyObject *__pyx_v_v, CYTHON_UNUSED PyObject *__pyx_v_tb) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__exit__", 0);
+
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_AddTraceback("gevent.libev.corecext.watcher.__exit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0983:         self.close()
+
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 983, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = NULL;
+  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+    if (likely(__pyx_t_3)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+      __Pyx_INCREF(__pyx_t_3);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_2, function);
+    }
+  }
+  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 983, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+0984:         return
+
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+
 0985: 
+
+0986: cdef start_and_stop io_ss = make_ss(<void*>libev.ev_io_start, <void*>libev.ev_io_stop)
+
+  __pyx_v_6gevent_5libev_8corecext_io_ss = __pyx_f_6gevent_5libev_8corecext_make_ss(((void *)ev_io_start), ((void *)ev_io_stop));
+
 0987: 
+
+0988: cdef public class io(watcher) [object PyGeventIOObject, type PyGeventIO_Type]:
+
+struct PyGeventIOObject {
+  struct PyGeventWatcherObject __pyx_base;
+  struct ev_io _watcher;
+};
+
+__PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyGeventIO_Type;
+
 0989: 
+
 0990:     cdef libev.ev_io _watcher
+
 0991: 
+
+0992:     def start(self, object callback, *args, pass_events=False):
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_2io_1start(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_2io_1start(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_callback = 0;
+  PyObject *__pyx_v_pass_events = 0;
+  PyObject *__pyx_v_args = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("start (wrapper)", 0);
+  if (PyTuple_GET_SIZE(__pyx_args) > 1) {
+    __pyx_v_args = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args));
+    if (unlikely(!__pyx_v_args)) {
+      __Pyx_RefNannyFinishContext();
+      return NULL;
+    }
+    __Pyx_GOTREF(__pyx_v_args);
+  } else {
+    __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple);
+  }
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_callback,&__pyx_n_s_pass_events,0};
+    PyObject* values[2] = {0,0};
+    values[1] = ((PyObject *)Py_False);
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        default:
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_callback)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+      }
+      if (kw_args == 1) {
+        const Py_ssize_t index = 1;
+        PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, *__pyx_pyargnames[index]);
+        if (value) { values[index] = value; kw_args--; }
+      }
+      if (unlikely(kw_args > 0)) {
+        const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1;
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "start") < 0)) __PYX_ERR(0, 992, __pyx_L3_error)
+      }
+    } else if (PyTuple_GET_SIZE(__pyx_args) < 1) {
+      goto __pyx_L5_argtuple_error;
+    } else {
+      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+    }
+    __pyx_v_callback = values[0];
+    __pyx_v_pass_events = values[1];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("start", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 992, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0;
+  __Pyx_AddTraceback("gevent.libev.corecext.io.start", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_2io_start(((struct PyGeventIOObject *)__pyx_v_self), __pyx_v_callback, __pyx_v_pass_events, __pyx_v_args);
+
+  /* function exit code */
+  __Pyx_XDECREF(__pyx_v_args);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_2io_start(struct PyGeventIOObject *__pyx_v_self, PyObject *__pyx_v_callback, PyObject *__pyx_v_pass_events, PyObject *__pyx_v_args) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("start", 0);
+  __Pyx_INCREF(__pyx_v_args);
+
+
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_AddTraceback("gevent.libev.corecext.io.start", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_args);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0993:         if pass_events:
+
+  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_pass_events); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 993, __pyx_L1_error)
+  if (__pyx_t_1) {
+
+  }
+
+0994:             args = (GEVENT_CORE_EVENTS, ) + args
+
+    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 994, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_INCREF(GEVENT_CORE_EVENTS);
+    __Pyx_GIVEREF(GEVENT_CORE_EVENTS);
+    PyTuple_SET_ITEM(__pyx_t_2, 0, GEVENT_CORE_EVENTS);
+    __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_v_args); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 994, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __Pyx_DECREF_SET(__pyx_v_args, ((PyObject*)__pyx_t_3));
+    __pyx_t_3 = 0;
+
+0995:         _watcher_start(self, callback, args)
+
+  __pyx_t_1 = __pyx_f_6gevent_5libev_8corecext__watcher_start(((struct PyGeventWatcherObject *)__pyx_v_self), __pyx_v_callback, __pyx_v_args); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 995, __pyx_L1_error)
+
 0996: 
+
+0997:     def __init__(self, loop loop, libev.vfd_socket_t fd, int events, ref=True, priority=None):
+
+
+/* Python wrapper */
+static int __pyx_pw_6gevent_5libev_8corecext_2io_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static int __pyx_pw_6gevent_5libev_8corecext_2io_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  struct PyGeventLoopObject *__pyx_v_loop = 0;
+  CYTHON_UNUSED vfd_socket_t __pyx_v_fd;
+  CYTHON_UNUSED int __pyx_v_events;
+  PyObject *__pyx_v_ref = 0;
+  PyObject *__pyx_v_priority = 0;
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_loop,&__pyx_n_s_fd,&__pyx_n_s_events_2,&__pyx_n_s_ref,&__pyx_n_s_priority,0};
+    PyObject* values[5] = {0,0,0,0,0};
+    values[3] = ((PyObject *)Py_True);
+    values[4] = ((PyObject *)Py_None);
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
+        CYTHON_FALLTHROUGH;
+        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
+        CYTHON_FALLTHROUGH;
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_loop)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_fd)) != 0)) kw_args--;
+        else {
+          __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 5, 1); __PYX_ERR(0, 997, __pyx_L3_error)
+        }
+        CYTHON_FALLTHROUGH;
+        case  2:
+        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_events_2)) != 0)) kw_args--;
+        else {
+          __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 5, 2); __PYX_ERR(0, 997, __pyx_L3_error)
+        }
+        CYTHON_FALLTHROUGH;
+        case  3:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ref);
+          if (value) { values[3] = value; kw_args--; }
+        }
+        CYTHON_FALLTHROUGH;
+        case  4:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_priority);
+          if (value) { values[4] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 997, __pyx_L3_error)
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
+        CYTHON_FALLTHROUGH;
+        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
+        CYTHON_FALLTHROUGH;
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    __pyx_v_loop = ((struct PyGeventLoopObject *)values[0]);
+    __pyx_v_fd = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_fd == ((vfd_socket_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 997, __pyx_L3_error)
+    __pyx_v_events = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_events == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 997, __pyx_L3_error)
+    __pyx_v_ref = values[3];
+    __pyx_v_priority = values[4];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 997, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.libev.corecext.io.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return -1;
+  __pyx_L4_argument_unpacking_done:;
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_loop), __pyx_ptype_6gevent_5libev_8corecext_loop, 1, "loop", 0))) __PYX_ERR(0, 997, __pyx_L1_error)
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_2io_2__init__(((struct PyGeventIOObject *)__pyx_v_self), __pyx_v_loop, __pyx_v_fd, __pyx_v_events, __pyx_v_ref, __pyx_v_priority);
+
+  /* function exit code */
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __pyx_r = -1;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_5libev_8corecext_2io_2__init__(struct PyGeventIOObject *__pyx_v_self, struct PyGeventLoopObject *__pyx_v_loop, CYTHON_UNUSED vfd_socket_t __pyx_v_fd, CYTHON_UNUSED int __pyx_v_events, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__", 0);
+
+
+  /* function exit code */
+  __pyx_r = 0;
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_AddTraceback("gevent.libev.corecext.io.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = -1;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+0998:         watcher.__init__(self, loop, ref, priority)
+
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_6gevent_5libev_8corecext_watcher), __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 998, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = NULL;
+  __pyx_t_4 = 0;
+  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+    if (likely(__pyx_t_3)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+      __Pyx_INCREF(__pyx_t_3);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_2, function);
+      __pyx_t_4 = 1;
+    }
+  }
+  #if CYTHON_FAST_PYCALL
+  if (PyFunction_Check(__pyx_t_2)) {
+    PyObject *__pyx_temp[5] = {__pyx_t_3, ((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_loop), __pyx_v_ref, __pyx_v_priority};
+    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 4+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 998, __pyx_L1_error)
+    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __Pyx_GOTREF(__pyx_t_1);
+  } else
+  #endif
+  #if CYTHON_FAST_PYCCALL
+  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
+    PyObject *__pyx_temp[5] = {__pyx_t_3, ((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_loop), __pyx_v_ref, __pyx_v_priority};
+    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 4+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 998, __pyx_L1_error)
+    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __Pyx_GOTREF(__pyx_t_1);
+  } else
+  #endif
+  {
+    __pyx_t_5 = PyTuple_New(4+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 998, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_5);
+    if (__pyx_t_3) {
+      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
+    }
+    __Pyx_INCREF(((PyObject *)__pyx_v_self));
+    __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
+    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, ((PyObject *)__pyx_v_self));
+    __Pyx_INCREF(((PyObject *)__pyx_v_loop));
+    __Pyx_GIVEREF(((PyObject *)__pyx_v_loop));
+    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, ((PyObject *)__pyx_v_loop));
+    __Pyx_INCREF(__pyx_v_ref);
+    __Pyx_GIVEREF(__pyx_v_ref);
+    PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_4, __pyx_v_ref);
+    __Pyx_INCREF(__pyx_v_priority);
+    __Pyx_GIVEREF(__pyx_v_priority);
+    PyTuple_SET_ITEM(__pyx_t_5, 3+__pyx_t_4, __pyx_v_priority);
+    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 998, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+  }
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 0999: 
+
+1000:     def __cinit__(self, loop loop, libev.vfd_socket_t fd, int events, ref=True, priority=None):
+
+
+/* Python wrapper */
+static int __pyx_pw_6gevent_5libev_8corecext_2io_5__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static int __pyx_pw_6gevent_5libev_8corecext_2io_5__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_loop = 0;
+  vfd_socket_t __pyx_v_fd;
+  int __pyx_v_events;
+  CYTHON_UNUSED PyObject *__pyx_v_ref = 0;
+  CYTHON_UNUSED PyObject *__pyx_v_priority = 0;
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_loop,&__pyx_n_s_fd,&__pyx_n_s_events_2,&__pyx_n_s_ref,&__pyx_n_s_priority,0};
+    PyObject* values[5] = {0,0,0,0,0};
+    values[3] = ((PyObject *)Py_True);
+    values[4] = ((PyObject *)Py_None);
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
+        CYTHON_FALLTHROUGH;
+        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
+        CYTHON_FALLTHROUGH;
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_loop)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_fd)) != 0)) kw_args--;
+        else {
+          __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 1); __PYX_ERR(0, 1000, __pyx_L3_error)
+        }
+        CYTHON_FALLTHROUGH;
+        case  2:
+        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_events_2)) != 0)) kw_args--;
+        else {
+          __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 2); __PYX_ERR(0, 1000, __pyx_L3_error)
+        }
+        CYTHON_FALLTHROUGH;
+        case  3:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ref);
+          if (value) { values[3] = value; kw_args--; }
+        }
+        CYTHON_FALLTHROUGH;
+        case  4:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_priority);
+          if (value) { values[4] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 1000, __pyx_L3_error)
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
+        CYTHON_FALLTHROUGH;
+        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
+        CYTHON_FALLTHROUGH;
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    __pyx_v_loop = ((struct PyGeventLoopObject *)values[0]);
+    __pyx_v_fd = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_fd == ((vfd_socket_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1000, __pyx_L3_error)
+    __pyx_v_events = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_events == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1000, __pyx_L3_error)
+    __pyx_v_ref = values[3];
+    __pyx_v_priority = values[4];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1000, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.libev.corecext.io.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return -1;
+  __pyx_L4_argument_unpacking_done:;
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_loop), __pyx_ptype_6gevent_5libev_8corecext_loop, 1, "loop", 0))) __PYX_ERR(0, 1000, __pyx_L1_error)
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_2io_4__cinit__(((struct PyGeventIOObject *)__pyx_v_self), __pyx_v_loop, __pyx_v_fd, __pyx_v_events, __pyx_v_ref, __pyx_v_priority);
+
+  /* function exit code */
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __pyx_r = -1;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_5libev_8corecext_2io_4__cinit__(struct PyGeventIOObject *__pyx_v_self, CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_loop, vfd_socket_t __pyx_v_fd, int __pyx_v_events, CYTHON_UNUSED PyObject *__pyx_v_ref, CYTHON_UNUSED PyObject *__pyx_v_priority) {
+  int __pyx_v_vfd;
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__cinit__", 0);
+
+
+  /* function exit code */
+  __pyx_r = 0;
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_AddTraceback("gevent.libev.corecext.io.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = -1;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+1001:         if fd < 0:
+
+  __pyx_t_1 = ((__pyx_v_fd < 0) != 0);
+  if (unlikely(__pyx_t_1)) {
+
+  }
+
+1002:             raise ValueError('fd must be non-negative: %r' % fd)
+
+    __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_fd); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1002, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_fd_must_be_non_negative_r, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1002, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1002, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __PYX_ERR(0, 1002, __pyx_L1_error)
+
+1003:         if events & ~(libev.EV__IOFDSET | libev.EV_READ | libev.EV_WRITE):
+
+  __pyx_t_1 = ((__pyx_v_events & (~((EV__IOFDSET | EV_READ) | EV_WRITE))) != 0);
+  if (unlikely(__pyx_t_1)) {
+
+  }
+
+1004:             raise ValueError('illegal event mask: %r' % events)
+
+    __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_events); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1004, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_illegal_event_mask_r, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1004, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1004, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __PYX_ERR(0, 1004, __pyx_L1_error)
+
 1005:         # All the vfd_functions are no-ops on POSIX
+
+1006:         cdef int vfd = libev.vfd_open(fd)
+
+  __pyx_t_4 = vfd_open(__pyx_v_fd); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 1006, __pyx_L1_error)
+  __pyx_v_vfd = __pyx_t_4;
+
+1007:         libev.ev_io_init(&self._watcher, <void *>gevent_callback_io, vfd, events)
+
+  ev_io_init((&__pyx_v_self->_watcher), ((void *)gevent_callback_io), __pyx_v_vfd, __pyx_v_events);
+
+1008:         self.__watcher = <libev.ev_watcher*>&self._watcher
+
+  __pyx_v_self->__pyx_base.__pyx___watcher = ((struct ev_watcher *)(&__pyx_v_self->_watcher));
+
+1009:         self.__ss = &io_ss
+
+  __pyx_v_self->__pyx_base.__pyx___ss = (&__pyx_v_6gevent_5libev_8corecext_io_ss);
+
 1010: 
+
+1011:     def __dealloc__(self):
+
+
+/* Python wrapper */
+static void __pyx_pw_6gevent_5libev_8corecext_2io_7__dealloc__(PyObject *__pyx_v_self); /*proto*/
+static void __pyx_pw_6gevent_5libev_8corecext_2io_7__dealloc__(PyObject *__pyx_v_self) {
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
+  __pyx_pf_6gevent_5libev_8corecext_2io_6__dealloc__(((struct PyGeventIOObject *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+}
+
+static void __pyx_pf_6gevent_5libev_8corecext_2io_6__dealloc__(struct PyGeventIOObject *__pyx_v_self) {
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__dealloc__", 0);
+
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+}
+
+1012:         libev.vfd_free(self._watcher.fd)
+
+  vfd_free(__pyx_v_self->_watcher.fd);
+
 1013: 
+
 1014:     @property
+
+1015:     def fd(self):
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_2io_2fd_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_2io_2fd_1__get__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_2io_2fd___get__(((struct PyGeventIOObject *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_2io_2fd___get__(struct PyGeventIOObject *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__", 0);
+
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.libev.corecext.io.fd.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+1016:         return libev.vfd_get(self._watcher.fd)
+
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = PyInt_FromSsize_t(vfd_get(__pyx_v_self->_watcher.fd)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1016, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
 1017: 
+
 1018:     @fd.setter
+
+1019:     def fd(self, long fd):
+
+
+/* Python wrapper */
+static int __pyx_pw_6gevent_5libev_8corecext_2io_2fd_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_fd); /*proto*/
+static int __pyx_pw_6gevent_5libev_8corecext_2io_2fd_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_fd) {
+  long __pyx_v_fd;
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
+  assert(__pyx_arg_fd); {
+    __pyx_v_fd = __Pyx_PyInt_As_long(__pyx_arg_fd); if (unlikely((__pyx_v_fd == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 1019, __pyx_L3_error)
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.libev.corecext.io.fd.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return -1;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_2io_2fd_2__set__(((struct PyGeventIOObject *)__pyx_v_self), ((long)__pyx_v_fd));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_5libev_8corecext_2io_2fd_2__set__(struct PyGeventIOObject *__pyx_v_self, long __pyx_v_fd) {
+  int __pyx_v_vfd;
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__set__", 0);
+
+
+  /* function exit code */
+  __pyx_r = 0;
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_AddTraceback("gevent.libev.corecext.io.fd.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = -1;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+1020:         if libev.ev_is_active(&self._watcher):
+
+  __pyx_t_1 = (ev_is_active((&__pyx_v_self->_watcher)) != 0);
+  if (unlikely(__pyx_t_1)) {
+
+  }
+
+1021:             raise AttributeError("'io' watcher attribute 'fd' is read-only while watcher is active")
+
+    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_AttributeError, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1021, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __PYX_ERR(0, 1021, __pyx_L1_error)
+
+  __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_s_io_watcher_attribute_fd_is_read); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(0, 1021, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__14);
+  __Pyx_GIVEREF(__pyx_tuple__14);
+
+1022:         cdef int vfd = libev.vfd_open(fd)
+
+  __pyx_t_3 = vfd_open(__pyx_v_fd); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 1022, __pyx_L1_error)
+  __pyx_v_vfd = __pyx_t_3;
+
+1023:         libev.vfd_free(self._watcher.fd)
+
+  vfd_free(__pyx_v_self->_watcher.fd);
+
+1024:         libev.ev_io_init(&self._watcher, <void *>gevent_callback_io, vfd, self._watcher.events)
+
+  ev_io_init((&__pyx_v_self->_watcher), ((void *)gevent_callback_io), __pyx_v_vfd, __pyx_v_self->_watcher.events);
+
 1025: 
+
 1026:     @property
+
+1027:     def events(self):
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_2io_6events_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_2io_6events_1__get__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_2io_6events___get__(((struct PyGeventIOObject *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_2io_6events___get__(struct PyGeventIOObject *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__", 0);
+
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.libev.corecext.io.events.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+1028:         return self._watcher.events
+
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->_watcher.events); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1028, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
 1029: 
+
 1030:     @events.setter
+
+1031:     def events(self, int events):
+
+
+/* Python wrapper */
+static int __pyx_pw_6gevent_5libev_8corecext_2io_6events_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_events); /*proto*/
+static int __pyx_pw_6gevent_5libev_8corecext_2io_6events_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_events) {
+  int __pyx_v_events;
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
+  assert(__pyx_arg_events); {
+    __pyx_v_events = __Pyx_PyInt_As_int(__pyx_arg_events); if (unlikely((__pyx_v_events == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1031, __pyx_L3_error)
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.libev.corecext.io.events.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return -1;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_2io_6events_2__set__(((struct PyGeventIOObject *)__pyx_v_self), ((int)__pyx_v_events));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_5libev_8corecext_2io_6events_2__set__(struct PyGeventIOObject *__pyx_v_self, int __pyx_v_events) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__set__", 0);
+
+
+  /* function exit code */
+  __pyx_r = 0;
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_AddTraceback("gevent.libev.corecext.io.events.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = -1;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+1032:         if libev.ev_is_active(&self._watcher):
+
+  __pyx_t_1 = (ev_is_active((&__pyx_v_self->_watcher)) != 0);
+  if (unlikely(__pyx_t_1)) {
+
+  }
+
+1033:             raise AttributeError("'io' watcher attribute 'events' is read-only while watcher is active")
+
+    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_AttributeError, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1033, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __PYX_ERR(0, 1033, __pyx_L1_error)
+
+  __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_io_watcher_attribute_events_is); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(0, 1033, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__15);
+  __Pyx_GIVEREF(__pyx_tuple__15);
+
+1034:         libev.ev_io_init(&self._watcher, <void *>gevent_callback_io, self._watcher.fd, events)
+
+  ev_io_init((&__pyx_v_self->_watcher), ((void *)gevent_callback_io), __pyx_v_self->_watcher.fd, __pyx_v_events);
+
 1035: 
+
 1036:     @property
+
+1037:     def events_str(self):
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_2io_10events_str_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_2io_10events_str_1__get__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_2io_10events_str___get__(((struct PyGeventIOObject *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_2io_10events_str___get__(struct PyGeventIOObject *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__", 0);
+
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.libev.corecext.io.events_str.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+1038:         return _events_to_str(self._watcher.events)
+
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __pyx_f_6gevent_5libev_8corecext__events_to_str(__pyx_v_self->_watcher.events, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1038, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
 1039: 
+
+1040:     def _format(self):
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_2io_9_format(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_2io_9_format(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_format (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_2io_8_format(((struct PyGeventIOObject *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_2io_8_format(struct PyGeventIOObject *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_format", 0);
+
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_AddTraceback("gevent.libev.corecext.io._format", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+1041:         return ' fd=%s events=%s' % (self.fd, self.events_str)
+
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_fd); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1041, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_events_str); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1041, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1041, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_GIVEREF(__pyx_t_1);
+  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_2);
+  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
+  __pyx_t_1 = 0;
+  __pyx_t_2 = 0;
+  __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_fd_s_events_s, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1041, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __pyx_r = __pyx_t_2;
+  __pyx_t_2 = 0;
+  goto __pyx_L0;
+
 1042: 
+
+1043: cdef start_and_stop timer_ss = make_ss(<void*>libev.ev_timer_start, <void*>libev.ev_timer_stop)
+
+  __pyx_v_6gevent_5libev_8corecext_timer_ss = __pyx_f_6gevent_5libev_8corecext_make_ss(((void *)ev_timer_start), ((void *)ev_timer_stop));
+
 1044: 
+
+1045: cdef public class timer(watcher) [object PyGeventTimerObject, type PyGeventTimer_Type]:
+
+struct PyGeventTimerObject {
+  struct PyGeventWatcherObject __pyx_base;
+  struct ev_timer _watcher;
+};
+
+__PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyGeventTimer_Type;
+
 1046: 
+
 1047:     cdef libev.ev_timer _watcher
+
 1048: 
+
+1049:     def __cinit__(self, loop loop, double after=0.0, double repeat=0.0, ref=True, priority=None):
+
+
+/* Python wrapper */
+static int __pyx_pw_6gevent_5libev_8corecext_5timer_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static int __pyx_pw_6gevent_5libev_8corecext_5timer_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_loop = 0;
+  double __pyx_v_after;
+  double __pyx_v_repeat;
+  CYTHON_UNUSED PyObject *__pyx_v_ref = 0;
+  CYTHON_UNUSED PyObject *__pyx_v_priority = 0;
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_loop,&__pyx_n_s_after,&__pyx_n_s_repeat,&__pyx_n_s_ref,&__pyx_n_s_priority,0};
+    PyObject* values[5] = {0,0,0,0,0};
+    values[3] = ((PyObject *)Py_True);
+    values[4] = ((PyObject *)Py_None);
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
+        CYTHON_FALLTHROUGH;
+        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
+        CYTHON_FALLTHROUGH;
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_loop)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_after);
+          if (value) { values[1] = value; kw_args--; }
+        }
+        CYTHON_FALLTHROUGH;
+        case  2:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_repeat);
+          if (value) { values[2] = value; kw_args--; }
+        }
+        CYTHON_FALLTHROUGH;
+        case  3:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ref);
+          if (value) { values[3] = value; kw_args--; }
+        }
+        CYTHON_FALLTHROUGH;
+        case  4:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_priority);
+          if (value) { values[4] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 1049, __pyx_L3_error)
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
+        CYTHON_FALLTHROUGH;
+        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
+        CYTHON_FALLTHROUGH;
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    __pyx_v_loop = ((struct PyGeventLoopObject *)values[0]);
+    if (values[1]) {
+      __pyx_v_after = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_after == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1049, __pyx_L3_error)
+    } else {
+      __pyx_v_after = ((double)0.0);
+    }
+    if (values[2]) {
+      __pyx_v_repeat = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_repeat == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1049, __pyx_L3_error)
+    } else {
+      __pyx_v_repeat = ((double)0.0);
+    }
+    __pyx_v_ref = values[3];
+    __pyx_v_priority = values[4];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1049, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.libev.corecext.timer.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return -1;
+  __pyx_L4_argument_unpacking_done:;
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_loop), __pyx_ptype_6gevent_5libev_8corecext_loop, 1, "loop", 0))) __PYX_ERR(0, 1049, __pyx_L1_error)
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_5timer___cinit__(((struct PyGeventTimerObject *)__pyx_v_self), __pyx_v_loop, __pyx_v_after, __pyx_v_repeat, __pyx_v_ref, __pyx_v_priority);
+
+  /* function exit code */
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __pyx_r = -1;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_5libev_8corecext_5timer___cinit__(struct PyGeventTimerObject *__pyx_v_self, CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_loop, double __pyx_v_after, double __pyx_v_repeat, CYTHON_UNUSED PyObject *__pyx_v_ref, CYTHON_UNUSED PyObject *__pyx_v_priority) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__cinit__", 0);
+
+
+  /* function exit code */
+  __pyx_r = 0;
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_AddTraceback("gevent.libev.corecext.timer.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = -1;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+1050:         if repeat < 0.0:
+
+  __pyx_t_1 = ((__pyx_v_repeat < 0.0) != 0);
+  if (unlikely(__pyx_t_1)) {
+
+  }
+
+1051:             raise ValueError("repeat must be positive or zero: %r" % repeat)
+
+    __pyx_t_2 = PyFloat_FromDouble(__pyx_v_repeat); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1051, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_repeat_must_be_positive_or_zero, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1051, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1051, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __PYX_ERR(0, 1051, __pyx_L1_error)
+
+1052:         libev.ev_timer_init(&self._watcher, <void *>gevent_callback_timer, after, repeat)
+
+  ev_timer_init((&__pyx_v_self->_watcher), ((void *)gevent_callback_timer), __pyx_v_after, __pyx_v_repeat);
+
+1053:         self.__watcher = <libev.ev_watcher*>&self._watcher
+
+  __pyx_v_self->__pyx_base.__pyx___watcher = ((struct ev_watcher *)(&__pyx_v_self->_watcher));
+
+1054:         self.__ss = &timer_ss
+
+  __pyx_v_self->__pyx_base.__pyx___ss = (&__pyx_v_6gevent_5libev_8corecext_timer_ss);
+
 1055: 
+
+1056:     def __init__(self, loop loop, double after=0.0, double repeat=0.0, ref=True, priority=None):
+
+
+/* Python wrapper */
+static int __pyx_pw_6gevent_5libev_8corecext_5timer_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static int __pyx_pw_6gevent_5libev_8corecext_5timer_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  struct PyGeventLoopObject *__pyx_v_loop = 0;
+  CYTHON_UNUSED double __pyx_v_after;
+  CYTHON_UNUSED double __pyx_v_repeat;
+  PyObject *__pyx_v_ref = 0;
+  PyObject *__pyx_v_priority = 0;
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_loop,&__pyx_n_s_after,&__pyx_n_s_repeat,&__pyx_n_s_ref,&__pyx_n_s_priority,0};
+    PyObject* values[5] = {0,0,0,0,0};
+    values[3] = ((PyObject *)Py_True);
+    values[4] = ((PyObject *)Py_None);
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
+        CYTHON_FALLTHROUGH;
+        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
+        CYTHON_FALLTHROUGH;
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_loop)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_after);
+          if (value) { values[1] = value; kw_args--; }
+        }
+        CYTHON_FALLTHROUGH;
+        case  2:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_repeat);
+          if (value) { values[2] = value; kw_args--; }
+        }
+        CYTHON_FALLTHROUGH;
+        case  3:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ref);
+          if (value) { values[3] = value; kw_args--; }
+        }
+        CYTHON_FALLTHROUGH;
+        case  4:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_priority);
+          if (value) { values[4] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 1056, __pyx_L3_error)
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
+        CYTHON_FALLTHROUGH;
+        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
+        CYTHON_FALLTHROUGH;
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    __pyx_v_loop = ((struct PyGeventLoopObject *)values[0]);
+    if (values[1]) {
+      __pyx_v_after = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_after == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1056, __pyx_L3_error)
+    } else {
+      __pyx_v_after = ((double)0.0);
+    }
+    if (values[2]) {
+      __pyx_v_repeat = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_repeat == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1056, __pyx_L3_error)
+    } else {
+      __pyx_v_repeat = ((double)0.0);
+    }
+    __pyx_v_ref = values[3];
+    __pyx_v_priority = values[4];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1056, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.libev.corecext.timer.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return -1;
+  __pyx_L4_argument_unpacking_done:;
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_loop), __pyx_ptype_6gevent_5libev_8corecext_loop, 1, "loop", 0))) __PYX_ERR(0, 1056, __pyx_L1_error)
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_5timer_2__init__(((struct PyGeventTimerObject *)__pyx_v_self), __pyx_v_loop, __pyx_v_after, __pyx_v_repeat, __pyx_v_ref, __pyx_v_priority);
+
+  /* function exit code */
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __pyx_r = -1;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_5libev_8corecext_5timer_2__init__(struct PyGeventTimerObject *__pyx_v_self, struct PyGeventLoopObject *__pyx_v_loop, CYTHON_UNUSED double __pyx_v_after, CYTHON_UNUSED double __pyx_v_repeat, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__", 0);
+
+
+  /* function exit code */
+  __pyx_r = 0;
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_AddTraceback("gevent.libev.corecext.timer.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = -1;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+1057:         watcher.__init__(self, loop, ref, priority)
+
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_6gevent_5libev_8corecext_watcher), __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1057, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = NULL;
+  __pyx_t_4 = 0;
+  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+    if (likely(__pyx_t_3)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+      __Pyx_INCREF(__pyx_t_3);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_2, function);
+      __pyx_t_4 = 1;
+    }
+  }
+  #if CYTHON_FAST_PYCALL
+  if (PyFunction_Check(__pyx_t_2)) {
+    PyObject *__pyx_temp[5] = {__pyx_t_3, ((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_loop), __pyx_v_ref, __pyx_v_priority};
+    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 4+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1057, __pyx_L1_error)
+    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __Pyx_GOTREF(__pyx_t_1);
+  } else
+  #endif
+  #if CYTHON_FAST_PYCCALL
+  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
+    PyObject *__pyx_temp[5] = {__pyx_t_3, ((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_loop), __pyx_v_ref, __pyx_v_priority};
+    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 4+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1057, __pyx_L1_error)
+    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __Pyx_GOTREF(__pyx_t_1);
+  } else
+  #endif
+  {
+    __pyx_t_5 = PyTuple_New(4+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1057, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_5);
+    if (__pyx_t_3) {
+      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
+    }
+    __Pyx_INCREF(((PyObject *)__pyx_v_self));
+    __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
+    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, ((PyObject *)__pyx_v_self));
+    __Pyx_INCREF(((PyObject *)__pyx_v_loop));
+    __Pyx_GIVEREF(((PyObject *)__pyx_v_loop));
+    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, ((PyObject *)__pyx_v_loop));
+    __Pyx_INCREF(__pyx_v_ref);
+    __Pyx_GIVEREF(__pyx_v_ref);
+    PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_4, __pyx_v_ref);
+    __Pyx_INCREF(__pyx_v_priority);
+    __Pyx_GIVEREF(__pyx_v_priority);
+    PyTuple_SET_ITEM(__pyx_t_5, 3+__pyx_t_4, __pyx_v_priority);
+    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1057, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+  }
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 1058: 
+
+1059:     def start(self, object callback, *args, update=None):
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_5timer_5start(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_5timer_5start(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_callback = 0;
+  PyObject *__pyx_v_update = 0;
+  PyObject *__pyx_v_args = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("start (wrapper)", 0);
+  if (PyTuple_GET_SIZE(__pyx_args) > 1) {
+    __pyx_v_args = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args));
+    if (unlikely(!__pyx_v_args)) {
+      __Pyx_RefNannyFinishContext();
+      return NULL;
+    }
+    __Pyx_GOTREF(__pyx_v_args);
+  } else {
+    __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple);
+  }
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_callback,&__pyx_n_s_update,0};
+    PyObject* values[2] = {0,0};
+    values[1] = ((PyObject *)Py_None);
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        default:
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_callback)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+      }
+      if (kw_args == 1) {
+        const Py_ssize_t index = 1;
+        PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, *__pyx_pyargnames[index]);
+        if (value) { values[index] = value; kw_args--; }
+      }
+      if (unlikely(kw_args > 0)) {
+        const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1;
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "start") < 0)) __PYX_ERR(0, 1059, __pyx_L3_error)
+      }
+    } else if (PyTuple_GET_SIZE(__pyx_args) < 1) {
+      goto __pyx_L5_argtuple_error;
+    } else {
+      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+    }
+    __pyx_v_callback = values[0];
+    __pyx_v_update = values[1];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("start", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1059, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0;
+  __Pyx_AddTraceback("gevent.libev.corecext.timer.start", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_5timer_4start(((struct PyGeventTimerObject *)__pyx_v_self), __pyx_v_callback, __pyx_v_update, __pyx_v_args);
+
+  /* function exit code */
+  __Pyx_XDECREF(__pyx_v_args);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_5timer_4start(struct PyGeventTimerObject *__pyx_v_self, PyObject *__pyx_v_callback, PyObject *__pyx_v_update, PyObject *__pyx_v_args) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("start", 0);
+  __Pyx_INCREF(__pyx_v_update);
+
+
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_AddTraceback("gevent.libev.corecext.timer.start", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_update);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+1060:         update = update if update is not None else self.loop.starting_timer_may_update_loop_time
+
+  __pyx_t_2 = (__pyx_v_update != Py_None);
+  if ((__pyx_t_2 != 0)) {
+    __Pyx_INCREF(__pyx_v_update);
+    __pyx_t_1 = __pyx_v_update;
+  } else {
+    __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_v_self->__pyx_base.loop->starting_timer_may_update_loop_time); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1060, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __pyx_t_1 = __pyx_t_3;
+    __pyx_t_3 = 0;
+  }
+  __Pyx_DECREF_SET(__pyx_v_update, __pyx_t_1);
+  __pyx_t_1 = 0;
+
+1061:         if update:
+
+  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_update); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1061, __pyx_L1_error)
+  if (__pyx_t_2) {
+
+  }
+
+1062:             self.loop.update_now()
+
+    ((struct __pyx_vtabstruct_6gevent_5libev_8corecext_loop *)__pyx_v_self->__pyx_base.loop->__pyx_vtab)->update_now(__pyx_v_self->__pyx_base.loop, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1062, __pyx_L1_error)
+
+1063:         _watcher_start(self, callback, args)
+
+  __pyx_t_2 = __pyx_f_6gevent_5libev_8corecext__watcher_start(((struct PyGeventWatcherObject *)__pyx_v_self), __pyx_v_callback, __pyx_v_args); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 1063, __pyx_L1_error)
+
 1064: 
+
 1065:     @property
+
+1066:     def at(self):
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_5timer_2at_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_5timer_2at_1__get__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_5timer_2at___get__(((struct PyGeventTimerObject *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_5timer_2at___get__(struct PyGeventTimerObject *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__", 0);
+
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.libev.corecext.timer.at.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+1067:         return self._watcher.at
+
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->_watcher.at); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1067, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
 1068: 
+
 1069:     # QQQ: add 'after' and 'repeat' properties?
+
 1070: 
+
+1071:     def again(self, object callback, *args, update=True):
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_5timer_7again(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_5timer_7again(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_callback = 0;
+  PyObject *__pyx_v_update = 0;
+  PyObject *__pyx_v_args = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("again (wrapper)", 0);
+  if (PyTuple_GET_SIZE(__pyx_args) > 1) {
+    __pyx_v_args = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args));
+    if (unlikely(!__pyx_v_args)) {
+      __Pyx_RefNannyFinishContext();
+      return NULL;
+    }
+    __Pyx_GOTREF(__pyx_v_args);
+  } else {
+    __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple);
+  }
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_callback,&__pyx_n_s_update,0};
+    PyObject* values[2] = {0,0};
+    values[1] = ((PyObject *)Py_True);
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        default:
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_callback)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+      }
+      if (kw_args == 1) {
+        const Py_ssize_t index = 1;
+        PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, *__pyx_pyargnames[index]);
+        if (value) { values[index] = value; kw_args--; }
+      }
+      if (unlikely(kw_args > 0)) {
+        const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1;
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "again") < 0)) __PYX_ERR(0, 1071, __pyx_L3_error)
+      }
+    } else if (PyTuple_GET_SIZE(__pyx_args) < 1) {
+      goto __pyx_L5_argtuple_error;
+    } else {
+      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+    }
+    __pyx_v_callback = values[0];
+    __pyx_v_update = values[1];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("again", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1071, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0;
+  __Pyx_AddTraceback("gevent.libev.corecext.timer.again", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_5timer_6again(((struct PyGeventTimerObject *)__pyx_v_self), __pyx_v_callback, __pyx_v_update, __pyx_v_args);
+
+  /* function exit code */
+  __Pyx_XDECREF(__pyx_v_args);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_5timer_6again(struct PyGeventTimerObject *__pyx_v_self, PyObject *__pyx_v_callback, PyObject *__pyx_v_update, PyObject *__pyx_v_args) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("again", 0);
+
+
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.libev.corecext.timer.again", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+1072:         _check_loop(self.loop)
+
+  __pyx_t_1 = ((PyObject *)__pyx_v_self->__pyx_base.loop);
+  __Pyx_INCREF(__pyx_t_1);
+  __pyx_t_2 = __pyx_f_6gevent_5libev_8corecext__check_loop(((struct PyGeventLoopObject *)__pyx_t_1)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 1072, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+1073:         self.callback = callback
+
+  if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_callback, __pyx_v_callback) < 0) __PYX_ERR(0, 1073, __pyx_L1_error)
+
+1074:         self.args = args
+
+  __Pyx_INCREF(__pyx_v_args);
+  __Pyx_GIVEREF(__pyx_v_args);
+  __Pyx_GOTREF(__pyx_v_self->__pyx_base.args);
+  __Pyx_DECREF(__pyx_v_self->__pyx_base.args);
+  __pyx_v_self->__pyx_base.args = __pyx_v_args;
+
+1075:         _libev_unref(self)
+
+  __pyx_f_6gevent_5libev_8corecext__libev_unref(((struct PyGeventWatcherObject *)__pyx_v_self));
+
+1076:         if update:
+
+  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_update); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1076, __pyx_L1_error)
+  if (__pyx_t_2) {
+
+  }
+
+1077:             libev.ev_now_update(self.loop._ptr)
+
+    ev_now_update(__pyx_v_self->__pyx_base.loop->_ptr);
+
+1078:         libev.ev_timer_again(self.loop._ptr, &self._watcher)
+
+  ev_timer_again(__pyx_v_self->__pyx_base.loop->_ptr, (&__pyx_v_self->_watcher));
+
+1079:         _python_incref(self)
+
+  __pyx_f_6gevent_5libev_8corecext__python_incref(((struct PyGeventWatcherObject *)__pyx_v_self));
+
 1080: 
+
 1081: 
+
 1082: 
+
+1083: cdef start_and_stop signal_ss = make_ss(<void*>libev.ev_signal_start, <void*>libev.ev_signal_stop)
+
+  __pyx_v_6gevent_5libev_8corecext_signal_ss = __pyx_f_6gevent_5libev_8corecext_make_ss(((void *)ev_signal_start), ((void *)ev_signal_stop));
+
 1084: 
+
+1085: cdef public class signal(watcher) [object PyGeventSignalObject, type PyGeventSignal_Type]:
+
+struct PyGeventSignalObject {
+  struct PyGeventWatcherObject __pyx_base;
+  struct ev_signal _watcher;
+};
+
+__PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyGeventSignal_Type;
+
 1086: 
+
 1087:     cdef libev.ev_signal _watcher
+
 1088: 
+
+1089:     def __cinit__(self, loop loop, int signalnum, ref=True, priority=None):
+
+
+/* Python wrapper */
+static int __pyx_pw_6gevent_5libev_8corecext_6signal_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static int __pyx_pw_6gevent_5libev_8corecext_6signal_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_loop = 0;
+  int __pyx_v_signalnum;
+  CYTHON_UNUSED PyObject *__pyx_v_ref = 0;
+  CYTHON_UNUSED PyObject *__pyx_v_priority = 0;
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_loop,&__pyx_n_s_signalnum,&__pyx_n_s_ref,&__pyx_n_s_priority,0};
+    PyObject* values[4] = {0,0,0,0};
+    values[2] = ((PyObject *)Py_True);
+    values[3] = ((PyObject *)Py_None);
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
+        CYTHON_FALLTHROUGH;
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_loop)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_signalnum)) != 0)) kw_args--;
+        else {
+          __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 4, 1); __PYX_ERR(0, 1089, __pyx_L3_error)
+        }
+        CYTHON_FALLTHROUGH;
+        case  2:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ref);
+          if (value) { values[2] = value; kw_args--; }
+        }
+        CYTHON_FALLTHROUGH;
+        case  3:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_priority);
+          if (value) { values[3] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 1089, __pyx_L3_error)
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
+        CYTHON_FALLTHROUGH;
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    __pyx_v_loop = ((struct PyGeventLoopObject *)values[0]);
+    __pyx_v_signalnum = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_signalnum == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1089, __pyx_L3_error)
+    __pyx_v_ref = values[2];
+    __pyx_v_priority = values[3];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1089, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.libev.corecext.signal.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return -1;
+  __pyx_L4_argument_unpacking_done:;
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_loop), __pyx_ptype_6gevent_5libev_8corecext_loop, 1, "loop", 0))) __PYX_ERR(0, 1089, __pyx_L1_error)
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_6signal___cinit__(((struct PyGeventSignalObject *)__pyx_v_self), __pyx_v_loop, __pyx_v_signalnum, __pyx_v_ref, __pyx_v_priority);
+
+  /* function exit code */
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __pyx_r = -1;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_5libev_8corecext_6signal___cinit__(struct PyGeventSignalObject *__pyx_v_self, CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_loop, int __pyx_v_signalnum, CYTHON_UNUSED PyObject *__pyx_v_ref, CYTHON_UNUSED PyObject *__pyx_v_priority) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__cinit__", 0);
+
+
+  /* function exit code */
+  __pyx_r = 0;
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_AddTraceback("gevent.libev.corecext.signal.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = -1;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+1090:         if signalnum < 1 or signalnum >= signalmodule.NSIG:
+
+  __pyx_t_2 = ((__pyx_v_signalnum < 1) != 0);
+  if (!__pyx_t_2) {
+  } else {
+    __pyx_t_1 = __pyx_t_2;
+    goto __pyx_L4_bool_binop_done;
+  }
+  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_signalnum); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1090, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_signalmodule); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1090, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_4);
+  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_NSIG); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1090, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_5);
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_t_5, Py_GE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1090, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1090, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __pyx_t_1 = __pyx_t_2;
+  __pyx_L4_bool_binop_done:;
+  if (unlikely(__pyx_t_1)) {
+
+  }
+
+1091:             raise ValueError('illegal signal number: %r' % signalnum)
+
+    __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_signalnum); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1091, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_illegal_signal_number_r, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1091, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_5);
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1091, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __PYX_ERR(0, 1091, __pyx_L1_error)
+
 1092:         # still possible to crash on one of libev's asserts:
+
 1093:         # 1) "libev: ev_signal_start called with illegal signal number"
+
 1094:         #    EV_NSIG might be different from signal.NSIG on some platforms
+
 1095:         # 2) "libev: a signal must not be attached to two different loops"
+
 1096:         #    we probably could check that in LIBEV_EMBED mode, but not in general
+
+1097:         libev.ev_signal_init(&self._watcher, <void *>gevent_callback_signal, signalnum)
+
+  ev_signal_init((&__pyx_v_self->_watcher), ((void *)gevent_callback_signal), __pyx_v_signalnum);
+
+1098:         self.__watcher = <libev.ev_watcher*>&self._watcher
+
+  __pyx_v_self->__pyx_base.__pyx___watcher = ((struct ev_watcher *)(&__pyx_v_self->_watcher));
+
+1099:         self.__ss = &signal_ss
+
+  __pyx_v_self->__pyx_base.__pyx___ss = (&__pyx_v_6gevent_5libev_8corecext_signal_ss);
+
 1100: 
+
+1101:     def __init__(self, loop loop, int signalnum, ref=True, priority=None):
+
+
+/* Python wrapper */
+static int __pyx_pw_6gevent_5libev_8corecext_6signal_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static int __pyx_pw_6gevent_5libev_8corecext_6signal_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  struct PyGeventLoopObject *__pyx_v_loop = 0;
+  CYTHON_UNUSED int __pyx_v_signalnum;
+  PyObject *__pyx_v_ref = 0;
+  PyObject *__pyx_v_priority = 0;
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_loop,&__pyx_n_s_signalnum,&__pyx_n_s_ref,&__pyx_n_s_priority,0};
+    PyObject* values[4] = {0,0,0,0};
+    values[2] = ((PyObject *)Py_True);
+    values[3] = ((PyObject *)Py_None);
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
+        CYTHON_FALLTHROUGH;
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_loop)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_signalnum)) != 0)) kw_args--;
+        else {
+          __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 4, 1); __PYX_ERR(0, 1101, __pyx_L3_error)
+        }
+        CYTHON_FALLTHROUGH;
+        case  2:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ref);
+          if (value) { values[2] = value; kw_args--; }
+        }
+        CYTHON_FALLTHROUGH;
+        case  3:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_priority);
+          if (value) { values[3] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 1101, __pyx_L3_error)
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
+        CYTHON_FALLTHROUGH;
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    __pyx_v_loop = ((struct PyGeventLoopObject *)values[0]);
+    __pyx_v_signalnum = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_signalnum == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1101, __pyx_L3_error)
+    __pyx_v_ref = values[2];
+    __pyx_v_priority = values[3];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1101, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.libev.corecext.signal.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return -1;
+  __pyx_L4_argument_unpacking_done:;
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_loop), __pyx_ptype_6gevent_5libev_8corecext_loop, 1, "loop", 0))) __PYX_ERR(0, 1101, __pyx_L1_error)
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_6signal_2__init__(((struct PyGeventSignalObject *)__pyx_v_self), __pyx_v_loop, __pyx_v_signalnum, __pyx_v_ref, __pyx_v_priority);
+
+  /* function exit code */
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __pyx_r = -1;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_5libev_8corecext_6signal_2__init__(struct PyGeventSignalObject *__pyx_v_self, struct PyGeventLoopObject *__pyx_v_loop, CYTHON_UNUSED int __pyx_v_signalnum, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__", 0);
+
+
+  /* function exit code */
+  __pyx_r = 0;
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_AddTraceback("gevent.libev.corecext.signal.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = -1;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+1102:         watcher.__init__(self, loop, ref, priority)
+
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_6gevent_5libev_8corecext_watcher), __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1102, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = NULL;
+  __pyx_t_4 = 0;
+  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+    if (likely(__pyx_t_3)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+      __Pyx_INCREF(__pyx_t_3);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_2, function);
+      __pyx_t_4 = 1;
+    }
+  }
+  #if CYTHON_FAST_PYCALL
+  if (PyFunction_Check(__pyx_t_2)) {
+    PyObject *__pyx_temp[5] = {__pyx_t_3, ((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_loop), __pyx_v_ref, __pyx_v_priority};
+    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 4+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1102, __pyx_L1_error)
+    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __Pyx_GOTREF(__pyx_t_1);
+  } else
+  #endif
+  #if CYTHON_FAST_PYCCALL
+  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
+    PyObject *__pyx_temp[5] = {__pyx_t_3, ((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_loop), __pyx_v_ref, __pyx_v_priority};
+    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 4+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1102, __pyx_L1_error)
+    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __Pyx_GOTREF(__pyx_t_1);
+  } else
+  #endif
+  {
+    __pyx_t_5 = PyTuple_New(4+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1102, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_5);
+    if (__pyx_t_3) {
+      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
+    }
+    __Pyx_INCREF(((PyObject *)__pyx_v_self));
+    __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
+    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, ((PyObject *)__pyx_v_self));
+    __Pyx_INCREF(((PyObject *)__pyx_v_loop));
+    __Pyx_GIVEREF(((PyObject *)__pyx_v_loop));
+    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, ((PyObject *)__pyx_v_loop));
+    __Pyx_INCREF(__pyx_v_ref);
+    __Pyx_GIVEREF(__pyx_v_ref);
+    PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_4, __pyx_v_ref);
+    __Pyx_INCREF(__pyx_v_priority);
+    __Pyx_GIVEREF(__pyx_v_priority);
+    PyTuple_SET_ITEM(__pyx_t_5, 3+__pyx_t_4, __pyx_v_priority);
+    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1102, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+  }
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 1103: 
+
 1104: 
+
 1105: 
+
+1106: cdef start_and_stop idle_ss = make_ss(<void*>libev.ev_idle_start, <void*>libev.ev_idle_stop)
+
+  __pyx_v_6gevent_5libev_8corecext_idle_ss = __pyx_f_6gevent_5libev_8corecext_make_ss(((void *)ev_idle_start), ((void *)ev_idle_stop));
+
 1107: 
+
+1108: cdef public class idle(watcher) [object PyGeventIdleObject, type PyGeventIdle_Type]:
+
+struct PyGeventIdleObject {
+  struct PyGeventWatcherObject __pyx_base;
+  struct ev_idle _watcher;
+};
+
+__PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyGeventIdle_Type;
+
 1109: 
+
 1110:     cdef libev.ev_idle _watcher
+
 1111: 
+
+1112:     def __cinit__(self, loop loop, ref=True, priority=None):
+
+
+/* Python wrapper */
+static int __pyx_pw_6gevent_5libev_8corecext_4idle_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static int __pyx_pw_6gevent_5libev_8corecext_4idle_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_loop = 0;
+  CYTHON_UNUSED PyObject *__pyx_v_ref = 0;
+  CYTHON_UNUSED PyObject *__pyx_v_priority = 0;
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_loop,&__pyx_n_s_ref,&__pyx_n_s_priority,0};
+    PyObject* values[3] = {0,0,0};
+    values[1] = ((PyObject *)Py_True);
+    values[2] = ((PyObject *)Py_None);
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_loop)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ref);
+          if (value) { values[1] = value; kw_args--; }
+        }
+        CYTHON_FALLTHROUGH;
+        case  2:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_priority);
+          if (value) { values[2] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 1112, __pyx_L3_error)
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    __pyx_v_loop = ((struct PyGeventLoopObject *)values[0]);
+    __pyx_v_ref = values[1];
+    __pyx_v_priority = values[2];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1112, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.libev.corecext.idle.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return -1;
+  __pyx_L4_argument_unpacking_done:;
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_loop), __pyx_ptype_6gevent_5libev_8corecext_loop, 1, "loop", 0))) __PYX_ERR(0, 1112, __pyx_L1_error)
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4idle___cinit__(((struct PyGeventIdleObject *)__pyx_v_self), __pyx_v_loop, __pyx_v_ref, __pyx_v_priority);
+
+  /* function exit code */
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __pyx_r = -1;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_5libev_8corecext_4idle___cinit__(struct PyGeventIdleObject *__pyx_v_self, CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_loop, CYTHON_UNUSED PyObject *__pyx_v_ref, CYTHON_UNUSED PyObject *__pyx_v_priority) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__cinit__", 0);
+
+
+  /* function exit code */
+  __pyx_r = 0;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+1113:         libev.ev_idle_init(&self._watcher, <void*>gevent_callback_idle)
+
+  ev_idle_init((&__pyx_v_self->_watcher), ((void *)gevent_callback_idle));
+
+1114:         self.__watcher = <libev.ev_watcher*>&self._watcher
+
+  __pyx_v_self->__pyx_base.__pyx___watcher = ((struct ev_watcher *)(&__pyx_v_self->_watcher));
+
+1115:         self.__ss = &idle_ss
+
+  __pyx_v_self->__pyx_base.__pyx___ss = (&__pyx_v_6gevent_5libev_8corecext_idle_ss);
+
 1116: 
+
 1117: 
+
 1118: 
+
+1119: cdef start_and_stop prepare_ss = make_ss(<void*>libev.ev_prepare_start, <void*>libev.ev_prepare_stop)
+
+  __pyx_v_6gevent_5libev_8corecext_prepare_ss = __pyx_f_6gevent_5libev_8corecext_make_ss(((void *)ev_prepare_start), ((void *)ev_prepare_stop));
+
 1120: 
+
+1121: cdef public class prepare(watcher) [object PyGeventPrepareObject, type PyGeventPrepare_Type]:
+
+struct PyGeventPrepareObject {
+  struct PyGeventWatcherObject __pyx_base;
+  struct ev_prepare _watcher;
+};
+
+__PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyGeventPrepare_Type;
+
 1122: 
+
 1123:     cdef libev.ev_prepare _watcher
+
 1124: 
+
+1125:     def __cinit__(self, loop loop, ref=True, priority=None):
+
+
+/* Python wrapper */
+static int __pyx_pw_6gevent_5libev_8corecext_7prepare_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static int __pyx_pw_6gevent_5libev_8corecext_7prepare_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_loop = 0;
+  CYTHON_UNUSED PyObject *__pyx_v_ref = 0;
+  CYTHON_UNUSED PyObject *__pyx_v_priority = 0;
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_loop,&__pyx_n_s_ref,&__pyx_n_s_priority,0};
+    PyObject* values[3] = {0,0,0};
+    values[1] = ((PyObject *)Py_True);
+    values[2] = ((PyObject *)Py_None);
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_loop)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ref);
+          if (value) { values[1] = value; kw_args--; }
+        }
+        CYTHON_FALLTHROUGH;
+        case  2:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_priority);
+          if (value) { values[2] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 1125, __pyx_L3_error)
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    __pyx_v_loop = ((struct PyGeventLoopObject *)values[0]);
+    __pyx_v_ref = values[1];
+    __pyx_v_priority = values[2];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1125, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.libev.corecext.prepare.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return -1;
+  __pyx_L4_argument_unpacking_done:;
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_loop), __pyx_ptype_6gevent_5libev_8corecext_loop, 1, "loop", 0))) __PYX_ERR(0, 1125, __pyx_L1_error)
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_7prepare___cinit__(((struct PyGeventPrepareObject *)__pyx_v_self), __pyx_v_loop, __pyx_v_ref, __pyx_v_priority);
+
+  /* function exit code */
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __pyx_r = -1;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_5libev_8corecext_7prepare___cinit__(struct PyGeventPrepareObject *__pyx_v_self, CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_loop, CYTHON_UNUSED PyObject *__pyx_v_ref, CYTHON_UNUSED PyObject *__pyx_v_priority) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__cinit__", 0);
+
+
+  /* function exit code */
+  __pyx_r = 0;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+1126:         libev.ev_prepare_init(&self._watcher, <void*>gevent_callback_prepare)
+
+  ev_prepare_init((&__pyx_v_self->_watcher), ((void *)gevent_callback_prepare));
+
+1127:         self.__watcher = <libev.ev_watcher*>&self._watcher
+
+  __pyx_v_self->__pyx_base.__pyx___watcher = ((struct ev_watcher *)(&__pyx_v_self->_watcher));
+
+1128:         self.__ss = &prepare_ss
+
+  __pyx_v_self->__pyx_base.__pyx___ss = (&__pyx_v_6gevent_5libev_8corecext_prepare_ss);
+
 1129: 
+
 1130: 
+
 1131: 
+
+1132: cdef start_and_stop check_ss = make_ss(<void*>libev.ev_check_start, <void*>libev.ev_check_stop)
+
+  __pyx_v_6gevent_5libev_8corecext_check_ss = __pyx_f_6gevent_5libev_8corecext_make_ss(((void *)ev_check_start), ((void *)ev_check_stop));
+
 1133: 
+
+1134: cdef public class check(watcher) [object PyGeventCheckObject, type PyGeventCheck_Type]:
+
+struct PyGeventCheckObject {
+  struct PyGeventWatcherObject __pyx_base;
+  struct ev_check _watcher;
+};
+
+__PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyGeventCheck_Type;
+
 1135: 
+
 1136:     cdef libev.ev_check _watcher
+
 1137: 
+
+1138:     def __cinit__(self, loop loop, ref=True, priority=None):
+
+
+/* Python wrapper */
+static int __pyx_pw_6gevent_5libev_8corecext_5check_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static int __pyx_pw_6gevent_5libev_8corecext_5check_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_loop = 0;
+  CYTHON_UNUSED PyObject *__pyx_v_ref = 0;
+  CYTHON_UNUSED PyObject *__pyx_v_priority = 0;
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_loop,&__pyx_n_s_ref,&__pyx_n_s_priority,0};
+    PyObject* values[3] = {0,0,0};
+    values[1] = ((PyObject *)Py_True);
+    values[2] = ((PyObject *)Py_None);
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_loop)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ref);
+          if (value) { values[1] = value; kw_args--; }
+        }
+        CYTHON_FALLTHROUGH;
+        case  2:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_priority);
+          if (value) { values[2] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 1138, __pyx_L3_error)
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    __pyx_v_loop = ((struct PyGeventLoopObject *)values[0]);
+    __pyx_v_ref = values[1];
+    __pyx_v_priority = values[2];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1138, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.libev.corecext.check.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return -1;
+  __pyx_L4_argument_unpacking_done:;
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_loop), __pyx_ptype_6gevent_5libev_8corecext_loop, 1, "loop", 0))) __PYX_ERR(0, 1138, __pyx_L1_error)
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_5check___cinit__(((struct PyGeventCheckObject *)__pyx_v_self), __pyx_v_loop, __pyx_v_ref, __pyx_v_priority);
+
+  /* function exit code */
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __pyx_r = -1;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_5libev_8corecext_5check___cinit__(struct PyGeventCheckObject *__pyx_v_self, CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_loop, CYTHON_UNUSED PyObject *__pyx_v_ref, CYTHON_UNUSED PyObject *__pyx_v_priority) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__cinit__", 0);
+
+
+  /* function exit code */
+  __pyx_r = 0;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+1139:         libev.ev_check_init(&self._watcher, <void*>gevent_callback_check)
+
+  ev_check_init((&__pyx_v_self->_watcher), ((void *)gevent_callback_check));
+
+1140:         self.__watcher = <libev.ev_watcher*>&self._watcher
+
+  __pyx_v_self->__pyx_base.__pyx___watcher = ((struct ev_watcher *)(&__pyx_v_self->_watcher));
+
+1141:         self.__ss = &check_ss
+
+  __pyx_v_self->__pyx_base.__pyx___ss = (&__pyx_v_6gevent_5libev_8corecext_check_ss);
+
 1142: 
+
 1143: 
+
 1144: 
+
+1145: cdef start_and_stop fork_ss = make_ss(<void*>libev.ev_fork_start, <void*>libev.ev_fork_stop)
+
+  __pyx_v_6gevent_5libev_8corecext_fork_ss = __pyx_f_6gevent_5libev_8corecext_make_ss(((void *)ev_fork_start), ((void *)ev_fork_stop));
+
 1146: 
+
+1147: cdef public class fork(watcher) [object PyGeventForkObject, type PyGeventFork_Type]:
+
+struct PyGeventForkObject {
+  struct PyGeventWatcherObject __pyx_base;
+  struct ev_fork _watcher;
+};
+
+__PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyGeventFork_Type;
+
 1148: 
+
 1149:     cdef libev.ev_fork _watcher
+
 1150: 
+
+1151:     def __cinit__(self, loop loop, ref=True, priority=None):
+
+
+/* Python wrapper */
+static int __pyx_pw_6gevent_5libev_8corecext_4fork_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static int __pyx_pw_6gevent_5libev_8corecext_4fork_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_loop = 0;
+  CYTHON_UNUSED PyObject *__pyx_v_ref = 0;
+  CYTHON_UNUSED PyObject *__pyx_v_priority = 0;
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_loop,&__pyx_n_s_ref,&__pyx_n_s_priority,0};
+    PyObject* values[3] = {0,0,0};
+    values[1] = ((PyObject *)Py_True);
+    values[2] = ((PyObject *)Py_None);
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_loop)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ref);
+          if (value) { values[1] = value; kw_args--; }
+        }
+        CYTHON_FALLTHROUGH;
+        case  2:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_priority);
+          if (value) { values[2] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 1151, __pyx_L3_error)
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    __pyx_v_loop = ((struct PyGeventLoopObject *)values[0]);
+    __pyx_v_ref = values[1];
+    __pyx_v_priority = values[2];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1151, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.libev.corecext.fork.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return -1;
+  __pyx_L4_argument_unpacking_done:;
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_loop), __pyx_ptype_6gevent_5libev_8corecext_loop, 1, "loop", 0))) __PYX_ERR(0, 1151, __pyx_L1_error)
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4fork___cinit__(((struct PyGeventForkObject *)__pyx_v_self), __pyx_v_loop, __pyx_v_ref, __pyx_v_priority);
+
+  /* function exit code */
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __pyx_r = -1;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_5libev_8corecext_4fork___cinit__(struct PyGeventForkObject *__pyx_v_self, CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_loop, CYTHON_UNUSED PyObject *__pyx_v_ref, CYTHON_UNUSED PyObject *__pyx_v_priority) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__cinit__", 0);
+
+
+  /* function exit code */
+  __pyx_r = 0;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+1152:         libev.ev_fork_init(&self._watcher, <void*>gevent_callback_fork)
+
+  ev_fork_init((&__pyx_v_self->_watcher), ((void *)gevent_callback_fork));
+
+1153:         self.__watcher = <libev.ev_watcher*>&self._watcher
+
+  __pyx_v_self->__pyx_base.__pyx___watcher = ((struct ev_watcher *)(&__pyx_v_self->_watcher));
+
+1154:         self.__ss = &fork_ss
+
+  __pyx_v_self->__pyx_base.__pyx___ss = (&__pyx_v_6gevent_5libev_8corecext_fork_ss);
+
 1155: 
+
 1156: 
+
+1157: cdef start_and_stop async_ss = make_ss(<void*>libev.ev_async_start, <void*>libev.ev_async_stop)
+
+  __pyx_v_6gevent_5libev_8corecext_async_ss = __pyx_f_6gevent_5libev_8corecext_make_ss(((void *)ev_async_start), ((void *)ev_async_stop));
+
 1158: 
+
+1159: cdef public class async_(watcher) [object PyGeventAsyncObject, type PyGeventAsync_Type]:
+
+struct PyGeventAsyncObject {
+  struct PyGeventWatcherObject __pyx_base;
+  struct ev_async _watcher;
+};
+
+__PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyGeventAsync_Type;
+
 1160: 
+
 1161:     cdef libev.ev_async _watcher
+
 1162: 
+
 1163:     @property
+
+1164:     def pending(self):
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_6async__7pending_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_6async__7pending_1__get__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_6async__7pending___get__(((struct PyGeventAsyncObject *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_6async__7pending___get__(struct PyGeventAsyncObject *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__", 0);
+
+
+  /* function exit code */
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
 1165:         # Note the use of ev_async_pending instead of ev_is_pending
+
+1166:         return True if libev.ev_async_pending(&self._watcher) else False
+
+  __Pyx_XDECREF(__pyx_r);
+  if ((ev_async_pending((&__pyx_v_self->_watcher)) != 0)) {
+    __Pyx_INCREF(Py_True);
+    __pyx_t_1 = Py_True;
+  } else {
+    __Pyx_INCREF(Py_False);
+    __pyx_t_1 = Py_False;
+  }
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
 1167: 
+
+1168:     def __cinit__(self, loop loop, ref=True, priority=None):
+
+
+/* Python wrapper */
+static int __pyx_pw_6gevent_5libev_8corecext_6async__1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static int __pyx_pw_6gevent_5libev_8corecext_6async__1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_loop = 0;
+  CYTHON_UNUSED PyObject *__pyx_v_ref = 0;
+  CYTHON_UNUSED PyObject *__pyx_v_priority = 0;
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_loop,&__pyx_n_s_ref,&__pyx_n_s_priority,0};
+    PyObject* values[3] = {0,0,0};
+    values[1] = ((PyObject *)Py_True);
+    values[2] = ((PyObject *)Py_None);
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_loop)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ref);
+          if (value) { values[1] = value; kw_args--; }
+        }
+        CYTHON_FALLTHROUGH;
+        case  2:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_priority);
+          if (value) { values[2] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 1168, __pyx_L3_error)
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    __pyx_v_loop = ((struct PyGeventLoopObject *)values[0]);
+    __pyx_v_ref = values[1];
+    __pyx_v_priority = values[2];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1168, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.libev.corecext.async_.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return -1;
+  __pyx_L4_argument_unpacking_done:;
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_loop), __pyx_ptype_6gevent_5libev_8corecext_loop, 1, "loop", 0))) __PYX_ERR(0, 1168, __pyx_L1_error)
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_6async____cinit__(((struct PyGeventAsyncObject *)__pyx_v_self), __pyx_v_loop, __pyx_v_ref, __pyx_v_priority);
+
+  /* function exit code */
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __pyx_r = -1;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_5libev_8corecext_6async____cinit__(struct PyGeventAsyncObject *__pyx_v_self, CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_loop, CYTHON_UNUSED PyObject *__pyx_v_ref, CYTHON_UNUSED PyObject *__pyx_v_priority) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__cinit__", 0);
+
+
+  /* function exit code */
+  __pyx_r = 0;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+1169:         libev.ev_async_init(&self._watcher, <void*>gevent_callback_async)
+
+  ev_async_init((&__pyx_v_self->_watcher), ((void *)gevent_callback_async));
+
+1170:         self.__watcher = <libev.ev_watcher*>&self._watcher
+
+  __pyx_v_self->__pyx_base.__pyx___watcher = ((struct ev_watcher *)(&__pyx_v_self->_watcher));
+
+1171:         self.__ss = &async_ss
+
+  __pyx_v_self->__pyx_base.__pyx___ss = (&__pyx_v_6gevent_5libev_8corecext_async_ss);
+
 1172: 
+
 1173: 
+
+1174:     def send(self):
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_6async__3send(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_6async__3send(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("send (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_6async__2send(((struct PyGeventAsyncObject *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_6async__2send(struct PyGeventAsyncObject *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("send", 0);
+
+
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.libev.corecext.async_.send", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+1175:         _check_loop(self.loop)
+
+  __pyx_t_1 = ((PyObject *)__pyx_v_self->__pyx_base.loop);
+  __Pyx_INCREF(__pyx_t_1);
+  __pyx_t_2 = __pyx_f_6gevent_5libev_8corecext__check_loop(((struct PyGeventLoopObject *)__pyx_t_1)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 1175, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+1176:         libev.ev_async_send(self.loop._ptr, &self._watcher)
+
+  ev_async_send(__pyx_v_self->__pyx_base.loop->_ptr, (&__pyx_v_self->_watcher));
+
 1177: 
+
+1178: async = async_
+
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_async_2, ((PyObject *)__pyx_ptype_6gevent_5libev_8corecext_async_)) < 0) __PYX_ERR(0, 1178, __pyx_L1_error)
+
 1179: 
+
+1180: cdef start_and_stop child_ss = make_ss(<void*>libev.ev_child_start, <void*>libev.ev_child_stop)
+
+  __pyx_v_6gevent_5libev_8corecext_child_ss = __pyx_f_6gevent_5libev_8corecext_make_ss(((void *)ev_child_start), ((void *)ev_child_stop));
+
 1181: 
+
+1182: cdef public class child(watcher) [object PyGeventChildObject, type PyGeventChild_Type]:
+
+struct PyGeventChildObject {
+  struct PyGeventWatcherObject __pyx_base;
+  struct ev_child _watcher;
+};
+
+__PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyGeventChild_Type;
+
 1183: 
+
 1184:     cdef libev.ev_child _watcher
+
 1185: 
+
+1186:     def __cinit__(self, loop loop, int pid, bint trace=0, ref=True):
+
+
+/* Python wrapper */
+static int __pyx_pw_6gevent_5libev_8corecext_5child_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static int __pyx_pw_6gevent_5libev_8corecext_5child_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  struct PyGeventLoopObject *__pyx_v_loop = 0;
+  int __pyx_v_pid;
+  int __pyx_v_trace;
+  CYTHON_UNUSED PyObject *__pyx_v_ref = 0;
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_loop,&__pyx_n_s_pid,&__pyx_n_s_trace,&__pyx_n_s_ref,0};
+    PyObject* values[4] = {0,0,0,0};
+    values[3] = ((PyObject *)Py_True);
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
+        CYTHON_FALLTHROUGH;
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_loop)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pid)) != 0)) kw_args--;
+        else {
+          __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 4, 1); __PYX_ERR(0, 1186, __pyx_L3_error)
+        }
+        CYTHON_FALLTHROUGH;
+        case  2:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_trace);
+          if (value) { values[2] = value; kw_args--; }
+        }
+        CYTHON_FALLTHROUGH;
+        case  3:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ref);
+          if (value) { values[3] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 1186, __pyx_L3_error)
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
+        CYTHON_FALLTHROUGH;
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    __pyx_v_loop = ((struct PyGeventLoopObject *)values[0]);
+    __pyx_v_pid = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_pid == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1186, __pyx_L3_error)
+    if (values[2]) {
+      __pyx_v_trace = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_trace == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1186, __pyx_L3_error)
+    } else {
+      __pyx_v_trace = ((int)0);
+    }
+    __pyx_v_ref = values[3];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1186, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.libev.corecext.child.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return -1;
+  __pyx_L4_argument_unpacking_done:;
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_loop), __pyx_ptype_6gevent_5libev_8corecext_loop, 1, "loop", 0))) __PYX_ERR(0, 1186, __pyx_L1_error)
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_5child___cinit__(((struct PyGeventChildObject *)__pyx_v_self), __pyx_v_loop, __pyx_v_pid, __pyx_v_trace, __pyx_v_ref);
+
+  /* function exit code */
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __pyx_r = -1;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_5libev_8corecext_5child___cinit__(struct PyGeventChildObject *__pyx_v_self, struct PyGeventLoopObject *__pyx_v_loop, int __pyx_v_pid, int __pyx_v_trace, CYTHON_UNUSED PyObject *__pyx_v_ref) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__cinit__", 0);
+
+
+  /* function exit code */
+  __pyx_r = 0;
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_AddTraceback("gevent.libev.corecext.child.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = -1;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+1187:         if sys.platform == 'win32':
+
+  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_sys); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1187, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_platform); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1187, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_t_2, __pyx_n_s_win32, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1187, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  if (unlikely(__pyx_t_3)) {
+
+  }
+
+1188:             raise AttributeError("Child watchers are not supported on Windows")
+
+    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_AttributeError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1188, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __PYX_ERR(0, 1188, __pyx_L1_error)
+
+1189:         if not loop.default:
+
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_loop), __pyx_n_s_default); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1189, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1189, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_4 = ((!__pyx_t_3) != 0);
+  if (unlikely(__pyx_t_4)) {
+
+  }
+
+1190:             raise TypeError('child watchers are only available on the default loop')
+
+    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1190, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __PYX_ERR(0, 1190, __pyx_L1_error)
+
+  __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s_child_watchers_are_only_availabl); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(0, 1190, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__16);
+  __Pyx_GIVEREF(__pyx_tuple__16);
+
+1191:         libev.gevent_install_sigchld_handler()
+
+  gevent_install_sigchld_handler();
+
+1192:         libev.ev_child_init(&self._watcher, <void *>gevent_callback_child, pid, trace)
+
+  ev_child_init((&__pyx_v_self->_watcher), ((void *)gevent_callback_child), __pyx_v_pid, __pyx_v_trace);
+
+1193:         self.__watcher = <libev.ev_watcher*>&self._watcher
+
+  __pyx_v_self->__pyx_base.__pyx___watcher = ((struct ev_watcher *)(&__pyx_v_self->_watcher));
+
+1194:         self.__ss = &child_ss
+
+  __pyx_v_self->__pyx_base.__pyx___ss = (&__pyx_v_6gevent_5libev_8corecext_child_ss);
+
 1195: 
+
+1196:     def __init__(self, loop loop, int pid, bint trace=0, ref=True):
+
+
+/* Python wrapper */
+static int __pyx_pw_6gevent_5libev_8corecext_5child_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static int __pyx_pw_6gevent_5libev_8corecext_5child_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  struct PyGeventLoopObject *__pyx_v_loop = 0;
+  CYTHON_UNUSED int __pyx_v_pid;
+  CYTHON_UNUSED int __pyx_v_trace;
+  PyObject *__pyx_v_ref = 0;
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_loop,&__pyx_n_s_pid,&__pyx_n_s_trace,&__pyx_n_s_ref,0};
+    PyObject* values[4] = {0,0,0,0};
+    values[3] = ((PyObject *)Py_True);
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
+        CYTHON_FALLTHROUGH;
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_loop)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pid)) != 0)) kw_args--;
+        else {
+          __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 4, 1); __PYX_ERR(0, 1196, __pyx_L3_error)
+        }
+        CYTHON_FALLTHROUGH;
+        case  2:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_trace);
+          if (value) { values[2] = value; kw_args--; }
+        }
+        CYTHON_FALLTHROUGH;
+        case  3:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ref);
+          if (value) { values[3] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 1196, __pyx_L3_error)
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
+        CYTHON_FALLTHROUGH;
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    __pyx_v_loop = ((struct PyGeventLoopObject *)values[0]);
+    __pyx_v_pid = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_pid == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1196, __pyx_L3_error)
+    if (values[2]) {
+      __pyx_v_trace = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_trace == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1196, __pyx_L3_error)
+    } else {
+      __pyx_v_trace = ((int)0);
+    }
+    __pyx_v_ref = values[3];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1196, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.libev.corecext.child.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return -1;
+  __pyx_L4_argument_unpacking_done:;
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_loop), __pyx_ptype_6gevent_5libev_8corecext_loop, 1, "loop", 0))) __PYX_ERR(0, 1196, __pyx_L1_error)
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_5child_2__init__(((struct PyGeventChildObject *)__pyx_v_self), __pyx_v_loop, __pyx_v_pid, __pyx_v_trace, __pyx_v_ref);
+
+  /* function exit code */
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __pyx_r = -1;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_5libev_8corecext_5child_2__init__(struct PyGeventChildObject *__pyx_v_self, struct PyGeventLoopObject *__pyx_v_loop, CYTHON_UNUSED int __pyx_v_pid, CYTHON_UNUSED int __pyx_v_trace, PyObject *__pyx_v_ref) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__", 0);
+
+
+  /* function exit code */
+  __pyx_r = 0;
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_AddTraceback("gevent.libev.corecext.child.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = -1;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+1197:         watcher.__init__(self, loop, ref, None)
+
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_6gevent_5libev_8corecext_watcher), __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1197, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = NULL;
+  __pyx_t_4 = 0;
+  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+    if (likely(__pyx_t_3)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+      __Pyx_INCREF(__pyx_t_3);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_2, function);
+      __pyx_t_4 = 1;
+    }
+  }
+  #if CYTHON_FAST_PYCALL
+  if (PyFunction_Check(__pyx_t_2)) {
+    PyObject *__pyx_temp[5] = {__pyx_t_3, ((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_loop), __pyx_v_ref, Py_None};
+    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 4+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1197, __pyx_L1_error)
+    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __Pyx_GOTREF(__pyx_t_1);
+  } else
+  #endif
+  #if CYTHON_FAST_PYCCALL
+  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
+    PyObject *__pyx_temp[5] = {__pyx_t_3, ((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_loop), __pyx_v_ref, Py_None};
+    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 4+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1197, __pyx_L1_error)
+    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __Pyx_GOTREF(__pyx_t_1);
+  } else
+  #endif
+  {
+    __pyx_t_5 = PyTuple_New(4+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1197, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_5);
+    if (__pyx_t_3) {
+      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
+    }
+    __Pyx_INCREF(((PyObject *)__pyx_v_self));
+    __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
+    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, ((PyObject *)__pyx_v_self));
+    __Pyx_INCREF(((PyObject *)__pyx_v_loop));
+    __Pyx_GIVEREF(((PyObject *)__pyx_v_loop));
+    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, ((PyObject *)__pyx_v_loop));
+    __Pyx_INCREF(__pyx_v_ref);
+    __Pyx_GIVEREF(__pyx_v_ref);
+    PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_4, __pyx_v_ref);
+    __Pyx_INCREF(Py_None);
+    __Pyx_GIVEREF(Py_None);
+    PyTuple_SET_ITEM(__pyx_t_5, 3+__pyx_t_4, Py_None);
+    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1197, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+  }
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 1198: 
+
 1199: 
+
+1200:     def _format(self):
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_5child_5_format(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_5child_5_format(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_format (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_5child_4_format(((struct PyGeventChildObject *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_5child_4_format(struct PyGeventChildObject *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_format", 0);
+
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_AddTraceback("gevent.libev.corecext.child._format", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+1201:         return ' pid=%r rstatus=%r' % (self.pid, self.rstatus)
+
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_pid); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1201, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_rstatus); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1201, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1201, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_GIVEREF(__pyx_t_1);
+  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_2);
+  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
+  __pyx_t_1 = 0;
+  __pyx_t_2 = 0;
+  __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_pid_r_rstatus_r, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1201, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __pyx_r = __pyx_t_2;
+  __pyx_t_2 = 0;
+  goto __pyx_L0;
+
 1202: 
+
 1203:     @property
+
+1204:     def pid(self):
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_5child_3pid_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_5child_3pid_1__get__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_5child_3pid___get__(((struct PyGeventChildObject *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_5child_3pid___get__(struct PyGeventChildObject *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__", 0);
+
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.libev.corecext.child.pid.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+1205:         return self._watcher.pid
+
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->_watcher.pid); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1205, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
 1206: 
+
 1207:     @property
+
+1208:     def rpid(self):
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_5child_4rpid_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_5child_4rpid_1__get__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_5child_4rpid___get__(((struct PyGeventChildObject *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_5child_4rpid___get__(struct PyGeventChildObject *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__", 0);
+
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.libev.corecext.child.rpid.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+1209:         return self._watcher.rpid
+
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->_watcher.rpid); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1209, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
 1210: 
+
 1211:     @rpid.setter
+
+1212:     def rpid(self, int value):
+
+
+/* Python wrapper */
+static int __pyx_pw_6gevent_5libev_8corecext_5child_4rpid_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_value); /*proto*/
+static int __pyx_pw_6gevent_5libev_8corecext_5child_4rpid_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_value) {
+  int __pyx_v_value;
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
+  assert(__pyx_arg_value); {
+    __pyx_v_value = __Pyx_PyInt_As_int(__pyx_arg_value); if (unlikely((__pyx_v_value == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1212, __pyx_L3_error)
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.libev.corecext.child.rpid.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return -1;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_5child_4rpid_2__set__(((struct PyGeventChildObject *)__pyx_v_self), ((int)__pyx_v_value));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_5libev_8corecext_5child_4rpid_2__set__(struct PyGeventChildObject *__pyx_v_self, int __pyx_v_value) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__set__", 0);
+
+
+  /* function exit code */
+  __pyx_r = 0;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+1213:         self._watcher.rpid = value
+
+  __pyx_v_self->_watcher.rpid = __pyx_v_value;
+
 1214: 
+
 1215:     @property
+
+1216:     def rstatus(self):
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_5child_7rstatus_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_5child_7rstatus_1__get__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_5child_7rstatus___get__(((struct PyGeventChildObject *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_5child_7rstatus___get__(struct PyGeventChildObject *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__", 0);
+
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.libev.corecext.child.rstatus.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+1217:         return self._watcher.rstatus
+
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->_watcher.rstatus); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1217, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
 1218: 
+
 1219:     @rstatus.setter
+
+1220:     def rstatus(self, int value):
+
+
+/* Python wrapper */
+static int __pyx_pw_6gevent_5libev_8corecext_5child_7rstatus_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_value); /*proto*/
+static int __pyx_pw_6gevent_5libev_8corecext_5child_7rstatus_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_value) {
+  int __pyx_v_value;
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
+  assert(__pyx_arg_value); {
+    __pyx_v_value = __Pyx_PyInt_As_int(__pyx_arg_value); if (unlikely((__pyx_v_value == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1220, __pyx_L3_error)
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.libev.corecext.child.rstatus.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return -1;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_5child_7rstatus_2__set__(((struct PyGeventChildObject *)__pyx_v_self), ((int)__pyx_v_value));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_5libev_8corecext_5child_7rstatus_2__set__(struct PyGeventChildObject *__pyx_v_self, int __pyx_v_value) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__set__", 0);
+
+
+  /* function exit code */
+  __pyx_r = 0;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+1221:         self._watcher.rstatus = value
+
+  __pyx_v_self->_watcher.rstatus = __pyx_v_value;
+
 1222: 
+
+1223: cdef start_and_stop stat_ss = make_ss(<void*>libev.ev_stat_start, <void*>libev.ev_stat_stop)
+
+  __pyx_v_6gevent_5libev_8corecext_stat_ss = __pyx_f_6gevent_5libev_8corecext_make_ss(((void *)ev_stat_start), ((void *)ev_stat_stop));
+
 1224: 
+
+1225: cdef public class stat(watcher) [object PyGeventStatObject, type PyGeventStat_Type]:
+
+struct PyGeventStatObject {
+  struct PyGeventWatcherObject __pyx_base;
+  struct ev_stat _watcher;
+  PyObject *path;
+  PyObject *_paths;
+};
+
+__PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyGeventStat_Type;
+
 1226: 
+
 1227:     cdef libev.ev_stat _watcher
+
+1228:     cdef readonly str path
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4stat_4path_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4stat_4path_1__get__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4stat_4path___get__(((struct PyGeventStatObject *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_4stat_4path___get__(struct PyGeventStatObject *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __Pyx_INCREF(__pyx_v_self->path);
+  __pyx_r = __pyx_v_self->path;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+1229:     cdef readonly bytes _paths
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4stat_6_paths_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4stat_6_paths_1__get__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4stat_6_paths___get__(((struct PyGeventStatObject *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_4stat_6_paths___get__(struct PyGeventStatObject *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __Pyx_INCREF(__pyx_v_self->_paths);
+  __pyx_r = __pyx_v_self->_paths;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
 1230: 
+
+1231:     def __cinit__(self, loop loop, str path, float interval=0.0, ref=True, priority=None):
+
+
+/* Python wrapper */
+static int __pyx_pw_6gevent_5libev_8corecext_4stat_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static int __pyx_pw_6gevent_5libev_8corecext_4stat_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_loop = 0;
+  PyObject *__pyx_v_path = 0;
+  float __pyx_v_interval;
+  CYTHON_UNUSED PyObject *__pyx_v_ref = 0;
+  CYTHON_UNUSED PyObject *__pyx_v_priority = 0;
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_loop,&__pyx_n_s_path,&__pyx_n_s_interval,&__pyx_n_s_ref,&__pyx_n_s_priority,0};
+    PyObject* values[5] = {0,0,0,0,0};
+    values[3] = ((PyObject *)Py_True);
+    values[4] = ((PyObject *)Py_None);
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
+        CYTHON_FALLTHROUGH;
+        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
+        CYTHON_FALLTHROUGH;
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_loop)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_path)) != 0)) kw_args--;
+        else {
+          __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 5, 1); __PYX_ERR(0, 1231, __pyx_L3_error)
+        }
+        CYTHON_FALLTHROUGH;
+        case  2:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_interval);
+          if (value) { values[2] = value; kw_args--; }
+        }
+        CYTHON_FALLTHROUGH;
+        case  3:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ref);
+          if (value) { values[3] = value; kw_args--; }
+        }
+        CYTHON_FALLTHROUGH;
+        case  4:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_priority);
+          if (value) { values[4] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 1231, __pyx_L3_error)
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
+        CYTHON_FALLTHROUGH;
+        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
+        CYTHON_FALLTHROUGH;
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    __pyx_v_loop = ((struct PyGeventLoopObject *)values[0]);
+    __pyx_v_path = ((PyObject*)values[1]);
+    if (values[2]) {
+      __pyx_v_interval = __pyx_PyFloat_AsFloat(values[2]); if (unlikely((__pyx_v_interval == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 1231, __pyx_L3_error)
+    } else {
+      __pyx_v_interval = ((float)0.0);
+    }
+    __pyx_v_ref = values[3];
+    __pyx_v_priority = values[4];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1231, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.libev.corecext.stat.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return -1;
+  __pyx_L4_argument_unpacking_done:;
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_loop), __pyx_ptype_6gevent_5libev_8corecext_loop, 1, "loop", 0))) __PYX_ERR(0, 1231, __pyx_L1_error)
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_path), (&PyString_Type), 1, "path", 1))) __PYX_ERR(0, 1231, __pyx_L1_error)
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4stat___cinit__(((struct PyGeventStatObject *)__pyx_v_self), __pyx_v_loop, __pyx_v_path, __pyx_v_interval, __pyx_v_ref, __pyx_v_priority);
+
+  /* function exit code */
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __pyx_r = -1;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_5libev_8corecext_4stat___cinit__(struct PyGeventStatObject *__pyx_v_self, CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_loop, PyObject *__pyx_v_path, float __pyx_v_interval, CYTHON_UNUSED PyObject *__pyx_v_ref, CYTHON_UNUSED PyObject *__pyx_v_priority) {
+  PyObject *__pyx_v_paths = 0;
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__cinit__", 0);
+
+
+  /* function exit code */
+  __pyx_r = 0;
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_XDECREF(__pyx_t_6);
+  __Pyx_XDECREF(__pyx_t_7);
+  __Pyx_AddTraceback("gevent.libev.corecext.stat.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = -1;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_paths);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+1232:         self.path = path
+
+  __Pyx_INCREF(__pyx_v_path);
+  __Pyx_GIVEREF(__pyx_v_path);
+  __Pyx_GOTREF(__pyx_v_self->path);
+  __Pyx_DECREF(__pyx_v_self->path);
+  __pyx_v_self->path = __pyx_v_path;
+
 1233:         cdef bytes paths
+
+1234:         if isinstance(path, unicode):
+
+  __pyx_t_1 = PyUnicode_Check(__pyx_v_path); 
+  __pyx_t_2 = (__pyx_t_1 != 0);
+  if (__pyx_t_2) {
+
+    goto __pyx_L3;
+  }
+
 1235:             # the famous Python3 filesystem encoding debacle hits us here. Can we do better?
+
 1236:             # We must keep a reference to the encoded string so that its bytes don't get freed
+
 1237:             # and overwritten, leading to strange errors from libev ("no such file or directory")
+
+1238:             paths = (<unicode>path).encode(sys.getfilesystemencoding())
+
+    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_path, __pyx_n_s_encode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1238, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_sys); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1238, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_6);
+    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_getfilesystemencoding); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1238, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_7);
+    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+    __pyx_t_6 = NULL;
+    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
+      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
+      if (likely(__pyx_t_6)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
+        __Pyx_INCREF(__pyx_t_6);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_7, function);
+      }
+    }
+    __pyx_t_5 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_7);
+    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+    if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1238, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_5);
+    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+    __pyx_t_7 = NULL;
+    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
+      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4);
+      if (likely(__pyx_t_7)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
+        __Pyx_INCREF(__pyx_t_7);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_4, function);
+      }
+    }
+    __pyx_t_3 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_7, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5);
+    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1238, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    if (!(likely(PyBytes_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(0, 1238, __pyx_L1_error)
+    __pyx_v_paths = ((PyObject*)__pyx_t_3);
+    __pyx_t_3 = 0;
+
+1239:             self._paths = paths
+
+    __Pyx_INCREF(__pyx_v_paths);
+    __Pyx_GIVEREF(__pyx_v_paths);
+    __Pyx_GOTREF(__pyx_v_self->_paths);
+    __Pyx_DECREF(__pyx_v_self->_paths);
+    __pyx_v_self->_paths = __pyx_v_paths;
+
 1240:         else:
+
+1241:             paths = <bytes>path
+
+  /*else*/ {
+    __pyx_t_3 = __pyx_v_path;
+    __Pyx_INCREF(__pyx_t_3);
+    __pyx_v_paths = ((PyObject*)__pyx_t_3);
+    __pyx_t_3 = 0;
+
+1242:             self._paths = paths
+
+    __Pyx_INCREF(__pyx_v_paths);
+    __Pyx_GIVEREF(__pyx_v_paths);
+    __Pyx_GOTREF(__pyx_v_self->_paths);
+    __Pyx_DECREF(__pyx_v_self->_paths);
+    __pyx_v_self->_paths = __pyx_v_paths;
+  }
+  __pyx_L3:;
+
+1243:         libev.ev_stat_init(&self._watcher, <void *>gevent_callback_stat, <char*>paths, interval)
+
+  if (unlikely(__pyx_v_paths == Py_None)) {
+    PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found");
+    __PYX_ERR(0, 1243, __pyx_L1_error)
+  }
+  __pyx_t_8 = __Pyx_PyBytes_AsWritableString(__pyx_v_paths); if (unlikely((!__pyx_t_8) && PyErr_Occurred())) __PYX_ERR(0, 1243, __pyx_L1_error)
+  ev_stat_init((&__pyx_v_self->_watcher), ((void *)gevent_callback_stat), ((char *)__pyx_t_8), __pyx_v_interval);
+
+1244:         self.__watcher = <libev.ev_watcher*>&self._watcher
+
+  __pyx_v_self->__pyx_base.__pyx___watcher = ((struct ev_watcher *)(&__pyx_v_self->_watcher));
+
+1245:         self.__ss = &stat_ss
+
+  __pyx_v_self->__pyx_base.__pyx___ss = (&__pyx_v_6gevent_5libev_8corecext_stat_ss);
+
 1246: 
+
+1247:     def __init__(self, loop loop, str path, float interval=0.0, ref=True, priority=None):
+
+
+/* Python wrapper */
+static int __pyx_pw_6gevent_5libev_8corecext_4stat_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static int __pyx_pw_6gevent_5libev_8corecext_4stat_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  struct PyGeventLoopObject *__pyx_v_loop = 0;
+  CYTHON_UNUSED PyObject *__pyx_v_path = 0;
+  CYTHON_UNUSED float __pyx_v_interval;
+  PyObject *__pyx_v_ref = 0;
+  PyObject *__pyx_v_priority = 0;
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_loop,&__pyx_n_s_path,&__pyx_n_s_interval,&__pyx_n_s_ref,&__pyx_n_s_priority,0};
+    PyObject* values[5] = {0,0,0,0,0};
+    values[3] = ((PyObject *)Py_True);
+    values[4] = ((PyObject *)Py_None);
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
+        CYTHON_FALLTHROUGH;
+        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
+        CYTHON_FALLTHROUGH;
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_loop)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_path)) != 0)) kw_args--;
+        else {
+          __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 5, 1); __PYX_ERR(0, 1247, __pyx_L3_error)
+        }
+        CYTHON_FALLTHROUGH;
+        case  2:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_interval);
+          if (value) { values[2] = value; kw_args--; }
+        }
+        CYTHON_FALLTHROUGH;
+        case  3:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ref);
+          if (value) { values[3] = value; kw_args--; }
+        }
+        CYTHON_FALLTHROUGH;
+        case  4:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_priority);
+          if (value) { values[4] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 1247, __pyx_L3_error)
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
+        CYTHON_FALLTHROUGH;
+        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
+        CYTHON_FALLTHROUGH;
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    __pyx_v_loop = ((struct PyGeventLoopObject *)values[0]);
+    __pyx_v_path = ((PyObject*)values[1]);
+    if (values[2]) {
+      __pyx_v_interval = __pyx_PyFloat_AsFloat(values[2]); if (unlikely((__pyx_v_interval == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 1247, __pyx_L3_error)
+    } else {
+      __pyx_v_interval = ((float)0.0);
+    }
+    __pyx_v_ref = values[3];
+    __pyx_v_priority = values[4];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1247, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.libev.corecext.stat.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return -1;
+  __pyx_L4_argument_unpacking_done:;
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_loop), __pyx_ptype_6gevent_5libev_8corecext_loop, 1, "loop", 0))) __PYX_ERR(0, 1247, __pyx_L1_error)
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_path), (&PyString_Type), 1, "path", 1))) __PYX_ERR(0, 1247, __pyx_L1_error)
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4stat_2__init__(((struct PyGeventStatObject *)__pyx_v_self), __pyx_v_loop, __pyx_v_path, __pyx_v_interval, __pyx_v_ref, __pyx_v_priority);
+
+  /* function exit code */
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __pyx_r = -1;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_5libev_8corecext_4stat_2__init__(struct PyGeventStatObject *__pyx_v_self, struct PyGeventLoopObject *__pyx_v_loop, CYTHON_UNUSED PyObject *__pyx_v_path, CYTHON_UNUSED float __pyx_v_interval, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__", 0);
+
+
+  /* function exit code */
+  __pyx_r = 0;
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_AddTraceback("gevent.libev.corecext.stat.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = -1;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+1248:         watcher.__init__(self, loop, ref, priority)
+
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_6gevent_5libev_8corecext_watcher), __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1248, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = NULL;
+  __pyx_t_4 = 0;
+  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+    if (likely(__pyx_t_3)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+      __Pyx_INCREF(__pyx_t_3);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_2, function);
+      __pyx_t_4 = 1;
+    }
+  }
+  #if CYTHON_FAST_PYCALL
+  if (PyFunction_Check(__pyx_t_2)) {
+    PyObject *__pyx_temp[5] = {__pyx_t_3, ((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_loop), __pyx_v_ref, __pyx_v_priority};
+    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 4+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1248, __pyx_L1_error)
+    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __Pyx_GOTREF(__pyx_t_1);
+  } else
+  #endif
+  #if CYTHON_FAST_PYCCALL
+  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
+    PyObject *__pyx_temp[5] = {__pyx_t_3, ((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_loop), __pyx_v_ref, __pyx_v_priority};
+    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 4+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1248, __pyx_L1_error)
+    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __Pyx_GOTREF(__pyx_t_1);
+  } else
+  #endif
+  {
+    __pyx_t_5 = PyTuple_New(4+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1248, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_5);
+    if (__pyx_t_3) {
+      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
+    }
+    __Pyx_INCREF(((PyObject *)__pyx_v_self));
+    __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
+    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, ((PyObject *)__pyx_v_self));
+    __Pyx_INCREF(((PyObject *)__pyx_v_loop));
+    __Pyx_GIVEREF(((PyObject *)__pyx_v_loop));
+    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, ((PyObject *)__pyx_v_loop));
+    __Pyx_INCREF(__pyx_v_ref);
+    __Pyx_GIVEREF(__pyx_v_ref);
+    PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_4, __pyx_v_ref);
+    __Pyx_INCREF(__pyx_v_priority);
+    __Pyx_GIVEREF(__pyx_v_priority);
+    PyTuple_SET_ITEM(__pyx_t_5, 3+__pyx_t_4, __pyx_v_priority);
+    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1248, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+  }
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 1249: 
+
 1250: 
+
 1251:     @property
+
+1252:     def attr(self):
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4stat_4attr_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4stat_4attr_1__get__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4stat_4attr___get__(((struct PyGeventStatObject *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_4stat_4attr___get__(struct PyGeventStatObject *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__", 0);
+
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_AddTraceback("gevent.libev.corecext.stat.attr.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+1253:         if not self._watcher.attr.st_nlink:
+
+  __pyx_t_1 = ((!(__pyx_v_self->_watcher.attr.st_nlink != 0)) != 0);
+  if (__pyx_t_1) {
+
+  }
+
+1254:             return
+
+    __Pyx_XDECREF(__pyx_r);
+    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+    goto __pyx_L0;
+
+1255:         return _pystat_fromstructstat(&self._watcher.attr)
+
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_2 = _pystat_fromstructstat((&__pyx_v_self->_watcher.attr)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1255, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_r = __pyx_t_2;
+  __pyx_t_2 = 0;
+  goto __pyx_L0;
+
 1256: 
+
 1257:     @property
+
+1258:     def prev(self):
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4stat_4prev_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4stat_4prev_1__get__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4stat_4prev___get__(((struct PyGeventStatObject *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_4stat_4prev___get__(struct PyGeventStatObject *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__", 0);
+
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_AddTraceback("gevent.libev.corecext.stat.prev.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+1259:         if not self._watcher.prev.st_nlink:
+
+  __pyx_t_1 = ((!(__pyx_v_self->_watcher.prev.st_nlink != 0)) != 0);
+  if (__pyx_t_1) {
+
+  }
+
+1260:             return
+
+    __Pyx_XDECREF(__pyx_r);
+    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+    goto __pyx_L0;
+
+1261:         return _pystat_fromstructstat(&self._watcher.prev)
+
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_2 = _pystat_fromstructstat((&__pyx_v_self->_watcher.prev)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1261, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_r = __pyx_t_2;
+  __pyx_t_2 = 0;
+  goto __pyx_L0;
+
 1262: 
+
 1263:     @property
+
+1264:     def interval(self):
+
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4stat_8interval_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_4stat_8interval_1__get__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_4stat_8interval___get__(((struct PyGeventStatObject *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_4stat_8interval___get__(struct PyGeventStatObject *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__", 0);
+
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.libev.corecext.stat.interval.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+1265:         return self._watcher.interval
+
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->_watcher.interval); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1265, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
 1266: 
+
 1267: 
+
 1268: 
+
+1269: __SYSERR_CALLBACK = None
+
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_SYSERR_CALLBACK, Py_None) < 0) __PYX_ERR(0, 1269, __pyx_L1_error)
+
 1270: 
+
 1271: 
+
+1272: cdef void _syserr_cb(char* msg) with gil:
+
+
+static void __pyx_f_6gevent_5libev_8corecext__syserr_cb(char *__pyx_v_msg) {
+  PyObject *__pyx_v_print_exc = NULL;
+  #ifdef WITH_THREAD
+  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
+  #endif
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_syserr_cb", 0);
+
+
+  /* function exit code */
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_XDECREF(__pyx_t_6);
+  __Pyx_XDECREF(__pyx_t_7);
+  __Pyx_XDECREF(__pyx_t_8);
+  __Pyx_XDECREF(__pyx_t_10);
+  __Pyx_WriteUnraisable("gevent.libev.corecext._syserr_cb", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_print_exc);
+  __Pyx_RefNannyFinishContext();
+  #ifdef WITH_THREAD
+  __Pyx_PyGILState_Release(__pyx_gilstate_save);
+  #endif
+}
+
+1273:     try:
+
+  {
+    /*try:*/ {
+
+    }
+    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+    goto __pyx_L8_try_end;
+    __pyx_L3_error:;
+    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
+    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
+    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+
+    __Pyx_XGIVEREF(__pyx_t_1);
+    __Pyx_XGIVEREF(__pyx_t_2);
+    __Pyx_XGIVEREF(__pyx_t_3);
+    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
+    goto __pyx_L1_error;
+    __pyx_L4_exception_handled:;
+    __Pyx_XGIVEREF(__pyx_t_1);
+    __Pyx_XGIVEREF(__pyx_t_2);
+    __Pyx_XGIVEREF(__pyx_t_3);
+    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
+    __pyx_L8_try_end:;
+  }
+
+1274:         __SYSERR_CALLBACK(msg, errno)
+
+      __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_SYSERR_CALLBACK); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1274, __pyx_L3_error)
+      __Pyx_GOTREF(__pyx_t_5);
+      __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_msg); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1274, __pyx_L3_error)
+      __Pyx_GOTREF(__pyx_t_6);
+      __pyx_t_7 = __Pyx_PyInt_From_int(errno); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1274, __pyx_L3_error)
+      __Pyx_GOTREF(__pyx_t_7);
+      __pyx_t_8 = NULL;
+      __pyx_t_9 = 0;
+      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
+        __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5);
+        if (likely(__pyx_t_8)) {
+          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
+          __Pyx_INCREF(__pyx_t_8);
+          __Pyx_INCREF(function);
+          __Pyx_DECREF_SET(__pyx_t_5, function);
+          __pyx_t_9 = 1;
+        }
+      }
+      #if CYTHON_FAST_PYCALL
+      if (PyFunction_Check(__pyx_t_5)) {
+        PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_t_6, __pyx_t_7};
+        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1274, __pyx_L3_error)
+        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
+        __Pyx_GOTREF(__pyx_t_4);
+        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+      } else
+      #endif
+      #if CYTHON_FAST_PYCCALL
+      if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
+        PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_t_6, __pyx_t_7};
+        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1274, __pyx_L3_error)
+        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
+        __Pyx_GOTREF(__pyx_t_4);
+        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+      } else
+      #endif
+      {
+        __pyx_t_10 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1274, __pyx_L3_error)
+        __Pyx_GOTREF(__pyx_t_10);
+        if (__pyx_t_8) {
+          __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_8); __pyx_t_8 = NULL;
+        }
+        __Pyx_GIVEREF(__pyx_t_6);
+        PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_9, __pyx_t_6);
+        __Pyx_GIVEREF(__pyx_t_7);
+        PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_9, __pyx_t_7);
+        __pyx_t_6 = 0;
+        __pyx_t_7 = 0;
+        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_10, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1274, __pyx_L3_error)
+        __Pyx_GOTREF(__pyx_t_4);
+        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+      }
+      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+
+1275:     except:
+
+    /*except:*/ {
+      __Pyx_AddTraceback("gevent.libev.corecext._syserr_cb", __pyx_clineno, __pyx_lineno, __pyx_filename);
+      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_5, &__pyx_t_10) < 0) __PYX_ERR(0, 1275, __pyx_L5_except_error)
+      __Pyx_GOTREF(__pyx_t_4);
+      __Pyx_GOTREF(__pyx_t_5);
+      __Pyx_GOTREF(__pyx_t_10);
+
+1276:         set_syserr_cb(None)
+
+      __pyx_t_7 = __pyx_f_6gevent_5libev_8corecext_set_syserr_cb(Py_None, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1276, __pyx_L5_except_error)
+      __Pyx_GOTREF(__pyx_t_7);
+      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+
+1277:         print_exc = getattr(traceback, 'print_exc', None)
+
+      __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_traceback); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1277, __pyx_L5_except_error)
+      __Pyx_GOTREF(__pyx_t_7);
+      __pyx_t_6 = __Pyx_GetAttr3(__pyx_t_7, __pyx_n_s_print_exc, Py_None); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1277, __pyx_L5_except_error)
+      __Pyx_GOTREF(__pyx_t_6);
+      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+      __pyx_v_print_exc = __pyx_t_6;
+      __pyx_t_6 = 0;
+
+1278:         if print_exc is not None:
+
+      __pyx_t_11 = (__pyx_v_print_exc != Py_None);
+      __pyx_t_12 = (__pyx_t_11 != 0);
+      if (__pyx_t_12) {
+
+      }
+      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
+      goto __pyx_L4_exception_handled;
+    }
+    __pyx_L5_except_error:;
+
+1279:             print_exc()
+
+        __Pyx_INCREF(__pyx_v_print_exc);
+        __pyx_t_7 = __pyx_v_print_exc; __pyx_t_8 = NULL;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
+          __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
+          if (likely(__pyx_t_8)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
+            __Pyx_INCREF(__pyx_t_8);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_7, function);
+          }
+        }
+        __pyx_t_6 = (__pyx_t_8) ? __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_8) : __Pyx_PyObject_CallNoArg(__pyx_t_7);
+        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
+        if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1279, __pyx_L5_except_error)
+        __Pyx_GOTREF(__pyx_t_6);
+        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+
 1280: 
+
 1281: 
+
+1282: cpdef set_syserr_cb(callback):
+
+
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_21set_syserr_cb(PyObject *__pyx_self, PyObject *__pyx_v_callback); /*proto*/
+static PyObject *__pyx_f_6gevent_5libev_8corecext_set_syserr_cb(PyObject *__pyx_v_callback, CYTHON_UNUSED int __pyx_skip_dispatch) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("set_syserr_cb", 0);
+
+
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_AddTraceback("gevent.libev.corecext.set_syserr_cb", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_21set_syserr_cb(PyObject *__pyx_self, PyObject *__pyx_v_callback); /*proto*/
+static PyObject *__pyx_pw_6gevent_5libev_8corecext_21set_syserr_cb(PyObject *__pyx_self, PyObject *__pyx_v_callback) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("set_syserr_cb (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_5libev_8corecext_20set_syserr_cb(__pyx_self, ((PyObject *)__pyx_v_callback));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_5libev_8corecext_20set_syserr_cb(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_callback) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("set_syserr_cb", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __pyx_f_6gevent_5libev_8corecext_set_syserr_cb(__pyx_v_callback, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1282, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.libev.corecext.set_syserr_cb", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
 1283:     global __SYSERR_CALLBACK
+
+1284:     if callback is None:
+
+  __pyx_t_1 = (__pyx_v_callback == Py_None);
+  __pyx_t_2 = (__pyx_t_1 != 0);
+  if (__pyx_t_2) {
+
+    goto __pyx_L3;
+  }
+
+1285:         libev.ev_set_syserr_cb(NULL)
+
+    ev_set_syserr_cb(NULL);
+
+1286:         __SYSERR_CALLBACK = None
+
+    if (PyDict_SetItem(__pyx_d, __pyx_n_s_SYSERR_CALLBACK, Py_None) < 0) __PYX_ERR(0, 1286, __pyx_L1_error)
+
+1287:     elif callable(callback):
+
+  __pyx_t_2 = __Pyx_PyCallable_Check(__pyx_v_callback); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 1287, __pyx_L1_error)
+  __pyx_t_1 = (__pyx_t_2 != 0);
+  if (likely(__pyx_t_1)) {
+
+    goto __pyx_L3;
+  }
+
+1288:         libev.ev_set_syserr_cb(<void *>_syserr_cb)
+
+    ev_set_syserr_cb(((void *)__pyx_f_6gevent_5libev_8corecext__syserr_cb));
+
+1289:         __SYSERR_CALLBACK = callback
+
+    if (PyDict_SetItem(__pyx_d, __pyx_n_s_SYSERR_CALLBACK, __pyx_v_callback) < 0) __PYX_ERR(0, 1289, __pyx_L1_error)
+
 1290:     else:
+
+1291:         raise TypeError('Expected callable or None, got %r' % (callback, ))
+
+  /*else*/ {
+    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1291, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_INCREF(__pyx_v_callback);
+    __Pyx_GIVEREF(__pyx_v_callback);
+    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_callback);
+    __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Expected_callable_or_None_got_r, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1291, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1291, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __PYX_ERR(0, 1291, __pyx_L1_error)
+  }
+  __pyx_L3:;
+
 1292: 
+
 1293: 
+
 1294: 
+
+1295: LIBEV_EMBED = bool(libev.LIBEV_EMBED)
+
+  __pyx_t_18 = __Pyx_PyInt_From_int(LIBEV_EMBED); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1295, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_18);
+  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_18); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1295, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
+  __pyx_t_18 = __Pyx_PyBool_FromLong((!(!__pyx_t_3))); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1295, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_18);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBEV_EMBED, __pyx_t_18) < 0) __PYX_ERR(0, 1295, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
+
+1296: EV_USE_FLOOR = libev.EV_USE_FLOOR
+
+  __pyx_t_18 = __Pyx_PyInt_From_int(EV_USE_FLOOR); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1296, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_18);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_EV_USE_FLOOR, __pyx_t_18) < 0) __PYX_ERR(0, 1296, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
+
+1297: EV_USE_CLOCK_SYSCALL = libev.EV_USE_CLOCK_SYSCALL
+
+  __pyx_t_18 = __Pyx_PyInt_From_int(EV_USE_CLOCK_SYSCALL); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1297, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_18);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_EV_USE_CLOCK_SYSCALL, __pyx_t_18) < 0) __PYX_ERR(0, 1297, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
+
+1298: EV_USE_REALTIME = libev.EV_USE_REALTIME
+
+  __pyx_t_18 = __Pyx_PyInt_From_int(EV_USE_REALTIME); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1298, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_18);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_EV_USE_REALTIME, __pyx_t_18) < 0) __PYX_ERR(0, 1298, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
+
+1299: EV_USE_MONOTONIC = libev.EV_USE_MONOTONIC
+
+  __pyx_t_18 = __Pyx_PyInt_From_int(EV_USE_MONOTONIC); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1299, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_18);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_EV_USE_MONOTONIC, __pyx_t_18) < 0) __PYX_ERR(0, 1299, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
+
+1300: EV_USE_NANOSLEEP = libev.EV_USE_NANOSLEEP
+
+  __pyx_t_18 = __Pyx_PyInt_From_int(EV_USE_NANOSLEEP); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1300, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_18);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_EV_USE_NANOSLEEP, __pyx_t_18) < 0) __PYX_ERR(0, 1300, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
+
+1301: EV_USE_INOTIFY = libev.EV_USE_INOTIFY
+
+  __pyx_t_18 = __Pyx_PyInt_From_int(EV_USE_INOTIFY); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1301, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_18);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_EV_USE_INOTIFY, __pyx_t_18) < 0) __PYX_ERR(0, 1301, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
+
+1302: EV_USE_SIGNALFD = libev.EV_USE_SIGNALFD
+
+  __pyx_t_18 = __Pyx_PyInt_From_int(EV_USE_SIGNALFD); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1302, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_18);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_EV_USE_SIGNALFD, __pyx_t_18) < 0) __PYX_ERR(0, 1302, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
+
+1303: EV_USE_EVENTFD = libev.EV_USE_EVENTFD
+
+  __pyx_t_18 = __Pyx_PyInt_From_int(EV_USE_EVENTFD); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1303, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_18);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_EV_USE_EVENTFD, __pyx_t_18) < 0) __PYX_ERR(0, 1303, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
+
+1304: EV_USE_4HEAP = libev.EV_USE_4HEAP
+
+  __pyx_t_18 = __Pyx_PyInt_From_int(EV_USE_4HEAP); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1304, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_18);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_EV_USE_4HEAP, __pyx_t_18) < 0) __PYX_ERR(0, 1304, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
+
 1305: 
+
 1306: # Things used in callbacks.c
+
 1307: 
+
 1308: from cpython cimport PyErr_Fetch
+
 1309: from cpython cimport PyObject
+
 1310: 
+
+1311: cdef public void gevent_handle_error(loop loop, object context):
+
+
+void gevent_handle_error(struct PyGeventLoopObject *__pyx_v_loop, PyObject *__pyx_v_context) {
+  PyObject *__pyx_v_typep;
+  PyObject *__pyx_v_valuep;
+  PyObject *__pyx_v_tracebackp;
+  PyObject *__pyx_v_type = 0;
+  PyObject *__pyx_v_value = 0;
+  PyObject *__pyx_v_traceback = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("gevent_handle_error", 0);
+
+
+  /* function exit code */
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_WriteUnraisable("gevent.libev.corecext.gevent_handle_error", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_type);
+  __Pyx_XDECREF(__pyx_v_value);
+  __Pyx_XDECREF(__pyx_v_traceback);
+  __Pyx_RefNannyFinishContext();
+}
+
 1312:     cdef PyObject* typep
+
 1313:     cdef PyObject* valuep
+
 1314:     cdef PyObject* tracebackp
+
 1315: 
+
 1316:     cdef object type
+
+1317:     cdef object value = None
+
+  __Pyx_INCREF(Py_None);
+  __pyx_v_value = Py_None;
+
+1318:     cdef object traceback = None
+
+  __Pyx_INCREF(Py_None);
+  __pyx_v_traceback = Py_None;
+
 1319:     cdef object result
+
 1320: 
+
 1321:     # If it was set, this will clear it, and we will own
+
 1322:     # the references.
+
+1323:     PyErr_Fetch(&typep, &valuep, &tracebackp)
+
+  PyErr_Fetch((&__pyx_v_typep), (&__pyx_v_valuep), (&__pyx_v_tracebackp));
+
 1324:     # TODO: Should we call PyErr_Normalize? There's code in
+
 1325:     # Hub.handle_error that works around what looks like an
+
 1326:     # unnormalized exception.
+
 1327: 
+
+1328:     if not typep:
+
+  __pyx_t_1 = ((!(__pyx_v_typep != 0)) != 0);
+  if (__pyx_t_1) {
+
+  }
+
+1329:         return
+
+    goto __pyx_L0;
+
 1330:     # This assignment will do a Py_INCREF
+
 1331:     # on the value. We already own the reference
+
 1332:     # returned from PyErr_Fetch,
+
 1333:     # so we must decref immediately
+
+1334:     type = <object>typep
+
+  __pyx_t_2 = ((PyObject *)__pyx_v_typep);
+  __Pyx_INCREF(__pyx_t_2);
+  __pyx_v_type = __pyx_t_2;
+  __pyx_t_2 = 0;
+
+1335:     Py_DECREF(type)
+
+  Py_DECREF(__pyx_v_type);
+
 1336: 
+
+1337:     if valuep:
+
+  __pyx_t_1 = (__pyx_v_valuep != 0);
+  if (__pyx_t_1) {
+
+  }
+
+1338:         value = <object>valuep
+
+    __pyx_t_2 = ((PyObject *)__pyx_v_valuep);
+    __Pyx_INCREF(__pyx_t_2);
+    __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_2);
+    __pyx_t_2 = 0;
+
+1339:         Py_DECREF(value)
+
+    Py_DECREF(__pyx_v_value);
+
+1340:     if tracebackp:
+
+  __pyx_t_1 = (__pyx_v_tracebackp != 0);
+  if (__pyx_t_1) {
+
+  }
+
+1341:         traceback = <object>tracebackp
+
+    __pyx_t_2 = ((PyObject *)__pyx_v_tracebackp);
+    __Pyx_INCREF(__pyx_t_2);
+    __Pyx_DECREF_SET(__pyx_v_traceback, __pyx_t_2);
+    __pyx_t_2 = 0;
+
+1342:         Py_DECREF(traceback)
+
+    Py_DECREF(__pyx_v_traceback);
+
 1343: 
+
 1344:     # If this method fails by raising an exception,
+
 1345:     # cython will print it for us because we don't return a
+
 1346:     # Python object and we don't declare an `except` clause.
+
+1347:     loop.handle_error(context, type, value, traceback)
+
+  __pyx_t_2 = ((struct __pyx_vtabstruct_6gevent_5libev_8corecext_loop *)__pyx_v_loop->__pyx_vtab)->handle_error(__pyx_v_loop, __pyx_v_context, __pyx_v_type, __pyx_v_value, __pyx_v_traceback, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1347, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
 1348: 
+
+1349: cdef public tuple _empty_tuple = ()
+
+  __Pyx_INCREF(__pyx_empty_tuple);
+  __Pyx_XGOTREF(_empty_tuple);
+  __Pyx_DECREF_SET(_empty_tuple, __pyx_empty_tuple);
+  __Pyx_GIVEREF(__pyx_empty_tuple);
+
 1350: 
+
+1351: cdef public object gevent_loop_run_callbacks(loop loop):
+
+
+PyObject *gevent_loop_run_callbacks(struct PyGeventLoopObject *__pyx_v_loop) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("gevent_loop_run_callbacks", 0);
+
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.libev.corecext.gevent_loop_run_callbacks", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+1352:     return loop._run_callbacks()
+
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_5libev_8corecext_loop *)__pyx_v_loop->__pyx_vtab)->_run_callbacks(__pyx_v_loop); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1352, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/libev/corecext.pyx b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/libev/corecext.pyx new file mode 100644 index 00000000..c7ec4c17 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/libev/corecext.pyx @@ -0,0 +1,1352 @@ +# Copyright (c) 2009-2012 Denis Bilenko. See LICENSE for details. + +# This first directive, supported in Cython 0.24+, causes sources +# files to be *much* smaller when it's false (139,027 LOC vs 35,000 +# LOC) and thus cythonpp.py (and probably the compiler; also Visual C +# has limits on source file sizes) to be faster (73s vs 46s). But it does +# make debugging more difficult. Auto-pickling was added in 0.26, and +# that's a new feature that we don't need or want to allow in a gevent +# point release. + +# cython: emit_code_comments=False, auto_pickle=False + +# NOTE: We generally cannot use the Cython IF directive as documented +# at +# http://cython.readthedocs.io/en/latest/src/userguide/language_basics.html#conditional-compilation +# (e.g., IF UNAME_SYSNAME == "Windows") because when Cython says +# "compilation", it means when *Cython* compiles, not when the C +# compiler compiles. We distribute an sdist with a single pre-compiled +# C file for all platforms so that end users that don't use a binary +# wheel don't have to sit through cythonpp and other steps the Makefile does. +# See https://github.com/gevent/gevent/issues/1076 + +cimport cython +cimport libev + +from cpython.ref cimport Py_INCREF +from cpython.ref cimport Py_DECREF +from cpython.mem cimport PyMem_Malloc +from cpython.mem cimport PyMem_Free +from libc.errno cimport errno + +cdef extern from "Python.h": + int Py_ReprEnter(object) + void Py_ReprLeave(object) + +# Work around lack of absolute_import in Cython +# Note for PY3: not doing so will leave reference to locals() on import +# (reproducible under Python 3.3, not under Python 3.4; see test__refcount_core.py) +sys = __import__('sys', level=0) +os = __import__('os', level=0) +traceback = __import__('traceback', level=0) +signalmodule = __import__('signal', level=0) +getswitchinterval = __import__('gevent', level=0).getswitchinterval + + +__all__ = ['get_version', + 'get_header_version', + 'supported_backends', + 'recommended_backends', + 'embeddable_backends', + 'time', + 'loop'] + +cdef tuple integer_types + +if sys.version_info[0] >= 3: + integer_types = int, +else: + integer_types = (int, long) + + +cdef extern from "callbacks.h": + void gevent_callback_io(libev.ev_loop, void*, int) + void gevent_callback_timer(libev.ev_loop, void*, int) + void gevent_callback_signal(libev.ev_loop, void*, int) + void gevent_callback_idle(libev.ev_loop, void*, int) + void gevent_callback_prepare(libev.ev_loop, void*, int) + void gevent_callback_check(libev.ev_loop, void*, int) + void gevent_callback_fork(libev.ev_loop, void*, int) + void gevent_callback_async(libev.ev_loop, void*, int) + void gevent_callback_child(libev.ev_loop, void*, int) + void gevent_callback_stat(libev.ev_loop, void*, int) + void gevent_run_callbacks(libev.ev_loop, void*, int) + void gevent_periodic_signal_check(libev.ev_loop, void*, int) + void gevent_call(loop, callback) + void gevent_noop(libev.ev_loop, void*, int) + +cdef extern from "stathelper.c": + object _pystat_fromstructstat(void*) + + +UNDEF = libev.EV_UNDEF +NONE = libev.EV_NONE +READ = libev.EV_READ +WRITE = libev.EV_WRITE +TIMER = libev.EV_TIMER +PERIODIC = libev.EV_PERIODIC +SIGNAL = libev.EV_SIGNAL +CHILD = libev.EV_CHILD +STAT = libev.EV_STAT +IDLE = libev.EV_IDLE +PREPARE = libev.EV_PREPARE +CHECK = libev.EV_CHECK +EMBED = libev.EV_EMBED +FORK = libev.EV_FORK +CLEANUP = libev.EV_CLEANUP +ASYNC = libev.EV_ASYNC +CUSTOM = libev.EV_CUSTOM +ERROR = libev.EV_ERROR + +READWRITE = libev.EV_READ | libev.EV_WRITE + +MINPRI = libev.EV_MINPRI +MAXPRI = libev.EV_MAXPRI + +BACKEND_PORT = libev.EVBACKEND_PORT +BACKEND_KQUEUE = libev.EVBACKEND_KQUEUE +BACKEND_EPOLL = libev.EVBACKEND_EPOLL +BACKEND_POLL = libev.EVBACKEND_POLL +BACKEND_SELECT = libev.EVBACKEND_SELECT +FORKCHECK = libev.EVFLAG_FORKCHECK +NOINOTIFY = libev.EVFLAG_NOINOTIFY +SIGNALFD = libev.EVFLAG_SIGNALFD +NOSIGMASK = libev.EVFLAG_NOSIGMASK + + +@cython.internal +cdef class _EVENTSType: + + def __repr__(self): + return 'gevent.core.EVENTS' + + +cdef public object GEVENT_CORE_EVENTS = _EVENTSType() +EVENTS = GEVENT_CORE_EVENTS + + +def get_version(): + return 'libev-%d.%02d' % (libev.ev_version_major(), libev.ev_version_minor()) + + +def get_header_version(): + return 'libev-%d.%02d' % (libev.EV_VERSION_MAJOR, libev.EV_VERSION_MINOR) + + +# This list backends in the order they are actually tried by libev +_flags = [(libev.EVBACKEND_PORT, 'port'), + (libev.EVBACKEND_KQUEUE, 'kqueue'), + (libev.EVBACKEND_EPOLL, 'epoll'), + (libev.EVBACKEND_POLL, 'poll'), + (libev.EVBACKEND_SELECT, 'select'), + (libev.EVFLAG_NOENV, 'noenv'), + (libev.EVFLAG_FORKCHECK, 'forkcheck'), + (libev.EVFLAG_NOINOTIFY, 'noinotify'), + (libev.EVFLAG_SIGNALFD, 'signalfd'), + (libev.EVFLAG_NOSIGMASK, 'nosigmask')] + + +_flags_str2int = dict((string, flag) for (flag, string) in _flags) + + +_events = [(libev.EV_READ, 'READ'), + (libev.EV_WRITE, 'WRITE'), + (libev.EV__IOFDSET, '_IOFDSET'), + (libev.EV_PERIODIC, 'PERIODIC'), + (libev.EV_SIGNAL, 'SIGNAL'), + (libev.EV_CHILD, 'CHILD'), + (libev.EV_STAT, 'STAT'), + (libev.EV_IDLE, 'IDLE'), + (libev.EV_PREPARE, 'PREPARE'), + (libev.EV_CHECK, 'CHECK'), + (libev.EV_EMBED, 'EMBED'), + (libev.EV_FORK, 'FORK'), + (libev.EV_CLEANUP, 'CLEANUP'), + (libev.EV_ASYNC, 'ASYNC'), + (libev.EV_CUSTOM, 'CUSTOM'), + (libev.EV_ERROR, 'ERROR')] + + +cpdef _flags_to_list(unsigned int flags): + cdef list result = [] + for code, value in _flags: + if flags & code: + result.append(value) + flags &= ~code + if not flags: + break + if flags: + result.append(flags) + return result + + +if sys.version_info[0] >= 3: + basestring = (bytes, str) +else: + basestring = __builtins__.basestring + + +cpdef unsigned int _flags_to_int(object flags) except? -1: + # Note, that order does not matter, libev has its own predefined order + if not flags: + return 0 + if isinstance(flags, integer_types): + return flags + cdef unsigned int result = 0 + try: + if isinstance(flags, basestring): + flags = flags.split(',') + for value in flags: + value = value.strip().lower() + if value: + result |= _flags_str2int[value] + except KeyError as ex: + raise ValueError('Invalid backend or flag: %s\nPossible values: %s' % (ex, ', '.join(sorted(_flags_str2int.keys())))) + return result + + +cdef str _str_hex(object flag): + if isinstance(flag, integer_types): + return hex(flag) + return str(flag) + + +cpdef _check_flags(unsigned int flags): + cdef list as_list + flags &= libev.EVBACKEND_MASK + if not flags: + return + if not (flags & libev.EVBACKEND_ALL): + raise ValueError('Invalid value for backend: 0x%x' % flags) + if not (flags & libev.ev_supported_backends()): + as_list = [_str_hex(x) for x in _flags_to_list(flags)] + raise ValueError('Unsupported backend: %s' % '|'.join(as_list)) + + +cpdef _events_to_str(int events): + cdef list result = [] + cdef int c_flag + for (flag, string) in _events: + c_flag = flag + if events & c_flag: + result.append(string) + events = events & (~c_flag) + if not events: + break + if events: + result.append(hex(events)) + return '|'.join(result) + + +def supported_backends(): + return _flags_to_list(libev.ev_supported_backends()) + + +def recommended_backends(): + return _flags_to_list(libev.ev_recommended_backends()) + + +def embeddable_backends(): + return _flags_to_list(libev.ev_embeddable_backends()) + + +def time(): + return libev.ev_time() + +cdef bint _check_loop(loop loop) except -1: + if not loop._ptr: + raise ValueError('operation on destroyed loop') + return 1 + + + +cdef public class callback [object PyGeventCallbackObject, type PyGeventCallback_Type]: + cdef public object callback + cdef public tuple args + cdef callback next + + def __init__(self, callback, args): + self.callback = callback + self.args = args + + def stop(self): + self.callback = None + self.args = None + + close = stop + + # Note, that __nonzero__ and pending are different + # nonzero is used in contexts where we need to know whether to schedule another callback, + # so it's true if it's pending or currently running + # 'pending' has the same meaning as libev watchers: it is cleared before entering callback + + def __nonzero__(self): + # it's nonzero if it's pending or currently executing + return self.args is not None + + @property + def pending(self): + return self.callback is not None + + def __repr__(self): + if Py_ReprEnter(self) != 0: + return "<...>" + try: + format = self._format() + result = "<%s at 0x%x%s" % (self.__class__.__name__, id(self), format) + if self.pending: + result += " pending" + if self.callback is not None: + result += " callback=%r" % (self.callback, ) + if self.args is not None: + result += " args=%r" % (self.args, ) + if self.callback is None and self.args is None: + result += " stopped" + return result + ">" + finally: + Py_ReprLeave(self) + + def _format(self): + return '' + +DEF CALLBACK_CHECK_COUNT = 50 + +@cython.final +@cython.internal +cdef class CallbackFIFO(object): + cdef callback head + cdef callback tail + + def __init__(self): + self.head = None + self.tail = None + + cdef inline callback popleft(self): + cdef callback head = self.head + self.head = head.next + if self.head is self.tail or self.head is None: + self.tail = None + head.next = None + return head + + + cdef inline append(self, callback new_tail): + assert not new_tail.next + if self.tail is None: + if self.head is None: + # Completely empty, so this + # is now our head + self.head = new_tail + return + self.tail = self.head + + + assert self.head is not None + old_tail = self.tail + old_tail.next = new_tail + self.tail = new_tail + + def __nonzero__(self): + return self.head is not None + + def __len__(self): + cdef Py_ssize_t count = 0 + head = self.head + while head is not None: + count += 1 + head = head.next + return count + + def __iter__(self): + cdef list objects = [] + head = self.head + while head is not None: + objects.append(head) + head = head.next + return iter(objects) + + cdef bint has_callbacks(self): + return self.head + + def __repr__(self): + return "" % (id(self), len(self), self.head, self.tail) + + +cdef public class loop [object PyGeventLoopObject, type PyGeventLoop_Type]: + ## embedded struct members + cdef libev.ev_prepare _prepare + cdef libev.ev_timer _timer0 + # We'll only actually start this timer if we're on Windows, + # but it doesn't hurt to compile it in on all platforms. + cdef libev.ev_timer _periodic_signal_checker + + ## pointer members + cdef public object error_handler + cdef libev.ev_loop* _ptr + cdef public CallbackFIFO _callbacks + + ## data members + cdef bint starting_timer_may_update_loop_time + # We must capture the 'default' state at initialiaztion + # time. Destroying the default loop in libev sets + # the libev internal pointer to 0, and ev_is_default_loop will + # no longer work. + cdef bint _default + cdef readonly double approx_timer_resolution + + def __cinit__(self, object flags=None, object default=None, libev.intptr_t ptr=0): + self.starting_timer_may_update_loop_time = 0 + self._default = 0 + libev.ev_prepare_init(&self._prepare, + gevent_run_callbacks) + libev.ev_timer_init(&self._periodic_signal_checker, + gevent_periodic_signal_check, + 0.3, 0.3) + libev.ev_timer_init(&self._timer0, + gevent_noop, + 0.0, 0.0) + + cdef unsigned int c_flags + cdef object old_handler = None + if ptr: + self._ptr = ptr + self._default = libev.ev_is_default_loop(self._ptr) + else: + c_flags = _flags_to_int(flags) + _check_flags(c_flags) + c_flags |= libev.EVFLAG_NOENV + c_flags |= libev.EVFLAG_FORKCHECK + if default is None: + default = True + if default: + self._default = 1 + self._ptr = libev.gevent_ev_default_loop(c_flags) + if not self._ptr: + raise SystemError("ev_default_loop(%s) failed" % (c_flags, )) + if sys.platform == "win32": + libev.ev_timer_start(self._ptr, &self._periodic_signal_checker) + libev.ev_unref(self._ptr) + else: + self._ptr = libev.ev_loop_new(c_flags) + if not self._ptr: + raise SystemError("ev_loop_new(%s) failed" % (c_flags, )) + if default or __SYSERR_CALLBACK is None: + set_syserr_cb(self._handle_syserr) + + # Mark as not destroyed + libev.ev_set_userdata(self._ptr, self._ptr) + + libev.ev_prepare_start(self._ptr, &self._prepare) + libev.ev_unref(self._ptr) + + def __init__(self, object flags=None, object default=None, libev.intptr_t ptr=0): + self._callbacks = CallbackFIFO() + # See libev.corecffi for this attribute. + self.approx_timer_resolution = 0.00001 + + cdef _run_callbacks(self): + cdef callback cb + cdef object callbacks + cdef int count = CALLBACK_CHECK_COUNT + self.starting_timer_may_update_loop_time = True + cdef libev.ev_tstamp now = libev.ev_now(self._ptr) + cdef libev.ev_tstamp expiration = now + getswitchinterval() + + try: + libev.ev_timer_stop(self._ptr, &self._timer0) + while self._callbacks.head is not None: + cb = self._callbacks.popleft() + + libev.ev_unref(self._ptr) + gevent_call(self, cb) # XXX: Why is this a C callback, not cython? + count -= 1 + + if count == 0 and self._callbacks.head is not None: + # We still have more to run but we've reached + # the end of one check group + count = CALLBACK_CHECK_COUNT + + libev.ev_now_update(self._ptr) + if libev.ev_now(self._ptr) >= expiration: + now = 0 + break + + if now != 0: + libev.ev_now_update(self._ptr) + if self._callbacks.head is not None: + libev.ev_timer_start(self._ptr, &self._timer0) + finally: + self.starting_timer_may_update_loop_time = False + + cdef _stop_watchers(self, libev.ev_loop* ptr): + if not ptr: + return + + if libev.ev_is_active(&self._prepare): + libev.ev_ref(ptr) + libev.ev_prepare_stop(ptr, &self._prepare) + if libev.ev_is_active(&self._periodic_signal_checker): + libev.ev_ref(ptr) + libev.ev_timer_stop(ptr, &self._periodic_signal_checker) + + def destroy(self): + cdef libev.ev_loop* ptr = self._ptr + self._ptr = NULL + + if ptr: + if not libev.ev_userdata(ptr): + # Whoops! Program error. They destroyed the loop, + # using a different loop object. Our _ptr is still + # valid, but the libev loop is gone. Doing anything + # else with it will likely cause a crash. + return + # Mark as destroyed + libev.ev_set_userdata(ptr, NULL) + self._stop_watchers(ptr) + if __SYSERR_CALLBACK == self._handle_syserr: + set_syserr_cb(None) + libev.ev_loop_destroy(ptr) + + def __dealloc__(self): + cdef libev.ev_loop* ptr = self._ptr + self._ptr = NULL + if ptr != NULL: + if not libev.ev_userdata(ptr): + # See destroy(). This is a bug in the caller. + return + self._stop_watchers(ptr) + if not self._default: + libev.ev_loop_destroy(ptr) + # Mark as destroyed + libev.ev_set_userdata(ptr, NULL) + + @property + def ptr(self): + return self._ptr + + @property + def WatcherType(self): + return watcher + + @property + def MAXPRI(self): + return libev.EV_MAXPRI + + @property + def MINPRI(self): + return libev.EV_MINPRI + + def _handle_syserr(self, message, errno): + if sys.version_info[0] >= 3: + message = message.decode() + self.handle_error(None, SystemError, SystemError(message + ': ' + os.strerror(errno)), None) + + cpdef handle_error(self, context, type, value, tb): + cdef object handle_error + cdef object error_handler = self.error_handler + if error_handler is not None: + # we do want to do getattr every time so that setting Hub.handle_error property just works + handle_error = getattr(error_handler, 'handle_error', error_handler) + handle_error(context, type, value, tb) + else: + self._default_handle_error(context, type, value, tb) + + cpdef _default_handle_error(self, context, type, value, tb): + # note: Hub sets its own error handler so this is not used by gevent + # this is here to make core.loop usable without the rest of gevent + traceback.print_exception(type, value, tb) + if self._ptr: + libev.ev_break(self._ptr, libev.EVBREAK_ONE) + + def run(self, nowait=False, once=False): + _check_loop(self) + cdef unsigned int flags = 0 + if nowait: + flags |= libev.EVRUN_NOWAIT + if once: + flags |= libev.EVRUN_ONCE + with nogil: + libev.ev_run(self._ptr, flags) + + def reinit(self): + if self._ptr: + libev.ev_loop_fork(self._ptr) + + def ref(self): + _check_loop(self) + libev.ev_ref(self._ptr) + + def unref(self): + _check_loop(self) + libev.ev_unref(self._ptr) + + def break_(self, int how=libev.EVBREAK_ONE): + _check_loop(self) + libev.ev_break(self._ptr, how) + + def verify(self): + _check_loop(self) + libev.ev_verify(self._ptr) + + cpdef libev.ev_tstamp now(self) except *: + _check_loop(self) + return libev.ev_now(self._ptr) + + cpdef void update_now(self) except *: + _check_loop(self) + libev.ev_now_update(self._ptr) + + update = update_now # Old name, deprecated. + + def __repr__(self): + return '<%s at 0x%x %s>' % (self.__class__.__name__, id(self), self._format()) + + @property + def default(self): + # If we're destroyed, we are not the default loop anymore, + # as far as Python is concerned. + return self._default if self._ptr else False + + @property + def iteration(self): + _check_loop(self) + return libev.ev_iteration(self._ptr) + + @property + def depth(self): + _check_loop(self) + return libev.ev_depth(self._ptr) + + @property + def backend_int(self): + _check_loop(self) + return libev.ev_backend(self._ptr) + + @property + def backend(self): + _check_loop(self) + cdef unsigned int backend = libev.ev_backend(self._ptr) + for key, value in _flags: + if key == backend: + return value + return backend + + @property + def pendingcnt(self): + _check_loop(self) + return libev.ev_pending_count(self._ptr) + + def io(self, libev.vfd_socket_t fd, int events, ref=True, priority=None): + return io(self, fd, events, ref, priority) + + def timer(self, double after, double repeat=0.0, ref=True, priority=None): + return timer(self, after, repeat, ref, priority) + + def signal(self, int signum, ref=True, priority=None): + return signal(self, signum, ref, priority) + + def idle(self, ref=True, priority=None): + return idle(self, ref, priority) + + def prepare(self, ref=True, priority=None): + return prepare(self, ref, priority) + + def check(self, ref=True, priority=None): + return check(self, ref, priority) + + def fork(self, ref=True, priority=None): + return fork(self, ref, priority) + + def async_(self, ref=True, priority=None): + return async_(self, ref, priority) + + # cython doesn't enforce async as a keyword + async = async_ + + def child(self, int pid, bint trace=0, ref=True): + if sys.platform == 'win32': + raise AttributeError("Child watchers are not supported on Windows") + return child(self, pid, trace, ref) + + def install_sigchld(self): + libev.gevent_install_sigchld_handler() + + def reset_sigchld(self): + libev.gevent_reset_sigchld_handler() + + def stat(self, str path, float interval=0.0, ref=True, priority=None): + return stat(self, path, interval, ref, priority) + + def run_callback(self, func, *args): + _check_loop(self) + cdef callback cb = callback(func, args) + self._callbacks.append(cb) + libev.ev_ref(self._ptr) + return cb + + def _format(self): + if not self._ptr: + return 'destroyed' + cdef object msg = self.backend + if self._default: + msg += ' default' + msg += ' pending=%s' % self.pendingcnt + msg += self._format_details() + return msg + + def _format_details(self): + cdef str msg = '' + cdef object fileno = self.fileno() + cdef object activecnt = None + try: + sigfd = self.sigfd + except AttributeError: + sigfd = None + try: + activecnt = self.activecnt + except AttributeError: + pass + if activecnt is not None: + msg += ' ref=' + repr(activecnt) + if fileno is not None: + msg += ' fileno=' + repr(fileno) + return msg + + def fileno(self): + cdef int fd + if self._ptr: + fd = libev.gevent_ev_loop_backend_fd(self._ptr) + if fd >= 0: + return fd + + @property + def activecnt(self): + _check_loop(self) + return libev.gevent_ev_loop_activecnt(self._ptr) + + @property + def sig_pending(self): + _check_loop(self) + return libev.gevent_ev_loop_sig_pending(self._ptr) + + @property + def origflags(self): + return _flags_to_list(self.origflags_int) + + @property + def origflags_int(self): + _check_loop(self) + return libev.gevent_ev_loop_origflags(self._ptr) + + @property + def sigfd(self): + _check_loop(self) + fd = libev.gevent_ev_loop_sigfd(self._ptr) + if fd >= 0: + return fd + + # Explicitly not EV_USE_SIGNALFD + raise AttributeError("sigfd") + +try: + from zope.interface import classImplements +except ImportError: + pass +else: + # XXX: This invokes the side-table lookup, we would + # prefer to have it stored directly on the class. + from gevent._interfaces import ILoop + classImplements(loop, ILoop) + +# about readonly _flags attribute: +# bit #1 set if object owns Python reference to itself (Py_INCREF was +# called and we must call Py_DECREF later) +DEF FLAG_WATCHER_OWNS_PYREF = 1 << 0 # 0x1 +# bit #2 set if ev_unref() was called and we must call ev_ref() later +DEF FLAG_WATCHER_NEEDS_EVREF = 1 << 1 # 0x2 +# bit #3 set if user wants to call ev_unref() before start() +DEF FLAG_WATCHER_UNREF_BEFORE_START = 1 << 2 # 0x4 +# bits 2 and 3 are *both* set when we are active, but the user +# request us not to be ref'd anymore. We unref us (because going active will +# ref us) and then make a note of this in the future +DEF FLAG_WATCHER_MASK_UNREF_NEEDS_REF = 0x6 + + +cdef void _python_incref(watcher self): + if not self._flags & FLAG_WATCHER_OWNS_PYREF: + Py_INCREF(self) + self._flags |= FLAG_WATCHER_OWNS_PYREF + +cdef void _python_decref(watcher self): + if self._flags & FLAG_WATCHER_OWNS_PYREF: + Py_DECREF(self) + self._flags &= ~FLAG_WATCHER_OWNS_PYREF + +cdef void _libev_ref(watcher self): + if self._flags & FLAG_WATCHER_NEEDS_EVREF: + libev.ev_ref(self.loop._ptr) + self._flags &= ~FLAG_WATCHER_NEEDS_EVREF + +cdef void _libev_unref(watcher self): + if self._flags & FLAG_WATCHER_MASK_UNREF_NEEDS_REF == FLAG_WATCHER_UNREF_BEFORE_START: + libev.ev_unref(self.loop._ptr) + self._flags |= FLAG_WATCHER_NEEDS_EVREF + + +ctypedef void (*start_stop_func)(libev.ev_loop*, void*) nogil + +cdef struct start_and_stop: + start_stop_func start + start_stop_func stop + +cdef start_and_stop make_ss(void* start, void* stop): + cdef start_and_stop result = start_and_stop(start, stop) + return result + +cdef bint _watcher_start(watcher self, object callback, tuple args) except -1: + # This method should be called by subclasses of watcher, if they + # override the python-level `start` function: they've already paid + # for argument unpacking, and `start` cannot be cpdef since it + # uses varargs. + + # We keep this as a function, not a cdef method of watcher. + # If it's a cdef method, it could potentially be overridden + # by a subclass, which means that the watcher gains a pointer to a + # function table (vtable), making each object 8 bytes larger. + + _check_loop(self.loop) + if callback is None or not callable(callback): + raise TypeError("Expected callable, not %r" % (callback, )) + self._callback = callback + self.args = args + _libev_unref(self) + _python_incref(self) + self.__ss.start(self.loop._ptr, self.__watcher) + return 1 + +cdef public class watcher [object PyGeventWatcherObject, type PyGeventWatcher_Type]: + """Abstract base class for all the watchers""" + ## pointer members + cdef public loop loop + cdef object _callback + cdef public tuple args + + # By keeping a __watcher cached, the size of the io and timer + # structs becomes 152 bytes and child is 160 and stat is 512 (when + # the start_and_stop is inlined). On 64-bit macOS CPython 2.7. I + # hoped that using libev's data pointer and allocating the + # watchers directly and not as inline members would result in + # overall savings thanks to better padding, but it didn't. And it + # added lots of casts, making the code ugly. + + # Table: + # gevent ver | 1.2 | This | +data + # Watcher Kind | | | + # Timer | 120 | 152 | 160 + # IO | 120 | 152 | 160 + # Child | 128 | 160 | 168 + # Stat | 480 | 512 | 512 + cdef libev.ev_watcher* __watcher + + # By inlining the start_and_stop struct, instead of taking the address + # of a static struct or using the watcher's data pointer, we + # use an additional pointer of memory and incur an additional pointer copy + # on creation. + # But we use fewer pointer accesses for start/stop, and they have + # better cache locality. (Then again, we're bigger). + # Right now we're going for size, so we use the pointer. IO/Timer objects + # are then 144 bytes. + cdef start_and_stop* __ss + + ## Int members + + # Our subclasses will declare the ev_X struct + # as an inline member. This is good for locality, but + # probably bad for alignment, as it will get tacked on + # immediately after our data. + + # But all ev_watchers start with some ints, so maybe we can help that + # out by putting our ints here. + cdef readonly unsigned int _flags + + def __init__(self, loop loop, ref=True, priority=None): + if not self.__watcher or not self.__ss.start or not self.__ss.stop: + raise ValueError("Cannot construct a bare watcher") + self.loop = loop + self._flags = 0 if ref else FLAG_WATCHER_UNREF_BEFORE_START + if priority is not None: + libev.ev_set_priority(self.__watcher, priority) + + @property + def ref(self): + return False if self._flags & 4 else True + + @ref.setter + def ref(self, object value): + _check_loop(self.loop) + if value: + # self.ref should be true after this. + if self.ref: + return # ref is already True + + if self._flags & FLAG_WATCHER_NEEDS_EVREF: # ev_unref was called, undo + libev.ev_ref(self.loop._ptr) + # do not want unref, no outstanding unref + self._flags &= ~FLAG_WATCHER_MASK_UNREF_NEEDS_REF + else: + # self.ref must be false after this + if not self.ref: + return # ref is already False + self._flags |= FLAG_WATCHER_UNREF_BEFORE_START + if not self._flags & FLAG_WATCHER_NEEDS_EVREF and libev.ev_is_active(self.__watcher): + libev.ev_unref(self.loop._ptr) + self._flags |= FLAG_WATCHER_NEEDS_EVREF + + @property + def callback(self): + return self._callback + + @callback.setter + def callback(self, object callback): + if callback is not None and not callable(callback): + raise TypeError("Expected callable, not %r" % (callback, )) + self._callback = callback + + @property + def priority(self): + return libev.ev_priority(self.__watcher) + + @priority.setter + def priority(self, int priority): + cdef libev.ev_watcher* w = self.__watcher + if libev.ev_is_active(w): + raise AttributeError("Cannot set priority of an active watcher") + libev.ev_set_priority(w, priority) + + @property + def active(self): + return True if libev.ev_is_active(self.__watcher) else False + + @property + def pending(self): + return True if libev.ev_is_pending(self.__watcher) else False + + def start(self, object callback, *args): + _watcher_start(self, callback, args) + + def stop(self): + _check_loop(self.loop) + _libev_ref(self) + # The callback cannot possibly fire while we are executing, + # so this is safe. + self._callback = None + self.args = None + self.__ss.stop(self.loop._ptr, self.__watcher) + _python_decref(self) + + def feed(self, int revents, object callback, *args): + _check_loop(self.loop) + self.callback = callback + self.args = args + _libev_unref(self) + libev.ev_feed_event(self.loop._ptr, self.__watcher, revents) + _python_incref(self) + + def __repr__(self): + if Py_ReprEnter(self) != 0: + return "<...>" + try: + format = self._format() + result = "<%s at 0x%x%s" % (self.__class__.__name__, id(self), format) + if self.active: + result += " active" + if self.pending: + result += " pending" + if self.callback is not None: + result += " callback=%r" % (self.callback, ) + if self.args is not None: + result += " args=%r" % (self.args, ) + return result + ">" + finally: + Py_ReprLeave(self) + + def _format(self): + return '' + + def close(self): + self.stop() + + def __enter__(self): + return self + + def __exit__(self, t, v, tb): + self.close() + return + +cdef start_and_stop io_ss = make_ss(libev.ev_io_start, libev.ev_io_stop) + +cdef public class io(watcher) [object PyGeventIOObject, type PyGeventIO_Type]: + + cdef libev.ev_io _watcher + + def start(self, object callback, *args, pass_events=False): + if pass_events: + args = (GEVENT_CORE_EVENTS, ) + args + _watcher_start(self, callback, args) + + def __init__(self, loop loop, libev.vfd_socket_t fd, int events, ref=True, priority=None): + watcher.__init__(self, loop, ref, priority) + + def __cinit__(self, loop loop, libev.vfd_socket_t fd, int events, ref=True, priority=None): + if fd < 0: + raise ValueError('fd must be non-negative: %r' % fd) + if events & ~(libev.EV__IOFDSET | libev.EV_READ | libev.EV_WRITE): + raise ValueError('illegal event mask: %r' % events) + # All the vfd_functions are no-ops on POSIX + cdef int vfd = libev.vfd_open(fd) + libev.ev_io_init(&self._watcher, gevent_callback_io, vfd, events) + self.__watcher = &self._watcher + self.__ss = &io_ss + + def __dealloc__(self): + libev.vfd_free(self._watcher.fd) + + @property + def fd(self): + return libev.vfd_get(self._watcher.fd) + + @fd.setter + def fd(self, long fd): + if libev.ev_is_active(&self._watcher): + raise AttributeError("'io' watcher attribute 'fd' is read-only while watcher is active") + cdef int vfd = libev.vfd_open(fd) + libev.vfd_free(self._watcher.fd) + libev.ev_io_init(&self._watcher, gevent_callback_io, vfd, self._watcher.events) + + @property + def events(self): + return self._watcher.events + + @events.setter + def events(self, int events): + if libev.ev_is_active(&self._watcher): + raise AttributeError("'io' watcher attribute 'events' is read-only while watcher is active") + libev.ev_io_init(&self._watcher, gevent_callback_io, self._watcher.fd, events) + + @property + def events_str(self): + return _events_to_str(self._watcher.events) + + def _format(self): + return ' fd=%s events=%s' % (self.fd, self.events_str) + +cdef start_and_stop timer_ss = make_ss(libev.ev_timer_start, libev.ev_timer_stop) + +cdef public class timer(watcher) [object PyGeventTimerObject, type PyGeventTimer_Type]: + + cdef libev.ev_timer _watcher + + def __cinit__(self, loop loop, double after=0.0, double repeat=0.0, ref=True, priority=None): + if repeat < 0.0: + raise ValueError("repeat must be positive or zero: %r" % repeat) + libev.ev_timer_init(&self._watcher, gevent_callback_timer, after, repeat) + self.__watcher = &self._watcher + self.__ss = &timer_ss + + def __init__(self, loop loop, double after=0.0, double repeat=0.0, ref=True, priority=None): + watcher.__init__(self, loop, ref, priority) + + def start(self, object callback, *args, update=None): + update = update if update is not None else self.loop.starting_timer_may_update_loop_time + if update: + self.loop.update_now() + _watcher_start(self, callback, args) + + @property + def at(self): + return self._watcher.at + + # QQQ: add 'after' and 'repeat' properties? + + def again(self, object callback, *args, update=True): + _check_loop(self.loop) + self.callback = callback + self.args = args + _libev_unref(self) + if update: + libev.ev_now_update(self.loop._ptr) + libev.ev_timer_again(self.loop._ptr, &self._watcher) + _python_incref(self) + + + +cdef start_and_stop signal_ss = make_ss(libev.ev_signal_start, libev.ev_signal_stop) + +cdef public class signal(watcher) [object PyGeventSignalObject, type PyGeventSignal_Type]: + + cdef libev.ev_signal _watcher + + def __cinit__(self, loop loop, int signalnum, ref=True, priority=None): + if signalnum < 1 or signalnum >= signalmodule.NSIG: + raise ValueError('illegal signal number: %r' % signalnum) + # still possible to crash on one of libev's asserts: + # 1) "libev: ev_signal_start called with illegal signal number" + # EV_NSIG might be different from signal.NSIG on some platforms + # 2) "libev: a signal must not be attached to two different loops" + # we probably could check that in LIBEV_EMBED mode, but not in general + libev.ev_signal_init(&self._watcher, gevent_callback_signal, signalnum) + self.__watcher = &self._watcher + self.__ss = &signal_ss + + def __init__(self, loop loop, int signalnum, ref=True, priority=None): + watcher.__init__(self, loop, ref, priority) + + + +cdef start_and_stop idle_ss = make_ss(libev.ev_idle_start, libev.ev_idle_stop) + +cdef public class idle(watcher) [object PyGeventIdleObject, type PyGeventIdle_Type]: + + cdef libev.ev_idle _watcher + + def __cinit__(self, loop loop, ref=True, priority=None): + libev.ev_idle_init(&self._watcher, gevent_callback_idle) + self.__watcher = &self._watcher + self.__ss = &idle_ss + + + +cdef start_and_stop prepare_ss = make_ss(libev.ev_prepare_start, libev.ev_prepare_stop) + +cdef public class prepare(watcher) [object PyGeventPrepareObject, type PyGeventPrepare_Type]: + + cdef libev.ev_prepare _watcher + + def __cinit__(self, loop loop, ref=True, priority=None): + libev.ev_prepare_init(&self._watcher, gevent_callback_prepare) + self.__watcher = &self._watcher + self.__ss = &prepare_ss + + + +cdef start_and_stop check_ss = make_ss(libev.ev_check_start, libev.ev_check_stop) + +cdef public class check(watcher) [object PyGeventCheckObject, type PyGeventCheck_Type]: + + cdef libev.ev_check _watcher + + def __cinit__(self, loop loop, ref=True, priority=None): + libev.ev_check_init(&self._watcher, gevent_callback_check) + self.__watcher = &self._watcher + self.__ss = &check_ss + + + +cdef start_and_stop fork_ss = make_ss(libev.ev_fork_start, libev.ev_fork_stop) + +cdef public class fork(watcher) [object PyGeventForkObject, type PyGeventFork_Type]: + + cdef libev.ev_fork _watcher + + def __cinit__(self, loop loop, ref=True, priority=None): + libev.ev_fork_init(&self._watcher, gevent_callback_fork) + self.__watcher = &self._watcher + self.__ss = &fork_ss + + +cdef start_and_stop async_ss = make_ss(libev.ev_async_start, libev.ev_async_stop) + +cdef public class async_(watcher) [object PyGeventAsyncObject, type PyGeventAsync_Type]: + + cdef libev.ev_async _watcher + + @property + def pending(self): + # Note the use of ev_async_pending instead of ev_is_pending + return True if libev.ev_async_pending(&self._watcher) else False + + def __cinit__(self, loop loop, ref=True, priority=None): + libev.ev_async_init(&self._watcher, gevent_callback_async) + self.__watcher = &self._watcher + self.__ss = &async_ss + + + def send(self): + _check_loop(self.loop) + libev.ev_async_send(self.loop._ptr, &self._watcher) + +async = async_ + +cdef start_and_stop child_ss = make_ss(libev.ev_child_start, libev.ev_child_stop) + +cdef public class child(watcher) [object PyGeventChildObject, type PyGeventChild_Type]: + + cdef libev.ev_child _watcher + + def __cinit__(self, loop loop, int pid, bint trace=0, ref=True): + if sys.platform == 'win32': + raise AttributeError("Child watchers are not supported on Windows") + if not loop.default: + raise TypeError('child watchers are only available on the default loop') + libev.gevent_install_sigchld_handler() + libev.ev_child_init(&self._watcher, gevent_callback_child, pid, trace) + self.__watcher = &self._watcher + self.__ss = &child_ss + + def __init__(self, loop loop, int pid, bint trace=0, ref=True): + watcher.__init__(self, loop, ref, None) + + + def _format(self): + return ' pid=%r rstatus=%r' % (self.pid, self.rstatus) + + @property + def pid(self): + return self._watcher.pid + + @property + def rpid(self): + return self._watcher.rpid + + @rpid.setter + def rpid(self, int value): + self._watcher.rpid = value + + @property + def rstatus(self): + return self._watcher.rstatus + + @rstatus.setter + def rstatus(self, int value): + self._watcher.rstatus = value + +cdef start_and_stop stat_ss = make_ss(libev.ev_stat_start, libev.ev_stat_stop) + +cdef public class stat(watcher) [object PyGeventStatObject, type PyGeventStat_Type]: + + cdef libev.ev_stat _watcher + cdef readonly str path + cdef readonly bytes _paths + + def __cinit__(self, loop loop, str path, float interval=0.0, ref=True, priority=None): + self.path = path + cdef bytes paths + if isinstance(path, unicode): + # the famous Python3 filesystem encoding debacle hits us here. Can we do better? + # We must keep a reference to the encoded string so that its bytes don't get freed + # and overwritten, leading to strange errors from libev ("no such file or directory") + paths = (path).encode(sys.getfilesystemencoding()) + self._paths = paths + else: + paths = path + self._paths = paths + libev.ev_stat_init(&self._watcher, gevent_callback_stat, paths, interval) + self.__watcher = &self._watcher + self.__ss = &stat_ss + + def __init__(self, loop loop, str path, float interval=0.0, ref=True, priority=None): + watcher.__init__(self, loop, ref, priority) + + + @property + def attr(self): + if not self._watcher.attr.st_nlink: + return + return _pystat_fromstructstat(&self._watcher.attr) + + @property + def prev(self): + if not self._watcher.prev.st_nlink: + return + return _pystat_fromstructstat(&self._watcher.prev) + + @property + def interval(self): + return self._watcher.interval + + + +__SYSERR_CALLBACK = None + + +cdef void _syserr_cb(char* msg) with gil: + try: + __SYSERR_CALLBACK(msg, errno) + except: + set_syserr_cb(None) + print_exc = getattr(traceback, 'print_exc', None) + if print_exc is not None: + print_exc() + + +cpdef set_syserr_cb(callback): + global __SYSERR_CALLBACK + if callback is None: + libev.ev_set_syserr_cb(NULL) + __SYSERR_CALLBACK = None + elif callable(callback): + libev.ev_set_syserr_cb(_syserr_cb) + __SYSERR_CALLBACK = callback + else: + raise TypeError('Expected callable or None, got %r' % (callback, )) + + + +LIBEV_EMBED = bool(libev.LIBEV_EMBED) +EV_USE_FLOOR = libev.EV_USE_FLOOR +EV_USE_CLOCK_SYSCALL = libev.EV_USE_CLOCK_SYSCALL +EV_USE_REALTIME = libev.EV_USE_REALTIME +EV_USE_MONOTONIC = libev.EV_USE_MONOTONIC +EV_USE_NANOSLEEP = libev.EV_USE_NANOSLEEP +EV_USE_INOTIFY = libev.EV_USE_INOTIFY +EV_USE_SIGNALFD = libev.EV_USE_SIGNALFD +EV_USE_EVENTFD = libev.EV_USE_EVENTFD +EV_USE_4HEAP = libev.EV_USE_4HEAP + +# Things used in callbacks.c + +from cpython cimport PyErr_Fetch +from cpython cimport PyObject + +cdef public void gevent_handle_error(loop loop, object context): + cdef PyObject* typep + cdef PyObject* valuep + cdef PyObject* tracebackp + + cdef object type + cdef object value = None + cdef object traceback = None + cdef object result + + # If it was set, this will clear it, and we will own + # the references. + PyErr_Fetch(&typep, &valuep, &tracebackp) + # TODO: Should we call PyErr_Normalize? There's code in + # Hub.handle_error that works around what looks like an + # unnormalized exception. + + if not typep: + return + # This assignment will do a Py_INCREF + # on the value. We already own the reference + # returned from PyErr_Fetch, + # so we must decref immediately + type = typep + Py_DECREF(type) + + if valuep: + value = valuep + Py_DECREF(value) + if tracebackp: + traceback = tracebackp + Py_DECREF(traceback) + + # If this method fails by raising an exception, + # cython will print it for us because we don't return a + # Python object and we don't declare an `except` clause. + loop.handle_error(context, type, value, traceback) + +cdef public tuple _empty_tuple = () + +cdef public object gevent_loop_run_callbacks(loop loop): + return loop._run_callbacks() diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/libev/corecffi.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/libev/corecffi.py new file mode 100644 index 00000000..51701c43 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/libev/corecffi.py @@ -0,0 +1,427 @@ +# pylint: disable=too-many-lines, protected-access, redefined-outer-name, not-callable +# pylint: disable=no-member +from __future__ import absolute_import, print_function +import sys + +# pylint: disable=undefined-all-variable +__all__ = [ + 'get_version', + 'get_header_version', + 'supported_backends', + 'recommended_backends', + 'embeddable_backends', + 'time', + 'loop', +] + +from gevent._util import implementer +from gevent._interfaces import ILoop + +from gevent.libev import _corecffi # pylint:disable=no-name-in-module,import-error + +ffi = _corecffi.ffi # pylint:disable=no-member +libev = _corecffi.lib # pylint:disable=no-member + +if hasattr(libev, 'vfd_open'): + # Must be on windows + assert sys.platform.startswith("win"), "vfd functions only needed on windows" + vfd_open = libev.vfd_open + vfd_free = libev.vfd_free + vfd_get = libev.vfd_get +else: + vfd_open = vfd_free = vfd_get = lambda fd: fd + +##### +## NOTE on Windows: +# The C implementation does several things specially for Windows; +# a possibly incomplete list is: +# +# - the loop runs a periodic signal checker; +# - the io watcher constructor is different and it has a destructor; +# - the child watcher is not defined +# +# The CFFI implementation does none of these things, and so +# is possibly NOT FUNCTIONALLY CORRECT on Win32 +##### + + +from gevent._ffi.loop import AbstractCallbacks +from gevent._ffi.loop import assign_standard_callbacks + +class _Callbacks(AbstractCallbacks): + # pylint:disable=arguments-differ + + def python_check_callback(self, _loop, watcher_ptr, _events): + pass + + def python_prepare_callback(self, _loop_ptr, watcher_ptr, _events): + AbstractCallbacks.python_prepare_callback(self, watcher_ptr) + + def _find_loop_from_c_watcher(self, watcher_ptr): + loop_handle = ffi.cast('struct ev_watcher*', watcher_ptr).data + return self.from_handle(loop_handle) + +_callbacks = assign_standard_callbacks(ffi, libev, _Callbacks) + + +UNDEF = libev.EV_UNDEF +NONE = libev.EV_NONE +READ = libev.EV_READ +WRITE = libev.EV_WRITE +TIMER = libev.EV_TIMER +PERIODIC = libev.EV_PERIODIC +SIGNAL = libev.EV_SIGNAL +CHILD = libev.EV_CHILD +STAT = libev.EV_STAT +IDLE = libev.EV_IDLE +PREPARE = libev.EV_PREPARE +CHECK = libev.EV_CHECK +EMBED = libev.EV_EMBED +FORK = libev.EV_FORK +CLEANUP = libev.EV_CLEANUP +ASYNC = libev.EV_ASYNC +CUSTOM = libev.EV_CUSTOM +ERROR = libev.EV_ERROR + +READWRITE = libev.EV_READ | libev.EV_WRITE + +MINPRI = libev.EV_MINPRI +MAXPRI = libev.EV_MAXPRI + +BACKEND_PORT = libev.EVBACKEND_PORT +BACKEND_KQUEUE = libev.EVBACKEND_KQUEUE +BACKEND_EPOLL = libev.EVBACKEND_EPOLL +BACKEND_POLL = libev.EVBACKEND_POLL +BACKEND_SELECT = libev.EVBACKEND_SELECT +FORKCHECK = libev.EVFLAG_FORKCHECK +NOINOTIFY = libev.EVFLAG_NOINOTIFY +SIGNALFD = libev.EVFLAG_SIGNALFD +NOSIGMASK = libev.EVFLAG_NOSIGMASK + + +from gevent._ffi.loop import EVENTS +GEVENT_CORE_EVENTS = EVENTS + + +def get_version(): + return 'libev-%d.%02d' % (libev.ev_version_major(), libev.ev_version_minor()) + + +def get_header_version(): + return 'libev-%d.%02d' % (libev.EV_VERSION_MAJOR, libev.EV_VERSION_MINOR) + +_flags = [(libev.EVBACKEND_PORT, 'port'), + (libev.EVBACKEND_KQUEUE, 'kqueue'), + (libev.EVBACKEND_EPOLL, 'epoll'), + (libev.EVBACKEND_POLL, 'poll'), + (libev.EVBACKEND_SELECT, 'select'), + (libev.EVFLAG_NOENV, 'noenv'), + (libev.EVFLAG_FORKCHECK, 'forkcheck'), + (libev.EVFLAG_SIGNALFD, 'signalfd'), + (libev.EVFLAG_NOSIGMASK, 'nosigmask')] + +_flags_str2int = dict((string, flag) for (flag, string) in _flags) + + + +def _flags_to_list(flags): + result = [] + for code, value in _flags: + if flags & code: + result.append(value) + flags &= ~code + if not flags: + break + if flags: + result.append(flags) + return result + +if sys.version_info[0] >= 3: + basestring = (bytes, str) + integer_types = (int,) +else: + import __builtin__ # pylint:disable=import-error + basestring = (__builtin__.basestring,) + integer_types = (int, __builtin__.long) + + +def _flags_to_int(flags): + # Note, that order does not matter, libev has its own predefined order + if not flags: + return 0 + if isinstance(flags, integer_types): + return flags + result = 0 + try: + if isinstance(flags, basestring): + flags = flags.split(',') + for value in flags: + value = value.strip().lower() + if value: + result |= _flags_str2int[value] + except KeyError as ex: + raise ValueError('Invalid backend or flag: %s\nPossible values: %s' % (ex, ', '.join(sorted(_flags_str2int.keys())))) + return result + + +def _str_hex(flag): + if isinstance(flag, integer_types): + return hex(flag) + return str(flag) + + +def _check_flags(flags): + as_list = [] + flags &= libev.EVBACKEND_MASK + if not flags: + return + if not flags & libev.EVBACKEND_ALL: + raise ValueError('Invalid value for backend: 0x%x' % flags) + if not flags & libev.ev_supported_backends(): + as_list = [_str_hex(x) for x in _flags_to_list(flags)] + raise ValueError('Unsupported backend: %s' % '|'.join(as_list)) + + +def supported_backends(): + return _flags_to_list(libev.ev_supported_backends()) + + +def recommended_backends(): + return _flags_to_list(libev.ev_recommended_backends()) + + +def embeddable_backends(): + return _flags_to_list(libev.ev_embeddable_backends()) + + +def time(): + return libev.ev_time() + +from gevent._ffi.loop import AbstractLoop + + +from gevent.libev import watcher as _watchers +_events_to_str = _watchers._events_to_str # exported + + +@implementer(ILoop) +class loop(AbstractLoop): + # pylint:disable=too-many-public-methods + + # libuv parameters simply won't accept anything lower than 1ms + # (0.001s), but libev takes fractional seconds. In practice, on + # one machine, libev can sleep for very small periods of time: + # + # sleep(0.00001) -> 0.000024 + # sleep(0.0001) -> 0.000156 + # sleep(0.001) -> 0.00136 (which is comparable to libuv) + + approx_timer_resolution = 0.00001 + + error_handler = None + + _CHECK_POINTER = 'struct ev_check *' + + _PREPARE_POINTER = 'struct ev_prepare *' + + _TIMER_POINTER = 'struct ev_timer *' + + def __init__(self, flags=None, default=None): + AbstractLoop.__init__(self, ffi, libev, _watchers, flags, default) + self._default = bool(libev.ev_is_default_loop(self._ptr)) + + def _init_loop(self, flags, default): + c_flags = _flags_to_int(flags) + _check_flags(c_flags) + c_flags |= libev.EVFLAG_NOENV + c_flags |= libev.EVFLAG_FORKCHECK + if default is None: + default = True + if default: + ptr = libev.gevent_ev_default_loop(c_flags) + if not ptr: + raise SystemError("ev_default_loop(%s) failed" % (c_flags, )) + else: + ptr = libev.ev_loop_new(c_flags) + if not ptr: + raise SystemError("ev_loop_new(%s) failed" % (c_flags, )) + if default or globals()["__SYSERR_CALLBACK"] is None: + set_syserr_cb(self._handle_syserr) + + # Mark this loop as being used. + libev.ev_set_userdata(ptr, ptr) + return ptr + + def _init_and_start_check(self): + libev.ev_check_init(self._check, libev.python_check_callback) + self._check.data = self._handle_to_self + libev.ev_check_start(self._ptr, self._check) + self.unref() + + def _init_and_start_prepare(self): + libev.ev_prepare_init(self._prepare, libev.python_prepare_callback) + libev.ev_prepare_start(self._ptr, self._prepare) + self.unref() + + def _init_callback_timer(self): + libev.ev_timer_init(self._timer0, libev.gevent_noop, 0.0, 0.0) + + def _stop_callback_timer(self): + libev.ev_timer_stop(self._ptr, self._timer0) + + def _start_callback_timer(self): + libev.ev_timer_start(self._ptr, self._timer0) + + def _stop_aux_watchers(self): + if libev.ev_is_active(self._prepare): + self.ref() + libev.ev_prepare_stop(self._ptr, self._prepare) + if libev.ev_is_active(self._check): + self.ref() + libev.ev_check_stop(self._ptr, self._check) + if libev.ev_is_active(self._timer0): + libev.ev_timer_stop(self._timer0) + + def _setup_for_run_callback(self): + self.ref() # we should go through the loop now + + def destroy(self): + if self._ptr: + super(loop, self).destroy() + # pylint:disable=comparison-with-callable + if globals()["__SYSERR_CALLBACK"] == self._handle_syserr: + set_syserr_cb(None) + + + def _can_destroy_loop(self, ptr): + # Is it marked as destroyed? + return libev.ev_userdata(ptr) + + def _destroy_loop(self, ptr): + # Mark as destroyed. + libev.ev_set_userdata(ptr, ffi.NULL) + libev.ev_loop_destroy(ptr) + + libev.gevent_zero_prepare(self._prepare) + libev.gevent_zero_check(self._check) + libev.gevent_zero_timer(self._timer0) + + del self._prepare + del self._check + del self._timer0 + + + @property + def MAXPRI(self): + return libev.EV_MAXPRI + + @property + def MINPRI(self): + return libev.EV_MINPRI + + def _default_handle_error(self, context, type, value, tb): # pylint:disable=unused-argument + super(loop, self)._default_handle_error(context, type, value, tb) + libev.ev_break(self._ptr, libev.EVBREAK_ONE) + + def run(self, nowait=False, once=False): + flags = 0 + if nowait: + flags |= libev.EVRUN_NOWAIT + if once: + flags |= libev.EVRUN_ONCE + + libev.ev_run(self._ptr, flags) + + def reinit(self): + libev.ev_loop_fork(self._ptr) + + def ref(self): + libev.ev_ref(self._ptr) + + def unref(self): + libev.ev_unref(self._ptr) + + def break_(self, how=libev.EVBREAK_ONE): + libev.ev_break(self._ptr, how) + + def verify(self): + libev.ev_verify(self._ptr) + + def now(self): + return libev.ev_now(self._ptr) + + def update_now(self): + libev.ev_now_update(self._ptr) + + def __repr__(self): + return '<%s at 0x%x %s>' % (self.__class__.__name__, id(self), self._format()) + + @property + def iteration(self): + return libev.ev_iteration(self._ptr) + + @property + def depth(self): + return libev.ev_depth(self._ptr) + + @property + def backend_int(self): + return libev.ev_backend(self._ptr) + + @property + def backend(self): + backend = libev.ev_backend(self._ptr) + for key, value in _flags: + if key == backend: + return value + return backend + + @property + def pendingcnt(self): + return libev.ev_pending_count(self._ptr) + + if sys.platform != "win32": + + def install_sigchld(self): + libev.gevent_install_sigchld_handler() + + def reset_sigchld(self): + libev.gevent_reset_sigchld_handler() + + def fileno(self): + if self._ptr: + fd = self._ptr.backend_fd + if fd >= 0: + return fd + + @property + def activecnt(self): + if not self._ptr: + raise ValueError('operation on destroyed loop') + return self._ptr.activecnt + + +@ffi.def_extern() +def _syserr_cb(msg): + try: + msg = ffi.string(msg) + __SYSERR_CALLBACK(msg, ffi.errno) + except: + set_syserr_cb(None) + raise # let cffi print the traceback + + +def set_syserr_cb(callback): + global __SYSERR_CALLBACK + if callback is None: + libev.ev_set_syserr_cb(ffi.NULL) + __SYSERR_CALLBACK = None + elif callable(callback): + libev.ev_set_syserr_cb(libev._syserr_cb) + __SYSERR_CALLBACK = callback + else: + raise TypeError('Expected callable or None, got %r' % (callback, )) + +__SYSERR_CALLBACK = None + +LIBEV_EMBED = True diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/libev/libev.h b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/libev/libev.h new file mode 100644 index 00000000..66959d9b --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/libev/libev.h @@ -0,0 +1,100 @@ +#if defined(LIBEV_EMBED) +#include "ev.c" +#undef LIBEV_EMBED +#define LIBEV_EMBED 1 +#define gevent_ev_loop_origflags(loop) ((loop)->origflags) +#define gevent_ev_loop_sig_pending(loop) ((loop))->sig_pending +#define gevent_ev_loop_backend_fd(loop) ((loop))->backend_fd +#define gevent_ev_loop_activecnt(loop) ((loop))->activecnt +#if EV_USE_SIGNALFD +#define gevent_ev_loop_sigfd(loop) ((loop))->sigfd +#else +#define gevent_ev_loop_sigfd(loop) -1 +#endif /* !EV_USE_SIGNALFD */ +#else /* !LIBEV_EMBED */ +#include "ev.h" + +#define gevent_ev_loop_origflags(loop) -1 +#define gevent_ev_loop_sig_pending(loop) -1 +#define gevent_ev_loop_backend_fd(loop) -1 +#define gevent_ev_loop_activecnt(loop) -1 +#define gevent_ev_loop_sigfd(loop) -1 + +#define LIBEV_EMBED 0 +#define EV_USE_FLOOR -1 +#define EV_USE_CLOCK_SYSCALL -1 +#define EV_USE_REALTIME -1 +#define EV_USE_MONOTONIC -1 +#define EV_USE_NANOSLEEP -1 +#define EV_USE_INOTIFY -1 +#define EV_USE_SIGNALFD -1 +#define EV_USE_EVENTFD -1 +#define EV_USE_4HEAP -1 + + +#ifndef _WIN32 +#include +#endif /* !_WIN32 */ + +#endif /* LIBEV_EMBED */ + +#ifndef _WIN32 + +static struct sigaction libev_sigchld; +/* + * Track the state of whether we have installed + * the libev sigchld handler specifically. + * If it's non-zero, libev_sigchld will be valid and set to the action + * that libev needs to do. + * If it's 1, we need to install libev_sigchld to make libev + * child handlers work (on request). + */ +static int sigchld_state = 0; + +static struct ev_loop* gevent_ev_default_loop(unsigned int flags) +{ + struct ev_loop* result; + struct sigaction tmp; + + if (sigchld_state) + return ev_default_loop(flags); + + // Request the old SIGCHLD handler + sigaction(SIGCHLD, NULL, &tmp); + // Get the loop, which will install a SIGCHLD handler + result = ev_default_loop(flags); + // XXX what if SIGCHLD received there? + // Now restore the previous SIGCHLD handler + sigaction(SIGCHLD, &tmp, &libev_sigchld); + sigchld_state = 1; + return result; +} + + +static void gevent_install_sigchld_handler(void) { + if (sigchld_state == 1) { + sigaction(SIGCHLD, &libev_sigchld, NULL); + sigchld_state = 2; + } +} + +static void gevent_reset_sigchld_handler(void) { + // We could have any state at this point, depending on + // whether the default loop has been used. If it has, + // then always be in state 1 ("need to install) + if (sigchld_state) { + sigchld_state = 1; + } +} + +#else /* !_WIN32 */ + +#define gevent_ev_default_loop ev_default_loop +static void gevent_install_sigchld_handler(void) { } +static void gevent_reset_sigchld_handler(void) { } + +// Fake child functions that we can link to. +static void ev_child_start(struct ev_loop* loop, ev_child* w) {}; +static void ev_child_stop(struct ev_loop* loop, ev_child* w) {}; + +#endif /* _WIN32 */ diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/libev/libev.pxd b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/libev/libev.pxd new file mode 100644 index 00000000..e3be5259 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/libev/libev.pxd @@ -0,0 +1,235 @@ +# From cython/includes/libc/stdint.pxd +# Longness only used for type promotion. +# Actual compile time size used for conversions. +# We don't have stdint.h on visual studio 9.0 (2008) on windows, sigh, +# so go with Py_ssize_t +# ssize_t -> intptr_t + +cdef extern from "libev_vfd.h": +# cython doesn't process pre-processor directives, so they +# don't matter in this file. It just takes the last definition it sees. + ctypedef Py_ssize_t intptr_t + ctypedef intptr_t vfd_socket_t + + vfd_socket_t vfd_get(int) + int vfd_open(long) except -1 + void vfd_free(int) + +cdef extern from "libev.h" nogil: + int LIBEV_EMBED + int EV_MINPRI + int EV_MAXPRI + + int EV_VERSION_MAJOR + int EV_VERSION_MINOR + + int EV_USE_FLOOR + int EV_USE_CLOCK_SYSCALL + int EV_USE_REALTIME + int EV_USE_MONOTONIC + int EV_USE_NANOSLEEP + int EV_USE_SELECT + int EV_USE_POLL + int EV_USE_EPOLL + int EV_USE_KQUEUE + int EV_USE_PORT + int EV_USE_INOTIFY + int EV_USE_SIGNALFD + int EV_USE_EVENTFD + int EV_USE_4HEAP + int EV_USE_IOCP + int EV_SELECT_IS_WINSOCKET + + int EV_UNDEF + int EV_NONE + int EV_READ + int EV_WRITE + int EV__IOFDSET + int EV_TIMER + int EV_PERIODIC + int EV_SIGNAL + int EV_CHILD + int EV_STAT + int EV_IDLE + int EV_PREPARE + int EV_CHECK + int EV_EMBED + int EV_FORK + int EV_CLEANUP + int EV_ASYNC + int EV_CUSTOM + int EV_ERROR + + int EVFLAG_AUTO + int EVFLAG_NOENV + int EVFLAG_FORKCHECK + int EVFLAG_NOINOTIFY + int EVFLAG_SIGNALFD + int EVFLAG_NOSIGMASK + + int EVBACKEND_SELECT + int EVBACKEND_POLL + int EVBACKEND_EPOLL + int EVBACKEND_KQUEUE + int EVBACKEND_DEVPOLL + int EVBACKEND_PORT + int EVBACKEND_IOCP + int EVBACKEND_ALL + int EVBACKEND_MASK + + int EVRUN_NOWAIT + int EVRUN_ONCE + + int EVBREAK_CANCEL + int EVBREAK_ONE + int EVBREAK_ALL + + struct ev_loop: + int activecnt + int sig_pending + int backend_fd + int sigfd + unsigned int origflags + + struct ev_watcher: + void* data; + + struct ev_io: + int fd + int events + + struct ev_timer: + double at + + struct ev_signal: + pass + + struct ev_idle: + pass + + struct ev_prepare: + pass + + struct ev_check: + pass + + struct ev_fork: + pass + + struct ev_async: + pass + + struct ev_child: + int pid + int rpid + int rstatus + + struct stat: + int st_nlink + + struct ev_stat: + stat attr + stat prev + double interval + + union ev_any_watcher: + ev_watcher w + ev_io io + ev_timer timer + ev_signal signal + ev_idle idle + + int ev_version_major() + int ev_version_minor() + + unsigned int ev_supported_backends() + unsigned int ev_recommended_backends() + unsigned int ev_embeddable_backends() + + ctypedef double ev_tstamp + + ev_tstamp ev_time() + void ev_set_syserr_cb(void *) + + int ev_priority(void*) + void ev_set_priority(void*, int) + + int ev_is_pending(void*) + int ev_is_active(void*) + void ev_io_init(ev_io*, void* callback, int fd, int events) + void ev_io_start(ev_loop*, ev_io*) + void ev_io_stop(ev_loop*, ev_io*) + void ev_feed_event(ev_loop*, void*, int) + + void ev_timer_init(ev_timer*, void* callback, double, double) + void ev_timer_start(ev_loop*, ev_timer*) + void ev_timer_stop(ev_loop*, ev_timer*) + void ev_timer_again(ev_loop*, ev_timer*) + + void ev_signal_init(ev_signal*, void* callback, int) + void ev_signal_start(ev_loop*, ev_signal*) + void ev_signal_stop(ev_loop*, ev_signal*) + + void ev_idle_init(ev_idle*, void* callback) + void ev_idle_start(ev_loop*, ev_idle*) + void ev_idle_stop(ev_loop*, ev_idle*) + + void ev_prepare_init(ev_prepare*, void* callback) + void ev_prepare_start(ev_loop*, ev_prepare*) + void ev_prepare_stop(ev_loop*, ev_prepare*) + + void ev_check_init(ev_check*, void* callback) + void ev_check_start(ev_loop*, ev_check*) + void ev_check_stop(ev_loop*, ev_check*) + + void ev_fork_init(ev_fork*, void* callback) + void ev_fork_start(ev_loop*, ev_fork*) + void ev_fork_stop(ev_loop*, ev_fork*) + + void ev_async_init(ev_async*, void* callback) + void ev_async_start(ev_loop*, ev_async*) + void ev_async_stop(ev_loop*, ev_async*) + void ev_async_send(ev_loop*, ev_async*) + int ev_async_pending(ev_async*) + + void ev_child_init(ev_child*, void* callback, int, int) + void ev_child_start(ev_loop*, ev_child*) + void ev_child_stop(ev_loop*, ev_child*) + + void ev_stat_init(ev_stat*, void* callback, char*, double) + void ev_stat_start(ev_loop*, ev_stat*) + void ev_stat_stop(ev_loop*, ev_stat*) + + ev_loop* ev_default_loop(unsigned int flags) + ev_loop* ev_loop_new(unsigned int flags) + void* ev_userdata(ev_loop*) + void ev_set_userdata(ev_loop*, void*) + void ev_loop_destroy(ev_loop*) + void ev_loop_fork(ev_loop*) + int ev_is_default_loop(ev_loop*) + unsigned int ev_iteration(ev_loop*) + unsigned int ev_depth(ev_loop*) + unsigned int ev_backend(ev_loop*) + void ev_verify(ev_loop*) + void ev_run(ev_loop*, int flags) nogil + + ev_tstamp ev_now(ev_loop*) + void ev_now_update(ev_loop*) + + void ev_ref(ev_loop*) + void ev_unref(ev_loop*) + void ev_break(ev_loop*, int) + unsigned int ev_pending_count(ev_loop*) + + # gevent extra functions. These are defined in libev.h. + ev_loop* gevent_ev_default_loop(unsigned int flags) + void gevent_install_sigchld_handler() + void gevent_reset_sigchld_handler() + + # These compensate for lack of access to ev_loop struct definition + # when LIBEV_EMBED is false. + unsigned int gevent_ev_loop_origflags(ev_loop*); + int gevent_ev_loop_sig_pending(ev_loop*); + int gevent_ev_loop_backend_fd(ev_loop*); + int gevent_ev_loop_activecnt(ev_loop*); + int gevent_ev_loop_sigfd(ev_loop*); diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/libev/libev_vfd.h b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/libev/libev_vfd.h new file mode 100644 index 00000000..ff30fd8d --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/libev/libev_vfd.h @@ -0,0 +1,225 @@ +#ifdef _WIN32 +/* see discussion in the libuv directory: this is a SOCKET which is a + HANDLE which is a PVOID (even though they're really small ints), + and CPython and PyPy return that SOCKET cast to an int from + fileno() +*/ +typedef intptr_t vfd_socket_t; +#define vfd_socket_object PyLong_FromLongLong + +#ifdef LIBEV_EMBED +/* + * If libev on win32 is embedded, then we can use an + * arbitrary mapping between integer fds and OS + * handles. Then by defining special macros libev + * will use our functions. + */ + +#define WIN32_LEAN_AND_MEAN +#include +#include + +typedef struct vfd_entry_t +{ + vfd_socket_t handle; /* OS handle, i.e. SOCKET */ + int count; /* Reference count, 0 if free */ + int next; /* Next free fd, -1 if last */ +} vfd_entry; + +#define VFD_INCREMENT 128 +static int vfd_num = 0; /* num allocated fds */ +static int vfd_max = 0; /* max allocated fds */ +static int vfd_next = -1; /* next free fd for reuse */ +static PyObject* vfd_map = NULL; /* map OS handle -> virtual fd */ +static vfd_entry* vfd_entries = NULL; /* list of virtual fd entries */ + +#ifdef WITH_THREAD +static CRITICAL_SECTION* volatile vfd_lock = NULL; +static CRITICAL_SECTION* vfd_make_lock() +{ + if (vfd_lock == NULL) { + /* must use malloc and not PyMem_Malloc here */ + CRITICAL_SECTION* lock = malloc(sizeof(CRITICAL_SECTION)); + InitializeCriticalSection(lock); + if (InterlockedCompareExchangePointer(&vfd_lock, lock, NULL) != NULL) { + /* another thread initialized lock first */ + DeleteCriticalSection(lock); + free(lock); + } + } + return vfd_lock; +} +#define VFD_LOCK_ENTER EnterCriticalSection(vfd_make_lock()) +#define VFD_LOCK_LEAVE LeaveCriticalSection(vfd_lock) +#define VFD_GIL_DECLARE PyGILState_STATE ___save +#define VFD_GIL_ENSURE ___save = PyGILState_Ensure() +#define VFD_GIL_RELEASE PyGILState_Release(___save) +#else /* ! WITH_THREAD */ +#define VFD_LOCK_ENTER +#define VFD_LOCK_LEAVE +#define VFD_GIL_DECLARE +#define VFD_GIL_ENSURE +#define VFD_GIL_RELEASE +#endif /*_WITH_THREAD */ + +/* + * Given a virtual fd returns an OS handle or -1 + * This function is speed critical, so it cannot use GIL + */ +static vfd_socket_t vfd_get(int fd) +{ + vfd_socket_t handle = -1; + VFD_LOCK_ENTER; + if (vfd_entries != NULL && fd >= 0 && fd < vfd_num) + handle = vfd_entries[fd].handle; + VFD_LOCK_LEAVE; + return handle; +} + +#define EV_FD_TO_WIN32_HANDLE(fd) vfd_get((fd)) + +/* + * Given an OS handle finds or allocates a virtual fd + * Returns -1 on failure and sets Python exception if pyexc is non-zero + */ +static int vfd_open_(vfd_socket_t handle, int pyexc) +{ + VFD_GIL_DECLARE; + int fd = -1; + unsigned long arg; + PyObject* key = NULL; + PyObject* value; + + if (!pyexc) { + VFD_GIL_ENSURE; + } + if (ioctlsocket(handle, FIONREAD, &arg) != 0) { + if (pyexc) + PyErr_Format(PyExc_IOError, +#ifdef _WIN64 + "%lld is not a socket (files are not supported)", +#else + "%ld is not a socket (files are not supported)", +#endif + handle); + goto done; + } + if (vfd_map == NULL) { + vfd_map = PyDict_New(); + if (vfd_map == NULL) + goto done; + } + key = vfd_socket_object(handle); + /* check if it's already in the dict */ + value = PyDict_GetItem(vfd_map, key); + if (value != NULL) { + /* is it safe to use PyInt_AS_LONG(value) here? */ + fd = PyInt_AsLong(value); + if (fd >= 0) { + ++vfd_entries[fd].count; + goto done; + } + } + /* use the free entry, if available */ + if (vfd_next >= 0) { + fd = vfd_next; + vfd_next = vfd_entries[fd].next; + VFD_LOCK_ENTER; + goto allocated; + } + /* check if it would be out of bounds */ + if (vfd_num >= FD_SETSIZE) { + /* libev's select doesn't support more that FD_SETSIZE fds */ + if (pyexc) + PyErr_Format(PyExc_IOError, "cannot watch more than %d sockets", (int)FD_SETSIZE); + goto done; + } + /* allocate more space if needed */ + VFD_LOCK_ENTER; + if (vfd_num >= vfd_max) { + int newsize = vfd_max + VFD_INCREMENT; + vfd_entry* entries = PyMem_Realloc(vfd_entries, sizeof(vfd_entry) * newsize); + if (entries == NULL) { + VFD_LOCK_LEAVE; + if (pyexc) + PyErr_NoMemory(); + goto done; + } + vfd_entries = entries; + vfd_max = newsize; + } + fd = vfd_num++; +allocated: + /* vfd_lock must be acquired when entering here */ + vfd_entries[fd].handle = handle; + vfd_entries[fd].count = 1; + VFD_LOCK_LEAVE; + value = PyInt_FromLong(fd); + PyDict_SetItem(vfd_map, key, value); + Py_DECREF(value); +done: + Py_XDECREF(key); + if (!pyexc) { + VFD_GIL_RELEASE; + } + return fd; +} + +#define vfd_open(fd) vfd_open_((fd), 1) +#define EV_WIN32_HANDLE_TO_FD(handle) vfd_open_((handle), 0) + +static void vfd_free_(int fd, int needclose) +{ + VFD_GIL_DECLARE; + PyObject* key; + + if (needclose) { + VFD_GIL_ENSURE; + } + if (fd < 0 || fd >= vfd_num) + goto done; /* out of bounds */ + if (vfd_entries[fd].count <= 0) + goto done; /* free entry, ignore */ + if (!--vfd_entries[fd].count) { + /* fd has just been freed */ + vfd_socket_t handle = vfd_entries[fd].handle; + vfd_entries[fd].handle = -1; + vfd_entries[fd].next = vfd_next; + vfd_next = fd; + if (needclose) + closesocket(handle); + /* vfd_map is assumed to be != NULL */ + key = vfd_socket_object(handle); + PyDict_DelItem(vfd_map, key); + Py_DECREF(key); + } +done: + if (needclose) { + VFD_GIL_RELEASE; + } +} + +#define vfd_free(fd) vfd_free_((fd), 0) +#define EV_WIN32_CLOSE_FD(fd) vfd_free_((fd), 1) + +#else /* !LIBEV_EMBED */ +/* + * If libev on win32 is not embedded in gevent, then + * the only way to map vfds is to use the default of + * using runtime fds in libev. Note that it will leak + * fds, because there's no way of closing them safely + */ +#define vfd_get(fd) _get_osfhandle((fd)) +#define vfd_open(fd) _open_osfhandle((fd), 0) +#define vfd_free(fd) +#endif /* LIBEV_EMBED */ + +#else /* !_WIN32 */ +/* + * On non-win32 platforms vfd_* are noop macros + */ +typedef int vfd_socket_t; +#define vfd_get(fd) (fd) +#define vfd_open(fd) (fd) +#define vfd_free(fd) +#endif /* _WIN32 */ diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/libev/stathelper.c b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/libev/stathelper.c new file mode 100644 index 00000000..1a70b550 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/libev/stathelper.c @@ -0,0 +1,187 @@ +/* copied from Python-2.7.2/Modules/posixmodule.c */ +#include "structseq.h" + +#define STRUCT_STAT struct stat + +#ifdef HAVE_STRUCT_STAT_ST_BLKSIZE +#define ST_BLKSIZE_IDX 13 +#else +#define ST_BLKSIZE_IDX 12 +#endif + +#ifdef HAVE_STRUCT_STAT_ST_BLOCKS +#define ST_BLOCKS_IDX (ST_BLKSIZE_IDX+1) +#else +#define ST_BLOCKS_IDX ST_BLKSIZE_IDX +#endif + +#ifdef HAVE_STRUCT_STAT_ST_RDEV +#define ST_RDEV_IDX (ST_BLOCKS_IDX+1) +#else +#define ST_RDEV_IDX ST_BLOCKS_IDX +#endif + +#ifdef HAVE_STRUCT_STAT_ST_FLAGS +#define ST_FLAGS_IDX (ST_RDEV_IDX+1) +#else +#define ST_FLAGS_IDX ST_RDEV_IDX +#endif + +#ifdef HAVE_STRUCT_STAT_ST_GEN +#define ST_GEN_IDX (ST_FLAGS_IDX+1) +#else +#define ST_GEN_IDX ST_FLAGS_IDX +#endif + +#ifdef HAVE_STRUCT_STAT_ST_BIRTHTIME +#define ST_BIRTHTIME_IDX (ST_GEN_IDX+1) +#else +#define ST_BIRTHTIME_IDX ST_GEN_IDX +#endif + + + +static PyObject* posixmodule = NULL; +static PyTypeObject* pStatResultType = NULL; + + +static PyObject* import_posixmodule(void) +{ + if (!posixmodule) { + posixmodule = PyImport_ImportModule("posix"); + } + return posixmodule; +} + + +static PyObject* import_StatResultType(void) +{ + PyObject* p = NULL; + if (!pStatResultType) { + PyObject* module; + module = import_posixmodule(); + if (module) { + p = PyObject_GetAttrString(module, "stat_result"); + } + } + return p; +} + +static void +fill_time(PyObject *v, int index, time_t sec, unsigned long nsec) +{ + PyObject *fval,*ival; +#if SIZEOF_TIME_T > SIZEOF_LONG + ival = PyLong_FromLongLong((PY_LONG_LONG)sec); +#else + ival = PyInt_FromLong((long)sec); +#endif + if (!ival) + return; + fval = PyFloat_FromDouble(sec + 1e-9*nsec); + PyStructSequence_SET_ITEM(v, index, ival); + PyStructSequence_SET_ITEM(v, index+3, fval); +} + +/* pack a system stat C structure into the Python stat tuple + (used by posix_stat() and posix_fstat()) */ +static PyObject* +_pystat_fromstructstat(STRUCT_STAT *st) +{ + unsigned long ansec, mnsec, cnsec; + PyObject *v; + + PyTypeObject* StatResultType = (PyTypeObject*)import_StatResultType(); + if (StatResultType == NULL) { + return NULL; + } + + v = PyStructSequence_New(StatResultType); + if (v == NULL) + return NULL; + + PyStructSequence_SET_ITEM(v, 0, PyInt_FromLong((long)st->st_mode)); +#ifdef HAVE_LARGEFILE_SUPPORT + PyStructSequence_SET_ITEM(v, 1, + PyLong_FromLongLong((PY_LONG_LONG)st->st_ino)); +#else + PyStructSequence_SET_ITEM(v, 1, PyInt_FromLong((long)st->st_ino)); +#endif +#if defined(HAVE_LONG_LONG) && !defined(MS_WINDOWS) + PyStructSequence_SET_ITEM(v, 2, + PyLong_FromLongLong((PY_LONG_LONG)st->st_dev)); +#else + PyStructSequence_SET_ITEM(v, 2, PyInt_FromLong((long)st->st_dev)); +#endif + PyStructSequence_SET_ITEM(v, 3, PyInt_FromLong((long)st->st_nlink)); + PyStructSequence_SET_ITEM(v, 4, PyInt_FromLong((long)st->st_uid)); + PyStructSequence_SET_ITEM(v, 5, PyInt_FromLong((long)st->st_gid)); +#ifdef HAVE_LARGEFILE_SUPPORT + PyStructSequence_SET_ITEM(v, 6, + PyLong_FromLongLong((PY_LONG_LONG)st->st_size)); +#else + PyStructSequence_SET_ITEM(v, 6, PyInt_FromLong(st->st_size)); +#endif + +#if defined(HAVE_STAT_TV_NSEC) + ansec = st->st_atim.tv_nsec; + mnsec = st->st_mtim.tv_nsec; + cnsec = st->st_ctim.tv_nsec; +#elif defined(HAVE_STAT_TV_NSEC2) + ansec = st->st_atimespec.tv_nsec; + mnsec = st->st_mtimespec.tv_nsec; + cnsec = st->st_ctimespec.tv_nsec; +#elif defined(HAVE_STAT_NSEC) + ansec = st->st_atime_nsec; + mnsec = st->st_mtime_nsec; + cnsec = st->st_ctime_nsec; +#else + ansec = mnsec = cnsec = 0; +#endif + fill_time(v, 7, st->st_atime, ansec); + fill_time(v, 8, st->st_mtime, mnsec); + fill_time(v, 9, st->st_ctime, cnsec); + +#ifdef HAVE_STRUCT_STAT_ST_BLKSIZE + PyStructSequence_SET_ITEM(v, ST_BLKSIZE_IDX, + PyInt_FromLong((long)st->st_blksize)); +#endif +#ifdef HAVE_STRUCT_STAT_ST_BLOCKS + PyStructSequence_SET_ITEM(v, ST_BLOCKS_IDX, + PyInt_FromLong((long)st->st_blocks)); +#endif +#ifdef HAVE_STRUCT_STAT_ST_RDEV + PyStructSequence_SET_ITEM(v, ST_RDEV_IDX, + PyInt_FromLong((long)st->st_rdev)); +#endif +#ifdef HAVE_STRUCT_STAT_ST_GEN + PyStructSequence_SET_ITEM(v, ST_GEN_IDX, + PyInt_FromLong((long)st->st_gen)); +#endif +#ifdef HAVE_STRUCT_STAT_ST_BIRTHTIME + { + PyObject *val; + unsigned long bsec,bnsec; + bsec = (long)st->st_birthtime; +#ifdef HAVE_STAT_TV_NSEC2 + bnsec = st->st_birthtimespec.tv_nsec; +#else + bnsec = 0; +#endif + val = PyFloat_FromDouble(bsec + 1e-9*bnsec); + PyStructSequence_SET_ITEM(v, ST_BIRTHTIME_IDX, + val); + } +#endif +#ifdef HAVE_STRUCT_STAT_ST_FLAGS + PyStructSequence_SET_ITEM(v, ST_FLAGS_IDX, + PyInt_FromLong((long)st->st_flags)); +#endif + + if (PyErr_Occurred()) { + Py_DECREF(v); + return NULL; + } + + return v; +} diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/libev/watcher.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/libev/watcher.py new file mode 100644 index 00000000..74db0c13 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/libev/watcher.py @@ -0,0 +1,286 @@ +# pylint: disable=too-many-lines, protected-access, redefined-outer-name, not-callable +# pylint: disable=no-member +from __future__ import absolute_import, print_function +import sys + +from gevent.libev import _corecffi # pylint:disable=no-name-in-module,import-error + +# Nothing public here +__all__ = [] + + +ffi = _corecffi.ffi # pylint:disable=no-member +libev = _corecffi.lib # pylint:disable=no-member + +if hasattr(libev, 'vfd_open'): + # Must be on windows + assert sys.platform.startswith("win"), "vfd functions only needed on windows" + vfd_open = libev.vfd_open + vfd_free = libev.vfd_free + vfd_get = libev.vfd_get +else: + vfd_open = vfd_free = vfd_get = lambda fd: fd + +##### +## NOTE on Windows: +# The C implementation does several things specially for Windows; +# a possibly incomplete list is: +# +# - the loop runs a periodic signal checker; +# - the io watcher constructor is different and it has a destructor; +# - the child watcher is not defined +# +# The CFFI implementation does none of these things, and so +# is possibly NOT FUNCTIONALLY CORRECT on Win32 +##### +_NOARGS = () +_events = [(libev.EV_READ, 'READ'), + (libev.EV_WRITE, 'WRITE'), + (libev.EV__IOFDSET, '_IOFDSET'), + (libev.EV_PERIODIC, 'PERIODIC'), + (libev.EV_SIGNAL, 'SIGNAL'), + (libev.EV_CHILD, 'CHILD'), + (libev.EV_STAT, 'STAT'), + (libev.EV_IDLE, 'IDLE'), + (libev.EV_PREPARE, 'PREPARE'), + (libev.EV_CHECK, 'CHECK'), + (libev.EV_EMBED, 'EMBED'), + (libev.EV_FORK, 'FORK'), + (libev.EV_CLEANUP, 'CLEANUP'), + (libev.EV_ASYNC, 'ASYNC'), + (libev.EV_CUSTOM, 'CUSTOM'), + (libev.EV_ERROR, 'ERROR')] + +from gevent._ffi import watcher as _base + +def _events_to_str(events): + return _base.events_to_str(events, _events) + + + +class watcher(_base.watcher): + _FFI = ffi + _LIB = libev + _watcher_prefix = 'ev' + + # Flags is a bitfield with the following meaning: + # 0000 -> default, referenced (when active) + # 0010 -> ev_unref has been called + # 0100 -> not referenced; independent of 0010 + _flags = 0 + + def __init__(self, _loop, ref=True, priority=None, args=_base._NOARGS): + if ref: + self._flags = 0 + else: + self._flags = 4 + + super(watcher, self).__init__(_loop, ref=ref, priority=priority, args=args) + + def _watcher_ffi_set_priority(self, priority): + libev.ev_set_priority(self._watcher, priority) + + def _watcher_ffi_init(self, args): + self._watcher_init(self._watcher, + self._watcher_callback, + *args) + + def _watcher_ffi_start(self): + self._watcher_start(self.loop._ptr, self._watcher) + + def _watcher_ffi_ref(self): + if self._flags & 2: # we've told libev we're not referenced + self.loop.ref() + self._flags &= ~2 + + def _watcher_ffi_unref(self): + if self._flags & 6 == 4: + # We're not referenced, but we haven't told libev that + self.loop.unref() + self._flags |= 2 # now we've told libev + + def _get_ref(self): + return not self._flags & 4 + + def _set_ref(self, value): + if value: + if not self._flags & 4: + return # ref is already True + if self._flags & 2: # ev_unref was called, undo + self.loop.ref() + self._flags &= ~6 # do not want unref, no outstanding unref + else: + if self._flags & 4: + return # ref is already False + self._flags |= 4 # we're not referenced + if not self._flags & 2 and libev.ev_is_active(self._watcher): + # we haven't told libev we're not referenced, but it thinks we're + # active so we need to undo that + self.loop.unref() + self._flags |= 2 # libev knows we're not referenced + + ref = property(_get_ref, _set_ref) + + + def _get_priority(self): + return libev.ev_priority(self._watcher) + + @_base.not_while_active + def _set_priority(self, priority): + libev.ev_set_priority(self._watcher, priority) + + priority = property(_get_priority, _set_priority) + + def feed(self, revents, callback, *args): + self.callback = callback + self.args = args or _NOARGS + if self._flags & 6 == 4: + self.loop.unref() + self._flags |= 2 + libev.ev_feed_event(self.loop._ptr, self._watcher, revents) + if not self._flags & 1: + # Py_INCREF(self) + self._flags |= 1 + + @property + def pending(self): + return bool(self._watcher and libev.ev_is_pending(self._watcher)) + + +class io(_base.IoMixin, watcher): + + EVENT_MASK = libev.EV__IOFDSET | libev.EV_READ | libev.EV_WRITE + + def _get_fd(self): + return vfd_get(self._watcher.fd) + + @_base.not_while_active + def _set_fd(self, fd): + vfd = vfd_open(fd) + vfd_free(self._watcher.fd) + self._watcher_init(self._watcher, self._watcher_callback, vfd, self._watcher.events) + + fd = property(_get_fd, _set_fd) + + def _get_events(self): + return self._watcher.events + + @_base.not_while_active + def _set_events(self, events): + self._watcher_init(self._watcher, self._watcher_callback, self._watcher.fd, events) + + events = property(_get_events, _set_events) + + @property + def events_str(self): + return _events_to_str(self._watcher.events) + + def _format(self): + return ' fd=%s events=%s' % (self.fd, self.events_str) + + +class timer(_base.TimerMixin, watcher): + + @property + def at(self): + return self._watcher.at + + def again(self, callback, *args, **kw): + # Exactly the same as start(), just with a different initializer + # function + self._watcher_start = libev.ev_timer_again + try: + self.start(callback, *args, **kw) + finally: + del self._watcher_start + + +class signal(_base.SignalMixin, watcher): + pass + +class idle(_base.IdleMixin, watcher): + pass + +class prepare(_base.PrepareMixin, watcher): + pass + +class check(_base.CheckMixin, watcher): + pass + +class fork(_base.ForkMixin, watcher): + pass + + +class async_(_base.AsyncMixin, watcher): + + def send(self): + libev.ev_async_send(self.loop._ptr, self._watcher) + + @property + def pending(self): + return bool(libev.ev_async_pending(self._watcher)) + +# Provide BWC for those that have async +locals()['async'] = async_ + +class _ClosedWatcher(object): + __slots__ = ('pid', 'rpid', 'rstatus') + + def __init__(self, other): + self.pid = other.pid + self.rpid = other.rpid + self.rstatus = other.rstatus + + def __bool__(self): + return False + __nonzero__ = __bool__ + +class child(_base.ChildMixin, watcher): + _watcher_type = 'child' + + def close(self): + # Capture the properties we defer to our _watcher, because + # we're about to discard it. + closed_watcher = _ClosedWatcher(self._watcher) + super(child, self).close() + self._watcher = closed_watcher + + @property + def pid(self): + return self._watcher.pid + + @property + def rpid(self): + return self._watcher.rpid + + @rpid.setter + def rpid(self, value): + self._watcher.rpid = value + + @property + def rstatus(self): + return self._watcher.rstatus + + @rstatus.setter + def rstatus(self, value): + self._watcher.rstatus = value + + +class stat(_base.StatMixin, watcher): + _watcher_type = 'stat' + + @property + def attr(self): + if not self._watcher.attr.st_nlink: + return + return self._watcher.attr + + @property + def prev(self): + if not self._watcher.prev.st_nlink: + return + return self._watcher.prev + + @property + def interval(self): + return self._watcher.interval diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/libuv/__init__.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/libuv/__init__.py new file mode 100644 index 00000000..412d64ce --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/libuv/__init__.py @@ -0,0 +1,7 @@ +# -*- coding: utf-8 -*- +from __future__ import absolute_import +from __future__ import division +from __future__ import print_function + +# Nothing public here +__all__ = [] diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/libuv/_corecffi.cp37-win_amd64.pyd b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/libuv/_corecffi.cp37-win_amd64.pyd new file mode 100644 index 0000000000000000000000000000000000000000..21ca8644e89f98bab81354a69c505382af535321 GIT binary patch literal 159232 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 literal 0 HcmV?d00001 diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/libuv/_corecffi_build.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/libuv/_corecffi_build.py new file mode 100644 index 00000000..5194d09f --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/libuv/_corecffi_build.py @@ -0,0 +1,256 @@ +# pylint: disable=no-member + +# This module is only used to create and compile the gevent._corecffi module; +# nothing should be directly imported from it except `ffi`, which should only be +# used for `ffi.compile()`; programs should import gevent._corecfffi. +# However, because we are using "out-of-line" mode, it is necessary to examine +# this file to know what functions are created and available on the generated +# module. +from __future__ import absolute_import, print_function +import sys +import os +import os.path # pylint:disable=no-name-in-module +import struct + +__all__ = [] + +WIN = sys.platform.startswith('win32') + +def system_bits(): + return struct.calcsize('P') * 8 + + +def st_nlink_type(): + if sys.platform == "darwin" or sys.platform.startswith("freebsd"): + return "short" + if system_bits() == 32: + return "unsigned long" + return "long long" + + +from cffi import FFI +ffi = FFI() + +thisdir = os.path.dirname(os.path.abspath(__file__)) +def read_source(name): + with open(os.path.join(thisdir, name), 'r') as f: + return f.read() + +_cdef = read_source('_corecffi_cdef.c') +_source = read_source('_corecffi_source.c') + +_cdef = _cdef.replace('#define GEVENT_ST_NLINK_T int', '') +_cdef = _cdef.replace('#define GEVENT_STRUCT_DONE int', '') +_cdef = _cdef.replace('#define GEVENT_UV_OS_SOCK_T int', '') + +_cdef = _cdef.replace('GEVENT_ST_NLINK_T', st_nlink_type()) +_cdef = _cdef.replace("GEVENT_STRUCT_DONE _;", '...;') +# uv_os_sock_t is int on POSIX and SOCKET on Win32, but socket is +# just another name for handle, which is just another name for 'void*' +# which we will treat as an 'unsigned long' or 'unsigned long long' +# since it comes through 'fileno()' where it has been cast as an int. +# See class watcher.io +_void_pointer_as_integer = 'intptr_t' +_cdef = _cdef.replace("GEVENT_UV_OS_SOCK_T", 'int' if not WIN else _void_pointer_as_integer) + + +setup_py_dir = os.path.abspath(os.path.join(thisdir, '..', '..', '..')) +libuv_dir = os.path.abspath(os.path.join(setup_py_dir, 'deps', 'libuv')) + + +LIBUV_INCLUDE_DIRS = [ + thisdir, # libev_vfd.h + os.path.join(libuv_dir, 'include'), + os.path.join(libuv_dir, 'src'), +] + +# Initially based on https://github.com/saghul/pyuv/blob/v1.x/setup_libuv.py + +def _libuv_source(rel_path): + # Certain versions of setuptools, notably on windows, are *very* + # picky about what we feed to sources= "setup() arguments must + # *always* be /-separated paths relative to the setup.py + # directory, *never* absolute paths." POSIX doesn't have that issue. + path = os.path.join('deps', 'libuv', 'src', rel_path) + return path + +LIBUV_SOURCES = [ + _libuv_source('fs-poll.c'), + _libuv_source('inet.c'), + _libuv_source('threadpool.c'), + _libuv_source('uv-common.c'), + _libuv_source('version.c'), + _libuv_source('uv-data-getter-setters.c'), + _libuv_source('timer.c'), + _libuv_source('idna.c'), +] + +if WIN: + LIBUV_SOURCES += [ + _libuv_source('win/async.c'), + _libuv_source('win/core.c'), + _libuv_source('win/detect-wakeup.c'), + _libuv_source('win/dl.c'), + _libuv_source('win/error.c'), + _libuv_source('win/fs-event.c'), + _libuv_source('win/fs.c'), + # getaddrinfo.c refers to ConvertInterfaceIndexToLuid + # and ConvertInterfaceLuidToNameA, which are supposedly in iphlpapi.h + # and iphlpapi.lib/dll. But on Windows 10 with Python 3.5 and VC 14 (Visual Studio 2015), + # I get an undefined warning from the compiler for those functions and + # a link error from the linker, so this file can't be included. + # This is possibly because the functions are defined for Windows Vista, and + # Python 3.5 builds with at earlier SDK? + # Fortunately we don't use those functions. + #_libuv_source('win/getaddrinfo.c'), + # getnameinfo.c refers to uv__getaddrinfo_translate_error from + # getaddrinfo.c, which we don't have. + #_libuv_source('win/getnameinfo.c'), + _libuv_source('win/handle.c'), + _libuv_source('win/loop-watcher.c'), + _libuv_source('win/pipe.c'), + _libuv_source('win/poll.c'), + _libuv_source('win/process-stdio.c'), + _libuv_source('win/process.c'), + _libuv_source('win/signal.c'), + _libuv_source('win/snprintf.c'), + _libuv_source('win/stream.c'), + _libuv_source('win/tcp.c'), + _libuv_source('win/thread.c'), + _libuv_source('win/tty.c'), + _libuv_source('win/udp.c'), + _libuv_source('win/util.c'), + _libuv_source('win/winapi.c'), + _libuv_source('win/winsock.c'), + ] +else: + LIBUV_SOURCES += [ + _libuv_source('unix/async.c'), + _libuv_source('unix/core.c'), + _libuv_source('unix/dl.c'), + _libuv_source('unix/fs.c'), + _libuv_source('unix/getaddrinfo.c'), + _libuv_source('unix/getnameinfo.c'), + _libuv_source('unix/loop-watcher.c'), + _libuv_source('unix/loop.c'), + _libuv_source('unix/pipe.c'), + _libuv_source('unix/poll.c'), + _libuv_source('unix/process.c'), + _libuv_source('unix/signal.c'), + _libuv_source('unix/stream.c'), + _libuv_source('unix/tcp.c'), + _libuv_source('unix/thread.c'), + _libuv_source('unix/tty.c'), + _libuv_source('unix/udp.c'), + ] + + +if sys.platform.startswith('linux'): + LIBUV_SOURCES += [ + _libuv_source('unix/linux-core.c'), + _libuv_source('unix/linux-inotify.c'), + _libuv_source('unix/linux-syscalls.c'), + _libuv_source('unix/procfs-exepath.c'), + _libuv_source('unix/proctitle.c'), + _libuv_source('unix/sysinfo-loadavg.c'), + _libuv_source('unix/sysinfo-memory.c'), + ] +elif sys.platform == 'darwin': + LIBUV_SOURCES += [ + _libuv_source('unix/bsd-ifaddrs.c'), + _libuv_source('unix/darwin.c'), + _libuv_source('unix/darwin-proctitle.c'), + _libuv_source('unix/fsevents.c'), + _libuv_source('unix/kqueue.c'), + _libuv_source('unix/proctitle.c'), + ] +elif sys.platform.startswith(('freebsd', 'dragonfly')): + LIBUV_SOURCES += [ + _libuv_source('unix/bsd-ifaddrs.c'), + _libuv_source('unix/freebsd.c'), + _libuv_source('unix/kqueue.c'), + _libuv_source('unix/posix-hrtime.c'), + _libuv_source('unix/bsd-proctitle.c'), + ] +elif sys.platform.startswith('openbsd'): + LIBUV_SOURCES += [ + _libuv_source('unix/bsd-ifaddrs.c'), + _libuv_source('unix/kqueue.c'), + _libuv_source('unix/openbsd.c'), + _libuv_source('unix/posix-hrtime.c'), + _libuv_source('unix/bsd-proctitle.c'), + ] +elif sys.platform.startswith('netbsd'): + LIBUV_SOURCES += [ + _libuv_source('unix/bsd-ifaddrs.c'), + _libuv_source('unix/kqueue.c'), + _libuv_source('unix/netbsd.c'), + _libuv_source('unix/posix-hrtime.c'), + _libuv_source('unix/bsd-proctitle.c'), + ] + +elif sys.platform.startswith('sunos'): + LIBUV_SOURCES += [ + _libuv_source('unix/no-proctitle.c'), + _libuv_source('unix/sunos.c'), + ] + + +LIBUV_MACROS = [] + +def _define_macro(name, value): + LIBUV_MACROS.append((name, value)) + +LIBUV_LIBRARIES = [] + +def _add_library(name): + LIBUV_LIBRARIES.append(name) + +if sys.platform != 'win32': + _define_macro('_LARGEFILE_SOURCE', 1) + _define_macro('_FILE_OFFSET_BITS', 64) + +if sys.platform.startswith('linux'): + _add_library('dl') + _add_library('rt') + _define_macro('_GNU_SOURCE', 1) + _define_macro('_POSIX_C_SOURCE', '200112') +elif sys.platform == 'darwin': + _define_macro('_DARWIN_USE_64_BIT_INODE', 1) + _define_macro('_DARWIN_UNLIMITED_SELECT', 1) +elif sys.platform.startswith('netbsd'): + _add_library('kvm') +elif sys.platform.startswith('sunos'): + _define_macro('__EXTENSIONS__', 1) + _define_macro('_XOPEN_SOURCE', 500) + _add_library('kstat') + _add_library('nsl') + _add_library('sendfile') + _add_library('socket') +elif WIN: + _define_macro('_GNU_SOURCE', 1) + _define_macro('WIN32', 1) + _define_macro('_CRT_SECURE_NO_DEPRECATE', 1) + _define_macro('_CRT_NONSTDC_NO_DEPRECATE', 1) + _define_macro('_CRT_SECURE_NO_WARNINGS', 1) + _define_macro('_WIN32_WINNT', '0x0600') + _define_macro('WIN32_LEAN_AND_MEAN', 1) + _add_library('advapi32') + _add_library('iphlpapi') + _add_library('psapi') + _add_library('shell32') + _add_library('user32') + _add_library('userenv') + _add_library('ws2_32') + +ffi.cdef(_cdef) +ffi.set_source('gevent.libuv._corecffi', + _source, + sources=LIBUV_SOURCES, + depends=LIBUV_SOURCES, + include_dirs=LIBUV_INCLUDE_DIRS, + libraries=list(LIBUV_LIBRARIES), + define_macros=list(LIBUV_MACROS)) + +if __name__ == '__main__': + ffi.compile() diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/libuv/_corecffi_cdef.c b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/libuv/_corecffi_cdef.c new file mode 100644 index 00000000..0735aea3 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/libuv/_corecffi_cdef.c @@ -0,0 +1,393 @@ +/* markers for the CFFI parser. Replaced when the string is read. */ +#define GEVENT_STRUCT_DONE int +#define GEVENT_ST_NLINK_T int +#define GEVENT_UV_OS_SOCK_T int + +#define UV_EBUSY ... + +#define UV_VERSION_MAJOR ... +#define UV_VERSION_MINOR ... +#define UV_VERSION_PATCH ... + +typedef enum { + UV_RUN_DEFAULT = 0, + UV_RUN_ONCE, + UV_RUN_NOWAIT +} uv_run_mode; + +typedef enum { + UV_UNKNOWN_HANDLE = 0, + UV_ASYNC, + UV_CHECK, + UV_FS_EVENT, + UV_FS_POLL, + UV_HANDLE, + UV_IDLE, + UV_NAMED_PIPE, + UV_POLL, + UV_PREPARE, + UV_PROCESS, + UV_STREAM, + UV_TCP, + UV_TIMER, + UV_TTY, + UV_UDP, + UV_SIGNAL, + UV_FILE, + UV_HANDLE_TYPE_MAX +} uv_handle_type; + +enum uv_poll_event { + UV_READABLE = 1, + UV_WRITABLE = 2, + /* new in 1.9 */ + UV_DISCONNECT = 4, + /* new in 1.14.0 */ + UV_PRIORITIZED = 8, +}; + +enum uv_fs_event { + UV_RENAME = 1, + UV_CHANGE = 2 +}; + +enum uv_fs_event_flags { + /* + * By default, if the fs event watcher is given a directory name, we will + * watch for all events in that directory. This flags overrides this behavior + * and makes fs_event report only changes to the directory entry itself. This + * flag does not affect individual files watched. + * This flag is currently not implemented yet on any backend. + */ + UV_FS_EVENT_WATCH_ENTRY = 1, + /* + * By default uv_fs_event will try to use a kernel interface such as inotify + * or kqueue to detect events. This may not work on remote filesystems such + * as NFS mounts. This flag makes fs_event fall back to calling stat() on a + * regular interval. + * This flag is currently not implemented yet on any backend. + */ + UV_FS_EVENT_STAT = 2, + /* + * By default, event watcher, when watching directory, is not registering + * (is ignoring) changes in it's subdirectories. + * This flag will override this behaviour on platforms that support it. + */ + UV_FS_EVENT_RECURSIVE = 4 +}; + +const char* uv_strerror(int); +const char* uv_err_name(int); +const char* uv_version_string(void); +const char* uv_handle_type_name(uv_handle_type type); + +// handle structs and types +struct uv_loop_s { + void* data; + GEVENT_STRUCT_DONE _; +}; +struct uv_handle_s { + struct uv_loop_s* loop; + uv_handle_type type; + void *data; + GEVENT_STRUCT_DONE _; +}; +struct uv_idle_s { + struct uv_loop_s* loop; + uv_handle_type type; + void *data; + GEVENT_STRUCT_DONE _; +}; +struct uv_prepare_s { + struct uv_loop_s* loop; + uv_handle_type type; + void *data; + GEVENT_STRUCT_DONE _; +}; +struct uv_timer_s { + struct uv_loop_s* loop; + uv_handle_type type; + void *data; + GEVENT_STRUCT_DONE _; +}; +struct uv_signal_s { + struct uv_loop_s* loop; + uv_handle_type type; + void *data; + GEVENT_STRUCT_DONE _; +}; +struct uv_poll_s { + struct uv_loop_s* loop; + uv_handle_type type; + void *data; + GEVENT_STRUCT_DONE _; +}; + +struct uv_check_s { + struct uv_loop_s* loop; + uv_handle_type type; + void *data; + GEVENT_STRUCT_DONE _; +}; + +struct uv_async_s { + struct uv_loop_s* loop; + uv_handle_type type; + void *data; + void (*async_cb)(struct uv_async_s *); + GEVENT_STRUCT_DONE _; +}; + +struct uv_fs_event_s { + struct uv_loop_s* loop; + uv_handle_type type; + void *data; + GEVENT_STRUCT_DONE _; +}; + +struct uv_fs_poll_s { + struct uv_loop_s* loop; + uv_handle_type type; + void *data; + GEVENT_STRUCT_DONE _; +}; + +typedef struct uv_loop_s uv_loop_t; +typedef struct uv_handle_s uv_handle_t; +typedef struct uv_idle_s uv_idle_t; +typedef struct uv_prepare_s uv_prepare_t; +typedef struct uv_timer_s uv_timer_t; +typedef struct uv_signal_s uv_signal_t; +typedef struct uv_poll_s uv_poll_t; +typedef struct uv_check_s uv_check_t; +typedef struct uv_async_s uv_async_t; +typedef struct uv_fs_event_s uv_fs_event_t; +typedef struct uv_fs_poll_s uv_fs_poll_t; + + +size_t uv_handle_size(uv_handle_type); + +// callbacks with the same signature +typedef void (*uv_close_cb)(uv_handle_t *handle); +typedef void (*uv_idle_cb)(uv_idle_t *handle); +typedef void (*uv_timer_cb)(uv_timer_t *handle); +typedef void (*uv_check_cb)(uv_check_t* handle); +typedef void (*uv_async_cb)(uv_async_t* handle); +typedef void (*uv_prepare_cb)(uv_prepare_t *handle); + +// callbacks with distinct sigs +typedef void (*uv_walk_cb)(uv_handle_t *handle, void *arg); +typedef void (*uv_poll_cb)(uv_poll_t *handle, int status, int events); +typedef void (*uv_signal_cb)(uv_signal_t *handle, int signum); + +// Callback passed to uv_fs_event_start() which will be called +// repeatedly after the handle is started. If the handle was started +// with a directory the filename parameter will be a relative path to +// a file contained in the directory. The events parameter is an ORed +// mask of uv_fs_event elements. +typedef void (*uv_fs_event_cb)(uv_fs_event_t* handle, const char* filename, int events, int status); + +typedef struct { + long tv_sec; + long tv_nsec; +} uv_timespec_t; + +typedef struct { + uint64_t st_dev; + uint64_t st_mode; + uint64_t st_nlink; + uint64_t st_uid; + uint64_t st_gid; + uint64_t st_rdev; + uint64_t st_ino; + uint64_t st_size; + uint64_t st_blksize; + uint64_t st_blocks; + uint64_t st_flags; + uint64_t st_gen; + uv_timespec_t st_atim; + uv_timespec_t st_mtim; + uv_timespec_t st_ctim; + uv_timespec_t st_birthtim; +} uv_stat_t; + +typedef void (*uv_fs_poll_cb)(uv_fs_poll_t* handle, int status, const uv_stat_t* prev, const uv_stat_t* curr); + +// loop functions +uv_loop_t *uv_default_loop(); +uv_loop_t* uv_loop_new(); // not documented; neither is uv_loop_delete +int uv_loop_init(uv_loop_t* loop); +int uv_loop_fork(uv_loop_t* loop); +int uv_loop_alive(const uv_loop_t *loop); +int uv_loop_close(uv_loop_t* loop); +uint64_t uv_backend_timeout(uv_loop_t* loop); +int uv_run(uv_loop_t *, uv_run_mode mode); +int uv_backend_fd(const uv_loop_t* loop); +// The narrative docs for the two time functions say 'const', +// but the header does not. +void uv_update_time(uv_loop_t* loop); +uint64_t uv_now(uv_loop_t* loop); +void uv_stop(uv_loop_t *); +void uv_walk(uv_loop_t *loop, uv_walk_cb walk_cb, void *arg); + +// handle functions +// uv_handle_t is the base type for all libuv handle types. + +void uv_ref(void *); +void uv_unref(void *); +int uv_has_ref(void *); +void uv_close(void *handle, uv_close_cb close_cb); +int uv_is_active(void *handle); +int uv_is_closing(void *handle); + +// idle functions +// Idle handles will run the given callback once per loop iteration, right +// before the uv_prepare_t handles. Note: The notable difference with prepare +// handles is that when there are active idle handles, the loop will perform a +// zero timeout poll instead of blocking for i/o. Warning: Despite the name, +// idle handles will get their callbacks called on every loop iteration, not +// when the loop is actually "idle". +int uv_idle_init(uv_loop_t *, uv_idle_t *idle); +int uv_idle_start(uv_idle_t *idle, uv_idle_cb cb); +int uv_idle_stop(uv_idle_t *idle); + +// prepare functions +// Prepare handles will run the given callback once per loop iteration, right +// before polling for i/o. +int uv_prepare_init(uv_loop_t *, uv_prepare_t *prepare); +int uv_prepare_start(uv_prepare_t *prepare, uv_prepare_cb cb); +int uv_prepare_stop(uv_prepare_t *prepare); + +// check functions +// Check handles will run the given callback once per loop iteration, right +int uv_check_init(uv_loop_t *, uv_check_t *check); +int uv_check_start(uv_check_t *check, uv_check_cb cb); +int uv_check_stop(uv_check_t *check); + +// async functions +// Async handles allow the user to "wakeup" the event loop and get a callback called from another thread. + +int uv_async_init(uv_loop_t *, uv_async_t*, uv_async_cb); +int uv_async_send(uv_async_t*); + +// timer functions +// Timer handles are used to schedule callbacks to be called in the future. +int uv_timer_init(uv_loop_t *, uv_timer_t *handle); +int uv_timer_start(uv_timer_t *handle, uv_timer_cb cb, uint64_t timeout, uint64_t repeat); +int uv_timer_stop(uv_timer_t *handle); +int uv_timer_again(uv_timer_t *handle); +void uv_timer_set_repeat(uv_timer_t *handle, uint64_t repeat); +uint64_t uv_timer_get_repeat(const uv_timer_t *handle); + +// signal functions +// Signal handles implement Unix style signal handling on a per-event loop +// bases. +int uv_signal_init(uv_loop_t *loop, uv_signal_t *handle); +int uv_signal_start(uv_signal_t *handle, uv_signal_cb signal_cb, int signum); +int uv_signal_stop(uv_signal_t *handle); + +// poll functions Poll handles are used to watch file descriptors for +// readability and writability, similar to the purpose of poll(2). It +// is not okay to have multiple active poll handles for the same +// socket, this can cause libuv to busyloop or otherwise malfunction. +// +// The purpose of poll handles is to enable integrating external +// libraries that rely on the event loop to signal it about the socket +// status changes, like c-ares or libssh2. Using uv_poll_t for any +// other purpose is not recommended; uv_tcp_t, uv_udp_t, etc. provide +// an implementation that is faster and more scalable than what can be +// achieved with uv_poll_t, especially on Windows. +// +// Note On windows only sockets can be polled with poll handles. On +// Unix any file descriptor that would be accepted by poll(2) can be +// used. +int uv_poll_init(uv_loop_t *loop, uv_poll_t *handle, int fd); + +// Initialize the handle using a socket descriptor. On Unix this is +// identical to uv_poll_init(). On windows it takes a SOCKET handle; +// SOCKET handles are another name for HANDLE objects in win32, and +// those are defined as PVOID, even though they are not actually +// pointers (they're small integers). CPython and PyPy both return +// the SOCKET (as cast to an int) from the socket.fileno() method. +// libuv uses ``uv_os_sock_t`` for this type, which is defined as an +// int on unix. +int uv_poll_init_socket(uv_loop_t* loop, uv_poll_t* handle, GEVENT_UV_OS_SOCK_T socket); +int uv_poll_start(uv_poll_t *handle, int events, uv_poll_cb cb); +int uv_poll_stop(uv_poll_t *handle); + +// FS Event handles allow the user to monitor a given path for +// changes, for example, if the file was renamed or there was a +// generic change in it. This handle uses the best backend for the job +// on each platform. +// +// Thereas also uv_fs_poll_t that uses stat for filesystems where +// the kernel event isn't available. +int uv_fs_event_init(uv_loop_t*, uv_fs_event_t*); +int uv_fs_event_start(uv_fs_event_t*, uv_fs_event_cb, const char* path, unsigned int flags); +int uv_fs_event_stop(uv_fs_event_t*); +int uv_fs_event_getpath(uv_fs_event_t*, char* buffer, size_t* size); + +// FS Poll handles allow the user to monitor a given path for changes. +// Unlike uv_fs_event_t, fs poll handles use stat to detect when a +// file has changed so they can work on file systems where fs event +// handles can't. +// +// This is a closer match to libev. +int uv_fs_poll_init(void*, void*); +int uv_fs_poll_start(void*, uv_fs_poll_cb, const char* path, unsigned int); +int uv_fs_poll_stop(void*); + + +/* Standard library */ +void* memset(void *b, int c, size_t len); + + +/* gevent callbacks */ +// Implemented in Python code as 'def_extern'. In the case of poll callbacks and fs +// callbacks, if *status* is less than 0, it will be passed in the revents +// field. In cases of no extra arguments, revents will be 0. +// These will be created as static functions at the end of the +// _source.c and must be pre-declared at the top of that file if we +// call them +typedef void* GeventWatcherObject; +extern "Python" { + // Standard gevent._ffi.loop callbacks. + int python_callback(GeventWatcherObject handle, int revents); + void python_handle_error(GeventWatcherObject handle, int revents); + void python_stop(GeventWatcherObject handle); + + void python_check_callback(uv_check_t* handle); + void python_prepare_callback(uv_prepare_t* handle); + void python_timer0_callback(uv_check_t* handle); + + // libuv specific callback + void _uv_close_callback(uv_handle_t* handle); + void python_sigchld_callback(uv_signal_t* handle, int signum); + void python_queue_callback(uv_handle_t* handle, int revents); +} +// A variable we fill in. +static void (*gevent_noop)(void* handle); + +static void _gevent_signal_callback1(uv_signal_t* handle, int arg); +static void _gevent_async_callback0(uv_async_t* handle); +static void _gevent_prepare_callback0(uv_prepare_t* handle); +static void _gevent_timer_callback0(uv_timer_t* handle); +static void _gevent_check_callback0(uv_check_t* handle); +static void _gevent_idle_callback0(uv_idle_t* handle); +static void _gevent_poll_callback2(uv_poll_t* handle, int status, int events); +static void _gevent_fs_event_callback3(uv_fs_event_t* handle, const char* filename, int events, int status); + +typedef struct _gevent_fs_poll_s { + uv_fs_poll_t handle; + uv_stat_t curr; + uv_stat_t prev; +} gevent_fs_poll_t; + +static void _gevent_fs_poll_callback3(uv_fs_poll_t* handle, int status, const uv_stat_t* prev, const uv_stat_t* curr); + +static void gevent_uv_walk_callback_close(uv_handle_t* handle, void* arg); +static void gevent_close_all_handles(uv_loop_t* loop); +static void gevent_zero_timer(uv_timer_t* handle); +static void gevent_zero_prepare(uv_prepare_t* handle); +static void gevent_zero_check(uv_check_t* handle); +static void gevent_zero_loop(uv_loop_t* handle); diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/libuv/_corecffi_source.c b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/libuv/_corecffi_source.c new file mode 100644 index 00000000..83fe82ee --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/libuv/_corecffi_source.c @@ -0,0 +1,181 @@ +#include +#include "uv.h" + +typedef void* GeventWatcherObject; + +static int python_callback(GeventWatcherObject handle, int revents); +static void python_queue_callback(uv_handle_t* watcher_ptr, int revents); +static void python_handle_error(GeventWatcherObject handle, int revents); +static void python_stop(GeventWatcherObject handle); + +static void _gevent_noop(void* handle) {} + +static void (*gevent_noop)(void* handle) = &_gevent_noop; + +static void _gevent_generic_callback1_unused(uv_handle_t* watcher, int arg) +{ + // Python code may set this to NULL or even change it + // out from under us, which would tend to break things. + GeventWatcherObject handle = watcher->data; + const int cb_result = python_callback(handle, arg); + switch(cb_result) { + case -1: + // in case of exception, call self.loop.handle_error; + // this function is also responsible for stopping the watcher + // and allowing memory to be freed + python_handle_error(handle, arg); + break; + case 1: + // Code to stop the event IF NEEDED. Note that if python_callback + // has disposed of the last reference to the handle, + // `watcher` could now be invalid/disposed memory! + if (!uv_is_active(watcher)) { + if (watcher->data != handle) { + if (watcher->data) { + // If Python set the data to NULL, then they + // expected to be stopped. That's fine. + // Otherwise, something weird happened. + fprintf(stderr, + "WARNING: gevent: watcher handle changed in callback " + "from %p to %p for watcher at %p of type %d\n", + handle, watcher->data, watcher, watcher->type); + // There's a very good chance that the object the + // handle referred to has been changed and/or the + // old handle has been deallocated (most common), so + // passing the old handle will crash. Instead we + // pass a sigil to let python distinguish this case. + python_stop(NULL); + } + } + else { + python_stop(handle); + } + } + break; + case 2: + // watcher is already stopped and dead, nothing to do. + break; + default: + fprintf(stderr, + "WARNING: gevent: Unexpected return value %d from Python callback " + "for watcher %p (of type %d) and handle %p\n", + cb_result, + watcher, watcher->type, handle); + // XXX: Possible leaking of resources here? Should we be + // closing the watcher? + } +} + + +static void _gevent_generic_callback1(uv_handle_t* watcher, int arg) +{ + python_queue_callback(watcher, arg); +} + +static void _gevent_generic_callback0(uv_handle_t* handle) +{ + _gevent_generic_callback1(handle, 0); +} + +static void _gevent_async_callback0(uv_async_t* handle) +{ + _gevent_generic_callback0((uv_handle_t*)handle); +} + +static void _gevent_timer_callback0(uv_timer_t* handle) +{ + _gevent_generic_callback0((uv_handle_t*)handle); +} + +static void _gevent_prepare_callback0(uv_prepare_t* handle) +{ + _gevent_generic_callback0((uv_handle_t*)handle); +} + +static void _gevent_check_callback0(uv_check_t* handle) +{ + _gevent_generic_callback0((uv_handle_t*)handle); +} + +static void _gevent_idle_callback0(uv_idle_t* handle) +{ + _gevent_generic_callback0((uv_handle_t*)handle); +} + +static void _gevent_signal_callback1(uv_signal_t* handle, int signum) +{ + _gevent_generic_callback1((uv_handle_t*)handle, signum); +} + + +static void _gevent_poll_callback2(void* handle, int status, int events) +{ + _gevent_generic_callback1(handle, status < 0 ? status : events); +} + +static void _gevent_fs_event_callback3(void* handle, const char* filename, int events, int status) +{ + _gevent_generic_callback1(handle, status < 0 ? status : events); +} + + +typedef struct _gevent_fs_poll_s { + uv_fs_poll_t handle; + uv_stat_t curr; + uv_stat_t prev; +} gevent_fs_poll_t; + +static void _gevent_fs_poll_callback3(void* handlep, int status, const uv_stat_t* prev, const uv_stat_t* curr) +{ + // stat pointers are valid for this callback only. + // if given, copy them into our structure, where they can be reached + // from python, just like libev's watcher does, before calling + // the callback. + + // The callback is invoked with status < 0 if path does not exist + // or is inaccessible. The watcher is not stopped but your + // callback is not called again until something changes (e.g. when + // the file is created or the error reason changes). + // In that case the fields will be 0 in curr/prev. + + + gevent_fs_poll_t* handle = (gevent_fs_poll_t*)handlep; + assert(status == 0); + + handle->curr = *curr; + handle->prev = *prev; + + _gevent_generic_callback1((uv_handle_t*)handle, 0); +} + +static void gevent_uv_walk_callback_close(uv_handle_t* handle, void* arg) +{ + if( handle && !uv_is_closing(handle) ) { + uv_close(handle, NULL); + } +} + +static void gevent_close_all_handles(uv_loop_t* loop) +{ + uv_walk(loop, gevent_uv_walk_callback_close, NULL); +} + +static void gevent_zero_timer(uv_timer_t* handle) +{ + memset(handle, 0, sizeof(uv_timer_t)); +} + +static void gevent_zero_check(uv_check_t* handle) +{ + memset(handle, 0, sizeof(uv_check_t)); +} + +static void gevent_zero_prepare(uv_prepare_t* handle) +{ + memset(handle, 0, sizeof(uv_prepare_t)); +} + +static void gevent_zero_loop(uv_loop_t* handle) +{ + memset(handle, 0, sizeof(uv_loop_t)); +} diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/libuv/loop.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/libuv/loop.py new file mode 100644 index 00000000..5f7ff815 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/libuv/loop.py @@ -0,0 +1,602 @@ +""" +libuv loop implementation +""" +# pylint: disable=no-member +from __future__ import absolute_import, print_function + +import os +from collections import defaultdict +from collections import namedtuple +from operator import delitem +import signal + +from gevent._ffi import _dbg # pylint: disable=unused-import +from gevent._ffi.loop import AbstractLoop +from gevent.libuv import _corecffi # pylint:disable=no-name-in-module,import-error +from gevent._ffi.loop import assign_standard_callbacks +from gevent._ffi.loop import AbstractCallbacks +from gevent._util import implementer +from gevent._interfaces import ILoop + +ffi = _corecffi.ffi +libuv = _corecffi.lib + +__all__ = [ +] + + +class _Callbacks(AbstractCallbacks): + + def _find_loop_from_c_watcher(self, watcher_ptr): + loop_handle = ffi.cast('uv_handle_t*', watcher_ptr).data + return self.from_handle(loop_handle) if loop_handle else None + + def python_sigchld_callback(self, watcher_ptr, _signum): + self.from_handle(ffi.cast('uv_handle_t*', watcher_ptr).data)._sigchld_callback() + + def python_timer0_callback(self, watcher_ptr): + return self.python_prepare_callback(watcher_ptr) + + def python_queue_callback(self, watcher_ptr, revents): + watcher_handle = watcher_ptr.data + the_watcher = self.from_handle(watcher_handle) + + the_watcher.loop._queue_callback(watcher_ptr, revents) + + +_callbacks = assign_standard_callbacks( + ffi, libuv, _Callbacks, + [('python_sigchld_callback', None), + ('python_timer0_callback', None), + ('python_queue_callback', None)]) + +from gevent._ffi.loop import EVENTS +GEVENT_CORE_EVENTS = EVENTS # export + +from gevent.libuv import watcher as _watchers # pylint:disable=no-name-in-module + +_events_to_str = _watchers._events_to_str # export + +READ = libuv.UV_READABLE +WRITE = libuv.UV_WRITABLE + +def get_version(): + uv_bytes = ffi.string(libuv.uv_version_string()) + if not isinstance(uv_bytes, str): + # Py3 + uv_str = uv_bytes.decode("ascii") + else: + uv_str = uv_bytes + + return 'libuv-' + uv_str + +def get_header_version(): + return 'libuv-%d.%d.%d' % (libuv.UV_VERSION_MAJOR, libuv.UV_VERSION_MINOR, libuv.UV_VERSION_PATCH) + +def supported_backends(): + return ['default'] + +@implementer(ILoop) +class loop(AbstractLoop): + + # libuv parameters simply won't accept anything lower than 1ms. In + # practice, looping on gevent.sleep(0.001) takes about 0.00138 s + # (+- 0.000036s) + approx_timer_resolution = 0.001 # 1ms + + error_handler = None + + _CHECK_POINTER = 'uv_check_t *' + + _PREPARE_POINTER = 'uv_prepare_t *' + _PREPARE_CALLBACK_SIG = "void(*)(void*)" + + _TIMER_POINTER = _CHECK_POINTER # This is poorly named. It's for the callback "timer" + + def __init__(self, flags=None, default=None): + AbstractLoop.__init__(self, ffi, libuv, _watchers, flags, default) + self.__loop_pid = os.getpid() + self._child_watchers = defaultdict(list) + self._io_watchers = dict() + self._fork_watchers = set() + self._pid = os.getpid() + self._default = self._ptr == libuv.uv_default_loop() + self._queued_callbacks = [] + + def _queue_callback(self, watcher_ptr, revents): + self._queued_callbacks.append((watcher_ptr, revents)) + + def _init_loop(self, flags, default): + if default is None: + default = True + # Unlike libev, libuv creates a new default + # loop automatically if the old default loop was + # closed. + + if default: + # XXX: If the default loop had been destroyed, this + # will create a new one, but we won't destroy it + ptr = libuv.uv_default_loop() + else: + ptr = libuv.uv_loop_new() + + + if not ptr: + raise SystemError("Failed to get loop") + + # Track whether or not any object has destroyed + # this loop. See _can_destroy_default_loop + ptr.data = ptr + return ptr + + _signal_idle = None + + def _init_and_start_check(self): + libuv.uv_check_init(self._ptr, self._check) + libuv.uv_check_start(self._check, libuv.python_check_callback) + libuv.uv_unref(self._check) + + # We also have to have an idle watcher to be able to handle + # signals in a timely manner. Without them, libuv won't loop again + # and call into its check and prepare handlers. + # Note that this basically forces us into a busy-loop + # XXX: As predicted, using an idle watcher causes our process + # to eat 100% CPU time. We instead use a timer with a max of a .3 second + # delay to notice signals. Note that this timeout also implements fork + # watchers, effectively. + + # XXX: Perhaps we could optimize this to notice when there are other + # timers in the loop and start/stop it then. When we have a callback + # scheduled, this should also be the same and unnecessary? + # libev does takes this basic approach on Windows. + self._signal_idle = ffi.new("uv_timer_t*") + libuv.uv_timer_init(self._ptr, self._signal_idle) + self._signal_idle.data = self._handle_to_self + sig_cb = ffi.cast('void(*)(uv_timer_t*)', libuv.python_check_callback) + libuv.uv_timer_start(self._signal_idle, + sig_cb, + 300, + 300) + libuv.uv_unref(self._signal_idle) + + def _run_callbacks(self): + # Manually handle fork watchers. + curpid = os.getpid() + if curpid != self._pid: + self._pid = curpid + for watcher in self._fork_watchers: + watcher._on_fork() + + + # The contents of queued_callbacks at this point should be timers + # that expired when the loop began along with any idle watchers. + # We need to run them so that any manual callbacks they want to schedule + # get added to the list and ran next before we go on to poll for IO. + # This is critical for libuv on linux: closing a socket schedules some manual + # callbacks to actually stop the watcher; if those don't run before + # we poll for IO, then libuv can abort the process for the closed file descriptor. + + # XXX: There's still a race condition here because we may not run *all* the manual + # callbacks. We need a way to prioritize those. + + # Running these before the manual callbacks lead to some + # random test failures. In test__event.TestEvent_SetThenClear + # we would get a LoopExit sometimes. The problem occurred when + # a timer expired on entering the first loop; we would process + # it there, and then process the callback that it created + # below, leaving nothing for the loop to do. Having the + # self.run() manually process manual callbacks before + # continuing solves the problem. (But we must still run callbacks + # here again.) + self._prepare_ran_callbacks = self.__run_queued_callbacks() + + super(loop, self)._run_callbacks() + + def _init_and_start_prepare(self): + libuv.uv_prepare_init(self._ptr, self._prepare) + libuv.uv_prepare_start(self._prepare, libuv.python_prepare_callback) + libuv.uv_unref(self._prepare) + + def _init_callback_timer(self): + libuv.uv_check_init(self._ptr, self._timer0) + + def _stop_callback_timer(self): + libuv.uv_check_stop(self._timer0) + + def _start_callback_timer(self): + # The purpose of the callback timer is to ensure that we run + # callbacks as soon as possible on the next iteration of the event loop. + + # In libev, we set a 0 duration timer with a no-op callback. + # This executes immediately *after* the IO poll is done (it + # actually determines the time that the IO poll will block + # for), so having the timer present simply spins the loop, and + # our normal prepare watcher kicks in to run the callbacks. + + # In libuv, however, timers are run *first*, before prepare + # callbacks and before polling for IO. So a no-op 0 duration + # timer actually does *nothing*. (Also note that libev queues all + # watchers found during IO poll to run at the end (I think), while libuv + # runs them in uv__io_poll itself.) + + # From the loop inside uv_run: + # while True: + # uv__update_time(loop); + # uv__run_timers(loop); + # # we don't use pending watchers. They are how libuv + # # implements the pipe/udp/tcp streams. + # ran_pending = uv__run_pending(loop); + # uv__run_idle(loop); + # uv__run_prepare(loop); + # ... + # uv__io_poll(loop, timeout); # <--- IO watchers run here! + # uv__run_check(loop); + + # libev looks something like this (pseudo code because the real code is + # hard to read): + # + # do { + # run_fork_callbacks(); + # run_prepare_callbacks(); + # timeout = min(time of all timers or normal block time) + # io_poll() # <--- Only queues IO callbacks + # update_now(); calculate_expired_timers(); + # run callbacks in this order: (although specificying priorities changes it) + # check + # stat + # child + # signal + # timer + # io + # } + + # So instead of running a no-op and letting the side-effect of spinning + # the loop run the callbacks, we must explicitly run them here. + + # If we don't, test__systemerror:TestCallback will be flaky, failing + # one time out of ~20, depending on timing. + + # To get them to run immediately after this current loop, + # we use a check watcher, instead of a 0 duration timer entirely. + # If we use a 0 duration timer, we can get stuck in a timer loop. + # Python 3.6 fails in test_ftplib.py + + # As a final note, if we have not yet entered the loop *at + # all*, and a timer was created with a duration shorter than + # the amount of time it took for us to enter the loop in the + # first place, it may expire and get called before our callback + # does. This could also lead to test__systemerror:TestCallback + # appearing to be flaky. + + # As yet another final note, if we are currently running a + # timer callback, meaning we're inside uv__run_timers() in C, + # and the Python starts a new timer, if the Python code then + # update's the loop's time, it's possible that timer will + # expire *and be run in the same iteration of the loop*. This + # is trivial to do: In sequential code, anything after + # `gevent.sleep(0.1)` is running in a timer callback. Starting + # a new timer---e.g., another gevent.sleep() call---will + # update the time, *before* uv__run_timers exits, meaning + # other timers get a chance to run before our check or prepare + # watcher callbacks do. Therefore, we do indeed have to have a 0 + # timer to run callbacks---it gets inserted before any other user + # timers---ideally, this should be especially careful about how much time + # it runs for. + + # AND YET: We can't actually do that. We get timeouts that I haven't fully + # investigated if we do. Probably stuck in a timer loop. + + # As a partial remedy to this, unlike libev, our timer watcher + # class doesn't update the loop time by default. + + libuv.uv_check_start(self._timer0, libuv.python_timer0_callback) + + + def _stop_aux_watchers(self): + assert self._prepare + assert self._check + assert self._signal_idle + libuv.uv_prepare_stop(self._prepare) + libuv.uv_ref(self._prepare) # Why are we doing this? + + libuv.uv_check_stop(self._check) + libuv.uv_ref(self._check) + + libuv.uv_timer_stop(self._signal_idle) + libuv.uv_ref(self._signal_idle) + + libuv.uv_check_stop(self._timer0) + + def _setup_for_run_callback(self): + self._start_callback_timer() + libuv.uv_ref(self._timer0) + + + def _can_destroy_loop(self, ptr): + # We're being asked to destroy a loop that's, + # at the time it was constructed, was the default loop. + # If loop objects were constructed more than once, + # it may have already been destroyed, though. + # We track this in the data member. + return ptr.data + + def _destroy_loop(self, ptr): + ptr.data = ffi.NULL + libuv.uv_stop(ptr) + + libuv.gevent_close_all_handles(ptr) + + closed_failed = libuv.uv_loop_close(ptr) + if closed_failed: + assert closed_failed == libuv.UV_EBUSY + # We already closed all the handles. Run the loop + # once to let them be cut off from the loop. + ran_has_more_callbacks = libuv.uv_run(ptr, libuv.UV_RUN_ONCE) + if ran_has_more_callbacks: + libuv.uv_run(ptr, libuv.UV_RUN_NOWAIT) + closed_failed = libuv.uv_loop_close(ptr) + assert closed_failed == 0, closed_failed + + # Destroy the native resources *after* we have closed + # the loop. If we do it before, walking the handles + # attached to the loop is likely to segfault. + + libuv.gevent_zero_check(self._check) + libuv.gevent_zero_check(self._timer0) + libuv.gevent_zero_prepare(self._prepare) + libuv.gevent_zero_timer(self._signal_idle) + del self._check + del self._prepare + del self._signal_idle + del self._timer0 + + libuv.gevent_zero_loop(ptr) + + # Destroy any watchers we're still holding on to. + del self._io_watchers + del self._fork_watchers + del self._child_watchers + + + def debug(self): + """ + Return all the handles that are open and their ref status. + """ + handle_state = namedtuple("HandleState", + ['handle', + 'type', + 'watcher', + 'ref', + 'active', + 'closing']) + handles = [] + + # XXX: Convert this to a modern callback. + def walk(handle, _arg): + data = handle.data + if data: + watcher = ffi.from_handle(data) + else: + watcher = None + handles.append(handle_state(handle, + ffi.string(libuv.uv_handle_type_name(handle.type)), + watcher, + libuv.uv_has_ref(handle), + libuv.uv_is_active(handle), + libuv.uv_is_closing(handle))) + + libuv.uv_walk(self._ptr, + ffi.callback("void(*)(uv_handle_t*,void*)", + walk), + ffi.NULL) + return handles + + def ref(self): + pass + + def unref(self): + # XXX: Called by _run_callbacks. + pass + + def break_(self, how=None): + libuv.uv_stop(self._ptr) + + def reinit(self): + # TODO: How to implement? We probably have to simply + # re-__init__ this whole class? Does it matter? + # OR maybe we need to uv_walk() and close all the handles? + + # XXX: libuv < 1.12 simply CANNOT handle a fork unless you immediately + # exec() in the child. There are multiple calls to abort() that + # will kill the child process: + # - The OS X poll implementation (kqueue) aborts on an error return + # value; since kqueue FDs can't be inherited, then the next call + # to kqueue in the child will fail and get aborted; fork() is likely + # to be called during the gevent loop, meaning we're deep inside the + # runloop already, so we can't even close the loop that we're in: + # it's too late, the next call to kqueue is already scheduled. + # - The threadpool, should it be in use, also aborts + # (https://github.com/joyent/libuv/pull/1136) + # - There global shared state that breaks signal handling + # and leads to an abort() in the child, EVEN IF the loop in the parent + # had already been closed + # (https://github.com/joyent/libuv/issues/1405) + + # In 1.12, the uv_loop_fork function was added (by gevent!) + libuv.uv_loop_fork(self._ptr) + + _prepare_ran_callbacks = False + + def __run_queued_callbacks(self): + if not self._queued_callbacks: + return False + + cbs = list(self._queued_callbacks) + self._queued_callbacks = [] + + for watcher_ptr, arg in cbs: + handle = watcher_ptr.data + if not handle: + # It's been stopped and possibly closed + assert not libuv.uv_is_active(watcher_ptr) + continue + val = _callbacks.python_callback(handle, arg) + if val == -1: + _callbacks.python_handle_error(handle, arg) + elif val == 1: + if not libuv.uv_is_active(watcher_ptr): + if watcher_ptr.data != handle: + if watcher_ptr.data: + _callbacks.python_stop(None) + else: + _callbacks.python_stop(handle) + return True + + + def run(self, nowait=False, once=False): + # we can only respect one flag or the other. + # nowait takes precedence because it can't block + mode = libuv.UV_RUN_DEFAULT + if once: + mode = libuv.UV_RUN_ONCE + if nowait: + mode = libuv.UV_RUN_NOWAIT + + if mode == libuv.UV_RUN_DEFAULT: + while self._ptr and self._ptr.data: + # This is here to better preserve order guarantees. See _run_callbacks + # for details. + # It may get run again from the prepare watcher, so potentially we + # could take twice as long as the switch interval. + self._run_callbacks() + self._prepare_ran_callbacks = False + ran_status = libuv.uv_run(self._ptr, libuv.UV_RUN_ONCE) + # Note that we run queued callbacks when the prepare watcher runs, + # thus accounting for timers that expired before polling for IO, + # and idle watchers. This next call should get IO callbacks and + # callbacks from timers that expired *after* polling for IO. + ran_callbacks = self.__run_queued_callbacks() + + if not ran_status and not ran_callbacks and not self._prepare_ran_callbacks: + # A return of 0 means there are no referenced and + # active handles. The loop is over. + # If we didn't run any callbacks, then we couldn't schedule + # anything to switch in the future, so there's no point + # running again. + return ran_status + return 0 # Somebody closed the loop + + result = libuv.uv_run(self._ptr, mode) + self.__run_queued_callbacks() + return result + + def now(self): + # libuv's now is expressed as an integer number of + # milliseconds, so to get it compatible with time.time units + # that this method is supposed to return, we have to divide by 1000.0 + now = libuv.uv_now(self._ptr) + return now / 1000.0 + + def update_now(self): + libuv.uv_update_time(self._ptr) + + def fileno(self): + if self._ptr: + fd = libuv.uv_backend_fd(self._ptr) + if fd >= 0: + return fd + + _sigchld_watcher = None + _sigchld_callback_ffi = None + + def install_sigchld(self): + if not self.default: + return + + if self._sigchld_watcher: + return + + self._sigchld_watcher = ffi.new('uv_signal_t*') + libuv.uv_signal_init(self._ptr, self._sigchld_watcher) + self._sigchld_watcher.data = self._handle_to_self + + libuv.uv_signal_start(self._sigchld_watcher, + libuv.python_sigchld_callback, + signal.SIGCHLD) + + def reset_sigchld(self): + if not self.default or not self._sigchld_watcher: + return + + libuv.uv_signal_stop(self._sigchld_watcher) + # Must go through this to manage the memory lifetime + # correctly. Alternately, we could just stop it and restart + # it in install_sigchld? + _watchers.watcher._watcher_ffi_close(self._sigchld_watcher) + del self._sigchld_watcher + + + def _sigchld_callback(self): + # Signals can arrive at (relatively) any time. To eliminate + # race conditions, and behave more like libev, we "queue" + # sigchld to run when we run callbacks. + while True: + try: + pid, status, _usage = os.wait3(os.WNOHANG) + except OSError: + # Python 3 raises ChildProcessError + break + + if pid == 0: + break + children_watchers = self._child_watchers.get(pid, []) + self._child_watchers.get(0, []) + for watcher in children_watchers: + self.run_callback(watcher._set_waitpid_status, pid, status) + + # Don't invoke child watchers for 0 more than once + self._child_watchers[0] = [] + + def _register_child_watcher(self, watcher): + self._child_watchers[watcher._pid].append(watcher) + + def _unregister_child_watcher(self, watcher): + try: + # stop() should be idempotent + self._child_watchers[watcher._pid].remove(watcher) + except ValueError: + pass + + # Now's a good time to clean up any dead lists we don't need + # anymore + for pid in list(self._child_watchers): + if not self._child_watchers[pid]: + del self._child_watchers[pid] + + def io(self, fd, events, ref=True, priority=None): + # We rely on hard references here and explicit calls to + # close() on the returned object to correctly manage + # the watcher lifetimes. + + io_watchers = self._io_watchers + try: + io_watcher = io_watchers[fd] + assert io_watcher._multiplex_watchers, ("IO Watcher %s unclosed but should be dead" % io_watcher) + except KeyError: + # Start the watcher with just the events that we're interested in. + # as multiplexers are added, the real event mask will be updated to keep in sync. + # If we watch for too much, we get spurious wakeups and busy loops. + io_watcher = self._watchers.io(self, fd, 0) + io_watchers[fd] = io_watcher + io_watcher._no_more_watchers = lambda: delitem(io_watchers, fd) + + return io_watcher.multiplex(events) + + def prepare(self, ref=True, priority=None): + # We run arbitrary code in python_prepare_callback. That could switch + # greenlets. If it does that while also manipulating the active prepare + # watchers, we could corrupt the process state, since the prepare watcher + # queue is iterated on the stack (on unix). We could workaround this by implementing + # prepare watchers in pure Python. + # See https://github.com/gevent/gevent/issues/1126 + raise TypeError("prepare watchers are not currently supported in libuv. " + "If you need them, please contact the maintainers.") diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/libuv/watcher.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/libuv/watcher.py new file mode 100644 index 00000000..84a8ca4e --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/libuv/watcher.py @@ -0,0 +1,735 @@ +# pylint: disable=too-many-lines, protected-access, redefined-outer-name, not-callable +# pylint: disable=no-member +from __future__ import absolute_import, print_function + +import functools +import sys + +from gevent.libuv import _corecffi # pylint:disable=no-name-in-module,import-error + +# Nothing public here +__all__ = [] + +ffi = _corecffi.ffi +libuv = _corecffi.lib + +from gevent._ffi import watcher as _base +from gevent._ffi import _dbg + +_closing_watchers = set() + +# In debug mode, it would be nice to be able to clear the memory of +# the watcher (its size determined by +# libuv.uv_handle_size(ffi_watcher.type)) using memset so that if we +# are using it after it's supposedly been closed and deleted, we'd +# catch it sooner. BUT doing so breaks test__threadpool. We get errors +# about `pthread_mutex_lock[3]: Invalid argument` (and sometimes we +# crash) suggesting either that we're writing on memory that doesn't +# belong to us, somehow, or that we haven't actually lost all +# references... +_uv_close_callback = ffi.def_extern(name='_uv_close_callback')(_closing_watchers.remove) + + +_events = [(libuv.UV_READABLE, "READ"), + (libuv.UV_WRITABLE, "WRITE")] + +def _events_to_str(events): # export + return _base.events_to_str(events, _events) + +class UVFuncallError(ValueError): + pass + +class libuv_error_wrapper(object): + # Makes sure that everything stored as a function + # on the wrapper instances (classes, actually, + # because this is used by the metaclass) + # checks its return value and raises an error. + # This expects that everything we call has an int + # or void return value and follows the conventions + # of error handling (that negative values are errors) + def __init__(self, uv): + self._libuv = uv + + def __getattr__(self, name): + libuv_func = getattr(self._libuv, name) + + @functools.wraps(libuv_func) + def wrap(*args, **kwargs): + if args and isinstance(args[0], watcher): + args = args[1:] + res = libuv_func(*args, **kwargs) + if res is not None and res < 0: + raise UVFuncallError( + str(ffi.string(libuv.uv_err_name(res)).decode('ascii') + + ' ' + + ffi.string(libuv.uv_strerror(res)).decode('ascii')) + + " Args: " + repr(args) + " KWARGS: " + repr(kwargs) + ) + return res + + setattr(self, name, wrap) + + return wrap + + +class ffi_unwrapper(object): + # undoes the wrapping of libuv_error_wrapper for + # the methods used by the metaclass that care + + def __init__(self, ff): + self._ffi = ff + + def __getattr__(self, name): + return getattr(self._ffi, name) + + def addressof(self, lib, name): + assert isinstance(lib, libuv_error_wrapper) + return self._ffi.addressof(libuv, name) + + +class watcher(_base.watcher): + _FFI = ffi_unwrapper(ffi) + _LIB = libuv_error_wrapper(libuv) + + _watcher_prefix = 'uv' + _watcher_struct_pattern = '%s_t' + + @classmethod + def _watcher_ffi_close(cls, ffi_watcher): + # Managing the lifetime of _watcher is tricky. + # They have to be uv_close()'d, but that only + # queues them to be closed in the *next* loop iteration. + # The memory must stay valid for at least that long, + # or assert errors are triggered. We can't use a ffi.gc() + # pointer to queue the uv_close, because by the time the + # destructor is called, there's no way to keep the memory alive + # and it could be re-used. + # So here we resort to resurrecting the pointer object out + # of our scope, keeping it alive past this object's lifetime. + # We then use the uv_close callback to handle removing that + # reference. There's no context passed to the close callback, + # so we have to do this globally. + + # Sadly, doing this causes crashes if there were multiple + # watchers for a given FD, so we have to take special care + # about that. See https://github.com/gevent/gevent/issues/790#issuecomment-208076604 + + # Note that this cannot be a __del__ method, because we store + # the CFFI handle to self on self, which is a cycle, and + # objects with a __del__ method cannot be collected on CPython < 3.4 + + # Instead, this is arranged as a callback to GC when the + # watcher class dies. Obviously it's important to keep the ffi + # watcher alive. + # We can pass in "subclasses" if uv_handle_t that line up at the C level, + # but that don't in CFFI without a cast. But be careful what we use the cast + # for, don't pass it back to C. + ffi_handle_watcher = cls._FFI.cast('uv_handle_t*', ffi_watcher) + if ffi_handle_watcher.type and not libuv.uv_is_closing(ffi_watcher): + # If the type isn't set, we were never properly initialized, + # and trying to close it results in libuv terminating the process. + # Sigh. Same thing if it's already in the process of being + # closed. + _closing_watchers.add(ffi_watcher) + libuv.uv_close(ffi_watcher, libuv._uv_close_callback) + + ffi_handle_watcher.data = ffi.NULL + + + def _watcher_ffi_set_init_ref(self, ref): + self.ref = ref + + def _watcher_ffi_init(self, args): + # TODO: we could do a better job chokepointing this + return self._watcher_init(self.loop.ptr, + self._watcher, + *args) + + def _watcher_ffi_start(self): + self._watcher_start(self._watcher, self._watcher_callback) + + def _watcher_ffi_stop(self): + if self._watcher: + # The multiplexed io watcher deletes self._watcher + # when it closes down. If that's in the process of + # an error handler, AbstractCallbacks.unhandled_onerror + # will try to close us again. + self._watcher_stop(self._watcher) + + @_base.only_if_watcher + def _watcher_ffi_ref(self): + libuv.uv_ref(self._watcher) + + @_base.only_if_watcher + def _watcher_ffi_unref(self): + libuv.uv_unref(self._watcher) + + def _watcher_ffi_start_unref(self): + pass + + def _watcher_ffi_stop_ref(self): + pass + + def _get_ref(self): + # Convert 1/0 to True/False + if self._watcher is None: + return None + return bool(libuv.uv_has_ref(self._watcher)) + + def _set_ref(self, value): + if value: + self._watcher_ffi_ref() + else: + self._watcher_ffi_unref() + + ref = property(_get_ref, _set_ref) + + def feed(self, _revents, _callback, *_args): + raise Exception("Not implemented") + +class io(_base.IoMixin, watcher): + _watcher_type = 'poll' + _watcher_callback_name = '_gevent_poll_callback2' + + # On Windows is critical to be able to garbage collect these + # objects in a timely fashion so that they don't get reused + # for multiplexing completely different sockets. This is because + # uv_poll_init_socket does a lot of setup for the socket to make + # polling work. If get reused for another socket that has the same + # fileno, things break badly. (In theory this could be a problem + # on posix too, but in practice it isn't). + + # TODO: We should probably generalize this to all + # ffi watchers. Avoiding GC cycles as much as possible + # is a good thing, and potentially allocating new handles + # as needed gets us better memory locality. + + # Especially on Windows, we must also account for the case that a + # reference to this object has leaked (e.g., the socket object is + # still around), but the fileno has been closed and a new one + # opened. We must still get a new native watcher at that point. We + # handle this case by simply making sure that we don't even have + # a native watcher until the object is started, and we shut it down + # when the object is stopped. + + # XXX: I was able to solve at least Windows test_ftplib.py issues + # with more of a careful use of io objects in socket.py, so + # delaying this entirely is at least temporarily on hold. Instead + # sticking with the _watcher_create function override for the + # moment. + + # XXX: Note 2: Moving to a deterministic close model, which was necessary + # for PyPy, also seems to solve the Windows issues. So we're completely taking + # this object out of the loop's registration; we don't want GC callbacks and + # uv_close anywhere *near* this object. + + _watcher_registers_with_loop_on_create = False + + EVENT_MASK = libuv.UV_READABLE | libuv.UV_WRITABLE | libuv.UV_DISCONNECT + + _multiplex_watchers = () + + def __init__(self, loop, fd, events, ref=True, priority=None): + super(io, self).__init__(loop, fd, events, ref=ref, priority=priority, _args=(fd,)) + self._fd = fd + self._events = events + self._multiplex_watchers = [] + + def _get_fd(self): + return self._fd + + @_base.not_while_active + def _set_fd(self, fd): + self._fd = fd + self._watcher_ffi_init((fd,)) + + def _get_events(self): + return self._events + + def _set_events(self, events): + if events == self._events: + return + self._events = events + if self.active: + # We're running but libuv specifically says we can + # call start again to change our event mask. + assert self._handle is not None + self._watcher_start(self._watcher, self._events, self._watcher_callback) + + events = property(_get_events, _set_events) + + def _watcher_ffi_start(self): + self._watcher_start(self._watcher, self._events, self._watcher_callback) + + if sys.platform.startswith('win32'): + # uv_poll can only handle sockets on Windows, but the plain + # uv_poll_init we call on POSIX assumes that the fileno + # argument is already a C fileno, as created by + # _get_osfhandle. C filenos are limited resources, must be + # closed with _close. So there are lifetime issues with that: + # calling the C function _close to dispose of the fileno + # *also* closes the underlying win32 handle, possibly + # prematurely. (XXX: Maybe could do something with weak + # references? But to what?) + + # All libuv wants to do with the fileno in uv_poll_init is + # turn it back into a Win32 SOCKET handle. + + # Now, libuv provides uv_poll_init_socket, which instead of + # taking a C fileno takes the SOCKET, avoiding the need to dance with + # the C runtime. + + # It turns out that SOCKET (win32 handles in general) can be + # represented with `intptr_t`. It further turns out that + # CPython *directly* exposes the SOCKET handle as the value of + # fileno (32-bit PyPy does some munging on it, which should + # rarely matter). So we can pass socket.fileno() through + # to uv_poll_init_socket. + + # See _corecffi_build. + _watcher_init = watcher._LIB.uv_poll_init_socket + + + class _multiplexwatcher(object): + + callback = None + args = () + pass_events = False + ref = True + + def __init__(self, events, watcher): + self._events = events + + # References: + # These objects must keep the original IO object alive; + # the IO object SHOULD NOT keep these alive to avoid cycles + # We MUST NOT rely on GC to clean up the IO objects, but the explicit + # calls to close(); see _multiplex_closed. + self._watcher_ref = watcher + + events = property( + lambda self: self._events, + _base.not_while_active(lambda self, nv: setattr(self, '_events', nv))) + + def start(self, callback, *args, **kwargs): + self.pass_events = kwargs.get("pass_events") + self.callback = callback + self.args = args + + watcher = self._watcher_ref + if watcher is not None: + if not watcher.active: + watcher._io_start() + else: + # Make sure we're in the event mask + watcher._calc_and_update_events() + + def stop(self): + self.callback = None + self.pass_events = None + self.args = None + watcher = self._watcher_ref + if watcher is not None: + watcher._io_maybe_stop() + + def close(self): + if self._watcher_ref is not None: + self._watcher_ref._multiplex_closed(self) + self._watcher_ref = None + + @property + def active(self): + return self.callback is not None + + @property + def _watcher(self): + # For testing. + return self._watcher_ref._watcher + + # ares.pyx depends on this property, + # and test__core uses it too + fd = property(lambda self: getattr(self._watcher_ref, '_fd', -1), + lambda self, nv: self._watcher_ref._set_fd(nv)) + + def _io_maybe_stop(self): + self._calc_and_update_events() + for w in self._multiplex_watchers: + if w.callback is not None: + # There's still a reference to it, and it's started, + # so we can't stop. + return + # If we get here, nothing was started + # so we can take ourself out of the polling set + self.stop() + + def _io_start(self): + self._calc_and_update_events() + self.start(self._io_callback, pass_events=True) + + def _calc_and_update_events(self): + events = 0 + for watcher in self._multiplex_watchers: + if watcher.callback is not None: + # Only ask for events that are active. + events |= watcher.events + self._set_events(events) + + + def multiplex(self, events): + watcher = self._multiplexwatcher(events, self) + self._multiplex_watchers.append(watcher) + self._calc_and_update_events() + return watcher + + def close(self): + super(io, self).close() + del self._multiplex_watchers + + def _multiplex_closed(self, watcher): + self._multiplex_watchers.remove(watcher) + if not self._multiplex_watchers: + self.stop() # should already be stopped + self._no_more_watchers() + # It is absolutely critical that we control when the call + # to uv_close() gets made. uv_close() of a uv_poll_t + # handle winds up calling uv__platform_invalidate_fd, + # which, as the name implies, destroys any outstanding + # events for the *fd* that haven't been delivered yet, and also removes + # the *fd* from the poll set. So if this happens later, at some + # non-deterministic time when (cyclic or otherwise) GC runs, + # *and* we've opened a new watcher for the fd, that watcher will + # suddenly and mysteriously stop seeing events. So we do this now; + # this method is smart enough not to close the handle twice. + self.close() + else: + self._calc_and_update_events() + + def _no_more_watchers(self): + # The loop sets this on an individual watcher to delete it from + # the active list where it keeps hard references. + pass + + def _io_callback(self, events): + if events < 0: + # actually a status error code + _dbg("Callback error on", self._fd, + ffi.string(libuv.uv_err_name(events)), + ffi.string(libuv.uv_strerror(events))) + # XXX: We've seen one half of a FileObjectPosix pair + # (the read side of a pipe) report errno 11 'bad file descriptor' + # after the write side was closed and its watcher removed. But + # we still need to attempt to read from it to clear out what's in + # its buffers--if we return with the watcher inactive before proceeding to wake up + # the reader, we get a LoopExit. So we can't return here and arguably shouldn't print it + # either. The negative events mask will match the watcher's mask. + # See test__fileobject.py:Test.test_newlines for an example. + + # On Windows (at least with PyPy), we can get ENOTSOCK (socket operation on non-socket) + # if a socket gets closed. If we don't pass the events on, we hang. + # See test__makefile_ref.TestSSL for examples. + # return + + for watcher in self._multiplex_watchers: + if not watcher.callback: + # Stopped + continue + assert watcher._watcher_ref is self, (self, watcher._watcher_ref) + + send_event = (events & watcher.events) or events < 0 + if send_event: + if not watcher.pass_events: + watcher.callback(*watcher.args) + else: + watcher.callback(events, *watcher.args) + +class _SimulatedWithAsyncMixin(object): + _watcher_skip_ffi = True + + def __init__(self, loop, *args, **kwargs): + self._async = loop.async_() + try: + super(_SimulatedWithAsyncMixin, self).__init__(loop, *args, **kwargs) + except: + self._async.close() + raise + + def _watcher_create(self, _args): + return + + @property + def _watcher_handle(self): + return None + + def _watcher_ffi_init(self, _args): + return + + def _watcher_ffi_set_init_ref(self, ref): + self._async.ref = ref + + @property + def active(self): + return self._async.active + + def start(self, cb, *args): + self._register_loop_callback() + self.callback = cb + self.args = args + self._async.start(cb, *args) + #watcher.start(self, cb, *args) + + def stop(self): + self._unregister_loop_callback() + self.callback = None + self.args = None + self._async.stop() + + def close(self): + if self._async is not None: + a = self._async + #self._async = None + a.close() + + def _register_loop_callback(self): + # called from start() + raise NotImplementedError() + + def _unregister_loop_callback(self): + # called from stop + raise NotImplementedError() + +class fork(_SimulatedWithAsyncMixin, + _base.ForkMixin, + watcher): + # We'll have to implement this one completely manually + # Right now it doesn't matter much since libuv doesn't survive + # a fork anyway. (That's a work in progress) + _watcher_skip_ffi = False + + def _register_loop_callback(self): + self.loop._fork_watchers.add(self) + + def _unregister_loop_callback(self): + try: + # stop() should be idempotent + self.loop._fork_watchers.remove(self) + except KeyError: + pass + + def _on_fork(self): + self._async.send() + + +class child(_SimulatedWithAsyncMixin, + _base.ChildMixin, + watcher): + _watcher_skip_ffi = True + # We'll have to implement this one completely manually. + # Our approach is to use a SIGCHLD handler and the original + # os.waitpid call. + + # On Unix, libuv's uv_process_t and uv_spawn use SIGCHLD, + # just like libev does for its child watchers. So + # we're not adding any new SIGCHLD related issues not already + # present in libev. + + + def _register_loop_callback(self): + self.loop._register_child_watcher(self) + + def _unregister_loop_callback(self): + self.loop._unregister_child_watcher(self) + + def _set_waitpid_status(self, pid, status): + self._rpid = pid + self._rstatus = status + self._async.send() + + +class async_(_base.AsyncMixin, watcher): + _watcher_callback_name = '_gevent_async_callback0' + + def _watcher_ffi_init(self, args): + # It's dangerous to have a raw, non-initted struct + # around; it will crash in uv_close() when we get GC'd, + # and send() will also crash. + # NOTE: uv_async_init is NOT idempotent. Calling it more than + # once adds the uv_async_t to the internal queue multiple times, + # and uv_close only cleans up one of them, meaning that we tend to + # crash. Thus we have to be very careful not to allow that. + return self._watcher_init(self.loop.ptr, self._watcher, ffi.NULL) + + def _watcher_ffi_start(self): + # we're created in a started state, but we didn't provide a + # callback (because if we did and we don't have a value in our + # callback attribute, then python_callback would crash.) Note that + # uv_async_t->async_cb is not technically documented as public. + self._watcher.async_cb = self._watcher_callback + + def _watcher_ffi_stop(self): + self._watcher.async_cb = ffi.NULL + # We have to unref this because we're setting the cb behind libuv's + # back, basically: once a async watcher is started, it can't ever be + # stopped through libuv interfaces, so it would never lose its active + # status, and thus if it stays reffed it would keep the event loop + # from exiting. + self._watcher_ffi_unref() + + def send(self): + if libuv.uv_is_closing(self._watcher): + raise Exception("Closing handle") + libuv.uv_async_send(self._watcher) + + @property + def pending(self): + return None + +locals()['async'] = async_ + +class timer(_base.TimerMixin, watcher): + + _watcher_callback_name = '_gevent_timer_callback0' + + # In libuv, timer callbacks continue running while any timer is + # expired, including newly added timers. Newly added non-zero + # timers (especially of small duration) can be seen to be expired + # if the loop time is updated while we are in a timer callback. + # This can lead to us being stuck running timers for a terribly + # long time, which is not good. So default to not updating the + # time. + + # Also, newly-added timers of 0 duration can *also* stall the + # loop, because they'll be seen to be expired immediately. + # Updating the time can prevent that, *if* there was already a + # timer for a longer duration scheduled. + + # To mitigate the above problems, our loop implementation turns + # zero duration timers into check watchers instead using OneShotCheck. + # This ensures the loop cycles. Of course, the 'again' method does + # nothing on them and doesn't exist. In practice that's not an issue. + + _again = False + + def _watcher_ffi_init(self, args): + self._watcher_init(self.loop._ptr, self._watcher) + self._after, self._repeat = args + if self._after and self._after < 0.001: + import warnings + # XXX: The stack level is hard to determine, could be getting here + # through a number of different ways. + warnings.warn("libuv only supports millisecond timer resolution; " + "all times less will be set to 1 ms", + stacklevel=6) + # The alternative is to effectively pass in int(0.1) == 0, which + # means no sleep at all, which leads to excessive wakeups + self._after = 0.001 + if self._repeat and self._repeat < 0.001: + import warnings + warnings.warn("libuv only supports millisecond timer resolution; " + "all times less will be set to 1 ms", + stacklevel=6) + self._repeat = 0.001 + + def _watcher_ffi_start(self): + if self._again: + libuv.uv_timer_again(self._watcher) + else: + try: + self._watcher_start(self._watcher, self._watcher_callback, + int(self._after * 1000), + int(self._repeat * 1000)) + except ValueError: + # in case of non-ints in _after/_repeat + raise TypeError() + + def again(self, callback, *args, **kw): + if not self.active: + # If we've never been started, this is the same as starting us. + # libuv makes the distinction, libev doesn't. + self.start(callback, *args, **kw) + return + + self._again = True + try: + self.start(callback, *args, **kw) + finally: + del self._again + + +class stat(_base.StatMixin, watcher): + _watcher_type = 'fs_poll' + _watcher_struct_name = 'gevent_fs_poll_t' + _watcher_callback_name = '_gevent_fs_poll_callback3' + + def _watcher_set_data(self, the_watcher, data): + the_watcher.handle.data = data + return data + + def _watcher_ffi_init(self, args): + return self._watcher_init(self.loop._ptr, self._watcher) + + MIN_STAT_INTERVAL = 0.1074891 # match libev; 0.0 is default + + def _watcher_ffi_start(self): + # libev changes this when the watcher is started + if self._interval < self.MIN_STAT_INTERVAL: + self._interval = self.MIN_STAT_INTERVAL + self._watcher_start(self._watcher, self._watcher_callback, + self._cpath, + int(self._interval * 1000)) + + @property + def _watcher_handle(self): + return self._watcher.handle.data + + @property + def attr(self): + if not self._watcher.curr.st_nlink: + return + return self._watcher.curr + + @property + def prev(self): + if not self._watcher.prev.st_nlink: + return + return self._watcher.prev + + +class signal(_base.SignalMixin, watcher): + _watcher_callback_name = '_gevent_signal_callback1' + + def _watcher_ffi_init(self, args): + self._watcher_init(self.loop._ptr, self._watcher) + self.ref = False # libev doesn't ref these by default + + + def _watcher_ffi_start(self): + self._watcher_start(self._watcher, self._watcher_callback, + self._signalnum) + + +class idle(_base.IdleMixin, watcher): + # Because libuv doesn't support priorities, idle watchers are + # potentially quite a bit different than under libev + _watcher_callback_name = '_gevent_idle_callback0' + + +class check(_base.CheckMixin, watcher): + _watcher_callback_name = '_gevent_check_callback0' + +class OneShotCheck(check): + + _watcher_skip_ffi = True + + def __make_cb(self, func): + stop = self.stop + @functools.wraps(func) + def cb(*args): + stop() + return func(*args) + return cb + + def start(self, callback, *args): + return check.start(self, self.__make_cb(callback), *args) + +class prepare(_base.PrepareMixin, watcher): + _watcher_callback_name = '_gevent_prepare_callback0' diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/local.c b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/local.c new file mode 100644 index 00000000..2a4ef046 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/local.c @@ -0,0 +1,13993 @@ +/* Generated by Cython 0.29.2 */ + +/* BEGIN: Cython Metadata +{ + "distutils": { + "depends": [ + "src/gevent/_local.pxd", + "src\\gevent\\_local.pxd" + ], + "include_dirs": [ + "C:\\Python37-x64\\Include", + "deps" + ], + "name": "gevent._local", + "sources": [ + "src/gevent/local.py" + ] + }, + "module_name": "gevent._local" +} +END: Cython Metadata */ + +#define PY_SSIZE_T_CLEAN +#include "Python.h" +#ifndef Py_PYTHON_H + #error Python headers needed to compile C extensions, please install development version of Python. +#elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) + #error Cython requires Python 2.6+ or Python 3.3+. +#else +#define CYTHON_ABI "0_29_2" +#define CYTHON_HEX_VERSION 0x001D02F0 +#define CYTHON_FUTURE_DIVISION 1 +#include +#ifndef offsetof + #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) +#endif +#if !defined(WIN32) && !defined(MS_WINDOWS) + #ifndef __stdcall + #define __stdcall + #endif + #ifndef __cdecl + #define __cdecl + #endif + #ifndef __fastcall + #define __fastcall + #endif +#endif +#ifndef DL_IMPORT + #define DL_IMPORT(t) t +#endif +#ifndef DL_EXPORT + #define DL_EXPORT(t) t +#endif +#define __PYX_COMMA , +#ifndef HAVE_LONG_LONG + #if PY_VERSION_HEX >= 0x02070000 + #define HAVE_LONG_LONG + #endif +#endif +#ifndef PY_LONG_LONG + #define PY_LONG_LONG LONG_LONG +#endif +#ifndef Py_HUGE_VAL + #define Py_HUGE_VAL HUGE_VAL +#endif +#ifdef PYPY_VERSION + #define CYTHON_COMPILING_IN_PYPY 1 + #define CYTHON_COMPILING_IN_PYSTON 0 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #undef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 0 + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #if PY_VERSION_HEX < 0x03050000 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #elif !defined(CYTHON_USE_ASYNC_SLOTS) + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #undef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 0 + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #undef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 1 + #undef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 0 + #undef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 0 + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #undef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE 0 + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 +#elif defined(PYSTON_VERSION) + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_PYSTON 1 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #ifndef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 1 + #endif + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #ifndef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 1 + #endif + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #ifndef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 0 + #endif + #ifndef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 1 + #endif + #ifndef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 1 + #endif + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #undef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE 0 + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 +#else + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_PYSTON 0 + #define CYTHON_COMPILING_IN_CPYTHON 1 + #ifndef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 1 + #endif + #if PY_VERSION_HEX < 0x02070000 + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #elif !defined(CYTHON_USE_PYTYPE_LOOKUP) + #define CYTHON_USE_PYTYPE_LOOKUP 1 + #endif + #if PY_MAJOR_VERSION < 3 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #elif !defined(CYTHON_USE_ASYNC_SLOTS) + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #if PY_VERSION_HEX < 0x02070000 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #elif !defined(CYTHON_USE_PYLONG_INTERNALS) + #define CYTHON_USE_PYLONG_INTERNALS 1 + #endif + #ifndef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 1 + #endif + #ifndef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 1 + #endif + #if PY_VERSION_HEX < 0x030300F0 + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #elif !defined(CYTHON_USE_UNICODE_WRITER) + #define CYTHON_USE_UNICODE_WRITER 1 + #endif + #ifndef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 0 + #endif + #ifndef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 1 + #endif + #ifndef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 1 + #endif + #ifndef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 1 + #endif + #ifndef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 1 + #endif + #ifndef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000) + #endif + #ifndef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1) + #endif + #ifndef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1) + #endif + #ifndef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3) + #endif +#endif +#if !defined(CYTHON_FAST_PYCCALL) +#define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) +#endif +#if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #undef SHIFT + #undef BASE + #undef MASK + #ifdef SIZEOF_VOID_P + enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) }; + #endif +#endif +#ifndef __has_attribute + #define __has_attribute(x) 0 +#endif +#ifndef __has_cpp_attribute + #define __has_cpp_attribute(x) 0 +#endif +#ifndef CYTHON_RESTRICT + #if defined(__GNUC__) + #define CYTHON_RESTRICT __restrict__ + #elif defined(_MSC_VER) && _MSC_VER >= 1400 + #define CYTHON_RESTRICT __restrict + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_RESTRICT restrict + #else + #define CYTHON_RESTRICT + #endif +#endif +#ifndef CYTHON_UNUSED +# if defined(__GNUC__) +# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +#endif +#ifndef CYTHON_MAYBE_UNUSED_VAR +# if defined(__cplusplus) + template void CYTHON_MAYBE_UNUSED_VAR( const T& ) { } +# else +# define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x) +# endif +#endif +#ifndef CYTHON_NCP_UNUSED +# if CYTHON_COMPILING_IN_CPYTHON +# define CYTHON_NCP_UNUSED +# else +# define CYTHON_NCP_UNUSED CYTHON_UNUSED +# endif +#endif +#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) +#ifdef _MSC_VER + #ifndef _MSC_STDINT_H_ + #if _MSC_VER < 1300 + typedef unsigned char uint8_t; + typedef unsigned int uint32_t; + #else + typedef unsigned __int8 uint8_t; + typedef unsigned __int32 uint32_t; + #endif + #endif +#else + #include +#endif +#ifndef CYTHON_FALLTHROUGH + #if defined(__cplusplus) && __cplusplus >= 201103L + #if __has_cpp_attribute(fallthrough) + #define CYTHON_FALLTHROUGH [[fallthrough]] + #elif __has_cpp_attribute(clang::fallthrough) + #define CYTHON_FALLTHROUGH [[clang::fallthrough]] + #elif __has_cpp_attribute(gnu::fallthrough) + #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] + #endif + #endif + #ifndef CYTHON_FALLTHROUGH + #if __has_attribute(fallthrough) + #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) + #else + #define CYTHON_FALLTHROUGH + #endif + #endif + #if defined(__clang__ ) && defined(__apple_build_version__) + #if __apple_build_version__ < 7000000 + #undef CYTHON_FALLTHROUGH + #define CYTHON_FALLTHROUGH + #endif + #endif +#endif + +#ifndef CYTHON_INLINE + #if defined(__clang__) + #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) + #elif defined(__GNUC__) + #define CYTHON_INLINE __inline__ + #elif defined(_MSC_VER) + #define CYTHON_INLINE __inline + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_INLINE inline + #else + #define CYTHON_INLINE + #endif +#endif + +#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) + #define Py_OptimizeFlag 0 +#endif +#define __PYX_BUILD_PY_SSIZE_T "n" +#define CYTHON_FORMAT_SSIZE_T "z" +#if PY_MAJOR_VERSION < 3 + #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyClass_Type +#else + #define __Pyx_BUILTIN_MODULE_NAME "builtins" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyType_Type +#endif +#ifndef Py_TPFLAGS_CHECKTYPES + #define Py_TPFLAGS_CHECKTYPES 0 +#endif +#ifndef Py_TPFLAGS_HAVE_INDEX + #define Py_TPFLAGS_HAVE_INDEX 0 +#endif +#ifndef Py_TPFLAGS_HAVE_NEWBUFFER + #define Py_TPFLAGS_HAVE_NEWBUFFER 0 +#endif +#ifndef Py_TPFLAGS_HAVE_FINALIZE + #define Py_TPFLAGS_HAVE_FINALIZE 0 +#endif +#ifndef METH_STACKLESS + #define METH_STACKLESS 0 +#endif +#if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) + #ifndef METH_FASTCALL + #define METH_FASTCALL 0x80 + #endif + typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs); + typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args, + Py_ssize_t nargs, PyObject *kwnames); +#else + #define __Pyx_PyCFunctionFast _PyCFunctionFast + #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords +#endif +#if CYTHON_FAST_PYCCALL +#define __Pyx_PyFastCFunction_Check(func)\ + ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS))))) +#else +#define __Pyx_PyFastCFunction_Check(func) 0 +#endif +#if CYTHON_USE_DICT_VERSIONS +#define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) +#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ + (version_var) = __PYX_GET_DICT_VERSION(dict);\ + (cache_var) = (value); +#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ + static PY_UINT64_T __pyx_dict_version = 0;\ + static PyObject *__pyx_dict_cached_value = NULL;\ + if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ + (VAR) = __pyx_dict_cached_value;\ + } else {\ + (VAR) = __pyx_dict_cached_value = (LOOKUP);\ + __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ + }\ + } +#else +#define __PYX_GET_DICT_VERSION(dict) (0) +#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) +#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) + #define PyObject_Malloc(s) PyMem_Malloc(s) + #define PyObject_Free(p) PyMem_Free(p) + #define PyObject_Realloc(p) PyMem_Realloc(p) +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1 + #define PyMem_RawMalloc(n) PyMem_Malloc(n) + #define PyMem_RawRealloc(p, n) PyMem_Realloc(p, n) + #define PyMem_RawFree(p) PyMem_Free(p) +#endif +#if CYTHON_COMPILING_IN_PYSTON + #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co) + #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno) +#else + #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) + #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) +#endif +#if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000 + #define __Pyx_PyThreadState_Current PyThreadState_GET() +#elif PY_VERSION_HEX >= 0x03060000 + #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() +#elif PY_VERSION_HEX >= 0x03000000 + #define __Pyx_PyThreadState_Current PyThreadState_GET() +#else + #define __Pyx_PyThreadState_Current _PyThreadState_Current +#endif +#if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) +#include "pythread.h" +#define Py_tss_NEEDS_INIT 0 +typedef int Py_tss_t; +static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) { + *key = PyThread_create_key(); + return 0; // PyThread_create_key reports success always +} +static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) { + Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t)); + *key = Py_tss_NEEDS_INIT; + return key; +} +static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) { + PyObject_Free(key); +} +static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) { + return *key != Py_tss_NEEDS_INIT; +} +static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) { + PyThread_delete_key(*key); + *key = Py_tss_NEEDS_INIT; +} +static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) { + return PyThread_set_key_value(*key, value); +} +static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { + return PyThread_get_key_value(*key); +} +#endif // TSS (Thread Specific Storage) API +#if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized) +#define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) +#else +#define __Pyx_PyDict_NewPresized(n) PyDict_New() +#endif +#if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION + #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) +#else + #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS +#define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) +#else +#define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name) +#endif +#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) + #define CYTHON_PEP393_ENABLED 1 + #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ + 0 : _PyUnicode_Ready((PyObject *)(op))) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) + #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) + #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) + #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) + #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) + #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch) + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) +#else + #define CYTHON_PEP393_ENABLED 0 + #define PyUnicode_1BYTE_KIND 1 + #define PyUnicode_2BYTE_KIND 2 + #define PyUnicode_4BYTE_KIND 4 + #define __Pyx_PyUnicode_READY(op) (0) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) + #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111) + #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) + #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) + #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) + #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch) + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) +#endif +#if CYTHON_COMPILING_IN_PYPY + #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) +#else + #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ + PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains) + #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check) + #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format) + #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) +#endif +#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) +#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) +#else + #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) +#endif +#if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) + #define PyObject_ASCII(o) PyObject_Repr(o) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBaseString_Type PyUnicode_Type + #define PyStringObject PyUnicodeObject + #define PyString_Type PyUnicode_Type + #define PyString_Check PyUnicode_Check + #define PyString_CheckExact PyUnicode_CheckExact + #define PyObject_Unicode PyObject_Str +#endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) + #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) +#else + #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) + #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) +#endif +#ifndef PySet_CheckExact + #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) +#endif +#if CYTHON_ASSUME_SAFE_MACROS + #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) +#else + #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyIntObject PyLongObject + #define PyInt_Type PyLong_Type + #define PyInt_Check(op) PyLong_Check(op) + #define PyInt_CheckExact(op) PyLong_CheckExact(op) + #define PyInt_FromString PyLong_FromString + #define PyInt_FromUnicode PyLong_FromUnicode + #define PyInt_FromLong PyLong_FromLong + #define PyInt_FromSize_t PyLong_FromSize_t + #define PyInt_FromSsize_t PyLong_FromSsize_t + #define PyInt_AsLong PyLong_AsLong + #define PyInt_AS_LONG PyLong_AS_LONG + #define PyInt_AsSsize_t PyLong_AsSsize_t + #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask + #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask + #define PyNumber_Int PyNumber_Long +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBoolObject PyLongObject +#endif +#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY + #ifndef PyUnicode_InternFromString + #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) + #endif +#endif +#if PY_VERSION_HEX < 0x030200A4 + typedef long Py_hash_t; + #define __Pyx_PyInt_FromHash_t PyInt_FromLong + #define __Pyx_PyInt_AsHash_t PyInt_AsLong +#else + #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t + #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t +#endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : (Py_INCREF(func), func)) +#else + #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) +#endif +#if CYTHON_USE_ASYNC_SLOTS + #if PY_VERSION_HEX >= 0x030500B1 + #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods + #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) + #else + #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) + #endif +#else + #define __Pyx_PyType_AsAsync(obj) NULL +#endif +#ifndef __Pyx_PyAsyncMethodsStruct + typedef struct { + unaryfunc am_await; + unaryfunc am_aiter; + unaryfunc am_anext; + } __Pyx_PyAsyncMethodsStruct; +#endif + +#if defined(WIN32) || defined(MS_WINDOWS) + #define _USE_MATH_DEFINES +#endif +#include +#ifdef NAN +#define __PYX_NAN() ((float) NAN) +#else +static CYTHON_INLINE float __PYX_NAN() { + float value; + memset(&value, 0xFF, sizeof(value)); + return value; +} +#endif +#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) +#define __Pyx_truncl trunc +#else +#define __Pyx_truncl truncl +#endif + + +#define __PYX_ERR(f_index, lineno, Ln_error) \ +{ \ + __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \ +} + +#ifndef __PYX_EXTERN_C + #ifdef __cplusplus + #define __PYX_EXTERN_C extern "C" + #else + #define __PYX_EXTERN_C extern + #endif +#endif + +#define __PYX_HAVE__gevent___local +#define __PYX_HAVE_API__gevent___local +/* Early includes */ +#include "greenlet/greenlet.h" +#include "frameobject.h" +#ifdef _OPENMP +#include +#endif /* _OPENMP */ + +#if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) +#define CYTHON_WITHOUT_ASSERTIONS +#endif + +typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; + const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; + +#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 +#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0 +#define __PYX_DEFAULT_STRING_ENCODING "" +#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString +#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#define __Pyx_uchar_cast(c) ((unsigned char)c) +#define __Pyx_long_cast(x) ((long)x) +#define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ + (sizeof(type) < sizeof(Py_ssize_t)) ||\ + (sizeof(type) > sizeof(Py_ssize_t) &&\ + likely(v < (type)PY_SSIZE_T_MAX ||\ + v == (type)PY_SSIZE_T_MAX) &&\ + (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ + v == (type)PY_SSIZE_T_MIN))) ||\ + (sizeof(type) == sizeof(Py_ssize_t) &&\ + (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ + v == (type)PY_SSIZE_T_MAX))) ) +static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) { + return (size_t) i < (size_t) limit; +} +#if defined (__cplusplus) && __cplusplus >= 201103L + #include + #define __Pyx_sst_abs(value) std::abs(value) +#elif SIZEOF_INT >= SIZEOF_SIZE_T + #define __Pyx_sst_abs(value) abs(value) +#elif SIZEOF_LONG >= SIZEOF_SIZE_T + #define __Pyx_sst_abs(value) labs(value) +#elif defined (_MSC_VER) + #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) +#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define __Pyx_sst_abs(value) llabs(value) +#elif defined (__GNUC__) + #define __Pyx_sst_abs(value) __builtin_llabs(value) +#else + #define __Pyx_sst_abs(value) ((value<0) ? -value : value) +#endif +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*); +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); +#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) +#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) +#define __Pyx_PyBytes_FromString PyBytes_FromString +#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); +#if PY_MAJOR_VERSION < 3 + #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#else + #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize +#endif +#define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) +#define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) +#define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) +#define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) +#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) +static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) { + const Py_UNICODE *u_end = u; + while (*u_end++) ; + return (size_t)(u_end - u - 1); +} +#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) +#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode +#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode +#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) +#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) +static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); +static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*); +static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); +#define __Pyx_PySequence_Tuple(obj)\ + (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); +#if CYTHON_ASSUME_SAFE_MACROS +#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) +#else +#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) +#endif +#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) +#if PY_MAJOR_VERSION >= 3 +#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) +#else +#define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) +#endif +#define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x)) +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII +static int __Pyx_sys_getdefaultencoding_not_ascii; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + PyObject* ascii_chars_u = NULL; + PyObject* ascii_chars_b = NULL; + const char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + if (strcmp(default_encoding_c, "ascii") == 0) { + __Pyx_sys_getdefaultencoding_not_ascii = 0; + } else { + char ascii_chars[128]; + int c; + for (c = 0; c < 128; c++) { + ascii_chars[c] = c; + } + __Pyx_sys_getdefaultencoding_not_ascii = 1; + ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); + if (!ascii_chars_u) goto bad; + ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); + if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { + PyErr_Format( + PyExc_ValueError, + "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", + default_encoding_c); + goto bad; + } + Py_DECREF(ascii_chars_u); + Py_DECREF(ascii_chars_b); + } + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + Py_XDECREF(ascii_chars_u); + Py_XDECREF(ascii_chars_b); + return -1; +} +#endif +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) +#else +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +static char* __PYX_DEFAULT_STRING_ENCODING; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1); + if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; + strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + return -1; +} +#endif +#endif + + +/* Test for GCC > 2.95 */ +#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) + #define likely(x) __builtin_expect(!!(x), 1) + #define unlikely(x) __builtin_expect(!!(x), 0) +#else /* !__GNUC__ or GCC < 2.95 */ + #define likely(x) (x) + #define unlikely(x) (x) +#endif /* __GNUC__ */ +static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } + +static PyObject *__pyx_m = NULL; +static PyObject *__pyx_d; +static PyObject *__pyx_b; +static PyObject *__pyx_cython_runtime = NULL; +static PyObject *__pyx_empty_tuple; +static PyObject *__pyx_empty_bytes; +static PyObject *__pyx_empty_unicode; +static int __pyx_lineno; +static int __pyx_clineno = 0; +static const char * __pyx_cfilenm= __FILE__; +static const char *__pyx_filename; + + +static const char *__pyx_f[] = { + "src\\gevent\\local.py", + "src\\gevent\\__greenlet_primitives.pxd", + "src\\gevent\\__waiter.pxd", + "src\\gevent\\_greenlet.pxd", + "src\\gevent\\_local.pxd", + "src\\gevent\\__ident.pxd", +}; + +/*--- Type declarations ---*/ +struct __pyx_obj_6gevent_7__ident_ValuedWeakRef; +struct __pyx_obj_6gevent_7__ident_IdentRegistry; +struct __pyx_obj_6gevent_21__greenlet_primitives_TrackedRawGreenlet; +struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop; +struct __pyx_obj_6gevent_8__waiter_Waiter; +struct __pyx_obj_6gevent_8__waiter_MultipleWaiter; +struct __pyx_obj_6gevent_9_greenlet_SpawnedLink; +struct __pyx_obj_6gevent_9_greenlet_SuccessSpawnedLink; +struct __pyx_obj_6gevent_9_greenlet_FailureSpawnedLink; +struct __pyx_obj_6gevent_9_greenlet__Frame; +struct __pyx_obj_6gevent_9_greenlet_Greenlet; +struct __pyx_obj_6gevent_9_greenlet__dummy_event; +struct __pyx_obj_6gevent_6_local__wrefdict; +struct __pyx_obj_6gevent_6_local__greenlet_deleted; +struct __pyx_obj_6gevent_6_local__local_deleted; +struct __pyx_obj_6gevent_6_local__localimpl; +struct __pyx_obj_6gevent_6_local__localimpl_dict_entry; +struct __pyx_obj_6gevent_6_local_local; +struct __pyx_opt_args_6gevent_9_greenlet_8Greenlet_join; +struct __pyx_opt_args_6gevent_9_greenlet_joinall; + +/* "gevent/_greenlet.pxd":105 + * + * cpdef bint has_links(self) + * cpdef join(self, timeout=*) # <<<<<<<<<<<<<< + * cpdef bint ready(self) + * cpdef bint successful(self) + */ +struct __pyx_opt_args_6gevent_9_greenlet_8Greenlet_join { + int __pyx_n; + PyObject *timeout; +}; + +/* "gevent/_greenlet.pxd":174 + * + * @cython.locals(done=list) + * cpdef joinall(greenlets, timeout=*, raise_error=*, count=*) # <<<<<<<<<<<<<< + * + * cdef set _spawn_callbacks + */ +struct __pyx_opt_args_6gevent_9_greenlet_joinall { + int __pyx_n; + PyObject *timeout; + PyObject *raise_error; + PyObject *count; +}; + +/* "gevent/__ident.pxd":15 + * @cython.internal + * @cython.final + * cdef class ValuedWeakRef(ref): # <<<<<<<<<<<<<< + * cdef object value + * + */ +struct __pyx_obj_6gevent_7__ident_ValuedWeakRef { + PyWeakReference __pyx_base; + PyObject *value; +}; + + +/* "gevent/__ident.pxd":19 + * + * @cython.final + * cdef class IdentRegistry: # <<<<<<<<<<<<<< + * cdef object _registry + * cdef list _available_idents + */ +struct __pyx_obj_6gevent_7__ident_IdentRegistry { + PyObject_HEAD + struct __pyx_vtabstruct_6gevent_7__ident_IdentRegistry *__pyx_vtab; + PyObject *_registry; + PyObject *_available_idents; +}; + + +/* "gevent/__greenlet_primitives.pxd":37 + * return PyGreenlet_Switch(self, NULL, NULL) + * + * cdef class TrackedRawGreenlet(greenlet): # <<<<<<<<<<<<<< + * pass + * + */ +struct __pyx_obj_6gevent_21__greenlet_primitives_TrackedRawGreenlet { + PyGreenlet __pyx_base; +}; + + +/* "gevent/__greenlet_primitives.pxd":40 + * pass + * + * cdef class SwitchOutGreenletWithLoop(TrackedRawGreenlet): # <<<<<<<<<<<<<< + * cdef public loop + * + */ +struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop { + struct __pyx_obj_6gevent_21__greenlet_primitives_TrackedRawGreenlet __pyx_base; + struct __pyx_vtabstruct_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *__pyx_vtab; + PyObject *loop; +}; + + +/* "gevent/__waiter.pxd":33 + * _greenlet_imported = True + * + * cdef class Waiter: # <<<<<<<<<<<<<< + * cdef readonly SwitchOutGreenletWithLoop hub + * cdef readonly greenlet greenlet + */ +struct __pyx_obj_6gevent_8__waiter_Waiter { + PyObject_HEAD + struct __pyx_vtabstruct_6gevent_8__waiter_Waiter *__pyx_vtab; + struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *hub; + PyGreenlet *greenlet; + PyObject *value; + PyObject *_exception; +}; + + +/* "gevent/__waiter.pxd":47 + * @cython.final + * @cython.internal + * cdef class MultipleWaiter(Waiter): # <<<<<<<<<<<<<< + * cdef list _values + */ +struct __pyx_obj_6gevent_8__waiter_MultipleWaiter { + struct __pyx_obj_6gevent_8__waiter_Waiter __pyx_base; + PyObject *_values; +}; + + +/* "gevent/_greenlet.pxd":56 + * cdef void _init() + * + * cdef class SpawnedLink: # <<<<<<<<<<<<<< + * cdef public object callback + * + */ +struct __pyx_obj_6gevent_9_greenlet_SpawnedLink { + PyObject_HEAD + PyObject *callback; +}; + + +/* "gevent/_greenlet.pxd":61 + * + * @cython.final + * cdef class SuccessSpawnedLink(SpawnedLink): # <<<<<<<<<<<<<< + * pass + * + */ +struct __pyx_obj_6gevent_9_greenlet_SuccessSpawnedLink { + struct __pyx_obj_6gevent_9_greenlet_SpawnedLink __pyx_base; +}; + + +/* "gevent/_greenlet.pxd":65 + * + * @cython.final + * cdef class FailureSpawnedLink(SpawnedLink): # <<<<<<<<<<<<<< + * pass + * + */ +struct __pyx_obj_6gevent_9_greenlet_FailureSpawnedLink { + struct __pyx_obj_6gevent_9_greenlet_SpawnedLink __pyx_base; +}; + + +/* "gevent/_greenlet.pxd":71 + * @cython.internal + * @cython.freelist(1000) + * cdef class _Frame: # <<<<<<<<<<<<<< + * cdef readonly CodeType f_code + * cdef readonly int f_lineno + */ +struct __pyx_obj_6gevent_9_greenlet__Frame { + PyObject_HEAD + PyCodeObject *f_code; + int f_lineno; + struct __pyx_obj_6gevent_9_greenlet__Frame *f_back; +}; + + +/* "gevent/_greenlet.pxd":86 + * + * + * cdef class Greenlet(greenlet): # <<<<<<<<<<<<<< + * cdef readonly object value + * cdef readonly tuple args + */ +struct __pyx_obj_6gevent_9_greenlet_Greenlet { + PyGreenlet __pyx_base; + struct __pyx_vtabstruct_6gevent_9_greenlet_Greenlet *__pyx_vtab; + PyObject *value; + PyObject *args; + PyObject *kwargs; + PyObject *spawning_greenlet; + PyObject *spawn_tree_locals; + PyObject *_spawning_stack_frames; + PyObject *_links; + PyObject *_exc_info; + PyObject *_notifier; + PyObject *_start_event; + PyObject *_formatted_info; + PyObject *_ident; +}; + + +/* "gevent/_greenlet.pxd":157 + * @cython.final + * @cython.internal + * cdef class _dummy_event: # <<<<<<<<<<<<<< + * cdef readonly bint pending + * cdef readonly bint active + */ +struct __pyx_obj_6gevent_9_greenlet__dummy_event { + PyObject_HEAD + struct __pyx_vtabstruct_6gevent_9_greenlet__dummy_event *__pyx_vtab; + int pending; + int active; +}; + + +/* "gevent/_local.pxd":40 + * @cython.final + * @cython.internal + * cdef class _wrefdict(dict): # <<<<<<<<<<<<<< + * cdef object __weakref__ + * + */ +struct __pyx_obj_6gevent_6_local__wrefdict { + PyDictObject __pyx_base; + PyObject *__weakref__; +}; + + +/* "gevent/_local.pxd":45 + * @cython.final + * @cython.internal + * cdef class _greenlet_deleted: # <<<<<<<<<<<<<< + * cdef object idt + * cdef object wrdicts + */ +struct __pyx_obj_6gevent_6_local__greenlet_deleted { + PyObject_HEAD + PyObject *idt; + PyObject *wrdicts; +}; + + +/* "gevent/_local.pxd":52 + * @cython.final + * @cython.internal + * cdef class _local_deleted: # <<<<<<<<<<<<<< + * cdef str key + * cdef object wrthread + */ +struct __pyx_obj_6gevent_6_local__local_deleted { + PyObject_HEAD + PyObject *key; + PyObject *wrthread; + struct __pyx_obj_6gevent_6_local__greenlet_deleted *greenlet_deleted; +}; + + +/* "gevent/_local.pxd":59 + * @cython.final + * @cython.internal + * cdef class _localimpl: # <<<<<<<<<<<<<< + * cdef str key + * cdef dict dicts + */ +struct __pyx_obj_6gevent_6_local__localimpl { + PyObject_HEAD + PyObject *key; + PyObject *dicts; + PyObject *localargs; + PyObject *localkwargs; + PyObject *localtypeid; + PyObject *__weakref__; +}; + + +/* "gevent/_local.pxd":70 + * @cython.final + * @cython.internal + * cdef class _localimpl_dict_entry: # <<<<<<<<<<<<<< + * cdef object wrgreenlet + * cdef dict localdict + */ +struct __pyx_obj_6gevent_6_local__localimpl_dict_entry { + PyObject_HEAD + PyObject *wrgreenlet; + PyObject *localdict; +}; + + +/* "gevent/_local.pxd":83 + * cdef set _local_attrs + * + * cdef class local: # <<<<<<<<<<<<<< + * cdef _localimpl _local__impl + * cdef set _local_type_get_descriptors + */ +struct __pyx_obj_6gevent_6_local_local { + PyObject_HEAD + struct __pyx_vtabstruct_6gevent_6_local_local *__pyx_vtab; + struct __pyx_obj_6gevent_6_local__localimpl *_local__impl; + PyObject *_local_type_get_descriptors; + PyObject *_local_type_set_or_del_descriptors; + PyObject *_local_type_del_descriptors; + PyObject *_local_type_set_descriptors; + PyObject *_local_type_vars; + PyTypeObject *_local_type; +}; + + + +/* "gevent/__ident.pxd":19 + * + * @cython.final + * cdef class IdentRegistry: # <<<<<<<<<<<<<< + * cdef object _registry + * cdef list _available_idents + */ + +struct __pyx_vtabstruct_6gevent_7__ident_IdentRegistry { + PyObject *(*get_ident)(struct __pyx_obj_6gevent_7__ident_IdentRegistry *, PyObject *, int __pyx_skip_dispatch); + PyObject *(*_return_ident)(struct __pyx_obj_6gevent_7__ident_IdentRegistry *, struct __pyx_obj_6gevent_7__ident_ValuedWeakRef *, int __pyx_skip_dispatch); +}; +static struct __pyx_vtabstruct_6gevent_7__ident_IdentRegistry *__pyx_vtabptr_6gevent_7__ident_IdentRegistry; + + +/* "gevent/__greenlet_primitives.pxd":40 + * pass + * + * cdef class SwitchOutGreenletWithLoop(TrackedRawGreenlet): # <<<<<<<<<<<<<< + * cdef public loop + * + */ + +struct __pyx_vtabstruct_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop { + PyObject *(*__pyx_switch)(struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *, int __pyx_skip_dispatch); + PyObject *(*switch_out)(struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *, int __pyx_skip_dispatch); +}; +static struct __pyx_vtabstruct_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *__pyx_vtabptr_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop; + + +/* "gevent/__waiter.pxd":33 + * _greenlet_imported = True + * + * cdef class Waiter: # <<<<<<<<<<<<<< + * cdef readonly SwitchOutGreenletWithLoop hub + * cdef readonly greenlet greenlet + */ + +struct __pyx_vtabstruct_6gevent_8__waiter_Waiter { + PyObject *(*get)(struct __pyx_obj_6gevent_8__waiter_Waiter *, int __pyx_skip_dispatch); + PyObject *(*clear)(struct __pyx_obj_6gevent_8__waiter_Waiter *, int __pyx_skip_dispatch); +}; +static struct __pyx_vtabstruct_6gevent_8__waiter_Waiter *__pyx_vtabptr_6gevent_8__waiter_Waiter; + + +/* "gevent/__waiter.pxd":47 + * @cython.final + * @cython.internal + * cdef class MultipleWaiter(Waiter): # <<<<<<<<<<<<<< + * cdef list _values + */ + +struct __pyx_vtabstruct_6gevent_8__waiter_MultipleWaiter { + struct __pyx_vtabstruct_6gevent_8__waiter_Waiter __pyx_base; +}; +static struct __pyx_vtabstruct_6gevent_8__waiter_MultipleWaiter *__pyx_vtabptr_6gevent_8__waiter_MultipleWaiter; + + +/* "gevent/_greenlet.pxd":86 + * + * + * cdef class Greenlet(greenlet): # <<<<<<<<<<<<<< + * cdef readonly object value + * cdef readonly tuple args + */ + +struct __pyx_vtabstruct_6gevent_9_greenlet_Greenlet { + int (*has_links)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *, int __pyx_skip_dispatch); + PyObject *(*join)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_9_greenlet_8Greenlet_join *__pyx_optional_args); + int (*ready)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *, int __pyx_skip_dispatch); + int (*successful)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *, int __pyx_skip_dispatch); + PyObject *(*rawlink)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *, PyObject *, int __pyx_skip_dispatch); + PyObject *(*_formatinfo)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *, int __pyx_skip_dispatch); + PyObject *(*_get_minimal_ident)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *); + int (*__pyx___started_but_aborted)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *); + int (*__pyx___start_cancelled_by_kill)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *); + int (*__pyx___start_pending)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *); + int (*__pyx___never_started_or_killed)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *); + int (*__pyx___start_completed)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *); + PyObject *(*__pyx___handle_death_before_start)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *, PyObject *); + PyObject *(*__pyx___cancel_start)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *); + PyObject *(*_report_result)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *, PyObject *); + PyObject *(*_report_error)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *, PyObject *); + PyObject *(*_notify_links)(struct __pyx_obj_6gevent_9_greenlet_Greenlet *, int __pyx_skip_dispatch); +}; +static struct __pyx_vtabstruct_6gevent_9_greenlet_Greenlet *__pyx_vtabptr_6gevent_9_greenlet_Greenlet; + + +/* "gevent/_greenlet.pxd":157 + * @cython.final + * @cython.internal + * cdef class _dummy_event: # <<<<<<<<<<<<<< + * cdef readonly bint pending + * cdef readonly bint active + */ + +struct __pyx_vtabstruct_6gevent_9_greenlet__dummy_event { + PyObject *(*stop)(struct __pyx_obj_6gevent_9_greenlet__dummy_event *, int __pyx_skip_dispatch); + PyObject *(*start)(struct __pyx_obj_6gevent_9_greenlet__dummy_event *, PyObject *, int __pyx_skip_dispatch); + PyObject *(*close)(struct __pyx_obj_6gevent_9_greenlet__dummy_event *, int __pyx_skip_dispatch); +}; +static struct __pyx_vtabstruct_6gevent_9_greenlet__dummy_event *__pyx_vtabptr_6gevent_9_greenlet__dummy_event; + + +/* "src/gevent/local.py":361 + * } + * + * class local(object): # <<<<<<<<<<<<<< + * """ + * An object whose attributes are greenlet-local. + */ + +struct __pyx_vtabstruct_6gevent_6_local_local { + struct __pyx_obj_6gevent_6_local_local *(*__pyx___copy__)(struct __pyx_obj_6gevent_6_local_local *, int __pyx_skip_dispatch); +}; +static struct __pyx_vtabstruct_6gevent_6_local_local *__pyx_vtabptr_6gevent_6_local_local; + +/* --- Runtime support code (head) --- */ +/* Refnanny.proto */ +#ifndef CYTHON_REFNANNY + #define CYTHON_REFNANNY 0 +#endif +#if CYTHON_REFNANNY + typedef struct { + void (*INCREF)(void*, PyObject*, int); + void (*DECREF)(void*, PyObject*, int); + void (*GOTREF)(void*, PyObject*, int); + void (*GIVEREF)(void*, PyObject*, int); + void* (*SetupContext)(const char*, int, const char*); + void (*FinishContext)(void**); + } __Pyx_RefNannyAPIStruct; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); + #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; +#ifdef WITH_THREAD + #define __Pyx_RefNannySetupContext(name, acquire_gil)\ + if (acquire_gil) {\ + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ + PyGILState_Release(__pyx_gilstate_save);\ + } else {\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ + } +#else + #define __Pyx_RefNannySetupContext(name, acquire_gil)\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) +#endif + #define __Pyx_RefNannyFinishContext()\ + __Pyx_RefNanny->FinishContext(&__pyx_refnanny) + #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0) + #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) + #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) + #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) +#else + #define __Pyx_RefNannyDeclarations + #define __Pyx_RefNannySetupContext(name, acquire_gil) + #define __Pyx_RefNannyFinishContext() + #define __Pyx_INCREF(r) Py_INCREF(r) + #define __Pyx_DECREF(r) Py_DECREF(r) + #define __Pyx_GOTREF(r) + #define __Pyx_GIVEREF(r) + #define __Pyx_XINCREF(r) Py_XINCREF(r) + #define __Pyx_XDECREF(r) Py_XDECREF(r) + #define __Pyx_XGOTREF(r) + #define __Pyx_XGIVEREF(r) +#endif +#define __Pyx_XDECREF_SET(r, v) do {\ + PyObject *tmp = (PyObject *) r;\ + r = v; __Pyx_XDECREF(tmp);\ + } while (0) +#define __Pyx_DECREF_SET(r, v) do {\ + PyObject *tmp = (PyObject *) r;\ + r = v; __Pyx_DECREF(tmp);\ + } while (0) +#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) +#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) + +/* PyObjectGetAttrStr.proto */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); +#else +#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) +#endif + +/* GetBuiltinName.proto */ +static PyObject *__Pyx_GetBuiltinName(PyObject *name); + +/* PyCFunctionFastCall.proto */ +#if CYTHON_FAST_PYCCALL +static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs); +#else +#define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL) +#endif + +/* PyFunctionFastCall.proto */ +#if CYTHON_FAST_PYCALL +#define __Pyx_PyFunction_FastCall(func, args, nargs)\ + __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) +#if 1 || PY_VERSION_HEX < 0x030600B1 +static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs); +#else +#define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs) +#endif +#define __Pyx_BUILD_ASSERT_EXPR(cond)\ + (sizeof(char [1 - 2*!(cond)]) - 1) +#ifndef Py_MEMBER_SIZE +#define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member) +#endif + static size_t __pyx_pyframe_localsplus_offset = 0; + #include "frameobject.h" + #define __Pxy_PyFrame_Initialize_Offsets()\ + ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\ + (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus))) + #define __Pyx_PyFrame_GetLocalsplus(frame)\ + (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset)) +#endif + +/* PyObjectCall.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); +#else +#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) +#endif + +/* PyObjectCallMethO.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); +#endif + +/* PyObjectCallOneArg.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); + +/* IterFinish.proto */ +static CYTHON_INLINE int __Pyx_IterFinish(void); + +/* PyObjectCallNoArg.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); +#else +#define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL) +#endif + +/* PyObjectGetMethod.proto */ +static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method); + +/* PyObjectCallMethod0.proto */ +static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name); + +/* RaiseNeedMoreValuesToUnpack.proto */ +static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); + +/* RaiseTooManyValuesToUnpack.proto */ +static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); + +/* UnpackItemEndCheck.proto */ +static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); + +/* RaiseNoneIterError.proto */ +static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void); + +/* UnpackTupleError.proto */ +static void __Pyx_UnpackTupleError(PyObject *, Py_ssize_t index); + +/* UnpackTuple2.proto */ +#define __Pyx_unpack_tuple2(tuple, value1, value2, is_tuple, has_known_size, decref_tuple)\ + (likely(is_tuple || PyTuple_Check(tuple)) ?\ + (likely(has_known_size || PyTuple_GET_SIZE(tuple) == 2) ?\ + __Pyx_unpack_tuple2_exact(tuple, value1, value2, decref_tuple) :\ + (__Pyx_UnpackTupleError(tuple, 2), -1)) :\ + __Pyx_unpack_tuple2_generic(tuple, value1, value2, has_known_size, decref_tuple)) +static CYTHON_INLINE int __Pyx_unpack_tuple2_exact( + PyObject* tuple, PyObject** value1, PyObject** value2, int decref_tuple); +static int __Pyx_unpack_tuple2_generic( + PyObject* tuple, PyObject** value1, PyObject** value2, int has_known_size, int decref_tuple); + +/* dict_iter.proto */ +static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* dict, int is_dict, PyObject* method_name, + Py_ssize_t* p_orig_length, int* p_is_dict); +static CYTHON_INLINE int __Pyx_dict_iter_next(PyObject* dict_or_iter, Py_ssize_t orig_length, Py_ssize_t* ppos, + PyObject** pkey, PyObject** pvalue, PyObject** pitem, int is_dict); + +/* bytes_tailmatch.proto */ +static int __Pyx_PyBytes_SingleTailmatch(PyObject* self, PyObject* arg, + Py_ssize_t start, Py_ssize_t end, int direction); +static int __Pyx_PyBytes_Tailmatch(PyObject* self, PyObject* substr, + Py_ssize_t start, Py_ssize_t end, int direction); + +/* unicode_tailmatch.proto */ +static int __Pyx_PyUnicode_Tailmatch( + PyObject* s, PyObject* substr, Py_ssize_t start, Py_ssize_t end, int direction); + +/* str_tailmatch.proto */ +static CYTHON_INLINE int __Pyx_PyStr_Tailmatch(PyObject* self, PyObject* arg, Py_ssize_t start, + Py_ssize_t end, int direction); + +/* ExtTypeTest.proto */ +static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); + +/* dict_getitem_default.proto */ +static PyObject* __Pyx_PyDict_GetItemDefault(PyObject* d, PyObject* key, PyObject* default_value); + +/* UnpackUnboundCMethod.proto */ +typedef struct { + PyObject *type; + PyObject **method_name; + PyCFunction func; + PyObject *method; + int flag; +} __Pyx_CachedCFunction; + +/* CallUnboundCMethod1.proto */ +static PyObject* __Pyx__CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg); +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg); +#else +#define __Pyx_CallUnboundCMethod1(cfunc, self, arg) __Pyx__CallUnboundCMethod1(cfunc, self, arg) +#endif + +/* CallUnboundCMethod2.proto */ +static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2); +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030600B1 +static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2); +#else +#define __Pyx_CallUnboundCMethod2(cfunc, self, arg1, arg2) __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2) +#endif + +/* ListAppend.proto */ +#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS +static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) { + PyListObject* L = (PyListObject*) list; + Py_ssize_t len = Py_SIZE(list); + if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) { + Py_INCREF(x); + PyList_SET_ITEM(list, len, x); + Py_SIZE(list) = len+1; + return 0; + } + return PyList_Append(list, x); +} +#else +#define __Pyx_PyList_Append(L,x) PyList_Append(L,x) +#endif + +/* ArgTypeTest.proto */ +#define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\ + ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\ + __Pyx__ArgTypeTest(obj, type, name, exact)) +static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact); + +/* RaiseArgTupleInvalid.proto */ +static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, + Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); + +/* RaiseDoubleKeywords.proto */ +static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); + +/* ParseKeywords.proto */ +static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\ + PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\ + const char* function_name); + +/* GetTopmostException.proto */ +#if CYTHON_USE_EXC_INFO_STACK +static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate); +#endif + +/* PyThreadStateGet.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; +#define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; +#define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type +#else +#define __Pyx_PyThreadState_declare +#define __Pyx_PyThreadState_assign +#define __Pyx_PyErr_Occurred() PyErr_Occurred() +#endif + +/* SaveResetException.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); +#else +#define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb) +#define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb) +#endif + +/* PyObjectCall2Args.proto */ +static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2); + +/* PyErrExceptionMatches.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) +static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); +#else +#define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) +#endif + +/* PyErrFetchRestore.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) +#define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) +#define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) +#define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) +#define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); +static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) +#else +#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) +#endif +#else +#define __Pyx_PyErr_Clear() PyErr_Clear() +#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) +#define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) +#define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb) +#define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) +#endif + +/* GetAttr.proto */ +static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *); + +/* GetAttr3.proto */ +static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *); + +/* DictGetItem.proto */ +#if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY +static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key); +#define __Pyx_PyObject_Dict_GetItem(obj, name)\ + (likely(PyDict_CheckExact(obj)) ?\ + __Pyx_PyDict_GetItem(obj, name) : PyObject_GetItem(obj, name)) +#else +#define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key) +#define __Pyx_PyObject_Dict_GetItem(obj, name) PyObject_GetItem(obj, name) +#endif + +/* GetException.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb) +static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#else +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); +#endif + +/* KeywordStringCheck.proto */ +static int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* function_name, int kw_allowed); + +/* RaiseException.proto */ +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); + +/* pyfrozenset_new.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyFrozenSet_New(PyObject* it); + +/* PySetContains.proto */ +static CYTHON_INLINE int __Pyx_PySet_ContainsTF(PyObject* key, PyObject* set, int eq); + +/* IncludeStringH.proto */ +#include + +/* BytesEquals.proto */ +static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); + +/* UnicodeEquals.proto */ +static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); + +/* StrEquals.proto */ +#if PY_MAJOR_VERSION >= 3 +#define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals +#else +#define __Pyx_PyString_Equals __Pyx_PyBytes_Equals +#endif + +/* PyDictContains.proto */ +static CYTHON_INLINE int __Pyx_PyDict_ContainsTF(PyObject* item, PyObject* dict, int eq) { + int result = PyDict_Contains(dict, item); + return unlikely(result < 0) ? result : (result == (eq == Py_EQ)); +} + +/* PySequenceContains.proto */ +static CYTHON_INLINE int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* seq, int eq) { + int result = PySequence_Contains(seq, item); + return unlikely(result < 0) ? result : (result == (eq == Py_EQ)); +} + +/* GetItemInt.proto */ +#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ + __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\ + (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\ + __Pyx_GetItemInt_Generic(o, to_py_func(i)))) +#define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ + __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ + (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL)) +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, + int wraparound, int boundscheck); +#define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ + __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ + (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL)) +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, + int wraparound, int boundscheck); +static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j); +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, + int is_list, int wraparound, int boundscheck); + +/* ObjectGetItem.proto */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key); +#else +#define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key) +#endif + +/* HasAttr.proto */ +static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *); + +/* SliceTupleAndList.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyList_GetSlice(PyObject* src, Py_ssize_t start, Py_ssize_t stop); +static CYTHON_INLINE PyObject* __Pyx_PyTuple_GetSlice(PyObject* src, Py_ssize_t start, Py_ssize_t stop); +#else +#define __Pyx_PyList_GetSlice(seq, start, stop) PySequence_GetSlice(seq, start, stop) +#define __Pyx_PyTuple_GetSlice(seq, start, stop) PySequence_GetSlice(seq, start, stop) +#endif + +/* TypeImport.proto */ +#ifndef __PYX_HAVE_RT_ImportType_proto +#define __PYX_HAVE_RT_ImportType_proto +enum __Pyx_ImportType_CheckSize { + __Pyx_ImportType_CheckSize_Error = 0, + __Pyx_ImportType_CheckSize_Warn = 1, + __Pyx_ImportType_CheckSize_Ignore = 2 +}; +static PyTypeObject *__Pyx_ImportType(PyObject* module, const char *module_name, const char *class_name, size_t size, enum __Pyx_ImportType_CheckSize check_size); +#endif + +/* PyObject_GenericGetAttrNoDict.proto */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name); +#else +#define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr +#endif + +/* SetVTable.proto */ +static int __Pyx_SetVtable(PyObject *dict, void *vtable); + +/* GetVTable.proto */ +static void* __Pyx_GetVtable(PyObject *dict); + +/* Import.proto */ +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); + +/* ImportFrom.proto */ +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); + +/* FetchCommonType.proto */ +static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); + +/* CythonFunction.proto */ +#define __Pyx_CyFunction_USED 1 +#define __Pyx_CYFUNCTION_STATICMETHOD 0x01 +#define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 +#define __Pyx_CYFUNCTION_CCLASS 0x04 +#define __Pyx_CyFunction_GetClosure(f)\ + (((__pyx_CyFunctionObject *) (f))->func_closure) +#define __Pyx_CyFunction_GetClassObj(f)\ + (((__pyx_CyFunctionObject *) (f))->func_classobj) +#define __Pyx_CyFunction_Defaults(type, f)\ + ((type *)(((__pyx_CyFunctionObject *) (f))->defaults)) +#define __Pyx_CyFunction_SetDefaultsGetter(f, g)\ + ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g) +typedef struct { + PyCFunctionObject func; +#if PY_VERSION_HEX < 0x030500A0 + PyObject *func_weakreflist; +#endif + PyObject *func_dict; + PyObject *func_name; + PyObject *func_qualname; + PyObject *func_doc; + PyObject *func_globals; + PyObject *func_code; + PyObject *func_closure; + PyObject *func_classobj; + void *defaults; + int defaults_pyobjects; + int flags; + PyObject *defaults_tuple; + PyObject *defaults_kwdict; + PyObject *(*defaults_getter)(PyObject *); + PyObject *func_annotations; +} __pyx_CyFunctionObject; +static PyTypeObject *__pyx_CyFunctionType = 0; +#define __Pyx_CyFunction_Check(obj) (__Pyx_TypeCheck(obj, __pyx_CyFunctionType)) +#define __Pyx_CyFunction_NewEx(ml, flags, qualname, self, module, globals, code)\ + __Pyx_CyFunction_New(__pyx_CyFunctionType, ml, flags, qualname, self, module, globals, code) +static PyObject *__Pyx_CyFunction_New(PyTypeObject *, PyMethodDef *ml, + int flags, PyObject* qualname, + PyObject *self, + PyObject *module, PyObject *globals, + PyObject* code); +static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, + size_t size, + int pyobjects); +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, + PyObject *tuple); +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, + PyObject *dict); +static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m, + PyObject *dict); +static int __pyx_CyFunction_init(void); + +/* PyObjectSetAttrStr.proto */ +#if CYTHON_USE_TYPE_SLOTS +#define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o, n, NULL) +static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value); +#else +#define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n) +#define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v) +#endif + +/* GetModuleGlobalName.proto */ +#if CYTHON_USE_DICT_VERSIONS +#define __Pyx_GetModuleGlobalName(var, name) {\ + static PY_UINT64_T __pyx_dict_version = 0;\ + static PyObject *__pyx_dict_cached_value = NULL;\ + (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\ + (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\ + __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ +} +#define __Pyx_GetModuleGlobalNameUncached(var, name) {\ + PY_UINT64_T __pyx_dict_version;\ + PyObject *__pyx_dict_cached_value;\ + (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ +} +static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value); +#else +#define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name) +#define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name) +static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name); +#endif + +/* Globals.proto */ +static PyObject* __Pyx_Globals(void); + +/* CLineInTraceback.proto */ +#ifdef CYTHON_CLINE_IN_TRACEBACK +#define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) +#else +static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line); +#endif + +/* CodeObjectCache.proto */ +typedef struct { + PyCodeObject* code_object; + int code_line; +} __Pyx_CodeObjectCacheEntry; +struct __Pyx_CodeObjectCache { + int count; + int max_count; + __Pyx_CodeObjectCacheEntry* entries; +}; +static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); +static PyCodeObject *__pyx_find_code_object(int code_line); +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); + +/* AddTraceback.proto */ +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename); + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); + +/* CIntFromPy.proto */ +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); + +/* CIntFromPy.proto */ +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); + +/* FastTypeChecks.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) +static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b); +static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type); +static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2); +#else +#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) +#define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) +#define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) +#endif +#define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) + +/* CheckBinaryVersion.proto */ +static int __Pyx_check_binary_version(void); + +/* VoidPtrExport.proto */ +static int __Pyx_ExportVoidPtr(PyObject *name, void *p, const char *sig); + +/* FunctionExport.proto */ +static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig); + +/* VoidPtrImport.proto */ +static int __Pyx_ImportVoidPtr(PyObject *module, const char *name, void **p, const char *sig); + +/* FunctionImport.proto */ +static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig); + +/* InitStrings.proto */ +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); + +static struct __pyx_obj_6gevent_6_local_local *__pyx_f_6gevent_6_local_5local___copy__(struct __pyx_obj_6gevent_6_local_local *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/ + +/* Module declarations from 'cython' */ + +/* Module declarations from 'weakref' */ + +/* Module declarations from 'gevent.__ident' */ +static PyTypeObject *__pyx_ptype_6gevent_7__ident_ref = 0; +static PyTypeObject *__pyx_ptype_6gevent_7__ident_ValuedWeakRef = 0; +static PyTypeObject *__pyx_ptype_6gevent_7__ident_IdentRegistry = 0; +static PyObject **__pyx_vp_6gevent_7__ident_heappop = 0; +#define __pyx_v_6gevent_7__ident_heappop (*__pyx_vp_6gevent_7__ident_heappop) +static PyObject **__pyx_vp_6gevent_7__ident_heappush = 0; +#define __pyx_v_6gevent_7__ident_heappush (*__pyx_vp_6gevent_7__ident_heappush) +static PyObject **__pyx_vp_6gevent_7__ident_WeakKeyDictionary = 0; +#define __pyx_v_6gevent_7__ident_WeakKeyDictionary (*__pyx_vp_6gevent_7__ident_WeakKeyDictionary) + +/* Module declarations from 'greenlet' */ + +/* Module declarations from 'gevent.__greenlet_primitives' */ +static PyTypeObject *__pyx_ptype_6gevent_21__greenlet_primitives_greenlet = 0; +static PyTypeObject *__pyx_ptype_6gevent_21__greenlet_primitives_TrackedRawGreenlet = 0; +static PyTypeObject *__pyx_ptype_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop = 0; +static PyObject **__pyx_vp_6gevent_21__greenlet_primitives_get_objects = 0; +#define __pyx_v_6gevent_21__greenlet_primitives_get_objects (*__pyx_vp_6gevent_21__greenlet_primitives_get_objects) +static PyObject **__pyx_vp_6gevent_21__greenlet_primitives_wref = 0; +#define __pyx_v_6gevent_21__greenlet_primitives_wref (*__pyx_vp_6gevent_21__greenlet_primitives_wref) +static PyObject **__pyx_vp_6gevent_21__greenlet_primitives_BlockingSwitchOutError = 0; +#define __pyx_v_6gevent_21__greenlet_primitives_BlockingSwitchOutError (*__pyx_vp_6gevent_21__greenlet_primitives_BlockingSwitchOutError) +static int *__pyx_vp_6gevent_21__greenlet_primitives__greenlet_imported = 0; +#define __pyx_v_6gevent_21__greenlet_primitives__greenlet_imported (*__pyx_vp_6gevent_21__greenlet_primitives__greenlet_imported) + +/* Module declarations from 'gevent.__hub_local' */ +static PyObject **__pyx_vp_6gevent_11__hub_local__threadlocal = 0; +#define __pyx_v_6gevent_11__hub_local__threadlocal (*__pyx_vp_6gevent_11__hub_local__threadlocal) +static struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *(*__pyx_f_6gevent_11__hub_local_get_hub_noargs)(int __pyx_skip_dispatch); /*proto*/ + +/* Module declarations from 'gevent.__waiter' */ +static PyTypeObject *__pyx_ptype_6gevent_8__waiter_greenlet = 0; +static PyTypeObject *__pyx_ptype_6gevent_8__waiter_Waiter = 0; +static PyTypeObject *__pyx_ptype_6gevent_8__waiter_MultipleWaiter = 0; +static PyObject **__pyx_vp_6gevent_8__waiter_sys = 0; +#define __pyx_v_6gevent_8__waiter_sys (*__pyx_vp_6gevent_8__waiter_sys) +static PyObject **__pyx_vp_6gevent_8__waiter_ConcurrentObjectUseError = 0; +#define __pyx_v_6gevent_8__waiter_ConcurrentObjectUseError (*__pyx_vp_6gevent_8__waiter_ConcurrentObjectUseError) +static int *__pyx_vp_6gevent_8__waiter__greenlet_imported = 0; +#define __pyx_v_6gevent_8__waiter__greenlet_imported (*__pyx_vp_6gevent_8__waiter__greenlet_imported) +static PyObject **__pyx_vp_6gevent_8__waiter__NONE = 0; +#define __pyx_v_6gevent_8__waiter__NONE (*__pyx_vp_6gevent_8__waiter__NONE) + +/* Module declarations from 'types' */ + +/* Module declarations from 'gevent._greenlet' */ +static PyTypeObject *__pyx_ptype_6gevent_9_greenlet_greenlet = 0; +static PyTypeObject *__pyx_ptype_6gevent_9_greenlet_CodeType = 0; +static PyTypeObject *__pyx_ptype_6gevent_9_greenlet_FrameType = 0; +static PyTypeObject *__pyx_ptype_6gevent_9_greenlet_SpawnedLink = 0; +static PyTypeObject *__pyx_ptype_6gevent_9_greenlet_SuccessSpawnedLink = 0; +static PyTypeObject *__pyx_ptype_6gevent_9_greenlet_FailureSpawnedLink = 0; +static PyTypeObject *__pyx_ptype_6gevent_9_greenlet__Frame = 0; +static PyTypeObject *__pyx_ptype_6gevent_9_greenlet_Greenlet = 0; +static PyTypeObject *__pyx_ptype_6gevent_9_greenlet__dummy_event = 0; +static int *__pyx_vp_6gevent_9_greenlet__PYPY = 0; +#define __pyx_v_6gevent_9_greenlet__PYPY (*__pyx_vp_6gevent_9_greenlet__PYPY) +static PyObject **__pyx_vp_6gevent_9_greenlet_sys_getframe = 0; +#define __pyx_v_6gevent_9_greenlet_sys_getframe (*__pyx_vp_6gevent_9_greenlet_sys_getframe) +static PyObject **__pyx_vp_6gevent_9_greenlet_sys_exc_info = 0; +#define __pyx_v_6gevent_9_greenlet_sys_exc_info (*__pyx_vp_6gevent_9_greenlet_sys_exc_info) +static PyObject **__pyx_vp_6gevent_9_greenlet_Timeout = 0; +#define __pyx_v_6gevent_9_greenlet_Timeout (*__pyx_vp_6gevent_9_greenlet_Timeout) +static PyObject **__pyx_vp_6gevent_9_greenlet_GreenletExit = 0; +#define __pyx_v_6gevent_9_greenlet_GreenletExit (*__pyx_vp_6gevent_9_greenlet_GreenletExit) +static PyObject **__pyx_vp_6gevent_9_greenlet_InvalidSwitchError = 0; +#define __pyx_v_6gevent_9_greenlet_InvalidSwitchError (*__pyx_vp_6gevent_9_greenlet_InvalidSwitchError) +static int *__pyx_vp_6gevent_9_greenlet__greenlet_imported = 0; +#define __pyx_v_6gevent_9_greenlet__greenlet_imported (*__pyx_vp_6gevent_9_greenlet__greenlet_imported) +static PyObject **__pyx_vp_6gevent_9_greenlet__greenlet__init__ = 0; +#define __pyx_v_6gevent_9_greenlet__greenlet__init__ (*__pyx_vp_6gevent_9_greenlet__greenlet__init__) +static PyObject **__pyx_vp_6gevent_9_greenlet__threadlocal = 0; +#define __pyx_v_6gevent_9_greenlet__threadlocal (*__pyx_vp_6gevent_9_greenlet__threadlocal) +static PyObject **__pyx_vp_6gevent_9_greenlet_get_hub_class = 0; +#define __pyx_v_6gevent_9_greenlet_get_hub_class (*__pyx_vp_6gevent_9_greenlet_get_hub_class) +static PyObject **__pyx_vp_6gevent_9_greenlet_wref = 0; +#define __pyx_v_6gevent_9_greenlet_wref (*__pyx_vp_6gevent_9_greenlet_wref) +static PyObject **__pyx_vp_6gevent_9_greenlet_dump_traceback = 0; +#define __pyx_v_6gevent_9_greenlet_dump_traceback (*__pyx_vp_6gevent_9_greenlet_dump_traceback) +static PyObject **__pyx_vp_6gevent_9_greenlet_load_traceback = 0; +#define __pyx_v_6gevent_9_greenlet_load_traceback (*__pyx_vp_6gevent_9_greenlet_load_traceback) +static PyObject **__pyx_vp_6gevent_9_greenlet_wait = 0; +#define __pyx_v_6gevent_9_greenlet_wait (*__pyx_vp_6gevent_9_greenlet_wait) +static PyObject **__pyx_vp_6gevent_9_greenlet_iwait = 0; +#define __pyx_v_6gevent_9_greenlet_iwait (*__pyx_vp_6gevent_9_greenlet_iwait) +static PyObject **__pyx_vp_6gevent_9_greenlet_reraise = 0; +#define __pyx_v_6gevent_9_greenlet_reraise (*__pyx_vp_6gevent_9_greenlet_reraise) +static PyObject **__pyx_vp_6gevent_9_greenlet_GEVENT_CONFIG = 0; +#define __pyx_v_6gevent_9_greenlet_GEVENT_CONFIG (*__pyx_vp_6gevent_9_greenlet_GEVENT_CONFIG) +static struct __pyx_obj_6gevent_9_greenlet__dummy_event **__pyx_vp_6gevent_9_greenlet__cancelled_start_event = 0; +#define __pyx_v_6gevent_9_greenlet__cancelled_start_event (*__pyx_vp_6gevent_9_greenlet__cancelled_start_event) +static struct __pyx_obj_6gevent_9_greenlet__dummy_event **__pyx_vp_6gevent_9_greenlet__start_completed_event = 0; +#define __pyx_v_6gevent_9_greenlet__start_completed_event (*__pyx_vp_6gevent_9_greenlet__start_completed_event) +static PyObject **__pyx_vp_6gevent_9_greenlet__spawn_callbacks = 0; +#define __pyx_v_6gevent_9_greenlet__spawn_callbacks (*__pyx_vp_6gevent_9_greenlet__spawn_callbacks) + +/* Module declarations from 'gevent._local' */ +static PyTypeObject *__pyx_ptype_6gevent_6_local_greenlet = 0; +static PyTypeObject *__pyx_ptype_6gevent_6_local__wrefdict = 0; +static PyTypeObject *__pyx_ptype_6gevent_6_local__greenlet_deleted = 0; +static PyTypeObject *__pyx_ptype_6gevent_6_local__local_deleted = 0; +static PyTypeObject *__pyx_ptype_6gevent_6_local__localimpl = 0; +static PyTypeObject *__pyx_ptype_6gevent_6_local__localimpl_dict_entry = 0; +static PyTypeObject *__pyx_ptype_6gevent_6_local_local = 0; +static int __pyx_v_6gevent_6_local__PYPY; +static PyObject *__pyx_v_6gevent_6_local_ref = 0; +static PyObject *__pyx_v_6gevent_6_local_copy = 0; +static PyObject *__pyx_v_6gevent_6_local__marker = 0; +static PyObject *__pyx_v_6gevent_6_local_key_prefix = 0; +static int __pyx_v_6gevent_6_local__greenlet_imported; +static PyObject *__pyx_v_6gevent_6_local__local_attrs = 0; +static CYTHON_INLINE PyGreenlet *__pyx_f_6gevent_6_local_getcurrent(void); /*proto*/ +static CYTHON_INLINE void __pyx_f_6gevent_6_local_greenlet_init(void); /*proto*/ +static void __pyx_f_6gevent_6_local__init(void); /*proto*/ +static PyObject *__pyx_f_6gevent_6_local__localimpl_create_dict(struct __pyx_obj_6gevent_6_local__localimpl *, PyGreenlet *, PyObject *); /*proto*/ +static CYTHON_INLINE PyObject *__pyx_f_6gevent_6_local__local_get_dict(struct __pyx_obj_6gevent_6_local_local *); /*proto*/ +static PyObject *__pyx_f_6gevent_6_local__local__copy_dict_from(struct __pyx_obj_6gevent_6_local_local *, struct __pyx_obj_6gevent_6_local__localimpl *, PyObject *); /*proto*/ +static PyObject *__pyx_f_6gevent_6_local__local_find_descriptors(struct __pyx_obj_6gevent_6_local_local *); /*proto*/ +static PyObject *__pyx_f_6gevent_6_local_all_local_dicts_for_greenlet(PyGreenlet *, int __pyx_skip_dispatch); /*proto*/ +#define __Pyx_MODULE_NAME "gevent._local" +extern int __pyx_module_is_main_gevent___local; +int __pyx_module_is_main_gevent___local = 0; + +/* Implementation of 'gevent._local' */ +static PyObject *__pyx_builtin___import__; +static PyObject *__pyx_builtin_object; +static PyObject *__pyx_builtin_TypeError; +static PyObject *__pyx_builtin_classmethod; +static PyObject *__pyx_builtin_id; +static PyObject *__pyx_builtin_AttributeError; +static PyObject *__pyx_builtin_KeyError; +static PyObject *__pyx_builtin_super; +static const char __pyx_k_id[] = "id"; +static const char __pyx_k_kw[] = "kw"; +static const char __pyx_k_PY2[] = "PY2"; +static const char __pyx_k_all[] = "__all__"; +static const char __pyx_k_cls[] = "cls"; +static const char __pyx_k_get[] = "__get__"; +static const char __pyx_k_idt[] = "idt"; +static const char __pyx_k_key[] = "key"; +static const char __pyx_k_mro[] = "mro"; +static const char __pyx_k_new[] = "__new__"; +static const char __pyx_k_pop[] = "pop"; +static const char __pyx_k_ref[] = "ref"; +static const char __pyx_k_set[] = "__set__"; +static const char __pyx_k_None[] = "None"; +static const char __pyx_k_PYPY[] = "_PYPY"; +static const char __pyx_k_args[] = "args"; +static const char __pyx_k_copy[] = "__copy__"; +static const char __pyx_k_dict[] = "__dict__"; +static const char __pyx_k_init[] = "__init__"; +static const char __pyx_k_main[] = "__main__"; +static const char __pyx_k_name[] = "__name__"; +static const char __pyx_k_self[] = "self"; +static const char __pyx_k_test[] = "__test__"; +static const char __pyx_k_cinit[] = "__cinit__"; +static const char __pyx_k_class[] = "__class__"; +static const char __pyx_k_dicts[] = "dicts"; +static const char __pyx_k_get_2[] = "get"; +static const char __pyx_k_items[] = "items"; +static const char __pyx_k_local[] = "local"; +static const char __pyx_k_slots[] = "__slots__"; +static const char __pyx_k_super[] = "super"; +static const char __pyx_k_PYPY_2[] = "PYPY"; +static const char __pyx_k_copy_2[] = "copy"; +static const char __pyx_k_delete[] = "__delete__"; +static const char __pyx_k_import[] = "__import__"; +static const char __pyx_k_kwargs[] = "kwargs"; +static const char __pyx_k_lambda[] = ""; +static const char __pyx_k_marker[] = "_marker"; +static const char __pyx_k_object[] = "object"; +static const char __pyx_k_unlink[] = "unlink"; +static const char __pyx_k_unused[] = "_unused"; +static const char __pyx_k_getattr[] = "__getattr__"; +static const char __pyx_k_rawlink[] = "rawlink"; +static const char __pyx_k_setattr[] = "__setattr__"; +static const char __pyx_k_weakref[] = "weakref"; +static const char __pyx_k_wrdicts[] = "wrdicts"; +static const char __pyx_k_KeyError[] = "KeyError"; +static const char __pyx_k_greenlet[] = "greenlet"; +static const char __pyx_k_id_local[] = "id_local"; +static const char __pyx_k_pyx_capi[] = "__pyx_capi__"; +static const char __pyx_k_wrefdict[] = "_wrefdict"; +static const char __pyx_k_wrthread[] = "wrthread"; +static const char __pyx_k_TypeError[] = "TypeError"; +static const char __pyx_k_localargs[] = "localargs"; +static const char __pyx_k_localdict[] = "localdict"; +static const char __pyx_k_localimpl[] = "_localimpl"; +static const char __pyx_k_weakref_2[] = "__weakref__"; +static const char __pyx_k_getcurrent[] = "getcurrent"; +static const char __pyx_k_key_prefix[] = "key_prefix"; +static const char __pyx_k_local_type[] = "local_type"; +static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__"; +static const char __pyx_k_wrgreenlet[] = "wrgreenlet"; +static const char __pyx_k_classmethod[] = "classmethod"; +static const char __pyx_k_local__impl[] = "_local__impl"; +static const char __pyx_k_local_attrs[] = "_local_attrs"; +static const char __pyx_k_localkwargs[] = "localkwargs"; +static const char __pyx_k_localtypeid[] = "localtypeid"; +static const char __pyx_k_getattribute[] = "__getattribute__"; +static const char __pyx_k_gevent__util[] = "gevent._util"; +static const char __pyx_k_local___copy[] = "local.__copy__"; +static const char __pyx_k_local_type_2[] = "_local_type"; +static const char __pyx_k_gevent__local[] = "gevent._local"; +static const char __pyx_k_greenlet_init[] = "greenlet_init"; +static const char __pyx_k_local_deleted[] = "_local_deleted"; +static const char __pyx_k_AttributeError[] = "AttributeError"; +static const char __pyx_k_gevent__compat[] = "gevent._compat"; +static const char __pyx_k_import_c_accel[] = "import_c_accel"; +static const char __pyx_k_local_type_vars[] = "_local_type_vars"; +static const char __pyx_k_greenlet_deleted[] = "greenlet_deleted"; +static const char __pyx_k_greenlet_imported[] = "_greenlet_imported"; +static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; +static const char __pyx_k_greenlet_deleted_2[] = "_greenlet_deleted"; +static const char __pyx_k_src_gevent_local_py[] = "src\\gevent\\local.py"; +static const char __pyx_k_localimpl_dict_entry[] = "_localimpl_dict_entry"; +static const char __pyx_k_gevent_local_localimpl[] = "_gevent_local_localimpl_"; +static const char __pyx_k_local_type_del_descriptors[] = "_local_type_del_descriptors"; +static const char __pyx_k_local_type_get_descriptors[] = "_local_type_get_descriptors"; +static const char __pyx_k_local_type_set_descriptors[] = "_local_type_set_descriptors"; +static const char __pyx_k_r_object_has_no_attribute_s[] = "%r object has no attribute '%s'"; +static const char __pyx_k_all_local_dicts_for_greenlet[] = "all_local_dicts_for_greenlet"; +static const char __pyx_k_r_object_attribute___dict___is[] = "%r object attribute '__dict__' is read-only"; +static const char __pyx_k_Greenlet_local_objects_This_mod[] = "\nGreenlet-local objects.\n\nThis module is based on `_threading_local.py`__ from the standard\nlibrary of Python 3.4.\n\n__ https://github.com/python/cpython/blob/3.4/Lib/_threading_local.py\n\nGreenlet-local objects support the management of greenlet-local data.\nIf you have data that you want to be local to a greenlet, simply create\na greenlet-local object and use its attributes:\n\n >>> mydata = local()\n >>> mydata.number = 42\n >>> mydata.number\n 42\n\nYou can also access the local-object's dictionary:\n\n >>> mydata.__dict__\n {'number': 42}\n >>> mydata.__dict__.setdefault('widgets', [])\n []\n >>> mydata.widgets\n []\n\nWhat's important about greenlet-local objects is that their data are\nlocal to a greenlet. If we access the data in a different greenlet:\n\n >>> log = []\n >>> def f():\n ... items = list(mydata.__dict__.items())\n ... items.sort()\n ... log.append(items)\n ... mydata.number = 11\n ... log.append(mydata.number)\n >>> greenlet = gevent.spawn(f)\n >>> greenlet.join()\n >>> log\n [[], 11]\n\nwe get different data. Furthermore, changes made in the other greenlet\ndon't affect data seen in this greenlet:\n\n >>> mydata.number\n 42\n\nOf course, values you get from a local object, including a __dict__\nattribute, are for whatever greenlet was current at the time the\nattribute was read. For that reason, you generally don't want to save\nthese values across greenlets, as they apply only to the greenlet they\ncame from.\n\nYou can create custom local objects by subclassing the local class:\n\n >>> class MyLocal(local):\n ... number = 2\n ... initialized = False\n ... def __init__(self, **kw):\n ... if self.initialized:\n ... raise SystemError('__init__ called too many times')\n ... self.initialized = True\n ... self.__dict__.update(kw)\n ... def squared(self):\n ... return self.number ** 2\n\nThis can be useful to support default val""ues, methods and\ninitialization. Note that if you define an __init__ method, it will be\ncalled each time the local object is used in a separate greenlet. This\nis necessary to initialize each greenlet's dictionary.\n\nNow if we create a local object:\n\n >>> mydata = MyLocal(color='red')\n\nNow we have a default number:\n\n >>> mydata.number\n 2\n\nan initial color:\n\n >>> mydata.color\n 'red'\n >>> del mydata.color\n\nAnd a method that operates on the data:\n\n >>> mydata.squared()\n 4\n\nAs before, we can access the data in a separate greenlet:\n\n >>> log = []\n >>> greenlet = gevent.spawn(f)\n >>> greenlet.join()\n >>> log\n [[('color', 'red'), ('initialized', True)], 11]\n\nwithout affecting this greenlet's data:\n\n >>> mydata.number\n 2\n >>> mydata.color\n Traceback (most recent call last):\n ...\n AttributeError: 'MyLocal' object has no attribute 'color'\n\nNote that subclasses can define slots, but they are not greenlet\nlocal. They are shared across greenlets::\n\n >>> class MyLocal(local):\n ... __slots__ = 'number'\n\n >>> mydata = MyLocal()\n >>> mydata.number = 42\n >>> mydata.color = 'red'\n\nSo, the separate greenlet:\n\n >>> greenlet = gevent.spawn(f)\n >>> greenlet.join()\n\naffects what we see:\n\n >>> mydata.number\n 11\n\n>>> del mydata\n\n.. versionchanged:: 1.1a2\n Update the implementation to match Python 3.4 instead of Python 2.5.\n This results in locals being eligible for garbage collection as soon\n as their greenlet exits.\n\n.. versionchanged:: 1.2.3\n Use a weak-reference to clear the greenlet link we establish in case\n the local object dies before the greenlet does.\n\n.. versionchanged:: 1.3a1\n Implement the methods for attribute access directly, handling\n descriptors directly here. This allows removing the use of a lock\n and facilitates greatly improved performance.\n\n.. versionchanged:: 1.3a1\n The ``__init__`` method of subclasses of ``local`` is no longer\n called wit""h a lock held. CPython does not use such a lock in its\n native implementation. This could potentially show as a difference\n if code that uses multiple dependent attributes in ``__slots__``\n (which are shared across all greenlets) switches during ``__init__``.\n\n"; +static const char __pyx_k_local_type_set_or_del_descripto[] = "_local_type_set_or_del_descriptors"; +static const char __pyx_k_Initialization_arguments_are_not[] = "Initialization arguments are not supported"; +static PyObject *__pyx_n_s_AttributeError; +static PyObject *__pyx_kp_s_Initialization_arguments_are_not; +static PyObject *__pyx_n_s_KeyError; +static PyObject *__pyx_n_s_None; +static PyObject *__pyx_n_s_PY2; +static PyObject *__pyx_n_s_PYPY; +static PyObject *__pyx_n_s_PYPY_2; +static PyObject *__pyx_n_s_TypeError; +static PyObject *__pyx_n_s_all; +static PyObject *__pyx_n_s_all_local_dicts_for_greenlet; +static PyObject *__pyx_n_s_args; +static PyObject *__pyx_n_s_cinit; +static PyObject *__pyx_n_s_class; +static PyObject *__pyx_n_s_classmethod; +static PyObject *__pyx_n_s_cline_in_traceback; +static PyObject *__pyx_n_s_cls; +static PyObject *__pyx_n_s_copy; +static PyObject *__pyx_n_s_copy_2; +static PyObject *__pyx_n_s_delete; +static PyObject *__pyx_n_s_dict; +static PyObject *__pyx_n_s_dicts; +static PyObject *__pyx_n_s_get; +static PyObject *__pyx_n_s_get_2; +static PyObject *__pyx_n_s_getattr; +static PyObject *__pyx_n_s_getattribute; +static PyObject *__pyx_n_s_getcurrent; +static PyObject *__pyx_n_s_gevent__compat; +static PyObject *__pyx_n_s_gevent__local; +static PyObject *__pyx_n_s_gevent__util; +static PyObject *__pyx_n_s_gevent_local_localimpl; +static PyObject *__pyx_n_s_greenlet; +static PyObject *__pyx_n_s_greenlet_deleted; +static PyObject *__pyx_n_s_greenlet_deleted_2; +static PyObject *__pyx_n_s_greenlet_imported; +static PyObject *__pyx_n_s_greenlet_init; +static PyObject *__pyx_n_s_id; +static PyObject *__pyx_n_s_id_local; +static PyObject *__pyx_n_s_idt; +static PyObject *__pyx_n_s_import; +static PyObject *__pyx_n_s_import_c_accel; +static PyObject *__pyx_n_s_init; +static PyObject *__pyx_n_s_items; +static PyObject *__pyx_n_s_key; +static PyObject *__pyx_n_s_key_prefix; +static PyObject *__pyx_n_s_kw; +static PyObject *__pyx_n_s_kwargs; +static PyObject *__pyx_n_s_lambda; +static PyObject *__pyx_n_s_local; +static PyObject *__pyx_n_s_local___copy; +static PyObject *__pyx_n_s_local__impl; +static PyObject *__pyx_n_s_local_attrs; +static PyObject *__pyx_n_s_local_deleted; +static PyObject *__pyx_n_s_local_type; +static PyObject *__pyx_n_s_local_type_2; +static PyObject *__pyx_n_s_local_type_del_descriptors; +static PyObject *__pyx_n_s_local_type_get_descriptors; +static PyObject *__pyx_n_s_local_type_set_descriptors; +static PyObject *__pyx_n_s_local_type_set_or_del_descripto; +static PyObject *__pyx_n_s_local_type_vars; +static PyObject *__pyx_n_s_localargs; +static PyObject *__pyx_n_s_localdict; +static PyObject *__pyx_n_s_localimpl; +static PyObject *__pyx_n_s_localimpl_dict_entry; +static PyObject *__pyx_n_s_localkwargs; +static PyObject *__pyx_n_s_localtypeid; +static PyObject *__pyx_n_s_main; +static PyObject *__pyx_n_s_marker; +static PyObject *__pyx_n_s_mro; +static PyObject *__pyx_n_s_name; +static PyObject *__pyx_n_s_new; +static PyObject *__pyx_n_s_object; +static PyObject *__pyx_n_s_pop; +static PyObject *__pyx_n_s_pyx_capi; +static PyObject *__pyx_n_s_pyx_vtable; +static PyObject *__pyx_kp_s_r_object_attribute___dict___is; +static PyObject *__pyx_kp_s_r_object_has_no_attribute_s; +static PyObject *__pyx_n_s_rawlink; +static PyObject *__pyx_n_s_ref; +static PyObject *__pyx_n_s_self; +static PyObject *__pyx_n_s_set; +static PyObject *__pyx_n_s_setattr; +static PyObject *__pyx_n_s_slots; +static PyObject *__pyx_kp_s_src_gevent_local_py; +static PyObject *__pyx_n_s_super; +static PyObject *__pyx_n_s_test; +static PyObject *__pyx_n_s_unlink; +static PyObject *__pyx_n_s_unused; +static PyObject *__pyx_n_s_weakref; +static PyObject *__pyx_n_s_weakref_2; +static PyObject *__pyx_n_s_wrdicts; +static PyObject *__pyx_n_s_wrefdict; +static PyObject *__pyx_n_s_wrgreenlet; +static PyObject *__pyx_n_s_wrthread; +static PyObject *__pyx_lambda_funcdef_6gevent_6_local_lambda(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_6gevent_6_local_all_local_dicts_for_greenlet(CYTHON_UNUSED PyObject *__pyx_self, PyGreenlet *__pyx_v_greenlet); /* proto */ +static int __pyx_pf_6gevent_6_local_17_greenlet_deleted___init__(struct __pyx_obj_6gevent_6_local__greenlet_deleted *__pyx_v_self, PyObject *__pyx_v_idt, PyObject *__pyx_v_wrdicts); /* proto */ +static PyObject *__pyx_pf_6gevent_6_local_17_greenlet_deleted_2__call__(struct __pyx_obj_6gevent_6_local__greenlet_deleted *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v__unused); /* proto */ +static int __pyx_pf_6gevent_6_local_14_local_deleted___init__(struct __pyx_obj_6gevent_6_local__local_deleted *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_wrthread, PyObject *__pyx_v_greenlet_deleted); /* proto */ +static PyObject *__pyx_pf_6gevent_6_local_14_local_deleted_2__call__(struct __pyx_obj_6gevent_6_local__local_deleted *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v__unused); /* proto */ +static int __pyx_pf_6gevent_6_local_10_localimpl___init__(struct __pyx_obj_6gevent_6_local__localimpl *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs, PyObject *__pyx_v_local_type, PyObject *__pyx_v_id_local); /* proto */ +static int __pyx_pf_6gevent_6_local_21_localimpl_dict_entry___init__(struct __pyx_obj_6gevent_6_local__localimpl_dict_entry *__pyx_v_self, PyObject *__pyx_v_wrgreenlet, PyObject *__pyx_v_localdict); /* proto */ +static int __pyx_pf_6gevent_6_local_5local___cinit__(struct __pyx_obj_6gevent_6_local_local *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kw); /* proto */ +static PyObject *__pyx_pf_6gevent_6_local_5local_2__getattribute__(struct __pyx_obj_6gevent_6_local_local *__pyx_v_self, PyObject *__pyx_v_name); /* proto */ +static int __pyx_pf_6gevent_6_local_5local_4__setattr__(struct __pyx_obj_6gevent_6_local_local *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6gevent_6_local_5local_6__delattr__(struct __pyx_obj_6gevent_6_local_local *__pyx_v_self, PyObject *__pyx_v_name); /* proto */ +static PyObject *__pyx_pf_6gevent_6_local_5local_8__copy__(struct __pyx_obj_6gevent_6_local_local *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_6_local_2__new__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_cls, PyObject *__pyx_v_args, PyObject *__pyx_v_kw); /* proto */ +static PyObject *__pyx_tp_new_6gevent_6_local__wrefdict(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6gevent_6_local__greenlet_deleted(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6gevent_6_local__local_deleted(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6gevent_6_local__localimpl(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6gevent_6_local__localimpl_dict_entry(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6gevent_6_local_local(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_get = {0, &__pyx_n_s_get_2, 0, 0, 0}; +static PyObject *__pyx_tuple_; +static PyObject *__pyx_tuple__2; +static PyObject *__pyx_tuple__4; +static PyObject *__pyx_tuple__5; +static PyObject *__pyx_tuple__6; +static PyObject *__pyx_tuple__7; +static PyObject *__pyx_tuple__8; +static PyObject *__pyx_tuple__10; +static PyObject *__pyx_codeobj__3; +static PyObject *__pyx_codeobj__9; +static PyObject *__pyx_codeobj__11; +/* Late includes */ + +/* "src/gevent/local.py":161 + * + * locals()['getcurrent'] = __import__('greenlet').getcurrent + * locals()['greenlet_init'] = lambda: None # <<<<<<<<<<<<<< + * + * __all__ = [ + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_local_4lambda(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyMethodDef __pyx_mdef_6gevent_6_local_4lambda = {"lambda", (PyCFunction)__pyx_pw_6gevent_6_local_4lambda, METH_NOARGS, 0}; +static PyObject *__pyx_pw_6gevent_6_local_4lambda(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("lambda (wrapper)", 0); + __pyx_r = __pyx_lambda_funcdef_6gevent_6_local_lambda(__pyx_self); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_lambda_funcdef_6gevent_6_local_lambda(CYTHON_UNUSED PyObject *__pyx_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("lambda", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/local.py":179 + * # That final tuple is actually a localimpl_dict_entry object. + * + * def all_local_dicts_for_greenlet(greenlet): # <<<<<<<<<<<<<< + * """ + * Internal debug helper for getting the local values associated + */ + +static PyObject *__pyx_pw_6gevent_6_local_1all_local_dicts_for_greenlet(PyObject *__pyx_self, PyObject *__pyx_v_greenlet); /*proto*/ +static PyObject *__pyx_f_6gevent_6_local_all_local_dicts_for_greenlet(PyGreenlet *__pyx_v_greenlet, CYTHON_UNUSED int __pyx_skip_dispatch) { + PyObject *__pyx_v_result = 0; + struct __pyx_obj_6gevent_6_local__localimpl *__pyx_v_local_impl = 0; + struct __pyx_obj_6gevent_6_local__localimpl_dict_entry *__pyx_v_entry = 0; + PyObject *__pyx_v_k = 0; + PyObject *__pyx_v_greenlet_dict = 0; + PyObject *__pyx_v_id_greenlet = NULL; + PyObject *__pyx_v_v = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + int __pyx_t_8; + int __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + int __pyx_t_11; + __Pyx_RefNannySetupContext("all_local_dicts_for_greenlet", 0); + + /* "src/gevent/local.py":191 + * """ + * + * result = [] # <<<<<<<<<<<<<< + * id_greenlet = id(greenlet) + * greenlet_dict = greenlet.__dict__ + */ + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 191, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_result = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "src/gevent/local.py":192 + * + * result = [] + * id_greenlet = id(greenlet) # <<<<<<<<<<<<<< + * greenlet_dict = greenlet.__dict__ + * for k, v in greenlet_dict.items(): + */ + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_greenlet)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 192, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_id_greenlet = __pyx_t_1; + __pyx_t_1 = 0; + + /* "src/gevent/local.py":193 + * result = [] + * id_greenlet = id(greenlet) + * greenlet_dict = greenlet.__dict__ # <<<<<<<<<<<<<< + * for k, v in greenlet_dict.items(): + * if not k.startswith(key_prefix): + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_greenlet), __pyx_n_s_dict); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 193, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(PyDict_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 193, __pyx_L1_error) + __pyx_v_greenlet_dict = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "src/gevent/local.py":194 + * id_greenlet = id(greenlet) + * greenlet_dict = greenlet.__dict__ + * for k, v in greenlet_dict.items(): # <<<<<<<<<<<<<< + * if not k.startswith(key_prefix): + * continue + */ + __pyx_t_2 = 0; + if (unlikely(__pyx_v_greenlet_dict == Py_None)) { + PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items"); + __PYX_ERR(0, 194, __pyx_L1_error) + } + __pyx_t_5 = __Pyx_dict_iterator(__pyx_v_greenlet_dict, 1, __pyx_n_s_items, (&__pyx_t_3), (&__pyx_t_4)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 194, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_1); + __pyx_t_1 = __pyx_t_5; + __pyx_t_5 = 0; + while (1) { + __pyx_t_7 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_3, &__pyx_t_2, &__pyx_t_5, &__pyx_t_6, NULL, __pyx_t_4); + if (unlikely(__pyx_t_7 == 0)) break; + if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(0, 194, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_6); + if (!(likely(PyString_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_5)->tp_name), 0))) __PYX_ERR(0, 194, __pyx_L1_error) + __Pyx_XDECREF_SET(__pyx_v_k, ((PyObject*)__pyx_t_5)); + __pyx_t_5 = 0; + __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_6); + __pyx_t_6 = 0; + + /* "src/gevent/local.py":195 + * greenlet_dict = greenlet.__dict__ + * for k, v in greenlet_dict.items(): + * if not k.startswith(key_prefix): # <<<<<<<<<<<<<< + * continue + * local_impl = v() + */ + if (unlikely(__pyx_v_k == Py_None)) { + PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "startswith"); + __PYX_ERR(0, 195, __pyx_L1_error) + } + __pyx_t_8 = __Pyx_PyStr_Tailmatch(__pyx_v_k, __pyx_v_6gevent_6_local_key_prefix, 0, PY_SSIZE_T_MAX, -1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 195, __pyx_L1_error) + __pyx_t_9 = ((!(__pyx_t_8 != 0)) != 0); + if (__pyx_t_9) { + + /* "src/gevent/local.py":196 + * for k, v in greenlet_dict.items(): + * if not k.startswith(key_prefix): + * continue # <<<<<<<<<<<<<< + * local_impl = v() + * if local_impl is None: + */ + goto __pyx_L3_continue; + + /* "src/gevent/local.py":195 + * greenlet_dict = greenlet.__dict__ + * for k, v in greenlet_dict.items(): + * if not k.startswith(key_prefix): # <<<<<<<<<<<<<< + * continue + * local_impl = v() + */ + } + + /* "src/gevent/local.py":197 + * if not k.startswith(key_prefix): + * continue + * local_impl = v() # <<<<<<<<<<<<<< + * if local_impl is None: + * continue + */ + __Pyx_INCREF(__pyx_v_v); + __pyx_t_5 = __pyx_v_v; __pyx_t_10 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_5); + if (likely(__pyx_t_10)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_10); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_5, function); + } + } + __pyx_t_6 = (__pyx_t_10) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_10) : __Pyx_PyObject_CallNoArg(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 197, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_6gevent_6_local__localimpl))))) __PYX_ERR(0, 197, __pyx_L1_error) + __Pyx_XDECREF_SET(__pyx_v_local_impl, ((struct __pyx_obj_6gevent_6_local__localimpl *)__pyx_t_6)); + __pyx_t_6 = 0; + + /* "src/gevent/local.py":198 + * continue + * local_impl = v() + * if local_impl is None: # <<<<<<<<<<<<<< + * continue + * entry = local_impl.dicts.get(id_greenlet) + */ + __pyx_t_9 = (((PyObject *)__pyx_v_local_impl) == Py_None); + __pyx_t_8 = (__pyx_t_9 != 0); + if (__pyx_t_8) { + + /* "src/gevent/local.py":199 + * local_impl = v() + * if local_impl is None: + * continue # <<<<<<<<<<<<<< + * entry = local_impl.dicts.get(id_greenlet) + * if entry is None: + */ + goto __pyx_L3_continue; + + /* "src/gevent/local.py":198 + * continue + * local_impl = v() + * if local_impl is None: # <<<<<<<<<<<<<< + * continue + * entry = local_impl.dicts.get(id_greenlet) + */ + } + + /* "src/gevent/local.py":200 + * if local_impl is None: + * continue + * entry = local_impl.dicts.get(id_greenlet) # <<<<<<<<<<<<<< + * if entry is None: + * # Not yet used in this greenlet. + */ + if (unlikely(__pyx_v_local_impl->dicts == Py_None)) { + PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get"); + __PYX_ERR(0, 200, __pyx_L1_error) + } + __pyx_t_6 = __Pyx_PyDict_GetItemDefault(__pyx_v_local_impl->dicts, __pyx_v_id_greenlet, Py_None); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 200, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_6gevent_6_local__localimpl_dict_entry))))) __PYX_ERR(0, 200, __pyx_L1_error) + __Pyx_XDECREF_SET(__pyx_v_entry, ((struct __pyx_obj_6gevent_6_local__localimpl_dict_entry *)__pyx_t_6)); + __pyx_t_6 = 0; + + /* "src/gevent/local.py":201 + * continue + * entry = local_impl.dicts.get(id_greenlet) + * if entry is None: # <<<<<<<<<<<<<< + * # Not yet used in this greenlet. + * continue + */ + __pyx_t_8 = (((PyObject *)__pyx_v_entry) == Py_None); + __pyx_t_9 = (__pyx_t_8 != 0); + if (__pyx_t_9) { + + /* "src/gevent/local.py":203 + * if entry is None: + * # Not yet used in this greenlet. + * continue # <<<<<<<<<<<<<< + * assert entry.wrgreenlet() is greenlet + * result.append((local_impl.localtypeid, entry.localdict)) + */ + goto __pyx_L3_continue; + + /* "src/gevent/local.py":201 + * continue + * entry = local_impl.dicts.get(id_greenlet) + * if entry is None: # <<<<<<<<<<<<<< + * # Not yet used in this greenlet. + * continue + */ + } + + /* "src/gevent/local.py":204 + * # Not yet used in this greenlet. + * continue + * assert entry.wrgreenlet() is greenlet # <<<<<<<<<<<<<< + * result.append((local_impl.localtypeid, entry.localdict)) + * + */ + #ifndef CYTHON_WITHOUT_ASSERTIONS + if (unlikely(!Py_OptimizeFlag)) { + __Pyx_INCREF(__pyx_v_entry->wrgreenlet); + __pyx_t_5 = __pyx_v_entry->wrgreenlet; __pyx_t_10 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_5); + if (likely(__pyx_t_10)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_10); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_5, function); + } + } + __pyx_t_6 = (__pyx_t_10) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_10) : __Pyx_PyObject_CallNoArg(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 204, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_9 = (__pyx_t_6 == ((PyObject *)__pyx_v_greenlet)); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (unlikely(!(__pyx_t_9 != 0))) { + PyErr_SetNone(PyExc_AssertionError); + __PYX_ERR(0, 204, __pyx_L1_error) + } + } + #endif + + /* "src/gevent/local.py":205 + * continue + * assert entry.wrgreenlet() is greenlet + * result.append((local_impl.localtypeid, entry.localdict)) # <<<<<<<<<<<<<< + * + * return result + */ + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 205, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(__pyx_v_local_impl->localtypeid); + __Pyx_GIVEREF(__pyx_v_local_impl->localtypeid); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_local_impl->localtypeid); + __Pyx_INCREF(__pyx_v_entry->localdict); + __Pyx_GIVEREF(__pyx_v_entry->localdict); + PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_entry->localdict); + __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_6); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 205, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_L3_continue:; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/local.py":207 + * result.append((local_impl.localtypeid, entry.localdict)) + * + * return result # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; + goto __pyx_L0; + + /* "src/gevent/local.py":179 + * # That final tuple is actually a localimpl_dict_entry object. + * + * def all_local_dicts_for_greenlet(greenlet): # <<<<<<<<<<<<<< + * """ + * Internal debug helper for getting the local values associated + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_AddTraceback("gevent._local.all_local_dicts_for_greenlet", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XDECREF((PyObject *)__pyx_v_local_impl); + __Pyx_XDECREF((PyObject *)__pyx_v_entry); + __Pyx_XDECREF(__pyx_v_k); + __Pyx_XDECREF(__pyx_v_greenlet_dict); + __Pyx_XDECREF(__pyx_v_id_greenlet); + __Pyx_XDECREF(__pyx_v_v); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_local_1all_local_dicts_for_greenlet(PyObject *__pyx_self, PyObject *__pyx_v_greenlet); /*proto*/ +static char __pyx_doc_6gevent_6_local_all_local_dicts_for_greenlet[] = "all_local_dicts_for_greenlet(greenlet greenlet)\n\n Internal debug helper for getting the local values associated\n with a greenlet. This is subject to change or removal at any time.\n\n :return: A list of ((type, id), {}) pairs, where the first element\n is the type and id of the local object and the second object is its\n instance dictionary, as seen from this greenlet.\n\n .. versionadded:: 1.3a2\n "; +static PyMethodDef __pyx_mdef_6gevent_6_local_1all_local_dicts_for_greenlet = {"all_local_dicts_for_greenlet", (PyCFunction)__pyx_pw_6gevent_6_local_1all_local_dicts_for_greenlet, METH_O, __pyx_doc_6gevent_6_local_all_local_dicts_for_greenlet}; +static PyObject *__pyx_pw_6gevent_6_local_1all_local_dicts_for_greenlet(PyObject *__pyx_self, PyObject *__pyx_v_greenlet) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("all_local_dicts_for_greenlet (wrapper)", 0); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_greenlet), __pyx_ptype_6gevent_6_local_greenlet, 1, "greenlet", 0))) __PYX_ERR(0, 179, __pyx_L1_error) + __pyx_r = __pyx_pf_6gevent_6_local_all_local_dicts_for_greenlet(__pyx_self, ((PyGreenlet *)__pyx_v_greenlet)); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_local_all_local_dicts_for_greenlet(CYTHON_UNUSED PyObject *__pyx_self, PyGreenlet *__pyx_v_greenlet) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("all_local_dicts_for_greenlet", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6gevent_6_local_all_local_dicts_for_greenlet(__pyx_v_greenlet, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 179, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent._local.all_local_dicts_for_greenlet", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/local.py":224 + * __slots__ = ('idt', 'wrdicts') + * + * def __init__(self, idt, wrdicts): # <<<<<<<<<<<<<< + * self.idt = idt + * self.wrdicts = wrdicts + */ + +/* Python wrapper */ +static int __pyx_pw_6gevent_6_local_17_greenlet_deleted_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6gevent_6_local_17_greenlet_deleted_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_idt = 0; + PyObject *__pyx_v_wrdicts = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_idt,&__pyx_n_s_wrdicts,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_idt)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_wrdicts)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(0, 224, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 224, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_idt = values[0]; + __pyx_v_wrdicts = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 224, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent._local._greenlet_deleted.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_6_local_17_greenlet_deleted___init__(((struct __pyx_obj_6gevent_6_local__greenlet_deleted *)__pyx_v_self), __pyx_v_idt, __pyx_v_wrdicts); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_6_local_17_greenlet_deleted___init__(struct __pyx_obj_6gevent_6_local__greenlet_deleted *__pyx_v_self, PyObject *__pyx_v_idt, PyObject *__pyx_v_wrdicts) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__", 0); + + /* "src/gevent/local.py":225 + * + * def __init__(self, idt, wrdicts): + * self.idt = idt # <<<<<<<<<<<<<< + * self.wrdicts = wrdicts + * + */ + __Pyx_INCREF(__pyx_v_idt); + __Pyx_GIVEREF(__pyx_v_idt); + __Pyx_GOTREF(__pyx_v_self->idt); + __Pyx_DECREF(__pyx_v_self->idt); + __pyx_v_self->idt = __pyx_v_idt; + + /* "src/gevent/local.py":226 + * def __init__(self, idt, wrdicts): + * self.idt = idt + * self.wrdicts = wrdicts # <<<<<<<<<<<<<< + * + * def __call__(self, _unused): + */ + __Pyx_INCREF(__pyx_v_wrdicts); + __Pyx_GIVEREF(__pyx_v_wrdicts); + __Pyx_GOTREF(__pyx_v_self->wrdicts); + __Pyx_DECREF(__pyx_v_self->wrdicts); + __pyx_v_self->wrdicts = __pyx_v_wrdicts; + + /* "src/gevent/local.py":224 + * __slots__ = ('idt', 'wrdicts') + * + * def __init__(self, idt, wrdicts): # <<<<<<<<<<<<<< + * self.idt = idt + * self.wrdicts = wrdicts + */ + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/local.py":228 + * self.wrdicts = wrdicts + * + * def __call__(self, _unused): # <<<<<<<<<<<<<< + * dicts = self.wrdicts() + * if dicts: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_local_17_greenlet_deleted_3__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6gevent_6_local_17_greenlet_deleted_3__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + CYTHON_UNUSED PyObject *__pyx_v__unused = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__call__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_unused,0}; + PyObject* values[1] = {0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_unused)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__call__") < 0)) __PYX_ERR(0, 228, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + } + __pyx_v__unused = values[0]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__call__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 228, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent._local._greenlet_deleted.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_6_local_17_greenlet_deleted_2__call__(((struct __pyx_obj_6gevent_6_local__greenlet_deleted *)__pyx_v_self), __pyx_v__unused); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_local_17_greenlet_deleted_2__call__(struct __pyx_obj_6gevent_6_local__greenlet_deleted *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v__unused) { + PyObject *__pyx_v_dicts = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + __Pyx_RefNannySetupContext("__call__", 0); + + /* "src/gevent/local.py":229 + * + * def __call__(self, _unused): + * dicts = self.wrdicts() # <<<<<<<<<<<<<< + * if dicts: + * dicts.pop(self.idt, None) + */ + __Pyx_INCREF(__pyx_v_self->wrdicts); + __pyx_t_2 = __pyx_v_self->wrdicts; __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 229, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_dicts = __pyx_t_1; + __pyx_t_1 = 0; + + /* "src/gevent/local.py":230 + * def __call__(self, _unused): + * dicts = self.wrdicts() + * if dicts: # <<<<<<<<<<<<<< + * dicts.pop(self.idt, None) + * + */ + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_dicts); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 230, __pyx_L1_error) + if (__pyx_t_4) { + + /* "src/gevent/local.py":231 + * dicts = self.wrdicts() + * if dicts: + * dicts.pop(self.idt, None) # <<<<<<<<<<<<<< + * + * class _local_deleted(object): + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_dicts, __pyx_n_s_pop); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 231, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + __pyx_t_5 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_5 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_self->idt, Py_None}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 231, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_self->idt, Py_None}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 231, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else + #endif + { + __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 231, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (__pyx_t_3) { + __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); __pyx_t_3 = NULL; + } + __Pyx_INCREF(__pyx_v_self->idt); + __Pyx_GIVEREF(__pyx_v_self->idt); + PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_self->idt); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, Py_None); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 231, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/local.py":230 + * def __call__(self, _unused): + * dicts = self.wrdicts() + * if dicts: # <<<<<<<<<<<<<< + * dicts.pop(self.idt, None) + * + */ + } + + /* "src/gevent/local.py":228 + * self.wrdicts = wrdicts + * + * def __call__(self, _unused): # <<<<<<<<<<<<<< + * dicts = self.wrdicts() + * if dicts: + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("gevent._local._greenlet_deleted.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_dicts); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/local.py":236 + * __slots__ = ('key', 'wrthread', 'greenlet_deleted') + * + * def __init__(self, key, wrthread, greenlet_deleted): # <<<<<<<<<<<<<< + * self.key = key + * self.wrthread = wrthread + */ + +/* Python wrapper */ +static int __pyx_pw_6gevent_6_local_14_local_deleted_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6gevent_6_local_14_local_deleted_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_key = 0; + PyObject *__pyx_v_wrthread = 0; + PyObject *__pyx_v_greenlet_deleted = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_key,&__pyx_n_s_wrthread,&__pyx_n_s_greenlet_deleted,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_wrthread)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 1); __PYX_ERR(0, 236, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_greenlet_deleted)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 2); __PYX_ERR(0, 236, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 236, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + } + __pyx_v_key = values[0]; + __pyx_v_wrthread = values[1]; + __pyx_v_greenlet_deleted = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 236, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent._local._local_deleted.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_6_local_14_local_deleted___init__(((struct __pyx_obj_6gevent_6_local__local_deleted *)__pyx_v_self), __pyx_v_key, __pyx_v_wrthread, __pyx_v_greenlet_deleted); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_6_local_14_local_deleted___init__(struct __pyx_obj_6gevent_6_local__local_deleted *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_wrthread, PyObject *__pyx_v_greenlet_deleted) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "src/gevent/local.py":237 + * + * def __init__(self, key, wrthread, greenlet_deleted): + * self.key = key # <<<<<<<<<<<<<< + * self.wrthread = wrthread + * self.greenlet_deleted = greenlet_deleted + */ + if (!(likely(PyString_CheckExact(__pyx_v_key))||((__pyx_v_key) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_v_key)->tp_name), 0))) __PYX_ERR(0, 237, __pyx_L1_error) + __pyx_t_1 = __pyx_v_key; + __Pyx_INCREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_self->key); + __Pyx_DECREF(__pyx_v_self->key); + __pyx_v_self->key = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "src/gevent/local.py":238 + * def __init__(self, key, wrthread, greenlet_deleted): + * self.key = key + * self.wrthread = wrthread # <<<<<<<<<<<<<< + * self.greenlet_deleted = greenlet_deleted + * + */ + __Pyx_INCREF(__pyx_v_wrthread); + __Pyx_GIVEREF(__pyx_v_wrthread); + __Pyx_GOTREF(__pyx_v_self->wrthread); + __Pyx_DECREF(__pyx_v_self->wrthread); + __pyx_v_self->wrthread = __pyx_v_wrthread; + + /* "src/gevent/local.py":239 + * self.key = key + * self.wrthread = wrthread + * self.greenlet_deleted = greenlet_deleted # <<<<<<<<<<<<<< + * + * def __call__(self, _unused): + */ + if (!(likely(((__pyx_v_greenlet_deleted) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_greenlet_deleted, __pyx_ptype_6gevent_6_local__greenlet_deleted))))) __PYX_ERR(0, 239, __pyx_L1_error) + __pyx_t_1 = __pyx_v_greenlet_deleted; + __Pyx_INCREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_self->greenlet_deleted); + __Pyx_DECREF(((PyObject *)__pyx_v_self->greenlet_deleted)); + __pyx_v_self->greenlet_deleted = ((struct __pyx_obj_6gevent_6_local__greenlet_deleted *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "src/gevent/local.py":236 + * __slots__ = ('key', 'wrthread', 'greenlet_deleted') + * + * def __init__(self, key, wrthread, greenlet_deleted): # <<<<<<<<<<<<<< + * self.key = key + * self.wrthread = wrthread + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent._local._local_deleted.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/local.py":241 + * self.greenlet_deleted = greenlet_deleted + * + * def __call__(self, _unused): # <<<<<<<<<<<<<< + * thread = self.wrthread() + * if thread is not None: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_local_14_local_deleted_3__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6gevent_6_local_14_local_deleted_3__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + CYTHON_UNUSED PyObject *__pyx_v__unused = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__call__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_unused,0}; + PyObject* values[1] = {0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_unused)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__call__") < 0)) __PYX_ERR(0, 241, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + } + __pyx_v__unused = values[0]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__call__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 241, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent._local._local_deleted.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_6_local_14_local_deleted_2__call__(((struct __pyx_obj_6gevent_6_local__local_deleted *)__pyx_v_self), __pyx_v__unused); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_local_14_local_deleted_2__call__(struct __pyx_obj_6gevent_6_local__local_deleted *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v__unused) { + PyObject *__pyx_v_thread = NULL; + PyObject *__pyx_v_unlink = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + int __pyx_t_9; + __Pyx_RefNannySetupContext("__call__", 0); + + /* "src/gevent/local.py":242 + * + * def __call__(self, _unused): + * thread = self.wrthread() # <<<<<<<<<<<<<< + * if thread is not None: + * try: + */ + __Pyx_INCREF(__pyx_v_self->wrthread); + __pyx_t_2 = __pyx_v_self->wrthread; __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 242, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_thread = __pyx_t_1; + __pyx_t_1 = 0; + + /* "src/gevent/local.py":243 + * def __call__(self, _unused): + * thread = self.wrthread() + * if thread is not None: # <<<<<<<<<<<<<< + * try: + * unlink = thread.unlink + */ + __pyx_t_4 = (__pyx_v_thread != Py_None); + __pyx_t_5 = (__pyx_t_4 != 0); + if (__pyx_t_5) { + + /* "src/gevent/local.py":244 + * thread = self.wrthread() + * if thread is not None: + * try: # <<<<<<<<<<<<<< + * unlink = thread.unlink + * except AttributeError: + */ + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); + __Pyx_XGOTREF(__pyx_t_6); + __Pyx_XGOTREF(__pyx_t_7); + __Pyx_XGOTREF(__pyx_t_8); + /*try:*/ { + + /* "src/gevent/local.py":245 + * if thread is not None: + * try: + * unlink = thread.unlink # <<<<<<<<<<<<<< + * except AttributeError: + * pass + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_thread, __pyx_n_s_unlink); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 245, __pyx_L4_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_unlink = __pyx_t_1; + __pyx_t_1 = 0; + + /* "src/gevent/local.py":244 + * thread = self.wrthread() + * if thread is not None: + * try: # <<<<<<<<<<<<<< + * unlink = thread.unlink + * except AttributeError: + */ + } + + /* "src/gevent/local.py":249 + * pass + * else: + * unlink(self.greenlet_deleted) # <<<<<<<<<<<<<< + * del thread.__dict__[self.key] + * + */ + /*else:*/ { + __Pyx_INCREF(__pyx_v_unlink); + __pyx_t_2 = __pyx_v_unlink; __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, ((PyObject *)__pyx_v_self->greenlet_deleted)) : __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_v_self->greenlet_deleted)); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 249, __pyx_L6_except_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + goto __pyx_L9_try_end; + __pyx_L4_error:; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/local.py":246 + * try: + * unlink = thread.unlink + * except AttributeError: # <<<<<<<<<<<<<< + * pass + * else: + */ + __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_AttributeError); + if (__pyx_t_9) { + __Pyx_ErrRestore(0,0,0); + goto __pyx_L5_exception_handled; + } + goto __pyx_L6_except_error; + __pyx_L6_except_error:; + + /* "src/gevent/local.py":244 + * thread = self.wrthread() + * if thread is not None: + * try: # <<<<<<<<<<<<<< + * unlink = thread.unlink + * except AttributeError: + */ + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); + goto __pyx_L1_error; + __pyx_L5_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); + __pyx_L9_try_end:; + } + + /* "src/gevent/local.py":250 + * else: + * unlink(self.greenlet_deleted) + * del thread.__dict__[self.key] # <<<<<<<<<<<<<< + * + * class _localimpl(object): + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_thread, __pyx_n_s_dict); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 250, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (unlikely(PyObject_DelItem(__pyx_t_1, __pyx_v_self->key) < 0)) __PYX_ERR(0, 250, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/local.py":243 + * def __call__(self, _unused): + * thread = self.wrthread() + * if thread is not None: # <<<<<<<<<<<<<< + * try: + * unlink = thread.unlink + */ + } + + /* "src/gevent/local.py":241 + * self.greenlet_deleted = greenlet_deleted + * + * def __call__(self, _unused): # <<<<<<<<<<<<<< + * thread = self.wrthread() + * if thread is not None: + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("gevent._local._local_deleted.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_thread); + __Pyx_XDECREF(__pyx_v_unlink); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/local.py":259 + * '__weakref__',) + * + * def __init__(self, args, kwargs, local_type, id_local): # <<<<<<<<<<<<<< + * self.key = key_prefix + str(id(self)) + * # { id(greenlet) -> _localimpl_dict_entry(ref(greenlet), greenlet-local dict) } + */ + +/* Python wrapper */ +static int __pyx_pw_6gevent_6_local_10_localimpl_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6gevent_6_local_10_localimpl_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_args = 0; + PyObject *__pyx_v_kwargs = 0; + PyObject *__pyx_v_local_type = 0; + PyObject *__pyx_v_id_local = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_args,&__pyx_n_s_kwargs,&__pyx_n_s_local_type,&__pyx_n_s_id_local,0}; + PyObject* values[4] = {0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kwargs)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, 1); __PYX_ERR(0, 259, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_local_type)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, 2); __PYX_ERR(0, 259, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 3: + if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_id_local)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, 3); __PYX_ERR(0, 259, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 259, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + } + __pyx_v_args = values[0]; + __pyx_v_kwargs = values[1]; + __pyx_v_local_type = values[2]; + __pyx_v_id_local = values[3]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 259, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent._local._localimpl.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_6_local_10_localimpl___init__(((struct __pyx_obj_6gevent_6_local__localimpl *)__pyx_v_self), __pyx_v_args, __pyx_v_kwargs, __pyx_v_local_type, __pyx_v_id_local); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_6_local_10_localimpl___init__(struct __pyx_obj_6gevent_6_local__localimpl *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs, PyObject *__pyx_v_local_type, PyObject *__pyx_v_id_local) { + PyGreenlet *__pyx_v_greenlet = NULL; + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "src/gevent/local.py":260 + * + * def __init__(self, args, kwargs, local_type, id_local): + * self.key = key_prefix + str(id(self)) # <<<<<<<<<<<<<< + * # { id(greenlet) -> _localimpl_dict_entry(ref(greenlet), greenlet-local dict) } + * self.dicts = _wrefdict() + */ + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 260, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyString_Type)), __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 260, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyNumber_Add(__pyx_v_6gevent_6_local_key_prefix, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 260, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(PyString_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 260, __pyx_L1_error) + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_self->key); + __Pyx_DECREF(__pyx_v_self->key); + __pyx_v_self->key = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "src/gevent/local.py":262 + * self.key = key_prefix + str(id(self)) + * # { id(greenlet) -> _localimpl_dict_entry(ref(greenlet), greenlet-local dict) } + * self.dicts = _wrefdict() # <<<<<<<<<<<<<< + * self.localargs = args + * self.localkwargs = kwargs + */ + __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_6gevent_6_local__wrefdict)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 262, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_self->dicts); + __Pyx_DECREF(__pyx_v_self->dicts); + __pyx_v_self->dicts = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "src/gevent/local.py":263 + * # { id(greenlet) -> _localimpl_dict_entry(ref(greenlet), greenlet-local dict) } + * self.dicts = _wrefdict() + * self.localargs = args # <<<<<<<<<<<<<< + * self.localkwargs = kwargs + * self.localtypeid = local_type, id_local + */ + if (!(likely(PyTuple_CheckExact(__pyx_v_args))||((__pyx_v_args) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v_args)->tp_name), 0))) __PYX_ERR(0, 263, __pyx_L1_error) + __pyx_t_1 = __pyx_v_args; + __Pyx_INCREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_self->localargs); + __Pyx_DECREF(__pyx_v_self->localargs); + __pyx_v_self->localargs = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "src/gevent/local.py":264 + * self.dicts = _wrefdict() + * self.localargs = args + * self.localkwargs = kwargs # <<<<<<<<<<<<<< + * self.localtypeid = local_type, id_local + * + */ + if (!(likely(PyDict_CheckExact(__pyx_v_kwargs))||((__pyx_v_kwargs) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_v_kwargs)->tp_name), 0))) __PYX_ERR(0, 264, __pyx_L1_error) + __pyx_t_1 = __pyx_v_kwargs; + __Pyx_INCREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_self->localkwargs); + __Pyx_DECREF(__pyx_v_self->localkwargs); + __pyx_v_self->localkwargs = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "src/gevent/local.py":265 + * self.localargs = args + * self.localkwargs = kwargs + * self.localtypeid = local_type, id_local # <<<<<<<<<<<<<< + * + * # We need to create the thread dict in anticipation of + */ + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 265, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_local_type); + __Pyx_GIVEREF(__pyx_v_local_type); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_local_type); + __Pyx_INCREF(__pyx_v_id_local); + __Pyx_GIVEREF(__pyx_v_id_local); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_id_local); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_self->localtypeid); + __Pyx_DECREF(__pyx_v_self->localtypeid); + __pyx_v_self->localtypeid = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "src/gevent/local.py":270 + * # __init__ being called, to make sure we don't call it + * # again ourselves. MUST do this before setting any attributes. + * greenlet = getcurrent() # pylint:disable=undefined-variable # <<<<<<<<<<<<<< + * _localimpl_create_dict(self, greenlet, id(greenlet)) + * + */ + __pyx_t_1 = ((PyObject *)__pyx_f_6gevent_6_local_getcurrent()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 270, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_greenlet = ((PyGreenlet *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "src/gevent/local.py":271 + * # again ourselves. MUST do this before setting any attributes. + * greenlet = getcurrent() # pylint:disable=undefined-variable + * _localimpl_create_dict(self, greenlet, id(greenlet)) # <<<<<<<<<<<<<< + * + * class _localimpl_dict_entry(object): + */ + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_greenlet)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 271, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __pyx_f_6gevent_6_local__localimpl_create_dict(__pyx_v_self, __pyx_v_greenlet, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 271, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/local.py":259 + * '__weakref__',) + * + * def __init__(self, args, kwargs, local_type, id_local): # <<<<<<<<<<<<<< + * self.key = key_prefix + str(id(self)) + * # { id(greenlet) -> _localimpl_dict_entry(ref(greenlet), greenlet-local dict) } + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent._local._localimpl.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_greenlet); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/local.py":282 + * __slots__ = ('wrgreenlet', 'localdict') + * + * def __init__(self, wrgreenlet, localdict): # <<<<<<<<<<<<<< + * self.wrgreenlet = wrgreenlet + * self.localdict = localdict + */ + +/* Python wrapper */ +static int __pyx_pw_6gevent_6_local_21_localimpl_dict_entry_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6gevent_6_local_21_localimpl_dict_entry_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_wrgreenlet = 0; + PyObject *__pyx_v_localdict = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_wrgreenlet,&__pyx_n_s_localdict,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_wrgreenlet)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_localdict)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(0, 282, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 282, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_wrgreenlet = values[0]; + __pyx_v_localdict = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 282, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent._local._localimpl_dict_entry.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_6_local_21_localimpl_dict_entry___init__(((struct __pyx_obj_6gevent_6_local__localimpl_dict_entry *)__pyx_v_self), __pyx_v_wrgreenlet, __pyx_v_localdict); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_6_local_21_localimpl_dict_entry___init__(struct __pyx_obj_6gevent_6_local__localimpl_dict_entry *__pyx_v_self, PyObject *__pyx_v_wrgreenlet, PyObject *__pyx_v_localdict) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "src/gevent/local.py":283 + * + * def __init__(self, wrgreenlet, localdict): + * self.wrgreenlet = wrgreenlet # <<<<<<<<<<<<<< + * self.localdict = localdict + * + */ + __Pyx_INCREF(__pyx_v_wrgreenlet); + __Pyx_GIVEREF(__pyx_v_wrgreenlet); + __Pyx_GOTREF(__pyx_v_self->wrgreenlet); + __Pyx_DECREF(__pyx_v_self->wrgreenlet); + __pyx_v_self->wrgreenlet = __pyx_v_wrgreenlet; + + /* "src/gevent/local.py":284 + * def __init__(self, wrgreenlet, localdict): + * self.wrgreenlet = wrgreenlet + * self.localdict = localdict # <<<<<<<<<<<<<< + * + * # We use functions instead of methods so that they can be cdef'd in + */ + if (!(likely(PyDict_CheckExact(__pyx_v_localdict))||((__pyx_v_localdict) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_v_localdict)->tp_name), 0))) __PYX_ERR(0, 284, __pyx_L1_error) + __pyx_t_1 = __pyx_v_localdict; + __Pyx_INCREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_self->localdict); + __Pyx_DECREF(__pyx_v_self->localdict); + __pyx_v_self->localdict = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "src/gevent/local.py":282 + * __slots__ = ('wrgreenlet', 'localdict') + * + * def __init__(self, wrgreenlet, localdict): # <<<<<<<<<<<<<< + * self.wrgreenlet = wrgreenlet + * self.localdict = localdict + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent._local._localimpl_dict_entry.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/local.py":294 + * + * + * def _localimpl_create_dict(self, greenlet, id_greenlet): # <<<<<<<<<<<<<< + * """Create a new dict for the current thread, and return it.""" + * localdict = {} + */ + +static PyObject *__pyx_f_6gevent_6_local__localimpl_create_dict(struct __pyx_obj_6gevent_6_local__localimpl *__pyx_v_self, PyGreenlet *__pyx_v_greenlet, PyObject *__pyx_v_id_greenlet) { + PyObject *__pyx_v_localdict = 0; + PyObject *__pyx_v_key = 0; + struct __pyx_obj_6gevent_6_local__greenlet_deleted *__pyx_v_greenlet_deleted = 0; + struct __pyx_obj_6gevent_6_local__local_deleted *__pyx_v_local_deleted = 0; + PyObject *__pyx_v_wrdicts = NULL; + PyObject *__pyx_v_rawlink = NULL; + PyObject *__pyx_v_wrthread = NULL; + PyObject *__pyx_v_wrlocal = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_t_5; + int __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + __Pyx_RefNannySetupContext("_localimpl_create_dict", 0); + + /* "src/gevent/local.py":296 + * def _localimpl_create_dict(self, greenlet, id_greenlet): + * """Create a new dict for the current thread, and return it.""" + * localdict = {} # <<<<<<<<<<<<<< + * key = self.key + * + */ + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 296, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_localdict = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "src/gevent/local.py":297 + * """Create a new dict for the current thread, and return it.""" + * localdict = {} + * key = self.key # <<<<<<<<<<<<<< + * + * wrdicts = ref(self.dicts) + */ + __pyx_t_1 = __pyx_v_self->key; + __Pyx_INCREF(__pyx_t_1); + __pyx_v_key = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "src/gevent/local.py":299 + * key = self.key + * + * wrdicts = ref(self.dicts) # <<<<<<<<<<<<<< + * + * # When the greenlet is deleted, remove the local dict. + */ + __Pyx_INCREF(__pyx_v_6gevent_6_local_ref); + __pyx_t_2 = __pyx_v_6gevent_6_local_ref; __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_self->dicts) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_self->dicts); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 299, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_wrdicts = __pyx_t_1; + __pyx_t_1 = 0; + + /* "src/gevent/local.py":310 + * # issue described above. Use rawlink to avoid spawning any + * # more greenlets. + * greenlet_deleted = _greenlet_deleted(id_greenlet, wrdicts) # <<<<<<<<<<<<<< + * + * rawlink = getattr(greenlet, 'rawlink', None) + */ + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 310, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_id_greenlet); + __Pyx_GIVEREF(__pyx_v_id_greenlet); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_id_greenlet); + __Pyx_INCREF(__pyx_v_wrdicts); + __Pyx_GIVEREF(__pyx_v_wrdicts); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_wrdicts); + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6gevent_6_local__greenlet_deleted), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 310, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_greenlet_deleted = ((struct __pyx_obj_6gevent_6_local__greenlet_deleted *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "src/gevent/local.py":312 + * greenlet_deleted = _greenlet_deleted(id_greenlet, wrdicts) + * + * rawlink = getattr(greenlet, 'rawlink', None) # <<<<<<<<<<<<<< + * if rawlink is not None: + * rawlink(greenlet_deleted) + */ + __pyx_t_2 = __Pyx_GetAttr3(((PyObject *)__pyx_v_greenlet), __pyx_n_s_rawlink, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 312, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_rawlink = __pyx_t_2; + __pyx_t_2 = 0; + + /* "src/gevent/local.py":313 + * + * rawlink = getattr(greenlet, 'rawlink', None) + * if rawlink is not None: # <<<<<<<<<<<<<< + * rawlink(greenlet_deleted) + * wrthread = ref(greenlet) + */ + __pyx_t_4 = (__pyx_v_rawlink != Py_None); + __pyx_t_5 = (__pyx_t_4 != 0); + if (__pyx_t_5) { + + /* "src/gevent/local.py":314 + * rawlink = getattr(greenlet, 'rawlink', None) + * if rawlink is not None: + * rawlink(greenlet_deleted) # <<<<<<<<<<<<<< + * wrthread = ref(greenlet) + * else: + */ + __Pyx_INCREF(__pyx_v_rawlink); + __pyx_t_1 = __pyx_v_rawlink; __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_1, function); + } + } + __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_3, ((PyObject *)__pyx_v_greenlet_deleted)) : __Pyx_PyObject_CallOneArg(__pyx_t_1, ((PyObject *)__pyx_v_greenlet_deleted)); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 314, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/local.py":315 + * if rawlink is not None: + * rawlink(greenlet_deleted) + * wrthread = ref(greenlet) # <<<<<<<<<<<<<< + * else: + * wrthread = ref(greenlet, greenlet_deleted) + */ + __Pyx_INCREF(__pyx_v_6gevent_6_local_ref); + __pyx_t_1 = __pyx_v_6gevent_6_local_ref; __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_1, function); + } + } + __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_3, ((PyObject *)__pyx_v_greenlet)) : __Pyx_PyObject_CallOneArg(__pyx_t_1, ((PyObject *)__pyx_v_greenlet)); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 315, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_wrthread = __pyx_t_2; + __pyx_t_2 = 0; + + /* "src/gevent/local.py":313 + * + * rawlink = getattr(greenlet, 'rawlink', None) + * if rawlink is not None: # <<<<<<<<<<<<<< + * rawlink(greenlet_deleted) + * wrthread = ref(greenlet) + */ + goto __pyx_L3; + } + + /* "src/gevent/local.py":317 + * wrthread = ref(greenlet) + * else: + * wrthread = ref(greenlet, greenlet_deleted) # <<<<<<<<<<<<<< + * + * + */ + /*else*/ { + __Pyx_INCREF(__pyx_v_6gevent_6_local_ref); + __pyx_t_1 = __pyx_v_6gevent_6_local_ref; __pyx_t_3 = NULL; + __pyx_t_6 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_1, function); + __pyx_t_6 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_1)) { + PyObject *__pyx_temp[3] = {__pyx_t_3, ((PyObject *)__pyx_v_greenlet), ((PyObject *)__pyx_v_greenlet_deleted)}; + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 317, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_t_2); + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) { + PyObject *__pyx_temp[3] = {__pyx_t_3, ((PyObject *)__pyx_v_greenlet), ((PyObject *)__pyx_v_greenlet_deleted)}; + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 317, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_t_2); + } else + #endif + { + __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 317, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + if (__pyx_t_3) { + __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3); __pyx_t_3 = NULL; + } + __Pyx_INCREF(((PyObject *)__pyx_v_greenlet)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_greenlet)); + PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, ((PyObject *)__pyx_v_greenlet)); + __Pyx_INCREF(((PyObject *)__pyx_v_greenlet_deleted)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_greenlet_deleted)); + PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, ((PyObject *)__pyx_v_greenlet_deleted)); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 317, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_wrthread = __pyx_t_2; + __pyx_t_2 = 0; + } + __pyx_L3:; + + /* "src/gevent/local.py":321 + * + * # When the localimpl is deleted, remove the thread attribute. + * local_deleted = _local_deleted(key, wrthread, greenlet_deleted) # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 321, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_key); + __Pyx_GIVEREF(__pyx_v_key); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_key); + __Pyx_INCREF(__pyx_v_wrthread); + __Pyx_GIVEREF(__pyx_v_wrthread); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_wrthread); + __Pyx_INCREF(((PyObject *)__pyx_v_greenlet_deleted)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_greenlet_deleted)); + PyTuple_SET_ITEM(__pyx_t_2, 2, ((PyObject *)__pyx_v_greenlet_deleted)); + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6gevent_6_local__local_deleted), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 321, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_local_deleted = ((struct __pyx_obj_6gevent_6_local__local_deleted *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "src/gevent/local.py":324 + * + * + * wrlocal = ref(self, local_deleted) # <<<<<<<<<<<<<< + * greenlet.__dict__[key] = wrlocal + * + */ + __Pyx_INCREF(__pyx_v_6gevent_6_local_ref); + __pyx_t_2 = __pyx_v_6gevent_6_local_ref; __pyx_t_7 = NULL; + __pyx_t_6 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_7)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_7); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_6 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[3] = {__pyx_t_7, ((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_local_deleted)}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 324, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[3] = {__pyx_t_7, ((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_local_deleted)}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 324, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else + #endif + { + __pyx_t_3 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 324, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (__pyx_t_7) { + __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_7); __pyx_t_7 = NULL; + } + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_6, ((PyObject *)__pyx_v_self)); + __Pyx_INCREF(((PyObject *)__pyx_v_local_deleted)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_local_deleted)); + PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_6, ((PyObject *)__pyx_v_local_deleted)); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 324, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_wrlocal = __pyx_t_1; + __pyx_t_1 = 0; + + /* "src/gevent/local.py":325 + * + * wrlocal = ref(self, local_deleted) + * greenlet.__dict__[key] = wrlocal # <<<<<<<<<<<<<< + * + * self.dicts[id_greenlet] = _localimpl_dict_entry(wrthread, localdict) + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_greenlet), __pyx_n_s_dict); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 325, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_key, __pyx_v_wrlocal) < 0)) __PYX_ERR(0, 325, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/local.py":327 + * greenlet.__dict__[key] = wrlocal + * + * self.dicts[id_greenlet] = _localimpl_dict_entry(wrthread, localdict) # <<<<<<<<<<<<<< + * return localdict + * + */ + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 327, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_wrthread); + __Pyx_GIVEREF(__pyx_v_wrthread); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_wrthread); + __Pyx_INCREF(__pyx_v_localdict); + __Pyx_GIVEREF(__pyx_v_localdict); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_localdict); + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6gevent_6_local__localimpl_dict_entry), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 327, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(__pyx_v_self->dicts == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 327, __pyx_L1_error) + } + if (unlikely(PyDict_SetItem(__pyx_v_self->dicts, __pyx_v_id_greenlet, __pyx_t_2) < 0)) __PYX_ERR(0, 327, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/local.py":328 + * + * self.dicts[id_greenlet] = _localimpl_dict_entry(wrthread, localdict) + * return localdict # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_localdict); + __pyx_r = __pyx_v_localdict; + goto __pyx_L0; + + /* "src/gevent/local.py":294 + * + * + * def _localimpl_create_dict(self, greenlet, id_greenlet): # <<<<<<<<<<<<<< + * """Create a new dict for the current thread, and return it.""" + * localdict = {} + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("gevent._local._localimpl_create_dict", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_localdict); + __Pyx_XDECREF(__pyx_v_key); + __Pyx_XDECREF((PyObject *)__pyx_v_greenlet_deleted); + __Pyx_XDECREF((PyObject *)__pyx_v_local_deleted); + __Pyx_XDECREF(__pyx_v_wrdicts); + __Pyx_XDECREF(__pyx_v_rawlink); + __Pyx_XDECREF(__pyx_v_wrthread); + __Pyx_XDECREF(__pyx_v_wrlocal); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/local.py":333 + * _marker = object() + * + * def _local_get_dict(self): # <<<<<<<<<<<<<< + * impl = self._local__impl + * # Cython can optimize dict[], but not dict.get() + */ + +static CYTHON_INLINE PyObject *__pyx_f_6gevent_6_local__local_get_dict(struct __pyx_obj_6gevent_6_local_local *__pyx_v_self) { + struct __pyx_obj_6gevent_6_local__localimpl *__pyx_v_impl = 0; + PyObject *__pyx_v_dct = 0; + struct __pyx_obj_6gevent_6_local__localimpl_dict_entry *__pyx_v_entry = 0; + PyGreenlet *__pyx_v_greenlet = NULL; + PyObject *__pyx_v_idg = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + __Pyx_RefNannySetupContext("_local_get_dict", 0); + + /* "src/gevent/local.py":334 + * + * def _local_get_dict(self): + * impl = self._local__impl # <<<<<<<<<<<<<< + * # Cython can optimize dict[], but not dict.get() + * greenlet = getcurrent() # pylint:disable=undefined-variable + */ + __pyx_t_1 = ((PyObject *)__pyx_v_self->_local__impl); + __Pyx_INCREF(__pyx_t_1); + __pyx_v_impl = ((struct __pyx_obj_6gevent_6_local__localimpl *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "src/gevent/local.py":336 + * impl = self._local__impl + * # Cython can optimize dict[], but not dict.get() + * greenlet = getcurrent() # pylint:disable=undefined-variable # <<<<<<<<<<<<<< + * idg = id(greenlet) + * try: + */ + __pyx_t_1 = ((PyObject *)__pyx_f_6gevent_6_local_getcurrent()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 336, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_greenlet = ((PyGreenlet *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "src/gevent/local.py":337 + * # Cython can optimize dict[], but not dict.get() + * greenlet = getcurrent() # pylint:disable=undefined-variable + * idg = id(greenlet) # <<<<<<<<<<<<<< + * try: + * entry = impl.dicts[idg] + */ + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_greenlet)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 337, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_idg = __pyx_t_1; + __pyx_t_1 = 0; + + /* "src/gevent/local.py":338 + * greenlet = getcurrent() # pylint:disable=undefined-variable + * idg = id(greenlet) + * try: # <<<<<<<<<<<<<< + * entry = impl.dicts[idg] + * dct = entry.localdict + */ + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_4); + /*try:*/ { + + /* "src/gevent/local.py":339 + * idg = id(greenlet) + * try: + * entry = impl.dicts[idg] # <<<<<<<<<<<<<< + * dct = entry.localdict + * except KeyError: + */ + if (unlikely(__pyx_v_impl->dicts == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 339, __pyx_L3_error) + } + __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_impl->dicts, __pyx_v_idg); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 339, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_6gevent_6_local__localimpl_dict_entry))))) __PYX_ERR(0, 339, __pyx_L3_error) + __pyx_v_entry = ((struct __pyx_obj_6gevent_6_local__localimpl_dict_entry *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "src/gevent/local.py":340 + * try: + * entry = impl.dicts[idg] + * dct = entry.localdict # <<<<<<<<<<<<<< + * except KeyError: + * dct = _localimpl_create_dict(impl, greenlet, idg) + */ + __pyx_t_1 = __pyx_v_entry->localdict; + __Pyx_INCREF(__pyx_t_1); + __pyx_v_dct = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "src/gevent/local.py":338 + * greenlet = getcurrent() # pylint:disable=undefined-variable + * idg = id(greenlet) + * try: # <<<<<<<<<<<<<< + * entry = impl.dicts[idg] + * dct = entry.localdict + */ + } + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L8_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/local.py":341 + * entry = impl.dicts[idg] + * dct = entry.localdict + * except KeyError: # <<<<<<<<<<<<<< + * dct = _localimpl_create_dict(impl, greenlet, idg) + * self.__init__(*impl.localargs, **impl.localkwargs) + */ + __pyx_t_5 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError); + if (__pyx_t_5) { + __Pyx_AddTraceback("gevent._local._local_get_dict", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 341, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_7); + + /* "src/gevent/local.py":342 + * dct = entry.localdict + * except KeyError: + * dct = _localimpl_create_dict(impl, greenlet, idg) # <<<<<<<<<<<<<< + * self.__init__(*impl.localargs, **impl.localkwargs) + * return dct + */ + __pyx_t_8 = __pyx_f_6gevent_6_local__localimpl_create_dict(__pyx_v_impl, __pyx_v_greenlet, __pyx_v_idg); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 342, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_XDECREF_SET(__pyx_v_dct, ((PyObject*)__pyx_t_8)); + __pyx_t_8 = 0; + + /* "src/gevent/local.py":343 + * except KeyError: + * dct = _localimpl_create_dict(impl, greenlet, idg) + * self.__init__(*impl.localargs, **impl.localkwargs) # <<<<<<<<<<<<<< + * return dct + * + */ + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_init); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 343, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_8); + if (unlikely(__pyx_v_impl->localargs == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); + __PYX_ERR(0, 343, __pyx_L5_except_error) + } + if (unlikely(__pyx_v_impl->localkwargs == Py_None)) { + PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); + __PYX_ERR(0, 343, __pyx_L5_except_error) + } + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_v_impl->localargs, __pyx_v_impl->localkwargs); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 343, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + + /* "src/gevent/local.py":338 + * greenlet = getcurrent() # pylint:disable=undefined-variable + * idg = id(greenlet) + * try: # <<<<<<<<<<<<<< + * entry = impl.dicts[idg] + * dct = entry.localdict + */ + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4); + goto __pyx_L1_error; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4); + __pyx_L8_try_end:; + } + + /* "src/gevent/local.py":344 + * dct = _localimpl_create_dict(impl, greenlet, idg) + * self.__init__(*impl.localargs, **impl.localkwargs) + * return dct # <<<<<<<<<<<<<< + * + * def _init(): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_dct); + __pyx_r = __pyx_v_dct; + goto __pyx_L0; + + /* "src/gevent/local.py":333 + * _marker = object() + * + * def _local_get_dict(self): # <<<<<<<<<<<<<< + * impl = self._local__impl + * # Cython can optimize dict[], but not dict.get() + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_AddTraceback("gevent._local._local_get_dict", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_impl); + __Pyx_XDECREF(__pyx_v_dct); + __Pyx_XDECREF((PyObject *)__pyx_v_entry); + __Pyx_XDECREF((PyObject *)__pyx_v_greenlet); + __Pyx_XDECREF(__pyx_v_idg); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/local.py":346 + * return dct + * + * def _init(): # <<<<<<<<<<<<<< + * greenlet_init() # pylint:disable=undefined-variable + * + */ + +static void __pyx_f_6gevent_6_local__init(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_init", 0); + + /* "src/gevent/local.py":347 + * + * def _init(): + * greenlet_init() # pylint:disable=undefined-variable # <<<<<<<<<<<<<< + * + * _local_attrs = { + */ + __pyx_f_6gevent_6_local_greenlet_init(); + + /* "src/gevent/local.py":346 + * return dct + * + * def _init(): # <<<<<<<<<<<<<< + * greenlet_init() # pylint:disable=undefined-variable + * + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "src/gevent/local.py":367 + * __slots__ = tuple(_local_attrs - {'__class__', '__cinit__'}) + * + * def __cinit__(self, *args, **kw): # <<<<<<<<<<<<<< + * if args or kw: + * if type(self).__init__ == object.__init__: + */ + +/* Python wrapper */ +static int __pyx_pw_6gevent_6_local_5local_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6gevent_6_local_5local_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_args = 0; + PyObject *__pyx_v_kw = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); + if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 1))) return -1; + __pyx_v_kw = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New(); if (unlikely(!__pyx_v_kw)) return -1; + __Pyx_GOTREF(__pyx_v_kw); + __Pyx_INCREF(__pyx_args); + __pyx_v_args = __pyx_args; + __pyx_r = __pyx_pf_6gevent_6_local_5local___cinit__(((struct __pyx_obj_6gevent_6_local_local *)__pyx_v_self), __pyx_v_args, __pyx_v_kw); + + /* function exit code */ + __Pyx_XDECREF(__pyx_v_args); + __Pyx_XDECREF(__pyx_v_kw); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_6_local_5local___cinit__(struct __pyx_obj_6gevent_6_local_local *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kw) { + struct __pyx_obj_6gevent_6_local__localimpl *__pyx_v_impl = NULL; + PyObject *__pyx_v_get = NULL; + PyObject *__pyx_v_dels = NULL; + PyObject *__pyx_v_sets_or_dels = NULL; + PyObject *__pyx_v_sets = NULL; + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + __Pyx_RefNannySetupContext("__cinit__", 0); + + /* "src/gevent/local.py":368 + * + * def __cinit__(self, *args, **kw): + * if args or kw: # <<<<<<<<<<<<<< + * if type(self).__init__ == object.__init__: + * raise TypeError("Initialization arguments are not supported", args, kw) + */ + __pyx_t_2 = (PyTuple_GET_SIZE(__pyx_v_args) != 0); + if (!__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_kw); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 368, __pyx_L1_error) + __pyx_t_1 = __pyx_t_2; + __pyx_L4_bool_binop_done:; + if (__pyx_t_1) { + + /* "src/gevent/local.py":369 + * def __cinit__(self, *args, **kw): + * if args or kw: + * if type(self).__init__ == object.__init__: # <<<<<<<<<<<<<< + * raise TypeError("Initialization arguments are not supported", args, kw) + * impl = _localimpl(args, kw, type(self), id(self)) + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))), __pyx_n_s_init); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 369, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_builtin_object, __pyx_n_s_init); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 369, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 369, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 369, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(__pyx_t_1)) { + + /* "src/gevent/local.py":370 + * if args or kw: + * if type(self).__init__ == object.__init__: + * raise TypeError("Initialization arguments are not supported", args, kw) # <<<<<<<<<<<<<< + * impl = _localimpl(args, kw, type(self), id(self)) + * # pylint:disable=attribute-defined-outside-init + */ + __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 370, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_kp_s_Initialization_arguments_are_not); + __Pyx_GIVEREF(__pyx_kp_s_Initialization_arguments_are_not); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_kp_s_Initialization_arguments_are_not); + __Pyx_INCREF(__pyx_v_args); + __Pyx_GIVEREF(__pyx_v_args); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_args); + __Pyx_INCREF(__pyx_v_kw); + __Pyx_GIVEREF(__pyx_v_kw); + PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_kw); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 370, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __PYX_ERR(0, 370, __pyx_L1_error) + + /* "src/gevent/local.py":369 + * def __cinit__(self, *args, **kw): + * if args or kw: + * if type(self).__init__ == object.__init__: # <<<<<<<<<<<<<< + * raise TypeError("Initialization arguments are not supported", args, kw) + * impl = _localimpl(args, kw, type(self), id(self)) + */ + } + + /* "src/gevent/local.py":368 + * + * def __cinit__(self, *args, **kw): + * if args or kw: # <<<<<<<<<<<<<< + * if type(self).__init__ == object.__init__: + * raise TypeError("Initialization arguments are not supported", args, kw) + */ + } + + /* "src/gevent/local.py":371 + * if type(self).__init__ == object.__init__: + * raise TypeError("Initialization arguments are not supported", args, kw) + * impl = _localimpl(args, kw, type(self), id(self)) # <<<<<<<<<<<<<< + * # pylint:disable=attribute-defined-outside-init + * self._local__impl = impl + */ + __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 371, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 371, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(__pyx_v_args); + __Pyx_GIVEREF(__pyx_v_args); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_args); + __Pyx_INCREF(__pyx_v_kw); + __Pyx_GIVEREF(__pyx_v_kw); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_kw); + __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + PyTuple_SET_ITEM(__pyx_t_5, 2, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6gevent_6_local__localimpl), __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 371, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_impl = ((struct __pyx_obj_6gevent_6_local__localimpl *)__pyx_t_4); + __pyx_t_4 = 0; + + /* "src/gevent/local.py":373 + * impl = _localimpl(args, kw, type(self), id(self)) + * # pylint:disable=attribute-defined-outside-init + * self._local__impl = impl # <<<<<<<<<<<<<< + * get, dels, sets_or_dels, sets = _local_find_descriptors(self) + * self._local_type_get_descriptors = get + */ + __Pyx_INCREF(((PyObject *)__pyx_v_impl)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_impl)); + __Pyx_GOTREF(__pyx_v_self->_local__impl); + __Pyx_DECREF(((PyObject *)__pyx_v_self->_local__impl)); + __pyx_v_self->_local__impl = __pyx_v_impl; + + /* "src/gevent/local.py":374 + * # pylint:disable=attribute-defined-outside-init + * self._local__impl = impl + * get, dels, sets_or_dels, sets = _local_find_descriptors(self) # <<<<<<<<<<<<<< + * self._local_type_get_descriptors = get + * self._local_type_set_or_del_descriptors = sets_or_dels + */ + __pyx_t_4 = __pyx_f_6gevent_6_local__local_find_descriptors(__pyx_v_self); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 374, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (likely(__pyx_t_4 != Py_None)) { + PyObject* sequence = __pyx_t_4; + Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); + if (unlikely(size != 4)) { + if (size > 4) __Pyx_RaiseTooManyValuesError(4); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + __PYX_ERR(0, 374, __pyx_L1_error) + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); + __pyx_t_6 = PyTuple_GET_ITEM(sequence, 2); + __pyx_t_7 = PyTuple_GET_ITEM(sequence, 3); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(__pyx_t_7); + #else + { + Py_ssize_t i; + PyObject** temps[4] = {&__pyx_t_5,&__pyx_t_3,&__pyx_t_6,&__pyx_t_7}; + for (i=0; i < 4; i++) { + PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(0, 374, __pyx_L1_error) + __Pyx_GOTREF(item); + *(temps[i]) = item; + } + } + #endif + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } else { + __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(0, 374, __pyx_L1_error) + } + __pyx_v_get = __pyx_t_5; + __pyx_t_5 = 0; + __pyx_v_dels = __pyx_t_3; + __pyx_t_3 = 0; + __pyx_v_sets_or_dels = __pyx_t_6; + __pyx_t_6 = 0; + __pyx_v_sets = __pyx_t_7; + __pyx_t_7 = 0; + + /* "src/gevent/local.py":375 + * self._local__impl = impl + * get, dels, sets_or_dels, sets = _local_find_descriptors(self) + * self._local_type_get_descriptors = get # <<<<<<<<<<<<<< + * self._local_type_set_or_del_descriptors = sets_or_dels + * self._local_type_del_descriptors = dels + */ + if (!(likely(PySet_CheckExact(__pyx_v_get))||((__pyx_v_get) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "set", Py_TYPE(__pyx_v_get)->tp_name), 0))) __PYX_ERR(0, 375, __pyx_L1_error) + __pyx_t_4 = __pyx_v_get; + __Pyx_INCREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_v_self->_local_type_get_descriptors); + __Pyx_DECREF(__pyx_v_self->_local_type_get_descriptors); + __pyx_v_self->_local_type_get_descriptors = ((PyObject*)__pyx_t_4); + __pyx_t_4 = 0; + + /* "src/gevent/local.py":376 + * get, dels, sets_or_dels, sets = _local_find_descriptors(self) + * self._local_type_get_descriptors = get + * self._local_type_set_or_del_descriptors = sets_or_dels # <<<<<<<<<<<<<< + * self._local_type_del_descriptors = dels + * self._local_type_set_descriptors = sets + */ + if (!(likely(PySet_CheckExact(__pyx_v_sets_or_dels))||((__pyx_v_sets_or_dels) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "set", Py_TYPE(__pyx_v_sets_or_dels)->tp_name), 0))) __PYX_ERR(0, 376, __pyx_L1_error) + __pyx_t_4 = __pyx_v_sets_or_dels; + __Pyx_INCREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_v_self->_local_type_set_or_del_descriptors); + __Pyx_DECREF(__pyx_v_self->_local_type_set_or_del_descriptors); + __pyx_v_self->_local_type_set_or_del_descriptors = ((PyObject*)__pyx_t_4); + __pyx_t_4 = 0; + + /* "src/gevent/local.py":377 + * self._local_type_get_descriptors = get + * self._local_type_set_or_del_descriptors = sets_or_dels + * self._local_type_del_descriptors = dels # <<<<<<<<<<<<<< + * self._local_type_set_descriptors = sets + * self._local_type = type(self) + */ + if (!(likely(PySet_CheckExact(__pyx_v_dels))||((__pyx_v_dels) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "set", Py_TYPE(__pyx_v_dels)->tp_name), 0))) __PYX_ERR(0, 377, __pyx_L1_error) + __pyx_t_4 = __pyx_v_dels; + __Pyx_INCREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_v_self->_local_type_del_descriptors); + __Pyx_DECREF(__pyx_v_self->_local_type_del_descriptors); + __pyx_v_self->_local_type_del_descriptors = ((PyObject*)__pyx_t_4); + __pyx_t_4 = 0; + + /* "src/gevent/local.py":378 + * self._local_type_set_or_del_descriptors = sets_or_dels + * self._local_type_del_descriptors = dels + * self._local_type_set_descriptors = sets # <<<<<<<<<<<<<< + * self._local_type = type(self) + * self._local_type_vars = set(dir(self._local_type)) + */ + if (!(likely(PySet_CheckExact(__pyx_v_sets))||((__pyx_v_sets) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "set", Py_TYPE(__pyx_v_sets)->tp_name), 0))) __PYX_ERR(0, 378, __pyx_L1_error) + __pyx_t_4 = __pyx_v_sets; + __Pyx_INCREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_v_self->_local_type_set_descriptors); + __Pyx_DECREF(__pyx_v_self->_local_type_set_descriptors); + __pyx_v_self->_local_type_set_descriptors = ((PyObject*)__pyx_t_4); + __pyx_t_4 = 0; + + /* "src/gevent/local.py":379 + * self._local_type_del_descriptors = dels + * self._local_type_set_descriptors = sets + * self._local_type = type(self) # <<<<<<<<<<<<<< + * self._local_type_vars = set(dir(self._local_type)) + * + */ + __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __Pyx_GOTREF(__pyx_v_self->_local_type); + __Pyx_DECREF(((PyObject *)__pyx_v_self->_local_type)); + __pyx_v_self->_local_type = ((PyTypeObject*)((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + + /* "src/gevent/local.py":380 + * self._local_type_set_descriptors = sets + * self._local_type = type(self) + * self._local_type_vars = set(dir(self._local_type)) # <<<<<<<<<<<<<< + * + * def __getattribute__(self, name): # pylint:disable=too-many-return-statements + */ + __pyx_t_4 = ((PyObject *)__pyx_v_self->_local_type); + __Pyx_INCREF(__pyx_t_4); + __pyx_t_7 = PyObject_Dir(__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 380, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PySet_New(__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 380, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_GIVEREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_v_self->_local_type_vars); + __Pyx_DECREF(__pyx_v_self->_local_type_vars); + __pyx_v_self->_local_type_vars = ((PyObject*)__pyx_t_4); + __pyx_t_4 = 0; + + /* "src/gevent/local.py":367 + * __slots__ = tuple(_local_attrs - {'__class__', '__cinit__'}) + * + * def __cinit__(self, *args, **kw): # <<<<<<<<<<<<<< + * if args or kw: + * if type(self).__init__ == object.__init__: + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("gevent._local.local.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_impl); + __Pyx_XDECREF(__pyx_v_get); + __Pyx_XDECREF(__pyx_v_dels); + __Pyx_XDECREF(__pyx_v_sets_or_dels); + __Pyx_XDECREF(__pyx_v_sets); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/local.py":382 + * self._local_type_vars = set(dir(self._local_type)) + * + * def __getattribute__(self, name): # pylint:disable=too-many-return-statements # <<<<<<<<<<<<<< + * if name in _local_attrs: + * # The _local__impl, __cinit__, etc, won't be hit by the + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_local_5local_3__getattribute__(PyObject *__pyx_v_self, PyObject *__pyx_v_name); /*proto*/ +static PyObject *__pyx_pw_6gevent_6_local_5local_3__getattribute__(PyObject *__pyx_v_self, PyObject *__pyx_v_name) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__getattribute__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6_local_5local_2__getattribute__(((struct __pyx_obj_6gevent_6_local_local *)__pyx_v_self), ((PyObject *)__pyx_v_name)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_local_5local_2__getattribute__(struct __pyx_obj_6gevent_6_local_local *__pyx_v_self, PyObject *__pyx_v_name) { + PyObject *__pyx_v_dct = NULL; + PyObject *__pyx_v_type_attr = NULL; + PyObject *__pyx_v_base = NULL; + PyObject *__pyx_v_bd = NULL; + PyObject *__pyx_v_attr_on_type = NULL; + PyObject *__pyx_v_result = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + Py_ssize_t __pyx_t_9; + PyObject *(*__pyx_t_10)(PyObject *); + __Pyx_RefNannySetupContext("__getattribute__", 0); + + /* "src/gevent/local.py":383 + * + * def __getattribute__(self, name): # pylint:disable=too-many-return-statements + * if name in _local_attrs: # <<<<<<<<<<<<<< + * # The _local__impl, __cinit__, etc, won't be hit by the + * # Cython version, if we've done things right. If we haven't, + */ + if (unlikely(__pyx_v_6gevent_6_local__local_attrs == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); + __PYX_ERR(0, 383, __pyx_L1_error) + } + __pyx_t_1 = (__Pyx_PySet_ContainsTF(__pyx_v_name, __pyx_v_6gevent_6_local__local_attrs, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 383, __pyx_L1_error) + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "src/gevent/local.py":387 + * # Cython version, if we've done things right. If we haven't, + * # they will be, and this will produce an error. + * return object.__getattribute__(self, name) # <<<<<<<<<<<<<< + * + * dct = _local_get_dict(self) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_builtin_object, __pyx_n_s_getattribute); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 387, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = NULL; + __pyx_t_6 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + __pyx_t_6 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_4)) { + PyObject *__pyx_temp[3] = {__pyx_t_5, ((PyObject *)__pyx_v_self), __pyx_v_name}; + __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 387, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_t_3); + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { + PyObject *__pyx_temp[3] = {__pyx_t_5, ((PyObject *)__pyx_v_self), __pyx_v_name}; + __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 387, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_t_3); + } else + #endif + { + __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 387, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + if (__pyx_t_5) { + __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL; + } + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, ((PyObject *)__pyx_v_self)); + __Pyx_INCREF(__pyx_v_name); + __Pyx_GIVEREF(__pyx_v_name); + PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_name); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 387, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "src/gevent/local.py":383 + * + * def __getattribute__(self, name): # pylint:disable=too-many-return-statements + * if name in _local_attrs: # <<<<<<<<<<<<<< + * # The _local__impl, __cinit__, etc, won't be hit by the + * # Cython version, if we've done things right. If we haven't, + */ + } + + /* "src/gevent/local.py":389 + * return object.__getattribute__(self, name) + * + * dct = _local_get_dict(self) # <<<<<<<<<<<<<< + * + * if name == '__dict__': + */ + __pyx_t_3 = __pyx_f_6gevent_6_local__local_get_dict(__pyx_v_self); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 389, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_v_dct = ((PyObject*)__pyx_t_3); + __pyx_t_3 = 0; + + /* "src/gevent/local.py":391 + * dct = _local_get_dict(self) + * + * if name == '__dict__': # <<<<<<<<<<<<<< + * return dct + * # If there's no possible way we can switch, because this + */ + __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_name, __pyx_n_s_dict, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 391, __pyx_L1_error) + if (__pyx_t_2) { + + /* "src/gevent/local.py":392 + * + * if name == '__dict__': + * return dct # <<<<<<<<<<<<<< + * # If there's no possible way we can switch, because this + * # attribute is *not* found in the class where it might be a + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_dct); + __pyx_r = __pyx_v_dct; + goto __pyx_L0; + + /* "src/gevent/local.py":391 + * dct = _local_get_dict(self) + * + * if name == '__dict__': # <<<<<<<<<<<<<< + * return dct + * # If there's no possible way we can switch, because this + */ + } + + /* "src/gevent/local.py":407 + * # there can be no descriptors except for methods, which will + * # never need to use __dict__. + * if self._local_type is local: # <<<<<<<<<<<<<< + * return dct[name] if name in dct else object.__getattribute__(self, name) + * + */ + __pyx_t_2 = (__pyx_v_self->_local_type == __pyx_ptype_6gevent_6_local_local); + __pyx_t_1 = (__pyx_t_2 != 0); + if (__pyx_t_1) { + + /* "src/gevent/local.py":408 + * # never need to use __dict__. + * if self._local_type is local: + * return dct[name] if name in dct else object.__getattribute__(self, name) # <<<<<<<<<<<<<< + * + * # NOTE: If this is a descriptor, this will invoke its __get__. + */ + __Pyx_XDECREF(__pyx_r); + if (unlikely(__pyx_v_dct == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); + __PYX_ERR(0, 408, __pyx_L1_error) + } + __pyx_t_1 = (__Pyx_PyDict_ContainsTF(__pyx_v_name, __pyx_v_dct, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 408, __pyx_L1_error) + if ((__pyx_t_1 != 0)) { + if (unlikely(__pyx_v_dct == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 408, __pyx_L1_error) + } + __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_dct, __pyx_v_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 408, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __pyx_t_4; + __pyx_t_4 = 0; + } else { + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_builtin_object, __pyx_n_s_getattribute); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 408, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_5 = NULL; + __pyx_t_6 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_7, function); + __pyx_t_6 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_7)) { + PyObject *__pyx_temp[3] = {__pyx_t_5, ((PyObject *)__pyx_v_self), __pyx_v_name}; + __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 408, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_t_4); + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) { + PyObject *__pyx_temp[3] = {__pyx_t_5, ((PyObject *)__pyx_v_self), __pyx_v_name}; + __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 408, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_t_4); + } else + #endif + { + __pyx_t_8 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 408, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + if (__pyx_t_5) { + __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL; + } + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_6, ((PyObject *)__pyx_v_self)); + __Pyx_INCREF(__pyx_v_name); + __Pyx_GIVEREF(__pyx_v_name); + PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_6, __pyx_v_name); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 408, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + } + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_3 = __pyx_t_4; + __pyx_t_4 = 0; + } + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "src/gevent/local.py":407 + * # there can be no descriptors except for methods, which will + * # never need to use __dict__. + * if self._local_type is local: # <<<<<<<<<<<<<< + * return dct[name] if name in dct else object.__getattribute__(self, name) + * + */ + } + + /* "src/gevent/local.py":415 + * # But this is faster than a loop over mro() checking each class __dict__ + * # manually. + * if name in dct: # <<<<<<<<<<<<<< + * if name not in self._local_type_vars: + * # If there is a dict value, and nothing in the type, + */ + if (unlikely(__pyx_v_dct == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); + __PYX_ERR(0, 415, __pyx_L1_error) + } + __pyx_t_1 = (__Pyx_PyDict_ContainsTF(__pyx_v_name, __pyx_v_dct, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 415, __pyx_L1_error) + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "src/gevent/local.py":416 + * # manually. + * if name in dct: + * if name not in self._local_type_vars: # <<<<<<<<<<<<<< + * # If there is a dict value, and nothing in the type, + * # it can't possibly be a descriptor, so it is just returned. + */ + if (unlikely(__pyx_v_self->_local_type_vars == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); + __PYX_ERR(0, 416, __pyx_L1_error) + } + __pyx_t_2 = (__Pyx_PySet_ContainsTF(__pyx_v_name, __pyx_v_self->_local_type_vars, Py_NE)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 416, __pyx_L1_error) + __pyx_t_1 = (__pyx_t_2 != 0); + if (__pyx_t_1) { + + /* "src/gevent/local.py":419 + * # If there is a dict value, and nothing in the type, + * # it can't possibly be a descriptor, so it is just returned. + * return dct[name] # <<<<<<<<<<<<<< + * + * # It's in the type *and* in the dict. If the type value is + */ + __Pyx_XDECREF(__pyx_r); + if (unlikely(__pyx_v_dct == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 419, __pyx_L1_error) + } + __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_dct, __pyx_v_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 419, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "src/gevent/local.py":416 + * # manually. + * if name in dct: + * if name not in self._local_type_vars: # <<<<<<<<<<<<<< + * # If there is a dict value, and nothing in the type, + * # it can't possibly be a descriptor, so it is just returned. + */ + } + + /* "src/gevent/local.py":428 + * # NOTE that the docs for descriptors say that these methods must be + * # defined on the *class* of the object in the type. + * if name not in self._local_type_get_descriptors: # <<<<<<<<<<<<<< + * # Entirely not a descriptor. Instance wins. + * return dct[name] + */ + if (unlikely(__pyx_v_self->_local_type_get_descriptors == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); + __PYX_ERR(0, 428, __pyx_L1_error) + } + __pyx_t_1 = (__Pyx_PySet_ContainsTF(__pyx_v_name, __pyx_v_self->_local_type_get_descriptors, Py_NE)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 428, __pyx_L1_error) + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "src/gevent/local.py":430 + * if name not in self._local_type_get_descriptors: + * # Entirely not a descriptor. Instance wins. + * return dct[name] # <<<<<<<<<<<<<< + * if name in self._local_type_set_or_del_descriptors: + * # A data descriptor. + */ + __Pyx_XDECREF(__pyx_r); + if (unlikely(__pyx_v_dct == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 430, __pyx_L1_error) + } + __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_dct, __pyx_v_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 430, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "src/gevent/local.py":428 + * # NOTE that the docs for descriptors say that these methods must be + * # defined on the *class* of the object in the type. + * if name not in self._local_type_get_descriptors: # <<<<<<<<<<<<<< + * # Entirely not a descriptor. Instance wins. + * return dct[name] + */ + } + + /* "src/gevent/local.py":431 + * # Entirely not a descriptor. Instance wins. + * return dct[name] + * if name in self._local_type_set_or_del_descriptors: # <<<<<<<<<<<<<< + * # A data descriptor. + * # arbitrary code execution while these run. If they touch self again, + */ + if (unlikely(__pyx_v_self->_local_type_set_or_del_descriptors == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); + __PYX_ERR(0, 431, __pyx_L1_error) + } + __pyx_t_2 = (__Pyx_PySet_ContainsTF(__pyx_v_name, __pyx_v_self->_local_type_set_or_del_descriptors, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 431, __pyx_L1_error) + __pyx_t_1 = (__pyx_t_2 != 0); + if (__pyx_t_1) { + + /* "src/gevent/local.py":435 + * # arbitrary code execution while these run. If they touch self again, + * # they'll call back into us and we'll repeat the dance. + * type_attr = getattr(self._local_type, name) # <<<<<<<<<<<<<< + * return type(type_attr).__get__(type_attr, self, self._local_type) + * # Last case is a non-data descriptor. Instance wins. + */ + __pyx_t_3 = ((PyObject *)__pyx_v_self->_local_type); + __Pyx_INCREF(__pyx_t_3); + __pyx_t_4 = __Pyx_GetAttr(__pyx_t_3, __pyx_v_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 435, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_type_attr = __pyx_t_4; + __pyx_t_4 = 0; + + /* "src/gevent/local.py":436 + * # they'll call back into us and we'll repeat the dance. + * type_attr = getattr(self._local_type, name) + * return type(type_attr).__get__(type_attr, self, self._local_type) # <<<<<<<<<<<<<< + * # Last case is a non-data descriptor. Instance wins. + * return dct[name] + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)Py_TYPE(__pyx_v_type_attr)), __pyx_n_s_get); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 436, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_7 = NULL; + __pyx_t_6 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_7)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_7); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_6 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_3)) { + PyObject *__pyx_temp[4] = {__pyx_t_7, __pyx_v_type_attr, ((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_self->_local_type)}; + __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 436, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_GOTREF(__pyx_t_4); + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { + PyObject *__pyx_temp[4] = {__pyx_t_7, __pyx_v_type_attr, ((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_self->_local_type)}; + __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 436, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_GOTREF(__pyx_t_4); + } else + #endif + { + __pyx_t_8 = PyTuple_New(3+__pyx_t_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 436, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + if (__pyx_t_7) { + __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7); __pyx_t_7 = NULL; + } + __Pyx_INCREF(__pyx_v_type_attr); + __Pyx_GIVEREF(__pyx_v_type_attr); + PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_6, __pyx_v_type_attr); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_6, ((PyObject *)__pyx_v_self)); + __Pyx_INCREF(((PyObject *)__pyx_v_self->_local_type)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self->_local_type)); + PyTuple_SET_ITEM(__pyx_t_8, 2+__pyx_t_6, ((PyObject *)__pyx_v_self->_local_type)); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 436, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + + /* "src/gevent/local.py":431 + * # Entirely not a descriptor. Instance wins. + * return dct[name] + * if name in self._local_type_set_or_del_descriptors: # <<<<<<<<<<<<<< + * # A data descriptor. + * # arbitrary code execution while these run. If they touch self again, + */ + } + + /* "src/gevent/local.py":438 + * return type(type_attr).__get__(type_attr, self, self._local_type) + * # Last case is a non-data descriptor. Instance wins. + * return dct[name] # <<<<<<<<<<<<<< + * + * if name in self._local_type_vars: + */ + __Pyx_XDECREF(__pyx_r); + if (unlikely(__pyx_v_dct == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 438, __pyx_L1_error) + } + __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_dct, __pyx_v_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 438, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + + /* "src/gevent/local.py":415 + * # But this is faster than a loop over mro() checking each class __dict__ + * # manually. + * if name in dct: # <<<<<<<<<<<<<< + * if name not in self._local_type_vars: + * # If there is a dict value, and nothing in the type, + */ + } + + /* "src/gevent/local.py":440 + * return dct[name] + * + * if name in self._local_type_vars: # <<<<<<<<<<<<<< + * # Not in the dictionary, but is found in the type. It could be + * # a non-data descriptor still. Some descriptors, like @staticmethod, + */ + if (unlikely(__pyx_v_self->_local_type_vars == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); + __PYX_ERR(0, 440, __pyx_L1_error) + } + __pyx_t_1 = (__Pyx_PySet_ContainsTF(__pyx_v_name, __pyx_v_self->_local_type_vars, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 440, __pyx_L1_error) + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "src/gevent/local.py":447 + * # So we can't rely on getattr() on the type for them, we have to + * # look through the MRO dicts ourself. + * if name not in self._local_type_get_descriptors: # <<<<<<<<<<<<<< + * # Not a descriptor, can't execute code. So all we need is + * # the return value of getattr() on our type. + */ + if (unlikely(__pyx_v_self->_local_type_get_descriptors == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); + __PYX_ERR(0, 447, __pyx_L1_error) + } + __pyx_t_2 = (__Pyx_PySet_ContainsTF(__pyx_v_name, __pyx_v_self->_local_type_get_descriptors, Py_NE)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 447, __pyx_L1_error) + __pyx_t_1 = (__pyx_t_2 != 0); + if (__pyx_t_1) { + + /* "src/gevent/local.py":450 + * # Not a descriptor, can't execute code. So all we need is + * # the return value of getattr() on our type. + * return getattr(self._local_type, name) # <<<<<<<<<<<<<< + * + * for base in self._local_type.mro(): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = ((PyObject *)__pyx_v_self->_local_type); + __Pyx_INCREF(__pyx_t_4); + __pyx_t_3 = __Pyx_GetAttr(__pyx_t_4, __pyx_v_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 450, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "src/gevent/local.py":447 + * # So we can't rely on getattr() on the type for them, we have to + * # look through the MRO dicts ourself. + * if name not in self._local_type_get_descriptors: # <<<<<<<<<<<<<< + * # Not a descriptor, can't execute code. So all we need is + * # the return value of getattr() on our type. + */ + } + + /* "src/gevent/local.py":452 + * return getattr(self._local_type, name) + * + * for base in self._local_type.mro(): # <<<<<<<<<<<<<< + * bd = base.__dict__ + * if name in bd: + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->_local_type), __pyx_n_s_mro); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 452, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_8 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_8)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_8); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + } + } + __pyx_t_3 = (__pyx_t_8) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_8) : __Pyx_PyObject_CallNoArg(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 452, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) { + __pyx_t_4 = __pyx_t_3; __Pyx_INCREF(__pyx_t_4); __pyx_t_9 = 0; + __pyx_t_10 = NULL; + } else { + __pyx_t_9 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 452, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_10 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 452, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + for (;;) { + if (likely(!__pyx_t_10)) { + if (likely(PyList_CheckExact(__pyx_t_4))) { + if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_3 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_9); __Pyx_INCREF(__pyx_t_3); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 452, __pyx_L1_error) + #else + __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 452, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + #endif + } else { + if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_9); __Pyx_INCREF(__pyx_t_3); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 452, __pyx_L1_error) + #else + __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 452, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + #endif + } + } else { + __pyx_t_3 = __pyx_t_10(__pyx_t_4); + if (unlikely(!__pyx_t_3)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(0, 452, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_3); + } + __Pyx_XDECREF_SET(__pyx_v_base, __pyx_t_3); + __pyx_t_3 = 0; + + /* "src/gevent/local.py":453 + * + * for base in self._local_type.mro(): + * bd = base.__dict__ # <<<<<<<<<<<<<< + * if name in bd: + * attr_on_type = bd[name] + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_dict); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 453, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_XDECREF_SET(__pyx_v_bd, __pyx_t_3); + __pyx_t_3 = 0; + + /* "src/gevent/local.py":454 + * for base in self._local_type.mro(): + * bd = base.__dict__ + * if name in bd: # <<<<<<<<<<<<<< + * attr_on_type = bd[name] + * result = type(attr_on_type).__get__(attr_on_type, self, self._local_type) + */ + __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_v_name, __pyx_v_bd, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 454, __pyx_L1_error) + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "src/gevent/local.py":455 + * bd = base.__dict__ + * if name in bd: + * attr_on_type = bd[name] # <<<<<<<<<<<<<< + * result = type(attr_on_type).__get__(attr_on_type, self, self._local_type) + * return result + */ + __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_bd, __pyx_v_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 455, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_v_attr_on_type = __pyx_t_3; + __pyx_t_3 = 0; + + /* "src/gevent/local.py":456 + * if name in bd: + * attr_on_type = bd[name] + * result = type(attr_on_type).__get__(attr_on_type, self, self._local_type) # <<<<<<<<<<<<<< + * return result + * + */ + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)Py_TYPE(__pyx_v_attr_on_type)), __pyx_n_s_get); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 456, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_7 = NULL; + __pyx_t_6 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) { + __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_8); + if (likely(__pyx_t_7)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); + __Pyx_INCREF(__pyx_t_7); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_8, function); + __pyx_t_6 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_8)) { + PyObject *__pyx_temp[4] = {__pyx_t_7, __pyx_v_attr_on_type, ((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_self->_local_type)}; + __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 456, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_GOTREF(__pyx_t_3); + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_8)) { + PyObject *__pyx_temp[4] = {__pyx_t_7, __pyx_v_attr_on_type, ((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_self->_local_type)}; + __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 456, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_GOTREF(__pyx_t_3); + } else + #endif + { + __pyx_t_5 = PyTuple_New(3+__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 456, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (__pyx_t_7) { + __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7); __pyx_t_7 = NULL; + } + __Pyx_INCREF(__pyx_v_attr_on_type); + __Pyx_GIVEREF(__pyx_v_attr_on_type); + PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_6, __pyx_v_attr_on_type); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_6, ((PyObject *)__pyx_v_self)); + __Pyx_INCREF(((PyObject *)__pyx_v_self->_local_type)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self->_local_type)); + PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_6, ((PyObject *)__pyx_v_self->_local_type)); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 456, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_v_result = __pyx_t_3; + __pyx_t_3 = 0; + + /* "src/gevent/local.py":457 + * attr_on_type = bd[name] + * result = type(attr_on_type).__get__(attr_on_type, self, self._local_type) + * return result # <<<<<<<<<<<<<< + * + * # It wasn't in the dict and it wasn't in the type. + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L0; + + /* "src/gevent/local.py":454 + * for base in self._local_type.mro(): + * bd = base.__dict__ + * if name in bd: # <<<<<<<<<<<<<< + * attr_on_type = bd[name] + * result = type(attr_on_type).__get__(attr_on_type, self, self._local_type) + */ + } + + /* "src/gevent/local.py":452 + * return getattr(self._local_type, name) + * + * for base in self._local_type.mro(): # <<<<<<<<<<<<<< + * bd = base.__dict__ + * if name in bd: + */ + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "src/gevent/local.py":440 + * return dct[name] + * + * if name in self._local_type_vars: # <<<<<<<<<<<<<< + * # Not in the dictionary, but is found in the type. It could be + * # a non-data descriptor still. Some descriptors, like @staticmethod, + */ + } + + /* "src/gevent/local.py":463 + * # exists, otherwise raise an AttributeError. + * # we will invoke type(self).__getattr__ or raise an attribute error. + * if hasattr(self._local_type, '__getattr__'): # <<<<<<<<<<<<<< + * return self._local_type.__getattr__(self, name) + * raise AttributeError("%r object has no attribute '%s'" + */ + __pyx_t_4 = ((PyObject *)__pyx_v_self->_local_type); + __Pyx_INCREF(__pyx_t_4); + __pyx_t_2 = __Pyx_HasAttr(__pyx_t_4, __pyx_n_s_getattr); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 463, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_1 = (__pyx_t_2 != 0); + if (__pyx_t_1) { + + /* "src/gevent/local.py":464 + * # we will invoke type(self).__getattr__ or raise an attribute error. + * if hasattr(self._local_type, '__getattr__'): + * return self._local_type.__getattr__(self, name) # <<<<<<<<<<<<<< + * raise AttributeError("%r object has no attribute '%s'" + * % (self._local_type.__name__, name)) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->_local_type), __pyx_n_s_getattr); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 464, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_8 = NULL; + __pyx_t_6 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_8)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_8); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_6 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_3)) { + PyObject *__pyx_temp[3] = {__pyx_t_8, ((PyObject *)__pyx_v_self), __pyx_v_name}; + __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 464, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_GOTREF(__pyx_t_4); + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { + PyObject *__pyx_temp[3] = {__pyx_t_8, ((PyObject *)__pyx_v_self), __pyx_v_name}; + __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 464, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_GOTREF(__pyx_t_4); + } else + #endif + { + __pyx_t_5 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 464, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (__pyx_t_8) { + __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_8); __pyx_t_8 = NULL; + } + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_6, ((PyObject *)__pyx_v_self)); + __Pyx_INCREF(__pyx_v_name); + __Pyx_GIVEREF(__pyx_v_name); + PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_6, __pyx_v_name); + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 464, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + + /* "src/gevent/local.py":463 + * # exists, otherwise raise an AttributeError. + * # we will invoke type(self).__getattr__ or raise an attribute error. + * if hasattr(self._local_type, '__getattr__'): # <<<<<<<<<<<<<< + * return self._local_type.__getattr__(self, name) + * raise AttributeError("%r object has no attribute '%s'" + */ + } + + /* "src/gevent/local.py":466 + * return self._local_type.__getattr__(self, name) + * raise AttributeError("%r object has no attribute '%s'" + * % (self._local_type.__name__, name)) # <<<<<<<<<<<<<< + * + * def __setattr__(self, name, value): + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->_local_type), __pyx_n_s_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 466, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 466, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); + __Pyx_INCREF(__pyx_v_name); + __Pyx_GIVEREF(__pyx_v_name); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_name); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_r_object_has_no_attribute_s, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 466, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "src/gevent/local.py":465 + * if hasattr(self._local_type, '__getattr__'): + * return self._local_type.__getattr__(self, name) + * raise AttributeError("%r object has no attribute '%s'" # <<<<<<<<<<<<<< + * % (self._local_type.__name__, name)) + * + */ + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_AttributeError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 465, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(0, 465, __pyx_L1_error) + + /* "src/gevent/local.py":382 + * self._local_type_vars = set(dir(self._local_type)) + * + * def __getattribute__(self, name): # pylint:disable=too-many-return-statements # <<<<<<<<<<<<<< + * if name in _local_attrs: + * # The _local__impl, __cinit__, etc, won't be hit by the + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("gevent._local.local.__getattribute__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_dct); + __Pyx_XDECREF(__pyx_v_type_attr); + __Pyx_XDECREF(__pyx_v_base); + __Pyx_XDECREF(__pyx_v_bd); + __Pyx_XDECREF(__pyx_v_attr_on_type); + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/local.py":468 + * % (self._local_type.__name__, name)) + * + * def __setattr__(self, name, value): # <<<<<<<<<<<<<< + * if name == '__dict__': + * raise AttributeError( + */ + +/* Python wrapper */ +static int __pyx_pw_6gevent_6_local_5local_5__setattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6gevent_6_local_5local_5__setattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__setattr__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6_local_5local_4__setattr__(((struct __pyx_obj_6gevent_6_local_local *)__pyx_v_self), ((PyObject *)__pyx_v_name), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_6_local_5local_4__setattr__(struct __pyx_obj_6gevent_6_local_local *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_value) { + PyObject *__pyx_v_dct = NULL; + PyObject *__pyx_v_type_attr = NULL; + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + __Pyx_RefNannySetupContext("__setattr__", 0); + + /* "src/gevent/local.py":469 + * + * def __setattr__(self, name, value): + * if name == '__dict__': # <<<<<<<<<<<<<< + * raise AttributeError( + * "%r object attribute '__dict__' is read-only" + */ + __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_name, __pyx_n_s_dict, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 469, __pyx_L1_error) + if (unlikely(__pyx_t_1)) { + + /* "src/gevent/local.py":472 + * raise AttributeError( + * "%r object attribute '__dict__' is read-only" + * % type(self)) # <<<<<<<<<<<<<< + * + * if name in _local_attrs: + */ + __pyx_t_2 = __Pyx_PyString_FormatSafe(__pyx_kp_s_r_object_attribute___dict___is, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 472, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + + /* "src/gevent/local.py":470 + * def __setattr__(self, name, value): + * if name == '__dict__': + * raise AttributeError( # <<<<<<<<<<<<<< + * "%r object attribute '__dict__' is read-only" + * % type(self)) + */ + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_AttributeError, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 470, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(0, 470, __pyx_L1_error) + + /* "src/gevent/local.py":469 + * + * def __setattr__(self, name, value): + * if name == '__dict__': # <<<<<<<<<<<<<< + * raise AttributeError( + * "%r object attribute '__dict__' is read-only" + */ + } + + /* "src/gevent/local.py":474 + * % type(self)) + * + * if name in _local_attrs: # <<<<<<<<<<<<<< + * object.__setattr__(self, name, value) + * return + */ + if (unlikely(__pyx_v_6gevent_6_local__local_attrs == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); + __PYX_ERR(0, 474, __pyx_L1_error) + } + __pyx_t_1 = (__Pyx_PySet_ContainsTF(__pyx_v_name, __pyx_v_6gevent_6_local__local_attrs, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 474, __pyx_L1_error) + __pyx_t_4 = (__pyx_t_1 != 0); + if (__pyx_t_4) { + + /* "src/gevent/local.py":475 + * + * if name in _local_attrs: + * object.__setattr__(self, name, value) # <<<<<<<<<<<<<< + * return + * + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_builtin_object, __pyx_n_s_setattr); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 475, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = NULL; + __pyx_t_6 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_6 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[4] = {__pyx_t_5, ((PyObject *)__pyx_v_self), __pyx_v_name, __pyx_v_value}; + __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 475, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_t_3); + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[4] = {__pyx_t_5, ((PyObject *)__pyx_v_self), __pyx_v_name, __pyx_v_value}; + __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 475, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_t_3); + } else + #endif + { + __pyx_t_7 = PyTuple_New(3+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 475, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + if (__pyx_t_5) { + __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL; + } + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, ((PyObject *)__pyx_v_self)); + __Pyx_INCREF(__pyx_v_name); + __Pyx_GIVEREF(__pyx_v_name); + PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_name); + __Pyx_INCREF(__pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_6, __pyx_v_value); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 475, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "src/gevent/local.py":476 + * if name in _local_attrs: + * object.__setattr__(self, name, value) + * return # <<<<<<<<<<<<<< + * + * dct = _local_get_dict(self) + */ + __pyx_r = 0; + goto __pyx_L0; + + /* "src/gevent/local.py":474 + * % type(self)) + * + * if name in _local_attrs: # <<<<<<<<<<<<<< + * object.__setattr__(self, name, value) + * return + */ + } + + /* "src/gevent/local.py":478 + * return + * + * dct = _local_get_dict(self) # <<<<<<<<<<<<<< + * + * if self._local_type is local: + */ + __pyx_t_3 = __pyx_f_6gevent_6_local__local_get_dict(__pyx_v_self); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 478, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_v_dct = ((PyObject*)__pyx_t_3); + __pyx_t_3 = 0; + + /* "src/gevent/local.py":480 + * dct = _local_get_dict(self) + * + * if self._local_type is local: # <<<<<<<<<<<<<< + * # Optimization: If we're not subclassed, we can't + * # have data descriptors, so this goes right in the dict. + */ + __pyx_t_4 = (__pyx_v_self->_local_type == __pyx_ptype_6gevent_6_local_local); + __pyx_t_1 = (__pyx_t_4 != 0); + if (__pyx_t_1) { + + /* "src/gevent/local.py":483 + * # Optimization: If we're not subclassed, we can't + * # have data descriptors, so this goes right in the dict. + * dct[name] = value # <<<<<<<<<<<<<< + * return + * + */ + if (unlikely(__pyx_v_dct == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 483, __pyx_L1_error) + } + if (unlikely(PyDict_SetItem(__pyx_v_dct, __pyx_v_name, __pyx_v_value) < 0)) __PYX_ERR(0, 483, __pyx_L1_error) + + /* "src/gevent/local.py":484 + * # have data descriptors, so this goes right in the dict. + * dct[name] = value + * return # <<<<<<<<<<<<<< + * + * if name in self._local_type_vars: + */ + __pyx_r = 0; + goto __pyx_L0; + + /* "src/gevent/local.py":480 + * dct = _local_get_dict(self) + * + * if self._local_type is local: # <<<<<<<<<<<<<< + * # Optimization: If we're not subclassed, we can't + * # have data descriptors, so this goes right in the dict. + */ + } + + /* "src/gevent/local.py":486 + * return + * + * if name in self._local_type_vars: # <<<<<<<<<<<<<< + * if name in self._local_type_set_descriptors: + * type_attr = getattr(self._local_type, name, _marker) + */ + if (unlikely(__pyx_v_self->_local_type_vars == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); + __PYX_ERR(0, 486, __pyx_L1_error) + } + __pyx_t_1 = (__Pyx_PySet_ContainsTF(__pyx_v_name, __pyx_v_self->_local_type_vars, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 486, __pyx_L1_error) + __pyx_t_4 = (__pyx_t_1 != 0); + if (__pyx_t_4) { + + /* "src/gevent/local.py":487 + * + * if name in self._local_type_vars: + * if name in self._local_type_set_descriptors: # <<<<<<<<<<<<<< + * type_attr = getattr(self._local_type, name, _marker) + * # A data descriptor, like a property or a slot. + */ + if (unlikely(__pyx_v_self->_local_type_set_descriptors == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); + __PYX_ERR(0, 487, __pyx_L1_error) + } + __pyx_t_4 = (__Pyx_PySet_ContainsTF(__pyx_v_name, __pyx_v_self->_local_type_set_descriptors, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 487, __pyx_L1_error) + __pyx_t_1 = (__pyx_t_4 != 0); + if (__pyx_t_1) { + + /* "src/gevent/local.py":488 + * if name in self._local_type_vars: + * if name in self._local_type_set_descriptors: + * type_attr = getattr(self._local_type, name, _marker) # <<<<<<<<<<<<<< + * # A data descriptor, like a property or a slot. + * type(type_attr).__set__(type_attr, self, value) + */ + __pyx_t_3 = ((PyObject *)__pyx_v_self->_local_type); + __Pyx_INCREF(__pyx_t_3); + __pyx_t_2 = __pyx_v_6gevent_6_local__marker; + __Pyx_INCREF(__pyx_t_2); + __pyx_t_7 = __Pyx_GetAttr3(__pyx_t_3, __pyx_v_name, __pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 488, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_type_attr = __pyx_t_7; + __pyx_t_7 = 0; + + /* "src/gevent/local.py":490 + * type_attr = getattr(self._local_type, name, _marker) + * # A data descriptor, like a property or a slot. + * type(type_attr).__set__(type_attr, self, value) # <<<<<<<<<<<<<< + * return + * # Otherwise it goes directly in the dict + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)Py_TYPE(__pyx_v_type_attr)), __pyx_n_s_set); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 490, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + __pyx_t_6 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_6 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[4] = {__pyx_t_3, __pyx_v_type_attr, ((PyObject *)__pyx_v_self), __pyx_v_value}; + __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 490, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_t_7); + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[4] = {__pyx_t_3, __pyx_v_type_attr, ((PyObject *)__pyx_v_self), __pyx_v_value}; + __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 490, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_t_7); + } else + #endif + { + __pyx_t_5 = PyTuple_New(3+__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 490, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (__pyx_t_3) { + __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL; + } + __Pyx_INCREF(__pyx_v_type_attr); + __Pyx_GIVEREF(__pyx_v_type_attr); + PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_6, __pyx_v_type_attr); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_6, ((PyObject *)__pyx_v_self)); + __Pyx_INCREF(__pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_6, __pyx_v_value); + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 490, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "src/gevent/local.py":491 + * # A data descriptor, like a property or a slot. + * type(type_attr).__set__(type_attr, self, value) + * return # <<<<<<<<<<<<<< + * # Otherwise it goes directly in the dict + * dct[name] = value + */ + __pyx_r = 0; + goto __pyx_L0; + + /* "src/gevent/local.py":487 + * + * if name in self._local_type_vars: + * if name in self._local_type_set_descriptors: # <<<<<<<<<<<<<< + * type_attr = getattr(self._local_type, name, _marker) + * # A data descriptor, like a property or a slot. + */ + } + + /* "src/gevent/local.py":486 + * return + * + * if name in self._local_type_vars: # <<<<<<<<<<<<<< + * if name in self._local_type_set_descriptors: + * type_attr = getattr(self._local_type, name, _marker) + */ + } + + /* "src/gevent/local.py":493 + * return + * # Otherwise it goes directly in the dict + * dct[name] = value # <<<<<<<<<<<<<< + * + * def __delattr__(self, name): + */ + if (unlikely(__pyx_v_dct == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 493, __pyx_L1_error) + } + if (unlikely(PyDict_SetItem(__pyx_v_dct, __pyx_v_name, __pyx_v_value) < 0)) __PYX_ERR(0, 493, __pyx_L1_error) + + /* "src/gevent/local.py":468 + * % (self._local_type.__name__, name)) + * + * def __setattr__(self, name, value): # <<<<<<<<<<<<<< + * if name == '__dict__': + * raise AttributeError( + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("gevent._local.local.__setattr__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_dct); + __Pyx_XDECREF(__pyx_v_type_attr); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/local.py":495 + * dct[name] = value + * + * def __delattr__(self, name): # <<<<<<<<<<<<<< + * if name == '__dict__': + * raise AttributeError( + */ + +/* Python wrapper */ +static int __pyx_pw_6gevent_6_local_5local_7__delattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_name); /*proto*/ +static int __pyx_pw_6gevent_6_local_5local_7__delattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_name) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__delattr__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6_local_5local_6__delattr__(((struct __pyx_obj_6gevent_6_local_local *)__pyx_v_self), ((PyObject *)__pyx_v_name)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_6_local_5local_6__delattr__(struct __pyx_obj_6gevent_6_local_local *__pyx_v_self, PyObject *__pyx_v_name) { + PyObject *__pyx_v_type_attr = NULL; + PyObject *__pyx_v_dct = NULL; + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + __Pyx_RefNannySetupContext("__delattr__", 0); + + /* "src/gevent/local.py":496 + * + * def __delattr__(self, name): + * if name == '__dict__': # <<<<<<<<<<<<<< + * raise AttributeError( + * "%r object attribute '__dict__' is read-only" + */ + __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_name, __pyx_n_s_dict, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 496, __pyx_L1_error) + if (unlikely(__pyx_t_1)) { + + /* "src/gevent/local.py":499 + * raise AttributeError( + * "%r object attribute '__dict__' is read-only" + * % self.__class__.__name__) # <<<<<<<<<<<<<< + * + * if name in self._local_type_vars: + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 499, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 499, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyString_FormatSafe(__pyx_kp_s_r_object_attribute___dict___is, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 499, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "src/gevent/local.py":497 + * def __delattr__(self, name): + * if name == '__dict__': + * raise AttributeError( # <<<<<<<<<<<<<< + * "%r object attribute '__dict__' is read-only" + * % self.__class__.__name__) + */ + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_AttributeError, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 497, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(0, 497, __pyx_L1_error) + + /* "src/gevent/local.py":496 + * + * def __delattr__(self, name): + * if name == '__dict__': # <<<<<<<<<<<<<< + * raise AttributeError( + * "%r object attribute '__dict__' is read-only" + */ + } + + /* "src/gevent/local.py":501 + * % self.__class__.__name__) + * + * if name in self._local_type_vars: # <<<<<<<<<<<<<< + * if name in self._local_type_del_descriptors: + * # A data descriptor, like a property or a slot. + */ + if (unlikely(__pyx_v_self->_local_type_vars == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); + __PYX_ERR(0, 501, __pyx_L1_error) + } + __pyx_t_1 = (__Pyx_PySet_ContainsTF(__pyx_v_name, __pyx_v_self->_local_type_vars, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 501, __pyx_L1_error) + __pyx_t_4 = (__pyx_t_1 != 0); + if (__pyx_t_4) { + + /* "src/gevent/local.py":502 + * + * if name in self._local_type_vars: + * if name in self._local_type_del_descriptors: # <<<<<<<<<<<<<< + * # A data descriptor, like a property or a slot. + * type_attr = getattr(self._local_type, name, _marker) + */ + if (unlikely(__pyx_v_self->_local_type_del_descriptors == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); + __PYX_ERR(0, 502, __pyx_L1_error) + } + __pyx_t_4 = (__Pyx_PySet_ContainsTF(__pyx_v_name, __pyx_v_self->_local_type_del_descriptors, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 502, __pyx_L1_error) + __pyx_t_1 = (__pyx_t_4 != 0); + if (__pyx_t_1) { + + /* "src/gevent/local.py":504 + * if name in self._local_type_del_descriptors: + * # A data descriptor, like a property or a slot. + * type_attr = getattr(self._local_type, name, _marker) # <<<<<<<<<<<<<< + * type(type_attr).__delete__(type_attr, self) + * return + */ + __pyx_t_3 = ((PyObject *)__pyx_v_self->_local_type); + __Pyx_INCREF(__pyx_t_3); + __pyx_t_2 = __pyx_v_6gevent_6_local__marker; + __Pyx_INCREF(__pyx_t_2); + __pyx_t_5 = __Pyx_GetAttr3(__pyx_t_3, __pyx_v_name, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 504, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_type_attr = __pyx_t_5; + __pyx_t_5 = 0; + + /* "src/gevent/local.py":505 + * # A data descriptor, like a property or a slot. + * type_attr = getattr(self._local_type, name, _marker) + * type(type_attr).__delete__(type_attr, self) # <<<<<<<<<<<<<< + * return + * # Otherwise it goes directly in the dict + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)Py_TYPE(__pyx_v_type_attr)), __pyx_n_s_delete); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 505, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + __pyx_t_6 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_6 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_type_attr, ((PyObject *)__pyx_v_self)}; + __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 505, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_t_5); + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_type_attr, ((PyObject *)__pyx_v_self)}; + __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 505, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_t_5); + } else + #endif + { + __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 505, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + if (__pyx_t_3) { + __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3); __pyx_t_3 = NULL; + } + __Pyx_INCREF(__pyx_v_type_attr); + __Pyx_GIVEREF(__pyx_v_type_attr); + PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_v_type_attr); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, ((PyObject *)__pyx_v_self)); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 505, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "src/gevent/local.py":506 + * type_attr = getattr(self._local_type, name, _marker) + * type(type_attr).__delete__(type_attr, self) + * return # <<<<<<<<<<<<<< + * # Otherwise it goes directly in the dict + * + */ + __pyx_r = 0; + goto __pyx_L0; + + /* "src/gevent/local.py":502 + * + * if name in self._local_type_vars: + * if name in self._local_type_del_descriptors: # <<<<<<<<<<<<<< + * # A data descriptor, like a property or a slot. + * type_attr = getattr(self._local_type, name, _marker) + */ + } + + /* "src/gevent/local.py":501 + * % self.__class__.__name__) + * + * if name in self._local_type_vars: # <<<<<<<<<<<<<< + * if name in self._local_type_del_descriptors: + * # A data descriptor, like a property or a slot. + */ + } + + /* "src/gevent/local.py":510 + * + * # Begin inlined function _get_dict() + * dct = _local_get_dict(self) # <<<<<<<<<<<<<< + * + * try: + */ + __pyx_t_5 = __pyx_f_6gevent_6_local__local_get_dict(__pyx_v_self); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 510, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_v_dct = ((PyObject*)__pyx_t_5); + __pyx_t_5 = 0; + + /* "src/gevent/local.py":512 + * dct = _local_get_dict(self) + * + * try: # <<<<<<<<<<<<<< + * del dct[name] + * except KeyError: + */ + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); + __Pyx_XGOTREF(__pyx_t_8); + __Pyx_XGOTREF(__pyx_t_9); + __Pyx_XGOTREF(__pyx_t_10); + /*try:*/ { + + /* "src/gevent/local.py":513 + * + * try: + * del dct[name] # <<<<<<<<<<<<<< + * except KeyError: + * raise AttributeError(name) + */ + if (unlikely(__pyx_v_dct == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 513, __pyx_L6_error) + } + if (unlikely(PyDict_DelItem(__pyx_v_dct, __pyx_v_name) < 0)) __PYX_ERR(0, 513, __pyx_L6_error) + + /* "src/gevent/local.py":512 + * dct = _local_get_dict(self) + * + * try: # <<<<<<<<<<<<<< + * del dct[name] + * except KeyError: + */ + } + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + goto __pyx_L11_try_end; + __pyx_L6_error:; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "src/gevent/local.py":514 + * try: + * del dct[name] + * except KeyError: # <<<<<<<<<<<<<< + * raise AttributeError(name) + * + */ + __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError); + if (__pyx_t_6) { + __Pyx_AddTraceback("gevent._local.local.__delattr__", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_2, &__pyx_t_7) < 0) __PYX_ERR(0, 514, __pyx_L8_except_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_t_7); + + /* "src/gevent/local.py":515 + * del dct[name] + * except KeyError: + * raise AttributeError(name) # <<<<<<<<<<<<<< + * + * def __copy__(self): + */ + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_AttributeError, __pyx_v_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 515, __pyx_L8_except_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(0, 515, __pyx_L8_except_error) + } + goto __pyx_L8_except_error; + __pyx_L8_except_error:; + + /* "src/gevent/local.py":512 + * dct = _local_get_dict(self) + * + * try: # <<<<<<<<<<<<<< + * del dct[name] + * except KeyError: + */ + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10); + goto __pyx_L1_error; + __pyx_L11_try_end:; + } + + /* "src/gevent/local.py":495 + * dct[name] = value + * + * def __delattr__(self, name): # <<<<<<<<<<<<<< + * if name == '__dict__': + * raise AttributeError( + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("gevent._local.local.__delattr__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_type_attr); + __Pyx_XDECREF(__pyx_v_dct); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/local.py":517 + * raise AttributeError(name) + * + * def __copy__(self): # <<<<<<<<<<<<<< + * impl = self._local__impl + * entry = impl.dicts[id(getcurrent())] # pylint:disable=undefined-variable + */ + +static PyObject *__pyx_pw_6gevent_6_local_5local_9__copy__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static struct __pyx_obj_6gevent_6_local_local *__pyx_f_6gevent_6_local_5local___copy__(struct __pyx_obj_6gevent_6_local_local *__pyx_v_self, int __pyx_skip_dispatch) { + struct __pyx_obj_6gevent_6_local__localimpl_dict_entry *__pyx_v_entry = 0; + PyObject *__pyx_v_dct = 0; + PyObject *__pyx_v_duplicate = 0; + struct __pyx_obj_6gevent_6_local_local *__pyx_v_instance = 0; + struct __pyx_obj_6gevent_6_local__localimpl *__pyx_v_impl = NULL; + PyTypeObject *__pyx_v_cls = NULL; + struct __pyx_obj_6gevent_6_local_local *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + __Pyx_RefNannySetupContext("__copy__", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0; + if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self)))))); + else { + PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + #endif + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_copy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 517, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_6_local_5local_9__copy__)) { + __Pyx_XDECREF(((PyObject *)__pyx_r)); + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 517, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_6gevent_6_local_local))))) __PYX_ERR(0, 517, __pyx_L1_error) + __pyx_r = ((struct __pyx_obj_6gevent_6_local_local *)__pyx_t_2); + __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0; + if (unlikely(type_dict_guard != tp_dict_version)) { + tp_dict_version = obj_dict_version = 0; + } + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + } + #endif + } + + /* "src/gevent/local.py":518 + * + * def __copy__(self): + * impl = self._local__impl # <<<<<<<<<<<<<< + * entry = impl.dicts[id(getcurrent())] # pylint:disable=undefined-variable + * + */ + __pyx_t_1 = ((PyObject *)__pyx_v_self->_local__impl); + __Pyx_INCREF(__pyx_t_1); + __pyx_v_impl = ((struct __pyx_obj_6gevent_6_local__localimpl *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "src/gevent/local.py":519 + * def __copy__(self): + * impl = self._local__impl + * entry = impl.dicts[id(getcurrent())] # pylint:disable=undefined-variable # <<<<<<<<<<<<<< + * + * dct = entry.localdict + */ + if (unlikely(__pyx_v_impl->dicts == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 519, __pyx_L1_error) + } + __pyx_t_1 = ((PyObject *)__pyx_f_6gevent_6_local_getcurrent()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 519, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 519, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_impl->dicts, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 519, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_6gevent_6_local__localimpl_dict_entry))))) __PYX_ERR(0, 519, __pyx_L1_error) + __pyx_v_entry = ((struct __pyx_obj_6gevent_6_local__localimpl_dict_entry *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "src/gevent/local.py":521 + * entry = impl.dicts[id(getcurrent())] # pylint:disable=undefined-variable + * + * dct = entry.localdict # <<<<<<<<<<<<<< + * duplicate = copy(dct) + * + */ + __pyx_t_1 = __pyx_v_entry->localdict; + __Pyx_INCREF(__pyx_t_1); + __pyx_v_dct = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "src/gevent/local.py":522 + * + * dct = entry.localdict + * duplicate = copy(dct) # <<<<<<<<<<<<<< + * + * cls = type(self) + */ + __Pyx_INCREF(__pyx_v_6gevent_6_local_copy); + __pyx_t_2 = __pyx_v_6gevent_6_local_copy; __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_dct) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_dct); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 522, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!(likely(PyDict_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 522, __pyx_L1_error) + __pyx_v_duplicate = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "src/gevent/local.py":524 + * duplicate = copy(dct) + * + * cls = type(self) # <<<<<<<<<<<<<< + * instance = cls(*impl.localargs, **impl.localkwargs) + * _local__copy_dict_from(instance, impl, duplicate) + */ + __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __pyx_v_cls = ((PyTypeObject*)((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + + /* "src/gevent/local.py":525 + * + * cls = type(self) + * instance = cls(*impl.localargs, **impl.localkwargs) # <<<<<<<<<<<<<< + * _local__copy_dict_from(instance, impl, duplicate) + * return instance + */ + if (unlikely(__pyx_v_impl->localargs == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); + __PYX_ERR(0, 525, __pyx_L1_error) + } + if (unlikely(__pyx_v_impl->localkwargs == Py_None)) { + PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); + __PYX_ERR(0, 525, __pyx_L1_error) + } + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_v_cls), __pyx_v_impl->localargs, __pyx_v_impl->localkwargs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 525, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_6gevent_6_local_local))))) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_v_instance = ((struct __pyx_obj_6gevent_6_local_local *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "src/gevent/local.py":526 + * cls = type(self) + * instance = cls(*impl.localargs, **impl.localkwargs) + * _local__copy_dict_from(instance, impl, duplicate) # <<<<<<<<<<<<<< + * return instance + * + */ + __pyx_t_1 = __pyx_f_6gevent_6_local__local__copy_dict_from(__pyx_v_instance, __pyx_v_impl, __pyx_v_duplicate); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 526, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/local.py":527 + * instance = cls(*impl.localargs, **impl.localkwargs) + * _local__copy_dict_from(instance, impl, duplicate) + * return instance # <<<<<<<<<<<<<< + * + * def _local__copy_dict_from(self, impl, duplicate): + */ + __Pyx_XDECREF(((PyObject *)__pyx_r)); + __Pyx_INCREF(((PyObject *)__pyx_v_instance)); + __pyx_r = __pyx_v_instance; + goto __pyx_L0; + + /* "src/gevent/local.py":517 + * raise AttributeError(name) + * + * def __copy__(self): # <<<<<<<<<<<<<< + * impl = self._local__impl + * entry = impl.dicts[id(getcurrent())] # pylint:disable=undefined-variable + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("gevent._local.local.__copy__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_entry); + __Pyx_XDECREF(__pyx_v_dct); + __Pyx_XDECREF(__pyx_v_duplicate); + __Pyx_XDECREF((PyObject *)__pyx_v_instance); + __Pyx_XDECREF((PyObject *)__pyx_v_impl); + __Pyx_XDECREF(__pyx_v_cls); + __Pyx_XGIVEREF((PyObject *)__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_local_5local_9__copy__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6gevent_6_local_5local_8__copy__[] = "local.__copy__(self) -> local"; +static PyMethodDef __pyx_mdef_6gevent_6_local_5local_9__copy__ = {"__copy__", (PyCFunction)__pyx_pw_6gevent_6_local_5local_9__copy__, METH_NOARGS, __pyx_doc_6gevent_6_local_5local_8__copy__}; +static PyObject *__pyx_pw_6gevent_6_local_5local_9__copy__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__copy__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6_local_5local_8__copy__(((struct __pyx_obj_6gevent_6_local_local *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_local_5local_8__copy__(struct __pyx_obj_6gevent_6_local_local *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__copy__", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = ((PyObject *)__pyx_f_6gevent_6_local_5local___copy__(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 517, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent._local.local.__copy__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/local.py":529 + * return instance + * + * def _local__copy_dict_from(self, impl, duplicate): # <<<<<<<<<<<<<< + * current = getcurrent() # pylint:disable=undefined-variable + * currentId = id(current) + */ + +static PyObject *__pyx_f_6gevent_6_local__local__copy_dict_from(struct __pyx_obj_6gevent_6_local_local *__pyx_v_self, struct __pyx_obj_6gevent_6_local__localimpl *__pyx_v_impl, PyObject *__pyx_v_duplicate) { + struct __pyx_obj_6gevent_6_local__localimpl_dict_entry *__pyx_v_entry = 0; + PyGreenlet *__pyx_v_current = NULL; + PyObject *__pyx_v_currentId = NULL; + struct __pyx_obj_6gevent_6_local__localimpl *__pyx_v_new_impl = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("_local__copy_dict_from", 0); + + /* "src/gevent/local.py":530 + * + * def _local__copy_dict_from(self, impl, duplicate): + * current = getcurrent() # pylint:disable=undefined-variable # <<<<<<<<<<<<<< + * currentId = id(current) + * new_impl = self._local__impl + */ + __pyx_t_1 = ((PyObject *)__pyx_f_6gevent_6_local_getcurrent()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 530, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_current = ((PyGreenlet *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "src/gevent/local.py":531 + * def _local__copy_dict_from(self, impl, duplicate): + * current = getcurrent() # pylint:disable=undefined-variable + * currentId = id(current) # <<<<<<<<<<<<<< + * new_impl = self._local__impl + * assert new_impl is not impl + */ + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_current)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 531, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_currentId = __pyx_t_1; + __pyx_t_1 = 0; + + /* "src/gevent/local.py":532 + * current = getcurrent() # pylint:disable=undefined-variable + * currentId = id(current) + * new_impl = self._local__impl # <<<<<<<<<<<<<< + * assert new_impl is not impl + * entry = new_impl.dicts[currentId] + */ + __pyx_t_1 = ((PyObject *)__pyx_v_self->_local__impl); + __Pyx_INCREF(__pyx_t_1); + __pyx_v_new_impl = ((struct __pyx_obj_6gevent_6_local__localimpl *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "src/gevent/local.py":533 + * currentId = id(current) + * new_impl = self._local__impl + * assert new_impl is not impl # <<<<<<<<<<<<<< + * entry = new_impl.dicts[currentId] + * new_impl.dicts[currentId] = _localimpl_dict_entry(entry.wrgreenlet, duplicate) + */ + #ifndef CYTHON_WITHOUT_ASSERTIONS + if (unlikely(!Py_OptimizeFlag)) { + __pyx_t_2 = (__pyx_v_new_impl != __pyx_v_impl); + if (unlikely(!(__pyx_t_2 != 0))) { + PyErr_SetNone(PyExc_AssertionError); + __PYX_ERR(0, 533, __pyx_L1_error) + } + } + #endif + + /* "src/gevent/local.py":534 + * new_impl = self._local__impl + * assert new_impl is not impl + * entry = new_impl.dicts[currentId] # <<<<<<<<<<<<<< + * new_impl.dicts[currentId] = _localimpl_dict_entry(entry.wrgreenlet, duplicate) + * + */ + if (unlikely(__pyx_v_new_impl->dicts == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 534, __pyx_L1_error) + } + __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_new_impl->dicts, __pyx_v_currentId); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 534, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_6gevent_6_local__localimpl_dict_entry))))) __PYX_ERR(0, 534, __pyx_L1_error) + __pyx_v_entry = ((struct __pyx_obj_6gevent_6_local__localimpl_dict_entry *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "src/gevent/local.py":535 + * assert new_impl is not impl + * entry = new_impl.dicts[currentId] + * new_impl.dicts[currentId] = _localimpl_dict_entry(entry.wrgreenlet, duplicate) # <<<<<<<<<<<<<< + * + * def _local_find_descriptors(self): + */ + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 535, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_entry->wrgreenlet); + __Pyx_GIVEREF(__pyx_v_entry->wrgreenlet); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_entry->wrgreenlet); + __Pyx_INCREF(__pyx_v_duplicate); + __Pyx_GIVEREF(__pyx_v_duplicate); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_duplicate); + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6gevent_6_local__localimpl_dict_entry), __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 535, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(__pyx_v_new_impl->dicts == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 535, __pyx_L1_error) + } + if (unlikely(PyDict_SetItem(__pyx_v_new_impl->dicts, __pyx_v_currentId, __pyx_t_3) < 0)) __PYX_ERR(0, 535, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "src/gevent/local.py":529 + * return instance + * + * def _local__copy_dict_from(self, impl, duplicate): # <<<<<<<<<<<<<< + * current = getcurrent() # pylint:disable=undefined-variable + * currentId = id(current) + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("gevent._local._local__copy_dict_from", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_entry); + __Pyx_XDECREF((PyObject *)__pyx_v_current); + __Pyx_XDECREF(__pyx_v_currentId); + __Pyx_XDECREF((PyObject *)__pyx_v_new_impl); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/local.py":537 + * new_impl.dicts[currentId] = _localimpl_dict_entry(entry.wrgreenlet, duplicate) + * + * def _local_find_descriptors(self): # <<<<<<<<<<<<<< + * type_self = type(self) + * gets = set() + */ + +static PyObject *__pyx_f_6gevent_6_local__local_find_descriptors(struct __pyx_obj_6gevent_6_local_local *__pyx_v_self) { + PyObject *__pyx_v_mro = 0; + PyObject *__pyx_v_gets = 0; + PyObject *__pyx_v_dels = 0; + PyObject *__pyx_v_set_or_del = 0; + PyTypeObject *__pyx_v_type_self = 0; + PyTypeObject *__pyx_v_type_attr = 0; + PyObject *__pyx_v_sets = 0; + PyObject *__pyx_v_attr_name = NULL; + PyObject *__pyx_v_base = NULL; + PyObject *__pyx_v_bd = NULL; + PyObject *__pyx_v_attr = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + Py_ssize_t __pyx_t_4; + PyObject *(*__pyx_t_5)(PyObject *); + Py_ssize_t __pyx_t_6; + int __pyx_t_7; + int __pyx_t_8; + int __pyx_t_9; + __Pyx_RefNannySetupContext("_local_find_descriptors", 0); + + /* "src/gevent/local.py":538 + * + * def _local_find_descriptors(self): + * type_self = type(self) # <<<<<<<<<<<<<< + * gets = set() + * dels = set() + */ + __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __pyx_v_type_self = ((PyTypeObject*)((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + + /* "src/gevent/local.py":539 + * def _local_find_descriptors(self): + * type_self = type(self) + * gets = set() # <<<<<<<<<<<<<< + * dels = set() + * set_or_del = set() + */ + __pyx_t_1 = PySet_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 539, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_gets = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "src/gevent/local.py":540 + * type_self = type(self) + * gets = set() + * dels = set() # <<<<<<<<<<<<<< + * set_or_del = set() + * sets = set() + */ + __pyx_t_1 = PySet_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 540, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_dels = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "src/gevent/local.py":541 + * gets = set() + * dels = set() + * set_or_del = set() # <<<<<<<<<<<<<< + * sets = set() + * mro = list(type_self.mro()) + */ + __pyx_t_1 = PySet_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 541, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_set_or_del = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "src/gevent/local.py":542 + * dels = set() + * set_or_del = set() + * sets = set() # <<<<<<<<<<<<<< + * mro = list(type_self.mro()) + * + */ + __pyx_t_1 = PySet_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 542, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_sets = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "src/gevent/local.py":543 + * set_or_del = set() + * sets = set() + * mro = list(type_self.mro()) # <<<<<<<<<<<<<< + * + * for attr_name in dir(type_self): + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_type_self), __pyx_n_s_mro); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 543, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 543, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PySequence_List(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 543, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_mro = ((PyObject*)__pyx_t_2); + __pyx_t_2 = 0; + + /* "src/gevent/local.py":545 + * mro = list(type_self.mro()) + * + * for attr_name in dir(type_self): # <<<<<<<<<<<<<< + * # Conventionally, descriptors when called on a class + * # return themself, but not all do. Notable exceptions are + */ + __pyx_t_2 = PyObject_Dir(((PyObject *)__pyx_v_type_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 545, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) { + __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1); __pyx_t_4 = 0; + __pyx_t_5 = NULL; + } else { + __pyx_t_4 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 545, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 545, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + for (;;) { + if (likely(!__pyx_t_5)) { + if (likely(PyList_CheckExact(__pyx_t_1))) { + if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 545, __pyx_L1_error) + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 545, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + #endif + } else { + if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 545, __pyx_L1_error) + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 545, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + #endif + } + } else { + __pyx_t_2 = __pyx_t_5(__pyx_t_1); + if (unlikely(!__pyx_t_2)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(0, 545, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_2); + } + __Pyx_XDECREF_SET(__pyx_v_attr_name, __pyx_t_2); + __pyx_t_2 = 0; + + /* "src/gevent/local.py":551 + * # return other class attributes. So we can't use getattr, and instead + * # walk up the dicts + * for base in mro: # <<<<<<<<<<<<<< + * bd = base.__dict__ + * if attr_name in bd: + */ + __pyx_t_2 = __pyx_v_mro; __Pyx_INCREF(__pyx_t_2); __pyx_t_6 = 0; + for (;;) { + if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_2)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_3); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 551, __pyx_L1_error) + #else + __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 551, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + #endif + __Pyx_XDECREF_SET(__pyx_v_base, __pyx_t_3); + __pyx_t_3 = 0; + + /* "src/gevent/local.py":552 + * # walk up the dicts + * for base in mro: + * bd = base.__dict__ # <<<<<<<<<<<<<< + * if attr_name in bd: + * attr = bd[attr_name] + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_dict); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 552, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_XDECREF_SET(__pyx_v_bd, __pyx_t_3); + __pyx_t_3 = 0; + + /* "src/gevent/local.py":553 + * for base in mro: + * bd = base.__dict__ + * if attr_name in bd: # <<<<<<<<<<<<<< + * attr = bd[attr_name] + * break + */ + __pyx_t_7 = (__Pyx_PySequence_ContainsTF(__pyx_v_attr_name, __pyx_v_bd, Py_EQ)); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 553, __pyx_L1_error) + __pyx_t_8 = (__pyx_t_7 != 0); + if (__pyx_t_8) { + + /* "src/gevent/local.py":554 + * bd = base.__dict__ + * if attr_name in bd: + * attr = bd[attr_name] # <<<<<<<<<<<<<< + * break + * else: + */ + __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_bd, __pyx_v_attr_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 554, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_XDECREF_SET(__pyx_v_attr, __pyx_t_3); + __pyx_t_3 = 0; + + /* "src/gevent/local.py":555 + * if attr_name in bd: + * attr = bd[attr_name] + * break # <<<<<<<<<<<<<< + * else: + * raise AttributeError(attr_name) + */ + goto __pyx_L6_break; + + /* "src/gevent/local.py":553 + * for base in mro: + * bd = base.__dict__ + * if attr_name in bd: # <<<<<<<<<<<<<< + * attr = bd[attr_name] + * break + */ + } + + /* "src/gevent/local.py":551 + * # return other class attributes. So we can't use getattr, and instead + * # walk up the dicts + * for base in mro: # <<<<<<<<<<<<<< + * bd = base.__dict__ + * if attr_name in bd: + */ + } + /*else*/ { + + /* "src/gevent/local.py":557 + * break + * else: + * raise AttributeError(attr_name) # <<<<<<<<<<<<<< + * + * type_attr = type(attr) + */ + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_AttributeError, __pyx_v_attr_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 557, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(0, 557, __pyx_L1_error) + } + + /* "src/gevent/local.py":551 + * # return other class attributes. So we can't use getattr, and instead + * # walk up the dicts + * for base in mro: # <<<<<<<<<<<<<< + * bd = base.__dict__ + * if attr_name in bd: + */ + __pyx_L6_break:; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/local.py":559 + * raise AttributeError(attr_name) + * + * type_attr = type(attr) # <<<<<<<<<<<<<< + * if hasattr(type_attr, '__get__'): + * gets.add(attr_name) + */ + __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_attr))); + __Pyx_XDECREF_SET(__pyx_v_type_attr, ((PyTypeObject*)((PyObject *)Py_TYPE(__pyx_v_attr)))); + + /* "src/gevent/local.py":560 + * + * type_attr = type(attr) + * if hasattr(type_attr, '__get__'): # <<<<<<<<<<<<<< + * gets.add(attr_name) + * if hasattr(type_attr, '__delete__'): + */ + __pyx_t_8 = __Pyx_HasAttr(((PyObject *)__pyx_v_type_attr), __pyx_n_s_get); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 560, __pyx_L1_error) + __pyx_t_7 = (__pyx_t_8 != 0); + if (__pyx_t_7) { + + /* "src/gevent/local.py":561 + * type_attr = type(attr) + * if hasattr(type_attr, '__get__'): + * gets.add(attr_name) # <<<<<<<<<<<<<< + * if hasattr(type_attr, '__delete__'): + * dels.add(attr_name) + */ + __pyx_t_9 = PySet_Add(__pyx_v_gets, __pyx_v_attr_name); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 561, __pyx_L1_error) + + /* "src/gevent/local.py":560 + * + * type_attr = type(attr) + * if hasattr(type_attr, '__get__'): # <<<<<<<<<<<<<< + * gets.add(attr_name) + * if hasattr(type_attr, '__delete__'): + */ + } + + /* "src/gevent/local.py":562 + * if hasattr(type_attr, '__get__'): + * gets.add(attr_name) + * if hasattr(type_attr, '__delete__'): # <<<<<<<<<<<<<< + * dels.add(attr_name) + * set_or_del.add(attr_name) + */ + __pyx_t_7 = __Pyx_HasAttr(((PyObject *)__pyx_v_type_attr), __pyx_n_s_delete); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 562, __pyx_L1_error) + __pyx_t_8 = (__pyx_t_7 != 0); + if (__pyx_t_8) { + + /* "src/gevent/local.py":563 + * gets.add(attr_name) + * if hasattr(type_attr, '__delete__'): + * dels.add(attr_name) # <<<<<<<<<<<<<< + * set_or_del.add(attr_name) + * if hasattr(type_attr, '__set__'): + */ + __pyx_t_9 = PySet_Add(__pyx_v_dels, __pyx_v_attr_name); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 563, __pyx_L1_error) + + /* "src/gevent/local.py":564 + * if hasattr(type_attr, '__delete__'): + * dels.add(attr_name) + * set_or_del.add(attr_name) # <<<<<<<<<<<<<< + * if hasattr(type_attr, '__set__'): + * sets.add(attr_name) + */ + __pyx_t_9 = PySet_Add(__pyx_v_set_or_del, __pyx_v_attr_name); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 564, __pyx_L1_error) + + /* "src/gevent/local.py":562 + * if hasattr(type_attr, '__get__'): + * gets.add(attr_name) + * if hasattr(type_attr, '__delete__'): # <<<<<<<<<<<<<< + * dels.add(attr_name) + * set_or_del.add(attr_name) + */ + } + + /* "src/gevent/local.py":565 + * dels.add(attr_name) + * set_or_del.add(attr_name) + * if hasattr(type_attr, '__set__'): # <<<<<<<<<<<<<< + * sets.add(attr_name) + * + */ + __pyx_t_8 = __Pyx_HasAttr(((PyObject *)__pyx_v_type_attr), __pyx_n_s_set); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 565, __pyx_L1_error) + __pyx_t_7 = (__pyx_t_8 != 0); + if (__pyx_t_7) { + + /* "src/gevent/local.py":566 + * set_or_del.add(attr_name) + * if hasattr(type_attr, '__set__'): + * sets.add(attr_name) # <<<<<<<<<<<<<< + * + * return (gets, dels, set_or_del, sets) + */ + __pyx_t_9 = PySet_Add(__pyx_v_sets, __pyx_v_attr_name); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 566, __pyx_L1_error) + + /* "src/gevent/local.py":565 + * dels.add(attr_name) + * set_or_del.add(attr_name) + * if hasattr(type_attr, '__set__'): # <<<<<<<<<<<<<< + * sets.add(attr_name) + * + */ + } + + /* "src/gevent/local.py":545 + * mro = list(type_self.mro()) + * + * for attr_name in dir(type_self): # <<<<<<<<<<<<<< + * # Conventionally, descriptors when called on a class + * # return themself, but not all do. Notable exceptions are + */ + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/local.py":568 + * sets.add(attr_name) + * + * return (gets, dels, set_or_del, sets) # <<<<<<<<<<<<<< + * + * # Cython doesn't let us use __new__, it requires + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 568, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_gets); + __Pyx_GIVEREF(__pyx_v_gets); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_gets); + __Pyx_INCREF(__pyx_v_dels); + __Pyx_GIVEREF(__pyx_v_dels); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_dels); + __Pyx_INCREF(__pyx_v_set_or_del); + __Pyx_GIVEREF(__pyx_v_set_or_del); + PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_set_or_del); + __Pyx_INCREF(__pyx_v_sets); + __Pyx_GIVEREF(__pyx_v_sets); + PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_v_sets); + __pyx_r = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "src/gevent/local.py":537 + * new_impl.dicts[currentId] = _localimpl_dict_entry(entry.wrgreenlet, duplicate) + * + * def _local_find_descriptors(self): # <<<<<<<<<<<<<< + * type_self = type(self) + * gets = set() + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("gevent._local._local_find_descriptors", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_mro); + __Pyx_XDECREF(__pyx_v_gets); + __Pyx_XDECREF(__pyx_v_dels); + __Pyx_XDECREF(__pyx_v_set_or_del); + __Pyx_XDECREF(__pyx_v_type_self); + __Pyx_XDECREF(__pyx_v_type_attr); + __Pyx_XDECREF(__pyx_v_sets); + __Pyx_XDECREF(__pyx_v_attr_name); + __Pyx_XDECREF(__pyx_v_base); + __Pyx_XDECREF(__pyx_v_bd); + __Pyx_XDECREF(__pyx_v_attr); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/local.py":574 + * # (e.g., on PyPy). So we set it at runtime. Cython + * # will raise an error if we're compiled. + * def __new__(cls, *args, **kw): # <<<<<<<<<<<<<< + * self = super(local, cls).__new__(cls) + * # We get the cls in *args for some reason + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_local_3__new__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6gevent_6_local_2__new__[] = "__new__(cls, *args, **kw)"; +static PyMethodDef __pyx_mdef_6gevent_6_local_3__new__ = {"__new__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_6_local_3__new__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_6_local_2__new__}; +static PyObject *__pyx_pw_6gevent_6_local_3__new__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_cls = 0; + PyObject *__pyx_v_args = 0; + PyObject *__pyx_v_kw = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__new__ (wrapper)", 0); + __pyx_v_kw = PyDict_New(); if (unlikely(!__pyx_v_kw)) return NULL; + __Pyx_GOTREF(__pyx_v_kw); + if (PyTuple_GET_SIZE(__pyx_args) > 1) { + __pyx_v_args = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args)); + if (unlikely(!__pyx_v_args)) { + __Pyx_DECREF(__pyx_v_kw); __pyx_v_kw = 0; + __Pyx_RefNannyFinishContext(); + return NULL; + } + __Pyx_GOTREF(__pyx_v_args); + } else { + __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple); + } + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_cls,0}; + PyObject* values[1] = {0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + default: + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cls)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kw, values, used_pos_args, "__new__") < 0)) __PYX_ERR(0, 574, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) < 1) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + } + __pyx_v_cls = values[0]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__new__", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 574, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0; + __Pyx_DECREF(__pyx_v_kw); __pyx_v_kw = 0; + __Pyx_AddTraceback("gevent._local.__new__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_6_local_2__new__(__pyx_self, __pyx_v_cls, __pyx_v_args, __pyx_v_kw); + + /* function exit code */ + __Pyx_XDECREF(__pyx_v_args); + __Pyx_XDECREF(__pyx_v_kw); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_local_2__new__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_cls, PyObject *__pyx_v_args, PyObject *__pyx_v_kw) { + PyObject *__pyx_v_self = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("__new__", 0); + + /* "src/gevent/local.py":575 + * # will raise an error if we're compiled. + * def __new__(cls, *args, **kw): + * self = super(local, cls).__new__(cls) # <<<<<<<<<<<<<< + * # We get the cls in *args for some reason + * # too when we do it this way....except on PyPy3, which does + */ + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 575, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_ptype_6gevent_6_local_local)); + __Pyx_GIVEREF(((PyObject *)__pyx_ptype_6gevent_6_local_local)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_ptype_6gevent_6_local_local)); + __Pyx_INCREF(__pyx_v_cls); + __Pyx_GIVEREF(__pyx_v_cls); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_cls); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 575, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 575, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_cls) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_cls); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 575, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_self = __pyx_t_1; + __pyx_t_1 = 0; + + /* "src/gevent/local.py":579 + * # too when we do it this way....except on PyPy3, which does + * # not *unless* it's wrapped in a classmethod (which it is) + * self.__cinit__(*args[1:], **kw) # <<<<<<<<<<<<<< + * return self + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cinit); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 579, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyTuple_GetSlice(__pyx_v_args, 1, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 579, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_v_kw); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 579, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "src/gevent/local.py":580 + * # not *unless* it's wrapped in a classmethod (which it is) + * self.__cinit__(*args[1:], **kw) + * return self # <<<<<<<<<<<<<< + * + * try: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self); + __pyx_r = __pyx_v_self; + goto __pyx_L0; + + /* "src/gevent/local.py":574 + * # (e.g., on PyPy). So we set it at runtime. Cython + * # will raise an error if we're compiled. + * def __new__(cls, *args, **kw): # <<<<<<<<<<<<<< + * self = super(local, cls).__new__(cls) + * # We get the cls in *args for some reason + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("gevent._local.__new__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_self); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/__greenlet_primitives.pxd":23 + * + * @cython.final + * cdef inline greenlet getcurrent(): # <<<<<<<<<<<<<< + * return PyGreenlet_GetCurrent() + * + */ + +static CYTHON_INLINE PyGreenlet *__pyx_f_6gevent_21__greenlet_primitives_getcurrent(void) { + PyGreenlet *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("getcurrent", 0); + + /* "gevent/__greenlet_primitives.pxd":24 + * @cython.final + * cdef inline greenlet getcurrent(): + * return PyGreenlet_GetCurrent() # <<<<<<<<<<<<<< + * + * cdef bint _greenlet_imported + */ + __Pyx_XDECREF(((PyObject *)__pyx_r)); + __pyx_t_1 = ((PyObject *)PyGreenlet_GetCurrent()); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 24, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = ((PyGreenlet *)__pyx_t_1); + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "gevent/__greenlet_primitives.pxd":23 + * + * @cython.final + * cdef inline greenlet getcurrent(): # <<<<<<<<<<<<<< + * return PyGreenlet_GetCurrent() + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__greenlet_primitives.getcurrent", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF((PyObject *)__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/__greenlet_primitives.pxd":28 + * cdef bint _greenlet_imported + * + * cdef inline void greenlet_init(): # <<<<<<<<<<<<<< + * global _greenlet_imported + * if not _greenlet_imported: + */ + +static CYTHON_INLINE void __pyx_f_6gevent_21__greenlet_primitives_greenlet_init(void) { + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("greenlet_init", 0); + + /* "gevent/__greenlet_primitives.pxd":30 + * cdef inline void greenlet_init(): + * global _greenlet_imported + * if not _greenlet_imported: # <<<<<<<<<<<<<< + * PyGreenlet_Import() + * _greenlet_imported = True + */ + __pyx_t_1 = ((!(__pyx_v_6gevent_21__greenlet_primitives__greenlet_imported != 0)) != 0); + if (__pyx_t_1) { + + /* "gevent/__greenlet_primitives.pxd":31 + * global _greenlet_imported + * if not _greenlet_imported: + * PyGreenlet_Import() # <<<<<<<<<<<<<< + * _greenlet_imported = True + * + */ + PyGreenlet_Import(); + + /* "gevent/__greenlet_primitives.pxd":32 + * if not _greenlet_imported: + * PyGreenlet_Import() + * _greenlet_imported = True # <<<<<<<<<<<<<< + * + * cdef inline object _greenlet_switch(greenlet self): + */ + __pyx_v_6gevent_21__greenlet_primitives__greenlet_imported = 1; + + /* "gevent/__greenlet_primitives.pxd":30 + * cdef inline void greenlet_init(): + * global _greenlet_imported + * if not _greenlet_imported: # <<<<<<<<<<<<<< + * PyGreenlet_Import() + * _greenlet_imported = True + */ + } + + /* "gevent/__greenlet_primitives.pxd":28 + * cdef bint _greenlet_imported + * + * cdef inline void greenlet_init(): # <<<<<<<<<<<<<< + * global _greenlet_imported + * if not _greenlet_imported: + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "gevent/__greenlet_primitives.pxd":34 + * _greenlet_imported = True + * + * cdef inline object _greenlet_switch(greenlet self): # <<<<<<<<<<<<<< + * return PyGreenlet_Switch(self, NULL, NULL) + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_6gevent_21__greenlet_primitives__greenlet_switch(PyGreenlet *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("_greenlet_switch", 0); + + /* "gevent/__greenlet_primitives.pxd":35 + * + * cdef inline object _greenlet_switch(greenlet self): + * return PyGreenlet_Switch(self, NULL, NULL) # <<<<<<<<<<<<<< + * + * cdef class TrackedRawGreenlet(greenlet): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyGreenlet_Switch(__pyx_v_self, NULL, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 35, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "gevent/__greenlet_primitives.pxd":34 + * _greenlet_imported = True + * + * cdef inline object _greenlet_switch(greenlet self): # <<<<<<<<<<<<<< + * return PyGreenlet_Switch(self, NULL, NULL) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__greenlet_primitives._greenlet_switch", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/__waiter.pxd":24 + * void PyGreenlet_Import() + * + * cdef inline greenlet getcurrent(): # <<<<<<<<<<<<<< + * return PyGreenlet_GetCurrent() + * + */ + +static CYTHON_INLINE PyGreenlet *__pyx_f_6gevent_8__waiter_getcurrent(void) { + PyGreenlet *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("getcurrent", 0); + + /* "gevent/__waiter.pxd":25 + * + * cdef inline greenlet getcurrent(): + * return PyGreenlet_GetCurrent() # <<<<<<<<<<<<<< + * + * cdef inline void greenlet_init(): + */ + __Pyx_XDECREF(((PyObject *)__pyx_r)); + __pyx_t_1 = ((PyObject *)PyGreenlet_GetCurrent()); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 25, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = ((PyGreenlet *)__pyx_t_1); + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "gevent/__waiter.pxd":24 + * void PyGreenlet_Import() + * + * cdef inline greenlet getcurrent(): # <<<<<<<<<<<<<< + * return PyGreenlet_GetCurrent() + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__waiter.getcurrent", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF((PyObject *)__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/__waiter.pxd":27 + * return PyGreenlet_GetCurrent() + * + * cdef inline void greenlet_init(): # <<<<<<<<<<<<<< + * global _greenlet_imported + * if not _greenlet_imported: + */ + +static CYTHON_INLINE void __pyx_f_6gevent_8__waiter_greenlet_init(void) { + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("greenlet_init", 0); + + /* "gevent/__waiter.pxd":29 + * cdef inline void greenlet_init(): + * global _greenlet_imported + * if not _greenlet_imported: # <<<<<<<<<<<<<< + * PyGreenlet_Import() + * _greenlet_imported = True + */ + __pyx_t_1 = ((!(__pyx_v_6gevent_8__waiter__greenlet_imported != 0)) != 0); + if (__pyx_t_1) { + + /* "gevent/__waiter.pxd":30 + * global _greenlet_imported + * if not _greenlet_imported: + * PyGreenlet_Import() # <<<<<<<<<<<<<< + * _greenlet_imported = True + * + */ + PyGreenlet_Import(); + + /* "gevent/__waiter.pxd":31 + * if not _greenlet_imported: + * PyGreenlet_Import() + * _greenlet_imported = True # <<<<<<<<<<<<<< + * + * cdef class Waiter: + */ + __pyx_v_6gevent_8__waiter__greenlet_imported = 1; + + /* "gevent/__waiter.pxd":29 + * cdef inline void greenlet_init(): + * global _greenlet_imported + * if not _greenlet_imported: # <<<<<<<<<<<<<< + * PyGreenlet_Import() + * _greenlet_imported = True + */ + } + + /* "gevent/__waiter.pxd":27 + * return PyGreenlet_GetCurrent() + * + * cdef inline void greenlet_init(): # <<<<<<<<<<<<<< + * global _greenlet_imported + * if not _greenlet_imported: + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "gevent/_greenlet.pxd":27 + * + * @cython.final + * cdef inline greenlet getcurrent(): # <<<<<<<<<<<<<< + * return PyGreenlet_GetCurrent() + * + */ + +static CYTHON_INLINE PyGreenlet *__pyx_f_6gevent_9_greenlet_getcurrent(void) { + PyGreenlet *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("getcurrent", 0); + + /* "gevent/_greenlet.pxd":28 + * @cython.final + * cdef inline greenlet getcurrent(): + * return PyGreenlet_GetCurrent() # <<<<<<<<<<<<<< + * + * cdef bint _greenlet_imported + */ + __Pyx_XDECREF(((PyObject *)__pyx_r)); + __pyx_t_1 = ((PyObject *)PyGreenlet_GetCurrent()); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 28, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = ((PyGreenlet *)__pyx_t_1); + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "gevent/_greenlet.pxd":27 + * + * @cython.final + * cdef inline greenlet getcurrent(): # <<<<<<<<<<<<<< + * return PyGreenlet_GetCurrent() + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent._greenlet.getcurrent", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF((PyObject *)__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/_greenlet.pxd":32 + * cdef bint _greenlet_imported + * + * cdef inline void greenlet_init(): # <<<<<<<<<<<<<< + * global _greenlet_imported + * if not _greenlet_imported: + */ + +static CYTHON_INLINE void __pyx_f_6gevent_9_greenlet_greenlet_init(void) { + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("greenlet_init", 0); + + /* "gevent/_greenlet.pxd":34 + * cdef inline void greenlet_init(): + * global _greenlet_imported + * if not _greenlet_imported: # <<<<<<<<<<<<<< + * PyGreenlet_Import() + * _greenlet_imported = True + */ + __pyx_t_1 = ((!(__pyx_v_6gevent_9_greenlet__greenlet_imported != 0)) != 0); + if (__pyx_t_1) { + + /* "gevent/_greenlet.pxd":35 + * global _greenlet_imported + * if not _greenlet_imported: + * PyGreenlet_Import() # <<<<<<<<<<<<<< + * _greenlet_imported = True + * + */ + PyGreenlet_Import(); + + /* "gevent/_greenlet.pxd":36 + * if not _greenlet_imported: + * PyGreenlet_Import() + * _greenlet_imported = True # <<<<<<<<<<<<<< + * + * cdef extern from "Python.h": + */ + __pyx_v_6gevent_9_greenlet__greenlet_imported = 1; + + /* "gevent/_greenlet.pxd":34 + * cdef inline void greenlet_init(): + * global _greenlet_imported + * if not _greenlet_imported: # <<<<<<<<<<<<<< + * PyGreenlet_Import() + * _greenlet_imported = True + */ + } + + /* "gevent/_greenlet.pxd":32 + * cdef bint _greenlet_imported + * + * cdef inline void greenlet_init(): # <<<<<<<<<<<<<< + * global _greenlet_imported + * if not _greenlet_imported: + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "gevent/_local.pxd":26 + * void PyGreenlet_Import() + * + * cdef inline greenlet getcurrent(): # <<<<<<<<<<<<<< + * return PyGreenlet_GetCurrent() + * + */ + +static CYTHON_INLINE PyGreenlet *__pyx_f_6gevent_6_local_getcurrent(void) { + PyGreenlet *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("getcurrent", 0); + + /* "gevent/_local.pxd":27 + * + * cdef inline greenlet getcurrent(): + * return PyGreenlet_GetCurrent() # <<<<<<<<<<<<<< + * + * cdef inline void greenlet_init(): + */ + __Pyx_XDECREF(((PyObject *)__pyx_r)); + __pyx_t_1 = ((PyObject *)PyGreenlet_GetCurrent()); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 27, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = ((PyGreenlet *)__pyx_t_1); + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "gevent/_local.pxd":26 + * void PyGreenlet_Import() + * + * cdef inline greenlet getcurrent(): # <<<<<<<<<<<<<< + * return PyGreenlet_GetCurrent() + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent._local.getcurrent", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF((PyObject *)__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/_local.pxd":29 + * return PyGreenlet_GetCurrent() + * + * cdef inline void greenlet_init(): # <<<<<<<<<<<<<< + * global _greenlet_imported + * if not _greenlet_imported: + */ + +static CYTHON_INLINE void __pyx_f_6gevent_6_local_greenlet_init(void) { + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("greenlet_init", 0); + + /* "gevent/_local.pxd":31 + * cdef inline void greenlet_init(): + * global _greenlet_imported + * if not _greenlet_imported: # <<<<<<<<<<<<<< + * PyGreenlet_Import() + * _greenlet_imported = True + */ + __pyx_t_1 = ((!(__pyx_v_6gevent_6_local__greenlet_imported != 0)) != 0); + if (__pyx_t_1) { + + /* "gevent/_local.pxd":32 + * global _greenlet_imported + * if not _greenlet_imported: + * PyGreenlet_Import() # <<<<<<<<<<<<<< + * _greenlet_imported = True + * + */ + PyGreenlet_Import(); + + /* "gevent/_local.pxd":33 + * if not _greenlet_imported: + * PyGreenlet_Import() + * _greenlet_imported = True # <<<<<<<<<<<<<< + * + * + */ + __pyx_v_6gevent_6_local__greenlet_imported = 1; + + /* "gevent/_local.pxd":31 + * cdef inline void greenlet_init(): + * global _greenlet_imported + * if not _greenlet_imported: # <<<<<<<<<<<<<< + * PyGreenlet_Import() + * _greenlet_imported = True + */ + } + + /* "gevent/_local.pxd":29 + * return PyGreenlet_GetCurrent() + * + * cdef inline void greenlet_init(): # <<<<<<<<<<<<<< + * global _greenlet_imported + * if not _greenlet_imported: + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +static PyObject *__pyx_tp_new_6gevent_6_local__wrefdict(PyTypeObject *t, PyObject *a, PyObject *k) { + PyObject *o = (&PyDict_Type)->tp_new(t, a, k); + if (unlikely(!o)) return 0; + return o; +} + +static void __pyx_tp_dealloc_6gevent_6_local__wrefdict(PyObject *o) { + struct __pyx_obj_6gevent_6_local__wrefdict *p = (struct __pyx_obj_6gevent_6_local__wrefdict *)o; + PyObject_GC_UnTrack(o); + if (p->__weakref__) PyObject_ClearWeakRefs(o); + PyObject_GC_Track(o); + (&PyDict_Type)->tp_dealloc(o); +} + +static int __pyx_tp_traverse_6gevent_6_local__wrefdict(PyObject *o, visitproc v, void *a) { + int e; + if (!(&PyDict_Type)->tp_traverse); else { e = (&PyDict_Type)->tp_traverse(o,v,a); if (e) return e; } + return 0; +} + +static int __pyx_tp_clear_6gevent_6_local__wrefdict(PyObject *o) { + if (!(&PyDict_Type)->tp_clear); else (&PyDict_Type)->tp_clear(o); + return 0; +} + +static PyTypeObject __pyx_type_6gevent_6_local__wrefdict = { + PyVarObject_HEAD_INIT(0, 0) + "gevent._local._wrefdict", /*tp_name*/ + sizeof(struct __pyx_obj_6gevent_6_local__wrefdict), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6gevent_6_local__wrefdict, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + "A dict that can be weak referenced", /*tp_doc*/ + __pyx_tp_traverse_6gevent_6_local__wrefdict, /*tp_traverse*/ + __pyx_tp_clear_6gevent_6_local__wrefdict, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + 0, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6gevent_6_local__wrefdict, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static PyObject *__pyx_tp_new_6gevent_6_local__greenlet_deleted(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + struct __pyx_obj_6gevent_6_local__greenlet_deleted *p; + PyObject *o; + o = (*t->tp_alloc)(t, 0); + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_6gevent_6_local__greenlet_deleted *)o); + p->idt = Py_None; Py_INCREF(Py_None); + p->wrdicts = Py_None; Py_INCREF(Py_None); + return o; +} + +static void __pyx_tp_dealloc_6gevent_6_local__greenlet_deleted(PyObject *o) { + struct __pyx_obj_6gevent_6_local__greenlet_deleted *p = (struct __pyx_obj_6gevent_6_local__greenlet_deleted *)o; + PyObject_GC_UnTrack(o); + Py_CLEAR(p->idt); + Py_CLEAR(p->wrdicts); + (*Py_TYPE(o)->tp_free)(o); +} + +static int __pyx_tp_traverse_6gevent_6_local__greenlet_deleted(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_6gevent_6_local__greenlet_deleted *p = (struct __pyx_obj_6gevent_6_local__greenlet_deleted *)o; + if (p->idt) { + e = (*v)(p->idt, a); if (e) return e; + } + if (p->wrdicts) { + e = (*v)(p->wrdicts, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_6gevent_6_local__greenlet_deleted(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_6gevent_6_local__greenlet_deleted *p = (struct __pyx_obj_6gevent_6_local__greenlet_deleted *)o; + tmp = ((PyObject*)p->idt); + p->idt = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->wrdicts); + p->wrdicts = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyMethodDef __pyx_methods_6gevent_6_local__greenlet_deleted[] = { + {0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_6gevent_6_local__greenlet_deleted = { + PyVarObject_HEAD_INIT(0, 0) + "gevent._local._greenlet_deleted", /*tp_name*/ + sizeof(struct __pyx_obj_6gevent_6_local__greenlet_deleted), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6gevent_6_local__greenlet_deleted, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + __pyx_pw_6gevent_6_local_17_greenlet_deleted_3__call__, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + "_greenlet_deleted(idt, wrdicts)\n\n A weakref callback for when the greenlet\n is deleted.\n\n If the greenlet is a `gevent.greenlet.Greenlet` and\n supplies ``rawlink``, that will be used instead of a\n weakref.\n ", /*tp_doc*/ + __pyx_tp_traverse_6gevent_6_local__greenlet_deleted, /*tp_traverse*/ + __pyx_tp_clear_6gevent_6_local__greenlet_deleted, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6gevent_6_local__greenlet_deleted, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_pw_6gevent_6_local_17_greenlet_deleted_1__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6gevent_6_local__greenlet_deleted, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static PyObject *__pyx_tp_new_6gevent_6_local__local_deleted(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + struct __pyx_obj_6gevent_6_local__local_deleted *p; + PyObject *o; + o = (*t->tp_alloc)(t, 0); + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_6gevent_6_local__local_deleted *)o); + p->key = ((PyObject*)Py_None); Py_INCREF(Py_None); + p->wrthread = Py_None; Py_INCREF(Py_None); + p->greenlet_deleted = ((struct __pyx_obj_6gevent_6_local__greenlet_deleted *)Py_None); Py_INCREF(Py_None); + return o; +} + +static void __pyx_tp_dealloc_6gevent_6_local__local_deleted(PyObject *o) { + struct __pyx_obj_6gevent_6_local__local_deleted *p = (struct __pyx_obj_6gevent_6_local__local_deleted *)o; + PyObject_GC_UnTrack(o); + Py_CLEAR(p->key); + Py_CLEAR(p->wrthread); + Py_CLEAR(p->greenlet_deleted); + (*Py_TYPE(o)->tp_free)(o); +} + +static int __pyx_tp_traverse_6gevent_6_local__local_deleted(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_6gevent_6_local__local_deleted *p = (struct __pyx_obj_6gevent_6_local__local_deleted *)o; + if (p->wrthread) { + e = (*v)(p->wrthread, a); if (e) return e; + } + if (p->greenlet_deleted) { + e = (*v)(((PyObject *)p->greenlet_deleted), a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_6gevent_6_local__local_deleted(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_6gevent_6_local__local_deleted *p = (struct __pyx_obj_6gevent_6_local__local_deleted *)o; + tmp = ((PyObject*)p->wrthread); + p->wrthread = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->greenlet_deleted); + p->greenlet_deleted = ((struct __pyx_obj_6gevent_6_local__greenlet_deleted *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyMethodDef __pyx_methods_6gevent_6_local__local_deleted[] = { + {0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_6gevent_6_local__local_deleted = { + PyVarObject_HEAD_INIT(0, 0) + "gevent._local._local_deleted", /*tp_name*/ + sizeof(struct __pyx_obj_6gevent_6_local__local_deleted), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6gevent_6_local__local_deleted, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + __pyx_pw_6gevent_6_local_14_local_deleted_3__call__, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + "_local_deleted(key, wrthread, greenlet_deleted)", /*tp_doc*/ + __pyx_tp_traverse_6gevent_6_local__local_deleted, /*tp_traverse*/ + __pyx_tp_clear_6gevent_6_local__local_deleted, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6gevent_6_local__local_deleted, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_pw_6gevent_6_local_14_local_deleted_1__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6gevent_6_local__local_deleted, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static PyObject *__pyx_tp_new_6gevent_6_local__localimpl(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + struct __pyx_obj_6gevent_6_local__localimpl *p; + PyObject *o; + o = (*t->tp_alloc)(t, 0); + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_6gevent_6_local__localimpl *)o); + p->key = ((PyObject*)Py_None); Py_INCREF(Py_None); + p->dicts = ((PyObject*)Py_None); Py_INCREF(Py_None); + p->localargs = ((PyObject*)Py_None); Py_INCREF(Py_None); + p->localkwargs = ((PyObject*)Py_None); Py_INCREF(Py_None); + p->localtypeid = ((PyObject*)Py_None); Py_INCREF(Py_None); + return o; +} + +static void __pyx_tp_dealloc_6gevent_6_local__localimpl(PyObject *o) { + struct __pyx_obj_6gevent_6_local__localimpl *p = (struct __pyx_obj_6gevent_6_local__localimpl *)o; + PyObject_GC_UnTrack(o); + if (p->__weakref__) PyObject_ClearWeakRefs(o); + Py_CLEAR(p->key); + Py_CLEAR(p->dicts); + Py_CLEAR(p->localargs); + Py_CLEAR(p->localkwargs); + Py_CLEAR(p->localtypeid); + (*Py_TYPE(o)->tp_free)(o); +} + +static int __pyx_tp_traverse_6gevent_6_local__localimpl(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_6gevent_6_local__localimpl *p = (struct __pyx_obj_6gevent_6_local__localimpl *)o; + if (p->dicts) { + e = (*v)(p->dicts, a); if (e) return e; + } + if (p->localargs) { + e = (*v)(p->localargs, a); if (e) return e; + } + if (p->localkwargs) { + e = (*v)(p->localkwargs, a); if (e) return e; + } + if (p->localtypeid) { + e = (*v)(p->localtypeid, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_6gevent_6_local__localimpl(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_6gevent_6_local__localimpl *p = (struct __pyx_obj_6gevent_6_local__localimpl *)o; + tmp = ((PyObject*)p->dicts); + p->dicts = ((PyObject*)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->localargs); + p->localargs = ((PyObject*)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->localkwargs); + p->localkwargs = ((PyObject*)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->localtypeid); + p->localtypeid = ((PyObject*)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyMethodDef __pyx_methods_6gevent_6_local__localimpl[] = { + {0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_6gevent_6_local__localimpl = { + PyVarObject_HEAD_INIT(0, 0) + "gevent._local._localimpl", /*tp_name*/ + sizeof(struct __pyx_obj_6gevent_6_local__localimpl), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6gevent_6_local__localimpl, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + "_localimpl(args, kwargs, local_type, id_local)\nA class managing thread-local dicts", /*tp_doc*/ + __pyx_tp_traverse_6gevent_6_local__localimpl, /*tp_traverse*/ + __pyx_tp_clear_6gevent_6_local__localimpl, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6gevent_6_local__localimpl, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_pw_6gevent_6_local_10_localimpl_1__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6gevent_6_local__localimpl, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static PyObject *__pyx_tp_new_6gevent_6_local__localimpl_dict_entry(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + struct __pyx_obj_6gevent_6_local__localimpl_dict_entry *p; + PyObject *o; + o = (*t->tp_alloc)(t, 0); + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_6gevent_6_local__localimpl_dict_entry *)o); + p->wrgreenlet = Py_None; Py_INCREF(Py_None); + p->localdict = ((PyObject*)Py_None); Py_INCREF(Py_None); + return o; +} + +static void __pyx_tp_dealloc_6gevent_6_local__localimpl_dict_entry(PyObject *o) { + struct __pyx_obj_6gevent_6_local__localimpl_dict_entry *p = (struct __pyx_obj_6gevent_6_local__localimpl_dict_entry *)o; + PyObject_GC_UnTrack(o); + Py_CLEAR(p->wrgreenlet); + Py_CLEAR(p->localdict); + (*Py_TYPE(o)->tp_free)(o); +} + +static int __pyx_tp_traverse_6gevent_6_local__localimpl_dict_entry(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_6gevent_6_local__localimpl_dict_entry *p = (struct __pyx_obj_6gevent_6_local__localimpl_dict_entry *)o; + if (p->wrgreenlet) { + e = (*v)(p->wrgreenlet, a); if (e) return e; + } + if (p->localdict) { + e = (*v)(p->localdict, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_6gevent_6_local__localimpl_dict_entry(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_6gevent_6_local__localimpl_dict_entry *p = (struct __pyx_obj_6gevent_6_local__localimpl_dict_entry *)o; + tmp = ((PyObject*)p->wrgreenlet); + p->wrgreenlet = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->localdict); + p->localdict = ((PyObject*)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyMethodDef __pyx_methods_6gevent_6_local__localimpl_dict_entry[] = { + {0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_6gevent_6_local__localimpl_dict_entry = { + PyVarObject_HEAD_INIT(0, 0) + "gevent._local._localimpl_dict_entry", /*tp_name*/ + sizeof(struct __pyx_obj_6gevent_6_local__localimpl_dict_entry), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6gevent_6_local__localimpl_dict_entry, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + "_localimpl_dict_entry(wrgreenlet, localdict)\n\n The object that goes in the ``dicts`` of ``_localimpl``\n object for each thread.\n ", /*tp_doc*/ + __pyx_tp_traverse_6gevent_6_local__localimpl_dict_entry, /*tp_traverse*/ + __pyx_tp_clear_6gevent_6_local__localimpl_dict_entry, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6gevent_6_local__localimpl_dict_entry, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_pw_6gevent_6_local_21_localimpl_dict_entry_1__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6gevent_6_local__localimpl_dict_entry, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; +static struct __pyx_vtabstruct_6gevent_6_local_local __pyx_vtable_6gevent_6_local_local; + +static PyObject *__pyx_tp_new_6gevent_6_local_local(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_6gevent_6_local_local *p; + PyObject *o; + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_6gevent_6_local_local *)o); + p->__pyx_vtab = __pyx_vtabptr_6gevent_6_local_local; + p->_local__impl = ((struct __pyx_obj_6gevent_6_local__localimpl *)Py_None); Py_INCREF(Py_None); + p->_local_type_get_descriptors = ((PyObject*)Py_None); Py_INCREF(Py_None); + p->_local_type_set_or_del_descriptors = ((PyObject*)Py_None); Py_INCREF(Py_None); + p->_local_type_del_descriptors = ((PyObject*)Py_None); Py_INCREF(Py_None); + p->_local_type_set_descriptors = ((PyObject*)Py_None); Py_INCREF(Py_None); + p->_local_type_vars = ((PyObject*)Py_None); Py_INCREF(Py_None); + p->_local_type = ((PyTypeObject*)Py_None); Py_INCREF(Py_None); + if (unlikely(__pyx_pw_6gevent_6_local_5local_1__cinit__(o, a, k) < 0)) goto bad; + return o; + bad: + Py_DECREF(o); o = 0; + return NULL; +} + +static void __pyx_tp_dealloc_6gevent_6_local_local(PyObject *o) { + struct __pyx_obj_6gevent_6_local_local *p = (struct __pyx_obj_6gevent_6_local_local *)o; + #if CYTHON_USE_TP_FINALIZE + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + PyObject_GC_UnTrack(o); + Py_CLEAR(p->_local__impl); + Py_CLEAR(p->_local_type_get_descriptors); + Py_CLEAR(p->_local_type_set_or_del_descriptors); + Py_CLEAR(p->_local_type_del_descriptors); + Py_CLEAR(p->_local_type_set_descriptors); + Py_CLEAR(p->_local_type_vars); + Py_CLEAR(p->_local_type); + (*Py_TYPE(o)->tp_free)(o); +} + +static int __pyx_tp_traverse_6gevent_6_local_local(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_6gevent_6_local_local *p = (struct __pyx_obj_6gevent_6_local_local *)o; + if (p->_local__impl) { + e = (*v)(((PyObject *)p->_local__impl), a); if (e) return e; + } + if (p->_local_type_get_descriptors) { + e = (*v)(p->_local_type_get_descriptors, a); if (e) return e; + } + if (p->_local_type_set_or_del_descriptors) { + e = (*v)(p->_local_type_set_or_del_descriptors, a); if (e) return e; + } + if (p->_local_type_del_descriptors) { + e = (*v)(p->_local_type_del_descriptors, a); if (e) return e; + } + if (p->_local_type_set_descriptors) { + e = (*v)(p->_local_type_set_descriptors, a); if (e) return e; + } + if (p->_local_type_vars) { + e = (*v)(p->_local_type_vars, a); if (e) return e; + } + if (p->_local_type) { + e = (*v)(((PyObject *)p->_local_type), a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_6gevent_6_local_local(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_6gevent_6_local_local *p = (struct __pyx_obj_6gevent_6_local_local *)o; + tmp = ((PyObject*)p->_local__impl); + p->_local__impl = ((struct __pyx_obj_6gevent_6_local__localimpl *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->_local_type_get_descriptors); + p->_local_type_get_descriptors = ((PyObject*)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->_local_type_set_or_del_descriptors); + p->_local_type_set_or_del_descriptors = ((PyObject*)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->_local_type_del_descriptors); + p->_local_type_del_descriptors = ((PyObject*)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->_local_type_set_descriptors); + p->_local_type_set_descriptors = ((PyObject*)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->_local_type_vars); + p->_local_type_vars = ((PyObject*)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->_local_type); + p->_local_type = ((PyTypeObject*)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyObject *__pyx_tp_getattro_6gevent_6_local_local(PyObject *o, PyObject *n) { + PyObject *v = __pyx_pw_6gevent_6_local_5local_3__getattribute__(o, n); + return v; +} + +static int __pyx_tp_setattro_6gevent_6_local_local(PyObject *o, PyObject *n, PyObject *v) { + if (v) { + return __pyx_pw_6gevent_6_local_5local_5__setattr__(o, n, v); + } + else { + return __pyx_pw_6gevent_6_local_5local_7__delattr__(o, n); + } +} + +static PyMethodDef __pyx_methods_6gevent_6_local_local[] = { + {0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_6gevent_6_local_local = { + PyVarObject_HEAD_INIT(0, 0) + "gevent._local.local", /*tp_name*/ + sizeof(struct __pyx_obj_6gevent_6_local_local), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6gevent_6_local_local, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + __pyx_tp_getattro_6gevent_6_local_local, /*tp_getattro*/ + __pyx_tp_setattro_6gevent_6_local_local, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + "\n An object whose attributes are greenlet-local.\n ", /*tp_doc*/ + __pyx_tp_traverse_6gevent_6_local_local, /*tp_traverse*/ + __pyx_tp_clear_6gevent_6_local_local, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6gevent_6_local_local, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6gevent_6_local_local, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static PyMethodDef __pyx_methods[] = { + {0, 0, 0, 0} +}; + +#if PY_MAJOR_VERSION >= 3 +#if CYTHON_PEP489_MULTI_PHASE_INIT +static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ +static int __pyx_pymod_exec__local(PyObject* module); /*proto*/ +static PyModuleDef_Slot __pyx_moduledef_slots[] = { + {Py_mod_create, (void*)__pyx_pymod_create}, + {Py_mod_exec, (void*)__pyx_pymod_exec__local}, + {0, NULL} +}; +#endif + +static struct PyModuleDef __pyx_moduledef = { + PyModuleDef_HEAD_INIT, + "_local", + __pyx_k_Greenlet_local_objects_This_mod, /* m_doc */ + #if CYTHON_PEP489_MULTI_PHASE_INIT + 0, /* m_size */ + #else + -1, /* m_size */ + #endif + __pyx_methods /* m_methods */, + #if CYTHON_PEP489_MULTI_PHASE_INIT + __pyx_moduledef_slots, /* m_slots */ + #else + NULL, /* m_reload */ + #endif + NULL, /* m_traverse */ + NULL, /* m_clear */ + NULL /* m_free */ +}; +#endif +#ifndef CYTHON_SMALL_CODE +#if defined(__clang__) + #define CYTHON_SMALL_CODE +#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) + #define CYTHON_SMALL_CODE __attribute__((cold)) +#else + #define CYTHON_SMALL_CODE +#endif +#endif + +static __Pyx_StringTabEntry __pyx_string_tab[] = { + {&__pyx_n_s_AttributeError, __pyx_k_AttributeError, sizeof(__pyx_k_AttributeError), 0, 0, 1, 1}, + {&__pyx_kp_s_Initialization_arguments_are_not, __pyx_k_Initialization_arguments_are_not, sizeof(__pyx_k_Initialization_arguments_are_not), 0, 0, 1, 0}, + {&__pyx_n_s_KeyError, __pyx_k_KeyError, sizeof(__pyx_k_KeyError), 0, 0, 1, 1}, + {&__pyx_n_s_None, __pyx_k_None, sizeof(__pyx_k_None), 0, 0, 1, 1}, + {&__pyx_n_s_PY2, __pyx_k_PY2, sizeof(__pyx_k_PY2), 0, 0, 1, 1}, + {&__pyx_n_s_PYPY, __pyx_k_PYPY, sizeof(__pyx_k_PYPY), 0, 0, 1, 1}, + {&__pyx_n_s_PYPY_2, __pyx_k_PYPY_2, sizeof(__pyx_k_PYPY_2), 0, 0, 1, 1}, + {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1}, + {&__pyx_n_s_all, __pyx_k_all, sizeof(__pyx_k_all), 0, 0, 1, 1}, + {&__pyx_n_s_all_local_dicts_for_greenlet, __pyx_k_all_local_dicts_for_greenlet, sizeof(__pyx_k_all_local_dicts_for_greenlet), 0, 0, 1, 1}, + {&__pyx_n_s_args, __pyx_k_args, sizeof(__pyx_k_args), 0, 0, 1, 1}, + {&__pyx_n_s_cinit, __pyx_k_cinit, sizeof(__pyx_k_cinit), 0, 0, 1, 1}, + {&__pyx_n_s_class, __pyx_k_class, sizeof(__pyx_k_class), 0, 0, 1, 1}, + {&__pyx_n_s_classmethod, __pyx_k_classmethod, sizeof(__pyx_k_classmethod), 0, 0, 1, 1}, + {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, + {&__pyx_n_s_cls, __pyx_k_cls, sizeof(__pyx_k_cls), 0, 0, 1, 1}, + {&__pyx_n_s_copy, __pyx_k_copy, sizeof(__pyx_k_copy), 0, 0, 1, 1}, + {&__pyx_n_s_copy_2, __pyx_k_copy_2, sizeof(__pyx_k_copy_2), 0, 0, 1, 1}, + {&__pyx_n_s_delete, __pyx_k_delete, sizeof(__pyx_k_delete), 0, 0, 1, 1}, + {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1}, + {&__pyx_n_s_dicts, __pyx_k_dicts, sizeof(__pyx_k_dicts), 0, 0, 1, 1}, + {&__pyx_n_s_get, __pyx_k_get, sizeof(__pyx_k_get), 0, 0, 1, 1}, + {&__pyx_n_s_get_2, __pyx_k_get_2, sizeof(__pyx_k_get_2), 0, 0, 1, 1}, + {&__pyx_n_s_getattr, __pyx_k_getattr, sizeof(__pyx_k_getattr), 0, 0, 1, 1}, + {&__pyx_n_s_getattribute, __pyx_k_getattribute, sizeof(__pyx_k_getattribute), 0, 0, 1, 1}, + {&__pyx_n_s_getcurrent, __pyx_k_getcurrent, sizeof(__pyx_k_getcurrent), 0, 0, 1, 1}, + {&__pyx_n_s_gevent__compat, __pyx_k_gevent__compat, sizeof(__pyx_k_gevent__compat), 0, 0, 1, 1}, + {&__pyx_n_s_gevent__local, __pyx_k_gevent__local, sizeof(__pyx_k_gevent__local), 0, 0, 1, 1}, + {&__pyx_n_s_gevent__util, __pyx_k_gevent__util, sizeof(__pyx_k_gevent__util), 0, 0, 1, 1}, + {&__pyx_n_s_gevent_local_localimpl, __pyx_k_gevent_local_localimpl, sizeof(__pyx_k_gevent_local_localimpl), 0, 0, 1, 1}, + {&__pyx_n_s_greenlet, __pyx_k_greenlet, sizeof(__pyx_k_greenlet), 0, 0, 1, 1}, + {&__pyx_n_s_greenlet_deleted, __pyx_k_greenlet_deleted, sizeof(__pyx_k_greenlet_deleted), 0, 0, 1, 1}, + {&__pyx_n_s_greenlet_deleted_2, __pyx_k_greenlet_deleted_2, sizeof(__pyx_k_greenlet_deleted_2), 0, 0, 1, 1}, + {&__pyx_n_s_greenlet_imported, __pyx_k_greenlet_imported, sizeof(__pyx_k_greenlet_imported), 0, 0, 1, 1}, + {&__pyx_n_s_greenlet_init, __pyx_k_greenlet_init, sizeof(__pyx_k_greenlet_init), 0, 0, 1, 1}, + {&__pyx_n_s_id, __pyx_k_id, sizeof(__pyx_k_id), 0, 0, 1, 1}, + {&__pyx_n_s_id_local, __pyx_k_id_local, sizeof(__pyx_k_id_local), 0, 0, 1, 1}, + {&__pyx_n_s_idt, __pyx_k_idt, sizeof(__pyx_k_idt), 0, 0, 1, 1}, + {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, + {&__pyx_n_s_import_c_accel, __pyx_k_import_c_accel, sizeof(__pyx_k_import_c_accel), 0, 0, 1, 1}, + {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1}, + {&__pyx_n_s_items, __pyx_k_items, sizeof(__pyx_k_items), 0, 0, 1, 1}, + {&__pyx_n_s_key, __pyx_k_key, sizeof(__pyx_k_key), 0, 0, 1, 1}, + {&__pyx_n_s_key_prefix, __pyx_k_key_prefix, sizeof(__pyx_k_key_prefix), 0, 0, 1, 1}, + {&__pyx_n_s_kw, __pyx_k_kw, sizeof(__pyx_k_kw), 0, 0, 1, 1}, + {&__pyx_n_s_kwargs, __pyx_k_kwargs, sizeof(__pyx_k_kwargs), 0, 0, 1, 1}, + {&__pyx_n_s_lambda, __pyx_k_lambda, sizeof(__pyx_k_lambda), 0, 0, 1, 1}, + {&__pyx_n_s_local, __pyx_k_local, sizeof(__pyx_k_local), 0, 0, 1, 1}, + {&__pyx_n_s_local___copy, __pyx_k_local___copy, sizeof(__pyx_k_local___copy), 0, 0, 1, 1}, + {&__pyx_n_s_local__impl, __pyx_k_local__impl, sizeof(__pyx_k_local__impl), 0, 0, 1, 1}, + {&__pyx_n_s_local_attrs, __pyx_k_local_attrs, sizeof(__pyx_k_local_attrs), 0, 0, 1, 1}, + {&__pyx_n_s_local_deleted, __pyx_k_local_deleted, sizeof(__pyx_k_local_deleted), 0, 0, 1, 1}, + {&__pyx_n_s_local_type, __pyx_k_local_type, sizeof(__pyx_k_local_type), 0, 0, 1, 1}, + {&__pyx_n_s_local_type_2, __pyx_k_local_type_2, sizeof(__pyx_k_local_type_2), 0, 0, 1, 1}, + {&__pyx_n_s_local_type_del_descriptors, __pyx_k_local_type_del_descriptors, sizeof(__pyx_k_local_type_del_descriptors), 0, 0, 1, 1}, + {&__pyx_n_s_local_type_get_descriptors, __pyx_k_local_type_get_descriptors, sizeof(__pyx_k_local_type_get_descriptors), 0, 0, 1, 1}, + {&__pyx_n_s_local_type_set_descriptors, __pyx_k_local_type_set_descriptors, sizeof(__pyx_k_local_type_set_descriptors), 0, 0, 1, 1}, + {&__pyx_n_s_local_type_set_or_del_descripto, __pyx_k_local_type_set_or_del_descripto, sizeof(__pyx_k_local_type_set_or_del_descripto), 0, 0, 1, 1}, + {&__pyx_n_s_local_type_vars, __pyx_k_local_type_vars, sizeof(__pyx_k_local_type_vars), 0, 0, 1, 1}, + {&__pyx_n_s_localargs, __pyx_k_localargs, sizeof(__pyx_k_localargs), 0, 0, 1, 1}, + {&__pyx_n_s_localdict, __pyx_k_localdict, sizeof(__pyx_k_localdict), 0, 0, 1, 1}, + {&__pyx_n_s_localimpl, __pyx_k_localimpl, sizeof(__pyx_k_localimpl), 0, 0, 1, 1}, + {&__pyx_n_s_localimpl_dict_entry, __pyx_k_localimpl_dict_entry, sizeof(__pyx_k_localimpl_dict_entry), 0, 0, 1, 1}, + {&__pyx_n_s_localkwargs, __pyx_k_localkwargs, sizeof(__pyx_k_localkwargs), 0, 0, 1, 1}, + {&__pyx_n_s_localtypeid, __pyx_k_localtypeid, sizeof(__pyx_k_localtypeid), 0, 0, 1, 1}, + {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, + {&__pyx_n_s_marker, __pyx_k_marker, sizeof(__pyx_k_marker), 0, 0, 1, 1}, + {&__pyx_n_s_mro, __pyx_k_mro, sizeof(__pyx_k_mro), 0, 0, 1, 1}, + {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, + {&__pyx_n_s_new, __pyx_k_new, sizeof(__pyx_k_new), 0, 0, 1, 1}, + {&__pyx_n_s_object, __pyx_k_object, sizeof(__pyx_k_object), 0, 0, 1, 1}, + {&__pyx_n_s_pop, __pyx_k_pop, sizeof(__pyx_k_pop), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_capi, __pyx_k_pyx_capi, sizeof(__pyx_k_pyx_capi), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1}, + {&__pyx_kp_s_r_object_attribute___dict___is, __pyx_k_r_object_attribute___dict___is, sizeof(__pyx_k_r_object_attribute___dict___is), 0, 0, 1, 0}, + {&__pyx_kp_s_r_object_has_no_attribute_s, __pyx_k_r_object_has_no_attribute_s, sizeof(__pyx_k_r_object_has_no_attribute_s), 0, 0, 1, 0}, + {&__pyx_n_s_rawlink, __pyx_k_rawlink, sizeof(__pyx_k_rawlink), 0, 0, 1, 1}, + {&__pyx_n_s_ref, __pyx_k_ref, sizeof(__pyx_k_ref), 0, 0, 1, 1}, + {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1}, + {&__pyx_n_s_set, __pyx_k_set, sizeof(__pyx_k_set), 0, 0, 1, 1}, + {&__pyx_n_s_setattr, __pyx_k_setattr, sizeof(__pyx_k_setattr), 0, 0, 1, 1}, + {&__pyx_n_s_slots, __pyx_k_slots, sizeof(__pyx_k_slots), 0, 0, 1, 1}, + {&__pyx_kp_s_src_gevent_local_py, __pyx_k_src_gevent_local_py, sizeof(__pyx_k_src_gevent_local_py), 0, 0, 1, 0}, + {&__pyx_n_s_super, __pyx_k_super, sizeof(__pyx_k_super), 0, 0, 1, 1}, + {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, + {&__pyx_n_s_unlink, __pyx_k_unlink, sizeof(__pyx_k_unlink), 0, 0, 1, 1}, + {&__pyx_n_s_unused, __pyx_k_unused, sizeof(__pyx_k_unused), 0, 0, 1, 1}, + {&__pyx_n_s_weakref, __pyx_k_weakref, sizeof(__pyx_k_weakref), 0, 0, 1, 1}, + {&__pyx_n_s_weakref_2, __pyx_k_weakref_2, sizeof(__pyx_k_weakref_2), 0, 0, 1, 1}, + {&__pyx_n_s_wrdicts, __pyx_k_wrdicts, sizeof(__pyx_k_wrdicts), 0, 0, 1, 1}, + {&__pyx_n_s_wrefdict, __pyx_k_wrefdict, sizeof(__pyx_k_wrefdict), 0, 0, 1, 1}, + {&__pyx_n_s_wrgreenlet, __pyx_k_wrgreenlet, sizeof(__pyx_k_wrgreenlet), 0, 0, 1, 1}, + {&__pyx_n_s_wrthread, __pyx_k_wrthread, sizeof(__pyx_k_wrthread), 0, 0, 1, 1}, + {0, 0, 0, 0, 0, 0, 0} +}; +static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { + __pyx_builtin___import__ = __Pyx_GetBuiltinName(__pyx_n_s_import); if (!__pyx_builtin___import__) __PYX_ERR(0, 160, __pyx_L1_error) + __pyx_builtin_object = __Pyx_GetBuiltinName(__pyx_n_s_object); if (!__pyx_builtin_object) __PYX_ERR(0, 331, __pyx_L1_error) + __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(0, 588, __pyx_L1_error) + __pyx_builtin_classmethod = __Pyx_GetBuiltinName(__pyx_n_s_classmethod); if (!__pyx_builtin_classmethod) __PYX_ERR(0, 597, __pyx_L1_error) + __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(0, 192, __pyx_L1_error) + __pyx_builtin_AttributeError = __Pyx_GetBuiltinName(__pyx_n_s_AttributeError); if (!__pyx_builtin_AttributeError) __PYX_ERR(0, 246, __pyx_L1_error) + __pyx_builtin_KeyError = __Pyx_GetBuiltinName(__pyx_n_s_KeyError); if (!__pyx_builtin_KeyError) __PYX_ERR(0, 341, __pyx_L1_error) + __pyx_builtin_super = __Pyx_GetBuiltinName(__pyx_n_s_super); if (!__pyx_builtin_super) __PYX_ERR(0, 575, __pyx_L1_error) + return 0; + __pyx_L1_error:; + return -1; +} + +static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); + + /* "src/gevent/local.py":160 + * + * + * locals()['getcurrent'] = __import__('greenlet').getcurrent # <<<<<<<<<<<<<< + * locals()['greenlet_init'] = lambda: None + * + */ + __pyx_tuple_ = PyTuple_Pack(1, __pyx_n_s_greenlet); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 160, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple_); + __Pyx_GIVEREF(__pyx_tuple_); + + /* "src/gevent/local.py":179 + * # That final tuple is actually a localimpl_dict_entry object. + * + * def all_local_dicts_for_greenlet(greenlet): # <<<<<<<<<<<<<< + * """ + * Internal debug helper for getting the local values associated + */ + __pyx_tuple__2 = PyTuple_Pack(1, __pyx_n_s_greenlet); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 179, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2); + __Pyx_GIVEREF(__pyx_tuple__2); + __pyx_codeobj__3 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_local_py, __pyx_n_s_all_local_dicts_for_greenlet, 179, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__3)) __PYX_ERR(0, 179, __pyx_L1_error) + + /* "src/gevent/local.py":222 + * weakref. + * """ + * __slots__ = ('idt', 'wrdicts') # <<<<<<<<<<<<<< + * + * def __init__(self, idt, wrdicts): + */ + __pyx_tuple__4 = PyTuple_Pack(2, __pyx_n_s_idt, __pyx_n_s_wrdicts); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 222, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__4); + __Pyx_GIVEREF(__pyx_tuple__4); + + /* "src/gevent/local.py":234 + * + * class _local_deleted(object): + * __slots__ = ('key', 'wrthread', 'greenlet_deleted') # <<<<<<<<<<<<<< + * + * def __init__(self, key, wrthread, greenlet_deleted): + */ + __pyx_tuple__5 = PyTuple_Pack(3, __pyx_n_s_key, __pyx_n_s_wrthread, __pyx_n_s_greenlet_deleted); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 234, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__5); + __Pyx_GIVEREF(__pyx_tuple__5); + + /* "src/gevent/local.py":254 + * class _localimpl(object): + * """A class managing thread-local dicts""" + * __slots__ = ('key', 'dicts', # <<<<<<<<<<<<<< + * 'localargs', 'localkwargs', + * 'localtypeid', + */ + __pyx_tuple__6 = PyTuple_Pack(6, __pyx_n_s_key, __pyx_n_s_dicts, __pyx_n_s_localargs, __pyx_n_s_localkwargs, __pyx_n_s_localtypeid, __pyx_n_s_weakref_2); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 254, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__6); + __Pyx_GIVEREF(__pyx_tuple__6); + + /* "src/gevent/local.py":280 + * # This is a class, not just a tuple, so that cython can optimize + * # attribute access + * __slots__ = ('wrgreenlet', 'localdict') # <<<<<<<<<<<<<< + * + * def __init__(self, wrgreenlet, localdict): + */ + __pyx_tuple__7 = PyTuple_Pack(2, __pyx_n_s_wrgreenlet, __pyx_n_s_localdict); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 280, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__7); + __Pyx_GIVEREF(__pyx_tuple__7); + + /* "src/gevent/local.py":517 + * raise AttributeError(name) + * + * def __copy__(self): # <<<<<<<<<<<<<< + * impl = self._local__impl + * entry = impl.dicts[id(getcurrent())] # pylint:disable=undefined-variable + */ + __pyx_tuple__8 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 517, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__8); + __Pyx_GIVEREF(__pyx_tuple__8); + __pyx_codeobj__9 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__8, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_local_py, __pyx_n_s_copy, 517, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__9)) __PYX_ERR(0, 517, __pyx_L1_error) + + /* "src/gevent/local.py":574 + * # (e.g., on PyPy). So we set it at runtime. Cython + * # will raise an error if we're compiled. + * def __new__(cls, *args, **kw): # <<<<<<<<<<<<<< + * self = super(local, cls).__new__(cls) + * # We get the cls in *args for some reason + */ + __pyx_tuple__10 = PyTuple_Pack(4, __pyx_n_s_cls, __pyx_n_s_args, __pyx_n_s_kw, __pyx_n_s_self); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 574, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__10); + __Pyx_GIVEREF(__pyx_tuple__10); + __pyx_codeobj__11 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__10, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_local_py, __pyx_n_s_new, 574, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__11)) __PYX_ERR(0, 574, __pyx_L1_error) + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} + +static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { + __pyx_umethod_PyDict_Type_get.type = (PyObject*)&PyDict_Type; + if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + return 0; + __pyx_L1_error:; + return -1; +} + +static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/ + +static int __Pyx_modinit_global_init_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); + /*--- Global init code ---*/ + __pyx_v_6gevent_6_local_ref = Py_None; Py_INCREF(Py_None); + __pyx_v_6gevent_6_local_copy = Py_None; Py_INCREF(Py_None); + __pyx_v_6gevent_6_local__marker = Py_None; Py_INCREF(Py_None); + __pyx_v_6gevent_6_local_key_prefix = ((PyObject*)Py_None); Py_INCREF(Py_None); + __pyx_v_6gevent_6_local__local_attrs = ((PyObject*)Py_None); Py_INCREF(Py_None); + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_variable_export_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); + /*--- Variable export code ---*/ + if (__Pyx_ExportVoidPtr(__pyx_n_s_PYPY, (void *)&__pyx_v_6gevent_6_local__PYPY, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportVoidPtr(__pyx_n_s_ref, (void *)&__pyx_v_6gevent_6_local_ref, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportVoidPtr(__pyx_n_s_copy_2, (void *)&__pyx_v_6gevent_6_local_copy, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportVoidPtr(__pyx_n_s_marker, (void *)&__pyx_v_6gevent_6_local__marker, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportVoidPtr(__pyx_n_s_key_prefix, (void *)&__pyx_v_6gevent_6_local_key_prefix, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportVoidPtr(__pyx_n_s_greenlet_imported, (void *)&__pyx_v_6gevent_6_local__greenlet_imported, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportVoidPtr(__pyx_n_s_local_attrs, (void *)&__pyx_v_6gevent_6_local__local_attrs, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_modinit_function_export_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); + /*--- Function export code ---*/ + if (__Pyx_ExportFunction("_init", (void (*)(void))__pyx_f_6gevent_6_local__init, "void (void)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportFunction("_localimpl_create_dict", (void (*)(void))__pyx_f_6gevent_6_local__localimpl_create_dict, "PyObject *(struct __pyx_obj_6gevent_6_local__localimpl *, PyGreenlet *, PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportFunction("_local_get_dict", (void (*)(void))__pyx_f_6gevent_6_local__local_get_dict, "PyObject *(struct __pyx_obj_6gevent_6_local_local *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportFunction("_local__copy_dict_from", (void (*)(void))__pyx_f_6gevent_6_local__local__copy_dict_from, "PyObject *(struct __pyx_obj_6gevent_6_local_local *, struct __pyx_obj_6gevent_6_local__localimpl *, PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportFunction("_local_find_descriptors", (void (*)(void))__pyx_f_6gevent_6_local__local_find_descriptors, "PyObject *(struct __pyx_obj_6gevent_6_local_local *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportFunction("all_local_dicts_for_greenlet", (void (*)(void))__pyx_f_6gevent_6_local_all_local_dicts_for_greenlet, "PyObject *(PyGreenlet *, int __pyx_skip_dispatch)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_modinit_type_init_code(void) { + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); + /*--- Type init code ---*/ + __pyx_t_1 = PyImport_ImportModule("greenlet"); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 17, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_ptype_6gevent_6_local_greenlet = __Pyx_ImportType(__pyx_t_1, "greenlet", "greenlet", sizeof(PyGreenlet), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_6_local_greenlet) __PYX_ERR(4, 17, __pyx_L1_error) + __pyx_type_6gevent_6_local__wrefdict.tp_base = (&PyDict_Type); + if (PyType_Ready(&__pyx_type_6gevent_6_local__wrefdict) < 0) __PYX_ERR(0, 210, __pyx_L1_error) + __pyx_type_6gevent_6_local__wrefdict.tp_print = 0; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6gevent_6_local__wrefdict.tp_dictoffset && __pyx_type_6gevent_6_local__wrefdict.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_type_6gevent_6_local__wrefdict.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + } + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_wrefdict, (PyObject *)&__pyx_type_6gevent_6_local__wrefdict) < 0) __PYX_ERR(0, 210, __pyx_L1_error) + if (__pyx_type_6gevent_6_local__wrefdict.tp_weaklistoffset == 0) __pyx_type_6gevent_6_local__wrefdict.tp_weaklistoffset = offsetof(struct __pyx_obj_6gevent_6_local__wrefdict, __weakref__); + __pyx_ptype_6gevent_6_local__wrefdict = &__pyx_type_6gevent_6_local__wrefdict; + if (PyType_Ready(&__pyx_type_6gevent_6_local__greenlet_deleted) < 0) __PYX_ERR(0, 213, __pyx_L1_error) + __pyx_type_6gevent_6_local__greenlet_deleted.tp_print = 0; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6gevent_6_local__greenlet_deleted.tp_dictoffset && __pyx_type_6gevent_6_local__greenlet_deleted.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_type_6gevent_6_local__greenlet_deleted.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + } + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_greenlet_deleted_2, (PyObject *)&__pyx_type_6gevent_6_local__greenlet_deleted) < 0) __PYX_ERR(0, 213, __pyx_L1_error) + __pyx_ptype_6gevent_6_local__greenlet_deleted = &__pyx_type_6gevent_6_local__greenlet_deleted; + if (PyType_Ready(&__pyx_type_6gevent_6_local__local_deleted) < 0) __PYX_ERR(0, 233, __pyx_L1_error) + __pyx_type_6gevent_6_local__local_deleted.tp_print = 0; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6gevent_6_local__local_deleted.tp_dictoffset && __pyx_type_6gevent_6_local__local_deleted.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_type_6gevent_6_local__local_deleted.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + } + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_local_deleted, (PyObject *)&__pyx_type_6gevent_6_local__local_deleted) < 0) __PYX_ERR(0, 233, __pyx_L1_error) + __pyx_ptype_6gevent_6_local__local_deleted = &__pyx_type_6gevent_6_local__local_deleted; + if (PyType_Ready(&__pyx_type_6gevent_6_local__localimpl) < 0) __PYX_ERR(0, 252, __pyx_L1_error) + __pyx_type_6gevent_6_local__localimpl.tp_print = 0; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6gevent_6_local__localimpl.tp_dictoffset && __pyx_type_6gevent_6_local__localimpl.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_type_6gevent_6_local__localimpl.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + } + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_localimpl, (PyObject *)&__pyx_type_6gevent_6_local__localimpl) < 0) __PYX_ERR(0, 252, __pyx_L1_error) + if (__pyx_type_6gevent_6_local__localimpl.tp_weaklistoffset == 0) __pyx_type_6gevent_6_local__localimpl.tp_weaklistoffset = offsetof(struct __pyx_obj_6gevent_6_local__localimpl, __weakref__); + __pyx_ptype_6gevent_6_local__localimpl = &__pyx_type_6gevent_6_local__localimpl; + if (PyType_Ready(&__pyx_type_6gevent_6_local__localimpl_dict_entry) < 0) __PYX_ERR(0, 273, __pyx_L1_error) + __pyx_type_6gevent_6_local__localimpl_dict_entry.tp_print = 0; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6gevent_6_local__localimpl_dict_entry.tp_dictoffset && __pyx_type_6gevent_6_local__localimpl_dict_entry.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_type_6gevent_6_local__localimpl_dict_entry.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + } + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_localimpl_dict_entry, (PyObject *)&__pyx_type_6gevent_6_local__localimpl_dict_entry) < 0) __PYX_ERR(0, 273, __pyx_L1_error) + __pyx_ptype_6gevent_6_local__localimpl_dict_entry = &__pyx_type_6gevent_6_local__localimpl_dict_entry; + __pyx_vtabptr_6gevent_6_local_local = &__pyx_vtable_6gevent_6_local_local; + __pyx_vtable_6gevent_6_local_local.__pyx___copy__ = (struct __pyx_obj_6gevent_6_local_local *(*)(struct __pyx_obj_6gevent_6_local_local *, int __pyx_skip_dispatch))__pyx_f_6gevent_6_local_5local___copy__; + if (PyType_Ready(&__pyx_type_6gevent_6_local_local) < 0) __PYX_ERR(0, 361, __pyx_L1_error) + __pyx_type_6gevent_6_local_local.tp_print = 0; + if (__Pyx_SetVtable(__pyx_type_6gevent_6_local_local.tp_dict, __pyx_vtabptr_6gevent_6_local_local) < 0) __PYX_ERR(0, 361, __pyx_L1_error) + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_local, (PyObject *)&__pyx_type_6gevent_6_local_local) < 0) __PYX_ERR(0, 361, __pyx_L1_error) + __pyx_ptype_6gevent_6_local_local = &__pyx_type_6gevent_6_local_local; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_modinit_type_import_code(void) { + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); + /*--- Type import code ---*/ + __pyx_t_1 = PyImport_ImportModule("weakref"); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 5, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_ptype_6gevent_7__ident_ref = __Pyx_ImportType(__pyx_t_1, "weakref", "ref", sizeof(PyWeakReference), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_7__ident_ref) __PYX_ERR(5, 5, __pyx_L1_error) + __pyx_t_2 = PyImport_ImportModule("gevent.__ident"); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 15, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_ptype_6gevent_7__ident_ValuedWeakRef = __Pyx_ImportType(__pyx_t_2, "gevent.__ident", "ValuedWeakRef", sizeof(struct __pyx_obj_6gevent_7__ident_ValuedWeakRef), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_7__ident_ValuedWeakRef) __PYX_ERR(5, 15, __pyx_L1_error) + __pyx_ptype_6gevent_7__ident_IdentRegistry = __Pyx_ImportType(__pyx_t_2, "gevent.__ident", "IdentRegistry", sizeof(struct __pyx_obj_6gevent_7__ident_IdentRegistry), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_7__ident_IdentRegistry) __PYX_ERR(5, 19, __pyx_L1_error) + __pyx_vtabptr_6gevent_7__ident_IdentRegistry = (struct __pyx_vtabstruct_6gevent_7__ident_IdentRegistry*)__Pyx_GetVtable(__pyx_ptype_6gevent_7__ident_IdentRegistry->tp_dict); if (unlikely(!__pyx_vtabptr_6gevent_7__ident_IdentRegistry)) __PYX_ERR(5, 19, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyImport_ImportModule("greenlet"); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_ptype_6gevent_21__greenlet_primitives_greenlet = __Pyx_ImportType(__pyx_t_2, "greenlet", "greenlet", sizeof(PyGreenlet), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_21__greenlet_primitives_greenlet) __PYX_ERR(1, 12, __pyx_L1_error) + __pyx_t_1 = PyImport_ImportModule("gevent.__greenlet_primitives"); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 37, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_ptype_6gevent_21__greenlet_primitives_TrackedRawGreenlet = __Pyx_ImportType(__pyx_t_1, "gevent.__greenlet_primitives", "TrackedRawGreenlet", sizeof(struct __pyx_obj_6gevent_21__greenlet_primitives_TrackedRawGreenlet), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_21__greenlet_primitives_TrackedRawGreenlet) __PYX_ERR(1, 37, __pyx_L1_error) + __pyx_ptype_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop = __Pyx_ImportType(__pyx_t_1, "gevent.__greenlet_primitives", "SwitchOutGreenletWithLoop", sizeof(struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop) __PYX_ERR(1, 40, __pyx_L1_error) + __pyx_vtabptr_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop = (struct __pyx_vtabstruct_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop*)__Pyx_GetVtable(__pyx_ptype_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop->tp_dict); if (unlikely(!__pyx_vtabptr_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop)) __PYX_ERR(1, 40, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyImport_ImportModule("greenlet"); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 15, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_ptype_6gevent_8__waiter_greenlet = __Pyx_ImportType(__pyx_t_1, "greenlet", "greenlet", sizeof(PyGreenlet), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_8__waiter_greenlet) __PYX_ERR(2, 15, __pyx_L1_error) + __pyx_t_2 = PyImport_ImportModule("gevent.__waiter"); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 33, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_ptype_6gevent_8__waiter_Waiter = __Pyx_ImportType(__pyx_t_2, "gevent.__waiter", "Waiter", sizeof(struct __pyx_obj_6gevent_8__waiter_Waiter), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_8__waiter_Waiter) __PYX_ERR(2, 33, __pyx_L1_error) + __pyx_vtabptr_6gevent_8__waiter_Waiter = (struct __pyx_vtabstruct_6gevent_8__waiter_Waiter*)__Pyx_GetVtable(__pyx_ptype_6gevent_8__waiter_Waiter->tp_dict); if (unlikely(!__pyx_vtabptr_6gevent_8__waiter_Waiter)) __PYX_ERR(2, 33, __pyx_L1_error) + __pyx_ptype_6gevent_8__waiter_MultipleWaiter = __Pyx_ImportType(__pyx_t_2, "gevent.__waiter", "MultipleWaiter", sizeof(struct __pyx_obj_6gevent_8__waiter_MultipleWaiter), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_8__waiter_MultipleWaiter) __PYX_ERR(2, 47, __pyx_L1_error) + __pyx_vtabptr_6gevent_8__waiter_MultipleWaiter = (struct __pyx_vtabstruct_6gevent_8__waiter_MultipleWaiter*)__Pyx_GetVtable(__pyx_ptype_6gevent_8__waiter_MultipleWaiter->tp_dict); if (unlikely(!__pyx_vtabptr_6gevent_8__waiter_MultipleWaiter)) __PYX_ERR(2, 47, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyImport_ImportModule("greenlet"); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 17, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_ptype_6gevent_9_greenlet_greenlet = __Pyx_ImportType(__pyx_t_2, "greenlet", "greenlet", sizeof(PyGreenlet), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_9_greenlet_greenlet) __PYX_ERR(3, 17, __pyx_L1_error) + __pyx_t_1 = PyImport_ImportModule("types"); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 40, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_ptype_6gevent_9_greenlet_CodeType = __Pyx_ImportType(__pyx_t_1, "types", "CodeType", sizeof(PyCodeObject), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_9_greenlet_CodeType) __PYX_ERR(3, 40, __pyx_L1_error) + __pyx_ptype_6gevent_9_greenlet_FrameType = __Pyx_ImportType(__pyx_t_1, "types", "FrameType", sizeof(PyFrameObject), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_9_greenlet_FrameType) __PYX_ERR(3, 45, __pyx_L1_error) + __pyx_t_3 = PyImport_ImportModule("gevent._greenlet"); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 56, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_ptype_6gevent_9_greenlet_SpawnedLink = __Pyx_ImportType(__pyx_t_3, "gevent._greenlet", "SpawnedLink", sizeof(struct __pyx_obj_6gevent_9_greenlet_SpawnedLink), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_9_greenlet_SpawnedLink) __PYX_ERR(3, 56, __pyx_L1_error) + __pyx_ptype_6gevent_9_greenlet_SuccessSpawnedLink = __Pyx_ImportType(__pyx_t_3, "gevent._greenlet", "SuccessSpawnedLink", sizeof(struct __pyx_obj_6gevent_9_greenlet_SuccessSpawnedLink), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_9_greenlet_SuccessSpawnedLink) __PYX_ERR(3, 61, __pyx_L1_error) + __pyx_ptype_6gevent_9_greenlet_FailureSpawnedLink = __Pyx_ImportType(__pyx_t_3, "gevent._greenlet", "FailureSpawnedLink", sizeof(struct __pyx_obj_6gevent_9_greenlet_FailureSpawnedLink), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_9_greenlet_FailureSpawnedLink) __PYX_ERR(3, 65, __pyx_L1_error) + __pyx_ptype_6gevent_9_greenlet__Frame = __Pyx_ImportType(__pyx_t_3, "gevent._greenlet", "_Frame", sizeof(struct __pyx_obj_6gevent_9_greenlet__Frame), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_9_greenlet__Frame) __PYX_ERR(3, 71, __pyx_L1_error) + __pyx_ptype_6gevent_9_greenlet_Greenlet = __Pyx_ImportType(__pyx_t_3, "gevent._greenlet", "Greenlet", sizeof(struct __pyx_obj_6gevent_9_greenlet_Greenlet), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_9_greenlet_Greenlet) __PYX_ERR(3, 86, __pyx_L1_error) + __pyx_vtabptr_6gevent_9_greenlet_Greenlet = (struct __pyx_vtabstruct_6gevent_9_greenlet_Greenlet*)__Pyx_GetVtable(__pyx_ptype_6gevent_9_greenlet_Greenlet->tp_dict); if (unlikely(!__pyx_vtabptr_6gevent_9_greenlet_Greenlet)) __PYX_ERR(3, 86, __pyx_L1_error) + __pyx_ptype_6gevent_9_greenlet__dummy_event = __Pyx_ImportType(__pyx_t_3, "gevent._greenlet", "_dummy_event", sizeof(struct __pyx_obj_6gevent_9_greenlet__dummy_event), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_9_greenlet__dummy_event) __PYX_ERR(3, 157, __pyx_L1_error) + __pyx_vtabptr_6gevent_9_greenlet__dummy_event = (struct __pyx_vtabstruct_6gevent_9_greenlet__dummy_event*)__Pyx_GetVtable(__pyx_ptype_6gevent_9_greenlet__dummy_event->tp_dict); if (unlikely(!__pyx_vtabptr_6gevent_9_greenlet__dummy_event)) __PYX_ERR(3, 157, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_modinit_variable_import_code(void) { + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); + /*--- Variable import code ---*/ + __pyx_t_1 = PyImport_ImportModule("gevent.__ident"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_1, "heappop", (void **)&__pyx_vp_6gevent_7__ident_heappop, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_1, "heappush", (void **)&__pyx_vp_6gevent_7__ident_heappush, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_1, "WeakKeyDictionary", (void **)&__pyx_vp_6gevent_7__ident_WeakKeyDictionary, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + Py_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_2 = PyImport_ImportModule("gevent.__greenlet_primitives"); if (!__pyx_t_2) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_2, "get_objects", (void **)&__pyx_vp_6gevent_21__greenlet_primitives_get_objects, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_2, "wref", (void **)&__pyx_vp_6gevent_21__greenlet_primitives_wref, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_2, "BlockingSwitchOutError", (void **)&__pyx_vp_6gevent_21__greenlet_primitives_BlockingSwitchOutError, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_2, "_greenlet_imported", (void **)&__pyx_vp_6gevent_21__greenlet_primitives__greenlet_imported, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + Py_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_3 = PyImport_ImportModule("gevent.__hub_local"); if (!__pyx_t_3) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_3, "_threadlocal", (void **)&__pyx_vp_6gevent_11__hub_local__threadlocal, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + Py_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_4 = PyImport_ImportModule("gevent.__waiter"); if (!__pyx_t_4) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_4, "sys", (void **)&__pyx_vp_6gevent_8__waiter_sys, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_4, "ConcurrentObjectUseError", (void **)&__pyx_vp_6gevent_8__waiter_ConcurrentObjectUseError, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_4, "_greenlet_imported", (void **)&__pyx_vp_6gevent_8__waiter__greenlet_imported, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_4, "_NONE", (void **)&__pyx_vp_6gevent_8__waiter__NONE, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + Py_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = PyImport_ImportModule("gevent._greenlet"); if (!__pyx_t_5) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_5, "_PYPY", (void **)&__pyx_vp_6gevent_9_greenlet__PYPY, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_5, "sys_getframe", (void **)&__pyx_vp_6gevent_9_greenlet_sys_getframe, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_5, "sys_exc_info", (void **)&__pyx_vp_6gevent_9_greenlet_sys_exc_info, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_5, "Timeout", (void **)&__pyx_vp_6gevent_9_greenlet_Timeout, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_5, "GreenletExit", (void **)&__pyx_vp_6gevent_9_greenlet_GreenletExit, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_5, "InvalidSwitchError", (void **)&__pyx_vp_6gevent_9_greenlet_InvalidSwitchError, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_5, "_greenlet_imported", (void **)&__pyx_vp_6gevent_9_greenlet__greenlet_imported, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_5, "_greenlet__init__", (void **)&__pyx_vp_6gevent_9_greenlet__greenlet__init__, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_5, "_threadlocal", (void **)&__pyx_vp_6gevent_9_greenlet__threadlocal, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_5, "get_hub_class", (void **)&__pyx_vp_6gevent_9_greenlet_get_hub_class, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_5, "wref", (void **)&__pyx_vp_6gevent_9_greenlet_wref, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_5, "dump_traceback", (void **)&__pyx_vp_6gevent_9_greenlet_dump_traceback, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_5, "load_traceback", (void **)&__pyx_vp_6gevent_9_greenlet_load_traceback, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_5, "wait", (void **)&__pyx_vp_6gevent_9_greenlet_wait, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_5, "iwait", (void **)&__pyx_vp_6gevent_9_greenlet_iwait, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_5, "reraise", (void **)&__pyx_vp_6gevent_9_greenlet_reraise, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_5, "GEVENT_CONFIG", (void **)&__pyx_vp_6gevent_9_greenlet_GEVENT_CONFIG, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_5, "_cancelled_start_event", (void **)&__pyx_vp_6gevent_9_greenlet__cancelled_start_event, "struct __pyx_obj_6gevent_9_greenlet__dummy_event *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_5, "_start_completed_event", (void **)&__pyx_vp_6gevent_9_greenlet__start_completed_event, "struct __pyx_obj_6gevent_9_greenlet__dummy_event *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_5, "_spawn_callbacks", (void **)&__pyx_vp_6gevent_9_greenlet__spawn_callbacks, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + Py_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_modinit_function_import_code(void) { + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); + /*--- Function import code ---*/ + __pyx_t_1 = PyImport_ImportModule("gevent.__hub_local"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportFunction(__pyx_t_1, "get_hub_noargs", (void (**)(void))&__pyx_f_6gevent_11__hub_local_get_hub_noargs, "struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *(int __pyx_skip_dispatch)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + Py_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_RefNannyFinishContext(); + return -1; +} + + +#if PY_MAJOR_VERSION < 3 +#ifdef CYTHON_NO_PYINIT_EXPORT +#define __Pyx_PyMODINIT_FUNC void +#else +#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC +#endif +#else +#ifdef CYTHON_NO_PYINIT_EXPORT +#define __Pyx_PyMODINIT_FUNC PyObject * +#else +#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC +#endif +#endif + + +#if PY_MAJOR_VERSION < 3 +__Pyx_PyMODINIT_FUNC init_local(void) CYTHON_SMALL_CODE; /*proto*/ +__Pyx_PyMODINIT_FUNC init_local(void) +#else +__Pyx_PyMODINIT_FUNC PyInit__local(void) CYTHON_SMALL_CODE; /*proto*/ +__Pyx_PyMODINIT_FUNC PyInit__local(void) +#if CYTHON_PEP489_MULTI_PHASE_INIT +{ + return PyModuleDef_Init(&__pyx_moduledef); +} +static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { + #if PY_VERSION_HEX >= 0x030700A1 + static PY_INT64_T main_interpreter_id = -1; + PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); + if (main_interpreter_id == -1) { + main_interpreter_id = current_id; + return (unlikely(current_id == -1)) ? -1 : 0; + } else if (unlikely(main_interpreter_id != current_id)) + #else + static PyInterpreterState *main_interpreter = NULL; + PyInterpreterState *current_interpreter = PyThreadState_Get()->interp; + if (!main_interpreter) { + main_interpreter = current_interpreter; + } else if (unlikely(main_interpreter != current_interpreter)) + #endif + { + PyErr_SetString( + PyExc_ImportError, + "Interpreter change detected - this module can only be loaded into one interpreter per process."); + return -1; + } + return 0; +} +static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) { + PyObject *value = PyObject_GetAttrString(spec, from_name); + int result = 0; + if (likely(value)) { + if (allow_none || value != Py_None) { + result = PyDict_SetItemString(moddict, to_name, value); + } + Py_DECREF(value); + } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_Clear(); + } else { + result = -1; + } + return result; +} +static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) { + PyObject *module = NULL, *moddict, *modname; + if (__Pyx_check_single_interpreter()) + return NULL; + if (__pyx_m) + return __Pyx_NewRef(__pyx_m); + modname = PyObject_GetAttrString(spec, "name"); + if (unlikely(!modname)) goto bad; + module = PyModule_NewObject(modname); + Py_DECREF(modname); + if (unlikely(!module)) goto bad; + moddict = PyModule_GetDict(module); + if (unlikely(!moddict)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad; + return module; +bad: + Py_XDECREF(module); + return NULL; +} + + +static CYTHON_SMALL_CODE int __pyx_pymod_exec__local(PyObject *__pyx_pyinit_module) +#endif +#endif +{ + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + int __pyx_t_7; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + __Pyx_RefNannyDeclarations + #if CYTHON_PEP489_MULTI_PHASE_INIT + if (__pyx_m) { + if (__pyx_m == __pyx_pyinit_module) return 0; + PyErr_SetString(PyExc_RuntimeError, "Module '_local' has already been imported. Re-initialisation is not supported."); + return -1; + } + #elif PY_MAJOR_VERSION >= 3 + if (__pyx_m) return __Pyx_NewRef(__pyx_m); + #endif + #if CYTHON_REFNANNY +__Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); +if (!__Pyx_RefNanny) { + PyErr_Clear(); + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); + if (!__Pyx_RefNanny) + Py_FatalError("failed to import 'refnanny' module"); +} +#endif + __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit__local(void)", 0); + if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #ifdef __Pxy_PyFrame_Initialize_Offsets + __Pxy_PyFrame_Initialize_Offsets(); + #endif + __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) + #ifdef __Pyx_CyFunction_USED + if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_FusedFunction_USED + if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_Coroutine_USED + if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_Generator_USED + if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_AsyncGen_USED + if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_StopAsyncIteration_USED + if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + /*--- Library function declarations ---*/ + /*--- Threads initialization code ---*/ + #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS + #ifdef WITH_THREAD /* Python build with threading support? */ + PyEval_InitThreads(); + #endif + #endif + /*--- Module creation code ---*/ + #if CYTHON_PEP489_MULTI_PHASE_INIT + __pyx_m = __pyx_pyinit_module; + Py_INCREF(__pyx_m); + #else + #if PY_MAJOR_VERSION < 3 + __pyx_m = Py_InitModule4("_local", __pyx_methods, __pyx_k_Greenlet_local_objects_This_mod, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); + #else + __pyx_m = PyModule_Create(&__pyx_moduledef); + #endif + if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) + Py_INCREF(__pyx_d); + __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) + #if CYTHON_COMPILING_IN_PYPY + Py_INCREF(__pyx_b); + #endif + if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + /*--- Initialize various global constants etc. ---*/ + if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) + if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + if (__pyx_module_is_main_gevent___local) { + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + } + #if PY_MAJOR_VERSION >= 3 + { + PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) + if (!PyDict_GetItemString(modules, "gevent._local")) { + if (unlikely(PyDict_SetItemString(modules, "gevent._local", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error) + } + } + #endif + /*--- Builtin init code ---*/ + if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + /*--- Constants init code ---*/ + if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + /*--- Global type/function init code ---*/ + (void)__Pyx_modinit_global_init_code(); + if (unlikely(__Pyx_modinit_variable_export_code() != 0)) goto __pyx_L1_error; + if (unlikely(__Pyx_modinit_function_export_code() != 0)) goto __pyx_L1_error; + if (unlikely(__Pyx_modinit_type_init_code() != 0)) goto __pyx_L1_error; + if (unlikely(__Pyx_modinit_type_import_code() != 0)) goto __pyx_L1_error; + if (unlikely(__Pyx_modinit_variable_import_code() != 0)) goto __pyx_L1_error; + if (unlikely(__Pyx_modinit_function_import_code() != 0)) goto __pyx_L1_error; + /*--- Execution code ---*/ + #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) + if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + + /* "src/gevent/local.py":156 + * from __future__ import print_function + * + * from copy import copy # <<<<<<<<<<<<<< + * from weakref import ref + * + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 156, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_copy_2); + __Pyx_GIVEREF(__pyx_n_s_copy_2); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_copy_2); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_copy_2, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 156, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_copy_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 156, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_v_6gevent_6_local_copy); + __Pyx_DECREF_SET(__pyx_v_6gevent_6_local_copy, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/local.py":157 + * + * from copy import copy + * from weakref import ref # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 157, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_ref); + __Pyx_GIVEREF(__pyx_n_s_ref); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_ref); + __pyx_t_1 = __Pyx_Import(__pyx_n_s_weakref, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 157, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_ref); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 157, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_v_6gevent_6_local_ref); + __Pyx_DECREF_SET(__pyx_v_6gevent_6_local_ref, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/local.py":160 + * + * + * locals()['getcurrent'] = __import__('greenlet').getcurrent # <<<<<<<<<<<<<< + * locals()['greenlet_init'] = lambda: None + * + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin___import__, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 160, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_getcurrent); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 160, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_Globals(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 160, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (unlikely(PyDict_SetItem(__pyx_t_1, __pyx_n_s_getcurrent, __pyx_t_2) < 0)) __PYX_ERR(0, 160, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/local.py":161 + * + * locals()['getcurrent'] = __import__('greenlet').getcurrent + * locals()['greenlet_init'] = lambda: None # <<<<<<<<<<<<<< + * + * __all__ = [ + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_local_4lambda, 0, __pyx_n_s_lambda, NULL, __pyx_n_s_gevent__local, __pyx_d, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 161, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_Globals(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 161, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (unlikely(PyDict_SetItem(__pyx_t_1, __pyx_n_s_greenlet_init, __pyx_t_2) < 0)) __PYX_ERR(0, 161, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/local.py":163 + * locals()['greenlet_init'] = lambda: None + * + * __all__ = [ # <<<<<<<<<<<<<< + * "local", + * ] + */ + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 163, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_local); + __Pyx_GIVEREF(__pyx_n_s_local); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_local); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_all, __pyx_t_2) < 0) __PYX_ERR(0, 163, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/local.py":170 + * # We keep it a string for speed but make it unlikely to clash with + * # a "real" attribute. + * key_prefix = '_gevent_local_localimpl_' # <<<<<<<<<<<<<< + * + * # The overall structure is as follows: + */ + __Pyx_INCREF(__pyx_n_s_gevent_local_localimpl); + __Pyx_XGOTREF(__pyx_v_6gevent_6_local_key_prefix); + __Pyx_DECREF_SET(__pyx_v_6gevent_6_local_key_prefix, __pyx_n_s_gevent_local_localimpl); + __Pyx_GIVEREF(__pyx_n_s_gevent_local_localimpl); + + /* "src/gevent/local.py":179 + * # That final tuple is actually a localimpl_dict_entry object. + * + * def all_local_dicts_for_greenlet(greenlet): # <<<<<<<<<<<<<< + * """ + * Internal debug helper for getting the local values associated + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_local_1all_local_dicts_for_greenlet, 0, __pyx_n_s_all_local_dicts_for_greenlet, NULL, __pyx_n_s_gevent__local, __pyx_d, ((PyObject *)__pyx_codeobj__3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 179, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_all_local_dicts_for_greenlet, __pyx_t_2) < 0) __PYX_ERR(0, 179, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/local.py":222 + * weakref. + * """ + * __slots__ = ('idt', 'wrdicts') # <<<<<<<<<<<<<< + * + * def __init__(self, idt, wrdicts): + */ + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_local__greenlet_deleted->tp_dict, __pyx_n_s_slots, __pyx_tuple__4) < 0) __PYX_ERR(0, 222, __pyx_L1_error) + PyType_Modified(__pyx_ptype_6gevent_6_local__greenlet_deleted); + + /* "src/gevent/local.py":234 + * + * class _local_deleted(object): + * __slots__ = ('key', 'wrthread', 'greenlet_deleted') # <<<<<<<<<<<<<< + * + * def __init__(self, key, wrthread, greenlet_deleted): + */ + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_local__local_deleted->tp_dict, __pyx_n_s_slots, __pyx_tuple__5) < 0) __PYX_ERR(0, 234, __pyx_L1_error) + PyType_Modified(__pyx_ptype_6gevent_6_local__local_deleted); + + /* "src/gevent/local.py":254 + * class _localimpl(object): + * """A class managing thread-local dicts""" + * __slots__ = ('key', 'dicts', # <<<<<<<<<<<<<< + * 'localargs', 'localkwargs', + * 'localtypeid', + */ + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_local__localimpl->tp_dict, __pyx_n_s_slots, __pyx_tuple__6) < 0) __PYX_ERR(0, 254, __pyx_L1_error) + PyType_Modified(__pyx_ptype_6gevent_6_local__localimpl); + + /* "src/gevent/local.py":280 + * # This is a class, not just a tuple, so that cython can optimize + * # attribute access + * __slots__ = ('wrgreenlet', 'localdict') # <<<<<<<<<<<<<< + * + * def __init__(self, wrgreenlet, localdict): + */ + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_local__localimpl_dict_entry->tp_dict, __pyx_n_s_slots, __pyx_tuple__7) < 0) __PYX_ERR(0, 280, __pyx_L1_error) + PyType_Modified(__pyx_ptype_6gevent_6_local__localimpl_dict_entry); + + /* "src/gevent/local.py":331 + * + * + * _marker = object() # <<<<<<<<<<<<<< + * + * def _local_get_dict(self): + */ + __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_builtin_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 331, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_v_6gevent_6_local__marker); + __Pyx_DECREF_SET(__pyx_v_6gevent_6_local__marker, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + + /* "src/gevent/local.py":350 + * + * _local_attrs = { + * '_local__impl', # <<<<<<<<<<<<<< + * '_local_type_get_descriptors', + * '_local_type_set_or_del_descriptors', + */ + __pyx_t_2 = PySet_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 350, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PySet_Add(__pyx_t_2, __pyx_n_s_local__impl) < 0) __PYX_ERR(0, 350, __pyx_L1_error) + if (PySet_Add(__pyx_t_2, __pyx_n_s_local_type_get_descriptors) < 0) __PYX_ERR(0, 350, __pyx_L1_error) + if (PySet_Add(__pyx_t_2, __pyx_n_s_local_type_set_or_del_descripto) < 0) __PYX_ERR(0, 350, __pyx_L1_error) + if (PySet_Add(__pyx_t_2, __pyx_n_s_local_type_del_descriptors) < 0) __PYX_ERR(0, 350, __pyx_L1_error) + if (PySet_Add(__pyx_t_2, __pyx_n_s_local_type_set_descriptors) < 0) __PYX_ERR(0, 350, __pyx_L1_error) + if (PySet_Add(__pyx_t_2, __pyx_n_s_local_type_2) < 0) __PYX_ERR(0, 350, __pyx_L1_error) + if (PySet_Add(__pyx_t_2, __pyx_n_s_local_type_vars) < 0) __PYX_ERR(0, 350, __pyx_L1_error) + if (PySet_Add(__pyx_t_2, __pyx_n_s_class) < 0) __PYX_ERR(0, 350, __pyx_L1_error) + if (PySet_Add(__pyx_t_2, __pyx_n_s_cinit) < 0) __PYX_ERR(0, 350, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_v_6gevent_6_local__local_attrs); + __Pyx_DECREF_SET(__pyx_v_6gevent_6_local__local_attrs, ((PyObject*)__pyx_t_2)); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + + /* "src/gevent/local.py":365 + * An object whose attributes are greenlet-local. + * """ + * __slots__ = tuple(_local_attrs - {'__class__', '__cinit__'}) # <<<<<<<<<<<<<< + * + * def __cinit__(self, *args, **kw): + */ + __pyx_t_2 = PySet_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 365, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PySet_Add(__pyx_t_2, __pyx_n_s_class) < 0) __PYX_ERR(0, 365, __pyx_L1_error) + if (PySet_Add(__pyx_t_2, __pyx_n_s_cinit) < 0) __PYX_ERR(0, 365, __pyx_L1_error) + __pyx_t_1 = PyNumber_Subtract(__pyx_v_6gevent_6_local__local_attrs, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 365, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PySequence_Tuple(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 365, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_local_local->tp_dict, __pyx_n_s_slots, __pyx_t_2) < 0) __PYX_ERR(0, 365, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_6_local_local); + + /* "src/gevent/local.py":517 + * raise AttributeError(name) + * + * def __copy__(self): # <<<<<<<<<<<<<< + * impl = self._local__impl + * entry = impl.dicts[id(getcurrent())] # pylint:disable=undefined-variable + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_local_5local_9__copy__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_local___copy, NULL, __pyx_n_s_gevent__local, __pyx_d, ((PyObject *)__pyx_codeobj__9)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 517, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_local_local->tp_dict, __pyx_n_s_copy, __pyx_t_2) < 0) __PYX_ERR(0, 517, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyType_Modified(__pyx_ptype_6gevent_6_local_local); + + /* "src/gevent/local.py":574 + * # (e.g., on PyPy). So we set it at runtime. Cython + * # will raise an error if we're compiled. + * def __new__(cls, *args, **kw): # <<<<<<<<<<<<<< + * self = super(local, cls).__new__(cls) + * # We get the cls in *args for some reason + */ + __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_local_3__new__, 0, __pyx_n_s_new, NULL, __pyx_n_s_gevent__local, __pyx_d, ((PyObject *)__pyx_codeobj__11)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 574, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_new, __pyx_t_2) < 0) __PYX_ERR(0, 574, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/local.py":582 + * return self + * + * try: # <<<<<<<<<<<<<< + * # PyPy2/3 and CPython handle adding a __new__ to the class + * # in different ways. In CPython and PyPy3, it must be wrapped with classmethod; + */ + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5); + __Pyx_XGOTREF(__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_4); + __Pyx_XGOTREF(__pyx_t_5); + /*try:*/ { + + /* "src/gevent/local.py":587 + * # in PyPy2, it must not. In either case, the args that get passed to + * # it are stil wrong. + * local.__new__ = 'None' # <<<<<<<<<<<<<< + * except TypeError: # pragma: no cover + * # Must be compiled + */ + if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_ptype_6gevent_6_local_local), __pyx_n_s_new, __pyx_n_s_None) < 0) __PYX_ERR(0, 587, __pyx_L2_error) + + /* "src/gevent/local.py":582 + * return self + * + * try: # <<<<<<<<<<<<<< + * # PyPy2/3 and CPython handle adding a __new__ to the class + * # in different ways. In CPython and PyPy3, it must be wrapped with classmethod; + */ + } + + /* "src/gevent/local.py":592 + * pass + * else: + * from gevent._compat import PYPY # <<<<<<<<<<<<<< + * from gevent._compat import PY2 + * if PYPY and PY2: + */ + /*else:*/ { + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 592, __pyx_L4_except_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_PYPY_2); + __Pyx_GIVEREF(__pyx_n_s_PYPY_2); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PYPY_2); + __pyx_t_1 = __Pyx_Import(__pyx_n_s_gevent__compat, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 592, __pyx_L4_except_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_PYPY_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 592, __pyx_L4_except_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_PYPY_2, __pyx_t_2) < 0) __PYX_ERR(0, 592, __pyx_L4_except_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/local.py":593 + * else: + * from gevent._compat import PYPY + * from gevent._compat import PY2 # <<<<<<<<<<<<<< + * if PYPY and PY2: + * local.__new__ = __new__ + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 593, __pyx_L4_except_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_PY2); + __Pyx_GIVEREF(__pyx_n_s_PY2); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_PY2); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_gevent__compat, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 593, __pyx_L4_except_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_PY2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 593, __pyx_L4_except_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_PY2, __pyx_t_1) < 0) __PYX_ERR(0, 593, __pyx_L4_except_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/local.py":594 + * from gevent._compat import PYPY + * from gevent._compat import PY2 + * if PYPY and PY2: # <<<<<<<<<<<<<< + * local.__new__ = __new__ + * else: + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_PYPY_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 594, __pyx_L4_except_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 594, __pyx_L4_except_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_7) { + } else { + __pyx_t_6 = __pyx_t_7; + goto __pyx_L9_bool_binop_done; + } + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_PY2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 594, __pyx_L4_except_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 594, __pyx_L4_except_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_6 = __pyx_t_7; + __pyx_L9_bool_binop_done:; + if (__pyx_t_6) { + + /* "src/gevent/local.py":595 + * from gevent._compat import PY2 + * if PYPY and PY2: + * local.__new__ = __new__ # <<<<<<<<<<<<<< + * else: + * local.__new__ = classmethod(__new__) + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 595, __pyx_L4_except_error) + __Pyx_GOTREF(__pyx_t_2); + if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_ptype_6gevent_6_local_local), __pyx_n_s_new, __pyx_t_2) < 0) __PYX_ERR(0, 595, __pyx_L4_except_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/local.py":594 + * from gevent._compat import PYPY + * from gevent._compat import PY2 + * if PYPY and PY2: # <<<<<<<<<<<<<< + * local.__new__ = __new__ + * else: + */ + goto __pyx_L8; + } + + /* "src/gevent/local.py":597 + * local.__new__ = __new__ + * else: + * local.__new__ = classmethod(__new__) # <<<<<<<<<<<<<< + * + * del PYPY + */ + /*else*/ { + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 597, __pyx_L4_except_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_classmethod, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 597, __pyx_L4_except_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_ptype_6gevent_6_local_local), __pyx_n_s_new, __pyx_t_1) < 0) __PYX_ERR(0, 597, __pyx_L4_except_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + __pyx_L8:; + + /* "src/gevent/local.py":599 + * local.__new__ = classmethod(__new__) + * + * del PYPY # <<<<<<<<<<<<<< + * del PY2 + * + */ + if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_PYPY_2) < 0) __PYX_ERR(0, 599, __pyx_L4_except_error) + + /* "src/gevent/local.py":600 + * + * del PYPY + * del PY2 # <<<<<<<<<<<<<< + * + * _init() + */ + if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_PY2) < 0) __PYX_ERR(0, 600, __pyx_L4_except_error) + } + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + goto __pyx_L7_try_end; + __pyx_L2_error:; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/local.py":588 + * # it are stil wrong. + * local.__new__ = 'None' + * except TypeError: # pragma: no cover # <<<<<<<<<<<<<< + * # Must be compiled + * pass + */ + __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError); + if (__pyx_t_8) { + __Pyx_ErrRestore(0,0,0); + goto __pyx_L3_exception_handled; + } + goto __pyx_L4_except_error; + __pyx_L4_except_error:; + + /* "src/gevent/local.py":582 + * return self + * + * try: # <<<<<<<<<<<<<< + * # PyPy2/3 and CPython handle adding a __new__ to the class + * # in different ways. In CPython and PyPy3, it must be wrapped with classmethod; + */ + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); + goto __pyx_L1_error; + __pyx_L3_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); + __pyx_L7_try_end:; + } + + /* "src/gevent/local.py":602 + * del PY2 + * + * _init() # <<<<<<<<<<<<<< + * + * from gevent._util import import_c_accel + */ + __pyx_f_6gevent_6_local__init(); + + /* "src/gevent/local.py":604 + * _init() + * + * from gevent._util import import_c_accel # <<<<<<<<<<<<<< + * import_c_accel(globals(), 'gevent._local') + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 604, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_import_c_accel); + __Pyx_GIVEREF(__pyx_n_s_import_c_accel); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_import_c_accel); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_gevent__util, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 604, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_import_c_accel); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 604, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_import_c_accel, __pyx_t_1) < 0) __PYX_ERR(0, 604, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/local.py":605 + * + * from gevent._util import import_c_accel + * import_c_accel(globals(), 'gevent._local') # <<<<<<<<<<<<<< + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_import_c_accel); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 605, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_Globals(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 605, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 605, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_1); + __Pyx_INCREF(__pyx_n_s_gevent__local); + __Pyx_GIVEREF(__pyx_n_s_gevent__local); + PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_n_s_gevent__local); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 605, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/local.py":1 + * # cython: auto_pickle=False,embedsignature=True,always_allow_keywords=False # <<<<<<<<<<<<<< + * """ + * Greenlet-local objects. + */ + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "gevent/_local.pxd":29 + * return PyGreenlet_GetCurrent() + * + * cdef inline void greenlet_init(): # <<<<<<<<<<<<<< + * global _greenlet_imported + * if not _greenlet_imported: + */ + + /*--- Wrapped vars code ---*/ + + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_9); + if (__pyx_m) { + if (__pyx_d) { + __Pyx_AddTraceback("init gevent._local", __pyx_clineno, __pyx_lineno, __pyx_filename); + } + Py_CLEAR(__pyx_m); + } else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_ImportError, "init gevent._local"); + } + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + #if CYTHON_PEP489_MULTI_PHASE_INIT + return (__pyx_m != NULL) ? 0 : -1; + #elif PY_MAJOR_VERSION >= 3 + return __pyx_m; + #else + return; + #endif +} + +/* --- Runtime support code --- */ +/* Refnanny */ +#if CYTHON_REFNANNY +static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { + PyObject *m = NULL, *p = NULL; + void *r = NULL; + m = PyImport_ImportModule(modname); + if (!m) goto end; + p = PyObject_GetAttrString(m, "RefNannyAPI"); + if (!p) goto end; + r = PyLong_AsVoidPtr(p); +end: + Py_XDECREF(p); + Py_XDECREF(m); + return (__Pyx_RefNannyAPIStruct *)r; +} +#endif + +/* PyObjectGetAttrStr */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_getattro)) + return tp->tp_getattro(obj, attr_name); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_getattr)) + return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); +#endif + return PyObject_GetAttr(obj, attr_name); +} +#endif + +/* GetBuiltinName */ +static PyObject *__Pyx_GetBuiltinName(PyObject *name) { + PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name); + if (unlikely(!result)) { + PyErr_Format(PyExc_NameError, +#if PY_MAJOR_VERSION >= 3 + "name '%U' is not defined", name); +#else + "name '%.200s' is not defined", PyString_AS_STRING(name)); +#endif + } + return result; +} + +/* PyCFunctionFastCall */ +#if CYTHON_FAST_PYCCALL +static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) { + PyCFunctionObject *func = (PyCFunctionObject*)func_obj; + PyCFunction meth = PyCFunction_GET_FUNCTION(func); + PyObject *self = PyCFunction_GET_SELF(func); + int flags = PyCFunction_GET_FLAGS(func); + assert(PyCFunction_Check(func)); + assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS))); + assert(nargs >= 0); + assert(nargs == 0 || args != NULL); + /* _PyCFunction_FastCallDict() must not be called with an exception set, + because it may clear it (directly or indirectly) and so the + caller loses its exception */ + assert(!PyErr_Occurred()); + if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) { + return (*((__Pyx_PyCFunctionFastWithKeywords)(void*)meth)) (self, args, nargs, NULL); + } else { + return (*((__Pyx_PyCFunctionFast)(void*)meth)) (self, args, nargs); + } +} +#endif + +/* PyFunctionFastCall */ +#if CYTHON_FAST_PYCALL +static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, + PyObject *globals) { + PyFrameObject *f; + PyThreadState *tstate = __Pyx_PyThreadState_Current; + PyObject **fastlocals; + Py_ssize_t i; + PyObject *result; + assert(globals != NULL); + /* XXX Perhaps we should create a specialized + PyFrame_New() that doesn't take locals, but does + take builtins without sanity checking them. + */ + assert(tstate != NULL); + f = PyFrame_New(tstate, co, globals, NULL); + if (f == NULL) { + return NULL; + } + fastlocals = __Pyx_PyFrame_GetLocalsplus(f); + for (i = 0; i < na; i++) { + Py_INCREF(*args); + fastlocals[i] = *args++; + } + result = PyEval_EvalFrameEx(f,0); + ++tstate->recursion_depth; + Py_DECREF(f); + --tstate->recursion_depth; + return result; +} +#if 1 || PY_VERSION_HEX < 0x030600B1 +static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs) { + PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); + PyObject *globals = PyFunction_GET_GLOBALS(func); + PyObject *argdefs = PyFunction_GET_DEFAULTS(func); + PyObject *closure; +#if PY_MAJOR_VERSION >= 3 + PyObject *kwdefs; +#endif + PyObject *kwtuple, **k; + PyObject **d; + Py_ssize_t nd; + Py_ssize_t nk; + PyObject *result; + assert(kwargs == NULL || PyDict_Check(kwargs)); + nk = kwargs ? PyDict_Size(kwargs) : 0; + if (Py_EnterRecursiveCall((char*)" while calling a Python object")) { + return NULL; + } + if ( +#if PY_MAJOR_VERSION >= 3 + co->co_kwonlyargcount == 0 && +#endif + likely(kwargs == NULL || nk == 0) && + co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { + if (argdefs == NULL && co->co_argcount == nargs) { + result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); + goto done; + } + else if (nargs == 0 && argdefs != NULL + && co->co_argcount == Py_SIZE(argdefs)) { + /* function called with no arguments, but all parameters have + a default value: use default values as arguments .*/ + args = &PyTuple_GET_ITEM(argdefs, 0); + result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); + goto done; + } + } + if (kwargs != NULL) { + Py_ssize_t pos, i; + kwtuple = PyTuple_New(2 * nk); + if (kwtuple == NULL) { + result = NULL; + goto done; + } + k = &PyTuple_GET_ITEM(kwtuple, 0); + pos = i = 0; + while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { + Py_INCREF(k[i]); + Py_INCREF(k[i+1]); + i += 2; + } + nk = i / 2; + } + else { + kwtuple = NULL; + k = NULL; + } + closure = PyFunction_GET_CLOSURE(func); +#if PY_MAJOR_VERSION >= 3 + kwdefs = PyFunction_GET_KW_DEFAULTS(func); +#endif + if (argdefs != NULL) { + d = &PyTuple_GET_ITEM(argdefs, 0); + nd = Py_SIZE(argdefs); + } + else { + d = NULL; + nd = 0; + } +#if PY_MAJOR_VERSION >= 3 + result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, + args, nargs, + k, (int)nk, + d, (int)nd, kwdefs, closure); +#else + result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, + args, nargs, + k, (int)nk, + d, (int)nd, closure); +#endif + Py_XDECREF(kwtuple); +done: + Py_LeaveRecursiveCall(); + return result; +} +#endif +#endif + +/* PyObjectCall */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { + PyObject *result; + ternaryfunc call = func->ob_type->tp_call; + if (unlikely(!call)) + return PyObject_Call(func, arg, kw); + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; + result = (*call)(func, arg, kw); + Py_LeaveRecursiveCall(); + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +/* PyObjectCallMethO */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { + PyObject *self, *result; + PyCFunction cfunc; + cfunc = PyCFunction_GET_FUNCTION(func); + self = PyCFunction_GET_SELF(func); + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; + result = cfunc(self, arg); + Py_LeaveRecursiveCall(); + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +/* PyObjectCallOneArg */ +#if CYTHON_COMPILING_IN_CPYTHON +static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) { + PyObject *result; + PyObject *args = PyTuple_New(1); + if (unlikely(!args)) return NULL; + Py_INCREF(arg); + PyTuple_SET_ITEM(args, 0, arg); + result = __Pyx_PyObject_Call(func, args, NULL); + Py_DECREF(args); + return result; +} +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { +#if CYTHON_FAST_PYCALL + if (PyFunction_Check(func)) { + return __Pyx_PyFunction_FastCall(func, &arg, 1); + } +#endif + if (likely(PyCFunction_Check(func))) { + if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) { + return __Pyx_PyObject_CallMethO(func, arg); +#if CYTHON_FAST_PYCCALL + } else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) { + return __Pyx_PyCFunction_FastCall(func, &arg, 1); +#endif + } + } + return __Pyx__PyObject_CallOneArg(func, arg); +} +#else +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { + PyObject *result; + PyObject *args = PyTuple_Pack(1, arg); + if (unlikely(!args)) return NULL; + result = __Pyx_PyObject_Call(func, args, NULL); + Py_DECREF(args); + return result; +} +#endif + +/* IterFinish */ +static CYTHON_INLINE int __Pyx_IterFinish(void) { +#if CYTHON_FAST_THREAD_STATE + PyThreadState *tstate = __Pyx_PyThreadState_Current; + PyObject* exc_type = tstate->curexc_type; + if (unlikely(exc_type)) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) { + PyObject *exc_value, *exc_tb; + exc_value = tstate->curexc_value; + exc_tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; + Py_DECREF(exc_type); + Py_XDECREF(exc_value); + Py_XDECREF(exc_tb); + return 0; + } else { + return -1; + } + } + return 0; +#else + if (unlikely(PyErr_Occurred())) { + if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) { + PyErr_Clear(); + return 0; + } else { + return -1; + } + } + return 0; +#endif +} + +/* PyObjectCallNoArg */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { +#if CYTHON_FAST_PYCALL + if (PyFunction_Check(func)) { + return __Pyx_PyFunction_FastCall(func, NULL, 0); + } +#endif +#ifdef __Pyx_CyFunction_USED + if (likely(PyCFunction_Check(func) || __Pyx_CyFunction_Check(func))) +#else + if (likely(PyCFunction_Check(func))) +#endif + { + if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) { + return __Pyx_PyObject_CallMethO(func, NULL); + } + } + return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL); +} +#endif + +/* PyObjectGetMethod */ +static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method) { + PyObject *attr; +#if CYTHON_UNPACK_METHODS && CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_PYTYPE_LOOKUP + PyTypeObject *tp = Py_TYPE(obj); + PyObject *descr; + descrgetfunc f = NULL; + PyObject **dictptr, *dict; + int meth_found = 0; + assert (*method == NULL); + if (unlikely(tp->tp_getattro != PyObject_GenericGetAttr)) { + attr = __Pyx_PyObject_GetAttrStr(obj, name); + goto try_unpack; + } + if (unlikely(tp->tp_dict == NULL) && unlikely(PyType_Ready(tp) < 0)) { + return 0; + } + descr = _PyType_Lookup(tp, name); + if (likely(descr != NULL)) { + Py_INCREF(descr); +#if PY_MAJOR_VERSION >= 3 + #ifdef __Pyx_CyFunction_USED + if (likely(PyFunction_Check(descr) || (Py_TYPE(descr) == &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr))) + #else + if (likely(PyFunction_Check(descr) || (Py_TYPE(descr) == &PyMethodDescr_Type))) + #endif +#else + #ifdef __Pyx_CyFunction_USED + if (likely(PyFunction_Check(descr) || __Pyx_CyFunction_Check(descr))) + #else + if (likely(PyFunction_Check(descr))) + #endif +#endif + { + meth_found = 1; + } else { + f = Py_TYPE(descr)->tp_descr_get; + if (f != NULL && PyDescr_IsData(descr)) { + attr = f(descr, obj, (PyObject *)Py_TYPE(obj)); + Py_DECREF(descr); + goto try_unpack; + } + } + } + dictptr = _PyObject_GetDictPtr(obj); + if (dictptr != NULL && (dict = *dictptr) != NULL) { + Py_INCREF(dict); + attr = __Pyx_PyDict_GetItemStr(dict, name); + if (attr != NULL) { + Py_INCREF(attr); + Py_DECREF(dict); + Py_XDECREF(descr); + goto try_unpack; + } + Py_DECREF(dict); + } + if (meth_found) { + *method = descr; + return 1; + } + if (f != NULL) { + attr = f(descr, obj, (PyObject *)Py_TYPE(obj)); + Py_DECREF(descr); + goto try_unpack; + } + if (descr != NULL) { + *method = descr; + return 0; + } + PyErr_Format(PyExc_AttributeError, +#if PY_MAJOR_VERSION >= 3 + "'%.50s' object has no attribute '%U'", + tp->tp_name, name); +#else + "'%.50s' object has no attribute '%.400s'", + tp->tp_name, PyString_AS_STRING(name)); +#endif + return 0; +#else + attr = __Pyx_PyObject_GetAttrStr(obj, name); + goto try_unpack; +#endif +try_unpack: +#if CYTHON_UNPACK_METHODS + if (likely(attr) && PyMethod_Check(attr) && likely(PyMethod_GET_SELF(attr) == obj)) { + PyObject *function = PyMethod_GET_FUNCTION(attr); + Py_INCREF(function); + Py_DECREF(attr); + *method = function; + return 1; + } +#endif + *method = attr; + return 0; +} + +/* PyObjectCallMethod0 */ +static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) { + PyObject *method = NULL, *result = NULL; + int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method); + if (likely(is_method)) { + result = __Pyx_PyObject_CallOneArg(method, obj); + Py_DECREF(method); + return result; + } + if (unlikely(!method)) goto bad; + result = __Pyx_PyObject_CallNoArg(method); + Py_DECREF(method); +bad: + return result; +} + +/* RaiseNeedMoreValuesToUnpack */ +static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { + PyErr_Format(PyExc_ValueError, + "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack", + index, (index == 1) ? "" : "s"); +} + +/* RaiseTooManyValuesToUnpack */ +static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { + PyErr_Format(PyExc_ValueError, + "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected); +} + +/* UnpackItemEndCheck */ +static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { + if (unlikely(retval)) { + Py_DECREF(retval); + __Pyx_RaiseTooManyValuesError(expected); + return -1; + } else { + return __Pyx_IterFinish(); + } + return 0; +} + +/* RaiseNoneIterError */ +static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); +} + +/* UnpackTupleError */ +static void __Pyx_UnpackTupleError(PyObject *t, Py_ssize_t index) { + if (t == Py_None) { + __Pyx_RaiseNoneNotIterableError(); + } else if (PyTuple_GET_SIZE(t) < index) { + __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(t)); + } else { + __Pyx_RaiseTooManyValuesError(index); + } +} + +/* UnpackTuple2 */ +static CYTHON_INLINE int __Pyx_unpack_tuple2_exact( + PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2, int decref_tuple) { + PyObject *value1 = NULL, *value2 = NULL; +#if CYTHON_COMPILING_IN_PYPY + value1 = PySequence_ITEM(tuple, 0); if (unlikely(!value1)) goto bad; + value2 = PySequence_ITEM(tuple, 1); if (unlikely(!value2)) goto bad; +#else + value1 = PyTuple_GET_ITEM(tuple, 0); Py_INCREF(value1); + value2 = PyTuple_GET_ITEM(tuple, 1); Py_INCREF(value2); +#endif + if (decref_tuple) { + Py_DECREF(tuple); + } + *pvalue1 = value1; + *pvalue2 = value2; + return 0; +#if CYTHON_COMPILING_IN_PYPY +bad: + Py_XDECREF(value1); + Py_XDECREF(value2); + if (decref_tuple) { Py_XDECREF(tuple); } + return -1; +#endif +} +static int __Pyx_unpack_tuple2_generic(PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2, + int has_known_size, int decref_tuple) { + Py_ssize_t index; + PyObject *value1 = NULL, *value2 = NULL, *iter = NULL; + iternextfunc iternext; + iter = PyObject_GetIter(tuple); + if (unlikely(!iter)) goto bad; + if (decref_tuple) { Py_DECREF(tuple); tuple = NULL; } + iternext = Py_TYPE(iter)->tp_iternext; + value1 = iternext(iter); if (unlikely(!value1)) { index = 0; goto unpacking_failed; } + value2 = iternext(iter); if (unlikely(!value2)) { index = 1; goto unpacking_failed; } + if (!has_known_size && unlikely(__Pyx_IternextUnpackEndCheck(iternext(iter), 2))) goto bad; + Py_DECREF(iter); + *pvalue1 = value1; + *pvalue2 = value2; + return 0; +unpacking_failed: + if (!has_known_size && __Pyx_IterFinish() == 0) + __Pyx_RaiseNeedMoreValuesError(index); +bad: + Py_XDECREF(iter); + Py_XDECREF(value1); + Py_XDECREF(value2); + if (decref_tuple) { Py_XDECREF(tuple); } + return -1; +} + +/* dict_iter */ +static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* iterable, int is_dict, PyObject* method_name, + Py_ssize_t* p_orig_length, int* p_source_is_dict) { + is_dict = is_dict || likely(PyDict_CheckExact(iterable)); + *p_source_is_dict = is_dict; + if (is_dict) { +#if !CYTHON_COMPILING_IN_PYPY + *p_orig_length = PyDict_Size(iterable); + Py_INCREF(iterable); + return iterable; +#elif PY_MAJOR_VERSION >= 3 + static PyObject *py_items = NULL, *py_keys = NULL, *py_values = NULL; + PyObject **pp = NULL; + if (method_name) { + const char *name = PyUnicode_AsUTF8(method_name); + if (strcmp(name, "iteritems") == 0) pp = &py_items; + else if (strcmp(name, "iterkeys") == 0) pp = &py_keys; + else if (strcmp(name, "itervalues") == 0) pp = &py_values; + if (pp) { + if (!*pp) { + *pp = PyUnicode_FromString(name + 4); + if (!*pp) + return NULL; + } + method_name = *pp; + } + } +#endif + } + *p_orig_length = 0; + if (method_name) { + PyObject* iter; + iterable = __Pyx_PyObject_CallMethod0(iterable, method_name); + if (!iterable) + return NULL; +#if !CYTHON_COMPILING_IN_PYPY + if (PyTuple_CheckExact(iterable) || PyList_CheckExact(iterable)) + return iterable; +#endif + iter = PyObject_GetIter(iterable); + Py_DECREF(iterable); + return iter; + } + return PyObject_GetIter(iterable); +} +static CYTHON_INLINE int __Pyx_dict_iter_next( + PyObject* iter_obj, CYTHON_NCP_UNUSED Py_ssize_t orig_length, CYTHON_NCP_UNUSED Py_ssize_t* ppos, + PyObject** pkey, PyObject** pvalue, PyObject** pitem, int source_is_dict) { + PyObject* next_item; +#if !CYTHON_COMPILING_IN_PYPY + if (source_is_dict) { + PyObject *key, *value; + if (unlikely(orig_length != PyDict_Size(iter_obj))) { + PyErr_SetString(PyExc_RuntimeError, "dictionary changed size during iteration"); + return -1; + } + if (unlikely(!PyDict_Next(iter_obj, ppos, &key, &value))) { + return 0; + } + if (pitem) { + PyObject* tuple = PyTuple_New(2); + if (unlikely(!tuple)) { + return -1; + } + Py_INCREF(key); + Py_INCREF(value); + PyTuple_SET_ITEM(tuple, 0, key); + PyTuple_SET_ITEM(tuple, 1, value); + *pitem = tuple; + } else { + if (pkey) { + Py_INCREF(key); + *pkey = key; + } + if (pvalue) { + Py_INCREF(value); + *pvalue = value; + } + } + return 1; + } else if (PyTuple_CheckExact(iter_obj)) { + Py_ssize_t pos = *ppos; + if (unlikely(pos >= PyTuple_GET_SIZE(iter_obj))) return 0; + *ppos = pos + 1; + next_item = PyTuple_GET_ITEM(iter_obj, pos); + Py_INCREF(next_item); + } else if (PyList_CheckExact(iter_obj)) { + Py_ssize_t pos = *ppos; + if (unlikely(pos >= PyList_GET_SIZE(iter_obj))) return 0; + *ppos = pos + 1; + next_item = PyList_GET_ITEM(iter_obj, pos); + Py_INCREF(next_item); + } else +#endif + { + next_item = PyIter_Next(iter_obj); + if (unlikely(!next_item)) { + return __Pyx_IterFinish(); + } + } + if (pitem) { + *pitem = next_item; + } else if (pkey && pvalue) { + if (__Pyx_unpack_tuple2(next_item, pkey, pvalue, source_is_dict, source_is_dict, 1)) + return -1; + } else if (pkey) { + *pkey = next_item; + } else { + *pvalue = next_item; + } + return 1; +} + +/* bytes_tailmatch */ +static int __Pyx_PyBytes_SingleTailmatch(PyObject* self, PyObject* arg, + Py_ssize_t start, Py_ssize_t end, int direction) { + const char* self_ptr = PyBytes_AS_STRING(self); + Py_ssize_t self_len = PyBytes_GET_SIZE(self); + const char* sub_ptr; + Py_ssize_t sub_len; + int retval; + Py_buffer view; + view.obj = NULL; + if ( PyBytes_Check(arg) ) { + sub_ptr = PyBytes_AS_STRING(arg); + sub_len = PyBytes_GET_SIZE(arg); + } +#if PY_MAJOR_VERSION < 3 + else if ( PyUnicode_Check(arg) ) { + return (int) PyUnicode_Tailmatch(self, arg, start, end, direction); + } +#endif + else { + if (unlikely(PyObject_GetBuffer(self, &view, PyBUF_SIMPLE) == -1)) + return -1; + sub_ptr = (const char*) view.buf; + sub_len = view.len; + } + if (end > self_len) + end = self_len; + else if (end < 0) + end += self_len; + if (end < 0) + end = 0; + if (start < 0) + start += self_len; + if (start < 0) + start = 0; + if (direction > 0) { + if (end-sub_len > start) + start = end - sub_len; + } + if (start + sub_len <= end) + retval = !memcmp(self_ptr+start, sub_ptr, (size_t)sub_len); + else + retval = 0; + if (view.obj) + PyBuffer_Release(&view); + return retval; +} +static int __Pyx_PyBytes_TailmatchTuple(PyObject* self, PyObject* substrings, + Py_ssize_t start, Py_ssize_t end, int direction) { + Py_ssize_t i, count = PyTuple_GET_SIZE(substrings); + for (i = 0; i < count; i++) { + int result; +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + result = __Pyx_PyBytes_SingleTailmatch(self, PyTuple_GET_ITEM(substrings, i), + start, end, direction); +#else + PyObject* sub = PySequence_ITEM(substrings, i); + if (unlikely(!sub)) return -1; + result = __Pyx_PyBytes_SingleTailmatch(self, sub, start, end, direction); + Py_DECREF(sub); +#endif + if (result) { + return result; + } + } + return 0; +} +static int __Pyx_PyBytes_Tailmatch(PyObject* self, PyObject* substr, + Py_ssize_t start, Py_ssize_t end, int direction) { + if (unlikely(PyTuple_Check(substr))) { + return __Pyx_PyBytes_TailmatchTuple(self, substr, start, end, direction); + } + return __Pyx_PyBytes_SingleTailmatch(self, substr, start, end, direction); +} + +/* unicode_tailmatch */ +static int __Pyx_PyUnicode_TailmatchTuple(PyObject* s, PyObject* substrings, + Py_ssize_t start, Py_ssize_t end, int direction) { + Py_ssize_t i, count = PyTuple_GET_SIZE(substrings); + for (i = 0; i < count; i++) { + Py_ssize_t result; +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + result = PyUnicode_Tailmatch(s, PyTuple_GET_ITEM(substrings, i), + start, end, direction); +#else + PyObject* sub = PySequence_ITEM(substrings, i); + if (unlikely(!sub)) return -1; + result = PyUnicode_Tailmatch(s, sub, start, end, direction); + Py_DECREF(sub); +#endif + if (result) { + return (int) result; + } + } + return 0; +} +static int __Pyx_PyUnicode_Tailmatch(PyObject* s, PyObject* substr, + Py_ssize_t start, Py_ssize_t end, int direction) { + if (unlikely(PyTuple_Check(substr))) { + return __Pyx_PyUnicode_TailmatchTuple(s, substr, start, end, direction); + } + return (int) PyUnicode_Tailmatch(s, substr, start, end, direction); +} + +/* str_tailmatch */ +static CYTHON_INLINE int __Pyx_PyStr_Tailmatch(PyObject* self, PyObject* arg, Py_ssize_t start, + Py_ssize_t end, int direction) +{ + if (PY_MAJOR_VERSION < 3) + return __Pyx_PyBytes_Tailmatch(self, arg, start, end, direction); + else + return __Pyx_PyUnicode_Tailmatch(self, arg, start, end, direction); +} + +/* ExtTypeTest */ +static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { + if (unlikely(!type)) { + PyErr_SetString(PyExc_SystemError, "Missing type object"); + return 0; + } + if (likely(__Pyx_TypeCheck(obj, type))) + return 1; + PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s", + Py_TYPE(obj)->tp_name, type->tp_name); + return 0; +} + +/* UnpackUnboundCMethod */ +static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target) { + PyObject *method; + method = __Pyx_PyObject_GetAttrStr(target->type, *target->method_name); + if (unlikely(!method)) + return -1; + target->method = method; +#if CYTHON_COMPILING_IN_CPYTHON + #if PY_MAJOR_VERSION >= 3 + if (likely(__Pyx_TypeCheck(method, &PyMethodDescr_Type))) + #endif + { + PyMethodDescrObject *descr = (PyMethodDescrObject*) method; + target->func = descr->d_method->ml_meth; + target->flag = descr->d_method->ml_flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_STACKLESS); + } +#endif + return 0; +} + +/* CallUnboundCMethod1 */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg) { + if (likely(cfunc->func)) { + int flag = cfunc->flag; + if (flag == METH_O) { + return (*(cfunc->func))(self, arg); + } else if (PY_VERSION_HEX >= 0x030600B1 && flag == METH_FASTCALL) { + if (PY_VERSION_HEX >= 0x030700A0) { + return (*(__Pyx_PyCFunctionFast)(void*)(PyCFunction)cfunc->func)(self, &arg, 1); + } else { + return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, &arg, 1, NULL); + } + } else if (PY_VERSION_HEX >= 0x030700A0 && flag == (METH_FASTCALL | METH_KEYWORDS)) { + return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, &arg, 1, NULL); + } + } + return __Pyx__CallUnboundCMethod1(cfunc, self, arg); +} +#endif +static PyObject* __Pyx__CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg){ + PyObject *args, *result = NULL; + if (unlikely(!cfunc->func && !cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL; +#if CYTHON_COMPILING_IN_CPYTHON + if (cfunc->func && (cfunc->flag & METH_VARARGS)) { + args = PyTuple_New(1); + if (unlikely(!args)) goto bad; + Py_INCREF(arg); + PyTuple_SET_ITEM(args, 0, arg); + if (cfunc->flag & METH_KEYWORDS) + result = (*(PyCFunctionWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, NULL); + else + result = (*cfunc->func)(self, args); + } else { + args = PyTuple_New(2); + if (unlikely(!args)) goto bad; + Py_INCREF(self); + PyTuple_SET_ITEM(args, 0, self); + Py_INCREF(arg); + PyTuple_SET_ITEM(args, 1, arg); + result = __Pyx_PyObject_Call(cfunc->method, args, NULL); + } +#else + args = PyTuple_Pack(2, self, arg); + if (unlikely(!args)) goto bad; + result = __Pyx_PyObject_Call(cfunc->method, args, NULL); +#endif +bad: + Py_XDECREF(args); + return result; +} + +/* CallUnboundCMethod2 */ +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030600B1 +static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2) { + if (likely(cfunc->func)) { + PyObject *args[2] = {arg1, arg2}; + if (cfunc->flag == METH_FASTCALL) { + #if PY_VERSION_HEX >= 0x030700A0 + return (*(__Pyx_PyCFunctionFast)(void*)(PyCFunction)cfunc->func)(self, args, 2); + #else + return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, 2, NULL); + #endif + } + #if PY_VERSION_HEX >= 0x030700A0 + if (cfunc->flag == (METH_FASTCALL | METH_KEYWORDS)) + return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, 2, NULL); + #endif + } + return __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2); +} +#endif +static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2){ + PyObject *args, *result = NULL; + if (unlikely(!cfunc->func && !cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL; +#if CYTHON_COMPILING_IN_CPYTHON + if (cfunc->func && (cfunc->flag & METH_VARARGS)) { + args = PyTuple_New(2); + if (unlikely(!args)) goto bad; + Py_INCREF(arg1); + PyTuple_SET_ITEM(args, 0, arg1); + Py_INCREF(arg2); + PyTuple_SET_ITEM(args, 1, arg2); + if (cfunc->flag & METH_KEYWORDS) + result = (*(PyCFunctionWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, NULL); + else + result = (*cfunc->func)(self, args); + } else { + args = PyTuple_New(3); + if (unlikely(!args)) goto bad; + Py_INCREF(self); + PyTuple_SET_ITEM(args, 0, self); + Py_INCREF(arg1); + PyTuple_SET_ITEM(args, 1, arg1); + Py_INCREF(arg2); + PyTuple_SET_ITEM(args, 2, arg2); + result = __Pyx_PyObject_Call(cfunc->method, args, NULL); + } +#else + args = PyTuple_Pack(3, self, arg1, arg2); + if (unlikely(!args)) goto bad; + result = __Pyx_PyObject_Call(cfunc->method, args, NULL); +#endif +bad: + Py_XDECREF(args); + return result; +} + +/* dict_getitem_default */ +static PyObject* __Pyx_PyDict_GetItemDefault(PyObject* d, PyObject* key, PyObject* default_value) { + PyObject* value; +#if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY + value = PyDict_GetItemWithError(d, key); + if (unlikely(!value)) { + if (unlikely(PyErr_Occurred())) + return NULL; + value = default_value; + } + Py_INCREF(value); + if ((1)); +#else + if (PyString_CheckExact(key) || PyUnicode_CheckExact(key) || PyInt_CheckExact(key)) { + value = PyDict_GetItem(d, key); + if (unlikely(!value)) { + value = default_value; + } + Py_INCREF(value); + } +#endif + else { + if (default_value == Py_None) + value = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PyDict_Type_get, d, key); + else + value = __Pyx_CallUnboundCMethod2(&__pyx_umethod_PyDict_Type_get, d, key, default_value); + } + return value; +} + +/* ArgTypeTest */ +static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact) +{ + if (unlikely(!type)) { + PyErr_SetString(PyExc_SystemError, "Missing type object"); + return 0; + } + else if (exact) { + #if PY_MAJOR_VERSION == 2 + if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1; + #endif + } + else { + if (likely(__Pyx_TypeCheck(obj, type))) return 1; + } + PyErr_Format(PyExc_TypeError, + "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)", + name, type->tp_name, Py_TYPE(obj)->tp_name); + return 0; +} + +/* RaiseArgTupleInvalid */ +static void __Pyx_RaiseArgtupleInvalid( + const char* func_name, + int exact, + Py_ssize_t num_min, + Py_ssize_t num_max, + Py_ssize_t num_found) +{ + Py_ssize_t num_expected; + const char *more_or_less; + if (num_found < num_min) { + num_expected = num_min; + more_or_less = "at least"; + } else { + num_expected = num_max; + more_or_less = "at most"; + } + if (exact) { + more_or_less = "exactly"; + } + PyErr_Format(PyExc_TypeError, + "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", + func_name, more_or_less, num_expected, + (num_expected == 1) ? "" : "s", num_found); +} + +/* RaiseDoubleKeywords */ +static void __Pyx_RaiseDoubleKeywordsError( + const char* func_name, + PyObject* kw_name) +{ + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION >= 3 + "%s() got multiple values for keyword argument '%U'", func_name, kw_name); + #else + "%s() got multiple values for keyword argument '%s'", func_name, + PyString_AsString(kw_name)); + #endif +} + +/* ParseKeywords */ +static int __Pyx_ParseOptionalKeywords( + PyObject *kwds, + PyObject **argnames[], + PyObject *kwds2, + PyObject *values[], + Py_ssize_t num_pos_args, + const char* function_name) +{ + PyObject *key = 0, *value = 0; + Py_ssize_t pos = 0; + PyObject*** name; + PyObject*** first_kw_arg = argnames + num_pos_args; + while (PyDict_Next(kwds, &pos, &key, &value)) { + name = first_kw_arg; + while (*name && (**name != key)) name++; + if (*name) { + values[name-argnames] = value; + continue; + } + name = first_kw_arg; + #if PY_MAJOR_VERSION < 3 + if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) { + while (*name) { + if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) + && _PyString_Eq(**name, key)) { + values[name-argnames] = value; + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + if ((**argname == key) || ( + (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) + && _PyString_Eq(**argname, key))) { + goto arg_passed_twice; + } + argname++; + } + } + } else + #endif + if (likely(PyUnicode_Check(key))) { + while (*name) { + int cmp = (**name == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 : + #endif + PyUnicode_Compare(**name, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) { + values[name-argnames] = value; + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + int cmp = (**argname == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 : + #endif + PyUnicode_Compare(**argname, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) goto arg_passed_twice; + argname++; + } + } + } else + goto invalid_keyword_type; + if (kwds2) { + if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; + } else { + goto invalid_keyword; + } + } + return 0; +arg_passed_twice: + __Pyx_RaiseDoubleKeywordsError(function_name, key); + goto bad; +invalid_keyword_type: + PyErr_Format(PyExc_TypeError, + "%.200s() keywords must be strings", function_name); + goto bad; +invalid_keyword: + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION < 3 + "%.200s() got an unexpected keyword argument '%.200s'", + function_name, PyString_AsString(key)); + #else + "%s() got an unexpected keyword argument '%U'", + function_name, key); + #endif +bad: + return -1; +} + +/* GetTopmostException */ +#if CYTHON_USE_EXC_INFO_STACK +static _PyErr_StackItem * +__Pyx_PyErr_GetTopmostException(PyThreadState *tstate) +{ + _PyErr_StackItem *exc_info = tstate->exc_info; + while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) && + exc_info->previous_item != NULL) + { + exc_info = exc_info->previous_item; + } + return exc_info; +} +#endif + +/* SaveResetException */ +#if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { + #if CYTHON_USE_EXC_INFO_STACK + _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate); + *type = exc_info->exc_type; + *value = exc_info->exc_value; + *tb = exc_info->exc_traceback; + #else + *type = tstate->exc_type; + *value = tstate->exc_value; + *tb = tstate->exc_traceback; + #endif + Py_XINCREF(*type); + Py_XINCREF(*value); + Py_XINCREF(*tb); +} +static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + #if CYTHON_USE_EXC_INFO_STACK + _PyErr_StackItem *exc_info = tstate->exc_info; + tmp_type = exc_info->exc_type; + tmp_value = exc_info->exc_value; + tmp_tb = exc_info->exc_traceback; + exc_info->exc_type = type; + exc_info->exc_value = value; + exc_info->exc_traceback = tb; + #else + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = type; + tstate->exc_value = value; + tstate->exc_traceback = tb; + #endif + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +} +#endif + +/* PyObjectCall2Args */ +static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) { + PyObject *args, *result = NULL; + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(function)) { + PyObject *args[2] = {arg1, arg2}; + return __Pyx_PyFunction_FastCall(function, args, 2); + } + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(function)) { + PyObject *args[2] = {arg1, arg2}; + return __Pyx_PyCFunction_FastCall(function, args, 2); + } + #endif + args = PyTuple_New(2); + if (unlikely(!args)) goto done; + Py_INCREF(arg1); + PyTuple_SET_ITEM(args, 0, arg1); + Py_INCREF(arg2); + PyTuple_SET_ITEM(args, 1, arg2); + Py_INCREF(function); + result = __Pyx_PyObject_Call(function, args, NULL); + Py_DECREF(args); + Py_DECREF(function); +done: + return result; +} + +/* PyErrExceptionMatches */ +#if CYTHON_FAST_THREAD_STATE +static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { + Py_ssize_t i, n; + n = PyTuple_GET_SIZE(tuple); +#if PY_MAJOR_VERSION >= 3 + for (i=0; icurexc_type; + if (exc_type == err) return 1; + if (unlikely(!exc_type)) return 0; + if (unlikely(PyTuple_Check(err))) + return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err); + return __Pyx_PyErr_GivenExceptionMatches(exc_type, err); +} +#endif + +/* PyErrFetchRestore */ +#if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + tmp_type = tstate->curexc_type; + tmp_value = tstate->curexc_value; + tmp_tb = tstate->curexc_traceback; + tstate->curexc_type = type; + tstate->curexc_value = value; + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +} +static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { + *type = tstate->curexc_type; + *value = tstate->curexc_value; + *tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +} +#endif + +/* GetAttr */ +static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) { +#if CYTHON_USE_TYPE_SLOTS +#if PY_MAJOR_VERSION >= 3 + if (likely(PyUnicode_Check(n))) +#else + if (likely(PyString_Check(n))) +#endif + return __Pyx_PyObject_GetAttrStr(o, n); +#endif + return PyObject_GetAttr(o, n); +} + +/* GetAttr3 */ +static PyObject *__Pyx_GetAttr3Default(PyObject *d) { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) + return NULL; + __Pyx_PyErr_Clear(); + Py_INCREF(d); + return d; +} +static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) { + PyObject *r = __Pyx_GetAttr(o, n); + return (likely(r)) ? r : __Pyx_GetAttr3Default(d); +} + +/* DictGetItem */ +#if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY +static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) { + PyObject *value; + value = PyDict_GetItemWithError(d, key); + if (unlikely(!value)) { + if (!PyErr_Occurred()) { + if (unlikely(PyTuple_Check(key))) { + PyObject* args = PyTuple_Pack(1, key); + if (likely(args)) { + PyErr_SetObject(PyExc_KeyError, args); + Py_DECREF(args); + } + } else { + PyErr_SetObject(PyExc_KeyError, key); + } + } + return NULL; + } + Py_INCREF(value); + return value; +} +#endif + +/* GetException */ +#if CYTHON_FAST_THREAD_STATE +static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) +#else +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) +#endif +{ + PyObject *local_type, *local_value, *local_tb; +#if CYTHON_FAST_THREAD_STATE + PyObject *tmp_type, *tmp_value, *tmp_tb; + local_type = tstate->curexc_type; + local_value = tstate->curexc_value; + local_tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +#else + PyErr_Fetch(&local_type, &local_value, &local_tb); +#endif + PyErr_NormalizeException(&local_type, &local_value, &local_tb); +#if CYTHON_FAST_THREAD_STATE + if (unlikely(tstate->curexc_type)) +#else + if (unlikely(PyErr_Occurred())) +#endif + goto bad; + #if PY_MAJOR_VERSION >= 3 + if (local_tb) { + if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) + goto bad; + } + #endif + Py_XINCREF(local_tb); + Py_XINCREF(local_type); + Py_XINCREF(local_value); + *type = local_type; + *value = local_value; + *tb = local_tb; +#if CYTHON_FAST_THREAD_STATE + #if CYTHON_USE_EXC_INFO_STACK + { + _PyErr_StackItem *exc_info = tstate->exc_info; + tmp_type = exc_info->exc_type; + tmp_value = exc_info->exc_value; + tmp_tb = exc_info->exc_traceback; + exc_info->exc_type = local_type; + exc_info->exc_value = local_value; + exc_info->exc_traceback = local_tb; + } + #else + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = local_type; + tstate->exc_value = local_value; + tstate->exc_traceback = local_tb; + #endif + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#else + PyErr_SetExcInfo(local_type, local_value, local_tb); +#endif + return 0; +bad: + *type = 0; + *value = 0; + *tb = 0; + Py_XDECREF(local_type); + Py_XDECREF(local_value); + Py_XDECREF(local_tb); + return -1; +} + +/* KeywordStringCheck */ +static int __Pyx_CheckKeywordStrings( + PyObject *kwdict, + const char* function_name, + int kw_allowed) +{ + PyObject* key = 0; + Py_ssize_t pos = 0; +#if CYTHON_COMPILING_IN_PYPY + if (!kw_allowed && PyDict_Next(kwdict, &pos, &key, 0)) + goto invalid_keyword; + return 1; +#else + while (PyDict_Next(kwdict, &pos, &key, 0)) { + #if PY_MAJOR_VERSION < 3 + if (unlikely(!PyString_Check(key))) + #endif + if (unlikely(!PyUnicode_Check(key))) + goto invalid_keyword_type; + } + if ((!kw_allowed) && unlikely(key)) + goto invalid_keyword; + return 1; +invalid_keyword_type: + PyErr_Format(PyExc_TypeError, + "%.200s() keywords must be strings", function_name); + return 0; +#endif +invalid_keyword: + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION < 3 + "%.200s() got an unexpected keyword argument '%.200s'", + function_name, PyString_AsString(key)); + #else + "%s() got an unexpected keyword argument '%U'", + function_name, key); + #endif + return 0; +} + +/* RaiseException */ +#if PY_MAJOR_VERSION < 3 +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, + CYTHON_UNUSED PyObject *cause) { + __Pyx_PyThreadState_declare + Py_XINCREF(type); + if (!value || value == Py_None) + value = NULL; + else + Py_INCREF(value); + if (!tb || tb == Py_None) + tb = NULL; + else { + Py_INCREF(tb); + if (!PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto raise_error; + } + } + if (PyType_Check(type)) { +#if CYTHON_COMPILING_IN_PYPY + if (!value) { + Py_INCREF(Py_None); + value = Py_None; + } +#endif + PyErr_NormalizeException(&type, &value, &tb); + } else { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto raise_error; + } + value = type; + type = (PyObject*) Py_TYPE(type); + Py_INCREF(type); + if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto raise_error; + } + } + __Pyx_PyThreadState_assign + __Pyx_ErrRestore(type, value, tb); + return; +raise_error: + Py_XDECREF(value); + Py_XDECREF(type); + Py_XDECREF(tb); + return; +} +#else +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { + PyObject* owned_instance = NULL; + if (tb == Py_None) { + tb = 0; + } else if (tb && !PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto bad; + } + if (value == Py_None) + value = 0; + if (PyExceptionInstance_Check(type)) { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto bad; + } + value = type; + type = (PyObject*) Py_TYPE(value); + } else if (PyExceptionClass_Check(type)) { + PyObject *instance_class = NULL; + if (value && PyExceptionInstance_Check(value)) { + instance_class = (PyObject*) Py_TYPE(value); + if (instance_class != type) { + int is_subclass = PyObject_IsSubclass(instance_class, type); + if (!is_subclass) { + instance_class = NULL; + } else if (unlikely(is_subclass == -1)) { + goto bad; + } else { + type = instance_class; + } + } + } + if (!instance_class) { + PyObject *args; + if (!value) + args = PyTuple_New(0); + else if (PyTuple_Check(value)) { + Py_INCREF(value); + args = value; + } else + args = PyTuple_Pack(1, value); + if (!args) + goto bad; + owned_instance = PyObject_Call(type, args, NULL); + Py_DECREF(args); + if (!owned_instance) + goto bad; + value = owned_instance; + if (!PyExceptionInstance_Check(value)) { + PyErr_Format(PyExc_TypeError, + "calling %R should have returned an instance of " + "BaseException, not %R", + type, Py_TYPE(value)); + goto bad; + } + } + } else { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto bad; + } + if (cause) { + PyObject *fixed_cause; + if (cause == Py_None) { + fixed_cause = NULL; + } else if (PyExceptionClass_Check(cause)) { + fixed_cause = PyObject_CallObject(cause, NULL); + if (fixed_cause == NULL) + goto bad; + } else if (PyExceptionInstance_Check(cause)) { + fixed_cause = cause; + Py_INCREF(fixed_cause); + } else { + PyErr_SetString(PyExc_TypeError, + "exception causes must derive from " + "BaseException"); + goto bad; + } + PyException_SetCause(value, fixed_cause); + } + PyErr_SetObject(type, value); + if (tb) { +#if CYTHON_COMPILING_IN_PYPY + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); + Py_INCREF(tb); + PyErr_Restore(tmp_type, tmp_value, tb); + Py_XDECREF(tmp_tb); +#else + PyThreadState *tstate = __Pyx_PyThreadState_Current; + PyObject* tmp_tb = tstate->curexc_traceback; + if (tb != tmp_tb) { + Py_INCREF(tb); + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_tb); + } +#endif + } +bad: + Py_XDECREF(owned_instance); + return; +} +#endif + +/* pyfrozenset_new */ +static CYTHON_INLINE PyObject* __Pyx_PyFrozenSet_New(PyObject* it) { + if (it) { + PyObject* result; +#if CYTHON_COMPILING_IN_PYPY + PyObject* args; + args = PyTuple_Pack(1, it); + if (unlikely(!args)) + return NULL; + result = PyObject_Call((PyObject*)&PyFrozenSet_Type, args, NULL); + Py_DECREF(args); + return result; +#else + if (PyFrozenSet_CheckExact(it)) { + Py_INCREF(it); + return it; + } + result = PyFrozenSet_New(it); + if (unlikely(!result)) + return NULL; + if (likely(PySet_GET_SIZE(result))) + return result; + Py_DECREF(result); +#endif + } +#if CYTHON_USE_TYPE_SLOTS + return PyFrozenSet_Type.tp_new(&PyFrozenSet_Type, __pyx_empty_tuple, NULL); +#else + return PyObject_Call((PyObject*)&PyFrozenSet_Type, __pyx_empty_tuple, NULL); +#endif +} + +/* PySetContains */ +static int __Pyx_PySet_ContainsUnhashable(PyObject *set, PyObject *key) { + int result = -1; + if (PySet_Check(key) && PyErr_ExceptionMatches(PyExc_TypeError)) { + PyObject *tmpkey; + PyErr_Clear(); + tmpkey = __Pyx_PyFrozenSet_New(key); + if (tmpkey != NULL) { + result = PySet_Contains(set, tmpkey); + Py_DECREF(tmpkey); + } + } + return result; +} +static CYTHON_INLINE int __Pyx_PySet_ContainsTF(PyObject* key, PyObject* set, int eq) { + int result = PySet_Contains(set, key); + if (unlikely(result < 0)) { + result = __Pyx_PySet_ContainsUnhashable(set, key); + } + return unlikely(result < 0) ? result : (result == (eq == Py_EQ)); +} + +/* BytesEquals */ +static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { +#if CYTHON_COMPILING_IN_PYPY + return PyObject_RichCompareBool(s1, s2, equals); +#else + if (s1 == s2) { + return (equals == Py_EQ); + } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) { + const char *ps1, *ps2; + Py_ssize_t length = PyBytes_GET_SIZE(s1); + if (length != PyBytes_GET_SIZE(s2)) + return (equals == Py_NE); + ps1 = PyBytes_AS_STRING(s1); + ps2 = PyBytes_AS_STRING(s2); + if (ps1[0] != ps2[0]) { + return (equals == Py_NE); + } else if (length == 1) { + return (equals == Py_EQ); + } else { + int result; +#if CYTHON_USE_UNICODE_INTERNALS + Py_hash_t hash1, hash2; + hash1 = ((PyBytesObject*)s1)->ob_shash; + hash2 = ((PyBytesObject*)s2)->ob_shash; + if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { + return (equals == Py_NE); + } +#endif + result = memcmp(ps1, ps2, (size_t)length); + return (equals == Py_EQ) ? (result == 0) : (result != 0); + } + } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) { + return (equals == Py_NE); + } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) { + return (equals == Py_NE); + } else { + int result; + PyObject* py_result = PyObject_RichCompare(s1, s2, equals); + if (!py_result) + return -1; + result = __Pyx_PyObject_IsTrue(py_result); + Py_DECREF(py_result); + return result; + } +#endif +} + +/* UnicodeEquals */ +static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { +#if CYTHON_COMPILING_IN_PYPY + return PyObject_RichCompareBool(s1, s2, equals); +#else +#if PY_MAJOR_VERSION < 3 + PyObject* owned_ref = NULL; +#endif + int s1_is_unicode, s2_is_unicode; + if (s1 == s2) { + goto return_eq; + } + s1_is_unicode = PyUnicode_CheckExact(s1); + s2_is_unicode = PyUnicode_CheckExact(s2); +#if PY_MAJOR_VERSION < 3 + if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) { + owned_ref = PyUnicode_FromObject(s2); + if (unlikely(!owned_ref)) + return -1; + s2 = owned_ref; + s2_is_unicode = 1; + } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) { + owned_ref = PyUnicode_FromObject(s1); + if (unlikely(!owned_ref)) + return -1; + s1 = owned_ref; + s1_is_unicode = 1; + } else if (((!s2_is_unicode) & (!s1_is_unicode))) { + return __Pyx_PyBytes_Equals(s1, s2, equals); + } +#endif + if (s1_is_unicode & s2_is_unicode) { + Py_ssize_t length; + int kind; + void *data1, *data2; + if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0)) + return -1; + length = __Pyx_PyUnicode_GET_LENGTH(s1); + if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) { + goto return_ne; + } +#if CYTHON_USE_UNICODE_INTERNALS + { + Py_hash_t hash1, hash2; + #if CYTHON_PEP393_ENABLED + hash1 = ((PyASCIIObject*)s1)->hash; + hash2 = ((PyASCIIObject*)s2)->hash; + #else + hash1 = ((PyUnicodeObject*)s1)->hash; + hash2 = ((PyUnicodeObject*)s2)->hash; + #endif + if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { + goto return_ne; + } + } +#endif + kind = __Pyx_PyUnicode_KIND(s1); + if (kind != __Pyx_PyUnicode_KIND(s2)) { + goto return_ne; + } + data1 = __Pyx_PyUnicode_DATA(s1); + data2 = __Pyx_PyUnicode_DATA(s2); + if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) { + goto return_ne; + } else if (length == 1) { + goto return_eq; + } else { + int result = memcmp(data1, data2, (size_t)(length * kind)); + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_EQ) ? (result == 0) : (result != 0); + } + } else if ((s1 == Py_None) & s2_is_unicode) { + goto return_ne; + } else if ((s2 == Py_None) & s1_is_unicode) { + goto return_ne; + } else { + int result; + PyObject* py_result = PyObject_RichCompare(s1, s2, equals); + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + if (!py_result) + return -1; + result = __Pyx_PyObject_IsTrue(py_result); + Py_DECREF(py_result); + return result; + } +return_eq: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_EQ); +return_ne: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_NE); +#endif +} + +/* GetItemInt */ +static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { + PyObject *r; + if (!j) return NULL; + r = PyObject_GetItem(o, j); + Py_DECREF(j); + return r; +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, + CYTHON_NCP_UNUSED int wraparound, + CYTHON_NCP_UNUSED int boundscheck) { +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + Py_ssize_t wrapped_i = i; + if (wraparound & unlikely(i < 0)) { + wrapped_i += PyList_GET_SIZE(o); + } + if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) { + PyObject *r = PyList_GET_ITEM(o, wrapped_i); + Py_INCREF(r); + return r; + } + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +#else + return PySequence_GetItem(o, i); +#endif +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, + CYTHON_NCP_UNUSED int wraparound, + CYTHON_NCP_UNUSED int boundscheck) { +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + Py_ssize_t wrapped_i = i; + if (wraparound & unlikely(i < 0)) { + wrapped_i += PyTuple_GET_SIZE(o); + } + if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) { + PyObject *r = PyTuple_GET_ITEM(o, wrapped_i); + Py_INCREF(r); + return r; + } + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +#else + return PySequence_GetItem(o, i); +#endif +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, + CYTHON_NCP_UNUSED int wraparound, + CYTHON_NCP_UNUSED int boundscheck) { +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS + if (is_list || PyList_CheckExact(o)) { + Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); + if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) { + PyObject *r = PyList_GET_ITEM(o, n); + Py_INCREF(r); + return r; + } + } + else if (PyTuple_CheckExact(o)) { + Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o); + if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) { + PyObject *r = PyTuple_GET_ITEM(o, n); + Py_INCREF(r); + return r; + } + } else { + PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence; + if (likely(m && m->sq_item)) { + if (wraparound && unlikely(i < 0) && likely(m->sq_length)) { + Py_ssize_t l = m->sq_length(o); + if (likely(l >= 0)) { + i += l; + } else { + if (!PyErr_ExceptionMatches(PyExc_OverflowError)) + return NULL; + PyErr_Clear(); + } + } + return m->sq_item(o, i); + } + } +#else + if (is_list || PySequence_Check(o)) { + return PySequence_GetItem(o, i); + } +#endif + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +} + +/* ObjectGetItem */ +#if CYTHON_USE_TYPE_SLOTS +static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject* index) { + PyObject *runerr; + Py_ssize_t key_value; + PySequenceMethods *m = Py_TYPE(obj)->tp_as_sequence; + if (unlikely(!(m && m->sq_item))) { + PyErr_Format(PyExc_TypeError, "'%.200s' object is not subscriptable", Py_TYPE(obj)->tp_name); + return NULL; + } + key_value = __Pyx_PyIndex_AsSsize_t(index); + if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) { + return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1); + } + if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) { + PyErr_Clear(); + PyErr_Format(PyExc_IndexError, "cannot fit '%.200s' into an index-sized integer", Py_TYPE(index)->tp_name); + } + return NULL; +} +static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key) { + PyMappingMethods *m = Py_TYPE(obj)->tp_as_mapping; + if (likely(m && m->mp_subscript)) { + return m->mp_subscript(obj, key); + } + return __Pyx_PyObject_GetIndex(obj, key); +} +#endif + +/* HasAttr */ +static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) { + PyObject *r; + if (unlikely(!__Pyx_PyBaseString_Check(n))) { + PyErr_SetString(PyExc_TypeError, + "hasattr(): attribute name must be string"); + return -1; + } + r = __Pyx_GetAttr(o, n); + if (unlikely(!r)) { + PyErr_Clear(); + return 0; + } else { + Py_DECREF(r); + return 1; + } +} + +/* SliceTupleAndList */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE void __Pyx_crop_slice(Py_ssize_t* _start, Py_ssize_t* _stop, Py_ssize_t* _length) { + Py_ssize_t start = *_start, stop = *_stop, length = *_length; + if (start < 0) { + start += length; + if (start < 0) + start = 0; + } + if (stop < 0) + stop += length; + else if (stop > length) + stop = length; + *_length = stop - start; + *_start = start; + *_stop = stop; +} +static CYTHON_INLINE void __Pyx_copy_object_array(PyObject** CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length) { + PyObject *v; + Py_ssize_t i; + for (i = 0; i < length; i++) { + v = dest[i] = src[i]; + Py_INCREF(v); + } +} +static CYTHON_INLINE PyObject* __Pyx_PyList_GetSlice( + PyObject* src, Py_ssize_t start, Py_ssize_t stop) { + PyObject* dest; + Py_ssize_t length = PyList_GET_SIZE(src); + __Pyx_crop_slice(&start, &stop, &length); + if (unlikely(length <= 0)) + return PyList_New(0); + dest = PyList_New(length); + if (unlikely(!dest)) + return NULL; + __Pyx_copy_object_array( + ((PyListObject*)src)->ob_item + start, + ((PyListObject*)dest)->ob_item, + length); + return dest; +} +static CYTHON_INLINE PyObject* __Pyx_PyTuple_GetSlice( + PyObject* src, Py_ssize_t start, Py_ssize_t stop) { + PyObject* dest; + Py_ssize_t length = PyTuple_GET_SIZE(src); + __Pyx_crop_slice(&start, &stop, &length); + if (unlikely(length <= 0)) + return PyTuple_New(0); + dest = PyTuple_New(length); + if (unlikely(!dest)) + return NULL; + __Pyx_copy_object_array( + ((PyTupleObject*)src)->ob_item + start, + ((PyTupleObject*)dest)->ob_item, + length); + return dest; +} +#endif + +/* TypeImport */ +#ifndef __PYX_HAVE_RT_ImportType +#define __PYX_HAVE_RT_ImportType +static PyTypeObject *__Pyx_ImportType(PyObject *module, const char *module_name, const char *class_name, + size_t size, enum __Pyx_ImportType_CheckSize check_size) +{ + PyObject *result = 0; + char warning[200]; + Py_ssize_t basicsize; +#ifdef Py_LIMITED_API + PyObject *py_basicsize; +#endif + result = PyObject_GetAttrString(module, class_name); + if (!result) + goto bad; + if (!PyType_Check(result)) { + PyErr_Format(PyExc_TypeError, + "%.200s.%.200s is not a type object", + module_name, class_name); + goto bad; + } +#ifndef Py_LIMITED_API + basicsize = ((PyTypeObject *)result)->tp_basicsize; +#else + py_basicsize = PyObject_GetAttrString(result, "__basicsize__"); + if (!py_basicsize) + goto bad; + basicsize = PyLong_AsSsize_t(py_basicsize); + Py_DECREF(py_basicsize); + py_basicsize = 0; + if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred()) + goto bad; +#endif + if ((size_t)basicsize < size) { + PyErr_Format(PyExc_ValueError, + "%.200s.%.200s size changed, may indicate binary incompatibility. " + "Expected %zd from C header, got %zd from PyObject", + module_name, class_name, size, basicsize); + goto bad; + } + if (check_size == __Pyx_ImportType_CheckSize_Error && (size_t)basicsize != size) { + PyErr_Format(PyExc_ValueError, + "%.200s.%.200s size changed, may indicate binary incompatibility. " + "Expected %zd from C header, got %zd from PyObject", + module_name, class_name, size, basicsize); + goto bad; + } + else if (check_size == __Pyx_ImportType_CheckSize_Warn && (size_t)basicsize > size) { + PyOS_snprintf(warning, sizeof(warning), + "%s.%s size changed, may indicate binary incompatibility. " + "Expected %zd from C header, got %zd from PyObject", + module_name, class_name, size, basicsize); + if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad; + } + return (PyTypeObject *)result; +bad: + Py_XDECREF(result); + return NULL; +} +#endif + +/* PyObject_GenericGetAttrNoDict */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) { + PyErr_Format(PyExc_AttributeError, +#if PY_MAJOR_VERSION >= 3 + "'%.50s' object has no attribute '%U'", + tp->tp_name, attr_name); +#else + "'%.50s' object has no attribute '%.400s'", + tp->tp_name, PyString_AS_STRING(attr_name)); +#endif + return NULL; +} +static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) { + PyObject *descr; + PyTypeObject *tp = Py_TYPE(obj); + if (unlikely(!PyString_Check(attr_name))) { + return PyObject_GenericGetAttr(obj, attr_name); + } + assert(!tp->tp_dictoffset); + descr = _PyType_Lookup(tp, attr_name); + if (unlikely(!descr)) { + return __Pyx_RaiseGenericGetAttributeError(tp, attr_name); + } + Py_INCREF(descr); + #if PY_MAJOR_VERSION < 3 + if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS))) + #endif + { + descrgetfunc f = Py_TYPE(descr)->tp_descr_get; + if (unlikely(f)) { + PyObject *res = f(descr, obj, (PyObject *)tp); + Py_DECREF(descr); + return res; + } + } + return descr; +} +#endif + +/* SetVTable */ +static int __Pyx_SetVtable(PyObject *dict, void *vtable) { +#if PY_VERSION_HEX >= 0x02070000 + PyObject *ob = PyCapsule_New(vtable, 0, 0); +#else + PyObject *ob = PyCObject_FromVoidPtr(vtable, 0); +#endif + if (!ob) + goto bad; + if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0) + goto bad; + Py_DECREF(ob); + return 0; +bad: + Py_XDECREF(ob); + return -1; +} + +/* GetVTable */ +static void* __Pyx_GetVtable(PyObject *dict) { + void* ptr; + PyObject *ob = PyObject_GetItem(dict, __pyx_n_s_pyx_vtable); + if (!ob) + goto bad; +#if PY_VERSION_HEX >= 0x02070000 + ptr = PyCapsule_GetPointer(ob, 0); +#else + ptr = PyCObject_AsVoidPtr(ob); +#endif + if (!ptr && !PyErr_Occurred()) + PyErr_SetString(PyExc_RuntimeError, "invalid vtable found for imported type"); + Py_DECREF(ob); + return ptr; +bad: + Py_XDECREF(ob); + return NULL; +} + +/* Import */ +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { + PyObject *empty_list = 0; + PyObject *module = 0; + PyObject *global_dict = 0; + PyObject *empty_dict = 0; + PyObject *list; + #if PY_MAJOR_VERSION < 3 + PyObject *py_import; + py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); + if (!py_import) + goto bad; + #endif + if (from_list) + list = from_list; + else { + empty_list = PyList_New(0); + if (!empty_list) + goto bad; + list = empty_list; + } + global_dict = PyModule_GetDict(__pyx_m); + if (!global_dict) + goto bad; + empty_dict = PyDict_New(); + if (!empty_dict) + goto bad; + { + #if PY_MAJOR_VERSION >= 3 + if (level == -1) { + if (strchr(__Pyx_MODULE_NAME, '.')) { + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, 1); + if (!module) { + if (!PyErr_ExceptionMatches(PyExc_ImportError)) + goto bad; + PyErr_Clear(); + } + } + level = 0; + } + #endif + if (!module) { + #if PY_MAJOR_VERSION < 3 + PyObject *py_level = PyInt_FromLong(level); + if (!py_level) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, py_level, (PyObject *)NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, level); + #endif + } + } +bad: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(py_import); + #endif + Py_XDECREF(empty_list); + Py_XDECREF(empty_dict); + return module; +} + +/* ImportFrom */ +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { + PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); + if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_Format(PyExc_ImportError, + #if PY_MAJOR_VERSION < 3 + "cannot import name %.230s", PyString_AS_STRING(name)); + #else + "cannot import name %S", name); + #endif + } + return value; +} + +/* FetchCommonType */ +static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { + PyObject* fake_module; + PyTypeObject* cached_type = NULL; + fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI); + if (!fake_module) return NULL; + Py_INCREF(fake_module); + cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name); + if (cached_type) { + if (!PyType_Check((PyObject*)cached_type)) { + PyErr_Format(PyExc_TypeError, + "Shared Cython type %.200s is not a type object", + type->tp_name); + goto bad; + } + if (cached_type->tp_basicsize != type->tp_basicsize) { + PyErr_Format(PyExc_TypeError, + "Shared Cython type %.200s has the wrong size, try recompiling", + type->tp_name); + goto bad; + } + } else { + if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; + PyErr_Clear(); + if (PyType_Ready(type) < 0) goto bad; + if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0) + goto bad; + Py_INCREF(type); + cached_type = type; + } +done: + Py_DECREF(fake_module); + return cached_type; +bad: + Py_XDECREF(cached_type); + cached_type = NULL; + goto done; +} + +/* CythonFunction */ +#include +static PyObject * +__Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure) +{ + if (unlikely(op->func_doc == NULL)) { + if (op->func.m_ml->ml_doc) { +#if PY_MAJOR_VERSION >= 3 + op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc); +#else + op->func_doc = PyString_FromString(op->func.m_ml->ml_doc); +#endif + if (unlikely(op->func_doc == NULL)) + return NULL; + } else { + Py_INCREF(Py_None); + return Py_None; + } + } + Py_INCREF(op->func_doc); + return op->func_doc; +} +static int +__Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context) +{ + PyObject *tmp = op->func_doc; + if (value == NULL) { + value = Py_None; + } + Py_INCREF(value); + op->func_doc = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + if (unlikely(op->func_name == NULL)) { +#if PY_MAJOR_VERSION >= 3 + op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name); +#else + op->func_name = PyString_InternFromString(op->func.m_ml->ml_name); +#endif + if (unlikely(op->func_name == NULL)) + return NULL; + } + Py_INCREF(op->func_name); + return op->func_name; +} +static int +__Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context) +{ + PyObject *tmp; +#if PY_MAJOR_VERSION >= 3 + if (unlikely(value == NULL || !PyUnicode_Check(value))) +#else + if (unlikely(value == NULL || !PyString_Check(value))) +#endif + { + PyErr_SetString(PyExc_TypeError, + "__name__ must be set to a string object"); + return -1; + } + tmp = op->func_name; + Py_INCREF(value); + op->func_name = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + Py_INCREF(op->func_qualname); + return op->func_qualname; +} +static int +__Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context) +{ + PyObject *tmp; +#if PY_MAJOR_VERSION >= 3 + if (unlikely(value == NULL || !PyUnicode_Check(value))) +#else + if (unlikely(value == NULL || !PyString_Check(value))) +#endif + { + PyErr_SetString(PyExc_TypeError, + "__qualname__ must be set to a string object"); + return -1; + } + tmp = op->func_qualname; + Py_INCREF(value); + op->func_qualname = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED void *closure) +{ + PyObject *self; + self = m->func_closure; + if (self == NULL) + self = Py_None; + Py_INCREF(self); + return self; +} +static PyObject * +__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + if (unlikely(op->func_dict == NULL)) { + op->func_dict = PyDict_New(); + if (unlikely(op->func_dict == NULL)) + return NULL; + } + Py_INCREF(op->func_dict); + return op->func_dict; +} +static int +__Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context) +{ + PyObject *tmp; + if (unlikely(value == NULL)) { + PyErr_SetString(PyExc_TypeError, + "function's dictionary may not be deleted"); + return -1; + } + if (unlikely(!PyDict_Check(value))) { + PyErr_SetString(PyExc_TypeError, + "setting function's dictionary to a non-dict"); + return -1; + } + tmp = op->func_dict; + Py_INCREF(value); + op->func_dict = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + Py_INCREF(op->func_globals); + return op->func_globals; +} +static PyObject * +__Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + Py_INCREF(Py_None); + return Py_None; +} +static PyObject * +__Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + PyObject* result = (op->func_code) ? op->func_code : Py_None; + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { + int result = 0; + PyObject *res = op->defaults_getter((PyObject *) op); + if (unlikely(!res)) + return -1; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + op->defaults_tuple = PyTuple_GET_ITEM(res, 0); + Py_INCREF(op->defaults_tuple); + op->defaults_kwdict = PyTuple_GET_ITEM(res, 1); + Py_INCREF(op->defaults_kwdict); + #else + op->defaults_tuple = PySequence_ITEM(res, 0); + if (unlikely(!op->defaults_tuple)) result = -1; + else { + op->defaults_kwdict = PySequence_ITEM(res, 1); + if (unlikely(!op->defaults_kwdict)) result = -1; + } + #endif + Py_DECREF(res); + return result; +} +static int +__Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) { + PyObject* tmp; + if (!value) { + value = Py_None; + } else if (value != Py_None && !PyTuple_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__defaults__ must be set to a tuple object"); + return -1; + } + Py_INCREF(value); + tmp = op->defaults_tuple; + op->defaults_tuple = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) { + PyObject* result = op->defaults_tuple; + if (unlikely(!result)) { + if (op->defaults_getter) { + if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL; + result = op->defaults_tuple; + } else { + result = Py_None; + } + } + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) { + PyObject* tmp; + if (!value) { + value = Py_None; + } else if (value != Py_None && !PyDict_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__kwdefaults__ must be set to a dict object"); + return -1; + } + Py_INCREF(value); + tmp = op->defaults_kwdict; + op->defaults_kwdict = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) { + PyObject* result = op->defaults_kwdict; + if (unlikely(!result)) { + if (op->defaults_getter) { + if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL; + result = op->defaults_kwdict; + } else { + result = Py_None; + } + } + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) { + PyObject* tmp; + if (!value || value == Py_None) { + value = NULL; + } else if (!PyDict_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__annotations__ must be set to a dict object"); + return -1; + } + Py_XINCREF(value); + tmp = op->func_annotations; + op->func_annotations = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) { + PyObject* result = op->func_annotations; + if (unlikely(!result)) { + result = PyDict_New(); + if (unlikely(!result)) return NULL; + op->func_annotations = result; + } + Py_INCREF(result); + return result; +} +static PyGetSetDef __pyx_CyFunction_getsets[] = { + {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, + {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, + {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, + {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, + {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, + {(char *) "__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0}, + {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, + {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, + {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, + {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, + {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, + {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, + {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, + {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, + {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, + {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, + {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, + {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, + {0, 0, 0, 0, 0} +}; +static PyMemberDef __pyx_CyFunction_members[] = { + {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), PY_WRITE_RESTRICTED, 0}, + {0, 0, 0, 0, 0} +}; +static PyObject * +__Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args) +{ +#if PY_MAJOR_VERSION >= 3 + return PyUnicode_FromString(m->func.m_ml->ml_name); +#else + return PyString_FromString(m->func.m_ml->ml_name); +#endif +} +static PyMethodDef __pyx_CyFunction_methods[] = { + {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, + {0, 0, 0, 0} +}; +#if PY_VERSION_HEX < 0x030500A0 +#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist) +#else +#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func.m_weakreflist) +#endif +static PyObject *__Pyx_CyFunction_New(PyTypeObject *type, PyMethodDef *ml, int flags, PyObject* qualname, + PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { + __pyx_CyFunctionObject *op = PyObject_GC_New(__pyx_CyFunctionObject, type); + if (op == NULL) + return NULL; + op->flags = flags; + __Pyx_CyFunction_weakreflist(op) = NULL; + op->func.m_ml = ml; + op->func.m_self = (PyObject *) op; + Py_XINCREF(closure); + op->func_closure = closure; + Py_XINCREF(module); + op->func.m_module = module; + op->func_dict = NULL; + op->func_name = NULL; + Py_INCREF(qualname); + op->func_qualname = qualname; + op->func_doc = NULL; + op->func_classobj = NULL; + op->func_globals = globals; + Py_INCREF(op->func_globals); + Py_XINCREF(code); + op->func_code = code; + op->defaults_pyobjects = 0; + op->defaults = NULL; + op->defaults_tuple = NULL; + op->defaults_kwdict = NULL; + op->defaults_getter = NULL; + op->func_annotations = NULL; + PyObject_GC_Track(op); + return (PyObject *) op; +} +static int +__Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) +{ + Py_CLEAR(m->func_closure); + Py_CLEAR(m->func.m_module); + Py_CLEAR(m->func_dict); + Py_CLEAR(m->func_name); + Py_CLEAR(m->func_qualname); + Py_CLEAR(m->func_doc); + Py_CLEAR(m->func_globals); + Py_CLEAR(m->func_code); + Py_CLEAR(m->func_classobj); + Py_CLEAR(m->defaults_tuple); + Py_CLEAR(m->defaults_kwdict); + Py_CLEAR(m->func_annotations); + if (m->defaults) { + PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); + int i; + for (i = 0; i < m->defaults_pyobjects; i++) + Py_XDECREF(pydefaults[i]); + PyObject_Free(m->defaults); + m->defaults = NULL; + } + return 0; +} +static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m) +{ + if (__Pyx_CyFunction_weakreflist(m) != NULL) + PyObject_ClearWeakRefs((PyObject *) m); + __Pyx_CyFunction_clear(m); + PyObject_GC_Del(m); +} +static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) +{ + PyObject_GC_UnTrack(m); + __Pyx__CyFunction_dealloc(m); +} +static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) +{ + Py_VISIT(m->func_closure); + Py_VISIT(m->func.m_module); + Py_VISIT(m->func_dict); + Py_VISIT(m->func_name); + Py_VISIT(m->func_qualname); + Py_VISIT(m->func_doc); + Py_VISIT(m->func_globals); + Py_VISIT(m->func_code); + Py_VISIT(m->func_classobj); + Py_VISIT(m->defaults_tuple); + Py_VISIT(m->defaults_kwdict); + if (m->defaults) { + PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); + int i; + for (i = 0; i < m->defaults_pyobjects; i++) + Py_VISIT(pydefaults[i]); + } + return 0; +} +static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type) +{ + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) { + Py_INCREF(func); + return func; + } + if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) { + if (type == NULL) + type = (PyObject *)(Py_TYPE(obj)); + return __Pyx_PyMethod_New(func, type, (PyObject *)(Py_TYPE(type))); + } + if (obj == Py_None) + obj = NULL; + return __Pyx_PyMethod_New(func, obj, type); +} +static PyObject* +__Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) +{ +#if PY_MAJOR_VERSION >= 3 + return PyUnicode_FromFormat("", + op->func_qualname, (void *)op); +#else + return PyString_FromFormat("", + PyString_AsString(op->func_qualname), (void *)op); +#endif +} +static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) { + PyCFunctionObject* f = (PyCFunctionObject*)func; + PyCFunction meth = f->m_ml->ml_meth; + Py_ssize_t size; + switch (f->m_ml->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) { + case METH_VARARGS: + if (likely(kw == NULL || PyDict_Size(kw) == 0)) + return (*meth)(self, arg); + break; + case METH_VARARGS | METH_KEYWORDS: + return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw); + case METH_NOARGS: + if (likely(kw == NULL || PyDict_Size(kw) == 0)) { + size = PyTuple_GET_SIZE(arg); + if (likely(size == 0)) + return (*meth)(self, NULL); + PyErr_Format(PyExc_TypeError, + "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", + f->m_ml->ml_name, size); + return NULL; + } + break; + case METH_O: + if (likely(kw == NULL || PyDict_Size(kw) == 0)) { + size = PyTuple_GET_SIZE(arg); + if (likely(size == 1)) { + PyObject *result, *arg0; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + arg0 = PyTuple_GET_ITEM(arg, 0); + #else + arg0 = PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL; + #endif + result = (*meth)(self, arg0); + #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) + Py_DECREF(arg0); + #endif + return result; + } + PyErr_Format(PyExc_TypeError, + "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", + f->m_ml->ml_name, size); + return NULL; + } + break; + default: + PyErr_SetString(PyExc_SystemError, "Bad call flags in " + "__Pyx_CyFunction_Call. METH_OLDARGS is no " + "longer supported!"); + return NULL; + } + PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", + f->m_ml->ml_name); + return NULL; +} +static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { + return __Pyx_CyFunction_CallMethod(func, ((PyCFunctionObject*)func)->m_self, arg, kw); +} +static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) { + PyObject *result; + __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func; + if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { + Py_ssize_t argc; + PyObject *new_args; + PyObject *self; + argc = PyTuple_GET_SIZE(args); + new_args = PyTuple_GetSlice(args, 1, argc); + if (unlikely(!new_args)) + return NULL; + self = PyTuple_GetItem(args, 0); + if (unlikely(!self)) { + Py_DECREF(new_args); + return NULL; + } + result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw); + Py_DECREF(new_args); + } else { + result = __Pyx_CyFunction_Call(func, args, kw); + } + return result; +} +static PyTypeObject __pyx_CyFunctionType_type = { + PyVarObject_HEAD_INIT(0, 0) + "cython_function_or_method", + sizeof(__pyx_CyFunctionObject), + 0, + (destructor) __Pyx_CyFunction_dealloc, + 0, + 0, + 0, +#if PY_MAJOR_VERSION < 3 + 0, +#else + 0, +#endif + (reprfunc) __Pyx_CyFunction_repr, + 0, + 0, + 0, + 0, + __Pyx_CyFunction_CallAsMethod, + 0, + 0, + 0, + 0, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, + 0, + (traverseproc) __Pyx_CyFunction_traverse, + (inquiry) __Pyx_CyFunction_clear, + 0, +#if PY_VERSION_HEX < 0x030500A0 + offsetof(__pyx_CyFunctionObject, func_weakreflist), +#else + offsetof(PyCFunctionObject, m_weakreflist), +#endif + 0, + 0, + __pyx_CyFunction_methods, + __pyx_CyFunction_members, + __pyx_CyFunction_getsets, + 0, + 0, + __Pyx_CyFunction_descr_get, + 0, + offsetof(__pyx_CyFunctionObject, func_dict), + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, +#if PY_VERSION_HEX >= 0x030400a1 + 0, +#endif +}; +static int __pyx_CyFunction_init(void) { + __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); + if (unlikely(__pyx_CyFunctionType == NULL)) { + return -1; + } + return 0; +} +static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults = PyObject_Malloc(size); + if (unlikely(!m->defaults)) + return PyErr_NoMemory(); + memset(m->defaults, 0, size); + m->defaults_pyobjects = pyobjects; + return m->defaults; +} +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults_tuple = tuple; + Py_INCREF(tuple); +} +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults_kwdict = dict; + Py_INCREF(dict); +} +static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->func_annotations = dict; + Py_INCREF(dict); +} + +/* PyObjectSetAttrStr */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) { + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_setattro)) + return tp->tp_setattro(obj, attr_name, value); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_setattr)) + return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value); +#endif + return PyObject_SetAttr(obj, attr_name, value); +} +#endif + +/* GetModuleGlobalName */ +#if CYTHON_USE_DICT_VERSIONS +static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value) +#else +static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) +#endif +{ + PyObject *result; +#if !CYTHON_AVOID_BORROWED_REFS +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 + result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } else if (unlikely(PyErr_Occurred())) { + return NULL; + } +#else + result = PyDict_GetItem(__pyx_d, name); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } +#endif +#else + result = PyObject_GetItem(__pyx_d, name); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } + PyErr_Clear(); +#endif + return __Pyx_GetBuiltinName(name); +} + +/* Globals */ +static PyObject* __Pyx_Globals(void) { + Py_ssize_t i; + PyObject *names; + PyObject *globals = __pyx_d; + Py_INCREF(globals); + names = PyObject_Dir(__pyx_m); + if (!names) + goto bad; + for (i = PyList_GET_SIZE(names)-1; i >= 0; i--) { +#if CYTHON_COMPILING_IN_PYPY + PyObject* name = PySequence_ITEM(names, i); + if (!name) + goto bad; +#else + PyObject* name = PyList_GET_ITEM(names, i); +#endif + if (!PyDict_Contains(globals, name)) { + PyObject* value = __Pyx_GetAttr(__pyx_m, name); + if (!value) { +#if CYTHON_COMPILING_IN_PYPY + Py_DECREF(name); +#endif + goto bad; + } + if (PyDict_SetItem(globals, name, value) < 0) { +#if CYTHON_COMPILING_IN_PYPY + Py_DECREF(name); +#endif + Py_DECREF(value); + goto bad; + } + } +#if CYTHON_COMPILING_IN_PYPY + Py_DECREF(name); +#endif + } + Py_DECREF(names); + return globals; +bad: + Py_XDECREF(names); + Py_XDECREF(globals); + return NULL; +} + +/* CLineInTraceback */ +#ifndef CYTHON_CLINE_IN_TRACEBACK +static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { + PyObject *use_cline; + PyObject *ptype, *pvalue, *ptraceback; +#if CYTHON_COMPILING_IN_CPYTHON + PyObject **cython_runtime_dict; +#endif + if (unlikely(!__pyx_cython_runtime)) { + return c_line; + } + __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); +#if CYTHON_COMPILING_IN_CPYTHON + cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); + if (likely(cython_runtime_dict)) { + __PYX_PY_DICT_LOOKUP_IF_MODIFIED( + use_cline, *cython_runtime_dict, + __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback)) + } else +#endif + { + PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback); + if (use_cline_obj) { + use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; + Py_DECREF(use_cline_obj); + } else { + PyErr_Clear(); + use_cline = NULL; + } + } + if (!use_cline) { + c_line = 0; + PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); + } + else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { + c_line = 0; + } + __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); + return c_line; +} +#endif + +/* CodeObjectCache */ +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { + int start = 0, mid = 0, end = count - 1; + if (end >= 0 && code_line > entries[end].code_line) { + return count; + } + while (start < end) { + mid = start + (end - start) / 2; + if (code_line < entries[mid].code_line) { + end = mid; + } else if (code_line > entries[mid].code_line) { + start = mid + 1; + } else { + return mid; + } + } + if (code_line <= entries[mid].code_line) { + return mid; + } else { + return mid + 1; + } +} +static PyCodeObject *__pyx_find_code_object(int code_line) { + PyCodeObject* code_object; + int pos; + if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { + return NULL; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { + return NULL; + } + code_object = __pyx_code_cache.entries[pos].code_object; + Py_INCREF(code_object); + return code_object; +} +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { + int pos, i; + __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; + if (unlikely(!code_line)) { + return; + } + if (unlikely(!entries)) { + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); + if (likely(entries)) { + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = 64; + __pyx_code_cache.count = 1; + entries[0].code_line = code_line; + entries[0].code_object = code_object; + Py_INCREF(code_object); + } + return; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { + PyCodeObject* tmp = entries[pos].code_object; + entries[pos].code_object = code_object; + Py_DECREF(tmp); + return; + } + if (__pyx_code_cache.count == __pyx_code_cache.max_count) { + int new_max = __pyx_code_cache.max_count + 64; + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( + __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry)); + if (unlikely(!entries)) { + return; + } + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = new_max; + } + for (i=__pyx_code_cache.count; i>pos; i--) { + entries[i] = entries[i-1]; + } + entries[pos].code_line = code_line; + entries[pos].code_object = code_object; + __pyx_code_cache.count++; + Py_INCREF(code_object); +} + +/* AddTraceback */ +#include "compile.h" +#include "frameobject.h" +#include "traceback.h" +static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( + const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyObject *py_srcfile = 0; + PyObject *py_funcname = 0; + #if PY_MAJOR_VERSION < 3 + py_srcfile = PyString_FromString(filename); + #else + py_srcfile = PyUnicode_FromString(filename); + #endif + if (!py_srcfile) goto bad; + if (c_line) { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + #else + py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + #endif + } + else { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromString(funcname); + #else + py_funcname = PyUnicode_FromString(funcname); + #endif + } + if (!py_funcname) goto bad; + py_code = __Pyx_PyCode_New( + 0, + 0, + 0, + 0, + 0, + __pyx_empty_bytes, /*PyObject *code,*/ + __pyx_empty_tuple, /*PyObject *consts,*/ + __pyx_empty_tuple, /*PyObject *names,*/ + __pyx_empty_tuple, /*PyObject *varnames,*/ + __pyx_empty_tuple, /*PyObject *freevars,*/ + __pyx_empty_tuple, /*PyObject *cellvars,*/ + py_srcfile, /*PyObject *filename,*/ + py_funcname, /*PyObject *name,*/ + py_line, + __pyx_empty_bytes /*PyObject *lnotab*/ + ); + Py_DECREF(py_srcfile); + Py_DECREF(py_funcname); + return py_code; +bad: + Py_XDECREF(py_srcfile); + Py_XDECREF(py_funcname); + return NULL; +} +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyFrameObject *py_frame = 0; + PyThreadState *tstate = __Pyx_PyThreadState_Current; + if (c_line) { + c_line = __Pyx_CLineForTraceback(tstate, c_line); + } + py_code = __pyx_find_code_object(c_line ? -c_line : py_line); + if (!py_code) { + py_code = __Pyx_CreateCodeObjectForTraceback( + funcname, c_line, py_line, filename); + if (!py_code) goto bad; + __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); + } + py_frame = PyFrame_New( + tstate, /*PyThreadState *tstate,*/ + py_code, /*PyCodeObject *code,*/ + __pyx_d, /*PyObject *globals,*/ + 0 /*PyObject *locals*/ + ); + if (!py_frame) goto bad; + __Pyx_PyFrame_SetLineNumber(py_frame, py_line); + PyTraceBack_Here(py_frame); +bad: + Py_XDECREF(py_code); + Py_XDECREF(py_frame); +} + +/* CIntToPy */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { + const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(long) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(long) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(long) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(long), + little, !is_unsigned); + } +} + +/* CIntFromPyVerify */ +#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ + __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) +#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ + __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) +#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ + {\ + func_type value = func_value;\ + if (sizeof(target_type) < sizeof(func_type)) {\ + if (unlikely(value != (func_type) (target_type) value)) {\ + func_type zero = 0;\ + if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ + return (target_type) -1;\ + if (is_unsigned && unlikely(value < zero))\ + goto raise_neg_overflow;\ + else\ + goto raise_overflow;\ + }\ + }\ + return (target_type) value;\ + } + +/* CIntFromPy */ +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { + const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(long) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (long) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (long) 0; + case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0]) + case 2: + if (8 * sizeof(long) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) { + return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + case 3: + if (8 * sizeof(long) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) { + return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + case 4: + if (8 * sizeof(long) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) { + return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (long) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if (sizeof(long) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (long) 0; + case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0])) + case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0]) + case -2: + if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 2: + if (8 * sizeof(long) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case -3: + if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 3: + if (8 * sizeof(long) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case -4: + if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 4: + if (8 * sizeof(long) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + } +#endif + if (sizeof(long) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + long val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (long) -1; + } + } else { + long val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (long) -1; + val = __Pyx_PyInt_As_long(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to long"); + return (long) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to long"); + return (long) -1; +} + +/* CIntFromPy */ +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { + const int neg_one = (int) ((int) 0 - (int) 1), const_zero = (int) 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(int) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (int) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (int) 0; + case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0]) + case 2: + if (8 * sizeof(int) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) { + return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + case 3: + if (8 * sizeof(int) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) { + return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + case 4: + if (8 * sizeof(int) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) { + return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (int) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if (sizeof(int) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (int) 0; + case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0])) + case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0]) + case -2: + if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { + return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 2: + if (8 * sizeof(int) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { + return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case -3: + if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { + return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 3: + if (8 * sizeof(int) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { + return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case -4: + if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { + return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 4: + if (8 * sizeof(int) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { + return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + } +#endif + if (sizeof(int) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + int val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (int) -1; + } + } else { + int val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (int) -1; + val = __Pyx_PyInt_As_int(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to int"); + return (int) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to int"); + return (int) -1; +} + +/* FastTypeChecks */ +#if CYTHON_COMPILING_IN_CPYTHON +static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) { + while (a) { + a = a->tp_base; + if (a == b) + return 1; + } + return b == &PyBaseObject_Type; +} +static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) { + PyObject *mro; + if (a == b) return 1; + mro = a->tp_mro; + if (likely(mro)) { + Py_ssize_t i, n; + n = PyTuple_GET_SIZE(mro); + for (i = 0; i < n; i++) { + if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b) + return 1; + } + return 0; + } + return __Pyx_InBases(a, b); +} +#if PY_MAJOR_VERSION == 2 +static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { + PyObject *exception, *value, *tb; + int res; + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ErrFetch(&exception, &value, &tb); + res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; + if (unlikely(res == -1)) { + PyErr_WriteUnraisable(err); + res = 0; + } + if (!res) { + res = PyObject_IsSubclass(err, exc_type2); + if (unlikely(res == -1)) { + PyErr_WriteUnraisable(err); + res = 0; + } + } + __Pyx_ErrRestore(exception, value, tb); + return res; +} +#else +static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { + int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0; + if (!res) { + res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); + } + return res; +} +#endif +static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { + Py_ssize_t i, n; + assert(PyExceptionClass_Check(exc_type)); + n = PyTuple_GET_SIZE(tuple); +#if PY_MAJOR_VERSION >= 3 + for (i=0; i= 0x02070000 + cobj = PyCapsule_New(p, sig, 0); +#else + cobj = PyCObject_FromVoidPtrAndDesc(p, (void *)sig, 0); +#endif + if (!cobj) + goto bad; + if (PyDict_SetItem(d, name, cobj) < 0) + goto bad; + Py_DECREF(cobj); + Py_DECREF(d); + return 0; +bad: + Py_XDECREF(cobj); + Py_XDECREF(d); + return -1; +} + +/* FunctionExport */ +static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig) { + PyObject *d = 0; + PyObject *cobj = 0; + union { + void (*fp)(void); + void *p; + } tmp; + d = PyObject_GetAttrString(__pyx_m, (char *)"__pyx_capi__"); + if (!d) { + PyErr_Clear(); + d = PyDict_New(); + if (!d) + goto bad; + Py_INCREF(d); + if (PyModule_AddObject(__pyx_m, (char *)"__pyx_capi__", d) < 0) + goto bad; + } + tmp.fp = f; +#if PY_VERSION_HEX >= 0x02070000 + cobj = PyCapsule_New(tmp.p, sig, 0); +#else + cobj = PyCObject_FromVoidPtrAndDesc(tmp.p, (void *)sig, 0); +#endif + if (!cobj) + goto bad; + if (PyDict_SetItemString(d, name, cobj) < 0) + goto bad; + Py_DECREF(cobj); + Py_DECREF(d); + return 0; +bad: + Py_XDECREF(cobj); + Py_XDECREF(d); + return -1; +} + +/* VoidPtrImport */ +#ifndef __PYX_HAVE_RT_ImportVoidPtr +#define __PYX_HAVE_RT_ImportVoidPtr +static int __Pyx_ImportVoidPtr(PyObject *module, const char *name, void **p, const char *sig) { + PyObject *d = 0; + PyObject *cobj = 0; + d = PyObject_GetAttrString(module, (char *)"__pyx_capi__"); + if (!d) + goto bad; + cobj = PyDict_GetItemString(d, name); + if (!cobj) { + PyErr_Format(PyExc_ImportError, + "%.200s does not export expected C variable %.200s", + PyModule_GetName(module), name); + goto bad; + } +#if PY_VERSION_HEX >= 0x02070000 + if (!PyCapsule_IsValid(cobj, sig)) { + PyErr_Format(PyExc_TypeError, + "C variable %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", + PyModule_GetName(module), name, sig, PyCapsule_GetName(cobj)); + goto bad; + } + *p = PyCapsule_GetPointer(cobj, sig); +#else + {const char *desc, *s1, *s2; + desc = (const char *)PyCObject_GetDesc(cobj); + if (!desc) + goto bad; + s1 = desc; s2 = sig; + while (*s1 != '\0' && *s1 == *s2) { s1++; s2++; } + if (*s1 != *s2) { + PyErr_Format(PyExc_TypeError, + "C variable %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", + PyModule_GetName(module), name, sig, desc); + goto bad; + } + *p = PyCObject_AsVoidPtr(cobj);} +#endif + if (!(*p)) + goto bad; + Py_DECREF(d); + return 0; +bad: + Py_XDECREF(d); + return -1; +} +#endif + +/* FunctionImport */ +#ifndef __PYX_HAVE_RT_ImportFunction +#define __PYX_HAVE_RT_ImportFunction +static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig) { + PyObject *d = 0; + PyObject *cobj = 0; + union { + void (*fp)(void); + void *p; + } tmp; + d = PyObject_GetAttrString(module, (char *)"__pyx_capi__"); + if (!d) + goto bad; + cobj = PyDict_GetItemString(d, funcname); + if (!cobj) { + PyErr_Format(PyExc_ImportError, + "%.200s does not export expected C function %.200s", + PyModule_GetName(module), funcname); + goto bad; + } +#if PY_VERSION_HEX >= 0x02070000 + if (!PyCapsule_IsValid(cobj, sig)) { + PyErr_Format(PyExc_TypeError, + "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", + PyModule_GetName(module), funcname, sig, PyCapsule_GetName(cobj)); + goto bad; + } + tmp.p = PyCapsule_GetPointer(cobj, sig); +#else + {const char *desc, *s1, *s2; + desc = (const char *)PyCObject_GetDesc(cobj); + if (!desc) + goto bad; + s1 = desc; s2 = sig; + while (*s1 != '\0' && *s1 == *s2) { s1++; s2++; } + if (*s1 != *s2) { + PyErr_Format(PyExc_TypeError, + "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", + PyModule_GetName(module), funcname, sig, desc); + goto bad; + } + tmp.p = PyCObject_AsVoidPtr(cobj);} +#endif + *f = tmp.fp; + if (!(*f)) + goto bad; + Py_DECREF(d); + return 0; +bad: + Py_XDECREF(d); + return -1; +} +#endif + +/* InitStrings */ +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { + while (t->p) { + #if PY_MAJOR_VERSION < 3 + if (t->is_unicode) { + *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); + } else if (t->intern) { + *t->p = PyString_InternFromString(t->s); + } else { + *t->p = PyString_FromStringAndSize(t->s, t->n - 1); + } + #else + if (t->is_unicode | t->is_str) { + if (t->intern) { + *t->p = PyUnicode_InternFromString(t->s); + } else if (t->encoding) { + *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); + } else { + *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); + } + } else { + *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); + } + #endif + if (!*t->p) + return -1; + if (PyObject_Hash(*t->p) == -1) + return -1; + ++t; + } + return 0; +} + +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { + return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); +} +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { + Py_ssize_t ignore; + return __Pyx_PyObject_AsStringAndSize(o, &ignore); +} +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +#if !CYTHON_PEP393_ENABLED +static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { + char* defenc_c; + PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); + if (!defenc) return NULL; + defenc_c = PyBytes_AS_STRING(defenc); +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + { + char* end = defenc_c + PyBytes_GET_SIZE(defenc); + char* c; + for (c = defenc_c; c < end; c++) { + if ((unsigned char) (*c) >= 128) { + PyUnicode_AsASCIIString(o); + return NULL; + } + } + } +#endif + *length = PyBytes_GET_SIZE(defenc); + return defenc_c; +} +#else +static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { + if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + if (likely(PyUnicode_IS_ASCII(o))) { + *length = PyUnicode_GET_LENGTH(o); + return PyUnicode_AsUTF8(o); + } else { + PyUnicode_AsASCIIString(o); + return NULL; + } +#else + return PyUnicode_AsUTF8AndSize(o, length); +#endif +} +#endif +#endif +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT + if ( +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + __Pyx_sys_getdefaultencoding_not_ascii && +#endif + PyUnicode_Check(o)) { + return __Pyx_PyUnicode_AsStringAndSize(o, length); + } else +#endif +#if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) + if (PyByteArray_Check(o)) { + *length = PyByteArray_GET_SIZE(o); + return PyByteArray_AS_STRING(o); + } else +#endif + { + char* result; + int r = PyBytes_AsStringAndSize(o, &result, length); + if (unlikely(r < 0)) { + return NULL; + } else { + return result; + } + } +} +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { + int is_true = x == Py_True; + if (is_true | (x == Py_False) | (x == Py_None)) return is_true; + else return PyObject_IsTrue(x); +} +static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) { + int retval; + if (unlikely(!x)) return -1; + retval = __Pyx_PyObject_IsTrue(x); + Py_DECREF(x); + return retval; +} +static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) { +#if PY_MAJOR_VERSION >= 3 + if (PyLong_Check(result)) { + if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, + "__int__ returned non-int (type %.200s). " + "The ability to return an instance of a strict subclass of int " + "is deprecated, and may be removed in a future version of Python.", + Py_TYPE(result)->tp_name)) { + Py_DECREF(result); + return NULL; + } + return result; + } +#endif + PyErr_Format(PyExc_TypeError, + "__%.4s__ returned non-%.4s (type %.200s)", + type_name, type_name, Py_TYPE(result)->tp_name); + Py_DECREF(result); + return NULL; +} +static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { +#if CYTHON_USE_TYPE_SLOTS + PyNumberMethods *m; +#endif + const char *name = NULL; + PyObject *res = NULL; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x) || PyLong_Check(x))) +#else + if (likely(PyLong_Check(x))) +#endif + return __Pyx_NewRef(x); +#if CYTHON_USE_TYPE_SLOTS + m = Py_TYPE(x)->tp_as_number; + #if PY_MAJOR_VERSION < 3 + if (m && m->nb_int) { + name = "int"; + res = m->nb_int(x); + } + else if (m && m->nb_long) { + name = "long"; + res = m->nb_long(x); + } + #else + if (likely(m && m->nb_int)) { + name = "int"; + res = m->nb_int(x); + } + #endif +#else + if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { + res = PyNumber_Int(x); + } +#endif + if (likely(res)) { +#if PY_MAJOR_VERSION < 3 + if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) { +#else + if (unlikely(!PyLong_CheckExact(res))) { +#endif + return __Pyx_PyNumber_IntOrLongWrongResultType(res, name); + } + } + else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_TypeError, + "an integer is required"); + } + return res; +} +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { + Py_ssize_t ival; + PyObject *x; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_CheckExact(b))) { + if (sizeof(Py_ssize_t) >= sizeof(long)) + return PyInt_AS_LONG(b); + else + return PyInt_AsSsize_t(b); + } +#endif + if (likely(PyLong_CheckExact(b))) { + #if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)b)->ob_digit; + const Py_ssize_t size = Py_SIZE(b); + if (likely(__Pyx_sst_abs(size) <= 1)) { + ival = likely(size) ? digits[0] : 0; + if (size == -1) ival = -ival; + return ival; + } else { + switch (size) { + case 2: + if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { + return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -2: + if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case 3: + if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { + return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -3: + if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case 4: + if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { + return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -4: + if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + } + } + #endif + return PyLong_AsSsize_t(b); + } + x = PyNumber_Index(b); + if (!x) return -1; + ival = PyInt_AsSsize_t(x); + Py_DECREF(x); + return ival; +} +static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) { + return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False); +} +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { + return PyInt_FromSize_t(ival); +} + + +#endif /* Py_PYTHON_H */ diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/local.html b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/local.html new file mode 100644 index 00000000..6bf32d55 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/local.html @@ -0,0 +1,4282 @@ + + + + + + Cython: local.py + + + +

Generated by Cython 0.29.2

+

+ Yellow lines hint at Python interaction.
+ Click on a line that starts with a "+" to see the C code that Cython generated for it. +

+
+
+001: # cython: auto_pickle=False,embedsignature=True,always_allow_keywords=False
+
  __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 002: """
+
 003: Greenlet-local objects.
+
 004: 
+
 005: This module is based on `_threading_local.py`__ from the standard
+
 006: library of Python 3.4.
+
 007: 
+
 008: __ https://github.com/python/cpython/blob/3.4/Lib/_threading_local.py
+
 009: 
+
 010: Greenlet-local objects support the management of greenlet-local data.
+
 011: If you have data that you want to be local to a greenlet, simply create
+
 012: a greenlet-local object and use its attributes:
+
 013: 
+
 014:   >>> mydata = local()
+
 015:   >>> mydata.number = 42
+
 016:   >>> mydata.number
+
 017:   42
+
 018: 
+
 019: You can also access the local-object's dictionary:
+
 020: 
+
 021:   >>> mydata.__dict__
+
 022:   {'number': 42}
+
 023:   >>> mydata.__dict__.setdefault('widgets', [])
+
 024:   []
+
 025:   >>> mydata.widgets
+
 026:   []
+
 027: 
+
 028: What's important about greenlet-local objects is that their data are
+
 029: local to a greenlet. If we access the data in a different greenlet:
+
 030: 
+
 031:   >>> log = []
+
 032:   >>> def f():
+
 033:   ...     items = list(mydata.__dict__.items())
+
 034:   ...     items.sort()
+
 035:   ...     log.append(items)
+
 036:   ...     mydata.number = 11
+
 037:   ...     log.append(mydata.number)
+
 038:   >>> greenlet = gevent.spawn(f)
+
 039:   >>> greenlet.join()
+
 040:   >>> log
+
 041:   [[], 11]
+
 042: 
+
 043: we get different data.  Furthermore, changes made in the other greenlet
+
 044: don't affect data seen in this greenlet:
+
 045: 
+
 046:   >>> mydata.number
+
 047:   42
+
 048: 
+
 049: Of course, values you get from a local object, including a __dict__
+
 050: attribute, are for whatever greenlet was current at the time the
+
 051: attribute was read.  For that reason, you generally don't want to save
+
 052: these values across greenlets, as they apply only to the greenlet they
+
 053: came from.
+
 054: 
+
 055: You can create custom local objects by subclassing the local class:
+
 056: 
+
 057:   >>> class MyLocal(local):
+
 058:   ...     number = 2
+
 059:   ...     initialized = False
+
 060:   ...     def __init__(self, **kw):
+
 061:   ...         if self.initialized:
+
 062:   ...             raise SystemError('__init__ called too many times')
+
 063:   ...         self.initialized = True
+
 064:   ...         self.__dict__.update(kw)
+
 065:   ...     def squared(self):
+
 066:   ...         return self.number ** 2
+
 067: 
+
 068: This can be useful to support default values, methods and
+
 069: initialization.  Note that if you define an __init__ method, it will be
+
 070: called each time the local object is used in a separate greenlet.  This
+
 071: is necessary to initialize each greenlet's dictionary.
+
 072: 
+
 073: Now if we create a local object:
+
 074: 
+
 075:   >>> mydata = MyLocal(color='red')
+
 076: 
+
 077: Now we have a default number:
+
 078: 
+
 079:   >>> mydata.number
+
 080:   2
+
 081: 
+
 082: an initial color:
+
 083: 
+
 084:   >>> mydata.color
+
 085:   'red'
+
 086:   >>> del mydata.color
+
 087: 
+
 088: And a method that operates on the data:
+
 089: 
+
 090:   >>> mydata.squared()
+
 091:   4
+
 092: 
+
 093: As before, we can access the data in a separate greenlet:
+
 094: 
+
 095:   >>> log = []
+
 096:   >>> greenlet = gevent.spawn(f)
+
 097:   >>> greenlet.join()
+
 098:   >>> log
+
 099:   [[('color', 'red'), ('initialized', True)], 11]
+
 100: 
+
 101: without affecting this greenlet's data:
+
 102: 
+
 103:   >>> mydata.number
+
 104:   2
+
 105:   >>> mydata.color
+
 106:   Traceback (most recent call last):
+
 107:   ...
+
 108:   AttributeError: 'MyLocal' object has no attribute 'color'
+
 109: 
+
 110: Note that subclasses can define slots, but they are not greenlet
+
 111: local. They are shared across greenlets::
+
 112: 
+
 113:   >>> class MyLocal(local):
+
 114:   ...     __slots__ = 'number'
+
 115: 
+
 116:   >>> mydata = MyLocal()
+
 117:   >>> mydata.number = 42
+
 118:   >>> mydata.color = 'red'
+
 119: 
+
 120: So, the separate greenlet:
+
 121: 
+
 122:   >>> greenlet = gevent.spawn(f)
+
 123:   >>> greenlet.join()
+
 124: 
+
 125: affects what we see:
+
 126: 
+
 127:   >>> mydata.number
+
 128:   11
+
 129: 
+
 130: >>> del mydata
+
 131: 
+
 132: .. versionchanged:: 1.1a2
+
 133:    Update the implementation to match Python 3.4 instead of Python 2.5.
+
 134:    This results in locals being eligible for garbage collection as soon
+
 135:    as their greenlet exits.
+
 136: 
+
 137: .. versionchanged:: 1.2.3
+
 138:    Use a weak-reference to clear the greenlet link we establish in case
+
 139:    the local object dies before the greenlet does.
+
 140: 
+
 141: .. versionchanged:: 1.3a1
+
 142:    Implement the methods for attribute access directly, handling
+
 143:    descriptors directly here. This allows removing the use of a lock
+
 144:    and facilitates greatly improved performance.
+
 145: 
+
 146: .. versionchanged:: 1.3a1
+
 147:    The ``__init__`` method of subclasses of ``local`` is no longer
+
 148:    called with a lock held. CPython does not use such a lock in its
+
 149:    native implementation. This could potentially show as a difference
+
 150:    if code that uses multiple dependent attributes in ``__slots__``
+
 151:    (which are shared across all greenlets) switches during ``__init__``.
+
 152: 
+
 153: """
+
 154: from __future__ import print_function
+
 155: 
+
+156: from copy import copy
+
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 156, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(__pyx_n_s_copy_2);
+  __Pyx_GIVEREF(__pyx_n_s_copy_2);
+  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_copy_2);
+  __pyx_t_2 = __Pyx_Import(__pyx_n_s_copy_2, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 156, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_copy_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 156, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(__pyx_t_1);
+  __Pyx_XGOTREF(__pyx_v_6gevent_6_local_copy);
+  __Pyx_DECREF_SET(__pyx_v_6gevent_6_local_copy, __pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+157: from weakref import ref
+
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 157, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_ref);
+  __Pyx_GIVEREF(__pyx_n_s_ref);
+  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_ref);
+  __pyx_t_1 = __Pyx_Import(__pyx_n_s_weakref, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 157, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_ref); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 157, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(__pyx_t_2);
+  __Pyx_XGOTREF(__pyx_v_6gevent_6_local_ref);
+  __Pyx_DECREF_SET(__pyx_v_6gevent_6_local_ref, __pyx_t_2);
+  __Pyx_GIVEREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 158: 
+
 159: 
+
+160: locals()['getcurrent'] = __import__('greenlet').getcurrent
+
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin___import__, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 160, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_getcurrent); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 160, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_1 = __Pyx_Globals(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 160, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (unlikely(PyDict_SetItem(__pyx_t_1, __pyx_n_s_getcurrent, __pyx_t_2) < 0)) __PYX_ERR(0, 160, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+/* … */
+  __pyx_tuple_ = PyTuple_Pack(1, __pyx_n_s_greenlet); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 160, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple_);
+  __Pyx_GIVEREF(__pyx_tuple_);
+
+161: locals()['greenlet_init'] = lambda: None
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_local_4lambda(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyMethodDef __pyx_mdef_6gevent_6_local_4lambda = {"lambda", (PyCFunction)__pyx_pw_6gevent_6_local_4lambda, METH_NOARGS, 0};
+static PyObject *__pyx_pw_6gevent_6_local_4lambda(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("lambda (wrapper)", 0);
+  __pyx_r = __pyx_lambda_funcdef_6gevent_6_local_lambda(__pyx_self);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_lambda_funcdef_6gevent_6_local_lambda(CYTHON_UNUSED PyObject *__pyx_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("lambda", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_local_4lambda, 0, __pyx_n_s_lambda, NULL, __pyx_n_s_gevent__local, __pyx_d, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 161, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_1 = __Pyx_Globals(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 161, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (unlikely(PyDict_SetItem(__pyx_t_1, __pyx_n_s_greenlet_init, __pyx_t_2) < 0)) __PYX_ERR(0, 161, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
 162: 
+
+163: __all__ = [
+
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 163, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_local);
+  __Pyx_GIVEREF(__pyx_n_s_local);
+  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_local);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_all, __pyx_t_2) < 0) __PYX_ERR(0, 163, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
 164:     "local",
+
 165: ]
+
 166: 
+
 167: # The key used in the Thread objects' attribute dicts.
+
 168: # We keep it a string for speed but make it unlikely to clash with
+
 169: # a "real" attribute.
+
+170: key_prefix = '_gevent_local_localimpl_'
+
  __Pyx_INCREF(__pyx_n_s_gevent_local_localimpl);
+  __Pyx_XGOTREF(__pyx_v_6gevent_6_local_key_prefix);
+  __Pyx_DECREF_SET(__pyx_v_6gevent_6_local_key_prefix, __pyx_n_s_gevent_local_localimpl);
+  __Pyx_GIVEREF(__pyx_n_s_gevent_local_localimpl);
+
 171: 
+
 172: # The overall structure is as follows:
+
 173: # For each local() object:
+
 174: # greenlet.__dict__[key_prefix + str(id(local))]
+
 175: #    => _localimpl.dicts[id(greenlet)] => (ref(greenlet), {})
+
 176: 
+
 177: # That final tuple is actually a localimpl_dict_entry object.
+
 178: 
+
+179: def all_local_dicts_for_greenlet(greenlet):
+
static PyObject *__pyx_pw_6gevent_6_local_1all_local_dicts_for_greenlet(PyObject *__pyx_self, PyObject *__pyx_v_greenlet); /*proto*/
+static PyObject *__pyx_f_6gevent_6_local_all_local_dicts_for_greenlet(PyGreenlet *__pyx_v_greenlet, CYTHON_UNUSED int __pyx_skip_dispatch) {
+  PyObject *__pyx_v_result = 0;
+  struct __pyx_obj_6gevent_6_local__localimpl *__pyx_v_local_impl = 0;
+  struct __pyx_obj_6gevent_6_local__localimpl_dict_entry *__pyx_v_entry = 0;
+  PyObject *__pyx_v_k = 0;
+  PyObject *__pyx_v_greenlet_dict = 0;
+  PyObject *__pyx_v_id_greenlet = NULL;
+  PyObject *__pyx_v_v = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("all_local_dicts_for_greenlet", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_XDECREF(__pyx_t_6);
+  __Pyx_XDECREF(__pyx_t_10);
+  __Pyx_AddTraceback("gevent._local.all_local_dicts_for_greenlet", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_result);
+  __Pyx_XDECREF((PyObject *)__pyx_v_local_impl);
+  __Pyx_XDECREF((PyObject *)__pyx_v_entry);
+  __Pyx_XDECREF(__pyx_v_k);
+  __Pyx_XDECREF(__pyx_v_greenlet_dict);
+  __Pyx_XDECREF(__pyx_v_id_greenlet);
+  __Pyx_XDECREF(__pyx_v_v);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_local_1all_local_dicts_for_greenlet(PyObject *__pyx_self, PyObject *__pyx_v_greenlet); /*proto*/
+static char __pyx_doc_6gevent_6_local_all_local_dicts_for_greenlet[] = "all_local_dicts_for_greenlet(greenlet greenlet)\n\n    Internal debug helper for getting the local values associated\n    with a greenlet. This is subject to change or removal at any time.\n\n    :return: A list of ((type, id), {}) pairs, where the first element\n      is the type and id of the local object and the second object is its\n      instance dictionary, as seen from this greenlet.\n\n    .. versionadded:: 1.3a2\n    ";
+static PyMethodDef __pyx_mdef_6gevent_6_local_1all_local_dicts_for_greenlet = {"all_local_dicts_for_greenlet", (PyCFunction)__pyx_pw_6gevent_6_local_1all_local_dicts_for_greenlet, METH_O, __pyx_doc_6gevent_6_local_all_local_dicts_for_greenlet};
+static PyObject *__pyx_pw_6gevent_6_local_1all_local_dicts_for_greenlet(PyObject *__pyx_self, PyObject *__pyx_v_greenlet) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("all_local_dicts_for_greenlet (wrapper)", 0);
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_greenlet), __pyx_ptype_6gevent_6_local_greenlet, 1, "greenlet", 0))) __PYX_ERR(0, 179, __pyx_L1_error)
+  __pyx_r = __pyx_pf_6gevent_6_local_all_local_dicts_for_greenlet(__pyx_self, ((PyGreenlet *)__pyx_v_greenlet));
+
+  /* function exit code */
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_local_all_local_dicts_for_greenlet(CYTHON_UNUSED PyObject *__pyx_self, PyGreenlet *__pyx_v_greenlet) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("all_local_dicts_for_greenlet", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __pyx_f_6gevent_6_local_all_local_dicts_for_greenlet(__pyx_v_greenlet, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 179, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent._local.all_local_dicts_for_greenlet", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__2 = PyTuple_Pack(1, __pyx_n_s_greenlet); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 179, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__2);
+  __Pyx_GIVEREF(__pyx_tuple__2);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_local_1all_local_dicts_for_greenlet, 0, __pyx_n_s_all_local_dicts_for_greenlet, NULL, __pyx_n_s_gevent__local, __pyx_d, ((PyObject *)__pyx_codeobj__3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 179, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_all_local_dicts_for_greenlet, __pyx_t_2) < 0) __PYX_ERR(0, 179, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_codeobj__3 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_local_py, __pyx_n_s_all_local_dicts_for_greenlet, 179, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__3)) __PYX_ERR(0, 179, __pyx_L1_error)
+
 180:     """
+
 181:     Internal debug helper for getting the local values associated
+
 182:     with a greenlet. This is subject to change or removal at any time.
+
 183: 
+
 184:     :return: A list of ((type, id), {}) pairs, where the first element
+
 185:       is the type and id of the local object and the second object is its
+
 186:       instance dictionary, as seen from this greenlet.
+
 187: 
+
 188:     .. versionadded:: 1.3a2
+
 189:     """
+
 190: 
+
+191:     result = []
+
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 191, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_v_result = ((PyObject*)__pyx_t_1);
+  __pyx_t_1 = 0;
+
+192:     id_greenlet = id(greenlet)
+
  __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_greenlet)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 192, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_v_id_greenlet = __pyx_t_1;
+  __pyx_t_1 = 0;
+
+193:     greenlet_dict = greenlet.__dict__
+
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_greenlet), __pyx_n_s_dict); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 193, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (!(likely(PyDict_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 193, __pyx_L1_error)
+  __pyx_v_greenlet_dict = ((PyObject*)__pyx_t_1);
+  __pyx_t_1 = 0;
+
+194:     for k, v in greenlet_dict.items():
+
  __pyx_t_2 = 0;
+  if (unlikely(__pyx_v_greenlet_dict == Py_None)) {
+    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items");
+    __PYX_ERR(0, 194, __pyx_L1_error)
+  }
+  __pyx_t_5 = __Pyx_dict_iterator(__pyx_v_greenlet_dict, 1, __pyx_n_s_items, (&__pyx_t_3), (&__pyx_t_4)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 194, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_5);
+  __Pyx_XDECREF(__pyx_t_1);
+  __pyx_t_1 = __pyx_t_5;
+  __pyx_t_5 = 0;
+  while (1) {
+    __pyx_t_7 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_3, &__pyx_t_2, &__pyx_t_5, &__pyx_t_6, NULL, __pyx_t_4);
+    if (unlikely(__pyx_t_7 == 0)) break;
+    if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(0, 194, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_5);
+    __Pyx_GOTREF(__pyx_t_6);
+    if (!(likely(PyString_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_5)->tp_name), 0))) __PYX_ERR(0, 194, __pyx_L1_error)
+    __Pyx_XDECREF_SET(__pyx_v_k, ((PyObject*)__pyx_t_5));
+    __pyx_t_5 = 0;
+    __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_6);
+    __pyx_t_6 = 0;
+
+195:         if not k.startswith(key_prefix):
+
    if (unlikely(__pyx_v_k == Py_None)) {
+      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "startswith");
+      __PYX_ERR(0, 195, __pyx_L1_error)
+    }
+    __pyx_t_8 = __Pyx_PyStr_Tailmatch(__pyx_v_k, __pyx_v_6gevent_6_local_key_prefix, 0, PY_SSIZE_T_MAX, -1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 195, __pyx_L1_error)
+    __pyx_t_9 = ((!(__pyx_t_8 != 0)) != 0);
+    if (__pyx_t_9) {
+/* … */
+    }
+
+196:             continue
+
      goto __pyx_L3_continue;
+
+197:         local_impl = v()
+
    __Pyx_INCREF(__pyx_v_v);
+    __pyx_t_5 = __pyx_v_v; __pyx_t_10 = NULL;
+    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
+      __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_5);
+      if (likely(__pyx_t_10)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
+        __Pyx_INCREF(__pyx_t_10);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_5, function);
+      }
+    }
+    __pyx_t_6 = (__pyx_t_10) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_10) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
+    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
+    if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 197, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_6);
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_6gevent_6_local__localimpl))))) __PYX_ERR(0, 197, __pyx_L1_error)
+    __Pyx_XDECREF_SET(__pyx_v_local_impl, ((struct __pyx_obj_6gevent_6_local__localimpl *)__pyx_t_6));
+    __pyx_t_6 = 0;
+
+198:         if local_impl is None:
+
    __pyx_t_9 = (((PyObject *)__pyx_v_local_impl) == Py_None);
+    __pyx_t_8 = (__pyx_t_9 != 0);
+    if (__pyx_t_8) {
+/* … */
+    }
+
+199:             continue
+
      goto __pyx_L3_continue;
+
+200:         entry = local_impl.dicts.get(id_greenlet)
+
    if (unlikely(__pyx_v_local_impl->dicts == Py_None)) {
+      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get");
+      __PYX_ERR(0, 200, __pyx_L1_error)
+    }
+    __pyx_t_6 = __Pyx_PyDict_GetItemDefault(__pyx_v_local_impl->dicts, __pyx_v_id_greenlet, Py_None); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 200, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_6);
+    if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_6gevent_6_local__localimpl_dict_entry))))) __PYX_ERR(0, 200, __pyx_L1_error)
+    __Pyx_XDECREF_SET(__pyx_v_entry, ((struct __pyx_obj_6gevent_6_local__localimpl_dict_entry *)__pyx_t_6));
+    __pyx_t_6 = 0;
+
+201:         if entry is None:
+
    __pyx_t_8 = (((PyObject *)__pyx_v_entry) == Py_None);
+    __pyx_t_9 = (__pyx_t_8 != 0);
+    if (__pyx_t_9) {
+/* … */
+    }
+
 202:             # Not yet used in this greenlet.
+
+203:             continue
+
      goto __pyx_L3_continue;
+
+204:         assert entry.wrgreenlet() is greenlet
+
    #ifndef CYTHON_WITHOUT_ASSERTIONS
+    if (unlikely(!Py_OptimizeFlag)) {
+      __Pyx_INCREF(__pyx_v_entry->wrgreenlet);
+      __pyx_t_5 = __pyx_v_entry->wrgreenlet; __pyx_t_10 = NULL;
+      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
+        __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_5);
+        if (likely(__pyx_t_10)) {
+          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
+          __Pyx_INCREF(__pyx_t_10);
+          __Pyx_INCREF(function);
+          __Pyx_DECREF_SET(__pyx_t_5, function);
+        }
+      }
+      __pyx_t_6 = (__pyx_t_10) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_10) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
+      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
+      if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 204, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_6);
+      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+      __pyx_t_9 = (__pyx_t_6 == ((PyObject *)__pyx_v_greenlet));
+      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+      if (unlikely(!(__pyx_t_9 != 0))) {
+        PyErr_SetNone(PyExc_AssertionError);
+        __PYX_ERR(0, 204, __pyx_L1_error)
+      }
+    }
+    #endif
+
+205:         result.append((local_impl.localtypeid, entry.localdict))
+
    __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 205, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_6);
+    __Pyx_INCREF(__pyx_v_local_impl->localtypeid);
+    __Pyx_GIVEREF(__pyx_v_local_impl->localtypeid);
+    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_local_impl->localtypeid);
+    __Pyx_INCREF(__pyx_v_entry->localdict);
+    __Pyx_GIVEREF(__pyx_v_entry->localdict);
+    PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_entry->localdict);
+    __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_6); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 205, __pyx_L1_error)
+    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+    __pyx_L3_continue:;
+  }
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 206: 
+
+207:     return result
+
  __Pyx_XDECREF(__pyx_r);
+  __Pyx_INCREF(__pyx_v_result);
+  __pyx_r = __pyx_v_result;
+  goto __pyx_L0;
+
 208: 
+
 209: 
+
 210: class _wrefdict(dict):
+
 211:     """A dict that can be weak referenced"""
+
 212: 
+
 213: class _greenlet_deleted(object):
+
 214:     """
+
 215:     A weakref callback for when the greenlet
+
 216:     is deleted.
+
 217: 
+
 218:     If the greenlet is a `gevent.greenlet.Greenlet` and
+
 219:     supplies ``rawlink``, that will be used instead of a
+
 220:     weakref.
+
 221:     """
+
+222:     __slots__ = ('idt', 'wrdicts')
+
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_local__greenlet_deleted->tp_dict, __pyx_n_s_slots, __pyx_tuple__4) < 0) __PYX_ERR(0, 222, __pyx_L1_error)
+  PyType_Modified(__pyx_ptype_6gevent_6_local__greenlet_deleted);
+/* … */
+  __pyx_tuple__4 = PyTuple_Pack(2, __pyx_n_s_idt, __pyx_n_s_wrdicts); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 222, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__4);
+  __Pyx_GIVEREF(__pyx_tuple__4);
+
 223: 
+
+224:     def __init__(self, idt, wrdicts):
+
/* Python wrapper */
+static int __pyx_pw_6gevent_6_local_17_greenlet_deleted_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static int __pyx_pw_6gevent_6_local_17_greenlet_deleted_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_idt = 0;
+  PyObject *__pyx_v_wrdicts = 0;
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_idt,&__pyx_n_s_wrdicts,0};
+    PyObject* values[2] = {0,0};
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_idt)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_wrdicts)) != 0)) kw_args--;
+        else {
+          __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(0, 224, __pyx_L3_error)
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 224, __pyx_L3_error)
+      }
+    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
+      goto __pyx_L5_argtuple_error;
+    } else {
+      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+    }
+    __pyx_v_idt = values[0];
+    __pyx_v_wrdicts = values[1];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 224, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent._local._greenlet_deleted.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return -1;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_6_local_17_greenlet_deleted___init__(((struct __pyx_obj_6gevent_6_local__greenlet_deleted *)__pyx_v_self), __pyx_v_idt, __pyx_v_wrdicts);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_6_local_17_greenlet_deleted___init__(struct __pyx_obj_6gevent_6_local__greenlet_deleted *__pyx_v_self, PyObject *__pyx_v_idt, PyObject *__pyx_v_wrdicts) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = 0;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+225:         self.idt = idt
+
  __Pyx_INCREF(__pyx_v_idt);
+  __Pyx_GIVEREF(__pyx_v_idt);
+  __Pyx_GOTREF(__pyx_v_self->idt);
+  __Pyx_DECREF(__pyx_v_self->idt);
+  __pyx_v_self->idt = __pyx_v_idt;
+
+226:         self.wrdicts = wrdicts
+
  __Pyx_INCREF(__pyx_v_wrdicts);
+  __Pyx_GIVEREF(__pyx_v_wrdicts);
+  __Pyx_GOTREF(__pyx_v_self->wrdicts);
+  __Pyx_DECREF(__pyx_v_self->wrdicts);
+  __pyx_v_self->wrdicts = __pyx_v_wrdicts;
+
 227: 
+
+228:     def __call__(self, _unused):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_local_17_greenlet_deleted_3__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_pw_6gevent_6_local_17_greenlet_deleted_3__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  CYTHON_UNUSED PyObject *__pyx_v__unused = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__call__ (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_unused,0};
+    PyObject* values[1] = {0};
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_unused)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__call__") < 0)) __PYX_ERR(0, 228, __pyx_L3_error)
+      }
+    } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
+      goto __pyx_L5_argtuple_error;
+    } else {
+      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+    }
+    __pyx_v__unused = values[0];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("__call__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 228, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent._local._greenlet_deleted.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_6_local_17_greenlet_deleted_2__call__(((struct __pyx_obj_6gevent_6_local__greenlet_deleted *)__pyx_v_self), __pyx_v__unused);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_local_17_greenlet_deleted_2__call__(struct __pyx_obj_6gevent_6_local__greenlet_deleted *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v__unused) {
+  PyObject *__pyx_v_dicts = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__call__", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_6);
+  __Pyx_AddTraceback("gevent._local._greenlet_deleted.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_dicts);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+229:         dicts = self.wrdicts()
+
  __Pyx_INCREF(__pyx_v_self->wrdicts);
+  __pyx_t_2 = __pyx_v_self->wrdicts; __pyx_t_3 = NULL;
+  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+    if (likely(__pyx_t_3)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+      __Pyx_INCREF(__pyx_t_3);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_2, function);
+    }
+  }
+  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 229, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_v_dicts = __pyx_t_1;
+  __pyx_t_1 = 0;
+
+230:         if dicts:
+
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_dicts); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 230, __pyx_L1_error)
+  if (__pyx_t_4) {
+/* … */
+  }
+
+231:             dicts.pop(self.idt, None)
+
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_dicts, __pyx_n_s_pop); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 231, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_3 = NULL;
+    __pyx_t_5 = 0;
+    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+      if (likely(__pyx_t_3)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+        __Pyx_INCREF(__pyx_t_3);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_2, function);
+        __pyx_t_5 = 1;
+      }
+    }
+    #if CYTHON_FAST_PYCALL
+    if (PyFunction_Check(__pyx_t_2)) {
+      PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_self->idt, Py_None};
+      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 231, __pyx_L1_error)
+      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __Pyx_GOTREF(__pyx_t_1);
+    } else
+    #endif
+    #if CYTHON_FAST_PYCCALL
+    if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
+      PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_self->idt, Py_None};
+      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 231, __pyx_L1_error)
+      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __Pyx_GOTREF(__pyx_t_1);
+    } else
+    #endif
+    {
+      __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 231, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_6);
+      if (__pyx_t_3) {
+        __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); __pyx_t_3 = NULL;
+      }
+      __Pyx_INCREF(__pyx_v_self->idt);
+      __Pyx_GIVEREF(__pyx_v_self->idt);
+      PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_self->idt);
+      __Pyx_INCREF(Py_None);
+      __Pyx_GIVEREF(Py_None);
+      PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, Py_None);
+      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 231, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+    }
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 232: 
+
 233: class _local_deleted(object):
+
+234:     __slots__ = ('key', 'wrthread', 'greenlet_deleted')
+
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_local__local_deleted->tp_dict, __pyx_n_s_slots, __pyx_tuple__5) < 0) __PYX_ERR(0, 234, __pyx_L1_error)
+  PyType_Modified(__pyx_ptype_6gevent_6_local__local_deleted);
+/* … */
+  __pyx_tuple__5 = PyTuple_Pack(3, __pyx_n_s_key, __pyx_n_s_wrthread, __pyx_n_s_greenlet_deleted); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 234, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__5);
+  __Pyx_GIVEREF(__pyx_tuple__5);
+
 235: 
+
+236:     def __init__(self, key, wrthread, greenlet_deleted):
+
/* Python wrapper */
+static int __pyx_pw_6gevent_6_local_14_local_deleted_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static int __pyx_pw_6gevent_6_local_14_local_deleted_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_key = 0;
+  PyObject *__pyx_v_wrthread = 0;
+  PyObject *__pyx_v_greenlet_deleted = 0;
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_key,&__pyx_n_s_wrthread,&__pyx_n_s_greenlet_deleted,0};
+    PyObject* values[3] = {0,0,0};
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_wrthread)) != 0)) kw_args--;
+        else {
+          __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 1); __PYX_ERR(0, 236, __pyx_L3_error)
+        }
+        CYTHON_FALLTHROUGH;
+        case  2:
+        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_greenlet_deleted)) != 0)) kw_args--;
+        else {
+          __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 2); __PYX_ERR(0, 236, __pyx_L3_error)
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 236, __pyx_L3_error)
+      }
+    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
+      goto __pyx_L5_argtuple_error;
+    } else {
+      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+    }
+    __pyx_v_key = values[0];
+    __pyx_v_wrthread = values[1];
+    __pyx_v_greenlet_deleted = values[2];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 236, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent._local._local_deleted.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return -1;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_6_local_14_local_deleted___init__(((struct __pyx_obj_6gevent_6_local__local_deleted *)__pyx_v_self), __pyx_v_key, __pyx_v_wrthread, __pyx_v_greenlet_deleted);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_6_local_14_local_deleted___init__(struct __pyx_obj_6gevent_6_local__local_deleted *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_wrthread, PyObject *__pyx_v_greenlet_deleted) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = 0;
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent._local._local_deleted.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = -1;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+237:         self.key = key
+
  if (!(likely(PyString_CheckExact(__pyx_v_key))||((__pyx_v_key) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_v_key)->tp_name), 0))) __PYX_ERR(0, 237, __pyx_L1_error)
+  __pyx_t_1 = __pyx_v_key;
+  __Pyx_INCREF(__pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_1);
+  __Pyx_GOTREF(__pyx_v_self->key);
+  __Pyx_DECREF(__pyx_v_self->key);
+  __pyx_v_self->key = ((PyObject*)__pyx_t_1);
+  __pyx_t_1 = 0;
+
+238:         self.wrthread = wrthread
+
  __Pyx_INCREF(__pyx_v_wrthread);
+  __Pyx_GIVEREF(__pyx_v_wrthread);
+  __Pyx_GOTREF(__pyx_v_self->wrthread);
+  __Pyx_DECREF(__pyx_v_self->wrthread);
+  __pyx_v_self->wrthread = __pyx_v_wrthread;
+
+239:         self.greenlet_deleted = greenlet_deleted
+
  if (!(likely(((__pyx_v_greenlet_deleted) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_greenlet_deleted, __pyx_ptype_6gevent_6_local__greenlet_deleted))))) __PYX_ERR(0, 239, __pyx_L1_error)
+  __pyx_t_1 = __pyx_v_greenlet_deleted;
+  __Pyx_INCREF(__pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_1);
+  __Pyx_GOTREF(__pyx_v_self->greenlet_deleted);
+  __Pyx_DECREF(((PyObject *)__pyx_v_self->greenlet_deleted));
+  __pyx_v_self->greenlet_deleted = ((struct __pyx_obj_6gevent_6_local__greenlet_deleted *)__pyx_t_1);
+  __pyx_t_1 = 0;
+
 240: 
+
+241:     def __call__(self, _unused):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_local_14_local_deleted_3__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_pw_6gevent_6_local_14_local_deleted_3__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  CYTHON_UNUSED PyObject *__pyx_v__unused = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__call__ (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_unused,0};
+    PyObject* values[1] = {0};
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_unused)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__call__") < 0)) __PYX_ERR(0, 241, __pyx_L3_error)
+      }
+    } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
+      goto __pyx_L5_argtuple_error;
+    } else {
+      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+    }
+    __pyx_v__unused = values[0];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("__call__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 241, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent._local._local_deleted.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_6_local_14_local_deleted_2__call__(((struct __pyx_obj_6gevent_6_local__local_deleted *)__pyx_v_self), __pyx_v__unused);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_local_14_local_deleted_2__call__(struct __pyx_obj_6gevent_6_local__local_deleted *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v__unused) {
+  PyObject *__pyx_v_thread = NULL;
+  PyObject *__pyx_v_unlink = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__call__", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_AddTraceback("gevent._local._local_deleted.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_thread);
+  __Pyx_XDECREF(__pyx_v_unlink);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+242:         thread = self.wrthread()
+
  __Pyx_INCREF(__pyx_v_self->wrthread);
+  __pyx_t_2 = __pyx_v_self->wrthread; __pyx_t_3 = NULL;
+  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+    if (likely(__pyx_t_3)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+      __Pyx_INCREF(__pyx_t_3);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_2, function);
+    }
+  }
+  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 242, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_v_thread = __pyx_t_1;
+  __pyx_t_1 = 0;
+
+243:         if thread is not None:
+
  __pyx_t_4 = (__pyx_v_thread != Py_None);
+  __pyx_t_5 = (__pyx_t_4 != 0);
+  if (__pyx_t_5) {
+/* … */
+  }
+
+244:             try:
+
    {
+      /*try:*/ {
+/* … */
+      }
+/* … */
+      __Pyx_XGIVEREF(__pyx_t_6);
+      __Pyx_XGIVEREF(__pyx_t_7);
+      __Pyx_XGIVEREF(__pyx_t_8);
+      __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
+      goto __pyx_L1_error;
+      __pyx_L5_exception_handled:;
+      __Pyx_XGIVEREF(__pyx_t_6);
+      __Pyx_XGIVEREF(__pyx_t_7);
+      __Pyx_XGIVEREF(__pyx_t_8);
+      __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
+      __pyx_L9_try_end:;
+    }
+
+245:                 unlink = thread.unlink
+
        __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_thread, __pyx_n_s_unlink); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 245, __pyx_L4_error)
+        __Pyx_GOTREF(__pyx_t_1);
+        __pyx_v_unlink = __pyx_t_1;
+        __pyx_t_1 = 0;
+
+246:             except AttributeError:
+
      __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_AttributeError);
+      if (__pyx_t_9) {
+        __Pyx_ErrRestore(0,0,0);
+        goto __pyx_L5_exception_handled;
+      }
+      goto __pyx_L6_except_error;
+      __pyx_L6_except_error:;
+
 247:                 pass
+
 248:             else:
+
+249:                 unlink(self.greenlet_deleted)
+
      /*else:*/ {
+        __Pyx_INCREF(__pyx_v_unlink);
+        __pyx_t_2 = __pyx_v_unlink; __pyx_t_3 = NULL;
+        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+          if (likely(__pyx_t_3)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+            __Pyx_INCREF(__pyx_t_3);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_2, function);
+          }
+        }
+        __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, ((PyObject *)__pyx_v_self->greenlet_deleted)) : __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_v_self->greenlet_deleted));
+        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+        if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 249, __pyx_L6_except_error)
+        __Pyx_GOTREF(__pyx_t_1);
+        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      }
+      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
+      goto __pyx_L9_try_end;
+      __pyx_L4_error:;
+      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+250:             del thread.__dict__[self.key]
+
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_thread, __pyx_n_s_dict); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 250, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    if (unlikely(PyObject_DelItem(__pyx_t_1, __pyx_v_self->key) < 0)) __PYX_ERR(0, 250, __pyx_L1_error)
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 251: 
+
 252: class _localimpl(object):
+
 253:     """A class managing thread-local dicts"""
+
+254:     __slots__ = ('key', 'dicts',
+
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_local__localimpl->tp_dict, __pyx_n_s_slots, __pyx_tuple__6) < 0) __PYX_ERR(0, 254, __pyx_L1_error)
+  PyType_Modified(__pyx_ptype_6gevent_6_local__localimpl);
+/* … */
+  __pyx_tuple__6 = PyTuple_Pack(6, __pyx_n_s_key, __pyx_n_s_dicts, __pyx_n_s_localargs, __pyx_n_s_localkwargs, __pyx_n_s_localtypeid, __pyx_n_s_weakref_2); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 254, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__6);
+  __Pyx_GIVEREF(__pyx_tuple__6);
+
 255:                  'localargs', 'localkwargs',
+
 256:                  'localtypeid',
+
 257:                  '__weakref__',)
+
 258: 
+
+259:     def __init__(self, args, kwargs, local_type, id_local):
+
/* Python wrapper */
+static int __pyx_pw_6gevent_6_local_10_localimpl_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static int __pyx_pw_6gevent_6_local_10_localimpl_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_args = 0;
+  PyObject *__pyx_v_kwargs = 0;
+  PyObject *__pyx_v_local_type = 0;
+  PyObject *__pyx_v_id_local = 0;
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_args,&__pyx_n_s_kwargs,&__pyx_n_s_local_type,&__pyx_n_s_id_local,0};
+    PyObject* values[4] = {0,0,0,0};
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
+        CYTHON_FALLTHROUGH;
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kwargs)) != 0)) kw_args--;
+        else {
+          __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, 1); __PYX_ERR(0, 259, __pyx_L3_error)
+        }
+        CYTHON_FALLTHROUGH;
+        case  2:
+        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_local_type)) != 0)) kw_args--;
+        else {
+          __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, 2); __PYX_ERR(0, 259, __pyx_L3_error)
+        }
+        CYTHON_FALLTHROUGH;
+        case  3:
+        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_id_local)) != 0)) kw_args--;
+        else {
+          __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, 3); __PYX_ERR(0, 259, __pyx_L3_error)
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 259, __pyx_L3_error)
+      }
+    } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
+      goto __pyx_L5_argtuple_error;
+    } else {
+      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
+    }
+    __pyx_v_args = values[0];
+    __pyx_v_kwargs = values[1];
+    __pyx_v_local_type = values[2];
+    __pyx_v_id_local = values[3];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 259, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent._local._localimpl.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return -1;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_6_local_10_localimpl___init__(((struct __pyx_obj_6gevent_6_local__localimpl *)__pyx_v_self), __pyx_v_args, __pyx_v_kwargs, __pyx_v_local_type, __pyx_v_id_local);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_6_local_10_localimpl___init__(struct __pyx_obj_6gevent_6_local__localimpl *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs, PyObject *__pyx_v_local_type, PyObject *__pyx_v_id_local) {
+  PyGreenlet *__pyx_v_greenlet = NULL;
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = 0;
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_AddTraceback("gevent._local._localimpl.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = -1;
+  __pyx_L0:;
+  __Pyx_XDECREF((PyObject *)__pyx_v_greenlet);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+260:         self.key = key_prefix + str(id(self))
+
  __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 260, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyString_Type)), __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 260, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_1 = PyNumber_Add(__pyx_v_6gevent_6_local_key_prefix, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 260, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  if (!(likely(PyString_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 260, __pyx_L1_error)
+  __Pyx_GIVEREF(__pyx_t_1);
+  __Pyx_GOTREF(__pyx_v_self->key);
+  __Pyx_DECREF(__pyx_v_self->key);
+  __pyx_v_self->key = ((PyObject*)__pyx_t_1);
+  __pyx_t_1 = 0;
+
 261:         # { id(greenlet) -> _localimpl_dict_entry(ref(greenlet), greenlet-local dict) }
+
+262:         self.dicts = _wrefdict()
+
  __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_6gevent_6_local__wrefdict)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 262, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_1);
+  __Pyx_GOTREF(__pyx_v_self->dicts);
+  __Pyx_DECREF(__pyx_v_self->dicts);
+  __pyx_v_self->dicts = ((PyObject*)__pyx_t_1);
+  __pyx_t_1 = 0;
+
+263:         self.localargs = args
+
  if (!(likely(PyTuple_CheckExact(__pyx_v_args))||((__pyx_v_args) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v_args)->tp_name), 0))) __PYX_ERR(0, 263, __pyx_L1_error)
+  __pyx_t_1 = __pyx_v_args;
+  __Pyx_INCREF(__pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_1);
+  __Pyx_GOTREF(__pyx_v_self->localargs);
+  __Pyx_DECREF(__pyx_v_self->localargs);
+  __pyx_v_self->localargs = ((PyObject*)__pyx_t_1);
+  __pyx_t_1 = 0;
+
+264:         self.localkwargs = kwargs
+
  if (!(likely(PyDict_CheckExact(__pyx_v_kwargs))||((__pyx_v_kwargs) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_v_kwargs)->tp_name), 0))) __PYX_ERR(0, 264, __pyx_L1_error)
+  __pyx_t_1 = __pyx_v_kwargs;
+  __Pyx_INCREF(__pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_1);
+  __Pyx_GOTREF(__pyx_v_self->localkwargs);
+  __Pyx_DECREF(__pyx_v_self->localkwargs);
+  __pyx_v_self->localkwargs = ((PyObject*)__pyx_t_1);
+  __pyx_t_1 = 0;
+
+265:         self.localtypeid = local_type, id_local
+
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 265, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(__pyx_v_local_type);
+  __Pyx_GIVEREF(__pyx_v_local_type);
+  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_local_type);
+  __Pyx_INCREF(__pyx_v_id_local);
+  __Pyx_GIVEREF(__pyx_v_id_local);
+  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_id_local);
+  __Pyx_GIVEREF(__pyx_t_1);
+  __Pyx_GOTREF(__pyx_v_self->localtypeid);
+  __Pyx_DECREF(__pyx_v_self->localtypeid);
+  __pyx_v_self->localtypeid = ((PyObject*)__pyx_t_1);
+  __pyx_t_1 = 0;
+
 266: 
+
 267:         # We need to create the thread dict in anticipation of
+
 268:         # __init__ being called, to make sure we don't call it
+
 269:         # again ourselves. MUST do this before setting any attributes.
+
+270:         greenlet = getcurrent() # pylint:disable=undefined-variable
+
  __pyx_t_1 = ((PyObject *)__pyx_f_6gevent_6_local_getcurrent()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 270, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_v_greenlet = ((PyGreenlet *)__pyx_t_1);
+  __pyx_t_1 = 0;
+
+271:         _localimpl_create_dict(self, greenlet, id(greenlet))
+
  __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_greenlet)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 271, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = __pyx_f_6gevent_6_local__localimpl_create_dict(__pyx_v_self, __pyx_v_greenlet, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 271, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
 272: 
+
 273: class _localimpl_dict_entry(object):
+
 274:     """
+
 275:     The object that goes in the ``dicts`` of ``_localimpl``
+
 276:     object for each thread.
+
 277:     """
+
 278:     # This is a class, not just a tuple, so that cython can optimize
+
 279:     # attribute access
+
+280:     __slots__ = ('wrgreenlet', 'localdict')
+
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_local__localimpl_dict_entry->tp_dict, __pyx_n_s_slots, __pyx_tuple__7) < 0) __PYX_ERR(0, 280, __pyx_L1_error)
+  PyType_Modified(__pyx_ptype_6gevent_6_local__localimpl_dict_entry);
+/* … */
+  __pyx_tuple__7 = PyTuple_Pack(2, __pyx_n_s_wrgreenlet, __pyx_n_s_localdict); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 280, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__7);
+  __Pyx_GIVEREF(__pyx_tuple__7);
+
 281: 
+
+282:     def __init__(self, wrgreenlet, localdict):
+
/* Python wrapper */
+static int __pyx_pw_6gevent_6_local_21_localimpl_dict_entry_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static int __pyx_pw_6gevent_6_local_21_localimpl_dict_entry_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_wrgreenlet = 0;
+  PyObject *__pyx_v_localdict = 0;
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_wrgreenlet,&__pyx_n_s_localdict,0};
+    PyObject* values[2] = {0,0};
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_wrgreenlet)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_localdict)) != 0)) kw_args--;
+        else {
+          __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(0, 282, __pyx_L3_error)
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 282, __pyx_L3_error)
+      }
+    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
+      goto __pyx_L5_argtuple_error;
+    } else {
+      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+    }
+    __pyx_v_wrgreenlet = values[0];
+    __pyx_v_localdict = values[1];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 282, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent._local._localimpl_dict_entry.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return -1;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_6_local_21_localimpl_dict_entry___init__(((struct __pyx_obj_6gevent_6_local__localimpl_dict_entry *)__pyx_v_self), __pyx_v_wrgreenlet, __pyx_v_localdict);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_6_local_21_localimpl_dict_entry___init__(struct __pyx_obj_6gevent_6_local__localimpl_dict_entry *__pyx_v_self, PyObject *__pyx_v_wrgreenlet, PyObject *__pyx_v_localdict) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = 0;
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent._local._localimpl_dict_entry.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = -1;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+283:         self.wrgreenlet = wrgreenlet
+
  __Pyx_INCREF(__pyx_v_wrgreenlet);
+  __Pyx_GIVEREF(__pyx_v_wrgreenlet);
+  __Pyx_GOTREF(__pyx_v_self->wrgreenlet);
+  __Pyx_DECREF(__pyx_v_self->wrgreenlet);
+  __pyx_v_self->wrgreenlet = __pyx_v_wrgreenlet;
+
+284:         self.localdict = localdict
+
  if (!(likely(PyDict_CheckExact(__pyx_v_localdict))||((__pyx_v_localdict) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_v_localdict)->tp_name), 0))) __PYX_ERR(0, 284, __pyx_L1_error)
+  __pyx_t_1 = __pyx_v_localdict;
+  __Pyx_INCREF(__pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_1);
+  __Pyx_GOTREF(__pyx_v_self->localdict);
+  __Pyx_DECREF(__pyx_v_self->localdict);
+  __pyx_v_self->localdict = ((PyObject*)__pyx_t_1);
+  __pyx_t_1 = 0;
+
 285: 
+
 286: # We use functions instead of methods so that they can be cdef'd in
+
 287: # local.pxd; if they were cdef'd as methods, they would cause
+
 288: # the creation of a pointer and a vtable. This happens
+
 289: # even if we declare the class @cython.final. functions thus save memory overhead
+
 290: # (but not pointer chasing overhead; the vtable isn't used when we declare
+
 291: # the class final).
+
 292: 
+
 293: 
+
+294: def _localimpl_create_dict(self, greenlet, id_greenlet):
+
static PyObject *__pyx_f_6gevent_6_local__localimpl_create_dict(struct __pyx_obj_6gevent_6_local__localimpl *__pyx_v_self, PyGreenlet *__pyx_v_greenlet, PyObject *__pyx_v_id_greenlet) {
+  PyObject *__pyx_v_localdict = 0;
+  PyObject *__pyx_v_key = 0;
+  struct __pyx_obj_6gevent_6_local__greenlet_deleted *__pyx_v_greenlet_deleted = 0;
+  struct __pyx_obj_6gevent_6_local__local_deleted *__pyx_v_local_deleted = 0;
+  PyObject *__pyx_v_wrdicts = NULL;
+  PyObject *__pyx_v_rawlink = NULL;
+  PyObject *__pyx_v_wrthread = NULL;
+  PyObject *__pyx_v_wrlocal = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_localimpl_create_dict", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_7);
+  __Pyx_AddTraceback("gevent._local._localimpl_create_dict", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_localdict);
+  __Pyx_XDECREF(__pyx_v_key);
+  __Pyx_XDECREF((PyObject *)__pyx_v_greenlet_deleted);
+  __Pyx_XDECREF((PyObject *)__pyx_v_local_deleted);
+  __Pyx_XDECREF(__pyx_v_wrdicts);
+  __Pyx_XDECREF(__pyx_v_rawlink);
+  __Pyx_XDECREF(__pyx_v_wrthread);
+  __Pyx_XDECREF(__pyx_v_wrlocal);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
 295:     """Create a new dict for the current thread, and return it."""
+
+296:     localdict = {}
+
  __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 296, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_v_localdict = ((PyObject*)__pyx_t_1);
+  __pyx_t_1 = 0;
+
+297:     key = self.key
+
  __pyx_t_1 = __pyx_v_self->key;
+  __Pyx_INCREF(__pyx_t_1);
+  __pyx_v_key = ((PyObject*)__pyx_t_1);
+  __pyx_t_1 = 0;
+
 298: 
+
+299:     wrdicts = ref(self.dicts)
+
  __Pyx_INCREF(__pyx_v_6gevent_6_local_ref);
+  __pyx_t_2 = __pyx_v_6gevent_6_local_ref; __pyx_t_3 = NULL;
+  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
+    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+    if (likely(__pyx_t_3)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+      __Pyx_INCREF(__pyx_t_3);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_2, function);
+    }
+  }
+  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_self->dicts) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_self->dicts);
+  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 299, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_v_wrdicts = __pyx_t_1;
+  __pyx_t_1 = 0;
+
 300: 
+
 301:     # When the greenlet is deleted, remove the local dict.
+
 302:     # Note that this is suboptimal if the greenlet object gets
+
 303:     # caught in a reference loop. We would like to be called
+
 304:     # as soon as the OS-level greenlet ends instead.
+
 305: 
+
 306:     # If we are working with a gevent.greenlet.Greenlet, we
+
 307:     # can pro-actively clear out with a link, avoiding the
+
 308:     # issue described above. Use rawlink to avoid spawning any
+
 309:     # more greenlets.
+
+310:     greenlet_deleted = _greenlet_deleted(id_greenlet, wrdicts)
+
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 310, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(__pyx_v_id_greenlet);
+  __Pyx_GIVEREF(__pyx_v_id_greenlet);
+  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_id_greenlet);
+  __Pyx_INCREF(__pyx_v_wrdicts);
+  __Pyx_GIVEREF(__pyx_v_wrdicts);
+  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_wrdicts);
+  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6gevent_6_local__greenlet_deleted), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 310, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_v_greenlet_deleted = ((struct __pyx_obj_6gevent_6_local__greenlet_deleted *)__pyx_t_2);
+  __pyx_t_2 = 0;
+
 311: 
+
+312:     rawlink = getattr(greenlet, 'rawlink', None)
+
  __pyx_t_2 = __Pyx_GetAttr3(((PyObject *)__pyx_v_greenlet), __pyx_n_s_rawlink, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 312, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_v_rawlink = __pyx_t_2;
+  __pyx_t_2 = 0;
+
+313:     if rawlink is not None:
+
  __pyx_t_4 = (__pyx_v_rawlink != Py_None);
+  __pyx_t_5 = (__pyx_t_4 != 0);
+  if (__pyx_t_5) {
+/* … */
+    goto __pyx_L3;
+  }
+
+314:         rawlink(greenlet_deleted)
+
    __Pyx_INCREF(__pyx_v_rawlink);
+    __pyx_t_1 = __pyx_v_rawlink; __pyx_t_3 = NULL;
+    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
+      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
+      if (likely(__pyx_t_3)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
+        __Pyx_INCREF(__pyx_t_3);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_1, function);
+      }
+    }
+    __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_3, ((PyObject *)__pyx_v_greenlet_deleted)) : __Pyx_PyObject_CallOneArg(__pyx_t_1, ((PyObject *)__pyx_v_greenlet_deleted));
+    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 314, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+315:         wrthread = ref(greenlet)
+
    __Pyx_INCREF(__pyx_v_6gevent_6_local_ref);
+    __pyx_t_1 = __pyx_v_6gevent_6_local_ref; __pyx_t_3 = NULL;
+    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
+      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
+      if (likely(__pyx_t_3)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
+        __Pyx_INCREF(__pyx_t_3);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_1, function);
+      }
+    }
+    __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_3, ((PyObject *)__pyx_v_greenlet)) : __Pyx_PyObject_CallOneArg(__pyx_t_1, ((PyObject *)__pyx_v_greenlet));
+    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 315, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __pyx_v_wrthread = __pyx_t_2;
+    __pyx_t_2 = 0;
+
 316:     else:
+
+317:         wrthread = ref(greenlet, greenlet_deleted)
+
  /*else*/ {
+    __Pyx_INCREF(__pyx_v_6gevent_6_local_ref);
+    __pyx_t_1 = __pyx_v_6gevent_6_local_ref; __pyx_t_3 = NULL;
+    __pyx_t_6 = 0;
+    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
+      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
+      if (likely(__pyx_t_3)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
+        __Pyx_INCREF(__pyx_t_3);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_1, function);
+        __pyx_t_6 = 1;
+      }
+    }
+    #if CYTHON_FAST_PYCALL
+    if (PyFunction_Check(__pyx_t_1)) {
+      PyObject *__pyx_temp[3] = {__pyx_t_3, ((PyObject *)__pyx_v_greenlet), ((PyObject *)__pyx_v_greenlet_deleted)};
+      __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 317, __pyx_L1_error)
+      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __Pyx_GOTREF(__pyx_t_2);
+    } else
+    #endif
+    #if CYTHON_FAST_PYCCALL
+    if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
+      PyObject *__pyx_temp[3] = {__pyx_t_3, ((PyObject *)__pyx_v_greenlet), ((PyObject *)__pyx_v_greenlet_deleted)};
+      __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 317, __pyx_L1_error)
+      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __Pyx_GOTREF(__pyx_t_2);
+    } else
+    #endif
+    {
+      __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 317, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_7);
+      if (__pyx_t_3) {
+        __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3); __pyx_t_3 = NULL;
+      }
+      __Pyx_INCREF(((PyObject *)__pyx_v_greenlet));
+      __Pyx_GIVEREF(((PyObject *)__pyx_v_greenlet));
+      PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, ((PyObject *)__pyx_v_greenlet));
+      __Pyx_INCREF(((PyObject *)__pyx_v_greenlet_deleted));
+      __Pyx_GIVEREF(((PyObject *)__pyx_v_greenlet_deleted));
+      PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, ((PyObject *)__pyx_v_greenlet_deleted));
+      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 317, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_2);
+      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+    }
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __pyx_v_wrthread = __pyx_t_2;
+    __pyx_t_2 = 0;
+  }
+  __pyx_L3:;
+
 318: 
+
 319: 
+
 320:     # When the localimpl is deleted, remove the thread attribute.
+
+321:     local_deleted = _local_deleted(key, wrthread, greenlet_deleted)
+
  __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 321, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(__pyx_v_key);
+  __Pyx_GIVEREF(__pyx_v_key);
+  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_key);
+  __Pyx_INCREF(__pyx_v_wrthread);
+  __Pyx_GIVEREF(__pyx_v_wrthread);
+  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_wrthread);
+  __Pyx_INCREF(((PyObject *)__pyx_v_greenlet_deleted));
+  __Pyx_GIVEREF(((PyObject *)__pyx_v_greenlet_deleted));
+  PyTuple_SET_ITEM(__pyx_t_2, 2, ((PyObject *)__pyx_v_greenlet_deleted));
+  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6gevent_6_local__local_deleted), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 321, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_v_local_deleted = ((struct __pyx_obj_6gevent_6_local__local_deleted *)__pyx_t_1);
+  __pyx_t_1 = 0;
+
 322: 
+
 323: 
+
+324:     wrlocal = ref(self, local_deleted)
+
  __Pyx_INCREF(__pyx_v_6gevent_6_local_ref);
+  __pyx_t_2 = __pyx_v_6gevent_6_local_ref; __pyx_t_7 = NULL;
+  __pyx_t_6 = 0;
+  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
+    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2);
+    if (likely(__pyx_t_7)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+      __Pyx_INCREF(__pyx_t_7);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_2, function);
+      __pyx_t_6 = 1;
+    }
+  }
+  #if CYTHON_FAST_PYCALL
+  if (PyFunction_Check(__pyx_t_2)) {
+    PyObject *__pyx_temp[3] = {__pyx_t_7, ((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_local_deleted)};
+    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 324, __pyx_L1_error)
+    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+    __Pyx_GOTREF(__pyx_t_1);
+  } else
+  #endif
+  #if CYTHON_FAST_PYCCALL
+  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
+    PyObject *__pyx_temp[3] = {__pyx_t_7, ((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_local_deleted)};
+    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 324, __pyx_L1_error)
+    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+    __Pyx_GOTREF(__pyx_t_1);
+  } else
+  #endif
+  {
+    __pyx_t_3 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 324, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    if (__pyx_t_7) {
+      __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_7); __pyx_t_7 = NULL;
+    }
+    __Pyx_INCREF(((PyObject *)__pyx_v_self));
+    __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
+    PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_6, ((PyObject *)__pyx_v_self));
+    __Pyx_INCREF(((PyObject *)__pyx_v_local_deleted));
+    __Pyx_GIVEREF(((PyObject *)__pyx_v_local_deleted));
+    PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_6, ((PyObject *)__pyx_v_local_deleted));
+    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 324, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  }
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_v_wrlocal = __pyx_t_1;
+  __pyx_t_1 = 0;
+
+325:     greenlet.__dict__[key] = wrlocal
+
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_greenlet), __pyx_n_s_dict); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 325, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_key, __pyx_v_wrlocal) < 0)) __PYX_ERR(0, 325, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 326: 
+
+327:     self.dicts[id_greenlet] = _localimpl_dict_entry(wrthread, localdict)
+
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 327, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(__pyx_v_wrthread);
+  __Pyx_GIVEREF(__pyx_v_wrthread);
+  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_wrthread);
+  __Pyx_INCREF(__pyx_v_localdict);
+  __Pyx_GIVEREF(__pyx_v_localdict);
+  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_localdict);
+  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6gevent_6_local__localimpl_dict_entry), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 327, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  if (unlikely(__pyx_v_self->dicts == Py_None)) {
+    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
+    __PYX_ERR(0, 327, __pyx_L1_error)
+  }
+  if (unlikely(PyDict_SetItem(__pyx_v_self->dicts, __pyx_v_id_greenlet, __pyx_t_2) < 0)) __PYX_ERR(0, 327, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+328:     return localdict
+
  __Pyx_XDECREF(__pyx_r);
+  __Pyx_INCREF(__pyx_v_localdict);
+  __pyx_r = __pyx_v_localdict;
+  goto __pyx_L0;
+
 329: 
+
 330: 
+
+331: _marker = object()
+
  __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_builtin_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 331, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_XGOTREF(__pyx_v_6gevent_6_local__marker);
+  __Pyx_DECREF_SET(__pyx_v_6gevent_6_local__marker, __pyx_t_2);
+  __Pyx_GIVEREF(__pyx_t_2);
+  __pyx_t_2 = 0;
+
 332: 
+
+333: def _local_get_dict(self):
+
static CYTHON_INLINE PyObject *__pyx_f_6gevent_6_local__local_get_dict(struct __pyx_obj_6gevent_6_local_local *__pyx_v_self) {
+  struct __pyx_obj_6gevent_6_local__localimpl *__pyx_v_impl = 0;
+  PyObject *__pyx_v_dct = 0;
+  struct __pyx_obj_6gevent_6_local__localimpl_dict_entry *__pyx_v_entry = 0;
+  PyGreenlet *__pyx_v_greenlet = NULL;
+  PyObject *__pyx_v_idg = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_local_get_dict", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_6);
+  __Pyx_XDECREF(__pyx_t_7);
+  __Pyx_XDECREF(__pyx_t_8);
+  __Pyx_XDECREF(__pyx_t_9);
+  __Pyx_AddTraceback("gevent._local._local_get_dict", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XDECREF((PyObject *)__pyx_v_impl);
+  __Pyx_XDECREF(__pyx_v_dct);
+  __Pyx_XDECREF((PyObject *)__pyx_v_entry);
+  __Pyx_XDECREF((PyObject *)__pyx_v_greenlet);
+  __Pyx_XDECREF(__pyx_v_idg);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+334:     impl = self._local__impl
+
  __pyx_t_1 = ((PyObject *)__pyx_v_self->_local__impl);
+  __Pyx_INCREF(__pyx_t_1);
+  __pyx_v_impl = ((struct __pyx_obj_6gevent_6_local__localimpl *)__pyx_t_1);
+  __pyx_t_1 = 0;
+
 335:     # Cython can optimize dict[], but not dict.get()
+
+336:     greenlet = getcurrent() # pylint:disable=undefined-variable
+
  __pyx_t_1 = ((PyObject *)__pyx_f_6gevent_6_local_getcurrent()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 336, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_v_greenlet = ((PyGreenlet *)__pyx_t_1);
+  __pyx_t_1 = 0;
+
+337:     idg = id(greenlet)
+
  __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_greenlet)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 337, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_v_idg = __pyx_t_1;
+  __pyx_t_1 = 0;
+
+338:     try:
+
  {
+    /*try:*/ {
+/* … */
+    }
+    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+    goto __pyx_L8_try_end;
+    __pyx_L3_error:;
+    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+/* … */
+    __Pyx_XGIVEREF(__pyx_t_2);
+    __Pyx_XGIVEREF(__pyx_t_3);
+    __Pyx_XGIVEREF(__pyx_t_4);
+    __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
+    goto __pyx_L1_error;
+    __pyx_L4_exception_handled:;
+    __Pyx_XGIVEREF(__pyx_t_2);
+    __Pyx_XGIVEREF(__pyx_t_3);
+    __Pyx_XGIVEREF(__pyx_t_4);
+    __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
+    __pyx_L8_try_end:;
+  }
+
+339:         entry = impl.dicts[idg]
+
      if (unlikely(__pyx_v_impl->dicts == Py_None)) {
+        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
+        __PYX_ERR(0, 339, __pyx_L3_error)
+      }
+      __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_impl->dicts, __pyx_v_idg); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 339, __pyx_L3_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_6gevent_6_local__localimpl_dict_entry))))) __PYX_ERR(0, 339, __pyx_L3_error)
+      __pyx_v_entry = ((struct __pyx_obj_6gevent_6_local__localimpl_dict_entry *)__pyx_t_1);
+      __pyx_t_1 = 0;
+
+340:         dct = entry.localdict
+
      __pyx_t_1 = __pyx_v_entry->localdict;
+      __Pyx_INCREF(__pyx_t_1);
+      __pyx_v_dct = ((PyObject*)__pyx_t_1);
+      __pyx_t_1 = 0;
+
+341:     except KeyError:
+
    __pyx_t_5 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
+    if (__pyx_t_5) {
+      __Pyx_AddTraceback("gevent._local._local_get_dict", __pyx_clineno, __pyx_lineno, __pyx_filename);
+      if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 341, __pyx_L5_except_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      __Pyx_GOTREF(__pyx_t_6);
+      __Pyx_GOTREF(__pyx_t_7);
+
+342:         dct = _localimpl_create_dict(impl, greenlet, idg)
+
      __pyx_t_8 = __pyx_f_6gevent_6_local__localimpl_create_dict(__pyx_v_impl, __pyx_v_greenlet, __pyx_v_idg); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 342, __pyx_L5_except_error)
+      __Pyx_GOTREF(__pyx_t_8);
+      __Pyx_XDECREF_SET(__pyx_v_dct, ((PyObject*)__pyx_t_8));
+      __pyx_t_8 = 0;
+
+343:         self.__init__(*impl.localargs, **impl.localkwargs)
+
      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_init); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 343, __pyx_L5_except_error)
+      __Pyx_GOTREF(__pyx_t_8);
+      if (unlikely(__pyx_v_impl->localargs == Py_None)) {
+        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
+        __PYX_ERR(0, 343, __pyx_L5_except_error)
+      }
+      if (unlikely(__pyx_v_impl->localkwargs == Py_None)) {
+        PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType");
+        __PYX_ERR(0, 343, __pyx_L5_except_error)
+      }
+      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_v_impl->localargs, __pyx_v_impl->localkwargs); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 343, __pyx_L5_except_error)
+      __Pyx_GOTREF(__pyx_t_9);
+      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+      goto __pyx_L4_exception_handled;
+    }
+    goto __pyx_L5_except_error;
+    __pyx_L5_except_error:;
+
+344:     return dct
+
  __Pyx_XDECREF(__pyx_r);
+  __Pyx_INCREF(__pyx_v_dct);
+  __pyx_r = __pyx_v_dct;
+  goto __pyx_L0;
+
 345: 
+
+346: def _init():
+
static void __pyx_f_6gevent_6_local__init(void) {
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_init", 0);
+/* … */
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+}
+
+347:     greenlet_init() # pylint:disable=undefined-variable
+
  __pyx_f_6gevent_6_local_greenlet_init();
+
 348: 
+
 349: _local_attrs = {
+
+350:     '_local__impl',
+
  __pyx_t_2 = PySet_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 350, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PySet_Add(__pyx_t_2, __pyx_n_s_local__impl) < 0) __PYX_ERR(0, 350, __pyx_L1_error)
+  if (PySet_Add(__pyx_t_2, __pyx_n_s_local_type_get_descriptors) < 0) __PYX_ERR(0, 350, __pyx_L1_error)
+  if (PySet_Add(__pyx_t_2, __pyx_n_s_local_type_set_or_del_descripto) < 0) __PYX_ERR(0, 350, __pyx_L1_error)
+  if (PySet_Add(__pyx_t_2, __pyx_n_s_local_type_del_descriptors) < 0) __PYX_ERR(0, 350, __pyx_L1_error)
+  if (PySet_Add(__pyx_t_2, __pyx_n_s_local_type_set_descriptors) < 0) __PYX_ERR(0, 350, __pyx_L1_error)
+  if (PySet_Add(__pyx_t_2, __pyx_n_s_local_type_2) < 0) __PYX_ERR(0, 350, __pyx_L1_error)
+  if (PySet_Add(__pyx_t_2, __pyx_n_s_local_type_vars) < 0) __PYX_ERR(0, 350, __pyx_L1_error)
+  if (PySet_Add(__pyx_t_2, __pyx_n_s_class) < 0) __PYX_ERR(0, 350, __pyx_L1_error)
+  if (PySet_Add(__pyx_t_2, __pyx_n_s_cinit) < 0) __PYX_ERR(0, 350, __pyx_L1_error)
+  __Pyx_XGOTREF(__pyx_v_6gevent_6_local__local_attrs);
+  __Pyx_DECREF_SET(__pyx_v_6gevent_6_local__local_attrs, ((PyObject*)__pyx_t_2));
+  __Pyx_GIVEREF(__pyx_t_2);
+  __pyx_t_2 = 0;
+
 351:     '_local_type_get_descriptors',
+
 352:     '_local_type_set_or_del_descriptors',
+
 353:     '_local_type_del_descriptors',
+
 354:     '_local_type_set_descriptors',
+
 355:     '_local_type',
+
 356:     '_local_type_vars',
+
 357:     '__class__',
+
 358:     '__cinit__',
+
 359: }
+
 360: 
+
+361: class local(object):
+
struct __pyx_vtabstruct_6gevent_6_local_local {
+  struct __pyx_obj_6gevent_6_local_local *(*__pyx___copy__)(struct __pyx_obj_6gevent_6_local_local *, int __pyx_skip_dispatch);
+};
+static struct __pyx_vtabstruct_6gevent_6_local_local *__pyx_vtabptr_6gevent_6_local_local;
+
 362:     """
+
 363:     An object whose attributes are greenlet-local.
+
 364:     """
+
+365:     __slots__ = tuple(_local_attrs - {'__class__', '__cinit__'})
+
  __pyx_t_2 = PySet_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 365, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PySet_Add(__pyx_t_2, __pyx_n_s_class) < 0) __PYX_ERR(0, 365, __pyx_L1_error)
+  if (PySet_Add(__pyx_t_2, __pyx_n_s_cinit) < 0) __PYX_ERR(0, 365, __pyx_L1_error)
+  __pyx_t_1 = PyNumber_Subtract(__pyx_v_6gevent_6_local__local_attrs, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 365, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_2 = __Pyx_PySequence_Tuple(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 365, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_local_local->tp_dict, __pyx_n_s_slots, __pyx_t_2) < 0) __PYX_ERR(0, 365, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_6_local_local);
+
 366: 
+
+367:     def __cinit__(self, *args, **kw):
+
/* Python wrapper */
+static int __pyx_pw_6gevent_6_local_5local_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static int __pyx_pw_6gevent_6_local_5local_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_args = 0;
+  PyObject *__pyx_v_kw = 0;
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
+  if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 1))) return -1;
+  __pyx_v_kw = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New(); if (unlikely(!__pyx_v_kw)) return -1;
+  __Pyx_GOTREF(__pyx_v_kw);
+  __Pyx_INCREF(__pyx_args);
+  __pyx_v_args = __pyx_args;
+  __pyx_r = __pyx_pf_6gevent_6_local_5local___cinit__(((struct __pyx_obj_6gevent_6_local_local *)__pyx_v_self), __pyx_v_args, __pyx_v_kw);
+
+  /* function exit code */
+  __Pyx_XDECREF(__pyx_v_args);
+  __Pyx_XDECREF(__pyx_v_kw);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_6_local_5local___cinit__(struct __pyx_obj_6gevent_6_local_local *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kw) {
+  struct __pyx_obj_6gevent_6_local__localimpl *__pyx_v_impl = NULL;
+  PyObject *__pyx_v_get = NULL;
+  PyObject *__pyx_v_dels = NULL;
+  PyObject *__pyx_v_sets_or_dels = NULL;
+  PyObject *__pyx_v_sets = NULL;
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__cinit__", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = 0;
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_XDECREF(__pyx_t_6);
+  __Pyx_XDECREF(__pyx_t_7);
+  __Pyx_AddTraceback("gevent._local.local.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = -1;
+  __pyx_L0:;
+  __Pyx_XDECREF((PyObject *)__pyx_v_impl);
+  __Pyx_XDECREF(__pyx_v_get);
+  __Pyx_XDECREF(__pyx_v_dels);
+  __Pyx_XDECREF(__pyx_v_sets_or_dels);
+  __Pyx_XDECREF(__pyx_v_sets);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+368:         if args or kw:
+
  __pyx_t_2 = (PyTuple_GET_SIZE(__pyx_v_args) != 0);
+  if (!__pyx_t_2) {
+  } else {
+    __pyx_t_1 = __pyx_t_2;
+    goto __pyx_L4_bool_binop_done;
+  }
+  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_kw); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 368, __pyx_L1_error)
+  __pyx_t_1 = __pyx_t_2;
+  __pyx_L4_bool_binop_done:;
+  if (__pyx_t_1) {
+/* … */
+  }
+
+369:             if type(self).__init__ == object.__init__:
+
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))), __pyx_n_s_init); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 369, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_builtin_object, __pyx_n_s_init); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 369, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 369, __pyx_L1_error)
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 369, __pyx_L1_error)
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    if (unlikely(__pyx_t_1)) {
+/* … */
+    }
+
+370:                 raise TypeError("Initialization arguments are not supported", args, kw)
+
      __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 370, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_5);
+      __Pyx_INCREF(__pyx_kp_s_Initialization_arguments_are_not);
+      __Pyx_GIVEREF(__pyx_kp_s_Initialization_arguments_are_not);
+      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_kp_s_Initialization_arguments_are_not);
+      __Pyx_INCREF(__pyx_v_args);
+      __Pyx_GIVEREF(__pyx_v_args);
+      PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_args);
+      __Pyx_INCREF(__pyx_v_kw);
+      __Pyx_GIVEREF(__pyx_v_kw);
+      PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_kw);
+      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 370, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_4);
+      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+      __Pyx_Raise(__pyx_t_4, 0, 0, 0);
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __PYX_ERR(0, 370, __pyx_L1_error)
+
+371:         impl = _localimpl(args, kw, type(self), id(self))
+
  __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 371, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_4);
+  __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 371, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_5);
+  __Pyx_INCREF(__pyx_v_args);
+  __Pyx_GIVEREF(__pyx_v_args);
+  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_args);
+  __Pyx_INCREF(__pyx_v_kw);
+  __Pyx_GIVEREF(__pyx_v_kw);
+  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_kw);
+  __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
+  __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
+  PyTuple_SET_ITEM(__pyx_t_5, 2, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
+  __Pyx_GIVEREF(__pyx_t_4);
+  PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4);
+  __pyx_t_4 = 0;
+  __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6gevent_6_local__localimpl), __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 371, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_4);
+  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+  __pyx_v_impl = ((struct __pyx_obj_6gevent_6_local__localimpl *)__pyx_t_4);
+  __pyx_t_4 = 0;
+
 372:         # pylint:disable=attribute-defined-outside-init
+
+373:         self._local__impl = impl
+
  __Pyx_INCREF(((PyObject *)__pyx_v_impl));
+  __Pyx_GIVEREF(((PyObject *)__pyx_v_impl));
+  __Pyx_GOTREF(__pyx_v_self->_local__impl);
+  __Pyx_DECREF(((PyObject *)__pyx_v_self->_local__impl));
+  __pyx_v_self->_local__impl = __pyx_v_impl;
+
+374:         get, dels, sets_or_dels, sets = _local_find_descriptors(self)
+
  __pyx_t_4 = __pyx_f_6gevent_6_local__local_find_descriptors(__pyx_v_self); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 374, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_4);
+  if (likely(__pyx_t_4 != Py_None)) {
+    PyObject* sequence = __pyx_t_4;
+    Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
+    if (unlikely(size != 4)) {
+      if (size > 4) __Pyx_RaiseTooManyValuesError(4);
+      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
+      __PYX_ERR(0, 374, __pyx_L1_error)
+    }
+    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+    __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); 
+    __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); 
+    __pyx_t_6 = PyTuple_GET_ITEM(sequence, 2); 
+    __pyx_t_7 = PyTuple_GET_ITEM(sequence, 3); 
+    __Pyx_INCREF(__pyx_t_5);
+    __Pyx_INCREF(__pyx_t_3);
+    __Pyx_INCREF(__pyx_t_6);
+    __Pyx_INCREF(__pyx_t_7);
+    #else
+    {
+      Py_ssize_t i;
+      PyObject** temps[4] = {&__pyx_t_5,&__pyx_t_3,&__pyx_t_6,&__pyx_t_7};
+      for (i=0; i < 4; i++) {
+        PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(0, 374, __pyx_L1_error)
+        __Pyx_GOTREF(item);
+        *(temps[i]) = item;
+      }
+    }
+    #endif
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  } else {
+    __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(0, 374, __pyx_L1_error)
+  }
+  __pyx_v_get = __pyx_t_5;
+  __pyx_t_5 = 0;
+  __pyx_v_dels = __pyx_t_3;
+  __pyx_t_3 = 0;
+  __pyx_v_sets_or_dels = __pyx_t_6;
+  __pyx_t_6 = 0;
+  __pyx_v_sets = __pyx_t_7;
+  __pyx_t_7 = 0;
+
+375:         self._local_type_get_descriptors = get
+
  if (!(likely(PySet_CheckExact(__pyx_v_get))||((__pyx_v_get) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "set", Py_TYPE(__pyx_v_get)->tp_name), 0))) __PYX_ERR(0, 375, __pyx_L1_error)
+  __pyx_t_4 = __pyx_v_get;
+  __Pyx_INCREF(__pyx_t_4);
+  __Pyx_GIVEREF(__pyx_t_4);
+  __Pyx_GOTREF(__pyx_v_self->_local_type_get_descriptors);
+  __Pyx_DECREF(__pyx_v_self->_local_type_get_descriptors);
+  __pyx_v_self->_local_type_get_descriptors = ((PyObject*)__pyx_t_4);
+  __pyx_t_4 = 0;
+
+376:         self._local_type_set_or_del_descriptors = sets_or_dels
+
  if (!(likely(PySet_CheckExact(__pyx_v_sets_or_dels))||((__pyx_v_sets_or_dels) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "set", Py_TYPE(__pyx_v_sets_or_dels)->tp_name), 0))) __PYX_ERR(0, 376, __pyx_L1_error)
+  __pyx_t_4 = __pyx_v_sets_or_dels;
+  __Pyx_INCREF(__pyx_t_4);
+  __Pyx_GIVEREF(__pyx_t_4);
+  __Pyx_GOTREF(__pyx_v_self->_local_type_set_or_del_descriptors);
+  __Pyx_DECREF(__pyx_v_self->_local_type_set_or_del_descriptors);
+  __pyx_v_self->_local_type_set_or_del_descriptors = ((PyObject*)__pyx_t_4);
+  __pyx_t_4 = 0;
+
+377:         self._local_type_del_descriptors = dels
+
  if (!(likely(PySet_CheckExact(__pyx_v_dels))||((__pyx_v_dels) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "set", Py_TYPE(__pyx_v_dels)->tp_name), 0))) __PYX_ERR(0, 377, __pyx_L1_error)
+  __pyx_t_4 = __pyx_v_dels;
+  __Pyx_INCREF(__pyx_t_4);
+  __Pyx_GIVEREF(__pyx_t_4);
+  __Pyx_GOTREF(__pyx_v_self->_local_type_del_descriptors);
+  __Pyx_DECREF(__pyx_v_self->_local_type_del_descriptors);
+  __pyx_v_self->_local_type_del_descriptors = ((PyObject*)__pyx_t_4);
+  __pyx_t_4 = 0;
+
+378:         self._local_type_set_descriptors = sets
+
  if (!(likely(PySet_CheckExact(__pyx_v_sets))||((__pyx_v_sets) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "set", Py_TYPE(__pyx_v_sets)->tp_name), 0))) __PYX_ERR(0, 378, __pyx_L1_error)
+  __pyx_t_4 = __pyx_v_sets;
+  __Pyx_INCREF(__pyx_t_4);
+  __Pyx_GIVEREF(__pyx_t_4);
+  __Pyx_GOTREF(__pyx_v_self->_local_type_set_descriptors);
+  __Pyx_DECREF(__pyx_v_self->_local_type_set_descriptors);
+  __pyx_v_self->_local_type_set_descriptors = ((PyObject*)__pyx_t_4);
+  __pyx_t_4 = 0;
+
+379:         self._local_type = type(self)
+
  __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
+  __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
+  __Pyx_GOTREF(__pyx_v_self->_local_type);
+  __Pyx_DECREF(((PyObject *)__pyx_v_self->_local_type));
+  __pyx_v_self->_local_type = ((PyTypeObject*)((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
+
+380:         self._local_type_vars = set(dir(self._local_type))
+
  __pyx_t_4 = ((PyObject *)__pyx_v_self->_local_type);
+  __Pyx_INCREF(__pyx_t_4);
+  __pyx_t_7 = PyObject_Dir(__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 380, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_7);
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __pyx_t_4 = PySet_New(__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 380, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_4);
+  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __Pyx_GIVEREF(__pyx_t_4);
+  __Pyx_GOTREF(__pyx_v_self->_local_type_vars);
+  __Pyx_DECREF(__pyx_v_self->_local_type_vars);
+  __pyx_v_self->_local_type_vars = ((PyObject*)__pyx_t_4);
+  __pyx_t_4 = 0;
+
 381: 
+
+382:     def __getattribute__(self, name): # pylint:disable=too-many-return-statements
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_local_5local_3__getattribute__(PyObject *__pyx_v_self, PyObject *__pyx_v_name); /*proto*/
+static PyObject *__pyx_pw_6gevent_6_local_5local_3__getattribute__(PyObject *__pyx_v_self, PyObject *__pyx_v_name) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__getattribute__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_6_local_5local_2__getattribute__(((struct __pyx_obj_6gevent_6_local_local *)__pyx_v_self), ((PyObject *)__pyx_v_name));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_local_5local_2__getattribute__(struct __pyx_obj_6gevent_6_local_local *__pyx_v_self, PyObject *__pyx_v_name) {
+  PyObject *__pyx_v_dct = NULL;
+  PyObject *__pyx_v_type_attr = NULL;
+  PyObject *__pyx_v_base = NULL;
+  PyObject *__pyx_v_bd = NULL;
+  PyObject *__pyx_v_attr_on_type = NULL;
+  PyObject *__pyx_v_result = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__getattribute__", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_XDECREF(__pyx_t_7);
+  __Pyx_XDECREF(__pyx_t_8);
+  __Pyx_AddTraceback("gevent._local.local.__getattribute__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_dct);
+  __Pyx_XDECREF(__pyx_v_type_attr);
+  __Pyx_XDECREF(__pyx_v_base);
+  __Pyx_XDECREF(__pyx_v_bd);
+  __Pyx_XDECREF(__pyx_v_attr_on_type);
+  __Pyx_XDECREF(__pyx_v_result);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+383:         if name in _local_attrs:
+
  if (unlikely(__pyx_v_6gevent_6_local__local_attrs == Py_None)) {
+    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
+    __PYX_ERR(0, 383, __pyx_L1_error)
+  }
+  __pyx_t_1 = (__Pyx_PySet_ContainsTF(__pyx_v_name, __pyx_v_6gevent_6_local__local_attrs, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 383, __pyx_L1_error)
+  __pyx_t_2 = (__pyx_t_1 != 0);
+  if (__pyx_t_2) {
+/* … */
+  }
+
 384:             # The _local__impl,  __cinit__, etc, won't be hit by the
+
 385:             # Cython version, if we've done things right. If we haven't,
+
 386:             # they will be, and this will produce an error.
+
+387:             return object.__getattribute__(self, name)
+
    __Pyx_XDECREF(__pyx_r);
+    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_builtin_object, __pyx_n_s_getattribute); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 387, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    __pyx_t_5 = NULL;
+    __pyx_t_6 = 0;
+    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
+      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
+      if (likely(__pyx_t_5)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
+        __Pyx_INCREF(__pyx_t_5);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_4, function);
+        __pyx_t_6 = 1;
+      }
+    }
+    #if CYTHON_FAST_PYCALL
+    if (PyFunction_Check(__pyx_t_4)) {
+      PyObject *__pyx_temp[3] = {__pyx_t_5, ((PyObject *)__pyx_v_self), __pyx_v_name};
+      __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 387, __pyx_L1_error)
+      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+      __Pyx_GOTREF(__pyx_t_3);
+    } else
+    #endif
+    #if CYTHON_FAST_PYCCALL
+    if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
+      PyObject *__pyx_temp[3] = {__pyx_t_5, ((PyObject *)__pyx_v_self), __pyx_v_name};
+      __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 387, __pyx_L1_error)
+      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+      __Pyx_GOTREF(__pyx_t_3);
+    } else
+    #endif
+    {
+      __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 387, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_7);
+      if (__pyx_t_5) {
+        __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
+      }
+      __Pyx_INCREF(((PyObject *)__pyx_v_self));
+      __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
+      PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, ((PyObject *)__pyx_v_self));
+      __Pyx_INCREF(__pyx_v_name);
+      __Pyx_GIVEREF(__pyx_v_name);
+      PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_name);
+      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 387, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_3);
+      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+    }
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __pyx_r = __pyx_t_3;
+    __pyx_t_3 = 0;
+    goto __pyx_L0;
+
 388: 
+
+389:         dct = _local_get_dict(self)
+
  __pyx_t_3 = __pyx_f_6gevent_6_local__local_get_dict(__pyx_v_self); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 389, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __pyx_v_dct = ((PyObject*)__pyx_t_3);
+  __pyx_t_3 = 0;
+
 390: 
+
+391:         if name == '__dict__':
+
  __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_name, __pyx_n_s_dict, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 391, __pyx_L1_error)
+  if (__pyx_t_2) {
+/* … */
+  }
+
+392:             return dct
+
    __Pyx_XDECREF(__pyx_r);
+    __Pyx_INCREF(__pyx_v_dct);
+    __pyx_r = __pyx_v_dct;
+    goto __pyx_L0;
+
 393:         # If there's no possible way we can switch, because this
+
 394:         # attribute is *not* found in the class where it might be a
+
 395:         # data descriptor (property), and it *is* in the dict
+
 396:         # then we don't need to swizzle the dict and take the lock.
+
 397: 
+
 398:         # We don't have to worry about people overriding __getattribute__
+
 399:         # because if they did, the dict-swizzling would only last as
+
 400:         # long as we were in here anyway.
+
 401:         # Similarly, a __getattr__ will still be called by _oga() if needed
+
 402:         # if it's not in the dict.
+
 403: 
+
 404:         # Optimization: If we're not subclassed, then
+
 405:         # there can be no descriptors except for methods, which will
+
 406:         # never need to use __dict__.
+
+407:         if self._local_type is local:
+
  __pyx_t_2 = (__pyx_v_self->_local_type == __pyx_ptype_6gevent_6_local_local);
+  __pyx_t_1 = (__pyx_t_2 != 0);
+  if (__pyx_t_1) {
+/* … */
+  }
+
+408:             return dct[name] if name in dct else object.__getattribute__(self, name)
+
    __Pyx_XDECREF(__pyx_r);
+    if (unlikely(__pyx_v_dct == Py_None)) {
+      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
+      __PYX_ERR(0, 408, __pyx_L1_error)
+    }
+    __pyx_t_1 = (__Pyx_PyDict_ContainsTF(__pyx_v_name, __pyx_v_dct, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 408, __pyx_L1_error)
+    if ((__pyx_t_1 != 0)) {
+      if (unlikely(__pyx_v_dct == Py_None)) {
+        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
+        __PYX_ERR(0, 408, __pyx_L1_error)
+      }
+      __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_dct, __pyx_v_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 408, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_4);
+      __pyx_t_3 = __pyx_t_4;
+      __pyx_t_4 = 0;
+    } else {
+      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_builtin_object, __pyx_n_s_getattribute); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 408, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_7);
+      __pyx_t_5 = NULL;
+      __pyx_t_6 = 0;
+      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
+        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
+        if (likely(__pyx_t_5)) {
+          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
+          __Pyx_INCREF(__pyx_t_5);
+          __Pyx_INCREF(function);
+          __Pyx_DECREF_SET(__pyx_t_7, function);
+          __pyx_t_6 = 1;
+        }
+      }
+      #if CYTHON_FAST_PYCALL
+      if (PyFunction_Check(__pyx_t_7)) {
+        PyObject *__pyx_temp[3] = {__pyx_t_5, ((PyObject *)__pyx_v_self), __pyx_v_name};
+        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 408, __pyx_L1_error)
+        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+        __Pyx_GOTREF(__pyx_t_4);
+      } else
+      #endif
+      #if CYTHON_FAST_PYCCALL
+      if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
+        PyObject *__pyx_temp[3] = {__pyx_t_5, ((PyObject *)__pyx_v_self), __pyx_v_name};
+        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 408, __pyx_L1_error)
+        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+        __Pyx_GOTREF(__pyx_t_4);
+      } else
+      #endif
+      {
+        __pyx_t_8 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 408, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_8);
+        if (__pyx_t_5) {
+          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL;
+        }
+        __Pyx_INCREF(((PyObject *)__pyx_v_self));
+        __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
+        PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_6, ((PyObject *)__pyx_v_self));
+        __Pyx_INCREF(__pyx_v_name);
+        __Pyx_GIVEREF(__pyx_v_name);
+        PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_6, __pyx_v_name);
+        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 408, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_4);
+        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+      }
+      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+      __pyx_t_3 = __pyx_t_4;
+      __pyx_t_4 = 0;
+    }
+    __pyx_r = __pyx_t_3;
+    __pyx_t_3 = 0;
+    goto __pyx_L0;
+
 409: 
+
 410:         # NOTE: If this is a descriptor, this will invoke its __get__.
+
 411:         # A broken descriptor that doesn't return itself when called with
+
 412:         # a None for the instance argument could mess us up here.
+
 413:         # But this is faster than a loop over mro() checking each class __dict__
+
 414:         # manually.
+
+415:         if name in dct:
+
  if (unlikely(__pyx_v_dct == Py_None)) {
+    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
+    __PYX_ERR(0, 415, __pyx_L1_error)
+  }
+  __pyx_t_1 = (__Pyx_PyDict_ContainsTF(__pyx_v_name, __pyx_v_dct, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 415, __pyx_L1_error)
+  __pyx_t_2 = (__pyx_t_1 != 0);
+  if (__pyx_t_2) {
+/* … */
+  }
+
+416:             if name not in self._local_type_vars:
+
    if (unlikely(__pyx_v_self->_local_type_vars == Py_None)) {
+      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
+      __PYX_ERR(0, 416, __pyx_L1_error)
+    }
+    __pyx_t_2 = (__Pyx_PySet_ContainsTF(__pyx_v_name, __pyx_v_self->_local_type_vars, Py_NE)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 416, __pyx_L1_error)
+    __pyx_t_1 = (__pyx_t_2 != 0);
+    if (__pyx_t_1) {
+/* … */
+    }
+
 417:                 # If there is a dict value, and nothing in the type,
+
 418:                 # it can't possibly be a descriptor, so it is just returned.
+
+419:                 return dct[name]
+
      __Pyx_XDECREF(__pyx_r);
+      if (unlikely(__pyx_v_dct == Py_None)) {
+        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
+        __PYX_ERR(0, 419, __pyx_L1_error)
+      }
+      __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_dct, __pyx_v_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 419, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_3);
+      __pyx_r = __pyx_t_3;
+      __pyx_t_3 = 0;
+      goto __pyx_L0;
+
 420: 
+
 421:             # It's in the type *and* in the dict. If the type value is
+
 422:             # a data descriptor (defines __get__ *and* either __set__ or
+
 423:             # __delete__), then the type wins. If it's a non-data descriptor
+
 424:             # (defines just __get__), then the instance wins. If it's not a
+
 425:             # descriptor at all (doesn't have __get__), the instance wins.
+
 426:             # NOTE that the docs for descriptors say that these methods must be
+
 427:             # defined on the *class* of the object in the type.
+
+428:             if name not in self._local_type_get_descriptors:
+
    if (unlikely(__pyx_v_self->_local_type_get_descriptors == Py_None)) {
+      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
+      __PYX_ERR(0, 428, __pyx_L1_error)
+    }
+    __pyx_t_1 = (__Pyx_PySet_ContainsTF(__pyx_v_name, __pyx_v_self->_local_type_get_descriptors, Py_NE)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 428, __pyx_L1_error)
+    __pyx_t_2 = (__pyx_t_1 != 0);
+    if (__pyx_t_2) {
+/* … */
+    }
+
 429:                 # Entirely not a descriptor. Instance wins.
+
+430:                 return dct[name]
+
      __Pyx_XDECREF(__pyx_r);
+      if (unlikely(__pyx_v_dct == Py_None)) {
+        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
+        __PYX_ERR(0, 430, __pyx_L1_error)
+      }
+      __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_dct, __pyx_v_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 430, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_3);
+      __pyx_r = __pyx_t_3;
+      __pyx_t_3 = 0;
+      goto __pyx_L0;
+
+431:             if name in self._local_type_set_or_del_descriptors:
+
    if (unlikely(__pyx_v_self->_local_type_set_or_del_descriptors == Py_None)) {
+      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
+      __PYX_ERR(0, 431, __pyx_L1_error)
+    }
+    __pyx_t_2 = (__Pyx_PySet_ContainsTF(__pyx_v_name, __pyx_v_self->_local_type_set_or_del_descriptors, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 431, __pyx_L1_error)
+    __pyx_t_1 = (__pyx_t_2 != 0);
+    if (__pyx_t_1) {
+/* … */
+    }
+
 432:                 # A data descriptor.
+
 433:                 # arbitrary code execution while these run. If they touch self again,
+
 434:                 # they'll call back into us and we'll repeat the dance.
+
+435:                 type_attr = getattr(self._local_type, name)
+
      __pyx_t_3 = ((PyObject *)__pyx_v_self->_local_type);
+      __Pyx_INCREF(__pyx_t_3);
+      __pyx_t_4 = __Pyx_GetAttr(__pyx_t_3, __pyx_v_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 435, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_4);
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __pyx_v_type_attr = __pyx_t_4;
+      __pyx_t_4 = 0;
+
+436:                 return type(type_attr).__get__(type_attr, self, self._local_type)
+
      __Pyx_XDECREF(__pyx_r);
+      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)Py_TYPE(__pyx_v_type_attr)), __pyx_n_s_get); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 436, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_3);
+      __pyx_t_7 = NULL;
+      __pyx_t_6 = 0;
+      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
+        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3);
+        if (likely(__pyx_t_7)) {
+          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+          __Pyx_INCREF(__pyx_t_7);
+          __Pyx_INCREF(function);
+          __Pyx_DECREF_SET(__pyx_t_3, function);
+          __pyx_t_6 = 1;
+        }
+      }
+      #if CYTHON_FAST_PYCALL
+      if (PyFunction_Check(__pyx_t_3)) {
+        PyObject *__pyx_temp[4] = {__pyx_t_7, __pyx_v_type_attr, ((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_self->_local_type)};
+        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 436, __pyx_L1_error)
+        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+        __Pyx_GOTREF(__pyx_t_4);
+      } else
+      #endif
+      #if CYTHON_FAST_PYCCALL
+      if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
+        PyObject *__pyx_temp[4] = {__pyx_t_7, __pyx_v_type_attr, ((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_self->_local_type)};
+        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 436, __pyx_L1_error)
+        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+        __Pyx_GOTREF(__pyx_t_4);
+      } else
+      #endif
+      {
+        __pyx_t_8 = PyTuple_New(3+__pyx_t_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 436, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_8);
+        if (__pyx_t_7) {
+          __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7); __pyx_t_7 = NULL;
+        }
+        __Pyx_INCREF(__pyx_v_type_attr);
+        __Pyx_GIVEREF(__pyx_v_type_attr);
+        PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_6, __pyx_v_type_attr);
+        __Pyx_INCREF(((PyObject *)__pyx_v_self));
+        __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
+        PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_6, ((PyObject *)__pyx_v_self));
+        __Pyx_INCREF(((PyObject *)__pyx_v_self->_local_type));
+        __Pyx_GIVEREF(((PyObject *)__pyx_v_self->_local_type));
+        PyTuple_SET_ITEM(__pyx_t_8, 2+__pyx_t_6, ((PyObject *)__pyx_v_self->_local_type));
+        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 436, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_4);
+        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+      }
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __pyx_r = __pyx_t_4;
+      __pyx_t_4 = 0;
+      goto __pyx_L0;
+
 437:             # Last case is a non-data descriptor. Instance wins.
+
+438:             return dct[name]
+
    __Pyx_XDECREF(__pyx_r);
+    if (unlikely(__pyx_v_dct == Py_None)) {
+      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
+      __PYX_ERR(0, 438, __pyx_L1_error)
+    }
+    __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_dct, __pyx_v_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 438, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    __pyx_r = __pyx_t_4;
+    __pyx_t_4 = 0;
+    goto __pyx_L0;
+
 439: 
+
+440:         if name in self._local_type_vars:
+
  if (unlikely(__pyx_v_self->_local_type_vars == Py_None)) {
+    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
+    __PYX_ERR(0, 440, __pyx_L1_error)
+  }
+  __pyx_t_1 = (__Pyx_PySet_ContainsTF(__pyx_v_name, __pyx_v_self->_local_type_vars, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 440, __pyx_L1_error)
+  __pyx_t_2 = (__pyx_t_1 != 0);
+  if (__pyx_t_2) {
+/* … */
+  }
+
 441:             # Not in the dictionary, but is found in the type. It could be
+
 442:             # a non-data descriptor still. Some descriptors, like @staticmethod,
+
 443:             # return objects (functions, in this case), that are *themselves*
+
 444:             # descriptors, which when invoked, again, would do the wrong thing.
+
 445:             # So we can't rely on getattr() on the type for them, we have to
+
 446:             # look through the MRO dicts ourself.
+
+447:             if name not in self._local_type_get_descriptors:
+
    if (unlikely(__pyx_v_self->_local_type_get_descriptors == Py_None)) {
+      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
+      __PYX_ERR(0, 447, __pyx_L1_error)
+    }
+    __pyx_t_2 = (__Pyx_PySet_ContainsTF(__pyx_v_name, __pyx_v_self->_local_type_get_descriptors, Py_NE)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 447, __pyx_L1_error)
+    __pyx_t_1 = (__pyx_t_2 != 0);
+    if (__pyx_t_1) {
+/* … */
+    }
+
 448:                 # Not a descriptor, can't execute code. So all we need is
+
 449:                 # the return value of getattr() on our type.
+
+450:                 return getattr(self._local_type, name)
+
      __Pyx_XDECREF(__pyx_r);
+      __pyx_t_4 = ((PyObject *)__pyx_v_self->_local_type);
+      __Pyx_INCREF(__pyx_t_4);
+      __pyx_t_3 = __Pyx_GetAttr(__pyx_t_4, __pyx_v_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 450, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_3);
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __pyx_r = __pyx_t_3;
+      __pyx_t_3 = 0;
+      goto __pyx_L0;
+
 451: 
+
+452:             for base in self._local_type.mro():
+
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->_local_type), __pyx_n_s_mro); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 452, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    __pyx_t_8 = NULL;
+    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
+      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_4);
+      if (likely(__pyx_t_8)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
+        __Pyx_INCREF(__pyx_t_8);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_4, function);
+      }
+    }
+    __pyx_t_3 = (__pyx_t_8) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_8) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
+    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
+    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 452, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
+      __pyx_t_4 = __pyx_t_3; __Pyx_INCREF(__pyx_t_4); __pyx_t_9 = 0;
+      __pyx_t_10 = NULL;
+    } else {
+      __pyx_t_9 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 452, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_4);
+      __pyx_t_10 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 452, __pyx_L1_error)
+    }
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    for (;;) {
+      if (likely(!__pyx_t_10)) {
+        if (likely(PyList_CheckExact(__pyx_t_4))) {
+          if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_4)) break;
+          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+          __pyx_t_3 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_9); __Pyx_INCREF(__pyx_t_3); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 452, __pyx_L1_error)
+          #else
+          __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 452, __pyx_L1_error)
+          __Pyx_GOTREF(__pyx_t_3);
+          #endif
+        } else {
+          if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
+          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+          __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_9); __Pyx_INCREF(__pyx_t_3); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 452, __pyx_L1_error)
+          #else
+          __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 452, __pyx_L1_error)
+          __Pyx_GOTREF(__pyx_t_3);
+          #endif
+        }
+      } else {
+        __pyx_t_3 = __pyx_t_10(__pyx_t_4);
+        if (unlikely(!__pyx_t_3)) {
+          PyObject* exc_type = PyErr_Occurred();
+          if (exc_type) {
+            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+            else __PYX_ERR(0, 452, __pyx_L1_error)
+          }
+          break;
+        }
+        __Pyx_GOTREF(__pyx_t_3);
+      }
+      __Pyx_XDECREF_SET(__pyx_v_base, __pyx_t_3);
+      __pyx_t_3 = 0;
+/* … */
+    }
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+
+453:                 bd = base.__dict__
+
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_dict); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 453, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_3);
+      __Pyx_XDECREF_SET(__pyx_v_bd, __pyx_t_3);
+      __pyx_t_3 = 0;
+
+454:                 if name in bd:
+
      __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_v_name, __pyx_v_bd, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 454, __pyx_L1_error)
+      __pyx_t_2 = (__pyx_t_1 != 0);
+      if (__pyx_t_2) {
+/* … */
+      }
+
+455:                     attr_on_type = bd[name]
+
        __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_bd, __pyx_v_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 455, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_3);
+        __pyx_v_attr_on_type = __pyx_t_3;
+        __pyx_t_3 = 0;
+
+456:                     result = type(attr_on_type).__get__(attr_on_type, self, self._local_type)
+
        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)Py_TYPE(__pyx_v_attr_on_type)), __pyx_n_s_get); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 456, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_8);
+        __pyx_t_7 = NULL;
+        __pyx_t_6 = 0;
+        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
+          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_8);
+          if (likely(__pyx_t_7)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
+            __Pyx_INCREF(__pyx_t_7);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_8, function);
+            __pyx_t_6 = 1;
+          }
+        }
+        #if CYTHON_FAST_PYCALL
+        if (PyFunction_Check(__pyx_t_8)) {
+          PyObject *__pyx_temp[4] = {__pyx_t_7, __pyx_v_attr_on_type, ((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_self->_local_type)};
+          __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 456, __pyx_L1_error)
+          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+          __Pyx_GOTREF(__pyx_t_3);
+        } else
+        #endif
+        #if CYTHON_FAST_PYCCALL
+        if (__Pyx_PyFastCFunction_Check(__pyx_t_8)) {
+          PyObject *__pyx_temp[4] = {__pyx_t_7, __pyx_v_attr_on_type, ((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_self->_local_type)};
+          __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 456, __pyx_L1_error)
+          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+          __Pyx_GOTREF(__pyx_t_3);
+        } else
+        #endif
+        {
+          __pyx_t_5 = PyTuple_New(3+__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 456, __pyx_L1_error)
+          __Pyx_GOTREF(__pyx_t_5);
+          if (__pyx_t_7) {
+            __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7); __pyx_t_7 = NULL;
+          }
+          __Pyx_INCREF(__pyx_v_attr_on_type);
+          __Pyx_GIVEREF(__pyx_v_attr_on_type);
+          PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_6, __pyx_v_attr_on_type);
+          __Pyx_INCREF(((PyObject *)__pyx_v_self));
+          __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
+          PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_6, ((PyObject *)__pyx_v_self));
+          __Pyx_INCREF(((PyObject *)__pyx_v_self->_local_type));
+          __Pyx_GIVEREF(((PyObject *)__pyx_v_self->_local_type));
+          PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_6, ((PyObject *)__pyx_v_self->_local_type));
+          __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 456, __pyx_L1_error)
+          __Pyx_GOTREF(__pyx_t_3);
+          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+        }
+        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+        __pyx_v_result = __pyx_t_3;
+        __pyx_t_3 = 0;
+
+457:                     return result
+
        __Pyx_XDECREF(__pyx_r);
+        __Pyx_INCREF(__pyx_v_result);
+        __pyx_r = __pyx_v_result;
+        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+        goto __pyx_L0;
+
 458: 
+
 459:         # It wasn't in the dict and it wasn't in the type.
+
 460:         # So the next step is to invoke type(self)__getattr__, if it
+
 461:         # exists, otherwise raise an AttributeError.
+
 462:         # we will invoke type(self).__getattr__ or raise an attribute error.
+
+463:         if hasattr(self._local_type, '__getattr__'):
+
  __pyx_t_4 = ((PyObject *)__pyx_v_self->_local_type);
+  __Pyx_INCREF(__pyx_t_4);
+  __pyx_t_2 = __Pyx_HasAttr(__pyx_t_4, __pyx_n_s_getattr); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 463, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __pyx_t_1 = (__pyx_t_2 != 0);
+  if (__pyx_t_1) {
+/* … */
+  }
+
+464:             return self._local_type.__getattr__(self, name)
+
    __Pyx_XDECREF(__pyx_r);
+    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->_local_type), __pyx_n_s_getattr); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 464, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __pyx_t_8 = NULL;
+    __pyx_t_6 = 0;
+    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
+      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_3);
+      if (likely(__pyx_t_8)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+        __Pyx_INCREF(__pyx_t_8);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_3, function);
+        __pyx_t_6 = 1;
+      }
+    }
+    #if CYTHON_FAST_PYCALL
+    if (PyFunction_Check(__pyx_t_3)) {
+      PyObject *__pyx_temp[3] = {__pyx_t_8, ((PyObject *)__pyx_v_self), __pyx_v_name};
+      __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 464, __pyx_L1_error)
+      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
+      __Pyx_GOTREF(__pyx_t_4);
+    } else
+    #endif
+    #if CYTHON_FAST_PYCCALL
+    if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
+      PyObject *__pyx_temp[3] = {__pyx_t_8, ((PyObject *)__pyx_v_self), __pyx_v_name};
+      __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 464, __pyx_L1_error)
+      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
+      __Pyx_GOTREF(__pyx_t_4);
+    } else
+    #endif
+    {
+      __pyx_t_5 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 464, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_5);
+      if (__pyx_t_8) {
+        __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_8); __pyx_t_8 = NULL;
+      }
+      __Pyx_INCREF(((PyObject *)__pyx_v_self));
+      __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
+      PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_6, ((PyObject *)__pyx_v_self));
+      __Pyx_INCREF(__pyx_v_name);
+      __Pyx_GIVEREF(__pyx_v_name);
+      PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_6, __pyx_v_name);
+      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 464, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_4);
+      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    }
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __pyx_r = __pyx_t_4;
+    __pyx_t_4 = 0;
+    goto __pyx_L0;
+
+465:         raise AttributeError("%r object has no attribute '%s'"
+
  __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_AttributeError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 465, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __PYX_ERR(0, 465, __pyx_L1_error)
+
+466:                              % (self._local_type.__name__, name))
+
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->_local_type), __pyx_n_s_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 466, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_4);
+  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 466, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_GIVEREF(__pyx_t_4);
+  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
+  __Pyx_INCREF(__pyx_v_name);
+  __Pyx_GIVEREF(__pyx_v_name);
+  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_name);
+  __pyx_t_4 = 0;
+  __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_r_object_has_no_attribute_s, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 466, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_4);
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+
 467: 
+
+468:     def __setattr__(self, name, value):
+
/* Python wrapper */
+static int __pyx_pw_6gevent_6_local_5local_5__setattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_value); /*proto*/
+static int __pyx_pw_6gevent_6_local_5local_5__setattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_value) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__setattr__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_6_local_5local_4__setattr__(((struct __pyx_obj_6gevent_6_local_local *)__pyx_v_self), ((PyObject *)__pyx_v_name), ((PyObject *)__pyx_v_value));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_6_local_5local_4__setattr__(struct __pyx_obj_6gevent_6_local_local *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_value) {
+  PyObject *__pyx_v_dct = NULL;
+  PyObject *__pyx_v_type_attr = NULL;
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__setattr__", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = 0;
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_XDECREF(__pyx_t_7);
+  __Pyx_AddTraceback("gevent._local.local.__setattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = -1;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_dct);
+  __Pyx_XDECREF(__pyx_v_type_attr);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+469:         if name == '__dict__':
+
  __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_name, __pyx_n_s_dict, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 469, __pyx_L1_error)
+  if (unlikely(__pyx_t_1)) {
+/* … */
+  }
+
+470:             raise AttributeError(
+
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_AttributeError, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 470, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __PYX_ERR(0, 470, __pyx_L1_error)
+
 471:                 "%r object attribute '__dict__' is read-only"
+
+472:                 % type(self))
+
    __pyx_t_2 = __Pyx_PyString_FormatSafe(__pyx_kp_s_r_object_attribute___dict___is, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 472, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+
 473: 
+
+474:         if name in _local_attrs:
+
  if (unlikely(__pyx_v_6gevent_6_local__local_attrs == Py_None)) {
+    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
+    __PYX_ERR(0, 474, __pyx_L1_error)
+  }
+  __pyx_t_1 = (__Pyx_PySet_ContainsTF(__pyx_v_name, __pyx_v_6gevent_6_local__local_attrs, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 474, __pyx_L1_error)
+  __pyx_t_4 = (__pyx_t_1 != 0);
+  if (__pyx_t_4) {
+/* … */
+  }
+
+475:             object.__setattr__(self, name, value)
+
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_builtin_object, __pyx_n_s_setattr); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 475, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_5 = NULL;
+    __pyx_t_6 = 0;
+    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
+      if (likely(__pyx_t_5)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+        __Pyx_INCREF(__pyx_t_5);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_2, function);
+        __pyx_t_6 = 1;
+      }
+    }
+    #if CYTHON_FAST_PYCALL
+    if (PyFunction_Check(__pyx_t_2)) {
+      PyObject *__pyx_temp[4] = {__pyx_t_5, ((PyObject *)__pyx_v_self), __pyx_v_name, __pyx_v_value};
+      __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 475, __pyx_L1_error)
+      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+      __Pyx_GOTREF(__pyx_t_3);
+    } else
+    #endif
+    #if CYTHON_FAST_PYCCALL
+    if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
+      PyObject *__pyx_temp[4] = {__pyx_t_5, ((PyObject *)__pyx_v_self), __pyx_v_name, __pyx_v_value};
+      __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 475, __pyx_L1_error)
+      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+      __Pyx_GOTREF(__pyx_t_3);
+    } else
+    #endif
+    {
+      __pyx_t_7 = PyTuple_New(3+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 475, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_7);
+      if (__pyx_t_5) {
+        __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
+      }
+      __Pyx_INCREF(((PyObject *)__pyx_v_self));
+      __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
+      PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, ((PyObject *)__pyx_v_self));
+      __Pyx_INCREF(__pyx_v_name);
+      __Pyx_GIVEREF(__pyx_v_name);
+      PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_name);
+      __Pyx_INCREF(__pyx_v_value);
+      __Pyx_GIVEREF(__pyx_v_value);
+      PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_6, __pyx_v_value);
+      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 475, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_3);
+      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+    }
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+
+476:             return
+
    __pyx_r = 0;
+    goto __pyx_L0;
+
 477: 
+
+478:         dct = _local_get_dict(self)
+
  __pyx_t_3 = __pyx_f_6gevent_6_local__local_get_dict(__pyx_v_self); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 478, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __pyx_v_dct = ((PyObject*)__pyx_t_3);
+  __pyx_t_3 = 0;
+
 479: 
+
+480:         if self._local_type is local:
+
  __pyx_t_4 = (__pyx_v_self->_local_type == __pyx_ptype_6gevent_6_local_local);
+  __pyx_t_1 = (__pyx_t_4 != 0);
+  if (__pyx_t_1) {
+/* … */
+  }
+
 481:             # Optimization: If we're not subclassed, we can't
+
 482:             # have data descriptors, so this goes right in the dict.
+
+483:             dct[name] = value
+
    if (unlikely(__pyx_v_dct == Py_None)) {
+      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
+      __PYX_ERR(0, 483, __pyx_L1_error)
+    }
+    if (unlikely(PyDict_SetItem(__pyx_v_dct, __pyx_v_name, __pyx_v_value) < 0)) __PYX_ERR(0, 483, __pyx_L1_error)
+
+484:             return
+
    __pyx_r = 0;
+    goto __pyx_L0;
+
 485: 
+
+486:         if name in self._local_type_vars:
+
  if (unlikely(__pyx_v_self->_local_type_vars == Py_None)) {
+    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
+    __PYX_ERR(0, 486, __pyx_L1_error)
+  }
+  __pyx_t_1 = (__Pyx_PySet_ContainsTF(__pyx_v_name, __pyx_v_self->_local_type_vars, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 486, __pyx_L1_error)
+  __pyx_t_4 = (__pyx_t_1 != 0);
+  if (__pyx_t_4) {
+/* … */
+  }
+
+487:             if name in self._local_type_set_descriptors:
+
    if (unlikely(__pyx_v_self->_local_type_set_descriptors == Py_None)) {
+      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
+      __PYX_ERR(0, 487, __pyx_L1_error)
+    }
+    __pyx_t_4 = (__Pyx_PySet_ContainsTF(__pyx_v_name, __pyx_v_self->_local_type_set_descriptors, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 487, __pyx_L1_error)
+    __pyx_t_1 = (__pyx_t_4 != 0);
+    if (__pyx_t_1) {
+/* … */
+    }
+
+488:                 type_attr = getattr(self._local_type, name, _marker)
+
      __pyx_t_3 = ((PyObject *)__pyx_v_self->_local_type);
+      __Pyx_INCREF(__pyx_t_3);
+      __pyx_t_2 = __pyx_v_6gevent_6_local__marker;
+      __Pyx_INCREF(__pyx_t_2);
+      __pyx_t_7 = __Pyx_GetAttr3(__pyx_t_3, __pyx_v_name, __pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 488, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_7);
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+      __pyx_v_type_attr = __pyx_t_7;
+      __pyx_t_7 = 0;
+
 489:                 # A data descriptor, like a property or a slot.
+
+490:                 type(type_attr).__set__(type_attr, self, value)
+
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)Py_TYPE(__pyx_v_type_attr)), __pyx_n_s_set); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 490, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_2);
+      __pyx_t_3 = NULL;
+      __pyx_t_6 = 0;
+      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+        if (likely(__pyx_t_3)) {
+          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+          __Pyx_INCREF(__pyx_t_3);
+          __Pyx_INCREF(function);
+          __Pyx_DECREF_SET(__pyx_t_2, function);
+          __pyx_t_6 = 1;
+        }
+      }
+      #if CYTHON_FAST_PYCALL
+      if (PyFunction_Check(__pyx_t_2)) {
+        PyObject *__pyx_temp[4] = {__pyx_t_3, __pyx_v_type_attr, ((PyObject *)__pyx_v_self), __pyx_v_value};
+        __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 490, __pyx_L1_error)
+        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __Pyx_GOTREF(__pyx_t_7);
+      } else
+      #endif
+      #if CYTHON_FAST_PYCCALL
+      if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
+        PyObject *__pyx_temp[4] = {__pyx_t_3, __pyx_v_type_attr, ((PyObject *)__pyx_v_self), __pyx_v_value};
+        __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 490, __pyx_L1_error)
+        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __Pyx_GOTREF(__pyx_t_7);
+      } else
+      #endif
+      {
+        __pyx_t_5 = PyTuple_New(3+__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 490, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_5);
+        if (__pyx_t_3) {
+          __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
+        }
+        __Pyx_INCREF(__pyx_v_type_attr);
+        __Pyx_GIVEREF(__pyx_v_type_attr);
+        PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_6, __pyx_v_type_attr);
+        __Pyx_INCREF(((PyObject *)__pyx_v_self));
+        __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
+        PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_6, ((PyObject *)__pyx_v_self));
+        __Pyx_INCREF(__pyx_v_value);
+        __Pyx_GIVEREF(__pyx_v_value);
+        PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_6, __pyx_v_value);
+        __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 490, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_7);
+        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+      }
+      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+
+491:                 return
+
      __pyx_r = 0;
+      goto __pyx_L0;
+
 492:         # Otherwise it goes directly in the dict
+
+493:         dct[name] = value
+
  if (unlikely(__pyx_v_dct == Py_None)) {
+    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
+    __PYX_ERR(0, 493, __pyx_L1_error)
+  }
+  if (unlikely(PyDict_SetItem(__pyx_v_dct, __pyx_v_name, __pyx_v_value) < 0)) __PYX_ERR(0, 493, __pyx_L1_error)
+
 494: 
+
+495:     def __delattr__(self, name):
+
/* Python wrapper */
+static int __pyx_pw_6gevent_6_local_5local_7__delattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_name); /*proto*/
+static int __pyx_pw_6gevent_6_local_5local_7__delattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_name) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__delattr__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_6_local_5local_6__delattr__(((struct __pyx_obj_6gevent_6_local_local *)__pyx_v_self), ((PyObject *)__pyx_v_name));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_6_local_5local_6__delattr__(struct __pyx_obj_6gevent_6_local_local *__pyx_v_self, PyObject *__pyx_v_name) {
+  PyObject *__pyx_v_type_attr = NULL;
+  PyObject *__pyx_v_dct = NULL;
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__delattr__", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = 0;
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_XDECREF(__pyx_t_7);
+  __Pyx_AddTraceback("gevent._local.local.__delattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = -1;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_type_attr);
+  __Pyx_XDECREF(__pyx_v_dct);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+496:         if name == '__dict__':
+
  __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_name, __pyx_n_s_dict, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 496, __pyx_L1_error)
+  if (unlikely(__pyx_t_1)) {
+/* … */
+  }
+
+497:             raise AttributeError(
+
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_AttributeError, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 497, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __PYX_ERR(0, 497, __pyx_L1_error)
+
 498:                 "%r object attribute '__dict__' is read-only"
+
+499:                 % self.__class__.__name__)
+
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 499, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 499, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __pyx_t_2 = __Pyx_PyString_FormatSafe(__pyx_kp_s_r_object_attribute___dict___is, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 499, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+
 500: 
+
+501:         if name in self._local_type_vars:
+
  if (unlikely(__pyx_v_self->_local_type_vars == Py_None)) {
+    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
+    __PYX_ERR(0, 501, __pyx_L1_error)
+  }
+  __pyx_t_1 = (__Pyx_PySet_ContainsTF(__pyx_v_name, __pyx_v_self->_local_type_vars, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 501, __pyx_L1_error)
+  __pyx_t_4 = (__pyx_t_1 != 0);
+  if (__pyx_t_4) {
+/* … */
+  }
+
+502:             if name in self._local_type_del_descriptors:
+
    if (unlikely(__pyx_v_self->_local_type_del_descriptors == Py_None)) {
+      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
+      __PYX_ERR(0, 502, __pyx_L1_error)
+    }
+    __pyx_t_4 = (__Pyx_PySet_ContainsTF(__pyx_v_name, __pyx_v_self->_local_type_del_descriptors, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 502, __pyx_L1_error)
+    __pyx_t_1 = (__pyx_t_4 != 0);
+    if (__pyx_t_1) {
+/* … */
+    }
+
 503:                 # A data descriptor, like a property or a slot.
+
+504:                 type_attr = getattr(self._local_type, name, _marker)
+
      __pyx_t_3 = ((PyObject *)__pyx_v_self->_local_type);
+      __Pyx_INCREF(__pyx_t_3);
+      __pyx_t_2 = __pyx_v_6gevent_6_local__marker;
+      __Pyx_INCREF(__pyx_t_2);
+      __pyx_t_5 = __Pyx_GetAttr3(__pyx_t_3, __pyx_v_name, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 504, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_5);
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+      __pyx_v_type_attr = __pyx_t_5;
+      __pyx_t_5 = 0;
+
+505:                 type(type_attr).__delete__(type_attr, self)
+
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)Py_TYPE(__pyx_v_type_attr)), __pyx_n_s_delete); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 505, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_2);
+      __pyx_t_3 = NULL;
+      __pyx_t_6 = 0;
+      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+        if (likely(__pyx_t_3)) {
+          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+          __Pyx_INCREF(__pyx_t_3);
+          __Pyx_INCREF(function);
+          __Pyx_DECREF_SET(__pyx_t_2, function);
+          __pyx_t_6 = 1;
+        }
+      }
+      #if CYTHON_FAST_PYCALL
+      if (PyFunction_Check(__pyx_t_2)) {
+        PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_type_attr, ((PyObject *)__pyx_v_self)};
+        __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 505, __pyx_L1_error)
+        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __Pyx_GOTREF(__pyx_t_5);
+      } else
+      #endif
+      #if CYTHON_FAST_PYCCALL
+      if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
+        PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_type_attr, ((PyObject *)__pyx_v_self)};
+        __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 505, __pyx_L1_error)
+        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __Pyx_GOTREF(__pyx_t_5);
+      } else
+      #endif
+      {
+        __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 505, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_7);
+        if (__pyx_t_3) {
+          __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3); __pyx_t_3 = NULL;
+        }
+        __Pyx_INCREF(__pyx_v_type_attr);
+        __Pyx_GIVEREF(__pyx_v_type_attr);
+        PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_v_type_attr);
+        __Pyx_INCREF(((PyObject *)__pyx_v_self));
+        __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
+        PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, ((PyObject *)__pyx_v_self));
+        __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 505, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_5);
+        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+      }
+      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+
+506:                 return
+
      __pyx_r = 0;
+      goto __pyx_L0;
+
 507:         # Otherwise it goes directly in the dict
+
 508: 
+
 509:         # Begin inlined function _get_dict()
+
+510:         dct = _local_get_dict(self)
+
  __pyx_t_5 = __pyx_f_6gevent_6_local__local_get_dict(__pyx_v_self); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 510, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_5);
+  __pyx_v_dct = ((PyObject*)__pyx_t_5);
+  __pyx_t_5 = 0;
+
 511: 
+
+512:         try:
+
  {
+    /*try:*/ {
+/* … */
+    }
+    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
+    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
+    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
+    goto __pyx_L11_try_end;
+    __pyx_L6_error:;
+    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+/* … */
+    __Pyx_XGIVEREF(__pyx_t_8);
+    __Pyx_XGIVEREF(__pyx_t_9);
+    __Pyx_XGIVEREF(__pyx_t_10);
+    __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
+    goto __pyx_L1_error;
+    __pyx_L11_try_end:;
+  }
+
+513:             del dct[name]
+
      if (unlikely(__pyx_v_dct == Py_None)) {
+        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
+        __PYX_ERR(0, 513, __pyx_L6_error)
+      }
+      if (unlikely(PyDict_DelItem(__pyx_v_dct, __pyx_v_name) < 0)) __PYX_ERR(0, 513, __pyx_L6_error)
+
+514:         except KeyError:
+
    __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
+    if (__pyx_t_6) {
+      __Pyx_AddTraceback("gevent._local.local.__delattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_2, &__pyx_t_7) < 0) __PYX_ERR(0, 514, __pyx_L8_except_error)
+      __Pyx_GOTREF(__pyx_t_5);
+      __Pyx_GOTREF(__pyx_t_2);
+      __Pyx_GOTREF(__pyx_t_7);
+
+515:             raise AttributeError(name)
+
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_AttributeError, __pyx_v_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 515, __pyx_L8_except_error)
+      __Pyx_GOTREF(__pyx_t_3);
+      __Pyx_Raise(__pyx_t_3, 0, 0, 0);
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __PYX_ERR(0, 515, __pyx_L8_except_error)
+    }
+    goto __pyx_L8_except_error;
+    __pyx_L8_except_error:;
+
 516: 
+
+517:     def __copy__(self):
+
static PyObject *__pyx_pw_6gevent_6_local_5local_9__copy__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static struct __pyx_obj_6gevent_6_local_local *__pyx_f_6gevent_6_local_5local___copy__(struct __pyx_obj_6gevent_6_local_local *__pyx_v_self, int __pyx_skip_dispatch) {
+  struct __pyx_obj_6gevent_6_local__localimpl_dict_entry *__pyx_v_entry = 0;
+  PyObject *__pyx_v_dct = 0;
+  PyObject *__pyx_v_duplicate = 0;
+  struct __pyx_obj_6gevent_6_local_local *__pyx_v_instance = 0;
+  struct __pyx_obj_6gevent_6_local__localimpl *__pyx_v_impl = NULL;
+  PyTypeObject *__pyx_v_cls = NULL;
+  struct __pyx_obj_6gevent_6_local_local *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__copy__", 0);
+  /* Check if called by wrapper */
+  if (unlikely(__pyx_skip_dispatch)) ;
+  /* Check if overridden in Python */
+  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
+    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
+    if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
+    else {
+      PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      #endif
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_copy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 517, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_6_local_5local_9__copy__)) {
+        __Pyx_XDECREF(((PyObject *)__pyx_r));
+        __Pyx_INCREF(__pyx_t_1);
+        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+          if (likely(__pyx_t_4)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+            __Pyx_INCREF(__pyx_t_4);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_3, function);
+          }
+        }
+        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
+        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 517, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_6gevent_6_local_local))))) __PYX_ERR(0, 517, __pyx_L1_error)
+        __pyx_r = ((struct __pyx_obj_6gevent_6_local_local *)__pyx_t_2);
+        __pyx_t_2 = 0;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        goto __pyx_L0;
+      }
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+      tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
+      if (unlikely(type_dict_guard != tp_dict_version)) {
+        tp_dict_version = obj_dict_version = 0;
+      }
+      #endif
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    }
+    #endif
+  }
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_AddTraceback("gevent._local.local.__copy__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XDECREF((PyObject *)__pyx_v_entry);
+  __Pyx_XDECREF(__pyx_v_dct);
+  __Pyx_XDECREF(__pyx_v_duplicate);
+  __Pyx_XDECREF((PyObject *)__pyx_v_instance);
+  __Pyx_XDECREF((PyObject *)__pyx_v_impl);
+  __Pyx_XDECREF(__pyx_v_cls);
+  __Pyx_XGIVEREF((PyObject *)__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_local_5local_9__copy__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6gevent_6_local_5local_8__copy__[] = "local.__copy__(self) -> local";
+static PyMethodDef __pyx_mdef_6gevent_6_local_5local_9__copy__ = {"__copy__", (PyCFunction)__pyx_pw_6gevent_6_local_5local_9__copy__, METH_NOARGS, __pyx_doc_6gevent_6_local_5local_8__copy__};
+static PyObject *__pyx_pw_6gevent_6_local_5local_9__copy__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__copy__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_6_local_5local_8__copy__(((struct __pyx_obj_6gevent_6_local_local *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_local_5local_8__copy__(struct __pyx_obj_6gevent_6_local_local *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__copy__", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = ((PyObject *)__pyx_f_6gevent_6_local_5local___copy__(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 517, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent._local.local.__copy__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__8 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 517, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__8);
+  __Pyx_GIVEREF(__pyx_tuple__8);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_local_5local_9__copy__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_local___copy, NULL, __pyx_n_s_gevent__local, __pyx_d, ((PyObject *)__pyx_codeobj__9)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 517, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_local_local->tp_dict, __pyx_n_s_copy, __pyx_t_2) < 0) __PYX_ERR(0, 517, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_6_local_local);
+  __pyx_codeobj__9 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__8, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_local_py, __pyx_n_s_copy, 517, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__9)) __PYX_ERR(0, 517, __pyx_L1_error)
+
+518:         impl = self._local__impl
+
  __pyx_t_1 = ((PyObject *)__pyx_v_self->_local__impl);
+  __Pyx_INCREF(__pyx_t_1);
+  __pyx_v_impl = ((struct __pyx_obj_6gevent_6_local__localimpl *)__pyx_t_1);
+  __pyx_t_1 = 0;
+
+519:         entry = impl.dicts[id(getcurrent())]  # pylint:disable=undefined-variable
+
  if (unlikely(__pyx_v_impl->dicts == Py_None)) {
+    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
+    __PYX_ERR(0, 519, __pyx_L1_error)
+  }
+  __pyx_t_1 = ((PyObject *)__pyx_f_6gevent_6_local_getcurrent()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 519, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 519, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_impl->dicts, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 519, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_6gevent_6_local__localimpl_dict_entry))))) __PYX_ERR(0, 519, __pyx_L1_error)
+  __pyx_v_entry = ((struct __pyx_obj_6gevent_6_local__localimpl_dict_entry *)__pyx_t_1);
+  __pyx_t_1 = 0;
+
 520: 
+
+521:         dct = entry.localdict
+
  __pyx_t_1 = __pyx_v_entry->localdict;
+  __Pyx_INCREF(__pyx_t_1);
+  __pyx_v_dct = ((PyObject*)__pyx_t_1);
+  __pyx_t_1 = 0;
+
+522:         duplicate = copy(dct)
+
  __Pyx_INCREF(__pyx_v_6gevent_6_local_copy);
+  __pyx_t_2 = __pyx_v_6gevent_6_local_copy; __pyx_t_3 = NULL;
+  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
+    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+    if (likely(__pyx_t_3)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+      __Pyx_INCREF(__pyx_t_3);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_2, function);
+    }
+  }
+  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_dct) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_dct);
+  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 522, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  if (!(likely(PyDict_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 522, __pyx_L1_error)
+  __pyx_v_duplicate = ((PyObject*)__pyx_t_1);
+  __pyx_t_1 = 0;
+
 523: 
+
+524:         cls = type(self)
+
  __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
+  __pyx_v_cls = ((PyTypeObject*)((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
+
+525:         instance = cls(*impl.localargs, **impl.localkwargs)
+
  if (unlikely(__pyx_v_impl->localargs == Py_None)) {
+    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
+    __PYX_ERR(0, 525, __pyx_L1_error)
+  }
+  if (unlikely(__pyx_v_impl->localkwargs == Py_None)) {
+    PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType");
+    __PYX_ERR(0, 525, __pyx_L1_error)
+  }
+  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_v_cls), __pyx_v_impl->localargs, __pyx_v_impl->localkwargs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 525, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_6gevent_6_local_local))))) __PYX_ERR(0, 525, __pyx_L1_error)
+  __pyx_v_instance = ((struct __pyx_obj_6gevent_6_local_local *)__pyx_t_1);
+  __pyx_t_1 = 0;
+
+526:         _local__copy_dict_from(instance, impl, duplicate)
+
  __pyx_t_1 = __pyx_f_6gevent_6_local__local__copy_dict_from(__pyx_v_instance, __pyx_v_impl, __pyx_v_duplicate); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 526, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+527:         return instance
+
  __Pyx_XDECREF(((PyObject *)__pyx_r));
+  __Pyx_INCREF(((PyObject *)__pyx_v_instance));
+  __pyx_r = __pyx_v_instance;
+  goto __pyx_L0;
+
 528: 
+
+529: def _local__copy_dict_from(self, impl, duplicate):
+
static PyObject *__pyx_f_6gevent_6_local__local__copy_dict_from(struct __pyx_obj_6gevent_6_local_local *__pyx_v_self, struct __pyx_obj_6gevent_6_local__localimpl *__pyx_v_impl, PyObject *__pyx_v_duplicate) {
+  struct __pyx_obj_6gevent_6_local__localimpl_dict_entry *__pyx_v_entry = 0;
+  PyGreenlet *__pyx_v_current = NULL;
+  PyObject *__pyx_v_currentId = NULL;
+  struct __pyx_obj_6gevent_6_local__localimpl *__pyx_v_new_impl = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_local__copy_dict_from", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_AddTraceback("gevent._local._local__copy_dict_from", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XDECREF((PyObject *)__pyx_v_entry);
+  __Pyx_XDECREF((PyObject *)__pyx_v_current);
+  __Pyx_XDECREF(__pyx_v_currentId);
+  __Pyx_XDECREF((PyObject *)__pyx_v_new_impl);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+530:     current = getcurrent() # pylint:disable=undefined-variable
+
  __pyx_t_1 = ((PyObject *)__pyx_f_6gevent_6_local_getcurrent()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 530, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_v_current = ((PyGreenlet *)__pyx_t_1);
+  __pyx_t_1 = 0;
+
+531:     currentId = id(current)
+
  __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_current)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 531, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_v_currentId = __pyx_t_1;
+  __pyx_t_1 = 0;
+
+532:     new_impl = self._local__impl
+
  __pyx_t_1 = ((PyObject *)__pyx_v_self->_local__impl);
+  __Pyx_INCREF(__pyx_t_1);
+  __pyx_v_new_impl = ((struct __pyx_obj_6gevent_6_local__localimpl *)__pyx_t_1);
+  __pyx_t_1 = 0;
+
+533:     assert new_impl is not impl
+
  #ifndef CYTHON_WITHOUT_ASSERTIONS
+  if (unlikely(!Py_OptimizeFlag)) {
+    __pyx_t_2 = (__pyx_v_new_impl != __pyx_v_impl);
+    if (unlikely(!(__pyx_t_2 != 0))) {
+      PyErr_SetNone(PyExc_AssertionError);
+      __PYX_ERR(0, 533, __pyx_L1_error)
+    }
+  }
+  #endif
+
+534:     entry = new_impl.dicts[currentId]
+
  if (unlikely(__pyx_v_new_impl->dicts == Py_None)) {
+    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
+    __PYX_ERR(0, 534, __pyx_L1_error)
+  }
+  __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_new_impl->dicts, __pyx_v_currentId); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 534, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_6gevent_6_local__localimpl_dict_entry))))) __PYX_ERR(0, 534, __pyx_L1_error)
+  __pyx_v_entry = ((struct __pyx_obj_6gevent_6_local__localimpl_dict_entry *)__pyx_t_1);
+  __pyx_t_1 = 0;
+
+535:     new_impl.dicts[currentId] = _localimpl_dict_entry(entry.wrgreenlet, duplicate)
+
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 535, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(__pyx_v_entry->wrgreenlet);
+  __Pyx_GIVEREF(__pyx_v_entry->wrgreenlet);
+  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_entry->wrgreenlet);
+  __Pyx_INCREF(__pyx_v_duplicate);
+  __Pyx_GIVEREF(__pyx_v_duplicate);
+  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_duplicate);
+  __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6gevent_6_local__localimpl_dict_entry), __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 535, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  if (unlikely(__pyx_v_new_impl->dicts == Py_None)) {
+    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
+    __PYX_ERR(0, 535, __pyx_L1_error)
+  }
+  if (unlikely(PyDict_SetItem(__pyx_v_new_impl->dicts, __pyx_v_currentId, __pyx_t_3) < 0)) __PYX_ERR(0, 535, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+
 536: 
+
+537: def _local_find_descriptors(self):
+
static PyObject *__pyx_f_6gevent_6_local__local_find_descriptors(struct __pyx_obj_6gevent_6_local_local *__pyx_v_self) {
+  PyObject *__pyx_v_mro = 0;
+  PyObject *__pyx_v_gets = 0;
+  PyObject *__pyx_v_dels = 0;
+  PyObject *__pyx_v_set_or_del = 0;
+  PyTypeObject *__pyx_v_type_self = 0;
+  PyTypeObject *__pyx_v_type_attr = 0;
+  PyObject *__pyx_v_sets = 0;
+  PyObject *__pyx_v_attr_name = NULL;
+  PyObject *__pyx_v_base = NULL;
+  PyObject *__pyx_v_bd = NULL;
+  PyObject *__pyx_v_attr = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_local_find_descriptors", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_AddTraceback("gevent._local._local_find_descriptors", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_mro);
+  __Pyx_XDECREF(__pyx_v_gets);
+  __Pyx_XDECREF(__pyx_v_dels);
+  __Pyx_XDECREF(__pyx_v_set_or_del);
+  __Pyx_XDECREF(__pyx_v_type_self);
+  __Pyx_XDECREF(__pyx_v_type_attr);
+  __Pyx_XDECREF(__pyx_v_sets);
+  __Pyx_XDECREF(__pyx_v_attr_name);
+  __Pyx_XDECREF(__pyx_v_base);
+  __Pyx_XDECREF(__pyx_v_bd);
+  __Pyx_XDECREF(__pyx_v_attr);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+538:     type_self = type(self)
+
  __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
+  __pyx_v_type_self = ((PyTypeObject*)((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
+
+539:     gets = set()
+
  __pyx_t_1 = PySet_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 539, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_v_gets = ((PyObject*)__pyx_t_1);
+  __pyx_t_1 = 0;
+
+540:     dels = set()
+
  __pyx_t_1 = PySet_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 540, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_v_dels = ((PyObject*)__pyx_t_1);
+  __pyx_t_1 = 0;
+
+541:     set_or_del = set()
+
  __pyx_t_1 = PySet_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 541, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_v_set_or_del = ((PyObject*)__pyx_t_1);
+  __pyx_t_1 = 0;
+
+542:     sets = set()
+
  __pyx_t_1 = PySet_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 542, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_v_sets = ((PyObject*)__pyx_t_1);
+  __pyx_t_1 = 0;
+
+543:     mro = list(type_self.mro())
+
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_type_self), __pyx_n_s_mro); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 543, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = NULL;
+  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+    if (likely(__pyx_t_3)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+      __Pyx_INCREF(__pyx_t_3);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_2, function);
+    }
+  }
+  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 543, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_2 = PySequence_List(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 543, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_v_mro = ((PyObject*)__pyx_t_2);
+  __pyx_t_2 = 0;
+
 544: 
+
+545:     for attr_name in dir(type_self):
+
  __pyx_t_2 = PyObject_Dir(((PyObject *)__pyx_v_type_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 545, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
+    __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1); __pyx_t_4 = 0;
+    __pyx_t_5 = NULL;
+  } else {
+    __pyx_t_4 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 545, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __pyx_t_5 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 545, __pyx_L1_error)
+  }
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  for (;;) {
+    if (likely(!__pyx_t_5)) {
+      if (likely(PyList_CheckExact(__pyx_t_1))) {
+        if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_1)) break;
+        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+        __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 545, __pyx_L1_error)
+        #else
+        __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 545, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        #endif
+      } else {
+        if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
+        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+        __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 545, __pyx_L1_error)
+        #else
+        __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 545, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        #endif
+      }
+    } else {
+      __pyx_t_2 = __pyx_t_5(__pyx_t_1);
+      if (unlikely(!__pyx_t_2)) {
+        PyObject* exc_type = PyErr_Occurred();
+        if (exc_type) {
+          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+          else __PYX_ERR(0, 545, __pyx_L1_error)
+        }
+        break;
+      }
+      __Pyx_GOTREF(__pyx_t_2);
+    }
+    __Pyx_XDECREF_SET(__pyx_v_attr_name, __pyx_t_2);
+    __pyx_t_2 = 0;
+/* … */
+  }
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 546:         # Conventionally, descriptors when called on a class
+
 547:         # return themself, but not all do. Notable exceptions are
+
 548:         # in the zope.interface package, where things like __provides__
+
 549:         # return other class attributes. So we can't use getattr, and instead
+
 550:         # walk up the dicts
+
+551:         for base in mro:
+
    __pyx_t_2 = __pyx_v_mro; __Pyx_INCREF(__pyx_t_2); __pyx_t_6 = 0;
+    for (;;) {
+      if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_2)) break;
+      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+      __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_3); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 551, __pyx_L1_error)
+      #else
+      __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 551, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_3);
+      #endif
+      __Pyx_XDECREF_SET(__pyx_v_base, __pyx_t_3);
+      __pyx_t_3 = 0;
+/* … */
+    }
+    /*else*/ {
+/* … */
+    __pyx_L6_break:;
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+552:             bd = base.__dict__
+
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_dict); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 552, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_3);
+      __Pyx_XDECREF_SET(__pyx_v_bd, __pyx_t_3);
+      __pyx_t_3 = 0;
+
+553:             if attr_name in bd:
+
      __pyx_t_7 = (__Pyx_PySequence_ContainsTF(__pyx_v_attr_name, __pyx_v_bd, Py_EQ)); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 553, __pyx_L1_error)
+      __pyx_t_8 = (__pyx_t_7 != 0);
+      if (__pyx_t_8) {
+/* … */
+      }
+
+554:                 attr = bd[attr_name]
+
        __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_bd, __pyx_v_attr_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 554, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_3);
+        __Pyx_XDECREF_SET(__pyx_v_attr, __pyx_t_3);
+        __pyx_t_3 = 0;
+
+555:                 break
+
        goto __pyx_L6_break;
+
 556:         else:
+
+557:             raise AttributeError(attr_name)
+
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_AttributeError, __pyx_v_attr_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 557, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_3);
+      __Pyx_Raise(__pyx_t_3, 0, 0, 0);
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __PYX_ERR(0, 557, __pyx_L1_error)
+    }
+
 558: 
+
+559:         type_attr = type(attr)
+
    __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_attr)));
+    __Pyx_XDECREF_SET(__pyx_v_type_attr, ((PyTypeObject*)((PyObject *)Py_TYPE(__pyx_v_attr))));
+
+560:         if hasattr(type_attr, '__get__'):
+
    __pyx_t_8 = __Pyx_HasAttr(((PyObject *)__pyx_v_type_attr), __pyx_n_s_get); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 560, __pyx_L1_error)
+    __pyx_t_7 = (__pyx_t_8 != 0);
+    if (__pyx_t_7) {
+/* … */
+    }
+
+561:             gets.add(attr_name)
+
      __pyx_t_9 = PySet_Add(__pyx_v_gets, __pyx_v_attr_name); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 561, __pyx_L1_error)
+
+562:         if hasattr(type_attr, '__delete__'):
+
    __pyx_t_7 = __Pyx_HasAttr(((PyObject *)__pyx_v_type_attr), __pyx_n_s_delete); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 562, __pyx_L1_error)
+    __pyx_t_8 = (__pyx_t_7 != 0);
+    if (__pyx_t_8) {
+/* … */
+    }
+
+563:             dels.add(attr_name)
+
      __pyx_t_9 = PySet_Add(__pyx_v_dels, __pyx_v_attr_name); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 563, __pyx_L1_error)
+
+564:             set_or_del.add(attr_name)
+
      __pyx_t_9 = PySet_Add(__pyx_v_set_or_del, __pyx_v_attr_name); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 564, __pyx_L1_error)
+
+565:         if hasattr(type_attr, '__set__'):
+
    __pyx_t_8 = __Pyx_HasAttr(((PyObject *)__pyx_v_type_attr), __pyx_n_s_set); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 565, __pyx_L1_error)
+    __pyx_t_7 = (__pyx_t_8 != 0);
+    if (__pyx_t_7) {
+/* … */
+    }
+
+566:             sets.add(attr_name)
+
      __pyx_t_9 = PySet_Add(__pyx_v_sets, __pyx_v_attr_name); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 566, __pyx_L1_error)
+
 567: 
+
+568:     return (gets, dels, set_or_del, sets)
+
  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 568, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(__pyx_v_gets);
+  __Pyx_GIVEREF(__pyx_v_gets);
+  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_gets);
+  __Pyx_INCREF(__pyx_v_dels);
+  __Pyx_GIVEREF(__pyx_v_dels);
+  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_dels);
+  __Pyx_INCREF(__pyx_v_set_or_del);
+  __Pyx_GIVEREF(__pyx_v_set_or_del);
+  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_set_or_del);
+  __Pyx_INCREF(__pyx_v_sets);
+  __Pyx_GIVEREF(__pyx_v_sets);
+  PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_v_sets);
+  __pyx_r = ((PyObject*)__pyx_t_1);
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
 569: 
+
 570: # Cython doesn't let us use __new__, it requires
+
 571: # __cinit__. But we need __new__ if we're not compiled
+
 572: # (e.g., on PyPy). So we set it at runtime. Cython
+
 573: # will raise an error if we're compiled.
+
+574: def __new__(cls, *args, **kw):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_local_3__new__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_6gevent_6_local_2__new__[] = "__new__(cls, *args, **kw)";
+static PyMethodDef __pyx_mdef_6gevent_6_local_3__new__ = {"__new__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_6_local_3__new__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_6_local_2__new__};
+static PyObject *__pyx_pw_6gevent_6_local_3__new__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_cls = 0;
+  PyObject *__pyx_v_args = 0;
+  PyObject *__pyx_v_kw = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__new__ (wrapper)", 0);
+  __pyx_v_kw = PyDict_New(); if (unlikely(!__pyx_v_kw)) return NULL;
+  __Pyx_GOTREF(__pyx_v_kw);
+  if (PyTuple_GET_SIZE(__pyx_args) > 1) {
+    __pyx_v_args = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args));
+    if (unlikely(!__pyx_v_args)) {
+      __Pyx_DECREF(__pyx_v_kw); __pyx_v_kw = 0;
+      __Pyx_RefNannyFinishContext();
+      return NULL;
+    }
+    __Pyx_GOTREF(__pyx_v_args);
+  } else {
+    __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple);
+  }
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_cls,0};
+    PyObject* values[1] = {0};
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        default:
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cls)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+      }
+      if (unlikely(kw_args > 0)) {
+        const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1;
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kw, values, used_pos_args, "__new__") < 0)) __PYX_ERR(0, 574, __pyx_L3_error)
+      }
+    } else if (PyTuple_GET_SIZE(__pyx_args) < 1) {
+      goto __pyx_L5_argtuple_error;
+    } else {
+      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+    }
+    __pyx_v_cls = values[0];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("__new__", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 574, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0;
+  __Pyx_DECREF(__pyx_v_kw); __pyx_v_kw = 0;
+  __Pyx_AddTraceback("gevent._local.__new__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_6_local_2__new__(__pyx_self, __pyx_v_cls, __pyx_v_args, __pyx_v_kw);
+
+  /* function exit code */
+  __Pyx_XDECREF(__pyx_v_args);
+  __Pyx_XDECREF(__pyx_v_kw);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_local_2__new__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_cls, PyObject *__pyx_v_args, PyObject *__pyx_v_kw) {
+  PyObject *__pyx_v_self = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__new__", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_AddTraceback("gevent._local.__new__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_self);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__10 = PyTuple_Pack(4, __pyx_n_s_cls, __pyx_n_s_args, __pyx_n_s_kw, __pyx_n_s_self); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 574, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__10);
+  __Pyx_GIVEREF(__pyx_tuple__10);
+/* … */
+  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_local_3__new__, 0, __pyx_n_s_new, NULL, __pyx_n_s_gevent__local, __pyx_d, ((PyObject *)__pyx_codeobj__11)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 574, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_new, __pyx_t_2) < 0) __PYX_ERR(0, 574, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+575:     self = super(local, cls).__new__(cls)
+
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 575, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(((PyObject *)__pyx_ptype_6gevent_6_local_local));
+  __Pyx_GIVEREF(((PyObject *)__pyx_ptype_6gevent_6_local_local));
+  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_ptype_6gevent_6_local_local));
+  __Pyx_INCREF(__pyx_v_cls);
+  __Pyx_GIVEREF(__pyx_v_cls);
+  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_cls);
+  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 575, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 575, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __pyx_t_3 = NULL;
+  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+    if (likely(__pyx_t_3)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+      __Pyx_INCREF(__pyx_t_3);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_2, function);
+    }
+  }
+  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_cls) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_cls);
+  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 575, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_v_self = __pyx_t_1;
+  __pyx_t_1 = 0;
+
 576:     # We get the cls in *args for some reason
+
 577:     # too when we do it this way....except on PyPy3, which does
+
 578:     # not *unless* it's wrapped in a classmethod (which it is)
+
+579:     self.__cinit__(*args[1:], **kw)
+
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cinit); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 579, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = __Pyx_PyTuple_GetSlice(__pyx_v_args, 1, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 579, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_v_kw); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 579, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+
+580:     return self
+
  __Pyx_XDECREF(__pyx_r);
+  __Pyx_INCREF(__pyx_v_self);
+  __pyx_r = __pyx_v_self;
+  goto __pyx_L0;
+
 581: 
+
+582: try:
+
  {
+    /*try:*/ {
+/* … */
+    }
+/* … */
+    __Pyx_XGIVEREF(__pyx_t_3);
+    __Pyx_XGIVEREF(__pyx_t_4);
+    __Pyx_XGIVEREF(__pyx_t_5);
+    __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
+    goto __pyx_L1_error;
+    __pyx_L3_exception_handled:;
+    __Pyx_XGIVEREF(__pyx_t_3);
+    __Pyx_XGIVEREF(__pyx_t_4);
+    __Pyx_XGIVEREF(__pyx_t_5);
+    __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
+    __pyx_L7_try_end:;
+  }
+
 583:     # PyPy2/3 and CPython handle adding a __new__ to the class
+
 584:     # in different ways. In CPython and PyPy3, it must be wrapped with classmethod;
+
 585:     # in PyPy2, it must not. In either case, the args that get passed to
+
 586:     # it are stil wrong.
+
+587:     local.__new__ = 'None'
+
      if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_ptype_6gevent_6_local_local), __pyx_n_s_new, __pyx_n_s_None) < 0) __PYX_ERR(0, 587, __pyx_L2_error)
+
+588: except TypeError: # pragma: no cover
+
    __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
+    if (__pyx_t_8) {
+      __Pyx_ErrRestore(0,0,0);
+      goto __pyx_L3_exception_handled;
+    }
+    goto __pyx_L4_except_error;
+    __pyx_L4_except_error:;
+
 589:     # Must be compiled
+
 590:     pass
+
 591: else:
+
+592:     from gevent._compat import PYPY
+
    /*else:*/ {
+      __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 592, __pyx_L4_except_error)
+      __Pyx_GOTREF(__pyx_t_2);
+      __Pyx_INCREF(__pyx_n_s_PYPY_2);
+      __Pyx_GIVEREF(__pyx_n_s_PYPY_2);
+      PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PYPY_2);
+      __pyx_t_1 = __Pyx_Import(__pyx_n_s_gevent__compat, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 592, __pyx_L4_except_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+      __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_PYPY_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 592, __pyx_L4_except_error)
+      __Pyx_GOTREF(__pyx_t_2);
+      if (PyDict_SetItem(__pyx_d, __pyx_n_s_PYPY_2, __pyx_t_2) < 0) __PYX_ERR(0, 592, __pyx_L4_except_error)
+      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+593:     from gevent._compat import PY2
+
      __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 593, __pyx_L4_except_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      __Pyx_INCREF(__pyx_n_s_PY2);
+      __Pyx_GIVEREF(__pyx_n_s_PY2);
+      PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_PY2);
+      __pyx_t_2 = __Pyx_Import(__pyx_n_s_gevent__compat, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 593, __pyx_L4_except_error)
+      __Pyx_GOTREF(__pyx_t_2);
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_PY2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 593, __pyx_L4_except_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      if (PyDict_SetItem(__pyx_d, __pyx_n_s_PY2, __pyx_t_1) < 0) __PYX_ERR(0, 593, __pyx_L4_except_error)
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+594:     if PYPY and PY2:
+
      __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_PYPY_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 594, __pyx_L4_except_error)
+      __Pyx_GOTREF(__pyx_t_2);
+      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 594, __pyx_L4_except_error)
+      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+      if (__pyx_t_7) {
+      } else {
+        __pyx_t_6 = __pyx_t_7;
+        goto __pyx_L9_bool_binop_done;
+      }
+      __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_PY2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 594, __pyx_L4_except_error)
+      __Pyx_GOTREF(__pyx_t_2);
+      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 594, __pyx_L4_except_error)
+      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+      __pyx_t_6 = __pyx_t_7;
+      __pyx_L9_bool_binop_done:;
+      if (__pyx_t_6) {
+/* … */
+        goto __pyx_L8;
+      }
+
+595:         local.__new__ = __new__
+
        __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 595, __pyx_L4_except_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_ptype_6gevent_6_local_local), __pyx_n_s_new, __pyx_t_2) < 0) __PYX_ERR(0, 595, __pyx_L4_except_error)
+        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
 596:     else:
+
+597:         local.__new__ = classmethod(__new__)
+
      /*else*/ {
+        __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 597, __pyx_L4_except_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_classmethod, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 597, __pyx_L4_except_error)
+        __Pyx_GOTREF(__pyx_t_1);
+        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+        if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_ptype_6gevent_6_local_local), __pyx_n_s_new, __pyx_t_1) < 0) __PYX_ERR(0, 597, __pyx_L4_except_error)
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      }
+      __pyx_L8:;
+
 598: 
+
+599:     del PYPY
+
      if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_PYPY_2) < 0) __PYX_ERR(0, 599, __pyx_L4_except_error)
+
+600:     del PY2
+
      if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_PY2) < 0) __PYX_ERR(0, 600, __pyx_L4_except_error)
+    }
+    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+    goto __pyx_L7_try_end;
+    __pyx_L2_error:;
+    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+
 601: 
+
+602: _init()
+
  __pyx_f_6gevent_6_local__init();
+
 603: 
+
+604: from gevent._util import import_c_accel
+
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 604, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(__pyx_n_s_import_c_accel);
+  __Pyx_GIVEREF(__pyx_n_s_import_c_accel);
+  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_import_c_accel);
+  __pyx_t_2 = __Pyx_Import(__pyx_n_s_gevent__util, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 604, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_import_c_accel); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 604, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_import_c_accel, __pyx_t_1) < 0) __PYX_ERR(0, 604, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+605: import_c_accel(globals(), 'gevent._local')
+
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_import_c_accel); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 605, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_1 = __Pyx_Globals(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 605, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 605, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_9);
+  __Pyx_GIVEREF(__pyx_t_1);
+  PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_1);
+  __Pyx_INCREF(__pyx_n_s_gevent__local);
+  __Pyx_GIVEREF(__pyx_n_s_gevent__local);
+  PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_n_s_gevent__local);
+  __pyx_t_1 = 0;
+  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 605, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/local.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/local.py new file mode 100644 index 00000000..f29bb235 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/local.py @@ -0,0 +1,605 @@ +# cython: auto_pickle=False,embedsignature=True,always_allow_keywords=False +""" +Greenlet-local objects. + +This module is based on `_threading_local.py`__ from the standard +library of Python 3.4. + +__ https://github.com/python/cpython/blob/3.4/Lib/_threading_local.py + +Greenlet-local objects support the management of greenlet-local data. +If you have data that you want to be local to a greenlet, simply create +a greenlet-local object and use its attributes: + + >>> mydata = local() + >>> mydata.number = 42 + >>> mydata.number + 42 + +You can also access the local-object's dictionary: + + >>> mydata.__dict__ + {'number': 42} + >>> mydata.__dict__.setdefault('widgets', []) + [] + >>> mydata.widgets + [] + +What's important about greenlet-local objects is that their data are +local to a greenlet. If we access the data in a different greenlet: + + >>> log = [] + >>> def f(): + ... items = list(mydata.__dict__.items()) + ... items.sort() + ... log.append(items) + ... mydata.number = 11 + ... log.append(mydata.number) + >>> greenlet = gevent.spawn(f) + >>> greenlet.join() + >>> log + [[], 11] + +we get different data. Furthermore, changes made in the other greenlet +don't affect data seen in this greenlet: + + >>> mydata.number + 42 + +Of course, values you get from a local object, including a __dict__ +attribute, are for whatever greenlet was current at the time the +attribute was read. For that reason, you generally don't want to save +these values across greenlets, as they apply only to the greenlet they +came from. + +You can create custom local objects by subclassing the local class: + + >>> class MyLocal(local): + ... number = 2 + ... initialized = False + ... def __init__(self, **kw): + ... if self.initialized: + ... raise SystemError('__init__ called too many times') + ... self.initialized = True + ... self.__dict__.update(kw) + ... def squared(self): + ... return self.number ** 2 + +This can be useful to support default values, methods and +initialization. Note that if you define an __init__ method, it will be +called each time the local object is used in a separate greenlet. This +is necessary to initialize each greenlet's dictionary. + +Now if we create a local object: + + >>> mydata = MyLocal(color='red') + +Now we have a default number: + + >>> mydata.number + 2 + +an initial color: + + >>> mydata.color + 'red' + >>> del mydata.color + +And a method that operates on the data: + + >>> mydata.squared() + 4 + +As before, we can access the data in a separate greenlet: + + >>> log = [] + >>> greenlet = gevent.spawn(f) + >>> greenlet.join() + >>> log + [[('color', 'red'), ('initialized', True)], 11] + +without affecting this greenlet's data: + + >>> mydata.number + 2 + >>> mydata.color + Traceback (most recent call last): + ... + AttributeError: 'MyLocal' object has no attribute 'color' + +Note that subclasses can define slots, but they are not greenlet +local. They are shared across greenlets:: + + >>> class MyLocal(local): + ... __slots__ = 'number' + + >>> mydata = MyLocal() + >>> mydata.number = 42 + >>> mydata.color = 'red' + +So, the separate greenlet: + + >>> greenlet = gevent.spawn(f) + >>> greenlet.join() + +affects what we see: + + >>> mydata.number + 11 + +>>> del mydata + +.. versionchanged:: 1.1a2 + Update the implementation to match Python 3.4 instead of Python 2.5. + This results in locals being eligible for garbage collection as soon + as their greenlet exits. + +.. versionchanged:: 1.2.3 + Use a weak-reference to clear the greenlet link we establish in case + the local object dies before the greenlet does. + +.. versionchanged:: 1.3a1 + Implement the methods for attribute access directly, handling + descriptors directly here. This allows removing the use of a lock + and facilitates greatly improved performance. + +.. versionchanged:: 1.3a1 + The ``__init__`` method of subclasses of ``local`` is no longer + called with a lock held. CPython does not use such a lock in its + native implementation. This could potentially show as a difference + if code that uses multiple dependent attributes in ``__slots__`` + (which are shared across all greenlets) switches during ``__init__``. + +""" +from __future__ import print_function + +from copy import copy +from weakref import ref + + +locals()['getcurrent'] = __import__('greenlet').getcurrent +locals()['greenlet_init'] = lambda: None + +__all__ = [ + "local", +] + +# The key used in the Thread objects' attribute dicts. +# We keep it a string for speed but make it unlikely to clash with +# a "real" attribute. +key_prefix = '_gevent_local_localimpl_' + +# The overall structure is as follows: +# For each local() object: +# greenlet.__dict__[key_prefix + str(id(local))] +# => _localimpl.dicts[id(greenlet)] => (ref(greenlet), {}) + +# That final tuple is actually a localimpl_dict_entry object. + +def all_local_dicts_for_greenlet(greenlet): + """ + Internal debug helper for getting the local values associated + with a greenlet. This is subject to change or removal at any time. + + :return: A list of ((type, id), {}) pairs, where the first element + is the type and id of the local object and the second object is its + instance dictionary, as seen from this greenlet. + + .. versionadded:: 1.3a2 + """ + + result = [] + id_greenlet = id(greenlet) + greenlet_dict = greenlet.__dict__ + for k, v in greenlet_dict.items(): + if not k.startswith(key_prefix): + continue + local_impl = v() + if local_impl is None: + continue + entry = local_impl.dicts.get(id_greenlet) + if entry is None: + # Not yet used in this greenlet. + continue + assert entry.wrgreenlet() is greenlet + result.append((local_impl.localtypeid, entry.localdict)) + + return result + + +class _wrefdict(dict): + """A dict that can be weak referenced""" + +class _greenlet_deleted(object): + """ + A weakref callback for when the greenlet + is deleted. + + If the greenlet is a `gevent.greenlet.Greenlet` and + supplies ``rawlink``, that will be used instead of a + weakref. + """ + __slots__ = ('idt', 'wrdicts') + + def __init__(self, idt, wrdicts): + self.idt = idt + self.wrdicts = wrdicts + + def __call__(self, _unused): + dicts = self.wrdicts() + if dicts: + dicts.pop(self.idt, None) + +class _local_deleted(object): + __slots__ = ('key', 'wrthread', 'greenlet_deleted') + + def __init__(self, key, wrthread, greenlet_deleted): + self.key = key + self.wrthread = wrthread + self.greenlet_deleted = greenlet_deleted + + def __call__(self, _unused): + thread = self.wrthread() + if thread is not None: + try: + unlink = thread.unlink + except AttributeError: + pass + else: + unlink(self.greenlet_deleted) + del thread.__dict__[self.key] + +class _localimpl(object): + """A class managing thread-local dicts""" + __slots__ = ('key', 'dicts', + 'localargs', 'localkwargs', + 'localtypeid', + '__weakref__',) + + def __init__(self, args, kwargs, local_type, id_local): + self.key = key_prefix + str(id(self)) + # { id(greenlet) -> _localimpl_dict_entry(ref(greenlet), greenlet-local dict) } + self.dicts = _wrefdict() + self.localargs = args + self.localkwargs = kwargs + self.localtypeid = local_type, id_local + + # We need to create the thread dict in anticipation of + # __init__ being called, to make sure we don't call it + # again ourselves. MUST do this before setting any attributes. + greenlet = getcurrent() # pylint:disable=undefined-variable + _localimpl_create_dict(self, greenlet, id(greenlet)) + +class _localimpl_dict_entry(object): + """ + The object that goes in the ``dicts`` of ``_localimpl`` + object for each thread. + """ + # This is a class, not just a tuple, so that cython can optimize + # attribute access + __slots__ = ('wrgreenlet', 'localdict') + + def __init__(self, wrgreenlet, localdict): + self.wrgreenlet = wrgreenlet + self.localdict = localdict + +# We use functions instead of methods so that they can be cdef'd in +# local.pxd; if they were cdef'd as methods, they would cause +# the creation of a pointer and a vtable. This happens +# even if we declare the class @cython.final. functions thus save memory overhead +# (but not pointer chasing overhead; the vtable isn't used when we declare +# the class final). + + +def _localimpl_create_dict(self, greenlet, id_greenlet): + """Create a new dict for the current thread, and return it.""" + localdict = {} + key = self.key + + wrdicts = ref(self.dicts) + + # When the greenlet is deleted, remove the local dict. + # Note that this is suboptimal if the greenlet object gets + # caught in a reference loop. We would like to be called + # as soon as the OS-level greenlet ends instead. + + # If we are working with a gevent.greenlet.Greenlet, we + # can pro-actively clear out with a link, avoiding the + # issue described above. Use rawlink to avoid spawning any + # more greenlets. + greenlet_deleted = _greenlet_deleted(id_greenlet, wrdicts) + + rawlink = getattr(greenlet, 'rawlink', None) + if rawlink is not None: + rawlink(greenlet_deleted) + wrthread = ref(greenlet) + else: + wrthread = ref(greenlet, greenlet_deleted) + + + # When the localimpl is deleted, remove the thread attribute. + local_deleted = _local_deleted(key, wrthread, greenlet_deleted) + + + wrlocal = ref(self, local_deleted) + greenlet.__dict__[key] = wrlocal + + self.dicts[id_greenlet] = _localimpl_dict_entry(wrthread, localdict) + return localdict + + +_marker = object() + +def _local_get_dict(self): + impl = self._local__impl + # Cython can optimize dict[], but not dict.get() + greenlet = getcurrent() # pylint:disable=undefined-variable + idg = id(greenlet) + try: + entry = impl.dicts[idg] + dct = entry.localdict + except KeyError: + dct = _localimpl_create_dict(impl, greenlet, idg) + self.__init__(*impl.localargs, **impl.localkwargs) + return dct + +def _init(): + greenlet_init() # pylint:disable=undefined-variable + +_local_attrs = { + '_local__impl', + '_local_type_get_descriptors', + '_local_type_set_or_del_descriptors', + '_local_type_del_descriptors', + '_local_type_set_descriptors', + '_local_type', + '_local_type_vars', + '__class__', + '__cinit__', +} + +class local(object): + """ + An object whose attributes are greenlet-local. + """ + __slots__ = tuple(_local_attrs - {'__class__', '__cinit__'}) + + def __cinit__(self, *args, **kw): + if args or kw: + if type(self).__init__ == object.__init__: + raise TypeError("Initialization arguments are not supported", args, kw) + impl = _localimpl(args, kw, type(self), id(self)) + # pylint:disable=attribute-defined-outside-init + self._local__impl = impl + get, dels, sets_or_dels, sets = _local_find_descriptors(self) + self._local_type_get_descriptors = get + self._local_type_set_or_del_descriptors = sets_or_dels + self._local_type_del_descriptors = dels + self._local_type_set_descriptors = sets + self._local_type = type(self) + self._local_type_vars = set(dir(self._local_type)) + + def __getattribute__(self, name): # pylint:disable=too-many-return-statements + if name in _local_attrs: + # The _local__impl, __cinit__, etc, won't be hit by the + # Cython version, if we've done things right. If we haven't, + # they will be, and this will produce an error. + return object.__getattribute__(self, name) + + dct = _local_get_dict(self) + + if name == '__dict__': + return dct + # If there's no possible way we can switch, because this + # attribute is *not* found in the class where it might be a + # data descriptor (property), and it *is* in the dict + # then we don't need to swizzle the dict and take the lock. + + # We don't have to worry about people overriding __getattribute__ + # because if they did, the dict-swizzling would only last as + # long as we were in here anyway. + # Similarly, a __getattr__ will still be called by _oga() if needed + # if it's not in the dict. + + # Optimization: If we're not subclassed, then + # there can be no descriptors except for methods, which will + # never need to use __dict__. + if self._local_type is local: + return dct[name] if name in dct else object.__getattribute__(self, name) + + # NOTE: If this is a descriptor, this will invoke its __get__. + # A broken descriptor that doesn't return itself when called with + # a None for the instance argument could mess us up here. + # But this is faster than a loop over mro() checking each class __dict__ + # manually. + if name in dct: + if name not in self._local_type_vars: + # If there is a dict value, and nothing in the type, + # it can't possibly be a descriptor, so it is just returned. + return dct[name] + + # It's in the type *and* in the dict. If the type value is + # a data descriptor (defines __get__ *and* either __set__ or + # __delete__), then the type wins. If it's a non-data descriptor + # (defines just __get__), then the instance wins. If it's not a + # descriptor at all (doesn't have __get__), the instance wins. + # NOTE that the docs for descriptors say that these methods must be + # defined on the *class* of the object in the type. + if name not in self._local_type_get_descriptors: + # Entirely not a descriptor. Instance wins. + return dct[name] + if name in self._local_type_set_or_del_descriptors: + # A data descriptor. + # arbitrary code execution while these run. If they touch self again, + # they'll call back into us and we'll repeat the dance. + type_attr = getattr(self._local_type, name) + return type(type_attr).__get__(type_attr, self, self._local_type) + # Last case is a non-data descriptor. Instance wins. + return dct[name] + + if name in self._local_type_vars: + # Not in the dictionary, but is found in the type. It could be + # a non-data descriptor still. Some descriptors, like @staticmethod, + # return objects (functions, in this case), that are *themselves* + # descriptors, which when invoked, again, would do the wrong thing. + # So we can't rely on getattr() on the type for them, we have to + # look through the MRO dicts ourself. + if name not in self._local_type_get_descriptors: + # Not a descriptor, can't execute code. So all we need is + # the return value of getattr() on our type. + return getattr(self._local_type, name) + + for base in self._local_type.mro(): + bd = base.__dict__ + if name in bd: + attr_on_type = bd[name] + result = type(attr_on_type).__get__(attr_on_type, self, self._local_type) + return result + + # It wasn't in the dict and it wasn't in the type. + # So the next step is to invoke type(self)__getattr__, if it + # exists, otherwise raise an AttributeError. + # we will invoke type(self).__getattr__ or raise an attribute error. + if hasattr(self._local_type, '__getattr__'): + return self._local_type.__getattr__(self, name) + raise AttributeError("%r object has no attribute '%s'" + % (self._local_type.__name__, name)) + + def __setattr__(self, name, value): + if name == '__dict__': + raise AttributeError( + "%r object attribute '__dict__' is read-only" + % type(self)) + + if name in _local_attrs: + object.__setattr__(self, name, value) + return + + dct = _local_get_dict(self) + + if self._local_type is local: + # Optimization: If we're not subclassed, we can't + # have data descriptors, so this goes right in the dict. + dct[name] = value + return + + if name in self._local_type_vars: + if name in self._local_type_set_descriptors: + type_attr = getattr(self._local_type, name, _marker) + # A data descriptor, like a property or a slot. + type(type_attr).__set__(type_attr, self, value) + return + # Otherwise it goes directly in the dict + dct[name] = value + + def __delattr__(self, name): + if name == '__dict__': + raise AttributeError( + "%r object attribute '__dict__' is read-only" + % self.__class__.__name__) + + if name in self._local_type_vars: + if name in self._local_type_del_descriptors: + # A data descriptor, like a property or a slot. + type_attr = getattr(self._local_type, name, _marker) + type(type_attr).__delete__(type_attr, self) + return + # Otherwise it goes directly in the dict + + # Begin inlined function _get_dict() + dct = _local_get_dict(self) + + try: + del dct[name] + except KeyError: + raise AttributeError(name) + + def __copy__(self): + impl = self._local__impl + entry = impl.dicts[id(getcurrent())] # pylint:disable=undefined-variable + + dct = entry.localdict + duplicate = copy(dct) + + cls = type(self) + instance = cls(*impl.localargs, **impl.localkwargs) + _local__copy_dict_from(instance, impl, duplicate) + return instance + +def _local__copy_dict_from(self, impl, duplicate): + current = getcurrent() # pylint:disable=undefined-variable + currentId = id(current) + new_impl = self._local__impl + assert new_impl is not impl + entry = new_impl.dicts[currentId] + new_impl.dicts[currentId] = _localimpl_dict_entry(entry.wrgreenlet, duplicate) + +def _local_find_descriptors(self): + type_self = type(self) + gets = set() + dels = set() + set_or_del = set() + sets = set() + mro = list(type_self.mro()) + + for attr_name in dir(type_self): + # Conventionally, descriptors when called on a class + # return themself, but not all do. Notable exceptions are + # in the zope.interface package, where things like __provides__ + # return other class attributes. So we can't use getattr, and instead + # walk up the dicts + for base in mro: + bd = base.__dict__ + if attr_name in bd: + attr = bd[attr_name] + break + else: + raise AttributeError(attr_name) + + type_attr = type(attr) + if hasattr(type_attr, '__get__'): + gets.add(attr_name) + if hasattr(type_attr, '__delete__'): + dels.add(attr_name) + set_or_del.add(attr_name) + if hasattr(type_attr, '__set__'): + sets.add(attr_name) + + return (gets, dels, set_or_del, sets) + +# Cython doesn't let us use __new__, it requires +# __cinit__. But we need __new__ if we're not compiled +# (e.g., on PyPy). So we set it at runtime. Cython +# will raise an error if we're compiled. +def __new__(cls, *args, **kw): + self = super(local, cls).__new__(cls) + # We get the cls in *args for some reason + # too when we do it this way....except on PyPy3, which does + # not *unless* it's wrapped in a classmethod (which it is) + self.__cinit__(*args[1:], **kw) + return self + +try: + # PyPy2/3 and CPython handle adding a __new__ to the class + # in different ways. In CPython and PyPy3, it must be wrapped with classmethod; + # in PyPy2, it must not. In either case, the args that get passed to + # it are stil wrong. + local.__new__ = 'None' +except TypeError: # pragma: no cover + # Must be compiled + pass +else: + from gevent._compat import PYPY + from gevent._compat import PY2 + if PYPY and PY2: + local.__new__ = __new__ + else: + local.__new__ = classmethod(__new__) + + del PYPY + del PY2 + +_init() + +from gevent._util import import_c_accel +import_c_accel(globals(), 'gevent._local') diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/lock.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/lock.py new file mode 100644 index 00000000..dc60d190 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/lock.py @@ -0,0 +1,260 @@ +# Copyright (c) 2009-2012 Denis Bilenko. See LICENSE for details. +"""Locking primitives""" +from __future__ import absolute_import + +from gevent.hub import getcurrent +from gevent._compat import PYPY +from gevent._semaphore import Semaphore, BoundedSemaphore # pylint:disable=no-name-in-module,import-error + + +__all__ = [ + 'Semaphore', + 'DummySemaphore', + 'BoundedSemaphore', + 'RLock', +] + +# On PyPy, we don't compile the Semaphore class with Cython. Under +# Cython, each individual method holds the GIL for its entire +# duration, ensuring that no other thread can interrupt us in an +# unsafe state (only when we _do_wait do we call back into Python and +# allow switching threads). Simulate that here through the use of a manual +# lock. (We use a separate lock for each semaphore to allow sys.settrace functions +# to use locks *other* than the one being traced.) +if PYPY: + # TODO: Need to use monkey.get_original? + try: + from _thread import allocate_lock as _allocate_lock # pylint:disable=import-error,useless-suppression + from _thread import get_ident as _get_ident # pylint:disable=import-error,useless-suppression + except ImportError: + # Python 2 + from thread import allocate_lock as _allocate_lock # pylint:disable=import-error,useless-suppression + from thread import get_ident as _get_ident # pylint:disable=import-error,useless-suppression + _sem_lock = _allocate_lock() + + def untraceable(f): + # Don't allow re-entry to these functions in a single thread, as can + # happen if a sys.settrace is used + def wrapper(self): + me = _get_ident() + try: + count = self._locking[me] + except KeyError: + count = self._locking[me] = 1 + else: + count = self._locking[me] = count + 1 + if count: + return + + try: + return f(self) + finally: + count = count - 1 + if not count: + del self._locking[me] + else: + self._locking[me] = count + return wrapper + + class _OwnedLock(object): + + def __init__(self): + self._owner = None + self._block = _allocate_lock() + self._locking = {} + self._count = 0 + + @untraceable + def acquire(self): + me = _get_ident() + if self._owner == me: + self._count += 1 + return + + self._owner = me + self._block.acquire() + self._count = 1 + + @untraceable + def release(self): + self._count = count = self._count - 1 + if not count: + self._block.release() + self._owner = None + + # acquire, wait, and release all acquire the lock on entry and release it + # on exit. acquire and wait can call _do_wait, which must release it on entry + # and re-acquire it for them on exit. + class _around(object): + __slots__ = ('before', 'after') + + def __init__(self, before, after): + self.before = before + self.after = after + + def __enter__(self): + self.before() + + def __exit__(self, t, v, tb): + self.after() + + def _decorate(func, cmname): + # functools.wrap? + def wrapped(self, *args, **kwargs): + with getattr(self, cmname): + return func(self, *args, **kwargs) + return wrapped + + Semaphore._py3k_acquire = Semaphore.acquire = _decorate(Semaphore.acquire, '_lock_locked') + Semaphore.release = _decorate(Semaphore.release, '_lock_locked') + Semaphore.wait = _decorate(Semaphore.wait, '_lock_locked') + Semaphore._wait = _decorate(Semaphore._wait, '_lock_unlocked') + + _Sem_init = Semaphore.__init__ + + def __init__(self, *args, **kwargs): + l = self._lock_lock = _OwnedLock() + self._lock_locked = _around(l.acquire, l.release) + self._lock_unlocked = _around(l.release, l.acquire) + + _Sem_init(self, *args, **kwargs) + + Semaphore.__init__ = __init__ + + del _decorate + del untraceable + + +class DummySemaphore(object): + """ + DummySemaphore(value=None) -> DummySemaphore + + A Semaphore initialized with "infinite" initial value. None of its + methods ever block. + + This can be used to parameterize on whether or not to actually + guard access to a potentially limited resource. If the resource is + actually limited, such as a fixed-size thread pool, use a real + :class:`Semaphore`, but if the resource is unbounded, use an + instance of this class. In that way none of the supporting code + needs to change. + + Similarly, it can be used to parameterize on whether or not to + enforce mutual exclusion to some underlying object. If the + underlying object is known to be thread-safe itself mutual + exclusion is not needed and a ``DummySemaphore`` can be used, but + if that's not true, use a real ``Semaphore``. + """ + + # Internally this is used for exactly the purpose described in the + # documentation. gevent.pool.Pool uses it instead of a Semaphore + # when the pool size is unlimited, and + # gevent.fileobject.FileObjectThread takes a parameter that + # determines whether it should lock around IO to the underlying + # file object. + + def __init__(self, value=None): + """ + .. versionchanged:: 1.1rc3 + Accept and ignore a *value* argument for compatibility with Semaphore. + """ + + def __str__(self): + return '<%s>' % self.__class__.__name__ + + def locked(self): + """A DummySemaphore is never locked so this always returns False.""" + return False + + def release(self): + """Releasing a dummy semaphore does nothing.""" + + def rawlink(self, callback): + # XXX should still work and notify? + pass + + def unlink(self, callback): + pass + + def wait(self, timeout=None): + """Waiting for a DummySemaphore returns immediately.""" + + def acquire(self, blocking=True, timeout=None): + """ + A DummySemaphore can always be acquired immediately so this always + returns True and ignores its arguments. + + .. versionchanged:: 1.1a1 + Always return *true*. + """ + # pylint:disable=unused-argument + return True + + def __enter__(self): + pass + + def __exit__(self, typ, val, tb): + pass + + +class RLock(object): + """ + A mutex that can be acquired more than once by the same greenlet. + """ + + def __init__(self): + self._block = Semaphore(1) + self._owner = None + self._count = 0 + + def __repr__(self): + return "<%s at 0x%x _block=%s _count=%r _owner=%r)>" % ( + self.__class__.__name__, + id(self), + self._block, + self._count, + self._owner) + + def acquire(self, blocking=1): + me = getcurrent() + if self._owner is me: + self._count = self._count + 1 + return 1 + rc = self._block.acquire(blocking) + if rc: + self._owner = me + self._count = 1 + return rc + + def __enter__(self): + return self.acquire() + + def release(self): + if self._owner is not getcurrent(): + raise RuntimeError("cannot release un-acquired lock") + self._count = count = self._count - 1 + if not count: + self._owner = None + self._block.release() + + def __exit__(self, typ, value, tb): + self.release() + + # Internal methods used by condition variables + + def _acquire_restore(self, count_owner): + count, owner = count_owner + self._block.acquire() + self._count = count + self._owner = owner + + def _release_save(self): + count = self._count + self._count = 0 + owner = self._owner + self._owner = None + self._block.release() + return (count, owner) + + def _is_owned(self): + return self._owner is getcurrent() diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/monkey.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/monkey.py new file mode 100644 index 00000000..6c1fa00b --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/monkey.py @@ -0,0 +1,1079 @@ +# Copyright (c) 2009-2012 Denis Bilenko. See LICENSE for details. +# pylint: disable=redefined-outer-name +""" +Make the standard library cooperative. + +The primary purpose of this module is to carefully patch, in place, +portions of the standard library with gevent-friendly functions that +behave in the same way as the original (at least as closely as possible). + +The primary interface to this is the :func:`patch_all` function, which +performs all the available patches. It accepts arguments to limit the +patching to certain modules, but most programs **should** use the +default values as they receive the most wide-spread testing, and some monkey +patches have dependencies on others. + +Patching **should be done as early as possible** in the lifecycle of the +program. For example, the main module (the one that tests against +``__main__`` or is otherwise the first imported) should begin with +this code, ideally before any other imports:: + + from gevent import monkey + monkey.patch_all() + +A corollary of the above is that patching **should be done on the main +thread** and **should be done while the program is single-threaded**. + +.. tip:: + + Some frameworks, such as gunicorn, handle monkey-patching for you. + Check their documentation to be sure. + +.. warning:: + + Patching too late can lead to unreliable behaviour (for example, some + modules may still use blocking sockets) or even errors. + +Querying +======== + +Sometimes it is helpful to know if objects have been monkey-patched, and in +advanced cases even to have access to the original standard library functions. This +module provides functions for that purpose. + +- :func:`is_module_patched` +- :func:`is_object_patched` +- :func:`get_original` + +Plugins +======= + +Beginning in gevent 1.3, events are emitted during the monkey patching process. +These events are delivered first to :mod:`gevent.events` subscribers, and then +to `setuptools entry points`_. + +The following events are defined. They are listed in (roughly) the order +that a call to :func:`patch_all` will emit them. + +- :class:`gevent.events.GeventWillPatchAllEvent` +- :class:`gevent.events.GeventWillPatchModuleEvent` +- :class:`gevent.events.GeventDidPatchModuleEvent` +- :class:`gevent.events.GeventDidPatchBuiltinModulesEvent` +- :class:`gevent.events.GeventDidPatchAllEvent` + +Each event class documents the corresponding setuptools entry point name. The +entry points will be called with a single argument, the same instance of +the class that was sent to the subscribers. + +You can subscribe to the events to monitor the monkey-patching process and +to manipulate it, for example by raising :exc:`gevent.events.DoNotPatch`. + +You can also subscribe to the events to provide additional patching beyond what +gevent distributes, either for additional standard library modules, or +for third-party packages. The suggested time to do this patching is in +the subscriber for :class:`gevent.events.GeventDidPatchBuiltinModulesEvent`. +For example, to automatically patch `psycopg2`_ using `psycogreen`_ +when the call to :func:`patch_all` is made, you could write code like this:: + + # mypackage.py + def patch_psycopg(event): + from psycogreen.gevent import patch_psycopg + patch_psycopg() + +In your ``setup.py`` you would register it like this:: + + from setuptools import setup + setup( + ... + entry_points={ + 'gevent.plugins.monkey.did_patch_builtins': [ + 'psycopg2 = mypackage:patch_psycopg', + ], + }, + ... + ) + +For more complex patching, gevent provides a helper method +that you can call to replace attributes of modules with attributes of your +own modules. This function also takes care of emitting the appropriate events. + +- :func:`patch_module` + +.. _setuptools entry points: http://setuptools.readthedocs.io/en/latest/setuptools.html#dynamic-discovery-of-services-and-plugins +.. _psycopg2: https://pypi.python.org/pypi/psycopg2 +.. _psycogreen: https://pypi.python.org/pypi/psycogreen + +Use as a module +=============== + +Sometimes it is useful to run existing python scripts or modules that +were not built to be gevent aware under gevent. To do so, this module +can be run as the main module, passing the script and its arguments. +For details, see the :func:`main` function. + +.. versionchanged:: 1.3b1 + Added support for plugins and began emitting will/did patch events. +""" +from __future__ import absolute_import +from __future__ import print_function +import sys + +__all__ = [ + 'patch_all', + 'patch_builtins', + 'patch_dns', + 'patch_os', + 'patch_queue', + 'patch_select', + 'patch_signal', + 'patch_socket', + 'patch_ssl', + 'patch_subprocess', + 'patch_sys', + 'patch_thread', + 'patch_time', + # query functions + 'get_original', + 'is_module_patched', + 'is_object_patched', + # plugin API + 'patch_module', + # module functions + 'main', +] + + +if sys.version_info[0] >= 3: + string_types = (str,) + PY3 = True +else: + import __builtin__ # pylint:disable=import-error + string_types = (__builtin__.basestring,) + PY3 = False + +WIN = sys.platform.startswith("win") + +class MonkeyPatchWarning(RuntimeWarning): + """ + The type of warnings we issue. + + .. versionadded:: 1.3a2 + """ + +def _notify_patch(event, _warnings=None): + # Raises DoNotPatch if we're not supposed to patch + from gevent.events import notify_and_call_entry_points + + event._warnings = _warnings + notify_and_call_entry_points(event) + +def _ignores_DoNotPatch(func): + + from functools import wraps + + @wraps(func) + def ignores(*args, **kwargs): + from gevent.events import DoNotPatch + try: + return func(*args, **kwargs) + except DoNotPatch: + return False + + return ignores + + +# maps module name -> {attribute name: original item} +# e.g. "time" -> {"sleep": built-in function sleep} +saved = {} + + +def is_module_patched(mod_name): + """ + Check if a module has been replaced with a cooperative version. + + :param str mod_name: The name of the standard library module, + e.g., ``'socket'``. + + """ + return mod_name in saved + + +def is_object_patched(mod_name, item_name): + """ + Check if an object in a module has been replaced with a + cooperative version. + + :param str mod_name: The name of the standard library module, + e.g., ``'socket'``. + :param str item_name: The name of the attribute in the module, + e.g., ``'create_connection'``. + + """ + return is_module_patched(mod_name) and item_name in saved[mod_name] + + +def _get_original(name, items): + d = saved.get(name, {}) + values = [] + module = None + for item in items: + if item in d: + values.append(d[item]) + else: + if module is None: + module = __import__(name) + values.append(getattr(module, item)) + return values + + +def get_original(mod_name, item_name): + """ + Retrieve the original object from a module. + + If the object has not been patched, then that object will still be + retrieved. + + :param str mod_name: The name of the standard library module, + e.g., ``'socket'``. + :param item_name: A string or sequence of strings naming the + attribute(s) on the module ``mod_name`` to return. + + :return: The original value if a string was given for + ``item_name`` or a sequence of original values if a + sequence was passed. + """ + if isinstance(item_name, string_types): + return _get_original(mod_name, [item_name])[0] + return _get_original(mod_name, item_name) + + +_NONE = object() + + +def patch_item(module, attr, newitem): + olditem = getattr(module, attr, _NONE) + if olditem is not _NONE: + saved.setdefault(module.__name__, {}).setdefault(attr, olditem) + setattr(module, attr, newitem) + + +def remove_item(module, attr): + olditem = getattr(module, attr, _NONE) + if olditem is _NONE: + return + saved.setdefault(module.__name__, {}).setdefault(attr, olditem) + delattr(module, attr) + + +def __call_module_hook(gevent_module, name, module, items, _warnings): + # This function can raise DoNotPatch on 'will' + + def warn(message): + _queue_warning(message, _warnings) + + func_name = '_gevent_' + name + '_monkey_patch' + try: + func = getattr(gevent_module, func_name) + except AttributeError: + func = lambda *args: None + + + func(module, items, warn) + + +def patch_module(target_module, source_module, items=None, + _warnings=None, + _notify_did_subscribers=True): + """ + patch_module(target_module, source_module, items=None) + + Replace attributes in *target_module* with the attributes of the + same name in *source_module*. + + The *source_module* can provide some attributes to customize the process: + + * ``__implements__`` is a list of attribute names to copy; if not present, + the *items* keyword argument is mandatory. + * ``_gevent_will_monkey_patch(target_module, items, warn, **kwargs)`` + * ``_gevent_did_monkey_patch(target_module, items, warn, **kwargs)`` + These two functions in the *source_module* are called *if* they exist, + before and after copying attributes, respectively. The "will" function + may modify *items*. The value of *warn* is a function that should be called + with a single string argument to issue a warning to the user. If the "will" + function raises :exc:`gevent.events.DoNotPatch`, no patching will be done. These functions + are called before any event subscribers or plugins. + + :keyword list items: A list of attribute names to replace. If + not given, this will be taken from the *source_module* ``__implements__`` + attribute. + :return: A true value if patching was done, a false value if patching was canceled. + + .. versionadded:: 1.3b1 + """ + from gevent import events + + if items is None: + items = getattr(source_module, '__implements__', None) + if items is None: + raise AttributeError('%r does not have __implements__' % source_module) + + try: + __call_module_hook(source_module, 'will', target_module, items, _warnings) + _notify_patch( + events.GeventWillPatchModuleEvent(target_module.__name__, source_module, + target_module, items), + _warnings) + except events.DoNotPatch: + return False + + for attr in items: + patch_item(target_module, attr, getattr(source_module, attr)) + + __call_module_hook(source_module, 'did', target_module, items, _warnings) + + if _notify_did_subscribers: + # We allow turning off the broadcast of the 'did' event for the benefit + # of our internal functions which need to do additional work (besides copying + # attributes) before their patch can be considered complete. + _notify_patch( + events.GeventDidPatchModuleEvent(target_module.__name__, source_module, + target_module) + ) + + return True + +def _patch_module(name, items=None, _warnings=None, _notify_did_subscribers=True): + + gevent_module = getattr(__import__('gevent.' + name), name) + module_name = getattr(gevent_module, '__target__', name) + target_module = __import__(module_name) + + patch_module(target_module, gevent_module, items=items, + _warnings=_warnings, + _notify_did_subscribers=_notify_did_subscribers) + + return gevent_module, target_module + + +def _queue_warning(message, _warnings): + # Queues a warning to show after the monkey-patching process is all done. + # Done this way to avoid extra imports during the process itself, just + # in case. If we're calling a function one-off (unusual) go ahead and do it + if _warnings is None: + _process_warnings([message]) + else: + _warnings.append(message) + + +def _process_warnings(_warnings): + import warnings + for warning in _warnings: + warnings.warn(warning, MonkeyPatchWarning, stacklevel=3) + + +def _patch_sys_std(name): + from gevent.fileobject import FileObjectThread + orig = getattr(sys, name) + if not isinstance(orig, FileObjectThread): + patch_item(sys, name, FileObjectThread(orig)) + +@_ignores_DoNotPatch +def patch_sys(stdin=True, stdout=True, stderr=True): + """ + Patch sys.std[in,out,err] to use a cooperative IO via a + threadpool. + + This is relatively dangerous and can have unintended consequences + such as hanging the process or `misinterpreting control keys`_ + when :func:`input` and :func:`raw_input` are used. :func:`patch_all` + does *not* call this function by default. + + This method does nothing on Python 3. The Python 3 interpreter + wants to flush the TextIOWrapper objects that make up + stderr/stdout at shutdown time, but using a threadpool at that + time leads to a hang. + + .. _`misinterpreting control keys`: https://github.com/gevent/gevent/issues/274 + """ + # test__issue6.py demonstrates the hang if these lines are removed; + # strangely enough that test passes even without monkey-patching sys + if PY3: + items = None + else: + items = set([('stdin' if stdin else None), + ('stdout' if stdout else None), + ('stderr' if stderr else None)]) + items.discard(None) + items = list(items) + + if not items: + return + + from gevent import events + _notify_patch(events.GeventWillPatchModuleEvent('sys', None, sys, + items)) + + for item in items: + _patch_sys_std(item) + + _notify_patch(events.GeventDidPatchModuleEvent('sys', None, sys)) + +@_ignores_DoNotPatch +def patch_os(): + """ + Replace :func:`os.fork` with :func:`gevent.fork`, and, on POSIX, + :func:`os.waitpid` with :func:`gevent.os.waitpid` (if the + environment variable ``GEVENT_NOWAITPID`` is not defined). Does + nothing if fork is not available. + + .. caution:: This method must be used with :func:`patch_signal` to have proper `SIGCHLD` + handling and thus correct results from ``waitpid``. + :func:`patch_all` calls both by default. + + .. caution:: For `SIGCHLD` handling to work correctly, the event loop must run. + The easiest way to help ensure this is to use :func:`patch_all`. + """ + _patch_module('os') + + +@_ignores_DoNotPatch +def patch_queue(): + """ + On Python 3.7 and above, replace :class:`queue.SimpleQueue` (implemented + in C) with its Python counterpart. + + .. versionadded:: 1.3.5 + """ + + import gevent.queue + if 'SimpleQueue' in gevent.queue.__all__: + _patch_module('queue', items=['SimpleQueue']) + + +@_ignores_DoNotPatch +def patch_time(): + """ + Replace :func:`time.sleep` with :func:`gevent.sleep`. + """ + _patch_module('time') + + +def _patch_existing_locks(threading): + if len(list(threading.enumerate())) != 1: + return + try: + tid = threading.get_ident() + except AttributeError: + tid = threading._get_ident() + rlock_type = type(threading.RLock()) + try: + import importlib._bootstrap + except ImportError: + class _ModuleLock(object): + pass + else: + _ModuleLock = importlib._bootstrap._ModuleLock # python 2 pylint: disable=no-member + # It might be possible to walk up all the existing stack frames to find + # locked objects...at least if they use `with`. To be sure, we look at every object + # Since we're supposed to be done very early in the process, there shouldn't be + # too many. + + # By definition there's only one thread running, so the various + # owner attributes were the old (native) thread id. Make it our + # current greenlet id so that when it wants to unlock and compare + # self.__owner with _get_ident(), they match. + gc = __import__('gc') + for o in gc.get_objects(): + if isinstance(o, rlock_type): + if hasattr(o, '_owner'): # Py3 + if o._owner is not None: + o._owner = tid + else: + if o._RLock__owner is not None: + o._RLock__owner = tid + elif isinstance(o, _ModuleLock): + if o.owner is not None: + o.owner = tid + +@_ignores_DoNotPatch +def patch_thread(threading=True, _threading_local=True, Event=True, logging=True, + existing_locks=True, + _warnings=None): + """ + patch_thread(threading=True, _threading_local=True, Event=True, logging=True, existing_locks=True) -> None + + Replace the standard :mod:`thread` module to make it greenlet-based. + + :keyword bool threading: When True (the default), + also patch :mod:`threading`. + :keyword bool _threading_local: When True (the default), + also patch :class:`_threading_local.local`. + :keyword bool logging: When True (the default), also patch locks + taken if the logging module has been configured. + + :keyword bool existing_locks: When True (the default), and the + process is still single threaded, make sure that any + :class:`threading.RLock` (and, under Python 3, :class:`importlib._bootstrap._ModuleLock`) + instances that are currently locked can be properly unlocked. + + .. caution:: + Monkey-patching :mod:`thread` and using + :class:`multiprocessing.Queue` or + :class:`concurrent.futures.ProcessPoolExecutor` (which uses a + ``Queue``) will hang the process. + + .. versionchanged:: 1.1b1 + Add *logging* and *existing_locks* params. + .. versionchanged:: 1.3a2 + ``Event`` defaults to True. + """ + # XXX: Simplify + # pylint:disable=too-many-branches,too-many-locals,too-many-statements + + # Description of the hang: + # There is an incompatibility with patching 'thread' and the 'multiprocessing' module: + # The problem is that multiprocessing.queues.Queue uses a half-duplex multiprocessing.Pipe, + # which is implemented with os.pipe() and _multiprocessing.Connection. os.pipe isn't patched + # by gevent, as it returns just a fileno. _multiprocessing.Connection is an internal implementation + # class implemented in C, which exposes a 'poll(timeout)' method; under the covers, this issues a + # (blocking) select() call: hence the need for a real thread. Except for that method, we could + # almost replace Connection with gevent.fileobject.SocketAdapter, plus a trivial + # patch to os.pipe (below). Sigh, so close. (With a little work, we could replicate that method) + + # import os + # import fcntl + # os_pipe = os.pipe + # def _pipe(): + # r, w = os_pipe() + # fcntl.fcntl(r, fcntl.F_SETFL, os.O_NONBLOCK) + # fcntl.fcntl(w, fcntl.F_SETFL, os.O_NONBLOCK) + # return r, w + # os.pipe = _pipe + + # The 'threading' module copies some attributes from the + # thread module the first time it is imported. If we patch 'thread' + # before that happens, then we store the wrong values in 'saved', + # So if we're going to patch threading, we either need to import it + # before we patch thread, or manually clean up the attributes that + # are in trouble. The latter is tricky because of the different names + # on different versions. + if threading: + threading_mod = __import__('threading') + # Capture the *real* current thread object before + # we start returning DummyThread objects, for comparison + # to the main thread. + orig_current_thread = threading_mod.current_thread() + else: + threading_mod = None + gevent_threading_mod = None + orig_current_thread = None + + gevent_thread_mod, thread_mod = _patch_module('thread', + _warnings=_warnings, _notify_did_subscribers=False) + + if threading: + gevent_threading_mod, _ = _patch_module('threading', + _warnings=_warnings, _notify_did_subscribers=False) + + if Event: + from gevent.event import Event + patch_item(threading_mod, 'Event', Event) + # Python 2 had `Event` as a function returning + # the private class `_Event`. Some code may be relying + # on that. + if hasattr(threading_mod, '_Event'): + patch_item(threading_mod, '_Event', Event) + + if existing_locks: + _patch_existing_locks(threading_mod) + + if logging and 'logging' in sys.modules: + logging = __import__('logging') + patch_item(logging, '_lock', threading_mod.RLock()) + for wr in logging._handlerList: + # In py26, these are actual handlers, not weakrefs + handler = wr() if callable(wr) else wr + if handler is None: + continue + if not hasattr(handler, 'lock'): + raise TypeError("Unknown/unsupported handler %r" % handler) + handler.lock = threading_mod.RLock() + + if _threading_local: + _threading_local = __import__('_threading_local') + from gevent.local import local + patch_item(_threading_local, 'local', local) + + def make_join_func(thread, thread_greenlet): + from gevent.hub import sleep + from time import time + + def join(timeout=None): + end = None + if threading_mod.current_thread() is thread: + raise RuntimeError("Cannot join current thread") + if thread_greenlet is not None and thread_greenlet.dead: + return + if not thread.is_alive(): + return + + if timeout: + end = time() + timeout + + while thread.is_alive(): + if end is not None and time() > end: + return + sleep(0.01) + return join + + if threading: + from gevent.threading import main_native_thread + + for thread in threading_mod._active.values(): + if thread == main_native_thread(): + continue + thread.join = make_join_func(thread, None) + + if sys.version_info[:2] >= (3, 4): + + # Issue 18808 changes the nature of Thread.join() to use + # locks. This means that a greenlet spawned in the main thread + # (which is already running) cannot wait for the main thread---it + # hangs forever. We patch around this if possible. See also + # gevent.threading. + greenlet = __import__('greenlet') + + if orig_current_thread == threading_mod.main_thread(): + main_thread = threading_mod.main_thread() + _greenlet = main_thread._greenlet = greenlet.getcurrent() + + main_thread.join = make_join_func(main_thread, _greenlet) + + # Patch up the ident of the main thread to match. This + # matters if threading was imported before monkey-patching + # thread + oldid = main_thread.ident + main_thread._ident = threading_mod.get_ident() + if oldid in threading_mod._active: + threading_mod._active[main_thread.ident] = threading_mod._active[oldid] + if oldid != main_thread.ident: + del threading_mod._active[oldid] + else: + _queue_warning("Monkey-patching not on the main thread; " + "threading.main_thread().join() will hang from a greenlet", + _warnings) + + from gevent import events + _notify_patch(events.GeventDidPatchModuleEvent('thread', gevent_thread_mod, thread_mod)) + _notify_patch(events.GeventDidPatchModuleEvent('threading', gevent_threading_mod, threading_mod)) + +@_ignores_DoNotPatch +def patch_socket(dns=True, aggressive=True): + """ + Replace the standard socket object with gevent's cooperative + sockets. + + :keyword bool dns: When true (the default), also patch address + resolution functions in :mod:`socket`. See :doc:`/dns` for details. + """ + from gevent import socket + # Note: although it seems like it's not strictly necessary to monkey patch 'create_connection', + # it's better to do it. If 'create_connection' was not monkey patched, but the rest of socket module + # was, create_connection would still use "green" getaddrinfo and "green" socket. + # However, because gevent.socket.socket.connect is a Python function, the exception raised by it causes + # _socket object to be referenced by the frame, thus causing the next invocation of bind(source_address) to fail. + if dns: + items = socket.__implements__ # pylint:disable=no-member + else: + items = set(socket.__implements__) - set(socket.__dns__) # pylint:disable=no-member + _patch_module('socket', items=items) + if aggressive: + if 'ssl' not in socket.__implements__: # pylint:disable=no-member + remove_item(socket, 'ssl') + +@_ignores_DoNotPatch +def patch_dns(): + """ + Replace :doc:`DNS functions ` in :mod:`socket` with + cooperative versions. + + This is only useful if :func:`patch_socket` has been called and is + done automatically by that method if requested. + """ + from gevent import socket + _patch_module('socket', items=socket.__dns__) # pylint:disable=no-member + + +def _find_module_refs(to, excluding_names=()): + # Looks specifically for module-level references, + # i.e., 'from foo import Bar'. We define a module reference + # as a dict (subclass) that also has a __name__ attribute. + # This does not handle subclasses, but it does find them. + # Returns two sets. The first is modules (name, file) that were + # found. The second is subclasses that were found. + gc = __import__('gc') + direct_ref_modules = set() + subclass_modules = set() + + def report(mod): + return mod['__name__'], mod.get('__file__', '') + + for r in gc.get_referrers(to): + if isinstance(r, dict) and '__name__' in r: + if r['__name__'] in excluding_names: + continue + + for v in r.values(): + if v is to: + direct_ref_modules.add(report(r)) + elif isinstance(r, type) and to in r.__bases__ and 'gevent.' not in r.__module__: + subclass_modules.add(r) + + return direct_ref_modules, subclass_modules + +@_ignores_DoNotPatch +def patch_ssl(_warnings=None, _first_time=True): + """ + patch_ssl() -> None + + Replace :class:`ssl.SSLSocket` object and socket wrapping functions in + :mod:`ssl` with cooperative versions. + + This is only useful if :func:`patch_socket` has been called. + """ + may_need_warning = ( + _first_time + and sys.version_info[:2] >= (3, 6) + and 'ssl' in sys.modules + and hasattr(sys.modules['ssl'], 'SSLContext')) + # Previously, we didn't warn on Python 2 if pkg_resources has been imported + # because that imports ssl and it's commonly used for namespace packages, + # which typically means we're still in some early part of the import cycle. + # However, with our new more discriminating check, that no longer seems to be a problem. + # Prior to 3.6, we don't have the RecursionError problem, and prior to 3.7 we don't have the + # SSLContext.sslsocket_class/SSLContext.sslobject_class problem. + + gevent_mod, _ = _patch_module('ssl', _warnings=_warnings) + if may_need_warning: + direct_ref_modules, subclass_modules = _find_module_refs( + gevent_mod.orig_SSLContext, + excluding_names=('ssl', 'gevent.ssl', 'gevent._ssl3', 'gevent._sslgte279')) + if direct_ref_modules or subclass_modules: + # Normally you don't want to have dynamic warning strings, because + # the cache in the warning module is based on the string. But we + # specifically only do this the first time we patch ourself, so it's + # ok. + direct_ref_mod_str = subclass_str = '' + if direct_ref_modules: + direct_ref_mod_str = 'Modules that had direct imports (NOT patched): %s. ' % ([ + "%s (%s)" % (name, fname) + for name, fname in direct_ref_modules + ]) + if subclass_modules: + subclass_str = 'Subclasses (NOT patched): %s. ' % ([ + str(t) for t in subclass_modules + ]) + _queue_warning( + 'Monkey-patching ssl after ssl has already been imported ' + 'may lead to errors, including RecursionError on Python 3.6. ' + 'It may also silently lead to incorrect behaviour on Python 3.7. ' + 'Please monkey-patch earlier. ' + 'See https://github.com/gevent/gevent/issues/1016. ' + + direct_ref_mod_str + subclass_str, + _warnings) + + +@_ignores_DoNotPatch +def patch_select(aggressive=True): + """ + Replace :func:`select.select` with :func:`gevent.select.select` + and :func:`select.poll` with :class:`gevent.select.poll` (where available). + + If ``aggressive`` is true (the default), also remove other + blocking functions from :mod:`select` and (on Python 3.4 and + above) :mod:`selectors`: + + - :func:`select.epoll` + - :func:`select.kqueue` + - :func:`select.kevent` + - :func:`select.devpoll` (Python 3.5+) + - :class:`selectors.EpollSelector` + - :class:`selectors.KqueueSelector` + - :class:`selectors.DevpollSelector` (Python 3.5+) + """ + + source_mod, target_mod = _patch_module('select', _notify_did_subscribers=False) + if aggressive: + select = target_mod + # since these are blocking we're removing them here. This makes some other + # modules (e.g. asyncore) non-blocking, as they use select that we provide + # when none of these are available. + remove_item(select, 'epoll') + remove_item(select, 'kqueue') + remove_item(select, 'kevent') + remove_item(select, 'devpoll') + + if sys.version_info[:2] >= (3, 4): + # Python 3 wants to use `select.select` as a member function, + # leading to this error in selectors.py (because gevent.select.select is + # not a builtin and doesn't get the magic auto-static that they do) + # r, w, _ = self._select(self._readers, self._writers, [], timeout) + # TypeError: select() takes from 3 to 4 positional arguments but 5 were given + # Note that this obviously only happens if selectors was imported after we had patched + # select; but there is a code path that leads to it being imported first (but now we've + # patched select---so we can't compare them identically) + select = target_mod # Should be gevent-patched now + orig_select_select = get_original('select', 'select') + assert select.select is not orig_select_select + selectors = __import__('selectors') + if selectors.SelectSelector._select in (select.select, orig_select_select): + def _select(self, *args, **kwargs): # pylint:disable=unused-argument + return select.select(*args, **kwargs) + selectors.SelectSelector._select = _select + _select._gevent_monkey = True + + # Python 3.7 refactors the poll-like selectors to use a common + # base class and capture a reference to select.poll, etc, at + # import time. selectors tends to get imported early + # (importing 'platform' does it: platform -> subprocess -> selectors), + # so we need to clean that up. + if hasattr(selectors, 'PollSelector') and hasattr(selectors.PollSelector, '_selector_cls'): + selectors.PollSelector._selector_cls = select.poll + + if aggressive: + # If `selectors` had already been imported before we removed + # select.epoll|kqueue|devpoll, these may have been defined in terms + # of those functions. They'll fail at runtime. + remove_item(selectors, 'EpollSelector') + remove_item(selectors, 'KqueueSelector') + remove_item(selectors, 'DevpollSelector') + selectors.DefaultSelector = selectors.SelectSelector + + from gevent import events + _notify_patch(events.GeventDidPatchModuleEvent('select', source_mod, target_mod)) + +@_ignores_DoNotPatch +def patch_subprocess(): + """ + Replace :func:`subprocess.call`, :func:`subprocess.check_call`, + :func:`subprocess.check_output` and :class:`subprocess.Popen` with + :mod:`cooperative versions `. + + .. note:: + On Windows under Python 3, the API support may not completely match + the standard library. + + """ + _patch_module('subprocess') + +@_ignores_DoNotPatch +def patch_builtins(): + """ + Make the builtin :func:`__import__` function `greenlet safe`_ under Python 2. + + .. note:: + This does nothing under Python 3 as it is not necessary. Python 3 features + improved import locks that are per-module, not global. + + .. _greenlet safe: https://github.com/gevent/gevent/issues/108 + + """ + if sys.version_info[:2] < (3, 3): + _patch_module('builtins') + +@_ignores_DoNotPatch +def patch_signal(): + """ + Make the :func:`signal.signal` function work with a :func:`monkey-patched os `. + + .. caution:: This method must be used with :func:`patch_os` to have proper ``SIGCHLD`` + handling. :func:`patch_all` calls both by default. + + .. caution:: For proper ``SIGCHLD`` handling, you must yield to the event loop. + Using :func:`patch_all` is the easiest way to ensure this. + + .. seealso:: :mod:`gevent.signal` + """ + _patch_module("signal") + + +def _check_repatching(**module_settings): + _warnings = [] + key = '_gevent_saved_patch_all' + del module_settings['kwargs'] + if saved.get(key, module_settings) != module_settings: + _queue_warning("Patching more than once will result in the union of all True" + " parameters being patched", + _warnings) + + first_time = key not in saved + saved[key] = module_settings + return _warnings, first_time, module_settings + + +def _subscribe_signal_os(will_patch_all): + if will_patch_all.will_patch_module('signal') and not will_patch_all.will_patch_module('os'): + warnings = will_patch_all._warnings # Internal + _queue_warning('Patching signal but not os will result in SIGCHLD handlers' + ' installed after this not being called and os.waitpid may not' + ' function correctly if gevent.subprocess is used. This may raise an' + ' error in the future.', + warnings) + +def patch_all(socket=True, dns=True, time=True, select=True, thread=True, os=True, ssl=True, + httplib=False, # Deprecated, to be removed. + subprocess=True, sys=False, aggressive=True, Event=True, + builtins=True, signal=True, + queue=True, + **kwargs): + """ + Do all of the default monkey patching (calls every other applicable + function in this module). + + :return: A true value if patching all modules wasn't cancelled, a false + value if it was. + + .. versionchanged:: 1.1 + Issue a :mod:`warning ` if this function is called multiple times + with different arguments. The second and subsequent calls will only add more + patches, they can never remove existing patches by setting an argument to ``False``. + .. versionchanged:: 1.1 + Issue a :mod:`warning ` if this function is called with ``os=False`` + and ``signal=True``. This will cause SIGCHLD handlers to not be called. This may + be an error in the future. + .. versionchanged:: 1.3a2 + ``Event`` defaults to True. + .. versionchanged:: 1.3b1 + Defined the return values. + .. versionchanged:: 1.3b1 + Add ``**kwargs`` for the benefit of event subscribers. CAUTION: gevent may add + and interpret additional arguments in the future, so it is suggested to use prefixes + for kwarg values to be interpreted by plugins, for example, `patch_all(mylib_futures=True)`. + .. versionchanged:: 1.3.5 + Add *queue*, defaulting to True, for Python 3.7. + """ + # pylint:disable=too-many-locals,too-many-branches + + # Check to see if they're changing the patched list + _warnings, first_time, modules_to_patch = _check_repatching(**locals()) + if not _warnings and not first_time: + # Nothing to do, identical args to what we just + # did + return + + from gevent import events + try: + _notify_patch(events.GeventWillPatchAllEvent(modules_to_patch, kwargs), _warnings) + except events.DoNotPatch: + return False + + # order is important + if os: + patch_os() + if time: + patch_time() + if thread: + patch_thread(Event=Event, _warnings=_warnings) + # sys must be patched after thread. in other cases threading._shutdown will be + # initiated to _MainThread with real thread ident + if sys: + patch_sys() + if socket: + patch_socket(dns=dns, aggressive=aggressive) + if select: + patch_select(aggressive=aggressive) + if ssl: + patch_ssl(_warnings=_warnings, _first_time=first_time) + if httplib: + raise ValueError('gevent.httplib is no longer provided, httplib must be False') + if subprocess: + patch_subprocess() + if builtins: + patch_builtins() + if signal: + patch_signal() + if queue: + patch_queue() + + _notify_patch(events.GeventDidPatchBuiltinModulesEvent(modules_to_patch, kwargs), _warnings) + _notify_patch(events.GeventDidPatchAllEvent(modules_to_patch, kwargs), _warnings) + + _process_warnings(_warnings) + return True + + +def main(): + args = {} + argv = sys.argv[1:] + verbose = False + script_help, patch_all_args, modules = _get_script_help() + while argv and argv[0].startswith('--'): + option = argv[0][2:] + if option == 'verbose': + verbose = True + elif option.startswith('no-') and option.replace('no-', '') in patch_all_args: + args[option[3:]] = False + elif option in patch_all_args: + args[option] = True + if option in modules: + for module in modules: + args.setdefault(module, False) + else: + sys.exit(script_help + '\n\n' + 'Cannot patch %r' % option) + del argv[0] + # TODO: break on -- + if verbose: + import pprint + import os + print('gevent.monkey.patch_all(%s)' % ', '.join('%s=%s' % item for item in args.items())) + print('sys.version=%s' % (sys.version.strip().replace('\n', ' '), )) + print('sys.path=%s' % pprint.pformat(sys.path)) + print('sys.modules=%s' % pprint.pformat(sorted(sys.modules.keys()))) + print('cwd=%s' % os.getcwd()) + + patch_all(**args) + if argv: + sys.argv = argv + import runpy + # Use runpy.run_path to closely (exactly) match what the + # interpreter does given 'python '. This includes allowing + # passing .pyc/.pyo files and packages with a __main__ and + # potentially even zip files. Previously we used exec, which only + # worked if we directly read a python source file. + runpy.run_path(sys.argv[0], + run_name='__main__') + else: + print(script_help) + + +def _get_script_help(): + # pylint:disable=deprecated-method + import inspect + try: + getter = inspect.getfullargspec # deprecated in 3.5, un-deprecated in 3.6 + except AttributeError: + getter = inspect.getargspec + patch_all_args = getter(patch_all)[0] + modules = [x for x in patch_all_args if 'patch_' + x in globals()] + script_help = """gevent.monkey - monkey patch the standard modules to use gevent. + +USAGE: ``python -m gevent.monkey [MONKEY OPTIONS] script [SCRIPT OPTIONS]`` + +If no OPTIONS present, monkey patches all the modules it can patch. +You can exclude a module with --no-module, e.g. --no-thread. You can +specify a module to patch with --module, e.g. --socket. In the latter +case only the modules specified on the command line will be patched. + +.. versionchanged:: 1.3b1 + The *script* argument can now be any argument that can be passed to `runpy.run_path`, + just like the interpreter itself does, for example a package directory containing ``__main__.py``. + Previously it had to be the path to + a .py source file. + +MONKEY OPTIONS: ``--verbose %s``""" % ', '.join('--[no-]%s' % m for m in modules) + return script_help, patch_all_args, modules + +main.__doc__ = _get_script_help()[0] + +if __name__ == '__main__': + main() diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/os.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/os.py new file mode 100644 index 00000000..3980f320 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/os.py @@ -0,0 +1,510 @@ +""" +Low-level operating system functions from :mod:`os`. + +Cooperative I/O +=============== + +This module provides cooperative versions of :func:`os.read` and +:func:`os.write`. These functions are *not* monkey-patched; you +must explicitly call them or monkey patch them yourself. + +POSIX functions +--------------- + +On POSIX, non-blocking IO is available. + +- :func:`nb_read` +- :func:`nb_write` +- :func:`make_nonblocking` + +All Platforms +------------- + +On non-POSIX platforms (e.g., Windows), non-blocking IO is not +available. On those platforms (and on POSIX), cooperative IO can +be done with the threadpool. + +- :func:`tp_read` +- :func:`tp_write` + +Child Processes +=============== + +The functions :func:`fork` and (on POSIX) :func:`forkpty` and :func:`waitpid` can be used +to manage child processes. + +.. warning:: + + Forking a process that uses greenlets does not eliminate all non-running + greenlets. Any that were scheduled in the hub of the forking thread in the parent + remain scheduled in the child; compare this to how normal threads operate. (This behaviour + may change is a subsequent major release.) +""" + +from __future__ import absolute_import + +import os +import sys +from gevent.hub import _get_hub_noargs as get_hub +from gevent.hub import reinit +from gevent._config import config +from gevent._compat import PY3 +from gevent._util import copy_globals +import errno + +EAGAIN = getattr(errno, 'EAGAIN', 11) + +try: + import fcntl +except ImportError: + fcntl = None + +__implements__ = ['fork'] +__extensions__ = ['tp_read', 'tp_write'] + +_read = os.read +_write = os.write + + +ignored_errors = [EAGAIN, errno.EINTR] + + +if fcntl: + + __extensions__ += ['make_nonblocking', 'nb_read', 'nb_write'] + + def make_nonblocking(fd): + """Put the file descriptor *fd* into non-blocking mode if + possible. + + :return: A boolean value that evaluates to True if successful. + """ + flags = fcntl.fcntl(fd, fcntl.F_GETFL, 0) + if not bool(flags & os.O_NONBLOCK): + fcntl.fcntl(fd, fcntl.F_SETFL, flags | os.O_NONBLOCK) + return True + + def nb_read(fd, n): + """ + Read up to *n* bytes from file descriptor *fd*. Return a + byte string containing the bytes read, which may be shorter than + *n*. If end-of-file is reached, an empty string is returned. + + The descriptor must be in non-blocking mode. + """ + hub = None + event = None + try: + while 1: + try: + result = _read(fd, n) + return result + except OSError as e: + if e.errno not in ignored_errors: + raise + if not PY3: + sys.exc_clear() + if hub is None: + hub = get_hub() + event = hub.loop.io(fd, 1) + hub.wait(event) + finally: + if event is not None: + event.close() + event = None + hub = None + + + def nb_write(fd, buf): + """ + Write some number of bytes from buffer *buf* to file + descriptor *fd*. Return the number of bytes written, which may + be less than the length of *buf*. + + The file descriptor must be in non-blocking mode. + """ + hub = None + event = None + try: + while 1: + try: + result = _write(fd, buf) + return result + except OSError as e: + if e.errno not in ignored_errors: + raise + if not PY3: + sys.exc_clear() + if hub is None: + hub = get_hub() + event = hub.loop.io(fd, 2) + hub.wait(event) + finally: + if event is not None: + event.close() + event = None + hub = None + + +def tp_read(fd, n): + """Read up to *n* bytes from file descriptor *fd*. Return a string + containing the bytes read. If end-of-file is reached, an empty string + is returned. + + Reading is done using the threadpool. + """ + return get_hub().threadpool.apply(_read, (fd, n)) + + +def tp_write(fd, buf): + """Write bytes from buffer *buf* to file descriptor *fd*. Return the + number of bytes written. + + Writing is done using the threadpool. + """ + return get_hub().threadpool.apply(_write, (fd, buf)) + + +if hasattr(os, 'fork'): + # pylint:disable=function-redefined,redefined-outer-name + + _raw_fork = os.fork + + def fork_gevent(): + """ + Forks the process using :func:`os.fork` and prepares the + child process to continue using gevent before returning. + + .. note:: + + The PID returned by this function may not be waitable with + either the original :func:`os.waitpid` or this module's + :func:`waitpid` and it may not generate SIGCHLD signals if + libev child watchers are or ever have been in use. For + example, the :mod:`gevent.subprocess` module uses libev + child watchers (which parts of gevent use libev child + watchers is subject to change at any time). Most + applications should use :func:`fork_and_watch`, which is + monkey-patched as the default replacement for + :func:`os.fork` and implements the ``fork`` function of + this module by default, unless the environment variable + ``GEVENT_NOWAITPID`` is defined before this module is + imported. + + .. versionadded:: 1.1b2 + """ + result = _raw_fork() + if not result: + reinit() + return result + + def fork(): + """ + A wrapper for :func:`fork_gevent` for non-POSIX platforms. + """ + return fork_gevent() + + if hasattr(os, 'forkpty'): + _raw_forkpty = os.forkpty + + def forkpty_gevent(): + """ + Forks the process using :func:`os.forkpty` and prepares the + child process to continue using gevent before returning. + + Returns a tuple (pid, master_fd). The `master_fd` is *not* put into + non-blocking mode. + + Availability: Some Unix systems. + + .. seealso:: This function has the same limitations as :func:`fork_gevent`. + + .. versionadded:: 1.1b5 + """ + pid, master_fd = _raw_forkpty() + if not pid: + reinit() + return pid, master_fd + + forkpty = forkpty_gevent + + __implements__.append('forkpty') + __extensions__.append("forkpty_gevent") + + if hasattr(os, 'WNOWAIT') or hasattr(os, 'WNOHANG'): + # We can only do this on POSIX + import time + + _waitpid = os.waitpid + _WNOHANG = os.WNOHANG + + # replaced by the signal module. + _on_child_hook = lambda: None + + # {pid -> watcher or tuple(pid, rstatus, timestamp)} + _watched_children = {} + + def _on_child(watcher, callback): + # XXX: Could handle tracing here by not stopping + # until the pid is terminated + watcher.stop() + try: + _watched_children[watcher.pid] = (watcher.pid, watcher.rstatus, time.time()) + if callback: + callback(watcher) + # dispatch an "event"; used by gevent.signal.signal + _on_child_hook() + # now is as good a time as any to reap children + _reap_children() + finally: + watcher.close() + + def _reap_children(timeout=60): + # Remove all the dead children that haven't been waited on + # for the *timeout* seconds. + # Some platforms queue delivery of SIGCHLD for all children that die; + # in that case, a well-behaved application should call waitpid() for each + # signal. + # Some platforms (linux) only guarantee one delivery if multiple children + # die. On that platform, the well-behave application calls waitpid() in a loop + # until it gets back -1, indicating no more dead children need to be waited for. + # In either case, waitpid should be called the same number of times as dead children, + # thus removing all the watchers when a SIGCHLD arrives. The (generous) timeout + # is to work with applications that neglect to call waitpid and prevent "unlimited" + # growth. + # Note that we don't watch for the case of pid wraparound. That is, we fork a new + # child with the same pid as an existing watcher, but the child is already dead, + # just not waited on yet. + now = time.time() + oldest_allowed = now - timeout + dead = [pid for pid, val + in _watched_children.items() + if isinstance(val, tuple) and val[2] < oldest_allowed] + for pid in dead: + del _watched_children[pid] + + def waitpid(pid, options): + """ + Wait for a child process to finish. + + If the child process was spawned using + :func:`fork_and_watch`, then this function behaves + cooperatively. If not, it *may* have race conditions; see + :func:`fork_gevent` for more information. + + The arguments are as for the underlying + :func:`os.waitpid`. Some combinations of *options* may not + be supported cooperatively (as of 1.1 that includes + WUNTRACED). Using a *pid* of 0 to request waiting on only processes + from the current process group is not cooperative. + + Availability: POSIX. + + .. versionadded:: 1.1b1 + .. versionchanged:: 1.2a1 + More cases are handled in a cooperative manner. + """ + # pylint: disable=too-many-return-statements + # XXX Does not handle tracing children + + # So long as libev's loop doesn't run, it's OK to add + # child watchers. The SIGCHLD handler only feeds events + # for the next iteration of the loop to handle. (And the + # signal handler itself is only called from the next loop + # iteration.) + + if pid <= 0: + # magic functions for multiple children. + if pid == -1: + # Any child. If we have one that we're watching and that finished, + # we will use that one. Otherwise, let the OS take care of it. + for k, v in _watched_children.items(): + if isinstance(v, tuple): + pid = k + break + if pid <= 0: + # We didn't have one that was ready. If there are + # no funky options set, and the pid was -1 + # (meaning any process, not 0, which means process + # group--- libev doesn't know about process + # groups) then we can use a child watcher of pid 0; otherwise, + # pass through to the OS. + if pid == -1 and options == 0: + hub = get_hub() + with hub.loop.child(0, False) as watcher: + hub.wait(watcher) + return watcher.rpid, watcher.rstatus + # There were funky options/pid, so we must go to the OS. + return _waitpid(pid, options) + + if pid in _watched_children: + # yes, we're watching it + + # Note that the remainder of this code must be careful to NOT + # yield to the event loop except at well known times, or + # we have a race condition between the _on_child callback and the + # code here that could lead to a process to hang. + if options & _WNOHANG or isinstance(_watched_children[pid], tuple): + # We're either asked not to block, or it already finished, in which + # case blocking doesn't matter + result = _watched_children[pid] + if isinstance(result, tuple): + # it finished. libev child watchers + # are one-shot + del _watched_children[pid] + return result[:2] + # it's not finished + return (0, 0) + + # Ok, we need to "block". Do so via a watcher so that we're + # cooperative. We know it's our child, etc, so this should work. + watcher = _watched_children[pid] + # We can't start a watcher that's already started, + # so we can't reuse the existing watcher. Notice that the + # old watcher must not have fired already, or during this time, but + # only after we successfully `start()` the watcher. So this must + # not yield to the event loop. + with watcher.loop.child(pid, False) as new_watcher: + get_hub().wait(new_watcher) + # Ok, so now the new watcher is done. That means + # the old watcher's callback (_on_child) should + # have fired, potentially taking this child out of + # _watched_children (but that could depend on how + # many callbacks there were to run, so use the + # watcher object directly; libev sets all the + # watchers at the same time). + return watcher.rpid, watcher.rstatus + + # we're not watching it and it may not even be our child, + # so we must go to the OS to be sure to get the right semantics (exception) + # XXX + # libuv has a race condition because the signal + # handler is a Python function, so the InterruptedError + # is raised before the signal handler runs and calls the + # child watcher + # we're not watching it + return _waitpid(pid, options) + + def fork_and_watch(callback=None, loop=None, ref=False, fork=fork_gevent): + """ + Fork a child process and start a child watcher for it in the parent process. + + This call cooperates with :func:`waitpid` to enable cooperatively waiting + for children to finish. When monkey-patching, these functions are patched in as + :func:`os.fork` and :func:`os.waitpid`, respectively. + + In the child process, this function calls :func:`gevent.hub.reinit` before returning. + + Availability: POSIX. + + :keyword callback: If given, a callable that will be called with the child watcher + when the child finishes. + :keyword loop: The loop to start the watcher in. Defaults to the + loop of the current hub. + :keyword fork: The fork function. Defaults to :func:`the one defined in this + module ` (which automatically calls :func:`gevent.hub.reinit`). + Pass the builtin :func:`os.fork` function if you do not need to + initialize gevent in the child process. + + .. versionadded:: 1.1b1 + .. seealso:: + :func:`gevent.monkey.get_original` To access the builtin :func:`os.fork`. + """ + pid = fork() + if pid: + # parent + loop = loop or get_hub().loop + watcher = loop.child(pid, ref=ref) + _watched_children[pid] = watcher + watcher.start(_on_child, watcher, callback) + return pid + + __extensions__.append('fork_and_watch') + __extensions__.append('fork_gevent') + + if 'forkpty' in __implements__: + def forkpty_and_watch(callback=None, loop=None, ref=False, forkpty=forkpty_gevent): + """ + Like :func:`fork_and_watch`, except using :func:`forkpty_gevent`. + + Availability: Some Unix systems. + + .. versionadded:: 1.1b5 + """ + result = [] + + def _fork(): + pid_and_fd = forkpty() + result.append(pid_and_fd) + return pid_and_fd[0] + fork_and_watch(callback, loop, ref, _fork) + return result[0] + + __extensions__.append('forkpty_and_watch') + + # Watch children by default + if not config.disable_watch_children: + # Broken out into separate functions instead of simple name aliases + # for documentation purposes. + def fork(*args, **kwargs): + """ + Forks a child process and starts a child watcher for it in the + parent process so that ``waitpid`` and SIGCHLD work as expected. + + This implementation of ``fork`` is a wrapper for :func:`fork_and_watch` + when the environment variable ``GEVENT_NOWAITPID`` is *not* defined. + This is the default and should be used by most applications. + + .. versionchanged:: 1.1b2 + """ + # take any args to match fork_and_watch + return fork_and_watch(*args, **kwargs) + + if 'forkpty' in __implements__: + def forkpty(*args, **kwargs): + """ + Like :func:`fork`, but using :func:`forkpty_gevent`. + + This implementation of ``forkpty`` is a wrapper for :func:`forkpty_and_watch` + when the environment variable ``GEVENT_NOWAITPID`` is *not* defined. + This is the default and should be used by most applications. + + .. versionadded:: 1.1b5 + """ + # take any args to match fork_and_watch + return forkpty_and_watch(*args, **kwargs) + __implements__.append("waitpid") + else: + def fork(): + """ + Forks a child process, initializes gevent in the child, + but *does not* prepare the parent to wait for the child or receive SIGCHLD. + + This implementation of ``fork`` is a wrapper for :func:`fork_gevent` + when the environment variable ``GEVENT_NOWAITPID`` *is* defined. + This is not recommended for most applications. + """ + return fork_gevent() + + if 'forkpty' in __implements__: + def forkpty(): + """ + Like :func:`fork`, but using :func:`os.forkpty` + + This implementation of ``forkpty`` is a wrapper for :func:`forkpty_gevent` + when the environment variable ``GEVENT_NOWAITPID`` *is* defined. + This is not recommended for most applications. + + .. versionadded:: 1.1b5 + """ + return forkpty_gevent() + __extensions__.append("waitpid") + +else: + __implements__.remove('fork') + +__imports__ = copy_globals(os, globals(), + names_to_ignore=__implements__ + __extensions__, + dunder_names_to_keep=()) + +__all__ = list(set(__implements__ + __extensions__)) diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/pool.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/pool.py new file mode 100644 index 00000000..bed3ff40 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/pool.py @@ -0,0 +1,675 @@ +# Copyright (c) 2009-2011 Denis Bilenko. See LICENSE for details. +""" +Managing greenlets in a group. + +The :class:`Group` class in this module abstracts a group of running +greenlets. When a greenlet dies, it's automatically removed from the +group. All running greenlets in a group can be waited on with +:meth:`Group.join`, or all running greenlets can be killed with +:meth:`Group.kill`. + +The :class:`Pool` class, which is a subclass of :class:`Group`, +provides a way to limit concurrency: its :meth:`spawn ` +method blocks if the number of greenlets in the pool has already +reached the limit, until there is a free slot. +""" +from __future__ import print_function, absolute_import, division + + +from gevent.hub import GreenletExit, getcurrent, kill as _kill +from gevent.greenlet import joinall, Greenlet +from gevent.queue import Full as QueueFull +from gevent.timeout import Timeout +from gevent.event import Event +from gevent.lock import Semaphore, DummySemaphore + +from gevent._compat import izip +from gevent._imap import IMap +from gevent._imap import IMapUnordered + +__all__ = [ + 'Group', + 'Pool', + 'PoolFull', +] + + + + +class GroupMappingMixin(object): + # Internal, non-public API class. + # Provides mixin methods for implementing mapping pools. Subclasses must define: + + def spawn(self, func, *args, **kwargs): + """ + A function that runs *func* with *args* and *kwargs*, potentially + asynchronously. Return a value with a ``get`` method that blocks + until the results of func are available, and a ``rawlink`` method + that calls a callback when the results are available. + + If this object has an upper bound on how many asyncronously executing + tasks can exist, this method may block until a slot becomes available. + """ + raise NotImplementedError() + + def _apply_immediately(self): + """ + should the function passed to apply be called immediately, + synchronously? + """ + raise NotImplementedError() + + def _apply_async_use_greenlet(self): + """ + Should apply_async directly call Greenlet.spawn(), bypassing + `spawn`? + + Return true when self.spawn would block. + """ + raise NotImplementedError() + + def _apply_async_cb_spawn(self, callback, result): + """ + Run the given callback function, possibly + asynchronously, possibly synchronously. + """ + raise NotImplementedError() + + def apply_cb(self, func, args=None, kwds=None, callback=None): + """ + :meth:`apply` the given *func(\\*args, \\*\\*kwds)*, and, if a *callback* is given, run it with the + results of *func* (unless an exception was raised.) + + The *callback* may be called synchronously or asynchronously. If called + asynchronously, it will not be tracked by this group. (:class:`Group` and :class:`Pool` + call it asynchronously in a new greenlet; :class:`~gevent.threadpool.ThreadPool` calls + it synchronously in the current greenlet.) + """ + result = self.apply(func, args, kwds) + if callback is not None: + self._apply_async_cb_spawn(callback, result) + return result + + def apply_async(self, func, args=None, kwds=None, callback=None): + """ + A variant of the :meth:`apply` method which returns a :class:`~.Greenlet` object. + + When the returned greenlet gets to run, it *will* call :meth:`apply`, + passing in *func*, *args* and *kwds*. + + If *callback* is specified, then it should be a callable which + accepts a single argument. When the result becomes ready + callback is applied to it (unless the call failed). + + This method will never block, even if this group is full (that is, + even if :meth:`spawn` would block, this method will not). + + .. caution:: The returned greenlet may or may not be tracked + as part of this group, so :meth:`joining ` this group is + not a reliable way to wait for the results to be available or + for the returned greenlet to run; instead, join the returned + greenlet. + + .. tip:: Because :class:`~.ThreadPool` objects do not track greenlets, the returned + greenlet will never be a part of it. To reduce overhead and improve performance, + :class:`Group` and :class:`Pool` may choose to track the returned + greenlet. These are implementation details that may change. + """ + if args is None: + args = () + if kwds is None: + kwds = {} + if self._apply_async_use_greenlet(): + # cannot call self.spawn() directly because it will block + # XXX: This is always the case for ThreadPool, but for Group/Pool + # of greenlets, this is only the case when they are full...hence + # the weasely language about "may or may not be tracked". Should we make + # Group/Pool always return true as well so it's never tracked by any + # implementation? That would simplify that logic, but could increase + # the total number of greenlets in the system and add a layer of + # overhead for the simple cases when the pool isn't full. + return Greenlet.spawn(self.apply_cb, func, args, kwds, callback) + + greenlet = self.spawn(func, *args, **kwds) + if callback is not None: + greenlet.link(pass_value(callback)) + return greenlet + + def apply(self, func, args=None, kwds=None): + """ + Rough quivalent of the :func:`apply()` builtin function blocking until + the result is ready and returning it. + + The ``func`` will *usually*, but not *always*, be run in a way + that allows the current greenlet to switch out (for example, + in a new greenlet or thread, depending on implementation). But + if the current greenlet or thread is already one that was + spawned by this pool, the pool may choose to immediately run + the `func` synchronously. + + Any exception ``func`` raises will be propagated to the caller of ``apply`` (that is, + this method will raise the exception that ``func`` raised). + """ + if args is None: + args = () + if kwds is None: + kwds = {} + if self._apply_immediately(): + return func(*args, **kwds) + return self.spawn(func, *args, **kwds).get() + + def __map(self, func, iterable): + return [g.get() for g in + [self.spawn(func, i) for i in iterable]] + + def map(self, func, iterable): + """Return a list made by applying the *func* to each element of + the iterable. + + .. seealso:: :meth:`imap` + """ + # We can't return until they're all done and in order. It + # wouldn't seem to much matter what order we wait on them in, + # so the simple, fast (50% faster than imap) solution would be: + + # return [g.get() for g in + # [self.spawn(func, i) for i in iterable]] + + # If the pool size is unlimited (or more than the len(iterable)), this + # is equivalent to imap (spawn() will never block, all of them run concurrently, + # we call get() in the order the iterable was given). + + # Now lets imagine the pool if is limited size. Suppose the + # func is time.sleep, our pool is limited to 3 threads, and + # our input is [10, 1, 10, 1, 1] We would start three threads, + # one to sleep for 10, one to sleep for 1, and the last to + # sleep for 10. We would block starting the fourth thread. At + # time 1, we would finish the second thread and start another + # one for time 1. At time 2, we would finish that one and + # start the last thread, and then begin executing get() on the first + # thread. + + # Because it's spawn that blocks, this is *also* equivalent to what + # imap would do. + + # The one remaining difference is that imap runs in its own + # greenlet, potentially changing the way the event loop runs. + # That's easy enough to do. + + g = Greenlet.spawn(self.__map, func, iterable) + return g.get() + + def map_cb(self, func, iterable, callback=None): + result = self.map(func, iterable) + if callback is not None: + callback(result) + return result + + def map_async(self, func, iterable, callback=None): + """ + A variant of the map() method which returns a Greenlet object that is executing + the map function. + + If callback is specified then it should be a callable which accepts a + single argument. + """ + return Greenlet.spawn(self.map_cb, func, iterable, callback) + + def __imap(self, cls, func, *iterables, **kwargs): + # Python 2 doesn't support the syntax that lets us mix varargs and + # a named kwarg, so we have to unpack manually + maxsize = kwargs.pop('maxsize', None) + if kwargs: + raise TypeError("Unsupported keyword arguments") + return cls.spawn(func, izip(*iterables), spawn=self.spawn, + _zipped=True, maxsize=maxsize) + + def imap(self, func, *iterables, **kwargs): + """ + imap(func, *iterables, maxsize=None) -> iterable + + An equivalent of :func:`itertools.imap`, operating in parallel. + The *func* is applied to each element yielded from each + iterable in *iterables* in turn, collecting the result. + + If this object has a bound on the number of active greenlets it can + contain (such as :class:`Pool`), then at most that number of tasks will operate + in parallel. + + :keyword int maxsize: If given and not-None, specifies the maximum number of + finished results that will be allowed to accumulate awaiting the reader; + more than that number of results will cause map function greenlets to begin + to block. This is most useful if there is a great disparity in the speed of + the mapping code and the consumer and the results consume a great deal of resources. + + .. note:: This is separate from any bound on the number of active parallel + tasks, though they may have some interaction (for example, limiting the + number of parallel tasks to the smallest bound). + + .. note:: Using a bound is slightly more computationally expensive than not using a bound. + + .. tip:: The :meth:`imap_unordered` method makes much better + use of this parameter. Some additional, unspecified, + number of objects may be required to be kept in memory + to maintain order by this function. + + :return: An iterable object. + + .. versionchanged:: 1.1b3 + Added the *maxsize* keyword parameter. + .. versionchanged:: 1.1a1 + Accept multiple *iterables* to iterate in parallel. + """ + return self.__imap(IMap, func, *iterables, **kwargs) + + def imap_unordered(self, func, *iterables, **kwargs): + """ + imap_unordered(func, *iterables, maxsize=None) -> iterable + + The same as :meth:`imap` except that the ordering of the results + from the returned iterator should be considered in arbitrary + order. + + This is lighter weight than :meth:`imap` and should be preferred if order + doesn't matter. + + .. seealso:: :meth:`imap` for more details. + """ + return self.__imap(IMapUnordered, func, *iterables, **kwargs) + + +class Group(GroupMappingMixin): + """ + Maintain a group of greenlets that are still running, without + limiting their number. + + Links to each item and removes it upon notification. + + Groups can be iterated to discover what greenlets they are tracking, + they can be tested to see if they contain a greenlet, and they know the + number (len) of greenlets they are tracking. If they are not tracking any + greenlets, they are False in a boolean context. + + .. attribute:: greenlet_class + + Either :class:`gevent.Greenlet` (the default) or a subclass. + These are the type of + object we will :meth:`spawn`. This can be + changed on an instance or in a subclass. + """ + + greenlet_class = Greenlet + + def __init__(self, *args): + assert len(args) <= 1, args + self.greenlets = set(*args) + if args: + for greenlet in args[0]: + greenlet.rawlink(self._discard) + # each item we kill we place in dying, to avoid killing the same greenlet twice + self.dying = set() + self._empty_event = Event() + self._empty_event.set() + + def __repr__(self): + return '<%s at 0x%x %s>' % (self.__class__.__name__, id(self), self.greenlets) + + def __len__(self): + """ + Answer how many greenlets we are tracking. Note that if we are empty, + we are False in a boolean context. + """ + return len(self.greenlets) + + def __contains__(self, item): + """ + Answer if we are tracking the given greenlet. + """ + return item in self.greenlets + + def __iter__(self): + """ + Iterate across all the greenlets we are tracking, in no particular order. + """ + return iter(self.greenlets) + + def add(self, greenlet): + """ + Begin tracking the *greenlet*. + + If this group is :meth:`full`, then this method may block + until it is possible to track the greenlet. + + Typically the *greenlet* should **not** be started when + it is added because if this object blocks in this method, + then the *greenlet* may run to completion before it is tracked. + """ + try: + rawlink = greenlet.rawlink + except AttributeError: + pass # non-Greenlet greenlet, like MAIN + else: + rawlink(self._discard) + self.greenlets.add(greenlet) + self._empty_event.clear() + + def _discard(self, greenlet): + self.greenlets.discard(greenlet) + self.dying.discard(greenlet) + if not self.greenlets: + self._empty_event.set() + + def discard(self, greenlet): + """ + Stop tracking the greenlet. + """ + self._discard(greenlet) + try: + unlink = greenlet.unlink + except AttributeError: + pass # non-Greenlet greenlet, like MAIN + else: + unlink(self._discard) + + def start(self, greenlet): + """ + Add the **unstarted** *greenlet* to the collection of greenlets + this group is monitoring, and then start it. + """ + self.add(greenlet) + greenlet.start() + + def spawn(self, *args, **kwargs): # pylint:disable=arguments-differ + """ + Begin a new greenlet with the given arguments (which are passed + to the greenlet constructor) and add it to the collection of greenlets + this group is monitoring. + + :return: The newly started greenlet. + """ + greenlet = self.greenlet_class(*args, **kwargs) + self.start(greenlet) + return greenlet + +# def close(self): +# """Prevents any more tasks from being submitted to the pool""" +# self.add = RaiseException("This %s has been closed" % self.__class__.__name__) + + def join(self, timeout=None, raise_error=False): + """ + Wait for this group to become empty *at least once*. + + If there are no greenlets in the group, returns immediately. + + .. note:: By the time the waiting code (the caller of this + method) regains control, a greenlet may have been added to + this group, and so this object may no longer be empty. (That + is, ``group.join(); assert len(group) == 0`` is not + guaranteed to hold.) This method only guarantees that the group + reached a ``len`` of 0 at some point. + + :keyword bool raise_error: If True (*not* the default), if any + greenlet that finished while the join was in progress raised + an exception, that exception will be raised to the caller of + this method. If multiple greenlets raised exceptions, which + one gets re-raised is not determined. Only greenlets currently + in the group when this method is called are guaranteed to + be checked for exceptions. + + :return bool: A value indicating whether this group became empty. + If the timeout is specified and the group did not become empty + during that timeout, then this will be a false value. Otherwise + it will be a true value. + + .. versionchanged:: 1.2a1 + Add the return value. + """ + greenlets = list(self.greenlets) if raise_error else () + result = self._empty_event.wait(timeout=timeout) + + for greenlet in greenlets: + if greenlet.exception is not None: + if hasattr(greenlet, '_raise_exception'): + greenlet._raise_exception() + raise greenlet.exception + + return result + + def kill(self, exception=GreenletExit, block=True, timeout=None): + """ + Kill all greenlets being tracked by this group. + """ + timer = Timeout._start_new_or_dummy(timeout) + try: + while self.greenlets: + for greenlet in list(self.greenlets): + if greenlet in self.dying: + continue + try: + kill = greenlet.kill + except AttributeError: + _kill(greenlet, exception) + else: + kill(exception, block=False) + self.dying.add(greenlet) + if not block: + break + joinall(self.greenlets) + except Timeout as ex: + if ex is not timer: + raise + finally: + timer.cancel() + + def killone(self, greenlet, exception=GreenletExit, block=True, timeout=None): + """ + If the given *greenlet* is running and being tracked by this group, + kill it. + """ + if greenlet not in self.dying and greenlet in self.greenlets: + greenlet.kill(exception, block=False) + self.dying.add(greenlet) + if block: + greenlet.join(timeout) + + def full(self): + """ + Return a value indicating whether this group can track more greenlets. + + In this implementation, because there are no limits on the number of + tracked greenlets, this will always return a ``False`` value. + """ + return False + + def wait_available(self, timeout=None): + """ + Block until it is possible to :meth:`spawn` a new greenlet. + + In this implementation, because there are no limits on the number + of tracked greenlets, this will always return immediately. + """ + + # MappingMixin methods + + def _apply_immediately(self): + # If apply() is called from one of our own + # worker greenlets, don't spawn a new one---if we're full, that + # could deadlock. + return getcurrent() in self + + def _apply_async_cb_spawn(self, callback, result): + Greenlet.spawn(callback, result) + + def _apply_async_use_greenlet(self): + # cannot call self.spawn() because it will block, so + # use a fresh, untracked greenlet that when run will + # (indirectly) call self.spawn() for us. + return self.full() + + + +class PoolFull(QueueFull): + """ + Raised when a Pool is full and an attempt was made to + add a new greenlet to it in non-blocking mode. + """ + + +class Pool(Group): + + def __init__(self, size=None, greenlet_class=None): + """ + Create a new pool. + + A pool is like a group, but the maximum number of members + is governed by the *size* parameter. + + :keyword int size: If given, this non-negative integer is the + maximum count of active greenlets that will be allowed in + this pool. A few values have special significance: + + * `None` (the default) places no limit on the number of + greenlets. This is useful when you want to track, but not limit, + greenlets. In general, a :class:`Group` + may be a more efficient way to achieve the same effect, but some things + need the additional abilities of this class (one example being the *spawn* + parameter of :class:`gevent.baseserver.BaseServer` and + its subclass :class:`gevent.pywsgi.WSGIServer`). + + * ``0`` creates a pool that can never have any active greenlets. Attempting + to spawn in this pool will block forever. This is only useful + if an application uses :meth:`wait_available` with a timeout and checks + :meth:`free_count` before attempting to spawn. + """ + if size is not None and size < 0: + raise ValueError('size must not be negative: %r' % (size, )) + Group.__init__(self) + self.size = size + if greenlet_class is not None: + self.greenlet_class = greenlet_class + if size is None: + factory = DummySemaphore + else: + factory = Semaphore + self._semaphore = factory(size) + + def wait_available(self, timeout=None): + """ + Wait until it's possible to spawn a greenlet in this pool. + + :param float timeout: If given, only wait the specified number + of seconds. + + .. warning:: If the pool was initialized with a size of 0, this + method will block forever unless a timeout is given. + + :return: A number indicating how many new greenlets can be put into + the pool without blocking. + + .. versionchanged:: 1.1a3 + Added the ``timeout`` parameter. + """ + return self._semaphore.wait(timeout=timeout) + + def full(self): + """ + Return a boolean indicating whether this pool is full, e.g. if + :meth:`add` would block. + + :return: False if there is room for new members, True if there isn't. + """ + return self.free_count() <= 0 + + def free_count(self): + """ + Return a number indicating *approximately* how many more members + can be added to this pool. + """ + if self.size is None: + return 1 + return max(0, self.size - len(self)) + + def start(self, greenlet, *args, **kwargs): # pylint:disable=arguments-differ + """ + start(greenlet, blocking=True, timeout=None) -> None + + Add the **unstarted** *greenlet* to the collection of greenlets + this group is monitoring and then start it. + + Parameters are as for :meth:`add`. + """ + self.add(greenlet, *args, **kwargs) + greenlet.start() + + def add(self, greenlet, blocking=True, timeout=None): # pylint:disable=arguments-differ + """ + Begin tracking the given **unstarted** greenlet, possibly blocking + until space is available. + + Usually you should call :meth:`start` to track and start the greenlet + instead of using this lower-level method, or :meth:`spawn` to + also create the greenlet. + + :keyword bool blocking: If True (the default), this function + will block until the pool has space or a timeout occurs. If + False, this function will immediately raise a Timeout if the + pool is currently full. + :keyword float timeout: The maximum number of seconds this + method will block, if ``blocking`` is True. (Ignored if + ``blocking`` is False.) + :raises PoolFull: if either ``blocking`` is False and the pool + was full, or if ``blocking`` is True and ``timeout`` was + exceeded. + + .. caution:: If the *greenlet* has already been started and + *blocking* is true, then the greenlet may run to completion + while the current greenlet blocks waiting to track it. This would + enable higher concurrency than desired. + + .. seealso:: :meth:`Group.add` + + .. versionchanged:: 1.3.0 Added the ``blocking`` and + ``timeout`` parameters. + """ + if not self._semaphore.acquire(blocking=blocking, timeout=timeout): + # We failed to acquire the semaphore. + # If blocking was True, then there was a timeout. If blocking was + # False, then there was no capacity. Either way, raise PoolFull. + raise PoolFull() + + try: + Group.add(self, greenlet) + except: + self._semaphore.release() + raise + + def _discard(self, greenlet): + Group._discard(self, greenlet) + self._semaphore.release() + + +class pass_value(object): + __slots__ = ['callback'] + + def __init__(self, callback): + self.callback = callback + + def __call__(self, source): + if source.successful(): + self.callback(source.value) + + def __hash__(self): + return hash(self.callback) + + def __eq__(self, other): + return self.callback == getattr(other, 'callback', other) + + def __str__(self): + return str(self.callback) + + def __repr__(self): + return repr(self.callback) + + def __getattr__(self, item): + assert item != 'callback' + return getattr(self.callback, item) diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/pywsgi.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/pywsgi.py new file mode 100644 index 00000000..5276eb5b --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/pywsgi.py @@ -0,0 +1,1549 @@ +# Copyright (c) 2005-2009, eventlet contributors +# Copyright (c) 2009-2018, gevent contributors +""" +A pure-Python, gevent-friendly WSGI server. + +The server is provided in :class:`WSGIServer`, but most of the actual +WSGI work is handled by :class:`WSGIHandler` --- a new instance is +created for each request. The server can be customized to use +different subclasses of :class:`WSGIHandler`. + +""" +from __future__ import absolute_import + +# FIXME: Can we refactor to make smallor? +# pylint:disable=too-many-lines + +import errno +from io import BytesIO +import string +import sys +import time +import traceback +from datetime import datetime + +try: + from urllib import unquote +except ImportError: + from urllib.parse import unquote # python 2 pylint:disable=import-error,no-name-in-module + +from gevent import socket +import gevent +from gevent.server import StreamServer +from gevent.hub import GreenletExit +from gevent._compat import PY3, reraise + +from functools import partial +if PY3: + unquote_latin1 = partial(unquote, encoding='latin-1') +else: + unquote_latin1 = unquote + +_no_undoc_members = True # Don't put undocumented things into sphinx + +__all__ = [ + 'WSGIServer', + 'WSGIHandler', + 'LoggingLogAdapter', + 'Environ', + 'SecureEnviron', + 'WSGISecureEnviron', +] + + +MAX_REQUEST_LINE = 8192 +# Weekday and month names for HTTP date/time formatting; always English! +_WEEKDAYNAME = ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"] +_MONTHNAME = [None, # Dummy so we can use 1-based month numbers + "Jan", "Feb", "Mar", "Apr", "May", "Jun", + "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"] + +# The contents of the "HEX" grammar rule for HTTP, upper and lowercase A-F plus digits, +# in byte form for comparing to the network. +_HEX = string.hexdigits.encode('ascii') + +# Errors +_ERRORS = dict() +_INTERNAL_ERROR_STATUS = '500 Internal Server Error' +_INTERNAL_ERROR_BODY = b'Internal Server Error' +_INTERNAL_ERROR_HEADERS = [('Content-Type', 'text/plain'), + ('Connection', 'close'), + ('Content-Length', str(len(_INTERNAL_ERROR_BODY)))] +_ERRORS[500] = (_INTERNAL_ERROR_STATUS, _INTERNAL_ERROR_HEADERS, _INTERNAL_ERROR_BODY) + +_BAD_REQUEST_STATUS = '400 Bad Request' +_BAD_REQUEST_BODY = '' +_BAD_REQUEST_HEADERS = [('Content-Type', 'text/plain'), + ('Connection', 'close'), + ('Content-Length', str(len(_BAD_REQUEST_BODY)))] +_ERRORS[400] = (_BAD_REQUEST_STATUS, _BAD_REQUEST_HEADERS, _BAD_REQUEST_BODY) + +_REQUEST_TOO_LONG_RESPONSE = b"HTTP/1.1 414 Request URI Too Long\r\nConnection: close\r\nContent-length: 0\r\n\r\n" +_BAD_REQUEST_RESPONSE = b"HTTP/1.1 400 Bad Request\r\nConnection: close\r\nContent-length: 0\r\n\r\n" +_CONTINUE_RESPONSE = b"HTTP/1.1 100 Continue\r\n\r\n" + + +def format_date_time(timestamp): + # Return a byte-string of the date and time in HTTP format + # .. versionchanged:: 1.1b5 + # Return a byte string, not a native string + year, month, day, hh, mm, ss, wd, _y, _z = time.gmtime(timestamp) + value = "%s, %02d %3s %4d %02d:%02d:%02d GMT" % (_WEEKDAYNAME[wd], day, _MONTHNAME[month], year, hh, mm, ss) + if PY3: + value = value.encode("latin-1") + return value + + +class _InvalidClientInput(IOError): + # Internal exception raised by Input indicating that the client + # sent invalid data at the lowest level of the stream. The result + # *should* be a HTTP 400 error. + pass + + +class _InvalidClientRequest(ValueError): + # Internal exception raised by WSGIHandler.read_request + # indicating that the client sent an HTTP request that cannot + # be parsed (e.g., invalid grammar). The result *should* be an + # HTTP 400 error + pass + + +class Input(object): + + __slots__ = ('rfile', 'content_length', 'socket', 'position', + 'chunked_input', 'chunk_length', '_chunked_input_error') + + def __init__(self, rfile, content_length, socket=None, chunked_input=False): + # pylint:disable=redefined-outer-name + self.rfile = rfile + self.content_length = content_length + self.socket = socket + self.position = 0 + self.chunked_input = chunked_input + self.chunk_length = -1 + self._chunked_input_error = False + + def _discard(self): + if self._chunked_input_error: + # We are in an unknown state, so we can't necessarily discard + # the body (e.g., if the client keeps the socket open, we could hang + # here forever). + # In this case, we've raised an exception and the user of this object + # is going to close the socket, so we don't have to discard + return + + if self.socket is None and (self.position < (self.content_length or 0) or self.chunked_input): + # ## Read and discard body + while 1: + d = self.read(16384) + if not d: + break + + def _send_100_continue(self): + if self.socket is not None: + self.socket.sendall(_CONTINUE_RESPONSE) + self.socket = None + + def _do_read(self, length=None, use_readline=False): + if use_readline: + reader = self.rfile.readline + else: + reader = self.rfile.read + content_length = self.content_length + if content_length is None: + # Either Content-Length or "Transfer-Encoding: chunked" must be present in a request with a body + # if it was chunked, then this function would have not been called + return b'' + + self._send_100_continue() + left = content_length - self.position + if length is None: + length = left + elif length > left: + length = left + if not length: + return b'' + + # On Python 2, self.rfile is usually socket.makefile(), which + # uses cStringIO.StringIO. If *length* is greater than the C + # sizeof(int) (typically 32 bits signed), parsing the argument to + # readline raises OverflowError. StringIO.read(), OTOH, uses + # PySize_t, typically a long (64 bits). In a bare readline() + # case, because the header lines we're trying to read with + # readline are typically expected to be small, we can correct + # that failure by simply doing a smaller call to readline and + # appending; failures in read we let propagate. + try: + read = reader(length) + except OverflowError: + if not use_readline: + # Expecting to read more than 64 bits of data. Ouch! + raise + # We could loop on calls to smaller readline(), appending them + # until we actually get a newline. For uses in this module, + # we expect the actual length to be small, but WSGI applications + # are allowed to pass in an arbitrary length. (This loop isn't optimal, + # but even client applications *probably* have short lines.) + read = b'' + while len(read) < length and not read.endswith(b'\n'): + read += reader(MAX_REQUEST_LINE) + + self.position += len(read) + if len(read) < length: + if (use_readline and not read.endswith(b"\n")) or not use_readline: + raise IOError("unexpected end of file while reading request at position %s" % (self.position,)) + + return read + + def __read_chunk_length(self, rfile): + # Read and return the next integer chunk length. If no + # chunk length can be read, raises _InvalidClientInput. + + # Here's the production for a chunk: + # (http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html) + # chunk = chunk-size [ chunk-extension ] CRLF + # chunk-data CRLF + # chunk-size = 1*HEX + # chunk-extension= *( ";" chunk-ext-name [ "=" chunk-ext-val ] ) + # chunk-ext-name = token + # chunk-ext-val = token | quoted-string + + # To cope with malicious or broken clients that fail to send valid + # chunk lines, the strategy is to read character by character until we either reach + # a ; or newline. If at any time we read a non-HEX digit, we bail. If we hit a + # ;, indicating an chunk-extension, we'll read up to the next + # MAX_REQUEST_LINE characters + # looking for the CRLF, and if we don't find it, we bail. If we read more than 16 hex characters, + # (the number needed to represent a 64-bit chunk size), we bail (this protects us from + # a client that sends an infinite stream of `F`, for example). + + buf = BytesIO() + while 1: + char = rfile.read(1) + if not char: + self._chunked_input_error = True + raise _InvalidClientInput("EOF before chunk end reached") + if char == b'\r': + break + if char == b';': + break + + if char not in _HEX: + self._chunked_input_error = True + raise _InvalidClientInput("Non-hex data", char) + buf.write(char) + if buf.tell() > 16: + self._chunked_input_error = True + raise _InvalidClientInput("Chunk-size too large.") + + if char == b';': + i = 0 + while i < MAX_REQUEST_LINE: + char = rfile.read(1) + if char == b'\r': + break + i += 1 + else: + # we read more than MAX_REQUEST_LINE without + # hitting CR + self._chunked_input_error = True + raise _InvalidClientInput("Too large chunk extension") + + if char == b'\r': + # We either got here from the main loop or from the + # end of an extension + char = rfile.read(1) + if char != b'\n': + self._chunked_input_error = True + raise _InvalidClientInput("Line didn't end in CRLF") + return int(buf.getvalue(), 16) + + def _chunked_read(self, length=None, use_readline=False): + # pylint:disable=too-many-branches + rfile = self.rfile + self._send_100_continue() + + if length == 0: + return b"" + + if use_readline: + reader = self.rfile.readline + else: + reader = self.rfile.read + + response = [] + while self.chunk_length != 0: + maxreadlen = self.chunk_length - self.position + if length is not None and length < maxreadlen: + maxreadlen = length + + if maxreadlen > 0: + data = reader(maxreadlen) + if not data: + self.chunk_length = 0 + self._chunked_input_error = True + raise IOError("unexpected end of file while parsing chunked data") + + datalen = len(data) + response.append(data) + + self.position += datalen + if self.chunk_length == self.position: + rfile.readline() + + if length is not None: + length -= datalen + if length == 0: + break + if use_readline and data[-1] == b"\n"[0]: + break + else: + # We're at the beginning of a chunk, so we need to + # determine the next size to read + self.chunk_length = self.__read_chunk_length(rfile) + self.position = 0 + if self.chunk_length == 0: + # Last chunk. Terminates with a CRLF. + rfile.readline() + return b''.join(response) + + def read(self, length=None): + if length is not None and length < 0: + length = None + if self.chunked_input: + return self._chunked_read(length) + return self._do_read(length) + + def readline(self, size=None): + if size is not None and size < 0: + size = None + if self.chunked_input: + return self._chunked_read(size, True) + return self._do_read(size, use_readline=True) + + def readlines(self, hint=None): + # pylint:disable=unused-argument + return list(self) + + def __iter__(self): + return self + + def next(self): + line = self.readline() + if not line: + raise StopIteration + return line + __next__ = next + + +try: + import mimetools + headers_factory = mimetools.Message +except ImportError: + # adapt Python 3 HTTP headers to old API + from http import client # pylint:disable=import-error + + class OldMessage(client.HTTPMessage): + def __init__(self, **kwargs): + super(client.HTTPMessage, self).__init__(**kwargs) # pylint:disable=bad-super-call + self.status = '' + + def getheader(self, name, default=None): + return self.get(name, default) + + @property + def headers(self): + for key, value in self._headers: + yield '%s: %s\r\n' % (key, value) + + @property + def typeheader(self): + return self.get('content-type') + + def headers_factory(fp, *args): # pylint:disable=unused-argument + try: + ret = client.parse_headers(fp, _class=OldMessage) + except client.LineTooLong: + ret = OldMessage() + ret.status = 'Line too long' + return ret + + +class WSGIHandler(object): + """ + Handles HTTP requests from a socket, creates the WSGI environment, and + interacts with the WSGI application. + + This is the default value of :attr:`WSGIServer.handler_class`. + This class may be subclassed carefully, and that class set on a + :class:`WSGIServer` instance through a keyword argument at + construction time. + + Instances are constructed with the same arguments as passed to the + server's :meth:`WSGIServer.handle` method followed by the server + itself. The application and environment are obtained from the server. + + """ + # pylint:disable=too-many-instance-attributes + + protocol_version = 'HTTP/1.1' + if PY3: + # if we do like Py2, then headers_factory unconditionally + # becomes a bound method, meaning the fp argument becomes WSGIHandler + def MessageClass(self, *args): + return headers_factory(*args) + else: + MessageClass = headers_factory + + # Attributes reset at various times for each request; not public + # documented. Class attributes to keep the constructor fast + # (but not make lint tools complain) + + status = None # byte string: b'200 OK' + _orig_status = None # native string: '200 OK' + response_headers = None # list of tuples (b'name', b'value') + code = None # Integer parsed from status + provided_date = None + provided_content_length = None + close_connection = False + time_start = 0 # time.time() when begin handling request + time_finish = 0 # time.time() when done handling request + headers_sent = False # Have we already sent headers? + response_use_chunked = False # Write with transfer-encoding chunked + environ = None # Dict from self.get_environ + application = None # application callable from self.server.application + requestline = None # native str 'GET / HTTP/1.1' + response_length = 0 # How much data we sent + result = None # The return value of the WSGI application + wsgi_input = None # Instance of Input() + content_length = 0 # From application-provided headers Incoming + # request headers, instance of MessageClass (gunicorn uses hasattr + # on this so the default value needs to be compatible with the + # API) + headers = headers_factory(BytesIO()) + request_version = None # str: 'HTTP 1.1' + command = None # str: 'GET' + path = None # str: '/' + + def __init__(self, sock, address, server, rfile=None): + # Deprecation: The rfile kwarg was introduced in 1.0a1 as part + # of a refactoring. It was never documented or used. It is + # considered DEPRECATED and may be removed in the future. Its + # use is not supported. + + self.socket = sock + self.client_address = address + self.server = server + if rfile is None: + self.rfile = sock.makefile('rb', -1) + else: + self.rfile = rfile + + def handle(self): + """ + The main request handling method, called by the server. + + This method runs a request handling loop, calling + :meth:`handle_one_request` until all requests on the + connection have been handled (that is, it implements + keep-alive). + """ + try: + while self.socket is not None: + self.time_start = time.time() + self.time_finish = 0 + + result = self.handle_one_request() + if result is None: + break + if result is True: + continue + + self.status, response_body = result + self.socket.sendall(response_body) + if self.time_finish == 0: + self.time_finish = time.time() + self.log_request() + break + finally: + if self.socket is not None: + _sock = getattr(self.socket, '_sock', None) # Python 3 + try: + # read out request data to prevent error: [Errno 104] Connection reset by peer + if _sock: + try: + # socket.recv would hang + _sock.recv(16384) + finally: + _sock.close() + self.socket.close() + except socket.error: + pass + self.__dict__.pop('socket', None) + self.__dict__.pop('rfile', None) + + def _check_http_version(self): + version_str = self.request_version + if not version_str.startswith("HTTP/"): + return False + version = tuple(int(x) for x in version_str[5:].split(".")) # "HTTP/" + if version[1] < 0 or version < (0, 9) or version >= (2, 0): + return False + return True + + def read_request(self, raw_requestline): + """ + Parse the incoming request. + + Parses various headers into ``self.headers`` using + :attr:`MessageClass`. Other attributes that are set upon a successful + return of this method include ``self.content_length`` and ``self.close_connection``. + + :param str raw_requestline: A native :class:`str` representing + the request line. A processed version of this will be stored + into ``self.requestline``. + + :raises ValueError: If the request is invalid. This error will + not be logged as a traceback (because it's a client issue, not a server problem). + :return: A boolean value indicating whether the request was successfully parsed. + This method should either return a true value or have raised a ValueError + with details about the parsing error. + + .. versionchanged:: 1.1b6 + Raise the previously documented :exc:`ValueError` in more cases instead of returning a + false value; this allows subclasses more opportunity to customize behaviour. + """ + # pylint:disable=too-many-branches + self.requestline = raw_requestline.rstrip() + words = self.requestline.split() + if len(words) == 3: + self.command, self.path, self.request_version = words + if not self._check_http_version(): + raise _InvalidClientRequest('Invalid http version: %r' % (raw_requestline,)) + elif len(words) == 2: + self.command, self.path = words + if self.command != "GET": + raise _InvalidClientRequest('Expected GET method: %r' % (raw_requestline,)) + self.request_version = "HTTP/0.9" + # QQQ I'm pretty sure we can drop support for HTTP/0.9 + else: + raise _InvalidClientRequest('Invalid HTTP method: %r' % (raw_requestline,)) + + self.headers = self.MessageClass(self.rfile, 0) + + if self.headers.status: + raise _InvalidClientRequest('Invalid headers status: %r' % (self.headers.status,)) + + if self.headers.get("transfer-encoding", "").lower() == "chunked": + try: + del self.headers["content-length"] + except KeyError: + pass + + content_length = self.headers.get("content-length") + if content_length is not None: + content_length = int(content_length) + if content_length < 0: + raise _InvalidClientRequest('Invalid Content-Length: %r' % (content_length,)) + + if content_length and self.command in ('HEAD', ): + raise _InvalidClientRequest('Unexpected Content-Length') + + self.content_length = content_length + + if self.request_version == "HTTP/1.1": + conntype = self.headers.get("Connection", "").lower() + self.close_connection = (conntype == 'close') + else: + self.close_connection = True + + return True + + def log_error(self, msg, *args): + try: + message = msg % args + except Exception: # pylint:disable=broad-except + traceback.print_exc() + message = '%r %r' % (msg, args) + try: + message = '%s: %s' % (self.socket, message) + except Exception: # pylint:disable=broad-except + pass + + try: + self.server.error_log.write(message + '\n') + except Exception: # pylint:disable=broad-except + traceback.print_exc() + + def read_requestline(self): + """ + Read and return the HTTP request line. + + Under both Python 2 and 3, this should return the native + ``str`` type; under Python 3, this probably means the bytes read + from the network need to be decoded (using the ISO-8859-1 charset, aka + latin-1). + """ + line = self.rfile.readline(MAX_REQUEST_LINE) + if PY3: + line = line.decode('latin-1') + return line + + def handle_one_request(self): + """ + Handles one HTTP request using ``self.socket`` and ``self.rfile``. + + Each invocation of this method will do several things, including (but not limited to): + + - Read the request line using :meth:`read_requestline`; + - Read the rest of the request, including headers, with :meth:`read_request`; + - Construct a new WSGI environment in ``self.environ`` using :meth:`get_environ`; + - Store the application in ``self.application``, retrieving it from the server; + - Handle the remainder of the request, including invoking the application, + with :meth:`handle_one_response` + + There are several possible return values to indicate the state + of the client connection: + + - ``None`` + The client connection is already closed or should + be closed because the WSGI application or client set the + ``Connection: close`` header. The request handling + loop should terminate and perform cleanup steps. + - (status, body) + An HTTP status and body tuple. The request was in error, + as detailed by the status and body. The request handling + loop should terminate, close the connection, and perform + cleanup steps. Note that the ``body`` is the complete contents + to send to the client, including all headers and the initial + status line. + - ``True`` + The literal ``True`` value. The request was successfully handled + and the response sent to the client by :meth:`handle_one_response`. + The connection remains open to process more requests and the connection + handling loop should call this method again. This is the typical return + value. + + .. seealso:: :meth:`handle` + + .. versionchanged:: 1.1b6 + Funnel exceptions having to do with invalid HTTP requests through + :meth:`_handle_client_error` to allow subclasses to customize. Note that + this is experimental and may change in the future. + """ + # pylint:disable=too-many-return-statements + if self.rfile.closed: + return + + try: + self.requestline = self.read_requestline() + # Account for old subclasses that haven't done this + if PY3 and isinstance(self.requestline, bytes): + self.requestline = self.requestline.decode('latin-1') + except socket.error: + # "Connection reset by peer" or other socket errors aren't interesting here + return + + if not self.requestline: + return + + self.response_length = 0 + + if len(self.requestline) >= MAX_REQUEST_LINE: + return ('414', _REQUEST_TOO_LONG_RESPONSE) + + try: + # for compatibility with older versions of pywsgi, we pass self.requestline as an argument there + # NOTE: read_request is supposed to raise ValueError on invalid input; allow old + # subclasses that return a False value instead. + # NOTE: This can mutate the value of self.headers, so self.get_environ() must not be + # called until AFTER this call is done. + if not self.read_request(self.requestline): + return ('400', _BAD_REQUEST_RESPONSE) + except Exception as ex: # pylint:disable=broad-except + # Notice we don't use self.handle_error because it reports + # a 500 error to the client, and this is almost certainly + # a client error. + # Provide a hook for subclasses. + return self._handle_client_error(ex) + + self.environ = self.get_environ() + self.application = self.server.application + + self.handle_one_response() + + if self.close_connection: + return + + if self.rfile.closed: + return + + return True # read more requests + + def finalize_headers(self): + if self.provided_date is None: + self.response_headers.append((b'Date', format_date_time(time.time()))) + + if self.code not in (304, 204): + # the reply will include message-body; make sure we have either Content-Length or chunked + if self.provided_content_length is None: + if hasattr(self.result, '__len__'): + total_len = sum(len(chunk) for chunk in self.result) + total_len_str = str(total_len) + if PY3: + total_len_str = total_len_str.encode("latin-1") + self.response_headers.append((b'Content-Length', total_len_str)) + else: + if self.request_version != 'HTTP/1.0': + self.response_use_chunked = True + self.response_headers.append((b'Transfer-Encoding', b'chunked')) + + def _sendall(self, data): + try: + self.socket.sendall(data) + except socket.error as ex: + self.status = 'socket error: %s' % ex + if self.code > 0: + self.code = -self.code + raise + self.response_length += len(data) + + def _write(self, data, + _PY34_EXACTLY=(sys.version_info[:2] == (3, 4)), + _bytearray=bytearray): + if not data: + # The application/middleware are allowed to yield + # empty bytestrings. + return + + if self.response_use_chunked: + ## Write the chunked encoding + # header + if _PY34_EXACTLY: + # This is the only version we support that doesn't + # allow % to be used with bytes. Passing a bytestring + # directly in to bytearray() is faster than passing a + # (unicode) str with encoding, which naturally is faster still + # than encoding first. Interestingly, byte formatting on Python 3 + # is faster than str formatting. + header_str = '%x\r\n' % len(data) + towrite = _bytearray(header_str, 'ascii') + else: + header_str = b'%x\r\n' % len(data) + towrite = _bytearray(header_str) + + # data + towrite += data + # trailer + towrite += b'\r\n' + self._sendall(towrite) + else: + self._sendall(data) + + def write(self, data): + # The write() callable we return from start_response. + # https://www.python.org/dev/peps/pep-3333/#the-write-callable + # Supposed to do pretty much the same thing as yielding values + # from the application's return. + if self.code in (304, 204) and data: + raise AssertionError('The %s response must have no body' % self.code) + + if self.headers_sent: + self._write(data) + else: + if not self.status: + raise AssertionError("The application did not call start_response()") + self._write_with_headers(data) + + def _write_with_headers(self, data): + self.headers_sent = True + self.finalize_headers() + + # self.response_headers and self.status are already in latin-1, as encoded by self.start_response + towrite = bytearray(b'HTTP/1.1 ') + towrite += self.status + towrite += b'\r\n' + for header, value in self.response_headers: + towrite += header + towrite += b': ' + towrite += value + towrite += b"\r\n" + + towrite += b'\r\n' + self._sendall(towrite) + # No need to copy the data into towrite; we may make an extra syscall + # but the copy time could be substantial too, and it reduces the chances + # of sendall being able to send everything in one go + self._write(data) + + def start_response(self, status, headers, exc_info=None): + """ + .. versionchanged:: 1.2a1 + Avoid HTTP header injection by raising a :exc:`ValueError` + if *status* or any *header* name or value contains a carriage + return or newline. + .. versionchanged:: 1.1b5 + Pro-actively handle checking the encoding of the status line + and headers during this method. On Python 2, avoid some + extra encodings. + """ + # pylint:disable=too-many-branches,too-many-statements + if exc_info: + try: + if self.headers_sent: + # Re-raise original exception if headers sent + reraise(*exc_info) + finally: + # Avoid dangling circular ref + exc_info = None + + # Pep 3333, "The start_response callable": + # https://www.python.org/dev/peps/pep-3333/#the-start-response-callable + # "Servers should check for errors in the headers at the time + # start_response is called, so that an error can be raised + # while the application is still running." Here, we check the encoding. + # This aids debugging: headers especially are generated programmatically + # and an encoding error in a loop or list comprehension yields an opaque + # UnicodeError without any clue which header was wrong. + # Note that this results in copying the header list at this point, not modifying it, + # although we are allowed to do so if needed. This slightly increases memory usage. + # We also check for HTTP Response Splitting vulnerabilities + response_headers = [] + header = None + value = None + try: + for header, value in headers: + if not isinstance(header, str): + raise UnicodeError("The header must be a native string", header, value) + if not isinstance(value, str): + raise UnicodeError("The value must be a native string", header, value) + if '\r' in header or '\n' in header: + raise ValueError('carriage return or newline in header name', header) + if '\r' in value or '\n' in value: + raise ValueError('carriage return or newline in header value', value) + # Either we're on Python 2, in which case bytes is correct, or + # we're on Python 3 and the user screwed up (because it should be a native + # string). In either case, make sure that this is latin-1 compatible. Under + # Python 2, bytes.encode() will take a round-trip through the system encoding, + # which may be ascii, which is not really what we want. However, the latin-1 encoding + # can encode everything except control characters and the block from 0x7F to 0x9F, so + # explicitly round-tripping bytes through the encoding is unlikely to be of much + # benefit, so we go for speed (the WSGI spec specifically calls out allowing the range + # from 0x00 to 0xFF, although the HTTP spec forbids the control characters). + # Note: Some Python 2 implementations, like Jython, may allow non-octet (above 255) values + # in their str implementation; this is mentioned in the WSGI spec, but we don't + # run on any platform like that so we can assume that a str value is pure bytes. + response_headers.append((header if not PY3 else header.encode("latin-1"), + value if not PY3 else value.encode("latin-1"))) + except UnicodeEncodeError: + # If we get here, we're guaranteed to have a header and value + raise UnicodeError("Non-latin1 header", repr(header), repr(value)) + + # Same as above + if not isinstance(status, str): + raise UnicodeError("The status string must be a native string") + if '\r' in status or '\n' in status: + raise ValueError("carriage return or newline in status", status) + # don't assign to anything until the validation is complete, including parsing the + # code + code = int(status.split(' ', 1)[0]) + + self.status = status if not PY3 else status.encode("latin-1") + self._orig_status = status # Preserve the native string for logging + self.response_headers = response_headers + self.code = code + + provided_connection = None + self.provided_date = None + self.provided_content_length = None + + for header, value in headers: + header = header.lower() + if header == 'connection': + provided_connection = value + elif header == 'date': + self.provided_date = value + elif header == 'content-length': + self.provided_content_length = value + + if self.request_version == 'HTTP/1.0' and provided_connection is None: + response_headers.append((b'Connection', b'close')) + self.close_connection = True + elif provided_connection == 'close': + self.close_connection = True + + if self.code in (304, 204): + if self.provided_content_length is not None and self.provided_content_length != '0': + msg = 'Invalid Content-Length for %s response: %r (must be absent or zero)' % (self.code, self.provided_content_length) + if PY3: + msg = msg.encode('latin-1') + raise AssertionError(msg) + + return self.write + + def log_request(self): + self.server.log.write(self.format_request() + '\n') + + def format_request(self): + now = datetime.now().replace(microsecond=0) + length = self.response_length or '-' + if self.time_finish: + delta = '%.6f' % (self.time_finish - self.time_start) + else: + delta = '-' + client_address = self.client_address[0] if isinstance(self.client_address, tuple) else self.client_address + return '%s - - [%s] "%s" %s %s %s' % ( + client_address or '-', + now, + self.requestline or '', + # Use the native string version of the status, saved so we don't have to + # decode. But fallback to the encoded 'status' in case of subclasses + # (Is that really necessary? At least there's no overhead.) + (self._orig_status or self.status or '000').split()[0], + length, + delta) + + def process_result(self): + for data in self.result: + if data: + self.write(data) + if self.status and not self.headers_sent: + # In other words, the application returned an empty + # result iterable (and did not use the write callable) + # Trigger the flush of the headers. + self.write(b'') + if self.response_use_chunked: + self._sendall(b'0\r\n\r\n') + + + def run_application(self): + assert self.result is None + try: + self.result = self.application(self.environ, self.start_response) + self.process_result() + finally: + close = getattr(self.result, 'close', None) + try: + if close is not None: + close() + finally: + # Discard the result. If it's a generator this can + # free a lot of hidden resources (if we failed to iterate + # all the way through it---the frames are automatically + # cleaned up when StopIteration is raised); but other cases + # could still free up resources sooner than otherwise. + close = None + self.result = None + + #: These errors are silently ignored by :meth:`handle_one_response` to avoid producing + #: excess log entries on normal operating conditions. They indicate + #: a remote client has disconnected and there is little or nothing + #: this process can be expected to do about it. You may change this + #: value in a subclass. + #: + #: The default value includes :data:`errno.EPIPE` and :data:`errno.ECONNRESET`. + #: On Windows this also includes :data:`errno.WSAECONNABORTED`. + #: + #: This is a provisional API, subject to change. See :pr:`377`, :pr:`999` + #: and :issue:`136`. + #: + #: .. versionadded:: 1.3 + ignored_socket_errors = (errno.EPIPE, errno.ECONNRESET) + try: + ignored_socket_errors += (errno.WSAECONNABORTED,) + except AttributeError: + pass # Not windows + + def handle_one_response(self): + """ + Invoke the application to produce one response. + + This is called by :meth:`handle_one_request` after all the + state for the request has been established. It is responsible + for error handling. + """ + self.time_start = time.time() + self.status = None + self.headers_sent = False + + self.result = None + self.response_use_chunked = False + self.response_length = 0 + + try: + try: + self.run_application() + finally: + try: + self.wsgi_input._discard() + except (socket.error, IOError): + # Don't let exceptions during discarding + # input override any exception that may have been + # raised by the application, such as our own _InvalidClientInput. + # In the general case, these aren't even worth logging (see the comment + # just below) + pass + except _InvalidClientInput: + self._send_error_response_if_possible(400) + except socket.error as ex: + if ex.args[0] in self.ignored_socket_errors: + # See description of self.ignored_socket_errors. + if not PY3: + sys.exc_clear() + self.close_connection = True + else: + self.handle_error(*sys.exc_info()) + except: # pylint:disable=bare-except + self.handle_error(*sys.exc_info()) + finally: + self.time_finish = time.time() + self.log_request() + + def _send_error_response_if_possible(self, error_code): + if self.response_length: + self.close_connection = True + else: + status, headers, body = _ERRORS[error_code] + try: + self.start_response(status, headers[:]) + self.write(body) + except socket.error: + if not PY3: + sys.exc_clear() + self.close_connection = True + + def _log_error(self, t, v, tb): + # TODO: Shouldn't we dump this to wsgi.errors? If we did that now, it would + # wind up getting logged twice + if not issubclass(t, GreenletExit): + context = self.environ + if not isinstance(context, self.server.secure_environ_class): + context = self.server.secure_environ_class(context) + self.server.loop.handle_error(context, t, v, tb) + + def handle_error(self, t, v, tb): + # Called for internal, unexpected errors, NOT invalid client input + self._log_error(t, v, tb) + del tb + self._send_error_response_if_possible(500) + + def _handle_client_error(self, ex): + # Called for invalid client input + # Returns the appropriate error response. + if not isinstance(ex, ValueError): + # XXX: Why not self._log_error to send it through the loop's + # handle_error method? + traceback.print_exc() + if isinstance(ex, _InvalidClientRequest): + # These come with good error messages, and we want to let + # log_error deal with the formatting, especially to handle encoding + self.log_error(*ex.args) + else: + self.log_error('Invalid request: %s', str(ex) or ex.__class__.__name__) + return ('400', _BAD_REQUEST_RESPONSE) + + def _headers(self): + key = None + value = None + IGNORED_KEYS = (None, 'CONTENT_TYPE', 'CONTENT_LENGTH') + for header in self.headers.headers: + if key is not None and header[:1] in " \t": + value += header + continue + + if key not in IGNORED_KEYS: + yield 'HTTP_' + key, value.strip() + + key, value = header.split(':', 1) + if '_' in key: + # strip incoming bad veaders + key = None + else: + key = key.replace('-', '_').upper() + + if key not in IGNORED_KEYS: + yield 'HTTP_' + key, value.strip() + + def get_environ(self): + """ + Construct and return a new WSGI environment dictionary for a specific request. + + This should begin with asking the server for the base environment + using :meth:`WSGIServer.get_environ`, and then proceed to add the + request specific values. + + By the time this method is invoked the request line and request shall have + been parsed and ``self.headers`` shall be populated. + """ + env = self.server.get_environ() + env['REQUEST_METHOD'] = self.command + env['SCRIPT_NAME'] = '' + + if '?' in self.path: + path, query = self.path.split('?', 1) + else: + path, query = self.path, '' + # Note that self.path contains the original str object; if it contains + # encoded escapes, it will NOT match PATH_INFO. + env['PATH_INFO'] = unquote_latin1(path) + env['QUERY_STRING'] = query + + if self.headers.typeheader is not None: + env['CONTENT_TYPE'] = self.headers.typeheader + + length = self.headers.getheader('content-length') + if length: + env['CONTENT_LENGTH'] = length + env['SERVER_PROTOCOL'] = self.request_version + + client_address = self.client_address + if isinstance(client_address, tuple): + env['REMOTE_ADDR'] = str(client_address[0]) + env['REMOTE_PORT'] = str(client_address[1]) + + for key, value in self._headers(): + if key in env: + if 'COOKIE' in key: + env[key] += '; ' + value + else: + env[key] += ',' + value + else: + env[key] = value + + if env.get('HTTP_EXPECT') == '100-continue': + sock = self.socket + else: + sock = None + + chunked = env.get('HTTP_TRANSFER_ENCODING', '').lower() == 'chunked' + self.wsgi_input = Input(self.rfile, self.content_length, socket=sock, chunked_input=chunked) + env['wsgi.input'] = self.wsgi_input + # This is a non-standard flag indicating that our input stream is + # self-terminated (returns EOF when consumed). + # See https://github.com/gevent/gevent/issues/1308 + env['wsgi.input_terminated'] = True + return env + + +class _NoopLog(object): + # Does nothing; implements just enough file-like methods + # to pass the WSGI validator + + def write(self, *args, **kwargs): + # pylint:disable=unused-argument + return + + def flush(self): + pass + + def writelines(self, *args, **kwargs): + pass + + +class LoggingLogAdapter(object): + """ + An adapter for :class:`logging.Logger` instances + to let them be used with :class:`WSGIServer`. + + .. warning:: Unless the entire process is monkey-patched at a very + early part of the lifecycle (before logging is configured), + loggers are likely to not be gevent-cooperative. For example, + the socket and syslog handlers use the socket module in a way + that can block, and most handlers acquire threading locks. + + .. warning:: It *may* be possible for the logging functions to be + called in the :class:`gevent.Hub` greenlet. Code running in the + hub greenlet cannot use any gevent blocking functions without triggering + a ``LoopExit``. + + .. versionadded:: 1.1a3 + + .. versionchanged:: 1.1b6 + Attributes not present on this object are proxied to the underlying + logger instance. This permits using custom :class:`~logging.Logger` + subclasses (or indeed, even duck-typed objects). + + .. versionchanged:: 1.1 + Strip trailing newline characters on the message passed to :meth:`write` + because log handlers will usually add one themselves. + """ + + # gevent avoids importing and using logging because importing it and + # creating loggers creates native locks unless monkey-patched. + + __slots__ = ('_logger', '_level') + + def __init__(self, logger, level=20): + """ + Write information to the *logger* at the given *level* (default to INFO). + """ + self._logger = logger + self._level = level + + def write(self, msg): + if msg and msg.endswith('\n'): + msg = msg[:-1] + self._logger.log(self._level, msg) + + def flush(self): + "No-op; required to be a file-like object" + + def writelines(self, lines): + for line in lines: + self.write(line) + + def __getattr__(self, name): + return getattr(self._logger, name) + + def __setattr__(self, name, value): + if name not in LoggingLogAdapter.__slots__: + setattr(self._logger, name, value) + else: + object.__setattr__(self, name, value) + + def __delattr__(self, name): + delattr(self._logger, name) + +#### +## Environ classes. +# These subclass dict. They could subclass collections.UserDict on +# 3.3+ and proxy to the underlying real dict to avoid a copy if we +# have to print them (on 2.7 it's slightly more complicated to be an +# instance of collections.MutableMapping; UserDict.UserDict isn't.) +# Then we could have either the WSGIHandler.get_environ or the +# WSGIServer.get_environ return one of these proxies, and +# WSGIHandler.run_application would know to access the `environ.data` +# attribute to be able to pass the *real* dict to the application +# (because PEP3333 requires no subclasses, only actual dict objects; +# wsgiref.validator and webob.Request both enforce this). This has the +# advantage of not being fragile if anybody else tries to print/log +# self.environ (and not requiring a copy). However, if there are any +# subclasses of Handler or Server, this could break if they don't know +# to return this type. +#### + +class Environ(dict): + """ + A base class that can be used for WSGI environment objects. + + Provisional API. + + .. versionadded:: 1.2a1 + """ + + __slots__ = () # add no ivars or weakref ability + + def copy(self): + return self.__class__(self) + + if not hasattr(dict, 'iteritems'): + # Python 3 + def iteritems(self): + return self.items() + + def __reduce_ex__(self, proto): + return (dict, (), None, None, iter(self.iteritems())) + +class SecureEnviron(Environ): + """ + An environment that does not print its keys and values + by default. + + Provisional API. + + This is intended to keep potentially sensitive information like + HTTP authorization and cookies from being inadvertently printed + or logged. + + For debugging, each instance can have its *secure_repr* attribute + set to ``False``, which will cause it to print like a normal dict. + + When *secure_repr* is ``True`` (the default), then the value of + the *whitelist_keys* attribute is consulted; if this value is + true-ish, it should be a container (something that responds to + ``in``) of key names (typically a list or set). Keys and values in + this dictionary that are in *whitelist_keys* will then be printed, + while all other values will be masked. These values may be + customized on the class by setting the *default_secure_repr* and + *default_whitelist_keys*, respectively:: + + >>> environ = SecureEnviron(key='value') + >>> environ # doctest: +ELLIPSIS + >> environ.whitelist_keys = {'key'} + >>> environ + {'key': 'value'} + + A non-whitelisted key (*only*, to avoid doctest issues) is masked:: + + >>> environ['secure'] = 'secret'; del environ['key'] + >>> environ + {'secure': ''} + + We can turn it off entirely for the instance:: + + >>> environ.secure_repr = False + >>> environ + {'secure': 'secret'} + + We can also customize it at the class level (here we use a new + class to be explicit and to avoid polluting the true default + values; we would set this class to be the ``environ_class`` of the + server):: + + >>> class MyEnviron(SecureEnviron): + ... default_whitelist_keys = ('key',) + ... + >>> environ = MyEnviron({'key': 'value'}) + >>> environ + {'key': 'value'} + + .. versionadded:: 1.2a1 + """ + + default_secure_repr = True + default_whitelist_keys = () + default_print_masked_keys = True + + # Allow instances to override the class values, + # but inherit from the class if not present. Keeps instances + # small since we can't combine __slots__ with class attributes + # of the same name. + __slots__ = ('secure_repr', 'whitelist_keys', 'print_masked_keys') + + def __getattr__(self, name): + if name in SecureEnviron.__slots__: + return getattr(type(self), 'default_' + name) + raise AttributeError(name) + + def __repr__(self): + if self.secure_repr: + whitelist = self.whitelist_keys + print_masked = self.print_masked_keys + if whitelist: + safe = {k: self[k] if k in whitelist else "" + for k in self + if k in whitelist or print_masked} + safe_repr = repr(safe) + if not print_masked and len(safe) != len(self): + safe_repr = safe_repr[:-1] + ", (hidden keys: %d)}" % (len(self) - len(safe)) + return safe_repr + return "" % (len(self), id(self)) + return Environ.__repr__(self) + __str__ = __repr__ + + +class WSGISecureEnviron(SecureEnviron): + """ + Specializes the default list of whitelisted keys to a few + common WSGI variables. + + Example:: + + >>> environ = WSGISecureEnviron(REMOTE_ADDR='::1', HTTP_AUTHORIZATION='secret') + >>> environ + {'REMOTE_ADDR': '::1', (hidden keys: 1)} + >>> import pprint + >>> pprint.pprint(environ) + {'REMOTE_ADDR': '::1', (hidden keys: 1)} + >>> print(pprint.pformat(environ)) + {'REMOTE_ADDR': '::1', (hidden keys: 1)} + """ + default_whitelist_keys = ('REMOTE_ADDR', 'REMOTE_PORT', 'HTTP_HOST') + default_print_masked_keys = False + + +class WSGIServer(StreamServer): + """ + A WSGI server based on :class:`StreamServer` that supports HTTPS. + + + :keyword log: If given, an object with a ``write`` method to which + request (access) logs will be written. If not given, defaults + to :obj:`sys.stderr`. You may pass ``None`` to disable request + logging. You may use a wrapper, around e.g., :mod:`logging`, + to support objects that don't implement a ``write`` method. + (If you pass a :class:`~logging.Logger` instance, or in + general something that provides a ``log`` method but not a + ``write`` method, such a wrapper will automatically be created + and it will be logged to at the :data:`~logging.INFO` level.) + + :keyword error_log: If given, a file-like object with ``write``, + ``writelines`` and ``flush`` methods to which error logs will + be written. If not given, defaults to :obj:`sys.stderr`. You + may pass ``None`` to disable error logging (not recommended). + You may use a wrapper, around e.g., :mod:`logging`, to support + objects that don't implement the proper methods. This + parameter will become the value for ``wsgi.errors`` in the + WSGI environment (if not already set). (As with *log*, + wrappers for :class:`~logging.Logger` instances and the like + will be created automatically and logged to at the :data:`~logging.ERROR` + level.) + + .. seealso:: + + :class:`LoggingLogAdapter` + See important warnings before attempting to use :mod:`logging`. + + .. versionchanged:: 1.1a3 + Added the ``error_log`` parameter, and set ``wsgi.errors`` in the WSGI + environment to this value. + .. versionchanged:: 1.1a3 + Add support for passing :class:`logging.Logger` objects to the ``log`` and + ``error_log`` arguments. + """ + + #: A callable taking three arguments: (socket, address, server) and returning + #: an object with a ``handle()`` method. The callable is called once for + #: each incoming socket request, as is its handle method. The handle method should not + #: return until all use of the socket is complete. + #: + #: This class uses the :class:`WSGIHandler` object as the default value. You may + #: subclass this class and set a different default value, or you may pass + #: a value to use in the ``handler_class`` keyword constructor argument. + handler_class = WSGIHandler + + #: The object to which request logs will be written. + #: It must never be None. Initialized from the ``log`` constructor + #: parameter. + log = None + + #: The object to which error logs will be written. + #: It must never be None. Initialized from the ``error_log`` constructor + #: parameter. + error_log = None + + #: The class of environ objects passed to the handlers. + #: Must be a dict subclass. For compliance with :pep:`3333` + #: and libraries like WebOb, this is simply :class:`dict` + #: but this can be customized in a subclass or per-instance + #: (probably to :class:`WSGISecureEnviron`). + #: + #: .. versionadded:: 1.2a1 + environ_class = dict + + # Undocumented internal detail: the class that WSGIHandler._log_error + # will cast to before passing to the loop. + secure_environ_class = WSGISecureEnviron + + base_env = {'GATEWAY_INTERFACE': 'CGI/1.1', + 'SERVER_SOFTWARE': 'gevent/%d.%d Python/%d.%d' % (gevent.version_info[:2] + sys.version_info[:2]), + 'SCRIPT_NAME': '', + 'wsgi.version': (1, 0), + 'wsgi.multithread': False, # XXX: Aren't we really, though? + 'wsgi.multiprocess': False, + 'wsgi.run_once': False} + + def __init__(self, listener, application=None, backlog=None, spawn='default', + log='default', error_log='default', + handler_class=None, + environ=None, **ssl_args): + StreamServer.__init__(self, listener, backlog=backlog, spawn=spawn, **ssl_args) + if application is not None: + self.application = application + if handler_class is not None: + self.handler_class = handler_class + + # Note that we can't initialize these as class variables: + # sys.stderr might get monkey patched at runtime. + def _make_log(l, level=20): + if l == 'default': + return sys.stderr + if l is None: + return _NoopLog() + if not hasattr(l, 'write') and hasattr(l, 'log'): + return LoggingLogAdapter(l, level) + return l + self.log = _make_log(log) + self.error_log = _make_log(error_log, 40) # logging.ERROR + + self.set_environ(environ) + self.set_max_accept() + + def set_environ(self, environ=None): + if environ is not None: + self.environ = environ + environ_update = getattr(self, 'environ', None) + + self.environ = self.environ_class(self.base_env) + if self.ssl_enabled: + self.environ['wsgi.url_scheme'] = 'https' + else: + self.environ['wsgi.url_scheme'] = 'http' + if environ_update is not None: + self.environ.update(environ_update) + if self.environ.get('wsgi.errors') is None: + self.environ['wsgi.errors'] = self.error_log + + def set_max_accept(self): + if self.environ.get('wsgi.multiprocess'): + self.max_accept = 1 + + def get_environ(self): + return self.environ_class(self.environ) + + def init_socket(self): + StreamServer.init_socket(self) + self.update_environ() + + def update_environ(self): + """ + Called before the first request is handled to fill in WSGI environment values. + + This includes getting the correct server name and port. + """ + address = self.address + if isinstance(address, tuple): + if 'SERVER_NAME' not in self.environ: + try: + name = socket.getfqdn(address[0]) + except socket.error: + name = str(address[0]) + if PY3 and not isinstance(name, str): + name = name.decode('ascii') + self.environ['SERVER_NAME'] = name + self.environ.setdefault('SERVER_PORT', str(address[1])) + else: + self.environ.setdefault('SERVER_NAME', '') + self.environ.setdefault('SERVER_PORT', '') + + def handle(self, sock, address): + """ + Create an instance of :attr:`handler_class` to handle the request. + + This method blocks until the handler returns. + """ + # pylint:disable=method-hidden + handler = self.handler_class(sock, address, self) + handler.handle() + +def _main(): + # Provisional main handler, for quick tests, not production + # usage. + from gevent import monkey; monkey.patch_all() + + import argparse + import importlib + + parser = argparse.ArgumentParser() + parser.add_argument("app", help="dotted name of WSGI app callable [module:callable]") + parser.add_argument("-b", "--bind", + help="The socket to bind", + default=":8080") + + args = parser.parse_args() + + module_name, app_name = args.app.split(':') + module = importlib.import_module(module_name) + app = getattr(module, app_name) + bind = args.bind + + server = WSGIServer(bind, app) + server.serve_forever() + +if __name__ == '__main__': + _main() diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/queue.c b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/queue.c new file mode 100644 index 00000000..ac684019 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/queue.c @@ -0,0 +1,21853 @@ +/* Generated by Cython 0.29.2 */ + +/* BEGIN: Cython Metadata +{ + "distutils": { + "depends": [ + "src/gevent/_queue.pxd", + "src\\gevent\\_queue.pxd" + ], + "include_dirs": [ + "C:\\Python37-x64\\Include", + "deps" + ], + "name": "gevent._queue", + "sources": [ + "src/gevent/queue.py" + ] + }, + "module_name": "gevent._queue" +} +END: Cython Metadata */ + +#define PY_SSIZE_T_CLEAN +#include "Python.h" +#ifndef Py_PYTHON_H + #error Python headers needed to compile C extensions, please install development version of Python. +#elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) + #error Cython requires Python 2.6+ or Python 3.3+. +#else +#define CYTHON_ABI "0_29_2" +#define CYTHON_HEX_VERSION 0x001D02F0 +#define CYTHON_FUTURE_DIVISION 1 +#include +#ifndef offsetof + #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) +#endif +#if !defined(WIN32) && !defined(MS_WINDOWS) + #ifndef __stdcall + #define __stdcall + #endif + #ifndef __cdecl + #define __cdecl + #endif + #ifndef __fastcall + #define __fastcall + #endif +#endif +#ifndef DL_IMPORT + #define DL_IMPORT(t) t +#endif +#ifndef DL_EXPORT + #define DL_EXPORT(t) t +#endif +#define __PYX_COMMA , +#ifndef HAVE_LONG_LONG + #if PY_VERSION_HEX >= 0x02070000 + #define HAVE_LONG_LONG + #endif +#endif +#ifndef PY_LONG_LONG + #define PY_LONG_LONG LONG_LONG +#endif +#ifndef Py_HUGE_VAL + #define Py_HUGE_VAL HUGE_VAL +#endif +#ifdef PYPY_VERSION + #define CYTHON_COMPILING_IN_PYPY 1 + #define CYTHON_COMPILING_IN_PYSTON 0 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #undef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 0 + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #if PY_VERSION_HEX < 0x03050000 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #elif !defined(CYTHON_USE_ASYNC_SLOTS) + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #undef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 0 + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #undef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 1 + #undef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 0 + #undef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 0 + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #undef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE 0 + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 +#elif defined(PYSTON_VERSION) + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_PYSTON 1 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #ifndef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 1 + #endif + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #ifndef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 1 + #endif + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #ifndef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 0 + #endif + #ifndef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 1 + #endif + #ifndef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 1 + #endif + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #undef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE 0 + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 +#else + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_PYSTON 0 + #define CYTHON_COMPILING_IN_CPYTHON 1 + #ifndef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 1 + #endif + #if PY_VERSION_HEX < 0x02070000 + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #elif !defined(CYTHON_USE_PYTYPE_LOOKUP) + #define CYTHON_USE_PYTYPE_LOOKUP 1 + #endif + #if PY_MAJOR_VERSION < 3 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #elif !defined(CYTHON_USE_ASYNC_SLOTS) + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #if PY_VERSION_HEX < 0x02070000 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #elif !defined(CYTHON_USE_PYLONG_INTERNALS) + #define CYTHON_USE_PYLONG_INTERNALS 1 + #endif + #ifndef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 1 + #endif + #ifndef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 1 + #endif + #if PY_VERSION_HEX < 0x030300F0 + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #elif !defined(CYTHON_USE_UNICODE_WRITER) + #define CYTHON_USE_UNICODE_WRITER 1 + #endif + #ifndef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 0 + #endif + #ifndef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 1 + #endif + #ifndef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 1 + #endif + #ifndef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 1 + #endif + #ifndef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 1 + #endif + #ifndef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000) + #endif + #ifndef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1) + #endif + #ifndef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1) + #endif + #ifndef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3) + #endif +#endif +#if !defined(CYTHON_FAST_PYCCALL) +#define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) +#endif +#if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #undef SHIFT + #undef BASE + #undef MASK + #ifdef SIZEOF_VOID_P + enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) }; + #endif +#endif +#ifndef __has_attribute + #define __has_attribute(x) 0 +#endif +#ifndef __has_cpp_attribute + #define __has_cpp_attribute(x) 0 +#endif +#ifndef CYTHON_RESTRICT + #if defined(__GNUC__) + #define CYTHON_RESTRICT __restrict__ + #elif defined(_MSC_VER) && _MSC_VER >= 1400 + #define CYTHON_RESTRICT __restrict + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_RESTRICT restrict + #else + #define CYTHON_RESTRICT + #endif +#endif +#ifndef CYTHON_UNUSED +# if defined(__GNUC__) +# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +#endif +#ifndef CYTHON_MAYBE_UNUSED_VAR +# if defined(__cplusplus) + template void CYTHON_MAYBE_UNUSED_VAR( const T& ) { } +# else +# define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x) +# endif +#endif +#ifndef CYTHON_NCP_UNUSED +# if CYTHON_COMPILING_IN_CPYTHON +# define CYTHON_NCP_UNUSED +# else +# define CYTHON_NCP_UNUSED CYTHON_UNUSED +# endif +#endif +#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) +#ifdef _MSC_VER + #ifndef _MSC_STDINT_H_ + #if _MSC_VER < 1300 + typedef unsigned char uint8_t; + typedef unsigned int uint32_t; + #else + typedef unsigned __int8 uint8_t; + typedef unsigned __int32 uint32_t; + #endif + #endif +#else + #include +#endif +#ifndef CYTHON_FALLTHROUGH + #if defined(__cplusplus) && __cplusplus >= 201103L + #if __has_cpp_attribute(fallthrough) + #define CYTHON_FALLTHROUGH [[fallthrough]] + #elif __has_cpp_attribute(clang::fallthrough) + #define CYTHON_FALLTHROUGH [[clang::fallthrough]] + #elif __has_cpp_attribute(gnu::fallthrough) + #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] + #endif + #endif + #ifndef CYTHON_FALLTHROUGH + #if __has_attribute(fallthrough) + #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) + #else + #define CYTHON_FALLTHROUGH + #endif + #endif + #if defined(__clang__ ) && defined(__apple_build_version__) + #if __apple_build_version__ < 7000000 + #undef CYTHON_FALLTHROUGH + #define CYTHON_FALLTHROUGH + #endif + #endif +#endif + +#ifndef CYTHON_INLINE + #if defined(__clang__) + #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) + #elif defined(__GNUC__) + #define CYTHON_INLINE __inline__ + #elif defined(_MSC_VER) + #define CYTHON_INLINE __inline + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_INLINE inline + #else + #define CYTHON_INLINE + #endif +#endif + +#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) + #define Py_OptimizeFlag 0 +#endif +#define __PYX_BUILD_PY_SSIZE_T "n" +#define CYTHON_FORMAT_SSIZE_T "z" +#if PY_MAJOR_VERSION < 3 + #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyClass_Type +#else + #define __Pyx_BUILTIN_MODULE_NAME "builtins" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyType_Type +#endif +#ifndef Py_TPFLAGS_CHECKTYPES + #define Py_TPFLAGS_CHECKTYPES 0 +#endif +#ifndef Py_TPFLAGS_HAVE_INDEX + #define Py_TPFLAGS_HAVE_INDEX 0 +#endif +#ifndef Py_TPFLAGS_HAVE_NEWBUFFER + #define Py_TPFLAGS_HAVE_NEWBUFFER 0 +#endif +#ifndef Py_TPFLAGS_HAVE_FINALIZE + #define Py_TPFLAGS_HAVE_FINALIZE 0 +#endif +#ifndef METH_STACKLESS + #define METH_STACKLESS 0 +#endif +#if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) + #ifndef METH_FASTCALL + #define METH_FASTCALL 0x80 + #endif + typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs); + typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args, + Py_ssize_t nargs, PyObject *kwnames); +#else + #define __Pyx_PyCFunctionFast _PyCFunctionFast + #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords +#endif +#if CYTHON_FAST_PYCCALL +#define __Pyx_PyFastCFunction_Check(func)\ + ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS))))) +#else +#define __Pyx_PyFastCFunction_Check(func) 0 +#endif +#if CYTHON_USE_DICT_VERSIONS +#define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) +#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ + (version_var) = __PYX_GET_DICT_VERSION(dict);\ + (cache_var) = (value); +#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ + static PY_UINT64_T __pyx_dict_version = 0;\ + static PyObject *__pyx_dict_cached_value = NULL;\ + if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ + (VAR) = __pyx_dict_cached_value;\ + } else {\ + (VAR) = __pyx_dict_cached_value = (LOOKUP);\ + __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ + }\ + } +#else +#define __PYX_GET_DICT_VERSION(dict) (0) +#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) +#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) + #define PyObject_Malloc(s) PyMem_Malloc(s) + #define PyObject_Free(p) PyMem_Free(p) + #define PyObject_Realloc(p) PyMem_Realloc(p) +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1 + #define PyMem_RawMalloc(n) PyMem_Malloc(n) + #define PyMem_RawRealloc(p, n) PyMem_Realloc(p, n) + #define PyMem_RawFree(p) PyMem_Free(p) +#endif +#if CYTHON_COMPILING_IN_PYSTON + #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co) + #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno) +#else + #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) + #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) +#endif +#if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000 + #define __Pyx_PyThreadState_Current PyThreadState_GET() +#elif PY_VERSION_HEX >= 0x03060000 + #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() +#elif PY_VERSION_HEX >= 0x03000000 + #define __Pyx_PyThreadState_Current PyThreadState_GET() +#else + #define __Pyx_PyThreadState_Current _PyThreadState_Current +#endif +#if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) +#include "pythread.h" +#define Py_tss_NEEDS_INIT 0 +typedef int Py_tss_t; +static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) { + *key = PyThread_create_key(); + return 0; // PyThread_create_key reports success always +} +static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) { + Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t)); + *key = Py_tss_NEEDS_INIT; + return key; +} +static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) { + PyObject_Free(key); +} +static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) { + return *key != Py_tss_NEEDS_INIT; +} +static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) { + PyThread_delete_key(*key); + *key = Py_tss_NEEDS_INIT; +} +static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) { + return PyThread_set_key_value(*key, value); +} +static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { + return PyThread_get_key_value(*key); +} +#endif // TSS (Thread Specific Storage) API +#if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized) +#define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) +#else +#define __Pyx_PyDict_NewPresized(n) PyDict_New() +#endif +#if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION + #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) +#else + #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS +#define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) +#else +#define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name) +#endif +#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) + #define CYTHON_PEP393_ENABLED 1 + #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ + 0 : _PyUnicode_Ready((PyObject *)(op))) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) + #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) + #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) + #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) + #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) + #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch) + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) +#else + #define CYTHON_PEP393_ENABLED 0 + #define PyUnicode_1BYTE_KIND 1 + #define PyUnicode_2BYTE_KIND 2 + #define PyUnicode_4BYTE_KIND 4 + #define __Pyx_PyUnicode_READY(op) (0) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) + #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111) + #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) + #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) + #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) + #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch) + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) +#endif +#if CYTHON_COMPILING_IN_PYPY + #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) +#else + #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ + PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains) + #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check) + #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format) + #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) +#endif +#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) +#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) +#else + #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) +#endif +#if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) + #define PyObject_ASCII(o) PyObject_Repr(o) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBaseString_Type PyUnicode_Type + #define PyStringObject PyUnicodeObject + #define PyString_Type PyUnicode_Type + #define PyString_Check PyUnicode_Check + #define PyString_CheckExact PyUnicode_CheckExact + #define PyObject_Unicode PyObject_Str +#endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) + #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) +#else + #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) + #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) +#endif +#ifndef PySet_CheckExact + #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) +#endif +#if CYTHON_ASSUME_SAFE_MACROS + #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) +#else + #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyIntObject PyLongObject + #define PyInt_Type PyLong_Type + #define PyInt_Check(op) PyLong_Check(op) + #define PyInt_CheckExact(op) PyLong_CheckExact(op) + #define PyInt_FromString PyLong_FromString + #define PyInt_FromUnicode PyLong_FromUnicode + #define PyInt_FromLong PyLong_FromLong + #define PyInt_FromSize_t PyLong_FromSize_t + #define PyInt_FromSsize_t PyLong_FromSsize_t + #define PyInt_AsLong PyLong_AsLong + #define PyInt_AS_LONG PyLong_AS_LONG + #define PyInt_AsSsize_t PyLong_AsSsize_t + #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask + #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask + #define PyNumber_Int PyNumber_Long +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBoolObject PyLongObject +#endif +#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY + #ifndef PyUnicode_InternFromString + #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) + #endif +#endif +#if PY_VERSION_HEX < 0x030200A4 + typedef long Py_hash_t; + #define __Pyx_PyInt_FromHash_t PyInt_FromLong + #define __Pyx_PyInt_AsHash_t PyInt_AsLong +#else + #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t + #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t +#endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : (Py_INCREF(func), func)) +#else + #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) +#endif +#if CYTHON_USE_ASYNC_SLOTS + #if PY_VERSION_HEX >= 0x030500B1 + #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods + #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) + #else + #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) + #endif +#else + #define __Pyx_PyType_AsAsync(obj) NULL +#endif +#ifndef __Pyx_PyAsyncMethodsStruct + typedef struct { + unaryfunc am_await; + unaryfunc am_aiter; + unaryfunc am_anext; + } __Pyx_PyAsyncMethodsStruct; +#endif + +#if defined(WIN32) || defined(MS_WINDOWS) + #define _USE_MATH_DEFINES +#endif +#include +#ifdef NAN +#define __PYX_NAN() ((float) NAN) +#else +static CYTHON_INLINE float __PYX_NAN() { + float value; + memset(&value, 0xFF, sizeof(value)); + return value; +} +#endif +#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) +#define __Pyx_truncl trunc +#else +#define __Pyx_truncl truncl +#endif + + +#define __PYX_ERR(f_index, lineno, Ln_error) \ +{ \ + __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \ +} + +#ifndef __PYX_EXTERN_C + #ifdef __cplusplus + #define __PYX_EXTERN_C extern "C" + #else + #define __PYX_EXTERN_C extern + #endif +#endif + +#define __PYX_HAVE__gevent___queue +#define __PYX_HAVE_API__gevent___queue +/* Early includes */ +#include "greenlet/greenlet.h" +#ifdef _OPENMP +#include +#endif /* _OPENMP */ + +#if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) +#define CYTHON_WITHOUT_ASSERTIONS +#endif + +typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; + const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; + +#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 +#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0 +#define __PYX_DEFAULT_STRING_ENCODING "" +#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString +#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#define __Pyx_uchar_cast(c) ((unsigned char)c) +#define __Pyx_long_cast(x) ((long)x) +#define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ + (sizeof(type) < sizeof(Py_ssize_t)) ||\ + (sizeof(type) > sizeof(Py_ssize_t) &&\ + likely(v < (type)PY_SSIZE_T_MAX ||\ + v == (type)PY_SSIZE_T_MAX) &&\ + (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ + v == (type)PY_SSIZE_T_MIN))) ||\ + (sizeof(type) == sizeof(Py_ssize_t) &&\ + (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ + v == (type)PY_SSIZE_T_MAX))) ) +static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) { + return (size_t) i < (size_t) limit; +} +#if defined (__cplusplus) && __cplusplus >= 201103L + #include + #define __Pyx_sst_abs(value) std::abs(value) +#elif SIZEOF_INT >= SIZEOF_SIZE_T + #define __Pyx_sst_abs(value) abs(value) +#elif SIZEOF_LONG >= SIZEOF_SIZE_T + #define __Pyx_sst_abs(value) labs(value) +#elif defined (_MSC_VER) + #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) +#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define __Pyx_sst_abs(value) llabs(value) +#elif defined (__GNUC__) + #define __Pyx_sst_abs(value) __builtin_llabs(value) +#else + #define __Pyx_sst_abs(value) ((value<0) ? -value : value) +#endif +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*); +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); +#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) +#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) +#define __Pyx_PyBytes_FromString PyBytes_FromString +#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); +#if PY_MAJOR_VERSION < 3 + #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#else + #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize +#endif +#define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) +#define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) +#define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) +#define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) +#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) +static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) { + const Py_UNICODE *u_end = u; + while (*u_end++) ; + return (size_t)(u_end - u - 1); +} +#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) +#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode +#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode +#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) +#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) +static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); +static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*); +static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); +#define __Pyx_PySequence_Tuple(obj)\ + (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); +#if CYTHON_ASSUME_SAFE_MACROS +#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) +#else +#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) +#endif +#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) +#if PY_MAJOR_VERSION >= 3 +#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) +#else +#define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) +#endif +#define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x)) +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII +static int __Pyx_sys_getdefaultencoding_not_ascii; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + PyObject* ascii_chars_u = NULL; + PyObject* ascii_chars_b = NULL; + const char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + if (strcmp(default_encoding_c, "ascii") == 0) { + __Pyx_sys_getdefaultencoding_not_ascii = 0; + } else { + char ascii_chars[128]; + int c; + for (c = 0; c < 128; c++) { + ascii_chars[c] = c; + } + __Pyx_sys_getdefaultencoding_not_ascii = 1; + ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); + if (!ascii_chars_u) goto bad; + ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); + if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { + PyErr_Format( + PyExc_ValueError, + "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", + default_encoding_c); + goto bad; + } + Py_DECREF(ascii_chars_u); + Py_DECREF(ascii_chars_b); + } + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + Py_XDECREF(ascii_chars_u); + Py_XDECREF(ascii_chars_b); + return -1; +} +#endif +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) +#else +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +static char* __PYX_DEFAULT_STRING_ENCODING; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1); + if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; + strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + return -1; +} +#endif +#endif + + +/* Test for GCC > 2.95 */ +#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) + #define likely(x) __builtin_expect(!!(x), 1) + #define unlikely(x) __builtin_expect(!!(x), 0) +#else /* !__GNUC__ or GCC < 2.95 */ + #define likely(x) (x) + #define unlikely(x) (x) +#endif /* __GNUC__ */ +static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } + +static PyObject *__pyx_m = NULL; +static PyObject *__pyx_d; +static PyObject *__pyx_b; +static PyObject *__pyx_cython_runtime = NULL; +static PyObject *__pyx_empty_tuple; +static PyObject *__pyx_empty_bytes; +static PyObject *__pyx_empty_unicode; +static int __pyx_lineno; +static int __pyx_clineno = 0; +static const char * __pyx_cfilenm= __FILE__; +static const char *__pyx_filename; + + +static const char *__pyx_f[] = { + "src\\gevent\\queue.py", + "src\\gevent\\_queue.pxd", + "src\\gevent\\__greenlet_primitives.pxd", + "src\\gevent\\__waiter.pxd", + "src\\gevent\\__abstract_linkable.pxd", + "src\\gevent\\_event.pxd", +}; + +/*--- Type declarations ---*/ +struct __pyx_obj_6gevent_21__greenlet_primitives_TrackedRawGreenlet; +struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop; +struct __pyx_obj_6gevent_8__waiter_Waiter; +struct __pyx_obj_6gevent_8__waiter_MultipleWaiter; +struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable; +struct __pyx_obj_6gevent_6_event_Event; +struct __pyx_obj_6gevent_6_event_AsyncResult; +struct __pyx_obj_6gevent_6_queue_ItemWaiter; +struct __pyx_obj_6gevent_6_queue_Queue; +struct __pyx_obj_6gevent_6_queue_UnboundQueue; +struct __pyx_obj_6gevent_6_queue_PriorityQueue; +struct __pyx_obj_6gevent_6_queue_LifoQueue; +struct __pyx_obj_6gevent_6_queue_JoinableQueue; +struct __pyx_obj_6gevent_6_queue_Channel; +struct __pyx_opt_args_6gevent_19__abstract_linkable_16AbstractLinkable__wait_core; +struct __pyx_opt_args_6gevent_19__abstract_linkable_16AbstractLinkable__wait; + +/* "gevent/__abstract_linkable.pxd":51 + * cdef _check_and_notify(self) + * cpdef _notify_links(self) + * cdef _wait_core(self, timeout, catch=*) # <<<<<<<<<<<<<< + * cdef _wait_return_value(self, waited, wait_success) + * cdef _wait(self, timeout=*) + */ +struct __pyx_opt_args_6gevent_19__abstract_linkable_16AbstractLinkable__wait_core { + int __pyx_n; + PyObject *catch; +}; + +/* "gevent/__abstract_linkable.pxd":53 + * cdef _wait_core(self, timeout, catch=*) + * cdef _wait_return_value(self, waited, wait_success) + * cdef _wait(self, timeout=*) # <<<<<<<<<<<<<< + */ +struct __pyx_opt_args_6gevent_19__abstract_linkable_16AbstractLinkable__wait { + int __pyx_n; + PyObject *timeout; +}; +struct __pyx_opt_args_6gevent_6_event_11AsyncResult_get; +struct __pyx_opt_args_6gevent_6_event_11AsyncResult_wait; + +/* "gevent/_event.pxd":23 + * cdef public int _imap_task_index + * + * cpdef get(self, block=*, timeout=*) # <<<<<<<<<<<<<< + * cpdef bint successful(self) + * + */ +struct __pyx_opt_args_6gevent_6_event_11AsyncResult_get { + int __pyx_n; + PyObject *block; + PyObject *timeout; +}; + +/* "gevent/_event.pxd":26 + * cpdef bint successful(self) + * + * cpdef wait(self, timeout=*) # <<<<<<<<<<<<<< + * cpdef bint done(self) + * + */ +struct __pyx_opt_args_6gevent_6_event_11AsyncResult_wait { + int __pyx_n; + PyObject *timeout; +}; +struct __pyx_opt_args_6gevent_6_queue_5Queue_put; +struct __pyx_opt_args_6gevent_6_queue_5Queue_get; +struct __pyx_opt_args_6gevent_6_queue_5Queue_peek; +struct __pyx_opt_args_6gevent_6_queue_7Channel_get; +struct __pyx_opt_args_6gevent_6_queue_12UnboundQueue_put; + +/* "gevent/_queue.pxd":37 + * cpdef bint full(self) + * + * cpdef put(self, item, block=*, timeout=*) # <<<<<<<<<<<<<< + * cpdef put_nowait(self, item) + * + */ +struct __pyx_opt_args_6gevent_6_queue_5Queue_put { + int __pyx_n; + PyObject *block; + PyObject *timeout; +}; + +/* "gevent/_queue.pxd":42 + * cdef __get_or_peek(self, method, block, timeout) + * + * cpdef get(self, block=*, timeout=*) # <<<<<<<<<<<<<< + * cpdef get_nowait(self) + * cpdef peek(self, block=*, timeout=*) + */ +struct __pyx_opt_args_6gevent_6_queue_5Queue_get { + int __pyx_n; + PyObject *block; + PyObject *timeout; +}; + +/* "gevent/_queue.pxd":44 + * cpdef get(self, block=*, timeout=*) + * cpdef get_nowait(self) + * cpdef peek(self, block=*, timeout=*) # <<<<<<<<<<<<<< + * cpdef peek_nowait(self) + * + */ +struct __pyx_opt_args_6gevent_6_queue_5Queue_peek { + int __pyx_n; + PyObject *block; + PyObject *timeout; +}; + +/* "gevent/_queue.pxd":71 + * cdef _event_unlock + * + * cpdef get(self, block=*, timeout=*) # <<<<<<<<<<<<<< + * cpdef get_nowait(self) + * + */ +struct __pyx_opt_args_6gevent_6_queue_7Channel_get { + int __pyx_n; + PyObject *block; + PyObject *timeout; +}; + +/* "src/gevent/queue.py":425 + * self.putters = None # Will never be used. + * + * def put(self, item, block=True, timeout=None): # <<<<<<<<<<<<<< + * self._put(item) + * if self.getters: + */ +struct __pyx_opt_args_6gevent_6_queue_12UnboundQueue_put { + int __pyx_n; + PyObject *block; + PyObject *timeout; +}; + +/* "gevent/__greenlet_primitives.pxd":37 + * return PyGreenlet_Switch(self, NULL, NULL) + * + * cdef class TrackedRawGreenlet(greenlet): # <<<<<<<<<<<<<< + * pass + * + */ +struct __pyx_obj_6gevent_21__greenlet_primitives_TrackedRawGreenlet { + PyGreenlet __pyx_base; +}; + + +/* "gevent/__greenlet_primitives.pxd":40 + * pass + * + * cdef class SwitchOutGreenletWithLoop(TrackedRawGreenlet): # <<<<<<<<<<<<<< + * cdef public loop + * + */ +struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop { + struct __pyx_obj_6gevent_21__greenlet_primitives_TrackedRawGreenlet __pyx_base; + struct __pyx_vtabstruct_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *__pyx_vtab; + PyObject *loop; +}; + + +/* "gevent/__waiter.pxd":33 + * _greenlet_imported = True + * + * cdef class Waiter: # <<<<<<<<<<<<<< + * cdef readonly SwitchOutGreenletWithLoop hub + * cdef readonly greenlet greenlet + */ +struct __pyx_obj_6gevent_8__waiter_Waiter { + PyObject_HEAD + struct __pyx_vtabstruct_6gevent_8__waiter_Waiter *__pyx_vtab; + struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *hub; + PyGreenlet *greenlet; + PyObject *value; + PyObject *_exception; +}; + + +/* "gevent/__waiter.pxd":47 + * @cython.final + * @cython.internal + * cdef class MultipleWaiter(Waiter): # <<<<<<<<<<<<<< + * cdef list _values + */ +struct __pyx_obj_6gevent_8__waiter_MultipleWaiter { + struct __pyx_obj_6gevent_8__waiter_Waiter __pyx_base; + PyObject *_values; +}; + + +/* "gevent/__abstract_linkable.pxd":32 + * cdef void _init() + * + * cdef class AbstractLinkable(object): # <<<<<<<<<<<<<< + * # We declare the __weakref__ here in the base (even though + * # that's not really what we want) as a workaround for a Cython + */ +struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable { + PyObject_HEAD + struct __pyx_vtabstruct_6gevent_19__abstract_linkable_AbstractLinkable *__pyx_vtab; + PyObject *__weakref__; + struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *hub; + PyObject *_notifier; + PyObject *_links; + int _notify_all; +}; + + +/* "gevent/_event.pxd":13 + * cdef Timeout + * + * cdef class Event(AbstractLinkable): # <<<<<<<<<<<<<< + * cdef bint _flag + * + */ +struct __pyx_obj_6gevent_6_event_Event { + struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable __pyx_base; + int _flag; +}; + + +/* "gevent/_event.pxd":16 + * cdef bint _flag + * + * cdef class AsyncResult(AbstractLinkable): # <<<<<<<<<<<<<< + * cdef readonly _value + * cdef readonly tuple _exc_info + */ +struct __pyx_obj_6gevent_6_event_AsyncResult { + struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable __pyx_base; + PyObject *_value; + PyObject *_exc_info; + int _imap_task_index; +}; + + +/* "gevent/_queue.pxd":14 + * @cython.final + * @cython.internal + * cdef class ItemWaiter(Waiter): # <<<<<<<<<<<<<< + * cdef readonly item + * cdef readonly queue + */ +struct __pyx_obj_6gevent_6_queue_ItemWaiter { + struct __pyx_obj_6gevent_8__waiter_Waiter __pyx_base; + PyObject *item; + PyObject *queue; +}; + + +/* "gevent/_queue.pxd":18 + * cdef readonly queue + * + * cdef class Queue: # <<<<<<<<<<<<<< + * cdef __weakref__ + * cdef readonly hub + */ +struct __pyx_obj_6gevent_6_queue_Queue { + PyObject_HEAD + struct __pyx_vtabstruct_6gevent_6_queue_Queue *__pyx_vtab; + PyObject *__weakref__; + PyObject *hub; + PyObject *queue; + PyObject *getters; + PyObject *putters; + PyObject *_event_unlock; + Py_ssize_t _maxsize; +}; + + +/* "gevent/_queue.pxd":50 + * + * @cython.final + * cdef class UnboundQueue(Queue): # <<<<<<<<<<<<<< + * pass + * + */ +struct __pyx_obj_6gevent_6_queue_UnboundQueue { + struct __pyx_obj_6gevent_6_queue_Queue __pyx_base; +}; + + +/* "gevent/_queue.pxd":53 + * pass + * + * cdef class PriorityQueue(Queue): # <<<<<<<<<<<<<< + * pass + * + */ +struct __pyx_obj_6gevent_6_queue_PriorityQueue { + struct __pyx_obj_6gevent_6_queue_Queue __pyx_base; +}; + + +/* "gevent/_queue.pxd":56 + * pass + * + * cdef class LifoQueue(Queue): # <<<<<<<<<<<<<< + * pass + * + */ +struct __pyx_obj_6gevent_6_queue_LifoQueue { + struct __pyx_obj_6gevent_6_queue_Queue __pyx_base; +}; + + +/* "gevent/_queue.pxd":59 + * pass + * + * cdef class JoinableQueue(Queue): # <<<<<<<<<<<<<< + * cdef Event _cond + * cdef readonly int unfinished_tasks + */ +struct __pyx_obj_6gevent_6_queue_JoinableQueue { + struct __pyx_obj_6gevent_6_queue_Queue __pyx_base; + struct __pyx_obj_6gevent_6_event_Event *_cond; + int unfinished_tasks; +}; + + +/* "gevent/_queue.pxd":64 + * + * + * cdef class Channel: # <<<<<<<<<<<<<< + * cdef __weakref__ + * cdef readonly getters + */ +struct __pyx_obj_6gevent_6_queue_Channel { + PyObject_HEAD + struct __pyx_vtabstruct_6gevent_6_queue_Channel *__pyx_vtab; + PyObject *__weakref__; + PyObject *getters; + PyObject *putters; + PyObject *hub; + PyObject *_event_unlock; +}; + + + +/* "gevent/__greenlet_primitives.pxd":40 + * pass + * + * cdef class SwitchOutGreenletWithLoop(TrackedRawGreenlet): # <<<<<<<<<<<<<< + * cdef public loop + * + */ + +struct __pyx_vtabstruct_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop { + PyObject *(*__pyx_switch)(struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *, int __pyx_skip_dispatch); + PyObject *(*switch_out)(struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *, int __pyx_skip_dispatch); +}; +static struct __pyx_vtabstruct_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *__pyx_vtabptr_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop; + + +/* "gevent/__waiter.pxd":33 + * _greenlet_imported = True + * + * cdef class Waiter: # <<<<<<<<<<<<<< + * cdef readonly SwitchOutGreenletWithLoop hub + * cdef readonly greenlet greenlet + */ + +struct __pyx_vtabstruct_6gevent_8__waiter_Waiter { + PyObject *(*get)(struct __pyx_obj_6gevent_8__waiter_Waiter *, int __pyx_skip_dispatch); + PyObject *(*clear)(struct __pyx_obj_6gevent_8__waiter_Waiter *, int __pyx_skip_dispatch); +}; +static struct __pyx_vtabstruct_6gevent_8__waiter_Waiter *__pyx_vtabptr_6gevent_8__waiter_Waiter; + + +/* "gevent/__waiter.pxd":47 + * @cython.final + * @cython.internal + * cdef class MultipleWaiter(Waiter): # <<<<<<<<<<<<<< + * cdef list _values + */ + +struct __pyx_vtabstruct_6gevent_8__waiter_MultipleWaiter { + struct __pyx_vtabstruct_6gevent_8__waiter_Waiter __pyx_base; +}; +static struct __pyx_vtabstruct_6gevent_8__waiter_MultipleWaiter *__pyx_vtabptr_6gevent_8__waiter_MultipleWaiter; + + +/* "gevent/__abstract_linkable.pxd":32 + * cdef void _init() + * + * cdef class AbstractLinkable(object): # <<<<<<<<<<<<<< + * # We declare the __weakref__ here in the base (even though + * # that's not really what we want) as a workaround for a Cython + */ + +struct __pyx_vtabstruct_6gevent_19__abstract_linkable_AbstractLinkable { + PyObject *(*rawlink)(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *, PyObject *, int __pyx_skip_dispatch); + int (*ready)(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *, int __pyx_skip_dispatch); + PyObject *(*unlink)(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *, PyObject *, int __pyx_skip_dispatch); + PyObject *(*_check_and_notify)(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *); + PyObject *(*_notify_links)(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *, int __pyx_skip_dispatch); + PyObject *(*_wait_core)(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *, PyObject *, struct __pyx_opt_args_6gevent_19__abstract_linkable_16AbstractLinkable__wait_core *__pyx_optional_args); + PyObject *(*_wait_return_value)(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *, PyObject *, PyObject *); + PyObject *(*_wait)(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable *, struct __pyx_opt_args_6gevent_19__abstract_linkable_16AbstractLinkable__wait *__pyx_optional_args); +}; +static struct __pyx_vtabstruct_6gevent_19__abstract_linkable_AbstractLinkable *__pyx_vtabptr_6gevent_19__abstract_linkable_AbstractLinkable; + + +/* "gevent/_event.pxd":13 + * cdef Timeout + * + * cdef class Event(AbstractLinkable): # <<<<<<<<<<<<<< + * cdef bint _flag + * + */ + +struct __pyx_vtabstruct_6gevent_6_event_Event { + struct __pyx_vtabstruct_6gevent_19__abstract_linkable_AbstractLinkable __pyx_base; +}; +static struct __pyx_vtabstruct_6gevent_6_event_Event *__pyx_vtabptr_6gevent_6_event_Event; + + +/* "gevent/_event.pxd":16 + * cdef bint _flag + * + * cdef class AsyncResult(AbstractLinkable): # <<<<<<<<<<<<<< + * cdef readonly _value + * cdef readonly tuple _exc_info + */ + +struct __pyx_vtabstruct_6gevent_6_event_AsyncResult { + struct __pyx_vtabstruct_6gevent_19__abstract_linkable_AbstractLinkable __pyx_base; + PyObject *(*get)(struct __pyx_obj_6gevent_6_event_AsyncResult *, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_6_event_11AsyncResult_get *__pyx_optional_args); + int (*successful)(struct __pyx_obj_6gevent_6_event_AsyncResult *, int __pyx_skip_dispatch); + PyObject *(*wait)(struct __pyx_obj_6gevent_6_event_AsyncResult *, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_6_event_11AsyncResult_wait *__pyx_optional_args); + int (*done)(struct __pyx_obj_6gevent_6_event_AsyncResult *, int __pyx_skip_dispatch); + int (*cancel)(struct __pyx_obj_6gevent_6_event_AsyncResult *, int __pyx_skip_dispatch); + int (*cancelled)(struct __pyx_obj_6gevent_6_event_AsyncResult *, int __pyx_skip_dispatch); +}; +static struct __pyx_vtabstruct_6gevent_6_event_AsyncResult *__pyx_vtabptr_6gevent_6_event_AsyncResult; + + +/* "src/gevent/queue.py":75 + * locals()['Waiter'] = gevent._waiter.Waiter + * + * class ItemWaiter(Waiter): # pylint:disable=undefined-variable # <<<<<<<<<<<<<< + * # pylint:disable=assigning-non-slot + * __slots__ = ( + */ + +struct __pyx_vtabstruct_6gevent_6_queue_ItemWaiter { + struct __pyx_vtabstruct_6gevent_8__waiter_Waiter __pyx_base; +}; +static struct __pyx_vtabstruct_6gevent_6_queue_ItemWaiter *__pyx_vtabptr_6gevent_6_queue_ItemWaiter; + + +/* "src/gevent/queue.py":93 + * return self.switch(self) + * + * class Queue(object): # <<<<<<<<<<<<<< + * """ + * Create a queue object with a given maximum size. + */ + +struct __pyx_vtabstruct_6gevent_6_queue_Queue { + PyObject *(*_get)(struct __pyx_obj_6gevent_6_queue_Queue *, int __pyx_skip_dispatch); + PyObject *(*_put)(struct __pyx_obj_6gevent_6_queue_Queue *, PyObject *, int __pyx_skip_dispatch); + PyObject *(*_peek)(struct __pyx_obj_6gevent_6_queue_Queue *, int __pyx_skip_dispatch); + Py_ssize_t (*qsize)(struct __pyx_obj_6gevent_6_queue_Queue *, int __pyx_skip_dispatch); + int (*empty)(struct __pyx_obj_6gevent_6_queue_Queue *, int __pyx_skip_dispatch); + int (*full)(struct __pyx_obj_6gevent_6_queue_Queue *, int __pyx_skip_dispatch); + PyObject *(*put)(struct __pyx_obj_6gevent_6_queue_Queue *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_6_queue_5Queue_put *__pyx_optional_args); + PyObject *(*put_nowait)(struct __pyx_obj_6gevent_6_queue_Queue *, PyObject *, int __pyx_skip_dispatch); + PyObject *(*__pyx___get_or_peek)(struct __pyx_obj_6gevent_6_queue_Queue *, PyObject *, PyObject *, PyObject *); + PyObject *(*get)(struct __pyx_obj_6gevent_6_queue_Queue *, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_6_queue_5Queue_get *__pyx_optional_args); + PyObject *(*get_nowait)(struct __pyx_obj_6gevent_6_queue_Queue *, int __pyx_skip_dispatch); + PyObject *(*peek)(struct __pyx_obj_6gevent_6_queue_Queue *, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_6_queue_5Queue_peek *__pyx_optional_args); + PyObject *(*peek_nowait)(struct __pyx_obj_6gevent_6_queue_Queue *, int __pyx_skip_dispatch); + PyObject *(*_schedule_unlock)(struct __pyx_obj_6gevent_6_queue_Queue *); +}; +static struct __pyx_vtabstruct_6gevent_6_queue_Queue *__pyx_vtabptr_6gevent_6_queue_Queue; + + +/* "src/gevent/queue.py":413 + * + * + * class UnboundQueue(Queue): # <<<<<<<<<<<<<< + * # A specialization of Queue that knows it can never + * # be bound. Changing its maxsize has no effect. + */ + +struct __pyx_vtabstruct_6gevent_6_queue_UnboundQueue { + struct __pyx_vtabstruct_6gevent_6_queue_Queue __pyx_base; +}; +static struct __pyx_vtabstruct_6gevent_6_queue_UnboundQueue *__pyx_vtabptr_6gevent_6_queue_UnboundQueue; + + +/* "src/gevent/queue.py":431 + * + * + * class PriorityQueue(Queue): # <<<<<<<<<<<<<< + * '''A subclass of :class:`Queue` that retrieves entries in priority order (lowest first). + * + */ + +struct __pyx_vtabstruct_6gevent_6_queue_PriorityQueue { + struct __pyx_vtabstruct_6gevent_6_queue_Queue __pyx_base; +}; +static struct __pyx_vtabstruct_6gevent_6_queue_PriorityQueue *__pyx_vtabptr_6gevent_6_queue_PriorityQueue; + + +/* "src/gevent/queue.py":456 + * + * + * class LifoQueue(Queue): # <<<<<<<<<<<<<< + * '''A subclass of :class:`Queue` that retrieves most recently added entries first.''' + * + */ + +struct __pyx_vtabstruct_6gevent_6_queue_LifoQueue { + struct __pyx_vtabstruct_6gevent_6_queue_Queue __pyx_base; +}; +static struct __pyx_vtabstruct_6gevent_6_queue_LifoQueue *__pyx_vtabptr_6gevent_6_queue_LifoQueue; + + +/* "src/gevent/queue.py":474 + * + * + * class JoinableQueue(Queue): # <<<<<<<<<<<<<< + * """ + * A subclass of :class:`Queue` that additionally has + */ + +struct __pyx_vtabstruct_6gevent_6_queue_JoinableQueue { + struct __pyx_vtabstruct_6gevent_6_queue_Queue __pyx_base; +}; +static struct __pyx_vtabstruct_6gevent_6_queue_JoinableQueue *__pyx_vtabptr_6gevent_6_queue_JoinableQueue; + + +/* "src/gevent/queue.py":560 + * + * + * class Channel(object): # <<<<<<<<<<<<<< + * + * __slots__ = ( + */ + +struct __pyx_vtabstruct_6gevent_6_queue_Channel { + PyObject *(*get)(struct __pyx_obj_6gevent_6_queue_Channel *, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_6_queue_7Channel_get *__pyx_optional_args); + PyObject *(*get_nowait)(struct __pyx_obj_6gevent_6_queue_Channel *, int __pyx_skip_dispatch); + PyObject *(*_schedule_unlock)(struct __pyx_obj_6gevent_6_queue_Channel *); +}; +static struct __pyx_vtabstruct_6gevent_6_queue_Channel *__pyx_vtabptr_6gevent_6_queue_Channel; + +/* --- Runtime support code (head) --- */ +/* Refnanny.proto */ +#ifndef CYTHON_REFNANNY + #define CYTHON_REFNANNY 0 +#endif +#if CYTHON_REFNANNY + typedef struct { + void (*INCREF)(void*, PyObject*, int); + void (*DECREF)(void*, PyObject*, int); + void (*GOTREF)(void*, PyObject*, int); + void (*GIVEREF)(void*, PyObject*, int); + void* (*SetupContext)(const char*, int, const char*); + void (*FinishContext)(void**); + } __Pyx_RefNannyAPIStruct; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); + #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; +#ifdef WITH_THREAD + #define __Pyx_RefNannySetupContext(name, acquire_gil)\ + if (acquire_gil) {\ + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ + PyGILState_Release(__pyx_gilstate_save);\ + } else {\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ + } +#else + #define __Pyx_RefNannySetupContext(name, acquire_gil)\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) +#endif + #define __Pyx_RefNannyFinishContext()\ + __Pyx_RefNanny->FinishContext(&__pyx_refnanny) + #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0) + #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) + #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) + #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) +#else + #define __Pyx_RefNannyDeclarations + #define __Pyx_RefNannySetupContext(name, acquire_gil) + #define __Pyx_RefNannyFinishContext() + #define __Pyx_INCREF(r) Py_INCREF(r) + #define __Pyx_DECREF(r) Py_DECREF(r) + #define __Pyx_GOTREF(r) + #define __Pyx_GIVEREF(r) + #define __Pyx_XINCREF(r) Py_XINCREF(r) + #define __Pyx_XDECREF(r) Py_XDECREF(r) + #define __Pyx_XGOTREF(r) + #define __Pyx_XGIVEREF(r) +#endif +#define __Pyx_XDECREF_SET(r, v) do {\ + PyObject *tmp = (PyObject *) r;\ + r = v; __Pyx_XDECREF(tmp);\ + } while (0) +#define __Pyx_DECREF_SET(r, v) do {\ + PyObject *tmp = (PyObject *) r;\ + r = v; __Pyx_DECREF(tmp);\ + } while (0) +#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) +#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) + +/* PyObjectGetAttrStr.proto */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); +#else +#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) +#endif + +/* GetBuiltinName.proto */ +static PyObject *__Pyx_GetBuiltinName(PyObject *name); + +/* PyCFunctionFastCall.proto */ +#if CYTHON_FAST_PYCCALL +static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs); +#else +#define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL) +#endif + +/* PyFunctionFastCall.proto */ +#if CYTHON_FAST_PYCALL +#define __Pyx_PyFunction_FastCall(func, args, nargs)\ + __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) +#if 1 || PY_VERSION_HEX < 0x030600B1 +static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs); +#else +#define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs) +#endif +#define __Pyx_BUILD_ASSERT_EXPR(cond)\ + (sizeof(char [1 - 2*!(cond)]) - 1) +#ifndef Py_MEMBER_SIZE +#define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member) +#endif + static size_t __pyx_pyframe_localsplus_offset = 0; + #include "frameobject.h" + #define __Pxy_PyFrame_Initialize_Offsets()\ + ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\ + (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus))) + #define __Pyx_PyFrame_GetLocalsplus(frame)\ + (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset)) +#endif + +/* PyObjectCall.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); +#else +#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) +#endif + +/* PyObjectCall2Args.proto */ +static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2); + +/* PyObjectCallMethO.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); +#endif + +/* PyObjectCallOneArg.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); + +/* GetTopmostException.proto */ +#if CYTHON_USE_EXC_INFO_STACK +static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate); +#endif + +/* PyThreadStateGet.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; +#define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; +#define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type +#else +#define __Pyx_PyThreadState_declare +#define __Pyx_PyThreadState_assign +#define __Pyx_PyErr_Occurred() PyErr_Occurred() +#endif + +/* SaveResetException.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); +#else +#define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb) +#define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb) +#endif + +/* PyErrExceptionMatches.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) +static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); +#else +#define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) +#endif + +/* PyErrFetchRestore.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) +#define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) +#define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) +#define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) +#define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); +static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) +#else +#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) +#endif +#else +#define __Pyx_PyErr_Clear() PyErr_Clear() +#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) +#define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) +#define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb) +#define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) +#endif + +/* RaiseArgTupleInvalid.proto */ +static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, + Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); + +/* RaiseDoubleKeywords.proto */ +static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); + +/* ParseKeywords.proto */ +static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\ + PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\ + const char* function_name); + +/* PyIntCompare.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, long intval, long inplace); + +/* Import.proto */ +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); + +/* GetModuleGlobalName.proto */ +#if CYTHON_USE_DICT_VERSIONS +#define __Pyx_GetModuleGlobalName(var, name) {\ + static PY_UINT64_T __pyx_dict_version = 0;\ + static PyObject *__pyx_dict_cached_value = NULL;\ + (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\ + (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\ + __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ +} +#define __Pyx_GetModuleGlobalNameUncached(var, name) {\ + PY_UINT64_T __pyx_dict_version;\ + PyObject *__pyx_dict_cached_value;\ + (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ +} +static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value); +#else +#define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name) +#define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name) +static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name); +#endif + +/* PyObjectCallNoArg.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); +#else +#define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL) +#endif + +/* GetItemInt.proto */ +#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ + __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\ + (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\ + __Pyx_GetItemInt_Generic(o, to_py_func(i)))) +#define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ + __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ + (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL)) +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, + int wraparound, int boundscheck); +#define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ + __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ + (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL)) +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, + int wraparound, int boundscheck); +static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j); +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, + int is_list, int wraparound, int boundscheck); + +/* ListAppend.proto */ +#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS +static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) { + PyListObject* L = (PyListObject*) list; + Py_ssize_t len = Py_SIZE(list); + if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) { + Py_INCREF(x); + PyList_SET_ITEM(list, len, x); + Py_SIZE(list) = len+1; + return 0; + } + return PyList_Append(list, x); +} +#else +#define __Pyx_PyList_Append(L,x) PyList_Append(L,x) +#endif + +/* PyObjectGetMethod.proto */ +static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method); + +/* PyObjectCallMethod1.proto */ +static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg); + +/* append.proto */ +static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x); + +/* GetAttr.proto */ +static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *); + +/* GetAttr3.proto */ +static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *); + +/* StringJoin.proto */ +#if PY_MAJOR_VERSION < 3 +#define __Pyx_PyString_Join __Pyx_PyBytes_Join +#define __Pyx_PyBaseString_Join(s, v) (PyUnicode_CheckExact(s) ? PyUnicode_Join(s, v) : __Pyx_PyBytes_Join(s, v)) +#else +#define __Pyx_PyString_Join PyUnicode_Join +#define __Pyx_PyBaseString_Join PyUnicode_Join +#endif +#if CYTHON_COMPILING_IN_CPYTHON + #if PY_MAJOR_VERSION < 3 + #define __Pyx_PyBytes_Join _PyString_Join + #else + #define __Pyx_PyBytes_Join _PyBytes_Join + #endif +#else +static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values); +#endif + +/* WriteUnraisableException.proto */ +static void __Pyx_WriteUnraisable(const char *name, int clineno, + int lineno, const char *filename, + int full_traceback, int nogil); + +/* RaiseException.proto */ +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); + +/* GetException.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb) +static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#else +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); +#endif + +/* SwapException.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#else +static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb); +#endif + +/* None.proto */ +static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname); + +/* PyObjectCallMethod0.proto */ +static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name); + +/* pop.proto */ +static CYTHON_INLINE PyObject* __Pyx__PyObject_Pop(PyObject* L); +#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS +static CYTHON_INLINE PyObject* __Pyx_PyList_Pop(PyObject* L); +#define __Pyx_PyObject_Pop(L) (likely(PyList_CheckExact(L)) ?\ + __Pyx_PyList_Pop(L) : __Pyx__PyObject_Pop(L)) +#else +#define __Pyx_PyList_Pop(L) __Pyx__PyObject_Pop(L) +#define __Pyx_PyObject_Pop(L) __Pyx__PyObject_Pop(L) +#endif + +/* UnpackUnboundCMethod.proto */ +typedef struct { + PyObject *type; + PyObject **method_name; + PyCFunction func; + PyObject *method; + int flag; +} __Pyx_CachedCFunction; + +/* CallUnboundCMethod0.proto */ +static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self); +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_CallUnboundCMethod0(cfunc, self)\ + (likely((cfunc)->func) ?\ + (likely((cfunc)->flag == METH_NOARGS) ? (*((cfunc)->func))(self, NULL) :\ + (PY_VERSION_HEX >= 0x030600B1 && likely((cfunc)->flag == METH_FASTCALL) ?\ + (PY_VERSION_HEX >= 0x030700A0 ?\ + (*(__Pyx_PyCFunctionFast)(void*)(PyCFunction)(cfunc)->func)(self, &__pyx_empty_tuple, 0) :\ + (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)(cfunc)->func)(self, &__pyx_empty_tuple, 0, NULL)) :\ + (PY_VERSION_HEX >= 0x030700A0 && (cfunc)->flag == (METH_FASTCALL | METH_KEYWORDS) ?\ + (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)(cfunc)->func)(self, &__pyx_empty_tuple, 0, NULL) :\ + (likely((cfunc)->flag == (METH_VARARGS | METH_KEYWORDS)) ? ((*(PyCFunctionWithKeywords)(void*)(PyCFunction)(cfunc)->func)(self, __pyx_empty_tuple, NULL)) :\ + ((cfunc)->flag == METH_VARARGS ? (*((cfunc)->func))(self, __pyx_empty_tuple) :\ + __Pyx__CallUnboundCMethod0(cfunc, self)))))) :\ + __Pyx__CallUnboundCMethod0(cfunc, self)) +#else +#define __Pyx_CallUnboundCMethod0(cfunc, self) __Pyx__CallUnboundCMethod0(cfunc, self) +#endif + +/* ImportFrom.proto */ +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); + +/* ExtTypeTest.proto */ +static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); + +/* PyIntCompare.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_NeObjC(PyObject *op1, PyObject *op2, long intval, long inplace); + +/* RaiseTooManyValuesToUnpack.proto */ +static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); + +/* RaiseNeedMoreValuesToUnpack.proto */ +static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); + +/* IterFinish.proto */ +static CYTHON_INLINE int __Pyx_IterFinish(void); + +/* UnpackItemEndCheck.proto */ +static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); + +/* CallNextTpDealloc.proto */ +static void __Pyx_call_next_tp_dealloc(PyObject* obj, destructor current_tp_dealloc); + +/* CallNextTpTraverse.proto */ +static int __Pyx_call_next_tp_traverse(PyObject* obj, visitproc v, void *a, traverseproc current_tp_traverse); + +/* CallNextTpClear.proto */ +static void __Pyx_call_next_tp_clear(PyObject* obj, inquiry current_tp_dealloc); + +/* TypeImport.proto */ +#ifndef __PYX_HAVE_RT_ImportType_proto +#define __PYX_HAVE_RT_ImportType_proto +enum __Pyx_ImportType_CheckSize { + __Pyx_ImportType_CheckSize_Error = 0, + __Pyx_ImportType_CheckSize_Warn = 1, + __Pyx_ImportType_CheckSize_Ignore = 2 +}; +static PyTypeObject *__Pyx_ImportType(PyObject* module, const char *module_name, const char *class_name, size_t size, enum __Pyx_ImportType_CheckSize check_size); +#endif + +/* GetVTable.proto */ +static void* __Pyx_GetVtable(PyObject *dict); + +/* PyObject_GenericGetAttrNoDict.proto */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name); +#else +#define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr +#endif + +/* SetVTable.proto */ +static int __Pyx_SetVtable(PyObject *dict, void *vtable); + +/* PyObject_GenericGetAttr.proto */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name); +#else +#define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr +#endif + +/* HasAttr.proto */ +static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *); + +/* FetchCommonType.proto */ +static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); + +/* CythonFunction.proto */ +#define __Pyx_CyFunction_USED 1 +#define __Pyx_CYFUNCTION_STATICMETHOD 0x01 +#define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 +#define __Pyx_CYFUNCTION_CCLASS 0x04 +#define __Pyx_CyFunction_GetClosure(f)\ + (((__pyx_CyFunctionObject *) (f))->func_closure) +#define __Pyx_CyFunction_GetClassObj(f)\ + (((__pyx_CyFunctionObject *) (f))->func_classobj) +#define __Pyx_CyFunction_Defaults(type, f)\ + ((type *)(((__pyx_CyFunctionObject *) (f))->defaults)) +#define __Pyx_CyFunction_SetDefaultsGetter(f, g)\ + ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g) +typedef struct { + PyCFunctionObject func; +#if PY_VERSION_HEX < 0x030500A0 + PyObject *func_weakreflist; +#endif + PyObject *func_dict; + PyObject *func_name; + PyObject *func_qualname; + PyObject *func_doc; + PyObject *func_globals; + PyObject *func_code; + PyObject *func_closure; + PyObject *func_classobj; + void *defaults; + int defaults_pyobjects; + int flags; + PyObject *defaults_tuple; + PyObject *defaults_kwdict; + PyObject *(*defaults_getter)(PyObject *); + PyObject *func_annotations; +} __pyx_CyFunctionObject; +static PyTypeObject *__pyx_CyFunctionType = 0; +#define __Pyx_CyFunction_Check(obj) (__Pyx_TypeCheck(obj, __pyx_CyFunctionType)) +#define __Pyx_CyFunction_NewEx(ml, flags, qualname, self, module, globals, code)\ + __Pyx_CyFunction_New(__pyx_CyFunctionType, ml, flags, qualname, self, module, globals, code) +static PyObject *__Pyx_CyFunction_New(PyTypeObject *, PyMethodDef *ml, + int flags, PyObject* qualname, + PyObject *self, + PyObject *module, PyObject *globals, + PyObject* code); +static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, + size_t size, + int pyobjects); +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, + PyObject *tuple); +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, + PyObject *dict); +static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m, + PyObject *dict); +static int __pyx_CyFunction_init(void); + +/* GetNameInClass.proto */ +#define __Pyx_GetNameInClass(var, nmspace, name) (var) = __Pyx__GetNameInClass(nmspace, name) +static PyObject *__Pyx__GetNameInClass(PyObject *nmspace, PyObject *name); + +/* Globals.proto */ +static PyObject* __Pyx_Globals(void); + +/* CLineInTraceback.proto */ +#ifdef CYTHON_CLINE_IN_TRACEBACK +#define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) +#else +static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line); +#endif + +/* CodeObjectCache.proto */ +typedef struct { + PyCodeObject* code_object; + int code_line; +} __Pyx_CodeObjectCacheEntry; +struct __Pyx_CodeObjectCache { + int count; + int max_count; + __Pyx_CodeObjectCacheEntry* entries; +}; +static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); +static PyCodeObject *__pyx_find_code_object(int code_line); +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); + +/* AddTraceback.proto */ +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename); + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); + +/* CIntFromPy.proto */ +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); + +/* CIntFromPy.proto */ +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); + +/* FastTypeChecks.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) +static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b); +static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type); +static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2); +#else +#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) +#define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) +#define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) +#endif +#define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) + +/* CheckBinaryVersion.proto */ +static int __Pyx_check_binary_version(void); + +/* PyObjectSetAttrStr.proto */ +#if CYTHON_USE_TYPE_SLOTS +#define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o, n, NULL) +static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value); +#else +#define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n) +#define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v) +#endif + +/* VoidPtrExport.proto */ +static int __Pyx_ExportVoidPtr(PyObject *name, void *p, const char *sig); + +/* FunctionExport.proto */ +static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig); + +/* VoidPtrImport.proto */ +static int __Pyx_ImportVoidPtr(PyObject *module, const char *name, void **p, const char *sig); + +/* FunctionImport.proto */ +static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig); + +/* InitStrings.proto */ +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); + +static PyObject *__pyx_f_6gevent_6_queue_5Queue__get(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/ +static PyObject *__pyx_f_6gevent_6_queue_5Queue__peek(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/ +static PyObject *__pyx_f_6gevent_6_queue_5Queue__put(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self, PyObject *__pyx_v_item, int __pyx_skip_dispatch); /* proto*/ +static Py_ssize_t __pyx_f_6gevent_6_queue_5Queue_qsize(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/ +static int __pyx_f_6gevent_6_queue_5Queue_empty(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/ +static int __pyx_f_6gevent_6_queue_5Queue_full(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/ +static PyObject *__pyx_f_6gevent_6_queue_5Queue_put(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self, PyObject *__pyx_v_item, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_6_queue_5Queue_put *__pyx_optional_args); /* proto*/ +static PyObject *__pyx_f_6gevent_6_queue_5Queue_put_nowait(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self, PyObject *__pyx_v_item, int __pyx_skip_dispatch); /* proto*/ +static PyObject *__pyx_f_6gevent_6_queue_5Queue___get_or_peek(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self, PyObject *__pyx_v_method, PyObject *__pyx_v_block, PyObject *__pyx_v_timeout); /* proto*/ +static PyObject *__pyx_f_6gevent_6_queue_5Queue_get(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_6_queue_5Queue_get *__pyx_optional_args); /* proto*/ +static PyObject *__pyx_f_6gevent_6_queue_5Queue_get_nowait(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/ +static PyObject *__pyx_f_6gevent_6_queue_5Queue_peek(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_6_queue_5Queue_peek *__pyx_optional_args); /* proto*/ +static PyObject *__pyx_f_6gevent_6_queue_5Queue_peek_nowait(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/ +static PyObject *__pyx_f_6gevent_6_queue_5Queue__schedule_unlock(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self); /* proto*/ +static PyObject *__pyx_f_6gevent_6_queue_12UnboundQueue_put(struct __pyx_obj_6gevent_6_queue_UnboundQueue *__pyx_v_self, PyObject *__pyx_v_item, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_6_queue_12UnboundQueue_put *__pyx_optional_args); /* proto*/ +static PyObject *__pyx_f_6gevent_6_queue_13PriorityQueue__put(struct __pyx_obj_6gevent_6_queue_PriorityQueue *__pyx_v_self, PyObject *__pyx_v_item, int __pyx_skip_dispatch); /* proto*/ +static PyObject *__pyx_f_6gevent_6_queue_13PriorityQueue__get(struct __pyx_obj_6gevent_6_queue_PriorityQueue *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/ +static PyObject *__pyx_f_6gevent_6_queue_9LifoQueue__put(struct __pyx_obj_6gevent_6_queue_LifoQueue *__pyx_v_self, PyObject *__pyx_v_item, int __pyx_skip_dispatch); /* proto*/ +static PyObject *__pyx_f_6gevent_6_queue_9LifoQueue__get(struct __pyx_obj_6gevent_6_queue_LifoQueue *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/ +static PyObject *__pyx_f_6gevent_6_queue_9LifoQueue__peek(struct __pyx_obj_6gevent_6_queue_LifoQueue *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/ +static PyObject *__pyx_f_6gevent_6_queue_13JoinableQueue__put(struct __pyx_obj_6gevent_6_queue_JoinableQueue *__pyx_v_self, PyObject *__pyx_v_item, int __pyx_skip_dispatch); /* proto*/ +static PyObject *__pyx_f_6gevent_6_queue_7Channel_get(struct __pyx_obj_6gevent_6_queue_Channel *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_6_queue_7Channel_get *__pyx_optional_args); /* proto*/ +static PyObject *__pyx_f_6gevent_6_queue_7Channel_get_nowait(struct __pyx_obj_6gevent_6_queue_Channel *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/ +static PyObject *__pyx_f_6gevent_6_queue_7Channel__schedule_unlock(struct __pyx_obj_6gevent_6_queue_Channel *__pyx_v_self); /* proto*/ + +/* Module declarations from 'cython' */ + +/* Module declarations from 'greenlet' */ + +/* Module declarations from 'gevent.__greenlet_primitives' */ +static PyTypeObject *__pyx_ptype_6gevent_21__greenlet_primitives_greenlet = 0; +static PyTypeObject *__pyx_ptype_6gevent_21__greenlet_primitives_TrackedRawGreenlet = 0; +static PyTypeObject *__pyx_ptype_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop = 0; +static PyObject **__pyx_vp_6gevent_21__greenlet_primitives_get_objects = 0; +#define __pyx_v_6gevent_21__greenlet_primitives_get_objects (*__pyx_vp_6gevent_21__greenlet_primitives_get_objects) +static PyObject **__pyx_vp_6gevent_21__greenlet_primitives_wref = 0; +#define __pyx_v_6gevent_21__greenlet_primitives_wref (*__pyx_vp_6gevent_21__greenlet_primitives_wref) +static PyObject **__pyx_vp_6gevent_21__greenlet_primitives_BlockingSwitchOutError = 0; +#define __pyx_v_6gevent_21__greenlet_primitives_BlockingSwitchOutError (*__pyx_vp_6gevent_21__greenlet_primitives_BlockingSwitchOutError) +static int *__pyx_vp_6gevent_21__greenlet_primitives__greenlet_imported = 0; +#define __pyx_v_6gevent_21__greenlet_primitives__greenlet_imported (*__pyx_vp_6gevent_21__greenlet_primitives__greenlet_imported) + +/* Module declarations from 'gevent.__hub_local' */ +static PyObject **__pyx_vp_6gevent_11__hub_local__threadlocal = 0; +#define __pyx_v_6gevent_11__hub_local__threadlocal (*__pyx_vp_6gevent_11__hub_local__threadlocal) +static struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *(*__pyx_f_6gevent_11__hub_local_get_hub_noargs)(int __pyx_skip_dispatch); /*proto*/ + +/* Module declarations from 'gevent.__waiter' */ +static PyTypeObject *__pyx_ptype_6gevent_8__waiter_greenlet = 0; +static PyTypeObject *__pyx_ptype_6gevent_8__waiter_Waiter = 0; +static PyTypeObject *__pyx_ptype_6gevent_8__waiter_MultipleWaiter = 0; +static PyObject **__pyx_vp_6gevent_8__waiter_sys = 0; +#define __pyx_v_6gevent_8__waiter_sys (*__pyx_vp_6gevent_8__waiter_sys) +static PyObject **__pyx_vp_6gevent_8__waiter_ConcurrentObjectUseError = 0; +#define __pyx_v_6gevent_8__waiter_ConcurrentObjectUseError (*__pyx_vp_6gevent_8__waiter_ConcurrentObjectUseError) +static int *__pyx_vp_6gevent_8__waiter__greenlet_imported = 0; +#define __pyx_v_6gevent_8__waiter__greenlet_imported (*__pyx_vp_6gevent_8__waiter__greenlet_imported) +static PyObject **__pyx_vp_6gevent_8__waiter__NONE = 0; +#define __pyx_v_6gevent_8__waiter__NONE (*__pyx_vp_6gevent_8__waiter__NONE) + +/* Module declarations from 'gevent.__abstract_linkable' */ +static PyTypeObject *__pyx_ptype_6gevent_19__abstract_linkable_greenlet = 0; +static PyTypeObject *__pyx_ptype_6gevent_19__abstract_linkable_AbstractLinkable = 0; +static PyObject **__pyx_vp_6gevent_19__abstract_linkable_InvalidSwitchError = 0; +#define __pyx_v_6gevent_19__abstract_linkable_InvalidSwitchError (*__pyx_vp_6gevent_19__abstract_linkable_InvalidSwitchError) +static PyObject **__pyx_vp_6gevent_19__abstract_linkable_Timeout = 0; +#define __pyx_v_6gevent_19__abstract_linkable_Timeout (*__pyx_vp_6gevent_19__abstract_linkable_Timeout) +static int *__pyx_vp_6gevent_19__abstract_linkable__greenlet_imported = 0; +#define __pyx_v_6gevent_19__abstract_linkable__greenlet_imported (*__pyx_vp_6gevent_19__abstract_linkable__greenlet_imported) + +/* Module declarations from 'gevent._event' */ +static PyTypeObject *__pyx_ptype_6gevent_6_event_Event = 0; +static PyTypeObject *__pyx_ptype_6gevent_6_event_AsyncResult = 0; +static PyObject **__pyx_vp_6gevent_6_event__None = 0; +#define __pyx_v_6gevent_6_event__None (*__pyx_vp_6gevent_6_event__None) +static PyObject **__pyx_vp_6gevent_6_event_reraise = 0; +#define __pyx_v_6gevent_6_event_reraise (*__pyx_vp_6gevent_6_event_reraise) +static PyObject **__pyx_vp_6gevent_6_event_dump_traceback = 0; +#define __pyx_v_6gevent_6_event_dump_traceback (*__pyx_vp_6gevent_6_event_dump_traceback) +static PyObject **__pyx_vp_6gevent_6_event_load_traceback = 0; +#define __pyx_v_6gevent_6_event_load_traceback (*__pyx_vp_6gevent_6_event_load_traceback) +static PyObject **__pyx_vp_6gevent_6_event_Timeout = 0; +#define __pyx_v_6gevent_6_event_Timeout (*__pyx_vp_6gevent_6_event_Timeout) + +/* Module declarations from 'gevent._queue' */ +static PyTypeObject *__pyx_ptype_6gevent_6_queue_ItemWaiter = 0; +static PyTypeObject *__pyx_ptype_6gevent_6_queue_Queue = 0; +static PyTypeObject *__pyx_ptype_6gevent_6_queue_UnboundQueue = 0; +static PyTypeObject *__pyx_ptype_6gevent_6_queue_PriorityQueue = 0; +static PyTypeObject *__pyx_ptype_6gevent_6_queue_LifoQueue = 0; +static PyTypeObject *__pyx_ptype_6gevent_6_queue_JoinableQueue = 0; +static PyTypeObject *__pyx_ptype_6gevent_6_queue_Channel = 0; +static PyObject *__pyx_v_6gevent_6_queue__heappush = 0; +static PyObject *__pyx_v_6gevent_6_queue__heappop = 0; +static PyObject *__pyx_v_6gevent_6_queue__heapify = 0; +static PyObject *__pyx_f_6gevent_6_queue__safe_remove(PyObject *, PyObject *); /*proto*/ +#define __Pyx_MODULE_NAME "gevent._queue" +extern int __pyx_module_is_main_gevent___queue; +int __pyx_module_is_main_gevent___queue = 0; + +/* Implementation of 'gevent._queue' */ +static PyObject *__pyx_builtin_ValueError; +static PyObject *__pyx_builtin_DeprecationWarning; +static PyObject *__pyx_builtin_hex; +static PyObject *__pyx_builtin_id; +static PyObject *__pyx_builtin_StopIteration; +static const char __pyx_k_q[] = "q"; +static const char __pyx_k__2[] = " "; +static const char __pyx_k__3[] = ""; +static const char __pyx_k_id[] = "id"; +static const char __pyx_k_all[] = "__all__"; +static const char __pyx_k_get[] = "_get"; +static const char __pyx_k_hex[] = "hex"; +static const char __pyx_k_hub[] = "hub"; +static const char __pyx_k_pop[] = "pop"; +static const char __pyx_k_put[] = "_put"; +static const char __pyx_k_s_s[] = "<%s%s>"; +static const char __pyx_k_set[] = "set"; +static const char __pyx_k_sys[] = "sys"; +static const char __pyx_k_Full[] = "Full"; +static const char __pyx_k_cond[] = "_cond"; +static const char __pyx_k_copy[] = "copy"; +static const char __pyx_k_full[] = "full"; +static const char __pyx_k_init[] = "__init__"; +static const char __pyx_k_item[] = "item"; +static const char __pyx_k_join[] = "join"; +static const char __pyx_k_loop[] = "loop"; +static const char __pyx_k_main[] = "__main__"; +static const char __pyx_k_name[] = "__name__"; +static const char __pyx_k_next[] = "__next__"; +static const char __pyx_k_peek[] = "_peek"; +static const char __pyx_k_self[] = "self"; +static const char __pyx_k_test[] = "__test__"; +static const char __pyx_k_wait[] = "wait"; +static const char __pyx_k_warn[] = "warn"; +static const char __pyx_k_Empty[] = "Empty"; +static const char __pyx_k_Event[] = "Event"; +static const char __pyx_k_Queue[] = "Queue"; +static const char __pyx_k_block[] = "block"; +static const char __pyx_k_clear[] = "clear"; +static const char __pyx_k_close[] = "close"; +static const char __pyx_k_deque[] = "deque"; +static const char __pyx_k_empty[] = "empty"; +static const char __pyx_k_get_2[] = "get"; +static const char __pyx_k_heapq[] = "heapq"; +static const char __pyx_k_items[] = "items"; +static const char __pyx_k_put_2[] = "put"; +static const char __pyx_k_qsize[] = "qsize"; +static const char __pyx_k_queue[] = "queue"; +static const char __pyx_k_s_s_2[] = "<%s %s>"; +static const char __pyx_k_slots[] = "__slots__"; +static const char __pyx_k_throw[] = "throw"; +static const char __pyx_k_Waiter[] = "Waiter"; +static const char __pyx_k_append[] = "append"; +static const char __pyx_k_cancel[] = "cancel"; +static const char __pyx_k_format[] = "_format"; +static const char __pyx_k_getter[] = "getter"; +static const char __pyx_k_gevent[] = "gevent"; +static const char __pyx_k_import[] = "__import__"; +static const char __pyx_k_next_2[] = "next"; +static const char __pyx_k_peek_2[] = "peek"; +static const char __pyx_k_putter[] = "putter"; +static const char __pyx_k_remove[] = "remove"; +static const char __pyx_k_repeat[] = "repeat"; +static const char __pyx_k_result[] = "result"; +static const char __pyx_k_switch[] = "switch"; +static const char __pyx_k_unlock[] = "_unlock"; +static const char __pyx_k_waiter[] = "_waiter"; +static const char __pyx_k_Channel[] = "Channel"; +static const char __pyx_k_Timeout[] = "Timeout"; +static const char __pyx_k_get_hub[] = "get_hub"; +static const char __pyx_k_getters[] = "getters"; +static const char __pyx_k_heapify[] = "_heapify"; +static const char __pyx_k_heappop[] = "_heappop"; +static const char __pyx_k_imports[] = "__imports__"; +static const char __pyx_k_maxsize[] = "maxsize"; +static const char __pyx_k_popleft[] = "popleft"; +static const char __pyx_k_putters[] = "putters"; +static const char __pyx_k_queue_2[] = "__queue__"; +static const char __pyx_k_queue_r[] = "queue=%r"; +static const char __pyx_k_timeout[] = "timeout"; +static const char __pyx_k_weakref[] = "__weakref__"; +static const char __pyx_k_exc_info[] = "exc_info"; +static const char __pyx_k_greenlet[] = "greenlet"; +static const char __pyx_k_heappush[] = "_heappush"; +static const char __pyx_k_pyx_capi[] = "__pyx_capi__"; +static const char __pyx_k_s_at_s_s[] = "<%s at %s%s>"; +static const char __pyx_k_waiter_2[] = "waiter"; +static const char __pyx_k_warnings[] = "warnings"; +static const char __pyx_k_LifoQueue[] = "LifoQueue"; +static const char __pyx_k_Queue_get[] = "Queue.get"; +static const char __pyx_k_Queue_put[] = "Queue.put"; +static const char __pyx_k_getters_s[] = "getters[%s]"; +static const char __pyx_k_heapify_2[] = "heapify"; +static const char __pyx_k_heappop_2[] = "heappop"; +static const char __pyx_k_maxsize_2[] = "_maxsize"; +static const char __pyx_k_maxsize_r[] = "maxsize=%r"; +static const char __pyx_k_putters_s[] = "putters[%s]"; +static const char __pyx_k_task_done[] = "task_done"; +static const char __pyx_k_ItemWaiter[] = "ItemWaiter"; +static const char __pyx_k_Queue__get[] = "Queue._get"; +static const char __pyx_k_Queue__put[] = "Queue._put"; +static const char __pyx_k_Queue_copy[] = "Queue.copy"; +static const char __pyx_k_Queue_full[] = "Queue.full"; +static const char __pyx_k_Queue_peek[] = "Queue.peek"; +static const char __pyx_k_ValueError[] = "ValueError"; +static const char __pyx_k_extensions[] = "__extensions__"; +static const char __pyx_k_get_nowait[] = "get_nowait"; +static const char __pyx_k_getcurrent[] = "getcurrent"; +static const char __pyx_k_heappush_2[] = "heappush"; +static const char __pyx_k_implements[] = "__implements__"; +static const char __pyx_k_put_nowait[] = "put_nowait"; +static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__"; +static const char __pyx_k_s_at_s_s_2[] = "<%s at %s %s>"; +static const char __pyx_k_stacklevel[] = "stacklevel"; +static const char __pyx_k_warn_depth[] = "_warn_depth"; +static const char __pyx_k_Channel_get[] = "Channel.get"; +static const char __pyx_k_Channel_put[] = "Channel.put"; +static const char __pyx_k_Queue__peek[] = "Queue._peek"; +static const char __pyx_k_Queue_empty[] = "Queue.empty"; +static const char __pyx_k_Queue_qsize[] = "Queue.qsize"; +static const char __pyx_k_SimpleQueue[] = "SimpleQueue"; +static const char __pyx_k_collections[] = "collections"; +static const char __pyx_k_getters_s_2[] = " getters[%s]"; +static const char __pyx_k_peek_nowait[] = "peek_nowait"; +static const char __pyx_k_putters_s_2[] = " putters[%s]"; +static const char __pyx_k_Channel_full[] = "Channel.full"; +static const char __pyx_k_UnboundQueue[] = "UnboundQueue"; +static const char __pyx_k_create_queue[] = "_create_queue"; +static const char __pyx_k_event_unlock[] = "_event_unlock"; +static const char __pyx_k_gevent__util[] = "gevent._util"; +static const char __pyx_k_gevent_event[] = "gevent.event"; +static const char __pyx_k_run_callback[] = "run_callback"; +static const char __pyx_k_version_info[] = "version_info"; +static const char __pyx_k_Channel_empty[] = "Channel.empty"; +static const char __pyx_k_Channel_qsize[] = "Channel.qsize"; +static const char __pyx_k_JoinableQueue[] = "JoinableQueue"; +static const char __pyx_k_PriorityQueue[] = "PriorityQueue"; +static const char __pyx_k_PySimpleQueue[] = "_PySimpleQueue"; +static const char __pyx_k_Queue__format[] = "Queue._format"; +static const char __pyx_k_Queue__unlock[] = "Queue._unlock"; +static const char __pyx_k_StopIteration[] = "StopIteration"; +static const char __pyx_k_gevent__queue[] = "gevent._queue"; +static const char __pyx_k_LifoQueue__get[] = "LifoQueue._get"; +static const char __pyx_k_LifoQueue__put[] = "LifoQueue._put"; +static const char __pyx_k_get_hub_noargs[] = "get_hub_noargs"; +static const char __pyx_k_gevent__waiter[] = "gevent._waiter"; +static const char __pyx_k_gevent_timeout[] = "gevent.timeout"; +static const char __pyx_k_import_c_accel[] = "import_c_accel"; +static const char __pyx_k_put_and_switch[] = "put_and_switch"; +static const char __pyx_k_Channel__format[] = "Channel._format"; +static const char __pyx_k_Channel__unlock[] = "Channel._unlock"; +static const char __pyx_k_LifoQueue__peek[] = "LifoQueue._peek"; +static const char __pyx_k_tasks_s__cond_s[] = " tasks=%s _cond=%s"; +static const char __pyx_k_Queue_get_nowait[] = "Queue.get_nowait"; +static const char __pyx_k_Queue_put_nowait[] = "Queue.put_nowait"; +static const char __pyx_k_UnboundQueue_put[] = "UnboundQueue.put"; +static const char __pyx_k_unfinished_tasks[] = "unfinished_tasks"; +static const char __pyx_k_Queue_peek_nowait[] = "Queue.peek_nowait"; +static const char __pyx_k_gevent__hub_local[] = "gevent._hub_local"; +static const char __pyx_k_gevent_exceptions[] = "gevent.exceptions"; +static const char __pyx_k_Channel_get_nowait[] = "Channel.get_nowait"; +static const char __pyx_k_Channel_put_nowait[] = "Channel.put_nowait"; +static const char __pyx_k_DeprecationWarning[] = "DeprecationWarning"; +static const char __pyx_k_InvalidSwitchError[] = "InvalidSwitchError"; +static const char __pyx_k_JoinableQueue__put[] = "JoinableQueue._put"; +static const char __pyx_k_JoinableQueue_copy[] = "JoinableQueue.copy"; +static const char __pyx_k_JoinableQueue_join[] = "JoinableQueue.join"; +static const char __pyx_k_PriorityQueue__get[] = "PriorityQueue._get"; +static const char __pyx_k_PriorityQueue__put[] = "PriorityQueue._put"; +static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; +static const char __pyx_k_start_new_or_dummy[] = "_start_new_or_dummy"; +static const char __pyx_k_Queue__create_queue[] = "Queue._create_queue"; +static const char __pyx_k_src_gevent_queue_py[] = "src\\gevent\\queue.py"; +static const char __pyx_k_JoinableQueue__format[] = "JoinableQueue._format"; +static const char __pyx_k_JoinableQueue_task_done[] = "JoinableQueue.task_done"; +static const char __pyx_k_LifoQueue__create_queue[] = "LifoQueue._create_queue"; +static const char __pyx_k_ItemWaiter_put_and_switch[] = "ItemWaiter.put_and_switch"; +static const char __pyx_k_PriorityQueue__create_queue[] = "PriorityQueue._create_queue"; +static const char __pyx_k_UnboundQueue_has_no_maxsize[] = "UnboundQueue has no maxsize"; +static const char __pyx_k_Channels_have_a_maxsize_of_1[] = "Channels have a maxsize of 1"; +static const char __pyx_k_Invalid_switch_into_Channel_put[] = "Invalid switch into Channel.put: %r"; +static const char __pyx_k_Invalid_switch_into_Queue_get_r[] = "Invalid switch into Queue.get: %r"; +static const char __pyx_k_Invalid_switch_into_Queue_put_r[] = "Invalid switch into Queue.put: %r"; +static const char __pyx_k_Queue_0_now_equivalent_to_Queue[] = "Queue(0) now equivalent to Queue(None); if you want a channel, use Channel"; +static const char __pyx_k_Synchronized_queues_The_mod_gev[] = "\nSynchronized queues.\n\nThe :mod:`gevent.queue` module implements multi-producer, multi-consumer queues\nthat work across greenlets, with the API similar to the classes found in the\nstandard :mod:`Queue` and :class:`multiprocessing ` modules.\n\nThe classes in this module implement the iterator protocol. Iterating\nover a queue means repeatedly calling :meth:`get ` until\n:meth:`get ` returns ``StopIteration`` (specifically that\nclass, not an instance or subclass).\n\n >>> queue = gevent.queue.Queue()\n >>> queue.put(1)\n >>> queue.put(2)\n >>> queue.put(StopIteration)\n >>> for item in queue:\n ... print(item)\n 1\n 2\n\n.. versionchanged:: 1.0\n ``Queue(0)`` now means queue of infinite size, not a channel. A :exc:`DeprecationWarning`\n will be issued with this argument.\n"; +static const char __pyx_k_task_done_called_too_many_times[] = "task_done() called too many times"; +static PyObject *__pyx_n_s_Channel; +static PyObject *__pyx_n_s_Channel__format; +static PyObject *__pyx_n_s_Channel__unlock; +static PyObject *__pyx_n_s_Channel_empty; +static PyObject *__pyx_n_s_Channel_full; +static PyObject *__pyx_n_s_Channel_get; +static PyObject *__pyx_n_s_Channel_get_nowait; +static PyObject *__pyx_n_s_Channel_put; +static PyObject *__pyx_n_s_Channel_put_nowait; +static PyObject *__pyx_n_s_Channel_qsize; +static PyObject *__pyx_kp_s_Channels_have_a_maxsize_of_1; +static PyObject *__pyx_n_s_DeprecationWarning; +static PyObject *__pyx_n_s_Empty; +static PyObject *__pyx_n_s_Event; +static PyObject *__pyx_n_s_Full; +static PyObject *__pyx_n_s_InvalidSwitchError; +static PyObject *__pyx_kp_s_Invalid_switch_into_Channel_put; +static PyObject *__pyx_kp_s_Invalid_switch_into_Queue_get_r; +static PyObject *__pyx_kp_s_Invalid_switch_into_Queue_put_r; +static PyObject *__pyx_n_s_ItemWaiter; +static PyObject *__pyx_n_s_ItemWaiter_put_and_switch; +static PyObject *__pyx_n_s_JoinableQueue; +static PyObject *__pyx_n_s_JoinableQueue__format; +static PyObject *__pyx_n_s_JoinableQueue__put; +static PyObject *__pyx_n_s_JoinableQueue_copy; +static PyObject *__pyx_n_s_JoinableQueue_join; +static PyObject *__pyx_n_s_JoinableQueue_task_done; +static PyObject *__pyx_n_s_LifoQueue; +static PyObject *__pyx_n_s_LifoQueue__create_queue; +static PyObject *__pyx_n_s_LifoQueue__get; +static PyObject *__pyx_n_s_LifoQueue__peek; +static PyObject *__pyx_n_s_LifoQueue__put; +static PyObject *__pyx_n_s_PriorityQueue; +static PyObject *__pyx_n_s_PriorityQueue__create_queue; +static PyObject *__pyx_n_s_PriorityQueue__get; +static PyObject *__pyx_n_s_PriorityQueue__put; +static PyObject *__pyx_n_s_PySimpleQueue; +static PyObject *__pyx_n_s_Queue; +static PyObject *__pyx_kp_s_Queue_0_now_equivalent_to_Queue; +static PyObject *__pyx_n_s_Queue__create_queue; +static PyObject *__pyx_n_s_Queue__format; +static PyObject *__pyx_n_s_Queue__get; +static PyObject *__pyx_n_s_Queue__peek; +static PyObject *__pyx_n_s_Queue__put; +static PyObject *__pyx_n_s_Queue__unlock; +static PyObject *__pyx_n_s_Queue_copy; +static PyObject *__pyx_n_s_Queue_empty; +static PyObject *__pyx_n_s_Queue_full; +static PyObject *__pyx_n_s_Queue_get; +static PyObject *__pyx_n_s_Queue_get_nowait; +static PyObject *__pyx_n_s_Queue_peek; +static PyObject *__pyx_n_s_Queue_peek_nowait; +static PyObject *__pyx_n_s_Queue_put; +static PyObject *__pyx_n_s_Queue_put_nowait; +static PyObject *__pyx_n_s_Queue_qsize; +static PyObject *__pyx_n_s_SimpleQueue; +static PyObject *__pyx_n_s_StopIteration; +static PyObject *__pyx_n_s_Timeout; +static PyObject *__pyx_n_s_UnboundQueue; +static PyObject *__pyx_kp_s_UnboundQueue_has_no_maxsize; +static PyObject *__pyx_n_s_UnboundQueue_put; +static PyObject *__pyx_n_s_ValueError; +static PyObject *__pyx_n_s_Waiter; +static PyObject *__pyx_kp_s__2; +static PyObject *__pyx_kp_s__3; +static PyObject *__pyx_n_s_all; +static PyObject *__pyx_n_s_append; +static PyObject *__pyx_n_s_block; +static PyObject *__pyx_n_s_cancel; +static PyObject *__pyx_n_s_clear; +static PyObject *__pyx_n_s_cline_in_traceback; +static PyObject *__pyx_n_s_close; +static PyObject *__pyx_n_s_collections; +static PyObject *__pyx_n_s_cond; +static PyObject *__pyx_n_s_copy; +static PyObject *__pyx_n_s_create_queue; +static PyObject *__pyx_n_s_deque; +static PyObject *__pyx_n_s_empty; +static PyObject *__pyx_n_s_event_unlock; +static PyObject *__pyx_n_s_exc_info; +static PyObject *__pyx_n_s_extensions; +static PyObject *__pyx_n_s_format; +static PyObject *__pyx_n_s_full; +static PyObject *__pyx_n_s_get; +static PyObject *__pyx_n_s_get_2; +static PyObject *__pyx_n_s_get_hub; +static PyObject *__pyx_n_s_get_hub_noargs; +static PyObject *__pyx_n_s_get_nowait; +static PyObject *__pyx_n_s_getcurrent; +static PyObject *__pyx_n_s_getter; +static PyObject *__pyx_n_s_getters; +static PyObject *__pyx_kp_s_getters_s; +static PyObject *__pyx_kp_s_getters_s_2; +static PyObject *__pyx_n_s_gevent; +static PyObject *__pyx_n_s_gevent__hub_local; +static PyObject *__pyx_n_s_gevent__queue; +static PyObject *__pyx_n_s_gevent__util; +static PyObject *__pyx_n_s_gevent__waiter; +static PyObject *__pyx_n_s_gevent_event; +static PyObject *__pyx_n_s_gevent_exceptions; +static PyObject *__pyx_n_s_gevent_timeout; +static PyObject *__pyx_n_s_greenlet; +static PyObject *__pyx_n_s_heapify; +static PyObject *__pyx_n_s_heapify_2; +static PyObject *__pyx_n_s_heappop; +static PyObject *__pyx_n_s_heappop_2; +static PyObject *__pyx_n_s_heappush; +static PyObject *__pyx_n_s_heappush_2; +static PyObject *__pyx_n_s_heapq; +static PyObject *__pyx_n_s_hex; +static PyObject *__pyx_n_s_hub; +static PyObject *__pyx_n_s_id; +static PyObject *__pyx_n_s_implements; +static PyObject *__pyx_n_s_import; +static PyObject *__pyx_n_s_import_c_accel; +static PyObject *__pyx_n_s_imports; +static PyObject *__pyx_n_s_init; +static PyObject *__pyx_n_s_item; +static PyObject *__pyx_n_s_items; +static PyObject *__pyx_n_s_join; +static PyObject *__pyx_n_s_loop; +static PyObject *__pyx_n_s_main; +static PyObject *__pyx_n_s_maxsize; +static PyObject *__pyx_n_s_maxsize_2; +static PyObject *__pyx_kp_s_maxsize_r; +static PyObject *__pyx_n_s_name; +static PyObject *__pyx_n_s_next; +static PyObject *__pyx_n_s_next_2; +static PyObject *__pyx_n_s_peek; +static PyObject *__pyx_n_s_peek_2; +static PyObject *__pyx_n_s_peek_nowait; +static PyObject *__pyx_n_s_pop; +static PyObject *__pyx_n_s_popleft; +static PyObject *__pyx_n_s_put; +static PyObject *__pyx_n_s_put_2; +static PyObject *__pyx_n_s_put_and_switch; +static PyObject *__pyx_n_s_put_nowait; +static PyObject *__pyx_n_s_putter; +static PyObject *__pyx_n_s_putters; +static PyObject *__pyx_kp_s_putters_s; +static PyObject *__pyx_kp_s_putters_s_2; +static PyObject *__pyx_n_s_pyx_capi; +static PyObject *__pyx_n_s_pyx_vtable; +static PyObject *__pyx_n_s_q; +static PyObject *__pyx_n_s_qsize; +static PyObject *__pyx_n_s_queue; +static PyObject *__pyx_n_s_queue_2; +static PyObject *__pyx_kp_s_queue_r; +static PyObject *__pyx_n_s_remove; +static PyObject *__pyx_n_s_repeat; +static PyObject *__pyx_n_s_result; +static PyObject *__pyx_n_s_run_callback; +static PyObject *__pyx_kp_s_s_at_s_s; +static PyObject *__pyx_kp_s_s_at_s_s_2; +static PyObject *__pyx_kp_s_s_s; +static PyObject *__pyx_kp_s_s_s_2; +static PyObject *__pyx_n_s_self; +static PyObject *__pyx_n_s_set; +static PyObject *__pyx_n_s_slots; +static PyObject *__pyx_kp_s_src_gevent_queue_py; +static PyObject *__pyx_n_s_stacklevel; +static PyObject *__pyx_n_s_start_new_or_dummy; +static PyObject *__pyx_n_s_switch; +static PyObject *__pyx_n_s_sys; +static PyObject *__pyx_n_s_task_done; +static PyObject *__pyx_kp_s_task_done_called_too_many_times; +static PyObject *__pyx_kp_s_tasks_s__cond_s; +static PyObject *__pyx_n_s_test; +static PyObject *__pyx_n_s_throw; +static PyObject *__pyx_n_s_timeout; +static PyObject *__pyx_n_s_unfinished_tasks; +static PyObject *__pyx_n_s_unlock; +static PyObject *__pyx_n_s_version_info; +static PyObject *__pyx_n_s_wait; +static PyObject *__pyx_n_s_waiter; +static PyObject *__pyx_n_s_waiter_2; +static PyObject *__pyx_n_s_warn; +static PyObject *__pyx_n_s_warn_depth; +static PyObject *__pyx_n_s_warnings; +static PyObject *__pyx_n_s_weakref; +static int __pyx_pf_6gevent_6_queue_10ItemWaiter___init__(struct __pyx_obj_6gevent_6_queue_ItemWaiter *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_queue); /* proto */ +static PyObject *__pyx_pf_6gevent_6_queue_10ItemWaiter_2put_and_switch(struct __pyx_obj_6gevent_6_queue_ItemWaiter *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_6_queue_10ItemWaiter_4item___get__(struct __pyx_obj_6gevent_6_queue_ItemWaiter *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_6_queue_10ItemWaiter_5queue___get__(struct __pyx_obj_6gevent_6_queue_ItemWaiter *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_6_queue_5Queue___init__(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self, PyObject *__pyx_v_maxsize, PyObject *__pyx_v_items, PyObject *__pyx_v__warn_depth); /* proto */ +static PyObject *__pyx_pf_6gevent_6_queue_5Queue_7maxsize___get__(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_6_queue_5Queue_7maxsize_2__set__(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self, PyObject *__pyx_v_nv); /* proto */ +static PyObject *__pyx_pf_6gevent_6_queue_5Queue_2copy(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_6_queue_5Queue_4_create_queue(CYTHON_UNUSED struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self, PyObject *__pyx_v_items); /* proto */ +static PyObject *__pyx_pf_6gevent_6_queue_5Queue_6_get(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_6_queue_5Queue_8_peek(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_6_queue_5Queue_10_put(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self, PyObject *__pyx_v_item); /* proto */ +static PyObject *__pyx_pf_6gevent_6_queue_5Queue_12__repr__(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_6_queue_5Queue_14__str__(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_6_queue_5Queue_16_format(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_6_queue_5Queue_18qsize(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self); /* proto */ +static Py_ssize_t __pyx_pf_6gevent_6_queue_5Queue_20__len__(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_6_queue_5Queue_22__bool__(CYTHON_UNUSED struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_6_queue_5Queue_24__nonzero__(CYTHON_UNUSED struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_6_queue_5Queue_26empty(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_6_queue_5Queue_28full(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_6_queue_5Queue_30put(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_block, PyObject *__pyx_v_timeout); /* proto */ +static PyObject *__pyx_pf_6gevent_6_queue_5Queue_32put_nowait(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self, PyObject *__pyx_v_item); /* proto */ +static PyObject *__pyx_pf_6gevent_6_queue_5Queue_34get(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self, PyObject *__pyx_v_block, PyObject *__pyx_v_timeout); /* proto */ +static PyObject *__pyx_pf_6gevent_6_queue_5Queue_36get_nowait(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_6_queue_5Queue_38peek(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self, PyObject *__pyx_v_block, PyObject *__pyx_v_timeout); /* proto */ +static PyObject *__pyx_pf_6gevent_6_queue_5Queue_40peek_nowait(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_6_queue_5Queue_42_unlock(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_6_queue_5Queue_44__iter__(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_6_queue_5Queue_46__next__(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_6_queue_5Queue_3hub___get__(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_6_queue_5Queue_5queue___get__(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_6_queue_12UnboundQueue___init__(struct __pyx_obj_6gevent_6_queue_UnboundQueue *__pyx_v_self, PyObject *__pyx_v_maxsize, PyObject *__pyx_v_items); /* proto */ +static PyObject *__pyx_pf_6gevent_6_queue_12UnboundQueue_2put(struct __pyx_obj_6gevent_6_queue_UnboundQueue *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_block, PyObject *__pyx_v_timeout); /* proto */ +static PyObject *__pyx_pf_6gevent_6_queue_13PriorityQueue__create_queue(CYTHON_UNUSED struct __pyx_obj_6gevent_6_queue_PriorityQueue *__pyx_v_self, PyObject *__pyx_v_items); /* proto */ +static PyObject *__pyx_pf_6gevent_6_queue_13PriorityQueue_2_put(struct __pyx_obj_6gevent_6_queue_PriorityQueue *__pyx_v_self, PyObject *__pyx_v_item); /* proto */ +static PyObject *__pyx_pf_6gevent_6_queue_13PriorityQueue_4_get(struct __pyx_obj_6gevent_6_queue_PriorityQueue *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_6_queue_9LifoQueue__create_queue(CYTHON_UNUSED struct __pyx_obj_6gevent_6_queue_LifoQueue *__pyx_v_self, PyObject *__pyx_v_items); /* proto */ +static PyObject *__pyx_pf_6gevent_6_queue_9LifoQueue_2_put(struct __pyx_obj_6gevent_6_queue_LifoQueue *__pyx_v_self, PyObject *__pyx_v_item); /* proto */ +static PyObject *__pyx_pf_6gevent_6_queue_9LifoQueue_4_get(struct __pyx_obj_6gevent_6_queue_LifoQueue *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_6_queue_9LifoQueue_6_peek(struct __pyx_obj_6gevent_6_queue_LifoQueue *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_6_queue_13JoinableQueue___init__(struct __pyx_obj_6gevent_6_queue_JoinableQueue *__pyx_v_self, PyObject *__pyx_v_maxsize, PyObject *__pyx_v_items, PyObject *__pyx_v_unfinished_tasks); /* proto */ +static PyObject *__pyx_pf_6gevent_6_queue_13JoinableQueue_2copy(struct __pyx_obj_6gevent_6_queue_JoinableQueue *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_6_queue_13JoinableQueue_4_format(struct __pyx_obj_6gevent_6_queue_JoinableQueue *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_6_queue_13JoinableQueue_6_put(struct __pyx_obj_6gevent_6_queue_JoinableQueue *__pyx_v_self, PyObject *__pyx_v_item); /* proto */ +static PyObject *__pyx_pf_6gevent_6_queue_13JoinableQueue_8task_done(struct __pyx_obj_6gevent_6_queue_JoinableQueue *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_6_queue_13JoinableQueue_10join(struct __pyx_obj_6gevent_6_queue_JoinableQueue *__pyx_v_self, PyObject *__pyx_v_timeout); /* proto */ +static PyObject *__pyx_pf_6gevent_6_queue_13JoinableQueue_16unfinished_tasks___get__(struct __pyx_obj_6gevent_6_queue_JoinableQueue *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_6_queue_7Channel___init__(struct __pyx_obj_6gevent_6_queue_Channel *__pyx_v_self, PyObject *__pyx_v_maxsize); /* proto */ +static PyObject *__pyx_pf_6gevent_6_queue_7Channel_2__repr__(struct __pyx_obj_6gevent_6_queue_Channel *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_6_queue_7Channel_4__str__(struct __pyx_obj_6gevent_6_queue_Channel *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_6_queue_7Channel_6_format(struct __pyx_obj_6gevent_6_queue_Channel *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_6_queue_7Channel_7balance___get__(struct __pyx_obj_6gevent_6_queue_Channel *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_6_queue_7Channel_8qsize(CYTHON_UNUSED struct __pyx_obj_6gevent_6_queue_Channel *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_6_queue_7Channel_10empty(CYTHON_UNUSED struct __pyx_obj_6gevent_6_queue_Channel *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_6_queue_7Channel_12full(CYTHON_UNUSED struct __pyx_obj_6gevent_6_queue_Channel *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_6_queue_7Channel_14put(struct __pyx_obj_6gevent_6_queue_Channel *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_block, PyObject *__pyx_v_timeout); /* proto */ +static PyObject *__pyx_pf_6gevent_6_queue_7Channel_16put_nowait(struct __pyx_obj_6gevent_6_queue_Channel *__pyx_v_self, PyObject *__pyx_v_item); /* proto */ +static PyObject *__pyx_pf_6gevent_6_queue_7Channel_18get(struct __pyx_obj_6gevent_6_queue_Channel *__pyx_v_self, PyObject *__pyx_v_block, PyObject *__pyx_v_timeout); /* proto */ +static PyObject *__pyx_pf_6gevent_6_queue_7Channel_20get_nowait(struct __pyx_obj_6gevent_6_queue_Channel *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_6_queue_7Channel_22_unlock(struct __pyx_obj_6gevent_6_queue_Channel *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_6_queue_7Channel_24__iter__(struct __pyx_obj_6gevent_6_queue_Channel *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_6_queue_7Channel_26__next__(struct __pyx_obj_6gevent_6_queue_Channel *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_6_queue_7Channel_7getters___get__(struct __pyx_obj_6gevent_6_queue_Channel *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_6_queue_7Channel_7putters___get__(struct __pyx_obj_6gevent_6_queue_Channel *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_6_queue_7Channel_3hub___get__(struct __pyx_obj_6gevent_6_queue_Channel *__pyx_v_self); /* proto */ +static PyObject *__pyx_tp_new_6gevent_6_queue_ItemWaiter(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6gevent_6_queue_Queue(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6gevent_6_queue_UnboundQueue(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6gevent_6_queue_PriorityQueue(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6gevent_6_queue_LifoQueue(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6gevent_6_queue_JoinableQueue(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6gevent_6_queue_Channel(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static __Pyx_CachedCFunction __pyx_umethod_PyList_Type_pop = {0, &__pyx_n_s_pop, 0, 0, 0}; +static PyObject *__pyx_int_0; +static PyObject *__pyx_int_1; +static PyObject *__pyx_int_2; +static PyObject *__pyx_int_3; +static PyObject *__pyx_tuple_; +static PyObject *__pyx_tuple__4; +static PyObject *__pyx_tuple__5; +static PyObject *__pyx_tuple__6; +static PyObject *__pyx_tuple__7; +static PyObject *__pyx_tuple__8; +static PyObject *__pyx_tuple__10; +static PyObject *__pyx_tuple__11; +static PyObject *__pyx_tuple__13; +static PyObject *__pyx_tuple__15; +static PyObject *__pyx_tuple__17; +static PyObject *__pyx_tuple__19; +static PyObject *__pyx_tuple__21; +static PyObject *__pyx_tuple__23; +static PyObject *__pyx_tuple__25; +static PyObject *__pyx_tuple__27; +static PyObject *__pyx_tuple__29; +static PyObject *__pyx_tuple__31; +static PyObject *__pyx_tuple__33; +static PyObject *__pyx_tuple__35; +static PyObject *__pyx_tuple__37; +static PyObject *__pyx_tuple__39; +static PyObject *__pyx_tuple__41; +static PyObject *__pyx_tuple__43; +static PyObject *__pyx_tuple__45; +static PyObject *__pyx_tuple__47; +static PyObject *__pyx_tuple__49; +static PyObject *__pyx_tuple__51; +static PyObject *__pyx_tuple__53; +static PyObject *__pyx_tuple__55; +static PyObject *__pyx_tuple__57; +static PyObject *__pyx_tuple__59; +static PyObject *__pyx_tuple__60; +static PyObject *__pyx_tuple__62; +static PyObject *__pyx_tuple__64; +static PyObject *__pyx_tuple__66; +static PyObject *__pyx_tuple__68; +static PyObject *__pyx_tuple__70; +static PyObject *__pyx_tuple__71; +static PyObject *__pyx_tuple__73; +static PyObject *__pyx_tuple__75; +static PyObject *__pyx_tuple__77; +static PyObject *__pyx_tuple__79; +static PyObject *__pyx_tuple__81; +static PyObject *__pyx_tuple__83; +static PyObject *__pyx_tuple__85; +static PyObject *__pyx_tuple__87; +static PyObject *__pyx_codeobj__9; +static PyObject *__pyx_codeobj__12; +static PyObject *__pyx_codeobj__14; +static PyObject *__pyx_codeobj__16; +static PyObject *__pyx_codeobj__18; +static PyObject *__pyx_codeobj__20; +static PyObject *__pyx_codeobj__22; +static PyObject *__pyx_codeobj__24; +static PyObject *__pyx_codeobj__26; +static PyObject *__pyx_codeobj__28; +static PyObject *__pyx_codeobj__30; +static PyObject *__pyx_codeobj__32; +static PyObject *__pyx_codeobj__34; +static PyObject *__pyx_codeobj__36; +static PyObject *__pyx_codeobj__38; +static PyObject *__pyx_codeobj__40; +static PyObject *__pyx_codeobj__42; +static PyObject *__pyx_codeobj__44; +static PyObject *__pyx_codeobj__46; +static PyObject *__pyx_codeobj__48; +static PyObject *__pyx_codeobj__50; +static PyObject *__pyx_codeobj__52; +static PyObject *__pyx_codeobj__54; +static PyObject *__pyx_codeobj__56; +static PyObject *__pyx_codeobj__58; +static PyObject *__pyx_codeobj__61; +static PyObject *__pyx_codeobj__63; +static PyObject *__pyx_codeobj__65; +static PyObject *__pyx_codeobj__67; +static PyObject *__pyx_codeobj__69; +static PyObject *__pyx_codeobj__72; +static PyObject *__pyx_codeobj__74; +static PyObject *__pyx_codeobj__76; +static PyObject *__pyx_codeobj__78; +static PyObject *__pyx_codeobj__80; +static PyObject *__pyx_codeobj__82; +static PyObject *__pyx_codeobj__84; +static PyObject *__pyx_codeobj__86; +static PyObject *__pyx_codeobj__88; +/* Late includes */ + +/* "src/gevent/queue.py":64 + * # pylint:disable=assignment-from-no-return + * + * def _safe_remove(deq, item): # <<<<<<<<<<<<<< + * # For when the item may have been removed by + * # Queue._unlock + */ + +static PyObject *__pyx_f_6gevent_6_queue__safe_remove(PyObject *__pyx_v_deq, PyObject *__pyx_v_item) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + __Pyx_RefNannySetupContext("_safe_remove", 0); + + /* "src/gevent/queue.py":67 + * # For when the item may have been removed by + * # Queue._unlock + * try: # <<<<<<<<<<<<<< + * deq.remove(item) + * except ValueError: + */ + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "src/gevent/queue.py":68 + * # Queue._unlock + * try: + * deq.remove(item) # <<<<<<<<<<<<<< + * except ValueError: + * pass + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_deq, __pyx_n_s_remove); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 68, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); + if (likely(__pyx_t_6)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_5, function); + } + } + __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_v_item) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_item); + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 68, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "src/gevent/queue.py":67 + * # For when the item may have been removed by + * # Queue._unlock + * try: # <<<<<<<<<<<<<< + * deq.remove(item) + * except ValueError: + */ + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L8_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "src/gevent/queue.py":69 + * try: + * deq.remove(item) + * except ValueError: # <<<<<<<<<<<<<< + * pass + * + */ + __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ValueError); + if (__pyx_t_7) { + __Pyx_ErrRestore(0,0,0); + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + + /* "src/gevent/queue.py":67 + * # For when the item may have been removed by + * # Queue._unlock + * try: # <<<<<<<<<<<<<< + * deq.remove(item) + * except ValueError: + */ + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L8_try_end:; + } + + /* "src/gevent/queue.py":64 + * # pylint:disable=assignment-from-no-return + * + * def _safe_remove(deq, item): # <<<<<<<<<<<<<< + * # For when the item may have been removed by + * # Queue._unlock + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("gevent._queue._safe_remove", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/queue.py":82 + * ) + * + * def __init__(self, item, queue): # <<<<<<<<<<<<<< + * Waiter.__init__(self) # pylint:disable=undefined-variable + * self.item = item + */ + +/* Python wrapper */ +static int __pyx_pw_6gevent_6_queue_10ItemWaiter_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6gevent_6_queue_10ItemWaiter_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_item = 0; + PyObject *__pyx_v_queue = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_item,&__pyx_n_s_queue,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_item)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_queue)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(0, 82, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 82, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_item = values[0]; + __pyx_v_queue = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 82, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent._queue.ItemWaiter.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_6_queue_10ItemWaiter___init__(((struct __pyx_obj_6gevent_6_queue_ItemWaiter *)__pyx_v_self), __pyx_v_item, __pyx_v_queue); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_6_queue_10ItemWaiter___init__(struct __pyx_obj_6gevent_6_queue_ItemWaiter *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_queue) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "src/gevent/queue.py":83 + * + * def __init__(self, item, queue): + * Waiter.__init__(self) # pylint:disable=undefined-variable # <<<<<<<<<<<<<< + * self.item = item + * self.queue = queue + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_6gevent_8__waiter_Waiter), __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 83, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, ((PyObject *)__pyx_v_self)) : __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_v_self)); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 83, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/queue.py":84 + * def __init__(self, item, queue): + * Waiter.__init__(self) # pylint:disable=undefined-variable + * self.item = item # <<<<<<<<<<<<<< + * self.queue = queue + * + */ + __Pyx_INCREF(__pyx_v_item); + __Pyx_GIVEREF(__pyx_v_item); + __Pyx_GOTREF(__pyx_v_self->item); + __Pyx_DECREF(__pyx_v_self->item); + __pyx_v_self->item = __pyx_v_item; + + /* "src/gevent/queue.py":85 + * Waiter.__init__(self) # pylint:disable=undefined-variable + * self.item = item + * self.queue = queue # <<<<<<<<<<<<<< + * + * def put_and_switch(self): + */ + __Pyx_INCREF(__pyx_v_queue); + __Pyx_GIVEREF(__pyx_v_queue); + __Pyx_GOTREF(__pyx_v_self->queue); + __Pyx_DECREF(__pyx_v_self->queue); + __pyx_v_self->queue = __pyx_v_queue; + + /* "src/gevent/queue.py":82 + * ) + * + * def __init__(self, item, queue): # <<<<<<<<<<<<<< + * Waiter.__init__(self) # pylint:disable=undefined-variable + * self.item = item + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("gevent._queue.ItemWaiter.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/queue.py":87 + * self.queue = queue + * + * def put_and_switch(self): # <<<<<<<<<<<<<< + * self.queue._put(self.item) + * self.queue = None + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_queue_10ItemWaiter_3put_and_switch(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6gevent_6_queue_10ItemWaiter_2put_and_switch[] = "ItemWaiter.put_and_switch(self)"; +static PyMethodDef __pyx_mdef_6gevent_6_queue_10ItemWaiter_3put_and_switch = {"put_and_switch", (PyCFunction)__pyx_pw_6gevent_6_queue_10ItemWaiter_3put_and_switch, METH_NOARGS, __pyx_doc_6gevent_6_queue_10ItemWaiter_2put_and_switch}; +static PyObject *__pyx_pw_6gevent_6_queue_10ItemWaiter_3put_and_switch(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("put_and_switch (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6_queue_10ItemWaiter_2put_and_switch(((struct __pyx_obj_6gevent_6_queue_ItemWaiter *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_queue_10ItemWaiter_2put_and_switch(struct __pyx_obj_6gevent_6_queue_ItemWaiter *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("put_and_switch", 0); + + /* "src/gevent/queue.py":88 + * + * def put_and_switch(self): + * self.queue._put(self.item) # <<<<<<<<<<<<<< + * self.queue = None + * self.item = None + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->queue, __pyx_n_s_put); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 88, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_self->item) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_self->item); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 88, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/queue.py":89 + * def put_and_switch(self): + * self.queue._put(self.item) + * self.queue = None # <<<<<<<<<<<<<< + * self.item = None + * return self.switch(self) + */ + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->queue); + __Pyx_DECREF(__pyx_v_self->queue); + __pyx_v_self->queue = Py_None; + + /* "src/gevent/queue.py":90 + * self.queue._put(self.item) + * self.queue = None + * self.item = None # <<<<<<<<<<<<<< + * return self.switch(self) + * + */ + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->item); + __Pyx_DECREF(__pyx_v_self->item); + __pyx_v_self->item = Py_None; + + /* "src/gevent/queue.py":91 + * self.queue = None + * self.item = None + * return self.switch(self) # <<<<<<<<<<<<<< + * + * class Queue(object): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_switch); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 91, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, ((PyObject *)__pyx_v_self)) : __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_v_self)); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 91, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "src/gevent/queue.py":87 + * self.queue = queue + * + * def put_and_switch(self): # <<<<<<<<<<<<<< + * self.queue._put(self.item) + * self.queue = None + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("gevent._queue.ItemWaiter.put_and_switch", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/_queue.pxd":15 + * @cython.internal + * cdef class ItemWaiter(Waiter): + * cdef readonly item # <<<<<<<<<<<<<< + * cdef readonly queue + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_queue_10ItemWaiter_4item_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_6_queue_10ItemWaiter_4item_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6_queue_10ItemWaiter_4item___get__(((struct __pyx_obj_6gevent_6_queue_ItemWaiter *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_queue_10ItemWaiter_4item___get__(struct __pyx_obj_6gevent_6_queue_ItemWaiter *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->item); + __pyx_r = __pyx_v_self->item; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/_queue.pxd":16 + * cdef class ItemWaiter(Waiter): + * cdef readonly item + * cdef readonly queue # <<<<<<<<<<<<<< + * + * cdef class Queue: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_queue_10ItemWaiter_5queue_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_6_queue_10ItemWaiter_5queue_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6_queue_10ItemWaiter_5queue___get__(((struct __pyx_obj_6gevent_6_queue_ItemWaiter *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_queue_10ItemWaiter_5queue___get__(struct __pyx_obj_6gevent_6_queue_ItemWaiter *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->queue); + __pyx_r = __pyx_v_self->queue; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/queue.py":124 + * ) + * + * def __init__(self, maxsize=None, items=(), _warn_depth=2): # <<<<<<<<<<<<<< + * if maxsize is not None and maxsize <= 0: + * if maxsize == 0: + */ + +/* Python wrapper */ +static int __pyx_pw_6gevent_6_queue_5Queue_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6gevent_6_queue_5Queue_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_maxsize = 0; + PyObject *__pyx_v_items = 0; + PyObject *__pyx_v__warn_depth = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_maxsize,&__pyx_n_s_items,&__pyx_n_s_warn_depth,0}; + PyObject* values[3] = {0,0,0}; + values[0] = ((PyObject *)Py_None); + values[1] = ((PyObject *)__pyx_empty_tuple); + values[2] = ((PyObject *)__pyx_int_2); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_maxsize); + if (value) { values[0] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 1: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_items); + if (value) { values[1] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 2: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_warn_depth); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 124, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_maxsize = values[0]; + __pyx_v_items = values[1]; + __pyx_v__warn_depth = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 124, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent._queue.Queue.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_6_queue_5Queue___init__(((struct __pyx_obj_6gevent_6_queue_Queue *)__pyx_v_self), __pyx_v_maxsize, __pyx_v_items, __pyx_v__warn_depth); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_6_queue_5Queue___init__(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self, PyObject *__pyx_v_maxsize, PyObject *__pyx_v_items, PyObject *__pyx_v__warn_depth) { + PyObject *__pyx_v_warnings = NULL; + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + Py_ssize_t __pyx_t_7; + Py_ssize_t __pyx_t_8; + __Pyx_RefNannySetupContext("__init__", 0); + __Pyx_INCREF(__pyx_v_maxsize); + + /* "src/gevent/queue.py":125 + * + * def __init__(self, maxsize=None, items=(), _warn_depth=2): + * if maxsize is not None and maxsize <= 0: # <<<<<<<<<<<<<< + * if maxsize == 0: + * import warnings + */ + __pyx_t_2 = (__pyx_v_maxsize != Py_None); + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + } else { + __pyx_t_1 = __pyx_t_3; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_4 = PyObject_RichCompare(__pyx_v_maxsize, __pyx_int_0, Py_LE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 125, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 125, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_1 = __pyx_t_3; + __pyx_L4_bool_binop_done:; + if (__pyx_t_1) { + + /* "src/gevent/queue.py":126 + * def __init__(self, maxsize=None, items=(), _warn_depth=2): + * if maxsize is not None and maxsize <= 0: + * if maxsize == 0: # <<<<<<<<<<<<<< + * import warnings + * warnings.warn( + */ + __pyx_t_4 = __Pyx_PyInt_EqObjC(__pyx_v_maxsize, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 126, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 126, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_1) { + + /* "src/gevent/queue.py":127 + * if maxsize is not None and maxsize <= 0: + * if maxsize == 0: + * import warnings # <<<<<<<<<<<<<< + * warnings.warn( + * 'Queue(0) now equivalent to Queue(None); if you want a channel, use Channel', + */ + __pyx_t_4 = __Pyx_Import(__pyx_n_s_warnings, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 127, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_v_warnings = __pyx_t_4; + __pyx_t_4 = 0; + + /* "src/gevent/queue.py":128 + * if maxsize == 0: + * import warnings + * warnings.warn( # <<<<<<<<<<<<<< + * 'Queue(0) now equivalent to Queue(None); if you want a channel, use Channel', + * DeprecationWarning, + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_warnings, __pyx_n_s_warn); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 128, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + + /* "src/gevent/queue.py":131 + * 'Queue(0) now equivalent to Queue(None); if you want a channel, use Channel', + * DeprecationWarning, + * stacklevel=_warn_depth) # <<<<<<<<<<<<<< + * maxsize = None + * + */ + __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 131, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_stacklevel, __pyx_v__warn_depth) < 0) __PYX_ERR(0, 131, __pyx_L1_error) + + /* "src/gevent/queue.py":128 + * if maxsize == 0: + * import warnings + * warnings.warn( # <<<<<<<<<<<<<< + * 'Queue(0) now equivalent to Queue(None); if you want a channel, use Channel', + * DeprecationWarning, + */ + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple_, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 128, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "src/gevent/queue.py":126 + * def __init__(self, maxsize=None, items=(), _warn_depth=2): + * if maxsize is not None and maxsize <= 0: + * if maxsize == 0: # <<<<<<<<<<<<<< + * import warnings + * warnings.warn( + */ + } + + /* "src/gevent/queue.py":132 + * DeprecationWarning, + * stacklevel=_warn_depth) + * maxsize = None # <<<<<<<<<<<<<< + * + * self._maxsize = maxsize if maxsize is not None else -1 + */ + __Pyx_INCREF(Py_None); + __Pyx_DECREF_SET(__pyx_v_maxsize, Py_None); + + /* "src/gevent/queue.py":125 + * + * def __init__(self, maxsize=None, items=(), _warn_depth=2): + * if maxsize is not None and maxsize <= 0: # <<<<<<<<<<<<<< + * if maxsize == 0: + * import warnings + */ + } + + /* "src/gevent/queue.py":134 + * maxsize = None + * + * self._maxsize = maxsize if maxsize is not None else -1 # <<<<<<<<<<<<<< + * # Explicitly maintain order for getters and putters that block + * # so that callers can consistently rely on getting things out + */ + __pyx_t_1 = (__pyx_v_maxsize != Py_None); + if ((__pyx_t_1 != 0)) { + __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_v_maxsize); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 134, __pyx_L1_error) + __pyx_t_7 = __pyx_t_8; + } else { + __pyx_t_7 = -1L; + } + __pyx_v_self->_maxsize = __pyx_t_7; + + /* "src/gevent/queue.py":147 + * # many waiters that removing an arbitrary element is a + * # bottleneck, though. + * self.getters = collections.deque() # <<<<<<<<<<<<<< + * self.putters = collections.deque() + * self.hub = get_hub() + */ + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_collections); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 147, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_deque); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 147, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + } + } + __pyx_t_6 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 147, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GIVEREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_v_self->getters); + __Pyx_DECREF(__pyx_v_self->getters); + __pyx_v_self->getters = __pyx_t_6; + __pyx_t_6 = 0; + + /* "src/gevent/queue.py":148 + * # bottleneck, though. + * self.getters = collections.deque() + * self.putters = collections.deque() # <<<<<<<<<<<<<< + * self.hub = get_hub() + * self._event_unlock = None + */ + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_collections); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 148, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_deque); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 148, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_5, function); + } + } + __pyx_t_6 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 148, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GIVEREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_v_self->putters); + __Pyx_DECREF(__pyx_v_self->putters); + __pyx_v_self->putters = __pyx_t_6; + __pyx_t_6 = 0; + + /* "src/gevent/queue.py":149 + * self.getters = collections.deque() + * self.putters = collections.deque() + * self.hub = get_hub() # <<<<<<<<<<<<<< + * self._event_unlock = None + * self.queue = self._create_queue(items) + */ + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_get_hub); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 149, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_5, function); + } + } + __pyx_t_6 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 149, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GIVEREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_v_self->hub); + __Pyx_DECREF(__pyx_v_self->hub); + __pyx_v_self->hub = __pyx_t_6; + __pyx_t_6 = 0; + + /* "src/gevent/queue.py":150 + * self.putters = collections.deque() + * self.hub = get_hub() + * self._event_unlock = None # <<<<<<<<<<<<<< + * self.queue = self._create_queue(items) + * + */ + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->_event_unlock); + __Pyx_DECREF(__pyx_v_self->_event_unlock); + __pyx_v_self->_event_unlock = Py_None; + + /* "src/gevent/queue.py":151 + * self.hub = get_hub() + * self._event_unlock = None + * self.queue = self._create_queue(items) # <<<<<<<<<<<<<< + * + * @property + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_create_queue); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 151, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_5, function); + } + } + __pyx_t_6 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_4, __pyx_v_items) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_items); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 151, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GIVEREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_v_self->queue); + __Pyx_DECREF(__pyx_v_self->queue); + __pyx_v_self->queue = __pyx_t_6; + __pyx_t_6 = 0; + + /* "src/gevent/queue.py":124 + * ) + * + * def __init__(self, maxsize=None, items=(), _warn_depth=2): # <<<<<<<<<<<<<< + * if maxsize is not None and maxsize <= 0: + * if maxsize == 0: + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("gevent._queue.Queue.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_warnings); + __Pyx_XDECREF(__pyx_v_maxsize); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/queue.py":154 + * + * @property + * def maxsize(self): # <<<<<<<<<<<<<< + * return self._maxsize if self._maxsize > 0 else None + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_queue_5Queue_7maxsize_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_6_queue_5Queue_7maxsize_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6_queue_5Queue_7maxsize___get__(((struct __pyx_obj_6gevent_6_queue_Queue *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_queue_5Queue_7maxsize___get__(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "src/gevent/queue.py":155 + * @property + * def maxsize(self): + * return self._maxsize if self._maxsize > 0 else None # <<<<<<<<<<<<<< + * + * @maxsize.setter + */ + __Pyx_XDECREF(__pyx_r); + if (((__pyx_v_self->_maxsize > 0) != 0)) { + __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->_maxsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 155, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __pyx_t_2; + __pyx_t_2 = 0; + } else { + __Pyx_INCREF(Py_None); + __pyx_t_1 = Py_None; + } + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "src/gevent/queue.py":154 + * + * @property + * def maxsize(self): # <<<<<<<<<<<<<< + * return self._maxsize if self._maxsize > 0 else None + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent._queue.Queue.maxsize.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/queue.py":158 + * + * @maxsize.setter + * def maxsize(self, nv): # <<<<<<<<<<<<<< + * # QQQ make maxsize into a property with setter that schedules unlock if necessary + * if nv is None or nv <= 0: + */ + +/* Python wrapper */ +static int __pyx_pw_6gevent_6_queue_5Queue_7maxsize_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_nv); /*proto*/ +static int __pyx_pw_6gevent_6_queue_5Queue_7maxsize_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_nv) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6_queue_5Queue_7maxsize_2__set__(((struct __pyx_obj_6gevent_6_queue_Queue *)__pyx_v_self), ((PyObject *)__pyx_v_nv)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_6_queue_5Queue_7maxsize_2__set__(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self, PyObject *__pyx_v_nv) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + Py_ssize_t __pyx_t_5; + __Pyx_RefNannySetupContext("__set__", 0); + + /* "src/gevent/queue.py":160 + * def maxsize(self, nv): + * # QQQ make maxsize into a property with setter that schedules unlock if necessary + * if nv is None or nv <= 0: # <<<<<<<<<<<<<< + * self._maxsize = -1 + * else: + */ + __pyx_t_2 = (__pyx_v_nv == Py_None); + __pyx_t_3 = (__pyx_t_2 != 0); + if (!__pyx_t_3) { + } else { + __pyx_t_1 = __pyx_t_3; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_4 = PyObject_RichCompare(__pyx_v_nv, __pyx_int_0, Py_LE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 160, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 160, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_1 = __pyx_t_3; + __pyx_L4_bool_binop_done:; + if (__pyx_t_1) { + + /* "src/gevent/queue.py":161 + * # QQQ make maxsize into a property with setter that schedules unlock if necessary + * if nv is None or nv <= 0: + * self._maxsize = -1 # <<<<<<<<<<<<<< + * else: + * self._maxsize = nv + */ + __pyx_v_self->_maxsize = -1L; + + /* "src/gevent/queue.py":160 + * def maxsize(self, nv): + * # QQQ make maxsize into a property with setter that schedules unlock if necessary + * if nv is None or nv <= 0: # <<<<<<<<<<<<<< + * self._maxsize = -1 + * else: + */ + goto __pyx_L3; + } + + /* "src/gevent/queue.py":163 + * self._maxsize = -1 + * else: + * self._maxsize = nv # <<<<<<<<<<<<<< + * + * def copy(self): + */ + /*else*/ { + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_v_nv); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 163, __pyx_L1_error) + __pyx_v_self->_maxsize = __pyx_t_5; + } + __pyx_L3:; + + /* "src/gevent/queue.py":158 + * + * @maxsize.setter + * def maxsize(self, nv): # <<<<<<<<<<<<<< + * # QQQ make maxsize into a property with setter that schedules unlock if necessary + * if nv is None or nv <= 0: + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("gevent._queue.Queue.maxsize.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/queue.py":165 + * self._maxsize = nv + * + * def copy(self): # <<<<<<<<<<<<<< + * return type(self)(self.maxsize, self.queue) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_queue_5Queue_3copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6gevent_6_queue_5Queue_2copy[] = "Queue.copy(self)"; +static PyMethodDef __pyx_mdef_6gevent_6_queue_5Queue_3copy = {"copy", (PyCFunction)__pyx_pw_6gevent_6_queue_5Queue_3copy, METH_NOARGS, __pyx_doc_6gevent_6_queue_5Queue_2copy}; +static PyObject *__pyx_pw_6gevent_6_queue_5Queue_3copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("copy (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6_queue_5Queue_2copy(((struct __pyx_obj_6gevent_6_queue_Queue *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_queue_5Queue_2copy(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + __Pyx_RefNannySetupContext("copy", 0); + + /* "src/gevent/queue.py":166 + * + * def copy(self): + * return type(self)(self.maxsize, self.queue) # <<<<<<<<<<<<<< + * + * def _create_queue(self, items=()): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_maxsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 166, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __pyx_t_3 = ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))); __pyx_t_4 = NULL; + __pyx_t_5 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_5 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_3)) { + PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_2, __pyx_v_self->queue}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 166, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { + PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_2, __pyx_v_self->queue}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 166, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } else + #endif + { + __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 166, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (__pyx_t_4) { + __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL; + } + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_t_2); + __Pyx_INCREF(__pyx_v_self->queue); + __Pyx_GIVEREF(__pyx_v_self->queue); + PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_self->queue); + __pyx_t_2 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 166, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "src/gevent/queue.py":165 + * self._maxsize = nv + * + * def copy(self): # <<<<<<<<<<<<<< + * return type(self)(self.maxsize, self.queue) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("gevent._queue.Queue.copy", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/queue.py":168 + * return type(self)(self.maxsize, self.queue) + * + * def _create_queue(self, items=()): # <<<<<<<<<<<<<< + * return collections.deque(items) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_queue_5Queue_5_create_queue(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6gevent_6_queue_5Queue_4_create_queue[] = "Queue._create_queue(self, items=())"; +static PyMethodDef __pyx_mdef_6gevent_6_queue_5Queue_5_create_queue = {"_create_queue", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_6_queue_5Queue_5_create_queue, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_6_queue_5Queue_4_create_queue}; +static PyObject *__pyx_pw_6gevent_6_queue_5Queue_5_create_queue(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_items = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_create_queue (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_items,0}; + PyObject* values[1] = {0}; + values[0] = ((PyObject *)__pyx_empty_tuple); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_items); + if (value) { values[0] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_create_queue") < 0)) __PYX_ERR(0, 168, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_items = values[0]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("_create_queue", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 168, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent._queue.Queue._create_queue", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_6_queue_5Queue_4_create_queue(((struct __pyx_obj_6gevent_6_queue_Queue *)__pyx_v_self), __pyx_v_items); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_queue_5Queue_4_create_queue(CYTHON_UNUSED struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self, PyObject *__pyx_v_items) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("_create_queue", 0); + + /* "src/gevent/queue.py":169 + * + * def _create_queue(self, items=()): + * return collections.deque(items) # <<<<<<<<<<<<<< + * + * def _get(self): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_collections); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 169, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_deque); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 169, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_2)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_v_items) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_items); + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 169, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "src/gevent/queue.py":168 + * return type(self)(self.maxsize, self.queue) + * + * def _create_queue(self, items=()): # <<<<<<<<<<<<<< + * return collections.deque(items) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("gevent._queue.Queue._create_queue", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/queue.py":171 + * return collections.deque(items) + * + * def _get(self): # <<<<<<<<<<<<<< + * return self.queue.popleft() + * + */ + +static PyObject *__pyx_pw_6gevent_6_queue_5Queue_7_get(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_f_6gevent_6_queue_5Queue__get(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self, int __pyx_skip_dispatch) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + __Pyx_RefNannySetupContext("_get", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0; + if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self)))))); + else { + PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + #endif + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 171, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_6_queue_5Queue_7_get)) { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 171, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0; + if (unlikely(type_dict_guard != tp_dict_version)) { + tp_dict_version = obj_dict_version = 0; + } + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + } + #endif + } + + /* "src/gevent/queue.py":172 + * + * def _get(self): + * return self.queue.popleft() # <<<<<<<<<<<<<< + * + * def _peek(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->queue, __pyx_n_s_popleft); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 172, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 172, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "src/gevent/queue.py":171 + * return collections.deque(items) + * + * def _get(self): # <<<<<<<<<<<<<< + * return self.queue.popleft() + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("gevent._queue.Queue._get", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_queue_5Queue_7_get(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6gevent_6_queue_5Queue_6_get[] = "Queue._get(self)"; +static PyMethodDef __pyx_mdef_6gevent_6_queue_5Queue_7_get = {"_get", (PyCFunction)__pyx_pw_6gevent_6_queue_5Queue_7_get, METH_NOARGS, __pyx_doc_6gevent_6_queue_5Queue_6_get}; +static PyObject *__pyx_pw_6gevent_6_queue_5Queue_7_get(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_get (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6_queue_5Queue_6_get(((struct __pyx_obj_6gevent_6_queue_Queue *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_queue_5Queue_6_get(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("_get", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6gevent_6_queue_5Queue__get(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 171, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent._queue.Queue._get", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/queue.py":174 + * return self.queue.popleft() + * + * def _peek(self): # <<<<<<<<<<<<<< + * return self.queue[0] + * + */ + +static PyObject *__pyx_pw_6gevent_6_queue_5Queue_9_peek(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_f_6gevent_6_queue_5Queue__peek(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self, int __pyx_skip_dispatch) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + __Pyx_RefNannySetupContext("_peek", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0; + if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self)))))); + else { + PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + #endif + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_peek); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 174, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_6_queue_5Queue_9_peek)) { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 174, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0; + if (unlikely(type_dict_guard != tp_dict_version)) { + tp_dict_version = obj_dict_version = 0; + } + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + } + #endif + } + + /* "src/gevent/queue.py":175 + * + * def _peek(self): + * return self.queue[0] # <<<<<<<<<<<<<< + * + * def _put(self, item): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_self->queue, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 175, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "src/gevent/queue.py":174 + * return self.queue.popleft() + * + * def _peek(self): # <<<<<<<<<<<<<< + * return self.queue[0] + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("gevent._queue.Queue._peek", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_queue_5Queue_9_peek(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6gevent_6_queue_5Queue_8_peek[] = "Queue._peek(self)"; +static PyMethodDef __pyx_mdef_6gevent_6_queue_5Queue_9_peek = {"_peek", (PyCFunction)__pyx_pw_6gevent_6_queue_5Queue_9_peek, METH_NOARGS, __pyx_doc_6gevent_6_queue_5Queue_8_peek}; +static PyObject *__pyx_pw_6gevent_6_queue_5Queue_9_peek(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_peek (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6_queue_5Queue_8_peek(((struct __pyx_obj_6gevent_6_queue_Queue *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_queue_5Queue_8_peek(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("_peek", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6gevent_6_queue_5Queue__peek(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 174, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent._queue.Queue._peek", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/queue.py":177 + * return self.queue[0] + * + * def _put(self, item): # <<<<<<<<<<<<<< + * self.queue.append(item) + * + */ + +static PyObject *__pyx_pw_6gevent_6_queue_5Queue_11_put(PyObject *__pyx_v_self, PyObject *__pyx_v_item); /*proto*/ +static PyObject *__pyx_f_6gevent_6_queue_5Queue__put(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self, PyObject *__pyx_v_item, int __pyx_skip_dispatch) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + __Pyx_RefNannySetupContext("_put", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0; + if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self)))))); + else { + PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + #endif + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_put); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 177, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_6_queue_5Queue_11_put)) { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_item) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_item); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 177, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0; + if (unlikely(type_dict_guard != tp_dict_version)) { + tp_dict_version = obj_dict_version = 0; + } + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + } + #endif + } + + /* "src/gevent/queue.py":178 + * + * def _put(self, item): + * self.queue.append(item) # <<<<<<<<<<<<<< + * + * def __repr__(self): + */ + __pyx_t_5 = __Pyx_PyObject_Append(__pyx_v_self->queue, __pyx_v_item); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 178, __pyx_L1_error) + + /* "src/gevent/queue.py":177 + * return self.queue[0] + * + * def _put(self, item): # <<<<<<<<<<<<<< + * self.queue.append(item) + * + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("gevent._queue.Queue._put", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_queue_5Queue_11_put(PyObject *__pyx_v_self, PyObject *__pyx_v_item); /*proto*/ +static char __pyx_doc_6gevent_6_queue_5Queue_10_put[] = "Queue._put(self, item)"; +static PyMethodDef __pyx_mdef_6gevent_6_queue_5Queue_11_put = {"_put", (PyCFunction)__pyx_pw_6gevent_6_queue_5Queue_11_put, METH_O, __pyx_doc_6gevent_6_queue_5Queue_10_put}; +static PyObject *__pyx_pw_6gevent_6_queue_5Queue_11_put(PyObject *__pyx_v_self, PyObject *__pyx_v_item) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_put (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6_queue_5Queue_10_put(((struct __pyx_obj_6gevent_6_queue_Queue *)__pyx_v_self), ((PyObject *)__pyx_v_item)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_queue_5Queue_10_put(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self, PyObject *__pyx_v_item) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("_put", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6gevent_6_queue_5Queue__put(__pyx_v_self, __pyx_v_item, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 177, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent._queue.Queue._put", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/queue.py":180 + * self.queue.append(item) + * + * def __repr__(self): # <<<<<<<<<<<<<< + * return '<%s at %s%s>' % (type(self).__name__, hex(id(self)), self._format()) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_queue_5Queue_13__repr__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_6_queue_5Queue_13__repr__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6_queue_5Queue_12__repr__(((struct __pyx_obj_6gevent_6_queue_Queue *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_queue_5Queue_12__repr__(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + __Pyx_RefNannySetupContext("__repr__", 0); + + /* "src/gevent/queue.py":181 + * + * def __repr__(self): + * return '<%s at %s%s>' % (type(self).__name__, hex(id(self)), self._format()) # <<<<<<<<<<<<<< + * + * def __str__(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))), __pyx_n_s_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 181, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 181, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_hex, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 181, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 181, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + } + } + __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 181, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 181, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_2); + __pyx_t_1 = 0; + __pyx_t_3 = 0; + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_s_at_s_s, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 181, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "src/gevent/queue.py":180 + * self.queue.append(item) + * + * def __repr__(self): # <<<<<<<<<<<<<< + * return '<%s at %s%s>' % (type(self).__name__, hex(id(self)), self._format()) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("gevent._queue.Queue.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/queue.py":183 + * return '<%s at %s%s>' % (type(self).__name__, hex(id(self)), self._format()) + * + * def __str__(self): # <<<<<<<<<<<<<< + * return '<%s%s>' % (type(self).__name__, self._format()) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_queue_5Queue_15__str__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_6_queue_5Queue_15__str__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__str__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6_queue_5Queue_14__str__(((struct __pyx_obj_6gevent_6_queue_Queue *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_queue_5Queue_14__str__(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + __Pyx_RefNannySetupContext("__str__", 0); + + /* "src/gevent/queue.py":184 + * + * def __str__(self): + * return '<%s%s>' % (type(self).__name__, self._format()) # <<<<<<<<<<<<<< + * + * def _format(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))), __pyx_n_s_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 184, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 184, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 184, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 184, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); + __pyx_t_1 = 0; + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_s_s, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 184, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "src/gevent/queue.py":183 + * return '<%s at %s%s>' % (type(self).__name__, hex(id(self)), self._format()) + * + * def __str__(self): # <<<<<<<<<<<<<< + * return '<%s%s>' % (type(self).__name__, self._format()) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("gevent._queue.Queue.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/queue.py":186 + * return '<%s%s>' % (type(self).__name__, self._format()) + * + * def _format(self): # <<<<<<<<<<<<<< + * result = [] + * if self.maxsize is not None: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_queue_5Queue_17_format(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6gevent_6_queue_5Queue_16_format[] = "Queue._format(self)"; +static PyMethodDef __pyx_mdef_6gevent_6_queue_5Queue_17_format = {"_format", (PyCFunction)__pyx_pw_6gevent_6_queue_5Queue_17_format, METH_NOARGS, __pyx_doc_6gevent_6_queue_5Queue_16_format}; +static PyObject *__pyx_pw_6gevent_6_queue_5Queue_17_format(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_format (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6_queue_5Queue_16_format(((struct __pyx_obj_6gevent_6_queue_Queue *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_queue_5Queue_16_format(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self) { + PyObject *__pyx_v_result = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + Py_ssize_t __pyx_t_6; + __Pyx_RefNannySetupContext("_format", 0); + + /* "src/gevent/queue.py":187 + * + * def _format(self): + * result = [] # <<<<<<<<<<<<<< + * if self.maxsize is not None: + * result.append('maxsize=%r' % (self.maxsize, )) + */ + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 187, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_result = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "src/gevent/queue.py":188 + * def _format(self): + * result = [] + * if self.maxsize is not None: # <<<<<<<<<<<<<< + * result.append('maxsize=%r' % (self.maxsize, )) + * if getattr(self, 'queue', None): + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_maxsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 188, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = (__pyx_t_1 != Py_None); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "src/gevent/queue.py":189 + * result = [] + * if self.maxsize is not None: + * result.append('maxsize=%r' % (self.maxsize, )) # <<<<<<<<<<<<<< + * if getattr(self, 'queue', None): + * result.append('queue=%r' % (self.queue, )) + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_maxsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 189, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 189, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_maxsize_r, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 189, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_1); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 189, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/queue.py":188 + * def _format(self): + * result = [] + * if self.maxsize is not None: # <<<<<<<<<<<<<< + * result.append('maxsize=%r' % (self.maxsize, )) + * if getattr(self, 'queue', None): + */ + } + + /* "src/gevent/queue.py":190 + * if self.maxsize is not None: + * result.append('maxsize=%r' % (self.maxsize, )) + * if getattr(self, 'queue', None): # <<<<<<<<<<<<<< + * result.append('queue=%r' % (self.queue, )) + * if self.getters: + */ + __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_queue, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 190, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 190, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_3) { + + /* "src/gevent/queue.py":191 + * result.append('maxsize=%r' % (self.maxsize, )) + * if getattr(self, 'queue', None): + * result.append('queue=%r' % (self.queue, )) # <<<<<<<<<<<<<< + * if self.getters: + * result.append('getters[%s]' % len(self.getters)) + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 191, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_self->queue); + __Pyx_GIVEREF(__pyx_v_self->queue); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->queue); + __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_queue_r, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 191, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_5 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_4); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 191, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "src/gevent/queue.py":190 + * if self.maxsize is not None: + * result.append('maxsize=%r' % (self.maxsize, )) + * if getattr(self, 'queue', None): # <<<<<<<<<<<<<< + * result.append('queue=%r' % (self.queue, )) + * if self.getters: + */ + } + + /* "src/gevent/queue.py":192 + * if getattr(self, 'queue', None): + * result.append('queue=%r' % (self.queue, )) + * if self.getters: # <<<<<<<<<<<<<< + * result.append('getters[%s]' % len(self.getters)) + * if self.putters: + */ + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_self->getters); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 192, __pyx_L1_error) + if (__pyx_t_3) { + + /* "src/gevent/queue.py":193 + * result.append('queue=%r' % (self.queue, )) + * if self.getters: + * result.append('getters[%s]' % len(self.getters)) # <<<<<<<<<<<<<< + * if self.putters: + * result.append('putters[%s]' % len(self.putters)) + */ + __pyx_t_4 = __pyx_v_self->getters; + __Pyx_INCREF(__pyx_t_4); + __pyx_t_6 = PyObject_Length(__pyx_t_4); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 193, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyInt_FromSsize_t(__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 193, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_getters_s, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 193, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_1); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 193, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/queue.py":192 + * if getattr(self, 'queue', None): + * result.append('queue=%r' % (self.queue, )) + * if self.getters: # <<<<<<<<<<<<<< + * result.append('getters[%s]' % len(self.getters)) + * if self.putters: + */ + } + + /* "src/gevent/queue.py":194 + * if self.getters: + * result.append('getters[%s]' % len(self.getters)) + * if self.putters: # <<<<<<<<<<<<<< + * result.append('putters[%s]' % len(self.putters)) + * if result: + */ + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_self->putters); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 194, __pyx_L1_error) + if (__pyx_t_3) { + + /* "src/gevent/queue.py":195 + * result.append('getters[%s]' % len(self.getters)) + * if self.putters: + * result.append('putters[%s]' % len(self.putters)) # <<<<<<<<<<<<<< + * if result: + * return ' ' + ' '.join(result) + */ + __pyx_t_1 = __pyx_v_self->putters; + __Pyx_INCREF(__pyx_t_1); + __pyx_t_6 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 195, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 195, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_putters_s, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 195, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_5 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_4); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 195, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "src/gevent/queue.py":194 + * if self.getters: + * result.append('getters[%s]' % len(self.getters)) + * if self.putters: # <<<<<<<<<<<<<< + * result.append('putters[%s]' % len(self.putters)) + * if result: + */ + } + + /* "src/gevent/queue.py":196 + * if self.putters: + * result.append('putters[%s]' % len(self.putters)) + * if result: # <<<<<<<<<<<<<< + * return ' ' + ' '.join(result) + * return '' + */ + __pyx_t_3 = (PyList_GET_SIZE(__pyx_v_result) != 0); + if (__pyx_t_3) { + + /* "src/gevent/queue.py":197 + * result.append('putters[%s]' % len(self.putters)) + * if result: + * return ' ' + ' '.join(result) # <<<<<<<<<<<<<< + * return '' + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = __Pyx_PyString_Join(__pyx_kp_s__2, __pyx_v_result); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 197, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = PyNumber_Add(__pyx_kp_s__2, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 197, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "src/gevent/queue.py":196 + * if self.putters: + * result.append('putters[%s]' % len(self.putters)) + * if result: # <<<<<<<<<<<<<< + * return ' ' + ' '.join(result) + * return '' + */ + } + + /* "src/gevent/queue.py":198 + * if result: + * return ' ' + ' '.join(result) + * return '' # <<<<<<<<<<<<<< + * + * def qsize(self): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_kp_s__3); + __pyx_r = __pyx_kp_s__3; + goto __pyx_L0; + + /* "src/gevent/queue.py":186 + * return '<%s%s>' % (type(self).__name__, self._format()) + * + * def _format(self): # <<<<<<<<<<<<<< + * result = [] + * if self.maxsize is not None: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("gevent._queue.Queue._format", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/queue.py":200 + * return '' + * + * def qsize(self): # <<<<<<<<<<<<<< + * """Return the size of the queue.""" + * return len(self.queue) + */ + +static PyObject *__pyx_pw_6gevent_6_queue_5Queue_19qsize(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static Py_ssize_t __pyx_f_6gevent_6_queue_5Queue_qsize(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self, int __pyx_skip_dispatch) { + Py_ssize_t __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + Py_ssize_t __pyx_t_5; + __Pyx_RefNannySetupContext("qsize", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0; + if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self)))))); + else { + PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + #endif + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_qsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 200, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_6_queue_5Queue_19qsize)) { + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 200, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 200, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_5; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0; + if (unlikely(type_dict_guard != tp_dict_version)) { + tp_dict_version = obj_dict_version = 0; + } + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + } + #endif + } + + /* "src/gevent/queue.py":202 + * def qsize(self): + * """Return the size of the queue.""" + * return len(self.queue) # <<<<<<<<<<<<<< + * + * def __len__(self): + */ + __pyx_t_1 = __pyx_v_self->queue; + __Pyx_INCREF(__pyx_t_1); + __pyx_t_5 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 202, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_5; + goto __pyx_L0; + + /* "src/gevent/queue.py":200 + * return '' + * + * def qsize(self): # <<<<<<<<<<<<<< + * """Return the size of the queue.""" + * return len(self.queue) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_WriteUnraisable("gevent._queue.Queue.qsize", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_queue_5Queue_19qsize(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6gevent_6_queue_5Queue_18qsize[] = "Queue.qsize(self) -> Py_ssize_t\nReturn the size of the queue."; +static PyMethodDef __pyx_mdef_6gevent_6_queue_5Queue_19qsize = {"qsize", (PyCFunction)__pyx_pw_6gevent_6_queue_5Queue_19qsize, METH_NOARGS, __pyx_doc_6gevent_6_queue_5Queue_18qsize}; +static PyObject *__pyx_pw_6gevent_6_queue_5Queue_19qsize(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("qsize (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6_queue_5Queue_18qsize(((struct __pyx_obj_6gevent_6_queue_Queue *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_queue_5Queue_18qsize(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("qsize", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyInt_FromSsize_t(__pyx_f_6gevent_6_queue_5Queue_qsize(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 200, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent._queue.Queue.qsize", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/queue.py":204 + * return len(self.queue) + * + * def __len__(self): # <<<<<<<<<<<<<< + * """ + * Return the size of the queue. This is the same as :meth:`qsize`. + */ + +/* Python wrapper */ +static Py_ssize_t __pyx_pw_6gevent_6_queue_5Queue_21__len__(PyObject *__pyx_v_self); /*proto*/ +static char __pyx_doc_6gevent_6_queue_5Queue_20__len__[] = "\n Return the size of the queue. This is the same as :meth:`qsize`.\n\n .. versionadded: 1.1b3\n\n Previously, getting len() of a queue would raise a TypeError.\n "; +#if CYTHON_COMPILING_IN_CPYTHON +struct wrapperbase __pyx_wrapperbase_6gevent_6_queue_5Queue_20__len__; +#endif +static Py_ssize_t __pyx_pw_6gevent_6_queue_5Queue_21__len__(PyObject *__pyx_v_self) { + Py_ssize_t __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__len__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6_queue_5Queue_20__len__(((struct __pyx_obj_6gevent_6_queue_Queue *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static Py_ssize_t __pyx_pf_6gevent_6_queue_5Queue_20__len__(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self) { + Py_ssize_t __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__len__", 0); + + /* "src/gevent/queue.py":213 + * """ + * + * return self.qsize() # <<<<<<<<<<<<<< + * + * def __bool__(self): + */ + __pyx_r = ((struct __pyx_vtabstruct_6gevent_6_queue_Queue *)__pyx_v_self->__pyx_vtab)->qsize(__pyx_v_self, 0); + goto __pyx_L0; + + /* "src/gevent/queue.py":204 + * return len(self.queue) + * + * def __len__(self): # <<<<<<<<<<<<<< + * """ + * Return the size of the queue. This is the same as :meth:`qsize`. + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/queue.py":215 + * return self.qsize() + * + * def __bool__(self): # <<<<<<<<<<<<<< + * """ + * A queue object is always True. + */ + +/* Python wrapper */ +static int __pyx_pw_6gevent_6_queue_5Queue_23__bool__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6gevent_6_queue_5Queue_23__bool__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__bool__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6_queue_5Queue_22__bool__(((struct __pyx_obj_6gevent_6_queue_Queue *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_6_queue_5Queue_22__bool__(CYTHON_UNUSED struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__bool__", 0); + + /* "src/gevent/queue.py":224 + * to return True for backwards compatibility. + * """ + * return True # <<<<<<<<<<<<<< + * + * def __nonzero__(self): + */ + __pyx_r = 1; + goto __pyx_L0; + + /* "src/gevent/queue.py":215 + * return self.qsize() + * + * def __bool__(self): # <<<<<<<<<<<<<< + * """ + * A queue object is always True. + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/queue.py":226 + * return True + * + * def __nonzero__(self): # <<<<<<<<<<<<<< + * # Py2. + * # For Cython; __bool__ becomes a special method that we can't + */ + +/* Python wrapper */ +static int __pyx_pw_6gevent_6_queue_5Queue_25__nonzero__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6gevent_6_queue_5Queue_25__nonzero__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__nonzero__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6_queue_5Queue_24__nonzero__(((struct __pyx_obj_6gevent_6_queue_Queue *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_6_queue_5Queue_24__nonzero__(CYTHON_UNUSED struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__nonzero__", 0); + + /* "src/gevent/queue.py":230 + * # For Cython; __bool__ becomes a special method that we can't + * # get by name. + * return True # <<<<<<<<<<<<<< + * + * def empty(self): + */ + __pyx_r = 1; + goto __pyx_L0; + + /* "src/gevent/queue.py":226 + * return True + * + * def __nonzero__(self): # <<<<<<<<<<<<<< + * # Py2. + * # For Cython; __bool__ becomes a special method that we can't + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/queue.py":232 + * return True + * + * def empty(self): # <<<<<<<<<<<<<< + * """Return ``True`` if the queue is empty, ``False`` otherwise.""" + * return not self.qsize() + */ + +static PyObject *__pyx_pw_6gevent_6_queue_5Queue_27empty(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static int __pyx_f_6gevent_6_queue_5Queue_empty(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self, int __pyx_skip_dispatch) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + __Pyx_RefNannySetupContext("empty", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0; + if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self)))))); + else { + PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + #endif + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_empty); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 232, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_6_queue_5Queue_27empty)) { + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 232, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 232, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_5; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0; + if (unlikely(type_dict_guard != tp_dict_version)) { + tp_dict_version = obj_dict_version = 0; + } + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + } + #endif + } + + /* "src/gevent/queue.py":234 + * def empty(self): + * """Return ``True`` if the queue is empty, ``False`` otherwise.""" + * return not self.qsize() # <<<<<<<<<<<<<< + * + * def full(self): + */ + __pyx_r = (!(((struct __pyx_vtabstruct_6gevent_6_queue_Queue *)__pyx_v_self->__pyx_vtab)->qsize(__pyx_v_self, 0) != 0)); + goto __pyx_L0; + + /* "src/gevent/queue.py":232 + * return True + * + * def empty(self): # <<<<<<<<<<<<<< + * """Return ``True`` if the queue is empty, ``False`` otherwise.""" + * return not self.qsize() + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_WriteUnraisable("gevent._queue.Queue.empty", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_queue_5Queue_27empty(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6gevent_6_queue_5Queue_26empty[] = "Queue.empty(self) -> bool\nReturn ``True`` if the queue is empty, ``False`` otherwise."; +static PyMethodDef __pyx_mdef_6gevent_6_queue_5Queue_27empty = {"empty", (PyCFunction)__pyx_pw_6gevent_6_queue_5Queue_27empty, METH_NOARGS, __pyx_doc_6gevent_6_queue_5Queue_26empty}; +static PyObject *__pyx_pw_6gevent_6_queue_5Queue_27empty(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("empty (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6_queue_5Queue_26empty(((struct __pyx_obj_6gevent_6_queue_Queue *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_queue_5Queue_26empty(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("empty", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_f_6gevent_6_queue_5Queue_empty(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 232, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent._queue.Queue.empty", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/queue.py":236 + * return not self.qsize() + * + * def full(self): # <<<<<<<<<<<<<< + * """Return ``True`` if the queue is full, ``False`` otherwise. + * + */ + +static PyObject *__pyx_pw_6gevent_6_queue_5Queue_29full(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static int __pyx_f_6gevent_6_queue_5Queue_full(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self, int __pyx_skip_dispatch) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + int __pyx_t_6; + __Pyx_RefNannySetupContext("full", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0; + if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self)))))); + else { + PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + #endif + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_full); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 236, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_6_queue_5Queue_29full)) { + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 236, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 236, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_5; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0; + if (unlikely(type_dict_guard != tp_dict_version)) { + tp_dict_version = obj_dict_version = 0; + } + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + } + #endif + } + + /* "src/gevent/queue.py":241 + * ``Queue(None)`` is never full. + * """ + * return self._maxsize > 0 and self.qsize() >= self._maxsize # <<<<<<<<<<<<<< + * + * def put(self, item, block=True, timeout=None): + */ + __pyx_t_6 = ((__pyx_v_self->_maxsize > 0) != 0); + if (__pyx_t_6) { + } else { + __pyx_t_5 = __pyx_t_6; + goto __pyx_L3_bool_binop_done; + } + __pyx_t_6 = ((((struct __pyx_vtabstruct_6gevent_6_queue_Queue *)__pyx_v_self->__pyx_vtab)->qsize(__pyx_v_self, 0) >= __pyx_v_self->_maxsize) != 0); + __pyx_t_5 = __pyx_t_6; + __pyx_L3_bool_binop_done:; + __pyx_r = __pyx_t_5; + goto __pyx_L0; + + /* "src/gevent/queue.py":236 + * return not self.qsize() + * + * def full(self): # <<<<<<<<<<<<<< + * """Return ``True`` if the queue is full, ``False`` otherwise. + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_WriteUnraisable("gevent._queue.Queue.full", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); + __pyx_r = 0; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_queue_5Queue_29full(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6gevent_6_queue_5Queue_28full[] = "Queue.full(self) -> bool\nReturn ``True`` if the queue is full, ``False`` otherwise.\n\n ``Queue(None)`` is never full.\n "; +static PyMethodDef __pyx_mdef_6gevent_6_queue_5Queue_29full = {"full", (PyCFunction)__pyx_pw_6gevent_6_queue_5Queue_29full, METH_NOARGS, __pyx_doc_6gevent_6_queue_5Queue_28full}; +static PyObject *__pyx_pw_6gevent_6_queue_5Queue_29full(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("full (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6_queue_5Queue_28full(((struct __pyx_obj_6gevent_6_queue_Queue *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_queue_5Queue_28full(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("full", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_f_6gevent_6_queue_5Queue_full(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 236, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent._queue.Queue.full", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/queue.py":243 + * return self._maxsize > 0 and self.qsize() >= self._maxsize + * + * def put(self, item, block=True, timeout=None): # <<<<<<<<<<<<<< + * """Put an item into the queue. + * + */ + +static PyObject *__pyx_pw_6gevent_6_queue_5Queue_31put(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_6gevent_6_queue_5Queue_put(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self, PyObject *__pyx_v_item, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_6_queue_5Queue_put *__pyx_optional_args) { + PyObject *__pyx_v_block = ((PyObject *)Py_True); + PyObject *__pyx_v_timeout = ((PyObject *)Py_None); + PyObject *__pyx_v_getter = NULL; + struct __pyx_obj_6gevent_6_queue_ItemWaiter *__pyx_v_waiter = NULL; + PyObject *__pyx_v_result = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + int __pyx_t_8; + int __pyx_t_9; + int __pyx_t_10; + char const *__pyx_t_11; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + PyObject *__pyx_t_14 = NULL; + PyObject *__pyx_t_15 = NULL; + PyObject *__pyx_t_16 = NULL; + PyObject *__pyx_t_17 = NULL; + __Pyx_RefNannySetupContext("put", 0); + if (__pyx_optional_args) { + if (__pyx_optional_args->__pyx_n > 0) { + __pyx_v_block = __pyx_optional_args->block; + if (__pyx_optional_args->__pyx_n > 1) { + __pyx_v_timeout = __pyx_optional_args->timeout; + } + } + } + __Pyx_INCREF(__pyx_v_timeout); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0; + if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self)))))); + else { + PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + #endif + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_put_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 243, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_6_queue_5Queue_31put)) { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; + __pyx_t_5 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_5 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_3)) { + PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_item, __pyx_v_block, __pyx_v_timeout}; + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 243, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GOTREF(__pyx_t_2); + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { + PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_item, __pyx_v_block, __pyx_v_timeout}; + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 243, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GOTREF(__pyx_t_2); + } else + #endif + { + __pyx_t_6 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 243, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (__pyx_t_4) { + __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL; + } + __Pyx_INCREF(__pyx_v_item); + __Pyx_GIVEREF(__pyx_v_item); + PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_item); + __Pyx_INCREF(__pyx_v_block); + __Pyx_GIVEREF(__pyx_v_block); + PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_block); + __Pyx_INCREF(__pyx_v_timeout); + __Pyx_GIVEREF(__pyx_v_timeout); + PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_v_timeout); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 243, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0; + if (unlikely(type_dict_guard != tp_dict_version)) { + tp_dict_version = obj_dict_version = 0; + } + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + } + #endif + } + + /* "src/gevent/queue.py":254 + * is ignored in that case). + * """ + * if self._maxsize == -1 or self.qsize() < self._maxsize: # <<<<<<<<<<<<<< + * # there's a free slot, put an item right away + * self._put(item) + */ + __pyx_t_8 = ((__pyx_v_self->_maxsize == -1L) != 0); + if (!__pyx_t_8) { + } else { + __pyx_t_7 = __pyx_t_8; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_8 = ((((struct __pyx_vtabstruct_6gevent_6_queue_Queue *)__pyx_v_self->__pyx_vtab)->qsize(__pyx_v_self, 0) < __pyx_v_self->_maxsize) != 0); + __pyx_t_7 = __pyx_t_8; + __pyx_L4_bool_binop_done:; + if (__pyx_t_7) { + + /* "src/gevent/queue.py":256 + * if self._maxsize == -1 or self.qsize() < self._maxsize: + * # there's a free slot, put an item right away + * self._put(item) # <<<<<<<<<<<<<< + * if self.getters: + * self._schedule_unlock() + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_6_queue_Queue *)__pyx_v_self->__pyx_vtab)->_put(__pyx_v_self, __pyx_v_item, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 256, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/queue.py":257 + * # there's a free slot, put an item right away + * self._put(item) + * if self.getters: # <<<<<<<<<<<<<< + * self._schedule_unlock() + * elif self.hub is getcurrent(): + */ + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_self->getters); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 257, __pyx_L1_error) + if (__pyx_t_7) { + + /* "src/gevent/queue.py":258 + * self._put(item) + * if self.getters: + * self._schedule_unlock() # <<<<<<<<<<<<<< + * elif self.hub is getcurrent(): + * # We're in the mainloop, so we cannot wait; we can switch to other greenlets though. + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_6_queue_Queue *)__pyx_v_self->__pyx_vtab)->_schedule_unlock(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 258, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/queue.py":257 + * # there's a free slot, put an item right away + * self._put(item) + * if self.getters: # <<<<<<<<<<<<<< + * self._schedule_unlock() + * elif self.hub is getcurrent(): + */ + } + + /* "src/gevent/queue.py":254 + * is ignored in that case). + * """ + * if self._maxsize == -1 or self.qsize() < self._maxsize: # <<<<<<<<<<<<<< + * # there's a free slot, put an item right away + * self._put(item) + */ + goto __pyx_L3; + } + + /* "src/gevent/queue.py":259 + * if self.getters: + * self._schedule_unlock() + * elif self.hub is getcurrent(): # <<<<<<<<<<<<<< + * # We're in the mainloop, so we cannot wait; we can switch to other greenlets though. + * # Check if possible to get a free slot in the queue. + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_getcurrent); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 259, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 259, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_7 = (__pyx_v_self->hub == __pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_8 = (__pyx_t_7 != 0); + if (__pyx_t_8) { + + /* "src/gevent/queue.py":262 + * # We're in the mainloop, so we cannot wait; we can switch to other greenlets though. + * # Check if possible to get a free slot in the queue. + * while self.getters and self.qsize() and self.qsize() >= self._maxsize: # <<<<<<<<<<<<<< + * getter = self.getters.popleft() + * getter.switch(getter) + */ + while (1) { + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_self->getters); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 262, __pyx_L1_error) + if (__pyx_t_7) { + } else { + __pyx_t_8 = __pyx_t_7; + goto __pyx_L9_bool_binop_done; + } + __pyx_t_7 = (((struct __pyx_vtabstruct_6gevent_6_queue_Queue *)__pyx_v_self->__pyx_vtab)->qsize(__pyx_v_self, 0) != 0); + if (__pyx_t_7) { + } else { + __pyx_t_8 = __pyx_t_7; + goto __pyx_L9_bool_binop_done; + } + __pyx_t_7 = ((((struct __pyx_vtabstruct_6gevent_6_queue_Queue *)__pyx_v_self->__pyx_vtab)->qsize(__pyx_v_self, 0) >= __pyx_v_self->_maxsize) != 0); + __pyx_t_8 = __pyx_t_7; + __pyx_L9_bool_binop_done:; + if (!__pyx_t_8) break; + + /* "src/gevent/queue.py":263 + * # Check if possible to get a free slot in the queue. + * while self.getters and self.qsize() and self.qsize() >= self._maxsize: + * getter = self.getters.popleft() # <<<<<<<<<<<<<< + * getter.switch(getter) + * if self.qsize() < self._maxsize: + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->getters, __pyx_n_s_popleft); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 263, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 263, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF_SET(__pyx_v_getter, __pyx_t_1); + __pyx_t_1 = 0; + + /* "src/gevent/queue.py":264 + * while self.getters and self.qsize() and self.qsize() >= self._maxsize: + * getter = self.getters.popleft() + * getter.switch(getter) # <<<<<<<<<<<<<< + * if self.qsize() < self._maxsize: + * self._put(item) + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_getter, __pyx_n_s_switch); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 264, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_getter) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_getter); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 264, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + + /* "src/gevent/queue.py":265 + * getter = self.getters.popleft() + * getter.switch(getter) + * if self.qsize() < self._maxsize: # <<<<<<<<<<<<<< + * self._put(item) + * return + */ + __pyx_t_8 = ((((struct __pyx_vtabstruct_6gevent_6_queue_Queue *)__pyx_v_self->__pyx_vtab)->qsize(__pyx_v_self, 0) < __pyx_v_self->_maxsize) != 0); + if (__pyx_t_8) { + + /* "src/gevent/queue.py":266 + * getter.switch(getter) + * if self.qsize() < self._maxsize: + * self._put(item) # <<<<<<<<<<<<<< + * return + * raise Full + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_6_queue_Queue *)__pyx_v_self->__pyx_vtab)->_put(__pyx_v_self, __pyx_v_item, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 266, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/queue.py":267 + * if self.qsize() < self._maxsize: + * self._put(item) + * return # <<<<<<<<<<<<<< + * raise Full + * elif block: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + + /* "src/gevent/queue.py":265 + * getter = self.getters.popleft() + * getter.switch(getter) + * if self.qsize() < self._maxsize: # <<<<<<<<<<<<<< + * self._put(item) + * return + */ + } + + /* "src/gevent/queue.py":268 + * self._put(item) + * return + * raise Full # <<<<<<<<<<<<<< + * elif block: + * waiter = ItemWaiter(item, self) + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Full); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 268, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 268, __pyx_L1_error) + + /* "src/gevent/queue.py":259 + * if self.getters: + * self._schedule_unlock() + * elif self.hub is getcurrent(): # <<<<<<<<<<<<<< + * # We're in the mainloop, so we cannot wait; we can switch to other greenlets though. + * # Check if possible to get a free slot in the queue. + */ + } + + /* "src/gevent/queue.py":269 + * return + * raise Full + * elif block: # <<<<<<<<<<<<<< + * waiter = ItemWaiter(item, self) + * self.putters.append(waiter) + */ + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_block); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 269, __pyx_L1_error) + if (likely(__pyx_t_8)) { + + /* "src/gevent/queue.py":270 + * raise Full + * elif block: + * waiter = ItemWaiter(item, self) # <<<<<<<<<<<<<< + * self.putters.append(waiter) + * timeout = Timeout._start_new_or_dummy(timeout, Full) + */ + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 270, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_item); + __Pyx_GIVEREF(__pyx_v_item); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_item); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_self)); + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6gevent_6_queue_ItemWaiter), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 270, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_waiter = ((struct __pyx_obj_6gevent_6_queue_ItemWaiter *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "src/gevent/queue.py":271 + * elif block: + * waiter = ItemWaiter(item, self) + * self.putters.append(waiter) # <<<<<<<<<<<<<< + * timeout = Timeout._start_new_or_dummy(timeout, Full) + * try: + */ + __pyx_t_9 = __Pyx_PyObject_Append(__pyx_v_self->putters, ((PyObject *)__pyx_v_waiter)); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 271, __pyx_L1_error) + + /* "src/gevent/queue.py":272 + * waiter = ItemWaiter(item, self) + * self.putters.append(waiter) + * timeout = Timeout._start_new_or_dummy(timeout, Full) # <<<<<<<<<<<<<< + * try: + * if self.getters: + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Timeout); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 272, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_start_new_or_dummy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 272, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Full); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 272, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = NULL; + __pyx_t_5 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_6)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_5 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_3)) { + PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_timeout, __pyx_t_1}; + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 272, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { + PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_timeout, __pyx_t_1}; + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 272, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else + #endif + { + __pyx_t_4 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 272, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (__pyx_t_6) { + __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6); __pyx_t_6 = NULL; + } + __Pyx_INCREF(__pyx_v_timeout); + __Pyx_GIVEREF(__pyx_v_timeout); + PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_5, __pyx_v_timeout); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_5, __pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 272, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF_SET(__pyx_v_timeout, __pyx_t_2); + __pyx_t_2 = 0; + + /* "src/gevent/queue.py":273 + * self.putters.append(waiter) + * timeout = Timeout._start_new_or_dummy(timeout, Full) + * try: # <<<<<<<<<<<<<< + * if self.getters: + * self._schedule_unlock() + */ + /*try:*/ { + + /* "src/gevent/queue.py":274 + * timeout = Timeout._start_new_or_dummy(timeout, Full) + * try: + * if self.getters: # <<<<<<<<<<<<<< + * self._schedule_unlock() + * result = waiter.get() + */ + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_self->getters); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 274, __pyx_L14_error) + if (__pyx_t_8) { + + /* "src/gevent/queue.py":275 + * try: + * if self.getters: + * self._schedule_unlock() # <<<<<<<<<<<<<< + * result = waiter.get() + * if result is not waiter: + */ + __pyx_t_2 = ((struct __pyx_vtabstruct_6gevent_6_queue_Queue *)__pyx_v_self->__pyx_vtab)->_schedule_unlock(__pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 275, __pyx_L14_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/queue.py":274 + * timeout = Timeout._start_new_or_dummy(timeout, Full) + * try: + * if self.getters: # <<<<<<<<<<<<<< + * self._schedule_unlock() + * result = waiter.get() + */ + } + + /* "src/gevent/queue.py":276 + * if self.getters: + * self._schedule_unlock() + * result = waiter.get() # <<<<<<<<<<<<<< + * if result is not waiter: + * raise InvalidSwitchError("Invalid switch into Queue.put: %r" % (result, )) + */ + __pyx_t_2 = ((struct __pyx_vtabstruct_6gevent_6_queue_ItemWaiter *)__pyx_v_waiter->__pyx_base.__pyx_vtab)->__pyx_base.get(((struct __pyx_obj_6gevent_8__waiter_Waiter *)__pyx_v_waiter), 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 276, __pyx_L14_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_result = __pyx_t_2; + __pyx_t_2 = 0; + + /* "src/gevent/queue.py":277 + * self._schedule_unlock() + * result = waiter.get() + * if result is not waiter: # <<<<<<<<<<<<<< + * raise InvalidSwitchError("Invalid switch into Queue.put: %r" % (result, )) + * finally: + */ + __pyx_t_8 = (__pyx_v_result != ((PyObject *)__pyx_v_waiter)); + __pyx_t_7 = (__pyx_t_8 != 0); + if (unlikely(__pyx_t_7)) { + + /* "src/gevent/queue.py":278 + * result = waiter.get() + * if result is not waiter: + * raise InvalidSwitchError("Invalid switch into Queue.put: %r" % (result, )) # <<<<<<<<<<<<<< + * finally: + * timeout.cancel() + */ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_InvalidSwitchError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 278, __pyx_L14_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 278, __pyx_L14_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_result); + __Pyx_GIVEREF(__pyx_v_result); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_result); + __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_switch_into_Queue_put_r, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 278, __pyx_L14_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_t_1) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 278, __pyx_L14_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 278, __pyx_L14_error) + + /* "src/gevent/queue.py":277 + * self._schedule_unlock() + * result = waiter.get() + * if result is not waiter: # <<<<<<<<<<<<<< + * raise InvalidSwitchError("Invalid switch into Queue.put: %r" % (result, )) + * finally: + */ + } + } + + /* "src/gevent/queue.py":280 + * raise InvalidSwitchError("Invalid switch into Queue.put: %r" % (result, )) + * finally: + * timeout.cancel() # <<<<<<<<<<<<<< + * _safe_remove(self.putters, waiter) + * else: + */ + /*finally:*/ { + /*normal exit:*/{ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_timeout, __pyx_n_s_cancel); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 280, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_1)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_1); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_1) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1) : __Pyx_PyObject_CallNoArg(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 280, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/queue.py":281 + * finally: + * timeout.cancel() + * _safe_remove(self.putters, waiter) # <<<<<<<<<<<<<< + * else: + * raise Full + */ + __pyx_t_2 = __pyx_v_self->putters; + __Pyx_INCREF(__pyx_t_2); + __pyx_t_3 = __pyx_f_6gevent_6_queue__safe_remove(__pyx_t_2, ((PyObject *)__pyx_v_waiter)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 281, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L15; + } + __pyx_L14_error:; + /*exception exit:*/{ + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17); + if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14) < 0)) __Pyx_ErrFetch(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14); + __Pyx_XGOTREF(__pyx_t_12); + __Pyx_XGOTREF(__pyx_t_13); + __Pyx_XGOTREF(__pyx_t_14); + __Pyx_XGOTREF(__pyx_t_15); + __Pyx_XGOTREF(__pyx_t_16); + __Pyx_XGOTREF(__pyx_t_17); + __pyx_t_5 = __pyx_lineno; __pyx_t_10 = __pyx_clineno; __pyx_t_11 = __pyx_filename; + { + + /* "src/gevent/queue.py":280 + * raise InvalidSwitchError("Invalid switch into Queue.put: %r" % (result, )) + * finally: + * timeout.cancel() # <<<<<<<<<<<<<< + * _safe_remove(self.putters, waiter) + * else: + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_timeout, __pyx_n_s_cancel); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 280, __pyx_L19_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_1)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_1); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_3 = (__pyx_t_1) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_1) : __Pyx_PyObject_CallNoArg(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 280, __pyx_L19_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "src/gevent/queue.py":281 + * finally: + * timeout.cancel() + * _safe_remove(self.putters, waiter) # <<<<<<<<<<<<<< + * else: + * raise Full + */ + __pyx_t_3 = __pyx_v_self->putters; + __Pyx_INCREF(__pyx_t_3); + __pyx_t_2 = __pyx_f_6gevent_6_queue__safe_remove(__pyx_t_3, ((PyObject *)__pyx_v_waiter)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 281, __pyx_L19_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + if (PY_MAJOR_VERSION >= 3) { + __Pyx_XGIVEREF(__pyx_t_15); + __Pyx_XGIVEREF(__pyx_t_16); + __Pyx_XGIVEREF(__pyx_t_17); + __Pyx_ExceptionReset(__pyx_t_15, __pyx_t_16, __pyx_t_17); + } + __Pyx_XGIVEREF(__pyx_t_12); + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_ErrRestore(__pyx_t_12, __pyx_t_13, __pyx_t_14); + __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; + __pyx_lineno = __pyx_t_5; __pyx_clineno = __pyx_t_10; __pyx_filename = __pyx_t_11; + goto __pyx_L1_error; + __pyx_L19_error:; + if (PY_MAJOR_VERSION >= 3) { + __Pyx_XGIVEREF(__pyx_t_15); + __Pyx_XGIVEREF(__pyx_t_16); + __Pyx_XGIVEREF(__pyx_t_17); + __Pyx_ExceptionReset(__pyx_t_15, __pyx_t_16, __pyx_t_17); + } + __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; + __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; + goto __pyx_L1_error; + } + __pyx_L15:; + } + + /* "src/gevent/queue.py":269 + * return + * raise Full + * elif block: # <<<<<<<<<<<<<< + * waiter = ItemWaiter(item, self) + * self.putters.append(waiter) + */ + goto __pyx_L3; + } + + /* "src/gevent/queue.py":283 + * _safe_remove(self.putters, waiter) + * else: + * raise Full # <<<<<<<<<<<<<< + * + * def put_nowait(self, item): + */ + /*else*/ { + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Full); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 283, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 283, __pyx_L1_error) + } + __pyx_L3:; + + /* "src/gevent/queue.py":243 + * return self._maxsize > 0 and self.qsize() >= self._maxsize + * + * def put(self, item, block=True, timeout=None): # <<<<<<<<<<<<<< + * """Put an item into the queue. + * + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("gevent._queue.Queue.put", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_getter); + __Pyx_XDECREF((PyObject *)__pyx_v_waiter); + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XDECREF(__pyx_v_timeout); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_queue_5Queue_31put(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6gevent_6_queue_5Queue_30put[] = "Queue.put(self, item, block=True, timeout=None)\nPut an item into the queue.\n\n If optional arg *block* is true and *timeout* is ``None`` (the default),\n block if necessary until a free slot is available. If *timeout* is\n a positive number, it blocks at most *timeout* seconds and raises\n the :class:`Full` exception if no free slot was available within that time.\n Otherwise (*block* is false), put an item on the queue if a free slot\n is immediately available, else raise the :class:`Full` exception (*timeout*\n is ignored in that case).\n "; +static PyMethodDef __pyx_mdef_6gevent_6_queue_5Queue_31put = {"put", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_6_queue_5Queue_31put, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_6_queue_5Queue_30put}; +static PyObject *__pyx_pw_6gevent_6_queue_5Queue_31put(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_item = 0; + PyObject *__pyx_v_block = 0; + PyObject *__pyx_v_timeout = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("put (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_item,&__pyx_n_s_block,&__pyx_n_s_timeout,0}; + PyObject* values[3] = {0,0,0}; + values[1] = ((PyObject *)Py_True); + values[2] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_item)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_block); + if (value) { values[1] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 2: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_timeout); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "put") < 0)) __PYX_ERR(0, 243, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_item = values[0]; + __pyx_v_block = values[1]; + __pyx_v_timeout = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("put", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 243, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent._queue.Queue.put", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_6_queue_5Queue_30put(((struct __pyx_obj_6gevent_6_queue_Queue *)__pyx_v_self), __pyx_v_item, __pyx_v_block, __pyx_v_timeout); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_queue_5Queue_30put(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_block, PyObject *__pyx_v_timeout) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + struct __pyx_opt_args_6gevent_6_queue_5Queue_put __pyx_t_2; + __Pyx_RefNannySetupContext("put", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_2.__pyx_n = 2; + __pyx_t_2.block = __pyx_v_block; + __pyx_t_2.timeout = __pyx_v_timeout; + __pyx_t_1 = __pyx_vtabptr_6gevent_6_queue_Queue->put(__pyx_v_self, __pyx_v_item, 1, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 243, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent._queue.Queue.put", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/queue.py":285 + * raise Full + * + * def put_nowait(self, item): # <<<<<<<<<<<<<< + * """Put an item into the queue without blocking. + * + */ + +static PyObject *__pyx_pw_6gevent_6_queue_5Queue_33put_nowait(PyObject *__pyx_v_self, PyObject *__pyx_v_item); /*proto*/ +static PyObject *__pyx_f_6gevent_6_queue_5Queue_put_nowait(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self, PyObject *__pyx_v_item, int __pyx_skip_dispatch) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + struct __pyx_opt_args_6gevent_6_queue_5Queue_put __pyx_t_5; + __Pyx_RefNannySetupContext("put_nowait", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0; + if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self)))))); + else { + PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + #endif + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_put_nowait); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 285, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_6_queue_5Queue_33put_nowait)) { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_item) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_item); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 285, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0; + if (unlikely(type_dict_guard != tp_dict_version)) { + tp_dict_version = obj_dict_version = 0; + } + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + } + #endif + } + + /* "src/gevent/queue.py":291 + * Otherwise raise the :class:`Full` exception. + * """ + * self.put(item, False) # <<<<<<<<<<<<<< + * + * def __get_or_peek(self, method, block, timeout): + */ + __pyx_t_5.__pyx_n = 1; + __pyx_t_5.block = Py_False; + __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_6_queue_Queue *)__pyx_v_self->__pyx_vtab)->put(__pyx_v_self, __pyx_v_item, 0, &__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 291, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/queue.py":285 + * raise Full + * + * def put_nowait(self, item): # <<<<<<<<<<<<<< + * """Put an item into the queue without blocking. + * + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("gevent._queue.Queue.put_nowait", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_queue_5Queue_33put_nowait(PyObject *__pyx_v_self, PyObject *__pyx_v_item); /*proto*/ +static char __pyx_doc_6gevent_6_queue_5Queue_32put_nowait[] = "Queue.put_nowait(self, item)\nPut an item into the queue without blocking.\n\n Only enqueue the item if a free slot is immediately available.\n Otherwise raise the :class:`Full` exception.\n "; +static PyMethodDef __pyx_mdef_6gevent_6_queue_5Queue_33put_nowait = {"put_nowait", (PyCFunction)__pyx_pw_6gevent_6_queue_5Queue_33put_nowait, METH_O, __pyx_doc_6gevent_6_queue_5Queue_32put_nowait}; +static PyObject *__pyx_pw_6gevent_6_queue_5Queue_33put_nowait(PyObject *__pyx_v_self, PyObject *__pyx_v_item) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("put_nowait (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6_queue_5Queue_32put_nowait(((struct __pyx_obj_6gevent_6_queue_Queue *)__pyx_v_self), ((PyObject *)__pyx_v_item)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_queue_5Queue_32put_nowait(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self, PyObject *__pyx_v_item) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("put_nowait", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6gevent_6_queue_5Queue_put_nowait(__pyx_v_self, __pyx_v_item, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 285, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent._queue.Queue.put_nowait", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/queue.py":293 + * self.put(item, False) + * + * def __get_or_peek(self, method, block, timeout): # <<<<<<<<<<<<<< + * # Internal helper method. The `method` should be either + * # self._get when called from self.get() or self._peek when + */ + +static PyObject *__pyx_f_6gevent_6_queue_5Queue___get_or_peek(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self, PyObject *__pyx_v_method, PyObject *__pyx_v_block, PyObject *__pyx_v_timeout) { + struct __pyx_obj_6gevent_8__waiter_Waiter *__pyx_v_waiter = NULL; + PyObject *__pyx_v_result = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + int __pyx_t_9; + int __pyx_t_10; + char const *__pyx_t_11; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + PyObject *__pyx_t_14 = NULL; + PyObject *__pyx_t_15 = NULL; + PyObject *__pyx_t_16 = NULL; + PyObject *__pyx_t_17 = NULL; + __Pyx_RefNannySetupContext("__get_or_peek", 0); + __Pyx_INCREF(__pyx_v_timeout); + + /* "src/gevent/queue.py":299 + * # to see if there are items in the queue. + * + * if self.hub is getcurrent(): # <<<<<<<<<<<<<< + * # special case to make get_nowait() or peek_nowait() runnable in the mainloop greenlet + * # there are no items in the queue; try to fix the situation by unlocking putters + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_getcurrent); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 299, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 299, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_4 = (__pyx_v_self->hub == __pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_5 = (__pyx_t_4 != 0); + if (__pyx_t_5) { + + /* "src/gevent/queue.py":302 + * # special case to make get_nowait() or peek_nowait() runnable in the mainloop greenlet + * # there are no items in the queue; try to fix the situation by unlocking putters + * while self.putters: # <<<<<<<<<<<<<< + * # Note: get() used popleft(), peek used pop(); popleft + * # is almost certainly correct. + */ + while (1) { + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_self->putters); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 302, __pyx_L1_error) + if (!__pyx_t_5) break; + + /* "src/gevent/queue.py":305 + * # Note: get() used popleft(), peek used pop(); popleft + * # is almost certainly correct. + * self.putters.popleft().put_and_switch() # <<<<<<<<<<<<<< + * if self.qsize(): + * return method() + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->putters, __pyx_n_s_popleft); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 305, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_6 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_6)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 305, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_put_and_switch); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 305, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_2)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 305, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/queue.py":306 + * # is almost certainly correct. + * self.putters.popleft().put_and_switch() + * if self.qsize(): # <<<<<<<<<<<<<< + * return method() + * raise Empty() + */ + __pyx_t_5 = (((struct __pyx_vtabstruct_6gevent_6_queue_Queue *)__pyx_v_self->__pyx_vtab)->qsize(__pyx_v_self, 0) != 0); + if (__pyx_t_5) { + + /* "src/gevent/queue.py":307 + * self.putters.popleft().put_and_switch() + * if self.qsize(): + * return method() # <<<<<<<<<<<<<< + * raise Empty() + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_method); + __pyx_t_3 = __pyx_v_method; __pyx_t_2 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_2)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 307, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "src/gevent/queue.py":306 + * # is almost certainly correct. + * self.putters.popleft().put_and_switch() + * if self.qsize(): # <<<<<<<<<<<<<< + * return method() + * raise Empty() + */ + } + } + + /* "src/gevent/queue.py":308 + * if self.qsize(): + * return method() + * raise Empty() # <<<<<<<<<<<<<< + * + * if not block: + */ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Empty); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 308, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_2)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 308, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 308, __pyx_L1_error) + + /* "src/gevent/queue.py":299 + * # to see if there are items in the queue. + * + * if self.hub is getcurrent(): # <<<<<<<<<<<<<< + * # special case to make get_nowait() or peek_nowait() runnable in the mainloop greenlet + * # there are no items in the queue; try to fix the situation by unlocking putters + */ + } + + /* "src/gevent/queue.py":310 + * raise Empty() + * + * if not block: # <<<<<<<<<<<<<< + * # We can't block, we're not the hub, and we have nothing + * # to return. No choice... + */ + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_block); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 310, __pyx_L1_error) + __pyx_t_4 = ((!__pyx_t_5) != 0); + if (unlikely(__pyx_t_4)) { + + /* "src/gevent/queue.py":313 + * # We can't block, we're not the hub, and we have nothing + * # to return. No choice... + * raise Empty() # <<<<<<<<<<<<<< + * + * waiter = Waiter() # pylint:disable=undefined-variable + */ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Empty); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 313, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_2)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 313, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 313, __pyx_L1_error) + + /* "src/gevent/queue.py":310 + * raise Empty() + * + * if not block: # <<<<<<<<<<<<<< + * # We can't block, we're not the hub, and we have nothing + * # to return. No choice... + */ + } + + /* "src/gevent/queue.py":315 + * raise Empty() + * + * waiter = Waiter() # pylint:disable=undefined-variable # <<<<<<<<<<<<<< + * timeout = Timeout._start_new_or_dummy(timeout, Empty) + * try: + */ + __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_6gevent_8__waiter_Waiter)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 315, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_waiter = ((struct __pyx_obj_6gevent_8__waiter_Waiter *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "src/gevent/queue.py":316 + * + * waiter = Waiter() # pylint:disable=undefined-variable + * timeout = Timeout._start_new_or_dummy(timeout, Empty) # <<<<<<<<<<<<<< + * try: + * self.getters.append(waiter) + */ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Timeout); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 316, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_start_new_or_dummy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 316, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Empty); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 316, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_6 = NULL; + __pyx_t_7 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_6)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_7 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_timeout, __pyx_t_3}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 316, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_timeout, __pyx_t_3}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 316, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } else + #endif + { + __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 316, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + if (__pyx_t_6) { + __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL; + } + __Pyx_INCREF(__pyx_v_timeout); + __Pyx_GIVEREF(__pyx_v_timeout); + PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_v_timeout); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 316, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF_SET(__pyx_v_timeout, __pyx_t_1); + __pyx_t_1 = 0; + + /* "src/gevent/queue.py":317 + * waiter = Waiter() # pylint:disable=undefined-variable + * timeout = Timeout._start_new_or_dummy(timeout, Empty) + * try: # <<<<<<<<<<<<<< + * self.getters.append(waiter) + * if self.putters: + */ + /*try:*/ { + + /* "src/gevent/queue.py":318 + * timeout = Timeout._start_new_or_dummy(timeout, Empty) + * try: + * self.getters.append(waiter) # <<<<<<<<<<<<<< + * if self.putters: + * self._schedule_unlock() + */ + __pyx_t_9 = __Pyx_PyObject_Append(__pyx_v_self->getters, ((PyObject *)__pyx_v_waiter)); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 318, __pyx_L9_error) + + /* "src/gevent/queue.py":319 + * try: + * self.getters.append(waiter) + * if self.putters: # <<<<<<<<<<<<<< + * self._schedule_unlock() + * result = waiter.get() + */ + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_self->putters); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 319, __pyx_L9_error) + if (__pyx_t_4) { + + /* "src/gevent/queue.py":320 + * self.getters.append(waiter) + * if self.putters: + * self._schedule_unlock() # <<<<<<<<<<<<<< + * result = waiter.get() + * if result is not waiter: + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_6_queue_Queue *)__pyx_v_self->__pyx_vtab)->_schedule_unlock(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 320, __pyx_L9_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/queue.py":319 + * try: + * self.getters.append(waiter) + * if self.putters: # <<<<<<<<<<<<<< + * self._schedule_unlock() + * result = waiter.get() + */ + } + + /* "src/gevent/queue.py":321 + * if self.putters: + * self._schedule_unlock() + * result = waiter.get() # <<<<<<<<<<<<<< + * if result is not waiter: + * raise InvalidSwitchError('Invalid switch into Queue.get: %r' % (result, )) + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_8__waiter_Waiter *)__pyx_v_waiter->__pyx_vtab)->get(__pyx_v_waiter, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 321, __pyx_L9_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_result = __pyx_t_1; + __pyx_t_1 = 0; + + /* "src/gevent/queue.py":322 + * self._schedule_unlock() + * result = waiter.get() + * if result is not waiter: # <<<<<<<<<<<<<< + * raise InvalidSwitchError('Invalid switch into Queue.get: %r' % (result, )) + * return method() + */ + __pyx_t_4 = (__pyx_v_result != ((PyObject *)__pyx_v_waiter)); + __pyx_t_5 = (__pyx_t_4 != 0); + if (unlikely(__pyx_t_5)) { + + /* "src/gevent/queue.py":323 + * result = waiter.get() + * if result is not waiter: + * raise InvalidSwitchError('Invalid switch into Queue.get: %r' % (result, )) # <<<<<<<<<<<<<< + * return method() + * finally: + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_InvalidSwitchError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 323, __pyx_L9_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 323, __pyx_L9_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(__pyx_v_result); + __Pyx_GIVEREF(__pyx_v_result); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_result); + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_switch_into_Queue_get_r, __pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 323, __pyx_L9_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_8)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_8); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_8, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 323, __pyx_L9_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 323, __pyx_L9_error) + + /* "src/gevent/queue.py":322 + * self._schedule_unlock() + * result = waiter.get() + * if result is not waiter: # <<<<<<<<<<<<<< + * raise InvalidSwitchError('Invalid switch into Queue.get: %r' % (result, )) + * return method() + */ + } + + /* "src/gevent/queue.py":324 + * if result is not waiter: + * raise InvalidSwitchError('Invalid switch into Queue.get: %r' % (result, )) + * return method() # <<<<<<<<<<<<<< + * finally: + * timeout.cancel() + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_method); + __pyx_t_2 = __pyx_v_method; __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 324, __pyx_L9_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L8_return; + } + + /* "src/gevent/queue.py":326 + * return method() + * finally: + * timeout.cancel() # <<<<<<<<<<<<<< + * _safe_remove(self.getters, waiter) + * + */ + /*finally:*/ { + __pyx_L9_error:; + /*exception exit:*/{ + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17); + if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14) < 0)) __Pyx_ErrFetch(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14); + __Pyx_XGOTREF(__pyx_t_12); + __Pyx_XGOTREF(__pyx_t_13); + __Pyx_XGOTREF(__pyx_t_14); + __Pyx_XGOTREF(__pyx_t_15); + __Pyx_XGOTREF(__pyx_t_16); + __Pyx_XGOTREF(__pyx_t_17); + __pyx_t_7 = __pyx_lineno; __pyx_t_10 = __pyx_clineno; __pyx_t_11 = __pyx_filename; + { + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_timeout, __pyx_n_s_cancel); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 326, __pyx_L14_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 326, __pyx_L14_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/queue.py":327 + * finally: + * timeout.cancel() + * _safe_remove(self.getters, waiter) # <<<<<<<<<<<<<< + * + * def get(self, block=True, timeout=None): + */ + __pyx_t_1 = __pyx_v_self->getters; + __Pyx_INCREF(__pyx_t_1); + __pyx_t_2 = __pyx_f_6gevent_6_queue__safe_remove(__pyx_t_1, ((PyObject *)__pyx_v_waiter)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 327, __pyx_L14_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + if (PY_MAJOR_VERSION >= 3) { + __Pyx_XGIVEREF(__pyx_t_15); + __Pyx_XGIVEREF(__pyx_t_16); + __Pyx_XGIVEREF(__pyx_t_17); + __Pyx_ExceptionReset(__pyx_t_15, __pyx_t_16, __pyx_t_17); + } + __Pyx_XGIVEREF(__pyx_t_12); + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_ErrRestore(__pyx_t_12, __pyx_t_13, __pyx_t_14); + __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; + __pyx_lineno = __pyx_t_7; __pyx_clineno = __pyx_t_10; __pyx_filename = __pyx_t_11; + goto __pyx_L1_error; + __pyx_L14_error:; + if (PY_MAJOR_VERSION >= 3) { + __Pyx_XGIVEREF(__pyx_t_15); + __Pyx_XGIVEREF(__pyx_t_16); + __Pyx_XGIVEREF(__pyx_t_17); + __Pyx_ExceptionReset(__pyx_t_15, __pyx_t_16, __pyx_t_17); + } + __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; + __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; + goto __pyx_L1_error; + } + __pyx_L8_return: { + __pyx_t_17 = __pyx_r; + __pyx_r = 0; + + /* "src/gevent/queue.py":326 + * return method() + * finally: + * timeout.cancel() # <<<<<<<<<<<<<< + * _safe_remove(self.getters, waiter) + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_timeout, __pyx_n_s_cancel); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 326, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_1, function); + } + } + __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 326, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/queue.py":327 + * finally: + * timeout.cancel() + * _safe_remove(self.getters, waiter) # <<<<<<<<<<<<<< + * + * def get(self, block=True, timeout=None): + */ + __pyx_t_2 = __pyx_v_self->getters; + __Pyx_INCREF(__pyx_t_2); + __pyx_t_1 = __pyx_f_6gevent_6_queue__safe_remove(__pyx_t_2, ((PyObject *)__pyx_v_waiter)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 327, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_17; + __pyx_t_17 = 0; + goto __pyx_L0; + } + } + + /* "src/gevent/queue.py":293 + * self.put(item, False) + * + * def __get_or_peek(self, method, block, timeout): # <<<<<<<<<<<<<< + * # Internal helper method. The `method` should be either + * # self._get when called from self.get() or self._peek when + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("gevent._queue.Queue.__get_or_peek", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_waiter); + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XDECREF(__pyx_v_timeout); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/queue.py":329 + * _safe_remove(self.getters, waiter) + * + * def get(self, block=True, timeout=None): # <<<<<<<<<<<<<< + * """Remove and return an item from the queue. + * + */ + +static PyObject *__pyx_pw_6gevent_6_queue_5Queue_35get(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_6gevent_6_queue_5Queue_get(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_6_queue_5Queue_get *__pyx_optional_args) { + PyObject *__pyx_v_block = ((PyObject *)Py_True); + PyObject *__pyx_v_timeout = ((PyObject *)Py_None); + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + __Pyx_RefNannySetupContext("get", 0); + if (__pyx_optional_args) { + if (__pyx_optional_args->__pyx_n > 0) { + __pyx_v_block = __pyx_optional_args->block; + if (__pyx_optional_args->__pyx_n > 1) { + __pyx_v_timeout = __pyx_optional_args->timeout; + } + } + } + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0; + if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self)))))); + else { + PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + #endif + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 329, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_6_queue_5Queue_35get)) { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; + __pyx_t_5 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_5 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_3)) { + PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_block, __pyx_v_timeout}; + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 329, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GOTREF(__pyx_t_2); + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { + PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_block, __pyx_v_timeout}; + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 329, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GOTREF(__pyx_t_2); + } else + #endif + { + __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 329, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (__pyx_t_4) { + __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL; + } + __Pyx_INCREF(__pyx_v_block); + __Pyx_GIVEREF(__pyx_v_block); + PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_block); + __Pyx_INCREF(__pyx_v_timeout); + __Pyx_GIVEREF(__pyx_v_timeout); + PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_timeout); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 329, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0; + if (unlikely(type_dict_guard != tp_dict_version)) { + tp_dict_version = obj_dict_version = 0; + } + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + } + #endif + } + + /* "src/gevent/queue.py":339 + * (*timeout* is ignored in that case). + * """ + * if self.qsize(): # <<<<<<<<<<<<<< + * if self.putters: + * self._schedule_unlock() + */ + __pyx_t_7 = (((struct __pyx_vtabstruct_6gevent_6_queue_Queue *)__pyx_v_self->__pyx_vtab)->qsize(__pyx_v_self, 0) != 0); + if (__pyx_t_7) { + + /* "src/gevent/queue.py":340 + * """ + * if self.qsize(): + * if self.putters: # <<<<<<<<<<<<<< + * self._schedule_unlock() + * return self._get() + */ + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_self->putters); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 340, __pyx_L1_error) + if (__pyx_t_7) { + + /* "src/gevent/queue.py":341 + * if self.qsize(): + * if self.putters: + * self._schedule_unlock() # <<<<<<<<<<<<<< + * return self._get() + * + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_6_queue_Queue *)__pyx_v_self->__pyx_vtab)->_schedule_unlock(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 341, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/queue.py":340 + * """ + * if self.qsize(): + * if self.putters: # <<<<<<<<<<<<<< + * self._schedule_unlock() + * return self._get() + */ + } + + /* "src/gevent/queue.py":342 + * if self.putters: + * self._schedule_unlock() + * return self._get() # <<<<<<<<<<<<<< + * + * return self.__get_or_peek(self._get, block, timeout) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_6_queue_Queue *)__pyx_v_self->__pyx_vtab)->_get(__pyx_v_self, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 342, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "src/gevent/queue.py":339 + * (*timeout* is ignored in that case). + * """ + * if self.qsize(): # <<<<<<<<<<<<<< + * if self.putters: + * self._schedule_unlock() + */ + } + + /* "src/gevent/queue.py":344 + * return self._get() + * + * return self.__get_or_peek(self._get, block, timeout) # <<<<<<<<<<<<<< + * + * def get_nowait(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 344, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = ((struct __pyx_vtabstruct_6gevent_6_queue_Queue *)__pyx_v_self->__pyx_vtab)->__pyx___get_or_peek(__pyx_v_self, __pyx_t_1, __pyx_v_block, __pyx_v_timeout); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 344, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "src/gevent/queue.py":329 + * _safe_remove(self.getters, waiter) + * + * def get(self, block=True, timeout=None): # <<<<<<<<<<<<<< + * """Remove and return an item from the queue. + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("gevent._queue.Queue.get", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_queue_5Queue_35get(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6gevent_6_queue_5Queue_34get[] = "Queue.get(self, block=True, timeout=None)\nRemove and return an item from the queue.\n\n If optional args *block* is true and *timeout* is ``None`` (the default),\n block if necessary until an item is available. If *timeout* is a positive number,\n it blocks at most *timeout* seconds and raises the :class:`Empty` exception\n if no item was available within that time. Otherwise (*block* is false), return\n an item if one is immediately available, else raise the :class:`Empty` exception\n (*timeout* is ignored in that case).\n "; +static PyMethodDef __pyx_mdef_6gevent_6_queue_5Queue_35get = {"get", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_6_queue_5Queue_35get, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_6_queue_5Queue_34get}; +static PyObject *__pyx_pw_6gevent_6_queue_5Queue_35get(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_block = 0; + PyObject *__pyx_v_timeout = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_block,&__pyx_n_s_timeout,0}; + PyObject* values[2] = {0,0}; + values[0] = ((PyObject *)Py_True); + values[1] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_block); + if (value) { values[0] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 1: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_timeout); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get") < 0)) __PYX_ERR(0, 329, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_block = values[0]; + __pyx_v_timeout = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("get", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 329, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent._queue.Queue.get", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_6_queue_5Queue_34get(((struct __pyx_obj_6gevent_6_queue_Queue *)__pyx_v_self), __pyx_v_block, __pyx_v_timeout); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_queue_5Queue_34get(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self, PyObject *__pyx_v_block, PyObject *__pyx_v_timeout) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + struct __pyx_opt_args_6gevent_6_queue_5Queue_get __pyx_t_2; + __Pyx_RefNannySetupContext("get", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_2.__pyx_n = 2; + __pyx_t_2.block = __pyx_v_block; + __pyx_t_2.timeout = __pyx_v_timeout; + __pyx_t_1 = __pyx_vtabptr_6gevent_6_queue_Queue->get(__pyx_v_self, 1, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 329, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent._queue.Queue.get", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/queue.py":346 + * return self.__get_or_peek(self._get, block, timeout) + * + * def get_nowait(self): # <<<<<<<<<<<<<< + * """Remove and return an item from the queue without blocking. + * + */ + +static PyObject *__pyx_pw_6gevent_6_queue_5Queue_37get_nowait(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_f_6gevent_6_queue_5Queue_get_nowait(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self, int __pyx_skip_dispatch) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + struct __pyx_opt_args_6gevent_6_queue_5Queue_get __pyx_t_5; + __Pyx_RefNannySetupContext("get_nowait", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0; + if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self)))))); + else { + PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + #endif + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_nowait); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 346, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_6_queue_5Queue_37get_nowait)) { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 346, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0; + if (unlikely(type_dict_guard != tp_dict_version)) { + tp_dict_version = obj_dict_version = 0; + } + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + } + #endif + } + + /* "src/gevent/queue.py":352 + * raise the :class:`Empty` exception. + * """ + * return self.get(False) # <<<<<<<<<<<<<< + * + * def peek(self, block=True, timeout=None): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_5.__pyx_n = 1; + __pyx_t_5.block = Py_False; + __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_6_queue_Queue *)__pyx_v_self->__pyx_vtab)->get(__pyx_v_self, 0, &__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 352, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "src/gevent/queue.py":346 + * return self.__get_or_peek(self._get, block, timeout) + * + * def get_nowait(self): # <<<<<<<<<<<<<< + * """Remove and return an item from the queue without blocking. + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("gevent._queue.Queue.get_nowait", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_queue_5Queue_37get_nowait(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6gevent_6_queue_5Queue_36get_nowait[] = "Queue.get_nowait(self)\nRemove and return an item from the queue without blocking.\n\n Only get an item if one is immediately available. Otherwise\n raise the :class:`Empty` exception.\n "; +static PyMethodDef __pyx_mdef_6gevent_6_queue_5Queue_37get_nowait = {"get_nowait", (PyCFunction)__pyx_pw_6gevent_6_queue_5Queue_37get_nowait, METH_NOARGS, __pyx_doc_6gevent_6_queue_5Queue_36get_nowait}; +static PyObject *__pyx_pw_6gevent_6_queue_5Queue_37get_nowait(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get_nowait (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6_queue_5Queue_36get_nowait(((struct __pyx_obj_6gevent_6_queue_Queue *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_queue_5Queue_36get_nowait(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("get_nowait", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6gevent_6_queue_5Queue_get_nowait(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 346, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent._queue.Queue.get_nowait", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/queue.py":354 + * return self.get(False) + * + * def peek(self, block=True, timeout=None): # <<<<<<<<<<<<<< + * """Return an item from the queue without removing it. + * + */ + +static PyObject *__pyx_pw_6gevent_6_queue_5Queue_39peek(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_6gevent_6_queue_5Queue_peek(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_6_queue_5Queue_peek *__pyx_optional_args) { + PyObject *__pyx_v_block = ((PyObject *)Py_True); + PyObject *__pyx_v_timeout = ((PyObject *)Py_None); + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + __Pyx_RefNannySetupContext("peek", 0); + if (__pyx_optional_args) { + if (__pyx_optional_args->__pyx_n > 0) { + __pyx_v_block = __pyx_optional_args->block; + if (__pyx_optional_args->__pyx_n > 1) { + __pyx_v_timeout = __pyx_optional_args->timeout; + } + } + } + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0; + if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self)))))); + else { + PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + #endif + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_peek_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 354, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_6_queue_5Queue_39peek)) { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; + __pyx_t_5 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_5 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_3)) { + PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_block, __pyx_v_timeout}; + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 354, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GOTREF(__pyx_t_2); + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { + PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_block, __pyx_v_timeout}; + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 354, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GOTREF(__pyx_t_2); + } else + #endif + { + __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 354, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (__pyx_t_4) { + __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL; + } + __Pyx_INCREF(__pyx_v_block); + __Pyx_GIVEREF(__pyx_v_block); + PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_block); + __Pyx_INCREF(__pyx_v_timeout); + __Pyx_GIVEREF(__pyx_v_timeout); + PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_timeout); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 354, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0; + if (unlikely(type_dict_guard != tp_dict_version)) { + tp_dict_version = obj_dict_version = 0; + } + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + } + #endif + } + + /* "src/gevent/queue.py":364 + * (*timeout* is ignored in that case). + * """ + * if self.qsize(): # <<<<<<<<<<<<<< + * # XXX: Why doesn't this schedule an unlock like get() does? + * return self._peek() + */ + __pyx_t_7 = (((struct __pyx_vtabstruct_6gevent_6_queue_Queue *)__pyx_v_self->__pyx_vtab)->qsize(__pyx_v_self, 0) != 0); + if (__pyx_t_7) { + + /* "src/gevent/queue.py":366 + * if self.qsize(): + * # XXX: Why doesn't this schedule an unlock like get() does? + * return self._peek() # <<<<<<<<<<<<<< + * + * return self.__get_or_peek(self._peek, block, timeout) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_6_queue_Queue *)__pyx_v_self->__pyx_vtab)->_peek(__pyx_v_self, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 366, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "src/gevent/queue.py":364 + * (*timeout* is ignored in that case). + * """ + * if self.qsize(): # <<<<<<<<<<<<<< + * # XXX: Why doesn't this schedule an unlock like get() does? + * return self._peek() + */ + } + + /* "src/gevent/queue.py":368 + * return self._peek() + * + * return self.__get_or_peek(self._peek, block, timeout) # <<<<<<<<<<<<<< + * + * def peek_nowait(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_peek); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 368, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = ((struct __pyx_vtabstruct_6gevent_6_queue_Queue *)__pyx_v_self->__pyx_vtab)->__pyx___get_or_peek(__pyx_v_self, __pyx_t_1, __pyx_v_block, __pyx_v_timeout); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 368, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "src/gevent/queue.py":354 + * return self.get(False) + * + * def peek(self, block=True, timeout=None): # <<<<<<<<<<<<<< + * """Return an item from the queue without removing it. + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("gevent._queue.Queue.peek", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_queue_5Queue_39peek(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6gevent_6_queue_5Queue_38peek[] = "Queue.peek(self, block=True, timeout=None)\nReturn an item from the queue without removing it.\n\n If optional args *block* is true and *timeout* is ``None`` (the default),\n block if necessary until an item is available. If *timeout* is a positive number,\n it blocks at most *timeout* seconds and raises the :class:`Empty` exception\n if no item was available within that time. Otherwise (*block* is false), return\n an item if one is immediately available, else raise the :class:`Empty` exception\n (*timeout* is ignored in that case).\n "; +static PyMethodDef __pyx_mdef_6gevent_6_queue_5Queue_39peek = {"peek", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_6_queue_5Queue_39peek, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_6_queue_5Queue_38peek}; +static PyObject *__pyx_pw_6gevent_6_queue_5Queue_39peek(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_block = 0; + PyObject *__pyx_v_timeout = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("peek (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_block,&__pyx_n_s_timeout,0}; + PyObject* values[2] = {0,0}; + values[0] = ((PyObject *)Py_True); + values[1] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_block); + if (value) { values[0] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 1: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_timeout); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "peek") < 0)) __PYX_ERR(0, 354, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_block = values[0]; + __pyx_v_timeout = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("peek", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 354, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent._queue.Queue.peek", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_6_queue_5Queue_38peek(((struct __pyx_obj_6gevent_6_queue_Queue *)__pyx_v_self), __pyx_v_block, __pyx_v_timeout); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_queue_5Queue_38peek(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self, PyObject *__pyx_v_block, PyObject *__pyx_v_timeout) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + struct __pyx_opt_args_6gevent_6_queue_5Queue_peek __pyx_t_2; + __Pyx_RefNannySetupContext("peek", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_2.__pyx_n = 2; + __pyx_t_2.block = __pyx_v_block; + __pyx_t_2.timeout = __pyx_v_timeout; + __pyx_t_1 = __pyx_vtabptr_6gevent_6_queue_Queue->peek(__pyx_v_self, 1, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 354, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent._queue.Queue.peek", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/queue.py":370 + * return self.__get_or_peek(self._peek, block, timeout) + * + * def peek_nowait(self): # <<<<<<<<<<<<<< + * """Return an item from the queue without blocking. + * + */ + +static PyObject *__pyx_pw_6gevent_6_queue_5Queue_41peek_nowait(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_f_6gevent_6_queue_5Queue_peek_nowait(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self, int __pyx_skip_dispatch) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + struct __pyx_opt_args_6gevent_6_queue_5Queue_peek __pyx_t_5; + __Pyx_RefNannySetupContext("peek_nowait", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0; + if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self)))))); + else { + PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + #endif + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_peek_nowait); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 370, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_6_queue_5Queue_41peek_nowait)) { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 370, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0; + if (unlikely(type_dict_guard != tp_dict_version)) { + tp_dict_version = obj_dict_version = 0; + } + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + } + #endif + } + + /* "src/gevent/queue.py":376 + * raise the :class:`Empty` exception. + * """ + * return self.peek(False) # <<<<<<<<<<<<<< + * + * def _unlock(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_5.__pyx_n = 1; + __pyx_t_5.block = Py_False; + __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_6_queue_Queue *)__pyx_v_self->__pyx_vtab)->peek(__pyx_v_self, 0, &__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 376, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "src/gevent/queue.py":370 + * return self.__get_or_peek(self._peek, block, timeout) + * + * def peek_nowait(self): # <<<<<<<<<<<<<< + * """Return an item from the queue without blocking. + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("gevent._queue.Queue.peek_nowait", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_queue_5Queue_41peek_nowait(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6gevent_6_queue_5Queue_40peek_nowait[] = "Queue.peek_nowait(self)\nReturn an item from the queue without blocking.\n\n Only return an item if one is immediately available. Otherwise\n raise the :class:`Empty` exception.\n "; +static PyMethodDef __pyx_mdef_6gevent_6_queue_5Queue_41peek_nowait = {"peek_nowait", (PyCFunction)__pyx_pw_6gevent_6_queue_5Queue_41peek_nowait, METH_NOARGS, __pyx_doc_6gevent_6_queue_5Queue_40peek_nowait}; +static PyObject *__pyx_pw_6gevent_6_queue_5Queue_41peek_nowait(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("peek_nowait (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6_queue_5Queue_40peek_nowait(((struct __pyx_obj_6gevent_6_queue_Queue *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_queue_5Queue_40peek_nowait(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("peek_nowait", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6gevent_6_queue_5Queue_peek_nowait(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 370, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent._queue.Queue.peek_nowait", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/queue.py":378 + * return self.peek(False) + * + * def _unlock(self): # <<<<<<<<<<<<<< + * while True: + * repeat = False + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_queue_5Queue_43_unlock(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6gevent_6_queue_5Queue_42_unlock[] = "Queue._unlock(self)"; +static PyMethodDef __pyx_mdef_6gevent_6_queue_5Queue_43_unlock = {"_unlock", (PyCFunction)__pyx_pw_6gevent_6_queue_5Queue_43_unlock, METH_NOARGS, __pyx_doc_6gevent_6_queue_5Queue_42_unlock}; +static PyObject *__pyx_pw_6gevent_6_queue_5Queue_43_unlock(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_unlock (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6_queue_5Queue_42_unlock(((struct __pyx_obj_6gevent_6_queue_Queue *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_queue_5Queue_42_unlock(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self) { + int __pyx_v_repeat; + PyObject *__pyx_v_putter = NULL; + PyObject *__pyx_v_getter = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + __Pyx_RefNannySetupContext("_unlock", 0); + + /* "src/gevent/queue.py":379 + * + * def _unlock(self): + * while True: # <<<<<<<<<<<<<< + * repeat = False + * if self.putters and (self._maxsize == -1 or self.qsize() < self._maxsize): + */ + while (1) { + + /* "src/gevent/queue.py":380 + * def _unlock(self): + * while True: + * repeat = False # <<<<<<<<<<<<<< + * if self.putters and (self._maxsize == -1 or self.qsize() < self._maxsize): + * repeat = True + */ + __pyx_v_repeat = 0; + + /* "src/gevent/queue.py":381 + * while True: + * repeat = False + * if self.putters and (self._maxsize == -1 or self.qsize() < self._maxsize): # <<<<<<<<<<<<<< + * repeat = True + * try: + */ + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_self->putters); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 381, __pyx_L1_error) + if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L6_bool_binop_done; + } + __pyx_t_2 = ((__pyx_v_self->_maxsize == -1L) != 0); + if (!__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L6_bool_binop_done; + } + __pyx_t_2 = ((((struct __pyx_vtabstruct_6gevent_6_queue_Queue *)__pyx_v_self->__pyx_vtab)->qsize(__pyx_v_self, 0) < __pyx_v_self->_maxsize) != 0); + __pyx_t_1 = __pyx_t_2; + __pyx_L6_bool_binop_done:; + if (__pyx_t_1) { + + /* "src/gevent/queue.py":382 + * repeat = False + * if self.putters and (self._maxsize == -1 or self.qsize() < self._maxsize): + * repeat = True # <<<<<<<<<<<<<< + * try: + * putter = self.putters.popleft() + */ + __pyx_v_repeat = 1; + + /* "src/gevent/queue.py":383 + * if self.putters and (self._maxsize == -1 or self.qsize() < self._maxsize): + * repeat = True + * try: # <<<<<<<<<<<<<< + * putter = self.putters.popleft() + * self._put(putter.item) + */ + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5); + __Pyx_XGOTREF(__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_4); + __Pyx_XGOTREF(__pyx_t_5); + /*try:*/ { + + /* "src/gevent/queue.py":384 + * repeat = True + * try: + * putter = self.putters.popleft() # <<<<<<<<<<<<<< + * self._put(putter.item) + * except: # pylint:disable=bare-except + */ + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->putters, __pyx_n_s_popleft); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 384, __pyx_L9_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) { + __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); + if (likely(__pyx_t_8)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); + __Pyx_INCREF(__pyx_t_8); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_7, function); + } + } + __pyx_t_6 = (__pyx_t_8) ? __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_8) : __Pyx_PyObject_CallNoArg(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 384, __pyx_L9_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF_SET(__pyx_v_putter, __pyx_t_6); + __pyx_t_6 = 0; + + /* "src/gevent/queue.py":385 + * try: + * putter = self.putters.popleft() + * self._put(putter.item) # <<<<<<<<<<<<<< + * except: # pylint:disable=bare-except + * putter.throw(*sys.exc_info()) + */ + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_putter, __pyx_n_s_item); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 385, __pyx_L9_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = ((struct __pyx_vtabstruct_6gevent_6_queue_Queue *)__pyx_v_self->__pyx_vtab)->_put(__pyx_v_self, __pyx_t_6, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 385, __pyx_L9_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "src/gevent/queue.py":383 + * if self.putters and (self._maxsize == -1 or self.qsize() < self._maxsize): + * repeat = True + * try: # <<<<<<<<<<<<<< + * putter = self.putters.popleft() + * self._put(putter.item) + */ + } + + /* "src/gevent/queue.py":389 + * putter.throw(*sys.exc_info()) + * else: + * putter.switch(putter) # <<<<<<<<<<<<<< + * if self.getters and self.qsize(): + * repeat = True + */ + /*else:*/ { + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_putter, __pyx_n_s_switch); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 389, __pyx_L11_except_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_8 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { + __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_6); + if (likely(__pyx_t_8)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); + __Pyx_INCREF(__pyx_t_8); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_6, function); + } + } + __pyx_t_7 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_8, __pyx_v_putter) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_putter); + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 389, __pyx_L11_except_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + goto __pyx_L16_try_end; + __pyx_L9_error:; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "src/gevent/queue.py":386 + * putter = self.putters.popleft() + * self._put(putter.item) + * except: # pylint:disable=bare-except # <<<<<<<<<<<<<< + * putter.throw(*sys.exc_info()) + * else: + */ + /*except:*/ { + __Pyx_AddTraceback("gevent._queue.Queue._unlock", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_6, &__pyx_t_8) < 0) __PYX_ERR(0, 386, __pyx_L11_except_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_8); + + /* "src/gevent/queue.py":387 + * self._put(putter.item) + * except: # pylint:disable=bare-except + * putter.throw(*sys.exc_info()) # <<<<<<<<<<<<<< + * else: + * putter.switch(putter) + */ + if (unlikely(!__pyx_v_putter)) { __Pyx_RaiseUnboundLocalError("putter"); __PYX_ERR(0, 387, __pyx_L11_except_error) } + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_putter, __pyx_n_s_throw); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 387, __pyx_L11_except_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_sys); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 387, __pyx_L11_except_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_exc_info); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 387, __pyx_L11_except_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_11 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_12))) { + __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_12); + if (likely(__pyx_t_11)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12); + __Pyx_INCREF(__pyx_t_11); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_12, function); + } + } + __pyx_t_10 = (__pyx_t_11) ? __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_11) : __Pyx_PyObject_CallNoArg(__pyx_t_12); + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 387, __pyx_L11_except_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_12 = __Pyx_PySequence_Tuple(__pyx_t_10); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 387, __pyx_L11_except_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_12, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 387, __pyx_L11_except_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + goto __pyx_L10_exception_handled; + } + __pyx_L11_except_error:; + + /* "src/gevent/queue.py":383 + * if self.putters and (self._maxsize == -1 or self.qsize() < self._maxsize): + * repeat = True + * try: # <<<<<<<<<<<<<< + * putter = self.putters.popleft() + * self._put(putter.item) + */ + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); + goto __pyx_L1_error; + __pyx_L10_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); + __pyx_L16_try_end:; + } + + /* "src/gevent/queue.py":381 + * while True: + * repeat = False + * if self.putters and (self._maxsize == -1 or self.qsize() < self._maxsize): # <<<<<<<<<<<<<< + * repeat = True + * try: + */ + } + + /* "src/gevent/queue.py":390 + * else: + * putter.switch(putter) + * if self.getters and self.qsize(): # <<<<<<<<<<<<<< + * repeat = True + * getter = self.getters.popleft() + */ + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_self->getters); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 390, __pyx_L1_error) + if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L20_bool_binop_done; + } + __pyx_t_2 = (((struct __pyx_vtabstruct_6gevent_6_queue_Queue *)__pyx_v_self->__pyx_vtab)->qsize(__pyx_v_self, 0) != 0); + __pyx_t_1 = __pyx_t_2; + __pyx_L20_bool_binop_done:; + if (__pyx_t_1) { + + /* "src/gevent/queue.py":391 + * putter.switch(putter) + * if self.getters and self.qsize(): + * repeat = True # <<<<<<<<<<<<<< + * getter = self.getters.popleft() + * getter.switch(getter) + */ + __pyx_v_repeat = 1; + + /* "src/gevent/queue.py":392 + * if self.getters and self.qsize(): + * repeat = True + * getter = self.getters.popleft() # <<<<<<<<<<<<<< + * getter.switch(getter) + * if not repeat: + */ + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->getters, __pyx_n_s_popleft); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 392, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { + __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); + if (likely(__pyx_t_7)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); + __Pyx_INCREF(__pyx_t_7); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_6, function); + } + } + __pyx_t_8 = (__pyx_t_7) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7) : __Pyx_PyObject_CallNoArg(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 392, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF_SET(__pyx_v_getter, __pyx_t_8); + __pyx_t_8 = 0; + + /* "src/gevent/queue.py":393 + * repeat = True + * getter = self.getters.popleft() + * getter.switch(getter) # <<<<<<<<<<<<<< + * if not repeat: + * return + */ + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_getter, __pyx_n_s_switch); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 393, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { + __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); + if (likely(__pyx_t_7)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); + __Pyx_INCREF(__pyx_t_7); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_6, function); + } + } + __pyx_t_8 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_v_getter) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_getter); + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 393, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + + /* "src/gevent/queue.py":390 + * else: + * putter.switch(putter) + * if self.getters and self.qsize(): # <<<<<<<<<<<<<< + * repeat = True + * getter = self.getters.popleft() + */ + } + + /* "src/gevent/queue.py":394 + * getter = self.getters.popleft() + * getter.switch(getter) + * if not repeat: # <<<<<<<<<<<<<< + * return + * + */ + __pyx_t_1 = ((!(__pyx_v_repeat != 0)) != 0); + if (__pyx_t_1) { + + /* "src/gevent/queue.py":395 + * getter.switch(getter) + * if not repeat: + * return # <<<<<<<<<<<<<< + * + * def _schedule_unlock(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + + /* "src/gevent/queue.py":394 + * getter = self.getters.popleft() + * getter.switch(getter) + * if not repeat: # <<<<<<<<<<<<<< + * return + * + */ + } + } + + /* "src/gevent/queue.py":378 + * return self.peek(False) + * + * def _unlock(self): # <<<<<<<<<<<<<< + * while True: + * repeat = False + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_AddTraceback("gevent._queue.Queue._unlock", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_putter); + __Pyx_XDECREF(__pyx_v_getter); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/queue.py":397 + * return + * + * def _schedule_unlock(self): # <<<<<<<<<<<<<< + * if not self._event_unlock: + * self._event_unlock = self.hub.loop.run_callback(self._unlock) + */ + +static PyObject *__pyx_f_6gevent_6_queue_5Queue__schedule_unlock(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + __Pyx_RefNannySetupContext("_schedule_unlock", 0); + + /* "src/gevent/queue.py":398 + * + * def _schedule_unlock(self): + * if not self._event_unlock: # <<<<<<<<<<<<<< + * self._event_unlock = self.hub.loop.run_callback(self._unlock) + * + */ + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_self->_event_unlock); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 398, __pyx_L1_error) + __pyx_t_2 = ((!__pyx_t_1) != 0); + if (__pyx_t_2) { + + /* "src/gevent/queue.py":399 + * def _schedule_unlock(self): + * if not self._event_unlock: + * self._event_unlock = self.hub.loop.run_callback(self._unlock) # <<<<<<<<<<<<<< + * + * def __iter__(self): + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->hub, __pyx_n_s_loop); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 399, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_run_callback); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 399, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_unlock); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 399, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); + if (likely(__pyx_t_6)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_5, function); + } + } + __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4); + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 399, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GIVEREF(__pyx_t_3); + __Pyx_GOTREF(__pyx_v_self->_event_unlock); + __Pyx_DECREF(__pyx_v_self->_event_unlock); + __pyx_v_self->_event_unlock = __pyx_t_3; + __pyx_t_3 = 0; + + /* "src/gevent/queue.py":398 + * + * def _schedule_unlock(self): + * if not self._event_unlock: # <<<<<<<<<<<<<< + * self._event_unlock = self.hub.loop.run_callback(self._unlock) + * + */ + } + + /* "src/gevent/queue.py":397 + * return + * + * def _schedule_unlock(self): # <<<<<<<<<<<<<< + * if not self._event_unlock: + * self._event_unlock = self.hub.loop.run_callback(self._unlock) + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("gevent._queue.Queue._schedule_unlock", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/queue.py":401 + * self._event_unlock = self.hub.loop.run_callback(self._unlock) + * + * def __iter__(self): # <<<<<<<<<<<<<< + * return self + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_queue_5Queue_45__iter__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_6_queue_5Queue_45__iter__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6_queue_5Queue_44__iter__(((struct __pyx_obj_6gevent_6_queue_Queue *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_queue_5Queue_44__iter__(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__iter__", 0); + + /* "src/gevent/queue.py":402 + * + * def __iter__(self): + * return self # <<<<<<<<<<<<<< + * + * def __next__(self): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __pyx_r = ((PyObject *)__pyx_v_self); + goto __pyx_L0; + + /* "src/gevent/queue.py":401 + * self._event_unlock = self.hub.loop.run_callback(self._unlock) + * + * def __iter__(self): # <<<<<<<<<<<<<< + * return self + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/queue.py":404 + * return self + * + * def __next__(self): # <<<<<<<<<<<<<< + * result = self.get() + * if result is StopIteration: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_queue_5Queue_47__next__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_6_queue_5Queue_47__next__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__next__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6_queue_5Queue_46__next__(((struct __pyx_obj_6gevent_6_queue_Queue *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_queue_5Queue_46__next__(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self) { + PyObject *__pyx_v_result = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + __Pyx_RefNannySetupContext("__next__", 0); + + /* "src/gevent/queue.py":405 + * + * def __next__(self): + * result = self.get() # <<<<<<<<<<<<<< + * if result is StopIteration: + * raise result + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_6_queue_Queue *)__pyx_v_self->__pyx_vtab)->get(__pyx_v_self, 0, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 405, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_result = __pyx_t_1; + __pyx_t_1 = 0; + + /* "src/gevent/queue.py":406 + * def __next__(self): + * result = self.get() + * if result is StopIteration: # <<<<<<<<<<<<<< + * raise result + * return result + */ + __pyx_t_2 = (__pyx_v_result == __pyx_builtin_StopIteration); + __pyx_t_3 = (__pyx_t_2 != 0); + if (unlikely(__pyx_t_3)) { + + /* "src/gevent/queue.py":407 + * result = self.get() + * if result is StopIteration: + * raise result # <<<<<<<<<<<<<< + * return result + * + */ + __Pyx_Raise(__pyx_v_result, 0, 0, 0); + __PYX_ERR(0, 407, __pyx_L1_error) + + /* "src/gevent/queue.py":406 + * def __next__(self): + * result = self.get() + * if result is StopIteration: # <<<<<<<<<<<<<< + * raise result + * return result + */ + } + + /* "src/gevent/queue.py":408 + * if result is StopIteration: + * raise result + * return result # <<<<<<<<<<<<<< + * + * next = __next__ # Py2 + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; + goto __pyx_L0; + + /* "src/gevent/queue.py":404 + * return self + * + * def __next__(self): # <<<<<<<<<<<<<< + * result = self.get() + * if result is StopIteration: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent._queue.Queue.__next__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/_queue.pxd":20 + * cdef class Queue: + * cdef __weakref__ + * cdef readonly hub # <<<<<<<<<<<<<< + * cdef readonly queue + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_queue_5Queue_3hub_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_6_queue_5Queue_3hub_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6_queue_5Queue_3hub___get__(((struct __pyx_obj_6gevent_6_queue_Queue *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_queue_5Queue_3hub___get__(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->hub); + __pyx_r = __pyx_v_self->hub; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/_queue.pxd":21 + * cdef __weakref__ + * cdef readonly hub + * cdef readonly queue # <<<<<<<<<<<<<< + * + * cdef getters + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_queue_5Queue_5queue_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_6_queue_5Queue_5queue_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6_queue_5Queue_5queue___get__(((struct __pyx_obj_6gevent_6_queue_Queue *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_queue_5Queue_5queue___get__(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->queue); + __pyx_r = __pyx_v_self->queue; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/queue.py":419 + * __slots__ = () + * + * def __init__(self, maxsize=None, items=()): # <<<<<<<<<<<<<< + * if maxsize is not None: + * raise ValueError("UnboundQueue has no maxsize") + */ + +/* Python wrapper */ +static int __pyx_pw_6gevent_6_queue_12UnboundQueue_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6gevent_6_queue_12UnboundQueue_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_maxsize = 0; + PyObject *__pyx_v_items = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_maxsize,&__pyx_n_s_items,0}; + PyObject* values[2] = {0,0}; + values[0] = ((PyObject *)Py_None); + values[1] = ((PyObject *)__pyx_empty_tuple); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_maxsize); + if (value) { values[0] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 1: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_items); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 419, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_maxsize = values[0]; + __pyx_v_items = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 419, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent._queue.UnboundQueue.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_6_queue_12UnboundQueue___init__(((struct __pyx_obj_6gevent_6_queue_UnboundQueue *)__pyx_v_self), __pyx_v_maxsize, __pyx_v_items); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_6_queue_12UnboundQueue___init__(struct __pyx_obj_6gevent_6_queue_UnboundQueue *__pyx_v_self, PyObject *__pyx_v_maxsize, PyObject *__pyx_v_items) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "src/gevent/queue.py":420 + * + * def __init__(self, maxsize=None, items=()): + * if maxsize is not None: # <<<<<<<<<<<<<< + * raise ValueError("UnboundQueue has no maxsize") + * Queue.__init__(self, maxsize, items) + */ + __pyx_t_1 = (__pyx_v_maxsize != Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (unlikely(__pyx_t_2)) { + + /* "src/gevent/queue.py":421 + * def __init__(self, maxsize=None, items=()): + * if maxsize is not None: + * raise ValueError("UnboundQueue has no maxsize") # <<<<<<<<<<<<<< + * Queue.__init__(self, maxsize, items) + * self.putters = None # Will never be used. + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 421, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(0, 421, __pyx_L1_error) + + /* "src/gevent/queue.py":420 + * + * def __init__(self, maxsize=None, items=()): + * if maxsize is not None: # <<<<<<<<<<<<<< + * raise ValueError("UnboundQueue has no maxsize") + * Queue.__init__(self, maxsize, items) + */ + } + + /* "src/gevent/queue.py":422 + * if maxsize is not None: + * raise ValueError("UnboundQueue has no maxsize") + * Queue.__init__(self, maxsize, items) # <<<<<<<<<<<<<< + * self.putters = None # Will never be used. + * + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_6gevent_6_queue_Queue), __pyx_n_s_init); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 422, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = NULL; + __pyx_t_6 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + __pyx_t_6 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_4)) { + PyObject *__pyx_temp[4] = {__pyx_t_5, ((PyObject *)__pyx_v_self), __pyx_v_maxsize, __pyx_v_items}; + __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 422, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_t_3); + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { + PyObject *__pyx_temp[4] = {__pyx_t_5, ((PyObject *)__pyx_v_self), __pyx_v_maxsize, __pyx_v_items}; + __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 422, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_t_3); + } else + #endif + { + __pyx_t_7 = PyTuple_New(3+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 422, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + if (__pyx_t_5) { + __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL; + } + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, ((PyObject *)__pyx_v_self)); + __Pyx_INCREF(__pyx_v_maxsize); + __Pyx_GIVEREF(__pyx_v_maxsize); + PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_maxsize); + __Pyx_INCREF(__pyx_v_items); + __Pyx_GIVEREF(__pyx_v_items); + PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_6, __pyx_v_items); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 422, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "src/gevent/queue.py":423 + * raise ValueError("UnboundQueue has no maxsize") + * Queue.__init__(self, maxsize, items) + * self.putters = None # Will never be used. # <<<<<<<<<<<<<< + * + * def put(self, item, block=True, timeout=None): + */ + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->__pyx_base.putters); + __Pyx_DECREF(__pyx_v_self->__pyx_base.putters); + __pyx_v_self->__pyx_base.putters = Py_None; + + /* "src/gevent/queue.py":419 + * __slots__ = () + * + * def __init__(self, maxsize=None, items=()): # <<<<<<<<<<<<<< + * if maxsize is not None: + * raise ValueError("UnboundQueue has no maxsize") + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("gevent._queue.UnboundQueue.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/queue.py":425 + * self.putters = None # Will never be used. + * + * def put(self, item, block=True, timeout=None): # <<<<<<<<<<<<<< + * self._put(item) + * if self.getters: + */ + +static PyObject *__pyx_pw_6gevent_6_queue_12UnboundQueue_3put(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_6gevent_6_queue_12UnboundQueue_put(struct __pyx_obj_6gevent_6_queue_UnboundQueue *__pyx_v_self, PyObject *__pyx_v_item, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_6_queue_12UnboundQueue_put *__pyx_optional_args) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + __Pyx_RefNannySetupContext("put", 0); + if (__pyx_optional_args) { + } + + /* "src/gevent/queue.py":426 + * + * def put(self, item, block=True, timeout=None): + * self._put(item) # <<<<<<<<<<<<<< + * if self.getters: + * self._schedule_unlock() + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_6_queue_UnboundQueue *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._put(((struct __pyx_obj_6gevent_6_queue_Queue *)__pyx_v_self), __pyx_v_item, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 426, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/queue.py":427 + * def put(self, item, block=True, timeout=None): + * self._put(item) + * if self.getters: # <<<<<<<<<<<<<< + * self._schedule_unlock() + * + */ + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_self->__pyx_base.getters); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 427, __pyx_L1_error) + if (__pyx_t_2) { + + /* "src/gevent/queue.py":428 + * self._put(item) + * if self.getters: + * self._schedule_unlock() # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_6_queue_UnboundQueue *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._schedule_unlock(((struct __pyx_obj_6gevent_6_queue_Queue *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 428, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/queue.py":427 + * def put(self, item, block=True, timeout=None): + * self._put(item) + * if self.getters: # <<<<<<<<<<<<<< + * self._schedule_unlock() + * + */ + } + + /* "src/gevent/queue.py":425 + * self.putters = None # Will never be used. + * + * def put(self, item, block=True, timeout=None): # <<<<<<<<<<<<<< + * self._put(item) + * if self.getters: + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent._queue.UnboundQueue.put", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_queue_12UnboundQueue_3put(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6gevent_6_queue_12UnboundQueue_2put[] = "UnboundQueue.put(self, item, block=True, timeout=None)"; +static PyMethodDef __pyx_mdef_6gevent_6_queue_12UnboundQueue_3put = {"put", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_6_queue_12UnboundQueue_3put, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_6_queue_12UnboundQueue_2put}; +static PyObject *__pyx_pw_6gevent_6_queue_12UnboundQueue_3put(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_item = 0; + PyObject *__pyx_v_block = 0; + PyObject *__pyx_v_timeout = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("put (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_item,&__pyx_n_s_block,&__pyx_n_s_timeout,0}; + PyObject* values[3] = {0,0,0}; + values[1] = ((PyObject *)Py_True); + values[2] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_item)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_block); + if (value) { values[1] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 2: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_timeout); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "put") < 0)) __PYX_ERR(0, 425, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_item = values[0]; + __pyx_v_block = values[1]; + __pyx_v_timeout = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("put", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 425, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent._queue.UnboundQueue.put", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_6_queue_12UnboundQueue_2put(((struct __pyx_obj_6gevent_6_queue_UnboundQueue *)__pyx_v_self), __pyx_v_item, __pyx_v_block, __pyx_v_timeout); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_queue_12UnboundQueue_2put(struct __pyx_obj_6gevent_6_queue_UnboundQueue *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_block, PyObject *__pyx_v_timeout) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + struct __pyx_opt_args_6gevent_6_queue_5Queue_put __pyx_t_2; + __Pyx_RefNannySetupContext("put", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_2.__pyx_n = 2; + __pyx_t_2.block = __pyx_v_block; + __pyx_t_2.timeout = __pyx_v_timeout; + __pyx_t_1 = __pyx_vtabptr_6gevent_6_queue_UnboundQueue->__pyx_base.put(((struct __pyx_obj_6gevent_6_queue_Queue *)__pyx_v_self), __pyx_v_item, 1, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 425, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent._queue.UnboundQueue.put", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/queue.py":444 + * __slots__ = () + * + * def _create_queue(self, items=()): # <<<<<<<<<<<<<< + * q = list(items) + * _heapify(q) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_queue_13PriorityQueue_1_create_queue(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6gevent_6_queue_13PriorityQueue__create_queue[] = "PriorityQueue._create_queue(self, items=())"; +static PyMethodDef __pyx_mdef_6gevent_6_queue_13PriorityQueue_1_create_queue = {"_create_queue", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_6_queue_13PriorityQueue_1_create_queue, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_6_queue_13PriorityQueue__create_queue}; +static PyObject *__pyx_pw_6gevent_6_queue_13PriorityQueue_1_create_queue(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_items = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_create_queue (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_items,0}; + PyObject* values[1] = {0}; + values[0] = ((PyObject *)__pyx_empty_tuple); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_items); + if (value) { values[0] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_create_queue") < 0)) __PYX_ERR(0, 444, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_items = values[0]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("_create_queue", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 444, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent._queue.PriorityQueue._create_queue", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_6_queue_13PriorityQueue__create_queue(((struct __pyx_obj_6gevent_6_queue_PriorityQueue *)__pyx_v_self), __pyx_v_items); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_queue_13PriorityQueue__create_queue(CYTHON_UNUSED struct __pyx_obj_6gevent_6_queue_PriorityQueue *__pyx_v_self, PyObject *__pyx_v_items) { + PyObject *__pyx_v_q = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("_create_queue", 0); + + /* "src/gevent/queue.py":445 + * + * def _create_queue(self, items=()): + * q = list(items) # <<<<<<<<<<<<<< + * _heapify(q) + * return q + */ + __pyx_t_1 = PySequence_List(__pyx_v_items); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 445, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_q = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "src/gevent/queue.py":446 + * def _create_queue(self, items=()): + * q = list(items) + * _heapify(q) # <<<<<<<<<<<<<< + * return q + * + */ + __Pyx_INCREF(__pyx_v_6gevent_6_queue__heapify); + __pyx_t_2 = __pyx_v_6gevent_6_queue__heapify; __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_q) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_q); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 446, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/queue.py":447 + * q = list(items) + * _heapify(q) + * return q # <<<<<<<<<<<<<< + * + * def _put(self, item): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_q); + __pyx_r = __pyx_v_q; + goto __pyx_L0; + + /* "src/gevent/queue.py":444 + * __slots__ = () + * + * def _create_queue(self, items=()): # <<<<<<<<<<<<<< + * q = list(items) + * _heapify(q) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("gevent._queue.PriorityQueue._create_queue", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_q); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/queue.py":449 + * return q + * + * def _put(self, item): # <<<<<<<<<<<<<< + * _heappush(self.queue, item) + * + */ + +static PyObject *__pyx_pw_6gevent_6_queue_13PriorityQueue_3_put(PyObject *__pyx_v_self, PyObject *__pyx_v_item); /*proto*/ +static PyObject *__pyx_f_6gevent_6_queue_13PriorityQueue__put(struct __pyx_obj_6gevent_6_queue_PriorityQueue *__pyx_v_self, PyObject *__pyx_v_item, int __pyx_skip_dispatch) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + __Pyx_RefNannySetupContext("_put", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0; + if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self)))))); + else { + PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + #endif + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_put); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 449, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_6_queue_13PriorityQueue_3_put)) { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_item) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_item); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 449, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0; + if (unlikely(type_dict_guard != tp_dict_version)) { + tp_dict_version = obj_dict_version = 0; + } + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + } + #endif + } + + /* "src/gevent/queue.py":450 + * + * def _put(self, item): + * _heappush(self.queue, item) # <<<<<<<<<<<<<< + * + * def _get(self): + */ + __Pyx_INCREF(__pyx_v_6gevent_6_queue__heappush); + __pyx_t_2 = __pyx_v_6gevent_6_queue__heappush; __pyx_t_3 = NULL; + __pyx_t_5 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_5 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_self->__pyx_base.queue, __pyx_v_item}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 450, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_self->__pyx_base.queue, __pyx_v_item}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 450, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else + #endif + { + __pyx_t_4 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 450, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (__pyx_t_3) { + __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = NULL; + } + __Pyx_INCREF(__pyx_v_self->__pyx_base.queue); + __Pyx_GIVEREF(__pyx_v_self->__pyx_base.queue); + PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_5, __pyx_v_self->__pyx_base.queue); + __Pyx_INCREF(__pyx_v_item); + __Pyx_GIVEREF(__pyx_v_item); + PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_5, __pyx_v_item); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 450, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/queue.py":449 + * return q + * + * def _put(self, item): # <<<<<<<<<<<<<< + * _heappush(self.queue, item) + * + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("gevent._queue.PriorityQueue._put", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_queue_13PriorityQueue_3_put(PyObject *__pyx_v_self, PyObject *__pyx_v_item); /*proto*/ +static char __pyx_doc_6gevent_6_queue_13PriorityQueue_2_put[] = "PriorityQueue._put(self, item)"; +static PyMethodDef __pyx_mdef_6gevent_6_queue_13PriorityQueue_3_put = {"_put", (PyCFunction)__pyx_pw_6gevent_6_queue_13PriorityQueue_3_put, METH_O, __pyx_doc_6gevent_6_queue_13PriorityQueue_2_put}; +static PyObject *__pyx_pw_6gevent_6_queue_13PriorityQueue_3_put(PyObject *__pyx_v_self, PyObject *__pyx_v_item) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_put (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6_queue_13PriorityQueue_2_put(((struct __pyx_obj_6gevent_6_queue_PriorityQueue *)__pyx_v_self), ((PyObject *)__pyx_v_item)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_queue_13PriorityQueue_2_put(struct __pyx_obj_6gevent_6_queue_PriorityQueue *__pyx_v_self, PyObject *__pyx_v_item) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("_put", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6gevent_6_queue_13PriorityQueue__put(__pyx_v_self, __pyx_v_item, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 449, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent._queue.PriorityQueue._put", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/queue.py":452 + * _heappush(self.queue, item) + * + * def _get(self): # <<<<<<<<<<<<<< + * return _heappop(self.queue) + * + */ + +static PyObject *__pyx_pw_6gevent_6_queue_13PriorityQueue_5_get(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_f_6gevent_6_queue_13PriorityQueue__get(struct __pyx_obj_6gevent_6_queue_PriorityQueue *__pyx_v_self, int __pyx_skip_dispatch) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + __Pyx_RefNannySetupContext("_get", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0; + if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self)))))); + else { + PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + #endif + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 452, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_6_queue_13PriorityQueue_5_get)) { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 452, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0; + if (unlikely(type_dict_guard != tp_dict_version)) { + tp_dict_version = obj_dict_version = 0; + } + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + } + #endif + } + + /* "src/gevent/queue.py":453 + * + * def _get(self): + * return _heappop(self.queue) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_6gevent_6_queue__heappop); + __pyx_t_2 = __pyx_v_6gevent_6_queue__heappop; __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_self->__pyx_base.queue) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_self->__pyx_base.queue); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 453, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "src/gevent/queue.py":452 + * _heappush(self.queue, item) + * + * def _get(self): # <<<<<<<<<<<<<< + * return _heappop(self.queue) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("gevent._queue.PriorityQueue._get", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_queue_13PriorityQueue_5_get(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6gevent_6_queue_13PriorityQueue_4_get[] = "PriorityQueue._get(self)"; +static PyMethodDef __pyx_mdef_6gevent_6_queue_13PriorityQueue_5_get = {"_get", (PyCFunction)__pyx_pw_6gevent_6_queue_13PriorityQueue_5_get, METH_NOARGS, __pyx_doc_6gevent_6_queue_13PriorityQueue_4_get}; +static PyObject *__pyx_pw_6gevent_6_queue_13PriorityQueue_5_get(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_get (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6_queue_13PriorityQueue_4_get(((struct __pyx_obj_6gevent_6_queue_PriorityQueue *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_queue_13PriorityQueue_4_get(struct __pyx_obj_6gevent_6_queue_PriorityQueue *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("_get", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6gevent_6_queue_13PriorityQueue__get(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 452, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent._queue.PriorityQueue._get", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/queue.py":461 + * __slots__ = () + * + * def _create_queue(self, items=()): # <<<<<<<<<<<<<< + * return list(items) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_queue_9LifoQueue_1_create_queue(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6gevent_6_queue_9LifoQueue__create_queue[] = "LifoQueue._create_queue(self, items=())"; +static PyMethodDef __pyx_mdef_6gevent_6_queue_9LifoQueue_1_create_queue = {"_create_queue", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_6_queue_9LifoQueue_1_create_queue, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_6_queue_9LifoQueue__create_queue}; +static PyObject *__pyx_pw_6gevent_6_queue_9LifoQueue_1_create_queue(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_items = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_create_queue (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_items,0}; + PyObject* values[1] = {0}; + values[0] = ((PyObject *)__pyx_empty_tuple); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_items); + if (value) { values[0] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_create_queue") < 0)) __PYX_ERR(0, 461, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_items = values[0]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("_create_queue", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 461, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent._queue.LifoQueue._create_queue", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_6_queue_9LifoQueue__create_queue(((struct __pyx_obj_6gevent_6_queue_LifoQueue *)__pyx_v_self), __pyx_v_items); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_queue_9LifoQueue__create_queue(CYTHON_UNUSED struct __pyx_obj_6gevent_6_queue_LifoQueue *__pyx_v_self, PyObject *__pyx_v_items) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("_create_queue", 0); + + /* "src/gevent/queue.py":462 + * + * def _create_queue(self, items=()): + * return list(items) # <<<<<<<<<<<<<< + * + * def _put(self, item): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PySequence_List(__pyx_v_items); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "src/gevent/queue.py":461 + * __slots__ = () + * + * def _create_queue(self, items=()): # <<<<<<<<<<<<<< + * return list(items) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent._queue.LifoQueue._create_queue", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/queue.py":464 + * return list(items) + * + * def _put(self, item): # <<<<<<<<<<<<<< + * self.queue.append(item) + * + */ + +static PyObject *__pyx_pw_6gevent_6_queue_9LifoQueue_3_put(PyObject *__pyx_v_self, PyObject *__pyx_v_item); /*proto*/ +static PyObject *__pyx_f_6gevent_6_queue_9LifoQueue__put(struct __pyx_obj_6gevent_6_queue_LifoQueue *__pyx_v_self, PyObject *__pyx_v_item, int __pyx_skip_dispatch) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + __Pyx_RefNannySetupContext("_put", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0; + if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self)))))); + else { + PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + #endif + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_put); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_6_queue_9LifoQueue_3_put)) { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_item) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_item); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 464, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0; + if (unlikely(type_dict_guard != tp_dict_version)) { + tp_dict_version = obj_dict_version = 0; + } + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + } + #endif + } + + /* "src/gevent/queue.py":465 + * + * def _put(self, item): + * self.queue.append(item) # <<<<<<<<<<<<<< + * + * def _get(self): + */ + __pyx_t_5 = __Pyx_PyObject_Append(__pyx_v_self->__pyx_base.queue, __pyx_v_item); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 465, __pyx_L1_error) + + /* "src/gevent/queue.py":464 + * return list(items) + * + * def _put(self, item): # <<<<<<<<<<<<<< + * self.queue.append(item) + * + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("gevent._queue.LifoQueue._put", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_queue_9LifoQueue_3_put(PyObject *__pyx_v_self, PyObject *__pyx_v_item); /*proto*/ +static char __pyx_doc_6gevent_6_queue_9LifoQueue_2_put[] = "LifoQueue._put(self, item)"; +static PyMethodDef __pyx_mdef_6gevent_6_queue_9LifoQueue_3_put = {"_put", (PyCFunction)__pyx_pw_6gevent_6_queue_9LifoQueue_3_put, METH_O, __pyx_doc_6gevent_6_queue_9LifoQueue_2_put}; +static PyObject *__pyx_pw_6gevent_6_queue_9LifoQueue_3_put(PyObject *__pyx_v_self, PyObject *__pyx_v_item) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_put (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6_queue_9LifoQueue_2_put(((struct __pyx_obj_6gevent_6_queue_LifoQueue *)__pyx_v_self), ((PyObject *)__pyx_v_item)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_queue_9LifoQueue_2_put(struct __pyx_obj_6gevent_6_queue_LifoQueue *__pyx_v_self, PyObject *__pyx_v_item) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("_put", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6gevent_6_queue_9LifoQueue__put(__pyx_v_self, __pyx_v_item, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent._queue.LifoQueue._put", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/queue.py":467 + * self.queue.append(item) + * + * def _get(self): # <<<<<<<<<<<<<< + * return self.queue.pop() + * + */ + +static PyObject *__pyx_pw_6gevent_6_queue_9LifoQueue_5_get(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_f_6gevent_6_queue_9LifoQueue__get(struct __pyx_obj_6gevent_6_queue_LifoQueue *__pyx_v_self, int __pyx_skip_dispatch) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + __Pyx_RefNannySetupContext("_get", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0; + if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self)))))); + else { + PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + #endif + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 467, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_6_queue_9LifoQueue_5_get)) { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 467, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0; + if (unlikely(type_dict_guard != tp_dict_version)) { + tp_dict_version = obj_dict_version = 0; + } + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + } + #endif + } + + /* "src/gevent/queue.py":468 + * + * def _get(self): + * return self.queue.pop() # <<<<<<<<<<<<<< + * + * def _peek(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_Pop(__pyx_v_self->__pyx_base.queue); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 468, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "src/gevent/queue.py":467 + * self.queue.append(item) + * + * def _get(self): # <<<<<<<<<<<<<< + * return self.queue.pop() + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("gevent._queue.LifoQueue._get", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_queue_9LifoQueue_5_get(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6gevent_6_queue_9LifoQueue_4_get[] = "LifoQueue._get(self)"; +static PyMethodDef __pyx_mdef_6gevent_6_queue_9LifoQueue_5_get = {"_get", (PyCFunction)__pyx_pw_6gevent_6_queue_9LifoQueue_5_get, METH_NOARGS, __pyx_doc_6gevent_6_queue_9LifoQueue_4_get}; +static PyObject *__pyx_pw_6gevent_6_queue_9LifoQueue_5_get(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_get (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6_queue_9LifoQueue_4_get(((struct __pyx_obj_6gevent_6_queue_LifoQueue *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_queue_9LifoQueue_4_get(struct __pyx_obj_6gevent_6_queue_LifoQueue *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("_get", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6gevent_6_queue_9LifoQueue__get(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 467, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent._queue.LifoQueue._get", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/queue.py":470 + * return self.queue.pop() + * + * def _peek(self): # <<<<<<<<<<<<<< + * return self.queue[-1] + * + */ + +static PyObject *__pyx_pw_6gevent_6_queue_9LifoQueue_7_peek(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_f_6gevent_6_queue_9LifoQueue__peek(struct __pyx_obj_6gevent_6_queue_LifoQueue *__pyx_v_self, int __pyx_skip_dispatch) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + __Pyx_RefNannySetupContext("_peek", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0; + if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self)))))); + else { + PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + #endif + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_peek); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 470, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_6_queue_9LifoQueue_7_peek)) { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 470, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0; + if (unlikely(type_dict_guard != tp_dict_version)) { + tp_dict_version = obj_dict_version = 0; + } + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + } + #endif + } + + /* "src/gevent/queue.py":471 + * + * def _peek(self): + * return self.queue[-1] # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_self->__pyx_base.queue, -1L, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 471, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "src/gevent/queue.py":470 + * return self.queue.pop() + * + * def _peek(self): # <<<<<<<<<<<<<< + * return self.queue[-1] + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("gevent._queue.LifoQueue._peek", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_queue_9LifoQueue_7_peek(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6gevent_6_queue_9LifoQueue_6_peek[] = "LifoQueue._peek(self)"; +static PyMethodDef __pyx_mdef_6gevent_6_queue_9LifoQueue_7_peek = {"_peek", (PyCFunction)__pyx_pw_6gevent_6_queue_9LifoQueue_7_peek, METH_NOARGS, __pyx_doc_6gevent_6_queue_9LifoQueue_6_peek}; +static PyObject *__pyx_pw_6gevent_6_queue_9LifoQueue_7_peek(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_peek (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6_queue_9LifoQueue_6_peek(((struct __pyx_obj_6gevent_6_queue_LifoQueue *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_queue_9LifoQueue_6_peek(struct __pyx_obj_6gevent_6_queue_LifoQueue *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("_peek", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6gevent_6_queue_9LifoQueue__peek(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 470, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent._queue.LifoQueue._peek", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/queue.py":485 + * ) + * + * def __init__(self, maxsize=None, items=(), unfinished_tasks=None): # <<<<<<<<<<<<<< + * """ + * + */ + +/* Python wrapper */ +static int __pyx_pw_6gevent_6_queue_13JoinableQueue_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6gevent_6_queue_13JoinableQueue___init__[] = "\n\n .. versionchanged:: 1.1a1\n If *unfinished_tasks* is not given, then all the given *items*\n (if any) will be considered unfinished.\n\n "; +#if CYTHON_COMPILING_IN_CPYTHON +struct wrapperbase __pyx_wrapperbase_6gevent_6_queue_13JoinableQueue___init__; +#endif +static int __pyx_pw_6gevent_6_queue_13JoinableQueue_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_maxsize = 0; + PyObject *__pyx_v_items = 0; + PyObject *__pyx_v_unfinished_tasks = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_maxsize,&__pyx_n_s_items,&__pyx_n_s_unfinished_tasks,0}; + PyObject* values[3] = {0,0,0}; + values[0] = ((PyObject *)Py_None); + values[1] = ((PyObject *)__pyx_empty_tuple); + values[2] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_maxsize); + if (value) { values[0] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 1: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_items); + if (value) { values[1] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 2: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_unfinished_tasks); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 485, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_maxsize = values[0]; + __pyx_v_items = values[1]; + __pyx_v_unfinished_tasks = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 485, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent._queue.JoinableQueue.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_6_queue_13JoinableQueue___init__(((struct __pyx_obj_6gevent_6_queue_JoinableQueue *)__pyx_v_self), __pyx_v_maxsize, __pyx_v_items, __pyx_v_unfinished_tasks); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_6_queue_13JoinableQueue___init__(struct __pyx_obj_6gevent_6_queue_JoinableQueue *__pyx_v_self, PyObject *__pyx_v_maxsize, PyObject *__pyx_v_items, PyObject *__pyx_v_unfinished_tasks) { + PyObject *__pyx_v_Event = NULL; + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + int __pyx_t_6; + Py_ssize_t __pyx_t_7; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "src/gevent/queue.py":493 + * + * """ + * Queue.__init__(self, maxsize, items, _warn_depth=3) # <<<<<<<<<<<<<< + * + * from gevent.event import Event + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_6gevent_6_queue_Queue), __pyx_n_s_init); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 493, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 493, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self)); + __Pyx_INCREF(__pyx_v_maxsize); + __Pyx_GIVEREF(__pyx_v_maxsize); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_maxsize); + __Pyx_INCREF(__pyx_v_items); + __Pyx_GIVEREF(__pyx_v_items); + PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_items); + __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 493, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_warn_depth, __pyx_int_3) < 0) __PYX_ERR(0, 493, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 493, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "src/gevent/queue.py":495 + * Queue.__init__(self, maxsize, items, _warn_depth=3) + * + * from gevent.event import Event # <<<<<<<<<<<<<< + * self._cond = Event() + * self._cond.set() + */ + __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 495, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_n_s_Event); + __Pyx_GIVEREF(__pyx_n_s_Event); + PyList_SET_ITEM(__pyx_t_4, 0, __pyx_n_s_Event); + __pyx_t_3 = __Pyx_Import(__pyx_n_s_gevent_event, __pyx_t_4, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 495, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_Event); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 495, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_t_4); + __pyx_v_Event = __pyx_t_4; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "src/gevent/queue.py":496 + * + * from gevent.event import Event + * self._cond = Event() # <<<<<<<<<<<<<< + * self._cond.set() + * + */ + __Pyx_INCREF(__pyx_v_Event); + __pyx_t_4 = __pyx_v_Event; __pyx_t_2 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_2)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + } + } + __pyx_t_3 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 496, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_6gevent_6_event_Event))))) __PYX_ERR(0, 496, __pyx_L1_error) + __Pyx_GIVEREF(__pyx_t_3); + __Pyx_GOTREF(__pyx_v_self->_cond); + __Pyx_DECREF(((PyObject *)__pyx_v_self->_cond)); + __pyx_v_self->_cond = ((struct __pyx_obj_6gevent_6_event_Event *)__pyx_t_3); + __pyx_t_3 = 0; + + /* "src/gevent/queue.py":497 + * from gevent.event import Event + * self._cond = Event() + * self._cond.set() # <<<<<<<<<<<<<< + * + * if unfinished_tasks: + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->_cond), __pyx_n_s_set); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 497, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_2)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + } + } + __pyx_t_3 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 497, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "src/gevent/queue.py":499 + * self._cond.set() + * + * if unfinished_tasks: # <<<<<<<<<<<<<< + * self.unfinished_tasks = unfinished_tasks + * elif items: + */ + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_unfinished_tasks); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 499, __pyx_L1_error) + if (__pyx_t_5) { + + /* "src/gevent/queue.py":500 + * + * if unfinished_tasks: + * self.unfinished_tasks = unfinished_tasks # <<<<<<<<<<<<<< + * elif items: + * self.unfinished_tasks = len(items) + */ + __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_v_unfinished_tasks); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 500, __pyx_L1_error) + __pyx_v_self->unfinished_tasks = __pyx_t_6; + + /* "src/gevent/queue.py":499 + * self._cond.set() + * + * if unfinished_tasks: # <<<<<<<<<<<<<< + * self.unfinished_tasks = unfinished_tasks + * elif items: + */ + goto __pyx_L3; + } + + /* "src/gevent/queue.py":501 + * if unfinished_tasks: + * self.unfinished_tasks = unfinished_tasks + * elif items: # <<<<<<<<<<<<<< + * self.unfinished_tasks = len(items) + * else: + */ + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_items); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 501, __pyx_L1_error) + if (__pyx_t_5) { + + /* "src/gevent/queue.py":502 + * self.unfinished_tasks = unfinished_tasks + * elif items: + * self.unfinished_tasks = len(items) # <<<<<<<<<<<<<< + * else: + * self.unfinished_tasks = 0 + */ + __pyx_t_7 = PyObject_Length(__pyx_v_items); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 502, __pyx_L1_error) + __pyx_v_self->unfinished_tasks = __pyx_t_7; + + /* "src/gevent/queue.py":501 + * if unfinished_tasks: + * self.unfinished_tasks = unfinished_tasks + * elif items: # <<<<<<<<<<<<<< + * self.unfinished_tasks = len(items) + * else: + */ + goto __pyx_L3; + } + + /* "src/gevent/queue.py":504 + * self.unfinished_tasks = len(items) + * else: + * self.unfinished_tasks = 0 # <<<<<<<<<<<<<< + * + * if self.unfinished_tasks: + */ + /*else*/ { + __pyx_v_self->unfinished_tasks = 0; + } + __pyx_L3:; + + /* "src/gevent/queue.py":506 + * self.unfinished_tasks = 0 + * + * if self.unfinished_tasks: # <<<<<<<<<<<<<< + * self._cond.clear() + * + */ + __pyx_t_5 = (__pyx_v_self->unfinished_tasks != 0); + if (__pyx_t_5) { + + /* "src/gevent/queue.py":507 + * + * if self.unfinished_tasks: + * self._cond.clear() # <<<<<<<<<<<<<< + * + * def copy(self): + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->_cond), __pyx_n_s_clear); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 507, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_2)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + } + } + __pyx_t_3 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 507, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "src/gevent/queue.py":506 + * self.unfinished_tasks = 0 + * + * if self.unfinished_tasks: # <<<<<<<<<<<<<< + * self._cond.clear() + * + */ + } + + /* "src/gevent/queue.py":485 + * ) + * + * def __init__(self, maxsize=None, items=(), unfinished_tasks=None): # <<<<<<<<<<<<<< + * """ + * + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("gevent._queue.JoinableQueue.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_Event); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/queue.py":509 + * self._cond.clear() + * + * def copy(self): # <<<<<<<<<<<<<< + * return type(self)(self.maxsize, self.queue, self.unfinished_tasks) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_queue_13JoinableQueue_3copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6gevent_6_queue_13JoinableQueue_2copy[] = "JoinableQueue.copy(self)"; +static PyMethodDef __pyx_mdef_6gevent_6_queue_13JoinableQueue_3copy = {"copy", (PyCFunction)__pyx_pw_6gevent_6_queue_13JoinableQueue_3copy, METH_NOARGS, __pyx_doc_6gevent_6_queue_13JoinableQueue_2copy}; +static PyObject *__pyx_pw_6gevent_6_queue_13JoinableQueue_3copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("copy (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6_queue_13JoinableQueue_2copy(((struct __pyx_obj_6gevent_6_queue_JoinableQueue *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_queue_13JoinableQueue_2copy(struct __pyx_obj_6gevent_6_queue_JoinableQueue *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + __Pyx_RefNannySetupContext("copy", 0); + + /* "src/gevent/queue.py":510 + * + * def copy(self): + * return type(self)(self.maxsize, self.queue, self.unfinished_tasks) # <<<<<<<<<<<<<< + * + * def _format(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_maxsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 510, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->unfinished_tasks); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 510, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); + __pyx_t_4 = ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))); __pyx_t_5 = NULL; + __pyx_t_6 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + __pyx_t_6 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_4)) { + PyObject *__pyx_temp[4] = {__pyx_t_5, __pyx_t_2, __pyx_v_self->__pyx_base.queue, __pyx_t_3}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 510, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { + PyObject *__pyx_temp[4] = {__pyx_t_5, __pyx_t_2, __pyx_v_self->__pyx_base.queue, __pyx_t_3}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 510, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } else + #endif + { + __pyx_t_7 = PyTuple_New(3+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 510, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + if (__pyx_t_5) { + __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL; + } + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_t_2); + __Pyx_INCREF(__pyx_v_self->__pyx_base.queue); + __Pyx_GIVEREF(__pyx_v_self->__pyx_base.queue); + PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_self->__pyx_base.queue); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_6, __pyx_t_3); + __pyx_t_2 = 0; + __pyx_t_3 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 510, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "src/gevent/queue.py":509 + * self._cond.clear() + * + * def copy(self): # <<<<<<<<<<<<<< + * return type(self)(self.maxsize, self.queue, self.unfinished_tasks) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("gevent._queue.JoinableQueue.copy", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/queue.py":512 + * return type(self)(self.maxsize, self.queue, self.unfinished_tasks) + * + * def _format(self): # <<<<<<<<<<<<<< + * result = Queue._format(self) + * if self.unfinished_tasks: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_queue_13JoinableQueue_5_format(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6gevent_6_queue_13JoinableQueue_4_format[] = "JoinableQueue._format(self)"; +static PyMethodDef __pyx_mdef_6gevent_6_queue_13JoinableQueue_5_format = {"_format", (PyCFunction)__pyx_pw_6gevent_6_queue_13JoinableQueue_5_format, METH_NOARGS, __pyx_doc_6gevent_6_queue_13JoinableQueue_4_format}; +static PyObject *__pyx_pw_6gevent_6_queue_13JoinableQueue_5_format(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_format (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6_queue_13JoinableQueue_4_format(((struct __pyx_obj_6gevent_6_queue_JoinableQueue *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_queue_13JoinableQueue_4_format(struct __pyx_obj_6gevent_6_queue_JoinableQueue *__pyx_v_self) { + PyObject *__pyx_v_result = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + __Pyx_RefNannySetupContext("_format", 0); + + /* "src/gevent/queue.py":513 + * + * def _format(self): + * result = Queue._format(self) # <<<<<<<<<<<<<< + * if self.unfinished_tasks: + * result += ' tasks=%s _cond=%s' % (self.unfinished_tasks, self._cond) + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_6gevent_6_queue_Queue), __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 513, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, ((PyObject *)__pyx_v_self)) : __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_v_self)); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 513, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_result = __pyx_t_1; + __pyx_t_1 = 0; + + /* "src/gevent/queue.py":514 + * def _format(self): + * result = Queue._format(self) + * if self.unfinished_tasks: # <<<<<<<<<<<<<< + * result += ' tasks=%s _cond=%s' % (self.unfinished_tasks, self._cond) + * return result + */ + __pyx_t_4 = (__pyx_v_self->unfinished_tasks != 0); + if (__pyx_t_4) { + + /* "src/gevent/queue.py":515 + * result = Queue._format(self) + * if self.unfinished_tasks: + * result += ' tasks=%s _cond=%s' % (self.unfinished_tasks, self._cond) # <<<<<<<<<<<<<< + * return result + * + */ + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->unfinished_tasks); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 515, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 515, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_self->_cond)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self->_cond)); + PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_self->_cond)); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_tasks_s__cond_s, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 515, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 515, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_2); + __pyx_t_2 = 0; + + /* "src/gevent/queue.py":514 + * def _format(self): + * result = Queue._format(self) + * if self.unfinished_tasks: # <<<<<<<<<<<<<< + * result += ' tasks=%s _cond=%s' % (self.unfinished_tasks, self._cond) + * return result + */ + } + + /* "src/gevent/queue.py":516 + * if self.unfinished_tasks: + * result += ' tasks=%s _cond=%s' % (self.unfinished_tasks, self._cond) + * return result # <<<<<<<<<<<<<< + * + * def _put(self, item): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; + goto __pyx_L0; + + /* "src/gevent/queue.py":512 + * return type(self)(self.maxsize, self.queue, self.unfinished_tasks) + * + * def _format(self): # <<<<<<<<<<<<<< + * result = Queue._format(self) + * if self.unfinished_tasks: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("gevent._queue.JoinableQueue._format", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/queue.py":518 + * return result + * + * def _put(self, item): # <<<<<<<<<<<<<< + * Queue._put(self, item) + * self.unfinished_tasks += 1 + */ + +static PyObject *__pyx_pw_6gevent_6_queue_13JoinableQueue_7_put(PyObject *__pyx_v_self, PyObject *__pyx_v_item); /*proto*/ +static PyObject *__pyx_f_6gevent_6_queue_13JoinableQueue__put(struct __pyx_obj_6gevent_6_queue_JoinableQueue *__pyx_v_self, PyObject *__pyx_v_item, int __pyx_skip_dispatch) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + __Pyx_RefNannySetupContext("_put", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0; + if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self)))))); + else { + PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + #endif + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_put); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 518, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_6_queue_13JoinableQueue_7_put)) { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_item) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_item); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 518, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0; + if (unlikely(type_dict_guard != tp_dict_version)) { + tp_dict_version = obj_dict_version = 0; + } + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + } + #endif + } + + /* "src/gevent/queue.py":519 + * + * def _put(self, item): + * Queue._put(self, item) # <<<<<<<<<<<<<< + * self.unfinished_tasks += 1 + * self._cond.clear() + */ + __pyx_t_1 = __pyx_f_6gevent_6_queue_5Queue__put(((struct __pyx_obj_6gevent_6_queue_Queue *)__pyx_v_self), __pyx_v_item, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 519, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/queue.py":520 + * def _put(self, item): + * Queue._put(self, item) + * self.unfinished_tasks += 1 # <<<<<<<<<<<<<< + * self._cond.clear() + * + */ + __pyx_v_self->unfinished_tasks = (__pyx_v_self->unfinished_tasks + 1); + + /* "src/gevent/queue.py":521 + * Queue._put(self, item) + * self.unfinished_tasks += 1 + * self._cond.clear() # <<<<<<<<<<<<<< + * + * def task_done(self): + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->_cond), __pyx_n_s_clear); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 521, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 521, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/queue.py":518 + * return result + * + * def _put(self, item): # <<<<<<<<<<<<<< + * Queue._put(self, item) + * self.unfinished_tasks += 1 + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("gevent._queue.JoinableQueue._put", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_queue_13JoinableQueue_7_put(PyObject *__pyx_v_self, PyObject *__pyx_v_item); /*proto*/ +static char __pyx_doc_6gevent_6_queue_13JoinableQueue_6_put[] = "JoinableQueue._put(self, item)"; +static PyMethodDef __pyx_mdef_6gevent_6_queue_13JoinableQueue_7_put = {"_put", (PyCFunction)__pyx_pw_6gevent_6_queue_13JoinableQueue_7_put, METH_O, __pyx_doc_6gevent_6_queue_13JoinableQueue_6_put}; +static PyObject *__pyx_pw_6gevent_6_queue_13JoinableQueue_7_put(PyObject *__pyx_v_self, PyObject *__pyx_v_item) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_put (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6_queue_13JoinableQueue_6_put(((struct __pyx_obj_6gevent_6_queue_JoinableQueue *)__pyx_v_self), ((PyObject *)__pyx_v_item)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_queue_13JoinableQueue_6_put(struct __pyx_obj_6gevent_6_queue_JoinableQueue *__pyx_v_self, PyObject *__pyx_v_item) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("_put", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6gevent_6_queue_13JoinableQueue__put(__pyx_v_self, __pyx_v_item, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 518, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent._queue.JoinableQueue._put", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/queue.py":523 + * self._cond.clear() + * + * def task_done(self): # <<<<<<<<<<<<<< + * '''Indicate that a formerly enqueued task is complete. Used by queue consumer threads. + * For each :meth:`get ` used to fetch a task, a subsequent call to :meth:`task_done` tells the queue + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_queue_13JoinableQueue_9task_done(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6gevent_6_queue_13JoinableQueue_8task_done[] = "JoinableQueue.task_done(self)\nIndicate that a formerly enqueued task is complete. Used by queue consumer threads.\n For each :meth:`get ` used to fetch a task, a subsequent call to :meth:`task_done` tells the queue\n that the processing on the task is complete.\n\n If a :meth:`join` is currently blocking, it will resume when all items have been processed\n (meaning that a :meth:`task_done` call was received for every item that had been\n :meth:`put ` into the queue).\n\n Raises a :exc:`ValueError` if called more times than there were items placed in the queue.\n "; +static PyMethodDef __pyx_mdef_6gevent_6_queue_13JoinableQueue_9task_done = {"task_done", (PyCFunction)__pyx_pw_6gevent_6_queue_13JoinableQueue_9task_done, METH_NOARGS, __pyx_doc_6gevent_6_queue_13JoinableQueue_8task_done}; +static PyObject *__pyx_pw_6gevent_6_queue_13JoinableQueue_9task_done(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("task_done (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6_queue_13JoinableQueue_8task_done(((struct __pyx_obj_6gevent_6_queue_JoinableQueue *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_queue_13JoinableQueue_8task_done(struct __pyx_obj_6gevent_6_queue_JoinableQueue *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + __Pyx_RefNannySetupContext("task_done", 0); + + /* "src/gevent/queue.py":534 + * Raises a :exc:`ValueError` if called more times than there were items placed in the queue. + * ''' + * if self.unfinished_tasks <= 0: # <<<<<<<<<<<<<< + * raise ValueError('task_done() called too many times') + * self.unfinished_tasks -= 1 + */ + __pyx_t_1 = ((__pyx_v_self->unfinished_tasks <= 0) != 0); + if (unlikely(__pyx_t_1)) { + + /* "src/gevent/queue.py":535 + * ''' + * if self.unfinished_tasks <= 0: + * raise ValueError('task_done() called too many times') # <<<<<<<<<<<<<< + * self.unfinished_tasks -= 1 + * if self.unfinished_tasks == 0: + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 535, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 535, __pyx_L1_error) + + /* "src/gevent/queue.py":534 + * Raises a :exc:`ValueError` if called more times than there were items placed in the queue. + * ''' + * if self.unfinished_tasks <= 0: # <<<<<<<<<<<<<< + * raise ValueError('task_done() called too many times') + * self.unfinished_tasks -= 1 + */ + } + + /* "src/gevent/queue.py":536 + * if self.unfinished_tasks <= 0: + * raise ValueError('task_done() called too many times') + * self.unfinished_tasks -= 1 # <<<<<<<<<<<<<< + * if self.unfinished_tasks == 0: + * self._cond.set() + */ + __pyx_v_self->unfinished_tasks = (__pyx_v_self->unfinished_tasks - 1); + + /* "src/gevent/queue.py":537 + * raise ValueError('task_done() called too many times') + * self.unfinished_tasks -= 1 + * if self.unfinished_tasks == 0: # <<<<<<<<<<<<<< + * self._cond.set() + * + */ + __pyx_t_1 = ((__pyx_v_self->unfinished_tasks == 0) != 0); + if (__pyx_t_1) { + + /* "src/gevent/queue.py":538 + * self.unfinished_tasks -= 1 + * if self.unfinished_tasks == 0: + * self._cond.set() # <<<<<<<<<<<<<< + * + * def join(self, timeout=None): + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->_cond), __pyx_n_s_set); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 538, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 538, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/queue.py":537 + * raise ValueError('task_done() called too many times') + * self.unfinished_tasks -= 1 + * if self.unfinished_tasks == 0: # <<<<<<<<<<<<<< + * self._cond.set() + * + */ + } + + /* "src/gevent/queue.py":523 + * self._cond.clear() + * + * def task_done(self): # <<<<<<<<<<<<<< + * '''Indicate that a formerly enqueued task is complete. Used by queue consumer threads. + * For each :meth:`get ` used to fetch a task, a subsequent call to :meth:`task_done` tells the queue + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("gevent._queue.JoinableQueue.task_done", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/queue.py":540 + * self._cond.set() + * + * def join(self, timeout=None): # <<<<<<<<<<<<<< + * ''' + * Block until all items in the queue have been gotten and processed. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_queue_13JoinableQueue_11join(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6gevent_6_queue_13JoinableQueue_10join[] = "JoinableQueue.join(self, timeout=None)\n\n Block until all items in the queue have been gotten and processed.\n\n The count of unfinished tasks goes up whenever an item is added to the queue.\n The count goes down whenever a consumer thread calls :meth:`task_done` to indicate\n that the item was retrieved and all work on it is complete. When the count of\n unfinished tasks drops to zero, :meth:`join` unblocks.\n\n :param float timeout: If not ``None``, then wait no more than this time in seconds\n for all tasks to finish.\n :return: ``True`` if all tasks have finished; if ``timeout`` was given and expired before\n all tasks finished, ``False``.\n\n .. versionchanged:: 1.1a1\n Add the *timeout* parameter.\n "; +static PyMethodDef __pyx_mdef_6gevent_6_queue_13JoinableQueue_11join = {"join", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_6_queue_13JoinableQueue_11join, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_6_queue_13JoinableQueue_10join}; +static PyObject *__pyx_pw_6gevent_6_queue_13JoinableQueue_11join(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_timeout = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("join (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_timeout,0}; + PyObject* values[1] = {0}; + values[0] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_timeout); + if (value) { values[0] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "join") < 0)) __PYX_ERR(0, 540, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_timeout = values[0]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("join", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 540, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent._queue.JoinableQueue.join", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_6_queue_13JoinableQueue_10join(((struct __pyx_obj_6gevent_6_queue_JoinableQueue *)__pyx_v_self), __pyx_v_timeout); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_queue_13JoinableQueue_10join(struct __pyx_obj_6gevent_6_queue_JoinableQueue *__pyx_v_self, PyObject *__pyx_v_timeout) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("join", 0); + + /* "src/gevent/queue.py":557 + * Add the *timeout* parameter. + * ''' + * return self._cond.wait(timeout=timeout) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->_cond), __pyx_n_s_wait); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 557, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 557, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_timeout, __pyx_v_timeout) < 0) __PYX_ERR(0, 557, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 557, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "src/gevent/queue.py":540 + * self._cond.set() + * + * def join(self, timeout=None): # <<<<<<<<<<<<<< + * ''' + * Block until all items in the queue have been gotten and processed. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("gevent._queue.JoinableQueue.join", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/_queue.pxd":61 + * cdef class JoinableQueue(Queue): + * cdef Event _cond + * cdef readonly int unfinished_tasks # <<<<<<<<<<<<<< + * + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_queue_13JoinableQueue_16unfinished_tasks_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_6_queue_13JoinableQueue_16unfinished_tasks_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6_queue_13JoinableQueue_16unfinished_tasks___get__(((struct __pyx_obj_6gevent_6_queue_JoinableQueue *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_queue_13JoinableQueue_16unfinished_tasks___get__(struct __pyx_obj_6gevent_6_queue_JoinableQueue *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->unfinished_tasks); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 61, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent._queue.JoinableQueue.unfinished_tasks.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/queue.py":570 + * ) + * + * def __init__(self, maxsize=1): # <<<<<<<<<<<<<< + * # We take maxsize to simplify certain kinds of code + * if maxsize != 1: + */ + +/* Python wrapper */ +static int __pyx_pw_6gevent_6_queue_7Channel_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6gevent_6_queue_7Channel_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_maxsize = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_maxsize,0}; + PyObject* values[1] = {0}; + values[0] = ((PyObject *)__pyx_int_1); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_maxsize); + if (value) { values[0] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 570, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_maxsize = values[0]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 570, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent._queue.Channel.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_6_queue_7Channel___init__(((struct __pyx_obj_6gevent_6_queue_Channel *)__pyx_v_self), __pyx_v_maxsize); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_6_queue_7Channel___init__(struct __pyx_obj_6gevent_6_queue_Channel *__pyx_v_self, PyObject *__pyx_v_maxsize) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "src/gevent/queue.py":572 + * def __init__(self, maxsize=1): + * # We take maxsize to simplify certain kinds of code + * if maxsize != 1: # <<<<<<<<<<<<<< + * raise ValueError("Channels have a maxsize of 1") + * self.getters = collections.deque() + */ + __pyx_t_1 = __Pyx_PyInt_NeObjC(__pyx_v_maxsize, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 572, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 572, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(__pyx_t_2)) { + + /* "src/gevent/queue.py":573 + * # We take maxsize to simplify certain kinds of code + * if maxsize != 1: + * raise ValueError("Channels have a maxsize of 1") # <<<<<<<<<<<<<< + * self.getters = collections.deque() + * self.putters = collections.deque() + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 573, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 573, __pyx_L1_error) + + /* "src/gevent/queue.py":572 + * def __init__(self, maxsize=1): + * # We take maxsize to simplify certain kinds of code + * if maxsize != 1: # <<<<<<<<<<<<<< + * raise ValueError("Channels have a maxsize of 1") + * self.getters = collections.deque() + */ + } + + /* "src/gevent/queue.py":574 + * if maxsize != 1: + * raise ValueError("Channels have a maxsize of 1") + * self.getters = collections.deque() # <<<<<<<<<<<<<< + * self.putters = collections.deque() + * self.hub = get_hub() + */ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_collections); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 574, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_deque); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 574, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + } + } + __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 574, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_self->getters); + __Pyx_DECREF(__pyx_v_self->getters); + __pyx_v_self->getters = __pyx_t_1; + __pyx_t_1 = 0; + + /* "src/gevent/queue.py":575 + * raise ValueError("Channels have a maxsize of 1") + * self.getters = collections.deque() + * self.putters = collections.deque() # <<<<<<<<<<<<<< + * self.hub = get_hub() + * self._event_unlock = None + */ + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_collections); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 575, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_deque); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 575, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 575, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_self->putters); + __Pyx_DECREF(__pyx_v_self->putters); + __pyx_v_self->putters = __pyx_t_1; + __pyx_t_1 = 0; + + /* "src/gevent/queue.py":576 + * self.getters = collections.deque() + * self.putters = collections.deque() + * self.hub = get_hub() # <<<<<<<<<<<<<< + * self._event_unlock = None + * + */ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_get_hub); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 576, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 576, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_self->hub); + __Pyx_DECREF(__pyx_v_self->hub); + __pyx_v_self->hub = __pyx_t_1; + __pyx_t_1 = 0; + + /* "src/gevent/queue.py":577 + * self.putters = collections.deque() + * self.hub = get_hub() + * self._event_unlock = None # <<<<<<<<<<<<<< + * + * def __repr__(self): + */ + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->_event_unlock); + __Pyx_DECREF(__pyx_v_self->_event_unlock); + __pyx_v_self->_event_unlock = Py_None; + + /* "src/gevent/queue.py":570 + * ) + * + * def __init__(self, maxsize=1): # <<<<<<<<<<<<<< + * # We take maxsize to simplify certain kinds of code + * if maxsize != 1: + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("gevent._queue.Channel.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/queue.py":579 + * self._event_unlock = None + * + * def __repr__(self): # <<<<<<<<<<<<<< + * return '<%s at %s %s>' % (type(self).__name__, hex(id(self)), self._format()) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_queue_7Channel_3__repr__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_6_queue_7Channel_3__repr__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6_queue_7Channel_2__repr__(((struct __pyx_obj_6gevent_6_queue_Channel *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_queue_7Channel_2__repr__(struct __pyx_obj_6gevent_6_queue_Channel *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + __Pyx_RefNannySetupContext("__repr__", 0); + + /* "src/gevent/queue.py":580 + * + * def __repr__(self): + * return '<%s at %s %s>' % (type(self).__name__, hex(id(self)), self._format()) # <<<<<<<<<<<<<< + * + * def __str__(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))), __pyx_n_s_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 580, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 580, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_hex, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 580, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 580, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + } + } + __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 580, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 580, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_2); + __pyx_t_1 = 0; + __pyx_t_3 = 0; + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_s_at_s_s_2, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 580, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "src/gevent/queue.py":579 + * self._event_unlock = None + * + * def __repr__(self): # <<<<<<<<<<<<<< + * return '<%s at %s %s>' % (type(self).__name__, hex(id(self)), self._format()) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("gevent._queue.Channel.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/queue.py":582 + * return '<%s at %s %s>' % (type(self).__name__, hex(id(self)), self._format()) + * + * def __str__(self): # <<<<<<<<<<<<<< + * return '<%s %s>' % (type(self).__name__, self._format()) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_queue_7Channel_5__str__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_6_queue_7Channel_5__str__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__str__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6_queue_7Channel_4__str__(((struct __pyx_obj_6gevent_6_queue_Channel *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_queue_7Channel_4__str__(struct __pyx_obj_6gevent_6_queue_Channel *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + __Pyx_RefNannySetupContext("__str__", 0); + + /* "src/gevent/queue.py":583 + * + * def __str__(self): + * return '<%s %s>' % (type(self).__name__, self._format()) # <<<<<<<<<<<<<< + * + * def _format(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))), __pyx_n_s_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 583, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 583, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 583, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 583, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); + __pyx_t_1 = 0; + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_s_s_2, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 583, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "src/gevent/queue.py":582 + * return '<%s at %s %s>' % (type(self).__name__, hex(id(self)), self._format()) + * + * def __str__(self): # <<<<<<<<<<<<<< + * return '<%s %s>' % (type(self).__name__, self._format()) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("gevent._queue.Channel.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/queue.py":585 + * return '<%s %s>' % (type(self).__name__, self._format()) + * + * def _format(self): # <<<<<<<<<<<<<< + * result = '' + * if self.getters: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_queue_7Channel_7_format(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6gevent_6_queue_7Channel_6_format[] = "Channel._format(self)"; +static PyMethodDef __pyx_mdef_6gevent_6_queue_7Channel_7_format = {"_format", (PyCFunction)__pyx_pw_6gevent_6_queue_7Channel_7_format, METH_NOARGS, __pyx_doc_6gevent_6_queue_7Channel_6_format}; +static PyObject *__pyx_pw_6gevent_6_queue_7Channel_7_format(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_format (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6_queue_7Channel_6_format(((struct __pyx_obj_6gevent_6_queue_Channel *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_queue_7Channel_6_format(struct __pyx_obj_6gevent_6_queue_Channel *__pyx_v_self) { + PyObject *__pyx_v_result = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + __Pyx_RefNannySetupContext("_format", 0); + + /* "src/gevent/queue.py":586 + * + * def _format(self): + * result = '' # <<<<<<<<<<<<<< + * if self.getters: + * result += ' getters[%s]' % len(self.getters) + */ + __Pyx_INCREF(__pyx_kp_s__3); + __pyx_v_result = __pyx_kp_s__3; + + /* "src/gevent/queue.py":587 + * def _format(self): + * result = '' + * if self.getters: # <<<<<<<<<<<<<< + * result += ' getters[%s]' % len(self.getters) + * if self.putters: + */ + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_self->getters); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 587, __pyx_L1_error) + if (__pyx_t_1) { + + /* "src/gevent/queue.py":588 + * result = '' + * if self.getters: + * result += ' getters[%s]' % len(self.getters) # <<<<<<<<<<<<<< + * if self.putters: + * result += ' putters[%s]' % len(self.putters) + */ + __pyx_t_2 = __pyx_v_self->getters; + __Pyx_INCREF(__pyx_t_2); + __pyx_t_3 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 588, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 588, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_getters_s_2, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 588, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 588, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (!(likely(PyString_CheckExact(__pyx_t_2))||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(0, 588, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "src/gevent/queue.py":587 + * def _format(self): + * result = '' + * if self.getters: # <<<<<<<<<<<<<< + * result += ' getters[%s]' % len(self.getters) + * if self.putters: + */ + } + + /* "src/gevent/queue.py":589 + * if self.getters: + * result += ' getters[%s]' % len(self.getters) + * if self.putters: # <<<<<<<<<<<<<< + * result += ' putters[%s]' % len(self.putters) + * return result + */ + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_self->putters); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 589, __pyx_L1_error) + if (__pyx_t_1) { + + /* "src/gevent/queue.py":590 + * result += ' getters[%s]' % len(self.getters) + * if self.putters: + * result += ' putters[%s]' % len(self.putters) # <<<<<<<<<<<<<< + * return result + * + */ + __pyx_t_2 = __pyx_v_self->putters; + __Pyx_INCREF(__pyx_t_2); + __pyx_t_3 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 590, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 590, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_putters_s_2, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 590, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 590, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (!(likely(PyString_CheckExact(__pyx_t_2))||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(0, 590, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "src/gevent/queue.py":589 + * if self.getters: + * result += ' getters[%s]' % len(self.getters) + * if self.putters: # <<<<<<<<<<<<<< + * result += ' putters[%s]' % len(self.putters) + * return result + */ + } + + /* "src/gevent/queue.py":591 + * if self.putters: + * result += ' putters[%s]' % len(self.putters) + * return result # <<<<<<<<<<<<<< + * + * @property + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; + goto __pyx_L0; + + /* "src/gevent/queue.py":585 + * return '<%s %s>' % (type(self).__name__, self._format()) + * + * def _format(self): # <<<<<<<<<<<<<< + * result = '' + * if self.getters: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("gevent._queue.Channel._format", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/queue.py":594 + * + * @property + * def balance(self): # <<<<<<<<<<<<<< + * return len(self.putters) - len(self.getters) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_queue_7Channel_7balance_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_6_queue_7Channel_7balance_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6_queue_7Channel_7balance___get__(((struct __pyx_obj_6gevent_6_queue_Channel *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_queue_7Channel_7balance___get__(struct __pyx_obj_6gevent_6_queue_Channel *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + Py_ssize_t __pyx_t_3; + __Pyx_RefNannySetupContext("__get__", 0); + + /* "src/gevent/queue.py":595 + * @property + * def balance(self): + * return len(self.putters) - len(self.getters) # <<<<<<<<<<<<<< + * + * def qsize(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_v_self->putters; + __Pyx_INCREF(__pyx_t_1); + __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 595, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __pyx_v_self->getters; + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 595, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyInt_FromSsize_t((__pyx_t_2 - __pyx_t_3)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 595, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "src/gevent/queue.py":594 + * + * @property + * def balance(self): # <<<<<<<<<<<<<< + * return len(self.putters) - len(self.getters) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent._queue.Channel.balance.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/queue.py":597 + * return len(self.putters) - len(self.getters) + * + * def qsize(self): # <<<<<<<<<<<<<< + * return 0 + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_queue_7Channel_9qsize(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6gevent_6_queue_7Channel_8qsize[] = "Channel.qsize(self)"; +static PyMethodDef __pyx_mdef_6gevent_6_queue_7Channel_9qsize = {"qsize", (PyCFunction)__pyx_pw_6gevent_6_queue_7Channel_9qsize, METH_NOARGS, __pyx_doc_6gevent_6_queue_7Channel_8qsize}; +static PyObject *__pyx_pw_6gevent_6_queue_7Channel_9qsize(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("qsize (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6_queue_7Channel_8qsize(((struct __pyx_obj_6gevent_6_queue_Channel *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_queue_7Channel_8qsize(CYTHON_UNUSED struct __pyx_obj_6gevent_6_queue_Channel *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("qsize", 0); + + /* "src/gevent/queue.py":598 + * + * def qsize(self): + * return 0 # <<<<<<<<<<<<<< + * + * def empty(self): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_int_0); + __pyx_r = __pyx_int_0; + goto __pyx_L0; + + /* "src/gevent/queue.py":597 + * return len(self.putters) - len(self.getters) + * + * def qsize(self): # <<<<<<<<<<<<<< + * return 0 + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/queue.py":600 + * return 0 + * + * def empty(self): # <<<<<<<<<<<<<< + * return True + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_queue_7Channel_11empty(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6gevent_6_queue_7Channel_10empty[] = "Channel.empty(self)"; +static PyMethodDef __pyx_mdef_6gevent_6_queue_7Channel_11empty = {"empty", (PyCFunction)__pyx_pw_6gevent_6_queue_7Channel_11empty, METH_NOARGS, __pyx_doc_6gevent_6_queue_7Channel_10empty}; +static PyObject *__pyx_pw_6gevent_6_queue_7Channel_11empty(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("empty (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6_queue_7Channel_10empty(((struct __pyx_obj_6gevent_6_queue_Channel *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_queue_7Channel_10empty(CYTHON_UNUSED struct __pyx_obj_6gevent_6_queue_Channel *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("empty", 0); + + /* "src/gevent/queue.py":601 + * + * def empty(self): + * return True # <<<<<<<<<<<<<< + * + * def full(self): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; + goto __pyx_L0; + + /* "src/gevent/queue.py":600 + * return 0 + * + * def empty(self): # <<<<<<<<<<<<<< + * return True + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/queue.py":603 + * return True + * + * def full(self): # <<<<<<<<<<<<<< + * return True + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_queue_7Channel_13full(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6gevent_6_queue_7Channel_12full[] = "Channel.full(self)"; +static PyMethodDef __pyx_mdef_6gevent_6_queue_7Channel_13full = {"full", (PyCFunction)__pyx_pw_6gevent_6_queue_7Channel_13full, METH_NOARGS, __pyx_doc_6gevent_6_queue_7Channel_12full}; +static PyObject *__pyx_pw_6gevent_6_queue_7Channel_13full(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("full (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6_queue_7Channel_12full(((struct __pyx_obj_6gevent_6_queue_Channel *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_queue_7Channel_12full(CYTHON_UNUSED struct __pyx_obj_6gevent_6_queue_Channel *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("full", 0); + + /* "src/gevent/queue.py":604 + * + * def full(self): + * return True # <<<<<<<<<<<<<< + * + * def put(self, item, block=True, timeout=None): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; + goto __pyx_L0; + + /* "src/gevent/queue.py":603 + * return True + * + * def full(self): # <<<<<<<<<<<<<< + * return True + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/queue.py":606 + * return True + * + * def put(self, item, block=True, timeout=None): # <<<<<<<<<<<<<< + * if self.hub is getcurrent(): + * if self.getters: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_queue_7Channel_15put(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6gevent_6_queue_7Channel_14put[] = "Channel.put(self, item, block=True, timeout=None)"; +static PyMethodDef __pyx_mdef_6gevent_6_queue_7Channel_15put = {"put", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_6_queue_7Channel_15put, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_6_queue_7Channel_14put}; +static PyObject *__pyx_pw_6gevent_6_queue_7Channel_15put(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_item = 0; + PyObject *__pyx_v_block = 0; + PyObject *__pyx_v_timeout = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("put (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_item,&__pyx_n_s_block,&__pyx_n_s_timeout,0}; + PyObject* values[3] = {0,0,0}; + values[1] = ((PyObject *)Py_True); + values[2] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_item)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_block); + if (value) { values[1] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 2: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_timeout); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "put") < 0)) __PYX_ERR(0, 606, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_item = values[0]; + __pyx_v_block = values[1]; + __pyx_v_timeout = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("put", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 606, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent._queue.Channel.put", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_6_queue_7Channel_14put(((struct __pyx_obj_6gevent_6_queue_Channel *)__pyx_v_self), __pyx_v_item, __pyx_v_block, __pyx_v_timeout); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_queue_7Channel_14put(struct __pyx_obj_6gevent_6_queue_Channel *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_block, PyObject *__pyx_v_timeout) { + PyObject *__pyx_v_getter = NULL; + struct __pyx_obj_6gevent_8__waiter_Waiter *__pyx_v_waiter = NULL; + PyObject *__pyx_v_result = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_t_5; + int __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + int __pyx_t_13; + char const *__pyx_t_14; + PyObject *__pyx_t_15 = NULL; + PyObject *__pyx_t_16 = NULL; + PyObject *__pyx_t_17 = NULL; + __Pyx_RefNannySetupContext("put", 0); + __Pyx_INCREF(__pyx_v_item); + __Pyx_INCREF(__pyx_v_timeout); + + /* "src/gevent/queue.py":607 + * + * def put(self, item, block=True, timeout=None): + * if self.hub is getcurrent(): # <<<<<<<<<<<<<< + * if self.getters: + * getter = self.getters.popleft() + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_getcurrent); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 607, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 607, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_4 = (__pyx_v_self->hub == __pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_5 = (__pyx_t_4 != 0); + if (__pyx_t_5) { + + /* "src/gevent/queue.py":608 + * def put(self, item, block=True, timeout=None): + * if self.hub is getcurrent(): + * if self.getters: # <<<<<<<<<<<<<< + * getter = self.getters.popleft() + * getter.switch(item) + */ + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_self->getters); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 608, __pyx_L1_error) + if (__pyx_t_5) { + + /* "src/gevent/queue.py":609 + * if self.hub is getcurrent(): + * if self.getters: + * getter = self.getters.popleft() # <<<<<<<<<<<<<< + * getter.switch(item) + * return + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->getters, __pyx_n_s_popleft); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 609, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 609, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_getter = __pyx_t_1; + __pyx_t_1 = 0; + + /* "src/gevent/queue.py":610 + * if self.getters: + * getter = self.getters.popleft() + * getter.switch(item) # <<<<<<<<<<<<<< + * return + * raise Full + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_getter, __pyx_n_s_switch); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 610, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_item) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_item); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 610, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/queue.py":611 + * getter = self.getters.popleft() + * getter.switch(item) + * return # <<<<<<<<<<<<<< + * raise Full + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + + /* "src/gevent/queue.py":608 + * def put(self, item, block=True, timeout=None): + * if self.hub is getcurrent(): + * if self.getters: # <<<<<<<<<<<<<< + * getter = self.getters.popleft() + * getter.switch(item) + */ + } + + /* "src/gevent/queue.py":612 + * getter.switch(item) + * return + * raise Full # <<<<<<<<<<<<<< + * + * if not block: + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Full); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 612, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 612, __pyx_L1_error) + + /* "src/gevent/queue.py":607 + * + * def put(self, item, block=True, timeout=None): + * if self.hub is getcurrent(): # <<<<<<<<<<<<<< + * if self.getters: + * getter = self.getters.popleft() + */ + } + + /* "src/gevent/queue.py":614 + * raise Full + * + * if not block: # <<<<<<<<<<<<<< + * timeout = 0 + * + */ + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_block); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 614, __pyx_L1_error) + __pyx_t_4 = ((!__pyx_t_5) != 0); + if (__pyx_t_4) { + + /* "src/gevent/queue.py":615 + * + * if not block: + * timeout = 0 # <<<<<<<<<<<<<< + * + * waiter = Waiter() # pylint:disable=undefined-variable + */ + __Pyx_INCREF(__pyx_int_0); + __Pyx_DECREF_SET(__pyx_v_timeout, __pyx_int_0); + + /* "src/gevent/queue.py":614 + * raise Full + * + * if not block: # <<<<<<<<<<<<<< + * timeout = 0 + * + */ + } + + /* "src/gevent/queue.py":617 + * timeout = 0 + * + * waiter = Waiter() # pylint:disable=undefined-variable # <<<<<<<<<<<<<< + * item = (item, waiter) + * self.putters.append(item) + */ + __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_6gevent_8__waiter_Waiter)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 617, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_waiter = ((struct __pyx_obj_6gevent_8__waiter_Waiter *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "src/gevent/queue.py":618 + * + * waiter = Waiter() # pylint:disable=undefined-variable + * item = (item, waiter) # <<<<<<<<<<<<<< + * self.putters.append(item) + * timeout = Timeout._start_new_or_dummy(timeout, Full) + */ + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 618, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_item); + __Pyx_GIVEREF(__pyx_v_item); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_item); + __Pyx_INCREF(((PyObject *)__pyx_v_waiter)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_waiter)); + PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_waiter)); + __Pyx_DECREF_SET(__pyx_v_item, __pyx_t_1); + __pyx_t_1 = 0; + + /* "src/gevent/queue.py":619 + * waiter = Waiter() # pylint:disable=undefined-variable + * item = (item, waiter) + * self.putters.append(item) # <<<<<<<<<<<<<< + * timeout = Timeout._start_new_or_dummy(timeout, Full) + * try: + */ + __pyx_t_6 = __Pyx_PyObject_Append(__pyx_v_self->putters, __pyx_v_item); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 619, __pyx_L1_error) + + /* "src/gevent/queue.py":620 + * item = (item, waiter) + * self.putters.append(item) + * timeout = Timeout._start_new_or_dummy(timeout, Full) # <<<<<<<<<<<<<< + * try: + * if self.getters: + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Timeout); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 620, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_start_new_or_dummy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 620, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Full); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 620, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_7 = NULL; + __pyx_t_8 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_7)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_7); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_8 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_3)) { + PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_v_timeout, __pyx_t_2}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 620, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { + PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_v_timeout, __pyx_t_2}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 620, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } else + #endif + { + __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 620, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + if (__pyx_t_7) { + __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL; + } + __Pyx_INCREF(__pyx_v_timeout); + __Pyx_GIVEREF(__pyx_v_timeout); + PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_v_timeout); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 620, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF_SET(__pyx_v_timeout, __pyx_t_1); + __pyx_t_1 = 0; + + /* "src/gevent/queue.py":621 + * self.putters.append(item) + * timeout = Timeout._start_new_or_dummy(timeout, Full) + * try: # <<<<<<<<<<<<<< + * if self.getters: + * self._schedule_unlock() + */ + /*try:*/ { + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12); + __Pyx_XGOTREF(__pyx_t_10); + __Pyx_XGOTREF(__pyx_t_11); + __Pyx_XGOTREF(__pyx_t_12); + /*try:*/ { + + /* "src/gevent/queue.py":622 + * timeout = Timeout._start_new_or_dummy(timeout, Full) + * try: + * if self.getters: # <<<<<<<<<<<<<< + * self._schedule_unlock() + * result = waiter.get() + */ + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_self->getters); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 622, __pyx_L9_error) + if (__pyx_t_4) { + + /* "src/gevent/queue.py":623 + * try: + * if self.getters: + * self._schedule_unlock() # <<<<<<<<<<<<<< + * result = waiter.get() + * if result is not waiter: + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_6_queue_Channel *)__pyx_v_self->__pyx_vtab)->_schedule_unlock(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 623, __pyx_L9_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/queue.py":622 + * timeout = Timeout._start_new_or_dummy(timeout, Full) + * try: + * if self.getters: # <<<<<<<<<<<<<< + * self._schedule_unlock() + * result = waiter.get() + */ + } + + /* "src/gevent/queue.py":624 + * if self.getters: + * self._schedule_unlock() + * result = waiter.get() # <<<<<<<<<<<<<< + * if result is not waiter: + * raise InvalidSwitchError("Invalid switch into Channel.put: %r" % (result, )) + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_8__waiter_Waiter *)__pyx_v_waiter->__pyx_vtab)->get(__pyx_v_waiter, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 624, __pyx_L9_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_result = __pyx_t_1; + __pyx_t_1 = 0; + + /* "src/gevent/queue.py":625 + * self._schedule_unlock() + * result = waiter.get() + * if result is not waiter: # <<<<<<<<<<<<<< + * raise InvalidSwitchError("Invalid switch into Channel.put: %r" % (result, )) + * except: + */ + __pyx_t_4 = (__pyx_v_result != ((PyObject *)__pyx_v_waiter)); + __pyx_t_5 = (__pyx_t_4 != 0); + if (unlikely(__pyx_t_5)) { + + /* "src/gevent/queue.py":626 + * result = waiter.get() + * if result is not waiter: + * raise InvalidSwitchError("Invalid switch into Channel.put: %r" % (result, )) # <<<<<<<<<<<<<< + * except: + * _safe_remove(self.putters, item) + */ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_InvalidSwitchError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 626, __pyx_L9_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 626, __pyx_L9_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_INCREF(__pyx_v_result); + __Pyx_GIVEREF(__pyx_v_result); + PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_result); + __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_switch_into_Channel_put, __pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 626, __pyx_L9_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_9)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_9); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_1 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_9, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 626, __pyx_L9_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 626, __pyx_L9_error) + + /* "src/gevent/queue.py":625 + * self._schedule_unlock() + * result = waiter.get() + * if result is not waiter: # <<<<<<<<<<<<<< + * raise InvalidSwitchError("Invalid switch into Channel.put: %r" % (result, )) + * except: + */ + } + + /* "src/gevent/queue.py":621 + * self.putters.append(item) + * timeout = Timeout._start_new_or_dummy(timeout, Full) + * try: # <<<<<<<<<<<<<< + * if self.getters: + * self._schedule_unlock() + */ + } + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; + goto __pyx_L14_try_end; + __pyx_L9_error:; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/queue.py":627 + * if result is not waiter: + * raise InvalidSwitchError("Invalid switch into Channel.put: %r" % (result, )) + * except: # <<<<<<<<<<<<<< + * _safe_remove(self.putters, item) + * raise + */ + /*except:*/ { + __Pyx_AddTraceback("gevent._queue.Channel.put", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_3, &__pyx_t_2) < 0) __PYX_ERR(0, 627, __pyx_L11_except_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GOTREF(__pyx_t_2); + + /* "src/gevent/queue.py":628 + * raise InvalidSwitchError("Invalid switch into Channel.put: %r" % (result, )) + * except: + * _safe_remove(self.putters, item) # <<<<<<<<<<<<<< + * raise + * finally: + */ + __pyx_t_9 = __pyx_v_self->putters; + __Pyx_INCREF(__pyx_t_9); + __pyx_t_7 = __pyx_f_6gevent_6_queue__safe_remove(__pyx_t_9, __pyx_v_item); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 628, __pyx_L11_except_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "src/gevent/queue.py":629 + * except: + * _safe_remove(self.putters, item) + * raise # <<<<<<<<<<<<<< + * finally: + * timeout.cancel() + */ + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_ErrRestoreWithState(__pyx_t_1, __pyx_t_3, __pyx_t_2); + __pyx_t_1 = 0; __pyx_t_3 = 0; __pyx_t_2 = 0; + __PYX_ERR(0, 629, __pyx_L11_except_error) + } + __pyx_L11_except_error:; + + /* "src/gevent/queue.py":621 + * self.putters.append(item) + * timeout = Timeout._start_new_or_dummy(timeout, Full) + * try: # <<<<<<<<<<<<<< + * if self.getters: + * self._schedule_unlock() + */ + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_XGIVEREF(__pyx_t_12); + __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12); + goto __pyx_L7_error; + __pyx_L14_try_end:; + } + } + + /* "src/gevent/queue.py":631 + * raise + * finally: + * timeout.cancel() # <<<<<<<<<<<<<< + * + * def put_nowait(self, item): + */ + /*finally:*/ { + /*normal exit:*/{ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_timeout, __pyx_n_s_cancel); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 631, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_1)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_1); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_1) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1) : __Pyx_PyObject_CallNoArg(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 631, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + goto __pyx_L8; + } + __pyx_L7_error:; + /*exception exit:*/{ + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __pyx_t_12 = 0; __pyx_t_11 = 0; __pyx_t_10 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17); + if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_12, &__pyx_t_11, &__pyx_t_10) < 0)) __Pyx_ErrFetch(&__pyx_t_12, &__pyx_t_11, &__pyx_t_10); + __Pyx_XGOTREF(__pyx_t_12); + __Pyx_XGOTREF(__pyx_t_11); + __Pyx_XGOTREF(__pyx_t_10); + __Pyx_XGOTREF(__pyx_t_15); + __Pyx_XGOTREF(__pyx_t_16); + __Pyx_XGOTREF(__pyx_t_17); + __pyx_t_8 = __pyx_lineno; __pyx_t_13 = __pyx_clineno; __pyx_t_14 = __pyx_filename; + { + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_timeout, __pyx_n_s_cancel); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 631, __pyx_L20_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_1)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_1); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_1) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1) : __Pyx_PyObject_CallNoArg(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 631, __pyx_L20_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + if (PY_MAJOR_VERSION >= 3) { + __Pyx_XGIVEREF(__pyx_t_15); + __Pyx_XGIVEREF(__pyx_t_16); + __Pyx_XGIVEREF(__pyx_t_17); + __Pyx_ExceptionReset(__pyx_t_15, __pyx_t_16, __pyx_t_17); + } + __Pyx_XGIVEREF(__pyx_t_12); + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_ErrRestore(__pyx_t_12, __pyx_t_11, __pyx_t_10); + __pyx_t_12 = 0; __pyx_t_11 = 0; __pyx_t_10 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; + __pyx_lineno = __pyx_t_8; __pyx_clineno = __pyx_t_13; __pyx_filename = __pyx_t_14; + goto __pyx_L1_error; + __pyx_L20_error:; + if (PY_MAJOR_VERSION >= 3) { + __Pyx_XGIVEREF(__pyx_t_15); + __Pyx_XGIVEREF(__pyx_t_16); + __Pyx_XGIVEREF(__pyx_t_17); + __Pyx_ExceptionReset(__pyx_t_15, __pyx_t_16, __pyx_t_17); + } + __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; + goto __pyx_L1_error; + } + __pyx_L8:; + } + + /* "src/gevent/queue.py":606 + * return True + * + * def put(self, item, block=True, timeout=None): # <<<<<<<<<<<<<< + * if self.hub is getcurrent(): + * if self.getters: + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_AddTraceback("gevent._queue.Channel.put", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_getter); + __Pyx_XDECREF((PyObject *)__pyx_v_waiter); + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XDECREF(__pyx_v_item); + __Pyx_XDECREF(__pyx_v_timeout); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/queue.py":633 + * timeout.cancel() + * + * def put_nowait(self, item): # <<<<<<<<<<<<<< + * self.put(item, False) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_queue_7Channel_17put_nowait(PyObject *__pyx_v_self, PyObject *__pyx_v_item); /*proto*/ +static char __pyx_doc_6gevent_6_queue_7Channel_16put_nowait[] = "Channel.put_nowait(self, item)"; +static PyMethodDef __pyx_mdef_6gevent_6_queue_7Channel_17put_nowait = {"put_nowait", (PyCFunction)__pyx_pw_6gevent_6_queue_7Channel_17put_nowait, METH_O, __pyx_doc_6gevent_6_queue_7Channel_16put_nowait}; +static PyObject *__pyx_pw_6gevent_6_queue_7Channel_17put_nowait(PyObject *__pyx_v_self, PyObject *__pyx_v_item) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("put_nowait (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6_queue_7Channel_16put_nowait(((struct __pyx_obj_6gevent_6_queue_Channel *)__pyx_v_self), ((PyObject *)__pyx_v_item)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_queue_7Channel_16put_nowait(struct __pyx_obj_6gevent_6_queue_Channel *__pyx_v_self, PyObject *__pyx_v_item) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + __Pyx_RefNannySetupContext("put_nowait", 0); + + /* "src/gevent/queue.py":634 + * + * def put_nowait(self, item): + * self.put(item, False) # <<<<<<<<<<<<<< + * + * def get(self, block=True, timeout=None): + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_put_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 634, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + __pyx_t_4 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_4 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_item, Py_False}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 634, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_item, Py_False}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 634, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else + #endif + { + __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 634, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (__pyx_t_3) { + __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL; + } + __Pyx_INCREF(__pyx_v_item); + __Pyx_GIVEREF(__pyx_v_item); + PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_item); + __Pyx_INCREF(Py_False); + __Pyx_GIVEREF(Py_False); + PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, Py_False); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 634, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/queue.py":633 + * timeout.cancel() + * + * def put_nowait(self, item): # <<<<<<<<<<<<<< + * self.put(item, False) + * + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("gevent._queue.Channel.put_nowait", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/queue.py":636 + * self.put(item, False) + * + * def get(self, block=True, timeout=None): # <<<<<<<<<<<<<< + * if self.hub is getcurrent(): + * if self.putters: + */ + +static PyObject *__pyx_pw_6gevent_6_queue_7Channel_19get(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_6gevent_6_queue_7Channel_get(struct __pyx_obj_6gevent_6_queue_Channel *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_6_queue_7Channel_get *__pyx_optional_args) { + PyObject *__pyx_v_block = ((PyObject *)Py_True); + PyObject *__pyx_v_timeout = ((PyObject *)Py_None); + PyObject *__pyx_v_item = NULL; + PyObject *__pyx_v_putter = NULL; + struct __pyx_obj_6gevent_8__waiter_Waiter *__pyx_v_waiter = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + int __pyx_t_8; + PyObject *(*__pyx_t_9)(PyObject *); + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + int __pyx_t_13; + PyObject *__pyx_t_14 = NULL; + int __pyx_t_15; + char const *__pyx_t_16; + PyObject *__pyx_t_17 = NULL; + PyObject *__pyx_t_18 = NULL; + PyObject *__pyx_t_19 = NULL; + __Pyx_RefNannySetupContext("get", 0); + if (__pyx_optional_args) { + if (__pyx_optional_args->__pyx_n > 0) { + __pyx_v_block = __pyx_optional_args->block; + if (__pyx_optional_args->__pyx_n > 1) { + __pyx_v_timeout = __pyx_optional_args->timeout; + } + } + } + __Pyx_INCREF(__pyx_v_timeout); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0; + if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self)))))); + else { + PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + #endif + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 636, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_6_queue_7Channel_19get)) { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; + __pyx_t_5 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_5 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_3)) { + PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_block, __pyx_v_timeout}; + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 636, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GOTREF(__pyx_t_2); + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { + PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_block, __pyx_v_timeout}; + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 636, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GOTREF(__pyx_t_2); + } else + #endif + { + __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 636, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (__pyx_t_4) { + __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL; + } + __Pyx_INCREF(__pyx_v_block); + __Pyx_GIVEREF(__pyx_v_block); + PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_block); + __Pyx_INCREF(__pyx_v_timeout); + __Pyx_GIVEREF(__pyx_v_timeout); + PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_timeout); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 636, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0; + if (unlikely(type_dict_guard != tp_dict_version)) { + tp_dict_version = obj_dict_version = 0; + } + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + } + #endif + } + + /* "src/gevent/queue.py":637 + * + * def get(self, block=True, timeout=None): + * if self.hub is getcurrent(): # <<<<<<<<<<<<<< + * if self.putters: + * item, putter = self.putters.popleft() + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_getcurrent); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 637, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 637, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_7 = (__pyx_v_self->hub == __pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_8 = (__pyx_t_7 != 0); + if (__pyx_t_8) { + + /* "src/gevent/queue.py":638 + * def get(self, block=True, timeout=None): + * if self.hub is getcurrent(): + * if self.putters: # <<<<<<<<<<<<<< + * item, putter = self.putters.popleft() + * self.hub.loop.run_callback(putter.switch, putter) + */ + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_self->putters); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 638, __pyx_L1_error) + if (__pyx_t_8) { + + /* "src/gevent/queue.py":639 + * if self.hub is getcurrent(): + * if self.putters: + * item, putter = self.putters.popleft() # <<<<<<<<<<<<<< + * self.hub.loop.run_callback(putter.switch, putter) + * return item + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->putters, __pyx_n_s_popleft); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 639, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 639, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { + PyObject* sequence = __pyx_t_1; + Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + __PYX_ERR(0, 639, __pyx_L1_error) + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_2 = PyList_GET_ITEM(sequence, 0); + __pyx_t_3 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + #else + __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 639, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 639, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_6 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 639, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_9 = Py_TYPE(__pyx_t_6)->tp_iternext; + index = 0; __pyx_t_2 = __pyx_t_9(__pyx_t_6); if (unlikely(!__pyx_t_2)) goto __pyx_L5_unpacking_failed; + __Pyx_GOTREF(__pyx_t_2); + index = 1; __pyx_t_3 = __pyx_t_9(__pyx_t_6); if (unlikely(!__pyx_t_3)) goto __pyx_L5_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_6), 2) < 0) __PYX_ERR(0, 639, __pyx_L1_error) + __pyx_t_9 = NULL; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L6_unpacking_done; + __pyx_L5_unpacking_failed:; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_9 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + __PYX_ERR(0, 639, __pyx_L1_error) + __pyx_L6_unpacking_done:; + } + __pyx_v_item = __pyx_t_2; + __pyx_t_2 = 0; + __pyx_v_putter = __pyx_t_3; + __pyx_t_3 = 0; + + /* "src/gevent/queue.py":640 + * if self.putters: + * item, putter = self.putters.popleft() + * self.hub.loop.run_callback(putter.switch, putter) # <<<<<<<<<<<<<< + * return item + * + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->hub, __pyx_n_s_loop); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 640, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_run_callback); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 640, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_putter, __pyx_n_s_switch); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 640, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_6 = NULL; + __pyx_t_5 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_6)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_5 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_3, __pyx_v_putter}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 640, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_3, __pyx_v_putter}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 640, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } else + #endif + { + __pyx_t_4 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 640, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (__pyx_t_6) { + __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6); __pyx_t_6 = NULL; + } + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_5, __pyx_t_3); + __Pyx_INCREF(__pyx_v_putter); + __Pyx_GIVEREF(__pyx_v_putter); + PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_5, __pyx_v_putter); + __pyx_t_3 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 640, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/queue.py":641 + * item, putter = self.putters.popleft() + * self.hub.loop.run_callback(putter.switch, putter) + * return item # <<<<<<<<<<<<<< + * + * if not block: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_item); + __pyx_r = __pyx_v_item; + goto __pyx_L0; + + /* "src/gevent/queue.py":638 + * def get(self, block=True, timeout=None): + * if self.hub is getcurrent(): + * if self.putters: # <<<<<<<<<<<<<< + * item, putter = self.putters.popleft() + * self.hub.loop.run_callback(putter.switch, putter) + */ + } + + /* "src/gevent/queue.py":637 + * + * def get(self, block=True, timeout=None): + * if self.hub is getcurrent(): # <<<<<<<<<<<<<< + * if self.putters: + * item, putter = self.putters.popleft() + */ + } + + /* "src/gevent/queue.py":643 + * return item + * + * if not block: # <<<<<<<<<<<<<< + * timeout = 0 + * + */ + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_block); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 643, __pyx_L1_error) + __pyx_t_7 = ((!__pyx_t_8) != 0); + if (__pyx_t_7) { + + /* "src/gevent/queue.py":644 + * + * if not block: + * timeout = 0 # <<<<<<<<<<<<<< + * + * waiter = Waiter() # pylint:disable=undefined-variable + */ + __Pyx_INCREF(__pyx_int_0); + __Pyx_DECREF_SET(__pyx_v_timeout, __pyx_int_0); + + /* "src/gevent/queue.py":643 + * return item + * + * if not block: # <<<<<<<<<<<<<< + * timeout = 0 + * + */ + } + + /* "src/gevent/queue.py":646 + * timeout = 0 + * + * waiter = Waiter() # pylint:disable=undefined-variable # <<<<<<<<<<<<<< + * timeout = Timeout._start_new_or_dummy(timeout, Empty) + * try: + */ + __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_6gevent_8__waiter_Waiter)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 646, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_waiter = ((struct __pyx_obj_6gevent_8__waiter_Waiter *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "src/gevent/queue.py":647 + * + * waiter = Waiter() # pylint:disable=undefined-variable + * timeout = Timeout._start_new_or_dummy(timeout, Empty) # <<<<<<<<<<<<<< + * try: + * self.getters.append(waiter) + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Timeout); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 647, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_start_new_or_dummy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 647, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 647, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + __pyx_t_5 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + __pyx_t_5 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_4)) { + PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_timeout, __pyx_t_2}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 647, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { + PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_timeout, __pyx_t_2}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 647, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } else + #endif + { + __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 647, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (__pyx_t_3) { + __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); __pyx_t_3 = NULL; + } + __Pyx_INCREF(__pyx_v_timeout); + __Pyx_GIVEREF(__pyx_v_timeout); + PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_timeout); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 647, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF_SET(__pyx_v_timeout, __pyx_t_1); + __pyx_t_1 = 0; + + /* "src/gevent/queue.py":648 + * waiter = Waiter() # pylint:disable=undefined-variable + * timeout = Timeout._start_new_or_dummy(timeout, Empty) + * try: # <<<<<<<<<<<<<< + * self.getters.append(waiter) + * if self.putters: + */ + /*try:*/ { + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12); + __Pyx_XGOTREF(__pyx_t_10); + __Pyx_XGOTREF(__pyx_t_11); + __Pyx_XGOTREF(__pyx_t_12); + /*try:*/ { + + /* "src/gevent/queue.py":649 + * timeout = Timeout._start_new_or_dummy(timeout, Empty) + * try: + * self.getters.append(waiter) # <<<<<<<<<<<<<< + * if self.putters: + * self._schedule_unlock() + */ + __pyx_t_13 = __Pyx_PyObject_Append(__pyx_v_self->getters, ((PyObject *)__pyx_v_waiter)); if (unlikely(__pyx_t_13 == ((int)-1))) __PYX_ERR(0, 649, __pyx_L11_error) + + /* "src/gevent/queue.py":650 + * try: + * self.getters.append(waiter) + * if self.putters: # <<<<<<<<<<<<<< + * self._schedule_unlock() + * return waiter.get() + */ + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_self->putters); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 650, __pyx_L11_error) + if (__pyx_t_7) { + + /* "src/gevent/queue.py":651 + * self.getters.append(waiter) + * if self.putters: + * self._schedule_unlock() # <<<<<<<<<<<<<< + * return waiter.get() + * except: + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_6_queue_Channel *)__pyx_v_self->__pyx_vtab)->_schedule_unlock(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 651, __pyx_L11_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/queue.py":650 + * try: + * self.getters.append(waiter) + * if self.putters: # <<<<<<<<<<<<<< + * self._schedule_unlock() + * return waiter.get() + */ + } + + /* "src/gevent/queue.py":652 + * if self.putters: + * self._schedule_unlock() + * return waiter.get() # <<<<<<<<<<<<<< + * except: + * self.getters.remove(waiter) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_8__waiter_Waiter *)__pyx_v_waiter->__pyx_vtab)->get(__pyx_v_waiter, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 652, __pyx_L11_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L15_try_return; + + /* "src/gevent/queue.py":648 + * waiter = Waiter() # pylint:disable=undefined-variable + * timeout = Timeout._start_new_or_dummy(timeout, Empty) + * try: # <<<<<<<<<<<<<< + * self.getters.append(waiter) + * if self.putters: + */ + } + __pyx_L11_error:; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/queue.py":653 + * self._schedule_unlock() + * return waiter.get() + * except: # <<<<<<<<<<<<<< + * self.getters.remove(waiter) + * raise + */ + /*except:*/ { + __Pyx_AddTraceback("gevent._queue.Channel.get", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_4, &__pyx_t_6) < 0) __PYX_ERR(0, 653, __pyx_L13_except_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_6); + + /* "src/gevent/queue.py":654 + * return waiter.get() + * except: + * self.getters.remove(waiter) # <<<<<<<<<<<<<< + * raise + * finally: + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->getters, __pyx_n_s_remove); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 654, __pyx_L13_except_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_14 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_14)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_14); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_14) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_14, ((PyObject *)__pyx_v_waiter)) : __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_waiter)); + __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 654, __pyx_L13_except_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/queue.py":655 + * except: + * self.getters.remove(waiter) + * raise # <<<<<<<<<<<<<< + * finally: + * timeout.close() + */ + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_ErrRestoreWithState(__pyx_t_1, __pyx_t_4, __pyx_t_6); + __pyx_t_1 = 0; __pyx_t_4 = 0; __pyx_t_6 = 0; + __PYX_ERR(0, 655, __pyx_L13_except_error) + } + __pyx_L13_except_error:; + + /* "src/gevent/queue.py":648 + * waiter = Waiter() # pylint:disable=undefined-variable + * timeout = Timeout._start_new_or_dummy(timeout, Empty) + * try: # <<<<<<<<<<<<<< + * self.getters.append(waiter) + * if self.putters: + */ + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_XGIVEREF(__pyx_t_12); + __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12); + goto __pyx_L9_error; + __pyx_L15_try_return:; + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_XGIVEREF(__pyx_t_12); + __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12); + goto __pyx_L8_return; + } + } + + /* "src/gevent/queue.py":657 + * raise + * finally: + * timeout.close() # <<<<<<<<<<<<<< + * + * def get_nowait(self): + */ + /*finally:*/ { + __pyx_L9_error:; + /*exception exit:*/{ + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __pyx_t_12 = 0; __pyx_t_11 = 0; __pyx_t_10 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; + __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19); + if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_12, &__pyx_t_11, &__pyx_t_10) < 0)) __Pyx_ErrFetch(&__pyx_t_12, &__pyx_t_11, &__pyx_t_10); + __Pyx_XGOTREF(__pyx_t_12); + __Pyx_XGOTREF(__pyx_t_11); + __Pyx_XGOTREF(__pyx_t_10); + __Pyx_XGOTREF(__pyx_t_17); + __Pyx_XGOTREF(__pyx_t_18); + __Pyx_XGOTREF(__pyx_t_19); + __pyx_t_5 = __pyx_lineno; __pyx_t_15 = __pyx_clineno; __pyx_t_16 = __pyx_filename; + { + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_timeout, __pyx_n_s_close); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 657, __pyx_L21_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_1)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_1); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + } + } + __pyx_t_6 = (__pyx_t_1) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_1) : __Pyx_PyObject_CallNoArg(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 657, __pyx_L21_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + if (PY_MAJOR_VERSION >= 3) { + __Pyx_XGIVEREF(__pyx_t_17); + __Pyx_XGIVEREF(__pyx_t_18); + __Pyx_XGIVEREF(__pyx_t_19); + __Pyx_ExceptionReset(__pyx_t_17, __pyx_t_18, __pyx_t_19); + } + __Pyx_XGIVEREF(__pyx_t_12); + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_ErrRestore(__pyx_t_12, __pyx_t_11, __pyx_t_10); + __pyx_t_12 = 0; __pyx_t_11 = 0; __pyx_t_10 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; + __pyx_lineno = __pyx_t_5; __pyx_clineno = __pyx_t_15; __pyx_filename = __pyx_t_16; + goto __pyx_L1_error; + __pyx_L21_error:; + if (PY_MAJOR_VERSION >= 3) { + __Pyx_XGIVEREF(__pyx_t_17); + __Pyx_XGIVEREF(__pyx_t_18); + __Pyx_XGIVEREF(__pyx_t_19); + __Pyx_ExceptionReset(__pyx_t_17, __pyx_t_18, __pyx_t_19); + } + __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; + goto __pyx_L1_error; + } + __pyx_L8_return: { + __pyx_t_19 = __pyx_r; + __pyx_r = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_timeout, __pyx_n_s_close); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 657, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_1)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_1); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + } + } + __pyx_t_6 = (__pyx_t_1) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_1) : __Pyx_PyObject_CallNoArg(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 657, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_r = __pyx_t_19; + __pyx_t_19 = 0; + goto __pyx_L0; + } + } + + /* "src/gevent/queue.py":636 + * self.put(item, False) + * + * def get(self, block=True, timeout=None): # <<<<<<<<<<<<<< + * if self.hub is getcurrent(): + * if self.putters: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_14); + __Pyx_AddTraceback("gevent._queue.Channel.get", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_item); + __Pyx_XDECREF(__pyx_v_putter); + __Pyx_XDECREF((PyObject *)__pyx_v_waiter); + __Pyx_XDECREF(__pyx_v_timeout); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_queue_7Channel_19get(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6gevent_6_queue_7Channel_18get[] = "Channel.get(self, block=True, timeout=None)"; +static PyMethodDef __pyx_mdef_6gevent_6_queue_7Channel_19get = {"get", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_6_queue_7Channel_19get, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_6_queue_7Channel_18get}; +static PyObject *__pyx_pw_6gevent_6_queue_7Channel_19get(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_block = 0; + PyObject *__pyx_v_timeout = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_block,&__pyx_n_s_timeout,0}; + PyObject* values[2] = {0,0}; + values[0] = ((PyObject *)Py_True); + values[1] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_block); + if (value) { values[0] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 1: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_timeout); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get") < 0)) __PYX_ERR(0, 636, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_block = values[0]; + __pyx_v_timeout = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("get", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 636, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent._queue.Channel.get", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_6_queue_7Channel_18get(((struct __pyx_obj_6gevent_6_queue_Channel *)__pyx_v_self), __pyx_v_block, __pyx_v_timeout); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_queue_7Channel_18get(struct __pyx_obj_6gevent_6_queue_Channel *__pyx_v_self, PyObject *__pyx_v_block, PyObject *__pyx_v_timeout) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + struct __pyx_opt_args_6gevent_6_queue_7Channel_get __pyx_t_2; + __Pyx_RefNannySetupContext("get", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_2.__pyx_n = 2; + __pyx_t_2.block = __pyx_v_block; + __pyx_t_2.timeout = __pyx_v_timeout; + __pyx_t_1 = __pyx_vtabptr_6gevent_6_queue_Channel->get(__pyx_v_self, 1, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 636, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent._queue.Channel.get", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/queue.py":659 + * timeout.close() + * + * def get_nowait(self): # <<<<<<<<<<<<<< + * return self.get(False) + * + */ + +static PyObject *__pyx_pw_6gevent_6_queue_7Channel_21get_nowait(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_f_6gevent_6_queue_7Channel_get_nowait(struct __pyx_obj_6gevent_6_queue_Channel *__pyx_v_self, int __pyx_skip_dispatch) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + struct __pyx_opt_args_6gevent_6_queue_7Channel_get __pyx_t_5; + __Pyx_RefNannySetupContext("get_nowait", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0; + if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self)))))); + else { + PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + #endif + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_nowait); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 659, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_6_queue_7Channel_21get_nowait)) { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 659, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0; + if (unlikely(type_dict_guard != tp_dict_version)) { + tp_dict_version = obj_dict_version = 0; + } + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + } + #endif + } + + /* "src/gevent/queue.py":660 + * + * def get_nowait(self): + * return self.get(False) # <<<<<<<<<<<<<< + * + * def _unlock(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_5.__pyx_n = 1; + __pyx_t_5.block = Py_False; + __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_6_queue_Channel *)__pyx_v_self->__pyx_vtab)->get(__pyx_v_self, 0, &__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 660, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "src/gevent/queue.py":659 + * timeout.close() + * + * def get_nowait(self): # <<<<<<<<<<<<<< + * return self.get(False) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("gevent._queue.Channel.get_nowait", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_queue_7Channel_21get_nowait(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6gevent_6_queue_7Channel_20get_nowait[] = "Channel.get_nowait(self)"; +static PyMethodDef __pyx_mdef_6gevent_6_queue_7Channel_21get_nowait = {"get_nowait", (PyCFunction)__pyx_pw_6gevent_6_queue_7Channel_21get_nowait, METH_NOARGS, __pyx_doc_6gevent_6_queue_7Channel_20get_nowait}; +static PyObject *__pyx_pw_6gevent_6_queue_7Channel_21get_nowait(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get_nowait (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6_queue_7Channel_20get_nowait(((struct __pyx_obj_6gevent_6_queue_Channel *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_queue_7Channel_20get_nowait(struct __pyx_obj_6gevent_6_queue_Channel *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("get_nowait", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6gevent_6_queue_7Channel_get_nowait(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 659, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent._queue.Channel.get_nowait", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/queue.py":662 + * return self.get(False) + * + * def _unlock(self): # <<<<<<<<<<<<<< + * while self.putters and self.getters: + * getter = self.getters.popleft() + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_queue_7Channel_23_unlock(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6gevent_6_queue_7Channel_22_unlock[] = "Channel._unlock(self)"; +static PyMethodDef __pyx_mdef_6gevent_6_queue_7Channel_23_unlock = {"_unlock", (PyCFunction)__pyx_pw_6gevent_6_queue_7Channel_23_unlock, METH_NOARGS, __pyx_doc_6gevent_6_queue_7Channel_22_unlock}; +static PyObject *__pyx_pw_6gevent_6_queue_7Channel_23_unlock(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_unlock (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6_queue_7Channel_22_unlock(((struct __pyx_obj_6gevent_6_queue_Channel *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_queue_7Channel_22_unlock(struct __pyx_obj_6gevent_6_queue_Channel *__pyx_v_self) { + PyObject *__pyx_v_getter = NULL; + PyObject *__pyx_v_item = NULL; + PyObject *__pyx_v_putter = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *(*__pyx_t_7)(PyObject *); + __Pyx_RefNannySetupContext("_unlock", 0); + + /* "src/gevent/queue.py":663 + * + * def _unlock(self): + * while self.putters and self.getters: # <<<<<<<<<<<<<< + * getter = self.getters.popleft() + * item, putter = self.putters.popleft() + */ + while (1) { + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_self->putters); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 663, __pyx_L1_error) + if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L5_bool_binop_done; + } + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_self->getters); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 663, __pyx_L1_error) + __pyx_t_1 = __pyx_t_2; + __pyx_L5_bool_binop_done:; + if (!__pyx_t_1) break; + + /* "src/gevent/queue.py":664 + * def _unlock(self): + * while self.putters and self.getters: + * getter = self.getters.popleft() # <<<<<<<<<<<<<< + * item, putter = self.putters.popleft() + * getter.switch(item) + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->getters, __pyx_n_s_popleft); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 664, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + } + } + __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 664, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF_SET(__pyx_v_getter, __pyx_t_3); + __pyx_t_3 = 0; + + /* "src/gevent/queue.py":665 + * while self.putters and self.getters: + * getter = self.getters.popleft() + * item, putter = self.putters.popleft() # <<<<<<<<<<<<<< + * getter.switch(item) + * putter.switch(putter) + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->putters, __pyx_n_s_popleft); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 665, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + } + } + __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 665, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) { + PyObject* sequence = __pyx_t_3; + Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + __PYX_ERR(0, 665, __pyx_L1_error) + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_4 = PyList_GET_ITEM(sequence, 0); + __pyx_t_5 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + #else + __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 665, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 665, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + #endif + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_6 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 665, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_7 = Py_TYPE(__pyx_t_6)->tp_iternext; + index = 0; __pyx_t_4 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_4)) goto __pyx_L7_unpacking_failed; + __Pyx_GOTREF(__pyx_t_4); + index = 1; __pyx_t_5 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_5)) goto __pyx_L7_unpacking_failed; + __Pyx_GOTREF(__pyx_t_5); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 2) < 0) __PYX_ERR(0, 665, __pyx_L1_error) + __pyx_t_7 = NULL; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L8_unpacking_done; + __pyx_L7_unpacking_failed:; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_7 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + __PYX_ERR(0, 665, __pyx_L1_error) + __pyx_L8_unpacking_done:; + } + __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_4); + __pyx_t_4 = 0; + __Pyx_XDECREF_SET(__pyx_v_putter, __pyx_t_5); + __pyx_t_5 = 0; + + /* "src/gevent/queue.py":666 + * getter = self.getters.popleft() + * item, putter = self.putters.popleft() + * getter.switch(item) # <<<<<<<<<<<<<< + * putter.switch(putter) + * + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_getter, __pyx_n_s_switch); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 666, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_5, function); + } + } + __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_4, __pyx_v_item) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_item); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 666, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "src/gevent/queue.py":667 + * item, putter = self.putters.popleft() + * getter.switch(item) + * putter.switch(putter) # <<<<<<<<<<<<<< + * + * def _schedule_unlock(self): + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_putter, __pyx_n_s_switch); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 667, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_5, function); + } + } + __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_4, __pyx_v_putter) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_putter); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 667, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + + /* "src/gevent/queue.py":662 + * return self.get(False) + * + * def _unlock(self): # <<<<<<<<<<<<<< + * while self.putters and self.getters: + * getter = self.getters.popleft() + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("gevent._queue.Channel._unlock", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_getter); + __Pyx_XDECREF(__pyx_v_item); + __Pyx_XDECREF(__pyx_v_putter); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/queue.py":669 + * putter.switch(putter) + * + * def _schedule_unlock(self): # <<<<<<<<<<<<<< + * if not self._event_unlock: + * self._event_unlock = self.hub.loop.run_callback(self._unlock) + */ + +static PyObject *__pyx_f_6gevent_6_queue_7Channel__schedule_unlock(struct __pyx_obj_6gevent_6_queue_Channel *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + __Pyx_RefNannySetupContext("_schedule_unlock", 0); + + /* "src/gevent/queue.py":670 + * + * def _schedule_unlock(self): + * if not self._event_unlock: # <<<<<<<<<<<<<< + * self._event_unlock = self.hub.loop.run_callback(self._unlock) + * + */ + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_self->_event_unlock); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 670, __pyx_L1_error) + __pyx_t_2 = ((!__pyx_t_1) != 0); + if (__pyx_t_2) { + + /* "src/gevent/queue.py":671 + * def _schedule_unlock(self): + * if not self._event_unlock: + * self._event_unlock = self.hub.loop.run_callback(self._unlock) # <<<<<<<<<<<<<< + * + * def __iter__(self): + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->hub, __pyx_n_s_loop); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 671, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_run_callback); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 671, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_unlock); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 671, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); + if (likely(__pyx_t_6)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_5, function); + } + } + __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4); + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 671, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GIVEREF(__pyx_t_3); + __Pyx_GOTREF(__pyx_v_self->_event_unlock); + __Pyx_DECREF(__pyx_v_self->_event_unlock); + __pyx_v_self->_event_unlock = __pyx_t_3; + __pyx_t_3 = 0; + + /* "src/gevent/queue.py":670 + * + * def _schedule_unlock(self): + * if not self._event_unlock: # <<<<<<<<<<<<<< + * self._event_unlock = self.hub.loop.run_callback(self._unlock) + * + */ + } + + /* "src/gevent/queue.py":669 + * putter.switch(putter) + * + * def _schedule_unlock(self): # <<<<<<<<<<<<<< + * if not self._event_unlock: + * self._event_unlock = self.hub.loop.run_callback(self._unlock) + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("gevent._queue.Channel._schedule_unlock", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/queue.py":673 + * self._event_unlock = self.hub.loop.run_callback(self._unlock) + * + * def __iter__(self): # <<<<<<<<<<<<<< + * return self + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_queue_7Channel_25__iter__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_6_queue_7Channel_25__iter__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6_queue_7Channel_24__iter__(((struct __pyx_obj_6gevent_6_queue_Channel *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_queue_7Channel_24__iter__(struct __pyx_obj_6gevent_6_queue_Channel *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__iter__", 0); + + /* "src/gevent/queue.py":674 + * + * def __iter__(self): + * return self # <<<<<<<<<<<<<< + * + * def __next__(self): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __pyx_r = ((PyObject *)__pyx_v_self); + goto __pyx_L0; + + /* "src/gevent/queue.py":673 + * self._event_unlock = self.hub.loop.run_callback(self._unlock) + * + * def __iter__(self): # <<<<<<<<<<<<<< + * return self + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "src/gevent/queue.py":676 + * return self + * + * def __next__(self): # <<<<<<<<<<<<<< + * result = self.get() + * if result is StopIteration: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_queue_7Channel_27__next__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_6_queue_7Channel_27__next__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__next__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6_queue_7Channel_26__next__(((struct __pyx_obj_6gevent_6_queue_Channel *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_queue_7Channel_26__next__(struct __pyx_obj_6gevent_6_queue_Channel *__pyx_v_self) { + PyObject *__pyx_v_result = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + __Pyx_RefNannySetupContext("__next__", 0); + + /* "src/gevent/queue.py":677 + * + * def __next__(self): + * result = self.get() # <<<<<<<<<<<<<< + * if result is StopIteration: + * raise result + */ + __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_6_queue_Channel *)__pyx_v_self->__pyx_vtab)->get(__pyx_v_self, 0, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 677, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_result = __pyx_t_1; + __pyx_t_1 = 0; + + /* "src/gevent/queue.py":678 + * def __next__(self): + * result = self.get() + * if result is StopIteration: # <<<<<<<<<<<<<< + * raise result + * return result + */ + __pyx_t_2 = (__pyx_v_result == __pyx_builtin_StopIteration); + __pyx_t_3 = (__pyx_t_2 != 0); + if (unlikely(__pyx_t_3)) { + + /* "src/gevent/queue.py":679 + * result = self.get() + * if result is StopIteration: + * raise result # <<<<<<<<<<<<<< + * return result + * + */ + __Pyx_Raise(__pyx_v_result, 0, 0, 0); + __PYX_ERR(0, 679, __pyx_L1_error) + + /* "src/gevent/queue.py":678 + * def __next__(self): + * result = self.get() + * if result is StopIteration: # <<<<<<<<<<<<<< + * raise result + * return result + */ + } + + /* "src/gevent/queue.py":680 + * if result is StopIteration: + * raise result + * return result # <<<<<<<<<<<<<< + * + * next = __next__ # Py2 + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; + goto __pyx_L0; + + /* "src/gevent/queue.py":676 + * return self + * + * def __next__(self): # <<<<<<<<<<<<<< + * result = self.get() + * if result is StopIteration: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent._queue.Channel.__next__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_result); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/_queue.pxd":66 + * cdef class Channel: + * cdef __weakref__ + * cdef readonly getters # <<<<<<<<<<<<<< + * cdef readonly putters + * cdef readonly hub + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_queue_7Channel_7getters_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_6_queue_7Channel_7getters_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6_queue_7Channel_7getters___get__(((struct __pyx_obj_6gevent_6_queue_Channel *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_queue_7Channel_7getters___get__(struct __pyx_obj_6gevent_6_queue_Channel *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->getters); + __pyx_r = __pyx_v_self->getters; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/_queue.pxd":67 + * cdef __weakref__ + * cdef readonly getters + * cdef readonly putters # <<<<<<<<<<<<<< + * cdef readonly hub + * cdef _event_unlock + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_queue_7Channel_7putters_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_6_queue_7Channel_7putters_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6_queue_7Channel_7putters___get__(((struct __pyx_obj_6gevent_6_queue_Channel *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_queue_7Channel_7putters___get__(struct __pyx_obj_6gevent_6_queue_Channel *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->putters); + __pyx_r = __pyx_v_self->putters; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/_queue.pxd":68 + * cdef readonly getters + * cdef readonly putters + * cdef readonly hub # <<<<<<<<<<<<<< + * cdef _event_unlock + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_6_queue_7Channel_3hub_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_6_queue_7Channel_3hub_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_6_queue_7Channel_3hub___get__(((struct __pyx_obj_6gevent_6_queue_Channel *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_6_queue_7Channel_3hub___get__(struct __pyx_obj_6gevent_6_queue_Channel *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->hub); + __pyx_r = __pyx_v_self->hub; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/__greenlet_primitives.pxd":23 + * + * @cython.final + * cdef inline greenlet getcurrent(): # <<<<<<<<<<<<<< + * return PyGreenlet_GetCurrent() + * + */ + +static CYTHON_INLINE PyGreenlet *__pyx_f_6gevent_21__greenlet_primitives_getcurrent(void) { + PyGreenlet *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("getcurrent", 0); + + /* "gevent/__greenlet_primitives.pxd":24 + * @cython.final + * cdef inline greenlet getcurrent(): + * return PyGreenlet_GetCurrent() # <<<<<<<<<<<<<< + * + * cdef bint _greenlet_imported + */ + __Pyx_XDECREF(((PyObject *)__pyx_r)); + __pyx_t_1 = ((PyObject *)PyGreenlet_GetCurrent()); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 24, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = ((PyGreenlet *)__pyx_t_1); + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "gevent/__greenlet_primitives.pxd":23 + * + * @cython.final + * cdef inline greenlet getcurrent(): # <<<<<<<<<<<<<< + * return PyGreenlet_GetCurrent() + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__greenlet_primitives.getcurrent", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF((PyObject *)__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/__greenlet_primitives.pxd":28 + * cdef bint _greenlet_imported + * + * cdef inline void greenlet_init(): # <<<<<<<<<<<<<< + * global _greenlet_imported + * if not _greenlet_imported: + */ + +static CYTHON_INLINE void __pyx_f_6gevent_21__greenlet_primitives_greenlet_init(void) { + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("greenlet_init", 0); + + /* "gevent/__greenlet_primitives.pxd":30 + * cdef inline void greenlet_init(): + * global _greenlet_imported + * if not _greenlet_imported: # <<<<<<<<<<<<<< + * PyGreenlet_Import() + * _greenlet_imported = True + */ + __pyx_t_1 = ((!(__pyx_v_6gevent_21__greenlet_primitives__greenlet_imported != 0)) != 0); + if (__pyx_t_1) { + + /* "gevent/__greenlet_primitives.pxd":31 + * global _greenlet_imported + * if not _greenlet_imported: + * PyGreenlet_Import() # <<<<<<<<<<<<<< + * _greenlet_imported = True + * + */ + PyGreenlet_Import(); + + /* "gevent/__greenlet_primitives.pxd":32 + * if not _greenlet_imported: + * PyGreenlet_Import() + * _greenlet_imported = True # <<<<<<<<<<<<<< + * + * cdef inline object _greenlet_switch(greenlet self): + */ + __pyx_v_6gevent_21__greenlet_primitives__greenlet_imported = 1; + + /* "gevent/__greenlet_primitives.pxd":30 + * cdef inline void greenlet_init(): + * global _greenlet_imported + * if not _greenlet_imported: # <<<<<<<<<<<<<< + * PyGreenlet_Import() + * _greenlet_imported = True + */ + } + + /* "gevent/__greenlet_primitives.pxd":28 + * cdef bint _greenlet_imported + * + * cdef inline void greenlet_init(): # <<<<<<<<<<<<<< + * global _greenlet_imported + * if not _greenlet_imported: + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "gevent/__greenlet_primitives.pxd":34 + * _greenlet_imported = True + * + * cdef inline object _greenlet_switch(greenlet self): # <<<<<<<<<<<<<< + * return PyGreenlet_Switch(self, NULL, NULL) + * + */ + +static CYTHON_INLINE PyObject *__pyx_f_6gevent_21__greenlet_primitives__greenlet_switch(PyGreenlet *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("_greenlet_switch", 0); + + /* "gevent/__greenlet_primitives.pxd":35 + * + * cdef inline object _greenlet_switch(greenlet self): + * return PyGreenlet_Switch(self, NULL, NULL) # <<<<<<<<<<<<<< + * + * cdef class TrackedRawGreenlet(greenlet): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyGreenlet_Switch(__pyx_v_self, NULL, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 35, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "gevent/__greenlet_primitives.pxd":34 + * _greenlet_imported = True + * + * cdef inline object _greenlet_switch(greenlet self): # <<<<<<<<<<<<<< + * return PyGreenlet_Switch(self, NULL, NULL) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__greenlet_primitives._greenlet_switch", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/__waiter.pxd":24 + * void PyGreenlet_Import() + * + * cdef inline greenlet getcurrent(): # <<<<<<<<<<<<<< + * return PyGreenlet_GetCurrent() + * + */ + +static CYTHON_INLINE PyGreenlet *__pyx_f_6gevent_8__waiter_getcurrent(void) { + PyGreenlet *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("getcurrent", 0); + + /* "gevent/__waiter.pxd":25 + * + * cdef inline greenlet getcurrent(): + * return PyGreenlet_GetCurrent() # <<<<<<<<<<<<<< + * + * cdef inline void greenlet_init(): + */ + __Pyx_XDECREF(((PyObject *)__pyx_r)); + __pyx_t_1 = ((PyObject *)PyGreenlet_GetCurrent()); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 25, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = ((PyGreenlet *)__pyx_t_1); + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "gevent/__waiter.pxd":24 + * void PyGreenlet_Import() + * + * cdef inline greenlet getcurrent(): # <<<<<<<<<<<<<< + * return PyGreenlet_GetCurrent() + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__waiter.getcurrent", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF((PyObject *)__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/__waiter.pxd":27 + * return PyGreenlet_GetCurrent() + * + * cdef inline void greenlet_init(): # <<<<<<<<<<<<<< + * global _greenlet_imported + * if not _greenlet_imported: + */ + +static CYTHON_INLINE void __pyx_f_6gevent_8__waiter_greenlet_init(void) { + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("greenlet_init", 0); + + /* "gevent/__waiter.pxd":29 + * cdef inline void greenlet_init(): + * global _greenlet_imported + * if not _greenlet_imported: # <<<<<<<<<<<<<< + * PyGreenlet_Import() + * _greenlet_imported = True + */ + __pyx_t_1 = ((!(__pyx_v_6gevent_8__waiter__greenlet_imported != 0)) != 0); + if (__pyx_t_1) { + + /* "gevent/__waiter.pxd":30 + * global _greenlet_imported + * if not _greenlet_imported: + * PyGreenlet_Import() # <<<<<<<<<<<<<< + * _greenlet_imported = True + * + */ + PyGreenlet_Import(); + + /* "gevent/__waiter.pxd":31 + * if not _greenlet_imported: + * PyGreenlet_Import() + * _greenlet_imported = True # <<<<<<<<<<<<<< + * + * cdef class Waiter: + */ + __pyx_v_6gevent_8__waiter__greenlet_imported = 1; + + /* "gevent/__waiter.pxd":29 + * cdef inline void greenlet_init(): + * global _greenlet_imported + * if not _greenlet_imported: # <<<<<<<<<<<<<< + * PyGreenlet_Import() + * _greenlet_imported = True + */ + } + + /* "gevent/__waiter.pxd":27 + * return PyGreenlet_GetCurrent() + * + * cdef inline void greenlet_init(): # <<<<<<<<<<<<<< + * global _greenlet_imported + * if not _greenlet_imported: + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "gevent/__abstract_linkable.pxd":21 + * void PyGreenlet_Import() + * + * cdef inline greenlet getcurrent(): # <<<<<<<<<<<<<< + * return PyGreenlet_GetCurrent() + * + */ + +static CYTHON_INLINE PyGreenlet *__pyx_f_6gevent_19__abstract_linkable_getcurrent(void) { + PyGreenlet *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("getcurrent", 0); + + /* "gevent/__abstract_linkable.pxd":22 + * + * cdef inline greenlet getcurrent(): + * return PyGreenlet_GetCurrent() # <<<<<<<<<<<<<< + * + * cdef inline void greenlet_init(): + */ + __Pyx_XDECREF(((PyObject *)__pyx_r)); + __pyx_t_1 = ((PyObject *)PyGreenlet_GetCurrent()); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 22, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = ((PyGreenlet *)__pyx_t_1); + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "gevent/__abstract_linkable.pxd":21 + * void PyGreenlet_Import() + * + * cdef inline greenlet getcurrent(): # <<<<<<<<<<<<<< + * return PyGreenlet_GetCurrent() + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.__abstract_linkable.getcurrent", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF((PyObject *)__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/__abstract_linkable.pxd":24 + * return PyGreenlet_GetCurrent() + * + * cdef inline void greenlet_init(): # <<<<<<<<<<<<<< + * global _greenlet_imported + * if not _greenlet_imported: + */ + +static CYTHON_INLINE void __pyx_f_6gevent_19__abstract_linkable_greenlet_init(void) { + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("greenlet_init", 0); + + /* "gevent/__abstract_linkable.pxd":26 + * cdef inline void greenlet_init(): + * global _greenlet_imported + * if not _greenlet_imported: # <<<<<<<<<<<<<< + * PyGreenlet_Import() + * _greenlet_imported = True + */ + __pyx_t_1 = ((!(__pyx_v_6gevent_19__abstract_linkable__greenlet_imported != 0)) != 0); + if (__pyx_t_1) { + + /* "gevent/__abstract_linkable.pxd":27 + * global _greenlet_imported + * if not _greenlet_imported: + * PyGreenlet_Import() # <<<<<<<<<<<<<< + * _greenlet_imported = True + * + */ + PyGreenlet_Import(); + + /* "gevent/__abstract_linkable.pxd":28 + * if not _greenlet_imported: + * PyGreenlet_Import() + * _greenlet_imported = True # <<<<<<<<<<<<<< + * + * cdef void _init() + */ + __pyx_v_6gevent_19__abstract_linkable__greenlet_imported = 1; + + /* "gevent/__abstract_linkable.pxd":26 + * cdef inline void greenlet_init(): + * global _greenlet_imported + * if not _greenlet_imported: # <<<<<<<<<<<<<< + * PyGreenlet_Import() + * _greenlet_imported = True + */ + } + + /* "gevent/__abstract_linkable.pxd":24 + * return PyGreenlet_GetCurrent() + * + * cdef inline void greenlet_init(): # <<<<<<<<<<<<<< + * global _greenlet_imported + * if not _greenlet_imported: + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} +static struct __pyx_vtabstruct_6gevent_6_queue_ItemWaiter __pyx_vtable_6gevent_6_queue_ItemWaiter; + +static PyObject *__pyx_tp_new_6gevent_6_queue_ItemWaiter(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_6gevent_6_queue_ItemWaiter *p; + PyObject *o = __pyx_ptype_6gevent_8__waiter_Waiter->tp_new(t, a, k); + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_6gevent_6_queue_ItemWaiter *)o); + p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_6gevent_8__waiter_Waiter*)__pyx_vtabptr_6gevent_6_queue_ItemWaiter; + p->item = Py_None; Py_INCREF(Py_None); + p->queue = Py_None; Py_INCREF(Py_None); + return o; +} + +static void __pyx_tp_dealloc_6gevent_6_queue_ItemWaiter(PyObject *o) { + struct __pyx_obj_6gevent_6_queue_ItemWaiter *p = (struct __pyx_obj_6gevent_6_queue_ItemWaiter *)o; + PyObject_GC_UnTrack(o); + Py_CLEAR(p->item); + Py_CLEAR(p->queue); + PyObject_GC_Track(o); + if (likely(__pyx_ptype_6gevent_8__waiter_Waiter)) __pyx_ptype_6gevent_8__waiter_Waiter->tp_dealloc(o); else __Pyx_call_next_tp_dealloc(o, __pyx_tp_dealloc_6gevent_6_queue_ItemWaiter); +} + +static int __pyx_tp_traverse_6gevent_6_queue_ItemWaiter(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_6gevent_6_queue_ItemWaiter *p = (struct __pyx_obj_6gevent_6_queue_ItemWaiter *)o; + e = ((likely(__pyx_ptype_6gevent_8__waiter_Waiter)) ? ((__pyx_ptype_6gevent_8__waiter_Waiter->tp_traverse) ? __pyx_ptype_6gevent_8__waiter_Waiter->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_6gevent_6_queue_ItemWaiter)); if (e) return e; + if (p->item) { + e = (*v)(p->item, a); if (e) return e; + } + if (p->queue) { + e = (*v)(p->queue, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_6gevent_6_queue_ItemWaiter(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_6gevent_6_queue_ItemWaiter *p = (struct __pyx_obj_6gevent_6_queue_ItemWaiter *)o; + if (likely(__pyx_ptype_6gevent_8__waiter_Waiter)) { if (__pyx_ptype_6gevent_8__waiter_Waiter->tp_clear) __pyx_ptype_6gevent_8__waiter_Waiter->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_6gevent_6_queue_ItemWaiter); + tmp = ((PyObject*)p->item); + p->item = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->queue); + p->queue = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyObject *__pyx_getprop_6gevent_6_queue_10ItemWaiter_item(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_6_queue_10ItemWaiter_4item_1__get__(o); +} + +static PyObject *__pyx_getprop_6gevent_6_queue_10ItemWaiter_queue(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_6_queue_10ItemWaiter_5queue_1__get__(o); +} + +static PyMethodDef __pyx_methods_6gevent_6_queue_ItemWaiter[] = { + {"put_and_switch", (PyCFunction)__pyx_pw_6gevent_6_queue_10ItemWaiter_3put_and_switch, METH_NOARGS, __pyx_doc_6gevent_6_queue_10ItemWaiter_2put_and_switch}, + {0, 0, 0, 0} +}; + +static struct PyGetSetDef __pyx_getsets_6gevent_6_queue_ItemWaiter[] = { + {(char *)"item", __pyx_getprop_6gevent_6_queue_10ItemWaiter_item, 0, (char *)0, 0}, + {(char *)"queue", __pyx_getprop_6gevent_6_queue_10ItemWaiter_queue, 0, (char *)0, 0}, + {0, 0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_6gevent_6_queue_ItemWaiter = { + PyVarObject_HEAD_INIT(0, 0) + "gevent._queue.ItemWaiter", /*tp_name*/ + sizeof(struct __pyx_obj_6gevent_6_queue_ItemWaiter), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6gevent_6_queue_ItemWaiter, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + "ItemWaiter(item, queue)", /*tp_doc*/ + __pyx_tp_traverse_6gevent_6_queue_ItemWaiter, /*tp_traverse*/ + __pyx_tp_clear_6gevent_6_queue_ItemWaiter, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6gevent_6_queue_ItemWaiter, /*tp_methods*/ + 0, /*tp_members*/ + __pyx_getsets_6gevent_6_queue_ItemWaiter, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_pw_6gevent_6_queue_10ItemWaiter_1__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6gevent_6_queue_ItemWaiter, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; +static struct __pyx_vtabstruct_6gevent_6_queue_Queue __pyx_vtable_6gevent_6_queue_Queue; + +static PyObject *__pyx_tp_new_6gevent_6_queue_Queue(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + struct __pyx_obj_6gevent_6_queue_Queue *p; + PyObject *o; + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_6gevent_6_queue_Queue *)o); + p->__pyx_vtab = __pyx_vtabptr_6gevent_6_queue_Queue; + p->hub = Py_None; Py_INCREF(Py_None); + p->queue = Py_None; Py_INCREF(Py_None); + p->getters = Py_None; Py_INCREF(Py_None); + p->putters = Py_None; Py_INCREF(Py_None); + p->_event_unlock = Py_None; Py_INCREF(Py_None); + return o; +} + +static void __pyx_tp_dealloc_6gevent_6_queue_Queue(PyObject *o) { + struct __pyx_obj_6gevent_6_queue_Queue *p = (struct __pyx_obj_6gevent_6_queue_Queue *)o; + #if CYTHON_USE_TP_FINALIZE + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + PyObject_GC_UnTrack(o); + if (p->__weakref__) PyObject_ClearWeakRefs(o); + Py_CLEAR(p->hub); + Py_CLEAR(p->queue); + Py_CLEAR(p->getters); + Py_CLEAR(p->putters); + Py_CLEAR(p->_event_unlock); + (*Py_TYPE(o)->tp_free)(o); +} + +static int __pyx_tp_traverse_6gevent_6_queue_Queue(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_6gevent_6_queue_Queue *p = (struct __pyx_obj_6gevent_6_queue_Queue *)o; + if (p->hub) { + e = (*v)(p->hub, a); if (e) return e; + } + if (p->queue) { + e = (*v)(p->queue, a); if (e) return e; + } + if (p->getters) { + e = (*v)(p->getters, a); if (e) return e; + } + if (p->putters) { + e = (*v)(p->putters, a); if (e) return e; + } + if (p->_event_unlock) { + e = (*v)(p->_event_unlock, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_6gevent_6_queue_Queue(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_6gevent_6_queue_Queue *p = (struct __pyx_obj_6gevent_6_queue_Queue *)o; + tmp = ((PyObject*)p->hub); + p->hub = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->queue); + p->queue = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->getters); + p->getters = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->putters); + p->putters = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->_event_unlock); + p->_event_unlock = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyObject *__pyx_getprop_6gevent_6_queue_5Queue_maxsize(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_6_queue_5Queue_7maxsize_1__get__(o); +} + +static int __pyx_setprop_6gevent_6_queue_5Queue_maxsize(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6gevent_6_queue_5Queue_7maxsize_3__set__(o, v); + } + else { + PyErr_SetString(PyExc_NotImplementedError, "__del__"); + return -1; + } +} + +static PyObject *__pyx_getprop_6gevent_6_queue_5Queue_hub(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_6_queue_5Queue_3hub_1__get__(o); +} + +static PyObject *__pyx_getprop_6gevent_6_queue_5Queue_queue(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_6_queue_5Queue_5queue_1__get__(o); +} + +static PyObject *__pyx_specialmethod___pyx_pw_6gevent_6_queue_5Queue_47__next__(PyObject *self, CYTHON_UNUSED PyObject *arg) {return __pyx_pw_6gevent_6_queue_5Queue_47__next__(self);} + +static PyMethodDef __pyx_methods_6gevent_6_queue_Queue[] = { + {"copy", (PyCFunction)__pyx_pw_6gevent_6_queue_5Queue_3copy, METH_NOARGS, __pyx_doc_6gevent_6_queue_5Queue_2copy}, + {"_create_queue", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_6_queue_5Queue_5_create_queue, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_6_queue_5Queue_4_create_queue}, + {"_format", (PyCFunction)__pyx_pw_6gevent_6_queue_5Queue_17_format, METH_NOARGS, __pyx_doc_6gevent_6_queue_5Queue_16_format}, + {"_unlock", (PyCFunction)__pyx_pw_6gevent_6_queue_5Queue_43_unlock, METH_NOARGS, __pyx_doc_6gevent_6_queue_5Queue_42_unlock}, + {"__next__", (PyCFunction)__pyx_specialmethod___pyx_pw_6gevent_6_queue_5Queue_47__next__, METH_NOARGS|METH_COEXIST, 0}, + {0, 0, 0, 0} +}; + +static struct PyGetSetDef __pyx_getsets_6gevent_6_queue_Queue[] = { + {(char *)"maxsize", __pyx_getprop_6gevent_6_queue_5Queue_maxsize, __pyx_setprop_6gevent_6_queue_5Queue_maxsize, (char *)0, 0}, + {(char *)"hub", __pyx_getprop_6gevent_6_queue_5Queue_hub, 0, (char *)0, 0}, + {(char *)"queue", __pyx_getprop_6gevent_6_queue_5Queue_queue, 0, (char *)0, 0}, + {0, 0, 0, 0, 0} +}; + +static PyNumberMethods __pyx_tp_as_number_Queue = { + 0, /*nb_add*/ + 0, /*nb_subtract*/ + 0, /*nb_multiply*/ + #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) + 0, /*nb_divide*/ + #endif + 0, /*nb_remainder*/ + 0, /*nb_divmod*/ + 0, /*nb_power*/ + 0, /*nb_negative*/ + 0, /*nb_positive*/ + 0, /*nb_absolute*/ + __pyx_pw_6gevent_6_queue_5Queue_25__nonzero__, /*nb_nonzero*/ + 0, /*nb_invert*/ + 0, /*nb_lshift*/ + 0, /*nb_rshift*/ + 0, /*nb_and*/ + 0, /*nb_xor*/ + 0, /*nb_or*/ + #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) + 0, /*nb_coerce*/ + #endif + 0, /*nb_int*/ + #if PY_MAJOR_VERSION < 3 + 0, /*nb_long*/ + #else + 0, /*reserved*/ + #endif + 0, /*nb_float*/ + #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) + 0, /*nb_oct*/ + #endif + #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) + 0, /*nb_hex*/ + #endif + 0, /*nb_inplace_add*/ + 0, /*nb_inplace_subtract*/ + 0, /*nb_inplace_multiply*/ + #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) + 0, /*nb_inplace_divide*/ + #endif + 0, /*nb_inplace_remainder*/ + 0, /*nb_inplace_power*/ + 0, /*nb_inplace_lshift*/ + 0, /*nb_inplace_rshift*/ + 0, /*nb_inplace_and*/ + 0, /*nb_inplace_xor*/ + 0, /*nb_inplace_or*/ + 0, /*nb_floor_divide*/ + 0, /*nb_true_divide*/ + 0, /*nb_inplace_floor_divide*/ + 0, /*nb_inplace_true_divide*/ + 0, /*nb_index*/ + #if PY_VERSION_HEX >= 0x03050000 + 0, /*nb_matrix_multiply*/ + #endif + #if PY_VERSION_HEX >= 0x03050000 + 0, /*nb_inplace_matrix_multiply*/ + #endif +}; + +static PySequenceMethods __pyx_tp_as_sequence_Queue = { + __pyx_pw_6gevent_6_queue_5Queue_21__len__, /*sq_length*/ + 0, /*sq_concat*/ + 0, /*sq_repeat*/ + 0, /*sq_item*/ + 0, /*sq_slice*/ + 0, /*sq_ass_item*/ + 0, /*sq_ass_slice*/ + 0, /*sq_contains*/ + 0, /*sq_inplace_concat*/ + 0, /*sq_inplace_repeat*/ +}; + +static PyMappingMethods __pyx_tp_as_mapping_Queue = { + __pyx_pw_6gevent_6_queue_5Queue_21__len__, /*mp_length*/ + 0, /*mp_subscript*/ + 0, /*mp_ass_subscript*/ +}; + +static PyTypeObject __pyx_type_6gevent_6_queue_Queue = { + PyVarObject_HEAD_INIT(0, 0) + "gevent._queue.Queue", /*tp_name*/ + sizeof(struct __pyx_obj_6gevent_6_queue_Queue), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6gevent_6_queue_Queue, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + __pyx_pw_6gevent_6_queue_5Queue_13__repr__, /*tp_repr*/ + &__pyx_tp_as_number_Queue, /*tp_as_number*/ + &__pyx_tp_as_sequence_Queue, /*tp_as_sequence*/ + &__pyx_tp_as_mapping_Queue, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + __pyx_pw_6gevent_6_queue_5Queue_15__str__, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + "Queue(maxsize=None, items=(), _warn_depth=2)\n\n Create a queue object with a given maximum size.\n\n If *maxsize* is less than or equal to zero or ``None``, the queue\n size is infinite.\n\n Queues have a ``len`` equal to the number of items in them (the :meth:`qsize`),\n but in a boolean context they are always True.\n\n .. versionchanged:: 1.1b3\n Queues now support :func:`len`; it behaves the same as :meth:`qsize`.\n .. versionchanged:: 1.1b3\n Multiple greenlets that block on a call to :meth:`put` for a full queue\n will now be awakened to put their items into the queue in the order in which\n they arrived. Likewise, multiple greenlets that block on a call to :meth:`get` for\n an empty queue will now receive items in the order in which they blocked. An\n implementation quirk under CPython *usually* ensured this was roughly the case\n previously anyway, but that wasn't the case for PyPy.\n ", /*tp_doc*/ + __pyx_tp_traverse_6gevent_6_queue_Queue, /*tp_traverse*/ + __pyx_tp_clear_6gevent_6_queue_Queue, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + __pyx_pw_6gevent_6_queue_5Queue_45__iter__, /*tp_iter*/ + __pyx_pw_6gevent_6_queue_5Queue_47__next__, /*tp_iternext*/ + __pyx_methods_6gevent_6_queue_Queue, /*tp_methods*/ + 0, /*tp_members*/ + __pyx_getsets_6gevent_6_queue_Queue, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_pw_6gevent_6_queue_5Queue_1__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6gevent_6_queue_Queue, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; +static struct __pyx_vtabstruct_6gevent_6_queue_UnboundQueue __pyx_vtable_6gevent_6_queue_UnboundQueue; + +static PyObject *__pyx_tp_new_6gevent_6_queue_UnboundQueue(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_6gevent_6_queue_UnboundQueue *p; + PyObject *o = __pyx_tp_new_6gevent_6_queue_Queue(t, a, k); + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_6gevent_6_queue_UnboundQueue *)o); + p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_6gevent_6_queue_Queue*)__pyx_vtabptr_6gevent_6_queue_UnboundQueue; + return o; +} + +static PyMethodDef __pyx_methods_6gevent_6_queue_UnboundQueue[] = { + {0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_6gevent_6_queue_UnboundQueue = { + PyVarObject_HEAD_INIT(0, 0) + "gevent._queue.UnboundQueue", /*tp_name*/ + sizeof(struct __pyx_obj_6gevent_6_queue_UnboundQueue), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6gevent_6_queue_Queue, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_6gevent_6_queue_5Queue_13__repr__, /*tp_repr*/ + #else + 0, /*tp_repr*/ + #endif + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_6gevent_6_queue_5Queue_15__str__, /*tp_str*/ + #else + 0, /*tp_str*/ + #endif + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + "UnboundQueue(maxsize=None, items=())", /*tp_doc*/ + __pyx_tp_traverse_6gevent_6_queue_Queue, /*tp_traverse*/ + __pyx_tp_clear_6gevent_6_queue_Queue, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_6gevent_6_queue_5Queue_45__iter__, /*tp_iter*/ + #else + 0, /*tp_iter*/ + #endif + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_6gevent_6_queue_5Queue_47__next__, /*tp_iternext*/ + #else + 0, /*tp_iternext*/ + #endif + __pyx_methods_6gevent_6_queue_UnboundQueue, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_pw_6gevent_6_queue_12UnboundQueue_1__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6gevent_6_queue_UnboundQueue, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; +static struct __pyx_vtabstruct_6gevent_6_queue_PriorityQueue __pyx_vtable_6gevent_6_queue_PriorityQueue; + +static PyObject *__pyx_tp_new_6gevent_6_queue_PriorityQueue(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_6gevent_6_queue_PriorityQueue *p; + PyObject *o = __pyx_tp_new_6gevent_6_queue_Queue(t, a, k); + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_6gevent_6_queue_PriorityQueue *)o); + p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_6gevent_6_queue_Queue*)__pyx_vtabptr_6gevent_6_queue_PriorityQueue; + return o; +} + +static PyMethodDef __pyx_methods_6gevent_6_queue_PriorityQueue[] = { + {"_create_queue", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_6_queue_13PriorityQueue_1_create_queue, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_6_queue_13PriorityQueue__create_queue}, + {0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_6gevent_6_queue_PriorityQueue = { + PyVarObject_HEAD_INIT(0, 0) + "gevent._queue.PriorityQueue", /*tp_name*/ + sizeof(struct __pyx_obj_6gevent_6_queue_PriorityQueue), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6gevent_6_queue_Queue, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_6gevent_6_queue_5Queue_13__repr__, /*tp_repr*/ + #else + 0, /*tp_repr*/ + #endif + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_6gevent_6_queue_5Queue_15__str__, /*tp_str*/ + #else + 0, /*tp_str*/ + #endif + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + "A subclass of :class:`Queue` that retrieves entries in priority order (lowest first).\n\n Entries are typically tuples of the form: ``(priority number, data)``.\n\n .. versionchanged:: 1.2a1\n Any *items* given to the constructor will now be passed through\n :func:`heapq.heapify` to ensure the invariants of this class hold.\n Previously it was just assumed that they were already a heap.\n ", /*tp_doc*/ + __pyx_tp_traverse_6gevent_6_queue_Queue, /*tp_traverse*/ + __pyx_tp_clear_6gevent_6_queue_Queue, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_6gevent_6_queue_5Queue_45__iter__, /*tp_iter*/ + #else + 0, /*tp_iter*/ + #endif + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_6gevent_6_queue_5Queue_47__next__, /*tp_iternext*/ + #else + 0, /*tp_iternext*/ + #endif + __pyx_methods_6gevent_6_queue_PriorityQueue, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_6gevent_6_queue_5Queue_1__init__, /*tp_init*/ + #else + 0, /*tp_init*/ + #endif + 0, /*tp_alloc*/ + __pyx_tp_new_6gevent_6_queue_PriorityQueue, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; +static struct __pyx_vtabstruct_6gevent_6_queue_LifoQueue __pyx_vtable_6gevent_6_queue_LifoQueue; + +static PyObject *__pyx_tp_new_6gevent_6_queue_LifoQueue(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_6gevent_6_queue_LifoQueue *p; + PyObject *o = __pyx_tp_new_6gevent_6_queue_Queue(t, a, k); + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_6gevent_6_queue_LifoQueue *)o); + p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_6gevent_6_queue_Queue*)__pyx_vtabptr_6gevent_6_queue_LifoQueue; + return o; +} + +static PyMethodDef __pyx_methods_6gevent_6_queue_LifoQueue[] = { + {"_create_queue", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_6_queue_9LifoQueue_1_create_queue, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_6_queue_9LifoQueue__create_queue}, + {0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_6gevent_6_queue_LifoQueue = { + PyVarObject_HEAD_INIT(0, 0) + "gevent._queue.LifoQueue", /*tp_name*/ + sizeof(struct __pyx_obj_6gevent_6_queue_LifoQueue), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6gevent_6_queue_Queue, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_6gevent_6_queue_5Queue_13__repr__, /*tp_repr*/ + #else + 0, /*tp_repr*/ + #endif + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_6gevent_6_queue_5Queue_15__str__, /*tp_str*/ + #else + 0, /*tp_str*/ + #endif + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + "A subclass of :class:`Queue` that retrieves most recently added entries first.", /*tp_doc*/ + __pyx_tp_traverse_6gevent_6_queue_Queue, /*tp_traverse*/ + __pyx_tp_clear_6gevent_6_queue_Queue, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_6gevent_6_queue_5Queue_45__iter__, /*tp_iter*/ + #else + 0, /*tp_iter*/ + #endif + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_6gevent_6_queue_5Queue_47__next__, /*tp_iternext*/ + #else + 0, /*tp_iternext*/ + #endif + __pyx_methods_6gevent_6_queue_LifoQueue, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_6gevent_6_queue_5Queue_1__init__, /*tp_init*/ + #else + 0, /*tp_init*/ + #endif + 0, /*tp_alloc*/ + __pyx_tp_new_6gevent_6_queue_LifoQueue, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; +static struct __pyx_vtabstruct_6gevent_6_queue_JoinableQueue __pyx_vtable_6gevent_6_queue_JoinableQueue; + +static PyObject *__pyx_tp_new_6gevent_6_queue_JoinableQueue(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_6gevent_6_queue_JoinableQueue *p; + PyObject *o = __pyx_tp_new_6gevent_6_queue_Queue(t, a, k); + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_6gevent_6_queue_JoinableQueue *)o); + p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_6gevent_6_queue_Queue*)__pyx_vtabptr_6gevent_6_queue_JoinableQueue; + p->_cond = ((struct __pyx_obj_6gevent_6_event_Event *)Py_None); Py_INCREF(Py_None); + return o; +} + +static void __pyx_tp_dealloc_6gevent_6_queue_JoinableQueue(PyObject *o) { + struct __pyx_obj_6gevent_6_queue_JoinableQueue *p = (struct __pyx_obj_6gevent_6_queue_JoinableQueue *)o; + #if CYTHON_USE_TP_FINALIZE + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + PyObject_GC_UnTrack(o); + Py_CLEAR(p->_cond); + PyObject_GC_Track(o); + __pyx_tp_dealloc_6gevent_6_queue_Queue(o); +} + +static int __pyx_tp_traverse_6gevent_6_queue_JoinableQueue(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_6gevent_6_queue_JoinableQueue *p = (struct __pyx_obj_6gevent_6_queue_JoinableQueue *)o; + e = __pyx_tp_traverse_6gevent_6_queue_Queue(o, v, a); if (e) return e; + if (p->_cond) { + e = (*v)(((PyObject *)p->_cond), a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_6gevent_6_queue_JoinableQueue(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_6gevent_6_queue_JoinableQueue *p = (struct __pyx_obj_6gevent_6_queue_JoinableQueue *)o; + __pyx_tp_clear_6gevent_6_queue_Queue(o); + tmp = ((PyObject*)p->_cond); + p->_cond = ((struct __pyx_obj_6gevent_6_event_Event *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyObject *__pyx_getprop_6gevent_6_queue_13JoinableQueue_unfinished_tasks(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_6_queue_13JoinableQueue_16unfinished_tasks_1__get__(o); +} + +static PyMethodDef __pyx_methods_6gevent_6_queue_JoinableQueue[] = { + {"copy", (PyCFunction)__pyx_pw_6gevent_6_queue_13JoinableQueue_3copy, METH_NOARGS, __pyx_doc_6gevent_6_queue_13JoinableQueue_2copy}, + {"_format", (PyCFunction)__pyx_pw_6gevent_6_queue_13JoinableQueue_5_format, METH_NOARGS, __pyx_doc_6gevent_6_queue_13JoinableQueue_4_format}, + {"task_done", (PyCFunction)__pyx_pw_6gevent_6_queue_13JoinableQueue_9task_done, METH_NOARGS, __pyx_doc_6gevent_6_queue_13JoinableQueue_8task_done}, + {"join", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_6_queue_13JoinableQueue_11join, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_6_queue_13JoinableQueue_10join}, + {0, 0, 0, 0} +}; + +static struct PyGetSetDef __pyx_getsets_6gevent_6_queue_JoinableQueue[] = { + {(char *)"unfinished_tasks", __pyx_getprop_6gevent_6_queue_13JoinableQueue_unfinished_tasks, 0, (char *)0, 0}, + {0, 0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_6gevent_6_queue_JoinableQueue = { + PyVarObject_HEAD_INIT(0, 0) + "gevent._queue.JoinableQueue", /*tp_name*/ + sizeof(struct __pyx_obj_6gevent_6_queue_JoinableQueue), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6gevent_6_queue_JoinableQueue, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_6gevent_6_queue_5Queue_13__repr__, /*tp_repr*/ + #else + 0, /*tp_repr*/ + #endif + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_6gevent_6_queue_5Queue_15__str__, /*tp_str*/ + #else + 0, /*tp_str*/ + #endif + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + "JoinableQueue(maxsize=None, items=(), unfinished_tasks=None)\n\n A subclass of :class:`Queue` that additionally has\n :meth:`task_done` and :meth:`join` methods.\n ", /*tp_doc*/ + __pyx_tp_traverse_6gevent_6_queue_JoinableQueue, /*tp_traverse*/ + __pyx_tp_clear_6gevent_6_queue_JoinableQueue, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_6gevent_6_queue_5Queue_45__iter__, /*tp_iter*/ + #else + 0, /*tp_iter*/ + #endif + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_6gevent_6_queue_5Queue_47__next__, /*tp_iternext*/ + #else + 0, /*tp_iternext*/ + #endif + __pyx_methods_6gevent_6_queue_JoinableQueue, /*tp_methods*/ + 0, /*tp_members*/ + __pyx_getsets_6gevent_6_queue_JoinableQueue, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_pw_6gevent_6_queue_13JoinableQueue_1__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6gevent_6_queue_JoinableQueue, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; +static struct __pyx_vtabstruct_6gevent_6_queue_Channel __pyx_vtable_6gevent_6_queue_Channel; + +static PyObject *__pyx_tp_new_6gevent_6_queue_Channel(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + struct __pyx_obj_6gevent_6_queue_Channel *p; + PyObject *o; + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_6gevent_6_queue_Channel *)o); + p->__pyx_vtab = __pyx_vtabptr_6gevent_6_queue_Channel; + p->getters = Py_None; Py_INCREF(Py_None); + p->putters = Py_None; Py_INCREF(Py_None); + p->hub = Py_None; Py_INCREF(Py_None); + p->_event_unlock = Py_None; Py_INCREF(Py_None); + return o; +} + +static void __pyx_tp_dealloc_6gevent_6_queue_Channel(PyObject *o) { + struct __pyx_obj_6gevent_6_queue_Channel *p = (struct __pyx_obj_6gevent_6_queue_Channel *)o; + #if CYTHON_USE_TP_FINALIZE + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + PyObject_GC_UnTrack(o); + if (p->__weakref__) PyObject_ClearWeakRefs(o); + Py_CLEAR(p->getters); + Py_CLEAR(p->putters); + Py_CLEAR(p->hub); + Py_CLEAR(p->_event_unlock); + (*Py_TYPE(o)->tp_free)(o); +} + +static int __pyx_tp_traverse_6gevent_6_queue_Channel(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_6gevent_6_queue_Channel *p = (struct __pyx_obj_6gevent_6_queue_Channel *)o; + if (p->getters) { + e = (*v)(p->getters, a); if (e) return e; + } + if (p->putters) { + e = (*v)(p->putters, a); if (e) return e; + } + if (p->hub) { + e = (*v)(p->hub, a); if (e) return e; + } + if (p->_event_unlock) { + e = (*v)(p->_event_unlock, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_6gevent_6_queue_Channel(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_6gevent_6_queue_Channel *p = (struct __pyx_obj_6gevent_6_queue_Channel *)o; + tmp = ((PyObject*)p->getters); + p->getters = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->putters); + p->putters = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->hub); + p->hub = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->_event_unlock); + p->_event_unlock = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyObject *__pyx_getprop_6gevent_6_queue_7Channel_balance(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_6_queue_7Channel_7balance_1__get__(o); +} + +static PyObject *__pyx_getprop_6gevent_6_queue_7Channel_getters(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_6_queue_7Channel_7getters_1__get__(o); +} + +static PyObject *__pyx_getprop_6gevent_6_queue_7Channel_putters(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_6_queue_7Channel_7putters_1__get__(o); +} + +static PyObject *__pyx_getprop_6gevent_6_queue_7Channel_hub(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_6_queue_7Channel_3hub_1__get__(o); +} + +static PyObject *__pyx_specialmethod___pyx_pw_6gevent_6_queue_7Channel_27__next__(PyObject *self, CYTHON_UNUSED PyObject *arg) {return __pyx_pw_6gevent_6_queue_7Channel_27__next__(self);} + +static PyMethodDef __pyx_methods_6gevent_6_queue_Channel[] = { + {"_format", (PyCFunction)__pyx_pw_6gevent_6_queue_7Channel_7_format, METH_NOARGS, __pyx_doc_6gevent_6_queue_7Channel_6_format}, + {"qsize", (PyCFunction)__pyx_pw_6gevent_6_queue_7Channel_9qsize, METH_NOARGS, __pyx_doc_6gevent_6_queue_7Channel_8qsize}, + {"empty", (PyCFunction)__pyx_pw_6gevent_6_queue_7Channel_11empty, METH_NOARGS, __pyx_doc_6gevent_6_queue_7Channel_10empty}, + {"full", (PyCFunction)__pyx_pw_6gevent_6_queue_7Channel_13full, METH_NOARGS, __pyx_doc_6gevent_6_queue_7Channel_12full}, + {"put", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_6_queue_7Channel_15put, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_6_queue_7Channel_14put}, + {"put_nowait", (PyCFunction)__pyx_pw_6gevent_6_queue_7Channel_17put_nowait, METH_O, __pyx_doc_6gevent_6_queue_7Channel_16put_nowait}, + {"_unlock", (PyCFunction)__pyx_pw_6gevent_6_queue_7Channel_23_unlock, METH_NOARGS, __pyx_doc_6gevent_6_queue_7Channel_22_unlock}, + {"__next__", (PyCFunction)__pyx_specialmethod___pyx_pw_6gevent_6_queue_7Channel_27__next__, METH_NOARGS|METH_COEXIST, 0}, + {0, 0, 0, 0} +}; + +static struct PyGetSetDef __pyx_getsets_6gevent_6_queue_Channel[] = { + {(char *)"balance", __pyx_getprop_6gevent_6_queue_7Channel_balance, 0, (char *)0, 0}, + {(char *)"getters", __pyx_getprop_6gevent_6_queue_7Channel_getters, 0, (char *)0, 0}, + {(char *)"putters", __pyx_getprop_6gevent_6_queue_7Channel_putters, 0, (char *)0, 0}, + {(char *)"hub", __pyx_getprop_6gevent_6_queue_7Channel_hub, 0, (char *)0, 0}, + {0, 0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_6gevent_6_queue_Channel = { + PyVarObject_HEAD_INIT(0, 0) + "gevent._queue.Channel", /*tp_name*/ + sizeof(struct __pyx_obj_6gevent_6_queue_Channel), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6gevent_6_queue_Channel, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + __pyx_pw_6gevent_6_queue_7Channel_3__repr__, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + __pyx_pw_6gevent_6_queue_7Channel_5__str__, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + "Channel(maxsize=1)", /*tp_doc*/ + __pyx_tp_traverse_6gevent_6_queue_Channel, /*tp_traverse*/ + __pyx_tp_clear_6gevent_6_queue_Channel, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + __pyx_pw_6gevent_6_queue_7Channel_25__iter__, /*tp_iter*/ + __pyx_pw_6gevent_6_queue_7Channel_27__next__, /*tp_iternext*/ + __pyx_methods_6gevent_6_queue_Channel, /*tp_methods*/ + 0, /*tp_members*/ + __pyx_getsets_6gevent_6_queue_Channel, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_pw_6gevent_6_queue_7Channel_1__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6gevent_6_queue_Channel, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static PyMethodDef __pyx_methods[] = { + {0, 0, 0, 0} +}; + +#if PY_MAJOR_VERSION >= 3 +#if CYTHON_PEP489_MULTI_PHASE_INIT +static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ +static int __pyx_pymod_exec__queue(PyObject* module); /*proto*/ +static PyModuleDef_Slot __pyx_moduledef_slots[] = { + {Py_mod_create, (void*)__pyx_pymod_create}, + {Py_mod_exec, (void*)__pyx_pymod_exec__queue}, + {0, NULL} +}; +#endif + +static struct PyModuleDef __pyx_moduledef = { + PyModuleDef_HEAD_INIT, + "_queue", + __pyx_k_Synchronized_queues_The_mod_gev, /* m_doc */ + #if CYTHON_PEP489_MULTI_PHASE_INIT + 0, /* m_size */ + #else + -1, /* m_size */ + #endif + __pyx_methods /* m_methods */, + #if CYTHON_PEP489_MULTI_PHASE_INIT + __pyx_moduledef_slots, /* m_slots */ + #else + NULL, /* m_reload */ + #endif + NULL, /* m_traverse */ + NULL, /* m_clear */ + NULL /* m_free */ +}; +#endif +#ifndef CYTHON_SMALL_CODE +#if defined(__clang__) + #define CYTHON_SMALL_CODE +#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) + #define CYTHON_SMALL_CODE __attribute__((cold)) +#else + #define CYTHON_SMALL_CODE +#endif +#endif + +static __Pyx_StringTabEntry __pyx_string_tab[] = { + {&__pyx_n_s_Channel, __pyx_k_Channel, sizeof(__pyx_k_Channel), 0, 0, 1, 1}, + {&__pyx_n_s_Channel__format, __pyx_k_Channel__format, sizeof(__pyx_k_Channel__format), 0, 0, 1, 1}, + {&__pyx_n_s_Channel__unlock, __pyx_k_Channel__unlock, sizeof(__pyx_k_Channel__unlock), 0, 0, 1, 1}, + {&__pyx_n_s_Channel_empty, __pyx_k_Channel_empty, sizeof(__pyx_k_Channel_empty), 0, 0, 1, 1}, + {&__pyx_n_s_Channel_full, __pyx_k_Channel_full, sizeof(__pyx_k_Channel_full), 0, 0, 1, 1}, + {&__pyx_n_s_Channel_get, __pyx_k_Channel_get, sizeof(__pyx_k_Channel_get), 0, 0, 1, 1}, + {&__pyx_n_s_Channel_get_nowait, __pyx_k_Channel_get_nowait, sizeof(__pyx_k_Channel_get_nowait), 0, 0, 1, 1}, + {&__pyx_n_s_Channel_put, __pyx_k_Channel_put, sizeof(__pyx_k_Channel_put), 0, 0, 1, 1}, + {&__pyx_n_s_Channel_put_nowait, __pyx_k_Channel_put_nowait, sizeof(__pyx_k_Channel_put_nowait), 0, 0, 1, 1}, + {&__pyx_n_s_Channel_qsize, __pyx_k_Channel_qsize, sizeof(__pyx_k_Channel_qsize), 0, 0, 1, 1}, + {&__pyx_kp_s_Channels_have_a_maxsize_of_1, __pyx_k_Channels_have_a_maxsize_of_1, sizeof(__pyx_k_Channels_have_a_maxsize_of_1), 0, 0, 1, 0}, + {&__pyx_n_s_DeprecationWarning, __pyx_k_DeprecationWarning, sizeof(__pyx_k_DeprecationWarning), 0, 0, 1, 1}, + {&__pyx_n_s_Empty, __pyx_k_Empty, sizeof(__pyx_k_Empty), 0, 0, 1, 1}, + {&__pyx_n_s_Event, __pyx_k_Event, sizeof(__pyx_k_Event), 0, 0, 1, 1}, + {&__pyx_n_s_Full, __pyx_k_Full, sizeof(__pyx_k_Full), 0, 0, 1, 1}, + {&__pyx_n_s_InvalidSwitchError, __pyx_k_InvalidSwitchError, sizeof(__pyx_k_InvalidSwitchError), 0, 0, 1, 1}, + {&__pyx_kp_s_Invalid_switch_into_Channel_put, __pyx_k_Invalid_switch_into_Channel_put, sizeof(__pyx_k_Invalid_switch_into_Channel_put), 0, 0, 1, 0}, + {&__pyx_kp_s_Invalid_switch_into_Queue_get_r, __pyx_k_Invalid_switch_into_Queue_get_r, sizeof(__pyx_k_Invalid_switch_into_Queue_get_r), 0, 0, 1, 0}, + {&__pyx_kp_s_Invalid_switch_into_Queue_put_r, __pyx_k_Invalid_switch_into_Queue_put_r, sizeof(__pyx_k_Invalid_switch_into_Queue_put_r), 0, 0, 1, 0}, + {&__pyx_n_s_ItemWaiter, __pyx_k_ItemWaiter, sizeof(__pyx_k_ItemWaiter), 0, 0, 1, 1}, + {&__pyx_n_s_ItemWaiter_put_and_switch, __pyx_k_ItemWaiter_put_and_switch, sizeof(__pyx_k_ItemWaiter_put_and_switch), 0, 0, 1, 1}, + {&__pyx_n_s_JoinableQueue, __pyx_k_JoinableQueue, sizeof(__pyx_k_JoinableQueue), 0, 0, 1, 1}, + {&__pyx_n_s_JoinableQueue__format, __pyx_k_JoinableQueue__format, sizeof(__pyx_k_JoinableQueue__format), 0, 0, 1, 1}, + {&__pyx_n_s_JoinableQueue__put, __pyx_k_JoinableQueue__put, sizeof(__pyx_k_JoinableQueue__put), 0, 0, 1, 1}, + {&__pyx_n_s_JoinableQueue_copy, __pyx_k_JoinableQueue_copy, sizeof(__pyx_k_JoinableQueue_copy), 0, 0, 1, 1}, + {&__pyx_n_s_JoinableQueue_join, __pyx_k_JoinableQueue_join, sizeof(__pyx_k_JoinableQueue_join), 0, 0, 1, 1}, + {&__pyx_n_s_JoinableQueue_task_done, __pyx_k_JoinableQueue_task_done, sizeof(__pyx_k_JoinableQueue_task_done), 0, 0, 1, 1}, + {&__pyx_n_s_LifoQueue, __pyx_k_LifoQueue, sizeof(__pyx_k_LifoQueue), 0, 0, 1, 1}, + {&__pyx_n_s_LifoQueue__create_queue, __pyx_k_LifoQueue__create_queue, sizeof(__pyx_k_LifoQueue__create_queue), 0, 0, 1, 1}, + {&__pyx_n_s_LifoQueue__get, __pyx_k_LifoQueue__get, sizeof(__pyx_k_LifoQueue__get), 0, 0, 1, 1}, + {&__pyx_n_s_LifoQueue__peek, __pyx_k_LifoQueue__peek, sizeof(__pyx_k_LifoQueue__peek), 0, 0, 1, 1}, + {&__pyx_n_s_LifoQueue__put, __pyx_k_LifoQueue__put, sizeof(__pyx_k_LifoQueue__put), 0, 0, 1, 1}, + {&__pyx_n_s_PriorityQueue, __pyx_k_PriorityQueue, sizeof(__pyx_k_PriorityQueue), 0, 0, 1, 1}, + {&__pyx_n_s_PriorityQueue__create_queue, __pyx_k_PriorityQueue__create_queue, sizeof(__pyx_k_PriorityQueue__create_queue), 0, 0, 1, 1}, + {&__pyx_n_s_PriorityQueue__get, __pyx_k_PriorityQueue__get, sizeof(__pyx_k_PriorityQueue__get), 0, 0, 1, 1}, + {&__pyx_n_s_PriorityQueue__put, __pyx_k_PriorityQueue__put, sizeof(__pyx_k_PriorityQueue__put), 0, 0, 1, 1}, + {&__pyx_n_s_PySimpleQueue, __pyx_k_PySimpleQueue, sizeof(__pyx_k_PySimpleQueue), 0, 0, 1, 1}, + {&__pyx_n_s_Queue, __pyx_k_Queue, sizeof(__pyx_k_Queue), 0, 0, 1, 1}, + {&__pyx_kp_s_Queue_0_now_equivalent_to_Queue, __pyx_k_Queue_0_now_equivalent_to_Queue, sizeof(__pyx_k_Queue_0_now_equivalent_to_Queue), 0, 0, 1, 0}, + {&__pyx_n_s_Queue__create_queue, __pyx_k_Queue__create_queue, sizeof(__pyx_k_Queue__create_queue), 0, 0, 1, 1}, + {&__pyx_n_s_Queue__format, __pyx_k_Queue__format, sizeof(__pyx_k_Queue__format), 0, 0, 1, 1}, + {&__pyx_n_s_Queue__get, __pyx_k_Queue__get, sizeof(__pyx_k_Queue__get), 0, 0, 1, 1}, + {&__pyx_n_s_Queue__peek, __pyx_k_Queue__peek, sizeof(__pyx_k_Queue__peek), 0, 0, 1, 1}, + {&__pyx_n_s_Queue__put, __pyx_k_Queue__put, sizeof(__pyx_k_Queue__put), 0, 0, 1, 1}, + {&__pyx_n_s_Queue__unlock, __pyx_k_Queue__unlock, sizeof(__pyx_k_Queue__unlock), 0, 0, 1, 1}, + {&__pyx_n_s_Queue_copy, __pyx_k_Queue_copy, sizeof(__pyx_k_Queue_copy), 0, 0, 1, 1}, + {&__pyx_n_s_Queue_empty, __pyx_k_Queue_empty, sizeof(__pyx_k_Queue_empty), 0, 0, 1, 1}, + {&__pyx_n_s_Queue_full, __pyx_k_Queue_full, sizeof(__pyx_k_Queue_full), 0, 0, 1, 1}, + {&__pyx_n_s_Queue_get, __pyx_k_Queue_get, sizeof(__pyx_k_Queue_get), 0, 0, 1, 1}, + {&__pyx_n_s_Queue_get_nowait, __pyx_k_Queue_get_nowait, sizeof(__pyx_k_Queue_get_nowait), 0, 0, 1, 1}, + {&__pyx_n_s_Queue_peek, __pyx_k_Queue_peek, sizeof(__pyx_k_Queue_peek), 0, 0, 1, 1}, + {&__pyx_n_s_Queue_peek_nowait, __pyx_k_Queue_peek_nowait, sizeof(__pyx_k_Queue_peek_nowait), 0, 0, 1, 1}, + {&__pyx_n_s_Queue_put, __pyx_k_Queue_put, sizeof(__pyx_k_Queue_put), 0, 0, 1, 1}, + {&__pyx_n_s_Queue_put_nowait, __pyx_k_Queue_put_nowait, sizeof(__pyx_k_Queue_put_nowait), 0, 0, 1, 1}, + {&__pyx_n_s_Queue_qsize, __pyx_k_Queue_qsize, sizeof(__pyx_k_Queue_qsize), 0, 0, 1, 1}, + {&__pyx_n_s_SimpleQueue, __pyx_k_SimpleQueue, sizeof(__pyx_k_SimpleQueue), 0, 0, 1, 1}, + {&__pyx_n_s_StopIteration, __pyx_k_StopIteration, sizeof(__pyx_k_StopIteration), 0, 0, 1, 1}, + {&__pyx_n_s_Timeout, __pyx_k_Timeout, sizeof(__pyx_k_Timeout), 0, 0, 1, 1}, + {&__pyx_n_s_UnboundQueue, __pyx_k_UnboundQueue, sizeof(__pyx_k_UnboundQueue), 0, 0, 1, 1}, + {&__pyx_kp_s_UnboundQueue_has_no_maxsize, __pyx_k_UnboundQueue_has_no_maxsize, sizeof(__pyx_k_UnboundQueue_has_no_maxsize), 0, 0, 1, 0}, + {&__pyx_n_s_UnboundQueue_put, __pyx_k_UnboundQueue_put, sizeof(__pyx_k_UnboundQueue_put), 0, 0, 1, 1}, + {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1}, + {&__pyx_n_s_Waiter, __pyx_k_Waiter, sizeof(__pyx_k_Waiter), 0, 0, 1, 1}, + {&__pyx_kp_s__2, __pyx_k__2, sizeof(__pyx_k__2), 0, 0, 1, 0}, + {&__pyx_kp_s__3, __pyx_k__3, sizeof(__pyx_k__3), 0, 0, 1, 0}, + {&__pyx_n_s_all, __pyx_k_all, sizeof(__pyx_k_all), 0, 0, 1, 1}, + {&__pyx_n_s_append, __pyx_k_append, sizeof(__pyx_k_append), 0, 0, 1, 1}, + {&__pyx_n_s_block, __pyx_k_block, sizeof(__pyx_k_block), 0, 0, 1, 1}, + {&__pyx_n_s_cancel, __pyx_k_cancel, sizeof(__pyx_k_cancel), 0, 0, 1, 1}, + {&__pyx_n_s_clear, __pyx_k_clear, sizeof(__pyx_k_clear), 0, 0, 1, 1}, + {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, + {&__pyx_n_s_close, __pyx_k_close, sizeof(__pyx_k_close), 0, 0, 1, 1}, + {&__pyx_n_s_collections, __pyx_k_collections, sizeof(__pyx_k_collections), 0, 0, 1, 1}, + {&__pyx_n_s_cond, __pyx_k_cond, sizeof(__pyx_k_cond), 0, 0, 1, 1}, + {&__pyx_n_s_copy, __pyx_k_copy, sizeof(__pyx_k_copy), 0, 0, 1, 1}, + {&__pyx_n_s_create_queue, __pyx_k_create_queue, sizeof(__pyx_k_create_queue), 0, 0, 1, 1}, + {&__pyx_n_s_deque, __pyx_k_deque, sizeof(__pyx_k_deque), 0, 0, 1, 1}, + {&__pyx_n_s_empty, __pyx_k_empty, sizeof(__pyx_k_empty), 0, 0, 1, 1}, + {&__pyx_n_s_event_unlock, __pyx_k_event_unlock, sizeof(__pyx_k_event_unlock), 0, 0, 1, 1}, + {&__pyx_n_s_exc_info, __pyx_k_exc_info, sizeof(__pyx_k_exc_info), 0, 0, 1, 1}, + {&__pyx_n_s_extensions, __pyx_k_extensions, sizeof(__pyx_k_extensions), 0, 0, 1, 1}, + {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1}, + {&__pyx_n_s_full, __pyx_k_full, sizeof(__pyx_k_full), 0, 0, 1, 1}, + {&__pyx_n_s_get, __pyx_k_get, sizeof(__pyx_k_get), 0, 0, 1, 1}, + {&__pyx_n_s_get_2, __pyx_k_get_2, sizeof(__pyx_k_get_2), 0, 0, 1, 1}, + {&__pyx_n_s_get_hub, __pyx_k_get_hub, sizeof(__pyx_k_get_hub), 0, 0, 1, 1}, + {&__pyx_n_s_get_hub_noargs, __pyx_k_get_hub_noargs, sizeof(__pyx_k_get_hub_noargs), 0, 0, 1, 1}, + {&__pyx_n_s_get_nowait, __pyx_k_get_nowait, sizeof(__pyx_k_get_nowait), 0, 0, 1, 1}, + {&__pyx_n_s_getcurrent, __pyx_k_getcurrent, sizeof(__pyx_k_getcurrent), 0, 0, 1, 1}, + {&__pyx_n_s_getter, __pyx_k_getter, sizeof(__pyx_k_getter), 0, 0, 1, 1}, + {&__pyx_n_s_getters, __pyx_k_getters, sizeof(__pyx_k_getters), 0, 0, 1, 1}, + {&__pyx_kp_s_getters_s, __pyx_k_getters_s, sizeof(__pyx_k_getters_s), 0, 0, 1, 0}, + {&__pyx_kp_s_getters_s_2, __pyx_k_getters_s_2, sizeof(__pyx_k_getters_s_2), 0, 0, 1, 0}, + {&__pyx_n_s_gevent, __pyx_k_gevent, sizeof(__pyx_k_gevent), 0, 0, 1, 1}, + {&__pyx_n_s_gevent__hub_local, __pyx_k_gevent__hub_local, sizeof(__pyx_k_gevent__hub_local), 0, 0, 1, 1}, + {&__pyx_n_s_gevent__queue, __pyx_k_gevent__queue, sizeof(__pyx_k_gevent__queue), 0, 0, 1, 1}, + {&__pyx_n_s_gevent__util, __pyx_k_gevent__util, sizeof(__pyx_k_gevent__util), 0, 0, 1, 1}, + {&__pyx_n_s_gevent__waiter, __pyx_k_gevent__waiter, sizeof(__pyx_k_gevent__waiter), 0, 0, 1, 1}, + {&__pyx_n_s_gevent_event, __pyx_k_gevent_event, sizeof(__pyx_k_gevent_event), 0, 0, 1, 1}, + {&__pyx_n_s_gevent_exceptions, __pyx_k_gevent_exceptions, sizeof(__pyx_k_gevent_exceptions), 0, 0, 1, 1}, + {&__pyx_n_s_gevent_timeout, __pyx_k_gevent_timeout, sizeof(__pyx_k_gevent_timeout), 0, 0, 1, 1}, + {&__pyx_n_s_greenlet, __pyx_k_greenlet, sizeof(__pyx_k_greenlet), 0, 0, 1, 1}, + {&__pyx_n_s_heapify, __pyx_k_heapify, sizeof(__pyx_k_heapify), 0, 0, 1, 1}, + {&__pyx_n_s_heapify_2, __pyx_k_heapify_2, sizeof(__pyx_k_heapify_2), 0, 0, 1, 1}, + {&__pyx_n_s_heappop, __pyx_k_heappop, sizeof(__pyx_k_heappop), 0, 0, 1, 1}, + {&__pyx_n_s_heappop_2, __pyx_k_heappop_2, sizeof(__pyx_k_heappop_2), 0, 0, 1, 1}, + {&__pyx_n_s_heappush, __pyx_k_heappush, sizeof(__pyx_k_heappush), 0, 0, 1, 1}, + {&__pyx_n_s_heappush_2, __pyx_k_heappush_2, sizeof(__pyx_k_heappush_2), 0, 0, 1, 1}, + {&__pyx_n_s_heapq, __pyx_k_heapq, sizeof(__pyx_k_heapq), 0, 0, 1, 1}, + {&__pyx_n_s_hex, __pyx_k_hex, sizeof(__pyx_k_hex), 0, 0, 1, 1}, + {&__pyx_n_s_hub, __pyx_k_hub, sizeof(__pyx_k_hub), 0, 0, 1, 1}, + {&__pyx_n_s_id, __pyx_k_id, sizeof(__pyx_k_id), 0, 0, 1, 1}, + {&__pyx_n_s_implements, __pyx_k_implements, sizeof(__pyx_k_implements), 0, 0, 1, 1}, + {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, + {&__pyx_n_s_import_c_accel, __pyx_k_import_c_accel, sizeof(__pyx_k_import_c_accel), 0, 0, 1, 1}, + {&__pyx_n_s_imports, __pyx_k_imports, sizeof(__pyx_k_imports), 0, 0, 1, 1}, + {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1}, + {&__pyx_n_s_item, __pyx_k_item, sizeof(__pyx_k_item), 0, 0, 1, 1}, + {&__pyx_n_s_items, __pyx_k_items, sizeof(__pyx_k_items), 0, 0, 1, 1}, + {&__pyx_n_s_join, __pyx_k_join, sizeof(__pyx_k_join), 0, 0, 1, 1}, + {&__pyx_n_s_loop, __pyx_k_loop, sizeof(__pyx_k_loop), 0, 0, 1, 1}, + {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, + {&__pyx_n_s_maxsize, __pyx_k_maxsize, sizeof(__pyx_k_maxsize), 0, 0, 1, 1}, + {&__pyx_n_s_maxsize_2, __pyx_k_maxsize_2, sizeof(__pyx_k_maxsize_2), 0, 0, 1, 1}, + {&__pyx_kp_s_maxsize_r, __pyx_k_maxsize_r, sizeof(__pyx_k_maxsize_r), 0, 0, 1, 0}, + {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, + {&__pyx_n_s_next, __pyx_k_next, sizeof(__pyx_k_next), 0, 0, 1, 1}, + {&__pyx_n_s_next_2, __pyx_k_next_2, sizeof(__pyx_k_next_2), 0, 0, 1, 1}, + {&__pyx_n_s_peek, __pyx_k_peek, sizeof(__pyx_k_peek), 0, 0, 1, 1}, + {&__pyx_n_s_peek_2, __pyx_k_peek_2, sizeof(__pyx_k_peek_2), 0, 0, 1, 1}, + {&__pyx_n_s_peek_nowait, __pyx_k_peek_nowait, sizeof(__pyx_k_peek_nowait), 0, 0, 1, 1}, + {&__pyx_n_s_pop, __pyx_k_pop, sizeof(__pyx_k_pop), 0, 0, 1, 1}, + {&__pyx_n_s_popleft, __pyx_k_popleft, sizeof(__pyx_k_popleft), 0, 0, 1, 1}, + {&__pyx_n_s_put, __pyx_k_put, sizeof(__pyx_k_put), 0, 0, 1, 1}, + {&__pyx_n_s_put_2, __pyx_k_put_2, sizeof(__pyx_k_put_2), 0, 0, 1, 1}, + {&__pyx_n_s_put_and_switch, __pyx_k_put_and_switch, sizeof(__pyx_k_put_and_switch), 0, 0, 1, 1}, + {&__pyx_n_s_put_nowait, __pyx_k_put_nowait, sizeof(__pyx_k_put_nowait), 0, 0, 1, 1}, + {&__pyx_n_s_putter, __pyx_k_putter, sizeof(__pyx_k_putter), 0, 0, 1, 1}, + {&__pyx_n_s_putters, __pyx_k_putters, sizeof(__pyx_k_putters), 0, 0, 1, 1}, + {&__pyx_kp_s_putters_s, __pyx_k_putters_s, sizeof(__pyx_k_putters_s), 0, 0, 1, 0}, + {&__pyx_kp_s_putters_s_2, __pyx_k_putters_s_2, sizeof(__pyx_k_putters_s_2), 0, 0, 1, 0}, + {&__pyx_n_s_pyx_capi, __pyx_k_pyx_capi, sizeof(__pyx_k_pyx_capi), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1}, + {&__pyx_n_s_q, __pyx_k_q, sizeof(__pyx_k_q), 0, 0, 1, 1}, + {&__pyx_n_s_qsize, __pyx_k_qsize, sizeof(__pyx_k_qsize), 0, 0, 1, 1}, + {&__pyx_n_s_queue, __pyx_k_queue, sizeof(__pyx_k_queue), 0, 0, 1, 1}, + {&__pyx_n_s_queue_2, __pyx_k_queue_2, sizeof(__pyx_k_queue_2), 0, 0, 1, 1}, + {&__pyx_kp_s_queue_r, __pyx_k_queue_r, sizeof(__pyx_k_queue_r), 0, 0, 1, 0}, + {&__pyx_n_s_remove, __pyx_k_remove, sizeof(__pyx_k_remove), 0, 0, 1, 1}, + {&__pyx_n_s_repeat, __pyx_k_repeat, sizeof(__pyx_k_repeat), 0, 0, 1, 1}, + {&__pyx_n_s_result, __pyx_k_result, sizeof(__pyx_k_result), 0, 0, 1, 1}, + {&__pyx_n_s_run_callback, __pyx_k_run_callback, sizeof(__pyx_k_run_callback), 0, 0, 1, 1}, + {&__pyx_kp_s_s_at_s_s, __pyx_k_s_at_s_s, sizeof(__pyx_k_s_at_s_s), 0, 0, 1, 0}, + {&__pyx_kp_s_s_at_s_s_2, __pyx_k_s_at_s_s_2, sizeof(__pyx_k_s_at_s_s_2), 0, 0, 1, 0}, + {&__pyx_kp_s_s_s, __pyx_k_s_s, sizeof(__pyx_k_s_s), 0, 0, 1, 0}, + {&__pyx_kp_s_s_s_2, __pyx_k_s_s_2, sizeof(__pyx_k_s_s_2), 0, 0, 1, 0}, + {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1}, + {&__pyx_n_s_set, __pyx_k_set, sizeof(__pyx_k_set), 0, 0, 1, 1}, + {&__pyx_n_s_slots, __pyx_k_slots, sizeof(__pyx_k_slots), 0, 0, 1, 1}, + {&__pyx_kp_s_src_gevent_queue_py, __pyx_k_src_gevent_queue_py, sizeof(__pyx_k_src_gevent_queue_py), 0, 0, 1, 0}, + {&__pyx_n_s_stacklevel, __pyx_k_stacklevel, sizeof(__pyx_k_stacklevel), 0, 0, 1, 1}, + {&__pyx_n_s_start_new_or_dummy, __pyx_k_start_new_or_dummy, sizeof(__pyx_k_start_new_or_dummy), 0, 0, 1, 1}, + {&__pyx_n_s_switch, __pyx_k_switch, sizeof(__pyx_k_switch), 0, 0, 1, 1}, + {&__pyx_n_s_sys, __pyx_k_sys, sizeof(__pyx_k_sys), 0, 0, 1, 1}, + {&__pyx_n_s_task_done, __pyx_k_task_done, sizeof(__pyx_k_task_done), 0, 0, 1, 1}, + {&__pyx_kp_s_task_done_called_too_many_times, __pyx_k_task_done_called_too_many_times, sizeof(__pyx_k_task_done_called_too_many_times), 0, 0, 1, 0}, + {&__pyx_kp_s_tasks_s__cond_s, __pyx_k_tasks_s__cond_s, sizeof(__pyx_k_tasks_s__cond_s), 0, 0, 1, 0}, + {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, + {&__pyx_n_s_throw, __pyx_k_throw, sizeof(__pyx_k_throw), 0, 0, 1, 1}, + {&__pyx_n_s_timeout, __pyx_k_timeout, sizeof(__pyx_k_timeout), 0, 0, 1, 1}, + {&__pyx_n_s_unfinished_tasks, __pyx_k_unfinished_tasks, sizeof(__pyx_k_unfinished_tasks), 0, 0, 1, 1}, + {&__pyx_n_s_unlock, __pyx_k_unlock, sizeof(__pyx_k_unlock), 0, 0, 1, 1}, + {&__pyx_n_s_version_info, __pyx_k_version_info, sizeof(__pyx_k_version_info), 0, 0, 1, 1}, + {&__pyx_n_s_wait, __pyx_k_wait, sizeof(__pyx_k_wait), 0, 0, 1, 1}, + {&__pyx_n_s_waiter, __pyx_k_waiter, sizeof(__pyx_k_waiter), 0, 0, 1, 1}, + {&__pyx_n_s_waiter_2, __pyx_k_waiter_2, sizeof(__pyx_k_waiter_2), 0, 0, 1, 1}, + {&__pyx_n_s_warn, __pyx_k_warn, sizeof(__pyx_k_warn), 0, 0, 1, 1}, + {&__pyx_n_s_warn_depth, __pyx_k_warn_depth, sizeof(__pyx_k_warn_depth), 0, 0, 1, 1}, + {&__pyx_n_s_warnings, __pyx_k_warnings, sizeof(__pyx_k_warnings), 0, 0, 1, 1}, + {&__pyx_n_s_weakref, __pyx_k_weakref, sizeof(__pyx_k_weakref), 0, 0, 1, 1}, + {0, 0, 0, 0, 0, 0, 0} +}; +static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { + __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 69, __pyx_L1_error) + __pyx_builtin_DeprecationWarning = __Pyx_GetBuiltinName(__pyx_n_s_DeprecationWarning); if (!__pyx_builtin_DeprecationWarning) __PYX_ERR(0, 130, __pyx_L1_error) + __pyx_builtin_hex = __Pyx_GetBuiltinName(__pyx_n_s_hex); if (!__pyx_builtin_hex) __PYX_ERR(0, 181, __pyx_L1_error) + __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(0, 181, __pyx_L1_error) + __pyx_builtin_StopIteration = __Pyx_GetBuiltinName(__pyx_n_s_StopIteration); if (!__pyx_builtin_StopIteration) __PYX_ERR(0, 406, __pyx_L1_error) + return 0; + __pyx_L1_error:; + return -1; +} + +static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); + + /* "src/gevent/queue.py":128 + * if maxsize == 0: + * import warnings + * warnings.warn( # <<<<<<<<<<<<<< + * 'Queue(0) now equivalent to Queue(None); if you want a channel, use Channel', + * DeprecationWarning, + */ + __pyx_tuple_ = PyTuple_Pack(2, __pyx_kp_s_Queue_0_now_equivalent_to_Queue, __pyx_builtin_DeprecationWarning); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 128, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple_); + __Pyx_GIVEREF(__pyx_tuple_); + + /* "src/gevent/queue.py":421 + * def __init__(self, maxsize=None, items=()): + * if maxsize is not None: + * raise ValueError("UnboundQueue has no maxsize") # <<<<<<<<<<<<<< + * Queue.__init__(self, maxsize, items) + * self.putters = None # Will never be used. + */ + __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s_UnboundQueue_has_no_maxsize); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 421, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__4); + __Pyx_GIVEREF(__pyx_tuple__4); + + /* "src/gevent/queue.py":535 + * ''' + * if self.unfinished_tasks <= 0: + * raise ValueError('task_done() called too many times') # <<<<<<<<<<<<<< + * self.unfinished_tasks -= 1 + * if self.unfinished_tasks == 0: + */ + __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_s_task_done_called_too_many_times); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 535, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__5); + __Pyx_GIVEREF(__pyx_tuple__5); + + /* "src/gevent/queue.py":573 + * # We take maxsize to simplify certain kinds of code + * if maxsize != 1: + * raise ValueError("Channels have a maxsize of 1") # <<<<<<<<<<<<<< + * self.getters = collections.deque() + * self.putters = collections.deque() + */ + __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_s_Channels_have_a_maxsize_of_1); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 573, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__6); + __Pyx_GIVEREF(__pyx_tuple__6); + + /* "src/gevent/queue.py":78 + * # pylint:disable=assigning-non-slot + * __slots__ = ( + * 'item', # <<<<<<<<<<<<<< + * 'queue', + * ) + */ + __pyx_tuple__7 = PyTuple_Pack(2, __pyx_n_s_item, __pyx_n_s_queue); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 78, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__7); + __Pyx_GIVEREF(__pyx_tuple__7); + + /* "src/gevent/queue.py":87 + * self.queue = queue + * + * def put_and_switch(self): # <<<<<<<<<<<<<< + * self.queue._put(self.item) + * self.queue = None + */ + __pyx_tuple__8 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 87, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__8); + __Pyx_GIVEREF(__pyx_tuple__8); + __pyx_codeobj__9 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__8, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_queue_py, __pyx_n_s_put_and_switch, 87, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__9)) __PYX_ERR(0, 87, __pyx_L1_error) + + /* "src/gevent/queue.py":115 + * + * __slots__ = ( + * '_maxsize', # <<<<<<<<<<<<<< + * 'getters', + * 'putters', + */ + __pyx_tuple__10 = PyTuple_Pack(7, __pyx_n_s_maxsize_2, __pyx_n_s_getters, __pyx_n_s_putters, __pyx_n_s_hub, __pyx_n_s_event_unlock, __pyx_n_s_queue, __pyx_n_s_weakref); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 115, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__10); + __Pyx_GIVEREF(__pyx_tuple__10); + + /* "src/gevent/queue.py":165 + * self._maxsize = nv + * + * def copy(self): # <<<<<<<<<<<<<< + * return type(self)(self.maxsize, self.queue) + * + */ + __pyx_tuple__11 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 165, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__11); + __Pyx_GIVEREF(__pyx_tuple__11); + __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__11, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_queue_py, __pyx_n_s_copy, 165, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(0, 165, __pyx_L1_error) + + /* "src/gevent/queue.py":168 + * return type(self)(self.maxsize, self.queue) + * + * def _create_queue(self, items=()): # <<<<<<<<<<<<<< + * return collections.deque(items) + * + */ + __pyx_tuple__13 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_items); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 168, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__13); + __Pyx_GIVEREF(__pyx_tuple__13); + __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__13, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_queue_py, __pyx_n_s_create_queue, 168, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__14)) __PYX_ERR(0, 168, __pyx_L1_error) + + /* "src/gevent/queue.py":171 + * return collections.deque(items) + * + * def _get(self): # <<<<<<<<<<<<<< + * return self.queue.popleft() + * + */ + __pyx_tuple__15 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(0, 171, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__15); + __Pyx_GIVEREF(__pyx_tuple__15); + __pyx_codeobj__16 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__15, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_queue_py, __pyx_n_s_get, 171, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__16)) __PYX_ERR(0, 171, __pyx_L1_error) + + /* "src/gevent/queue.py":174 + * return self.queue.popleft() + * + * def _peek(self): # <<<<<<<<<<<<<< + * return self.queue[0] + * + */ + __pyx_tuple__17 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(0, 174, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__17); + __Pyx_GIVEREF(__pyx_tuple__17); + __pyx_codeobj__18 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__17, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_queue_py, __pyx_n_s_peek, 174, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__18)) __PYX_ERR(0, 174, __pyx_L1_error) + + /* "src/gevent/queue.py":177 + * return self.queue[0] + * + * def _put(self, item): # <<<<<<<<<<<<<< + * self.queue.append(item) + * + */ + __pyx_tuple__19 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_item); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(0, 177, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__19); + __Pyx_GIVEREF(__pyx_tuple__19); + __pyx_codeobj__20 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__19, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_queue_py, __pyx_n_s_put, 177, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__20)) __PYX_ERR(0, 177, __pyx_L1_error) + + /* "src/gevent/queue.py":186 + * return '<%s%s>' % (type(self).__name__, self._format()) + * + * def _format(self): # <<<<<<<<<<<<<< + * result = [] + * if self.maxsize is not None: + */ + __pyx_tuple__21 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_result); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(0, 186, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__21); + __Pyx_GIVEREF(__pyx_tuple__21); + __pyx_codeobj__22 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__21, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_queue_py, __pyx_n_s_format, 186, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__22)) __PYX_ERR(0, 186, __pyx_L1_error) + + /* "src/gevent/queue.py":200 + * return '' + * + * def qsize(self): # <<<<<<<<<<<<<< + * """Return the size of the queue.""" + * return len(self.queue) + */ + __pyx_tuple__23 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(0, 200, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__23); + __Pyx_GIVEREF(__pyx_tuple__23); + __pyx_codeobj__24 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__23, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_queue_py, __pyx_n_s_qsize, 200, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__24)) __PYX_ERR(0, 200, __pyx_L1_error) + + /* "src/gevent/queue.py":232 + * return True + * + * def empty(self): # <<<<<<<<<<<<<< + * """Return ``True`` if the queue is empty, ``False`` otherwise.""" + * return not self.qsize() + */ + __pyx_tuple__25 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(0, 232, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__25); + __Pyx_GIVEREF(__pyx_tuple__25); + __pyx_codeobj__26 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__25, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_queue_py, __pyx_n_s_empty, 232, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__26)) __PYX_ERR(0, 232, __pyx_L1_error) + + /* "src/gevent/queue.py":236 + * return not self.qsize() + * + * def full(self): # <<<<<<<<<<<<<< + * """Return ``True`` if the queue is full, ``False`` otherwise. + * + */ + __pyx_tuple__27 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(0, 236, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__27); + __Pyx_GIVEREF(__pyx_tuple__27); + __pyx_codeobj__28 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__27, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_queue_py, __pyx_n_s_full, 236, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__28)) __PYX_ERR(0, 236, __pyx_L1_error) + + /* "src/gevent/queue.py":243 + * return self._maxsize > 0 and self.qsize() >= self._maxsize + * + * def put(self, item, block=True, timeout=None): # <<<<<<<<<<<<<< + * """Put an item into the queue. + * + */ + __pyx_tuple__29 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_item, __pyx_n_s_block, __pyx_n_s_timeout); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(0, 243, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__29); + __Pyx_GIVEREF(__pyx_tuple__29); + __pyx_codeobj__30 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__29, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_queue_py, __pyx_n_s_put_2, 243, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__30)) __PYX_ERR(0, 243, __pyx_L1_error) + + /* "src/gevent/queue.py":285 + * raise Full + * + * def put_nowait(self, item): # <<<<<<<<<<<<<< + * """Put an item into the queue without blocking. + * + */ + __pyx_tuple__31 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_item); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(0, 285, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__31); + __Pyx_GIVEREF(__pyx_tuple__31); + __pyx_codeobj__32 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__31, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_queue_py, __pyx_n_s_put_nowait, 285, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__32)) __PYX_ERR(0, 285, __pyx_L1_error) + + /* "src/gevent/queue.py":329 + * _safe_remove(self.getters, waiter) + * + * def get(self, block=True, timeout=None): # <<<<<<<<<<<<<< + * """Remove and return an item from the queue. + * + */ + __pyx_tuple__33 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_block, __pyx_n_s_timeout); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(0, 329, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__33); + __Pyx_GIVEREF(__pyx_tuple__33); + __pyx_codeobj__34 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__33, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_queue_py, __pyx_n_s_get_2, 329, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__34)) __PYX_ERR(0, 329, __pyx_L1_error) + + /* "src/gevent/queue.py":346 + * return self.__get_or_peek(self._get, block, timeout) + * + * def get_nowait(self): # <<<<<<<<<<<<<< + * """Remove and return an item from the queue without blocking. + * + */ + __pyx_tuple__35 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(0, 346, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__35); + __Pyx_GIVEREF(__pyx_tuple__35); + __pyx_codeobj__36 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__35, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_queue_py, __pyx_n_s_get_nowait, 346, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__36)) __PYX_ERR(0, 346, __pyx_L1_error) + + /* "src/gevent/queue.py":354 + * return self.get(False) + * + * def peek(self, block=True, timeout=None): # <<<<<<<<<<<<<< + * """Return an item from the queue without removing it. + * + */ + __pyx_tuple__37 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_block, __pyx_n_s_timeout); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(0, 354, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__37); + __Pyx_GIVEREF(__pyx_tuple__37); + __pyx_codeobj__38 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__37, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_queue_py, __pyx_n_s_peek_2, 354, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__38)) __PYX_ERR(0, 354, __pyx_L1_error) + + /* "src/gevent/queue.py":370 + * return self.__get_or_peek(self._peek, block, timeout) + * + * def peek_nowait(self): # <<<<<<<<<<<<<< + * """Return an item from the queue without blocking. + * + */ + __pyx_tuple__39 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__39)) __PYX_ERR(0, 370, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__39); + __Pyx_GIVEREF(__pyx_tuple__39); + __pyx_codeobj__40 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__39, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_queue_py, __pyx_n_s_peek_nowait, 370, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__40)) __PYX_ERR(0, 370, __pyx_L1_error) + + /* "src/gevent/queue.py":378 + * return self.peek(False) + * + * def _unlock(self): # <<<<<<<<<<<<<< + * while True: + * repeat = False + */ + __pyx_tuple__41 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_repeat, __pyx_n_s_putter, __pyx_n_s_getter); if (unlikely(!__pyx_tuple__41)) __PYX_ERR(0, 378, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__41); + __Pyx_GIVEREF(__pyx_tuple__41); + __pyx_codeobj__42 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__41, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_queue_py, __pyx_n_s_unlock, 378, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__42)) __PYX_ERR(0, 378, __pyx_L1_error) + + /* "src/gevent/queue.py":425 + * self.putters = None # Will never be used. + * + * def put(self, item, block=True, timeout=None): # <<<<<<<<<<<<<< + * self._put(item) + * if self.getters: + */ + __pyx_tuple__43 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_item, __pyx_n_s_block, __pyx_n_s_timeout); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(0, 425, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__43); + __Pyx_GIVEREF(__pyx_tuple__43); + __pyx_codeobj__44 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__43, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_queue_py, __pyx_n_s_put_2, 425, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__44)) __PYX_ERR(0, 425, __pyx_L1_error) + + /* "src/gevent/queue.py":444 + * __slots__ = () + * + * def _create_queue(self, items=()): # <<<<<<<<<<<<<< + * q = list(items) + * _heapify(q) + */ + __pyx_tuple__45 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_items, __pyx_n_s_q); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(0, 444, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__45); + __Pyx_GIVEREF(__pyx_tuple__45); + __pyx_codeobj__46 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__45, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_queue_py, __pyx_n_s_create_queue, 444, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__46)) __PYX_ERR(0, 444, __pyx_L1_error) + + /* "src/gevent/queue.py":449 + * return q + * + * def _put(self, item): # <<<<<<<<<<<<<< + * _heappush(self.queue, item) + * + */ + __pyx_tuple__47 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_item); if (unlikely(!__pyx_tuple__47)) __PYX_ERR(0, 449, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__47); + __Pyx_GIVEREF(__pyx_tuple__47); + __pyx_codeobj__48 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__47, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_queue_py, __pyx_n_s_put, 449, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__48)) __PYX_ERR(0, 449, __pyx_L1_error) + + /* "src/gevent/queue.py":452 + * _heappush(self.queue, item) + * + * def _get(self): # <<<<<<<<<<<<<< + * return _heappop(self.queue) + * + */ + __pyx_tuple__49 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__49)) __PYX_ERR(0, 452, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__49); + __Pyx_GIVEREF(__pyx_tuple__49); + __pyx_codeobj__50 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__49, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_queue_py, __pyx_n_s_get, 452, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__50)) __PYX_ERR(0, 452, __pyx_L1_error) + + /* "src/gevent/queue.py":461 + * __slots__ = () + * + * def _create_queue(self, items=()): # <<<<<<<<<<<<<< + * return list(items) + * + */ + __pyx_tuple__51 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_items); if (unlikely(!__pyx_tuple__51)) __PYX_ERR(0, 461, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__51); + __Pyx_GIVEREF(__pyx_tuple__51); + __pyx_codeobj__52 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__51, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_queue_py, __pyx_n_s_create_queue, 461, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__52)) __PYX_ERR(0, 461, __pyx_L1_error) + + /* "src/gevent/queue.py":464 + * return list(items) + * + * def _put(self, item): # <<<<<<<<<<<<<< + * self.queue.append(item) + * + */ + __pyx_tuple__53 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_item); if (unlikely(!__pyx_tuple__53)) __PYX_ERR(0, 464, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__53); + __Pyx_GIVEREF(__pyx_tuple__53); + __pyx_codeobj__54 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__53, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_queue_py, __pyx_n_s_put, 464, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__54)) __PYX_ERR(0, 464, __pyx_L1_error) + + /* "src/gevent/queue.py":467 + * self.queue.append(item) + * + * def _get(self): # <<<<<<<<<<<<<< + * return self.queue.pop() + * + */ + __pyx_tuple__55 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__55)) __PYX_ERR(0, 467, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__55); + __Pyx_GIVEREF(__pyx_tuple__55); + __pyx_codeobj__56 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__55, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_queue_py, __pyx_n_s_get, 467, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__56)) __PYX_ERR(0, 467, __pyx_L1_error) + + /* "src/gevent/queue.py":470 + * return self.queue.pop() + * + * def _peek(self): # <<<<<<<<<<<<<< + * return self.queue[-1] + * + */ + __pyx_tuple__57 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__57)) __PYX_ERR(0, 470, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__57); + __Pyx_GIVEREF(__pyx_tuple__57); + __pyx_codeobj__58 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__57, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_queue_py, __pyx_n_s_peek, 470, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__58)) __PYX_ERR(0, 470, __pyx_L1_error) + + /* "src/gevent/queue.py":481 + * + * __slots__ = ( + * '_cond', # <<<<<<<<<<<<<< + * 'unfinished_tasks', + * ) + */ + __pyx_tuple__59 = PyTuple_Pack(2, __pyx_n_s_cond, __pyx_n_s_unfinished_tasks); if (unlikely(!__pyx_tuple__59)) __PYX_ERR(0, 481, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__59); + __Pyx_GIVEREF(__pyx_tuple__59); + + /* "src/gevent/queue.py":509 + * self._cond.clear() + * + * def copy(self): # <<<<<<<<<<<<<< + * return type(self)(self.maxsize, self.queue, self.unfinished_tasks) + * + */ + __pyx_tuple__60 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__60)) __PYX_ERR(0, 509, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__60); + __Pyx_GIVEREF(__pyx_tuple__60); + __pyx_codeobj__61 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__60, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_queue_py, __pyx_n_s_copy, 509, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__61)) __PYX_ERR(0, 509, __pyx_L1_error) + + /* "src/gevent/queue.py":512 + * return type(self)(self.maxsize, self.queue, self.unfinished_tasks) + * + * def _format(self): # <<<<<<<<<<<<<< + * result = Queue._format(self) + * if self.unfinished_tasks: + */ + __pyx_tuple__62 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_result); if (unlikely(!__pyx_tuple__62)) __PYX_ERR(0, 512, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__62); + __Pyx_GIVEREF(__pyx_tuple__62); + __pyx_codeobj__63 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__62, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_queue_py, __pyx_n_s_format, 512, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__63)) __PYX_ERR(0, 512, __pyx_L1_error) + + /* "src/gevent/queue.py":518 + * return result + * + * def _put(self, item): # <<<<<<<<<<<<<< + * Queue._put(self, item) + * self.unfinished_tasks += 1 + */ + __pyx_tuple__64 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_item); if (unlikely(!__pyx_tuple__64)) __PYX_ERR(0, 518, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__64); + __Pyx_GIVEREF(__pyx_tuple__64); + __pyx_codeobj__65 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__64, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_queue_py, __pyx_n_s_put, 518, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__65)) __PYX_ERR(0, 518, __pyx_L1_error) + + /* "src/gevent/queue.py":523 + * self._cond.clear() + * + * def task_done(self): # <<<<<<<<<<<<<< + * '''Indicate that a formerly enqueued task is complete. Used by queue consumer threads. + * For each :meth:`get ` used to fetch a task, a subsequent call to :meth:`task_done` tells the queue + */ + __pyx_tuple__66 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__66)) __PYX_ERR(0, 523, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__66); + __Pyx_GIVEREF(__pyx_tuple__66); + __pyx_codeobj__67 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__66, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_queue_py, __pyx_n_s_task_done, 523, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__67)) __PYX_ERR(0, 523, __pyx_L1_error) + + /* "src/gevent/queue.py":540 + * self._cond.set() + * + * def join(self, timeout=None): # <<<<<<<<<<<<<< + * ''' + * Block until all items in the queue have been gotten and processed. + */ + __pyx_tuple__68 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_timeout); if (unlikely(!__pyx_tuple__68)) __PYX_ERR(0, 540, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__68); + __Pyx_GIVEREF(__pyx_tuple__68); + __pyx_codeobj__69 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__68, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_queue_py, __pyx_n_s_join, 540, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__69)) __PYX_ERR(0, 540, __pyx_L1_error) + + /* "src/gevent/queue.py":563 + * + * __slots__ = ( + * 'getters', # <<<<<<<<<<<<<< + * 'putters', + * 'hub', + */ + __pyx_tuple__70 = PyTuple_Pack(5, __pyx_n_s_getters, __pyx_n_s_putters, __pyx_n_s_hub, __pyx_n_s_event_unlock, __pyx_n_s_weakref); if (unlikely(!__pyx_tuple__70)) __PYX_ERR(0, 563, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__70); + __Pyx_GIVEREF(__pyx_tuple__70); + + /* "src/gevent/queue.py":585 + * return '<%s %s>' % (type(self).__name__, self._format()) + * + * def _format(self): # <<<<<<<<<<<<<< + * result = '' + * if self.getters: + */ + __pyx_tuple__71 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_result); if (unlikely(!__pyx_tuple__71)) __PYX_ERR(0, 585, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__71); + __Pyx_GIVEREF(__pyx_tuple__71); + __pyx_codeobj__72 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__71, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_queue_py, __pyx_n_s_format, 585, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__72)) __PYX_ERR(0, 585, __pyx_L1_error) + + /* "src/gevent/queue.py":597 + * return len(self.putters) - len(self.getters) + * + * def qsize(self): # <<<<<<<<<<<<<< + * return 0 + * + */ + __pyx_tuple__73 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__73)) __PYX_ERR(0, 597, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__73); + __Pyx_GIVEREF(__pyx_tuple__73); + __pyx_codeobj__74 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__73, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_queue_py, __pyx_n_s_qsize, 597, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__74)) __PYX_ERR(0, 597, __pyx_L1_error) + + /* "src/gevent/queue.py":600 + * return 0 + * + * def empty(self): # <<<<<<<<<<<<<< + * return True + * + */ + __pyx_tuple__75 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__75)) __PYX_ERR(0, 600, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__75); + __Pyx_GIVEREF(__pyx_tuple__75); + __pyx_codeobj__76 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__75, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_queue_py, __pyx_n_s_empty, 600, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__76)) __PYX_ERR(0, 600, __pyx_L1_error) + + /* "src/gevent/queue.py":603 + * return True + * + * def full(self): # <<<<<<<<<<<<<< + * return True + * + */ + __pyx_tuple__77 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__77)) __PYX_ERR(0, 603, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__77); + __Pyx_GIVEREF(__pyx_tuple__77); + __pyx_codeobj__78 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__77, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_queue_py, __pyx_n_s_full, 603, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__78)) __PYX_ERR(0, 603, __pyx_L1_error) + + /* "src/gevent/queue.py":606 + * return True + * + * def put(self, item, block=True, timeout=None): # <<<<<<<<<<<<<< + * if self.hub is getcurrent(): + * if self.getters: + */ + __pyx_tuple__79 = PyTuple_Pack(7, __pyx_n_s_self, __pyx_n_s_item, __pyx_n_s_block, __pyx_n_s_timeout, __pyx_n_s_getter, __pyx_n_s_waiter_2, __pyx_n_s_result); if (unlikely(!__pyx_tuple__79)) __PYX_ERR(0, 606, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__79); + __Pyx_GIVEREF(__pyx_tuple__79); + __pyx_codeobj__80 = (PyObject*)__Pyx_PyCode_New(4, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__79, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_queue_py, __pyx_n_s_put_2, 606, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__80)) __PYX_ERR(0, 606, __pyx_L1_error) + + /* "src/gevent/queue.py":633 + * timeout.cancel() + * + * def put_nowait(self, item): # <<<<<<<<<<<<<< + * self.put(item, False) + * + */ + __pyx_tuple__81 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_item); if (unlikely(!__pyx_tuple__81)) __PYX_ERR(0, 633, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__81); + __Pyx_GIVEREF(__pyx_tuple__81); + __pyx_codeobj__82 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__81, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_queue_py, __pyx_n_s_put_nowait, 633, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__82)) __PYX_ERR(0, 633, __pyx_L1_error) + + /* "src/gevent/queue.py":636 + * self.put(item, False) + * + * def get(self, block=True, timeout=None): # <<<<<<<<<<<<<< + * if self.hub is getcurrent(): + * if self.putters: + */ + __pyx_tuple__83 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_block, __pyx_n_s_timeout); if (unlikely(!__pyx_tuple__83)) __PYX_ERR(0, 636, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__83); + __Pyx_GIVEREF(__pyx_tuple__83); + __pyx_codeobj__84 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__83, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_queue_py, __pyx_n_s_get_2, 636, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__84)) __PYX_ERR(0, 636, __pyx_L1_error) + + /* "src/gevent/queue.py":659 + * timeout.close() + * + * def get_nowait(self): # <<<<<<<<<<<<<< + * return self.get(False) + * + */ + __pyx_tuple__85 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__85)) __PYX_ERR(0, 659, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__85); + __Pyx_GIVEREF(__pyx_tuple__85); + __pyx_codeobj__86 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__85, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_queue_py, __pyx_n_s_get_nowait, 659, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__86)) __PYX_ERR(0, 659, __pyx_L1_error) + + /* "src/gevent/queue.py":662 + * return self.get(False) + * + * def _unlock(self): # <<<<<<<<<<<<<< + * while self.putters and self.getters: + * getter = self.getters.popleft() + */ + __pyx_tuple__87 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_getter, __pyx_n_s_item, __pyx_n_s_putter); if (unlikely(!__pyx_tuple__87)) __PYX_ERR(0, 662, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__87); + __Pyx_GIVEREF(__pyx_tuple__87); + __pyx_codeobj__88 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__87, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_queue_py, __pyx_n_s_unlock, 662, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__88)) __PYX_ERR(0, 662, __pyx_L1_error) + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} + +static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { + __pyx_umethod_PyList_Type_pop.type = (PyObject*)&PyList_Type; + if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) __PYX_ERR(0, 1, __pyx_L1_error) + return 0; + __pyx_L1_error:; + return -1; +} + +static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/ + +static int __Pyx_modinit_global_init_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); + /*--- Global init code ---*/ + __pyx_v_6gevent_6_queue__heappush = Py_None; Py_INCREF(Py_None); + __pyx_v_6gevent_6_queue__heappop = Py_None; Py_INCREF(Py_None); + __pyx_v_6gevent_6_queue__heapify = Py_None; Py_INCREF(Py_None); + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_variable_export_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); + /*--- Variable export code ---*/ + if (__Pyx_ExportVoidPtr(__pyx_n_s_heappush, (void *)&__pyx_v_6gevent_6_queue__heappush, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportVoidPtr(__pyx_n_s_heappop, (void *)&__pyx_v_6gevent_6_queue__heappop, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportVoidPtr(__pyx_n_s_heapify, (void *)&__pyx_v_6gevent_6_queue__heapify, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_modinit_function_export_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); + /*--- Function export code ---*/ + if (__Pyx_ExportFunction("_safe_remove", (void (*)(void))__pyx_f_6gevent_6_queue__safe_remove, "PyObject *(PyObject *, PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_modinit_type_init_code(void) { + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); + /*--- Type init code ---*/ + __pyx_t_1 = PyImport_ImportModule("gevent.__waiter"); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_ptype_6gevent_8__waiter_Waiter = __Pyx_ImportType(__pyx_t_1, "gevent.__waiter", "Waiter", sizeof(struct __pyx_obj_6gevent_8__waiter_Waiter), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_8__waiter_Waiter) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_vtabptr_6gevent_8__waiter_Waiter = (struct __pyx_vtabstruct_6gevent_8__waiter_Waiter*)__Pyx_GetVtable(__pyx_ptype_6gevent_8__waiter_Waiter->tp_dict); if (unlikely(!__pyx_vtabptr_6gevent_8__waiter_Waiter)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_vtabptr_6gevent_6_queue_ItemWaiter = &__pyx_vtable_6gevent_6_queue_ItemWaiter; + __pyx_vtable_6gevent_6_queue_ItemWaiter.__pyx_base = *__pyx_vtabptr_6gevent_8__waiter_Waiter; + __pyx_type_6gevent_6_queue_ItemWaiter.tp_base = __pyx_ptype_6gevent_8__waiter_Waiter; + if (PyType_Ready(&__pyx_type_6gevent_6_queue_ItemWaiter) < 0) __PYX_ERR(0, 75, __pyx_L1_error) + __pyx_type_6gevent_6_queue_ItemWaiter.tp_print = 0; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6gevent_6_queue_ItemWaiter.tp_dictoffset && __pyx_type_6gevent_6_queue_ItemWaiter.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_type_6gevent_6_queue_ItemWaiter.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + } + if (__Pyx_SetVtable(__pyx_type_6gevent_6_queue_ItemWaiter.tp_dict, __pyx_vtabptr_6gevent_6_queue_ItemWaiter) < 0) __PYX_ERR(0, 75, __pyx_L1_error) + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_ItemWaiter, (PyObject *)&__pyx_type_6gevent_6_queue_ItemWaiter) < 0) __PYX_ERR(0, 75, __pyx_L1_error) + __pyx_ptype_6gevent_6_queue_ItemWaiter = &__pyx_type_6gevent_6_queue_ItemWaiter; + __pyx_vtabptr_6gevent_6_queue_Queue = &__pyx_vtable_6gevent_6_queue_Queue; + __pyx_vtable_6gevent_6_queue_Queue._get = (PyObject *(*)(struct __pyx_obj_6gevent_6_queue_Queue *, int __pyx_skip_dispatch))__pyx_f_6gevent_6_queue_5Queue__get; + __pyx_vtable_6gevent_6_queue_Queue._put = (PyObject *(*)(struct __pyx_obj_6gevent_6_queue_Queue *, PyObject *, int __pyx_skip_dispatch))__pyx_f_6gevent_6_queue_5Queue__put; + __pyx_vtable_6gevent_6_queue_Queue._peek = (PyObject *(*)(struct __pyx_obj_6gevent_6_queue_Queue *, int __pyx_skip_dispatch))__pyx_f_6gevent_6_queue_5Queue__peek; + __pyx_vtable_6gevent_6_queue_Queue.qsize = (Py_ssize_t (*)(struct __pyx_obj_6gevent_6_queue_Queue *, int __pyx_skip_dispatch))__pyx_f_6gevent_6_queue_5Queue_qsize; + __pyx_vtable_6gevent_6_queue_Queue.empty = (int (*)(struct __pyx_obj_6gevent_6_queue_Queue *, int __pyx_skip_dispatch))__pyx_f_6gevent_6_queue_5Queue_empty; + __pyx_vtable_6gevent_6_queue_Queue.full = (int (*)(struct __pyx_obj_6gevent_6_queue_Queue *, int __pyx_skip_dispatch))__pyx_f_6gevent_6_queue_5Queue_full; + __pyx_vtable_6gevent_6_queue_Queue.put = (PyObject *(*)(struct __pyx_obj_6gevent_6_queue_Queue *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_6_queue_5Queue_put *__pyx_optional_args))__pyx_f_6gevent_6_queue_5Queue_put; + __pyx_vtable_6gevent_6_queue_Queue.put_nowait = (PyObject *(*)(struct __pyx_obj_6gevent_6_queue_Queue *, PyObject *, int __pyx_skip_dispatch))__pyx_f_6gevent_6_queue_5Queue_put_nowait; + __pyx_vtable_6gevent_6_queue_Queue.__pyx___get_or_peek = (PyObject *(*)(struct __pyx_obj_6gevent_6_queue_Queue *, PyObject *, PyObject *, PyObject *))__pyx_f_6gevent_6_queue_5Queue___get_or_peek; + __pyx_vtable_6gevent_6_queue_Queue.get = (PyObject *(*)(struct __pyx_obj_6gevent_6_queue_Queue *, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_6_queue_5Queue_get *__pyx_optional_args))__pyx_f_6gevent_6_queue_5Queue_get; + __pyx_vtable_6gevent_6_queue_Queue.get_nowait = (PyObject *(*)(struct __pyx_obj_6gevent_6_queue_Queue *, int __pyx_skip_dispatch))__pyx_f_6gevent_6_queue_5Queue_get_nowait; + __pyx_vtable_6gevent_6_queue_Queue.peek = (PyObject *(*)(struct __pyx_obj_6gevent_6_queue_Queue *, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_6_queue_5Queue_peek *__pyx_optional_args))__pyx_f_6gevent_6_queue_5Queue_peek; + __pyx_vtable_6gevent_6_queue_Queue.peek_nowait = (PyObject *(*)(struct __pyx_obj_6gevent_6_queue_Queue *, int __pyx_skip_dispatch))__pyx_f_6gevent_6_queue_5Queue_peek_nowait; + __pyx_vtable_6gevent_6_queue_Queue._schedule_unlock = (PyObject *(*)(struct __pyx_obj_6gevent_6_queue_Queue *))__pyx_f_6gevent_6_queue_5Queue__schedule_unlock; + if (PyType_Ready(&__pyx_type_6gevent_6_queue_Queue) < 0) __PYX_ERR(0, 93, __pyx_L1_error) + __pyx_type_6gevent_6_queue_Queue.tp_print = 0; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6gevent_6_queue_Queue.tp_dictoffset && __pyx_type_6gevent_6_queue_Queue.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_type_6gevent_6_queue_Queue.tp_getattro = __Pyx_PyObject_GenericGetAttr; + } + #if CYTHON_COMPILING_IN_CPYTHON + { + PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_6gevent_6_queue_Queue, "__len__"); if (unlikely(!wrapper)) __PYX_ERR(0, 93, __pyx_L1_error) + if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) { + __pyx_wrapperbase_6gevent_6_queue_5Queue_20__len__ = *((PyWrapperDescrObject *)wrapper)->d_base; + __pyx_wrapperbase_6gevent_6_queue_5Queue_20__len__.doc = __pyx_doc_6gevent_6_queue_5Queue_20__len__; + ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_6gevent_6_queue_5Queue_20__len__; + } + } + #endif + if (__Pyx_SetVtable(__pyx_type_6gevent_6_queue_Queue.tp_dict, __pyx_vtabptr_6gevent_6_queue_Queue) < 0) __PYX_ERR(0, 93, __pyx_L1_error) + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Queue, (PyObject *)&__pyx_type_6gevent_6_queue_Queue) < 0) __PYX_ERR(0, 93, __pyx_L1_error) + if (__pyx_type_6gevent_6_queue_Queue.tp_weaklistoffset == 0) __pyx_type_6gevent_6_queue_Queue.tp_weaklistoffset = offsetof(struct __pyx_obj_6gevent_6_queue_Queue, __weakref__); + __pyx_ptype_6gevent_6_queue_Queue = &__pyx_type_6gevent_6_queue_Queue; + __pyx_vtabptr_6gevent_6_queue_UnboundQueue = &__pyx_vtable_6gevent_6_queue_UnboundQueue; + __pyx_vtable_6gevent_6_queue_UnboundQueue.__pyx_base = *__pyx_vtabptr_6gevent_6_queue_Queue; + __pyx_vtable_6gevent_6_queue_UnboundQueue.__pyx_base.put = (PyObject *(*)(struct __pyx_obj_6gevent_6_queue_Queue *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_6_queue_5Queue_put *__pyx_optional_args))__pyx_f_6gevent_6_queue_12UnboundQueue_put; + __pyx_type_6gevent_6_queue_UnboundQueue.tp_base = __pyx_ptype_6gevent_6_queue_Queue; + if (PyType_Ready(&__pyx_type_6gevent_6_queue_UnboundQueue) < 0) __PYX_ERR(0, 413, __pyx_L1_error) + __pyx_type_6gevent_6_queue_UnboundQueue.tp_print = 0; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6gevent_6_queue_UnboundQueue.tp_dictoffset && __pyx_type_6gevent_6_queue_UnboundQueue.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_type_6gevent_6_queue_UnboundQueue.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + } + if (__Pyx_SetVtable(__pyx_type_6gevent_6_queue_UnboundQueue.tp_dict, __pyx_vtabptr_6gevent_6_queue_UnboundQueue) < 0) __PYX_ERR(0, 413, __pyx_L1_error) + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_UnboundQueue, (PyObject *)&__pyx_type_6gevent_6_queue_UnboundQueue) < 0) __PYX_ERR(0, 413, __pyx_L1_error) + if (__pyx_type_6gevent_6_queue_UnboundQueue.tp_weaklistoffset == 0) __pyx_type_6gevent_6_queue_UnboundQueue.tp_weaklistoffset = offsetof(struct __pyx_obj_6gevent_6_queue_UnboundQueue, __pyx_base.__weakref__); + __pyx_ptype_6gevent_6_queue_UnboundQueue = &__pyx_type_6gevent_6_queue_UnboundQueue; + __pyx_vtabptr_6gevent_6_queue_PriorityQueue = &__pyx_vtable_6gevent_6_queue_PriorityQueue; + __pyx_vtable_6gevent_6_queue_PriorityQueue.__pyx_base = *__pyx_vtabptr_6gevent_6_queue_Queue; + __pyx_vtable_6gevent_6_queue_PriorityQueue.__pyx_base._get = (PyObject *(*)(struct __pyx_obj_6gevent_6_queue_Queue *, int __pyx_skip_dispatch))__pyx_f_6gevent_6_queue_13PriorityQueue__get; + __pyx_vtable_6gevent_6_queue_PriorityQueue.__pyx_base._put = (PyObject *(*)(struct __pyx_obj_6gevent_6_queue_Queue *, PyObject *, int __pyx_skip_dispatch))__pyx_f_6gevent_6_queue_13PriorityQueue__put; + __pyx_type_6gevent_6_queue_PriorityQueue.tp_base = __pyx_ptype_6gevent_6_queue_Queue; + if (PyType_Ready(&__pyx_type_6gevent_6_queue_PriorityQueue) < 0) __PYX_ERR(0, 431, __pyx_L1_error) + __pyx_type_6gevent_6_queue_PriorityQueue.tp_print = 0; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6gevent_6_queue_PriorityQueue.tp_dictoffset && __pyx_type_6gevent_6_queue_PriorityQueue.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_type_6gevent_6_queue_PriorityQueue.tp_getattro = __Pyx_PyObject_GenericGetAttr; + } + if (__Pyx_SetVtable(__pyx_type_6gevent_6_queue_PriorityQueue.tp_dict, __pyx_vtabptr_6gevent_6_queue_PriorityQueue) < 0) __PYX_ERR(0, 431, __pyx_L1_error) + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_PriorityQueue, (PyObject *)&__pyx_type_6gevent_6_queue_PriorityQueue) < 0) __PYX_ERR(0, 431, __pyx_L1_error) + if (__pyx_type_6gevent_6_queue_PriorityQueue.tp_weaklistoffset == 0) __pyx_type_6gevent_6_queue_PriorityQueue.tp_weaklistoffset = offsetof(struct __pyx_obj_6gevent_6_queue_PriorityQueue, __pyx_base.__weakref__); + __pyx_ptype_6gevent_6_queue_PriorityQueue = &__pyx_type_6gevent_6_queue_PriorityQueue; + __pyx_vtabptr_6gevent_6_queue_LifoQueue = &__pyx_vtable_6gevent_6_queue_LifoQueue; + __pyx_vtable_6gevent_6_queue_LifoQueue.__pyx_base = *__pyx_vtabptr_6gevent_6_queue_Queue; + __pyx_vtable_6gevent_6_queue_LifoQueue.__pyx_base._get = (PyObject *(*)(struct __pyx_obj_6gevent_6_queue_Queue *, int __pyx_skip_dispatch))__pyx_f_6gevent_6_queue_9LifoQueue__get; + __pyx_vtable_6gevent_6_queue_LifoQueue.__pyx_base._put = (PyObject *(*)(struct __pyx_obj_6gevent_6_queue_Queue *, PyObject *, int __pyx_skip_dispatch))__pyx_f_6gevent_6_queue_9LifoQueue__put; + __pyx_vtable_6gevent_6_queue_LifoQueue.__pyx_base._peek = (PyObject *(*)(struct __pyx_obj_6gevent_6_queue_Queue *, int __pyx_skip_dispatch))__pyx_f_6gevent_6_queue_9LifoQueue__peek; + __pyx_type_6gevent_6_queue_LifoQueue.tp_base = __pyx_ptype_6gevent_6_queue_Queue; + if (PyType_Ready(&__pyx_type_6gevent_6_queue_LifoQueue) < 0) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_type_6gevent_6_queue_LifoQueue.tp_print = 0; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6gevent_6_queue_LifoQueue.tp_dictoffset && __pyx_type_6gevent_6_queue_LifoQueue.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_type_6gevent_6_queue_LifoQueue.tp_getattro = __Pyx_PyObject_GenericGetAttr; + } + if (__Pyx_SetVtable(__pyx_type_6gevent_6_queue_LifoQueue.tp_dict, __pyx_vtabptr_6gevent_6_queue_LifoQueue) < 0) __PYX_ERR(0, 456, __pyx_L1_error) + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_LifoQueue, (PyObject *)&__pyx_type_6gevent_6_queue_LifoQueue) < 0) __PYX_ERR(0, 456, __pyx_L1_error) + if (__pyx_type_6gevent_6_queue_LifoQueue.tp_weaklistoffset == 0) __pyx_type_6gevent_6_queue_LifoQueue.tp_weaklistoffset = offsetof(struct __pyx_obj_6gevent_6_queue_LifoQueue, __pyx_base.__weakref__); + __pyx_ptype_6gevent_6_queue_LifoQueue = &__pyx_type_6gevent_6_queue_LifoQueue; + __pyx_vtabptr_6gevent_6_queue_JoinableQueue = &__pyx_vtable_6gevent_6_queue_JoinableQueue; + __pyx_vtable_6gevent_6_queue_JoinableQueue.__pyx_base = *__pyx_vtabptr_6gevent_6_queue_Queue; + __pyx_vtable_6gevent_6_queue_JoinableQueue.__pyx_base._put = (PyObject *(*)(struct __pyx_obj_6gevent_6_queue_Queue *, PyObject *, int __pyx_skip_dispatch))__pyx_f_6gevent_6_queue_13JoinableQueue__put; + __pyx_type_6gevent_6_queue_JoinableQueue.tp_base = __pyx_ptype_6gevent_6_queue_Queue; + if (PyType_Ready(&__pyx_type_6gevent_6_queue_JoinableQueue) < 0) __PYX_ERR(0, 474, __pyx_L1_error) + __pyx_type_6gevent_6_queue_JoinableQueue.tp_print = 0; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6gevent_6_queue_JoinableQueue.tp_dictoffset && __pyx_type_6gevent_6_queue_JoinableQueue.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_type_6gevent_6_queue_JoinableQueue.tp_getattro = __Pyx_PyObject_GenericGetAttr; + } + #if CYTHON_COMPILING_IN_CPYTHON + { + PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_6gevent_6_queue_JoinableQueue, "__init__"); if (unlikely(!wrapper)) __PYX_ERR(0, 474, __pyx_L1_error) + if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) { + __pyx_wrapperbase_6gevent_6_queue_13JoinableQueue___init__ = *((PyWrapperDescrObject *)wrapper)->d_base; + __pyx_wrapperbase_6gevent_6_queue_13JoinableQueue___init__.doc = __pyx_doc_6gevent_6_queue_13JoinableQueue___init__; + ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_6gevent_6_queue_13JoinableQueue___init__; + } + } + #endif + if (__Pyx_SetVtable(__pyx_type_6gevent_6_queue_JoinableQueue.tp_dict, __pyx_vtabptr_6gevent_6_queue_JoinableQueue) < 0) __PYX_ERR(0, 474, __pyx_L1_error) + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_JoinableQueue, (PyObject *)&__pyx_type_6gevent_6_queue_JoinableQueue) < 0) __PYX_ERR(0, 474, __pyx_L1_error) + if (__pyx_type_6gevent_6_queue_JoinableQueue.tp_weaklistoffset == 0) __pyx_type_6gevent_6_queue_JoinableQueue.tp_weaklistoffset = offsetof(struct __pyx_obj_6gevent_6_queue_JoinableQueue, __pyx_base.__weakref__); + __pyx_ptype_6gevent_6_queue_JoinableQueue = &__pyx_type_6gevent_6_queue_JoinableQueue; + __pyx_vtabptr_6gevent_6_queue_Channel = &__pyx_vtable_6gevent_6_queue_Channel; + __pyx_vtable_6gevent_6_queue_Channel.get = (PyObject *(*)(struct __pyx_obj_6gevent_6_queue_Channel *, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_6_queue_7Channel_get *__pyx_optional_args))__pyx_f_6gevent_6_queue_7Channel_get; + __pyx_vtable_6gevent_6_queue_Channel.get_nowait = (PyObject *(*)(struct __pyx_obj_6gevent_6_queue_Channel *, int __pyx_skip_dispatch))__pyx_f_6gevent_6_queue_7Channel_get_nowait; + __pyx_vtable_6gevent_6_queue_Channel._schedule_unlock = (PyObject *(*)(struct __pyx_obj_6gevent_6_queue_Channel *))__pyx_f_6gevent_6_queue_7Channel__schedule_unlock; + if (PyType_Ready(&__pyx_type_6gevent_6_queue_Channel) < 0) __PYX_ERR(0, 560, __pyx_L1_error) + __pyx_type_6gevent_6_queue_Channel.tp_print = 0; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6gevent_6_queue_Channel.tp_dictoffset && __pyx_type_6gevent_6_queue_Channel.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_type_6gevent_6_queue_Channel.tp_getattro = __Pyx_PyObject_GenericGetAttr; + } + if (__Pyx_SetVtable(__pyx_type_6gevent_6_queue_Channel.tp_dict, __pyx_vtabptr_6gevent_6_queue_Channel) < 0) __PYX_ERR(0, 560, __pyx_L1_error) + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Channel, (PyObject *)&__pyx_type_6gevent_6_queue_Channel) < 0) __PYX_ERR(0, 560, __pyx_L1_error) + if (__pyx_type_6gevent_6_queue_Channel.tp_weaklistoffset == 0) __pyx_type_6gevent_6_queue_Channel.tp_weaklistoffset = offsetof(struct __pyx_obj_6gevent_6_queue_Channel, __weakref__); + __pyx_ptype_6gevent_6_queue_Channel = &__pyx_type_6gevent_6_queue_Channel; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_modinit_type_import_code(void) { + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); + /*--- Type import code ---*/ + __pyx_t_1 = PyImport_ImportModule("greenlet"); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_ptype_6gevent_21__greenlet_primitives_greenlet = __Pyx_ImportType(__pyx_t_1, "greenlet", "greenlet", sizeof(PyGreenlet), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_21__greenlet_primitives_greenlet) __PYX_ERR(2, 12, __pyx_L1_error) + __pyx_t_2 = PyImport_ImportModule("gevent.__greenlet_primitives"); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 37, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_ptype_6gevent_21__greenlet_primitives_TrackedRawGreenlet = __Pyx_ImportType(__pyx_t_2, "gevent.__greenlet_primitives", "TrackedRawGreenlet", sizeof(struct __pyx_obj_6gevent_21__greenlet_primitives_TrackedRawGreenlet), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_21__greenlet_primitives_TrackedRawGreenlet) __PYX_ERR(2, 37, __pyx_L1_error) + __pyx_ptype_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop = __Pyx_ImportType(__pyx_t_2, "gevent.__greenlet_primitives", "SwitchOutGreenletWithLoop", sizeof(struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop) __PYX_ERR(2, 40, __pyx_L1_error) + __pyx_vtabptr_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop = (struct __pyx_vtabstruct_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop*)__Pyx_GetVtable(__pyx_ptype_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop->tp_dict); if (unlikely(!__pyx_vtabptr_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop)) __PYX_ERR(2, 40, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyImport_ImportModule("greenlet"); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 15, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_ptype_6gevent_8__waiter_greenlet = __Pyx_ImportType(__pyx_t_2, "greenlet", "greenlet", sizeof(PyGreenlet), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_8__waiter_greenlet) __PYX_ERR(3, 15, __pyx_L1_error) + __pyx_t_1 = PyImport_ImportModule("gevent.__waiter"); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 47, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_ptype_6gevent_8__waiter_MultipleWaiter = __Pyx_ImportType(__pyx_t_1, "gevent.__waiter", "MultipleWaiter", sizeof(struct __pyx_obj_6gevent_8__waiter_MultipleWaiter), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_8__waiter_MultipleWaiter) __PYX_ERR(3, 47, __pyx_L1_error) + __pyx_vtabptr_6gevent_8__waiter_MultipleWaiter = (struct __pyx_vtabstruct_6gevent_8__waiter_MultipleWaiter*)__Pyx_GetVtable(__pyx_ptype_6gevent_8__waiter_MultipleWaiter->tp_dict); if (unlikely(!__pyx_vtabptr_6gevent_8__waiter_MultipleWaiter)) __PYX_ERR(3, 47, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyImport_ImportModule("greenlet"); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_ptype_6gevent_19__abstract_linkable_greenlet = __Pyx_ImportType(__pyx_t_1, "greenlet", "greenlet", sizeof(PyGreenlet), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_19__abstract_linkable_greenlet) __PYX_ERR(4, 12, __pyx_L1_error) + __pyx_t_2 = PyImport_ImportModule("gevent.__abstract_linkable"); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 32, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_ptype_6gevent_19__abstract_linkable_AbstractLinkable = __Pyx_ImportType(__pyx_t_2, "gevent.__abstract_linkable", "AbstractLinkable", sizeof(struct __pyx_obj_6gevent_19__abstract_linkable_AbstractLinkable), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_19__abstract_linkable_AbstractLinkable) __PYX_ERR(4, 32, __pyx_L1_error) + __pyx_vtabptr_6gevent_19__abstract_linkable_AbstractLinkable = (struct __pyx_vtabstruct_6gevent_19__abstract_linkable_AbstractLinkable*)__Pyx_GetVtable(__pyx_ptype_6gevent_19__abstract_linkable_AbstractLinkable->tp_dict); if (unlikely(!__pyx_vtabptr_6gevent_19__abstract_linkable_AbstractLinkable)) __PYX_ERR(4, 32, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyImport_ImportModule("gevent._event"); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_ptype_6gevent_6_event_Event = __Pyx_ImportType(__pyx_t_2, "gevent._event", "Event", sizeof(struct __pyx_obj_6gevent_6_event_Event), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_6_event_Event) __PYX_ERR(5, 13, __pyx_L1_error) + __pyx_vtabptr_6gevent_6_event_Event = (struct __pyx_vtabstruct_6gevent_6_event_Event*)__Pyx_GetVtable(__pyx_ptype_6gevent_6_event_Event->tp_dict); if (unlikely(!__pyx_vtabptr_6gevent_6_event_Event)) __PYX_ERR(5, 13, __pyx_L1_error) + __pyx_ptype_6gevent_6_event_AsyncResult = __Pyx_ImportType(__pyx_t_2, "gevent._event", "AsyncResult", sizeof(struct __pyx_obj_6gevent_6_event_AsyncResult), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_6gevent_6_event_AsyncResult) __PYX_ERR(5, 16, __pyx_L1_error) + __pyx_vtabptr_6gevent_6_event_AsyncResult = (struct __pyx_vtabstruct_6gevent_6_event_AsyncResult*)__Pyx_GetVtable(__pyx_ptype_6gevent_6_event_AsyncResult->tp_dict); if (unlikely(!__pyx_vtabptr_6gevent_6_event_AsyncResult)) __PYX_ERR(5, 16, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_modinit_variable_import_code(void) { + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); + /*--- Variable import code ---*/ + __pyx_t_1 = PyImport_ImportModule("gevent.__greenlet_primitives"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_1, "get_objects", (void **)&__pyx_vp_6gevent_21__greenlet_primitives_get_objects, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_1, "wref", (void **)&__pyx_vp_6gevent_21__greenlet_primitives_wref, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_1, "BlockingSwitchOutError", (void **)&__pyx_vp_6gevent_21__greenlet_primitives_BlockingSwitchOutError, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_1, "_greenlet_imported", (void **)&__pyx_vp_6gevent_21__greenlet_primitives__greenlet_imported, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + Py_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_2 = PyImport_ImportModule("gevent.__hub_local"); if (!__pyx_t_2) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_2, "_threadlocal", (void **)&__pyx_vp_6gevent_11__hub_local__threadlocal, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + Py_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_3 = PyImport_ImportModule("gevent.__waiter"); if (!__pyx_t_3) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_3, "sys", (void **)&__pyx_vp_6gevent_8__waiter_sys, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_3, "ConcurrentObjectUseError", (void **)&__pyx_vp_6gevent_8__waiter_ConcurrentObjectUseError, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_3, "_greenlet_imported", (void **)&__pyx_vp_6gevent_8__waiter__greenlet_imported, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_3, "_NONE", (void **)&__pyx_vp_6gevent_8__waiter__NONE, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + Py_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_4 = PyImport_ImportModule("gevent.__abstract_linkable"); if (!__pyx_t_4) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_4, "InvalidSwitchError", (void **)&__pyx_vp_6gevent_19__abstract_linkable_InvalidSwitchError, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_4, "Timeout", (void **)&__pyx_vp_6gevent_19__abstract_linkable_Timeout, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_4, "_greenlet_imported", (void **)&__pyx_vp_6gevent_19__abstract_linkable__greenlet_imported, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + Py_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = PyImport_ImportModule("gevent._event"); if (!__pyx_t_5) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_5, "_None", (void **)&__pyx_vp_6gevent_6_event__None, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_5, "reraise", (void **)&__pyx_vp_6gevent_6_event_reraise, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_5, "dump_traceback", (void **)&__pyx_vp_6gevent_6_event_dump_traceback, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_5, "load_traceback", (void **)&__pyx_vp_6gevent_6_event_load_traceback, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportVoidPtr(__pyx_t_5, "Timeout", (void **)&__pyx_vp_6gevent_6_event_Timeout, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + Py_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_modinit_function_import_code(void) { + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); + /*--- Function import code ---*/ + __pyx_t_1 = PyImport_ImportModule("gevent.__hub_local"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportFunction(__pyx_t_1, "get_hub_noargs", (void (**)(void))&__pyx_f_6gevent_11__hub_local_get_hub_noargs, "struct __pyx_obj_6gevent_21__greenlet_primitives_SwitchOutGreenletWithLoop *(int __pyx_skip_dispatch)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + Py_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_RefNannyFinishContext(); + return -1; +} + + +#if PY_MAJOR_VERSION < 3 +#ifdef CYTHON_NO_PYINIT_EXPORT +#define __Pyx_PyMODINIT_FUNC void +#else +#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC +#endif +#else +#ifdef CYTHON_NO_PYINIT_EXPORT +#define __Pyx_PyMODINIT_FUNC PyObject * +#else +#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC +#endif +#endif + + +#if PY_MAJOR_VERSION < 3 +__Pyx_PyMODINIT_FUNC init_queue(void) CYTHON_SMALL_CODE; /*proto*/ +__Pyx_PyMODINIT_FUNC init_queue(void) +#else +__Pyx_PyMODINIT_FUNC PyInit__queue(void) CYTHON_SMALL_CODE; /*proto*/ +__Pyx_PyMODINIT_FUNC PyInit__queue(void) +#if CYTHON_PEP489_MULTI_PHASE_INIT +{ + return PyModuleDef_Init(&__pyx_moduledef); +} +static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { + #if PY_VERSION_HEX >= 0x030700A1 + static PY_INT64_T main_interpreter_id = -1; + PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); + if (main_interpreter_id == -1) { + main_interpreter_id = current_id; + return (unlikely(current_id == -1)) ? -1 : 0; + } else if (unlikely(main_interpreter_id != current_id)) + #else + static PyInterpreterState *main_interpreter = NULL; + PyInterpreterState *current_interpreter = PyThreadState_Get()->interp; + if (!main_interpreter) { + main_interpreter = current_interpreter; + } else if (unlikely(main_interpreter != current_interpreter)) + #endif + { + PyErr_SetString( + PyExc_ImportError, + "Interpreter change detected - this module can only be loaded into one interpreter per process."); + return -1; + } + return 0; +} +static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) { + PyObject *value = PyObject_GetAttrString(spec, from_name); + int result = 0; + if (likely(value)) { + if (allow_none || value != Py_None) { + result = PyDict_SetItemString(moddict, to_name, value); + } + Py_DECREF(value); + } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_Clear(); + } else { + result = -1; + } + return result; +} +static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) { + PyObject *module = NULL, *moddict, *modname; + if (__Pyx_check_single_interpreter()) + return NULL; + if (__pyx_m) + return __Pyx_NewRef(__pyx_m); + modname = PyObject_GetAttrString(spec, "name"); + if (unlikely(!modname)) goto bad; + module = PyModule_NewObject(modname); + Py_DECREF(modname); + if (unlikely(!module)) goto bad; + moddict = PyModule_GetDict(module); + if (unlikely(!moddict)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad; + return module; +bad: + Py_XDECREF(module); + return NULL; +} + + +static CYTHON_SMALL_CODE int __pyx_pymod_exec__queue(PyObject *__pyx_pyinit_module) +#endif +#endif +{ + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + int __pyx_t_4; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + __Pyx_RefNannyDeclarations + #if CYTHON_PEP489_MULTI_PHASE_INIT + if (__pyx_m) { + if (__pyx_m == __pyx_pyinit_module) return 0; + PyErr_SetString(PyExc_RuntimeError, "Module '_queue' has already been imported. Re-initialisation is not supported."); + return -1; + } + #elif PY_MAJOR_VERSION >= 3 + if (__pyx_m) return __Pyx_NewRef(__pyx_m); + #endif + #if CYTHON_REFNANNY +__Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); +if (!__Pyx_RefNanny) { + PyErr_Clear(); + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); + if (!__Pyx_RefNanny) + Py_FatalError("failed to import 'refnanny' module"); +} +#endif + __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit__queue(void)", 0); + if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #ifdef __Pxy_PyFrame_Initialize_Offsets + __Pxy_PyFrame_Initialize_Offsets(); + #endif + __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) + #ifdef __Pyx_CyFunction_USED + if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_FusedFunction_USED + if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_Coroutine_USED + if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_Generator_USED + if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_AsyncGen_USED + if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_StopAsyncIteration_USED + if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + /*--- Library function declarations ---*/ + /*--- Threads initialization code ---*/ + #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS + #ifdef WITH_THREAD /* Python build with threading support? */ + PyEval_InitThreads(); + #endif + #endif + /*--- Module creation code ---*/ + #if CYTHON_PEP489_MULTI_PHASE_INIT + __pyx_m = __pyx_pyinit_module; + Py_INCREF(__pyx_m); + #else + #if PY_MAJOR_VERSION < 3 + __pyx_m = Py_InitModule4("_queue", __pyx_methods, __pyx_k_Synchronized_queues_The_mod_gev, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); + #else + __pyx_m = PyModule_Create(&__pyx_moduledef); + #endif + if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) + Py_INCREF(__pyx_d); + __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) + #if CYTHON_COMPILING_IN_PYPY + Py_INCREF(__pyx_b); + #endif + if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + /*--- Initialize various global constants etc. ---*/ + if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) + if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + if (__pyx_module_is_main_gevent___queue) { + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + } + #if PY_MAJOR_VERSION >= 3 + { + PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) + if (!PyDict_GetItemString(modules, "gevent._queue")) { + if (unlikely(PyDict_SetItemString(modules, "gevent._queue", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error) + } + } + #endif + /*--- Builtin init code ---*/ + if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + /*--- Constants init code ---*/ + if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + /*--- Global type/function init code ---*/ + (void)__Pyx_modinit_global_init_code(); + if (unlikely(__Pyx_modinit_variable_export_code() != 0)) goto __pyx_L1_error; + if (unlikely(__Pyx_modinit_function_export_code() != 0)) goto __pyx_L1_error; + if (unlikely(__Pyx_modinit_type_init_code() != 0)) goto __pyx_L1_error; + if (unlikely(__Pyx_modinit_type_import_code() != 0)) goto __pyx_L1_error; + if (unlikely(__Pyx_modinit_variable_import_code() != 0)) goto __pyx_L1_error; + if (unlikely(__Pyx_modinit_function_import_code() != 0)) goto __pyx_L1_error; + /*--- Execution code ---*/ + #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) + if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + + /* "src/gevent/queue.py":31 + * + * from __future__ import absolute_import + * import sys # <<<<<<<<<<<<<< + * from heapq import heappush as _heappush + * from heapq import heappop as _heappop + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_sys, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 31, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_sys, __pyx_t_1) < 0) __PYX_ERR(0, 31, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/queue.py":32 + * from __future__ import absolute_import + * import sys + * from heapq import heappush as _heappush # <<<<<<<<<<<<<< + * from heapq import heappop as _heappop + * from heapq import heapify as _heapify + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 32, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_heappush_2); + __Pyx_GIVEREF(__pyx_n_s_heappush_2); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_heappush_2); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_heapq, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 32, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_heappush_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 32, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_v_6gevent_6_queue__heappush); + __Pyx_DECREF_SET(__pyx_v_6gevent_6_queue__heappush, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/queue.py":33 + * import sys + * from heapq import heappush as _heappush + * from heapq import heappop as _heappop # <<<<<<<<<<<<<< + * from heapq import heapify as _heapify + * import collections + */ + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 33, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_heappop_2); + __Pyx_GIVEREF(__pyx_n_s_heappop_2); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_heappop_2); + __pyx_t_1 = __Pyx_Import(__pyx_n_s_heapq, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 33, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_heappop_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 33, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_v_6gevent_6_queue__heappop); + __Pyx_DECREF_SET(__pyx_v_6gevent_6_queue__heappop, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/queue.py":34 + * from heapq import heappush as _heappush + * from heapq import heappop as _heappop + * from heapq import heapify as _heapify # <<<<<<<<<<<<<< + * import collections + * + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 34, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_heapify_2); + __Pyx_GIVEREF(__pyx_n_s_heapify_2); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_heapify_2); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_heapq, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 34, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_heapify_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 34, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_v_6gevent_6_queue__heapify); + __Pyx_DECREF_SET(__pyx_v_6gevent_6_queue__heapify, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/queue.py":35 + * from heapq import heappop as _heappop + * from heapq import heapify as _heapify + * import collections # <<<<<<<<<<<<<< + * + * if sys.version_info[0] == 2: + */ + __pyx_t_2 = __Pyx_Import(__pyx_n_s_collections, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 35, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_collections, __pyx_t_2) < 0) __PYX_ERR(0, 35, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/queue.py":37 + * import collections + * + * if sys.version_info[0] == 2: # <<<<<<<<<<<<<< + * import Queue as __queue__ # python 3: pylint:disable=import-error + * else: + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_sys); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 37, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_version_info); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 37, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 37, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyInt_EqObjC(__pyx_t_2, __pyx_int_2, 2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 37, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 37, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_3) { + + /* "src/gevent/queue.py":38 + * + * if sys.version_info[0] == 2: + * import Queue as __queue__ # python 3: pylint:disable=import-error # <<<<<<<<<<<<<< + * else: + * import queue as __queue__ # python 2: pylint:disable=import-error + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_Queue, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 38, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_queue_2, __pyx_t_1) < 0) __PYX_ERR(0, 38, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/queue.py":37 + * import collections + * + * if sys.version_info[0] == 2: # <<<<<<<<<<<<<< + * import Queue as __queue__ # python 3: pylint:disable=import-error + * else: + */ + goto __pyx_L2; + } + + /* "src/gevent/queue.py":40 + * import Queue as __queue__ # python 3: pylint:disable=import-error + * else: + * import queue as __queue__ # python 2: pylint:disable=import-error # <<<<<<<<<<<<<< + * Full = __queue__.Full + * Empty = __queue__.Empty + */ + /*else*/ { + __pyx_t_1 = __Pyx_Import(__pyx_n_s_queue, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 40, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_queue_2, __pyx_t_1) < 0) __PYX_ERR(0, 40, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + __pyx_L2:; + + /* "src/gevent/queue.py":41 + * else: + * import queue as __queue__ # python 2: pylint:disable=import-error + * Full = __queue__.Full # <<<<<<<<<<<<<< + * Empty = __queue__.Empty + * + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_queue_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 41, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_Full); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 41, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_Full, __pyx_t_2) < 0) __PYX_ERR(0, 41, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/queue.py":42 + * import queue as __queue__ # python 2: pylint:disable=import-error + * Full = __queue__.Full + * Empty = __queue__.Empty # <<<<<<<<<<<<<< + * + * from gevent.timeout import Timeout + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_queue_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 42, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_Empty); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 42, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_Empty, __pyx_t_1) < 0) __PYX_ERR(0, 42, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/queue.py":44 + * Empty = __queue__.Empty + * + * from gevent.timeout import Timeout # <<<<<<<<<<<<<< + * from gevent._hub_local import get_hub_noargs as get_hub + * from greenlet import getcurrent + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 44, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_Timeout); + __Pyx_GIVEREF(__pyx_n_s_Timeout); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_Timeout); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_gevent_timeout, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 44, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_Timeout); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 44, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_Timeout, __pyx_t_1) < 0) __PYX_ERR(0, 44, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/queue.py":45 + * + * from gevent.timeout import Timeout + * from gevent._hub_local import get_hub_noargs as get_hub # <<<<<<<<<<<<<< + * from greenlet import getcurrent + * from gevent.exceptions import InvalidSwitchError + */ + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 45, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_get_hub_noargs); + __Pyx_GIVEREF(__pyx_n_s_get_hub_noargs); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_get_hub_noargs); + __pyx_t_1 = __Pyx_Import(__pyx_n_s_gevent__hub_local, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 45, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_get_hub_noargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 45, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_hub, __pyx_t_2) < 0) __PYX_ERR(0, 45, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/queue.py":46 + * from gevent.timeout import Timeout + * from gevent._hub_local import get_hub_noargs as get_hub + * from greenlet import getcurrent # <<<<<<<<<<<<<< + * from gevent.exceptions import InvalidSwitchError + * + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 46, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_getcurrent); + __Pyx_GIVEREF(__pyx_n_s_getcurrent); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_getcurrent); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_greenlet, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 46, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_getcurrent); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 46, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_getcurrent, __pyx_t_1) < 0) __PYX_ERR(0, 46, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/queue.py":47 + * from gevent._hub_local import get_hub_noargs as get_hub + * from greenlet import getcurrent + * from gevent.exceptions import InvalidSwitchError # <<<<<<<<<<<<<< + * + * __all__ = [] + */ + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 47, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_InvalidSwitchError); + __Pyx_GIVEREF(__pyx_n_s_InvalidSwitchError); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_InvalidSwitchError); + __pyx_t_1 = __Pyx_Import(__pyx_n_s_gevent_exceptions, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 47, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_InvalidSwitchError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 47, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_InvalidSwitchError, __pyx_t_2) < 0) __PYX_ERR(0, 47, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/queue.py":49 + * from gevent.exceptions import InvalidSwitchError + * + * __all__ = [] # <<<<<<<<<<<<<< + * __implements__ = ['Queue', 'PriorityQueue', 'LifoQueue'] + * __extensions__ = ['JoinableQueue', 'Channel'] + */ + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 49, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_all, __pyx_t_1) < 0) __PYX_ERR(0, 49, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/queue.py":50 + * + * __all__ = [] + * __implements__ = ['Queue', 'PriorityQueue', 'LifoQueue'] # <<<<<<<<<<<<<< + * __extensions__ = ['JoinableQueue', 'Channel'] + * __imports__ = ['Empty', 'Full'] + */ + __pyx_t_1 = PyList_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 50, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_Queue); + __Pyx_GIVEREF(__pyx_n_s_Queue); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_Queue); + __Pyx_INCREF(__pyx_n_s_PriorityQueue); + __Pyx_GIVEREF(__pyx_n_s_PriorityQueue); + PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_PriorityQueue); + __Pyx_INCREF(__pyx_n_s_LifoQueue); + __Pyx_GIVEREF(__pyx_n_s_LifoQueue); + PyList_SET_ITEM(__pyx_t_1, 2, __pyx_n_s_LifoQueue); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_implements, __pyx_t_1) < 0) __PYX_ERR(0, 50, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/queue.py":51 + * __all__ = [] + * __implements__ = ['Queue', 'PriorityQueue', 'LifoQueue'] + * __extensions__ = ['JoinableQueue', 'Channel'] # <<<<<<<<<<<<<< + * __imports__ = ['Empty', 'Full'] + * if hasattr(__queue__, 'SimpleQueue'): + */ + __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 51, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_JoinableQueue); + __Pyx_GIVEREF(__pyx_n_s_JoinableQueue); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_JoinableQueue); + __Pyx_INCREF(__pyx_n_s_Channel); + __Pyx_GIVEREF(__pyx_n_s_Channel); + PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_Channel); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_extensions, __pyx_t_1) < 0) __PYX_ERR(0, 51, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/queue.py":52 + * __implements__ = ['Queue', 'PriorityQueue', 'LifoQueue'] + * __extensions__ = ['JoinableQueue', 'Channel'] + * __imports__ = ['Empty', 'Full'] # <<<<<<<<<<<<<< + * if hasattr(__queue__, 'SimpleQueue'): + * __all__.append('SimpleQueue') # New in 3.7 + */ + __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 52, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_Empty); + __Pyx_GIVEREF(__pyx_n_s_Empty); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_Empty); + __Pyx_INCREF(__pyx_n_s_Full); + __Pyx_GIVEREF(__pyx_n_s_Full); + PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_Full); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_imports, __pyx_t_1) < 0) __PYX_ERR(0, 52, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/queue.py":53 + * __extensions__ = ['JoinableQueue', 'Channel'] + * __imports__ = ['Empty', 'Full'] + * if hasattr(__queue__, 'SimpleQueue'): # <<<<<<<<<<<<<< + * __all__.append('SimpleQueue') # New in 3.7 + * # SimpleQueue is implemented in C and directly allocates locks + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_queue_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 53, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_HasAttr(__pyx_t_1, __pyx_n_s_SimpleQueue); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 53, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_4 = (__pyx_t_3 != 0); + if (__pyx_t_4) { + + /* "src/gevent/queue.py":54 + * __imports__ = ['Empty', 'Full'] + * if hasattr(__queue__, 'SimpleQueue'): + * __all__.append('SimpleQueue') # New in 3.7 # <<<<<<<<<<<<<< + * # SimpleQueue is implemented in C and directly allocates locks + * # unaffected by monkey patching. We need the Python version. + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_all); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 54, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_n_s_SimpleQueue); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 54, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/queue.py":57 + * # SimpleQueue is implemented in C and directly allocates locks + * # unaffected by monkey patching. We need the Python version. + * SimpleQueue = __queue__._PySimpleQueue # pylint:disable=no-member # <<<<<<<<<<<<<< + * __all__ += (__implements__ + __extensions__ + __imports__) + * + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_queue_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 57, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_PySimpleQueue); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 57, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_SimpleQueue, __pyx_t_2) < 0) __PYX_ERR(0, 57, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "src/gevent/queue.py":53 + * __extensions__ = ['JoinableQueue', 'Channel'] + * __imports__ = ['Empty', 'Full'] + * if hasattr(__queue__, 'SimpleQueue'): # <<<<<<<<<<<<<< + * __all__.append('SimpleQueue') # New in 3.7 + * # SimpleQueue is implemented in C and directly allocates locks + */ + } + + /* "src/gevent/queue.py":58 + * # unaffected by monkey patching. We need the Python version. + * SimpleQueue = __queue__._PySimpleQueue # pylint:disable=no-member + * __all__ += (__implements__ + __extensions__ + __imports__) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_all); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 58, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_implements); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 58, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_extensions); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 58, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = PyNumber_Add(__pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 58, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_imports); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 58, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_1 = PyNumber_Add(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 58, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyNumber_InPlaceAdd(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 58, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_all, __pyx_t_6) < 0) __PYX_ERR(0, 58, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "src/gevent/queue.py":72 + * pass + * + * import gevent._waiter # <<<<<<<<<<<<<< + * locals()['Waiter'] = gevent._waiter.Waiter + * + */ + __pyx_t_6 = __Pyx_Import(__pyx_n_s_gevent__waiter, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 72, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_gevent, __pyx_t_6) < 0) __PYX_ERR(0, 72, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "src/gevent/queue.py":73 + * + * import gevent._waiter + * locals()['Waiter'] = gevent._waiter.Waiter # <<<<<<<<<<<<<< + * + * class ItemWaiter(Waiter): # pylint:disable=undefined-variable + */ + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_gevent); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 73, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_waiter); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 73, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_Waiter); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 73, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_Globals(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 73, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (unlikely(PyDict_SetItem(__pyx_t_1, __pyx_n_s_Waiter, __pyx_t_6) < 0)) __PYX_ERR(0, 73, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "src/gevent/queue.py":78 + * # pylint:disable=assigning-non-slot + * __slots__ = ( + * 'item', # <<<<<<<<<<<<<< + * 'queue', + * ) + */ + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_ItemWaiter->tp_dict, __pyx_n_s_slots, __pyx_tuple__7) < 0) __PYX_ERR(0, 77, __pyx_L1_error) + PyType_Modified(__pyx_ptype_6gevent_6_queue_ItemWaiter); + + /* "src/gevent/queue.py":87 + * self.queue = queue + * + * def put_and_switch(self): # <<<<<<<<<<<<<< + * self.queue._put(self.item) + * self.queue = None + */ + __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_queue_10ItemWaiter_3put_and_switch, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ItemWaiter_put_and_switch, NULL, __pyx_n_s_gevent__queue, __pyx_d, ((PyObject *)__pyx_codeobj__9)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 87, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_ItemWaiter->tp_dict, __pyx_n_s_put_and_switch, __pyx_t_6) < 0) __PYX_ERR(0, 87, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + PyType_Modified(__pyx_ptype_6gevent_6_queue_ItemWaiter); + + /* "src/gevent/queue.py":115 + * + * __slots__ = ( + * '_maxsize', # <<<<<<<<<<<<<< + * 'getters', + * 'putters', + */ + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_Queue->tp_dict, __pyx_n_s_slots, __pyx_tuple__10) < 0) __PYX_ERR(0, 114, __pyx_L1_error) + PyType_Modified(__pyx_ptype_6gevent_6_queue_Queue); + + /* "src/gevent/queue.py":165 + * self._maxsize = nv + * + * def copy(self): # <<<<<<<<<<<<<< + * return type(self)(self.maxsize, self.queue) + * + */ + __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_queue_5Queue_3copy, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Queue_copy, NULL, __pyx_n_s_gevent__queue, __pyx_d, ((PyObject *)__pyx_codeobj__12)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 165, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_Queue->tp_dict, __pyx_n_s_copy, __pyx_t_6) < 0) __PYX_ERR(0, 165, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + PyType_Modified(__pyx_ptype_6gevent_6_queue_Queue); + + /* "src/gevent/queue.py":168 + * return type(self)(self.maxsize, self.queue) + * + * def _create_queue(self, items=()): # <<<<<<<<<<<<<< + * return collections.deque(items) + * + */ + __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_queue_5Queue_5_create_queue, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Queue__create_queue, NULL, __pyx_n_s_gevent__queue, __pyx_d, ((PyObject *)__pyx_codeobj__14)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 168, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_Queue->tp_dict, __pyx_n_s_create_queue, __pyx_t_6) < 0) __PYX_ERR(0, 168, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + PyType_Modified(__pyx_ptype_6gevent_6_queue_Queue); + + /* "src/gevent/queue.py":171 + * return collections.deque(items) + * + * def _get(self): # <<<<<<<<<<<<<< + * return self.queue.popleft() + * + */ + __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_queue_5Queue_7_get, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Queue__get, NULL, __pyx_n_s_gevent__queue, __pyx_d, ((PyObject *)__pyx_codeobj__16)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 171, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_Queue->tp_dict, __pyx_n_s_get, __pyx_t_6) < 0) __PYX_ERR(0, 171, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + PyType_Modified(__pyx_ptype_6gevent_6_queue_Queue); + + /* "src/gevent/queue.py":174 + * return self.queue.popleft() + * + * def _peek(self): # <<<<<<<<<<<<<< + * return self.queue[0] + * + */ + __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_queue_5Queue_9_peek, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Queue__peek, NULL, __pyx_n_s_gevent__queue, __pyx_d, ((PyObject *)__pyx_codeobj__18)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 174, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_Queue->tp_dict, __pyx_n_s_peek, __pyx_t_6) < 0) __PYX_ERR(0, 174, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + PyType_Modified(__pyx_ptype_6gevent_6_queue_Queue); + + /* "src/gevent/queue.py":177 + * return self.queue[0] + * + * def _put(self, item): # <<<<<<<<<<<<<< + * self.queue.append(item) + * + */ + __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_queue_5Queue_11_put, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Queue__put, NULL, __pyx_n_s_gevent__queue, __pyx_d, ((PyObject *)__pyx_codeobj__20)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 177, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_Queue->tp_dict, __pyx_n_s_put, __pyx_t_6) < 0) __PYX_ERR(0, 177, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + PyType_Modified(__pyx_ptype_6gevent_6_queue_Queue); + + /* "src/gevent/queue.py":186 + * return '<%s%s>' % (type(self).__name__, self._format()) + * + * def _format(self): # <<<<<<<<<<<<<< + * result = [] + * if self.maxsize is not None: + */ + __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_queue_5Queue_17_format, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Queue__format, NULL, __pyx_n_s_gevent__queue, __pyx_d, ((PyObject *)__pyx_codeobj__22)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 186, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_Queue->tp_dict, __pyx_n_s_format, __pyx_t_6) < 0) __PYX_ERR(0, 186, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + PyType_Modified(__pyx_ptype_6gevent_6_queue_Queue); + + /* "src/gevent/queue.py":200 + * return '' + * + * def qsize(self): # <<<<<<<<<<<<<< + * """Return the size of the queue.""" + * return len(self.queue) + */ + __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_queue_5Queue_19qsize, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Queue_qsize, NULL, __pyx_n_s_gevent__queue, __pyx_d, ((PyObject *)__pyx_codeobj__24)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 200, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_Queue->tp_dict, __pyx_n_s_qsize, __pyx_t_6) < 0) __PYX_ERR(0, 200, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + PyType_Modified(__pyx_ptype_6gevent_6_queue_Queue); + + /* "src/gevent/queue.py":232 + * return True + * + * def empty(self): # <<<<<<<<<<<<<< + * """Return ``True`` if the queue is empty, ``False`` otherwise.""" + * return not self.qsize() + */ + __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_queue_5Queue_27empty, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Queue_empty, NULL, __pyx_n_s_gevent__queue, __pyx_d, ((PyObject *)__pyx_codeobj__26)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 232, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_Queue->tp_dict, __pyx_n_s_empty, __pyx_t_6) < 0) __PYX_ERR(0, 232, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + PyType_Modified(__pyx_ptype_6gevent_6_queue_Queue); + + /* "src/gevent/queue.py":236 + * return not self.qsize() + * + * def full(self): # <<<<<<<<<<<<<< + * """Return ``True`` if the queue is full, ``False`` otherwise. + * + */ + __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_queue_5Queue_29full, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Queue_full, NULL, __pyx_n_s_gevent__queue, __pyx_d, ((PyObject *)__pyx_codeobj__28)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 236, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_Queue->tp_dict, __pyx_n_s_full, __pyx_t_6) < 0) __PYX_ERR(0, 236, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + PyType_Modified(__pyx_ptype_6gevent_6_queue_Queue); + + /* "src/gevent/queue.py":243 + * return self._maxsize > 0 and self.qsize() >= self._maxsize + * + * def put(self, item, block=True, timeout=None): # <<<<<<<<<<<<<< + * """Put an item into the queue. + * + */ + __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_queue_5Queue_31put, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Queue_put, NULL, __pyx_n_s_gevent__queue, __pyx_d, ((PyObject *)__pyx_codeobj__30)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 243, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_Queue->tp_dict, __pyx_n_s_put_2, __pyx_t_6) < 0) __PYX_ERR(0, 243, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + PyType_Modified(__pyx_ptype_6gevent_6_queue_Queue); + + /* "src/gevent/queue.py":285 + * raise Full + * + * def put_nowait(self, item): # <<<<<<<<<<<<<< + * """Put an item into the queue without blocking. + * + */ + __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_queue_5Queue_33put_nowait, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Queue_put_nowait, NULL, __pyx_n_s_gevent__queue, __pyx_d, ((PyObject *)__pyx_codeobj__32)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 285, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_Queue->tp_dict, __pyx_n_s_put_nowait, __pyx_t_6) < 0) __PYX_ERR(0, 285, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + PyType_Modified(__pyx_ptype_6gevent_6_queue_Queue); + + /* "src/gevent/queue.py":329 + * _safe_remove(self.getters, waiter) + * + * def get(self, block=True, timeout=None): # <<<<<<<<<<<<<< + * """Remove and return an item from the queue. + * + */ + __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_queue_5Queue_35get, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Queue_get, NULL, __pyx_n_s_gevent__queue, __pyx_d, ((PyObject *)__pyx_codeobj__34)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 329, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_Queue->tp_dict, __pyx_n_s_get_2, __pyx_t_6) < 0) __PYX_ERR(0, 329, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + PyType_Modified(__pyx_ptype_6gevent_6_queue_Queue); + + /* "src/gevent/queue.py":346 + * return self.__get_or_peek(self._get, block, timeout) + * + * def get_nowait(self): # <<<<<<<<<<<<<< + * """Remove and return an item from the queue without blocking. + * + */ + __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_queue_5Queue_37get_nowait, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Queue_get_nowait, NULL, __pyx_n_s_gevent__queue, __pyx_d, ((PyObject *)__pyx_codeobj__36)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 346, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_Queue->tp_dict, __pyx_n_s_get_nowait, __pyx_t_6) < 0) __PYX_ERR(0, 346, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + PyType_Modified(__pyx_ptype_6gevent_6_queue_Queue); + + /* "src/gevent/queue.py":354 + * return self.get(False) + * + * def peek(self, block=True, timeout=None): # <<<<<<<<<<<<<< + * """Return an item from the queue without removing it. + * + */ + __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_queue_5Queue_39peek, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Queue_peek, NULL, __pyx_n_s_gevent__queue, __pyx_d, ((PyObject *)__pyx_codeobj__38)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 354, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_Queue->tp_dict, __pyx_n_s_peek_2, __pyx_t_6) < 0) __PYX_ERR(0, 354, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + PyType_Modified(__pyx_ptype_6gevent_6_queue_Queue); + + /* "src/gevent/queue.py":370 + * return self.__get_or_peek(self._peek, block, timeout) + * + * def peek_nowait(self): # <<<<<<<<<<<<<< + * """Return an item from the queue without blocking. + * + */ + __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_queue_5Queue_41peek_nowait, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Queue_peek_nowait, NULL, __pyx_n_s_gevent__queue, __pyx_d, ((PyObject *)__pyx_codeobj__40)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 370, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_Queue->tp_dict, __pyx_n_s_peek_nowait, __pyx_t_6) < 0) __PYX_ERR(0, 370, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + PyType_Modified(__pyx_ptype_6gevent_6_queue_Queue); + + /* "src/gevent/queue.py":378 + * return self.peek(False) + * + * def _unlock(self): # <<<<<<<<<<<<<< + * while True: + * repeat = False + */ + __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_queue_5Queue_43_unlock, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Queue__unlock, NULL, __pyx_n_s_gevent__queue, __pyx_d, ((PyObject *)__pyx_codeobj__42)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 378, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_Queue->tp_dict, __pyx_n_s_unlock, __pyx_t_6) < 0) __PYX_ERR(0, 378, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + PyType_Modified(__pyx_ptype_6gevent_6_queue_Queue); + + /* "src/gevent/queue.py":410 + * return result + * + * next = __next__ # Py2 # <<<<<<<<<<<<<< + * + * + */ + __Pyx_GetNameInClass(__pyx_t_6, (PyObject *)__pyx_ptype_6gevent_6_queue_Queue, __pyx_n_s_next); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 410, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_Queue->tp_dict, __pyx_n_s_next_2, __pyx_t_6) < 0) __PYX_ERR(0, 410, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + PyType_Modified(__pyx_ptype_6gevent_6_queue_Queue); + + /* "src/gevent/queue.py":417 + * # be bound. Changing its maxsize has no effect. + * + * __slots__ = () # <<<<<<<<<<<<<< + * + * def __init__(self, maxsize=None, items=()): + */ + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_UnboundQueue->tp_dict, __pyx_n_s_slots, __pyx_empty_tuple) < 0) __PYX_ERR(0, 417, __pyx_L1_error) + PyType_Modified(__pyx_ptype_6gevent_6_queue_UnboundQueue); + + /* "src/gevent/queue.py":425 + * self.putters = None # Will never be used. + * + * def put(self, item, block=True, timeout=None): # <<<<<<<<<<<<<< + * self._put(item) + * if self.getters: + */ + __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_queue_12UnboundQueue_3put, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_UnboundQueue_put, NULL, __pyx_n_s_gevent__queue, __pyx_d, ((PyObject *)__pyx_codeobj__44)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 425, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_UnboundQueue->tp_dict, __pyx_n_s_put_2, __pyx_t_6) < 0) __PYX_ERR(0, 425, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + PyType_Modified(__pyx_ptype_6gevent_6_queue_UnboundQueue); + + /* "src/gevent/queue.py":442 + * ''' + * + * __slots__ = () # <<<<<<<<<<<<<< + * + * def _create_queue(self, items=()): + */ + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_PriorityQueue->tp_dict, __pyx_n_s_slots, __pyx_empty_tuple) < 0) __PYX_ERR(0, 442, __pyx_L1_error) + PyType_Modified(__pyx_ptype_6gevent_6_queue_PriorityQueue); + + /* "src/gevent/queue.py":444 + * __slots__ = () + * + * def _create_queue(self, items=()): # <<<<<<<<<<<<<< + * q = list(items) + * _heapify(q) + */ + __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_queue_13PriorityQueue_1_create_queue, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_PriorityQueue__create_queue, NULL, __pyx_n_s_gevent__queue, __pyx_d, ((PyObject *)__pyx_codeobj__46)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 444, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_PriorityQueue->tp_dict, __pyx_n_s_create_queue, __pyx_t_6) < 0) __PYX_ERR(0, 444, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + PyType_Modified(__pyx_ptype_6gevent_6_queue_PriorityQueue); + + /* "src/gevent/queue.py":449 + * return q + * + * def _put(self, item): # <<<<<<<<<<<<<< + * _heappush(self.queue, item) + * + */ + __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_queue_13PriorityQueue_3_put, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_PriorityQueue__put, NULL, __pyx_n_s_gevent__queue, __pyx_d, ((PyObject *)__pyx_codeobj__48)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 449, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_PriorityQueue->tp_dict, __pyx_n_s_put, __pyx_t_6) < 0) __PYX_ERR(0, 449, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + PyType_Modified(__pyx_ptype_6gevent_6_queue_PriorityQueue); + + /* "src/gevent/queue.py":452 + * _heappush(self.queue, item) + * + * def _get(self): # <<<<<<<<<<<<<< + * return _heappop(self.queue) + * + */ + __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_queue_13PriorityQueue_5_get, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_PriorityQueue__get, NULL, __pyx_n_s_gevent__queue, __pyx_d, ((PyObject *)__pyx_codeobj__50)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 452, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_PriorityQueue->tp_dict, __pyx_n_s_get, __pyx_t_6) < 0) __PYX_ERR(0, 452, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + PyType_Modified(__pyx_ptype_6gevent_6_queue_PriorityQueue); + + /* "src/gevent/queue.py":459 + * '''A subclass of :class:`Queue` that retrieves most recently added entries first.''' + * + * __slots__ = () # <<<<<<<<<<<<<< + * + * def _create_queue(self, items=()): + */ + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_LifoQueue->tp_dict, __pyx_n_s_slots, __pyx_empty_tuple) < 0) __PYX_ERR(0, 459, __pyx_L1_error) + PyType_Modified(__pyx_ptype_6gevent_6_queue_LifoQueue); + + /* "src/gevent/queue.py":461 + * __slots__ = () + * + * def _create_queue(self, items=()): # <<<<<<<<<<<<<< + * return list(items) + * + */ + __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_queue_9LifoQueue_1_create_queue, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_LifoQueue__create_queue, NULL, __pyx_n_s_gevent__queue, __pyx_d, ((PyObject *)__pyx_codeobj__52)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 461, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_LifoQueue->tp_dict, __pyx_n_s_create_queue, __pyx_t_6) < 0) __PYX_ERR(0, 461, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + PyType_Modified(__pyx_ptype_6gevent_6_queue_LifoQueue); + + /* "src/gevent/queue.py":464 + * return list(items) + * + * def _put(self, item): # <<<<<<<<<<<<<< + * self.queue.append(item) + * + */ + __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_queue_9LifoQueue_3_put, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_LifoQueue__put, NULL, __pyx_n_s_gevent__queue, __pyx_d, ((PyObject *)__pyx_codeobj__54)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 464, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_LifoQueue->tp_dict, __pyx_n_s_put, __pyx_t_6) < 0) __PYX_ERR(0, 464, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + PyType_Modified(__pyx_ptype_6gevent_6_queue_LifoQueue); + + /* "src/gevent/queue.py":467 + * self.queue.append(item) + * + * def _get(self): # <<<<<<<<<<<<<< + * return self.queue.pop() + * + */ + __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_queue_9LifoQueue_5_get, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_LifoQueue__get, NULL, __pyx_n_s_gevent__queue, __pyx_d, ((PyObject *)__pyx_codeobj__56)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 467, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_LifoQueue->tp_dict, __pyx_n_s_get, __pyx_t_6) < 0) __PYX_ERR(0, 467, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + PyType_Modified(__pyx_ptype_6gevent_6_queue_LifoQueue); + + /* "src/gevent/queue.py":470 + * return self.queue.pop() + * + * def _peek(self): # <<<<<<<<<<<<<< + * return self.queue[-1] + * + */ + __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_queue_9LifoQueue_7_peek, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_LifoQueue__peek, NULL, __pyx_n_s_gevent__queue, __pyx_d, ((PyObject *)__pyx_codeobj__58)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 470, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_LifoQueue->tp_dict, __pyx_n_s_peek, __pyx_t_6) < 0) __PYX_ERR(0, 470, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + PyType_Modified(__pyx_ptype_6gevent_6_queue_LifoQueue); + + /* "src/gevent/queue.py":481 + * + * __slots__ = ( + * '_cond', # <<<<<<<<<<<<<< + * 'unfinished_tasks', + * ) + */ + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_JoinableQueue->tp_dict, __pyx_n_s_slots, __pyx_tuple__59) < 0) __PYX_ERR(0, 480, __pyx_L1_error) + PyType_Modified(__pyx_ptype_6gevent_6_queue_JoinableQueue); + + /* "src/gevent/queue.py":509 + * self._cond.clear() + * + * def copy(self): # <<<<<<<<<<<<<< + * return type(self)(self.maxsize, self.queue, self.unfinished_tasks) + * + */ + __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_queue_13JoinableQueue_3copy, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_JoinableQueue_copy, NULL, __pyx_n_s_gevent__queue, __pyx_d, ((PyObject *)__pyx_codeobj__61)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 509, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_JoinableQueue->tp_dict, __pyx_n_s_copy, __pyx_t_6) < 0) __PYX_ERR(0, 509, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + PyType_Modified(__pyx_ptype_6gevent_6_queue_JoinableQueue); + + /* "src/gevent/queue.py":512 + * return type(self)(self.maxsize, self.queue, self.unfinished_tasks) + * + * def _format(self): # <<<<<<<<<<<<<< + * result = Queue._format(self) + * if self.unfinished_tasks: + */ + __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_queue_13JoinableQueue_5_format, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_JoinableQueue__format, NULL, __pyx_n_s_gevent__queue, __pyx_d, ((PyObject *)__pyx_codeobj__63)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 512, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_JoinableQueue->tp_dict, __pyx_n_s_format, __pyx_t_6) < 0) __PYX_ERR(0, 512, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + PyType_Modified(__pyx_ptype_6gevent_6_queue_JoinableQueue); + + /* "src/gevent/queue.py":518 + * return result + * + * def _put(self, item): # <<<<<<<<<<<<<< + * Queue._put(self, item) + * self.unfinished_tasks += 1 + */ + __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_queue_13JoinableQueue_7_put, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_JoinableQueue__put, NULL, __pyx_n_s_gevent__queue, __pyx_d, ((PyObject *)__pyx_codeobj__65)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 518, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_JoinableQueue->tp_dict, __pyx_n_s_put, __pyx_t_6) < 0) __PYX_ERR(0, 518, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + PyType_Modified(__pyx_ptype_6gevent_6_queue_JoinableQueue); + + /* "src/gevent/queue.py":523 + * self._cond.clear() + * + * def task_done(self): # <<<<<<<<<<<<<< + * '''Indicate that a formerly enqueued task is complete. Used by queue consumer threads. + * For each :meth:`get ` used to fetch a task, a subsequent call to :meth:`task_done` tells the queue + */ + __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_queue_13JoinableQueue_9task_done, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_JoinableQueue_task_done, NULL, __pyx_n_s_gevent__queue, __pyx_d, ((PyObject *)__pyx_codeobj__67)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 523, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_JoinableQueue->tp_dict, __pyx_n_s_task_done, __pyx_t_6) < 0) __PYX_ERR(0, 523, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + PyType_Modified(__pyx_ptype_6gevent_6_queue_JoinableQueue); + + /* "src/gevent/queue.py":540 + * self._cond.set() + * + * def join(self, timeout=None): # <<<<<<<<<<<<<< + * ''' + * Block until all items in the queue have been gotten and processed. + */ + __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_queue_13JoinableQueue_11join, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_JoinableQueue_join, NULL, __pyx_n_s_gevent__queue, __pyx_d, ((PyObject *)__pyx_codeobj__69)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 540, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_JoinableQueue->tp_dict, __pyx_n_s_join, __pyx_t_6) < 0) __PYX_ERR(0, 540, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + PyType_Modified(__pyx_ptype_6gevent_6_queue_JoinableQueue); + + /* "src/gevent/queue.py":563 + * + * __slots__ = ( + * 'getters', # <<<<<<<<<<<<<< + * 'putters', + * 'hub', + */ + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_Channel->tp_dict, __pyx_n_s_slots, __pyx_tuple__70) < 0) __PYX_ERR(0, 562, __pyx_L1_error) + PyType_Modified(__pyx_ptype_6gevent_6_queue_Channel); + + /* "src/gevent/queue.py":585 + * return '<%s %s>' % (type(self).__name__, self._format()) + * + * def _format(self): # <<<<<<<<<<<<<< + * result = '' + * if self.getters: + */ + __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_queue_7Channel_7_format, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Channel__format, NULL, __pyx_n_s_gevent__queue, __pyx_d, ((PyObject *)__pyx_codeobj__72)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 585, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_Channel->tp_dict, __pyx_n_s_format, __pyx_t_6) < 0) __PYX_ERR(0, 585, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + PyType_Modified(__pyx_ptype_6gevent_6_queue_Channel); + + /* "src/gevent/queue.py":597 + * return len(self.putters) - len(self.getters) + * + * def qsize(self): # <<<<<<<<<<<<<< + * return 0 + * + */ + __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_queue_7Channel_9qsize, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Channel_qsize, NULL, __pyx_n_s_gevent__queue, __pyx_d, ((PyObject *)__pyx_codeobj__74)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 597, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_Channel->tp_dict, __pyx_n_s_qsize, __pyx_t_6) < 0) __PYX_ERR(0, 597, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + PyType_Modified(__pyx_ptype_6gevent_6_queue_Channel); + + /* "src/gevent/queue.py":600 + * return 0 + * + * def empty(self): # <<<<<<<<<<<<<< + * return True + * + */ + __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_queue_7Channel_11empty, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Channel_empty, NULL, __pyx_n_s_gevent__queue, __pyx_d, ((PyObject *)__pyx_codeobj__76)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 600, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_Channel->tp_dict, __pyx_n_s_empty, __pyx_t_6) < 0) __PYX_ERR(0, 600, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + PyType_Modified(__pyx_ptype_6gevent_6_queue_Channel); + + /* "src/gevent/queue.py":603 + * return True + * + * def full(self): # <<<<<<<<<<<<<< + * return True + * + */ + __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_queue_7Channel_13full, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Channel_full, NULL, __pyx_n_s_gevent__queue, __pyx_d, ((PyObject *)__pyx_codeobj__78)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 603, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_Channel->tp_dict, __pyx_n_s_full, __pyx_t_6) < 0) __PYX_ERR(0, 603, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + PyType_Modified(__pyx_ptype_6gevent_6_queue_Channel); + + /* "src/gevent/queue.py":606 + * return True + * + * def put(self, item, block=True, timeout=None): # <<<<<<<<<<<<<< + * if self.hub is getcurrent(): + * if self.getters: + */ + __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_queue_7Channel_15put, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Channel_put, NULL, __pyx_n_s_gevent__queue, __pyx_d, ((PyObject *)__pyx_codeobj__80)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 606, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_Channel->tp_dict, __pyx_n_s_put_2, __pyx_t_6) < 0) __PYX_ERR(0, 606, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + PyType_Modified(__pyx_ptype_6gevent_6_queue_Channel); + + /* "src/gevent/queue.py":633 + * timeout.cancel() + * + * def put_nowait(self, item): # <<<<<<<<<<<<<< + * self.put(item, False) + * + */ + __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_queue_7Channel_17put_nowait, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Channel_put_nowait, NULL, __pyx_n_s_gevent__queue, __pyx_d, ((PyObject *)__pyx_codeobj__82)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 633, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_Channel->tp_dict, __pyx_n_s_put_nowait, __pyx_t_6) < 0) __PYX_ERR(0, 633, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + PyType_Modified(__pyx_ptype_6gevent_6_queue_Channel); + + /* "src/gevent/queue.py":636 + * self.put(item, False) + * + * def get(self, block=True, timeout=None): # <<<<<<<<<<<<<< + * if self.hub is getcurrent(): + * if self.putters: + */ + __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_queue_7Channel_19get, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Channel_get, NULL, __pyx_n_s_gevent__queue, __pyx_d, ((PyObject *)__pyx_codeobj__84)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 636, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_Channel->tp_dict, __pyx_n_s_get_2, __pyx_t_6) < 0) __PYX_ERR(0, 636, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + PyType_Modified(__pyx_ptype_6gevent_6_queue_Channel); + + /* "src/gevent/queue.py":659 + * timeout.close() + * + * def get_nowait(self): # <<<<<<<<<<<<<< + * return self.get(False) + * + */ + __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_queue_7Channel_21get_nowait, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Channel_get_nowait, NULL, __pyx_n_s_gevent__queue, __pyx_d, ((PyObject *)__pyx_codeobj__86)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 659, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_Channel->tp_dict, __pyx_n_s_get_nowait, __pyx_t_6) < 0) __PYX_ERR(0, 659, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + PyType_Modified(__pyx_ptype_6gevent_6_queue_Channel); + + /* "src/gevent/queue.py":662 + * return self.get(False) + * + * def _unlock(self): # <<<<<<<<<<<<<< + * while self.putters and self.getters: + * getter = self.getters.popleft() + */ + __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_queue_7Channel_23_unlock, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Channel__unlock, NULL, __pyx_n_s_gevent__queue, __pyx_d, ((PyObject *)__pyx_codeobj__88)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 662, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_Channel->tp_dict, __pyx_n_s_unlock, __pyx_t_6) < 0) __PYX_ERR(0, 662, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + PyType_Modified(__pyx_ptype_6gevent_6_queue_Channel); + + /* "src/gevent/queue.py":682 + * return result + * + * next = __next__ # Py2 # <<<<<<<<<<<<<< + * + * from gevent._util import import_c_accel + */ + __Pyx_GetNameInClass(__pyx_t_6, (PyObject *)__pyx_ptype_6gevent_6_queue_Channel, __pyx_n_s_next); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 682, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_Channel->tp_dict, __pyx_n_s_next_2, __pyx_t_6) < 0) __PYX_ERR(0, 682, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + PyType_Modified(__pyx_ptype_6gevent_6_queue_Channel); + + /* "src/gevent/queue.py":684 + * next = __next__ # Py2 + * + * from gevent._util import import_c_accel # <<<<<<<<<<<<<< + * import_c_accel(globals(), 'gevent._queue') + */ + __pyx_t_6 = PyList_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 684, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(__pyx_n_s_import_c_accel); + __Pyx_GIVEREF(__pyx_n_s_import_c_accel); + PyList_SET_ITEM(__pyx_t_6, 0, __pyx_n_s_import_c_accel); + __pyx_t_1 = __Pyx_Import(__pyx_n_s_gevent__util, __pyx_t_6, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 684, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_import_c_accel); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 684, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_import_c_accel, __pyx_t_6) < 0) __PYX_ERR(0, 684, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "src/gevent/queue.py":685 + * + * from gevent._util import import_c_accel + * import_c_accel(globals(), 'gevent._queue') # <<<<<<<<<<<<<< + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_import_c_accel); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 685, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = __Pyx_Globals(); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 685, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 685, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_6); + __Pyx_INCREF(__pyx_n_s_gevent__queue); + __Pyx_GIVEREF(__pyx_n_s_gevent__queue); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_gevent__queue); + __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 685, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "src/gevent/queue.py":1 + * # Copyright (c) 2009-2012 Denis Bilenko. See LICENSE for details. # <<<<<<<<<<<<<< + * # copyright (c) 2018 gevent + * # cython: auto_pickle=False,embedsignature=True,always_allow_keywords=False + */ + __pyx_t_6 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_6) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "gevent/__abstract_linkable.pxd":24 + * return PyGreenlet_GetCurrent() + * + * cdef inline void greenlet_init(): # <<<<<<<<<<<<<< + * global _greenlet_imported + * if not _greenlet_imported: + */ + + /*--- Wrapped vars code ---*/ + + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + if (__pyx_m) { + if (__pyx_d) { + __Pyx_AddTraceback("init gevent._queue", __pyx_clineno, __pyx_lineno, __pyx_filename); + } + Py_CLEAR(__pyx_m); + } else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_ImportError, "init gevent._queue"); + } + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + #if CYTHON_PEP489_MULTI_PHASE_INIT + return (__pyx_m != NULL) ? 0 : -1; + #elif PY_MAJOR_VERSION >= 3 + return __pyx_m; + #else + return; + #endif +} + +/* --- Runtime support code --- */ +/* Refnanny */ +#if CYTHON_REFNANNY +static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { + PyObject *m = NULL, *p = NULL; + void *r = NULL; + m = PyImport_ImportModule(modname); + if (!m) goto end; + p = PyObject_GetAttrString(m, "RefNannyAPI"); + if (!p) goto end; + r = PyLong_AsVoidPtr(p); +end: + Py_XDECREF(p); + Py_XDECREF(m); + return (__Pyx_RefNannyAPIStruct *)r; +} +#endif + +/* PyObjectGetAttrStr */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_getattro)) + return tp->tp_getattro(obj, attr_name); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_getattr)) + return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); +#endif + return PyObject_GetAttr(obj, attr_name); +} +#endif + +/* GetBuiltinName */ +static PyObject *__Pyx_GetBuiltinName(PyObject *name) { + PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name); + if (unlikely(!result)) { + PyErr_Format(PyExc_NameError, +#if PY_MAJOR_VERSION >= 3 + "name '%U' is not defined", name); +#else + "name '%.200s' is not defined", PyString_AS_STRING(name)); +#endif + } + return result; +} + +/* PyCFunctionFastCall */ +#if CYTHON_FAST_PYCCALL +static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) { + PyCFunctionObject *func = (PyCFunctionObject*)func_obj; + PyCFunction meth = PyCFunction_GET_FUNCTION(func); + PyObject *self = PyCFunction_GET_SELF(func); + int flags = PyCFunction_GET_FLAGS(func); + assert(PyCFunction_Check(func)); + assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS))); + assert(nargs >= 0); + assert(nargs == 0 || args != NULL); + /* _PyCFunction_FastCallDict() must not be called with an exception set, + because it may clear it (directly or indirectly) and so the + caller loses its exception */ + assert(!PyErr_Occurred()); + if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) { + return (*((__Pyx_PyCFunctionFastWithKeywords)(void*)meth)) (self, args, nargs, NULL); + } else { + return (*((__Pyx_PyCFunctionFast)(void*)meth)) (self, args, nargs); + } +} +#endif + +/* PyFunctionFastCall */ +#if CYTHON_FAST_PYCALL +static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, + PyObject *globals) { + PyFrameObject *f; + PyThreadState *tstate = __Pyx_PyThreadState_Current; + PyObject **fastlocals; + Py_ssize_t i; + PyObject *result; + assert(globals != NULL); + /* XXX Perhaps we should create a specialized + PyFrame_New() that doesn't take locals, but does + take builtins without sanity checking them. + */ + assert(tstate != NULL); + f = PyFrame_New(tstate, co, globals, NULL); + if (f == NULL) { + return NULL; + } + fastlocals = __Pyx_PyFrame_GetLocalsplus(f); + for (i = 0; i < na; i++) { + Py_INCREF(*args); + fastlocals[i] = *args++; + } + result = PyEval_EvalFrameEx(f,0); + ++tstate->recursion_depth; + Py_DECREF(f); + --tstate->recursion_depth; + return result; +} +#if 1 || PY_VERSION_HEX < 0x030600B1 +static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs) { + PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); + PyObject *globals = PyFunction_GET_GLOBALS(func); + PyObject *argdefs = PyFunction_GET_DEFAULTS(func); + PyObject *closure; +#if PY_MAJOR_VERSION >= 3 + PyObject *kwdefs; +#endif + PyObject *kwtuple, **k; + PyObject **d; + Py_ssize_t nd; + Py_ssize_t nk; + PyObject *result; + assert(kwargs == NULL || PyDict_Check(kwargs)); + nk = kwargs ? PyDict_Size(kwargs) : 0; + if (Py_EnterRecursiveCall((char*)" while calling a Python object")) { + return NULL; + } + if ( +#if PY_MAJOR_VERSION >= 3 + co->co_kwonlyargcount == 0 && +#endif + likely(kwargs == NULL || nk == 0) && + co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { + if (argdefs == NULL && co->co_argcount == nargs) { + result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); + goto done; + } + else if (nargs == 0 && argdefs != NULL + && co->co_argcount == Py_SIZE(argdefs)) { + /* function called with no arguments, but all parameters have + a default value: use default values as arguments .*/ + args = &PyTuple_GET_ITEM(argdefs, 0); + result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); + goto done; + } + } + if (kwargs != NULL) { + Py_ssize_t pos, i; + kwtuple = PyTuple_New(2 * nk); + if (kwtuple == NULL) { + result = NULL; + goto done; + } + k = &PyTuple_GET_ITEM(kwtuple, 0); + pos = i = 0; + while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { + Py_INCREF(k[i]); + Py_INCREF(k[i+1]); + i += 2; + } + nk = i / 2; + } + else { + kwtuple = NULL; + k = NULL; + } + closure = PyFunction_GET_CLOSURE(func); +#if PY_MAJOR_VERSION >= 3 + kwdefs = PyFunction_GET_KW_DEFAULTS(func); +#endif + if (argdefs != NULL) { + d = &PyTuple_GET_ITEM(argdefs, 0); + nd = Py_SIZE(argdefs); + } + else { + d = NULL; + nd = 0; + } +#if PY_MAJOR_VERSION >= 3 + result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, + args, nargs, + k, (int)nk, + d, (int)nd, kwdefs, closure); +#else + result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, + args, nargs, + k, (int)nk, + d, (int)nd, closure); +#endif + Py_XDECREF(kwtuple); +done: + Py_LeaveRecursiveCall(); + return result; +} +#endif +#endif + +/* PyObjectCall */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { + PyObject *result; + ternaryfunc call = func->ob_type->tp_call; + if (unlikely(!call)) + return PyObject_Call(func, arg, kw); + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; + result = (*call)(func, arg, kw); + Py_LeaveRecursiveCall(); + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +/* PyObjectCall2Args */ +static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) { + PyObject *args, *result = NULL; + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(function)) { + PyObject *args[2] = {arg1, arg2}; + return __Pyx_PyFunction_FastCall(function, args, 2); + } + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(function)) { + PyObject *args[2] = {arg1, arg2}; + return __Pyx_PyCFunction_FastCall(function, args, 2); + } + #endif + args = PyTuple_New(2); + if (unlikely(!args)) goto done; + Py_INCREF(arg1); + PyTuple_SET_ITEM(args, 0, arg1); + Py_INCREF(arg2); + PyTuple_SET_ITEM(args, 1, arg2); + Py_INCREF(function); + result = __Pyx_PyObject_Call(function, args, NULL); + Py_DECREF(args); + Py_DECREF(function); +done: + return result; +} + +/* PyObjectCallMethO */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { + PyObject *self, *result; + PyCFunction cfunc; + cfunc = PyCFunction_GET_FUNCTION(func); + self = PyCFunction_GET_SELF(func); + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; + result = cfunc(self, arg); + Py_LeaveRecursiveCall(); + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +/* PyObjectCallOneArg */ +#if CYTHON_COMPILING_IN_CPYTHON +static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) { + PyObject *result; + PyObject *args = PyTuple_New(1); + if (unlikely(!args)) return NULL; + Py_INCREF(arg); + PyTuple_SET_ITEM(args, 0, arg); + result = __Pyx_PyObject_Call(func, args, NULL); + Py_DECREF(args); + return result; +} +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { +#if CYTHON_FAST_PYCALL + if (PyFunction_Check(func)) { + return __Pyx_PyFunction_FastCall(func, &arg, 1); + } +#endif + if (likely(PyCFunction_Check(func))) { + if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) { + return __Pyx_PyObject_CallMethO(func, arg); +#if CYTHON_FAST_PYCCALL + } else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) { + return __Pyx_PyCFunction_FastCall(func, &arg, 1); +#endif + } + } + return __Pyx__PyObject_CallOneArg(func, arg); +} +#else +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { + PyObject *result; + PyObject *args = PyTuple_Pack(1, arg); + if (unlikely(!args)) return NULL; + result = __Pyx_PyObject_Call(func, args, NULL); + Py_DECREF(args); + return result; +} +#endif + +/* GetTopmostException */ +#if CYTHON_USE_EXC_INFO_STACK +static _PyErr_StackItem * +__Pyx_PyErr_GetTopmostException(PyThreadState *tstate) +{ + _PyErr_StackItem *exc_info = tstate->exc_info; + while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) && + exc_info->previous_item != NULL) + { + exc_info = exc_info->previous_item; + } + return exc_info; +} +#endif + +/* SaveResetException */ +#if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { + #if CYTHON_USE_EXC_INFO_STACK + _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate); + *type = exc_info->exc_type; + *value = exc_info->exc_value; + *tb = exc_info->exc_traceback; + #else + *type = tstate->exc_type; + *value = tstate->exc_value; + *tb = tstate->exc_traceback; + #endif + Py_XINCREF(*type); + Py_XINCREF(*value); + Py_XINCREF(*tb); +} +static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + #if CYTHON_USE_EXC_INFO_STACK + _PyErr_StackItem *exc_info = tstate->exc_info; + tmp_type = exc_info->exc_type; + tmp_value = exc_info->exc_value; + tmp_tb = exc_info->exc_traceback; + exc_info->exc_type = type; + exc_info->exc_value = value; + exc_info->exc_traceback = tb; + #else + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = type; + tstate->exc_value = value; + tstate->exc_traceback = tb; + #endif + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +} +#endif + +/* PyErrExceptionMatches */ +#if CYTHON_FAST_THREAD_STATE +static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { + Py_ssize_t i, n; + n = PyTuple_GET_SIZE(tuple); +#if PY_MAJOR_VERSION >= 3 + for (i=0; icurexc_type; + if (exc_type == err) return 1; + if (unlikely(!exc_type)) return 0; + if (unlikely(PyTuple_Check(err))) + return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err); + return __Pyx_PyErr_GivenExceptionMatches(exc_type, err); +} +#endif + +/* PyErrFetchRestore */ +#if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + tmp_type = tstate->curexc_type; + tmp_value = tstate->curexc_value; + tmp_tb = tstate->curexc_traceback; + tstate->curexc_type = type; + tstate->curexc_value = value; + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +} +static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { + *type = tstate->curexc_type; + *value = tstate->curexc_value; + *tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +} +#endif + +/* RaiseArgTupleInvalid */ +static void __Pyx_RaiseArgtupleInvalid( + const char* func_name, + int exact, + Py_ssize_t num_min, + Py_ssize_t num_max, + Py_ssize_t num_found) +{ + Py_ssize_t num_expected; + const char *more_or_less; + if (num_found < num_min) { + num_expected = num_min; + more_or_less = "at least"; + } else { + num_expected = num_max; + more_or_less = "at most"; + } + if (exact) { + more_or_less = "exactly"; + } + PyErr_Format(PyExc_TypeError, + "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", + func_name, more_or_less, num_expected, + (num_expected == 1) ? "" : "s", num_found); +} + +/* RaiseDoubleKeywords */ +static void __Pyx_RaiseDoubleKeywordsError( + const char* func_name, + PyObject* kw_name) +{ + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION >= 3 + "%s() got multiple values for keyword argument '%U'", func_name, kw_name); + #else + "%s() got multiple values for keyword argument '%s'", func_name, + PyString_AsString(kw_name)); + #endif +} + +/* ParseKeywords */ +static int __Pyx_ParseOptionalKeywords( + PyObject *kwds, + PyObject **argnames[], + PyObject *kwds2, + PyObject *values[], + Py_ssize_t num_pos_args, + const char* function_name) +{ + PyObject *key = 0, *value = 0; + Py_ssize_t pos = 0; + PyObject*** name; + PyObject*** first_kw_arg = argnames + num_pos_args; + while (PyDict_Next(kwds, &pos, &key, &value)) { + name = first_kw_arg; + while (*name && (**name != key)) name++; + if (*name) { + values[name-argnames] = value; + continue; + } + name = first_kw_arg; + #if PY_MAJOR_VERSION < 3 + if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) { + while (*name) { + if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) + && _PyString_Eq(**name, key)) { + values[name-argnames] = value; + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + if ((**argname == key) || ( + (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) + && _PyString_Eq(**argname, key))) { + goto arg_passed_twice; + } + argname++; + } + } + } else + #endif + if (likely(PyUnicode_Check(key))) { + while (*name) { + int cmp = (**name == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 : + #endif + PyUnicode_Compare(**name, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) { + values[name-argnames] = value; + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + int cmp = (**argname == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 : + #endif + PyUnicode_Compare(**argname, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) goto arg_passed_twice; + argname++; + } + } + } else + goto invalid_keyword_type; + if (kwds2) { + if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; + } else { + goto invalid_keyword; + } + } + return 0; +arg_passed_twice: + __Pyx_RaiseDoubleKeywordsError(function_name, key); + goto bad; +invalid_keyword_type: + PyErr_Format(PyExc_TypeError, + "%.200s() keywords must be strings", function_name); + goto bad; +invalid_keyword: + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION < 3 + "%.200s() got an unexpected keyword argument '%.200s'", + function_name, PyString_AsString(key)); + #else + "%s() got an unexpected keyword argument '%U'", + function_name, key); + #endif +bad: + return -1; +} + +/* PyIntCompare */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED long inplace) { + if (op1 == op2) { + Py_RETURN_TRUE; + } + #if PY_MAJOR_VERSION < 3 + if (likely(PyInt_CheckExact(op1))) { + const long b = intval; + long a = PyInt_AS_LONG(op1); + if (a == b) Py_RETURN_TRUE; else Py_RETURN_FALSE; + } + #endif + #if CYTHON_USE_PYLONG_INTERNALS + if (likely(PyLong_CheckExact(op1))) { + int unequal; + unsigned long uintval; + Py_ssize_t size = Py_SIZE(op1); + const digit* digits = ((PyLongObject*)op1)->ob_digit; + if (intval == 0) { + if (size == 0) Py_RETURN_TRUE; else Py_RETURN_FALSE; + } else if (intval < 0) { + if (size >= 0) + Py_RETURN_FALSE; + intval = -intval; + size = -size; + } else { + if (size <= 0) + Py_RETURN_FALSE; + } + uintval = (unsigned long) intval; +#if PyLong_SHIFT * 4 < SIZEOF_LONG*8 + if (uintval >> (PyLong_SHIFT * 4)) { + unequal = (size != 5) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) + | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[4] != ((uintval >> (4 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); + } else +#endif +#if PyLong_SHIFT * 3 < SIZEOF_LONG*8 + if (uintval >> (PyLong_SHIFT * 3)) { + unequal = (size != 4) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) + | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); + } else +#endif +#if PyLong_SHIFT * 2 < SIZEOF_LONG*8 + if (uintval >> (PyLong_SHIFT * 2)) { + unequal = (size != 3) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) + | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); + } else +#endif +#if PyLong_SHIFT * 1 < SIZEOF_LONG*8 + if (uintval >> (PyLong_SHIFT * 1)) { + unequal = (size != 2) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) + | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); + } else +#endif + unequal = (size != 1) || (((unsigned long) digits[0]) != (uintval & (unsigned long) PyLong_MASK)); + if (unequal == 0) Py_RETURN_TRUE; else Py_RETURN_FALSE; + } + #endif + if (PyFloat_CheckExact(op1)) { + const long b = intval; + double a = PyFloat_AS_DOUBLE(op1); + if ((double)a == (double)b) Py_RETURN_TRUE; else Py_RETURN_FALSE; + } + return ( + PyObject_RichCompare(op1, op2, Py_EQ)); +} + +/* Import */ +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { + PyObject *empty_list = 0; + PyObject *module = 0; + PyObject *global_dict = 0; + PyObject *empty_dict = 0; + PyObject *list; + #if PY_MAJOR_VERSION < 3 + PyObject *py_import; + py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); + if (!py_import) + goto bad; + #endif + if (from_list) + list = from_list; + else { + empty_list = PyList_New(0); + if (!empty_list) + goto bad; + list = empty_list; + } + global_dict = PyModule_GetDict(__pyx_m); + if (!global_dict) + goto bad; + empty_dict = PyDict_New(); + if (!empty_dict) + goto bad; + { + #if PY_MAJOR_VERSION >= 3 + if (level == -1) { + if (strchr(__Pyx_MODULE_NAME, '.')) { + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, 1); + if (!module) { + if (!PyErr_ExceptionMatches(PyExc_ImportError)) + goto bad; + PyErr_Clear(); + } + } + level = 0; + } + #endif + if (!module) { + #if PY_MAJOR_VERSION < 3 + PyObject *py_level = PyInt_FromLong(level); + if (!py_level) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, py_level, (PyObject *)NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, level); + #endif + } + } +bad: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(py_import); + #endif + Py_XDECREF(empty_list); + Py_XDECREF(empty_dict); + return module; +} + +/* GetModuleGlobalName */ +#if CYTHON_USE_DICT_VERSIONS +static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value) +#else +static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) +#endif +{ + PyObject *result; +#if !CYTHON_AVOID_BORROWED_REFS +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 + result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } else if (unlikely(PyErr_Occurred())) { + return NULL; + } +#else + result = PyDict_GetItem(__pyx_d, name); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } +#endif +#else + result = PyObject_GetItem(__pyx_d, name); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } + PyErr_Clear(); +#endif + return __Pyx_GetBuiltinName(name); +} + +/* PyObjectCallNoArg */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { +#if CYTHON_FAST_PYCALL + if (PyFunction_Check(func)) { + return __Pyx_PyFunction_FastCall(func, NULL, 0); + } +#endif +#ifdef __Pyx_CyFunction_USED + if (likely(PyCFunction_Check(func) || __Pyx_CyFunction_Check(func))) +#else + if (likely(PyCFunction_Check(func))) +#endif + { + if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) { + return __Pyx_PyObject_CallMethO(func, NULL); + } + } + return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL); +} +#endif + +/* GetItemInt */ +static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { + PyObject *r; + if (!j) return NULL; + r = PyObject_GetItem(o, j); + Py_DECREF(j); + return r; +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, + CYTHON_NCP_UNUSED int wraparound, + CYTHON_NCP_UNUSED int boundscheck) { +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + Py_ssize_t wrapped_i = i; + if (wraparound & unlikely(i < 0)) { + wrapped_i += PyList_GET_SIZE(o); + } + if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) { + PyObject *r = PyList_GET_ITEM(o, wrapped_i); + Py_INCREF(r); + return r; + } + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +#else + return PySequence_GetItem(o, i); +#endif +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, + CYTHON_NCP_UNUSED int wraparound, + CYTHON_NCP_UNUSED int boundscheck) { +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + Py_ssize_t wrapped_i = i; + if (wraparound & unlikely(i < 0)) { + wrapped_i += PyTuple_GET_SIZE(o); + } + if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) { + PyObject *r = PyTuple_GET_ITEM(o, wrapped_i); + Py_INCREF(r); + return r; + } + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +#else + return PySequence_GetItem(o, i); +#endif +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, + CYTHON_NCP_UNUSED int wraparound, + CYTHON_NCP_UNUSED int boundscheck) { +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS + if (is_list || PyList_CheckExact(o)) { + Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); + if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) { + PyObject *r = PyList_GET_ITEM(o, n); + Py_INCREF(r); + return r; + } + } + else if (PyTuple_CheckExact(o)) { + Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o); + if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) { + PyObject *r = PyTuple_GET_ITEM(o, n); + Py_INCREF(r); + return r; + } + } else { + PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence; + if (likely(m && m->sq_item)) { + if (wraparound && unlikely(i < 0) && likely(m->sq_length)) { + Py_ssize_t l = m->sq_length(o); + if (likely(l >= 0)) { + i += l; + } else { + if (!PyErr_ExceptionMatches(PyExc_OverflowError)) + return NULL; + PyErr_Clear(); + } + } + return m->sq_item(o, i); + } + } +#else + if (is_list || PySequence_Check(o)) { + return PySequence_GetItem(o, i); + } +#endif + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +} + +/* PyObjectGetMethod */ +static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method) { + PyObject *attr; +#if CYTHON_UNPACK_METHODS && CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_PYTYPE_LOOKUP + PyTypeObject *tp = Py_TYPE(obj); + PyObject *descr; + descrgetfunc f = NULL; + PyObject **dictptr, *dict; + int meth_found = 0; + assert (*method == NULL); + if (unlikely(tp->tp_getattro != PyObject_GenericGetAttr)) { + attr = __Pyx_PyObject_GetAttrStr(obj, name); + goto try_unpack; + } + if (unlikely(tp->tp_dict == NULL) && unlikely(PyType_Ready(tp) < 0)) { + return 0; + } + descr = _PyType_Lookup(tp, name); + if (likely(descr != NULL)) { + Py_INCREF(descr); +#if PY_MAJOR_VERSION >= 3 + #ifdef __Pyx_CyFunction_USED + if (likely(PyFunction_Check(descr) || (Py_TYPE(descr) == &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr))) + #else + if (likely(PyFunction_Check(descr) || (Py_TYPE(descr) == &PyMethodDescr_Type))) + #endif +#else + #ifdef __Pyx_CyFunction_USED + if (likely(PyFunction_Check(descr) || __Pyx_CyFunction_Check(descr))) + #else + if (likely(PyFunction_Check(descr))) + #endif +#endif + { + meth_found = 1; + } else { + f = Py_TYPE(descr)->tp_descr_get; + if (f != NULL && PyDescr_IsData(descr)) { + attr = f(descr, obj, (PyObject *)Py_TYPE(obj)); + Py_DECREF(descr); + goto try_unpack; + } + } + } + dictptr = _PyObject_GetDictPtr(obj); + if (dictptr != NULL && (dict = *dictptr) != NULL) { + Py_INCREF(dict); + attr = __Pyx_PyDict_GetItemStr(dict, name); + if (attr != NULL) { + Py_INCREF(attr); + Py_DECREF(dict); + Py_XDECREF(descr); + goto try_unpack; + } + Py_DECREF(dict); + } + if (meth_found) { + *method = descr; + return 1; + } + if (f != NULL) { + attr = f(descr, obj, (PyObject *)Py_TYPE(obj)); + Py_DECREF(descr); + goto try_unpack; + } + if (descr != NULL) { + *method = descr; + return 0; + } + PyErr_Format(PyExc_AttributeError, +#if PY_MAJOR_VERSION >= 3 + "'%.50s' object has no attribute '%U'", + tp->tp_name, name); +#else + "'%.50s' object has no attribute '%.400s'", + tp->tp_name, PyString_AS_STRING(name)); +#endif + return 0; +#else + attr = __Pyx_PyObject_GetAttrStr(obj, name); + goto try_unpack; +#endif +try_unpack: +#if CYTHON_UNPACK_METHODS + if (likely(attr) && PyMethod_Check(attr) && likely(PyMethod_GET_SELF(attr) == obj)) { + PyObject *function = PyMethod_GET_FUNCTION(attr); + Py_INCREF(function); + Py_DECREF(attr); + *method = function; + return 1; + } +#endif + *method = attr; + return 0; +} + +/* PyObjectCallMethod1 */ +static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg) { + PyObject *result = __Pyx_PyObject_CallOneArg(method, arg); + Py_DECREF(method); + return result; +} +static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) { + PyObject *method = NULL, *result; + int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method); + if (likely(is_method)) { + result = __Pyx_PyObject_Call2Args(method, obj, arg); + Py_DECREF(method); + return result; + } + if (unlikely(!method)) return NULL; + return __Pyx__PyObject_CallMethod1(method, arg); +} + +/* append */ +static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x) { + if (likely(PyList_CheckExact(L))) { + if (unlikely(__Pyx_PyList_Append(L, x) < 0)) return -1; + } else { + PyObject* retval = __Pyx_PyObject_CallMethod1(L, __pyx_n_s_append, x); + if (unlikely(!retval)) + return -1; + Py_DECREF(retval); + } + return 0; +} + +/* GetAttr */ +static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) { +#if CYTHON_USE_TYPE_SLOTS +#if PY_MAJOR_VERSION >= 3 + if (likely(PyUnicode_Check(n))) +#else + if (likely(PyString_Check(n))) +#endif + return __Pyx_PyObject_GetAttrStr(o, n); +#endif + return PyObject_GetAttr(o, n); +} + +/* GetAttr3 */ +static PyObject *__Pyx_GetAttr3Default(PyObject *d) { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) + return NULL; + __Pyx_PyErr_Clear(); + Py_INCREF(d); + return d; +} +static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) { + PyObject *r = __Pyx_GetAttr(o, n); + return (likely(r)) ? r : __Pyx_GetAttr3Default(d); +} + +/* StringJoin */ +#if !CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values) { + return PyObject_CallMethodObjArgs(sep, __pyx_n_s_join, values, NULL); +} +#endif + +/* WriteUnraisableException */ +static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno, + CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename, + int full_traceback, CYTHON_UNUSED int nogil) { + PyObject *old_exc, *old_val, *old_tb; + PyObject *ctx; + __Pyx_PyThreadState_declare +#ifdef WITH_THREAD + PyGILState_STATE state; + if (nogil) + state = PyGILState_Ensure(); +#ifdef _MSC_VER + else state = (PyGILState_STATE)-1; +#endif +#endif + __Pyx_PyThreadState_assign + __Pyx_ErrFetch(&old_exc, &old_val, &old_tb); + if (full_traceback) { + Py_XINCREF(old_exc); + Py_XINCREF(old_val); + Py_XINCREF(old_tb); + __Pyx_ErrRestore(old_exc, old_val, old_tb); + PyErr_PrintEx(1); + } + #if PY_MAJOR_VERSION < 3 + ctx = PyString_FromString(name); + #else + ctx = PyUnicode_FromString(name); + #endif + __Pyx_ErrRestore(old_exc, old_val, old_tb); + if (!ctx) { + PyErr_WriteUnraisable(Py_None); + } else { + PyErr_WriteUnraisable(ctx); + Py_DECREF(ctx); + } +#ifdef WITH_THREAD + if (nogil) + PyGILState_Release(state); +#endif +} + +/* RaiseException */ +#if PY_MAJOR_VERSION < 3 +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, + CYTHON_UNUSED PyObject *cause) { + __Pyx_PyThreadState_declare + Py_XINCREF(type); + if (!value || value == Py_None) + value = NULL; + else + Py_INCREF(value); + if (!tb || tb == Py_None) + tb = NULL; + else { + Py_INCREF(tb); + if (!PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto raise_error; + } + } + if (PyType_Check(type)) { +#if CYTHON_COMPILING_IN_PYPY + if (!value) { + Py_INCREF(Py_None); + value = Py_None; + } +#endif + PyErr_NormalizeException(&type, &value, &tb); + } else { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto raise_error; + } + value = type; + type = (PyObject*) Py_TYPE(type); + Py_INCREF(type); + if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto raise_error; + } + } + __Pyx_PyThreadState_assign + __Pyx_ErrRestore(type, value, tb); + return; +raise_error: + Py_XDECREF(value); + Py_XDECREF(type); + Py_XDECREF(tb); + return; +} +#else +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { + PyObject* owned_instance = NULL; + if (tb == Py_None) { + tb = 0; + } else if (tb && !PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto bad; + } + if (value == Py_None) + value = 0; + if (PyExceptionInstance_Check(type)) { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto bad; + } + value = type; + type = (PyObject*) Py_TYPE(value); + } else if (PyExceptionClass_Check(type)) { + PyObject *instance_class = NULL; + if (value && PyExceptionInstance_Check(value)) { + instance_class = (PyObject*) Py_TYPE(value); + if (instance_class != type) { + int is_subclass = PyObject_IsSubclass(instance_class, type); + if (!is_subclass) { + instance_class = NULL; + } else if (unlikely(is_subclass == -1)) { + goto bad; + } else { + type = instance_class; + } + } + } + if (!instance_class) { + PyObject *args; + if (!value) + args = PyTuple_New(0); + else if (PyTuple_Check(value)) { + Py_INCREF(value); + args = value; + } else + args = PyTuple_Pack(1, value); + if (!args) + goto bad; + owned_instance = PyObject_Call(type, args, NULL); + Py_DECREF(args); + if (!owned_instance) + goto bad; + value = owned_instance; + if (!PyExceptionInstance_Check(value)) { + PyErr_Format(PyExc_TypeError, + "calling %R should have returned an instance of " + "BaseException, not %R", + type, Py_TYPE(value)); + goto bad; + } + } + } else { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto bad; + } + if (cause) { + PyObject *fixed_cause; + if (cause == Py_None) { + fixed_cause = NULL; + } else if (PyExceptionClass_Check(cause)) { + fixed_cause = PyObject_CallObject(cause, NULL); + if (fixed_cause == NULL) + goto bad; + } else if (PyExceptionInstance_Check(cause)) { + fixed_cause = cause; + Py_INCREF(fixed_cause); + } else { + PyErr_SetString(PyExc_TypeError, + "exception causes must derive from " + "BaseException"); + goto bad; + } + PyException_SetCause(value, fixed_cause); + } + PyErr_SetObject(type, value); + if (tb) { +#if CYTHON_COMPILING_IN_PYPY + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); + Py_INCREF(tb); + PyErr_Restore(tmp_type, tmp_value, tb); + Py_XDECREF(tmp_tb); +#else + PyThreadState *tstate = __Pyx_PyThreadState_Current; + PyObject* tmp_tb = tstate->curexc_traceback; + if (tb != tmp_tb) { + Py_INCREF(tb); + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_tb); + } +#endif + } +bad: + Py_XDECREF(owned_instance); + return; +} +#endif + +/* GetException */ +#if CYTHON_FAST_THREAD_STATE +static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) +#else +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) +#endif +{ + PyObject *local_type, *local_value, *local_tb; +#if CYTHON_FAST_THREAD_STATE + PyObject *tmp_type, *tmp_value, *tmp_tb; + local_type = tstate->curexc_type; + local_value = tstate->curexc_value; + local_tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +#else + PyErr_Fetch(&local_type, &local_value, &local_tb); +#endif + PyErr_NormalizeException(&local_type, &local_value, &local_tb); +#if CYTHON_FAST_THREAD_STATE + if (unlikely(tstate->curexc_type)) +#else + if (unlikely(PyErr_Occurred())) +#endif + goto bad; + #if PY_MAJOR_VERSION >= 3 + if (local_tb) { + if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) + goto bad; + } + #endif + Py_XINCREF(local_tb); + Py_XINCREF(local_type); + Py_XINCREF(local_value); + *type = local_type; + *value = local_value; + *tb = local_tb; +#if CYTHON_FAST_THREAD_STATE + #if CYTHON_USE_EXC_INFO_STACK + { + _PyErr_StackItem *exc_info = tstate->exc_info; + tmp_type = exc_info->exc_type; + tmp_value = exc_info->exc_value; + tmp_tb = exc_info->exc_traceback; + exc_info->exc_type = local_type; + exc_info->exc_value = local_value; + exc_info->exc_traceback = local_tb; + } + #else + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = local_type; + tstate->exc_value = local_value; + tstate->exc_traceback = local_tb; + #endif + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#else + PyErr_SetExcInfo(local_type, local_value, local_tb); +#endif + return 0; +bad: + *type = 0; + *value = 0; + *tb = 0; + Py_XDECREF(local_type); + Py_XDECREF(local_value); + Py_XDECREF(local_tb); + return -1; +} + +/* SwapException */ +#if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + #if CYTHON_USE_EXC_INFO_STACK + _PyErr_StackItem *exc_info = tstate->exc_info; + tmp_type = exc_info->exc_type; + tmp_value = exc_info->exc_value; + tmp_tb = exc_info->exc_traceback; + exc_info->exc_type = *type; + exc_info->exc_value = *value; + exc_info->exc_traceback = *tb; + #else + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = *type; + tstate->exc_value = *value; + tstate->exc_traceback = *tb; + #endif + *type = tmp_type; + *value = tmp_value; + *tb = tmp_tb; +} +#else +static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb); + PyErr_SetExcInfo(*type, *value, *tb); + *type = tmp_type; + *value = tmp_value; + *tb = tmp_tb; +} +#endif + +/* None */ +static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) { + PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname); +} + +/* PyObjectCallMethod0 */ +static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) { + PyObject *method = NULL, *result = NULL; + int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method); + if (likely(is_method)) { + result = __Pyx_PyObject_CallOneArg(method, obj); + Py_DECREF(method); + return result; + } + if (unlikely(!method)) goto bad; + result = __Pyx_PyObject_CallNoArg(method); + Py_DECREF(method); +bad: + return result; +} + +/* UnpackUnboundCMethod */ +static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target) { + PyObject *method; + method = __Pyx_PyObject_GetAttrStr(target->type, *target->method_name); + if (unlikely(!method)) + return -1; + target->method = method; +#if CYTHON_COMPILING_IN_CPYTHON + #if PY_MAJOR_VERSION >= 3 + if (likely(__Pyx_TypeCheck(method, &PyMethodDescr_Type))) + #endif + { + PyMethodDescrObject *descr = (PyMethodDescrObject*) method; + target->func = descr->d_method->ml_meth; + target->flag = descr->d_method->ml_flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_STACKLESS); + } +#endif + return 0; +} + +/* CallUnboundCMethod0 */ +static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self) { + PyObject *args, *result = NULL; + if (unlikely(!cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL; +#if CYTHON_ASSUME_SAFE_MACROS + args = PyTuple_New(1); + if (unlikely(!args)) goto bad; + Py_INCREF(self); + PyTuple_SET_ITEM(args, 0, self); +#else + args = PyTuple_Pack(1, self); + if (unlikely(!args)) goto bad; +#endif + result = __Pyx_PyObject_Call(cfunc->method, args, NULL); + Py_DECREF(args); +bad: + return result; +} + +/* pop */ +static CYTHON_INLINE PyObject* __Pyx__PyObject_Pop(PyObject* L) { + if (Py_TYPE(L) == &PySet_Type) { + return PySet_Pop(L); + } + return __Pyx_PyObject_CallMethod0(L, __pyx_n_s_pop); +} +#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS +static CYTHON_INLINE PyObject* __Pyx_PyList_Pop(PyObject* L) { + if (likely(PyList_GET_SIZE(L) > (((PyListObject*)L)->allocated >> 1))) { + Py_SIZE(L) -= 1; + return PyList_GET_ITEM(L, PyList_GET_SIZE(L)); + } + return __Pyx_CallUnboundCMethod0(&__pyx_umethod_PyList_Type_pop, L); +} +#endif + +/* ImportFrom */ +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { + PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); + if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_Format(PyExc_ImportError, + #if PY_MAJOR_VERSION < 3 + "cannot import name %.230s", PyString_AS_STRING(name)); + #else + "cannot import name %S", name); + #endif + } + return value; +} + +/* ExtTypeTest */ +static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { + if (unlikely(!type)) { + PyErr_SetString(PyExc_SystemError, "Missing type object"); + return 0; + } + if (likely(__Pyx_TypeCheck(obj, type))) + return 1; + PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s", + Py_TYPE(obj)->tp_name, type->tp_name); + return 0; +} + +/* PyIntCompare */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_NeObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED long inplace) { + if (op1 == op2) { + Py_RETURN_FALSE; + } + #if PY_MAJOR_VERSION < 3 + if (likely(PyInt_CheckExact(op1))) { + const long b = intval; + long a = PyInt_AS_LONG(op1); + if (a != b) Py_RETURN_TRUE; else Py_RETURN_FALSE; + } + #endif + #if CYTHON_USE_PYLONG_INTERNALS + if (likely(PyLong_CheckExact(op1))) { + int unequal; + unsigned long uintval; + Py_ssize_t size = Py_SIZE(op1); + const digit* digits = ((PyLongObject*)op1)->ob_digit; + if (intval == 0) { + if (size != 0) Py_RETURN_TRUE; else Py_RETURN_FALSE; + } else if (intval < 0) { + if (size >= 0) + Py_RETURN_TRUE; + intval = -intval; + size = -size; + } else { + if (size <= 0) + Py_RETURN_TRUE; + } + uintval = (unsigned long) intval; +#if PyLong_SHIFT * 4 < SIZEOF_LONG*8 + if (uintval >> (PyLong_SHIFT * 4)) { + unequal = (size != 5) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) + | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[4] != ((uintval >> (4 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); + } else +#endif +#if PyLong_SHIFT * 3 < SIZEOF_LONG*8 + if (uintval >> (PyLong_SHIFT * 3)) { + unequal = (size != 4) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) + | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); + } else +#endif +#if PyLong_SHIFT * 2 < SIZEOF_LONG*8 + if (uintval >> (PyLong_SHIFT * 2)) { + unequal = (size != 3) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) + | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); + } else +#endif +#if PyLong_SHIFT * 1 < SIZEOF_LONG*8 + if (uintval >> (PyLong_SHIFT * 1)) { + unequal = (size != 2) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) + | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); + } else +#endif + unequal = (size != 1) || (((unsigned long) digits[0]) != (uintval & (unsigned long) PyLong_MASK)); + if (unequal != 0) Py_RETURN_TRUE; else Py_RETURN_FALSE; + } + #endif + if (PyFloat_CheckExact(op1)) { + const long b = intval; + double a = PyFloat_AS_DOUBLE(op1); + if ((double)a != (double)b) Py_RETURN_TRUE; else Py_RETURN_FALSE; + } + return ( + PyObject_RichCompare(op1, op2, Py_NE)); +} + +/* RaiseTooManyValuesToUnpack */ +static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { + PyErr_Format(PyExc_ValueError, + "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected); +} + +/* RaiseNeedMoreValuesToUnpack */ +static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { + PyErr_Format(PyExc_ValueError, + "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack", + index, (index == 1) ? "" : "s"); +} + +/* IterFinish */ +static CYTHON_INLINE int __Pyx_IterFinish(void) { +#if CYTHON_FAST_THREAD_STATE + PyThreadState *tstate = __Pyx_PyThreadState_Current; + PyObject* exc_type = tstate->curexc_type; + if (unlikely(exc_type)) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) { + PyObject *exc_value, *exc_tb; + exc_value = tstate->curexc_value; + exc_tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; + Py_DECREF(exc_type); + Py_XDECREF(exc_value); + Py_XDECREF(exc_tb); + return 0; + } else { + return -1; + } + } + return 0; +#else + if (unlikely(PyErr_Occurred())) { + if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) { + PyErr_Clear(); + return 0; + } else { + return -1; + } + } + return 0; +#endif +} + +/* UnpackItemEndCheck */ +static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { + if (unlikely(retval)) { + Py_DECREF(retval); + __Pyx_RaiseTooManyValuesError(expected); + return -1; + } else { + return __Pyx_IterFinish(); + } + return 0; +} + +/* CallNextTpDealloc */ +static void __Pyx_call_next_tp_dealloc(PyObject* obj, destructor current_tp_dealloc) { + PyTypeObject* type = Py_TYPE(obj); + while (type && type->tp_dealloc != current_tp_dealloc) + type = type->tp_base; + while (type && type->tp_dealloc == current_tp_dealloc) + type = type->tp_base; + if (type) + type->tp_dealloc(obj); +} + +/* CallNextTpTraverse */ +static int __Pyx_call_next_tp_traverse(PyObject* obj, visitproc v, void *a, traverseproc current_tp_traverse) { + PyTypeObject* type = Py_TYPE(obj); + while (type && type->tp_traverse != current_tp_traverse) + type = type->tp_base; + while (type && type->tp_traverse == current_tp_traverse) + type = type->tp_base; + if (type && type->tp_traverse) + return type->tp_traverse(obj, v, a); + return 0; +} + +/* CallNextTpClear */ +static void __Pyx_call_next_tp_clear(PyObject* obj, inquiry current_tp_clear) { + PyTypeObject* type = Py_TYPE(obj); + while (type && type->tp_clear != current_tp_clear) + type = type->tp_base; + while (type && type->tp_clear == current_tp_clear) + type = type->tp_base; + if (type && type->tp_clear) + type->tp_clear(obj); +} + +/* TypeImport */ +#ifndef __PYX_HAVE_RT_ImportType +#define __PYX_HAVE_RT_ImportType +static PyTypeObject *__Pyx_ImportType(PyObject *module, const char *module_name, const char *class_name, + size_t size, enum __Pyx_ImportType_CheckSize check_size) +{ + PyObject *result = 0; + char warning[200]; + Py_ssize_t basicsize; +#ifdef Py_LIMITED_API + PyObject *py_basicsize; +#endif + result = PyObject_GetAttrString(module, class_name); + if (!result) + goto bad; + if (!PyType_Check(result)) { + PyErr_Format(PyExc_TypeError, + "%.200s.%.200s is not a type object", + module_name, class_name); + goto bad; + } +#ifndef Py_LIMITED_API + basicsize = ((PyTypeObject *)result)->tp_basicsize; +#else + py_basicsize = PyObject_GetAttrString(result, "__basicsize__"); + if (!py_basicsize) + goto bad; + basicsize = PyLong_AsSsize_t(py_basicsize); + Py_DECREF(py_basicsize); + py_basicsize = 0; + if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred()) + goto bad; +#endif + if ((size_t)basicsize < size) { + PyErr_Format(PyExc_ValueError, + "%.200s.%.200s size changed, may indicate binary incompatibility. " + "Expected %zd from C header, got %zd from PyObject", + module_name, class_name, size, basicsize); + goto bad; + } + if (check_size == __Pyx_ImportType_CheckSize_Error && (size_t)basicsize != size) { + PyErr_Format(PyExc_ValueError, + "%.200s.%.200s size changed, may indicate binary incompatibility. " + "Expected %zd from C header, got %zd from PyObject", + module_name, class_name, size, basicsize); + goto bad; + } + else if (check_size == __Pyx_ImportType_CheckSize_Warn && (size_t)basicsize > size) { + PyOS_snprintf(warning, sizeof(warning), + "%s.%s size changed, may indicate binary incompatibility. " + "Expected %zd from C header, got %zd from PyObject", + module_name, class_name, size, basicsize); + if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad; + } + return (PyTypeObject *)result; +bad: + Py_XDECREF(result); + return NULL; +} +#endif + +/* GetVTable */ +static void* __Pyx_GetVtable(PyObject *dict) { + void* ptr; + PyObject *ob = PyObject_GetItem(dict, __pyx_n_s_pyx_vtable); + if (!ob) + goto bad; +#if PY_VERSION_HEX >= 0x02070000 + ptr = PyCapsule_GetPointer(ob, 0); +#else + ptr = PyCObject_AsVoidPtr(ob); +#endif + if (!ptr && !PyErr_Occurred()) + PyErr_SetString(PyExc_RuntimeError, "invalid vtable found for imported type"); + Py_DECREF(ob); + return ptr; +bad: + Py_XDECREF(ob); + return NULL; +} + +/* PyObject_GenericGetAttrNoDict */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) { + PyErr_Format(PyExc_AttributeError, +#if PY_MAJOR_VERSION >= 3 + "'%.50s' object has no attribute '%U'", + tp->tp_name, attr_name); +#else + "'%.50s' object has no attribute '%.400s'", + tp->tp_name, PyString_AS_STRING(attr_name)); +#endif + return NULL; +} +static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) { + PyObject *descr; + PyTypeObject *tp = Py_TYPE(obj); + if (unlikely(!PyString_Check(attr_name))) { + return PyObject_GenericGetAttr(obj, attr_name); + } + assert(!tp->tp_dictoffset); + descr = _PyType_Lookup(tp, attr_name); + if (unlikely(!descr)) { + return __Pyx_RaiseGenericGetAttributeError(tp, attr_name); + } + Py_INCREF(descr); + #if PY_MAJOR_VERSION < 3 + if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS))) + #endif + { + descrgetfunc f = Py_TYPE(descr)->tp_descr_get; + if (unlikely(f)) { + PyObject *res = f(descr, obj, (PyObject *)tp); + Py_DECREF(descr); + return res; + } + } + return descr; +} +#endif + +/* SetVTable */ +static int __Pyx_SetVtable(PyObject *dict, void *vtable) { +#if PY_VERSION_HEX >= 0x02070000 + PyObject *ob = PyCapsule_New(vtable, 0, 0); +#else + PyObject *ob = PyCObject_FromVoidPtr(vtable, 0); +#endif + if (!ob) + goto bad; + if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0) + goto bad; + Py_DECREF(ob); + return 0; +bad: + Py_XDECREF(ob); + return -1; +} + +/* PyObject_GenericGetAttr */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) { + if (unlikely(Py_TYPE(obj)->tp_dictoffset)) { + return PyObject_GenericGetAttr(obj, attr_name); + } + return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name); +} +#endif + +/* HasAttr */ +static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) { + PyObject *r; + if (unlikely(!__Pyx_PyBaseString_Check(n))) { + PyErr_SetString(PyExc_TypeError, + "hasattr(): attribute name must be string"); + return -1; + } + r = __Pyx_GetAttr(o, n); + if (unlikely(!r)) { + PyErr_Clear(); + return 0; + } else { + Py_DECREF(r); + return 1; + } +} + +/* FetchCommonType */ +static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { + PyObject* fake_module; + PyTypeObject* cached_type = NULL; + fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI); + if (!fake_module) return NULL; + Py_INCREF(fake_module); + cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name); + if (cached_type) { + if (!PyType_Check((PyObject*)cached_type)) { + PyErr_Format(PyExc_TypeError, + "Shared Cython type %.200s is not a type object", + type->tp_name); + goto bad; + } + if (cached_type->tp_basicsize != type->tp_basicsize) { + PyErr_Format(PyExc_TypeError, + "Shared Cython type %.200s has the wrong size, try recompiling", + type->tp_name); + goto bad; + } + } else { + if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; + PyErr_Clear(); + if (PyType_Ready(type) < 0) goto bad; + if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0) + goto bad; + Py_INCREF(type); + cached_type = type; + } +done: + Py_DECREF(fake_module); + return cached_type; +bad: + Py_XDECREF(cached_type); + cached_type = NULL; + goto done; +} + +/* CythonFunction */ +#include +static PyObject * +__Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure) +{ + if (unlikely(op->func_doc == NULL)) { + if (op->func.m_ml->ml_doc) { +#if PY_MAJOR_VERSION >= 3 + op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc); +#else + op->func_doc = PyString_FromString(op->func.m_ml->ml_doc); +#endif + if (unlikely(op->func_doc == NULL)) + return NULL; + } else { + Py_INCREF(Py_None); + return Py_None; + } + } + Py_INCREF(op->func_doc); + return op->func_doc; +} +static int +__Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context) +{ + PyObject *tmp = op->func_doc; + if (value == NULL) { + value = Py_None; + } + Py_INCREF(value); + op->func_doc = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + if (unlikely(op->func_name == NULL)) { +#if PY_MAJOR_VERSION >= 3 + op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name); +#else + op->func_name = PyString_InternFromString(op->func.m_ml->ml_name); +#endif + if (unlikely(op->func_name == NULL)) + return NULL; + } + Py_INCREF(op->func_name); + return op->func_name; +} +static int +__Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context) +{ + PyObject *tmp; +#if PY_MAJOR_VERSION >= 3 + if (unlikely(value == NULL || !PyUnicode_Check(value))) +#else + if (unlikely(value == NULL || !PyString_Check(value))) +#endif + { + PyErr_SetString(PyExc_TypeError, + "__name__ must be set to a string object"); + return -1; + } + tmp = op->func_name; + Py_INCREF(value); + op->func_name = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + Py_INCREF(op->func_qualname); + return op->func_qualname; +} +static int +__Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context) +{ + PyObject *tmp; +#if PY_MAJOR_VERSION >= 3 + if (unlikely(value == NULL || !PyUnicode_Check(value))) +#else + if (unlikely(value == NULL || !PyString_Check(value))) +#endif + { + PyErr_SetString(PyExc_TypeError, + "__qualname__ must be set to a string object"); + return -1; + } + tmp = op->func_qualname; + Py_INCREF(value); + op->func_qualname = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED void *closure) +{ + PyObject *self; + self = m->func_closure; + if (self == NULL) + self = Py_None; + Py_INCREF(self); + return self; +} +static PyObject * +__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + if (unlikely(op->func_dict == NULL)) { + op->func_dict = PyDict_New(); + if (unlikely(op->func_dict == NULL)) + return NULL; + } + Py_INCREF(op->func_dict); + return op->func_dict; +} +static int +__Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context) +{ + PyObject *tmp; + if (unlikely(value == NULL)) { + PyErr_SetString(PyExc_TypeError, + "function's dictionary may not be deleted"); + return -1; + } + if (unlikely(!PyDict_Check(value))) { + PyErr_SetString(PyExc_TypeError, + "setting function's dictionary to a non-dict"); + return -1; + } + tmp = op->func_dict; + Py_INCREF(value); + op->func_dict = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + Py_INCREF(op->func_globals); + return op->func_globals; +} +static PyObject * +__Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + Py_INCREF(Py_None); + return Py_None; +} +static PyObject * +__Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + PyObject* result = (op->func_code) ? op->func_code : Py_None; + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { + int result = 0; + PyObject *res = op->defaults_getter((PyObject *) op); + if (unlikely(!res)) + return -1; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + op->defaults_tuple = PyTuple_GET_ITEM(res, 0); + Py_INCREF(op->defaults_tuple); + op->defaults_kwdict = PyTuple_GET_ITEM(res, 1); + Py_INCREF(op->defaults_kwdict); + #else + op->defaults_tuple = PySequence_ITEM(res, 0); + if (unlikely(!op->defaults_tuple)) result = -1; + else { + op->defaults_kwdict = PySequence_ITEM(res, 1); + if (unlikely(!op->defaults_kwdict)) result = -1; + } + #endif + Py_DECREF(res); + return result; +} +static int +__Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) { + PyObject* tmp; + if (!value) { + value = Py_None; + } else if (value != Py_None && !PyTuple_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__defaults__ must be set to a tuple object"); + return -1; + } + Py_INCREF(value); + tmp = op->defaults_tuple; + op->defaults_tuple = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) { + PyObject* result = op->defaults_tuple; + if (unlikely(!result)) { + if (op->defaults_getter) { + if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL; + result = op->defaults_tuple; + } else { + result = Py_None; + } + } + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) { + PyObject* tmp; + if (!value) { + value = Py_None; + } else if (value != Py_None && !PyDict_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__kwdefaults__ must be set to a dict object"); + return -1; + } + Py_INCREF(value); + tmp = op->defaults_kwdict; + op->defaults_kwdict = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) { + PyObject* result = op->defaults_kwdict; + if (unlikely(!result)) { + if (op->defaults_getter) { + if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL; + result = op->defaults_kwdict; + } else { + result = Py_None; + } + } + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) { + PyObject* tmp; + if (!value || value == Py_None) { + value = NULL; + } else if (!PyDict_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__annotations__ must be set to a dict object"); + return -1; + } + Py_XINCREF(value); + tmp = op->func_annotations; + op->func_annotations = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) { + PyObject* result = op->func_annotations; + if (unlikely(!result)) { + result = PyDict_New(); + if (unlikely(!result)) return NULL; + op->func_annotations = result; + } + Py_INCREF(result); + return result; +} +static PyGetSetDef __pyx_CyFunction_getsets[] = { + {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, + {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, + {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, + {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, + {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, + {(char *) "__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0}, + {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, + {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, + {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, + {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, + {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, + {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, + {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, + {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, + {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, + {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, + {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, + {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, + {0, 0, 0, 0, 0} +}; +static PyMemberDef __pyx_CyFunction_members[] = { + {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), PY_WRITE_RESTRICTED, 0}, + {0, 0, 0, 0, 0} +}; +static PyObject * +__Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args) +{ +#if PY_MAJOR_VERSION >= 3 + return PyUnicode_FromString(m->func.m_ml->ml_name); +#else + return PyString_FromString(m->func.m_ml->ml_name); +#endif +} +static PyMethodDef __pyx_CyFunction_methods[] = { + {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, + {0, 0, 0, 0} +}; +#if PY_VERSION_HEX < 0x030500A0 +#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist) +#else +#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func.m_weakreflist) +#endif +static PyObject *__Pyx_CyFunction_New(PyTypeObject *type, PyMethodDef *ml, int flags, PyObject* qualname, + PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { + __pyx_CyFunctionObject *op = PyObject_GC_New(__pyx_CyFunctionObject, type); + if (op == NULL) + return NULL; + op->flags = flags; + __Pyx_CyFunction_weakreflist(op) = NULL; + op->func.m_ml = ml; + op->func.m_self = (PyObject *) op; + Py_XINCREF(closure); + op->func_closure = closure; + Py_XINCREF(module); + op->func.m_module = module; + op->func_dict = NULL; + op->func_name = NULL; + Py_INCREF(qualname); + op->func_qualname = qualname; + op->func_doc = NULL; + op->func_classobj = NULL; + op->func_globals = globals; + Py_INCREF(op->func_globals); + Py_XINCREF(code); + op->func_code = code; + op->defaults_pyobjects = 0; + op->defaults = NULL; + op->defaults_tuple = NULL; + op->defaults_kwdict = NULL; + op->defaults_getter = NULL; + op->func_annotations = NULL; + PyObject_GC_Track(op); + return (PyObject *) op; +} +static int +__Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) +{ + Py_CLEAR(m->func_closure); + Py_CLEAR(m->func.m_module); + Py_CLEAR(m->func_dict); + Py_CLEAR(m->func_name); + Py_CLEAR(m->func_qualname); + Py_CLEAR(m->func_doc); + Py_CLEAR(m->func_globals); + Py_CLEAR(m->func_code); + Py_CLEAR(m->func_classobj); + Py_CLEAR(m->defaults_tuple); + Py_CLEAR(m->defaults_kwdict); + Py_CLEAR(m->func_annotations); + if (m->defaults) { + PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); + int i; + for (i = 0; i < m->defaults_pyobjects; i++) + Py_XDECREF(pydefaults[i]); + PyObject_Free(m->defaults); + m->defaults = NULL; + } + return 0; +} +static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m) +{ + if (__Pyx_CyFunction_weakreflist(m) != NULL) + PyObject_ClearWeakRefs((PyObject *) m); + __Pyx_CyFunction_clear(m); + PyObject_GC_Del(m); +} +static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) +{ + PyObject_GC_UnTrack(m); + __Pyx__CyFunction_dealloc(m); +} +static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) +{ + Py_VISIT(m->func_closure); + Py_VISIT(m->func.m_module); + Py_VISIT(m->func_dict); + Py_VISIT(m->func_name); + Py_VISIT(m->func_qualname); + Py_VISIT(m->func_doc); + Py_VISIT(m->func_globals); + Py_VISIT(m->func_code); + Py_VISIT(m->func_classobj); + Py_VISIT(m->defaults_tuple); + Py_VISIT(m->defaults_kwdict); + if (m->defaults) { + PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); + int i; + for (i = 0; i < m->defaults_pyobjects; i++) + Py_VISIT(pydefaults[i]); + } + return 0; +} +static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type) +{ + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) { + Py_INCREF(func); + return func; + } + if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) { + if (type == NULL) + type = (PyObject *)(Py_TYPE(obj)); + return __Pyx_PyMethod_New(func, type, (PyObject *)(Py_TYPE(type))); + } + if (obj == Py_None) + obj = NULL; + return __Pyx_PyMethod_New(func, obj, type); +} +static PyObject* +__Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) +{ +#if PY_MAJOR_VERSION >= 3 + return PyUnicode_FromFormat("", + op->func_qualname, (void *)op); +#else + return PyString_FromFormat("", + PyString_AsString(op->func_qualname), (void *)op); +#endif +} +static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) { + PyCFunctionObject* f = (PyCFunctionObject*)func; + PyCFunction meth = f->m_ml->ml_meth; + Py_ssize_t size; + switch (f->m_ml->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) { + case METH_VARARGS: + if (likely(kw == NULL || PyDict_Size(kw) == 0)) + return (*meth)(self, arg); + break; + case METH_VARARGS | METH_KEYWORDS: + return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw); + case METH_NOARGS: + if (likely(kw == NULL || PyDict_Size(kw) == 0)) { + size = PyTuple_GET_SIZE(arg); + if (likely(size == 0)) + return (*meth)(self, NULL); + PyErr_Format(PyExc_TypeError, + "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", + f->m_ml->ml_name, size); + return NULL; + } + break; + case METH_O: + if (likely(kw == NULL || PyDict_Size(kw) == 0)) { + size = PyTuple_GET_SIZE(arg); + if (likely(size == 1)) { + PyObject *result, *arg0; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + arg0 = PyTuple_GET_ITEM(arg, 0); + #else + arg0 = PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL; + #endif + result = (*meth)(self, arg0); + #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) + Py_DECREF(arg0); + #endif + return result; + } + PyErr_Format(PyExc_TypeError, + "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", + f->m_ml->ml_name, size); + return NULL; + } + break; + default: + PyErr_SetString(PyExc_SystemError, "Bad call flags in " + "__Pyx_CyFunction_Call. METH_OLDARGS is no " + "longer supported!"); + return NULL; + } + PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", + f->m_ml->ml_name); + return NULL; +} +static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { + return __Pyx_CyFunction_CallMethod(func, ((PyCFunctionObject*)func)->m_self, arg, kw); +} +static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) { + PyObject *result; + __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func; + if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { + Py_ssize_t argc; + PyObject *new_args; + PyObject *self; + argc = PyTuple_GET_SIZE(args); + new_args = PyTuple_GetSlice(args, 1, argc); + if (unlikely(!new_args)) + return NULL; + self = PyTuple_GetItem(args, 0); + if (unlikely(!self)) { + Py_DECREF(new_args); + return NULL; + } + result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw); + Py_DECREF(new_args); + } else { + result = __Pyx_CyFunction_Call(func, args, kw); + } + return result; +} +static PyTypeObject __pyx_CyFunctionType_type = { + PyVarObject_HEAD_INIT(0, 0) + "cython_function_or_method", + sizeof(__pyx_CyFunctionObject), + 0, + (destructor) __Pyx_CyFunction_dealloc, + 0, + 0, + 0, +#if PY_MAJOR_VERSION < 3 + 0, +#else + 0, +#endif + (reprfunc) __Pyx_CyFunction_repr, + 0, + 0, + 0, + 0, + __Pyx_CyFunction_CallAsMethod, + 0, + 0, + 0, + 0, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, + 0, + (traverseproc) __Pyx_CyFunction_traverse, + (inquiry) __Pyx_CyFunction_clear, + 0, +#if PY_VERSION_HEX < 0x030500A0 + offsetof(__pyx_CyFunctionObject, func_weakreflist), +#else + offsetof(PyCFunctionObject, m_weakreflist), +#endif + 0, + 0, + __pyx_CyFunction_methods, + __pyx_CyFunction_members, + __pyx_CyFunction_getsets, + 0, + 0, + __Pyx_CyFunction_descr_get, + 0, + offsetof(__pyx_CyFunctionObject, func_dict), + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, +#if PY_VERSION_HEX >= 0x030400a1 + 0, +#endif +}; +static int __pyx_CyFunction_init(void) { + __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); + if (unlikely(__pyx_CyFunctionType == NULL)) { + return -1; + } + return 0; +} +static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults = PyObject_Malloc(size); + if (unlikely(!m->defaults)) + return PyErr_NoMemory(); + memset(m->defaults, 0, size); + m->defaults_pyobjects = pyobjects; + return m->defaults; +} +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults_tuple = tuple; + Py_INCREF(tuple); +} +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults_kwdict = dict; + Py_INCREF(dict); +} +static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->func_annotations = dict; + Py_INCREF(dict); +} + +/* GetNameInClass */ +static PyObject *__Pyx_GetGlobalNameAfterAttributeLookup(PyObject *name) { + PyObject *result; + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) + return NULL; + __Pyx_PyErr_Clear(); + __Pyx_GetModuleGlobalNameUncached(result, name); + return result; +} +static PyObject *__Pyx__GetNameInClass(PyObject *nmspace, PyObject *name) { + PyObject *result; + result = __Pyx_PyObject_GetAttrStr(nmspace, name); + if (!result) { + result = __Pyx_GetGlobalNameAfterAttributeLookup(name); + } + return result; +} + +/* Globals */ +static PyObject* __Pyx_Globals(void) { + Py_ssize_t i; + PyObject *names; + PyObject *globals = __pyx_d; + Py_INCREF(globals); + names = PyObject_Dir(__pyx_m); + if (!names) + goto bad; + for (i = PyList_GET_SIZE(names)-1; i >= 0; i--) { +#if CYTHON_COMPILING_IN_PYPY + PyObject* name = PySequence_ITEM(names, i); + if (!name) + goto bad; +#else + PyObject* name = PyList_GET_ITEM(names, i); +#endif + if (!PyDict_Contains(globals, name)) { + PyObject* value = __Pyx_GetAttr(__pyx_m, name); + if (!value) { +#if CYTHON_COMPILING_IN_PYPY + Py_DECREF(name); +#endif + goto bad; + } + if (PyDict_SetItem(globals, name, value) < 0) { +#if CYTHON_COMPILING_IN_PYPY + Py_DECREF(name); +#endif + Py_DECREF(value); + goto bad; + } + } +#if CYTHON_COMPILING_IN_PYPY + Py_DECREF(name); +#endif + } + Py_DECREF(names); + return globals; +bad: + Py_XDECREF(names); + Py_XDECREF(globals); + return NULL; +} + +/* CLineInTraceback */ +#ifndef CYTHON_CLINE_IN_TRACEBACK +static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { + PyObject *use_cline; + PyObject *ptype, *pvalue, *ptraceback; +#if CYTHON_COMPILING_IN_CPYTHON + PyObject **cython_runtime_dict; +#endif + if (unlikely(!__pyx_cython_runtime)) { + return c_line; + } + __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); +#if CYTHON_COMPILING_IN_CPYTHON + cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); + if (likely(cython_runtime_dict)) { + __PYX_PY_DICT_LOOKUP_IF_MODIFIED( + use_cline, *cython_runtime_dict, + __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback)) + } else +#endif + { + PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback); + if (use_cline_obj) { + use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; + Py_DECREF(use_cline_obj); + } else { + PyErr_Clear(); + use_cline = NULL; + } + } + if (!use_cline) { + c_line = 0; + PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); + } + else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { + c_line = 0; + } + __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); + return c_line; +} +#endif + +/* CodeObjectCache */ +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { + int start = 0, mid = 0, end = count - 1; + if (end >= 0 && code_line > entries[end].code_line) { + return count; + } + while (start < end) { + mid = start + (end - start) / 2; + if (code_line < entries[mid].code_line) { + end = mid; + } else if (code_line > entries[mid].code_line) { + start = mid + 1; + } else { + return mid; + } + } + if (code_line <= entries[mid].code_line) { + return mid; + } else { + return mid + 1; + } +} +static PyCodeObject *__pyx_find_code_object(int code_line) { + PyCodeObject* code_object; + int pos; + if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { + return NULL; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { + return NULL; + } + code_object = __pyx_code_cache.entries[pos].code_object; + Py_INCREF(code_object); + return code_object; +} +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { + int pos, i; + __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; + if (unlikely(!code_line)) { + return; + } + if (unlikely(!entries)) { + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); + if (likely(entries)) { + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = 64; + __pyx_code_cache.count = 1; + entries[0].code_line = code_line; + entries[0].code_object = code_object; + Py_INCREF(code_object); + } + return; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { + PyCodeObject* tmp = entries[pos].code_object; + entries[pos].code_object = code_object; + Py_DECREF(tmp); + return; + } + if (__pyx_code_cache.count == __pyx_code_cache.max_count) { + int new_max = __pyx_code_cache.max_count + 64; + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( + __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry)); + if (unlikely(!entries)) { + return; + } + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = new_max; + } + for (i=__pyx_code_cache.count; i>pos; i--) { + entries[i] = entries[i-1]; + } + entries[pos].code_line = code_line; + entries[pos].code_object = code_object; + __pyx_code_cache.count++; + Py_INCREF(code_object); +} + +/* AddTraceback */ +#include "compile.h" +#include "frameobject.h" +#include "traceback.h" +static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( + const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyObject *py_srcfile = 0; + PyObject *py_funcname = 0; + #if PY_MAJOR_VERSION < 3 + py_srcfile = PyString_FromString(filename); + #else + py_srcfile = PyUnicode_FromString(filename); + #endif + if (!py_srcfile) goto bad; + if (c_line) { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + #else + py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + #endif + } + else { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromString(funcname); + #else + py_funcname = PyUnicode_FromString(funcname); + #endif + } + if (!py_funcname) goto bad; + py_code = __Pyx_PyCode_New( + 0, + 0, + 0, + 0, + 0, + __pyx_empty_bytes, /*PyObject *code,*/ + __pyx_empty_tuple, /*PyObject *consts,*/ + __pyx_empty_tuple, /*PyObject *names,*/ + __pyx_empty_tuple, /*PyObject *varnames,*/ + __pyx_empty_tuple, /*PyObject *freevars,*/ + __pyx_empty_tuple, /*PyObject *cellvars,*/ + py_srcfile, /*PyObject *filename,*/ + py_funcname, /*PyObject *name,*/ + py_line, + __pyx_empty_bytes /*PyObject *lnotab*/ + ); + Py_DECREF(py_srcfile); + Py_DECREF(py_funcname); + return py_code; +bad: + Py_XDECREF(py_srcfile); + Py_XDECREF(py_funcname); + return NULL; +} +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyFrameObject *py_frame = 0; + PyThreadState *tstate = __Pyx_PyThreadState_Current; + if (c_line) { + c_line = __Pyx_CLineForTraceback(tstate, c_line); + } + py_code = __pyx_find_code_object(c_line ? -c_line : py_line); + if (!py_code) { + py_code = __Pyx_CreateCodeObjectForTraceback( + funcname, c_line, py_line, filename); + if (!py_code) goto bad; + __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); + } + py_frame = PyFrame_New( + tstate, /*PyThreadState *tstate,*/ + py_code, /*PyCodeObject *code,*/ + __pyx_d, /*PyObject *globals,*/ + 0 /*PyObject *locals*/ + ); + if (!py_frame) goto bad; + __Pyx_PyFrame_SetLineNumber(py_frame, py_line); + PyTraceBack_Here(py_frame); +bad: + Py_XDECREF(py_code); + Py_XDECREF(py_frame); +} + +/* CIntToPy */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { + const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(long) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(long) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(long) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(long), + little, !is_unsigned); + } +} + +/* CIntFromPyVerify */ +#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ + __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) +#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ + __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) +#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ + {\ + func_type value = func_value;\ + if (sizeof(target_type) < sizeof(func_type)) {\ + if (unlikely(value != (func_type) (target_type) value)) {\ + func_type zero = 0;\ + if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ + return (target_type) -1;\ + if (is_unsigned && unlikely(value < zero))\ + goto raise_neg_overflow;\ + else\ + goto raise_overflow;\ + }\ + }\ + return (target_type) value;\ + } + +/* CIntToPy */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { + const int neg_one = (int) ((int) 0 - (int) 1), const_zero = (int) 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(int) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(int) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(int) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(int), + little, !is_unsigned); + } +} + +/* CIntFromPy */ +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { + const int neg_one = (int) ((int) 0 - (int) 1), const_zero = (int) 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(int) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (int) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (int) 0; + case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0]) + case 2: + if (8 * sizeof(int) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) { + return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + case 3: + if (8 * sizeof(int) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) { + return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + case 4: + if (8 * sizeof(int) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) { + return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (int) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if (sizeof(int) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (int) 0; + case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0])) + case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0]) + case -2: + if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { + return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 2: + if (8 * sizeof(int) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { + return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case -3: + if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { + return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 3: + if (8 * sizeof(int) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { + return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case -4: + if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { + return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 4: + if (8 * sizeof(int) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { + return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + } +#endif + if (sizeof(int) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + int val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (int) -1; + } + } else { + int val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (int) -1; + val = __Pyx_PyInt_As_int(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to int"); + return (int) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to int"); + return (int) -1; +} + +/* CIntFromPy */ +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { + const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(long) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (long) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (long) 0; + case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0]) + case 2: + if (8 * sizeof(long) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) { + return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + case 3: + if (8 * sizeof(long) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) { + return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + case 4: + if (8 * sizeof(long) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) { + return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (long) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if (sizeof(long) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (long) 0; + case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0])) + case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0]) + case -2: + if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 2: + if (8 * sizeof(long) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case -3: + if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 3: + if (8 * sizeof(long) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case -4: + if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 4: + if (8 * sizeof(long) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + } +#endif + if (sizeof(long) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + long val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (long) -1; + } + } else { + long val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (long) -1; + val = __Pyx_PyInt_As_long(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to long"); + return (long) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to long"); + return (long) -1; +} + +/* FastTypeChecks */ +#if CYTHON_COMPILING_IN_CPYTHON +static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) { + while (a) { + a = a->tp_base; + if (a == b) + return 1; + } + return b == &PyBaseObject_Type; +} +static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) { + PyObject *mro; + if (a == b) return 1; + mro = a->tp_mro; + if (likely(mro)) { + Py_ssize_t i, n; + n = PyTuple_GET_SIZE(mro); + for (i = 0; i < n; i++) { + if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b) + return 1; + } + return 0; + } + return __Pyx_InBases(a, b); +} +#if PY_MAJOR_VERSION == 2 +static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { + PyObject *exception, *value, *tb; + int res; + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ErrFetch(&exception, &value, &tb); + res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; + if (unlikely(res == -1)) { + PyErr_WriteUnraisable(err); + res = 0; + } + if (!res) { + res = PyObject_IsSubclass(err, exc_type2); + if (unlikely(res == -1)) { + PyErr_WriteUnraisable(err); + res = 0; + } + } + __Pyx_ErrRestore(exception, value, tb); + return res; +} +#else +static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { + int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0; + if (!res) { + res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); + } + return res; +} +#endif +static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { + Py_ssize_t i, n; + assert(PyExceptionClass_Check(exc_type)); + n = PyTuple_GET_SIZE(tuple); +#if PY_MAJOR_VERSION >= 3 + for (i=0; itp_setattro)) + return tp->tp_setattro(obj, attr_name, value); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_setattr)) + return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value); +#endif + return PyObject_SetAttr(obj, attr_name, value); +} +#endif + +/* VoidPtrExport */ +static int __Pyx_ExportVoidPtr(PyObject *name, void *p, const char *sig) { + PyObject *d; + PyObject *cobj = 0; + d = PyDict_GetItem(__pyx_d, __pyx_n_s_pyx_capi); + Py_XINCREF(d); + if (!d) { + d = PyDict_New(); + if (!d) + goto bad; + if (__Pyx_PyObject_SetAttrStr(__pyx_m, __pyx_n_s_pyx_capi, d) < 0) + goto bad; + } +#if PY_VERSION_HEX >= 0x02070000 + cobj = PyCapsule_New(p, sig, 0); +#else + cobj = PyCObject_FromVoidPtrAndDesc(p, (void *)sig, 0); +#endif + if (!cobj) + goto bad; + if (PyDict_SetItem(d, name, cobj) < 0) + goto bad; + Py_DECREF(cobj); + Py_DECREF(d); + return 0; +bad: + Py_XDECREF(cobj); + Py_XDECREF(d); + return -1; +} + +/* FunctionExport */ +static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig) { + PyObject *d = 0; + PyObject *cobj = 0; + union { + void (*fp)(void); + void *p; + } tmp; + d = PyObject_GetAttrString(__pyx_m, (char *)"__pyx_capi__"); + if (!d) { + PyErr_Clear(); + d = PyDict_New(); + if (!d) + goto bad; + Py_INCREF(d); + if (PyModule_AddObject(__pyx_m, (char *)"__pyx_capi__", d) < 0) + goto bad; + } + tmp.fp = f; +#if PY_VERSION_HEX >= 0x02070000 + cobj = PyCapsule_New(tmp.p, sig, 0); +#else + cobj = PyCObject_FromVoidPtrAndDesc(tmp.p, (void *)sig, 0); +#endif + if (!cobj) + goto bad; + if (PyDict_SetItemString(d, name, cobj) < 0) + goto bad; + Py_DECREF(cobj); + Py_DECREF(d); + return 0; +bad: + Py_XDECREF(cobj); + Py_XDECREF(d); + return -1; +} + +/* VoidPtrImport */ +#ifndef __PYX_HAVE_RT_ImportVoidPtr +#define __PYX_HAVE_RT_ImportVoidPtr +static int __Pyx_ImportVoidPtr(PyObject *module, const char *name, void **p, const char *sig) { + PyObject *d = 0; + PyObject *cobj = 0; + d = PyObject_GetAttrString(module, (char *)"__pyx_capi__"); + if (!d) + goto bad; + cobj = PyDict_GetItemString(d, name); + if (!cobj) { + PyErr_Format(PyExc_ImportError, + "%.200s does not export expected C variable %.200s", + PyModule_GetName(module), name); + goto bad; + } +#if PY_VERSION_HEX >= 0x02070000 + if (!PyCapsule_IsValid(cobj, sig)) { + PyErr_Format(PyExc_TypeError, + "C variable %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", + PyModule_GetName(module), name, sig, PyCapsule_GetName(cobj)); + goto bad; + } + *p = PyCapsule_GetPointer(cobj, sig); +#else + {const char *desc, *s1, *s2; + desc = (const char *)PyCObject_GetDesc(cobj); + if (!desc) + goto bad; + s1 = desc; s2 = sig; + while (*s1 != '\0' && *s1 == *s2) { s1++; s2++; } + if (*s1 != *s2) { + PyErr_Format(PyExc_TypeError, + "C variable %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", + PyModule_GetName(module), name, sig, desc); + goto bad; + } + *p = PyCObject_AsVoidPtr(cobj);} +#endif + if (!(*p)) + goto bad; + Py_DECREF(d); + return 0; +bad: + Py_XDECREF(d); + return -1; +} +#endif + +/* FunctionImport */ +#ifndef __PYX_HAVE_RT_ImportFunction +#define __PYX_HAVE_RT_ImportFunction +static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig) { + PyObject *d = 0; + PyObject *cobj = 0; + union { + void (*fp)(void); + void *p; + } tmp; + d = PyObject_GetAttrString(module, (char *)"__pyx_capi__"); + if (!d) + goto bad; + cobj = PyDict_GetItemString(d, funcname); + if (!cobj) { + PyErr_Format(PyExc_ImportError, + "%.200s does not export expected C function %.200s", + PyModule_GetName(module), funcname); + goto bad; + } +#if PY_VERSION_HEX >= 0x02070000 + if (!PyCapsule_IsValid(cobj, sig)) { + PyErr_Format(PyExc_TypeError, + "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", + PyModule_GetName(module), funcname, sig, PyCapsule_GetName(cobj)); + goto bad; + } + tmp.p = PyCapsule_GetPointer(cobj, sig); +#else + {const char *desc, *s1, *s2; + desc = (const char *)PyCObject_GetDesc(cobj); + if (!desc) + goto bad; + s1 = desc; s2 = sig; + while (*s1 != '\0' && *s1 == *s2) { s1++; s2++; } + if (*s1 != *s2) { + PyErr_Format(PyExc_TypeError, + "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", + PyModule_GetName(module), funcname, sig, desc); + goto bad; + } + tmp.p = PyCObject_AsVoidPtr(cobj);} +#endif + *f = tmp.fp; + if (!(*f)) + goto bad; + Py_DECREF(d); + return 0; +bad: + Py_XDECREF(d); + return -1; +} +#endif + +/* InitStrings */ +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { + while (t->p) { + #if PY_MAJOR_VERSION < 3 + if (t->is_unicode) { + *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); + } else if (t->intern) { + *t->p = PyString_InternFromString(t->s); + } else { + *t->p = PyString_FromStringAndSize(t->s, t->n - 1); + } + #else + if (t->is_unicode | t->is_str) { + if (t->intern) { + *t->p = PyUnicode_InternFromString(t->s); + } else if (t->encoding) { + *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); + } else { + *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); + } + } else { + *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); + } + #endif + if (!*t->p) + return -1; + if (PyObject_Hash(*t->p) == -1) + return -1; + ++t; + } + return 0; +} + +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { + return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); +} +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { + Py_ssize_t ignore; + return __Pyx_PyObject_AsStringAndSize(o, &ignore); +} +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +#if !CYTHON_PEP393_ENABLED +static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { + char* defenc_c; + PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); + if (!defenc) return NULL; + defenc_c = PyBytes_AS_STRING(defenc); +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + { + char* end = defenc_c + PyBytes_GET_SIZE(defenc); + char* c; + for (c = defenc_c; c < end; c++) { + if ((unsigned char) (*c) >= 128) { + PyUnicode_AsASCIIString(o); + return NULL; + } + } + } +#endif + *length = PyBytes_GET_SIZE(defenc); + return defenc_c; +} +#else +static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { + if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + if (likely(PyUnicode_IS_ASCII(o))) { + *length = PyUnicode_GET_LENGTH(o); + return PyUnicode_AsUTF8(o); + } else { + PyUnicode_AsASCIIString(o); + return NULL; + } +#else + return PyUnicode_AsUTF8AndSize(o, length); +#endif +} +#endif +#endif +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT + if ( +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + __Pyx_sys_getdefaultencoding_not_ascii && +#endif + PyUnicode_Check(o)) { + return __Pyx_PyUnicode_AsStringAndSize(o, length); + } else +#endif +#if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) + if (PyByteArray_Check(o)) { + *length = PyByteArray_GET_SIZE(o); + return PyByteArray_AS_STRING(o); + } else +#endif + { + char* result; + int r = PyBytes_AsStringAndSize(o, &result, length); + if (unlikely(r < 0)) { + return NULL; + } else { + return result; + } + } +} +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { + int is_true = x == Py_True; + if (is_true | (x == Py_False) | (x == Py_None)) return is_true; + else return PyObject_IsTrue(x); +} +static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) { + int retval; + if (unlikely(!x)) return -1; + retval = __Pyx_PyObject_IsTrue(x); + Py_DECREF(x); + return retval; +} +static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) { +#if PY_MAJOR_VERSION >= 3 + if (PyLong_Check(result)) { + if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, + "__int__ returned non-int (type %.200s). " + "The ability to return an instance of a strict subclass of int " + "is deprecated, and may be removed in a future version of Python.", + Py_TYPE(result)->tp_name)) { + Py_DECREF(result); + return NULL; + } + return result; + } +#endif + PyErr_Format(PyExc_TypeError, + "__%.4s__ returned non-%.4s (type %.200s)", + type_name, type_name, Py_TYPE(result)->tp_name); + Py_DECREF(result); + return NULL; +} +static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { +#if CYTHON_USE_TYPE_SLOTS + PyNumberMethods *m; +#endif + const char *name = NULL; + PyObject *res = NULL; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x) || PyLong_Check(x))) +#else + if (likely(PyLong_Check(x))) +#endif + return __Pyx_NewRef(x); +#if CYTHON_USE_TYPE_SLOTS + m = Py_TYPE(x)->tp_as_number; + #if PY_MAJOR_VERSION < 3 + if (m && m->nb_int) { + name = "int"; + res = m->nb_int(x); + } + else if (m && m->nb_long) { + name = "long"; + res = m->nb_long(x); + } + #else + if (likely(m && m->nb_int)) { + name = "int"; + res = m->nb_int(x); + } + #endif +#else + if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { + res = PyNumber_Int(x); + } +#endif + if (likely(res)) { +#if PY_MAJOR_VERSION < 3 + if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) { +#else + if (unlikely(!PyLong_CheckExact(res))) { +#endif + return __Pyx_PyNumber_IntOrLongWrongResultType(res, name); + } + } + else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_TypeError, + "an integer is required"); + } + return res; +} +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { + Py_ssize_t ival; + PyObject *x; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_CheckExact(b))) { + if (sizeof(Py_ssize_t) >= sizeof(long)) + return PyInt_AS_LONG(b); + else + return PyInt_AsSsize_t(b); + } +#endif + if (likely(PyLong_CheckExact(b))) { + #if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)b)->ob_digit; + const Py_ssize_t size = Py_SIZE(b); + if (likely(__Pyx_sst_abs(size) <= 1)) { + ival = likely(size) ? digits[0] : 0; + if (size == -1) ival = -ival; + return ival; + } else { + switch (size) { + case 2: + if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { + return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -2: + if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case 3: + if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { + return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -3: + if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case 4: + if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { + return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -4: + if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + } + } + #endif + return PyLong_AsSsize_t(b); + } + x = PyNumber_Index(b); + if (!x) return -1; + ival = PyInt_AsSsize_t(x); + Py_DECREF(x); + return ival; +} +static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) { + return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False); +} +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { + return PyInt_FromSize_t(ival); +} + + +#endif /* Py_PYTHON_H */ diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/queue.html b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/queue.html new file mode 100644 index 00000000..294d2c87 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/queue.html @@ -0,0 +1,9489 @@ + + + + + + Cython: queue.py + + + +

Generated by Cython 0.29.2

+

+ Yellow lines hint at Python interaction.
+ Click on a line that starts with a "+" to see the C code that Cython generated for it. +

+

Raw output: queue.c

+
+001: # Copyright (c) 2009-2012 Denis Bilenko. See LICENSE for details.
+
  __pyx_t_6 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_6) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+
 002: # copyright (c) 2018 gevent
+
 003: # cython: auto_pickle=False,embedsignature=True,always_allow_keywords=False
+
 004: """
+
 005: Synchronized queues.
+
 006: 
+
 007: The :mod:`gevent.queue` module implements multi-producer, multi-consumer queues
+
 008: that work across greenlets, with the API similar to the classes found in the
+
 009: standard :mod:`Queue` and :class:`multiprocessing <multiprocessing.Queue>` modules.
+
 010: 
+
 011: The classes in this module implement the iterator protocol. Iterating
+
 012: over a queue means repeatedly calling :meth:`get <Queue.get>` until
+
 013: :meth:`get <Queue.get>` returns ``StopIteration`` (specifically that
+
 014: class, not an instance or subclass).
+
 015: 
+
 016:     >>> queue = gevent.queue.Queue()
+
 017:     >>> queue.put(1)
+
 018:     >>> queue.put(2)
+
 019:     >>> queue.put(StopIteration)
+
 020:     >>> for item in queue:
+
 021:     ...    print(item)
+
 022:     1
+
 023:     2
+
 024: 
+
 025: .. versionchanged:: 1.0
+
 026:        ``Queue(0)`` now means queue of infinite size, not a channel. A :exc:`DeprecationWarning`
+
 027:        will be issued with this argument.
+
 028: """
+
 029: 
+
 030: from __future__ import absolute_import
+
+031: import sys
+
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_sys, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 31, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_sys, __pyx_t_1) < 0) __PYX_ERR(0, 31, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+032: from heapq import heappush as _heappush
+
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 32, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(__pyx_n_s_heappush_2);
+  __Pyx_GIVEREF(__pyx_n_s_heappush_2);
+  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_heappush_2);
+  __pyx_t_2 = __Pyx_Import(__pyx_n_s_heapq, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 32, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_heappush_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 32, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(__pyx_t_1);
+  __Pyx_XGOTREF(__pyx_v_6gevent_6_queue__heappush);
+  __Pyx_DECREF_SET(__pyx_v_6gevent_6_queue__heappush, __pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+033: from heapq import heappop as _heappop
+
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 33, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_heappop_2);
+  __Pyx_GIVEREF(__pyx_n_s_heappop_2);
+  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_heappop_2);
+  __pyx_t_1 = __Pyx_Import(__pyx_n_s_heapq, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 33, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_heappop_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 33, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(__pyx_t_2);
+  __Pyx_XGOTREF(__pyx_v_6gevent_6_queue__heappop);
+  __Pyx_DECREF_SET(__pyx_v_6gevent_6_queue__heappop, __pyx_t_2);
+  __Pyx_GIVEREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+034: from heapq import heapify as _heapify
+
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 34, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(__pyx_n_s_heapify_2);
+  __Pyx_GIVEREF(__pyx_n_s_heapify_2);
+  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_heapify_2);
+  __pyx_t_2 = __Pyx_Import(__pyx_n_s_heapq, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 34, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_heapify_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 34, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(__pyx_t_1);
+  __Pyx_XGOTREF(__pyx_v_6gevent_6_queue__heapify);
+  __Pyx_DECREF_SET(__pyx_v_6gevent_6_queue__heapify, __pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+035: import collections
+
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_collections, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 35, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_collections, __pyx_t_2) < 0) __PYX_ERR(0, 35, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
 036: 
+
+037: if sys.version_info[0] == 2:
+
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_sys); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 37, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_version_info); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 37, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 37, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_1 = __Pyx_PyInt_EqObjC(__pyx_t_2, __pyx_int_2, 2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 37, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 37, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  if (__pyx_t_3) {
+/* … */
+    goto __pyx_L2;
+  }
+
+038:     import Queue as __queue__ # python 3: pylint:disable=import-error
+
    __pyx_t_1 = __Pyx_Import(__pyx_n_s_Queue, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 38, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    if (PyDict_SetItem(__pyx_d, __pyx_n_s_queue_2, __pyx_t_1) < 0) __PYX_ERR(0, 38, __pyx_L1_error)
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 039: else:
+
+040:     import queue as __queue__ # python 2: pylint:disable=import-error
+
  /*else*/ {
+    __pyx_t_1 = __Pyx_Import(__pyx_n_s_queue, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 40, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    if (PyDict_SetItem(__pyx_d, __pyx_n_s_queue_2, __pyx_t_1) < 0) __PYX_ERR(0, 40, __pyx_L1_error)
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  }
+  __pyx_L2:;
+
+041: Full = __queue__.Full
+
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_queue_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 41, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_Full); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 41, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Full, __pyx_t_2) < 0) __PYX_ERR(0, 41, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+042: Empty = __queue__.Empty
+
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_queue_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 42, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_Empty); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 42, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Empty, __pyx_t_1) < 0) __PYX_ERR(0, 42, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 043: 
+
+044: from gevent.timeout import Timeout
+
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 44, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(__pyx_n_s_Timeout);
+  __Pyx_GIVEREF(__pyx_n_s_Timeout);
+  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_Timeout);
+  __pyx_t_2 = __Pyx_Import(__pyx_n_s_gevent_timeout, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 44, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_Timeout); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 44, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Timeout, __pyx_t_1) < 0) __PYX_ERR(0, 44, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+045: from gevent._hub_local import get_hub_noargs as get_hub
+
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 45, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_get_hub_noargs);
+  __Pyx_GIVEREF(__pyx_n_s_get_hub_noargs);
+  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_get_hub_noargs);
+  __pyx_t_1 = __Pyx_Import(__pyx_n_s_gevent__hub_local, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 45, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_get_hub_noargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 45, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_hub, __pyx_t_2) < 0) __PYX_ERR(0, 45, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+046: from greenlet import getcurrent
+
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 46, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(__pyx_n_s_getcurrent);
+  __Pyx_GIVEREF(__pyx_n_s_getcurrent);
+  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_getcurrent);
+  __pyx_t_2 = __Pyx_Import(__pyx_n_s_greenlet, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 46, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_getcurrent); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 46, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_getcurrent, __pyx_t_1) < 0) __PYX_ERR(0, 46, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+047: from gevent.exceptions import InvalidSwitchError
+
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 47, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_InvalidSwitchError);
+  __Pyx_GIVEREF(__pyx_n_s_InvalidSwitchError);
+  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_InvalidSwitchError);
+  __pyx_t_1 = __Pyx_Import(__pyx_n_s_gevent_exceptions, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 47, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_InvalidSwitchError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 47, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_InvalidSwitchError, __pyx_t_2) < 0) __PYX_ERR(0, 47, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 048: 
+
+049: __all__ = []
+
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 49, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_all, __pyx_t_1) < 0) __PYX_ERR(0, 49, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+050: __implements__ = ['Queue', 'PriorityQueue', 'LifoQueue']
+
  __pyx_t_1 = PyList_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 50, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(__pyx_n_s_Queue);
+  __Pyx_GIVEREF(__pyx_n_s_Queue);
+  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_Queue);
+  __Pyx_INCREF(__pyx_n_s_PriorityQueue);
+  __Pyx_GIVEREF(__pyx_n_s_PriorityQueue);
+  PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_PriorityQueue);
+  __Pyx_INCREF(__pyx_n_s_LifoQueue);
+  __Pyx_GIVEREF(__pyx_n_s_LifoQueue);
+  PyList_SET_ITEM(__pyx_t_1, 2, __pyx_n_s_LifoQueue);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_implements, __pyx_t_1) < 0) __PYX_ERR(0, 50, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+051: __extensions__ = ['JoinableQueue', 'Channel']
+
  __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 51, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(__pyx_n_s_JoinableQueue);
+  __Pyx_GIVEREF(__pyx_n_s_JoinableQueue);
+  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_JoinableQueue);
+  __Pyx_INCREF(__pyx_n_s_Channel);
+  __Pyx_GIVEREF(__pyx_n_s_Channel);
+  PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_Channel);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_extensions, __pyx_t_1) < 0) __PYX_ERR(0, 51, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+052: __imports__ = ['Empty', 'Full']
+
  __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 52, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(__pyx_n_s_Empty);
+  __Pyx_GIVEREF(__pyx_n_s_Empty);
+  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_Empty);
+  __Pyx_INCREF(__pyx_n_s_Full);
+  __Pyx_GIVEREF(__pyx_n_s_Full);
+  PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_Full);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_imports, __pyx_t_1) < 0) __PYX_ERR(0, 52, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+053: if hasattr(__queue__, 'SimpleQueue'):
+
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_queue_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 53, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_3 = __Pyx_HasAttr(__pyx_t_1, __pyx_n_s_SimpleQueue); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 53, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_4 = (__pyx_t_3 != 0);
+  if (__pyx_t_4) {
+/* … */
+  }
+
+054:     __all__.append('SimpleQueue') # New in 3.7
+
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_all); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 54, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __pyx_t_5 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_n_s_SimpleQueue); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 54, __pyx_L1_error)
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 055:     # SimpleQueue is implemented in C and directly allocates locks
+
 056:     # unaffected by monkey patching. We need the Python version.
+
+057:     SimpleQueue = __queue__._PySimpleQueue # pylint:disable=no-member
+
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_queue_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 57, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_PySimpleQueue); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 57, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    if (PyDict_SetItem(__pyx_d, __pyx_n_s_SimpleQueue, __pyx_t_2) < 0) __PYX_ERR(0, 57, __pyx_L1_error)
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+058: __all__ += (__implements__ + __extensions__ + __imports__)
+
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_all); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 58, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_implements); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 58, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_extensions); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 58, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  __pyx_t_7 = PyNumber_Add(__pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 58, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_7);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_imports); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 58, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  __pyx_t_1 = PyNumber_Add(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 58, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  __pyx_t_6 = PyNumber_InPlaceAdd(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 58, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_all, __pyx_t_6) < 0) __PYX_ERR(0, 58, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+
 059: 
+
 060: 
+
 061: # pylint 2.0.dev2 things collections.dequeue.popleft() doesn't return
+
 062: # pylint:disable=assignment-from-no-return
+
 063: 
+
+064: def _safe_remove(deq, item):
+
static PyObject *__pyx_f_6gevent_6_queue__safe_remove(PyObject *__pyx_v_deq, PyObject *__pyx_v_item) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_safe_remove", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_XDECREF(__pyx_t_6);
+  __Pyx_AddTraceback("gevent._queue._safe_remove", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
 065:     # For when the item may have been removed by
+
 066:     # Queue._unlock
+
+067:     try:
+
  {
+    /*try:*/ {
+/* … */
+    }
+    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+    goto __pyx_L8_try_end;
+    __pyx_L3_error:;
+    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+/* … */
+    __Pyx_XGIVEREF(__pyx_t_1);
+    __Pyx_XGIVEREF(__pyx_t_2);
+    __Pyx_XGIVEREF(__pyx_t_3);
+    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
+    goto __pyx_L1_error;
+    __pyx_L4_exception_handled:;
+    __Pyx_XGIVEREF(__pyx_t_1);
+    __Pyx_XGIVEREF(__pyx_t_2);
+    __Pyx_XGIVEREF(__pyx_t_3);
+    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
+    __pyx_L8_try_end:;
+  }
+
+068:         deq.remove(item)
+
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_deq, __pyx_n_s_remove); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 68, __pyx_L3_error)
+      __Pyx_GOTREF(__pyx_t_5);
+      __pyx_t_6 = NULL;
+      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
+        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
+        if (likely(__pyx_t_6)) {
+          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
+          __Pyx_INCREF(__pyx_t_6);
+          __Pyx_INCREF(function);
+          __Pyx_DECREF_SET(__pyx_t_5, function);
+        }
+      }
+      __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_v_item) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_item);
+      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 68, __pyx_L3_error)
+      __Pyx_GOTREF(__pyx_t_4);
+      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+
+069:     except ValueError:
+
    __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ValueError);
+    if (__pyx_t_7) {
+      __Pyx_ErrRestore(0,0,0);
+      goto __pyx_L4_exception_handled;
+    }
+    goto __pyx_L5_except_error;
+    __pyx_L5_except_error:;
+
 070:         pass
+
 071: 
+
+072: import gevent._waiter
+
  __pyx_t_6 = __Pyx_Import(__pyx_n_s_gevent__waiter, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 72, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_gevent, __pyx_t_6) < 0) __PYX_ERR(0, 72, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+
+073: locals()['Waiter'] = gevent._waiter.Waiter
+
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_gevent); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 73, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_waiter); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 73, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_Waiter); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 73, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_1 = __Pyx_Globals(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 73, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (unlikely(PyDict_SetItem(__pyx_t_1, __pyx_n_s_Waiter, __pyx_t_6) < 0)) __PYX_ERR(0, 73, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+
 074: 
+
+075: class ItemWaiter(Waiter): # pylint:disable=undefined-variable
+
struct __pyx_vtabstruct_6gevent_6_queue_ItemWaiter {
+  struct __pyx_vtabstruct_6gevent_8__waiter_Waiter __pyx_base;
+};
+static struct __pyx_vtabstruct_6gevent_6_queue_ItemWaiter *__pyx_vtabptr_6gevent_6_queue_ItemWaiter;
+
+
 076:     # pylint:disable=assigning-non-slot
+
 077:     __slots__ = (
+
+078:         'item',
+
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_ItemWaiter->tp_dict, __pyx_n_s_slots, __pyx_tuple__7) < 0) __PYX_ERR(0, 77, __pyx_L1_error)
+  PyType_Modified(__pyx_ptype_6gevent_6_queue_ItemWaiter);
+/* … */
+  __pyx_tuple__7 = PyTuple_Pack(2, __pyx_n_s_item, __pyx_n_s_queue); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 78, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__7);
+  __Pyx_GIVEREF(__pyx_tuple__7);
+
 079:         'queue',
+
 080:     )
+
 081: 
+
+082:     def __init__(self, item, queue):
+
/* Python wrapper */
+static int __pyx_pw_6gevent_6_queue_10ItemWaiter_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static int __pyx_pw_6gevent_6_queue_10ItemWaiter_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_item = 0;
+  PyObject *__pyx_v_queue = 0;
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_item,&__pyx_n_s_queue,0};
+    PyObject* values[2] = {0,0};
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_item)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_queue)) != 0)) kw_args--;
+        else {
+          __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(0, 82, __pyx_L3_error)
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 82, __pyx_L3_error)
+      }
+    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
+      goto __pyx_L5_argtuple_error;
+    } else {
+      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+    }
+    __pyx_v_item = values[0];
+    __pyx_v_queue = values[1];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 82, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent._queue.ItemWaiter.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return -1;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_6_queue_10ItemWaiter___init__(((struct __pyx_obj_6gevent_6_queue_ItemWaiter *)__pyx_v_self), __pyx_v_item, __pyx_v_queue);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_6_queue_10ItemWaiter___init__(struct __pyx_obj_6gevent_6_queue_ItemWaiter *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_queue) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = 0;
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_AddTraceback("gevent._queue.ItemWaiter.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = -1;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+083:         Waiter.__init__(self) # pylint:disable=undefined-variable
+
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_6gevent_8__waiter_Waiter), __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 83, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = NULL;
+  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+    if (likely(__pyx_t_3)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+      __Pyx_INCREF(__pyx_t_3);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_2, function);
+    }
+  }
+  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, ((PyObject *)__pyx_v_self)) : __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_v_self));
+  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 83, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+084:         self.item = item
+
  __Pyx_INCREF(__pyx_v_item);
+  __Pyx_GIVEREF(__pyx_v_item);
+  __Pyx_GOTREF(__pyx_v_self->item);
+  __Pyx_DECREF(__pyx_v_self->item);
+  __pyx_v_self->item = __pyx_v_item;
+
+085:         self.queue = queue
+
  __Pyx_INCREF(__pyx_v_queue);
+  __Pyx_GIVEREF(__pyx_v_queue);
+  __Pyx_GOTREF(__pyx_v_self->queue);
+  __Pyx_DECREF(__pyx_v_self->queue);
+  __pyx_v_self->queue = __pyx_v_queue;
+
 086: 
+
+087:     def put_and_switch(self):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_queue_10ItemWaiter_3put_and_switch(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6gevent_6_queue_10ItemWaiter_2put_and_switch[] = "ItemWaiter.put_and_switch(self)";
+static PyMethodDef __pyx_mdef_6gevent_6_queue_10ItemWaiter_3put_and_switch = {"put_and_switch", (PyCFunction)__pyx_pw_6gevent_6_queue_10ItemWaiter_3put_and_switch, METH_NOARGS, __pyx_doc_6gevent_6_queue_10ItemWaiter_2put_and_switch};
+static PyObject *__pyx_pw_6gevent_6_queue_10ItemWaiter_3put_and_switch(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("put_and_switch (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_6_queue_10ItemWaiter_2put_and_switch(((struct __pyx_obj_6gevent_6_queue_ItemWaiter *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_queue_10ItemWaiter_2put_and_switch(struct __pyx_obj_6gevent_6_queue_ItemWaiter *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("put_and_switch", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_AddTraceback("gevent._queue.ItemWaiter.put_and_switch", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__8 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 87, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__8);
+  __Pyx_GIVEREF(__pyx_tuple__8);
+/* … */
+  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_queue_10ItemWaiter_3put_and_switch, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ItemWaiter_put_and_switch, NULL, __pyx_n_s_gevent__queue, __pyx_d, ((PyObject *)__pyx_codeobj__9)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 87, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_ItemWaiter->tp_dict, __pyx_n_s_put_and_switch, __pyx_t_6) < 0) __PYX_ERR(0, 87, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_6_queue_ItemWaiter);
+  __pyx_codeobj__9 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__8, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_queue_py, __pyx_n_s_put_and_switch, 87, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__9)) __PYX_ERR(0, 87, __pyx_L1_error)
+
+088:         self.queue._put(self.item)
+
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->queue, __pyx_n_s_put); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 88, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = NULL;
+  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+    if (likely(__pyx_t_3)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+      __Pyx_INCREF(__pyx_t_3);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_2, function);
+    }
+  }
+  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_self->item) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_self->item);
+  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 88, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+089:         self.queue = None
+
  __Pyx_INCREF(Py_None);
+  __Pyx_GIVEREF(Py_None);
+  __Pyx_GOTREF(__pyx_v_self->queue);
+  __Pyx_DECREF(__pyx_v_self->queue);
+  __pyx_v_self->queue = Py_None;
+
+090:         self.item = None
+
  __Pyx_INCREF(Py_None);
+  __Pyx_GIVEREF(Py_None);
+  __Pyx_GOTREF(__pyx_v_self->item);
+  __Pyx_DECREF(__pyx_v_self->item);
+  __pyx_v_self->item = Py_None;
+
+091:         return self.switch(self)
+
  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_switch); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 91, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = NULL;
+  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+    if (likely(__pyx_t_3)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+      __Pyx_INCREF(__pyx_t_3);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_2, function);
+    }
+  }
+  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, ((PyObject *)__pyx_v_self)) : __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_v_self));
+  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 91, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
 092: 
+
+093: class Queue(object):
+
struct __pyx_vtabstruct_6gevent_6_queue_Queue {
+  PyObject *(*_get)(struct __pyx_obj_6gevent_6_queue_Queue *, int __pyx_skip_dispatch);
+  PyObject *(*_put)(struct __pyx_obj_6gevent_6_queue_Queue *, PyObject *, int __pyx_skip_dispatch);
+  PyObject *(*_peek)(struct __pyx_obj_6gevent_6_queue_Queue *, int __pyx_skip_dispatch);
+  Py_ssize_t (*qsize)(struct __pyx_obj_6gevent_6_queue_Queue *, int __pyx_skip_dispatch);
+  int (*empty)(struct __pyx_obj_6gevent_6_queue_Queue *, int __pyx_skip_dispatch);
+  int (*full)(struct __pyx_obj_6gevent_6_queue_Queue *, int __pyx_skip_dispatch);
+  PyObject *(*put)(struct __pyx_obj_6gevent_6_queue_Queue *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_6_queue_5Queue_put *__pyx_optional_args);
+  PyObject *(*put_nowait)(struct __pyx_obj_6gevent_6_queue_Queue *, PyObject *, int __pyx_skip_dispatch);
+  PyObject *(*__pyx___get_or_peek)(struct __pyx_obj_6gevent_6_queue_Queue *, PyObject *, PyObject *, PyObject *);
+  PyObject *(*get)(struct __pyx_obj_6gevent_6_queue_Queue *, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_6_queue_5Queue_get *__pyx_optional_args);
+  PyObject *(*get_nowait)(struct __pyx_obj_6gevent_6_queue_Queue *, int __pyx_skip_dispatch);
+  PyObject *(*peek)(struct __pyx_obj_6gevent_6_queue_Queue *, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_6_queue_5Queue_peek *__pyx_optional_args);
+  PyObject *(*peek_nowait)(struct __pyx_obj_6gevent_6_queue_Queue *, int __pyx_skip_dispatch);
+  PyObject *(*_schedule_unlock)(struct __pyx_obj_6gevent_6_queue_Queue *);
+};
+static struct __pyx_vtabstruct_6gevent_6_queue_Queue *__pyx_vtabptr_6gevent_6_queue_Queue;
+
+
 094:     """
+
 095:     Create a queue object with a given maximum size.
+
 096: 
+
 097:     If *maxsize* is less than or equal to zero or ``None``, the queue
+
 098:     size is infinite.
+
 099: 
+
 100:     Queues have a ``len`` equal to the number of items in them (the :meth:`qsize`),
+
 101:     but in a boolean context they are always True.
+
 102: 
+
 103:     .. versionchanged:: 1.1b3
+
 104:        Queues now support :func:`len`; it behaves the same as :meth:`qsize`.
+
 105:     .. versionchanged:: 1.1b3
+
 106:        Multiple greenlets that block on a call to :meth:`put` for a full queue
+
 107:        will now be awakened to put their items into the queue in the order in which
+
 108:        they arrived. Likewise, multiple greenlets that block on a call to :meth:`get` for
+
 109:        an empty queue will now receive items in the order in which they blocked. An
+
 110:        implementation quirk under CPython *usually* ensured this was roughly the case
+
 111:        previously anyway, but that wasn't the case for PyPy.
+
 112:     """
+
 113: 
+
 114:     __slots__ = (
+
+115:         '_maxsize',
+
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_Queue->tp_dict, __pyx_n_s_slots, __pyx_tuple__10) < 0) __PYX_ERR(0, 114, __pyx_L1_error)
+  PyType_Modified(__pyx_ptype_6gevent_6_queue_Queue);
+/* … */
+  __pyx_tuple__10 = PyTuple_Pack(7, __pyx_n_s_maxsize_2, __pyx_n_s_getters, __pyx_n_s_putters, __pyx_n_s_hub, __pyx_n_s_event_unlock, __pyx_n_s_queue, __pyx_n_s_weakref); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 115, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__10);
+  __Pyx_GIVEREF(__pyx_tuple__10);
+
 116:         'getters',
+
 117:         'putters',
+
 118:         'hub',
+
 119:         '_event_unlock',
+
 120:         'queue',
+
 121:         '__weakref__',
+
 122:     )
+
 123: 
+
+124:     def __init__(self, maxsize=None, items=(), _warn_depth=2):
+
/* Python wrapper */
+static int __pyx_pw_6gevent_6_queue_5Queue_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static int __pyx_pw_6gevent_6_queue_5Queue_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_maxsize = 0;
+  PyObject *__pyx_v_items = 0;
+  PyObject *__pyx_v__warn_depth = 0;
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_maxsize,&__pyx_n_s_items,&__pyx_n_s_warn_depth,0};
+    PyObject* values[3] = {0,0,0};
+    values[0] = ((PyObject *)Py_None);
+    values[1] = ((PyObject *)__pyx_empty_tuple);
+    values[2] = ((PyObject *)__pyx_int_2);
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_maxsize);
+          if (value) { values[0] = value; kw_args--; }
+        }
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_items);
+          if (value) { values[1] = value; kw_args--; }
+        }
+        CYTHON_FALLTHROUGH;
+        case  2:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_warn_depth);
+          if (value) { values[2] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 124, __pyx_L3_error)
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    __pyx_v_maxsize = values[0];
+    __pyx_v_items = values[1];
+    __pyx_v__warn_depth = values[2];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 124, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent._queue.Queue.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return -1;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_6_queue_5Queue___init__(((struct __pyx_obj_6gevent_6_queue_Queue *)__pyx_v_self), __pyx_v_maxsize, __pyx_v_items, __pyx_v__warn_depth);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_6_queue_5Queue___init__(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self, PyObject *__pyx_v_maxsize, PyObject *__pyx_v_items, PyObject *__pyx_v__warn_depth) {
+  PyObject *__pyx_v_warnings = NULL;
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__", 0);
+  __Pyx_INCREF(__pyx_v_maxsize);
+/* … */
+  /* function exit code */
+  __pyx_r = 0;
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_XDECREF(__pyx_t_6);
+  __Pyx_AddTraceback("gevent._queue.Queue.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = -1;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_warnings);
+  __Pyx_XDECREF(__pyx_v_maxsize);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+125:         if maxsize is not None and maxsize <= 0:
+
  __pyx_t_2 = (__pyx_v_maxsize != Py_None);
+  __pyx_t_3 = (__pyx_t_2 != 0);
+  if (__pyx_t_3) {
+  } else {
+    __pyx_t_1 = __pyx_t_3;
+    goto __pyx_L4_bool_binop_done;
+  }
+  __pyx_t_4 = PyObject_RichCompare(__pyx_v_maxsize, __pyx_int_0, Py_LE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 125, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 125, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __pyx_t_1 = __pyx_t_3;
+  __pyx_L4_bool_binop_done:;
+  if (__pyx_t_1) {
+/* … */
+  }
+
+126:             if maxsize == 0:
+
    __pyx_t_4 = __Pyx_PyInt_EqObjC(__pyx_v_maxsize, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 126, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 126, __pyx_L1_error)
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    if (__pyx_t_1) {
+/* … */
+    }
+
+127:                 import warnings
+
      __pyx_t_4 = __Pyx_Import(__pyx_n_s_warnings, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 127, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_4);
+      __pyx_v_warnings = __pyx_t_4;
+      __pyx_t_4 = 0;
+
+128:                 warnings.warn(
+
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_warnings, __pyx_n_s_warn); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 128, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_4);
+/* … */
+      __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple_, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 128, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_6);
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+/* … */
+  __pyx_tuple_ = PyTuple_Pack(2, __pyx_kp_s_Queue_0_now_equivalent_to_Queue, __pyx_builtin_DeprecationWarning); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 128, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple_);
+  __Pyx_GIVEREF(__pyx_tuple_);
+
 129:                     'Queue(0) now equivalent to Queue(None); if you want a channel, use Channel',
+
 130:                     DeprecationWarning,
+
+131:                     stacklevel=_warn_depth)
+
      __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 131, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_5);
+      if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_stacklevel, __pyx_v__warn_depth) < 0) __PYX_ERR(0, 131, __pyx_L1_error)
+
+132:             maxsize = None
+
    __Pyx_INCREF(Py_None);
+    __Pyx_DECREF_SET(__pyx_v_maxsize, Py_None);
+
 133: 
+
+134:         self._maxsize = maxsize if maxsize is not None else -1
+
  __pyx_t_1 = (__pyx_v_maxsize != Py_None);
+  if ((__pyx_t_1 != 0)) {
+    __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_v_maxsize); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 134, __pyx_L1_error)
+    __pyx_t_7 = __pyx_t_8;
+  } else {
+    __pyx_t_7 = -1L;
+  }
+  __pyx_v_self->_maxsize = __pyx_t_7;
+
 135:         # Explicitly maintain order for getters and putters that block
+
 136:         # so that callers can consistently rely on getting things out
+
 137:         # in the apparent order they went in. This was once required by
+
 138:         # imap_unordered. Previously these were set() objects, and the
+
 139:         # items put in the set have default hash() and eq() methods;
+
 140:         # under CPython, since new objects tend to have increasing
+
 141:         # hash values, this tended to roughly maintain order anyway,
+
 142:         # but that's not true under PyPy. An alternative to a deque
+
 143:         # (to avoid the linear scan of remove()) might be an
+
 144:         # OrderedDict, but it's 2.7 only; we don't expect to have so
+
 145:         # many waiters that removing an arbitrary element is a
+
 146:         # bottleneck, though.
+
+147:         self.getters = collections.deque()
+
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_collections); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 147, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_5);
+  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_deque); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 147, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_4);
+  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+  __pyx_t_5 = NULL;
+  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
+    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
+    if (likely(__pyx_t_5)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
+      __Pyx_INCREF(__pyx_t_5);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_4, function);
+    }
+  }
+  __pyx_t_6 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+  if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 147, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __Pyx_GIVEREF(__pyx_t_6);
+  __Pyx_GOTREF(__pyx_v_self->getters);
+  __Pyx_DECREF(__pyx_v_self->getters);
+  __pyx_v_self->getters = __pyx_t_6;
+  __pyx_t_6 = 0;
+
+148:         self.putters = collections.deque()
+
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_collections); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 148, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_4);
+  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_deque); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 148, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_5);
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __pyx_t_4 = NULL;
+  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
+    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
+    if (likely(__pyx_t_4)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
+      __Pyx_INCREF(__pyx_t_4);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_5, function);
+    }
+  }
+  __pyx_t_6 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
+  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+  if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 148, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+  __Pyx_GIVEREF(__pyx_t_6);
+  __Pyx_GOTREF(__pyx_v_self->putters);
+  __Pyx_DECREF(__pyx_v_self->putters);
+  __pyx_v_self->putters = __pyx_t_6;
+  __pyx_t_6 = 0;
+
+149:         self.hub = get_hub()
+
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_get_hub); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 149, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_5);
+  __pyx_t_4 = NULL;
+  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
+    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
+    if (likely(__pyx_t_4)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
+      __Pyx_INCREF(__pyx_t_4);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_5, function);
+    }
+  }
+  __pyx_t_6 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
+  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+  if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 149, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+  __Pyx_GIVEREF(__pyx_t_6);
+  __Pyx_GOTREF(__pyx_v_self->hub);
+  __Pyx_DECREF(__pyx_v_self->hub);
+  __pyx_v_self->hub = __pyx_t_6;
+  __pyx_t_6 = 0;
+
+150:         self._event_unlock = None
+
  __Pyx_INCREF(Py_None);
+  __Pyx_GIVEREF(Py_None);
+  __Pyx_GOTREF(__pyx_v_self->_event_unlock);
+  __Pyx_DECREF(__pyx_v_self->_event_unlock);
+  __pyx_v_self->_event_unlock = Py_None;
+
+151:         self.queue = self._create_queue(items)
+
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_create_queue); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 151, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_5);
+  __pyx_t_4 = NULL;
+  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
+    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
+    if (likely(__pyx_t_4)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
+      __Pyx_INCREF(__pyx_t_4);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_5, function);
+    }
+  }
+  __pyx_t_6 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_4, __pyx_v_items) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_items);
+  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+  if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 151, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+  __Pyx_GIVEREF(__pyx_t_6);
+  __Pyx_GOTREF(__pyx_v_self->queue);
+  __Pyx_DECREF(__pyx_v_self->queue);
+  __pyx_v_self->queue = __pyx_t_6;
+  __pyx_t_6 = 0;
+
 152: 
+
 153:     @property
+
+154:     def maxsize(self):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_queue_5Queue_7maxsize_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_6_queue_5Queue_7maxsize_1__get__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_6_queue_5Queue_7maxsize___get__(((struct __pyx_obj_6gevent_6_queue_Queue *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_queue_5Queue_7maxsize___get__(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_AddTraceback("gevent._queue.Queue.maxsize.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+155:         return self._maxsize if self._maxsize > 0 else None
+
  __Pyx_XDECREF(__pyx_r);
+  if (((__pyx_v_self->_maxsize > 0) != 0)) {
+    __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->_maxsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 155, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_1 = __pyx_t_2;
+    __pyx_t_2 = 0;
+  } else {
+    __Pyx_INCREF(Py_None);
+    __pyx_t_1 = Py_None;
+  }
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
 156: 
+
 157:     @maxsize.setter
+
+158:     def maxsize(self, nv):
+
/* Python wrapper */
+static int __pyx_pw_6gevent_6_queue_5Queue_7maxsize_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_nv); /*proto*/
+static int __pyx_pw_6gevent_6_queue_5Queue_7maxsize_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_nv) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_6_queue_5Queue_7maxsize_2__set__(((struct __pyx_obj_6gevent_6_queue_Queue *)__pyx_v_self), ((PyObject *)__pyx_v_nv));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_6_queue_5Queue_7maxsize_2__set__(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self, PyObject *__pyx_v_nv) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__set__", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = 0;
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_AddTraceback("gevent._queue.Queue.maxsize.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = -1;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
 159:         # QQQ make maxsize into a property with setter that schedules unlock if necessary
+
+160:         if nv is None or nv <= 0:
+
  __pyx_t_2 = (__pyx_v_nv == Py_None);
+  __pyx_t_3 = (__pyx_t_2 != 0);
+  if (!__pyx_t_3) {
+  } else {
+    __pyx_t_1 = __pyx_t_3;
+    goto __pyx_L4_bool_binop_done;
+  }
+  __pyx_t_4 = PyObject_RichCompare(__pyx_v_nv, __pyx_int_0, Py_LE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 160, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 160, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __pyx_t_1 = __pyx_t_3;
+  __pyx_L4_bool_binop_done:;
+  if (__pyx_t_1) {
+/* … */
+    goto __pyx_L3;
+  }
+
+161:             self._maxsize = -1
+
    __pyx_v_self->_maxsize = -1L;
+
 162:         else:
+
+163:             self._maxsize = nv
+
  /*else*/ {
+    __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_v_nv); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 163, __pyx_L1_error)
+    __pyx_v_self->_maxsize = __pyx_t_5;
+  }
+  __pyx_L3:;
+
 164: 
+
+165:     def copy(self):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_queue_5Queue_3copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6gevent_6_queue_5Queue_2copy[] = "Queue.copy(self)";
+static PyMethodDef __pyx_mdef_6gevent_6_queue_5Queue_3copy = {"copy", (PyCFunction)__pyx_pw_6gevent_6_queue_5Queue_3copy, METH_NOARGS, __pyx_doc_6gevent_6_queue_5Queue_2copy};
+static PyObject *__pyx_pw_6gevent_6_queue_5Queue_3copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("copy (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_6_queue_5Queue_2copy(((struct __pyx_obj_6gevent_6_queue_Queue *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_queue_5Queue_2copy(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("copy", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_6);
+  __Pyx_AddTraceback("gevent._queue.Queue.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__11 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 165, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__11);
+  __Pyx_GIVEREF(__pyx_tuple__11);
+/* … */
+  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_queue_5Queue_3copy, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Queue_copy, NULL, __pyx_n_s_gevent__queue, __pyx_d, ((PyObject *)__pyx_codeobj__12)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 165, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_Queue->tp_dict, __pyx_n_s_copy, __pyx_t_6) < 0) __PYX_ERR(0, 165, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_6_queue_Queue);
+  __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__11, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_queue_py, __pyx_n_s_copy, 165, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(0, 165, __pyx_L1_error)
+
+166:         return type(self)(self.maxsize, self.queue)
+
  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_maxsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 166, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
+  __pyx_t_3 = ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))); __pyx_t_4 = NULL;
+  __pyx_t_5 = 0;
+  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+    if (likely(__pyx_t_4)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+      __Pyx_INCREF(__pyx_t_4);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_3, function);
+      __pyx_t_5 = 1;
+    }
+  }
+  #if CYTHON_FAST_PYCALL
+  if (PyFunction_Check(__pyx_t_3)) {
+    PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_2, __pyx_v_self->queue};
+    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 166, __pyx_L1_error)
+    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  } else
+  #endif
+  #if CYTHON_FAST_PYCCALL
+  if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
+    PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_2, __pyx_v_self->queue};
+    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 166, __pyx_L1_error)
+    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  } else
+  #endif
+  {
+    __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 166, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_6);
+    if (__pyx_t_4) {
+      __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
+    }
+    __Pyx_GIVEREF(__pyx_t_2);
+    PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_t_2);
+    __Pyx_INCREF(__pyx_v_self->queue);
+    __Pyx_GIVEREF(__pyx_v_self->queue);
+    PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_self->queue);
+    __pyx_t_2 = 0;
+    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 166, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  }
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
 167: 
+
+168:     def _create_queue(self, items=()):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_queue_5Queue_5_create_queue(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_6gevent_6_queue_5Queue_4_create_queue[] = "Queue._create_queue(self, items=())";
+static PyMethodDef __pyx_mdef_6gevent_6_queue_5Queue_5_create_queue = {"_create_queue", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_6_queue_5Queue_5_create_queue, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_6_queue_5Queue_4_create_queue};
+static PyObject *__pyx_pw_6gevent_6_queue_5Queue_5_create_queue(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_items = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_create_queue (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_items,0};
+    PyObject* values[1] = {0};
+    values[0] = ((PyObject *)__pyx_empty_tuple);
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_items);
+          if (value) { values[0] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_create_queue") < 0)) __PYX_ERR(0, 168, __pyx_L3_error)
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    __pyx_v_items = values[0];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("_create_queue", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 168, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent._queue.Queue._create_queue", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_6_queue_5Queue_4_create_queue(((struct __pyx_obj_6gevent_6_queue_Queue *)__pyx_v_self), __pyx_v_items);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_queue_5Queue_4_create_queue(CYTHON_UNUSED struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self, PyObject *__pyx_v_items) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_create_queue", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_AddTraceback("gevent._queue.Queue._create_queue", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__13 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_items); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 168, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__13);
+  __Pyx_GIVEREF(__pyx_tuple__13);
+/* … */
+  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_queue_5Queue_5_create_queue, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Queue__create_queue, NULL, __pyx_n_s_gevent__queue, __pyx_d, ((PyObject *)__pyx_codeobj__14)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 168, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_Queue->tp_dict, __pyx_n_s_create_queue, __pyx_t_6) < 0) __PYX_ERR(0, 168, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_6_queue_Queue);
+  __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__13, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_queue_py, __pyx_n_s_create_queue, 168, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__14)) __PYX_ERR(0, 168, __pyx_L1_error)
+
+169:         return collections.deque(items)
+
  __Pyx_XDECREF(__pyx_r);
+  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_collections); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 169, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_deque); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 169, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_2 = NULL;
+  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
+    if (likely(__pyx_t_2)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+      __Pyx_INCREF(__pyx_t_2);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_3, function);
+    }
+  }
+  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_v_items) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_items);
+  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 169, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
 170: 
+
+171:     def _get(self):
+
static PyObject *__pyx_pw_6gevent_6_queue_5Queue_7_get(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyObject *__pyx_f_6gevent_6_queue_5Queue__get(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self, int __pyx_skip_dispatch) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_get", 0);
+  /* Check if called by wrapper */
+  if (unlikely(__pyx_skip_dispatch)) ;
+  /* Check if overridden in Python */
+  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
+    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
+    if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
+    else {
+      PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      #endif
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 171, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_6_queue_5Queue_7_get)) {
+        __Pyx_XDECREF(__pyx_r);
+        __Pyx_INCREF(__pyx_t_1);
+        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+          if (likely(__pyx_t_4)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+            __Pyx_INCREF(__pyx_t_4);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_3, function);
+          }
+        }
+        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
+        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 171, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __pyx_r = __pyx_t_2;
+        __pyx_t_2 = 0;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        goto __pyx_L0;
+      }
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+      tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
+      if (unlikely(type_dict_guard != tp_dict_version)) {
+        tp_dict_version = obj_dict_version = 0;
+      }
+      #endif
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    }
+    #endif
+  }
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_AddTraceback("gevent._queue.Queue._get", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_queue_5Queue_7_get(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6gevent_6_queue_5Queue_6_get[] = "Queue._get(self)";
+static PyMethodDef __pyx_mdef_6gevent_6_queue_5Queue_7_get = {"_get", (PyCFunction)__pyx_pw_6gevent_6_queue_5Queue_7_get, METH_NOARGS, __pyx_doc_6gevent_6_queue_5Queue_6_get};
+static PyObject *__pyx_pw_6gevent_6_queue_5Queue_7_get(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_get (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_6_queue_5Queue_6_get(((struct __pyx_obj_6gevent_6_queue_Queue *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_queue_5Queue_6_get(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_get", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __pyx_f_6gevent_6_queue_5Queue__get(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 171, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent._queue.Queue._get", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__15 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(0, 171, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__15);
+  __Pyx_GIVEREF(__pyx_tuple__15);
+/* … */
+  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_queue_5Queue_7_get, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Queue__get, NULL, __pyx_n_s_gevent__queue, __pyx_d, ((PyObject *)__pyx_codeobj__16)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 171, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_Queue->tp_dict, __pyx_n_s_get, __pyx_t_6) < 0) __PYX_ERR(0, 171, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_6_queue_Queue);
+  __pyx_codeobj__16 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__15, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_queue_py, __pyx_n_s_get, 171, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__16)) __PYX_ERR(0, 171, __pyx_L1_error)
+
+172:         return self.queue.popleft()
+
  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->queue, __pyx_n_s_popleft); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 172, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = NULL;
+  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+    if (likely(__pyx_t_3)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+      __Pyx_INCREF(__pyx_t_3);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_2, function);
+    }
+  }
+  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 172, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
 173: 
+
+174:     def _peek(self):
+
static PyObject *__pyx_pw_6gevent_6_queue_5Queue_9_peek(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyObject *__pyx_f_6gevent_6_queue_5Queue__peek(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self, int __pyx_skip_dispatch) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_peek", 0);
+  /* Check if called by wrapper */
+  if (unlikely(__pyx_skip_dispatch)) ;
+  /* Check if overridden in Python */
+  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
+    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
+    if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
+    else {
+      PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      #endif
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_peek); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 174, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_6_queue_5Queue_9_peek)) {
+        __Pyx_XDECREF(__pyx_r);
+        __Pyx_INCREF(__pyx_t_1);
+        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+          if (likely(__pyx_t_4)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+            __Pyx_INCREF(__pyx_t_4);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_3, function);
+          }
+        }
+        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
+        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 174, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __pyx_r = __pyx_t_2;
+        __pyx_t_2 = 0;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        goto __pyx_L0;
+      }
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+      tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
+      if (unlikely(type_dict_guard != tp_dict_version)) {
+        tp_dict_version = obj_dict_version = 0;
+      }
+      #endif
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    }
+    #endif
+  }
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_AddTraceback("gevent._queue.Queue._peek", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_queue_5Queue_9_peek(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6gevent_6_queue_5Queue_8_peek[] = "Queue._peek(self)";
+static PyMethodDef __pyx_mdef_6gevent_6_queue_5Queue_9_peek = {"_peek", (PyCFunction)__pyx_pw_6gevent_6_queue_5Queue_9_peek, METH_NOARGS, __pyx_doc_6gevent_6_queue_5Queue_8_peek};
+static PyObject *__pyx_pw_6gevent_6_queue_5Queue_9_peek(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_peek (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_6_queue_5Queue_8_peek(((struct __pyx_obj_6gevent_6_queue_Queue *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_queue_5Queue_8_peek(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_peek", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __pyx_f_6gevent_6_queue_5Queue__peek(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 174, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent._queue.Queue._peek", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__17 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(0, 174, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__17);
+  __Pyx_GIVEREF(__pyx_tuple__17);
+/* … */
+  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_queue_5Queue_9_peek, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Queue__peek, NULL, __pyx_n_s_gevent__queue, __pyx_d, ((PyObject *)__pyx_codeobj__18)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 174, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_Queue->tp_dict, __pyx_n_s_peek, __pyx_t_6) < 0) __PYX_ERR(0, 174, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_6_queue_Queue);
+  __pyx_codeobj__18 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__17, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_queue_py, __pyx_n_s_peek, 174, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__18)) __PYX_ERR(0, 174, __pyx_L1_error)
+
+175:         return self.queue[0]
+
  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_self->queue, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 175, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
 176: 
+
+177:     def _put(self, item):
+
static PyObject *__pyx_pw_6gevent_6_queue_5Queue_11_put(PyObject *__pyx_v_self, PyObject *__pyx_v_item); /*proto*/
+static PyObject *__pyx_f_6gevent_6_queue_5Queue__put(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self, PyObject *__pyx_v_item, int __pyx_skip_dispatch) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_put", 0);
+  /* Check if called by wrapper */
+  if (unlikely(__pyx_skip_dispatch)) ;
+  /* Check if overridden in Python */
+  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
+    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
+    if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
+    else {
+      PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      #endif
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_put); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 177, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_6_queue_5Queue_11_put)) {
+        __Pyx_XDECREF(__pyx_r);
+        __Pyx_INCREF(__pyx_t_1);
+        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+          if (likely(__pyx_t_4)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+            __Pyx_INCREF(__pyx_t_4);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_3, function);
+          }
+        }
+        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_item) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_item);
+        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 177, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __pyx_r = __pyx_t_2;
+        __pyx_t_2 = 0;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        goto __pyx_L0;
+      }
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+      tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
+      if (unlikely(type_dict_guard != tp_dict_version)) {
+        tp_dict_version = obj_dict_version = 0;
+      }
+      #endif
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    }
+    #endif
+  }
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_AddTraceback("gevent._queue.Queue._put", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_queue_5Queue_11_put(PyObject *__pyx_v_self, PyObject *__pyx_v_item); /*proto*/
+static char __pyx_doc_6gevent_6_queue_5Queue_10_put[] = "Queue._put(self, item)";
+static PyMethodDef __pyx_mdef_6gevent_6_queue_5Queue_11_put = {"_put", (PyCFunction)__pyx_pw_6gevent_6_queue_5Queue_11_put, METH_O, __pyx_doc_6gevent_6_queue_5Queue_10_put};
+static PyObject *__pyx_pw_6gevent_6_queue_5Queue_11_put(PyObject *__pyx_v_self, PyObject *__pyx_v_item) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_put (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_6_queue_5Queue_10_put(((struct __pyx_obj_6gevent_6_queue_Queue *)__pyx_v_self), ((PyObject *)__pyx_v_item));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_queue_5Queue_10_put(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self, PyObject *__pyx_v_item) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_put", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __pyx_f_6gevent_6_queue_5Queue__put(__pyx_v_self, __pyx_v_item, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 177, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent._queue.Queue._put", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__19 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_item); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(0, 177, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__19);
+  __Pyx_GIVEREF(__pyx_tuple__19);
+/* … */
+  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_queue_5Queue_11_put, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Queue__put, NULL, __pyx_n_s_gevent__queue, __pyx_d, ((PyObject *)__pyx_codeobj__20)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 177, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_Queue->tp_dict, __pyx_n_s_put, __pyx_t_6) < 0) __PYX_ERR(0, 177, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_6_queue_Queue);
+  __pyx_codeobj__20 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__19, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_queue_py, __pyx_n_s_put, 177, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__20)) __PYX_ERR(0, 177, __pyx_L1_error)
+
+178:         self.queue.append(item)
+
  __pyx_t_5 = __Pyx_PyObject_Append(__pyx_v_self->queue, __pyx_v_item); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 178, __pyx_L1_error)
+
 179: 
+
+180:     def __repr__(self):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_queue_5Queue_13__repr__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_6_queue_5Queue_13__repr__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_6_queue_5Queue_12__repr__(((struct __pyx_obj_6gevent_6_queue_Queue *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_queue_5Queue_12__repr__(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__repr__", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_AddTraceback("gevent._queue.Queue.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+181:         return '<%s at %s%s>' % (type(self).__name__, hex(id(self)), self._format())
+
  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))), __pyx_n_s_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 181, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 181, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_hex, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 181, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 181, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_4);
+  __pyx_t_5 = NULL;
+  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
+    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
+    if (likely(__pyx_t_5)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
+      __Pyx_INCREF(__pyx_t_5);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_4, function);
+    }
+  }
+  __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 181, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 181, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_4);
+  __Pyx_GIVEREF(__pyx_t_1);
+  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_3);
+  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
+  __Pyx_GIVEREF(__pyx_t_2);
+  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_2);
+  __pyx_t_1 = 0;
+  __pyx_t_3 = 0;
+  __pyx_t_2 = 0;
+  __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_s_at_s_s, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 181, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __pyx_r = __pyx_t_2;
+  __pyx_t_2 = 0;
+  goto __pyx_L0;
+
 182: 
+
+183:     def __str__(self):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_queue_5Queue_15__str__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_6_queue_5Queue_15__str__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_6_queue_5Queue_14__str__(((struct __pyx_obj_6gevent_6_queue_Queue *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_queue_5Queue_14__str__(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__str__", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_AddTraceback("gevent._queue.Queue.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+184:         return '<%s%s>' % (type(self).__name__, self._format())
+
  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))), __pyx_n_s_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 184, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 184, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __pyx_t_4 = NULL;
+  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
+    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+    if (likely(__pyx_t_4)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+      __Pyx_INCREF(__pyx_t_4);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_3, function);
+    }
+  }
+  __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 184, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 184, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_GIVEREF(__pyx_t_1);
+  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_2);
+  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
+  __pyx_t_1 = 0;
+  __pyx_t_2 = 0;
+  __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_s_s, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 184, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __pyx_r = __pyx_t_2;
+  __pyx_t_2 = 0;
+  goto __pyx_L0;
+
 185: 
+
+186:     def _format(self):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_queue_5Queue_17_format(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6gevent_6_queue_5Queue_16_format[] = "Queue._format(self)";
+static PyMethodDef __pyx_mdef_6gevent_6_queue_5Queue_17_format = {"_format", (PyCFunction)__pyx_pw_6gevent_6_queue_5Queue_17_format, METH_NOARGS, __pyx_doc_6gevent_6_queue_5Queue_16_format};
+static PyObject *__pyx_pw_6gevent_6_queue_5Queue_17_format(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_format (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_6_queue_5Queue_16_format(((struct __pyx_obj_6gevent_6_queue_Queue *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_queue_5Queue_16_format(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self) {
+  PyObject *__pyx_v_result = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_format", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_AddTraceback("gevent._queue.Queue._format", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_result);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__21 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_result); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(0, 186, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__21);
+  __Pyx_GIVEREF(__pyx_tuple__21);
+/* … */
+  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_queue_5Queue_17_format, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Queue__format, NULL, __pyx_n_s_gevent__queue, __pyx_d, ((PyObject *)__pyx_codeobj__22)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 186, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_Queue->tp_dict, __pyx_n_s_format, __pyx_t_6) < 0) __PYX_ERR(0, 186, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_6_queue_Queue);
+  __pyx_codeobj__22 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__21, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_queue_py, __pyx_n_s_format, 186, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__22)) __PYX_ERR(0, 186, __pyx_L1_error)
+
+187:         result = []
+
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 187, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_v_result = ((PyObject*)__pyx_t_1);
+  __pyx_t_1 = 0;
+
+188:         if self.maxsize is not None:
+
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_maxsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 188, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = (__pyx_t_1 != Py_None);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_3 = (__pyx_t_2 != 0);
+  if (__pyx_t_3) {
+/* … */
+  }
+
+189:             result.append('maxsize=%r' % (self.maxsize, ))
+
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_maxsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 189, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 189, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_GIVEREF(__pyx_t_1);
+    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
+    __pyx_t_1 = 0;
+    __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_maxsize_r, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 189, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __pyx_t_5 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_1); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 189, __pyx_L1_error)
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+190:         if getattr(self, 'queue', None):
+
  __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_queue, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 190, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 190, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  if (__pyx_t_3) {
+/* … */
+  }
+
+191:             result.append('queue=%r' % (self.queue, ))
+
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 191, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_INCREF(__pyx_v_self->queue);
+    __Pyx_GIVEREF(__pyx_v_self->queue);
+    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->queue);
+    __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_queue_r, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 191, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __pyx_t_5 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_4); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 191, __pyx_L1_error)
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+
+192:         if self.getters:
+
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_self->getters); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 192, __pyx_L1_error)
+  if (__pyx_t_3) {
+/* … */
+  }
+
+193:             result.append('getters[%s]' % len(self.getters))
+
    __pyx_t_4 = __pyx_v_self->getters;
+    __Pyx_INCREF(__pyx_t_4);
+    __pyx_t_6 = PyObject_Length(__pyx_t_4); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 193, __pyx_L1_error)
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __pyx_t_4 = PyInt_FromSsize_t(__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 193, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_getters_s, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 193, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __pyx_t_5 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_1); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 193, __pyx_L1_error)
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+194:         if self.putters:
+
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_self->putters); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 194, __pyx_L1_error)
+  if (__pyx_t_3) {
+/* … */
+  }
+
+195:             result.append('putters[%s]' % len(self.putters))
+
    __pyx_t_1 = __pyx_v_self->putters;
+    __Pyx_INCREF(__pyx_t_1);
+    __pyx_t_6 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 195, __pyx_L1_error)
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 195, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_putters_s, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 195, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __pyx_t_5 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_4); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 195, __pyx_L1_error)
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+
+196:         if result:
+
  __pyx_t_3 = (PyList_GET_SIZE(__pyx_v_result) != 0);
+  if (__pyx_t_3) {
+/* … */
+  }
+
+197:             return ' ' + ' '.join(result)
+
    __Pyx_XDECREF(__pyx_r);
+    __pyx_t_4 = __Pyx_PyString_Join(__pyx_kp_s__2, __pyx_v_result); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 197, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    __pyx_t_1 = PyNumber_Add(__pyx_kp_s__2, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 197, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __pyx_r = __pyx_t_1;
+    __pyx_t_1 = 0;
+    goto __pyx_L0;
+
+198:         return ''
+
  __Pyx_XDECREF(__pyx_r);
+  __Pyx_INCREF(__pyx_kp_s__3);
+  __pyx_r = __pyx_kp_s__3;
+  goto __pyx_L0;
+
 199: 
+
+200:     def qsize(self):
+
static PyObject *__pyx_pw_6gevent_6_queue_5Queue_19qsize(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static Py_ssize_t __pyx_f_6gevent_6_queue_5Queue_qsize(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self, int __pyx_skip_dispatch) {
+  Py_ssize_t __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("qsize", 0);
+  /* Check if called by wrapper */
+  if (unlikely(__pyx_skip_dispatch)) ;
+  /* Check if overridden in Python */
+  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
+    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
+    if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
+    else {
+      PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      #endif
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_qsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 200, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_6_queue_5Queue_19qsize)) {
+        __Pyx_INCREF(__pyx_t_1);
+        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+          if (likely(__pyx_t_4)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+            __Pyx_INCREF(__pyx_t_4);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_3, function);
+          }
+        }
+        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
+        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 200, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 200, __pyx_L1_error)
+        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+        __pyx_r = __pyx_t_5;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        goto __pyx_L0;
+      }
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+      tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
+      if (unlikely(type_dict_guard != tp_dict_version)) {
+        tp_dict_version = obj_dict_version = 0;
+      }
+      #endif
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    }
+    #endif
+  }
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_WriteUnraisable("gevent._queue.Queue.qsize", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_queue_5Queue_19qsize(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6gevent_6_queue_5Queue_18qsize[] = "Queue.qsize(self) -> Py_ssize_t\nReturn the size of the queue.";
+static PyMethodDef __pyx_mdef_6gevent_6_queue_5Queue_19qsize = {"qsize", (PyCFunction)__pyx_pw_6gevent_6_queue_5Queue_19qsize, METH_NOARGS, __pyx_doc_6gevent_6_queue_5Queue_18qsize};
+static PyObject *__pyx_pw_6gevent_6_queue_5Queue_19qsize(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("qsize (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_6_queue_5Queue_18qsize(((struct __pyx_obj_6gevent_6_queue_Queue *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_queue_5Queue_18qsize(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("qsize", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = PyInt_FromSsize_t(__pyx_f_6gevent_6_queue_5Queue_qsize(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 200, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent._queue.Queue.qsize", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__23 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(0, 200, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__23);
+  __Pyx_GIVEREF(__pyx_tuple__23);
+/* … */
+  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_queue_5Queue_19qsize, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Queue_qsize, NULL, __pyx_n_s_gevent__queue, __pyx_d, ((PyObject *)__pyx_codeobj__24)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 200, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_Queue->tp_dict, __pyx_n_s_qsize, __pyx_t_6) < 0) __PYX_ERR(0, 200, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_6_queue_Queue);
+  __pyx_codeobj__24 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__23, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_queue_py, __pyx_n_s_qsize, 200, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__24)) __PYX_ERR(0, 200, __pyx_L1_error)
+
 201:         """Return the size of the queue."""
+
+202:         return len(self.queue)
+
  __pyx_t_1 = __pyx_v_self->queue;
+  __Pyx_INCREF(__pyx_t_1);
+  __pyx_t_5 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 202, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_r = __pyx_t_5;
+  goto __pyx_L0;
+
 203: 
+
+204:     def __len__(self):
+
/* Python wrapper */
+static Py_ssize_t __pyx_pw_6gevent_6_queue_5Queue_21__len__(PyObject *__pyx_v_self); /*proto*/
+static char __pyx_doc_6gevent_6_queue_5Queue_20__len__[] = "\n        Return the size of the queue. This is the same as :meth:`qsize`.\n\n        .. versionadded: 1.1b3\n\n            Previously, getting len() of a queue would raise a TypeError.\n        ";
+#if CYTHON_COMPILING_IN_CPYTHON
+struct wrapperbase __pyx_wrapperbase_6gevent_6_queue_5Queue_20__len__;
+#endif
+static Py_ssize_t __pyx_pw_6gevent_6_queue_5Queue_21__len__(PyObject *__pyx_v_self) {
+  Py_ssize_t __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_6_queue_5Queue_20__len__(((struct __pyx_obj_6gevent_6_queue_Queue *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static Py_ssize_t __pyx_pf_6gevent_6_queue_5Queue_20__len__(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self) {
+  Py_ssize_t __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__len__", 0);
+/* … */
+  /* function exit code */
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
 205:         """
+
 206:         Return the size of the queue. This is the same as :meth:`qsize`.
+
 207: 
+
 208:         .. versionadded: 1.1b3
+
 209: 
+
 210:             Previously, getting len() of a queue would raise a TypeError.
+
 211:         """
+
 212: 
+
+213:         return self.qsize()
+
  __pyx_r = ((struct __pyx_vtabstruct_6gevent_6_queue_Queue *)__pyx_v_self->__pyx_vtab)->qsize(__pyx_v_self, 0);
+  goto __pyx_L0;
+
 214: 
+
+215:     def __bool__(self):
+
/* Python wrapper */
+static int __pyx_pw_6gevent_6_queue_5Queue_23__bool__(PyObject *__pyx_v_self); /*proto*/
+static int __pyx_pw_6gevent_6_queue_5Queue_23__bool__(PyObject *__pyx_v_self) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__bool__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_6_queue_5Queue_22__bool__(((struct __pyx_obj_6gevent_6_queue_Queue *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_6_queue_5Queue_22__bool__(CYTHON_UNUSED struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__bool__", 0);
+/* … */
+  /* function exit code */
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
 216:         """
+
 217:         A queue object is always True.
+
 218: 
+
 219:         .. versionadded: 1.1b3
+
 220: 
+
 221:            Now that queues support len(), they need to implement ``__bool__``
+
 222:            to return True for backwards compatibility.
+
 223:         """
+
+224:         return True
+
  __pyx_r = 1;
+  goto __pyx_L0;
+
 225: 
+
+226:     def __nonzero__(self):
+
/* Python wrapper */
+static int __pyx_pw_6gevent_6_queue_5Queue_25__nonzero__(PyObject *__pyx_v_self); /*proto*/
+static int __pyx_pw_6gevent_6_queue_5Queue_25__nonzero__(PyObject *__pyx_v_self) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__nonzero__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_6_queue_5Queue_24__nonzero__(((struct __pyx_obj_6gevent_6_queue_Queue *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_6_queue_5Queue_24__nonzero__(CYTHON_UNUSED struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__nonzero__", 0);
+/* … */
+  /* function exit code */
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
 227:         # Py2.
+
 228:         # For Cython; __bool__ becomes a special method that we can't
+
 229:         # get by name.
+
+230:         return True
+
  __pyx_r = 1;
+  goto __pyx_L0;
+
 231: 
+
+232:     def empty(self):
+
static PyObject *__pyx_pw_6gevent_6_queue_5Queue_27empty(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static int __pyx_f_6gevent_6_queue_5Queue_empty(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self, int __pyx_skip_dispatch) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("empty", 0);
+  /* Check if called by wrapper */
+  if (unlikely(__pyx_skip_dispatch)) ;
+  /* Check if overridden in Python */
+  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
+    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
+    if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
+    else {
+      PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      #endif
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_empty); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 232, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_6_queue_5Queue_27empty)) {
+        __Pyx_INCREF(__pyx_t_1);
+        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+          if (likely(__pyx_t_4)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+            __Pyx_INCREF(__pyx_t_4);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_3, function);
+          }
+        }
+        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
+        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 232, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 232, __pyx_L1_error)
+        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+        __pyx_r = __pyx_t_5;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        goto __pyx_L0;
+      }
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+      tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
+      if (unlikely(type_dict_guard != tp_dict_version)) {
+        tp_dict_version = obj_dict_version = 0;
+      }
+      #endif
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    }
+    #endif
+  }
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_WriteUnraisable("gevent._queue.Queue.empty", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_queue_5Queue_27empty(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6gevent_6_queue_5Queue_26empty[] = "Queue.empty(self) -> bool\nReturn ``True`` if the queue is empty, ``False`` otherwise.";
+static PyMethodDef __pyx_mdef_6gevent_6_queue_5Queue_27empty = {"empty", (PyCFunction)__pyx_pw_6gevent_6_queue_5Queue_27empty, METH_NOARGS, __pyx_doc_6gevent_6_queue_5Queue_26empty};
+static PyObject *__pyx_pw_6gevent_6_queue_5Queue_27empty(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("empty (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_6_queue_5Queue_26empty(((struct __pyx_obj_6gevent_6_queue_Queue *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_queue_5Queue_26empty(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("empty", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_f_6gevent_6_queue_5Queue_empty(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 232, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent._queue.Queue.empty", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__25 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(0, 232, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__25);
+  __Pyx_GIVEREF(__pyx_tuple__25);
+/* … */
+  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_queue_5Queue_27empty, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Queue_empty, NULL, __pyx_n_s_gevent__queue, __pyx_d, ((PyObject *)__pyx_codeobj__26)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 232, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_Queue->tp_dict, __pyx_n_s_empty, __pyx_t_6) < 0) __PYX_ERR(0, 232, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_6_queue_Queue);
+  __pyx_codeobj__26 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__25, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_queue_py, __pyx_n_s_empty, 232, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__26)) __PYX_ERR(0, 232, __pyx_L1_error)
+
 233:         """Return ``True`` if the queue is empty, ``False`` otherwise."""
+
+234:         return not self.qsize()
+
  __pyx_r = (!(((struct __pyx_vtabstruct_6gevent_6_queue_Queue *)__pyx_v_self->__pyx_vtab)->qsize(__pyx_v_self, 0) != 0));
+  goto __pyx_L0;
+
 235: 
+
+236:     def full(self):
+
static PyObject *__pyx_pw_6gevent_6_queue_5Queue_29full(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static int __pyx_f_6gevent_6_queue_5Queue_full(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self, int __pyx_skip_dispatch) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("full", 0);
+  /* Check if called by wrapper */
+  if (unlikely(__pyx_skip_dispatch)) ;
+  /* Check if overridden in Python */
+  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
+    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
+    if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
+    else {
+      PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      #endif
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_full); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 236, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_6_queue_5Queue_29full)) {
+        __Pyx_INCREF(__pyx_t_1);
+        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+          if (likely(__pyx_t_4)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+            __Pyx_INCREF(__pyx_t_4);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_3, function);
+          }
+        }
+        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
+        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 236, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 236, __pyx_L1_error)
+        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+        __pyx_r = __pyx_t_5;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        goto __pyx_L0;
+      }
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+      tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
+      if (unlikely(type_dict_guard != tp_dict_version)) {
+        tp_dict_version = obj_dict_version = 0;
+      }
+      #endif
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    }
+    #endif
+  }
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_WriteUnraisable("gevent._queue.Queue.full", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_queue_5Queue_29full(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6gevent_6_queue_5Queue_28full[] = "Queue.full(self) -> bool\nReturn ``True`` if the queue is full, ``False`` otherwise.\n\n        ``Queue(None)`` is never full.\n        ";
+static PyMethodDef __pyx_mdef_6gevent_6_queue_5Queue_29full = {"full", (PyCFunction)__pyx_pw_6gevent_6_queue_5Queue_29full, METH_NOARGS, __pyx_doc_6gevent_6_queue_5Queue_28full};
+static PyObject *__pyx_pw_6gevent_6_queue_5Queue_29full(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("full (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_6_queue_5Queue_28full(((struct __pyx_obj_6gevent_6_queue_Queue *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_queue_5Queue_28full(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("full", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_f_6gevent_6_queue_5Queue_full(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 236, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent._queue.Queue.full", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__27 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(0, 236, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__27);
+  __Pyx_GIVEREF(__pyx_tuple__27);
+/* … */
+  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_queue_5Queue_29full, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Queue_full, NULL, __pyx_n_s_gevent__queue, __pyx_d, ((PyObject *)__pyx_codeobj__28)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 236, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_Queue->tp_dict, __pyx_n_s_full, __pyx_t_6) < 0) __PYX_ERR(0, 236, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_6_queue_Queue);
+  __pyx_codeobj__28 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__27, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_queue_py, __pyx_n_s_full, 236, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__28)) __PYX_ERR(0, 236, __pyx_L1_error)
+
 237:         """Return ``True`` if the queue is full, ``False`` otherwise.
+
 238: 
+
 239:         ``Queue(None)`` is never full.
+
 240:         """
+
+241:         return self._maxsize > 0 and self.qsize() >= self._maxsize
+
  __pyx_t_6 = ((__pyx_v_self->_maxsize > 0) != 0);
+  if (__pyx_t_6) {
+  } else {
+    __pyx_t_5 = __pyx_t_6;
+    goto __pyx_L3_bool_binop_done;
+  }
+  __pyx_t_6 = ((((struct __pyx_vtabstruct_6gevent_6_queue_Queue *)__pyx_v_self->__pyx_vtab)->qsize(__pyx_v_self, 0) >= __pyx_v_self->_maxsize) != 0);
+  __pyx_t_5 = __pyx_t_6;
+  __pyx_L3_bool_binop_done:;
+  __pyx_r = __pyx_t_5;
+  goto __pyx_L0;
+
 242: 
+
+243:     def put(self, item, block=True, timeout=None):
+
static PyObject *__pyx_pw_6gevent_6_queue_5Queue_31put(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_f_6gevent_6_queue_5Queue_put(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self, PyObject *__pyx_v_item, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_6_queue_5Queue_put *__pyx_optional_args) {
+  PyObject *__pyx_v_block = ((PyObject *)Py_True);
+  PyObject *__pyx_v_timeout = ((PyObject *)Py_None);
+  PyObject *__pyx_v_getter = NULL;
+  struct __pyx_obj_6gevent_6_queue_ItemWaiter *__pyx_v_waiter = NULL;
+  PyObject *__pyx_v_result = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("put", 0);
+  if (__pyx_optional_args) {
+    if (__pyx_optional_args->__pyx_n > 0) {
+      __pyx_v_block = __pyx_optional_args->block;
+      if (__pyx_optional_args->__pyx_n > 1) {
+        __pyx_v_timeout = __pyx_optional_args->timeout;
+      }
+    }
+  }
+  __Pyx_INCREF(__pyx_v_timeout);
+  /* Check if called by wrapper */
+  if (unlikely(__pyx_skip_dispatch)) ;
+  /* Check if overridden in Python */
+  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
+    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
+    if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
+    else {
+      PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      #endif
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_put_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 243, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_6_queue_5Queue_31put)) {
+        __Pyx_XDECREF(__pyx_r);
+        __Pyx_INCREF(__pyx_t_1);
+        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
+        __pyx_t_5 = 0;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+          if (likely(__pyx_t_4)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+            __Pyx_INCREF(__pyx_t_4);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_3, function);
+            __pyx_t_5 = 1;
+          }
+        }
+        #if CYTHON_FAST_PYCALL
+        if (PyFunction_Check(__pyx_t_3)) {
+          PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_item, __pyx_v_block, __pyx_v_timeout};
+          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 243, __pyx_L1_error)
+          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+          __Pyx_GOTREF(__pyx_t_2);
+        } else
+        #endif
+        #if CYTHON_FAST_PYCCALL
+        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
+          PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_item, __pyx_v_block, __pyx_v_timeout};
+          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 243, __pyx_L1_error)
+          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+          __Pyx_GOTREF(__pyx_t_2);
+        } else
+        #endif
+        {
+          __pyx_t_6 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 243, __pyx_L1_error)
+          __Pyx_GOTREF(__pyx_t_6);
+          if (__pyx_t_4) {
+            __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
+          }
+          __Pyx_INCREF(__pyx_v_item);
+          __Pyx_GIVEREF(__pyx_v_item);
+          PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_item);
+          __Pyx_INCREF(__pyx_v_block);
+          __Pyx_GIVEREF(__pyx_v_block);
+          PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_block);
+          __Pyx_INCREF(__pyx_v_timeout);
+          __Pyx_GIVEREF(__pyx_v_timeout);
+          PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_v_timeout);
+          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 243, __pyx_L1_error)
+          __Pyx_GOTREF(__pyx_t_2);
+          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+        }
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __pyx_r = __pyx_t_2;
+        __pyx_t_2 = 0;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        goto __pyx_L0;
+      }
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+      tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
+      if (unlikely(type_dict_guard != tp_dict_version)) {
+        tp_dict_version = obj_dict_version = 0;
+      }
+      #endif
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    }
+    #endif
+  }
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_6);
+  __Pyx_AddTraceback("gevent._queue.Queue.put", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_getter);
+  __Pyx_XDECREF((PyObject *)__pyx_v_waiter);
+  __Pyx_XDECREF(__pyx_v_result);
+  __Pyx_XDECREF(__pyx_v_timeout);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_queue_5Queue_31put(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_6gevent_6_queue_5Queue_30put[] = "Queue.put(self, item, block=True, timeout=None)\nPut an item into the queue.\n\n        If optional arg *block* is true and *timeout* is ``None`` (the default),\n        block if necessary until a free slot is available. If *timeout* is\n        a positive number, it blocks at most *timeout* seconds and raises\n        the :class:`Full` exception if no free slot was available within that time.\n        Otherwise (*block* is false), put an item on the queue if a free slot\n        is immediately available, else raise the :class:`Full` exception (*timeout*\n        is ignored in that case).\n        ";
+static PyMethodDef __pyx_mdef_6gevent_6_queue_5Queue_31put = {"put", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_6_queue_5Queue_31put, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_6_queue_5Queue_30put};
+static PyObject *__pyx_pw_6gevent_6_queue_5Queue_31put(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_item = 0;
+  PyObject *__pyx_v_block = 0;
+  PyObject *__pyx_v_timeout = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("put (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_item,&__pyx_n_s_block,&__pyx_n_s_timeout,0};
+    PyObject* values[3] = {0,0,0};
+    values[1] = ((PyObject *)Py_True);
+    values[2] = ((PyObject *)Py_None);
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_item)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_block);
+          if (value) { values[1] = value; kw_args--; }
+        }
+        CYTHON_FALLTHROUGH;
+        case  2:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_timeout);
+          if (value) { values[2] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "put") < 0)) __PYX_ERR(0, 243, __pyx_L3_error)
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    __pyx_v_item = values[0];
+    __pyx_v_block = values[1];
+    __pyx_v_timeout = values[2];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("put", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 243, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent._queue.Queue.put", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_6_queue_5Queue_30put(((struct __pyx_obj_6gevent_6_queue_Queue *)__pyx_v_self), __pyx_v_item, __pyx_v_block, __pyx_v_timeout);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_queue_5Queue_30put(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_block, PyObject *__pyx_v_timeout) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("put", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_2.__pyx_n = 2;
+  __pyx_t_2.block = __pyx_v_block;
+  __pyx_t_2.timeout = __pyx_v_timeout;
+  __pyx_t_1 = __pyx_vtabptr_6gevent_6_queue_Queue->put(__pyx_v_self, __pyx_v_item, 1, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 243, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent._queue.Queue.put", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__29 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_item, __pyx_n_s_block, __pyx_n_s_timeout); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(0, 243, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__29);
+  __Pyx_GIVEREF(__pyx_tuple__29);
+/* … */
+  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_queue_5Queue_31put, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Queue_put, NULL, __pyx_n_s_gevent__queue, __pyx_d, ((PyObject *)__pyx_codeobj__30)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 243, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_Queue->tp_dict, __pyx_n_s_put_2, __pyx_t_6) < 0) __PYX_ERR(0, 243, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_6_queue_Queue);
+  __pyx_codeobj__30 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__29, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_queue_py, __pyx_n_s_put_2, 243, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__30)) __PYX_ERR(0, 243, __pyx_L1_error)
+
 244:         """Put an item into the queue.
+
 245: 
+
 246:         If optional arg *block* is true and *timeout* is ``None`` (the default),
+
 247:         block if necessary until a free slot is available. If *timeout* is
+
 248:         a positive number, it blocks at most *timeout* seconds and raises
+
 249:         the :class:`Full` exception if no free slot was available within that time.
+
 250:         Otherwise (*block* is false), put an item on the queue if a free slot
+
 251:         is immediately available, else raise the :class:`Full` exception (*timeout*
+
 252:         is ignored in that case).
+
 253:         """
+
+254:         if self._maxsize == -1 or self.qsize() < self._maxsize:
+
  __pyx_t_8 = ((__pyx_v_self->_maxsize == -1L) != 0);
+  if (!__pyx_t_8) {
+  } else {
+    __pyx_t_7 = __pyx_t_8;
+    goto __pyx_L4_bool_binop_done;
+  }
+  __pyx_t_8 = ((((struct __pyx_vtabstruct_6gevent_6_queue_Queue *)__pyx_v_self->__pyx_vtab)->qsize(__pyx_v_self, 0) < __pyx_v_self->_maxsize) != 0);
+  __pyx_t_7 = __pyx_t_8;
+  __pyx_L4_bool_binop_done:;
+  if (__pyx_t_7) {
+/* … */
+    goto __pyx_L3;
+  }
+
 255:             # there's a free slot, put an item right away
+
+256:             self._put(item)
+
    __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_6_queue_Queue *)__pyx_v_self->__pyx_vtab)->_put(__pyx_v_self, __pyx_v_item, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 256, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+257:             if self.getters:
+
    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_self->getters); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 257, __pyx_L1_error)
+    if (__pyx_t_7) {
+/* … */
+    }
+
+258:                 self._schedule_unlock()
+
      __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_6_queue_Queue *)__pyx_v_self->__pyx_vtab)->_schedule_unlock(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 258, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+259:         elif self.hub is getcurrent():
+
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_getcurrent); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 259, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = NULL;
+  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
+    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+    if (likely(__pyx_t_3)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+      __Pyx_INCREF(__pyx_t_3);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_2, function);
+    }
+  }
+  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 259, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_7 = (__pyx_v_self->hub == __pyx_t_1);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_8 = (__pyx_t_7 != 0);
+  if (__pyx_t_8) {
+/* … */
+  }
+
 260:             # We're in the mainloop, so we cannot wait; we can switch to other greenlets though.
+
 261:             # Check if possible to get a free slot in the queue.
+
+262:             while self.getters and self.qsize() and self.qsize() >= self._maxsize:
+
    while (1) {
+      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_self->getters); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 262, __pyx_L1_error)
+      if (__pyx_t_7) {
+      } else {
+        __pyx_t_8 = __pyx_t_7;
+        goto __pyx_L9_bool_binop_done;
+      }
+      __pyx_t_7 = (((struct __pyx_vtabstruct_6gevent_6_queue_Queue *)__pyx_v_self->__pyx_vtab)->qsize(__pyx_v_self, 0) != 0);
+      if (__pyx_t_7) {
+      } else {
+        __pyx_t_8 = __pyx_t_7;
+        goto __pyx_L9_bool_binop_done;
+      }
+      __pyx_t_7 = ((((struct __pyx_vtabstruct_6gevent_6_queue_Queue *)__pyx_v_self->__pyx_vtab)->qsize(__pyx_v_self, 0) >= __pyx_v_self->_maxsize) != 0);
+      __pyx_t_8 = __pyx_t_7;
+      __pyx_L9_bool_binop_done:;
+      if (!__pyx_t_8) break;
+
+263:                 getter = self.getters.popleft()
+
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->getters, __pyx_n_s_popleft); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 263, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_2);
+      __pyx_t_3 = NULL;
+      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+        if (likely(__pyx_t_3)) {
+          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+          __Pyx_INCREF(__pyx_t_3);
+          __Pyx_INCREF(function);
+          __Pyx_DECREF_SET(__pyx_t_2, function);
+        }
+      }
+      __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
+      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 263, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+      __Pyx_XDECREF_SET(__pyx_v_getter, __pyx_t_1);
+      __pyx_t_1 = 0;
+
+264:                 getter.switch(getter)
+
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_getter, __pyx_n_s_switch); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 264, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_2);
+      __pyx_t_3 = NULL;
+      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+        if (likely(__pyx_t_3)) {
+          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+          __Pyx_INCREF(__pyx_t_3);
+          __Pyx_INCREF(function);
+          __Pyx_DECREF_SET(__pyx_t_2, function);
+        }
+      }
+      __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_getter) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_getter);
+      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 264, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    }
+
+265:             if self.qsize() < self._maxsize:
+
    __pyx_t_8 = ((((struct __pyx_vtabstruct_6gevent_6_queue_Queue *)__pyx_v_self->__pyx_vtab)->qsize(__pyx_v_self, 0) < __pyx_v_self->_maxsize) != 0);
+    if (__pyx_t_8) {
+/* … */
+    }
+
+266:                 self._put(item)
+
      __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_6_queue_Queue *)__pyx_v_self->__pyx_vtab)->_put(__pyx_v_self, __pyx_v_item, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 266, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+267:                 return
+
      __Pyx_XDECREF(__pyx_r);
+      __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+      goto __pyx_L0;
+
+268:             raise Full
+
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Full); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 268, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __PYX_ERR(0, 268, __pyx_L1_error)
+
+269:         elif block:
+
  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_block); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 269, __pyx_L1_error)
+  if (likely(__pyx_t_8)) {
+/* … */
+    goto __pyx_L3;
+  }
+
+270:             waiter = ItemWaiter(item, self)
+
    __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 270, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_INCREF(__pyx_v_item);
+    __Pyx_GIVEREF(__pyx_v_item);
+    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_item);
+    __Pyx_INCREF(((PyObject *)__pyx_v_self));
+    __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
+    PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_self));
+    __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6gevent_6_queue_ItemWaiter), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 270, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __pyx_v_waiter = ((struct __pyx_obj_6gevent_6_queue_ItemWaiter *)__pyx_t_2);
+    __pyx_t_2 = 0;
+
+271:             self.putters.append(waiter)
+
    __pyx_t_9 = __Pyx_PyObject_Append(__pyx_v_self->putters, ((PyObject *)__pyx_v_waiter)); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 271, __pyx_L1_error)
+
+272:             timeout = Timeout._start_new_or_dummy(timeout, Full)
+
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Timeout); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 272, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_start_new_or_dummy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 272, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Full); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 272, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __pyx_t_6 = NULL;
+    __pyx_t_5 = 0;
+    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
+      if (likely(__pyx_t_6)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+        __Pyx_INCREF(__pyx_t_6);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_3, function);
+        __pyx_t_5 = 1;
+      }
+    }
+    #if CYTHON_FAST_PYCALL
+    if (PyFunction_Check(__pyx_t_3)) {
+      PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_timeout, __pyx_t_1};
+      __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 272, __pyx_L1_error)
+      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+      __Pyx_GOTREF(__pyx_t_2);
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    } else
+    #endif
+    #if CYTHON_FAST_PYCCALL
+    if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
+      PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_timeout, __pyx_t_1};
+      __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 272, __pyx_L1_error)
+      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+      __Pyx_GOTREF(__pyx_t_2);
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    } else
+    #endif
+    {
+      __pyx_t_4 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 272, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_4);
+      if (__pyx_t_6) {
+        __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6); __pyx_t_6 = NULL;
+      }
+      __Pyx_INCREF(__pyx_v_timeout);
+      __Pyx_GIVEREF(__pyx_v_timeout);
+      PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_5, __pyx_v_timeout);
+      __Pyx_GIVEREF(__pyx_t_1);
+      PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_5, __pyx_t_1);
+      __pyx_t_1 = 0;
+      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 272, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_2);
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    }
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __Pyx_DECREF_SET(__pyx_v_timeout, __pyx_t_2);
+    __pyx_t_2 = 0;
+
+273:             try:
+
    /*try:*/ {
+
+274:                 if self.getters:
+
      __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_self->getters); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 274, __pyx_L14_error)
+      if (__pyx_t_8) {
+/* … */
+      }
+
+275:                     self._schedule_unlock()
+
        __pyx_t_2 = ((struct __pyx_vtabstruct_6gevent_6_queue_Queue *)__pyx_v_self->__pyx_vtab)->_schedule_unlock(__pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 275, __pyx_L14_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+276:                 result = waiter.get()
+
      __pyx_t_2 = ((struct __pyx_vtabstruct_6gevent_6_queue_ItemWaiter *)__pyx_v_waiter->__pyx_base.__pyx_vtab)->__pyx_base.get(((struct __pyx_obj_6gevent_8__waiter_Waiter *)__pyx_v_waiter), 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 276, __pyx_L14_error)
+      __Pyx_GOTREF(__pyx_t_2);
+      __pyx_v_result = __pyx_t_2;
+      __pyx_t_2 = 0;
+
+277:                 if result is not waiter:
+
      __pyx_t_8 = (__pyx_v_result != ((PyObject *)__pyx_v_waiter));
+      __pyx_t_7 = (__pyx_t_8 != 0);
+      if (unlikely(__pyx_t_7)) {
+/* … */
+      }
+    }
+
+278:                     raise InvalidSwitchError("Invalid switch into Queue.put: %r" % (result, ))
+
        __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_InvalidSwitchError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 278, __pyx_L14_error)
+        __Pyx_GOTREF(__pyx_t_3);
+        __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 278, __pyx_L14_error)
+        __Pyx_GOTREF(__pyx_t_4);
+        __Pyx_INCREF(__pyx_v_result);
+        __Pyx_GIVEREF(__pyx_v_result);
+        PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_result);
+        __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_switch_into_Queue_put_r, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 278, __pyx_L14_error)
+        __Pyx_GOTREF(__pyx_t_1);
+        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+        __pyx_t_4 = NULL;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+          if (likely(__pyx_t_4)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+            __Pyx_INCREF(__pyx_t_4);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_3, function);
+          }
+        }
+        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_t_1) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1);
+        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 278, __pyx_L14_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __Pyx_Raise(__pyx_t_2, 0, 0, 0);
+        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+        __PYX_ERR(0, 278, __pyx_L14_error)
+
 279:             finally:
+
+280:                 timeout.cancel()
+
    /*finally:*/ {
+      /*normal exit:*/{
+        __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_timeout, __pyx_n_s_cancel); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 280, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_3);
+        __pyx_t_1 = NULL;
+        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
+          __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
+          if (likely(__pyx_t_1)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+            __Pyx_INCREF(__pyx_t_1);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_3, function);
+          }
+        }
+        __pyx_t_2 = (__pyx_t_1) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
+        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 280, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+/* … */
+          __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_timeout, __pyx_n_s_cancel); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 280, __pyx_L19_error)
+          __Pyx_GOTREF(__pyx_t_2);
+          __pyx_t_1 = NULL;
+          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+            __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
+            if (likely(__pyx_t_1)) {
+              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+              __Pyx_INCREF(__pyx_t_1);
+              __Pyx_INCREF(function);
+              __Pyx_DECREF_SET(__pyx_t_2, function);
+            }
+          }
+          __pyx_t_3 = (__pyx_t_1) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_1) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
+          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+          if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 280, __pyx_L19_error)
+          __Pyx_GOTREF(__pyx_t_3);
+          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+
+281:                 _safe_remove(self.putters, waiter)
+
        __pyx_t_2 = __pyx_v_self->putters;
+        __Pyx_INCREF(__pyx_t_2);
+        __pyx_t_3 = __pyx_f_6gevent_6_queue__safe_remove(__pyx_t_2, ((PyObject *)__pyx_v_waiter)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 281, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_3);
+        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        goto __pyx_L15;
+      }
+      __pyx_L14_error:;
+      /*exception exit:*/{
+        __Pyx_PyThreadState_declare
+        __Pyx_PyThreadState_assign
+        __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0;
+        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+        if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
+        if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14) < 0)) __Pyx_ErrFetch(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14);
+        __Pyx_XGOTREF(__pyx_t_12);
+        __Pyx_XGOTREF(__pyx_t_13);
+        __Pyx_XGOTREF(__pyx_t_14);
+        __Pyx_XGOTREF(__pyx_t_15);
+        __Pyx_XGOTREF(__pyx_t_16);
+        __Pyx_XGOTREF(__pyx_t_17);
+        __pyx_t_5 = __pyx_lineno; __pyx_t_10 = __pyx_clineno; __pyx_t_11 = __pyx_filename;
+        {
+/* … */
+          __pyx_t_3 = __pyx_v_self->putters;
+          __Pyx_INCREF(__pyx_t_3);
+          __pyx_t_2 = __pyx_f_6gevent_6_queue__safe_remove(__pyx_t_3, ((PyObject *)__pyx_v_waiter)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 281, __pyx_L19_error)
+          __Pyx_GOTREF(__pyx_t_2);
+          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+        }
+        if (PY_MAJOR_VERSION >= 3) {
+          __Pyx_XGIVEREF(__pyx_t_15);
+          __Pyx_XGIVEREF(__pyx_t_16);
+          __Pyx_XGIVEREF(__pyx_t_17);
+          __Pyx_ExceptionReset(__pyx_t_15, __pyx_t_16, __pyx_t_17);
+        }
+        __Pyx_XGIVEREF(__pyx_t_12);
+        __Pyx_XGIVEREF(__pyx_t_13);
+        __Pyx_XGIVEREF(__pyx_t_14);
+        __Pyx_ErrRestore(__pyx_t_12, __pyx_t_13, __pyx_t_14);
+        __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0;
+        __pyx_lineno = __pyx_t_5; __pyx_clineno = __pyx_t_10; __pyx_filename = __pyx_t_11;
+        goto __pyx_L1_error;
+        __pyx_L19_error:;
+        if (PY_MAJOR_VERSION >= 3) {
+          __Pyx_XGIVEREF(__pyx_t_15);
+          __Pyx_XGIVEREF(__pyx_t_16);
+          __Pyx_XGIVEREF(__pyx_t_17);
+          __Pyx_ExceptionReset(__pyx_t_15, __pyx_t_16, __pyx_t_17);
+        }
+        __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
+        __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
+        __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
+        __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0;
+        goto __pyx_L1_error;
+      }
+      __pyx_L15:;
+    }
+
 282:         else:
+
+283:             raise Full
+
  /*else*/ {
+    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Full); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 283, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __PYX_ERR(0, 283, __pyx_L1_error)
+  }
+  __pyx_L3:;
+
 284: 
+
+285:     def put_nowait(self, item):
+
static PyObject *__pyx_pw_6gevent_6_queue_5Queue_33put_nowait(PyObject *__pyx_v_self, PyObject *__pyx_v_item); /*proto*/
+static PyObject *__pyx_f_6gevent_6_queue_5Queue_put_nowait(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self, PyObject *__pyx_v_item, int __pyx_skip_dispatch) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("put_nowait", 0);
+  /* Check if called by wrapper */
+  if (unlikely(__pyx_skip_dispatch)) ;
+  /* Check if overridden in Python */
+  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
+    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
+    if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
+    else {
+      PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      #endif
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_put_nowait); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 285, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_6_queue_5Queue_33put_nowait)) {
+        __Pyx_XDECREF(__pyx_r);
+        __Pyx_INCREF(__pyx_t_1);
+        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+          if (likely(__pyx_t_4)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+            __Pyx_INCREF(__pyx_t_4);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_3, function);
+          }
+        }
+        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_item) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_item);
+        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 285, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __pyx_r = __pyx_t_2;
+        __pyx_t_2 = 0;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        goto __pyx_L0;
+      }
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+      tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
+      if (unlikely(type_dict_guard != tp_dict_version)) {
+        tp_dict_version = obj_dict_version = 0;
+      }
+      #endif
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    }
+    #endif
+  }
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_AddTraceback("gevent._queue.Queue.put_nowait", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_queue_5Queue_33put_nowait(PyObject *__pyx_v_self, PyObject *__pyx_v_item); /*proto*/
+static char __pyx_doc_6gevent_6_queue_5Queue_32put_nowait[] = "Queue.put_nowait(self, item)\nPut an item into the queue without blocking.\n\n        Only enqueue the item if a free slot is immediately available.\n        Otherwise raise the :class:`Full` exception.\n        ";
+static PyMethodDef __pyx_mdef_6gevent_6_queue_5Queue_33put_nowait = {"put_nowait", (PyCFunction)__pyx_pw_6gevent_6_queue_5Queue_33put_nowait, METH_O, __pyx_doc_6gevent_6_queue_5Queue_32put_nowait};
+static PyObject *__pyx_pw_6gevent_6_queue_5Queue_33put_nowait(PyObject *__pyx_v_self, PyObject *__pyx_v_item) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("put_nowait (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_6_queue_5Queue_32put_nowait(((struct __pyx_obj_6gevent_6_queue_Queue *)__pyx_v_self), ((PyObject *)__pyx_v_item));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_queue_5Queue_32put_nowait(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self, PyObject *__pyx_v_item) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("put_nowait", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __pyx_f_6gevent_6_queue_5Queue_put_nowait(__pyx_v_self, __pyx_v_item, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 285, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent._queue.Queue.put_nowait", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__31 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_item); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(0, 285, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__31);
+  __Pyx_GIVEREF(__pyx_tuple__31);
+/* … */
+  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_queue_5Queue_33put_nowait, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Queue_put_nowait, NULL, __pyx_n_s_gevent__queue, __pyx_d, ((PyObject *)__pyx_codeobj__32)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 285, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_Queue->tp_dict, __pyx_n_s_put_nowait, __pyx_t_6) < 0) __PYX_ERR(0, 285, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_6_queue_Queue);
+  __pyx_codeobj__32 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__31, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_queue_py, __pyx_n_s_put_nowait, 285, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__32)) __PYX_ERR(0, 285, __pyx_L1_error)
+
 286:         """Put an item into the queue without blocking.
+
 287: 
+
 288:         Only enqueue the item if a free slot is immediately available.
+
 289:         Otherwise raise the :class:`Full` exception.
+
 290:         """
+
+291:         self.put(item, False)
+
  __pyx_t_5.__pyx_n = 1;
+  __pyx_t_5.block = Py_False;
+  __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_6_queue_Queue *)__pyx_v_self->__pyx_vtab)->put(__pyx_v_self, __pyx_v_item, 0, &__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 291, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 292: 
+
+293:     def __get_or_peek(self, method, block, timeout):
+
static PyObject *__pyx_f_6gevent_6_queue_5Queue___get_or_peek(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self, PyObject *__pyx_v_method, PyObject *__pyx_v_block, PyObject *__pyx_v_timeout) {
+  struct __pyx_obj_6gevent_8__waiter_Waiter *__pyx_v_waiter = NULL;
+  PyObject *__pyx_v_result = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get_or_peek", 0);
+  __Pyx_INCREF(__pyx_v_timeout);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_6);
+  __Pyx_XDECREF(__pyx_t_8);
+  __Pyx_AddTraceback("gevent._queue.Queue.__get_or_peek", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XDECREF((PyObject *)__pyx_v_waiter);
+  __Pyx_XDECREF(__pyx_v_result);
+  __Pyx_XDECREF(__pyx_v_timeout);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
 294:         # Internal helper method. The `method` should be either
+
 295:         # self._get when called from self.get() or self._peek when
+
 296:         # called from self.peek(). Call this after the initial check
+
 297:         # to see if there are items in the queue.
+
 298: 
+
+299:         if self.hub is getcurrent():
+
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_getcurrent); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 299, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = NULL;
+  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
+    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+    if (likely(__pyx_t_3)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+      __Pyx_INCREF(__pyx_t_3);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_2, function);
+    }
+  }
+  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 299, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_4 = (__pyx_v_self->hub == __pyx_t_1);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_5 = (__pyx_t_4 != 0);
+  if (__pyx_t_5) {
+/* … */
+  }
+
 300:             # special case to make get_nowait() or peek_nowait() runnable in the mainloop greenlet
+
 301:             # there are no items in the queue; try to fix the situation by unlocking putters
+
+302:             while self.putters:
+
    while (1) {
+      __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_self->putters); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 302, __pyx_L1_error)
+      if (!__pyx_t_5) break;
+
 303:                 # Note: get() used popleft(), peek used pop(); popleft
+
 304:                 # is almost certainly correct.
+
+305:                 self.putters.popleft().put_and_switch()
+
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->putters, __pyx_n_s_popleft); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 305, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_3);
+      __pyx_t_6 = NULL;
+      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
+        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
+        if (likely(__pyx_t_6)) {
+          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+          __Pyx_INCREF(__pyx_t_6);
+          __Pyx_INCREF(function);
+          __Pyx_DECREF_SET(__pyx_t_3, function);
+        }
+      }
+      __pyx_t_2 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
+      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 305, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_2);
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_put_and_switch); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 305, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_3);
+      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+      __pyx_t_2 = NULL;
+      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
+        __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
+        if (likely(__pyx_t_2)) {
+          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+          __Pyx_INCREF(__pyx_t_2);
+          __Pyx_INCREF(function);
+          __Pyx_DECREF_SET(__pyx_t_3, function);
+        }
+      }
+      __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
+      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 305, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+306:                 if self.qsize():
+
      __pyx_t_5 = (((struct __pyx_vtabstruct_6gevent_6_queue_Queue *)__pyx_v_self->__pyx_vtab)->qsize(__pyx_v_self, 0) != 0);
+      if (__pyx_t_5) {
+/* … */
+      }
+    }
+
+307:                     return method()
+
        __Pyx_XDECREF(__pyx_r);
+        __Pyx_INCREF(__pyx_v_method);
+        __pyx_t_3 = __pyx_v_method; __pyx_t_2 = NULL;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+          __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
+          if (likely(__pyx_t_2)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+            __Pyx_INCREF(__pyx_t_2);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_3, function);
+          }
+        }
+        __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
+        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+        if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 307, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_1);
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __pyx_r = __pyx_t_1;
+        __pyx_t_1 = 0;
+        goto __pyx_L0;
+
+308:             raise Empty()
+
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Empty); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 308, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __pyx_t_2 = NULL;
+    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
+      if (likely(__pyx_t_2)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+        __Pyx_INCREF(__pyx_t_2);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_3, function);
+      }
+    }
+    __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
+    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 308, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __PYX_ERR(0, 308, __pyx_L1_error)
+
 309: 
+
+310:         if not block:
+
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_block); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 310, __pyx_L1_error)
+  __pyx_t_4 = ((!__pyx_t_5) != 0);
+  if (unlikely(__pyx_t_4)) {
+/* … */
+  }
+
 311:             # We can't block, we're not the hub, and we have nothing
+
 312:             # to return. No choice...
+
+313:             raise Empty()
+
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Empty); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 313, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __pyx_t_2 = NULL;
+    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
+      if (likely(__pyx_t_2)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+        __Pyx_INCREF(__pyx_t_2);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_3, function);
+      }
+    }
+    __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
+    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 313, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __PYX_ERR(0, 313, __pyx_L1_error)
+
 314: 
+
+315:         waiter = Waiter() # pylint:disable=undefined-variable
+
  __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_6gevent_8__waiter_Waiter)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 315, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_v_waiter = ((struct __pyx_obj_6gevent_8__waiter_Waiter *)__pyx_t_1);
+  __pyx_t_1 = 0;
+
+316:         timeout = Timeout._start_new_or_dummy(timeout, Empty)
+
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Timeout); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 316, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_start_new_or_dummy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 316, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Empty); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 316, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __pyx_t_6 = NULL;
+  __pyx_t_7 = 0;
+  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
+    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
+    if (likely(__pyx_t_6)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+      __Pyx_INCREF(__pyx_t_6);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_2, function);
+      __pyx_t_7 = 1;
+    }
+  }
+  #if CYTHON_FAST_PYCALL
+  if (PyFunction_Check(__pyx_t_2)) {
+    PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_timeout, __pyx_t_3};
+    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 316, __pyx_L1_error)
+    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  } else
+  #endif
+  #if CYTHON_FAST_PYCCALL
+  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
+    PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_timeout, __pyx_t_3};
+    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 316, __pyx_L1_error)
+    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  } else
+  #endif
+  {
+    __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 316, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_8);
+    if (__pyx_t_6) {
+      __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL;
+    }
+    __Pyx_INCREF(__pyx_v_timeout);
+    __Pyx_GIVEREF(__pyx_v_timeout);
+    PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_v_timeout);
+    __Pyx_GIVEREF(__pyx_t_3);
+    PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_t_3);
+    __pyx_t_3 = 0;
+    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 316, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+  }
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF_SET(__pyx_v_timeout, __pyx_t_1);
+  __pyx_t_1 = 0;
+
+317:         try:
+
  /*try:*/ {
+
+318:             self.getters.append(waiter)
+
    __pyx_t_9 = __Pyx_PyObject_Append(__pyx_v_self->getters, ((PyObject *)__pyx_v_waiter)); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 318, __pyx_L9_error)
+
+319:             if self.putters:
+
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_self->putters); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 319, __pyx_L9_error)
+    if (__pyx_t_4) {
+/* … */
+    }
+
+320:                 self._schedule_unlock()
+
      __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_6_queue_Queue *)__pyx_v_self->__pyx_vtab)->_schedule_unlock(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 320, __pyx_L9_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+321:             result = waiter.get()
+
    __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_8__waiter_Waiter *)__pyx_v_waiter->__pyx_vtab)->get(__pyx_v_waiter, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 321, __pyx_L9_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __pyx_v_result = __pyx_t_1;
+    __pyx_t_1 = 0;
+
+322:             if result is not waiter:
+
    __pyx_t_4 = (__pyx_v_result != ((PyObject *)__pyx_v_waiter));
+    __pyx_t_5 = (__pyx_t_4 != 0);
+    if (unlikely(__pyx_t_5)) {
+/* … */
+    }
+
+323:                 raise InvalidSwitchError('Invalid switch into Queue.get: %r' % (result, ))
+
      __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_InvalidSwitchError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 323, __pyx_L9_error)
+      __Pyx_GOTREF(__pyx_t_2);
+      __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 323, __pyx_L9_error)
+      __Pyx_GOTREF(__pyx_t_8);
+      __Pyx_INCREF(__pyx_v_result);
+      __Pyx_GIVEREF(__pyx_v_result);
+      PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_result);
+      __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_switch_into_Queue_get_r, __pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 323, __pyx_L9_error)
+      __Pyx_GOTREF(__pyx_t_3);
+      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+      __pyx_t_8 = NULL;
+      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
+        __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_2);
+        if (likely(__pyx_t_8)) {
+          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+          __Pyx_INCREF(__pyx_t_8);
+          __Pyx_INCREF(function);
+          __Pyx_DECREF_SET(__pyx_t_2, function);
+        }
+      }
+      __pyx_t_1 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_8, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
+      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 323, __pyx_L9_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+      __Pyx_Raise(__pyx_t_1, 0, 0, 0);
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      __PYX_ERR(0, 323, __pyx_L9_error)
+
+324:             return method()
+
    __Pyx_XDECREF(__pyx_r);
+    __Pyx_INCREF(__pyx_v_method);
+    __pyx_t_2 = __pyx_v_method; __pyx_t_3 = NULL;
+    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
+      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+      if (likely(__pyx_t_3)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+        __Pyx_INCREF(__pyx_t_3);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_2, function);
+      }
+    }
+    __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
+    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 324, __pyx_L9_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __pyx_r = __pyx_t_1;
+    __pyx_t_1 = 0;
+    goto __pyx_L8_return;
+  }
+
 325:         finally:
+
+326:             timeout.cancel()
+
  /*finally:*/ {
+    __pyx_L9_error:;
+    /*exception exit:*/{
+      __Pyx_PyThreadState_declare
+      __Pyx_PyThreadState_assign
+      __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0;
+      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
+      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+      if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
+      if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14) < 0)) __Pyx_ErrFetch(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14);
+      __Pyx_XGOTREF(__pyx_t_12);
+      __Pyx_XGOTREF(__pyx_t_13);
+      __Pyx_XGOTREF(__pyx_t_14);
+      __Pyx_XGOTREF(__pyx_t_15);
+      __Pyx_XGOTREF(__pyx_t_16);
+      __Pyx_XGOTREF(__pyx_t_17);
+      __pyx_t_7 = __pyx_lineno; __pyx_t_10 = __pyx_clineno; __pyx_t_11 = __pyx_filename;
+      {
+        __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_timeout, __pyx_n_s_cancel); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 326, __pyx_L14_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        __pyx_t_3 = NULL;
+        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+          if (likely(__pyx_t_3)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+            __Pyx_INCREF(__pyx_t_3);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_2, function);
+          }
+        }
+        __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
+        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+        if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 326, __pyx_L14_error)
+        __Pyx_GOTREF(__pyx_t_1);
+        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+/* … */
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_timeout, __pyx_n_s_cancel); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 326, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      __pyx_t_3 = NULL;
+      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
+        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
+        if (likely(__pyx_t_3)) {
+          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
+          __Pyx_INCREF(__pyx_t_3);
+          __Pyx_INCREF(function);
+          __Pyx_DECREF_SET(__pyx_t_1, function);
+        }
+      }
+      __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_1);
+      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 326, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_2);
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+327:             _safe_remove(self.getters, waiter)
+
        __pyx_t_1 = __pyx_v_self->getters;
+        __Pyx_INCREF(__pyx_t_1);
+        __pyx_t_2 = __pyx_f_6gevent_6_queue__safe_remove(__pyx_t_1, ((PyObject *)__pyx_v_waiter)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 327, __pyx_L14_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+      }
+      if (PY_MAJOR_VERSION >= 3) {
+        __Pyx_XGIVEREF(__pyx_t_15);
+        __Pyx_XGIVEREF(__pyx_t_16);
+        __Pyx_XGIVEREF(__pyx_t_17);
+        __Pyx_ExceptionReset(__pyx_t_15, __pyx_t_16, __pyx_t_17);
+      }
+      __Pyx_XGIVEREF(__pyx_t_12);
+      __Pyx_XGIVEREF(__pyx_t_13);
+      __Pyx_XGIVEREF(__pyx_t_14);
+      __Pyx_ErrRestore(__pyx_t_12, __pyx_t_13, __pyx_t_14);
+      __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0;
+      __pyx_lineno = __pyx_t_7; __pyx_clineno = __pyx_t_10; __pyx_filename = __pyx_t_11;
+      goto __pyx_L1_error;
+      __pyx_L14_error:;
+      if (PY_MAJOR_VERSION >= 3) {
+        __Pyx_XGIVEREF(__pyx_t_15);
+        __Pyx_XGIVEREF(__pyx_t_16);
+        __Pyx_XGIVEREF(__pyx_t_17);
+        __Pyx_ExceptionReset(__pyx_t_15, __pyx_t_16, __pyx_t_17);
+      }
+      __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
+      __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
+      __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
+      __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0;
+      goto __pyx_L1_error;
+    }
+    __pyx_L8_return: {
+      __pyx_t_17 = __pyx_r;
+      __pyx_r = 0;
+/* … */
+      __pyx_t_2 = __pyx_v_self->getters;
+      __Pyx_INCREF(__pyx_t_2);
+      __pyx_t_1 = __pyx_f_6gevent_6_queue__safe_remove(__pyx_t_2, ((PyObject *)__pyx_v_waiter)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 327, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      __pyx_r = __pyx_t_17;
+      __pyx_t_17 = 0;
+      goto __pyx_L0;
+    }
+  }
+
 328: 
+
+329:     def get(self, block=True, timeout=None):
+
static PyObject *__pyx_pw_6gevent_6_queue_5Queue_35get(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_f_6gevent_6_queue_5Queue_get(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_6_queue_5Queue_get *__pyx_optional_args) {
+  PyObject *__pyx_v_block = ((PyObject *)Py_True);
+  PyObject *__pyx_v_timeout = ((PyObject *)Py_None);
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("get", 0);
+  if (__pyx_optional_args) {
+    if (__pyx_optional_args->__pyx_n > 0) {
+      __pyx_v_block = __pyx_optional_args->block;
+      if (__pyx_optional_args->__pyx_n > 1) {
+        __pyx_v_timeout = __pyx_optional_args->timeout;
+      }
+    }
+  }
+  /* Check if called by wrapper */
+  if (unlikely(__pyx_skip_dispatch)) ;
+  /* Check if overridden in Python */
+  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
+    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
+    if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
+    else {
+      PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      #endif
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 329, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_6_queue_5Queue_35get)) {
+        __Pyx_XDECREF(__pyx_r);
+        __Pyx_INCREF(__pyx_t_1);
+        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
+        __pyx_t_5 = 0;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+          if (likely(__pyx_t_4)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+            __Pyx_INCREF(__pyx_t_4);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_3, function);
+            __pyx_t_5 = 1;
+          }
+        }
+        #if CYTHON_FAST_PYCALL
+        if (PyFunction_Check(__pyx_t_3)) {
+          PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_block, __pyx_v_timeout};
+          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 329, __pyx_L1_error)
+          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+          __Pyx_GOTREF(__pyx_t_2);
+        } else
+        #endif
+        #if CYTHON_FAST_PYCCALL
+        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
+          PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_block, __pyx_v_timeout};
+          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 329, __pyx_L1_error)
+          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+          __Pyx_GOTREF(__pyx_t_2);
+        } else
+        #endif
+        {
+          __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 329, __pyx_L1_error)
+          __Pyx_GOTREF(__pyx_t_6);
+          if (__pyx_t_4) {
+            __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
+          }
+          __Pyx_INCREF(__pyx_v_block);
+          __Pyx_GIVEREF(__pyx_v_block);
+          PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_block);
+          __Pyx_INCREF(__pyx_v_timeout);
+          __Pyx_GIVEREF(__pyx_v_timeout);
+          PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_timeout);
+          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 329, __pyx_L1_error)
+          __Pyx_GOTREF(__pyx_t_2);
+          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+        }
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __pyx_r = __pyx_t_2;
+        __pyx_t_2 = 0;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        goto __pyx_L0;
+      }
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+      tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
+      if (unlikely(type_dict_guard != tp_dict_version)) {
+        tp_dict_version = obj_dict_version = 0;
+      }
+      #endif
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    }
+    #endif
+  }
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_6);
+  __Pyx_AddTraceback("gevent._queue.Queue.get", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_queue_5Queue_35get(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_6gevent_6_queue_5Queue_34get[] = "Queue.get(self, block=True, timeout=None)\nRemove and return an item from the queue.\n\n        If optional args *block* is true and *timeout* is ``None`` (the default),\n        block if necessary until an item is available. If *timeout* is a positive number,\n        it blocks at most *timeout* seconds and raises the :class:`Empty` exception\n        if no item was available within that time. Otherwise (*block* is false), return\n        an item if one is immediately available, else raise the :class:`Empty` exception\n        (*timeout* is ignored in that case).\n        ";
+static PyMethodDef __pyx_mdef_6gevent_6_queue_5Queue_35get = {"get", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_6_queue_5Queue_35get, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_6_queue_5Queue_34get};
+static PyObject *__pyx_pw_6gevent_6_queue_5Queue_35get(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_block = 0;
+  PyObject *__pyx_v_timeout = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("get (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_block,&__pyx_n_s_timeout,0};
+    PyObject* values[2] = {0,0};
+    values[0] = ((PyObject *)Py_True);
+    values[1] = ((PyObject *)Py_None);
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_block);
+          if (value) { values[0] = value; kw_args--; }
+        }
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_timeout);
+          if (value) { values[1] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get") < 0)) __PYX_ERR(0, 329, __pyx_L3_error)
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    __pyx_v_block = values[0];
+    __pyx_v_timeout = values[1];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("get", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 329, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent._queue.Queue.get", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_6_queue_5Queue_34get(((struct __pyx_obj_6gevent_6_queue_Queue *)__pyx_v_self), __pyx_v_block, __pyx_v_timeout);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_queue_5Queue_34get(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self, PyObject *__pyx_v_block, PyObject *__pyx_v_timeout) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("get", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_2.__pyx_n = 2;
+  __pyx_t_2.block = __pyx_v_block;
+  __pyx_t_2.timeout = __pyx_v_timeout;
+  __pyx_t_1 = __pyx_vtabptr_6gevent_6_queue_Queue->get(__pyx_v_self, 1, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 329, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent._queue.Queue.get", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__33 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_block, __pyx_n_s_timeout); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(0, 329, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__33);
+  __Pyx_GIVEREF(__pyx_tuple__33);
+/* … */
+  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_queue_5Queue_35get, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Queue_get, NULL, __pyx_n_s_gevent__queue, __pyx_d, ((PyObject *)__pyx_codeobj__34)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 329, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_Queue->tp_dict, __pyx_n_s_get_2, __pyx_t_6) < 0) __PYX_ERR(0, 329, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_6_queue_Queue);
+  __pyx_codeobj__34 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__33, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_queue_py, __pyx_n_s_get_2, 329, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__34)) __PYX_ERR(0, 329, __pyx_L1_error)
+
 330:         """Remove and return an item from the queue.
+
 331: 
+
 332:         If optional args *block* is true and *timeout* is ``None`` (the default),
+
 333:         block if necessary until an item is available. If *timeout* is a positive number,
+
 334:         it blocks at most *timeout* seconds and raises the :class:`Empty` exception
+
 335:         if no item was available within that time. Otherwise (*block* is false), return
+
 336:         an item if one is immediately available, else raise the :class:`Empty` exception
+
 337:         (*timeout* is ignored in that case).
+
 338:         """
+
+339:         if self.qsize():
+
  __pyx_t_7 = (((struct __pyx_vtabstruct_6gevent_6_queue_Queue *)__pyx_v_self->__pyx_vtab)->qsize(__pyx_v_self, 0) != 0);
+  if (__pyx_t_7) {
+/* … */
+  }
+
+340:             if self.putters:
+
    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_self->putters); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 340, __pyx_L1_error)
+    if (__pyx_t_7) {
+/* … */
+    }
+
+341:                 self._schedule_unlock()
+
      __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_6_queue_Queue *)__pyx_v_self->__pyx_vtab)->_schedule_unlock(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 341, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+342:             return self._get()
+
    __Pyx_XDECREF(__pyx_r);
+    __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_6_queue_Queue *)__pyx_v_self->__pyx_vtab)->_get(__pyx_v_self, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 342, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __pyx_r = __pyx_t_1;
+    __pyx_t_1 = 0;
+    goto __pyx_L0;
+
 343: 
+
+344:         return self.__get_or_peek(self._get, block, timeout)
+
  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 344, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = ((struct __pyx_vtabstruct_6gevent_6_queue_Queue *)__pyx_v_self->__pyx_vtab)->__pyx___get_or_peek(__pyx_v_self, __pyx_t_1, __pyx_v_block, __pyx_v_timeout); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 344, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_r = __pyx_t_2;
+  __pyx_t_2 = 0;
+  goto __pyx_L0;
+
 345: 
+
+346:     def get_nowait(self):
+
static PyObject *__pyx_pw_6gevent_6_queue_5Queue_37get_nowait(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyObject *__pyx_f_6gevent_6_queue_5Queue_get_nowait(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self, int __pyx_skip_dispatch) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("get_nowait", 0);
+  /* Check if called by wrapper */
+  if (unlikely(__pyx_skip_dispatch)) ;
+  /* Check if overridden in Python */
+  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
+    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
+    if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
+    else {
+      PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      #endif
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_nowait); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 346, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_6_queue_5Queue_37get_nowait)) {
+        __Pyx_XDECREF(__pyx_r);
+        __Pyx_INCREF(__pyx_t_1);
+        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+          if (likely(__pyx_t_4)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+            __Pyx_INCREF(__pyx_t_4);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_3, function);
+          }
+        }
+        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
+        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 346, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __pyx_r = __pyx_t_2;
+        __pyx_t_2 = 0;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        goto __pyx_L0;
+      }
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+      tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
+      if (unlikely(type_dict_guard != tp_dict_version)) {
+        tp_dict_version = obj_dict_version = 0;
+      }
+      #endif
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    }
+    #endif
+  }
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_AddTraceback("gevent._queue.Queue.get_nowait", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_queue_5Queue_37get_nowait(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6gevent_6_queue_5Queue_36get_nowait[] = "Queue.get_nowait(self)\nRemove and return an item from the queue without blocking.\n\n        Only get an item if one is immediately available. Otherwise\n        raise the :class:`Empty` exception.\n        ";
+static PyMethodDef __pyx_mdef_6gevent_6_queue_5Queue_37get_nowait = {"get_nowait", (PyCFunction)__pyx_pw_6gevent_6_queue_5Queue_37get_nowait, METH_NOARGS, __pyx_doc_6gevent_6_queue_5Queue_36get_nowait};
+static PyObject *__pyx_pw_6gevent_6_queue_5Queue_37get_nowait(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("get_nowait (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_6_queue_5Queue_36get_nowait(((struct __pyx_obj_6gevent_6_queue_Queue *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_queue_5Queue_36get_nowait(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("get_nowait", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __pyx_f_6gevent_6_queue_5Queue_get_nowait(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 346, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent._queue.Queue.get_nowait", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__35 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(0, 346, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__35);
+  __Pyx_GIVEREF(__pyx_tuple__35);
+/* … */
+  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_queue_5Queue_37get_nowait, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Queue_get_nowait, NULL, __pyx_n_s_gevent__queue, __pyx_d, ((PyObject *)__pyx_codeobj__36)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 346, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_Queue->tp_dict, __pyx_n_s_get_nowait, __pyx_t_6) < 0) __PYX_ERR(0, 346, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_6_queue_Queue);
+  __pyx_codeobj__36 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__35, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_queue_py, __pyx_n_s_get_nowait, 346, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__36)) __PYX_ERR(0, 346, __pyx_L1_error)
+
 347:         """Remove and return an item from the queue without blocking.
+
 348: 
+
 349:         Only get an item if one is immediately available. Otherwise
+
 350:         raise the :class:`Empty` exception.
+
 351:         """
+
+352:         return self.get(False)
+
  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_5.__pyx_n = 1;
+  __pyx_t_5.block = Py_False;
+  __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_6_queue_Queue *)__pyx_v_self->__pyx_vtab)->get(__pyx_v_self, 0, &__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 352, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
 353: 
+
+354:     def peek(self, block=True, timeout=None):
+
static PyObject *__pyx_pw_6gevent_6_queue_5Queue_39peek(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_f_6gevent_6_queue_5Queue_peek(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_6_queue_5Queue_peek *__pyx_optional_args) {
+  PyObject *__pyx_v_block = ((PyObject *)Py_True);
+  PyObject *__pyx_v_timeout = ((PyObject *)Py_None);
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("peek", 0);
+  if (__pyx_optional_args) {
+    if (__pyx_optional_args->__pyx_n > 0) {
+      __pyx_v_block = __pyx_optional_args->block;
+      if (__pyx_optional_args->__pyx_n > 1) {
+        __pyx_v_timeout = __pyx_optional_args->timeout;
+      }
+    }
+  }
+  /* Check if called by wrapper */
+  if (unlikely(__pyx_skip_dispatch)) ;
+  /* Check if overridden in Python */
+  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
+    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
+    if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
+    else {
+      PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      #endif
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_peek_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 354, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_6_queue_5Queue_39peek)) {
+        __Pyx_XDECREF(__pyx_r);
+        __Pyx_INCREF(__pyx_t_1);
+        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
+        __pyx_t_5 = 0;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+          if (likely(__pyx_t_4)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+            __Pyx_INCREF(__pyx_t_4);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_3, function);
+            __pyx_t_5 = 1;
+          }
+        }
+        #if CYTHON_FAST_PYCALL
+        if (PyFunction_Check(__pyx_t_3)) {
+          PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_block, __pyx_v_timeout};
+          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 354, __pyx_L1_error)
+          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+          __Pyx_GOTREF(__pyx_t_2);
+        } else
+        #endif
+        #if CYTHON_FAST_PYCCALL
+        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
+          PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_block, __pyx_v_timeout};
+          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 354, __pyx_L1_error)
+          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+          __Pyx_GOTREF(__pyx_t_2);
+        } else
+        #endif
+        {
+          __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 354, __pyx_L1_error)
+          __Pyx_GOTREF(__pyx_t_6);
+          if (__pyx_t_4) {
+            __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
+          }
+          __Pyx_INCREF(__pyx_v_block);
+          __Pyx_GIVEREF(__pyx_v_block);
+          PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_block);
+          __Pyx_INCREF(__pyx_v_timeout);
+          __Pyx_GIVEREF(__pyx_v_timeout);
+          PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_timeout);
+          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 354, __pyx_L1_error)
+          __Pyx_GOTREF(__pyx_t_2);
+          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+        }
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __pyx_r = __pyx_t_2;
+        __pyx_t_2 = 0;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        goto __pyx_L0;
+      }
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+      tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
+      if (unlikely(type_dict_guard != tp_dict_version)) {
+        tp_dict_version = obj_dict_version = 0;
+      }
+      #endif
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    }
+    #endif
+  }
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_6);
+  __Pyx_AddTraceback("gevent._queue.Queue.peek", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_queue_5Queue_39peek(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_6gevent_6_queue_5Queue_38peek[] = "Queue.peek(self, block=True, timeout=None)\nReturn an item from the queue without removing it.\n\n        If optional args *block* is true and *timeout* is ``None`` (the default),\n        block if necessary until an item is available. If *timeout* is a positive number,\n        it blocks at most *timeout* seconds and raises the :class:`Empty` exception\n        if no item was available within that time. Otherwise (*block* is false), return\n        an item if one is immediately available, else raise the :class:`Empty` exception\n        (*timeout* is ignored in that case).\n        ";
+static PyMethodDef __pyx_mdef_6gevent_6_queue_5Queue_39peek = {"peek", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_6_queue_5Queue_39peek, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_6_queue_5Queue_38peek};
+static PyObject *__pyx_pw_6gevent_6_queue_5Queue_39peek(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_block = 0;
+  PyObject *__pyx_v_timeout = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("peek (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_block,&__pyx_n_s_timeout,0};
+    PyObject* values[2] = {0,0};
+    values[0] = ((PyObject *)Py_True);
+    values[1] = ((PyObject *)Py_None);
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_block);
+          if (value) { values[0] = value; kw_args--; }
+        }
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_timeout);
+          if (value) { values[1] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "peek") < 0)) __PYX_ERR(0, 354, __pyx_L3_error)
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    __pyx_v_block = values[0];
+    __pyx_v_timeout = values[1];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("peek", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 354, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent._queue.Queue.peek", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_6_queue_5Queue_38peek(((struct __pyx_obj_6gevent_6_queue_Queue *)__pyx_v_self), __pyx_v_block, __pyx_v_timeout);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_queue_5Queue_38peek(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self, PyObject *__pyx_v_block, PyObject *__pyx_v_timeout) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("peek", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_2.__pyx_n = 2;
+  __pyx_t_2.block = __pyx_v_block;
+  __pyx_t_2.timeout = __pyx_v_timeout;
+  __pyx_t_1 = __pyx_vtabptr_6gevent_6_queue_Queue->peek(__pyx_v_self, 1, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 354, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent._queue.Queue.peek", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__37 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_block, __pyx_n_s_timeout); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(0, 354, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__37);
+  __Pyx_GIVEREF(__pyx_tuple__37);
+/* … */
+  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_queue_5Queue_39peek, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Queue_peek, NULL, __pyx_n_s_gevent__queue, __pyx_d, ((PyObject *)__pyx_codeobj__38)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 354, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_Queue->tp_dict, __pyx_n_s_peek_2, __pyx_t_6) < 0) __PYX_ERR(0, 354, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_6_queue_Queue);
+  __pyx_codeobj__38 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__37, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_queue_py, __pyx_n_s_peek_2, 354, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__38)) __PYX_ERR(0, 354, __pyx_L1_error)
+
 355:         """Return an item from the queue without removing it.
+
 356: 
+
 357:         If optional args *block* is true and *timeout* is ``None`` (the default),
+
 358:         block if necessary until an item is available. If *timeout* is a positive number,
+
 359:         it blocks at most *timeout* seconds and raises the :class:`Empty` exception
+
 360:         if no item was available within that time. Otherwise (*block* is false), return
+
 361:         an item if one is immediately available, else raise the :class:`Empty` exception
+
 362:         (*timeout* is ignored in that case).
+
 363:         """
+
+364:         if self.qsize():
+
  __pyx_t_7 = (((struct __pyx_vtabstruct_6gevent_6_queue_Queue *)__pyx_v_self->__pyx_vtab)->qsize(__pyx_v_self, 0) != 0);
+  if (__pyx_t_7) {
+/* … */
+  }
+
 365:             # XXX: Why doesn't this schedule an unlock like get() does?
+
+366:             return self._peek()
+
    __Pyx_XDECREF(__pyx_r);
+    __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_6_queue_Queue *)__pyx_v_self->__pyx_vtab)->_peek(__pyx_v_self, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 366, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __pyx_r = __pyx_t_1;
+    __pyx_t_1 = 0;
+    goto __pyx_L0;
+
 367: 
+
+368:         return self.__get_or_peek(self._peek, block, timeout)
+
  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_peek); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 368, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = ((struct __pyx_vtabstruct_6gevent_6_queue_Queue *)__pyx_v_self->__pyx_vtab)->__pyx___get_or_peek(__pyx_v_self, __pyx_t_1, __pyx_v_block, __pyx_v_timeout); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 368, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_r = __pyx_t_2;
+  __pyx_t_2 = 0;
+  goto __pyx_L0;
+
 369: 
+
+370:     def peek_nowait(self):
+
static PyObject *__pyx_pw_6gevent_6_queue_5Queue_41peek_nowait(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyObject *__pyx_f_6gevent_6_queue_5Queue_peek_nowait(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self, int __pyx_skip_dispatch) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("peek_nowait", 0);
+  /* Check if called by wrapper */
+  if (unlikely(__pyx_skip_dispatch)) ;
+  /* Check if overridden in Python */
+  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
+    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
+    if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
+    else {
+      PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      #endif
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_peek_nowait); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 370, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_6_queue_5Queue_41peek_nowait)) {
+        __Pyx_XDECREF(__pyx_r);
+        __Pyx_INCREF(__pyx_t_1);
+        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+          if (likely(__pyx_t_4)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+            __Pyx_INCREF(__pyx_t_4);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_3, function);
+          }
+        }
+        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
+        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 370, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __pyx_r = __pyx_t_2;
+        __pyx_t_2 = 0;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        goto __pyx_L0;
+      }
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+      tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
+      if (unlikely(type_dict_guard != tp_dict_version)) {
+        tp_dict_version = obj_dict_version = 0;
+      }
+      #endif
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    }
+    #endif
+  }
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_AddTraceback("gevent._queue.Queue.peek_nowait", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_queue_5Queue_41peek_nowait(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6gevent_6_queue_5Queue_40peek_nowait[] = "Queue.peek_nowait(self)\nReturn an item from the queue without blocking.\n\n        Only return an item if one is immediately available. Otherwise\n        raise the :class:`Empty` exception.\n        ";
+static PyMethodDef __pyx_mdef_6gevent_6_queue_5Queue_41peek_nowait = {"peek_nowait", (PyCFunction)__pyx_pw_6gevent_6_queue_5Queue_41peek_nowait, METH_NOARGS, __pyx_doc_6gevent_6_queue_5Queue_40peek_nowait};
+static PyObject *__pyx_pw_6gevent_6_queue_5Queue_41peek_nowait(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("peek_nowait (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_6_queue_5Queue_40peek_nowait(((struct __pyx_obj_6gevent_6_queue_Queue *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_queue_5Queue_40peek_nowait(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("peek_nowait", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __pyx_f_6gevent_6_queue_5Queue_peek_nowait(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 370, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent._queue.Queue.peek_nowait", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__39 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__39)) __PYX_ERR(0, 370, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__39);
+  __Pyx_GIVEREF(__pyx_tuple__39);
+/* … */
+  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_queue_5Queue_41peek_nowait, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Queue_peek_nowait, NULL, __pyx_n_s_gevent__queue, __pyx_d, ((PyObject *)__pyx_codeobj__40)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 370, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_Queue->tp_dict, __pyx_n_s_peek_nowait, __pyx_t_6) < 0) __PYX_ERR(0, 370, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_6_queue_Queue);
+  __pyx_codeobj__40 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__39, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_queue_py, __pyx_n_s_peek_nowait, 370, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__40)) __PYX_ERR(0, 370, __pyx_L1_error)
+
 371:         """Return an item from the queue without blocking.
+
 372: 
+
 373:         Only return an item if one is immediately available. Otherwise
+
 374:         raise the :class:`Empty` exception.
+
 375:         """
+
+376:         return self.peek(False)
+
  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_5.__pyx_n = 1;
+  __pyx_t_5.block = Py_False;
+  __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_6_queue_Queue *)__pyx_v_self->__pyx_vtab)->peek(__pyx_v_self, 0, &__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 376, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
 377: 
+
+378:     def _unlock(self):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_queue_5Queue_43_unlock(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6gevent_6_queue_5Queue_42_unlock[] = "Queue._unlock(self)";
+static PyMethodDef __pyx_mdef_6gevent_6_queue_5Queue_43_unlock = {"_unlock", (PyCFunction)__pyx_pw_6gevent_6_queue_5Queue_43_unlock, METH_NOARGS, __pyx_doc_6gevent_6_queue_5Queue_42_unlock};
+static PyObject *__pyx_pw_6gevent_6_queue_5Queue_43_unlock(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_unlock (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_6_queue_5Queue_42_unlock(((struct __pyx_obj_6gevent_6_queue_Queue *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_queue_5Queue_42_unlock(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self) {
+  int __pyx_v_repeat;
+  PyObject *__pyx_v_putter = NULL;
+  PyObject *__pyx_v_getter = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_unlock", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_6);
+  __Pyx_XDECREF(__pyx_t_7);
+  __Pyx_XDECREF(__pyx_t_8);
+  __Pyx_XDECREF(__pyx_t_9);
+  __Pyx_XDECREF(__pyx_t_10);
+  __Pyx_XDECREF(__pyx_t_11);
+  __Pyx_XDECREF(__pyx_t_12);
+  __Pyx_AddTraceback("gevent._queue.Queue._unlock", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_putter);
+  __Pyx_XDECREF(__pyx_v_getter);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__41 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_repeat, __pyx_n_s_putter, __pyx_n_s_getter); if (unlikely(!__pyx_tuple__41)) __PYX_ERR(0, 378, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__41);
+  __Pyx_GIVEREF(__pyx_tuple__41);
+/* … */
+  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_queue_5Queue_43_unlock, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Queue__unlock, NULL, __pyx_n_s_gevent__queue, __pyx_d, ((PyObject *)__pyx_codeobj__42)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 378, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_Queue->tp_dict, __pyx_n_s_unlock, __pyx_t_6) < 0) __PYX_ERR(0, 378, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_6_queue_Queue);
+  __pyx_codeobj__42 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__41, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_queue_py, __pyx_n_s_unlock, 378, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__42)) __PYX_ERR(0, 378, __pyx_L1_error)
+
+379:         while True:
+
  while (1) {
+
+380:             repeat = False
+
    __pyx_v_repeat = 0;
+
+381:             if self.putters and (self._maxsize == -1 or self.qsize() < self._maxsize):
+
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_self->putters); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 381, __pyx_L1_error)
+    if (__pyx_t_2) {
+    } else {
+      __pyx_t_1 = __pyx_t_2;
+      goto __pyx_L6_bool_binop_done;
+    }
+    __pyx_t_2 = ((__pyx_v_self->_maxsize == -1L) != 0);
+    if (!__pyx_t_2) {
+    } else {
+      __pyx_t_1 = __pyx_t_2;
+      goto __pyx_L6_bool_binop_done;
+    }
+    __pyx_t_2 = ((((struct __pyx_vtabstruct_6gevent_6_queue_Queue *)__pyx_v_self->__pyx_vtab)->qsize(__pyx_v_self, 0) < __pyx_v_self->_maxsize) != 0);
+    __pyx_t_1 = __pyx_t_2;
+    __pyx_L6_bool_binop_done:;
+    if (__pyx_t_1) {
+/* … */
+    }
+
+382:                 repeat = True
+
      __pyx_v_repeat = 1;
+
+383:                 try:
+
      {
+        /*try:*/ {
+/* … */
+        }
+/* … */
+        __Pyx_XGIVEREF(__pyx_t_3);
+        __Pyx_XGIVEREF(__pyx_t_4);
+        __Pyx_XGIVEREF(__pyx_t_5);
+        __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
+        goto __pyx_L1_error;
+        __pyx_L10_exception_handled:;
+        __Pyx_XGIVEREF(__pyx_t_3);
+        __Pyx_XGIVEREF(__pyx_t_4);
+        __Pyx_XGIVEREF(__pyx_t_5);
+        __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
+        __pyx_L16_try_end:;
+      }
+
+384:                     putter = self.putters.popleft()
+
          __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->putters, __pyx_n_s_popleft); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 384, __pyx_L9_error)
+          __Pyx_GOTREF(__pyx_t_7);
+          __pyx_t_8 = NULL;
+          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
+            __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
+            if (likely(__pyx_t_8)) {
+              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
+              __Pyx_INCREF(__pyx_t_8);
+              __Pyx_INCREF(function);
+              __Pyx_DECREF_SET(__pyx_t_7, function);
+            }
+          }
+          __pyx_t_6 = (__pyx_t_8) ? __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_8) : __Pyx_PyObject_CallNoArg(__pyx_t_7);
+          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
+          if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 384, __pyx_L9_error)
+          __Pyx_GOTREF(__pyx_t_6);
+          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+          __Pyx_XDECREF_SET(__pyx_v_putter, __pyx_t_6);
+          __pyx_t_6 = 0;
+
+385:                     self._put(putter.item)
+
          __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_putter, __pyx_n_s_item); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 385, __pyx_L9_error)
+          __Pyx_GOTREF(__pyx_t_6);
+          __pyx_t_7 = ((struct __pyx_vtabstruct_6gevent_6_queue_Queue *)__pyx_v_self->__pyx_vtab)->_put(__pyx_v_self, __pyx_t_6, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 385, __pyx_L9_error)
+          __Pyx_GOTREF(__pyx_t_7);
+          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+
+386:                 except: # pylint:disable=bare-except
+
        /*except:*/ {
+          __Pyx_AddTraceback("gevent._queue.Queue._unlock", __pyx_clineno, __pyx_lineno, __pyx_filename);
+          if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_6, &__pyx_t_8) < 0) __PYX_ERR(0, 386, __pyx_L11_except_error)
+          __Pyx_GOTREF(__pyx_t_7);
+          __Pyx_GOTREF(__pyx_t_6);
+          __Pyx_GOTREF(__pyx_t_8);
+
+387:                     putter.throw(*sys.exc_info())
+
          if (unlikely(!__pyx_v_putter)) { __Pyx_RaiseUnboundLocalError("putter"); __PYX_ERR(0, 387, __pyx_L11_except_error) }
+          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_putter, __pyx_n_s_throw); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 387, __pyx_L11_except_error)
+          __Pyx_GOTREF(__pyx_t_9);
+          __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_sys); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 387, __pyx_L11_except_error)
+          __Pyx_GOTREF(__pyx_t_11);
+          __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_exc_info); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 387, __pyx_L11_except_error)
+          __Pyx_GOTREF(__pyx_t_12);
+          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+          __pyx_t_11 = NULL;
+          if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_12))) {
+            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_12);
+            if (likely(__pyx_t_11)) {
+              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
+              __Pyx_INCREF(__pyx_t_11);
+              __Pyx_INCREF(function);
+              __Pyx_DECREF_SET(__pyx_t_12, function);
+            }
+          }
+          __pyx_t_10 = (__pyx_t_11) ? __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_11) : __Pyx_PyObject_CallNoArg(__pyx_t_12);
+          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
+          if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 387, __pyx_L11_except_error)
+          __Pyx_GOTREF(__pyx_t_10);
+          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
+          __pyx_t_12 = __Pyx_PySequence_Tuple(__pyx_t_10); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 387, __pyx_L11_except_error)
+          __Pyx_GOTREF(__pyx_t_12);
+          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+          __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_12, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 387, __pyx_L11_except_error)
+          __Pyx_GOTREF(__pyx_t_10);
+          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
+          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+          __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
+          goto __pyx_L10_exception_handled;
+        }
+        __pyx_L11_except_error:;
+
 388:                 else:
+
+389:                     putter.switch(putter)
+
        /*else:*/ {
+          __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_putter, __pyx_n_s_switch); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 389, __pyx_L11_except_error)
+          __Pyx_GOTREF(__pyx_t_6);
+          __pyx_t_8 = NULL;
+          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
+            __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_6);
+            if (likely(__pyx_t_8)) {
+              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
+              __Pyx_INCREF(__pyx_t_8);
+              __Pyx_INCREF(function);
+              __Pyx_DECREF_SET(__pyx_t_6, function);
+            }
+          }
+          __pyx_t_7 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_8, __pyx_v_putter) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_putter);
+          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
+          if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 389, __pyx_L11_except_error)
+          __Pyx_GOTREF(__pyx_t_7);
+          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+        }
+        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+        goto __pyx_L16_try_end;
+        __pyx_L9_error:;
+        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
+        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+
+390:             if self.getters and self.qsize():
+
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_self->getters); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 390, __pyx_L1_error)
+    if (__pyx_t_2) {
+    } else {
+      __pyx_t_1 = __pyx_t_2;
+      goto __pyx_L20_bool_binop_done;
+    }
+    __pyx_t_2 = (((struct __pyx_vtabstruct_6gevent_6_queue_Queue *)__pyx_v_self->__pyx_vtab)->qsize(__pyx_v_self, 0) != 0);
+    __pyx_t_1 = __pyx_t_2;
+    __pyx_L20_bool_binop_done:;
+    if (__pyx_t_1) {
+/* … */
+    }
+
+391:                 repeat = True
+
      __pyx_v_repeat = 1;
+
+392:                 getter = self.getters.popleft()
+
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->getters, __pyx_n_s_popleft); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 392, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_6);
+      __pyx_t_7 = NULL;
+      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
+        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
+        if (likely(__pyx_t_7)) {
+          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
+          __Pyx_INCREF(__pyx_t_7);
+          __Pyx_INCREF(function);
+          __Pyx_DECREF_SET(__pyx_t_6, function);
+        }
+      }
+      __pyx_t_8 = (__pyx_t_7) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7) : __Pyx_PyObject_CallNoArg(__pyx_t_6);
+      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+      if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 392, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_8);
+      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+      __Pyx_XDECREF_SET(__pyx_v_getter, __pyx_t_8);
+      __pyx_t_8 = 0;
+
+393:                 getter.switch(getter)
+
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_getter, __pyx_n_s_switch); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 393, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_6);
+      __pyx_t_7 = NULL;
+      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
+        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
+        if (likely(__pyx_t_7)) {
+          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
+          __Pyx_INCREF(__pyx_t_7);
+          __Pyx_INCREF(function);
+          __Pyx_DECREF_SET(__pyx_t_6, function);
+        }
+      }
+      __pyx_t_8 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_v_getter) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_getter);
+      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+      if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 393, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_8);
+      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+
+394:             if not repeat:
+
    __pyx_t_1 = ((!(__pyx_v_repeat != 0)) != 0);
+    if (__pyx_t_1) {
+/* … */
+    }
+  }
+
+395:                 return
+
      __Pyx_XDECREF(__pyx_r);
+      __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+      goto __pyx_L0;
+
 396: 
+
+397:     def _schedule_unlock(self):
+
static PyObject *__pyx_f_6gevent_6_queue_5Queue__schedule_unlock(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_schedule_unlock", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_XDECREF(__pyx_t_6);
+  __Pyx_AddTraceback("gevent._queue.Queue._schedule_unlock", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+398:         if not self._event_unlock:
+
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_self->_event_unlock); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 398, __pyx_L1_error)
+  __pyx_t_2 = ((!__pyx_t_1) != 0);
+  if (__pyx_t_2) {
+/* … */
+  }
+
+399:             self._event_unlock = self.hub.loop.run_callback(self._unlock)
+
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->hub, __pyx_n_s_loop); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 399, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_run_callback); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 399, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_5);
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_unlock); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 399, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    __pyx_t_6 = NULL;
+    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
+      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
+      if (likely(__pyx_t_6)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
+        __Pyx_INCREF(__pyx_t_6);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_5, function);
+      }
+    }
+    __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4);
+    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 399, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __Pyx_GIVEREF(__pyx_t_3);
+    __Pyx_GOTREF(__pyx_v_self->_event_unlock);
+    __Pyx_DECREF(__pyx_v_self->_event_unlock);
+    __pyx_v_self->_event_unlock = __pyx_t_3;
+    __pyx_t_3 = 0;
+
 400: 
+
+401:     def __iter__(self):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_queue_5Queue_45__iter__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_6_queue_5Queue_45__iter__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_6_queue_5Queue_44__iter__(((struct __pyx_obj_6gevent_6_queue_Queue *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_queue_5Queue_44__iter__(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__iter__", 0);
+/* … */
+  /* function exit code */
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+402:         return self
+
  __Pyx_XDECREF(__pyx_r);
+  __Pyx_INCREF(((PyObject *)__pyx_v_self));
+  __pyx_r = ((PyObject *)__pyx_v_self);
+  goto __pyx_L0;
+
 403: 
+
+404:     def __next__(self):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_queue_5Queue_47__next__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_6_queue_5Queue_47__next__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__next__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_6_queue_5Queue_46__next__(((struct __pyx_obj_6gevent_6_queue_Queue *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_queue_5Queue_46__next__(struct __pyx_obj_6gevent_6_queue_Queue *__pyx_v_self) {
+  PyObject *__pyx_v_result = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__next__", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent._queue.Queue.__next__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_result);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+405:         result = self.get()
+
  __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_6_queue_Queue *)__pyx_v_self->__pyx_vtab)->get(__pyx_v_self, 0, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 405, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_v_result = __pyx_t_1;
+  __pyx_t_1 = 0;
+
+406:         if result is StopIteration:
+
  __pyx_t_2 = (__pyx_v_result == __pyx_builtin_StopIteration);
+  __pyx_t_3 = (__pyx_t_2 != 0);
+  if (unlikely(__pyx_t_3)) {
+/* … */
+  }
+
+407:             raise result
+
    __Pyx_Raise(__pyx_v_result, 0, 0, 0);
+    __PYX_ERR(0, 407, __pyx_L1_error)
+
+408:         return result
+
  __Pyx_XDECREF(__pyx_r);
+  __Pyx_INCREF(__pyx_v_result);
+  __pyx_r = __pyx_v_result;
+  goto __pyx_L0;
+
 409: 
+
+410:     next = __next__ # Py2
+
  __Pyx_GetNameInClass(__pyx_t_6, (PyObject *)__pyx_ptype_6gevent_6_queue_Queue, __pyx_n_s_next); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 410, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_Queue->tp_dict, __pyx_n_s_next_2, __pyx_t_6) < 0) __PYX_ERR(0, 410, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_6_queue_Queue);
+
 411: 
+
 412: 
+
+413: class UnboundQueue(Queue):
+
struct __pyx_vtabstruct_6gevent_6_queue_UnboundQueue {
+  struct __pyx_vtabstruct_6gevent_6_queue_Queue __pyx_base;
+};
+static struct __pyx_vtabstruct_6gevent_6_queue_UnboundQueue *__pyx_vtabptr_6gevent_6_queue_UnboundQueue;
+
+
 414:     # A specialization of Queue that knows it can never
+
 415:     # be bound. Changing its maxsize has no effect.
+
 416: 
+
+417:     __slots__ = ()
+
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_UnboundQueue->tp_dict, __pyx_n_s_slots, __pyx_empty_tuple) < 0) __PYX_ERR(0, 417, __pyx_L1_error)
+  PyType_Modified(__pyx_ptype_6gevent_6_queue_UnboundQueue);
+
 418: 
+
+419:     def __init__(self, maxsize=None, items=()):
+
/* Python wrapper */
+static int __pyx_pw_6gevent_6_queue_12UnboundQueue_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static int __pyx_pw_6gevent_6_queue_12UnboundQueue_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_maxsize = 0;
+  PyObject *__pyx_v_items = 0;
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_maxsize,&__pyx_n_s_items,0};
+    PyObject* values[2] = {0,0};
+    values[0] = ((PyObject *)Py_None);
+    values[1] = ((PyObject *)__pyx_empty_tuple);
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_maxsize);
+          if (value) { values[0] = value; kw_args--; }
+        }
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_items);
+          if (value) { values[1] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 419, __pyx_L3_error)
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    __pyx_v_maxsize = values[0];
+    __pyx_v_items = values[1];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 419, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent._queue.UnboundQueue.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return -1;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_6_queue_12UnboundQueue___init__(((struct __pyx_obj_6gevent_6_queue_UnboundQueue *)__pyx_v_self), __pyx_v_maxsize, __pyx_v_items);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_6_queue_12UnboundQueue___init__(struct __pyx_obj_6gevent_6_queue_UnboundQueue *__pyx_v_self, PyObject *__pyx_v_maxsize, PyObject *__pyx_v_items) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = 0;
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_XDECREF(__pyx_t_7);
+  __Pyx_AddTraceback("gevent._queue.UnboundQueue.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = -1;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+420:         if maxsize is not None:
+
  __pyx_t_1 = (__pyx_v_maxsize != Py_None);
+  __pyx_t_2 = (__pyx_t_1 != 0);
+  if (unlikely(__pyx_t_2)) {
+/* … */
+  }
+
+421:             raise ValueError("UnboundQueue has no maxsize")
+
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 421, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __PYX_ERR(0, 421, __pyx_L1_error)
+/* … */
+  __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s_UnboundQueue_has_no_maxsize); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 421, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__4);
+  __Pyx_GIVEREF(__pyx_tuple__4);
+
+422:         Queue.__init__(self, maxsize, items)
+
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_6gevent_6_queue_Queue), __pyx_n_s_init); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 422, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_4);
+  __pyx_t_5 = NULL;
+  __pyx_t_6 = 0;
+  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
+    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
+    if (likely(__pyx_t_5)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
+      __Pyx_INCREF(__pyx_t_5);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_4, function);
+      __pyx_t_6 = 1;
+    }
+  }
+  #if CYTHON_FAST_PYCALL
+  if (PyFunction_Check(__pyx_t_4)) {
+    PyObject *__pyx_temp[4] = {__pyx_t_5, ((PyObject *)__pyx_v_self), __pyx_v_maxsize, __pyx_v_items};
+    __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 422, __pyx_L1_error)
+    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __Pyx_GOTREF(__pyx_t_3);
+  } else
+  #endif
+  #if CYTHON_FAST_PYCCALL
+  if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
+    PyObject *__pyx_temp[4] = {__pyx_t_5, ((PyObject *)__pyx_v_self), __pyx_v_maxsize, __pyx_v_items};
+    __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 422, __pyx_L1_error)
+    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __Pyx_GOTREF(__pyx_t_3);
+  } else
+  #endif
+  {
+    __pyx_t_7 = PyTuple_New(3+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 422, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_7);
+    if (__pyx_t_5) {
+      __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
+    }
+    __Pyx_INCREF(((PyObject *)__pyx_v_self));
+    __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
+    PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, ((PyObject *)__pyx_v_self));
+    __Pyx_INCREF(__pyx_v_maxsize);
+    __Pyx_GIVEREF(__pyx_v_maxsize);
+    PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_maxsize);
+    __Pyx_INCREF(__pyx_v_items);
+    __Pyx_GIVEREF(__pyx_v_items);
+    PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_6, __pyx_v_items);
+    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 422, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  }
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+
+423:         self.putters = None # Will never be used.
+
  __Pyx_INCREF(Py_None);
+  __Pyx_GIVEREF(Py_None);
+  __Pyx_GOTREF(__pyx_v_self->__pyx_base.putters);
+  __Pyx_DECREF(__pyx_v_self->__pyx_base.putters);
+  __pyx_v_self->__pyx_base.putters = Py_None;
+
 424: 
+
+425:     def put(self, item, block=True, timeout=None):
+
static PyObject *__pyx_pw_6gevent_6_queue_12UnboundQueue_3put(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_f_6gevent_6_queue_12UnboundQueue_put(struct __pyx_obj_6gevent_6_queue_UnboundQueue *__pyx_v_self, PyObject *__pyx_v_item, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_6_queue_12UnboundQueue_put *__pyx_optional_args) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("put", 0);
+  if (__pyx_optional_args) {
+  }
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent._queue.UnboundQueue.put", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_queue_12UnboundQueue_3put(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_6gevent_6_queue_12UnboundQueue_2put[] = "UnboundQueue.put(self, item, block=True, timeout=None)";
+static PyMethodDef __pyx_mdef_6gevent_6_queue_12UnboundQueue_3put = {"put", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_6_queue_12UnboundQueue_3put, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_6_queue_12UnboundQueue_2put};
+static PyObject *__pyx_pw_6gevent_6_queue_12UnboundQueue_3put(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_item = 0;
+  PyObject *__pyx_v_block = 0;
+  PyObject *__pyx_v_timeout = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("put (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_item,&__pyx_n_s_block,&__pyx_n_s_timeout,0};
+    PyObject* values[3] = {0,0,0};
+    values[1] = ((PyObject *)Py_True);
+    values[2] = ((PyObject *)Py_None);
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_item)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_block);
+          if (value) { values[1] = value; kw_args--; }
+        }
+        CYTHON_FALLTHROUGH;
+        case  2:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_timeout);
+          if (value) { values[2] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "put") < 0)) __PYX_ERR(0, 425, __pyx_L3_error)
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    __pyx_v_item = values[0];
+    __pyx_v_block = values[1];
+    __pyx_v_timeout = values[2];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("put", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 425, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent._queue.UnboundQueue.put", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_6_queue_12UnboundQueue_2put(((struct __pyx_obj_6gevent_6_queue_UnboundQueue *)__pyx_v_self), __pyx_v_item, __pyx_v_block, __pyx_v_timeout);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_queue_12UnboundQueue_2put(struct __pyx_obj_6gevent_6_queue_UnboundQueue *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_block, PyObject *__pyx_v_timeout) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("put", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_2.__pyx_n = 2;
+  __pyx_t_2.block = __pyx_v_block;
+  __pyx_t_2.timeout = __pyx_v_timeout;
+  __pyx_t_1 = __pyx_vtabptr_6gevent_6_queue_UnboundQueue->__pyx_base.put(((struct __pyx_obj_6gevent_6_queue_Queue *)__pyx_v_self), __pyx_v_item, 1, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 425, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent._queue.UnboundQueue.put", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__43 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_item, __pyx_n_s_block, __pyx_n_s_timeout); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(0, 425, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__43);
+  __Pyx_GIVEREF(__pyx_tuple__43);
+/* … */
+  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_queue_12UnboundQueue_3put, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_UnboundQueue_put, NULL, __pyx_n_s_gevent__queue, __pyx_d, ((PyObject *)__pyx_codeobj__44)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 425, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_UnboundQueue->tp_dict, __pyx_n_s_put_2, __pyx_t_6) < 0) __PYX_ERR(0, 425, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_6_queue_UnboundQueue);
+  __pyx_codeobj__44 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__43, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_queue_py, __pyx_n_s_put_2, 425, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__44)) __PYX_ERR(0, 425, __pyx_L1_error)
+/* … */
+struct __pyx_opt_args_6gevent_6_queue_12UnboundQueue_put {
+  int __pyx_n;
+  PyObject *block;
+  PyObject *timeout;
+};
+
+426:         self._put(item)
+
  __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_6_queue_UnboundQueue *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._put(((struct __pyx_obj_6gevent_6_queue_Queue *)__pyx_v_self), __pyx_v_item, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 426, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+427:         if self.getters:
+
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_self->__pyx_base.getters); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 427, __pyx_L1_error)
+  if (__pyx_t_2) {
+/* … */
+  }
+
+428:             self._schedule_unlock()
+
    __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_6_queue_UnboundQueue *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._schedule_unlock(((struct __pyx_obj_6gevent_6_queue_Queue *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 428, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 429: 
+
 430: 
+
+431: class PriorityQueue(Queue):
+
struct __pyx_vtabstruct_6gevent_6_queue_PriorityQueue {
+  struct __pyx_vtabstruct_6gevent_6_queue_Queue __pyx_base;
+};
+static struct __pyx_vtabstruct_6gevent_6_queue_PriorityQueue *__pyx_vtabptr_6gevent_6_queue_PriorityQueue;
+
+
 432:     '''A subclass of :class:`Queue` that retrieves entries in priority order (lowest first).
+
 433: 
+
 434:     Entries are typically tuples of the form: ``(priority number, data)``.
+
 435: 
+
 436:     .. versionchanged:: 1.2a1
+
 437:        Any *items* given to the constructor will now be passed through
+
 438:        :func:`heapq.heapify` to ensure the invariants of this class hold.
+
 439:        Previously it was just assumed that they were already a heap.
+
 440:     '''
+
 441: 
+
+442:     __slots__ = ()
+
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_PriorityQueue->tp_dict, __pyx_n_s_slots, __pyx_empty_tuple) < 0) __PYX_ERR(0, 442, __pyx_L1_error)
+  PyType_Modified(__pyx_ptype_6gevent_6_queue_PriorityQueue);
+
 443: 
+
+444:     def _create_queue(self, items=()):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_queue_13PriorityQueue_1_create_queue(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_6gevent_6_queue_13PriorityQueue__create_queue[] = "PriorityQueue._create_queue(self, items=())";
+static PyMethodDef __pyx_mdef_6gevent_6_queue_13PriorityQueue_1_create_queue = {"_create_queue", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_6_queue_13PriorityQueue_1_create_queue, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_6_queue_13PriorityQueue__create_queue};
+static PyObject *__pyx_pw_6gevent_6_queue_13PriorityQueue_1_create_queue(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_items = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_create_queue (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_items,0};
+    PyObject* values[1] = {0};
+    values[0] = ((PyObject *)__pyx_empty_tuple);
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_items);
+          if (value) { values[0] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_create_queue") < 0)) __PYX_ERR(0, 444, __pyx_L3_error)
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    __pyx_v_items = values[0];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("_create_queue", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 444, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent._queue.PriorityQueue._create_queue", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_6_queue_13PriorityQueue__create_queue(((struct __pyx_obj_6gevent_6_queue_PriorityQueue *)__pyx_v_self), __pyx_v_items);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_queue_13PriorityQueue__create_queue(CYTHON_UNUSED struct __pyx_obj_6gevent_6_queue_PriorityQueue *__pyx_v_self, PyObject *__pyx_v_items) {
+  PyObject *__pyx_v_q = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_create_queue", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_AddTraceback("gevent._queue.PriorityQueue._create_queue", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_q);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__45 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_items, __pyx_n_s_q); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(0, 444, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__45);
+  __Pyx_GIVEREF(__pyx_tuple__45);
+/* … */
+  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_queue_13PriorityQueue_1_create_queue, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_PriorityQueue__create_queue, NULL, __pyx_n_s_gevent__queue, __pyx_d, ((PyObject *)__pyx_codeobj__46)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 444, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_PriorityQueue->tp_dict, __pyx_n_s_create_queue, __pyx_t_6) < 0) __PYX_ERR(0, 444, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_6_queue_PriorityQueue);
+  __pyx_codeobj__46 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__45, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_queue_py, __pyx_n_s_create_queue, 444, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__46)) __PYX_ERR(0, 444, __pyx_L1_error)
+
+445:         q = list(items)
+
  __pyx_t_1 = PySequence_List(__pyx_v_items); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 445, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_v_q = ((PyObject*)__pyx_t_1);
+  __pyx_t_1 = 0;
+
+446:         _heapify(q)
+
  __Pyx_INCREF(__pyx_v_6gevent_6_queue__heapify);
+  __pyx_t_2 = __pyx_v_6gevent_6_queue__heapify; __pyx_t_3 = NULL;
+  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
+    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+    if (likely(__pyx_t_3)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+      __Pyx_INCREF(__pyx_t_3);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_2, function);
+    }
+  }
+  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_q) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_q);
+  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 446, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+447:         return q
+
  __Pyx_XDECREF(__pyx_r);
+  __Pyx_INCREF(__pyx_v_q);
+  __pyx_r = __pyx_v_q;
+  goto __pyx_L0;
+
 448: 
+
+449:     def _put(self, item):
+
static PyObject *__pyx_pw_6gevent_6_queue_13PriorityQueue_3_put(PyObject *__pyx_v_self, PyObject *__pyx_v_item); /*proto*/
+static PyObject *__pyx_f_6gevent_6_queue_13PriorityQueue__put(struct __pyx_obj_6gevent_6_queue_PriorityQueue *__pyx_v_self, PyObject *__pyx_v_item, int __pyx_skip_dispatch) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_put", 0);
+  /* Check if called by wrapper */
+  if (unlikely(__pyx_skip_dispatch)) ;
+  /* Check if overridden in Python */
+  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
+    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
+    if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
+    else {
+      PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      #endif
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_put); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 449, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_6_queue_13PriorityQueue_3_put)) {
+        __Pyx_XDECREF(__pyx_r);
+        __Pyx_INCREF(__pyx_t_1);
+        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+          if (likely(__pyx_t_4)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+            __Pyx_INCREF(__pyx_t_4);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_3, function);
+          }
+        }
+        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_item) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_item);
+        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 449, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __pyx_r = __pyx_t_2;
+        __pyx_t_2 = 0;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        goto __pyx_L0;
+      }
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+      tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
+      if (unlikely(type_dict_guard != tp_dict_version)) {
+        tp_dict_version = obj_dict_version = 0;
+      }
+      #endif
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    }
+    #endif
+  }
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_AddTraceback("gevent._queue.PriorityQueue._put", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_queue_13PriorityQueue_3_put(PyObject *__pyx_v_self, PyObject *__pyx_v_item); /*proto*/
+static char __pyx_doc_6gevent_6_queue_13PriorityQueue_2_put[] = "PriorityQueue._put(self, item)";
+static PyMethodDef __pyx_mdef_6gevent_6_queue_13PriorityQueue_3_put = {"_put", (PyCFunction)__pyx_pw_6gevent_6_queue_13PriorityQueue_3_put, METH_O, __pyx_doc_6gevent_6_queue_13PriorityQueue_2_put};
+static PyObject *__pyx_pw_6gevent_6_queue_13PriorityQueue_3_put(PyObject *__pyx_v_self, PyObject *__pyx_v_item) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_put (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_6_queue_13PriorityQueue_2_put(((struct __pyx_obj_6gevent_6_queue_PriorityQueue *)__pyx_v_self), ((PyObject *)__pyx_v_item));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_queue_13PriorityQueue_2_put(struct __pyx_obj_6gevent_6_queue_PriorityQueue *__pyx_v_self, PyObject *__pyx_v_item) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_put", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __pyx_f_6gevent_6_queue_13PriorityQueue__put(__pyx_v_self, __pyx_v_item, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 449, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent._queue.PriorityQueue._put", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__47 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_item); if (unlikely(!__pyx_tuple__47)) __PYX_ERR(0, 449, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__47);
+  __Pyx_GIVEREF(__pyx_tuple__47);
+/* … */
+  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_queue_13PriorityQueue_3_put, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_PriorityQueue__put, NULL, __pyx_n_s_gevent__queue, __pyx_d, ((PyObject *)__pyx_codeobj__48)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 449, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_PriorityQueue->tp_dict, __pyx_n_s_put, __pyx_t_6) < 0) __PYX_ERR(0, 449, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_6_queue_PriorityQueue);
+  __pyx_codeobj__48 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__47, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_queue_py, __pyx_n_s_put, 449, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__48)) __PYX_ERR(0, 449, __pyx_L1_error)
+
+450:         _heappush(self.queue, item)
+
  __Pyx_INCREF(__pyx_v_6gevent_6_queue__heappush);
+  __pyx_t_2 = __pyx_v_6gevent_6_queue__heappush; __pyx_t_3 = NULL;
+  __pyx_t_5 = 0;
+  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
+    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+    if (likely(__pyx_t_3)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+      __Pyx_INCREF(__pyx_t_3);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_2, function);
+      __pyx_t_5 = 1;
+    }
+  }
+  #if CYTHON_FAST_PYCALL
+  if (PyFunction_Check(__pyx_t_2)) {
+    PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_self->__pyx_base.queue, __pyx_v_item};
+    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 450, __pyx_L1_error)
+    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __Pyx_GOTREF(__pyx_t_1);
+  } else
+  #endif
+  #if CYTHON_FAST_PYCCALL
+  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
+    PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_self->__pyx_base.queue, __pyx_v_item};
+    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 450, __pyx_L1_error)
+    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __Pyx_GOTREF(__pyx_t_1);
+  } else
+  #endif
+  {
+    __pyx_t_4 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 450, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    if (__pyx_t_3) {
+      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = NULL;
+    }
+    __Pyx_INCREF(__pyx_v_self->__pyx_base.queue);
+    __Pyx_GIVEREF(__pyx_v_self->__pyx_base.queue);
+    PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_5, __pyx_v_self->__pyx_base.queue);
+    __Pyx_INCREF(__pyx_v_item);
+    __Pyx_GIVEREF(__pyx_v_item);
+    PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_5, __pyx_v_item);
+    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 450, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  }
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 451: 
+
+452:     def _get(self):
+
static PyObject *__pyx_pw_6gevent_6_queue_13PriorityQueue_5_get(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyObject *__pyx_f_6gevent_6_queue_13PriorityQueue__get(struct __pyx_obj_6gevent_6_queue_PriorityQueue *__pyx_v_self, int __pyx_skip_dispatch) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_get", 0);
+  /* Check if called by wrapper */
+  if (unlikely(__pyx_skip_dispatch)) ;
+  /* Check if overridden in Python */
+  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
+    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
+    if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
+    else {
+      PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      #endif
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 452, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_6_queue_13PriorityQueue_5_get)) {
+        __Pyx_XDECREF(__pyx_r);
+        __Pyx_INCREF(__pyx_t_1);
+        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+          if (likely(__pyx_t_4)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+            __Pyx_INCREF(__pyx_t_4);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_3, function);
+          }
+        }
+        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
+        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 452, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __pyx_r = __pyx_t_2;
+        __pyx_t_2 = 0;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        goto __pyx_L0;
+      }
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+      tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
+      if (unlikely(type_dict_guard != tp_dict_version)) {
+        tp_dict_version = obj_dict_version = 0;
+      }
+      #endif
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    }
+    #endif
+  }
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_AddTraceback("gevent._queue.PriorityQueue._get", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_queue_13PriorityQueue_5_get(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6gevent_6_queue_13PriorityQueue_4_get[] = "PriorityQueue._get(self)";
+static PyMethodDef __pyx_mdef_6gevent_6_queue_13PriorityQueue_5_get = {"_get", (PyCFunction)__pyx_pw_6gevent_6_queue_13PriorityQueue_5_get, METH_NOARGS, __pyx_doc_6gevent_6_queue_13PriorityQueue_4_get};
+static PyObject *__pyx_pw_6gevent_6_queue_13PriorityQueue_5_get(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_get (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_6_queue_13PriorityQueue_4_get(((struct __pyx_obj_6gevent_6_queue_PriorityQueue *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_queue_13PriorityQueue_4_get(struct __pyx_obj_6gevent_6_queue_PriorityQueue *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_get", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __pyx_f_6gevent_6_queue_13PriorityQueue__get(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 452, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent._queue.PriorityQueue._get", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__49 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__49)) __PYX_ERR(0, 452, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__49);
+  __Pyx_GIVEREF(__pyx_tuple__49);
+/* … */
+  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_queue_13PriorityQueue_5_get, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_PriorityQueue__get, NULL, __pyx_n_s_gevent__queue, __pyx_d, ((PyObject *)__pyx_codeobj__50)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 452, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_PriorityQueue->tp_dict, __pyx_n_s_get, __pyx_t_6) < 0) __PYX_ERR(0, 452, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_6_queue_PriorityQueue);
+  __pyx_codeobj__50 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__49, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_queue_py, __pyx_n_s_get, 452, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__50)) __PYX_ERR(0, 452, __pyx_L1_error)
+
+453:         return _heappop(self.queue)
+
  __Pyx_XDECREF(__pyx_r);
+  __Pyx_INCREF(__pyx_v_6gevent_6_queue__heappop);
+  __pyx_t_2 = __pyx_v_6gevent_6_queue__heappop; __pyx_t_3 = NULL;
+  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
+    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+    if (likely(__pyx_t_3)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+      __Pyx_INCREF(__pyx_t_3);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_2, function);
+    }
+  }
+  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_self->__pyx_base.queue) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_self->__pyx_base.queue);
+  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 453, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
 454: 
+
 455: 
+
+456: class LifoQueue(Queue):
+
struct __pyx_vtabstruct_6gevent_6_queue_LifoQueue {
+  struct __pyx_vtabstruct_6gevent_6_queue_Queue __pyx_base;
+};
+static struct __pyx_vtabstruct_6gevent_6_queue_LifoQueue *__pyx_vtabptr_6gevent_6_queue_LifoQueue;
+
+
 457:     '''A subclass of :class:`Queue` that retrieves most recently added entries first.'''
+
 458: 
+
+459:     __slots__ = ()
+
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_LifoQueue->tp_dict, __pyx_n_s_slots, __pyx_empty_tuple) < 0) __PYX_ERR(0, 459, __pyx_L1_error)
+  PyType_Modified(__pyx_ptype_6gevent_6_queue_LifoQueue);
+
 460: 
+
+461:     def _create_queue(self, items=()):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_queue_9LifoQueue_1_create_queue(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_6gevent_6_queue_9LifoQueue__create_queue[] = "LifoQueue._create_queue(self, items=())";
+static PyMethodDef __pyx_mdef_6gevent_6_queue_9LifoQueue_1_create_queue = {"_create_queue", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_6_queue_9LifoQueue_1_create_queue, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_6_queue_9LifoQueue__create_queue};
+static PyObject *__pyx_pw_6gevent_6_queue_9LifoQueue_1_create_queue(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_items = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_create_queue (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_items,0};
+    PyObject* values[1] = {0};
+    values[0] = ((PyObject *)__pyx_empty_tuple);
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_items);
+          if (value) { values[0] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_create_queue") < 0)) __PYX_ERR(0, 461, __pyx_L3_error)
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    __pyx_v_items = values[0];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("_create_queue", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 461, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent._queue.LifoQueue._create_queue", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_6_queue_9LifoQueue__create_queue(((struct __pyx_obj_6gevent_6_queue_LifoQueue *)__pyx_v_self), __pyx_v_items);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_queue_9LifoQueue__create_queue(CYTHON_UNUSED struct __pyx_obj_6gevent_6_queue_LifoQueue *__pyx_v_self, PyObject *__pyx_v_items) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_create_queue", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent._queue.LifoQueue._create_queue", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__51 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_items); if (unlikely(!__pyx_tuple__51)) __PYX_ERR(0, 461, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__51);
+  __Pyx_GIVEREF(__pyx_tuple__51);
+/* … */
+  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_queue_9LifoQueue_1_create_queue, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_LifoQueue__create_queue, NULL, __pyx_n_s_gevent__queue, __pyx_d, ((PyObject *)__pyx_codeobj__52)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 461, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_LifoQueue->tp_dict, __pyx_n_s_create_queue, __pyx_t_6) < 0) __PYX_ERR(0, 461, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_6_queue_LifoQueue);
+  __pyx_codeobj__52 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__51, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_queue_py, __pyx_n_s_create_queue, 461, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__52)) __PYX_ERR(0, 461, __pyx_L1_error)
+
+462:         return list(items)
+
  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = PySequence_List(__pyx_v_items); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
 463: 
+
+464:     def _put(self, item):
+
static PyObject *__pyx_pw_6gevent_6_queue_9LifoQueue_3_put(PyObject *__pyx_v_self, PyObject *__pyx_v_item); /*proto*/
+static PyObject *__pyx_f_6gevent_6_queue_9LifoQueue__put(struct __pyx_obj_6gevent_6_queue_LifoQueue *__pyx_v_self, PyObject *__pyx_v_item, int __pyx_skip_dispatch) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_put", 0);
+  /* Check if called by wrapper */
+  if (unlikely(__pyx_skip_dispatch)) ;
+  /* Check if overridden in Python */
+  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
+    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
+    if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
+    else {
+      PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      #endif
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_put); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_6_queue_9LifoQueue_3_put)) {
+        __Pyx_XDECREF(__pyx_r);
+        __Pyx_INCREF(__pyx_t_1);
+        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+          if (likely(__pyx_t_4)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+            __Pyx_INCREF(__pyx_t_4);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_3, function);
+          }
+        }
+        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_item) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_item);
+        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 464, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __pyx_r = __pyx_t_2;
+        __pyx_t_2 = 0;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        goto __pyx_L0;
+      }
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+      tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
+      if (unlikely(type_dict_guard != tp_dict_version)) {
+        tp_dict_version = obj_dict_version = 0;
+      }
+      #endif
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    }
+    #endif
+  }
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_AddTraceback("gevent._queue.LifoQueue._put", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_queue_9LifoQueue_3_put(PyObject *__pyx_v_self, PyObject *__pyx_v_item); /*proto*/
+static char __pyx_doc_6gevent_6_queue_9LifoQueue_2_put[] = "LifoQueue._put(self, item)";
+static PyMethodDef __pyx_mdef_6gevent_6_queue_9LifoQueue_3_put = {"_put", (PyCFunction)__pyx_pw_6gevent_6_queue_9LifoQueue_3_put, METH_O, __pyx_doc_6gevent_6_queue_9LifoQueue_2_put};
+static PyObject *__pyx_pw_6gevent_6_queue_9LifoQueue_3_put(PyObject *__pyx_v_self, PyObject *__pyx_v_item) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_put (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_6_queue_9LifoQueue_2_put(((struct __pyx_obj_6gevent_6_queue_LifoQueue *)__pyx_v_self), ((PyObject *)__pyx_v_item));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_queue_9LifoQueue_2_put(struct __pyx_obj_6gevent_6_queue_LifoQueue *__pyx_v_self, PyObject *__pyx_v_item) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_put", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __pyx_f_6gevent_6_queue_9LifoQueue__put(__pyx_v_self, __pyx_v_item, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent._queue.LifoQueue._put", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__53 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_item); if (unlikely(!__pyx_tuple__53)) __PYX_ERR(0, 464, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__53);
+  __Pyx_GIVEREF(__pyx_tuple__53);
+/* … */
+  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_queue_9LifoQueue_3_put, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_LifoQueue__put, NULL, __pyx_n_s_gevent__queue, __pyx_d, ((PyObject *)__pyx_codeobj__54)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 464, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_LifoQueue->tp_dict, __pyx_n_s_put, __pyx_t_6) < 0) __PYX_ERR(0, 464, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_6_queue_LifoQueue);
+  __pyx_codeobj__54 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__53, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_queue_py, __pyx_n_s_put, 464, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__54)) __PYX_ERR(0, 464, __pyx_L1_error)
+
+465:         self.queue.append(item)
+
  __pyx_t_5 = __Pyx_PyObject_Append(__pyx_v_self->__pyx_base.queue, __pyx_v_item); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 465, __pyx_L1_error)
+
 466: 
+
+467:     def _get(self):
+
static PyObject *__pyx_pw_6gevent_6_queue_9LifoQueue_5_get(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyObject *__pyx_f_6gevent_6_queue_9LifoQueue__get(struct __pyx_obj_6gevent_6_queue_LifoQueue *__pyx_v_self, int __pyx_skip_dispatch) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_get", 0);
+  /* Check if called by wrapper */
+  if (unlikely(__pyx_skip_dispatch)) ;
+  /* Check if overridden in Python */
+  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
+    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
+    if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
+    else {
+      PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      #endif
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 467, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_6_queue_9LifoQueue_5_get)) {
+        __Pyx_XDECREF(__pyx_r);
+        __Pyx_INCREF(__pyx_t_1);
+        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+          if (likely(__pyx_t_4)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+            __Pyx_INCREF(__pyx_t_4);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_3, function);
+          }
+        }
+        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
+        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 467, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __pyx_r = __pyx_t_2;
+        __pyx_t_2 = 0;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        goto __pyx_L0;
+      }
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+      tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
+      if (unlikely(type_dict_guard != tp_dict_version)) {
+        tp_dict_version = obj_dict_version = 0;
+      }
+      #endif
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    }
+    #endif
+  }
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_AddTraceback("gevent._queue.LifoQueue._get", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_queue_9LifoQueue_5_get(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6gevent_6_queue_9LifoQueue_4_get[] = "LifoQueue._get(self)";
+static PyMethodDef __pyx_mdef_6gevent_6_queue_9LifoQueue_5_get = {"_get", (PyCFunction)__pyx_pw_6gevent_6_queue_9LifoQueue_5_get, METH_NOARGS, __pyx_doc_6gevent_6_queue_9LifoQueue_4_get};
+static PyObject *__pyx_pw_6gevent_6_queue_9LifoQueue_5_get(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_get (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_6_queue_9LifoQueue_4_get(((struct __pyx_obj_6gevent_6_queue_LifoQueue *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_queue_9LifoQueue_4_get(struct __pyx_obj_6gevent_6_queue_LifoQueue *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_get", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __pyx_f_6gevent_6_queue_9LifoQueue__get(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 467, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent._queue.LifoQueue._get", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__55 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__55)) __PYX_ERR(0, 467, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__55);
+  __Pyx_GIVEREF(__pyx_tuple__55);
+/* … */
+  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_queue_9LifoQueue_5_get, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_LifoQueue__get, NULL, __pyx_n_s_gevent__queue, __pyx_d, ((PyObject *)__pyx_codeobj__56)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 467, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_LifoQueue->tp_dict, __pyx_n_s_get, __pyx_t_6) < 0) __PYX_ERR(0, 467, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_6_queue_LifoQueue);
+  __pyx_codeobj__56 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__55, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_queue_py, __pyx_n_s_get, 467, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__56)) __PYX_ERR(0, 467, __pyx_L1_error)
+
+468:         return self.queue.pop()
+
  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __Pyx_PyObject_Pop(__pyx_v_self->__pyx_base.queue); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 468, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
 469: 
+
+470:     def _peek(self):
+
static PyObject *__pyx_pw_6gevent_6_queue_9LifoQueue_7_peek(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyObject *__pyx_f_6gevent_6_queue_9LifoQueue__peek(struct __pyx_obj_6gevent_6_queue_LifoQueue *__pyx_v_self, int __pyx_skip_dispatch) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_peek", 0);
+  /* Check if called by wrapper */
+  if (unlikely(__pyx_skip_dispatch)) ;
+  /* Check if overridden in Python */
+  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
+    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
+    if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
+    else {
+      PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      #endif
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_peek); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 470, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_6_queue_9LifoQueue_7_peek)) {
+        __Pyx_XDECREF(__pyx_r);
+        __Pyx_INCREF(__pyx_t_1);
+        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+          if (likely(__pyx_t_4)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+            __Pyx_INCREF(__pyx_t_4);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_3, function);
+          }
+        }
+        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
+        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 470, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __pyx_r = __pyx_t_2;
+        __pyx_t_2 = 0;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        goto __pyx_L0;
+      }
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+      tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
+      if (unlikely(type_dict_guard != tp_dict_version)) {
+        tp_dict_version = obj_dict_version = 0;
+      }
+      #endif
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    }
+    #endif
+  }
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_AddTraceback("gevent._queue.LifoQueue._peek", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_queue_9LifoQueue_7_peek(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6gevent_6_queue_9LifoQueue_6_peek[] = "LifoQueue._peek(self)";
+static PyMethodDef __pyx_mdef_6gevent_6_queue_9LifoQueue_7_peek = {"_peek", (PyCFunction)__pyx_pw_6gevent_6_queue_9LifoQueue_7_peek, METH_NOARGS, __pyx_doc_6gevent_6_queue_9LifoQueue_6_peek};
+static PyObject *__pyx_pw_6gevent_6_queue_9LifoQueue_7_peek(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_peek (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_6_queue_9LifoQueue_6_peek(((struct __pyx_obj_6gevent_6_queue_LifoQueue *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_queue_9LifoQueue_6_peek(struct __pyx_obj_6gevent_6_queue_LifoQueue *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_peek", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __pyx_f_6gevent_6_queue_9LifoQueue__peek(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 470, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent._queue.LifoQueue._peek", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__57 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__57)) __PYX_ERR(0, 470, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__57);
+  __Pyx_GIVEREF(__pyx_tuple__57);
+/* … */
+  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_queue_9LifoQueue_7_peek, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_LifoQueue__peek, NULL, __pyx_n_s_gevent__queue, __pyx_d, ((PyObject *)__pyx_codeobj__58)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 470, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_LifoQueue->tp_dict, __pyx_n_s_peek, __pyx_t_6) < 0) __PYX_ERR(0, 470, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_6_queue_LifoQueue);
+  __pyx_codeobj__58 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__57, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_queue_py, __pyx_n_s_peek, 470, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__58)) __PYX_ERR(0, 470, __pyx_L1_error)
+
+471:         return self.queue[-1]
+
  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_self->__pyx_base.queue, -1L, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 471, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
 472: 
+
 473: 
+
+474: class JoinableQueue(Queue):
+
struct __pyx_vtabstruct_6gevent_6_queue_JoinableQueue {
+  struct __pyx_vtabstruct_6gevent_6_queue_Queue __pyx_base;
+};
+static struct __pyx_vtabstruct_6gevent_6_queue_JoinableQueue *__pyx_vtabptr_6gevent_6_queue_JoinableQueue;
+
+
 475:     """
+
 476:     A subclass of :class:`Queue` that additionally has
+
 477:     :meth:`task_done` and :meth:`join` methods.
+
 478:     """
+
 479: 
+
 480:     __slots__ = (
+
+481:         '_cond',
+
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_JoinableQueue->tp_dict, __pyx_n_s_slots, __pyx_tuple__59) < 0) __PYX_ERR(0, 480, __pyx_L1_error)
+  PyType_Modified(__pyx_ptype_6gevent_6_queue_JoinableQueue);
+/* … */
+  __pyx_tuple__59 = PyTuple_Pack(2, __pyx_n_s_cond, __pyx_n_s_unfinished_tasks); if (unlikely(!__pyx_tuple__59)) __PYX_ERR(0, 481, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__59);
+  __Pyx_GIVEREF(__pyx_tuple__59);
+
 482:         'unfinished_tasks',
+
 483:     )
+
 484: 
+
+485:     def __init__(self, maxsize=None, items=(), unfinished_tasks=None):
+
/* Python wrapper */
+static int __pyx_pw_6gevent_6_queue_13JoinableQueue_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_6gevent_6_queue_13JoinableQueue___init__[] = "\n\n        .. versionchanged:: 1.1a1\n           If *unfinished_tasks* is not given, then all the given *items*\n           (if any) will be considered unfinished.\n\n        ";
+#if CYTHON_COMPILING_IN_CPYTHON
+struct wrapperbase __pyx_wrapperbase_6gevent_6_queue_13JoinableQueue___init__;
+#endif
+static int __pyx_pw_6gevent_6_queue_13JoinableQueue_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_maxsize = 0;
+  PyObject *__pyx_v_items = 0;
+  PyObject *__pyx_v_unfinished_tasks = 0;
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_maxsize,&__pyx_n_s_items,&__pyx_n_s_unfinished_tasks,0};
+    PyObject* values[3] = {0,0,0};
+    values[0] = ((PyObject *)Py_None);
+    values[1] = ((PyObject *)__pyx_empty_tuple);
+    values[2] = ((PyObject *)Py_None);
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_maxsize);
+          if (value) { values[0] = value; kw_args--; }
+        }
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_items);
+          if (value) { values[1] = value; kw_args--; }
+        }
+        CYTHON_FALLTHROUGH;
+        case  2:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_unfinished_tasks);
+          if (value) { values[2] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 485, __pyx_L3_error)
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    __pyx_v_maxsize = values[0];
+    __pyx_v_items = values[1];
+    __pyx_v_unfinished_tasks = values[2];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 485, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent._queue.JoinableQueue.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return -1;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_6_queue_13JoinableQueue___init__(((struct __pyx_obj_6gevent_6_queue_JoinableQueue *)__pyx_v_self), __pyx_v_maxsize, __pyx_v_items, __pyx_v_unfinished_tasks);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_6_queue_13JoinableQueue___init__(struct __pyx_obj_6gevent_6_queue_JoinableQueue *__pyx_v_self, PyObject *__pyx_v_maxsize, PyObject *__pyx_v_items, PyObject *__pyx_v_unfinished_tasks) {
+  PyObject *__pyx_v_Event = NULL;
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = 0;
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_AddTraceback("gevent._queue.JoinableQueue.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = -1;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_Event);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
 486:         """
+
 487: 
+
 488:         .. versionchanged:: 1.1a1
+
 489:            If *unfinished_tasks* is not given, then all the given *items*
+
 490:            (if any) will be considered unfinished.
+
 491: 
+
 492:         """
+
+493:         Queue.__init__(self, maxsize, items, _warn_depth=3)
+
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_6gevent_6_queue_Queue), __pyx_n_s_init); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 493, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 493, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(((PyObject *)__pyx_v_self));
+  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
+  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self));
+  __Pyx_INCREF(__pyx_v_maxsize);
+  __Pyx_GIVEREF(__pyx_v_maxsize);
+  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_maxsize);
+  __Pyx_INCREF(__pyx_v_items);
+  __Pyx_GIVEREF(__pyx_v_items);
+  PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_items);
+  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 493, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_warn_depth, __pyx_int_3) < 0) __PYX_ERR(0, 493, __pyx_L1_error)
+  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 493, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_4);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+
 494: 
+
+495:         from gevent.event import Event
+
  __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 495, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_4);
+  __Pyx_INCREF(__pyx_n_s_Event);
+  __Pyx_GIVEREF(__pyx_n_s_Event);
+  PyList_SET_ITEM(__pyx_t_4, 0, __pyx_n_s_Event);
+  __pyx_t_3 = __Pyx_Import(__pyx_n_s_gevent_event, __pyx_t_4, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 495, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_Event); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 495, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_4);
+  __Pyx_INCREF(__pyx_t_4);
+  __pyx_v_Event = __pyx_t_4;
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+
+496:         self._cond = Event()
+
  __Pyx_INCREF(__pyx_v_Event);
+  __pyx_t_4 = __pyx_v_Event; __pyx_t_2 = NULL;
+  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
+    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
+    if (likely(__pyx_t_2)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
+      __Pyx_INCREF(__pyx_t_2);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_4, function);
+    }
+  }
+  __pyx_t_3 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 496, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_6gevent_6_event_Event))))) __PYX_ERR(0, 496, __pyx_L1_error)
+  __Pyx_GIVEREF(__pyx_t_3);
+  __Pyx_GOTREF(__pyx_v_self->_cond);
+  __Pyx_DECREF(((PyObject *)__pyx_v_self->_cond));
+  __pyx_v_self->_cond = ((struct __pyx_obj_6gevent_6_event_Event *)__pyx_t_3);
+  __pyx_t_3 = 0;
+
+497:         self._cond.set()
+
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->_cond), __pyx_n_s_set); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 497, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_4);
+  __pyx_t_2 = NULL;
+  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
+    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
+    if (likely(__pyx_t_2)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
+      __Pyx_INCREF(__pyx_t_2);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_4, function);
+    }
+  }
+  __pyx_t_3 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 497, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+
 498: 
+
+499:         if unfinished_tasks:
+
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_unfinished_tasks); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 499, __pyx_L1_error)
+  if (__pyx_t_5) {
+/* … */
+    goto __pyx_L3;
+  }
+
+500:             self.unfinished_tasks = unfinished_tasks
+
    __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_v_unfinished_tasks); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 500, __pyx_L1_error)
+    __pyx_v_self->unfinished_tasks = __pyx_t_6;
+
+501:         elif items:
+
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_items); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 501, __pyx_L1_error)
+  if (__pyx_t_5) {
+/* … */
+    goto __pyx_L3;
+  }
+
+502:             self.unfinished_tasks = len(items)
+
    __pyx_t_7 = PyObject_Length(__pyx_v_items); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 502, __pyx_L1_error)
+    __pyx_v_self->unfinished_tasks = __pyx_t_7;
+
 503:         else:
+
+504:             self.unfinished_tasks = 0
+
  /*else*/ {
+    __pyx_v_self->unfinished_tasks = 0;
+  }
+  __pyx_L3:;
+
 505: 
+
+506:         if self.unfinished_tasks:
+
  __pyx_t_5 = (__pyx_v_self->unfinished_tasks != 0);
+  if (__pyx_t_5) {
+/* … */
+  }
+
+507:             self._cond.clear()
+
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->_cond), __pyx_n_s_clear); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 507, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    __pyx_t_2 = NULL;
+    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
+      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
+      if (likely(__pyx_t_2)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
+        __Pyx_INCREF(__pyx_t_2);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_4, function);
+      }
+    }
+    __pyx_t_3 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
+    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 507, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+
 508: 
+
+509:     def copy(self):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_queue_13JoinableQueue_3copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6gevent_6_queue_13JoinableQueue_2copy[] = "JoinableQueue.copy(self)";
+static PyMethodDef __pyx_mdef_6gevent_6_queue_13JoinableQueue_3copy = {"copy", (PyCFunction)__pyx_pw_6gevent_6_queue_13JoinableQueue_3copy, METH_NOARGS, __pyx_doc_6gevent_6_queue_13JoinableQueue_2copy};
+static PyObject *__pyx_pw_6gevent_6_queue_13JoinableQueue_3copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("copy (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_6_queue_13JoinableQueue_2copy(((struct __pyx_obj_6gevent_6_queue_JoinableQueue *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_queue_13JoinableQueue_2copy(struct __pyx_obj_6gevent_6_queue_JoinableQueue *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("copy", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_XDECREF(__pyx_t_7);
+  __Pyx_AddTraceback("gevent._queue.JoinableQueue.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__60 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__60)) __PYX_ERR(0, 509, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__60);
+  __Pyx_GIVEREF(__pyx_tuple__60);
+/* … */
+  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_queue_13JoinableQueue_3copy, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_JoinableQueue_copy, NULL, __pyx_n_s_gevent__queue, __pyx_d, ((PyObject *)__pyx_codeobj__61)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 509, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_JoinableQueue->tp_dict, __pyx_n_s_copy, __pyx_t_6) < 0) __PYX_ERR(0, 509, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_6_queue_JoinableQueue);
+  __pyx_codeobj__61 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__60, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_queue_py, __pyx_n_s_copy, 509, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__61)) __PYX_ERR(0, 509, __pyx_L1_error)
+
+510:         return type(self)(self.maxsize, self.queue, self.unfinished_tasks)
+
  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_maxsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 510, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->unfinished_tasks); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 510, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
+  __pyx_t_4 = ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))); __pyx_t_5 = NULL;
+  __pyx_t_6 = 0;
+  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
+    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
+    if (likely(__pyx_t_5)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
+      __Pyx_INCREF(__pyx_t_5);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_4, function);
+      __pyx_t_6 = 1;
+    }
+  }
+  #if CYTHON_FAST_PYCALL
+  if (PyFunction_Check(__pyx_t_4)) {
+    PyObject *__pyx_temp[4] = {__pyx_t_5, __pyx_t_2, __pyx_v_self->__pyx_base.queue, __pyx_t_3};
+    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 510, __pyx_L1_error)
+    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  } else
+  #endif
+  #if CYTHON_FAST_PYCCALL
+  if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
+    PyObject *__pyx_temp[4] = {__pyx_t_5, __pyx_t_2, __pyx_v_self->__pyx_base.queue, __pyx_t_3};
+    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 510, __pyx_L1_error)
+    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  } else
+  #endif
+  {
+    __pyx_t_7 = PyTuple_New(3+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 510, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_7);
+    if (__pyx_t_5) {
+      __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
+    }
+    __Pyx_GIVEREF(__pyx_t_2);
+    PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_t_2);
+    __Pyx_INCREF(__pyx_v_self->__pyx_base.queue);
+    __Pyx_GIVEREF(__pyx_v_self->__pyx_base.queue);
+    PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_self->__pyx_base.queue);
+    __Pyx_GIVEREF(__pyx_t_3);
+    PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_6, __pyx_t_3);
+    __pyx_t_2 = 0;
+    __pyx_t_3 = 0;
+    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 510, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  }
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
 511: 
+
+512:     def _format(self):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_queue_13JoinableQueue_5_format(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6gevent_6_queue_13JoinableQueue_4_format[] = "JoinableQueue._format(self)";
+static PyMethodDef __pyx_mdef_6gevent_6_queue_13JoinableQueue_5_format = {"_format", (PyCFunction)__pyx_pw_6gevent_6_queue_13JoinableQueue_5_format, METH_NOARGS, __pyx_doc_6gevent_6_queue_13JoinableQueue_4_format};
+static PyObject *__pyx_pw_6gevent_6_queue_13JoinableQueue_5_format(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_format (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_6_queue_13JoinableQueue_4_format(((struct __pyx_obj_6gevent_6_queue_JoinableQueue *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_queue_13JoinableQueue_4_format(struct __pyx_obj_6gevent_6_queue_JoinableQueue *__pyx_v_self) {
+  PyObject *__pyx_v_result = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_format", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_AddTraceback("gevent._queue.JoinableQueue._format", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_result);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__62 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_result); if (unlikely(!__pyx_tuple__62)) __PYX_ERR(0, 512, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__62);
+  __Pyx_GIVEREF(__pyx_tuple__62);
+/* … */
+  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_queue_13JoinableQueue_5_format, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_JoinableQueue__format, NULL, __pyx_n_s_gevent__queue, __pyx_d, ((PyObject *)__pyx_codeobj__63)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 512, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_JoinableQueue->tp_dict, __pyx_n_s_format, __pyx_t_6) < 0) __PYX_ERR(0, 512, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_6_queue_JoinableQueue);
+  __pyx_codeobj__63 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__62, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_queue_py, __pyx_n_s_format, 512, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__63)) __PYX_ERR(0, 512, __pyx_L1_error)
+
+513:         result = Queue._format(self)
+
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_6gevent_6_queue_Queue), __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 513, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = NULL;
+  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+    if (likely(__pyx_t_3)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+      __Pyx_INCREF(__pyx_t_3);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_2, function);
+    }
+  }
+  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, ((PyObject *)__pyx_v_self)) : __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_v_self));
+  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 513, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_v_result = __pyx_t_1;
+  __pyx_t_1 = 0;
+
+514:         if self.unfinished_tasks:
+
  __pyx_t_4 = (__pyx_v_self->unfinished_tasks != 0);
+  if (__pyx_t_4) {
+/* … */
+  }
+
+515:             result += ' tasks=%s _cond=%s' % (self.unfinished_tasks, self._cond)
+
    __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->unfinished_tasks); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 515, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 515, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_GIVEREF(__pyx_t_1);
+    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
+    __Pyx_INCREF(((PyObject *)__pyx_v_self->_cond));
+    __Pyx_GIVEREF(((PyObject *)__pyx_v_self->_cond));
+    PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_self->_cond));
+    __pyx_t_1 = 0;
+    __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_tasks_s__cond_s, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 515, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 515, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_2);
+    __pyx_t_2 = 0;
+
+516:         return result
+
  __Pyx_XDECREF(__pyx_r);
+  __Pyx_INCREF(__pyx_v_result);
+  __pyx_r = __pyx_v_result;
+  goto __pyx_L0;
+
 517: 
+
+518:     def _put(self, item):
+
static PyObject *__pyx_pw_6gevent_6_queue_13JoinableQueue_7_put(PyObject *__pyx_v_self, PyObject *__pyx_v_item); /*proto*/
+static PyObject *__pyx_f_6gevent_6_queue_13JoinableQueue__put(struct __pyx_obj_6gevent_6_queue_JoinableQueue *__pyx_v_self, PyObject *__pyx_v_item, int __pyx_skip_dispatch) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_put", 0);
+  /* Check if called by wrapper */
+  if (unlikely(__pyx_skip_dispatch)) ;
+  /* Check if overridden in Python */
+  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
+    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
+    if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
+    else {
+      PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      #endif
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_put); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 518, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_6_queue_13JoinableQueue_7_put)) {
+        __Pyx_XDECREF(__pyx_r);
+        __Pyx_INCREF(__pyx_t_1);
+        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+          if (likely(__pyx_t_4)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+            __Pyx_INCREF(__pyx_t_4);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_3, function);
+          }
+        }
+        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_item) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_item);
+        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 518, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __pyx_r = __pyx_t_2;
+        __pyx_t_2 = 0;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        goto __pyx_L0;
+      }
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+      tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
+      if (unlikely(type_dict_guard != tp_dict_version)) {
+        tp_dict_version = obj_dict_version = 0;
+      }
+      #endif
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    }
+    #endif
+  }
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_AddTraceback("gevent._queue.JoinableQueue._put", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_queue_13JoinableQueue_7_put(PyObject *__pyx_v_self, PyObject *__pyx_v_item); /*proto*/
+static char __pyx_doc_6gevent_6_queue_13JoinableQueue_6_put[] = "JoinableQueue._put(self, item)";
+static PyMethodDef __pyx_mdef_6gevent_6_queue_13JoinableQueue_7_put = {"_put", (PyCFunction)__pyx_pw_6gevent_6_queue_13JoinableQueue_7_put, METH_O, __pyx_doc_6gevent_6_queue_13JoinableQueue_6_put};
+static PyObject *__pyx_pw_6gevent_6_queue_13JoinableQueue_7_put(PyObject *__pyx_v_self, PyObject *__pyx_v_item) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_put (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_6_queue_13JoinableQueue_6_put(((struct __pyx_obj_6gevent_6_queue_JoinableQueue *)__pyx_v_self), ((PyObject *)__pyx_v_item));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_queue_13JoinableQueue_6_put(struct __pyx_obj_6gevent_6_queue_JoinableQueue *__pyx_v_self, PyObject *__pyx_v_item) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_put", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __pyx_f_6gevent_6_queue_13JoinableQueue__put(__pyx_v_self, __pyx_v_item, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 518, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent._queue.JoinableQueue._put", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__64 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_item); if (unlikely(!__pyx_tuple__64)) __PYX_ERR(0, 518, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__64);
+  __Pyx_GIVEREF(__pyx_tuple__64);
+/* … */
+  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_queue_13JoinableQueue_7_put, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_JoinableQueue__put, NULL, __pyx_n_s_gevent__queue, __pyx_d, ((PyObject *)__pyx_codeobj__65)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 518, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_JoinableQueue->tp_dict, __pyx_n_s_put, __pyx_t_6) < 0) __PYX_ERR(0, 518, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_6_queue_JoinableQueue);
+  __pyx_codeobj__65 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__64, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_queue_py, __pyx_n_s_put, 518, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__65)) __PYX_ERR(0, 518, __pyx_L1_error)
+
+519:         Queue._put(self, item)
+
  __pyx_t_1 = __pyx_f_6gevent_6_queue_5Queue__put(((struct __pyx_obj_6gevent_6_queue_Queue *)__pyx_v_self), __pyx_v_item, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 519, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+520:         self.unfinished_tasks += 1
+
  __pyx_v_self->unfinished_tasks = (__pyx_v_self->unfinished_tasks + 1);
+
+521:         self._cond.clear()
+
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->_cond), __pyx_n_s_clear); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 521, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = NULL;
+  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+    if (likely(__pyx_t_3)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+      __Pyx_INCREF(__pyx_t_3);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_2, function);
+    }
+  }
+  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 521, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 522: 
+
+523:     def task_done(self):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_queue_13JoinableQueue_9task_done(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6gevent_6_queue_13JoinableQueue_8task_done[] = "JoinableQueue.task_done(self)\nIndicate that a formerly enqueued task is complete. Used by queue consumer threads.\n        For each :meth:`get <Queue.get>` used to fetch a task, a subsequent call to :meth:`task_done` tells the queue\n        that the processing on the task is complete.\n\n        If a :meth:`join` is currently blocking, it will resume when all items have been processed\n        (meaning that a :meth:`task_done` call was received for every item that had been\n        :meth:`put <Queue.put>` into the queue).\n\n        Raises a :exc:`ValueError` if called more times than there were items placed in the queue.\n        ";
+static PyMethodDef __pyx_mdef_6gevent_6_queue_13JoinableQueue_9task_done = {"task_done", (PyCFunction)__pyx_pw_6gevent_6_queue_13JoinableQueue_9task_done, METH_NOARGS, __pyx_doc_6gevent_6_queue_13JoinableQueue_8task_done};
+static PyObject *__pyx_pw_6gevent_6_queue_13JoinableQueue_9task_done(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("task_done (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_6_queue_13JoinableQueue_8task_done(((struct __pyx_obj_6gevent_6_queue_JoinableQueue *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_queue_13JoinableQueue_8task_done(struct __pyx_obj_6gevent_6_queue_JoinableQueue *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("task_done", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_AddTraceback("gevent._queue.JoinableQueue.task_done", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__66 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__66)) __PYX_ERR(0, 523, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__66);
+  __Pyx_GIVEREF(__pyx_tuple__66);
+/* … */
+  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_queue_13JoinableQueue_9task_done, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_JoinableQueue_task_done, NULL, __pyx_n_s_gevent__queue, __pyx_d, ((PyObject *)__pyx_codeobj__67)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 523, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_JoinableQueue->tp_dict, __pyx_n_s_task_done, __pyx_t_6) < 0) __PYX_ERR(0, 523, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_6_queue_JoinableQueue);
+  __pyx_codeobj__67 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__66, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_queue_py, __pyx_n_s_task_done, 523, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__67)) __PYX_ERR(0, 523, __pyx_L1_error)
+
 524:         '''Indicate that a formerly enqueued task is complete. Used by queue consumer threads.
+
 525:         For each :meth:`get <Queue.get>` used to fetch a task, a subsequent call to :meth:`task_done` tells the queue
+
 526:         that the processing on the task is complete.
+
 527: 
+
 528:         If a :meth:`join` is currently blocking, it will resume when all items have been processed
+
 529:         (meaning that a :meth:`task_done` call was received for every item that had been
+
 530:         :meth:`put <Queue.put>` into the queue).
+
 531: 
+
 532:         Raises a :exc:`ValueError` if called more times than there were items placed in the queue.
+
 533:         '''
+
+534:         if self.unfinished_tasks <= 0:
+
  __pyx_t_1 = ((__pyx_v_self->unfinished_tasks <= 0) != 0);
+  if (unlikely(__pyx_t_1)) {
+/* … */
+  }
+
+535:             raise ValueError('task_done() called too many times')
+
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 535, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __PYX_ERR(0, 535, __pyx_L1_error)
+/* … */
+  __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_s_task_done_called_too_many_times); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 535, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__5);
+  __Pyx_GIVEREF(__pyx_tuple__5);
+
+536:         self.unfinished_tasks -= 1
+
  __pyx_v_self->unfinished_tasks = (__pyx_v_self->unfinished_tasks - 1);
+
+537:         if self.unfinished_tasks == 0:
+
  __pyx_t_1 = ((__pyx_v_self->unfinished_tasks == 0) != 0);
+  if (__pyx_t_1) {
+/* … */
+  }
+
+538:             self._cond.set()
+
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->_cond), __pyx_n_s_set); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 538, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __pyx_t_4 = NULL;
+    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
+      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+      if (likely(__pyx_t_4)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+        __Pyx_INCREF(__pyx_t_4);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_3, function);
+      }
+    }
+    __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
+    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 538, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
 539: 
+
+540:     def join(self, timeout=None):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_queue_13JoinableQueue_11join(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_6gevent_6_queue_13JoinableQueue_10join[] = "JoinableQueue.join(self, timeout=None)\n\n        Block until all items in the queue have been gotten and processed.\n\n        The count of unfinished tasks goes up whenever an item is added to the queue.\n        The count goes down whenever a consumer thread calls :meth:`task_done` to indicate\n        that the item was retrieved and all work on it is complete. When the count of\n        unfinished tasks drops to zero, :meth:`join` unblocks.\n\n        :param float timeout: If not ``None``, then wait no more than this time in seconds\n            for all tasks to finish.\n        :return: ``True`` if all tasks have finished; if ``timeout`` was given and expired before\n            all tasks finished, ``False``.\n\n        .. versionchanged:: 1.1a1\n           Add the *timeout* parameter.\n        ";
+static PyMethodDef __pyx_mdef_6gevent_6_queue_13JoinableQueue_11join = {"join", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_6_queue_13JoinableQueue_11join, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_6_queue_13JoinableQueue_10join};
+static PyObject *__pyx_pw_6gevent_6_queue_13JoinableQueue_11join(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_timeout = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("join (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_timeout,0};
+    PyObject* values[1] = {0};
+    values[0] = ((PyObject *)Py_None);
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_timeout);
+          if (value) { values[0] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "join") < 0)) __PYX_ERR(0, 540, __pyx_L3_error)
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    __pyx_v_timeout = values[0];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("join", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 540, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent._queue.JoinableQueue.join", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_6_queue_13JoinableQueue_10join(((struct __pyx_obj_6gevent_6_queue_JoinableQueue *)__pyx_v_self), __pyx_v_timeout);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_queue_13JoinableQueue_10join(struct __pyx_obj_6gevent_6_queue_JoinableQueue *__pyx_v_self, PyObject *__pyx_v_timeout) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("join", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_AddTraceback("gevent._queue.JoinableQueue.join", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__68 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_timeout); if (unlikely(!__pyx_tuple__68)) __PYX_ERR(0, 540, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__68);
+  __Pyx_GIVEREF(__pyx_tuple__68);
+/* … */
+  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_queue_13JoinableQueue_11join, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_JoinableQueue_join, NULL, __pyx_n_s_gevent__queue, __pyx_d, ((PyObject *)__pyx_codeobj__69)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 540, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_JoinableQueue->tp_dict, __pyx_n_s_join, __pyx_t_6) < 0) __PYX_ERR(0, 540, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_6_queue_JoinableQueue);
+  __pyx_codeobj__69 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__68, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_queue_py, __pyx_n_s_join, 540, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__69)) __PYX_ERR(0, 540, __pyx_L1_error)
+
 541:         '''
+
 542:         Block until all items in the queue have been gotten and processed.
+
 543: 
+
 544:         The count of unfinished tasks goes up whenever an item is added to the queue.
+
 545:         The count goes down whenever a consumer thread calls :meth:`task_done` to indicate
+
 546:         that the item was retrieved and all work on it is complete. When the count of
+
 547:         unfinished tasks drops to zero, :meth:`join` unblocks.
+
 548: 
+
 549:         :param float timeout: If not ``None``, then wait no more than this time in seconds
+
 550:             for all tasks to finish.
+
 551:         :return: ``True`` if all tasks have finished; if ``timeout`` was given and expired before
+
 552:             all tasks finished, ``False``.
+
 553: 
+
 554:         .. versionchanged:: 1.1a1
+
 555:            Add the *timeout* parameter.
+
 556:         '''
+
+557:         return self._cond.wait(timeout=timeout)
+
  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->_cond), __pyx_n_s_wait); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 557, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 557, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_timeout, __pyx_v_timeout) < 0) __PYX_ERR(0, 557, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 557, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_r = __pyx_t_3;
+  __pyx_t_3 = 0;
+  goto __pyx_L0;
+
 558: 
+
 559: 
+
+560: class Channel(object):
+
struct __pyx_vtabstruct_6gevent_6_queue_Channel {
+  PyObject *(*get)(struct __pyx_obj_6gevent_6_queue_Channel *, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_6_queue_7Channel_get *__pyx_optional_args);
+  PyObject *(*get_nowait)(struct __pyx_obj_6gevent_6_queue_Channel *, int __pyx_skip_dispatch);
+  PyObject *(*_schedule_unlock)(struct __pyx_obj_6gevent_6_queue_Channel *);
+};
+static struct __pyx_vtabstruct_6gevent_6_queue_Channel *__pyx_vtabptr_6gevent_6_queue_Channel;
+
 561: 
+
 562:     __slots__ = (
+
+563:         'getters',
+
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_Channel->tp_dict, __pyx_n_s_slots, __pyx_tuple__70) < 0) __PYX_ERR(0, 562, __pyx_L1_error)
+  PyType_Modified(__pyx_ptype_6gevent_6_queue_Channel);
+/* … */
+  __pyx_tuple__70 = PyTuple_Pack(5, __pyx_n_s_getters, __pyx_n_s_putters, __pyx_n_s_hub, __pyx_n_s_event_unlock, __pyx_n_s_weakref); if (unlikely(!__pyx_tuple__70)) __PYX_ERR(0, 563, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__70);
+  __Pyx_GIVEREF(__pyx_tuple__70);
+
 564:         'putters',
+
 565:         'hub',
+
 566:         '_event_unlock',
+
 567:         '__weakref__',
+
 568:     )
+
 569: 
+
+570:     def __init__(self, maxsize=1):
+
/* Python wrapper */
+static int __pyx_pw_6gevent_6_queue_7Channel_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static int __pyx_pw_6gevent_6_queue_7Channel_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_maxsize = 0;
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_maxsize,0};
+    PyObject* values[1] = {0};
+    values[0] = ((PyObject *)__pyx_int_1);
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_maxsize);
+          if (value) { values[0] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 570, __pyx_L3_error)
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    __pyx_v_maxsize = values[0];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 570, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent._queue.Channel.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return -1;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_6_queue_7Channel___init__(((struct __pyx_obj_6gevent_6_queue_Channel *)__pyx_v_self), __pyx_v_maxsize);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_6_queue_7Channel___init__(struct __pyx_obj_6gevent_6_queue_Channel *__pyx_v_self, PyObject *__pyx_v_maxsize) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = 0;
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_AddTraceback("gevent._queue.Channel.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = -1;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
 571:         # We take maxsize to simplify certain kinds of code
+
+572:         if maxsize != 1:
+
  __pyx_t_1 = __Pyx_PyInt_NeObjC(__pyx_v_maxsize, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 572, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 572, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  if (unlikely(__pyx_t_2)) {
+/* … */
+  }
+
+573:             raise ValueError("Channels have a maxsize of 1")
+
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 573, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __PYX_ERR(0, 573, __pyx_L1_error)
+/* … */
+  __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_s_Channels_have_a_maxsize_of_1); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 573, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__6);
+  __Pyx_GIVEREF(__pyx_tuple__6);
+
+574:         self.getters = collections.deque()
+
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_collections); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 574, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_deque); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 574, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_4);
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __pyx_t_3 = NULL;
+  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
+    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
+    if (likely(__pyx_t_3)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
+      __Pyx_INCREF(__pyx_t_3);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_4, function);
+    }
+  }
+  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 574, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __Pyx_GIVEREF(__pyx_t_1);
+  __Pyx_GOTREF(__pyx_v_self->getters);
+  __Pyx_DECREF(__pyx_v_self->getters);
+  __pyx_v_self->getters = __pyx_t_1;
+  __pyx_t_1 = 0;
+
+575:         self.putters = collections.deque()
+
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_collections); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 575, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_4);
+  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_deque); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 575, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __pyx_t_4 = NULL;
+  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+    if (likely(__pyx_t_4)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+      __Pyx_INCREF(__pyx_t_4);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_3, function);
+    }
+  }
+  __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 575, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __Pyx_GIVEREF(__pyx_t_1);
+  __Pyx_GOTREF(__pyx_v_self->putters);
+  __Pyx_DECREF(__pyx_v_self->putters);
+  __pyx_v_self->putters = __pyx_t_1;
+  __pyx_t_1 = 0;
+
+576:         self.hub = get_hub()
+
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_get_hub); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 576, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __pyx_t_4 = NULL;
+  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+    if (likely(__pyx_t_4)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+      __Pyx_INCREF(__pyx_t_4);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_3, function);
+    }
+  }
+  __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 576, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __Pyx_GIVEREF(__pyx_t_1);
+  __Pyx_GOTREF(__pyx_v_self->hub);
+  __Pyx_DECREF(__pyx_v_self->hub);
+  __pyx_v_self->hub = __pyx_t_1;
+  __pyx_t_1 = 0;
+
+577:         self._event_unlock = None
+
  __Pyx_INCREF(Py_None);
+  __Pyx_GIVEREF(Py_None);
+  __Pyx_GOTREF(__pyx_v_self->_event_unlock);
+  __Pyx_DECREF(__pyx_v_self->_event_unlock);
+  __pyx_v_self->_event_unlock = Py_None;
+
 578: 
+
+579:     def __repr__(self):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_queue_7Channel_3__repr__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_6_queue_7Channel_3__repr__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_6_queue_7Channel_2__repr__(((struct __pyx_obj_6gevent_6_queue_Channel *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_queue_7Channel_2__repr__(struct __pyx_obj_6gevent_6_queue_Channel *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__repr__", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_AddTraceback("gevent._queue.Channel.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+580:         return '<%s at %s %s>' % (type(self).__name__, hex(id(self)), self._format())
+
  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))), __pyx_n_s_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 580, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 580, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_hex, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 580, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 580, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_4);
+  __pyx_t_5 = NULL;
+  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
+    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
+    if (likely(__pyx_t_5)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
+      __Pyx_INCREF(__pyx_t_5);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_4, function);
+    }
+  }
+  __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 580, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 580, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_4);
+  __Pyx_GIVEREF(__pyx_t_1);
+  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_3);
+  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
+  __Pyx_GIVEREF(__pyx_t_2);
+  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_2);
+  __pyx_t_1 = 0;
+  __pyx_t_3 = 0;
+  __pyx_t_2 = 0;
+  __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_s_at_s_s_2, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 580, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __pyx_r = __pyx_t_2;
+  __pyx_t_2 = 0;
+  goto __pyx_L0;
+
 581: 
+
+582:     def __str__(self):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_queue_7Channel_5__str__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_6_queue_7Channel_5__str__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_6_queue_7Channel_4__str__(((struct __pyx_obj_6gevent_6_queue_Channel *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_queue_7Channel_4__str__(struct __pyx_obj_6gevent_6_queue_Channel *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__str__", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_AddTraceback("gevent._queue.Channel.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+583:         return '<%s %s>' % (type(self).__name__, self._format())
+
  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))), __pyx_n_s_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 583, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 583, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __pyx_t_4 = NULL;
+  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
+    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+    if (likely(__pyx_t_4)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+      __Pyx_INCREF(__pyx_t_4);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_3, function);
+    }
+  }
+  __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 583, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 583, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_GIVEREF(__pyx_t_1);
+  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_2);
+  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
+  __pyx_t_1 = 0;
+  __pyx_t_2 = 0;
+  __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_s_s_2, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 583, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __pyx_r = __pyx_t_2;
+  __pyx_t_2 = 0;
+  goto __pyx_L0;
+
 584: 
+
+585:     def _format(self):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_queue_7Channel_7_format(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6gevent_6_queue_7Channel_6_format[] = "Channel._format(self)";
+static PyMethodDef __pyx_mdef_6gevent_6_queue_7Channel_7_format = {"_format", (PyCFunction)__pyx_pw_6gevent_6_queue_7Channel_7_format, METH_NOARGS, __pyx_doc_6gevent_6_queue_7Channel_6_format};
+static PyObject *__pyx_pw_6gevent_6_queue_7Channel_7_format(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_format (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_6_queue_7Channel_6_format(((struct __pyx_obj_6gevent_6_queue_Channel *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_queue_7Channel_6_format(struct __pyx_obj_6gevent_6_queue_Channel *__pyx_v_self) {
+  PyObject *__pyx_v_result = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_format", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_AddTraceback("gevent._queue.Channel._format", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_result);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__71 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_result); if (unlikely(!__pyx_tuple__71)) __PYX_ERR(0, 585, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__71);
+  __Pyx_GIVEREF(__pyx_tuple__71);
+/* … */
+  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_queue_7Channel_7_format, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Channel__format, NULL, __pyx_n_s_gevent__queue, __pyx_d, ((PyObject *)__pyx_codeobj__72)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 585, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_Channel->tp_dict, __pyx_n_s_format, __pyx_t_6) < 0) __PYX_ERR(0, 585, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_6_queue_Channel);
+  __pyx_codeobj__72 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__71, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_queue_py, __pyx_n_s_format, 585, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__72)) __PYX_ERR(0, 585, __pyx_L1_error)
+
+586:         result = ''
+
  __Pyx_INCREF(__pyx_kp_s__3);
+  __pyx_v_result = __pyx_kp_s__3;
+
+587:         if self.getters:
+
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_self->getters); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 587, __pyx_L1_error)
+  if (__pyx_t_1) {
+/* … */
+  }
+
+588:             result += ' getters[%s]' % len(self.getters)
+
    __pyx_t_2 = __pyx_v_self->getters;
+    __Pyx_INCREF(__pyx_t_2);
+    __pyx_t_3 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 588, __pyx_L1_error)
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 588, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_getters_s_2, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 588, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 588, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    if (!(likely(PyString_CheckExact(__pyx_t_2))||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(0, 588, __pyx_L1_error)
+    __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_2));
+    __pyx_t_2 = 0;
+
+589:         if self.putters:
+
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_self->putters); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 589, __pyx_L1_error)
+  if (__pyx_t_1) {
+/* … */
+  }
+
+590:             result += ' putters[%s]' % len(self.putters)
+
    __pyx_t_2 = __pyx_v_self->putters;
+    __Pyx_INCREF(__pyx_t_2);
+    __pyx_t_3 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 590, __pyx_L1_error)
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 590, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_putters_s_2, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 590, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 590, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    if (!(likely(PyString_CheckExact(__pyx_t_2))||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(0, 590, __pyx_L1_error)
+    __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_2));
+    __pyx_t_2 = 0;
+
+591:         return result
+
  __Pyx_XDECREF(__pyx_r);
+  __Pyx_INCREF(__pyx_v_result);
+  __pyx_r = __pyx_v_result;
+  goto __pyx_L0;
+
 592: 
+
 593:     @property
+
+594:     def balance(self):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_queue_7Channel_7balance_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_6_queue_7Channel_7balance_1__get__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_6_queue_7Channel_7balance___get__(((struct __pyx_obj_6gevent_6_queue_Channel *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_queue_7Channel_7balance___get__(struct __pyx_obj_6gevent_6_queue_Channel *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent._queue.Channel.balance.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+595:         return len(self.putters) - len(self.getters)
+
  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __pyx_v_self->putters;
+  __Pyx_INCREF(__pyx_t_1);
+  __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 595, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_1 = __pyx_v_self->getters;
+  __Pyx_INCREF(__pyx_t_1);
+  __pyx_t_3 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 595, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_1 = PyInt_FromSsize_t((__pyx_t_2 - __pyx_t_3)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 595, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
 596: 
+
+597:     def qsize(self):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_queue_7Channel_9qsize(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6gevent_6_queue_7Channel_8qsize[] = "Channel.qsize(self)";
+static PyMethodDef __pyx_mdef_6gevent_6_queue_7Channel_9qsize = {"qsize", (PyCFunction)__pyx_pw_6gevent_6_queue_7Channel_9qsize, METH_NOARGS, __pyx_doc_6gevent_6_queue_7Channel_8qsize};
+static PyObject *__pyx_pw_6gevent_6_queue_7Channel_9qsize(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("qsize (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_6_queue_7Channel_8qsize(((struct __pyx_obj_6gevent_6_queue_Channel *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_queue_7Channel_8qsize(CYTHON_UNUSED struct __pyx_obj_6gevent_6_queue_Channel *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("qsize", 0);
+/* … */
+  /* function exit code */
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__73 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__73)) __PYX_ERR(0, 597, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__73);
+  __Pyx_GIVEREF(__pyx_tuple__73);
+/* … */
+  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_queue_7Channel_9qsize, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Channel_qsize, NULL, __pyx_n_s_gevent__queue, __pyx_d, ((PyObject *)__pyx_codeobj__74)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 597, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_Channel->tp_dict, __pyx_n_s_qsize, __pyx_t_6) < 0) __PYX_ERR(0, 597, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_6_queue_Channel);
+  __pyx_codeobj__74 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__73, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_queue_py, __pyx_n_s_qsize, 597, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__74)) __PYX_ERR(0, 597, __pyx_L1_error)
+
+598:         return 0
+
  __Pyx_XDECREF(__pyx_r);
+  __Pyx_INCREF(__pyx_int_0);
+  __pyx_r = __pyx_int_0;
+  goto __pyx_L0;
+
 599: 
+
+600:     def empty(self):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_queue_7Channel_11empty(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6gevent_6_queue_7Channel_10empty[] = "Channel.empty(self)";
+static PyMethodDef __pyx_mdef_6gevent_6_queue_7Channel_11empty = {"empty", (PyCFunction)__pyx_pw_6gevent_6_queue_7Channel_11empty, METH_NOARGS, __pyx_doc_6gevent_6_queue_7Channel_10empty};
+static PyObject *__pyx_pw_6gevent_6_queue_7Channel_11empty(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("empty (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_6_queue_7Channel_10empty(((struct __pyx_obj_6gevent_6_queue_Channel *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_queue_7Channel_10empty(CYTHON_UNUSED struct __pyx_obj_6gevent_6_queue_Channel *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("empty", 0);
+/* … */
+  /* function exit code */
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__75 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__75)) __PYX_ERR(0, 600, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__75);
+  __Pyx_GIVEREF(__pyx_tuple__75);
+/* … */
+  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_queue_7Channel_11empty, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Channel_empty, NULL, __pyx_n_s_gevent__queue, __pyx_d, ((PyObject *)__pyx_codeobj__76)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 600, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_Channel->tp_dict, __pyx_n_s_empty, __pyx_t_6) < 0) __PYX_ERR(0, 600, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_6_queue_Channel);
+  __pyx_codeobj__76 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__75, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_queue_py, __pyx_n_s_empty, 600, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__76)) __PYX_ERR(0, 600, __pyx_L1_error)
+
+601:         return True
+
  __Pyx_XDECREF(__pyx_r);
+  __Pyx_INCREF(Py_True);
+  __pyx_r = Py_True;
+  goto __pyx_L0;
+
 602: 
+
+603:     def full(self):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_queue_7Channel_13full(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6gevent_6_queue_7Channel_12full[] = "Channel.full(self)";
+static PyMethodDef __pyx_mdef_6gevent_6_queue_7Channel_13full = {"full", (PyCFunction)__pyx_pw_6gevent_6_queue_7Channel_13full, METH_NOARGS, __pyx_doc_6gevent_6_queue_7Channel_12full};
+static PyObject *__pyx_pw_6gevent_6_queue_7Channel_13full(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("full (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_6_queue_7Channel_12full(((struct __pyx_obj_6gevent_6_queue_Channel *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_queue_7Channel_12full(CYTHON_UNUSED struct __pyx_obj_6gevent_6_queue_Channel *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("full", 0);
+/* … */
+  /* function exit code */
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__77 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__77)) __PYX_ERR(0, 603, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__77);
+  __Pyx_GIVEREF(__pyx_tuple__77);
+/* … */
+  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_queue_7Channel_13full, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Channel_full, NULL, __pyx_n_s_gevent__queue, __pyx_d, ((PyObject *)__pyx_codeobj__78)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 603, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_Channel->tp_dict, __pyx_n_s_full, __pyx_t_6) < 0) __PYX_ERR(0, 603, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_6_queue_Channel);
+  __pyx_codeobj__78 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__77, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_queue_py, __pyx_n_s_full, 603, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__78)) __PYX_ERR(0, 603, __pyx_L1_error)
+
+604:         return True
+
  __Pyx_XDECREF(__pyx_r);
+  __Pyx_INCREF(Py_True);
+  __pyx_r = Py_True;
+  goto __pyx_L0;
+
 605: 
+
+606:     def put(self, item, block=True, timeout=None):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_queue_7Channel_15put(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_6gevent_6_queue_7Channel_14put[] = "Channel.put(self, item, block=True, timeout=None)";
+static PyMethodDef __pyx_mdef_6gevent_6_queue_7Channel_15put = {"put", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_6_queue_7Channel_15put, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_6_queue_7Channel_14put};
+static PyObject *__pyx_pw_6gevent_6_queue_7Channel_15put(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_item = 0;
+  PyObject *__pyx_v_block = 0;
+  PyObject *__pyx_v_timeout = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("put (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_item,&__pyx_n_s_block,&__pyx_n_s_timeout,0};
+    PyObject* values[3] = {0,0,0};
+    values[1] = ((PyObject *)Py_True);
+    values[2] = ((PyObject *)Py_None);
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_item)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_block);
+          if (value) { values[1] = value; kw_args--; }
+        }
+        CYTHON_FALLTHROUGH;
+        case  2:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_timeout);
+          if (value) { values[2] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "put") < 0)) __PYX_ERR(0, 606, __pyx_L3_error)
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    __pyx_v_item = values[0];
+    __pyx_v_block = values[1];
+    __pyx_v_timeout = values[2];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("put", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 606, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent._queue.Channel.put", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_6_queue_7Channel_14put(((struct __pyx_obj_6gevent_6_queue_Channel *)__pyx_v_self), __pyx_v_item, __pyx_v_block, __pyx_v_timeout);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_queue_7Channel_14put(struct __pyx_obj_6gevent_6_queue_Channel *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_block, PyObject *__pyx_v_timeout) {
+  PyObject *__pyx_v_getter = NULL;
+  struct __pyx_obj_6gevent_8__waiter_Waiter *__pyx_v_waiter = NULL;
+  PyObject *__pyx_v_result = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("put", 0);
+  __Pyx_INCREF(__pyx_v_item);
+  __Pyx_INCREF(__pyx_v_timeout);
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_7);
+  __Pyx_XDECREF(__pyx_t_9);
+  __Pyx_AddTraceback("gevent._queue.Channel.put", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_getter);
+  __Pyx_XDECREF((PyObject *)__pyx_v_waiter);
+  __Pyx_XDECREF(__pyx_v_result);
+  __Pyx_XDECREF(__pyx_v_item);
+  __Pyx_XDECREF(__pyx_v_timeout);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__79 = PyTuple_Pack(7, __pyx_n_s_self, __pyx_n_s_item, __pyx_n_s_block, __pyx_n_s_timeout, __pyx_n_s_getter, __pyx_n_s_waiter_2, __pyx_n_s_result); if (unlikely(!__pyx_tuple__79)) __PYX_ERR(0, 606, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__79);
+  __Pyx_GIVEREF(__pyx_tuple__79);
+/* … */
+  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_queue_7Channel_15put, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Channel_put, NULL, __pyx_n_s_gevent__queue, __pyx_d, ((PyObject *)__pyx_codeobj__80)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 606, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_Channel->tp_dict, __pyx_n_s_put_2, __pyx_t_6) < 0) __PYX_ERR(0, 606, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_6_queue_Channel);
+  __pyx_codeobj__80 = (PyObject*)__Pyx_PyCode_New(4, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__79, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_queue_py, __pyx_n_s_put_2, 606, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__80)) __PYX_ERR(0, 606, __pyx_L1_error)
+
+607:         if self.hub is getcurrent():
+
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_getcurrent); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 607, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = NULL;
+  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
+    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+    if (likely(__pyx_t_3)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+      __Pyx_INCREF(__pyx_t_3);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_2, function);
+    }
+  }
+  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 607, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_4 = (__pyx_v_self->hub == __pyx_t_1);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_5 = (__pyx_t_4 != 0);
+  if (__pyx_t_5) {
+/* … */
+  }
+
+608:             if self.getters:
+
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_self->getters); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 608, __pyx_L1_error)
+    if (__pyx_t_5) {
+/* … */
+    }
+
+609:                 getter = self.getters.popleft()
+
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->getters, __pyx_n_s_popleft); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 609, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_2);
+      __pyx_t_3 = NULL;
+      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+        if (likely(__pyx_t_3)) {
+          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+          __Pyx_INCREF(__pyx_t_3);
+          __Pyx_INCREF(function);
+          __Pyx_DECREF_SET(__pyx_t_2, function);
+        }
+      }
+      __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
+      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 609, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+      __pyx_v_getter = __pyx_t_1;
+      __pyx_t_1 = 0;
+
+610:                 getter.switch(item)
+
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_getter, __pyx_n_s_switch); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 610, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_2);
+      __pyx_t_3 = NULL;
+      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+        if (likely(__pyx_t_3)) {
+          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+          __Pyx_INCREF(__pyx_t_3);
+          __Pyx_INCREF(function);
+          __Pyx_DECREF_SET(__pyx_t_2, function);
+        }
+      }
+      __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_item) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_item);
+      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 610, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+611:                 return
+
      __Pyx_XDECREF(__pyx_r);
+      __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+      goto __pyx_L0;
+
+612:             raise Full
+
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Full); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 612, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __PYX_ERR(0, 612, __pyx_L1_error)
+
 613: 
+
+614:         if not block:
+
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_block); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 614, __pyx_L1_error)
+  __pyx_t_4 = ((!__pyx_t_5) != 0);
+  if (__pyx_t_4) {
+/* … */
+  }
+
+615:             timeout = 0
+
    __Pyx_INCREF(__pyx_int_0);
+    __Pyx_DECREF_SET(__pyx_v_timeout, __pyx_int_0);
+
 616: 
+
+617:         waiter = Waiter() # pylint:disable=undefined-variable
+
  __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_6gevent_8__waiter_Waiter)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 617, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_v_waiter = ((struct __pyx_obj_6gevent_8__waiter_Waiter *)__pyx_t_1);
+  __pyx_t_1 = 0;
+
+618:         item = (item, waiter)
+
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 618, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(__pyx_v_item);
+  __Pyx_GIVEREF(__pyx_v_item);
+  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_item);
+  __Pyx_INCREF(((PyObject *)__pyx_v_waiter));
+  __Pyx_GIVEREF(((PyObject *)__pyx_v_waiter));
+  PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_waiter));
+  __Pyx_DECREF_SET(__pyx_v_item, __pyx_t_1);
+  __pyx_t_1 = 0;
+
+619:         self.putters.append(item)
+
  __pyx_t_6 = __Pyx_PyObject_Append(__pyx_v_self->putters, __pyx_v_item); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 619, __pyx_L1_error)
+
+620:         timeout = Timeout._start_new_or_dummy(timeout, Full)
+
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Timeout); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 620, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_start_new_or_dummy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 620, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Full); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 620, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_7 = NULL;
+  __pyx_t_8 = 0;
+  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3);
+    if (likely(__pyx_t_7)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+      __Pyx_INCREF(__pyx_t_7);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_3, function);
+      __pyx_t_8 = 1;
+    }
+  }
+  #if CYTHON_FAST_PYCALL
+  if (PyFunction_Check(__pyx_t_3)) {
+    PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_v_timeout, __pyx_t_2};
+    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 620, __pyx_L1_error)
+    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  } else
+  #endif
+  #if CYTHON_FAST_PYCCALL
+  if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
+    PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_v_timeout, __pyx_t_2};
+    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 620, __pyx_L1_error)
+    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  } else
+  #endif
+  {
+    __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 620, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_9);
+    if (__pyx_t_7) {
+      __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
+    }
+    __Pyx_INCREF(__pyx_v_timeout);
+    __Pyx_GIVEREF(__pyx_v_timeout);
+    PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_v_timeout);
+    __Pyx_GIVEREF(__pyx_t_2);
+    PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_t_2);
+    __pyx_t_2 = 0;
+    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 620, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+  }
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __Pyx_DECREF_SET(__pyx_v_timeout, __pyx_t_1);
+  __pyx_t_1 = 0;
+
+621:         try:
+
  /*try:*/ {
+    {
+      /*try:*/ {
+/* … */
+      }
+      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
+      __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
+      __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
+      goto __pyx_L14_try_end;
+      __pyx_L9_error:;
+      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
+      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+/* … */
+      __Pyx_XGIVEREF(__pyx_t_10);
+      __Pyx_XGIVEREF(__pyx_t_11);
+      __Pyx_XGIVEREF(__pyx_t_12);
+      __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
+      goto __pyx_L7_error;
+      __pyx_L14_try_end:;
+    }
+  }
+
+622:             if self.getters:
+
        __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_self->getters); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 622, __pyx_L9_error)
+        if (__pyx_t_4) {
+/* … */
+        }
+
+623:                 self._schedule_unlock()
+
          __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_6_queue_Channel *)__pyx_v_self->__pyx_vtab)->_schedule_unlock(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 623, __pyx_L9_error)
+          __Pyx_GOTREF(__pyx_t_1);
+          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+624:             result = waiter.get()
+
        __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_8__waiter_Waiter *)__pyx_v_waiter->__pyx_vtab)->get(__pyx_v_waiter, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 624, __pyx_L9_error)
+        __Pyx_GOTREF(__pyx_t_1);
+        __pyx_v_result = __pyx_t_1;
+        __pyx_t_1 = 0;
+
+625:             if result is not waiter:
+
        __pyx_t_4 = (__pyx_v_result != ((PyObject *)__pyx_v_waiter));
+        __pyx_t_5 = (__pyx_t_4 != 0);
+        if (unlikely(__pyx_t_5)) {
+/* … */
+        }
+
+626:                 raise InvalidSwitchError("Invalid switch into Channel.put: %r" % (result, ))
+
          __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_InvalidSwitchError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 626, __pyx_L9_error)
+          __Pyx_GOTREF(__pyx_t_3);
+          __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 626, __pyx_L9_error)
+          __Pyx_GOTREF(__pyx_t_9);
+          __Pyx_INCREF(__pyx_v_result);
+          __Pyx_GIVEREF(__pyx_v_result);
+          PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_result);
+          __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_switch_into_Channel_put, __pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 626, __pyx_L9_error)
+          __Pyx_GOTREF(__pyx_t_2);
+          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+          __pyx_t_9 = NULL;
+          if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+            __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_3);
+            if (likely(__pyx_t_9)) {
+              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+              __Pyx_INCREF(__pyx_t_9);
+              __Pyx_INCREF(function);
+              __Pyx_DECREF_SET(__pyx_t_3, function);
+            }
+          }
+          __pyx_t_1 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_9, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2);
+          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
+          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+          if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 626, __pyx_L9_error)
+          __Pyx_GOTREF(__pyx_t_1);
+          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+          __Pyx_Raise(__pyx_t_1, 0, 0, 0);
+          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+          __PYX_ERR(0, 626, __pyx_L9_error)
+
+627:         except:
+
      /*except:*/ {
+        __Pyx_AddTraceback("gevent._queue.Channel.put", __pyx_clineno, __pyx_lineno, __pyx_filename);
+        if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_3, &__pyx_t_2) < 0) __PYX_ERR(0, 627, __pyx_L11_except_error)
+        __Pyx_GOTREF(__pyx_t_1);
+        __Pyx_GOTREF(__pyx_t_3);
+        __Pyx_GOTREF(__pyx_t_2);
+
+628:             _safe_remove(self.putters, item)
+
        __pyx_t_9 = __pyx_v_self->putters;
+        __Pyx_INCREF(__pyx_t_9);
+        __pyx_t_7 = __pyx_f_6gevent_6_queue__safe_remove(__pyx_t_9, __pyx_v_item); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 628, __pyx_L11_except_error)
+        __Pyx_GOTREF(__pyx_t_7);
+        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+
+629:             raise
+
        __Pyx_GIVEREF(__pyx_t_1);
+        __Pyx_GIVEREF(__pyx_t_3);
+        __Pyx_XGIVEREF(__pyx_t_2);
+        __Pyx_ErrRestoreWithState(__pyx_t_1, __pyx_t_3, __pyx_t_2);
+        __pyx_t_1 = 0; __pyx_t_3 = 0; __pyx_t_2 = 0; 
+        __PYX_ERR(0, 629, __pyx_L11_except_error)
+      }
+      __pyx_L11_except_error:;
+
 630:         finally:
+
+631:             timeout.cancel()
+
  /*finally:*/ {
+    /*normal exit:*/{
+      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_timeout, __pyx_n_s_cancel); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 631, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_3);
+      __pyx_t_1 = NULL;
+      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
+        __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
+        if (likely(__pyx_t_1)) {
+          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+          __Pyx_INCREF(__pyx_t_1);
+          __Pyx_INCREF(function);
+          __Pyx_DECREF_SET(__pyx_t_3, function);
+        }
+      }
+      __pyx_t_2 = (__pyx_t_1) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
+      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 631, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_2);
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+      goto __pyx_L8;
+    }
+    __pyx_L7_error:;
+    /*exception exit:*/{
+      __Pyx_PyThreadState_declare
+      __Pyx_PyThreadState_assign
+      __pyx_t_12 = 0; __pyx_t_11 = 0; __pyx_t_10 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0;
+      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
+      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+      if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
+      if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_12, &__pyx_t_11, &__pyx_t_10) < 0)) __Pyx_ErrFetch(&__pyx_t_12, &__pyx_t_11, &__pyx_t_10);
+      __Pyx_XGOTREF(__pyx_t_12);
+      __Pyx_XGOTREF(__pyx_t_11);
+      __Pyx_XGOTREF(__pyx_t_10);
+      __Pyx_XGOTREF(__pyx_t_15);
+      __Pyx_XGOTREF(__pyx_t_16);
+      __Pyx_XGOTREF(__pyx_t_17);
+      __pyx_t_8 = __pyx_lineno; __pyx_t_13 = __pyx_clineno; __pyx_t_14 = __pyx_filename;
+      {
+        __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_timeout, __pyx_n_s_cancel); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 631, __pyx_L20_error)
+        __Pyx_GOTREF(__pyx_t_3);
+        __pyx_t_1 = NULL;
+        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
+          __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
+          if (likely(__pyx_t_1)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+            __Pyx_INCREF(__pyx_t_1);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_3, function);
+          }
+        }
+        __pyx_t_2 = (__pyx_t_1) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
+        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 631, __pyx_L20_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+      }
+      if (PY_MAJOR_VERSION >= 3) {
+        __Pyx_XGIVEREF(__pyx_t_15);
+        __Pyx_XGIVEREF(__pyx_t_16);
+        __Pyx_XGIVEREF(__pyx_t_17);
+        __Pyx_ExceptionReset(__pyx_t_15, __pyx_t_16, __pyx_t_17);
+      }
+      __Pyx_XGIVEREF(__pyx_t_12);
+      __Pyx_XGIVEREF(__pyx_t_11);
+      __Pyx_XGIVEREF(__pyx_t_10);
+      __Pyx_ErrRestore(__pyx_t_12, __pyx_t_11, __pyx_t_10);
+      __pyx_t_12 = 0; __pyx_t_11 = 0; __pyx_t_10 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0;
+      __pyx_lineno = __pyx_t_8; __pyx_clineno = __pyx_t_13; __pyx_filename = __pyx_t_14;
+      goto __pyx_L1_error;
+      __pyx_L20_error:;
+      if (PY_MAJOR_VERSION >= 3) {
+        __Pyx_XGIVEREF(__pyx_t_15);
+        __Pyx_XGIVEREF(__pyx_t_16);
+        __Pyx_XGIVEREF(__pyx_t_17);
+        __Pyx_ExceptionReset(__pyx_t_15, __pyx_t_16, __pyx_t_17);
+      }
+      __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
+      __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
+      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
+      __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0;
+      goto __pyx_L1_error;
+    }
+    __pyx_L8:;
+  }
+
 632: 
+
+633:     def put_nowait(self, item):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_queue_7Channel_17put_nowait(PyObject *__pyx_v_self, PyObject *__pyx_v_item); /*proto*/
+static char __pyx_doc_6gevent_6_queue_7Channel_16put_nowait[] = "Channel.put_nowait(self, item)";
+static PyMethodDef __pyx_mdef_6gevent_6_queue_7Channel_17put_nowait = {"put_nowait", (PyCFunction)__pyx_pw_6gevent_6_queue_7Channel_17put_nowait, METH_O, __pyx_doc_6gevent_6_queue_7Channel_16put_nowait};
+static PyObject *__pyx_pw_6gevent_6_queue_7Channel_17put_nowait(PyObject *__pyx_v_self, PyObject *__pyx_v_item) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("put_nowait (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_6_queue_7Channel_16put_nowait(((struct __pyx_obj_6gevent_6_queue_Channel *)__pyx_v_self), ((PyObject *)__pyx_v_item));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_queue_7Channel_16put_nowait(struct __pyx_obj_6gevent_6_queue_Channel *__pyx_v_self, PyObject *__pyx_v_item) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("put_nowait", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_AddTraceback("gevent._queue.Channel.put_nowait", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__81 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_item); if (unlikely(!__pyx_tuple__81)) __PYX_ERR(0, 633, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__81);
+  __Pyx_GIVEREF(__pyx_tuple__81);
+/* … */
+  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_queue_7Channel_17put_nowait, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Channel_put_nowait, NULL, __pyx_n_s_gevent__queue, __pyx_d, ((PyObject *)__pyx_codeobj__82)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 633, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_Channel->tp_dict, __pyx_n_s_put_nowait, __pyx_t_6) < 0) __PYX_ERR(0, 633, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_6_queue_Channel);
+  __pyx_codeobj__82 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__81, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_queue_py, __pyx_n_s_put_nowait, 633, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__82)) __PYX_ERR(0, 633, __pyx_L1_error)
+
+634:         self.put(item, False)
+
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_put_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 634, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = NULL;
+  __pyx_t_4 = 0;
+  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+    if (likely(__pyx_t_3)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+      __Pyx_INCREF(__pyx_t_3);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_2, function);
+      __pyx_t_4 = 1;
+    }
+  }
+  #if CYTHON_FAST_PYCALL
+  if (PyFunction_Check(__pyx_t_2)) {
+    PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_item, Py_False};
+    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 634, __pyx_L1_error)
+    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __Pyx_GOTREF(__pyx_t_1);
+  } else
+  #endif
+  #if CYTHON_FAST_PYCCALL
+  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
+    PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_item, Py_False};
+    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 634, __pyx_L1_error)
+    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __Pyx_GOTREF(__pyx_t_1);
+  } else
+  #endif
+  {
+    __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 634, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_5);
+    if (__pyx_t_3) {
+      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
+    }
+    __Pyx_INCREF(__pyx_v_item);
+    __Pyx_GIVEREF(__pyx_v_item);
+    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_item);
+    __Pyx_INCREF(Py_False);
+    __Pyx_GIVEREF(Py_False);
+    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, Py_False);
+    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 634, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+  }
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 635: 
+
+636:     def get(self, block=True, timeout=None):
+
static PyObject *__pyx_pw_6gevent_6_queue_7Channel_19get(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_f_6gevent_6_queue_7Channel_get(struct __pyx_obj_6gevent_6_queue_Channel *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_6_queue_7Channel_get *__pyx_optional_args) {
+  PyObject *__pyx_v_block = ((PyObject *)Py_True);
+  PyObject *__pyx_v_timeout = ((PyObject *)Py_None);
+  PyObject *__pyx_v_item = NULL;
+  PyObject *__pyx_v_putter = NULL;
+  struct __pyx_obj_6gevent_8__waiter_Waiter *__pyx_v_waiter = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("get", 0);
+  if (__pyx_optional_args) {
+    if (__pyx_optional_args->__pyx_n > 0) {
+      __pyx_v_block = __pyx_optional_args->block;
+      if (__pyx_optional_args->__pyx_n > 1) {
+        __pyx_v_timeout = __pyx_optional_args->timeout;
+      }
+    }
+  }
+  __Pyx_INCREF(__pyx_v_timeout);
+  /* Check if called by wrapper */
+  if (unlikely(__pyx_skip_dispatch)) ;
+  /* Check if overridden in Python */
+  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
+    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
+    if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
+    else {
+      PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      #endif
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 636, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_6_queue_7Channel_19get)) {
+        __Pyx_XDECREF(__pyx_r);
+        __Pyx_INCREF(__pyx_t_1);
+        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
+        __pyx_t_5 = 0;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+          if (likely(__pyx_t_4)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+            __Pyx_INCREF(__pyx_t_4);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_3, function);
+            __pyx_t_5 = 1;
+          }
+        }
+        #if CYTHON_FAST_PYCALL
+        if (PyFunction_Check(__pyx_t_3)) {
+          PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_block, __pyx_v_timeout};
+          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 636, __pyx_L1_error)
+          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+          __Pyx_GOTREF(__pyx_t_2);
+        } else
+        #endif
+        #if CYTHON_FAST_PYCCALL
+        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
+          PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_block, __pyx_v_timeout};
+          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 636, __pyx_L1_error)
+          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+          __Pyx_GOTREF(__pyx_t_2);
+        } else
+        #endif
+        {
+          __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 636, __pyx_L1_error)
+          __Pyx_GOTREF(__pyx_t_6);
+          if (__pyx_t_4) {
+            __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
+          }
+          __Pyx_INCREF(__pyx_v_block);
+          __Pyx_GIVEREF(__pyx_v_block);
+          PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_block);
+          __Pyx_INCREF(__pyx_v_timeout);
+          __Pyx_GIVEREF(__pyx_v_timeout);
+          PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_timeout);
+          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 636, __pyx_L1_error)
+          __Pyx_GOTREF(__pyx_t_2);
+          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+        }
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __pyx_r = __pyx_t_2;
+        __pyx_t_2 = 0;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        goto __pyx_L0;
+      }
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+      tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
+      if (unlikely(type_dict_guard != tp_dict_version)) {
+        tp_dict_version = obj_dict_version = 0;
+      }
+      #endif
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    }
+    #endif
+  }
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_6);
+  __Pyx_XDECREF(__pyx_t_14);
+  __Pyx_AddTraceback("gevent._queue.Channel.get", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_item);
+  __Pyx_XDECREF(__pyx_v_putter);
+  __Pyx_XDECREF((PyObject *)__pyx_v_waiter);
+  __Pyx_XDECREF(__pyx_v_timeout);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_queue_7Channel_19get(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_6gevent_6_queue_7Channel_18get[] = "Channel.get(self, block=True, timeout=None)";
+static PyMethodDef __pyx_mdef_6gevent_6_queue_7Channel_19get = {"get", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_6_queue_7Channel_19get, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_6_queue_7Channel_18get};
+static PyObject *__pyx_pw_6gevent_6_queue_7Channel_19get(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_block = 0;
+  PyObject *__pyx_v_timeout = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("get (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_block,&__pyx_n_s_timeout,0};
+    PyObject* values[2] = {0,0};
+    values[0] = ((PyObject *)Py_True);
+    values[1] = ((PyObject *)Py_None);
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_block);
+          if (value) { values[0] = value; kw_args--; }
+        }
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_timeout);
+          if (value) { values[1] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get") < 0)) __PYX_ERR(0, 636, __pyx_L3_error)
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    __pyx_v_block = values[0];
+    __pyx_v_timeout = values[1];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("get", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 636, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent._queue.Channel.get", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_6_queue_7Channel_18get(((struct __pyx_obj_6gevent_6_queue_Channel *)__pyx_v_self), __pyx_v_block, __pyx_v_timeout);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_queue_7Channel_18get(struct __pyx_obj_6gevent_6_queue_Channel *__pyx_v_self, PyObject *__pyx_v_block, PyObject *__pyx_v_timeout) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("get", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_2.__pyx_n = 2;
+  __pyx_t_2.block = __pyx_v_block;
+  __pyx_t_2.timeout = __pyx_v_timeout;
+  __pyx_t_1 = __pyx_vtabptr_6gevent_6_queue_Channel->get(__pyx_v_self, 1, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 636, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent._queue.Channel.get", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__83 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_block, __pyx_n_s_timeout); if (unlikely(!__pyx_tuple__83)) __PYX_ERR(0, 636, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__83);
+  __Pyx_GIVEREF(__pyx_tuple__83);
+/* … */
+  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_queue_7Channel_19get, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Channel_get, NULL, __pyx_n_s_gevent__queue, __pyx_d, ((PyObject *)__pyx_codeobj__84)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 636, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_Channel->tp_dict, __pyx_n_s_get_2, __pyx_t_6) < 0) __PYX_ERR(0, 636, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_6_queue_Channel);
+  __pyx_codeobj__84 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__83, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_queue_py, __pyx_n_s_get_2, 636, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__84)) __PYX_ERR(0, 636, __pyx_L1_error)
+
+637:         if self.hub is getcurrent():
+
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_getcurrent); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 637, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = NULL;
+  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
+    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+    if (likely(__pyx_t_3)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+      __Pyx_INCREF(__pyx_t_3);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_2, function);
+    }
+  }
+  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 637, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_7 = (__pyx_v_self->hub == __pyx_t_1);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_8 = (__pyx_t_7 != 0);
+  if (__pyx_t_8) {
+/* … */
+  }
+
+638:             if self.putters:
+
    __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_self->putters); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 638, __pyx_L1_error)
+    if (__pyx_t_8) {
+/* … */
+    }
+
+639:                 item, putter = self.putters.popleft()
+
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->putters, __pyx_n_s_popleft); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 639, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_2);
+      __pyx_t_3 = NULL;
+      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+        if (likely(__pyx_t_3)) {
+          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+          __Pyx_INCREF(__pyx_t_3);
+          __Pyx_INCREF(function);
+          __Pyx_DECREF_SET(__pyx_t_2, function);
+        }
+      }
+      __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
+      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 639, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+      if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
+        PyObject* sequence = __pyx_t_1;
+        Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
+        if (unlikely(size != 2)) {
+          if (size > 2) __Pyx_RaiseTooManyValuesError(2);
+          else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
+          __PYX_ERR(0, 639, __pyx_L1_error)
+        }
+        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+        if (likely(PyTuple_CheckExact(sequence))) {
+          __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); 
+          __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); 
+        } else {
+          __pyx_t_2 = PyList_GET_ITEM(sequence, 0); 
+          __pyx_t_3 = PyList_GET_ITEM(sequence, 1); 
+        }
+        __Pyx_INCREF(__pyx_t_2);
+        __Pyx_INCREF(__pyx_t_3);
+        #else
+        __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 639, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 639, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_3);
+        #endif
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      } else {
+        Py_ssize_t index = -1;
+        __pyx_t_6 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 639, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_6);
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        __pyx_t_9 = Py_TYPE(__pyx_t_6)->tp_iternext;
+        index = 0; __pyx_t_2 = __pyx_t_9(__pyx_t_6); if (unlikely(!__pyx_t_2)) goto __pyx_L5_unpacking_failed;
+        __Pyx_GOTREF(__pyx_t_2);
+        index = 1; __pyx_t_3 = __pyx_t_9(__pyx_t_6); if (unlikely(!__pyx_t_3)) goto __pyx_L5_unpacking_failed;
+        __Pyx_GOTREF(__pyx_t_3);
+        if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_6), 2) < 0) __PYX_ERR(0, 639, __pyx_L1_error)
+        __pyx_t_9 = NULL;
+        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+        goto __pyx_L6_unpacking_done;
+        __pyx_L5_unpacking_failed:;
+        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+        __pyx_t_9 = NULL;
+        if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
+        __PYX_ERR(0, 639, __pyx_L1_error)
+        __pyx_L6_unpacking_done:;
+      }
+      __pyx_v_item = __pyx_t_2;
+      __pyx_t_2 = 0;
+      __pyx_v_putter = __pyx_t_3;
+      __pyx_t_3 = 0;
+
+640:                 self.hub.loop.run_callback(putter.switch, putter)
+
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->hub, __pyx_n_s_loop); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 640, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_3);
+      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_run_callback); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 640, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_2);
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_putter, __pyx_n_s_switch); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 640, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_3);
+      __pyx_t_6 = NULL;
+      __pyx_t_5 = 0;
+      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
+        if (likely(__pyx_t_6)) {
+          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+          __Pyx_INCREF(__pyx_t_6);
+          __Pyx_INCREF(function);
+          __Pyx_DECREF_SET(__pyx_t_2, function);
+          __pyx_t_5 = 1;
+        }
+      }
+      #if CYTHON_FAST_PYCALL
+      if (PyFunction_Check(__pyx_t_2)) {
+        PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_3, __pyx_v_putter};
+        __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 640, __pyx_L1_error)
+        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+        __Pyx_GOTREF(__pyx_t_1);
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+      } else
+      #endif
+      #if CYTHON_FAST_PYCCALL
+      if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
+        PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_3, __pyx_v_putter};
+        __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 640, __pyx_L1_error)
+        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+        __Pyx_GOTREF(__pyx_t_1);
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+      } else
+      #endif
+      {
+        __pyx_t_4 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 640, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_4);
+        if (__pyx_t_6) {
+          __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6); __pyx_t_6 = NULL;
+        }
+        __Pyx_GIVEREF(__pyx_t_3);
+        PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_5, __pyx_t_3);
+        __Pyx_INCREF(__pyx_v_putter);
+        __Pyx_GIVEREF(__pyx_v_putter);
+        PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_5, __pyx_v_putter);
+        __pyx_t_3 = 0;
+        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 640, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_1);
+        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      }
+      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+641:                 return item
+
      __Pyx_XDECREF(__pyx_r);
+      __Pyx_INCREF(__pyx_v_item);
+      __pyx_r = __pyx_v_item;
+      goto __pyx_L0;
+
 642: 
+
+643:         if not block:
+
  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_block); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 643, __pyx_L1_error)
+  __pyx_t_7 = ((!__pyx_t_8) != 0);
+  if (__pyx_t_7) {
+/* … */
+  }
+
+644:             timeout = 0
+
    __Pyx_INCREF(__pyx_int_0);
+    __Pyx_DECREF_SET(__pyx_v_timeout, __pyx_int_0);
+
 645: 
+
+646:         waiter = Waiter() # pylint:disable=undefined-variable
+
  __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_6gevent_8__waiter_Waiter)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 646, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_v_waiter = ((struct __pyx_obj_6gevent_8__waiter_Waiter *)__pyx_t_1);
+  __pyx_t_1 = 0;
+
+647:         timeout = Timeout._start_new_or_dummy(timeout, Empty)
+
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Timeout); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 647, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_start_new_or_dummy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 647, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_4);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 647, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = NULL;
+  __pyx_t_5 = 0;
+  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
+    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
+    if (likely(__pyx_t_3)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
+      __Pyx_INCREF(__pyx_t_3);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_4, function);
+      __pyx_t_5 = 1;
+    }
+  }
+  #if CYTHON_FAST_PYCALL
+  if (PyFunction_Check(__pyx_t_4)) {
+    PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_timeout, __pyx_t_2};
+    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 647, __pyx_L1_error)
+    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  } else
+  #endif
+  #if CYTHON_FAST_PYCCALL
+  if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
+    PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_timeout, __pyx_t_2};
+    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 647, __pyx_L1_error)
+    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  } else
+  #endif
+  {
+    __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 647, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_6);
+    if (__pyx_t_3) {
+      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); __pyx_t_3 = NULL;
+    }
+    __Pyx_INCREF(__pyx_v_timeout);
+    __Pyx_GIVEREF(__pyx_v_timeout);
+    PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_timeout);
+    __Pyx_GIVEREF(__pyx_t_2);
+    PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_t_2);
+    __pyx_t_2 = 0;
+    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 647, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  }
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __Pyx_DECREF_SET(__pyx_v_timeout, __pyx_t_1);
+  __pyx_t_1 = 0;
+
+648:         try:
+
  /*try:*/ {
+    {
+      /*try:*/ {
+/* … */
+      }
+      __pyx_L11_error:;
+      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+/* … */
+      __Pyx_XGIVEREF(__pyx_t_10);
+      __Pyx_XGIVEREF(__pyx_t_11);
+      __Pyx_XGIVEREF(__pyx_t_12);
+      __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
+      goto __pyx_L9_error;
+      __pyx_L15_try_return:;
+      __Pyx_XGIVEREF(__pyx_t_10);
+      __Pyx_XGIVEREF(__pyx_t_11);
+      __Pyx_XGIVEREF(__pyx_t_12);
+      __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
+      goto __pyx_L8_return;
+    }
+  }
+
+649:             self.getters.append(waiter)
+
        __pyx_t_13 = __Pyx_PyObject_Append(__pyx_v_self->getters, ((PyObject *)__pyx_v_waiter)); if (unlikely(__pyx_t_13 == ((int)-1))) __PYX_ERR(0, 649, __pyx_L11_error)
+
+650:             if self.putters:
+
        __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_self->putters); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 650, __pyx_L11_error)
+        if (__pyx_t_7) {
+/* … */
+        }
+
+651:                 self._schedule_unlock()
+
          __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_6_queue_Channel *)__pyx_v_self->__pyx_vtab)->_schedule_unlock(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 651, __pyx_L11_error)
+          __Pyx_GOTREF(__pyx_t_1);
+          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+652:             return waiter.get()
+
        __Pyx_XDECREF(__pyx_r);
+        __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_8__waiter_Waiter *)__pyx_v_waiter->__pyx_vtab)->get(__pyx_v_waiter, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 652, __pyx_L11_error)
+        __Pyx_GOTREF(__pyx_t_1);
+        __pyx_r = __pyx_t_1;
+        __pyx_t_1 = 0;
+        goto __pyx_L15_try_return;
+
+653:         except:
+
      /*except:*/ {
+        __Pyx_AddTraceback("gevent._queue.Channel.get", __pyx_clineno, __pyx_lineno, __pyx_filename);
+        if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_4, &__pyx_t_6) < 0) __PYX_ERR(0, 653, __pyx_L13_except_error)
+        __Pyx_GOTREF(__pyx_t_1);
+        __Pyx_GOTREF(__pyx_t_4);
+        __Pyx_GOTREF(__pyx_t_6);
+
+654:             self.getters.remove(waiter)
+
        __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->getters, __pyx_n_s_remove); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 654, __pyx_L13_except_error)
+        __Pyx_GOTREF(__pyx_t_3);
+        __pyx_t_14 = NULL;
+        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
+          __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_3);
+          if (likely(__pyx_t_14)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+            __Pyx_INCREF(__pyx_t_14);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_3, function);
+          }
+        }
+        __pyx_t_2 = (__pyx_t_14) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_14, ((PyObject *)__pyx_v_waiter)) : __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_waiter));
+        __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
+        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 654, __pyx_L13_except_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+655:             raise
+
        __Pyx_GIVEREF(__pyx_t_1);
+        __Pyx_GIVEREF(__pyx_t_4);
+        __Pyx_XGIVEREF(__pyx_t_6);
+        __Pyx_ErrRestoreWithState(__pyx_t_1, __pyx_t_4, __pyx_t_6);
+        __pyx_t_1 = 0; __pyx_t_4 = 0; __pyx_t_6 = 0; 
+        __PYX_ERR(0, 655, __pyx_L13_except_error)
+      }
+      __pyx_L13_except_error:;
+
 656:         finally:
+
+657:             timeout.close()
+
  /*finally:*/ {
+    __pyx_L9_error:;
+    /*exception exit:*/{
+      __Pyx_PyThreadState_declare
+      __Pyx_PyThreadState_assign
+      __pyx_t_12 = 0; __pyx_t_11 = 0; __pyx_t_10 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0;
+      __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
+      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+      if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19);
+      if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_12, &__pyx_t_11, &__pyx_t_10) < 0)) __Pyx_ErrFetch(&__pyx_t_12, &__pyx_t_11, &__pyx_t_10);
+      __Pyx_XGOTREF(__pyx_t_12);
+      __Pyx_XGOTREF(__pyx_t_11);
+      __Pyx_XGOTREF(__pyx_t_10);
+      __Pyx_XGOTREF(__pyx_t_17);
+      __Pyx_XGOTREF(__pyx_t_18);
+      __Pyx_XGOTREF(__pyx_t_19);
+      __pyx_t_5 = __pyx_lineno; __pyx_t_15 = __pyx_clineno; __pyx_t_16 = __pyx_filename;
+      {
+        __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_timeout, __pyx_n_s_close); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 657, __pyx_L21_error)
+        __Pyx_GOTREF(__pyx_t_4);
+        __pyx_t_1 = NULL;
+        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
+          __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4);
+          if (likely(__pyx_t_1)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
+            __Pyx_INCREF(__pyx_t_1);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_4, function);
+          }
+        }
+        __pyx_t_6 = (__pyx_t_1) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_1) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
+        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+        if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 657, __pyx_L21_error)
+        __Pyx_GOTREF(__pyx_t_6);
+        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+      }
+      if (PY_MAJOR_VERSION >= 3) {
+        __Pyx_XGIVEREF(__pyx_t_17);
+        __Pyx_XGIVEREF(__pyx_t_18);
+        __Pyx_XGIVEREF(__pyx_t_19);
+        __Pyx_ExceptionReset(__pyx_t_17, __pyx_t_18, __pyx_t_19);
+      }
+      __Pyx_XGIVEREF(__pyx_t_12);
+      __Pyx_XGIVEREF(__pyx_t_11);
+      __Pyx_XGIVEREF(__pyx_t_10);
+      __Pyx_ErrRestore(__pyx_t_12, __pyx_t_11, __pyx_t_10);
+      __pyx_t_12 = 0; __pyx_t_11 = 0; __pyx_t_10 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0;
+      __pyx_lineno = __pyx_t_5; __pyx_clineno = __pyx_t_15; __pyx_filename = __pyx_t_16;
+      goto __pyx_L1_error;
+      __pyx_L21_error:;
+      if (PY_MAJOR_VERSION >= 3) {
+        __Pyx_XGIVEREF(__pyx_t_17);
+        __Pyx_XGIVEREF(__pyx_t_18);
+        __Pyx_XGIVEREF(__pyx_t_19);
+        __Pyx_ExceptionReset(__pyx_t_17, __pyx_t_18, __pyx_t_19);
+      }
+      __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
+      __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
+      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
+      __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0;
+      goto __pyx_L1_error;
+    }
+    __pyx_L8_return: {
+      __pyx_t_19 = __pyx_r;
+      __pyx_r = 0;
+      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_timeout, __pyx_n_s_close); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 657, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_4);
+      __pyx_t_1 = NULL;
+      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
+        __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4);
+        if (likely(__pyx_t_1)) {
+          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
+          __Pyx_INCREF(__pyx_t_1);
+          __Pyx_INCREF(function);
+          __Pyx_DECREF_SET(__pyx_t_4, function);
+        }
+      }
+      __pyx_t_6 = (__pyx_t_1) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_1) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
+      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+      if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 657, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_6);
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+      __pyx_r = __pyx_t_19;
+      __pyx_t_19 = 0;
+      goto __pyx_L0;
+    }
+  }
+
 658: 
+
+659:     def get_nowait(self):
+
static PyObject *__pyx_pw_6gevent_6_queue_7Channel_21get_nowait(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyObject *__pyx_f_6gevent_6_queue_7Channel_get_nowait(struct __pyx_obj_6gevent_6_queue_Channel *__pyx_v_self, int __pyx_skip_dispatch) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("get_nowait", 0);
+  /* Check if called by wrapper */
+  if (unlikely(__pyx_skip_dispatch)) ;
+  /* Check if overridden in Python */
+  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
+    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
+    if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
+    else {
+      PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      #endif
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_nowait); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 659, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_6_queue_7Channel_21get_nowait)) {
+        __Pyx_XDECREF(__pyx_r);
+        __Pyx_INCREF(__pyx_t_1);
+        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+          if (likely(__pyx_t_4)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+            __Pyx_INCREF(__pyx_t_4);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_3, function);
+          }
+        }
+        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
+        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 659, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __pyx_r = __pyx_t_2;
+        __pyx_t_2 = 0;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        goto __pyx_L0;
+      }
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+      tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
+      if (unlikely(type_dict_guard != tp_dict_version)) {
+        tp_dict_version = obj_dict_version = 0;
+      }
+      #endif
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    }
+    #endif
+  }
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_AddTraceback("gevent._queue.Channel.get_nowait", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_queue_7Channel_21get_nowait(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6gevent_6_queue_7Channel_20get_nowait[] = "Channel.get_nowait(self)";
+static PyMethodDef __pyx_mdef_6gevent_6_queue_7Channel_21get_nowait = {"get_nowait", (PyCFunction)__pyx_pw_6gevent_6_queue_7Channel_21get_nowait, METH_NOARGS, __pyx_doc_6gevent_6_queue_7Channel_20get_nowait};
+static PyObject *__pyx_pw_6gevent_6_queue_7Channel_21get_nowait(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("get_nowait (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_6_queue_7Channel_20get_nowait(((struct __pyx_obj_6gevent_6_queue_Channel *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_queue_7Channel_20get_nowait(struct __pyx_obj_6gevent_6_queue_Channel *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("get_nowait", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __pyx_f_6gevent_6_queue_7Channel_get_nowait(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 659, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent._queue.Channel.get_nowait", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__85 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__85)) __PYX_ERR(0, 659, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__85);
+  __Pyx_GIVEREF(__pyx_tuple__85);
+/* … */
+  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_queue_7Channel_21get_nowait, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Channel_get_nowait, NULL, __pyx_n_s_gevent__queue, __pyx_d, ((PyObject *)__pyx_codeobj__86)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 659, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_Channel->tp_dict, __pyx_n_s_get_nowait, __pyx_t_6) < 0) __PYX_ERR(0, 659, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_6_queue_Channel);
+  __pyx_codeobj__86 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__85, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_queue_py, __pyx_n_s_get_nowait, 659, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__86)) __PYX_ERR(0, 659, __pyx_L1_error)
+
+660:         return self.get(False)
+
  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_5.__pyx_n = 1;
+  __pyx_t_5.block = Py_False;
+  __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_6_queue_Channel *)__pyx_v_self->__pyx_vtab)->get(__pyx_v_self, 0, &__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 660, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
 661: 
+
+662:     def _unlock(self):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_queue_7Channel_23_unlock(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_6gevent_6_queue_7Channel_22_unlock[] = "Channel._unlock(self)";
+static PyMethodDef __pyx_mdef_6gevent_6_queue_7Channel_23_unlock = {"_unlock", (PyCFunction)__pyx_pw_6gevent_6_queue_7Channel_23_unlock, METH_NOARGS, __pyx_doc_6gevent_6_queue_7Channel_22_unlock};
+static PyObject *__pyx_pw_6gevent_6_queue_7Channel_23_unlock(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_unlock (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_6_queue_7Channel_22_unlock(((struct __pyx_obj_6gevent_6_queue_Channel *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_queue_7Channel_22_unlock(struct __pyx_obj_6gevent_6_queue_Channel *__pyx_v_self) {
+  PyObject *__pyx_v_getter = NULL;
+  PyObject *__pyx_v_item = NULL;
+  PyObject *__pyx_v_putter = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_unlock", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_XDECREF(__pyx_t_6);
+  __Pyx_AddTraceback("gevent._queue.Channel._unlock", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_getter);
+  __Pyx_XDECREF(__pyx_v_item);
+  __Pyx_XDECREF(__pyx_v_putter);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__87 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_getter, __pyx_n_s_item, __pyx_n_s_putter); if (unlikely(!__pyx_tuple__87)) __PYX_ERR(0, 662, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__87);
+  __Pyx_GIVEREF(__pyx_tuple__87);
+/* … */
+  __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_6_queue_7Channel_23_unlock, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Channel__unlock, NULL, __pyx_n_s_gevent__queue, __pyx_d, ((PyObject *)__pyx_codeobj__88)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 662, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_Channel->tp_dict, __pyx_n_s_unlock, __pyx_t_6) < 0) __PYX_ERR(0, 662, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_6_queue_Channel);
+
+663:         while self.putters and self.getters:
+
  while (1) {
+    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_self->putters); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 663, __pyx_L1_error)
+    if (__pyx_t_2) {
+    } else {
+      __pyx_t_1 = __pyx_t_2;
+      goto __pyx_L5_bool_binop_done;
+    }
+    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_self->getters); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 663, __pyx_L1_error)
+    __pyx_t_1 = __pyx_t_2;
+    __pyx_L5_bool_binop_done:;
+    if (!__pyx_t_1) break;
+
+664:             getter = self.getters.popleft()
+
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->getters, __pyx_n_s_popleft); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 664, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    __pyx_t_5 = NULL;
+    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
+      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
+      if (likely(__pyx_t_5)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
+        __Pyx_INCREF(__pyx_t_5);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_4, function);
+      }
+    }
+    __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
+    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 664, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __Pyx_XDECREF_SET(__pyx_v_getter, __pyx_t_3);
+    __pyx_t_3 = 0;
+
+665:             item, putter = self.putters.popleft()
+
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->putters, __pyx_n_s_popleft); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 665, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    __pyx_t_5 = NULL;
+    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
+      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
+      if (likely(__pyx_t_5)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
+        __Pyx_INCREF(__pyx_t_5);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_4, function);
+      }
+    }
+    __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
+    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 665, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
+      PyObject* sequence = __pyx_t_3;
+      Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
+      if (unlikely(size != 2)) {
+        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
+        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
+        __PYX_ERR(0, 665, __pyx_L1_error)
+      }
+      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+      if (likely(PyTuple_CheckExact(sequence))) {
+        __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); 
+        __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); 
+      } else {
+        __pyx_t_4 = PyList_GET_ITEM(sequence, 0); 
+        __pyx_t_5 = PyList_GET_ITEM(sequence, 1); 
+      }
+      __Pyx_INCREF(__pyx_t_4);
+      __Pyx_INCREF(__pyx_t_5);
+      #else
+      __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 665, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_4);
+      __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 665, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_5);
+      #endif
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    } else {
+      Py_ssize_t index = -1;
+      __pyx_t_6 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 665, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_6);
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __pyx_t_7 = Py_TYPE(__pyx_t_6)->tp_iternext;
+      index = 0; __pyx_t_4 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_4)) goto __pyx_L7_unpacking_failed;
+      __Pyx_GOTREF(__pyx_t_4);
+      index = 1; __pyx_t_5 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_5)) goto __pyx_L7_unpacking_failed;
+      __Pyx_GOTREF(__pyx_t_5);
+      if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 2) < 0) __PYX_ERR(0, 665, __pyx_L1_error)
+      __pyx_t_7 = NULL;
+      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+      goto __pyx_L8_unpacking_done;
+      __pyx_L7_unpacking_failed:;
+      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+      __pyx_t_7 = NULL;
+      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
+      __PYX_ERR(0, 665, __pyx_L1_error)
+      __pyx_L8_unpacking_done:;
+    }
+    __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_4);
+    __pyx_t_4 = 0;
+    __Pyx_XDECREF_SET(__pyx_v_putter, __pyx_t_5);
+    __pyx_t_5 = 0;
+
+666:             getter.switch(item)
+
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_getter, __pyx_n_s_switch); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 666, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_5);
+    __pyx_t_4 = NULL;
+    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
+      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
+      if (likely(__pyx_t_4)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
+        __Pyx_INCREF(__pyx_t_4);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_5, function);
+      }
+    }
+    __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_4, __pyx_v_item) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_item);
+    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 666, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+
+667:             putter.switch(putter)
+
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_putter, __pyx_n_s_switch); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 667, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_5);
+    __pyx_t_4 = NULL;
+    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
+      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
+      if (likely(__pyx_t_4)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
+        __Pyx_INCREF(__pyx_t_4);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_5, function);
+      }
+    }
+    __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_4, __pyx_v_putter) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_putter);
+    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 667, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  }
+
 668: 
+
+669:     def _schedule_unlock(self):
+
static PyObject *__pyx_f_6gevent_6_queue_7Channel__schedule_unlock(struct __pyx_obj_6gevent_6_queue_Channel *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_schedule_unlock", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_XDECREF(__pyx_t_6);
+  __Pyx_AddTraceback("gevent._queue.Channel._schedule_unlock", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+670:         if not self._event_unlock:
+
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_self->_event_unlock); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 670, __pyx_L1_error)
+  __pyx_t_2 = ((!__pyx_t_1) != 0);
+  if (__pyx_t_2) {
+/* … */
+  }
+
+671:             self._event_unlock = self.hub.loop.run_callback(self._unlock)
+
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->hub, __pyx_n_s_loop); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 671, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_run_callback); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 671, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_5);
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_unlock); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 671, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    __pyx_t_6 = NULL;
+    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
+      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
+      if (likely(__pyx_t_6)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
+        __Pyx_INCREF(__pyx_t_6);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_5, function);
+      }
+    }
+    __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4);
+    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 671, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __Pyx_GIVEREF(__pyx_t_3);
+    __Pyx_GOTREF(__pyx_v_self->_event_unlock);
+    __Pyx_DECREF(__pyx_v_self->_event_unlock);
+    __pyx_v_self->_event_unlock = __pyx_t_3;
+    __pyx_t_3 = 0;
+
 672: 
+
+673:     def __iter__(self):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_queue_7Channel_25__iter__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_6_queue_7Channel_25__iter__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_6_queue_7Channel_24__iter__(((struct __pyx_obj_6gevent_6_queue_Channel *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_queue_7Channel_24__iter__(struct __pyx_obj_6gevent_6_queue_Channel *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__iter__", 0);
+/* … */
+  /* function exit code */
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+674:         return self
+
  __Pyx_XDECREF(__pyx_r);
+  __Pyx_INCREF(((PyObject *)__pyx_v_self));
+  __pyx_r = ((PyObject *)__pyx_v_self);
+  goto __pyx_L0;
+
 675: 
+
+676:     def __next__(self):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_6_queue_7Channel_27__next__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_6_queue_7Channel_27__next__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__next__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_6_queue_7Channel_26__next__(((struct __pyx_obj_6gevent_6_queue_Channel *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_6_queue_7Channel_26__next__(struct __pyx_obj_6gevent_6_queue_Channel *__pyx_v_self) {
+  PyObject *__pyx_v_result = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__next__", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent._queue.Channel.__next__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_result);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+677:         result = self.get()
+
  __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_6_queue_Channel *)__pyx_v_self->__pyx_vtab)->get(__pyx_v_self, 0, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 677, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_v_result = __pyx_t_1;
+  __pyx_t_1 = 0;
+
+678:         if result is StopIteration:
+
  __pyx_t_2 = (__pyx_v_result == __pyx_builtin_StopIteration);
+  __pyx_t_3 = (__pyx_t_2 != 0);
+  if (unlikely(__pyx_t_3)) {
+/* … */
+  }
+
+679:             raise result
+
    __Pyx_Raise(__pyx_v_result, 0, 0, 0);
+    __PYX_ERR(0, 679, __pyx_L1_error)
+
+680:         return result
+
  __Pyx_XDECREF(__pyx_r);
+  __Pyx_INCREF(__pyx_v_result);
+  __pyx_r = __pyx_v_result;
+  goto __pyx_L0;
+
 681: 
+
+682:     next = __next__ # Py2
+
  __Pyx_GetNameInClass(__pyx_t_6, (PyObject *)__pyx_ptype_6gevent_6_queue_Channel, __pyx_n_s_next); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 682, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_6_queue_Channel->tp_dict, __pyx_n_s_next_2, __pyx_t_6) < 0) __PYX_ERR(0, 682, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  PyType_Modified(__pyx_ptype_6gevent_6_queue_Channel);
+
 683: 
+
+684: from gevent._util import import_c_accel
+
  __pyx_t_6 = PyList_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 684, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  __Pyx_INCREF(__pyx_n_s_import_c_accel);
+  __Pyx_GIVEREF(__pyx_n_s_import_c_accel);
+  PyList_SET_ITEM(__pyx_t_6, 0, __pyx_n_s_import_c_accel);
+  __pyx_t_1 = __Pyx_Import(__pyx_n_s_gevent__util, __pyx_t_6, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 684, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  __pyx_t_6 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_import_c_accel); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 684, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_import_c_accel, __pyx_t_6) < 0) __PYX_ERR(0, 684, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+685: import_c_accel(globals(), 'gevent._queue')
+
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_import_c_accel); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 685, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_6 = __Pyx_Globals(); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 685, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 685, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_GIVEREF(__pyx_t_6);
+  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_6);
+  __Pyx_INCREF(__pyx_n_s_gevent__queue);
+  __Pyx_GIVEREF(__pyx_n_s_gevent__queue);
+  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_gevent__queue);
+  __pyx_t_6 = 0;
+  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 685, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+
diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/queue.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/queue.py new file mode 100644 index 00000000..57b937b1 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/queue.py @@ -0,0 +1,685 @@ +# Copyright (c) 2009-2012 Denis Bilenko. See LICENSE for details. +# copyright (c) 2018 gevent +# cython: auto_pickle=False,embedsignature=True,always_allow_keywords=False +""" +Synchronized queues. + +The :mod:`gevent.queue` module implements multi-producer, multi-consumer queues +that work across greenlets, with the API similar to the classes found in the +standard :mod:`Queue` and :class:`multiprocessing ` modules. + +The classes in this module implement the iterator protocol. Iterating +over a queue means repeatedly calling :meth:`get ` until +:meth:`get ` returns ``StopIteration`` (specifically that +class, not an instance or subclass). + + >>> queue = gevent.queue.Queue() + >>> queue.put(1) + >>> queue.put(2) + >>> queue.put(StopIteration) + >>> for item in queue: + ... print(item) + 1 + 2 + +.. versionchanged:: 1.0 + ``Queue(0)`` now means queue of infinite size, not a channel. A :exc:`DeprecationWarning` + will be issued with this argument. +""" + +from __future__ import absolute_import +import sys +from heapq import heappush as _heappush +from heapq import heappop as _heappop +from heapq import heapify as _heapify +import collections + +if sys.version_info[0] == 2: + import Queue as __queue__ # python 3: pylint:disable=import-error +else: + import queue as __queue__ # python 2: pylint:disable=import-error +Full = __queue__.Full +Empty = __queue__.Empty + +from gevent.timeout import Timeout +from gevent._hub_local import get_hub_noargs as get_hub +from greenlet import getcurrent +from gevent.exceptions import InvalidSwitchError + +__all__ = [] +__implements__ = ['Queue', 'PriorityQueue', 'LifoQueue'] +__extensions__ = ['JoinableQueue', 'Channel'] +__imports__ = ['Empty', 'Full'] +if hasattr(__queue__, 'SimpleQueue'): + __all__.append('SimpleQueue') # New in 3.7 + # SimpleQueue is implemented in C and directly allocates locks + # unaffected by monkey patching. We need the Python version. + SimpleQueue = __queue__._PySimpleQueue # pylint:disable=no-member +__all__ += (__implements__ + __extensions__ + __imports__) + + +# pylint 2.0.dev2 things collections.dequeue.popleft() doesn't return +# pylint:disable=assignment-from-no-return + +def _safe_remove(deq, item): + # For when the item may have been removed by + # Queue._unlock + try: + deq.remove(item) + except ValueError: + pass + +import gevent._waiter +locals()['Waiter'] = gevent._waiter.Waiter + +class ItemWaiter(Waiter): # pylint:disable=undefined-variable + # pylint:disable=assigning-non-slot + __slots__ = ( + 'item', + 'queue', + ) + + def __init__(self, item, queue): + Waiter.__init__(self) # pylint:disable=undefined-variable + self.item = item + self.queue = queue + + def put_and_switch(self): + self.queue._put(self.item) + self.queue = None + self.item = None + return self.switch(self) + +class Queue(object): + """ + Create a queue object with a given maximum size. + + If *maxsize* is less than or equal to zero or ``None``, the queue + size is infinite. + + Queues have a ``len`` equal to the number of items in them (the :meth:`qsize`), + but in a boolean context they are always True. + + .. versionchanged:: 1.1b3 + Queues now support :func:`len`; it behaves the same as :meth:`qsize`. + .. versionchanged:: 1.1b3 + Multiple greenlets that block on a call to :meth:`put` for a full queue + will now be awakened to put their items into the queue in the order in which + they arrived. Likewise, multiple greenlets that block on a call to :meth:`get` for + an empty queue will now receive items in the order in which they blocked. An + implementation quirk under CPython *usually* ensured this was roughly the case + previously anyway, but that wasn't the case for PyPy. + """ + + __slots__ = ( + '_maxsize', + 'getters', + 'putters', + 'hub', + '_event_unlock', + 'queue', + '__weakref__', + ) + + def __init__(self, maxsize=None, items=(), _warn_depth=2): + if maxsize is not None and maxsize <= 0: + if maxsize == 0: + import warnings + warnings.warn( + 'Queue(0) now equivalent to Queue(None); if you want a channel, use Channel', + DeprecationWarning, + stacklevel=_warn_depth) + maxsize = None + + self._maxsize = maxsize if maxsize is not None else -1 + # Explicitly maintain order for getters and putters that block + # so that callers can consistently rely on getting things out + # in the apparent order they went in. This was once required by + # imap_unordered. Previously these were set() objects, and the + # items put in the set have default hash() and eq() methods; + # under CPython, since new objects tend to have increasing + # hash values, this tended to roughly maintain order anyway, + # but that's not true under PyPy. An alternative to a deque + # (to avoid the linear scan of remove()) might be an + # OrderedDict, but it's 2.7 only; we don't expect to have so + # many waiters that removing an arbitrary element is a + # bottleneck, though. + self.getters = collections.deque() + self.putters = collections.deque() + self.hub = get_hub() + self._event_unlock = None + self.queue = self._create_queue(items) + + @property + def maxsize(self): + return self._maxsize if self._maxsize > 0 else None + + @maxsize.setter + def maxsize(self, nv): + # QQQ make maxsize into a property with setter that schedules unlock if necessary + if nv is None or nv <= 0: + self._maxsize = -1 + else: + self._maxsize = nv + + def copy(self): + return type(self)(self.maxsize, self.queue) + + def _create_queue(self, items=()): + return collections.deque(items) + + def _get(self): + return self.queue.popleft() + + def _peek(self): + return self.queue[0] + + def _put(self, item): + self.queue.append(item) + + def __repr__(self): + return '<%s at %s%s>' % (type(self).__name__, hex(id(self)), self._format()) + + def __str__(self): + return '<%s%s>' % (type(self).__name__, self._format()) + + def _format(self): + result = [] + if self.maxsize is not None: + result.append('maxsize=%r' % (self.maxsize, )) + if getattr(self, 'queue', None): + result.append('queue=%r' % (self.queue, )) + if self.getters: + result.append('getters[%s]' % len(self.getters)) + if self.putters: + result.append('putters[%s]' % len(self.putters)) + if result: + return ' ' + ' '.join(result) + return '' + + def qsize(self): + """Return the size of the queue.""" + return len(self.queue) + + def __len__(self): + """ + Return the size of the queue. This is the same as :meth:`qsize`. + + .. versionadded: 1.1b3 + + Previously, getting len() of a queue would raise a TypeError. + """ + + return self.qsize() + + def __bool__(self): + """ + A queue object is always True. + + .. versionadded: 1.1b3 + + Now that queues support len(), they need to implement ``__bool__`` + to return True for backwards compatibility. + """ + return True + + def __nonzero__(self): + # Py2. + # For Cython; __bool__ becomes a special method that we can't + # get by name. + return True + + def empty(self): + """Return ``True`` if the queue is empty, ``False`` otherwise.""" + return not self.qsize() + + def full(self): + """Return ``True`` if the queue is full, ``False`` otherwise. + + ``Queue(None)`` is never full. + """ + return self._maxsize > 0 and self.qsize() >= self._maxsize + + def put(self, item, block=True, timeout=None): + """Put an item into the queue. + + If optional arg *block* is true and *timeout* is ``None`` (the default), + block if necessary until a free slot is available. If *timeout* is + a positive number, it blocks at most *timeout* seconds and raises + the :class:`Full` exception if no free slot was available within that time. + Otherwise (*block* is false), put an item on the queue if a free slot + is immediately available, else raise the :class:`Full` exception (*timeout* + is ignored in that case). + """ + if self._maxsize == -1 or self.qsize() < self._maxsize: + # there's a free slot, put an item right away + self._put(item) + if self.getters: + self._schedule_unlock() + elif self.hub is getcurrent(): + # We're in the mainloop, so we cannot wait; we can switch to other greenlets though. + # Check if possible to get a free slot in the queue. + while self.getters and self.qsize() and self.qsize() >= self._maxsize: + getter = self.getters.popleft() + getter.switch(getter) + if self.qsize() < self._maxsize: + self._put(item) + return + raise Full + elif block: + waiter = ItemWaiter(item, self) + self.putters.append(waiter) + timeout = Timeout._start_new_or_dummy(timeout, Full) + try: + if self.getters: + self._schedule_unlock() + result = waiter.get() + if result is not waiter: + raise InvalidSwitchError("Invalid switch into Queue.put: %r" % (result, )) + finally: + timeout.cancel() + _safe_remove(self.putters, waiter) + else: + raise Full + + def put_nowait(self, item): + """Put an item into the queue without blocking. + + Only enqueue the item if a free slot is immediately available. + Otherwise raise the :class:`Full` exception. + """ + self.put(item, False) + + def __get_or_peek(self, method, block, timeout): + # Internal helper method. The `method` should be either + # self._get when called from self.get() or self._peek when + # called from self.peek(). Call this after the initial check + # to see if there are items in the queue. + + if self.hub is getcurrent(): + # special case to make get_nowait() or peek_nowait() runnable in the mainloop greenlet + # there are no items in the queue; try to fix the situation by unlocking putters + while self.putters: + # Note: get() used popleft(), peek used pop(); popleft + # is almost certainly correct. + self.putters.popleft().put_and_switch() + if self.qsize(): + return method() + raise Empty() + + if not block: + # We can't block, we're not the hub, and we have nothing + # to return. No choice... + raise Empty() + + waiter = Waiter() # pylint:disable=undefined-variable + timeout = Timeout._start_new_or_dummy(timeout, Empty) + try: + self.getters.append(waiter) + if self.putters: + self._schedule_unlock() + result = waiter.get() + if result is not waiter: + raise InvalidSwitchError('Invalid switch into Queue.get: %r' % (result, )) + return method() + finally: + timeout.cancel() + _safe_remove(self.getters, waiter) + + def get(self, block=True, timeout=None): + """Remove and return an item from the queue. + + If optional args *block* is true and *timeout* is ``None`` (the default), + block if necessary until an item is available. If *timeout* is a positive number, + it blocks at most *timeout* seconds and raises the :class:`Empty` exception + if no item was available within that time. Otherwise (*block* is false), return + an item if one is immediately available, else raise the :class:`Empty` exception + (*timeout* is ignored in that case). + """ + if self.qsize(): + if self.putters: + self._schedule_unlock() + return self._get() + + return self.__get_or_peek(self._get, block, timeout) + + def get_nowait(self): + """Remove and return an item from the queue without blocking. + + Only get an item if one is immediately available. Otherwise + raise the :class:`Empty` exception. + """ + return self.get(False) + + def peek(self, block=True, timeout=None): + """Return an item from the queue without removing it. + + If optional args *block* is true and *timeout* is ``None`` (the default), + block if necessary until an item is available. If *timeout* is a positive number, + it blocks at most *timeout* seconds and raises the :class:`Empty` exception + if no item was available within that time. Otherwise (*block* is false), return + an item if one is immediately available, else raise the :class:`Empty` exception + (*timeout* is ignored in that case). + """ + if self.qsize(): + # XXX: Why doesn't this schedule an unlock like get() does? + return self._peek() + + return self.__get_or_peek(self._peek, block, timeout) + + def peek_nowait(self): + """Return an item from the queue without blocking. + + Only return an item if one is immediately available. Otherwise + raise the :class:`Empty` exception. + """ + return self.peek(False) + + def _unlock(self): + while True: + repeat = False + if self.putters and (self._maxsize == -1 or self.qsize() < self._maxsize): + repeat = True + try: + putter = self.putters.popleft() + self._put(putter.item) + except: # pylint:disable=bare-except + putter.throw(*sys.exc_info()) + else: + putter.switch(putter) + if self.getters and self.qsize(): + repeat = True + getter = self.getters.popleft() + getter.switch(getter) + if not repeat: + return + + def _schedule_unlock(self): + if not self._event_unlock: + self._event_unlock = self.hub.loop.run_callback(self._unlock) + + def __iter__(self): + return self + + def __next__(self): + result = self.get() + if result is StopIteration: + raise result + return result + + next = __next__ # Py2 + + +class UnboundQueue(Queue): + # A specialization of Queue that knows it can never + # be bound. Changing its maxsize has no effect. + + __slots__ = () + + def __init__(self, maxsize=None, items=()): + if maxsize is not None: + raise ValueError("UnboundQueue has no maxsize") + Queue.__init__(self, maxsize, items) + self.putters = None # Will never be used. + + def put(self, item, block=True, timeout=None): + self._put(item) + if self.getters: + self._schedule_unlock() + + +class PriorityQueue(Queue): + '''A subclass of :class:`Queue` that retrieves entries in priority order (lowest first). + + Entries are typically tuples of the form: ``(priority number, data)``. + + .. versionchanged:: 1.2a1 + Any *items* given to the constructor will now be passed through + :func:`heapq.heapify` to ensure the invariants of this class hold. + Previously it was just assumed that they were already a heap. + ''' + + __slots__ = () + + def _create_queue(self, items=()): + q = list(items) + _heapify(q) + return q + + def _put(self, item): + _heappush(self.queue, item) + + def _get(self): + return _heappop(self.queue) + + +class LifoQueue(Queue): + '''A subclass of :class:`Queue` that retrieves most recently added entries first.''' + + __slots__ = () + + def _create_queue(self, items=()): + return list(items) + + def _put(self, item): + self.queue.append(item) + + def _get(self): + return self.queue.pop() + + def _peek(self): + return self.queue[-1] + + +class JoinableQueue(Queue): + """ + A subclass of :class:`Queue` that additionally has + :meth:`task_done` and :meth:`join` methods. + """ + + __slots__ = ( + '_cond', + 'unfinished_tasks', + ) + + def __init__(self, maxsize=None, items=(), unfinished_tasks=None): + """ + + .. versionchanged:: 1.1a1 + If *unfinished_tasks* is not given, then all the given *items* + (if any) will be considered unfinished. + + """ + Queue.__init__(self, maxsize, items, _warn_depth=3) + + from gevent.event import Event + self._cond = Event() + self._cond.set() + + if unfinished_tasks: + self.unfinished_tasks = unfinished_tasks + elif items: + self.unfinished_tasks = len(items) + else: + self.unfinished_tasks = 0 + + if self.unfinished_tasks: + self._cond.clear() + + def copy(self): + return type(self)(self.maxsize, self.queue, self.unfinished_tasks) + + def _format(self): + result = Queue._format(self) + if self.unfinished_tasks: + result += ' tasks=%s _cond=%s' % (self.unfinished_tasks, self._cond) + return result + + def _put(self, item): + Queue._put(self, item) + self.unfinished_tasks += 1 + self._cond.clear() + + def task_done(self): + '''Indicate that a formerly enqueued task is complete. Used by queue consumer threads. + For each :meth:`get ` used to fetch a task, a subsequent call to :meth:`task_done` tells the queue + that the processing on the task is complete. + + If a :meth:`join` is currently blocking, it will resume when all items have been processed + (meaning that a :meth:`task_done` call was received for every item that had been + :meth:`put ` into the queue). + + Raises a :exc:`ValueError` if called more times than there were items placed in the queue. + ''' + if self.unfinished_tasks <= 0: + raise ValueError('task_done() called too many times') + self.unfinished_tasks -= 1 + if self.unfinished_tasks == 0: + self._cond.set() + + def join(self, timeout=None): + ''' + Block until all items in the queue have been gotten and processed. + + The count of unfinished tasks goes up whenever an item is added to the queue. + The count goes down whenever a consumer thread calls :meth:`task_done` to indicate + that the item was retrieved and all work on it is complete. When the count of + unfinished tasks drops to zero, :meth:`join` unblocks. + + :param float timeout: If not ``None``, then wait no more than this time in seconds + for all tasks to finish. + :return: ``True`` if all tasks have finished; if ``timeout`` was given and expired before + all tasks finished, ``False``. + + .. versionchanged:: 1.1a1 + Add the *timeout* parameter. + ''' + return self._cond.wait(timeout=timeout) + + +class Channel(object): + + __slots__ = ( + 'getters', + 'putters', + 'hub', + '_event_unlock', + '__weakref__', + ) + + def __init__(self, maxsize=1): + # We take maxsize to simplify certain kinds of code + if maxsize != 1: + raise ValueError("Channels have a maxsize of 1") + self.getters = collections.deque() + self.putters = collections.deque() + self.hub = get_hub() + self._event_unlock = None + + def __repr__(self): + return '<%s at %s %s>' % (type(self).__name__, hex(id(self)), self._format()) + + def __str__(self): + return '<%s %s>' % (type(self).__name__, self._format()) + + def _format(self): + result = '' + if self.getters: + result += ' getters[%s]' % len(self.getters) + if self.putters: + result += ' putters[%s]' % len(self.putters) + return result + + @property + def balance(self): + return len(self.putters) - len(self.getters) + + def qsize(self): + return 0 + + def empty(self): + return True + + def full(self): + return True + + def put(self, item, block=True, timeout=None): + if self.hub is getcurrent(): + if self.getters: + getter = self.getters.popleft() + getter.switch(item) + return + raise Full + + if not block: + timeout = 0 + + waiter = Waiter() # pylint:disable=undefined-variable + item = (item, waiter) + self.putters.append(item) + timeout = Timeout._start_new_or_dummy(timeout, Full) + try: + if self.getters: + self._schedule_unlock() + result = waiter.get() + if result is not waiter: + raise InvalidSwitchError("Invalid switch into Channel.put: %r" % (result, )) + except: + _safe_remove(self.putters, item) + raise + finally: + timeout.cancel() + + def put_nowait(self, item): + self.put(item, False) + + def get(self, block=True, timeout=None): + if self.hub is getcurrent(): + if self.putters: + item, putter = self.putters.popleft() + self.hub.loop.run_callback(putter.switch, putter) + return item + + if not block: + timeout = 0 + + waiter = Waiter() # pylint:disable=undefined-variable + timeout = Timeout._start_new_or_dummy(timeout, Empty) + try: + self.getters.append(waiter) + if self.putters: + self._schedule_unlock() + return waiter.get() + except: + self.getters.remove(waiter) + raise + finally: + timeout.close() + + def get_nowait(self): + return self.get(False) + + def _unlock(self): + while self.putters and self.getters: + getter = self.getters.popleft() + item, putter = self.putters.popleft() + getter.switch(item) + putter.switch(putter) + + def _schedule_unlock(self): + if not self._event_unlock: + self._event_unlock = self.hub.loop.run_callback(self._unlock) + + def __iter__(self): + return self + + def __next__(self): + result = self.get() + if result is StopIteration: + raise result + return result + + next = __next__ # Py2 + +from gevent._util import import_c_accel +import_c_accel(globals(), 'gevent._queue') diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/resolver/__init__.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/resolver/__init__.py new file mode 100644 index 00000000..bffa292f --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/resolver/__init__.py @@ -0,0 +1,105 @@ +# Copyright (c) 2018 gevent contributors. See LICENSE for details. + +from _socket import gaierror +from _socket import error +from _socket import getservbyname +from _socket import getaddrinfo +from _socket import SOCK_STREAM +from _socket import SOCK_DGRAM +from _socket import SOL_TCP +from _socket import AI_CANONNAME +from _socket import EAI_SERVICE +from _socket import AF_INET +from _socket import AI_PASSIVE + + +from gevent._compat import string_types +from gevent._compat import integer_types + +# Nothing public here. +__all__ = [] + +def _lookup_port(port, socktype): + # pylint:disable=too-many-branches + socktypes = [] + if isinstance(port, string_types): + try: + port = int(port) + except ValueError: + try: + if socktype == 0: + origport = port + try: + port = getservbyname(port, 'tcp') + socktypes.append(SOCK_STREAM) + except error: + port = getservbyname(port, 'udp') + socktypes.append(SOCK_DGRAM) + else: + try: + if port == getservbyname(origport, 'udp'): + socktypes.append(SOCK_DGRAM) + except error: + pass + elif socktype == SOCK_STREAM: + port = getservbyname(port, 'tcp') + elif socktype == SOCK_DGRAM: + port = getservbyname(port, 'udp') + else: + raise gaierror(EAI_SERVICE, 'Servname not supported for ai_socktype') + except error as ex: + if 'not found' in str(ex): + raise gaierror(EAI_SERVICE, 'Servname not supported for ai_socktype') + else: + raise gaierror(str(ex)) + except UnicodeEncodeError: + raise error('Int or String expected', port) + elif port is None: + port = 0 + elif isinstance(port, integer_types): + pass + else: + raise error('Int or String expected', port, type(port)) + port = int(port % 65536) + if not socktypes and socktype: + socktypes.append(socktype) + return port, socktypes + +hostname_types = tuple(set(string_types + (bytearray, bytes))) + +def _resolve_special(hostname, family): + if not isinstance(hostname, hostname_types): + raise TypeError("argument 1 must be str, bytes or bytearray, not %s" % (type(hostname),)) + + if hostname == '': + result = getaddrinfo(None, 0, family, SOCK_DGRAM, 0, AI_PASSIVE) + if len(result) != 1: + raise error('wildcard resolved to multiple address') + return result[0][4][0] + return hostname + + +class AbstractResolver(object): + + def gethostbyname(self, hostname, family=AF_INET): + hostname = _resolve_special(hostname, family) + return self.gethostbyname_ex(hostname, family)[-1][0] + + def gethostbyname_ex(self, hostname, family=AF_INET): + aliases = self._getaliases(hostname, family) + addresses = [] + tuples = self.getaddrinfo(hostname, 0, family, + SOCK_STREAM, + SOL_TCP, AI_CANONNAME) + canonical = tuples[0][3] + for item in tuples: + addresses.append(item[4][0]) + # XXX we just ignore aliases + return (canonical, aliases, addresses) + + def getaddrinfo(self, host, port, family=0, socktype=0, proto=0, flags=0): + raise NotImplementedError() + + def _getaliases(self, hostname, family): + # pylint:disable=unused-argument + return [] diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/resolver/ares.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/resolver/ares.py new file mode 100644 index 00000000..ea6e919f --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/resolver/ares.py @@ -0,0 +1,357 @@ +# Copyright (c) 2011-2015 Denis Bilenko. See LICENSE for details. +""" +c-ares based hostname resolver. +""" +from __future__ import absolute_import, print_function, division +import os +import sys + +from _socket import getaddrinfo +from _socket import gaierror +from _socket import error + +from gevent._compat import string_types +from gevent._compat import text_type + +from gevent._compat import reraise +from gevent._compat import PY3 + +from gevent.hub import Waiter +from gevent.hub import get_hub + +from gevent.socket import AF_UNSPEC +from gevent.socket import AF_INET +from gevent.socket import AF_INET6 +from gevent.socket import SOCK_STREAM +from gevent.socket import SOCK_DGRAM +from gevent.socket import SOCK_RAW +from gevent.socket import AI_NUMERICHOST + +from gevent._config import config +from gevent._config import AresSettingMixin + +from .cares import channel, InvalidIP # pylint:disable=import-error,no-name-in-module +from . import _lookup_port as lookup_port +from . import _resolve_special +from . import AbstractResolver + +__all__ = ['Resolver'] + + +class Resolver(AbstractResolver): + """ + Implementation of the resolver API using the `c-ares`_ library. + + This implementation uses the c-ares library to handle name + resolution. c-ares is natively asynchronous at the socket level + and so integrates well into gevent's event loop. + + In comparison to :class:`gevent.resolver_thread.Resolver` (which + delegates to the native system resolver), the implementation is + much more complex. In addition, there have been reports of it not + properly honoring certain system configurations (for example, the + order in which IPv4 and IPv6 results are returned may not match + the threaded resolver). However, because it does not use threads, + it may scale better for applications that make many lookups. + + There are some known differences from the system resolver: + + - ``gethostbyname_ex`` and ``gethostbyaddr`` may return different + for the ``aliaslist`` tuple member. (Sometimes the same, + sometimes in a different order, sometimes a different alias + altogether.) + - ``gethostbyname_ex`` may return the ``ipaddrlist`` in a different order. + - ``getaddrinfo`` does not return ``SOCK_RAW`` results. + - ``getaddrinfo`` may return results in a different order. + - Handling of ``.local`` (mDNS) names may be different, even if they are listed in + the hosts file. + - c-ares will not resolve ``broadcasthost``, even if listed in the hosts file. + - This implementation may raise ``gaierror(4)`` where the system implementation would raise + ``herror(1)``. + - The results for ``localhost`` may be different. In particular, some system + resolvers will return more results from ``getaddrinfo`` than c-ares does, + such as SOCK_DGRAM results, and c-ares may report more ips on a multi-homed + host. + + .. caution:: This module is considered extremely experimental on PyPy, and + due to its implementation in cython, it may be slower. It may also lead to + interpreter crashes. + + .. _c-ares: http://c-ares.haxx.se + """ + + ares_class = channel + + def __init__(self, hub=None, use_environ=True, **kwargs): + if hub is None: + hub = get_hub() + self.hub = hub + if use_environ: + for setting in config.settings.values(): + if isinstance(setting, AresSettingMixin): + value = setting.get() + if value is not None: + kwargs.setdefault(setting.kwarg_name, value) + self.ares = self.ares_class(hub.loop, **kwargs) + self.pid = os.getpid() + self.params = kwargs + self.fork_watcher = hub.loop.fork(ref=False) + self.fork_watcher.start(self._on_fork) + + def __repr__(self): + return '' % (id(self), self.ares) + + def _on_fork(self): + # NOTE: See comment in gevent.hub.reinit. + pid = os.getpid() + if pid != self.pid: + self.hub.loop.run_callback(self.ares.destroy) + self.ares = self.ares_class(self.hub.loop, **self.params) + self.pid = pid + + def close(self): + if self.ares is not None: + self.hub.loop.run_callback(self.ares.destroy) + self.ares = None + self.fork_watcher.stop() + + def gethostbyname(self, hostname, family=AF_INET): + hostname = _resolve_special(hostname, family) + return self.gethostbyname_ex(hostname, family)[-1][0] + + def gethostbyname_ex(self, hostname, family=AF_INET): + if PY3: + if isinstance(hostname, str): + hostname = hostname.encode('idna') + elif not isinstance(hostname, (bytes, bytearray)): + raise TypeError('Expected es(idna), not %s' % type(hostname).__name__) + else: + if isinstance(hostname, text_type): + hostname = hostname.encode('ascii') + elif not isinstance(hostname, str): + raise TypeError('Expected string, not %s' % type(hostname).__name__) + + while True: + ares = self.ares + try: + waiter = Waiter(self.hub) + ares.gethostbyname(waiter, hostname, family) + result = waiter.get() + if not result[-1]: + raise gaierror(-5, 'No address associated with hostname') + return result + except gaierror: + if ares is self.ares: + if hostname == b'255.255.255.255': + # The stdlib handles this case in 2.7 and 3.x, but ares does not. + # It is tested by test_socket.py in 3.4. + # HACK: So hardcode the expected return. + return ('255.255.255.255', [], ['255.255.255.255']) + raise + # "self.ares is not ares" means channel was destroyed (because we were forked) + + def _lookup_port(self, port, socktype): + return lookup_port(port, socktype) + + def _getaddrinfo(self, host, port, family=0, socktype=0, proto=0, flags=0): + # pylint:disable=too-many-locals,too-many-branches + if isinstance(host, text_type): + host = host.encode('idna') + elif not isinstance(host, str) or (flags & AI_NUMERICHOST): + # this handles cases which do not require network access + # 1) host is None + # 2) host is of an invalid type + # 3) AI_NUMERICHOST flag is set + return getaddrinfo(host, port, family, socktype, proto, flags) + # we also call _socket.getaddrinfo below if family is not one of AF_* + + port, socktypes = self._lookup_port(port, socktype) + + socktype_proto = [(SOCK_STREAM, 6), (SOCK_DGRAM, 17), (SOCK_RAW, 0)] + if socktypes: + socktype_proto = [(x, y) for (x, y) in socktype_proto if x in socktypes] + if proto: + socktype_proto = [(x, y) for (x, y) in socktype_proto if proto == y] + + ares = self.ares + + if family == AF_UNSPEC: + ares_values = Values(self.hub, 2) + ares.gethostbyname(ares_values, host, AF_INET) + ares.gethostbyname(ares_values, host, AF_INET6) + elif family == AF_INET: + ares_values = Values(self.hub, 1) + ares.gethostbyname(ares_values, host, AF_INET) + elif family == AF_INET6: + ares_values = Values(self.hub, 1) + ares.gethostbyname(ares_values, host, AF_INET6) + else: + raise gaierror(5, 'ai_family not supported: %r' % (family, )) + + values = ares_values.get() + if len(values) == 2 and values[0] == values[1]: + values.pop() + + result = [] + result4 = [] + result6 = [] + + for addrs in values: + if addrs.family == AF_INET: + for addr in addrs[-1]: + sockaddr = (addr, port) + for socktype4, proto4 in socktype_proto: + result4.append((AF_INET, socktype4, proto4, '', sockaddr)) + elif addrs.family == AF_INET6: + for addr in addrs[-1]: + if addr == '::1': + dest = result + else: + dest = result6 + sockaddr = (addr, port, 0, 0) + for socktype6, proto6 in socktype_proto: + dest.append((AF_INET6, socktype6, proto6, '', sockaddr)) + + # As of 2016, some platforms return IPV6 first and some do IPV4 first, + # and some might even allow configuration of which is which. For backwards + # compatibility with earlier releases (but not necessarily resolver_thread!) + # we return 4 first. See https://github.com/gevent/gevent/issues/815 for more. + result += result4 + result6 + + if not result: + raise gaierror(-5, 'No address associated with hostname') + + return result + + def getaddrinfo(self, host, port, family=0, socktype=0, proto=0, flags=0): + while True: + ares = self.ares + try: + return self._getaddrinfo(host, port, family, socktype, proto, flags) + except gaierror: + if ares is self.ares: + raise + + def _gethostbyaddr(self, ip_address): + if PY3: + if isinstance(ip_address, str): + ip_address = ip_address.encode('idna') + elif not isinstance(ip_address, (bytes, bytearray)): + raise TypeError('Expected es(idna), not %s' % type(ip_address).__name__) + else: + if isinstance(ip_address, text_type): + ip_address = ip_address.encode('ascii') + elif not isinstance(ip_address, str): + raise TypeError('Expected string, not %s' % type(ip_address).__name__) + + waiter = Waiter(self.hub) + try: + self.ares.gethostbyaddr(waiter, ip_address) + return waiter.get() + except InvalidIP: + result = self._getaddrinfo(ip_address, None, family=AF_UNSPEC, socktype=SOCK_DGRAM) + if not result: + raise + _ip_address = result[0][-1][0] + if isinstance(_ip_address, text_type): + _ip_address = _ip_address.encode('ascii') + if _ip_address == ip_address: + raise + waiter.clear() + self.ares.gethostbyaddr(waiter, _ip_address) + return waiter.get() + + def gethostbyaddr(self, ip_address): + ip_address = _resolve_special(ip_address, AF_UNSPEC) + while True: + ares = self.ares + try: + return self._gethostbyaddr(ip_address) + except gaierror: + if ares is self.ares: + raise + + def _getnameinfo(self, sockaddr, flags): + if not isinstance(flags, int): + raise TypeError('an integer is required') + if not isinstance(sockaddr, tuple): + raise TypeError('getnameinfo() argument 1 must be a tuple') + + address = sockaddr[0] + if not PY3 and isinstance(address, text_type): + address = address.encode('ascii') + + if not isinstance(address, string_types): + raise TypeError('sockaddr[0] must be a string, not %s' % type(address).__name__) + + port = sockaddr[1] + if not isinstance(port, int): + raise TypeError('port must be an integer, not %s' % type(port)) + + waiter = Waiter(self.hub) + result = self._getaddrinfo(address, str(sockaddr[1]), family=AF_UNSPEC, socktype=SOCK_DGRAM) + if not result: + reraise(*sys.exc_info()) + elif len(result) != 1: + raise error('sockaddr resolved to multiple addresses') + family, _socktype, _proto, _name, address = result[0] + + if family == AF_INET: + if len(sockaddr) != 2: + raise error("IPv4 sockaddr must be 2 tuple") + elif family == AF_INET6: + address = address[:2] + sockaddr[2:] + + self.ares.getnameinfo(waiter, address, flags) + node, service = waiter.get() + + if service is None: + if PY3: + # ares docs: "If the query did not complete + # successfully, or one of the values was not + # requested, node or service will be NULL ". Python 2 + # allows that for the service, but Python 3 raises + # an error. This is tested by test_socket in py 3.4 + err = gaierror('nodename nor servname provided, or not known') + err.errno = 8 + raise err + service = '0' + return node, service + + def getnameinfo(self, sockaddr, flags): + while True: + ares = self.ares + try: + return self._getnameinfo(sockaddr, flags) + except gaierror: + if ares is self.ares: + raise + + +class Values(object): + # helper to collect multiple values; ignore errors unless nothing has succeeded + # QQQ could probably be moved somewhere - hub.py? + + __slots__ = ['count', 'values', 'error', 'waiter'] + + def __init__(self, hub, count): + self.count = count + self.values = [] + self.error = None + self.waiter = Waiter(hub) + + def __call__(self, source): + self.count -= 1 + if source.exception is None: + self.values.append(source.value) + else: + self.error = source.exception + if self.count <= 0: + self.waiter.switch(None) + + def get(self): + self.waiter.get() + if self.values: + return self.values + assert error is not None + raise self.error # pylint:disable=raising-bad-type diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/resolver/blocking.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/resolver/blocking.py new file mode 100644 index 00000000..4a26a764 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/resolver/blocking.py @@ -0,0 +1,45 @@ +# Copyright (c) 2018 gevent contributors. See LICENSE for details. + +import _socket + +__all__ = [ + 'Resolver', +] + +class Resolver(object): + """ + A resolver that directly uses the system's resolver functions. + + .. caution:: + + This resolver is *not* cooperative. + + This resolver has the lowest overhead of any resolver and + typically approaches the speed of the unmodified :mod:`socket` + functions. However, it is not cooperative, so if name resolution + blocks, the entire thread and all its greenlets will be blocked. + + This can be useful during debugging, or it may be a good choice if + your operating system provides a good caching resolver (such as + macOS's Directory Services) that is usually very fast and + functionally non-blocking. + + .. versionchanged:: 1.3a2 + This was previously undocumented and existed in :mod:`gevent.socket`. + + """ + + def __init__(self, hub=None): + pass + + def close(self): + pass + + for method in ( + 'gethostbyname', + 'gethostbyname_ex', + 'getaddrinfo', + 'gethostbyaddr', + 'getnameinfo' + ): + locals()[method] = staticmethod(getattr(_socket, method)) diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/resolver/cares.c b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/resolver/cares.c new file mode 100644 index 00000000..8dc7c5fe --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/resolver/cares.c @@ -0,0 +1,15082 @@ +/* Generated by Cython 0.29.2 */ + +/* BEGIN: Cython Metadata +{ + "distutils": { + "define_macros": [ + [ + "FD_SETSIZE", + "1024" + ], + [ + "_WIN32", + "1" + ], + [ + "CARES_STATICLIB", + "" + ], + [ + "CARES_EMBED", + "1" + ] + ], + "depends": [ + "C:\\Users\\appveyor\\AppData\\Local\\Temp\\1\\pip-req-build-23dcp19e\\deps\\c-ares\\ares.h", + "src/gevent/resolver/dnshelper.c", + "src/gevent/resolver\\cares_ntop.h", + "src/gevent/resolver\\cares_pton.h", + "src\\gevent\\resolver\\cares_ntop.h", + "src\\gevent\\resolver\\cares_pton.h", + "src\\gevent\\resolver\\dnshelper.c" + ], + "include_dirs": [ + "src/gevent/resolver", + "C:\\Users\\appveyor\\AppData\\Local\\Temp\\1\\pip-req-build-23dcp19e\\deps\\c-ares" + ], + "libraries": [ + "ws2_32", + "advapi32" + ], + "name": "gevent.resolver.cares", + "sources": [ + "src/gevent/resolver/cares.pyx", + "deps/c-ares\\ares__close_sockets.c", + "deps/c-ares\\ares__get_hostent.c", + "deps/c-ares\\ares__read_line.c", + "deps/c-ares\\ares__timeval.c", + "deps/c-ares\\ares_android.c", + "deps/c-ares\\ares_cancel.c", + "deps/c-ares\\ares_create_query.c", + "deps/c-ares\\ares_data.c", + "deps/c-ares\\ares_destroy.c", + "deps/c-ares\\ares_expand_name.c", + "deps/c-ares\\ares_expand_string.c", + "deps/c-ares\\ares_fds.c", + "deps/c-ares\\ares_free_hostent.c", + "deps/c-ares\\ares_free_string.c", + "deps/c-ares\\ares_getenv.c", + "deps/c-ares\\ares_gethostbyaddr.c", + "deps/c-ares\\ares_gethostbyname.c", + "deps/c-ares\\ares_getnameinfo.c", + "deps/c-ares\\ares_getopt.c", + "deps/c-ares\\ares_getsock.c", + "deps/c-ares\\ares_init.c", + "deps/c-ares\\ares_library_init.c", + "deps/c-ares\\ares_llist.c", + "deps/c-ares\\ares_mkquery.c", + "deps/c-ares\\ares_nowarn.c", + "deps/c-ares\\ares_options.c", + "deps/c-ares\\ares_parse_a_reply.c", + "deps/c-ares\\ares_parse_aaaa_reply.c", + "deps/c-ares\\ares_parse_mx_reply.c", + "deps/c-ares\\ares_parse_naptr_reply.c", + "deps/c-ares\\ares_parse_ns_reply.c", + "deps/c-ares\\ares_parse_ptr_reply.c", + "deps/c-ares\\ares_parse_soa_reply.c", + "deps/c-ares\\ares_parse_srv_reply.c", + "deps/c-ares\\ares_parse_txt_reply.c", + "deps/c-ares\\ares_platform.c", + "deps/c-ares\\ares_process.c", + "deps/c-ares\\ares_query.c", + "deps/c-ares\\ares_search.c", + "deps/c-ares\\ares_send.c", + "deps/c-ares\\ares_strcasecmp.c", + "deps/c-ares\\ares_strdup.c", + "deps/c-ares\\ares_strerror.c", + "deps/c-ares\\ares_timeout.c", + "deps/c-ares\\ares_version.c", + "deps/c-ares\\ares_writev.c", + "deps/c-ares\\bitncmp.c", + "deps/c-ares\\inet_net_pton.c", + "deps/c-ares\\inet_ntop.c", + "deps/c-ares\\windows_port.c" + ] + }, + "module_name": "gevent.resolver.cares" +} +END: Cython Metadata */ + +#define PY_SSIZE_T_CLEAN +#include "Python.h" +#ifndef Py_PYTHON_H + #error Python headers needed to compile C extensions, please install development version of Python. +#elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) + #error Cython requires Python 2.6+ or Python 3.3+. +#else +#define CYTHON_ABI "0_29_2" +#define CYTHON_HEX_VERSION 0x001D02F0 +#define CYTHON_FUTURE_DIVISION 1 +#include +#ifndef offsetof + #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) +#endif +#if !defined(WIN32) && !defined(MS_WINDOWS) + #ifndef __stdcall + #define __stdcall + #endif + #ifndef __cdecl + #define __cdecl + #endif + #ifndef __fastcall + #define __fastcall + #endif +#endif +#ifndef DL_IMPORT + #define DL_IMPORT(t) t +#endif +#ifndef DL_EXPORT + #define DL_EXPORT(t) t +#endif +#define __PYX_COMMA , +#ifndef HAVE_LONG_LONG + #if PY_VERSION_HEX >= 0x02070000 + #define HAVE_LONG_LONG + #endif +#endif +#ifndef PY_LONG_LONG + #define PY_LONG_LONG LONG_LONG +#endif +#ifndef Py_HUGE_VAL + #define Py_HUGE_VAL HUGE_VAL +#endif +#ifdef PYPY_VERSION + #define CYTHON_COMPILING_IN_PYPY 1 + #define CYTHON_COMPILING_IN_PYSTON 0 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #undef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 0 + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #if PY_VERSION_HEX < 0x03050000 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #elif !defined(CYTHON_USE_ASYNC_SLOTS) + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #undef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 0 + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #undef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 1 + #undef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 0 + #undef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 0 + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #undef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE 0 + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 +#elif defined(PYSTON_VERSION) + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_PYSTON 1 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #ifndef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 1 + #endif + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #ifndef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 1 + #endif + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #ifndef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 0 + #endif + #ifndef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 1 + #endif + #ifndef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 1 + #endif + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #undef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE 0 + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 +#else + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_PYSTON 0 + #define CYTHON_COMPILING_IN_CPYTHON 1 + #ifndef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 1 + #endif + #if PY_VERSION_HEX < 0x02070000 + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #elif !defined(CYTHON_USE_PYTYPE_LOOKUP) + #define CYTHON_USE_PYTYPE_LOOKUP 1 + #endif + #if PY_MAJOR_VERSION < 3 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #elif !defined(CYTHON_USE_ASYNC_SLOTS) + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #if PY_VERSION_HEX < 0x02070000 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #elif !defined(CYTHON_USE_PYLONG_INTERNALS) + #define CYTHON_USE_PYLONG_INTERNALS 1 + #endif + #ifndef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 1 + #endif + #ifndef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 1 + #endif + #if PY_VERSION_HEX < 0x030300F0 + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #elif !defined(CYTHON_USE_UNICODE_WRITER) + #define CYTHON_USE_UNICODE_WRITER 1 + #endif + #ifndef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 0 + #endif + #ifndef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 1 + #endif + #ifndef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 1 + #endif + #ifndef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 1 + #endif + #ifndef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 1 + #endif + #ifndef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000) + #endif + #ifndef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1) + #endif + #ifndef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1) + #endif + #ifndef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3) + #endif +#endif +#if !defined(CYTHON_FAST_PYCCALL) +#define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) +#endif +#if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #undef SHIFT + #undef BASE + #undef MASK + #ifdef SIZEOF_VOID_P + enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) }; + #endif +#endif +#ifndef __has_attribute + #define __has_attribute(x) 0 +#endif +#ifndef __has_cpp_attribute + #define __has_cpp_attribute(x) 0 +#endif +#ifndef CYTHON_RESTRICT + #if defined(__GNUC__) + #define CYTHON_RESTRICT __restrict__ + #elif defined(_MSC_VER) && _MSC_VER >= 1400 + #define CYTHON_RESTRICT __restrict + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_RESTRICT restrict + #else + #define CYTHON_RESTRICT + #endif +#endif +#ifndef CYTHON_UNUSED +# if defined(__GNUC__) +# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +#endif +#ifndef CYTHON_MAYBE_UNUSED_VAR +# if defined(__cplusplus) + template void CYTHON_MAYBE_UNUSED_VAR( const T& ) { } +# else +# define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x) +# endif +#endif +#ifndef CYTHON_NCP_UNUSED +# if CYTHON_COMPILING_IN_CPYTHON +# define CYTHON_NCP_UNUSED +# else +# define CYTHON_NCP_UNUSED CYTHON_UNUSED +# endif +#endif +#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) +#ifdef _MSC_VER + #ifndef _MSC_STDINT_H_ + #if _MSC_VER < 1300 + typedef unsigned char uint8_t; + typedef unsigned int uint32_t; + #else + typedef unsigned __int8 uint8_t; + typedef unsigned __int32 uint32_t; + #endif + #endif +#else + #include +#endif +#ifndef CYTHON_FALLTHROUGH + #if defined(__cplusplus) && __cplusplus >= 201103L + #if __has_cpp_attribute(fallthrough) + #define CYTHON_FALLTHROUGH [[fallthrough]] + #elif __has_cpp_attribute(clang::fallthrough) + #define CYTHON_FALLTHROUGH [[clang::fallthrough]] + #elif __has_cpp_attribute(gnu::fallthrough) + #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] + #endif + #endif + #ifndef CYTHON_FALLTHROUGH + #if __has_attribute(fallthrough) + #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) + #else + #define CYTHON_FALLTHROUGH + #endif + #endif + #if defined(__clang__ ) && defined(__apple_build_version__) + #if __apple_build_version__ < 7000000 + #undef CYTHON_FALLTHROUGH + #define CYTHON_FALLTHROUGH + #endif + #endif +#endif + +#ifndef CYTHON_INLINE + #if defined(__clang__) + #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) + #elif defined(__GNUC__) + #define CYTHON_INLINE __inline__ + #elif defined(_MSC_VER) + #define CYTHON_INLINE __inline + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_INLINE inline + #else + #define CYTHON_INLINE + #endif +#endif + +#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) + #define Py_OptimizeFlag 0 +#endif +#define __PYX_BUILD_PY_SSIZE_T "n" +#define CYTHON_FORMAT_SSIZE_T "z" +#if PY_MAJOR_VERSION < 3 + #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyClass_Type +#else + #define __Pyx_BUILTIN_MODULE_NAME "builtins" + #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + #define __Pyx_DefaultClassType PyType_Type +#endif +#ifndef Py_TPFLAGS_CHECKTYPES + #define Py_TPFLAGS_CHECKTYPES 0 +#endif +#ifndef Py_TPFLAGS_HAVE_INDEX + #define Py_TPFLAGS_HAVE_INDEX 0 +#endif +#ifndef Py_TPFLAGS_HAVE_NEWBUFFER + #define Py_TPFLAGS_HAVE_NEWBUFFER 0 +#endif +#ifndef Py_TPFLAGS_HAVE_FINALIZE + #define Py_TPFLAGS_HAVE_FINALIZE 0 +#endif +#ifndef METH_STACKLESS + #define METH_STACKLESS 0 +#endif +#if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) + #ifndef METH_FASTCALL + #define METH_FASTCALL 0x80 + #endif + typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs); + typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args, + Py_ssize_t nargs, PyObject *kwnames); +#else + #define __Pyx_PyCFunctionFast _PyCFunctionFast + #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords +#endif +#if CYTHON_FAST_PYCCALL +#define __Pyx_PyFastCFunction_Check(func)\ + ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS))))) +#else +#define __Pyx_PyFastCFunction_Check(func) 0 +#endif +#if CYTHON_USE_DICT_VERSIONS +#define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) +#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ + (version_var) = __PYX_GET_DICT_VERSION(dict);\ + (cache_var) = (value); +#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ + static PY_UINT64_T __pyx_dict_version = 0;\ + static PyObject *__pyx_dict_cached_value = NULL;\ + if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ + (VAR) = __pyx_dict_cached_value;\ + } else {\ + (VAR) = __pyx_dict_cached_value = (LOOKUP);\ + __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ + }\ + } +#else +#define __PYX_GET_DICT_VERSION(dict) (0) +#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) +#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) + #define PyObject_Malloc(s) PyMem_Malloc(s) + #define PyObject_Free(p) PyMem_Free(p) + #define PyObject_Realloc(p) PyMem_Realloc(p) +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1 + #define PyMem_RawMalloc(n) PyMem_Malloc(n) + #define PyMem_RawRealloc(p, n) PyMem_Realloc(p, n) + #define PyMem_RawFree(p) PyMem_Free(p) +#endif +#if CYTHON_COMPILING_IN_PYSTON + #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co) + #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno) +#else + #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) + #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) +#endif +#if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000 + #define __Pyx_PyThreadState_Current PyThreadState_GET() +#elif PY_VERSION_HEX >= 0x03060000 + #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() +#elif PY_VERSION_HEX >= 0x03000000 + #define __Pyx_PyThreadState_Current PyThreadState_GET() +#else + #define __Pyx_PyThreadState_Current _PyThreadState_Current +#endif +#if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) +#include "pythread.h" +#define Py_tss_NEEDS_INIT 0 +typedef int Py_tss_t; +static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) { + *key = PyThread_create_key(); + return 0; // PyThread_create_key reports success always +} +static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) { + Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t)); + *key = Py_tss_NEEDS_INIT; + return key; +} +static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) { + PyObject_Free(key); +} +static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) { + return *key != Py_tss_NEEDS_INIT; +} +static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) { + PyThread_delete_key(*key); + *key = Py_tss_NEEDS_INIT; +} +static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) { + return PyThread_set_key_value(*key, value); +} +static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { + return PyThread_get_key_value(*key); +} +#endif // TSS (Thread Specific Storage) API +#if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized) +#define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) +#else +#define __Pyx_PyDict_NewPresized(n) PyDict_New() +#endif +#if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION + #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) +#else + #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS +#define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) +#else +#define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name) +#endif +#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) + #define CYTHON_PEP393_ENABLED 1 + #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ + 0 : _PyUnicode_Ready((PyObject *)(op))) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) + #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) + #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) + #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) + #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) + #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch) + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) +#else + #define CYTHON_PEP393_ENABLED 0 + #define PyUnicode_1BYTE_KIND 1 + #define PyUnicode_2BYTE_KIND 2 + #define PyUnicode_4BYTE_KIND 4 + #define __Pyx_PyUnicode_READY(op) (0) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) + #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111) + #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) + #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) + #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) + #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch) + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) +#endif +#if CYTHON_COMPILING_IN_PYPY + #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) +#else + #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ + PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains) + #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check) + #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format) + #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) +#endif +#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) +#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) +#else + #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) +#endif +#if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) + #define PyObject_ASCII(o) PyObject_Repr(o) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBaseString_Type PyUnicode_Type + #define PyStringObject PyUnicodeObject + #define PyString_Type PyUnicode_Type + #define PyString_Check PyUnicode_Check + #define PyString_CheckExact PyUnicode_CheckExact + #define PyObject_Unicode PyObject_Str +#endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) + #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) +#else + #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) + #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) +#endif +#ifndef PySet_CheckExact + #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) +#endif +#if CYTHON_ASSUME_SAFE_MACROS + #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) +#else + #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyIntObject PyLongObject + #define PyInt_Type PyLong_Type + #define PyInt_Check(op) PyLong_Check(op) + #define PyInt_CheckExact(op) PyLong_CheckExact(op) + #define PyInt_FromString PyLong_FromString + #define PyInt_FromUnicode PyLong_FromUnicode + #define PyInt_FromLong PyLong_FromLong + #define PyInt_FromSize_t PyLong_FromSize_t + #define PyInt_FromSsize_t PyLong_FromSsize_t + #define PyInt_AsLong PyLong_AsLong + #define PyInt_AS_LONG PyLong_AS_LONG + #define PyInt_AsSsize_t PyLong_AsSsize_t + #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask + #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask + #define PyNumber_Int PyNumber_Long +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBoolObject PyLongObject +#endif +#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY + #ifndef PyUnicode_InternFromString + #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) + #endif +#endif +#if PY_VERSION_HEX < 0x030200A4 + typedef long Py_hash_t; + #define __Pyx_PyInt_FromHash_t PyInt_FromLong + #define __Pyx_PyInt_AsHash_t PyInt_AsLong +#else + #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t + #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t +#endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : (Py_INCREF(func), func)) +#else + #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) +#endif +#if CYTHON_USE_ASYNC_SLOTS + #if PY_VERSION_HEX >= 0x030500B1 + #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods + #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) + #else + #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) + #endif +#else + #define __Pyx_PyType_AsAsync(obj) NULL +#endif +#ifndef __Pyx_PyAsyncMethodsStruct + typedef struct { + unaryfunc am_await; + unaryfunc am_aiter; + unaryfunc am_anext; + } __Pyx_PyAsyncMethodsStruct; +#endif + +#if defined(WIN32) || defined(MS_WINDOWS) + #define _USE_MATH_DEFINES +#endif +#include +#ifdef NAN +#define __PYX_NAN() ((float) NAN) +#else +static CYTHON_INLINE float __PYX_NAN() { + float value; + memset(&value, 0xFF, sizeof(value)); + return value; +} +#endif +#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) +#define __Pyx_truncl trunc +#else +#define __Pyx_truncl truncl +#endif + + +#define __PYX_ERR(f_index, lineno, Ln_error) \ +{ \ + __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \ +} + +#ifndef __PYX_EXTERN_C + #ifdef __cplusplus + #define __PYX_EXTERN_C extern "C" + #else + #define __PYX_EXTERN_C extern + #endif +#endif + +#define __PYX_HAVE__gevent__resolver__cares +#define __PYX_HAVE_API__gevent__resolver__cares +/* Early includes */ +#include "ares.h" +#include "cares_pton.h" +#include +#include +#include "dnshelper.c" +#ifdef _OPENMP +#include +#endif /* _OPENMP */ + +#if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) +#define CYTHON_WITHOUT_ASSERTIONS +#endif + +typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; + const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; + +#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 +#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0 +#define __PYX_DEFAULT_STRING_ENCODING "" +#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString +#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#define __Pyx_uchar_cast(c) ((unsigned char)c) +#define __Pyx_long_cast(x) ((long)x) +#define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ + (sizeof(type) < sizeof(Py_ssize_t)) ||\ + (sizeof(type) > sizeof(Py_ssize_t) &&\ + likely(v < (type)PY_SSIZE_T_MAX ||\ + v == (type)PY_SSIZE_T_MAX) &&\ + (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ + v == (type)PY_SSIZE_T_MIN))) ||\ + (sizeof(type) == sizeof(Py_ssize_t) &&\ + (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ + v == (type)PY_SSIZE_T_MAX))) ) +static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) { + return (size_t) i < (size_t) limit; +} +#if defined (__cplusplus) && __cplusplus >= 201103L + #include + #define __Pyx_sst_abs(value) std::abs(value) +#elif SIZEOF_INT >= SIZEOF_SIZE_T + #define __Pyx_sst_abs(value) abs(value) +#elif SIZEOF_LONG >= SIZEOF_SIZE_T + #define __Pyx_sst_abs(value) labs(value) +#elif defined (_MSC_VER) + #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) +#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define __Pyx_sst_abs(value) llabs(value) +#elif defined (__GNUC__) + #define __Pyx_sst_abs(value) __builtin_llabs(value) +#else + #define __Pyx_sst_abs(value) ((value<0) ? -value : value) +#endif +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*); +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); +#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) +#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) +#define __Pyx_PyBytes_FromString PyBytes_FromString +#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); +#if PY_MAJOR_VERSION < 3 + #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#else + #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize +#endif +#define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) +#define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) +#define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) +#define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) +#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) +static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) { + const Py_UNICODE *u_end = u; + while (*u_end++) ; + return (size_t)(u_end - u - 1); +} +#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) +#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode +#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode +#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) +#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) +static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); +static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*); +static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); +#define __Pyx_PySequence_Tuple(obj)\ + (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); +#if CYTHON_ASSUME_SAFE_MACROS +#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) +#else +#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) +#endif +#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) +#if PY_MAJOR_VERSION >= 3 +#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) +#else +#define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) +#endif +#define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x)) +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII +static int __Pyx_sys_getdefaultencoding_not_ascii; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + PyObject* ascii_chars_u = NULL; + PyObject* ascii_chars_b = NULL; + const char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + if (strcmp(default_encoding_c, "ascii") == 0) { + __Pyx_sys_getdefaultencoding_not_ascii = 0; + } else { + char ascii_chars[128]; + int c; + for (c = 0; c < 128; c++) { + ascii_chars[c] = c; + } + __Pyx_sys_getdefaultencoding_not_ascii = 1; + ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); + if (!ascii_chars_u) goto bad; + ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); + if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { + PyErr_Format( + PyExc_ValueError, + "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", + default_encoding_c); + goto bad; + } + Py_DECREF(ascii_chars_u); + Py_DECREF(ascii_chars_b); + } + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + Py_XDECREF(ascii_chars_u); + Py_XDECREF(ascii_chars_b); + return -1; +} +#endif +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) +#else +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +static char* __PYX_DEFAULT_STRING_ENCODING; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1); + if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; + strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + return -1; +} +#endif +#endif + + +/* Test for GCC > 2.95 */ +#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) + #define likely(x) __builtin_expect(!!(x), 1) + #define unlikely(x) __builtin_expect(!!(x), 0) +#else /* !__GNUC__ or GCC < 2.95 */ + #define likely(x) (x) + #define unlikely(x) (x) +#endif /* __GNUC__ */ +static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } + +static PyObject *__pyx_m = NULL; +static PyObject *__pyx_d; +static PyObject *__pyx_b; +static PyObject *__pyx_cython_runtime = NULL; +static PyObject *__pyx_empty_tuple; +static PyObject *__pyx_empty_bytes; +static PyObject *__pyx_empty_unicode; +static int __pyx_lineno; +static int __pyx_clineno = 0; +static const char * __pyx_cfilenm= __FILE__; +static const char *__pyx_filename; + + +static const char *__pyx_f[] = { + "src\\gevent\\resolver\\cares.pyx", + "type.pxd", +}; + +/*--- Type declarations ---*/ +struct __pyx_obj_6gevent_8resolver_5cares_result; +struct __pyx_obj_6gevent_8resolver_5cares_channel; +struct __pyx_opt_args_6gevent_8resolver_5cares__convert_cares_flags; +struct __pyx_opt_args_6gevent_8resolver_5cares_7channel_set_servers; + +/* "gevent/resolver/cares.pyx":146 + * + * + * cpdef _convert_cares_flags(int flags, int default=cares.ARES_NI_LOOKUPHOST|cares.ARES_NI_LOOKUPSERVICE): # <<<<<<<<<<<<<< + * if _cares_flag_map is None: + * _prepare_cares_flag_map() + */ +struct __pyx_opt_args_6gevent_8resolver_5cares__convert_cares_flags { + int __pyx_n; + int __pyx_default; +}; + +/* "gevent/resolver/cares.pyx":323 + * self.channel = NULL + * + * cpdef set_servers(self, servers=None): # <<<<<<<<<<<<<< + * if not self.channel: + * raise gaierror(cares.ARES_EDESTRUCTION, 'this ares channel has been destroyed') + */ +struct __pyx_opt_args_6gevent_8resolver_5cares_7channel_set_servers { + int __pyx_n; + PyObject *servers; +}; + +/* "gevent/resolver/cares.pyx":173 + * + * + * cdef class result: # <<<<<<<<<<<<<< + * cdef public object value + * cdef public object exception + */ +struct __pyx_obj_6gevent_8resolver_5cares_result { + PyObject_HEAD + PyObject *value; + PyObject *exception; +}; + + +/* "gevent/resolver/cares.pyx":254 + * + * + * cdef class channel: # <<<<<<<<<<<<<< + * + * cdef public object loop + */ +struct __pyx_obj_6gevent_8resolver_5cares_channel { + PyObject_HEAD + struct __pyx_vtabstruct_6gevent_8resolver_5cares_channel *__pyx_vtab; + PyObject *loop; + struct ares_channeldata *channel; + PyObject *_watchers; + PyObject *_timer; +}; + + + +struct __pyx_vtabstruct_6gevent_8resolver_5cares_channel { + PyObject *(*set_servers)(struct __pyx_obj_6gevent_8resolver_5cares_channel *, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_8resolver_5cares_7channel_set_servers *__pyx_optional_args); + PyObject *(*_sock_state_callback)(struct __pyx_obj_6gevent_8resolver_5cares_channel *, int, int, int); + PyObject *(*_getnameinfo)(struct __pyx_obj_6gevent_8resolver_5cares_channel *, PyObject *, PyObject *, int, int __pyx_skip_dispatch); +}; +static struct __pyx_vtabstruct_6gevent_8resolver_5cares_channel *__pyx_vtabptr_6gevent_8resolver_5cares_channel; + +/* --- Runtime support code (head) --- */ +/* Refnanny.proto */ +#ifndef CYTHON_REFNANNY + #define CYTHON_REFNANNY 0 +#endif +#if CYTHON_REFNANNY + typedef struct { + void (*INCREF)(void*, PyObject*, int); + void (*DECREF)(void*, PyObject*, int); + void (*GOTREF)(void*, PyObject*, int); + void (*GIVEREF)(void*, PyObject*, int); + void* (*SetupContext)(const char*, int, const char*); + void (*FinishContext)(void**); + } __Pyx_RefNannyAPIStruct; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); + #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; +#ifdef WITH_THREAD + #define __Pyx_RefNannySetupContext(name, acquire_gil)\ + if (acquire_gil) {\ + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ + PyGILState_Release(__pyx_gilstate_save);\ + } else {\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ + } +#else + #define __Pyx_RefNannySetupContext(name, acquire_gil)\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) +#endif + #define __Pyx_RefNannyFinishContext()\ + __Pyx_RefNanny->FinishContext(&__pyx_refnanny) + #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0) + #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) + #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) + #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) +#else + #define __Pyx_RefNannyDeclarations + #define __Pyx_RefNannySetupContext(name, acquire_gil) + #define __Pyx_RefNannyFinishContext() + #define __Pyx_INCREF(r) Py_INCREF(r) + #define __Pyx_DECREF(r) Py_DECREF(r) + #define __Pyx_GOTREF(r) + #define __Pyx_GIVEREF(r) + #define __Pyx_XINCREF(r) Py_XINCREF(r) + #define __Pyx_XDECREF(r) Py_XDECREF(r) + #define __Pyx_XGOTREF(r) + #define __Pyx_XGIVEREF(r) +#endif +#define __Pyx_XDECREF_SET(r, v) do {\ + PyObject *tmp = (PyObject *) r;\ + r = v; __Pyx_XDECREF(tmp);\ + } while (0) +#define __Pyx_DECREF_SET(r, v) do {\ + PyObject *tmp = (PyObject *) r;\ + r = v; __Pyx_DECREF(tmp);\ + } while (0) +#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) +#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) + +/* PyObjectGetAttrStr.proto */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); +#else +#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) +#endif + +/* GetBuiltinName.proto */ +static PyObject *__Pyx_GetBuiltinName(PyObject *name); + +/* Import.proto */ +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); + +/* PyErrExceptionMatches.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) +static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); +#else +#define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) +#endif + +/* PyThreadStateGet.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; +#define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; +#define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type +#else +#define __Pyx_PyThreadState_declare +#define __Pyx_PyThreadState_assign +#define __Pyx_PyErr_Occurred() PyErr_Occurred() +#endif + +/* PyErrFetchRestore.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) +#define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) +#define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) +#define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) +#define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); +static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) +#else +#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) +#endif +#else +#define __Pyx_PyErr_Clear() PyErr_Clear() +#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) +#define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) +#define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb) +#define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) +#endif + +/* GetAttr.proto */ +static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *); + +/* GetAttr3.proto */ +static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *); + +/* GetModuleGlobalName.proto */ +#if CYTHON_USE_DICT_VERSIONS +#define __Pyx_GetModuleGlobalName(var, name) {\ + static PY_UINT64_T __pyx_dict_version = 0;\ + static PyObject *__pyx_dict_cached_value = NULL;\ + (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\ + (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\ + __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ +} +#define __Pyx_GetModuleGlobalNameUncached(var, name) {\ + PY_UINT64_T __pyx_dict_version;\ + PyObject *__pyx_dict_cached_value;\ + (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ +} +static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value); +#else +#define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name) +#define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name) +static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name); +#endif + +/* RaiseTooManyValuesToUnpack.proto */ +static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); + +/* RaiseNeedMoreValuesToUnpack.proto */ +static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); + +/* IterFinish.proto */ +static CYTHON_INLINE int __Pyx_IterFinish(void); + +/* UnpackItemEndCheck.proto */ +static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); + +/* PyFunctionFastCall.proto */ +#if CYTHON_FAST_PYCALL +#define __Pyx_PyFunction_FastCall(func, args, nargs)\ + __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) +#if 1 || PY_VERSION_HEX < 0x030600B1 +static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs); +#else +#define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs) +#endif +#define __Pyx_BUILD_ASSERT_EXPR(cond)\ + (sizeof(char [1 - 2*!(cond)]) - 1) +#ifndef Py_MEMBER_SIZE +#define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member) +#endif + static size_t __pyx_pyframe_localsplus_offset = 0; + #include "frameobject.h" + #define __Pxy_PyFrame_Initialize_Offsets()\ + ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\ + (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus))) + #define __Pyx_PyFrame_GetLocalsplus(frame)\ + (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset)) +#endif + +/* PyCFunctionFastCall.proto */ +#if CYTHON_FAST_PYCCALL +static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs); +#else +#define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL) +#endif + +/* PyObjectCall.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); +#else +#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) +#endif + +/* RaiseException.proto */ +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); + +/* RaiseDoubleKeywords.proto */ +static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); + +/* ParseKeywords.proto */ +static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\ + PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\ + const char* function_name); + +/* RaiseArgTupleInvalid.proto */ +static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, + Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); + +/* PyObjectCall2Args.proto */ +static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2); + +/* PyObjectCallMethO.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); +#endif + +/* PyObjectCallOneArg.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); + +/* WriteUnraisableException.proto */ +static void __Pyx_WriteUnraisable(const char *name, int clineno, + int lineno, const char *filename, + int full_traceback, int nogil); + +/* PyObjectSetAttrStr.proto */ +#if CYTHON_USE_TYPE_SLOTS +#define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o, n, NULL) +static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value); +#else +#define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n) +#define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v) +#endif + +/* RaiseNoneIterError.proto */ +static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void); + +/* ExtTypeTest.proto */ +static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); + +/* GetTopmostException.proto */ +#if CYTHON_USE_EXC_INFO_STACK +static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate); +#endif + +/* SaveResetException.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); +#else +#define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb) +#define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb) +#endif + +/* GetException.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb) +static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#else +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); +#endif + +/* PyObjectCallNoArg.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); +#else +#define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL) +#endif + +/* GetItemInt.proto */ +#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ + __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\ + (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\ + __Pyx_GetItemInt_Generic(o, to_py_func(i)))) +#define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ + __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ + (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL)) +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, + int wraparound, int boundscheck); +#define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ + __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ + (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL)) +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, + int wraparound, int boundscheck); +static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j); +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, + int is_list, int wraparound, int boundscheck); + +/* pyobject_as_double.proto */ +static double __Pyx__PyObject_AsDouble(PyObject* obj); +#if CYTHON_COMPILING_IN_PYPY +#define __Pyx_PyObject_AsDouble(obj)\ +(likely(PyFloat_CheckExact(obj)) ? PyFloat_AS_DOUBLE(obj) :\ + likely(PyInt_CheckExact(obj)) ?\ + PyFloat_AsDouble(obj) : __Pyx__PyObject_AsDouble(obj)) +#else +#define __Pyx_PyObject_AsDouble(obj)\ +((likely(PyFloat_CheckExact(obj))) ?\ + PyFloat_AS_DOUBLE(obj) : __Pyx__PyObject_AsDouble(obj)) +#endif + +/* py_dict_clear.proto */ +#define __Pyx_PyDict_Clear(d) (PyDict_Clear(d), 0) + +/* SwapException.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#else +static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb); +#endif + +/* dict_getitem_default.proto */ +static PyObject* __Pyx_PyDict_GetItemDefault(PyObject* d, PyObject* key, PyObject* default_value); + +/* UnpackUnboundCMethod.proto */ +typedef struct { + PyObject *type; + PyObject **method_name; + PyCFunction func; + PyObject *method; + int flag; +} __Pyx_CachedCFunction; + +/* CallUnboundCMethod1.proto */ +static PyObject* __Pyx__CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg); +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg); +#else +#define __Pyx_CallUnboundCMethod1(cfunc, self, arg) __Pyx__CallUnboundCMethod1(cfunc, self, arg) +#endif + +/* CallUnboundCMethod2.proto */ +static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2); +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030600B1 +static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2); +#else +#define __Pyx_CallUnboundCMethod2(cfunc, self, arg1, arg2) __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2) +#endif + +/* py_dict_pop.proto */ +static CYTHON_INLINE PyObject *__Pyx_PyDict_Pop(PyObject *d, PyObject *key, PyObject *default_value); + +/* ArgTypeTest.proto */ +#define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\ + ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\ + __Pyx__ArgTypeTest(obj, type, name, exact)) +static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact); + +/* FastTypeChecks.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) +static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b); +static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type); +static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2); +#else +#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) +#define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) +#define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) +#endif +#define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) + +/* PyObject_GenericGetAttrNoDict.proto */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name); +#else +#define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr +#endif + +/* PyObject_GenericGetAttr.proto */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name); +#else +#define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr +#endif + +/* SetVTable.proto */ +static int __Pyx_SetVtable(PyObject *dict, void *vtable); + +/* TypeImport.proto */ +#ifndef __PYX_HAVE_RT_ImportType_proto +#define __PYX_HAVE_RT_ImportType_proto +enum __Pyx_ImportType_CheckSize { + __Pyx_ImportType_CheckSize_Error = 0, + __Pyx_ImportType_CheckSize_Warn = 1, + __Pyx_ImportType_CheckSize_Ignore = 2 +}; +static PyTypeObject *__Pyx_ImportType(PyObject* module, const char *module_name, const char *class_name, size_t size, enum __Pyx_ImportType_CheckSize check_size); +#endif + +/* ImportFrom.proto */ +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); + +/* CalculateMetaclass.proto */ +static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases); + +/* Py3ClassCreate.proto */ +static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname, + PyObject *mkw, PyObject *modname, PyObject *doc); +static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict, + PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass); + +/* FetchCommonType.proto */ +static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); + +/* CythonFunction.proto */ +#define __Pyx_CyFunction_USED 1 +#define __Pyx_CYFUNCTION_STATICMETHOD 0x01 +#define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 +#define __Pyx_CYFUNCTION_CCLASS 0x04 +#define __Pyx_CyFunction_GetClosure(f)\ + (((__pyx_CyFunctionObject *) (f))->func_closure) +#define __Pyx_CyFunction_GetClassObj(f)\ + (((__pyx_CyFunctionObject *) (f))->func_classobj) +#define __Pyx_CyFunction_Defaults(type, f)\ + ((type *)(((__pyx_CyFunctionObject *) (f))->defaults)) +#define __Pyx_CyFunction_SetDefaultsGetter(f, g)\ + ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g) +typedef struct { + PyCFunctionObject func; +#if PY_VERSION_HEX < 0x030500A0 + PyObject *func_weakreflist; +#endif + PyObject *func_dict; + PyObject *func_name; + PyObject *func_qualname; + PyObject *func_doc; + PyObject *func_globals; + PyObject *func_code; + PyObject *func_closure; + PyObject *func_classobj; + void *defaults; + int defaults_pyobjects; + int flags; + PyObject *defaults_tuple; + PyObject *defaults_kwdict; + PyObject *(*defaults_getter)(PyObject *); + PyObject *func_annotations; +} __pyx_CyFunctionObject; +static PyTypeObject *__pyx_CyFunctionType = 0; +#define __Pyx_CyFunction_Check(obj) (__Pyx_TypeCheck(obj, __pyx_CyFunctionType)) +#define __Pyx_CyFunction_NewEx(ml, flags, qualname, self, module, globals, code)\ + __Pyx_CyFunction_New(__pyx_CyFunctionType, ml, flags, qualname, self, module, globals, code) +static PyObject *__Pyx_CyFunction_New(PyTypeObject *, PyMethodDef *ml, + int flags, PyObject* qualname, + PyObject *self, + PyObject *module, PyObject *globals, + PyObject* code); +static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, + size_t size, + int pyobjects); +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, + PyObject *tuple); +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, + PyObject *dict); +static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m, + PyObject *dict); +static int __pyx_CyFunction_init(void); + +/* SetNameInClass.proto */ +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 +#define __Pyx_SetNameInClass(ns, name, value)\ + (likely(PyDict_CheckExact(ns)) ? _PyDict_SetItem_KnownHash(ns, name, value, ((PyASCIIObject *) name)->hash) : PyObject_SetItem(ns, name, value)) +#elif CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_SetNameInClass(ns, name, value)\ + (likely(PyDict_CheckExact(ns)) ? PyDict_SetItem(ns, name, value) : PyObject_SetItem(ns, name, value)) +#else +#define __Pyx_SetNameInClass(ns, name, value) PyObject_SetItem(ns, name, value) +#endif + +/* CLineInTraceback.proto */ +#ifdef CYTHON_CLINE_IN_TRACEBACK +#define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) +#else +static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line); +#endif + +/* CodeObjectCache.proto */ +typedef struct { + PyCodeObject* code_object; + int code_line; +} __Pyx_CodeObjectCacheEntry; +struct __Pyx_CodeObjectCache { + int count; + int max_count; + __Pyx_CodeObjectCacheEntry* entries; +}; +static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); +static PyCodeObject *__pyx_find_code_object(int code_line); +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); + +/* AddTraceback.proto */ +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename); + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); + +/* CIntFromPy.proto */ +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); + +/* CIntFromPy.proto */ +static CYTHON_INLINE unsigned short __Pyx_PyInt_As_unsigned_short(PyObject *); + +/* CIntFromPy.proto */ +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); + +/* CheckBinaryVersion.proto */ +static int __Pyx_check_binary_version(void); + +/* InitStrings.proto */ +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); + +static PyObject *__pyx_f_6gevent_8resolver_5cares_7channel_set_servers(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_8resolver_5cares_7channel_set_servers *__pyx_optional_args); /* proto*/ +static PyObject *__pyx_f_6gevent_8resolver_5cares_7channel__sock_state_callback(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self, int __pyx_v_socket, int __pyx_v_read, int __pyx_v_write); /* proto*/ +static PyObject *__pyx_f_6gevent_8resolver_5cares_7channel__getnameinfo(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self, PyObject *__pyx_v_callback, PyObject *__pyx_v_sockaddr, int __pyx_v_flags, int __pyx_skip_dispatch); /* proto*/ + +/* Module declarations from 'libcares' */ + +/* Module declarations from 'libc.string' */ + +/* Module declarations from 'libc.stdio' */ + +/* Module declarations from '__builtin__' */ + +/* Module declarations from 'cpython.type' */ +static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0; + +/* Module declarations from 'cpython' */ + +/* Module declarations from 'cpython.object' */ + +/* Module declarations from 'cpython.ref' */ + +/* Module declarations from 'cpython.mem' */ + +/* Module declarations from 'gevent.resolver.cares' */ +static PyTypeObject *__pyx_ptype_6gevent_8resolver_5cares_result = 0; +static PyTypeObject *__pyx_ptype_6gevent_8resolver_5cares_channel = 0; +static PyObject *__pyx_v_6gevent_8resolver_5cares_string_types = 0; +static PyObject *__pyx_v_6gevent_8resolver_5cares_text_type = 0; +static PyObject *__pyx_f_6gevent_8resolver_5cares__prepare_cares_flag_map(void); /*proto*/ +static PyObject *__pyx_f_6gevent_8resolver_5cares__convert_cares_flags(int, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_8resolver_5cares__convert_cares_flags *__pyx_optional_args); /*proto*/ +static PyObject *__pyx_f_6gevent_8resolver_5cares_strerror(PyObject *, int __pyx_skip_dispatch); /*proto*/ +static void __pyx_f_6gevent_8resolver_5cares_gevent_sock_state_callback(void *, int, int, int); /*proto*/ +static void __pyx_f_6gevent_8resolver_5cares_gevent_ares_host_callback(void *, int, int, struct hostent *); /*proto*/ +static void __pyx_f_6gevent_8resolver_5cares_gevent_ares_nameinfo_callback(void *, int, int, char *, char *); /*proto*/ +#define __Pyx_MODULE_NAME "gevent.resolver.cares" +extern int __pyx_module_is_main_gevent__resolver__cares; +int __pyx_module_is_main_gevent__resolver__cares = 0; + +/* Implementation of 'gevent.resolver.cares' */ +static PyObject *__pyx_builtin_ValueError; +static PyObject *__pyx_builtin_id; +static PyObject *__pyx_builtin_MemoryError; +static PyObject *__pyx_builtin_TypeError; +static const char __pyx_k__2[] = ","; +static const char __pyx_k_fd[] = "fd"; +static const char __pyx_k_id[] = "id"; +static const char __pyx_k_io[] = "io"; +static const char __pyx_k_all[] = "__all__"; +static const char __pyx_k_cls[] = "cls"; +static const char __pyx_k_doc[] = "__doc__"; +static const char __pyx_k_get[] = "get"; +static const char __pyx_k_new[] = "__new__"; +static const char __pyx_k_pop[] = "pop"; +static const char __pyx_k_s_r[] = "%s(%r)"; +static const char __pyx_k_s_s[] = "%s: %s"; +static const char __pyx_k_sys[] = "sys"; +static const char __pyx_k_addr[] = "addr"; +static const char __pyx_k_loop[] = "loop"; +static const char __pyx_k_main[] = "__main__"; +static const char __pyx_k_name[] = "__name__"; +static const char __pyx_k_self[] = "self"; +static const char __pyx_k_stop[] = "stop"; +static const char __pyx_k_test[] = "__test__"; +static const char __pyx_k_again[] = "again"; +static const char __pyx_k_ascii[] = "ascii"; +static const char __pyx_k_class[] = "__class__"; +static const char __pyx_k_close[] = "close"; +static const char __pyx_k_flags[] = "flags"; +static const char __pyx_k_ndots[] = "ndots"; +static const char __pyx_k_split[] = "split"; +static const char __pyx_k_start[] = "start"; +static const char __pyx_k_timer[] = "timer"; +static const char __pyx_k_tries[] = "tries"; +static const char __pyx_k_value[] = "value"; +static const char __pyx_k_encode[] = "encode"; +static const char __pyx_k_events[] = "events"; +static const char __pyx_k_family[] = "family"; +static const char __pyx_k_import[] = "__import__"; +static const char __pyx_k_module[] = "__module__"; +static const char __pyx_k_name_2[] = "name"; +static const char __pyx_k_result[] = "result"; +static const char __pyx_k_socket[] = "_socket"; +static const char __pyx_k_TIMEOUT[] = "TIMEOUT"; +static const char __pyx_k_channel[] = "channel"; +static const char __pyx_k_default[] = "default"; +static const char __pyx_k_destroy[] = "destroy"; +static const char __pyx_k_prepare[] = "__prepare__"; +static const char __pyx_k_servers[] = "servers"; +static const char __pyx_k_timeout[] = "timeout"; +static const char __pyx_k_unicode[] = "unicode"; +static const char __pyx_k_watcher[] = "watcher"; +static const char __pyx_k_ARES_EOF[] = "ARES_EOF"; +static const char __pyx_k_NI_DGRAM[] = "NI_DGRAM"; +static const char __pyx_k_builtins[] = "__builtins__"; +static const char __pyx_k_callback[] = "callback"; +static const char __pyx_k_exc_info[] = "exc_info"; +static const char __pyx_k_gaierror[] = "gaierror"; +static const char __pyx_k_iterable[] = "iterable"; +static const char __pyx_k_on_timer[] = "_on_timer"; +static const char __pyx_k_qualname[] = "__qualname__"; +static const char __pyx_k_sockaddr[] = "sockaddr"; +static const char __pyx_k_tcp_port[] = "tcp_port"; +static const char __pyx_k_udp_port[] = "udp_port"; +static const char __pyx_k_InvalidIP[] = "InvalidIP"; +static const char __pyx_k_NI_NOFQDN[] = "NI_NOFQDN"; +static const char __pyx_k_TypeError[] = "TypeError"; +static const char __pyx_k_exception[] = "exception"; +static const char __pyx_k_metaclass[] = "__metaclass__"; +static const char __pyx_k_ARES_EFILE[] = "ARES_EFILE"; +static const char __pyx_k_ValueError[] = "ValueError"; +static const char __pyx_k_basestring[] = "basestring"; +static const char __pyx_k_getnewargs[] = "__getnewargs__"; +static const char __pyx_k_process_fd[] = "_process_fd"; +static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__"; +static const char __pyx_k_ARES_ENOMEM[] = "ARES_ENOMEM"; +static const char __pyx_k_MemoryError[] = "MemoryError"; +static const char __pyx_k_NI_NAMEREQD[] = "NI_NAMEREQD"; +static const char __pyx_k_ares_errors[] = "_ares_errors"; +static const char __pyx_k_getnameinfo[] = "_getnameinfo"; +static const char __pyx_k_pass_events[] = "pass_events"; +static const char __pyx_k_set_servers[] = "set_servers"; +static const char __pyx_k_ARES_EBADSTR[] = "ARES_EBADSTR"; +static const char __pyx_k_ARES_ENODATA[] = "ARES_ENODATA"; +static const char __pyx_k_ARES_ENONAME[] = "ARES_ENONAME"; +static const char __pyx_k_ARES_ENOTIMP[] = "ARES_ENOTIMP"; +static const char __pyx_k_ARES_SUCCESS[] = "ARES_SUCCESS"; +static const char __pyx_k_handle_error[] = "handle_error"; +static const char __pyx_k_version_info[] = "version_info"; +static const char __pyx_k_ARES_EBADNAME[] = "ARES_EBADNAME"; +static const char __pyx_k_ARES_EBADRESP[] = "ARES_EBADRESP"; +static const char __pyx_k_ARES_EFORMERR[] = "ARES_EFORMERR"; +static const char __pyx_k_ARES_EREFUSED[] = "ARES_EREFUSED"; +static const char __pyx_k_ARES_ETIMEOUT[] = "ARES_ETIMEOUT"; +static const char __pyx_k_s_exception_r[] = "%s(exception=%r)"; +static const char __pyx_k_ARES_EBADFLAGS[] = "ARES_EBADFLAGS"; +static const char __pyx_k_ARES_EBADHINTS[] = "ARES_EBADHINTS"; +static const char __pyx_k_ARES_EBADQUERY[] = "ARES_EBADQUERY"; +static const char __pyx_k_ARES_ENOTFOUND[] = "ARES_ENOTFOUND"; +static const char __pyx_k_ARES_ESERVFAIL[] = "ARES_ESERVFAIL"; +static const char __pyx_k_NI_NUMERICHOST[] = "NI_NUMERICHOST"; +static const char __pyx_k_NI_NUMERICSERV[] = "NI_NUMERICSERV"; +static const char __pyx_k_cares_flag_map[] = "_cares_flag_map"; +static const char __pyx_k_ARES_EBADFAMILY[] = "ARES_EBADFAMILY"; +static const char __pyx_k_ARES_ECANCELLED[] = "ARES_ECANCELLED"; +static const char __pyx_k_ARES_FLAG_IGNTC[] = "ARES_FLAG_IGNTC"; +static const char __pyx_k_ARES_FLAG_USEVC[] = "ARES_FLAG_USEVC"; +static const char __pyx_k_ares_host_result[] = "ares_host_result"; +static const char __pyx_k_ARES_ECONNREFUSED[] = "ARES_ECONNREFUSED"; +static const char __pyx_k_ARES_EDESTRUCTION[] = "ARES_EDESTRUCTION"; +static const char __pyx_k_ARES_FLAG_PRIMARY[] = "ARES_FLAG_PRIMARY"; +static const char __pyx_k_ARES_ELOADIPHLPAPI[] = "ARES_ELOADIPHLPAPI"; +static const char __pyx_k_ARES_FLAG_NOSEARCH[] = "ARES_FLAG_NOSEARCH"; +static const char __pyx_k_ARES_FLAG_STAYOPEN[] = "ARES_FLAG_STAYOPEN"; +static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; +static const char __pyx_k_ARES_FLAG_NOALIASES[] = "ARES_FLAG_NOALIASES"; +static const char __pyx_k_ARES_FLAG_NORECURSE[] = "ARES_FLAG_NORECURSE"; +static const char __pyx_k_ARES_ENOTINITIALIZED[] = "ARES_ENOTINITIALIZED"; +static const char __pyx_k_ARES_FLAG_NOCHECKRESP[] = "ARES_FLAG_NOCHECKRESP"; +static const char __pyx_k_gevent_resolver_cares[] = "gevent.resolver.cares"; +static const char __pyx_k_s_value_r_exception_r[] = "%s(value=%r, exception=%r)"; +static const char __pyx_k_ares_host_result___new[] = "ares_host_result.__new__"; +static const char __pyx_k_expected_a_tuple_got_r[] = "expected a tuple, got %r"; +static const char __pyx_k_Invalid_value_for_port_r[] = "Invalid value for port: %r"; +static const char __pyx_k_ARES_EADDRGETNETWORKPARAMS[] = "ARES_EADDRGETNETWORKPARAMS"; +static const char __pyx_k_Bad_value_for_ai_flags_0x_x[] = "Bad value for ai_flags: 0x%x"; +static const char __pyx_k_ares_host_result___getnewargs[] = "ares_host_result.__getnewargs__"; +static const char __pyx_k_src_gevent_resolver_cares_pyx[] = "src\\gevent\\resolver\\cares.pyx"; +static const char __pyx_k_s_at_0x_x__timer_r__watchers_s[] = "<%s at 0x%x _timer=%r _watchers[%s]>"; +static const char __pyx_k_this_ares_channel_has_been_destr[] = "this ares channel has been destroyed"; +static PyObject *__pyx_n_s_ARES_EADDRGETNETWORKPARAMS; +static PyObject *__pyx_n_s_ARES_EBADFAMILY; +static PyObject *__pyx_n_s_ARES_EBADFLAGS; +static PyObject *__pyx_n_s_ARES_EBADHINTS; +static PyObject *__pyx_n_s_ARES_EBADNAME; +static PyObject *__pyx_n_s_ARES_EBADQUERY; +static PyObject *__pyx_n_s_ARES_EBADRESP; +static PyObject *__pyx_n_s_ARES_EBADSTR; +static PyObject *__pyx_n_s_ARES_ECANCELLED; +static PyObject *__pyx_n_s_ARES_ECONNREFUSED; +static PyObject *__pyx_n_s_ARES_EDESTRUCTION; +static PyObject *__pyx_n_s_ARES_EFILE; +static PyObject *__pyx_n_s_ARES_EFORMERR; +static PyObject *__pyx_n_s_ARES_ELOADIPHLPAPI; +static PyObject *__pyx_n_s_ARES_ENODATA; +static PyObject *__pyx_n_s_ARES_ENOMEM; +static PyObject *__pyx_n_s_ARES_ENONAME; +static PyObject *__pyx_n_s_ARES_ENOTFOUND; +static PyObject *__pyx_n_s_ARES_ENOTIMP; +static PyObject *__pyx_n_s_ARES_ENOTINITIALIZED; +static PyObject *__pyx_n_s_ARES_EOF; +static PyObject *__pyx_n_s_ARES_EREFUSED; +static PyObject *__pyx_n_s_ARES_ESERVFAIL; +static PyObject *__pyx_n_s_ARES_ETIMEOUT; +static PyObject *__pyx_n_s_ARES_FLAG_IGNTC; +static PyObject *__pyx_n_s_ARES_FLAG_NOALIASES; +static PyObject *__pyx_n_s_ARES_FLAG_NOCHECKRESP; +static PyObject *__pyx_n_s_ARES_FLAG_NORECURSE; +static PyObject *__pyx_n_s_ARES_FLAG_NOSEARCH; +static PyObject *__pyx_n_s_ARES_FLAG_PRIMARY; +static PyObject *__pyx_n_s_ARES_FLAG_STAYOPEN; +static PyObject *__pyx_n_s_ARES_FLAG_USEVC; +static PyObject *__pyx_n_s_ARES_SUCCESS; +static PyObject *__pyx_kp_s_Bad_value_for_ai_flags_0x_x; +static PyObject *__pyx_n_s_InvalidIP; +static PyObject *__pyx_kp_s_Invalid_value_for_port_r; +static PyObject *__pyx_n_s_MemoryError; +static PyObject *__pyx_n_s_NI_DGRAM; +static PyObject *__pyx_n_s_NI_NAMEREQD; +static PyObject *__pyx_n_s_NI_NOFQDN; +static PyObject *__pyx_n_s_NI_NUMERICHOST; +static PyObject *__pyx_n_s_NI_NUMERICSERV; +static PyObject *__pyx_n_s_TIMEOUT; +static PyObject *__pyx_n_s_TypeError; +static PyObject *__pyx_n_s_ValueError; +static PyObject *__pyx_kp_s__2; +static PyObject *__pyx_n_s_addr; +static PyObject *__pyx_n_s_again; +static PyObject *__pyx_n_s_all; +static PyObject *__pyx_n_s_ares_errors; +static PyObject *__pyx_n_s_ares_host_result; +static PyObject *__pyx_n_s_ares_host_result___getnewargs; +static PyObject *__pyx_n_s_ares_host_result___new; +static PyObject *__pyx_n_s_ascii; +static PyObject *__pyx_n_s_basestring; +static PyObject *__pyx_n_s_builtins; +static PyObject *__pyx_n_s_callback; +static PyObject *__pyx_n_s_cares_flag_map; +static PyObject *__pyx_n_s_channel; +static PyObject *__pyx_n_s_class; +static PyObject *__pyx_n_s_cline_in_traceback; +static PyObject *__pyx_n_s_close; +static PyObject *__pyx_n_s_cls; +static PyObject *__pyx_n_s_default; +static PyObject *__pyx_n_s_destroy; +static PyObject *__pyx_n_s_doc; +static PyObject *__pyx_n_s_encode; +static PyObject *__pyx_n_s_events; +static PyObject *__pyx_n_s_exc_info; +static PyObject *__pyx_n_s_exception; +static PyObject *__pyx_kp_s_expected_a_tuple_got_r; +static PyObject *__pyx_n_s_family; +static PyObject *__pyx_n_s_fd; +static PyObject *__pyx_n_s_flags; +static PyObject *__pyx_n_s_gaierror; +static PyObject *__pyx_n_s_get; +static PyObject *__pyx_n_s_getnameinfo; +static PyObject *__pyx_n_s_getnewargs; +static PyObject *__pyx_n_s_gevent_resolver_cares; +static PyObject *__pyx_n_s_handle_error; +static PyObject *__pyx_n_s_id; +static PyObject *__pyx_n_s_import; +static PyObject *__pyx_n_s_io; +static PyObject *__pyx_n_s_iterable; +static PyObject *__pyx_n_s_loop; +static PyObject *__pyx_n_s_main; +static PyObject *__pyx_n_s_metaclass; +static PyObject *__pyx_n_s_module; +static PyObject *__pyx_n_s_name; +static PyObject *__pyx_n_s_name_2; +static PyObject *__pyx_n_s_ndots; +static PyObject *__pyx_n_s_new; +static PyObject *__pyx_n_s_on_timer; +static PyObject *__pyx_n_s_pass_events; +static PyObject *__pyx_n_s_pop; +static PyObject *__pyx_n_s_prepare; +static PyObject *__pyx_n_s_process_fd; +static PyObject *__pyx_n_s_pyx_vtable; +static PyObject *__pyx_n_s_qualname; +static PyObject *__pyx_n_s_result; +static PyObject *__pyx_kp_s_s_at_0x_x__timer_r__watchers_s; +static PyObject *__pyx_kp_s_s_exception_r; +static PyObject *__pyx_kp_s_s_r; +static PyObject *__pyx_kp_s_s_s; +static PyObject *__pyx_kp_s_s_value_r_exception_r; +static PyObject *__pyx_n_s_self; +static PyObject *__pyx_n_s_servers; +static PyObject *__pyx_n_s_set_servers; +static PyObject *__pyx_n_s_sockaddr; +static PyObject *__pyx_n_s_socket; +static PyObject *__pyx_n_s_split; +static PyObject *__pyx_kp_s_src_gevent_resolver_cares_pyx; +static PyObject *__pyx_n_s_start; +static PyObject *__pyx_n_s_stop; +static PyObject *__pyx_n_s_sys; +static PyObject *__pyx_n_s_tcp_port; +static PyObject *__pyx_n_s_test; +static PyObject *__pyx_kp_s_this_ares_channel_has_been_destr; +static PyObject *__pyx_n_s_timeout; +static PyObject *__pyx_n_s_timer; +static PyObject *__pyx_n_s_tries; +static PyObject *__pyx_n_s_udp_port; +static PyObject *__pyx_n_s_unicode; +static PyObject *__pyx_n_s_value; +static PyObject *__pyx_n_s_version_info; +static PyObject *__pyx_n_s_watcher; +static PyObject *__pyx_pf_6gevent_8resolver_5cares__convert_cares_flags(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_flags, int __pyx_v_default); /* proto */ +static PyObject *__pyx_pf_6gevent_8resolver_5cares_2strerror(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_code); /* proto */ +static int __pyx_pf_6gevent_8resolver_5cares_6result___init__(struct __pyx_obj_6gevent_8resolver_5cares_result *__pyx_v_self, PyObject *__pyx_v_value, PyObject *__pyx_v_exception); /* proto */ +static PyObject *__pyx_pf_6gevent_8resolver_5cares_6result_2__repr__(struct __pyx_obj_6gevent_8resolver_5cares_result *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_8resolver_5cares_6result_4successful(struct __pyx_obj_6gevent_8resolver_5cares_result *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_8resolver_5cares_6result_6get(struct __pyx_obj_6gevent_8resolver_5cares_result *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_8resolver_5cares_6result_5value___get__(struct __pyx_obj_6gevent_8resolver_5cares_result *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_8resolver_5cares_6result_5value_2__set__(struct __pyx_obj_6gevent_8resolver_5cares_result *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6gevent_8resolver_5cares_6result_5value_4__del__(struct __pyx_obj_6gevent_8resolver_5cares_result *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_8resolver_5cares_6result_9exception___get__(struct __pyx_obj_6gevent_8resolver_5cares_result *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_8resolver_5cares_6result_9exception_2__set__(struct __pyx_obj_6gevent_8resolver_5cares_result *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6gevent_8resolver_5cares_6result_9exception_4__del__(struct __pyx_obj_6gevent_8resolver_5cares_result *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_8resolver_5cares_16ares_host_result___new__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_cls, PyObject *__pyx_v_family, PyObject *__pyx_v_iterable); /* proto */ +static PyObject *__pyx_pf_6gevent_8resolver_5cares_16ares_host_result_2__getnewargs__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_8resolver_5cares_7channel___init__(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self, PyObject *__pyx_v_loop, PyObject *__pyx_v_flags, PyObject *__pyx_v_timeout, PyObject *__pyx_v_tries, PyObject *__pyx_v_ndots, PyObject *__pyx_v_udp_port, PyObject *__pyx_v_tcp_port, PyObject *__pyx_v_servers); /* proto */ +static PyObject *__pyx_pf_6gevent_8resolver_5cares_7channel_2__repr__(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_8resolver_5cares_7channel_4destroy(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self); /* proto */ +static void __pyx_pf_6gevent_8resolver_5cares_7channel_6__dealloc__(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_8resolver_5cares_7channel_8set_servers(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self, PyObject *__pyx_v_servers); /* proto */ +static PyObject *__pyx_pf_6gevent_8resolver_5cares_7channel_10_on_timer(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_8resolver_5cares_7channel_12_process_fd(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self, int __pyx_v_events, PyObject *__pyx_v_watcher); /* proto */ +static PyObject *__pyx_pf_6gevent_8resolver_5cares_7channel_14gethostbyname(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self, PyObject *__pyx_v_callback, char *__pyx_v_name, int __pyx_v_family); /* proto */ +static PyObject *__pyx_pf_6gevent_8resolver_5cares_7channel_16gethostbyaddr(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self, PyObject *__pyx_v_callback, char *__pyx_v_addr); /* proto */ +static PyObject *__pyx_pf_6gevent_8resolver_5cares_7channel_18_getnameinfo(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self, PyObject *__pyx_v_callback, PyObject *__pyx_v_sockaddr, int __pyx_v_flags); /* proto */ +static PyObject *__pyx_pf_6gevent_8resolver_5cares_7channel_20getnameinfo(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self, PyObject *__pyx_v_callback, PyObject *__pyx_v_sockaddr, int __pyx_v_flags); /* proto */ +static PyObject *__pyx_pf_6gevent_8resolver_5cares_7channel_4loop___get__(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_8resolver_5cares_7channel_4loop_2__set__(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6gevent_8resolver_5cares_7channel_4loop_4__del__(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_8resolver_5cares_7channel_9_watchers___get__(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_8resolver_5cares_7channel_9_watchers_2__set__(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6gevent_8resolver_5cares_7channel_9_watchers_4__del__(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6gevent_8resolver_5cares_7channel_6_timer___get__(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self); /* proto */ +static int __pyx_pf_6gevent_8resolver_5cares_7channel_6_timer_2__set__(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static int __pyx_pf_6gevent_8resolver_5cares_7channel_6_timer_4__del__(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self); /* proto */ +static PyObject *__pyx_tp_new_6gevent_8resolver_5cares_result(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_6gevent_8resolver_5cares_channel(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_get = {0, &__pyx_n_s_get, 0, 0, 0}; +static __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_pop = {0, &__pyx_n_s_pop, 0, 0, 0}; +static PyObject *__pyx_int_1; +static PyObject *__pyx_int_2; +static PyObject *__pyx_int_3; +static PyObject *__pyx_int_4; +static PyObject *__pyx_int_8; +static PyObject *__pyx_int_16; +static PyObject *__pyx_int_neg_1; +static PyObject *__pyx_int_neg_8; +static int __pyx_k_; +static int __pyx_k__3; +static PyObject *__pyx_tuple__4; +static PyObject *__pyx_tuple__5; +static PyObject *__pyx_tuple__7; +static PyObject *__pyx_codeobj__6; +static PyObject *__pyx_codeobj__8; +/* Late includes */ + +/* "gevent/resolver/cares.pyx":135 + * + * + * cdef _prepare_cares_flag_map(): # <<<<<<<<<<<<<< + * global _cares_flag_map + * import _socket + */ + +static PyObject *__pyx_f_6gevent_8resolver_5cares__prepare_cares_flag_map(void) { + PyObject *__pyx_v__socket = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + __Pyx_RefNannySetupContext("_prepare_cares_flag_map", 0); + + /* "gevent/resolver/cares.pyx":137 + * cdef _prepare_cares_flag_map(): + * global _cares_flag_map + * import _socket # <<<<<<<<<<<<<< + * _cares_flag_map = [ + * (getattr(_socket, 'NI_NUMERICHOST', 1), cares.ARES_NI_NUMERICHOST), + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_socket, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 137, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v__socket = __pyx_t_1; + __pyx_t_1 = 0; + + /* "gevent/resolver/cares.pyx":139 + * import _socket + * _cares_flag_map = [ + * (getattr(_socket, 'NI_NUMERICHOST', 1), cares.ARES_NI_NUMERICHOST), # <<<<<<<<<<<<<< + * (getattr(_socket, 'NI_NUMERICSERV', 2), cares.ARES_NI_NUMERICSERV), + * (getattr(_socket, 'NI_NOFQDN', 4), cares.ARES_NI_NOFQDN), + */ + __pyx_t_1 = __Pyx_GetAttr3(__pyx_v__socket, __pyx_n_s_NI_NUMERICHOST, __pyx_int_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 139, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyInt_From_int(ARES_NI_NUMERICHOST); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 139, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 139, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); + __pyx_t_1 = 0; + __pyx_t_2 = 0; + + /* "gevent/resolver/cares.pyx":140 + * _cares_flag_map = [ + * (getattr(_socket, 'NI_NUMERICHOST', 1), cares.ARES_NI_NUMERICHOST), + * (getattr(_socket, 'NI_NUMERICSERV', 2), cares.ARES_NI_NUMERICSERV), # <<<<<<<<<<<<<< + * (getattr(_socket, 'NI_NOFQDN', 4), cares.ARES_NI_NOFQDN), + * (getattr(_socket, 'NI_NAMEREQD', 8), cares.ARES_NI_NAMEREQD), + */ + __pyx_t_2 = __Pyx_GetAttr3(__pyx_v__socket, __pyx_n_s_NI_NUMERICSERV, __pyx_int_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 140, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyInt_From_int(ARES_NI_NUMERICSERV); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 140, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 140, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1); + __pyx_t_2 = 0; + __pyx_t_1 = 0; + + /* "gevent/resolver/cares.pyx":141 + * (getattr(_socket, 'NI_NUMERICHOST', 1), cares.ARES_NI_NUMERICHOST), + * (getattr(_socket, 'NI_NUMERICSERV', 2), cares.ARES_NI_NUMERICSERV), + * (getattr(_socket, 'NI_NOFQDN', 4), cares.ARES_NI_NOFQDN), # <<<<<<<<<<<<<< + * (getattr(_socket, 'NI_NAMEREQD', 8), cares.ARES_NI_NAMEREQD), + * (getattr(_socket, 'NI_DGRAM', 16), cares.ARES_NI_DGRAM)] + */ + __pyx_t_1 = __Pyx_GetAttr3(__pyx_v__socket, __pyx_n_s_NI_NOFQDN, __pyx_int_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 141, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyInt_From_int(ARES_NI_NOFQDN); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 141, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 141, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2); + __pyx_t_1 = 0; + __pyx_t_2 = 0; + + /* "gevent/resolver/cares.pyx":142 + * (getattr(_socket, 'NI_NUMERICSERV', 2), cares.ARES_NI_NUMERICSERV), + * (getattr(_socket, 'NI_NOFQDN', 4), cares.ARES_NI_NOFQDN), + * (getattr(_socket, 'NI_NAMEREQD', 8), cares.ARES_NI_NAMEREQD), # <<<<<<<<<<<<<< + * (getattr(_socket, 'NI_DGRAM', 16), cares.ARES_NI_DGRAM)] + * + */ + __pyx_t_2 = __Pyx_GetAttr3(__pyx_v__socket, __pyx_n_s_NI_NAMEREQD, __pyx_int_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 142, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyInt_From_int(ARES_NI_NAMEREQD); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 142, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 142, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_1); + __pyx_t_2 = 0; + __pyx_t_1 = 0; + + /* "gevent/resolver/cares.pyx":143 + * (getattr(_socket, 'NI_NOFQDN', 4), cares.ARES_NI_NOFQDN), + * (getattr(_socket, 'NI_NAMEREQD', 8), cares.ARES_NI_NAMEREQD), + * (getattr(_socket, 'NI_DGRAM', 16), cares.ARES_NI_DGRAM)] # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_1 = __Pyx_GetAttr3(__pyx_v__socket, __pyx_n_s_NI_DGRAM, __pyx_int_16); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 143, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyInt_From_int(ARES_NI_DGRAM); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 143, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 143, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_2); + __pyx_t_1 = 0; + __pyx_t_2 = 0; + + /* "gevent/resolver/cares.pyx":138 + * global _cares_flag_map + * import _socket + * _cares_flag_map = [ # <<<<<<<<<<<<<< + * (getattr(_socket, 'NI_NUMERICHOST', 1), cares.ARES_NI_NUMERICHOST), + * (getattr(_socket, 'NI_NUMERICSERV', 2), cares.ARES_NI_NUMERICSERV), + */ + __pyx_t_2 = PyList_New(5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 138, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_3); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_4); + PyList_SET_ITEM(__pyx_t_2, 1, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_5); + PyList_SET_ITEM(__pyx_t_2, 2, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_6); + PyList_SET_ITEM(__pyx_t_2, 3, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_7); + PyList_SET_ITEM(__pyx_t_2, 4, __pyx_t_7); + __pyx_t_3 = 0; + __pyx_t_4 = 0; + __pyx_t_5 = 0; + __pyx_t_6 = 0; + __pyx_t_7 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_cares_flag_map, __pyx_t_2) < 0) __PYX_ERR(0, 138, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "gevent/resolver/cares.pyx":135 + * + * + * cdef _prepare_cares_flag_map(): # <<<<<<<<<<<<<< + * global _cares_flag_map + * import _socket + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("gevent.resolver.cares._prepare_cares_flag_map", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v__socket); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/resolver/cares.pyx":146 + * + * + * cpdef _convert_cares_flags(int flags, int default=cares.ARES_NI_LOOKUPHOST|cares.ARES_NI_LOOKUPSERVICE): # <<<<<<<<<<<<<< + * if _cares_flag_map is None: + * _prepare_cares_flag_map() + */ + +static PyObject *__pyx_pw_6gevent_8resolver_5cares_1_convert_cares_flags(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_6gevent_8resolver_5cares__convert_cares_flags(int __pyx_v_flags, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_8resolver_5cares__convert_cares_flags *__pyx_optional_args) { + int __pyx_v_default = __pyx_k_; + PyObject *__pyx_v_socket_flag = NULL; + PyObject *__pyx_v_cares_flag = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + Py_ssize_t __pyx_t_5; + PyObject *(*__pyx_t_6)(PyObject *); + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *(*__pyx_t_10)(PyObject *); + int __pyx_t_11; + __Pyx_RefNannySetupContext("_convert_cares_flags", 0); + if (__pyx_optional_args) { + if (__pyx_optional_args->__pyx_n > 0) { + __pyx_v_default = __pyx_optional_args->__pyx_default; + } + } + + /* "gevent/resolver/cares.pyx":147 + * + * cpdef _convert_cares_flags(int flags, int default=cares.ARES_NI_LOOKUPHOST|cares.ARES_NI_LOOKUPSERVICE): + * if _cares_flag_map is None: # <<<<<<<<<<<<<< + * _prepare_cares_flag_map() + * for socket_flag, cares_flag in _cares_flag_map: + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_cares_flag_map); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 147, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = (__pyx_t_1 == Py_None); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = (__pyx_t_2 != 0); + if (__pyx_t_3) { + + /* "gevent/resolver/cares.pyx":148 + * cpdef _convert_cares_flags(int flags, int default=cares.ARES_NI_LOOKUPHOST|cares.ARES_NI_LOOKUPSERVICE): + * if _cares_flag_map is None: + * _prepare_cares_flag_map() # <<<<<<<<<<<<<< + * for socket_flag, cares_flag in _cares_flag_map: + * if socket_flag & flags: + */ + __pyx_t_1 = __pyx_f_6gevent_8resolver_5cares__prepare_cares_flag_map(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 148, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "gevent/resolver/cares.pyx":147 + * + * cpdef _convert_cares_flags(int flags, int default=cares.ARES_NI_LOOKUPHOST|cares.ARES_NI_LOOKUPSERVICE): + * if _cares_flag_map is None: # <<<<<<<<<<<<<< + * _prepare_cares_flag_map() + * for socket_flag, cares_flag in _cares_flag_map: + */ + } + + /* "gevent/resolver/cares.pyx":149 + * if _cares_flag_map is None: + * _prepare_cares_flag_map() + * for socket_flag, cares_flag in _cares_flag_map: # <<<<<<<<<<<<<< + * if socket_flag & flags: + * default |= cares_flag + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_cares_flag_map); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 149, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { + __pyx_t_4 = __pyx_t_1; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0; + __pyx_t_6 = NULL; + } else { + __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 149, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 149, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + for (;;) { + if (likely(!__pyx_t_6)) { + if (likely(PyList_CheckExact(__pyx_t_4))) { + if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_1 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 149, __pyx_L1_error) + #else + __pyx_t_1 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 149, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + #endif + } else { + if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 149, __pyx_L1_error) + #else + __pyx_t_1 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 149, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + #endif + } + } else { + __pyx_t_1 = __pyx_t_6(__pyx_t_4); + if (unlikely(!__pyx_t_1)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(0, 149, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_1); + } + if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { + PyObject* sequence = __pyx_t_1; + Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + __PYX_ERR(0, 149, __pyx_L1_error) + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_7 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_8 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_7 = PyList_GET_ITEM(sequence, 0); + __pyx_t_8 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_7); + __Pyx_INCREF(__pyx_t_8); + #else + __pyx_t_7 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 149, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 149, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_9 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 149, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_10 = Py_TYPE(__pyx_t_9)->tp_iternext; + index = 0; __pyx_t_7 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_7)) goto __pyx_L6_unpacking_failed; + __Pyx_GOTREF(__pyx_t_7); + index = 1; __pyx_t_8 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_8)) goto __pyx_L6_unpacking_failed; + __Pyx_GOTREF(__pyx_t_8); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) __PYX_ERR(0, 149, __pyx_L1_error) + __pyx_t_10 = NULL; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L7_unpacking_done; + __pyx_L6_unpacking_failed:; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_10 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + __PYX_ERR(0, 149, __pyx_L1_error) + __pyx_L7_unpacking_done:; + } + __Pyx_XDECREF_SET(__pyx_v_socket_flag, __pyx_t_7); + __pyx_t_7 = 0; + __Pyx_XDECREF_SET(__pyx_v_cares_flag, __pyx_t_8); + __pyx_t_8 = 0; + + /* "gevent/resolver/cares.pyx":150 + * _prepare_cares_flag_map() + * for socket_flag, cares_flag in _cares_flag_map: + * if socket_flag & flags: # <<<<<<<<<<<<<< + * default |= cares_flag + * flags &= ~socket_flag + */ + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 150, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_8 = PyNumber_And(__pyx_v_socket_flag, __pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 150, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 150, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__pyx_t_3) { + + /* "gevent/resolver/cares.pyx":151 + * for socket_flag, cares_flag in _cares_flag_map: + * if socket_flag & flags: + * default |= cares_flag # <<<<<<<<<<<<<< + * flags &= ~socket_flag + * if not flags: + */ + __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_default); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 151, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_1 = PyNumber_InPlaceOr(__pyx_t_8, __pyx_v_cares_flag); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 151, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_11 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 151, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_default = __pyx_t_11; + + /* "gevent/resolver/cares.pyx":152 + * if socket_flag & flags: + * default |= cares_flag + * flags &= ~socket_flag # <<<<<<<<<<<<<< + * if not flags: + * return default + */ + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 152, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_8 = PyNumber_Invert(__pyx_v_socket_flag); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 152, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_7 = PyNumber_InPlaceAnd(__pyx_t_1, __pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 152, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_11 = __Pyx_PyInt_As_int(__pyx_t_7); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 152, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_v_flags = __pyx_t_11; + + /* "gevent/resolver/cares.pyx":150 + * _prepare_cares_flag_map() + * for socket_flag, cares_flag in _cares_flag_map: + * if socket_flag & flags: # <<<<<<<<<<<<<< + * default |= cares_flag + * flags &= ~socket_flag + */ + } + + /* "gevent/resolver/cares.pyx":153 + * default |= cares_flag + * flags &= ~socket_flag + * if not flags: # <<<<<<<<<<<<<< + * return default + * raise gaierror(-1, "Bad value for ai_flags: 0x%x" % flags) + */ + __pyx_t_3 = ((!(__pyx_v_flags != 0)) != 0); + if (__pyx_t_3) { + + /* "gevent/resolver/cares.pyx":154 + * flags &= ~socket_flag + * if not flags: + * return default # <<<<<<<<<<<<<< + * raise gaierror(-1, "Bad value for ai_flags: 0x%x" % flags) + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_default); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 154, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_r = __pyx_t_7; + __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L0; + + /* "gevent/resolver/cares.pyx":153 + * default |= cares_flag + * flags &= ~socket_flag + * if not flags: # <<<<<<<<<<<<<< + * return default + * raise gaierror(-1, "Bad value for ai_flags: 0x%x" % flags) + */ + } + + /* "gevent/resolver/cares.pyx":149 + * if _cares_flag_map is None: + * _prepare_cares_flag_map() + * for socket_flag, cares_flag in _cares_flag_map: # <<<<<<<<<<<<<< + * if socket_flag & flags: + * default |= cares_flag + */ + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "gevent/resolver/cares.pyx":155 + * if not flags: + * return default + * raise gaierror(-1, "Bad value for ai_flags: 0x%x" % flags) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_gaierror); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 155, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 155, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_Bad_value_for_ai_flags_0x_x, __pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 155, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = NULL; + __pyx_t_11 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) { + __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); + if (likely(__pyx_t_8)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); + __Pyx_INCREF(__pyx_t_8); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_7, function); + __pyx_t_11 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_7)) { + PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_int_neg_1, __pyx_t_1}; + __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 155, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) { + PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_int_neg_1, __pyx_t_1}; + __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 155, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else + #endif + { + __pyx_t_9 = PyTuple_New(2+__pyx_t_11); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 155, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + if (__pyx_t_8) { + __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = NULL; + } + __Pyx_INCREF(__pyx_int_neg_1); + __Pyx_GIVEREF(__pyx_int_neg_1); + PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_11, __pyx_int_neg_1); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_11, __pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_9, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 155, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __PYX_ERR(0, 155, __pyx_L1_error) + + /* "gevent/resolver/cares.pyx":146 + * + * + * cpdef _convert_cares_flags(int flags, int default=cares.ARES_NI_LOOKUPHOST|cares.ARES_NI_LOOKUPSERVICE): # <<<<<<<<<<<<<< + * if _cares_flag_map is None: + * _prepare_cares_flag_map() + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_AddTraceback("gevent.resolver.cares._convert_cares_flags", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_socket_flag); + __Pyx_XDECREF(__pyx_v_cares_flag); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_8resolver_5cares_1_convert_cares_flags(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6gevent_8resolver_5cares_1_convert_cares_flags(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + int __pyx_v_flags; + int __pyx_v_default; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_convert_cares_flags (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_flags,&__pyx_n_s_default,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flags)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_default); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_convert_cares_flags") < 0)) __PYX_ERR(0, 146, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_flags = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 146, __pyx_L3_error) + if (values[1]) { + __pyx_v_default = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_default == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 146, __pyx_L3_error) + } else { + __pyx_v_default = __pyx_k_; + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("_convert_cares_flags", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 146, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.resolver.cares._convert_cares_flags", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_8resolver_5cares__convert_cares_flags(__pyx_self, __pyx_v_flags, __pyx_v_default); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_8resolver_5cares__convert_cares_flags(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_flags, int __pyx_v_default) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + struct __pyx_opt_args_6gevent_8resolver_5cares__convert_cares_flags __pyx_t_2; + __Pyx_RefNannySetupContext("_convert_cares_flags", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_2.__pyx_n = 1; + __pyx_t_2.__pyx_default = __pyx_v_default; + __pyx_t_1 = __pyx_f_6gevent_8resolver_5cares__convert_cares_flags(__pyx_v_flags, 0, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 146, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.resolver.cares._convert_cares_flags", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/resolver/cares.pyx":158 + * + * + * cpdef strerror(code): # <<<<<<<<<<<<<< + * return '%s: %s' % (_ares_errors.get(code) or code, cares.ares_strerror(code)) + * + */ + +static PyObject *__pyx_pw_6gevent_8resolver_5cares_3strerror(PyObject *__pyx_self, PyObject *__pyx_v_code); /*proto*/ +static PyObject *__pyx_f_6gevent_8resolver_5cares_strerror(PyObject *__pyx_v_code, CYTHON_UNUSED int __pyx_skip_dispatch) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + int __pyx_t_6; + __Pyx_RefNannySetupContext("strerror", 0); + + /* "gevent/resolver/cares.pyx":159 + * + * cpdef strerror(code): + * return '%s: %s' % (_ares_errors.get(code) or code, cares.ares_strerror(code)) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ares_errors); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 159, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_get); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 159, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + } + } + __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_3, __pyx_v_code) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_code); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 159, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 159, __pyx_L1_error) + if (!__pyx_t_5) { + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } else { + __Pyx_INCREF(__pyx_t_2); + __pyx_t_1 = __pyx_t_2; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + goto __pyx_L3_bool_binop_done; + } + __Pyx_INCREF(__pyx_v_code); + __pyx_t_1 = __pyx_v_code; + __pyx_L3_bool_binop_done:; + __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_v_code); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 159, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBytes_FromString(ares_strerror(__pyx_t_6)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 159, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 159, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2); + __pyx_t_1 = 0; + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_s_s, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 159, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "gevent/resolver/cares.pyx":158 + * + * + * cpdef strerror(code): # <<<<<<<<<<<<<< + * return '%s: %s' % (_ares_errors.get(code) or code, cares.ares_strerror(code)) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("gevent.resolver.cares.strerror", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_8resolver_5cares_3strerror(PyObject *__pyx_self, PyObject *__pyx_v_code); /*proto*/ +static PyObject *__pyx_pw_6gevent_8resolver_5cares_3strerror(PyObject *__pyx_self, PyObject *__pyx_v_code) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("strerror (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_8resolver_5cares_2strerror(__pyx_self, ((PyObject *)__pyx_v_code)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_8resolver_5cares_2strerror(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_code) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("strerror", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6gevent_8resolver_5cares_strerror(__pyx_v_code, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 158, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.resolver.cares.strerror", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/resolver/cares.pyx":166 + * + * + * cdef void gevent_sock_state_callback(void *data, int s, int read, int write): # <<<<<<<<<<<<<< + * if not data: + * return + */ + +static void __pyx_f_6gevent_8resolver_5cares_gevent_sock_state_callback(void *__pyx_v_data, int __pyx_v_s, int __pyx_v_read, int __pyx_v_write) { + struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_ch = 0; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("gevent_sock_state_callback", 0); + + /* "gevent/resolver/cares.pyx":167 + * + * cdef void gevent_sock_state_callback(void *data, int s, int read, int write): + * if not data: # <<<<<<<<<<<<<< + * return + * cdef channel ch = data + */ + __pyx_t_1 = ((!(__pyx_v_data != 0)) != 0); + if (__pyx_t_1) { + + /* "gevent/resolver/cares.pyx":168 + * cdef void gevent_sock_state_callback(void *data, int s, int read, int write): + * if not data: + * return # <<<<<<<<<<<<<< + * cdef channel ch = data + * ch._sock_state_callback(s, read, write) + */ + goto __pyx_L0; + + /* "gevent/resolver/cares.pyx":167 + * + * cdef void gevent_sock_state_callback(void *data, int s, int read, int write): + * if not data: # <<<<<<<<<<<<<< + * return + * cdef channel ch = data + */ + } + + /* "gevent/resolver/cares.pyx":169 + * if not data: + * return + * cdef channel ch = data # <<<<<<<<<<<<<< + * ch._sock_state_callback(s, read, write) + * + */ + __pyx_t_2 = ((PyObject *)__pyx_v_data); + __Pyx_INCREF(__pyx_t_2); + __pyx_v_ch = ((struct __pyx_obj_6gevent_8resolver_5cares_channel *)__pyx_t_2); + __pyx_t_2 = 0; + + /* "gevent/resolver/cares.pyx":170 + * return + * cdef channel ch = data + * ch._sock_state_callback(s, read, write) # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_2 = ((struct __pyx_vtabstruct_6gevent_8resolver_5cares_channel *)__pyx_v_ch->__pyx_vtab)->_sock_state_callback(__pyx_v_ch, __pyx_v_s, __pyx_v_read, __pyx_v_write); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 170, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "gevent/resolver/cares.pyx":166 + * + * + * cdef void gevent_sock_state_callback(void *data, int s, int read, int write): # <<<<<<<<<<<<<< + * if not data: + * return + */ + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_WriteUnraisable("gevent.resolver.cares.gevent_sock_state_callback", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_ch); + __Pyx_RefNannyFinishContext(); +} + +/* "gevent/resolver/cares.pyx":177 + * cdef public object exception + * + * def __init__(self, object value=None, object exception=None): # <<<<<<<<<<<<<< + * self.value = value + * self.exception = exception + */ + +/* Python wrapper */ +static int __pyx_pw_6gevent_8resolver_5cares_6result_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6gevent_8resolver_5cares_6result_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_value = 0; + PyObject *__pyx_v_exception = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_value,&__pyx_n_s_exception,0}; + PyObject* values[2] = {0,0}; + values[0] = ((PyObject *)Py_None); + values[1] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value); + if (value) { values[0] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 1: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_exception); + if (value) { values[1] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 177, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_value = values[0]; + __pyx_v_exception = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 177, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.resolver.cares.result.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_8resolver_5cares_6result___init__(((struct __pyx_obj_6gevent_8resolver_5cares_result *)__pyx_v_self), __pyx_v_value, __pyx_v_exception); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_8resolver_5cares_6result___init__(struct __pyx_obj_6gevent_8resolver_5cares_result *__pyx_v_self, PyObject *__pyx_v_value, PyObject *__pyx_v_exception) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__", 0); + + /* "gevent/resolver/cares.pyx":178 + * + * def __init__(self, object value=None, object exception=None): + * self.value = value # <<<<<<<<<<<<<< + * self.exception = exception + * + */ + __Pyx_INCREF(__pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + __Pyx_GOTREF(__pyx_v_self->value); + __Pyx_DECREF(__pyx_v_self->value); + __pyx_v_self->value = __pyx_v_value; + + /* "gevent/resolver/cares.pyx":179 + * def __init__(self, object value=None, object exception=None): + * self.value = value + * self.exception = exception # <<<<<<<<<<<<<< + * + * def __repr__(self): + */ + __Pyx_INCREF(__pyx_v_exception); + __Pyx_GIVEREF(__pyx_v_exception); + __Pyx_GOTREF(__pyx_v_self->exception); + __Pyx_DECREF(__pyx_v_self->exception); + __pyx_v_self->exception = __pyx_v_exception; + + /* "gevent/resolver/cares.pyx":177 + * cdef public object exception + * + * def __init__(self, object value=None, object exception=None): # <<<<<<<<<<<<<< + * self.value = value + * self.exception = exception + */ + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/resolver/cares.pyx":181 + * self.exception = exception + * + * def __repr__(self): # <<<<<<<<<<<<<< + * if self.exception is None: + * return '%s(%r)' % (self.__class__.__name__, self.value) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_8resolver_5cares_6result_3__repr__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_8resolver_5cares_6result_3__repr__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_8resolver_5cares_6result_2__repr__(((struct __pyx_obj_6gevent_8resolver_5cares_result *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_8resolver_5cares_6result_2__repr__(struct __pyx_obj_6gevent_8resolver_5cares_result *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + __Pyx_RefNannySetupContext("__repr__", 0); + + /* "gevent/resolver/cares.pyx":182 + * + * def __repr__(self): + * if self.exception is None: # <<<<<<<<<<<<<< + * return '%s(%r)' % (self.__class__.__name__, self.value) + * elif self.value is None: + */ + __pyx_t_1 = (__pyx_v_self->exception == Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "gevent/resolver/cares.pyx":183 + * def __repr__(self): + * if self.exception is None: + * return '%s(%r)' % (self.__class__.__name__, self.value) # <<<<<<<<<<<<<< + * elif self.value is None: + * return '%s(exception=%r)' % (self.__class__.__name__, self.exception) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 183, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 183, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 183, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); + __Pyx_INCREF(__pyx_v_self->value); + __Pyx_GIVEREF(__pyx_v_self->value); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_self->value); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_s_r, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 183, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + + /* "gevent/resolver/cares.pyx":182 + * + * def __repr__(self): + * if self.exception is None: # <<<<<<<<<<<<<< + * return '%s(%r)' % (self.__class__.__name__, self.value) + * elif self.value is None: + */ + } + + /* "gevent/resolver/cares.pyx":184 + * if self.exception is None: + * return '%s(%r)' % (self.__class__.__name__, self.value) + * elif self.value is None: # <<<<<<<<<<<<<< + * return '%s(exception=%r)' % (self.__class__.__name__, self.exception) + * else: + */ + __pyx_t_2 = (__pyx_v_self->value == Py_None); + __pyx_t_1 = (__pyx_t_2 != 0); + if (__pyx_t_1) { + + /* "gevent/resolver/cares.pyx":185 + * return '%s(%r)' % (self.__class__.__name__, self.value) + * elif self.value is None: + * return '%s(exception=%r)' % (self.__class__.__name__, self.exception) # <<<<<<<<<<<<<< + * else: + * return '%s(value=%r, exception=%r)' % (self.__class__.__name__, self.value, self.exception) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 185, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 185, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 185, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); + __Pyx_INCREF(__pyx_v_self->exception); + __Pyx_GIVEREF(__pyx_v_self->exception); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_self->exception); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_s_exception_r, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 185, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "gevent/resolver/cares.pyx":184 + * if self.exception is None: + * return '%s(%r)' % (self.__class__.__name__, self.value) + * elif self.value is None: # <<<<<<<<<<<<<< + * return '%s(exception=%r)' % (self.__class__.__name__, self.exception) + * else: + */ + } + + /* "gevent/resolver/cares.pyx":187 + * return '%s(exception=%r)' % (self.__class__.__name__, self.exception) + * else: + * return '%s(value=%r, exception=%r)' % (self.__class__.__name__, self.value, self.exception) # <<<<<<<<<<<<<< + * # add repr_recursive precaution + * + */ + /*else*/ { + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 187, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 187, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 187, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); + __Pyx_INCREF(__pyx_v_self->value); + __Pyx_GIVEREF(__pyx_v_self->value); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_self->value); + __Pyx_INCREF(__pyx_v_self->exception); + __Pyx_GIVEREF(__pyx_v_self->exception); + PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_self->exception); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_s_value_r_exception_r, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 187, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + } + + /* "gevent/resolver/cares.pyx":181 + * self.exception = exception + * + * def __repr__(self): # <<<<<<<<<<<<<< + * if self.exception is None: + * return '%s(%r)' % (self.__class__.__name__, self.value) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("gevent.resolver.cares.result.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/resolver/cares.pyx":190 + * # add repr_recursive precaution + * + * def successful(self): # <<<<<<<<<<<<<< + * return self.exception is None + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_8resolver_5cares_6result_5successful(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6gevent_8resolver_5cares_6result_5successful(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("successful (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_8resolver_5cares_6result_4successful(((struct __pyx_obj_6gevent_8resolver_5cares_result *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_8resolver_5cares_6result_4successful(struct __pyx_obj_6gevent_8resolver_5cares_result *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + __Pyx_RefNannySetupContext("successful", 0); + + /* "gevent/resolver/cares.pyx":191 + * + * def successful(self): + * return self.exception is None # <<<<<<<<<<<<<< + * + * def get(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = (__pyx_v_self->exception == Py_None); + __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 191, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "gevent/resolver/cares.pyx":190 + * # add repr_recursive precaution + * + * def successful(self): # <<<<<<<<<<<<<< + * return self.exception is None + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent.resolver.cares.result.successful", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/resolver/cares.pyx":193 + * return self.exception is None + * + * def get(self): # <<<<<<<<<<<<<< + * if self.exception is not None: + * raise self.exception + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_8resolver_5cares_6result_7get(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6gevent_8resolver_5cares_6result_7get(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("get (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_8resolver_5cares_6result_6get(((struct __pyx_obj_6gevent_8resolver_5cares_result *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_8resolver_5cares_6result_6get(struct __pyx_obj_6gevent_8resolver_5cares_result *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + __Pyx_RefNannySetupContext("get", 0); + + /* "gevent/resolver/cares.pyx":194 + * + * def get(self): + * if self.exception is not None: # <<<<<<<<<<<<<< + * raise self.exception + * return self.value + */ + __pyx_t_1 = (__pyx_v_self->exception != Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (unlikely(__pyx_t_2)) { + + /* "gevent/resolver/cares.pyx":195 + * def get(self): + * if self.exception is not None: + * raise self.exception # <<<<<<<<<<<<<< + * return self.value + * + */ + __Pyx_Raise(__pyx_v_self->exception, 0, 0, 0); + __PYX_ERR(0, 195, __pyx_L1_error) + + /* "gevent/resolver/cares.pyx":194 + * + * def get(self): + * if self.exception is not None: # <<<<<<<<<<<<<< + * raise self.exception + * return self.value + */ + } + + /* "gevent/resolver/cares.pyx":196 + * if self.exception is not None: + * raise self.exception + * return self.value # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->value); + __pyx_r = __pyx_v_self->value; + goto __pyx_L0; + + /* "gevent/resolver/cares.pyx":193 + * return self.exception is None + * + * def get(self): # <<<<<<<<<<<<<< + * if self.exception is not None: + * raise self.exception + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_AddTraceback("gevent.resolver.cares.result.get", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/resolver/cares.pyx":174 + * + * cdef class result: + * cdef public object value # <<<<<<<<<<<<<< + * cdef public object exception + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_8resolver_5cares_6result_5value_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_8resolver_5cares_6result_5value_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_8resolver_5cares_6result_5value___get__(((struct __pyx_obj_6gevent_8resolver_5cares_result *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_8resolver_5cares_6result_5value___get__(struct __pyx_obj_6gevent_8resolver_5cares_result *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->value); + __pyx_r = __pyx_v_self->value; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6gevent_8resolver_5cares_6result_5value_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6gevent_8resolver_5cares_6result_5value_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_8resolver_5cares_6result_5value_2__set__(((struct __pyx_obj_6gevent_8resolver_5cares_result *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_8resolver_5cares_6result_5value_2__set__(struct __pyx_obj_6gevent_8resolver_5cares_result *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__", 0); + __Pyx_INCREF(__pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + __Pyx_GOTREF(__pyx_v_self->value); + __Pyx_DECREF(__pyx_v_self->value); + __pyx_v_self->value = __pyx_v_value; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6gevent_8resolver_5cares_6result_5value_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6gevent_8resolver_5cares_6result_5value_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_8resolver_5cares_6result_5value_4__del__(((struct __pyx_obj_6gevent_8resolver_5cares_result *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_8resolver_5cares_6result_5value_4__del__(struct __pyx_obj_6gevent_8resolver_5cares_result *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->value); + __Pyx_DECREF(__pyx_v_self->value); + __pyx_v_self->value = Py_None; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/resolver/cares.pyx":175 + * cdef class result: + * cdef public object value + * cdef public object exception # <<<<<<<<<<<<<< + * + * def __init__(self, object value=None, object exception=None): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_8resolver_5cares_6result_9exception_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_8resolver_5cares_6result_9exception_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_8resolver_5cares_6result_9exception___get__(((struct __pyx_obj_6gevent_8resolver_5cares_result *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_8resolver_5cares_6result_9exception___get__(struct __pyx_obj_6gevent_8resolver_5cares_result *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->exception); + __pyx_r = __pyx_v_self->exception; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6gevent_8resolver_5cares_6result_9exception_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6gevent_8resolver_5cares_6result_9exception_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_8resolver_5cares_6result_9exception_2__set__(((struct __pyx_obj_6gevent_8resolver_5cares_result *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_8resolver_5cares_6result_9exception_2__set__(struct __pyx_obj_6gevent_8resolver_5cares_result *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__", 0); + __Pyx_INCREF(__pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + __Pyx_GOTREF(__pyx_v_self->exception); + __Pyx_DECREF(__pyx_v_self->exception); + __pyx_v_self->exception = __pyx_v_value; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6gevent_8resolver_5cares_6result_9exception_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6gevent_8resolver_5cares_6result_9exception_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_8resolver_5cares_6result_9exception_4__del__(((struct __pyx_obj_6gevent_8resolver_5cares_result *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_8resolver_5cares_6result_9exception_4__del__(struct __pyx_obj_6gevent_8resolver_5cares_result *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->exception); + __Pyx_DECREF(__pyx_v_self->exception); + __pyx_v_self->exception = Py_None; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/resolver/cares.pyx":201 + * class ares_host_result(tuple): + * + * def __new__(cls, family, iterable): # <<<<<<<<<<<<<< + * cdef object self = tuple.__new__(cls, iterable) + * self.family = family + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_8resolver_5cares_16ares_host_result_1__new__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6gevent_8resolver_5cares_16ares_host_result_1__new__ = {"__new__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_8resolver_5cares_16ares_host_result_1__new__, METH_VARARGS|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_6gevent_8resolver_5cares_16ares_host_result_1__new__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_cls = 0; + PyObject *__pyx_v_family = 0; + PyObject *__pyx_v_iterable = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__new__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_cls,&__pyx_n_s_family,&__pyx_n_s_iterable,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cls)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_family)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__new__", 1, 3, 3, 1); __PYX_ERR(0, 201, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_iterable)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__new__", 1, 3, 3, 2); __PYX_ERR(0, 201, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__new__") < 0)) __PYX_ERR(0, 201, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + } + __pyx_v_cls = values[0]; + __pyx_v_family = values[1]; + __pyx_v_iterable = values[2]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__new__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 201, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.resolver.cares.ares_host_result.__new__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_8resolver_5cares_16ares_host_result___new__(__pyx_self, __pyx_v_cls, __pyx_v_family, __pyx_v_iterable); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_8resolver_5cares_16ares_host_result___new__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_cls, PyObject *__pyx_v_family, PyObject *__pyx_v_iterable) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + __Pyx_RefNannySetupContext("__new__", 0); + + /* "gevent/resolver/cares.pyx":202 + * + * def __new__(cls, family, iterable): + * cdef object self = tuple.__new__(cls, iterable) # <<<<<<<<<<<<<< + * self.family = family + * return self + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)(&PyTuple_Type)), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 202, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + __pyx_t_4 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_4 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_cls, __pyx_v_iterable}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 202, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_cls, __pyx_v_iterable}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 202, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_t_1); + } else + #endif + { + __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 202, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (__pyx_t_3) { + __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL; + } + __Pyx_INCREF(__pyx_v_cls); + __Pyx_GIVEREF(__pyx_v_cls); + PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_cls); + __Pyx_INCREF(__pyx_v_iterable); + __Pyx_GIVEREF(__pyx_v_iterable); + PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_iterable); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 202, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_self = __pyx_t_1; + __pyx_t_1 = 0; + + /* "gevent/resolver/cares.pyx":203 + * def __new__(cls, family, iterable): + * cdef object self = tuple.__new__(cls, iterable) + * self.family = family # <<<<<<<<<<<<<< + * return self + * + */ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_family, __pyx_v_family) < 0) __PYX_ERR(0, 203, __pyx_L1_error) + + /* "gevent/resolver/cares.pyx":204 + * cdef object self = tuple.__new__(cls, iterable) + * self.family = family + * return self # <<<<<<<<<<<<<< + * + * def __getnewargs__(self): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self); + __pyx_r = __pyx_v_self; + goto __pyx_L0; + + /* "gevent/resolver/cares.pyx":201 + * class ares_host_result(tuple): + * + * def __new__(cls, family, iterable): # <<<<<<<<<<<<<< + * cdef object self = tuple.__new__(cls, iterable) + * self.family = family + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("gevent.resolver.cares.ares_host_result.__new__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_self); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/resolver/cares.pyx":206 + * return self + * + * def __getnewargs__(self): # <<<<<<<<<<<<<< + * return (self.family, tuple(self)) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_8resolver_5cares_16ares_host_result_3__getnewargs__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ +static PyMethodDef __pyx_mdef_6gevent_8resolver_5cares_16ares_host_result_3__getnewargs__ = {"__getnewargs__", (PyCFunction)__pyx_pw_6gevent_8resolver_5cares_16ares_host_result_3__getnewargs__, METH_O, 0}; +static PyObject *__pyx_pw_6gevent_8resolver_5cares_16ares_host_result_3__getnewargs__(PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__getnewargs__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_8resolver_5cares_16ares_host_result_2__getnewargs__(__pyx_self, ((PyObject *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_8resolver_5cares_16ares_host_result_2__getnewargs__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("__getnewargs__", 0); + + /* "gevent/resolver/cares.pyx":207 + * + * def __getnewargs__(self): + * return (self.family, tuple(self)) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_family); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 207, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PySequence_Tuple(__pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 207, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 207, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); + __pyx_t_1 = 0; + __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "gevent/resolver/cares.pyx":206 + * return self + * + * def __getnewargs__(self): # <<<<<<<<<<<<<< + * return (self.family, tuple(self)) + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("gevent.resolver.cares.ares_host_result.__getnewargs__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/resolver/cares.pyx":210 + * + * + * cdef void gevent_ares_host_callback(void *arg, int status, int timeouts, hostent* host): # <<<<<<<<<<<<<< + * cdef channel channel + * cdef object callback + */ + +static void __pyx_f_6gevent_8resolver_5cares_gevent_ares_host_callback(void *__pyx_v_arg, int __pyx_v_status, CYTHON_UNUSED int __pyx_v_timeouts, struct hostent *__pyx_v_host) { + struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_channel = 0; + PyObject *__pyx_v_callback = 0; + PyObject *__pyx_v_host_result = 0; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + int __pyx_t_12; + PyObject *__pyx_t_13 = NULL; + PyObject *__pyx_t_14 = NULL; + PyObject *__pyx_t_15 = NULL; + PyObject *__pyx_t_16 = NULL; + PyObject *__pyx_t_17 = NULL; + __Pyx_RefNannySetupContext("gevent_ares_host_callback", 0); + + /* "gevent/resolver/cares.pyx":213 + * cdef channel channel + * cdef object callback + * channel, callback = arg # <<<<<<<<<<<<<< + * Py_DECREF(arg) + * cdef object host_result + */ + __pyx_t_1 = ((PyObject *)__pyx_v_arg); + __Pyx_INCREF(__pyx_t_1); + if (likely(__pyx_t_1 != Py_None)) { + PyObject* sequence = __pyx_t_1; + Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + __PYX_ERR(0, 213, __pyx_L1_error) + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + #else + __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 213, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 213, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else { + __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(0, 213, __pyx_L1_error) + } + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_6gevent_8resolver_5cares_channel))))) __PYX_ERR(0, 213, __pyx_L1_error) + __pyx_v_channel = ((struct __pyx_obj_6gevent_8resolver_5cares_channel *)__pyx_t_2); + __pyx_t_2 = 0; + __pyx_v_callback = __pyx_t_3; + __pyx_t_3 = 0; + + /* "gevent/resolver/cares.pyx":214 + * cdef object callback + * channel, callback = arg + * Py_DECREF(arg) # <<<<<<<<<<<<<< + * cdef object host_result + * try: + */ + Py_DECREF(((PyObject *)__pyx_v_arg)); + + /* "gevent/resolver/cares.pyx":216 + * Py_DECREF(arg) + * cdef object host_result + * try: # <<<<<<<<<<<<<< + * if status or not host: + * callback(result(None, gaierror(status, strerror(status)))) + */ + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6); + __Pyx_XGOTREF(__pyx_t_4); + __Pyx_XGOTREF(__pyx_t_5); + __Pyx_XGOTREF(__pyx_t_6); + /*try:*/ { + + /* "gevent/resolver/cares.pyx":217 + * cdef object host_result + * try: + * if status or not host: # <<<<<<<<<<<<<< + * callback(result(None, gaierror(status, strerror(status)))) + * else: + */ + __pyx_t_8 = (__pyx_v_status != 0); + if (!__pyx_t_8) { + } else { + __pyx_t_7 = __pyx_t_8; + goto __pyx_L10_bool_binop_done; + } + __pyx_t_8 = ((!(__pyx_v_host != 0)) != 0); + __pyx_t_7 = __pyx_t_8; + __pyx_L10_bool_binop_done:; + if (__pyx_t_7) { + + /* "gevent/resolver/cares.pyx":218 + * try: + * if status or not host: + * callback(result(None, gaierror(status, strerror(status)))) # <<<<<<<<<<<<<< + * else: + * try: + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_gaierror); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 218, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_status); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 218, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = __Pyx_PyInt_From_int(__pyx_v_status); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 218, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_11 = __pyx_f_6gevent_8resolver_5cares_strerror(__pyx_t_10, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 218, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = NULL; + __pyx_t_12 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_10)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_10); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_12 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[3] = {__pyx_t_10, __pyx_t_9, __pyx_t_11}; + __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_12, 2+__pyx_t_12); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 218, __pyx_L3_error) + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[3] = {__pyx_t_10, __pyx_t_9, __pyx_t_11}; + __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_12, 2+__pyx_t_12); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 218, __pyx_L3_error) + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + } else + #endif + { + __pyx_t_13 = PyTuple_New(2+__pyx_t_12); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 218, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_13); + if (__pyx_t_10) { + __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_10); __pyx_t_10 = NULL; + } + __Pyx_GIVEREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_13, 0+__pyx_t_12, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_13, 1+__pyx_t_12, __pyx_t_11); + __pyx_t_9 = 0; + __pyx_t_11 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_13, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 218, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 218, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + PyTuple_SET_ITEM(__pyx_t_2, 0, Py_None); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6gevent_8resolver_5cares_result), __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 218, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_INCREF(__pyx_v_callback); + __pyx_t_2 = __pyx_v_callback; __pyx_t_13 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_13)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_13); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_13) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_13, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); + __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 218, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "gevent/resolver/cares.pyx":217 + * cdef object host_result + * try: + * if status or not host: # <<<<<<<<<<<<<< + * callback(result(None, gaierror(status, strerror(status)))) + * else: + */ + goto __pyx_L9; + } + + /* "gevent/resolver/cares.pyx":220 + * callback(result(None, gaierror(status, strerror(status)))) + * else: + * try: # <<<<<<<<<<<<<< + * host_result = ares_host_result(host.h_addrtype, (parse_h_name(host), parse_h_aliases(host), parse_h_addr_list(host))) + * except: + */ + /*else*/ { + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_14, &__pyx_t_15, &__pyx_t_16); + __Pyx_XGOTREF(__pyx_t_14); + __Pyx_XGOTREF(__pyx_t_15); + __Pyx_XGOTREF(__pyx_t_16); + /*try:*/ { + + /* "gevent/resolver/cares.pyx":221 + * else: + * try: + * host_result = ares_host_result(host.h_addrtype, (parse_h_name(host), parse_h_aliases(host), parse_h_addr_list(host))) # <<<<<<<<<<<<<< + * except: + * callback(result(None, sys.exc_info()[1])) + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ares_host_result); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 221, __pyx_L12_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_host->h_addrtype); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 221, __pyx_L12_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_13 = parse_h_name(__pyx_v_host); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 221, __pyx_L12_error) + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_11 = parse_h_aliases(__pyx_v_host); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 221, __pyx_L12_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_9 = parse_h_addr_list(__pyx_v_host); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 221, __pyx_L12_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = PyTuple_New(3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 221, __pyx_L12_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_GIVEREF(__pyx_t_13); + PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_13); + __Pyx_GIVEREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_11); + __Pyx_GIVEREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_t_9); + __pyx_t_13 = 0; + __pyx_t_11 = 0; + __pyx_t_9 = 0; + __pyx_t_9 = NULL; + __pyx_t_12 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_9)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_9); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_12 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_t_3, __pyx_t_10}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_12, 2+__pyx_t_12); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 221, __pyx_L12_error) + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_t_3, __pyx_t_10}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_12, 2+__pyx_t_12); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 221, __pyx_L12_error) + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + } else + #endif + { + __pyx_t_11 = PyTuple_New(2+__pyx_t_12); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 221, __pyx_L12_error) + __Pyx_GOTREF(__pyx_t_11); + if (__pyx_t_9) { + __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_9); __pyx_t_9 = NULL; + } + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_12, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_10); + PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_12, __pyx_t_10); + __pyx_t_3 = 0; + __pyx_t_10 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_11, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 221, __pyx_L12_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_host_result = __pyx_t_1; + __pyx_t_1 = 0; + + /* "gevent/resolver/cares.pyx":220 + * callback(result(None, gaierror(status, strerror(status)))) + * else: + * try: # <<<<<<<<<<<<<< + * host_result = ares_host_result(host.h_addrtype, (parse_h_name(host), parse_h_aliases(host), parse_h_addr_list(host))) + * except: + */ + } + + /* "gevent/resolver/cares.pyx":225 + * callback(result(None, sys.exc_info()[1])) + * else: + * callback(result(host_result)) # <<<<<<<<<<<<<< + * except: + * channel.loop.handle_error(callback, *sys.exc_info()) + */ + /*else:*/ { + __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_6gevent_8resolver_5cares_result), __pyx_v_host_result); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 225, __pyx_L14_except_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_callback); + __pyx_t_11 = __pyx_v_callback; __pyx_t_10 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_11))) { + __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_11); + if (likely(__pyx_t_10)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11); + __Pyx_INCREF(__pyx_t_10); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_11, function); + } + } + __pyx_t_1 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_11, __pyx_t_10, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_t_2); + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 225, __pyx_L14_except_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; + __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; + goto __pyx_L17_try_end; + __pyx_L12_error:; + __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "gevent/resolver/cares.pyx":222 + * try: + * host_result = ares_host_result(host.h_addrtype, (parse_h_name(host), parse_h_aliases(host), parse_h_addr_list(host))) + * except: # <<<<<<<<<<<<<< + * callback(result(None, sys.exc_info()[1])) + * else: + */ + /*except:*/ { + __Pyx_AddTraceback("gevent.resolver.cares.gevent_ares_host_callback", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_11, &__pyx_t_2) < 0) __PYX_ERR(0, 222, __pyx_L14_except_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_t_11); + __Pyx_GOTREF(__pyx_t_2); + + /* "gevent/resolver/cares.pyx":223 + * host_result = ares_host_result(host.h_addrtype, (parse_h_name(host), parse_h_aliases(host), parse_h_addr_list(host))) + * except: + * callback(result(None, sys.exc_info()[1])) # <<<<<<<<<<<<<< + * else: + * callback(result(host_result)) + */ + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_sys); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 223, __pyx_L14_except_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_exc_info); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 223, __pyx_L14_except_error) + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_13))) { + __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_13); + if (likely(__pyx_t_9)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13); + __Pyx_INCREF(__pyx_t_9); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_13, function); + } + } + __pyx_t_3 = (__pyx_t_9) ? __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_t_9) : __Pyx_PyObject_CallNoArg(__pyx_t_13); + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 223, __pyx_L14_except_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_13 = __Pyx_GetItemInt(__pyx_t_3, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 223, __pyx_L14_except_error) + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 223, __pyx_L14_except_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + PyTuple_SET_ITEM(__pyx_t_3, 0, Py_None); + __Pyx_GIVEREF(__pyx_t_13); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_13); + __pyx_t_13 = 0; + __pyx_t_13 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6gevent_8resolver_5cares_result), __pyx_t_3, NULL); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 223, __pyx_L14_except_error) + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_INCREF(__pyx_v_callback); + __pyx_t_3 = __pyx_v_callback; __pyx_t_9 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_9)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_9); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_10 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_9, __pyx_t_13) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_13); + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 223, __pyx_L14_except_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + goto __pyx_L13_exception_handled; + } + __pyx_L14_except_error:; + + /* "gevent/resolver/cares.pyx":220 + * callback(result(None, gaierror(status, strerror(status)))) + * else: + * try: # <<<<<<<<<<<<<< + * host_result = ares_host_result(host.h_addrtype, (parse_h_name(host), parse_h_aliases(host), parse_h_addr_list(host))) + * except: + */ + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_XGIVEREF(__pyx_t_15); + __Pyx_XGIVEREF(__pyx_t_16); + __Pyx_ExceptionReset(__pyx_t_14, __pyx_t_15, __pyx_t_16); + goto __pyx_L3_error; + __pyx_L13_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_XGIVEREF(__pyx_t_15); + __Pyx_XGIVEREF(__pyx_t_16); + __Pyx_ExceptionReset(__pyx_t_14, __pyx_t_15, __pyx_t_16); + __pyx_L17_try_end:; + } + } + __pyx_L9:; + + /* "gevent/resolver/cares.pyx":216 + * Py_DECREF(arg) + * cdef object host_result + * try: # <<<<<<<<<<<<<< + * if status or not host: + * callback(result(None, gaierror(status, strerror(status)))) + */ + } + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L8_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "gevent/resolver/cares.pyx":226 + * else: + * callback(result(host_result)) + * except: # <<<<<<<<<<<<<< + * channel.loop.handle_error(callback, *sys.exc_info()) + * + */ + /*except:*/ { + __Pyx_AddTraceback("gevent.resolver.cares.gevent_ares_host_callback", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_11, &__pyx_t_1) < 0) __PYX_ERR(0, 226, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_t_11); + __Pyx_GOTREF(__pyx_t_1); + + /* "gevent/resolver/cares.pyx":227 + * callback(result(host_result)) + * except: + * channel.loop.handle_error(callback, *sys.exc_info()) # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_channel->loop, __pyx_n_s_handle_error); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 227, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 227, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_callback); + __Pyx_GIVEREF(__pyx_v_callback); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_callback); + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_sys); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 227, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_exc_info); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 227, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_17); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_17))) { + __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_17); + if (likely(__pyx_t_9)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_17); + __Pyx_INCREF(__pyx_t_9); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_17, function); + } + } + __pyx_t_13 = (__pyx_t_9) ? __Pyx_PyObject_CallOneArg(__pyx_t_17, __pyx_t_9) : __Pyx_PyObject_CallNoArg(__pyx_t_17); + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 227, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + __pyx_t_17 = __Pyx_PySequence_Tuple(__pyx_t_13); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 227, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_17); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_13 = PyNumber_Add(__pyx_t_3, __pyx_t_17); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 227, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + __pyx_t_17 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_13, NULL); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 227, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_17); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L4_exception_handled; + } + __pyx_L5_except_error:; + + /* "gevent/resolver/cares.pyx":216 + * Py_DECREF(arg) + * cdef object host_result + * try: # <<<<<<<<<<<<<< + * if status or not host: + * callback(result(None, gaierror(status, strerror(status)))) + */ + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6); + goto __pyx_L1_error; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6); + __pyx_L8_try_end:; + } + + /* "gevent/resolver/cares.pyx":210 + * + * + * cdef void gevent_ares_host_callback(void *arg, int status, int timeouts, hostent* host): # <<<<<<<<<<<<<< + * cdef channel channel + * cdef object callback + */ + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_XDECREF(__pyx_t_13); + __Pyx_XDECREF(__pyx_t_17); + __Pyx_WriteUnraisable("gevent.resolver.cares.gevent_ares_host_callback", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_channel); + __Pyx_XDECREF(__pyx_v_callback); + __Pyx_XDECREF(__pyx_v_host_result); + __Pyx_RefNannyFinishContext(); +} + +/* "gevent/resolver/cares.pyx":230 + * + * + * cdef void gevent_ares_nameinfo_callback(void *arg, int status, int timeouts, char *c_node, char *c_service): # <<<<<<<<<<<<<< + * cdef channel channel + * cdef object callback + */ + +static void __pyx_f_6gevent_8resolver_5cares_gevent_ares_nameinfo_callback(void *__pyx_v_arg, int __pyx_v_status, CYTHON_UNUSED int __pyx_v_timeouts, char *__pyx_v_c_node, char *__pyx_v_c_service) { + struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_channel = 0; + PyObject *__pyx_v_callback = 0; + PyObject *__pyx_v_node = 0; + PyObject *__pyx_v_service = 0; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + int __pyx_t_11; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + __Pyx_RefNannySetupContext("gevent_ares_nameinfo_callback", 0); + + /* "gevent/resolver/cares.pyx":233 + * cdef channel channel + * cdef object callback + * channel, callback = arg # <<<<<<<<<<<<<< + * Py_DECREF(arg) + * cdef object node + */ + __pyx_t_1 = ((PyObject *)__pyx_v_arg); + __Pyx_INCREF(__pyx_t_1); + if (likely(__pyx_t_1 != Py_None)) { + PyObject* sequence = __pyx_t_1; + Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + __PYX_ERR(0, 233, __pyx_L1_error) + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + #else + __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 233, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 233, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else { + __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(0, 233, __pyx_L1_error) + } + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_6gevent_8resolver_5cares_channel))))) __PYX_ERR(0, 233, __pyx_L1_error) + __pyx_v_channel = ((struct __pyx_obj_6gevent_8resolver_5cares_channel *)__pyx_t_2); + __pyx_t_2 = 0; + __pyx_v_callback = __pyx_t_3; + __pyx_t_3 = 0; + + /* "gevent/resolver/cares.pyx":234 + * cdef object callback + * channel, callback = arg + * Py_DECREF(arg) # <<<<<<<<<<<<<< + * cdef object node + * cdef object service + */ + Py_DECREF(((PyObject *)__pyx_v_arg)); + + /* "gevent/resolver/cares.pyx":237 + * cdef object node + * cdef object service + * try: # <<<<<<<<<<<<<< + * if status: + * callback(result(None, gaierror(status, strerror(status)))) + */ + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6); + __Pyx_XGOTREF(__pyx_t_4); + __Pyx_XGOTREF(__pyx_t_5); + __Pyx_XGOTREF(__pyx_t_6); + /*try:*/ { + + /* "gevent/resolver/cares.pyx":238 + * cdef object service + * try: + * if status: # <<<<<<<<<<<<<< + * callback(result(None, gaierror(status, strerror(status)))) + * else: + */ + __pyx_t_7 = (__pyx_v_status != 0); + if (__pyx_t_7) { + + /* "gevent/resolver/cares.pyx":239 + * try: + * if status: + * callback(result(None, gaierror(status, strerror(status)))) # <<<<<<<<<<<<<< + * else: + * if c_node: + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_gaierror); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 239, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_status); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 239, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_status); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 239, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = __pyx_f_6gevent_8resolver_5cares_strerror(__pyx_t_9, 0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 239, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = NULL; + __pyx_t_11 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_9)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_9); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_11 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_t_8, __pyx_t_10}; + __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 239, __pyx_L3_error) + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_t_8, __pyx_t_10}; + __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 239, __pyx_L3_error) + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + } else + #endif + { + __pyx_t_12 = PyTuple_New(2+__pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 239, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_12); + if (__pyx_t_9) { + __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_9); __pyx_t_9 = NULL; + } + __Pyx_GIVEREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_12, 0+__pyx_t_11, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_10); + PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_11, __pyx_t_10); + __pyx_t_8 = 0; + __pyx_t_10 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_12, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 239, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 239, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + PyTuple_SET_ITEM(__pyx_t_2, 0, Py_None); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6gevent_8resolver_5cares_result), __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 239, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_INCREF(__pyx_v_callback); + __pyx_t_2 = __pyx_v_callback; __pyx_t_12 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_12)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_12); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_12) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_12, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); + __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 239, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "gevent/resolver/cares.pyx":238 + * cdef object service + * try: + * if status: # <<<<<<<<<<<<<< + * callback(result(None, gaierror(status, strerror(status)))) + * else: + */ + goto __pyx_L9; + } + + /* "gevent/resolver/cares.pyx":241 + * callback(result(None, gaierror(status, strerror(status)))) + * else: + * if c_node: # <<<<<<<<<<<<<< + * node = PyUnicode_FromString(c_node) + * else: + */ + /*else*/ { + __pyx_t_7 = (__pyx_v_c_node != 0); + if (__pyx_t_7) { + + /* "gevent/resolver/cares.pyx":242 + * else: + * if c_node: + * node = PyUnicode_FromString(c_node) # <<<<<<<<<<<<<< + * else: + * node = None + */ + __pyx_t_1 = PyUnicode_FromString(__pyx_v_c_node); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 242, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_node = __pyx_t_1; + __pyx_t_1 = 0; + + /* "gevent/resolver/cares.pyx":241 + * callback(result(None, gaierror(status, strerror(status)))) + * else: + * if c_node: # <<<<<<<<<<<<<< + * node = PyUnicode_FromString(c_node) + * else: + */ + goto __pyx_L10; + } + + /* "gevent/resolver/cares.pyx":244 + * node = PyUnicode_FromString(c_node) + * else: + * node = None # <<<<<<<<<<<<<< + * if c_service: + * service = PyUnicode_FromString(c_service) + */ + /*else*/ { + __Pyx_INCREF(Py_None); + __pyx_v_node = Py_None; + } + __pyx_L10:; + + /* "gevent/resolver/cares.pyx":245 + * else: + * node = None + * if c_service: # <<<<<<<<<<<<<< + * service = PyUnicode_FromString(c_service) + * else: + */ + __pyx_t_7 = (__pyx_v_c_service != 0); + if (__pyx_t_7) { + + /* "gevent/resolver/cares.pyx":246 + * node = None + * if c_service: + * service = PyUnicode_FromString(c_service) # <<<<<<<<<<<<<< + * else: + * service = None + */ + __pyx_t_1 = PyUnicode_FromString(__pyx_v_c_service); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 246, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_service = __pyx_t_1; + __pyx_t_1 = 0; + + /* "gevent/resolver/cares.pyx":245 + * else: + * node = None + * if c_service: # <<<<<<<<<<<<<< + * service = PyUnicode_FromString(c_service) + * else: + */ + goto __pyx_L11; + } + + /* "gevent/resolver/cares.pyx":248 + * service = PyUnicode_FromString(c_service) + * else: + * service = None # <<<<<<<<<<<<<< + * callback(result((node, service))) + * except: + */ + /*else*/ { + __Pyx_INCREF(Py_None); + __pyx_v_service = Py_None; + } + __pyx_L11:; + + /* "gevent/resolver/cares.pyx":249 + * else: + * service = None + * callback(result((node, service))) # <<<<<<<<<<<<<< + * except: + * channel.loop.handle_error(callback, *sys.exc_info()) + */ + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 249, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_node); + __Pyx_GIVEREF(__pyx_v_node); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_node); + __Pyx_INCREF(__pyx_v_service); + __Pyx_GIVEREF(__pyx_v_service); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_service); + __pyx_t_3 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_6gevent_8resolver_5cares_result), __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 249, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_INCREF(__pyx_v_callback); + __pyx_t_2 = __pyx_v_callback; __pyx_t_12 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_12)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_12); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_12) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_12, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); + __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 249, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + __pyx_L9:; + + /* "gevent/resolver/cares.pyx":237 + * cdef object node + * cdef object service + * try: # <<<<<<<<<<<<<< + * if status: + * callback(result(None, gaierror(status, strerror(status)))) + */ + } + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L8_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "gevent/resolver/cares.pyx":250 + * service = None + * callback(result((node, service))) + * except: # <<<<<<<<<<<<<< + * channel.loop.handle_error(callback, *sys.exc_info()) + * + */ + /*except:*/ { + __Pyx_AddTraceback("gevent.resolver.cares.gevent_ares_nameinfo_callback", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3) < 0) __PYX_ERR(0, 250, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_t_3); + + /* "gevent/resolver/cares.pyx":251 + * callback(result((node, service))) + * except: + * channel.loop.handle_error(callback, *sys.exc_info()) # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_channel->loop, __pyx_n_s_handle_error); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 251, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 251, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_INCREF(__pyx_v_callback); + __Pyx_GIVEREF(__pyx_v_callback); + PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v_callback); + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_sys); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 251, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_exc_info); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 251, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_13))) { + __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_13); + if (likely(__pyx_t_9)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13); + __Pyx_INCREF(__pyx_t_9); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_13, function); + } + } + __pyx_t_8 = (__pyx_t_9) ? __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_t_9) : __Pyx_PyObject_CallNoArg(__pyx_t_13); + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 251, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_13 = __Pyx_PySequence_Tuple(__pyx_t_8); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 251, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyNumber_Add(__pyx_t_10, __pyx_t_13); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 251, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_8, NULL); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 251, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L4_exception_handled; + } + __pyx_L5_except_error:; + + /* "gevent/resolver/cares.pyx":237 + * cdef object node + * cdef object service + * try: # <<<<<<<<<<<<<< + * if status: + * callback(result(None, gaierror(status, strerror(status)))) + */ + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6); + goto __pyx_L1_error; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6); + __pyx_L8_try_end:; + } + + /* "gevent/resolver/cares.pyx":230 + * + * + * cdef void gevent_ares_nameinfo_callback(void *arg, int status, int timeouts, char *c_node, char *c_service): # <<<<<<<<<<<<<< + * cdef channel channel + * cdef object callback + */ + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_XDECREF(__pyx_t_13); + __Pyx_WriteUnraisable("gevent.resolver.cares.gevent_ares_nameinfo_callback", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_channel); + __Pyx_XDECREF(__pyx_v_callback); + __Pyx_XDECREF(__pyx_v_node); + __Pyx_XDECREF(__pyx_v_service); + __Pyx_RefNannyFinishContext(); +} + +/* "gevent/resolver/cares.pyx":261 + * cdef public object _timer + * + * def __init__(self, object loop, flags=None, timeout=None, tries=None, ndots=None, # <<<<<<<<<<<<<< + * udp_port=None, tcp_port=None, servers=None): + * cdef ares_channeldata* channel = NULL + */ + +/* Python wrapper */ +static int __pyx_pw_6gevent_8resolver_5cares_7channel_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_6gevent_8resolver_5cares_7channel_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_loop = 0; + PyObject *__pyx_v_flags = 0; + PyObject *__pyx_v_timeout = 0; + PyObject *__pyx_v_tries = 0; + PyObject *__pyx_v_ndots = 0; + PyObject *__pyx_v_udp_port = 0; + PyObject *__pyx_v_tcp_port = 0; + PyObject *__pyx_v_servers = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_loop,&__pyx_n_s_flags,&__pyx_n_s_timeout,&__pyx_n_s_tries,&__pyx_n_s_ndots,&__pyx_n_s_udp_port,&__pyx_n_s_tcp_port,&__pyx_n_s_servers,0}; + PyObject* values[8] = {0,0,0,0,0,0,0,0}; + values[1] = ((PyObject *)Py_None); + values[2] = ((PyObject *)Py_None); + values[3] = ((PyObject *)Py_None); + values[4] = ((PyObject *)Py_None); + + /* "gevent/resolver/cares.pyx":262 + * + * def __init__(self, object loop, flags=None, timeout=None, tries=None, ndots=None, + * udp_port=None, tcp_port=None, servers=None): # <<<<<<<<<<<<<< + * cdef ares_channeldata* channel = NULL + * cdef cares.ares_options options + */ + values[5] = ((PyObject *)Py_None); + values[6] = ((PyObject *)Py_None); + values[7] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); + CYTHON_FALLTHROUGH; + case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); + CYTHON_FALLTHROUGH; + case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + CYTHON_FALLTHROUGH; + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + CYTHON_FALLTHROUGH; + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_loop)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flags); + if (value) { values[1] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 2: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_timeout); + if (value) { values[2] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 3: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tries); + if (value) { values[3] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 4: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ndots); + if (value) { values[4] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 5: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_udp_port); + if (value) { values[5] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 6: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tcp_port); + if (value) { values[6] = value; kw_args--; } + } + CYTHON_FALLTHROUGH; + case 7: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_servers); + if (value) { values[7] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 261, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); + CYTHON_FALLTHROUGH; + case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); + CYTHON_FALLTHROUGH; + case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + CYTHON_FALLTHROUGH; + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + CYTHON_FALLTHROUGH; + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_loop = values[0]; + __pyx_v_flags = values[1]; + __pyx_v_timeout = values[2]; + __pyx_v_tries = values[3]; + __pyx_v_ndots = values[4]; + __pyx_v_udp_port = values[5]; + __pyx_v_tcp_port = values[6]; + __pyx_v_servers = values[7]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 8, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 261, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.resolver.cares.channel.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_8resolver_5cares_7channel___init__(((struct __pyx_obj_6gevent_8resolver_5cares_channel *)__pyx_v_self), __pyx_v_loop, __pyx_v_flags, __pyx_v_timeout, __pyx_v_tries, __pyx_v_ndots, __pyx_v_udp_port, __pyx_v_tcp_port, __pyx_v_servers); + + /* "gevent/resolver/cares.pyx":261 + * cdef public object _timer + * + * def __init__(self, object loop, flags=None, timeout=None, tries=None, ndots=None, # <<<<<<<<<<<<<< + * udp_port=None, tcp_port=None, servers=None): + * cdef ares_channeldata* channel = NULL + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_8resolver_5cares_7channel___init__(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self, PyObject *__pyx_v_loop, PyObject *__pyx_v_flags, PyObject *__pyx_v_timeout, PyObject *__pyx_v_tries, PyObject *__pyx_v_ndots, PyObject *__pyx_v_udp_port, PyObject *__pyx_v_tcp_port, PyObject *__pyx_v_servers) { + struct ares_channeldata *__pyx_v_channel; + struct ares_options __pyx_v_options; + int __pyx_v_optmask; + int __pyx_v_result; + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + double __pyx_t_5; + unsigned short __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + PyObject *__pyx_t_14 = NULL; + struct __pyx_opt_args_6gevent_8resolver_5cares_7channel_set_servers __pyx_t_15; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "gevent/resolver/cares.pyx":263 + * def __init__(self, object loop, flags=None, timeout=None, tries=None, ndots=None, + * udp_port=None, tcp_port=None, servers=None): + * cdef ares_channeldata* channel = NULL # <<<<<<<<<<<<<< + * cdef cares.ares_options options + * memset(&options, 0, sizeof(cares.ares_options)) + */ + __pyx_v_channel = NULL; + + /* "gevent/resolver/cares.pyx":265 + * cdef ares_channeldata* channel = NULL + * cdef cares.ares_options options + * memset(&options, 0, sizeof(cares.ares_options)) # <<<<<<<<<<<<<< + * cdef int optmask = cares.ARES_OPT_SOCK_STATE_CB + * options.sock_state_cb = gevent_sock_state_callback + */ + memset((&__pyx_v_options), 0, (sizeof(struct ares_options))); + + /* "gevent/resolver/cares.pyx":266 + * cdef cares.ares_options options + * memset(&options, 0, sizeof(cares.ares_options)) + * cdef int optmask = cares.ARES_OPT_SOCK_STATE_CB # <<<<<<<<<<<<<< + * options.sock_state_cb = gevent_sock_state_callback + * options.sock_state_cb_data = self + */ + __pyx_v_optmask = ARES_OPT_SOCK_STATE_CB; + + /* "gevent/resolver/cares.pyx":267 + * memset(&options, 0, sizeof(cares.ares_options)) + * cdef int optmask = cares.ARES_OPT_SOCK_STATE_CB + * options.sock_state_cb = gevent_sock_state_callback # <<<<<<<<<<<<<< + * options.sock_state_cb_data = self + * if flags is not None: + */ + __pyx_v_options.sock_state_cb = ((void *)__pyx_f_6gevent_8resolver_5cares_gevent_sock_state_callback); + + /* "gevent/resolver/cares.pyx":268 + * cdef int optmask = cares.ARES_OPT_SOCK_STATE_CB + * options.sock_state_cb = gevent_sock_state_callback + * options.sock_state_cb_data = self # <<<<<<<<<<<<<< + * if flags is not None: + * options.flags = int(flags) + */ + __pyx_v_options.sock_state_cb_data = ((void *)__pyx_v_self); + + /* "gevent/resolver/cares.pyx":269 + * options.sock_state_cb = gevent_sock_state_callback + * options.sock_state_cb_data = self + * if flags is not None: # <<<<<<<<<<<<<< + * options.flags = int(flags) + * optmask |= cares.ARES_OPT_FLAGS + */ + __pyx_t_1 = (__pyx_v_flags != Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "gevent/resolver/cares.pyx":270 + * options.sock_state_cb_data = self + * if flags is not None: + * options.flags = int(flags) # <<<<<<<<<<<<<< + * optmask |= cares.ARES_OPT_FLAGS + * if timeout is not None: + */ + __pyx_t_3 = __Pyx_PyNumber_Int(__pyx_v_flags); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 270, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 270, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_options.flags = __pyx_t_4; + + /* "gevent/resolver/cares.pyx":271 + * if flags is not None: + * options.flags = int(flags) + * optmask |= cares.ARES_OPT_FLAGS # <<<<<<<<<<<<<< + * if timeout is not None: + * options.timeout = int(float(timeout) * 1000) + */ + __pyx_v_optmask = (__pyx_v_optmask | ARES_OPT_FLAGS); + + /* "gevent/resolver/cares.pyx":269 + * options.sock_state_cb = gevent_sock_state_callback + * options.sock_state_cb_data = self + * if flags is not None: # <<<<<<<<<<<<<< + * options.flags = int(flags) + * optmask |= cares.ARES_OPT_FLAGS + */ + } + + /* "gevent/resolver/cares.pyx":272 + * options.flags = int(flags) + * optmask |= cares.ARES_OPT_FLAGS + * if timeout is not None: # <<<<<<<<<<<<<< + * options.timeout = int(float(timeout) * 1000) + * optmask |= cares.ARES_OPT_TIMEOUTMS + */ + __pyx_t_2 = (__pyx_v_timeout != Py_None); + __pyx_t_1 = (__pyx_t_2 != 0); + if (__pyx_t_1) { + + /* "gevent/resolver/cares.pyx":273 + * optmask |= cares.ARES_OPT_FLAGS + * if timeout is not None: + * options.timeout = int(float(timeout) * 1000) # <<<<<<<<<<<<<< + * optmask |= cares.ARES_OPT_TIMEOUTMS + * if tries is not None: + */ + __pyx_t_5 = __Pyx_PyObject_AsDouble(__pyx_v_timeout); if (unlikely(__pyx_t_5 == ((double)((double)-1)) && PyErr_Occurred())) __PYX_ERR(0, 273, __pyx_L1_error) + __pyx_v_options.timeout = ((int)(__pyx_t_5 * 1000.0)); + + /* "gevent/resolver/cares.pyx":274 + * if timeout is not None: + * options.timeout = int(float(timeout) * 1000) + * optmask |= cares.ARES_OPT_TIMEOUTMS # <<<<<<<<<<<<<< + * if tries is not None: + * options.tries = int(tries) + */ + __pyx_v_optmask = (__pyx_v_optmask | ARES_OPT_TIMEOUTMS); + + /* "gevent/resolver/cares.pyx":272 + * options.flags = int(flags) + * optmask |= cares.ARES_OPT_FLAGS + * if timeout is not None: # <<<<<<<<<<<<<< + * options.timeout = int(float(timeout) * 1000) + * optmask |= cares.ARES_OPT_TIMEOUTMS + */ + } + + /* "gevent/resolver/cares.pyx":275 + * options.timeout = int(float(timeout) * 1000) + * optmask |= cares.ARES_OPT_TIMEOUTMS + * if tries is not None: # <<<<<<<<<<<<<< + * options.tries = int(tries) + * optmask |= cares.ARES_OPT_TRIES + */ + __pyx_t_1 = (__pyx_v_tries != Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "gevent/resolver/cares.pyx":276 + * optmask |= cares.ARES_OPT_TIMEOUTMS + * if tries is not None: + * options.tries = int(tries) # <<<<<<<<<<<<<< + * optmask |= cares.ARES_OPT_TRIES + * if ndots is not None: + */ + __pyx_t_3 = __Pyx_PyNumber_Int(__pyx_v_tries); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 276, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 276, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_options.tries = __pyx_t_4; + + /* "gevent/resolver/cares.pyx":277 + * if tries is not None: + * options.tries = int(tries) + * optmask |= cares.ARES_OPT_TRIES # <<<<<<<<<<<<<< + * if ndots is not None: + * options.ndots = int(ndots) + */ + __pyx_v_optmask = (__pyx_v_optmask | ARES_OPT_TRIES); + + /* "gevent/resolver/cares.pyx":275 + * options.timeout = int(float(timeout) * 1000) + * optmask |= cares.ARES_OPT_TIMEOUTMS + * if tries is not None: # <<<<<<<<<<<<<< + * options.tries = int(tries) + * optmask |= cares.ARES_OPT_TRIES + */ + } + + /* "gevent/resolver/cares.pyx":278 + * options.tries = int(tries) + * optmask |= cares.ARES_OPT_TRIES + * if ndots is not None: # <<<<<<<<<<<<<< + * options.ndots = int(ndots) + * optmask |= cares.ARES_OPT_NDOTS + */ + __pyx_t_2 = (__pyx_v_ndots != Py_None); + __pyx_t_1 = (__pyx_t_2 != 0); + if (__pyx_t_1) { + + /* "gevent/resolver/cares.pyx":279 + * optmask |= cares.ARES_OPT_TRIES + * if ndots is not None: + * options.ndots = int(ndots) # <<<<<<<<<<<<<< + * optmask |= cares.ARES_OPT_NDOTS + * if udp_port is not None: + */ + __pyx_t_3 = __Pyx_PyNumber_Int(__pyx_v_ndots); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 279, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 279, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_options.ndots = __pyx_t_4; + + /* "gevent/resolver/cares.pyx":280 + * if ndots is not None: + * options.ndots = int(ndots) + * optmask |= cares.ARES_OPT_NDOTS # <<<<<<<<<<<<<< + * if udp_port is not None: + * options.udp_port = int(udp_port) + */ + __pyx_v_optmask = (__pyx_v_optmask | ARES_OPT_NDOTS); + + /* "gevent/resolver/cares.pyx":278 + * options.tries = int(tries) + * optmask |= cares.ARES_OPT_TRIES + * if ndots is not None: # <<<<<<<<<<<<<< + * options.ndots = int(ndots) + * optmask |= cares.ARES_OPT_NDOTS + */ + } + + /* "gevent/resolver/cares.pyx":281 + * options.ndots = int(ndots) + * optmask |= cares.ARES_OPT_NDOTS + * if udp_port is not None: # <<<<<<<<<<<<<< + * options.udp_port = int(udp_port) + * optmask |= cares.ARES_OPT_UDP_PORT + */ + __pyx_t_1 = (__pyx_v_udp_port != Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "gevent/resolver/cares.pyx":282 + * optmask |= cares.ARES_OPT_NDOTS + * if udp_port is not None: + * options.udp_port = int(udp_port) # <<<<<<<<<<<<<< + * optmask |= cares.ARES_OPT_UDP_PORT + * if tcp_port is not None: + */ + __pyx_t_3 = __Pyx_PyNumber_Int(__pyx_v_udp_port); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 282, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_6 = __Pyx_PyInt_As_unsigned_short(__pyx_t_3); if (unlikely((__pyx_t_6 == (unsigned short)-1) && PyErr_Occurred())) __PYX_ERR(0, 282, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_options.udp_port = __pyx_t_6; + + /* "gevent/resolver/cares.pyx":283 + * if udp_port is not None: + * options.udp_port = int(udp_port) + * optmask |= cares.ARES_OPT_UDP_PORT # <<<<<<<<<<<<<< + * if tcp_port is not None: + * options.tcp_port = int(tcp_port) + */ + __pyx_v_optmask = (__pyx_v_optmask | ARES_OPT_UDP_PORT); + + /* "gevent/resolver/cares.pyx":281 + * options.ndots = int(ndots) + * optmask |= cares.ARES_OPT_NDOTS + * if udp_port is not None: # <<<<<<<<<<<<<< + * options.udp_port = int(udp_port) + * optmask |= cares.ARES_OPT_UDP_PORT + */ + } + + /* "gevent/resolver/cares.pyx":284 + * options.udp_port = int(udp_port) + * optmask |= cares.ARES_OPT_UDP_PORT + * if tcp_port is not None: # <<<<<<<<<<<<<< + * options.tcp_port = int(tcp_port) + * optmask |= cares.ARES_OPT_TCP_PORT + */ + __pyx_t_2 = (__pyx_v_tcp_port != Py_None); + __pyx_t_1 = (__pyx_t_2 != 0); + if (__pyx_t_1) { + + /* "gevent/resolver/cares.pyx":285 + * optmask |= cares.ARES_OPT_UDP_PORT + * if tcp_port is not None: + * options.tcp_port = int(tcp_port) # <<<<<<<<<<<<<< + * optmask |= cares.ARES_OPT_TCP_PORT + * cdef int result = cares.ares_library_init(cares.ARES_LIB_INIT_ALL) # ARES_LIB_INIT_WIN32 -DUSE_WINSOCK? + */ + __pyx_t_3 = __Pyx_PyNumber_Int(__pyx_v_tcp_port); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 285, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_6 = __Pyx_PyInt_As_unsigned_short(__pyx_t_3); if (unlikely((__pyx_t_6 == (unsigned short)-1) && PyErr_Occurred())) __PYX_ERR(0, 285, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_options.tcp_port = __pyx_t_6; + + /* "gevent/resolver/cares.pyx":286 + * if tcp_port is not None: + * options.tcp_port = int(tcp_port) + * optmask |= cares.ARES_OPT_TCP_PORT # <<<<<<<<<<<<<< + * cdef int result = cares.ares_library_init(cares.ARES_LIB_INIT_ALL) # ARES_LIB_INIT_WIN32 -DUSE_WINSOCK? + * if result: + */ + __pyx_v_optmask = (__pyx_v_optmask | ARES_OPT_TCP_PORT); + + /* "gevent/resolver/cares.pyx":284 + * options.udp_port = int(udp_port) + * optmask |= cares.ARES_OPT_UDP_PORT + * if tcp_port is not None: # <<<<<<<<<<<<<< + * options.tcp_port = int(tcp_port) + * optmask |= cares.ARES_OPT_TCP_PORT + */ + } + + /* "gevent/resolver/cares.pyx":287 + * options.tcp_port = int(tcp_port) + * optmask |= cares.ARES_OPT_TCP_PORT + * cdef int result = cares.ares_library_init(cares.ARES_LIB_INIT_ALL) # ARES_LIB_INIT_WIN32 -DUSE_WINSOCK? # <<<<<<<<<<<<<< + * if result: + * raise gaierror(result, strerror(result)) + */ + __pyx_v_result = ares_library_init(ARES_LIB_INIT_ALL); + + /* "gevent/resolver/cares.pyx":288 + * optmask |= cares.ARES_OPT_TCP_PORT + * cdef int result = cares.ares_library_init(cares.ARES_LIB_INIT_ALL) # ARES_LIB_INIT_WIN32 -DUSE_WINSOCK? + * if result: # <<<<<<<<<<<<<< + * raise gaierror(result, strerror(result)) + * result = cares.ares_init_options(&channel, &options, optmask) + */ + __pyx_t_1 = (__pyx_v_result != 0); + if (unlikely(__pyx_t_1)) { + + /* "gevent/resolver/cares.pyx":289 + * cdef int result = cares.ares_library_init(cares.ARES_LIB_INIT_ALL) # ARES_LIB_INIT_WIN32 -DUSE_WINSOCK? + * if result: + * raise gaierror(result, strerror(result)) # <<<<<<<<<<<<<< + * result = cares.ares_init_options(&channel, &options, optmask) + * if result: + */ + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_gaierror); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 289, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_result); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 289, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_result); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 289, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = __pyx_f_6gevent_8resolver_5cares_strerror(__pyx_t_9, 0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 289, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = NULL; + __pyx_t_4 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) { + __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_7); + if (likely(__pyx_t_9)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); + __Pyx_INCREF(__pyx_t_9); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_7, function); + __pyx_t_4 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_7)) { + PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_t_8, __pyx_t_10}; + __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 289, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) { + PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_t_8, __pyx_t_10}; + __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 289, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + } else + #endif + { + __pyx_t_11 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 289, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + if (__pyx_t_9) { + __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_9); __pyx_t_9 = NULL; + } + __Pyx_GIVEREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_4, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_10); + PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_4, __pyx_t_10); + __pyx_t_8 = 0; + __pyx_t_10 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_11, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 289, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + } + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(0, 289, __pyx_L1_error) + + /* "gevent/resolver/cares.pyx":288 + * optmask |= cares.ARES_OPT_TCP_PORT + * cdef int result = cares.ares_library_init(cares.ARES_LIB_INIT_ALL) # ARES_LIB_INIT_WIN32 -DUSE_WINSOCK? + * if result: # <<<<<<<<<<<<<< + * raise gaierror(result, strerror(result)) + * result = cares.ares_init_options(&channel, &options, optmask) + */ + } + + /* "gevent/resolver/cares.pyx":290 + * if result: + * raise gaierror(result, strerror(result)) + * result = cares.ares_init_options(&channel, &options, optmask) # <<<<<<<<<<<<<< + * if result: + * raise gaierror(result, strerror(result)) + */ + __pyx_v_result = ares_init_options((&__pyx_v_channel), (&__pyx_v_options), __pyx_v_optmask); + + /* "gevent/resolver/cares.pyx":291 + * raise gaierror(result, strerror(result)) + * result = cares.ares_init_options(&channel, &options, optmask) + * if result: # <<<<<<<<<<<<<< + * raise gaierror(result, strerror(result)) + * self._timer = loop.timer(TIMEOUT, TIMEOUT) + */ + __pyx_t_1 = (__pyx_v_result != 0); + if (unlikely(__pyx_t_1)) { + + /* "gevent/resolver/cares.pyx":292 + * result = cares.ares_init_options(&channel, &options, optmask) + * if result: + * raise gaierror(result, strerror(result)) # <<<<<<<<<<<<<< + * self._timer = loop.timer(TIMEOUT, TIMEOUT) + * self._watchers = {} + */ + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_gaierror); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 292, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_11 = __Pyx_PyInt_From_int(__pyx_v_result); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 292, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_10 = __Pyx_PyInt_From_int(__pyx_v_result); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 292, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_8 = __pyx_f_6gevent_8resolver_5cares_strerror(__pyx_t_10, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 292, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = NULL; + __pyx_t_4 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) { + __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_7); + if (likely(__pyx_t_10)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); + __Pyx_INCREF(__pyx_t_10); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_7, function); + __pyx_t_4 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_7)) { + PyObject *__pyx_temp[3] = {__pyx_t_10, __pyx_t_11, __pyx_t_8}; + __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 292, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) { + PyObject *__pyx_temp[3] = {__pyx_t_10, __pyx_t_11, __pyx_t_8}; + __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 292, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + } else + #endif + { + __pyx_t_9 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 292, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + if (__pyx_t_10) { + __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_10); __pyx_t_10 = NULL; + } + __Pyx_GIVEREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_4, __pyx_t_11); + __Pyx_GIVEREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_4, __pyx_t_8); + __pyx_t_11 = 0; + __pyx_t_8 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 292, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(0, 292, __pyx_L1_error) + + /* "gevent/resolver/cares.pyx":291 + * raise gaierror(result, strerror(result)) + * result = cares.ares_init_options(&channel, &options, optmask) + * if result: # <<<<<<<<<<<<<< + * raise gaierror(result, strerror(result)) + * self._timer = loop.timer(TIMEOUT, TIMEOUT) + */ + } + + /* "gevent/resolver/cares.pyx":293 + * if result: + * raise gaierror(result, strerror(result)) + * self._timer = loop.timer(TIMEOUT, TIMEOUT) # <<<<<<<<<<<<<< + * self._watchers = {} + * self.channel = channel + */ + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_loop, __pyx_n_s_timer); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 293, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_TIMEOUT); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 293, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_TIMEOUT); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 293, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_11 = NULL; + __pyx_t_4 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) { + __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_7); + if (likely(__pyx_t_11)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); + __Pyx_INCREF(__pyx_t_11); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_7, function); + __pyx_t_4 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_7)) { + PyObject *__pyx_temp[3] = {__pyx_t_11, __pyx_t_9, __pyx_t_8}; + __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 293, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) { + PyObject *__pyx_temp[3] = {__pyx_t_11, __pyx_t_9, __pyx_t_8}; + __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 293, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + } else + #endif + { + __pyx_t_10 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 293, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + if (__pyx_t_11) { + __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_11); __pyx_t_11 = NULL; + } + __Pyx_GIVEREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_4, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_4, __pyx_t_8); + __pyx_t_9 = 0; + __pyx_t_8 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_10, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 293, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + } + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_GIVEREF(__pyx_t_3); + __Pyx_GOTREF(__pyx_v_self->_timer); + __Pyx_DECREF(__pyx_v_self->_timer); + __pyx_v_self->_timer = __pyx_t_3; + __pyx_t_3 = 0; + + /* "gevent/resolver/cares.pyx":294 + * raise gaierror(result, strerror(result)) + * self._timer = loop.timer(TIMEOUT, TIMEOUT) + * self._watchers = {} # <<<<<<<<<<<<<< + * self.channel = channel + * try: + */ + __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 294, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __Pyx_GOTREF(__pyx_v_self->_watchers); + __Pyx_DECREF(__pyx_v_self->_watchers); + __pyx_v_self->_watchers = ((PyObject*)__pyx_t_3); + __pyx_t_3 = 0; + + /* "gevent/resolver/cares.pyx":295 + * self._timer = loop.timer(TIMEOUT, TIMEOUT) + * self._watchers = {} + * self.channel = channel # <<<<<<<<<<<<<< + * try: + * if servers is not None: + */ + __pyx_v_self->channel = __pyx_v_channel; + + /* "gevent/resolver/cares.pyx":296 + * self._watchers = {} + * self.channel = channel + * try: # <<<<<<<<<<<<<< + * if servers is not None: + * self.set_servers(servers) + */ + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14); + __Pyx_XGOTREF(__pyx_t_12); + __Pyx_XGOTREF(__pyx_t_13); + __Pyx_XGOTREF(__pyx_t_14); + /*try:*/ { + + /* "gevent/resolver/cares.pyx":297 + * self.channel = channel + * try: + * if servers is not None: # <<<<<<<<<<<<<< + * self.set_servers(servers) + * self.loop = loop + */ + __pyx_t_1 = (__pyx_v_servers != Py_None); + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "gevent/resolver/cares.pyx":298 + * try: + * if servers is not None: + * self.set_servers(servers) # <<<<<<<<<<<<<< + * self.loop = loop + * except: + */ + __pyx_t_15.__pyx_n = 1; + __pyx_t_15.servers = __pyx_v_servers; + __pyx_t_3 = ((struct __pyx_vtabstruct_6gevent_8resolver_5cares_channel *)__pyx_v_self->__pyx_vtab)->set_servers(__pyx_v_self, 0, &__pyx_t_15); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 298, __pyx_L11_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "gevent/resolver/cares.pyx":297 + * self.channel = channel + * try: + * if servers is not None: # <<<<<<<<<<<<<< + * self.set_servers(servers) + * self.loop = loop + */ + } + + /* "gevent/resolver/cares.pyx":299 + * if servers is not None: + * self.set_servers(servers) + * self.loop = loop # <<<<<<<<<<<<<< + * except: + * self.destroy() + */ + __Pyx_INCREF(__pyx_v_loop); + __Pyx_GIVEREF(__pyx_v_loop); + __Pyx_GOTREF(__pyx_v_self->loop); + __Pyx_DECREF(__pyx_v_self->loop); + __pyx_v_self->loop = __pyx_v_loop; + + /* "gevent/resolver/cares.pyx":296 + * self._watchers = {} + * self.channel = channel + * try: # <<<<<<<<<<<<<< + * if servers is not None: + * self.set_servers(servers) + */ + } + __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; + goto __pyx_L16_try_end; + __pyx_L11_error:; + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "gevent/resolver/cares.pyx":300 + * self.set_servers(servers) + * self.loop = loop + * except: # <<<<<<<<<<<<<< + * self.destroy() + * raise + */ + /*except:*/ { + __Pyx_AddTraceback("gevent.resolver.cares.channel.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_7, &__pyx_t_10) < 0) __PYX_ERR(0, 300, __pyx_L13_except_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GOTREF(__pyx_t_10); + + /* "gevent/resolver/cares.pyx":301 + * self.loop = loop + * except: + * self.destroy() # <<<<<<<<<<<<<< + * raise + * + */ + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_destroy); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 301, __pyx_L13_except_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_11 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) { + __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_9); + if (likely(__pyx_t_11)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); + __Pyx_INCREF(__pyx_t_11); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_9, function); + } + } + __pyx_t_8 = (__pyx_t_11) ? __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_11) : __Pyx_PyObject_CallNoArg(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 301, __pyx_L13_except_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + + /* "gevent/resolver/cares.pyx":302 + * except: + * self.destroy() + * raise # <<<<<<<<<<<<<< + * + * def __repr__(self): + */ + __Pyx_GIVEREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_7); + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_ErrRestoreWithState(__pyx_t_3, __pyx_t_7, __pyx_t_10); + __pyx_t_3 = 0; __pyx_t_7 = 0; __pyx_t_10 = 0; + __PYX_ERR(0, 302, __pyx_L13_except_error) + } + __pyx_L13_except_error:; + + /* "gevent/resolver/cares.pyx":296 + * self._watchers = {} + * self.channel = channel + * try: # <<<<<<<<<<<<<< + * if servers is not None: + * self.set_servers(servers) + */ + __Pyx_XGIVEREF(__pyx_t_12); + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14); + goto __pyx_L1_error; + __pyx_L16_try_end:; + } + + /* "gevent/resolver/cares.pyx":261 + * cdef public object _timer + * + * def __init__(self, object loop, flags=None, timeout=None, tries=None, ndots=None, # <<<<<<<<<<<<<< + * udp_port=None, tcp_port=None, servers=None): + * cdef ares_channeldata* channel = NULL + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_AddTraceback("gevent.resolver.cares.channel.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/resolver/cares.pyx":304 + * raise + * + * def __repr__(self): # <<<<<<<<<<<<<< + * args = (self.__class__.__name__, id(self), self._timer, len(self._watchers)) + * return '<%s at 0x%x _timer=%r _watchers[%s]>' % args + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_3__repr__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_3__repr__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_8resolver_5cares_7channel_2__repr__(((struct __pyx_obj_6gevent_8resolver_5cares_channel *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_8resolver_5cares_7channel_2__repr__(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self) { + PyObject *__pyx_v_args = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + Py_ssize_t __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + __Pyx_RefNannySetupContext("__repr__", 0); + + /* "gevent/resolver/cares.pyx":305 + * + * def __repr__(self): + * args = (self.__class__.__name__, id(self), self._timer, len(self._watchers)) # <<<<<<<<<<<<<< + * return '<%s at 0x%x _timer=%r _watchers[%s]>' % args + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 305, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 305, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 305, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __pyx_v_self->_watchers; + __Pyx_INCREF(__pyx_t_3); + if (unlikely(__pyx_t_3 == Py_None)) { + PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); + __PYX_ERR(0, 305, __pyx_L1_error) + } + __pyx_t_4 = PyDict_Size(__pyx_t_3); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 305, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 305, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 305, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1); + __Pyx_INCREF(__pyx_v_self->_timer); + __Pyx_GIVEREF(__pyx_v_self->_timer); + PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_self->_timer); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_3); + __pyx_t_2 = 0; + __pyx_t_1 = 0; + __pyx_t_3 = 0; + __pyx_v_args = ((PyObject*)__pyx_t_5); + __pyx_t_5 = 0; + + /* "gevent/resolver/cares.pyx":306 + * def __repr__(self): + * args = (self.__class__.__name__, id(self), self._timer, len(self._watchers)) + * return '<%s at 0x%x _timer=%r _watchers[%s]>' % args # <<<<<<<<<<<<<< + * + * def destroy(self): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_s_at_0x_x__timer_r__watchers_s, __pyx_v_args); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 306, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L0; + + /* "gevent/resolver/cares.pyx":304 + * raise + * + * def __repr__(self): # <<<<<<<<<<<<<< + * args = (self.__class__.__name__, id(self), self._timer, len(self._watchers)) + * return '<%s at 0x%x _timer=%r _watchers[%s]>' % args + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("gevent.resolver.cares.channel.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_args); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/resolver/cares.pyx":308 + * return '<%s at 0x%x _timer=%r _watchers[%s]>' % args + * + * def destroy(self): # <<<<<<<<<<<<<< + * if self.channel: + * # XXX ares_library_cleanup? + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_5destroy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_5destroy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("destroy (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_8resolver_5cares_7channel_4destroy(((struct __pyx_obj_6gevent_8resolver_5cares_channel *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_8resolver_5cares_7channel_4destroy(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + __Pyx_RefNannySetupContext("destroy", 0); + + /* "gevent/resolver/cares.pyx":309 + * + * def destroy(self): + * if self.channel: # <<<<<<<<<<<<<< + * # XXX ares_library_cleanup? + * cares.ares_destroy(self.channel) + */ + __pyx_t_1 = (__pyx_v_self->channel != 0); + if (__pyx_t_1) { + + /* "gevent/resolver/cares.pyx":311 + * if self.channel: + * # XXX ares_library_cleanup? + * cares.ares_destroy(self.channel) # <<<<<<<<<<<<<< + * self.channel = NULL + * self._watchers.clear() + */ + ares_destroy(__pyx_v_self->channel); + + /* "gevent/resolver/cares.pyx":312 + * # XXX ares_library_cleanup? + * cares.ares_destroy(self.channel) + * self.channel = NULL # <<<<<<<<<<<<<< + * self._watchers.clear() + * self._timer.stop() + */ + __pyx_v_self->channel = NULL; + + /* "gevent/resolver/cares.pyx":313 + * cares.ares_destroy(self.channel) + * self.channel = NULL + * self._watchers.clear() # <<<<<<<<<<<<<< + * self._timer.stop() + * self.loop = None + */ + if (unlikely(__pyx_v_self->_watchers == Py_None)) { + PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "clear"); + __PYX_ERR(0, 313, __pyx_L1_error) + } + __pyx_t_2 = __Pyx_PyDict_Clear(__pyx_v_self->_watchers); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 313, __pyx_L1_error) + + /* "gevent/resolver/cares.pyx":314 + * self.channel = NULL + * self._watchers.clear() + * self._timer.stop() # <<<<<<<<<<<<<< + * self.loop = None + * + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_timer, __pyx_n_s_stop); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 314, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + } + } + __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 314, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "gevent/resolver/cares.pyx":315 + * self._watchers.clear() + * self._timer.stop() + * self.loop = None # <<<<<<<<<<<<<< + * + * def __dealloc__(self): + */ + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->loop); + __Pyx_DECREF(__pyx_v_self->loop); + __pyx_v_self->loop = Py_None; + + /* "gevent/resolver/cares.pyx":309 + * + * def destroy(self): + * if self.channel: # <<<<<<<<<<<<<< + * # XXX ares_library_cleanup? + * cares.ares_destroy(self.channel) + */ + } + + /* "gevent/resolver/cares.pyx":308 + * return '<%s at 0x%x _timer=%r _watchers[%s]>' % args + * + * def destroy(self): # <<<<<<<<<<<<<< + * if self.channel: + * # XXX ares_library_cleanup? + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("gevent.resolver.cares.channel.destroy", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/resolver/cares.pyx":317 + * self.loop = None + * + * def __dealloc__(self): # <<<<<<<<<<<<<< + * if self.channel: + * # XXX ares_library_cleanup? + */ + +/* Python wrapper */ +static void __pyx_pw_6gevent_8resolver_5cares_7channel_7__dealloc__(PyObject *__pyx_v_self); /*proto*/ +static void __pyx_pw_6gevent_8resolver_5cares_7channel_7__dealloc__(PyObject *__pyx_v_self) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); + __pyx_pf_6gevent_8resolver_5cares_7channel_6__dealloc__(((struct __pyx_obj_6gevent_8resolver_5cares_channel *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +static void __pyx_pf_6gevent_8resolver_5cares_7channel_6__dealloc__(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self) { + __Pyx_RefNannyDeclarations + int __pyx_t_1; + __Pyx_RefNannySetupContext("__dealloc__", 0); + + /* "gevent/resolver/cares.pyx":318 + * + * def __dealloc__(self): + * if self.channel: # <<<<<<<<<<<<<< + * # XXX ares_library_cleanup? + * cares.ares_destroy(self.channel) + */ + __pyx_t_1 = (__pyx_v_self->channel != 0); + if (__pyx_t_1) { + + /* "gevent/resolver/cares.pyx":320 + * if self.channel: + * # XXX ares_library_cleanup? + * cares.ares_destroy(self.channel) # <<<<<<<<<<<<<< + * self.channel = NULL + * + */ + ares_destroy(__pyx_v_self->channel); + + /* "gevent/resolver/cares.pyx":321 + * # XXX ares_library_cleanup? + * cares.ares_destroy(self.channel) + * self.channel = NULL # <<<<<<<<<<<<<< + * + * cpdef set_servers(self, servers=None): + */ + __pyx_v_self->channel = NULL; + + /* "gevent/resolver/cares.pyx":318 + * + * def __dealloc__(self): + * if self.channel: # <<<<<<<<<<<<<< + * # XXX ares_library_cleanup? + * cares.ares_destroy(self.channel) + */ + } + + /* "gevent/resolver/cares.pyx":317 + * self.loop = None + * + * def __dealloc__(self): # <<<<<<<<<<<<<< + * if self.channel: + * # XXX ares_library_cleanup? + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "gevent/resolver/cares.pyx":323 + * self.channel = NULL + * + * cpdef set_servers(self, servers=None): # <<<<<<<<<<<<<< + * if not self.channel: + * raise gaierror(cares.ARES_EDESTRUCTION, 'this ares channel has been destroyed') + */ + +static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_9set_servers(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_6gevent_8resolver_5cares_7channel_set_servers(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_8resolver_5cares_7channel_set_servers *__pyx_optional_args) { + PyObject *__pyx_v_servers = ((PyObject *)Py_None); + int __pyx_v_length; + CYTHON_UNUSED int __pyx_v_result; + int __pyx_v_index; + char *__pyx_v_string; + struct ares_addr_node *__pyx_v_c_servers; + PyObject *__pyx_v_server = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + int __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + int __pyx_t_8; + Py_ssize_t __pyx_t_9; + PyObject *(*__pyx_t_10)(PyObject *); + char *__pyx_t_11; + int __pyx_t_12; + char const *__pyx_t_13; + PyObject *__pyx_t_14 = NULL; + PyObject *__pyx_t_15 = NULL; + PyObject *__pyx_t_16 = NULL; + PyObject *__pyx_t_17 = NULL; + PyObject *__pyx_t_18 = NULL; + PyObject *__pyx_t_19 = NULL; + __Pyx_RefNannySetupContext("set_servers", 0); + if (__pyx_optional_args) { + if (__pyx_optional_args->__pyx_n > 0) { + __pyx_v_servers = __pyx_optional_args->servers; + } + } + __Pyx_INCREF(__pyx_v_servers); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0; + if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self)))))); + else { + PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + #endif + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_servers); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 323, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_8resolver_5cares_7channel_9set_servers)) { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_servers) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_servers); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 323, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0; + if (unlikely(type_dict_guard != tp_dict_version)) { + tp_dict_version = obj_dict_version = 0; + } + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + } + #endif + } + + /* "gevent/resolver/cares.pyx":324 + * + * cpdef set_servers(self, servers=None): + * if not self.channel: # <<<<<<<<<<<<<< + * raise gaierror(cares.ARES_EDESTRUCTION, 'this ares channel has been destroyed') + * if not servers: + */ + __pyx_t_5 = ((!(__pyx_v_self->channel != 0)) != 0); + if (unlikely(__pyx_t_5)) { + + /* "gevent/resolver/cares.pyx":325 + * cpdef set_servers(self, servers=None): + * if not self.channel: + * raise gaierror(cares.ARES_EDESTRUCTION, 'this ares channel has been destroyed') # <<<<<<<<<<<<<< + * if not servers: + * servers = [] + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_gaierror); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 325, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyInt_From_int(ARES_EDESTRUCTION); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 325, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = NULL; + __pyx_t_6 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_6 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_3, __pyx_kp_s_this_ares_channel_has_been_destr}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 325, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_3, __pyx_kp_s_this_ares_channel_has_been_destr}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 325, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } else + #endif + { + __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 325, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + if (__pyx_t_4) { + __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4); __pyx_t_4 = NULL; + } + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_t_3); + __Pyx_INCREF(__pyx_kp_s_this_ares_channel_has_been_destr); + __Pyx_GIVEREF(__pyx_kp_s_this_ares_channel_has_been_destr); + PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_kp_s_this_ares_channel_has_been_destr); + __pyx_t_3 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 325, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 325, __pyx_L1_error) + + /* "gevent/resolver/cares.pyx":324 + * + * cpdef set_servers(self, servers=None): + * if not self.channel: # <<<<<<<<<<<<<< + * raise gaierror(cares.ARES_EDESTRUCTION, 'this ares channel has been destroyed') + * if not servers: + */ + } + + /* "gevent/resolver/cares.pyx":326 + * if not self.channel: + * raise gaierror(cares.ARES_EDESTRUCTION, 'this ares channel has been destroyed') + * if not servers: # <<<<<<<<<<<<<< + * servers = [] + * if isinstance(servers, string_types): + */ + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_servers); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 326, __pyx_L1_error) + __pyx_t_8 = ((!__pyx_t_5) != 0); + if (__pyx_t_8) { + + /* "gevent/resolver/cares.pyx":327 + * raise gaierror(cares.ARES_EDESTRUCTION, 'this ares channel has been destroyed') + * if not servers: + * servers = [] # <<<<<<<<<<<<<< + * if isinstance(servers, string_types): + * servers = servers.split(',') + */ + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 327, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF_SET(__pyx_v_servers, __pyx_t_1); + __pyx_t_1 = 0; + + /* "gevent/resolver/cares.pyx":326 + * if not self.channel: + * raise gaierror(cares.ARES_EDESTRUCTION, 'this ares channel has been destroyed') + * if not servers: # <<<<<<<<<<<<<< + * servers = [] + * if isinstance(servers, string_types): + */ + } + + /* "gevent/resolver/cares.pyx":328 + * if not servers: + * servers = [] + * if isinstance(servers, string_types): # <<<<<<<<<<<<<< + * servers = servers.split(',') + * cdef int length = len(servers) + */ + __pyx_t_1 = __pyx_v_6gevent_8resolver_5cares_string_types; + __Pyx_INCREF(__pyx_t_1); + __pyx_t_8 = PyObject_IsInstance(__pyx_v_servers, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 328, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_5 = (__pyx_t_8 != 0); + if (__pyx_t_5) { + + /* "gevent/resolver/cares.pyx":329 + * servers = [] + * if isinstance(servers, string_types): + * servers = servers.split(',') # <<<<<<<<<<<<<< + * cdef int length = len(servers) + * cdef int result, index + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_servers, __pyx_n_s_split); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 329, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_7 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_7)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_7); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_7, __pyx_kp_s__2) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_kp_s__2); + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 329, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF_SET(__pyx_v_servers, __pyx_t_1); + __pyx_t_1 = 0; + + /* "gevent/resolver/cares.pyx":328 + * if not servers: + * servers = [] + * if isinstance(servers, string_types): # <<<<<<<<<<<<<< + * servers = servers.split(',') + * cdef int length = len(servers) + */ + } + + /* "gevent/resolver/cares.pyx":330 + * if isinstance(servers, string_types): + * servers = servers.split(',') + * cdef int length = len(servers) # <<<<<<<<<<<<<< + * cdef int result, index + * cdef char* string + */ + __pyx_t_9 = PyObject_Length(__pyx_v_servers); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 330, __pyx_L1_error) + __pyx_v_length = __pyx_t_9; + + /* "gevent/resolver/cares.pyx":334 + * cdef char* string + * cdef cares.ares_addr_node* c_servers + * if length <= 0: # <<<<<<<<<<<<<< + * result = cares.ares_set_servers(self.channel, NULL) + * else: + */ + __pyx_t_5 = ((__pyx_v_length <= 0) != 0); + if (__pyx_t_5) { + + /* "gevent/resolver/cares.pyx":335 + * cdef cares.ares_addr_node* c_servers + * if length <= 0: + * result = cares.ares_set_servers(self.channel, NULL) # <<<<<<<<<<<<<< + * else: + * c_servers = PyMem_Malloc(sizeof(cares.ares_addr_node) * length) + */ + __pyx_v_result = ares_set_servers(__pyx_v_self->channel, NULL); + + /* "gevent/resolver/cares.pyx":334 + * cdef char* string + * cdef cares.ares_addr_node* c_servers + * if length <= 0: # <<<<<<<<<<<<<< + * result = cares.ares_set_servers(self.channel, NULL) + * else: + */ + goto __pyx_L6; + } + + /* "gevent/resolver/cares.pyx":337 + * result = cares.ares_set_servers(self.channel, NULL) + * else: + * c_servers = PyMem_Malloc(sizeof(cares.ares_addr_node) * length) # <<<<<<<<<<<<<< + * if not c_servers: + * raise MemoryError + */ + /*else*/ { + __pyx_v_c_servers = ((struct ares_addr_node *)PyMem_Malloc(((sizeof(struct ares_addr_node)) * __pyx_v_length))); + + /* "gevent/resolver/cares.pyx":338 + * else: + * c_servers = PyMem_Malloc(sizeof(cares.ares_addr_node) * length) + * if not c_servers: # <<<<<<<<<<<<<< + * raise MemoryError + * try: + */ + __pyx_t_5 = ((!(__pyx_v_c_servers != 0)) != 0); + if (unlikely(__pyx_t_5)) { + + /* "gevent/resolver/cares.pyx":339 + * c_servers = PyMem_Malloc(sizeof(cares.ares_addr_node) * length) + * if not c_servers: + * raise MemoryError # <<<<<<<<<<<<<< + * try: + * index = 0 + */ + PyErr_NoMemory(); __PYX_ERR(0, 339, __pyx_L1_error) + + /* "gevent/resolver/cares.pyx":338 + * else: + * c_servers = PyMem_Malloc(sizeof(cares.ares_addr_node) * length) + * if not c_servers: # <<<<<<<<<<<<<< + * raise MemoryError + * try: + */ + } + + /* "gevent/resolver/cares.pyx":340 + * if not c_servers: + * raise MemoryError + * try: # <<<<<<<<<<<<<< + * index = 0 + * for server in servers: + */ + /*try:*/ { + + /* "gevent/resolver/cares.pyx":341 + * raise MemoryError + * try: + * index = 0 # <<<<<<<<<<<<<< + * for server in servers: + * if isinstance(server, unicode): + */ + __pyx_v_index = 0; + + /* "gevent/resolver/cares.pyx":342 + * try: + * index = 0 + * for server in servers: # <<<<<<<<<<<<<< + * if isinstance(server, unicode): + * server = server.encode('ascii') + */ + if (likely(PyList_CheckExact(__pyx_v_servers)) || PyTuple_CheckExact(__pyx_v_servers)) { + __pyx_t_1 = __pyx_v_servers; __Pyx_INCREF(__pyx_t_1); __pyx_t_9 = 0; + __pyx_t_10 = NULL; + } else { + __pyx_t_9 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_servers); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 342, __pyx_L9_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_10 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 342, __pyx_L9_error) + } + for (;;) { + if (likely(!__pyx_t_10)) { + if (likely(PyList_CheckExact(__pyx_t_1))) { + if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_9); __Pyx_INCREF(__pyx_t_2); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 342, __pyx_L9_error) + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 342, __pyx_L9_error) + __Pyx_GOTREF(__pyx_t_2); + #endif + } else { + if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_1)) break; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_9); __Pyx_INCREF(__pyx_t_2); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 342, __pyx_L9_error) + #else + __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 342, __pyx_L9_error) + __Pyx_GOTREF(__pyx_t_2); + #endif + } + } else { + __pyx_t_2 = __pyx_t_10(__pyx_t_1); + if (unlikely(!__pyx_t_2)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(0, 342, __pyx_L9_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_2); + } + __Pyx_XDECREF_SET(__pyx_v_server, __pyx_t_2); + __pyx_t_2 = 0; + + /* "gevent/resolver/cares.pyx":343 + * index = 0 + * for server in servers: + * if isinstance(server, unicode): # <<<<<<<<<<<<<< + * server = server.encode('ascii') + * string = server + */ + __pyx_t_5 = PyUnicode_Check(__pyx_v_server); + __pyx_t_8 = (__pyx_t_5 != 0); + if (__pyx_t_8) { + + /* "gevent/resolver/cares.pyx":344 + * for server in servers: + * if isinstance(server, unicode): + * server = server.encode('ascii') # <<<<<<<<<<<<<< + * string = server + * if cares.ares_inet_pton(AF_INET, string, &c_servers[index].addr) > 0: + */ + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_server, __pyx_n_s_encode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 344, __pyx_L9_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_7); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_7, function); + } + } + __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_3, __pyx_n_s_ascii) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_n_s_ascii); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 344, __pyx_L9_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF_SET(__pyx_v_server, __pyx_t_2); + __pyx_t_2 = 0; + + /* "gevent/resolver/cares.pyx":343 + * index = 0 + * for server in servers: + * if isinstance(server, unicode): # <<<<<<<<<<<<<< + * server = server.encode('ascii') + * string = server + */ + } + + /* "gevent/resolver/cares.pyx":345 + * if isinstance(server, unicode): + * server = server.encode('ascii') + * string = server # <<<<<<<<<<<<<< + * if cares.ares_inet_pton(AF_INET, string, &c_servers[index].addr) > 0: + * c_servers[index].family = AF_INET + */ + __pyx_t_11 = __Pyx_PyObject_AsWritableString(__pyx_v_server); if (unlikely((!__pyx_t_11) && PyErr_Occurred())) __PYX_ERR(0, 345, __pyx_L9_error) + __pyx_v_string = ((char *)__pyx_t_11); + + /* "gevent/resolver/cares.pyx":346 + * server = server.encode('ascii') + * string = server + * if cares.ares_inet_pton(AF_INET, string, &c_servers[index].addr) > 0: # <<<<<<<<<<<<<< + * c_servers[index].family = AF_INET + * elif cares.ares_inet_pton(AF_INET6, string, &c_servers[index].addr) > 0: + */ + __pyx_t_8 = ((ares_inet_pton(AF_INET, __pyx_v_string, (&(__pyx_v_c_servers[__pyx_v_index]).addr)) > 0) != 0); + if (__pyx_t_8) { + + /* "gevent/resolver/cares.pyx":347 + * string = server + * if cares.ares_inet_pton(AF_INET, string, &c_servers[index].addr) > 0: + * c_servers[index].family = AF_INET # <<<<<<<<<<<<<< + * elif cares.ares_inet_pton(AF_INET6, string, &c_servers[index].addr) > 0: + * c_servers[index].family = AF_INET6 + */ + (__pyx_v_c_servers[__pyx_v_index]).family = AF_INET; + + /* "gevent/resolver/cares.pyx":346 + * server = server.encode('ascii') + * string = server + * if cares.ares_inet_pton(AF_INET, string, &c_servers[index].addr) > 0: # <<<<<<<<<<<<<< + * c_servers[index].family = AF_INET + * elif cares.ares_inet_pton(AF_INET6, string, &c_servers[index].addr) > 0: + */ + goto __pyx_L14; + } + + /* "gevent/resolver/cares.pyx":348 + * if cares.ares_inet_pton(AF_INET, string, &c_servers[index].addr) > 0: + * c_servers[index].family = AF_INET + * elif cares.ares_inet_pton(AF_INET6, string, &c_servers[index].addr) > 0: # <<<<<<<<<<<<<< + * c_servers[index].family = AF_INET6 + * else: + */ + __pyx_t_8 = ((ares_inet_pton(AF_INET6, __pyx_v_string, (&(__pyx_v_c_servers[__pyx_v_index]).addr)) > 0) != 0); + if (likely(__pyx_t_8)) { + + /* "gevent/resolver/cares.pyx":349 + * c_servers[index].family = AF_INET + * elif cares.ares_inet_pton(AF_INET6, string, &c_servers[index].addr) > 0: + * c_servers[index].family = AF_INET6 # <<<<<<<<<<<<<< + * else: + * raise InvalidIP(repr(string)) + */ + (__pyx_v_c_servers[__pyx_v_index]).family = AF_INET6; + + /* "gevent/resolver/cares.pyx":348 + * if cares.ares_inet_pton(AF_INET, string, &c_servers[index].addr) > 0: + * c_servers[index].family = AF_INET + * elif cares.ares_inet_pton(AF_INET6, string, &c_servers[index].addr) > 0: # <<<<<<<<<<<<<< + * c_servers[index].family = AF_INET6 + * else: + */ + goto __pyx_L14; + } + + /* "gevent/resolver/cares.pyx":351 + * c_servers[index].family = AF_INET6 + * else: + * raise InvalidIP(repr(string)) # <<<<<<<<<<<<<< + * c_servers[index].next = &c_servers[index] + 1 + * index += 1 + */ + /*else*/ { + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_InvalidIP); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 351, __pyx_L9_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_string); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 351, __pyx_L9_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_Repr(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 351, __pyx_L9_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_7); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_7, function); + } + } + __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_4); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 351, __pyx_L9_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 351, __pyx_L9_error) + } + __pyx_L14:; + + /* "gevent/resolver/cares.pyx":352 + * else: + * raise InvalidIP(repr(string)) + * c_servers[index].next = &c_servers[index] + 1 # <<<<<<<<<<<<<< + * index += 1 + * if index >= length: + */ + (__pyx_v_c_servers[__pyx_v_index]).next = ((&(__pyx_v_c_servers[__pyx_v_index])) + 1); + + /* "gevent/resolver/cares.pyx":353 + * raise InvalidIP(repr(string)) + * c_servers[index].next = &c_servers[index] + 1 + * index += 1 # <<<<<<<<<<<<<< + * if index >= length: + * break + */ + __pyx_v_index = (__pyx_v_index + 1); + + /* "gevent/resolver/cares.pyx":354 + * c_servers[index].next = &c_servers[index] + 1 + * index += 1 + * if index >= length: # <<<<<<<<<<<<<< + * break + * c_servers[length - 1].next = NULL + */ + __pyx_t_8 = ((__pyx_v_index >= __pyx_v_length) != 0); + if (__pyx_t_8) { + + /* "gevent/resolver/cares.pyx":355 + * index += 1 + * if index >= length: + * break # <<<<<<<<<<<<<< + * c_servers[length - 1].next = NULL + * index = cares.ares_set_servers(self.channel, c_servers) + */ + goto __pyx_L12_break; + + /* "gevent/resolver/cares.pyx":354 + * c_servers[index].next = &c_servers[index] + 1 + * index += 1 + * if index >= length: # <<<<<<<<<<<<<< + * break + * c_servers[length - 1].next = NULL + */ + } + + /* "gevent/resolver/cares.pyx":342 + * try: + * index = 0 + * for server in servers: # <<<<<<<<<<<<<< + * if isinstance(server, unicode): + * server = server.encode('ascii') + */ + } + __pyx_L12_break:; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "gevent/resolver/cares.pyx":356 + * if index >= length: + * break + * c_servers[length - 1].next = NULL # <<<<<<<<<<<<<< + * index = cares.ares_set_servers(self.channel, c_servers) + * if index: + */ + (__pyx_v_c_servers[(__pyx_v_length - 1)]).next = NULL; + + /* "gevent/resolver/cares.pyx":357 + * break + * c_servers[length - 1].next = NULL + * index = cares.ares_set_servers(self.channel, c_servers) # <<<<<<<<<<<<<< + * if index: + * raise ValueError(strerror(index)) + */ + __pyx_v_index = ares_set_servers(__pyx_v_self->channel, __pyx_v_c_servers); + + /* "gevent/resolver/cares.pyx":358 + * c_servers[length - 1].next = NULL + * index = cares.ares_set_servers(self.channel, c_servers) + * if index: # <<<<<<<<<<<<<< + * raise ValueError(strerror(index)) + * finally: + */ + __pyx_t_8 = (__pyx_v_index != 0); + if (unlikely(__pyx_t_8)) { + + /* "gevent/resolver/cares.pyx":359 + * index = cares.ares_set_servers(self.channel, c_servers) + * if index: + * raise ValueError(strerror(index)) # <<<<<<<<<<<<<< + * finally: + * PyMem_Free(c_servers) + */ + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 359, __pyx_L9_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __pyx_f_6gevent_8resolver_5cares_strerror(__pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 359, __pyx_L9_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 359, __pyx_L9_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 359, __pyx_L9_error) + + /* "gevent/resolver/cares.pyx":358 + * c_servers[length - 1].next = NULL + * index = cares.ares_set_servers(self.channel, c_servers) + * if index: # <<<<<<<<<<<<<< + * raise ValueError(strerror(index)) + * finally: + */ + } + } + + /* "gevent/resolver/cares.pyx":361 + * raise ValueError(strerror(index)) + * finally: + * PyMem_Free(c_servers) # <<<<<<<<<<<<<< + * + * # this crashes c-ares + */ + /*finally:*/ { + /*normal exit:*/{ + PyMem_Free(__pyx_v_c_servers); + goto __pyx_L10; + } + __pyx_L9_error:; + /*exception exit:*/{ + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19); + if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_14, &__pyx_t_15, &__pyx_t_16) < 0)) __Pyx_ErrFetch(&__pyx_t_14, &__pyx_t_15, &__pyx_t_16); + __Pyx_XGOTREF(__pyx_t_14); + __Pyx_XGOTREF(__pyx_t_15); + __Pyx_XGOTREF(__pyx_t_16); + __Pyx_XGOTREF(__pyx_t_17); + __Pyx_XGOTREF(__pyx_t_18); + __Pyx_XGOTREF(__pyx_t_19); + __pyx_t_6 = __pyx_lineno; __pyx_t_12 = __pyx_clineno; __pyx_t_13 = __pyx_filename; + { + PyMem_Free(__pyx_v_c_servers); + } + if (PY_MAJOR_VERSION >= 3) { + __Pyx_XGIVEREF(__pyx_t_17); + __Pyx_XGIVEREF(__pyx_t_18); + __Pyx_XGIVEREF(__pyx_t_19); + __Pyx_ExceptionReset(__pyx_t_17, __pyx_t_18, __pyx_t_19); + } + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_XGIVEREF(__pyx_t_15); + __Pyx_XGIVEREF(__pyx_t_16); + __Pyx_ErrRestore(__pyx_t_14, __pyx_t_15, __pyx_t_16); + __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; + __pyx_lineno = __pyx_t_6; __pyx_clineno = __pyx_t_12; __pyx_filename = __pyx_t_13; + goto __pyx_L1_error; + } + __pyx_L10:; + } + } + __pyx_L6:; + + /* "gevent/resolver/cares.pyx":323 + * self.channel = NULL + * + * cpdef set_servers(self, servers=None): # <<<<<<<<<<<<<< + * if not self.channel: + * raise gaierror(cares.ARES_EDESTRUCTION, 'this ares channel has been destroyed') + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("gevent.resolver.cares.channel.set_servers", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_server); + __Pyx_XDECREF(__pyx_v_servers); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_9set_servers(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_9set_servers(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_servers = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("set_servers (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_servers,0}; + PyObject* values[1] = {0}; + values[0] = ((PyObject *)Py_None); + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_servers); + if (value) { values[0] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_servers") < 0)) __PYX_ERR(0, 323, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_servers = values[0]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("set_servers", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 323, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.resolver.cares.channel.set_servers", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_8resolver_5cares_7channel_8set_servers(((struct __pyx_obj_6gevent_8resolver_5cares_channel *)__pyx_v_self), __pyx_v_servers); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_8resolver_5cares_7channel_8set_servers(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self, PyObject *__pyx_v_servers) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + struct __pyx_opt_args_6gevent_8resolver_5cares_7channel_set_servers __pyx_t_2; + __Pyx_RefNannySetupContext("set_servers", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_2.__pyx_n = 1; + __pyx_t_2.servers = __pyx_v_servers; + __pyx_t_1 = __pyx_vtabptr_6gevent_8resolver_5cares_channel->set_servers(__pyx_v_self, 1, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 323, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.resolver.cares.channel.set_servers", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/resolver/cares.pyx":367 + * # cares.ares_cancel(self.channel) + * + * cdef _sock_state_callback(self, int socket, int read, int write): # <<<<<<<<<<<<<< + * if not self.channel: + * return + */ + +static PyObject *__pyx_f_6gevent_8resolver_5cares_7channel__sock_state_callback(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self, int __pyx_v_socket, int __pyx_v_read, int __pyx_v_write) { + PyObject *__pyx_v_watcher = 0; + int __pyx_v_events; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + __Pyx_RefNannySetupContext("_sock_state_callback", 0); + + /* "gevent/resolver/cares.pyx":368 + * + * cdef _sock_state_callback(self, int socket, int read, int write): + * if not self.channel: # <<<<<<<<<<<<<< + * return + * cdef object watcher = self._watchers.get(socket) + */ + __pyx_t_1 = ((!(__pyx_v_self->channel != 0)) != 0); + if (__pyx_t_1) { + + /* "gevent/resolver/cares.pyx":369 + * cdef _sock_state_callback(self, int socket, int read, int write): + * if not self.channel: + * return # <<<<<<<<<<<<<< + * cdef object watcher = self._watchers.get(socket) + * cdef int events = 0 + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + + /* "gevent/resolver/cares.pyx":368 + * + * cdef _sock_state_callback(self, int socket, int read, int write): + * if not self.channel: # <<<<<<<<<<<<<< + * return + * cdef object watcher = self._watchers.get(socket) + */ + } + + /* "gevent/resolver/cares.pyx":370 + * if not self.channel: + * return + * cdef object watcher = self._watchers.get(socket) # <<<<<<<<<<<<<< + * cdef int events = 0 + * if read: + */ + if (unlikely(__pyx_v_self->_watchers == Py_None)) { + PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get"); + __PYX_ERR(0, 370, __pyx_L1_error) + } + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_socket); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 370, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyDict_GetItemDefault(__pyx_v_self->_watchers, __pyx_t_2, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 370, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_watcher = __pyx_t_3; + __pyx_t_3 = 0; + + /* "gevent/resolver/cares.pyx":371 + * return + * cdef object watcher = self._watchers.get(socket) + * cdef int events = 0 # <<<<<<<<<<<<<< + * if read: + * events |= EV_READ + */ + __pyx_v_events = 0; + + /* "gevent/resolver/cares.pyx":372 + * cdef object watcher = self._watchers.get(socket) + * cdef int events = 0 + * if read: # <<<<<<<<<<<<<< + * events |= EV_READ + * if write: + */ + __pyx_t_1 = (__pyx_v_read != 0); + if (__pyx_t_1) { + + /* "gevent/resolver/cares.pyx":373 + * cdef int events = 0 + * if read: + * events |= EV_READ # <<<<<<<<<<<<<< + * if write: + * events |= EV_WRITE + */ + __pyx_v_events = (__pyx_v_events | 1); + + /* "gevent/resolver/cares.pyx":372 + * cdef object watcher = self._watchers.get(socket) + * cdef int events = 0 + * if read: # <<<<<<<<<<<<<< + * events |= EV_READ + * if write: + */ + } + + /* "gevent/resolver/cares.pyx":374 + * if read: + * events |= EV_READ + * if write: # <<<<<<<<<<<<<< + * events |= EV_WRITE + * if watcher is None: + */ + __pyx_t_1 = (__pyx_v_write != 0); + if (__pyx_t_1) { + + /* "gevent/resolver/cares.pyx":375 + * events |= EV_READ + * if write: + * events |= EV_WRITE # <<<<<<<<<<<<<< + * if watcher is None: + * if not events: + */ + __pyx_v_events = (__pyx_v_events | 2); + + /* "gevent/resolver/cares.pyx":374 + * if read: + * events |= EV_READ + * if write: # <<<<<<<<<<<<<< + * events |= EV_WRITE + * if watcher is None: + */ + } + + /* "gevent/resolver/cares.pyx":376 + * if write: + * events |= EV_WRITE + * if watcher is None: # <<<<<<<<<<<<<< + * if not events: + * return + */ + __pyx_t_1 = (__pyx_v_watcher == Py_None); + __pyx_t_4 = (__pyx_t_1 != 0); + if (__pyx_t_4) { + + /* "gevent/resolver/cares.pyx":377 + * events |= EV_WRITE + * if watcher is None: + * if not events: # <<<<<<<<<<<<<< + * return + * watcher = self.loop.io(socket, events) + */ + __pyx_t_4 = ((!(__pyx_v_events != 0)) != 0); + if (__pyx_t_4) { + + /* "gevent/resolver/cares.pyx":378 + * if watcher is None: + * if not events: + * return # <<<<<<<<<<<<<< + * watcher = self.loop.io(socket, events) + * self._watchers[socket] = watcher + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + + /* "gevent/resolver/cares.pyx":377 + * events |= EV_WRITE + * if watcher is None: + * if not events: # <<<<<<<<<<<<<< + * return + * watcher = self.loop.io(socket, events) + */ + } + + /* "gevent/resolver/cares.pyx":379 + * if not events: + * return + * watcher = self.loop.io(socket, events) # <<<<<<<<<<<<<< + * self._watchers[socket] = watcher + * elif events: + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->loop, __pyx_n_s_io); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 379, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_socket); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 379, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_events); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 379, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = NULL; + __pyx_t_8 = 0; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_7)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_7); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_8 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_5, __pyx_t_6}; + __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 379, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_5, __pyx_t_6}; + __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 379, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } else + #endif + { + __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 379, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + if (__pyx_t_7) { + __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL; + } + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_t_6); + __pyx_t_5 = 0; + __pyx_t_6 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 379, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF_SET(__pyx_v_watcher, __pyx_t_3); + __pyx_t_3 = 0; + + /* "gevent/resolver/cares.pyx":380 + * return + * watcher = self.loop.io(socket, events) + * self._watchers[socket] = watcher # <<<<<<<<<<<<<< + * elif events: + * if watcher.events == events: + */ + if (unlikely(__pyx_v_self->_watchers == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 380, __pyx_L1_error) + } + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_socket); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 380, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (unlikely(PyDict_SetItem(__pyx_v_self->_watchers, __pyx_t_3, __pyx_v_watcher) < 0)) __PYX_ERR(0, 380, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "gevent/resolver/cares.pyx":376 + * if write: + * events |= EV_WRITE + * if watcher is None: # <<<<<<<<<<<<<< + * if not events: + * return + */ + goto __pyx_L6; + } + + /* "gevent/resolver/cares.pyx":381 + * watcher = self.loop.io(socket, events) + * self._watchers[socket] = watcher + * elif events: # <<<<<<<<<<<<<< + * if watcher.events == events: + * return + */ + __pyx_t_4 = (__pyx_v_events != 0); + if (__pyx_t_4) { + + /* "gevent/resolver/cares.pyx":382 + * self._watchers[socket] = watcher + * elif events: + * if watcher.events == events: # <<<<<<<<<<<<<< + * return + * watcher.stop() + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_watcher, __pyx_n_s_events); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 382, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_events); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 382, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_9 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 382, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 382, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (__pyx_t_4) { + + /* "gevent/resolver/cares.pyx":383 + * elif events: + * if watcher.events == events: + * return # <<<<<<<<<<<<<< + * watcher.stop() + * watcher.events = events + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + + /* "gevent/resolver/cares.pyx":382 + * self._watchers[socket] = watcher + * elif events: + * if watcher.events == events: # <<<<<<<<<<<<<< + * return + * watcher.stop() + */ + } + + /* "gevent/resolver/cares.pyx":384 + * if watcher.events == events: + * return + * watcher.stop() # <<<<<<<<<<<<<< + * watcher.events = events + * else: + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_watcher, __pyx_n_s_stop); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 384, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_9 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 384, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "gevent/resolver/cares.pyx":385 + * return + * watcher.stop() + * watcher.events = events # <<<<<<<<<<<<<< + * else: + * watcher.stop() + */ + __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_events); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 385, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + if (__Pyx_PyObject_SetAttrStr(__pyx_v_watcher, __pyx_n_s_events, __pyx_t_9) < 0) __PYX_ERR(0, 385, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "gevent/resolver/cares.pyx":381 + * watcher = self.loop.io(socket, events) + * self._watchers[socket] = watcher + * elif events: # <<<<<<<<<<<<<< + * if watcher.events == events: + * return + */ + goto __pyx_L6; + } + + /* "gevent/resolver/cares.pyx":387 + * watcher.events = events + * else: + * watcher.stop() # <<<<<<<<<<<<<< + * watcher.close() + * self._watchers.pop(socket, None) + */ + /*else*/ { + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_watcher, __pyx_n_s_stop); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 387, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_9 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 387, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "gevent/resolver/cares.pyx":388 + * else: + * watcher.stop() + * watcher.close() # <<<<<<<<<<<<<< + * self._watchers.pop(socket, None) + * if not self._watchers: + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_watcher, __pyx_n_s_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 388, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_9 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 388, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "gevent/resolver/cares.pyx":389 + * watcher.stop() + * watcher.close() + * self._watchers.pop(socket, None) # <<<<<<<<<<<<<< + * if not self._watchers: + * self._timer.stop() + */ + if (unlikely(__pyx_v_self->_watchers == Py_None)) { + PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "pop"); + __PYX_ERR(0, 389, __pyx_L1_error) + } + __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_socket); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 389, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_2 = __Pyx_PyDict_Pop(__pyx_v_self->_watchers, __pyx_t_9, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 389, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "gevent/resolver/cares.pyx":390 + * watcher.close() + * self._watchers.pop(socket, None) + * if not self._watchers: # <<<<<<<<<<<<<< + * self._timer.stop() + * return + */ + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_self->_watchers); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 390, __pyx_L1_error) + __pyx_t_1 = ((!__pyx_t_4) != 0); + if (__pyx_t_1) { + + /* "gevent/resolver/cares.pyx":391 + * self._watchers.pop(socket, None) + * if not self._watchers: + * self._timer.stop() # <<<<<<<<<<<<<< + * return + * watcher.start(self._process_fd, watcher, pass_events=True) + */ + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_timer, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 391, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_9, function); + } + } + __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 391, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "gevent/resolver/cares.pyx":390 + * watcher.close() + * self._watchers.pop(socket, None) + * if not self._watchers: # <<<<<<<<<<<<<< + * self._timer.stop() + * return + */ + } + + /* "gevent/resolver/cares.pyx":392 + * if not self._watchers: + * self._timer.stop() + * return # <<<<<<<<<<<<<< + * watcher.start(self._process_fd, watcher, pass_events=True) + * self._timer.again(self._on_timer) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + } + __pyx_L6:; + + /* "gevent/resolver/cares.pyx":393 + * self._timer.stop() + * return + * watcher.start(self._process_fd, watcher, pass_events=True) # <<<<<<<<<<<<<< + * self._timer.again(self._on_timer) + * + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_watcher, __pyx_n_s_start); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 393, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_process_fd); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 393, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 393, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_9); + __Pyx_INCREF(__pyx_v_watcher); + __Pyx_GIVEREF(__pyx_v_watcher); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_watcher); + __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 393, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_pass_events, Py_True) < 0) __PYX_ERR(0, 393, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_9); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 393, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "gevent/resolver/cares.pyx":394 + * return + * watcher.start(self._process_fd, watcher, pass_events=True) + * self._timer.again(self._on_timer) # <<<<<<<<<<<<<< + * + * def _on_timer(self): + */ + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_timer, __pyx_n_s_again); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 394, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_on_timer); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 394, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) { + __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_9); + if (likely(__pyx_t_2)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_9, function); + } + } + __pyx_t_6 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_3); + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 394, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "gevent/resolver/cares.pyx":367 + * # cares.ares_cancel(self.channel) + * + * cdef _sock_state_callback(self, int socket, int read, int write): # <<<<<<<<<<<<<< + * if not self.channel: + * return + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_AddTraceback("gevent.resolver.cares.channel._sock_state_callback", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_watcher); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/resolver/cares.pyx":396 + * self._timer.again(self._on_timer) + * + * def _on_timer(self): # <<<<<<<<<<<<<< + * cares.ares_process_fd(self.channel, cares.ARES_SOCKET_BAD, cares.ARES_SOCKET_BAD) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_11_on_timer(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_11_on_timer(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_on_timer (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_8resolver_5cares_7channel_10_on_timer(((struct __pyx_obj_6gevent_8resolver_5cares_channel *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_8resolver_5cares_7channel_10_on_timer(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_on_timer", 0); + + /* "gevent/resolver/cares.pyx":397 + * + * def _on_timer(self): + * cares.ares_process_fd(self.channel, cares.ARES_SOCKET_BAD, cares.ARES_SOCKET_BAD) # <<<<<<<<<<<<<< + * + * def _process_fd(self, int events, object watcher): + */ + ares_process_fd(__pyx_v_self->channel, ARES_SOCKET_BAD, ARES_SOCKET_BAD); + + /* "gevent/resolver/cares.pyx":396 + * self._timer.again(self._on_timer) + * + * def _on_timer(self): # <<<<<<<<<<<<<< + * cares.ares_process_fd(self.channel, cares.ARES_SOCKET_BAD, cares.ARES_SOCKET_BAD) + * + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/resolver/cares.pyx":399 + * cares.ares_process_fd(self.channel, cares.ARES_SOCKET_BAD, cares.ARES_SOCKET_BAD) + * + * def _process_fd(self, int events, object watcher): # <<<<<<<<<<<<<< + * if not self.channel: + * return + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_13_process_fd(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_13_process_fd(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + int __pyx_v_events; + PyObject *__pyx_v_watcher = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_process_fd (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_events,&__pyx_n_s_watcher,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_events)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_watcher)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("_process_fd", 1, 2, 2, 1); __PYX_ERR(0, 399, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_process_fd") < 0)) __PYX_ERR(0, 399, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_events = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_events == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 399, __pyx_L3_error) + __pyx_v_watcher = values[1]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("_process_fd", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 399, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.resolver.cares.channel._process_fd", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_8resolver_5cares_7channel_12_process_fd(((struct __pyx_obj_6gevent_8resolver_5cares_channel *)__pyx_v_self), __pyx_v_events, __pyx_v_watcher); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_8resolver_5cares_7channel_12_process_fd(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self, int __pyx_v_events, PyObject *__pyx_v_watcher) { + int __pyx_v_read_fd; + int __pyx_v_write_fd; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + __Pyx_RefNannySetupContext("_process_fd", 0); + + /* "gevent/resolver/cares.pyx":400 + * + * def _process_fd(self, int events, object watcher): + * if not self.channel: # <<<<<<<<<<<<<< + * return + * cdef int read_fd = watcher.fd + */ + __pyx_t_1 = ((!(__pyx_v_self->channel != 0)) != 0); + if (__pyx_t_1) { + + /* "gevent/resolver/cares.pyx":401 + * def _process_fd(self, int events, object watcher): + * if not self.channel: + * return # <<<<<<<<<<<<<< + * cdef int read_fd = watcher.fd + * cdef int write_fd = read_fd + */ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + + /* "gevent/resolver/cares.pyx":400 + * + * def _process_fd(self, int events, object watcher): + * if not self.channel: # <<<<<<<<<<<<<< + * return + * cdef int read_fd = watcher.fd + */ + } + + /* "gevent/resolver/cares.pyx":402 + * if not self.channel: + * return + * cdef int read_fd = watcher.fd # <<<<<<<<<<<<<< + * cdef int write_fd = read_fd + * if not (events & EV_READ): + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_watcher, __pyx_n_s_fd); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 402, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 402, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_read_fd = __pyx_t_3; + + /* "gevent/resolver/cares.pyx":403 + * return + * cdef int read_fd = watcher.fd + * cdef int write_fd = read_fd # <<<<<<<<<<<<<< + * if not (events & EV_READ): + * read_fd = cares.ARES_SOCKET_BAD + */ + __pyx_v_write_fd = __pyx_v_read_fd; + + /* "gevent/resolver/cares.pyx":404 + * cdef int read_fd = watcher.fd + * cdef int write_fd = read_fd + * if not (events & EV_READ): # <<<<<<<<<<<<<< + * read_fd = cares.ARES_SOCKET_BAD + * if not (events & EV_WRITE): + */ + __pyx_t_1 = ((!((__pyx_v_events & 1) != 0)) != 0); + if (__pyx_t_1) { + + /* "gevent/resolver/cares.pyx":405 + * cdef int write_fd = read_fd + * if not (events & EV_READ): + * read_fd = cares.ARES_SOCKET_BAD # <<<<<<<<<<<<<< + * if not (events & EV_WRITE): + * write_fd = cares.ARES_SOCKET_BAD + */ + __pyx_v_read_fd = ARES_SOCKET_BAD; + + /* "gevent/resolver/cares.pyx":404 + * cdef int read_fd = watcher.fd + * cdef int write_fd = read_fd + * if not (events & EV_READ): # <<<<<<<<<<<<<< + * read_fd = cares.ARES_SOCKET_BAD + * if not (events & EV_WRITE): + */ + } + + /* "gevent/resolver/cares.pyx":406 + * if not (events & EV_READ): + * read_fd = cares.ARES_SOCKET_BAD + * if not (events & EV_WRITE): # <<<<<<<<<<<<<< + * write_fd = cares.ARES_SOCKET_BAD + * cares.ares_process_fd(self.channel, read_fd, write_fd) + */ + __pyx_t_1 = ((!((__pyx_v_events & 2) != 0)) != 0); + if (__pyx_t_1) { + + /* "gevent/resolver/cares.pyx":407 + * read_fd = cares.ARES_SOCKET_BAD + * if not (events & EV_WRITE): + * write_fd = cares.ARES_SOCKET_BAD # <<<<<<<<<<<<<< + * cares.ares_process_fd(self.channel, read_fd, write_fd) + * + */ + __pyx_v_write_fd = ARES_SOCKET_BAD; + + /* "gevent/resolver/cares.pyx":406 + * if not (events & EV_READ): + * read_fd = cares.ARES_SOCKET_BAD + * if not (events & EV_WRITE): # <<<<<<<<<<<<<< + * write_fd = cares.ARES_SOCKET_BAD + * cares.ares_process_fd(self.channel, read_fd, write_fd) + */ + } + + /* "gevent/resolver/cares.pyx":408 + * if not (events & EV_WRITE): + * write_fd = cares.ARES_SOCKET_BAD + * cares.ares_process_fd(self.channel, read_fd, write_fd) # <<<<<<<<<<<<<< + * + * def gethostbyname(self, object callback, char* name, int family=AF_INET): + */ + ares_process_fd(__pyx_v_self->channel, __pyx_v_read_fd, __pyx_v_write_fd); + + /* "gevent/resolver/cares.pyx":399 + * cares.ares_process_fd(self.channel, cares.ARES_SOCKET_BAD, cares.ARES_SOCKET_BAD) + * + * def _process_fd(self, int events, object watcher): # <<<<<<<<<<<<<< + * if not self.channel: + * return + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("gevent.resolver.cares.channel._process_fd", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/resolver/cares.pyx":410 + * cares.ares_process_fd(self.channel, read_fd, write_fd) + * + * def gethostbyname(self, object callback, char* name, int family=AF_INET): # <<<<<<<<<<<<<< + * if not self.channel: + * raise gaierror(cares.ARES_EDESTRUCTION, 'this ares channel has been destroyed') + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_15gethostbyname(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_15gethostbyname(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_callback = 0; + char *__pyx_v_name; + int __pyx_v_family; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("gethostbyname (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_callback,&__pyx_n_s_name_2,&__pyx_n_s_family,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_callback)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name_2)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("gethostbyname", 0, 2, 3, 1); __PYX_ERR(0, 410, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (kw_args > 0) { + PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_family); + if (value) { values[2] = value; kw_args--; } + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "gethostbyname") < 0)) __PYX_ERR(0, 410, __pyx_L3_error) + } + } else { + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_callback = values[0]; + __pyx_v_name = __Pyx_PyObject_AsWritableString(values[1]); if (unlikely((!__pyx_v_name) && PyErr_Occurred())) __PYX_ERR(0, 410, __pyx_L3_error) + if (values[2]) { + __pyx_v_family = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_family == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 410, __pyx_L3_error) + } else { + __pyx_v_family = __pyx_k__3; + } + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("gethostbyname", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 410, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.resolver.cares.channel.gethostbyname", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_8resolver_5cares_7channel_14gethostbyname(((struct __pyx_obj_6gevent_8resolver_5cares_channel *)__pyx_v_self), __pyx_v_callback, __pyx_v_name, __pyx_v_family); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_8resolver_5cares_7channel_14gethostbyname(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self, PyObject *__pyx_v_callback, char *__pyx_v_name, int __pyx_v_family) { + PyObject *__pyx_v_arg = 0; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + __Pyx_RefNannySetupContext("gethostbyname", 0); + + /* "gevent/resolver/cares.pyx":411 + * + * def gethostbyname(self, object callback, char* name, int family=AF_INET): + * if not self.channel: # <<<<<<<<<<<<<< + * raise gaierror(cares.ARES_EDESTRUCTION, 'this ares channel has been destroyed') + * # note that for file lookups still AF_INET can be returned for AF_INET6 request + */ + __pyx_t_1 = ((!(__pyx_v_self->channel != 0)) != 0); + if (unlikely(__pyx_t_1)) { + + /* "gevent/resolver/cares.pyx":412 + * def gethostbyname(self, object callback, char* name, int family=AF_INET): + * if not self.channel: + * raise gaierror(cares.ARES_EDESTRUCTION, 'this ares channel has been destroyed') # <<<<<<<<<<<<<< + * # note that for file lookups still AF_INET can be returned for AF_INET6 request + * cdef object arg = (self, callback) + */ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_gaierror); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 412, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyInt_From_int(ARES_EDESTRUCTION); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 412, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = NULL; + __pyx_t_6 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_6 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_3)) { + PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_4, __pyx_kp_s_this_ares_channel_has_been_destr}; + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 412, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { + PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_4, __pyx_kp_s_this_ares_channel_has_been_destr}; + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 412, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } else + #endif + { + __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 412, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + if (__pyx_t_5) { + __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL; + } + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_t_4); + __Pyx_INCREF(__pyx_kp_s_this_ares_channel_has_been_destr); + __Pyx_GIVEREF(__pyx_kp_s_this_ares_channel_has_been_destr); + PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_kp_s_this_ares_channel_has_been_destr); + __pyx_t_4 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 412, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 412, __pyx_L1_error) + + /* "gevent/resolver/cares.pyx":411 + * + * def gethostbyname(self, object callback, char* name, int family=AF_INET): + * if not self.channel: # <<<<<<<<<<<<<< + * raise gaierror(cares.ARES_EDESTRUCTION, 'this ares channel has been destroyed') + * # note that for file lookups still AF_INET can be returned for AF_INET6 request + */ + } + + /* "gevent/resolver/cares.pyx":414 + * raise gaierror(cares.ARES_EDESTRUCTION, 'this ares channel has been destroyed') + * # note that for file lookups still AF_INET can be returned for AF_INET6 request + * cdef object arg = (self, callback) # <<<<<<<<<<<<<< + * Py_INCREF(arg) + * cares.ares_gethostbyname(self.channel, name, family, gevent_ares_host_callback, arg) + */ + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 414, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self)); + __Pyx_INCREF(__pyx_v_callback); + __Pyx_GIVEREF(__pyx_v_callback); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_callback); + __pyx_v_arg = __pyx_t_2; + __pyx_t_2 = 0; + + /* "gevent/resolver/cares.pyx":415 + * # note that for file lookups still AF_INET can be returned for AF_INET6 request + * cdef object arg = (self, callback) + * Py_INCREF(arg) # <<<<<<<<<<<<<< + * cares.ares_gethostbyname(self.channel, name, family, gevent_ares_host_callback, arg) + * + */ + Py_INCREF(__pyx_v_arg); + + /* "gevent/resolver/cares.pyx":416 + * cdef object arg = (self, callback) + * Py_INCREF(arg) + * cares.ares_gethostbyname(self.channel, name, family, gevent_ares_host_callback, arg) # <<<<<<<<<<<<<< + * + * def gethostbyaddr(self, object callback, char* addr): + */ + ares_gethostbyname(__pyx_v_self->channel, __pyx_v_name, __pyx_v_family, ((void *)__pyx_f_6gevent_8resolver_5cares_gevent_ares_host_callback), ((void *)__pyx_v_arg)); + + /* "gevent/resolver/cares.pyx":410 + * cares.ares_process_fd(self.channel, read_fd, write_fd) + * + * def gethostbyname(self, object callback, char* name, int family=AF_INET): # <<<<<<<<<<<<<< + * if not self.channel: + * raise gaierror(cares.ARES_EDESTRUCTION, 'this ares channel has been destroyed') + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("gevent.resolver.cares.channel.gethostbyname", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_arg); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/resolver/cares.pyx":418 + * cares.ares_gethostbyname(self.channel, name, family, gevent_ares_host_callback, arg) + * + * def gethostbyaddr(self, object callback, char* addr): # <<<<<<<<<<<<<< + * if not self.channel: + * raise gaierror(cares.ARES_EDESTRUCTION, 'this ares channel has been destroyed') + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_17gethostbyaddr(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_17gethostbyaddr(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_callback = 0; + char *__pyx_v_addr; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("gethostbyaddr (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_callback,&__pyx_n_s_addr,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_callback)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_addr)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("gethostbyaddr", 1, 2, 2, 1); __PYX_ERR(0, 418, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "gethostbyaddr") < 0)) __PYX_ERR(0, 418, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_callback = values[0]; + __pyx_v_addr = __Pyx_PyObject_AsWritableString(values[1]); if (unlikely((!__pyx_v_addr) && PyErr_Occurred())) __PYX_ERR(0, 418, __pyx_L3_error) + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("gethostbyaddr", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 418, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.resolver.cares.channel.gethostbyaddr", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_6gevent_8resolver_5cares_7channel_16gethostbyaddr(((struct __pyx_obj_6gevent_8resolver_5cares_channel *)__pyx_v_self), __pyx_v_callback, __pyx_v_addr); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_8resolver_5cares_7channel_16gethostbyaddr(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self, PyObject *__pyx_v_callback, char *__pyx_v_addr) { + char __pyx_v_addr_packed[16]; + int __pyx_v_family; + int __pyx_v_length; + PyObject *__pyx_v_arg = 0; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + __Pyx_RefNannySetupContext("gethostbyaddr", 0); + + /* "gevent/resolver/cares.pyx":419 + * + * def gethostbyaddr(self, object callback, char* addr): + * if not self.channel: # <<<<<<<<<<<<<< + * raise gaierror(cares.ARES_EDESTRUCTION, 'this ares channel has been destroyed') + * # will guess the family + */ + __pyx_t_1 = ((!(__pyx_v_self->channel != 0)) != 0); + if (unlikely(__pyx_t_1)) { + + /* "gevent/resolver/cares.pyx":420 + * def gethostbyaddr(self, object callback, char* addr): + * if not self.channel: + * raise gaierror(cares.ARES_EDESTRUCTION, 'this ares channel has been destroyed') # <<<<<<<<<<<<<< + * # will guess the family + * cdef char addr_packed[16] + */ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_gaierror); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 420, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyInt_From_int(ARES_EDESTRUCTION); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 420, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = NULL; + __pyx_t_6 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_6 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_3)) { + PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_4, __pyx_kp_s_this_ares_channel_has_been_destr}; + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 420, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { + PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_4, __pyx_kp_s_this_ares_channel_has_been_destr}; + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 420, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } else + #endif + { + __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 420, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + if (__pyx_t_5) { + __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL; + } + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_t_4); + __Pyx_INCREF(__pyx_kp_s_this_ares_channel_has_been_destr); + __Pyx_GIVEREF(__pyx_kp_s_this_ares_channel_has_been_destr); + PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_kp_s_this_ares_channel_has_been_destr); + __pyx_t_4 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 420, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 420, __pyx_L1_error) + + /* "gevent/resolver/cares.pyx":419 + * + * def gethostbyaddr(self, object callback, char* addr): + * if not self.channel: # <<<<<<<<<<<<<< + * raise gaierror(cares.ARES_EDESTRUCTION, 'this ares channel has been destroyed') + * # will guess the family + */ + } + + /* "gevent/resolver/cares.pyx":425 + * cdef int family + * cdef int length + * if cares.ares_inet_pton(AF_INET, addr, addr_packed) > 0: # <<<<<<<<<<<<<< + * family = AF_INET + * length = 4 + */ + __pyx_t_1 = ((ares_inet_pton(AF_INET, __pyx_v_addr, __pyx_v_addr_packed) > 0) != 0); + if (__pyx_t_1) { + + /* "gevent/resolver/cares.pyx":426 + * cdef int length + * if cares.ares_inet_pton(AF_INET, addr, addr_packed) > 0: + * family = AF_INET # <<<<<<<<<<<<<< + * length = 4 + * elif cares.ares_inet_pton(AF_INET6, addr, addr_packed) > 0: + */ + __pyx_v_family = AF_INET; + + /* "gevent/resolver/cares.pyx":427 + * if cares.ares_inet_pton(AF_INET, addr, addr_packed) > 0: + * family = AF_INET + * length = 4 # <<<<<<<<<<<<<< + * elif cares.ares_inet_pton(AF_INET6, addr, addr_packed) > 0: + * family = AF_INET6 + */ + __pyx_v_length = 4; + + /* "gevent/resolver/cares.pyx":425 + * cdef int family + * cdef int length + * if cares.ares_inet_pton(AF_INET, addr, addr_packed) > 0: # <<<<<<<<<<<<<< + * family = AF_INET + * length = 4 + */ + goto __pyx_L4; + } + + /* "gevent/resolver/cares.pyx":428 + * family = AF_INET + * length = 4 + * elif cares.ares_inet_pton(AF_INET6, addr, addr_packed) > 0: # <<<<<<<<<<<<<< + * family = AF_INET6 + * length = 16 + */ + __pyx_t_1 = ((ares_inet_pton(AF_INET6, __pyx_v_addr, __pyx_v_addr_packed) > 0) != 0); + if (likely(__pyx_t_1)) { + + /* "gevent/resolver/cares.pyx":429 + * length = 4 + * elif cares.ares_inet_pton(AF_INET6, addr, addr_packed) > 0: + * family = AF_INET6 # <<<<<<<<<<<<<< + * length = 16 + * else: + */ + __pyx_v_family = AF_INET6; + + /* "gevent/resolver/cares.pyx":430 + * elif cares.ares_inet_pton(AF_INET6, addr, addr_packed) > 0: + * family = AF_INET6 + * length = 16 # <<<<<<<<<<<<<< + * else: + * raise InvalidIP(repr(addr)) + */ + __pyx_v_length = 16; + + /* "gevent/resolver/cares.pyx":428 + * family = AF_INET + * length = 4 + * elif cares.ares_inet_pton(AF_INET6, addr, addr_packed) > 0: # <<<<<<<<<<<<<< + * family = AF_INET6 + * length = 16 + */ + goto __pyx_L4; + } + + /* "gevent/resolver/cares.pyx":432 + * length = 16 + * else: + * raise InvalidIP(repr(addr)) # <<<<<<<<<<<<<< + * cdef object arg = (self, callback) + * Py_INCREF(arg) + */ + /*else*/ { + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_InvalidIP); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 432, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_7 = __Pyx_PyBytes_FromString(__pyx_v_addr); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 432, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_4 = PyObject_Repr(__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 432, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_7)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_7); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + } + } + __pyx_t_2 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_7, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 432, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 432, __pyx_L1_error) + } + __pyx_L4:; + + /* "gevent/resolver/cares.pyx":433 + * else: + * raise InvalidIP(repr(addr)) + * cdef object arg = (self, callback) # <<<<<<<<<<<<<< + * Py_INCREF(arg) + * cares.ares_gethostbyaddr(self.channel, addr_packed, length, family, gevent_ares_host_callback, arg) + */ + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 433, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self)); + __Pyx_INCREF(__pyx_v_callback); + __Pyx_GIVEREF(__pyx_v_callback); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_callback); + __pyx_v_arg = __pyx_t_2; + __pyx_t_2 = 0; + + /* "gevent/resolver/cares.pyx":434 + * raise InvalidIP(repr(addr)) + * cdef object arg = (self, callback) + * Py_INCREF(arg) # <<<<<<<<<<<<<< + * cares.ares_gethostbyaddr(self.channel, addr_packed, length, family, gevent_ares_host_callback, arg) + * + */ + Py_INCREF(__pyx_v_arg); + + /* "gevent/resolver/cares.pyx":435 + * cdef object arg = (self, callback) + * Py_INCREF(arg) + * cares.ares_gethostbyaddr(self.channel, addr_packed, length, family, gevent_ares_host_callback, arg) # <<<<<<<<<<<<<< + * + * cpdef _getnameinfo(self, object callback, tuple sockaddr, int flags): + */ + ares_gethostbyaddr(__pyx_v_self->channel, __pyx_v_addr_packed, __pyx_v_length, __pyx_v_family, ((void *)__pyx_f_6gevent_8resolver_5cares_gevent_ares_host_callback), ((void *)__pyx_v_arg)); + + /* "gevent/resolver/cares.pyx":418 + * cares.ares_gethostbyname(self.channel, name, family, gevent_ares_host_callback, arg) + * + * def gethostbyaddr(self, object callback, char* addr): # <<<<<<<<<<<<<< + * if not self.channel: + * raise gaierror(cares.ARES_EDESTRUCTION, 'this ares channel has been destroyed') + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("gevent.resolver.cares.channel.gethostbyaddr", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_arg); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/resolver/cares.pyx":437 + * cares.ares_gethostbyaddr(self.channel, addr_packed, length, family, gevent_ares_host_callback, arg) + * + * cpdef _getnameinfo(self, object callback, tuple sockaddr, int flags): # <<<<<<<<<<<<<< + * if not self.channel: + * raise gaierror(cares.ARES_EDESTRUCTION, 'this ares channel has been destroyed') + */ + +static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_19_getnameinfo(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_6gevent_8resolver_5cares_7channel__getnameinfo(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self, PyObject *__pyx_v_callback, PyObject *__pyx_v_sockaddr, int __pyx_v_flags, int __pyx_skip_dispatch) { + char *__pyx_v_hostp; + int __pyx_v_port; + int __pyx_v_flowinfo; + int __pyx_v_scope_id; + struct sockaddr_in6 __pyx_v_sa6; + int __pyx_v_length; + PyObject *__pyx_v_arg = 0; + struct sockaddr *__pyx_v_x; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + int __pyx_t_8; + int __pyx_t_9; + __Pyx_RefNannySetupContext("_getnameinfo", 0); + /* Check if called by wrapper */ + if (unlikely(__pyx_skip_dispatch)) ; + /* Check if overridden in Python */ + else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0; + if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self)))))); + else { + PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + #endif + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getnameinfo); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 437, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_8resolver_5cares_7channel_19_getnameinfo)) { + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 437, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_t_1); + __pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL; + __pyx_t_6 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + __pyx_t_6 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_4)) { + PyObject *__pyx_temp[4] = {__pyx_t_5, __pyx_v_callback, __pyx_v_sockaddr, __pyx_t_3}; + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 437, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { + PyObject *__pyx_temp[4] = {__pyx_t_5, __pyx_v_callback, __pyx_v_sockaddr, __pyx_t_3}; + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 437, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } else + #endif + { + __pyx_t_7 = PyTuple_New(3+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 437, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + if (__pyx_t_5) { + __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL; + } + __Pyx_INCREF(__pyx_v_callback); + __Pyx_GIVEREF(__pyx_v_callback); + PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_v_callback); + __Pyx_INCREF(__pyx_v_sockaddr); + __Pyx_GIVEREF(__pyx_v_sockaddr); + PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_sockaddr); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_6, __pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 437, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0; + obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0; + if (unlikely(type_dict_guard != tp_dict_version)) { + tp_dict_version = obj_dict_version = 0; + } + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP + } + #endif + } + + /* "gevent/resolver/cares.pyx":438 + * + * cpdef _getnameinfo(self, object callback, tuple sockaddr, int flags): + * if not self.channel: # <<<<<<<<<<<<<< + * raise gaierror(cares.ARES_EDESTRUCTION, 'this ares channel has been destroyed') + * cdef char* hostp = NULL + */ + __pyx_t_8 = ((!(__pyx_v_self->channel != 0)) != 0); + if (unlikely(__pyx_t_8)) { + + /* "gevent/resolver/cares.pyx":439 + * cpdef _getnameinfo(self, object callback, tuple sockaddr, int flags): + * if not self.channel: + * raise gaierror(cares.ARES_EDESTRUCTION, 'this ares channel has been destroyed') # <<<<<<<<<<<<<< + * cdef char* hostp = NULL + * cdef int port = 0 + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_gaierror); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 439, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyInt_From_int(ARES_EDESTRUCTION); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 439, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_7 = NULL; + __pyx_t_6 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_7)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_7); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_6 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_4, __pyx_kp_s_this_ares_channel_has_been_destr}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 439, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_4, __pyx_kp_s_this_ares_channel_has_been_destr}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 439, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } else + #endif + { + __pyx_t_3 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 439, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (__pyx_t_7) { + __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_7); __pyx_t_7 = NULL; + } + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_6, __pyx_t_4); + __Pyx_INCREF(__pyx_kp_s_this_ares_channel_has_been_destr); + __Pyx_GIVEREF(__pyx_kp_s_this_ares_channel_has_been_destr); + PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_6, __pyx_kp_s_this_ares_channel_has_been_destr); + __pyx_t_4 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 439, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 439, __pyx_L1_error) + + /* "gevent/resolver/cares.pyx":438 + * + * cpdef _getnameinfo(self, object callback, tuple sockaddr, int flags): + * if not self.channel: # <<<<<<<<<<<<<< + * raise gaierror(cares.ARES_EDESTRUCTION, 'this ares channel has been destroyed') + * cdef char* hostp = NULL + */ + } + + /* "gevent/resolver/cares.pyx":440 + * if not self.channel: + * raise gaierror(cares.ARES_EDESTRUCTION, 'this ares channel has been destroyed') + * cdef char* hostp = NULL # <<<<<<<<<<<<<< + * cdef int port = 0 + * cdef int flowinfo = 0 + */ + __pyx_v_hostp = NULL; + + /* "gevent/resolver/cares.pyx":441 + * raise gaierror(cares.ARES_EDESTRUCTION, 'this ares channel has been destroyed') + * cdef char* hostp = NULL + * cdef int port = 0 # <<<<<<<<<<<<<< + * cdef int flowinfo = 0 + * cdef int scope_id = 0 + */ + __pyx_v_port = 0; + + /* "gevent/resolver/cares.pyx":442 + * cdef char* hostp = NULL + * cdef int port = 0 + * cdef int flowinfo = 0 # <<<<<<<<<<<<<< + * cdef int scope_id = 0 + * cdef sockaddr_in6 sa6 + */ + __pyx_v_flowinfo = 0; + + /* "gevent/resolver/cares.pyx":443 + * cdef int port = 0 + * cdef int flowinfo = 0 + * cdef int scope_id = 0 # <<<<<<<<<<<<<< + * cdef sockaddr_in6 sa6 + * if not PyTuple_Check(sockaddr): + */ + __pyx_v_scope_id = 0; + + /* "gevent/resolver/cares.pyx":445 + * cdef int scope_id = 0 + * cdef sockaddr_in6 sa6 + * if not PyTuple_Check(sockaddr): # <<<<<<<<<<<<<< + * raise TypeError('expected a tuple, got %r' % (sockaddr, )) + * PyArg_ParseTuple(sockaddr, "si|ii", &hostp, &port, &flowinfo, &scope_id) + */ + __pyx_t_8 = ((!(PyTuple_Check(__pyx_v_sockaddr) != 0)) != 0); + if (unlikely(__pyx_t_8)) { + + /* "gevent/resolver/cares.pyx":446 + * cdef sockaddr_in6 sa6 + * if not PyTuple_Check(sockaddr): + * raise TypeError('expected a tuple, got %r' % (sockaddr, )) # <<<<<<<<<<<<<< + * PyArg_ParseTuple(sockaddr, "si|ii", &hostp, &port, &flowinfo, &scope_id) + * if port < 0 or port > 65535: + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 446, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_sockaddr); + __Pyx_GIVEREF(__pyx_v_sockaddr); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_sockaddr); + __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_expected_a_tuple_got_r, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 446, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 446, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 446, __pyx_L1_error) + + /* "gevent/resolver/cares.pyx":445 + * cdef int scope_id = 0 + * cdef sockaddr_in6 sa6 + * if not PyTuple_Check(sockaddr): # <<<<<<<<<<<<<< + * raise TypeError('expected a tuple, got %r' % (sockaddr, )) + * PyArg_ParseTuple(sockaddr, "si|ii", &hostp, &port, &flowinfo, &scope_id) + */ + } + + /* "gevent/resolver/cares.pyx":447 + * if not PyTuple_Check(sockaddr): + * raise TypeError('expected a tuple, got %r' % (sockaddr, )) + * PyArg_ParseTuple(sockaddr, "si|ii", &hostp, &port, &flowinfo, &scope_id) # <<<<<<<<<<<<<< + * if port < 0 or port > 65535: + * raise gaierror(-8, 'Invalid value for port: %r' % port) + */ + __pyx_t_6 = PyArg_ParseTuple(__pyx_v_sockaddr, ((char *)"si|ii"), (&__pyx_v_hostp), (&__pyx_v_port), (&__pyx_v_flowinfo), (&__pyx_v_scope_id)); if (unlikely(__pyx_t_6 == ((int)0))) __PYX_ERR(0, 447, __pyx_L1_error) + + /* "gevent/resolver/cares.pyx":448 + * raise TypeError('expected a tuple, got %r' % (sockaddr, )) + * PyArg_ParseTuple(sockaddr, "si|ii", &hostp, &port, &flowinfo, &scope_id) + * if port < 0 or port > 65535: # <<<<<<<<<<<<<< + * raise gaierror(-8, 'Invalid value for port: %r' % port) + * cdef int length = gevent_make_sockaddr(hostp, port, flowinfo, scope_id, &sa6) + */ + __pyx_t_9 = ((__pyx_v_port < 0) != 0); + if (!__pyx_t_9) { + } else { + __pyx_t_8 = __pyx_t_9; + goto __pyx_L6_bool_binop_done; + } + __pyx_t_9 = ((__pyx_v_port > 0xFFFF) != 0); + __pyx_t_8 = __pyx_t_9; + __pyx_L6_bool_binop_done:; + if (unlikely(__pyx_t_8)) { + + /* "gevent/resolver/cares.pyx":449 + * PyArg_ParseTuple(sockaddr, "si|ii", &hostp, &port, &flowinfo, &scope_id) + * if port < 0 or port > 65535: + * raise gaierror(-8, 'Invalid value for port: %r' % port) # <<<<<<<<<<<<<< + * cdef int length = gevent_make_sockaddr(hostp, port, flowinfo, scope_id, &sa6) + * if length <= 0: + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_gaierror); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 449, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_port); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 449, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_value_for_port_r, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 449, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = NULL; + __pyx_t_6 = 0; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_6 = 1; + } + } + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_int_neg_8, __pyx_t_4}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 449, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } else + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { + PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_int_neg_8, __pyx_t_4}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 449, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } else + #endif + { + __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 449, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + if (__pyx_t_3) { + __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3); __pyx_t_3 = NULL; + } + __Pyx_INCREF(__pyx_int_neg_8); + __Pyx_GIVEREF(__pyx_int_neg_8); + PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_int_neg_8); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 449, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 449, __pyx_L1_error) + + /* "gevent/resolver/cares.pyx":448 + * raise TypeError('expected a tuple, got %r' % (sockaddr, )) + * PyArg_ParseTuple(sockaddr, "si|ii", &hostp, &port, &flowinfo, &scope_id) + * if port < 0 or port > 65535: # <<<<<<<<<<<<<< + * raise gaierror(-8, 'Invalid value for port: %r' % port) + * cdef int length = gevent_make_sockaddr(hostp, port, flowinfo, scope_id, &sa6) + */ + } + + /* "gevent/resolver/cares.pyx":450 + * if port < 0 or port > 65535: + * raise gaierror(-8, 'Invalid value for port: %r' % port) + * cdef int length = gevent_make_sockaddr(hostp, port, flowinfo, scope_id, &sa6) # <<<<<<<<<<<<<< + * if length <= 0: + * raise InvalidIP(repr(hostp)) + */ + __pyx_v_length = gevent_make_sockaddr(__pyx_v_hostp, __pyx_v_port, __pyx_v_flowinfo, __pyx_v_scope_id, (&__pyx_v_sa6)); + + /* "gevent/resolver/cares.pyx":451 + * raise gaierror(-8, 'Invalid value for port: %r' % port) + * cdef int length = gevent_make_sockaddr(hostp, port, flowinfo, scope_id, &sa6) + * if length <= 0: # <<<<<<<<<<<<<< + * raise InvalidIP(repr(hostp)) + * cdef object arg = (self, callback) + */ + __pyx_t_8 = ((__pyx_v_length <= 0) != 0); + if (unlikely(__pyx_t_8)) { + + /* "gevent/resolver/cares.pyx":452 + * cdef int length = gevent_make_sockaddr(hostp, port, flowinfo, scope_id, &sa6) + * if length <= 0: + * raise InvalidIP(repr(hostp)) # <<<<<<<<<<<<<< + * cdef object arg = (self, callback) + * Py_INCREF(arg) + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_InvalidIP); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 452, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_7 = __Pyx_PyBytes_FromString(__pyx_v_hostp); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 452, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_4 = PyObject_Repr(__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 452, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_7)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_7); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_7, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 452, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 452, __pyx_L1_error) + + /* "gevent/resolver/cares.pyx":451 + * raise gaierror(-8, 'Invalid value for port: %r' % port) + * cdef int length = gevent_make_sockaddr(hostp, port, flowinfo, scope_id, &sa6) + * if length <= 0: # <<<<<<<<<<<<<< + * raise InvalidIP(repr(hostp)) + * cdef object arg = (self, callback) + */ + } + + /* "gevent/resolver/cares.pyx":453 + * if length <= 0: + * raise InvalidIP(repr(hostp)) + * cdef object arg = (self, callback) # <<<<<<<<<<<<<< + * Py_INCREF(arg) + * cdef sockaddr_t* x = &sa6 + */ + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 453, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_self)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self)); + __Pyx_INCREF(__pyx_v_callback); + __Pyx_GIVEREF(__pyx_v_callback); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_callback); + __pyx_v_arg = __pyx_t_1; + __pyx_t_1 = 0; + + /* "gevent/resolver/cares.pyx":454 + * raise InvalidIP(repr(hostp)) + * cdef object arg = (self, callback) + * Py_INCREF(arg) # <<<<<<<<<<<<<< + * cdef sockaddr_t* x = &sa6 + * cares.ares_getnameinfo(self.channel, x, length, flags, gevent_ares_nameinfo_callback, arg) + */ + Py_INCREF(__pyx_v_arg); + + /* "gevent/resolver/cares.pyx":455 + * cdef object arg = (self, callback) + * Py_INCREF(arg) + * cdef sockaddr_t* x = &sa6 # <<<<<<<<<<<<<< + * cares.ares_getnameinfo(self.channel, x, length, flags, gevent_ares_nameinfo_callback, arg) + * + */ + __pyx_v_x = ((struct sockaddr *)(&__pyx_v_sa6)); + + /* "gevent/resolver/cares.pyx":456 + * Py_INCREF(arg) + * cdef sockaddr_t* x = &sa6 + * cares.ares_getnameinfo(self.channel, x, length, flags, gevent_ares_nameinfo_callback, arg) # <<<<<<<<<<<<<< + * + * def getnameinfo(self, object callback, tuple sockaddr, int flags): + */ + ares_getnameinfo(__pyx_v_self->channel, __pyx_v_x, __pyx_v_length, __pyx_v_flags, ((void *)__pyx_f_6gevent_8resolver_5cares_gevent_ares_nameinfo_callback), ((void *)__pyx_v_arg)); + + /* "gevent/resolver/cares.pyx":437 + * cares.ares_gethostbyaddr(self.channel, addr_packed, length, family, gevent_ares_host_callback, arg) + * + * cpdef _getnameinfo(self, object callback, tuple sockaddr, int flags): # <<<<<<<<<<<<<< + * if not self.channel: + * raise gaierror(cares.ARES_EDESTRUCTION, 'this ares channel has been destroyed') + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("gevent.resolver.cares.channel._getnameinfo", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_arg); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_19_getnameinfo(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_19_getnameinfo(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_callback = 0; + PyObject *__pyx_v_sockaddr = 0; + int __pyx_v_flags; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_getnameinfo (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_callback,&__pyx_n_s_sockaddr,&__pyx_n_s_flags,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_callback)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_sockaddr)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("_getnameinfo", 1, 3, 3, 1); __PYX_ERR(0, 437, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flags)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("_getnameinfo", 1, 3, 3, 2); __PYX_ERR(0, 437, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_getnameinfo") < 0)) __PYX_ERR(0, 437, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + } + __pyx_v_callback = values[0]; + __pyx_v_sockaddr = ((PyObject*)values[1]); + __pyx_v_flags = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 437, __pyx_L3_error) + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("_getnameinfo", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 437, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.resolver.cares.channel._getnameinfo", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sockaddr), (&PyTuple_Type), 1, "sockaddr", 1))) __PYX_ERR(0, 437, __pyx_L1_error) + __pyx_r = __pyx_pf_6gevent_8resolver_5cares_7channel_18_getnameinfo(((struct __pyx_obj_6gevent_8resolver_5cares_channel *)__pyx_v_self), __pyx_v_callback, __pyx_v_sockaddr, __pyx_v_flags); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_8resolver_5cares_7channel_18_getnameinfo(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self, PyObject *__pyx_v_callback, PyObject *__pyx_v_sockaddr, int __pyx_v_flags) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("_getnameinfo", 0); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_6gevent_8resolver_5cares_7channel__getnameinfo(__pyx_v_self, __pyx_v_callback, __pyx_v_sockaddr, __pyx_v_flags, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 437, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.resolver.cares.channel._getnameinfo", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/resolver/cares.pyx":458 + * cares.ares_getnameinfo(self.channel, x, length, flags, gevent_ares_nameinfo_callback, arg) + * + * def getnameinfo(self, object callback, tuple sockaddr, int flags): # <<<<<<<<<<<<<< + * try: + * flags = _convert_cares_flags(flags) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_21getnameinfo(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_21getnameinfo(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_callback = 0; + PyObject *__pyx_v_sockaddr = 0; + int __pyx_v_flags; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("getnameinfo (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_callback,&__pyx_n_s_sockaddr,&__pyx_n_s_flags,0}; + PyObject* values[3] = {0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_callback)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_sockaddr)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("getnameinfo", 1, 3, 3, 1); __PYX_ERR(0, 458, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flags)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("getnameinfo", 1, 3, 3, 2); __PYX_ERR(0, 458, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getnameinfo") < 0)) __PYX_ERR(0, 458, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + } + __pyx_v_callback = values[0]; + __pyx_v_sockaddr = ((PyObject*)values[1]); + __pyx_v_flags = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 458, __pyx_L3_error) + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("getnameinfo", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 458, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("gevent.resolver.cares.channel.getnameinfo", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sockaddr), (&PyTuple_Type), 1, "sockaddr", 1))) __PYX_ERR(0, 458, __pyx_L1_error) + __pyx_r = __pyx_pf_6gevent_8resolver_5cares_7channel_20getnameinfo(((struct __pyx_obj_6gevent_8resolver_5cares_channel *)__pyx_v_self), __pyx_v_callback, __pyx_v_sockaddr, __pyx_v_flags); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_8resolver_5cares_7channel_20getnameinfo(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self, PyObject *__pyx_v_callback, PyObject *__pyx_v_sockaddr, int __pyx_v_flags) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + __Pyx_RefNannySetupContext("getnameinfo", 0); + + /* "gevent/resolver/cares.pyx":459 + * + * def getnameinfo(self, object callback, tuple sockaddr, int flags): + * try: # <<<<<<<<<<<<<< + * flags = _convert_cares_flags(flags) + * except gaierror: + */ + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "gevent/resolver/cares.pyx":460 + * def getnameinfo(self, object callback, tuple sockaddr, int flags): + * try: + * flags = _convert_cares_flags(flags) # <<<<<<<<<<<<<< + * except gaierror: + * # The stdlib just ignores bad flags + */ + __pyx_t_4 = __pyx_f_6gevent_8resolver_5cares__convert_cares_flags(__pyx_v_flags, 0, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 460, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 460, __pyx_L3_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_flags = __pyx_t_5; + + /* "gevent/resolver/cares.pyx":459 + * + * def getnameinfo(self, object callback, tuple sockaddr, int flags): + * try: # <<<<<<<<<<<<<< + * flags = _convert_cares_flags(flags) + * except gaierror: + */ + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L8_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "gevent/resolver/cares.pyx":461 + * try: + * flags = _convert_cares_flags(flags) + * except gaierror: # <<<<<<<<<<<<<< + * # The stdlib just ignores bad flags + * flags = 0 + */ + __Pyx_ErrFetch(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7); + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_gaierror); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 461, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_5 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_4, __pyx_t_8); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_ErrRestore(__pyx_t_4, __pyx_t_6, __pyx_t_7); + __pyx_t_4 = 0; __pyx_t_6 = 0; __pyx_t_7 = 0; + if (__pyx_t_5) { + __Pyx_AddTraceback("gevent.resolver.cares.channel.getnameinfo", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_6, &__pyx_t_4) < 0) __PYX_ERR(0, 461, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_4); + + /* "gevent/resolver/cares.pyx":463 + * except gaierror: + * # The stdlib just ignores bad flags + * flags = 0 # <<<<<<<<<<<<<< + * return self._getnameinfo(callback, sockaddr, flags) + */ + __pyx_v_flags = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L4_exception_handled; + } + goto __pyx_L5_except_error; + __pyx_L5_except_error:; + + /* "gevent/resolver/cares.pyx":459 + * + * def getnameinfo(self, object callback, tuple sockaddr, int flags): + * try: # <<<<<<<<<<<<<< + * flags = _convert_cares_flags(flags) + * except gaierror: + */ + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L4_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + __pyx_L8_try_end:; + } + + /* "gevent/resolver/cares.pyx":464 + * # The stdlib just ignores bad flags + * flags = 0 + * return self._getnameinfo(callback, sockaddr, flags) # <<<<<<<<<<<<<< + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = ((struct __pyx_vtabstruct_6gevent_8resolver_5cares_channel *)__pyx_v_self->__pyx_vtab)->_getnameinfo(__pyx_v_self, __pyx_v_callback, __pyx_v_sockaddr, __pyx_v_flags, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 464, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + + /* "gevent/resolver/cares.pyx":458 + * cares.ares_getnameinfo(self.channel, x, length, flags, gevent_ares_nameinfo_callback, arg) + * + * def getnameinfo(self, object callback, tuple sockaddr, int flags): # <<<<<<<<<<<<<< + * try: + * flags = _convert_cares_flags(flags) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("gevent.resolver.cares.channel.getnameinfo", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/resolver/cares.pyx":256 + * cdef class channel: + * + * cdef public object loop # <<<<<<<<<<<<<< + * cdef ares_channeldata* channel + * cdef public dict _watchers + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_4loop_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_4loop_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_8resolver_5cares_7channel_4loop___get__(((struct __pyx_obj_6gevent_8resolver_5cares_channel *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_8resolver_5cares_7channel_4loop___get__(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->loop); + __pyx_r = __pyx_v_self->loop; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6gevent_8resolver_5cares_7channel_4loop_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6gevent_8resolver_5cares_7channel_4loop_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_8resolver_5cares_7channel_4loop_2__set__(((struct __pyx_obj_6gevent_8resolver_5cares_channel *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_8resolver_5cares_7channel_4loop_2__set__(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__", 0); + __Pyx_INCREF(__pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + __Pyx_GOTREF(__pyx_v_self->loop); + __Pyx_DECREF(__pyx_v_self->loop); + __pyx_v_self->loop = __pyx_v_value; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6gevent_8resolver_5cares_7channel_4loop_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6gevent_8resolver_5cares_7channel_4loop_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_8resolver_5cares_7channel_4loop_4__del__(((struct __pyx_obj_6gevent_8resolver_5cares_channel *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_8resolver_5cares_7channel_4loop_4__del__(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->loop); + __Pyx_DECREF(__pyx_v_self->loop); + __pyx_v_self->loop = Py_None; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/resolver/cares.pyx":258 + * cdef public object loop + * cdef ares_channeldata* channel + * cdef public dict _watchers # <<<<<<<<<<<<<< + * cdef public object _timer + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_9_watchers_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_9_watchers_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_8resolver_5cares_7channel_9_watchers___get__(((struct __pyx_obj_6gevent_8resolver_5cares_channel *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_8resolver_5cares_7channel_9_watchers___get__(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->_watchers); + __pyx_r = __pyx_v_self->_watchers; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6gevent_8resolver_5cares_7channel_9_watchers_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6gevent_8resolver_5cares_7channel_9_watchers_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_8resolver_5cares_7channel_9_watchers_2__set__(((struct __pyx_obj_6gevent_8resolver_5cares_channel *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_8resolver_5cares_7channel_9_watchers_2__set__(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__set__", 0); + if (!(likely(PyDict_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_v_value)->tp_name), 0))) __PYX_ERR(0, 258, __pyx_L1_error) + __pyx_t_1 = __pyx_v_value; + __Pyx_INCREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_v_self->_watchers); + __Pyx_DECREF(__pyx_v_self->_watchers); + __pyx_v_self->_watchers = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("gevent.resolver.cares.channel._watchers.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6gevent_8resolver_5cares_7channel_9_watchers_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6gevent_8resolver_5cares_7channel_9_watchers_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_8resolver_5cares_7channel_9_watchers_4__del__(((struct __pyx_obj_6gevent_8resolver_5cares_channel *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_8resolver_5cares_7channel_9_watchers_4__del__(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->_watchers); + __Pyx_DECREF(__pyx_v_self->_watchers); + __pyx_v_self->_watchers = ((PyObject*)Py_None); + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "gevent/resolver/cares.pyx":259 + * cdef ares_channeldata* channel + * cdef public dict _watchers + * cdef public object _timer # <<<<<<<<<<<<<< + * + * def __init__(self, object loop, flags=None, timeout=None, tries=None, ndots=None, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_6_timer_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_6_timer_1__get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_8resolver_5cares_7channel_6_timer___get__(((struct __pyx_obj_6gevent_8resolver_5cares_channel *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6gevent_8resolver_5cares_7channel_6_timer___get__(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__get__", 0); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_self->_timer); + __pyx_r = __pyx_v_self->_timer; + goto __pyx_L0; + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6gevent_8resolver_5cares_7channel_6_timer_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pw_6gevent_8resolver_5cares_7channel_6_timer_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_8resolver_5cares_7channel_6_timer_2__set__(((struct __pyx_obj_6gevent_8resolver_5cares_channel *)__pyx_v_self), ((PyObject *)__pyx_v_value)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_8resolver_5cares_7channel_6_timer_2__set__(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__set__", 0); + __Pyx_INCREF(__pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + __Pyx_GOTREF(__pyx_v_self->_timer); + __Pyx_DECREF(__pyx_v_self->_timer); + __pyx_v_self->_timer = __pyx_v_value; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static int __pyx_pw_6gevent_8resolver_5cares_7channel_6_timer_5__del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pw_6gevent_8resolver_5cares_7channel_6_timer_5__del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); + __pyx_r = __pyx_pf_6gevent_8resolver_5cares_7channel_6_timer_4__del__(((struct __pyx_obj_6gevent_8resolver_5cares_channel *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6gevent_8resolver_5cares_7channel_6_timer_4__del__(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__del__", 0); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(__pyx_v_self->_timer); + __Pyx_DECREF(__pyx_v_self->_timer); + __pyx_v_self->_timer = Py_None; + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_tp_new_6gevent_8resolver_5cares_result(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + struct __pyx_obj_6gevent_8resolver_5cares_result *p; + PyObject *o; + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_6gevent_8resolver_5cares_result *)o); + p->value = Py_None; Py_INCREF(Py_None); + p->exception = Py_None; Py_INCREF(Py_None); + return o; +} + +static void __pyx_tp_dealloc_6gevent_8resolver_5cares_result(PyObject *o) { + struct __pyx_obj_6gevent_8resolver_5cares_result *p = (struct __pyx_obj_6gevent_8resolver_5cares_result *)o; + #if CYTHON_USE_TP_FINALIZE + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + PyObject_GC_UnTrack(o); + Py_CLEAR(p->value); + Py_CLEAR(p->exception); + (*Py_TYPE(o)->tp_free)(o); +} + +static int __pyx_tp_traverse_6gevent_8resolver_5cares_result(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_6gevent_8resolver_5cares_result *p = (struct __pyx_obj_6gevent_8resolver_5cares_result *)o; + if (p->value) { + e = (*v)(p->value, a); if (e) return e; + } + if (p->exception) { + e = (*v)(p->exception, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_6gevent_8resolver_5cares_result(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_6gevent_8resolver_5cares_result *p = (struct __pyx_obj_6gevent_8resolver_5cares_result *)o; + tmp = ((PyObject*)p->value); + p->value = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->exception); + p->exception = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyObject *__pyx_getprop_6gevent_8resolver_5cares_6result_value(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_8resolver_5cares_6result_5value_1__get__(o); +} + +static int __pyx_setprop_6gevent_8resolver_5cares_6result_value(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6gevent_8resolver_5cares_6result_5value_3__set__(o, v); + } + else { + return __pyx_pw_6gevent_8resolver_5cares_6result_5value_5__del__(o); + } +} + +static PyObject *__pyx_getprop_6gevent_8resolver_5cares_6result_exception(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_8resolver_5cares_6result_9exception_1__get__(o); +} + +static int __pyx_setprop_6gevent_8resolver_5cares_6result_exception(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6gevent_8resolver_5cares_6result_9exception_3__set__(o, v); + } + else { + return __pyx_pw_6gevent_8resolver_5cares_6result_9exception_5__del__(o); + } +} + +static PyMethodDef __pyx_methods_6gevent_8resolver_5cares_result[] = { + {"successful", (PyCFunction)__pyx_pw_6gevent_8resolver_5cares_6result_5successful, METH_NOARGS, 0}, + {"get", (PyCFunction)__pyx_pw_6gevent_8resolver_5cares_6result_7get, METH_NOARGS, 0}, + {0, 0, 0, 0} +}; + +static struct PyGetSetDef __pyx_getsets_6gevent_8resolver_5cares_result[] = { + {(char *)"value", __pyx_getprop_6gevent_8resolver_5cares_6result_value, __pyx_setprop_6gevent_8resolver_5cares_6result_value, (char *)0, 0}, + {(char *)"exception", __pyx_getprop_6gevent_8resolver_5cares_6result_exception, __pyx_setprop_6gevent_8resolver_5cares_6result_exception, (char *)0, 0}, + {0, 0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_6gevent_8resolver_5cares_result = { + PyVarObject_HEAD_INIT(0, 0) + "gevent.resolver.cares.result", /*tp_name*/ + sizeof(struct __pyx_obj_6gevent_8resolver_5cares_result), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6gevent_8resolver_5cares_result, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + __pyx_pw_6gevent_8resolver_5cares_6result_3__repr__, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_6gevent_8resolver_5cares_result, /*tp_traverse*/ + __pyx_tp_clear_6gevent_8resolver_5cares_result, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6gevent_8resolver_5cares_result, /*tp_methods*/ + 0, /*tp_members*/ + __pyx_getsets_6gevent_8resolver_5cares_result, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_pw_6gevent_8resolver_5cares_6result_1__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6gevent_8resolver_5cares_result, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; +static struct __pyx_vtabstruct_6gevent_8resolver_5cares_channel __pyx_vtable_6gevent_8resolver_5cares_channel; + +static PyObject *__pyx_tp_new_6gevent_8resolver_5cares_channel(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + struct __pyx_obj_6gevent_8resolver_5cares_channel *p; + PyObject *o; + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_6gevent_8resolver_5cares_channel *)o); + p->__pyx_vtab = __pyx_vtabptr_6gevent_8resolver_5cares_channel; + p->loop = Py_None; Py_INCREF(Py_None); + p->_watchers = ((PyObject*)Py_None); Py_INCREF(Py_None); + p->_timer = Py_None; Py_INCREF(Py_None); + return o; +} + +static void __pyx_tp_dealloc_6gevent_8resolver_5cares_channel(PyObject *o) { + struct __pyx_obj_6gevent_8resolver_5cares_channel *p = (struct __pyx_obj_6gevent_8resolver_5cares_channel *)o; + #if CYTHON_USE_TP_FINALIZE + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + PyObject_GC_UnTrack(o); + { + PyObject *etype, *eval, *etb; + PyErr_Fetch(&etype, &eval, &etb); + ++Py_REFCNT(o); + __pyx_pw_6gevent_8resolver_5cares_7channel_7__dealloc__(o); + --Py_REFCNT(o); + PyErr_Restore(etype, eval, etb); + } + Py_CLEAR(p->loop); + Py_CLEAR(p->_watchers); + Py_CLEAR(p->_timer); + (*Py_TYPE(o)->tp_free)(o); +} + +static int __pyx_tp_traverse_6gevent_8resolver_5cares_channel(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_6gevent_8resolver_5cares_channel *p = (struct __pyx_obj_6gevent_8resolver_5cares_channel *)o; + if (p->loop) { + e = (*v)(p->loop, a); if (e) return e; + } + if (p->_watchers) { + e = (*v)(p->_watchers, a); if (e) return e; + } + if (p->_timer) { + e = (*v)(p->_timer, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_6gevent_8resolver_5cares_channel(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_6gevent_8resolver_5cares_channel *p = (struct __pyx_obj_6gevent_8resolver_5cares_channel *)o; + tmp = ((PyObject*)p->loop); + p->loop = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->_watchers); + p->_watchers = ((PyObject*)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->_timer); + p->_timer = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyObject *__pyx_getprop_6gevent_8resolver_5cares_7channel_loop(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_8resolver_5cares_7channel_4loop_1__get__(o); +} + +static int __pyx_setprop_6gevent_8resolver_5cares_7channel_loop(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6gevent_8resolver_5cares_7channel_4loop_3__set__(o, v); + } + else { + return __pyx_pw_6gevent_8resolver_5cares_7channel_4loop_5__del__(o); + } +} + +static PyObject *__pyx_getprop_6gevent_8resolver_5cares_7channel__watchers(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_8resolver_5cares_7channel_9_watchers_1__get__(o); +} + +static int __pyx_setprop_6gevent_8resolver_5cares_7channel__watchers(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6gevent_8resolver_5cares_7channel_9_watchers_3__set__(o, v); + } + else { + return __pyx_pw_6gevent_8resolver_5cares_7channel_9_watchers_5__del__(o); + } +} + +static PyObject *__pyx_getprop_6gevent_8resolver_5cares_7channel__timer(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_6gevent_8resolver_5cares_7channel_6_timer_1__get__(o); +} + +static int __pyx_setprop_6gevent_8resolver_5cares_7channel__timer(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { + if (v) { + return __pyx_pw_6gevent_8resolver_5cares_7channel_6_timer_3__set__(o, v); + } + else { + return __pyx_pw_6gevent_8resolver_5cares_7channel_6_timer_5__del__(o); + } +} + +static PyMethodDef __pyx_methods_6gevent_8resolver_5cares_channel[] = { + {"destroy", (PyCFunction)__pyx_pw_6gevent_8resolver_5cares_7channel_5destroy, METH_NOARGS, 0}, + {"set_servers", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_8resolver_5cares_7channel_9set_servers, METH_VARARGS|METH_KEYWORDS, 0}, + {"_on_timer", (PyCFunction)__pyx_pw_6gevent_8resolver_5cares_7channel_11_on_timer, METH_NOARGS, 0}, + {"_process_fd", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_8resolver_5cares_7channel_13_process_fd, METH_VARARGS|METH_KEYWORDS, 0}, + {"gethostbyname", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_8resolver_5cares_7channel_15gethostbyname, METH_VARARGS|METH_KEYWORDS, 0}, + {"gethostbyaddr", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_8resolver_5cares_7channel_17gethostbyaddr, METH_VARARGS|METH_KEYWORDS, 0}, + {"_getnameinfo", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_8resolver_5cares_7channel_19_getnameinfo, METH_VARARGS|METH_KEYWORDS, 0}, + {"getnameinfo", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_8resolver_5cares_7channel_21getnameinfo, METH_VARARGS|METH_KEYWORDS, 0}, + {0, 0, 0, 0} +}; + +static struct PyGetSetDef __pyx_getsets_6gevent_8resolver_5cares_channel[] = { + {(char *)"loop", __pyx_getprop_6gevent_8resolver_5cares_7channel_loop, __pyx_setprop_6gevent_8resolver_5cares_7channel_loop, (char *)0, 0}, + {(char *)"_watchers", __pyx_getprop_6gevent_8resolver_5cares_7channel__watchers, __pyx_setprop_6gevent_8resolver_5cares_7channel__watchers, (char *)0, 0}, + {(char *)"_timer", __pyx_getprop_6gevent_8resolver_5cares_7channel__timer, __pyx_setprop_6gevent_8resolver_5cares_7channel__timer, (char *)0, 0}, + {0, 0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_6gevent_8resolver_5cares_channel = { + PyVarObject_HEAD_INIT(0, 0) + "gevent.resolver.cares.channel", /*tp_name*/ + sizeof(struct __pyx_obj_6gevent_8resolver_5cares_channel), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_6gevent_8resolver_5cares_channel, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + __pyx_pw_6gevent_8resolver_5cares_7channel_3__repr__, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_6gevent_8resolver_5cares_channel, /*tp_traverse*/ + __pyx_tp_clear_6gevent_8resolver_5cares_channel, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_6gevent_8resolver_5cares_channel, /*tp_methods*/ + 0, /*tp_members*/ + __pyx_getsets_6gevent_8resolver_5cares_channel, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + __pyx_pw_6gevent_8resolver_5cares_7channel_1__init__, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_6gevent_8resolver_5cares_channel, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; + +static PyMethodDef __pyx_methods[] = { + {"_convert_cares_flags", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_8resolver_5cares_1_convert_cares_flags, METH_VARARGS|METH_KEYWORDS, 0}, + {"strerror", (PyCFunction)__pyx_pw_6gevent_8resolver_5cares_3strerror, METH_O, 0}, + {0, 0, 0, 0} +}; + +#if PY_MAJOR_VERSION >= 3 +#if CYTHON_PEP489_MULTI_PHASE_INIT +static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ +static int __pyx_pymod_exec_cares(PyObject* module); /*proto*/ +static PyModuleDef_Slot __pyx_moduledef_slots[] = { + {Py_mod_create, (void*)__pyx_pymod_create}, + {Py_mod_exec, (void*)__pyx_pymod_exec_cares}, + {0, NULL} +}; +#endif + +static struct PyModuleDef __pyx_moduledef = { + PyModuleDef_HEAD_INIT, + "cares", + 0, /* m_doc */ + #if CYTHON_PEP489_MULTI_PHASE_INIT + 0, /* m_size */ + #else + -1, /* m_size */ + #endif + __pyx_methods /* m_methods */, + #if CYTHON_PEP489_MULTI_PHASE_INIT + __pyx_moduledef_slots, /* m_slots */ + #else + NULL, /* m_reload */ + #endif + NULL, /* m_traverse */ + NULL, /* m_clear */ + NULL /* m_free */ +}; +#endif +#ifndef CYTHON_SMALL_CODE +#if defined(__clang__) + #define CYTHON_SMALL_CODE +#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) + #define CYTHON_SMALL_CODE __attribute__((cold)) +#else + #define CYTHON_SMALL_CODE +#endif +#endif + +static __Pyx_StringTabEntry __pyx_string_tab[] = { + {&__pyx_n_s_ARES_EADDRGETNETWORKPARAMS, __pyx_k_ARES_EADDRGETNETWORKPARAMS, sizeof(__pyx_k_ARES_EADDRGETNETWORKPARAMS), 0, 0, 1, 1}, + {&__pyx_n_s_ARES_EBADFAMILY, __pyx_k_ARES_EBADFAMILY, sizeof(__pyx_k_ARES_EBADFAMILY), 0, 0, 1, 1}, + {&__pyx_n_s_ARES_EBADFLAGS, __pyx_k_ARES_EBADFLAGS, sizeof(__pyx_k_ARES_EBADFLAGS), 0, 0, 1, 1}, + {&__pyx_n_s_ARES_EBADHINTS, __pyx_k_ARES_EBADHINTS, sizeof(__pyx_k_ARES_EBADHINTS), 0, 0, 1, 1}, + {&__pyx_n_s_ARES_EBADNAME, __pyx_k_ARES_EBADNAME, sizeof(__pyx_k_ARES_EBADNAME), 0, 0, 1, 1}, + {&__pyx_n_s_ARES_EBADQUERY, __pyx_k_ARES_EBADQUERY, sizeof(__pyx_k_ARES_EBADQUERY), 0, 0, 1, 1}, + {&__pyx_n_s_ARES_EBADRESP, __pyx_k_ARES_EBADRESP, sizeof(__pyx_k_ARES_EBADRESP), 0, 0, 1, 1}, + {&__pyx_n_s_ARES_EBADSTR, __pyx_k_ARES_EBADSTR, sizeof(__pyx_k_ARES_EBADSTR), 0, 0, 1, 1}, + {&__pyx_n_s_ARES_ECANCELLED, __pyx_k_ARES_ECANCELLED, sizeof(__pyx_k_ARES_ECANCELLED), 0, 0, 1, 1}, + {&__pyx_n_s_ARES_ECONNREFUSED, __pyx_k_ARES_ECONNREFUSED, sizeof(__pyx_k_ARES_ECONNREFUSED), 0, 0, 1, 1}, + {&__pyx_n_s_ARES_EDESTRUCTION, __pyx_k_ARES_EDESTRUCTION, sizeof(__pyx_k_ARES_EDESTRUCTION), 0, 0, 1, 1}, + {&__pyx_n_s_ARES_EFILE, __pyx_k_ARES_EFILE, sizeof(__pyx_k_ARES_EFILE), 0, 0, 1, 1}, + {&__pyx_n_s_ARES_EFORMERR, __pyx_k_ARES_EFORMERR, sizeof(__pyx_k_ARES_EFORMERR), 0, 0, 1, 1}, + {&__pyx_n_s_ARES_ELOADIPHLPAPI, __pyx_k_ARES_ELOADIPHLPAPI, sizeof(__pyx_k_ARES_ELOADIPHLPAPI), 0, 0, 1, 1}, + {&__pyx_n_s_ARES_ENODATA, __pyx_k_ARES_ENODATA, sizeof(__pyx_k_ARES_ENODATA), 0, 0, 1, 1}, + {&__pyx_n_s_ARES_ENOMEM, __pyx_k_ARES_ENOMEM, sizeof(__pyx_k_ARES_ENOMEM), 0, 0, 1, 1}, + {&__pyx_n_s_ARES_ENONAME, __pyx_k_ARES_ENONAME, sizeof(__pyx_k_ARES_ENONAME), 0, 0, 1, 1}, + {&__pyx_n_s_ARES_ENOTFOUND, __pyx_k_ARES_ENOTFOUND, sizeof(__pyx_k_ARES_ENOTFOUND), 0, 0, 1, 1}, + {&__pyx_n_s_ARES_ENOTIMP, __pyx_k_ARES_ENOTIMP, sizeof(__pyx_k_ARES_ENOTIMP), 0, 0, 1, 1}, + {&__pyx_n_s_ARES_ENOTINITIALIZED, __pyx_k_ARES_ENOTINITIALIZED, sizeof(__pyx_k_ARES_ENOTINITIALIZED), 0, 0, 1, 1}, + {&__pyx_n_s_ARES_EOF, __pyx_k_ARES_EOF, sizeof(__pyx_k_ARES_EOF), 0, 0, 1, 1}, + {&__pyx_n_s_ARES_EREFUSED, __pyx_k_ARES_EREFUSED, sizeof(__pyx_k_ARES_EREFUSED), 0, 0, 1, 1}, + {&__pyx_n_s_ARES_ESERVFAIL, __pyx_k_ARES_ESERVFAIL, sizeof(__pyx_k_ARES_ESERVFAIL), 0, 0, 1, 1}, + {&__pyx_n_s_ARES_ETIMEOUT, __pyx_k_ARES_ETIMEOUT, sizeof(__pyx_k_ARES_ETIMEOUT), 0, 0, 1, 1}, + {&__pyx_n_s_ARES_FLAG_IGNTC, __pyx_k_ARES_FLAG_IGNTC, sizeof(__pyx_k_ARES_FLAG_IGNTC), 0, 0, 1, 1}, + {&__pyx_n_s_ARES_FLAG_NOALIASES, __pyx_k_ARES_FLAG_NOALIASES, sizeof(__pyx_k_ARES_FLAG_NOALIASES), 0, 0, 1, 1}, + {&__pyx_n_s_ARES_FLAG_NOCHECKRESP, __pyx_k_ARES_FLAG_NOCHECKRESP, sizeof(__pyx_k_ARES_FLAG_NOCHECKRESP), 0, 0, 1, 1}, + {&__pyx_n_s_ARES_FLAG_NORECURSE, __pyx_k_ARES_FLAG_NORECURSE, sizeof(__pyx_k_ARES_FLAG_NORECURSE), 0, 0, 1, 1}, + {&__pyx_n_s_ARES_FLAG_NOSEARCH, __pyx_k_ARES_FLAG_NOSEARCH, sizeof(__pyx_k_ARES_FLAG_NOSEARCH), 0, 0, 1, 1}, + {&__pyx_n_s_ARES_FLAG_PRIMARY, __pyx_k_ARES_FLAG_PRIMARY, sizeof(__pyx_k_ARES_FLAG_PRIMARY), 0, 0, 1, 1}, + {&__pyx_n_s_ARES_FLAG_STAYOPEN, __pyx_k_ARES_FLAG_STAYOPEN, sizeof(__pyx_k_ARES_FLAG_STAYOPEN), 0, 0, 1, 1}, + {&__pyx_n_s_ARES_FLAG_USEVC, __pyx_k_ARES_FLAG_USEVC, sizeof(__pyx_k_ARES_FLAG_USEVC), 0, 0, 1, 1}, + {&__pyx_n_s_ARES_SUCCESS, __pyx_k_ARES_SUCCESS, sizeof(__pyx_k_ARES_SUCCESS), 0, 0, 1, 1}, + {&__pyx_kp_s_Bad_value_for_ai_flags_0x_x, __pyx_k_Bad_value_for_ai_flags_0x_x, sizeof(__pyx_k_Bad_value_for_ai_flags_0x_x), 0, 0, 1, 0}, + {&__pyx_n_s_InvalidIP, __pyx_k_InvalidIP, sizeof(__pyx_k_InvalidIP), 0, 0, 1, 1}, + {&__pyx_kp_s_Invalid_value_for_port_r, __pyx_k_Invalid_value_for_port_r, sizeof(__pyx_k_Invalid_value_for_port_r), 0, 0, 1, 0}, + {&__pyx_n_s_MemoryError, __pyx_k_MemoryError, sizeof(__pyx_k_MemoryError), 0, 0, 1, 1}, + {&__pyx_n_s_NI_DGRAM, __pyx_k_NI_DGRAM, sizeof(__pyx_k_NI_DGRAM), 0, 0, 1, 1}, + {&__pyx_n_s_NI_NAMEREQD, __pyx_k_NI_NAMEREQD, sizeof(__pyx_k_NI_NAMEREQD), 0, 0, 1, 1}, + {&__pyx_n_s_NI_NOFQDN, __pyx_k_NI_NOFQDN, sizeof(__pyx_k_NI_NOFQDN), 0, 0, 1, 1}, + {&__pyx_n_s_NI_NUMERICHOST, __pyx_k_NI_NUMERICHOST, sizeof(__pyx_k_NI_NUMERICHOST), 0, 0, 1, 1}, + {&__pyx_n_s_NI_NUMERICSERV, __pyx_k_NI_NUMERICSERV, sizeof(__pyx_k_NI_NUMERICSERV), 0, 0, 1, 1}, + {&__pyx_n_s_TIMEOUT, __pyx_k_TIMEOUT, sizeof(__pyx_k_TIMEOUT), 0, 0, 1, 1}, + {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1}, + {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1}, + {&__pyx_kp_s__2, __pyx_k__2, sizeof(__pyx_k__2), 0, 0, 1, 0}, + {&__pyx_n_s_addr, __pyx_k_addr, sizeof(__pyx_k_addr), 0, 0, 1, 1}, + {&__pyx_n_s_again, __pyx_k_again, sizeof(__pyx_k_again), 0, 0, 1, 1}, + {&__pyx_n_s_all, __pyx_k_all, sizeof(__pyx_k_all), 0, 0, 1, 1}, + {&__pyx_n_s_ares_errors, __pyx_k_ares_errors, sizeof(__pyx_k_ares_errors), 0, 0, 1, 1}, + {&__pyx_n_s_ares_host_result, __pyx_k_ares_host_result, sizeof(__pyx_k_ares_host_result), 0, 0, 1, 1}, + {&__pyx_n_s_ares_host_result___getnewargs, __pyx_k_ares_host_result___getnewargs, sizeof(__pyx_k_ares_host_result___getnewargs), 0, 0, 1, 1}, + {&__pyx_n_s_ares_host_result___new, __pyx_k_ares_host_result___new, sizeof(__pyx_k_ares_host_result___new), 0, 0, 1, 1}, + {&__pyx_n_s_ascii, __pyx_k_ascii, sizeof(__pyx_k_ascii), 0, 0, 1, 1}, + {&__pyx_n_s_basestring, __pyx_k_basestring, sizeof(__pyx_k_basestring), 0, 0, 1, 1}, + {&__pyx_n_s_builtins, __pyx_k_builtins, sizeof(__pyx_k_builtins), 0, 0, 1, 1}, + {&__pyx_n_s_callback, __pyx_k_callback, sizeof(__pyx_k_callback), 0, 0, 1, 1}, + {&__pyx_n_s_cares_flag_map, __pyx_k_cares_flag_map, sizeof(__pyx_k_cares_flag_map), 0, 0, 1, 1}, + {&__pyx_n_s_channel, __pyx_k_channel, sizeof(__pyx_k_channel), 0, 0, 1, 1}, + {&__pyx_n_s_class, __pyx_k_class, sizeof(__pyx_k_class), 0, 0, 1, 1}, + {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, + {&__pyx_n_s_close, __pyx_k_close, sizeof(__pyx_k_close), 0, 0, 1, 1}, + {&__pyx_n_s_cls, __pyx_k_cls, sizeof(__pyx_k_cls), 0, 0, 1, 1}, + {&__pyx_n_s_default, __pyx_k_default, sizeof(__pyx_k_default), 0, 0, 1, 1}, + {&__pyx_n_s_destroy, __pyx_k_destroy, sizeof(__pyx_k_destroy), 0, 0, 1, 1}, + {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1}, + {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1}, + {&__pyx_n_s_events, __pyx_k_events, sizeof(__pyx_k_events), 0, 0, 1, 1}, + {&__pyx_n_s_exc_info, __pyx_k_exc_info, sizeof(__pyx_k_exc_info), 0, 0, 1, 1}, + {&__pyx_n_s_exception, __pyx_k_exception, sizeof(__pyx_k_exception), 0, 0, 1, 1}, + {&__pyx_kp_s_expected_a_tuple_got_r, __pyx_k_expected_a_tuple_got_r, sizeof(__pyx_k_expected_a_tuple_got_r), 0, 0, 1, 0}, + {&__pyx_n_s_family, __pyx_k_family, sizeof(__pyx_k_family), 0, 0, 1, 1}, + {&__pyx_n_s_fd, __pyx_k_fd, sizeof(__pyx_k_fd), 0, 0, 1, 1}, + {&__pyx_n_s_flags, __pyx_k_flags, sizeof(__pyx_k_flags), 0, 0, 1, 1}, + {&__pyx_n_s_gaierror, __pyx_k_gaierror, sizeof(__pyx_k_gaierror), 0, 0, 1, 1}, + {&__pyx_n_s_get, __pyx_k_get, sizeof(__pyx_k_get), 0, 0, 1, 1}, + {&__pyx_n_s_getnameinfo, __pyx_k_getnameinfo, sizeof(__pyx_k_getnameinfo), 0, 0, 1, 1}, + {&__pyx_n_s_getnewargs, __pyx_k_getnewargs, sizeof(__pyx_k_getnewargs), 0, 0, 1, 1}, + {&__pyx_n_s_gevent_resolver_cares, __pyx_k_gevent_resolver_cares, sizeof(__pyx_k_gevent_resolver_cares), 0, 0, 1, 1}, + {&__pyx_n_s_handle_error, __pyx_k_handle_error, sizeof(__pyx_k_handle_error), 0, 0, 1, 1}, + {&__pyx_n_s_id, __pyx_k_id, sizeof(__pyx_k_id), 0, 0, 1, 1}, + {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, + {&__pyx_n_s_io, __pyx_k_io, sizeof(__pyx_k_io), 0, 0, 1, 1}, + {&__pyx_n_s_iterable, __pyx_k_iterable, sizeof(__pyx_k_iterable), 0, 0, 1, 1}, + {&__pyx_n_s_loop, __pyx_k_loop, sizeof(__pyx_k_loop), 0, 0, 1, 1}, + {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, + {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1}, + {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1}, + {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, + {&__pyx_n_s_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 0, 1, 1}, + {&__pyx_n_s_ndots, __pyx_k_ndots, sizeof(__pyx_k_ndots), 0, 0, 1, 1}, + {&__pyx_n_s_new, __pyx_k_new, sizeof(__pyx_k_new), 0, 0, 1, 1}, + {&__pyx_n_s_on_timer, __pyx_k_on_timer, sizeof(__pyx_k_on_timer), 0, 0, 1, 1}, + {&__pyx_n_s_pass_events, __pyx_k_pass_events, sizeof(__pyx_k_pass_events), 0, 0, 1, 1}, + {&__pyx_n_s_pop, __pyx_k_pop, sizeof(__pyx_k_pop), 0, 0, 1, 1}, + {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1}, + {&__pyx_n_s_process_fd, __pyx_k_process_fd, sizeof(__pyx_k_process_fd), 0, 0, 1, 1}, + {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1}, + {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1}, + {&__pyx_n_s_result, __pyx_k_result, sizeof(__pyx_k_result), 0, 0, 1, 1}, + {&__pyx_kp_s_s_at_0x_x__timer_r__watchers_s, __pyx_k_s_at_0x_x__timer_r__watchers_s, sizeof(__pyx_k_s_at_0x_x__timer_r__watchers_s), 0, 0, 1, 0}, + {&__pyx_kp_s_s_exception_r, __pyx_k_s_exception_r, sizeof(__pyx_k_s_exception_r), 0, 0, 1, 0}, + {&__pyx_kp_s_s_r, __pyx_k_s_r, sizeof(__pyx_k_s_r), 0, 0, 1, 0}, + {&__pyx_kp_s_s_s, __pyx_k_s_s, sizeof(__pyx_k_s_s), 0, 0, 1, 0}, + {&__pyx_kp_s_s_value_r_exception_r, __pyx_k_s_value_r_exception_r, sizeof(__pyx_k_s_value_r_exception_r), 0, 0, 1, 0}, + {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1}, + {&__pyx_n_s_servers, __pyx_k_servers, sizeof(__pyx_k_servers), 0, 0, 1, 1}, + {&__pyx_n_s_set_servers, __pyx_k_set_servers, sizeof(__pyx_k_set_servers), 0, 0, 1, 1}, + {&__pyx_n_s_sockaddr, __pyx_k_sockaddr, sizeof(__pyx_k_sockaddr), 0, 0, 1, 1}, + {&__pyx_n_s_socket, __pyx_k_socket, sizeof(__pyx_k_socket), 0, 0, 1, 1}, + {&__pyx_n_s_split, __pyx_k_split, sizeof(__pyx_k_split), 0, 0, 1, 1}, + {&__pyx_kp_s_src_gevent_resolver_cares_pyx, __pyx_k_src_gevent_resolver_cares_pyx, sizeof(__pyx_k_src_gevent_resolver_cares_pyx), 0, 0, 1, 0}, + {&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1}, + {&__pyx_n_s_stop, __pyx_k_stop, sizeof(__pyx_k_stop), 0, 0, 1, 1}, + {&__pyx_n_s_sys, __pyx_k_sys, sizeof(__pyx_k_sys), 0, 0, 1, 1}, + {&__pyx_n_s_tcp_port, __pyx_k_tcp_port, sizeof(__pyx_k_tcp_port), 0, 0, 1, 1}, + {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, + {&__pyx_kp_s_this_ares_channel_has_been_destr, __pyx_k_this_ares_channel_has_been_destr, sizeof(__pyx_k_this_ares_channel_has_been_destr), 0, 0, 1, 0}, + {&__pyx_n_s_timeout, __pyx_k_timeout, sizeof(__pyx_k_timeout), 0, 0, 1, 1}, + {&__pyx_n_s_timer, __pyx_k_timer, sizeof(__pyx_k_timer), 0, 0, 1, 1}, + {&__pyx_n_s_tries, __pyx_k_tries, sizeof(__pyx_k_tries), 0, 0, 1, 1}, + {&__pyx_n_s_udp_port, __pyx_k_udp_port, sizeof(__pyx_k_udp_port), 0, 0, 1, 1}, + {&__pyx_n_s_unicode, __pyx_k_unicode, sizeof(__pyx_k_unicode), 0, 0, 1, 1}, + {&__pyx_n_s_value, __pyx_k_value, sizeof(__pyx_k_value), 0, 0, 1, 1}, + {&__pyx_n_s_version_info, __pyx_k_version_info, sizeof(__pyx_k_version_info), 0, 0, 1, 1}, + {&__pyx_n_s_watcher, __pyx_k_watcher, sizeof(__pyx_k_watcher), 0, 0, 1, 1}, + {0, 0, 0, 0, 0, 0, 0} +}; +static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { + __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 162, __pyx_L1_error) + __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(0, 305, __pyx_L1_error) + __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(0, 339, __pyx_L1_error) + __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(0, 446, __pyx_L1_error) + return 0; + __pyx_L1_error:; + return -1; +} + +static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); + + /* "gevent/resolver/cares.pyx":162 + * + * + * class InvalidIP(ValueError): # <<<<<<<<<<<<<< + * pass + * + */ + __pyx_tuple__4 = PyTuple_Pack(1, __pyx_builtin_ValueError); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 162, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__4); + __Pyx_GIVEREF(__pyx_tuple__4); + + /* "gevent/resolver/cares.pyx":201 + * class ares_host_result(tuple): + * + * def __new__(cls, family, iterable): # <<<<<<<<<<<<<< + * cdef object self = tuple.__new__(cls, iterable) + * self.family = family + */ + __pyx_tuple__5 = PyTuple_Pack(4, __pyx_n_s_cls, __pyx_n_s_family, __pyx_n_s_iterable, __pyx_n_s_self); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 201, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__5); + __Pyx_GIVEREF(__pyx_tuple__5); + __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__5, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_resolver_cares_pyx, __pyx_n_s_new, 201, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__6)) __PYX_ERR(0, 201, __pyx_L1_error) + + /* "gevent/resolver/cares.pyx":206 + * return self + * + * def __getnewargs__(self): # <<<<<<<<<<<<<< + * return (self.family, tuple(self)) + * + */ + __pyx_tuple__7 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 206, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__7); + __Pyx_GIVEREF(__pyx_tuple__7); + __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_resolver_cares_pyx, __pyx_n_s_getnewargs, 206, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) __PYX_ERR(0, 206, __pyx_L1_error) + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} + +static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { + __pyx_umethod_PyDict_Type_get.type = (PyObject*)&PyDict_Type; + __pyx_umethod_PyDict_Type_pop.type = (PyObject*)&PyDict_Type; + if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_4 = PyInt_FromLong(4); if (unlikely(!__pyx_int_4)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_8 = PyInt_FromLong(8); if (unlikely(!__pyx_int_8)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_16 = PyInt_FromLong(16); if (unlikely(!__pyx_int_16)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_neg_8 = PyInt_FromLong(-8); if (unlikely(!__pyx_int_neg_8)) __PYX_ERR(0, 1, __pyx_L1_error) + return 0; + __pyx_L1_error:; + return -1; +} + +static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/ + +static int __Pyx_modinit_global_init_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); + /*--- Global init code ---*/ + __pyx_v_6gevent_8resolver_5cares_string_types = Py_None; Py_INCREF(Py_None); + __pyx_v_6gevent_8resolver_5cares_text_type = Py_None; Py_INCREF(Py_None); + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_variable_export_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); + /*--- Variable export code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_function_export_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); + /*--- Function export code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_type_init_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); + /*--- Type init code ---*/ + if (PyType_Ready(&__pyx_type_6gevent_8resolver_5cares_result) < 0) __PYX_ERR(0, 173, __pyx_L1_error) + __pyx_type_6gevent_8resolver_5cares_result.tp_print = 0; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6gevent_8resolver_5cares_result.tp_dictoffset && __pyx_type_6gevent_8resolver_5cares_result.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_type_6gevent_8resolver_5cares_result.tp_getattro = __Pyx_PyObject_GenericGetAttr; + } + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_result, (PyObject *)&__pyx_type_6gevent_8resolver_5cares_result) < 0) __PYX_ERR(0, 173, __pyx_L1_error) + __pyx_ptype_6gevent_8resolver_5cares_result = &__pyx_type_6gevent_8resolver_5cares_result; + __pyx_vtabptr_6gevent_8resolver_5cares_channel = &__pyx_vtable_6gevent_8resolver_5cares_channel; + __pyx_vtable_6gevent_8resolver_5cares_channel.set_servers = (PyObject *(*)(struct __pyx_obj_6gevent_8resolver_5cares_channel *, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_8resolver_5cares_7channel_set_servers *__pyx_optional_args))__pyx_f_6gevent_8resolver_5cares_7channel_set_servers; + __pyx_vtable_6gevent_8resolver_5cares_channel._sock_state_callback = (PyObject *(*)(struct __pyx_obj_6gevent_8resolver_5cares_channel *, int, int, int))__pyx_f_6gevent_8resolver_5cares_7channel__sock_state_callback; + __pyx_vtable_6gevent_8resolver_5cares_channel._getnameinfo = (PyObject *(*)(struct __pyx_obj_6gevent_8resolver_5cares_channel *, PyObject *, PyObject *, int, int __pyx_skip_dispatch))__pyx_f_6gevent_8resolver_5cares_7channel__getnameinfo; + if (PyType_Ready(&__pyx_type_6gevent_8resolver_5cares_channel) < 0) __PYX_ERR(0, 254, __pyx_L1_error) + __pyx_type_6gevent_8resolver_5cares_channel.tp_print = 0; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6gevent_8resolver_5cares_channel.tp_dictoffset && __pyx_type_6gevent_8resolver_5cares_channel.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_type_6gevent_8resolver_5cares_channel.tp_getattro = __Pyx_PyObject_GenericGetAttr; + } + if (__Pyx_SetVtable(__pyx_type_6gevent_8resolver_5cares_channel.tp_dict, __pyx_vtabptr_6gevent_8resolver_5cares_channel) < 0) __PYX_ERR(0, 254, __pyx_L1_error) + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_channel, (PyObject *)&__pyx_type_6gevent_8resolver_5cares_channel) < 0) __PYX_ERR(0, 254, __pyx_L1_error) + __pyx_ptype_6gevent_8resolver_5cares_channel = &__pyx_type_6gevent_8resolver_5cares_channel; + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_modinit_type_import_code(void) { + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); + /*--- Type import code ---*/ + __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 9, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type", + #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000 + sizeof(PyTypeObject), + #else + sizeof(PyHeapTypeObject), + #endif + __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(1, 9, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_modinit_variable_import_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); + /*--- Variable import code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_function_import_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); + /*--- Function import code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + + +#if PY_MAJOR_VERSION < 3 +#ifdef CYTHON_NO_PYINIT_EXPORT +#define __Pyx_PyMODINIT_FUNC void +#else +#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC +#endif +#else +#ifdef CYTHON_NO_PYINIT_EXPORT +#define __Pyx_PyMODINIT_FUNC PyObject * +#else +#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC +#endif +#endif + + +#if PY_MAJOR_VERSION < 3 +__Pyx_PyMODINIT_FUNC initcares(void) CYTHON_SMALL_CODE; /*proto*/ +__Pyx_PyMODINIT_FUNC initcares(void) +#else +__Pyx_PyMODINIT_FUNC PyInit_cares(void) CYTHON_SMALL_CODE; /*proto*/ +__Pyx_PyMODINIT_FUNC PyInit_cares(void) +#if CYTHON_PEP489_MULTI_PHASE_INIT +{ + return PyModuleDef_Init(&__pyx_moduledef); +} +static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { + #if PY_VERSION_HEX >= 0x030700A1 + static PY_INT64_T main_interpreter_id = -1; + PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); + if (main_interpreter_id == -1) { + main_interpreter_id = current_id; + return (unlikely(current_id == -1)) ? -1 : 0; + } else if (unlikely(main_interpreter_id != current_id)) + #else + static PyInterpreterState *main_interpreter = NULL; + PyInterpreterState *current_interpreter = PyThreadState_Get()->interp; + if (!main_interpreter) { + main_interpreter = current_interpreter; + } else if (unlikely(main_interpreter != current_interpreter)) + #endif + { + PyErr_SetString( + PyExc_ImportError, + "Interpreter change detected - this module can only be loaded into one interpreter per process."); + return -1; + } + return 0; +} +static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) { + PyObject *value = PyObject_GetAttrString(spec, from_name); + int result = 0; + if (likely(value)) { + if (allow_none || value != Py_None) { + result = PyDict_SetItemString(moddict, to_name, value); + } + Py_DECREF(value); + } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_Clear(); + } else { + result = -1; + } + return result; +} +static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) { + PyObject *module = NULL, *moddict, *modname; + if (__Pyx_check_single_interpreter()) + return NULL; + if (__pyx_m) + return __Pyx_NewRef(__pyx_m); + modname = PyObject_GetAttrString(spec, "name"); + if (unlikely(!modname)) goto bad; + module = PyModule_NewObject(modname); + Py_DECREF(modname); + if (unlikely(!module)) goto bad; + moddict = PyModule_GetDict(module); + if (unlikely(!moddict)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad; + return module; +bad: + Py_XDECREF(module); + return NULL; +} + + +static CYTHON_SMALL_CODE int __pyx_pymod_exec_cares(PyObject *__pyx_pyinit_module) +#endif +#endif +{ + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + PyObject *__pyx_t_14 = NULL; + PyObject *__pyx_t_15 = NULL; + PyObject *__pyx_t_16 = NULL; + PyObject *__pyx_t_17 = NULL; + PyObject *__pyx_t_18 = NULL; + PyObject *__pyx_t_19 = NULL; + PyObject *__pyx_t_20 = NULL; + PyObject *__pyx_t_21 = NULL; + PyObject *__pyx_t_22 = NULL; + PyObject *__pyx_t_23 = NULL; + PyObject *__pyx_t_24 = NULL; + PyObject *__pyx_t_25 = NULL; + PyObject *__pyx_t_26 = NULL; + PyObject *__pyx_t_27 = NULL; + __Pyx_RefNannyDeclarations + #if CYTHON_PEP489_MULTI_PHASE_INIT + if (__pyx_m) { + if (__pyx_m == __pyx_pyinit_module) return 0; + PyErr_SetString(PyExc_RuntimeError, "Module 'cares' has already been imported. Re-initialisation is not supported."); + return -1; + } + #elif PY_MAJOR_VERSION >= 3 + if (__pyx_m) return __Pyx_NewRef(__pyx_m); + #endif + #if CYTHON_REFNANNY +__Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); +if (!__Pyx_RefNanny) { + PyErr_Clear(); + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); + if (!__Pyx_RefNanny) + Py_FatalError("failed to import 'refnanny' module"); +} +#endif + __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_cares(void)", 0); + if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #ifdef __Pxy_PyFrame_Initialize_Offsets + __Pxy_PyFrame_Initialize_Offsets(); + #endif + __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) + #ifdef __Pyx_CyFunction_USED + if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_FusedFunction_USED + if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_Coroutine_USED + if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_Generator_USED + if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_AsyncGen_USED + if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_StopAsyncIteration_USED + if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + /*--- Library function declarations ---*/ + /*--- Threads initialization code ---*/ + #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS + #ifdef WITH_THREAD /* Python build with threading support? */ + PyEval_InitThreads(); + #endif + #endif + /*--- Module creation code ---*/ + #if CYTHON_PEP489_MULTI_PHASE_INIT + __pyx_m = __pyx_pyinit_module; + Py_INCREF(__pyx_m); + #else + #if PY_MAJOR_VERSION < 3 + __pyx_m = Py_InitModule4("cares", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); + #else + __pyx_m = PyModule_Create(&__pyx_moduledef); + #endif + if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) + Py_INCREF(__pyx_d); + __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) + #if CYTHON_COMPILING_IN_PYPY + Py_INCREF(__pyx_b); + #endif + if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + /*--- Initialize various global constants etc. ---*/ + if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) + if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + if (__pyx_module_is_main_gevent__resolver__cares) { + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + } + #if PY_MAJOR_VERSION >= 3 + { + PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) + if (!PyDict_GetItemString(modules, "gevent.resolver.cares")) { + if (unlikely(PyDict_SetItemString(modules, "gevent.resolver.cares", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error) + } + } + #endif + /*--- Builtin init code ---*/ + if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + /*--- Constants init code ---*/ + if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + /*--- Global type/function init code ---*/ + (void)__Pyx_modinit_global_init_code(); + (void)__Pyx_modinit_variable_export_code(); + (void)__Pyx_modinit_function_export_code(); + if (unlikely(__Pyx_modinit_type_init_code() != 0)) goto __pyx_L1_error; + if (unlikely(__Pyx_modinit_type_import_code() != 0)) goto __pyx_L1_error; + (void)__Pyx_modinit_variable_import_code(); + (void)__Pyx_modinit_function_import_code(); + /*--- Execution code ---*/ + #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) + if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + + /* "gevent/resolver/cares.pyx":8 + * # cython: auto_pickle=False + * cimport libcares as cares + * import sys # <<<<<<<<<<<<<< + * + * from cpython.ref cimport Py_INCREF + */ + __pyx_t_1 = __Pyx_Import(__pyx_n_s_sys, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 8, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_sys, __pyx_t_1) < 0) __PYX_ERR(0, 8, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "gevent/resolver/cares.pyx":15 + * from cpython.mem cimport PyMem_Free + * + * from _socket import gaierror # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 15, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_n_s_gaierror); + __Pyx_GIVEREF(__pyx_n_s_gaierror); + PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_gaierror); + __pyx_t_2 = __Pyx_Import(__pyx_n_s_socket, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 15, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_gaierror); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 15, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_gaierror, __pyx_t_1) < 0) __PYX_ERR(0, 15, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "gevent/resolver/cares.pyx":18 + * + * + * __all__ = ['channel'] # <<<<<<<<<<<<<< + * + * cdef object string_types + */ + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 18, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_n_s_channel); + __Pyx_GIVEREF(__pyx_n_s_channel); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_channel); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_all, __pyx_t_2) < 0) __PYX_ERR(0, 18, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "gevent/resolver/cares.pyx":23 + * cdef object text_type + * + * if sys.version_info[0] >= 3: # <<<<<<<<<<<<<< + * string_types = str, + * text_type = str + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_sys); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 23, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_version_info); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 23, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 23, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_int_3, Py_GE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 23, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 23, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_3) { + + /* "gevent/resolver/cares.pyx":24 + * + * if sys.version_info[0] >= 3: + * string_types = str, # <<<<<<<<<<<<<< + * text_type = str + * else: + */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 24, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)(&PyString_Type))); + __Pyx_GIVEREF(((PyObject *)(&PyString_Type))); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)(&PyString_Type))); + __Pyx_XGOTREF(__pyx_v_6gevent_8resolver_5cares_string_types); + __Pyx_DECREF_SET(__pyx_v_6gevent_8resolver_5cares_string_types, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + + /* "gevent/resolver/cares.pyx":25 + * if sys.version_info[0] >= 3: + * string_types = str, + * text_type = str # <<<<<<<<<<<<<< + * else: + * string_types = __builtins__.basestring, + */ + __Pyx_INCREF(((PyObject *)(&PyString_Type))); + __Pyx_XGOTREF(__pyx_v_6gevent_8resolver_5cares_text_type); + __Pyx_DECREF_SET(__pyx_v_6gevent_8resolver_5cares_text_type, ((PyObject *)(&PyString_Type))); + __Pyx_GIVEREF(((PyObject *)(&PyString_Type))); + + /* "gevent/resolver/cares.pyx":23 + * cdef object text_type + * + * if sys.version_info[0] >= 3: # <<<<<<<<<<<<<< + * string_types = str, + * text_type = str + */ + goto __pyx_L2; + } + + /* "gevent/resolver/cares.pyx":27 + * text_type = str + * else: + * string_types = __builtins__.basestring, # <<<<<<<<<<<<<< + * text_type = __builtins__.unicode + * + */ + /*else*/ { + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_builtins); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 27, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_basestring); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 27, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 27, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); + __pyx_t_2 = 0; + __Pyx_XGOTREF(__pyx_v_6gevent_8resolver_5cares_string_types); + __Pyx_DECREF_SET(__pyx_v_6gevent_8resolver_5cares_string_types, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + + /* "gevent/resolver/cares.pyx":28 + * else: + * string_types = __builtins__.basestring, + * text_type = __builtins__.unicode # <<<<<<<<<<<<<< + * + * TIMEOUT = 1 + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_builtins); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 28, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 28, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XGOTREF(__pyx_v_6gevent_8resolver_5cares_text_type); + __Pyx_DECREF_SET(__pyx_v_6gevent_8resolver_5cares_text_type, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + } + __pyx_L2:; + + /* "gevent/resolver/cares.pyx":30 + * text_type = __builtins__.unicode + * + * TIMEOUT = 1 # <<<<<<<<<<<<<< + * + * DEF EV_READ = 1 + */ + if (PyDict_SetItem(__pyx_d, __pyx_n_s_TIMEOUT, __pyx_int_1) < 0) __PYX_ERR(0, 30, __pyx_L1_error) + + /* "gevent/resolver/cares.pyx":67 + * + * + * ARES_SUCCESS = cares.ARES_SUCCESS # <<<<<<<<<<<<<< + * ARES_ENODATA = cares.ARES_ENODATA + * ARES_EFORMERR = cares.ARES_EFORMERR + */ + __pyx_t_2 = __Pyx_PyInt_From_int(ARES_SUCCESS); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 67, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARES_SUCCESS, __pyx_t_2) < 0) __PYX_ERR(0, 67, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "gevent/resolver/cares.pyx":68 + * + * ARES_SUCCESS = cares.ARES_SUCCESS + * ARES_ENODATA = cares.ARES_ENODATA # <<<<<<<<<<<<<< + * ARES_EFORMERR = cares.ARES_EFORMERR + * ARES_ESERVFAIL = cares.ARES_ESERVFAIL + */ + __pyx_t_2 = __Pyx_PyInt_From_int(ARES_ENODATA); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 68, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARES_ENODATA, __pyx_t_2) < 0) __PYX_ERR(0, 68, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "gevent/resolver/cares.pyx":69 + * ARES_SUCCESS = cares.ARES_SUCCESS + * ARES_ENODATA = cares.ARES_ENODATA + * ARES_EFORMERR = cares.ARES_EFORMERR # <<<<<<<<<<<<<< + * ARES_ESERVFAIL = cares.ARES_ESERVFAIL + * ARES_ENOTFOUND = cares.ARES_ENOTFOUND + */ + __pyx_t_2 = __Pyx_PyInt_From_int(ARES_EFORMERR); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 69, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARES_EFORMERR, __pyx_t_2) < 0) __PYX_ERR(0, 69, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "gevent/resolver/cares.pyx":70 + * ARES_ENODATA = cares.ARES_ENODATA + * ARES_EFORMERR = cares.ARES_EFORMERR + * ARES_ESERVFAIL = cares.ARES_ESERVFAIL # <<<<<<<<<<<<<< + * ARES_ENOTFOUND = cares.ARES_ENOTFOUND + * ARES_ENOTIMP = cares.ARES_ENOTIMP + */ + __pyx_t_2 = __Pyx_PyInt_From_int(ARES_ESERVFAIL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 70, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARES_ESERVFAIL, __pyx_t_2) < 0) __PYX_ERR(0, 70, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "gevent/resolver/cares.pyx":71 + * ARES_EFORMERR = cares.ARES_EFORMERR + * ARES_ESERVFAIL = cares.ARES_ESERVFAIL + * ARES_ENOTFOUND = cares.ARES_ENOTFOUND # <<<<<<<<<<<<<< + * ARES_ENOTIMP = cares.ARES_ENOTIMP + * ARES_EREFUSED = cares.ARES_EREFUSED + */ + __pyx_t_2 = __Pyx_PyInt_From_int(ARES_ENOTFOUND); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 71, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARES_ENOTFOUND, __pyx_t_2) < 0) __PYX_ERR(0, 71, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "gevent/resolver/cares.pyx":72 + * ARES_ESERVFAIL = cares.ARES_ESERVFAIL + * ARES_ENOTFOUND = cares.ARES_ENOTFOUND + * ARES_ENOTIMP = cares.ARES_ENOTIMP # <<<<<<<<<<<<<< + * ARES_EREFUSED = cares.ARES_EREFUSED + * ARES_EBADQUERY = cares.ARES_EBADQUERY + */ + __pyx_t_2 = __Pyx_PyInt_From_int(ARES_ENOTIMP); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 72, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARES_ENOTIMP, __pyx_t_2) < 0) __PYX_ERR(0, 72, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "gevent/resolver/cares.pyx":73 + * ARES_ENOTFOUND = cares.ARES_ENOTFOUND + * ARES_ENOTIMP = cares.ARES_ENOTIMP + * ARES_EREFUSED = cares.ARES_EREFUSED # <<<<<<<<<<<<<< + * ARES_EBADQUERY = cares.ARES_EBADQUERY + * ARES_EBADNAME = cares.ARES_EBADNAME + */ + __pyx_t_2 = __Pyx_PyInt_From_int(ARES_EREFUSED); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 73, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARES_EREFUSED, __pyx_t_2) < 0) __PYX_ERR(0, 73, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "gevent/resolver/cares.pyx":74 + * ARES_ENOTIMP = cares.ARES_ENOTIMP + * ARES_EREFUSED = cares.ARES_EREFUSED + * ARES_EBADQUERY = cares.ARES_EBADQUERY # <<<<<<<<<<<<<< + * ARES_EBADNAME = cares.ARES_EBADNAME + * ARES_EBADFAMILY = cares.ARES_EBADFAMILY + */ + __pyx_t_2 = __Pyx_PyInt_From_int(ARES_EBADQUERY); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 74, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARES_EBADQUERY, __pyx_t_2) < 0) __PYX_ERR(0, 74, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "gevent/resolver/cares.pyx":75 + * ARES_EREFUSED = cares.ARES_EREFUSED + * ARES_EBADQUERY = cares.ARES_EBADQUERY + * ARES_EBADNAME = cares.ARES_EBADNAME # <<<<<<<<<<<<<< + * ARES_EBADFAMILY = cares.ARES_EBADFAMILY + * ARES_EBADRESP = cares.ARES_EBADRESP + */ + __pyx_t_2 = __Pyx_PyInt_From_int(ARES_EBADNAME); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 75, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARES_EBADNAME, __pyx_t_2) < 0) __PYX_ERR(0, 75, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "gevent/resolver/cares.pyx":76 + * ARES_EBADQUERY = cares.ARES_EBADQUERY + * ARES_EBADNAME = cares.ARES_EBADNAME + * ARES_EBADFAMILY = cares.ARES_EBADFAMILY # <<<<<<<<<<<<<< + * ARES_EBADRESP = cares.ARES_EBADRESP + * ARES_ECONNREFUSED = cares.ARES_ECONNREFUSED + */ + __pyx_t_2 = __Pyx_PyInt_From_int(ARES_EBADFAMILY); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 76, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARES_EBADFAMILY, __pyx_t_2) < 0) __PYX_ERR(0, 76, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "gevent/resolver/cares.pyx":77 + * ARES_EBADNAME = cares.ARES_EBADNAME + * ARES_EBADFAMILY = cares.ARES_EBADFAMILY + * ARES_EBADRESP = cares.ARES_EBADRESP # <<<<<<<<<<<<<< + * ARES_ECONNREFUSED = cares.ARES_ECONNREFUSED + * ARES_ETIMEOUT = cares.ARES_ETIMEOUT + */ + __pyx_t_2 = __Pyx_PyInt_From_int(ARES_EBADRESP); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 77, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARES_EBADRESP, __pyx_t_2) < 0) __PYX_ERR(0, 77, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "gevent/resolver/cares.pyx":78 + * ARES_EBADFAMILY = cares.ARES_EBADFAMILY + * ARES_EBADRESP = cares.ARES_EBADRESP + * ARES_ECONNREFUSED = cares.ARES_ECONNREFUSED # <<<<<<<<<<<<<< + * ARES_ETIMEOUT = cares.ARES_ETIMEOUT + * ARES_EOF = cares.ARES_EOF + */ + __pyx_t_2 = __Pyx_PyInt_From_int(ARES_ECONNREFUSED); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 78, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARES_ECONNREFUSED, __pyx_t_2) < 0) __PYX_ERR(0, 78, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "gevent/resolver/cares.pyx":79 + * ARES_EBADRESP = cares.ARES_EBADRESP + * ARES_ECONNREFUSED = cares.ARES_ECONNREFUSED + * ARES_ETIMEOUT = cares.ARES_ETIMEOUT # <<<<<<<<<<<<<< + * ARES_EOF = cares.ARES_EOF + * ARES_EFILE = cares.ARES_EFILE + */ + __pyx_t_2 = __Pyx_PyInt_From_int(ARES_ETIMEOUT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 79, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARES_ETIMEOUT, __pyx_t_2) < 0) __PYX_ERR(0, 79, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "gevent/resolver/cares.pyx":80 + * ARES_ECONNREFUSED = cares.ARES_ECONNREFUSED + * ARES_ETIMEOUT = cares.ARES_ETIMEOUT + * ARES_EOF = cares.ARES_EOF # <<<<<<<<<<<<<< + * ARES_EFILE = cares.ARES_EFILE + * ARES_ENOMEM = cares.ARES_ENOMEM + */ + __pyx_t_2 = __Pyx_PyInt_From_int(ARES_EOF); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 80, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARES_EOF, __pyx_t_2) < 0) __PYX_ERR(0, 80, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "gevent/resolver/cares.pyx":81 + * ARES_ETIMEOUT = cares.ARES_ETIMEOUT + * ARES_EOF = cares.ARES_EOF + * ARES_EFILE = cares.ARES_EFILE # <<<<<<<<<<<<<< + * ARES_ENOMEM = cares.ARES_ENOMEM + * ARES_EDESTRUCTION = cares.ARES_EDESTRUCTION + */ + __pyx_t_2 = __Pyx_PyInt_From_int(ARES_EFILE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 81, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARES_EFILE, __pyx_t_2) < 0) __PYX_ERR(0, 81, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "gevent/resolver/cares.pyx":82 + * ARES_EOF = cares.ARES_EOF + * ARES_EFILE = cares.ARES_EFILE + * ARES_ENOMEM = cares.ARES_ENOMEM # <<<<<<<<<<<<<< + * ARES_EDESTRUCTION = cares.ARES_EDESTRUCTION + * ARES_EBADSTR = cares.ARES_EBADSTR + */ + __pyx_t_2 = __Pyx_PyInt_From_int(ARES_ENOMEM); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 82, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARES_ENOMEM, __pyx_t_2) < 0) __PYX_ERR(0, 82, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "gevent/resolver/cares.pyx":83 + * ARES_EFILE = cares.ARES_EFILE + * ARES_ENOMEM = cares.ARES_ENOMEM + * ARES_EDESTRUCTION = cares.ARES_EDESTRUCTION # <<<<<<<<<<<<<< + * ARES_EBADSTR = cares.ARES_EBADSTR + * ARES_EBADFLAGS = cares.ARES_EBADFLAGS + */ + __pyx_t_2 = __Pyx_PyInt_From_int(ARES_EDESTRUCTION); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 83, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARES_EDESTRUCTION, __pyx_t_2) < 0) __PYX_ERR(0, 83, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "gevent/resolver/cares.pyx":84 + * ARES_ENOMEM = cares.ARES_ENOMEM + * ARES_EDESTRUCTION = cares.ARES_EDESTRUCTION + * ARES_EBADSTR = cares.ARES_EBADSTR # <<<<<<<<<<<<<< + * ARES_EBADFLAGS = cares.ARES_EBADFLAGS + * ARES_ENONAME = cares.ARES_ENONAME + */ + __pyx_t_2 = __Pyx_PyInt_From_int(ARES_EBADSTR); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 84, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARES_EBADSTR, __pyx_t_2) < 0) __PYX_ERR(0, 84, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "gevent/resolver/cares.pyx":85 + * ARES_EDESTRUCTION = cares.ARES_EDESTRUCTION + * ARES_EBADSTR = cares.ARES_EBADSTR + * ARES_EBADFLAGS = cares.ARES_EBADFLAGS # <<<<<<<<<<<<<< + * ARES_ENONAME = cares.ARES_ENONAME + * ARES_EBADHINTS = cares.ARES_EBADHINTS + */ + __pyx_t_2 = __Pyx_PyInt_From_int(ARES_EBADFLAGS); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 85, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARES_EBADFLAGS, __pyx_t_2) < 0) __PYX_ERR(0, 85, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "gevent/resolver/cares.pyx":86 + * ARES_EBADSTR = cares.ARES_EBADSTR + * ARES_EBADFLAGS = cares.ARES_EBADFLAGS + * ARES_ENONAME = cares.ARES_ENONAME # <<<<<<<<<<<<<< + * ARES_EBADHINTS = cares.ARES_EBADHINTS + * ARES_ENOTINITIALIZED = cares.ARES_ENOTINITIALIZED + */ + __pyx_t_2 = __Pyx_PyInt_From_int(ARES_ENONAME); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 86, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARES_ENONAME, __pyx_t_2) < 0) __PYX_ERR(0, 86, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "gevent/resolver/cares.pyx":87 + * ARES_EBADFLAGS = cares.ARES_EBADFLAGS + * ARES_ENONAME = cares.ARES_ENONAME + * ARES_EBADHINTS = cares.ARES_EBADHINTS # <<<<<<<<<<<<<< + * ARES_ENOTINITIALIZED = cares.ARES_ENOTINITIALIZED + * ARES_ELOADIPHLPAPI = cares.ARES_ELOADIPHLPAPI + */ + __pyx_t_2 = __Pyx_PyInt_From_int(ARES_EBADHINTS); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 87, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARES_EBADHINTS, __pyx_t_2) < 0) __PYX_ERR(0, 87, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "gevent/resolver/cares.pyx":88 + * ARES_ENONAME = cares.ARES_ENONAME + * ARES_EBADHINTS = cares.ARES_EBADHINTS + * ARES_ENOTINITIALIZED = cares.ARES_ENOTINITIALIZED # <<<<<<<<<<<<<< + * ARES_ELOADIPHLPAPI = cares.ARES_ELOADIPHLPAPI + * ARES_EADDRGETNETWORKPARAMS = cares.ARES_EADDRGETNETWORKPARAMS + */ + __pyx_t_2 = __Pyx_PyInt_From_int(ARES_ENOTINITIALIZED); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 88, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARES_ENOTINITIALIZED, __pyx_t_2) < 0) __PYX_ERR(0, 88, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "gevent/resolver/cares.pyx":89 + * ARES_EBADHINTS = cares.ARES_EBADHINTS + * ARES_ENOTINITIALIZED = cares.ARES_ENOTINITIALIZED + * ARES_ELOADIPHLPAPI = cares.ARES_ELOADIPHLPAPI # <<<<<<<<<<<<<< + * ARES_EADDRGETNETWORKPARAMS = cares.ARES_EADDRGETNETWORKPARAMS + * ARES_ECANCELLED = cares.ARES_ECANCELLED + */ + __pyx_t_2 = __Pyx_PyInt_From_int(ARES_ELOADIPHLPAPI); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 89, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARES_ELOADIPHLPAPI, __pyx_t_2) < 0) __PYX_ERR(0, 89, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "gevent/resolver/cares.pyx":90 + * ARES_ENOTINITIALIZED = cares.ARES_ENOTINITIALIZED + * ARES_ELOADIPHLPAPI = cares.ARES_ELOADIPHLPAPI + * ARES_EADDRGETNETWORKPARAMS = cares.ARES_EADDRGETNETWORKPARAMS # <<<<<<<<<<<<<< + * ARES_ECANCELLED = cares.ARES_ECANCELLED + * + */ + __pyx_t_2 = __Pyx_PyInt_From_int(ARES_EADDRGETNETWORKPARAMS); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 90, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARES_EADDRGETNETWORKPARAMS, __pyx_t_2) < 0) __PYX_ERR(0, 90, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "gevent/resolver/cares.pyx":91 + * ARES_ELOADIPHLPAPI = cares.ARES_ELOADIPHLPAPI + * ARES_EADDRGETNETWORKPARAMS = cares.ARES_EADDRGETNETWORKPARAMS + * ARES_ECANCELLED = cares.ARES_ECANCELLED # <<<<<<<<<<<<<< + * + * ARES_FLAG_USEVC = cares.ARES_FLAG_USEVC + */ + __pyx_t_2 = __Pyx_PyInt_From_int(ARES_ECANCELLED); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 91, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARES_ECANCELLED, __pyx_t_2) < 0) __PYX_ERR(0, 91, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "gevent/resolver/cares.pyx":93 + * ARES_ECANCELLED = cares.ARES_ECANCELLED + * + * ARES_FLAG_USEVC = cares.ARES_FLAG_USEVC # <<<<<<<<<<<<<< + * ARES_FLAG_PRIMARY = cares.ARES_FLAG_PRIMARY + * ARES_FLAG_IGNTC = cares.ARES_FLAG_IGNTC + */ + __pyx_t_2 = __Pyx_PyInt_From_int(ARES_FLAG_USEVC); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 93, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARES_FLAG_USEVC, __pyx_t_2) < 0) __PYX_ERR(0, 93, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "gevent/resolver/cares.pyx":94 + * + * ARES_FLAG_USEVC = cares.ARES_FLAG_USEVC + * ARES_FLAG_PRIMARY = cares.ARES_FLAG_PRIMARY # <<<<<<<<<<<<<< + * ARES_FLAG_IGNTC = cares.ARES_FLAG_IGNTC + * ARES_FLAG_NORECURSE = cares.ARES_FLAG_NORECURSE + */ + __pyx_t_2 = __Pyx_PyInt_From_int(ARES_FLAG_PRIMARY); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 94, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARES_FLAG_PRIMARY, __pyx_t_2) < 0) __PYX_ERR(0, 94, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "gevent/resolver/cares.pyx":95 + * ARES_FLAG_USEVC = cares.ARES_FLAG_USEVC + * ARES_FLAG_PRIMARY = cares.ARES_FLAG_PRIMARY + * ARES_FLAG_IGNTC = cares.ARES_FLAG_IGNTC # <<<<<<<<<<<<<< + * ARES_FLAG_NORECURSE = cares.ARES_FLAG_NORECURSE + * ARES_FLAG_STAYOPEN = cares.ARES_FLAG_STAYOPEN + */ + __pyx_t_2 = __Pyx_PyInt_From_int(ARES_FLAG_IGNTC); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 95, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARES_FLAG_IGNTC, __pyx_t_2) < 0) __PYX_ERR(0, 95, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "gevent/resolver/cares.pyx":96 + * ARES_FLAG_PRIMARY = cares.ARES_FLAG_PRIMARY + * ARES_FLAG_IGNTC = cares.ARES_FLAG_IGNTC + * ARES_FLAG_NORECURSE = cares.ARES_FLAG_NORECURSE # <<<<<<<<<<<<<< + * ARES_FLAG_STAYOPEN = cares.ARES_FLAG_STAYOPEN + * ARES_FLAG_NOSEARCH = cares.ARES_FLAG_NOSEARCH + */ + __pyx_t_2 = __Pyx_PyInt_From_int(ARES_FLAG_NORECURSE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 96, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARES_FLAG_NORECURSE, __pyx_t_2) < 0) __PYX_ERR(0, 96, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "gevent/resolver/cares.pyx":97 + * ARES_FLAG_IGNTC = cares.ARES_FLAG_IGNTC + * ARES_FLAG_NORECURSE = cares.ARES_FLAG_NORECURSE + * ARES_FLAG_STAYOPEN = cares.ARES_FLAG_STAYOPEN # <<<<<<<<<<<<<< + * ARES_FLAG_NOSEARCH = cares.ARES_FLAG_NOSEARCH + * ARES_FLAG_NOALIASES = cares.ARES_FLAG_NOALIASES + */ + __pyx_t_2 = __Pyx_PyInt_From_int(ARES_FLAG_STAYOPEN); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 97, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARES_FLAG_STAYOPEN, __pyx_t_2) < 0) __PYX_ERR(0, 97, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "gevent/resolver/cares.pyx":98 + * ARES_FLAG_NORECURSE = cares.ARES_FLAG_NORECURSE + * ARES_FLAG_STAYOPEN = cares.ARES_FLAG_STAYOPEN + * ARES_FLAG_NOSEARCH = cares.ARES_FLAG_NOSEARCH # <<<<<<<<<<<<<< + * ARES_FLAG_NOALIASES = cares.ARES_FLAG_NOALIASES + * ARES_FLAG_NOCHECKRESP = cares.ARES_FLAG_NOCHECKRESP + */ + __pyx_t_2 = __Pyx_PyInt_From_int(ARES_FLAG_NOSEARCH); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 98, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARES_FLAG_NOSEARCH, __pyx_t_2) < 0) __PYX_ERR(0, 98, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "gevent/resolver/cares.pyx":99 + * ARES_FLAG_STAYOPEN = cares.ARES_FLAG_STAYOPEN + * ARES_FLAG_NOSEARCH = cares.ARES_FLAG_NOSEARCH + * ARES_FLAG_NOALIASES = cares.ARES_FLAG_NOALIASES # <<<<<<<<<<<<<< + * ARES_FLAG_NOCHECKRESP = cares.ARES_FLAG_NOCHECKRESP + * + */ + __pyx_t_2 = __Pyx_PyInt_From_int(ARES_FLAG_NOALIASES); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 99, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARES_FLAG_NOALIASES, __pyx_t_2) < 0) __PYX_ERR(0, 99, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "gevent/resolver/cares.pyx":100 + * ARES_FLAG_NOSEARCH = cares.ARES_FLAG_NOSEARCH + * ARES_FLAG_NOALIASES = cares.ARES_FLAG_NOALIASES + * ARES_FLAG_NOCHECKRESP = cares.ARES_FLAG_NOCHECKRESP # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_2 = __Pyx_PyInt_From_int(ARES_FLAG_NOCHECKRESP); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 100, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARES_FLAG_NOCHECKRESP, __pyx_t_2) < 0) __PYX_ERR(0, 100, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "gevent/resolver/cares.pyx":104 + * + * _ares_errors = dict([ + * (cares.ARES_SUCCESS, 'ARES_SUCCESS'), # <<<<<<<<<<<<<< + * (cares.ARES_ENODATA, 'ARES_ENODATA'), + * (cares.ARES_EFORMERR, 'ARES_EFORMERR'), + */ + __pyx_t_2 = __Pyx_PyInt_From_int(ARES_SUCCESS); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 104, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 104, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); + __Pyx_INCREF(__pyx_n_s_ARES_SUCCESS); + __Pyx_GIVEREF(__pyx_n_s_ARES_SUCCESS); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_ARES_SUCCESS); + __pyx_t_2 = 0; + + /* "gevent/resolver/cares.pyx":105 + * _ares_errors = dict([ + * (cares.ARES_SUCCESS, 'ARES_SUCCESS'), + * (cares.ARES_ENODATA, 'ARES_ENODATA'), # <<<<<<<<<<<<<< + * (cares.ARES_EFORMERR, 'ARES_EFORMERR'), + * (cares.ARES_ESERVFAIL, 'ARES_ESERVFAIL'), + */ + __pyx_t_2 = __Pyx_PyInt_From_int(ARES_ENODATA); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 105, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 105, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_INCREF(__pyx_n_s_ARES_ENODATA); + __Pyx_GIVEREF(__pyx_n_s_ARES_ENODATA); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_n_s_ARES_ENODATA); + __pyx_t_2 = 0; + + /* "gevent/resolver/cares.pyx":106 + * (cares.ARES_SUCCESS, 'ARES_SUCCESS'), + * (cares.ARES_ENODATA, 'ARES_ENODATA'), + * (cares.ARES_EFORMERR, 'ARES_EFORMERR'), # <<<<<<<<<<<<<< + * (cares.ARES_ESERVFAIL, 'ARES_ESERVFAIL'), + * (cares.ARES_ENOTFOUND, 'ARES_ENOTFOUND'), + */ + __pyx_t_2 = __Pyx_PyInt_From_int(ARES_EFORMERR); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 106, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 106, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); + __Pyx_INCREF(__pyx_n_s_ARES_EFORMERR); + __Pyx_GIVEREF(__pyx_n_s_ARES_EFORMERR); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_n_s_ARES_EFORMERR); + __pyx_t_2 = 0; + + /* "gevent/resolver/cares.pyx":107 + * (cares.ARES_ENODATA, 'ARES_ENODATA'), + * (cares.ARES_EFORMERR, 'ARES_EFORMERR'), + * (cares.ARES_ESERVFAIL, 'ARES_ESERVFAIL'), # <<<<<<<<<<<<<< + * (cares.ARES_ENOTFOUND, 'ARES_ENOTFOUND'), + * (cares.ARES_ENOTIMP, 'ARES_ENOTIMP'), + */ + __pyx_t_2 = __Pyx_PyInt_From_int(ARES_ESERVFAIL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 107, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 107, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); + __Pyx_INCREF(__pyx_n_s_ARES_ESERVFAIL); + __Pyx_GIVEREF(__pyx_n_s_ARES_ESERVFAIL); + PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_n_s_ARES_ESERVFAIL); + __pyx_t_2 = 0; + + /* "gevent/resolver/cares.pyx":108 + * (cares.ARES_EFORMERR, 'ARES_EFORMERR'), + * (cares.ARES_ESERVFAIL, 'ARES_ESERVFAIL'), + * (cares.ARES_ENOTFOUND, 'ARES_ENOTFOUND'), # <<<<<<<<<<<<<< + * (cares.ARES_ENOTIMP, 'ARES_ENOTIMP'), + * (cares.ARES_EREFUSED, 'ARES_EREFUSED'), + */ + __pyx_t_2 = __Pyx_PyInt_From_int(ARES_ENOTFOUND); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 108, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 108, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2); + __Pyx_INCREF(__pyx_n_s_ARES_ENOTFOUND); + __Pyx_GIVEREF(__pyx_n_s_ARES_ENOTFOUND); + PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_n_s_ARES_ENOTFOUND); + __pyx_t_2 = 0; + + /* "gevent/resolver/cares.pyx":109 + * (cares.ARES_ESERVFAIL, 'ARES_ESERVFAIL'), + * (cares.ARES_ENOTFOUND, 'ARES_ENOTFOUND'), + * (cares.ARES_ENOTIMP, 'ARES_ENOTIMP'), # <<<<<<<<<<<<<< + * (cares.ARES_EREFUSED, 'ARES_EREFUSED'), + * (cares.ARES_EBADQUERY, 'ARES_EBADQUERY'), + */ + __pyx_t_2 = __Pyx_PyInt_From_int(ARES_ENOTIMP); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 109, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 109, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_2); + __Pyx_INCREF(__pyx_n_s_ARES_ENOTIMP); + __Pyx_GIVEREF(__pyx_n_s_ARES_ENOTIMP); + PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_n_s_ARES_ENOTIMP); + __pyx_t_2 = 0; + + /* "gevent/resolver/cares.pyx":110 + * (cares.ARES_ENOTFOUND, 'ARES_ENOTFOUND'), + * (cares.ARES_ENOTIMP, 'ARES_ENOTIMP'), + * (cares.ARES_EREFUSED, 'ARES_EREFUSED'), # <<<<<<<<<<<<<< + * (cares.ARES_EBADQUERY, 'ARES_EBADQUERY'), + * (cares.ARES_EBADNAME, 'ARES_EBADNAME'), + */ + __pyx_t_2 = __Pyx_PyInt_From_int(ARES_EREFUSED); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 110, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 110, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_2); + __Pyx_INCREF(__pyx_n_s_ARES_EREFUSED); + __Pyx_GIVEREF(__pyx_n_s_ARES_EREFUSED); + PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_n_s_ARES_EREFUSED); + __pyx_t_2 = 0; + + /* "gevent/resolver/cares.pyx":111 + * (cares.ARES_ENOTIMP, 'ARES_ENOTIMP'), + * (cares.ARES_EREFUSED, 'ARES_EREFUSED'), + * (cares.ARES_EBADQUERY, 'ARES_EBADQUERY'), # <<<<<<<<<<<<<< + * (cares.ARES_EBADNAME, 'ARES_EBADNAME'), + * (cares.ARES_EBADFAMILY, 'ARES_EBADFAMILY'), + */ + __pyx_t_2 = __Pyx_PyInt_From_int(ARES_EBADQUERY); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 111, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 111, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_2); + __Pyx_INCREF(__pyx_n_s_ARES_EBADQUERY); + __Pyx_GIVEREF(__pyx_n_s_ARES_EBADQUERY); + PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_n_s_ARES_EBADQUERY); + __pyx_t_2 = 0; + + /* "gevent/resolver/cares.pyx":112 + * (cares.ARES_EREFUSED, 'ARES_EREFUSED'), + * (cares.ARES_EBADQUERY, 'ARES_EBADQUERY'), + * (cares.ARES_EBADNAME, 'ARES_EBADNAME'), # <<<<<<<<<<<<<< + * (cares.ARES_EBADFAMILY, 'ARES_EBADFAMILY'), + * (cares.ARES_EBADRESP, 'ARES_EBADRESP'), + */ + __pyx_t_2 = __Pyx_PyInt_From_int(ARES_EBADNAME); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 112, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 112, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_2); + __Pyx_INCREF(__pyx_n_s_ARES_EBADNAME); + __Pyx_GIVEREF(__pyx_n_s_ARES_EBADNAME); + PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_n_s_ARES_EBADNAME); + __pyx_t_2 = 0; + + /* "gevent/resolver/cares.pyx":113 + * (cares.ARES_EBADQUERY, 'ARES_EBADQUERY'), + * (cares.ARES_EBADNAME, 'ARES_EBADNAME'), + * (cares.ARES_EBADFAMILY, 'ARES_EBADFAMILY'), # <<<<<<<<<<<<<< + * (cares.ARES_EBADRESP, 'ARES_EBADRESP'), + * (cares.ARES_ECONNREFUSED, 'ARES_ECONNREFUSED'), + */ + __pyx_t_2 = __Pyx_PyInt_From_int(ARES_EBADFAMILY); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 113, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 113, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_2); + __Pyx_INCREF(__pyx_n_s_ARES_EBADFAMILY); + __Pyx_GIVEREF(__pyx_n_s_ARES_EBADFAMILY); + PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_n_s_ARES_EBADFAMILY); + __pyx_t_2 = 0; + + /* "gevent/resolver/cares.pyx":114 + * (cares.ARES_EBADNAME, 'ARES_EBADNAME'), + * (cares.ARES_EBADFAMILY, 'ARES_EBADFAMILY'), + * (cares.ARES_EBADRESP, 'ARES_EBADRESP'), # <<<<<<<<<<<<<< + * (cares.ARES_ECONNREFUSED, 'ARES_ECONNREFUSED'), + * (cares.ARES_ETIMEOUT, 'ARES_ETIMEOUT'), + */ + __pyx_t_2 = __Pyx_PyInt_From_int(ARES_EBADRESP); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 114, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_13 = PyTuple_New(2); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 114, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_2); + __Pyx_INCREF(__pyx_n_s_ARES_EBADRESP); + __Pyx_GIVEREF(__pyx_n_s_ARES_EBADRESP); + PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_n_s_ARES_EBADRESP); + __pyx_t_2 = 0; + + /* "gevent/resolver/cares.pyx":115 + * (cares.ARES_EBADFAMILY, 'ARES_EBADFAMILY'), + * (cares.ARES_EBADRESP, 'ARES_EBADRESP'), + * (cares.ARES_ECONNREFUSED, 'ARES_ECONNREFUSED'), # <<<<<<<<<<<<<< + * (cares.ARES_ETIMEOUT, 'ARES_ETIMEOUT'), + * (cares.ARES_EOF, 'ARES_EOF'), + */ + __pyx_t_2 = __Pyx_PyInt_From_int(ARES_ECONNREFUSED); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 115, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_14 = PyTuple_New(2); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 115, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_14); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_2); + __Pyx_INCREF(__pyx_n_s_ARES_ECONNREFUSED); + __Pyx_GIVEREF(__pyx_n_s_ARES_ECONNREFUSED); + PyTuple_SET_ITEM(__pyx_t_14, 1, __pyx_n_s_ARES_ECONNREFUSED); + __pyx_t_2 = 0; + + /* "gevent/resolver/cares.pyx":116 + * (cares.ARES_EBADRESP, 'ARES_EBADRESP'), + * (cares.ARES_ECONNREFUSED, 'ARES_ECONNREFUSED'), + * (cares.ARES_ETIMEOUT, 'ARES_ETIMEOUT'), # <<<<<<<<<<<<<< + * (cares.ARES_EOF, 'ARES_EOF'), + * (cares.ARES_EFILE, 'ARES_EFILE'), + */ + __pyx_t_2 = __Pyx_PyInt_From_int(ARES_ETIMEOUT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 116, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_15 = PyTuple_New(2); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 116, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_15); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_2); + __Pyx_INCREF(__pyx_n_s_ARES_ETIMEOUT); + __Pyx_GIVEREF(__pyx_n_s_ARES_ETIMEOUT); + PyTuple_SET_ITEM(__pyx_t_15, 1, __pyx_n_s_ARES_ETIMEOUT); + __pyx_t_2 = 0; + + /* "gevent/resolver/cares.pyx":117 + * (cares.ARES_ECONNREFUSED, 'ARES_ECONNREFUSED'), + * (cares.ARES_ETIMEOUT, 'ARES_ETIMEOUT'), + * (cares.ARES_EOF, 'ARES_EOF'), # <<<<<<<<<<<<<< + * (cares.ARES_EFILE, 'ARES_EFILE'), + * (cares.ARES_ENOMEM, 'ARES_ENOMEM'), + */ + __pyx_t_2 = __Pyx_PyInt_From_int(ARES_EOF); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 117, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_16 = PyTuple_New(2); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 117, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_16); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_2); + __Pyx_INCREF(__pyx_n_s_ARES_EOF); + __Pyx_GIVEREF(__pyx_n_s_ARES_EOF); + PyTuple_SET_ITEM(__pyx_t_16, 1, __pyx_n_s_ARES_EOF); + __pyx_t_2 = 0; + + /* "gevent/resolver/cares.pyx":118 + * (cares.ARES_ETIMEOUT, 'ARES_ETIMEOUT'), + * (cares.ARES_EOF, 'ARES_EOF'), + * (cares.ARES_EFILE, 'ARES_EFILE'), # <<<<<<<<<<<<<< + * (cares.ARES_ENOMEM, 'ARES_ENOMEM'), + * (cares.ARES_EDESTRUCTION, 'ARES_EDESTRUCTION'), + */ + __pyx_t_2 = __Pyx_PyInt_From_int(ARES_EFILE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 118, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_17 = PyTuple_New(2); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 118, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_17); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_2); + __Pyx_INCREF(__pyx_n_s_ARES_EFILE); + __Pyx_GIVEREF(__pyx_n_s_ARES_EFILE); + PyTuple_SET_ITEM(__pyx_t_17, 1, __pyx_n_s_ARES_EFILE); + __pyx_t_2 = 0; + + /* "gevent/resolver/cares.pyx":119 + * (cares.ARES_EOF, 'ARES_EOF'), + * (cares.ARES_EFILE, 'ARES_EFILE'), + * (cares.ARES_ENOMEM, 'ARES_ENOMEM'), # <<<<<<<<<<<<<< + * (cares.ARES_EDESTRUCTION, 'ARES_EDESTRUCTION'), + * (cares.ARES_EBADSTR, 'ARES_EBADSTR'), + */ + __pyx_t_2 = __Pyx_PyInt_From_int(ARES_ENOMEM); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 119, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_18 = PyTuple_New(2); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 119, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_18); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_18, 0, __pyx_t_2); + __Pyx_INCREF(__pyx_n_s_ARES_ENOMEM); + __Pyx_GIVEREF(__pyx_n_s_ARES_ENOMEM); + PyTuple_SET_ITEM(__pyx_t_18, 1, __pyx_n_s_ARES_ENOMEM); + __pyx_t_2 = 0; + + /* "gevent/resolver/cares.pyx":120 + * (cares.ARES_EFILE, 'ARES_EFILE'), + * (cares.ARES_ENOMEM, 'ARES_ENOMEM'), + * (cares.ARES_EDESTRUCTION, 'ARES_EDESTRUCTION'), # <<<<<<<<<<<<<< + * (cares.ARES_EBADSTR, 'ARES_EBADSTR'), + * (cares.ARES_EBADFLAGS, 'ARES_EBADFLAGS'), + */ + __pyx_t_2 = __Pyx_PyInt_From_int(ARES_EDESTRUCTION); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 120, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_19 = PyTuple_New(2); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 120, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_19); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_t_2); + __Pyx_INCREF(__pyx_n_s_ARES_EDESTRUCTION); + __Pyx_GIVEREF(__pyx_n_s_ARES_EDESTRUCTION); + PyTuple_SET_ITEM(__pyx_t_19, 1, __pyx_n_s_ARES_EDESTRUCTION); + __pyx_t_2 = 0; + + /* "gevent/resolver/cares.pyx":121 + * (cares.ARES_ENOMEM, 'ARES_ENOMEM'), + * (cares.ARES_EDESTRUCTION, 'ARES_EDESTRUCTION'), + * (cares.ARES_EBADSTR, 'ARES_EBADSTR'), # <<<<<<<<<<<<<< + * (cares.ARES_EBADFLAGS, 'ARES_EBADFLAGS'), + * (cares.ARES_ENONAME, 'ARES_ENONAME'), + */ + __pyx_t_2 = __Pyx_PyInt_From_int(ARES_EBADSTR); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 121, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_20 = PyTuple_New(2); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 121, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_20); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_t_2); + __Pyx_INCREF(__pyx_n_s_ARES_EBADSTR); + __Pyx_GIVEREF(__pyx_n_s_ARES_EBADSTR); + PyTuple_SET_ITEM(__pyx_t_20, 1, __pyx_n_s_ARES_EBADSTR); + __pyx_t_2 = 0; + + /* "gevent/resolver/cares.pyx":122 + * (cares.ARES_EDESTRUCTION, 'ARES_EDESTRUCTION'), + * (cares.ARES_EBADSTR, 'ARES_EBADSTR'), + * (cares.ARES_EBADFLAGS, 'ARES_EBADFLAGS'), # <<<<<<<<<<<<<< + * (cares.ARES_ENONAME, 'ARES_ENONAME'), + * (cares.ARES_EBADHINTS, 'ARES_EBADHINTS'), + */ + __pyx_t_2 = __Pyx_PyInt_From_int(ARES_EBADFLAGS); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 122, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_21 = PyTuple_New(2); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 122, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_21); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_21, 0, __pyx_t_2); + __Pyx_INCREF(__pyx_n_s_ARES_EBADFLAGS); + __Pyx_GIVEREF(__pyx_n_s_ARES_EBADFLAGS); + PyTuple_SET_ITEM(__pyx_t_21, 1, __pyx_n_s_ARES_EBADFLAGS); + __pyx_t_2 = 0; + + /* "gevent/resolver/cares.pyx":123 + * (cares.ARES_EBADSTR, 'ARES_EBADSTR'), + * (cares.ARES_EBADFLAGS, 'ARES_EBADFLAGS'), + * (cares.ARES_ENONAME, 'ARES_ENONAME'), # <<<<<<<<<<<<<< + * (cares.ARES_EBADHINTS, 'ARES_EBADHINTS'), + * (cares.ARES_ENOTINITIALIZED, 'ARES_ENOTINITIALIZED'), + */ + __pyx_t_2 = __Pyx_PyInt_From_int(ARES_ENONAME); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 123, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_22 = PyTuple_New(2); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 123, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_22); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_22, 0, __pyx_t_2); + __Pyx_INCREF(__pyx_n_s_ARES_ENONAME); + __Pyx_GIVEREF(__pyx_n_s_ARES_ENONAME); + PyTuple_SET_ITEM(__pyx_t_22, 1, __pyx_n_s_ARES_ENONAME); + __pyx_t_2 = 0; + + /* "gevent/resolver/cares.pyx":124 + * (cares.ARES_EBADFLAGS, 'ARES_EBADFLAGS'), + * (cares.ARES_ENONAME, 'ARES_ENONAME'), + * (cares.ARES_EBADHINTS, 'ARES_EBADHINTS'), # <<<<<<<<<<<<<< + * (cares.ARES_ENOTINITIALIZED, 'ARES_ENOTINITIALIZED'), + * (cares.ARES_ELOADIPHLPAPI, 'ARES_ELOADIPHLPAPI'), + */ + __pyx_t_2 = __Pyx_PyInt_From_int(ARES_EBADHINTS); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 124, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_23 = PyTuple_New(2); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 124, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_23); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_23, 0, __pyx_t_2); + __Pyx_INCREF(__pyx_n_s_ARES_EBADHINTS); + __Pyx_GIVEREF(__pyx_n_s_ARES_EBADHINTS); + PyTuple_SET_ITEM(__pyx_t_23, 1, __pyx_n_s_ARES_EBADHINTS); + __pyx_t_2 = 0; + + /* "gevent/resolver/cares.pyx":125 + * (cares.ARES_ENONAME, 'ARES_ENONAME'), + * (cares.ARES_EBADHINTS, 'ARES_EBADHINTS'), + * (cares.ARES_ENOTINITIALIZED, 'ARES_ENOTINITIALIZED'), # <<<<<<<<<<<<<< + * (cares.ARES_ELOADIPHLPAPI, 'ARES_ELOADIPHLPAPI'), + * (cares.ARES_EADDRGETNETWORKPARAMS, 'ARES_EADDRGETNETWORKPARAMS'), + */ + __pyx_t_2 = __Pyx_PyInt_From_int(ARES_ENOTINITIALIZED); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 125, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_24 = PyTuple_New(2); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 125, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_24); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_24, 0, __pyx_t_2); + __Pyx_INCREF(__pyx_n_s_ARES_ENOTINITIALIZED); + __Pyx_GIVEREF(__pyx_n_s_ARES_ENOTINITIALIZED); + PyTuple_SET_ITEM(__pyx_t_24, 1, __pyx_n_s_ARES_ENOTINITIALIZED); + __pyx_t_2 = 0; + + /* "gevent/resolver/cares.pyx":126 + * (cares.ARES_EBADHINTS, 'ARES_EBADHINTS'), + * (cares.ARES_ENOTINITIALIZED, 'ARES_ENOTINITIALIZED'), + * (cares.ARES_ELOADIPHLPAPI, 'ARES_ELOADIPHLPAPI'), # <<<<<<<<<<<<<< + * (cares.ARES_EADDRGETNETWORKPARAMS, 'ARES_EADDRGETNETWORKPARAMS'), + * (cares.ARES_ECANCELLED, 'ARES_ECANCELLED')]) + */ + __pyx_t_2 = __Pyx_PyInt_From_int(ARES_ELOADIPHLPAPI); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 126, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_25 = PyTuple_New(2); if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 126, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_25); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_25, 0, __pyx_t_2); + __Pyx_INCREF(__pyx_n_s_ARES_ELOADIPHLPAPI); + __Pyx_GIVEREF(__pyx_n_s_ARES_ELOADIPHLPAPI); + PyTuple_SET_ITEM(__pyx_t_25, 1, __pyx_n_s_ARES_ELOADIPHLPAPI); + __pyx_t_2 = 0; + + /* "gevent/resolver/cares.pyx":127 + * (cares.ARES_ENOTINITIALIZED, 'ARES_ENOTINITIALIZED'), + * (cares.ARES_ELOADIPHLPAPI, 'ARES_ELOADIPHLPAPI'), + * (cares.ARES_EADDRGETNETWORKPARAMS, 'ARES_EADDRGETNETWORKPARAMS'), # <<<<<<<<<<<<<< + * (cares.ARES_ECANCELLED, 'ARES_ECANCELLED')]) + * + */ + __pyx_t_2 = __Pyx_PyInt_From_int(ARES_EADDRGETNETWORKPARAMS); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 127, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_26 = PyTuple_New(2); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 127, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_26); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_26, 0, __pyx_t_2); + __Pyx_INCREF(__pyx_n_s_ARES_EADDRGETNETWORKPARAMS); + __Pyx_GIVEREF(__pyx_n_s_ARES_EADDRGETNETWORKPARAMS); + PyTuple_SET_ITEM(__pyx_t_26, 1, __pyx_n_s_ARES_EADDRGETNETWORKPARAMS); + __pyx_t_2 = 0; + + /* "gevent/resolver/cares.pyx":128 + * (cares.ARES_ELOADIPHLPAPI, 'ARES_ELOADIPHLPAPI'), + * (cares.ARES_EADDRGETNETWORKPARAMS, 'ARES_EADDRGETNETWORKPARAMS'), + * (cares.ARES_ECANCELLED, 'ARES_ECANCELLED')]) # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_2 = __Pyx_PyInt_From_int(ARES_ECANCELLED); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 128, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_27 = PyTuple_New(2); if (unlikely(!__pyx_t_27)) __PYX_ERR(0, 128, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_27); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_27, 0, __pyx_t_2); + __Pyx_INCREF(__pyx_n_s_ARES_ECANCELLED); + __Pyx_GIVEREF(__pyx_n_s_ARES_ECANCELLED); + PyTuple_SET_ITEM(__pyx_t_27, 1, __pyx_n_s_ARES_ECANCELLED); + __pyx_t_2 = 0; + + /* "gevent/resolver/cares.pyx":103 + * + * + * _ares_errors = dict([ # <<<<<<<<<<<<<< + * (cares.ARES_SUCCESS, 'ARES_SUCCESS'), + * (cares.ARES_ENODATA, 'ARES_ENODATA'), + */ + __pyx_t_2 = PyList_New(25); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 103, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_1); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_4); + PyList_SET_ITEM(__pyx_t_2, 1, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_5); + PyList_SET_ITEM(__pyx_t_2, 2, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_6); + PyList_SET_ITEM(__pyx_t_2, 3, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_7); + PyList_SET_ITEM(__pyx_t_2, 4, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_8); + PyList_SET_ITEM(__pyx_t_2, 5, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_9); + PyList_SET_ITEM(__pyx_t_2, 6, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_10); + PyList_SET_ITEM(__pyx_t_2, 7, __pyx_t_10); + __Pyx_GIVEREF(__pyx_t_11); + PyList_SET_ITEM(__pyx_t_2, 8, __pyx_t_11); + __Pyx_GIVEREF(__pyx_t_12); + PyList_SET_ITEM(__pyx_t_2, 9, __pyx_t_12); + __Pyx_GIVEREF(__pyx_t_13); + PyList_SET_ITEM(__pyx_t_2, 10, __pyx_t_13); + __Pyx_GIVEREF(__pyx_t_14); + PyList_SET_ITEM(__pyx_t_2, 11, __pyx_t_14); + __Pyx_GIVEREF(__pyx_t_15); + PyList_SET_ITEM(__pyx_t_2, 12, __pyx_t_15); + __Pyx_GIVEREF(__pyx_t_16); + PyList_SET_ITEM(__pyx_t_2, 13, __pyx_t_16); + __Pyx_GIVEREF(__pyx_t_17); + PyList_SET_ITEM(__pyx_t_2, 14, __pyx_t_17); + __Pyx_GIVEREF(__pyx_t_18); + PyList_SET_ITEM(__pyx_t_2, 15, __pyx_t_18); + __Pyx_GIVEREF(__pyx_t_19); + PyList_SET_ITEM(__pyx_t_2, 16, __pyx_t_19); + __Pyx_GIVEREF(__pyx_t_20); + PyList_SET_ITEM(__pyx_t_2, 17, __pyx_t_20); + __Pyx_GIVEREF(__pyx_t_21); + PyList_SET_ITEM(__pyx_t_2, 18, __pyx_t_21); + __Pyx_GIVEREF(__pyx_t_22); + PyList_SET_ITEM(__pyx_t_2, 19, __pyx_t_22); + __Pyx_GIVEREF(__pyx_t_23); + PyList_SET_ITEM(__pyx_t_2, 20, __pyx_t_23); + __Pyx_GIVEREF(__pyx_t_24); + PyList_SET_ITEM(__pyx_t_2, 21, __pyx_t_24); + __Pyx_GIVEREF(__pyx_t_25); + PyList_SET_ITEM(__pyx_t_2, 22, __pyx_t_25); + __Pyx_GIVEREF(__pyx_t_26); + PyList_SET_ITEM(__pyx_t_2, 23, __pyx_t_26); + __Pyx_GIVEREF(__pyx_t_27); + PyList_SET_ITEM(__pyx_t_2, 24, __pyx_t_27); + __pyx_t_1 = 0; + __pyx_t_4 = 0; + __pyx_t_5 = 0; + __pyx_t_6 = 0; + __pyx_t_7 = 0; + __pyx_t_8 = 0; + __pyx_t_9 = 0; + __pyx_t_10 = 0; + __pyx_t_11 = 0; + __pyx_t_12 = 0; + __pyx_t_13 = 0; + __pyx_t_14 = 0; + __pyx_t_15 = 0; + __pyx_t_16 = 0; + __pyx_t_17 = 0; + __pyx_t_18 = 0; + __pyx_t_19 = 0; + __pyx_t_20 = 0; + __pyx_t_21 = 0; + __pyx_t_22 = 0; + __pyx_t_23 = 0; + __pyx_t_24 = 0; + __pyx_t_25 = 0; + __pyx_t_26 = 0; + __pyx_t_27 = 0; + __pyx_t_27 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyDict_Type)), __pyx_t_2); if (unlikely(!__pyx_t_27)) __PYX_ERR(0, 103, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_27); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ares_errors, __pyx_t_27) < 0) __PYX_ERR(0, 103, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0; + + /* "gevent/resolver/cares.pyx":132 + * + * # maps c-ares flag to _socket module flag + * _cares_flag_map = None # <<<<<<<<<<<<<< + * + * + */ + if (PyDict_SetItem(__pyx_d, __pyx_n_s_cares_flag_map, Py_None) < 0) __PYX_ERR(0, 132, __pyx_L1_error) + + /* "gevent/resolver/cares.pyx":146 + * + * + * cpdef _convert_cares_flags(int flags, int default=cares.ARES_NI_LOOKUPHOST|cares.ARES_NI_LOOKUPSERVICE): # <<<<<<<<<<<<<< + * if _cares_flag_map is None: + * _prepare_cares_flag_map() + */ + __pyx_k_ = (ARES_NI_LOOKUPHOST | ARES_NI_LOOKUPSERVICE); + __pyx_k_ = (ARES_NI_LOOKUPHOST | ARES_NI_LOOKUPSERVICE); + + /* "gevent/resolver/cares.pyx":162 + * + * + * class InvalidIP(ValueError): # <<<<<<<<<<<<<< + * pass + * + */ + __pyx_t_27 = __Pyx_CalculateMetaclass(NULL, __pyx_tuple__4); if (unlikely(!__pyx_t_27)) __PYX_ERR(0, 162, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_27); + __pyx_t_2 = __Pyx_Py3MetaclassPrepare(__pyx_t_27, __pyx_tuple__4, __pyx_n_s_InvalidIP, __pyx_n_s_InvalidIP, (PyObject *) NULL, __pyx_n_s_gevent_resolver_cares, (PyObject *) NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 162, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_26 = __Pyx_Py3ClassCreate(__pyx_t_27, __pyx_n_s_InvalidIP, __pyx_tuple__4, __pyx_t_2, NULL, 0, 0); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 162, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_26); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_InvalidIP, __pyx_t_26) < 0) __PYX_ERR(0, 162, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0; + + /* "gevent/resolver/cares.pyx":199 + * + * + * class ares_host_result(tuple): # <<<<<<<<<<<<<< + * + * def __new__(cls, family, iterable): + */ + __pyx_t_27 = PyTuple_New(1); if (unlikely(!__pyx_t_27)) __PYX_ERR(0, 199, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_27); + __Pyx_INCREF(((PyObject *)(&PyTuple_Type))); + __Pyx_GIVEREF(((PyObject *)(&PyTuple_Type))); + PyTuple_SET_ITEM(__pyx_t_27, 0, ((PyObject *)(&PyTuple_Type))); + __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_27); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 199, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_26 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_27, __pyx_n_s_ares_host_result, __pyx_n_s_ares_host_result, (PyObject *) NULL, __pyx_n_s_gevent_resolver_cares, (PyObject *) NULL); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 199, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_26); + + /* "gevent/resolver/cares.pyx":201 + * class ares_host_result(tuple): + * + * def __new__(cls, family, iterable): # <<<<<<<<<<<<<< + * cdef object self = tuple.__new__(cls, iterable) + * self.family = family + */ + __pyx_t_25 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_8resolver_5cares_16ares_host_result_1__new__, __Pyx_CYFUNCTION_STATICMETHOD, __pyx_n_s_ares_host_result___new, NULL, __pyx_n_s_gevent_resolver_cares, __pyx_d, ((PyObject *)__pyx_codeobj__6)); if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 201, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_25); + if (__Pyx_SetNameInClass(__pyx_t_26, __pyx_n_s_new, __pyx_t_25) < 0) __PYX_ERR(0, 201, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0; + + /* "gevent/resolver/cares.pyx":206 + * return self + * + * def __getnewargs__(self): # <<<<<<<<<<<<<< + * return (self.family, tuple(self)) + * + */ + __pyx_t_25 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_8resolver_5cares_16ares_host_result_3__getnewargs__, 0, __pyx_n_s_ares_host_result___getnewargs, NULL, __pyx_n_s_gevent_resolver_cares, __pyx_d, ((PyObject *)__pyx_codeobj__8)); if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 206, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_25); + if (__Pyx_SetNameInClass(__pyx_t_26, __pyx_n_s_getnewargs, __pyx_t_25) < 0) __PYX_ERR(0, 206, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0; + + /* "gevent/resolver/cares.pyx":199 + * + * + * class ares_host_result(tuple): # <<<<<<<<<<<<<< + * + * def __new__(cls, family, iterable): + */ + __pyx_t_25 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_ares_host_result, __pyx_t_27, __pyx_t_26, NULL, 0, 0); if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 199, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_25); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ares_host_result, __pyx_t_25) < 0) __PYX_ERR(0, 199, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0; + __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0; + + /* "gevent/resolver/cares.pyx":410 + * cares.ares_process_fd(self.channel, read_fd, write_fd) + * + * def gethostbyname(self, object callback, char* name, int family=AF_INET): # <<<<<<<<<<<<<< + * if not self.channel: + * raise gaierror(cares.ARES_EDESTRUCTION, 'this ares channel has been destroyed') + */ + __pyx_k__3 = AF_INET; + + /* "gevent/resolver/cares.pyx":1 + * # Copyright (c) 2011-2012 Denis Bilenko. See LICENSE for details. # <<<<<<<<<<<<<< + * # Automatic pickling of cdef classes was added in 0.26. Unfortunately it + * # seems to be buggy (at least for the `result` class) and produces code that + */ + __pyx_t_27 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_27)) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_27); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_27) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0; + + /*--- Wrapped vars code ---*/ + + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_XDECREF(__pyx_t_13); + __Pyx_XDECREF(__pyx_t_14); + __Pyx_XDECREF(__pyx_t_15); + __Pyx_XDECREF(__pyx_t_16); + __Pyx_XDECREF(__pyx_t_17); + __Pyx_XDECREF(__pyx_t_18); + __Pyx_XDECREF(__pyx_t_19); + __Pyx_XDECREF(__pyx_t_20); + __Pyx_XDECREF(__pyx_t_21); + __Pyx_XDECREF(__pyx_t_22); + __Pyx_XDECREF(__pyx_t_23); + __Pyx_XDECREF(__pyx_t_24); + __Pyx_XDECREF(__pyx_t_25); + __Pyx_XDECREF(__pyx_t_26); + __Pyx_XDECREF(__pyx_t_27); + if (__pyx_m) { + if (__pyx_d) { + __Pyx_AddTraceback("init gevent.resolver.cares", __pyx_clineno, __pyx_lineno, __pyx_filename); + } + Py_CLEAR(__pyx_m); + } else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_ImportError, "init gevent.resolver.cares"); + } + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + #if CYTHON_PEP489_MULTI_PHASE_INIT + return (__pyx_m != NULL) ? 0 : -1; + #elif PY_MAJOR_VERSION >= 3 + return __pyx_m; + #else + return; + #endif +} + +/* --- Runtime support code --- */ +/* Refnanny */ +#if CYTHON_REFNANNY +static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { + PyObject *m = NULL, *p = NULL; + void *r = NULL; + m = PyImport_ImportModule(modname); + if (!m) goto end; + p = PyObject_GetAttrString(m, "RefNannyAPI"); + if (!p) goto end; + r = PyLong_AsVoidPtr(p); +end: + Py_XDECREF(p); + Py_XDECREF(m); + return (__Pyx_RefNannyAPIStruct *)r; +} +#endif + +/* PyObjectGetAttrStr */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_getattro)) + return tp->tp_getattro(obj, attr_name); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_getattr)) + return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); +#endif + return PyObject_GetAttr(obj, attr_name); +} +#endif + +/* GetBuiltinName */ +static PyObject *__Pyx_GetBuiltinName(PyObject *name) { + PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name); + if (unlikely(!result)) { + PyErr_Format(PyExc_NameError, +#if PY_MAJOR_VERSION >= 3 + "name '%U' is not defined", name); +#else + "name '%.200s' is not defined", PyString_AS_STRING(name)); +#endif + } + return result; +} + +/* Import */ +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { + PyObject *empty_list = 0; + PyObject *module = 0; + PyObject *global_dict = 0; + PyObject *empty_dict = 0; + PyObject *list; + #if PY_MAJOR_VERSION < 3 + PyObject *py_import; + py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); + if (!py_import) + goto bad; + #endif + if (from_list) + list = from_list; + else { + empty_list = PyList_New(0); + if (!empty_list) + goto bad; + list = empty_list; + } + global_dict = PyModule_GetDict(__pyx_m); + if (!global_dict) + goto bad; + empty_dict = PyDict_New(); + if (!empty_dict) + goto bad; + { + #if PY_MAJOR_VERSION >= 3 + if (level == -1) { + if (strchr(__Pyx_MODULE_NAME, '.')) { + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, 1); + if (!module) { + if (!PyErr_ExceptionMatches(PyExc_ImportError)) + goto bad; + PyErr_Clear(); + } + } + level = 0; + } + #endif + if (!module) { + #if PY_MAJOR_VERSION < 3 + PyObject *py_level = PyInt_FromLong(level); + if (!py_level) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, global_dict, empty_dict, list, py_level, (PyObject *)NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, level); + #endif + } + } +bad: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(py_import); + #endif + Py_XDECREF(empty_list); + Py_XDECREF(empty_dict); + return module; +} + +/* PyErrExceptionMatches */ +#if CYTHON_FAST_THREAD_STATE +static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { + Py_ssize_t i, n; + n = PyTuple_GET_SIZE(tuple); +#if PY_MAJOR_VERSION >= 3 + for (i=0; icurexc_type; + if (exc_type == err) return 1; + if (unlikely(!exc_type)) return 0; + if (unlikely(PyTuple_Check(err))) + return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err); + return __Pyx_PyErr_GivenExceptionMatches(exc_type, err); +} +#endif + +/* PyErrFetchRestore */ +#if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + tmp_type = tstate->curexc_type; + tmp_value = tstate->curexc_value; + tmp_tb = tstate->curexc_traceback; + tstate->curexc_type = type; + tstate->curexc_value = value; + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +} +static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { + *type = tstate->curexc_type; + *value = tstate->curexc_value; + *tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +} +#endif + +/* GetAttr */ +static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) { +#if CYTHON_USE_TYPE_SLOTS +#if PY_MAJOR_VERSION >= 3 + if (likely(PyUnicode_Check(n))) +#else + if (likely(PyString_Check(n))) +#endif + return __Pyx_PyObject_GetAttrStr(o, n); +#endif + return PyObject_GetAttr(o, n); +} + +/* GetAttr3 */ +static PyObject *__Pyx_GetAttr3Default(PyObject *d) { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) + return NULL; + __Pyx_PyErr_Clear(); + Py_INCREF(d); + return d; +} +static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) { + PyObject *r = __Pyx_GetAttr(o, n); + return (likely(r)) ? r : __Pyx_GetAttr3Default(d); +} + +/* GetModuleGlobalName */ +#if CYTHON_USE_DICT_VERSIONS +static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value) +#else +static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) +#endif +{ + PyObject *result; +#if !CYTHON_AVOID_BORROWED_REFS +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 + result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } else if (unlikely(PyErr_Occurred())) { + return NULL; + } +#else + result = PyDict_GetItem(__pyx_d, name); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } +#endif +#else + result = PyObject_GetItem(__pyx_d, name); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } + PyErr_Clear(); +#endif + return __Pyx_GetBuiltinName(name); +} + +/* RaiseTooManyValuesToUnpack */ +static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { + PyErr_Format(PyExc_ValueError, + "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected); +} + +/* RaiseNeedMoreValuesToUnpack */ +static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { + PyErr_Format(PyExc_ValueError, + "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack", + index, (index == 1) ? "" : "s"); +} + +/* IterFinish */ +static CYTHON_INLINE int __Pyx_IterFinish(void) { +#if CYTHON_FAST_THREAD_STATE + PyThreadState *tstate = __Pyx_PyThreadState_Current; + PyObject* exc_type = tstate->curexc_type; + if (unlikely(exc_type)) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) { + PyObject *exc_value, *exc_tb; + exc_value = tstate->curexc_value; + exc_tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; + Py_DECREF(exc_type); + Py_XDECREF(exc_value); + Py_XDECREF(exc_tb); + return 0; + } else { + return -1; + } + } + return 0; +#else + if (unlikely(PyErr_Occurred())) { + if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) { + PyErr_Clear(); + return 0; + } else { + return -1; + } + } + return 0; +#endif +} + +/* UnpackItemEndCheck */ +static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { + if (unlikely(retval)) { + Py_DECREF(retval); + __Pyx_RaiseTooManyValuesError(expected); + return -1; + } else { + return __Pyx_IterFinish(); + } + return 0; +} + +/* PyFunctionFastCall */ +#if CYTHON_FAST_PYCALL +static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, + PyObject *globals) { + PyFrameObject *f; + PyThreadState *tstate = __Pyx_PyThreadState_Current; + PyObject **fastlocals; + Py_ssize_t i; + PyObject *result; + assert(globals != NULL); + /* XXX Perhaps we should create a specialized + PyFrame_New() that doesn't take locals, but does + take builtins without sanity checking them. + */ + assert(tstate != NULL); + f = PyFrame_New(tstate, co, globals, NULL); + if (f == NULL) { + return NULL; + } + fastlocals = __Pyx_PyFrame_GetLocalsplus(f); + for (i = 0; i < na; i++) { + Py_INCREF(*args); + fastlocals[i] = *args++; + } + result = PyEval_EvalFrameEx(f,0); + ++tstate->recursion_depth; + Py_DECREF(f); + --tstate->recursion_depth; + return result; +} +#if 1 || PY_VERSION_HEX < 0x030600B1 +static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs) { + PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); + PyObject *globals = PyFunction_GET_GLOBALS(func); + PyObject *argdefs = PyFunction_GET_DEFAULTS(func); + PyObject *closure; +#if PY_MAJOR_VERSION >= 3 + PyObject *kwdefs; +#endif + PyObject *kwtuple, **k; + PyObject **d; + Py_ssize_t nd; + Py_ssize_t nk; + PyObject *result; + assert(kwargs == NULL || PyDict_Check(kwargs)); + nk = kwargs ? PyDict_Size(kwargs) : 0; + if (Py_EnterRecursiveCall((char*)" while calling a Python object")) { + return NULL; + } + if ( +#if PY_MAJOR_VERSION >= 3 + co->co_kwonlyargcount == 0 && +#endif + likely(kwargs == NULL || nk == 0) && + co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { + if (argdefs == NULL && co->co_argcount == nargs) { + result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); + goto done; + } + else if (nargs == 0 && argdefs != NULL + && co->co_argcount == Py_SIZE(argdefs)) { + /* function called with no arguments, but all parameters have + a default value: use default values as arguments .*/ + args = &PyTuple_GET_ITEM(argdefs, 0); + result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); + goto done; + } + } + if (kwargs != NULL) { + Py_ssize_t pos, i; + kwtuple = PyTuple_New(2 * nk); + if (kwtuple == NULL) { + result = NULL; + goto done; + } + k = &PyTuple_GET_ITEM(kwtuple, 0); + pos = i = 0; + while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { + Py_INCREF(k[i]); + Py_INCREF(k[i+1]); + i += 2; + } + nk = i / 2; + } + else { + kwtuple = NULL; + k = NULL; + } + closure = PyFunction_GET_CLOSURE(func); +#if PY_MAJOR_VERSION >= 3 + kwdefs = PyFunction_GET_KW_DEFAULTS(func); +#endif + if (argdefs != NULL) { + d = &PyTuple_GET_ITEM(argdefs, 0); + nd = Py_SIZE(argdefs); + } + else { + d = NULL; + nd = 0; + } +#if PY_MAJOR_VERSION >= 3 + result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, + args, nargs, + k, (int)nk, + d, (int)nd, kwdefs, closure); +#else + result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, + args, nargs, + k, (int)nk, + d, (int)nd, closure); +#endif + Py_XDECREF(kwtuple); +done: + Py_LeaveRecursiveCall(); + return result; +} +#endif +#endif + +/* PyCFunctionFastCall */ +#if CYTHON_FAST_PYCCALL +static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) { + PyCFunctionObject *func = (PyCFunctionObject*)func_obj; + PyCFunction meth = PyCFunction_GET_FUNCTION(func); + PyObject *self = PyCFunction_GET_SELF(func); + int flags = PyCFunction_GET_FLAGS(func); + assert(PyCFunction_Check(func)); + assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS))); + assert(nargs >= 0); + assert(nargs == 0 || args != NULL); + /* _PyCFunction_FastCallDict() must not be called with an exception set, + because it may clear it (directly or indirectly) and so the + caller loses its exception */ + assert(!PyErr_Occurred()); + if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) { + return (*((__Pyx_PyCFunctionFastWithKeywords)(void*)meth)) (self, args, nargs, NULL); + } else { + return (*((__Pyx_PyCFunctionFast)(void*)meth)) (self, args, nargs); + } +} +#endif + +/* PyObjectCall */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { + PyObject *result; + ternaryfunc call = func->ob_type->tp_call; + if (unlikely(!call)) + return PyObject_Call(func, arg, kw); + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; + result = (*call)(func, arg, kw); + Py_LeaveRecursiveCall(); + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +/* RaiseException */ +#if PY_MAJOR_VERSION < 3 +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, + CYTHON_UNUSED PyObject *cause) { + __Pyx_PyThreadState_declare + Py_XINCREF(type); + if (!value || value == Py_None) + value = NULL; + else + Py_INCREF(value); + if (!tb || tb == Py_None) + tb = NULL; + else { + Py_INCREF(tb); + if (!PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto raise_error; + } + } + if (PyType_Check(type)) { +#if CYTHON_COMPILING_IN_PYPY + if (!value) { + Py_INCREF(Py_None); + value = Py_None; + } +#endif + PyErr_NormalizeException(&type, &value, &tb); + } else { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto raise_error; + } + value = type; + type = (PyObject*) Py_TYPE(type); + Py_INCREF(type); + if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto raise_error; + } + } + __Pyx_PyThreadState_assign + __Pyx_ErrRestore(type, value, tb); + return; +raise_error: + Py_XDECREF(value); + Py_XDECREF(type); + Py_XDECREF(tb); + return; +} +#else +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { + PyObject* owned_instance = NULL; + if (tb == Py_None) { + tb = 0; + } else if (tb && !PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto bad; + } + if (value == Py_None) + value = 0; + if (PyExceptionInstance_Check(type)) { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto bad; + } + value = type; + type = (PyObject*) Py_TYPE(value); + } else if (PyExceptionClass_Check(type)) { + PyObject *instance_class = NULL; + if (value && PyExceptionInstance_Check(value)) { + instance_class = (PyObject*) Py_TYPE(value); + if (instance_class != type) { + int is_subclass = PyObject_IsSubclass(instance_class, type); + if (!is_subclass) { + instance_class = NULL; + } else if (unlikely(is_subclass == -1)) { + goto bad; + } else { + type = instance_class; + } + } + } + if (!instance_class) { + PyObject *args; + if (!value) + args = PyTuple_New(0); + else if (PyTuple_Check(value)) { + Py_INCREF(value); + args = value; + } else + args = PyTuple_Pack(1, value); + if (!args) + goto bad; + owned_instance = PyObject_Call(type, args, NULL); + Py_DECREF(args); + if (!owned_instance) + goto bad; + value = owned_instance; + if (!PyExceptionInstance_Check(value)) { + PyErr_Format(PyExc_TypeError, + "calling %R should have returned an instance of " + "BaseException, not %R", + type, Py_TYPE(value)); + goto bad; + } + } + } else { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto bad; + } + if (cause) { + PyObject *fixed_cause; + if (cause == Py_None) { + fixed_cause = NULL; + } else if (PyExceptionClass_Check(cause)) { + fixed_cause = PyObject_CallObject(cause, NULL); + if (fixed_cause == NULL) + goto bad; + } else if (PyExceptionInstance_Check(cause)) { + fixed_cause = cause; + Py_INCREF(fixed_cause); + } else { + PyErr_SetString(PyExc_TypeError, + "exception causes must derive from " + "BaseException"); + goto bad; + } + PyException_SetCause(value, fixed_cause); + } + PyErr_SetObject(type, value); + if (tb) { +#if CYTHON_COMPILING_IN_PYPY + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); + Py_INCREF(tb); + PyErr_Restore(tmp_type, tmp_value, tb); + Py_XDECREF(tmp_tb); +#else + PyThreadState *tstate = __Pyx_PyThreadState_Current; + PyObject* tmp_tb = tstate->curexc_traceback; + if (tb != tmp_tb) { + Py_INCREF(tb); + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_tb); + } +#endif + } +bad: + Py_XDECREF(owned_instance); + return; +} +#endif + +/* RaiseDoubleKeywords */ +static void __Pyx_RaiseDoubleKeywordsError( + const char* func_name, + PyObject* kw_name) +{ + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION >= 3 + "%s() got multiple values for keyword argument '%U'", func_name, kw_name); + #else + "%s() got multiple values for keyword argument '%s'", func_name, + PyString_AsString(kw_name)); + #endif +} + +/* ParseKeywords */ +static int __Pyx_ParseOptionalKeywords( + PyObject *kwds, + PyObject **argnames[], + PyObject *kwds2, + PyObject *values[], + Py_ssize_t num_pos_args, + const char* function_name) +{ + PyObject *key = 0, *value = 0; + Py_ssize_t pos = 0; + PyObject*** name; + PyObject*** first_kw_arg = argnames + num_pos_args; + while (PyDict_Next(kwds, &pos, &key, &value)) { + name = first_kw_arg; + while (*name && (**name != key)) name++; + if (*name) { + values[name-argnames] = value; + continue; + } + name = first_kw_arg; + #if PY_MAJOR_VERSION < 3 + if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) { + while (*name) { + if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) + && _PyString_Eq(**name, key)) { + values[name-argnames] = value; + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + if ((**argname == key) || ( + (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) + && _PyString_Eq(**argname, key))) { + goto arg_passed_twice; + } + argname++; + } + } + } else + #endif + if (likely(PyUnicode_Check(key))) { + while (*name) { + int cmp = (**name == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 : + #endif + PyUnicode_Compare(**name, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) { + values[name-argnames] = value; + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + int cmp = (**argname == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 : + #endif + PyUnicode_Compare(**argname, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) goto arg_passed_twice; + argname++; + } + } + } else + goto invalid_keyword_type; + if (kwds2) { + if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; + } else { + goto invalid_keyword; + } + } + return 0; +arg_passed_twice: + __Pyx_RaiseDoubleKeywordsError(function_name, key); + goto bad; +invalid_keyword_type: + PyErr_Format(PyExc_TypeError, + "%.200s() keywords must be strings", function_name); + goto bad; +invalid_keyword: + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION < 3 + "%.200s() got an unexpected keyword argument '%.200s'", + function_name, PyString_AsString(key)); + #else + "%s() got an unexpected keyword argument '%U'", + function_name, key); + #endif +bad: + return -1; +} + +/* RaiseArgTupleInvalid */ +static void __Pyx_RaiseArgtupleInvalid( + const char* func_name, + int exact, + Py_ssize_t num_min, + Py_ssize_t num_max, + Py_ssize_t num_found) +{ + Py_ssize_t num_expected; + const char *more_or_less; + if (num_found < num_min) { + num_expected = num_min; + more_or_less = "at least"; + } else { + num_expected = num_max; + more_or_less = "at most"; + } + if (exact) { + more_or_less = "exactly"; + } + PyErr_Format(PyExc_TypeError, + "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", + func_name, more_or_less, num_expected, + (num_expected == 1) ? "" : "s", num_found); +} + +/* PyObjectCall2Args */ +static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) { + PyObject *args, *result = NULL; + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(function)) { + PyObject *args[2] = {arg1, arg2}; + return __Pyx_PyFunction_FastCall(function, args, 2); + } + #endif + #if CYTHON_FAST_PYCCALL + if (__Pyx_PyFastCFunction_Check(function)) { + PyObject *args[2] = {arg1, arg2}; + return __Pyx_PyCFunction_FastCall(function, args, 2); + } + #endif + args = PyTuple_New(2); + if (unlikely(!args)) goto done; + Py_INCREF(arg1); + PyTuple_SET_ITEM(args, 0, arg1); + Py_INCREF(arg2); + PyTuple_SET_ITEM(args, 1, arg2); + Py_INCREF(function); + result = __Pyx_PyObject_Call(function, args, NULL); + Py_DECREF(args); + Py_DECREF(function); +done: + return result; +} + +/* PyObjectCallMethO */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { + PyObject *self, *result; + PyCFunction cfunc; + cfunc = PyCFunction_GET_FUNCTION(func); + self = PyCFunction_GET_SELF(func); + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; + result = cfunc(self, arg); + Py_LeaveRecursiveCall(); + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +/* PyObjectCallOneArg */ +#if CYTHON_COMPILING_IN_CPYTHON +static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) { + PyObject *result; + PyObject *args = PyTuple_New(1); + if (unlikely(!args)) return NULL; + Py_INCREF(arg); + PyTuple_SET_ITEM(args, 0, arg); + result = __Pyx_PyObject_Call(func, args, NULL); + Py_DECREF(args); + return result; +} +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { +#if CYTHON_FAST_PYCALL + if (PyFunction_Check(func)) { + return __Pyx_PyFunction_FastCall(func, &arg, 1); + } +#endif + if (likely(PyCFunction_Check(func))) { + if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) { + return __Pyx_PyObject_CallMethO(func, arg); +#if CYTHON_FAST_PYCCALL + } else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) { + return __Pyx_PyCFunction_FastCall(func, &arg, 1); +#endif + } + } + return __Pyx__PyObject_CallOneArg(func, arg); +} +#else +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { + PyObject *result; + PyObject *args = PyTuple_Pack(1, arg); + if (unlikely(!args)) return NULL; + result = __Pyx_PyObject_Call(func, args, NULL); + Py_DECREF(args); + return result; +} +#endif + +/* WriteUnraisableException */ +static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno, + CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename, + int full_traceback, CYTHON_UNUSED int nogil) { + PyObject *old_exc, *old_val, *old_tb; + PyObject *ctx; + __Pyx_PyThreadState_declare +#ifdef WITH_THREAD + PyGILState_STATE state; + if (nogil) + state = PyGILState_Ensure(); +#ifdef _MSC_VER + else state = (PyGILState_STATE)-1; +#endif +#endif + __Pyx_PyThreadState_assign + __Pyx_ErrFetch(&old_exc, &old_val, &old_tb); + if (full_traceback) { + Py_XINCREF(old_exc); + Py_XINCREF(old_val); + Py_XINCREF(old_tb); + __Pyx_ErrRestore(old_exc, old_val, old_tb); + PyErr_PrintEx(1); + } + #if PY_MAJOR_VERSION < 3 + ctx = PyString_FromString(name); + #else + ctx = PyUnicode_FromString(name); + #endif + __Pyx_ErrRestore(old_exc, old_val, old_tb); + if (!ctx) { + PyErr_WriteUnraisable(Py_None); + } else { + PyErr_WriteUnraisable(ctx); + Py_DECREF(ctx); + } +#ifdef WITH_THREAD + if (nogil) + PyGILState_Release(state); +#endif +} + +/* PyObjectSetAttrStr */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) { + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_setattro)) + return tp->tp_setattro(obj, attr_name, value); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_setattr)) + return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value); +#endif + return PyObject_SetAttr(obj, attr_name, value); +} +#endif + +/* RaiseNoneIterError */ +static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); +} + +/* ExtTypeTest */ +static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { + if (unlikely(!type)) { + PyErr_SetString(PyExc_SystemError, "Missing type object"); + return 0; + } + if (likely(__Pyx_TypeCheck(obj, type))) + return 1; + PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s", + Py_TYPE(obj)->tp_name, type->tp_name); + return 0; +} + +/* GetTopmostException */ +#if CYTHON_USE_EXC_INFO_STACK +static _PyErr_StackItem * +__Pyx_PyErr_GetTopmostException(PyThreadState *tstate) +{ + _PyErr_StackItem *exc_info = tstate->exc_info; + while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) && + exc_info->previous_item != NULL) + { + exc_info = exc_info->previous_item; + } + return exc_info; +} +#endif + +/* SaveResetException */ +#if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { + #if CYTHON_USE_EXC_INFO_STACK + _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate); + *type = exc_info->exc_type; + *value = exc_info->exc_value; + *tb = exc_info->exc_traceback; + #else + *type = tstate->exc_type; + *value = tstate->exc_value; + *tb = tstate->exc_traceback; + #endif + Py_XINCREF(*type); + Py_XINCREF(*value); + Py_XINCREF(*tb); +} +static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + #if CYTHON_USE_EXC_INFO_STACK + _PyErr_StackItem *exc_info = tstate->exc_info; + tmp_type = exc_info->exc_type; + tmp_value = exc_info->exc_value; + tmp_tb = exc_info->exc_traceback; + exc_info->exc_type = type; + exc_info->exc_value = value; + exc_info->exc_traceback = tb; + #else + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = type; + tstate->exc_value = value; + tstate->exc_traceback = tb; + #endif + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +} +#endif + +/* GetException */ +#if CYTHON_FAST_THREAD_STATE +static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) +#else +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) +#endif +{ + PyObject *local_type, *local_value, *local_tb; +#if CYTHON_FAST_THREAD_STATE + PyObject *tmp_type, *tmp_value, *tmp_tb; + local_type = tstate->curexc_type; + local_value = tstate->curexc_value; + local_tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +#else + PyErr_Fetch(&local_type, &local_value, &local_tb); +#endif + PyErr_NormalizeException(&local_type, &local_value, &local_tb); +#if CYTHON_FAST_THREAD_STATE + if (unlikely(tstate->curexc_type)) +#else + if (unlikely(PyErr_Occurred())) +#endif + goto bad; + #if PY_MAJOR_VERSION >= 3 + if (local_tb) { + if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) + goto bad; + } + #endif + Py_XINCREF(local_tb); + Py_XINCREF(local_type); + Py_XINCREF(local_value); + *type = local_type; + *value = local_value; + *tb = local_tb; +#if CYTHON_FAST_THREAD_STATE + #if CYTHON_USE_EXC_INFO_STACK + { + _PyErr_StackItem *exc_info = tstate->exc_info; + tmp_type = exc_info->exc_type; + tmp_value = exc_info->exc_value; + tmp_tb = exc_info->exc_traceback; + exc_info->exc_type = local_type; + exc_info->exc_value = local_value; + exc_info->exc_traceback = local_tb; + } + #else + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = local_type; + tstate->exc_value = local_value; + tstate->exc_traceback = local_tb; + #endif + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#else + PyErr_SetExcInfo(local_type, local_value, local_tb); +#endif + return 0; +bad: + *type = 0; + *value = 0; + *tb = 0; + Py_XDECREF(local_type); + Py_XDECREF(local_value); + Py_XDECREF(local_tb); + return -1; +} + +/* PyObjectCallNoArg */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { +#if CYTHON_FAST_PYCALL + if (PyFunction_Check(func)) { + return __Pyx_PyFunction_FastCall(func, NULL, 0); + } +#endif +#ifdef __Pyx_CyFunction_USED + if (likely(PyCFunction_Check(func) || __Pyx_CyFunction_Check(func))) +#else + if (likely(PyCFunction_Check(func))) +#endif + { + if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) { + return __Pyx_PyObject_CallMethO(func, NULL); + } + } + return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL); +} +#endif + +/* GetItemInt */ +static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { + PyObject *r; + if (!j) return NULL; + r = PyObject_GetItem(o, j); + Py_DECREF(j); + return r; +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, + CYTHON_NCP_UNUSED int wraparound, + CYTHON_NCP_UNUSED int boundscheck) { +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + Py_ssize_t wrapped_i = i; + if (wraparound & unlikely(i < 0)) { + wrapped_i += PyList_GET_SIZE(o); + } + if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) { + PyObject *r = PyList_GET_ITEM(o, wrapped_i); + Py_INCREF(r); + return r; + } + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +#else + return PySequence_GetItem(o, i); +#endif +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, + CYTHON_NCP_UNUSED int wraparound, + CYTHON_NCP_UNUSED int boundscheck) { +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + Py_ssize_t wrapped_i = i; + if (wraparound & unlikely(i < 0)) { + wrapped_i += PyTuple_GET_SIZE(o); + } + if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) { + PyObject *r = PyTuple_GET_ITEM(o, wrapped_i); + Py_INCREF(r); + return r; + } + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +#else + return PySequence_GetItem(o, i); +#endif +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, + CYTHON_NCP_UNUSED int wraparound, + CYTHON_NCP_UNUSED int boundscheck) { +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS + if (is_list || PyList_CheckExact(o)) { + Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); + if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) { + PyObject *r = PyList_GET_ITEM(o, n); + Py_INCREF(r); + return r; + } + } + else if (PyTuple_CheckExact(o)) { + Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o); + if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) { + PyObject *r = PyTuple_GET_ITEM(o, n); + Py_INCREF(r); + return r; + } + } else { + PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence; + if (likely(m && m->sq_item)) { + if (wraparound && unlikely(i < 0) && likely(m->sq_length)) { + Py_ssize_t l = m->sq_length(o); + if (likely(l >= 0)) { + i += l; + } else { + if (!PyErr_ExceptionMatches(PyExc_OverflowError)) + return NULL; + PyErr_Clear(); + } + } + return m->sq_item(o, i); + } + } +#else + if (is_list || PySequence_Check(o)) { + return PySequence_GetItem(o, i); + } +#endif + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +} + +/* pyobject_as_double */ +static double __Pyx__PyObject_AsDouble(PyObject* obj) { + PyObject* float_value; +#if !CYTHON_USE_TYPE_SLOTS + float_value = PyNumber_Float(obj); if ((0)) goto bad; +#else + PyNumberMethods *nb = Py_TYPE(obj)->tp_as_number; + if (likely(nb) && likely(nb->nb_float)) { + float_value = nb->nb_float(obj); + if (likely(float_value) && unlikely(!PyFloat_Check(float_value))) { + PyErr_Format(PyExc_TypeError, + "__float__ returned non-float (type %.200s)", + Py_TYPE(float_value)->tp_name); + Py_DECREF(float_value); + goto bad; + } + } else if (PyUnicode_CheckExact(obj) || PyBytes_CheckExact(obj)) { +#if PY_MAJOR_VERSION >= 3 + float_value = PyFloat_FromString(obj); +#else + float_value = PyFloat_FromString(obj, 0); +#endif + } else { + PyObject* args = PyTuple_New(1); + if (unlikely(!args)) goto bad; + PyTuple_SET_ITEM(args, 0, obj); + float_value = PyObject_Call((PyObject*)&PyFloat_Type, args, 0); + PyTuple_SET_ITEM(args, 0, 0); + Py_DECREF(args); + } +#endif + if (likely(float_value)) { + double value = PyFloat_AS_DOUBLE(float_value); + Py_DECREF(float_value); + return value; + } +bad: + return (double)-1; +} + +/* SwapException */ +#if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + #if CYTHON_USE_EXC_INFO_STACK + _PyErr_StackItem *exc_info = tstate->exc_info; + tmp_type = exc_info->exc_type; + tmp_value = exc_info->exc_value; + tmp_tb = exc_info->exc_traceback; + exc_info->exc_type = *type; + exc_info->exc_value = *value; + exc_info->exc_traceback = *tb; + #else + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = *type; + tstate->exc_value = *value; + tstate->exc_traceback = *tb; + #endif + *type = tmp_type; + *value = tmp_value; + *tb = tmp_tb; +} +#else +static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb); + PyErr_SetExcInfo(*type, *value, *tb); + *type = tmp_type; + *value = tmp_value; + *tb = tmp_tb; +} +#endif + +/* UnpackUnboundCMethod */ +static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target) { + PyObject *method; + method = __Pyx_PyObject_GetAttrStr(target->type, *target->method_name); + if (unlikely(!method)) + return -1; + target->method = method; +#if CYTHON_COMPILING_IN_CPYTHON + #if PY_MAJOR_VERSION >= 3 + if (likely(__Pyx_TypeCheck(method, &PyMethodDescr_Type))) + #endif + { + PyMethodDescrObject *descr = (PyMethodDescrObject*) method; + target->func = descr->d_method->ml_meth; + target->flag = descr->d_method->ml_flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_STACKLESS); + } +#endif + return 0; +} + +/* CallUnboundCMethod1 */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg) { + if (likely(cfunc->func)) { + int flag = cfunc->flag; + if (flag == METH_O) { + return (*(cfunc->func))(self, arg); + } else if (PY_VERSION_HEX >= 0x030600B1 && flag == METH_FASTCALL) { + if (PY_VERSION_HEX >= 0x030700A0) { + return (*(__Pyx_PyCFunctionFast)(void*)(PyCFunction)cfunc->func)(self, &arg, 1); + } else { + return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, &arg, 1, NULL); + } + } else if (PY_VERSION_HEX >= 0x030700A0 && flag == (METH_FASTCALL | METH_KEYWORDS)) { + return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, &arg, 1, NULL); + } + } + return __Pyx__CallUnboundCMethod1(cfunc, self, arg); +} +#endif +static PyObject* __Pyx__CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg){ + PyObject *args, *result = NULL; + if (unlikely(!cfunc->func && !cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL; +#if CYTHON_COMPILING_IN_CPYTHON + if (cfunc->func && (cfunc->flag & METH_VARARGS)) { + args = PyTuple_New(1); + if (unlikely(!args)) goto bad; + Py_INCREF(arg); + PyTuple_SET_ITEM(args, 0, arg); + if (cfunc->flag & METH_KEYWORDS) + result = (*(PyCFunctionWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, NULL); + else + result = (*cfunc->func)(self, args); + } else { + args = PyTuple_New(2); + if (unlikely(!args)) goto bad; + Py_INCREF(self); + PyTuple_SET_ITEM(args, 0, self); + Py_INCREF(arg); + PyTuple_SET_ITEM(args, 1, arg); + result = __Pyx_PyObject_Call(cfunc->method, args, NULL); + } +#else + args = PyTuple_Pack(2, self, arg); + if (unlikely(!args)) goto bad; + result = __Pyx_PyObject_Call(cfunc->method, args, NULL); +#endif +bad: + Py_XDECREF(args); + return result; +} + +/* CallUnboundCMethod2 */ +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030600B1 +static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2) { + if (likely(cfunc->func)) { + PyObject *args[2] = {arg1, arg2}; + if (cfunc->flag == METH_FASTCALL) { + #if PY_VERSION_HEX >= 0x030700A0 + return (*(__Pyx_PyCFunctionFast)(void*)(PyCFunction)cfunc->func)(self, args, 2); + #else + return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, 2, NULL); + #endif + } + #if PY_VERSION_HEX >= 0x030700A0 + if (cfunc->flag == (METH_FASTCALL | METH_KEYWORDS)) + return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, 2, NULL); + #endif + } + return __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2); +} +#endif +static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2){ + PyObject *args, *result = NULL; + if (unlikely(!cfunc->func && !cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL; +#if CYTHON_COMPILING_IN_CPYTHON + if (cfunc->func && (cfunc->flag & METH_VARARGS)) { + args = PyTuple_New(2); + if (unlikely(!args)) goto bad; + Py_INCREF(arg1); + PyTuple_SET_ITEM(args, 0, arg1); + Py_INCREF(arg2); + PyTuple_SET_ITEM(args, 1, arg2); + if (cfunc->flag & METH_KEYWORDS) + result = (*(PyCFunctionWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, NULL); + else + result = (*cfunc->func)(self, args); + } else { + args = PyTuple_New(3); + if (unlikely(!args)) goto bad; + Py_INCREF(self); + PyTuple_SET_ITEM(args, 0, self); + Py_INCREF(arg1); + PyTuple_SET_ITEM(args, 1, arg1); + Py_INCREF(arg2); + PyTuple_SET_ITEM(args, 2, arg2); + result = __Pyx_PyObject_Call(cfunc->method, args, NULL); + } +#else + args = PyTuple_Pack(3, self, arg1, arg2); + if (unlikely(!args)) goto bad; + result = __Pyx_PyObject_Call(cfunc->method, args, NULL); +#endif +bad: + Py_XDECREF(args); + return result; +} + +/* dict_getitem_default */ +static PyObject* __Pyx_PyDict_GetItemDefault(PyObject* d, PyObject* key, PyObject* default_value) { + PyObject* value; +#if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY + value = PyDict_GetItemWithError(d, key); + if (unlikely(!value)) { + if (unlikely(PyErr_Occurred())) + return NULL; + value = default_value; + } + Py_INCREF(value); + if ((1)); +#else + if (PyString_CheckExact(key) || PyUnicode_CheckExact(key) || PyInt_CheckExact(key)) { + value = PyDict_GetItem(d, key); + if (unlikely(!value)) { + value = default_value; + } + Py_INCREF(value); + } +#endif + else { + if (default_value == Py_None) + value = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PyDict_Type_get, d, key); + else + value = __Pyx_CallUnboundCMethod2(&__pyx_umethod_PyDict_Type_get, d, key, default_value); + } + return value; +} + +/* py_dict_pop */ +static CYTHON_INLINE PyObject *__Pyx_PyDict_Pop(PyObject *d, PyObject *key, PyObject *default_value) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX > 0x030600B3 + if ((1)) { + return _PyDict_Pop(d, key, default_value); + } else +#endif + if (default_value) { + return __Pyx_CallUnboundCMethod2(&__pyx_umethod_PyDict_Type_pop, d, key, default_value); + } else { + return __Pyx_CallUnboundCMethod1(&__pyx_umethod_PyDict_Type_pop, d, key); + } +} + +/* ArgTypeTest */ +static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact) +{ + if (unlikely(!type)) { + PyErr_SetString(PyExc_SystemError, "Missing type object"); + return 0; + } + else if (exact) { + #if PY_MAJOR_VERSION == 2 + if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1; + #endif + } + else { + if (likely(__Pyx_TypeCheck(obj, type))) return 1; + } + PyErr_Format(PyExc_TypeError, + "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)", + name, type->tp_name, Py_TYPE(obj)->tp_name); + return 0; +} + +/* FastTypeChecks */ +#if CYTHON_COMPILING_IN_CPYTHON +static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) { + while (a) { + a = a->tp_base; + if (a == b) + return 1; + } + return b == &PyBaseObject_Type; +} +static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) { + PyObject *mro; + if (a == b) return 1; + mro = a->tp_mro; + if (likely(mro)) { + Py_ssize_t i, n; + n = PyTuple_GET_SIZE(mro); + for (i = 0; i < n; i++) { + if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b) + return 1; + } + return 0; + } + return __Pyx_InBases(a, b); +} +#if PY_MAJOR_VERSION == 2 +static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { + PyObject *exception, *value, *tb; + int res; + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ErrFetch(&exception, &value, &tb); + res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; + if (unlikely(res == -1)) { + PyErr_WriteUnraisable(err); + res = 0; + } + if (!res) { + res = PyObject_IsSubclass(err, exc_type2); + if (unlikely(res == -1)) { + PyErr_WriteUnraisable(err); + res = 0; + } + } + __Pyx_ErrRestore(exception, value, tb); + return res; +} +#else +static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { + int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0; + if (!res) { + res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); + } + return res; +} +#endif +static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { + Py_ssize_t i, n; + assert(PyExceptionClass_Check(exc_type)); + n = PyTuple_GET_SIZE(tuple); +#if PY_MAJOR_VERSION >= 3 + for (i=0; i= 3 + "'%.50s' object has no attribute '%U'", + tp->tp_name, attr_name); +#else + "'%.50s' object has no attribute '%.400s'", + tp->tp_name, PyString_AS_STRING(attr_name)); +#endif + return NULL; +} +static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) { + PyObject *descr; + PyTypeObject *tp = Py_TYPE(obj); + if (unlikely(!PyString_Check(attr_name))) { + return PyObject_GenericGetAttr(obj, attr_name); + } + assert(!tp->tp_dictoffset); + descr = _PyType_Lookup(tp, attr_name); + if (unlikely(!descr)) { + return __Pyx_RaiseGenericGetAttributeError(tp, attr_name); + } + Py_INCREF(descr); + #if PY_MAJOR_VERSION < 3 + if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS))) + #endif + { + descrgetfunc f = Py_TYPE(descr)->tp_descr_get; + if (unlikely(f)) { + PyObject *res = f(descr, obj, (PyObject *)tp); + Py_DECREF(descr); + return res; + } + } + return descr; +} +#endif + +/* PyObject_GenericGetAttr */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) { + if (unlikely(Py_TYPE(obj)->tp_dictoffset)) { + return PyObject_GenericGetAttr(obj, attr_name); + } + return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name); +} +#endif + +/* SetVTable */ +static int __Pyx_SetVtable(PyObject *dict, void *vtable) { +#if PY_VERSION_HEX >= 0x02070000 + PyObject *ob = PyCapsule_New(vtable, 0, 0); +#else + PyObject *ob = PyCObject_FromVoidPtr(vtable, 0); +#endif + if (!ob) + goto bad; + if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0) + goto bad; + Py_DECREF(ob); + return 0; +bad: + Py_XDECREF(ob); + return -1; +} + +/* TypeImport */ +#ifndef __PYX_HAVE_RT_ImportType +#define __PYX_HAVE_RT_ImportType +static PyTypeObject *__Pyx_ImportType(PyObject *module, const char *module_name, const char *class_name, + size_t size, enum __Pyx_ImportType_CheckSize check_size) +{ + PyObject *result = 0; + char warning[200]; + Py_ssize_t basicsize; +#ifdef Py_LIMITED_API + PyObject *py_basicsize; +#endif + result = PyObject_GetAttrString(module, class_name); + if (!result) + goto bad; + if (!PyType_Check(result)) { + PyErr_Format(PyExc_TypeError, + "%.200s.%.200s is not a type object", + module_name, class_name); + goto bad; + } +#ifndef Py_LIMITED_API + basicsize = ((PyTypeObject *)result)->tp_basicsize; +#else + py_basicsize = PyObject_GetAttrString(result, "__basicsize__"); + if (!py_basicsize) + goto bad; + basicsize = PyLong_AsSsize_t(py_basicsize); + Py_DECREF(py_basicsize); + py_basicsize = 0; + if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred()) + goto bad; +#endif + if ((size_t)basicsize < size) { + PyErr_Format(PyExc_ValueError, + "%.200s.%.200s size changed, may indicate binary incompatibility. " + "Expected %zd from C header, got %zd from PyObject", + module_name, class_name, size, basicsize); + goto bad; + } + if (check_size == __Pyx_ImportType_CheckSize_Error && (size_t)basicsize != size) { + PyErr_Format(PyExc_ValueError, + "%.200s.%.200s size changed, may indicate binary incompatibility. " + "Expected %zd from C header, got %zd from PyObject", + module_name, class_name, size, basicsize); + goto bad; + } + else if (check_size == __Pyx_ImportType_CheckSize_Warn && (size_t)basicsize > size) { + PyOS_snprintf(warning, sizeof(warning), + "%s.%s size changed, may indicate binary incompatibility. " + "Expected %zd from C header, got %zd from PyObject", + module_name, class_name, size, basicsize); + if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad; + } + return (PyTypeObject *)result; +bad: + Py_XDECREF(result); + return NULL; +} +#endif + +/* ImportFrom */ +static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { + PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); + if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_Format(PyExc_ImportError, + #if PY_MAJOR_VERSION < 3 + "cannot import name %.230s", PyString_AS_STRING(name)); + #else + "cannot import name %S", name); + #endif + } + return value; +} + +/* CalculateMetaclass */ +static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) { + Py_ssize_t i, nbases = PyTuple_GET_SIZE(bases); + for (i=0; i < nbases; i++) { + PyTypeObject *tmptype; + PyObject *tmp = PyTuple_GET_ITEM(bases, i); + tmptype = Py_TYPE(tmp); +#if PY_MAJOR_VERSION < 3 + if (tmptype == &PyClass_Type) + continue; +#endif + if (!metaclass) { + metaclass = tmptype; + continue; + } + if (PyType_IsSubtype(metaclass, tmptype)) + continue; + if (PyType_IsSubtype(tmptype, metaclass)) { + metaclass = tmptype; + continue; + } + PyErr_SetString(PyExc_TypeError, + "metaclass conflict: " + "the metaclass of a derived class " + "must be a (non-strict) subclass " + "of the metaclasses of all its bases"); + return NULL; + } + if (!metaclass) { +#if PY_MAJOR_VERSION < 3 + metaclass = &PyClass_Type; +#else + metaclass = &PyType_Type; +#endif + } + Py_INCREF((PyObject*) metaclass); + return (PyObject*) metaclass; +} + +/* Py3ClassCreate */ +static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, + PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) { + PyObject *ns; + if (metaclass) { + PyObject *prep = __Pyx_PyObject_GetAttrStr(metaclass, __pyx_n_s_prepare); + if (prep) { + PyObject *pargs = PyTuple_Pack(2, name, bases); + if (unlikely(!pargs)) { + Py_DECREF(prep); + return NULL; + } + ns = PyObject_Call(prep, pargs, mkw); + Py_DECREF(prep); + Py_DECREF(pargs); + } else { + if (unlikely(!PyErr_ExceptionMatches(PyExc_AttributeError))) + return NULL; + PyErr_Clear(); + ns = PyDict_New(); + } + } else { + ns = PyDict_New(); + } + if (unlikely(!ns)) + return NULL; + if (unlikely(PyObject_SetItem(ns, __pyx_n_s_module, modname) < 0)) goto bad; + if (unlikely(PyObject_SetItem(ns, __pyx_n_s_qualname, qualname) < 0)) goto bad; + if (unlikely(doc && PyObject_SetItem(ns, __pyx_n_s_doc, doc) < 0)) goto bad; + return ns; +bad: + Py_DECREF(ns); + return NULL; +} +static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, + PyObject *dict, PyObject *mkw, + int calculate_metaclass, int allow_py2_metaclass) { + PyObject *result, *margs; + PyObject *owned_metaclass = NULL; + if (allow_py2_metaclass) { + owned_metaclass = PyObject_GetItem(dict, __pyx_n_s_metaclass); + if (owned_metaclass) { + metaclass = owned_metaclass; + } else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) { + PyErr_Clear(); + } else { + return NULL; + } + } + if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) { + metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases); + Py_XDECREF(owned_metaclass); + if (unlikely(!metaclass)) + return NULL; + owned_metaclass = metaclass; + } + margs = PyTuple_Pack(3, name, bases, dict); + if (unlikely(!margs)) { + result = NULL; + } else { + result = PyObject_Call(metaclass, margs, mkw); + Py_DECREF(margs); + } + Py_XDECREF(owned_metaclass); + return result; +} + +/* FetchCommonType */ +static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { + PyObject* fake_module; + PyTypeObject* cached_type = NULL; + fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI); + if (!fake_module) return NULL; + Py_INCREF(fake_module); + cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name); + if (cached_type) { + if (!PyType_Check((PyObject*)cached_type)) { + PyErr_Format(PyExc_TypeError, + "Shared Cython type %.200s is not a type object", + type->tp_name); + goto bad; + } + if (cached_type->tp_basicsize != type->tp_basicsize) { + PyErr_Format(PyExc_TypeError, + "Shared Cython type %.200s has the wrong size, try recompiling", + type->tp_name); + goto bad; + } + } else { + if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; + PyErr_Clear(); + if (PyType_Ready(type) < 0) goto bad; + if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0) + goto bad; + Py_INCREF(type); + cached_type = type; + } +done: + Py_DECREF(fake_module); + return cached_type; +bad: + Py_XDECREF(cached_type); + cached_type = NULL; + goto done; +} + +/* CythonFunction */ +#include +static PyObject * +__Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure) +{ + if (unlikely(op->func_doc == NULL)) { + if (op->func.m_ml->ml_doc) { +#if PY_MAJOR_VERSION >= 3 + op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc); +#else + op->func_doc = PyString_FromString(op->func.m_ml->ml_doc); +#endif + if (unlikely(op->func_doc == NULL)) + return NULL; + } else { + Py_INCREF(Py_None); + return Py_None; + } + } + Py_INCREF(op->func_doc); + return op->func_doc; +} +static int +__Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context) +{ + PyObject *tmp = op->func_doc; + if (value == NULL) { + value = Py_None; + } + Py_INCREF(value); + op->func_doc = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + if (unlikely(op->func_name == NULL)) { +#if PY_MAJOR_VERSION >= 3 + op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name); +#else + op->func_name = PyString_InternFromString(op->func.m_ml->ml_name); +#endif + if (unlikely(op->func_name == NULL)) + return NULL; + } + Py_INCREF(op->func_name); + return op->func_name; +} +static int +__Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context) +{ + PyObject *tmp; +#if PY_MAJOR_VERSION >= 3 + if (unlikely(value == NULL || !PyUnicode_Check(value))) +#else + if (unlikely(value == NULL || !PyString_Check(value))) +#endif + { + PyErr_SetString(PyExc_TypeError, + "__name__ must be set to a string object"); + return -1; + } + tmp = op->func_name; + Py_INCREF(value); + op->func_name = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + Py_INCREF(op->func_qualname); + return op->func_qualname; +} +static int +__Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context) +{ + PyObject *tmp; +#if PY_MAJOR_VERSION >= 3 + if (unlikely(value == NULL || !PyUnicode_Check(value))) +#else + if (unlikely(value == NULL || !PyString_Check(value))) +#endif + { + PyErr_SetString(PyExc_TypeError, + "__qualname__ must be set to a string object"); + return -1; + } + tmp = op->func_qualname; + Py_INCREF(value); + op->func_qualname = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED void *closure) +{ + PyObject *self; + self = m->func_closure; + if (self == NULL) + self = Py_None; + Py_INCREF(self); + return self; +} +static PyObject * +__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + if (unlikely(op->func_dict == NULL)) { + op->func_dict = PyDict_New(); + if (unlikely(op->func_dict == NULL)) + return NULL; + } + Py_INCREF(op->func_dict); + return op->func_dict; +} +static int +__Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context) +{ + PyObject *tmp; + if (unlikely(value == NULL)) { + PyErr_SetString(PyExc_TypeError, + "function's dictionary may not be deleted"); + return -1; + } + if (unlikely(!PyDict_Check(value))) { + PyErr_SetString(PyExc_TypeError, + "setting function's dictionary to a non-dict"); + return -1; + } + tmp = op->func_dict; + Py_INCREF(value); + op->func_dict = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + Py_INCREF(op->func_globals); + return op->func_globals; +} +static PyObject * +__Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + Py_INCREF(Py_None); + return Py_None; +} +static PyObject * +__Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) +{ + PyObject* result = (op->func_code) ? op->func_code : Py_None; + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { + int result = 0; + PyObject *res = op->defaults_getter((PyObject *) op); + if (unlikely(!res)) + return -1; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + op->defaults_tuple = PyTuple_GET_ITEM(res, 0); + Py_INCREF(op->defaults_tuple); + op->defaults_kwdict = PyTuple_GET_ITEM(res, 1); + Py_INCREF(op->defaults_kwdict); + #else + op->defaults_tuple = PySequence_ITEM(res, 0); + if (unlikely(!op->defaults_tuple)) result = -1; + else { + op->defaults_kwdict = PySequence_ITEM(res, 1); + if (unlikely(!op->defaults_kwdict)) result = -1; + } + #endif + Py_DECREF(res); + return result; +} +static int +__Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) { + PyObject* tmp; + if (!value) { + value = Py_None; + } else if (value != Py_None && !PyTuple_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__defaults__ must be set to a tuple object"); + return -1; + } + Py_INCREF(value); + tmp = op->defaults_tuple; + op->defaults_tuple = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) { + PyObject* result = op->defaults_tuple; + if (unlikely(!result)) { + if (op->defaults_getter) { + if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL; + result = op->defaults_tuple; + } else { + result = Py_None; + } + } + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) { + PyObject* tmp; + if (!value) { + value = Py_None; + } else if (value != Py_None && !PyDict_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__kwdefaults__ must be set to a dict object"); + return -1; + } + Py_INCREF(value); + tmp = op->defaults_kwdict; + op->defaults_kwdict = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) { + PyObject* result = op->defaults_kwdict; + if (unlikely(!result)) { + if (op->defaults_getter) { + if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL; + result = op->defaults_kwdict; + } else { + result = Py_None; + } + } + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) { + PyObject* tmp; + if (!value || value == Py_None) { + value = NULL; + } else if (!PyDict_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "__annotations__ must be set to a dict object"); + return -1; + } + Py_XINCREF(value); + tmp = op->func_annotations; + op->func_annotations = value; + Py_XDECREF(tmp); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) { + PyObject* result = op->func_annotations; + if (unlikely(!result)) { + result = PyDict_New(); + if (unlikely(!result)) return NULL; + op->func_annotations = result; + } + Py_INCREF(result); + return result; +} +static PyGetSetDef __pyx_CyFunction_getsets[] = { + {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, + {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, + {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, + {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, + {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, + {(char *) "__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0}, + {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, + {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, + {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, + {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, + {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, + {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, + {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, + {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, + {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, + {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, + {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, + {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, + {0, 0, 0, 0, 0} +}; +static PyMemberDef __pyx_CyFunction_members[] = { + {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), PY_WRITE_RESTRICTED, 0}, + {0, 0, 0, 0, 0} +}; +static PyObject * +__Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args) +{ +#if PY_MAJOR_VERSION >= 3 + return PyUnicode_FromString(m->func.m_ml->ml_name); +#else + return PyString_FromString(m->func.m_ml->ml_name); +#endif +} +static PyMethodDef __pyx_CyFunction_methods[] = { + {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, + {0, 0, 0, 0} +}; +#if PY_VERSION_HEX < 0x030500A0 +#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist) +#else +#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func.m_weakreflist) +#endif +static PyObject *__Pyx_CyFunction_New(PyTypeObject *type, PyMethodDef *ml, int flags, PyObject* qualname, + PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { + __pyx_CyFunctionObject *op = PyObject_GC_New(__pyx_CyFunctionObject, type); + if (op == NULL) + return NULL; + op->flags = flags; + __Pyx_CyFunction_weakreflist(op) = NULL; + op->func.m_ml = ml; + op->func.m_self = (PyObject *) op; + Py_XINCREF(closure); + op->func_closure = closure; + Py_XINCREF(module); + op->func.m_module = module; + op->func_dict = NULL; + op->func_name = NULL; + Py_INCREF(qualname); + op->func_qualname = qualname; + op->func_doc = NULL; + op->func_classobj = NULL; + op->func_globals = globals; + Py_INCREF(op->func_globals); + Py_XINCREF(code); + op->func_code = code; + op->defaults_pyobjects = 0; + op->defaults = NULL; + op->defaults_tuple = NULL; + op->defaults_kwdict = NULL; + op->defaults_getter = NULL; + op->func_annotations = NULL; + PyObject_GC_Track(op); + return (PyObject *) op; +} +static int +__Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) +{ + Py_CLEAR(m->func_closure); + Py_CLEAR(m->func.m_module); + Py_CLEAR(m->func_dict); + Py_CLEAR(m->func_name); + Py_CLEAR(m->func_qualname); + Py_CLEAR(m->func_doc); + Py_CLEAR(m->func_globals); + Py_CLEAR(m->func_code); + Py_CLEAR(m->func_classobj); + Py_CLEAR(m->defaults_tuple); + Py_CLEAR(m->defaults_kwdict); + Py_CLEAR(m->func_annotations); + if (m->defaults) { + PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); + int i; + for (i = 0; i < m->defaults_pyobjects; i++) + Py_XDECREF(pydefaults[i]); + PyObject_Free(m->defaults); + m->defaults = NULL; + } + return 0; +} +static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m) +{ + if (__Pyx_CyFunction_weakreflist(m) != NULL) + PyObject_ClearWeakRefs((PyObject *) m); + __Pyx_CyFunction_clear(m); + PyObject_GC_Del(m); +} +static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) +{ + PyObject_GC_UnTrack(m); + __Pyx__CyFunction_dealloc(m); +} +static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) +{ + Py_VISIT(m->func_closure); + Py_VISIT(m->func.m_module); + Py_VISIT(m->func_dict); + Py_VISIT(m->func_name); + Py_VISIT(m->func_qualname); + Py_VISIT(m->func_doc); + Py_VISIT(m->func_globals); + Py_VISIT(m->func_code); + Py_VISIT(m->func_classobj); + Py_VISIT(m->defaults_tuple); + Py_VISIT(m->defaults_kwdict); + if (m->defaults) { + PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); + int i; + for (i = 0; i < m->defaults_pyobjects; i++) + Py_VISIT(pydefaults[i]); + } + return 0; +} +static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type) +{ + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) { + Py_INCREF(func); + return func; + } + if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) { + if (type == NULL) + type = (PyObject *)(Py_TYPE(obj)); + return __Pyx_PyMethod_New(func, type, (PyObject *)(Py_TYPE(type))); + } + if (obj == Py_None) + obj = NULL; + return __Pyx_PyMethod_New(func, obj, type); +} +static PyObject* +__Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) +{ +#if PY_MAJOR_VERSION >= 3 + return PyUnicode_FromFormat("", + op->func_qualname, (void *)op); +#else + return PyString_FromFormat("", + PyString_AsString(op->func_qualname), (void *)op); +#endif +} +static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) { + PyCFunctionObject* f = (PyCFunctionObject*)func; + PyCFunction meth = f->m_ml->ml_meth; + Py_ssize_t size; + switch (f->m_ml->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) { + case METH_VARARGS: + if (likely(kw == NULL || PyDict_Size(kw) == 0)) + return (*meth)(self, arg); + break; + case METH_VARARGS | METH_KEYWORDS: + return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw); + case METH_NOARGS: + if (likely(kw == NULL || PyDict_Size(kw) == 0)) { + size = PyTuple_GET_SIZE(arg); + if (likely(size == 0)) + return (*meth)(self, NULL); + PyErr_Format(PyExc_TypeError, + "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", + f->m_ml->ml_name, size); + return NULL; + } + break; + case METH_O: + if (likely(kw == NULL || PyDict_Size(kw) == 0)) { + size = PyTuple_GET_SIZE(arg); + if (likely(size == 1)) { + PyObject *result, *arg0; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + arg0 = PyTuple_GET_ITEM(arg, 0); + #else + arg0 = PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL; + #endif + result = (*meth)(self, arg0); + #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) + Py_DECREF(arg0); + #endif + return result; + } + PyErr_Format(PyExc_TypeError, + "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", + f->m_ml->ml_name, size); + return NULL; + } + break; + default: + PyErr_SetString(PyExc_SystemError, "Bad call flags in " + "__Pyx_CyFunction_Call. METH_OLDARGS is no " + "longer supported!"); + return NULL; + } + PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", + f->m_ml->ml_name); + return NULL; +} +static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { + return __Pyx_CyFunction_CallMethod(func, ((PyCFunctionObject*)func)->m_self, arg, kw); +} +static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) { + PyObject *result; + __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func; + if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { + Py_ssize_t argc; + PyObject *new_args; + PyObject *self; + argc = PyTuple_GET_SIZE(args); + new_args = PyTuple_GetSlice(args, 1, argc); + if (unlikely(!new_args)) + return NULL; + self = PyTuple_GetItem(args, 0); + if (unlikely(!self)) { + Py_DECREF(new_args); + return NULL; + } + result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw); + Py_DECREF(new_args); + } else { + result = __Pyx_CyFunction_Call(func, args, kw); + } + return result; +} +static PyTypeObject __pyx_CyFunctionType_type = { + PyVarObject_HEAD_INIT(0, 0) + "cython_function_or_method", + sizeof(__pyx_CyFunctionObject), + 0, + (destructor) __Pyx_CyFunction_dealloc, + 0, + 0, + 0, +#if PY_MAJOR_VERSION < 3 + 0, +#else + 0, +#endif + (reprfunc) __Pyx_CyFunction_repr, + 0, + 0, + 0, + 0, + __Pyx_CyFunction_CallAsMethod, + 0, + 0, + 0, + 0, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, + 0, + (traverseproc) __Pyx_CyFunction_traverse, + (inquiry) __Pyx_CyFunction_clear, + 0, +#if PY_VERSION_HEX < 0x030500A0 + offsetof(__pyx_CyFunctionObject, func_weakreflist), +#else + offsetof(PyCFunctionObject, m_weakreflist), +#endif + 0, + 0, + __pyx_CyFunction_methods, + __pyx_CyFunction_members, + __pyx_CyFunction_getsets, + 0, + 0, + __Pyx_CyFunction_descr_get, + 0, + offsetof(__pyx_CyFunctionObject, func_dict), + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, +#if PY_VERSION_HEX >= 0x030400a1 + 0, +#endif +}; +static int __pyx_CyFunction_init(void) { + __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); + if (unlikely(__pyx_CyFunctionType == NULL)) { + return -1; + } + return 0; +} +static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults = PyObject_Malloc(size); + if (unlikely(!m->defaults)) + return PyErr_NoMemory(); + memset(m->defaults, 0, size); + m->defaults_pyobjects = pyobjects; + return m->defaults; +} +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults_tuple = tuple; + Py_INCREF(tuple); +} +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults_kwdict = dict; + Py_INCREF(dict); +} +static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->func_annotations = dict; + Py_INCREF(dict); +} + +/* CLineInTraceback */ +#ifndef CYTHON_CLINE_IN_TRACEBACK +static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { + PyObject *use_cline; + PyObject *ptype, *pvalue, *ptraceback; +#if CYTHON_COMPILING_IN_CPYTHON + PyObject **cython_runtime_dict; +#endif + if (unlikely(!__pyx_cython_runtime)) { + return c_line; + } + __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); +#if CYTHON_COMPILING_IN_CPYTHON + cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); + if (likely(cython_runtime_dict)) { + __PYX_PY_DICT_LOOKUP_IF_MODIFIED( + use_cline, *cython_runtime_dict, + __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback)) + } else +#endif + { + PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback); + if (use_cline_obj) { + use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; + Py_DECREF(use_cline_obj); + } else { + PyErr_Clear(); + use_cline = NULL; + } + } + if (!use_cline) { + c_line = 0; + PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); + } + else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { + c_line = 0; + } + __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); + return c_line; +} +#endif + +/* CodeObjectCache */ +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { + int start = 0, mid = 0, end = count - 1; + if (end >= 0 && code_line > entries[end].code_line) { + return count; + } + while (start < end) { + mid = start + (end - start) / 2; + if (code_line < entries[mid].code_line) { + end = mid; + } else if (code_line > entries[mid].code_line) { + start = mid + 1; + } else { + return mid; + } + } + if (code_line <= entries[mid].code_line) { + return mid; + } else { + return mid + 1; + } +} +static PyCodeObject *__pyx_find_code_object(int code_line) { + PyCodeObject* code_object; + int pos; + if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { + return NULL; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { + return NULL; + } + code_object = __pyx_code_cache.entries[pos].code_object; + Py_INCREF(code_object); + return code_object; +} +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { + int pos, i; + __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; + if (unlikely(!code_line)) { + return; + } + if (unlikely(!entries)) { + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); + if (likely(entries)) { + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = 64; + __pyx_code_cache.count = 1; + entries[0].code_line = code_line; + entries[0].code_object = code_object; + Py_INCREF(code_object); + } + return; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { + PyCodeObject* tmp = entries[pos].code_object; + entries[pos].code_object = code_object; + Py_DECREF(tmp); + return; + } + if (__pyx_code_cache.count == __pyx_code_cache.max_count) { + int new_max = __pyx_code_cache.max_count + 64; + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( + __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry)); + if (unlikely(!entries)) { + return; + } + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = new_max; + } + for (i=__pyx_code_cache.count; i>pos; i--) { + entries[i] = entries[i-1]; + } + entries[pos].code_line = code_line; + entries[pos].code_object = code_object; + __pyx_code_cache.count++; + Py_INCREF(code_object); +} + +/* AddTraceback */ +#include "compile.h" +#include "frameobject.h" +#include "traceback.h" +static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( + const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyObject *py_srcfile = 0; + PyObject *py_funcname = 0; + #if PY_MAJOR_VERSION < 3 + py_srcfile = PyString_FromString(filename); + #else + py_srcfile = PyUnicode_FromString(filename); + #endif + if (!py_srcfile) goto bad; + if (c_line) { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + #else + py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + #endif + } + else { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromString(funcname); + #else + py_funcname = PyUnicode_FromString(funcname); + #endif + } + if (!py_funcname) goto bad; + py_code = __Pyx_PyCode_New( + 0, + 0, + 0, + 0, + 0, + __pyx_empty_bytes, /*PyObject *code,*/ + __pyx_empty_tuple, /*PyObject *consts,*/ + __pyx_empty_tuple, /*PyObject *names,*/ + __pyx_empty_tuple, /*PyObject *varnames,*/ + __pyx_empty_tuple, /*PyObject *freevars,*/ + __pyx_empty_tuple, /*PyObject *cellvars,*/ + py_srcfile, /*PyObject *filename,*/ + py_funcname, /*PyObject *name,*/ + py_line, + __pyx_empty_bytes /*PyObject *lnotab*/ + ); + Py_DECREF(py_srcfile); + Py_DECREF(py_funcname); + return py_code; +bad: + Py_XDECREF(py_srcfile); + Py_XDECREF(py_funcname); + return NULL; +} +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyFrameObject *py_frame = 0; + PyThreadState *tstate = __Pyx_PyThreadState_Current; + if (c_line) { + c_line = __Pyx_CLineForTraceback(tstate, c_line); + } + py_code = __pyx_find_code_object(c_line ? -c_line : py_line); + if (!py_code) { + py_code = __Pyx_CreateCodeObjectForTraceback( + funcname, c_line, py_line, filename); + if (!py_code) goto bad; + __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); + } + py_frame = PyFrame_New( + tstate, /*PyThreadState *tstate,*/ + py_code, /*PyCodeObject *code,*/ + __pyx_d, /*PyObject *globals,*/ + 0 /*PyObject *locals*/ + ); + if (!py_frame) goto bad; + __Pyx_PyFrame_SetLineNumber(py_frame, py_line); + PyTraceBack_Here(py_frame); +bad: + Py_XDECREF(py_code); + Py_XDECREF(py_frame); +} + +/* CIntToPy */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { + const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(long) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(long) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(long) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(long), + little, !is_unsigned); + } +} + +/* CIntToPy */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { + const int neg_one = (int) ((int) 0 - (int) 1), const_zero = (int) 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(int) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(int) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(int) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(int), + little, !is_unsigned); + } +} + +/* CIntFromPyVerify */ +#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ + __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) +#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ + __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) +#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ + {\ + func_type value = func_value;\ + if (sizeof(target_type) < sizeof(func_type)) {\ + if (unlikely(value != (func_type) (target_type) value)) {\ + func_type zero = 0;\ + if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ + return (target_type) -1;\ + if (is_unsigned && unlikely(value < zero))\ + goto raise_neg_overflow;\ + else\ + goto raise_overflow;\ + }\ + }\ + return (target_type) value;\ + } + +/* CIntFromPy */ +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { + const int neg_one = (int) ((int) 0 - (int) 1), const_zero = (int) 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(int) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (int) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (int) 0; + case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0]) + case 2: + if (8 * sizeof(int) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) { + return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + case 3: + if (8 * sizeof(int) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) { + return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + case 4: + if (8 * sizeof(int) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) { + return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (int) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if (sizeof(int) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (int) 0; + case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0])) + case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0]) + case -2: + if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { + return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 2: + if (8 * sizeof(int) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { + return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case -3: + if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { + return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 3: + if (8 * sizeof(int) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { + return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case -4: + if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { + return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 4: + if (8 * sizeof(int) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { + return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + } +#endif + if (sizeof(int) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + int val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (int) -1; + } + } else { + int val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (int) -1; + val = __Pyx_PyInt_As_int(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to int"); + return (int) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to int"); + return (int) -1; +} + +/* CIntFromPy */ +static CYTHON_INLINE unsigned short __Pyx_PyInt_As_unsigned_short(PyObject *x) { + const unsigned short neg_one = (unsigned short) ((unsigned short) 0 - (unsigned short) 1), const_zero = (unsigned short) 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(unsigned short) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(unsigned short, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (unsigned short) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (unsigned short) 0; + case 1: __PYX_VERIFY_RETURN_INT(unsigned short, digit, digits[0]) + case 2: + if (8 * sizeof(unsigned short) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(unsigned short, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(unsigned short) >= 2 * PyLong_SHIFT) { + return (unsigned short) (((((unsigned short)digits[1]) << PyLong_SHIFT) | (unsigned short)digits[0])); + } + } + break; + case 3: + if (8 * sizeof(unsigned short) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(unsigned short, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(unsigned short) >= 3 * PyLong_SHIFT) { + return (unsigned short) (((((((unsigned short)digits[2]) << PyLong_SHIFT) | (unsigned short)digits[1]) << PyLong_SHIFT) | (unsigned short)digits[0])); + } + } + break; + case 4: + if (8 * sizeof(unsigned short) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(unsigned short, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(unsigned short) >= 4 * PyLong_SHIFT) { + return (unsigned short) (((((((((unsigned short)digits[3]) << PyLong_SHIFT) | (unsigned short)digits[2]) << PyLong_SHIFT) | (unsigned short)digits[1]) << PyLong_SHIFT) | (unsigned short)digits[0])); + } + } + break; + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (unsigned short) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if (sizeof(unsigned short) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(unsigned short, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(unsigned short) <= sizeof(unsigned PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(unsigned short, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (unsigned short) 0; + case -1: __PYX_VERIFY_RETURN_INT(unsigned short, sdigit, (sdigit) (-(sdigit)digits[0])) + case 1: __PYX_VERIFY_RETURN_INT(unsigned short, digit, +digits[0]) + case -2: + if (8 * sizeof(unsigned short) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(unsigned short, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(unsigned short) - 1 > 2 * PyLong_SHIFT) { + return (unsigned short) (((unsigned short)-1)*(((((unsigned short)digits[1]) << PyLong_SHIFT) | (unsigned short)digits[0]))); + } + } + break; + case 2: + if (8 * sizeof(unsigned short) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(unsigned short, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(unsigned short) - 1 > 2 * PyLong_SHIFT) { + return (unsigned short) ((((((unsigned short)digits[1]) << PyLong_SHIFT) | (unsigned short)digits[0]))); + } + } + break; + case -3: + if (8 * sizeof(unsigned short) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(unsigned short, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(unsigned short) - 1 > 3 * PyLong_SHIFT) { + return (unsigned short) (((unsigned short)-1)*(((((((unsigned short)digits[2]) << PyLong_SHIFT) | (unsigned short)digits[1]) << PyLong_SHIFT) | (unsigned short)digits[0]))); + } + } + break; + case 3: + if (8 * sizeof(unsigned short) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(unsigned short, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(unsigned short) - 1 > 3 * PyLong_SHIFT) { + return (unsigned short) ((((((((unsigned short)digits[2]) << PyLong_SHIFT) | (unsigned short)digits[1]) << PyLong_SHIFT) | (unsigned short)digits[0]))); + } + } + break; + case -4: + if (8 * sizeof(unsigned short) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(unsigned short, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(unsigned short) - 1 > 4 * PyLong_SHIFT) { + return (unsigned short) (((unsigned short)-1)*(((((((((unsigned short)digits[3]) << PyLong_SHIFT) | (unsigned short)digits[2]) << PyLong_SHIFT) | (unsigned short)digits[1]) << PyLong_SHIFT) | (unsigned short)digits[0]))); + } + } + break; + case 4: + if (8 * sizeof(unsigned short) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(unsigned short, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(unsigned short) - 1 > 4 * PyLong_SHIFT) { + return (unsigned short) ((((((((((unsigned short)digits[3]) << PyLong_SHIFT) | (unsigned short)digits[2]) << PyLong_SHIFT) | (unsigned short)digits[1]) << PyLong_SHIFT) | (unsigned short)digits[0]))); + } + } + break; + } +#endif + if (sizeof(unsigned short) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(unsigned short, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(unsigned short) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(unsigned short, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + unsigned short val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (unsigned short) -1; + } + } else { + unsigned short val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (unsigned short) -1; + val = __Pyx_PyInt_As_unsigned_short(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to unsigned short"); + return (unsigned short) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to unsigned short"); + return (unsigned short) -1; +} + +/* CIntFromPy */ +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { + const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(long) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (long) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (long) 0; + case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0]) + case 2: + if (8 * sizeof(long) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) { + return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + case 3: + if (8 * sizeof(long) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) { + return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + case 4: + if (8 * sizeof(long) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) { + return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (long) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if (sizeof(long) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (long) 0; + case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0])) + case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0]) + case -2: + if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 2: + if (8 * sizeof(long) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case -3: + if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 3: + if (8 * sizeof(long) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case -4: + if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 4: + if (8 * sizeof(long) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { + return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + } +#endif + if (sizeof(long) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + long val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (long) -1; + } + } else { + long val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (long) -1; + val = __Pyx_PyInt_As_long(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to long"); + return (long) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to long"); + return (long) -1; +} + +/* CheckBinaryVersion */ +static int __Pyx_check_binary_version(void) { + char ctversion[4], rtversion[4]; + PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION); + PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion()); + if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) { + char message[200]; + PyOS_snprintf(message, sizeof(message), + "compiletime version %s of module '%.100s' " + "does not match runtime version %s", + ctversion, __Pyx_MODULE_NAME, rtversion); + return PyErr_WarnEx(NULL, message, 1); + } + return 0; +} + +/* InitStrings */ +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { + while (t->p) { + #if PY_MAJOR_VERSION < 3 + if (t->is_unicode) { + *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); + } else if (t->intern) { + *t->p = PyString_InternFromString(t->s); + } else { + *t->p = PyString_FromStringAndSize(t->s, t->n - 1); + } + #else + if (t->is_unicode | t->is_str) { + if (t->intern) { + *t->p = PyUnicode_InternFromString(t->s); + } else if (t->encoding) { + *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); + } else { + *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); + } + } else { + *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); + } + #endif + if (!*t->p) + return -1; + if (PyObject_Hash(*t->p) == -1) + return -1; + ++t; + } + return 0; +} + +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { + return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); +} +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { + Py_ssize_t ignore; + return __Pyx_PyObject_AsStringAndSize(o, &ignore); +} +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +#if !CYTHON_PEP393_ENABLED +static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { + char* defenc_c; + PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); + if (!defenc) return NULL; + defenc_c = PyBytes_AS_STRING(defenc); +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + { + char* end = defenc_c + PyBytes_GET_SIZE(defenc); + char* c; + for (c = defenc_c; c < end; c++) { + if ((unsigned char) (*c) >= 128) { + PyUnicode_AsASCIIString(o); + return NULL; + } + } + } +#endif + *length = PyBytes_GET_SIZE(defenc); + return defenc_c; +} +#else +static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { + if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + if (likely(PyUnicode_IS_ASCII(o))) { + *length = PyUnicode_GET_LENGTH(o); + return PyUnicode_AsUTF8(o); + } else { + PyUnicode_AsASCIIString(o); + return NULL; + } +#else + return PyUnicode_AsUTF8AndSize(o, length); +#endif +} +#endif +#endif +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT + if ( +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + __Pyx_sys_getdefaultencoding_not_ascii && +#endif + PyUnicode_Check(o)) { + return __Pyx_PyUnicode_AsStringAndSize(o, length); + } else +#endif +#if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) + if (PyByteArray_Check(o)) { + *length = PyByteArray_GET_SIZE(o); + return PyByteArray_AS_STRING(o); + } else +#endif + { + char* result; + int r = PyBytes_AsStringAndSize(o, &result, length); + if (unlikely(r < 0)) { + return NULL; + } else { + return result; + } + } +} +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { + int is_true = x == Py_True; + if (is_true | (x == Py_False) | (x == Py_None)) return is_true; + else return PyObject_IsTrue(x); +} +static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) { + int retval; + if (unlikely(!x)) return -1; + retval = __Pyx_PyObject_IsTrue(x); + Py_DECREF(x); + return retval; +} +static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) { +#if PY_MAJOR_VERSION >= 3 + if (PyLong_Check(result)) { + if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, + "__int__ returned non-int (type %.200s). " + "The ability to return an instance of a strict subclass of int " + "is deprecated, and may be removed in a future version of Python.", + Py_TYPE(result)->tp_name)) { + Py_DECREF(result); + return NULL; + } + return result; + } +#endif + PyErr_Format(PyExc_TypeError, + "__%.4s__ returned non-%.4s (type %.200s)", + type_name, type_name, Py_TYPE(result)->tp_name); + Py_DECREF(result); + return NULL; +} +static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { +#if CYTHON_USE_TYPE_SLOTS + PyNumberMethods *m; +#endif + const char *name = NULL; + PyObject *res = NULL; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x) || PyLong_Check(x))) +#else + if (likely(PyLong_Check(x))) +#endif + return __Pyx_NewRef(x); +#if CYTHON_USE_TYPE_SLOTS + m = Py_TYPE(x)->tp_as_number; + #if PY_MAJOR_VERSION < 3 + if (m && m->nb_int) { + name = "int"; + res = m->nb_int(x); + } + else if (m && m->nb_long) { + name = "long"; + res = m->nb_long(x); + } + #else + if (likely(m && m->nb_int)) { + name = "int"; + res = m->nb_int(x); + } + #endif +#else + if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { + res = PyNumber_Int(x); + } +#endif + if (likely(res)) { +#if PY_MAJOR_VERSION < 3 + if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) { +#else + if (unlikely(!PyLong_CheckExact(res))) { +#endif + return __Pyx_PyNumber_IntOrLongWrongResultType(res, name); + } + } + else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_TypeError, + "an integer is required"); + } + return res; +} +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { + Py_ssize_t ival; + PyObject *x; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_CheckExact(b))) { + if (sizeof(Py_ssize_t) >= sizeof(long)) + return PyInt_AS_LONG(b); + else + return PyInt_AsSsize_t(b); + } +#endif + if (likely(PyLong_CheckExact(b))) { + #if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)b)->ob_digit; + const Py_ssize_t size = Py_SIZE(b); + if (likely(__Pyx_sst_abs(size) <= 1)) { + ival = likely(size) ? digits[0] : 0; + if (size == -1) ival = -ival; + return ival; + } else { + switch (size) { + case 2: + if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { + return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -2: + if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case 3: + if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { + return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -3: + if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case 4: + if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { + return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -4: + if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + } + } + #endif + return PyLong_AsSsize_t(b); + } + x = PyNumber_Index(b); + if (!x) return -1; + ival = PyInt_AsSsize_t(x); + Py_DECREF(x); + return ival; +} +static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) { + return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False); +} +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { + return PyInt_FromSize_t(ival); +} + + +#endif /* Py_PYTHON_H */ diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/resolver/cares.cp37-win_amd64.pyd b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/resolver/cares.cp37-win_amd64.pyd new file mode 100644 index 0000000000000000000000000000000000000000..7df5b6dff1e70b259ed1e7e3b28ee14b6a7a3132 GIT binary patch literal 189952 zcmdqKd3;sX)yJI#4us)y<8U;nNYp4%9FRy$jA#N0o(ngMB8meN1r!w#;iiHhf=Mjb z3>?jF~rGJM*d=OD0`4efmw2lB=hb%xsuma^3Wjn)An&+<4REDW?VkJxhJo z?U$W#&2K9&8GP#$nBR$KJf+W9p79HQ@4dpL zTY1gpXDs3Qx0ROna%x>XNrln4qoJzItOWRbBGtkwwXvg1n>7E&oeSd0X%IpY1<;PPffh=YB%aKf3l9yM1>deVkMXt)r`*;kY@XWiA z-;?;w_*X^DsU}%o-Z&x_6YualuS2?)Q)ifjri>Kq2-3aMAzjs}*IskoonX_h2B1&b43^m=3&eBbpb`uFjmU+lj%eu2ey5YqB|LUI;vp(Ndkhf}`|IdkD zR9X~{)|3{9qv6t$u@_(BG=4nDakn|KNNK&}?oX`oJTL67b)u2dGN*B^=frDDOGGAN zca`J5?YM-goGHBwJm#4BIr)#bW_HR--I+cMrKPt%kqTyg? z#fqY9_O9@}FB%HISmmr(UDWn{l90M;EEq~0cWe1-&;I>s7_Ph4v%luXv!Bz)*5y6A z=CzPf$>olB{9*|MJwQGly6kY6B$@+xfQfWpCK_FTq7w^Ddb=Pm@eEInTT?pJiCUw! zKoyhw#+E{!w~@ect#S#DT2H+tPc@}g+%F*}Zp|k|a*bQFxsxgyx9;%omKF-*8(Lr( zxK$|QUGpX9bhsP1;~rrg?pl%z%y-;CLoyJ;{O^Gfr|eO#p(4F1qm3#g;o0t~0_gW* z*X3Sqd5aUfNc8i%XU~xs3R~ecPA(k^gmCFp$0auGwu)E=h27UAaE3gTm9KW9SCp1` z_9)1_c%xS^?{{Qa!w>9yWmL*c`xJP2Ii9^7H;Fk-1 z2sLf?tmn5D@jGU!%6>O%1^cdl%K@ zcG24llrJ{iYuuNA%Snkp^5Aa4n+(DVnqoX50{3mopLp_H&r3!{evk@Yj8IK*qnF<> z5S(X#iidR);7KfyQk4b@Q?^eDYdmLm6KASRE zRbM#~$y07)r_;nvBc(M}gdWn@Q)<8$p@z0w{^NOqiMp7064yfI zK4yyJc0GO&MR8oGu-$ShTO)^-x9oO;zY9#oKQ(+h*wn@6^V|0(X|FZ3-L+n{_f4G7 zGnV?43GO<$rM-LN5gwk;C*Lw0_s6)0L^Zb6L?t%-lDr-w9aU9`4o=)-9=a!*xoQ76 zgFZ2fki>K@e&7LQ8*=xHK_QQ}L<^!s@rO5llTWkYZb-bHRJ_QR7UrVT@ouB7j zT~>rETV~RVuPkeSr+kxxrxB4H+IVYe-feQ%6XWj2Z-Lr+v1ubgS8~_Z#9SbkZ$gT_ znzlD|cYbJJh-)|MFnV1u>=tqMcWsSyZQ9h(2Z!DY2|p|NQDYU&CHo%s<~v0qTirEI zxgCVC@!fNr&1;;-uf2wzQvYv*sy*mXe`A5qHlwh50kFEc#R=A|bzEryg`d=^#IK}L z-@E0=mc3iNRwBxbuP^cKqr_>PQk>`fY48*8obup6so~Z*$-Qz_!%a@CuGq7?4G=K3 z#ZI)g$g_)ia$B6!<^E;*>DU}t3bShZqB>SlF1dcM|(H&xJ@1@#02#V;8iNI!JfrEH%E2OcZ&uMe7d=hiNk`7K`*Te^4;ikZsN6fl_)^?R&Z(`4tR((VK z!jD@JtGm_o>VAvQlzQT>U4LTZ@vWPHLP2+zZ>nCpk$e)56E6XtJ%M42<35tWjGfs1 zTLgr=mR^%*kCqsioR#b?#dc_{CQA31Ryna)LL#KkBs}G&L^`AgE9>S~iKJIG#)&pd zHrQ)S1FM%lAh~L%vU!ozBk9#RuA!i9tfvD#hT&utzZZ#*@$9qVNee37QTWmQabmT* zgZCkgno>tH{dFm*$*sz>zu*>M)^pGHBU_HKUU@?b`f%w+#N;e|MWi($qdlYFrEQNB z>o@rO!eYoke%cRn+)9TA6ieQaxK1Fv?KG|`bSnQj^ZlI0Ncse+K3tO59=fXV`i!4! zUj6TGWk#q@*la-)xN`m@RPXBsFqv>`9pQv$H#H|TDikKFDKB>B{rp8@U z<8G>6`1zFSk?X1#esSIODWU3xyQfE{Osnm+vBuqA<66JpSddq}@XP9k$kf_iTiwky zy|ym=;@m0I8_HL^`)Yb^Qo9X45v|=_m$CTd*;$6+nq^7A5P!|J;g8pBJppn<=qfiS0q`QapWLbleVr?5f;1ue5x%LK8%F z`v4W4kO(e+uZMChfac8&lrFgZ-9u+hk6TqBr5ey#J(D}y7L7V`)>uh#)T}Vf@;5pw zc9uB3HagL9MR<{-(r#yUYZ&ZWy`gAqEsR^=EG)>wM)UU6CQ72#S3E@yX>2WtTRXYM zqVl5F4(`M^^7*?%oULBzeVf{iX zsRv@~A@1nsTBF5l80n+Y^@EDIvL?X4nq8 zobm_8l5LpQ%&np=UkS`JA0l7;ONpWg3yQ{p`O>(JAg{IFm_ewTp?uarew~awD+428 zR_(S_yBq1C@O&lI!TVNnw+l?w1XlOj*lQ#0uy_1N=qDv^Q}2x%alfWWjvFF3yH12s zxhC>G&%PB7fIpeev5avkJA;2qg~V7^ns_JZP>vO9jv}^+ly3yiq`T8Nw}jIT zsE%F0bkHmidG-{b6L;qA1$oP9FtNZ^NrM>25+D2{BgLULrDrr8FSmoa{a(Wn;$iOA zJe=}%iM5|dH{cZkL7Pna<*o1$!z~L-Zgei3|Itit=EoQ`;WU(=BZO+xML}~_BCg-4 zT++;^XD~NLA^kO}ZRx5OY+5K8x)1d$&QwB>#hx`CS&9M!j#n>3AT2T~ch zChDY9q<*I%Xp-m%UU|zL9aAic3hh`8%n!b_Pipg6t<4u=KQIWs6c_hhf}ZJwcJi-d z`6IQ+gRWmoR}81{mXiVe(ssu3O?R}GB9|^Jy&XP83bmIB5jb!TxphQ8*GKPm1dl^VVV_Rk$-gVOAIIM{8DSFFN%6El?%91x0Mw}nbo6hgsxGR& zxLQ3`*ggIfX>-j4$bQe>+h2U?ZaPrKG6C9}_(4}Xsr%4%VGUk!@0Rv1HO#qD;wmRP zt<b)S^o3FrIEZ%z41+(o$1V^J<~!?TS}vue!9K zT<5NXnM|T=NIa^RsLjq)a__qLo%RCvKaRVRxEH7)Vb_}UI{ghM`P|Ji>tsI#RL9*X zcGw%F(HYY`yGp{Ew=+)8arn|DB=9tC1vHHsD zD{_sNo)wpZ%5u4^n=vxdNrv5}+$Ip+V zqV&)i&hAPe#crtT0I#!xl(&Rq50^^DA@}m4kb6UM$emRZa^I7t!Wy*R7g69*y=#%a z{fzQWsA{UJSRo@+!N+hpF!YjBpy0tMq5RULC{-Jyw2WoES) zBVn}m_ti2-{W{kwN*%XaxFZQ1RB@t0bVl)+-5ONmzUmHnf)r@jeJf1R&_ubI&!pWo zm3wX*5JC-IHdRb}yRd<|%-(N1(WBmW8c)m*Hs7f%s|&G<_S;DxBg5{K>Ew4{cGQbnS(bx7!+a zhcjal=_?QW(D?O|-tES;CH5V7nWy&4VYBL03AV#ZR9zT$7u*XQ>DgG-9#Zh^W29P{ ztS^MGXD=w0fMKg)EuFyHVYi5#HJ+;OY9zJpb#YfH_e7_1*yY4U4&&zMB#)dSzRW%c z24pax{FCS5hi#i>dK6@_J~SKBLG;)F#4>aoKqFHSIs zST9GAro%?xfF@`aD_#WGh_p#kn2ht=<|Nk+{+Zb`w|ZX4O_W-W^vFLyt82q#bVzS! zgN`UX+fi9)t5d=>he-0zqF%B&H0k8hV}|z1u)AK@1~;OS#0_E`ctVV!;plX4L?+QM zU?f7yc;Z|&pnZ-s@bnU-#mSsUPhywfIx#Tn(*?zC2SJq?rT3kcPx>z*I!#i%wi=gZ z4R=Oib>q%pH4Y}&Br6!)6$G0eGI#lrvDJ-VcZ~oyFj+(%v!}TH$k6I!3eKv>pGaAU z-uuv`dG@)!H0Foh(M2KVdK+lB#um4UMMJ#tE^K~4I(f05{Cr7Ha6{MfP0aGf?Au8g zW`It!{}?WCxH^Nw zbi;uvV#xoim{W2^(pAj;VuEX;u=S4bV#{zl^-r7+_Om3v;q)a1k^a=*h8|c?p;YAl ztP6Vfa&TavV%@8pO1m5=5liNFccsSI8C}tIJD6N5+=^{7N~F?#AvFz&Z>;v-VtuLk zL}@qO(Ipz}xNrKw2b*9#0jbl$--t5Y(L-~BcbVX-oZ$5)*vSc&1umFqozLL?m=;$M#8lO`|3tF;jD5QkHP26Ma^#BAYU06B4iXkrS_z%?L~4&BSw7&chH z{1V?}vYV{5)$G8&XL$DJB2lAQPxOWvVmvzYH;pDt`$I_u=K9;@mms9_!6z;pl7(VmzG%2P^O*T^z5w6P;bc zGgzFVj@QkJ(%+0abj%$(>{G`$UM*N_N@t53Bz<0V^lT?OdWI7<;*A<9MqPEtQCH<8 z!{rgcLFtl2SrlQ4|g>+cZov=R3q&t#MD zcm?eR(ojbwlTh?t%?lgJR(Vd(z?30{-}o-Ye}&^NRLLRTkhf8sId>H@l}JI~ACqt8p+K@ukhWp(E+BTg7#W>j~vwlO&|Mu{2r)1UhB$$Tkp;NpN^>Kn0w zWT|tEqzB1AC3*V>>i8h)P$(*+iT_e-QtjU$^4Z$JRP5Eg$tyYn(sXrqc@)t6s0A3T zetGb6vS@7e6${N0hLkt$53=1rk?cAORT-SxjCESODg31ZC}zJP^S9zEuEP?NGDrjQ z?+`3JNmyO=U*wzPmJA-ev&e1e0p$js)$9)d&(G)jc($UP1L8@^myK=6_bA{0diHUm z(&z|s$`mvCi@E$h};<`;F3zg%D^uLR@+lE z1tcp_`|*MKPs-Tu_dTFAD^3x|9aFgXjwN^m{w-jz5wj;F&GtjdVfz!Ls~Axd8ARxO zm2u#bo;uQ9Dp6tq6U8EO=KjjJcbHjA?hgZ=%$o%qArtz)7V0>9oo5dbRIz>|m9wnV z@Z8)o`vqW+B20&Y3>SY10D>QKJnKk;+wV(hCZoLWeqB;v{ySCFhF)f*q6lQ^$&6p@ zKJZHpD(P6KXW0A!q^3{hk$IETUokVix+yX24mp3R^jO+-tSEzxVAHPWxS8vk#FjGfIQbCT8!}1qj7(hLN_b=LOrlN9rya8 z@;y{qX1wQ*2*+j?%luwQW`brH%Jg%I?j8okA~l+ZLz3E^tGh3|^fA%$_XBfQOi_7HP!nwYT`vnh94%(Q7iT!Qb0p>YJ*0nESk>f4h_U zs2_`t%-YMT@IO-@QN!;nRl^a4onZ3p{{s;*wn*%kK3tvH=xCQBKelKr{J2C%t=1J+ zlSz7&&4~@`c9Q}!`I!8JO>s3Pr?7FEdVzT-konEs$Teo|oGzJfpy>M|LJ5YOz|hvD zBvmEOuzJ=UX3@I}Y#Ri*wV(R~`qWH+hhu@;g@6=g zk^%;M8(7|J75*}z=dYznucy>--Eb@#-*x)+bZ@h^gVJ_Al*|dU(I{NG zYF>LSJ$}SrM5^FD#%~Slqb6}#aeDuK$i=0mLC?$peNDJ>b>!BNyKub79x0v@cB_iY zH_~c$CsB+`H&)QE@QC!X@@D;)SC}4rCJ2;gq7;WJCK65HJ z$RUp2JD_4oXq30}kV8aNRskYC`H-#&$J(vpn6-c8~octy;luZbA zVK*u=kSVs~>S*B0TSNwSC>APqDh@)sBK8&J(=zWfHl6r+2$cx$@*^+BufXq zcl^!y8HQ&1SG0JZy&n>7tvvgCUGz3ms4TSGkHe*fN_SLzmNIq2a9y@cCx`yE<$DgjL3aJ*}B}MJSn=4XI=h%9Qson!T4Feq zIqvzziAN8SHPhX>6XM7n7sjEcboJIMluSPw`sV9OUs5WppG^i zS`(|fBV_iEl+bHXr3|}6q7G-Jme>X2Buhw=jFlv9kDFcKY2C?PTHYC5m-0{8OD*%G z^cO3xL)u(L+UH=zzO;WtcH%n+ITbe*MJiO<<;#et-|&DMjXKUrA{}HEoq@1l&yw;G zk@6s4K~vHsgF;?6mGTTDWtpA96p?P#!Q{#0ZBD*G5A7SU zIf$82y8E3jSIwka$@Ug}Tza@1j*do<+J7AE<>MAtMkYD#BJnOVVmLjV@-9>GD8<*@ zEB>WA+rOAv7wo?PWg$=Bzpi9@)c9Asj2(cPJ~q;qEHQA0jL8c*=L8bZ=P0om0mS%^uvuCzwmB8z+!o&; zRXOnBxB2vAnQIci_LNZN7!;e?ty1lc$rN5AZ=bQyVD0=jyEVsf^SIoc>)ZNsLT|e3 ztuo7q<&wn-8p>kDAIQt^hdc3ei$&rMWSra!(axGD9oD}}Dk;tONTYxWo){@D0mZB$ z>AWYG!qkfd%U%nX5o=(j#Gbmzwy#R-3ITg2sGs~#KCZ*5yr4+BYBg^Zr~EJSn<^4U zBW$ywojwRqY9x-gLkMPGD9h^f1=waaS)uL|Q(<2mLFL<%dkvG_?;d2?+1Nvde-Ie+ z)4bfScu~@3v;s-|+hj#2-CUT=fBTJaHfw*m!?YCVlqmGZRIb$s;0s_i^h7`9o7xTw zV)>QU01Cs7Dc8R8S6Bvh>H3ViG&Eh8j?}tj)<>vMHJSAZ>Os$H&y>Zpwnt>uw390J zCYfhdsaC2{(VnWJu93gU%So%-8rf@`4PBqY?%zXEwwy$7DE42Rl8P}N4;>w`124@( zeO-(?6&1ro_atmomyG z@t=xY2u1sZT~gdi^}dX@9!=7~Inm)f>lT^eEMj&tchc!vx73-U+zQOF46gvNQ1nzs z{y)vY&7MS-(rPJkgAqsWES=x6A1`f8z0|$rdtSLJOZhJfZYH_eD=7n1cRWSq&Dg5K zaMYnwotwk|zI3L&qtfKAB?y+V?)=vwk4X|RIf8#>QpK1XTFyF9EuAM@>|o;2hT!&^5m{) zf4>uI?SHa95qSTX%q`HJmL>A)eb{HrUOq*dbjJ2I9TSb*Dtdnh#3&oDo?cT9W z1JkR<`sUY2T@6?Ch+O5@QtCCMic>;vi|M~>dlzCnVcNTJWnd`go>@5?Wb`|0uc8Qp zqRtH!ry7h|B=*sm0Y-K^4`qd++%#G7(?ND1NlMK4qeZfUBEx|$A@5yM{DvZ%6ly=Y zowC%nw& zqVq~G3Jboa-f<_g0p(iup4?I&j^3``KYO;plC~J%Ud1 z+2Xi2k<~2+&gz0fk8N#iU_8iayfII=-PBT3)*o=o3-3M9>IBX~T%MgzPVIfQ0p0Tz zndY?O+FWMzxM_Pj*=MNlt4n`S6ho7+4yFxudYkXi#7BiVNl`Mfdn7h24MR0U*(HUM zo{6>MBPF`2WzOI_CQ_G_M7ox*Ztu#>G9#*sN{1R|>}HTH*2z9%@;A{dNuQFBR%s7hp$3nkkwCA*X*$Zg2nt159FVystrs4QgvT`X|dRWf%t4@u!Q4#qNb zk;)d=wI1`7fgg$5+%4`w3%_nf4D+qnt*^ItTk&;4?5qpfPbC>RB^9$vZtLmUH}LdY zRVi+1d&9Awz3X3)A_#c{qDbyz_UUA-4r7b5)t!8FIi$P?aF&!<%8O%Wzkm!n&HLoY zhu1gupzpuHSqGjBg|;#Q&*26oI<}HwL|IL2WI{h#$zezeYl5SU( zXV+?xq}vr4kuyH3rO+%r%RsbCq91S9n7)^89ZmK#JJt=jIx--Y*Yjx8#)v&g^`K$P z^3zleCrmp&gMIO1CgKY#H-?eIpgNcC2HS@Mqradx9jx2RG+q_)pxetADXMRhS5V2nV9XsW4nfr!;@3&+k_NpFa)e(S%~9!=B3cq?fJQs+m6 z+`|}{hUqNKkiN?`?8y%^C3U5`1LkDJ#y+L5Moan6)T~=ku&Er)K@e;zg=5zI3-e(; zm@x`A?G+G>Y-EX?E(6RR^=H*L9OJliirPmyjZ7~+E!~}|&cN5575lq{qFpz%{ZnDj zscJvovwI;|$L(T}xkKG^eGUw#Z!eNMczabym`kg^nthd@=QGTq6xHOlq$<)AH`Gn~ znC)G;RymdX8kj`v6>{IuDiYhBuN%zg1U>sfNGWEpc|Ju^9yAxcjmlT{z(tSt_qsOvS^?J203OhVR*@ zQ&P$PW=74%UDT@~vLAfnmAozLUaA858p!1C3#8Z`krv41Dv-;w1hSUo-zktS4JSG- z!ZQMy_Zb4&!sJFT)(<2n^nSAu#&))SvSuJ6X#Q44_A&dgE11CU&drp|#k>O}p$=nr zi&TO1S?Z9f-)GDzOyCI8LisF|StLgsfF#R3)4yAxZ(Rj8f2wSDU8ePmKEyUqXQ!2? z4*q;U3v;|9^OqI(}wE4GMCLM(4xN^s<=Uj$4 zx9FMKO z^9}Omh8y_k6D?>t1x>Djdg8vyQ zHb*t28@bE;M(!vYx%-4Gjof%`m z+?EbMR#d}uO_-iZH4RU?Z^BbSgqgP0A#W%D`!dRvkMD8o#cwhH8g_3k#<5Z-OG1-& zd-j{4LMY@=LNDO2Jk=l;`aOXz0QKw!P$CwYpM3`@Hr{?H{inv;OGY$|l!m;RsoDlP zS)+abyX=Y_UF6UekZjct*vu%|s zreJ;fF%F?{;eNkka;fNSe?jc1kZ128Dy_3kJgLsycsRz(9=st^!W$xGydg4(H$>#M zmW+W~j(jsFUG)TugfT+;H|_cI+KrkLt=eX0l|6d^S?N4cOXM=<9a;|V3HQ*=W4W*~`Sgp1|7hx~b z9*rfOz7~xdAWivG6` zMJa(HJk-fX{OBR_{w!7h5S=zsCzTp;@ZKmol-N$k2UPH^^lkscyGnjJlJkQyb+IMg zA&c13VGFy9WP(Ws)@-MEL$*_#EH;E91E^SZczK%~2&Z=$z09RlOT33gx$dnmRc zAs)+SwywIKi6VZcGEpRjkl<=yS5M87quPtMs;pumtU2|x6%_RXCL5}mYzQ$su}Stt zouvDsM2&0ww`?d%&YOarmQQUXx0%Z*Uue9{JtY^^nN#YbOR5<=Ub_aH<@Ck21v_$H zo`Z|vH~vTVn`rMvH=G*PV!qbrMpP4e1gYN`CydF{q2h&szXd~xue55>mVp(5=Q z?+k4VHhnB1Oy&El`@xv3OQaoEu<3s^!SJ-xnv>d*RTa6>aT~`=@0%)fhOVNo))iz~ zsdg%gA|q2P)vdCE+Gu~!2Cw4MO_Vj!dcK5sg zqw{!B*h~m<%_DvY2PjO zTxq=wS{8o1Sca^w_4VDdy`{E%mvoJ$vbZk4vju&0+#+7|jgEVOAp%{a`r7hODr? zz9&!udqvAJd;Dm>Pum}5(crc<5}nxeS8<`isM%*^-GGtuKH9&2Ebpa$&6VoF-5Hq0 zdjsIsIIM(%aRS1j!n<+UGbG82^sRBNH@Kri`UJVSb|L8#*RIr&#cr1f*_GEtNlwgn z;?@?zTp3J&=DJEMT+|9HmkU!|?uJXS3@&4Z3una$Ni6W|5I-Ig zIP@JQyDfv$9K)$VITfZj4TsY~!l{RF;#@{pP|ppLKdVZO4k`@&${%U@x%%aY{$QbB zttS9lJr#*PLXfzDzek1JNc7=LV2dj-+T~pl7CV4;MX2H#~ zPZQy(3smE)GDNGDXaiSM@E#ByBSahjErPSJawKbfq$9G!aEF8E?~4eG*%Oj+ucWcG zNo|cUGq>H%hWD!!%AkMX}ghUrJD*``-K&El6j}R=$jc9 z_Q_;-gxs*pa@awVzzrO$v}^!Amqn9bZ!=|dtzJo%v?GeR--F6KyVqB-9QEj0ml~J36T6RF39fQdaojofE(wxpc`zA=fUZgG?YU+fdY{7?TKIi!SiZ3Nkz@^ZwS=Lq!0AWmFKl>IIbg- z+Gggq?*WBxhg;PSHzvKq7b2mkH5X=aYa!QS74x5{1x>>84%LdaYKsUmP}+#nqjo>} zQSbDughyF-&)#KV{nVtN2OE>{4ozs?KtLPRFta{X17;1qBJgmNZ+5+eAZ2#L{!O@= z-6Uwl?D}0MS-XK}m6my<5t!ZgG_!rMyf4Wz8VEs3OTJuwn2o^fx{KM}wH3f>cAl8s z+C*PDVNv{*r)IZP)D*RDfKlAKnd^}%k7r@?oXBJ59!ah%Pt?J6py|Zy?)U3~@m2#< zT&BR~H^SwFV>>F!*H4AeLWq%kfl*8LYOg0k`#WfTZ}lm+$l<38rIhmer?p6KbJWlT z2ft=lAX%;1gCt#A#K-WcBF?+R7x7+6!22so>x+2vTcAQpv`0yn(ZB~H+vu=&>W*6uvRo;`393etBAx^HPDDId^q6W8TB!ks zO95P75iYArI*OQ5eMBjpXutR5CsSB-4t@(0bXqK>aswfrJiDB1{H{`~C?;xMKzQ7` zgzM1?`^Rv4Q!*U?FFL)eqkmv>0m5x6u#~%Z4e_B$d<54KN_-K-{}kdQAtvvmw6Khi z0&7s0XTOLjja&bKXQ5GB=m*&j$b4JasjX19TUTp}H?vleC;cPO4rK%STI3hC8eto^ zqFief&?K$wW32+n;3(A%G@gj!R8?j((8 z&p`3UhMw?g6wub&3-XH6fF9LGEJs4pc*UCw0VH?4ua*tyj}#RNouhzixjG8yb~qm) zfJPcXpYd#LNDm6N-$Bj>&_OkLp21ylwgx%2E5Z)8bmrc}D9CG|CK<-D(k6$1_4O!JbO?!pm)W_IfqFB&EQ(6fS$o-E*3yHf2tB1 zo{~_B0_vFpB=3w1jRKkl+4wY|p`8JeJyP-Jp#YLQ&Mn%QC803}kkr?>^$u4#&OdJT zh4a+{XosB2=-OK`4x_Rkk%s+6DBeiuS)WD$?VMYXH#rUHS0$ZDsJCQLJ41dv`=D$z zE2YLotf$0(q$Z!O5XRRFE{Sj97noQ!y8kjAqwO98sur%^zwAe)y4 zw5We4;^9+A0CE5%cbwn$dKRF?QsbB}Q$VM2y+8q72j@El&>#b-M+(q8m=gOQk+YG| zH#`fC0vZh2qBNkrbUHdTWI7aX9uFY7^Xx0L0R;`92Vfhw9_4zW0@^aCAnzvv=&^Q{ z(9)F3&Qm}`Q-H4bX%x`oklmLCbWLY~iX?;PdH~5C`;*pZNoc;*xTw`#0R^~@RY2#$ z`B4GX#{l|lc2Z@32AXI83dI`9!*v74STrW~Ue+0lY0_e7nR6-+pIo8}C{iB=nL`qkujI z_tG?=-_uj>U_-pxg@k4UNbWf2B^%IMsdQ0G>TBG(jO)b;=sq~F6hN07Ku@Jq)>8rf z3ppD=C-^i9XaZ!fqyZh<8K6TI&;kI-oo7eaW=ZHw14!y?+*-}`5(U%+&aVrgH3^ka zV+zn5(s=fy6rlTk8U?ftL2gU~`Z1%f4ib_@wRrO)0Lh(a?^}}v=xM2RQA_G;+#1St zyaJjD=WPP0!T=f!Kx0D*?3VMNkh76cSD!`!RYLanG$0uUb^vsk0=gGKa_8CCW&oYk68fQ3x~L`fHEtcol@DZaHwMmM2%y6apfR(O5_%2gah@BBHxk;(v(PA@ zzL5PZ4d|bJI{~C~8MO)dVIDXe&3-ZPsC5TCz6EseG@6wNpo6kx5Eif9CqL{X$VT%IscTW|8bvdW z>y?V;m#{rd(A;Ryybd~J%SS1iZYeZFeHuk`6J*6{G-q^%Mu$GN{eQ`wxA($q}Sc=i=3H23&4isn_w z&Pt=X3%}AqHYJilZL$1#_P<`uLh}o$Vo~c7~`V;?^&@PLjmdjv4fT1kJD5 z#e&_mrqEohXsS|ZX8JUW=4r?-N~4+H8JY!>L2a4*c=nc8vSbsLDi*a4Ry4(2Cre`M zLfBp@X!;s7FWi{48^Pt-FQ9KDn_WB$jiNacvidZd9kh|TvSBW&VUTBEkPV~2z;Iy} zw|>lZs=`=%Q$gPK0^=v|dfqbQ6n?AXWM)(+Bd7RjHT#E2J}sU7RgyikkUHtaT+TQO z5wDdIjX(QaLjdpYlz8^aRVk^kq*4Ua>lDB!IL;FQz3Aop08SMEY-OxBXQ;{iY+$(5 z#%N$I^(Jn;!PSuWf_%P^Z)4P=6QZv5ePk4`t&+l+Ip`AzU`tPl&;I*aP@3U&y+Zlx z^n$#5gx3Oi`DvdNDFS6`29%eiDzd(zP)4T67eIcmke{E1a-Rysk$ENqrBMX}6ba%x zjVoc5n$7$g!@ohHoB^-J!s{!BhCY;HAIgjjC?^{ze}FJ<{V7HM6}dbiEgBHWp2qp2@s$PGSf{zTahW1U1;w{g>p2!UJ+jJ^h`;mK%vww$Ut(qL9$rP z!1`s1ddIYayw`;Kw@~{+3Bxg7TQ8GJ21z9Wip0z__0B?a8N8+|lKbHGmhc*vMlxFj z7_D8Dfh49X3mm3Mj!IEq4D}YFK0b});Ohm+RGCdONb(6#BxZu?j+RWBY{cwuQY1a$ zl@MNQd!%IYsi2P5vP-K~DzQ|bE(Xcn&@um$qF#3c)4oFe5Y)a*#E#?5W2nT^4jM4i zk_s|S<5z#p1TzA5GZf5iu=`rrot*}Al>zfW2AChH&H|ofWLYWdbD;jWQ1?lLc~-?T zn*bll&y!-2Al{$KLb42wH!G4aN!EKHyj}#cUxD5h5n{FDGoZAq(gG2Ma%+nGMacUI zc_ZY$TxKKbc=H0-_vFvWWinx^Bnk5DfBYp=E(2jVlkm7T1$IXZyA#rALW-t#aR!(x z4VVwbD6LPp8tMU1mk9M9Ou+~9C&Cz%z`a)r%&!PjFcQRh`&nQfh21O#v*kLv9>VTH z*!iM)S;QEvU6KLj4b@xVG6hqgqW(G5gN6FKG#Ihxc=Nq*$MgA;8J?7k1bOzVKW9qj zAlO9|%xKsR7k0hVU`{h&p3eYNW5BGJjI7OE4RrwO8lnC>)zz1b)SGzo18|pVBcrBI zNT-r9GfCge0@DP$1_kq%sWkP%?snMul6gX;7_D8J0p=yuT%bz9j7(84fcj#gK0gg+ z9bxh2#c-D?BLikBVG72~B0c?breyX~2Yx`(xOF{E0nJzM5<|e_I8Kk4Kz+4ZzTNKPwu$wLHrli3v5-CP& zTQk5sqM8ewpkPi;QC|b~twKE{4Q9Bi>3O(I|JHyxHEF;S&^Q>JA8LF8-&b2#ko z5_a;zI$tv12=Hj_#tbk;2F!z!k@Z-Ldh0a>d3Ou-5~zL2+(uZuc`4jwn#h2;jxbe| znK>%R0y747a}>;7BzsucjZTA^Zoq8G0Mn?N3-nen;_D4{7;4#p&~{`R%$CUlrUmXY zMP$IdLYRUvvqlZeGbOVM>%LXNd^?48W?}aix);7=-WA}{+8r5S_Ne9pw?h}Vnp4z& zh5C7+z6WYwG6NM%E8Jyz$bdOK3C7GACFuR7`!L^w-CPAT19mOK?({U6ixi9;hmdZX zrW!P#i*;Iixf=4*AzvxvvP$Qp8K!#L2zxr7KAIDgdXgaKceBtef!#bsvlGypgx!<$ z3w_bNCSs&P;8oBa$%b;9>Mk%z(Oj1ze-iS)2|3+8MYBvMgB;g7LLqJ8K?8JiL^r}h z@GbG|wM#RF(-(fXDV(wJ+a>%CO~d)V52woP0@ikWw1M+COg?UH<7&tch5Q2{e~)Hb zgtJVhf`GG@hzHpvKkYQd9@H-GI zRda#S3gm(mr3>Xgp}Z^!M5cfMvXY2+bAksAP$0h{EEKH;$cry!ilqQ{w=0mdNKtq) z?7rpE2U4OybT}eCnF<4BrO4fCZ%Ffek6uhkU}W6NgTu9&@tJTq84i%0uX$Kos0bam8S$pG?Ec1dCzpZ`!=t!jOct#i%CGWmc+7yT3#v9dv;PgK+^lA+)wrITezR$ z-?wr<+rMY0^&-)M|G0%m>E`&4J9xY|^{C$!)l(0>5J>KEy;>F3- zx*wbk-wqqX!_nuZ9aN^e`&-IKxx&#U&!@u|hoeiSQ83A#Z;@NJhwHxa=k-v6x~00~ zyskwzoY%GL-txMQW@|an*)Q$}f`1e@gTfM1{vtCEYD5fzdr>cq(rYn`IVioYNE*nT z{R&J~e08Nv4)FR*;91Pvv+su^lLPRG^K5wJ!(*QCSVB)K_lyg6xxD)aF*y6K30RXG zn52B_3?JEsu~RAn`=1DB{}b0HN*lMHoyh8yaGj|qPTCS*zK1>-W-5+3?B2?;Hs1Vk zPVCl<^AjDnJMXs@%8OzpA}IOBRx1`y?KwogUL_mjmg;i^JNYtX&egB0+{^i;uHB7H zAe9fr47vLE;F8nUc$?jlddsIx5)+;lIqD{xOXAilusoq?zeP?D3EHQ$J_MRyfSB{D zkCig>8p8cr>8w4f5bJj6X#Y~we}(!%p}upYd_-O2!@OVR+BZtIbze_3ERhIxMg8N} zXrD6V{yT2n0r4Xc*SY^{8zn84YkyzS#*y|{SBci%(E`tb@}Nvg2g=8M$|5L3x}`A0 zUNd>sg9?~y4>{+T;2x#n+b@DLwk7&J*p%@ha*kV%%T*<`9rZseWqe|Th|rn@RXFy8 z;_~fcvmW}qrikD$!J#N8tn8X!bD;BR_aR)PPxQ-vYx%SqyT911_fE)*%XzeQmH*cB zXho6z9{imsvJ2Wrw7stofvy!@{+Q1``!eN4g-YZJqm7o%?>t zo2xI~8&{guqzStp#;xB0@nvB+PXSmVGOTl7mBSTXy9u3zD$Xrz=q)EqdiF&WPTtF# z3`#0y2G0|~k>WW4o_`UZW$+A{!(l>hEsEB|VO(n$)eY32R4eLkmz%R;74ou2I)faC z;PoWr|B${_*h_}U;AfypLEeuDG9f<>RDt}v-zsGG{wBpRE0gCl@LU7W_Sv1_wQFF? zTgK{})+R3gMG9hXzE2G0--MC_3G5>^A(cDOhUj?j3TW~gOc*y3w`xiH7D;^!ABJ7D z@i7TSw-lsSY&&YbPDs|S6sMFAU zI}LrHvruVAJ7c`K)6gZIhCbhE=+aI@TRIJG?KE^_r=eRq4c*Z(RL*KTIMjG@X?_ET zbJTDmqPq?~$;nN;Bq`@Fh1`(@CO<{i;U&pBIXrLaVD zo5ot|BYyEWTES}K))6V1i%9da8oYI#;raz>Y4d_jJ%kG)3O0MIh2Kc}Zz86)-SQ~1 z<5=xvU^~YtJpUZ9aKv(E&^kdJvwv;FOd7nWek~=i{xOc{y<3iK*}KJSm2;zaP(aR& zUd)evpmIX>6>=y^>ixf}arzcx8HXZxc3d*xum#>DL{2@a+!)yf&QgQ3;Se9^zsZ7EE|aNvo3e^x zjFM>HvU41Fy>y`Hp6PK0uRkq-Fh;(L(~J%nOnUZ0K}l1|Ze=-#BlAVb$=W`ZDAjI( zGy>)~7E0b6?X@7qEpn-xgdMZbR#b}VslQO{&H*Cey~$FJ0j zH|^$~HP1fZWK*TQ5bS_-HWeHrRS#9V1t8Mn?9A{q5<9*6! zL@JbOx}V)b&29%zoa@lm%u~v6{TqE>G=1Kje;&$5df@U#&yGQg{i+E?&ZwAII)<-9 za4r@ZMGn%{Te_%};1L3Ra8!jPI5*x-YZ<6d!g~9cs!vYys)H}FUHsz}XqOIff{C0j zL3z~jq+&g+yjrO>mzAJ!`84w37*sScS|9g&d@!DxOZ}h47zn~y z1~bW5(wM50uFmUtp|I}|5_-pvf-F~B@?H9j#6;&l>-hwHDkJdIpt!UNDa|$v1oLmi z9-`K1m*^Kt;?`hpWO_bsO&eQ~H)H@cl$VX=t2k>DgBRn)qSn|kpuuVJ^#bcAL%#cB z@vD2d8rnh7o~^XmTU|{dgDh>PCp9lubo%n+)H9Dl87 z|8gPw9LTY4xODj%hfO(C++^IE36cEcs5IAFAsi~LlSKS{j^3wR}x9NK45h>hPfh4=>?Q-wI0KngJh%auY* zkl(0vn1s54AM%q}{+PZ&3%4b3J3+V|Pe1NSP?`cp&zDTss_oAi$U8(N8$hzSRSum0 zNZDNLZn5yFWfNl5CZ9-&4qK0yR9l@M_SuR3<=P{x4>E$k>pU>)q)wg*$Oi`j*%W%7 zi)%HTa{lZ{l0>cF9z{8SvQW!;5**(VtBzVzFA_U^fr85W6>)1a&(hK-E0;gs`W$hS zdM2@A$im=J!(f0ixETiTDTCv38Hgf`zF=@^1_P~EQR@T56SoGzV3#u3$#WJ0Mu{-E z$slMUHi_UUgWwm+;4?JzzA|_`mjPoW7@TStd_RN1b|b{e%HTIJ_&^!d=Q1c%2A@2s zGWZmWP9pfZVQ`!>xDf^)Due#H42qP&bB4hXVv`ImH4JvbGj5#>gM>2pC(oHOXrwn} z-)P7m&B*@HzK;BQFxm zcI^tDWYAi|zPiVi;o-uN(|xcyc)p6g%Xlwtd36l`glAZJ20kQ)!Y=qf(;jZA$V9CQj!~D1&k99Ma3{ylr=w^aE1(hcQePFf#(76>!Klh`>DOBJE;`LwlPf{RMa$~UD8u>3JCzzsqSj8o#)Qh2@% zjJPE}Tyx|7cT-iugoqzl_=>1o+FAcDr%BB`KO=Cv@OFnSrT7OvL*p_r7Bi(KXK1`9 zuwr)Cp1!-Kf#0Yy>$hKY$suE?ehs(AoVtSfX%XET6kL{RXvh3z($qe}=+@6kkv4;q|e1oQ;ebE0!Ob~A$$S-vDTElo;pTGx75&3!~RNp9vmbHaxC zlwI|p?2eV6HhJC?hwyCT=&nXN!RY~fD!Esraxcq9>RLye+{@JWq`rkFEXl7-Ay;?y zbp~_(Phscs$a#e~I=47i9={U9Pmi<{(w(U=I7@-B(`P_034p@_~Ez23(zyScq3%#u&d~J?gGeZiJ(qe!(RCJ$lke)BJ zqwLZ%jE;t>Yi}B_on!H$2@Ql;i?}Gf~=iM4r}7W za)@9HElLcR>fJk3`DrV{%fvE7VjWbRZB$Nqwh|=gR&41Xa;u%i%_dN+rZpA#7ZWJ< z@%v;TpGtyb7C0U<{dVtg6gHwTN+ud#1!j4WnV7vZ*rvESff&XoP!8%e(n3P|x=e52Si=r*; zVE-xkZC9J~<==t+&j+GUm!I`6y!bZxzJ#*cADPKl+?u$LTu0aLko%?SvG#oHaK3A06EJjS`EmIOfBqS&j;+6{h#UoOMmXa_4my8${5k%^~0rwV^c@_;i$$`OZ{x~?3aEjvh7!f zNy)-CLpyf6=$B>ht#gm4`!99w^@Vlrdv)$iHYRMB4}^4)#U#EQQp*vl z=F1`U9>UR=OQl=IK|eoQmdAm2{z!67{Ojyrv- z6FqM{fA#!LrCPm6?NFIkSf4|$=ed-frQ@vRNlkru)bm_+GixbF=2#zcqhG13k;RBA zmZ_~Dizv4cH%S??11K6;3`0&v*;*;={BxR)^6X20qQ%j3nmA^beqrK+U(13N>n`S` zrr(NUqSjDY#jUfs@}3`evxhN6q=0RA@aR;2)6iW8b$RVq$?-YK&w!51I9>fr_Sd8j z2<@9bJ~R^0x%dr{bx9+ z#be=04uF)!ZZ1P*kzkOlyKMkt4f_VF5JN1meGd%n-yzdP5sKDT9XaK{N;aa|?wDaJq zj=>xot_%Esliewo{7is8S1S9XbOW8g7ImitI4*8`27lxET2o0lI<+tyouOTioc#aS zpUCO-h*9|_4=cQ~G?reOmBVA3bR(5)c?dSkY`ep@2S>L(v^^@1IjTG00&?fe!ksNE zyR{q<&(?&d(#4wJddI!5^Z{;V@`s;1kKJ%|#)eV9c8Re^12<9?;?^v#8`YG5O%1vh zZDAKzOD%~7zWkTi#e;+=_VHO(`QWVaBXl^&R9{(b7E(KWQ(gRRNy^FT+Ug8!=KeOa zEq_H^TfOcX!@$HU#|JNIsbfzn9^L)C+WqXy;O#g+&c+Qk$t-@DGkinttK!y1IE{&X zKD8>>Ls&OLx<`%=dk|q-WT%e8pdBWrDakd9eNm#9nFjt zg)K?^;^$f&yD#5xELDuPC6z$3bW$Cvu(`z9({SBe)OC*r2J^@Y5g43(`!a*sJgfRp$Pc6bc9A{-$MUsg-!_l_3d~+{r8^aPm6S_iFI}q@pBqLD?(IJa zhnTe~!4F5H3w!+}br-R2`!V76s&G41xHaBd)Fo1fuPuV(ETLrHPWfApWbnMo@SHC^ zl_8AN)1{+@=Rbw#HkMtDCEZ#g=GOKE0Z!$xIi#qTO;VQ>R`cxuH;_j_@V*tH$~X8L zS+5n5?pl)euzVP;FBr8%niJJm!`2uquok?ktvD) zL}Id`8cW07PfRyz{Spg}ThDP7HN~wDu&`ZVZa=ifUCZ1irznfRyoDp~*m)L`)ag^;ZKF#nKXB7N5 zf6+RqPuR+&Yb`s5ffghz5+R(ffU$;4l6PJN(6e zq~xsQ{}8g6)kjpD;V(AP&?NoEsZdcv;u4gsifa9T2FLP=WS{gG_Zem@cKOW6Li|T_ z2D3LlR%W+$U^YXTT`J5@>)>!2#&6Cl-ir@T>cChQko$ zP?_S;0Ef)#{*U%lbzgZ6{Z_tzMf=KrZr|+$F8trQozw`nYTVe&!_cRdwz2{_R1M0i zdY4j(lc=TT|Jq-}laIpi^$@;p_OAOyjr{+S`*p?riz!R6d8QJ|+|?rSXmm3hiu{jI z6cptJn=aJ&1%(>d5*e&-8dO+sQ%d=s4M&a3+^jl-&CTqr;rLWW78QY`F?~)h*EmLb zd{i^Zf_29+n1X&vRGV`?XG53alhb4j!r8EVD2}bEBgNd*Pv{Yy=U^(Rs}-(s>vgV1 zU4^IfhJOhrwtyGvsE1`JUpBf1n`MIqz0e{m-m`M7ZiPc&Tmyk4FjIgS;qd9?sMUos ziHBRsX{UQ(>{R?tL=x$*rTeNWRXW$&BGJ)6ML86F2i6|MjZ?w;W26sH$I4UG{ymAb zJIp6ok{i0qH-%-K5UOB*Sg`pG+4AoOHc5IJRU=pW48i7=1zMVejYxt`Ps_7RoAvWf zWmS7Gk4)PSbz7-*Lp}RypryBe2M)o|0rxOmIscZck=5VfcCE87FmdR_y5F4BQxw-nhewPGA(@urD!P2P%vsbpg9;3fFb4b>W_sCFYA#A@{uEJuCU%_on1G3=6!C{!9T2upz9)2(}TO+#%2(pfm7Y(3b-x z3H@2_tLemc@$5=fpEQa3+Sf(mz@mYFU_Ei`z5j=_HxG=mNdEs5;89e@!D9p!Bx=-n zptunQBbs1>6HO2g5DyM@MZ8%}6h#y^i7-A!-1Wd)TwP^%-4%}o#Dh}?CS65e6S65eeb9JS3r<9mVDGf^5o`D>Pb8mFi z_uryQ(7uv5{#bduYZ(oY&uot-OJe7_=XT6u#k&@7PAt7sIw#c#H>b;Zp=Z0isVZY7 zR%CXNV=8uch{f)n-YdlzXYssBr=I!?o6g@!H4I&H2y#(X<@X-R4Hj3mKY;N<-2}1e zTA1#AxZLyv`^i!y9*Bbu<1gibV9VaOCX!a#Ks!ZKt;8ro;4}OWN5Hm->}&wVy;r!( z0%s3Vz|2(z#;_>+1v%Bx;e+(g{$GF$R@c#dx2E$fBF}u~IhxorkUI?Dg;w_TJ+Wi$ zVNsviFUGa|%XY@~W2XhIl`LlZ>YYr;l>s-NM>(}O0%(6Kk5o*KvK(Jb*G^0a2qzWM z*!T%mvD(Rr^Jt7f(}CB~VDkpp#JvO(p;|RP+!4Gqw$5&m;-uOn+#pLNh^cNm%!xz~ zkO(*2LdA95SQ!z#8HaaX4RW^}Y{*Rmx#<=7GYq*jX7_^Gv}#uIY_{{&=IM0C6T5P} zS~c3yUsBVN*pjm3n&$Rg0&A|}Y%GVkckQ9=^41ytMJfE>+upHyJJzMES<{Q4whL0k zy;5?0pf-4xw5scNI`p+T3B@EN`8MUpiDxy7;rPvcd_!72=B7QraLle z`2-^4_+kT1u~G0(7kmpsZwaK%_CLVRiK$aKAu`*Q;d`^;4cM*>z;W-SH28^t|F6Ig z5qPly?#-e6dhyfYqV%qEIL>d{>$}%C&(9Cnt7CbApZF57$mrL!6oIV8D;fSzcHr7u-<2E5H;S_YMcwMa~~*Q)^oLw1)%y zhyngH*SYy3-+H*@3;{k1z|3|t+rv?(_s&D-a*AOxi7E6558?XJ(tMo9OwOQ7-W|%D z({-Fg2AvdakAFFj&BI7L?f_{!)~j93jjeH#w!0ggoVNQ0<_@&o5`lAEZ*#N zB0+UZdgv6AWSaKZ|K6 zjfbu*v}W8Qvw(i#oghWr+nro@k*nzzS%uUUT{(tcofh2_L{XL2&v33rK2Czb5LYM1r&`N`jr3{u~Uw1$mruwQ%u6PfN=?6Zt$qm^?nmvXcyXe4Iy< z#}^@x}&XU+z_e%^?i#(oveJgofl}OyxN*OTwt11YWd~%txS_@4K?4ACjO|7(I>VP{;y?;w+MYU zLE5HSk-1EZM%41FhWo%O?%fHs)`KK#_Ygo;9liUo)LqOwh&Qt1uvJ<|?&lQBoNL0i zVL@y8*Zl!i!nWZ|a3q7)M@_U3txHs$SJQ2^?bW=m)F?6U2KXcHP2lR^C%6+d7FBx(6U8k9Xt9YMSiC2;1 z>rSamb|}=m5vzm0EyerwtEy#L>l@H7CY|gB^wYRkZK# z3c?N5t`j^~(&2<|5^ZimcS{d7aJmz`jz<%^YjMO|CwK)n=}z#D8cH&g{|h)f=mbk7 zZL#jh8Kf4W`>2+*DU)BF;5C0}C3MG0C}ZBM0E&CdxIS*w_x8o3$6AP{Dth*m$zR}1 z{z`##Jt4M1=m(KB7OFD{u{4B*tg{&?2$#r)@x4Q@)c|1g|12l}E6t)v*Z&5DMt~6ZAEZ(>o93wp&OHWj z!{SO(rN)-W>b}I=8$80cPZaByI{PPQ4gqRGudX|k1HGuw8b;34@IgWGHV`E3p4H z;=}&eT%Q3(+?xqgbSMDrpD7;q4>QHB)YP>Fb;))$C)6do)OvM4cdj{h4nl*tEVUup zvc&LN(s(0IzXSxcRwgtQTd}?to1&G*;HB zd53Uk?!vp2cEZ`b^|v_IuV;Wo&~xl;oDKtE-?BdOvQmH%FSHocg9)^8h*6-vO5q7p zUuVHp8R{#_qp7b+w3gIY&zmH({+pb>jSc_$RgPr7cZ9(*o8iB&rJ`Dn zIADyv8zb|*Gv7bbcQ=1->z*^%*Y_?48`x5Y!ZA_*GVJn=HHTOE*EmA~$DaQljoZpn zuyxCCiq+?glcj(Xm!jMd5_PvduP(;?SK$gPh+Uw)q6_Dw_pcwahK&cs0NxnB$ zY!UPF1KRyMD7wH7N;elDzC9tPZ1mR1 zjL_=rV0d22czkXL&9C9yPDEfL=GS(dvy1rjE#qUbY?9-XzW5VCZuEA0jXzC&Q8Ud} zz4f+3j0t}4Lcwp0EY~Yd#Yi98)Yk&^<(!bfPS7hRx7*d6j5Vmq?R%7(b&P-qM5#c4 zpJuD-^`+5!bg6q)1gJDv*5eB1KEP}~g6Zc1M_i*aW0b^}sASo!`0`}rSk$fv(s#~Y zWPq(7m2k$qLy*c?WNcUQlkWdSrOIaO3KPA$n(4oJRb~zDY>RBx$U+^yS&+{w#4fvB zd#XNP=;}m7$%wMyZC3{<-dMpTj)}^a=-h+2k#rZV)gyVg*Y|lZHC?A-cMW~giiQBfi`*{n)Vx-J7v!G za^~C(m#KKufvm<29cmCl&l`lTV1B9cEfcwYZxqFw5ywU?heiDnXux&yOfVxvfP(g- zp-thPjEL*9z=%6ZUfg>qt5#OhFcE;>x736#WhDV4uawlz@ESAfts zA#|7!$~7e7Ok#82o@*F0pW?4{%lB9>uhPdcF`8wzjRv9RyE(JXhRQ7Db5>=_Y&%bD z;D`#yGTTm)^Y$0awsXyFdx18r2j}K-&Qg2S2yUIyUJ!ha_&ydok*I;V$JPaTzS0g; zfs8bqFFLSuH<2@tVXauEw{h0i(vmJ%MOZp2Vh!qb#Muk(!rsxfrba`ifg@IDbk z{V<5^k405M#0su)4ddy*;o#Vqf~bFLfkllZMlKiq`h9f?W#qKJz-okxyG87 zY1MBTq}K6jBWaV57XZ_#nW4D+=)H6j_8?O=?^O9sW&VFNdNGV0da)bm#o`JJEVf>3 zzs$bu0^|CtvEp=&xm2#})Gnn{yWDkZ{Lxs+$d0Ox1?vb_W>nfK&DYYk-3n8Y&~{C=V(&Fawn_Z zW8NA>fb)O3-VgO+kuJL^sz&$J?7by)tCv)me01@t9q|IKOl=!-VRB(#?zW!xdYi7owiz!5xA{2T~WSO+_=SzFDbh>ID%kA{*nm z%e5Y$rm$Z5&^(q<-j9V3WVS@>59}#~14h zdyc3$ULn$%#_?$ac)9>$O0_bMmnAlqrbHOaxB#s#LGL@KS}f>$lhpp4|ATnMBEv%x zWZh4pp~`0K3fK9I;JPPJ7<6%AMKdtrDAV{FJ01Q1G>sLH$r_k~O05$T9mJi9e>0Av z{7;3D?7Wr`%iQUoaOr2YO)q=9OnYKY{CtMBjrY!r09995Z}IlU^DM&3g18}F@y2oy zmBC z^UNca#l|q^|DjFEdaY%>F`acLSwB+NpDm(lAe_Ji$^nm19{wgF;|%bFIVV>DY3#i< z#dB;LLJbf;F$e^MuqCGX8CsiQm?#4QRXneFvxK3D$f;iJa#ZebD63oEt}hmKdANK- zRmpeZhA^J9iiVHE^)tc8VyBS7XLeMFuQTJzI_5Yhct;~nx~A=2O>f&-MEWCF98TOV z2gtC!sp)P&#w;qJo%$prkrAq6DsyPD7$O!r)iMuGXP!dl5z2fZl`Qj@m(xY|;{2E4 zqOlpwayZ9a=3Omw*L3F7$$Y*tHxZ>mE6$-vn?+@;!fcLfT4tE8F=QNmVwLL%&)kG9;M(Hbsp8GBXwWm-D+t1hIjVJW-ORjHQrS?L0?nI zTX+`3VlCLR53#2TCzIe;4sKix!wskweA4%JO4aL)j%=5!dYwzePcYj$(^}5@XHjI8 zcsmvvN}jkkJe~7ia@H&75#$s_QbAZ?Zw}Bkj?N2%_^a6E3kg_Zf+aEJ$~49C@OMf> z900^Ag1D+970>E&vxhtyvQ+t7)lU{>&d+H9M=6Z-{V;_;4k)VSAyj`ZRba2XSHzO2 zjJxf0t+uJNJiS9r;Nrd2Ls^w6o3)~ zP?iQT4gh}=fQtb@^jwjxy&}Hg14_mfbU2x>Q|66U{!d5&v|;ZWZX61If$+E>d>n-7 zgd0}i251@HHNC=PFnu2gzA1;daY9QkK+I}15|)<*k>*>KQ*7@2pf=|GYs%yNYpyq0 z#TRbJZu2U2N7y`&Wp+~NB>JTlf%me@Jisznr8D0`=0(c<8&GD^s@PY%t}txb$>?S* zMU(HD&T7AuRLT#@BJ&2Dm;e1GjNlh5rX_69QP(C!47r2^ASacfzequJW=ybovv zZB}@=4g3jrfM6zx-fLaUw?wg+Hw=A#W`09`}k2VmQ3eL;7uNJA+F_)2uY&%FbM?IVf|KHCo%(V&4hhKgE|cM0fWuL z;7K)g_RM%z?Sn>S`u(J{)rcvv_O_@=V%|i+#=S{gCtCI97Y3GM>xAW!}LKK+P#R5RZ8{^)5FnJJA#haU=01GCJ z9+0G){6Uw#$pJWw&#Iuxm z8Pph-r!clzj<7D{C(vJY6^i?iak?@-X&Kq)gJH+2M3VIsL5JHd?)@{!VAy`%j(w4o zqgL+EHXNgkXj>FZw*0j5BB9TEfn^*lw_$bMH8fps*;kEfM)uVMrMTCP>#f#mL%?d5 zu<8$1Ev+_He)G1{S!yuT3aqb#xqv2S|7)%eW;K0wpW>&c7_dy5B`6u^DMNp)6MXgc7`XhOKBXg28S|m zp!i8@D8_$$+r~6r4)wpSg~T}~AhE&1^(;Eag=Nc&3Cc&RQoE`*?Qgu6HTcNlyzCn9dX01n|WY}eB(brzcF&!Klzgl73DRxdPYq_{1**H{1?{-qx}tA^Ycy>?dS8D zwxBR2=AW)?>0an+m;FbWI_~ACvzL(lG-dxi+0l)MT44-@Pi4Q@_XY`swLbmgaqd!W>#Le7U4D;(eHOL^{d8Wr*mX#ZyJ@Z^4&IWR4$J|)W6NV3-Vhw?M)RYE}Fq>T$aOHx$A8`D%E)tp;Ksdfnv{#=0I&*?5_W0 zXDLc8QQe|O!u}yG_7B$+tySj#n4kAYhU{~6p~9~}BUhrnC3dF5t(T})`Twbmo!hZ8 zc3Ef5L*h;u#KNSTPLmTn!4kjDRsL5bU~rD>pNQ&bR2dp)S9zqv4fe>?wM#-|!(rrf z?N{3iJj1u|NV)LZgT`yYg!M@SNrYv;v&0C$%LD(kVJH5zl-B6fw^l9HzfC!u$DVJlb=gDl`_`?v zlM%%0AmtPD8UaG=CRep<(7L@2x7KZ$f39QRdH9Io8OxDb?Ejy#!8pG*h#KspHXU%z z`8AC!vnmtWoqM|3E~~6LBZIw`93f}kb)5ln-KP;-{h`sxAQ&qA_ixGSGVvFI1Mr{Ksc~}xjHhpql!<9 z%vw9xMhSyJxZxr5X48$xI@HMV*o8;UoCW(2w8M=FNt$<|g|GPOq?@gima;PQ5 zA&6L=da??oGqXU@k7);&rw4i7Ql4SXl$}J;|9@gsXHibL;rFhEZx8|S8jekA)>Kdd z!-Z6o!;M6!;C33D_&Zv(C8BZ?oR9#oxYswpwdq9}p1C?>v;fYIaKkxb9CwUG6V;Gs zaEzg&@bb3H)xr%E9hz&t7MgdtUXecFUS3x;4zZxx6q+xYe=v&vFh|F)UBM=ThZ_c% zpYVBF`75i^D4Jd5Z%SZBx`>D=);?(m?{vvvEOaCZ>6Rh zr?8W){&L;<-V0RFVl}bRT&(7A{;ya~?+R)e)g1TA#Exts&>RM-v+W)GlbsrHPVSgZ z)M>b(9_eB20`lu{dKuOm3QnN&25%tIxu*Dk?OKkUB9BjiLwn>ibi=b{<~~gC{`8W4 zY2884a+(v0R{LMHYFJ~gUg8p(eJEy`Yt925u1_Nq_RIXZqxQk9}~}EIhJ7l4<0g$;hYlI8bPY znmOk6wNg*udWMyHJ*ECdrGAJDP`rX_`#U*gequzHc$>h#=1QtkS+|NU=9m8&oGKFk&OKIJ;Z;O-0D*9EtamPHbD5cTiaAfRki+>;ye`;uf-`}`_5T8|K)7V(GVa{SFp8cw<=8KRjxx|R9uC*@^`Ow0El#&l9U@waDS2pzMZq;d;5Iv;8`O zS#I^s9Jk{8Es(JOeIJ1}ejSx96)a4hTJ0o}t?~pg{BSeK^uDIgc>=Ez!F91!Csnb=t+TkF5HlsuBcdJSD+h zO*4OHKtWt%cBcdsLK3MCC)r%MMA2(V*vat@M^cm(J5p2li96nww1(^FLxt4zQ+=7* zNL_BY;cn^|_jaX)n)iggLzo(IZ!Xd?6zt>P_n+tIb2hYft#K_8k7KqDW{ zCWmC@RX+99r`L>&LKS=q%;0nQWUB`Lf;>@vDoXZ#9xY1tv@e_q**(e){SC$os|Fr8 zK@VGyrSFwbCVDKiGq8w~9bu4KqGZ2hC@07r@Fx&owk&ZI=9TevvbMX>`+y81ger6F zdjaEWp=xd|O)+&9`#5IWo3$IMwB-Au8BL?Kbh;!VZ3l`96d7r6%}Bd|wAU)_GNsL) zkYc?UEfCE19Gw!ap1&wsw(1ZE{j$WBr#LI0hgFI5D}PC(+E^%V4rl|k6$Pk2c-~_5 zH#}SWwkWJPnOINHm)(1dj1Q!Ny!jc@ARzC-dBlCIvBYvwI2TQ`8Tn8z;P09!?kj&m z4GVOB$IGUJND%i<2ar?Bw*lx2DcL_53$I9AI9!xAFCRzeT*2p!l+#QkUK?o$9pM-z zajFHDn>|UMzU0}YJjZ0$0i9aBE|G7w%YvrakvuYfOGeJFK{ljIw5|^h++GY4^X}j+ z`^2C)6d_Xz!o~{R_tCvx7THbaY}^pKnU&huBbPCs(`BYe*tUyADt+69Qd{;Bwj{M- z;naSVX|^J%kfF#3!C!a?q&(w71e8kYk?p^;{u8ew@UxYp~ds6*(lstNh;QK!2iPT6z9b8v|)CN%{BW9-PO&+<;5$|M|kz_WxAjTKjh{ zlGfoEg9$@iK~u5rLw?5DmhiU1Y5K>1_?PYB?TL#v@K}}+>6ls{iVLs6ZNy$+y>p`J z77_l$0@9-ovNq~Z?SK5XG`36s!Y`#)uTSd+L6sEL6l4t76A6}=xKWw?YIZNIa0Qlx zjzr#SFTf(&qIPQZ4wxz;N6vXrO^Cm2KCfZ!LnOQGXUOZa*?pxG*#8enn6rih&Bs{3NF>!SDF(y&1hA-rtx?=^YTE6Y4NVg5&_6t^?Np?BqJ}WtD4E^|k z$_0SRJzV9!=gR$!l{-e|uG%YCxxiQqU&t-l>;K97-IW+k=l%YopVSuSL=MM^qAro% z&9$Q_@Mmc1u$}WcXoB*%CODY=K=_MA7JLjo_%^zm<{?Hjwcr>Yzkn31e^QFZkVmZ( zTlUOZt*oJEj;`b^Ra-;d>NXo@A7>P)=nAe!rc$+TF2}D;e?t)mv7`EHIj^#eZE2*# z_XAUQPPKU4GJn0>|I|&cTI?kb>P%yDop?Y)4*Fe%IuE5kQ1HRUNb`}jE@vozL<)%3 z^s*XTF<1D2{m5RFlVc3%8&5e4k3FQxd$RI2nJ{H{TA@FGs$t2$6BYf{kTPg(m^x4_ z7xUiYYutO6tHY!V(5eM(AhEDUTo)jG;ed zghDRuJk06ab9htKD&v3QO>9?Sa(R;pXOhs0+oad$hiDj69Mu;4_h z;rI~vd^VqH#M`Vry@=Id@1O?R)^g795Aoq|jSq*n#40zRu5B)&{%0(Iz>prGGj{AR z)}Kz~93(ijV1smf2ay0O_KSOeMg)IjEx7&zOecref33N_@qB}~Z;{lq?hFm%M_wjX zqFWbai(UG*$X+c_M?(L^KC;1%%8Frb)y)lt8=UTqqgCvv(+uup|M_#X`L)&leNVAV zgtYVL(?K+RFpewZF|YOyASOS1!vryo-_V)&SYdRNsQI-~zp*PX%(YJcCBAPc;6-`k zfYD0R#~j#=MV4lxMzN)&=*6SHvUM&e8!IkU!$LOTsN!XT#g!#)3WH8b_rDt_c>~W> zj*2B^FEJMe8VVO?8@@Zr6G zrc=4$C}D6$1_pB_1Tima7!2g9;S=Zo!f|&AgX_6`9X`AFEOM8H=X@UeI(*pTSVg@| zkfD@4f+EB9(;dwg2ykD@Ck!~Bj<*>>U0lq&7Mh*v%3F&##l82q?r!CErMwqa-VUlU zG`niIWRmtP2#7XKln;p3$$_}rKs=BJ@#gycyq5*yq+Qz*jpi*N1h+%1VzMyr1Ll7Q z*)--Ib70=7HRgAVZ(`m)R%{{HE{6GViv3u{o~mNO{GYqF!u%6K2{1q1fmnw$qPw^{ z5PJjSQ-NsQWt*6Hj8)tw%uB(%8DfO%WmM7T14WrEnxBqt$e_9S1I&MG#a_yFFT?!t z_W%QnHr=ga!TiV0$>a;#GHR44KdNNDnB~9>{Qu|x?QMYeO#?a?K)VRg3M|@eb`8&R zr0+b6-QrY(C^a}Zvj(@Rgsd9eL9dWegFRire?l%eyOV2otHB5F=I8ZQ!E017HRzkG z2EP?Gf)-ek;#K6=tQcb zM1taL=YaKi=WH}b+ffK<4?QqM9RdjIqv24hosjC)JTMGdh> z7CU$~_W`S}1=dK?+6aCwv{&WaI@jJac(f7x+_yD?uk!oNHpZKp|~o@xRhcfjPw1HLNplKGA3{@t8agBUO7?F=CHZsNMH zwaGxBT_#eVpb-6K*vJL=1JTbdvFF~&F6$cjp7l>$UDn;mdWEvyufTO>B|c<0Su@Os zu*-U{WqmlEb?v(RysMOTgw27iN<4k48wmzh$6E1N%sbz*U7XJLDA|6eY(>hJ9ms^A zgTje&UKi~C6yPD-j_kjhE>Udr=K%(?BKO!Q^*4b@~fok}aBb zDsMco9l`6-*m&AuWmRlEwpndn;&3yQ%o=U%V`^H z??l;REnBn7{op1&gHS9s{-6_W8V{nlZdbq);fB{hx{7MG-civV!e+R4cDSDr;LhCk z_|72SHEV;g0o&M2(S+GqfK`&mnD-_U5ck$`bybT{wMJEKQm6l^YMJrks+Rii##7ji zpO^D+}ps_W!;OcE0y(8CcsjHf01Ri(S`(K50~{3%lhYZ*7a}Y=dD)OQ8stBGBNWM zG4hsFtFM>Fi+Q6h+m-2T)5-RRvK^sp<{4}e4ob^|1~hX@@~ix7**|!5TJp8@=a(h_ z2(S+~+zBt5^b}=CK2lR)l7B@JLd1D1$G2joo(|)ghy(GDTpf)z|2seLBVnxQcj3Z` zBntIyK^uJAu$Xi~xFJRZ1^S@r1}F7z!4SVf>Ps`E9=!Xo<#8!UGl|t|3)NpC^+OJ~ zhFFh8#J!KXx@z^HT3@JIf1tnoAFHJUB2(3REG6}ejniA&U(8JVTd`NBi=B>eY_|3f ziY3N-46?o1#NGvR5WN$Z*b~?j=hH?cKQX$bRa;GT(04TGozu`y26}#kO1*9o^I1b< zYqpFCZS0nO+is=xd?8%8pK+n2emW8o_x{1vkuCAB{Jf4T;U6jit7;I#_B-F8uDMr^ ztv*Db7+j_0X)z26;8P8-WcL7*;wb>$OMv$5hUuk#e^S8AYwX@h-}k=cyvobIs@ zn&pX;a0pqhP=oR}xXIBS9P)qU73-h4I^^G2!}Pn5*QT!l)<;v2VSRT7)>VGLTZHup z@cNb-HxC5s&$+4eQ&|7wKxeY}UMEA`Or@sPyo~ibnY?m#daMm--a8p-7hvtdBC?g1 zC+@)IiWVY~IX%u6Q^vdxV0QLD=IZd>4}A9#zJF1CkMG?IoYbzPhg30RE@$YziW;>b zvbI4-sr{Lm`YiEYg3in&AqciuZtzgaZp&J^D_{}U@{b>i{Eke_Wey;t|C%lSVEfj2DHci?`miL!B(-+aAe%OlB=Wqbhx6gDz+E)_WxM1nc$gHJ5LH{x2poX+q;5WFSN5=ELT>>Zd~jZ+F^PuX1i#qo{bFUGg@pr z2Ve3U_wG)^UnLF|{2{>4?jf=b4mpDGxv&5v(}1mv4X5Y6XMYISV&F^_i^seIEABw9 zhzA9aq`2WKu0+MLG_DmSc~y#-!6*PEru>WOE@>b}mwnhc`VMFp^>@)}(K~S5Vg!h_ zgu$NHRd1Lkey#casL!4PXEU90K92Sq8T>LPh|273FWVb$8vmSx_mNJ*>%hWN96kub zGDsb+|4bediW;M-nbCBUor~XK=7Jfa(V(u_VP?ZL_xilKQoMiCer1w_yg7GLBPv^r zc;ZJsj=xyshESDoJA6eLu06^4p{!rivR3Y;r{9CFE1=e zOl^;1fMI&c0syfh%^4LW<{e~{Kt*!o7sw%3WNj1oUPJ;>cH*Ix`FXF2)ctu3dVQ4s zJ`|e6SG(S5ZQWp7prZgv*8b(5#O*Fb-1>D;%k3^i$ai+! zI%`8$CWas8Jol>-M;&OoPtC&uxYnJT6ygDGD*11O!r{{yd_Dr7=8?ISN~QmE=D?=f z|Cw{4_f!3ipi4C4MQugU9(2@HguQEljp;$HzKwg&tYA73@YVjei0DH2gl4WHg{{tK zj?5{?lOSYf`R-p(v!`fWMWZ<=9h zoFEoq((S0vx8hR_{J9esO^3KG`;BC5(<)(Ybv|6<<%Msz#9Lo6j+)62T*0JF?=Cc> zPIRb_>wvge#Vkdy#41?1#SppT=_-PzbjX+gNiDz}VVIZOwZo6fW6}vKtev7Q6O{@Icr%_FApP%0Qh$|f!>8JWfRD9fs znUx>natw@T(IjTK`RVPWReP9pDr#psQpMdQ^F zHn(3*gJL`3$z%>{(O;0l@S&!#JJ0zKZr`Rcl%UpWo?GRMiNru+9x+YzmsNf>Od8bz5MFMLfWc7p!&cIL7!Q#g1Y{*w9$eKZSXAj;9x^`Db+1nW!*j_S=E( zZS^Cq($d!|t=?8YnTCK9EAuTd;he#kWUezW*J$M0!= zf8*C`GK~l6%dVOGlc6u)M_;ZsQhEKZrLv|k2?wdT*$&Kx(#%_-H%mhQhM~*-L{+T% z5$2j=gQpl@&oyN*wcH-!L<_^~67)&o`cCp7`jvFi-?yu&xQR|aG)FKROSNUz)Ot$O zMC;+aN~Ub3ZQy+rpT6*e>?_2E4}Xvl&FEwIQ;8Dv?#KXKJZ0IsH( zppL}f_mu?M@aR}mdEP=)4Zd%#no^E??SZ{og+49Vu`A|Q`=6tnr)r3l1sOl_Uecr9 zDlwGx8=3Z{S6Q+;%eMTu3jXp>>&P$>KPG|^8~ijGXK6M3j+IHaqwwkk3tMzY&ZFkB z#vbSCQ6*i(qhC8k5!4-Q_!jzbiD+iWU5x~F8+AUiKrmAN`R;e{X#V*gx~XC{@E%H# z+RMLhS3NLH_of;w=br}_+lmi1NG*#r8uxUN?Ia-up><<71+&=KvEGb*?Vz-#RlUmr z#WX5`0KMYgWjuUo)cx}!xSyGyrnL-~{gtuWDXiDB^37@_ZrA%$3dF(WV*O7#?y1prBN3YwxahRq<#Ch}jfGx~tBf#-w^QQb z^wino6;QgETI*;Iw*~NFs57ja|MO^$m#Hd*WtmKgcQp_*w#jbG5 zV8mO2k3Bu${Rsm+AU+s#x=>zkK{-a$%W{2YtAk*phdEt9!;N8gjeE}n;aDKxZL+c~5k@=8mGm#E%62`15mgQ| z-n_nny&bzkItP(gpA?KG2v8gm4r0r4Moh@|A(uT0SpkXKUF3obPYFD zn6ZdYi8w#bpg7t-v>wMf7takye~K3_GnX6IG0HB=&^j5Z+MS}1oWm)0D8-sGT94EO zs%QhZUsF2quOL~YwymZpu@Ui|(5*Sdp>N#(7%}F;|IFY(BRy1fSu*nZZVo=d@ZJ_$ z%;4V)P)HIKF`lQ*R>UmY_fZw`nV8Vu#CeD|>G}w;k)%}t$4u6v;~0Sze;C-JR$ve0 z>3ah^60nN|_D*r7W(61whYmsC$e*mCGTWFY`gc!rG8)S}B?a{jBm-pQ-kaPwfMEbG z7r;W{nZ;b|a{h4}WO zEnu}A{su9b+h)eepQ3m4OZxf2FgGV&)Q=h|p&*d)+X$l)L$9So%A>$1CkFe8Y9xO{=a z97i#dzJTgUs&zNOC~!*Kbx*vd8^~S_ zl~&!Y7fCVTY=zh;5NkT$c%pS#IobuQJx4LsI7!+TUOkJq;ri_j^1<|SKO2q8du1LD$%njhuWHieHPE!W$4&bRC?-KGq`I;>H4C%hUO zWfzF#6Bn(9#w~urHqrXawI9Ra%ErsqGUT-^?2~*kSciT@R;lZg7`|+WQ zg?emw$w+uRQ{Y+S0PM4>lHU6RP-EehiARYU493ETOQ*!VS;%wTdztH-&@JwLHYZ?oq`|Zh} z-~4gZ@5~DfzS7R9l{**sJHTY$QrJWM;pRewKfBX!rvn-y+>S0Q@Jx=eM*W8|s zPUWt=!wrW2tzN|qhD-h#bXK=M$GdcA)o&b+)>-YU8+BGYC_!qu*dWVO$-J>aYFTbJVMhl!z1%F!B!sEiq*hIOYaz8(pn4+!B|me}`lY&KSbQe0wcSeG zyB%a_h|rIQ<*Z#<&bYahb9)V$wNl&c2H{Nx9?*8lf=1t+22=r{X9eik7C^Ml?EuP{ zCOp9bS~6SBy^^cLq9d7~SLRE&h(p#FrN_(%QGQ34?GKi1YC7BNP)Ga8HvLA~vIj}N zcQ9m`<;uZe!L#)FRw)FE9Q1<&9MGm?%$ErBvACsjDm1Xp?hxH5 zWCK_PqY(HX!EYKTjl=nu9fjmlK66qck!^!oouB=TAS7%$fUQnSpdF4gMK zAY3<}!S;vL%M3B+J^M+#AM+ZlT%W6>=&R3ir*aPr%1wv3SP=a@n_xL_N!P|QMYt@+ zvRp+eiCen1YOY5d@FD|#cpCUqI>aw4hHW(Y}Yb)cNQpPtnm!qQG(mIu}5sHL56>; z5~uH?F%|@t1zN$f19M~Kut2jZhkc+hQ}5su{xc8@4G^E_-%;m_8Ele)Mrpc}$hB-E z(`N3%4ZZkY$y}&r@0tpDNJdWZM7qcfY7~uCObhyiU)v>=YYP?azKjYOv#nl%f$#gK zzs&=>54Sc#c^8tWls-{5D|xiIn|J@g4Ko(~{>4q&1A0t*smBe_;BJFuO8*TwqAGU4 zon(~-MVH#4P;oc6c5tAHyZK1;UX|#IVN7<>@d#kNZ>%FH=*2)|?JC!I5u>>GB&>7@ zl#$cDSJPc`Hfm8>cpRvm3S*)|*X%3#F^4VD$Rt+F?fA8c129cnhKb3)=jRO+l}1XZ=d!dB*zArD{S$83&m2-I zv#4n|J(hUu+o?~Gqg7jGboNhc)hDP!bDq}Otvs#6W`N#o(3__reyUUO1VX(+&MtvQ z>JRcmh5Tc{{hyG($c(5o@p8Hvx=Lv61#e<0Ifx8R-0}!C3X?8n8vxsAhk^6EM~op zAg8BsWG|VVud8i~^;5uGZ&-iwS5{03>wOJt+W`y(e;q8B!~e26Pw1I8YYX(OG|)c) z^ko5EE_IgWeWW@~Ad5E8Y6z_0;id%8ayK!0U^N6=rhT^!hYT?)wyt+&VvlwK_iclr zHs+}HOe*DSz3DHwM}^>_hG1*25rZX(^@_xw^3v8o+uB}|2KE@hRtea9^0Q_8;sdMY zTB;nVqqeZRr(vB1tTzPfkEYGNlgQ?bmhMl=SNoUI})=kRklx~UIyyTLj6XXrVWML=xx+#sm7YEJw)4Z9O-qRwy6~h zHdZW5p=g24xcDc^F~5AZ&*~WY<*Vhjlp`RQ%@`--6Lb^%Z0~GFwDyX`E|h3y zOztrMY_m^}^N+#}Z>JCr0VB8#fqq%YJJKFiR6%9*xqR&aHIEkh4#rgLnwZqk|Z5wmOJ^ z(Q@eyB5?>|USgAx>KIDXy+WVFX==aTyaQ>b^7^$^^AP4i8HtM5gdihqB> zv3~=8R&ynoeLqjGXH_ivv@7+p(^)g3P(#t3aORj(By>DdoacK1FffJ8JX#@}X(87hB8E`G^^a#{t6cwVfAXZ!bBjZSsaA}!Gl6s( zkeaX0R+O{?Qk{%kEm%(BlfIDjXDWSVE+NX6aqCRb6w4DIp{|XhfkLWc4dtIOGyz5Y z6RjYA0`rfI^4=BJF4cG7`k##Je}V}_B1uG)%%M`n8TYY`T$(1DlFpt>Zc~}8(fu~` zuwM6StDf~bhmL0!APd3aAlO9r+D2*T(%3rtF=xLqCim;Hxn8qzKn@u4g0}6Es_)=! zxW1z?ux1lbuF$;9W)r@)`_O-gBgB7Pdx6A|NUG17iH>`RKgym|cpzw?6U7erKM)7} zA6(_?&8g;cYSi5NH>VC4)uV0ekz3*B()I!{v@HPi?$$GyPWXz(3RD(8b~ftSLQSgt zrwTDU`G3672*u7nokcLdceVcq3rqFihQ7J+@~fw7GoejJq#RAML6Z(s=fc+$7Zm_E zdx}9r{f=k3J%Re;>wX8NwdD~t&axbO>)~&O=@#^$g{V!HytDoRnPu*h>nhM-{R8=R z%vRG~!pip&YV)jJBX0agpGLSuCw@NJ)%;Z#>=DlLyK-t(~)I@yVRcFTNDMf+{x z=qmpMi3;T3Wg2}3okM~8fA+m<%Fz%Jk(B+jr&&2@+@}gB=r(AWts+>=n}k?#b}!f0 z_!#%%59Q}g!Ij)}zV+tb5#Ynw@MXl2YaSOTn_JsJ80<-mUfkM-Hg0coU<5AjVTg5Y zxkAPWZgno>AZCnp>OfG{dZ`|L5*IM&OzrF^@^FR(=u8tj9mMb@-cW$CE>rdJPi^gm zsJ&L9US}e&=9aFITUxAJssad3$44pZ(ZS(|sO=CqrdzupT;b}h=RTO9H(dq$Mzb7t zJydCWijNk@H5t5u9!k9WsL?)j2+b7tY5?^QKsBExP9wsevvK_Qrx*sOaa~4o`p^fMix7^v z%;B8VvPjt;WJk)n43v~r10nI$s;$Xp!n`1a|E)#|Bjtn`tzMUb333rdK~A7VO_EOI zzm?icot(hVXHNN|+~&+NUBwfT3nOuwlbTm`EZq8mw!0w@i{rM|ZcvO|rB z-Jg-JAV^0i#uVdR5zP{yqbYZqk#S^1eEiPt1Pj~W4}JxA&rsi zZjc7LkrhMzuohvB9p{`+(>I}2sD;+lXzRVEL#_Uy9fU@sceKc=xFd8+9%1c2F!l(b zdMi&6A4I;?E0Pr8rvMP$|HogjvTT@O-)FBvFA3d7ucgpuaVfxbO-Js$`0gy@~$a!J{I0k@l z&EM35G4CiuC>Htsy%JB|Ya*>|wyyAb5)vd{TdsbjnH8!!JC$>ijYF7PwdGV*SnK|q zi8sHO{L6fRgSX6*+4-Q`>b!2zNU`yV;n_X4R{k9I?<}jURr#?ID)`sZ?|;ir zWWS?N=WWsNm%rD2j*vj(67TxvygZ9)O`P?E7}%R^OylixpM;|e*M*1$`=8&GxJ%S6AMnCX7#Vb>+Q( zSL^b2X({jUUs;~_&}X39x2$XJZq#dZf(M&k9nM|zF1!lqyS-|!JIpQ}xHHLG-Ro=! z?ZH(#nfNyl`gtb^pbG>TIzR-_x5PtB(gbi!+%%5;;WGJI_PIK!&ViBcwNrsQTsTq$ zTp<~5*xfX7&N$2FCMCzvb|(8r5D_(Y1^rFjyN2s5L-Fr-ve7Nr*+F$J?u!E{A&2!j z)nM8%0B=#xG?a^hGE`9HJI?lD1h#xh3qIuiimu9Ga431tRbDxC&Gc5(@Bqh*{KZZz zK!x{%my(h2r>c|64>!C-^0@bxG@K9rn4fo{;G82kePJr>!k`Y}h9U@+xf|pPHEqj) zX0d3?{trMSc8Ti?Mx80ZyhShz1=B?pLH~}RoP#>o8%(1(H4LYrR03tPpbS=PWjPE2 z>U3|xhrDa3t-~NhUSE0Zl@}uu?+Mg#s*b$2j zAc9?t@3pl-b2VSGEuP9CBFk6(&^wJH;!_`~s4WtkVZ=XCz)KXs`ENm?6my^2D(3CS zn{0eBefQSu#!z{GnZBo!Kk>|>mH}o9l~Y+$JFs$)R(3;VsDtHA%|HI4eo&{Zy?SvA zZi)I|XZ0)BAWqw}LNeQ4u*kJ&jPrc5J00t$JEiDtKoVmgmT=-7D081{F>cZ-^n<}d=>r;1seWF?a(V_wK(9NjdeE( z47oZgea#Wg=P2XyQu8*f#9=ix46PA=HQgD16|^OWG4RV{d8gm z%!+jj660~Ask|fcy8zkjz?3EY&^a;;wMRkmroa+@XGfScrYwwEz#rV3q{6^BT>lT< zP}gw%G`pj|^?%e|W9S10K>~%SF_aB0)Z_du94Y3lJ%QW04O_8CSLkisJc0{1a(dWO zvaLT}*;sH3Yd)eHfO&!0&VTukE~Oc4;Kh(6Bj(+M5XB-N!NGC6S2$PMY+Zr$2Z~7? zw!jvBHWU9x3+Ti#X2JY{tqmY{rVyj#ST=uCVAze(2w<$7RucqV2Z_mOP4(I>94kN8 zktvXl*Y8WPTacrEd~&s+J z?eu#|pv#YPa9^gH>|M;&!TlK=Hv%`@(7y$+g4T=mnANvZ%L?j%<4sP;qf^TxIn-br z9LXWMOkuD!KyW{I|!9ApGXN10oVyu3B(jvU#Ob5F$_u+q-#p#$ul5C^t! zDr2?FKJ>S?jI9w&gYJ<@o2y9GiBtq#L4JDAA@Veq5eBN0y#rj~=VBQyqLfrc= zS5;wK#H_i*>T+Swh10yvXSr>m*JxX41Yze})K@DUCqU**&d`{gpSOoA?K@}-Q%9$-OrV?8hE#61>_epOspF{bfC8WCP z$38DAM{ghHzh?8T@{+(Cd5Nv!)<7$r?2ui9#4vZoRsBZX+YL-!p>^lz0)A`yNGs`E zV&qG0wNgueojR@)2UjIqM)*Hu__mtJUgcknk+4{^D6C0u>7EtaWWEdQBGp5vdv0d$ zA?x6ou^Vml-V|hZz4RgM*zHGlZjg=%PVt;bY^Lj!O{By1b%Gr9xwtt=8Tpplr85jt z2KbKgPDbzino>4;oQ~NH5%gnqLkptG1uhG_>A-$rA>0`0 zO1f&d9mB?>g(Z%yPXD3Frh`oLnXQS56it5tVcVijoOew|)&-T`e$FFGePDW4YEWW= z(%CscCnqD%1?f(h^C;;MrM)DjG4C;iD;D_*!pH4ioZS12GyN?`CEwf5UR&qc9+1&kU>$y{5l>a@CFlR+V6KB8{c-RQq<#dJ4qDxJizzr2#afD zQ-aP)BHz5NK4W3D?hrfTUUPV_p(*jwmnC}0;o>imh7rufI)nK;gLxg-yA0+t2*UA# zSz<$|OasgJ3Q18v@?M`)r?b< zk!$`fT-Jid>%0y&TivRJvF=~$4~$u5X-93wMPMV^I<3lGnHchoh(>?n_L%SCDl#2F z?ElF1ZmUQFL{3*lt~T{=8yj?^*qV#*R$WL#)SO2PRMsu$Ft$#REeO6~pnYi?#^b;k zDj45!(Kb?5{_G7vw{2gTi>N(>wfpJR*OK}irCzGk$@T{VSdii6kYc$$hEpo7;o$RtlLYChO~nZ}n>{PR9BOP$xdLXff~ zqkna;;resfckWXp;cp`uz6XXPG9!?wg8l z_U~1llWTOFuwrg8C@aewZ_ZERm%#v{Y=!eE@Piji63=2L@p5u+URE7^yey0XFr!w> z+um)8hQy97!WL;exh<{Nhy5!U5)yYo%vJVOcA3AToZQi3+HNHEN>x9hiukK7{G@b^ z?j36X%vr%ziK-dWslxM8OW_tfq`V+H=4}`%QB!9A67z@w%#Q$pW?TxPoZoWnFbR4JTRpCM-gDBLnDq&zbiWdR^Cx$6vln{zu!u_8UQ~FfJ9NT zV&R5eA#Si4qZ+-vsVMJ~6bhRrs8XA`-eVAY0pUeKcmfEle+xdSm-vfv3P`)KoGEyQ!&=+;XT8$H7qW;w1HPK<2v|UX!8R^ff0P$gHnXU>4+dt}8bVfIs zLo*?2W=^4%%|*3P9_p*an@x$e*FlsKq6ASSBQ=T`SSb|#%p1U)oB@sEVvoV?!55mCU~}@c%ISt-wMT#RcQy`lkm~6fXsx!9KJqH=40bt5ty6` zCY0aLmA@DWac?mSo%7lFG-L1J!#r~JLON#tlE9(59 zD9(^Xu7(JiT#cR6V}TFhK(a?0Lyr{6hcFBXiI<*|OtE!s@kYhz-C?a5nEXV#OtWV< z6wo1nGmQMfSS6>A3DX3hLvZRJiiAEHi=D36oT@gHL)6i2?qqa=3m%vX0uvX_18}a0 zg3`f5@J@`Twf=OSbdK16qz1i+g8zl0s|J<(pD4g8TCQi-eU~d@4Lhw|5p2{fk@!S) zTq0r7Fk_=Bp~xw8vZ96kU?o6w*ur^0ns_MfuHNj4SdM2aj0j}s(e8T?WdYj=N2H0c)o1miU1vGk}%%5)AXABofKm>4j zIGt^6ZGPUZ%64E2#xGIVATXb_SEtiHMcUhxR%;)@w-a9sU#1$(*A{sVXG@}=;hU!S zJ!+1a*Mr1y?*Ojyx3K>qz#bH^)c|`znizb=`nu)(i>1OhP4CkjkarLl&cER5fb0d3 zhXv#zas~9>N=<`B17QDrI_($m(ln*LkhEYwfG@47{nIsIe=|$sG74U6t>>L@1z*hd zcEkQrfXxsvt^2fd@4#M`8q5RsA1ukFcCU1{OUd@EvdwP6cc9^G9og__Iag! z4v^rx4_{hS`#-{W73wjAyNevY&mc%~Zx+`nhVNG-T_j)^sNl|e$M8k}$w+TQ)<|6l zYkwk6k9k)agxWNOr-85-2+h3%I^RPJ1>GNuW~yH;sxS`%PW zHqjVk47L>ZLz2g;*hmKGpXd$yK(Q0@7w&c}nYOyyF$GmVR#;@*7`cios2F3f*gPxh znslLmhq;@qV%`Et6Y-CH%h~lgT-pp!x3PvNcRYHlpvKgpusP$|=~P}v5TcEtz4lY5 z(os@)@e|BQ?A3Ps-usg{xF@&Mn2KREx;i+}7A>yX%AxYgjg%4Ca&B+xK*J~@m350o zXNR2;hg9-f_>c2aGkfYE@Xw~^gVj$Il${yO3Ktms3V(zDwL99pLIGk;(Z(}6Brbf4 zVYQ8ccVhq4`Rv-TrCrUz^OHU5KHZ8*&@k_&Zf2#2XRRC+YoCnlv_MC$o!D-+7`b^U zFgm(}&XJSECx6ZW_CAd%U`J*GE1cbhd?{eBP@Vzn#>?{9g&oS7>uzpew*>JruQuIV z5ZEXx)h#N}bY|Iksam)AE5(Ebitv^?L!w^lLE|`& zQ{#f1t|Y{2&)^@F!}YW6rb`W7y7$cQ#BuX#y~IK2Ylbe<1zVd2#w9pyhP_Qk0Xgd5 zj4)_QCtP31bJ^^}RR-21Exsht{b?Tbt)tQs-ibqF=|W|b7>4V=QsTgUGEqol!}N2zGhVMyiub@g?rQkLiwvY^qO4Np)}f9nqR-P_Df|b zO-6Q4BVALPLU{H3+z8k1V|vJteIwj(31)EfPA{nG*?;jBRV8Q%3^28XSRadNf^M;x zE)jAm3v1#cHFV3|j#$5-Og0mG01Fl07L9h(sw1v!GOxjeqpU4>RBl*QX$J@p8GyHy<@lZxu4F0NCUK zPf#bv^Cs^$^<3${U9GY2_jNzCtLatuLzkL8UpV0)(R9m8aI+JoUV=DcVbz7W&TMnH zrHT6y{N~P?Z=#MVYnGYs>R6+n)oPB_ifPZybAwuK$*h&eYS~LMf_P5Oh3+Q({`VGO zC2-#Fd1(^VAb>G%;FV6qAWmow)J#Th4Cu$asT;J(*QL)7*ymyTOdNZVPoaNb+bcoK z(_8AB8FLWm$8@}2-3@~P@D2fcHAl$*i^~kc5UmwEk^fV>%G0?W^StVGG~xTaZtBJj z%By9%`IJ(51I7&v65VTw&Y%w*R~j34RP4pcc}o04vW7XPTUPIDb*o_`?AzCJ&w!A@ zS8_F<^5{B%CM%UQ5&e5Q@=Op$GX)<;+j01J5i*iY-ZCv8y=vFki6hYg1qQw1S3xhx z0e$6*2A%y!6)c0s*ImF zfhy-!$BN*;@T55%^73YTc@y%&kF5^ZJ;hUH?6S`6hn8SBG&VuIaBXV;v$THE{43|- zp2>ogKak#fN`Eb-6rc_p-a_#bqhHbIh??D;d`{@IKl72vdF6eIYQKp#4o#L%E~+e9 ze|5KT4?`t9lkRL1M1-`YTgJC*n#(6&mS5?w7nmNFV3bR+Yc#pAyw9Pv&1OS1jWMcF zFW!agFW{-l|IpGOZRxeTG9$gEI*wH3lMm%XcxL;0G&o!CC&M%8B-*($BH@`Q=JUCJ zUTwk^vqP(5h~1zmzG>07;2)=%Q0wX9@LN$>%~1xbaa?}=yqcnPeJN_HrLPHvXEK&g z##L1F_T_z!s0vqnS1j~o$_&xUqCUsh3^YV*PH^-zRL^qdkw1-UGlZf(HC-*i(XN1< zG7?aZNcXI`sCXk{omb+AfZw zvnWuoWn%n)w7m&@RMpwXpJfsT2;88I#+4{hV}lxnYGP1l$OP`dM5DN1-LPp>RBBOX z6l4odqM2UDsB2L}68sxxdn2SKXX67qc#SX=>$q6& zS16!Uk}9)-EBHEb(ca$G!veI?v8J{vfV=XSE(wC2*Ljs8~WpOg`1 z&{F&!i<58LR%e$XkB#r^7(al?z9W=uspQXB@rM78Q4v`4(PZt!UTvCGJ=!ekGSY{P zA|~#9zj^}$-(=oDRMTnhm5B)!{?l7v;he(4v(ROitOIB0XErvR*0OAYq^j`k7h<)xQ%W~t2N~`$&On7tFLjBLf8OLPCdY3+Fw++Erbe{w(SHpm=G{JNS%zZNv@S;Lc7?A#y%K@UR;X zjUTzXlM1qdB$c~SJysX0G~~QoFPwu~CD&Nin)kTwRTQ&Y$ox&8Vh>{5=2V&xyBwy5S(HRzPvrM=8| zuBE!C)RtYkB^&r;g((-mQ!ZP1EYX{J)ZH7jzO^B-VN_lcVP~LZlb{<+DZ%@4-~h*d zC4nz_k{PwkwouR9A_Xx#qEH&f^G}HJPVcIxTEAEs+P$Oi&GM@@%l#lu5w7bCUDa#u zh`4djFdy7d@SpV;v4eRbYvo?EDJ|rr!-UW}&qWfOv!VWBj7d?X-&dpG9Q}-B*G}o2 zJfE?91(SmW5YwKkTqblc9pcVIFt{nhO|6ZKk8F#b)Nx0|;X(pnBpKF4UIKiuSIt45{=kJP z9w#?)^vEE||BuW`fcNl@6R3`?)x%&5eB{G0qHeqKFrMC zt`eMYBk^4dOEmcxJ<&R??!QGJGLv{-*4JOYu7CN^`vR&ucxe=|9en4;Br~l+1tl|Y zwv6B29L|cSelIg##JScVX?iEtn3o@MKUE@G$4YoB88>|bo#M=|)gyq@3ina6 zVW^E`P=C>2;KzxyZ)YDt7{{>U9@a%uhaVVe+H(DYp2CN8fvzL)s-QSXimojnKVImw zIDmSO>7~Il^d~+^gr;fB{J&5LRP$C8FEhrZaH+_e zzJ4i`?Q`KX_J9^xzAuzoXtWZ)6iYf_x-xV){sTX5)gG)jp%6q;Y?M&lPFTr8e`=av z3BjO>Gm5i;w-L%CMk0!ja0P(Z^$ww7vbY_rb-; zmC$*v7uvp8$X9RN^#6?lKsExft3V9XqhV zU&Db11;&mL@AEJzqbH_1f_7)3lx}6{6Q^rS4f}|u`?7&A|2KlwRv~rYo0VZ_J6E`0 zw>VoveVMAhH~rji#_sTshz`jl1wxqWs?$GPWW-U`cF8)5Og~UYKuNCFimON4gaGz( z9d=%_R$MQiUq@3q!zdN!p^(a zih2G};x)@!F=u!v@w!E+c_RRT-{8ow^SHA%)c3BBCMXl?dkcu(=HGzNd5jM7s}Z@) zG(r|@?$vK^C|E}3!45sx0~mJVk?b9ikIu;>i{iVzF-5xdpiJIf)2UL#|02?Or(-2A#o zAV0CNLt0R;`E_y0ODA7wjq=V<%NwodmFTmwVZ%KmOIOWo^W^=Fs9e0+oBs91Vi2WP zw~;AQz!_S7NKuIq9mPTD?hhOJx?c&wIP8m(sVmV&q}!&->JWM-Zj+i*NI!j*J-#t^>O7cLd?$d$M+i_;=h?qh z%V}hncr+X6p@l^6r))yIu|Cz}GnpyOaNXt(8;a%`3z)CeeKi``h;vDG#F<|kab72R zOn*63Q?zO{e=-}KgH2+=$I_$TM*V|N#J}j-Q=(3}Gc061+*V0I-6?c5KAIHU&@#VM z+%(OXIU=#=;P|25Bikvqc_^DGnPQrzRm2WMD@(8Xh)Q!U{OT>Yh1gGweOQ+H#K)uJ z2R`T%s<=?0fSx2Ou7oA|Cr9vPl?n|U##N3W=Jw08r*L!n92#N;BQ;cC0^#(d(dEkJ zeoguMaB(OYar&T}I0w2Ppi;*~-LPS9Vm7hRUt)~pajbY1OUhEyMi4ce3RQ%Rv(=kZ z%wk|oHRD>8G3AD>lF*Vl-Yr?l_0WnL{{apP*Z^BMMd@zy^a-A;t z6$@jlcK(3E`^xf5t=9l}F*IeJ0cL?YTu z%d0N&zlNP@E-dHNBW?P!7Xc6aZ8^%Y4RJB`gOk6Ai@+omd_biz5O zUY~;j57DRe4SR5r{J~D)z12cU@8Vuw3pBgX>I%V~oW|-dJ5q8E6pi(*6>FAqD)eD` z*CNnnK>^z2M`Tc*G)z9E&8Z(DG=+4);wjkV;^m>lp32w>3V@~?q{MIy*G4GX$7XD2 zcTm_De`>W&;cVa=xX+n#E!VPCo0aLcll6&@OX99_+fn;;^icnWBVRshj}&Ze28>u-L4=# zb(JweMo%oOJ~)1%wekuC<7b@@FfiJE?~tNzV|pAc6lhORygn?}EI-e&a4z4O%){p) zQDN4}W~AliuXa-3G5XWADL$%nTT5wgc1!mQ%U;clMsGq(Nc7jXHtk+~kH8Mfm?F&p z?V?RcUFg7cHe}w&PX-s*+f9P1JE$8@@JWe>p3)EqRg5~DB>^!~Pf7@?S4R^_eO-PL zxa1}1KA0}9Ayw;qG}uKuv9YJwk+CC^c#JdmkoGXRZx_MM+eaK9RDajRw+(-@DvPW! zOa{g{>vnZ7f;&lrb+H*NaIekzKwI0r;o5nR8LlP`SBtgc{7G%O;X2Kupa0uZ-^Ipdt ziKRe$iM5gqvRWzZdnUtE-@8n1e|m}w?HPiWb$kBgprAdC$sN=m|IhGlH1OUbvu@A; z9c}{Nr3VWxeoxFFSQprJ$@grV~QTwBTkLOG|5en(Be863 zaXb`qd^O{THBH+Y8=c*lUj`p8#=XWz(wSJNS^=}wA2bPCaZL*7xuHuhUuUfx2a((9 zV6kRNzRj#{NZ)q1!Li?H)>fkUjGe%&g-_bawEeu}j{VG6SK)f>HenN{@*(}s-56CO zA0WZ<3{|x_dr0;sBd%Fl2T1^8JQm10N9UnRvWGG_4Q61pv81!s@k^~;Pb;2+Hr?YLdg|xamdTd*^9n+oGOADObv&FK}{Q%jv_z# zJGh(QE>2c0+@fjFxX;s$77!A$p3Y-nve7(s5%2^Lb(t&rD>4SMYYdpW1#n@rt-LS} zgLuV@3;|mJL4try{*<4IX2+OBSxn?clnsl?45VK^`+t>YXR;GBFU`L5Uj`TUBhAJp zOGxbc_tNYZKHaZ0JN^3t6zMn{_yJ`+Y4*8&q}j15C5j?V&4}sQM?^=5$g}gI*8jUa z+gc=0jXb;b2T~tQ7;_78zcla3v&V;0Q#m@_YswiEXy<;_ENP8y=n5sF8Y0NDvvVW5 zpWK>5{hqKiBRv(s_veb>)%vp&~Y3xMw{iNqo#ES?aO67_OqkrzP<*W+*ynd)tO2vk5_g`H8xLXtJAE0 z;Mog2h6cj%l!t@<9Dpo{V3*!?7lTUgi!#$yO|1s0fm`qncfLv1u}VJ0iQ78HqtdBH zUd-x%lD4H+^RX6SkbUWBLvB4KGEsTn!Ub0wobRMQ6ZUl(c%Rdvhw49QZ>SU4oJJWH zHLnSM`tzJJVB~*KXoO!&=#@59uX#J3`GjrE=pog>s#Xh@OC%n7>TKPo!2PiTFxAOoc(dzD2eTDVhe@4C@B~qzM>=_X| zkWuAajBM-+I3cRUf#Rno7S$AyiX*2UU4;gz_^;4vjkxWM>~A(|n7US*9(e_kE}hUd{Ec;#K85lbu1dtzZonMz&h(vWv zQlTkQ|IO`44YwEC?$bALkOqssVrG&0V!!U7+uQr%`cmi|nDV*ZYEkts_b zYXHAAFB8l5j!L&58O56~rM5ASA7^2$ars#*hT%DzfPW4BEVc;UEa1$nF;k=_(=mn~ z&Uxlw2*lIswgGI0*KGsZ>pwN1iJ`&Olsi#?pmA`O5osONfP1{Qg|Ajg;S96FkMd4A`tI_l--~KCzfq4ijW(G z7{g%lxShn=v4>~LML6|1YrNSH)+gR9xmdX$ET= zSV%SbK@s@XW+dcAH<4XC?d-eaD6Sb)ihuQBCrkV6Gft$;{A1h~bPqNboE&r z2|X1Aftp}W@a8s?`9jJ=$(Ie)6>K?T3%vRDSbfo|`by^Ldx)8K-44J%7lP@5ujqEv zF?xWne%D%meA=$Hm9gRUBE1I!FkXid>Fy8Z?2;oIH;C<`d@rA;0_>I{ze9MdwG#fn z6ulh;lUWEVwJkp0Je|i=B<5a9zejZ%lpLgvL5}8QK8G1f54ABWB2m} zMlwm~sN;CTuohqHoLg_Ld2RUoV-gD|lvpbx2Xw&04-BWyIm)CNN&glJg#81VvS82R zn)+SM^~JGWV01sFCx8*Zf*6K_8M?3kNGKdR2yJRcfIrP+Vac@^6{^+xtn^)9WI)?D z*~|9|fvz9r1?c|jE(Y-o$X^bB!WFZ6!WHwtK-p_Eq!Q}`T`{y1>dc4f({EOPW{~F< z=_y?S$j(f6SWdB4&M-q#6Iy)~;JJhHT}nW3CrN6Ur_L}!Bxg9vjM0!6O4-2TnB;OB zqH<7cvWyLUX4DU9lquG%Xo^3t&MaTAX}jX`0(55mU2qZVUrylj=Jgiht_$YXT3I6b z;MX-($eWN?RAqb}VJF)m;b5c;Wbv}7^JeB?9>D2;L@^#7&S8^WwK|_#E5E>2#y)wH zb^=0(u!S}6_>Ut+2t{5|;x(mHk zI*-TFG2DIwiiEJ%{KIc0zROi`*G3}P-)CSobo03N#SYh4c^~o_^z?vqqdvV#U;%P` zd;}AxJ9TCj(>HaxGlR1DM7kA5k+~Ei*jf$>O}k(4uV@*D?WeVjKP|pO9I8*BJ$t`6 z^p!inp@W1&@b7R%y}_SUL*%-?dk^pWCNp- z#=IRZSdH>MM`YEQ1u31G59v9L3p;rY7*uL3m&y6{#P4>55@(jgm-aVLU|Q&BWee7s zX2JoLbIdhsT3rsWh|&u=bUjqjACesobT9j>K$S@|d2zkY27|AK8j=fx=|uzTgNp}+ z82ZgC@)+t0xuHw1K+2_ci37BbskFKBeJ;+aeBT-~gC?g{!7HO~p}`lHFVN;~=WPAUo~?}A7dg_}&Q$l`DAMY;0! z%Z^S>WopHTV<6U@ONM7jye?U&x5w8cF(C2r zxW&i;$UZHn^tPO`t)u@|wIbT_gzenovF|D-7Z!Zg|mtjT1s4v+ZE_sq?n=w!} z5@?oP)m=#t*4Rd(=`cXot$i|Gx)wL;HNE4)b-l9d#Q(=+pcspiCJCuQqD_7r^3(Zf z(DUV&C4%&e?LTyFr0JUJ*NJAlCccmjT=R|pL-*WK9<1G!58U%AVE)uk+zbj3G9u0j z2FJ*Qxv3ev8LS~V(`?>o=sX?hp2rAhb-l{aX{s5W)-w#9^Vt(h7n+;JvBfh-|>edxcztl2a>G zFZCgboT&QpHDP|CrXTI6CSO5KYl!jmY9btuno?!#BSC;gn5{PgtP7dhlR@vJ*OZht3v@YR`~{?))&;?@T*_tDed7%>P-E3%IX&#~6QQ_pMd%CME@0mqF24Lf1CXRW{%uyjfV` z$(uNNynJcZM!jTqFd)9CDDtL|^D?{B#&Jr9joqg?{z?QxrV7ne*V(eDQY ztNW{rl0Z_hw=s)Z(7SKUIHmj{=!xzhYq51#MP21PwS4M?sv4RZ=a z0(na5Xk*6_yXlVq5oVXc)~}mxV>Fu(KXK5{`npIP<|4^;m(7A}I`_Fz=bkxQR#CT_ zXBa6{(=BdImDCg~n9kS34NWnBxJN`gLz>lB++C59d(d(pOP@0zCbmcUcNnfiVN8g7 zv8wzwMvOM`5qT$g^Wc^R^YLqQb00%-Ub@wMY;_^g7Zq0E9vh-c#G9S+h%*{x7 zy~KnO(KHjhh&sJmfmhk>qj~WNov$X~J6W;Sd%z9xEnCM9y{)p_5z;Dp?b1hxU#><_ zMGmPUTy&E!Gg3aNnh?&uO}^G-IT z3%N}+vX*v-oNT-_oNP=igpds*GP>tLDIHKDZv3*$CKf_0xv3BZNi2k(5MQ*gGO=)M zHa=$c=Xsb7{GPEwyGu5YO)RP!eEi+q<0`gasgmZlqB1IZP?8C<7G4Qy>uvE_CN?-5 z_yr%>$%K(lWSKjjHf1tf)-O4mhAJuGY_c6wBxw^sVy?o;1!D&8 ztGN4fkU#8Ettac1^IEb$WOmF^due(PJk4EX1j=Mx~{(?&b9Q=X^r zZWH?RIBCqlYgF_wJa(Q`R*BPa?s~{%tfoGGyxSWPi9v`RCeQT(xr^>L5haXEGH+!>(jqD#Y{|W*u>s} zH_)JE(F%Sh3a;+Rg7IIm+;EZ^F5gH6IX!@s72c-mFEeQ1!S*F;jsn}I2DUBe3dULG z0XWsvTL9o+$O13~z$;B{aZA+*z;XeYIoUuLr#925#(B1;Y!-dIl`7ID2bihtN}8S+ zx%ktLJM7YrU028WoP5108(6tqMe!z{H9^v8Zj1Su|th`cb8jelw=;_#M!7i zG5!y`?v>cl5yvt)JDyFS%^XtEcimeVc-|U`Y3Az&)<=-w4Vc-$Elb_Y{i0jQ`K!9L zFTPFZ8?m!r%1BAXittQ^4}*8^vO0+(03-fzaJb>**a5_cHfsG9v;O*c65rX{cv{H% z7EW!p%C(xkgIAwz3?-dZ=MtYw3iBpOF!2jna_6zY1K+b#lS@#fOYj)ElI0C94t-_- z5qTNI*db;B&vgq`XaGIY`whm=PM#@Jih~a$vfLX+oy`$9$szEWoRI=GmXHUt4`FXS zV5o=D&Q*hFqY%XP?i`PkJ&gH%*2N$L-q8i~E5TPSO203tLAt`#e6?{fr$?^5N7Vp_2$t>*>4uBESMDSKigTrmvi=ny=mpv zVbzRuJ81^RbWN5QhKsnd~b^m63 zqlEq=0!R!c6fyf?(PWlX;~DEt;y54Za*-GL!X~h2vN2v^n9wX@B`~I;*9ub`&;wBj zY(mDxrn~?Q)`Vs?vED0ePA*(s1e(dh5Db}3%Gtn!eCZ`wZnz`b@#BEAMaTE|{E@EGA>>|f4*R*~9vCdXg%Ul7Zrzf8+xf)qd!t#@67)ge0&tu)}%Wg{S`NX>QSjt73-i{v?NnPMG0a~vi_x%xi zWdI*$>Lk)|gD-s$g8B5+q~n0>Xq(QuGUHQWr*k`K<;(iyh zaITf@*_4^#OFxVXHSlBZT(kO5^jz^LO=W+k)%X~0DwRKw8>}(l0QTSOBh2@?+`D)&}}uQa*PR;w&5&0D4TZ? zdHkf1s3TUFefe1rG#Z`wHg4M55!mNuzRXjIMZH=0&L_bhL#W>?$e%N4Bxu8hkpAE7K6LPyc$Ya$BWY3&KuoYVPn=Z)7` zD?XNdA5_GvaU?42wdsOSF{^AzygDovFnejuo4P(&&9>Kih=M(Z1V1_ZCl85?tuT?X zCzI@_qAh&%+M_pzPAAU!)85II*T3wt2(n#cUlP$kZ4OVa776Gc=SiirWtv$#RbJIg z6=Zk`l#-ZahnQsTy~s~C7iN41?L*bpisuc(90)rfN9aZ9FIl>dtR8YWNBj}uk<-_l zPl{;MoiV06rYE6o|7hu%bk-@o``Fh_f5tW{(D!%@>nEGugir5_A8vZH!(+(`cTHf> z@=kVi8SRiq9?(v4*eMA$_0IRPVAkDGZoY@Hu(qA^piG;ue}j)n$@T4gO0L50K8l88 zNT5@8^wW9l?xl;k@tC>l(5kz+N#8mXRMfpNSx>O<#tnb1!Io1~e*F<1;Dg%=&TBE) ztJ>xF0O@Q{xy%&2;fSfQ9TP%3U56JpFBFY_^FhxTcC%l z^~&t*F~I#K!JU_6=?Y#;IjuIj;(>fC=HwTGV3t=1l-@`M5l6!gX}%?t3hq}r`0Xa@ z%Le{>ocNp7{igb|e4{MSR@Y0qL2Oze)w|8icn*IDEqD{`)Y<;@ZCB(L7;@1?F|)v8 zhZQca_$UPR35Lhra9-wXgA3HH;4n5^yluJ=eDN!f@UV)h%Wn_u}qs_@33YWGxqL+(8bP%3aGyV~GE*+B3*Rd02> z%u6$s3fu<`r7VkaAzAKP>g$e9?PDgW=SS;W>$tny#m4Ht^y+ zw+nfYGC_S2q`;M4UBuP6tuTk~n~S_Rub4OPQ|1_H?!Tzcw3rRtrJ7&RfVU|fAv#8W zoCwr2!tpw$9OcH8#fcYqAIQb&PB?!)b!5Ak_lwNMOug4;W@tZoLMh2orgDupP4Lo+O zK#f=FYuO|$Z%;ZoVtNiQ&Ooz9X9L@j*=SOGWi-n7P$+J@aqjr~*5r5hGtD$g zeLY9bq?$=1R^OVMfmE?Ql5F0oL6b!}75E&>k4u|1t4w3rz>{B9-*W?aBSRn>^))kq zZ!cDt%^vp4HGr~JX-f$6ja@A_gw*<1JQmnNOjYsYRELJ~NVyNN(N8MQ%Mn3I!(KEi zvANm6&8CToT1Y|h<^0>iZsxBws;CK`yy?a#bMA()FOp=qw;OB$N@ki;fcTM0S7YTM zpAq`fU{BkDvW?qIOixP(drFKpog0EGuBvMCzyHWog4E2{>SLwX#|ds9g)8*x*C-}- zvQ8Z`o}jrJ@cndckRGQ-1xIQO-)9Up0Rg#F2n$do>X!6awkv?31;(M* z(=eE{$t=4S&x`Q_}FeqVjr>TKoX zr58n=a}e#HLI3m|XLjl?eM@AEufMBAiS!`nxtAD)OSkQspW4BLhpy|udqFe|2nrj5I@k_ZmIdJZW8*gk_ zdOBY9ynMls)+eulxK|9z298rN@maaf^XA&t#!16sm#~8q?|0MJ8WwMJrZps+30C}v zfBqrS#`(66n?5I)4ZP#Fg=ecbR>$iR^Oq##TD#G1zi4*%wxx6NyWZu3HQp`SpkW;5 z`pPd>DfVkqusP~Xno5mPqSaY zOjAF>bNpwrf^k!&8@#ygkBJ|1eXZ^Tc|>>})KBuk`^8(6i&zf$6!Bl$o+C2(pjjQs z2emSIxWoNPyFWYKpFQr6Nwb-JP}wz;5B`n{cfY#2$d9W1X1TK#Y#0A#43o|0^N$Q_ z&0pf*+~lGdKd2gsP7O>dAyV%}uF31jldU}Q>@9^a61`PshB7MBht5=lytm&1Vb3DF zB|U+VJtr-x5h!VG)JQ_4$v?`F3fYDd%~xJDG!dWPsDHALJsY^kE0!agzj@vi@QcE( zg~ICh^c}etdQE?v@AH#>V0-TAFAJWYcm}q&Wa2&^?J6ya9q5vd;-w=7o#M{3jm87N z^jbtW{1vX>IJ-7dx+$`}*AS5YkeOV&Kja1nCN!Cj`I`*QCcoJnJGpRDav_tuFvvd$ z-NIRg$N8p1@ZMDbY#5R%HOoe3wl`U} z##FJczwE!c5Cj7+?h{j@Ek!zy?@*iE8A+Xyfy0JJNili?7+}Ifny{0+bjVLZG5*?= z98p+6U!98``LkcTQ)DO6p)l6KyEPt#pPB-8W5gdHX*Uj!d#0U%q(=n-V{a`%^7}f%S9`(=a#F zip>Go>E7Ro0^q6V6txFT{^@2c70>^A$xMbW2mrp^46Rj;4!ed$(34! zw)6BIGRHgL(EFqhFODghoLfQwP41F#9e+u@(ktaOS0uwDd>QUd0jsjP0$x^v74a~8 z`C7N37vevcf2i}REIB15b=2?c^2)Ebs5UIf>{~@z1m+#@kO>rY6MS$+6HZtd$g);3 zxV?%pD@AdT;i?yymEUB9$y+jThK~VR5gMjENO2FrnG0D=_jr3+0tcQJ2dkA}QO4iREBY8!7k0EUb$+1f-(XlkamL zbiu&zRlW?Rf5R^tny#v)G%Zb4i?IyN_xJlTm^sQQ3&nA8mKW95DI9* z75~a}!QbF{$3EvZ_$Qtl&&03Hhf}SAx8V6Y<3Wx!Hc4gtVaJ7A8L)l_BxbL_b^M=< z7o;O%UHi`tYwj+JhcN;A88RtuM3`7ziq-!|5bmXgruT zWZuZA!|OTGWPN6|f#ES}UwWjZV|)0(PTl6BHi+`GaDBLOZcTJ)rM4PJGp_6CLJH7ery4BXZZ}<8Gwa4v0HY0N z!rvymEmrDhdP_ioz{ug+z~6{6FpwXpDn2oeCWCld0kwAfeJ-TkFDxb7ZN)C~zDo9o z^fi63_#N}%^E@z^{iL}d%xM!BPQTn;LSw7e#b9OOFbfPXtroh{fr((qCflpu2u*3S=G5Pwb7;xOAeEM*}fLpGF8zPaf+uW zD|#`l^J;OLTRS-^%^;7~k^!A?P7Xu&iX_M3vN+AyqLAeNd9@eRIPkKGOM!$8^mAo! z#Z1e?jA7Bh2A+w@{CobggJOoi$aGKgnLTJvh5SWGP{3clmgg@IxctFdaizy!{s!6D zA^yUKkEt$$`4XGs3mDAj_}ET$)l_SKVKCdNJI7!msmm+Sz4Hv_&0l|p!Mx7gc?@Pd zmo|(=HHp!P{)$ldQlp)k?t{sklbTQ-X?iTrWBTxJyFBKbe4LsBi}4cN85Se=^Oa;d z1S>Hd+$UGK)++n7Bvzm>8%DL5=c#FASEdSORrlD;S9u(DOXfJtd8$FNDG@F>jm{bv zE12EG%-UcN;xI1YVk-9ocuV)+%$|Y{+q!nQ$6O}ETo5{qDbVWLpaJAbC#4N%5xauk zu`f>g>}<24#K=S5C^Mpl#CiN>OZuC?DkN!E_em@;F&8r>(5lqT5s{{+ty`mJp7VS~ z2d%WbeC2QO6_ZCb$5$Z89$z8T=n%fLBNr&(@)d(1E?@Z@;@0z^i=Fb(-UjQ|7a1H@ zJggVGYUsPtP`JAf|BK#ogp1XEHy48pX3iys!7Q{P{cT9zGN!7kbNNuEW?Pk|))>4y z=0={xPJQ3~$igG@Wsfmsq4lOLvCy+CRh|cM9S+YVb?sWjG4Inv?^ua0vkiA(j|1g` z0@}dKJ`KSOKl%n&kU*Ck%^T!KXMIJ0v3*qG5~7phMjH4WB1F0G;bRz*<~+}k+;yQ= z=cTv(qHqG^*L#ThdWY(EKNk~&Eq$pbytGPbBEy+6hBZ7)nOxJL-W?i^((RF^mu~zV zP~j4z0UPEt%SuUA&OtTs+ZR0xi=gP%M{noJ+mdX6Lgm}`OM zG9wt?pA4&qKUrPMUF9*OKBH_Z_`>SClurto(NFYlA7(_jlbN-8h*PqZpmVXIgNrH+ z8(IxOh7B2hbjE}gMMWjnZ9nFz*w8`rb0`}c4jZx(3EuCA6~TgFL~be*>)Ijt&Hn%4 zM=X*yk0~8*#M8WdDn8V{nFPsDL-NZPu&BQeVNu(}qDVjgr7wv^VagadHpimQ<&lZI zAK2ots09P74T}POT<)X;E?gBz(&;|>kD}vp`j;lzN6AOXWA&&_wx4emzuU$}*pG^1V^b|7z$DdZ;w~>U5p^l~ zx;?^br>?8;=;h-go}565r~0Y%te zefyfE&CPLn(c_V(O)ek8;@H@p<3qPn-0-0<;V*{?5rr$GZKYQk6vdbzzcB8kBi-h&@(o*{mgX)O5=0;Zq=8dg)JGnzB7)g^AL) zx{okiK}BJEbL`Tc(bNqiTASXpZf&GB@=0s>t(9A0^u;6fx5Uf`o&l~)$+69k-z|gs zF?IOJO?LZxkrl0L*qM|~z`f$_E#W$4p zLhS7Jt!#iQ6=g*ZRy(3QBE8IR=Dfs5W%1VkL-$_%@jl&40-#8LFdInEb`b#X&(xd2 zdzwc!iTvhRw{}ucP)31Iutk;NugxMattzPEcx!5MR8u=$ z8tBPATEL?)^H(2f|4_)nA(KU^8P&wUtE?yHe}RYQkVwuA)nkaN>3Jj1qwNnF0#BfJ zs{_wC$$U4X%H8QxWjEGZUBf6BO0__RJio{Yw-&5yjNgkzs*-?}r#aw#=|PJ3^s(KO zBnwI3lbj@BH$AiXEgPebIRZu)BL>nD9=}(Il_V$Zv{rW2?9d}lhhY!V0es6|YQiv` z;puc(-Dt)oi<@B%f=ZX0<1|^tIbOu!c*A}jm(aUE3lt`zVc<1UJ}K-RrwO58fKpc! z4?N3F$a!U8v!RQWSHCmzXO=|Gk$N z6+LLF)$UzObNjtf2H*0Gzt8brQEg4{EFLi2c9S0DSHc?Ixrp;yE=jcyJ11Pn6)HbN z89fWtV7%8UzvcUh>}csSsFRQPlEjey_6hjHS(hf>OHZwhwC14&uPrPnu@1WE z7Ccm@vfE7E@~$_JGv0N{1M3*5dPr?YB3&E{>(9{;koXgZVHSR46@0S_dPRQ+D}0~i zvh>naxT<8ImrobI1OtbBxvJo$?W~U`?P{}&(B=#!a}qU?W%G6@uSRmgcCs(Bk1Kb4 z$1hb?au(>x>7mIvX{8vKIVjI>ZO805n(kbBLYo4NzJQyqGCl(rQ6(m&_({TT;zur1 zHD)En4vHF^C0ygc^r=$>DbEQ3Xk1hkKX6Ka*9qcqrVFeSgckDRRa0~Pr|f=-EZ-ms z6mI(IclcR+v#4=Uw#hlNQqBh9J9$n9K9Tuumm+9reYL|0|Fi zOzUql1sA`FkHFsV<~eZEDIvl%HjXqU@mdm%VpaSW7ReYGsV{w^6k$A z&isX$Ka;V+_FpjbLWvr7YR(Tq^!xd=1tr)?n-pE*O}C8)Q!qAhbqH4oAt9d*oRzqN zwz~xDs!@rsv2xo|HgZom+44$q$*^!!zuDj=c}FHq4T1Dd!vInXE27CI&-Sj!|n{%hUfQM;OuZ8rt@jciBwxtX&Fo-N?C0(bPh8+9gj! zoAy|@epwZ*2o*DuPi}A8p#;~f0LX9o8FPUU`z6X55mbW?-n3-GESC3 z>-G&m#d3H6cZ1z`B{4TQLGGCnT3FvU9#2f(C_l~_w&QKt(RTSo*lK3 z*<$c5^C+}y=v$9`62Ik!Z?V~f*sXVdK{cYG(0he>JS;loV7z=k)bvE`^2FYQV}68> zffAli>`mM>mQ^nsJb!A#sd;4lfD-br!T8b?J6#nkp+Br;Lr2>+=kicptEQD2d56A(yiWDOz0923ddy$3{jS#~koj zsq-B#ovs1GlTRjt1_#>2xNJ)Q)Taqt2=y{GC=Q7)VYc7&j)qhxrNVIzFBRxc)?|vi z9`9ef1J5^yM4g1(-)bBj*lK*sJtA?rx>LmCf}vg;6*=hI40szN)Xu(T&cAt+%d*FC z6T>@hI6n8a3z;9(WpXuzIRBE| z*e8)+f||HGhKh`y&_&`{ui&wg7%i~o;9}Nt@yJD_VKhq z1iLnmU@df{yLZ89m=R7*`Iz`XsuD8%XS8fE zXc<#k(DHNpN6W)Jv|OV`3lP(#7cN48m<|6HF(-JioJG7LmwCke&#<`y)Ap$@Y`2)U z^XPe&hn_=W`d<)~w7p5H13?k0|09C-Pqk?e#93OKEsTJeI=c{U-KiAj&JyM>2^h?s zO?c#BOmdDk>X-OB=Uz=Ap;%-Xi((w)2qtHnWT6A1PEzzDf?I~2QXHeOgG+vnd8Z{8 z1|D_4CZ`aX6n3^bTU+^Zl=o%G*&NA^=P%#&Xno4qtlInrwCu2}7%jD_tZBT&Pk| z%BzWWQ_2JH6RRTIa|{hXhE-zGuC1|22ZcOFaEp*IZt3-YqMmgm`kbFRu7t6}$c zo)9l&YFgUr#S5j>`gA8;jQrjkJJxQTSIIf91Xdx77i(w?iAXYO3y{Tw$l|^6=kWo# z!9`8q5?G5@gIf z=E8-~y8Se+?=bTAV}tVcw*+l^MYoZ+O-B~LI53Kmn*3693{(}gVL~v`9jeH@Gf$7( zr!H_`&F9skY7(r^QfJFiZK^ZJ+D>LpGj}oWhTt(nqdUAZo^yK@6kX;oqIa@i8yC#5MxJ0 zos`G}>x-wd&o>DD>!V!NXWObXV{kDspimRyeM1!aj>HrKyD@rj3N;@&m-+79ZAQV_ z^wjIwz^Tou-b(BkmgptU=4_w!+jaMH)KfU+D{&74?c3uE?N0Z7RPJo<8yHvmWbuU@ z8+EqtsfTLK}q1n^+^=>k?n%nGkY+Bz5*2y2(SHl$*cvKmhjoqYZj` zVGI{j!cCO1p9OB>qfr1kzID5Em&P>eJeOS?N}6jYgsnCy3=dhq?Q7b)rOlaq_KhTKx4E=jK0A#6<=P2i!2xThb@&#B`J3FdnQSY&@kG z%DK(iJTc-J3;9IuI$_S`EMCgqT?1L9eUnE*J`;*%KG{#a6SVC82z$-glao4pm)-X| zPRo0>EM;px{AK`xRg>syu+Hm-H(%TX|J6$znjcUgBqp{roEQ)cw=Ye^}oc! z8b^ZFlnVP2|5BpoO~3nnJGJUemaZq#yI4^!lug^?j|zJbUgshLV1LB&x;~i49OYv) zpcAHs>AaUnwODD0Sfj@C{P8lo@qkzL#bwSnj0(^C8BPfHD(OOucY|b))szZ#$l_5V80V6 zR#dGFtIEk7pV;Y*oAKYe6Yfs7<~h|o$Cyz@xb&1v28`6B3`-ls0;S-8C7+ya zru&ijg8$FcedeG&>fg^dalGP_Qnb?LO6F<+)qLxy)qaD(iH-iI-$RAEf=XxtzA-x3^a4gkRh}pW|E;3<+145~|RlI46$V>rlkf zl#(aYi5jrE}+OBe@n7F@#d&R^MVhZ&549s`4D+*Uf*6nhhTEi zgYLu6#$W|xK)<7~tIPzl8S}CM3l%czxY-^c60qWV@_(>{(TnO%Z-8qK^ieCjYv&ck zeNFEzZQ%n=3b3EdeiC22t}*dD?yc^7`CCvORrQ-Un&9*zYRcTi_hs0d!tb?o^)9%G zUVZBJDr$N)HIy)>y5gneXuI2Zu8}82sQZ0eRZC`=<34WurU-nTiOWMTshy1hTa#P5CoH6}}bTbxf|31JF2=78i#DHAoV+LfoY9>R^kHPo#;%1xwc zJ)$TVp@;Yu8Gjkl9n-zh7!M=POXmgjI+QQbpP zcM5x)hV>K2VEimDF-sHl$9kCNIyAc z-`IroD~mb~9gn!?&avhoQ{G^j)Ijj7X)=)$=GUEXMO0|A<^M2vfGYlenel%JVK8BG zSk>U7D!6j->l$Xp%TdD+L%$=eECNdAp?$#v5nW(&c?MWVX)QP7hs0~}&w_Y5JIDWC zjyf}IBZ-foyMLj4jvIDMUu$i8)^Zm_`wV46k2*gPGBBoO&t)o%HL0!-m#UO|Y=Yqx{LpORX&!lV zUJD=w55{qUTqAYxiS%RI`JHeHjPd1^nNw#0KlON|wlm|$2 zkOr*oX8=22$!-oUF&xkYIT?m%yd{PglG%rKPinVjXv33s>C9kVU$niKo~W~jdz~HZ z8DQFLdlkFtIZYRzsceuIBBc=|TeMOzaC|h8 zt{X`cwXQ(I914NaPjYS3FwtkN?6{SgXj|-5ui-&LLEG4xx@tPA#ewqd)rjUnsl zaztz85ZZJ7C3YQONK>E6GaSe6CZH#S8WzD@ zmlX1X6`?5XIu&J^WjiJ#XQcE~sHIFOR@Y@J=$un)lkvvtQj&wj!(uLoE>pOPG(Bo{ zH*ztN^LUL#g=jsboPW9zoX?-7uibPU-{d1|Vy|$o1_z75CfgZ9C`TlztmTz93Th-7 zViY5o6dsAch8QCxHMSrCkP?x1C{$<4(k~sT3K0+YWCK^JA;Q?niF*6Vc`|Z8O&T%+ zCkCVY#qzeKKYWk%At4cYA#;Q2sXFMik&Or_+(u~)2#s@P(57M7M73-h)%)5sw$}rI z=-I-f@T25Fh#jS6e|Wy>n`km2gIMh9`>Y#xEkDU(Vo7PBY87hiLF?LW>A2(!a>6iKML@6WE?EcCq2fiP0fD3k zx}7j@hAv%m_kXt!>&W08vJVe5kclu?RbubR7&+9I?=_75?%s6(YT6;E!uIkg3B9cTSqM`w|uI%*dXaVNA zafv;V{xQU~@O~nUMG}B5E_19HMD8ZZgt_Yu$!}jZ36^Gn+5M($P^8cwSGu(rL)Y-n zSfD~a=Um_NkBkM%G8U-f)Xl~K74i-C-zlyuVH>iyS!`h`+r^v^a<0$Fxr60$<7wu< znpJJ2_K2Z5he3oYUHj6^D)$--R5Jk&L?&=LvX-98K+f6krU&M_nD-z}Gq*GBT$!L( zhGBt|CRHZLKW=Bt&Xt+vl>t$kxmFoY^lavK#=NMz>6;&6Ht}CgTCk3E6Y@@)oBXM2 zKj${ruiS6c#cZ1#WZ*PP-<{%2_%tKg*}%?0MaNuxLcwPs4aaDLV(XA3BEnv7X>z`go( z?7^qf#JT*N#lI`~*TKK9@-Nqat%oWRX8a+L@Lj0e-~K+!SEyUb%@2OSjoF-`!|y8Z z2z|O15V!HB>-6sfOG^o{ge$gi+o;VA-0I(E71@QmDs!XjzKUTe5hqdIx)< zp&nDYx=p@#(_{gX4uWU=FL}`JG@zyQO%A$VIi38e1ts2oapvDnT~Z8SYx!5xpZNg(^w@368T-sM`yWMyqoh}zdiWSI%#d6<# zs>qZ%&lX#n1T!O!;l>=W$vK|e@1O1OoP0Xjt&CA%F0w8GgC}+_J~(?~{5T|?Y+&v2 z)ZUH6J;qT`k_;|$tuwodq12xGH^&%1t?m@FGMM&%J?)xpo(ATkftzjQ$I+y_tH$b*aw+FwwTLe)azVQBI(OFM*AdTaG%AED*~2&t zG7#od2K`Ksu;R=}>hLq!hhrX*=R$`@Om=S$$*nImIrqGe@$QH3h8ybQVbdUiMQ($e z=6PsxmqvL(Ht;o6EE9Hg3q8TQJ=P)FMyM^16)YuSL|`;<{=-cD=Q^@g@~#=VS|f%i|x})ecp5wbVH! zY~JFW3iU2I%-gqH&OyRf1_u+Qos^=S3w($$=$zuvM&FqyMoKyUktO&{dIFEx@^|FM zaD&FwE1cpUwOcZ+s{i~WTi7nG{GurB4aMkW@&jXVA#jgG<%Gy zooCr)#A|fNjmc}q_BYouA3(1l-$j$)v7=kM9*G^DTTh|Ry(i*NW{Kr}~8RKffeE?R>RMqdLdjJYAwo+i&7_>gM(=NTUmcVpeU6d8GS zFTF66P9Bt#)UswP4$T8F4$w3BLi5Z)b^5}8()X)mm7Nt%#Y-aX(8as-5uO&!@o@x= zNS|XI@8gr1MzbTNLb>gD5Zq$9!K&`sA_d9f0Bw3Mc0;$Y=T~TSkN2 z-66=q_jz2a7s+4s=#E`+f`b2{)F`6lqq=zPE%Qd3;)?u_ntN=1xLH zs_b-gDG@tWc8j@gxs}VO+{F-tHmTz;}>R$eU%kR3EKjX6Bz5Feg|8y@`a(R58 z`RrjXFLW>axlFj1h)iX@?&Y&wzU^MV!sUpy=Ce1rJkGs*m&>So3HvWw=w4z7Df_;A zIgHCK?xn?L(K=JZ!Cbbum*cqnx_fyXmruBtCvjP^-jqEpvA62R;dVRo=39?dGgUTH zFPzqCicWmxEi`X;b7{`U7@X;nm1-TB%K3eJ2_#rnwfb0uB;-E4Q#!a9#)3F;1(ska zhD``>qJ+bnelN4@`lC&~)~)wbB2v0XTa^-hB!7Qq@k>bD zR@YDTrDM(=X(JC*odjUnFyqxJy8=7^VQ$MJ9}q{iItT*}!-(^a>z|7{s78-r(chCk zq>^t+>rl@s?Zi99@xMWH+0h8qH^Sq0>5Pbb`}S<$`=3+m#__l=^F6P(%hjgaR6&>J ztSxLl$EdwuQC!wsULKTDO<^9+`}d-FBwiaFBv9p>z69TY7@KAt6U^oV6im(=nZl*78^N7vI~_rQ2Fcd$U_`(7h_?_G7VT z@1Kc^#k$> zImMkpfacaTOg=qs8KFPBZu03?_Z`L1jkz_o&eO8pMx6}8P>pzb*!jElmz`Z0x_6X_ z(Z*`d<5fMyi#qPW>y#RG1-b}nhdBuH0Mo&r$si4x%YzMd?y4{ditLNb!#h5f(16ga6q2p?}UL1gTJ1>RFIp4J_hEOCjQH^>N+5O@Wdq~jw z3w}AQaU^Q}om2rcEU`1#g&WHD!>WCtPgUyh@0Gql4KK57>$aCZxBTNQpxwYJOMpV4 z2Hv_KR{<0O-WT&EHFewM;u~L^k@8K#i&na9d#L9~eD}^v!Ol-lik%8n)O8ni8AySU zy^r)yr%L^|q6_LcUVzVjC_6?i-wvEi$0_^&wD&gfaaLvC|Cuyx(==^{z9yx>6dD_B z8-_MO1k{8iZ6awpCTXcqP14M?iOtJ6Gbt&H8U?jjs*z=-D(;5Tmq6bl%VKqr4bTUR zqDHJ*U0kCUHwuqNtQeK0&-Xg#+>?8z8B*N;e?R}v^LIYE^1IHt&+B!rbDeXa`#$F` zXVW~le>Yd{y6SOa>v8jm!8N}{o`cT@%UlVD|_Y{^;6rHoaC%EJFE3!W}2QNM$NWpjhK@=?=H-)&y z7Q*#BDf@{*S-;WcX^596`_AVX#CAS&_8BBPO`mP_Bpwv3bXWSnNy*A~U0))5NEVlT z#H^xaJi{9Au1dmjZ0F0nN~e+& zmI@Qalh`UA+!t@V>?=h`kMGLP(|YsLViJ#iU#rpv>%}{PJO_|9gTV0pnM|6vGZjT= zr0M)6BaPj3i{%cF|8k4W2a@ck>pdtR+o)Fl`^s0@pQgXz{U_drD!%h<>;^esck=JK z`=E2MONP$z^|N#To=xQ43*LVDd57^&Jf8{et%Qp1=)C>-KuD@%G=lbsKJG%8n z7Kv`B+2k2$2Oj!sDPO}rm1IA$a50}WsNDG)*6qWxhVqy0=xq#;zu<+yvvXJLNU;{} zxYRf@3peiGLM?4k6=GbST*j}EEa^G<^txfjXPh7%2(vOh6SiW3WupELF5BxIS1f}|&m(okVefEyOT+!J^ zrKO73I92=%%_M2R1&=k?{UQ6~7s-_;E+O5OuSy|#xc`0qob|-6^v4)>v?VMox#M+T z_NRX*wnm3V5(`8OGgumDT~8<4IUxJezeN~H_)eyJ3_R$id>j`gU8lPLJd*vgpwL_n*79?=dEYD!X(9gD-tlf83Wr_=7V_ zcD`D&^bgrzef5$je>v%n*EvLzr1TE!>@q?>Q_=K;%BBCS;>n>&71s@Z=rU(MCX-Fk z6~2I0^2`(_zXKU43qd~o;?8G&^=>J=*v((P11>)4axu&gSz;LA1#)?V>aDT^a`so= zsV%L?R`(8eh^%47S-v#&4UA|0uU7NyG|?x-@`NkZG1fe<)H!^^$)WRtvRx&A(&;@r z{1x#F$0ij$2m@so4%5rukpp(yViVx-HhdLE9$&Z-iXT9ZyMjV?mql?KJ`-m*(YIM z;)Q~JsV5E?%N-lQL&R-#=FY@Y3Jz9&Ie`YSbiVdS?(A}zvIstw?8Uj=Zzm$ ze5bOViJ|+os-0~-ntAVUIR`?#7nNOi_V$Il(%(^b-RKAB;K=^i5E6Q3(zVQkfAxJ> zecGIHSKjgZlfwE zvVY;mdG7I;wD~uOM>%yva+>rbOfJ2J`ebC^{RgoGh+-yEkfUa%n94pgNs7Ry+)p8i zitFBcU|aTAxN~DB^0OH-yMAdI?QxW{{Z^W~<8I-jPj!&7aAulr`iDg0tnc&3Hi`f&fpj7&#m%X-OIZM8lO@`Z%f)`ovYq)!-pAD)6!Req0CDrtOkYm)nWwFjq_t*eNfAez zSML1oFeOxa<{~yn)*y>(%Xcz3{{Ax+4S_gcFys#EazokPsOAgGhQv3lpV`7kN!uhCY`8SNhZ(U@~c~3_^)#<*Vy~` zl!^B!<}9v~dEpu+M9eO8s+JC}$-d!xp{kt=^TeL7x$b+fMCWfV`N+@J$eLYWP;6=` zL2tyn6SW{V)0zyb;eF-l=g#IeBbc*!xAEUGRAc#_9b$z^-bdT{>rbvJ7IXIAUuAGO zB@Ys<_wbcJ|F5&3TvKGOz5EO3nqPk<(!=Xa@*a@B=iN2qBHFBKXL)$%I@ZtDGz>TX z?7z{Zl;#Pg?(PSp2#5cjB2)s(X_0=w`MhzwY@K(=9S5ke|HN ztdZL+jZFVE%FKsfH{+_tB8#joY4_VK%0p3p-LlXuC^sd7`al2rZ22Ac<4Nvktb5R@ zXVUfCKW%E%U~#v_#TI8-Ot&~{;6=df9uCh{ktvpSbW&xS1q2j_)CjtET(_L z#J|{LfyGr8>nv`zc)P{BE$+AYsKswsJY{j%;;6-}9VWj87O%GW@jHzF2J7BzvCHE9 z7LQr{w#64LzG6|`Wzv~t@vRoGwODO&lf`Wo@3FYY;$s$1SUhF%*A`#1nDt4M-#6|w zSY+K*7T;$vV)5e^KX0+dw!<^l{T~)zv6yD<#4L-KTD;mKUm4UYvccjui+5X$S-IY9 z@m&_LwYb>g6pOEX)TDRH;!_s;Eq>nOhb-P~@dk@;v6yM`wU3zeer@r`7QbQf5sUX) z{HVodi***uEcz|ZviQ2S@4vQKY~}e@iwi7Hu{ioMQ=Vaq&s%)TV!y>+i#sgdX7T+N zkJN+DHdO`?eTMq1vZ@p7N=Nz)rRl4`toz@ ze#XW-WHH}fzu&q~T6wK<`i(U-!Hbowk*NN{G>wk^`S0Suf130fh7;2*sVT3mFTbIr ztfI2Iu9n%cxNFyymX_DzQffZFtoX`vo%IOE$yNDmiGEsq_HWqsj+FRQp>m=?P%KC7z{>W zRb#ZNr3K83UhB)FbS(^$_4QjqvG&ldjgc+U`g&W>@>OeV)|A)O5Vp0WBP?;NE9 zi1->?>NmGGZlPQvAc<37AC82=q)HN$(8yofqqa_pW!$T(N>*{buw3I1vcubxmLo~X+zOl8HA~pd=du+V=mbP$5BxXvFteRU; zWLnbK)ZEzK9%}V9H%5J%LZNn_6-fx`Xj#Qo8BIrO=2u@I>}Vn}-Jfjxl~h%h)Rt2S zezx2$-H_bTS9d*ayxQ`Tn$ilBZmcO>FCmRf>SNSzQ)5(Gs-=C4xiXe-pr&$7NzHp~ zgfaixx{~*>W2D*@zPxH}Nm*r}qAE}ls5JhLq;a}ai*XRr68*gjzFxP9!SFNip zFT)*fjA9&+e>PlIIq3S#6>S9K8uG|8K+BzcJ z#}q=8A1i`I*sQ0*p{{VKDHaO)8hx?OaBFCpZ%aokE>&%J;$bC8`rr1h`fV}k1Jd@k zwH1vX#77%A3D+L%&^4iN=150PNyH2mD7#amDW|RO{ll@Z>!)&ZnzWr zYxUYP9*CIo#b{TfmC=~7QR0uCDqCGsVj2UtNk?qfs*=how;iikTT4gLX2%Jq^{R4p zbzP~7hFe=inWCXsy<Br-*Dp^xm^`5cttJbcoM$wY(vBZ&|Huq?# zqZcNflCrXz)#Y{7<#ji$t+_E!f&l4`qRA4+rLO43SRLe=iCXrV^$l*cfYEe3ir_Pf1P{ z`29_rvC|uH%YA%7X-(bY4W+ujHzfMqEb*EX{3><0aH5|M*OlNG(BZlh{dBk;34X@T z^x&tN!}a1re2zS*KUz z_Nz1DiWB@yxC;DsEGC~WlkecI?BfwRg^WADD@~1v+sJkWtjgJ*rgFyoR*Ih=KUW(R zieDG=?idxdajzCX)tjaUR^w-qSIm`FF-lsnDQX5UH26d=?ywEun`C6QWphg~x_G-z z!#_ziz!XH7$u9O^DSi$3?H=>f*lbo3cW~pK^?v( zE#T4VPmQNPE#0HiFJ)eA%X1wK^bB<2RcRVMysVQJApVSWHKQ<7&4^41c;;lNIh1iu z-BdM)a?V-d4V&xJ)QlBepF5d)epSu&98*&y?yM99`6&bFuKo*PKchw(p3LD zmHG)Ze3OxPqFdTLIn23!S`Ri^JAzH~%+64=k@0L~JbOj<$c!P|Hpn}0gHoS@sy3MX z-0pZfahr&3L)T{|b6d=aGgClKtp=t}vbp)76E95qqxdUYDh27fx5RYqE!CgtHoq{jzQC z=*7iZ>SFA{#mMPm8bk({A<1Mzw!+2dsU>=8Kyrz4|GY${_&jg?a@Lk$EN zzurwBc#n~@+pXpNQRFl)L(MD9lJRQ9J2W#qqao{@F<@MKuKUm|`p^aRA+O4L#P*?7 zI_lKfX$QuEMKiHGG1KP*%q~Wt;LTE2k@r-U=%*6g=g7h7t6Qe1E%cYnI@)^0lm^qD zQ`I1|*6ZG@)N!3Yw$J5GXd8F=gtz4zd>;qjax;{Ei;-obJ6)GoVRz2Q-!qG`4*i&g ze$1+wIg%BgZpwK&Q~4W|YJ-|>K5lnHIWL*6E-BooF7ebUJ(3J&4rGL%~W8aE_!xB5c`jgsn2o5J#<3nft%}!>x%0t>H4^B@3f`Jye2-63CG8R zsWKj4pc2ZfeBm-Mo`;iag@+op27i z({S_7bqCM)nmgPlGu0>0%vBfNlRGqjaPGkD@T`Ul0$zXaWy}!@bJd*Z6I)m8IqG5N zIGdE3C|vH6OqJ_lJQ$fiG;MI|z~pdx!z6!NK+^FsSIR{{vY($mGHu9SW40jInk5h2 z$LZU3+4S+5D(4>4$8#4>RWp7*ZDi_@PEF4*oH(XD^VOV3&Mo%_NmJ^Mt-=mBELxPV z7BS9gogCsYSSa{D)2_$do~988254`7X-f{w8*@@}8!D zK?9PHHy!sJm2rHo_Upv|1)INwal75|ocxTP&&JNrRI~3fc0TvwNh-^;P)!~*V{fnI zy?&-ze|o;EF1$otbY`BKcRWXVW4S6bxIm@XU8uZ&RO%|ItX}Gl?IWz)&l#KIm^kOL zHg1XvaF6kR&Zh6v>0mEiZjak0ye(6`?f7(cCH*~@zCRl;}h5*ubQVHS)VWLXxtkMG}-VlC^ z-a1pg^~}ZUEvJ#;NuSC+z6cp!iVQDP>4o{Kx5%Tu2JL9DG9+xGAGe6EFmBtFyC7Xn z$6jGEheVG>PZ!;srEaeCsEwZkym-chG&!%{z8D8I$c>vO7h;_GG3>zx2oLpp$NIhU#T( zbI-Hm^AkOmWiyt|RI~2kj)t*J+HbliC*FQLM4st<6g4L;gXtMAhX%L*@4nJ4F{^w>Nd<{;rVN;u+69Jkw@j=s-%iaTobWzo_swe-wXb=m0* zb>T_op2ss)7Gv9F<~VA*M|q)RHchwN^9FM`mcZ<);I@ zAIfPm<#oF~)6p;Hchgr)HFH?zX8wU2-SjwG~rE<=A)tu88DDUxE$Y-|7;2t!+E?0Gb%%i>oowWHUx{)FA z6!8@C6!8@C)CBQT-nTgV^#-!n^{Pp0&@$pabux1Fe#)bkK=%fboz(aAWaeqchKYX} zbiZ7quE}n9T+hrjHM1tuzbH2YJIH-GY0Qv05_89qPkYqs(1=baox1Y&4%ZU>nX|gW z#m5CHQ*07#D(es2ho_noOMhcM!?~~N{(Fzw1%*SV>~6Q`r`hVKj8$JcIamGT@p)=j zY`*%tV2vp6|um{B*VIf54+Yv&W;JvvCvMG6zWt zBf3?%PAz)SqgF#1+&@eIN_M-`$z8;K&MUeOgU(D*bPpAb-*21y3;Le4Z{ajGr-pSH zZNoBI)0w8SYo>?wT2YLCPruY_MRHG%z4SeV4TW|~S;SB5C+-hGeYSjwZrXu(dhO30 zm-4vNGIn*Exqr-^f^8sQxeu(HqWqi;xE0E1k^0k~T$6iMm2^#XZ<;4x$=aLL+3%6L z&s5f(rl;i;PD{(7(>Q(6=ao6nWX8;^m01}!acEAJo5vW2zn)DDP8r~Od|oTpb)OHu zLp2=nsBb~{>T;nA32xeRf-t(y=$5ueGB2+)H#Tz*tp{gllgB)22RL@sD>OLrctC4}*t#vyRzuyYzc~K!UeVk7$K|zU=E_0wn6lehztCrGCgV$cM>{9$$4-0!{PF6GbWR5T!4osmx=r%e{ zosWA|0NNnwNM0v1)a2u=K_p+({XJ9NM%aIWZrAy$1h?sL3*-H5kao(wOrAr`!nRz1 zZDGFiyf>`JK50X*%+oW)p2X+r<~hQJy1x!c{Q2nU9=R(pvaG;Q_c!hf8oudKUxd7E zlwE9N@B;1r5q^usPv&$nnUiEI@ymVAql(0zG?LwtPCOph-D!`z{vzY7tTPJMq}jfg zsk*=IQ9p$GZ9Z;yV%TY_|2rP_d*}rl*6lX;(aYpMddPhr9dPVT>?&0}h>e9Z+D)C@ zZqFQ^`Otso&=<5lpCj!cHXi%#_&If$!8k=b%viw+M3^-Jk=q$F2lJieInEEzfAa9G z&Qz;oQ`OtiDKGOdXDo={tLQw)2VIRnb9%>A^^Uq6bun{{`9pKVa~f>>vEJhQ55@^- zP|7duSD35aU&8OS<9B?%68DuqasAgF2|X(pZ2KlLibBqbX_jg?pZIQ3y$B( z93}1`blmYfGhe&!#qX5k*PN-uebFyH>SghxtjTUkBOZtA3F+dNvc&VoolrhqSL#dN ziZUt6uek4XhwrI^cU+H;xrk?unmaUmP@ef_V|%p?k1bR^zxSx`K}8=R53$4C?`9mIt^Lx^a4@*| zBO?hj=4M_&I7K*>oCaatY343q-mqut$mAh;qHOF`F=5Oc967)0QO`h+NY~FI+?RLk><=Nx3M@;HsJN4R#q{F>m!>C7H_9u^;6B$ce+~0)q#gB3%yWMe| z=TNy9WBak6+1SeLN2Y5Vt=9@OurD`YtMz&X>yNZe4sDYYaXqh-^=IApv*`O`bC^d) zm_yE-qGr}*tCgRT!Gf#Eh*9TY=-wqYqcy4!Y!DQCM=B2TMI554zv|+cGHk_TVW}lp$mQgo1 zEr85F1a(RLoGIMD&r0*g=A>m5UYI8SN1+~@cCyg4fqDOAGN90n&GsS`F#wOHdsv*Mu9_o|u($Dqk=Kef%I zBiF~=a(`>?X%phoZf@n&nj|KKVw;#r4|Mu?8-vqvT#Mt2yf90&KkhJ zq*~K?qd4j2y%a}}%zF8y^nIQO$lD;UXLw?3k0GDjT&jypena>TyV9%1?-=D9b@_$yJAq$@ zE4|O+cM89Jm)~RfjpCQ;_qY9$MmB%jFKOiPxBZev4u9J(Y2@&?{gOrwf7>r<DqhC}T)hPIb?m8gFZ_q#hok?m#|8D46G_?60L zMFKG)#Z}(k*=A#ul&xpylat>3w7~Z2&bCdVNPT5{ptZ3nv^JvD940h3u-j_wruVbc zs9rX-sBS`9cWo$E5{nV;=%m2*b!OKG(b;C#zADnuR%`cYy^~Z*S9P{G$sS0Ph$@v- zYU`uzVfJywHmkF^>zX5>#$au%F&3&{&3?ZJCf5hH*OxYjnzq)2nmYC7r>d4V_V9d{ z6xkP5PXSC()IVFF)h+D9Dt9(quF+dDqv}hZ!1k(+_AT`#(RJ<7mM!g}pg7eJZLFIb zBShkKd+QEJq43y3yu^a97oUi12dfU-kH{vPU*{95F4ee zjD_0jZ*1?lwY{P-+N?f7yh^hN&%heJaZuegzJC?Fby{sj)t7Axz>7$?PBx+5 zz$VoCico|-L1>y6Vs;bT|HgMsDAwE&)Z*i*qmf_b zS`*+SV=6t-6hs-*Ekk-b!q*&b}8Rh)jsB{CH*<-t{Z_uNh93U5^FYj-9w66 zS7|ylHm-J+WlFtFeMJS=n;my*%UG(8NYn~azF|8%*6Q85{?@o}Nz|0Rq&--RfYtxf z+Faey9>Tw~33)FSsmjJZEsQ-*Nv*m#HGeSfFR9!_sg3^W&ZtJYDjF!w)Uv5F=1BUj z@w6#$ZEH&tE%v;GHND0r{(|+nDZ<{^b?uSHmZ;t!yEUP{$c;XpiJ!F)B|&uP-<`N9 z{3_8!YV-^7W6xl{{3~VSEq&-J+s4K&ncb~>>3PLZ$3dRqCHeLAO^mdyrJW&BIB5 zuX9yb{`Rp_*0eM=mv*$t=3=F;h}Yf7=nar+Bll(=ggIHe~t?k?t6Vs@ku;r~`A7ckaS!nCNmaUtcTRUzwns<4; zd{!yd9fY&?054M#k%CfxmNJ-K#auCd?;ET4sz@lLj@Vq|hQKjJDnKhuS)0gY*=qE%!)@E$sIcL#i$rD=FKBLu~r(9Fqz9W(}lznh!#g0^Wm>tTBonMJo)@g$t$KME8y??9(ws^c5B>8I%FAHsE z_8?nyS=e*t7-*xh>?=tt+1@&~)kk=1o3wU*z$H7!EG)M*lPZ{g_#cupHAj`S>|$fN zRz~Y0oNth0<5V-?n>fov|Fq2x=<^t^6nRUrN+OZQ?e(FyaBO>h)J%MSWYb?`lIJ}W ztsV8Ir&&lojxxTMg`!On zJJ)(q+RL%Zdhn3B&H)@J+f#@sbbh13$;Rz@gBd#@GA ziM`a$XNgf8`amb=GvFfv<$NZ0&hh!9)5ew5&Dd;rX}u)KX+OQfT{jjj7eWuqlnLc&%xMq@_wYO%z8q!VBVIo6BSLM-DUkMuDc zg836o>B{G+^qN>J1|rrO36*v*iDvwJR{W|uI<|I(ooQ%!dn|(88STOu(|qFC3? zA|%%Rp~>so&0hXs+z74WzzG?>TO_xXmvf}7r7}5e*F~1%eqwT6DAIxJ|qm(s3<%p(A()H~}fRRqLhIZA$CiC2LQ?CrFi(I~D8i}VG7GIk&+VmDf}IjogIrGn7`dtDhV3vKG$vLzI8N_k^>O?7#d zbJtVMIUtdyX5^E>F8I>=CYF;++PG!f7PWUt&7>G?*@B6@PsKWzP$1n4RRm2&AJqq*LH2l;d|2u9S0;JQqf zjE6{|C5Aq=scXjg`jC1jXS9Tx>o;p!I?XX!)Uf3dTvzhmCg3fQeCR*LtWe`a{HJN>0-*l zX(uQ$38{IwG$Z*)BeXOjtG8-iv+8oq2Ro5qxMg`;RMz;HlfrUBb8EM}^~&W}F1Kxb zPKaPjhdV&h_0CueXHaZ^gAhnfrax~G!X>LW2-O^F47)EU*Ck?Z%-lh)6I~WzAZ6iD z&cFS}k-&;QKVAO0rAmG4y}su+pX8WPeiBTc8Oh4c6+ZsCe&X-`Ip-O5wo50Y&&m-l zW{~hX=L}hMq0dQTm;Dvyyr?U%wfbzTE9?^}eXh|&=Shj}DhPLBBjlVWChH(p02=4K ztAh9;O-ZKE38tm`x)#ybAA1vvLgYX21FNtyne2`^`3jUS#)ZH4{UT{p3G zn_^C6?WzeY>YTR}ZMj{a&*dEK!@3gIUCgLC=Z0ySK1Yk2(V&deZ0Sz8t{VZrjtFMI zo%6PI+l|+5sD?SCE1vlH^@)e$EUt(y#2bc-b~ee_zqzwDh5T%KqEP(g4qRqfQcmZ* zripO;{F6_+89ROK&4y1po+d>-#>tO5wT~U6mLi@hjX5JuAC?wx{_)HCKN((5`_Yq@ zc$qlE=sfCiZamK7O3=%^U_qW3l#Nnl`c__NqTa^+TRT(aXHTD^SsjHPUtWKGxDLH) z?d#a=6AS2DB5QAQ^RYyqZ`R)7YYnyMb8f>#`8plNm4HoJ&PgMkMrZNOwZ5s1SIVHb08$UV0H}9T6{%&DVzBgCi35T zlIy9MPprt65a)o#Soq>TWw}qE7TTs4Y<*3Q?Y@ro*6kb?>eDmWppOY|2Yw-8LJ{+9 z&BscD&zeOhxb^jBwrgg<;%4E%o~0@U;G9a(X}2Jk~97O3&GcoE)t0_oTe3l8$wB z_*kghZVqOR`e?Y$b`iZVKYp}m-fclAtSW?Af@rnf63E zS~l#?CZF4BPb#q`7gMM2*TZ#oWr7`Z@7z zK5?_+)5m7IazrtW7gJ7oZ6dx3Yf^AUZ0zI+TN9JpKHgdIZDzqcDH7+eUapUHZR5tS zg(Y&Qp;%z`Z4GU|wIjm9L1as(tY2#dF!?xw&#Uo85ngMM`7Sx|n7cEATKH(YxCoL< zx=f29uSQbJ)3%s0*t~3k5w2MXv)xV3P&VZx;Z9cT?5VUVOURkotU}1@srlh`jhgvJa zL-Y87(o|&)%e|uT`fkHfcKk~@RGHbWUB{q4GQ>%5Go08z3?d`gSQE8(v@h45zI>gU z32A%cc=<$|VyxSl9}jpPmC#uk6WGE@*evij#Z38JU0erp55G1alWBo1udOrvN^YiH z)wAv8gp;>P?647BraKl7Ct5JjA>SsRCPcQQe5`9@(pxs^#n1xZ*hGMa)E%MJ$ND8b z!$Z)tGaiwt{)JTuLnW|6F_$C^XFF@LN=BV)c8rr~E(ZiH4zF`iOA%dF>Omg_O~Gps*zBlj*8h9MW`#2+UtF)XID)KEBed9O}NsH-0?b z;3Bg4)R*(p%?bY;8+~qhV)8K5Q4KA!`ueT6zEKQG*d2j$-=$;d3C*}!Bt?*N%MtEQ z`#9&hYk$|o(9!3yaEa&O%RIbw^VmGiq)Xv!1k%NkbbU)}$0pv)ksz$o8HWv`DarBGI=WSttqdos9#%ER#LON*7QAQ@l5w4bZa~RT||AX zS##=I-w~c#NMOPf_#>oif)k-wK#0-Q*Z=oW4lp{L1TuOf}!u^R8G(Ah#|R%TkdXt; zYs4zbTLSSiQY&*iP(c66D<~8L6`z@knH0aol3I0%!{954-*t&!u*~q6&2@GM>z~hJ zy2UpOReMZ&#RtvzY6c!Qn4C`EK@+amUiYO4mmDvZJO148b0$CYRyg~b8^_PzNvC+^ zjpgIB*L#w}nJ1ZN&ldmA#2>NOz1Hodf8sZ`p4A2~bS^mPF(vP@?XII^s-WPxEhx^1}T3EH>F zhAXn+Ql+=UhV!pA_2m?b#GjR4jt#fl>cODFIz| zUn`eX>5baX-da|FG>bCq+H-Z9TeeeL0yU@n_}IWy`n0hD(*+2AgkS0=*is z>GjxfsrpBTO|Nf)^p4qj_-%Wnl1q;bcf#7CRQfVt!{yleUX&;m^uTy@Tf5d}+l}4Z zi9aj9W40cCTaRws`~D5+HC?o4cl;CRxX@c znfSB$_SkT0t!?MTP;tAq!PaBg%7v3_5`Q+me4F0gHe9Ouj@WSBwtZ8z$B50h$jT*E zzbv-$>$l-j>3y?JZ-)(+${q~Z@}01HpQ=5EZGRiIa!#dxLpEHql}oB|HOKZ3HG%w2 z*nT<3>eV^(VA~#DwjVXv^itJh)Rym*O)phAuMOv&pkMl|{0`alI3+Og=jgpH-*GFy zRN)$|T>5N#q-tMh{_D5(P1PR9Y`!~edgto1DXue5J~Kf*PFVfB-sU?gv9|Gk)L`|m z*V@Tc{iENuZ-tdhs`@(jO=T14L9=a-9-CgOel%#q_1b!*vd>}L9;d7wN;yBU;Rdao zQ{~%l+vB9IM=JT9vgI4F{Wq1}*kJYa{t4Qn&&v6j%{P^tn{D|9Y1 z*z_`Nd!(Az^;x~jnV`NEHr$Bqm#OOE-2Xjp^G#Kc99zC2+it1!w9kg?n!p}-tsZQ! z>80wIr)+z8ZManP66b#S(Fyck*?fy^xK!yi*m?}xewixV=x@w8dCZnCRsR^W^-#9m zQt7?V=9^{9m&*Qi+k7*u{^gxxUyR3qO>flZd+xYz!j0H)&!x=Qgd4Q=xYy=;Zux9_ zHr%k4OR9Nng{{Y8TfS8Kmv7sx%a$+Icyz*s8s*W+oo4+^W{@wi9b7^?6Y?5xXm|JdVMy%pv^ax{QS1Qtv0<>^8=r4kLC&N#tED6 z2Agjx`GswIgSLHB>1n{$H^Zivs(rg`dV433OTSGof34}CspMB-^<{K|dMKN(&!(5E ze9pRC`UK_cwffR!`$sB!P-NRJV8f-#H&KaFyUez$jdmYcDSOZ&9j&#Y*v48uyvz>r z=*GIHa7%b2n}>O>$+K_sxIsDNoikr?+RKr%Gd?)-bo9vSw@!)jx(eRZpA*lS-#YUz zXPkDfkJ|O%;+1CI)OI81@`QN4;alxGadLt^KQMaM{J6p7>yG=cm4DSClWyREso&uK z@z;kp*l_*!dP9nEh0c1ny*{vS{Pdi1PlU%GNXdv+?75?RE8&@vr+FdH!Jh>wbH^`>W$$FLvTTHvaXA;)fR})~EZS^OM6w=_X%y))Pi;yE%5y377w%DfiGiQ=Vjfo+y65jbB`2;wRhr z9k$&Eo5xST*Iq9UjvwDCXDZxn`&-XO6F;$4ImXm}cewYK@vo;!*YQuK&&M1)-~_bj zKXiWW*xz8vlN9~0cP8ocpnV?LU~!^^N9;J@gd6$SH>c0O#>Dyzo~Im~{LU8#A2a1D zew&rEgGmVtooBdV8?L{|q*rV)DLFNIp5Zd=chaSnI?r$wHrzmpbew!QoM*UZ8?JYP^t#S7+zuPAdxG?KpJ%u}8_su?kz21tr=AWT zJI`<@oN$FUJ&R5{4xX~%8tlBT*P?U%%_8rx_&UP+bsqb2MpRygh`)=oe7P^LiNy%V zUJu!Mx|7deJAZS=i!M8U{CCq!Wlu+rnSR~tWMGl6Z=cuvz+Z5F;ncG83|E{ulJNav zT@JoMoKT+pr1Cn>{_ooQSUWm&YJ7VdNGiAAN#K77%lM+ayZ{+s7lUM(*V2^8Qt; zqyLVo>+2K6uUcDLQdPEgO-W_74qsDVTfa6?SGl&jR=X$e7wfyqHm<3yD-G!I)!bdm zEoUgAohsQ~*4z|!`&G(Llg*s7Ved!X*Cd7H@U?o^h#V7Q(y#5<9J>|4Yz%bpGHeS{ zTGP@L>4@UJ(U!fey0)~nMel6ptnNrl8*hZ-SKGOHa|=5sZ94kIo;P#rilpn86arB3A3BMixh`je1GS^pJbyb0jRErApz0y|xH$pA! zH4oxyHG%oRIuxr8#n@G_Ro~%TX=?wHAP3WM!(U>KDKL^I{0$s*R>S^`5U)FvYLJso zOxi0sA1^t5Bg<9xl}Z1~t8LB|YisLDswzur%dNh|x196dU>k44ib*DHZ3=%Hf*l*8 zFJo_#Ar}ru(c4FOVa^w%3#z{&9Pc)_v_*ZKQ^XsXP4I8!r;t%+8mf5$HJb8}~Z<9pWvBAj?2)qDu1p&8Li$*P>Arlv;mUcFlh-t5Q=S&tIc_=1h)OjE^;_>wFjbzye=TK` zmsxo$RF1Av$?j5ileLG~D8N1ejw{&0Yo%;2=-BS`u!*iG$klAE(B)3$UunlW^Ln&B z^NGw-`Rg-feX_-~U3S{pjWC>~D@UY~(?r*ubenl=HfmqW9?Mn5^G$W#4Bfs~bF>(5 z)!L)3%#KCTo9%2Yp|gs1QI9tp-n5(S$rRzYgqvH#99v}0uo6K|bbU-e*>)K8B@ZL< zeG$4*`1fYR$Gg1jH*E^hddBpo^6zZlDktr#D+{hHEMT(Nx!cM4{~7dpmD&nb)bgzb z@BwH8{9f=B6owakhzDvL;SYfq@p4)a-Uo)EV|-IW@C&m!F%$p$!HanzZm)y^=gKFp z;B&xMsG=@S<3sT2@Q1(`AxUQ#T*yOp;RUa>d?C2e@`4|*d<^_PBx#-kGx)@m#1&j< zdBG4Qb!i5#%;8ih!WV+yg66;vf@dHJBX|ifMhNc%J1idtKLJVlJHWyPlu6P7Z-T`C zcJMyS_ku6-K(LuG!{CaAroM&Xhb+GXtmffZ7h$}YaAquYH+(->=;J$F@ZI3#MM~W- zVZhs)@@-VZLgj55Icz^_0j;01pS4Z;gfUCbv{;03dw*Caf+UEJ&VUJJZ+=O8(i4F%wR;Je>~&cHW-cPwFFHhd4LxY^ku;lb}gyWs_Y0rkU= zfW?>dU3T~Y_%w6^eh~Z}Gzc&F7w83e!3|4kCwRd-A@BM$jeFpI@crN@R0z+#n|c(w z9)1YCuz)hda}TBNgM#qfr>Xuc&`Ws1KS8&{3ugL}KRox8Y8A8>J^+3YIt0(Xo%-XI z6>JD_6{9{egBhmOM!fNy&z zZ3o{E{sbC^7pyJjv{ZP(o1yd#X&S!(KL=j$0F)0uP@>fDq3hwjH(+z2GWY=aDX0ow zaCs?pffp=+ViE>C3f&1m0KNv@4KKK}jPk<^J^(!m-w$3~PWj>e;M7%0JqPav-vyn7 z4}j}dQ!jYI4?)B5J>ajP*Wd-GS5U9_q-iXI&w&@LgqFbvzI_rd{9%z;~^sF5(Y94c!Yr2p$Zes}crmcsKQe7kmOb0WWwG zdI5e2Twg=qmN4L^b@VUzUU1)f^z&w90{+8IlplT&T=E{u5AO$m1C_z6n*}K|d;lDQ zg7AWGzlAcx3)Vn8;05cU`{9ScmW}i&_%Qgm5d0u`-Fs;Zc)^cAC*cJTK*R9f_o186 zsDuY6*CX>=(lp)&?}ZmU0Oi9A<}}b>-~}&%0`PvY4QhrL{1S9Kyx_}F4?MSnY7^88 z&%PD)$K8}!{69x~K_}n^-~D;Y2`||H1>^}o0N!*zy1fxOgU>+u@ZK*f^)<*3KL~F9 zC(0%~c=;asGQ1zWaxc08Ukvu|qs;I;%T&wvBXfA3f2#dZGd#~s)!Ppsb9kOlskA=o z0?#um6^8DF=Q*1CGITGz;O2*D3wXg+s9(Z>-iNWz@a+FlyPy;B>={za4^l^Xo)@UE zLqqU9Lr@nVqFvy5uA!cQM#Ud2KCF~_FS-GK0?L5z0lyA;;RnIVM`#;(FIWyOmN4Mg zA-{wHryfN<5(YdD6~p`bku6jO-vHhR)xr0I--kBB4}o*PgnT3nSn?S50X_iE`6~Sg z-Un`j4#D$0RPB6%z60M2KKX6x3qJ_H^9Qskd;t8^Da!vo!hnB#fi{KbS*-fwPw5ZB z4`BnLAiUuFenuO>3${Qz;CZ&I9{L62BYZ#jBd8yqXToaQY3wSz7i@zD-~~IO7vKe3 z&(PoC1wR30)Te3O51#|y59a=XvcdBlT21~V@`U$-S3za)f(QBb;s$uZpFwxRkAQQh z@x5($A6O3c!Uw?jXYxH*c)^p< zFb0jn3+`V>zKv-bpNB7m=UJw@e}jj$M#>ESC)5Bx0xo$E<%9QwAt($V2KPa?OBis; z&6G{TfLov*2?OqfcEk6BFG71I%q<@EIjA3=XN+pvM&t(X1wRQ5h(EZufqKCYfD0P= zRx3Qu%+%T@WC-5?J`eGs3pE5@8RWZ}@H`h)pMkvaykOnZ6_b-7`))w1vNsscu3w{i$fbRkOcTzTZ z!CymR_z^JkQP??uQrr;-~p0E4<)0p+R`Te}{(PN5I#i5qQC_9%KqH z_!yKEO4Imbct89QIO#JURSfS1XWc_N;eBBA?Vg-11-cvFd#^`b z{tuKBUhw2+(L?wl@ag+-!wat5P1)cDH$dr|nTLZjKgaiA;RSP`e0U#N3>Co#z*cd? z3ub+ua>5I~9oi^iz_ni>9DD<~@P6zMybrt)x))yXn@}IT;Av<8egs_hMdS%DSolv| zgBQFJ@@^qba2w=<7yJ#h3|_FL*Q4s-1#g6Im+;`np}XM)?|%UOhZj5mJr3Uwer6B0 z4qh<*LGpzcTm+563$BJTn$t91x|h1a3$BCw@PhSFF?<+Yu%BQh0Fv5#$En0DcR)7hdou{pdWrAfGN$C*TEdflk2- z-U_`8?|lRrK(E0I4nZ03Ctq;YKYNr9J^+THLU_S{gsz7d+zSQZ`@vsA4e%r2)JKsa zyx{P^p#SiKuRy)<>M`QBa19iL7ku~EXj6E>ozVU8g5QJ=!4HA!|BW_<7yQAK zlnq|+El<%m;r(DAq*{>!_;bh$FSz(=WC$;~4Jw511v8G*AK|@V0NMaAcpKCVFZeIe z?eKy}zK*`Z3;qN;1U~|9KS9~xyTOysqHpj+;9cK97Vv{$;G2|<@6WrxcmGBFegrMX zUoiJM>;}Bxt56lZ;OkHjUhv{?AvbuzLg-HT25|AW(LH!S*ah{$cY{BK`r!pX@g2r2 zc)?!iIrx6?_s|RQg0lzd%kYBBpiy}D_wM`f`}%juuRTrUZ{UmI)$`bMr~-ZjeC&J3 z6Mg{9J&7K|yT5TS-@0G*L&}eT06g$x+8w?h{P@4qci_E0@u>NHOa5_*3(9xp->1Ll=d?TDbr<|RR0J=$2daPGmQFZcx13@>>5Y2*m+{#LvD zTkr1gz`MT@@BV(gd{=(quW0u$YkJ^fXb!yKGI7HT77D=&UJsSQ3kIM%c)_uc(nclo~iVdyo&2>uSr;T!3K*ZrQp4DbH- zy8D~$^6mDg|A3t#jNp%!8CpdNTX z_#MTXAN&ybxCb4SFllLO+9bZG3qJrl-%l6Jnw+Lyz+dn}XcXT4ZFKo&`qfiu^Qgg9 z@P2srchKeg=mi=0;V)PTHA@&!zG*JsJ{NSpbuQSR$v4087yLYQ9A5AX&`Egr_s8Ae zE|+hb&(4zX*c;4)_rVLk1@glSjzGomY6fE=)BxWNrp;vj0`LAVxqPqud(fTu3!a2_ z!@IvP?*8_8b~bCWUe;3yBlvabG`!#m=nVWIxcma<5uKC+?1Hl3d%+uKrKvgagJAD$ z$`3yTz6#~Tt2xL9^27Io2j;To1n-@Pe4q;P2j4cIxf^^j_@SIM6@>2wzqf#K6@Ccp zxiC%L4c`lXAKEMaV9`aa*~7cPD=yy~UvWvAdJccVa%c$N{Vj0!_rv8o;&Xk}Wt+i# z_IR4YpS(oHmgMX6x zOkyPMy8fMAZLQ9MNpD|rWr2T*kMCr4$m7|!FIiW&YI)HTju7O)rACgN3cY>F_E2=m zJKr%Q^ZLeUG}N|<^LR<1J^J<~ocDQcl&^BOHAa`WIqx(r=cSr!8>4Ln+pb*VjZ_b@Exk*x2IBDS+r;Pu<_9|w4MgSED0tb2z^c^_WH`M2UxZ-Hw=mtKTh&|-m z?%w|1W4$o_j732A!QO)-2S*R8Lpg_hhw=}F4|N~vJv4CW#G#=>!-qx=slyqE^AGzE z2M%vI+;zD7aPQ&1!zT_89v(S7dN}8Z??~~HiX+WO!bf_J>^^er$iR`IBg02Bj(U&! zj~0<@!_n@eJC61p?LRtr^wiN&)_BzbV-M3u)$8lc@2%(!^oD!8dUyBs_73!(=pF7I z>GeL4^FYx9#Sb(*(EPxT2YMdpf8f{yrydx3K<&xclfTEmC$MM3o~}LJdwTcu?K!b$ zaL>q|(LFg2`W`HPu;Rhy2g48cJh=P8V-F5IIP~D~gBg3hd;NQh_HNkQu(x~fj=g<* z`}Yp+J+*gquiEF^m%p!KUtnK&U)R3f`+D~c>^reP_Mh56v|k;_IFNt9k8C#_=sM7?C4Az*;DM0?qX%;Oe0{}z6@ATp;l7@}-F?UU z29W)5U&ce;hx`u}J+$GWhKITz+VN1|L;Vj8K6L7#(TCK-zK8Q4u6Q``aQNY_hj%~R z`|!ZSCmtStc;sR4!JLCd2a69j9Be+g<6zIh{)5L3o;o;03uVwg{zHL78xD2pR_ddb z25Fwa9Bw`wKHPJ7_u*rQ2M!M%9zL9L#Cyblr0B?oBMnEokL)QY+Iw{1=!v7lM@OWM1{sHFBX4g`Z&7b?Z$oc$?~dLc z-7>xh@*nW)_Nkz4c0bUo+b4&1DcaMsXE&{KY|jAgGPGxymhtOWX`o%YAKdX^?}L4` z%L&~wYH!9~-`;%MrFrjeTIJN~v_yD+7cH?{x5dc* z(f!^7IR~0)gT4b9ecrwzB;VDyLrZ)_%REO*y;#e=SxderF8d)Z{fsx1zfZS7g>Hke fZiU@i{v!Kh$b9sWkN(hbc!!pDKhHb + + + + + Cython: cares.pyx + + + +

Generated by Cython 0.29.2

+

+ Yellow lines hint at Python interaction.
+ Click on a line that starts with a "+" to see the C code that Cython generated for it. +

+

Raw output: cares.c

+
 001: # Copyright (c) 2011-2012 Denis Bilenko. See LICENSE for details.
+
 002: # Automatic pickling of cdef classes was added in 0.26. Unfortunately it
+
 003: # seems to be buggy (at least for the `result` class) and produces code that
+
 004: # can't compile ("local variable 'result' referenced before assignment").
+
 005: # See https://github.com/cython/cython/issues/1786
+
 006: # cython: auto_pickle=False
+
 007: cimport libcares as cares
+
+008: import sys
+
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_sys, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 8, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_sys, __pyx_t_1) < 0) __PYX_ERR(0, 8, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 009: 
+
 010: from cpython.ref cimport Py_INCREF
+
 011: from cpython.ref cimport Py_DECREF
+
 012: from cpython.mem cimport PyMem_Malloc
+
 013: from cpython.mem cimport PyMem_Free
+
 014: 
+
+015: from _socket import gaierror
+
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 15, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(__pyx_n_s_gaierror);
+  __Pyx_GIVEREF(__pyx_n_s_gaierror);
+  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_gaierror);
+  __pyx_t_2 = __Pyx_Import(__pyx_n_s_socket, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 15, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_gaierror); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 15, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_gaierror, __pyx_t_1) < 0) __PYX_ERR(0, 15, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
 016: 
+
 017: 
+
+018: __all__ = ['channel']
+
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 18, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_channel);
+  __Pyx_GIVEREF(__pyx_n_s_channel);
+  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_channel);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_all, __pyx_t_2) < 0) __PYX_ERR(0, 18, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
 019: 
+
 020: cdef object string_types
+
 021: cdef object text_type
+
 022: 
+
+023: if sys.version_info[0] >= 3:
+
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_sys); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 23, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_version_info); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 23, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 23, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_int_3, Py_GE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 23, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 23, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  if (__pyx_t_3) {
+/* … */
+    goto __pyx_L2;
+  }
+
+024:     string_types = str,
+
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 24, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_INCREF(((PyObject *)(&PyString_Type)));
+    __Pyx_GIVEREF(((PyObject *)(&PyString_Type)));
+    PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)(&PyString_Type)));
+    __Pyx_XGOTREF(__pyx_v_6gevent_8resolver_5cares_string_types);
+    __Pyx_DECREF_SET(__pyx_v_6gevent_8resolver_5cares_string_types, __pyx_t_1);
+    __Pyx_GIVEREF(__pyx_t_1);
+    __pyx_t_1 = 0;
+
+025:     text_type = str
+
    __Pyx_INCREF(((PyObject *)(&PyString_Type)));
+    __Pyx_XGOTREF(__pyx_v_6gevent_8resolver_5cares_text_type);
+    __Pyx_DECREF_SET(__pyx_v_6gevent_8resolver_5cares_text_type, ((PyObject *)(&PyString_Type)));
+    __Pyx_GIVEREF(((PyObject *)(&PyString_Type)));
+
 026: else:
+
+027:     string_types = __builtins__.basestring,
+
  /*else*/ {
+    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_builtins); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 27, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_basestring); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 27, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 27, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_GIVEREF(__pyx_t_2);
+    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
+    __pyx_t_2 = 0;
+    __Pyx_XGOTREF(__pyx_v_6gevent_8resolver_5cares_string_types);
+    __Pyx_DECREF_SET(__pyx_v_6gevent_8resolver_5cares_string_types, __pyx_t_1);
+    __Pyx_GIVEREF(__pyx_t_1);
+    __pyx_t_1 = 0;
+
+028:     text_type = __builtins__.unicode
+
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_builtins); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 28, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 28, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __Pyx_XGOTREF(__pyx_v_6gevent_8resolver_5cares_text_type);
+    __Pyx_DECREF_SET(__pyx_v_6gevent_8resolver_5cares_text_type, __pyx_t_2);
+    __Pyx_GIVEREF(__pyx_t_2);
+    __pyx_t_2 = 0;
+  }
+  __pyx_L2:;
+
 029: 
+
+030: TIMEOUT = 1
+
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_TIMEOUT, __pyx_int_1) < 0) __PYX_ERR(0, 30, __pyx_L1_error)
+
 031: 
+
 032: DEF EV_READ = 1
+
 033: DEF EV_WRITE = 2
+
 034: 
+
 035: 
+
 036: cdef extern from "dnshelper.c":
+
 037:     int AF_INET
+
 038:     int AF_INET6
+
 039: 
+
 040:     struct hostent:
+
 041:         char* h_name
+
 042:         int h_addrtype
+
 043: 
+
 044:     struct sockaddr_t "sockaddr":
+
 045:         pass
+
 046: 
+
 047:     struct ares_channeldata:
+
 048:         pass
+
 049: 
+
 050:     object parse_h_name(hostent*)
+
 051:     object parse_h_aliases(hostent*)
+
 052:     object parse_h_addr_list(hostent*)
+
 053:     void* create_object_from_hostent(void*)
+
 054: 
+
 055:     # this imports _socket lazily
+
 056:     object PyUnicode_FromString(char*)
+
 057:     int PyTuple_Check(object)
+
 058:     int PyArg_ParseTuple(object, char*, ...) except 0
+
 059:     struct sockaddr_in6:
+
 060:         pass
+
 061:     int gevent_make_sockaddr(char* hostp, int port, int flowinfo, int scope_id, sockaddr_in6* sa6)
+
 062: 
+
 063: 
+
 064:     void memset(void*, int, int)
+
 065: 
+
 066: 
+
+067: ARES_SUCCESS = cares.ARES_SUCCESS
+
  __pyx_t_2 = __Pyx_PyInt_From_int(ARES_SUCCESS); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 67, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARES_SUCCESS, __pyx_t_2) < 0) __PYX_ERR(0, 67, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+068: ARES_ENODATA = cares.ARES_ENODATA
+
  __pyx_t_2 = __Pyx_PyInt_From_int(ARES_ENODATA); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 68, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARES_ENODATA, __pyx_t_2) < 0) __PYX_ERR(0, 68, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+069: ARES_EFORMERR = cares.ARES_EFORMERR
+
  __pyx_t_2 = __Pyx_PyInt_From_int(ARES_EFORMERR); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 69, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARES_EFORMERR, __pyx_t_2) < 0) __PYX_ERR(0, 69, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+070: ARES_ESERVFAIL = cares.ARES_ESERVFAIL
+
  __pyx_t_2 = __Pyx_PyInt_From_int(ARES_ESERVFAIL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 70, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARES_ESERVFAIL, __pyx_t_2) < 0) __PYX_ERR(0, 70, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+071: ARES_ENOTFOUND = cares.ARES_ENOTFOUND
+
  __pyx_t_2 = __Pyx_PyInt_From_int(ARES_ENOTFOUND); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 71, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARES_ENOTFOUND, __pyx_t_2) < 0) __PYX_ERR(0, 71, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+072: ARES_ENOTIMP = cares.ARES_ENOTIMP
+
  __pyx_t_2 = __Pyx_PyInt_From_int(ARES_ENOTIMP); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 72, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARES_ENOTIMP, __pyx_t_2) < 0) __PYX_ERR(0, 72, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+073: ARES_EREFUSED = cares.ARES_EREFUSED
+
  __pyx_t_2 = __Pyx_PyInt_From_int(ARES_EREFUSED); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 73, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARES_EREFUSED, __pyx_t_2) < 0) __PYX_ERR(0, 73, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+074: ARES_EBADQUERY = cares.ARES_EBADQUERY
+
  __pyx_t_2 = __Pyx_PyInt_From_int(ARES_EBADQUERY); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 74, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARES_EBADQUERY, __pyx_t_2) < 0) __PYX_ERR(0, 74, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+075: ARES_EBADNAME = cares.ARES_EBADNAME
+
  __pyx_t_2 = __Pyx_PyInt_From_int(ARES_EBADNAME); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 75, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARES_EBADNAME, __pyx_t_2) < 0) __PYX_ERR(0, 75, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+076: ARES_EBADFAMILY = cares.ARES_EBADFAMILY
+
  __pyx_t_2 = __Pyx_PyInt_From_int(ARES_EBADFAMILY); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 76, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARES_EBADFAMILY, __pyx_t_2) < 0) __PYX_ERR(0, 76, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+077: ARES_EBADRESP = cares.ARES_EBADRESP
+
  __pyx_t_2 = __Pyx_PyInt_From_int(ARES_EBADRESP); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 77, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARES_EBADRESP, __pyx_t_2) < 0) __PYX_ERR(0, 77, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+078: ARES_ECONNREFUSED = cares.ARES_ECONNREFUSED
+
  __pyx_t_2 = __Pyx_PyInt_From_int(ARES_ECONNREFUSED); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 78, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARES_ECONNREFUSED, __pyx_t_2) < 0) __PYX_ERR(0, 78, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+079: ARES_ETIMEOUT = cares.ARES_ETIMEOUT
+
  __pyx_t_2 = __Pyx_PyInt_From_int(ARES_ETIMEOUT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 79, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARES_ETIMEOUT, __pyx_t_2) < 0) __PYX_ERR(0, 79, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+080: ARES_EOF = cares.ARES_EOF
+
  __pyx_t_2 = __Pyx_PyInt_From_int(ARES_EOF); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 80, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARES_EOF, __pyx_t_2) < 0) __PYX_ERR(0, 80, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+081: ARES_EFILE = cares.ARES_EFILE
+
  __pyx_t_2 = __Pyx_PyInt_From_int(ARES_EFILE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 81, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARES_EFILE, __pyx_t_2) < 0) __PYX_ERR(0, 81, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+082: ARES_ENOMEM = cares.ARES_ENOMEM
+
  __pyx_t_2 = __Pyx_PyInt_From_int(ARES_ENOMEM); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 82, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARES_ENOMEM, __pyx_t_2) < 0) __PYX_ERR(0, 82, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+083: ARES_EDESTRUCTION = cares.ARES_EDESTRUCTION
+
  __pyx_t_2 = __Pyx_PyInt_From_int(ARES_EDESTRUCTION); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 83, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARES_EDESTRUCTION, __pyx_t_2) < 0) __PYX_ERR(0, 83, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+084: ARES_EBADSTR = cares.ARES_EBADSTR
+
  __pyx_t_2 = __Pyx_PyInt_From_int(ARES_EBADSTR); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 84, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARES_EBADSTR, __pyx_t_2) < 0) __PYX_ERR(0, 84, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+085: ARES_EBADFLAGS = cares.ARES_EBADFLAGS
+
  __pyx_t_2 = __Pyx_PyInt_From_int(ARES_EBADFLAGS); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 85, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARES_EBADFLAGS, __pyx_t_2) < 0) __PYX_ERR(0, 85, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+086: ARES_ENONAME = cares.ARES_ENONAME
+
  __pyx_t_2 = __Pyx_PyInt_From_int(ARES_ENONAME); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 86, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARES_ENONAME, __pyx_t_2) < 0) __PYX_ERR(0, 86, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+087: ARES_EBADHINTS = cares.ARES_EBADHINTS
+
  __pyx_t_2 = __Pyx_PyInt_From_int(ARES_EBADHINTS); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 87, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARES_EBADHINTS, __pyx_t_2) < 0) __PYX_ERR(0, 87, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+088: ARES_ENOTINITIALIZED = cares.ARES_ENOTINITIALIZED
+
  __pyx_t_2 = __Pyx_PyInt_From_int(ARES_ENOTINITIALIZED); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 88, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARES_ENOTINITIALIZED, __pyx_t_2) < 0) __PYX_ERR(0, 88, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+089: ARES_ELOADIPHLPAPI = cares.ARES_ELOADIPHLPAPI
+
  __pyx_t_2 = __Pyx_PyInt_From_int(ARES_ELOADIPHLPAPI); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 89, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARES_ELOADIPHLPAPI, __pyx_t_2) < 0) __PYX_ERR(0, 89, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+090: ARES_EADDRGETNETWORKPARAMS = cares.ARES_EADDRGETNETWORKPARAMS
+
  __pyx_t_2 = __Pyx_PyInt_From_int(ARES_EADDRGETNETWORKPARAMS); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 90, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARES_EADDRGETNETWORKPARAMS, __pyx_t_2) < 0) __PYX_ERR(0, 90, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+091: ARES_ECANCELLED = cares.ARES_ECANCELLED
+
  __pyx_t_2 = __Pyx_PyInt_From_int(ARES_ECANCELLED); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 91, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARES_ECANCELLED, __pyx_t_2) < 0) __PYX_ERR(0, 91, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
 092: 
+
+093: ARES_FLAG_USEVC = cares.ARES_FLAG_USEVC
+
  __pyx_t_2 = __Pyx_PyInt_From_int(ARES_FLAG_USEVC); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 93, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARES_FLAG_USEVC, __pyx_t_2) < 0) __PYX_ERR(0, 93, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+094: ARES_FLAG_PRIMARY = cares.ARES_FLAG_PRIMARY
+
  __pyx_t_2 = __Pyx_PyInt_From_int(ARES_FLAG_PRIMARY); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 94, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARES_FLAG_PRIMARY, __pyx_t_2) < 0) __PYX_ERR(0, 94, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+095: ARES_FLAG_IGNTC = cares.ARES_FLAG_IGNTC
+
  __pyx_t_2 = __Pyx_PyInt_From_int(ARES_FLAG_IGNTC); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 95, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARES_FLAG_IGNTC, __pyx_t_2) < 0) __PYX_ERR(0, 95, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+096: ARES_FLAG_NORECURSE = cares.ARES_FLAG_NORECURSE
+
  __pyx_t_2 = __Pyx_PyInt_From_int(ARES_FLAG_NORECURSE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 96, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARES_FLAG_NORECURSE, __pyx_t_2) < 0) __PYX_ERR(0, 96, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+097: ARES_FLAG_STAYOPEN = cares.ARES_FLAG_STAYOPEN
+
  __pyx_t_2 = __Pyx_PyInt_From_int(ARES_FLAG_STAYOPEN); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 97, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARES_FLAG_STAYOPEN, __pyx_t_2) < 0) __PYX_ERR(0, 97, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+098: ARES_FLAG_NOSEARCH = cares.ARES_FLAG_NOSEARCH
+
  __pyx_t_2 = __Pyx_PyInt_From_int(ARES_FLAG_NOSEARCH); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 98, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARES_FLAG_NOSEARCH, __pyx_t_2) < 0) __PYX_ERR(0, 98, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+099: ARES_FLAG_NOALIASES = cares.ARES_FLAG_NOALIASES
+
  __pyx_t_2 = __Pyx_PyInt_From_int(ARES_FLAG_NOALIASES); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 99, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARES_FLAG_NOALIASES, __pyx_t_2) < 0) __PYX_ERR(0, 99, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+100: ARES_FLAG_NOCHECKRESP = cares.ARES_FLAG_NOCHECKRESP
+
  __pyx_t_2 = __Pyx_PyInt_From_int(ARES_FLAG_NOCHECKRESP); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 100, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARES_FLAG_NOCHECKRESP, __pyx_t_2) < 0) __PYX_ERR(0, 100, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
 101: 
+
 102: 
+
+103: _ares_errors = dict([
+
  __pyx_t_2 = PyList_New(25); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 103, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_GIVEREF(__pyx_t_1);
+  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_4);
+  PyList_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
+  __Pyx_GIVEREF(__pyx_t_5);
+  PyList_SET_ITEM(__pyx_t_2, 2, __pyx_t_5);
+  __Pyx_GIVEREF(__pyx_t_6);
+  PyList_SET_ITEM(__pyx_t_2, 3, __pyx_t_6);
+  __Pyx_GIVEREF(__pyx_t_7);
+  PyList_SET_ITEM(__pyx_t_2, 4, __pyx_t_7);
+  __Pyx_GIVEREF(__pyx_t_8);
+  PyList_SET_ITEM(__pyx_t_2, 5, __pyx_t_8);
+  __Pyx_GIVEREF(__pyx_t_9);
+  PyList_SET_ITEM(__pyx_t_2, 6, __pyx_t_9);
+  __Pyx_GIVEREF(__pyx_t_10);
+  PyList_SET_ITEM(__pyx_t_2, 7, __pyx_t_10);
+  __Pyx_GIVEREF(__pyx_t_11);
+  PyList_SET_ITEM(__pyx_t_2, 8, __pyx_t_11);
+  __Pyx_GIVEREF(__pyx_t_12);
+  PyList_SET_ITEM(__pyx_t_2, 9, __pyx_t_12);
+  __Pyx_GIVEREF(__pyx_t_13);
+  PyList_SET_ITEM(__pyx_t_2, 10, __pyx_t_13);
+  __Pyx_GIVEREF(__pyx_t_14);
+  PyList_SET_ITEM(__pyx_t_2, 11, __pyx_t_14);
+  __Pyx_GIVEREF(__pyx_t_15);
+  PyList_SET_ITEM(__pyx_t_2, 12, __pyx_t_15);
+  __Pyx_GIVEREF(__pyx_t_16);
+  PyList_SET_ITEM(__pyx_t_2, 13, __pyx_t_16);
+  __Pyx_GIVEREF(__pyx_t_17);
+  PyList_SET_ITEM(__pyx_t_2, 14, __pyx_t_17);
+  __Pyx_GIVEREF(__pyx_t_18);
+  PyList_SET_ITEM(__pyx_t_2, 15, __pyx_t_18);
+  __Pyx_GIVEREF(__pyx_t_19);
+  PyList_SET_ITEM(__pyx_t_2, 16, __pyx_t_19);
+  __Pyx_GIVEREF(__pyx_t_20);
+  PyList_SET_ITEM(__pyx_t_2, 17, __pyx_t_20);
+  __Pyx_GIVEREF(__pyx_t_21);
+  PyList_SET_ITEM(__pyx_t_2, 18, __pyx_t_21);
+  __Pyx_GIVEREF(__pyx_t_22);
+  PyList_SET_ITEM(__pyx_t_2, 19, __pyx_t_22);
+  __Pyx_GIVEREF(__pyx_t_23);
+  PyList_SET_ITEM(__pyx_t_2, 20, __pyx_t_23);
+  __Pyx_GIVEREF(__pyx_t_24);
+  PyList_SET_ITEM(__pyx_t_2, 21, __pyx_t_24);
+  __Pyx_GIVEREF(__pyx_t_25);
+  PyList_SET_ITEM(__pyx_t_2, 22, __pyx_t_25);
+  __Pyx_GIVEREF(__pyx_t_26);
+  PyList_SET_ITEM(__pyx_t_2, 23, __pyx_t_26);
+  __Pyx_GIVEREF(__pyx_t_27);
+  PyList_SET_ITEM(__pyx_t_2, 24, __pyx_t_27);
+  __pyx_t_1 = 0;
+  __pyx_t_4 = 0;
+  __pyx_t_5 = 0;
+  __pyx_t_6 = 0;
+  __pyx_t_7 = 0;
+  __pyx_t_8 = 0;
+  __pyx_t_9 = 0;
+  __pyx_t_10 = 0;
+  __pyx_t_11 = 0;
+  __pyx_t_12 = 0;
+  __pyx_t_13 = 0;
+  __pyx_t_14 = 0;
+  __pyx_t_15 = 0;
+  __pyx_t_16 = 0;
+  __pyx_t_17 = 0;
+  __pyx_t_18 = 0;
+  __pyx_t_19 = 0;
+  __pyx_t_20 = 0;
+  __pyx_t_21 = 0;
+  __pyx_t_22 = 0;
+  __pyx_t_23 = 0;
+  __pyx_t_24 = 0;
+  __pyx_t_25 = 0;
+  __pyx_t_26 = 0;
+  __pyx_t_27 = 0;
+  __pyx_t_27 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyDict_Type)), __pyx_t_2); if (unlikely(!__pyx_t_27)) __PYX_ERR(0, 103, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_27);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ares_errors, __pyx_t_27) < 0) __PYX_ERR(0, 103, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0;
+
+104:                 (cares.ARES_SUCCESS, 'ARES_SUCCESS'),
+
  __pyx_t_2 = __Pyx_PyInt_From_int(ARES_SUCCESS); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 104, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 104, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_2);
+  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_ARES_SUCCESS);
+  __Pyx_GIVEREF(__pyx_n_s_ARES_SUCCESS);
+  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_ARES_SUCCESS);
+  __pyx_t_2 = 0;
+
+105:                 (cares.ARES_ENODATA, 'ARES_ENODATA'),
+
  __pyx_t_2 = __Pyx_PyInt_From_int(ARES_ENODATA); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 105, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 105, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_4);
+  __Pyx_GIVEREF(__pyx_t_2);
+  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_ARES_ENODATA);
+  __Pyx_GIVEREF(__pyx_n_s_ARES_ENODATA);
+  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_n_s_ARES_ENODATA);
+  __pyx_t_2 = 0;
+
+106:                 (cares.ARES_EFORMERR, 'ARES_EFORMERR'),
+
  __pyx_t_2 = __Pyx_PyInt_From_int(ARES_EFORMERR); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 106, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 106, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_5);
+  __Pyx_GIVEREF(__pyx_t_2);
+  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_ARES_EFORMERR);
+  __Pyx_GIVEREF(__pyx_n_s_ARES_EFORMERR);
+  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_n_s_ARES_EFORMERR);
+  __pyx_t_2 = 0;
+
+107:                 (cares.ARES_ESERVFAIL, 'ARES_ESERVFAIL'),
+
  __pyx_t_2 = __Pyx_PyInt_From_int(ARES_ESERVFAIL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 107, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 107, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  __Pyx_GIVEREF(__pyx_t_2);
+  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_ARES_ESERVFAIL);
+  __Pyx_GIVEREF(__pyx_n_s_ARES_ESERVFAIL);
+  PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_n_s_ARES_ESERVFAIL);
+  __pyx_t_2 = 0;
+
+108:                 (cares.ARES_ENOTFOUND, 'ARES_ENOTFOUND'),
+
  __pyx_t_2 = __Pyx_PyInt_From_int(ARES_ENOTFOUND); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 108, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 108, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_7);
+  __Pyx_GIVEREF(__pyx_t_2);
+  PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_ARES_ENOTFOUND);
+  __Pyx_GIVEREF(__pyx_n_s_ARES_ENOTFOUND);
+  PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_n_s_ARES_ENOTFOUND);
+  __pyx_t_2 = 0;
+
+109:                 (cares.ARES_ENOTIMP, 'ARES_ENOTIMP'),
+
  __pyx_t_2 = __Pyx_PyInt_From_int(ARES_ENOTIMP); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 109, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 109, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_8);
+  __Pyx_GIVEREF(__pyx_t_2);
+  PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_ARES_ENOTIMP);
+  __Pyx_GIVEREF(__pyx_n_s_ARES_ENOTIMP);
+  PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_n_s_ARES_ENOTIMP);
+  __pyx_t_2 = 0;
+
+110:                 (cares.ARES_EREFUSED, 'ARES_EREFUSED'),
+
  __pyx_t_2 = __Pyx_PyInt_From_int(ARES_EREFUSED); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 110, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 110, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_9);
+  __Pyx_GIVEREF(__pyx_t_2);
+  PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_ARES_EREFUSED);
+  __Pyx_GIVEREF(__pyx_n_s_ARES_EREFUSED);
+  PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_n_s_ARES_EREFUSED);
+  __pyx_t_2 = 0;
+
+111:                 (cares.ARES_EBADQUERY, 'ARES_EBADQUERY'),
+
  __pyx_t_2 = __Pyx_PyInt_From_int(ARES_EBADQUERY); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 111, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 111, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_10);
+  __Pyx_GIVEREF(__pyx_t_2);
+  PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_ARES_EBADQUERY);
+  __Pyx_GIVEREF(__pyx_n_s_ARES_EBADQUERY);
+  PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_n_s_ARES_EBADQUERY);
+  __pyx_t_2 = 0;
+
+112:                 (cares.ARES_EBADNAME, 'ARES_EBADNAME'),
+
  __pyx_t_2 = __Pyx_PyInt_From_int(ARES_EBADNAME); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 112, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 112, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_11);
+  __Pyx_GIVEREF(__pyx_t_2);
+  PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_ARES_EBADNAME);
+  __Pyx_GIVEREF(__pyx_n_s_ARES_EBADNAME);
+  PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_n_s_ARES_EBADNAME);
+  __pyx_t_2 = 0;
+
+113:                 (cares.ARES_EBADFAMILY, 'ARES_EBADFAMILY'),
+
  __pyx_t_2 = __Pyx_PyInt_From_int(ARES_EBADFAMILY); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 113, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 113, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_12);
+  __Pyx_GIVEREF(__pyx_t_2);
+  PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_ARES_EBADFAMILY);
+  __Pyx_GIVEREF(__pyx_n_s_ARES_EBADFAMILY);
+  PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_n_s_ARES_EBADFAMILY);
+  __pyx_t_2 = 0;
+
+114:                 (cares.ARES_EBADRESP, 'ARES_EBADRESP'),
+
  __pyx_t_2 = __Pyx_PyInt_From_int(ARES_EBADRESP); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 114, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_13 = PyTuple_New(2); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 114, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_13);
+  __Pyx_GIVEREF(__pyx_t_2);
+  PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_ARES_EBADRESP);
+  __Pyx_GIVEREF(__pyx_n_s_ARES_EBADRESP);
+  PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_n_s_ARES_EBADRESP);
+  __pyx_t_2 = 0;
+
+115:                 (cares.ARES_ECONNREFUSED, 'ARES_ECONNREFUSED'),
+
  __pyx_t_2 = __Pyx_PyInt_From_int(ARES_ECONNREFUSED); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 115, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_14 = PyTuple_New(2); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 115, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_14);
+  __Pyx_GIVEREF(__pyx_t_2);
+  PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_ARES_ECONNREFUSED);
+  __Pyx_GIVEREF(__pyx_n_s_ARES_ECONNREFUSED);
+  PyTuple_SET_ITEM(__pyx_t_14, 1, __pyx_n_s_ARES_ECONNREFUSED);
+  __pyx_t_2 = 0;
+
+116:                 (cares.ARES_ETIMEOUT, 'ARES_ETIMEOUT'),
+
  __pyx_t_2 = __Pyx_PyInt_From_int(ARES_ETIMEOUT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 116, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_15 = PyTuple_New(2); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 116, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_15);
+  __Pyx_GIVEREF(__pyx_t_2);
+  PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_ARES_ETIMEOUT);
+  __Pyx_GIVEREF(__pyx_n_s_ARES_ETIMEOUT);
+  PyTuple_SET_ITEM(__pyx_t_15, 1, __pyx_n_s_ARES_ETIMEOUT);
+  __pyx_t_2 = 0;
+
+117:                 (cares.ARES_EOF, 'ARES_EOF'),
+
  __pyx_t_2 = __Pyx_PyInt_From_int(ARES_EOF); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 117, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_16 = PyTuple_New(2); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 117, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_16);
+  __Pyx_GIVEREF(__pyx_t_2);
+  PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_ARES_EOF);
+  __Pyx_GIVEREF(__pyx_n_s_ARES_EOF);
+  PyTuple_SET_ITEM(__pyx_t_16, 1, __pyx_n_s_ARES_EOF);
+  __pyx_t_2 = 0;
+
+118:                 (cares.ARES_EFILE, 'ARES_EFILE'),
+
  __pyx_t_2 = __Pyx_PyInt_From_int(ARES_EFILE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 118, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_17 = PyTuple_New(2); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 118, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_17);
+  __Pyx_GIVEREF(__pyx_t_2);
+  PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_ARES_EFILE);
+  __Pyx_GIVEREF(__pyx_n_s_ARES_EFILE);
+  PyTuple_SET_ITEM(__pyx_t_17, 1, __pyx_n_s_ARES_EFILE);
+  __pyx_t_2 = 0;
+
+119:                 (cares.ARES_ENOMEM, 'ARES_ENOMEM'),
+
  __pyx_t_2 = __Pyx_PyInt_From_int(ARES_ENOMEM); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 119, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_18 = PyTuple_New(2); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 119, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_18);
+  __Pyx_GIVEREF(__pyx_t_2);
+  PyTuple_SET_ITEM(__pyx_t_18, 0, __pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_ARES_ENOMEM);
+  __Pyx_GIVEREF(__pyx_n_s_ARES_ENOMEM);
+  PyTuple_SET_ITEM(__pyx_t_18, 1, __pyx_n_s_ARES_ENOMEM);
+  __pyx_t_2 = 0;
+
+120:                 (cares.ARES_EDESTRUCTION, 'ARES_EDESTRUCTION'),
+
  __pyx_t_2 = __Pyx_PyInt_From_int(ARES_EDESTRUCTION); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 120, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_19 = PyTuple_New(2); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 120, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_19);
+  __Pyx_GIVEREF(__pyx_t_2);
+  PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_ARES_EDESTRUCTION);
+  __Pyx_GIVEREF(__pyx_n_s_ARES_EDESTRUCTION);
+  PyTuple_SET_ITEM(__pyx_t_19, 1, __pyx_n_s_ARES_EDESTRUCTION);
+  __pyx_t_2 = 0;
+
+121:                 (cares.ARES_EBADSTR, 'ARES_EBADSTR'),
+
  __pyx_t_2 = __Pyx_PyInt_From_int(ARES_EBADSTR); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 121, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_20 = PyTuple_New(2); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 121, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_20);
+  __Pyx_GIVEREF(__pyx_t_2);
+  PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_ARES_EBADSTR);
+  __Pyx_GIVEREF(__pyx_n_s_ARES_EBADSTR);
+  PyTuple_SET_ITEM(__pyx_t_20, 1, __pyx_n_s_ARES_EBADSTR);
+  __pyx_t_2 = 0;
+
+122:                 (cares.ARES_EBADFLAGS, 'ARES_EBADFLAGS'),
+
  __pyx_t_2 = __Pyx_PyInt_From_int(ARES_EBADFLAGS); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 122, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_21 = PyTuple_New(2); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 122, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_21);
+  __Pyx_GIVEREF(__pyx_t_2);
+  PyTuple_SET_ITEM(__pyx_t_21, 0, __pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_ARES_EBADFLAGS);
+  __Pyx_GIVEREF(__pyx_n_s_ARES_EBADFLAGS);
+  PyTuple_SET_ITEM(__pyx_t_21, 1, __pyx_n_s_ARES_EBADFLAGS);
+  __pyx_t_2 = 0;
+
+123:                 (cares.ARES_ENONAME, 'ARES_ENONAME'),
+
  __pyx_t_2 = __Pyx_PyInt_From_int(ARES_ENONAME); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 123, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_22 = PyTuple_New(2); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 123, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_22);
+  __Pyx_GIVEREF(__pyx_t_2);
+  PyTuple_SET_ITEM(__pyx_t_22, 0, __pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_ARES_ENONAME);
+  __Pyx_GIVEREF(__pyx_n_s_ARES_ENONAME);
+  PyTuple_SET_ITEM(__pyx_t_22, 1, __pyx_n_s_ARES_ENONAME);
+  __pyx_t_2 = 0;
+
+124:                 (cares.ARES_EBADHINTS, 'ARES_EBADHINTS'),
+
  __pyx_t_2 = __Pyx_PyInt_From_int(ARES_EBADHINTS); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 124, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_23 = PyTuple_New(2); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 124, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_23);
+  __Pyx_GIVEREF(__pyx_t_2);
+  PyTuple_SET_ITEM(__pyx_t_23, 0, __pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_ARES_EBADHINTS);
+  __Pyx_GIVEREF(__pyx_n_s_ARES_EBADHINTS);
+  PyTuple_SET_ITEM(__pyx_t_23, 1, __pyx_n_s_ARES_EBADHINTS);
+  __pyx_t_2 = 0;
+
+125:                 (cares.ARES_ENOTINITIALIZED, 'ARES_ENOTINITIALIZED'),
+
  __pyx_t_2 = __Pyx_PyInt_From_int(ARES_ENOTINITIALIZED); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 125, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_24 = PyTuple_New(2); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 125, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_24);
+  __Pyx_GIVEREF(__pyx_t_2);
+  PyTuple_SET_ITEM(__pyx_t_24, 0, __pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_ARES_ENOTINITIALIZED);
+  __Pyx_GIVEREF(__pyx_n_s_ARES_ENOTINITIALIZED);
+  PyTuple_SET_ITEM(__pyx_t_24, 1, __pyx_n_s_ARES_ENOTINITIALIZED);
+  __pyx_t_2 = 0;
+
+126:                 (cares.ARES_ELOADIPHLPAPI, 'ARES_ELOADIPHLPAPI'),
+
  __pyx_t_2 = __Pyx_PyInt_From_int(ARES_ELOADIPHLPAPI); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 126, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_25 = PyTuple_New(2); if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 126, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_25);
+  __Pyx_GIVEREF(__pyx_t_2);
+  PyTuple_SET_ITEM(__pyx_t_25, 0, __pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_ARES_ELOADIPHLPAPI);
+  __Pyx_GIVEREF(__pyx_n_s_ARES_ELOADIPHLPAPI);
+  PyTuple_SET_ITEM(__pyx_t_25, 1, __pyx_n_s_ARES_ELOADIPHLPAPI);
+  __pyx_t_2 = 0;
+
+127:                 (cares.ARES_EADDRGETNETWORKPARAMS, 'ARES_EADDRGETNETWORKPARAMS'),
+
  __pyx_t_2 = __Pyx_PyInt_From_int(ARES_EADDRGETNETWORKPARAMS); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 127, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_26 = PyTuple_New(2); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 127, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_26);
+  __Pyx_GIVEREF(__pyx_t_2);
+  PyTuple_SET_ITEM(__pyx_t_26, 0, __pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_ARES_EADDRGETNETWORKPARAMS);
+  __Pyx_GIVEREF(__pyx_n_s_ARES_EADDRGETNETWORKPARAMS);
+  PyTuple_SET_ITEM(__pyx_t_26, 1, __pyx_n_s_ARES_EADDRGETNETWORKPARAMS);
+  __pyx_t_2 = 0;
+
+128:                 (cares.ARES_ECANCELLED, 'ARES_ECANCELLED')])
+
  __pyx_t_2 = __Pyx_PyInt_From_int(ARES_ECANCELLED); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 128, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_27 = PyTuple_New(2); if (unlikely(!__pyx_t_27)) __PYX_ERR(0, 128, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_27);
+  __Pyx_GIVEREF(__pyx_t_2);
+  PyTuple_SET_ITEM(__pyx_t_27, 0, __pyx_t_2);
+  __Pyx_INCREF(__pyx_n_s_ARES_ECANCELLED);
+  __Pyx_GIVEREF(__pyx_n_s_ARES_ECANCELLED);
+  PyTuple_SET_ITEM(__pyx_t_27, 1, __pyx_n_s_ARES_ECANCELLED);
+  __pyx_t_2 = 0;
+
 129: 
+
 130: 
+
 131: # maps c-ares flag to _socket module flag
+
+132: _cares_flag_map = None
+
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_cares_flag_map, Py_None) < 0) __PYX_ERR(0, 132, __pyx_L1_error)
+
 133: 
+
 134: 
+
+135: cdef _prepare_cares_flag_map():
+
static PyObject *__pyx_f_6gevent_8resolver_5cares__prepare_cares_flag_map(void) {
+  PyObject *__pyx_v__socket = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_prepare_cares_flag_map", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_XDECREF(__pyx_t_6);
+  __Pyx_XDECREF(__pyx_t_7);
+  __Pyx_AddTraceback("gevent.resolver.cares._prepare_cares_flag_map", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v__socket);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
 136:     global _cares_flag_map
+
+137:     import _socket
+
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_socket, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 137, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_v__socket = __pyx_t_1;
+  __pyx_t_1 = 0;
+
+138:     _cares_flag_map = [
+
  __pyx_t_2 = PyList_New(5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 138, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_GIVEREF(__pyx_t_3);
+  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
+  __Pyx_GIVEREF(__pyx_t_4);
+  PyList_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
+  __Pyx_GIVEREF(__pyx_t_5);
+  PyList_SET_ITEM(__pyx_t_2, 2, __pyx_t_5);
+  __Pyx_GIVEREF(__pyx_t_6);
+  PyList_SET_ITEM(__pyx_t_2, 3, __pyx_t_6);
+  __Pyx_GIVEREF(__pyx_t_7);
+  PyList_SET_ITEM(__pyx_t_2, 4, __pyx_t_7);
+  __pyx_t_3 = 0;
+  __pyx_t_4 = 0;
+  __pyx_t_5 = 0;
+  __pyx_t_6 = 0;
+  __pyx_t_7 = 0;
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_cares_flag_map, __pyx_t_2) < 0) __PYX_ERR(0, 138, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+139:         (getattr(_socket, 'NI_NUMERICHOST', 1), cares.ARES_NI_NUMERICHOST),
+
  __pyx_t_1 = __Pyx_GetAttr3(__pyx_v__socket, __pyx_n_s_NI_NUMERICHOST, __pyx_int_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 139, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = __Pyx_PyInt_From_int(ARES_NI_NUMERICHOST); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 139, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 139, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_GIVEREF(__pyx_t_1);
+  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_2);
+  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
+  __pyx_t_1 = 0;
+  __pyx_t_2 = 0;
+
+140:         (getattr(_socket, 'NI_NUMERICSERV', 2), cares.ARES_NI_NUMERICSERV),
+
  __pyx_t_2 = __Pyx_GetAttr3(__pyx_v__socket, __pyx_n_s_NI_NUMERICSERV, __pyx_int_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 140, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_1 = __Pyx_PyInt_From_int(ARES_NI_NUMERICSERV); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 140, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 140, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_4);
+  __Pyx_GIVEREF(__pyx_t_2);
+  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
+  __Pyx_GIVEREF(__pyx_t_1);
+  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
+  __pyx_t_2 = 0;
+  __pyx_t_1 = 0;
+
+141:         (getattr(_socket, 'NI_NOFQDN', 4), cares.ARES_NI_NOFQDN),
+
  __pyx_t_1 = __Pyx_GetAttr3(__pyx_v__socket, __pyx_n_s_NI_NOFQDN, __pyx_int_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 141, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = __Pyx_PyInt_From_int(ARES_NI_NOFQDN); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 141, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 141, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_5);
+  __Pyx_GIVEREF(__pyx_t_1);
+  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_2);
+  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
+  __pyx_t_1 = 0;
+  __pyx_t_2 = 0;
+
+142:         (getattr(_socket, 'NI_NAMEREQD', 8), cares.ARES_NI_NAMEREQD),
+
  __pyx_t_2 = __Pyx_GetAttr3(__pyx_v__socket, __pyx_n_s_NI_NAMEREQD, __pyx_int_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 142, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_1 = __Pyx_PyInt_From_int(ARES_NI_NAMEREQD); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 142, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 142, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  __Pyx_GIVEREF(__pyx_t_2);
+  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2);
+  __Pyx_GIVEREF(__pyx_t_1);
+  PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_1);
+  __pyx_t_2 = 0;
+  __pyx_t_1 = 0;
+
+143:         (getattr(_socket, 'NI_DGRAM', 16), cares.ARES_NI_DGRAM)]
+
  __pyx_t_1 = __Pyx_GetAttr3(__pyx_v__socket, __pyx_n_s_NI_DGRAM, __pyx_int_16); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 143, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = __Pyx_PyInt_From_int(ARES_NI_DGRAM); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 143, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 143, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_7);
+  __Pyx_GIVEREF(__pyx_t_1);
+  PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_2);
+  PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_2);
+  __pyx_t_1 = 0;
+  __pyx_t_2 = 0;
+
 144: 
+
 145: 
+
+146: cpdef _convert_cares_flags(int flags, int default=cares.ARES_NI_LOOKUPHOST|cares.ARES_NI_LOOKUPSERVICE):
+
static PyObject *__pyx_pw_6gevent_8resolver_5cares_1_convert_cares_flags(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_f_6gevent_8resolver_5cares__convert_cares_flags(int __pyx_v_flags, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_8resolver_5cares__convert_cares_flags *__pyx_optional_args) {
+  int __pyx_v_default = __pyx_k_;
+  PyObject *__pyx_v_socket_flag = NULL;
+  PyObject *__pyx_v_cares_flag = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_convert_cares_flags", 0);
+  if (__pyx_optional_args) {
+    if (__pyx_optional_args->__pyx_n > 0) {
+      __pyx_v_default = __pyx_optional_args->__pyx_default;
+    }
+  }
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_7);
+  __Pyx_XDECREF(__pyx_t_8);
+  __Pyx_XDECREF(__pyx_t_9);
+  __Pyx_AddTraceback("gevent.resolver.cares._convert_cares_flags", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_socket_flag);
+  __Pyx_XDECREF(__pyx_v_cares_flag);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_8resolver_5cares_1_convert_cares_flags(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_pw_6gevent_8resolver_5cares_1_convert_cares_flags(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  int __pyx_v_flags;
+  int __pyx_v_default;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_convert_cares_flags (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_flags,&__pyx_n_s_default,0};
+    PyObject* values[2] = {0,0};
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flags)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_default);
+          if (value) { values[1] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_convert_cares_flags") < 0)) __PYX_ERR(0, 146, __pyx_L3_error)
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    __pyx_v_flags = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 146, __pyx_L3_error)
+    if (values[1]) {
+      __pyx_v_default = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_default == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 146, __pyx_L3_error)
+    } else {
+      __pyx_v_default = __pyx_k_;
+    }
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("_convert_cares_flags", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 146, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.resolver.cares._convert_cares_flags", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_8resolver_5cares__convert_cares_flags(__pyx_self, __pyx_v_flags, __pyx_v_default);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_8resolver_5cares__convert_cares_flags(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_flags, int __pyx_v_default) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_convert_cares_flags", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_2.__pyx_n = 1;
+  __pyx_t_2.__pyx_default = __pyx_v_default;
+  __pyx_t_1 = __pyx_f_6gevent_8resolver_5cares__convert_cares_flags(__pyx_v_flags, 0, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 146, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.resolver.cares._convert_cares_flags", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_k_ = (ARES_NI_LOOKUPHOST | ARES_NI_LOOKUPSERVICE);
+  __pyx_k_ = (ARES_NI_LOOKUPHOST | ARES_NI_LOOKUPSERVICE);
+/* … */
+struct __pyx_opt_args_6gevent_8resolver_5cares__convert_cares_flags {
+  int __pyx_n;
+  int __pyx_default;
+};
+
+147:     if _cares_flag_map is None:
+
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_cares_flag_map); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 147, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = (__pyx_t_1 == Py_None);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_3 = (__pyx_t_2 != 0);
+  if (__pyx_t_3) {
+/* … */
+  }
+
+148:         _prepare_cares_flag_map()
+
    __pyx_t_1 = __pyx_f_6gevent_8resolver_5cares__prepare_cares_flag_map(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 148, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+149:     for socket_flag, cares_flag in _cares_flag_map:
+
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_cares_flag_map); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 149, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
+    __pyx_t_4 = __pyx_t_1; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0;
+    __pyx_t_6 = NULL;
+  } else {
+    __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 149, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 149, __pyx_L1_error)
+  }
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  for (;;) {
+    if (likely(!__pyx_t_6)) {
+      if (likely(PyList_CheckExact(__pyx_t_4))) {
+        if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break;
+        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 149, __pyx_L1_error)
+        #else
+        __pyx_t_1 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 149, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_1);
+        #endif
+      } else {
+        if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
+        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 149, __pyx_L1_error)
+        #else
+        __pyx_t_1 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 149, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_1);
+        #endif
+      }
+    } else {
+      __pyx_t_1 = __pyx_t_6(__pyx_t_4);
+      if (unlikely(!__pyx_t_1)) {
+        PyObject* exc_type = PyErr_Occurred();
+        if (exc_type) {
+          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+          else __PYX_ERR(0, 149, __pyx_L1_error)
+        }
+        break;
+      }
+      __Pyx_GOTREF(__pyx_t_1);
+    }
+    if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
+      PyObject* sequence = __pyx_t_1;
+      Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
+      if (unlikely(size != 2)) {
+        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
+        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
+        __PYX_ERR(0, 149, __pyx_L1_error)
+      }
+      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+      if (likely(PyTuple_CheckExact(sequence))) {
+        __pyx_t_7 = PyTuple_GET_ITEM(sequence, 0); 
+        __pyx_t_8 = PyTuple_GET_ITEM(sequence, 1); 
+      } else {
+        __pyx_t_7 = PyList_GET_ITEM(sequence, 0); 
+        __pyx_t_8 = PyList_GET_ITEM(sequence, 1); 
+      }
+      __Pyx_INCREF(__pyx_t_7);
+      __Pyx_INCREF(__pyx_t_8);
+      #else
+      __pyx_t_7 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 149, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_7);
+      __pyx_t_8 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 149, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_8);
+      #endif
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    } else {
+      Py_ssize_t index = -1;
+      __pyx_t_9 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 149, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_9);
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      __pyx_t_10 = Py_TYPE(__pyx_t_9)->tp_iternext;
+      index = 0; __pyx_t_7 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_7)) goto __pyx_L6_unpacking_failed;
+      __Pyx_GOTREF(__pyx_t_7);
+      index = 1; __pyx_t_8 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_8)) goto __pyx_L6_unpacking_failed;
+      __Pyx_GOTREF(__pyx_t_8);
+      if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) __PYX_ERR(0, 149, __pyx_L1_error)
+      __pyx_t_10 = NULL;
+      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+      goto __pyx_L7_unpacking_done;
+      __pyx_L6_unpacking_failed:;
+      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+      __pyx_t_10 = NULL;
+      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
+      __PYX_ERR(0, 149, __pyx_L1_error)
+      __pyx_L7_unpacking_done:;
+    }
+    __Pyx_XDECREF_SET(__pyx_v_socket_flag, __pyx_t_7);
+    __pyx_t_7 = 0;
+    __Pyx_XDECREF_SET(__pyx_v_cares_flag, __pyx_t_8);
+    __pyx_t_8 = 0;
+/* … */
+  }
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+
+150:         if socket_flag & flags:
+
    __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 150, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __pyx_t_8 = PyNumber_And(__pyx_v_socket_flag, __pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 150, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_8);
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 150, __pyx_L1_error)
+    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+    if (__pyx_t_3) {
+/* … */
+    }
+
+151:             default |= cares_flag
+
      __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_default); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 151, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_8);
+      __pyx_t_1 = PyNumber_InPlaceOr(__pyx_t_8, __pyx_v_cares_flag); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 151, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+      __pyx_t_11 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 151, __pyx_L1_error)
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      __pyx_v_default = __pyx_t_11;
+
+152:             flags &= ~socket_flag
+
      __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 152, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      __pyx_t_8 = PyNumber_Invert(__pyx_v_socket_flag); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 152, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_8);
+      __pyx_t_7 = PyNumber_InPlaceAnd(__pyx_t_1, __pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 152, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_7);
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+      __pyx_t_11 = __Pyx_PyInt_As_int(__pyx_t_7); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 152, __pyx_L1_error)
+      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+      __pyx_v_flags = __pyx_t_11;
+
+153:         if not flags:
+
    __pyx_t_3 = ((!(__pyx_v_flags != 0)) != 0);
+    if (__pyx_t_3) {
+/* … */
+    }
+
+154:             return default
+
      __Pyx_XDECREF(__pyx_r);
+      __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_default); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 154, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_7);
+      __pyx_r = __pyx_t_7;
+      __pyx_t_7 = 0;
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      goto __pyx_L0;
+
+155:     raise gaierror(-1, "Bad value for ai_flags: 0x%x" % flags)
+
  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_gaierror); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 155, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_7);
+  __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 155, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_8);
+  __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_Bad_value_for_ai_flags_0x_x, __pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 155, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+  __pyx_t_8 = NULL;
+  __pyx_t_11 = 0;
+  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
+    __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
+    if (likely(__pyx_t_8)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
+      __Pyx_INCREF(__pyx_t_8);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_7, function);
+      __pyx_t_11 = 1;
+    }
+  }
+  #if CYTHON_FAST_PYCALL
+  if (PyFunction_Check(__pyx_t_7)) {
+    PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_int_neg_1, __pyx_t_1};
+    __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 155, __pyx_L1_error)
+    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
+    __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  } else
+  #endif
+  #if CYTHON_FAST_PYCCALL
+  if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
+    PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_int_neg_1, __pyx_t_1};
+    __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 155, __pyx_L1_error)
+    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
+    __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  } else
+  #endif
+  {
+    __pyx_t_9 = PyTuple_New(2+__pyx_t_11); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 155, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_9);
+    if (__pyx_t_8) {
+      __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = NULL;
+    }
+    __Pyx_INCREF(__pyx_int_neg_1);
+    __Pyx_GIVEREF(__pyx_int_neg_1);
+    PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_11, __pyx_int_neg_1);
+    __Pyx_GIVEREF(__pyx_t_1);
+    PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_11, __pyx_t_1);
+    __pyx_t_1 = 0;
+    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_9, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 155, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+  }
+  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __Pyx_Raise(__pyx_t_4, 0, 0, 0);
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __PYX_ERR(0, 155, __pyx_L1_error)
+
 156: 
+
 157: 
+
+158: cpdef strerror(code):
+
static PyObject *__pyx_pw_6gevent_8resolver_5cares_3strerror(PyObject *__pyx_self, PyObject *__pyx_v_code); /*proto*/
+static PyObject *__pyx_f_6gevent_8resolver_5cares_strerror(PyObject *__pyx_v_code, CYTHON_UNUSED int __pyx_skip_dispatch) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("strerror", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_AddTraceback("gevent.resolver.cares.strerror", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_8resolver_5cares_3strerror(PyObject *__pyx_self, PyObject *__pyx_v_code); /*proto*/
+static PyObject *__pyx_pw_6gevent_8resolver_5cares_3strerror(PyObject *__pyx_self, PyObject *__pyx_v_code) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("strerror (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_8resolver_5cares_2strerror(__pyx_self, ((PyObject *)__pyx_v_code));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_8resolver_5cares_2strerror(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_code) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("strerror", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __pyx_f_6gevent_8resolver_5cares_strerror(__pyx_v_code, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 158, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.resolver.cares.strerror", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+159:     return '%s: %s' % (_ares_errors.get(code) or code, cares.ares_strerror(code))
+
  __Pyx_XDECREF(__pyx_r);
+  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ares_errors); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 159, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_get); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 159, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_4);
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __pyx_t_3 = NULL;
+  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
+    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
+    if (likely(__pyx_t_3)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
+      __Pyx_INCREF(__pyx_t_3);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_4, function);
+    }
+  }
+  __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_3, __pyx_v_code) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_code);
+  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 159, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 159, __pyx_L1_error)
+  if (!__pyx_t_5) {
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  } else {
+    __Pyx_INCREF(__pyx_t_2);
+    __pyx_t_1 = __pyx_t_2;
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    goto __pyx_L3_bool_binop_done;
+  }
+  __Pyx_INCREF(__pyx_v_code);
+  __pyx_t_1 = __pyx_v_code;
+  __pyx_L3_bool_binop_done:;
+  __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_v_code); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 159, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyBytes_FromString(ares_strerror(__pyx_t_6)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 159, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 159, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_4);
+  __Pyx_GIVEREF(__pyx_t_1);
+  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_2);
+  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
+  __pyx_t_1 = 0;
+  __pyx_t_2 = 0;
+  __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_s_s, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 159, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __pyx_r = __pyx_t_2;
+  __pyx_t_2 = 0;
+  goto __pyx_L0;
+
 160: 
+
 161: 
+
+162: class InvalidIP(ValueError):
+
  __pyx_t_27 = __Pyx_CalculateMetaclass(NULL, __pyx_tuple__4); if (unlikely(!__pyx_t_27)) __PYX_ERR(0, 162, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_27);
+  __pyx_t_2 = __Pyx_Py3MetaclassPrepare(__pyx_t_27, __pyx_tuple__4, __pyx_n_s_InvalidIP, __pyx_n_s_InvalidIP, (PyObject *) NULL, __pyx_n_s_gevent_resolver_cares, (PyObject *) NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 162, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_26 = __Pyx_Py3ClassCreate(__pyx_t_27, __pyx_n_s_InvalidIP, __pyx_tuple__4, __pyx_t_2, NULL, 0, 0); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 162, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_26);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_InvalidIP, __pyx_t_26) < 0) __PYX_ERR(0, 162, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0;
+/* … */
+  __pyx_tuple__4 = PyTuple_Pack(1, __pyx_builtin_ValueError); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 162, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__4);
+  __Pyx_GIVEREF(__pyx_tuple__4);
+
 163:     pass
+
 164: 
+
 165: 
+
+166: cdef void gevent_sock_state_callback(void *data, int s, int read, int write):
+
static void __pyx_f_6gevent_8resolver_5cares_gevent_sock_state_callback(void *__pyx_v_data, int __pyx_v_s, int __pyx_v_read, int __pyx_v_write) {
+  struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_ch = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("gevent_sock_state_callback", 0);
+/* … */
+  /* function exit code */
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_WriteUnraisable("gevent.resolver.cares.gevent_sock_state_callback", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
+  __pyx_L0:;
+  __Pyx_XDECREF((PyObject *)__pyx_v_ch);
+  __Pyx_RefNannyFinishContext();
+}
+
+167:     if not data:
+
  __pyx_t_1 = ((!(__pyx_v_data != 0)) != 0);
+  if (__pyx_t_1) {
+/* … */
+  }
+
+168:         return
+
    goto __pyx_L0;
+
+169:     cdef channel ch = <channel>data
+
  __pyx_t_2 = ((PyObject *)__pyx_v_data);
+  __Pyx_INCREF(__pyx_t_2);
+  __pyx_v_ch = ((struct __pyx_obj_6gevent_8resolver_5cares_channel *)__pyx_t_2);
+  __pyx_t_2 = 0;
+
+170:     ch._sock_state_callback(s, read, write)
+
  __pyx_t_2 = ((struct __pyx_vtabstruct_6gevent_8resolver_5cares_channel *)__pyx_v_ch->__pyx_vtab)->_sock_state_callback(__pyx_v_ch, __pyx_v_s, __pyx_v_read, __pyx_v_write); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 170, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
 171: 
+
 172: 
+
+173: cdef class result:
+
struct __pyx_obj_6gevent_8resolver_5cares_result {
+  PyObject_HEAD
+  PyObject *value;
+  PyObject *exception;
+};
+
+
+174:     cdef public object value
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_8resolver_5cares_6result_5value_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_8resolver_5cares_6result_5value_1__get__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_8resolver_5cares_6result_5value___get__(((struct __pyx_obj_6gevent_8resolver_5cares_result *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_8resolver_5cares_6result_5value___get__(struct __pyx_obj_6gevent_8resolver_5cares_result *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __Pyx_INCREF(__pyx_v_self->value);
+  __pyx_r = __pyx_v_self->value;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static int __pyx_pw_6gevent_8resolver_5cares_6result_5value_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
+static int __pyx_pw_6gevent_8resolver_5cares_6result_5value_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_8resolver_5cares_6result_5value_2__set__(((struct __pyx_obj_6gevent_8resolver_5cares_result *)__pyx_v_self), ((PyObject *)__pyx_v_value));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_8resolver_5cares_6result_5value_2__set__(struct __pyx_obj_6gevent_8resolver_5cares_result *__pyx_v_self, PyObject *__pyx_v_value) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__set__", 0);
+  __Pyx_INCREF(__pyx_v_value);
+  __Pyx_GIVEREF(__pyx_v_value);
+  __Pyx_GOTREF(__pyx_v_self->value);
+  __Pyx_DECREF(__pyx_v_self->value);
+  __pyx_v_self->value = __pyx_v_value;
+
+  /* function exit code */
+  __pyx_r = 0;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static int __pyx_pw_6gevent_8resolver_5cares_6result_5value_5__del__(PyObject *__pyx_v_self); /*proto*/
+static int __pyx_pw_6gevent_8resolver_5cares_6result_5value_5__del__(PyObject *__pyx_v_self) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_8resolver_5cares_6result_5value_4__del__(((struct __pyx_obj_6gevent_8resolver_5cares_result *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_8resolver_5cares_6result_5value_4__del__(struct __pyx_obj_6gevent_8resolver_5cares_result *__pyx_v_self) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__del__", 0);
+  __Pyx_INCREF(Py_None);
+  __Pyx_GIVEREF(Py_None);
+  __Pyx_GOTREF(__pyx_v_self->value);
+  __Pyx_DECREF(__pyx_v_self->value);
+  __pyx_v_self->value = Py_None;
+
+  /* function exit code */
+  __pyx_r = 0;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+175:     cdef public object exception
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_8resolver_5cares_6result_9exception_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_8resolver_5cares_6result_9exception_1__get__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_8resolver_5cares_6result_9exception___get__(((struct __pyx_obj_6gevent_8resolver_5cares_result *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_8resolver_5cares_6result_9exception___get__(struct __pyx_obj_6gevent_8resolver_5cares_result *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __Pyx_INCREF(__pyx_v_self->exception);
+  __pyx_r = __pyx_v_self->exception;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static int __pyx_pw_6gevent_8resolver_5cares_6result_9exception_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
+static int __pyx_pw_6gevent_8resolver_5cares_6result_9exception_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_8resolver_5cares_6result_9exception_2__set__(((struct __pyx_obj_6gevent_8resolver_5cares_result *)__pyx_v_self), ((PyObject *)__pyx_v_value));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_8resolver_5cares_6result_9exception_2__set__(struct __pyx_obj_6gevent_8resolver_5cares_result *__pyx_v_self, PyObject *__pyx_v_value) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__set__", 0);
+  __Pyx_INCREF(__pyx_v_value);
+  __Pyx_GIVEREF(__pyx_v_value);
+  __Pyx_GOTREF(__pyx_v_self->exception);
+  __Pyx_DECREF(__pyx_v_self->exception);
+  __pyx_v_self->exception = __pyx_v_value;
+
+  /* function exit code */
+  __pyx_r = 0;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static int __pyx_pw_6gevent_8resolver_5cares_6result_9exception_5__del__(PyObject *__pyx_v_self); /*proto*/
+static int __pyx_pw_6gevent_8resolver_5cares_6result_9exception_5__del__(PyObject *__pyx_v_self) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_8resolver_5cares_6result_9exception_4__del__(((struct __pyx_obj_6gevent_8resolver_5cares_result *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_8resolver_5cares_6result_9exception_4__del__(struct __pyx_obj_6gevent_8resolver_5cares_result *__pyx_v_self) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__del__", 0);
+  __Pyx_INCREF(Py_None);
+  __Pyx_GIVEREF(Py_None);
+  __Pyx_GOTREF(__pyx_v_self->exception);
+  __Pyx_DECREF(__pyx_v_self->exception);
+  __pyx_v_self->exception = Py_None;
+
+  /* function exit code */
+  __pyx_r = 0;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
 176: 
+
+177:     def __init__(self, object value=None, object exception=None):
+
/* Python wrapper */
+static int __pyx_pw_6gevent_8resolver_5cares_6result_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static int __pyx_pw_6gevent_8resolver_5cares_6result_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_value = 0;
+  PyObject *__pyx_v_exception = 0;
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_value,&__pyx_n_s_exception,0};
+    PyObject* values[2] = {0,0};
+    values[0] = ((PyObject *)Py_None);
+    values[1] = ((PyObject *)Py_None);
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value);
+          if (value) { values[0] = value; kw_args--; }
+        }
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_exception);
+          if (value) { values[1] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 177, __pyx_L3_error)
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    __pyx_v_value = values[0];
+    __pyx_v_exception = values[1];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 177, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.resolver.cares.result.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return -1;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_8resolver_5cares_6result___init__(((struct __pyx_obj_6gevent_8resolver_5cares_result *)__pyx_v_self), __pyx_v_value, __pyx_v_exception);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_8resolver_5cares_6result___init__(struct __pyx_obj_6gevent_8resolver_5cares_result *__pyx_v_self, PyObject *__pyx_v_value, PyObject *__pyx_v_exception) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = 0;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+178:         self.value = value
+
  __Pyx_INCREF(__pyx_v_value);
+  __Pyx_GIVEREF(__pyx_v_value);
+  __Pyx_GOTREF(__pyx_v_self->value);
+  __Pyx_DECREF(__pyx_v_self->value);
+  __pyx_v_self->value = __pyx_v_value;
+
+179:         self.exception = exception
+
  __Pyx_INCREF(__pyx_v_exception);
+  __Pyx_GIVEREF(__pyx_v_exception);
+  __Pyx_GOTREF(__pyx_v_self->exception);
+  __Pyx_DECREF(__pyx_v_self->exception);
+  __pyx_v_self->exception = __pyx_v_exception;
+
 180: 
+
+181:     def __repr__(self):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_8resolver_5cares_6result_3__repr__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_8resolver_5cares_6result_3__repr__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_8resolver_5cares_6result_2__repr__(((struct __pyx_obj_6gevent_8resolver_5cares_result *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_8resolver_5cares_6result_2__repr__(struct __pyx_obj_6gevent_8resolver_5cares_result *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__repr__", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_AddTraceback("gevent.resolver.cares.result.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+182:         if self.exception is None:
+
  __pyx_t_1 = (__pyx_v_self->exception == Py_None);
+  __pyx_t_2 = (__pyx_t_1 != 0);
+  if (__pyx_t_2) {
+/* … */
+  }
+
+183:             return '%s(%r)' % (self.__class__.__name__, self.value)
+
    __Pyx_XDECREF(__pyx_r);
+    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 183, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 183, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 183, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_GIVEREF(__pyx_t_4);
+    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
+    __Pyx_INCREF(__pyx_v_self->value);
+    __Pyx_GIVEREF(__pyx_v_self->value);
+    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_self->value);
+    __pyx_t_4 = 0;
+    __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_s_r, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 183, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __pyx_r = __pyx_t_4;
+    __pyx_t_4 = 0;
+    goto __pyx_L0;
+
+184:         elif self.value is None:
+
  __pyx_t_2 = (__pyx_v_self->value == Py_None);
+  __pyx_t_1 = (__pyx_t_2 != 0);
+  if (__pyx_t_1) {
+/* … */
+  }
+
+185:             return '%s(exception=%r)' % (self.__class__.__name__, self.exception)
+
    __Pyx_XDECREF(__pyx_r);
+    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 185, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 185, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 185, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_GIVEREF(__pyx_t_3);
+    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
+    __Pyx_INCREF(__pyx_v_self->exception);
+    __Pyx_GIVEREF(__pyx_v_self->exception);
+    PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_self->exception);
+    __pyx_t_3 = 0;
+    __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_s_exception_r, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 185, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __pyx_r = __pyx_t_3;
+    __pyx_t_3 = 0;
+    goto __pyx_L0;
+
 186:         else:
+
+187:             return '%s(value=%r, exception=%r)' % (self.__class__.__name__, self.value, self.exception)
+
  /*else*/ {
+    __Pyx_XDECREF(__pyx_r);
+    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 187, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 187, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 187, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_GIVEREF(__pyx_t_4);
+    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
+    __Pyx_INCREF(__pyx_v_self->value);
+    __Pyx_GIVEREF(__pyx_v_self->value);
+    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_self->value);
+    __Pyx_INCREF(__pyx_v_self->exception);
+    __Pyx_GIVEREF(__pyx_v_self->exception);
+    PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_self->exception);
+    __pyx_t_4 = 0;
+    __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_s_value_r_exception_r, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 187, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __pyx_r = __pyx_t_4;
+    __pyx_t_4 = 0;
+    goto __pyx_L0;
+  }
+
 188:         # add repr_recursive precaution
+
 189: 
+
+190:     def successful(self):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_8resolver_5cares_6result_5successful(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyObject *__pyx_pw_6gevent_8resolver_5cares_6result_5successful(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("successful (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_8resolver_5cares_6result_4successful(((struct __pyx_obj_6gevent_8resolver_5cares_result *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_8resolver_5cares_6result_4successful(struct __pyx_obj_6gevent_8resolver_5cares_result *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("successful", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_AddTraceback("gevent.resolver.cares.result.successful", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+191:         return self.exception is None
+
  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = (__pyx_v_self->exception == Py_None);
+  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 191, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_r = __pyx_t_2;
+  __pyx_t_2 = 0;
+  goto __pyx_L0;
+
 192: 
+
+193:     def get(self):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_8resolver_5cares_6result_7get(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyObject *__pyx_pw_6gevent_8resolver_5cares_6result_7get(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("get (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_8resolver_5cares_6result_6get(((struct __pyx_obj_6gevent_8resolver_5cares_result *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_8resolver_5cares_6result_6get(struct __pyx_obj_6gevent_8resolver_5cares_result *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("get", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_AddTraceback("gevent.resolver.cares.result.get", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+194:         if self.exception is not None:
+
  __pyx_t_1 = (__pyx_v_self->exception != Py_None);
+  __pyx_t_2 = (__pyx_t_1 != 0);
+  if (unlikely(__pyx_t_2)) {
+/* … */
+  }
+
+195:             raise self.exception
+
    __Pyx_Raise(__pyx_v_self->exception, 0, 0, 0);
+    __PYX_ERR(0, 195, __pyx_L1_error)
+
+196:         return self.value
+
  __Pyx_XDECREF(__pyx_r);
+  __Pyx_INCREF(__pyx_v_self->value);
+  __pyx_r = __pyx_v_self->value;
+  goto __pyx_L0;
+
 197: 
+
 198: 
+
+199: class ares_host_result(tuple):
+
  __pyx_t_27 = PyTuple_New(1); if (unlikely(!__pyx_t_27)) __PYX_ERR(0, 199, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_27);
+  __Pyx_INCREF(((PyObject *)(&PyTuple_Type)));
+  __Pyx_GIVEREF(((PyObject *)(&PyTuple_Type)));
+  PyTuple_SET_ITEM(__pyx_t_27, 0, ((PyObject *)(&PyTuple_Type)));
+  __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_27); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 199, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_26 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_27, __pyx_n_s_ares_host_result, __pyx_n_s_ares_host_result, (PyObject *) NULL, __pyx_n_s_gevent_resolver_cares, (PyObject *) NULL); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 199, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_26);
+/* … */
+  __pyx_t_25 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_ares_host_result, __pyx_t_27, __pyx_t_26, NULL, 0, 0); if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 199, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_25);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ares_host_result, __pyx_t_25) < 0) __PYX_ERR(0, 199, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0;
+  __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0;
+
 200: 
+
+201:     def __new__(cls, family, iterable):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_8resolver_5cares_16ares_host_result_1__new__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyMethodDef __pyx_mdef_6gevent_8resolver_5cares_16ares_host_result_1__new__ = {"__new__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_8resolver_5cares_16ares_host_result_1__new__, METH_VARARGS|METH_KEYWORDS, 0};
+static PyObject *__pyx_pw_6gevent_8resolver_5cares_16ares_host_result_1__new__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_cls = 0;
+  PyObject *__pyx_v_family = 0;
+  PyObject *__pyx_v_iterable = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__new__ (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_cls,&__pyx_n_s_family,&__pyx_n_s_iterable,0};
+    PyObject* values[3] = {0,0,0};
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cls)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_family)) != 0)) kw_args--;
+        else {
+          __Pyx_RaiseArgtupleInvalid("__new__", 1, 3, 3, 1); __PYX_ERR(0, 201, __pyx_L3_error)
+        }
+        CYTHON_FALLTHROUGH;
+        case  2:
+        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_iterable)) != 0)) kw_args--;
+        else {
+          __Pyx_RaiseArgtupleInvalid("__new__", 1, 3, 3, 2); __PYX_ERR(0, 201, __pyx_L3_error)
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__new__") < 0)) __PYX_ERR(0, 201, __pyx_L3_error)
+      }
+    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
+      goto __pyx_L5_argtuple_error;
+    } else {
+      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+    }
+    __pyx_v_cls = values[0];
+    __pyx_v_family = values[1];
+    __pyx_v_iterable = values[2];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("__new__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 201, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.resolver.cares.ares_host_result.__new__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_8resolver_5cares_16ares_host_result___new__(__pyx_self, __pyx_v_cls, __pyx_v_family, __pyx_v_iterable);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_8resolver_5cares_16ares_host_result___new__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_cls, PyObject *__pyx_v_family, PyObject *__pyx_v_iterable) {
+  PyObject *__pyx_v_self = 0;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__new__", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_AddTraceback("gevent.resolver.cares.ares_host_result.__new__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_self);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__5 = PyTuple_Pack(4, __pyx_n_s_cls, __pyx_n_s_family, __pyx_n_s_iterable, __pyx_n_s_self); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 201, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__5);
+  __Pyx_GIVEREF(__pyx_tuple__5);
+/* … */
+  __pyx_t_25 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_8resolver_5cares_16ares_host_result_1__new__, __Pyx_CYFUNCTION_STATICMETHOD, __pyx_n_s_ares_host_result___new, NULL, __pyx_n_s_gevent_resolver_cares, __pyx_d, ((PyObject *)__pyx_codeobj__6)); if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 201, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_25);
+  if (__Pyx_SetNameInClass(__pyx_t_26, __pyx_n_s_new, __pyx_t_25) < 0) __PYX_ERR(0, 201, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0;
+  __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__5, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent_resolver_cares_pyx, __pyx_n_s_new, 201, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__6)) __PYX_ERR(0, 201, __pyx_L1_error)
+
+202:         cdef object self = tuple.__new__(cls, iterable)
+
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)(&PyTuple_Type)), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 202, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = NULL;
+  __pyx_t_4 = 0;
+  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+    if (likely(__pyx_t_3)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+      __Pyx_INCREF(__pyx_t_3);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_2, function);
+      __pyx_t_4 = 1;
+    }
+  }
+  #if CYTHON_FAST_PYCALL
+  if (PyFunction_Check(__pyx_t_2)) {
+    PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_cls, __pyx_v_iterable};
+    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 202, __pyx_L1_error)
+    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __Pyx_GOTREF(__pyx_t_1);
+  } else
+  #endif
+  #if CYTHON_FAST_PYCCALL
+  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
+    PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_cls, __pyx_v_iterable};
+    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 202, __pyx_L1_error)
+    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __Pyx_GOTREF(__pyx_t_1);
+  } else
+  #endif
+  {
+    __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 202, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_5);
+    if (__pyx_t_3) {
+      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
+    }
+    __Pyx_INCREF(__pyx_v_cls);
+    __Pyx_GIVEREF(__pyx_v_cls);
+    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_cls);
+    __Pyx_INCREF(__pyx_v_iterable);
+    __Pyx_GIVEREF(__pyx_v_iterable);
+    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_iterable);
+    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 202, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+  }
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_v_self = __pyx_t_1;
+  __pyx_t_1 = 0;
+
+203:         self.family = family
+
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_family, __pyx_v_family) < 0) __PYX_ERR(0, 203, __pyx_L1_error)
+
+204:         return self
+
  __Pyx_XDECREF(__pyx_r);
+  __Pyx_INCREF(__pyx_v_self);
+  __pyx_r = __pyx_v_self;
+  goto __pyx_L0;
+
 205: 
+
+206:     def __getnewargs__(self):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_8resolver_5cares_16ares_host_result_3__getnewargs__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
+static PyMethodDef __pyx_mdef_6gevent_8resolver_5cares_16ares_host_result_3__getnewargs__ = {"__getnewargs__", (PyCFunction)__pyx_pw_6gevent_8resolver_5cares_16ares_host_result_3__getnewargs__, METH_O, 0};
+static PyObject *__pyx_pw_6gevent_8resolver_5cares_16ares_host_result_3__getnewargs__(PyObject *__pyx_self, PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__getnewargs__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_8resolver_5cares_16ares_host_result_2__getnewargs__(__pyx_self, ((PyObject *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_8resolver_5cares_16ares_host_result_2__getnewargs__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__getnewargs__", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_AddTraceback("gevent.resolver.cares.ares_host_result.__getnewargs__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_tuple__7 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 206, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__7);
+  __Pyx_GIVEREF(__pyx_tuple__7);
+/* … */
+  __pyx_t_25 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6gevent_8resolver_5cares_16ares_host_result_3__getnewargs__, 0, __pyx_n_s_ares_host_result___getnewargs, NULL, __pyx_n_s_gevent_resolver_cares, __pyx_d, ((PyObject *)__pyx_codeobj__8)); if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 206, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_25);
+  if (__Pyx_SetNameInClass(__pyx_t_26, __pyx_n_s_getnewargs, __pyx_t_25) < 0) __PYX_ERR(0, 206, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0;
+
+207:         return (self.family, tuple(self))
+
  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_family); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 207, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = __Pyx_PySequence_Tuple(__pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 207, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 207, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_GIVEREF(__pyx_t_1);
+  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_2);
+  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
+  __pyx_t_1 = 0;
+  __pyx_t_2 = 0;
+  __pyx_r = __pyx_t_3;
+  __pyx_t_3 = 0;
+  goto __pyx_L0;
+
 208: 
+
 209: 
+
+210: cdef void gevent_ares_host_callback(void *arg, int status, int timeouts, hostent* host):
+
static void __pyx_f_6gevent_8resolver_5cares_gevent_ares_host_callback(void *__pyx_v_arg, int __pyx_v_status, CYTHON_UNUSED int __pyx_v_timeouts, struct hostent *__pyx_v_host) {
+  struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_channel = 0;
+  PyObject *__pyx_v_callback = 0;
+  PyObject *__pyx_v_host_result = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("gevent_ares_host_callback", 0);
+/* … */
+  /* function exit code */
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_9);
+  __Pyx_XDECREF(__pyx_t_10);
+  __Pyx_XDECREF(__pyx_t_11);
+  __Pyx_XDECREF(__pyx_t_13);
+  __Pyx_XDECREF(__pyx_t_17);
+  __Pyx_WriteUnraisable("gevent.resolver.cares.gevent_ares_host_callback", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
+  __pyx_L0:;
+  __Pyx_XDECREF((PyObject *)__pyx_v_channel);
+  __Pyx_XDECREF(__pyx_v_callback);
+  __Pyx_XDECREF(__pyx_v_host_result);
+  __Pyx_RefNannyFinishContext();
+}
+
 211:     cdef channel channel
+
 212:     cdef object callback
+
+213:     channel, callback = <tuple>arg
+
  __pyx_t_1 = ((PyObject *)__pyx_v_arg);
+  __Pyx_INCREF(__pyx_t_1);
+  if (likely(__pyx_t_1 != Py_None)) {
+    PyObject* sequence = __pyx_t_1;
+    Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
+    if (unlikely(size != 2)) {
+      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
+      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
+      __PYX_ERR(0, 213, __pyx_L1_error)
+    }
+    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+    __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); 
+    __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); 
+    __Pyx_INCREF(__pyx_t_2);
+    __Pyx_INCREF(__pyx_t_3);
+    #else
+    __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 213, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 213, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    #endif
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  } else {
+    __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(0, 213, __pyx_L1_error)
+  }
+  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_6gevent_8resolver_5cares_channel))))) __PYX_ERR(0, 213, __pyx_L1_error)
+  __pyx_v_channel = ((struct __pyx_obj_6gevent_8resolver_5cares_channel *)__pyx_t_2);
+  __pyx_t_2 = 0;
+  __pyx_v_callback = __pyx_t_3;
+  __pyx_t_3 = 0;
+
+214:     Py_DECREF(<tuple>arg)
+
  Py_DECREF(((PyObject *)__pyx_v_arg));
+
 215:     cdef object host_result
+
+216:     try:
+
  {
+    /*try:*/ {
+/* … */
+    }
+    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+    goto __pyx_L8_try_end;
+    __pyx_L3_error:;
+    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
+    __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
+    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
+    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
+    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+/* … */
+    __Pyx_XGIVEREF(__pyx_t_4);
+    __Pyx_XGIVEREF(__pyx_t_5);
+    __Pyx_XGIVEREF(__pyx_t_6);
+    __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
+    goto __pyx_L1_error;
+    __pyx_L4_exception_handled:;
+    __Pyx_XGIVEREF(__pyx_t_4);
+    __Pyx_XGIVEREF(__pyx_t_5);
+    __Pyx_XGIVEREF(__pyx_t_6);
+    __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
+    __pyx_L8_try_end:;
+  }
+
+217:         if status or not host:
+
      __pyx_t_8 = (__pyx_v_status != 0);
+      if (!__pyx_t_8) {
+      } else {
+        __pyx_t_7 = __pyx_t_8;
+        goto __pyx_L10_bool_binop_done;
+      }
+      __pyx_t_8 = ((!(__pyx_v_host != 0)) != 0);
+      __pyx_t_7 = __pyx_t_8;
+      __pyx_L10_bool_binop_done:;
+      if (__pyx_t_7) {
+/* … */
+        goto __pyx_L9;
+      }
+
+218:             callback(result(None, gaierror(status, strerror(status))))
+
        __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_gaierror); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 218, __pyx_L3_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_status); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 218, __pyx_L3_error)
+        __Pyx_GOTREF(__pyx_t_9);
+        __pyx_t_10 = __Pyx_PyInt_From_int(__pyx_v_status); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 218, __pyx_L3_error)
+        __Pyx_GOTREF(__pyx_t_10);
+        __pyx_t_11 = __pyx_f_6gevent_8resolver_5cares_strerror(__pyx_t_10, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 218, __pyx_L3_error)
+        __Pyx_GOTREF(__pyx_t_11);
+        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+        __pyx_t_10 = NULL;
+        __pyx_t_12 = 0;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
+          __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_2);
+          if (likely(__pyx_t_10)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+            __Pyx_INCREF(__pyx_t_10);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_2, function);
+            __pyx_t_12 = 1;
+          }
+        }
+        #if CYTHON_FAST_PYCALL
+        if (PyFunction_Check(__pyx_t_2)) {
+          PyObject *__pyx_temp[3] = {__pyx_t_10, __pyx_t_9, __pyx_t_11};
+          __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_12, 2+__pyx_t_12); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 218, __pyx_L3_error)
+          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
+          __Pyx_GOTREF(__pyx_t_3);
+          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+        } else
+        #endif
+        #if CYTHON_FAST_PYCCALL
+        if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
+          PyObject *__pyx_temp[3] = {__pyx_t_10, __pyx_t_9, __pyx_t_11};
+          __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_12, 2+__pyx_t_12); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 218, __pyx_L3_error)
+          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
+          __Pyx_GOTREF(__pyx_t_3);
+          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+        } else
+        #endif
+        {
+          __pyx_t_13 = PyTuple_New(2+__pyx_t_12); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 218, __pyx_L3_error)
+          __Pyx_GOTREF(__pyx_t_13);
+          if (__pyx_t_10) {
+            __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_10); __pyx_t_10 = NULL;
+          }
+          __Pyx_GIVEREF(__pyx_t_9);
+          PyTuple_SET_ITEM(__pyx_t_13, 0+__pyx_t_12, __pyx_t_9);
+          __Pyx_GIVEREF(__pyx_t_11);
+          PyTuple_SET_ITEM(__pyx_t_13, 1+__pyx_t_12, __pyx_t_11);
+          __pyx_t_9 = 0;
+          __pyx_t_11 = 0;
+          __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_13, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 218, __pyx_L3_error)
+          __Pyx_GOTREF(__pyx_t_3);
+          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+        }
+        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+        __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 218, __pyx_L3_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        __Pyx_INCREF(Py_None);
+        __Pyx_GIVEREF(Py_None);
+        PyTuple_SET_ITEM(__pyx_t_2, 0, Py_None);
+        __Pyx_GIVEREF(__pyx_t_3);
+        PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3);
+        __pyx_t_3 = 0;
+        __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6gevent_8resolver_5cares_result), __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 218, __pyx_L3_error)
+        __Pyx_GOTREF(__pyx_t_3);
+        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+        __Pyx_INCREF(__pyx_v_callback);
+        __pyx_t_2 = __pyx_v_callback; __pyx_t_13 = NULL;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
+          __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_2);
+          if (likely(__pyx_t_13)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+            __Pyx_INCREF(__pyx_t_13);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_2, function);
+          }
+        }
+        __pyx_t_1 = (__pyx_t_13) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_13, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
+        __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 218, __pyx_L3_error)
+        __Pyx_GOTREF(__pyx_t_1);
+        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 219:         else:
+
+220:             try:
+
      /*else*/ {
+        {
+          /*try:*/ {
+/* … */
+          }
+/* … */
+          __Pyx_XGIVEREF(__pyx_t_14);
+          __Pyx_XGIVEREF(__pyx_t_15);
+          __Pyx_XGIVEREF(__pyx_t_16);
+          __Pyx_ExceptionReset(__pyx_t_14, __pyx_t_15, __pyx_t_16);
+          goto __pyx_L3_error;
+          __pyx_L13_exception_handled:;
+          __Pyx_XGIVEREF(__pyx_t_14);
+          __Pyx_XGIVEREF(__pyx_t_15);
+          __Pyx_XGIVEREF(__pyx_t_16);
+          __Pyx_ExceptionReset(__pyx_t_14, __pyx_t_15, __pyx_t_16);
+          __pyx_L17_try_end:;
+        }
+      }
+      __pyx_L9:;
+
+221:                 host_result = ares_host_result(host.h_addrtype, (parse_h_name(host), parse_h_aliases(host), parse_h_addr_list(host)))
+
            __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ares_host_result); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 221, __pyx_L12_error)
+            __Pyx_GOTREF(__pyx_t_2);
+            __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_host->h_addrtype); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 221, __pyx_L12_error)
+            __Pyx_GOTREF(__pyx_t_3);
+            __pyx_t_13 = parse_h_name(__pyx_v_host); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 221, __pyx_L12_error)
+            __Pyx_GOTREF(__pyx_t_13);
+            __pyx_t_11 = parse_h_aliases(__pyx_v_host); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 221, __pyx_L12_error)
+            __Pyx_GOTREF(__pyx_t_11);
+            __pyx_t_9 = parse_h_addr_list(__pyx_v_host); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 221, __pyx_L12_error)
+            __Pyx_GOTREF(__pyx_t_9);
+            __pyx_t_10 = PyTuple_New(3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 221, __pyx_L12_error)
+            __Pyx_GOTREF(__pyx_t_10);
+            __Pyx_GIVEREF(__pyx_t_13);
+            PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_13);
+            __Pyx_GIVEREF(__pyx_t_11);
+            PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_11);
+            __Pyx_GIVEREF(__pyx_t_9);
+            PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_t_9);
+            __pyx_t_13 = 0;
+            __pyx_t_11 = 0;
+            __pyx_t_9 = 0;
+            __pyx_t_9 = NULL;
+            __pyx_t_12 = 0;
+            if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
+              __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_2);
+              if (likely(__pyx_t_9)) {
+                PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+                __Pyx_INCREF(__pyx_t_9);
+                __Pyx_INCREF(function);
+                __Pyx_DECREF_SET(__pyx_t_2, function);
+                __pyx_t_12 = 1;
+              }
+            }
+            #if CYTHON_FAST_PYCALL
+            if (PyFunction_Check(__pyx_t_2)) {
+              PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_t_3, __pyx_t_10};
+              __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_12, 2+__pyx_t_12); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 221, __pyx_L12_error)
+              __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
+              __Pyx_GOTREF(__pyx_t_1);
+              __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+            } else
+            #endif
+            #if CYTHON_FAST_PYCCALL
+            if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
+              PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_t_3, __pyx_t_10};
+              __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_12, 2+__pyx_t_12); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 221, __pyx_L12_error)
+              __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
+              __Pyx_GOTREF(__pyx_t_1);
+              __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+            } else
+            #endif
+            {
+              __pyx_t_11 = PyTuple_New(2+__pyx_t_12); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 221, __pyx_L12_error)
+              __Pyx_GOTREF(__pyx_t_11);
+              if (__pyx_t_9) {
+                __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_9); __pyx_t_9 = NULL;
+              }
+              __Pyx_GIVEREF(__pyx_t_3);
+              PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_12, __pyx_t_3);
+              __Pyx_GIVEREF(__pyx_t_10);
+              PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_12, __pyx_t_10);
+              __pyx_t_3 = 0;
+              __pyx_t_10 = 0;
+              __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_11, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 221, __pyx_L12_error)
+              __Pyx_GOTREF(__pyx_t_1);
+              __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+            }
+            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+            __pyx_v_host_result = __pyx_t_1;
+            __pyx_t_1 = 0;
+
+222:             except:
+
          /*except:*/ {
+            __Pyx_AddTraceback("gevent.resolver.cares.gevent_ares_host_callback", __pyx_clineno, __pyx_lineno, __pyx_filename);
+            if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_11, &__pyx_t_2) < 0) __PYX_ERR(0, 222, __pyx_L14_except_error)
+            __Pyx_GOTREF(__pyx_t_1);
+            __Pyx_GOTREF(__pyx_t_11);
+            __Pyx_GOTREF(__pyx_t_2);
+
+223:                 callback(result(None, sys.exc_info()[1]))
+
            __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_sys); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 223, __pyx_L14_except_error)
+            __Pyx_GOTREF(__pyx_t_9);
+            __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_exc_info); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 223, __pyx_L14_except_error)
+            __Pyx_GOTREF(__pyx_t_13);
+            __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+            __pyx_t_9 = NULL;
+            if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_13))) {
+              __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_13);
+              if (likely(__pyx_t_9)) {
+                PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13);
+                __Pyx_INCREF(__pyx_t_9);
+                __Pyx_INCREF(function);
+                __Pyx_DECREF_SET(__pyx_t_13, function);
+              }
+            }
+            __pyx_t_3 = (__pyx_t_9) ? __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_t_9) : __Pyx_PyObject_CallNoArg(__pyx_t_13);
+            __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
+            if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 223, __pyx_L14_except_error)
+            __Pyx_GOTREF(__pyx_t_3);
+            __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+            __pyx_t_13 = __Pyx_GetItemInt(__pyx_t_3, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 223, __pyx_L14_except_error)
+            __Pyx_GOTREF(__pyx_t_13);
+            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+            __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 223, __pyx_L14_except_error)
+            __Pyx_GOTREF(__pyx_t_3);
+            __Pyx_INCREF(Py_None);
+            __Pyx_GIVEREF(Py_None);
+            PyTuple_SET_ITEM(__pyx_t_3, 0, Py_None);
+            __Pyx_GIVEREF(__pyx_t_13);
+            PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_13);
+            __pyx_t_13 = 0;
+            __pyx_t_13 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6gevent_8resolver_5cares_result), __pyx_t_3, NULL); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 223, __pyx_L14_except_error)
+            __Pyx_GOTREF(__pyx_t_13);
+            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+            __Pyx_INCREF(__pyx_v_callback);
+            __pyx_t_3 = __pyx_v_callback; __pyx_t_9 = NULL;
+            if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+              __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_3);
+              if (likely(__pyx_t_9)) {
+                PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+                __Pyx_INCREF(__pyx_t_9);
+                __Pyx_INCREF(function);
+                __Pyx_DECREF_SET(__pyx_t_3, function);
+              }
+            }
+            __pyx_t_10 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_9, __pyx_t_13) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_13);
+            __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
+            __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+            if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 223, __pyx_L14_except_error)
+            __Pyx_GOTREF(__pyx_t_10);
+            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+            __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+            __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
+            __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+            goto __pyx_L13_exception_handled;
+          }
+          __pyx_L14_except_error:;
+
 224:             else:
+
+225:                 callback(result(host_result))
+
          /*else:*/ {
+            __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_6gevent_8resolver_5cares_result), __pyx_v_host_result); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 225, __pyx_L14_except_error)
+            __Pyx_GOTREF(__pyx_t_2);
+            __Pyx_INCREF(__pyx_v_callback);
+            __pyx_t_11 = __pyx_v_callback; __pyx_t_10 = NULL;
+            if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_11))) {
+              __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_11);
+              if (likely(__pyx_t_10)) {
+                PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
+                __Pyx_INCREF(__pyx_t_10);
+                __Pyx_INCREF(function);
+                __Pyx_DECREF_SET(__pyx_t_11, function);
+              }
+            }
+            __pyx_t_1 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_11, __pyx_t_10, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_t_2);
+            __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
+            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+            if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 225, __pyx_L14_except_error)
+            __Pyx_GOTREF(__pyx_t_1);
+            __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+          }
+          __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
+          __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
+          __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
+          goto __pyx_L17_try_end;
+          __pyx_L12_error:;
+          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
+          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
+          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
+          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
+          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+226:     except:
+
    /*except:*/ {
+      __Pyx_AddTraceback("gevent.resolver.cares.gevent_ares_host_callback", __pyx_clineno, __pyx_lineno, __pyx_filename);
+      if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_11, &__pyx_t_1) < 0) __PYX_ERR(0, 226, __pyx_L5_except_error)
+      __Pyx_GOTREF(__pyx_t_2);
+      __Pyx_GOTREF(__pyx_t_11);
+      __Pyx_GOTREF(__pyx_t_1);
+
+227:         channel.loop.handle_error(callback, *sys.exc_info())
+
      __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_channel->loop, __pyx_n_s_handle_error); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 227, __pyx_L5_except_error)
+      __Pyx_GOTREF(__pyx_t_10);
+      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 227, __pyx_L5_except_error)
+      __Pyx_GOTREF(__pyx_t_3);
+      __Pyx_INCREF(__pyx_v_callback);
+      __Pyx_GIVEREF(__pyx_v_callback);
+      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_callback);
+      __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_sys); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 227, __pyx_L5_except_error)
+      __Pyx_GOTREF(__pyx_t_9);
+      __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_exc_info); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 227, __pyx_L5_except_error)
+      __Pyx_GOTREF(__pyx_t_17);
+      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+      __pyx_t_9 = NULL;
+      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_17))) {
+        __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_17);
+        if (likely(__pyx_t_9)) {
+          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_17);
+          __Pyx_INCREF(__pyx_t_9);
+          __Pyx_INCREF(function);
+          __Pyx_DECREF_SET(__pyx_t_17, function);
+        }
+      }
+      __pyx_t_13 = (__pyx_t_9) ? __Pyx_PyObject_CallOneArg(__pyx_t_17, __pyx_t_9) : __Pyx_PyObject_CallNoArg(__pyx_t_17);
+      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
+      if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 227, __pyx_L5_except_error)
+      __Pyx_GOTREF(__pyx_t_13);
+      __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
+      __pyx_t_17 = __Pyx_PySequence_Tuple(__pyx_t_13); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 227, __pyx_L5_except_error)
+      __Pyx_GOTREF(__pyx_t_17);
+      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+      __pyx_t_13 = PyNumber_Add(__pyx_t_3, __pyx_t_17); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 227, __pyx_L5_except_error)
+      __Pyx_GOTREF(__pyx_t_13);
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
+      __pyx_t_17 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_13, NULL); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 227, __pyx_L5_except_error)
+      __Pyx_GOTREF(__pyx_t_17);
+      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+      __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
+      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+      __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
+      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+      goto __pyx_L4_exception_handled;
+    }
+    __pyx_L5_except_error:;
+
 228: 
+
 229: 
+
+230: cdef void gevent_ares_nameinfo_callback(void *arg, int status, int timeouts, char *c_node, char *c_service):
+
static void __pyx_f_6gevent_8resolver_5cares_gevent_ares_nameinfo_callback(void *__pyx_v_arg, int __pyx_v_status, CYTHON_UNUSED int __pyx_v_timeouts, char *__pyx_v_c_node, char *__pyx_v_c_service) {
+  struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_channel = 0;
+  PyObject *__pyx_v_callback = 0;
+  PyObject *__pyx_v_node = 0;
+  PyObject *__pyx_v_service = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("gevent_ares_nameinfo_callback", 0);
+/* … */
+  /* function exit code */
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_8);
+  __Pyx_XDECREF(__pyx_t_9);
+  __Pyx_XDECREF(__pyx_t_10);
+  __Pyx_XDECREF(__pyx_t_12);
+  __Pyx_XDECREF(__pyx_t_13);
+  __Pyx_WriteUnraisable("gevent.resolver.cares.gevent_ares_nameinfo_callback", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
+  __pyx_L0:;
+  __Pyx_XDECREF((PyObject *)__pyx_v_channel);
+  __Pyx_XDECREF(__pyx_v_callback);
+  __Pyx_XDECREF(__pyx_v_node);
+  __Pyx_XDECREF(__pyx_v_service);
+  __Pyx_RefNannyFinishContext();
+}
+
 231:     cdef channel channel
+
 232:     cdef object callback
+
+233:     channel, callback = <tuple>arg
+
  __pyx_t_1 = ((PyObject *)__pyx_v_arg);
+  __Pyx_INCREF(__pyx_t_1);
+  if (likely(__pyx_t_1 != Py_None)) {
+    PyObject* sequence = __pyx_t_1;
+    Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
+    if (unlikely(size != 2)) {
+      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
+      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
+      __PYX_ERR(0, 233, __pyx_L1_error)
+    }
+    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+    __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); 
+    __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); 
+    __Pyx_INCREF(__pyx_t_2);
+    __Pyx_INCREF(__pyx_t_3);
+    #else
+    __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 233, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 233, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    #endif
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  } else {
+    __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(0, 233, __pyx_L1_error)
+  }
+  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_6gevent_8resolver_5cares_channel))))) __PYX_ERR(0, 233, __pyx_L1_error)
+  __pyx_v_channel = ((struct __pyx_obj_6gevent_8resolver_5cares_channel *)__pyx_t_2);
+  __pyx_t_2 = 0;
+  __pyx_v_callback = __pyx_t_3;
+  __pyx_t_3 = 0;
+
+234:     Py_DECREF(<tuple>arg)
+
  Py_DECREF(((PyObject *)__pyx_v_arg));
+
 235:     cdef object node
+
 236:     cdef object service
+
+237:     try:
+
  {
+    /*try:*/ {
+/* … */
+    }
+    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+    goto __pyx_L8_try_end;
+    __pyx_L3_error:;
+    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
+    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
+    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
+    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
+    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+/* … */
+    __Pyx_XGIVEREF(__pyx_t_4);
+    __Pyx_XGIVEREF(__pyx_t_5);
+    __Pyx_XGIVEREF(__pyx_t_6);
+    __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
+    goto __pyx_L1_error;
+    __pyx_L4_exception_handled:;
+    __Pyx_XGIVEREF(__pyx_t_4);
+    __Pyx_XGIVEREF(__pyx_t_5);
+    __Pyx_XGIVEREF(__pyx_t_6);
+    __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
+    __pyx_L8_try_end:;
+  }
+
+238:         if status:
+
      __pyx_t_7 = (__pyx_v_status != 0);
+      if (__pyx_t_7) {
+/* … */
+        goto __pyx_L9;
+      }
+
+239:             callback(result(None, gaierror(status, strerror(status))))
+
        __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_gaierror); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 239, __pyx_L3_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_status); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 239, __pyx_L3_error)
+        __Pyx_GOTREF(__pyx_t_8);
+        __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_status); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 239, __pyx_L3_error)
+        __Pyx_GOTREF(__pyx_t_9);
+        __pyx_t_10 = __pyx_f_6gevent_8resolver_5cares_strerror(__pyx_t_9, 0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 239, __pyx_L3_error)
+        __Pyx_GOTREF(__pyx_t_10);
+        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+        __pyx_t_9 = NULL;
+        __pyx_t_11 = 0;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
+          __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_2);
+          if (likely(__pyx_t_9)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+            __Pyx_INCREF(__pyx_t_9);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_2, function);
+            __pyx_t_11 = 1;
+          }
+        }
+        #if CYTHON_FAST_PYCALL
+        if (PyFunction_Check(__pyx_t_2)) {
+          PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_t_8, __pyx_t_10};
+          __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 239, __pyx_L3_error)
+          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
+          __Pyx_GOTREF(__pyx_t_3);
+          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+        } else
+        #endif
+        #if CYTHON_FAST_PYCCALL
+        if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
+          PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_t_8, __pyx_t_10};
+          __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 239, __pyx_L3_error)
+          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
+          __Pyx_GOTREF(__pyx_t_3);
+          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+        } else
+        #endif
+        {
+          __pyx_t_12 = PyTuple_New(2+__pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 239, __pyx_L3_error)
+          __Pyx_GOTREF(__pyx_t_12);
+          if (__pyx_t_9) {
+            __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_9); __pyx_t_9 = NULL;
+          }
+          __Pyx_GIVEREF(__pyx_t_8);
+          PyTuple_SET_ITEM(__pyx_t_12, 0+__pyx_t_11, __pyx_t_8);
+          __Pyx_GIVEREF(__pyx_t_10);
+          PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_11, __pyx_t_10);
+          __pyx_t_8 = 0;
+          __pyx_t_10 = 0;
+          __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_12, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 239, __pyx_L3_error)
+          __Pyx_GOTREF(__pyx_t_3);
+          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
+        }
+        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+        __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 239, __pyx_L3_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        __Pyx_INCREF(Py_None);
+        __Pyx_GIVEREF(Py_None);
+        PyTuple_SET_ITEM(__pyx_t_2, 0, Py_None);
+        __Pyx_GIVEREF(__pyx_t_3);
+        PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3);
+        __pyx_t_3 = 0;
+        __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6gevent_8resolver_5cares_result), __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 239, __pyx_L3_error)
+        __Pyx_GOTREF(__pyx_t_3);
+        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+        __Pyx_INCREF(__pyx_v_callback);
+        __pyx_t_2 = __pyx_v_callback; __pyx_t_12 = NULL;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
+          __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_2);
+          if (likely(__pyx_t_12)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+            __Pyx_INCREF(__pyx_t_12);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_2, function);
+          }
+        }
+        __pyx_t_1 = (__pyx_t_12) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_12, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
+        __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 239, __pyx_L3_error)
+        __Pyx_GOTREF(__pyx_t_1);
+        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
 240:         else:
+
+241:             if c_node:
+
      /*else*/ {
+        __pyx_t_7 = (__pyx_v_c_node != 0);
+        if (__pyx_t_7) {
+/* … */
+          goto __pyx_L10;
+        }
+
+242:                 node = PyUnicode_FromString(c_node)
+
          __pyx_t_1 = PyUnicode_FromString(__pyx_v_c_node); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 242, __pyx_L3_error)
+          __Pyx_GOTREF(__pyx_t_1);
+          __pyx_v_node = __pyx_t_1;
+          __pyx_t_1 = 0;
+
 243:             else:
+
+244:                 node = None
+
        /*else*/ {
+          __Pyx_INCREF(Py_None);
+          __pyx_v_node = Py_None;
+        }
+        __pyx_L10:;
+
+245:             if c_service:
+
        __pyx_t_7 = (__pyx_v_c_service != 0);
+        if (__pyx_t_7) {
+/* … */
+          goto __pyx_L11;
+        }
+
+246:                 service = PyUnicode_FromString(c_service)
+
          __pyx_t_1 = PyUnicode_FromString(__pyx_v_c_service); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 246, __pyx_L3_error)
+          __Pyx_GOTREF(__pyx_t_1);
+          __pyx_v_service = __pyx_t_1;
+          __pyx_t_1 = 0;
+
 247:             else:
+
+248:                 service = None
+
        /*else*/ {
+          __Pyx_INCREF(Py_None);
+          __pyx_v_service = Py_None;
+        }
+        __pyx_L11:;
+
+249:             callback(result((node, service)))
+
        __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 249, __pyx_L3_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        __Pyx_INCREF(__pyx_v_node);
+        __Pyx_GIVEREF(__pyx_v_node);
+        PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_node);
+        __Pyx_INCREF(__pyx_v_service);
+        __Pyx_GIVEREF(__pyx_v_service);
+        PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_service);
+        __pyx_t_3 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_6gevent_8resolver_5cares_result), __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 249, __pyx_L3_error)
+        __Pyx_GOTREF(__pyx_t_3);
+        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+        __Pyx_INCREF(__pyx_v_callback);
+        __pyx_t_2 = __pyx_v_callback; __pyx_t_12 = NULL;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
+          __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_2);
+          if (likely(__pyx_t_12)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+            __Pyx_INCREF(__pyx_t_12);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_2, function);
+          }
+        }
+        __pyx_t_1 = (__pyx_t_12) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_12, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
+        __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 249, __pyx_L3_error)
+        __Pyx_GOTREF(__pyx_t_1);
+        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      }
+      __pyx_L9:;
+
+250:     except:
+
    /*except:*/ {
+      __Pyx_AddTraceback("gevent.resolver.cares.gevent_ares_nameinfo_callback", __pyx_clineno, __pyx_lineno, __pyx_filename);
+      if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3) < 0) __PYX_ERR(0, 250, __pyx_L5_except_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      __Pyx_GOTREF(__pyx_t_2);
+      __Pyx_GOTREF(__pyx_t_3);
+
+251:         channel.loop.handle_error(callback, *sys.exc_info())
+
      __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_channel->loop, __pyx_n_s_handle_error); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 251, __pyx_L5_except_error)
+      __Pyx_GOTREF(__pyx_t_12);
+      __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 251, __pyx_L5_except_error)
+      __Pyx_GOTREF(__pyx_t_10);
+      __Pyx_INCREF(__pyx_v_callback);
+      __Pyx_GIVEREF(__pyx_v_callback);
+      PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v_callback);
+      __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_sys); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 251, __pyx_L5_except_error)
+      __Pyx_GOTREF(__pyx_t_9);
+      __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_exc_info); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 251, __pyx_L5_except_error)
+      __Pyx_GOTREF(__pyx_t_13);
+      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+      __pyx_t_9 = NULL;
+      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_13))) {
+        __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_13);
+        if (likely(__pyx_t_9)) {
+          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13);
+          __Pyx_INCREF(__pyx_t_9);
+          __Pyx_INCREF(function);
+          __Pyx_DECREF_SET(__pyx_t_13, function);
+        }
+      }
+      __pyx_t_8 = (__pyx_t_9) ? __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_t_9) : __Pyx_PyObject_CallNoArg(__pyx_t_13);
+      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
+      if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 251, __pyx_L5_except_error)
+      __Pyx_GOTREF(__pyx_t_8);
+      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+      __pyx_t_13 = __Pyx_PySequence_Tuple(__pyx_t_8); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 251, __pyx_L5_except_error)
+      __Pyx_GOTREF(__pyx_t_13);
+      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+      __pyx_t_8 = PyNumber_Add(__pyx_t_10, __pyx_t_13); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 251, __pyx_L5_except_error)
+      __Pyx_GOTREF(__pyx_t_8);
+      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+      __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_8, NULL); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 251, __pyx_L5_except_error)
+      __Pyx_GOTREF(__pyx_t_13);
+      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
+      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+      goto __pyx_L4_exception_handled;
+    }
+    __pyx_L5_except_error:;
+
 252: 
+
 253: 
+
+254: cdef class channel:
+
struct __pyx_obj_6gevent_8resolver_5cares_channel {
+  PyObject_HEAD
+  struct __pyx_vtabstruct_6gevent_8resolver_5cares_channel *__pyx_vtab;
+  PyObject *loop;
+  struct ares_channeldata *channel;
+  PyObject *_watchers;
+  PyObject *_timer;
+};
+
+
+
+struct __pyx_vtabstruct_6gevent_8resolver_5cares_channel {
+  PyObject *(*set_servers)(struct __pyx_obj_6gevent_8resolver_5cares_channel *, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_8resolver_5cares_7channel_set_servers *__pyx_optional_args);
+  PyObject *(*_sock_state_callback)(struct __pyx_obj_6gevent_8resolver_5cares_channel *, int, int, int);
+  PyObject *(*_getnameinfo)(struct __pyx_obj_6gevent_8resolver_5cares_channel *, PyObject *, PyObject *, int, int __pyx_skip_dispatch);
+};
+static struct __pyx_vtabstruct_6gevent_8resolver_5cares_channel *__pyx_vtabptr_6gevent_8resolver_5cares_channel;
+
 255: 
+
+256:     cdef public object loop
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_4loop_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_4loop_1__get__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_8resolver_5cares_7channel_4loop___get__(((struct __pyx_obj_6gevent_8resolver_5cares_channel *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_8resolver_5cares_7channel_4loop___get__(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __Pyx_INCREF(__pyx_v_self->loop);
+  __pyx_r = __pyx_v_self->loop;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static int __pyx_pw_6gevent_8resolver_5cares_7channel_4loop_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
+static int __pyx_pw_6gevent_8resolver_5cares_7channel_4loop_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_8resolver_5cares_7channel_4loop_2__set__(((struct __pyx_obj_6gevent_8resolver_5cares_channel *)__pyx_v_self), ((PyObject *)__pyx_v_value));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_8resolver_5cares_7channel_4loop_2__set__(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self, PyObject *__pyx_v_value) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__set__", 0);
+  __Pyx_INCREF(__pyx_v_value);
+  __Pyx_GIVEREF(__pyx_v_value);
+  __Pyx_GOTREF(__pyx_v_self->loop);
+  __Pyx_DECREF(__pyx_v_self->loop);
+  __pyx_v_self->loop = __pyx_v_value;
+
+  /* function exit code */
+  __pyx_r = 0;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static int __pyx_pw_6gevent_8resolver_5cares_7channel_4loop_5__del__(PyObject *__pyx_v_self); /*proto*/
+static int __pyx_pw_6gevent_8resolver_5cares_7channel_4loop_5__del__(PyObject *__pyx_v_self) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_8resolver_5cares_7channel_4loop_4__del__(((struct __pyx_obj_6gevent_8resolver_5cares_channel *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_8resolver_5cares_7channel_4loop_4__del__(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__del__", 0);
+  __Pyx_INCREF(Py_None);
+  __Pyx_GIVEREF(Py_None);
+  __Pyx_GOTREF(__pyx_v_self->loop);
+  __Pyx_DECREF(__pyx_v_self->loop);
+  __pyx_v_self->loop = Py_None;
+
+  /* function exit code */
+  __pyx_r = 0;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
 257:     cdef ares_channeldata* channel
+
+258:     cdef public dict _watchers
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_9_watchers_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_9_watchers_1__get__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_8resolver_5cares_7channel_9_watchers___get__(((struct __pyx_obj_6gevent_8resolver_5cares_channel *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_8resolver_5cares_7channel_9_watchers___get__(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __Pyx_INCREF(__pyx_v_self->_watchers);
+  __pyx_r = __pyx_v_self->_watchers;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static int __pyx_pw_6gevent_8resolver_5cares_7channel_9_watchers_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
+static int __pyx_pw_6gevent_8resolver_5cares_7channel_9_watchers_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_8resolver_5cares_7channel_9_watchers_2__set__(((struct __pyx_obj_6gevent_8resolver_5cares_channel *)__pyx_v_self), ((PyObject *)__pyx_v_value));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_8resolver_5cares_7channel_9_watchers_2__set__(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self, PyObject *__pyx_v_value) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__set__", 0);
+  if (!(likely(PyDict_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_v_value)->tp_name), 0))) __PYX_ERR(0, 258, __pyx_L1_error)
+  __pyx_t_1 = __pyx_v_value;
+  __Pyx_INCREF(__pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_1);
+  __Pyx_GOTREF(__pyx_v_self->_watchers);
+  __Pyx_DECREF(__pyx_v_self->_watchers);
+  __pyx_v_self->_watchers = ((PyObject*)__pyx_t_1);
+  __pyx_t_1 = 0;
+
+  /* function exit code */
+  __pyx_r = 0;
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.resolver.cares.channel._watchers.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = -1;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static int __pyx_pw_6gevent_8resolver_5cares_7channel_9_watchers_5__del__(PyObject *__pyx_v_self); /*proto*/
+static int __pyx_pw_6gevent_8resolver_5cares_7channel_9_watchers_5__del__(PyObject *__pyx_v_self) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_8resolver_5cares_7channel_9_watchers_4__del__(((struct __pyx_obj_6gevent_8resolver_5cares_channel *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_8resolver_5cares_7channel_9_watchers_4__del__(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__del__", 0);
+  __Pyx_INCREF(Py_None);
+  __Pyx_GIVEREF(Py_None);
+  __Pyx_GOTREF(__pyx_v_self->_watchers);
+  __Pyx_DECREF(__pyx_v_self->_watchers);
+  __pyx_v_self->_watchers = ((PyObject*)Py_None);
+
+  /* function exit code */
+  __pyx_r = 0;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+259:     cdef public object _timer
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_6_timer_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_6_timer_1__get__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_8resolver_5cares_7channel_6_timer___get__(((struct __pyx_obj_6gevent_8resolver_5cares_channel *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_8resolver_5cares_7channel_6_timer___get__(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __Pyx_INCREF(__pyx_v_self->_timer);
+  __pyx_r = __pyx_v_self->_timer;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static int __pyx_pw_6gevent_8resolver_5cares_7channel_6_timer_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
+static int __pyx_pw_6gevent_8resolver_5cares_7channel_6_timer_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_8resolver_5cares_7channel_6_timer_2__set__(((struct __pyx_obj_6gevent_8resolver_5cares_channel *)__pyx_v_self), ((PyObject *)__pyx_v_value));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_8resolver_5cares_7channel_6_timer_2__set__(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self, PyObject *__pyx_v_value) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__set__", 0);
+  __Pyx_INCREF(__pyx_v_value);
+  __Pyx_GIVEREF(__pyx_v_value);
+  __Pyx_GOTREF(__pyx_v_self->_timer);
+  __Pyx_DECREF(__pyx_v_self->_timer);
+  __pyx_v_self->_timer = __pyx_v_value;
+
+  /* function exit code */
+  __pyx_r = 0;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static int __pyx_pw_6gevent_8resolver_5cares_7channel_6_timer_5__del__(PyObject *__pyx_v_self); /*proto*/
+static int __pyx_pw_6gevent_8resolver_5cares_7channel_6_timer_5__del__(PyObject *__pyx_v_self) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_8resolver_5cares_7channel_6_timer_4__del__(((struct __pyx_obj_6gevent_8resolver_5cares_channel *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_8resolver_5cares_7channel_6_timer_4__del__(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__del__", 0);
+  __Pyx_INCREF(Py_None);
+  __Pyx_GIVEREF(Py_None);
+  __Pyx_GOTREF(__pyx_v_self->_timer);
+  __Pyx_DECREF(__pyx_v_self->_timer);
+  __pyx_v_self->_timer = Py_None;
+
+  /* function exit code */
+  __pyx_r = 0;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
 260: 
+
+261:     def __init__(self, object loop, flags=None, timeout=None, tries=None, ndots=None,
+
/* Python wrapper */
+static int __pyx_pw_6gevent_8resolver_5cares_7channel_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static int __pyx_pw_6gevent_8resolver_5cares_7channel_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_loop = 0;
+  PyObject *__pyx_v_flags = 0;
+  PyObject *__pyx_v_timeout = 0;
+  PyObject *__pyx_v_tries = 0;
+  PyObject *__pyx_v_ndots = 0;
+  PyObject *__pyx_v_udp_port = 0;
+  PyObject *__pyx_v_tcp_port = 0;
+  PyObject *__pyx_v_servers = 0;
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_loop,&__pyx_n_s_flags,&__pyx_n_s_timeout,&__pyx_n_s_tries,&__pyx_n_s_ndots,&__pyx_n_s_udp_port,&__pyx_n_s_tcp_port,&__pyx_n_s_servers,0};
+    PyObject* values[8] = {0,0,0,0,0,0,0,0};
+    values[1] = ((PyObject *)Py_None);
+    values[2] = ((PyObject *)Py_None);
+    values[3] = ((PyObject *)Py_None);
+    values[4] = ((PyObject *)Py_None);
+/* … */
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_6gevent_8resolver_5cares_7channel___init__(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self, PyObject *__pyx_v_loop, PyObject *__pyx_v_flags, PyObject *__pyx_v_timeout, PyObject *__pyx_v_tries, PyObject *__pyx_v_ndots, PyObject *__pyx_v_udp_port, PyObject *__pyx_v_tcp_port, PyObject *__pyx_v_servers) {
+  struct ares_channeldata *__pyx_v_channel;
+  struct ares_options __pyx_v_options;
+  int __pyx_v_optmask;
+  int __pyx_v_result;
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__init__", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = 0;
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_7);
+  __Pyx_XDECREF(__pyx_t_8);
+  __Pyx_XDECREF(__pyx_t_9);
+  __Pyx_XDECREF(__pyx_t_10);
+  __Pyx_XDECREF(__pyx_t_11);
+  __Pyx_AddTraceback("gevent.resolver.cares.channel.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = -1;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+262:                  udp_port=None, tcp_port=None, servers=None):
+
    values[5] = ((PyObject *)Py_None);
+    values[6] = ((PyObject *)Py_None);
+    values[7] = ((PyObject *)Py_None);
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
+        CYTHON_FALLTHROUGH;
+        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
+        CYTHON_FALLTHROUGH;
+        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
+        CYTHON_FALLTHROUGH;
+        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
+        CYTHON_FALLTHROUGH;
+        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
+        CYTHON_FALLTHROUGH;
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_loop)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flags);
+          if (value) { values[1] = value; kw_args--; }
+        }
+        CYTHON_FALLTHROUGH;
+        case  2:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_timeout);
+          if (value) { values[2] = value; kw_args--; }
+        }
+        CYTHON_FALLTHROUGH;
+        case  3:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tries);
+          if (value) { values[3] = value; kw_args--; }
+        }
+        CYTHON_FALLTHROUGH;
+        case  4:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ndots);
+          if (value) { values[4] = value; kw_args--; }
+        }
+        CYTHON_FALLTHROUGH;
+        case  5:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_udp_port);
+          if (value) { values[5] = value; kw_args--; }
+        }
+        CYTHON_FALLTHROUGH;
+        case  6:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tcp_port);
+          if (value) { values[6] = value; kw_args--; }
+        }
+        CYTHON_FALLTHROUGH;
+        case  7:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_servers);
+          if (value) { values[7] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 261, __pyx_L3_error)
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
+        CYTHON_FALLTHROUGH;
+        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
+        CYTHON_FALLTHROUGH;
+        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
+        CYTHON_FALLTHROUGH;
+        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
+        CYTHON_FALLTHROUGH;
+        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
+        CYTHON_FALLTHROUGH;
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    __pyx_v_loop = values[0];
+    __pyx_v_flags = values[1];
+    __pyx_v_timeout = values[2];
+    __pyx_v_tries = values[3];
+    __pyx_v_ndots = values[4];
+    __pyx_v_udp_port = values[5];
+    __pyx_v_tcp_port = values[6];
+    __pyx_v_servers = values[7];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 8, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 261, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.resolver.cares.channel.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return -1;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_8resolver_5cares_7channel___init__(((struct __pyx_obj_6gevent_8resolver_5cares_channel *)__pyx_v_self), __pyx_v_loop, __pyx_v_flags, __pyx_v_timeout, __pyx_v_tries, __pyx_v_ndots, __pyx_v_udp_port, __pyx_v_tcp_port, __pyx_v_servers);
+
+263:         cdef ares_channeldata* channel = NULL
+
  __pyx_v_channel = NULL;
+
 264:         cdef cares.ares_options options
+
+265:         memset(&options, 0, sizeof(cares.ares_options))
+
  memset((&__pyx_v_options), 0, (sizeof(struct ares_options)));
+
+266:         cdef int optmask = cares.ARES_OPT_SOCK_STATE_CB
+
  __pyx_v_optmask = ARES_OPT_SOCK_STATE_CB;
+
+267:         options.sock_state_cb = <void*>gevent_sock_state_callback
+
  __pyx_v_options.sock_state_cb = ((void *)__pyx_f_6gevent_8resolver_5cares_gevent_sock_state_callback);
+
+268:         options.sock_state_cb_data = <void*>self
+
  __pyx_v_options.sock_state_cb_data = ((void *)__pyx_v_self);
+
+269:         if flags is not None:
+
  __pyx_t_1 = (__pyx_v_flags != Py_None);
+  __pyx_t_2 = (__pyx_t_1 != 0);
+  if (__pyx_t_2) {
+/* … */
+  }
+
+270:             options.flags = int(flags)
+
    __pyx_t_3 = __Pyx_PyNumber_Int(__pyx_v_flags); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 270, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 270, __pyx_L1_error)
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __pyx_v_options.flags = __pyx_t_4;
+
+271:             optmask |= cares.ARES_OPT_FLAGS
+
    __pyx_v_optmask = (__pyx_v_optmask | ARES_OPT_FLAGS);
+
+272:         if timeout is not None:
+
  __pyx_t_2 = (__pyx_v_timeout != Py_None);
+  __pyx_t_1 = (__pyx_t_2 != 0);
+  if (__pyx_t_1) {
+/* … */
+  }
+
+273:             options.timeout = int(float(timeout) * 1000)
+
    __pyx_t_5 = __Pyx_PyObject_AsDouble(__pyx_v_timeout); if (unlikely(__pyx_t_5 == ((double)((double)-1)) && PyErr_Occurred())) __PYX_ERR(0, 273, __pyx_L1_error)
+    __pyx_v_options.timeout = ((int)(__pyx_t_5 * 1000.0));
+
+274:             optmask |= cares.ARES_OPT_TIMEOUTMS
+
    __pyx_v_optmask = (__pyx_v_optmask | ARES_OPT_TIMEOUTMS);
+
+275:         if tries is not None:
+
  __pyx_t_1 = (__pyx_v_tries != Py_None);
+  __pyx_t_2 = (__pyx_t_1 != 0);
+  if (__pyx_t_2) {
+/* … */
+  }
+
+276:             options.tries = int(tries)
+
    __pyx_t_3 = __Pyx_PyNumber_Int(__pyx_v_tries); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 276, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 276, __pyx_L1_error)
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __pyx_v_options.tries = __pyx_t_4;
+
+277:             optmask |= cares.ARES_OPT_TRIES
+
    __pyx_v_optmask = (__pyx_v_optmask | ARES_OPT_TRIES);
+
+278:         if ndots is not None:
+
  __pyx_t_2 = (__pyx_v_ndots != Py_None);
+  __pyx_t_1 = (__pyx_t_2 != 0);
+  if (__pyx_t_1) {
+/* … */
+  }
+
+279:             options.ndots = int(ndots)
+
    __pyx_t_3 = __Pyx_PyNumber_Int(__pyx_v_ndots); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 279, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 279, __pyx_L1_error)
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __pyx_v_options.ndots = __pyx_t_4;
+
+280:             optmask |= cares.ARES_OPT_NDOTS
+
    __pyx_v_optmask = (__pyx_v_optmask | ARES_OPT_NDOTS);
+
+281:         if udp_port is not None:
+
  __pyx_t_1 = (__pyx_v_udp_port != Py_None);
+  __pyx_t_2 = (__pyx_t_1 != 0);
+  if (__pyx_t_2) {
+/* … */
+  }
+
+282:             options.udp_port = int(udp_port)
+
    __pyx_t_3 = __Pyx_PyNumber_Int(__pyx_v_udp_port); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 282, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __pyx_t_6 = __Pyx_PyInt_As_unsigned_short(__pyx_t_3); if (unlikely((__pyx_t_6 == (unsigned short)-1) && PyErr_Occurred())) __PYX_ERR(0, 282, __pyx_L1_error)
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __pyx_v_options.udp_port = __pyx_t_6;
+
+283:             optmask |= cares.ARES_OPT_UDP_PORT
+
    __pyx_v_optmask = (__pyx_v_optmask | ARES_OPT_UDP_PORT);
+
+284:         if tcp_port is not None:
+
  __pyx_t_2 = (__pyx_v_tcp_port != Py_None);
+  __pyx_t_1 = (__pyx_t_2 != 0);
+  if (__pyx_t_1) {
+/* … */
+  }
+
+285:             options.tcp_port = int(tcp_port)
+
    __pyx_t_3 = __Pyx_PyNumber_Int(__pyx_v_tcp_port); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 285, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __pyx_t_6 = __Pyx_PyInt_As_unsigned_short(__pyx_t_3); if (unlikely((__pyx_t_6 == (unsigned short)-1) && PyErr_Occurred())) __PYX_ERR(0, 285, __pyx_L1_error)
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __pyx_v_options.tcp_port = __pyx_t_6;
+
+286:             optmask |= cares.ARES_OPT_TCP_PORT
+
    __pyx_v_optmask = (__pyx_v_optmask | ARES_OPT_TCP_PORT);
+
+287:         cdef int result = cares.ares_library_init(cares.ARES_LIB_INIT_ALL)  # ARES_LIB_INIT_WIN32 -DUSE_WINSOCK?
+
  __pyx_v_result = ares_library_init(ARES_LIB_INIT_ALL);
+
+288:         if result:
+
  __pyx_t_1 = (__pyx_v_result != 0);
+  if (unlikely(__pyx_t_1)) {
+/* … */
+  }
+
+289:             raise gaierror(result, strerror(result))
+
    __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_gaierror); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 289, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_7);
+    __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_result); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 289, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_8);
+    __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_result); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 289, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_9);
+    __pyx_t_10 = __pyx_f_6gevent_8resolver_5cares_strerror(__pyx_t_9, 0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 289, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_10);
+    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+    __pyx_t_9 = NULL;
+    __pyx_t_4 = 0;
+    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
+      __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_7);
+      if (likely(__pyx_t_9)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
+        __Pyx_INCREF(__pyx_t_9);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_7, function);
+        __pyx_t_4 = 1;
+      }
+    }
+    #if CYTHON_FAST_PYCALL
+    if (PyFunction_Check(__pyx_t_7)) {
+      PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_t_8, __pyx_t_10};
+      __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 289, __pyx_L1_error)
+      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
+      __Pyx_GOTREF(__pyx_t_3);
+      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+    } else
+    #endif
+    #if CYTHON_FAST_PYCCALL
+    if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
+      PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_t_8, __pyx_t_10};
+      __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 289, __pyx_L1_error)
+      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
+      __Pyx_GOTREF(__pyx_t_3);
+      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+    } else
+    #endif
+    {
+      __pyx_t_11 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 289, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_11);
+      if (__pyx_t_9) {
+        __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_9); __pyx_t_9 = NULL;
+      }
+      __Pyx_GIVEREF(__pyx_t_8);
+      PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_4, __pyx_t_8);
+      __Pyx_GIVEREF(__pyx_t_10);
+      PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_4, __pyx_t_10);
+      __pyx_t_8 = 0;
+      __pyx_t_10 = 0;
+      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_11, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 289, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_3);
+      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+    }
+    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __PYX_ERR(0, 289, __pyx_L1_error)
+
+290:         result = cares.ares_init_options(&channel, &options, optmask)
+
  __pyx_v_result = ares_init_options((&__pyx_v_channel), (&__pyx_v_options), __pyx_v_optmask);
+
+291:         if result:
+
  __pyx_t_1 = (__pyx_v_result != 0);
+  if (unlikely(__pyx_t_1)) {
+/* … */
+  }
+
+292:             raise gaierror(result, strerror(result))
+
    __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_gaierror); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 292, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_7);
+    __pyx_t_11 = __Pyx_PyInt_From_int(__pyx_v_result); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 292, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_11);
+    __pyx_t_10 = __Pyx_PyInt_From_int(__pyx_v_result); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 292, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_10);
+    __pyx_t_8 = __pyx_f_6gevent_8resolver_5cares_strerror(__pyx_t_10, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 292, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_8);
+    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+    __pyx_t_10 = NULL;
+    __pyx_t_4 = 0;
+    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
+      __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_7);
+      if (likely(__pyx_t_10)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
+        __Pyx_INCREF(__pyx_t_10);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_7, function);
+        __pyx_t_4 = 1;
+      }
+    }
+    #if CYTHON_FAST_PYCALL
+    if (PyFunction_Check(__pyx_t_7)) {
+      PyObject *__pyx_temp[3] = {__pyx_t_10, __pyx_t_11, __pyx_t_8};
+      __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 292, __pyx_L1_error)
+      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
+      __Pyx_GOTREF(__pyx_t_3);
+      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+    } else
+    #endif
+    #if CYTHON_FAST_PYCCALL
+    if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
+      PyObject *__pyx_temp[3] = {__pyx_t_10, __pyx_t_11, __pyx_t_8};
+      __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 292, __pyx_L1_error)
+      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
+      __Pyx_GOTREF(__pyx_t_3);
+      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+    } else
+    #endif
+    {
+      __pyx_t_9 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 292, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_9);
+      if (__pyx_t_10) {
+        __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_10); __pyx_t_10 = NULL;
+      }
+      __Pyx_GIVEREF(__pyx_t_11);
+      PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_4, __pyx_t_11);
+      __Pyx_GIVEREF(__pyx_t_8);
+      PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_4, __pyx_t_8);
+      __pyx_t_11 = 0;
+      __pyx_t_8 = 0;
+      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 292, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_3);
+      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+    }
+    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __PYX_ERR(0, 292, __pyx_L1_error)
+
+293:         self._timer = loop.timer(TIMEOUT, TIMEOUT)
+
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_loop, __pyx_n_s_timer); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 293, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_7);
+  __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_TIMEOUT); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 293, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_9);
+  __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_TIMEOUT); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 293, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_8);
+  __pyx_t_11 = NULL;
+  __pyx_t_4 = 0;
+  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
+    __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_7);
+    if (likely(__pyx_t_11)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
+      __Pyx_INCREF(__pyx_t_11);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_7, function);
+      __pyx_t_4 = 1;
+    }
+  }
+  #if CYTHON_FAST_PYCALL
+  if (PyFunction_Check(__pyx_t_7)) {
+    PyObject *__pyx_temp[3] = {__pyx_t_11, __pyx_t_9, __pyx_t_8};
+    __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 293, __pyx_L1_error)
+    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+  } else
+  #endif
+  #if CYTHON_FAST_PYCCALL
+  if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
+    PyObject *__pyx_temp[3] = {__pyx_t_11, __pyx_t_9, __pyx_t_8};
+    __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 293, __pyx_L1_error)
+    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+  } else
+  #endif
+  {
+    __pyx_t_10 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 293, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_10);
+    if (__pyx_t_11) {
+      __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_11); __pyx_t_11 = NULL;
+    }
+    __Pyx_GIVEREF(__pyx_t_9);
+    PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_4, __pyx_t_9);
+    __Pyx_GIVEREF(__pyx_t_8);
+    PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_4, __pyx_t_8);
+    __pyx_t_9 = 0;
+    __pyx_t_8 = 0;
+    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_10, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 293, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+  }
+  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __Pyx_GIVEREF(__pyx_t_3);
+  __Pyx_GOTREF(__pyx_v_self->_timer);
+  __Pyx_DECREF(__pyx_v_self->_timer);
+  __pyx_v_self->_timer = __pyx_t_3;
+  __pyx_t_3 = 0;
+
+294:         self._watchers = {}
+
  __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 294, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_GIVEREF(__pyx_t_3);
+  __Pyx_GOTREF(__pyx_v_self->_watchers);
+  __Pyx_DECREF(__pyx_v_self->_watchers);
+  __pyx_v_self->_watchers = ((PyObject*)__pyx_t_3);
+  __pyx_t_3 = 0;
+
+295:         self.channel = channel
+
  __pyx_v_self->channel = __pyx_v_channel;
+
+296:         try:
+
  {
+    /*try:*/ {
+/* … */
+    }
+    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
+    __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
+    __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
+    goto __pyx_L16_try_end;
+    __pyx_L11_error:;
+    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
+    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
+    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
+    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
+    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+/* … */
+    __Pyx_XGIVEREF(__pyx_t_12);
+    __Pyx_XGIVEREF(__pyx_t_13);
+    __Pyx_XGIVEREF(__pyx_t_14);
+    __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14);
+    goto __pyx_L1_error;
+    __pyx_L16_try_end:;
+  }
+
+297:             if servers is not None:
+
      __pyx_t_1 = (__pyx_v_servers != Py_None);
+      __pyx_t_2 = (__pyx_t_1 != 0);
+      if (__pyx_t_2) {
+/* … */
+      }
+
+298:                 self.set_servers(servers)
+
        __pyx_t_15.__pyx_n = 1;
+        __pyx_t_15.servers = __pyx_v_servers;
+        __pyx_t_3 = ((struct __pyx_vtabstruct_6gevent_8resolver_5cares_channel *)__pyx_v_self->__pyx_vtab)->set_servers(__pyx_v_self, 0, &__pyx_t_15); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 298, __pyx_L11_error)
+        __Pyx_GOTREF(__pyx_t_3);
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+
+299:             self.loop = loop
+
      __Pyx_INCREF(__pyx_v_loop);
+      __Pyx_GIVEREF(__pyx_v_loop);
+      __Pyx_GOTREF(__pyx_v_self->loop);
+      __Pyx_DECREF(__pyx_v_self->loop);
+      __pyx_v_self->loop = __pyx_v_loop;
+
+300:         except:
+
    /*except:*/ {
+      __Pyx_AddTraceback("gevent.resolver.cares.channel.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+      if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_7, &__pyx_t_10) < 0) __PYX_ERR(0, 300, __pyx_L13_except_error)
+      __Pyx_GOTREF(__pyx_t_3);
+      __Pyx_GOTREF(__pyx_t_7);
+      __Pyx_GOTREF(__pyx_t_10);
+
+301:             self.destroy()
+
      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_destroy); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 301, __pyx_L13_except_error)
+      __Pyx_GOTREF(__pyx_t_9);
+      __pyx_t_11 = NULL;
+      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
+        __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_9);
+        if (likely(__pyx_t_11)) {
+          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
+          __Pyx_INCREF(__pyx_t_11);
+          __Pyx_INCREF(function);
+          __Pyx_DECREF_SET(__pyx_t_9, function);
+        }
+      }
+      __pyx_t_8 = (__pyx_t_11) ? __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_11) : __Pyx_PyObject_CallNoArg(__pyx_t_9);
+      __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
+      if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 301, __pyx_L13_except_error)
+      __Pyx_GOTREF(__pyx_t_8);
+      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+
+302:             raise
+
      __Pyx_GIVEREF(__pyx_t_3);
+      __Pyx_GIVEREF(__pyx_t_7);
+      __Pyx_XGIVEREF(__pyx_t_10);
+      __Pyx_ErrRestoreWithState(__pyx_t_3, __pyx_t_7, __pyx_t_10);
+      __pyx_t_3 = 0; __pyx_t_7 = 0; __pyx_t_10 = 0; 
+      __PYX_ERR(0, 302, __pyx_L13_except_error)
+    }
+    __pyx_L13_except_error:;
+
 303: 
+
+304:     def __repr__(self):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_3__repr__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_3__repr__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_8resolver_5cares_7channel_2__repr__(((struct __pyx_obj_6gevent_8resolver_5cares_channel *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_8resolver_5cares_7channel_2__repr__(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self) {
+  PyObject *__pyx_v_args = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__repr__", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_AddTraceback("gevent.resolver.cares.channel.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_args);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+305:         args = (self.__class__.__name__, id(self), self._timer, len(self._watchers))
+
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 305, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 305, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 305, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_3 = __pyx_v_self->_watchers;
+  __Pyx_INCREF(__pyx_t_3);
+  if (unlikely(__pyx_t_3 == Py_None)) {
+    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
+    __PYX_ERR(0, 305, __pyx_L1_error)
+  }
+  __pyx_t_4 = PyDict_Size(__pyx_t_3); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 305, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 305, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 305, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_5);
+  __Pyx_GIVEREF(__pyx_t_2);
+  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2);
+  __Pyx_GIVEREF(__pyx_t_1);
+  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1);
+  __Pyx_INCREF(__pyx_v_self->_timer);
+  __Pyx_GIVEREF(__pyx_v_self->_timer);
+  PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_self->_timer);
+  __Pyx_GIVEREF(__pyx_t_3);
+  PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_3);
+  __pyx_t_2 = 0;
+  __pyx_t_1 = 0;
+  __pyx_t_3 = 0;
+  __pyx_v_args = ((PyObject*)__pyx_t_5);
+  __pyx_t_5 = 0;
+
+306:         return '<%s at 0x%x _timer=%r _watchers[%s]>' % args
+
  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_s_at_0x_x__timer_r__watchers_s, __pyx_v_args); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 306, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_5);
+  __pyx_r = __pyx_t_5;
+  __pyx_t_5 = 0;
+  goto __pyx_L0;
+
 307: 
+
+308:     def destroy(self):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_5destroy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_5destroy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("destroy (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_8resolver_5cares_7channel_4destroy(((struct __pyx_obj_6gevent_8resolver_5cares_channel *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_8resolver_5cares_7channel_4destroy(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("destroy", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_AddTraceback("gevent.resolver.cares.channel.destroy", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+309:         if self.channel:
+
  __pyx_t_1 = (__pyx_v_self->channel != 0);
+  if (__pyx_t_1) {
+/* … */
+  }
+
 310:             # XXX ares_library_cleanup?
+
+311:             cares.ares_destroy(self.channel)
+
    ares_destroy(__pyx_v_self->channel);
+
+312:             self.channel = NULL
+
    __pyx_v_self->channel = NULL;
+
+313:             self._watchers.clear()
+
    if (unlikely(__pyx_v_self->_watchers == Py_None)) {
+      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "clear");
+      __PYX_ERR(0, 313, __pyx_L1_error)
+    }
+    __pyx_t_2 = __Pyx_PyDict_Clear(__pyx_v_self->_watchers); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 313, __pyx_L1_error)
+
+314:             self._timer.stop()
+
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_timer, __pyx_n_s_stop); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 314, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    __pyx_t_5 = NULL;
+    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
+      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
+      if (likely(__pyx_t_5)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
+        __Pyx_INCREF(__pyx_t_5);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_4, function);
+      }
+    }
+    __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
+    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 314, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+
+315:             self.loop = None
+
    __Pyx_INCREF(Py_None);
+    __Pyx_GIVEREF(Py_None);
+    __Pyx_GOTREF(__pyx_v_self->loop);
+    __Pyx_DECREF(__pyx_v_self->loop);
+    __pyx_v_self->loop = Py_None;
+
 316: 
+
+317:     def __dealloc__(self):
+
/* Python wrapper */
+static void __pyx_pw_6gevent_8resolver_5cares_7channel_7__dealloc__(PyObject *__pyx_v_self); /*proto*/
+static void __pyx_pw_6gevent_8resolver_5cares_7channel_7__dealloc__(PyObject *__pyx_v_self) {
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
+  __pyx_pf_6gevent_8resolver_5cares_7channel_6__dealloc__(((struct __pyx_obj_6gevent_8resolver_5cares_channel *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+}
+
+static void __pyx_pf_6gevent_8resolver_5cares_7channel_6__dealloc__(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self) {
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__dealloc__", 0);
+/* … */
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+}
+
+318:         if self.channel:
+
  __pyx_t_1 = (__pyx_v_self->channel != 0);
+  if (__pyx_t_1) {
+/* … */
+  }
+
 319:             # XXX ares_library_cleanup?
+
+320:             cares.ares_destroy(self.channel)
+
    ares_destroy(__pyx_v_self->channel);
+
+321:             self.channel = NULL
+
    __pyx_v_self->channel = NULL;
+
 322: 
+
+323:     cpdef set_servers(self, servers=None):
+
static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_9set_servers(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_f_6gevent_8resolver_5cares_7channel_set_servers(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_8resolver_5cares_7channel_set_servers *__pyx_optional_args) {
+  PyObject *__pyx_v_servers = ((PyObject *)Py_None);
+  int __pyx_v_length;
+  CYTHON_UNUSED int __pyx_v_result;
+  int __pyx_v_index;
+  char *__pyx_v_string;
+  struct ares_addr_node *__pyx_v_c_servers;
+  PyObject *__pyx_v_server = NULL;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("set_servers", 0);
+  if (__pyx_optional_args) {
+    if (__pyx_optional_args->__pyx_n > 0) {
+      __pyx_v_servers = __pyx_optional_args->servers;
+    }
+  }
+  __Pyx_INCREF(__pyx_v_servers);
+  /* Check if called by wrapper */
+  if (unlikely(__pyx_skip_dispatch)) ;
+  /* Check if overridden in Python */
+  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
+    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
+    if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
+    else {
+      PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      #endif
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_servers); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 323, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_8resolver_5cares_7channel_9set_servers)) {
+        __Pyx_XDECREF(__pyx_r);
+        __Pyx_INCREF(__pyx_t_1);
+        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+          if (likely(__pyx_t_4)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+            __Pyx_INCREF(__pyx_t_4);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_3, function);
+          }
+        }
+        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_servers) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_servers);
+        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 323, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __pyx_r = __pyx_t_2;
+        __pyx_t_2 = 0;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        goto __pyx_L0;
+      }
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+      tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
+      if (unlikely(type_dict_guard != tp_dict_version)) {
+        tp_dict_version = obj_dict_version = 0;
+      }
+      #endif
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    }
+    #endif
+  }
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_7);
+  __Pyx_AddTraceback("gevent.resolver.cares.channel.set_servers", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_server);
+  __Pyx_XDECREF(__pyx_v_servers);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_9set_servers(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_9set_servers(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_servers = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("set_servers (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_servers,0};
+    PyObject* values[1] = {0};
+    values[0] = ((PyObject *)Py_None);
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_servers);
+          if (value) { values[0] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_servers") < 0)) __PYX_ERR(0, 323, __pyx_L3_error)
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    __pyx_v_servers = values[0];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("set_servers", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 323, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.resolver.cares.channel.set_servers", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_8resolver_5cares_7channel_8set_servers(((struct __pyx_obj_6gevent_8resolver_5cares_channel *)__pyx_v_self), __pyx_v_servers);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_8resolver_5cares_7channel_8set_servers(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self, PyObject *__pyx_v_servers) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("set_servers", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_2.__pyx_n = 1;
+  __pyx_t_2.servers = __pyx_v_servers;
+  __pyx_t_1 = __pyx_vtabptr_6gevent_8resolver_5cares_channel->set_servers(__pyx_v_self, 1, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 323, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.resolver.cares.channel.set_servers", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+struct __pyx_opt_args_6gevent_8resolver_5cares_7channel_set_servers {
+  int __pyx_n;
+  PyObject *servers;
+};
+
+324:         if not self.channel:
+
  __pyx_t_5 = ((!(__pyx_v_self->channel != 0)) != 0);
+  if (unlikely(__pyx_t_5)) {
+/* … */
+  }
+
+325:             raise gaierror(cares.ARES_EDESTRUCTION, 'this ares channel has been destroyed')
+
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_gaierror); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 325, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_3 = __Pyx_PyInt_From_int(ARES_EDESTRUCTION); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 325, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __pyx_t_4 = NULL;
+    __pyx_t_6 = 0;
+    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
+      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
+      if (likely(__pyx_t_4)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+        __Pyx_INCREF(__pyx_t_4);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_2, function);
+        __pyx_t_6 = 1;
+      }
+    }
+    #if CYTHON_FAST_PYCALL
+    if (PyFunction_Check(__pyx_t_2)) {
+      PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_3, __pyx_kp_s_this_ares_channel_has_been_destr};
+      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 325, __pyx_L1_error)
+      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __Pyx_GOTREF(__pyx_t_1);
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    } else
+    #endif
+    #if CYTHON_FAST_PYCCALL
+    if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
+      PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_3, __pyx_kp_s_this_ares_channel_has_been_destr};
+      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 325, __pyx_L1_error)
+      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __Pyx_GOTREF(__pyx_t_1);
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    } else
+    #endif
+    {
+      __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 325, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_7);
+      if (__pyx_t_4) {
+        __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4); __pyx_t_4 = NULL;
+      }
+      __Pyx_GIVEREF(__pyx_t_3);
+      PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_t_3);
+      __Pyx_INCREF(__pyx_kp_s_this_ares_channel_has_been_destr);
+      __Pyx_GIVEREF(__pyx_kp_s_this_ares_channel_has_been_destr);
+      PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_kp_s_this_ares_channel_has_been_destr);
+      __pyx_t_3 = 0;
+      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 325, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+    }
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __PYX_ERR(0, 325, __pyx_L1_error)
+
+326:         if not servers:
+
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_servers); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 326, __pyx_L1_error)
+  __pyx_t_8 = ((!__pyx_t_5) != 0);
+  if (__pyx_t_8) {
+/* … */
+  }
+
+327:             servers = []
+
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 327, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF_SET(__pyx_v_servers, __pyx_t_1);
+    __pyx_t_1 = 0;
+
+328:         if isinstance(servers, string_types):
+
  __pyx_t_1 = __pyx_v_6gevent_8resolver_5cares_string_types;
+  __Pyx_INCREF(__pyx_t_1);
+  __pyx_t_8 = PyObject_IsInstance(__pyx_v_servers, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 328, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_5 = (__pyx_t_8 != 0);
+  if (__pyx_t_5) {
+/* … */
+  }
+
+329:             servers = servers.split(',')
+
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_servers, __pyx_n_s_split); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 329, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_7 = NULL;
+    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2);
+      if (likely(__pyx_t_7)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+        __Pyx_INCREF(__pyx_t_7);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_2, function);
+      }
+    }
+    __pyx_t_1 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_7, __pyx_kp_s__2) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_kp_s__2);
+    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 329, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __Pyx_DECREF_SET(__pyx_v_servers, __pyx_t_1);
+    __pyx_t_1 = 0;
+
+330:         cdef int length = len(servers)
+
  __pyx_t_9 = PyObject_Length(__pyx_v_servers); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 330, __pyx_L1_error)
+  __pyx_v_length = __pyx_t_9;
+
 331:         cdef int result, index
+
 332:         cdef char* string
+
 333:         cdef cares.ares_addr_node* c_servers
+
+334:         if length <= 0:
+
  __pyx_t_5 = ((__pyx_v_length <= 0) != 0);
+  if (__pyx_t_5) {
+/* … */
+    goto __pyx_L6;
+  }
+
+335:             result = cares.ares_set_servers(self.channel, NULL)
+
    __pyx_v_result = ares_set_servers(__pyx_v_self->channel, NULL);
+
 336:         else:
+
+337:             c_servers = <cares.ares_addr_node*>PyMem_Malloc(sizeof(cares.ares_addr_node) * length)
+
  /*else*/ {
+    __pyx_v_c_servers = ((struct ares_addr_node *)PyMem_Malloc(((sizeof(struct ares_addr_node)) * __pyx_v_length)));
+
+338:             if not c_servers:
+
    __pyx_t_5 = ((!(__pyx_v_c_servers != 0)) != 0);
+    if (unlikely(__pyx_t_5)) {
+/* … */
+    }
+
+339:                 raise MemoryError
+
      PyErr_NoMemory(); __PYX_ERR(0, 339, __pyx_L1_error)
+
+340:             try:
+
    /*try:*/ {
+
+341:                 index = 0
+
      __pyx_v_index = 0;
+
+342:                 for server in servers:
+
      if (likely(PyList_CheckExact(__pyx_v_servers)) || PyTuple_CheckExact(__pyx_v_servers)) {
+        __pyx_t_1 = __pyx_v_servers; __Pyx_INCREF(__pyx_t_1); __pyx_t_9 = 0;
+        __pyx_t_10 = NULL;
+      } else {
+        __pyx_t_9 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_servers); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 342, __pyx_L9_error)
+        __Pyx_GOTREF(__pyx_t_1);
+        __pyx_t_10 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 342, __pyx_L9_error)
+      }
+      for (;;) {
+        if (likely(!__pyx_t_10)) {
+          if (likely(PyList_CheckExact(__pyx_t_1))) {
+            if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_1)) break;
+            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+            __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_9); __Pyx_INCREF(__pyx_t_2); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 342, __pyx_L9_error)
+            #else
+            __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 342, __pyx_L9_error)
+            __Pyx_GOTREF(__pyx_t_2);
+            #endif
+          } else {
+            if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
+            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+            __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_9); __Pyx_INCREF(__pyx_t_2); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 342, __pyx_L9_error)
+            #else
+            __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 342, __pyx_L9_error)
+            __Pyx_GOTREF(__pyx_t_2);
+            #endif
+          }
+        } else {
+          __pyx_t_2 = __pyx_t_10(__pyx_t_1);
+          if (unlikely(!__pyx_t_2)) {
+            PyObject* exc_type = PyErr_Occurred();
+            if (exc_type) {
+              if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+              else __PYX_ERR(0, 342, __pyx_L9_error)
+            }
+            break;
+          }
+          __Pyx_GOTREF(__pyx_t_2);
+        }
+        __Pyx_XDECREF_SET(__pyx_v_server, __pyx_t_2);
+        __pyx_t_2 = 0;
+/* … */
+      }
+      __pyx_L12_break:;
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+343:                     if isinstance(server, unicode):
+
        __pyx_t_5 = PyUnicode_Check(__pyx_v_server); 
+        __pyx_t_8 = (__pyx_t_5 != 0);
+        if (__pyx_t_8) {
+/* … */
+        }
+
+344:                         server = server.encode('ascii')
+
          __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_server, __pyx_n_s_encode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 344, __pyx_L9_error)
+          __Pyx_GOTREF(__pyx_t_7);
+          __pyx_t_3 = NULL;
+          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
+            __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_7);
+            if (likely(__pyx_t_3)) {
+              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
+              __Pyx_INCREF(__pyx_t_3);
+              __Pyx_INCREF(function);
+              __Pyx_DECREF_SET(__pyx_t_7, function);
+            }
+          }
+          __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_3, __pyx_n_s_ascii) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_n_s_ascii);
+          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 344, __pyx_L9_error)
+          __Pyx_GOTREF(__pyx_t_2);
+          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+          __Pyx_DECREF_SET(__pyx_v_server, __pyx_t_2);
+          __pyx_t_2 = 0;
+
+345:                     string = <char*?>server
+
        __pyx_t_11 = __Pyx_PyObject_AsWritableString(__pyx_v_server); if (unlikely((!__pyx_t_11) && PyErr_Occurred())) __PYX_ERR(0, 345, __pyx_L9_error)
+        __pyx_v_string = ((char *)__pyx_t_11);
+
+346:                     if cares.ares_inet_pton(AF_INET, string, &c_servers[index].addr) > 0:
+
        __pyx_t_8 = ((ares_inet_pton(AF_INET, __pyx_v_string, (&(__pyx_v_c_servers[__pyx_v_index]).addr)) > 0) != 0);
+        if (__pyx_t_8) {
+/* … */
+          goto __pyx_L14;
+        }
+
+347:                         c_servers[index].family = AF_INET
+
          (__pyx_v_c_servers[__pyx_v_index]).family = AF_INET;
+
+348:                     elif cares.ares_inet_pton(AF_INET6, string, &c_servers[index].addr) > 0:
+
        __pyx_t_8 = ((ares_inet_pton(AF_INET6, __pyx_v_string, (&(__pyx_v_c_servers[__pyx_v_index]).addr)) > 0) != 0);
+        if (likely(__pyx_t_8)) {
+/* … */
+          goto __pyx_L14;
+        }
+
+349:                         c_servers[index].family = AF_INET6
+
          (__pyx_v_c_servers[__pyx_v_index]).family = AF_INET6;
+
 350:                     else:
+
+351:                         raise InvalidIP(repr(string))
+
        /*else*/ {
+          __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_InvalidIP); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 351, __pyx_L9_error)
+          __Pyx_GOTREF(__pyx_t_7);
+          __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_string); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 351, __pyx_L9_error)
+          __Pyx_GOTREF(__pyx_t_3);
+          __pyx_t_4 = PyObject_Repr(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 351, __pyx_L9_error)
+          __Pyx_GOTREF(__pyx_t_4);
+          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+          __pyx_t_3 = NULL;
+          if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
+            __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_7);
+            if (likely(__pyx_t_3)) {
+              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
+              __Pyx_INCREF(__pyx_t_3);
+              __Pyx_INCREF(function);
+              __Pyx_DECREF_SET(__pyx_t_7, function);
+            }
+          }
+          __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_4);
+          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 351, __pyx_L9_error)
+          __Pyx_GOTREF(__pyx_t_2);
+          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+          __Pyx_Raise(__pyx_t_2, 0, 0, 0);
+          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+          __PYX_ERR(0, 351, __pyx_L9_error)
+        }
+        __pyx_L14:;
+
+352:                     c_servers[index].next = &c_servers[index] + 1
+
        (__pyx_v_c_servers[__pyx_v_index]).next = ((&(__pyx_v_c_servers[__pyx_v_index])) + 1);
+
+353:                     index += 1
+
        __pyx_v_index = (__pyx_v_index + 1);
+
+354:                     if index >= length:
+
        __pyx_t_8 = ((__pyx_v_index >= __pyx_v_length) != 0);
+        if (__pyx_t_8) {
+/* … */
+        }
+
+355:                         break
+
          goto __pyx_L12_break;
+
+356:                 c_servers[length - 1].next = NULL
+
      (__pyx_v_c_servers[(__pyx_v_length - 1)]).next = NULL;
+
+357:                 index = cares.ares_set_servers(self.channel, c_servers)
+
      __pyx_v_index = ares_set_servers(__pyx_v_self->channel, __pyx_v_c_servers);
+
+358:                 if index:
+
      __pyx_t_8 = (__pyx_v_index != 0);
+      if (unlikely(__pyx_t_8)) {
+/* … */
+      }
+    }
+
+359:                     raise ValueError(strerror(index))
+
        __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 359, __pyx_L9_error)
+        __Pyx_GOTREF(__pyx_t_1);
+        __pyx_t_2 = __pyx_f_6gevent_8resolver_5cares_strerror(__pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 359, __pyx_L9_error)
+        __Pyx_GOTREF(__pyx_t_2);
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 359, __pyx_L9_error)
+        __Pyx_GOTREF(__pyx_t_1);
+        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+        __Pyx_Raise(__pyx_t_1, 0, 0, 0);
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        __PYX_ERR(0, 359, __pyx_L9_error)
+
 360:             finally:
+
+361:                 PyMem_Free(c_servers)
+
    /*finally:*/ {
+      /*normal exit:*/{
+        PyMem_Free(__pyx_v_c_servers);
+        goto __pyx_L10;
+      }
+      __pyx_L9_error:;
+      /*exception exit:*/{
+        __Pyx_PyThreadState_declare
+        __Pyx_PyThreadState_assign
+        __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0;
+        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+        if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19);
+        if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_14, &__pyx_t_15, &__pyx_t_16) < 0)) __Pyx_ErrFetch(&__pyx_t_14, &__pyx_t_15, &__pyx_t_16);
+        __Pyx_XGOTREF(__pyx_t_14);
+        __Pyx_XGOTREF(__pyx_t_15);
+        __Pyx_XGOTREF(__pyx_t_16);
+        __Pyx_XGOTREF(__pyx_t_17);
+        __Pyx_XGOTREF(__pyx_t_18);
+        __Pyx_XGOTREF(__pyx_t_19);
+        __pyx_t_6 = __pyx_lineno; __pyx_t_12 = __pyx_clineno; __pyx_t_13 = __pyx_filename;
+        {
+          PyMem_Free(__pyx_v_c_servers);
+        }
+        if (PY_MAJOR_VERSION >= 3) {
+          __Pyx_XGIVEREF(__pyx_t_17);
+          __Pyx_XGIVEREF(__pyx_t_18);
+          __Pyx_XGIVEREF(__pyx_t_19);
+          __Pyx_ExceptionReset(__pyx_t_17, __pyx_t_18, __pyx_t_19);
+        }
+        __Pyx_XGIVEREF(__pyx_t_14);
+        __Pyx_XGIVEREF(__pyx_t_15);
+        __Pyx_XGIVEREF(__pyx_t_16);
+        __Pyx_ErrRestore(__pyx_t_14, __pyx_t_15, __pyx_t_16);
+        __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0;
+        __pyx_lineno = __pyx_t_6; __pyx_clineno = __pyx_t_12; __pyx_filename = __pyx_t_13;
+        goto __pyx_L1_error;
+      }
+      __pyx_L10:;
+    }
+  }
+  __pyx_L6:;
+
 362: 
+
 363:     # this crashes c-ares
+
 364:     #def cancel(self):
+
 365:     #    cares.ares_cancel(self.channel)
+
 366: 
+
+367:     cdef _sock_state_callback(self, int socket, int read, int write):
+
static PyObject *__pyx_f_6gevent_8resolver_5cares_7channel__sock_state_callback(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self, int __pyx_v_socket, int __pyx_v_read, int __pyx_v_write) {
+  PyObject *__pyx_v_watcher = 0;
+  int __pyx_v_events;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_sock_state_callback", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_XDECREF(__pyx_t_6);
+  __Pyx_XDECREF(__pyx_t_7);
+  __Pyx_XDECREF(__pyx_t_9);
+  __Pyx_AddTraceback("gevent.resolver.cares.channel._sock_state_callback", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_watcher);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+368:         if not self.channel:
+
  __pyx_t_1 = ((!(__pyx_v_self->channel != 0)) != 0);
+  if (__pyx_t_1) {
+/* … */
+  }
+
+369:             return
+
    __Pyx_XDECREF(__pyx_r);
+    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+    goto __pyx_L0;
+
+370:         cdef object watcher = self._watchers.get(socket)
+
  if (unlikely(__pyx_v_self->_watchers == Py_None)) {
+    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get");
+    __PYX_ERR(0, 370, __pyx_L1_error)
+  }
+  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_socket); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 370, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = __Pyx_PyDict_GetItemDefault(__pyx_v_self->_watchers, __pyx_t_2, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 370, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_v_watcher = __pyx_t_3;
+  __pyx_t_3 = 0;
+
+371:         cdef int events = 0
+
  __pyx_v_events = 0;
+
+372:         if read:
+
  __pyx_t_1 = (__pyx_v_read != 0);
+  if (__pyx_t_1) {
+/* … */
+  }
+
+373:             events |= EV_READ
+
    __pyx_v_events = (__pyx_v_events | 1);
+
+374:         if write:
+
  __pyx_t_1 = (__pyx_v_write != 0);
+  if (__pyx_t_1) {
+/* … */
+  }
+
+375:             events |= EV_WRITE
+
    __pyx_v_events = (__pyx_v_events | 2);
+
+376:         if watcher is None:
+
  __pyx_t_1 = (__pyx_v_watcher == Py_None);
+  __pyx_t_4 = (__pyx_t_1 != 0);
+  if (__pyx_t_4) {
+/* … */
+    goto __pyx_L6;
+  }
+
+377:             if not events:
+
    __pyx_t_4 = ((!(__pyx_v_events != 0)) != 0);
+    if (__pyx_t_4) {
+/* … */
+    }
+
+378:                 return
+
      __Pyx_XDECREF(__pyx_r);
+      __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+      goto __pyx_L0;
+
+379:             watcher = self.loop.io(socket, events)
+
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->loop, __pyx_n_s_io); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 379, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_socket); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 379, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_5);
+    __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_events); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 379, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_6);
+    __pyx_t_7 = NULL;
+    __pyx_t_8 = 0;
+    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2);
+      if (likely(__pyx_t_7)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+        __Pyx_INCREF(__pyx_t_7);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_2, function);
+        __pyx_t_8 = 1;
+      }
+    }
+    #if CYTHON_FAST_PYCALL
+    if (PyFunction_Check(__pyx_t_2)) {
+      PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_5, __pyx_t_6};
+      __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 379, __pyx_L1_error)
+      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+      __Pyx_GOTREF(__pyx_t_3);
+      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+    } else
+    #endif
+    #if CYTHON_FAST_PYCCALL
+    if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
+      PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_5, __pyx_t_6};
+      __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 379, __pyx_L1_error)
+      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+      __Pyx_GOTREF(__pyx_t_3);
+      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+    } else
+    #endif
+    {
+      __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 379, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_9);
+      if (__pyx_t_7) {
+        __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
+      }
+      __Pyx_GIVEREF(__pyx_t_5);
+      PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_5);
+      __Pyx_GIVEREF(__pyx_t_6);
+      PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_t_6);
+      __pyx_t_5 = 0;
+      __pyx_t_6 = 0;
+      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 379, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_3);
+      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+    }
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __Pyx_DECREF_SET(__pyx_v_watcher, __pyx_t_3);
+    __pyx_t_3 = 0;
+
+380:             self._watchers[socket] = watcher
+
    if (unlikely(__pyx_v_self->_watchers == Py_None)) {
+      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
+      __PYX_ERR(0, 380, __pyx_L1_error)
+    }
+    __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_socket); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 380, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    if (unlikely(PyDict_SetItem(__pyx_v_self->_watchers, __pyx_t_3, __pyx_v_watcher) < 0)) __PYX_ERR(0, 380, __pyx_L1_error)
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+
+381:         elif events:
+
  __pyx_t_4 = (__pyx_v_events != 0);
+  if (__pyx_t_4) {
+/* … */
+    goto __pyx_L6;
+  }
+
+382:             if watcher.events == events:
+
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_watcher, __pyx_n_s_events); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 382, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_events); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 382, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_9 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 382, __pyx_L1_error)
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 382, __pyx_L1_error)
+    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+    if (__pyx_t_4) {
+/* … */
+    }
+
+383:                 return
+
      __Pyx_XDECREF(__pyx_r);
+      __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+      goto __pyx_L0;
+
+384:             watcher.stop()
+
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_watcher, __pyx_n_s_stop); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 384, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_3 = NULL;
+    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+      if (likely(__pyx_t_3)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+        __Pyx_INCREF(__pyx_t_3);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_2, function);
+      }
+    }
+    __pyx_t_9 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
+    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+    if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 384, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_9);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+
+385:             watcher.events = events
+
    __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_events); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 385, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_9);
+    if (__Pyx_PyObject_SetAttrStr(__pyx_v_watcher, __pyx_n_s_events, __pyx_t_9) < 0) __PYX_ERR(0, 385, __pyx_L1_error)
+    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+
 386:         else:
+
+387:             watcher.stop()
+
  /*else*/ {
+    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_watcher, __pyx_n_s_stop); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 387, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_3 = NULL;
+    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+      if (likely(__pyx_t_3)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+        __Pyx_INCREF(__pyx_t_3);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_2, function);
+      }
+    }
+    __pyx_t_9 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
+    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+    if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 387, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_9);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+
+388:             watcher.close()
+
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_watcher, __pyx_n_s_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 388, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_3 = NULL;
+    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+      if (likely(__pyx_t_3)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+        __Pyx_INCREF(__pyx_t_3);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_2, function);
+      }
+    }
+    __pyx_t_9 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
+    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+    if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 388, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_9);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+
+389:             self._watchers.pop(socket, None)
+
    if (unlikely(__pyx_v_self->_watchers == Py_None)) {
+      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "pop");
+      __PYX_ERR(0, 389, __pyx_L1_error)
+    }
+    __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_socket); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 389, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_9);
+    __pyx_t_2 = __Pyx_PyDict_Pop(__pyx_v_self->_watchers, __pyx_t_9, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 389, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+390:             if not self._watchers:
+
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_self->_watchers); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 390, __pyx_L1_error)
+    __pyx_t_1 = ((!__pyx_t_4) != 0);
+    if (__pyx_t_1) {
+/* … */
+    }
+
+391:                 self._timer.stop()
+
      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_timer, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 391, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_9);
+      __pyx_t_3 = NULL;
+      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
+        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9);
+        if (likely(__pyx_t_3)) {
+          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
+          __Pyx_INCREF(__pyx_t_3);
+          __Pyx_INCREF(function);
+          __Pyx_DECREF_SET(__pyx_t_9, function);
+        }
+      }
+      __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_9);
+      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 391, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_2);
+      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+392:             return
+
    __Pyx_XDECREF(__pyx_r);
+    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+    goto __pyx_L0;
+  }
+  __pyx_L6:;
+
+393:         watcher.start(self._process_fd, watcher, pass_events=True)
+
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_watcher, __pyx_n_s_start); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 393, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_process_fd); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 393, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_9);
+  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 393, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_GIVEREF(__pyx_t_9);
+  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_9);
+  __Pyx_INCREF(__pyx_v_watcher);
+  __Pyx_GIVEREF(__pyx_v_watcher);
+  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_watcher);
+  __pyx_t_9 = 0;
+  __pyx_t_9 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 393, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_9);
+  if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_pass_events, Py_True) < 0) __PYX_ERR(0, 393, __pyx_L1_error)
+  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_9); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 393, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+
+394:         self._timer.again(self._on_timer)
+
  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_timer, __pyx_n_s_again); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 394, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_9);
+  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_on_timer); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 394, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __pyx_t_2 = NULL;
+  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
+    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_9);
+    if (likely(__pyx_t_2)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
+      __Pyx_INCREF(__pyx_t_2);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_9, function);
+    }
+  }
+  __pyx_t_6 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 394, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+
 395: 
+
+396:     def _on_timer(self):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_11_on_timer(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_11_on_timer(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_on_timer (wrapper)", 0);
+  __pyx_r = __pyx_pf_6gevent_8resolver_5cares_7channel_10_on_timer(((struct __pyx_obj_6gevent_8resolver_5cares_channel *)__pyx_v_self));
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_8resolver_5cares_7channel_10_on_timer(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_on_timer", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+397:         cares.ares_process_fd(self.channel, cares.ARES_SOCKET_BAD, cares.ARES_SOCKET_BAD)
+
  ares_process_fd(__pyx_v_self->channel, ARES_SOCKET_BAD, ARES_SOCKET_BAD);
+
 398: 
+
+399:     def _process_fd(self, int events, object watcher):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_13_process_fd(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_13_process_fd(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  int __pyx_v_events;
+  PyObject *__pyx_v_watcher = 0;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_process_fd (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_events,&__pyx_n_s_watcher,0};
+    PyObject* values[2] = {0,0};
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_events)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_watcher)) != 0)) kw_args--;
+        else {
+          __Pyx_RaiseArgtupleInvalid("_process_fd", 1, 2, 2, 1); __PYX_ERR(0, 399, __pyx_L3_error)
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_process_fd") < 0)) __PYX_ERR(0, 399, __pyx_L3_error)
+      }
+    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
+      goto __pyx_L5_argtuple_error;
+    } else {
+      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+    }
+    __pyx_v_events = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_events == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 399, __pyx_L3_error)
+    __pyx_v_watcher = values[1];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("_process_fd", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 399, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.resolver.cares.channel._process_fd", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_8resolver_5cares_7channel_12_process_fd(((struct __pyx_obj_6gevent_8resolver_5cares_channel *)__pyx_v_self), __pyx_v_events, __pyx_v_watcher);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_8resolver_5cares_7channel_12_process_fd(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self, int __pyx_v_events, PyObject *__pyx_v_watcher) {
+  int __pyx_v_read_fd;
+  int __pyx_v_write_fd;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_process_fd", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_AddTraceback("gevent.resolver.cares.channel._process_fd", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+400:         if not self.channel:
+
  __pyx_t_1 = ((!(__pyx_v_self->channel != 0)) != 0);
+  if (__pyx_t_1) {
+/* … */
+  }
+
+401:             return
+
    __Pyx_XDECREF(__pyx_r);
+    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+    goto __pyx_L0;
+
+402:         cdef int read_fd = watcher.fd
+
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_watcher, __pyx_n_s_fd); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 402, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 402, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_v_read_fd = __pyx_t_3;
+
+403:         cdef int write_fd = read_fd
+
  __pyx_v_write_fd = __pyx_v_read_fd;
+
+404:         if not (events & EV_READ):
+
  __pyx_t_1 = ((!((__pyx_v_events & 1) != 0)) != 0);
+  if (__pyx_t_1) {
+/* … */
+  }
+
+405:             read_fd = cares.ARES_SOCKET_BAD
+
    __pyx_v_read_fd = ARES_SOCKET_BAD;
+
+406:         if not (events & EV_WRITE):
+
  __pyx_t_1 = ((!((__pyx_v_events & 2) != 0)) != 0);
+  if (__pyx_t_1) {
+/* … */
+  }
+
+407:             write_fd = cares.ARES_SOCKET_BAD
+
    __pyx_v_write_fd = ARES_SOCKET_BAD;
+
+408:         cares.ares_process_fd(self.channel, read_fd, write_fd)
+
  ares_process_fd(__pyx_v_self->channel, __pyx_v_read_fd, __pyx_v_write_fd);
+
 409: 
+
+410:     def gethostbyname(self, object callback, char* name, int family=AF_INET):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_15gethostbyname(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_15gethostbyname(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_callback = 0;
+  char *__pyx_v_name;
+  int __pyx_v_family;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("gethostbyname (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_callback,&__pyx_n_s_name_2,&__pyx_n_s_family,0};
+    PyObject* values[3] = {0,0,0};
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_callback)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name_2)) != 0)) kw_args--;
+        else {
+          __Pyx_RaiseArgtupleInvalid("gethostbyname", 0, 2, 3, 1); __PYX_ERR(0, 410, __pyx_L3_error)
+        }
+        CYTHON_FALLTHROUGH;
+        case  2:
+        if (kw_args > 0) {
+          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_family);
+          if (value) { values[2] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "gethostbyname") < 0)) __PYX_ERR(0, 410, __pyx_L3_error)
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    __pyx_v_callback = values[0];
+    __pyx_v_name = __Pyx_PyObject_AsWritableString(values[1]); if (unlikely((!__pyx_v_name) && PyErr_Occurred())) __PYX_ERR(0, 410, __pyx_L3_error)
+    if (values[2]) {
+      __pyx_v_family = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_family == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 410, __pyx_L3_error)
+    } else {
+      __pyx_v_family = __pyx_k__3;
+    }
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("gethostbyname", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 410, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.resolver.cares.channel.gethostbyname", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_8resolver_5cares_7channel_14gethostbyname(((struct __pyx_obj_6gevent_8resolver_5cares_channel *)__pyx_v_self), __pyx_v_callback, __pyx_v_name, __pyx_v_family);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_8resolver_5cares_7channel_14gethostbyname(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self, PyObject *__pyx_v_callback, char *__pyx_v_name, int __pyx_v_family) {
+  PyObject *__pyx_v_arg = 0;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("gethostbyname", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_XDECREF(__pyx_t_7);
+  __Pyx_AddTraceback("gevent.resolver.cares.channel.gethostbyname", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_arg);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+/* … */
+  __pyx_k__3 = AF_INET;
+
+411:         if not self.channel:
+
  __pyx_t_1 = ((!(__pyx_v_self->channel != 0)) != 0);
+  if (unlikely(__pyx_t_1)) {
+/* … */
+  }
+
+412:             raise gaierror(cares.ARES_EDESTRUCTION, 'this ares channel has been destroyed')
+
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_gaierror); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 412, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __pyx_t_4 = __Pyx_PyInt_From_int(ARES_EDESTRUCTION); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 412, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    __pyx_t_5 = NULL;
+    __pyx_t_6 = 0;
+    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
+      if (likely(__pyx_t_5)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+        __Pyx_INCREF(__pyx_t_5);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_3, function);
+        __pyx_t_6 = 1;
+      }
+    }
+    #if CYTHON_FAST_PYCALL
+    if (PyFunction_Check(__pyx_t_3)) {
+      PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_4, __pyx_kp_s_this_ares_channel_has_been_destr};
+      __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 412, __pyx_L1_error)
+      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+      __Pyx_GOTREF(__pyx_t_2);
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    } else
+    #endif
+    #if CYTHON_FAST_PYCCALL
+    if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
+      PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_4, __pyx_kp_s_this_ares_channel_has_been_destr};
+      __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 412, __pyx_L1_error)
+      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+      __Pyx_GOTREF(__pyx_t_2);
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    } else
+    #endif
+    {
+      __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 412, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_7);
+      if (__pyx_t_5) {
+        __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
+      }
+      __Pyx_GIVEREF(__pyx_t_4);
+      PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_t_4);
+      __Pyx_INCREF(__pyx_kp_s_this_ares_channel_has_been_destr);
+      __Pyx_GIVEREF(__pyx_kp_s_this_ares_channel_has_been_destr);
+      PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_kp_s_this_ares_channel_has_been_destr);
+      __pyx_t_4 = 0;
+      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 412, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_2);
+      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+    }
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __PYX_ERR(0, 412, __pyx_L1_error)
+
 413:         # note that for file lookups still AF_INET can be returned for AF_INET6 request
+
+414:         cdef object arg = (self, callback)
+
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 414, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(((PyObject *)__pyx_v_self));
+  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
+  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self));
+  __Pyx_INCREF(__pyx_v_callback);
+  __Pyx_GIVEREF(__pyx_v_callback);
+  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_callback);
+  __pyx_v_arg = __pyx_t_2;
+  __pyx_t_2 = 0;
+
+415:         Py_INCREF(arg)
+
  Py_INCREF(__pyx_v_arg);
+
+416:         cares.ares_gethostbyname(self.channel, name, family, <void*>gevent_ares_host_callback, <void*>arg)
+
  ares_gethostbyname(__pyx_v_self->channel, __pyx_v_name, __pyx_v_family, ((void *)__pyx_f_6gevent_8resolver_5cares_gevent_ares_host_callback), ((void *)__pyx_v_arg));
+
 417: 
+
+418:     def gethostbyaddr(self, object callback, char* addr):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_17gethostbyaddr(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_17gethostbyaddr(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_callback = 0;
+  char *__pyx_v_addr;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("gethostbyaddr (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_callback,&__pyx_n_s_addr,0};
+    PyObject* values[2] = {0,0};
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_callback)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_addr)) != 0)) kw_args--;
+        else {
+          __Pyx_RaiseArgtupleInvalid("gethostbyaddr", 1, 2, 2, 1); __PYX_ERR(0, 418, __pyx_L3_error)
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "gethostbyaddr") < 0)) __PYX_ERR(0, 418, __pyx_L3_error)
+      }
+    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
+      goto __pyx_L5_argtuple_error;
+    } else {
+      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+    }
+    __pyx_v_callback = values[0];
+    __pyx_v_addr = __Pyx_PyObject_AsWritableString(values[1]); if (unlikely((!__pyx_v_addr) && PyErr_Occurred())) __PYX_ERR(0, 418, __pyx_L3_error)
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("gethostbyaddr", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 418, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.resolver.cares.channel.gethostbyaddr", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_r = __pyx_pf_6gevent_8resolver_5cares_7channel_16gethostbyaddr(((struct __pyx_obj_6gevent_8resolver_5cares_channel *)__pyx_v_self), __pyx_v_callback, __pyx_v_addr);
+
+  /* function exit code */
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_8resolver_5cares_7channel_16gethostbyaddr(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self, PyObject *__pyx_v_callback, char *__pyx_v_addr) {
+  char __pyx_v_addr_packed[16];
+  int __pyx_v_family;
+  int __pyx_v_length;
+  PyObject *__pyx_v_arg = 0;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("gethostbyaddr", 0);
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_XDECREF(__pyx_t_7);
+  __Pyx_AddTraceback("gevent.resolver.cares.channel.gethostbyaddr", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_arg);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+419:         if not self.channel:
+
  __pyx_t_1 = ((!(__pyx_v_self->channel != 0)) != 0);
+  if (unlikely(__pyx_t_1)) {
+/* … */
+  }
+
+420:             raise gaierror(cares.ARES_EDESTRUCTION, 'this ares channel has been destroyed')
+
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_gaierror); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 420, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __pyx_t_4 = __Pyx_PyInt_From_int(ARES_EDESTRUCTION); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 420, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    __pyx_t_5 = NULL;
+    __pyx_t_6 = 0;
+    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
+      if (likely(__pyx_t_5)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+        __Pyx_INCREF(__pyx_t_5);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_3, function);
+        __pyx_t_6 = 1;
+      }
+    }
+    #if CYTHON_FAST_PYCALL
+    if (PyFunction_Check(__pyx_t_3)) {
+      PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_4, __pyx_kp_s_this_ares_channel_has_been_destr};
+      __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 420, __pyx_L1_error)
+      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+      __Pyx_GOTREF(__pyx_t_2);
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    } else
+    #endif
+    #if CYTHON_FAST_PYCCALL
+    if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
+      PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_4, __pyx_kp_s_this_ares_channel_has_been_destr};
+      __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 420, __pyx_L1_error)
+      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+      __Pyx_GOTREF(__pyx_t_2);
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    } else
+    #endif
+    {
+      __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 420, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_7);
+      if (__pyx_t_5) {
+        __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
+      }
+      __Pyx_GIVEREF(__pyx_t_4);
+      PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_t_4);
+      __Pyx_INCREF(__pyx_kp_s_this_ares_channel_has_been_destr);
+      __Pyx_GIVEREF(__pyx_kp_s_this_ares_channel_has_been_destr);
+      PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_kp_s_this_ares_channel_has_been_destr);
+      __pyx_t_4 = 0;
+      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 420, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_2);
+      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+    }
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __PYX_ERR(0, 420, __pyx_L1_error)
+
 421:         # will guess the family
+
 422:         cdef char addr_packed[16]
+
 423:         cdef int family
+
 424:         cdef int length
+
+425:         if cares.ares_inet_pton(AF_INET, addr, addr_packed) > 0:
+
  __pyx_t_1 = ((ares_inet_pton(AF_INET, __pyx_v_addr, __pyx_v_addr_packed) > 0) != 0);
+  if (__pyx_t_1) {
+/* … */
+    goto __pyx_L4;
+  }
+
+426:             family = AF_INET
+
    __pyx_v_family = AF_INET;
+
+427:             length = 4
+
    __pyx_v_length = 4;
+
+428:         elif cares.ares_inet_pton(AF_INET6, addr, addr_packed) > 0:
+
  __pyx_t_1 = ((ares_inet_pton(AF_INET6, __pyx_v_addr, __pyx_v_addr_packed) > 0) != 0);
+  if (likely(__pyx_t_1)) {
+/* … */
+    goto __pyx_L4;
+  }
+
+429:             family = AF_INET6
+
    __pyx_v_family = AF_INET6;
+
+430:             length = 16
+
    __pyx_v_length = 16;
+
 431:         else:
+
+432:             raise InvalidIP(repr(addr))
+
  /*else*/ {
+    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_InvalidIP); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 432, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __pyx_t_7 = __Pyx_PyBytes_FromString(__pyx_v_addr); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 432, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_7);
+    __pyx_t_4 = PyObject_Repr(__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 432, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+    __pyx_t_7 = NULL;
+    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3);
+      if (likely(__pyx_t_7)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+        __Pyx_INCREF(__pyx_t_7);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_3, function);
+      }
+    }
+    __pyx_t_2 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_7, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4);
+    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 432, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __PYX_ERR(0, 432, __pyx_L1_error)
+  }
+  __pyx_L4:;
+
+433:         cdef object arg = (self, callback)
+
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 433, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(((PyObject *)__pyx_v_self));
+  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
+  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self));
+  __Pyx_INCREF(__pyx_v_callback);
+  __Pyx_GIVEREF(__pyx_v_callback);
+  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_callback);
+  __pyx_v_arg = __pyx_t_2;
+  __pyx_t_2 = 0;
+
+434:         Py_INCREF(arg)
+
  Py_INCREF(__pyx_v_arg);
+
+435:         cares.ares_gethostbyaddr(self.channel, addr_packed, length, family, <void*>gevent_ares_host_callback, <void*>arg)
+
  ares_gethostbyaddr(__pyx_v_self->channel, __pyx_v_addr_packed, __pyx_v_length, __pyx_v_family, ((void *)__pyx_f_6gevent_8resolver_5cares_gevent_ares_host_callback), ((void *)__pyx_v_arg));
+
 436: 
+
+437:     cpdef _getnameinfo(self, object callback, tuple sockaddr, int flags):
+
static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_19_getnameinfo(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_f_6gevent_8resolver_5cares_7channel__getnameinfo(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self, PyObject *__pyx_v_callback, PyObject *__pyx_v_sockaddr, int __pyx_v_flags, int __pyx_skip_dispatch) {
+  char *__pyx_v_hostp;
+  int __pyx_v_port;
+  int __pyx_v_flowinfo;
+  int __pyx_v_scope_id;
+  struct sockaddr_in6 __pyx_v_sa6;
+  int __pyx_v_length;
+  PyObject *__pyx_v_arg = 0;
+  struct sockaddr *__pyx_v_x;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_getnameinfo", 0);
+  /* Check if called by wrapper */
+  if (unlikely(__pyx_skip_dispatch)) ;
+  /* Check if overridden in Python */
+  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
+    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    static PY_UINT64_T tp_dict_version = 0, obj_dict_version = 0;
+    if (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict && tp_dict_version == __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) && (!Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset || obj_dict_version == __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))))));
+    else {
+      PY_UINT64_T type_dict_guard = (likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict)) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      #endif
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getnameinfo); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 437, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_8resolver_5cares_7channel_19_getnameinfo)) {
+        __Pyx_XDECREF(__pyx_r);
+        __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 437, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_3);
+        __Pyx_INCREF(__pyx_t_1);
+        __pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL;
+        __pyx_t_6 = 0;
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
+          __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
+          if (likely(__pyx_t_5)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
+            __Pyx_INCREF(__pyx_t_5);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_4, function);
+            __pyx_t_6 = 1;
+          }
+        }
+        #if CYTHON_FAST_PYCALL
+        if (PyFunction_Check(__pyx_t_4)) {
+          PyObject *__pyx_temp[4] = {__pyx_t_5, __pyx_v_callback, __pyx_v_sockaddr, __pyx_t_3};
+          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 437, __pyx_L1_error)
+          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+          __Pyx_GOTREF(__pyx_t_2);
+          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        } else
+        #endif
+        #if CYTHON_FAST_PYCCALL
+        if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
+          PyObject *__pyx_temp[4] = {__pyx_t_5, __pyx_v_callback, __pyx_v_sockaddr, __pyx_t_3};
+          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 437, __pyx_L1_error)
+          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+          __Pyx_GOTREF(__pyx_t_2);
+          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+        } else
+        #endif
+        {
+          __pyx_t_7 = PyTuple_New(3+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 437, __pyx_L1_error)
+          __Pyx_GOTREF(__pyx_t_7);
+          if (__pyx_t_5) {
+            __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
+          }
+          __Pyx_INCREF(__pyx_v_callback);
+          __Pyx_GIVEREF(__pyx_v_callback);
+          PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_v_callback);
+          __Pyx_INCREF(__pyx_v_sockaddr);
+          __Pyx_GIVEREF(__pyx_v_sockaddr);
+          PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_sockaddr);
+          __Pyx_GIVEREF(__pyx_t_3);
+          PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_6, __pyx_t_3);
+          __pyx_t_3 = 0;
+          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 437, __pyx_L1_error)
+          __Pyx_GOTREF(__pyx_t_2);
+          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+        }
+        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+        __pyx_r = __pyx_t_2;
+        __pyx_t_2 = 0;
+        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+        goto __pyx_L0;
+      }
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+      tp_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) ? __PYX_GET_DICT_VERSION(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dict) : 0;
+      obj_dict_version = likely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset) ? __PYX_GET_DICT_VERSION(_PyObject_GetDictPtr(((PyObject *)__pyx_v_self))) : 0;
+      if (unlikely(type_dict_guard != tp_dict_version)) {
+        tp_dict_version = obj_dict_version = 0;
+      }
+      #endif
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP
+    }
+    #endif
+  }
+/* … */
+  /* function exit code */
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_XDECREF(__pyx_t_7);
+  __Pyx_AddTraceback("gevent.resolver.cares.channel._getnameinfo", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_arg);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_19_getnameinfo(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_19_getnameinfo(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_callback = 0;
+  PyObject *__pyx_v_sockaddr = 0;
+  int __pyx_v_flags;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_getnameinfo (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_callback,&__pyx_n_s_sockaddr,&__pyx_n_s_flags,0};
+    PyObject* values[3] = {0,0,0};
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_callback)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_sockaddr)) != 0)) kw_args--;
+        else {
+          __Pyx_RaiseArgtupleInvalid("_getnameinfo", 1, 3, 3, 1); __PYX_ERR(0, 437, __pyx_L3_error)
+        }
+        CYTHON_FALLTHROUGH;
+        case  2:
+        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flags)) != 0)) kw_args--;
+        else {
+          __Pyx_RaiseArgtupleInvalid("_getnameinfo", 1, 3, 3, 2); __PYX_ERR(0, 437, __pyx_L3_error)
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_getnameinfo") < 0)) __PYX_ERR(0, 437, __pyx_L3_error)
+      }
+    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
+      goto __pyx_L5_argtuple_error;
+    } else {
+      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+    }
+    __pyx_v_callback = values[0];
+    __pyx_v_sockaddr = ((PyObject*)values[1]);
+    __pyx_v_flags = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 437, __pyx_L3_error)
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("_getnameinfo", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 437, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.resolver.cares.channel._getnameinfo", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sockaddr), (&PyTuple_Type), 1, "sockaddr", 1))) __PYX_ERR(0, 437, __pyx_L1_error)
+  __pyx_r = __pyx_pf_6gevent_8resolver_5cares_7channel_18_getnameinfo(((struct __pyx_obj_6gevent_8resolver_5cares_channel *)__pyx_v_self), __pyx_v_callback, __pyx_v_sockaddr, __pyx_v_flags);
+
+  /* function exit code */
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_8resolver_5cares_7channel_18_getnameinfo(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self, PyObject *__pyx_v_callback, PyObject *__pyx_v_sockaddr, int __pyx_v_flags) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("_getnameinfo", 0);
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __pyx_f_6gevent_8resolver_5cares_7channel__getnameinfo(__pyx_v_self, __pyx_v_callback, __pyx_v_sockaddr, __pyx_v_flags, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 437, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("gevent.resolver.cares.channel._getnameinfo", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+438:         if not self.channel:
+
  __pyx_t_8 = ((!(__pyx_v_self->channel != 0)) != 0);
+  if (unlikely(__pyx_t_8)) {
+/* … */
+  }
+
+439:             raise gaierror(cares.ARES_EDESTRUCTION, 'this ares channel has been destroyed')
+
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_gaierror); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 439, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_4 = __Pyx_PyInt_From_int(ARES_EDESTRUCTION); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 439, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    __pyx_t_7 = NULL;
+    __pyx_t_6 = 0;
+    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
+      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2);
+      if (likely(__pyx_t_7)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+        __Pyx_INCREF(__pyx_t_7);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_2, function);
+        __pyx_t_6 = 1;
+      }
+    }
+    #if CYTHON_FAST_PYCALL
+    if (PyFunction_Check(__pyx_t_2)) {
+      PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_4, __pyx_kp_s_this_ares_channel_has_been_destr};
+      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 439, __pyx_L1_error)
+      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+      __Pyx_GOTREF(__pyx_t_1);
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    } else
+    #endif
+    #if CYTHON_FAST_PYCCALL
+    if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
+      PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_4, __pyx_kp_s_this_ares_channel_has_been_destr};
+      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 439, __pyx_L1_error)
+      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+      __Pyx_GOTREF(__pyx_t_1);
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    } else
+    #endif
+    {
+      __pyx_t_3 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 439, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_3);
+      if (__pyx_t_7) {
+        __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_7); __pyx_t_7 = NULL;
+      }
+      __Pyx_GIVEREF(__pyx_t_4);
+      PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_6, __pyx_t_4);
+      __Pyx_INCREF(__pyx_kp_s_this_ares_channel_has_been_destr);
+      __Pyx_GIVEREF(__pyx_kp_s_this_ares_channel_has_been_destr);
+      PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_6, __pyx_kp_s_this_ares_channel_has_been_destr);
+      __pyx_t_4 = 0;
+      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 439, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    }
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __PYX_ERR(0, 439, __pyx_L1_error)
+
+440:         cdef char* hostp = NULL
+
  __pyx_v_hostp = NULL;
+
+441:         cdef int port = 0
+
  __pyx_v_port = 0;
+
+442:         cdef int flowinfo = 0
+
  __pyx_v_flowinfo = 0;
+
+443:         cdef int scope_id = 0
+
  __pyx_v_scope_id = 0;
+
 444:         cdef sockaddr_in6 sa6
+
+445:         if not PyTuple_Check(sockaddr):
+
  __pyx_t_8 = ((!(PyTuple_Check(__pyx_v_sockaddr) != 0)) != 0);
+  if (unlikely(__pyx_t_8)) {
+/* … */
+  }
+
+446:             raise TypeError('expected a tuple, got %r' % (sockaddr, ))
+
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 446, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_INCREF(__pyx_v_sockaddr);
+    __Pyx_GIVEREF(__pyx_v_sockaddr);
+    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_sockaddr);
+    __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_expected_a_tuple_got_r, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 446, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 446, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __PYX_ERR(0, 446, __pyx_L1_error)
+
+447:         PyArg_ParseTuple(sockaddr, "si|ii", &hostp, &port, &flowinfo, &scope_id)
+
  __pyx_t_6 = PyArg_ParseTuple(__pyx_v_sockaddr, ((char *)"si|ii"), (&__pyx_v_hostp), (&__pyx_v_port), (&__pyx_v_flowinfo), (&__pyx_v_scope_id)); if (unlikely(__pyx_t_6 == ((int)0))) __PYX_ERR(0, 447, __pyx_L1_error)
+
+448:         if port < 0 or port > 65535:
+
  __pyx_t_9 = ((__pyx_v_port < 0) != 0);
+  if (!__pyx_t_9) {
+  } else {
+    __pyx_t_8 = __pyx_t_9;
+    goto __pyx_L6_bool_binop_done;
+  }
+  __pyx_t_9 = ((__pyx_v_port > 0xFFFF) != 0);
+  __pyx_t_8 = __pyx_t_9;
+  __pyx_L6_bool_binop_done:;
+  if (unlikely(__pyx_t_8)) {
+/* … */
+  }
+
+449:             raise gaierror(-8, 'Invalid value for port: %r' % port)
+
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_gaierror); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 449, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_port); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 449, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_value_for_port_r, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 449, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __pyx_t_3 = NULL;
+    __pyx_t_6 = 0;
+    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
+      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+      if (likely(__pyx_t_3)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+        __Pyx_INCREF(__pyx_t_3);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_2, function);
+        __pyx_t_6 = 1;
+      }
+    }
+    #if CYTHON_FAST_PYCALL
+    if (PyFunction_Check(__pyx_t_2)) {
+      PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_int_neg_8, __pyx_t_4};
+      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 449, __pyx_L1_error)
+      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __Pyx_GOTREF(__pyx_t_1);
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    } else
+    #endif
+    #if CYTHON_FAST_PYCCALL
+    if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
+      PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_int_neg_8, __pyx_t_4};
+      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 449, __pyx_L1_error)
+      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+      __Pyx_GOTREF(__pyx_t_1);
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    } else
+    #endif
+    {
+      __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 449, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_7);
+      if (__pyx_t_3) {
+        __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3); __pyx_t_3 = NULL;
+      }
+      __Pyx_INCREF(__pyx_int_neg_8);
+      __Pyx_GIVEREF(__pyx_int_neg_8);
+      PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_int_neg_8);
+      __Pyx_GIVEREF(__pyx_t_4);
+      PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_4);
+      __pyx_t_4 = 0;
+      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 449, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_1);
+      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+    }
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __PYX_ERR(0, 449, __pyx_L1_error)
+
+450:         cdef int length = gevent_make_sockaddr(hostp, port, flowinfo, scope_id, &sa6)
+
  __pyx_v_length = gevent_make_sockaddr(__pyx_v_hostp, __pyx_v_port, __pyx_v_flowinfo, __pyx_v_scope_id, (&__pyx_v_sa6));
+
+451:         if length <= 0:
+
  __pyx_t_8 = ((__pyx_v_length <= 0) != 0);
+  if (unlikely(__pyx_t_8)) {
+/* … */
+  }
+
+452:             raise InvalidIP(repr(hostp))
+
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_InvalidIP); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 452, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_7 = __Pyx_PyBytes_FromString(__pyx_v_hostp); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 452, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_7);
+    __pyx_t_4 = PyObject_Repr(__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 452, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+    __pyx_t_7 = NULL;
+    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
+      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2);
+      if (likely(__pyx_t_7)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+        __Pyx_INCREF(__pyx_t_7);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_2, function);
+      }
+    }
+    __pyx_t_1 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_7, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
+    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 452, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
+    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __PYX_ERR(0, 452, __pyx_L1_error)
+
+453:         cdef object arg = (self, callback)
+
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 453, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_INCREF(((PyObject *)__pyx_v_self));
+  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
+  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self));
+  __Pyx_INCREF(__pyx_v_callback);
+  __Pyx_GIVEREF(__pyx_v_callback);
+  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_callback);
+  __pyx_v_arg = __pyx_t_1;
+  __pyx_t_1 = 0;
+
+454:         Py_INCREF(arg)
+
  Py_INCREF(__pyx_v_arg);
+
+455:         cdef sockaddr_t* x = <sockaddr_t*>&sa6
+
  __pyx_v_x = ((struct sockaddr *)(&__pyx_v_sa6));
+
+456:         cares.ares_getnameinfo(self.channel, x, length, flags, <void*>gevent_ares_nameinfo_callback, <void*>arg)
+
  ares_getnameinfo(__pyx_v_self->channel, __pyx_v_x, __pyx_v_length, __pyx_v_flags, ((void *)__pyx_f_6gevent_8resolver_5cares_gevent_ares_nameinfo_callback), ((void *)__pyx_v_arg));
+
 457: 
+
+458:     def getnameinfo(self, object callback, tuple sockaddr, int flags):
+
/* Python wrapper */
+static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_21getnameinfo(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_21getnameinfo(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_callback = 0;
+  PyObject *__pyx_v_sockaddr = 0;
+  int __pyx_v_flags;
+  PyObject *__pyx_r = 0;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("getnameinfo (wrapper)", 0);
+  {
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_callback,&__pyx_n_s_sockaddr,&__pyx_n_s_flags,0};
+    PyObject* values[3] = {0,0,0};
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+      switch (pos_args) {
+        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+        CYTHON_FALLTHROUGH;
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        CYTHON_FALLTHROUGH;
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        CYTHON_FALLTHROUGH;
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (pos_args) {
+        case  0:
+        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_callback)) != 0)) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+        CYTHON_FALLTHROUGH;
+        case  1:
+        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_sockaddr)) != 0)) kw_args--;
+        else {
+          __Pyx_RaiseArgtupleInvalid("getnameinfo", 1, 3, 3, 1); __PYX_ERR(0, 458, __pyx_L3_error)
+        }
+        CYTHON_FALLTHROUGH;
+        case  2:
+        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flags)) != 0)) kw_args--;
+        else {
+          __Pyx_RaiseArgtupleInvalid("getnameinfo", 1, 3, 3, 2); __PYX_ERR(0, 458, __pyx_L3_error)
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getnameinfo") < 0)) __PYX_ERR(0, 458, __pyx_L3_error)
+      }
+    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
+      goto __pyx_L5_argtuple_error;
+    } else {
+      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+    }
+    __pyx_v_callback = values[0];
+    __pyx_v_sockaddr = ((PyObject*)values[1]);
+    __pyx_v_flags = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 458, __pyx_L3_error)
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("getnameinfo", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 458, __pyx_L3_error)
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("gevent.resolver.cares.channel.getnameinfo", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sockaddr), (&PyTuple_Type), 1, "sockaddr", 1))) __PYX_ERR(0, 458, __pyx_L1_error)
+  __pyx_r = __pyx_pf_6gevent_8resolver_5cares_7channel_20getnameinfo(((struct __pyx_obj_6gevent_8resolver_5cares_channel *)__pyx_v_self), __pyx_v_callback, __pyx_v_sockaddr, __pyx_v_flags);
+
+  /* function exit code */
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6gevent_8resolver_5cares_7channel_20getnameinfo(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self, PyObject *__pyx_v_callback, PyObject *__pyx_v_sockaddr, int __pyx_v_flags) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("getnameinfo", 0);
+/* … */
+  /* function exit code */
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_6);
+  __Pyx_XDECREF(__pyx_t_7);
+  __Pyx_XDECREF(__pyx_t_8);
+  __Pyx_AddTraceback("gevent.resolver.cares.channel.getnameinfo", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+459:         try:
+
  {
+    /*try:*/ {
+/* … */
+    }
+    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+    goto __pyx_L8_try_end;
+    __pyx_L3_error:;
+    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+/* … */
+    __Pyx_XGIVEREF(__pyx_t_1);
+    __Pyx_XGIVEREF(__pyx_t_2);
+    __Pyx_XGIVEREF(__pyx_t_3);
+    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
+    goto __pyx_L1_error;
+    __pyx_L4_exception_handled:;
+    __Pyx_XGIVEREF(__pyx_t_1);
+    __Pyx_XGIVEREF(__pyx_t_2);
+    __Pyx_XGIVEREF(__pyx_t_3);
+    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
+    __pyx_L8_try_end:;
+  }
+
+460:             flags = _convert_cares_flags(flags)
+
      __pyx_t_4 = __pyx_f_6gevent_8resolver_5cares__convert_cares_flags(__pyx_v_flags, 0, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 460, __pyx_L3_error)
+      __Pyx_GOTREF(__pyx_t_4);
+      __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 460, __pyx_L3_error)
+      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __pyx_v_flags = __pyx_t_5;
+
+461:         except gaierror:
+
    __Pyx_ErrFetch(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7);
+    __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_gaierror); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 461, __pyx_L5_except_error)
+    __Pyx_GOTREF(__pyx_t_8);
+    __pyx_t_5 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_4, __pyx_t_8);
+    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+    __Pyx_ErrRestore(__pyx_t_4, __pyx_t_6, __pyx_t_7);
+    __pyx_t_4 = 0; __pyx_t_6 = 0; __pyx_t_7 = 0;
+    if (__pyx_t_5) {
+      __Pyx_AddTraceback("gevent.resolver.cares.channel.getnameinfo", __pyx_clineno, __pyx_lineno, __pyx_filename);
+      if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_6, &__pyx_t_4) < 0) __PYX_ERR(0, 461, __pyx_L5_except_error)
+      __Pyx_GOTREF(__pyx_t_7);
+      __Pyx_GOTREF(__pyx_t_6);
+      __Pyx_GOTREF(__pyx_t_4);
+
 462:             # The stdlib just ignores bad flags
+
+463:             flags = 0
+
      __pyx_v_flags = 0;
+      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+      goto __pyx_L4_exception_handled;
+    }
+    goto __pyx_L5_except_error;
+    __pyx_L5_except_error:;
+
+464:         return self._getnameinfo(callback, sockaddr, flags)
+
  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_4 = ((struct __pyx_vtabstruct_6gevent_8resolver_5cares_channel *)__pyx_v_self->__pyx_vtab)->_getnameinfo(__pyx_v_self, __pyx_v_callback, __pyx_v_sockaddr, __pyx_v_flags, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 464, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_4);
+  __pyx_r = __pyx_t_4;
+  __pyx_t_4 = 0;
+  goto __pyx_L0;
+
diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/resolver/cares.pyx b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/resolver/cares.pyx new file mode 100644 index 00000000..cc43c13d --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/resolver/cares.pyx @@ -0,0 +1,464 @@ +# Copyright (c) 2011-2012 Denis Bilenko. See LICENSE for details. +# Automatic pickling of cdef classes was added in 0.26. Unfortunately it +# seems to be buggy (at least for the `result` class) and produces code that +# can't compile ("local variable 'result' referenced before assignment"). +# See https://github.com/cython/cython/issues/1786 +# cython: auto_pickle=False +cimport libcares as cares +import sys + +from cpython.ref cimport Py_INCREF +from cpython.ref cimport Py_DECREF +from cpython.mem cimport PyMem_Malloc +from cpython.mem cimport PyMem_Free + +from _socket import gaierror + + +__all__ = ['channel'] + +cdef object string_types +cdef object text_type + +if sys.version_info[0] >= 3: + string_types = str, + text_type = str +else: + string_types = __builtins__.basestring, + text_type = __builtins__.unicode + +TIMEOUT = 1 + +DEF EV_READ = 1 +DEF EV_WRITE = 2 + + +cdef extern from "dnshelper.c": + int AF_INET + int AF_INET6 + + struct hostent: + char* h_name + int h_addrtype + + struct sockaddr_t "sockaddr": + pass + + struct ares_channeldata: + pass + + object parse_h_name(hostent*) + object parse_h_aliases(hostent*) + object parse_h_addr_list(hostent*) + void* create_object_from_hostent(void*) + + # this imports _socket lazily + object PyUnicode_FromString(char*) + int PyTuple_Check(object) + int PyArg_ParseTuple(object, char*, ...) except 0 + struct sockaddr_in6: + pass + int gevent_make_sockaddr(char* hostp, int port, int flowinfo, int scope_id, sockaddr_in6* sa6) + + + void memset(void*, int, int) + + +ARES_SUCCESS = cares.ARES_SUCCESS +ARES_ENODATA = cares.ARES_ENODATA +ARES_EFORMERR = cares.ARES_EFORMERR +ARES_ESERVFAIL = cares.ARES_ESERVFAIL +ARES_ENOTFOUND = cares.ARES_ENOTFOUND +ARES_ENOTIMP = cares.ARES_ENOTIMP +ARES_EREFUSED = cares.ARES_EREFUSED +ARES_EBADQUERY = cares.ARES_EBADQUERY +ARES_EBADNAME = cares.ARES_EBADNAME +ARES_EBADFAMILY = cares.ARES_EBADFAMILY +ARES_EBADRESP = cares.ARES_EBADRESP +ARES_ECONNREFUSED = cares.ARES_ECONNREFUSED +ARES_ETIMEOUT = cares.ARES_ETIMEOUT +ARES_EOF = cares.ARES_EOF +ARES_EFILE = cares.ARES_EFILE +ARES_ENOMEM = cares.ARES_ENOMEM +ARES_EDESTRUCTION = cares.ARES_EDESTRUCTION +ARES_EBADSTR = cares.ARES_EBADSTR +ARES_EBADFLAGS = cares.ARES_EBADFLAGS +ARES_ENONAME = cares.ARES_ENONAME +ARES_EBADHINTS = cares.ARES_EBADHINTS +ARES_ENOTINITIALIZED = cares.ARES_ENOTINITIALIZED +ARES_ELOADIPHLPAPI = cares.ARES_ELOADIPHLPAPI +ARES_EADDRGETNETWORKPARAMS = cares.ARES_EADDRGETNETWORKPARAMS +ARES_ECANCELLED = cares.ARES_ECANCELLED + +ARES_FLAG_USEVC = cares.ARES_FLAG_USEVC +ARES_FLAG_PRIMARY = cares.ARES_FLAG_PRIMARY +ARES_FLAG_IGNTC = cares.ARES_FLAG_IGNTC +ARES_FLAG_NORECURSE = cares.ARES_FLAG_NORECURSE +ARES_FLAG_STAYOPEN = cares.ARES_FLAG_STAYOPEN +ARES_FLAG_NOSEARCH = cares.ARES_FLAG_NOSEARCH +ARES_FLAG_NOALIASES = cares.ARES_FLAG_NOALIASES +ARES_FLAG_NOCHECKRESP = cares.ARES_FLAG_NOCHECKRESP + + +_ares_errors = dict([ + (cares.ARES_SUCCESS, 'ARES_SUCCESS'), + (cares.ARES_ENODATA, 'ARES_ENODATA'), + (cares.ARES_EFORMERR, 'ARES_EFORMERR'), + (cares.ARES_ESERVFAIL, 'ARES_ESERVFAIL'), + (cares.ARES_ENOTFOUND, 'ARES_ENOTFOUND'), + (cares.ARES_ENOTIMP, 'ARES_ENOTIMP'), + (cares.ARES_EREFUSED, 'ARES_EREFUSED'), + (cares.ARES_EBADQUERY, 'ARES_EBADQUERY'), + (cares.ARES_EBADNAME, 'ARES_EBADNAME'), + (cares.ARES_EBADFAMILY, 'ARES_EBADFAMILY'), + (cares.ARES_EBADRESP, 'ARES_EBADRESP'), + (cares.ARES_ECONNREFUSED, 'ARES_ECONNREFUSED'), + (cares.ARES_ETIMEOUT, 'ARES_ETIMEOUT'), + (cares.ARES_EOF, 'ARES_EOF'), + (cares.ARES_EFILE, 'ARES_EFILE'), + (cares.ARES_ENOMEM, 'ARES_ENOMEM'), + (cares.ARES_EDESTRUCTION, 'ARES_EDESTRUCTION'), + (cares.ARES_EBADSTR, 'ARES_EBADSTR'), + (cares.ARES_EBADFLAGS, 'ARES_EBADFLAGS'), + (cares.ARES_ENONAME, 'ARES_ENONAME'), + (cares.ARES_EBADHINTS, 'ARES_EBADHINTS'), + (cares.ARES_ENOTINITIALIZED, 'ARES_ENOTINITIALIZED'), + (cares.ARES_ELOADIPHLPAPI, 'ARES_ELOADIPHLPAPI'), + (cares.ARES_EADDRGETNETWORKPARAMS, 'ARES_EADDRGETNETWORKPARAMS'), + (cares.ARES_ECANCELLED, 'ARES_ECANCELLED')]) + + +# maps c-ares flag to _socket module flag +_cares_flag_map = None + + +cdef _prepare_cares_flag_map(): + global _cares_flag_map + import _socket + _cares_flag_map = [ + (getattr(_socket, 'NI_NUMERICHOST', 1), cares.ARES_NI_NUMERICHOST), + (getattr(_socket, 'NI_NUMERICSERV', 2), cares.ARES_NI_NUMERICSERV), + (getattr(_socket, 'NI_NOFQDN', 4), cares.ARES_NI_NOFQDN), + (getattr(_socket, 'NI_NAMEREQD', 8), cares.ARES_NI_NAMEREQD), + (getattr(_socket, 'NI_DGRAM', 16), cares.ARES_NI_DGRAM)] + + +cpdef _convert_cares_flags(int flags, int default=cares.ARES_NI_LOOKUPHOST|cares.ARES_NI_LOOKUPSERVICE): + if _cares_flag_map is None: + _prepare_cares_flag_map() + for socket_flag, cares_flag in _cares_flag_map: + if socket_flag & flags: + default |= cares_flag + flags &= ~socket_flag + if not flags: + return default + raise gaierror(-1, "Bad value for ai_flags: 0x%x" % flags) + + +cpdef strerror(code): + return '%s: %s' % (_ares_errors.get(code) or code, cares.ares_strerror(code)) + + +class InvalidIP(ValueError): + pass + + +cdef void gevent_sock_state_callback(void *data, int s, int read, int write): + if not data: + return + cdef channel ch = data + ch._sock_state_callback(s, read, write) + + +cdef class result: + cdef public object value + cdef public object exception + + def __init__(self, object value=None, object exception=None): + self.value = value + self.exception = exception + + def __repr__(self): + if self.exception is None: + return '%s(%r)' % (self.__class__.__name__, self.value) + elif self.value is None: + return '%s(exception=%r)' % (self.__class__.__name__, self.exception) + else: + return '%s(value=%r, exception=%r)' % (self.__class__.__name__, self.value, self.exception) + # add repr_recursive precaution + + def successful(self): + return self.exception is None + + def get(self): + if self.exception is not None: + raise self.exception + return self.value + + +class ares_host_result(tuple): + + def __new__(cls, family, iterable): + cdef object self = tuple.__new__(cls, iterable) + self.family = family + return self + + def __getnewargs__(self): + return (self.family, tuple(self)) + + +cdef void gevent_ares_host_callback(void *arg, int status, int timeouts, hostent* host): + cdef channel channel + cdef object callback + channel, callback = arg + Py_DECREF(arg) + cdef object host_result + try: + if status or not host: + callback(result(None, gaierror(status, strerror(status)))) + else: + try: + host_result = ares_host_result(host.h_addrtype, (parse_h_name(host), parse_h_aliases(host), parse_h_addr_list(host))) + except: + callback(result(None, sys.exc_info()[1])) + else: + callback(result(host_result)) + except: + channel.loop.handle_error(callback, *sys.exc_info()) + + +cdef void gevent_ares_nameinfo_callback(void *arg, int status, int timeouts, char *c_node, char *c_service): + cdef channel channel + cdef object callback + channel, callback = arg + Py_DECREF(arg) + cdef object node + cdef object service + try: + if status: + callback(result(None, gaierror(status, strerror(status)))) + else: + if c_node: + node = PyUnicode_FromString(c_node) + else: + node = None + if c_service: + service = PyUnicode_FromString(c_service) + else: + service = None + callback(result((node, service))) + except: + channel.loop.handle_error(callback, *sys.exc_info()) + + +cdef class channel: + + cdef public object loop + cdef ares_channeldata* channel + cdef public dict _watchers + cdef public object _timer + + def __init__(self, object loop, flags=None, timeout=None, tries=None, ndots=None, + udp_port=None, tcp_port=None, servers=None): + cdef ares_channeldata* channel = NULL + cdef cares.ares_options options + memset(&options, 0, sizeof(cares.ares_options)) + cdef int optmask = cares.ARES_OPT_SOCK_STATE_CB + options.sock_state_cb = gevent_sock_state_callback + options.sock_state_cb_data = self + if flags is not None: + options.flags = int(flags) + optmask |= cares.ARES_OPT_FLAGS + if timeout is not None: + options.timeout = int(float(timeout) * 1000) + optmask |= cares.ARES_OPT_TIMEOUTMS + if tries is not None: + options.tries = int(tries) + optmask |= cares.ARES_OPT_TRIES + if ndots is not None: + options.ndots = int(ndots) + optmask |= cares.ARES_OPT_NDOTS + if udp_port is not None: + options.udp_port = int(udp_port) + optmask |= cares.ARES_OPT_UDP_PORT + if tcp_port is not None: + options.tcp_port = int(tcp_port) + optmask |= cares.ARES_OPT_TCP_PORT + cdef int result = cares.ares_library_init(cares.ARES_LIB_INIT_ALL) # ARES_LIB_INIT_WIN32 -DUSE_WINSOCK? + if result: + raise gaierror(result, strerror(result)) + result = cares.ares_init_options(&channel, &options, optmask) + if result: + raise gaierror(result, strerror(result)) + self._timer = loop.timer(TIMEOUT, TIMEOUT) + self._watchers = {} + self.channel = channel + try: + if servers is not None: + self.set_servers(servers) + self.loop = loop + except: + self.destroy() + raise + + def __repr__(self): + args = (self.__class__.__name__, id(self), self._timer, len(self._watchers)) + return '<%s at 0x%x _timer=%r _watchers[%s]>' % args + + def destroy(self): + if self.channel: + # XXX ares_library_cleanup? + cares.ares_destroy(self.channel) + self.channel = NULL + self._watchers.clear() + self._timer.stop() + self.loop = None + + def __dealloc__(self): + if self.channel: + # XXX ares_library_cleanup? + cares.ares_destroy(self.channel) + self.channel = NULL + + cpdef set_servers(self, servers=None): + if not self.channel: + raise gaierror(cares.ARES_EDESTRUCTION, 'this ares channel has been destroyed') + if not servers: + servers = [] + if isinstance(servers, string_types): + servers = servers.split(',') + cdef int length = len(servers) + cdef int result, index + cdef char* string + cdef cares.ares_addr_node* c_servers + if length <= 0: + result = cares.ares_set_servers(self.channel, NULL) + else: + c_servers = PyMem_Malloc(sizeof(cares.ares_addr_node) * length) + if not c_servers: + raise MemoryError + try: + index = 0 + for server in servers: + if isinstance(server, unicode): + server = server.encode('ascii') + string = server + if cares.ares_inet_pton(AF_INET, string, &c_servers[index].addr) > 0: + c_servers[index].family = AF_INET + elif cares.ares_inet_pton(AF_INET6, string, &c_servers[index].addr) > 0: + c_servers[index].family = AF_INET6 + else: + raise InvalidIP(repr(string)) + c_servers[index].next = &c_servers[index] + 1 + index += 1 + if index >= length: + break + c_servers[length - 1].next = NULL + index = cares.ares_set_servers(self.channel, c_servers) + if index: + raise ValueError(strerror(index)) + finally: + PyMem_Free(c_servers) + + # this crashes c-ares + #def cancel(self): + # cares.ares_cancel(self.channel) + + cdef _sock_state_callback(self, int socket, int read, int write): + if not self.channel: + return + cdef object watcher = self._watchers.get(socket) + cdef int events = 0 + if read: + events |= EV_READ + if write: + events |= EV_WRITE + if watcher is None: + if not events: + return + watcher = self.loop.io(socket, events) + self._watchers[socket] = watcher + elif events: + if watcher.events == events: + return + watcher.stop() + watcher.events = events + else: + watcher.stop() + watcher.close() + self._watchers.pop(socket, None) + if not self._watchers: + self._timer.stop() + return + watcher.start(self._process_fd, watcher, pass_events=True) + self._timer.again(self._on_timer) + + def _on_timer(self): + cares.ares_process_fd(self.channel, cares.ARES_SOCKET_BAD, cares.ARES_SOCKET_BAD) + + def _process_fd(self, int events, object watcher): + if not self.channel: + return + cdef int read_fd = watcher.fd + cdef int write_fd = read_fd + if not (events & EV_READ): + read_fd = cares.ARES_SOCKET_BAD + if not (events & EV_WRITE): + write_fd = cares.ARES_SOCKET_BAD + cares.ares_process_fd(self.channel, read_fd, write_fd) + + def gethostbyname(self, object callback, char* name, int family=AF_INET): + if not self.channel: + raise gaierror(cares.ARES_EDESTRUCTION, 'this ares channel has been destroyed') + # note that for file lookups still AF_INET can be returned for AF_INET6 request + cdef object arg = (self, callback) + Py_INCREF(arg) + cares.ares_gethostbyname(self.channel, name, family, gevent_ares_host_callback, arg) + + def gethostbyaddr(self, object callback, char* addr): + if not self.channel: + raise gaierror(cares.ARES_EDESTRUCTION, 'this ares channel has been destroyed') + # will guess the family + cdef char addr_packed[16] + cdef int family + cdef int length + if cares.ares_inet_pton(AF_INET, addr, addr_packed) > 0: + family = AF_INET + length = 4 + elif cares.ares_inet_pton(AF_INET6, addr, addr_packed) > 0: + family = AF_INET6 + length = 16 + else: + raise InvalidIP(repr(addr)) + cdef object arg = (self, callback) + Py_INCREF(arg) + cares.ares_gethostbyaddr(self.channel, addr_packed, length, family, gevent_ares_host_callback, arg) + + cpdef _getnameinfo(self, object callback, tuple sockaddr, int flags): + if not self.channel: + raise gaierror(cares.ARES_EDESTRUCTION, 'this ares channel has been destroyed') + cdef char* hostp = NULL + cdef int port = 0 + cdef int flowinfo = 0 + cdef int scope_id = 0 + cdef sockaddr_in6 sa6 + if not PyTuple_Check(sockaddr): + raise TypeError('expected a tuple, got %r' % (sockaddr, )) + PyArg_ParseTuple(sockaddr, "si|ii", &hostp, &port, &flowinfo, &scope_id) + if port < 0 or port > 65535: + raise gaierror(-8, 'Invalid value for port: %r' % port) + cdef int length = gevent_make_sockaddr(hostp, port, flowinfo, scope_id, &sa6) + if length <= 0: + raise InvalidIP(repr(hostp)) + cdef object arg = (self, callback) + Py_INCREF(arg) + cdef sockaddr_t* x = &sa6 + cares.ares_getnameinfo(self.channel, x, length, flags, gevent_ares_nameinfo_callback, arg) + + def getnameinfo(self, object callback, tuple sockaddr, int flags): + try: + flags = _convert_cares_flags(flags) + except gaierror: + # The stdlib just ignores bad flags + flags = 0 + return self._getnameinfo(callback, sockaddr, flags) diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/resolver/cares_ntop.h b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/resolver/cares_ntop.h new file mode 100644 index 00000000..9ffc9dd9 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/resolver/cares_ntop.h @@ -0,0 +1,7 @@ +#ifdef CARES_EMBED +#include "ares_setup.h" +#include "ares.h" +#else +#include +#define ares_inet_ntop(w,x,y,z) inet_ntop(w,x,y,z) +#endif diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/resolver/cares_pton.h b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/resolver/cares_pton.h new file mode 100644 index 00000000..85af403d --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/resolver/cares_pton.h @@ -0,0 +1,8 @@ +#ifdef CARES_EMBED +#include "ares_setup.h" +#include "ares_inet_net_pton.h" +#else +#include +#define ares_inet_pton(x,y,z) inet_pton(x,y,z) +#define ares_inet_net_pton(w,x,y,z) inet_net_pton(w,x,y,z) +#endif diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/resolver/dnshelper.c b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/resolver/dnshelper.c new file mode 100644 index 00000000..3befb699 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/resolver/dnshelper.c @@ -0,0 +1,159 @@ +/* Copyright (c) 2011 Denis Bilenko. See LICENSE for details. */ +#include "Python.h" +#ifdef CARES_EMBED +#include "ares_setup.h" +#endif + +#ifdef HAVE_NETDB_H +#include +#endif + +#include "ares.h" + +#include "cares_ntop.h" +#include "cares_pton.h" + +#if PY_VERSION_HEX < 0x02060000 + #define PyUnicode_FromString PyString_FromString +#elif PY_MAJOR_VERSION < 3 + #define PyUnicode_FromString PyBytes_FromString +#endif + + +static PyObject* _socket_error = 0; + +static PyObject* +get_socket_object(PyObject** pobject, const char* name) +{ + if (!*pobject) { + PyObject* _socket; + _socket = PyImport_ImportModule("_socket"); + if (_socket) { + *pobject = PyObject_GetAttrString(_socket, name); + if (!*pobject) { + PyErr_WriteUnraisable(Py_None); + } + Py_DECREF(_socket); + } + else { + PyErr_WriteUnraisable(Py_None); + } + if (!*pobject) { + *pobject = PyExc_IOError; + } + } + return *pobject; +} + + +static int +gevent_append_addr(PyObject* list, int family, void* src, char* tmpbuf, size_t tmpsize) { + int status = -1; + PyObject* tmp; + if (ares_inet_ntop(family, src, tmpbuf, tmpsize)) { + tmp = PyUnicode_FromString(tmpbuf); + if (tmp) { + status = PyList_Append(list, tmp); + Py_DECREF(tmp); + } + } + return status; +} + + +static PyObject* +parse_h_name(struct hostent *h) +{ + return PyUnicode_FromString(h->h_name); +} + + +static PyObject* +parse_h_aliases(struct hostent *h) +{ + char **pch; + PyObject *result = NULL; + PyObject *tmp; + + result = PyList_New(0); + + if (result && h->h_aliases) { + for (pch = h->h_aliases; *pch != NULL; pch++) { + if (*pch != h->h_name && strcmp(*pch, h->h_name)) { + int status; + tmp = PyUnicode_FromString(*pch); + if (tmp == NULL) { + break; + } + + status = PyList_Append(result, tmp); + Py_DECREF(tmp); + + if (status) { + break; + } + } + } + } + + return result; +} + + +static PyObject * +parse_h_addr_list(struct hostent *h) +{ + char **pch; + PyObject *result = NULL; + + result = PyList_New(0); + + if (result) { + switch (h->h_addrtype) { + case AF_INET: + { + char tmpbuf[sizeof "255.255.255.255"]; + for (pch = h->h_addr_list; *pch != NULL; pch++) { + if (gevent_append_addr(result, AF_INET, *pch, tmpbuf, sizeof(tmpbuf))) { + break; + } + } + break; + } + case AF_INET6: + { + char tmpbuf[sizeof("ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255")]; + for (pch = h->h_addr_list; *pch != NULL; pch++) { + if (gevent_append_addr(result, AF_INET6, *pch, tmpbuf, sizeof(tmpbuf))) { + break; + } + } + break; + } + default: + PyErr_SetString(get_socket_object(&_socket_error, "error"), "unsupported address family"); + Py_DECREF(result); + result = NULL; + } + } + + return result; +} + + +static int +gevent_make_sockaddr(char* hostp, int port, int flowinfo, int scope_id, struct sockaddr_in6* sa6) { + if ( ares_inet_pton(AF_INET, hostp, &((struct sockaddr_in*)sa6)->sin_addr.s_addr) > 0 ) { + ((struct sockaddr_in*)sa6)->sin_family = AF_INET; + ((struct sockaddr_in*)sa6)->sin_port = htons(port); + return sizeof(struct sockaddr_in); + } + else if ( ares_inet_pton(AF_INET6, hostp, &sa6->sin6_addr.s6_addr) > 0 ) { + sa6->sin6_family = AF_INET6; + sa6->sin6_port = htons(port); + sa6->sin6_flowinfo = flowinfo; + sa6->sin6_scope_id = scope_id; + return sizeof(struct sockaddr_in6); + } + return -1; +} diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/resolver/dnspython.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/resolver/dnspython.py new file mode 100644 index 00000000..0b9e82f2 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/resolver/dnspython.py @@ -0,0 +1,662 @@ +# Copyright (c) 2018 gevent contributors. See LICENSE for details. + +# Portions of this code taken from the gogreen project: +# http://github.com/slideinc/gogreen +# +# Copyright (c) 2005-2010 Slide, Inc. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following +# disclaimer in the documentation and/or other materials provided +# with the distribution. +# * Neither the name of the author nor the names of other +# contributors may be used to endorse or promote products derived +# from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +# Portions of this code taken from the eventlet project: +# https://github.com/eventlet/eventlet/blob/master/eventlet/support/greendns.py + +# Unless otherwise noted, the files in Eventlet are under the following MIT license: + +# Copyright (c) 2005-2006, Bob Ippolito +# Copyright (c) 2007-2010, Linden Research, Inc. +# Copyright (c) 2008-2010, Eventlet Contributors (see AUTHORS) + +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: + +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. + +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. +from __future__ import absolute_import, print_function, division + +import time +import re +import os +import sys + +import _socket +from _socket import AI_NUMERICHOST +from _socket import error +from _socket import NI_NUMERICSERV +from _socket import AF_INET +from _socket import AF_INET6 +from _socket import AF_UNSPEC + +import socket + +from gevent.resolver import AbstractResolver +from gevent.resolver import hostname_types + +from gevent._compat import string_types +from gevent._compat import iteritems +from gevent._patcher import import_patched +from gevent._config import config + +__all__ = [ + 'Resolver', +] + +# Import the DNS packages to use the gevent modules, +# even if the system is not monkey-patched. +def _patch_dns(): + top = import_patched('dns') + for pkg in ('dns', + 'dns.rdtypes', + 'dns.rdtypes.IN', + 'dns.rdtypes.ANY'): + mod = import_patched(pkg) + for name in mod.__all__: + setattr(mod, name, import_patched(pkg + '.' + name)) + return top + +dns = _patch_dns() + +def _dns_import_patched(name): + assert name.startswith('dns') + import_patched(name) + return dns + +# This module tries to dynamically import classes +# using __import__, and it's important that they match +# the ones we just created, otherwise exceptions won't be caught +# as expected. It uses a one-arg __import__ statement and then +# tries to walk down the sub-modules using getattr, so we can't +# directly use import_patched as-is. +dns.rdata.__import__ = _dns_import_patched + +resolver = dns.resolver +dTimeout = dns.resolver.Timeout + +_exc_clear = getattr(sys, 'exc_clear', lambda: None) + +# This is a copy of resolver._getaddrinfo with the crucial change that it +# doesn't have a bare except:, because that breaks Timeout and KeyboardInterrupt +# A secondary change is that calls to sys.exc_clear() have been inserted to avoid +# failing tests in test__refcount.py (timeouts). +# See https://github.com/rthalley/dnspython/pull/300 +def _getaddrinfo(host=None, service=None, family=AF_UNSPEC, socktype=0, + proto=0, flags=0): + # pylint:disable=too-many-locals,broad-except,too-many-statements + # pylint:disable=too-many-branches + # pylint:disable=redefined-argument-from-local + # pylint:disable=consider-using-in + if flags & (socket.AI_ADDRCONFIG | socket.AI_V4MAPPED) != 0: + raise NotImplementedError + if host is None and service is None: + raise socket.gaierror(socket.EAI_NONAME) + v6addrs = [] + v4addrs = [] + canonical_name = None + try: + # Is host None or a V6 address literal? + if host is None: + canonical_name = 'localhost' + if flags & socket.AI_PASSIVE != 0: + v6addrs.append('::') + v4addrs.append('0.0.0.0') + else: + v6addrs.append('::1') + v4addrs.append('127.0.0.1') + else: + parts = host.split('%') + if len(parts) == 2: + ahost = parts[0] + else: + ahost = host + addr = dns.ipv6.inet_aton(ahost) + v6addrs.append(host) + canonical_name = host + except Exception: + _exc_clear() + try: + # Is it a V4 address literal? + addr = dns.ipv4.inet_aton(host) + v4addrs.append(host) + canonical_name = host + except Exception: + _exc_clear() + if flags & socket.AI_NUMERICHOST == 0: + try: + if family == socket.AF_INET6 or family == socket.AF_UNSPEC: + v6 = resolver._resolver.query(host, dns.rdatatype.AAAA, + raise_on_no_answer=False) + # Note that setting host ensures we query the same name + # for A as we did for AAAA. + host = v6.qname + canonical_name = v6.canonical_name.to_text(True) + if v6.rrset is not None: + for rdata in v6.rrset: + v6addrs.append(rdata.address) + if family == socket.AF_INET or family == socket.AF_UNSPEC: + v4 = resolver._resolver.query(host, dns.rdatatype.A, + raise_on_no_answer=False) + host = v4.qname + canonical_name = v4.canonical_name.to_text(True) + if v4.rrset is not None: + for rdata in v4.rrset: + v4addrs.append(rdata.address) + except dns.resolver.NXDOMAIN: + _exc_clear() + raise socket.gaierror(socket.EAI_NONAME) + except Exception: + _exc_clear() + raise socket.gaierror(socket.EAI_SYSTEM) + port = None + try: + # Is it a port literal? + if service is None: + port = 0 + else: + port = int(service) + except Exception: + _exc_clear() + if flags & socket.AI_NUMERICSERV == 0: + try: + port = socket.getservbyname(service) + except Exception: + _exc_clear() + + if port is None: + raise socket.gaierror(socket.EAI_NONAME) + tuples = [] + if socktype == 0: + socktypes = [socket.SOCK_DGRAM, socket.SOCK_STREAM] + else: + socktypes = [socktype] + if flags & socket.AI_CANONNAME != 0: + cname = canonical_name + else: + cname = '' + if family == socket.AF_INET6 or family == socket.AF_UNSPEC: + for addr in v6addrs: + for socktype in socktypes: + for proto in resolver._protocols_for_socktype[socktype]: + tuples.append((socket.AF_INET6, socktype, proto, + cname, (addr, port, 0, 0))) # XXX: gevent: this can get the scopeid wrong + if family == socket.AF_INET or family == socket.AF_UNSPEC: + for addr in v4addrs: + for socktype in socktypes: + for proto in resolver._protocols_for_socktype[socktype]: + tuples.append((socket.AF_INET, socktype, proto, + cname, (addr, port))) + if len(tuples) == 0: # pylint:disable=len-as-condition + raise socket.gaierror(socket.EAI_NONAME) + return tuples + + +resolver._getaddrinfo = _getaddrinfo + +HOSTS_TTL = 300.0 + +def _is_addr(host, parse=dns.ipv4.inet_aton): + if not host: + return False + assert isinstance(host, hostname_types), repr(host) + try: + parse(host) + except dns.exception.SyntaxError: + return False + else: + return True + +# Return True if host is a valid IPv4 address +_is_ipv4_addr = _is_addr + + +def _is_ipv6_addr(host): + # Return True if host is a valid IPv6 address + if host: + s = '%' if isinstance(host, str) else b'%' + host = host.split(s, 1)[0] + return _is_addr(host, dns.ipv6.inet_aton) + +class HostsFile(object): + """ + A class to read the contents of a hosts file (/etc/hosts). + """ + + LINES_RE = re.compile(r""" + \s* # Leading space + ([^\r\n#]+?) # The actual match, non-greedy so as not to include trailing space + \s* # Trailing space + (?:[#][^\r\n]+)? # Comments + (?:$|[\r\n]+) # EOF or newline + """, re.VERBOSE) + + def __init__(self, fname=None): + self.v4 = {} # name -> ipv4 + self.v6 = {} # name -> ipv6 + self.aliases = {} # name -> canonical_name + self.reverse = {} # ip addr -> some name + if fname is None: + if os.name == 'posix': + fname = '/etc/hosts' + elif os.name == 'nt': # pragma: no cover + fname = os.path.expandvars( + r'%SystemRoot%\system32\drivers\etc\hosts') + self.fname = fname + assert self.fname + self._last_load = 0 + + + def _readlines(self): + # Read the contents of the hosts file. + # + # Return list of lines, comment lines and empty lines are + # excluded. Note that this performs disk I/O so can be + # blocking. + with open(self.fname, 'rb') as fp: + fdata = fp.read() + + + # XXX: Using default decoding. Is that correct? + udata = fdata.decode(errors='ignore') if not isinstance(fdata, str) else fdata + + return self.LINES_RE.findall(udata) + + def load(self): # pylint:disable=too-many-locals + # Load hosts file + + # This will (re)load the data from the hosts + # file if it has changed. + + try: + load_time = os.stat(self.fname).st_mtime + needs_load = load_time > self._last_load + except (IOError, OSError): + from gevent import get_hub + get_hub().handle_error(self, *sys.exc_info()) + needs_load = False + + if not needs_load: + return + + v4 = {} + v6 = {} + aliases = {} + reverse = {} + + for line in self._readlines(): + parts = line.split() + if len(parts) < 2: + continue + ip = parts.pop(0) + if _is_ipv4_addr(ip): + ipmap = v4 + elif _is_ipv6_addr(ip): + if ip.startswith('fe80'): + # Do not use link-local addresses, OSX stores these here + continue + ipmap = v6 + else: + continue + cname = parts.pop(0).lower() + ipmap[cname] = ip + for alias in parts: + alias = alias.lower() + ipmap[alias] = ip + aliases[alias] = cname + + # XXX: This is wrong for ipv6 + if ipmap is v4: + ptr = '.'.join(reversed(ip.split('.'))) + '.in-addr.arpa' + else: + ptr = ip + '.ip6.arpa.' + if ptr not in reverse: + reverse[ptr] = cname + + self._last_load = load_time + self.v4 = v4 + self.v6 = v6 + self.aliases = aliases + self.reverse = reverse + + def iter_all_host_addr_pairs(self): + self.load() + for name, addr in iteritems(self.v4): + yield name, addr + for name, addr in iteritems(self.v6): + yield name, addr + +class _HostsAnswer(dns.resolver.Answer): + # Answer class for HostsResolver object + + def __init__(self, qname, rdtype, rdclass, rrset, raise_on_no_answer=True): + self.response = None + self.qname = qname + self.rdtype = rdtype + self.rdclass = rdclass + self.canonical_name = qname + if not rrset and raise_on_no_answer: + raise dns.resolver.NoAnswer() + self.rrset = rrset + self.expiration = (time.time() + + rrset.ttl if hasattr(rrset, 'ttl') else 0) + + +class _HostsResolver(object): + """ + Class to parse the hosts file + """ + + def __init__(self, fname=None, interval=HOSTS_TTL): + self.hosts_file = HostsFile(fname) + self.interval = interval + self._last_load = 0 + + def query(self, qname, rdtype=dns.rdatatype.A, rdclass=dns.rdataclass.IN, + tcp=False, source=None, raise_on_no_answer=True): # pylint:disable=unused-argument + # Query the hosts file + # + # The known rdtypes are dns.rdatatype.A, dns.rdatatype.AAAA and + # dns.rdatatype.CNAME. + # The ``rdclass`` parameter must be dns.rdataclass.IN while the + # ``tcp`` and ``source`` parameters are ignored. + # Return a HostAnswer instance or raise a dns.resolver.NoAnswer + # exception. + + now = time.time() + hosts_file = self.hosts_file + if self._last_load + self.interval < now: + self._last_load = now + hosts_file.load() + + rdclass = dns.rdataclass.IN # Always + if isinstance(qname, string_types): + name = qname + qname = dns.name.from_text(qname) + else: + name = str(qname) + + name = name.lower() + rrset = dns.rrset.RRset(qname, rdclass, rdtype) + rrset.ttl = self._last_load + self.interval - now + + if rdtype == dns.rdatatype.A: + mapping = hosts_file.v4 + kind = dns.rdtypes.IN.A.A + elif rdtype == dns.rdatatype.AAAA: + mapping = hosts_file.v6 + kind = dns.rdtypes.IN.AAAA.AAAA + elif rdtype == dns.rdatatype.CNAME: + mapping = hosts_file.aliases + kind = lambda c, t, addr: dns.rdtypes.ANY.CNAME.CNAME(c, t, dns.name.from_text(addr)) + elif rdtype == dns.rdatatype.PTR: + mapping = hosts_file.reverse + kind = lambda c, t, addr: dns.rdtypes.ANY.PTR.PTR(c, t, dns.name.from_text(addr)) + + + addr = mapping.get(name) + if not addr and qname.is_absolute(): + addr = mapping.get(name[:-1]) + if addr: + rrset.add(kind(rdclass, rdtype, addr)) + return _HostsAnswer(qname, rdtype, rdclass, rrset, raise_on_no_answer) + + def getaliases(self, hostname): + # Return a list of all the aliases of a given cname + + # Due to the way store aliases this is a bit inefficient, this + # clearly was an afterthought. But this is only used by + # gethostbyname_ex so it's probably fine. + aliases = self.hosts_file.aliases + result = [] + if hostname in aliases: + cannon = aliases[hostname] + else: + cannon = hostname + result.append(cannon) + for alias, cname in iteritems(aliases): + if cannon == cname: + result.append(alias) + result.remove(hostname) + return result + +class _DualResolver(object): + + def __init__(self): + self.hosts_resolver = _HostsResolver() + self.network_resolver = resolver.get_default_resolver() + self.network_resolver.cache = resolver.LRUCache() + + def query(self, qname, rdtype=dns.rdatatype.A, rdclass=dns.rdataclass.IN, + tcp=False, source=None, raise_on_no_answer=True, + _hosts_rdtypes=(dns.rdatatype.A, dns.rdatatype.AAAA, dns.rdatatype.PTR)): + # Query the resolver, using /etc/hosts + + # Behavior: + # 1. if hosts is enabled and contains answer, return it now + # 2. query nameservers for qname + if qname is None: + qname = '0.0.0.0' + + if not isinstance(qname, string_types): + if isinstance(qname, bytes): + qname = qname.decode("idna") + + if isinstance(qname, string_types): + qname = dns.name.from_text(qname, None) + + if isinstance(rdtype, string_types): + rdtype = dns.rdatatype.from_text(rdtype) + + if rdclass == dns.rdataclass.IN and rdtype in _hosts_rdtypes: + try: + answer = self.hosts_resolver.query(qname, rdtype, raise_on_no_answer=False) + except Exception: # pylint: disable=broad-except + from gevent import get_hub + get_hub().handle_error(self, *sys.exc_info()) + else: + if answer.rrset: + return answer + + return self.network_resolver.query(qname, rdtype, rdclass, + tcp, source, raise_on_no_answer=raise_on_no_answer) + +def _family_to_rdtype(family): + if family == socket.AF_INET: + rdtype = dns.rdatatype.A + elif family == socket.AF_INET6: + rdtype = dns.rdatatype.AAAA + else: + raise socket.gaierror(socket.EAI_FAMILY, + 'Address family not supported') + return rdtype + +class Resolver(AbstractResolver): + """ + An *experimental* resolver that uses `dnspython`_. + + This is typically slower than the default threaded resolver + (unless there's a cache hit, in which case it can be much faster). + It is usually much faster than the c-ares resolver. It tends to + scale well as more concurrent resolutions are attempted. + + Under Python 2, if the ``idna`` package is installed, this + resolver can resolve Unicode host names that the system resolver + cannot. + + .. note:: + + This **does not** use dnspython's default resolver object, or share any + classes with ``import dns``. A separate copy of the objects is imported to + be able to function in a non monkey-patched process. The documentation for the resolver + object still applies. + + The resolver that we use is available as the :attr:`resolver` attribute + of this object (typically ``gevent.get_hub().resolver.resolver``). + + .. caution:: + + Many of the same caveats about DNS results apply here as are documented + for :class:`gevent.resolver.ares.Resolver`. + + .. caution:: + + This resolver is experimental. It may be removed or modified in + the future. As always, feedback is welcome. + + .. versionadded:: 1.3a2 + + .. _dnspython: http://www.dnspython.org + """ + + def __init__(self, hub=None): # pylint: disable=unused-argument + if resolver._resolver is None: + _resolver = resolver._resolver = _DualResolver() + if config.resolver_nameservers: + _resolver.network_resolver.nameservers[:] = config.resolver_nameservers + if config.resolver_timeout: + _resolver.network_resolver.lifetime = config.resolver_timeout + # Different hubs in different threads could be sharing the same + # resolver. + assert isinstance(resolver._resolver, _DualResolver) + self._resolver = resolver._resolver + + @property + def resolver(self): + """ + The dnspython resolver object we use. + + This object has several useful attributes that can be used to + adjust the behaviour of the DNS system: + + * ``cache`` is a :class:`dns.resolver.LRUCache`. Its maximum size + can be configured by calling :meth:`resolver.cache.set_max_size` + * ``nameservers`` controls which nameservers to talk to + * ``lifetime`` configures a timeout for each individual query. + """ + return self._resolver.network_resolver + + def close(self): + pass + + def _getaliases(self, hostname, family): + if not isinstance(hostname, str): + if isinstance(hostname, bytes): + hostname = hostname.decode("idna") + aliases = self._resolver.hosts_resolver.getaliases(hostname) + net_resolver = self._resolver.network_resolver + rdtype = _family_to_rdtype(family) + while True: + try: + ans = net_resolver.query(hostname, dns.rdatatype.CNAME, rdtype) + except (dns.resolver.NoAnswer, dns.resolver.NXDOMAIN, dns.resolver.NoNameservers): + break + except dTimeout: + break + else: + aliases.extend(str(rr.target) for rr in ans.rrset) + hostname = ans[0].target + return aliases + + def getaddrinfo(self, host, port, family=0, socktype=0, proto=0, flags=0): + if ((host in (u'localhost', b'localhost') + or (_is_ipv6_addr(host) and host.startswith('fe80'))) + or not isinstance(host, str) or (flags & AI_NUMERICHOST)): + # this handles cases which do not require network access + # 1) host is None + # 2) host is of an invalid type + # 3) host is localhost or a link-local ipv6; dnspython returns the wrong + # scope-id for those. + # 3) AI_NUMERICHOST flag is set + + return _socket.getaddrinfo(host, port, family, socktype, proto, flags) + + if family == AF_UNSPEC: + # This tends to raise in the case that a v6 address did not exist + # but a v4 does. So we break it into two parts. + + # Note that if there is no ipv6 in the hosts file, but there *is* + # an ipv4, and there *is* an ipv6 in the nameservers, we will return + # both (from the first call). The system resolver on OS X only returns + # the results from the hosts file. doubleclick.com is one example. + + # See also https://github.com/gevent/gevent/issues/1012 + try: + return _getaddrinfo(host, port, family, socktype, proto, flags) + except socket.gaierror: + try: + return _getaddrinfo(host, port, AF_INET6, socktype, proto, flags) + except socket.gaierror: + return _getaddrinfo(host, port, AF_INET, socktype, proto, flags) + else: + return _getaddrinfo(host, port, family, socktype, proto, flags) + + def getnameinfo(self, sockaddr, flags): + if (sockaddr + and isinstance(sockaddr, (list, tuple)) + and sockaddr[0] in ('::1', '127.0.0.1', 'localhost')): + return _socket.getnameinfo(sockaddr, flags) + if isinstance(sockaddr, (list, tuple)) and not isinstance(sockaddr[0], hostname_types): + raise TypeError("getnameinfo(): illegal sockaddr argument") + try: + return resolver._getnameinfo(sockaddr, flags) + except error: + if not flags: + # dnspython doesn't like getting ports it can't resolve. + # We have one test, test__socket_dns.py:Test_getnameinfo_geventorg.test_port_zero + # that does this. We conservatively fix it here; this could be expanded later. + return resolver._getnameinfo(sockaddr, NI_NUMERICSERV) + + def gethostbyaddr(self, ip_address): + if ip_address in (u'127.0.0.1', u'::1', + b'127.0.0.1', b'::1', + 'localhost'): + return _socket.gethostbyaddr(ip_address) + + if not isinstance(ip_address, hostname_types): + raise TypeError("argument 1 must be str, bytes or bytearray, not %s" % (type(ip_address),)) + + return resolver._gethostbyaddr(ip_address) diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/resolver/libcares.pxd b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/resolver/libcares.pxd new file mode 100644 index 00000000..7b551a7d --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/resolver/libcares.pxd @@ -0,0 +1,109 @@ +cdef extern from "ares.h": + struct ares_options: + int flags + void* sock_state_cb + void* sock_state_cb_data + int timeout + int tries + int ndots + unsigned short udp_port + unsigned short tcp_port + char **domains + int ndomains + char* lookups + + int ARES_OPT_FLAGS + int ARES_OPT_SOCK_STATE_CB + int ARES_OPT_TIMEOUTMS + int ARES_OPT_TRIES + int ARES_OPT_NDOTS + int ARES_OPT_TCP_PORT + int ARES_OPT_UDP_PORT + int ARES_OPT_SERVERS + int ARES_OPT_DOMAINS + int ARES_OPT_LOOKUPS + + int ARES_FLAG_USEVC + int ARES_FLAG_PRIMARY + int ARES_FLAG_IGNTC + int ARES_FLAG_NORECURSE + int ARES_FLAG_STAYOPEN + int ARES_FLAG_NOSEARCH + int ARES_FLAG_NOALIASES + int ARES_FLAG_NOCHECKRESP + + int ARES_LIB_INIT_ALL + int ARES_SOCKET_BAD + + int ARES_SUCCESS + int ARES_ENODATA + int ARES_EFORMERR + int ARES_ESERVFAIL + int ARES_ENOTFOUND + int ARES_ENOTIMP + int ARES_EREFUSED + int ARES_EBADQUERY + int ARES_EBADNAME + int ARES_EBADFAMILY + int ARES_EBADRESP + int ARES_ECONNREFUSED + int ARES_ETIMEOUT + int ARES_EOF + int ARES_EFILE + int ARES_ENOMEM + int ARES_EDESTRUCTION + int ARES_EBADSTR + int ARES_EBADFLAGS + int ARES_ENONAME + int ARES_EBADHINTS + int ARES_ENOTINITIALIZED + int ARES_ELOADIPHLPAPI + int ARES_EADDRGETNETWORKPARAMS + int ARES_ECANCELLED + + int ARES_NI_NOFQDN + int ARES_NI_NUMERICHOST + int ARES_NI_NAMEREQD + int ARES_NI_NUMERICSERV + int ARES_NI_DGRAM + int ARES_NI_TCP + int ARES_NI_UDP + int ARES_NI_SCTP + int ARES_NI_DCCP + int ARES_NI_NUMERICSCOPE + int ARES_NI_LOOKUPHOST + int ARES_NI_LOOKUPSERVICE + + + int ares_library_init(int flags) + void ares_library_cleanup() + int ares_init_options(void *channelptr, ares_options *options, int) + int ares_init(void *channelptr) + void ares_destroy(void *channelptr) + void ares_gethostbyname(void* channel, char *name, int family, void* callback, void *arg) + void ares_gethostbyaddr(void* channel, void *addr, int addrlen, int family, void* callback, void *arg) + void ares_process_fd(void* channel, int read_fd, int write_fd) + char* ares_strerror(int code) + void ares_cancel(void* channel) + void ares_getnameinfo(void* channel, void* sa, int salen, int flags, void* callback, void *arg) + + struct in_addr: + pass + + struct ares_in6_addr: + pass + + struct addr_union: + in_addr addr4 + ares_in6_addr addr6 + + struct ares_addr_node: + ares_addr_node *next + int family + addr_union addr + + int ares_set_servers(void* channel, ares_addr_node *servers) + + +cdef extern from "cares_pton.h": + int ares_inet_pton(int af, char *src, void *dst) diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/resolver/thread.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/resolver/thread.py new file mode 100644 index 00000000..df71706a --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/resolver/thread.py @@ -0,0 +1,71 @@ +# Copyright (c) 2012-2015 Denis Bilenko. See LICENSE for details. +""" +Native thread-based hostname resolver. +""" +import _socket + +from gevent.hub import get_hub + + +__all__ = ['Resolver'] + + +# trigger import of encodings.idna to avoid https://github.com/gevent/gevent/issues/349 +u'foo'.encode('idna') + + +class Resolver(object): + """ + Implementation of the resolver API using native threads and native resolution + functions. + + Using the native resolution mechanisms ensures the highest + compatibility with what a non-gevent program would return + including good support for platform specific configuration + mechanisms. The use of native (non-greenlet) threads ensures that + a caller doesn't block other greenlets. + + This implementation also has the benefit of being very simple in comparison to + :class:`gevent.resolver_ares.Resolver`. + + .. tip:: + + Most users find this resolver to be quite reliable in a + properly monkey-patched environment. However, there have been + some reports of long delays, slow performance or even hangs, + particularly in long-lived programs that make many, many DNS + requests. If you suspect that may be happening to you, try the + dnspython or ares resolver (and submit a bug report). + """ + def __init__(self, hub=None): + if hub is None: + hub = get_hub() + self.pool = hub.threadpool + if _socket.gaierror not in hub.NOT_ERROR: + # Do not cause lookup failures to get printed by the default + # error handler. This can be very noisy. + hub.NOT_ERROR += (_socket.gaierror, _socket.herror) + + def __repr__(self): + return '' % (id(self), self.pool) + + def close(self): + pass + + # from briefly reading socketmodule.c, it seems that all of the functions + # below are thread-safe in Python, even if they are not thread-safe in C. + + def gethostbyname(self, *args): + return self.pool.apply(_socket.gethostbyname, args) + + def gethostbyname_ex(self, *args): + return self.pool.apply(_socket.gethostbyname_ex, args) + + def getaddrinfo(self, *args, **kwargs): + return self.pool.apply(_socket.getaddrinfo, args, kwargs) + + def gethostbyaddr(self, *args, **kwargs): + return self.pool.apply(_socket.gethostbyaddr, args, kwargs) + + def getnameinfo(self, *args, **kwargs): + return self.pool.apply(_socket.getnameinfo, args, kwargs) diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/resolver_ares.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/resolver_ares.py new file mode 100644 index 00000000..9f0c4491 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/resolver_ares.py @@ -0,0 +1,17 @@ +"""Backwards compatibility alias for :mod:`gevent.resolver.ares`. + +.. deprecated:: 1.3 + Use :mod:`gevent.resolver.ares` +""" +import warnings +warnings.warn( + "gevent.resolver_ares is deprecated and will be removed in 1.5. " + "Use gevent.resolver.ares instead.", + DeprecationWarning, + stacklevel=2 +) +del warnings +from gevent.resolver.ares import * # pylint:disable=wildcard-import,unused-wildcard-import +import gevent.resolver.ares as _ares +__all__ = _ares.__all__ +del _ares diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/resolver_thread.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/resolver_thread.py new file mode 100644 index 00000000..1486e422 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/resolver_thread.py @@ -0,0 +1,17 @@ +"""Backwards compatibility alias for :mod:`gevent.resolver.thread`. + +.. deprecated:: 1.3 + Use :mod:`gevent.resolver.thread` +""" +import warnings +warnings.warn( + "gevent.resolver_thread is deprecated and will be removed in 1.5. " + "Use gevent.resolver.thread instead.", + DeprecationWarning, + stacklevel=2 +) +del warnings +from gevent.resolver.thread import * # pylint:disable=wildcard-import,unused-wildcard-import +import gevent.resolver.thread as _thread +__all__ = _thread.__all__ +del _thread diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/select.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/select.py new file mode 100644 index 00000000..a4c182cf --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/select.py @@ -0,0 +1,286 @@ +# Copyright (c) 2009-2011 Denis Bilenko. See LICENSE for details. +""" +Waiting for I/O completion. +""" +from __future__ import absolute_import, division, print_function + +import sys + +from gevent.event import Event +from gevent.hub import _get_hub_noargs as get_hub +from gevent.hub import sleep as _g_sleep +from gevent._compat import integer_types +from gevent._compat import iteritems +from gevent._util import copy_globals +from gevent._util import _NONE + +from errno import EINTR +from select import select as _real_original_select +if sys.platform.startswith('win32'): + def _original_select(r, w, x, t): + # windows cant handle three empty lists, but we've always + # accepted that + if not r and not w and not x: + return ((), (), ()) + return _real_original_select(r, w, x, t) +else: + _original_select = _real_original_select + + +try: + from select import poll as original_poll + from select import POLLIN, POLLOUT, POLLNVAL + __implements__ = ['select', 'poll'] +except ImportError: + original_poll = None + __implements__ = ['select'] + +__all__ = ['error'] + __implements__ + +import select as __select__ + +error = __select__.error + +__imports__ = copy_globals(__select__, globals(), + names_to_ignore=__all__, + dunder_names_to_keep=()) + +_EV_READ = 1 +_EV_WRITE = 2 + +def get_fileno(obj): + try: + fileno_f = obj.fileno + except AttributeError: + if not isinstance(obj, integer_types): + raise TypeError('argument must be an int, or have a fileno() method: %r' % (obj,)) + return obj + else: + return fileno_f() + + +class SelectResult(object): + __slots__ = ('read', 'write', 'event') + + def __init__(self): + self.read = [] + self.write = [] + self.event = Event() + + def add_read(self, socket): + self.read.append(socket) + self.event.set() + + add_read.event = _EV_READ + + def add_write(self, socket): + self.write.append(socket) + self.event.set() + + add_write.event = _EV_WRITE + + def __add_watchers(self, watchers, fdlist, callback, io, pri): + for fd in fdlist: + watcher = io(get_fileno(fd), callback.event) + watcher.priority = pri + watchers.append(watcher) + watcher.start(callback, fd) + + def _make_watchers(self, watchers, rlist, wlist): + loop = get_hub().loop + io = loop.io + MAXPRI = loop.MAXPRI + + try: + self.__add_watchers(watchers, rlist, self.add_read, io, MAXPRI) + self.__add_watchers(watchers, wlist, self.add_write, io, MAXPRI) + except IOError as ex: + raise error(*ex.args) + + def _closeall(self, watchers): + for watcher in watchers: + watcher.stop() + watcher.close() + del watchers[:] + + def select(self, rlist, wlist, timeout): + watchers = [] + try: + self._make_watchers(watchers, rlist, wlist) + self.event.wait(timeout=timeout) + return self.read, self.write, [] + finally: + self._closeall(watchers) + + +def select(rlist, wlist, xlist, timeout=None): # pylint:disable=unused-argument + """An implementation of :meth:`select.select` that blocks only the current greenlet. + + .. caution:: *xlist* is ignored. + + .. versionchanged:: 1.2a1 + Raise a :exc:`ValueError` if timeout is negative. This matches Python 3's + behaviour (Python 2 would raise a ``select.error``). Previously gevent had + undefined behaviour. + .. versionchanged:: 1.2a1 + Raise an exception if any of the file descriptors are invalid. + """ + if timeout is not None and timeout < 0: + # Raise an error like the real implementation; which error + # depends on the version. Python 3, where select.error is OSError, + # raises a ValueError (which makes sense). Older pythons raise + # the error from the select syscall...but we don't actually get there. + # We choose to just raise the ValueError as it makes more sense and is + # forward compatible + raise ValueError("timeout must be non-negative") + + # First, do a poll with the original select system call. This + # is the most efficient way to check to see if any of the file descriptors + # have previously been closed and raise the correct corresponding exception. + # (Because libev tends to just return them as ready...) + # We accept the *xlist* here even though we can't below because this is all about + # error handling. + sel_results = ((), (), ()) + try: + sel_results = _original_select(rlist, wlist, xlist, 0) + except error as e: + enumber = getattr(e, 'errno', None) or e.args[0] + if enumber != EINTR: + # Ignore interrupted syscalls + raise + + if sel_results[0] or sel_results[1] or sel_results[2] or (timeout is not None and timeout == 0): + # If we actually had stuff ready, go ahead and return it. No need + # to go through the trouble of doing our own stuff. + + # Likewise, if the timeout is 0, we already did a 0 timeout + # select and we don't need to do it again. Note that in libuv, + # zero duration timers may be called immediately, without + # cycling the event loop at all. 2.7/test_telnetlib.py "hangs" + # calling zero-duration timers if we go to the loop here. + + # However, because this is typically a place where scheduling switches + # can occur, we need to make sure that's still the case; otherwise a single + # consumer could monopolize the thread. (shows up in test_ftplib.) + _g_sleep() + return sel_results + + result = SelectResult() + return result.select(rlist, wlist, timeout) + + +if original_poll is not None: + class PollResult(object): + __slots__ = ('events', 'event') + + def __init__(self): + self.events = set() + self.event = Event() + + def add_event(self, events, fd): + if events < 0: + result_flags = POLLNVAL + else: + result_flags = 0 + if events & _EV_READ: + result_flags = POLLIN + if events & _EV_WRITE: + result_flags |= POLLOUT + + self.events.add((fd, result_flags)) + self.event.set() + + class poll(object): + """ + An implementation of :class:`select.poll` that blocks only the current greenlet. + + .. caution:: ``POLLPRI`` data is not supported. + + .. versionadded:: 1.1b1 + """ + def __init__(self): + # {int -> flags} + # We can't keep watcher objects in here because people commonly + # just drop the poll object when they're done, without calling + # unregister(). dnspython does this. + self.fds = {} + self.loop = get_hub().loop + + def register(self, fd, eventmask=_NONE): + if eventmask is _NONE: + flags = _EV_READ | _EV_WRITE + else: + flags = 0 + if eventmask & POLLIN: + flags = _EV_READ + if eventmask & POLLOUT: + flags |= _EV_WRITE + # If they ask for POLLPRI, we can't support + # that. Should we raise an error? + + fileno = get_fileno(fd) + self.fds[fileno] = flags + + def modify(self, fd, eventmask): + self.register(fd, eventmask) + + def poll(self, timeout=None): + """ + poll the registered fds. + + .. versionchanged:: 1.2a1 + File descriptors that are closed are reported with POLLNVAL. + + .. versionchanged:: 1.3a2 + Under libuv, interpret *timeout* values less than 0 the same as *None*, + i.e., block. This was always the case with libev. + """ + result = PollResult() + watchers = [] + io = self.loop.io + MAXPRI = self.loop.MAXPRI + try: + for fd, flags in iteritems(self.fds): + watcher = io(fd, flags) + watchers.append(watcher) + watcher.priority = MAXPRI + watcher.start(result.add_event, fd, pass_events=True) + if timeout is not None: + if timeout < 0: + # The docs for python say that an omitted timeout, + # a negative timeout and a timeout of None are all + # supposed to block forever. Many, but not all + # OS's accept any negative number to mean that. Some + # OS's raise errors for anything negative but not -1. + # Python 3.7 changes to always pass exactly -1 in that + # case from selectors. + + # Our Timeout class currently does not have a defined behaviour + # for negative values. On libuv, it uses a check watcher and effectively + # doesn't block. On libev, it seems to block. In either case, we + # *want* to block, so turn this into the sure fire block request. + timeout = None + elif timeout: + # The docs for poll.poll say timeout is in + # milliseconds. Our result objects work in + # seconds, so this should be *=, shouldn't it? + timeout /= 1000.0 + result.event.wait(timeout=timeout) + return list(result.events) + finally: + for awatcher in watchers: + awatcher.stop() + awatcher.close() + + def unregister(self, fd): + """ + Unregister the *fd*. + + .. versionchanged:: 1.2a1 + Raise a `KeyError` if *fd* was not registered, like the standard + library. Previously gevent did nothing. + """ + fileno = get_fileno(fd) + del self.fds[fileno] + +del original_poll diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/server.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/server.py new file mode 100644 index 00000000..4c48bd3d --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/server.py @@ -0,0 +1,282 @@ +# Copyright (c) 2009-2012 Denis Bilenko. See LICENSE for details. +"""TCP/SSL server""" + +from contextlib import closing + +import sys + +from _socket import error as SocketError +from _socket import SOL_SOCKET +from _socket import SO_REUSEADDR +from _socket import AF_INET +from _socket import SOCK_DGRAM + +from gevent.baseserver import BaseServer +from gevent.socket import EWOULDBLOCK +from gevent.socket import socket as GeventSocket +from gevent._compat import PYPY, PY3 + +__all__ = ['StreamServer', 'DatagramServer'] + + +if sys.platform == 'win32': + # SO_REUSEADDR on Windows does not mean the same thing as on *nix (issue #217) + DEFAULT_REUSE_ADDR = None +else: + DEFAULT_REUSE_ADDR = 1 + + +if PY3: + # sockets and SSL sockets are context managers on Python 3 + def _closing_socket(sock): + return sock +else: + # but they are not guaranteed to be so on Python 2 + _closing_socket = closing + + +class StreamServer(BaseServer): + """ + A generic TCP server. + + Accepts connections on a listening socket and spawns user-provided + *handle* function for each connection with 2 arguments: the client + socket and the client address. + + Note that although the errors in a successfully spawned handler + will not affect the server or other connections, the errors raised + by :func:`accept` and *spawn* cause the server to stop accepting + for a short amount of time. The exact period depends on the values + of :attr:`min_delay` and :attr:`max_delay` attributes. + + The delay starts with :attr:`min_delay` and doubles with each + successive error until it reaches :attr:`max_delay`. A successful + :func:`accept` resets the delay to :attr:`min_delay` again. + + See :class:`~gevent.baseserver.BaseServer` for information on defining the *handle* + function and important restrictions on it. + + **SSL Support** + + The server can optionally work in SSL mode when given the correct + keyword arguments. (That is, the presence of any keyword arguments + will trigger SSL mode.) On Python 2.7.9 and later (any Python + version that supports the :class:`ssl.SSLContext`), this can be + done with a configured ``SSLContext``. On any Python version, it + can be done by passing the appropriate arguments for + :func:`ssl.wrap_socket`. + + The incoming socket will be wrapped into an SSL socket before + being passed to the *handle* function. + + If the *ssl_context* keyword argument is present, it should + contain an :class:`ssl.SSLContext`. The remaining keyword + arguments are passed to the :meth:`ssl.SSLContext.wrap_socket` + method of that object. Depending on the Python version, supported arguments + may include: + + - server_hostname + - suppress_ragged_eofs + - do_handshake_on_connect + + .. caution:: When using an SSLContext, it should either be + imported from :mod:`gevent.ssl`, or the process needs to be monkey-patched. + If the process is not monkey-patched and you pass the standard library + SSLContext, the resulting client sockets will not cooperate with gevent. + + Otherwise, keyword arguments are assumed to apply to :func:`ssl.wrap_socket`. + These keyword arguments may include: + + - keyfile + - certfile + - cert_reqs + - ssl_version + - ca_certs + - suppress_ragged_eofs + - do_handshake_on_connect + - ciphers + + .. versionchanged:: 1.2a2 + Add support for the *ssl_context* keyword argument. + + """ + # the default backlog to use if none was provided in __init__ + backlog = 256 + + reuse_addr = DEFAULT_REUSE_ADDR + + def __init__(self, listener, handle=None, backlog=None, spawn='default', **ssl_args): + BaseServer.__init__(self, listener, handle=handle, spawn=spawn) + try: + if ssl_args: + ssl_args.setdefault('server_side', True) + if 'ssl_context' in ssl_args: + ssl_context = ssl_args.pop('ssl_context') + self.wrap_socket = ssl_context.wrap_socket + self.ssl_args = ssl_args + else: + from gevent.ssl import wrap_socket + self.wrap_socket = wrap_socket + self.ssl_args = ssl_args + else: + self.ssl_args = None + if backlog is not None: + if hasattr(self, 'socket'): + raise TypeError('backlog must be None when a socket instance is passed') + self.backlog = backlog + except: + self.close() + raise + + @property + def ssl_enabled(self): + return self.ssl_args is not None + + def set_listener(self, listener): + BaseServer.set_listener(self, listener) + try: + self.socket = self.socket._sock + except AttributeError: + pass + + def init_socket(self): + if not hasattr(self, 'socket'): + # FIXME: clean up the socket lifetime + # pylint:disable=attribute-defined-outside-init + self.socket = self.get_listener(self.address, self.backlog, self.family) + self.address = self.socket.getsockname() + if self.ssl_args: + self._handle = self.wrap_socket_and_handle + else: + self._handle = self.handle + + @classmethod + def get_listener(cls, address, backlog=None, family=None): + if backlog is None: + backlog = cls.backlog + return _tcp_listener(address, backlog=backlog, reuse_addr=cls.reuse_addr, family=family) + + if PY3: + + def do_read(self): + sock = self.socket + try: + fd, address = sock._accept() + except BlockingIOError: # python 2: pylint: disable=undefined-variable + if not sock.timeout: + return + raise + + sock = GeventSocket(sock.family, sock.type, sock.proto, fileno=fd) + # XXX Python issue #7995? + return sock, address + + else: + + def do_read(self): + try: + client_socket, address = self.socket.accept() + except SocketError as err: + if err.args[0] == EWOULDBLOCK: + return + raise + # XXX: When would this not be the case? In Python 3 it makes sense + # because we're using the low-level _accept method, + # but not in Python 2. + if not isinstance(client_socket, GeventSocket): + # This leads to a leak of the watchers in client_socket + sockobj = GeventSocket(_sock=client_socket) + if PYPY: + client_socket._drop() + else: + sockobj = client_socket + return sockobj, address + + def do_close(self, sock, *args): + # pylint:disable=arguments-differ + sock.close() + + def wrap_socket_and_handle(self, client_socket, address): + # used in case of ssl sockets + with _closing_socket(self.wrap_socket(client_socket, **self.ssl_args)) as ssl_socket: + return self.handle(ssl_socket, address) + + +class DatagramServer(BaseServer): + """A UDP server""" + + reuse_addr = DEFAULT_REUSE_ADDR + + def __init__(self, *args, **kwargs): + # The raw (non-gevent) socket, if possible + self._socket = None + BaseServer.__init__(self, *args, **kwargs) + from gevent.lock import Semaphore + self._writelock = Semaphore() + + def init_socket(self): + if not hasattr(self, 'socket'): + # FIXME: clean up the socket lifetime + # pylint:disable=attribute-defined-outside-init + self.socket = self.get_listener(self.address, self.family) + self.address = self.socket.getsockname() + self._socket = self.socket + try: + self._socket = self._socket._sock + except AttributeError: + pass + + @classmethod + def get_listener(cls, address, family=None): + return _udp_socket(address, reuse_addr=cls.reuse_addr, family=family) + + def do_read(self): + try: + data, address = self._socket.recvfrom(8192) + except SocketError as err: + if err.args[0] == EWOULDBLOCK: + return + raise + return data, address + + def sendto(self, *args): + self._writelock.acquire() + try: + self.socket.sendto(*args) + finally: + self._writelock.release() + + +def _tcp_listener(address, backlog=50, reuse_addr=None, family=AF_INET): + """A shortcut to create a TCP socket, bind it and put it into listening state.""" + sock = GeventSocket(family=family) + if reuse_addr is not None: + sock.setsockopt(SOL_SOCKET, SO_REUSEADDR, reuse_addr) + try: + sock.bind(address) + except SocketError as ex: + strerror = getattr(ex, 'strerror', None) + if strerror is not None: + ex.strerror = strerror + ': ' + repr(address) + raise + sock.listen(backlog) + sock.setblocking(0) + return sock + + +def _udp_socket(address, backlog=50, reuse_addr=None, family=AF_INET): + # backlog argument for compat with tcp_listener + # pylint:disable=unused-argument + + # we want gevent.socket.socket here + sock = GeventSocket(family=family, type=SOCK_DGRAM) + if reuse_addr is not None: + sock.setsockopt(SOL_SOCKET, SO_REUSEADDR, reuse_addr) + try: + sock.bind(address) + except SocketError as ex: + strerror = getattr(ex, 'strerror', None) + if strerror is not None: + ex.strerror = strerror + ': ' + repr(address) + raise + return sock diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/signal.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/signal.py new file mode 100644 index 00000000..0954af84 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/signal.py @@ -0,0 +1,137 @@ +""" +Cooperative implementation of special cases of :func:`signal.signal`. + +This module is designed to work with libev's child watchers, as used +by default in :func:`gevent.os.fork` Note that each ``SIGCHLD`` handler +will be run in a new greenlet when the signal is delivered (just like +:class:`gevent.hub.signal`) + +The implementations in this module are only monkey patched if +:func:`gevent.os.waitpid` is being used (the default) and if +:const:`signal.SIGCHLD` is available; see :func:`gevent.os.fork` for +information on configuring this not to be the case for advanced uses. + +.. versionadded:: 1.1b4 +""" + +from __future__ import absolute_import + +from gevent._util import _NONE as _INITIAL +from gevent._util import copy_globals + +import signal as _signal + +__implements__ = [] +__extensions__ = [] + + +_child_handler = _INITIAL + +_signal_signal = _signal.signal +_signal_getsignal = _signal.getsignal + + +def getsignal(signalnum): + """ + Exactly the same as :func:`signal.getsignal` except where + :const:`signal.SIGCHLD` is concerned. + + For :const:`signal.SIGCHLD`, this cooperates with :func:`signal` + to provide consistent answers. + """ + if signalnum != _signal.SIGCHLD: + return _signal_getsignal(signalnum) + + global _child_handler + if _child_handler is _INITIAL: + _child_handler = _signal_getsignal(_signal.SIGCHLD) + + return _child_handler + + +def signal(signalnum, handler): + """ + Exactly the same as :func:`signal.signal` except where + :const:`signal.SIGCHLD` is concerned. + + .. note:: + + A :const:`signal.SIGCHLD` handler installed with this function + will only be triggered for children that are forked using + :func:`gevent.os.fork` (:func:`gevent.os.fork_and_watch`); + children forked before monkey patching, or otherwise by the raw + :func:`os.fork`, will not trigger the handler installed by this + function. (It's unlikely that a SIGCHLD handler installed with + the builtin :func:`signal.signal` would be triggered either; + libev typically overwrites such a handler at the C level. At + the very least, it's full of race conditions.) + + .. note:: + + Use of ``SIG_IGN`` and ``SIG_DFL`` may also have race conditions + with libev child watchers and the :mod:`gevent.subprocess` module. + + .. versionchanged:: 1.2a1 + If ``SIG_IGN`` or ``SIG_DFL`` are used to ignore ``SIGCHLD``, a + future use of ``gevent.subprocess`` and libev child watchers + will once again work. However, on Python 2, use of ``os.popen`` + will fail. + + .. versionchanged:: 1.1rc2 + Allow using ``SIG_IGN`` and ``SIG_DFL`` to reset and ignore ``SIGCHLD``. + However, this allows the possibility of a race condition if ``gevent.subprocess`` + had already been used. + """ + if signalnum != _signal.SIGCHLD: + return _signal_signal(signalnum, handler) + + # TODO: raise value error if not called from the main + # greenlet, just like threads + + if handler != _signal.SIG_IGN and handler != _signal.SIG_DFL and not callable(handler): + # exact same error message raised by the stdlib + raise TypeError("signal handler must be signal.SIG_IGN, signal.SIG_DFL, or a callable object") + + old_handler = getsignal(signalnum) + global _child_handler + _child_handler = handler + if handler in (_signal.SIG_IGN, _signal.SIG_DFL): + # Allow resetting/ignoring this signal at the process level. + # Note that this conflicts with gevent.subprocess and other users + # of child watchers, until the next time gevent.subprocess/loop.install_sigchld() + # is called. + from gevent.hub import get_hub # Are we always safe to import here? + _signal_signal(signalnum, handler) + get_hub().loop.reset_sigchld() + return old_handler + + +def _on_child_hook(): + # This is called in the hub greenlet. To let the function + # do more useful work, like use blocking functions, + # we run it in a new greenlet; see gevent.hub.signal + if callable(_child_handler): + # None is a valid value for the frame argument + from gevent import Greenlet + greenlet = Greenlet(_child_handler, _signal.SIGCHLD, None) + greenlet.switch() + + +import gevent.os + +if 'waitpid' in gevent.os.__implements__ and hasattr(_signal, 'SIGCHLD'): + # Tightly coupled here to gevent.os and its waitpid implementation; only use these + # if necessary. + gevent.os._on_child_hook = _on_child_hook + __implements__.append("signal") + __implements__.append("getsignal") +else: + # XXX: This breaks test__all__ on windows + __extensions__.append("signal") + __extensions__.append("getsignal") + +__imports__ = copy_globals(_signal, globals(), + names_to_ignore=__implements__ + __extensions__, + dunder_names_to_keep=()) + +__all__ = __implements__ + __extensions__ diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/socket.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/socket.py new file mode 100644 index 00000000..1bb039e3 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/socket.py @@ -0,0 +1,129 @@ +# Copyright (c) 2009-2014 Denis Bilenko and gevent contributors. See LICENSE for details. + +"""Cooperative low-level networking interface. + +This module provides socket operations and some related functions. +The API of the functions and classes matches the API of the corresponding +items in the standard :mod:`socket` module exactly, but the synchronous functions +in this module only block the current greenlet and let the others run. + +For convenience, exceptions (like :class:`error ` and :class:`timeout `) +as well as the constants from the :mod:`socket` module are imported into this module. +""" +# Our import magic sadly makes this warning useless +# pylint: disable=undefined-variable + +from gevent._compat import PY3 +from gevent._compat import exc_clear +from gevent._util import copy_globals + + +if PY3: + from gevent import _socket3 as _source # python 2: pylint:disable=no-name-in-module +else: + from gevent import _socket2 as _source + +# define some things we're expecting to overwrite; each module +# needs to define these +__implements__ = __dns__ = __all__ = __extensions__ = __imports__ = () + + +class error(Exception): + errno = None + + +def getfqdn(*args): + # pylint:disable=unused-argument + raise NotImplementedError() + +copy_globals(_source, globals(), + dunder_names_to_keep=('__implements__', '__dns__', '__all__', + '__extensions__', '__imports__', '__socket__'), + cleanup_globs=False) + +# The _socket2 and _socket3 don't import things defined in +# __extensions__, to help avoid confusing reference cycles in the +# documentation and to prevent importing from the wrong place, but we +# *do* need to expose them here. (NOTE: This may lead to some sphinx +# warnings like: +# WARNING: missing attribute mentioned in :members: or __all__: +# module gevent._socket2, attribute cancel_wait +# These can be ignored.) +from gevent import _socketcommon +copy_globals(_socketcommon, globals(), + only_names=_socketcommon.__extensions__) + +try: + _GLOBAL_DEFAULT_TIMEOUT = __socket__._GLOBAL_DEFAULT_TIMEOUT +except AttributeError: + _GLOBAL_DEFAULT_TIMEOUT = object() + + +def create_connection(address, timeout=_GLOBAL_DEFAULT_TIMEOUT, source_address=None): + """ + create_connection(address, timeout=None, source_address=None) -> socket + + Connect to *address* and return the :class:`gevent.socket.socket` + object. + + Convenience function. Connect to *address* (a 2-tuple ``(host, + port)``) and return the socket object. Passing the optional + *timeout* parameter will set the timeout on the socket instance + before attempting to connect. If no *timeout* is supplied, the + global default timeout setting returned by + :func:`getdefaulttimeout` is used. If *source_address* is set it + must be a tuple of (host, port) for the socket to bind as a source + address before making the connection. A host of '' or port 0 tells + the OS to use the default. + """ + + host, port = address + # getaddrinfo is documented as returning a list, but our interface + # is pluggable, so be sure it does. + addrs = list(getaddrinfo(host, port, 0, SOCK_STREAM)) + if not addrs: + raise error("getaddrinfo returns an empty list") + + for res in addrs: + af, socktype, proto, _, sa = res + sock = None + try: + sock = socket(af, socktype, proto) + if timeout is not _GLOBAL_DEFAULT_TIMEOUT: + sock.settimeout(timeout) + if source_address: + sock.bind(source_address) + sock.connect(sa) + except error: + if sock is not None: + sock.close() + sock = None + if res is addrs[-1]: + raise + # without exc_clear(), if connect() fails once, the socket + # is referenced by the frame in exc_info and the next + # bind() fails (see test__socket.TestCreateConnection) + # that does not happen with regular sockets though, + # because _socket.socket.connect() is a built-in. this is + # similar to "getnameinfo loses a reference" failure in + # test_socket.py + exc_clear() + except BaseException: + # Things like GreenletExit, Timeout and KeyboardInterrupt. + # These get raised immediately, being sure to + # close the socket + if sock is not None: + sock.close() + sock = None + raise + else: + try: + return sock + finally: + sock = None + + +# This is promised to be in the __all__ of the _source, but, for circularity reasons, +# we implement it in this module. Mostly for documentation purposes, put it +# in the _source too. +_source.create_connection = create_connection diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/ssl.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/ssl.py new file mode 100644 index 00000000..2418c414 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/ssl.py @@ -0,0 +1,35 @@ +""" +Secure Sockets Layer (SSL/TLS) module. +""" +from gevent._compat import PY2 +from gevent._util import copy_globals + +# things we expect to override, here for static analysis +def wrap_socket(_sock, **_kwargs): + # pylint:disable=unused-argument + raise NotImplementedError() + +if PY2: + if hasattr(__import__('ssl'), 'SSLContext'): + # It's not sufficient to check for >= 2.7.9; some distributions + # have backported most of PEP 466. Try to accommodate them. See Issue #702. + # We're just about to import ssl anyway so it's fine to import it here, just + # don't pollute the namespace + from gevent import _sslgte279 as _source + else: # pragma: no cover + from gevent import _ssl2 as _source + import warnings + warnings.warn( + "This version of Python has an insecure SSL implementation. " + "gevent is no longer tested with it, and support will be removed " + "in gevent 1.5. Please use Python 2.7.9 or newer.", + DeprecationWarning, + stacklevel=2, + ) + del warnings +else: + # Py3 + from gevent import _ssl3 as _source # pragma: no cover + + +copy_globals(_source, globals()) diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/subprocess.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/subprocess.py new file mode 100644 index 00000000..58409c2a --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/subprocess.py @@ -0,0 +1,1688 @@ +""" +Cooperative ``subprocess`` module. + +.. caution:: On POSIX platforms, this module is not usable from native + threads other than the main thread; attempting to do so will raise + a :exc:`TypeError`. This module depends on libev's fork watchers. + On POSIX systems, fork watchers are implemented using signals, and + the thread to which process-directed signals are delivered `is not + defined`_. Because each native thread has its own gevent/libev + loop, this means that a fork watcher registered with one loop + (thread) may never see the signal about a child it spawned if the + signal is sent to a different thread. + +.. note:: The interface of this module is intended to match that of + the standard library :mod:`subprocess` module (with many backwards + compatible extensions from Python 3 backported to Python 2). There + are some small differences between the Python 2 and Python 3 + versions of that module (the Python 2 ``TimeoutExpired`` exception, + notably, extends ``Timeout`` and there is no ``SubprocessError``) and between the + POSIX and Windows versions. The HTML documentation here can only + describe one version; for definitive documentation, see the + standard library or the source code. + +.. _is not defined: http://www.linuxprogrammingblog.com/all-about-linux-signals?page=11 +""" +from __future__ import absolute_import, print_function +# Can we split this up to make it cleaner? See https://github.com/gevent/gevent/issues/748 +# pylint: disable=too-many-lines +# Most of this we inherit from the standard lib +# pylint: disable=bare-except,too-many-locals,too-many-statements,attribute-defined-outside-init +# pylint: disable=too-many-branches,too-many-instance-attributes +# Most of this is cross-platform +# pylint: disable=no-member,expression-not-assigned,unused-argument,unused-variable +import errno +import gc +import os +import signal +import sys +import traceback +from gevent.event import AsyncResult +from gevent.hub import _get_hub_noargs as get_hub +from gevent.hub import linkproxy +from gevent.hub import sleep +from gevent.hub import getcurrent +from gevent._compat import integer_types, string_types, xrange +from gevent._compat import PY3 +from gevent._compat import reraise +from gevent._compat import fspath +from gevent._compat import fsencode +from gevent._util import _NONE +from gevent._util import copy_globals + +from gevent.greenlet import Greenlet, joinall +spawn = Greenlet.spawn +import subprocess as __subprocess__ + + +# Standard functions and classes that this module re-implements in a gevent-aware way. +__implements__ = [ + 'Popen', + 'call', + 'check_call', + 'check_output', +] +if PY3 and not sys.platform.startswith('win32'): + __implements__.append("_posixsubprocess") + _posixsubprocess = None + +# Some symbols we define that we expect to export; +# useful for static analysis +PIPE = "PIPE should be imported" + +# Standard functions and classes that this module re-imports. +__imports__ = [ + 'PIPE', + 'STDOUT', + 'CalledProcessError', + # Windows: + 'CREATE_NEW_CONSOLE', + 'CREATE_NEW_PROCESS_GROUP', + 'STD_INPUT_HANDLE', + 'STD_OUTPUT_HANDLE', + 'STD_ERROR_HANDLE', + 'SW_HIDE', + 'STARTF_USESTDHANDLES', + 'STARTF_USESHOWWINDOW', +] + + +__extra__ = [ + 'MAXFD', + '_eintr_retry_call', + 'STARTUPINFO', + 'pywintypes', + 'list2cmdline', + '_subprocess', + '_winapi', + # Python 2.5 does not have _subprocess, so we don't use it + # XXX We don't run on Py 2.5 anymore; can/could/should we use _subprocess? + # It's only used on mswindows + 'WAIT_OBJECT_0', + 'WaitForSingleObject', + 'GetExitCodeProcess', + 'GetStdHandle', + 'CreatePipe', + 'DuplicateHandle', + 'GetCurrentProcess', + 'DUPLICATE_SAME_ACCESS', + 'GetModuleFileName', + 'GetVersion', + 'CreateProcess', + 'INFINITE', + 'TerminateProcess', + 'STILL_ACTIVE', + + # These were added for 3.5, but we make them available everywhere. + 'run', + 'CompletedProcess', +] + +if sys.version_info[:2] >= (3, 3): + __imports__ += [ + 'DEVNULL', + 'getstatusoutput', + 'getoutput', + 'SubprocessError', + 'TimeoutExpired', + ] +else: + __extra__.append("TimeoutExpired") + + +if sys.version_info[:2] >= (3, 5): + __extra__.remove('run') + __extra__.remove('CompletedProcess') + __implements__.append('run') + __implements__.append('CompletedProcess') + + # Removed in Python 3.5; this is the exact code that was removed: + # https://hg.python.org/cpython/rev/f98b0a5e5ef5 + __extra__.remove('MAXFD') + try: + MAXFD = os.sysconf("SC_OPEN_MAX") + except: + MAXFD = 256 + +if sys.version_info[:2] >= (3, 6): + # This was added to __all__ for windows in 3.6 + __extra__.remove('STARTUPINFO') + __imports__.append('STARTUPINFO') + +if sys.version_info[:2] >= (3, 7): + __imports__.extend([ + 'ABOVE_NORMAL_PRIORITY_CLASS', 'BELOW_NORMAL_PRIORITY_CLASS', + 'HIGH_PRIORITY_CLASS', 'IDLE_PRIORITY_CLASS', + 'NORMAL_PRIORITY_CLASS', + 'REALTIME_PRIORITY_CLASS', + 'CREATE_NO_WINDOW', 'DETACHED_PROCESS', + 'CREATE_DEFAULT_ERROR_MODE', + 'CREATE_BREAKAWAY_FROM_JOB' + ]) + +actually_imported = copy_globals(__subprocess__, globals(), + only_names=__imports__, + ignore_missing_names=True) +# anything we couldn't import from here we may need to find +# elsewhere +__extra__.extend(set(__imports__).difference(set(actually_imported))) +__imports__ = actually_imported +del actually_imported + + +# In Python 3 on Windows, a lot of the functions previously +# in _subprocess moved to _winapi +_subprocess = getattr(__subprocess__, '_subprocess', _NONE) +_winapi = getattr(__subprocess__, '_winapi', _NONE) + +_attr_resolution_order = [__subprocess__, _subprocess, _winapi] + +for name in list(__extra__): + if name in globals(): + continue + value = _NONE + for place in _attr_resolution_order: + value = getattr(place, name, _NONE) + if value is not _NONE: + break + + if value is _NONE: + __extra__.remove(name) + else: + globals()[name] = value + +del _attr_resolution_order +__all__ = __implements__ + __imports__ +# Some other things we want to document +for _x in ('run', 'CompletedProcess', 'TimeoutExpired'): + if _x not in __all__: + __all__.append(_x) + + +mswindows = sys.platform == 'win32' +if mswindows: + import msvcrt # pylint: disable=import-error + if PY3: + class Handle(int): + closed = False + + def Close(self): + if not self.closed: + self.closed = True + _winapi.CloseHandle(self) + + def Detach(self): + if not self.closed: + self.closed = True + return int(self) + raise ValueError("already closed") + + def __repr__(self): + return "Handle(%d)" % int(self) + + __del__ = Close + __str__ = __repr__ +else: + import fcntl + import pickle + from gevent import monkey + fork = monkey.get_original('os', 'fork') + from gevent.os import fork_and_watch + +def call(*popenargs, **kwargs): + """ + call(args, *, stdin=None, stdout=None, stderr=None, shell=False, timeout=None) -> returncode + + Run command with arguments. Wait for command to complete or + timeout, then return the returncode attribute. + + The arguments are the same as for the Popen constructor. Example:: + + retcode = call(["ls", "-l"]) + + .. versionchanged:: 1.2a1 + The ``timeout`` keyword argument is now accepted on all supported + versions of Python (not just Python 3) and if it expires will raise a + :exc:`TimeoutExpired` exception (under Python 2 this is a subclass of :exc:`~.Timeout`). + """ + timeout = kwargs.pop('timeout', None) + with Popen(*popenargs, **kwargs) as p: + try: + return p.wait(timeout=timeout, _raise_exc=True) + except: + p.kill() + p.wait() + raise + +def check_call(*popenargs, **kwargs): + """ + check_call(args, *, stdin=None, stdout=None, stderr=None, shell=False, timeout=None) -> 0 + + Run command with arguments. Wait for command to complete. If + the exit code was zero then return, otherwise raise + :exc:`CalledProcessError`. The ``CalledProcessError`` object will have the + return code in the returncode attribute. + + The arguments are the same as for the Popen constructor. Example:: + + retcode = check_call(["ls", "-l"]) + """ + retcode = call(*popenargs, **kwargs) + if retcode: + cmd = kwargs.get("args") + if cmd is None: + cmd = popenargs[0] + raise CalledProcessError(retcode, cmd) # pylint:disable=undefined-variable + return 0 + +def check_output(*popenargs, **kwargs): + r""" + check_output(args, *, input=None, stdin=None, stderr=None, shell=False, universal_newlines=False, timeout=None) -> output + + Run command with arguments and return its output. + + If the exit code was non-zero it raises a :exc:`CalledProcessError`. The + ``CalledProcessError`` object will have the return code in the returncode + attribute and output in the output attribute. + + + The arguments are the same as for the Popen constructor. Example:: + + >>> check_output(["ls", "-1", "/dev/null"]) + '/dev/null\n' + + The ``stdout`` argument is not allowed as it is used internally. + + To capture standard error in the result, use ``stderr=STDOUT``:: + + >>> print(check_output(["/bin/sh", "-c", + ... "ls -l non_existent_file ; exit 0"], + ... stderr=STDOUT).decode('ascii').strip()) + ls: non_existent_file: No such file or directory + + There is an additional optional argument, "input", allowing you to + pass a string to the subprocess's stdin. If you use this argument + you may not also use the Popen constructor's "stdin" argument, as + it too will be used internally. Example:: + + >>> check_output(["sed", "-e", "s/foo/bar/"], + ... input=b"when in the course of fooman events\n") + 'when in the course of barman events\n' + + If ``universal_newlines=True`` is passed, the return value will be a + string rather than bytes. + + .. versionchanged:: 1.2a1 + The ``timeout`` keyword argument is now accepted on all supported + versions of Python (not just Python 3) and if it expires will raise a + :exc:`TimeoutExpired` exception (under Python 2 this is a subclass of :exc:`~.Timeout`). + .. versionchanged:: 1.2a1 + The ``input`` keyword argument is now accepted on all supported + versions of Python, not just Python 3 + """ + timeout = kwargs.pop('timeout', None) + if 'stdout' in kwargs: + raise ValueError('stdout argument not allowed, it will be overridden.') + if 'input' in kwargs: + if 'stdin' in kwargs: + raise ValueError('stdin and input arguments may not both be used.') + inputdata = kwargs['input'] + del kwargs['input'] + kwargs['stdin'] = PIPE + else: + inputdata = None + with Popen(*popenargs, stdout=PIPE, **kwargs) as process: + try: + output, unused_err = process.communicate(inputdata, timeout=timeout) + except TimeoutExpired: + process.kill() + output, unused_err = process.communicate() + raise TimeoutExpired(process.args, timeout, output=output) + except: + process.kill() + process.wait() + raise + retcode = process.poll() + if retcode: + # pylint:disable=undefined-variable + raise CalledProcessError(retcode, process.args, output=output) + return output + +_PLATFORM_DEFAULT_CLOSE_FDS = object() + +if 'TimeoutExpired' not in globals(): + # Python 2 + + # Make TimeoutExpired inherit from _Timeout so it can be caught + # the way we used to throw things (except Timeout), but make sure it doesn't + # init a timer. Note that we can't have a fake 'SubprocessError' that inherits + # from exception, because we need TimeoutExpired to just be a BaseException for + # bwc. + from gevent.timeout import Timeout as _Timeout + + class TimeoutExpired(_Timeout): + """ + This exception is raised when the timeout expires while waiting for + a child process in `communicate`. + + Under Python 2, this is a gevent extension with the same name as the + Python 3 class for source-code forward compatibility. However, it extends + :class:`gevent.timeout.Timeout` for backwards compatibility (because + we used to just raise a plain ``Timeout``); note that ``Timeout`` is a + ``BaseException``, *not* an ``Exception``. + + .. versionadded:: 1.2a1 + """ + + def __init__(self, cmd, timeout, output=None): + _Timeout.__init__(self, None) + self.cmd = cmd + self.seconds = timeout + self.output = output + + @property + def timeout(self): + return self.seconds + + def __str__(self): + return ("Command '%s' timed out after %s seconds" % + (self.cmd, self.timeout)) + + +if hasattr(os, 'set_inheritable'): + _set_inheritable = os.set_inheritable +else: + _set_inheritable = lambda i, v: True + + +def FileObject(*args): + # Defer importing FileObject until we need it + # to allow it to be configured more easily. + from gevent.fileobject import FileObject as _FileObject + globals()['FileObject'] = _FileObject + return _FileObject(*args) + +class Popen(object): + """ + The underlying process creation and management in this module is + handled by the Popen class. It offers a lot of flexibility so that + developers are able to handle the less common cases not covered by + the convenience functions. + + .. seealso:: :class:`subprocess.Popen` + This class should have the same interface as the standard library class. + + .. versionchanged:: 1.2a1 + Instances can now be used as context managers under Python 2.7. Previously + this was restricted to Python 3. + + .. versionchanged:: 1.2a1 + Instances now save the ``args`` attribute under Python 2.7. Previously this was + restricted to Python 3. + + .. versionchanged:: 1.2b1 + Add the ``encoding`` and ``errors`` parameters for Python 3. + + .. versionchanged:: 1.3a1 + Accept "path-like" objects for the *cwd* parameter on all platforms. + This was added to Python 3.6. Previously with gevent, it only worked + on POSIX platforms on 3.6. + + .. versionchanged:: 1.3a1 + Add the ``text`` argument as a synonym for ``universal_newlines``, + as added on Python 3.7. + + .. versionchanged:: 1.3a2 + Allow the same keyword arguments under Python 2 as Python 3: + ``pass_fds``, ``start_new_session``, ``restore_signals``, ``encoding`` + and ``errors``. Under Python 2, ``encoding`` and ``errors`` are ignored + because native handling of universal newlines is used. + + .. versionchanged:: 1.3a2 + Under Python 2, ``restore_signals`` defaults to ``False``. Previously it + defaulted to ``True``, the same as it did in Python 3. + """ + + # The value returned from communicate() when there was nothing to read. + # Changes if we're in text mode or universal newlines mode. + _communicate_empty_value = b'' + + def __init__(self, args, + bufsize=-1 if PY3 else 0, + executable=None, + stdin=None, stdout=None, stderr=None, + preexec_fn=None, close_fds=_PLATFORM_DEFAULT_CLOSE_FDS, shell=False, + cwd=None, env=None, universal_newlines=None, + startupinfo=None, creationflags=0, + restore_signals=PY3, start_new_session=False, + pass_fds=(), + # Added in 3.6. These are kept as ivars + encoding=None, errors=None, + # Added in 3.7. Not an ivar directly. + text=None, + # gevent additions + threadpool=None): + + self.encoding = encoding + self.errors = errors + + hub = get_hub() + + if bufsize is None: + # Python 2 doesn't allow None at all, but Python 3 treats + # it the same as the default. We do as well. + bufsize = -1 if PY3 else 0 + if not isinstance(bufsize, integer_types): + raise TypeError("bufsize must be an integer") + + if mswindows: + if preexec_fn is not None: + raise ValueError("preexec_fn is not supported on Windows " + "platforms") + if sys.version_info[:2] >= (3, 7): + if close_fds is _PLATFORM_DEFAULT_CLOSE_FDS: + close_fds = True + else: + any_stdio_set = (stdin is not None or stdout is not None or + stderr is not None) + if close_fds is _PLATFORM_DEFAULT_CLOSE_FDS: + if any_stdio_set: + close_fds = False + else: + close_fds = True + elif close_fds and any_stdio_set: + raise ValueError("close_fds is not supported on Windows " + "platforms if you redirect stdin/stdout/stderr") + if threadpool is None: + threadpool = hub.threadpool + self.threadpool = threadpool + self._waiting = False + else: + # POSIX + if close_fds is _PLATFORM_DEFAULT_CLOSE_FDS: + # close_fds has different defaults on Py3/Py2 + if PY3: # pylint: disable=simplifiable-if-statement + close_fds = True + else: + close_fds = False + + if pass_fds and not close_fds: + import warnings + warnings.warn("pass_fds overriding close_fds.", RuntimeWarning) + close_fds = True + if startupinfo is not None: + raise ValueError("startupinfo is only supported on Windows " + "platforms") + if creationflags != 0: + raise ValueError("creationflags is only supported on Windows " + "platforms") + assert threadpool is None + self._loop = hub.loop + + # Validate the combinations of text and universal_newlines + if (text is not None and universal_newlines is not None + and bool(universal_newlines) != bool(text)): + # pylint:disable=undefined-variable + raise SubprocessError('Cannot disambiguate when both text ' + 'and universal_newlines are supplied but ' + 'different. Pass one or the other.') + + self.args = args # Previously this was Py3 only. + self.stdin = None + self.stdout = None + self.stderr = None + self.pid = None + self.returncode = None + self.universal_newlines = universal_newlines + self.result = AsyncResult() + + # Input and output objects. The general principle is like + # this: + # + # Parent Child + # ------ ----- + # p2cwrite ---stdin---> p2cread + # c2pread <--stdout--- c2pwrite + # errread <--stderr--- errwrite + # + # On POSIX, the child objects are file descriptors. On + # Windows, these are Windows file handles. The parent objects + # are file descriptors on both platforms. The parent objects + # are -1 when not using PIPEs. The child objects are -1 + # when not redirecting. + + (p2cread, p2cwrite, + c2pread, c2pwrite, + errread, errwrite) = self._get_handles(stdin, stdout, stderr) + + # We wrap OS handles *before* launching the child, otherwise a + # quickly terminating child could make our fds unwrappable + # (see #8458). + if mswindows: + if p2cwrite != -1: + p2cwrite = msvcrt.open_osfhandle(p2cwrite.Detach(), 0) + if c2pread != -1: + c2pread = msvcrt.open_osfhandle(c2pread.Detach(), 0) + if errread != -1: + errread = msvcrt.open_osfhandle(errread.Detach(), 0) + + text_mode = PY3 and (self.encoding or self.errors or universal_newlines or text) + if text_mode or universal_newlines: + # Always a native str in universal_newlines mode, even when that + # str type is bytes. Additionally, text_mode is only true under + # Python 3, so it's actually a unicode str + self._communicate_empty_value = '' + + + if p2cwrite != -1: + if PY3 and text_mode: + # Under Python 3, if we left on the 'b' we'd get different results + # depending on whether we used FileObjectPosix or FileObjectThread + self.stdin = FileObject(p2cwrite, 'wb', bufsize) + self.stdin.translate_newlines(None, + write_through=True, + line_buffering=(bufsize == 1), + encoding=self.encoding, errors=self.errors) + else: + self.stdin = FileObject(p2cwrite, 'wb', bufsize) + if c2pread != -1: + if universal_newlines or text_mode: + if PY3: + # FileObjectThread doesn't support the 'U' qualifier + # with a bufsize of 0 + self.stdout = FileObject(c2pread, 'rb', bufsize) + # NOTE: Universal Newlines are broken on Windows/Py3, at least + # in some cases. This is true in the stdlib subprocess module + # as well; the following line would fix the test cases in + # test__subprocess.py that depend on python_universal_newlines, + # but would be inconsistent with the stdlib: + #msvcrt.setmode(self.stdout.fileno(), os.O_TEXT) + self.stdout.translate_newlines('r', encoding=self.encoding, errors=self.errors) + else: + self.stdout = FileObject(c2pread, 'rU', bufsize) + else: + self.stdout = FileObject(c2pread, 'rb', bufsize) + if errread != -1: + if universal_newlines or text_mode: + if PY3: + self.stderr = FileObject(errread, 'rb', bufsize) + self.stderr.translate_newlines(None, encoding=encoding, errors=errors) + else: + self.stderr = FileObject(errread, 'rU', bufsize) + else: + self.stderr = FileObject(errread, 'rb', bufsize) + + self._closed_child_pipe_fds = False + # Convert here for the sake of all platforms. os.chdir accepts + # path-like objects natively under 3.6, but CreateProcess + # doesn't. + cwd = fspath(cwd) if cwd is not None else None + try: + self._execute_child(args, executable, preexec_fn, close_fds, + pass_fds, cwd, env, universal_newlines, + startupinfo, creationflags, shell, + p2cread, p2cwrite, + c2pread, c2pwrite, + errread, errwrite, + restore_signals, start_new_session) + except: + # Cleanup if the child failed starting. + # (gevent: New in python3, but reported as gevent bug in #347. + # Note that under Py2, any error raised below will replace the + # original error so we have to use reraise) + if not PY3: + exc_info = sys.exc_info() + for f in filter(None, (self.stdin, self.stdout, self.stderr)): + try: + f.close() + except (OSError, IOError): + pass # Ignore EBADF or other errors. + + if not self._closed_child_pipe_fds: + to_close = [] + if stdin == PIPE: + to_close.append(p2cread) + if stdout == PIPE: + to_close.append(c2pwrite) + if stderr == PIPE: + to_close.append(errwrite) + if hasattr(self, '_devnull'): + to_close.append(self._devnull) + for fd in to_close: + try: + os.close(fd) + except (OSError, IOError): + pass + if not PY3: + try: + reraise(*exc_info) + finally: + del exc_info + raise + + def __repr__(self): + return '<%s at 0x%x pid=%r returncode=%r>' % (self.__class__.__name__, id(self), self.pid, self.returncode) + + def _on_child(self, watcher): + watcher.stop() + status = watcher.rstatus + if os.WIFSIGNALED(status): + self.returncode = -os.WTERMSIG(status) + else: + self.returncode = os.WEXITSTATUS(status) + self.result.set(self.returncode) + + def _get_devnull(self): + if not hasattr(self, '_devnull'): + self._devnull = os.open(os.devnull, os.O_RDWR) + return self._devnull + + _stdout_buffer = None + _stderr_buffer = None + + def communicate(self, input=None, timeout=None): + """Interact with process: Send data to stdin. Read data from + stdout and stderr, until end-of-file is reached. Wait for + process to terminate. The optional input argument should be a + string to be sent to the child process, or None, if no data + should be sent to the child. + + communicate() returns a tuple (stdout, stderr). + + :keyword timeout: Under Python 2, this is a gevent extension; if + given and it expires, we will raise :exc:`TimeoutExpired`, which + extends :exc:`gevent.timeout.Timeout` (note that this only extends :exc:`BaseException`, + *not* :exc:`Exception`) + Under Python 3, this raises the standard :exc:`TimeoutExpired` exception. + + .. versionchanged:: 1.1a2 + Under Python 2, if the *timeout* elapses, raise the :exc:`gevent.timeout.Timeout` + exception. Previously, we silently returned. + .. versionchanged:: 1.1b5 + Honor a *timeout* even if there's no way to communicate with the child + (stdin, stdout, and stderr are not pipes). + """ + greenlets = [] + if self.stdin: + greenlets.append(spawn(write_and_close, self.stdin, input)) + + # If the timeout parameter is used, and the caller calls back after + # getting a TimeoutExpired exception, we can wind up with multiple + # greenlets trying to run and read from and close stdout/stderr. + # That's bad because it can lead to 'RuntimeError: reentrant call in io.BufferedReader'. + # We can't just kill the previous greenlets when a timeout happens, + # though, because we risk losing the output collected by that greenlet + # (and Python 3, where timeout is an official parameter, explicitly says + # that no output should be lost in the event of a timeout.) Instead, we're + # watching for the exception and ignoring it. It's not elegant, + # but it works + def _make_pipe_reader(pipe_name): + pipe = getattr(self, pipe_name) + buf_name = '_' + pipe_name + '_buffer' + + def _read(): + try: + data = pipe.read() + except RuntimeError: + return + if not data: + return + the_buffer = getattr(self, buf_name) + if the_buffer: + the_buffer.append(data) + else: + setattr(self, buf_name, [data]) + return _read + + if self.stdout: + _read_out = _make_pipe_reader('stdout') + stdout = spawn(_read_out) + greenlets.append(stdout) + else: + stdout = None + + if self.stderr: + _read_err = _make_pipe_reader('stderr') + stderr = spawn(_read_err) + greenlets.append(stderr) + else: + stderr = None + + # If we were given stdin=stdout=stderr=None, we have no way to + # communicate with the child, and thus no greenlets to wait + # on. This is a nonsense case, but it comes up in the test + # case for Python 3.5 (test_subprocess.py + # RunFuncTestCase.test_timeout). Instead, we go directly to + # self.wait + if not greenlets and timeout is not None: + self.wait(timeout=timeout, _raise_exc=True) + + done = joinall(greenlets, timeout=timeout) + if timeout is not None and len(done) != len(greenlets): + raise TimeoutExpired(self.args, timeout) + + for pipe in (self.stdout, self.stderr): + if pipe: + try: + pipe.close() + except RuntimeError: + pass + + self.wait() + + def _get_output_value(pipe_name): + buf_name = '_' + pipe_name + '_buffer' + buf_value = getattr(self, buf_name) + setattr(self, buf_name, None) + if buf_value: + buf_value = self._communicate_empty_value.join(buf_value) + else: + buf_value = self._communicate_empty_value + return buf_value + + stdout_value = _get_output_value('stdout') + stderr_value = _get_output_value('stderr') + + return (None if stdout is None else stdout_value, + None if stderr is None else stderr_value) + + def poll(self): + """Check if child process has terminated. Set and return :attr:`returncode` attribute.""" + return self._internal_poll() + + def __enter__(self): + return self + + def __exit__(self, t, v, tb): + if self.stdout: + self.stdout.close() + if self.stderr: + self.stderr.close() + try: # Flushing a BufferedWriter may raise an error + if self.stdin: + self.stdin.close() + finally: + # Wait for the process to terminate, to avoid zombies. + # JAM: gevent: If the process never terminates, this + # blocks forever. + self.wait() + + def _gevent_result_wait(self, timeout=None, raise_exc=PY3): + result = self.result.wait(timeout=timeout) + if raise_exc and timeout is not None and not self.result.ready(): + raise TimeoutExpired(self.args, timeout) + return result + + + if mswindows: + # + # Windows methods + # + def _get_handles(self, stdin, stdout, stderr): + """Construct and return tuple with IO objects: + p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite + """ + # pylint:disable=undefined-variable + if stdin is None and stdout is None and stderr is None: + return (-1, -1, -1, -1, -1, -1) + + p2cread, p2cwrite = -1, -1 + c2pread, c2pwrite = -1, -1 + errread, errwrite = -1, -1 + + try: + DEVNULL + except NameError: + _devnull = object() + else: + _devnull = DEVNULL + + if stdin is None: + p2cread = GetStdHandle(STD_INPUT_HANDLE) + if p2cread is None: + p2cread, _ = CreatePipe(None, 0) + if PY3: + p2cread = Handle(p2cread) + _winapi.CloseHandle(_) + elif stdin == PIPE: + p2cread, p2cwrite = CreatePipe(None, 0) + if PY3: + p2cread, p2cwrite = Handle(p2cread), Handle(p2cwrite) + elif stdin == _devnull: + p2cread = msvcrt.get_osfhandle(self._get_devnull()) + elif isinstance(stdin, int): + p2cread = msvcrt.get_osfhandle(stdin) + else: + # Assuming file-like object + p2cread = msvcrt.get_osfhandle(stdin.fileno()) + p2cread = self._make_inheritable(p2cread) + + if stdout is None: + c2pwrite = GetStdHandle(STD_OUTPUT_HANDLE) + if c2pwrite is None: + _, c2pwrite = CreatePipe(None, 0) + if PY3: + c2pwrite = Handle(c2pwrite) + _winapi.CloseHandle(_) + elif stdout == PIPE: + c2pread, c2pwrite = CreatePipe(None, 0) + if PY3: + c2pread, c2pwrite = Handle(c2pread), Handle(c2pwrite) + elif stdout == _devnull: + c2pwrite = msvcrt.get_osfhandle(self._get_devnull()) + elif isinstance(stdout, int): + c2pwrite = msvcrt.get_osfhandle(stdout) + else: + # Assuming file-like object + c2pwrite = msvcrt.get_osfhandle(stdout.fileno()) + c2pwrite = self._make_inheritable(c2pwrite) + + if stderr is None: + errwrite = GetStdHandle(STD_ERROR_HANDLE) + if errwrite is None: + _, errwrite = CreatePipe(None, 0) + if PY3: + errwrite = Handle(errwrite) + _winapi.CloseHandle(_) + elif stderr == PIPE: + errread, errwrite = CreatePipe(None, 0) + if PY3: + errread, errwrite = Handle(errread), Handle(errwrite) + elif stderr == STDOUT: + errwrite = c2pwrite + elif stderr == _devnull: + errwrite = msvcrt.get_osfhandle(self._get_devnull()) + elif isinstance(stderr, int): + errwrite = msvcrt.get_osfhandle(stderr) + else: + # Assuming file-like object + errwrite = msvcrt.get_osfhandle(stderr.fileno()) + errwrite = self._make_inheritable(errwrite) + + return (p2cread, p2cwrite, + c2pread, c2pwrite, + errread, errwrite) + + def _make_inheritable(self, handle): + """Return a duplicate of handle, which is inheritable""" + # pylint:disable=undefined-variable + return DuplicateHandle(GetCurrentProcess(), + handle, GetCurrentProcess(), 0, 1, + DUPLICATE_SAME_ACCESS) + + def _find_w9xpopen(self): + """Find and return absolute path to w9xpopen.exe""" + # pylint:disable=undefined-variable + w9xpopen = os.path.join(os.path.dirname(GetModuleFileName(0)), + "w9xpopen.exe") + if not os.path.exists(w9xpopen): + # Eeek - file-not-found - possibly an embedding + # situation - see if we can locate it in sys.exec_prefix + w9xpopen = os.path.join(os.path.dirname(sys.exec_prefix), + "w9xpopen.exe") + if not os.path.exists(w9xpopen): + raise RuntimeError("Cannot locate w9xpopen.exe, which is " + "needed for Popen to work with your " + "shell or platform.") + return w9xpopen + + + def _filter_handle_list(self, handle_list): + """Filter out console handles that can't be used + in lpAttributeList["handle_list"] and make sure the list + isn't empty. This also removes duplicate handles.""" + # An handle with it's lowest two bits set might be a special console + # handle that if passed in lpAttributeList["handle_list"], will + # cause it to fail. + # Only works on 3.7+ + return list({handle for handle in handle_list + if handle & 0x3 != 0x3 + or _winapi.GetFileType(handle) != + _winapi.FILE_TYPE_CHAR}) + + + def _execute_child(self, args, executable, preexec_fn, close_fds, + pass_fds, cwd, env, universal_newlines, + startupinfo, creationflags, shell, + p2cread, p2cwrite, + c2pread, c2pwrite, + errread, errwrite, + unused_restore_signals, unused_start_new_session): + """Execute program (MS Windows version)""" + # pylint:disable=undefined-variable + assert not pass_fds, "pass_fds not supported on Windows." + + if not isinstance(args, string_types): + args = list2cmdline(args) + + # Process startup details + if startupinfo is None: + startupinfo = STARTUPINFO() + use_std_handles = -1 not in (p2cread, c2pwrite, errwrite) + if use_std_handles: + startupinfo.dwFlags |= STARTF_USESTDHANDLES + startupinfo.hStdInput = p2cread + startupinfo.hStdOutput = c2pwrite + startupinfo.hStdError = errwrite + + if hasattr(startupinfo, 'lpAttributeList'): + # Support for Python >= 3.7 + + attribute_list = startupinfo.lpAttributeList + have_handle_list = bool(attribute_list and + "handle_list" in attribute_list and + attribute_list["handle_list"]) + + # If we were given an handle_list or need to create one + if have_handle_list or (use_std_handles and close_fds): + if attribute_list is None: + attribute_list = startupinfo.lpAttributeList = {} + handle_list = attribute_list["handle_list"] = \ + list(attribute_list.get("handle_list", [])) + + if use_std_handles: + handle_list += [int(p2cread), int(c2pwrite), int(errwrite)] + + handle_list[:] = self._filter_handle_list(handle_list) + + if handle_list: + if not close_fds: + import warnings + warnings.warn("startupinfo.lpAttributeList['handle_list'] " + "overriding close_fds", RuntimeWarning) + + # When using the handle_list we always request to inherit + # handles but the only handles that will be inherited are + # the ones in the handle_list + close_fds = False + + if shell: + startupinfo.dwFlags |= STARTF_USESHOWWINDOW + startupinfo.wShowWindow = SW_HIDE + comspec = os.environ.get("COMSPEC", "cmd.exe") + args = '{} /c "{}"'.format(comspec, args) + if GetVersion() >= 0x80000000 or os.path.basename(comspec).lower() == "command.com": + # Win9x, or using command.com on NT. We need to + # use the w9xpopen intermediate program. For more + # information, see KB Q150956 + # (http://web.archive.org/web/20011105084002/http://support.microsoft.com/support/kb/articles/Q150/9/56.asp) + w9xpopen = self._find_w9xpopen() + args = '"%s" %s' % (w9xpopen, args) + # Not passing CREATE_NEW_CONSOLE has been known to + # cause random failures on win9x. Specifically a + # dialog: "Your program accessed mem currently in + # use at xxx" and a hopeful warning about the + # stability of your system. Cost is Ctrl+C wont + # kill children. + creationflags |= CREATE_NEW_CONSOLE + + # Start the process + try: + hp, ht, pid, tid = CreateProcess(executable, args, + # no special security + None, None, + int(not close_fds), + creationflags, + env, + cwd, + startupinfo) + except IOError as e: # From 2.6 on, pywintypes.error was defined as IOError + # Translate pywintypes.error to WindowsError, which is + # a subclass of OSError. FIXME: We should really + # translate errno using _sys_errlist (or similar), but + # how can this be done from Python? + if PY3: + raise # don't remap here + raise WindowsError(*e.args) + finally: + # Child is launched. Close the parent's copy of those pipe + # handles that only the child should have open. You need + # to make sure that no handles to the write end of the + # output pipe are maintained in this process or else the + # pipe will not close when the child process exits and the + # ReadFile will hang. + def _close(x): + if x is not None and x != -1: + if hasattr(x, 'Close'): + x.Close() + else: + _winapi.CloseHandle(x) + + _close(p2cread) + _close(c2pwrite) + _close(errwrite) + if hasattr(self, '_devnull'): + os.close(self._devnull) + + # Retain the process handle, but close the thread handle + self._child_created = True + self._handle = Handle(hp) if not hasattr(hp, 'Close') else hp + self.pid = pid + _winapi.CloseHandle(ht) if not hasattr(ht, 'Close') else ht.Close() + + def _internal_poll(self): + """Check if child process has terminated. Returns returncode + attribute. + """ + # pylint:disable=undefined-variable + if self.returncode is None: + if WaitForSingleObject(self._handle, 0) == WAIT_OBJECT_0: + self.returncode = GetExitCodeProcess(self._handle) + self.result.set(self.returncode) + return self.returncode + + def rawlink(self, callback): + if not self.result.ready() and not self._waiting: + self._waiting = True + Greenlet.spawn(self._wait) + self.result.rawlink(linkproxy(callback, self)) + # XXX unlink + + def _blocking_wait(self): + # pylint:disable=undefined-variable + WaitForSingleObject(self._handle, INFINITE) + self.returncode = GetExitCodeProcess(self._handle) + return self.returncode + + def _wait(self): + self.threadpool.spawn(self._blocking_wait).rawlink(self.result) + + def wait(self, timeout=None, _raise_exc=PY3): + """Wait for child process to terminate. Returns returncode + attribute.""" + if self.returncode is None: + if not self._waiting: + self._waiting = True + self._wait() + return self._gevent_result_wait(timeout, _raise_exc) + + def send_signal(self, sig): + """Send a signal to the process + """ + if sig == signal.SIGTERM: + self.terminate() + elif sig == signal.CTRL_C_EVENT: + os.kill(self.pid, signal.CTRL_C_EVENT) + elif sig == signal.CTRL_BREAK_EVENT: + os.kill(self.pid, signal.CTRL_BREAK_EVENT) + else: + raise ValueError("Unsupported signal: {}".format(sig)) + + def terminate(self): + """Terminates the process + """ + # pylint:disable=undefined-variable + # Don't terminate a process that we know has already died. + if self.returncode is not None: + return + try: + TerminateProcess(self._handle, 1) + except OSError as e: + # ERROR_ACCESS_DENIED (winerror 5) is received when the + # process already died. + if e.winerror != 5: + raise + rc = GetExitCodeProcess(self._handle) + if rc == STILL_ACTIVE: + raise + self.returncode = rc + self.result.set(self.returncode) + + kill = terminate + + else: + # + # POSIX methods + # + + def rawlink(self, callback): + # Not public documented, part of the link protocol + self.result.rawlink(linkproxy(callback, self)) + # XXX unlink + + def _get_handles(self, stdin, stdout, stderr): + """Construct and return tuple with IO objects: + p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite + """ + p2cread, p2cwrite = -1, -1 + c2pread, c2pwrite = -1, -1 + errread, errwrite = -1, -1 + + try: + DEVNULL + except NameError: + _devnull = object() + else: + _devnull = DEVNULL + + if stdin is None: + pass + elif stdin == PIPE: + p2cread, p2cwrite = self.pipe_cloexec() + elif stdin == _devnull: + p2cread = self._get_devnull() + elif isinstance(stdin, int): + p2cread = stdin + else: + # Assuming file-like object + p2cread = stdin.fileno() + + if stdout is None: + pass + elif stdout == PIPE: + c2pread, c2pwrite = self.pipe_cloexec() + elif stdout == _devnull: + c2pwrite = self._get_devnull() + elif isinstance(stdout, int): + c2pwrite = stdout + else: + # Assuming file-like object + c2pwrite = stdout.fileno() + + if stderr is None: + pass + elif stderr == PIPE: + errread, errwrite = self.pipe_cloexec() + elif stderr == STDOUT: # pylint:disable=undefined-variable + if c2pwrite != -1: + errwrite = c2pwrite + else: # child's stdout is not set, use parent's stdout + errwrite = sys.__stdout__.fileno() + elif stderr == _devnull: + errwrite = self._get_devnull() + elif isinstance(stderr, int): + errwrite = stderr + else: + # Assuming file-like object + errwrite = stderr.fileno() + + return (p2cread, p2cwrite, + c2pread, c2pwrite, + errread, errwrite) + + def _set_cloexec_flag(self, fd, cloexec=True): + try: + cloexec_flag = fcntl.FD_CLOEXEC + except AttributeError: + cloexec_flag = 1 + + old = fcntl.fcntl(fd, fcntl.F_GETFD) + if cloexec: + fcntl.fcntl(fd, fcntl.F_SETFD, old | cloexec_flag) + else: + fcntl.fcntl(fd, fcntl.F_SETFD, old & ~cloexec_flag) + + def _remove_nonblock_flag(self, fd): + flags = fcntl.fcntl(fd, fcntl.F_GETFL) & (~os.O_NONBLOCK) + fcntl.fcntl(fd, fcntl.F_SETFL, flags) + + def pipe_cloexec(self): + """Create a pipe with FDs set CLOEXEC.""" + # Pipes' FDs are set CLOEXEC by default because we don't want them + # to be inherited by other subprocesses: the CLOEXEC flag is removed + # from the child's FDs by _dup2(), between fork() and exec(). + # This is not atomic: we would need the pipe2() syscall for that. + r, w = os.pipe() + self._set_cloexec_flag(r) + self._set_cloexec_flag(w) + return r, w + + _POSSIBLE_FD_DIRS = ( + '/proc/self/fd', # Linux + '/dev/fd', # BSD, including macOS + ) + + @classmethod + def _close_fds(cls, keep, errpipe_write): + # From the C code: + # errpipe_write is part of keep. It must be closed at + # exec(), but kept open in the child process until exec() is + # called. + for path in cls._POSSIBLE_FD_DIRS: + if os.path.isdir(path): + return cls._close_fds_from_path(path, keep, errpipe_write) + return cls._close_fds_brute_force(keep, errpipe_write) + + @classmethod + def _close_fds_from_path(cls, path, keep, errpipe_write): + # path names a directory whose only entries have + # names that are ascii strings of integers in base10, + # corresponding to the fds the current process has open + try: + fds = [int(fname) for fname in os.listdir(path)] + except (ValueError, OSError): + cls._close_fds_brute_force(keep, errpipe_write) + else: + for i in keep: + if i == errpipe_write: + continue + _set_inheritable(i, True) + + for fd in fds: + if fd in keep or fd < 3: + continue + try: + os.close(fd) + except: + pass + + @classmethod + def _close_fds_brute_force(cls, keep, errpipe_write): + # `keep` is a set of fds, so we + # use os.closerange from 3 to min(keep) + # and then from max(keep + 1) to MAXFD and + # loop through filling in the gaps. + + # Under new python versions, we need to explicitly set + # passed fds to be inheritable or they will go away on exec + + # XXX: Bug: We implicitly rely on errpipe_write being the largest open + # FD so that we don't change its cloexec flag. + + assert hasattr(os, 'closerange') # Added in 2.7 + keep = sorted(keep) + min_keep = min(keep) + max_keep = max(keep) + os.closerange(3, min_keep) + os.closerange(max_keep + 1, MAXFD) + + for i in xrange(min_keep, max_keep): + if i in keep: + _set_inheritable(i, True) + continue + + try: + os.close(i) + except: + pass + + def _execute_child(self, args, executable, preexec_fn, close_fds, + pass_fds, cwd, env, universal_newlines, + startupinfo, creationflags, shell, + p2cread, p2cwrite, + c2pread, c2pwrite, + errread, errwrite, + restore_signals, start_new_session): + """Execute program (POSIX version)""" + + if PY3 and isinstance(args, (str, bytes)): + args = [args] + elif not PY3 and isinstance(args, string_types): + args = [args] + else: + try: + args = list(args) + except TypeError: # os.PathLike instead of a sequence? + args = [fsencode(args)] # os.PathLike -> [str] + + if shell: + args = ["/bin/sh", "-c"] + args + if executable: + args[0] = executable + + if executable is None: + executable = args[0] + + self._loop.install_sigchld() + + # For transferring possible exec failure from child to parent + # The first char specifies the exception type: 0 means + # OSError, 1 means some other error. + errpipe_read, errpipe_write = self.pipe_cloexec() + # errpipe_write must not be in the standard io 0, 1, or 2 fd range. + low_fds_to_close = [] + while errpipe_write < 3: + low_fds_to_close.append(errpipe_write) + errpipe_write = os.dup(errpipe_write) + for low_fd in low_fds_to_close: + os.close(low_fd) + try: + try: + gc_was_enabled = gc.isenabled() + # Disable gc to avoid bug where gc -> file_dealloc -> + # write to stderr -> hang. http://bugs.python.org/issue1336 + gc.disable() + try: + self.pid = fork_and_watch(self._on_child, self._loop, True, fork) + except: + if gc_was_enabled: + gc.enable() + raise + if self.pid == 0: + # Child + + # XXX: Technically we're doing a lot of stuff here that + # may not be safe to do before a exec(), depending on the OS. + # CPython 3 goes to great lengths to precompute a lot + # of this info before the fork and pass it all to C functions that + # try hard not to call things like malloc(). (Of course, + # CPython 2 pretty much did what we're doing.) + try: + # Close parent's pipe ends + if p2cwrite != -1: + os.close(p2cwrite) + if c2pread != -1: + os.close(c2pread) + if errread != -1: + os.close(errread) + os.close(errpipe_read) + + # When duping fds, if there arises a situation + # where one of the fds is either 0, 1 or 2, it + # is possible that it is overwritten (#12607). + if c2pwrite == 0: + c2pwrite = os.dup(c2pwrite) + while errwrite in (0, 1): + errwrite = os.dup(errwrite) + + # Dup fds for child + def _dup2(existing, desired): + # dup2() removes the CLOEXEC flag but + # we must do it ourselves if dup2() + # would be a no-op (issue #10806). + if existing == desired: + self._set_cloexec_flag(existing, False) + elif existing != -1: + os.dup2(existing, desired) + try: + self._remove_nonblock_flag(desired) + except OSError: + # Ignore EBADF, it may not actually be + # open yet. + # Tested beginning in 3.7.0b3 test_subprocess.py + pass + _dup2(p2cread, 0) + _dup2(c2pwrite, 1) + _dup2(errwrite, 2) + + # Close pipe fds. Make sure we don't close the + # same fd more than once, or standard fds. + closed = set([None]) + for fd in [p2cread, c2pwrite, errwrite]: + if fd not in closed and fd > 2: + os.close(fd) + closed.add(fd) + + if cwd is not None: + try: + os.chdir(cwd) + except OSError as e: + e._failed_chdir = True + raise + + if preexec_fn: + preexec_fn() + + # Close all other fds, if asked for. This must be done + # after preexec_fn runs. + if close_fds: + fds_to_keep = set(pass_fds) + fds_to_keep.add(errpipe_write) + self._close_fds(fds_to_keep, errpipe_write) + + if restore_signals: + # restore the documented signals back to sig_dfl; + # not all will be defined on every platform + for sig in 'SIGPIPE', 'SIGXFZ', 'SIGXFSZ': + sig = getattr(signal, sig, None) + if sig is not None: + signal.signal(sig, signal.SIG_DFL) + + if start_new_session: + os.setsid() + + if env is None: + os.execvp(executable, args) + else: + if PY3: + # Python 3.6 started testing for + # bytes values in the env; it also + # started encoding strs using + # fsencode and using a lower-level + # API that takes a list of keys + # and values. We don't have access + # to that API, so we go the reverse direction. + env = {os.fsdecode(k) if isinstance(k, bytes) else k: + os.fsdecode(v) if isinstance(v, bytes) else v + for k, v in env.items()} + os.execvpe(executable, args, env) + + except: + exc_type, exc_value, tb = sys.exc_info() + # Save the traceback and attach it to the exception object + exc_lines = traceback.format_exception(exc_type, + exc_value, + tb) + exc_value.child_traceback = ''.join(exc_lines) + os.write(errpipe_write, pickle.dumps(exc_value)) + + finally: + # Make sure that the process exits no matter what. + # The return code does not matter much as it won't be + # reported to the application + os._exit(1) + + # Parent + self._child_created = True + if gc_was_enabled: + gc.enable() + finally: + # be sure the FD is closed no matter what + os.close(errpipe_write) + + # self._devnull is not always defined. + devnull_fd = getattr(self, '_devnull', None) + if p2cread != -1 and p2cwrite != -1 and p2cread != devnull_fd: + os.close(p2cread) + if c2pwrite != -1 and c2pread != -1 and c2pwrite != devnull_fd: + os.close(c2pwrite) + if errwrite != -1 and errread != -1 and errwrite != devnull_fd: + os.close(errwrite) + if devnull_fd is not None: + os.close(devnull_fd) + # Prevent a double close of these fds from __init__ on error. + self._closed_child_pipe_fds = True + + # Wait for exec to fail or succeed; possibly raising exception + errpipe_read = FileObject(errpipe_read, 'rb') + data = errpipe_read.read() + finally: + if hasattr(errpipe_read, 'close'): + errpipe_read.close() + else: + os.close(errpipe_read) + + if data != b"": + self.wait() + child_exception = pickle.loads(data) + for fd in (p2cwrite, c2pread, errread): + if fd is not None and fd != -1: + os.close(fd) + if isinstance(child_exception, OSError): + child_exception.filename = executable + if hasattr(child_exception, '_failed_chdir'): + child_exception.filename = cwd + raise child_exception + + def _handle_exitstatus(self, sts): + if os.WIFSIGNALED(sts): + self.returncode = -os.WTERMSIG(sts) + elif os.WIFEXITED(sts): + self.returncode = os.WEXITSTATUS(sts) + else: + # Should never happen + raise RuntimeError("Unknown child exit status!") + + def _internal_poll(self): + """Check if child process has terminated. Returns returncode + attribute. + """ + if self.returncode is None: + if get_hub() is not getcurrent(): + sig_pending = getattr(self._loop, 'sig_pending', True) + if sig_pending: + sleep(0.00001) + return self.returncode + + def wait(self, timeout=None, _raise_exc=PY3): + """ + Wait for child process to terminate. Returns :attr:`returncode` + attribute. + + :keyword timeout: The floating point number of seconds to + wait. Under Python 2, this is a gevent extension, and + we simply return if it expires. Under Python 3, if + this time elapses without finishing the process, + :exc:`TimeoutExpired` is raised. + """ + return self._gevent_result_wait(timeout, _raise_exc) + + def send_signal(self, sig): + """Send a signal to the process + """ + # Skip signalling a process that we know has already died. + if self.returncode is None: + os.kill(self.pid, sig) + + def terminate(self): + """Terminate the process with SIGTERM + """ + self.send_signal(signal.SIGTERM) + + def kill(self): + """Kill the process with SIGKILL + """ + self.send_signal(signal.SIGKILL) + + +def write_and_close(fobj, data): + try: + if data: + fobj.write(data) + if hasattr(fobj, 'flush'): + # 3.6 started expecting flush to be called. + fobj.flush() + except (OSError, IOError) as ex: + if ex.errno != errno.EPIPE and ex.errno != errno.EINVAL: + raise + finally: + try: + fobj.close() + except EnvironmentError: + pass + +def _with_stdout_stderr(exc, stderr): + # Prior to Python 3.5, most exceptions didn't have stdout + # and stderr attributes and can't take the stderr attribute in their + # constructor + exc.stdout = exc.output + exc.stderr = stderr + return exc + +class CompletedProcess(object): + """ + A process that has finished running. + + This is returned by run(). + + Attributes: + - args: The list or str args passed to run(). + - returncode: The exit code of the process, negative for signals. + - stdout: The standard output (None if not captured). + - stderr: The standard error (None if not captured). + + .. versionadded:: 1.2a1 + This first appeared in Python 3.5 and is available to all + Python versions in gevent. + """ + def __init__(self, args, returncode, stdout=None, stderr=None): + self.args = args + self.returncode = returncode + self.stdout = stdout + self.stderr = stderr + + def __repr__(self): + args = ['args={!r}'.format(self.args), + 'returncode={!r}'.format(self.returncode)] + if self.stdout is not None: + args.append('stdout={!r}'.format(self.stdout)) + if self.stderr is not None: + args.append('stderr={!r}'.format(self.stderr)) + return "{}({})".format(type(self).__name__, ', '.join(args)) + + def check_returncode(self): + """Raise CalledProcessError if the exit code is non-zero.""" + if self.returncode: + # pylint:disable=undefined-variable + raise _with_stdout_stderr(CalledProcessError(self.returncode, self.args, self.stdout), self.stderr) + + +def run(*popenargs, **kwargs): + """ + run(args, *, stdin=None, input=None, stdout=None, stderr=None, shell=False, timeout=None, check=False) -> CompletedProcess + + Run command with arguments and return a CompletedProcess instance. + + The returned instance will have attributes args, returncode, stdout and + stderr. By default, stdout and stderr are not captured, and those attributes + will be None. Pass stdout=PIPE and/or stderr=PIPE in order to capture them. + If check is True and the exit code was non-zero, it raises a + CalledProcessError. The CalledProcessError object will have the return code + in the returncode attribute, and output & stderr attributes if those streams + were captured. + + If timeout is given, and the process takes too long, a TimeoutExpired + exception will be raised. + + There is an optional argument "input", allowing you to + pass a string to the subprocess's stdin. If you use this argument + you may not also use the Popen constructor's "stdin" argument, as + it will be used internally. + The other arguments are the same as for the Popen constructor. + If universal_newlines=True is passed, the "input" argument must be a + string and stdout/stderr in the returned object will be strings rather than + bytes. + + .. versionadded:: 1.2a1 + This function first appeared in Python 3.5. It is available on all Python + versions gevent supports. + + .. versionchanged:: 1.3a2 + Add the ``capture_output`` argument from Python 3.7. It automatically sets + ``stdout`` and ``stderr`` to ``PIPE``. It is an error to pass either + of those arguments along with ``capture_output``. + """ + input = kwargs.pop('input', None) + timeout = kwargs.pop('timeout', None) + check = kwargs.pop('check', False) + capture_output = kwargs.pop('capture_output', False) + + if input is not None: + if 'stdin' in kwargs: + raise ValueError('stdin and input arguments may not both be used.') + kwargs['stdin'] = PIPE + + if capture_output: + if ('stdout' in kwargs) or ('stderr' in kwargs): + raise ValueError('stdout and stderr arguments may not be used ' + 'with capture_output.') + kwargs['stdout'] = PIPE + kwargs['stderr'] = PIPE + + with Popen(*popenargs, **kwargs) as process: + try: + stdout, stderr = process.communicate(input, timeout=timeout) + except TimeoutExpired: + process.kill() + stdout, stderr = process.communicate() + raise _with_stdout_stderr(TimeoutExpired(process.args, timeout, output=stdout), stderr) + except: + process.kill() + process.wait() + raise + retcode = process.poll() + if check and retcode: + # pylint:disable=undefined-variable + raise _with_stdout_stderr(CalledProcessError(retcode, process.args, stdout), stderr) + + return CompletedProcess(process.args, retcode, stdout, stderr) diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/testing/__init__.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/testing/__init__.py new file mode 100644 index 00000000..462d6f8d --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/testing/__init__.py @@ -0,0 +1,137 @@ +# Copyright (c) 2008-2009 AG Projects +# Copyright 2018 gevent community +# Author: Denis Bilenko +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. + + +import unittest + +# pylint:disable=unused-import + +from .sysinfo import VERBOSE +from .sysinfo import WIN +from .sysinfo import LINUX +from .sysinfo import LIBUV +from .sysinfo import CFFI_BACKEND +from .sysinfo import DEBUG +from .sysinfo import RUN_LEAKCHECKS +from .sysinfo import RUN_COVERAGE + +from .sysinfo import PY2 +from .sysinfo import PY3 +from .sysinfo import PY34 +from .sysinfo import PY36 +from .sysinfo import PY37 + +from .sysinfo import PYPY +from .sysinfo import PYPY3 +from .sysinfo import CPYTHON + +from .sysinfo import PLATFORM_SPECIFIC_SUFFIXES +from .sysinfo import NON_APPLICABLE_SUFFIXES +from .sysinfo import SHARED_OBJECT_EXTENSION + +from .sysinfo import RUNNING_ON_TRAVIS +from .sysinfo import RUNNING_ON_APPVEYOR +from .sysinfo import RUNNING_ON_CI + +from .sysinfo import RESOLVER_NOT_SYSTEM +from .sysinfo import RESOLVER_DNSPYTHON +from .sysinfo import RESOLVER_ARES + +from .sysinfo import EXPECT_POOR_TIMER_RESOLUTION + +from .sysinfo import CONN_ABORTED_ERRORS + +from .skipping import skipOnWindows +from .skipping import skipOnAppVeyor +from .skipping import skipOnCI +from .skipping import skipOnPyPy3OnCI +from .skipping import skipOnPyPy +from .skipping import skipOnPyPyOnCI +from .skipping import skipOnPyPy3 +from .skipping import skipIf +from .skipping import skipUnless +from .skipping import skipOnLibev +from .skipping import skipOnLibuv +from .skipping import skipOnLibuvOnWin +from .skipping import skipOnLibuvOnCI +from .skipping import skipOnLibuvOnCIOnPyPy +from .skipping import skipOnLibuvOnPyPyOnWin +from .skipping import skipOnPurePython +from .skipping import skipWithCExtensions +from .skipping import skipOnLibuvOnTravisOnCPython27 +from .skipping import skipOnPy37 + +from .exception import ExpectedException + + +from .leakcheck import ignores_leakcheck + + + +from .params import LARGE_TIMEOUT + +from .params import DEFAULT_LOCAL_HOST_ADDR +from .params import DEFAULT_LOCAL_HOST_ADDR6 +from .params import DEFAULT_BIND_ADDR + + +from .params import DEFAULT_SOCKET_TIMEOUT +from .params import DEFAULT_XPC_SOCKET_TIMEOUT + +main = unittest.main + +from .hub import QuietHub + +import gevent.hub +gevent.hub.set_default_hub_class(QuietHub) + + + +from .sockets import bind_and_listen +from .sockets import tcp_listener + +from .openfiles import get_number_open_files +from .openfiles import get_open_files + +from .testcase import TestCase + +from .modules import walk_modules + +BaseTestCase = unittest.TestCase + +from .flaky import reraiseFlakyTestTimeout +from .flaky import reraiseFlakyTestRaceCondition +from .flaky import reraises_flaky_timeout +from .flaky import reraises_flaky_race_condition + +def gc_collect_if_needed(): + "Collect garbage if necessary for destructors to run" + import gc + if PYPY: # pragma: no cover + gc.collect() + +try: + from unittest import mock +except ImportError: # Python 2 + import mock + +mock = mock diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/testing/coveragesite/sitecustomize.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/testing/coveragesite/sitecustomize.py new file mode 100644 index 00000000..097dcec1 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/testing/coveragesite/sitecustomize.py @@ -0,0 +1,17 @@ +# When testrunner.py is invoked with --coverage, it puts this first +# on the path as per https://coverage.readthedocs.io/en/coverage-4.0b3/subprocess.html. +# Note that this disables other sitecustomize.py files. +import coverage +try: + coverage.process_startup() +except coverage.CoverageException as e: + if str(e) == "Can't support concurrency=greenlet with PyTracer, only threads are supported": + pass + else: + import traceback + traceback.print_exc() + raise +except: + import traceback + traceback.print_exc() + raise diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/testing/errorhandler.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/testing/errorhandler.py new file mode 100644 index 00000000..77302dc5 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/testing/errorhandler.py @@ -0,0 +1,53 @@ +# Copyright (c) 2018 gevent community +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. + +from functools import wraps + + +def wrap_error_fatal(method): + import gevent + system_error = gevent.get_hub().SYSTEM_ERROR + + @wraps(method) + def wrapper(self, *args, **kwargs): + # XXX should also be able to do gevent.SYSTEM_ERROR = object + # which is a global default to all hubs + + gevent.get_hub().SYSTEM_ERROR = object + try: + return method(self, *args, **kwargs) + finally: + gevent.get_hub().SYSTEM_ERROR = system_error + return wrapper + + +def wrap_restore_handle_error(method): + import gevent + old = gevent.get_hub().handle_error + + @wraps(method) + def wrapper(self, *args, **kwargs): + try: + return method(self, *args, **kwargs) + finally: + gevent.get_hub().handle_error = old + if self.peek_error()[0] is not None: + gevent.getcurrent().throw(*self.peek_error()[1:]) + return wrapper diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/testing/exception.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/testing/exception.py new file mode 100644 index 00000000..baa9f96a --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/testing/exception.py @@ -0,0 +1,23 @@ +# Copyright (c) 2018 gevent community +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. +from __future__ import absolute_import, print_function, division + +class ExpectedException(Exception): + """An exception whose traceback should be ignored by the hub""" diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/testing/flaky.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/testing/flaky.py new file mode 100644 index 00000000..98f9fe8c --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/testing/flaky.py @@ -0,0 +1,114 @@ +# Copyright (c) 2018 gevent community +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. +from __future__ import absolute_import, print_function, division + +import sys +import functools +import unittest + +from . import sysinfo +from . import six + +class FlakyAssertionError(AssertionError): + "Re-raised so that we know it's a known-flaky test." + +# The next exceptions allow us to raise them in a highly +# greppable way so that we can debug them later. + +class FlakyTest(unittest.SkipTest): + """ + A unittest exception that causes the test to be skipped when raised. + + Use this carefully, it is a code smell and indicates an undebugged problem. + """ + +class FlakyTestRaceCondition(FlakyTest): + """ + Use this when the flaky test is definitely caused by a race condition. + """ + +class FlakyTestTimeout(FlakyTest): + """ + Use this when the flaky test is definitely caused by an + unexpected timeout. + """ + +class FlakyTestCrashes(FlakyTest): + """ + Use this when the test sometimes crashes. + """ + +def reraiseFlakyTestRaceCondition(): + six.reraise(FlakyAssertionError, + FlakyAssertionError(sys.exc_info()[1]), + sys.exc_info()[2]) + +reraiseFlakyTestTimeout = reraiseFlakyTestRaceCondition +reraiseFlakyTestRaceConditionLibuv = reraiseFlakyTestRaceCondition +reraiseFlakyTestTimeoutLibuv = reraiseFlakyTestRaceCondition + +if sysinfo.RUNNING_ON_CI or (sysinfo.PYPY and sysinfo.WIN): + # pylint: disable=function-redefined + def reraiseFlakyTestRaceCondition(): + # Getting stack traces is incredibly expensive + # in pypy on win, at least in test virtual machines. + # It can take minutes. The traceback consistently looks like + # the following when interrupted: + + # dump_stacks -> traceback.format_stack + # -> traceback.extract_stack -> linecache.checkcache + # -> os.stat -> _structseq.structseq_new + + # Moreover, without overriding __repr__ or __str__, + # the msg doesn't get printed like we would want (its basically + # unreadable, all printed on one line). So skip that. + + #msg = '\n'.join(dump_stacks()) + msg = str(sys.exc_info()[1]) + six.reraise(FlakyTestRaceCondition, + FlakyTestRaceCondition(msg), + sys.exc_info()[2]) + + def reraiseFlakyTestTimeout(): + msg = str(sys.exc_info()[1]) + six.reraise(FlakyTestTimeout, + FlakyTestTimeout(msg), + sys.exc_info()[2]) + + if sysinfo.LIBUV: + reraiseFlakyTestRaceConditionLibuv = reraiseFlakyTestRaceCondition + reraiseFlakyTestTimeoutLibuv = reraiseFlakyTestTimeout + + +def reraises_flaky_timeout(exc_kind=AssertionError, _func=reraiseFlakyTestTimeout): + + def wrapper(f): + @functools.wraps(f) + def m(*args): + try: + f(*args) + except exc_kind: + _func() + return m + + return wrapper + +def reraises_flaky_race_condition(exc_kind=AssertionError): + return reraises_flaky_timeout(exc_kind, _func=reraiseFlakyTestRaceCondition) diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/testing/hub.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/testing/hub.py new file mode 100644 index 00000000..645c1d0d --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/testing/hub.py @@ -0,0 +1,35 @@ +# Copyright (c) 2018 gevent community +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. +from __future__ import absolute_import, print_function, division + + +from gevent.hub import Hub + +from .exception import ExpectedException + +class QuietHub(Hub): + + EXPECTED_TEST_ERROR = (ExpectedException,) + + def handle_error(self, context, type, value, tb): + if issubclass(type, self.EXPECTED_TEST_ERROR): + # Don't print these to cut down on the noise in the test logs + return + return Hub.handle_error(self, context, type, value, tb) diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/testing/leakcheck.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/testing/leakcheck.py new file mode 100644 index 00000000..5e5b7f0b --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/testing/leakcheck.py @@ -0,0 +1,206 @@ +# Copyright (c) 2018 gevent community +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. +from __future__ import print_function + +import sys +import gc +import types +from functools import wraps +import unittest + +import objgraph + +import gevent +import gevent.core + + +def ignores_leakcheck(func): + """ + Ignore the given object during leakchecks. + + Can be applied to a method, in which case the method will run, but + will not be subject to leak checks. + + If applied to a class, the entire class will be skipped during leakchecks. This + is intended to be used for classes that are very slow and cause problems such as + test timeouts; typically it will be used for classes that are subclasses of a base + class and specify variants of behaviour (such as pool sizes). + """ + func.ignore_leakcheck = True + return func + +class _RefCountChecker(object): + + # Some builtin things that we ignore + IGNORED_TYPES = (tuple, dict, types.FrameType, types.TracebackType) + try: + CALLBACK_KIND = gevent.core.callback + except AttributeError: + # Must be using FFI. + from gevent._ffi.callback import callback as CALLBACK_KIND + + + def __init__(self, testcase, function): + self.testcase = testcase + self.function = function + self.deltas = [] + self.peak_stats = {} + + # The very first time we are called, we have already been + # self.setUp() by the test runner, so we don't need to do it again. + self.needs_setUp = False + + def _ignore_object_p(self, obj): + if ( + obj is self + or obj in self.__dict__.values() + or obj == self._ignore_object_p # pylint:disable=comparison-with-callable + ): + return False + kind = type(obj) + if kind in self.IGNORED_TYPES: + return False + if kind is self.CALLBACK_KIND and obj.callback is None and obj.args is None: + # these represent callbacks that have been stopped, but + # the event loop hasn't cycled around to run them. The only + # known cause of this is killing greenlets before they get a chance + # to run for the first time. + return False + return True + + + def _growth(self): + return objgraph.growth(limit=None, peak_stats=self.peak_stats, filter=self._ignore_object_p) + + def _report_diff(self, growth): + if not growth: + return "" + + lines = [] + width = max(len(name) for name, _, _ in growth) + for name, count, delta in growth: + lines.append('%-*s%9d %+9d' % (width, name, count, delta)) + + diff = '\n'.join(lines) + return diff + + + def _run_test(self, args, kwargs): + gc_enabled = gc.isenabled() + gc.disable() + + if self.needs_setUp: + self.testcase.setUp() + self.testcase.skipTearDown = False + try: + self.function(self.testcase, *args, **kwargs) + finally: + self.testcase.tearDown() + self.testcase.skipTearDown = True + self.needs_setUp = True + if gc_enabled: + gc.enable() + + def _growth_after(self): + # Grab post snapshot + if 'urlparse' in sys.modules: + sys.modules['urlparse'].clear_cache() + if 'urllib.parse' in sys.modules: + sys.modules['urllib.parse'].clear_cache() + + return self._growth() + + def _check_deltas(self, growth): + # Return false when we have decided there is no leak, + # true if we should keep looping, raises an assertion + # if we have decided there is a leak. + + deltas = self.deltas + if not deltas: + # We haven't run yet, no data, keep looping + return True + + if gc.garbage: + raise AssertionError("Generated uncollectable garbage %r" % (gc.garbage,)) + + + # the following configurations are classified as "no leak" + # [0, 0] + # [x, 0, 0] + # [... a, b, c, d] where a+b+c+d = 0 + # + # the following configurations are classified as "leak" + # [... z, z, z] where z > 0 + + if deltas[-2:] == [0, 0] and len(deltas) in (2, 3): + return False + + if deltas[-3:] == [0, 0, 0]: + return False + + if len(deltas) >= 4 and sum(deltas[-4:]) == 0: + return False + + if len(deltas) >= 3 and deltas[-1] > 0 and deltas[-1] == deltas[-2] and deltas[-2] == deltas[-3]: + diff = self._report_diff(growth) + raise AssertionError('refcount increased by %r\n%s' % (deltas, diff)) + + # OK, we don't know for sure yet. Let's search for more + if sum(deltas[-3:]) <= 0 or sum(deltas[-4:]) <= 0 or deltas[-4:].count(0) >= 2: + # this is suspicious, so give a few more runs + limit = 11 + else: + limit = 7 + if len(deltas) >= limit: + raise AssertionError('refcount increased by %r\n%s' + % (deltas, + self._report_diff(growth))) + + # We couldn't decide yet, keep going + return True + + def __call__(self, args, kwargs): + for _ in range(3): + gc.collect() + + # Capture state before; the incremental will be + # updated by each call to _growth_after + growth = self._growth() + + while self._check_deltas(growth): + self._run_test(args, kwargs) + + growth = self._growth_after() + + self.deltas.append(sum((stat[2] for stat in growth))) + + +def wrap_refcount(method): + if getattr(method, 'ignore_leakcheck', False): + return method + + + @wraps(method) + def wrapper(self, *args, **kwargs): # pylint:disable=too-many-branches + if getattr(self, 'ignore_leakcheck', False): + raise unittest.SkipTest("This class ignored during leakchecks") + return _RefCountChecker(self, method)(args, kwargs) + + return wrapper diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/testing/modules.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/testing/modules.py new file mode 100644 index 00000000..2fb04d59 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/testing/modules.py @@ -0,0 +1,85 @@ +# Copyright (c) 2018 gevent community +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. +from __future__ import absolute_import, print_function, division + +import importlib +import os.path +import warnings + +import gevent + +from . import sysinfo + + +OPTIONAL_MODULES = [ + 'gevent.resolver_ares', + 'gevent.resolver.ares', + 'gevent.libev', + 'gevent.libev.watcher', +] + + +def walk_modules(basedir=None, modpath=None, include_so=False, recursive=False): + # pylint:disable=too-many-branches + if sysinfo.PYPY: + include_so = False + if basedir is None: + basedir = os.path.dirname(gevent.__file__) + if modpath is None: + modpath = 'gevent.' + else: + if modpath is None: + modpath = '' + for fn in sorted(os.listdir(basedir)): + path = os.path.join(basedir, fn) + if os.path.isdir(path): + if not recursive: + continue + if fn in ['testing', 'tests']: + continue + pkg_init = os.path.join(path, '__init__.py') + if os.path.exists(pkg_init): + yield pkg_init, modpath + fn + for p, m in walk_modules(path, modpath + fn + "."): + yield p, m + continue + if fn.endswith('.py'): + x = fn[:-3] + if x.endswith('_d'): + x = x[:-2] + if x in ['__init__', 'core', 'ares', '_util', '_semaphore', + 'corecffi', '_corecffi', '_corecffi_build']: + continue + modname = modpath + x + if modname in OPTIONAL_MODULES: + try: + with warnings.catch_warnings(): + warnings.simplefilter('ignore', DeprecationWarning) + importlib.import_module(modname) + except ImportError: + continue + yield path, modname + elif include_so and fn.endswith(sysinfo.SHARED_OBJECT_EXTENSION): + if '.pypy-' in fn: + continue + if fn.endswith('_d.so'): + yield path, modpath + fn[:-5] + else: + yield path, modpath + fn[:-3] diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/testing/monkey_test.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/testing/monkey_test.py new file mode 100644 index 00000000..f8076731 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/testing/monkey_test.py @@ -0,0 +1,75 @@ +import sys +import os + + +kwargs = {} + +if sys.argv[1] == '--Event': + kwargs['Event'] = True + del sys.argv[1] +else: + kwargs['Event'] = False + +test_filename = sys.argv[1] +del sys.argv[1] + +print('Running with patch_all(%s): %s' % (','.join('%s=%r' % x for x in kwargs.items()), test_filename)) + +from gevent import monkey +monkey.patch_all(**kwargs) + +from .sysinfo import RUNNING_ON_APPVEYOR +from .sysinfo import PY37 +from .patched_tests_setup import disable_tests_in_source +try: + from test import support +except ImportError: + from test import test_support as support +support.is_resource_enabled = lambda *args: True +del support.use_resources +if RUNNING_ON_APPVEYOR and PY37: + # 3.7 added a stricter mode for thread cleanup. + # It appears to be unstable on Windows (at least appveyor) + # and test_socket.py constantly fails with an extra thread + # on some random test. We disable it entirely. + import contextlib + @contextlib.contextmanager + def wait_threads_exit(timeout=None): # pylint:disable=unused-argument + yield + support.wait_threads_exit = wait_threads_exit + + +__file__ = os.path.join(os.getcwd(), test_filename) + +test_name = os.path.splitext(test_filename)[0] + +# It's important that the `module_source` be a native +# string. Passing unicode to `compile` on Python 2 can +# do bad things: it conflicts with a 'coding:' directive, +# and it can cause some TypeError with string literals +if sys.version_info[0] >= 3: + module_file = open(test_filename, encoding='utf-8') +else: + module_file = open(test_filename) +with module_file: + module_source = module_file.read() +module_source = disable_tests_in_source(module_source, test_name) + +# We write the module source to a file so that tracebacks +# show correctly, since disabling the tests changes line +# numbers. However, note that __file__ must still point to the +# real location so that data files can be found. +# See https://github.com/gevent/gevent/issues/1306 +import tempfile +temp_handle, temp_path = tempfile.mkstemp(prefix=test_name, suffix='.py', text=True) +os.write(temp_handle, + module_source.encode('utf-8') if not isinstance(module_source, bytes) else module_source) +os.close(temp_handle) +try: + module_code = compile(module_source, + temp_path, + 'exec', + dont_inherit=True) + exec(module_code, globals()) +finally: + os.remove(temp_path) diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/testing/openfiles.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/testing/openfiles.py new file mode 100644 index 00000000..fe916e74 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/testing/openfiles.py @@ -0,0 +1,125 @@ +# Copyright (c) 2018 gevent community +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. +from __future__ import absolute_import, print_function, division + +import os +import unittest +import re + +from . import sysinfo + +# Linux/OS X/BSD platforms can implement this by calling out to lsof + + +if sysinfo.WIN: + def _run_lsof(): + raise unittest.SkipTest("lsof not expected on Windows") +else: + def _run_lsof(): + import tempfile + pid = os.getpid() + fd, tmpname = tempfile.mkstemp('get_open_files') + os.close(fd) + lsof_command = 'lsof -p %s > %s' % (pid, tmpname) + if os.system(lsof_command): + # XXX: This prints to the console an annoying message: 'lsof is not recognized' + raise unittest.SkipTest("lsof failed") + with open(tmpname) as fobj: + data = fobj.read().strip() + os.remove(tmpname) + return data + +def default_get_open_files(pipes=False): + data = _run_lsof() + results = {} + for line in data.split('\n'): + line = line.strip() + if not line or line.startswith("COMMAND"): + # Skip header and blank lines + continue + split = re.split(r'\s+', line) + _command, _pid, _user, fd = split[:4] + # Pipes (on OS X, at least) get an fd like "3" while normal files get an fd like "1u" + if fd[:-1].isdigit() or fd.isdigit(): + if not pipes and fd[-1].isdigit(): + continue + fd = int(fd[:-1]) if not fd[-1].isdigit() else int(fd) + if fd in results: + params = (fd, line, split, results.get(fd), data) + raise AssertionError('error when parsing lsof output: duplicate fd=%r\nline=%r\nsplit=%r\nprevious=%r\ndata:\n%s' % params) + results[fd] = line + if not results: + raise AssertionError('failed to parse lsof:\n%s' % (data, )) + results['data'] = data + return results + +def default_get_number_open_files(): + if os.path.exists('/proc/'): + # Linux only + fd_directory = '/proc/%d/fd' % os.getpid() + return len(os.listdir(fd_directory)) + + try: + return len(get_open_files(pipes=True)) - 1 + except (OSError, AssertionError, unittest.SkipTest): + return 0 + +lsof_get_open_files = default_get_open_files + +try: + # psutil import subprocess which on Python 3 imports selectors. + # This can expose issues with monkey-patching. + import psutil +except ImportError: + get_open_files = default_get_open_files + get_number_open_files = default_get_number_open_files +else: + # If psutil is available (it is cross-platform) use that. + # It is *much* faster than shelling out to lsof each time + # (Running 14 tests takes 3.964s with lsof and 0.046 with psutil) + # However, it still doesn't completely solve the issue on Windows: fds are reported + # as -1 there, so we can't fully check those. + + def get_open_files(): + """ + Return a list of popenfile and pconn objects. + + Note that other than `fd`, they have different attributes. + + .. important:: If you want to find open sockets, on Windows + and linux, it is important that the socket at least be listening + (socket.listen(1)). Unlike the lsof implementation, this will only + return sockets in a state like that. + """ + results = dict() + process = psutil.Process() + results['data'] = process.open_files() + process.connections('all') + for x in results['data']: + results[x.fd] = x + results['data'] += ['From psutil', process] + return results + + def get_number_open_files(): + process = psutil.Process() + try: + return process.num_fds() + except AttributeError: + # num_fds is unix only. Is num_handles close enough on Windows? + return 0 diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/testing/params.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/testing/params.py new file mode 100644 index 00000000..efa54165 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/testing/params.py @@ -0,0 +1,83 @@ +# Copyright (c) 2018 gevent community +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. + + +from .sysinfo import PY3 +from .sysinfo import PYPY +from .sysinfo import WIN +from .sysinfo import LIBUV +from .sysinfo import OSX + +from .sysinfo import RUNNING_ON_TRAVIS +from .sysinfo import RUNNING_ON_APPVEYOR +from .sysinfo import EXPECT_POOR_TIMER_RESOLUTION +from .sysinfo import RESOLVER_ARES + + +# Travis is slow and overloaded; Appveyor used to be faster, but +# as of Dec 2015 it's almost always slower and/or has much worse timer +# resolution +CI_TIMEOUT = 15 +if (PY3 and PYPY) or (PYPY and WIN and LIBUV): + # pypy3 is very slow right now, + # as is PyPy2 on windows (which only has libuv) + CI_TIMEOUT = 20 +if PYPY and LIBUV: + # slow and flaky timeouts + LOCAL_TIMEOUT = CI_TIMEOUT +else: + LOCAL_TIMEOUT = 1 + +LARGE_TIMEOUT = max(LOCAL_TIMEOUT, CI_TIMEOUT) + +DEFAULT_LOCAL_HOST_ADDR = 'localhost' +DEFAULT_LOCAL_HOST_ADDR6 = DEFAULT_LOCAL_HOST_ADDR +DEFAULT_BIND_ADDR = '' + +if RUNNING_ON_TRAVIS: + # As of November 2017 (probably Sept or Oct), after a + # Travis upgrade, using "localhost" no longer works, + # producing 'OSError: [Errno 99] Cannot assign + # requested address'. This is apparently something to do with + # docker containers. Sigh. + DEFAULT_LOCAL_HOST_ADDR = '127.0.0.1' + DEFAULT_LOCAL_HOST_ADDR6 = '::1' + # Likewise, binding to '' appears to work, but it cannot be + # connected to with the same error. + DEFAULT_BIND_ADDR = '127.0.0.1' + +if RUNNING_ON_APPVEYOR: + DEFAULT_BIND_ADDR = '127.0.0.1' + DEFAULT_LOCAL_HOST_ADDR = '127.0.0.1' + + +if RESOLVER_ARES and OSX: + # Ares likes to raise "malformed domain name" on '', at least + # on OS X + DEFAULT_BIND_ADDR = '127.0.0.1' + +DEFAULT_CONNECT = DEFAULT_LOCAL_HOST_ADDR +DEFAULT_BIND_ADDR_TUPLE = (DEFAULT_BIND_ADDR, 0) + +# For in-process sockets +DEFAULT_SOCKET_TIMEOUT = 0.1 if not EXPECT_POOR_TIMER_RESOLUTION else 2.0 + +# For cross-process sockets +DEFAULT_XPC_SOCKET_TIMEOUT = 2.0 if not EXPECT_POOR_TIMER_RESOLUTION else 4.0 diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/testing/patched_tests_setup.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/testing/patched_tests_setup.py new file mode 100644 index 00000000..39c881d8 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/testing/patched_tests_setup.py @@ -0,0 +1,1139 @@ +# pylint:disable=missing-docstring,invalid-name,too-many-lines +from __future__ import print_function, absolute_import, division + +import collections +import contextlib +import functools +import sys +import os +# At least on 3.6+, importing platform +# imports subprocess, which imports selectors. That +# can expose issues with monkey patching. We don't need it +# though. +# import platform +import re + +from .sysinfo import RUNNING_ON_APPVEYOR as APPVEYOR +from .sysinfo import RUNNING_ON_TRAVIS as TRAVIS +from .sysinfo import RESOLVER_NOT_SYSTEM as ARES +from .sysinfo import RUN_COVERAGE + + +from .sysinfo import PYPY +from .sysinfo import PYPY3 +from .sysinfo import PY3 +from .sysinfo import PY2 +from .sysinfo import PY34 +from .sysinfo import PY35 +from .sysinfo import PY36 +from .sysinfo import PY37 + +from .sysinfo import WIN +from .sysinfo import OSX + +from .sysinfo import LIBUV +from .sysinfo import CFFI_BACKEND + +from . import flaky + +CPYTHON = not PYPY + +# By default, test cases are expected to switch and emit warnings if there was none +# If a test is found in this list, it's expected not to switch. +no_switch_tests = '''test_patched_select.SelectTestCase.test_error_conditions +test_patched_ftplib.*.test_all_errors +test_patched_ftplib.*.test_getwelcome +test_patched_ftplib.*.test_sanitize +test_patched_ftplib.*.test_set_pasv +#test_patched_ftplib.TestIPv6Environment.test_af +test_patched_socket.TestExceptions.testExceptionTree +test_patched_socket.Urllib2FileobjectTest.testClose +test_patched_socket.TestLinuxAbstractNamespace.testLinuxAbstractNamespace +test_patched_socket.TestLinuxAbstractNamespace.testMaxName +test_patched_socket.TestLinuxAbstractNamespace.testNameOverflow +test_patched_socket.FileObjectInterruptedTestCase.* +test_patched_urllib.* +test_patched_asyncore.HelperFunctionTests.* +test_patched_httplib.BasicTest.* +test_patched_httplib.HTTPSTimeoutTest.test_attributes +test_patched_httplib.HeaderTests.* +test_patched_httplib.OfflineTest.* +test_patched_httplib.HTTPSTimeoutTest.test_host_port +test_patched_httplib.SourceAddressTest.testHTTPSConnectionSourceAddress +test_patched_select.SelectTestCase.test_error_conditions +test_patched_smtplib.NonConnectingTests.* +test_patched_urllib2net.OtherNetworkTests.* +test_patched_wsgiref.* +test_patched_subprocess.HelperFunctionTests.* +''' + +ignore_switch_tests = ''' +test_patched_socket.GeneralModuleTests.* +test_patched_httpservers.BaseHTTPRequestHandlerTestCase.* +test_patched_queue.* +test_patched_signal.SiginterruptTest.* +test_patched_urllib2.* +test_patched_ssl.* +test_patched_signal.BasicSignalTests.* +test_patched_threading_local.* +test_patched_threading.* +''' + + +def make_re(tests): + tests = [x.strip().replace(r'\.', r'\\.').replace('*', '.*?') + for x in tests.split('\n') if x.strip()] + return re.compile('^%s$' % '|'.join(tests)) + + +no_switch_tests = make_re(no_switch_tests) +ignore_switch_tests = make_re(ignore_switch_tests) + + +def get_switch_expected(fullname): + """ + >>> get_switch_expected('test_patched_select.SelectTestCase.test_error_conditions') + False + >>> get_switch_expected('test_patched_socket.GeneralModuleTests.testCrucialConstants') + False + >>> get_switch_expected('test_patched_socket.SomeOtherTest.testHello') + True + >>> get_switch_expected("test_patched_httplib.BasicTest.test_bad_status_repr") + False + """ + # certain pylint versions mistype the globals as + # str, not re. + # pylint:disable=no-member + if ignore_switch_tests.match(fullname) is not None: + return None + if no_switch_tests.match(fullname) is not None: + return False + return True + + +disabled_tests = [ + # The server side takes awhile to shut down + 'test_httplib.HTTPSTest.test_local_bad_hostname', + + 'test_threading.ThreadTests.test_PyThreadState_SetAsyncExc', + # uses some internal C API of threads not available when threads are emulated with greenlets + + 'test_threading.ThreadTests.test_join_nondaemon_on_shutdown', + # asserts that repr(sleep) is '' + + 'test_urllib2net.TimeoutTest.test_ftp_no_timeout', + 'test_urllib2net.TimeoutTest.test_ftp_timeout', + 'test_urllib2net.TimeoutTest.test_http_no_timeout', + 'test_urllib2net.TimeoutTest.test_http_timeout', + # accesses _sock.gettimeout() which is always in non-blocking mode + + 'test_urllib2net.OtherNetworkTests.test_ftp', + # too slow + + 'test_urllib2net.OtherNetworkTests.test_urlwithfrag', + # fails dues to some changes on python.org + + 'test_urllib2net.OtherNetworkTests.test_sites_no_connection_close', + # flaky + + 'test_socket.UDPTimeoutTest.testUDPTimeout', + # has a bug which makes it fail with error: (107, 'Transport endpoint is not connected') + # (it creates a TCP socket, not UDP) + + 'test_socket.GeneralModuleTests.testRefCountGetNameInfo', + # fails with "socket.getnameinfo loses a reference" while the reference is only "lost" + # because it is referenced by the traceback - any Python function would lose a reference like that. + # the original getnameinfo does not "lose" it because it's in C. + + 'test_socket.NetworkConnectionNoServer.test_create_connection_timeout', + # replaces socket.socket with MockSocket and then calls create_connection. + # this unfortunately does not work with monkey patching, because gevent.socket.create_connection + # is bound to gevent.socket.socket and updating socket.socket does not affect it. + # this issues also manifests itself when not monkey patching DNS: http://code.google.com/p/gevent/issues/detail?id=54 + # create_connection still uses gevent.socket.getaddrinfo while it should be using socket.getaddrinfo + + 'test_asyncore.BaseTestAPI.test_handle_expt', + # sends some OOB data and expect it to be detected as such; gevent.select.select does not support that + + # This one likes to check its own filename, but we rewrite + # the file to a temp location during patching. + 'test_asyncore.HelperFunctionTests.test_compact_traceback', + + 'test_signal.WakeupSignalTests.test_wakeup_fd_early', + # expects time.sleep() to return prematurely in case of a signal; + # gevent.sleep() is better than that and does not get interrupted (unless signal handler raises an error) + + 'test_signal.WakeupSignalTests.test_wakeup_fd_during', + # expects select.select() to raise select.error(EINTR'interrupted system call') + # gevent.select.select() does not get interrupted (unless signal handler raises an error) + # maybe it should? + + 'test_signal.SiginterruptTest.test_without_siginterrupt', + 'test_signal.SiginterruptTest.test_siginterrupt_on', + # these rely on os.read raising EINTR which never happens with gevent.os.read + + 'test_subprocess.ProcessTestCase.test_leak_fast_process_del_killed', + 'test_subprocess.ProcessTestCase.test_zombie_fast_process_del', + # relies on subprocess._active which we don't use + + # Very slow, tries to open lots and lots of subprocess and files, + # tends to timeout on CI. + 'test_subprocess.ProcessTestCase.test_no_leaking', + + # This test is also very slow, and has been timing out on Travis + # since November of 2016 on Python 3, but now also seen on Python 2/Pypy. + 'test_subprocess.ProcessTestCase.test_leaking_fds_on_error', + + 'test_ssl.ThreadedTests.test_default_ciphers', + 'test_ssl.ThreadedTests.test_empty_cert', + 'test_ssl.ThreadedTests.test_malformed_cert', + 'test_ssl.ThreadedTests.test_malformed_key', + 'test_ssl.NetworkedTests.test_non_blocking_connect_ex', + # XXX needs investigating + + 'test_ssl.NetworkedTests.test_algorithms', + # The host this wants to use, sha256.tbs-internet.com, is not resolvable + # right now (2015-10-10), and we need to get Windows wheels + + # This started timing out randomly on Travis in oct/nov 2018. It appears + # to be something with random number generation taking too long. + 'test_ssl.BasicSocketTests.test_random_fork', + + # Relies on the repr of objects (Py3) + 'test_ssl.BasicSocketTests.test_dealloc_warn', + + 'test_urllib2.HandlerTests.test_cookie_redirect', + # this uses cookielib which we don't care about + + 'test_thread.ThreadRunningTests.test__count', + 'test_thread.TestForkInThread.test_forkinthread', + # XXX needs investigating + + 'test_subprocess.POSIXProcessTestCase.test_preexec_errpipe_does_not_double_close_pipes', + # Does not exist in the test suite until 2.7.4+. Subclasses Popen, and overrides + # _execute_child. But our version has a different parameter list than the + # version that comes with PyPy/CPython, so fails with a TypeError. +] + +if 'thread' in os.getenv('GEVENT_FILE', ''): + disabled_tests += [ + 'test_subprocess.ProcessTestCase.test_double_close_on_error' + # Fails with "OSError: 9 invalid file descriptor"; expect GC/lifetime issues + ] + + +if LIBUV: + # epoll appears to work with these just fine in some cases; + # kqueue (at least on OS X, the only tested kqueue system) + # never does (failing with abort()) + # (epoll on Raspbian 8.0/Debian Jessie/Linux 4.1.20 works; + # on a VirtualBox image of Ubuntu 15.10/Linux 4.2.0 both tests fail; + # Travis CI Ubuntu 12.04 precise/Linux 3.13 causes one of these tests to hang forever) + # XXX: Retry this with libuv 1.12+ + disabled_tests += [ + # A 2.7 test. Tries to fork, and libuv cannot fork + 'test_signal.InterProcessSignalTests.test_main', + # Likewise, a forking problem + 'test_signal.SiginterruptTest.test_siginterrupt_off', + ] + + if PY2: + + if TRAVIS: + + if CPYTHON: + + disabled_tests += [ + # This appears to crash the process, for some reason, + # but only on CPython 2.7.14 on Travis. Cannot reproduce in + # 2.7.14 on macOS or 2.7.12 in local Ubuntu 16.04 + 'test_subprocess.POSIXProcessTestCase.test_close_fd_0', + 'test_subprocess.POSIXProcessTestCase.test_close_fds_0_1', + 'test_subprocess.POSIXProcessTestCase.test_close_fds_0_2', + ] + + if PYPY: + disabled_tests += [ + # This seems to crash the interpreter. I cannot reproduce + # on macOS or local Linux VM. + # See https://travis-ci.org/gevent/gevent/jobs/348661604#L709 + 'test_smtplib.TooLongLineTests.testLineTooLong', + ] + if ARES: + + disabled_tests += [ + # This can timeout with a socket timeout in ssl.wrap_socket(c) + # on Travis. I can't reproduce locally. + 'test_ssl.ThreadedTests.test_handshake_timeout', + ] + + if PY3: + + disabled_tests += [ + # This test wants to pass an arbitrary fileno + # to a socket and do things with it. libuv doesn't like this, + # it raises EPERM. It is disabled on windows already. + # It depends on whether we had a fd already open and multiplexed with + 'test_socket.GeneralModuleTests.test_unknown_socket_family_repr', + # And yes, there's a typo in some versions. + 'test_socket.GeneralModuleTests.test_uknown_socket_family_repr', + ] + + if PY37: + + disabled_tests += [ + # This test sometimes fails at line 358. It's apparently + # extremely sensitive to timing. + 'test_selectors.PollSelectorTestCase.test_timeout', + ] + + if OSX: + disabled_tests += [ + # XXX: Starting when we upgraded from libuv 1.18.0 + # to 1.19.2, this sometimes (usually) started having + # a series of calls ('select.poll(0)', 'select.poll(-1)') + # take longer than the allowed 0.5 seconds. Debugging showed that + # it was the second call that took longer, for no apparent reason. + # There doesn't seem to be a change in the source code to libuv that + # would affect this. + # XXX-XXX: This actually disables too many tests :( + 'test_selectors.PollSelectorTestCase.test_timeout', + ] + + if RUN_COVERAGE: + + disabled_tests += [ + # Starting with #1145 this test (actually + # TestTLS_FTPClassMixin) becomes sensitive to timings + # under coverage. + 'test_ftplib.TestFTPClass.test_storlines', + ] + + + if sys.platform.startswith('linux'): + disabled_tests += [ + # crashes with EPERM, which aborts the epoll loop, even + # though it was allowed in in the first place. + 'test_asyncore.FileWrapperTest.test_dispatcher', + ] + + + + if WIN and PY2: + # From PyPy2-v5.9.0 and CPython 2.7.14, using its version of tests, + # which do work on darwin (and possibly linux?) + # I can't produce them in a local VM running Windows 10 + # and the same pypy version. + disabled_tests += [ + # These, which use asyncore, fail with + # 'NoneType is not iterable' on 'conn, addr = self.accept()' + # That returns None when the underlying socket raises + # EWOULDBLOCK, which it will do because it's set to non-blocking + # both by gevent and by libuv (at the level below python's knowledge) + # I can *usually* reproduce these locally; it seems to be some sort + # of race condition. + 'test_ftplib.TestFTPClass.test_acct', + 'test_ftplib.TestFTPClass.test_all_errors', + 'test_ftplib.TestFTPClass.test_cwd', + 'test_ftplib.TestFTPClass.test_delete', + 'test_ftplib.TestFTPClass.test_dir', + 'test_ftplib.TestFTPClass.test_exceptions', + 'test_ftplib.TestFTPClass.test_getwelcome', + 'test_ftplib.TestFTPClass.test_line_too_long', + 'test_ftplib.TestFTPClass.test_login', + 'test_ftplib.TestFTPClass.test_makepasv', + 'test_ftplib.TestFTPClass.test_mkd', + 'test_ftplib.TestFTPClass.test_nlst', + 'test_ftplib.TestFTPClass.test_pwd', + 'test_ftplib.TestFTPClass.test_quit', + 'test_ftplib.TestFTPClass.test_makepasv', + 'test_ftplib.TestFTPClass.test_rename', + 'test_ftplib.TestFTPClass.test_retrbinary', + 'test_ftplib.TestFTPClass.test_retrbinary_rest', + 'test_ftplib.TestFTPClass.test_retrlines', + 'test_ftplib.TestFTPClass.test_retrlines_too_long', + 'test_ftplib.TestFTPClass.test_rmd', + 'test_ftplib.TestFTPClass.test_sanitize', + 'test_ftplib.TestFTPClass.test_set_pasv', + 'test_ftplib.TestFTPClass.test_size', + 'test_ftplib.TestFTPClass.test_storbinary', + 'test_ftplib.TestFTPClass.test_storbinary_rest', + 'test_ftplib.TestFTPClass.test_storlines', + 'test_ftplib.TestFTPClass.test_storlines_too_long', + 'test_ftplib.TestFTPClass.test_voidcmd', + 'test_ftplib.TestTLS_FTPClass.test_data_connection', + 'test_ftplib.TestTLS_FTPClass.test_control_connection', + 'test_ftplib.TestTLS_FTPClass.test_context', + 'test_ftplib.TestTLS_FTPClass.test_check_hostname', + 'test_ftplib.TestTLS_FTPClass.test_auth_ssl', + 'test_ftplib.TestTLS_FTPClass.test_auth_issued_twice', + + # This one times out, but it's still a non-blocking socket + 'test_ftplib.TestFTPClass.test_makeport', + + # A timeout, possibly because of the way we handle interrupts? + 'test_socketserver.SocketServerTest.test_InterruptedServerSelectCall', + 'test_socketserver.SocketServerTest.test_InterruptServerSelectCall', + + # times out with something about threading? + # The apparent hang is just after the print of "waiting for server" + 'test_socketserver.SocketServerTest.test_ThreadingTCPServer', + 'test_socketserver.SocketServerTest.test_ThreadingUDPServer', + 'test_socketserver.SocketServerTest.test_TCPServer', + 'test_socketserver.SocketServerTest.test_UDPServer', + + # This one might be like 'test_urllib2_localnet.TestUrlopen.test_https_with_cafile'? + # XXX: Look at newer pypy and verify our usage of drop/reuse matches + # theirs. + 'test_httpservers.BaseHTTPServerTestCase.test_command', + 'test_httpservers.BaseHTTPServerTestCase.test_handler', + 'test_httpservers.BaseHTTPServerTestCase.test_head_keep_alive', + 'test_httpservers.BaseHTTPServerTestCase.test_head_via_send_error', + 'test_httpservers.BaseHTTPServerTestCase.test_header_close', + 'test_httpservers.BaseHTTPServerTestCase.test_internal_key_error', + 'test_httpservers.BaseHTTPServerTestCase.test_request_line_trimming', + 'test_httpservers.BaseHTTPServerTestCase.test_return_custom_status', + 'test_httpservers.BaseHTTPServerTestCase.test_send_blank', + 'test_httpservers.BaseHTTPServerTestCase.test_send_error', + 'test_httpservers.BaseHTTPServerTestCase.test_version_bogus', + 'test_httpservers.BaseHTTPServerTestCase.test_version_digits', + 'test_httpservers.BaseHTTPServerTestCase.test_version_invalid', + 'test_httpservers.BaseHTTPServerTestCase.test_version_none', + 'test_httpservers.SimpleHTTPServerTestCase.test_get', + 'test_httpservers.SimpleHTTPServerTestCase.test_head', + 'test_httpservers.SimpleHTTPServerTestCase.test_invalid_requests', + 'test_httpservers.SimpleHTTPServerTestCase.test_path_without_leading_slash', + 'test_httpservers.CGIHTTPServerTestCase.test_invaliduri', + 'test_httpservers.CGIHTTPServerTestCase.test_issue19435', + + # Unexpected timeouts sometimes + 'test_smtplib.TooLongLineTests.testLineTooLong', + 'test_smtplib.GeneralTests.testTimeoutValue', + + ] + + if PYPY: + disabled_tests += [ + # appears to timeout? + 'test_threading.ThreadTests.test_finalize_with_trace', + 'test_asyncore.DispatcherWithSendTests_UsePoll.test_send', + 'test_asyncore.DispatcherWithSendTests.test_send', + + # More unexpected timeouts + 'test_ssl.ContextTests.test__https_verify_envvar', + 'test_subprocess.ProcessTestCase.test_check_output', + 'test_telnetlib.ReadTests.test_read_eager_A', + + # But on Windows, our gc fix for that doesn't work anyway + # so we have to disable it. + 'test_urllib2_localnet.TestUrlopen.test_https_with_cafile', + + # These tests hang. see above. + 'test_threading.ThreadJoinOnShutdown.test_1_join_on_shutdown', + 'test_threading.ThreadingExceptionTests.test_print_exception', + + # Our copy of these in test__subprocess.py also hangs. + # Anything that uses Popen.communicate or directly uses + # Popen.stdXXX.read hangs. It's not clear why. + 'test_subprocess.ProcessTestCase.test_communicate', + 'test_subprocess.ProcessTestCase.test_cwd', + 'test_subprocess.ProcessTestCase.test_env', + 'test_subprocess.ProcessTestCase.test_stderr_pipe', + 'test_subprocess.ProcessTestCase.test_stdout_pipe', + 'test_subprocess.ProcessTestCase.test_stdout_stderr_pipe', + 'test_subprocess.ProcessTestCase.test_stderr_redirect_with_no_stdout_redirect', + 'test_subprocess.ProcessTestCase.test_stdout_filedes_of_stdout', + 'test_subprocess.ProcessTestcase.test_stdout_none', + 'test_subprocess.ProcessTestcase.test_universal_newlines', + 'test_subprocess.ProcessTestcase.test_writes_before_communicate', + 'test_subprocess.Win32ProcessTestCase._kill_process', + 'test_subprocess.Win32ProcessTestCase._kill_dead_process', + 'test_subprocess.Win32ProcessTestCase.test_shell_sequence', + 'test_subprocess.Win32ProcessTestCase.test_shell_string', + 'test_subprocess.CommandsWithSpaces.with_spaces', + ] + + + if WIN: + + disabled_tests += [ + # This test winds up hanging a long time. + # Inserting GCs doesn't fix it. + 'test_ssl.ThreadedTests.test_handshake_timeout', + + # These sometimes raise LoopExit, for no apparent reason, + # mostly but not exclusively on Python 2. + 'test_socket.BufferIOTest.testRecvFromIntoBytearray', + 'test_socket.BufferIOTest.testRecvFromIntoArray', + 'test_socket.BufferIOTest.testRecvIntoArray', + 'test_socket.BufferIOTest.testRecvFromIntoEmptyBuffer', + 'test_socket.BufferIOTest.testRecvFromIntoMemoryview', + 'test_socket.BufferIOTest.testRecvFromIntoSmallBuffer', + ] + + if PY3: + + disabled_tests += [ + ] + + if APPVEYOR: + + disabled_tests += [ + ] + + if PYPY: + + if TRAVIS: + + disabled_tests += [ + # This sometimes causes a segfault for no apparent reason. + # See https://travis-ci.org/gevent/gevent/jobs/327328704 + # Can't reproduce locally. + 'test_subprocess.ProcessTestCase.test_universal_newlines_communicate', + ] + +if RUN_COVERAGE and CFFI_BACKEND: + disabled_tests += [ + # This test hangs in this combo for some reason + 'test_socket.GeneralModuleTests.test_sendall_interrupted', + # This can get a timeout exception instead of the Alarm + 'test_socket.TCPTimeoutTest.testInterruptedTimeout', + + # This test sometimes gets the wrong answer (due to changed timing?) + 'test_socketserver.SocketServerTest.test_ForkingUDPServer', + + # Timing and signals are off, so a handler exception doesn't get raised. + # Seen under libev + 'test_signal.InterProcessSignalTests.test_main', + ] + +if PY2: + if TRAVIS: + disabled_tests += [ + # When we moved to group:travis_latest and dist:xenial, + # this started returning a value (33554432L) != 0; presumably + # because of updated SSL library? Only on CPython. + 'test_ssl.ContextTests.test_options', + # When we moved to group:travis_latest and dist:xenial, + # one of the values used started *working* when it was expected to fail. + # The list of values and systems is long and complex, so + # presumably something needs to be updated. Only on PyPy. + 'test_ssl.ThreadedTests.test_alpn_protocols', + ] + +def _make_run_with_original(mod_name, func_name): + @contextlib.contextmanager + def with_orig(): + mod = __import__(mod_name) + now = getattr(mod, func_name) + from gevent.monkey import get_original + orig = get_original(mod_name, func_name) + try: + setattr(mod, func_name, orig) + yield + finally: + setattr(mod, func_name, now) + return with_orig + +@contextlib.contextmanager +def _gc_at_end(): + try: + yield + finally: + import gc + gc.collect() + gc.collect() + +@contextlib.contextmanager +def _flaky_socket_timeout(): + import socket + try: + yield + except socket.timeout: + flaky.reraiseFlakyTestTimeout() + +# Map from FQN to a context manager that will be wrapped around +# that test. +wrapped_tests = { +} + + + +class _PatchedTest(object): + def __init__(self, test_fqn): + self._patcher = wrapped_tests[test_fqn] + + def __call__(self, orig_test_fn): + + @functools.wraps(orig_test_fn) + def test(*args, **kwargs): + with self._patcher(): + return orig_test_fn(*args, **kwargs) + return test + + + +if sys.version_info[:3] <= (2, 7, 11): + + disabled_tests += [ + # These were added/fixed in 2.7.12+ + 'test_ssl.ThreadedTests.test__https_verify_certificates', + 'test_ssl.ThreadedTests.test__https_verify_envvar', + ] + +if OSX: + disabled_tests += [ + 'test_subprocess.POSIXProcessTestCase.test_run_abort', + # causes Mac OS X to show "Python crashes" dialog box which is annoying + ] + +if WIN: + disabled_tests += [ + # Issue with Unix vs DOS newlines in the file vs from the server + 'test_ssl.ThreadedTests.test_socketserver', + ] + + # These are a problem on 3.5; on 3.6+ they wind up getting (accidentally) disabled. + wrapped_tests.update({ + 'test_socket.SendfileUsingSendTest.testWithTimeout': _flaky_socket_timeout, + 'test_socket.SendfileUsingSendTest.testOffset': _flaky_socket_timeout, + 'test_socket.SendfileUsingSendTest.testRegularFile': _flaky_socket_timeout, + 'test_socket.SendfileUsingSendTest.testCount': _flaky_socket_timeout, + }) + +if PYPY: + disabled_tests += [ + # Does not exist in the CPython test suite, tests for a specific bug + # in PyPy's forking. Only runs on linux and is specific to the PyPy + # implementation of subprocess (possibly explains the extra parameter to + # _execut_child) + 'test_subprocess.ProcessTestCase.test_failed_child_execute_fd_leak', + # On some platforms, this returns "zlib_compression", but the test is looking for + # "ZLIB" + 'test_ssl.ThreadedTests.test_compression', + ] + +# Generic Python 3 + +if PY3: + + disabled_tests += [ + # Triggers the crash reporter + 'test_threading.SubinterpThreadingTests.test_daemon_threads_fatal_error', + + # Relies on an implementation detail, Thread._tstate_lock + 'test_threading.ThreadTests.test_tstate_lock', + # Relies on an implementation detail (reprs); we have our own version + 'test_threading.ThreadTests.test_various_ops', + 'test_threading.ThreadTests.test_various_ops_large_stack', + 'test_threading.ThreadTests.test_various_ops_small_stack', + + # Relies on Event having a _cond and an _reset_internal_locks() + # XXX: These are commented out in the source code of test_threading because + # this doesn't work. + # 'lock_tests.EventTests.test_reset_internal_locks', + + # Python bug 13502. We may or may not suffer from this as its + # basically a timing race condition. + # XXX Same as above + # 'lock_tests.EventTests.test_set_and_clear', + + # These tests want to assert on the type of the class that implements + # `Popen.stdin`; we use a FileObject, but they expect different subclasses + # from the `io` module + 'test_subprocess.ProcessTestCase.test_io_buffered_by_default', + 'test_subprocess.ProcessTestCase.test_io_unbuffered_works', + + # 3.3 exposed the `endtime` argument to wait accidentally. + # It is documented as deprecated and not to be used since 3.4 + # This test in 3.6.3 wants to use it though, and we don't have it. + 'test_subprocess.ProcessTestCase.test_wait_endtime', + + # These all want to inspect the string value of an exception raised + # by the exec() call in the child. The _posixsubprocess module arranges + # for better exception handling and printing than we do. + 'test_subprocess.POSIXProcessTestCase.test_exception_bad_args_0', + 'test_subprocess.POSIXProcessTestCase.test_exception_bad_executable', + 'test_subprocess.POSIXProcessTestCase.test_exception_cwd', + # Relies on a 'fork_exec' attribute that we don't provide + 'test_subprocess.POSIXProcessTestCase.test_exception_errpipe_bad_data', + 'test_subprocess.POSIXProcessTestCase.test_exception_errpipe_normal', + + # Python 3 fixed a bug if the stdio file descriptors were closed; + # we still have that bug + 'test_subprocess.POSIXProcessTestCase.test_small_errpipe_write_fd', + + # Relies on implementation details (some of these tests were added in 3.4, + # but PyPy3 is also shipping them.) + 'test_socket.GeneralModuleTests.test_SocketType_is_socketobject', + 'test_socket.GeneralModuleTests.test_dealloc_warn', + 'test_socket.GeneralModuleTests.test_repr', + 'test_socket.GeneralModuleTests.test_str_for_enums', + 'test_socket.GeneralModuleTests.testGetaddrinfo', + + ] + if TRAVIS: + disabled_tests += [ + # test_cwd_with_relative_executable tends to fail + # on Travis...it looks like the test processes are stepping + # on each other and messing up their temp directories. We tend to get things like + # saved_dir = os.getcwd() + # FileNotFoundError: [Errno 2] No such file or directory + 'test_subprocess.ProcessTestCase.test_cwd_with_relative_arg', + 'test_subprocess.ProcessTestCaseNoPoll.test_cwd_with_relative_arg', + 'test_subprocess.ProcessTestCase.test_cwd_with_relative_executable', + + ] + + wrapped_tests.update({ + # XXX: BUG: We simply don't handle this correctly. On CPython, + # we wind up raising a BlockingIOError and then + # BrokenPipeError and then some random TypeErrors, all on the + # server. CPython 3.5 goes directly to socket.send() (via + # socket.makefile), whereas CPython 3.6 uses socket.sendall(). + # On PyPy, the behaviour is much worse: we hang indefinitely, perhaps exposing a problem + # with our signal handling. + # In actuality, though, this test doesn't fully test the EINTR it expects + # to under gevent (because if its EWOULDBLOCK retry behaviour.) + # Instead, the failures were all due to `pthread_kill` trying to send a signal + # to a greenlet instead of a real thread. The solution is to deliver the signal + # to the real thread by letting it get the correct ID. + 'test_wsgiref.IntegrationTests.test_interrupted_write': _make_run_with_original('threading', 'get_ident') + }) + +# PyPy3 3.5.5 v5.8-beta + +if PYPY3: + + + disabled_tests += [ + # This raises 'RuntimeError: reentrant call' when exiting the + # process tries to close the stdout stream; no other platform does this. + # Seen in both 3.3 and 3.5 (5.7 and 5.8) + 'test_signal.SiginterruptTest.test_siginterrupt_off', + ] + + +if PYPY and PY3: + disabled_tests += [ + # This fails to close all the FDs, at least on CI. On OS X, many of the + # POSIXProcessTestCase fd tests have issues. + 'test_subprocess.POSIXProcessTestCase.test_close_fds_when_max_fd_is_lowered', + + # This has the wrong constants in 5.8 (but worked in 5.7), at least on + # OS X. It finds "zlib compression" but expects "ZLIB". + 'test_ssl.ThreadedTests.test_compression', + + # The below are new with 5.10.1 + # This gets an EOF in violation of protocol; again, even without gevent + # (at least on OS X; it's less consistent about that on travis) + 'test_ssl.NetworkedBIOTests.test_handshake', + + ] + + if OSX: + disabled_tests += [ + # These all fail with "invalid_literal for int() with base 10: b''" + 'test_subprocess.POSIXProcessTestCase.test_close_fds', + 'test_subprocess.POSIXProcessTestCase.test_close_fds_after_preexec', + 'test_subprocess.POSIXProcessTestCase.test_pass_fds', + 'test_subprocess.POSIXProcessTestCase.test_pass_fds_inheritable', + 'test_subprocess.POSIXProcessTestCase.test_pipe_cloexec', + + # The below are new with 5.10.1 + # These fail with 'OSError: received malformed or improperly truncated ancillary data' + 'test_socket.RecvmsgSCMRightsStreamTest.testCmsgTruncLen0', + 'test_socket.RecvmsgSCMRightsStreamTest.testCmsgTruncLen0Plus1', + 'test_socket.RecvmsgSCMRightsStreamTest.testCmsgTruncLen1', + 'test_socket.RecvmsgSCMRightsStreamTest.testCmsgTruncLen2Minus1', + + # Using the provided High Sierra binary, these fail with + # 'ValueError: invalid protocol version _SSLMethod.PROTOCOL_SSLv3'. + # gevent code isn't involved and running them unpatched has the same issue. + 'test_ssl.ContextTests.test_constructor', + 'test_ssl.ContextTests.test_protocol', + 'test_ssl.ContextTests.test_session_stats', + 'test_ssl.ThreadedTests.test_echo', + 'test_ssl.ThreadedTests.test_protocol_sslv23', + 'test_ssl.ThreadedTests.test_protocol_sslv3', + 'test_ssl.ThreadedTests.test_protocol_tlsv1', + 'test_ssl.ThreadedTests.test_protocol_tlsv1_1', + + # This gets None instead of http1.1, even without gevent + 'test_ssl.ThreadedTests.test_npn_protocols', + + # This fails to decode a filename even without gevent, + # at least on High Sierarr. + 'test_httpservers.SimpleHTTPServerTestCase.test_undecodable_filename', + ] + + disabled_tests += [ + # This seems to be a buffering issue? Something isn't + # getting flushed. (The output is wrong). Under PyPy3 5.7, + # I couldn't reproduce locally in Ubuntu 16 in a VM + # or a laptop with OS X. Under 5.8.0, I can reproduce it, but only + # when run by the testrunner, not when run manually on the command line, + # so something is changing in stdout buffering in those situations. + 'test_threading.ThreadJoinOnShutdown.test_2_join_in_forked_process', + 'test_threading.ThreadJoinOnShutdown.test_1_join_in_forked_process', + ] + + if TRAVIS: + disabled_tests += [ + # Likewise, but I haven't produced it locally. + 'test_threading.ThreadJoinOnShutdown.test_1_join_on_shutdown', + ] + +if PYPY: + + wrapped_tests.update({ + # XXX: gevent: The error that was raised by that last call + # left a socket open on the server or client. The server gets + # to http/server.py(390)handle_one_request and blocks on + # self.rfile.readline which apparently is where the SSL + # handshake is done. That results in the exception being + # raised on the client above, but apparently *not* on the + # server. Consequently it sits trying to read from that + # socket. On CPython, when the client socket goes out of scope + # it is closed and the server raises an exception, closing the + # socket. On PyPy, we need a GC cycle for that to happen. + # Without the socket being closed and exception being raised, + # the server cannot be stopped (it runs each request in the + # same thread that would notice it had been stopped), and so + # the cleanup method added by start_https_server to stop the + # server blocks "forever". + + # This is an important test, so rather than skip it in patched_tests_setup, + # we do the gc before we return. + 'test_urllib2_localnet.TestUrlopen.test_https_with_cafile': _gc_at_end, + }) + + +if PY34 and sys.version_info[:3] < (3, 4, 4): + # Older versions have some issues with the SSL tests. Seen on Appveyor + disabled_tests += [ + 'test_ssl.ContextTests.test_options', + 'test_ssl.ThreadedTests.test_protocol_sslv23', + 'test_ssl.ThreadedTests.test_protocol_sslv3', + 'test_httplib.HTTPSTest.test_networked', + ] + +if PY34: + disabled_tests += [ + 'test_subprocess.ProcessTestCase.test_threadsafe_wait', + # XXX: It seems that threading.Timer is not being greened properly, possibly + # due to a similar issue to what gevent.threading documents for normal threads. + # In any event, this test hangs forever + + + 'test_subprocess.POSIXProcessTestCase.test_preexec_errpipe_does_not_double_close_pipes', + # Subclasses Popen, and overrides _execute_child. Expects things to be done + # in a particular order in an exception case, but we don't follow that + # exact order + + + 'test_selectors.PollSelectorTestCase.test_above_fd_setsize', + # This test attempts to open many many file descriptors and + # poll on them, expecting them all to be ready at once. But + # libev limits the number of events it will return at once. Specifically, + # on linux with epoll, it returns a max of 64 (ev_epoll.c). + + # XXX: Hangs (Linux only) + 'test_socket.NonBlockingTCPTests.testInitNonBlocking', + # We don't handle the Linux-only SOCK_NONBLOCK option + 'test_socket.NonblockConstantTest.test_SOCK_NONBLOCK', + + # Tries to use multiprocessing which doesn't quite work in + # monkey_test module (Windows only) + 'test_socket.TestSocketSharing.testShare', + + # Windows-only: Sockets have a 'ioctl' method in Python 3 + # implemented in the C code. This test tries to check + # for the presence of the method in the class, which we don't + # have because we don't inherit the C implementation. But + # it should be found at runtime. + 'test_socket.GeneralModuleTests.test_sock_ioctl', + + # See comments for 2.7; these hang + 'test_httplib.HTTPSTest.test_local_good_hostname', + 'test_httplib.HTTPSTest.test_local_unknown_cert', + + # XXX This fails for an unknown reason + 'test_httplib.HeaderTests.test_parse_all_octets', + ] + + if OSX: + disabled_tests += [ + # These raise "OSError: 12 Cannot allocate memory" on both + # patched and unpatched runs + 'test_socket.RecvmsgSCMRightsStreamTest.testFDPassEmpty', + ] + + if sys.version_info[:2] == (3, 4): + disabled_tests += [ + # These are all expecting that a signal (sigalarm) that + # arrives during a blocking call should raise + # InterruptedError with errno=EINTR. gevent does not do + # this, instead its loop keeps going and raises a timeout + # (which fails the test). HOWEVER: Python 3.5 fixed this + # problem and started raising a timeout, + # (https://docs.python.org/3/whatsnew/3.5.html#pep-475-retry-system-calls-failing-with-eintr) + # and removed these tests (InterruptedError is no longer + # raised). So basically, gevent was ahead of its time. + 'test_socket.InterruptedRecvTimeoutTest.testInterruptedRecvIntoTimeout', + 'test_socket.InterruptedRecvTimeoutTest.testInterruptedRecvTimeout', + 'test_socket.InterruptedRecvTimeoutTest.testInterruptedRecvfromIntoTimeout', + 'test_socket.InterruptedRecvTimeoutTest.testInterruptedRecvfromTimeout', + 'test_socket.InterruptedRecvTimeoutTest.testInterruptedSendTimeout', + 'test_socket.InterruptedRecvTimeoutTest.testInterruptedSendtoTimeout', + 'test_socket.InterruptedRecvTimeoutTest.testInterruptedRecvmsgTimeout', + 'test_socket.InterruptedRecvTimeoutTest.testInterruptedRecvmsgIntoTimeout', + 'test_socket.InterruptedSendTimeoutTest.testInterruptedSendmsgTimeout', + ] + + if TRAVIS: + # This has been seen to produce "Inconsistency detected by + # ld.so: dl-open.c: 231: dl_open_worker: Assertion + # `_dl_debug_initialize (0, args->nsid)->r_state == + # RT_CONSISTENT' failed!" and fail. + disabled_tests += [ + 'test_threading.ThreadTests.test_is_alive_after_fork', + ] + + if TRAVIS: + disabled_tests += [ + 'test_subprocess.ProcessTestCase.test_double_close_on_error', + # This test is racy or OS-dependent. It passes locally (sufficiently fast machine) + # but fails under Travis + ] + +if PY35: + disabled_tests += [ + # XXX: Hangs + 'test_ssl.ThreadedTests.test_nonblocking_send', + 'test_ssl.ThreadedTests.test_socketserver', + # Uses direct sendfile, doesn't properly check for it being enabled + 'test_socket.GeneralModuleTests.test__sendfile_use_sendfile', + + + # Relies on the regex of the repr having the locked state (TODO: it'd be nice if + # we did that). + # XXX: These are commented out in the source code of test_threading because + # this doesn't work. + # 'lock_tests.LockTests.lest_locked_repr', + # 'lock_tests.LockTests.lest_repr', + + # Added between 3.6.0 and 3.6.3, uses _testcapi and internals + # of the subprocess module. + 'test_subprocess.POSIXProcessTestCase.test_stopped', + + # This test opens a socket, creates a new socket with the same fileno, + # closes the original socket (and hence fileno) and then + # expects that the calling setblocking() on the duplicate socket + # will raise an error. Our implementation doesn't work that way because + # setblocking() doesn't actually touch the file descriptor. + # That's probably OK because this was a GIL state error in CPython + # see https://github.com/python/cpython/commit/fa22b29960b4e683f4e5d7e308f674df2620473c + 'test_socket.TestExceptions.test_setblocking_invalidfd', + ] + + if ARES: + disabled_tests += [ + # These raise different errors or can't resolve + # the IP address correctly + 'test_socket.GeneralModuleTests.test_host_resolution', + 'test_socket.GeneralModuleTests.test_getnameinfo', + ] + + if sys.version_info[1] == 5: + disabled_tests += [ + # This test tends to time out, but only under 3.5, not under + # 3.6 or 3.7. Seen with both libev and libuv + 'test_socket.SendfileUsingSendTest.testWithTimeoutTriggeredSend', + ] + +if sys.version_info[:3] <= (3, 5, 1): + # Python issue 26499 was fixed in 3.5.2 and these tests were added. + disabled_tests += [ + 'test_httplib.BasicTest.test_mixed_reads', + 'test_httplib.BasicTest.test_read1_bound_content_length', + 'test_httplib.BasicTest.test_read1_content_length', + 'test_httplib.BasicTest.test_readline_bound_content_length', + 'test_httplib.BasicTest.test_readlines_content_length', + ] + +if PY36: + disabled_tests += [ + 'test_threading.MiscTestCase.test__all__', + ] + + # We don't actually implement socket._sendfile_use_sendfile, + # so these tests, which think they're using that and os.sendfile, + # fail. + disabled_tests += [ + 'test_socket.SendfileUsingSendfileTest.testCount', + 'test_socket.SendfileUsingSendfileTest.testCountSmall', + 'test_socket.SendfileUsingSendfileTest.testCountWithOffset', + 'test_socket.SendfileUsingSendfileTest.testOffset', + 'test_socket.SendfileUsingSendfileTest.testRegularFile', + 'test_socket.SendfileUsingSendfileTest.testWithTimeout', + 'test_socket.SendfileUsingSendfileTest.testEmptyFileSend', + 'test_socket.SendfileUsingSendfileTest.testNonBlocking', + 'test_socket.SendfileUsingSendfileTest.test_errors', + ] + + # Ditto + disabled_tests += [ + 'test_socket.GeneralModuleTests.test__sendfile_use_sendfile', + ] + + disabled_tests += [ + # This test requires Linux >= 4.3. When we were running 'dist: + # trusty' on the 4.4 kernel, it passed (~July 2017). But when + # trusty became the default dist in September 2017 and updated + # the kernel to 4.11.6, it begain failing. It fails on `res = + # op.recv(assoclen + len(plain) + taglen)` (where 'op' is the + # client socket) with 'OSError: [Errno 22] Invalid argument' + # for unknown reasons. This is *after* having successfully + # called `op.sendmsg_afalg`. Post 3.6.0, what we test with, + # the test was changed to require Linux 4.9 and the data was changed, + # so this is not our fault. We should eventually update this when we + # update our 3.6 version. + # See https://bugs.python.org/issue29324 + 'test_socket.LinuxKernelCryptoAPI.test_aead_aes_gcm', + ] + +if PY37: + disabled_tests += [ + # These want to use the private '_communicate' method, which + # our Popen doesn't have. + 'test_subprocess.MiscTests.test_call_keyboardinterrupt_no_kill', + 'test_subprocess.MiscTests.test_context_manager_keyboardinterrupt_no_kill', + 'test_subprocess.MiscTests.test_run_keyboardinterrupt_no_kill', + + # This wants to check that the underlying fileno is blocking, + # but it isn't. + 'test_socket.NonBlockingTCPTests.testSetBlocking', + + # 3.7b2 made it impossible to instantiate SSLSocket objects + # directly, and this tests for that, but we don't follow that change. + 'test_ssl.BasicSocketTests.test_private_init', + + # 3.7b2 made a change to this test that on the surface looks incorrect, + # but it passes when they run it and fails when we do. It's not + # clear why. + 'test_ssl.ThreadedTests.test_check_hostname_idn', + ] + + if APPVEYOR: + disabled_tests += [ + + ] + +# if 'signalfd' in os.environ.get('GEVENT_BACKEND', ''): +# # tests that don't interact well with signalfd +# disabled_tests.extend([ +# 'test_signal.SiginterruptTest.test_siginterrupt_off', +# 'test_socketserver.SocketServerTest.test_ForkingTCPServer', +# 'test_socketserver.SocketServerTest.test_ForkingUDPServer', +# 'test_socketserver.SocketServerTest.test_ForkingUnixStreamServer']) + +# LibreSSL reports OPENSSL_VERSION_INFO (2, 0, 0, 0, 0) regardless of its version, +# so this is known to fail on some distros. We don't want to detect this because we +# don't want to trigger the side-effects of importing ssl prematurely if we will +# be monkey-patching, so we skip this test everywhere. It doesn't do much for us +# anyway. +disabled_tests += [ + 'test_ssl.BasicSocketTests.test_openssl_version' +] + +# Now build up the data structure we'll use to actually find disabled tests +# to avoid a linear scan for every file (it seems the list could get quite large) +# (First, freeze the source list to make sure it isn't modified anywhere) + +def _build_test_structure(sequence_of_tests): + + _disabled_tests = frozenset(sequence_of_tests) + + disabled_tests_by_file = collections.defaultdict(set) + for file_case_meth in _disabled_tests: + file_name, _case, _meth = file_case_meth.split('.') + + by_file = disabled_tests_by_file[file_name] + + by_file.add(file_case_meth) + + return disabled_tests_by_file + +_disabled_tests_by_file = _build_test_structure(disabled_tests) + +_wrapped_tests_by_file = _build_test_structure(wrapped_tests) + + +def disable_tests_in_source(source, filename): + # Source and filename are both native strings. + + if filename.startswith('./'): + # turn "./test_socket.py" (used for auto-complete) into "test_socket.py" + filename = filename[2:] + + if filename.endswith('.py'): + filename = filename[:-3] + + + # XXX ignoring TestCase class name (just using function name). + # Maybe we should do this with the AST, or even after the test is + # imported. + my_disabled_tests = _disabled_tests_by_file.get(filename, ()) + my_wrapped_tests = _wrapped_tests_by_file.get(filename, {}) + + + if my_disabled_tests or my_wrapped_tests: + # Insert our imports early in the file. + # If we do it on a def-by-def basis, we can break syntax + # if the function is already decorated + pattern = r'^import .*' + replacement = r'from gevent.testing import patched_tests_setup as _GEVENT_PTS;' + replacement += r'import unittest as _GEVENT_UTS;' + replacement += r'\g<0>' + source, n = re.subn(pattern, replacement, source, 1, re.MULTILINE) + + print("Added imports", n) + + # Test cases will always be indented some, + # so use [ \t]+. Without indentation, test_main, commonly used as the + # __main__ function at the top level, could get matched. \s matches + # newlines even in MULTILINE mode so it would still match that. + my_disabled_testcases = set() + for test in my_disabled_tests: + testcase = test.split('.')[-1] + my_disabled_testcases.add(testcase) + # def foo_bar(self) + # -> + # @_GEVENT_UTS.skip('Removed by patched_tests_setup') + # def foo_bar(self) + pattern = r"^([ \t]+)def " + testcase + replacement = r"\1@_GEVENT_UTS.skip('Removed by patched_tests_setup: %s')\n" % (test,) + replacement += r"\g<0>" + source, n = re.subn(pattern, replacement, source, 0, re.MULTILINE) + print('Skipped %s (%d)' % (testcase, n), file=sys.stderr) + + + for test in my_wrapped_tests: + testcase = test.split('.')[-1] + if testcase in my_disabled_testcases: + print("Not wrapping %s because it is skipped" % (test,)) + continue + + # def foo_bar(self) + # -> + # @_GEVENT_PTS._PatchedTest('file.Case.name') + # def foo_bar(self) + pattern = r"^([ \t]+)def " + testcase + replacement = r"\1@_GEVENT_PTS._PatchedTest('%s')\n" % (test,) + replacement += r"\g<0>" + + source, n = re.subn(pattern, replacement, source, 0, re.MULTILINE) + print('Wrapped %s (%d)' % (testcase, n), file=sys.stderr) + + return source diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/testing/six.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/testing/six.py new file mode 100644 index 00000000..955d14b5 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/testing/six.py @@ -0,0 +1,42 @@ +import sys +# pylint:disable=unused-argument,import-error + +PY3 = sys.version_info[0] >= 3 + +if PY3: + import builtins + exec_ = getattr(builtins, "exec") + + def reraise(tp, value, tb=None): + if value.__traceback__ is not tb: + raise value.with_traceback(tb) + raise value + + xrange = range + string_types = (str,) + text_type = str + +else: + def exec_(code, globs=None, locs=None): + """Execute code in a namespace.""" + if globs is None: + frame = sys._getframe(1) + globs = frame.f_globals + if locs is None: + locs = frame.f_locals + del frame + elif locs is None: + locs = globs + exec("""exec code in globs, locs""") + + import __builtin__ as builtins + xrange = builtins.xrange + string_types = (builtins.basestring,) + text_type = builtins.unicode + + exec_("""def reraise(tp, value, tb=None): + try: + raise tp, value, tb + finally: + tb = None +""") diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/testing/skipping.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/testing/skipping.py new file mode 100644 index 00000000..d2de2f52 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/testing/skipping.py @@ -0,0 +1,116 @@ +# Copyright (c) 2018 gevent community +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. +from __future__ import absolute_import, print_function, division + +import unittest + +from . import sysinfo + +def _identity(f): + return f + +def _do_not_skip(reason): + assert reason + return _identity + + +skipOnWindows = _do_not_skip +skipOnAppVeyor = _do_not_skip +skipOnCI = _do_not_skip + +skipOnPyPy = _do_not_skip +skipOnPyPyOnCI = _do_not_skip +skipOnPyPy3OnCI = _do_not_skip +skipOnPyPy3 = _do_not_skip +skipOnPyPyOnWindows = _do_not_skip + +skipOnPy37 = unittest.skip if sysinfo.PY37 else _do_not_skip + +skipOnPurePython = unittest.skip if sysinfo.PURE_PYTHON else _do_not_skip +skipWithCExtensions = unittest.skip if not sysinfo.PURE_PYTHON else _do_not_skip + +skipOnLibuv = _do_not_skip +skipOnLibuvOnWin = _do_not_skip +skipOnLibuvOnCI = _do_not_skip +skipOnLibuvOnCIOnPyPy = _do_not_skip +skipOnLibuvOnPyPyOnWin = _do_not_skip +skipOnLibuvOnTravisOnCPython27 = _do_not_skip + +skipOnLibev = _do_not_skip + +if sysinfo.WIN: + skipOnWindows = unittest.skip + + +if sysinfo.RUNNING_ON_APPVEYOR: + # See comments scattered around about timeouts and the timer + # resolution available on appveyor (lots of jitter). this + # seems worse with the 62-bit builds. + # Note that we skip/adjust these tests only on AppVeyor, not + # win32---we don't think there's gevent related problems but + # environment related problems. These can be tested and debugged + # separately on windows in a more stable environment. + skipOnAppVeyor = unittest.skip + + +if sysinfo.RUNNING_ON_CI: + skipOnCI = unittest.skip + + +if sysinfo.PYPY: + skipOnPyPy = unittest.skip + if sysinfo.RUNNING_ON_CI: + skipOnPyPyOnCI = unittest.skip + + if sysinfo.WIN: + skipOnPyPyOnWindows = unittest.skip + + if sysinfo.PYPY3: + skipOnPyPy3 = unittest.skip + if sysinfo.RUNNING_ON_CI: + # Same as above, for PyPy3.3-5.5-alpha and 3.5-5.7.1-beta and 3.5-5.8 + skipOnPyPy3OnCI = unittest.skip + + +skipUnderCoverage = unittest.skip if sysinfo.RUN_COVERAGE else _do_not_skip + +skipIf = unittest.skipIf +skipUnless = unittest.skipUnless + + + +if sysinfo.LIBUV: + skipOnLibuv = unittest.skip + + if sysinfo.RUNNING_ON_CI: + skipOnLibuvOnCI = unittest.skip + if sysinfo.PYPY: + skipOnLibuvOnCIOnPyPy = unittest.skip + if sysinfo.RUNNING_ON_TRAVIS: + if sysinfo.CPYTHON: + if sysinfo.PY27_ONLY: + skipOnLibuvOnTravisOnCPython27 = unittest.skip + + if sysinfo.WIN: + skipOnLibuvOnWin = unittest.skip + if sysinfo.PYPY: + skipOnLibuvOnPyPyOnWin = unittest.skip +else: + skipOnLibev = unittest.skip diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/testing/sockets.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/testing/sockets.py new file mode 100644 index 00000000..147da63b --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/testing/sockets.py @@ -0,0 +1,41 @@ +# Copyright (c) 2018 gevent community +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. +from __future__ import absolute_import, print_function, division + +from .params import DEFAULT_BIND_ADDR_TUPLE + +def bind_and_listen(sock, address=DEFAULT_BIND_ADDR_TUPLE, backlog=50, reuse_addr=True): + from socket import SOL_SOCKET, SO_REUSEADDR, error + if reuse_addr: + try: + sock.setsockopt(SOL_SOCKET, SO_REUSEADDR, + sock.getsockopt(SOL_SOCKET, SO_REUSEADDR) | 1) + except error: + pass + sock.bind(address) + sock.listen(backlog) + + +def tcp_listener(address=DEFAULT_BIND_ADDR_TUPLE, backlog=50, reuse_addr=True): + """A shortcut to create a TCP socket, bind it and put it into listening state.""" + from gevent import socket + sock = socket.socket() + bind_and_listen(sock, address, backlog=backlog, reuse_addr=reuse_addr) + return sock diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/testing/switching.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/testing/switching.py new file mode 100644 index 00000000..d846dc8c --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/testing/switching.py @@ -0,0 +1,64 @@ +# Copyright (c) 2018 gevent community +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. +from __future__ import absolute_import, print_function, division + +from functools import wraps + +from gevent.hub import _get_hub + +from .hub import QuietHub + +from .patched_tests_setup import get_switch_expected + +def wrap_switch_count_check(method): + @wraps(method) + def wrapper(self, *args, **kwargs): + initial_switch_count = getattr(_get_hub(), 'switch_count', None) + self.switch_expected = getattr(self, 'switch_expected', True) + if initial_switch_count is not None: + fullname = getattr(self, 'fullname', None) + if self.switch_expected == 'default' and fullname: + self.switch_expected = get_switch_expected(fullname) + result = method(self, *args, **kwargs) + if initial_switch_count is not None and self.switch_expected is not None: + switch_count = _get_hub().switch_count - initial_switch_count + if self.switch_expected is True: + assert switch_count >= 0 + if not switch_count: + raise AssertionError('%s did not switch' % fullname) + elif self.switch_expected is False: + if switch_count: + raise AssertionError('%s switched but not expected to' % fullname) + else: + raise AssertionError('Invalid value for switch_expected: %r' % (self.switch_expected, )) + return result + return wrapper + + + + +class CountingHub(QuietHub): + + switch_count = 0 + + def switch(self, *args): + # pylint:disable=arguments-differ + self.switch_count += 1 + return QuietHub.switch(self, *args) diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/testing/sysinfo.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/testing/sysinfo.py new file mode 100644 index 00000000..b20b595e --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/testing/sysinfo.py @@ -0,0 +1,137 @@ +# Copyright (c) 2018 gevent community +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. + +import os +import sys + +import gevent.core +from gevent import _compat as gsysinfo + +PYPY = gsysinfo.PYPY +CPYTHON = not PYPY +VERBOSE = sys.argv.count('-v') > 1 +WIN = gsysinfo.WIN +LINUX = gsysinfo.LINUX +OSX = gsysinfo.OSX + +PURE_PYTHON = gsysinfo.PURE_PYTHON + +# XXX: Formalize this better +LIBUV = 'libuv' in gevent.core.loop.__module__ # pylint:disable=no-member +CFFI_BACKEND = PYPY or LIBUV or 'cffi' in os.getenv('GEVENT_LOOP', '') + +if '--debug-greentest' in sys.argv: + sys.argv.remove('--debug-greentest') + DEBUG = True +else: + DEBUG = False + +RUN_LEAKCHECKS = os.getenv('GEVENTTEST_LEAKCHECK') +RUN_COVERAGE = os.getenv("COVERAGE_PROCESS_START") or os.getenv("GEVENTTEST_COVERAGE") + +# Generally, ignore the portions that are only implemented +# on particular platforms; they generally contain partial +# implementations completed in different modules. +PLATFORM_SPECIFIC_SUFFIXES = ('2', '279', '3') +if WIN: + PLATFORM_SPECIFIC_SUFFIXES += ('posix',) + +PY2 = None +PY3 = None +PY34 = None +PY35 = None +PY36 = None +PY37 = None + +NON_APPLICABLE_SUFFIXES = () +if sys.version_info[0] == 3: + # Python 3 + NON_APPLICABLE_SUFFIXES += ('2', '279') + PY2 = False + PY3 = True + if sys.version_info[1] >= 4: + PY34 = True + if sys.version_info[1] >= 5: + PY35 = True + if sys.version_info[1] >= 6: + PY36 = True + if sys.version_info[1] >= 7: + PY37 = True + +elif sys.version_info[0] == 2: + # Any python 2 + PY3 = False + PY2 = True + NON_APPLICABLE_SUFFIXES += ('3',) + if (sys.version_info[1] < 7 + or (sys.version_info[1] == 7 and sys.version_info[2] < 9)): + # Python 2, < 2.7.9 + NON_APPLICABLE_SUFFIXES += ('279',) + +PYPY3 = PYPY and PY3 + +PY27_ONLY = sys.version_info[0] == 2 and sys.version_info[1] == 7 + +PYGTE279 = ( + sys.version_info[0] == 2 + and sys.version_info[1] >= 7 + and sys.version_info[2] >= 9 +) + +if WIN: + NON_APPLICABLE_SUFFIXES += ("posix",) + # This is intimately tied to FileObjectPosix + NON_APPLICABLE_SUFFIXES += ("fileobject2",) + SHARED_OBJECT_EXTENSION = ".pyd" +else: + SHARED_OBJECT_EXTENSION = ".so" + + +RUNNING_ON_TRAVIS = os.environ.get('TRAVIS') +RUNNING_ON_APPVEYOR = os.environ.get('APPVEYOR') +RUNNING_ON_CI = RUNNING_ON_TRAVIS or RUNNING_ON_APPVEYOR + +if RUNNING_ON_APPVEYOR: + # We can't exec corecext on appveyor if we haven't run setup.py in + # 'develop' mode (i.e., we install) + NON_APPLICABLE_SUFFIXES += ('corecext',) + +EXPECT_POOR_TIMER_RESOLUTION = (PYPY3 + or RUNNING_ON_APPVEYOR + or (LIBUV and PYPY) + or RUN_COVERAGE) + + +CONN_ABORTED_ERRORS = [] +try: + from errno import WSAECONNABORTED + CONN_ABORTED_ERRORS.append(WSAECONNABORTED) +except ImportError: + pass + +from errno import ECONNRESET +CONN_ABORTED_ERRORS.append(ECONNRESET) + +CONN_ABORTED_ERRORS = frozenset(CONN_ABORTED_ERRORS) + +RESOLVER_ARES = os.getenv('GEVENT_RESOLVER') == 'ares' +RESOLVER_DNSPYTHON = os.getenv('GEVENT_RESOLVER') == 'dnspython' + +RESOLVER_NOT_SYSTEM = RESOLVER_ARES or RESOLVER_DNSPYTHON diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/testing/testcase.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/testing/testcase.py new file mode 100644 index 00000000..c16413b7 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/testing/testcase.py @@ -0,0 +1,340 @@ +# Copyright (c) 2018 gevent community +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. +from __future__ import absolute_import, print_function, division + +import sys +from time import time +import os.path +from contextlib import contextmanager +from unittest import TestCase as BaseTestCase +from functools import wraps + +import gevent + +from . import sysinfo +from . import params +from . import leakcheck +from . import errorhandler +from . import flaky + +from .patched_tests_setup import get_switch_expected + +class TimeAssertMixin(object): + @flaky.reraises_flaky_timeout() + def assertTimeoutAlmostEqual(self, first, second, places=None, msg=None, delta=None): + try: + self.assertAlmostEqual(first, second, places=places, msg=msg, delta=delta) + except AssertionError: + flaky.reraiseFlakyTestTimeout() + + + if sysinfo.EXPECT_POOR_TIMER_RESOLUTION: + # pylint:disable=unused-argument + def assertTimeWithinRange(self, time_taken, min_time, max_time): + return + else: + def assertTimeWithinRange(self, time_taken, min_time, max_time): + self.assertLessEqual(time_taken, max_time) + self.assertGreaterEqual(time_taken, min_time) + + @contextmanager + def runs_in_given_time(self, expected, fuzzy=None): + if fuzzy is None: + if sysinfo.EXPECT_POOR_TIMER_RESOLUTION or sysinfo.LIBUV: + # The noted timer jitter issues on appveyor/pypy3 + fuzzy = expected * 5.0 + else: + fuzzy = expected / 2.0 + start = time() + yield + elapsed = time() - start + try: + self.assertTrue( + expected - fuzzy <= elapsed <= expected + fuzzy, + 'Expected: %r; elapsed: %r; fuzzy %r' % (expected, elapsed, fuzzy)) + except AssertionError: + flaky.reraiseFlakyTestRaceCondition() + + def runs_in_no_time( + self, + fuzzy=(0.01 if not sysinfo.EXPECT_POOR_TIMER_RESOLUTION and not sysinfo.LIBUV else 1.0)): + return self.runs_in_given_time(0.0, fuzzy) + + +def _wrap_timeout(timeout, method): + if timeout is None: + return method + + @wraps(method) + def wrapper(self, *args, **kwargs): + with gevent.Timeout(timeout, 'test timed out', ref=False): + return method(self, *args, **kwargs) + + return wrapper + +def _get_class_attr(classDict, bases, attr, default=AttributeError): + NONE = object() + value = classDict.get(attr, NONE) + if value is not NONE: + return value + for base in bases: + value = getattr(base, attr, NONE) + if value is not NONE: + return value + if default is AttributeError: + raise AttributeError('Attribute %r not found\n%s\n%s\n' % (attr, classDict, bases)) + return default + + +class TestCaseMetaClass(type): + # wrap each test method with + # a) timeout check + # b) fatal error check + # c) restore the hub's error handler (see expect_one_error) + # d) totalrefcount check + def __new__(cls, classname, bases, classDict): + # pylint and pep8 fight over what this should be called (mcs or cls). + # pylint gets it right, but we cant scope disable pep8, so we go with + # its convention. + # pylint: disable=bad-mcs-classmethod-argument + timeout = classDict.get('__timeout__', 'NONE') + if timeout == 'NONE': + timeout = getattr(bases[0], '__timeout__', None) + if sysinfo.RUN_LEAKCHECKS and timeout is not None: + timeout *= 6 + check_totalrefcount = _get_class_attr(classDict, bases, 'check_totalrefcount', True) + + error_fatal = _get_class_attr(classDict, bases, 'error_fatal', True) + uses_handle_error = _get_class_attr(classDict, bases, 'uses_handle_error', True) + # Python 3: must copy, we mutate the classDict. Interestingly enough, + # it doesn't actually error out, but under 3.6 we wind up wrapping + # and re-wrapping the same items over and over and over. + for key, value in list(classDict.items()): + if key.startswith('test') and callable(value): + classDict.pop(key) + # XXX: When did we stop doing this? + #value = wrap_switch_count_check(value) + value = _wrap_timeout(timeout, value) + error_fatal = getattr(value, 'error_fatal', error_fatal) + if error_fatal: + value = errorhandler.wrap_error_fatal(value) + if uses_handle_error: + value = errorhandler.wrap_restore_handle_error(value) + if check_totalrefcount and sysinfo.RUN_LEAKCHECKS: + value = leakcheck.wrap_refcount(value) + classDict[key] = value + return type.__new__(cls, classname, bases, classDict) + +def _noop(): + return + +class SubscriberCleanupMixin(object): + + def setUp(self): + super(SubscriberCleanupMixin, self).setUp() + from gevent import events + self.__old_subscribers = events.subscribers[:] + + def tearDown(self): + from gevent import events + events.subscribers[:] = self.__old_subscribers + super(SubscriberCleanupMixin, self).tearDown() + + +class TestCase(TestCaseMetaClass("NewBase", + (SubscriberCleanupMixin, TimeAssertMixin, BaseTestCase,), + {})): + __timeout__ = params.LOCAL_TIMEOUT if not sysinfo.RUNNING_ON_CI else params.CI_TIMEOUT + + switch_expected = 'default' + error_fatal = True + uses_handle_error = True + close_on_teardown = () + __old_subscribers = () + + def run(self, *args, **kwargs): + # pylint:disable=arguments-differ + if self.switch_expected == 'default': + self.switch_expected = get_switch_expected(self.fullname) + return BaseTestCase.run(self, *args, **kwargs) + + def setUp(self): + super(TestCase, self).setUp() + # Especially if we're running in leakcheck mode, where + # the same test gets executed repeatedly, we need to update the + # current time. Tests don't always go through the full event loop, + # so that doesn't always happen. test__pool.py:TestPoolYYY.test_async + # tends to show timeouts that are too short if we don't. + # XXX: Should some core part of the loop call this? + gevent.get_hub().loop.update_now() + self.close_on_teardown = [] + + def tearDown(self): + if getattr(self, 'skipTearDown', False): + return + + cleanup = getattr(self, 'cleanup', _noop) + cleanup() + self._error = self._none + self._tearDownCloseOnTearDown() + self.close_on_teardown = [] + super(TestCase, self).tearDown() + + def _tearDownCloseOnTearDown(self): + # XXX: Should probably reverse this + for x in self.close_on_teardown: + close = getattr(x, 'close', x) + try: + close() + except Exception: # pylint:disable=broad-except + pass + + @classmethod + def setUpClass(cls): + import warnings + cls._warning_cm = warnings.catch_warnings() + cls._warning_cm.__enter__() + if not sys.warnoptions: + warnings.simplefilter('default') + super(TestCase, cls).setUpClass() + + @classmethod + def tearDownClass(cls): + cls._warning_cm.__exit__(None, None, None) + super(TestCase, cls).tearDownClass() + + def _close_on_teardown(self, resource): + """ + *resource* either has a ``close`` method, or is a + callable. + """ + self.close_on_teardown.append(resource) + return resource + + @property + def testname(self): + return getattr(self, '_testMethodName', '') or getattr(self, '_TestCase__testMethodName') + + @property + def testcasename(self): + return self.__class__.__name__ + '.' + self.testname + + @property + def modulename(self): + return os.path.basename(sys.modules[self.__class__.__module__].__file__).rsplit('.', 1)[0] + + @property + def fullname(self): + return os.path.splitext(os.path.basename(self.modulename))[0] + '.' + self.testcasename + + _none = (None, None, None) + # (context, kind, value) + _error = _none + + def expect_one_error(self): + self.assertEqual(self._error, self._none) + gevent.get_hub().handle_error = self._store_error + + def _store_error(self, where, t, value, tb): + del tb + if self._error != self._none: + gevent.get_hub().parent.throw(t, value) + else: + self._error = (where, t, value) + + def peek_error(self): + return self._error + + def get_error(self): + try: + return self._error + finally: + self._error = self._none + + def assert_error(self, kind=None, value=None, error=None, where_type=None): + if error is None: + error = self.get_error() + econtext, ekind, evalue = error + if kind is not None: + self.assertIsInstance(kind, type) + self.assertIsNotNone( + ekind, + "Error must not be none %r" % (error,)) + assert issubclass(ekind, kind), error + if value is not None: + if isinstance(value, str): + self.assertEqual(str(evalue), value) + else: + self.assertIs(evalue, value) + if where_type is not None: + self.assertIsInstance(econtext, where_type) + return error + + def assertMonkeyPatchedFuncSignatures(self, mod_name, func_names=(), exclude=()): + # We use inspect.getargspec because it's the only thing available + # in Python 2.7, but it is deprecated + # pylint:disable=deprecated-method,too-many-locals + import inspect + import warnings + from gevent.monkey import get_original + # XXX: Very similar to gevent.monkey.patch_module. Should refactor? + gevent_module = getattr(__import__('gevent.' + mod_name), mod_name) + module_name = getattr(gevent_module, '__target__', mod_name) + + funcs_given = True + if not func_names: + funcs_given = False + func_names = getattr(gevent_module, '__implements__') + + for func_name in func_names: + if func_name in exclude: + continue + gevent_func = getattr(gevent_module, func_name) + if not inspect.isfunction(gevent_func) and not funcs_given: + continue + + func = get_original(module_name, func_name) + + try: + with warnings.catch_warnings(): + warnings.simplefilter("ignore") + gevent_sig = inspect.getargspec(gevent_func) + sig = inspect.getargspec(func) + except TypeError: + if funcs_given: + raise + # Can't do this one. If they specifically asked for it, + # it's an error, otherwise it's not. + # Python 3 can check a lot more than Python 2 can. + continue + self.assertEqual(sig.args, gevent_sig.args, func_name) + # The next three might not actually matter? + self.assertEqual(sig.varargs, gevent_sig.varargs, func_name) + self.assertEqual(sig.keywords, gevent_sig.keywords, func_name) + self.assertEqual(sig.defaults, gevent_sig.defaults, func_name) + + def assertEqualFlakyRaceCondition(self, a, b): + try: + self.assertEqual(a, b) + except AssertionError: + flaky.reraiseFlakyTestRaceCondition() + + assertRaisesRegex = getattr(BaseTestCase, 'assertRaisesRegex', + getattr(BaseTestCase, 'assertRaisesRegexp')) diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/testing/testrunner.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/testing/testrunner.py new file mode 100644 index 00000000..2eb4debd --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/testing/testrunner.py @@ -0,0 +1,481 @@ +#!/usr/bin/env python +from __future__ import print_function, absolute_import, division + +import sys +import os +import glob +import traceback +import time +import importlib +from datetime import timedelta + +from multiprocessing.pool import ThreadPool +from multiprocessing import cpu_count +from . import util +from .util import log +from .sysinfo import RUNNING_ON_CI +from .sysinfo import PYPY +from .sysinfo import PY2 +from .sysinfo import RESOLVER_ARES +from .sysinfo import RUN_LEAKCHECKS +from . import six + +# Import this while we're probably single-threaded/single-processed +# to try to avoid issues with PyPy 5.10. +# See https://bitbucket.org/pypy/pypy/issues/2769/systemerror-unexpected-internal-exception +try: + __import__('_testcapi') +except (ImportError, OSError, IOError): + # This can raise a wide variety of errors + pass + +TIMEOUT = 100 +NWORKERS = int(os.environ.get('NWORKERS') or max(cpu_count() - 1, 4)) +if NWORKERS > 10: + NWORKERS = 10 + +if RUN_LEAKCHECKS: + # Capturing the stats takes time, and we run each + # test at least twice + TIMEOUT = 200 + +DEFAULT_RUN_OPTIONS = { + 'timeout': TIMEOUT +} + + +if RUNNING_ON_CI: + # Too many and we get spurious timeouts + NWORKERS = 4 + + + + +def _package_relative_filename(filename, package): + if not os.path.isfile(filename) and package: + # Ok, try to locate it as a module in the package + package_dir = _dir_from_package_name(package) + return os.path.join(package_dir, filename) + return filename + +def _dir_from_package_name(package): + package_mod = importlib.import_module(package) + package_dir = os.path.dirname(package_mod.__file__) + return package_dir + + +def run_many(tests, + configured_failing_tests=(), + failfast=False, + quiet=False, + configured_run_alone_tests=()): + # pylint:disable=too-many-locals,too-many-statements + global NWORKERS + start = time.time() + total = 0 + failed = {} + passed = {} + total_cases = [0] + total_skipped = [0] + + NWORKERS = min(len(tests), NWORKERS) or 1 + + pool = ThreadPool(NWORKERS) + util.BUFFER_OUTPUT = NWORKERS > 1 or quiet + + def run_one(cmd, **kwargs): + kwargs['quiet'] = quiet + result = util.run(cmd, **kwargs) + if result: + if failfast: + sys.exit(1) + failed[result.name] = [cmd, kwargs] + else: + passed[result.name] = True + total_cases[0] += result.run_count + total_skipped[0] += result.skipped_count + + results = [] + + def reap(): + for r in results[:]: + if not r.ready(): + continue + if r.successful(): + results.remove(r) + else: + r.get() + sys.exit('Internal error in testrunner.py: %r' % (r, )) + return len(results) + + def reap_all(): + while reap() > 0: + time.sleep(0.1) + + def spawn(cmd, options): + while True: + if reap() < NWORKERS: + r = pool.apply_async(run_one, (cmd, ), options or {}) + results.append(r) + return + + time.sleep(0.05) + + run_alone = [] + + try: + try: + log("Running tests in parallel with concurrency %s" % (NWORKERS,),) + for cmd, options in tests: + total += 1 + options = options or {} + if matches(configured_run_alone_tests, cmd): + run_alone.append((cmd, options)) + else: + spawn(cmd, options) + pool.close() + pool.join() + + log("Running tests marked standalone") + for cmd, options in run_alone: + run_one(cmd, **options) + + except KeyboardInterrupt: + try: + log('Waiting for currently running to finish...') + reap_all() + except KeyboardInterrupt: + pool.terminate() + report(total, failed, passed, exit=False, took=time.time() - start, + configured_failing_tests=configured_failing_tests, + total_cases=total_cases[0], total_skipped=total_skipped[0]) + log('(partial results)\n') + raise + except: + traceback.print_exc() + pool.terminate() + raise + + reap_all() + report(total, failed, passed, took=time.time() - start, + configured_failing_tests=configured_failing_tests, + total_cases=total_cases[0], total_skipped=total_skipped[0]) + +def discover( + tests=None, ignore_files=None, + ignored=(), coverage=False, + package=None, + configured_ignore_coverage=(), + configured_test_options=None, +): + # pylint:disable=too-many-locals,too-many-branches + configured_test_options = configured_test_options or {} + olddir = os.getcwd() + ignore = set(ignored or ()) + + if ignore_files: + ignore_files = ignore_files.split(',') + for f in ignore_files: + ignore.update(set(load_list_from_file(f, package))) + + if coverage: + ignore.update(configured_ignore_coverage) + + if package: + package_dir = _dir_from_package_name(package) + # We need to glob relative names, our config is based on filenames still + os.chdir(package_dir) + + if not tests: + tests = set(glob.glob('test_*.py')) - set(['test_support.py']) + else: + tests = set(tests) + + if ignore: + # Always ignore the designated list, even if tests were specified + # on the command line. This fixes a nasty interaction with test__threading_vs_settrace.py + # being run under coverage when 'grep -l subprocess test*py' is used to list the tests + # to run. + tests -= ignore + tests = sorted(tests) + + to_process = [] + to_import = [] + + for filename in tests: + module_name = os.path.splitext(filename)[0] + qualified_name = package + '.' + module_name if package else module_name + with open(os.path.abspath(filename), 'rb') as f: + # Some of the test files (e.g., test__socket_dns) are + # UTF8 encoded. Depending on the environment, Python 3 may + # try to decode those as ASCII, which fails with UnicodeDecodeError. + # Thus, be sure to open and compare in binary mode. + # Open the absolute path to make errors more clear, + # but we can't store the absolute path, our configuration is based on + # relative file names. + contents = f.read() + if b'TESTRUNNER' in contents: # test__monkey_patching.py + # XXX: Rework this to avoid importing. + to_import.append(qualified_name) + else: + cmd = [sys.executable, '-u'] + if PYPY and PY2: + # Doesn't seem to be an env var for this + cmd.extend(('-X', 'track-resources')) + if package: + # Using a package is the best way to work with coverage 5 + # when we specify 'source = ' + cmd.append('-m' + qualified_name) + else: + cmd.append(filename) + + options = DEFAULT_RUN_OPTIONS.copy() + options.update(configured_test_options.get(filename, {})) + to_process.append((cmd, options)) + + os.chdir(olddir) + # When we actually execute, do so from the original directory, + # this helps find setup.py + for qualified_name in to_import: + module = importlib.import_module(qualified_name) + for cmd, options in module.TESTRUNNER(): + if remove_options(cmd)[-1] in ignore: + continue + to_process.append((cmd, options)) + + return to_process + + +def remove_options(lst): + return [x for x in lst if x and not x.startswith('-')] + +def load_list_from_file(filename, package): + result = [] + if filename: + with open(_package_relative_filename(filename, package)) as f: + for x in f: + x = x.split('#', 1)[0].strip() + if x: + result.append(x) + return result + + +def matches(possibilities, command, include_flaky=True): + if isinstance(command, list): + command = ' '.join(command) + for line in possibilities: + if not include_flaky and line.startswith('FLAKY '): + continue + line = line.replace('FLAKY ', '') + # Our configs are still mostly written in terms of file names, + # but the non-monkey tests are now using package names. + # Strip off '.py' from filenames to see if we match a module. + # XXX: This could be much better. Our command needs better structure. + if command.endswith(' ' + line) or command.endswith(line.replace(".py", '')): + return True + return False + + +def format_seconds(seconds): + if seconds < 20: + return '%.1fs' % seconds + seconds = str(timedelta(seconds=round(seconds))) + if seconds.startswith('0:'): + seconds = seconds[2:] + return seconds + + +def report(total, failed, passed, exit=True, took=None, + configured_failing_tests=(), + total_cases=0, total_skipped=0): + # pylint:disable=redefined-builtin,too-many-branches,too-many-locals + runtimelog = util.runtimelog + if runtimelog: + log('\nLongest-running tests:') + runtimelog.sort() + length = len('%.1f' % -runtimelog[0][0]) + frmt = '%' + str(length) + '.1f seconds: %s' + for delta, name in runtimelog[:5]: + log(frmt, -delta, name) + if took: + took = ' in %s' % format_seconds(took) + else: + took = '' + + failed_expected = [] + failed_unexpected = [] + passed_unexpected = [] + + for name in passed: + if matches(configured_failing_tests, name, include_flaky=False): + passed_unexpected.append(name) + + if passed_unexpected: + log('\n%s/%s unexpected passes', len(passed_unexpected), total, color='error') + print_list(passed_unexpected) + + if failed: + log('\n%s/%s tests failed%s', len(failed), total, took) + + for name in failed: + if matches(configured_failing_tests, name, include_flaky=True): + failed_expected.append(name) + else: + failed_unexpected.append(name) + + if failed_expected: + log('\n%s/%s expected failures', len(failed_expected), total) + print_list(failed_expected) + + if failed_unexpected: + log('\n%s/%s unexpected failures', len(failed_unexpected), total, color='error') + print_list(failed_unexpected) + else: + log( + '\nRan %s tests%s in %s files%s', + total_cases, + util._colorize('skipped', " (skipped=%d)" % total_skipped) if total_skipped else '', + total, + took, + ) + + if exit: + if failed_unexpected: + sys.exit(min(100, len(failed_unexpected))) + if passed_unexpected: + sys.exit(101) + if total <= 0: + sys.exit('No tests found.') + + +def print_list(lst): + for name in lst: + log(' - %s', name) + +def _setup_environ(debug=False): + if 'PYTHONWARNINGS' not in os.environ and not sys.warnoptions: + + # action:message:category:module:line + os.environ['PYTHONWARNINGS'] = ','.join([ + # Enable default warnings such as ResourceWarning. + 'default', + # On Python 3[.6], the system site.py module has + # "open(fullname, 'rU')" which produces the warning that + # 'U' is deprecated, so ignore warnings from site.py + 'ignore:::site:', + # pkgutil on Python 2 complains about missing __init__.py + 'ignore:::pkgutil', + # importlib/_bootstrap.py likes to spit out "ImportWarning: + # can't resolve package from __spec__ or __package__, falling + # back on __name__ and __path__". I have no idea what that means, but it seems harmless + # and is annoying. + 'ignore:::importlib._bootstrap:', + 'ignore:::importlib._bootstrap_external:', + # importing ABCs from collections, not collections.abc + 'ignore:::pkg_resources._vendor.pyparsing:', + ]) + + if 'PYTHONFAULTHANDLER' not in os.environ: + os.environ['PYTHONFAULTHANDLER'] = 'true' + + if 'GEVENT_DEBUG' not in os.environ and debug: + os.environ['GEVENT_DEBUG'] = 'debug' + + if 'PYTHONTRACEMALLOC' not in os.environ: + os.environ['PYTHONTRACEMALLOC'] = '10' + + if 'PYTHONDEVMODE' not in os.environ: + # Python 3.7 + os.environ['PYTHONDEVMODE'] = '1' + + if 'PYTHONMALLOC' not in os.environ: + # Python 3.6 + os.environ['PYTHONMALLOC'] = 'debug' + + + +def main(): + # pylint:disable=too-many-locals,too-many-statements + import argparse + parser = argparse.ArgumentParser() + parser.add_argument('--ignore') + parser.add_argument('--discover', action='store_true') + parser.add_argument('--full', action='store_true') + parser.add_argument('--config', default='known_failures.py') + parser.add_argument('--failfast', action='store_true') + parser.add_argument("--coverage", action="store_true") + parser.add_argument("--quiet", action="store_true", default=True) + parser.add_argument("--verbose", action="store_false", dest='quiet') + parser.add_argument("--debug", action="store_true", default=False) + parser.add_argument("--package", default="gevent.tests") + parser.add_argument('tests', nargs='*') + options = parser.parse_args() + FAILING_TESTS = [] + IGNORED_TESTS = [] + RUN_ALONE = [] + TEST_FILE_OPTIONS = {} + + coverage = False + if options.coverage or os.environ.get("GEVENTTEST_COVERAGE"): + coverage = True + os.environ['COVERAGE_PROCESS_START'] = os.path.abspath(".coveragerc") + if PYPY: + os.environ['COVERAGE_PROCESS_START'] = os.path.abspath(".coveragerc-pypy") + this_dir = os.path.dirname(__file__) + site_dir = os.path.join(this_dir, 'coveragesite') + site_dir = os.path.abspath(site_dir) + os.environ['PYTHONPATH'] = site_dir + os.pathsep + os.environ.get("PYTHONPATH", "") + # We change directory often, use an absolute path to keep all the + # coverage files (which will have distinct suffixes because of parallel=true in .coveragerc + # in this directory; makes them easier to combine and use with coverage report) + os.environ['COVERAGE_FILE'] = os.path.abspath(".") + os.sep + ".coverage" + print("Enabling coverage to", os.environ['COVERAGE_FILE'], "with site", site_dir) + + _setup_environ(debug=options.debug) + + if options.config: + config = {} + options.config = _package_relative_filename(options.config, options.package) + with open(options.config) as f: + config_data = f.read() + six.exec_(config_data, config) + FAILING_TESTS = config['FAILING_TESTS'] + IGNORED_TESTS = config['IGNORED_TESTS'] + RUN_ALONE = config['RUN_ALONE'] + TEST_FILE_OPTIONS = config['TEST_FILE_OPTIONS'] + IGNORE_COVERAGE = config['IGNORE_COVERAGE'] + + + tests = discover( + options.tests, + ignore_files=options.ignore, + ignored=IGNORED_TESTS, + coverage=coverage, + package=options.package, + configured_ignore_coverage=IGNORE_COVERAGE, + configured_test_options=TEST_FILE_OPTIONS, + ) + if options.discover: + for cmd, options in tests: + print(util.getname(cmd, env=options.get('env'), setenv=options.get('setenv'))) + print('%s tests found.' % len(tests)) + else: + if PYPY and RESOLVER_ARES: + # XXX: Add a way to force these. + print("Not running tests on pypy with c-ares; not a supported configuration") + return + if options.package: + # Put this directory on the path so relative imports work. + package_dir = _dir_from_package_name(options.package) + os.environ['PYTHONPATH'] = os.environ.get('PYTHONPATH', "") + os.pathsep + package_dir + run_many( + tests, + configured_failing_tests=FAILING_TESTS, + failfast=options.failfast, + quiet=options.quiet, + configured_run_alone_tests=RUN_ALONE, + ) + + +if __name__ == '__main__': + main() diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/testing/timing.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/testing/timing.py new file mode 100644 index 00000000..bc62edf0 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/testing/timing.py @@ -0,0 +1,139 @@ +# Copyright (c) 2018 gevent community +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. + +import time + +import gevent + +from . import sysinfo +from . import leakcheck +from .testcase import TestCase + +SMALLEST_RELIABLE_DELAY = 0.001 # 1ms, because of libuv + +SMALL_TICK = 0.01 +SMALL_TICK_MIN_ADJ = SMALLEST_RELIABLE_DELAY +SMALL_TICK_MAX_ADJ = 0.11 +if sysinfo.RUNNING_ON_APPVEYOR: + # Timing resolution is extremely poor on Appveyor + # and subject to jitter. + SMALL_TICK_MAX_ADJ = 1.5 + + +LARGE_TICK = 0.2 +LARGE_TICK_MIN_ADJ = LARGE_TICK / 2.0 +LARGE_TICK_MAX_ADJ = SMALL_TICK_MAX_ADJ + + +class _DelayWaitMixin(object): + + _default_wait_timeout = SMALL_TICK + _default_delay_min_adj = SMALL_TICK_MIN_ADJ + _default_delay_max_adj = SMALL_TICK_MAX_ADJ + + def wait(self, timeout): + raise NotImplementedError('override me in subclass') + + def _check_delay_bounds(self, timeout, delay, + delay_min_adj=None, + delay_max_adj=None): + delay_min_adj = self._default_delay_min_adj if not delay_min_adj else delay_min_adj + delay_max_adj = self._default_delay_max_adj if not delay_max_adj else delay_max_adj + self.assertTimeWithinRange(delay, + timeout - delay_min_adj, + timeout + delay_max_adj) + + def _wait_and_check(self, timeout=None): + if timeout is None: + timeout = self._default_wait_timeout + + # gevent.timer instances have a 'seconds' attribute, + # otherwise it's the raw number + seconds = getattr(timeout, 'seconds', timeout) + + gevent.get_hub().loop.update_now() + start = time.time() + try: + result = self.wait(timeout) + finally: + self._check_delay_bounds(seconds, time.time() - start, + self._default_delay_min_adj, + self._default_delay_max_adj) + return result + + def test_outer_timeout_is_not_lost(self): + timeout = gevent.Timeout.start_new(SMALLEST_RELIABLE_DELAY, ref=False) + try: + with self.assertRaises(gevent.Timeout) as exc: + self.wait(timeout=1) + self.assertIs(exc.exception, timeout) + finally: + timeout.close() + + +class AbstractGenericWaitTestCase(_DelayWaitMixin, TestCase): + # pylint:disable=abstract-method + + _default_wait_timeout = LARGE_TICK + _default_delay_min_adj = LARGE_TICK_MIN_ADJ + _default_delay_max_adj = LARGE_TICK_MAX_ADJ + + @leakcheck.ignores_leakcheck # waiting checks can be very sensitive to timing + def test_returns_none_after_timeout(self): + result = self._wait_and_check() + # join and wait simply return after timeout expires + self.assertIsNone(result) + + +class AbstractGenericGetTestCase(_DelayWaitMixin, TestCase): + # pylint:disable=abstract-method + + Timeout = gevent.Timeout + + def cleanup(self): + pass + + def test_raises_timeout_number(self): + with self.assertRaises(self.Timeout): + self._wait_and_check(timeout=SMALL_TICK) + # get raises Timeout after timeout expired + self.cleanup() + + def test_raises_timeout_Timeout(self): + timeout = gevent.Timeout(self._default_wait_timeout) + try: + self._wait_and_check(timeout=timeout) + except gevent.Timeout as ex: + self.assertIs(ex, timeout) + finally: + timeout.close() + self.cleanup() + + def test_raises_timeout_Timeout_exc_customized(self): + error = RuntimeError('expected error') + timeout = gevent.Timeout(self._default_wait_timeout, exception=error) + try: + with self.assertRaises(RuntimeError) as exc: + self._wait_and_check(timeout=timeout) + + self.assertIs(exc.exception, error) + self.cleanup() + finally: + timeout.close() diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/testing/util.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/testing/util.py new file mode 100644 index 00000000..afcd83ba --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/testing/util.py @@ -0,0 +1,453 @@ +from __future__ import print_function, absolute_import, division +import re +import sys +import os +from . import six +import traceback +import unittest +import threading +import subprocess +import time + +# pylint: disable=broad-except,attribute-defined-outside-init + +runtimelog = [] +MIN_RUNTIME = 1.0 +BUFFER_OUTPUT = False +QUIET = False + + +class Popen(subprocess.Popen): + + def __enter__(self): + return self + + def __exit__(self, *args): + kill(self) + + +# Coloring code based on zope.testrunner + +# These colors are carefully chosen to have enough contrast +# on terminals with both black and white background. +_colorscheme = { + 'normal': 'normal', + 'default': 'default', + 'info': 'normal', + 'suboptimal-behaviour': 'magenta', + 'error': 'brightred', + 'number': 'green', + 'slow-test': 'brightmagenta', + 'ok-number': 'green', + 'error-number': 'brightred', + 'filename': 'lightblue', + 'lineno': 'lightred', + 'testname': 'lightcyan', + 'failed-example': 'cyan', + 'expected-output': 'green', + 'actual-output': 'red', + 'character-diffs': 'magenta', + 'diff-chunk': 'magenta', + 'exception': 'red', + 'skipped': 'brightyellow', +} + +_prefixes = [ + ('dark', '0;'), + ('light', '1;'), + ('bright', '1;'), + ('bold', '1;'), +] + +_colorcodes = { + 'default': 0, + 'normal': 0, + 'black': 30, + 'red': 31, + 'green': 32, + 'brown': 33, 'yellow': 33, + 'blue': 34, + 'magenta': 35, + 'cyan': 36, + 'grey': 37, 'gray': 37, 'white': 37 +} + +def _color_code(color): + prefix_code = '' + for prefix, code in _prefixes: + if color.startswith(prefix): + color = color[len(prefix):] + prefix_code = code + break + color_code = _colorcodes[color] + return '\033[%s%sm' % (prefix_code, color_code) + +def _color(what): + return _color_code(_colorscheme[what]) + +def _colorize(what, message, normal='normal'): + return _color(what) + message + _color(normal) + +def log(message, *args, **kwargs): + color = kwargs.pop('color', 'normal') + try: + if args: + string = message % args + else: + string = message + except Exception: + traceback.print_exc() + try: + string = '%r %% %r\n\n' % (message, args) + except Exception: + pass + try: + string = _colorize('exception', string) + sys.stderr.write(string) + except Exception: + traceback.print_exc() + else: + string = _colorize(color, string) + sys.stderr.write(string + '\n') + + +def killpg(pid): + if not hasattr(os, 'killpg'): + return + try: + return os.killpg(pid, 9) + except OSError as ex: + if ex.errno != 3: + log('killpg(%r, 9) failed: %s: %s', pid, type(ex).__name__, ex) + except Exception as ex: + log('killpg(%r, 9) failed: %s: %s', pid, type(ex).__name__, ex) + + +def kill_processtree(pid): + ignore_msg = 'ERROR: The process "%s" not found.' % pid + err = subprocess.Popen('taskkill /F /PID %s /T' % pid, stderr=subprocess.PIPE).communicate()[1] + if err and err.strip() not in [ignore_msg, '']: + log('%r', err) + + +def _kill(popen): + if hasattr(popen, 'kill'): + try: + popen.kill() + except OSError as ex: + if ex.errno == 3: # No such process + return + if ex.errno == 13: # Permission denied (translated from windows error 5: "Access is denied") + return + raise + else: + try: + os.kill(popen.pid, 9) + except EnvironmentError: + pass + + +def kill(popen): + if popen.timer is not None: + popen.timer.cancel() + if popen.poll() is not None: + return + popen.was_killed = True + try: + if getattr(popen, 'setpgrp_enabled', None): + killpg(popen.pid) + elif sys.platform.startswith('win'): + kill_processtree(popen.pid) + except Exception: + traceback.print_exc() + try: + _kill(popen) + except Exception: + traceback.print_exc() + try: + popen.wait() + except Exception: + traceback.print_exc() + + +def getname(command, env=None, setenv=None): + result = [] + + env = (env or os.environ).copy() + env.update(setenv or {}) + + for key, value in sorted(env.items()): + if key.startswith('GEVENT'): + result.append('%s=%s' % (key, value)) + + if isinstance(command, six.string_types): + result.append(command) + else: + result.extend(command) + + return ' '.join(result) + + +def start(command, quiet=False, **kwargs): + timeout = kwargs.pop('timeout', None) + preexec_fn = None + if not os.environ.get('DO_NOT_SETPGRP'): + preexec_fn = getattr(os, 'setpgrp', None) + env = kwargs.pop('env', None) + setenv = kwargs.pop('setenv', None) or {} + name = getname(command, env=env, setenv=setenv) + if preexec_fn is not None: + setenv['DO_NOT_SETPGRP'] = '1' + if setenv: + if env: + env = env.copy() + else: + env = os.environ.copy() + env.update(setenv) + + if not quiet: + log('+ %s', name) + popen = Popen(command, preexec_fn=preexec_fn, env=env, **kwargs) + popen.name = name + popen.setpgrp_enabled = preexec_fn is not None + popen.was_killed = False + popen.timer = None + if timeout is not None: + t = threading.Timer(timeout, kill, args=(popen, )) + t.setDaemon(True) + t.start() + popen.timer = t + return popen + + +class RunResult(object): + + def __init__(self, code, + output=None, name=None, + run_count=0, skipped_count=0): + self.code = code + self.output = output + self.name = name + self.run_count = run_count + self.skipped_count = skipped_count + + + def __bool__(self): + return bool(self.code) + + __nonzero__ = __bool__ + + def __int__(self): + return self.code + + +def _should_show_warning_output(out): + if 'Warning' in out: + # Strip out some patterns we specifically do not + # care about. + # from test.support for monkey-patched tests + out = out.replace('Warning -- reap_children', 'NADA') + out = out.replace("Warning -- threading_cleanup", 'NADA') + + # The below *could* be done with sophisticated enough warning + # filters passed to the children + + # collections.abc is the new home; setuptools uses the old one, + # as does dnspython + out = out.replace("DeprecationWarning: Using or importing the ABCs", 'NADA') + # libuv poor timer resolution + out = out.replace('UserWarning: libuv only supports', 'NADA') + # Packages on Python 2 + out = out.replace('ImportWarning: Not importing directory', 'NADA') + return 'Warning' in out + +output_lock = threading.Lock() + +def _find_test_status(took, out): + status = '[took %.1fs%s]' + skipped = '' + run_count = 0 + skipped_count = 0 + if out: + m = re.search(r"Ran (\d+) tests in", out) + if m: + result = out[m.start():m.end()] + status = status.replace('took', result) + run_count = int(out[m.start(1):m.end(1)]) + + m = re.search(r' \(skipped=(\d+)\)$', out) + if m: + skipped = _colorize('skipped', out[m.start():m.end()]) + skipped_count = int(out[m.start(1):m.end(1)]) + status = status % (took, skipped) + if took > 10: + status = _colorize('slow-test', status) + return status, run_count, skipped_count + + +def run(command, **kwargs): # pylint:disable=too-many-locals + buffer_output = kwargs.pop('buffer_output', BUFFER_OUTPUT) + quiet = kwargs.pop('quiet', QUIET) + verbose = not quiet + nested = kwargs.pop('nested', False) + if buffer_output: + assert 'stdout' not in kwargs and 'stderr' not in kwargs, kwargs + kwargs['stderr'] = subprocess.STDOUT + kwargs['stdout'] = subprocess.PIPE + popen = start(command, quiet=nested, **kwargs) + name = popen.name + try: + time_start = time.time() + out, err = popen.communicate() + took = time.time() - time_start + if popen.was_killed or popen.poll() is None: + result = 'TIMEOUT' + else: + result = popen.poll() + finally: + kill(popen) + assert not err + with output_lock: # pylint:disable=not-context-manager + failed = bool(result) + if out: + out = out.strip() + out = out if isinstance(out, str) else out.decode('utf-8', 'ignore') + if out and (failed or verbose or _should_show_warning_output(out)): + if out: + out = ' ' + out.replace('\n', '\n ') + out = out.rstrip() + out += '\n' + log('| %s\n%s', name, out) + status, run_count, skipped_count = _find_test_status(took, out) + if result: + log('! %s [code %s] %s', name, result, status, color='error') + elif not nested: + log('- %s %s', name, status) + if took >= MIN_RUNTIME: + runtimelog.append((-took, name)) + return RunResult(result, out, name, run_count, skipped_count) + + +class NoSetupPyFound(Exception): + "Raised by find_setup_py_above" + +def find_setup_py_above(a_file): + "Return the directory containing setup.py somewhere above *a_file*" + root = os.path.dirname(os.path.abspath(a_file)) + while not os.path.exists(os.path.join(root, 'setup.py')): + prev, root = root, os.path.dirname(root) + if root == prev: + # Let's avoid infinite loops at root + raise NoSetupPyFound('could not find my setup.py above %r' % (a_file,)) + return root + +def search_for_setup_py(a_file=None, a_module_name=None, a_class=None, climb_cwd=True): + if a_file is not None: + try: + return find_setup_py_above(a_file) + except NoSetupPyFound: + pass + + if a_class is not None: + try: + return find_setup_py_above(sys.modules[a_class.__module__].__file__) + except NoSetupPyFound: + pass + + if a_module_name is not None: + try: + return find_setup_py_above(sys.modules[a_module_name].__file__) + except NoSetupPyFound: + pass + + if climb_cwd: + return find_setup_py_above("./dne") + + raise NoSetupPyFound("After checking %r" % (locals(),)) + + +class ExampleMixin(object): + "Something that uses the examples/ directory" + + def find_setup_py(self): + "Return the directory containing setup.py" + return search_for_setup_py( + a_file=__file__, + a_class=type(self) + ) + + @property + def cwd(self): + try: + root = self.find_setup_py() + except NoSetupPyFound as e: + raise unittest.SkipTest("Unable to locate file/dir to run: %s" % (e,)) + + return os.path.join(root, 'examples') + +class TestServer(ExampleMixin, + unittest.TestCase): + args = [] + before_delay = 3 + after_delay = 0.5 + popen = None + server = None # subclasses define this to be the path to the server.py + start_kwargs = None + + def start(self): + try: + kwargs = self.start_kwargs or {} + return start([sys.executable, '-u', self.server] + self.args, cwd=self.cwd, **kwargs) + except NoSetupPyFound as e: + raise unittest.SkipTest("Unable to locate file/dir to run: %s" % (e,)) + + def running_server(self): + from contextlib import contextmanager + + @contextmanager + def running_server(): + with self.start() as popen: + self.popen = popen + self.before() + yield + self.after() + return running_server() + + def test(self): + with self.running_server(): + self._run_all_tests() + + def before(self): + if self.before_delay is not None: + time.sleep(self.before_delay) + assert self.popen.poll() is None, '%s died with code %s' % (self.server, self.popen.poll(), ) + + def after(self): + if self.after_delay is not None: + time.sleep(self.after_delay) + assert self.popen.poll() is None, '%s died with code %s' % (self.server, self.popen.poll(), ) + + def _run_all_tests(self): + ran = False + for method in sorted(dir(self)): + if method.startswith('_test'): + function = getattr(self, method) + if callable(function): + function() + ran = True + assert ran + + +class alarm(threading.Thread): + # can't use signal.alarm because of Windows + + def __init__(self, timeout): + threading.Thread.__init__(self) + self.setDaemon(True) + self.timeout = timeout + self.start() + + def run(self): + time.sleep(self.timeout) + sys.stderr.write('Timeout.\n') + os._exit(5) diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/2_7_keycert.pem b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/2_7_keycert.pem new file mode 100644 index 00000000..64318aa2 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/2_7_keycert.pem @@ -0,0 +1,31 @@ +-----BEGIN PRIVATE KEY----- +MIICdwIBADANBgkqhkiG9w0BAQEFAASCAmEwggJdAgEAAoGBANtb0+YrKuxevGpm +LrjaUhZSgz6zFAmuGFmKmUbdjmfv9zSmmdsQIksK++jK0Be9LeZy20j6ahOfuVa0 +ufEmPoP7Fy4hXegKZR9cCWcIe/A6H2xWF1IIJLRTLaU8ol/I7T+um5HD5AwAwNPP +USNU0Eegmvp+xxWu3NX2m1Veot85AgMBAAECgYA3ZdZ673X0oexFlq7AAmrutkHt +CL7LvwrpOiaBjhyTxTeSNWzvtQBkIU8DOI0bIazA4UreAFffwtvEuPmonDb3F+Iq +SMAu42XcGyVZEl+gHlTPU9XRX7nTOXVt+MlRRRxL6t9GkGfUAXI3XxJDXW3c0vBK +UL9xqD8cORXOfE06rQJBAP8mEX1ERkR64Ptsoe4281vjTlNfIbs7NMPkUnrn9N/Y +BLhjNIfQ3HFZG8BTMLfX7kCS9D593DW5tV4Z9BP/c6cCQQDcFzCcVArNh2JSywOQ +ZfTfRbJg/Z5Lt9Fkngv1meeGNPgIMLN8Sg679pAOOWmzdMO3V706rNPzSVMME7E5 +oPIfAkEA8pDddarP5tCvTTgUpmTFbakm0KoTZm2+FzHcnA4jRh+XNTjTOv98Y6Ik +eO5d1ZnKXseWvkZncQgxfdnMqqpj5wJAcNq/RVne1DbYlwWchT2Si65MYmmJ8t+F +0mcsULqjOnEMwf5e+ptq5LzwbyrHZYq5FNk7ocufPv/ZQrcSSC+cFwJBAKvOJByS +x56qyGeZLOQlWS2JS3KJo59XuLFGqcbgN9Om9xFa41Yb4N9NvplFivsvZdw3m1Q/ +SPIXQuT8RMPDVNQ= +-----END PRIVATE KEY----- +-----BEGIN CERTIFICATE----- +MIICVDCCAb2gAwIBAgIJANfHOBkZr8JOMA0GCSqGSIb3DQEBBQUAMF8xCzAJBgNV +BAYTAlhZMRcwFQYDVQQHEw5DYXN0bGUgQW50aHJheDEjMCEGA1UEChMaUHl0aG9u +IFNvZnR3YXJlIEZvdW5kYXRpb24xEjAQBgNVBAMTCWxvY2FsaG9zdDAeFw0xMDEw +MDgyMzAxNTZaFw0yMDEwMDUyMzAxNTZaMF8xCzAJBgNVBAYTAlhZMRcwFQYDVQQH +Ew5DYXN0bGUgQW50aHJheDEjMCEGA1UEChMaUHl0aG9uIFNvZnR3YXJlIEZvdW5k +YXRpb24xEjAQBgNVBAMTCWxvY2FsaG9zdDCBnzANBgkqhkiG9w0BAQEFAAOBjQAw +gYkCgYEA21vT5isq7F68amYuuNpSFlKDPrMUCa4YWYqZRt2OZ+/3NKaZ2xAiSwr7 +6MrQF70t5nLbSPpqE5+5VrS58SY+g/sXLiFd6AplH1wJZwh78DofbFYXUggktFMt +pTyiX8jtP66bkcPkDADA089RI1TQR6Ca+n7HFa7c1fabVV6i3zkCAwEAAaMYMBYw +FAYDVR0RBA0wC4IJbG9jYWxob3N0MA0GCSqGSIb3DQEBBQUAA4GBAHPctQBEQ4wd +BJ6+JcpIraopLn8BGhbjNWj40mmRqWB/NAWF6M5ne7KpGAu7tLeG4hb1zLaldK8G +lxy2GPSRF6LFS48dpEj2HbMv2nvv6xxalDMJ9+DicWgAKTQ6bcX2j3GUkCR0g/T1 +CRlNBAAlvhKzO7Clpf9l0YKBEfraJByX +-----END CERTIFICATE----- diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/__init__.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/__main__.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/__main__.py new file mode 100644 index 00000000..e43891fb --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/__main__.py @@ -0,0 +1,6 @@ +#!/usr/bin/env python +from __future__ import print_function, absolute_import, division + +if __name__ == '__main__': + from gevent.testing import testrunner + testrunner.main() diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/_blocks_at_top_level.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/_blocks_at_top_level.py new file mode 100644 index 00000000..9f907aa6 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/_blocks_at_top_level.py @@ -0,0 +1,3 @@ +from gevent import sleep +sleep(0.01) +x = "done" diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/_import_import_patch.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/_import_import_patch.py new file mode 100644 index 00000000..aa85abd6 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/_import_import_patch.py @@ -0,0 +1 @@ +__import__('_import_patch') diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/_import_patch.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/_import_patch.py new file mode 100644 index 00000000..9d7cc3c3 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/_import_patch.py @@ -0,0 +1,2 @@ +import gevent.monkey +gevent.monkey.patch_all() diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/_import_wait.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/_import_wait.py new file mode 100644 index 00000000..80850a54 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/_import_wait.py @@ -0,0 +1,26 @@ +# test__import_wait.py calls this via an import statement, +# so all of this is happening with import locks held (especially on py2) +import gevent + + +def fn2(): + return 2 + + +# A blocking function doesn't raise LoopExit +def fn(): + return gevent.wait([gevent.spawn(fn2), gevent.spawn(fn2)]) + +gevent.spawn(fn).get() + + +# Marshalling the traceback across greenlets doesn't +# raise LoopExit +def raise_name_error(): + raise NameError("ThisIsExpected") + +try: + gevent.spawn(raise_name_error).get() + raise AssertionError("Should fail") +except NameError as e: + x = e diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/_imports_at_top_level.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/_imports_at_top_level.py new file mode 100644 index 00000000..d11f66b6 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/_imports_at_top_level.py @@ -0,0 +1,2 @@ +# We simply import a stdlib module +__import__('netrc') diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/_imports_imports_at_top_level.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/_imports_imports_at_top_level.py new file mode 100644 index 00000000..00bbf513 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/_imports_imports_at_top_level.py @@ -0,0 +1,13 @@ +import gevent + +# For reproducing #728: We spawn a greenlet at import time, +# that itself wants to import, and wait on it at import time. +# If we're the only greenlet running, and locks aren't granular +# enough, this results in a LoopExit (and also a lock deadlock) + + +def f(): + __import__('_imports_at_top_level') + +g = gevent.spawn(f) +g.get() diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/badcert.pem b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/badcert.pem new file mode 100644 index 00000000..c4191460 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/badcert.pem @@ -0,0 +1,36 @@ +-----BEGIN RSA PRIVATE KEY----- +MIICXwIBAAKBgQC8ddrhm+LutBvjYcQlnH21PPIseJ1JVG2HMmN2CmZk2YukO+9L +opdJhTvbGfEj0DQs1IE8M+kTUyOmuKfVrFMKwtVeCJphrAnhoz7TYOuLBSqt7lVH +fhi/VwovESJlaBOp+WMnfhcduPEYHYx/6cnVapIkZnLt30zu2um+DzA9jQIDAQAB +AoGBAK0FZpaKj6WnJZN0RqhhK+ggtBWwBnc0U/ozgKz2j1s3fsShYeiGtW6CK5nU +D1dZ5wzhbGThI7LiOXDvRucc9n7vUgi0alqPQ/PFodPxAN/eEYkmXQ7W2k7zwsDA +IUK0KUhktQbLu8qF/m8qM86ba9y9/9YkXuQbZ3COl5ahTZrhAkEA301P08RKv3KM +oXnGU2UHTuJ1MAD2hOrPxjD4/wxA/39EWG9bZczbJyggB4RHu0I3NOSFjAm3HQm0 +ANOu5QK9owJBANgOeLfNNcF4pp+UikRFqxk5hULqRAWzVxVrWe85FlPm0VVmHbb/ +loif7mqjU8o1jTd/LM7RD9f2usZyE2psaw8CQQCNLhkpX3KO5kKJmS9N7JMZSc4j +oog58yeYO8BBqKKzpug0LXuQultYv2K4veaIO04iL9VLe5z9S/Q1jaCHBBuXAkEA +z8gjGoi1AOp6PBBLZNsncCvcV/0aC+1se4HxTNo2+duKSDnbq+ljqOM+E7odU+Nq +ewvIWOG//e8fssd0mq3HywJBAJ8l/c8GVmrpFTx8r/nZ2Pyyjt3dH1widooDXYSV +q6Gbf41Llo5sYAtmxdndTLASuHKecacTgZVhy0FryZpLKrU= +-----END RSA PRIVATE KEY----- +-----BEGIN CERTIFICATE----- +Just bad cert data +-----END CERTIFICATE----- +-----BEGIN RSA PRIVATE KEY----- +MIICXwIBAAKBgQC8ddrhm+LutBvjYcQlnH21PPIseJ1JVG2HMmN2CmZk2YukO+9L +opdJhTvbGfEj0DQs1IE8M+kTUyOmuKfVrFMKwtVeCJphrAnhoz7TYOuLBSqt7lVH +fhi/VwovESJlaBOp+WMnfhcduPEYHYx/6cnVapIkZnLt30zu2um+DzA9jQIDAQAB +AoGBAK0FZpaKj6WnJZN0RqhhK+ggtBWwBnc0U/ozgKz2j1s3fsShYeiGtW6CK5nU +D1dZ5wzhbGThI7LiOXDvRucc9n7vUgi0alqPQ/PFodPxAN/eEYkmXQ7W2k7zwsDA +IUK0KUhktQbLu8qF/m8qM86ba9y9/9YkXuQbZ3COl5ahTZrhAkEA301P08RKv3KM +oXnGU2UHTuJ1MAD2hOrPxjD4/wxA/39EWG9bZczbJyggB4RHu0I3NOSFjAm3HQm0 +ANOu5QK9owJBANgOeLfNNcF4pp+UikRFqxk5hULqRAWzVxVrWe85FlPm0VVmHbb/ +loif7mqjU8o1jTd/LM7RD9f2usZyE2psaw8CQQCNLhkpX3KO5kKJmS9N7JMZSc4j +oog58yeYO8BBqKKzpug0LXuQultYv2K4veaIO04iL9VLe5z9S/Q1jaCHBBuXAkEA +z8gjGoi1AOp6PBBLZNsncCvcV/0aC+1se4HxTNo2+duKSDnbq+ljqOM+E7odU+Nq +ewvIWOG//e8fssd0mq3HywJBAJ8l/c8GVmrpFTx8r/nZ2Pyyjt3dH1widooDXYSV +q6Gbf41Llo5sYAtmxdndTLASuHKecacTgZVhy0FryZpLKrU= +-----END RSA PRIVATE KEY----- +-----BEGIN CERTIFICATE----- +Just bad cert data +-----END CERTIFICATE----- diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/badkey.pem b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/badkey.pem new file mode 100644 index 00000000..1c8a9557 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/badkey.pem @@ -0,0 +1,40 @@ +-----BEGIN RSA PRIVATE KEY----- +Bad Key, though the cert should be OK +-----END RSA PRIVATE KEY----- +-----BEGIN CERTIFICATE----- +MIICpzCCAhCgAwIBAgIJAP+qStv1cIGNMA0GCSqGSIb3DQEBBQUAMIGJMQswCQYD +VQQGEwJVUzERMA8GA1UECBMIRGVsYXdhcmUxEzARBgNVBAcTCldpbG1pbmd0b24x +IzAhBgNVBAoTGlB5dGhvbiBTb2Z0d2FyZSBGb3VuZGF0aW9uMQwwCgYDVQQLEwNT +U0wxHzAdBgNVBAMTFnNvbWVtYWNoaW5lLnB5dGhvbi5vcmcwHhcNMDcwODI3MTY1 +NDUwWhcNMTMwMjE2MTY1NDUwWjCBiTELMAkGA1UEBhMCVVMxETAPBgNVBAgTCERl +bGF3YXJlMRMwEQYDVQQHEwpXaWxtaW5ndG9uMSMwIQYDVQQKExpQeXRob24gU29m +dHdhcmUgRm91bmRhdGlvbjEMMAoGA1UECxMDU1NMMR8wHQYDVQQDExZzb21lbWFj +aGluZS5weXRob24ub3JnMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC8ddrh +m+LutBvjYcQlnH21PPIseJ1JVG2HMmN2CmZk2YukO+9LopdJhTvbGfEj0DQs1IE8 +M+kTUyOmuKfVrFMKwtVeCJphrAnhoz7TYOuLBSqt7lVHfhi/VwovESJlaBOp+WMn +fhcduPEYHYx/6cnVapIkZnLt30zu2um+DzA9jQIDAQABoxUwEzARBglghkgBhvhC +AQEEBAMCBkAwDQYJKoZIhvcNAQEFBQADgYEAF4Q5BVqmCOLv1n8je/Jw9K669VXb +08hyGzQhkemEBYQd6fzQ9A/1ZzHkJKb1P6yreOLSEh4KcxYPyrLRC1ll8nr5OlCx +CMhKkTnR6qBsdNV0XtdU2+N25hqW+Ma4ZeqsN/iiJVCGNOZGnvQuvCAGWF8+J/f/ +iHkC6gGdBJhogs4= +-----END CERTIFICATE----- +-----BEGIN RSA PRIVATE KEY----- +Bad Key, though the cert should be OK +-----END RSA PRIVATE KEY----- +-----BEGIN CERTIFICATE----- +MIICpzCCAhCgAwIBAgIJAP+qStv1cIGNMA0GCSqGSIb3DQEBBQUAMIGJMQswCQYD +VQQGEwJVUzERMA8GA1UECBMIRGVsYXdhcmUxEzARBgNVBAcTCldpbG1pbmd0b24x +IzAhBgNVBAoTGlB5dGhvbiBTb2Z0d2FyZSBGb3VuZGF0aW9uMQwwCgYDVQQLEwNT +U0wxHzAdBgNVBAMTFnNvbWVtYWNoaW5lLnB5dGhvbi5vcmcwHhcNMDcwODI3MTY1 +NDUwWhcNMTMwMjE2MTY1NDUwWjCBiTELMAkGA1UEBhMCVVMxETAPBgNVBAgTCERl +bGF3YXJlMRMwEQYDVQQHEwpXaWxtaW5ndG9uMSMwIQYDVQQKExpQeXRob24gU29m +dHdhcmUgRm91bmRhdGlvbjEMMAoGA1UECxMDU1NMMR8wHQYDVQQDExZzb21lbWFj +aGluZS5weXRob24ub3JnMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC8ddrh +m+LutBvjYcQlnH21PPIseJ1JVG2HMmN2CmZk2YukO+9LopdJhTvbGfEj0DQs1IE8 +M+kTUyOmuKfVrFMKwtVeCJphrAnhoz7TYOuLBSqt7lVHfhi/VwovESJlaBOp+WMn +fhcduPEYHYx/6cnVapIkZnLt30zu2um+DzA9jQIDAQABoxUwEzARBglghkgBhvhC +AQEEBAMCBkAwDQYJKoZIhvcNAQEFBQADgYEAF4Q5BVqmCOLv1n8je/Jw9K669VXb +08hyGzQhkemEBYQd6fzQ9A/1ZzHkJKb1P6yreOLSEh4KcxYPyrLRC1ll8nr5OlCx +CMhKkTnR6qBsdNV0XtdU2+N25hqW+Ma4ZeqsN/iiJVCGNOZGnvQuvCAGWF8+J/f/ +iHkC6gGdBJhogs4= +-----END CERTIFICATE----- diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/getaddrinfo_module.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/getaddrinfo_module.py new file mode 100644 index 00000000..75a25dff --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/getaddrinfo_module.py @@ -0,0 +1,4 @@ +import socket +import gevent.socket as gevent_socket + +gevent_socket.getaddrinfo(u'gevent.org', None, socket.AF_INET) diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/hosts_file.txt b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/hosts_file.txt new file mode 100644 index 00000000..a33da688 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/hosts_file.txt @@ -0,0 +1,10351 @@ +## +# Host Database +# +# localhost is used to configure the loopback interface +# when the system is booting. Do not change this entry. +## +127.0.0.1 localhost Localhost localhost.localdomain testsite.mc.com mathcounts.mc.com platform.osu.edu + +255.255.255.255 broadcasthost +::1 localhost +fe80::1%lo0 localhost +172.178.0.51 excelsior excelsior.example.com +162.168.8.27 memoryprime.local memoryprime +122.168.9.64 isy.local isy + + +192.168.1.172 drivefoo.local + +172.168.15.95 aragefoo.local +172.168.15.105 livgfoo.local +172.168.16.109 upsirsfoo.local +172.168.15.140 bacorthfoo.local +172.168.15.142 bacouthfoo.local +172.168.16.144 drisfoo.local +172.168.15.152 nghborfoo.local +172.168.15.154 fntfoo.local +172.168.18.151 as.local + +# Internals +146.120.241.22 ds3 +146.120.241.23 ds4 +146.120.241.21 ds2 +146.120.241.20 ds1 + + +# Not blocked by Mar 18 2013 +0.0.0.0 h.ppjol.com +0.0.0.0 s.ppjol.net +0.0.0.0 yayfollowers.com +0.0.0.0 pagead2.googlesyndication.com +0.0.0.0 www.googletagservices.com +0.0.0.0 cdn.teads.tv +0.0.0.0 js.moatads.com +0.0.0.0 cdn2.teads.tv + + +# This hosts file is brought to you by Dan Pollock and can be found at +# http://someonewhocares.org/hosts/zero/ + +# +# For example, to block unpleasant pages, try: +0.0.0.0 goatse.cx # More information on sites such as +0.0.0.0 www.goatse.cx # these can be found in this article +0.0.0.0 oralse.cx # en.wikipedia.org/wiki/List_of_shock_sites +0.0.0.0 www.oralse.cx +0.0.0.0 goatse.ca +0.0.0.0 www.goatse.ca +0.0.0.0 oralse.ca +0.0.0.0 www.oralse.ca +0.0.0.0 goat.cx +0.0.0.0 www.goat.cx +0.0.0.0 goatse.ru +0.0.0.0 www.goatse.ru + +0.0.0.0 1girl1pitcher.com +0.0.0.0 1girl1pitcher.org +0.0.0.0 1guy1cock.com +0.0.0.0 1man1jar.org +0.0.0.0 1man2needles.com +0.0.0.0 1priest1nun.com +0.0.0.0 2girls1cup.com +0.0.0.0 2girls1cup-free.com +0.0.0.0 2girls1cup.nl +0.0.0.0 2girls1cup.ws +0.0.0.0 2girls1finger.com +0.0.0.0 2girls1finger.org +0.0.0.0 2guys1stump.org +0.0.0.0 3guys1hammer.ws +0.0.0.0 4girlsfingerpaint.com +0.0.0.0 4girlsfingerpaint.org +0.0.0.0 bagslap.com +0.0.0.0 ballsack.org +0.0.0.0 bluewaffle.biz +0.0.0.0 bottleguy.com +0.0.0.0 bowlgirl.com +0.0.0.0 cadaver.org +0.0.0.0 clownsong.com +0.0.0.0 copyright-reform.info +0.0.0.0 cshacks.partycat.us +0.0.0.0 cyberscat.com +0.0.0.0 dadparty.com +0.0.0.0 detroithardcore.com +0.0.0.0 donotwatch.org +0.0.0.0 dontwatch.us +0.0.0.0 eelsoup.net +0.0.0.0 fruitlauncher.com +0.0.0.0 fuck.org +0.0.0.0 funnelchair.com +0.0.0.0 goatse.bz +0.0.0.0 goatsegirl.org +0.0.0.0 goatse.ru +0.0.0.0 hai2u.com +0.0.0.0 homewares.org +0.0.0.0 howtotroll.org +0.0.0.0 japscat.org +0.0.0.0 jiztini.com +0.0.0.0 junecleeland.com +0.0.0.0 kids-in-sandbox.com +0.0.0.0 kidsinsandbox.info +0.0.0.0 lemonparty.biz +0.0.0.0 lemonparty.org +0.0.0.0 lolhello.com +0.0.0.0 loltrain.com +0.0.0.0 meatspin.biz +0.0.0.0 meatspin.com +0.0.0.0 merryholidays.org +0.0.0.0 milkfountain.com +0.0.0.0 mudfall.com +0.0.0.0 mudmonster.org +0.0.0.0 nimp.org +0.0.0.0 nobrain.dk +0.0.0.0 nutabuse.com +0.0.0.0 octopusgirl.com +0.0.0.0 on.nimp.org +0.0.0.0 painolympics.info +0.0.0.0 phonejapan.com +0.0.0.0 pressurespot.com +0.0.0.0 prolapseman.com +0.0.0.0 scrollbelow.com +0.0.0.0 selfpwn.org +0.0.0.0 sexitnow.com +0.0.0.0 sourmath.com +0.0.0.0 suckdude.com +0.0.0.0 thatsjustgay.com +0.0.0.0 thatsphucked.com +0.0.0.0 thehomo.org +0.0.0.0 themacuser.org +0.0.0.0 thepounder.com +0.0.0.0 tubgirl.me +0.0.0.0 tubgirl.org +0.0.0.0 turdgasm.com +0.0.0.0 vomitgirl.org +0.0.0.0 walkthedinosaur.com +0.0.0.0 whipcrack.org +0.0.0.0 wormgush.com +0.0.0.0 www.1girl1pitcher.org +0.0.0.0 www.1guy1cock.com +0.0.0.0 www.1man1jar.org +0.0.0.0 www.1man2needles.com +0.0.0.0 www.1priest1nun.com +0.0.0.0 www.2girls1cup-free.com +0.0.0.0 www.2girls1cup.nl +0.0.0.0 www.2girls1cup.ws +0.0.0.0 www.2girls1finger.org +0.0.0.0 www.2guys1stump.org +0.0.0.0 www.3guys1hammer.ws +0.0.0.0 www.4girlsfingerpaint.org +0.0.0.0 www.bagslap.com +0.0.0.0 www.ballsack.org +0.0.0.0 www.bluewaffle.biz +0.0.0.0 www.bottleguy.com +0.0.0.0 www.bowlgirl.com +0.0.0.0 www.cadaver.org +0.0.0.0 www.clownsong.com +0.0.0.0 www.copyright-reform.info +0.0.0.0 www.cshacks.partycat.us +0.0.0.0 www.cyberscat.com +0.0.0.0 www.dadparty.com +0.0.0.0 www.detroithardcore.com +0.0.0.0 www.donotwatch.org +0.0.0.0 www.dontwatch.us +0.0.0.0 www.eelsoup.net +0.0.0.0 www.fruitlauncher.com +0.0.0.0 www.fuck.org +0.0.0.0 www.funnelchair.com +0.0.0.0 www.goatse.bz +0.0.0.0 www.goatsegirl.org +0.0.0.0 www.goatse.ru +0.0.0.0 www.hai2u.com +0.0.0.0 www.homewares.org +0.0.0.0 www.howtotroll.org +0.0.0.0 www.japscat.org +0.0.0.0 www.jiztini.com +0.0.0.0 www.junecleeland.com +0.0.0.0 www.kids-in-sandbox.com +0.0.0.0 www.kidsinsandbox.info +0.0.0.0 www.lemonparty.biz +0.0.0.0 www.lemonparty.org +0.0.0.0 www.lolhello.com +0.0.0.0 www.loltrain.com +0.0.0.0 www.meatspin.biz +0.0.0.0 www.meatspin.com +0.0.0.0 www.merryholidays.org +0.0.0.0 www.milkfountain.com +0.0.0.0 www.mudfall.com +0.0.0.0 www.mudmonster.org +0.0.0.0 www.nimp.org +0.0.0.0 www.nobrain.dk +0.0.0.0 www.nutabuse.com +0.0.0.0 www.octopusgirl.com +0.0.0.0 www.on.nimp.org +0.0.0.0 www.painolympics.info +0.0.0.0 www.phonejapan.com +0.0.0.0 www.pressurespot.com +0.0.0.0 www.prolapseman.com +0.0.0.0 www.punishtube.com +0.0.0.0 www.scrollbelow.com +0.0.0.0 www.selfpwn.org +0.0.0.0 www.sourmath.com +0.0.0.0 www.suckdude.com +0.0.0.0 www.thatsjustgay.com +0.0.0.0 www.thatsphucked.com +0.0.0.0 www.theexgirlfriends.com +0.0.0.0 www.thehomo.org +0.0.0.0 www.themacuser.org +0.0.0.0 www.thepounder.com +0.0.0.0 www.tubgirl.me +0.0.0.0 www.tubgirl.org +0.0.0.0 www.turdgasm.com +0.0.0.0 www.vomitgirl.org +0.0.0.0 www.walkthedinosaur.com +0.0.0.0 www.whipcrack.org +0.0.0.0 www.wormgush.com +0.0.0.0 www.xvideoslive.com +0.0.0.0 www.y8.com +0.0.0.0 www.youaresogay.com +0.0.0.0 www.ypmate.com +0.0.0.0 www.zentastic.com +0.0.0.0 youaresogay.com +0.0.0.0 zentastic.com +# + +0.0.0.0 ads234.com +0.0.0.0 ads345.com +0.0.0.0 www.ads234.com +0.0.0.0 www.ads345.com +# + + +# + +# +0.0.0.0 auto.search.msn.com # Microsoft uses this server to redirect + # mistyped URLs to search engines. They + # log all such errors. +0.0.0.0 sitefinder.verisign.com # Verisign has joined the game +0.0.0.0 sitefinder-idn.verisign.com # of trying to hijack mistyped + # URLs to their site. + # May break iOS Game Center. + +0.0.0.0 s0.2mdn.net # This may interfere with some streaming + # video on sites such as cbc.ca +0.0.0.0 ad.doubleclick.net # This may interefere with www.sears.com + # and potentially other sites. +0.0.0.0 media.fastclick.net # Likewise, this may interfere with some +0.0.0.0 cdn.fastclick.net # sites. +0.0.0.0 ebay.doubleclick.net # may interfere with ebay +#0.0.0.0 google-analytics.com # breaks some sites +#0.0.0.0 ssl.google-analytics.com +#0.0.0.0 www.google-analytics.l.google.com +0.0.0.0 stat.livejournal.com # There are reports that this may mess + # up CSS on livejournal +0.0.0.0 stats.surfaid.ihost.com # This has been known cause + # problems with NPR.org +0.0.0.0 www.google-analytics.com # breaks some sites +0.0.0.0 ads.imeem.com # Seems to interfere with the functioning of imeem.com +# + +0.0.0.0 006.free-counter.co.uk +0.0.0.0 006.freecounters.co.uk +0.0.0.0 06272002-dbase.hitcountz.net # Web bugs in spam +0.0.0.0 123counter.mycomputer.com +0.0.0.0 123counter.superstats.com +0.0.0.0 1ca.cqcounter.com +0.0.0.0 1uk.cqcounter.com +0.0.0.0 1us.cqcounter.com +0.0.0.0 1xxx.cqcounter.com +0.0.0.0 2001-007.com +0.0.0.0 3bc3fd26-91cf-46b2-8ec6-b1559ada0079.statcamp.net +0.0.0.0 3ps.go.com +0.0.0.0 4-counter.com +0.0.0.0 a796faee-7163-4757-a34f-e5b48cada4cb.statcamp.net +0.0.0.0 abscbn.spinbox.net +0.0.0.0 activity.serving-sys.com #eyeblaster.com +0.0.0.0 adadvisor.net +0.0.0.0 adclient.rottentomatoes.com +0.0.0.0 adcodes.aim4media.com +0.0.0.0 adcounter.globeandmail.com +0.0.0.0 adcounter.theglobeandmail.com +0.0.0.0 addfreestats.com +0.0.0.0 ademails.com +0.0.0.0 adlog.com.com # Used by Ziff Davis to serve + # ads and track users across + # the com.com family of sites +0.0.0.0 ad-logics.com +0.0.0.0 admanmail.com +0.0.0.0 adopt.specificclick.net +0.0.0.0 ads.tiscali.com +0.0.0.0 ads.tiscali.it +0.0.0.0 adult.foxcounter.com +0.0.0.0 affiliate.ab1trk.com +0.0.0.0 affiliate.irotracker.com +0.0.0.0 ai062.insightexpress.com +0.0.0.0 ai078.insightexpressai.com +0.0.0.0 ai087.insightexpress.com +0.0.0.0 ai113.insightexpressai.com +0.0.0.0 ai125.insightexpressai.com +0.0.0.0 alpha.easy-hit-counters.com +0.0.0.0 amateur.xxxcounter.com +0.0.0.0 amer.hops.glbdns.microsoft.com +0.0.0.0 amer.rel.msn.com +0.0.0.0 analytics.msnbc.msn.com +0.0.0.0 analytics.prx.org +0.0.0.0 anm.intelli-direct.com +0.0.0.0 ant.conversive.nl +0.0.0.0 apac.rel.msn.com +0.0.0.0 api.bizographics.com +0.0.0.0 apprep.smartscreen.microsoft.com +0.0.0.0 app.yesware.com +0.0.0.0 arbo.hit.gemius.pl +0.0.0.0 au052.insightexpress.com +0.0.0.0 auspice.augur.io +0.0.0.0 au.track.decideinteractive.com +0.0.0.0 a.visualrevenue.com +0.0.0.0 banner.0catch.com +0.0.0.0 banners.webcounter.com +0.0.0.0 beacon-1.newrelic.com +0.0.0.0 beacon.scorecardresearch.com +0.0.0.0 beacons.hottraffic.nl +0.0.0.0 be.sitestat.com +0.0.0.0 best-search.cc #spyware +0.0.0.0 beta.easy-hit-counter.com +0.0.0.0 beta.easy-hit-counters.com +0.0.0.0 beta.easyhitcounters.com +0.0.0.0 bilbo.counted.com +0.0.0.0 bin.clearspring.com +0.0.0.0 birta.stats.is +0.0.0.0 bluekai.com +0.0.0.0 bluestreak.com +0.0.0.0 bookproplus.com +0.0.0.0 broadcastpc.tv +0.0.0.0 report.broadcastpc.tv +0.0.0.0 www.broadcastpc.tv +0.0.0.0 bserver.blick.com +0.0.0.0 bstats.adbrite.com +0.0.0.0 b.stats.paypal.com +0.0.0.0 by.optimost.com +0.0.0.0 c10.statcounter.com +0.0.0.0 c11.statcounter.com +0.0.0.0 c12.statcounter.com +0.0.0.0 c13.statcounter.com +0.0.0.0 c14.statcounter.com +0.0.0.0 c15.statcounter.com +0.0.0.0 c16.statcounter.com +0.0.0.0 c17.statcounter.com +0.0.0.0 c1.statcounter.com +0.0.0.0 c1.thecounter.com +0.0.0.0 c1.thecounter.de +0.0.0.0 c1.xxxcounter.com +0.0.0.0 c2.gostats.com +0.0.0.0 c2.thecounter.com +0.0.0.0 c2.thecounter.de +0.0.0.0 c2.xxxcounter.com +0.0.0.0 c3.gostats.com +0.0.0.0 c3.statcounter.com +0.0.0.0 c3.thecounter.com +0.0.0.0 c3.xxxcounter.com +0.0.0.0 c4.myway.com +0.0.0.0 c4.statcounter.com +0.0.0.0 c5.statcounter.com +0.0.0.0 c6.statcounter.com +0.0.0.0 c7.statcounter.com +0.0.0.0 c8.statcounter.com +0.0.0.0 c9.statcounter.com +0.0.0.0 ca.cqcounter.com +0.0.0.0 cashcounter.com +0.0.0.0 cb1.counterbot.com +0.0.0.0 cdn.krxd.net +0.0.0.0 cdn.oggifinogi.com +0.0.0.0 cdn.taboolasyndication.com +0.0.0.0 cdxbin.vulnerap.com +0.0.0.0 cf.addthis.com +0.0.0.0 cgicounter.onlinehome.de +0.0.0.0 cgicounter.puretec.de +0.0.0.0 cgi.hotstat.nl +0.0.0.0 cgi.sexlist.com +0.0.0.0 ci-mpsnare.iovation.com # See http://www.codingthewheel.com/archives/online-gambling-privacy-iesnare +0.0.0.0 citrix.tradedoubler.com +0.0.0.0 cjt1.net +0.0.0.0 click.atdmt.com +0.0.0.0 clickauditor.net +0.0.0.0 click.fivemtn.com +0.0.0.0 click.investopedia.com +0.0.0.0 click.jve.net +0.0.0.0 clickmeter.com +0.0.0.0 click.payserve.com +0.0.0.0 clicks.emarketmakers.com +0.0.0.0 click.silvercash.com +0.0.0.0 clicks.m4n.nl +0.0.0.0 clicks.natwest.com +0.0.0.0 clickspring.net #used by a spyware product called PurityScan +0.0.0.0 clicks.rbs.co.uk +0.0.0.0 clicktrack.onlineemailmarketing.com +0.0.0.0 clicktracks.webmetro.com +0.0.0.0 clit10.sextracker.com +0.0.0.0 clit13.sextracker.com +0.0.0.0 clit15.sextracker.com +0.0.0.0 clit2.sextracker.com +0.0.0.0 clit4.sextracker.com +0.0.0.0 clit6.sextracker.com +0.0.0.0 clit7.sextracker.com +0.0.0.0 clit8.sextracker.com +0.0.0.0 clit9.sextracker.com +0.0.0.0 clk.aboxdeal.com +0.0.0.0 clk.relestar.com +0.0.0.0 cnn.entertainment.printthis.clickability.com +0.0.0.0 cnt.xcounter.com +0.0.0.0 collector.deepmetrix.com +0.0.0.0 collector.newsx.cc +0.0.0.0 connectionlead.com +0.0.0.0 connexity.net +0.0.0.0 cookies.cmpnet.com +0.0.0.0 count.channeladvisor.com +0.0.0.0 counter10.bravenet.com +0.0.0.0 counter10.sextracker.be +0.0.0.0 counter10.sextracker.com +0.0.0.0 counter11.bravenet.com +0.0.0.0 counter11.sextracker.be +0.0.0.0 counter11.sextracker.com +0.0.0.0 counter.123counts.com +0.0.0.0 counter12.bravenet.com +0.0.0.0 counter12.sextracker.be +0.0.0.0 counter12.sextracker.com +0.0.0.0 counter13.bravenet.com +0.0.0.0 counter13.sextracker.be +0.0.0.0 counter13.sextracker.com +0.0.0.0 counter14.bravenet.com +0.0.0.0 counter14.sextracker.be +0.0.0.0 counter14.sextracker.com +0.0.0.0 counter15.bravenet.com +0.0.0.0 counter15.sextracker.be +0.0.0.0 counter15.sextracker.com +0.0.0.0 counter16.bravenet.com +0.0.0.0 counter16.sextracker.be +0.0.0.0 counter16.sextracker.com +0.0.0.0 counter17.bravenet.com +0.0.0.0 counter18.bravenet.com +0.0.0.0 counter19.bravenet.com +0.0.0.0 counter1.bravenet.com +0.0.0.0 counter1.sextracker.be +0.0.0.0 counter1.sextracker.com +0.0.0.0 counter.1stblaze.com +0.0.0.0 counter20.bravenet.com +0.0.0.0 counter21.bravenet.com +0.0.0.0 counter22.bravenet.com +0.0.0.0 counter23.bravenet.com +0.0.0.0 counter24.bravenet.com +0.0.0.0 counter25.bravenet.com +0.0.0.0 counter26.bravenet.com +0.0.0.0 counter27.bravenet.com +0.0.0.0 counter28.bravenet.com +0.0.0.0 counter29.bravenet.com +0.0.0.0 counter2.bravenet.com +0.0.0.0 counter2.freeware.de +0.0.0.0 counter2.hitslink.com +0.0.0.0 counter2.sextracker.be +0.0.0.0 counter2.sextracker.com +0.0.0.0 counter30.bravenet.com +0.0.0.0 counter31.bravenet.com +0.0.0.0 counter32.bravenet.com +0.0.0.0 counter33.bravenet.com +0.0.0.0 counter34.bravenet.com +0.0.0.0 counter35.bravenet.com +0.0.0.0 counter36.bravenet.com +0.0.0.0 counter37.bravenet.com +0.0.0.0 counter38.bravenet.com +0.0.0.0 counter39.bravenet.com +0.0.0.0 counter3.bravenet.com +0.0.0.0 counter3.sextracker.be +0.0.0.0 counter3.sextracker.com +0.0.0.0 counter40.bravenet.com +0.0.0.0 counter41.bravenet.com +0.0.0.0 counter42.bravenet.com +0.0.0.0 counter43.bravenet.com +0.0.0.0 counter44.bravenet.com +0.0.0.0 counter45.bravenet.com +0.0.0.0 counter46.bravenet.com +0.0.0.0 counter47.bravenet.com +0.0.0.0 counter48.bravenet.com +0.0.0.0 counter49.bravenet.com +0.0.0.0 counter4all.dk +0.0.0.0 counter4.bravenet.com +0.0.0.0 counter4.sextracker.be +0.0.0.0 counter4.sextracker.com +0.0.0.0 counter4u.de +0.0.0.0 counter50.bravenet.com +0.0.0.0 counter5.bravenet.com +0.0.0.0 counter5.sextracker.be +0.0.0.0 counter5.sextracker.com +0.0.0.0 counter6.bravenet.com +0.0.0.0 counter6.sextracker.be +0.0.0.0 counter6.sextracker.com +0.0.0.0 counter7.bravenet.com +0.0.0.0 counter7.sextracker.be +0.0.0.0 counter7.sextracker.com +0.0.0.0 counter8.bravenet.com +0.0.0.0 counter8.sextracker.be +0.0.0.0 counter8.sextracker.com +0.0.0.0 counter9.bravenet.com +0.0.0.0 counter9.sextracker.be +0.0.0.0 counter9.sextracker.com +0.0.0.0 counter.aaddzz.com +0.0.0.0 counterad.de +0.0.0.0 counter.adultcheck.com +0.0.0.0 counter.adultrevenueservice.com +0.0.0.0 counter.advancewebhosting.com +0.0.0.0 counter.aport.ru +0.0.0.0 counteraport.spylog.com +0.0.0.0 counter.asexhound.com +0.0.0.0 counter.avp2000.com +0.0.0.0 counter.bizland.com +0.0.0.0 counter.bloke.com +0.0.0.0 counterbot.com +0.0.0.0 counter.clubnet.ro +0.0.0.0 counter.cnw.cz +0.0.0.0 countercrazy.com +0.0.0.0 counter.credo.ru +0.0.0.0 counter.cz +0.0.0.0 counter.digits.com +0.0.0.0 counter.dreamhost.com +0.0.0.0 counter.e-audit.it +0.0.0.0 counter.execpc.com +0.0.0.0 counter.fateback.com +0.0.0.0 counter.gamespy.com +0.0.0.0 counter.hitslink.com +0.0.0.0 counter.hitslinks.com +0.0.0.0 counter.htmlvalidator.com +0.0.0.0 counter.impressur.com +0.0.0.0 counter.inetusa.com +0.0.0.0 counter.inti.fr +0.0.0.0 counter.kaspersky.com +0.0.0.0 counter.letssingit.com +0.0.0.0 counter.mtree.com +0.0.0.0 counter.mycomputer.com +0.0.0.0 counter.netmore.net +0.0.0.0 counter.nope.dk +0.0.0.0 counter.nowlinux.com +0.0.0.0 counter.pcgames.de +0.0.0.0 counter.rambler.ru +0.0.0.0 counters.auctionhelper.com # comment these +0.0.0.0 counters.auctionwatch.com # out to allow +0.0.0.0 counters.auctiva.com # tracking by +0.0.0.0 counters.honesty.com # ebay users +0.0.0.0 counter.search.bg +0.0.0.0 counter.sexhound.nl +0.0.0.0 counters.gigya.com +0.0.0.0 counter.sparklit.com +0.0.0.0 counter.superstats.com +0.0.0.0 counter.surfcounters.com +0.0.0.0 counters.xaraonline.com +0.0.0.0 counter.times.lv +0.0.0.0 counter.topping.com.ua +0.0.0.0 counter.tripod.com +0.0.0.0 counter.uq.edu.au +0.0.0.0 counter.w3open.com +0.0.0.0 counter.webcom.com +0.0.0.0 counter.webmedia.pl +0.0.0.0 counter.webtrends.com +0.0.0.0 counter.webtrends.net +0.0.0.0 counter.xxxcool.com +0.0.0.0 counter.yadro.ru +0.0.0.0 count.paycounter.com +0.0.0.0 count.xhit.com +0.0.0.0 cs.sexcounter.com +0.0.0.0 c.statcounter.com +0.0.0.0 c.thecounter.de +0.0.0.0 cw.nu +0.0.0.0 cyseal.cyveillance.com +0.0.0.0 cz3.clickzs.com +0.0.0.0 cz6.clickzs.com +0.0.0.0 da.ce.bd.a9.top.list.ru +0.0.0.0 da.newstogram.com +0.0.0.0 data2.perf.overture.com +0.0.0.0 data.coremetrics.com +0.0.0.0 data.webads.co.nz +0.0.0.0 dclk.haaretz.co.il +0.0.0.0 dclk.themarker.com +0.0.0.0 dclk.themarketer.com +0.0.0.0 delivery.loopingclick.com +0.0.0.0 de.sitestat.com +0.0.0.0 didtheyreadit.com # email bugs +0.0.0.0 digistats.westjet.com +0.0.0.0 dimeprice.com # "spam bugs" +0.0.0.0 directads.mcafee.com +0.0.0.0 dotcomsecrets.com +0.0.0.0 dpbolvw.net +0.0.0.0 ds.247realmedia.com +0.0.0.0 ds.amateurmatch.com +0.0.0.0 dwclick.com +0.0.0.0 e-2dj6wfk4ehd5afq.stats.esomniture.com +0.0.0.0 e-2dj6wfk4ggdzkbo.stats.esomniture.com +0.0.0.0 e-2dj6wfk4gkcpiep.stats.esomniture.com +0.0.0.0 e-2dj6wfk4skdpogo.stats.esomniture.com +0.0.0.0 e-2dj6wfkiakdjgcp.stats.esomniture.com +0.0.0.0 e-2dj6wfkiepczoeo.stats.esomniture.com +0.0.0.0 e-2dj6wfkikjd5glq.stats.esomniture.com +0.0.0.0 e-2dj6wfkiokc5odp.stats.esomniture.com +0.0.0.0 e-2dj6wfkiqjcpifp.stats.esomniture.com +0.0.0.0 e-2dj6wfkocjczedo.stats.esomniture.com +0.0.0.0 e-2dj6wfkokjajseq.stats.esomniture.com +0.0.0.0 e-2dj6wfkowkdjokp.stats.esomniture.com +0.0.0.0 e-2dj6wfkykpazskq.stats.esomniture.com +0.0.0.0 e-2dj6wflicocjklo.stats.esomniture.com +0.0.0.0 e-2dj6wfligpd5iap.stats.esomniture.com +0.0.0.0 e-2dj6wflikgdpodo.stats.esomniture.com +0.0.0.0 e-2dj6wflikiajslo.stats.esomniture.com +0.0.0.0 e-2dj6wflioldzoco.stats.esomniture.com +0.0.0.0 e-2dj6wfliwpczolp.stats.esomniture.com +0.0.0.0 e-2dj6wfloenczmkq.stats.esomniture.com +0.0.0.0 e-2dj6wflokmajedo.stats.esomniture.com +0.0.0.0 e-2dj6wfloqgc5mho.stats.esomniture.com +0.0.0.0 e-2dj6wfmysgdzobo.stats.esomniture.com +0.0.0.0 e-2dj6wgkigpcjedo.stats.esomniture.com +0.0.0.0 e-2dj6wgkisnd5abo.stats.esomniture.com +0.0.0.0 e-2dj6wgkoandzieq.stats.esomniture.com +0.0.0.0 e-2dj6wgkycpcpsgq.stats.esomniture.com +0.0.0.0 e-2dj6wgkyepajmeo.stats.esomniture.com +0.0.0.0 e-2dj6wgkyknd5sko.stats.esomniture.com +0.0.0.0 e-2dj6wgkyomdpalp.stats.esomniture.com +0.0.0.0 e-2dj6whkiandzkko.stats.esomniture.com +0.0.0.0 e-2dj6whkiepd5iho.stats.esomniture.com +0.0.0.0 e-2dj6whkiwjdjwhq.stats.esomniture.com +0.0.0.0 e-2dj6wjk4amd5mfp.stats.esomniture.com +0.0.0.0 e-2dj6wjk4kkcjalp.stats.esomniture.com +0.0.0.0 e-2dj6wjk4ukazebo.stats.esomniture.com +0.0.0.0 e-2dj6wjkosodpmaq.stats.esomniture.com +0.0.0.0 e-2dj6wjkouhd5eao.stats.esomniture.com +0.0.0.0 e-2dj6wjkowhd5ggo.stats.esomniture.com +0.0.0.0 e-2dj6wjkowjajcbo.stats.esomniture.com +0.0.0.0 e-2dj6wjkyandpogq.stats.esomniture.com +0.0.0.0 e-2dj6wjkycpdzckp.stats.esomniture.com +0.0.0.0 e-2dj6wjkyqmdzcgo.stats.esomniture.com +0.0.0.0 e-2dj6wjkysndzigp.stats.esomniture.com +0.0.0.0 e-2dj6wjl4qhd5kdo.stats.esomniture.com +0.0.0.0 e-2dj6wjlichdjoep.stats.esomniture.com +0.0.0.0 e-2dj6wjliehcjglp.stats.esomniture.com +0.0.0.0 e-2dj6wjlignajgaq.stats.esomniture.com +0.0.0.0 e-2dj6wjloagc5oco.stats.esomniture.com +0.0.0.0 e-2dj6wjlougazmao.stats.esomniture.com +0.0.0.0 e-2dj6wjlyamdpogo.stats.esomniture.com +0.0.0.0 e-2dj6wjlyckcpelq.stats.esomniture.com +0.0.0.0 e-2dj6wjlyeodjkcq.stats.esomniture.com +0.0.0.0 e-2dj6wjlygkd5ecq.stats.esomniture.com +0.0.0.0 e-2dj6wjmiekc5olo.stats.esomniture.com +0.0.0.0 e-2dj6wjmyehd5mfo.stats.esomniture.com +0.0.0.0 e-2dj6wjmyooczoeo.stats.esomniture.com +0.0.0.0 e-2dj6wjny-1idzkh.stats.esomniture.com +0.0.0.0 e-2dj6wjnyagcpkko.stats.esomniture.com +0.0.0.0 e-2dj6wjnyeocpcdo.stats.esomniture.com +0.0.0.0 e-2dj6wjnygidjskq.stats.esomniture.com +0.0.0.0 e-2dj6wjnyqkajabp.stats.esomniture.com +0.0.0.0 easy-web-stats.com +0.0.0.0 ecestats.theglobeandmail.com +0.0.0.0 economisttestcollect.insightfirst.com +0.0.0.0 ehg.fedex.com +0.0.0.0 eitbglobal.ojdinteractiva.com +0.0.0.0 emea.rel.msn.com +0.0.0.0 engine.cmmeglobal.com +0.0.0.0 enoratraffic.com +0.0.0.0 entry-stats.huffingtonpost.com +0.0.0.0 environmentalgraffiti.uk.intellitxt.com +0.0.0.0 e-n.y-1shz2prbmdj6wvny-1sez2pra2dj6wjmyepdzadpwudj6x9ny-1seq-2-2.stats.esomniture.com +0.0.0.0 e-ny.a-1shz2prbmdj6wvny-1sez2pra2dj6wjny-1jcpgbowsdj6x9ny-1seq-2-2.stats.esomniture.com +0.0.0.0 es.optimost.com +0.0.0.0 fastcounter.bcentral.com +0.0.0.0 fastcounter.com +0.0.0.0 fastcounter.linkexchange.com +0.0.0.0 fastcounter.linkexchange.net +0.0.0.0 fastcounter.linkexchange.nl +0.0.0.0 fastcounter.onlinehoster.net +0.0.0.0 fastwebcounter.com +0.0.0.0 fcstats.bcentral.com +0.0.0.0 fi.sitestat.com +0.0.0.0 fl01.ct2.comclick.com +0.0.0.0 flycast.com +0.0.0.0 forbescollect.247realmedia.com +0.0.0.0 formalyzer.com +0.0.0.0 foxcounter.com +0.0.0.0 free-counter.5u.com +0.0.0.0 freeinvisiblecounters.com +0.0.0.0 freestats.com +0.0.0.0 freewebcounter.com +0.0.0.0 free.xxxcounter.com +0.0.0.0 fs10.fusestats.com +0.0.0.0 ft2.autonomycloud.com +0.0.0.0 gapl.hit.gemius.pl +0.0.0.0 gator.com +0.0.0.0 gcounter.hosting4u.net +0.0.0.0 gd.mlb.com +0.0.0.0 geocounter.net +0.0.0.0 gkkzngresullts.com +0.0.0.0 go-in-search.net +0.0.0.0 goldstats.com +0.0.0.0 googfle.com +0.0.0.0 googletagservices.com +0.0.0.0 gostats.com +0.0.0.0 grafix.xxxcounter.com +0.0.0.0 gtcc1.acecounter.com +0.0.0.0 g-wizzads.net +0.0.0.0 hc2.humanclick.com +0.0.0.0 hit10.hotlog.ru +0.0.0.0 hit2.hotlog.ru +0.0.0.0 hit37.chark.dk +0.0.0.0 hit37.chart.dk +0.0.0.0 hit39.chart.dk +0.0.0.0 hit5.hotlog.ru +0.0.0.0 hit8.hotlog.ru +0.0.0.0 hit.clickaider.com +0.0.0.0 hit-counter.5u.com +0.0.0.0 hit-counter.udub.com +0.0.0.0 hits.guardian.co.uk +0.0.0.0 hits.gureport.co.uk +0.0.0.0 hits.nextstat.com +0.0.0.0 hits.webstat.com +0.0.0.0 hitx.statistics.ro +0.0.0.0 hst.tradedoubler.com +0.0.0.0 htm.freelogs.com +0.0.0.0 http300.edge.ru4.com +0.0.0.0 iccee.com +0.0.0.0 idm.hit.gemius.pl +0.0.0.0 ieplugin.com +0.0.0.0 iesnare.com # See http://www.codingthewheel.com/archives/online-gambling-privacy-iesnare +0.0.0.0 ig.insightgrit.com +0.0.0.0 ih.constantcontacts.com +0.0.0.0 i.kissmetrics.com # http://www.wired.com/epicenter/2011/07/undeletable-cookie/ +0.0.0.0 ilead.itrack.it +0.0.0.0 image.masterstats.com +0.0.0.0 images1.paycounter.com +0.0.0.0 images-aud.freshmeat.net +0.0.0.0 images-aud.slashdot.org +0.0.0.0 images-aud.sourceforge.net +0.0.0.0 images.dailydiscounts.com # "spam bugs" +0.0.0.0 images.itchydawg.com +0.0.0.0 impacts.alliancehub.com # "spam bugs" +0.0.0.0 impch.tradedoubler.com +0.0.0.0 imp.clickability.com +0.0.0.0 impde.tradedoubler.com +0.0.0.0 impdk.tradedoubler.com +0.0.0.0 impes.tradedoubler.com +0.0.0.0 impfr.tradedoubler.com +0.0.0.0 impgb.tradedoubler.com +0.0.0.0 impie.tradedoubler.com +0.0.0.0 impit.tradedouble.com +0.0.0.0 impit.tradedoubler.com +0.0.0.0 impnl.tradedoubler.com +0.0.0.0 impno.tradedoubler.com +0.0.0.0 impse.tradedoubler.com +0.0.0.0 in.paycounter.com +0.0.0.0 insightfirst.com +0.0.0.0 insightxe.looksmart.com +0.0.0.0 int.sitestat.com +0.0.0.0 in.webcounter.cc +0.0.0.0 iprocollect.realmedia.com +0.0.0.0 izitracking.izimailing.com +0.0.0.0 jgoyk.cjt1.net +0.0.0.0 jkearns.freestats.com +0.0.0.0 journalism.uk.smarttargetting.com +0.0.0.0 js.cybermonitor.com +0.0.0.0 jsonlinecollect.247realmedia.com +0.0.0.0 js.revsci.net +0.0.0.0 kissmetrics.com +0.0.0.0 kqzyfj.com +0.0.0.0 kt4.kliptracker.com +0.0.0.0 leadpub.com +0.0.0.0 liapentruromania.ro +0.0.0.0 lin31.metriweb.be +0.0.0.0 linkcounter.com +0.0.0.0 linkcounter.pornosite.com +0.0.0.0 link.masterstats.com +0.0.0.0 linktrack.bravenet.com +0.0.0.0 livestats.atlanta-airport.com +#0.0.0.0 ll.a.hulu.com # Uncomment to block Hulu. +0.0.0.0 loc1.hitsprocessor.com +0.0.0.0 log1.countomat.com +0.0.0.0 log4.quintelligence.com +0.0.0.0 log999.goo.ne.jp +0.0.0.0 loga.xiti.com +0.0.0.0 log.btopenworld.com +0.0.0.0 logc146.xiti.com +0.0.0.0 logc1.xiti.com +0.0.0.0 logc22.xiti.com +0.0.0.0 logc25.xiti.com +0.0.0.0 logc31.xiti.com +0.0.0.0 log.clickstream.co.za +0.0.0.0 log.hankooki.com +0.0.0.0 logi6.xiti.com +0.0.0.0 logi7.xiti.com +0.0.0.0 logi8.xiti.com +0.0.0.0 logp3.xiti.com +0.0.0.0 logs.comics.com +0.0.0.0 logs.eresmas.com +0.0.0.0 logs.eresmas.net +0.0.0.0 log.statistici.ro +0.0.0.0 logv14.xiti.com +0.0.0.0 logv17.xiti.com +0.0.0.0 logv18.xiti.com +0.0.0.0 logv21.xiti.com +0.0.0.0 logv25.xiti.com +0.0.0.0 logv27.xiti.com +0.0.0.0 logv29.xiti.com +0.0.0.0 logv32.xiti.com +0.0.0.0 logv4.xiti.com +0.0.0.0 logv.xiti.com +0.0.0.0 luycos.com +0.0.0.0 lycoscollect.247realmedia.com +0.0.0.0 lycoscollect.realmedia.com +0.0.0.0 m1.nedstatbasic.net +0.0.0.0 m1.webstats4u.com +0.0.0.0 mailcheckisp.biz # "spam bugs" +0.0.0.0 mama128.valuehost.ru +0.0.0.0 marketscore.com +0.0.0.0 mature.xxxcounter.com +0.0.0.0 mbox5.offermatica.com +0.0.0.0 media101.sitebrand.com +0.0.0.0 media.superstats.com +0.0.0.0 mediatrack.revenue.net +0.0.0.0 metric.10best.com +0.0.0.0 metric.infoworld.com +0.0.0.0 metric.nationalgeographic.com +0.0.0.0 metric.nwsource.com +0.0.0.0 metric.olivegarden.com +0.0.0.0 metrics2.pricegrabber.com +0.0.0.0 metrics.accuweather.com +0.0.0.0 metrics.al.com +0.0.0.0 metrics.boston.com +0.0.0.0 metrics.cbc.ca +0.0.0.0 metrics.cleveland.com +0.0.0.0 metrics.cnn.com +0.0.0.0 metrics.csmonitor.com +0.0.0.0 metrics.ctv.ca +0.0.0.0 metrics.dallasnews.com +0.0.0.0 metrics.elle.com +0.0.0.0 metrics.experts-exchange.com +0.0.0.0 metrics.fandome.com +0.0.0.0 metrics.foxnews.com +0.0.0.0 metrics.gap.com +0.0.0.0 metrics.health.com +0.0.0.0 metrics.hrblock.com +0.0.0.0 metrics.ioffer.com +0.0.0.0 metrics.ireport.com +0.0.0.0 metrics.kgw.com +0.0.0.0 metrics.ktvb.com +0.0.0.0 metrics.landolakes.com +0.0.0.0 metrics.lhj.com +0.0.0.0 metrics.maxim.com +0.0.0.0 metrics.mlive.com +0.0.0.0 metrics.mms.mavenapps.net +0.0.0.0 metrics.mpora.com +0.0.0.0 metrics.mysanantonio.com +0.0.0.0 metrics.nba.com +0.0.0.0 metrics.nextgov.com +0.0.0.0 metrics.nfl.com +0.0.0.0 metrics.npr.org +0.0.0.0 metrics.oclc.org +0.0.0.0 metrics.olivegarden.com +0.0.0.0 metrics.oregonlive.com +0.0.0.0 metrics.parallels.com +0.0.0.0 metrics.performancing.com +0.0.0.0 metrics.philly.com +0.0.0.0 metrics.post-gazette.com +0.0.0.0 metrics.premiere.com +0.0.0.0 metrics.rottentomatoes.com +0.0.0.0 metrics.sephora.com +0.0.0.0 metrics.soundandvision.com +0.0.0.0 metrics.soundandvisionmag.com +0.0.0.0 metrics.sun.com +0.0.0.0 metric.starz.com +0.0.0.0 metrics.technologyreview.com +0.0.0.0 metrics.theatlantic.com +0.0.0.0 metrics.thedailybeast.com +0.0.0.0 metrics.thefa.com +0.0.0.0 metrics.thefrisky.com +0.0.0.0 metrics.thenation.com +0.0.0.0 metrics.theweathernetwork.com +#0.0.0.0 metrics.ticketmaster.com # interferes with logging in to ticketmaster.com +0.0.0.0 metrics.tmz.com +0.0.0.0 metrics.toyota.com +0.0.0.0 metrics.tulsaworld.com +0.0.0.0 metrics.washingtonpost.com +0.0.0.0 metrics.whitepages.com +0.0.0.0 metrics.womansday.com +0.0.0.0 metrics.yellowpages.com +0.0.0.0 metrics.yousendit.com +0.0.0.0 metric.thenation.com +0.0.0.0 mng1.clickalyzer.com +0.0.0.0 monster.gostats.com +0.0.0.0 mpsnare.iesnare.com # See http://www.codingthewheel.com/archives/online-gambling-privacy-iesnare +0.0.0.0 msn1.com +0.0.0.0 msnm.com +0.0.0.0 mt122.mtree.com +0.0.0.0 mtcount.channeladvisor.com +0.0.0.0 mtrcs.popcap.com +0.0.0.0 mtv.247realmedia.com +0.0.0.0 multi1.rmuk.co.uk +0.0.0.0 mvs.mediavantage.de +0.0.0.0 mvtracker.com +0.0.0.0 mystats.com +0.0.0.0 nedstat.s0.nl +0.0.0.0 nethit-free.nl +0.0.0.0 net-radar.com +0.0.0.0 network.leadpub.com +0.0.0.0 nextgenstats.com +0.0.0.0 nht-2.extreme-dm.com +0.0.0.0 nl.nedstatbasic.net +0.0.0.0 nl.sitestat.com +0.0.0.0 o.addthis.com +0.0.0.0 objects.tremormedia.com +0.0.0.0 okcounter.com +0.0.0.0 omniture.theglobeandmail.com +0.0.0.0 one.123counters.com +0.0.0.0 oss-crules.marketscore.com +0.0.0.0 oss-survey.marketscore.com +0.0.0.0 ostats.mozilla.com +0.0.0.0 other.xxxcounter.com +0.0.0.0 out.true-counter.com +0.0.0.0 p.addthis.com +0.0.0.0 partner.alerts.aol.com +0.0.0.0 partners.pantheranetwork.com +0.0.0.0 passpport.com +0.0.0.0 paxito.sitetracker.com +0.0.0.0 paycounter.com +0.0.0.0 pei-ads.thesmokingjacket.com +0.0.0.0 perso.estat.com +0.0.0.0 pf.tradedoubler.com +0.0.0.0 pings.blip.tv +0.0.0.0 pix02.revsci.net +0.0.0.0 pix03.revsci.net +0.0.0.0 pix04.revsci.net +0.0.0.0 pixel.invitemedia.com +0.0.0.0 pmg.ad-logics.com +0.0.0.0 pn2.adserver.yahoo.com +0.0.0.0 pointclicktrack.com +0.0.0.0 pong.qubitproducts.com +0.0.0.0 postclick.adcentriconline.com +0.0.0.0 postgazettecollect.247realmedia.com +0.0.0.0 precisioncounter.com +0.0.0.0 p.reuters.com +0.0.0.0 printmail.biz +0.0.0.0 prof.estat.com +0.0.0.0 pro.hit.gemius.pl +0.0.0.0 proxycfg.marketscore.com +0.0.0.0 proxy.ia2.marketscore.com +0.0.0.0 proxy.ia3.marketscore.com +0.0.0.0 proxy.ia4.marketscore.com +0.0.0.0 proxy.or3.marketscore.com +0.0.0.0 proxy.or4.marketscore.com +0.0.0.0 proxy.sj3.marketscore.com +0.0.0.0 proxy.sj4.marketscore.com +0.0.0.0 quantserve.com #: Ad Tracking, JavaScript, etc. +0.0.0.0 quareclk.com +0.0.0.0 raw.oggifinogi.com +0.0.0.0 r.clickdensity.com +0.0.0.0 remotrk.com +0.0.0.0 rightmedia.net +0.0.0.0 rightstats.com +0.0.0.0 roskatrack.roskadirect.com +0.0.0.0 rr1.xxxcounter.com +0.0.0.0 rr2.xxxcounter.com +0.0.0.0 rr3.xxxcounter.com +0.0.0.0 rr4.xxxcounter.com +0.0.0.0 rr5.xxxcounter.com +0.0.0.0 rr7.xxxcounter.com +0.0.0.0 rts.pgmediaserve.com +0.0.0.0 rts.phn.doublepimp.com +0.0.0.0 s10.histats.com +0.0.0.0 s10.sitemeter.com +0.0.0.0 s11.sitemeter.com +0.0.0.0 s12.sitemeter.com +0.0.0.0 s13.sitemeter.com +0.0.0.0 s14.sitemeter.com +0.0.0.0 s15.sitemeter.com +0.0.0.0 s16.sitemeter.com +0.0.0.0 s17.sitemeter.com +0.0.0.0 s18.sitemeter.com +0.0.0.0 s19.sitemeter.com +0.0.0.0 s1.shinystat.it +0.0.0.0 s1.thecounter.com +0.0.0.0 s20.sitemeter.com +0.0.0.0 s21.sitemeter.com +0.0.0.0 s22.sitemeter.com +0.0.0.0 s23.sitemeter.com +0.0.0.0 s24.sitemeter.com +0.0.0.0 s25.sitemeter.com +0.0.0.0 s26.sitemeter.com +0.0.0.0 s27.sitemeter.com +0.0.0.0 s28.sitemeter.com +0.0.0.0 s29.sitemeter.com +0.0.0.0 s2.statcounter.com +0.0.0.0 s2.youtube.com +0.0.0.0 s30.sitemeter.com +0.0.0.0 s31.sitemeter.com +0.0.0.0 s32.sitemeter.com +0.0.0.0 s33.sitemeter.com +0.0.0.0 s34.sitemeter.com +0.0.0.0 s35.sitemeter.com +0.0.0.0 s36.sitemeter.com +0.0.0.0 s37.sitemeter.com +0.0.0.0 s38.sitemeter.com +0.0.0.0 s39.sitemeter.com +0.0.0.0 s3.hit.stat.pl +0.0.0.0 s41.sitemeter.com +0.0.0.0 s42.sitemeter.com +0.0.0.0 s43.sitemeter.com +0.0.0.0 s44.sitemeter.com +0.0.0.0 s45.sitemeter.com +0.0.0.0 s46.sitemeter.com +0.0.0.0 s47.sitemeter.com +0.0.0.0 s48.sitemeter.com +0.0.0.0 s4.histats.com +0.0.0.0 s4.shinystat.com +0.0.0.0 s.clickability.com +0.0.0.0 scorecardresearch.com +0.0.0.0 scribe.twitter.com +0.0.0.0 scrooge.channelcincinnati.com +0.0.0.0 scrooge.channeloklahoma.com +0.0.0.0 scrooge.click10.com +0.0.0.0 scrooge.clickondetroit.com +0.0.0.0 scrooge.nbc11.com +0.0.0.0 scrooge.nbc4columbus.com +0.0.0.0 scrooge.nbc4.com +0.0.0.0 scrooge.nbcsandiego.com +0.0.0.0 scrooge.newsnet5.com +0.0.0.0 scrooge.thebostonchannel.com +0.0.0.0 scrooge.thedenverchannel.com +0.0.0.0 scrooge.theindychannel.com +0.0.0.0 scrooge.thekansascitychannel.com +0.0.0.0 scrooge.themilwaukeechannel.com +0.0.0.0 scrooge.theomahachannel.com +0.0.0.0 scrooge.wesh.com +0.0.0.0 scrooge.wftv.com +0.0.0.0 scrooge.wnbc.com +0.0.0.0 scrooge.wsoctv.com +0.0.0.0 scrooge.wtov9.com +0.0.0.0 sdc.rbistats.com +0.0.0.0 searchadv.com +0.0.0.0 sekel.ch +0.0.0.0 servedby.valuead.com +0.0.0.0 server10.opentracker.net +0.0.0.0 server11.opentracker.net +0.0.0.0 server12.opentracker.net +0.0.0.0 server13.opentracker.net +0.0.0.0 server14.opentracker.net +0.0.0.0 server15.opentracker.net +0.0.0.0 server16.opentracker.net +0.0.0.0 server17.opentracker.net +0.0.0.0 server18.opentracker.net +0.0.0.0 server1.opentracker.net +0.0.0.0 server2.opentracker.net +0.0.0.0 server3.opentracker.net +0.0.0.0 server3.web-stat.com +0.0.0.0 server4.opentracker.net +0.0.0.0 server5.opentracker.net +0.0.0.0 server6.opentracker.net +0.0.0.0 server7.opentracker.net +0.0.0.0 server8.opentracker.net +0.0.0.0 server9.opentracker.net +0.0.0.0 service.bfast.com +0.0.0.0 services.krxd.net +0.0.0.0 se.sitestat.com +0.0.0.0 sexcounter.com +0.0.0.0 seznam.hit.gemius.pl +0.0.0.0 showads.pubmatic.com +0.0.0.0 showcount.honest.com +0.0.0.0 sideshow.directtrack.com +0.0.0.0 sitestat.com +0.0.0.0 sitestats.tiscali.co.uk +0.0.0.0 sm1.sitemeter.com +0.0.0.0 sm2.sitemeter.com +0.0.0.0 sm3.sitemeter.com +0.0.0.0 sm4.sitemeter.com +0.0.0.0 sm5.sitemeter.com +0.0.0.0 sm6.sitemeter.com +0.0.0.0 sm7.sitemeter.com +0.0.0.0 sm8.sitemeter.com +0.0.0.0 sm9.sitemeter.com +0.0.0.0 smartstats.com +0.0.0.0 softcore.xxxcounter.com +0.0.0.0 sostats.mozilla.com +0.0.0.0 sovereign.sitetracker.com +0.0.0.0 spinbox.maccentral.com +0.0.0.0 spinbox.versiontracker.com +0.0.0.0 spklds.com +0.0.0.0 s.statistici.ro +0.0.0.0 s.stats.wordpress.com +0.0.0.0 ss.tiscali.com +0.0.0.0 ss.tiscali.it +0.0.0.0 st1.hit.gemius.pl +0.0.0.0 stags.peer39.net +0.0.0.0 stast2.gq.com +0.0.0.0 stat1.z-stat.com +0.0.0.0 stat3.cybermonitor.com +0.0.0.0 stat.4u.pl +0.0.0.0 stat.alibaba.com +0.0.0.0 statcounter.com +0.0.0.0 stat-counter.tass-online.ru +0.0.0.0 stat.discogs.com +0.0.0.0 static.kibboko.com +0.0.0.0 static.smni.com # Santa Monica - popunders +0.0.0.0 statik.topica.com +0.0.0.0 statistics.dynamicsitestats.com +0.0.0.0 statistics.elsevier.nl +0.0.0.0 statistics.reedbusiness.nl +0.0.0.0 statistics.theonion.com +0.0.0.0 statistik-gallup.net +0.0.0.0 stat.netmonitor.fi +0.0.0.0 stat.onestat.com +0.0.0.0 stats1.clicktracks.com +0.0.0.0 stats1.corusradio.com +0.0.0.0 stats1.in +0.0.0.0 stats.24ways.org +0.0.0.0 stats2.clicktracks.com +0.0.0.0 stats2.gourmet.com +0.0.0.0 stats2.newyorker.com +0.0.0.0 stats2.rte.ie +0.0.0.0 stats2.unrulymedia.com +0.0.0.0 stats2.vanityfair.com +0.0.0.0 stats4all.com +0.0.0.0 stats5.lightningcast.com +0.0.0.0 stats6.lightningcast.net +0.0.0.0 stats.absol.co.za +0.0.0.0 stats.adbrite.com +0.0.0.0 stats.adotube.com +0.0.0.0 stats.adultswim.com +0.0.0.0 stats.airfarewatchdog.com +0.0.0.0 stats.allliquid.com +0.0.0.0 stats.askmen.com +0.0.0.0 stats.bbc.co.uk +0.0.0.0 stats.becu.org +0.0.0.0 stats.big-boards.com +0.0.0.0 stats.blogoscoop.net +0.0.0.0 stats.bonzaii.no +0.0.0.0 stats.break.com +0.0.0.0 stats.brides.com +0.0.0.0 stats.buysellads.com +0.0.0.0 stats.cafepress.com +0.0.0.0 stats.canalblog.com +0.0.0.0 stats.cartoonnetwork.com +0.0.0.0 stats.channel4.com +0.0.0.0 stats.clickability.com +0.0.0.0 stats.concierge.com +0.0.0.0 stats.cts-bv.nl +0.0.0.0 stats.darkbluesea.com +0.0.0.0 stats.datahjaelp.net +0.0.0.0 stats.directnic.com +0.0.0.0 stats.dziennik.pl +0.0.0.0 stats.economist.com +0.0.0.0 stats.epicurious.com +0.0.0.0 statse.webtrendslive.com # Fortune.com among others +0.0.0.0 stats.examiner.com +0.0.0.0 stats.fairmont.com +0.0.0.0 stats.fastcompany.com +0.0.0.0 stats.foxcounter.com +0.0.0.0 stats.free-rein.net +0.0.0.0 stats.f-secure.com +0.0.0.0 stats.ft.com +0.0.0.0 stats.gamestop.com +0.0.0.0 stats.globesports.com +0.0.0.0 stats.groupninetyfour.com +0.0.0.0 stats.idsoft.com +0.0.0.0 stats.ign.com +0.0.0.0 stats.ilsemedia.nl +0.0.0.0 stats.independent.co.uk +0.0.0.0 stats.indexstats.com +0.0.0.0 stats.indextools.com +0.0.0.0 stats.investors.com +0.0.0.0 stats.iwebtrack.com +0.0.0.0 stats.jippii.com +0.0.0.0 stats.klsoft.com +0.0.0.0 stats.ladotstats.nl +0.0.0.0 stats.macworld.com +0.0.0.0 stats.magnify.net +0.0.0.0 stats.manticoretechnology.com +0.0.0.0 stats.mbamupdates.com +0.0.0.0 stats.millanusa.com +0.0.0.0 stats.nowpublic.com +0.0.0.0 stats.paycounter.com +0.0.0.0 stats.platinumbucks.com +0.0.0.0 stats.popscreen.com +0.0.0.0 stats.reinvigorate.net +0.0.0.0 stats.resellerratings.com +0.0.0.0 stats.revenue.net +0.0.0.0 stats.searchles.com +0.0.0.0 stats.ssa.gov +0.0.0.0 stats.superstats.com +0.0.0.0 stats.telegraph.co.uk +0.0.0.0 stats.thoughtcatalog.com +0.0.0.0 stats.townnews.com +0.0.0.0 stats.ultimate-webservices.com +0.0.0.0 stats.unionleader.com +0.0.0.0 stats.video.search.yahoo.com +0.0.0.0 stats.vodpod.com +0.0.0.0 stats.wordpress.com +0.0.0.0 stats.www.ibm.com +0.0.0.0 stats.yourminis.com +0.0.0.0 stat.webmedia.pl +0.0.0.0 stat.www.fi +0.0.0.0 stat.yellowtracker.com +0.0.0.0 stat.youku.com +0.0.0.0 stl.p.a1.traceworks.com +0.0.0.0 straighttangerine.cz.cc +0.0.0.0 st.sageanalyst.net +0.0.0.0 sugoicounter.com +0.0.0.0 superstats.com +0.0.0.0 s.youtube.com +#0.0.0.0 t2.hulu.com # Uncomment to block Hulu. +0.0.0.0 tagging.outrider.com +0.0.0.0 talkcity.realtracker.com +0.0.0.0 targetnet.com +0.0.0.0 tates.freestats.com +0.0.0.0 tcookie.usatoday.com +0.0.0.0 tcr.tynt.com # See http://daringfireball.net/2010/05/tynt_copy_paste_jerks +0.0.0.0 tgpcounter.freethumbnailgalleries.com +0.0.0.0 thecounter.com +0.0.0.0 the-counter.net +0.0.0.0 themecounter.com +0.0.0.0 the.sextracker.com +0.0.0.0 tipsurf.com +0.0.0.0 toolbarpartner.com +0.0.0.0 tools.spylog.ru +0.0.0.0 top.mail.ru +0.0.0.0 topstats.com +0.0.0.0 topstats.net +0.0.0.0 torstarcollect.247realmedia.com +0.0.0.0 track2.mybloglog.com +0.0.0.0 track.adform.com +0.0.0.0 track.adform.net +0.0.0.0 track.did-it.com +0.0.0.0 track.directleads.com +0.0.0.0 track.domainsponsor.com +0.0.0.0 track.effiliation.com +0.0.0.0 tracker.bonnint.net +0.0.0.0 tracker.clicktrade.com +0.0.0.0 tracker.idg.co.uk +0.0.0.0 tracker.mattel.com +0.0.0.0 tracker.netklix.com +0.0.0.0 tracker.tradedoubler.com +0.0.0.0 track.exclusivecpa.com +0.0.0.0 track.ft.com +0.0.0.0 track.gawker.com +0.0.0.0 track.homestead.com +#0.0.0.0 track.hulu.com # Uncomment to block Hulu. +0.0.0.0 tracking.10e20.com +0.0.0.0 tracking.adjug.com +0.0.0.0 tracking.allposters.com +0.0.0.0 tracking.foxnews.com +0.0.0.0 tracking.iol.co.za +0.0.0.0 tracking.msadcenter.msn.com +0.0.0.0 tracking.oggifinogi.com +0.0.0.0 tracking.percentmobile.com +0.0.0.0 tracking.publicidees.com +0.0.0.0 tracking.quisma.com +0.0.0.0 tracking.rangeonlinemedia.com +0.0.0.0 tracking.searchmarketing.com +0.0.0.0 tracking.summitmedia.co.uk +0.0.0.0 tracking.trafficjunky.net +0.0.0.0 tracking.trutv.com +0.0.0.0 tracking.vindicosuite.com +0.0.0.0 track.lfstmedia.com +0.0.0.0 track.mybloglog.com +0.0.0.0 track.omg2.com +0.0.0.0 track.roiservice.com +0.0.0.0 track.searchignite.com +0.0.0.0 tracksurf.daooda.com +0.0.0.0 track.webgains.com +0.0.0.0 tradedoubler.com +0.0.0.0 tradedoubler.sonvideopro.com +0.0.0.0 tr.adinterax.com +0.0.0.0 traffic-stats.streamsolutions.co.uk +0.0.0.0 trax.gamespot.com +0.0.0.0 trc.taboolasyndication.com +0.0.0.0 trk.kissmetrics.com +0.0.0.0 trk.tidaltv.com +0.0.0.0 true-counter.com +0.0.0.0 truehits1.gits.net.th +0.0.0.0 t.senaluno.com +0.0.0.0 tu.connect.wunderloop.net +0.0.0.0 tynt.com +0.0.0.0 u1817.16.spylog.com +0.0.0.0 u3102.47.spylog.com +0.0.0.0 u3305.71.spylog.com +0.0.0.0 u3608.20.spylog.com +0.0.0.0 u4056.56.spylog.com +0.0.0.0 u432.77.spylog.com +0.0.0.0 u4396.79.spylog.com +0.0.0.0 u4443.84.spylog.com +0.0.0.0 u4556.11.spylog.com +0.0.0.0 u5234.87.spylog.com +0.0.0.0 u5234.98.spylog.com +0.0.0.0 u5687.48.spylog.com +0.0.0.0 u574.07.spylog.com +0.0.0.0 u604.41.spylog.com +0.0.0.0 u6762.46.spylog.com +0.0.0.0 u6905.71.spylog.com +0.0.0.0 u7748.16.spylog.com +0.0.0.0 u810.15.spylog.com +0.0.0.0 u920.31.spylog.com +0.0.0.0 u977.40.spylog.com +0.0.0.0 udc.msn.com +0.0.0.0 uk.cqcounter.com +0.0.0.0 uk.sitestat.com +0.0.0.0 ultimatecounter.com +0.0.0.0 us.2.cqcounter.com +0.0.0.0 usa.nedstat.net +0.0.0.0 us.cqcounter.com +0.0.0.0 v1.nedstatbasic.net +0.0.0.0 v7.stats.load.com +0.0.0.0 valueclick.com +0.0.0.0 valueclick.net +0.0.0.0 vertical-stats.huffpost.com +0.0.0.0 video-stats.video.google.com +0.0.0.0 vip.clickzs.com +0.0.0.0 virtualbartendertrack.beer.com +0.0.0.0 visit.theglobeandmail.com # Visits to theglobeandmail.com +0.0.0.0 vis.sexlist.com +0.0.0.0 voken.eyereturn.com +0.0.0.0 vs.dmtracker.com +0.0.0.0 vsii.spinbox.net +0.0.0.0 vsii.spindox.net +0.0.0.0 w1.tcr112.tynt.com +0.0.0.0 warlog.info +0.0.0.0 wau.tynt.com +0.0.0.0 web1.realtracker.com +0.0.0.0 web2.realtracker.com +0.0.0.0 web3.realtracker.com +0.0.0.0 web4.realtracker.com +0.0.0.0 webanalytics.globalthoughtz.com +0.0.0.0 webbug.seatreport.com # web bugs +0.0.0.0 web-counter.5u.com +0.0.0.0 webcounter.com +0.0.0.0 webcounter.goweb.de +0.0.0.0 webcounter.together.net +0.0.0.0 webhit.aftenposten.no +0.0.0.0 webhit.afterposten.no +0.0.0.0 webmasterkai.sitetracker.com +0.0.0.0 webpdp.gator.com +0.0.0.0 webstat.channel4.com +0.0.0.0 webtrends.telenet.be +0.0.0.0 webtrends.thisis.co.uk +0.0.0.0 webtrends.townhall.com +0.0.0.0 wtnj.worldnow.com +0.0.0.0 www.0stats.com +0.0.0.0 www101.coolsavings.com +0.0.0.0 www.123count.com +0.0.0.0 www.123counter.superstats.com +0.0.0.0 www.123stat.com +0.0.0.0 www1.addfreestats.com +0.0.0.0 www1.counter.bloke.com +0.0.0.0 www.1quickclickrx.com +0.0.0.0 www1.tynt.com +0.0.0.0 www.2001-007.com +0.0.0.0 www2.addfreestats.com +0.0.0.0 www2.counter.bloke.com +0.0.0.0 www2.pagecount.com +0.0.0.0 www3.addfreestats.com +0.0.0.0 www3.click-fr.com +0.0.0.0 www3.counter.bloke.com +0.0.0.0 www.3dstats.com +0.0.0.0 www4.addfreestats.com +0.0.0.0 www4.counter.bloke.com +0.0.0.0 www5.addfreestats.com +0.0.0.0 www5.counter.bloke.com +0.0.0.0 www60.valueclick.com +0.0.0.0 www6.addfreestats.com +0.0.0.0 www6.click-fr.com +0.0.0.0 www6.counter.bloke.com +0.0.0.0 www7.addfreestats.com +0.0.0.0 www7.counter.bloke.com +0.0.0.0 www8.addfreestats.com +0.0.0.0 www8.counter.bloke.com +0.0.0.0 www9.counter.bloke.com +0.0.0.0 www.addfreecounter.com +0.0.0.0 www.addfreestats.com +0.0.0.0 www.ademails.com +0.0.0.0 www.affiliatesuccess.net +0.0.0.0 www.bar.ry2002.02-ry014.snpr.hotmx.hair.zaam.net # In spam +0.0.0.0 www.belstat.nl +0.0.0.0 www.betcounter.com +0.0.0.0 www.bigbadted.com +0.0.0.0 www.bluestreak.com +0.0.0.0 www.c1.thecounter.de +0.0.0.0 www.c2.thecounter.de +0.0.0.0 www.clickclick.com +0.0.0.0 www.clickspring.net #used by a spyware product called PurityScan +0.0.0.0 www.clixgalore.com +0.0.0.0 www.connectionlead.com +0.0.0.0 www.counter10.sextracker.be +0.0.0.0 www.counter11.sextracker.be +0.0.0.0 www.counter12.sextracker.be +0.0.0.0 www.counter13.sextracker.be +0.0.0.0 www.counter14.sextracker.be +0.0.0.0 www.counter15.sextracker.be +0.0.0.0 www.counter16.sextracker.be +0.0.0.0 www.counter1.sextracker.be +0.0.0.0 www.counter2.sextracker.be +0.0.0.0 www.counter3.sextracker.be +0.0.0.0 www.counter4all.com +0.0.0.0 www.counter4all.de +0.0.0.0 www.counter4.sextracker.be +0.0.0.0 www.counter5.sextracker.be +0.0.0.0 www.counter6.sextracker.be +0.0.0.0 www.counter7.sextracker.be +0.0.0.0 www.counter8.sextracker.be +0.0.0.0 www.counter9.sextracker.be +0.0.0.0 www.counter.bloke.com +0.0.0.0 www.counterguide.com +0.0.0.0 www.counter.sexhound.nl +0.0.0.0 www.counter.superstats.com +0.0.0.0 www.c.thecounter.de +0.0.0.0 www.cw.nu +0.0.0.0 www.directgrowthhormone.com +0.0.0.0 www.dpbolvw.net +0.0.0.0 www.dwclick.com +0.0.0.0 www.easycounter.com +0.0.0.0 www.emaildeals.biz +0.0.0.0 www.estats4all.com +0.0.0.0 www.fastcounter.linkexchange.nl +0.0.0.0 www.formalyzer.com +0.0.0.0 www.foxcounter.com +0.0.0.0 www.freestats.com +0.0.0.0 www.fxcounters.com +0.0.0.0 www.gator.com +0.0.0.0 www.googkle.com +0.0.0.0 www.googletagservices.com +0.0.0.0 www.hitstats.co.uk +0.0.0.0 www.iccee.com +0.0.0.0 www.iesnare.com # See http://www.codingthewheel.com/archives/online-gambling-privacy-iesnare +0.0.0.0 www.jellycounter.com +0.0.0.0 www.kqzyfj.com +0.0.0.0 www.leadpub.com +0.0.0.0 www.linkcounter.com +0.0.0.0 www.marketscore.com +0.0.0.0 www.megacounter.de +0.0.0.0 www.metareward.com # web bugs in spam +0.0.0.0 www.naturalgrowthstore.biz +0.0.0.0 www.nedstat.com +0.0.0.0 www.nextgenstats.com +0.0.0.0 www.ntsearch.com +0.0.0.0 www.onestat.com +0.0.0.0 www.originalicons.com # installs IE extension +0.0.0.0 www.paycounter.com +0.0.0.0 www.pointclicktrack.com +0.0.0.0 www.popuptrafic.com +0.0.0.0 www.precisioncounter.com +0.0.0.0 www.premiumsmail.net +0.0.0.0 www.printmail.biz +0.0.0.0 www.quantserve.com #: Ad Tracking, JavaScript, etc. +0.0.0.0 www.quareclk.com +0.0.0.0 www.remotrk.com +0.0.0.0 www.rightmedia.net +0.0.0.0 www.rightstats.com +0.0.0.0 www.searchadv.com +0.0.0.0 www.sekel.ch +0.0.0.0 www.shockcounter.com +0.0.0.0 www.simplecounter.net +0.0.0.0 www.specificclick.com +0.0.0.0 www.specificpop.com +0.0.0.0 www.spklds.com +0.0.0.0 www.statcount.com +0.0.0.0 www.statcounter.com +0.0.0.0 www.statsession.com +0.0.0.0 www.stattrax.com +0.0.0.0 www.stiffnetwork.com +0.0.0.0 www.testracking.com +0.0.0.0 www.thecounter.com +0.0.0.0 www.the-counter.net +0.0.0.0 www.toolbarcounter.com +0.0.0.0 www.tradedoubler.com +0.0.0.0 www.tradedoubler.com.ar +0.0.0.0 www.trafficmagnet.net # web bugs in spam +0.0.0.0 www.trafic.ro +0.0.0.0 www.trendcounter.com +0.0.0.0 www.true-counter.com +0.0.0.0 www.tynt.com +0.0.0.0 www.ultimatecounter.com +0.0.0.0 www.v61.com +0.0.0.0 www.webcounter.com +0.0.0.0 www.web-stat.com +0.0.0.0 www.webstat.com +0.0.0.0 www.whereugetxxx.com +0.0.0.0 www.xxxcounter.com +0.0.0.0 x.cb.kount.com +0.0.0.0 xcnn.com +0.0.0.0 xxxcounter.com +0.0.0.0 xyz.freelogs.com +0.0.0.0 zz.cqcounter.com +# +# + +# sites with known trojans, phishing, or other malware +0.0.0.0 05tz2e9.com +0.0.0.0 09killspyware.com +0.0.0.0 11398.onceedge.ru +0.0.0.0 2006mindfreaklike.blogspot.com # Facebook trojan +0.0.0.0 20-yrs-1.info +0.0.0.0 59-106-20-39.r-bl100.sakura.ne.jp +0.0.0.0 662bd114b7c9.onceedge.ru +0.0.0.0 a15172379.alturo-server.de +0.0.0.0 aaukqiooaseseuke.org +0.0.0.0 abetterinternet.com +0.0.0.0 abruzzoinitaly.co.uk +0.0.0.0 acglgoa.com +0.0.0.0 acim.moqhixoz.cn +0.0.0.0 adshufffle.com +0.0.0.0 adwitty.com +0.0.0.0 adwords.google.lloymlincs.com +0.0.0.0 afantispy.com +0.0.0.0 afdbande.cn +0.0.0.0 allhqpics.com # Facebook trojan +0.0.0.0 alphabirdnetwork.com +0.0.0.0 antispywareexpert.com +0.0.0.0 antivirus-online-scan5.com +0.0.0.0 antivirus-scanner8.com +0.0.0.0 antivirus-scanner.com +0.0.0.0 a.oix.com +0.0.0.0 a.oix.net +0.0.0.0 armsart.com +0.0.0.0 articlefuns.cn +0.0.0.0 articleidea.cn +0.0.0.0 asianread.com +0.0.0.0 autohipnose.com +0.0.0.0 a.webwise.com +0.0.0.0 a.webwise.net +0.0.0.0 a.webwise.org +0.0.0.0 beloysoff.ru +0.0.0.0 binsservicesonline.info +0.0.0.0 blackhat.be +0.0.0.0 blenz-me.net +0.0.0.0 bnvxcfhdgf.blogspot.com.es +0.0.0.0 b.oix.com +0.0.0.0 b.oix.net +0.0.0.0 BonusCashh.com +0.0.0.0 brunga.at # Facebook phishing attempt +0.0.0.0 bt.webwise.com +0.0.0.0 bt.webwise.net +0.0.0.0 bt.webwise.org +0.0.0.0 b.webwise.com +0.0.0.0 b.webwise.net +0.0.0.0 b.webwise.org +0.0.0.0 callawaypos.com +0.0.0.0 callbling.com +0.0.0.0 cambonanza.com +0.0.0.0 ccudl.com +0.0.0.0 changduk26.com # Facebook trojan +0.0.0.0 chelick.net # Facebook trojan +0.0.0.0 cioco-froll.com +0.0.0.0 cira.login.cqr.ssl.igotmyloverback.com +0.0.0.0 cleanchain.net +0.0.0.0 click.get-answers-fast.com +0.0.0.0 clien.net +0.0.0.0 cnbc.com-article906773.us +0.0.0.0 co8vd.cn +0.0.0.0 c.oix.com +0.0.0.0 c.oix.net +0.0.0.0 conduit.com +0.0.0.0 cra-arc-gc-ca.noads.biz +0.0.0.0 custom3hurricanedigitalmedia.com +0.0.0.0 c.webwise.com +0.0.0.0 c.webwise.net +0.0.0.0 c.webwise.org +0.0.0.0 dbios.org +0.0.0.0 dhauzja511.co.cc +0.0.0.0 dietpharmacyrx.net +0.0.0.0 download.abetterinternet.com +0.0.0.0 drc-group.net +0.0.0.0 dubstep.onedumb.com +0.0.0.0 east.05tz2e9.com +0.0.0.0 e-kasa.w8w.pl +0.0.0.0 en.likefever.org # Facebook trojan +0.0.0.0 enteryouremail.net +0.0.0.0 eviboli576.o-f.com +0.0.0.0 facebook-repto1040s2.ahlamountada.com +0.0.0.0 faceboook-replyei0ki.montadalitihad.com +0.0.0.0 facemail.com +0.0.0.0 faggotry.com +0.0.0.0 familyupport1.com +0.0.0.0 feaecebook.com +0.0.0.0 fengyixin.com +0.0.0.0 filosvybfimpsv.ru.gg +0.0.0.0 froling.bee.pl +0.0.0.0 fromru.su +0.0.0.0 ftdownload.com +0.0.0.0 fu.golikeus.net # Facebook trojan +0.0.0.0 gamelights.ru +0.0.0.0 gasasthe.freehostia.com +0.0.0.0 get-answers-fast.com +0.0.0.0 gglcash4u.info # twitter worm +0.0.0.0 girlownedbypolicelike.blogspot.com # Facebook trojan +0.0.0.0 goggle.com +0.0.0.0 greatarcadehits.com +0.0.0.0 gyros.es +0.0.0.0 h1317070.stratoserver.net +0.0.0.0 hackerz.ir +0.0.0.0 hakerzy.net +0.0.0.0 hatrecord.ru # Facebook trojan +0.0.0.0 hellwert.biz +0.0.0.0 hotchix.servepics.com +0.0.0.0 hsb-canada.com # phishing site for hsbc.ca +0.0.0.0 hsbconline.ca # phishing site for hsbc.ca +0.0.0.0 icecars.com +0.0.0.0 idea21.org +0.0.0.0 Iframecash.biz +0.0.0.0 infopaypal.com +0.0.0.0 installmac.com +0.0.0.0 ipadzu.net +0.0.0.0 ircleaner.com +0.0.0.0 itwititer.com +0.0.0.0 ity.elusmedic.ru +0.0.0.0 jajajaj-thats-you-really.com +0.0.0.0 janezk.50webs.co +0.0.0.0 jujitsu-ostrava.info +0.0.0.0 jump.ewoss.net +0.0.0.0 juste.ru # Twitter trojan +0.0.0.0 kczambians.com +0.0.0.0 keybinary.com +0.0.0.0 kirgo.at # Facebook phishing attempt +0.0.0.0 klowns4phun.com +0.0.0.0 konflow.com # Facebook trojan +0.0.0.0 kplusd.far.ru +0.0.0.0 kpremium.com +0.0.0.0 lank.ru +0.0.0.0 lighthouse2k.com +0.0.0.0 like.likewut.net +0.0.0.0 likeportal.com # Facebook trojan +0.0.0.0 likespike.com # Facebook trojan +0.0.0.0 likethislist.biz # Facebook trojan +0.0.0.0 likethis.mbosoft.com # Facebook trojan +0.0.0.0 loseweight.asdjiiw.com +0.0.0.0 lucibad.home.ro +0.0.0.0 luxcart.ro +0.0.0.0 m01.oix.com +0.0.0.0 m01.oix.net +0.0.0.0 m01.webwise.com +0.0.0.0 m01.webwise.net +0.0.0.0 m01.webwise.org +0.0.0.0 m02.oix.com +0.0.0.0 m02.oix.net +0.0.0.0 m02.webwise.com +0.0.0.0 m02.webwise.net +0.0.0.0 m02.webwise.org +0.0.0.0 mail.cyberh.fr +0.0.0.0 malware-live-pro-scanv1.com +0.0.0.0 maxi4.firstvds.ru +0.0.0.0 megasurfin.com +0.0.0.0 monkeyball.osa.pl +0.0.0.0 movies.701pages.com +0.0.0.0 mplayerdownloader.com +0.0.0.0 murcia-ban.es +0.0.0.0 mylike.co.uk # Facebook trojan +0.0.0.0 nactx.com +0.0.0.0 natashyabaydesign.com +0.0.0.0 new-dating-2012.info +0.0.0.0 new-vid-zone-1.blogspot.com.au +0.0.0.0 newwayscanner.info +0.0.0.0 novemberrainx.com +0.0.0.0 ns1.oix.com +0.0.0.0 ns1.oix.net +0.0.0.0 ns1.webwise.com +0.0.0.0 ns1.webwise.net +0.0.0.0 ns1.webwise.org +0.0.0.0 ns2.oix.com +0.0.0.0 ns2.oix.net +0.0.0.0 ns2.webwise.com +0.0.0.0 ns2.webwise.net +0.0.0.0 ns2.webwise.org +0.0.0.0 nufindings.info +0.0.0.0 office.officenet.co.kr +0.0.0.0 oix.com +0.0.0.0 oix.net +0.0.0.0 oj.likewut.net +0.0.0.0 online-antispym4.com +0.0.0.0 oo-na-na-pics.com +0.0.0.0 ordersildenafil.com +0.0.0.0 otsserver.com +0.0.0.0 outerinfo.com +0.0.0.0 paincake.yoll.net +0.0.0.0 pc-scanner16.com +0.0.0.0 personalantispy.com +0.0.0.0 phatthalung.go.th +0.0.0.0 picture-uploads.com +0.0.0.0 pilltabletsrxbargain.net +0.0.0.0 powabcyfqe.com +0.0.0.0 premium-live-scan.com +0.0.0.0 products-gold.net +0.0.0.0 proflashdata.com # Facebook trojan +0.0.0.0 protectionupdatecenter.com +0.0.0.0 pv.wantsfly.com +0.0.0.0 qip.ru +0.0.0.0 qy.corrmedic.ru +0.0.0.0 rd.alphabirdnetwork.com +0.0.0.0 rickrolling.com +0.0.0.0 roifmd.info +0.0.0.0 russian-sex.com +0.0.0.0 s4d.in +0.0.0.0 scan.antispyware-free-scanner.com +0.0.0.0 scanner.best-click-av1.info +0.0.0.0 scanner.best-protect.info +0.0.0.0 scottishstuff-online.com # Canadian bank phishing site +0.0.0.0 sc-spyware.com +0.0.0.0 search.conduit.com +0.0.0.0 securedliveuploads.com +0.0.0.0 securityandroidupdate.dinamikaprinting.com +0.0.0.0 securityscan.us +0.0.0.0 sexymarissa.net +0.0.0.0 shell.xhhow4.com +0.0.0.0 shoppstop.comood.opsource.net +0.0.0.0 shop.skin-safety.com +0.0.0.0 signin-ebay-com-ws-ebayisapi-dll-signin-webscr.ocom.pl +0.0.0.0 sinera.org +0.0.0.0 sjguild.com +0.0.0.0 smarturl.it +0.0.0.0 smile-angel.com +0.0.0.0 software-updates.co +0.0.0.0 software-wenc.co.cc +0.0.0.0 someonewhocares.com +0.0.0.0 sousay.info +0.0.0.0 start.qip.ru +0.0.0.0 superegler.net +0.0.0.0 supernaturalart.com +0.0.0.0 superprotection10.com +0.0.0.0 sverd.net +0.0.0.0 tahoesup.com +0.0.0.0 tattooshaha.info # Facebook trojan +0.0.0.0 test.ishvara-yoga.com +0.0.0.0 TheBizMeet.com +0.0.0.0 thedatesafe.com # Facebook trojan +0.0.0.0 themoneyclippodcast.com +0.0.0.0 themusicnetwork.co.uk +0.0.0.0 thinstall.abetterinternet.com +0.0.0.0 tivvitter.com +0.0.0.0 tomorrownewstoday.com # I'm not sure what it does, but it seems to be associated with a phishing attempt on Facebook +0.0.0.0 toolbarbest.biz +0.0.0.0 toolbarbucks.biz +0.0.0.0 toolbarcool.biz +0.0.0.0 toolbardollars.biz +0.0.0.0 toolbarmoney.biz +0.0.0.0 toolbarnew.biz +0.0.0.0 toolbarsale.biz +0.0.0.0 toolbarweb.biz +0.0.0.0 traffic.adwitty.com +0.0.0.0 trialreg.com +0.0.0.0 tvshowslist.com +0.0.0.0 twitter.login.kevanshome.org +0.0.0.0 twitter.secure.bzpharma.net +0.0.0.0 uawj.moqhixoz.cn +0.0.0.0 ughmvqf.spitt.ru +0.0.0.0 uqz.com +0.0.0.0 users16.jabry.com +0.0.0.0 utenti.lycos.it +0.0.0.0 vcipo.info +0.0.0.0 videos.dskjkiuw.com +0.0.0.0 videos.twitter.secure-logins01.com # twitter worm (http://mashable.com/2009/09/23/twitter-worm-dms/) +0.0.0.0 vxiframe.biz +0.0.0.0 waldenfarms.com +0.0.0.0 weblover.info +0.0.0.0 webpaypal.com +0.0.0.0 webwise.com +0.0.0.0 webwise.net +0.0.0.0 webwise.org +0.0.0.0 west.05tz2e9.com +0.0.0.0 wewillrocknow.com +0.0.0.0 willysy.com +0.0.0.0 wm.maxysearch.info +0.0.0.0 womo.corrmedic.ru +0.0.0.0 www1.bmo.com.hotfrio.com.br +0.0.0.0 www1.firesavez5.com +0.0.0.0 www1.firesavez6.com +0.0.0.0 www1.realsoft34.com +0.0.0.0 www4.gy7k.net +0.0.0.0 www.abetterinternet.com +0.0.0.0 www.adshufffle.com +0.0.0.0 www.adwords.google.lloymlincs.com +0.0.0.0 www.afantispy.com +0.0.0.0 www.akoneplatit.sk +0.0.0.0 www.allhqpics.com # Facebook trojan +0.0.0.0 www.alrpost69.com +0.0.0.0 www.anatol.com +0.0.0.0 www.articlefuns.cn +0.0.0.0 www.articleidea.cn +0.0.0.0 www.asianread.com +0.0.0.0 www.backsim.ru +0.0.0.0 www.bankofamerica.com.ok.am +0.0.0.0 www.be4life.ru +0.0.0.0 www.blenz-me.net +0.0.0.0 www.cambonanza.com +0.0.0.0 www.chelick.net # Facebook trojan +0.0.0.0 www.didata.bw +0.0.0.0 www.dietsecret.ru +0.0.0.0 www.eroyear.ru +0.0.0.0 www.exbays.com +0.0.0.0 www.faggotry.com +0.0.0.0 www.feaecebook.com +0.0.0.0 www.fictioncinema.com +0.0.0.0 www.fischereszter.hu +0.0.0.0 www.froling.bee.pl +0.0.0.0 www.gns-consola.com +0.0.0.0 www.goggle.com +0.0.0.0 www.grouphappy.com +0.0.0.0 www.hakerzy.net +0.0.0.0 www.haoyunlaid.com +0.0.0.0 www.icecars.com +0.0.0.0 www.indesignstudioinfo.com +0.0.0.0 www.infopaypal.com +0.0.0.0 www.keybinary.com +0.0.0.0 www.kinomarathon.ru +0.0.0.0 www.kpremium.com +0.0.0.0 www.likeportal.com # Facebook trojan +0.0.0.0 www.likespike.com # Facebook trojan +0.0.0.0 www.likethislist.biz # Facebook trojan +0.0.0.0 www.likethis.mbosoft.com # Facebook trojan +0.0.0.0 www.lomalindasda.org # Facebook trojan +0.0.0.0 www.lovecouple.ru +0.0.0.0 www.lovetrust.ru +0.0.0.0 www.mikras.nl +0.0.0.0 www.monkeyball.osa.pl +0.0.0.0 www.monsonis.net +0.0.0.0 www.movie-port.ru +0.0.0.0 www.mplayerdownloader.com +0.0.0.0 www.mylike.co.uk # Facebook trojan +0.0.0.0 www.mylovecards.com +0.0.0.0 www.nine2rack.in +0.0.0.0 www.novemberrainx.com +0.0.0.0 www.nu26.com +0.0.0.0 www.oix.com +0.0.0.0 www.oix.net +0.0.0.0 www.onlyfreeoffersonline.com +0.0.0.0 www.oreidofitilho.com.br +0.0.0.0 www.otsserver.com +0.0.0.0 www.pay-pal.com-cgibin-canada.4mcmeta4v.cn +0.0.0.0 www.picture-uploads.com +0.0.0.0 www.portaldimensional.com +0.0.0.0 www.poxudeli.ru +0.0.0.0 www.proflashdata.com # Facebook trojan +0.0.0.0 www.rickrolling.com +0.0.0.0 www.russian-sex.com +0.0.0.0 www.scotiaonline.scotiabank.salferreras.com +0.0.0.0 www.sdlpgift.com +0.0.0.0 www.securityscan.us +0.0.0.0 www.servertasarimbu.com +0.0.0.0 www.sexytiger.ru +0.0.0.0 www.shinilchurch.net # domain was hacked and had a trojan installed +0.0.0.0 www.sinera.org +0.0.0.0 www.someonewhocares.com +0.0.0.0 www.tanger.com.br +0.0.0.0 www.tattooshaha.info # Facebook trojan +0.0.0.0 www.te81.net +0.0.0.0 www.thedatesafe.com # Facebook trojan +0.0.0.0 www.trucktirehotline.com +0.0.0.0 www.tvshowslist.com +0.0.0.0 www.upi6.pillsstore-c.com # Facebook trojan +0.0.0.0 www.uqz.com +0.0.0.0 www.via99.org +0.0.0.0 www.videolove.clanteam.com +0.0.0.0 www.videostan.ru +0.0.0.0 www.vippotexa.ru +0.0.0.0 www.wantsfly.com +0.0.0.0 www.webpaypal.com +0.0.0.0 www.webwise.com +0.0.0.0 www.webwise.net +0.0.0.0 www.webwise.org +0.0.0.0 www.wewillrocknow.com +0.0.0.0 www.willysy.com +0.0.0.0 xfotosx01.fromru.su +0.0.0.0 xponlinescanner.com +0.0.0.0 xvrxyzba253.hotmail.ru +0.0.0.0 yrwap.cn +0.0.0.0 zarozinski.info +0.0.0.0 zettapetta.com +0.0.0.0 zfotos.fromru.su +0.0.0.0 zip.er.cz +0.0.0.0 ztrf.net +0.0.0.0 zviframe.biz +# + +# + +0.0.0.0 3ad.doubleclick.net +0.0.0.0 ad2.doubleclick.net +0.0.0.0 ad.3au.doubleclick.net +0.0.0.0 ad.ae.doubleclick.net +0.0.0.0 ad.au.doubleclick.net +0.0.0.0 ad.be.doubleclick.net +0.0.0.0 ad.br.doubleclick.net +0.0.0.0 ad.de.doubleclick.net +0.0.0.0 ad.dk.doubleclick.net +0.0.0.0 ad-emea.doubleclick.net +0.0.0.0 ad.es.doubleclick.net +0.0.0.0 ad.fi.doubleclick.net +0.0.0.0 ad.fr.doubleclick.net +0.0.0.0 ad-g.doubleclick.net +0.0.0.0 ad.it.doubleclick.net +0.0.0.0 ad.jp.doubleclick.net +0.0.0.0 ad.mo.doubleclick.net +0.0.0.0 ad.n2434.doubleclick.net +0.0.0.0 ad.nl.doubleclick.net +0.0.0.0 ad.no.doubleclick.net +0.0.0.0 ad.nz.doubleclick.net +0.0.0.0 ad.pl.doubleclick.net +0.0.0.0 ad.se.doubleclick.net +0.0.0.0 ad.sg.doubleclick.net +0.0.0.0 ad.uk.doubleclick.net +0.0.0.0 ad.ve.doubleclick.net +0.0.0.0 ad-yt-bfp.doubleclick.net +0.0.0.0 ad.za.doubleclick.net +0.0.0.0 amn.doubleclick.net +0.0.0.0 creative.cc-dt.com +0.0.0.0 doubleclick.de +0.0.0.0 doubleclick.net +0.0.0.0 ebaycn.doubleclick.net +0.0.0.0 ebaytw.doubleclick.net +0.0.0.0 exnjadgda1.doubleclick.net +0.0.0.0 exnjadgda2.doubleclick.net +0.0.0.0 exnjadgds1.doubleclick.net +0.0.0.0 exnjmdgda1.doubleclick.net +0.0.0.0 exnjmdgds1.doubleclick.net +0.0.0.0 feedads.g.doubleclick.net +0.0.0.0 fls.doubleclick.net +0.0.0.0 gd10.doubleclick.net +0.0.0.0 gd11.doubleclick.net +0.0.0.0 gd12.doubleclick.net +0.0.0.0 gd13.doubleclick.net +0.0.0.0 gd14.doubleclick.net +0.0.0.0 gd15.doubleclick.net +0.0.0.0 gd16.doubleclick.net +0.0.0.0 gd17.doubleclick.net +0.0.0.0 gd18.doubleclick.net +0.0.0.0 gd19.doubleclick.net +0.0.0.0 gd1.doubleclick.net +0.0.0.0 gd20.doubleclick.net +0.0.0.0 gd21.doubleclick.net +0.0.0.0 gd22.doubleclick.net +0.0.0.0 gd23.doubleclick.net +0.0.0.0 gd24.doubleclick.net +0.0.0.0 gd25.doubleclick.net +0.0.0.0 gd26.doubleclick.net +0.0.0.0 gd27.doubleclick.net +0.0.0.0 gd28.doubleclick.net +0.0.0.0 gd29.doubleclick.net +0.0.0.0 gd2.doubleclick.net +0.0.0.0 gd30.doubleclick.net +0.0.0.0 gd31.doubleclick.net +0.0.0.0 gd3.doubleclick.net +0.0.0.0 gd4.doubleclick.net +0.0.0.0 gd5.doubleclick.net +0.0.0.0 gd7.doubleclick.net +0.0.0.0 gd8.doubleclick.net +0.0.0.0 gd9.doubleclick.net +0.0.0.0 googleads.g.doubleclick.net +0.0.0.0 iv.doubleclick.net +0.0.0.0 ln.doubleclick.net +0.0.0.0 m1.2mdn.net +0.0.0.0 m1.ae.2mdn.net +0.0.0.0 m1.au.2mdn.net +0.0.0.0 m1.be.2mdn.net +0.0.0.0 m1.br.2mdn.net +0.0.0.0 m1.ca.2mdn.net +0.0.0.0 m1.cn.2mdn.net +0.0.0.0 m1.de.2mdn.net +0.0.0.0 m1.dk.2mdn.net +0.0.0.0 m1.doubleclick.net +0.0.0.0 m1.es.2mdn.net +0.0.0.0 m1.fi.2mdn.net +0.0.0.0 m1.fr.2mdn.net +0.0.0.0 m1.it.2mdn.net +0.0.0.0 m1.jp.2mdn.net +0.0.0.0 m1.nl.2mdn.net +0.0.0.0 m1.no.2mdn.net +0.0.0.0 m1.nz.2mdn.net +0.0.0.0 m1.pl.2mdn.net +0.0.0.0 m1.se.2mdn.net +0.0.0.0 m1.sg.2mdn.net +0.0.0.0 m1.uk.2mdn.net +0.0.0.0 m1.ve.2mdn.net +0.0.0.0 m1.za.2mdn.net +0.0.0.0 m2.ae.2mdn.net +0.0.0.0 m2.au.2mdn.net +0.0.0.0 m2.be.2mdn.net +0.0.0.0 m2.br.2mdn.net +0.0.0.0 m2.ca.2mdn.net +0.0.0.0 m2.cn.2mdn.net +0.0.0.0 m2.cn.doubleclick.net +0.0.0.0 m2.de.2mdn.net +0.0.0.0 m2.dk.2mdn.net +0.0.0.0 m2.doubleclick.net +0.0.0.0 m2.es.2mdn.net +0.0.0.0 m2.fi.2mdn.net +0.0.0.0 m2.fr.2mdn.net +0.0.0.0 m2.it.2mdn.net +0.0.0.0 m2.jp.2mdn.net +0.0.0.0 m.2mdn.net +0.0.0.0 m2.nl.2mdn.net +0.0.0.0 m2.no.2mdn.net +0.0.0.0 m2.nz.2mdn.net +0.0.0.0 m2.pl.2mdn.net +0.0.0.0 m2.se.2mdn.net +0.0.0.0 m2.sg.2mdn.net +0.0.0.0 m2.uk.2mdn.net +0.0.0.0 m2.ve.2mdn.net +0.0.0.0 m2.za.2mdn.net +0.0.0.0 m3.ae.2mdn.net +0.0.0.0 m3.au.2mdn.net +0.0.0.0 m3.be.2mdn.net +0.0.0.0 m3.br.2mdn.net +0.0.0.0 m3.ca.2mdn.net +0.0.0.0 m3.cn.2mdn.net +0.0.0.0 m3.de.2mdn.net +0.0.0.0 m3.dk.2mdn.net +0.0.0.0 m3.doubleclick.net +0.0.0.0 m3.es.2mdn.net +0.0.0.0 m3.fi.2mdn.net +0.0.0.0 m3.fr.2mdn.net +0.0.0.0 m3.it.2mdn.net +0.0.0.0 m3.jp.2mdn.net +0.0.0.0 m3.nl.2mdn.net +0.0.0.0 m3.no.2mdn.net +0.0.0.0 m3.nz.2mdn.net +0.0.0.0 m3.pl.2mdn.net +0.0.0.0 m3.se.2mdn.net +0.0.0.0 m3.sg.2mdn.net +0.0.0.0 m3.uk.2mdn.net +0.0.0.0 m3.ve.2mdn.net +0.0.0.0 m3.za.2mdn.net +0.0.0.0 m4.ae.2mdn.net +0.0.0.0 m4.au.2mdn.net +0.0.0.0 m4.be.2mdn.net +0.0.0.0 m4.br.2mdn.net +0.0.0.0 m4.ca.2mdn.net +0.0.0.0 m4.cn.2mdn.net +0.0.0.0 m4.de.2mdn.net +0.0.0.0 m4.dk.2mdn.net +0.0.0.0 m4.doubleclick.net +0.0.0.0 m4.es.2mdn.net +0.0.0.0 m4.fi.2mdn.net +0.0.0.0 m4.fr.2mdn.net +0.0.0.0 m4.it.2mdn.net +0.0.0.0 m4.jp.2mdn.net +0.0.0.0 m4.nl.2mdn.net +0.0.0.0 m4.no.2mdn.net +0.0.0.0 m4.nz.2mdn.net +0.0.0.0 m4.pl.2mdn.net +0.0.0.0 m4.se.2mdn.net +0.0.0.0 m4.sg.2mdn.net +0.0.0.0 m4.uk.2mdn.net +0.0.0.0 m4.ve.2mdn.net +0.0.0.0 m4.za.2mdn.net +0.0.0.0 m5.ae.2mdn.net +0.0.0.0 m5.au.2mdn.net +0.0.0.0 m5.be.2mdn.net +0.0.0.0 m5.br.2mdn.net +0.0.0.0 m5.ca.2mdn.net +0.0.0.0 m5.cn.2mdn.net +0.0.0.0 m5.de.2mdn.net +0.0.0.0 m5.dk.2mdn.net +0.0.0.0 m5.doubleclick.net +0.0.0.0 m5.es.2mdn.net +0.0.0.0 m5.fi.2mdn.net +0.0.0.0 m5.fr.2mdn.net +0.0.0.0 m5.it.2mdn.net +0.0.0.0 m5.jp.2mdn.net +0.0.0.0 m5.nl.2mdn.net +0.0.0.0 m5.no.2mdn.net +0.0.0.0 m5.nz.2mdn.net +0.0.0.0 m5.pl.2mdn.net +0.0.0.0 m5.se.2mdn.net +0.0.0.0 m5.sg.2mdn.net +0.0.0.0 m5.uk.2mdn.net +0.0.0.0 m5.ve.2mdn.net +0.0.0.0 m5.za.2mdn.net +0.0.0.0 m6.ae.2mdn.net +0.0.0.0 m6.au.2mdn.net +0.0.0.0 m6.be.2mdn.net +0.0.0.0 m6.br.2mdn.net +0.0.0.0 m6.ca.2mdn.net +0.0.0.0 m6.cn.2mdn.net +0.0.0.0 m6.de.2mdn.net +0.0.0.0 m6.dk.2mdn.net +0.0.0.0 m6.doubleclick.net +0.0.0.0 m6.es.2mdn.net +0.0.0.0 m6.fi.2mdn.net +0.0.0.0 m6.fr.2mdn.net +0.0.0.0 m6.it.2mdn.net +0.0.0.0 m6.jp.2mdn.net +0.0.0.0 m6.nl.2mdn.net +0.0.0.0 m6.no.2mdn.net +0.0.0.0 m6.nz.2mdn.net +0.0.0.0 m6.pl.2mdn.net +0.0.0.0 m6.se.2mdn.net +0.0.0.0 m6.sg.2mdn.net +0.0.0.0 m6.uk.2mdn.net +0.0.0.0 m6.ve.2mdn.net +0.0.0.0 m6.za.2mdn.net +0.0.0.0 m7.ae.2mdn.net +0.0.0.0 m7.au.2mdn.net +0.0.0.0 m7.be.2mdn.net +0.0.0.0 m7.br.2mdn.net +0.0.0.0 m7.ca.2mdn.net +0.0.0.0 m7.cn.2mdn.net +0.0.0.0 m7.de.2mdn.net +0.0.0.0 m7.dk.2mdn.net +0.0.0.0 m7.doubleclick.net +0.0.0.0 m7.es.2mdn.net +0.0.0.0 m7.fi.2mdn.net +0.0.0.0 m7.fr.2mdn.net +0.0.0.0 m7.it.2mdn.net +0.0.0.0 m7.jp.2mdn.net +0.0.0.0 m7.nl.2mdn.net +0.0.0.0 m7.no.2mdn.net +0.0.0.0 m7.nz.2mdn.net +0.0.0.0 m7.pl.2mdn.net +0.0.0.0 m7.se.2mdn.net +0.0.0.0 m7.sg.2mdn.net +0.0.0.0 m7.uk.2mdn.net +0.0.0.0 m7.ve.2mdn.net +0.0.0.0 m7.za.2mdn.net +0.0.0.0 m8.ae.2mdn.net +0.0.0.0 m8.au.2mdn.net +0.0.0.0 m8.be.2mdn.net +0.0.0.0 m8.br.2mdn.net +0.0.0.0 m8.ca.2mdn.net +0.0.0.0 m8.cn.2mdn.net +0.0.0.0 m8.de.2mdn.net +0.0.0.0 m8.dk.2mdn.net +0.0.0.0 m8.doubleclick.net +0.0.0.0 m8.es.2mdn.net +0.0.0.0 m8.fi.2mdn.net +0.0.0.0 m8.fr.2mdn.net +0.0.0.0 m8.it.2mdn.net +0.0.0.0 m8.jp.2mdn.net +0.0.0.0 m8.nl.2mdn.net +0.0.0.0 m8.no.2mdn.net +0.0.0.0 m8.nz.2mdn.net +0.0.0.0 m8.pl.2mdn.net +0.0.0.0 m8.se.2mdn.net +0.0.0.0 m8.sg.2mdn.net +0.0.0.0 m8.uk.2mdn.net +0.0.0.0 m8.ve.2mdn.net +0.0.0.0 m8.za.2mdn.net +0.0.0.0 m9.ae.2mdn.net +0.0.0.0 m9.au.2mdn.net +0.0.0.0 m9.be.2mdn.net +0.0.0.0 m9.br.2mdn.net +0.0.0.0 m9.ca.2mdn.net +0.0.0.0 m9.cn.2mdn.net +0.0.0.0 m9.de.2mdn.net +0.0.0.0 m9.dk.2mdn.net +0.0.0.0 m9.doubleclick.net +0.0.0.0 m9.es.2mdn.net +0.0.0.0 m9.fi.2mdn.net +0.0.0.0 m9.fr.2mdn.net +0.0.0.0 m9.it.2mdn.net +0.0.0.0 m9.jp.2mdn.net +0.0.0.0 m9.nl.2mdn.net +0.0.0.0 m9.no.2mdn.net +0.0.0.0 m9.nz.2mdn.net +0.0.0.0 m9.pl.2mdn.net +0.0.0.0 m9.se.2mdn.net +0.0.0.0 m9.sg.2mdn.net +0.0.0.0 m9.uk.2mdn.net +0.0.0.0 m9.ve.2mdn.net +0.0.0.0 m9.za.2mdn.net +0.0.0.0 m.de.2mdn.net +0.0.0.0 m.doubleclick.net +0.0.0.0 n3302ad.doubleclick.net +0.0.0.0 n3349ad.doubleclick.net +0.0.0.0 n4061ad.doubleclick.net +0.0.0.0 n4403ad.doubleclick.net +0.0.0.0 n479ad.doubleclick.net +0.0.0.0 optimize.doubleclick.net +0.0.0.0 pubads.g.doubleclick.net +0.0.0.0 rd.intl.doubleclick.net +0.0.0.0 securepubads.g.doubleclick.net +0.0.0.0 stats.g.doubleclick.net +0.0.0.0 twx.2mdn.net +0.0.0.0 twx.doubleclick.net +0.0.0.0 ukrpts.net +0.0.0.0 uunyadgda1.doubleclick.net +0.0.0.0 uunyadgds1.doubleclick.net +0.0.0.0 www.ukrpts.net +# + +# + +0.0.0.0 1up.us.intellitxt.com +0.0.0.0 5starhiphop.us.intellitxt.com +0.0.0.0 askmen2.us.intellitxt.com +0.0.0.0 bargainpda.us.intellitxt.com +0.0.0.0 businesspundit.us.intellitxt.com +0.0.0.0 canadafreepress.us.intellitxt.com +0.0.0.0 contactmusic.uk.intellitxt.com +0.0.0.0 ctv.us.intellitxt.com +0.0.0.0 designtechnica.us.intellitxt.com +0.0.0.0 devshed.us.intellitxt.com +0.0.0.0 digitaltrends.us.intellitxt.com +0.0.0.0 dnps.us.intellitxt.com +0.0.0.0 doubleviking.us.intellitxt.com +0.0.0.0 drizzydrake.us.intellitxt.com +0.0.0.0 ehow.us.intellitxt.com +0.0.0.0 entertainment.msnbc.us.intellitxt.com +0.0.0.0 examnotes.us.intellitxt.com +0.0.0.0 excite.us.intellitxt.com +0.0.0.0 experts.us.intellitxt.com +0.0.0.0 extremetech.us.intellitxt.com +0.0.0.0 ferrago.uk.intellitxt.com +0.0.0.0 filmschoolrejects.us.intellitxt.com +0.0.0.0 filmwad.us.intellitxt.com +0.0.0.0 firstshowing.us.intellitxt.com +0.0.0.0 flashmagazine.us.intellitxt.com +0.0.0.0 foxnews.us.intellitxt.com +0.0.0.0 foxtv.us.intellitxt.com +0.0.0.0 freedownloadcenter.uk.intellitxt.com +0.0.0.0 gadgets.fosfor.se.intellitxt.com +0.0.0.0 gamesradar.us.intellitxt.com +0.0.0.0 gannettbroadcast.us.intellitxt.com +0.0.0.0 gonintendo.us.intellitxt.com +0.0.0.0 gorillanation.us.intellitxt.com +0.0.0.0 hackedgadgets.us.intellitxt.com +0.0.0.0 hardcoreware.us.intellitxt.com +0.0.0.0 hardocp.us.intellitxt.com +0.0.0.0 hothardware.us.intellitxt.com +0.0.0.0 hotonlinenews.us.intellitxt.com +0.0.0.0 ign.us.intellitxt.com +0.0.0.0 images.intellitxt.com +0.0.0.0 itxt2.us.intellitxt.com +0.0.0.0 joblo.us.intellitxt.com +0.0.0.0 johnchow.us.intellitxt.com +0.0.0.0 laptopmag.us.intellitxt.com +0.0.0.0 linuxforums.us.intellitxt.com +0.0.0.0 maccity.it.intellitxt.com +0.0.0.0 macnn.us.intellitxt.com +0.0.0.0 macuser.uk.intellitxt.com +0.0.0.0 macworld.uk.intellitxt.com +0.0.0.0 metro.uk.intellitxt.com +0.0.0.0 mobile9.us.intellitxt.com +0.0.0.0 monstersandcritics.uk.intellitxt.com +0.0.0.0 moviesonline.ca.intellitxt.com +0.0.0.0 mustangevolution.us.intellitxt.com +0.0.0.0 neowin.us.intellitxt.com +0.0.0.0 newcarnet.uk.intellitxt.com +0.0.0.0 newlaunches.uk.intellitxt.com +0.0.0.0 nexys404.us.intellitxt.com +0.0.0.0 ohgizmo.us.intellitxt.com +0.0.0.0 pcadvisor.uk.intellitxt.com +0.0.0.0 pcgameshardware.de.intellitxt.com +0.0.0.0 pcmag.us.intellitxt.com +0.0.0.0 pcper.us.intellitxt.com +0.0.0.0 penton.us.intellitxt.com +0.0.0.0 physorg.uk.intellitxt.com +0.0.0.0 physorg.us.intellitxt.com +0.0.0.0 playfuls.uk.intellitxt.com +0.0.0.0 pocketlint.uk.intellitxt.com +0.0.0.0 popularmechanics.us.intellitxt.com +0.0.0.0 postchronicle.us.intellitxt.com +0.0.0.0 projectorreviews.us.intellitxt.com +0.0.0.0 psp3d.us.intellitxt.com +0.0.0.0 pspcave.uk.intellitxt.com +0.0.0.0 qj.us.intellitxt.com +0.0.0.0 rasmussenreports.us.intellitxt.com +0.0.0.0 rawstory.us.intellitxt.com +0.0.0.0 savemanny.us.intellitxt.com +0.0.0.0 sc.intellitxt.com +0.0.0.0 siliconera.us.intellitxt.com +0.0.0.0 slashphone.us.intellitxt.com +0.0.0.0 soft32.us.intellitxt.com +0.0.0.0 softpedia.uk.intellitxt.com +0.0.0.0 somethingawful.us.intellitxt.com +0.0.0.0 splashnews.uk.intellitxt.com +0.0.0.0 spymac.us.intellitxt.com +0.0.0.0 techeblog.us.intellitxt.com +0.0.0.0 technewsworld.us.intellitxt.com +0.0.0.0 technologyreview.us.intellitxt.com +0.0.0.0 techspot.us.intellitxt.com +0.0.0.0 tgdaily.us.intellitxt.com +0.0.0.0 the-gadgeteer.us.intellitxt.com +0.0.0.0 thelastboss.us.intellitxt.com +0.0.0.0 thetechzone.us.intellitxt.com +0.0.0.0 thoughtsmedia.us.intellitxt.com +0.0.0.0 tmcnet.us.intellitxt.com +0.0.0.0 tomsnetworking.us.intellitxt.com +0.0.0.0 toms.us.intellitxt.com +0.0.0.0 tribal.us.intellitxt.com # vibrantmedia.com +0.0.0.0 universetoday.us.intellitxt.com +0.0.0.0 us.intellitxt.com +0.0.0.0 warp2search.us.intellitxt.com +0.0.0.0 wi-fitechnology.uk.intellitxt.com +0.0.0.0 worldnetdaily.us.intellitxt.com +# + +# + +# Red Sheriff and imrworldwide.com -- server side tracking +0.0.0.0 devfw.imrworldwide.com +0.0.0.0 fe1-au.imrworldwide.com +0.0.0.0 fe1-fi.imrworldwide.com +0.0.0.0 fe1-it.imrworldwide.com +0.0.0.0 fe2-au.imrworldwide.com +0.0.0.0 fe3-au.imrworldwide.com +0.0.0.0 fe3-gc.imrworldwide.com +0.0.0.0 fe3-uk.imrworldwide.com +0.0.0.0 fe4-uk.imrworldwide.com +0.0.0.0 fe-au.imrworldwide.com +0.0.0.0 imrworldwide.com +0.0.0.0 lycos-eu.imrworldwide.com +0.0.0.0 ninemsn.imrworldwide.com +0.0.0.0 rc-au.imrworldwide.com +0.0.0.0 redsheriff.com +#0.0.0.0 secure-au.imrworldwide.com +0.0.0.0 secure-jp.imrworldwide.com +0.0.0.0 secure-nz.imrworldwide.com +0.0.0.0 secure-uk.imrworldwide.com +0.0.0.0 secure-us.imrworldwide.com +0.0.0.0 secure-za.imrworldwide.com +0.0.0.0 server-au.imrworldwide.com +0.0.0.0 server-br.imrworldwide.com +0.0.0.0 server-by.imrworldwide.com +0.0.0.0 server-ca.imrworldwide.com +0.0.0.0 server-de.imrworldwide.com +0.0.0.0 server-dk.imrworldwide.com +0.0.0.0 server-ee.imrworldwide.com +0.0.0.0 server-fi.imrworldwide.com +0.0.0.0 server-fr.imrworldwide.com +0.0.0.0 server-hk.imrworldwide.com +0.0.0.0 server-it.imrworldwide.com +0.0.0.0 server-jp.imrworldwide.com +0.0.0.0 server-lt.imrworldwide.com +0.0.0.0 server-lv.imrworldwide.com +0.0.0.0 server-no.imrworldwide.com +0.0.0.0 server-nz.imrworldwide.com +0.0.0.0 server-oslo.imrworldwide.com +0.0.0.0 server-pl.imrworldwide.com +0.0.0.0 server-ru.imrworldwide.com +0.0.0.0 server-se.imrworldwide.com +0.0.0.0 server-sg.imrworldwide.com +0.0.0.0 server-stockh.imrworldwide.com +0.0.0.0 server-ua.imrworldwide.com +0.0.0.0 server-uk.imrworldwide.com +0.0.0.0 server-us.imrworldwide.com +0.0.0.0 server-za.imrworldwide.com +0.0.0.0 survey1-au.imrworldwide.com +0.0.0.0 telstra.imrworldwide.com +0.0.0.0 www.imrworldwide.com +0.0.0.0 www.imrworldwide.com.au +0.0.0.0 www.redsheriff.com +# + +# + +# cydoor -- server side tracking +0.0.0.0 cydoor.com +0.0.0.0 j.2004cms.com # cydoor +0.0.0.0 jbaventures.cjt1.net +0.0.0.0 jbeet.cjt1.net +0.0.0.0 jbit.cjt1.net +0.0.0.0 jcollegehumor.cjt1.net +0.0.0.0 jcontent.bns1.net +0.0.0.0 jdownloadacc.cjt1.net +0.0.0.0 jgen10.cjt1.net +0.0.0.0 jgen11.cjt1.net +0.0.0.0 jgen12.cjt1.net +0.0.0.0 jgen13.cjt1.net +0.0.0.0 jgen14.cjt1.net +0.0.0.0 jgen15.cjt1.net +0.0.0.0 jgen16.cjt1.net +0.0.0.0 jgen17.cjt1.net +0.0.0.0 jgen18.cjt1.net +0.0.0.0 jgen19.cjt1.net +0.0.0.0 jgen1.cjt1.net +0.0.0.0 jgen20.cjt1.net +0.0.0.0 jgen21.cjt1.net +0.0.0.0 jgen22.cjt1.net +0.0.0.0 jgen23.cjt1.net +0.0.0.0 jgen24.cjt1.net +0.0.0.0 jgen25.cjt1.net +0.0.0.0 jgen26.cjt1.net +0.0.0.0 jgen27.cjt1.net +0.0.0.0 jgen28.cjt1.net +0.0.0.0 jgen29.cjt1.net +0.0.0.0 jgen2.cjt1.net +0.0.0.0 jgen30.cjt1.net +0.0.0.0 jgen31.cjt1.net +0.0.0.0 jgen32.cjt1.net +0.0.0.0 jgen33.cjt1.net +0.0.0.0 jgen34.cjt1.net +0.0.0.0 jgen35.cjt1.net +0.0.0.0 jgen36.cjt1.net +0.0.0.0 jgen37.cjt1.net +0.0.0.0 jgen38.cjt1.net +0.0.0.0 jgen39.cjt1.net +0.0.0.0 jgen3.cjt1.net +0.0.0.0 jgen40.cjt1.net +0.0.0.0 jgen41.cjt1.net +0.0.0.0 jgen42.cjt1.net +0.0.0.0 jgen43.cjt1.net +0.0.0.0 jgen44.cjt1.net +0.0.0.0 jgen45.cjt1.net +0.0.0.0 jgen46.cjt1.net +0.0.0.0 jgen47.cjt1.net +0.0.0.0 jgen48.cjt1.net +0.0.0.0 jgen49.cjt1.net +0.0.0.0 jgen4.cjt1.net +0.0.0.0 jgen5.cjt1.net +0.0.0.0 jgen6.cjt1.net +0.0.0.0 jgen7.cjt1.net +0.0.0.0 jgen8.cjt1.net +0.0.0.0 jgen9.cjt1.net +0.0.0.0 jhumour.cjt1.net +0.0.0.0 jmbi58.cjt1.net +0.0.0.0 jnova.cjt1.net +0.0.0.0 jpirate.cjt1.net +0.0.0.0 jsandboxer.cjt1.net +0.0.0.0 jumcna.cjt1.net +0.0.0.0 jwebbsense.cjt1.net +0.0.0.0 www.cydoor.com +# + +#<2o7-sites> + +# 2o7.net -- server side tracking +0.0.0.0 102.112.2o7.net +0.0.0.0 102.122.2o7.net +0.0.0.0 112.2o7.net +0.0.0.0 122.2o7.net +0.0.0.0 192.168.112.2o7.net +0.0.0.0 2o7.net +0.0.0.0 actforvictory.112.2o7.net +0.0.0.0 adbrite.112.2o7.net +0.0.0.0 adbrite.122.2o7.net +0.0.0.0 aehistory.112.2o7.net +0.0.0.0 aetv.112.2o7.net +0.0.0.0 agamgreetingscom.112.2o7.net +0.0.0.0 allbritton.122.2o7.net +0.0.0.0 americanbaby.112.2o7.net +0.0.0.0 ancestrymsn.112.2o7.net +0.0.0.0 ancestryuki.112.2o7.net +0.0.0.0 angiba.112.2o7.net +0.0.0.0 angmar.112.2o7.net +0.0.0.0 angtr.112.2o7.net +0.0.0.0 angts.112.2o7.net +0.0.0.0 angvac.112.2o7.net +0.0.0.0 anm.112.2o7.net +0.0.0.0 aolcareers.122.2o7.net +0.0.0.0 aoldlama.122.2o7.net +0.0.0.0 aoljournals.122.2o7.net +0.0.0.0 aolnsnews.122.2o7.net +0.0.0.0 aolpf.122.2o7.net +0.0.0.0 aolpolls.112.2o7.net +0.0.0.0 aolpolls.122.2o7.net +0.0.0.0 aolsearch.122.2o7.net +0.0.0.0 aolsvc.122.2o7.net +0.0.0.0 aoltmz.122.2o7.net +0.0.0.0 aolturnercnnmoney.112.2o7.net +0.0.0.0 aolturnercnnmoney.122.2o7.net +0.0.0.0 aolturnersi.122.2o7.net +0.0.0.0 aolukglobal.122.2o7.net +0.0.0.0 aolwinamp.122.2o7.net +0.0.0.0 aolwpaim.112.2o7.net +0.0.0.0 aolwpicq.122.2o7.net +0.0.0.0 aolwpmq.112.2o7.net +0.0.0.0 aolwpmqnoban.112.2o7.net +0.0.0.0 apdigitalorg.112.2o7.net +0.0.0.0 apdigitalorgovn.112.2o7.net +0.0.0.0 apnonline.112.2o7.net +#0.0.0.0 appleglobal.112.2o7.net #breaks apple.com +#0.0.0.0 applestoreus.112.2o7.net #breaks apple.com +0.0.0.0 atlassian.122.2o7.net +0.0.0.0 autobytel.112.2o7.net +0.0.0.0 autoweb.112.2o7.net +0.0.0.0 bbcnewscouk.112.2o7.net +0.0.0.0 bellca.112.2o7.net +0.0.0.0 bellglobemediapublishing.122.2o7.net +0.0.0.0 bellglovemediapublishing.122.2o7.net +0.0.0.0 bellserviceeng.112.2o7.net +0.0.0.0 betterhg.112.2o7.net +0.0.0.0 bhgmarketing.112.2o7.net +0.0.0.0 bidentonrccom.122.2o7.net +0.0.0.0 biwwltvcom.112.2o7.net +0.0.0.0 biwwltvcom.122.2o7.net +0.0.0.0 blackpress.122.2o7.net +0.0.0.0 bnkr8dev.112.2o7.net +0.0.0.0 bntbcstglobal.112.2o7.net +0.0.0.0 bosecom.112.2o7.net +0.0.0.0 brightcove.112.2o7.net +0.0.0.0 bulldog.122.2o7.net +0.0.0.0 businessweekpoc.112.2o7.net +0.0.0.0 bzresults.122.2o7.net +0.0.0.0 cablevision.112.2o7.net +0.0.0.0 canwest.112.2o7.net +0.0.0.0 canwestcom.112.2o7.net +0.0.0.0 canwestglobal.112.2o7.net +0.0.0.0 capcityadvcom.112.2o7.net +0.0.0.0 capcityadvcom.122.2o7.net +0.0.0.0 careers.112.2o7.net +0.0.0.0 cartoonnetwork.122.2o7.net +0.0.0.0 cbaol.112.2o7.net +0.0.0.0 cbc.122.2o7.net +0.0.0.0 cbcca.112.2o7.net +0.0.0.0 cbcca.122.2o7.net +0.0.0.0 cbcincinnatienquirer.112.2o7.net +0.0.0.0 cbmsn.112.2o7.net +0.0.0.0 cbs.112.2o7.net +0.0.0.0 cbsncaasports.112.2o7.net +0.0.0.0 cbsnfl.112.2o7.net +0.0.0.0 cbspgatour.112.2o7.net +0.0.0.0 cbsspln.112.2o7.net +0.0.0.0 ccrbudgetca.112.2o7.net +0.0.0.0 ccrgaviscom.112.2o7.net +0.0.0.0 cfrfa.112.2o7.net +0.0.0.0 chicagosuntimes.122.2o7.net +0.0.0.0 chumtv.122.2o7.net +0.0.0.0 classifiedscanada.112.2o7.net +0.0.0.0 classmatescom.112.2o7.net +0.0.0.0 cmpglobalvista.112.2o7.net +0.0.0.0 cnetasiapacific.122.2o7.net +0.0.0.0 cnetaustralia.122.2o7.net +0.0.0.0 cneteurope.122.2o7.net +0.0.0.0 cnetnews.112.2o7.net +0.0.0.0 cnetzdnet.112.2o7.net +0.0.0.0 cnhienid.122.2o7.net +0.0.0.0 cnhimcalesternews.122.2o7.net +0.0.0.0 cnhipicayuneitemv.112.2o7.net +0.0.0.0 cnhitribunestar.122.2o7.net +0.0.0.0 cnhitribunestara.122.2o7.net +0.0.0.0 cnhregisterherald.122.2o7.net +0.0.0.0 cnn.122.2o7.net +0.0.0.0 computerworldcom.112.2o7.net +0.0.0.0 condenast.112.2o7.net +0.0.0.0 coxnetmasterglobal.112.2o7.net +0.0.0.0 coxpalmbeachpost.112.2o7.net +0.0.0.0 csoonlinecom.112.2o7.net +0.0.0.0 ctvcrimelibrary.112.2o7.net +0.0.0.0 ctvsmokinggun.112.2o7.net +0.0.0.0 cxociocom.112.2o7.net +0.0.0.0 denverpost.112.2o7.net +0.0.0.0 diginet.112.2o7.net +0.0.0.0 digitalhomediscountptyltd.122.2o7.net +0.0.0.0 disccglobal.112.2o7.net +0.0.0.0 disccstats.112.2o7.net +0.0.0.0 dischannel.112.2o7.net +0.0.0.0 divx.112.2o7.net +0.0.0.0 dixonslnkcouk.112.2o7.net +0.0.0.0 dogpile.112.2o7.net +0.0.0.0 donval.112.2o7.net +0.0.0.0 dowjones.122.2o7.net +0.0.0.0 dreammates.112.2o7.net +0.0.0.0 eaeacom.112.2o7.net +0.0.0.0 eagamesuk.112.2o7.net +0.0.0.0 earthlnkpsplive.122.2o7.net +0.0.0.0 ebay1.112.2o7.net +0.0.0.0 ebaynonreg.112.2o7.net +0.0.0.0 ebayreg.112.2o7.net +0.0.0.0 ebayus.112.2o7.net +0.0.0.0 ebcom.112.2o7.net +0.0.0.0 ectestlampsplus1.112.2o7.net +0.0.0.0 edietsmain.112.2o7.net +0.0.0.0 edmundsinsideline.112.2o7.net +0.0.0.0 edsa.112.2o7.net +0.0.0.0 ehg-moma.hitbox.com.112.2o7.net +0.0.0.0 emc.122.2o7.net +0.0.0.0 employ22.112.2o7.net +0.0.0.0 employ26.112.2o7.net +0.0.0.0 employment.112.2o7.net +0.0.0.0 enterprisenewsmedia.122.2o7.net +0.0.0.0 epost.122.2o7.net +0.0.0.0 ewsnaples.112.2o7.net +0.0.0.0 ewstcpalm.112.2o7.net +0.0.0.0 examinercom.122.2o7.net +0.0.0.0 execulink.112.2o7.net +0.0.0.0 expedia4.112.2o7.net +0.0.0.0 expedia.ca.112.2o7.net +0.0.0.0 f2ncracker.112.2o7.net +0.0.0.0 f2nsmh.112.2o7.net +0.0.0.0 f2ntheage.112.2o7.net +0.0.0.0 faceoff.112.2o7.net +0.0.0.0 fbkmnr.112.2o7.net +0.0.0.0 forbesattache.112.2o7.net +0.0.0.0 forbesauto.112.2o7.net +0.0.0.0 forbesautos.112.2o7.net +0.0.0.0 forbescom.112.2o7.net +0.0.0.0 ford.112.2o7.net +0.0.0.0 foxcom.112.2o7.net +0.0.0.0 foxsimpsons.112.2o7.net +0.0.0.0 georgewbush.112.2o7.net +0.0.0.0 georgewbushcom.112.2o7.net +0.0.0.0 gettyimages.122.2o7.net +0.0.0.0 gjfastcompanycom.112.2o7.net +0.0.0.0 gmchevyapprentice.112.2o7.net +0.0.0.0 gmhummer.112.2o7.net +0.0.0.0 gntbcstglobal.112.2o7.net +0.0.0.0 gntbcstkxtv.112.2o7.net +0.0.0.0 gntbcstwtsp.112.2o7.net +0.0.0.0 gpaper104.112.2o7.net +0.0.0.0 gpaper105.112.2o7.net +0.0.0.0 gpaper107.112.2o7.net +0.0.0.0 gpaper108.112.2o7.net +0.0.0.0 gpaper109.112.2o7.net +0.0.0.0 gpaper110.112.2o7.net +0.0.0.0 gpaper111.112.2o7.net +0.0.0.0 gpaper112.112.2o7.net +0.0.0.0 gpaper113.112.2o7.net +0.0.0.0 gpaper114.112.2o7.net +0.0.0.0 gpaper115.112.2o7.net +0.0.0.0 gpaper116.112.2o7.net +0.0.0.0 gpaper117.112.2o7.net +0.0.0.0 gpaper118.112.2o7.net +0.0.0.0 gpaper119.112.2o7.net +0.0.0.0 gpaper120.112.2o7.net +0.0.0.0 gpaper121.112.2o7.net +0.0.0.0 gpaper122.112.2o7.net +0.0.0.0 gpaper123.112.2o7.net +0.0.0.0 gpaper124.112.2o7.net +0.0.0.0 gpaper125.112.2o7.net +0.0.0.0 gpaper126.112.2o7.net +0.0.0.0 gpaper127.112.2o7.net +0.0.0.0 gpaper128.112.2o7.net +0.0.0.0 gpaper129.112.2o7.net +0.0.0.0 gpaper131.112.2o7.net +0.0.0.0 gpaper132.112.2o7.net +0.0.0.0 gpaper133.112.2o7.net +0.0.0.0 gpaper138.112.2o7.net +0.0.0.0 gpaper139.112.2o7.net +0.0.0.0 gpaper140.112.2o7.net +0.0.0.0 gpaper141.112.2o7.net +0.0.0.0 gpaper142.112.2o7.net +0.0.0.0 gpaper144.112.2o7.net +0.0.0.0 gpaper145.112.2o7.net +0.0.0.0 gpaper147.112.2o7.net +0.0.0.0 gpaper149.112.2o7.net +0.0.0.0 gpaper151.112.2o7.net +0.0.0.0 gpaper154.112.2o7.net +0.0.0.0 gpaper156.112.2o7.net +0.0.0.0 gpaper157.112.2o7.net +0.0.0.0 gpaper158.112.2o7.net +0.0.0.0 gpaper162.112.2o7.net +0.0.0.0 gpaper164.112.2o7.net +0.0.0.0 gpaper166.112.2o7.net +0.0.0.0 gpaper167.112.2o7.net +0.0.0.0 gpaper169.112.2o7.net +0.0.0.0 gpaper170.112.2o7.net +0.0.0.0 gpaper171.112.2o7.net +0.0.0.0 gpaper172.112.2o7.net +0.0.0.0 gpaper173.112.2o7.net +0.0.0.0 gpaper174.112.2o7.net +0.0.0.0 gpaper176.112.2o7.net +0.0.0.0 gpaper177.112.2o7.net +0.0.0.0 gpaper180.112.2o7.net +0.0.0.0 gpaper183.112.2o7.net +0.0.0.0 gpaper184.112.2o7.net +0.0.0.0 gpaper191.112.2o7.net +0.0.0.0 gpaper192.112.2o7.net +0.0.0.0 gpaper193.112.2o7.net +0.0.0.0 gpaper194.112.2o7.net +0.0.0.0 gpaper195.112.2o7.net +0.0.0.0 gpaper196.112.2o7.net +0.0.0.0 gpaper197.112.2o7.net +0.0.0.0 gpaper198.112.2o7.net +0.0.0.0 gpaper202.112.2o7.net +0.0.0.0 gpaper204.112.2o7.net +0.0.0.0 gpaper205.112.2o7.net +0.0.0.0 gpaper212.112.2o7.net +0.0.0.0 gpaper214.112.2o7.net +0.0.0.0 gpaper219.112.2o7.net +0.0.0.0 gpaper223.112.2o7.net +0.0.0.0 harpo.122.2o7.net +0.0.0.0 hchrmain.112.2o7.net +0.0.0.0 heavycom.112.2o7.net +0.0.0.0 heavycom.122.2o7.net +0.0.0.0 homesclick.112.2o7.net +0.0.0.0 hostdomainpeople.112.2o7.net +0.0.0.0 hostdomainpeopleca.112.2o7.net +0.0.0.0 hostpowermedium.112.2o7.net +0.0.0.0 hpglobal.112.2o7.net +0.0.0.0 hphqglobal.112.2o7.net +0.0.0.0 hphqsearch.112.2o7.net +0.0.0.0 infomart.ca.112.2o7.net +0.0.0.0 infospace.com.112.2o7.net +0.0.0.0 intelcorpcim.112.2o7.net +0.0.0.0 intelglobal.112.2o7.net +0.0.0.0 ivillageglobal.112.2o7.net +0.0.0.0 jijsonline.122.2o7.net +0.0.0.0 jitmj4.122.2o7.net +0.0.0.0 johnlewis.112.2o7.net +0.0.0.0 journalregistercompany.122.2o7.net +0.0.0.0 kddi.122.2o7.net +0.0.0.0 krafteurope.112.2o7.net +0.0.0.0 ktva.112.2o7.net +0.0.0.0 ladieshj.112.2o7.net +0.0.0.0 laptopmag.122.2o7.net +0.0.0.0 laxnws.112.2o7.net +0.0.0.0 laxprs.112.2o7.net +0.0.0.0 laxpsd.112.2o7.net +0.0.0.0 ldsfch.112.2o7.net +0.0.0.0 leeenterprises.112.2o7.net +0.0.0.0 lenovo.112.2o7.net +0.0.0.0 logoworksdev.112.2o7.net +0.0.0.0 losu.112.2o7.net +0.0.0.0 mailtribune.112.2o7.net +0.0.0.0 maxim.122.2o7.net +0.0.0.0 maxvr.112.2o7.net +0.0.0.0 mdamarillo.112.2o7.net +0.0.0.0 mdjacksonville.112.2o7.net +0.0.0.0 mdtopeka.112.2o7.net +0.0.0.0 mdwardmore.112.2o7.net +0.0.0.0 mdwsavannah.112.2o7.net +0.0.0.0 medbroadcast.112.2o7.net +0.0.0.0 mediabistrocom.112.2o7.net +0.0.0.0 mediamatters.112.2o7.net +0.0.0.0 meetupcom.112.2o7.net +0.0.0.0 metacafe.122.2o7.net +0.0.0.0 mgjournalnow.112.2o7.net +0.0.0.0 mgtbo.112.2o7.net +0.0.0.0 mgtimesdispatch.112.2o7.net +0.0.0.0 mgwsls.112.2o7.net +0.0.0.0 mgwspa.112.2o7.net +0.0.0.0 microsoftconsumermarketing.112.2o7.net +0.0.0.0 microsofteup.112.2o7.net +0.0.0.0 microsoftwindows.112.2o7.net +0.0.0.0 midala.112.2o7.net +0.0.0.0 midar.112.2o7.net +0.0.0.0 midsen.112.2o7.net +0.0.0.0 mlbastros.112.2o7.net +0.0.0.0 mlbcolorado.112.2o7.net +0.0.0.0 mlbcom.112.2o7.net +0.0.0.0 mlbglobal08.112.2o7.net +0.0.0.0 mlbglobal.112.2o7.net +0.0.0.0 mlbhouston.112.2o7.net +0.0.0.0 mlbstlouis.112.2o7.net +0.0.0.0 mlbtoronto.112.2o7.net +0.0.0.0 mmsshopcom.112.2o7.net +0.0.0.0 mnfidnahub.112.2o7.net +0.0.0.0 mngidmn.112.2o7.net +0.0.0.0 mngirockymtnnews.112.2o7.net +0.0.0.0 mngislctrib.112.2o7.net +0.0.0.0 mngiyrkdr.112.2o7.net +0.0.0.0 mseuppremain.112.2o7.net +0.0.0.0 msnmercom.112.2o7.net +0.0.0.0 msnportal.112.2o7.net +0.0.0.0 mtvn.112.2o7.net +0.0.0.0 mtvu.112.2o7.net +0.0.0.0 mxmacromedia.112.2o7.net +0.0.0.0 myfamilyancestry.112.2o7.net +0.0.0.0 nasdaq.122.2o7.net +0.0.0.0 natgeoeditco.112.2o7.net +0.0.0.0 natgeoeditcom.112.2o7.net +0.0.0.0 natgeonews.112.2o7.net +0.0.0.0 natgeongmcom.112.2o7.net +0.0.0.0 nationalpost.112.2o7.net +0.0.0.0 nba.112.2o7.net +0.0.0.0 neber.112.2o7.net +0.0.0.0 netrp.112.2o7.net +0.0.0.0 netsdartboards.122.2o7.net +0.0.0.0 newsinteractive.112.2o7.net +0.0.0.0 newstimeslivecom.112.2o7.net +0.0.0.0 nike.112.2o7.net +0.0.0.0 nikeplus.112.2o7.net +0.0.0.0 nmanchorage.112.2o7.net +0.0.0.0 nmbrampton.112.2o7.net +0.0.0.0 nmcommancomedia.112.2o7.net +0.0.0.0 nmfresno.112.2o7.net +0.0.0.0 nmhiltonhead.112.2o7.net +0.0.0.0 nmkawartha.112.2o7.net +0.0.0.0 nmminneapolis.112.2o7.net +0.0.0.0 nmmississauga.112.2o7.net +0.0.0.0 nmnandomedia.112.2o7.net +0.0.0.0 nmraleigh.112.2o7.net +0.0.0.0 nmrockhill.112.2o7.net +0.0.0.0 nmsacramento.112.2o7.net +0.0.0.0 nmtoronto.112.2o7.net +0.0.0.0 nmtricity.112.2o7.net +0.0.0.0 nmyork.112.2o7.net +0.0.0.0 novellcom.112.2o7.net +0.0.0.0 nytbglobe.112.2o7.net +0.0.0.0 nytglobe.112.2o7.net +0.0.0.0 nythglobe.112.2o7.net +0.0.0.0 nytimesglobal.112.2o7.net +0.0.0.0 nytimesnonsampled.112.2o7.net +0.0.0.0 nytimesnoonsampled.112.2o7.net +0.0.0.0 nytmembercenter.112.2o7.net +0.0.0.0 nytrflorence.112.2o7.net +0.0.0.0 nytrgadsden.112.2o7.net +0.0.0.0 nytrgainseville.112.2o7.net +0.0.0.0 nytrhendersonville.112.2o7.net +0.0.0.0 nytrhouma.112.2o7.net +0.0.0.0 nytrlakeland.112.2o7.net +0.0.0.0 nytrsantarosa.112.2o7.net +0.0.0.0 nytrsarasota.112.2o7.net +0.0.0.0 nytrwilmington.112.2o7.net +0.0.0.0 nyttechnology.112.2o7.net +0.0.0.0 omniture.112.2o7.net +0.0.0.0 omnitureglobal.112.2o7.net +0.0.0.0 onlineindigoca.112.2o7.net +0.0.0.0 oracle.112.2o7.net +0.0.0.0 oraclecom.112.2o7.net +0.0.0.0 overstock.com.112.2o7.net +0.0.0.0 overturecomvista.112.2o7.net +0.0.0.0 paypal.112.2o7.net +0.0.0.0 poacprod.122.2o7.net +0.0.0.0 poconorecordcom.112.2o7.net +0.0.0.0 projectorpeople.112.2o7.net +0.0.0.0 publicationsunbound.112.2o7.net +0.0.0.0 pulharktheherald.112.2o7.net +0.0.0.0 pulpantagraph.112.2o7.net +0.0.0.0 rckymtnnws.112.2o7.net +0.0.0.0 recordnetcom.112.2o7.net +0.0.0.0 recordonlinecom.112.2o7.net +0.0.0.0 rey3935.112.2o7.net +0.0.0.0 rezrezwhistler.112.2o7.net +0.0.0.0 riptownmedia.122.2o7.net +0.0.0.0 rncgopcom.122.2o7.net +0.0.0.0 roxio.112.2o7.net +0.0.0.0 salesforce.122.2o7.net +0.0.0.0 santacruzsentinel.112.2o7.net +0.0.0.0 sciamglobal.112.2o7.net +0.0.0.0 scrippsbathvert.112.2o7.net +0.0.0.0 scrippsfoodnet.112.2o7.net +0.0.0.0 scrippswfts.112.2o7.net +0.0.0.0 scrippswxyz.112.2o7.net +0.0.0.0 seacoastonlinecom.112.2o7.net +0.0.0.0 searscom.112.2o7.net +0.0.0.0 smibs.112.2o7.net +0.0.0.0 smwww.112.2o7.net +0.0.0.0 sonycorporate.122.2o7.net +0.0.0.0 sonyglobal.112.2o7.net +0.0.0.0 southcoasttoday.112.2o7.net +0.0.0.0 spiketv.112.2o7.net +0.0.0.0 stpetersburgtimes.122.2o7.net +0.0.0.0 suncom.112.2o7.net +0.0.0.0 sunglobal.112.2o7.net +0.0.0.0 sunonesearch.112.2o7.net +0.0.0.0 survey.112.2o7.net +0.0.0.0 sympmsnsports.112.2o7.net +0.0.0.0 techreview.112.2o7.net +0.0.0.0 thestar.122.2o7.net +0.0.0.0 thestardev.122.2o7.net +0.0.0.0 thinkgeek.112.2o7.net +0.0.0.0 timebus2.112.2o7.net +0.0.0.0 timecom.112.2o7.net +0.0.0.0 timeew.122.2o7.net +0.0.0.0 timefortune.112.2o7.net +0.0.0.0 timehealth.112.2o7.net +0.0.0.0 timeofficepirates.122.2o7.net +0.0.0.0 timepeople.122.2o7.net +0.0.0.0 timepopsci.122.2o7.net +0.0.0.0 timerealsimple.112.2o7.net +0.0.0.0 timewarner.122.2o7.net +0.0.0.0 tmsscion.112.2o7.net +0.0.0.0 tmstoyota.112.2o7.net +0.0.0.0 tnttv.112.2o7.net +0.0.0.0 torstardigital.122.2o7.net +0.0.0.0 travidiathebrick.112.2o7.net +0.0.0.0 tribuneinteractive.122.2o7.net +0.0.0.0 usatoday1.112.2o7.net +0.0.0.0 usnews.122.2o7.net +0.0.0.0 usun.112.2o7.net +0.0.0.0 vanns.112.2o7.net +0.0.0.0 verisignwildcard.112.2o7.net +0.0.0.0 verisonwildcard.112.2o7.net +0.0.0.0 vh1com.112.2o7.net +0.0.0.0 viaatomvideo.112.2o7.net +0.0.0.0 viacomedycentralrl.112.2o7.net +0.0.0.0 viagametrailers.112.2o7.net +0.0.0.0 viamtvcom.112.2o7.net +0.0.0.0 viasyndimedia.112.2o7.net +0.0.0.0 viavh1com.112.2o7.net +0.0.0.0 viay2m.112.2o7.net +0.0.0.0 vintacom.112.2o7.net +0.0.0.0 viralvideo.112.2o7.net +0.0.0.0 walmartcom.112.2o7.net +0.0.0.0 westjet.112.2o7.net +0.0.0.0 wileydumcom.112.2o7.net +0.0.0.0 wmg.112.2o7.net +0.0.0.0 wmgmulti.112.2o7.net +0.0.0.0 workopolis.122.2o7.net +0.0.0.0 wpni.112.2o7.net +0.0.0.0 xhealthmobiletools.112.2o7.net +0.0.0.0 youtube.112.2o7.net +0.0.0.0 yrkeve.112.2o7.net +0.0.0.0 ziffdavisglobal.112.2o7.net +0.0.0.0 ziffdavispennyarcade.112.2o7.net +# + + +# ads +0.0.0.0 0101011.com +0.0.0.0 0427d7.se +0.0.0.0 0d79ed.r.axf8.net +0.0.0.0 104231.dtiblog.com +0.0.0.0 10.im.cz +0.0.0.0 123.fluxads.com +0.0.0.0 123specialgifts.com +#0.0.0.0 140cc.v.fwmrm.net #interferes with Comedy Central videos +0.0.0.0 1.adbrite.com +0.0.0.0 1.forgetstore.com +0.0.0.0 1.httpads.com +0.0.0.0 1.primaryads.com +0.0.0.0 207-87-18-203.wsmg.digex.net +0.0.0.0 247support.adtech.fr +0.0.0.0 247support.adtech.us +0.0.0.0 24ratownik.hit.gemius.pl +0.0.0.0 24trk.com +0.0.0.0 25184.hittail.com +0.0.0.0 2754.btrll.com +0.0.0.0 2912a.v.fwmrm.net +0.0.0.0 2.adbrite.com +0.0.0.0 2-art-coliseum.com +0.0.0.0 312.1d27c9b8fb.com +0.0.0.0 321cba.com +0.0.0.0 32red.it +0.0.0.0 360ads.com +0.0.0.0 3.adbrite.com +0.0.0.0 3.cennter.com +0.0.0.0 3fns.com +0.0.0.0 4.adbrite.com +0.0.0.0 4c28d6.r.axf8.net +0.0.0.0 4qinvite.4q.iperceptions.com +0.0.0.0 7500.com +0.0.0.0 76.a.boom.ro +0.0.0.0 7adpower.com +0.0.0.0 7bpeople.com +0.0.0.0 7bpeople.data.7bpeople.com +0.0.0.0 7cnbcnews.com +0.0.0.0 85103.hittail.com +0.0.0.0 8574dnj3yzjace8c8io6zr9u3n.hop.clickbank.net +0.0.0.0 888casino.com +0.0.0.0 961.com +0.0.0.0 9cf9.v.fwmrm.net +0.0.0.0 a01.gestionpub.com +0.0.0.0 a.0day.kiev.ua +0.0.0.0 a1.greenadworks.net +0.0.0.0 a1.interclick.com +0.0.0.0 a200.yieldoptimizer.com +0.0.0.0 a2.mediagra.com +0.0.0.0 a2.websponsors.com +0.0.0.0 a3.suntimes.com +0.0.0.0 a3.websponsors.com +0.0.0.0 a4.websponsors.com +0.0.0.0 a5.websponsors.com +0.0.0.0 a.admaxserver.com +0.0.0.0 a.adorika.net +0.0.0.0 a.ad.playstation.net +0.0.0.0 a.adready.com +0.0.0.0 a.ads1.msn.com +0.0.0.0 a.ads2.msn.com +0.0.0.0 a.adstome.com +0.0.0.0 aads.treehugger.com +0.0.0.0 aams1.aim4media.com +0.0.0.0 aan.amazon.com +0.0.0.0 aa-nb.marketgid.com +0.0.0.0 aa.newsblock.dt00.net +0.0.0.0 aa.newsblock.marketgid.com +0.0.0.0 a.as-eu.falkag.net +0.0.0.0 a.as-us.falkag.net +0.0.0.0 aax-us-east.amazon-adsystem.com +0.0.0.0 abcnews.footprint.net +0.0.0.0 a.boom.ro +0.0.0.0 abrogatesdv.info +0.0.0.0 abseckw.adtlgc.com +0.0.0.0 a.collective-media.net +0.0.0.0 ac.rnm.ca +0.0.0.0 actiondesk.com +0.0.0.0 actionflash.com +0.0.0.0 action.ientry.net +0.0.0.0 action.mathtag.com +0.0.0.0 action.media6degrees.com +0.0.0.0 actionsplash.com +0.0.0.0 ac.tynt.com +0.0.0.0 acvs.mediaonenetwork.net +0.0.0.0 acvsrv.mediaonenetwork.net +0.0.0.0 ad01.adonspot.com +0.0.0.0 ad01.focalink.com +0.0.0.0 ad01.mediacorpsingapore.com +0.0.0.0 ad02.focalink.com +0.0.0.0 ad03.focalink.com +0.0.0.0 ad04.focalink.com +0.0.0.0 ad05.focalink.com +0.0.0.0 ad06.focalink.com +0.0.0.0 ad07.focalink.com +0.0.0.0 ad08.focalink.com +0.0.0.0 ad09.focalink.com +0.0.0.0 ad0.haynet.com +0.0.0.0 ad101com.adbureau.net +0.0.0.0 ad10.bannerbank.ru +0.0.0.0 ad10.focalink.com +0.0.0.0 ad11.bannerbank.ru +0.0.0.0 ad11.focalink.com +0.0.0.0 ad12.bannerbank.ru +0.0.0.0 ad12.focalink.com +0.0.0.0 ad13.focalink.com +0.0.0.0 ad14.focalink.com +0.0.0.0 ad15.focalink.com +0.0.0.0 ad16.focalink.com +0.0.0.0 ad17.focalink.com +0.0.0.0 ad18.focalink.com +0.0.0.0 ad19.focalink.com +0.0.0.0 ad1.adtitan.net +0.0.0.0 ad1.bannerbank.ru +0.0.0.0 ad1.clickhype.com +0.0.0.0 ad1.emediate.dk +0.0.0.0 ad1.emediate.se +0.0.0.0 ad1.gamezone.com +0.0.0.0 ad1.hotel.com +0.0.0.0 ad1.lbn.ru +0.0.0.0 ad1.peel.com +0.0.0.0 ad1.popcap.com +0.0.0.0 ad1.yomiuri.co.jp +0.0.0.0 ad1.yourmedia.com +0.0.0.0 ad234.prbn.ru +0.0.0.0 ad2.adecn.com +0.0.0.0 ad2.bal.dotandad.com +0.0.0.0 ad2.bannerbank.ru +0.0.0.0 ad2.bannerhost.ru +0.0.0.0 ad2.bbmedia.cz +0.0.0.0 ad2.cooks.com +0.0.0.0 ad2.firehousezone.com +0.0.0.0 ad2games.com +0.0.0.0 ad2.gammae.com +0.0.0.0 ad2.hotel.com +0.0.0.0 ad2.ip.ro +0.0.0.0 ad2.lbn.ru +0.0.0.0 ad2.nationalreview.com +0.0.0.0 ad2.pamedia.com +0.0.0.0 ad2.parom.hu +0.0.0.0 ad2.peel.com +0.0.0.0 ad2.pl +0.0.0.0 ad2.pl.mediainter.net +0.0.0.0 ad2.sbisec.co.jp +0.0.0.0 ad2.smni.com +0.0.0.0 ad.360yield.com +0.0.0.0 ad3.adfarm1.adition.com +0.0.0.0 ad3.bannerbank.ru +0.0.0.0 ad3.bb.ru +0.0.0.0 ad.3dnews.ru +0.0.0.0 ad3.lbn.ru +0.0.0.0 ad3.nationalreview.com +0.0.0.0 ad3.rambler.ru +0.0.0.0 ad41.atlas.cz +0.0.0.0 ad4.adfarm1.adition.com +0.0.0.0 ad4.bannerbank.ru +0.0.0.0 ad4.lbn.ru +0.0.0.0 ad4.liverail.com +0.0.0.0 ad4.speedbit.com +0.0.0.0 ad5.bannerbank.ru +0.0.0.0 ad5.lbn.ru +0.0.0.0 ad6.bannerbank.ru +0.0.0.0 ad6.horvitznewspapers.net +0.0.0.0 ad.71i.de +0.0.0.0 ad7.bannerbank.ru +0.0.0.0 ad8.bannerbank.ru +0.0.0.0 ad9.bannerbank.ru +0.0.0.0 ad.abcnews.com +0.0.0.0 ad.aboutwebservices.com +0.0.0.0 ad.adfunky.com +0.0.0.0 ad.adition.de +0.0.0.0 ad.adition.net +0.0.0.0 ad.adlegend.com +0.0.0.0 ad.admarketplace.net +0.0.0.0 ad.adnet.biz +0.0.0.0 ad.adnet.de +0.0.0.0 ad.adnetwork.com.br +0.0.0.0 ad.adnetwork.net +0.0.0.0 ad.adorika.com +0.0.0.0 ad.adperium.com +0.0.0.0 ad.adriver.ru +0.0.0.0 ad.adserve.com +0.0.0.0 ad.adserverplus.com +0.0.0.0 ad.adsmart.net +0.0.0.0 ad.adtegrity.net +0.0.0.0 ad.adtoma.com +0.0.0.0 ad.adverticum.net +0.0.0.0 ad.advertstream.com +0.0.0.0 ad.adview.pl +0.0.0.0 ad.afilo.pl +0.0.0.0 ad.aftenposten.no +0.0.0.0 ad.aftonbladet.se +0.0.0.0 ad.afy11.net +0.0.0.0 ad.agava.tbn.ru +0.0.0.0 adagiobanner.s3.amazonaws.com +0.0.0.0 ad.agkn.com +0.0.0.0 ad.amgdgt.com +0.0.0.0 adap.tv +0.0.0.0 ad.aquamediadirect.com +0.0.0.0 ad.asv.de +0.0.0.0 ad-audit.tubemogul.com +0.0.0.0 ad.auditude.com +0.0.0.0 ad.bannerbank.ru +0.0.0.0 ad.bannerconnect.net +0.0.0.0 adblade.com +0.0.0.0 ad.bnmla.com +0.0.0.0 adbnr.ru +0.0.0.0 adbot.theonion.com +0.0.0.0 adbrite.com +0.0.0.0 adbucks.brandreachsys.com +0.0.0.0 adc2.adcentriconline.com +0.0.0.0 adcache.aftenposten.no +0.0.0.0 adcanadian.com +0.0.0.0 adcash.com +0.0.0.0 adcast.deviantart.com +0.0.0.0 adcentriconline.com +0.0.0.0 adcentric.randomseed.com +0.0.0.0 ad.cibleclick.com +0.0.0.0 ad.clickdistrict.com +0.0.0.0 adclick.hit.gemius.pl +0.0.0.0 ad.clickotmedia.com +0.0.0.0 adclient-af.lp.uol.com.br +0.0.0.0 adclient.uimserv.net +0.0.0.0 adcode.adengage.com +0.0.0.0 adcontent.gamespy.com +0.0.0.0 adcontent.reedbusiness.com +0.0.0.0 adcontent.videoegg.com +0.0.0.0 adcontroller.unicast.com +0.0.0.0 adcount.ohmynews.com +0.0.0.0 adcreative.tribuneinteractive.com +0.0.0.0 adcycle.footymad.net +0.0.0.0 adcycle.icpeurope.net +0.0.0.0 ad.dc2.adtech.de +0.0.0.0 addelivery.thestreet.com +0.0.0.0 ad.designtaxi.com +0.0.0.0 ad.deviantart.com +0.0.0.0 ad.directrev.com +0.0.0.0 addthiscdn.com +0.0.0.0 addthis.com +0.0.0.0 adecn.com +0.0.0.0 ad.egloos.com +0.0.0.0 adengine.rt.ru +0.0.0.0 ad.espn.starwave.com +0.0.0.0 ad.eurosport.com +0.0.0.0 adexpansion.com +0.0.0.0 adexprt.com +0.0.0.0 adexprt.me +0.0.0.0 adexprts.com +0.0.0.0 adext.inkclub.com +0.0.0.0 adfarm1.adition.com +0.0.0.0 adfarm.mserve.ca +0.0.0.0 adfiles.pitchforkmedia.com +0.0.0.0 ad.filmweb.pl +0.0.0.0 ad.firstadsolution.com +0.0.0.0 ad.flux.com +#0.0.0.0 adf.ly +0.0.0.0 adforce.ads.imgis.com +0.0.0.0 adforce.adtech.de +0.0.0.0 adforce.adtech.fr +0.0.0.0 adforce.adtech.us +0.0.0.0 adforce.imgis.com +0.0.0.0 adform.com +0.0.0.0 adfu.blockstackers.com +0.0.0.0 ad.funpic.de +0.0.0.0 adfusion.com +0.0.0.0 ad.garantiarkadas.com +0.0.0.0 adgardener.com +0.0.0.0 ad.gazeta.pl +0.0.0.0 ad.goo.ne.jp +0.0.0.0 adgraphics.theonion.com +0.0.0.0 ad.gra.pl +0.0.0.0 ad.gr.doubleclick.net +0.0.0.0 ad.greenmarquee.com +0.0.0.0 adgroup.naver.com +0.0.0.0 ad.hankooki.com +0.0.0.0 ad.harrenmedianetwork.com +0.0.0.0 adhearus.com +0.0.0.0 adhese.be +0.0.0.0 adhese.com +0.0.0.0 adhitzads.com +0.0.0.0 ad.horvitznewspapers.net +0.0.0.0 ad.host.bannerflow.com +0.0.0.0 ad.howstuffworks.com +0.0.0.0 adhref.pl +#0.0.0.0 ad.hulu.com # Uncomment to block Hulu. +0.0.0.0 ad.iconadserver.com +0.0.0.0 adidm.idmnet.pl +0.0.0.0 adidm.supermedia.pl +0.0.0.0 adimage.asia1.com.sg +0.0.0.0 adimage.asiaone.com +0.0.0.0 adimage.asiaone.com.sg +0.0.0.0 adimage.blm.net +0.0.0.0 adimages.earthweb.com +0.0.0.0 adimages.go.com +0.0.0.0 adimages.mp3.com +0.0.0.0 adimages.watchmygf.net +0.0.0.0 adi.mainichi.co.jp +0.0.0.0 adimg.activeadv.net +0.0.0.0 adimg.com.com +0.0.0.0 adincl.gopher.com +0.0.0.0 ad.insightexpressai.com +0.0.0.0 ad.investopedia.com +0.0.0.0 adipics.com +0.0.0.0 adireland.com +0.0.0.0 ad.ir.ru +0.0.0.0 ad.isohunt.com +0.0.0.0 adition.com +0.0.0.0 ad.iwin.com +0.0.0.0 adj10.thruport.com +0.0.0.0 adj11.thruport.com +0.0.0.0 adj12.thruport.com +0.0.0.0 adj13.thruport.com +0.0.0.0 adj14.thruport.com +0.0.0.0 adj15.thruport.com +0.0.0.0 adj16r1.thruport.com +0.0.0.0 adj16.thruport.com +0.0.0.0 adj17.thruport.com +0.0.0.0 adj18.thruport.com +0.0.0.0 adj19.thruport.com +0.0.0.0 adj1.thruport.com +0.0.0.0 adj22.thruport.com +0.0.0.0 adj23.thruport.com +0.0.0.0 adj24.thruport.com +0.0.0.0 adj25.thruport.com +0.0.0.0 adj26.thruport.com +0.0.0.0 adj27.thruport.com +0.0.0.0 adj28.thruport.com +0.0.0.0 adj29.thruport.com +0.0.0.0 adj2.thruport.com +0.0.0.0 adj30.thruport.com +0.0.0.0 adj31.thruport.com +0.0.0.0 adj32.thruport.com +0.0.0.0 adj33.thruport.com +0.0.0.0 adj34.thruport.com +0.0.0.0 adj35.thruport.com +0.0.0.0 adj36.thruport.com +0.0.0.0 adj37.thruport.com +0.0.0.0 adj38.thruport.com +0.0.0.0 adj39.thruport.com +0.0.0.0 adj3.thruport.com +0.0.0.0 adj40.thruport.com +0.0.0.0 adj41.thruport.com +0.0.0.0 adj43.thruport.com +0.0.0.0 adj44.thruport.com +0.0.0.0 adj45.thruport.com +0.0.0.0 adj46.thruport.com +0.0.0.0 adj47.thruport.com +0.0.0.0 adj48.thruport.com +0.0.0.0 adj49.thruport.com +0.0.0.0 adj4.thruport.com +0.0.0.0 adj50.thruport.com +0.0.0.0 adj51.thruport.com +0.0.0.0 adj52.thruport.com +0.0.0.0 adj53.thruport.com +0.0.0.0 adj54.thruport.com +0.0.0.0 adj55.thruport.com +0.0.0.0 adj56.thruport.com +0.0.0.0 adj5.thruport.com +0.0.0.0 adj6.thruport.com +0.0.0.0 adj7.thruport.com +0.0.0.0 adj8.thruport.com +0.0.0.0 adj9.thruport.com +0.0.0.0 ad.jamba.net +0.0.0.0 ad.jamster.ca +0.0.0.0 adjmps.com +0.0.0.0 adjuggler.net +0.0.0.0 adjuggler.yourdictionary.com +0.0.0.0 ad.kataweb.it +0.0.0.0 ad.kat.ph +0.0.0.0 adkontekst.pl +0.0.0.0 ad.krutilka.ru +0.0.0.0 ad.leadcrunch.com +0.0.0.0 ad.lgappstv.com +0.0.0.0 ad.linkexchange.com +0.0.0.0 ad.linksynergy.com +0.0.0.0 admanager1.collegepublisher.com +0.0.0.0 admanager2.broadbandpublisher.com +0.0.0.0 admanager3.collegepublisher.com +0.0.0.0 admanager.adam4adam.com +0.0.0.0 admanager.beweb.com +0.0.0.0 admanager.btopenworld.com +0.0.0.0 admanager.collegepublisher.com +0.0.0.0 adman.freeze.com +0.0.0.0 adman.in.gr +0.0.0.0 ad.mastermedia.ru +0.0.0.0 admatcher.videostrip.com #http://admatcher.videostrip.com/?puid=23940627&host=www.dumpert.nl&categories=default +0.0.0.0 admatch-syndication.mochila.com +0.0.0.0 admax.quisma.com +0.0.0.0 ad.media-servers.net +0.0.0.0 admedia.xoom.com +0.0.0.0 admeld.com +0.0.0.0 admeta.vo.llnwd.net +#0.0.0.0 adm.fwmrm.net #may interfere with nhl.com +0.0.0.0 admin.digitalacre.com +0.0.0.0 admin.hotkeys.com +0.0.0.0 admin.inq.com +0.0.0.0 admonkey.dapper.net +0.0.0.0 ad.moscowtimes.ru +0.0.0.0 adm.shacknews.com +0.0.0.0 adms.physorg.com +0.0.0.0 ad.my.doubleclick.net +0.0.0.0 ad.nate.com +0.0.0.0 adn.ebay.com +0.0.0.0 adnet.asahi.com +0.0.0.0 adnet.biz +0.0.0.0 adnet.chicago.tribune.com +0.0.0.0 adnet.com +0.0.0.0 adnet.de +0.0.0.0 ad.network60.com +0.0.0.0 adnetwork.nextgen.net +0.0.0.0 adnetwork.rovicorp.com +0.0.0.0 adnetxchange.com +0.0.0.0 adng.ascii24.com +0.0.0.0 adn.kinkydollars.com +0.0.0.0 ad.nozonedata.com +0.0.0.0 adnxs.com +0.0.0.0 adnxs.revsci.net +0.0.0.0 adobee.com +0.0.0.0 adobe.tt.omtrdc.net +0.0.0.0 adocean.pl +0.0.0.0 ad.ohmynews.com +0.0.0.0 adopt.euroclick.com +0.0.0.0 adopt.precisead.com +0.0.0.0 adotube.com +0.0.0.0 ad.parom.hu +0.0.0.0 ad.partis.si +0.0.0.0 adpepper.dk +0.0.0.0 adp.gazeta.pl +0.0.0.0 ad.ph-prt.tbn.ru +0.0.0.0 adpick.switchboard.com +0.0.0.0 ad.pravda.ru +0.0.0.0 ad.preferences.com +0.0.0.0 ad.pro-advertising.com +0.0.0.0 ad.propellerads.com +0.0.0.0 ad.prv.pl +0.0.0.0 adpulse.ads.targetnet.com +0.0.0.0 adpush.dreamscape.com +0.0.0.0 adq.nextag.com +0.0.0.0 adremote.pathfinder.com +0.0.0.0 adremote.timeinc.aol.com +0.0.0.0 adremote.timeinc.net +0.0.0.0 ad.repubblica.it +0.0.0.0 adriver.ru +0.0.0.0 adroll.com +0.0.0.0 adrotate.se +0.0.0.0 adrotator.se +0.0.0.0 ad.ru.doubleclick.net +0.0.0.0 ads01.focalink.com +0.0.0.0 ads01.hyperbanner.net +0.0.0.0 ads02.focalink.com +0.0.0.0 ads02.hyperbanner.net +0.0.0.0 ads03.focalink.com +0.0.0.0 ads03.hyperbanner.net +0.0.0.0 ads04.focalink.com +0.0.0.0 ads04.hyperbanner.net +0.0.0.0 ads05.focalink.com +0.0.0.0 ads05.hyperbanner.net +0.0.0.0 ads06.focalink.com +0.0.0.0 ads06.hyperbanner.net +0.0.0.0 ads07.focalink.com +0.0.0.0 ads07.hyperbanner.net +0.0.0.0 ads08.focalink.com +0.0.0.0 ads08.hyperbanner.net +0.0.0.0 ads09.focalink.com +0.0.0.0 ads09.hyperbanner.net +0.0.0.0 ads0.okcupid.com +0.0.0.0 ads10.focalink.com +0.0.0.0 ads10.hyperbanner.net +0.0.0.0 ads10.speedbit.com +0.0.0.0 ads10.udc.advance.net +0.0.0.0 ads11.focalink.com +0.0.0.0 ads11.hyperbanner.net +0.0.0.0 ads11.udc.advance.net +0.0.0.0 ads12.focalink.com +0.0.0.0 ads12.hyperbanner.net +0.0.0.0 ads12.udc.advance.net +0.0.0.0 ads13.focalink.com +0.0.0.0 ads13.hyperbanner.net +0.0.0.0 ads13.udc.advance.net +0.0.0.0 ads14.bpath.com +0.0.0.0 ads14.focalink.com +0.0.0.0 ads14.hyperbanner.net +0.0.0.0 ads14.udc.advance.net +0.0.0.0 ads15.bpath.com +0.0.0.0 ads15.focalink.com +0.0.0.0 ads15.hyperbanner.net +0.0.0.0 ads15.udc.advance.net +0.0.0.0 ads16.advance.net +0.0.0.0 ads16.focalink.com +0.0.0.0 ads16.hyperbanner.net +0.0.0.0 ads16.udc.advance.net +0.0.0.0 ads17.focalink.com +0.0.0.0 ads17.hyperbanner.net +0.0.0.0 ads18.focalink.com +0.0.0.0 ads18.hyperbanner.net +0.0.0.0 ads19.focalink.com +0.0.0.0 ads1.activeagent.at +0.0.0.0 ads1.ad-flow.com +0.0.0.0 ads1.admedia.ro +0.0.0.0 ads1.advance.net +0.0.0.0 ads1.advertwizard.com +0.0.0.0 ads1.ami-admin.com +0.0.0.0 ads1.canoe.ca +0.0.0.0 ads1.destructoid.com +0.0.0.0 ads1.empiretheatres.com +0.0.0.0 ads1.erotism.com +0.0.0.0 ads1.eudora.com +0.0.0.0 ads1.globeandmail.com +0.0.0.0 ads1.itadnetwork.co.uk +0.0.0.0 ads1.jev.co.za +0.0.0.0 ads1.msads.net +0.0.0.0 ads1.msn.com +0.0.0.0 ads1.perfadbrite.com.akadns.net +0.0.0.0 ads1.performancingads.com +0.0.0.0 ads1.realcities.com +0.0.0.0 ads1.revenue.net +0.0.0.0 ads1.sptimes.com +0.0.0.0 ads1.theglobeandmail.com +0.0.0.0 ads1.ucomics.com +0.0.0.0 ads1.udc.advance.net +0.0.0.0 ads1.updated.com +0.0.0.0 ads1.virtumundo.com +0.0.0.0 ads1.zdnet.com +0.0.0.0 ads20.focalink.com +0.0.0.0 ads21.focalink.com +0.0.0.0 ads22.focalink.com +0.0.0.0 ads23.focalink.com +0.0.0.0 ads24.focalink.com +0.0.0.0 ads25.focalink.com +0.0.0.0 ads2.adbrite.com +0.0.0.0 ads2.ad-flow.com +0.0.0.0 ads2.advance.net +0.0.0.0 ads2.advertwizard.com +0.0.0.0 ads2.canoe.ca +0.0.0.0 ads2.clearchannel.com +0.0.0.0 ads2.clickad.com +0.0.0.0 ads2.collegclub.com +0.0.0.0 ads2.collegeclub.com +0.0.0.0 ads2.contentabc.com +0.0.0.0 ads2.drivelinemedia.com +0.0.0.0 ads2.emeraldcoast.com +0.0.0.0 ads2.exhedra.com +0.0.0.0 ads2.firingsquad.com +0.0.0.0 ads2.gamecity.net +0.0.0.0 ads2.jubii.dk +0.0.0.0 ads2.ljworld.com +0.0.0.0 ads2.msn.com +0.0.0.0 ads2.newtimes.com +0.0.0.0 ads2.osdn.com +0.0.0.0 ads2.pittsburghlive.com +0.0.0.0 ads2.realcities.com +0.0.0.0 ads2.revenue.net +0.0.0.0 ads2.rp.pl +0.0.0.0 ads2srv.com +0.0.0.0 ads2.theglobeandmail.com +0.0.0.0 ads2.udc.advance.net +0.0.0.0 ads2.virtumundo.com +0.0.0.0 ads2.weblogssl.com +0.0.0.0 ads2.zdnet.com +0.0.0.0 ads2.zeusclicks.com +0.0.0.0 ads360.com +0.0.0.0 ads36.hyperbanner.net +0.0.0.0 ads3.ad-flow.com +0.0.0.0 ads3.adman.gr +0.0.0.0 ads3.advance.net +0.0.0.0 ads3.advertwizard.com +0.0.0.0 ads3.canoe.ca +0.0.0.0 ads3.freebannertrade.com +0.0.0.0 ads3.gamecity.net +0.0.0.0 ads3.jubii.dk +0.0.0.0 ads3.realcities.com +0.0.0.0 ads3.udc.advance.net +0.0.0.0 ads3.virtumundo.com +0.0.0.0 ads3.zdnet.com +0.0.0.0 ads4.ad-flow.com +0.0.0.0 ads4.advance.net +0.0.0.0 ads4.advertwizard.com +0.0.0.0 ads4.canoe.ca +0.0.0.0 ads4.clearchannel.com +0.0.0.0 ads4.gamecity.net +0.0.0.0 ads4homes.com +0.0.0.0 ads4.realcities.com +0.0.0.0 ads4.udc.advance.net +0.0.0.0 ads4.virtumundo.com +0.0.0.0 ads5.ad-flow.com +0.0.0.0 ads5.advance.net +0.0.0.0 ads5.advertwizard.com +0.0.0.0 ads5.canoe.ca +0.0.0.0 ads.5ci.lt +0.0.0.0 ads5.fxdepo.com +0.0.0.0 ads5.mconetwork.com +0.0.0.0 ads5.udc.advance.net +0.0.0.0 ads5.virtumundo.com +0.0.0.0 ads6.ad-flow.com +0.0.0.0 ads6.advance.net +0.0.0.0 ads6.advertwizard.com +0.0.0.0 ads6.gamecity.net +0.0.0.0 ads6.udc.advance.net +0.0.0.0 ads7.ad-flow.com +0.0.0.0 ads7.advance.net +0.0.0.0 ads7.advertwizard.com +0.0.0.0 ads.7days.ae +0.0.0.0 ads7.gamecity.net +0.0.0.0 ads7.speedbit.com +0.0.0.0 ads7.udc.advance.net +0.0.0.0 ads.8833.com +0.0.0.0 ads8.ad-flow.com +0.0.0.0 ads8.advertwizard.com +0.0.0.0 ads8.com +0.0.0.0 ads8.udc.advance.net +0.0.0.0 ads9.ad-flow.com +0.0.0.0 ads9.advertwizard.com +0.0.0.0 ads9.udc.advance.net +0.0.0.0 ads.abs-cbn.com +0.0.0.0 ads.accelerator-media.com +0.0.0.0 ads.aceweb.net +0.0.0.0 ads.activeagent.at +0.0.0.0 ads.active.com +0.0.0.0 ads.ad4game.com +0.0.0.0 ads.adap.tv +0.0.0.0 ads.adbrite.com +0.0.0.0 ads.adbroker.de +0.0.0.0 ads.adcorps.com +0.0.0.0 ads.addesktop.com +0.0.0.0 ads.addynamix.com +0.0.0.0 ads.adengage.com +0.0.0.0 ads.ad-flow.com +0.0.0.0 ads.adfox.ru +0.0.0.0 ads.adgoto.com +0.0.0.0 ads.adhall.com +0.0.0.0 ads.adhearus.com +0.0.0.0 ads.adhostingsolutions.com +0.0.0.0 ads.admarvel.com +0.0.0.0 ads.admaximize.com +0.0.0.0 adsadmin.aspentimes.com +0.0.0.0 adsadmin.corusradionetwork.com +0.0.0.0 adsadmin.vaildaily.com +0.0.0.0 ads.admonitor.net +0.0.0.0 ads.adn.com +0.0.0.0 ads.adroar.com +0.0.0.0 ads.adsag.com +0.0.0.0 ads.adsbookie.com +0.0.0.0 ads.adshareware.net +0.0.0.0 ads.adsinimages.com +0.0.0.0 ads.adsonar.com +0.0.0.0 ads.adsrvmedia.com +0.0.0.0 ads.adtegrity.net +0.0.0.0 ads.adtiger.de +0.0.0.0 ads.adultfriendfinder.com +0.0.0.0 ads.adultswim.com +0.0.0.0 ads.advance.net +0.0.0.0 ads.adverline.com +0.0.0.0 ads.adviva.net +0.0.0.0 ads.advolume.com +0.0.0.0 ads.adworldnetwork.com +0.0.0.0 ads.adx.nu +0.0.0.0 ads.adxpansion.com +0.0.0.0 ads.adxpose.com +0.0.0.0 ads.adxpose.mpire.akadns.net +0.0.0.0 ads.affiliates.match.com +0.0.0.0 ads.aftonbladet.se +0.0.0.0 ads.ah-ha.com +0.0.0.0 ads.aintitcool.com +0.0.0.0 ads.airamericaradio.com +0.0.0.0 ads.ak.facebook.com +0.0.0.0 ads.albawaba.com +0.0.0.0 ads.al.com +0.0.0.0 ads.allsites.com +0.0.0.0 ads.allvertical.com +0.0.0.0 ads.amarillo.com +0.0.0.0 ads.amateurmatch.com +0.0.0.0 ads.amazingmedia.com +0.0.0.0 ads.amgdgt.com +0.0.0.0 ads.ami-admin.com +0.0.0.0 ads.anm.co.uk +0.0.0.0 ads.anvato.com +0.0.0.0 ads.aol.com +0.0.0.0 ads.apartmenttherapy.com +0.0.0.0 ads.apn.co.nz +0.0.0.0 ads.apn.co.za +0.0.0.0 ads.appleinsider.com +0.0.0.0 ads.arcadechain.com +0.0.0.0 ads.aroundtherings.com +0.0.0.0 ads.as4x.tmcs.net +0.0.0.0 ads.as4x.tmcs.ticketmaster.ca +0.0.0.0 ads.as4x.tmcs.ticketmaster.com +0.0.0.0 ads.asia1.com +0.0.0.0 ads.asia1.com.sg +0.0.0.0 ads.aspalliance.com +0.0.0.0 ads.aspentimes.com +0.0.0.0 ads.asp.net +0.0.0.0 ads.associatedcontent.com +0.0.0.0 ads.astalavista.us +0.0.0.0 ads.atlantamotorspeedway.com +0.0.0.0 adsatt.abcnews.starwave.com +0.0.0.0 adsatt.espn.go.com +0.0.0.0 adsatt.espn.starwave.com +0.0.0.0 ads.auctionads.com +0.0.0.0 ads.auctioncity.co.nz +0.0.0.0 ads.auctions.yahoo.com +0.0.0.0 ads.augusta.com +0.0.0.0 ads.aversion2.com +0.0.0.0 ads.aws.sitepoint.com +0.0.0.0 ads.azjmp.com +0.0.0.0 ads.baazee.com +0.0.0.0 ads.bangkokpost.co.th +0.0.0.0 ads.banner.t-online.de +0.0.0.0 ads.barnonedrinks.com +0.0.0.0 ads.battle.net +0.0.0.0 ads.bauerpublishing.com +0.0.0.0 ads.baventures.com +0.0.0.0 ads.bbcworld.com +0.0.0.0 ads.bcnewsgroup.com +0.0.0.0 ads.beeb.com +0.0.0.0 ads.beliefnet.com +0.0.0.0 ads.belointeractive.com +0.0.0.0 ads.beta.itravel2000.com +0.0.0.0 ads.betanews.com +0.0.0.0 ads.bfast.com +0.0.0.0 ads.bfm.valueclick.net +0.0.0.0 ads.bianca.com +0.0.0.0 ads.bidclix.com +0.0.0.0 ads.bidvertiser.com +0.0.0.0 ads.bigcitytools.com +0.0.0.0 ads.biggerboat.com +0.0.0.0 ads.bitsonthewire.com +0.0.0.0 ads.bizhut.com +0.0.0.0 ads.blixem.nl +0.0.0.0 ads.blog.com +0.0.0.0 ads.blogherads.com +0.0.0.0 ads.bloomberg.com +0.0.0.0 ads.blp.calueclick.net +0.0.0.0 ads.blp.valueclick.net +0.0.0.0 ads.bluelithium.com +0.0.0.0 ads.bluemountain.com +0.0.0.0 ads.bonnint.net +0.0.0.0 ads.box.sk +0.0.0.0 ads.brabys.com +0.0.0.0 ads.brand.net +0.0.0.0 ads.bridgetrack.com +0.0.0.0 ads.britishexpats.com +0.0.0.0 ads.buscape.com.br +0.0.0.0 ads.businessclick.com +0.0.0.0 ads.businessweek.com +0.0.0.0 ads.calgarysun.com +0.0.0.0 ads.callofdutyblackopsforum.net +0.0.0.0 ads.camrecord.com +0.0.0.0 ads.canoe.ca +0.0.0.0 ads.cardea.se +0.0.0.0 ads.cardplayer.com +0.0.0.0 ads.carltononline.com +0.0.0.0 ads.carocean.co.uk +0.0.0.0 ads.casinocity.com +0.0.0.0 ads.catholic.org +0.0.0.0 ads.cavello.com +0.0.0.0 ads.cbc.ca +0.0.0.0 ads.cdfreaks.com +0.0.0.0 ads.cdnow.com +0.0.0.0 adscendmedia.com +0.0.0.0 ads.centraliprom.com +0.0.0.0 ads.cgchannel.com +0.0.0.0 ads.chalomumbai.com +0.0.0.0 ads.champs-elysees.com +0.0.0.0 ads.channel4.com +0.0.0.0 ads.checkm8.co.za +0.0.0.0 ads.chipcenter.com +0.0.0.0 adscholar.com +0.0.0.0 ads.chumcity.com +0.0.0.0 ads.cjonline.com +0.0.0.0 ads.clamav.net +0.0.0.0 ads.clara.net +0.0.0.0 ads.clearchannel.com +0.0.0.0 ads.cleveland.com +0.0.0.0 ads.clickability.com +0.0.0.0 ads.clickad.com.pl +0.0.0.0 ads.clickagents.com +0.0.0.0 ads.clickhouse.com +0.0.0.0 ads.clicksor.com +0.0.0.0 ads.clickthru.net +0.0.0.0 ads.clicmanager.fr +0.0.0.0 ads.clubzone.com +0.0.0.0 ads.cluster01.oasis.zmh.zope.net +0.0.0.0 ads.cmediaworld.com +0.0.0.0 ads.cmg.valueclick.net +0.0.0.0 ads.cnn.com +0.0.0.0 ads.cnngo.com +0.0.0.0 ads.cobrad.com +0.0.0.0 ads.collegclub.com +0.0.0.0 ads.collegehumor.com +0.0.0.0 ads.collegemix.com +0.0.0.0 ads.com.com +0.0.0.0 ads.comediagroup.hu +0.0.0.0 ads.comicbookresources.com +0.0.0.0 ads.contactmusic.com +0.0.0.0 ads.contentabc.com +0.0.0.0 ads.coopson.com +0.0.0.0 ads.corusradionetwork.com +0.0.0.0 ads.courierpostonline.com +0.0.0.0 ads.cpsgsoftware.com +0.0.0.0 ads.crakmedia.com +0.0.0.0 ads.crapville.com +0.0.0.0 ads.creative-serving.com +0.0.0.0 ads.crosscut.com +0.0.0.0 ads.ctvdigital.net +0.0.0.0 ads.currantbun.com +0.0.0.0 ads.cyberfight.ru +0.0.0.0 ads.cybersales.cz +0.0.0.0 ads.cybertrader.com +0.0.0.0 ads.dada.it +0.0.0.0 ads.danworld.net +0.0.0.0 adsdaq.com +0.0.0.0 ads.dbforums.com +0.0.0.0 ads.ddj.com +0.0.0.0 ads.dealnews.com +0.0.0.0 ads.democratandchronicle.com +0.0.0.0 ads.dennisnet.co.uk +0.0.0.0 ads.designboom.com +0.0.0.0 ads.designtaxi.com +0.0.0.0 ads.desmoinesregister.com +0.0.0.0 ads-de.spray.net +0.0.0.0 ads.detelefoongids.nl +0.0.0.0 ads.developershed.com +0.0.0.0 ads.deviantart.com +0.0.0.0 ads-dev.youporn.com +0.0.0.0 ads.digitalacre.com +0.0.0.0 ads.digital-digest.com +0.0.0.0 ads.digitalhealthcare.com +0.0.0.0 ads.digitalmedianet.com +0.0.0.0 ads.digitalpoint.com +0.0.0.0 ads.dimcab.com +0.0.0.0 ads.directionsmag.com +0.0.0.0 ads-direct.prodigy.net +0.0.0.0 ads.discovery.com +0.0.0.0 ads.dk +0.0.0.0 ads.doclix.com +0.0.0.0 ads.domeus.com +0.0.0.0 ads.dontpanicmedia.com +0.0.0.0 ads.dothads.com +0.0.0.0 ads.doubleviking.com +0.0.0.0 ads.drf.com +0.0.0.0 ads.drivelinemedia.com +0.0.0.0 ads.drugs.com +0.0.0.0 ads.dumpalink.com +0.0.0.0 adsearch.adkontekst.pl +0.0.0.0 adsearch.pl +0.0.0.0 adsearch.wp.pl +0.0.0.0 ads.ecircles.com +0.0.0.0 ads.economist.com +0.0.0.0 ads.ecosalon.com +0.0.0.0 ads.edirectme.com +0.0.0.0 ads.einmedia.com +0.0.0.0 ads.eircom.net +0.0.0.0 ads.emeraldcoast.com +0.0.0.0 ads.enliven.com +0.0.0.0 ad.sensismediasmart.com.au +0.0.0.0 adsentnetwork.com +0.0.0.0 adserer.ihigh.com +0.0.0.0 ads.erotism.com +0.0.0.0 adserv001.adtech.de +0.0.0.0 adserv001.adtech.fr +0.0.0.0 adserv001.adtech.us +0.0.0.0 adserv002.adtech.de +0.0.0.0 adserv002.adtech.fr +0.0.0.0 adserv002.adtech.us +0.0.0.0 adserv003.adtech.de +0.0.0.0 adserv003.adtech.fr +0.0.0.0 adserv003.adtech.us +0.0.0.0 adserv004.adtech.de +0.0.0.0 adserv004.adtech.fr +0.0.0.0 adserv004.adtech.us +0.0.0.0 adserv005.adtech.de +0.0.0.0 adserv005.adtech.fr +0.0.0.0 adserv005.adtech.us +0.0.0.0 adserv006.adtech.de +0.0.0.0 adserv006.adtech.fr +0.0.0.0 adserv006.adtech.us +0.0.0.0 adserv007.adtech.de +0.0.0.0 adserv007.adtech.fr +0.0.0.0 adserv007.adtech.us +0.0.0.0 adserv008.adtech.de +0.0.0.0 adserv008.adtech.fr +0.0.0.0 adserv008.adtech.us +0.0.0.0 adserv2.bravenet.com +0.0.0.0 adserv.aip.org +0.0.0.0 adservant.guj.de +0.0.0.0 adserv.bravenet.com +0.0.0.0 adserve5.nikkeibp.co.jp +0.0.0.0 adserve.adtoll.com +0.0.0.0 adserve.canadawidemagazines.com +0.0.0.0 adserve.city-ad.com +0.0.0.0 adserve.ehpub.com +0.0.0.0 adserve.gossipgirls.com +0.0.0.0 adserve.mizzenmedia.com +0.0.0.0 adserv.entriq.net +0.0.0.0 adserve.podaddies.com +0.0.0.0 adserve.profit-smart.com +0.0.0.0 adserver01.ancestry.com +0.0.0.0 adserver.100free.com +0.0.0.0 adserver.163.com +0.0.0.0 adserver1.adserver.com.pl +0.0.0.0 adserver1.adtech.com.tr +0.0.0.0 adserver1.backbeatmedia.com +0.0.0.0 adserver1.economist.com +0.0.0.0 adserver1.eudora.com +0.0.0.0 adserver1.harvestadsdepot.com +0.0.0.0 adserver1.hookyouup.com +0.0.0.0 adserver1-images.backbeatmedia.com +0.0.0.0 adserver1.isohunt.com +0.0.0.0 adserver1.lokitorrent.com +0.0.0.0 adserver1.mediainsight.de +0.0.0.0 adserver1.ogilvy-interactive.de +0.0.0.0 adserver1.realtracker.com +0.0.0.0 adserver1.sonymusiceurope.com +0.0.0.0 adserver1.teracent.net +0.0.0.0 adserver1.wmads.com +0.0.0.0 adserver.2618.com +0.0.0.0 adserver2.adserver.com.pl +0.0.0.0 adserver2.atman.pl +0.0.0.0 adserver2.christianitytoday.com +0.0.0.0 adserver2.condenast.co.uk +0.0.0.0 adserver2.creative.com +0.0.0.0 adserver2.eudora.com +0.0.0.0 adserver-2.ig.com.br +0.0.0.0 adserver2.mediainsight.de +0.0.0.0 adserver2.news-journalonline.com +0.0.0.0 adserver2.popdata.de +0.0.0.0 adserver2.realtracker.com +0.0.0.0 adserver2.teracent.net +0.0.0.0 adserver.3digit.de +0.0.0.0 adserver3.eudora.com +0.0.0.0 adserver-3.ig.com.br +0.0.0.0 adserver4.eudora.com +0.0.0.0 adserver-4.ig.com.br +0.0.0.0 adserver-5.ig.com.br +0.0.0.0 adserver.71i.de +0.0.0.0 adserver9.contextad.com +0.0.0.0 adserver.ad-it.dk +0.0.0.0 adserver.adreactor.com +0.0.0.0 adserver.adremedy.com +0.0.0.0 adserver.ads360.com +0.0.0.0 adserver.adserver.com.pl +0.0.0.0 adserver.adsincontext.com +0.0.0.0 adserver.adtech.de +0.0.0.0 adserver.adtech.fr +0.0.0.0 adserver.adtech.us +0.0.0.0 adserver.adtechus.com +0.0.0.0 adserver.adultfriendfinder.com +0.0.0.0 adserver.advertist.com +0.0.0.0 adserver.affiliatemg.com +0.0.0.0 adserver.affiliation.com +0.0.0.0 adserver.aim4media.com +0.0.0.0 adserver.a.in.monster.com +0.0.0.0 adserver.airmiles.ca +0.0.0.0 adserver.akqa.net +0.0.0.0 adserver.allheadlinenews.com +0.0.0.0 adserver.amnews.com +0.0.0.0 adserver.ancestry.com +0.0.0.0 adserver.anemo.com +0.0.0.0 adserver.anm.co.uk +0.0.0.0 adserver.aol.fr +0.0.0.0 adserver.archant.co.uk +0.0.0.0 adserver.artempireindustries.com +0.0.0.0 adserver.arttoday.com +0.0.0.0 adserver.atari.net +0.0.0.0 adserverb.conjelco.com +0.0.0.0 adserver.betandwin.de +0.0.0.0 adserver.billiger-surfen.de +0.0.0.0 adserver.billiger-telefonieren.de +0.0.0.0 adserver.bizland-inc.net +0.0.0.0 adserver.bluereactor.com +0.0.0.0 adserver.bluereactor.net +0.0.0.0 adserver.bluewin.ch +0.0.0.0 adserver.buttonware.com +0.0.0.0 adserver.buttonware.net +0.0.0.0 adserver.cams.com +0.0.0.0 adserver.cantv.net +0.0.0.0 adserver.cebu-online.com +0.0.0.0 adserver.cheatplanet.com +0.0.0.0 adserver.chickclick.com +0.0.0.0 adserver.click4cash.de +0.0.0.0 adserver.clubic.com +0.0.0.0 adserver.clundressed.com +0.0.0.0 adserver.co.il +0.0.0.0 adserver.colleges.com +0.0.0.0 adserver.com +0.0.0.0 adserver.comparatel.fr +0.0.0.0 adserver.com-solutions.com +0.0.0.0 adserver.conjelco.com +0.0.0.0 adserver.corusradionetwork.com +0.0.0.0 adserver.creative-asia.com +0.0.0.0 adserver.creativeinspire.com +0.0.0.0 adserver.dayrates.com +0.0.0.0 adserver.dbusiness.com +0.0.0.0 adserver.developersnetwork.com +0.0.0.0 adserver.devx.com +0.0.0.0 adserver.digitalpartners.com +0.0.0.0 adserver.digitoday.com +0.0.0.0 adserver.directforce.com +0.0.0.0 adserver.directforce.net +0.0.0.0 adserver.dnps.com +0.0.0.0 adserver.dotcommedia.de +0.0.0.0 adserver.dotmusic.com +0.0.0.0 adserver.eham.net +0.0.0.0 adserver.emapadserver.com +0.0.0.0 adserver.emporis.com +0.0.0.0 adserver.emulation64.com +0.0.0.0 adserver-espnet.sportszone.net +0.0.0.0 adserver.eudora.com +0.0.0.0 adserver.eva2000.com +0.0.0.0 adserver.expatica.nxs.nl +0.0.0.0 adserver.ezzhosting.com +0.0.0.0 adserver.filefront.com +0.0.0.0 adserver.fmpub.net +0.0.0.0 adserver.fr.adtech.de +0.0.0.0 adserver.freecity.de +0.0.0.0 adserver.freenet.de +0.0.0.0 adserver.friendfinder.com +0.0.0.0 adserver.gameparty.net +0.0.0.0 adserver.gamesquad.net +0.0.0.0 adserver.garden.com +0.0.0.0 adserver.gorillanation.com +0.0.0.0 adserver.gr +0.0.0.0 adserver.gunaxin.com +0.0.0.0 adserver.hardsextube.com +0.0.0.0 adserver.hardwareanalysis.com +0.0.0.0 adserver.harktheherald.com +0.0.0.0 adserver.harvestadsdepot.com +0.0.0.0 adserver.hellasnet.gr +0.0.0.0 adserver.hg-computer.de +0.0.0.0 adserver.hi-m.de +0.0.0.0 adserver.hispavista.com +0.0.0.0 adserver.hk.outblaze.com +0.0.0.0 adserver.home.pl +0.0.0.0 adserver.hostinteractive.com +0.0.0.0 adserver.humanux.com +0.0.0.0 adserver.hwupgrade.it +0.0.0.0 adserver.ifmagazine.com +0.0.0.0 adserver.ig.com.br +0.0.0.0 adserver.ign.com +0.0.0.0 adserver.ilounge.com +0.0.0.0 adserver.infinit.net +0.0.0.0 adserver.infotiger.com +0.0.0.0 adserver.interfree.it +0.0.0.0 adserver.inwind.it +0.0.0.0 adserver.ision.de +0.0.0.0 adserver.isonews.com +0.0.0.0 adserver.ixm.co.uk +0.0.0.0 adserver.jacotei.com.br +0.0.0.0 adserver.janes.com +0.0.0.0 adserver.janes.net +0.0.0.0 adserver.janes.org +0.0.0.0 adserver.jolt.co.uk +0.0.0.0 adserver.journalinteractive.com +0.0.0.0 adserver.juicyads.com +0.0.0.0 adserver.kcilink.com +0.0.0.0 adserver.killeraces.com +0.0.0.0 adserver.kylemedia.com +0.0.0.0 adserver.lanacion.com.ar +0.0.0.0 adserver.lanepress.com +0.0.0.0 adserver.latimes.com +0.0.0.0 adserver.legacy-network.com +0.0.0.0 adserver.libero.it +0.0.0.0 adserver.linktrader.co.uk +0.0.0.0 adserver.livejournal.com +0.0.0.0 adserver.lostreality.com +0.0.0.0 adserver.lunarpages.com +0.0.0.0 adserver.lycos.co.jp +0.0.0.0 adserver.m2kcore.com +0.0.0.0 adserver.magazyn.pl +0.0.0.0 adserver.matchcraft.com +0.0.0.0 adserver.merc.com +0.0.0.0 adserver.mindshare.de +0.0.0.0 adserver.mobsmith.com +0.0.0.0 adserver.monster.com +0.0.0.0 adserver.monstersandcritics.com +0.0.0.0 adserver.motonews.pl +0.0.0.0 adserver.myownemail.com +0.0.0.0 adserver.netcreators.nl +0.0.0.0 adserver.netshelter.net +0.0.0.0 adserver.newdigitalgroup.com +0.0.0.0 adserver.newmassmedia.net +0.0.0.0 adserver.news.com +0.0.0.0 adserver.news.com.au +0.0.0.0 adserver.news-journalonline.com +0.0.0.0 adserver.newtimes.com +0.0.0.0 adserver.ngz-network.de +0.0.0.0 adserver.nydailynews.com +0.0.0.0 adserver.nzoom.com +0.0.0.0 adserver.o2.pl +0.0.0.0 adserver.onwisconsin.com +0.0.0.0 adserver.passion.com +0.0.0.0 adserver.phatmax.net +0.0.0.0 adserver.phillyburbs.com +0.0.0.0 adserver.pl +0.0.0.0 adserver.planet-multiplayer.de +0.0.0.0 adserver.plhb.com +0.0.0.0 adserver.pollstar.com +0.0.0.0 adserver.portalofevil.com +0.0.0.0 adserver.portal.pl +0.0.0.0 adserver.portugalmail.pt +0.0.0.0 adserver.prodigy.net +0.0.0.0 adserver.proteinos.com +0.0.0.0 adserver.radio-canada.ca +0.0.0.0 adserver.ratestar.net +0.0.0.0 adserver.revver.com +0.0.0.0 adserver.ro +0.0.0.0 adserver.sabc.co.za +0.0.0.0 adserver.sabcnews.co.za +0.0.0.0 adserver.sanomawsoy.fi +0.0.0.0 adserver.scmp.com +0.0.0.0 adserver.securityfocus.com +0.0.0.0 adserver.sextracker.com +0.0.0.0 adserver.sharewareonline.com +0.0.0.0 adserver.singnet.com +0.0.0.0 adserver.sl.kharkov.ua +0.0.0.0 adserver.smashtv.com +0.0.0.0 adserver.snowball.com +0.0.0.0 adserver.softonic.com +0.0.0.0 adserver.soloserver.com +0.0.0.0 adserversolutions.com +0.0.0.0 adserver.swiatobrazu.pl +0.0.0.0 adserver.synergetic.de +0.0.0.0 adserver.telalink.net +0.0.0.0 adserver.te.pt +0.0.0.0 adserver.teracent.net +0.0.0.0 adserver.terra.com.br +0.0.0.0 adserver.terra.es +0.0.0.0 adserver.theknot.com +0.0.0.0 adserver.theonering.net +0.0.0.0 adserver.thirty4.com +0.0.0.0 adserver.thisislondon.co.uk +0.0.0.0 adserver.tilted.net +0.0.0.0 adserver.tqs.ca +0.0.0.0 adserver.track-star.com +0.0.0.0 adserver.trader.ca +0.0.0.0 adserver.trafficsyndicate.com +0.0.0.0 adserver.trb.com +0.0.0.0 adserver.tribuneinteractive.com +0.0.0.0 adserver.tsgadv.com +0.0.0.0 adserver.tulsaworld.com +0.0.0.0 adserver.tweakers.net +0.0.0.0 adserver.twitpic.com +0.0.0.0 adserver.ugo.com +0.0.0.0 adserver.ugo.nl +0.0.0.0 adserver.ukplus.co.uk +0.0.0.0 adserver.uproxx.com +0.0.0.0 adserver.usermagnet.com +0.0.0.0 adserver.van.net +0.0.0.0 adserver.virginmedia.com +0.0.0.0 adserver.virgin.net +0.0.0.0 adserver.virtualminds.nl +0.0.0.0 adserver.virtuous.co.uk +0.0.0.0 adserver.voir.ca +0.0.0.0 adserver.webads.co.uk +0.0.0.0 adserver.webads.nl +0.0.0.0 adserver.wemnet.nl +0.0.0.0 adserver.x3.hu +0.0.0.0 adserver.ya.com +0.0.0.0 adserver.yahoo.com +0.0.0.0 adserver.zaz.com.br +0.0.0.0 adserver.zeads.com +0.0.0.0 adserve.shopzilla.com +0.0.0.0 adserve.splicetoday.com +0.0.0.0 adserve.viaarena.com +0.0.0.0 adserv.free6.com +0.0.0.0 adserv.geocomm.com +0.0.0.0 adserv.iafrica.com +0.0.0.0 adservices.google.com +0.0.0.0 adservices.picadmedia.com +0.0.0.0 adservingcentral.com +0.0.0.0 adserving.cpxinteractive.com +0.0.0.0 adserv.internetfuel.com +0.0.0.0 adserv.jupiter.com +0.0.0.0 adserv.lwmn.net +0.0.0.0 adserv.maineguide.com +0.0.0.0 adserv.muchosucko.com +0.0.0.0 adserv.mywebtimes.com +0.0.0.0 adserv.pitchforkmedia.com +0.0.0.0 adserv.postbulletin.com +0.0.0.0 adserv.qconline.com +0.0.0.0 adserv.quality-channel.de +0.0.0.0 adserv.usps.com +0.0.0.0 adserwer.o2.pl +0.0.0.0 ads.espn.adsonar.com +0.0.0.0 ads.eudora.com +0.0.0.0 ads.eu.msn.com +0.0.0.0 ads.euniverseads.com +0.0.0.0 adseu.novem.pl +0.0.0.0 ads.examiner.net +0.0.0.0 ads.exhedra.com +0.0.0.0 ads.expedia.com +0.0.0.0 ads.expekt.com +0.0.0.0 ads.ezboard.com +0.0.0.0 adsfac.eu +0.0.0.0 adsfac.net +0.0.0.0 adsfac.us +0.0.0.0 ads.fairfax.com.au +0.0.0.0 ads.fark.com +0.0.0.0 ads.fayettevillenc.com +0.0.0.0 ads.filecloud.com +0.0.0.0 ads.fileindexer.com +0.0.0.0 ads.filmup.com +0.0.0.0 ads.first-response.be +0.0.0.0 ads.flabber.nl +0.0.0.0 ads.flashgames247.com +0.0.0.0 ads.fling.com +0.0.0.0 ads.floridatoday.com +0.0.0.0 ads.fool.com +0.0.0.0 ads.forbes.com +0.0.0.0 ads.forbes.net +0.0.0.0 ads.fortunecity.com +0.0.0.0 ads.fredericksburg.com +0.0.0.0 ads.freebannertrade.com +0.0.0.0 ads.freshmeat.net +0.0.0.0 ads.fresnobee.com +0.0.0.0 ads.friendfinder.com +0.0.0.0 ads.ft.com +0.0.0.0 ads.gamblinghit.com +0.0.0.0 ads.gamecity.net +0.0.0.0 ads.gamecopyworld.no +0.0.0.0 ads.gameinformer.com +0.0.0.0 ads.game.net +0.0.0.0 ads.gamershell.com +0.0.0.0 ads.gamespy.com +0.0.0.0 ads.gamespyid.com +0.0.0.0 ads.gateway.com +0.0.0.0 ads.gawker.com +0.0.0.0 ads.gettools.com +0.0.0.0 ads.gigaom.com.php5-12.websitetestlink.com +0.0.0.0 ads.globeandmail.com +0.0.0.0 ads.gmg.valueclick.net +0.0.0.0 ads.gmodules.com +0.0.0.0 ads.god.co.uk +0.0.0.0 ads.gorillanation.com +0.0.0.0 ads.gplusmedia.com +0.0.0.0 ads.granadamedia.com +0.0.0.0 ads.greenbaypressgazette.com +0.0.0.0 ads.greenvilleonline.com +0.0.0.0 ads.guardian.co.uk +0.0.0.0 ads.guardianunlimited.co.uk +0.0.0.0 ads.gunaxin.com +0.0.0.0 ads.halogennetwork.com +0.0.0.0 ads.hamptonroads.com +0.0.0.0 ads.hamtonroads.com +0.0.0.0 ads.hardwarezone.com +0.0.0.0 ads.harpers.org +0.0.0.0 ads.hbv.de +0.0.0.0 ads.hearstmags.com +0.0.0.0 ads.heartlight.org +0.0.0.0 ads.herald-mail.com +0.0.0.0 ads.heraldnet.com +0.0.0.0 ads.heraldonline.com +0.0.0.0 ads.heraldsun.com +0.0.0.0 ads.heroldonline.com +0.0.0.0 ads.he.valueclick.net +0.0.0.0 ads.hitcents.com +0.0.0.0 ads.hlwd.valueclick.net +0.0.0.0 ads.hollandsentinel.com +0.0.0.0 ads.hollywood.com +0.0.0.0 ads.hooqy.com +0.0.0.0 ads.hothardware.com +0.0.0.0 ad.showbizz.net +0.0.0.0 ads.hulu.com.edgesuite.net +#0.0.0.0 ads.hulu.com # Uncomment to block Hulu. +0.0.0.0 ads.humorbua.no +0.0.0.0 ads.i12.de +0.0.0.0 ads.i33.com +0.0.0.0 ads.iafrica.com +0.0.0.0 ads.i-am-bored.com +0.0.0.0 ads.iboost.com +0.0.0.0 ads.icq.com +0.0.0.0 ads.iforex.com +0.0.0.0 ads.ign.com +0.0.0.0 ads.illuminatednation.com +0.0.0.0 ads.imdb.com +0.0.0.0 ads.imgur.com +0.0.0.0 ads.imposibil.ro +0.0.0.0 ads.indiatimes.com +0.0.0.0 ads.indya.com +0.0.0.0 ads.indystar.com +0.0.0.0 ads.inedomedia.com +0.0.0.0 ads.inetdirectories.com +0.0.0.0 ads.inetinteractive.com +0.0.0.0 ads.infi.net +0.0.0.0 ads.infospace.com +0.0.0.0 adsinimages.com +0.0.0.0 ads.injersey.com +0.0.0.0 ads.insidehighered.com +0.0.0.0 ads.intellicast.com +0.0.0.0 ads.internic.co.il +0.0.0.0 ads.inthesidebar.com +0.0.0.0 adsintl.starwave.com +0.0.0.0 ads.iol.co.il +0.0.0.0 ads.ipowerweb.com +0.0.0.0 ads.ireport.com +0.0.0.0 ads.isat-tech.com +0.0.0.0 ads.isoftmarketing.com +0.0.0.0 ads.isum.de +0.0.0.0 ads.itv.com +0.0.0.0 ads.iwon.com +0.0.0.0 ads.jacksonville.com +0.0.0.0 ads.jeneauempire.com +0.0.0.0 ads.jetpackdigital.com +0.0.0.0 ads.jetphotos.net +0.0.0.0 ads.jewcy.com +0.0.0.0 ads.jimworld.com +0.0.0.0 ads.joetec.net +0.0.0.0 ads.jokaroo.com +0.0.0.0 ads.jornadavirtual.com.mx +0.0.0.0 ads.jossip.com +0.0.0.0 ads.jpost.com +0.0.0.0 ads.jubii.dk +0.0.0.0 ads.juicyads.com +0.0.0.0 ads.juneauempire.com +0.0.0.0 ads.jwtt3.com +0.0.0.0 ads.kazaa.com +0.0.0.0 ads.keywordblocks.com +0.0.0.0 ads.kixer.com +0.0.0.0 ads.kleinman.com +0.0.0.0 ads.kmpads.com +0.0.0.0 ads.koreanfriendfinder.com +0.0.0.0 ads.ksl.com +0.0.0.0 ad.slashgear.com +0.0.0.0 ads.leo.org +0.0.0.0 ads.lfstmedia.com +0.0.0.0 ads.lilengine.com +0.0.0.0 ads.link4ads.com +0.0.0.0 ads.linksponsor.com +0.0.0.0 ads.linktracking.net +0.0.0.0 ads.linuxjournal.com +0.0.0.0 ads.linuxsecurity.com +0.0.0.0 ads.list-universe.com +0.0.0.0 ads.live365.com +0.0.0.0 ads.ljworld.com +0.0.0.0 ads.lnkworld.com +0.0.0.0 ads.localnow.com +0.0.0.0 ads-local.sixapart.com +0.0.0.0 ads.lubbockonline.com +0.0.0.0 ads.lucidmedia.com +0.0.0.0 ads.lucidmedia.com.gslb.com +0.0.0.0 ads.lycos.com +0.0.0.0 ads.lycos-europe.com +0.0.0.0 ads.lzjl.com +0.0.0.0 ads.macnews.de +0.0.0.0 ads.macupdate.com +0.0.0.0 ads.madisonavenue.com +0.0.0.0 ads.madison.com +0.0.0.0 ads.magnetic.is +0.0.0.0 ads.mail.com +0.0.0.0 ads.mambocommunities.com +0.0.0.0 ad.sma.punto.net +0.0.0.0 ads.mariuana.it +0.0.0.0 adsmart.com +0.0.0.0 adsmart.co.uk +0.0.0.0 adsmart.net +0.0.0.0 ads.mcafee.com +0.0.0.0 ads.mdchoice.com +0.0.0.0 ads.mediamayhemcorp.com +0.0.0.0 ads.mediaodyssey.com +0.0.0.0 ads.mediaturf.net +0.0.0.0 ads.mefeedia.com +0.0.0.0 ads.megaproxy.com +0.0.0.0 ads.metblogs.com +0.0.0.0 ads.mgnetwork.com +0.0.0.0 ads.mindsetnetwork.com +0.0.0.0 ads.miniclip.com +0.0.0.0 ads.mininova.org +0.0.0.0 ads.mircx.com +0.0.0.0 ads.mixtraffic.com +0.0.0.0 ads.mlive.com +0.0.0.0 ads.mm.ap.org +0.0.0.0 ads.mndaily.com +0.0.0.0 ad.smni.com +0.0.0.0 ads.mobiledia.com +0.0.0.0 ads.mobygames.com +0.0.0.0 ads.modbee.com +0.0.0.0 ads.mofos.com +0.0.0.0 ads.money.pl +0.0.0.0 ads.monster.com +0.0.0.0 ads.mouseplanet.com +0.0.0.0 ads.movieweb.com +0.0.0.0 ads.mp3searchy.com +0.0.0.0 adsm.soush.com +0.0.0.0 ads.mt.valueclick.net +0.0.0.0 ads.mtv.uol.com.br +0.0.0.0 ads.multimania.lycos.fr +0.0.0.0 ads.musiccity.com +0.0.0.0 ads.mustangworks.com +0.0.0.0 ads.mysimon.com +0.0.0.0 ads.mytelus.com +0.0.0.0 ads.nandomedia.com +0.0.0.0 ads.nationalreview.com +0.0.0.0 ads.nativeinstruments.de +0.0.0.0 ads.neoseeker.com +0.0.0.0 ads.neowin.net +0.0.0.0 ads.nerve.com +0.0.0.0 ads.netmechanic.com +0.0.0.0 ads.networkwcs.net +0.0.0.0 ads.networldmedia.net +0.0.0.0 ads.neudesicmediagroup.com +0.0.0.0 ads.newcity.com +0.0.0.0 ads.newcitynet.com +0.0.0.0 ads.newdream.net +0.0.0.0 ads.newgrounds.com +0.0.0.0 ads.newsint.co.uk +0.0.0.0 ads.newsminerextra.com +0.0.0.0 ads.newsobserver.com +0.0.0.0 ads.newsquest.co.uk +0.0.0.0 ads.newtention.net +0.0.0.0 ads.newtimes.com +0.0.0.0 adsnew.userfriendly.org +0.0.0.0 ads.ngenuity.com +0.0.0.0 ads.ninemsn.com.au +0.0.0.0 adsniper.ru +0.0.0.0 ads.nola.com +0.0.0.0 ads.northjersey.com +0.0.0.0 ads.novem.pl +0.0.0.0 ads.nowrunning.com +0.0.0.0 ads.npr.valueclick.net +0.0.0.0 ads.ntadvice.com +0.0.0.0 ads.nudecards.com +0.0.0.0 ads.nwsource.com +0.0.0.0 ads.nwsource.com.edgesuite.net +0.0.0.0 ads.nyi.net +0.0.0.0 ads.nyjournalnews.com +0.0.0.0 ads.nypost.com +0.0.0.0 ads.nytimes.com +0.0.0.0 ads.o2.pl +0.0.0.0 adsoftware.com +0.0.0.0 adsoldier.com +0.0.0.0 ads.ole.com +0.0.0.0 ads.omaha.com +0.0.0.0 adsonar.com +0.0.0.0 adson.awempire.com +0.0.0.0 ads.onlineathens.com +0.0.0.0 ads.online.ie +0.0.0.0 ads.onvertise.com +0.0.0.0 ads.ookla.com +0.0.0.0 ads.open.pl +0.0.0.0 ads.opensubtitles.org +0.0.0.0 ads.oregonlive.com +0.0.0.0 ads.orsm.net +0.0.0.0 ads.osdn.com +0.0.0.0 ad-souk.com +0.0.0.0 adspaces.ero-advertising.com +0.0.0.0 ads.parrysound.com +0.0.0.0 ads.partner2profit.com +0.0.0.0 ads.pastemagazine.com +0.0.0.0 ads.paxnet.co.kr +0.0.0.0 ads.pcper.com +0.0.0.0 ads.pdxguide.com +0.0.0.0 ads.peel.com +0.0.0.0 ads.peninsulaclarion.com +0.0.0.0 ads.penny-arcade.com +0.0.0.0 ads.pennyweb.com +0.0.0.0 ads.people.com.cn +0.0.0.0 ads.pg.valueclick.net +0.0.0.0 ads.pheedo.com +0.0.0.0 ads.phillyburbs.com +0.0.0.0 ads.phpclasses.org +0.0.0.0 ads.pilotonline.com +0.0.0.0 adspirit.net +0.0.0.0 adspiro.pl +0.0.0.0 ads.pitchforkmedia.com +0.0.0.0 ads.pittsburghlive.com +0.0.0.0 ads.pixiq.com +0.0.0.0 ads.place1.com +0.0.0.0 ads.planet-f1.com +0.0.0.0 ads.plantyours.com +0.0.0.0 ads.pni.com +0.0.0.0 ads.pno.net +0.0.0.0 ads.poconorecord.com +0.0.0.0 ads.pointroll.com +0.0.0.0 ads.portlandmercury.com +0.0.0.0 ads.premiumnetwork.com +0.0.0.0 ads.premiumnetwork.net +0.0.0.0 ads.pressdemo.com +0.0.0.0 ads.pricescan.com +0.0.0.0 ads.primaryclick.com +0.0.0.0 ads.primeinteractive.net +0.0.0.0 ads.prisacom.com +0.0.0.0 ads.profitsdeluxe.com +0.0.0.0 ads.profootballtalk.com +0.0.0.0 ads.program3.com +0.0.0.0 ads.pro-market.net +0.0.0.0 ads.pro-market.net.edgesuite.net +0.0.0.0 ads.prospect.org +0.0.0.0 ads.pubmatic.com +0.0.0.0 ads.queendom.com +0.0.0.0 ads.quicken.com +0.0.0.0 adsr3pg.com.br +0.0.0.0 ads.rackshack.net +0.0.0.0 ads.rasmussenreports.com +0.0.0.0 ads.ratemyprofessors.com +0.0.0.0 adsrc.bankrate.com +0.0.0.0 ads.rcgroups.com +0.0.0.0 ads.rdstore.com +0.0.0.0 ads.realcastmedia.com +0.0.0.0 ads.realcities.com +0.0.0.0 ads.realmedia.de +0.0.0.0 ads.realtechnetwork.net +0.0.0.0 ads.reason.com +0.0.0.0 ads.rediff.com +0.0.0.0 ads.redorbit.com +0.0.0.0 ads.register.com +0.0.0.0 adsremote.scripps.com +0.0.0.0 adsremote.scrippsnetwork.com +0.0.0.0 ads.revenews.com +0.0.0.0 ads.revenue.net +0.0.0.0 adsrevenue.net +0.0.0.0 ads.revsci.net +0.0.0.0 ads.rim.co.uk +0.0.0.0 ads-rm.looksmart.com +0.0.0.0 ads.roanoke.com +0.0.0.0 ads.rockstargames.com +0.0.0.0 ads.rodale.com +0.0.0.0 ads.roiserver.com +0.0.0.0 ads.rondomondo.com +0.0.0.0 ads.rootzoo.com +0.0.0.0 ads.rottentomatoes.com +0.0.0.0 ads.rp-online.de +0.0.0.0 ads.ruralpress.com +0.0.0.0 adsrv2.wilmingtonstar.com +0.0.0.0 adsrv.bankrate.com +0.0.0.0 adsrv.dispatch.com +0.0.0.0 adsrv.emporis.com +0.0.0.0 adsrv.heraldtribune.com +0.0.0.0 adsrv.hpg.com.br +0.0.0.0 adsrv.iol.co.za +0.0.0.0 adsrv.lua.pl +0.0.0.0 adsrv.news.com.au +0.0.0.0 adsrvr.com +0.0.0.0 adsrv.tuscaloosanews.com +0.0.0.0 adsrv.wilmingtonstar.com +0.0.0.0 ads.sacbee.com +0.0.0.0 ads.satyamonline.com +0.0.0.0 ads.savannahnow.com +0.0.0.0 ads.scabee.com +0.0.0.0 ads.schwabtrader.com +0.0.0.0 ads.scifi.com +0.0.0.0 ads.seattletimes.com +0.0.0.0 ads.sfusion.com +0.0.0.0 ads.shizmoo.com +0.0.0.0 ads.shoppingads.com +0.0.0.0 ads.shoutfile.com +0.0.0.0 ads.sify.com +0.0.0.0 ads.simtel.com +0.0.0.0 ads.simtel.net +0.0.0.0 ads.sitemeter.com +0.0.0.0 ads.sixapart.com +0.0.0.0 adssl01.adtech.de +0.0.0.0 adssl01.adtech.fr +0.0.0.0 adssl01.adtech.us +0.0.0.0 adssl02.adtech.de +0.0.0.0 adssl02.adtech.fr +0.0.0.0 adssl02.adtech.us +0.0.0.0 ads.sl.interpals.net +0.0.0.0 ads.smartclick.com +0.0.0.0 ads.smartclicks.com +0.0.0.0 ads.smartclicks.net +0.0.0.0 ads.snowball.com +0.0.0.0 ads.socialmedia.com +0.0.0.0 ads.sohh.com +0.0.0.0 ads.somethingawful.com +0.0.0.0 ads.space.com +0.0.0.0 adsspace.net +0.0.0.0 ads.specificclick.com +0.0.0.0 ads.specificmedia.com +0.0.0.0 ads.specificpop.com +0.0.0.0 ads.sptimes.com +0.0.0.0 ads.spymac.net +0.0.0.0 ads.stackoverflow.com +0.0.0.0 ads.starbanner.com +0.0.0.0 ads.stephensmedia.com +0.0.0.0 ads.stileproject.com +0.0.0.0 ads.stupid.com +0.0.0.0 ads.sunjournal.com +0.0.0.0 ads.sup.com +0.0.0.0 ads.swiftnews.com +0.0.0.0 ads.switchboard.com +0.0.0.0 ads.teamyehey.com +0.0.0.0 ads.technoratimedia.com +0.0.0.0 ads.techtv.com +0.0.0.0 ads.techvibes.com +0.0.0.0 ads.techweb.com +0.0.0.0 ads.telegraaf.nl +0.0.0.0 ads.telegraph.co.uk +0.0.0.0 ads.the15thinternet.com +0.0.0.0 ads.theawl.com +0.0.0.0 ads.thebugs.ws +0.0.0.0 ads.thecoolhunter.net +0.0.0.0 ads.thecrimson.com +0.0.0.0 ads.thefrisky.com +0.0.0.0 ads.thegauntlet.com +0.0.0.0 ads.theglobeandmail.com +0.0.0.0 ads.theindependent.com +0.0.0.0 ads.theolympian.com +0.0.0.0 ads.thesmokinggun.com +0.0.0.0 ads.thestar.com #Toronto Star +0.0.0.0 ads.thestranger.com +0.0.0.0 ads.thewebfreaks.com +0.0.0.0 adstil.indiatimes.com +0.0.0.0 ads.timesunion.com +0.0.0.0 ads.tiscali.fr +0.0.0.0 ads.tmcs.net +0.0.0.0 ads.tnt.tv +0.0.0.0 adstogo.com +0.0.0.0 adstome.com +0.0.0.0 ads.top500.org #TOP500 SuperComputer Site +0.0.0.0 ads.top-banners.com +0.0.0.0 ads.toronto.com +0.0.0.0 ads.townhall.com +0.0.0.0 ads.track.net +0.0.0.0 ads.traderonline.com +0.0.0.0 ads.traffichaus.com +0.0.0.0 ads.trafficjunky.net +0.0.0.0 ads.traffikings.com +0.0.0.0 adstream.cardboardfish.com +0.0.0.0 adstreams.org +0.0.0.0 ads.treehugger.com +0.0.0.0 ads.tricityherald.com +0.0.0.0 ads.trinitymirror.co.uk +0.0.0.0 ads.tripod.com +0.0.0.0 ads.tripod.lycos.co.uk +0.0.0.0 ads.tripod.lycos.de +0.0.0.0 ads.tripod.lycos.es +0.0.0.0 ads.tromaville.com +0.0.0.0 ads-t.ru +0.0.0.0 ads.trutv.com +0.0.0.0 ads.tucows.com +0.0.0.0 ads.tw.adsonar.com +0.0.0.0 ads.ucomics.com +0.0.0.0 ads.uigc.net +0.0.0.0 ads.undertone.com +0.0.0.0 ads.unixathome.org +0.0.0.0 ads.update.com +0.0.0.0 ad.suprnova.org +0.0.0.0 ads.uproar.com +0.0.0.0 ads.urbandictionary.com +0.0.0.0 ads.usatoday.com +0.0.0.0 ads.us.e-planning.ne +0.0.0.0 ads.us.e-planning.net +0.0.0.0 ads.userfriendly.org +0.0.0.0 ads.v3.com +0.0.0.0 ads.v3exchange.com +0.0.0.0 ads.vaildaily.com +0.0.0.0 ads.valuead.com +0.0.0.0 ads.vegas.com +0.0.0.0 ads.veloxia.com +0.0.0.0 ads.ventivmedia.com +0.0.0.0 ads.veoh.com +0.0.0.0 ads.verkata.com +0.0.0.0 ads.vesperexchange.com +0.0.0.0 ads.vg.basefarm.net +0.0.0.0 ads.viddler.com +0.0.0.0 ads.videoadvertising.com +0.0.0.0 ads.viewlondon.co.uk +0.0.0.0 ads.virginislandsdailynews.com +0.0.0.0 ads.virtualcountries.com +0.0.0.0 ads.vnuemedia.com +0.0.0.0 adsvr.adknowledge.com +0.0.0.0 ads.vs.co +0.0.0.0 ads.vs.com +0.0.0.0 ads.wanadooregie.com +0.0.0.0 ads.warcry.com +0.0.0.0 ads.watershed-publishing.com +0.0.0.0 ads.wave.si +0.0.0.0 ads.weather.ca +0.0.0.0 ads.weather.com +0.0.0.0 ads.web21.com +0.0.0.0 ads.web.alwayson-network.com +0.0.0.0 ads.web.aol.com +0.0.0.0 ads.webattack.com +0.0.0.0 ads.web.compuserve.com +0.0.0.0 ads.webcoretech.com +0.0.0.0 ads.web.cs.com +0.0.0.0 ads.web.de +0.0.0.0 ads.webfeat.com +0.0.0.0 ads.webheat.com +0.0.0.0 ads.webhosting.info +0.0.0.0 ads.webindia123.com +0.0.0.0 ads-web.mail.com +0.0.0.0 ads.webmd.com +0.0.0.0 ads.webnet.advance.net +0.0.0.0 ads.websponsors.com +0.0.0.0 adsweb.tiscali.cz +0.0.0.0 ads.weissinc.com +0.0.0.0 ads.whaleads.com +0.0.0.0 ads.whi.co.nz +0.0.0.0 ads.winsite.com +0.0.0.0 ads.wnd.com +0.0.0.0 ads.wunderground.com +0.0.0.0 ads.x10.com +0.0.0.0 ads.x10.net +0.0.0.0 ads.x17online.com +0.0.0.0 ads.xboxic.com +0.0.0.0 ads.xbox-scene.com +0.0.0.0 ads.xposed.com +0.0.0.0 ads.xtra.ca +0.0.0.0 ads.xtra.co.nz +0.0.0.0 ads.xtramsn.co.nz +0.0.0.0 ads.yahoo.com +0.0.0.0 ads.yimg.com +0.0.0.0 ads.yimg.com.edgesuite.net +0.0.0.0 ads.yldmgrimg.net +0.0.0.0 adsyndication.msn.com +0.0.0.0 adsyndication.yelldirect.com +0.0.0.0 adsynergy.com +0.0.0.0 ads.youporn.com +0.0.0.0 ads.youtube.com +0.0.0.0 adsys.townnews.com +0.0.0.0 ads.zap2it.com +0.0.0.0 ads.zdnet.com +0.0.0.0 adtag.msn.ca +0.0.0.0 adtag.sympatico.ca +0.0.0.0 adtaily.com +0.0.0.0 adtaily.pl +0.0.0.0 ad.tbn.ru +0.0.0.0 adtcp.ru +0.0.0.0 adtech.de +0.0.0.0 ad.technoramedia.com +0.0.0.0 adtech.panthercustomer.com +0.0.0.0 adtechus.com +0.0.0.0 adtegrity.spinbox.net +0.0.0.0 adtext.pl +0.0.0.0 ad.text.tbn.ru +0.0.0.0 ad.tgdaily.com +0.0.0.0 ad.thehill.com +0.0.0.0 ad.thetyee.ca +0.0.0.0 ad.thewheelof.com +0.0.0.0 adthru.com +0.0.0.0 adtigerpl.adspirit.net +0.0.0.0 ad.tiscali.com +0.0.0.0 adtlgc.com +0.0.0.0 adtology3.com +0.0.0.0 ad.tomshardware.com +0.0.0.0 adtotal.pl +0.0.0.0 adtracking.vinden.nl +0.0.0.0 adtrader.com +0.0.0.0 ad.trafficmp.com +0.0.0.0 adtrak.net +0.0.0.0 ad.turn.com +0.0.0.0 ad.tv2.no +0.0.0.0 ad.twitchguru.com +0.0.0.0 ad.ubnm.co.kr +0.0.0.0 ad.uk.tangozebra.com +0.0.0.0 ad-uk.tiscali.com +0.0.0.0 adultadworld.com +0.0.0.0 ad.usatoday.com +0.0.0.0 adv0005.247realmedia.com +0.0.0.0 adv0035.247realmedia.com +0.0.0.0 adv.440net.com +0.0.0.0 adv.adgates.com +0.0.0.0 adv.adtotal.pl +0.0.0.0 adv.adview.pl +0.0.0.0 adv.bannercity.ru +0.0.0.0 adv.bbanner.it +0.0.0.0 adv.bookclubservices.ca +0.0.0.0 adveng.hiasys.com +0.0.0.0 adveraction.pl +0.0.0.0 advert.bayarea.com +0.0.0.0 advertise.com +0.0.0.0 advertisers.federatedmedia.net +0.0.0.0 advertising.aol.com +0.0.0.0 advertisingbay.com +0.0.0.0 advertising.bbcworldwide.com +0.0.0.0 advertising.com +0.0.0.0 advertising.gfxartist.com +0.0.0.0 advertising.hiasys.com +0.0.0.0 advertising.illinimedia.com +0.0.0.0 advertising.online-media24.de +0.0.0.0 advertising.paltalk.com +0.0.0.0 advertising.wellpack.fr +0.0.0.0 advertising.zenit.org +0.0.0.0 advertlets.com +0.0.0.0 advertpro.investorvillage.com +0.0.0.0 advertpro.sitepoint.com +0.0.0.0 adverts.digitalspy.co.uk +0.0.0.0 adverts.ecn.co.uk +0.0.0.0 adverts.freeloader.com +0.0.0.0 adverts.im4ges.com +0.0.0.0 advertstream.com +0.0.0.0 advert.uloz.to +0.0.0.0 adv.federalpost.ru +0.0.0.0 adv.gazeta.pl +0.0.0.0 advicepl.adocean.pl +0.0.0.0 adview.pl +0.0.0.0 adviva.net +0.0.0.0 adv.lampsplus.com +0.0.0.0 advmaker.ru +0.0.0.0 adv.merlin.co.il +0.0.0.0 adv.netshelter.net +0.0.0.0 adv.publy.net +0.0.0.0 adv.surinter.net +0.0.0.0 advt.webindia123.com +0.0.0.0 ad.vurts.com +0.0.0.0 adv.virgilio.it +0.0.0.0 adv.webmd.com +0.0.0.0 adv.wp.pl +0.0.0.0 adv.zapal.ru +0.0.0.0 advzilla.com +0.0.0.0 adware.kogaryu.com +0.0.0.0 adweb2.hornymatches.com +0.0.0.0 ad.webprovider.com +0.0.0.0 adw.sapo.pt +0.0.0.0 ad.wsod.com +0.0.0.0 adx.adrenalinesk.sk +0.0.0.0 adx.gainesvillesun.com +0.0.0.0 adx.gainesvillsun.com +0.0.0.0 adx.groupstate.com +0.0.0.0 adx.hendersonvillenews.com +0.0.0.0 adx.heraldtribune.com +0.0.0.0 adxpose.com +0.0.0.0 adx.starnewsonline.com +0.0.0.0 ad.xtendmedia.com +0.0.0.0 adx.theledger.com +0.0.0.0 ad.yadro.ru +0.0.0.0 ad.yieldmanager.com +0.0.0.0 adz.afterdawn.net +0.0.0.0 ad.zanox.com +0.0.0.0 adzerk.net +0.0.0.0 ad.zodera.hu +0.0.0.0 adzone.ro +0.0.0.0 adzone.stltoday.com +0.0.0.0 adzservice.theday.com +0.0.0.0 ae.goodsblock.marketgid.com +0.0.0.0 afe2.specificclick.net +0.0.0.0 afe.specificclick.net +0.0.0.0 aff.foxtab.com +0.0.0.0 affiliate.a4dtracker.com +0.0.0.0 affiliate.aol.com +0.0.0.0 affiliate.baazee.com +0.0.0.0 affiliate.cfdebt.com +0.0.0.0 affiliate.exabytes.com.my +0.0.0.0 affiliate-fr.com +0.0.0.0 affiliate.fr.espotting.com +0.0.0.0 affiliate.googleusercontent.com +0.0.0.0 affiliate.hbytracker.com +0.0.0.0 affiliate.mlntracker.com +0.0.0.0 affiliates.arvixe.com +0.0.0.0 affiliates.eblastengine.com +0.0.0.0 affiliates.genealogybank.com +0.0.0.0 affiliates.globat.com +0.0.0.0 affiliation-france.com +0.0.0.0 affimg.pop6.com +0.0.0.0 afform.co.uk +0.0.0.0 affpartners.com +0.0.0.0 aff.ringtonepartner.com +0.0.0.0 afi.adocean.pl +0.0.0.0 afilo.pl +0.0.0.0 agkn.com +0.0.0.0 aj.600z.com +0.0.0.0 ajcclassifieds.com +0.0.0.0 akaads-espn.starwave.com +0.0.0.0 aka-cdn.adtechus.com +0.0.0.0 aka-cdn-ns.adtech.de +0.0.0.0 aka-cdn-ns.adtechus.com +0.0.0.0 akamai.invitemedia.com +0.0.0.0 ak.buyservices.com +0.0.0.0 a.kerg.net +0.0.0.0 ak.maxserving.com +0.0.0.0 ako.cc +0.0.0.0 ak.p.openx.net +0.0.0.0 al1.sharethis.com +0.0.0.0 alert.police-patrol-agent.com +0.0.0.0 a.ligatus.com +0.0.0.0 a.ligatus.de +0.0.0.0 alliance.adbureau.net +0.0.0.0 all.orfr.adgtw.orangeads.fr +0.0.0.0 altfarm.mediaplex.com +0.0.0.0 amch.questionmarket.com +0.0.0.0 americansingles.click-url.com +0.0.0.0 a.mktw.net +0.0.0.0 amscdn.btrll.com +0.0.0.0 analysis.fc2.com +0.0.0.0 analytics.kwebsoft.com +0.0.0.0 analytics.percentmobile.com +0.0.0.0 analyzer51.fc2.com +0.0.0.0 ankieta-online.pl +0.0.0.0 annuaire-autosurf.com +0.0.0.0 anrtx.tacoda.net +0.0.0.0 answers.us.intellitxt.com +0.0.0.0 an.tacoda.net +0.0.0.0 an.yandex.ru +0.0.0.0 apex-ad.com +0.0.0.0 api.addthis.com +0.0.0.0 api.affinesystems.com +0.0.0.0 api-public.addthis.com +0.0.0.0 apopt.hbmediapro.com +0.0.0.0 apparelncs.com +0.0.0.0 apparel-offer.com +0.0.0.0 appdev.addthis.com +0.0.0.0 appnexus.com +0.0.0.0 apps5.oingo.com +0.0.0.0 app.scanscout.com +0.0.0.0 ap.read.mediation.pns.ap.orangeads.fr +0.0.0.0 a.prisacom.com +0.0.0.0 apx.moatads.com +0.0.0.0 a.rad.live.com +0.0.0.0 a.rad.msn.com +0.0.0.0 arbomedia.pl +0.0.0.0 arbopl.bbelements.com +0.0.0.0 arsconsole.global-intermedia.com +0.0.0.0 art-music-rewardpath.com +0.0.0.0 art-offer.com +0.0.0.0 art-offer.net +0.0.0.0 art-photo-music-premiumblvd.com +0.0.0.0 art-photo-music-rewardempire.com +0.0.0.0 art-photo-music-savingblvd.com +0.0.0.0 as1.falkag.de +0.0.0.0 as1image1.adshuffle.com +0.0.0.0 as1image2.adshuffle.com +0.0.0.0 as1.inoventiv.com +0.0.0.0 as2.falkag.de +0.0.0.0 as3.falkag.de +0.0.0.0 as4.falkag.de +0.0.0.0 as.5to1.com +0.0.0.0 asa.tynt.com +0.0.0.0 asb.tynt.com +0.0.0.0 as.casalemedia.com +0.0.0.0 as.ebz.io +0.0.0.0 asg01.casalemedia.com +0.0.0.0 asg02.casalemedia.com +0.0.0.0 asg03.casalemedia.com +0.0.0.0 asg04.casalemedia.com +0.0.0.0 asg05.casalemedia.com +0.0.0.0 asg06.casalemedia.com +0.0.0.0 asg07.casalemedia.com +0.0.0.0 asg08.casalemedia.com +0.0.0.0 asg09.casalemedia.com +0.0.0.0 asg10.casalemedia.com +0.0.0.0 asg11.casalemedia.com +0.0.0.0 asg12.casalemedia.com +0.0.0.0 asg13.casalemedia.com +0.0.0.0 ask-gps.ru +0.0.0.0 asklots.com +0.0.0.0 askmen.thruport.com +0.0.0.0 asm2.z1.adserver.com +0.0.0.0 asm3.z1.adserver.com +0.0.0.0 asn.advolution.de +0.0.0.0 asn.cunda.advolution.biz +0.0.0.0 a.ss34.on9mail.com +0.0.0.0 assets.igapi.com +0.0.0.0 assets.kixer.com +0.0.0.0 assets.percentmobile.com +0.0.0.0 as.sexad.net +0.0.0.0 asv.nuggad.net +0.0.0.0 as.vs4entertainment.com +0.0.0.0 as.webmd.com +0.0.0.0 a.tadd.react2media.com +0.0.0.0 at-adserver.alltop.com +0.0.0.0 at.campaigns.f2.com.au +0.0.0.0 at.ceofreehost.com +0.0.0.0 atdmt.com +0.0.0.0 atemda.com +0.0.0.0 athena-ads.wikia.com +0.0.0.0 at.m1.nedstatbasic.net +0.0.0.0 a.total-media.net +0.0.0.0 a.tribalfusion.com +0.0.0.0 a.triggit.com +0.0.0.0 au.adserver.yahoo.com +0.0.0.0 au.ads.link4ads.com +0.0.0.0 aud.pubmatic.com +0.0.0.0 aureate.com +0.0.0.0 auslieferung.commindo-media-ressourcen.de +0.0.0.0 austria1.adverserve.net +0.0.0.0 autocontext.begun.ru +0.0.0.0 automotive-offer.com +0.0.0.0 automotive-rewardpath.com +0.0.0.0 avcounter10.com +0.0.0.0 avpa.dzone.com +0.0.0.0 avpa.javalobby.org +0.0.0.0 a.websponsors.com +0.0.0.0 awesomevipoffers.com +0.0.0.0 awrz.net +0.0.0.0 axp.zedo.com +0.0.0.0 azcentra.app.ur.gcion.com +0.0.0.0 azoogleads.com +0.0.0.0 b1.adbrite.com +0.0.0.0 b1.azjmp.com +0.0.0.0 b2b.filecloud.me +0.0.0.0 babycenter.tt.omtrdc.net +0.0.0.0 b.ads2.msn.com +0.0.0.0 badservant.guj.de +0.0.0.0 b.am15.net +0.0.0.0 bananacashback.com +0.0.0.0 banery.acr.pl +0.0.0.0 banery.netart.pl +0.0.0.0 banery.onet.pl +0.0.0.0 banki.onet.pl +0.0.0.0 bankofamerica.tt.omtrdc.net +0.0.0.0 banman.nepsecure.co.uk +0.0.0.0 banner.1and1.co.uk +0.0.0.0 banner1.pornhost.com +0.0.0.0 banner2.inet-traffic.com +0.0.0.0 bannerads.anytimenews.com +0.0.0.0 bannerads.de +0.0.0.0 bannerads.zwire.com +0.0.0.0 banner.affactive.com +0.0.0.0 banner.betroyalaffiliates.com +0.0.0.0 banner.betwwts.com +0.0.0.0 banner.cdpoker.com +0.0.0.0 banner.clubdicecasino.com +0.0.0.0 bannerconnect.net +0.0.0.0 banner.coza.com +0.0.0.0 banner.diamondclubcasino.com +0.0.0.0 bannerdriven.ru +0.0.0.0 banner.easyspace.com +0.0.0.0 bannerfarm.ace.advertising.com +0.0.0.0 banner.free6.com # www.free6.com +0.0.0.0 bannerhost.egamingonline.com +0.0.0.0 bannerimages.0catch.com +0.0.0.0 banner.joylandcasino.com +0.0.0.0 banner.media-system.de +0.0.0.0 banner.monacogoldcasino.com +0.0.0.0 banner.newyorkcasino.com +0.0.0.0 banner.northsky.com +0.0.0.0 banner.oddcast.com +0.0.0.0 banner.orb.net +0.0.0.0 banner.piratos.de +0.0.0.0 banner.playgatecasino.com +0.0.0.0 bannerpower.com +0.0.0.0 banner.prestigecasino.com +0.0.0.0 banner.publisher.to +0.0.0.0 banner.rbc.ru +0.0.0.0 banner.relcom.ru +0.0.0.0 banners1.linkbuddies.com +0.0.0.0 banners2.castles.org +0.0.0.0 banners3.spacash.com +0.0.0.0 banners.adgoto.com +0.0.0.0 banners.adultfriendfinder.com +0.0.0.0 banners.affiliatefuel.com +0.0.0.0 banners.affiliatefuture.com +0.0.0.0 banners.aftrk.com +0.0.0.0 banners.audioholics.com +0.0.0.0 banners.blogads.com +0.0.0.0 banners.bol.se +0.0.0.0 banners.broadwayworld.com +0.0.0.0 banners.celebritybling.com +0.0.0.0 banners.crisscross.com +0.0.0.0 banners.directnic.com +0.0.0.0 banners.dnastudio.com +0.0.0.0 banners.easydns.com +0.0.0.0 banners.easysolutions.be +0.0.0.0 banners.ebay.com +0.0.0.0 banners.expressindia.com +0.0.0.0 banners.flair.be +0.0.0.0 banners.free6.com # www.free6.com +0.0.0.0 banners.fuifbeest.be +0.0.0.0 banners.globovision.com +0.0.0.0 banners.img.uol.com.br +0.0.0.0 banners.ims.nl +0.0.0.0 banners.iop.org +0.0.0.0 banners.ipotd.com +0.0.0.0 banners.japantoday.com +0.0.0.0 banners.kfmb.com +0.0.0.0 banners.ksl.com +0.0.0.0 banners.linkbuddies.com +0.0.0.0 banners.looksmart.com +0.0.0.0 banners.nbcupromotes.com +0.0.0.0 banners.netcraft.com +0.0.0.0 banners.newsru.com +0.0.0.0 banners.nextcard.com +0.0.0.0 banners.passion.com +0.0.0.0 banners.pennyweb.com +0.0.0.0 banners.primaryclick.com +0.0.0.0 banners.resultonline.com +0.0.0.0 banners.rspworldwide.com +0.0.0.0 banners.sextracker.com +0.0.0.0 banners.spiceworks.com +0.0.0.0 banners.thegridwebmaster.com +0.0.0.0 banners.thestranger.com +0.0.0.0 banners.thgimages.co.uk +0.0.0.0 banners.tribute.ca +0.0.0.0 banners.tucson.com +0.0.0.0 banners.unibet.com +0.0.0.0 bannersurvey.biz +0.0.0.0 banners.valuead.com +0.0.0.0 banners.videosecrets.com +0.0.0.0 banners.webmasterplan.com +0.0.0.0 banners.wunderground.com +0.0.0.0 banners.zbs.ru +0.0.0.0 banner.tattomedia.com +0.0.0.0 banner.techarp.com +0.0.0.0 bannert.ru +0.0.0.0 bannerus1.axelsfun.com +0.0.0.0 bannerus3.axelsfun.com +0.0.0.0 banner.usacasino.com +0.0.0.0 banniere.reussissonsensemble.fr +0.0.0.0 bans.bride.ru +0.0.0.0 banstex.com +0.0.0.0 bansys.onzin.com +0.0.0.0 bargainbeautybuys.com +0.0.0.0 barnesandnoble.bfast.com +0.0.0.0 b.as-us.falkag.net +0.0.0.0 bayoubuzz.advertserve.com +0.0.0.0 bbcdn.go.adlt.bbelements.com +0.0.0.0 bbcdn.go.adnet.bbelements.com +0.0.0.0 bbcdn.go.arbo.bbelements.com +0.0.0.0 bbcdn.go.eu.bbelements.com +0.0.0.0 bbcdn.go.ihned.bbelements.com +0.0.0.0 bbcdn.go.pl.bbelements.com +0.0.0.0 bb.crwdcntrl.net +0.0.0.0 bbnaut.bbelements.com +0.0.0.0 bc685d37-266c-488e-824e-dd95d1c0e98b.statcamp.net +0.0.0.0 bcp.crwdcntrl.net +0.0.0.0 bdnad1.bangornews.com +0.0.0.0 bdv.bidvertiser.com +0.0.0.0 beacon-3.newrelic.com +0.0.0.0 beacons.helium.com +0.0.0.0 bell.adcentriconline.com +0.0.0.0 beseenad.looksmart.com +0.0.0.0 bestgift4you.cn +0.0.0.0 bestshopperrewards.com +0.0.0.0 beta.hotkeys.com +0.0.0.0 bet-at-home.com +0.0.0.0 betterperformance.goldenopps.info +0.0.0.0 bfast.com +0.0.0.0 bidclix.net +0.0.0.0 bid.openx.net +0.0.0.0 bidsystem.com +0.0.0.0 bidtraffic.com +0.0.0.0 bidvertiser.com +0.0.0.0 bigads.guj.de +0.0.0.0 bigbrandpromotions.com +0.0.0.0 bigbrandrewards.com +0.0.0.0 biggestgiftrewards.com +0.0.0.0 billing.speedboink.com +0.0.0.0 bitburg.adtech.de +0.0.0.0 bitburg.adtech.fr +0.0.0.0 bitburg.adtech.us +0.0.0.0 bitcast-d.bitgravity.com +0.0.0.0 bizad.nikkeibp.co.jp +0.0.0.0 biz-offer.com +0.0.0.0 bizopprewards.com +0.0.0.0 blabla4u.adserver.co.il +0.0.0.0 blasphemysfhs.info +0.0.0.0 blatant8jh.info +0.0.0.0 b.liquidustv.com +0.0.0.0 blog.addthis.com +0.0.0.0 blogads.com +0.0.0.0 blogads.ebanner.nl +0.0.0.0 blogvertising.pl +0.0.0.0 bluediamondoffers.com +0.0.0.0 blu.mobileads.msn.com +0.0.0.0 bl.wavecdn.de +0.0.0.0 b.myspace.com +0.0.0.0 bn.bfast.com +0.0.0.0 bnmgr.adinjector.net +0.0.0.0 bnrs.ilm.ee +0.0.0.0 boksy.dir.onet.pl +0.0.0.0 boksy.onet.pl +0.0.0.0 bookclub-offer.com +0.0.0.0 books-media-edu-premiumblvd.com +0.0.0.0 books-media-edu-rewardempire.com +0.0.0.0 books-media-rewardpath.com +0.0.0.0 bostonsubwayoffer.com +0.0.0.0 bp.specificclick.net +0.0.0.0 b.rad.live.com +0.0.0.0 b.rad.msn.com +0.0.0.0 br.adserver.yahoo.com +0.0.0.0 brandrewardcentral.com +0.0.0.0 brandsurveypanel.com +0.0.0.0 bravo.israelinfo.ru +0.0.0.0 bravospots.com +0.0.0.0 br.naked.com +0.0.0.0 broadcast.piximedia.fr +0.0.0.0 broadent.vo.llnwd.net +0.0.0.0 brokertraffic.com +0.0.0.0 bsads.looksmart.com +#0.0.0.0 b.scorecardresearch.com # interferes with Huffington Post slideshows +0.0.0.0 bs.israelinfo.ru +0.0.0.0 bs.serving-sys.com #eyeblaster.com +0.0.0.0 bt.linkpulse.com +0.0.0.0 burns.adtech.de +0.0.0.0 burns.adtech.fr +0.0.0.0 burns.adtech.us +0.0.0.0 business-rewardpath.com +0.0.0.0 bus-offer.com +0.0.0.0 buttcandy.com +0.0.0.0 buttons.googlesyndication.com +0.0.0.0 buzzbox.buzzfeed.com +0.0.0.0 bwp.lastfm.com.com +0.0.0.0 bwp.news.com +0.0.0.0 c1.popads.net +0.0.0.0 c1.teaser-goods.ru +0.0.0.0 c1.zedo.com +0.0.0.0 c2.zedo.com +0.0.0.0 c3.zedo.com +0.0.0.0 c4.maxserving.com +0.0.0.0 c4.zedo.com +0.0.0.0 c5.zedo.com +0.0.0.0 c6.zedo.com +0.0.0.0 c7.zedo.com +0.0.0.0 c8.zedo.com +0.0.0.0 ca.adserver.yahoo.com +0.0.0.0 cache.addthiscdn.com +0.0.0.0 cache.addthis.com +0.0.0.0 cache.blogads.com +0.0.0.0 cache-dev.addthis.com +0.0.0.0 cacheserve.eurogrand.com +0.0.0.0 cacheserve.prestigecasino.com +0.0.0.0 cache.unicast.com +0.0.0.0 c.actiondesk.com +0.0.0.0 c.adroll.com +0.0.0.0 califia.imaginemedia.com +0.0.0.0 c.am10.ru +0.0.0.0 camgeil.com +0.0.0.0 campaign.iitech.dk +0.0.0.0 campaign.indieclick.com +0.0.0.0 campaigns.f2.com.au +0.0.0.0 campaigns.interclick.com +0.0.0.0 capath.com +0.0.0.0 cardgamespidersolitaire.com +0.0.0.0 cards.virtuagirlhd.com +0.0.0.0 careers.canwestad.net +0.0.0.0 careers-rewardpath.com +0.0.0.0 c.ar.msn.com +0.0.0.0 carrier.bz +0.0.0.0 car-truck-boat-bonuspath.com +0.0.0.0 car-truck-boat-premiumblvd.com +0.0.0.0 casalemedia.com +0.0.0.0 cas.clickability.com +0.0.0.0 cashback.co.uk +0.0.0.0 cashbackwow.co.uk +0.0.0.0 cashflowmarketing.com +0.0.0.0 casino770.com +0.0.0.0 c.as-us.falkag.net +0.0.0.0 catalinkcashback.com +0.0.0.0 catchvid.info +0.0.0.0 c.at.msn.com +0.0.0.0 cbanners.virtuagirlhd.com +0.0.0.0 c.be.msn.com +0.0.0.0 c.blogads.com +0.0.0.0 c.br.msn.com +0.0.0.0 c.ca.msn.com +0.0.0.0 c.casalemedia.com +0.0.0.0 ccas.clearchannel.com +0.0.0.0 c.cl.msn.com +0.0.0.0 c.de.msn.com +0.0.0.0 c.dk.msn.com +0.0.0.0 cdn1.adexprt.com +0.0.0.0 cdn1.ads.mofos.com +0.0.0.0 cdn1.eyewonder.com +0.0.0.0 cdn1.rmgserving.com +0.0.0.0 cdn1.traffichaus.com +0.0.0.0 cdn1.xlightmedia.com +0.0.0.0 cdn2.adsdk.com +0.0.0.0 cdn2.amateurmatch.com +0.0.0.0 cdn2.emediate.eu +0.0.0.0 cdn3.adexprts.com +0.0.0.0 cdn3.telemetryverification.net +0.0.0.0 cdn454.telemetryverification.net +0.0.0.0 cdn5.tribalfusion.com +0.0.0.0 cdn6.emediate.eu +0.0.0.0 cdn.adigniter.org +0.0.0.0 cdn.adnxs.com +0.0.0.0 cdnads.cam4.com +0.0.0.0 cdn.ads.ookla.com +0.0.0.0 cdn.amateurmatch.com +0.0.0.0 cdn.amgdgt.com +0.0.0.0 cdn.assets.craveonline.com +0.0.0.0 cdn.banners.scubl.com +0.0.0.0 cdn.cpmstar.com +0.0.0.0 cdn.crowdignite.com +0.0.0.0 cdn.directrev.com +0.0.0.0 cdn.eyewonder.com +0.0.0.0 cdn.go.arbo.bbelements.com +0.0.0.0 cdn.go.arbopl.bbelements.com +0.0.0.0 cdn.go.cz.bbelements.com +0.0.0.0 cdn.go.idmnet.bbelements.com +0.0.0.0 cdn.go.pol.bbelements.com +0.0.0.0 cdn.hadj7.adjuggler.net +0.0.0.0 cdn.innovid.com +0.0.0.0 cdn.krxd.net +0.0.0.0 cdn.mediative.ca +0.0.0.0 cdn.merchenta.com +0.0.0.0 cdn.mobicow.com +0.0.0.0 cdn.nearbyad.com +0.0.0.0 cdn.nsimg.net +0.0.0.0 cdn.onescreen.net +#0.0.0.0 cdns.gigya.com +0.0.0.0 cdns.mydirtyhobby.com +0.0.0.0 cdns.privatamateure.com +0.0.0.0 cdn.stat.easydate.biz +0.0.0.0 cdn.syn.verticalacuity.com +0.0.0.0 cdn.tabnak.ir +0.0.0.0 cdnt.yottos.com +0.0.0.0 cdn.udmserve.net +0.0.0.0 cdn.undertone.com +0.0.0.0 cdn.wg.uproxx.com +0.0.0.0 cdnw.ringtonepartner.com +0.0.0.0 cdn.yottos.com +0.0.0.0 cdn.zeusclicks.com +0.0.0.0 cds.adecn.com +0.0.0.0 cecash.com +0.0.0.0 ced.sascdn.com +0.0.0.0 cell-phone-giveaways.com +0.0.0.0 cellphoneincentives.com +0.0.0.0 cent.adbureau.net +0.0.0.0 c.es.msn.com +0.0.0.0 c.fi.msn.com +0.0.0.0 cf.kampyle.com +0.0.0.0 c.fr.msn.com +0.0.0.0 cgirm.greatfallstribune.com +0.0.0.0 cgm.adbureau.ne +0.0.0.0 cgm.adbureau.net +0.0.0.0 c.gr.msn.com +0.0.0.0 chainsawoffer.com +0.0.0.0 chartbeat.com +0.0.0.0 checkintocash.data.7bpeople.com +0.0.0.0 cherryhi.app.ur.gcion.com +0.0.0.0 c.hk.msn.com +0.0.0.0 chkpt.zdnet.com +0.0.0.0 choicedealz.com +0.0.0.0 choicesurveypanel.com +0.0.0.0 christianbusinessadvertising.com +0.0.0.0 c.id.msn.com +0.0.0.0 c.ie.msn.com +0.0.0.0 c.il.msn.com +0.0.0.0 c.imedia.cz +0.0.0.0 c.in.msn.com +0.0.0.0 cithingy.info +0.0.0.0 citi.bridgetrack.com +0.0.0.0 c.it.msn.com +0.0.0.0 citrix.market2lead.com +0.0.0.0 cityads.telus.net +0.0.0.0 citycash2.blogspot.com +0.0.0.0 c.jp.msn.com +0.0.0.0 cl21.v4.adaction.se +0.0.0.0 cl320.v4.adaction.se +0.0.0.0 claimfreerewards.com +0.0.0.0 clashmediausa.com +0.0.0.0 classicjack.com +0.0.0.0 c.latam.msn.com +0.0.0.0 click1.mainadv.com +0.0.0.0 click1.rbc.magna.ru +0.0.0.0 click2.rbc.magna.ru +0.0.0.0 click3.rbc.magna.ru +0.0.0.0 click4.rbc.magna.ru +0.0.0.0 clickad.eo.pl +0.0.0.0 clickarrows.com +0.0.0.0 click.avenuea.com +0.0.0.0 clickbangpop.com +0.0.0.0 clickcash.webpower.com +0.0.0.0 click.go2net.com +0.0.0.0 click.israelinfo.ru +0.0.0.0 clickit.go2net.com +0.0.0.0 clickmedia.ro +0.0.0.0 click.pulse360.com +0.0.0.0 clicks2.virtuagirl.com +0.0.0.0 clicks.adultplex.com +0.0.0.0 clicks.deskbabes.com +0.0.0.0 click-see-save.com +0.0.0.0 clicksor.com +0.0.0.0 clicksotrk.com +0.0.0.0 clicks.totemcash.com +0.0.0.0 clicks.toteme.com +0.0.0.0 clicks.virtuagirl.com +0.0.0.0 clicks.virtuagirlhd.com +0.0.0.0 clicks.virtuaguyhd.com +0.0.0.0 clicks.walla.co.il +0.0.0.0 clickthru.net +0.0.0.0 clickthrunet.net +0.0.0.0 clickthruserver.com +0.0.0.0 clickthrutraffic.com +0.0.0.0 clicktorrent.info +0.0.0.0 clipserv.adclip.com +0.0.0.0 clkads.com +0.0.0.0 clk.cloudyisland.com +0.0.0.0 clk.tradedoubler.com +0.0.0.0 clkuk.tradedoubler.com +0.0.0.0 c.lomadee.com +0.0.0.0 closeoutproductsreview.com +0.0.0.0 cluster3.adultadworld.com +0.0.0.0 cluster.adultadworld.com +0.0.0.0 cm1359.com +0.0.0.0 cmads.sv.publicus.com +0.0.0.0 cmads.us.publicus.com +0.0.0.0 cmap.am.ace.advertising.com +0.0.0.0 cmap.an.ace.advertising.com +0.0.0.0 cmap.at.ace.advertising.com +0.0.0.0 cmap.dc.ace.advertising.com +0.0.0.0 cmap.ox.ace.advertising.com +0.0.0.0 cmap.pub.ace.advertising.com +0.0.0.0 cmap.rm.ace.advertising.com +0.0.0.0 cmap.rub.ace.advertising.com +0.0.0.0 cmhtml.overture.com +0.0.0.0 cmn1lsm2.beliefnet.com +0.0.0.0 cm.npc-hearst.overture.com +0.0.0.0 cmps.mt50ad.com +0.0.0.0 cm.the-n.overture.com +0.0.0.0 c.my.msn.com +0.0.0.0 cnad1.economicoutlook.net +0.0.0.0 cnad2.economicoutlook.net +0.0.0.0 cnad3.economicoutlook.net +0.0.0.0 cnad4.economicoutlook.net +0.0.0.0 cnad5.economicoutlook.net +0.0.0.0 cnad6.economicoutlook.net +0.0.0.0 cnad7.economicoutlook.net +0.0.0.0 cnad8.economicoutlook.net +0.0.0.0 cnad9.economicoutlook.net +0.0.0.0 cnad.economicoutlook.net +0.0.0.0 cn.adserver.yahoo.com +0.0.0.0 cnf.adshuffle.com +0.0.0.0 c.ninemsn.com.au +0.0.0.0 c.nl.msn.com +0.0.0.0 c.no.msn.com +0.0.0.0 c.novostimira.biz +0.0.0.0 cnt1.xhamster.com +0.0.0.0 code2.adtlgc.com +0.0.0.0 code.adtlgc.com +0.0.0.0 collectiveads.net +0.0.0.0 col.mobileads.msn.com +0.0.0.0 comadverts.bcmpweb.co.nz +0.0.0.0 comcastresidentialservices.tt.omtrdc.net +0.0.0.0 com.cool-premiums-now.com +0.0.0.0 come-see-it-all.com +0.0.0.0 com.htmlwww.youfck.com +0.0.0.0 commerce-offer.com +0.0.0.0 commerce-rewardpath.com +0.0.0.0 commerce.www.ibm.com +0.0.0.0 common.ziffdavisinternet.com +0.0.0.0 companion.adap.tv +0.0.0.0 computer-offer.com +0.0.0.0 computer-offer.net +0.0.0.0 computers-electronics-rewardpath.com +0.0.0.0 computersncs.com +0.0.0.0 com.shc-rebates.com +0.0.0.0 connect.247media.ads.link4ads.com +0.0.0.0 consumergiftcenter.com +0.0.0.0 consumerincentivenetwork.com +0.0.0.0 consumerinfo.tt.omtrdc.net +0.0.0.0 consumer-org.com +0.0.0.0 contaxe.com +0.0.0.0 content.ad-flow.com +0.0.0.0 content.clipster.ws +0.0.0.0 content.codelnet.com +0.0.0.0 content.promoisland.net +0.0.0.0 contentsearch.de.espotting.com +0.0.0.0 content.yieldmanager.edgesuite.net +0.0.0.0 context3.kanoodle.com +0.0.0.0 context5.kanoodle.com +0.0.0.0 context.adshadow.net +0.0.0.0 contextweb.com +0.0.0.0 conv.adengage.com +0.0.0.0 conversion-pixel.invitemedia.com +0.0.0.0 cookiecontainer.blox.pl +0.0.0.0 cookie.pebblemedia.be +0.0.0.0 cookingtiprewards.com +0.0.0.0 cookonsea.com +0.0.0.0 cool-premiums.com +0.0.0.0 cool-premiums-now.com +0.0.0.0 coolpremiumsnow.com +0.0.0.0 coolsavings.com +0.0.0.0 corba.adtech.de +0.0.0.0 corba.adtech.fr +0.0.0.0 corba.adtech.us +0.0.0.0 core0.node12.top.mail.ru +0.0.0.0 core2.adtlgc.com +0.0.0.0 coreg.flashtrack.net +0.0.0.0 coreglead.co.uk +0.0.0.0 core.insightexpressai.com +0.0.0.0 core.videoegg.com +0.0.0.0 cornflakes.pathfinder.com +0.0.0.0 corusads.dserv.ca +0.0.0.0 cosmeticscentre.uk.com +0.0.0.0 count6.51yes.com +0.0.0.0 count.casino-trade.com +0.0.0.0 cover.m2y.siemens.ch +0.0.0.0 c.ph.msn.com +0.0.0.0 cpmadvisors.com +0.0.0.0 cp.promoisland.net +0.0.0.0 c.prodigy.msn.com +0.0.0.0 c.pt.msn.com +0.0.0.0 cpu.firingsquad.com +0.0.0.0 creatiby1.unicast.com +0.0.0.0 creative.adshuffle.com +0.0.0.0 creative.ak.facebook.com +0.0.0.0 creatives.livejasmin.com +0.0.0.0 creatives.rgadvert.com +0.0.0.0 creatrixads.com +0.0.0.0 crediblegfj.info +0.0.0.0 creditburner.blueadvertise.com +0.0.0.0 creditsoffer.blogspot.com +0.0.0.0 creview.adbureau.net +0.0.0.0 crosspixel.demdex.net +0.0.0.0 crowdgravity.com +0.0.0.0 crowdignite.com +0.0.0.0 c.ru.msn.com +0.0.0.0 crux.songline.com +0.0.0.0 crwdcntrl.net +0.0.0.0 c.se.msn.com +0.0.0.0 cserver.mii.instacontent.net +0.0.0.0 c.sg.msn.com +0.0.0.0 csh.actiondesk.com +0.0.0.0 csm.rotator.hadj7.adjuggler.net +0.0.0.0 cspix.media6degrees.com +0.0.0.0 cs.prd.msys.playstation.net +0.0.0.0 csr.onet.pl +0.0.0.0 ctbdev.net +0.0.0.0 c.th.msn.com +0.0.0.0 c.tr.msn.com +0.0.0.0 cts.channelintelligence.com +0.0.0.0 c.tw.msn.com +0.0.0.0 ctxtad.tribalfusion.com +0.0.0.0 c.uk.msn.com +0.0.0.0 cxoadfarm.dyndns.info +0.0.0.0 cxtad.specificmedia.com +0.0.0.0 cyber-incentives.com +0.0.0.0 cz8.clickzs.com +0.0.0.0 c.za.msn.com +0.0.0.0 cz.bbelements.com +0.0.0.0 d.101m3.com +0.0.0.0 d10.zedo.com +0.0.0.0 d11.zedo.com +0.0.0.0 d12.zedo.com +0.0.0.0 d14.zedo.com +0.0.0.0 d1.openx.org +0.0.0.0 d1ros97qkrwjf5.cloudfront.net +0.0.0.0 d1.zedo.com +0.0.0.0 d2.zedo.com +0.0.0.0 d3.zedo.com +0.0.0.0 d4.zedo.com +0.0.0.0 d5phz18u4wuww.cloudfront.net +0.0.0.0 d5.zedo.com +0.0.0.0 d6.c5.b0.a2.top.mail.ru +0.0.0.0 d6.zedo.com +0.0.0.0 d7.zedo.com +0.0.0.0 d8.zedo.com +0.0.0.0 d9.zedo.com +0.0.0.0 da.2000888.com +0.0.0.0 d.adnetxchange.com +0.0.0.0 d.adserve.com +0.0.0.0 dads.new.digg.com +0.0.0.0 d.ads.readwriteweb.com +0.0.0.0 d.agkn.com +0.0.0.0 daily-saver.com +0.0.0.0 darmowe-liczniki.info +0.0.0.0 dart.chron.com +0.0.0.0 data.flurry.com +0.0.0.0 date.ventivmedia.com +0.0.0.0 datingadvertising.com +0.0.0.0 db4.net-filter.com +0.0.0.0 dbbsrv.com +0.0.0.0 dc.sabela.com.pl +0.0.0.0 dctracking.com +0.0.0.0 de.adserver.yahoo.com +0.0.0.0 del1.phillyburbs.com +0.0.0.0 delb.mspaceads.com +0.0.0.0 delivery.adyea.com +0.0.0.0 delivery.trafficjunky.net +0.0.0.0 delivery.w00tads.com +0.0.0.0 delivery.way2traffic.com +0.0.0.0 demr.mspaceads.com +0.0.0.0 demr.opt.fimserve.com +0.0.0.0 derkeiler.com +0.0.0.0 desb.mspaceads.com +0.0.0.0 descargas2.tuvideogratis.com +0.0.0.0 designbloxlive.com +0.0.0.0 desk.mspaceads.com +0.0.0.0 desk.opt.fimserve.com +0.0.0.0 dev.adforum.com +0.0.0.0 devart.adbureau.net +0.0.0.0 devlp1.linkpulse.com +0.0.0.0 dev.sfbg.com +0.0.0.0 dgm2.com +0.0.0.0 dgmaustralia.com +0.0.0.0 dg.specificclick.net +0.0.0.0 dietoftoday.ca.pn #security risk/fake news# +0.0.0.0 diff3.smartadserver.com +0.0.0.0 dinoadserver1.roka.net +0.0.0.0 dinoadserver2.roka.net +0.0.0.0 directleads.com +0.0.0.0 directpowerrewards.com +0.0.0.0 directrev.cloudapp.net +0.0.0.0 dirtyrhino.com +0.0.0.0 discount-savings-more.com +0.0.0.0 discoverecommerce.tt.omtrdc.net +0.0.0.0 display.gestionpub.com +0.0.0.0 dist.belnk.com +0.0.0.0 divx.adbureau.net +0.0.0.0 djbanners.deadjournal.com +0.0.0.0 djugoogs.com +0.0.0.0 dk.adserver.yahoo.com +0.0.0.0 dl.ncbuy.com +0.0.0.0 dl-plugin.com +0.0.0.0 dlvr.readserver.net +0.0.0.0 dnads.directnic.com +0.0.0.0 dnps.com +0.0.0.0 dnse.linkpulse.com +0.0.0.0 dosugcz.biz +0.0.0.0 dot.wp.pl +0.0.0.0 downloadcdn.com +0.0.0.0 do-wn-lo-ad.com +0.0.0.0 downloads.larivieracasino.com +0.0.0.0 downloads.mytvandmovies.com +0.0.0.0 dqs001.adtech.de +0.0.0.0 dqs001.adtech.fr +0.0.0.0 dqs001.adtech.us +0.0.0.0 dra.amazon-adsystem.com +0.0.0.0 drowle.com +0.0.0.0 ds.contextweb.com +0.0.0.0 ds.onet.pl +0.0.0.0 ds.serving-sys.com +0.0.0.0 dt.linkpulse.com +0.0.0.0 dub.mobileads.msn.com +0.0.0.0 e0.extreme-dm.com +0.0.0.0 e1.addthis.com +0.0.0.0 e2.cdn.qnsr.com +0.0.0.0 e2.emediate.se +0.0.0.0 eads-adserving.com +0.0.0.0 ead.sharethis.com +0.0.0.0 earnmygift.com +0.0.0.0 earnpointsandgifts.com +0.0.0.0 e.as-eu.falkag.net +0.0.0.0 easyadservice.com +0.0.0.0 easyweb.tdcanadatrust.secureserver.host1.customer-identification-process.b88600d8.com +0.0.0.0 eatps.web.aol.com +0.0.0.0 eb.adbureau.net +0.0.0.0 eblastengine.upickem.net +0.0.0.0 ecomadserver.com +0.0.0.0 eddamedia.linkpulse.com +0.0.0.0 edge.bnmla.com +0.0.0.0 edge.quantserve.com +0.0.0.0 edirect.hotkeys.com +0.0.0.0 education-rewardpath.com +0.0.0.0 edu-offer.com +0.0.0.0 electronics-bonuspath.com +0.0.0.0 electronics-offer.net +0.0.0.0 electronicspresent.com +0.0.0.0 electronics-rewardpath.com +0.0.0.0 emailadvantagegroup.com +0.0.0.0 emailproductreview.com +0.0.0.0 emapadserver.com +0.0.0.0 emea-bidder.mathtag.com +0.0.0.0 engage.everyone.net +0.0.0.0 engage.speedera.net +0.0.0.0 engine2.adzerk.net +0.0.0.0 engine.4chan-ads.org +0.0.0.0 engine.adland.ru +0.0.0.0 engine.adzerk.net +0.0.0.0 engine.carbonads.com +0.0.0.0 engine.espace.netavenir.com +0.0.0.0 engine.influads.com +0.0.0.0 engine.rorer.ru +0.0.0.0 enirocode.adtlgc.com +0.0.0.0 enirodk.adtlgc.com +0.0.0.0 enn.advertserve.com +0.0.0.0 entertainment-rewardpath.com +0.0.0.0 entertainment-specials.com +0.0.0.0 es.adserver.yahoo.com +0.0.0.0 escape.insites.eu +0.0.0.0 espn.footprint.net +0.0.0.0 etad.telegraph.co.uk +0.0.0.0 etrk.asus.com +0.0.0.0 etype.adbureau.net +0.0.0.0 eu2.madsone.com +0.0.0.0 euniverseads.com +0.0.0.0 eu-pn4.adserver.yahoo.com +0.0.0.0 europe.adserver.yahoo.com +0.0.0.0 eu.xtms.net +0.0.0.0 eventtracker.videostrip.com +0.0.0.0 exclusivegiftcards.com +0.0.0.0 exits1.webquest.net +0.0.0.0 exits2.webquest.net +0.0.0.0 exponential.com +0.0.0.0 eyewonder.com +0.0.0.0 ezboard.bigbangmedia.com +0.0.0.0 falkag.net +0.0.0.0 family-offer.com +0.0.0.0 farm.plista.com +0.0.0.0 f.as-eu.falkag.net +0.0.0.0 fatcatrewards.com +0.0.0.0 fbcdn-creative-a.akamaihd.net +0.0.0.0 fbfreegifts.com +0.0.0.0 fbi.gov.id402037057-8235504608.d9680.com +0.0.0.0 fcg.casino770.com +0.0.0.0 fc.webmasterpro.de +0.0.0.0 fdimages.fairfax.com.au +0.0.0.0 feedads.googleadservices.com +0.0.0.0 feeds.videosz.com +0.0.0.0 feeds.weselltraffic.com +0.0.0.0 fei.pro-market.net +0.0.0.0 fe.lea.lycos.es +0.0.0.0 fhm.valueclick.net +0.0.0.0 fif49.info +0.0.0.0 files.adbrite.com +0.0.0.0 fin.adbureau.net +0.0.0.0 finance-offer.com +0.0.0.0 finanzmeldungen.com +0.0.0.0 finder.cox.net +0.0.0.0 fixbonus.com +0.0.0.0 floatingads.madisonavenue.com +0.0.0.0 floridat.app.ur.gcion.com +0.0.0.0 flowers-offer.com +0.0.0.0 fls-na.amazon.com +0.0.0.0 flu23.com +0.0.0.0 fmads.osdn.com +0.0.0.0 focusin.ads.targetnet.com +0.0.0.0 folloyu.com +0.0.0.0 food-drink-bonuspath.com +0.0.0.0 food-drink-rewardpath.com +0.0.0.0 foodmixeroffer.com +0.0.0.0 food-offer.com +0.0.0.0 foreignpolicy.advertserve.com +0.0.0.0 fp.uclo.net +0.0.0.0 fp.valueclick.com +0.0.0.0 fr.a2dfp.net +0.0.0.0 fr.adserver.yahoo.com +0.0.0.0 fr.classic.clickintext.net +0.0.0.0 freebiegb.co.uk +0.0.0.0 freecameraonus.com +0.0.0.0 freecameraprovider.com +0.0.0.0 freecamerasource.com +0.0.0.0 freecamerauk.co.uk +0.0.0.0 freecoolgift.com +0.0.0.0 freedesignerhandbagreviews.com +0.0.0.0 freedinnersource.com +0.0.0.0 freedvddept.com +0.0.0.0 freeelectronicscenter.com +0.0.0.0 freeelectronicsdepot.com +0.0.0.0 freeelectronicsonus.com +0.0.0.0 freeelectronicssource.com +0.0.0.0 freeentertainmentsource.com +0.0.0.0 freefoodprovider.com +0.0.0.0 freefoodsource.com +0.0.0.0 freefuelcard.com +0.0.0.0 freefuelcoupon.com +0.0.0.0 freegasonus.com +0.0.0.0 freegasprovider.com +0.0.0.0 free-gift-cards-now.com +0.0.0.0 freegiftcardsource.com +0.0.0.0 freegiftreward.com +0.0.0.0 free-gifts-comp.com +0.0.0.0 free.hotsocialz.com +0.0.0.0 freeipodnanouk.co.uk +0.0.0.0 freeipoduk.com +0.0.0.0 freeipoduk.co.uk +0.0.0.0 freelaptopgift.com +0.0.0.0 freelaptopnation.com +0.0.0.0 free-laptop-reward.com +0.0.0.0 freelaptopreward.com +0.0.0.0 freelaptopwebsites.com +0.0.0.0 freenation.com +0.0.0.0 freeoffers-toys.com +0.0.0.0 freepayasyougotopupuk.co.uk +0.0.0.0 freeplasmanation.com +0.0.0.0 freerestaurantprovider.com +0.0.0.0 freerestaurantsource.com +0.0.0.0 free-rewards.com-s.tv +0.0.0.0 freeshoppingprovider.com +0.0.0.0 freeshoppingsource.com +0.0.0.0 free.thesocialsexnetwork.com +0.0.0.0 freevideodownloadforpc.com +0.0.0.0 frontend-loadbalancer.meteorsolutions.com +0.0.0.0 fwdservice.com +0.0.0.0 fwmrm.net +0.0.0.0 g1.idg.pl +0.0.0.0 g2.gumgum.com +0.0.0.0 g3t4d5.madison.com +0.0.0.0 g4p.grt02.com +0.0.0.0 gadgeteer.pdamart.com +0.0.0.0 gam.adnxs.com +0.0.0.0 gameconsolerewards.com +0.0.0.0 games-toys-bonuspath.com +0.0.0.0 games-toys-free.com +0.0.0.0 games-toys-rewardpath.com +0.0.0.0 gate.hyperpaysys.com +0.0.0.0 gavzad.keenspot.com +0.0.0.0 gazeta.hit.gemius.pl +0.0.0.0 gazetteextra.advertserve.com +0.0.0.0 gbanners.hornymatches.com +0.0.0.0 gcads.osdn.com +0.0.0.0 gcdn.2mdn.net +0.0.0.0 gc.gcl.ru +0.0.0.0 gcir.gannett-tv.com +0.0.0.0 gcirm2.indystar.com +0.0.0.0 gcirm.argusleader.com +0.0.0.0 gcirm.argusleader.gcion.com +0.0.0.0 gcirm.battlecreekenquirer.com +0.0.0.0 gcirm.burlingtonfreepress.com +0.0.0.0 gcirm.centralohio.com +0.0.0.0 gcirm.centralohio.gcion.com +0.0.0.0 gcirm.cincinnati.com +0.0.0.0 gcirm.citizen-times.com +0.0.0.0 gcirm.clarionledger.com +0.0.0.0 gcirm.coloradoan.com +0.0.0.0 gcirm.courier-journal.com +0.0.0.0 gcirm.courierpostonline.com +0.0.0.0 gcirm.customcoupon.com +0.0.0.0 gcirm.dailyrecord.com +0.0.0.0 gcirm.delawareonline.com +0.0.0.0 gcirm.democratandchronicle.com +0.0.0.0 gcirm.desmoinesregister.com +0.0.0.0 gcirm.detnews.com +0.0.0.0 gcirm.dmp.gcion.com +0.0.0.0 gcirm.dmregister.com +0.0.0.0 gcirm.dnj.com +0.0.0.0 gcirm.flatoday.com +0.0.0.0 gcirm.gannettnetwork.com +0.0.0.0 gcirm.gannett-tv.com +0.0.0.0 gcirm.greatfallstribune.com +0.0.0.0 gcirm.greenvilleonline.com +0.0.0.0 gcirm.greenvilleonline.gcion.com +0.0.0.0 gcirm.honoluluadvertiser.gcion.com +0.0.0.0 gcirm.idahostatesman.com +0.0.0.0 gcirm.idehostatesman.com +0.0.0.0 gcirm.indystar.com +0.0.0.0 gcirm.injersey.com +0.0.0.0 gcirm.jacksonsun.com +0.0.0.0 gcirm.laregionalonline.com +0.0.0.0 gcirm.lsj.com +0.0.0.0 gcirm.montgomeryadvertiser.com +0.0.0.0 gcirm.muskogeephoenix.com +0.0.0.0 gcirm.newsleader.com +0.0.0.0 gcirm.news-press.com +0.0.0.0 gcirm.ozarksnow.com +0.0.0.0 gcirm.pensacolanewsjournal.com +0.0.0.0 gcirm.press-citizen.com +0.0.0.0 gcirm.pressconnects.com +0.0.0.0 gcirm.rgj.com +0.0.0.0 gcirm.sctimes.com +0.0.0.0 gcirm.stargazette.com +0.0.0.0 gcirm.statesmanjournal.com +0.0.0.0 gcirm.tallahassee.com +0.0.0.0 gcirm.tennessean.com +0.0.0.0 gcirm.thedailyjournal.com +0.0.0.0 gcirm.thedesertsun.com +0.0.0.0 gcirm.theithacajournal.com +0.0.0.0 gcirm.thejournalnews.com +0.0.0.0 gcirm.theolympian.com +0.0.0.0 gcirm.thespectrum.com +0.0.0.0 gcirm.tucson.com +0.0.0.0 gcirm.wisinfo.com +0.0.0.0 gde.adocean.pl +0.0.0.0 gdeee.hit.gemius.pl +0.0.0.0 gdelt.hit.gemius.pl +0.0.0.0 gdelv.hit.gemius.pl +0.0.0.0 gdyn.cnngo.com +0.0.0.0 gdyn.trutv.com +0.0.0.0 gemius.pl +0.0.0.0 geoads.osdn.com +0.0.0.0 geoloc11.geovisite.com +0.0.0.0 geo.precisionclick.com +0.0.0.0 getacool100.com +0.0.0.0 getacool500.com +0.0.0.0 getacoollaptop.com +0.0.0.0 getacooltv.com +0.0.0.0 getafreeiphone.org +0.0.0.0 getagiftonline.com +0.0.0.0 getmyfreebabystuff.com +0.0.0.0 getmyfreegear.com +0.0.0.0 getmyfreegiftcard.com +0.0.0.0 getmyfreelaptop.com +0.0.0.0 getmyfreelaptophere.com +0.0.0.0 getmyfreeplasma.com +0.0.0.0 getmylaptopfree.com +0.0.0.0 getmyplasmatv.com +0.0.0.0 getspecialgifts.com +0.0.0.0 getyour5kcredits0.blogspot.com +0.0.0.0 getyourfreecomputer.com +0.0.0.0 getyourfreetv.com +0.0.0.0 getyourgiftnow2.blogspot.com +0.0.0.0 getyourgiftnow3.blogspot.com +0.0.0.0 gg.adocean.pl +0.0.0.0 giftcardchallenge.com +0.0.0.0 giftcardsurveys.us.com +0.0.0.0 giftrewardzone.com +0.0.0.0 gifts-flowers-rewardpath.com +0.0.0.0 gimmethatreward.com +0.0.0.0 gingert.net +0.0.0.0 globalwebads.com +0.0.0.0 gmads.net +0.0.0.0 gm.preferences.com +0.0.0.0 go2.hit.gemius.pl +0.0.0.0 go.adee.bbelements.com +0.0.0.0 go.adlt.bbelements.com +0.0.0.0 go.adlv.bbelements.com +0.0.0.0 go.admulti.com +0.0.0.0 go.adnet.bbelements.com +0.0.0.0 go.arbo.bbelements.com +0.0.0.0 go.arbopl.bbelements.com +0.0.0.0 go.arboru.bbelements.com +0.0.0.0 go.bb007.bbelements.com +0.0.0.0 go.evolutionmedia.bbelements.com +0.0.0.0 go-free-gifts.com +0.0.0.0 gofreegifts.com +0.0.0.0 go.ihned.bbelements.com +0.0.0.0 go.intact.bbelements.com +0.0.0.0 go.lfstmedia.com +0.0.0.0 go.lotech.bbelements.com +0.0.0.0 goodsblock.marketgid.com +0.0.0.0 goody-garage.com +0.0.0.0 go.pl.bbelements.com +0.0.0.0 got2goshop.com +0.0.0.0 goto.trafficmultiplier.com +0.0.0.0 gozing.directtrack.com +0.0.0.0 grabbit-rabbit.com +0.0.0.0 graphics.adultfriendfinder.com +0.0.0.0 graphics.pop6.com +0.0.0.0 gratkapl.adocean.pl +0.0.0.0 gravitron.chron.com +0.0.0.0 greasypalm.com +0.0.0.0 grfx.mp3.com +0.0.0.0 groupon.pl +0.0.0.0 grz67.com +0.0.0.0 gs1.idsales.co.uk +0.0.0.0 gserv.cneteu.net +0.0.0.0 gspro.hit.gemius.pl +0.0.0.0 g.thinktarget.com +0.0.0.0 guiaconsumidor.com +0.0.0.0 guide2poker.com +0.0.0.0 guptamedianetwork.com +0.0.0.0 guru.sitescout.netdna-cdn.com +0.0.0.0 gwallet.com +0.0.0.0 gx-in-f109.1e100.net +0.0.0.0 h-afnetwww.adshuffle.com +0.0.0.0 halfords.ukrpts.net +0.0.0.0 happydiscountspecials.com +0.0.0.0 harvest176.adgardener.com +0.0.0.0 harvest284.adgardener.com +0.0.0.0 harvest285.adgardener.com +0.0.0.0 harvest.adgardener.com +0.0.0.0 hathor.eztonez.com +0.0.0.0 haynet.adbureau.net +0.0.0.0 hbads.eboz.com +0.0.0.0 hbadz.eboz.com +0.0.0.0 healthbeautyncs.com +0.0.0.0 health-beauty-rewardpath.com +0.0.0.0 health-beauty-savingblvd.com +0.0.0.0 healthclicks.co.uk +0.0.0.0 hebdotop.com +0.0.0.0 help.adtech.de +0.0.0.0 help.adtech.fr +0.0.0.0 help.adtech.us +0.0.0.0 helpint.mywebsearch.com +0.0.0.0 hightrafficads.com +0.0.0.0 himediads.com +0.0.0.0 hit4.hotlog.ru +0.0.0.0 hk.adserver.yahoo.com +0.0.0.0 hlcc.ca +0.0.0.0 holiday-gift-offers.com +0.0.0.0 holidayproductpromo.com +0.0.0.0 holidayshoppingrewards.com +0.0.0.0 home4bizstart.ru +0.0.0.0 homeelectronicproducts.com +0.0.0.0 home-garden-premiumblvd.com +0.0.0.0 home-garden-rewardempire.com +0.0.0.0 home-garden-rewardpath.com +0.0.0.0 homeimprovementonus.com +0.0.0.0 honolulu.app.ur.gcion.com +0.0.0.0 hooqy.com +0.0.0.0 host207.ewtn.com +0.0.0.0 hostedaje14.thruport.com +0.0.0.0 hosting.adjug.com +0.0.0.0 hot-daily-deal.com +0.0.0.0 hotgiftzone.com +0.0.0.0 hot-product-hangout.com +0.0.0.0 hpad.www.infoseek.co.jp +0.0.0.0 h.ppjol.com +0.0.0.0 htmlads.ru +0.0.0.0 html.centralmediaserver.com +0.0.0.0 htmlwww.youfck.com +0.0.0.0 http300.content.ru4.com +0.0.0.0 httpads.com +0.0.0.0 httpwwwadserver.com +0.0.0.0 hub.com.pl +0.0.0.0 huiwiw.hit.gemius.pl +0.0.0.0 huntingtonbank.tt.omtrdc.net +0.0.0.0 huomdgde.adocean.pl +0.0.0.0 hyperion.adtech.de +0.0.0.0 hyperion.adtech.fr +0.0.0.0 hyperion.adtech.us +0.0.0.0 i1.teaser-goods.ru +0.0.0.0 iacas.adbureau.net +0.0.0.0 iad.anm.co.uk +0.0.0.0 iadc.qwapi.com +#0.0.0.0 iadsdk.apple.com #may interfere with iTunes radio +0.0.0.0 ib.adnxs.com +0.0.0.0 ibis.lgappstv.com +0.0.0.0 i.blogads.com +0.0.0.0 i.casalemedia.com +0.0.0.0 icon.clickthru.net +0.0.0.0 id11938.luxup.ru +0.0.0.0 id5576.al21.luxup.ru +0.0.0.0 idearc.tt.omtrdc.net +0.0.0.0 idpix.media6degrees.com +0.0.0.0 ieee.adbureau.net +0.0.0.0 if.bbanner.it +0.0.0.0 iftarvakitleri.net +0.0.0.0 ih2.gamecopyworld.com +0.0.0.0 i.hotkeys.com +0.0.0.0 i.interia.pl +0.0.0.0 i.laih.com +0.0.0.0 ilinks.industrybrains.com +0.0.0.0 im.adtech.de +0.0.0.0 image2.pubmatic.com +0.0.0.0 imageads.canoe.ca +0.0.0.0 imagec08.247realmedia.com +0.0.0.0 imagec12.247realmedia.com +0.0.0.0 imagec14.247realmedia.com +0.0.0.0 imagecache2.allposters.com +0.0.0.0 imageceu1.247realmedia.com +0.0.0.0 image.click.livedoor.com +0.0.0.0 image.i1img.com +0.0.0.0 image.linkexchange.com +0.0.0.0 images2.laih.com +0.0.0.0 images3.linkwithin.com +0.0.0.0 images.ads.fairfax.com.au +0.0.0.0 images.blogads.com +0.0.0.0 images.bluetime.com +0.0.0.0 images-cdn.azoogleads.com +0.0.0.0 images.clickfinders.com +0.0.0.0 images.conduit-banners.com +0.0.0.0 images.cybereps.com +0.0.0.0 images.directtrack.com +0.0.0.0 images.emapadserver.com +0.0.0.0 imageserv.adtech.de +0.0.0.0 imageserv.adtech.fr +0.0.0.0 imageserv.adtech.us +0.0.0.0 imageserver1.thruport.com +0.0.0.0 images.jambocast.com +0.0.0.0 images.linkwithin.com +0.0.0.0 images.mbuyu.nl +0.0.0.0 images.netcomvad.com +0.0.0.0 images.newsx.cc +0.0.0.0 images.people2people.com +0.0.0.0 images.primaryads.com +0.0.0.0 images.sexlist.com +0.0.0.0 images.steamray.com +0.0.0.0 images.trafficmp.com +0.0.0.0 im.banner.t-online.de +0.0.0.0 i.media.cz +0.0.0.0 img0.ru.redtram.com +0.0.0.0 img1.ru.redtram.com +0.0.0.0 img2.ru.redtram.com +0.0.0.0 img4.cdn.adjuggler.com +0.0.0.0 img-a2.ak.imagevz.net +0.0.0.0 img.blogads.com +0.0.0.0 img-cdn.mediaplex.com +0.0.0.0 img.directtrack.com +0.0.0.0 imgg.dt00.net +0.0.0.0 imgg.marketgid.com +0.0.0.0 img.layer-ads.de +0.0.0.0 img.marketgid.com +0.0.0.0 imgn.dt00.net +0.0.0.0 imgn.dt07.com +0.0.0.0 imgn.marketgid.com +0.0.0.0 imgserv.adbutler.com +0.0.0.0 img.sn00.net +0.0.0.0 img.soulmate.com +0.0.0.0 img.xnxx.com +0.0.0.0 im.of.pl +0.0.0.0 impact.cossette-webpact.com +0.0.0.0 impbe.tradedoubler.com +0.0.0.0 imp.partner2profit.com +0.0.0.0 imppl.tradedoubler.com +0.0.0.0 impressionaffiliate.com +0.0.0.0 impressionaffiliate.mobi +0.0.0.0 impressionlead.com +0.0.0.0 impressionperformance.biz +0.0.0.0 imserv001.adtech.de +0.0.0.0 imserv001.adtech.fr +0.0.0.0 imserv001.adtech.us +0.0.0.0 imserv002.adtech.de +0.0.0.0 imserv002.adtech.fr +0.0.0.0 imserv002.adtech.us +0.0.0.0 imserv003.adtech.de +0.0.0.0 imserv003.adtech.fr +0.0.0.0 imserv003.adtech.us +0.0.0.0 imserv004.adtech.de +0.0.0.0 imserv004.adtech.fr +0.0.0.0 imserv004.adtech.us +0.0.0.0 imserv005.adtech.de +0.0.0.0 imserv005.adtech.fr +0.0.0.0 imserv005.adtech.us +0.0.0.0 imserv006.adtech.de +0.0.0.0 imserv006.adtech.fr +0.0.0.0 imserv006.adtech.us +0.0.0.0 imserv00x.adtech.de +0.0.0.0 imserv00x.adtech.fr +0.0.0.0 imserv00x.adtech.us +0.0.0.0 imssl01.adtech.de +0.0.0.0 imssl01.adtech.fr +0.0.0.0 imssl01.adtech.us +0.0.0.0 im.xo.pl +0.0.0.0 in.adserver.yahoo.com +0.0.0.0 incentivegateway.com +0.0.0.0 incentiverewardcenter.com +0.0.0.0 incentive-scene.com +0.0.0.0 indexhu.adocean.pl +0.0.0.0 infinite-ads.com +0.0.0.0 inklineglobal.com +0.0.0.0 inl.adbureau.net +0.0.0.0 input.insights.gravity.com +0.0.0.0 insightxe.pittsburghlive.com +0.0.0.0 insightxe.vtsgonline.com +0.0.0.0 ins-offer.com +0.0.0.0 installer.zutrack.com +0.0.0.0 insurance-rewardpath.com +0.0.0.0 intela.com +0.0.0.0 intelliads.com +0.0.0.0 internet.billboard.cz +0.0.0.0 intnet-offer.com +0.0.0.0 intrack.pl +0.0.0.0 invitefashion.com +0.0.0.0 ipacc1.adtech.de +0.0.0.0 ipacc1.adtech.fr +0.0.0.0 ipacc1.adtech.us +0.0.0.0 ipad2free4u.com +0.0.0.0 i.pcp001.com +0.0.0.0 ipdata.adtech.de +0.0.0.0 ipdata.adtech.fr +0.0.0.0 ipdata.adtech.us +0.0.0.0 iq001.adtech.de +0.0.0.0 iq001.adtech.fr +0.0.0.0 iq001.adtech.us +0.0.0.0 i.qitrck.com +0.0.0.0 is.casalemedia.com +0.0.0.0 i.securecontactinfo.com +0.0.0.0 isg01.casalemedia.com +0.0.0.0 isg02.casalemedia.com +0.0.0.0 isg03.casalemedia.com +0.0.0.0 isg04.casalemedia.com +0.0.0.0 isg05.casalemedia.com +0.0.0.0 isg06.casalemedia.com +0.0.0.0 isg07.casalemedia.com +0.0.0.0 isg08.casalemedia.com +0.0.0.0 isg09.casalemedia.com +0.0.0.0 i.simpli.fi +0.0.0.0 it.adserver.yahoo.com +0.0.0.0 i.total-media.net +0.0.0.0 itrackerpro.com +0.0.0.0 i.trkjmp.com +0.0.0.0 itsfree123.com +0.0.0.0 itxt.vibrantmedia.com +0.0.0.0 iwantmyfreecash.com +0.0.0.0 iwantmy-freelaptop.com +0.0.0.0 iwantmyfree-laptop.com +0.0.0.0 iwantmyfreelaptop.com +0.0.0.0 iwantmygiftcard.com +0.0.0.0 jambocast.com +0.0.0.0 jb9clfifs6.s.ad6media.fr +0.0.0.0 jcarter.spinbox.net +0.0.0.0 j.clickdensity.com +0.0.0.0 jcrew.tt.omtrdc.net +0.0.0.0 jersey-offer.com +0.0.0.0 jgedads.cjt.net +0.0.0.0 jh.revolvermaps.com +0.0.0.0 jivox.com +0.0.0.0 jl29jd25sm24mc29.com +0.0.0.0 jlinks.industrybrains.com +0.0.0.0 jmn.jangonetwork.com +0.0.0.0 join1.winhundred.com +0.0.0.0 js1.bloggerads.net +0.0.0.0 js77.neodatagroup.com +0.0.0.0 js.adlink.net +0.0.0.0 js.admngr.com +0.0.0.0 js.adscale.de +0.0.0.0 js.adserverpub.com +0.0.0.0 js.adsonar.com +0.0.0.0 jsc.dt07.net +0.0.0.0 js.goods.redtram.com +0.0.0.0 js.himediads.com +0.0.0.0 js.hotkeys.com +0.0.0.0 jsn.dt07.net +0.0.0.0 js.ru.redtram.com +0.0.0.0 js.selectornews.com +0.0.0.0 js.smi2.ru +0.0.0.0 js.tongji.linezing.com +0.0.0.0 js.zevents.com +0.0.0.0 judo.salon.com +0.0.0.0 juggler.inetinteractive.com +0.0.0.0 justwebads.com +0.0.0.0 jxliu.com +0.0.0.0 k5ads.osdn.com +0.0.0.0 kaartenhuis.nl.site-id.nl +0.0.0.0 kansas.valueclick.com +0.0.0.0 katu.adbureau.net +0.0.0.0 kazaa.adserver.co.il +0.0.0.0 kermit.macnn.com +0.0.0.0 kestrel.ospreymedialp.com +0.0.0.0 keys.dmtracker.com +0.0.0.0 keywordblocks.com +0.0.0.0 keywords.adtlgc.com +0.0.0.0 kitaramarketplace.com +0.0.0.0 kitaramedia.com +0.0.0.0 kitaratrk.com +0.0.0.0 kithrup.matchlogic.com +0.0.0.0 kixer.com +0.0.0.0 klikk.linkpulse.com +0.0.0.0 klikmoney.net +0.0.0.0 kliksaya.com +0.0.0.0 klipads.dvlabs.com +0.0.0.0 klipmart.dvlabs.com +0.0.0.0 klipmart.forbes.com +0.0.0.0 kmdl101.com +0.0.0.0 knc.lv +0.0.0.0 knight.economist.com +0.0.0.0 kona2.kontera.com +0.0.0.0 kona3.kontera.com +0.0.0.0 kona4.kontera.com +0.0.0.0 kona5.kontera.com +0.0.0.0 kona6.kontera.com +0.0.0.0 kona7.kontera.com +0.0.0.0 kona8.kontera.com +0.0.0.0 kona.kontera.com +0.0.0.0 kontera.com +0.0.0.0 kreaffiliation.com +0.0.0.0 kropka.onet.pl +0.0.0.0 kuhdi.com +0.0.0.0 l.5min.com +0.0.0.0 ladyclicks.ru +0.0.0.0 lanzar.publicidadweb.com +0.0.0.0 laptopreportcard.com +0.0.0.0 laptoprewards.com +0.0.0.0 laptoprewardsgroup.com +0.0.0.0 laptoprewardszone.com +0.0.0.0 larivieracasino.com +0.0.0.0 lasthr.info +0.0.0.0 lastmeasure.zoy.org +0.0.0.0 launch.adserver.yahoo.com +0.0.0.0 layer-ads.de +0.0.0.0 lb-adserver.ig.com.br +0.0.0.0 ld1.criteo.com +0.0.0.0 ld2.criteo.com +0.0.0.0 ldglob01.adtech.de +0.0.0.0 ldglob01.adtech.fr +0.0.0.0 ldglob01.adtech.us +0.0.0.0 ldglob02.adtech.de +0.0.0.0 ldglob02.adtech.fr +0.0.0.0 ldglob02.adtech.us +0.0.0.0 ldimage01.adtech.de +0.0.0.0 ldimage01.adtech.fr +0.0.0.0 ldimage01.adtech.us +0.0.0.0 ldimage02.adtech.de +0.0.0.0 ldimage02.adtech.fr +0.0.0.0 ldimage02.adtech.us +0.0.0.0 ldserv01.adtech.de +0.0.0.0 ldserv01.adtech.fr +0.0.0.0 ldserv01.adtech.us +0.0.0.0 ldserv02.adtech.de +0.0.0.0 ldserv02.adtech.fr +0.0.0.0 ldserv02.adtech.us +0.0.0.0 le1er.net +0.0.0.0 leadback.advertising.com +0.0.0.0 leader.linkexchange.com +0.0.0.0 lead.program3.com +0.0.0.0 leadsynaptic.go2jump.org +0.0.0.0 learning-offer.com +0.0.0.0 legal-rewardpath.com +0.0.0.0 leisure-offer.com +0.0.0.0 lg.brandreachsys.com +0.0.0.0 liberty.gedads.com +0.0.0.0 link2me.ru +0.0.0.0 link4ads.com +0.0.0.0 linktracker.angelfire.com +0.0.0.0 linuxpark.adtech.de +0.0.0.0 linuxpark.adtech.fr +0.0.0.0 linuxpark.adtech.us +0.0.0.0 liquidad.narrowcastmedia.com +0.0.0.0 live-cams-1.livejasmin.com +0.0.0.0 livingnet.adtech.de +0.0.0.0 ll.atdmt.com +0.0.0.0 l.linkpulse.com +0.0.0.0 lnads.osdn.com +0.0.0.0 load.exelator.com +0.0.0.0 load.focalex.com +0.0.0.0 loading321.com +0.0.0.0 loadm.exelator.com +0.0.0.0 local.promoisland.net +0.0.0.0 logc252.xiti.com +0.0.0.0 log.feedjit.com +0.0.0.0 login.linkpulse.com +0.0.0.0 log.olark.com +0.0.0.0 looksmartcollect.247realmedia.com +0.0.0.0 louisvil.app.ur.gcion.com +0.0.0.0 louisvil.ur.gcion.com +0.0.0.0 lp1.linkpulse.com +0.0.0.0 lp4.linkpulse.com +0.0.0.0 lpcloudsvr405.com +0.0.0.0 lstats.qip.ru +0.0.0.0 lt.andomedia.com +0.0.0.0 lt.angelfire.com +0.0.0.0 lucky-day-uk.com +0.0.0.0 luxup.ru +0.0.0.0 lw1.gamecopyworld.com +0.0.0.0 lw2.gamecopyworld.com +0.0.0.0 lycos.247realmedia.com +0.0.0.0 l.yieldmanager.net +0.0.0.0 m1.emea.2mdn.net.edgesuite.net +0.0.0.0 m2.sexgarantie.nl +0.0.0.0 m3.2mdn.net +0.0.0.0 macaddictads.snv.futurenet.com +0.0.0.0 macads.net +0.0.0.0 mackeeperapp1.zeobit.com +0.0.0.0 mad2.brandreachsys.com +0.0.0.0 m.adbridge.de +0.0.0.0 mads.aol.com +0.0.0.0 mads.cnet.com +0.0.0.0 mail.radar.imgsmail.ru +0.0.0.0 manage001.adtech.de +0.0.0.0 manage001.adtech.fr +0.0.0.0 manage001.adtech.us +0.0.0.0 manager.rovion.com +0.0.0.0 manuel.theonion.com +0.0.0.0 marketgid.com +0.0.0.0 marketing.888.com +0.0.0.0 marketing-rewardpath.com +0.0.0.0 marriottinternationa.tt.omtrdc.net +0.0.0.0 mastertracks.be +0.0.0.0 matomy.adk2.co +0.0.0.0 matrix.mediavantage.de +0.0.0.0 maxadserver.corusradionetwork.com +0.0.0.0 maxads.ruralpress.com +0.0.0.0 maxbounty.com +0.0.0.0 maximumpcads.imaginemedia.com +0.0.0.0 maxmedia.sgaonline.com +0.0.0.0 maxserving.com +0.0.0.0 mb01.com +0.0.0.0 mbox2.offermatica.com +0.0.0.0 mbox9.offermatica.com +0.0.0.0 mds.centrport.net +0.0.0.0 media2021.videostrip.com +0.0.0.0 media2.adshuffle.com +0.0.0.0 media2.legacy.com +0.0.0.0 media2.travelzoo.com +0.0.0.0 media4021.videostrip.com #http://media4021.videostrip.com/dev8/0/000/449/0000449408.mp4 +0.0.0.0 media5021.videostrip.com #http://media5021.videostrip.com/dev14/0/000/363/0000363146.mp4 +0.0.0.0 media6021.videostrip.com +0.0.0.0 media6.sitebrand.com +0.0.0.0 media.888.com +0.0.0.0 media.adcentriconline.com +0.0.0.0 media.adrcdn.com +0.0.0.0 media.adrevolver.com +0.0.0.0 media.adrime.com +0.0.0.0 media.adshadow.net +0.0.0.0 media.b.lead.program3.com +0.0.0.0 media.bonnint.net +0.0.0.0 mediacharger.com +0.0.0.0 media.contextweb.com +0.0.0.0 media.elb-kind.de +0.0.0.0 media.espace-plus.net +0.0.0.0 media.fairlink.ru +0.0.0.0 mediafr.247realmedia.com +0.0.0.0 media.funpic.de +0.0.0.0 medialand.relax.ru +0.0.0.0 media.markethealth.com +0.0.0.0 media.naked.com +0.0.0.0 media.nk-net.pl +0.0.0.0 media.ontarionorth.com +0.0.0.0 media.popuptraffic.com +0.0.0.0 mediapst.adbureau.net +0.0.0.0 mediapst-images.adbureau.net +0.0.0.0 mediative.ca +0.0.0.0 mediative.com +0.0.0.0 media.trafficfactory.biz +0.0.0.0 media.trafficjunky.net +0.0.0.0 mediauk.247realmedia.com +0.0.0.0 media.ventivmedia.com +0.0.0.0 media.viwii.net +0.0.0.0 medical-offer.com +0.0.0.0 medical-rewardpath.com +0.0.0.0 medleyads.com +0.0.0.0 medrx.sensis.com.au +0.0.0.0 megapanel.gem.pl +0.0.0.0 mercury.bravenet.com +0.0.0.0 messagent.duvalguillaume.com +0.0.0.0 messagia.adcentric.proximi-t.com +0.0.0.0 meter-svc.nytimes.com +0.0.0.0 metrics.natmags.co.uk +0.0.0.0 metrics.sfr.fr +0.0.0.0 metrics.target.com +0.0.0.0 m.fr.a2dfp.net +0.0.0.0 m.friendlyduck.com +0.0.0.0 mf.sitescout.com +0.0.0.0 mg.dt00.net +0.0.0.0 mgid.com +0.0.0.0 mhlnk.com +0.0.0.0 mi.adinterax.com +0.0.0.0 microsof.wemfbox.ch +0.0.0.0 mightymagoo.com +0.0.0.0 mii-image.adjuggler.com +0.0.0.0 mini.videostrip.com +0.0.0.0 mirror.pointroll.com +0.0.0.0 mjxads.internet.com +0.0.0.0 mjx.ads.nwsource.com +0.0.0.0 mklik.gazeta.pl +0.0.0.0 mktg-offer.com +0.0.0.0 mlntracker.com +0.0.0.0 mm.admob.com +0.0.0.0 mm.chitika.net +0.0.0.0 mob.adwhirl.com +0.0.0.0 mobileads.msn.com +0.0.0.0 mobile.juicyads.com +0.0.0.0 mobularity.com +0.0.0.0 mochibot.com +0.0.0.0 mojofarm.mediaplex.com +0.0.0.0 moneyraid.com +0.0.0.0 monstersandcritics.advertserve.com +0.0.0.0 morefreecamsecrets.com +0.0.0.0 morevisits.info +0.0.0.0 motd.pinion.gg +0.0.0.0 movieads.imgs.sapo.pt +0.0.0.0 mp3playersource.com +0.0.0.0 mp.tscapeplay.com +0.0.0.0 msn.allyes.com +0.0.0.0 msnbe-hp.metriweb.be +0.0.0.0 msn-cdn.effectivemeasure.net +0.0.0.0 msn.oewabox.at +0.0.0.0 msn.tns-cs.net +0.0.0.0 msn.uvwbox.de +0.0.0.0 msn.wrating.com +0.0.0.0 mt58.mtree.com +0.0.0.0 m.tribalfusion.com +0.0.0.0 mu-in-f167.1e100.net +0.0.0.0 multi.xnxx.com +0.0.0.0 mvonline.com +0.0.0.0 mx.adserver.yahoo.com +0.0.0.0 myao.adocean.pl +0.0.0.0 my.blueadvertise.com +0.0.0.0 mycashback.co.uk +0.0.0.0 mycelloffer.com +0.0.0.0 mychoicerewards.com +0.0.0.0 myexclusiverewards.com +0.0.0.0 myfreedinner.com +0.0.0.0 myfreegifts.co.uk +0.0.0.0 myfreemp3player.com +0.0.0.0 mygiftcardcenter.com +0.0.0.0 mygiftresource.com +0.0.0.0 mygreatrewards.com +0.0.0.0 myoffertracking.com +0.0.0.0 my-reward-channel.com +0.0.0.0 my-rewardsvault.com +0.0.0.0 myseostats.com +0.0.0.0 myusersonline.com +0.0.0.0 myyearbookdigital.checkm8.com +0.0.0.0 n4g.us.intellitxt.com +0.0.0.0 n4p.ru.redtram.com +0.0.0.0 nationalissuepanel.com +0.0.0.0 nationalpost.adperfect.com +0.0.0.0 nationalsurveypanel.com +0.0.0.0 nbads.com +0.0.0.0 nbc.adbureau.net +0.0.0.0 nbimg.dt00.net +0.0.0.0 nb.netbreak.com.au +0.0.0.0 nc.ru.redtram.com +0.0.0.0 nctracking.com +0.0.0.0 nd1.gamecopyworld.com +0.0.0.0 nearbyad.com +0.0.0.0 needadvertising.com +0.0.0.0 netads.hotwired.com +0.0.0.0 netadsrv.iworld.com +0.0.0.0 netads.sohu.com +0.0.0.0 netcomm.spinbox.net +0.0.0.0 netpalnow.com +0.0.0.0 netshelter.adtrix.com +0.0.0.0 netspiderads2.indiatimes.com +0.0.0.0 netsponsors.com +0.0.0.0 networkads.net +0.0.0.0 network-ca.247realmedia.com +0.0.0.0 network.realmedia.com +0.0.0.0 network.realtechnetwork.net +0.0.0.0 newads.cmpnet.com +0.0.0.0 newadserver.interfree.it +0.0.0.0 new-ads.eurogamer.net +0.0.0.0 newbs.hutz.co.il +0.0.0.0 news6health.com +0.0.0.0 newsblock.marketgid.com +0.0.0.0 new.smartcontext.pl +0.0.0.0 newssourceoftoday.com #security risk/fake news# +0.0.0.0 newt1.adultadworld.com +0.0.0.0 newt1.adultworld.com +0.0.0.0 ng3.ads.warnerbros.com +0.0.0.0 ngads.smartage.com +0.0.0.0 nitrous.exitfuel.com +0.0.0.0 nitrous.internetfuel.com +0.0.0.0 nivendas.net +0.0.0.0 nkcache.brandreachsys.com +0.0.0.0 nl.adserver.yahoo.com +0.0.0.0 no.adserver.yahoo.com +0.0.0.0 nospartenaires.com +0.0.0.0 nothing-but-value.com +0.0.0.0 novafinanza.com +0.0.0.0 novem.onet.pl +0.0.0.0 nrads.1host.co.il +0.0.0.0 nrkno.linkpulse.com +0.0.0.0 ns1.lalibco.com +0.0.0.0 ns1.primeinteractive.net +0.0.0.0 ns2.hitbox.com +0.0.0.0 ns2.lalibco.com +0.0.0.0 ns2.primeinteractive.net +0.0.0.0 nsads4.us.publicus.com +0.0.0.0 nsads.hotwired.com +0.0.0.0 nsads.us.publicus.com +0.0.0.0 nspmotion.com +0.0.0.0 ns-vip1.hitbox.com +0.0.0.0 ns-vip2.hitbox.com +0.0.0.0 ns-vip3.hitbox.com +0.0.0.0 ntbanner.digitalriver.com +0.0.0.0 nx-adv0005.247realmedia.com +0.0.0.0 nxs.kidcolez.cn +0.0.0.0 nxtscrn.adbureau.net +0.0.0.0 nysubwayoffer.com +0.0.0.0 nytadvertising.nytimes.com +0.0.0.0 o0.winfuture.de +0.0.0.0 o1.qnsr.com +0.0.0.0 o2.eyereturn.com +0.0.0.0 oads.cracked.com +0.0.0.0 oamsrhads.us.publicus.com +0.0.0.0 oas-1.rmuk.co.uk +0.0.0.0 oasads.whitepages.com +0.0.0.0 oasc02023.247realmedia.com +0.0.0.0 oasc02.247realmedia.com +0.0.0.0 oasc03.247realmedia.com +0.0.0.0 oasc04.247.realmedia.com +0.0.0.0 oasc05050.247realmedia.com +0.0.0.0 oasc05.247realmedia.com +0.0.0.0 oasc16.247realmedia.com +0.0.0.0 oascenral.phoenixnewtimes.com +0.0.0.0 oascentral.videodome.com +0.0.0.0 oas.dn.se +0.0.0.0 oas-eu.247realmedia.com +0.0.0.0 oas.heise.de +0.0.0.0 oasis2.advfn.com +0.0.0.0 oasis.411affiliates.ca +0.0.0.0 oasis.nysun.com +0.0.0.0 oasis.promon.cz +0.0.0.0 oasis.realbeer.com +0.0.0.0 oasis.zmh.zope.com +0.0.0.0 oasis.zmh.zope.net +0.0.0.0 oasn03.247realmedia.com +0.0.0.0 oassis.zmh.zope.com +0.0.0.0 objects.abcvisiteurs.com +0.0.0.0 objects.designbloxlive.com +0.0.0.0 obozua.adocean.pl +0.0.0.0 observer.advertserve.com +0.0.0.0 obs.nnm2.ru +0.0.0.0 offers.impower.com +0.0.0.0 offerx.co.uk +0.0.0.0 oinadserve.com +0.0.0.0 old-darkroast.adknowledge.com +0.0.0.0 ometrics.warnerbros.com +0.0.0.0 onclickads.net +0.0.0.0 online1.webcams.com +0.0.0.0 onlineads.magicvalley.com +0.0.0.0 onlinebestoffers.net +0.0.0.0 onocollect.247realmedia.com +0.0.0.0 open.4info.net +0.0.0.0 openadext.tf1.fr +0.0.0.0 openad.infobel.com +0.0.0.0 openads.dimcab.com +0.0.0.0 openads.friendfinder.com +0.0.0.0 openads.nightlifemagazine.ca +0.0.0.0 openads.smithmag.net +0.0.0.0 openads.zeads.com +0.0.0.0 openad.travelnow.com +0.0.0.0 opentable.tt.omtrdc.net +0.0.0.0 openx2.fotoflexer.com +0.0.0.0 openx.adfactor.nl +0.0.0.0 openx.coolconcepts.nl +0.0.0.0 openx.shinyads.com +0.0.0.0 openxxx.viragemedia.com +0.0.0.0 optimized-by.rubiconproject.com +0.0.0.0 optimized.by.vitalads.net +0.0.0.0 optimize.indieclick.com +0.0.0.0 optimzedby.rmxads.com +0.0.0.0 orange.weborama.fr +0.0.0.0 ordie.adbureau.net +0.0.0.0 origin.chron.com +0.0.0.0 out.popads.net +0.0.0.0 overflow.adsoftware.com +0.0.0.0 overlay.ringtonematcher.com +0.0.0.0 overstock.tt.omtrdc.net +0.0.0.0 ox-d.hbr.org +0.0.0.0 ox-d.hulkshare.com +0.0.0.0 ox-d.hypeads.org +0.0.0.0 ox-d.zenoviagroup.com +0.0.0.0 ox.eurogamer.net +0.0.0.0 ox-i.zenoviagroup.com +0.0.0.0 ozonemedia.adbureau.net +0.0.0.0 oz.valueclick.com +0.0.0.0 oz.valueclick.ne.jp +0.0.0.0 p0rnuha.com +0.0.0.0 p1.adhitzads.com +0.0.0.0 pagead1.googlesyndication.com +0.0.0.0 pagead2.googlesyndication.com +0.0.0.0 pagead3.googlesyndication.com +0.0.0.0 pagead.googlesyndication.com +0.0.0.0 pages.etology.com +0.0.0.0 paime.com +0.0.0.0 panel.adtify.pl +0.0.0.0 paperg.com +0.0.0.0 partner01.oingo.com +0.0.0.0 partner02.oingo.com +0.0.0.0 partner03.oingo.com +0.0.0.0 partner.ah-ha.com +0.0.0.0 partner.ceneo.pl +0.0.0.0 partner.join.com.ua +0.0.0.0 partner.magna.ru +0.0.0.0 partner.pobieraczek.pl +0.0.0.0 partners.sprintrade.com +0.0.0.0 partners.webmasterplan.com +0.0.0.0 partner.wapacz.pl +0.0.0.0 partner.wapster.pl +0.0.0.0 pathforpoints.com +0.0.0.0 paulsnetwork.com +0.0.0.0 pbid.pro-market.net +0.0.0.0 pb.tynt.com +0.0.0.0 pcads.ru +0.0.0.0 pei-ads.playboy.com +0.0.0.0 people-choice-sites.com +0.0.0.0 personalcare-offer.com +0.0.0.0 personalcashbailout.com +0.0.0.0 pg2.solution.weborama.fr +0.0.0.0 ph-ad01.focalink.com +0.0.0.0 ph-ad02.focalink.com +0.0.0.0 ph-ad03.focalink.com +0.0.0.0 ph-ad04.focalink.com +0.0.0.0 ph-ad05.focalink.com +0.0.0.0 ph-ad06.focalink.com +0.0.0.0 ph-ad07.focalink.com +0.0.0.0 ph-ad08.focalink.com +0.0.0.0 ph-ad09.focalink.com +0.0.0.0 ph-ad10.focalink.com +0.0.0.0 ph-ad11.focalink.com +0.0.0.0 ph-ad12.focalink.com +0.0.0.0 ph-ad13.focalink.com +0.0.0.0 ph-ad14.focalink.com +0.0.0.0 ph-ad15.focalink.com +0.0.0.0 ph-ad16.focalink.com +0.0.0.0 ph-ad17.focalink.com +0.0.0.0 ph-ad18.focalink.com +0.0.0.0 ph-ad19.focalink.com +0.0.0.0 ph-ad20.focalink.com +0.0.0.0 ph-ad21.focalink.com +0.0.0.0 ph-cdn.effectivemeasure.net +0.0.0.0 phoenixads.co.in +0.0.0.0 photobucket.adnxs.com +0.0.0.0 photos0.pop6.com +0.0.0.0 photos1.pop6.com +0.0.0.0 photos2.pop6.com +0.0.0.0 photos3.pop6.com +0.0.0.0 photos4.pop6.com +0.0.0.0 photos5.pop6.com +0.0.0.0 photos6.pop6.com +0.0.0.0 photos7.pop6.com +0.0.0.0 photos8.pop6.com +0.0.0.0 photos.daily-deals.analoganalytics.com +0.0.0.0 photos.pop6.com +0.0.0.0 phpads.astalavista.us +0.0.0.0 phpads.cnpapers.com +0.0.0.0 phpads.flipcorp.com +0.0.0.0 phpads.foundrymusic.com +0.0.0.0 phpads.i-merge.net +0.0.0.0 phpads.macbidouille.com +0.0.0.0 phpadsnew.gamefolk.de +0.0.0.0 phpadsnew.wn.com +0.0.0.0 php.fark.com +0.0.0.0 pick-savings.com +0.0.0.0 p.ic.tynt.com +0.0.0.0 pink.habralab.ru +0.0.0.0 pix01.revsci.net +0.0.0.0 pix521.adtech.de +0.0.0.0 pix521.adtech.fr +0.0.0.0 pix521.adtech.us +0.0.0.0 pix522.adtech.de +0.0.0.0 pix522.adtech.fr +0.0.0.0 pix522.adtech.us +0.0.0.0 pixel.everesttech.net +0.0.0.0 pixel.mathtag.com +0.0.0.0 pixel.quantserve.com +0.0.0.0 pixel.sitescout.com +0.0.0.0 plasmatv4free.com +0.0.0.0 plasmatvreward.com +0.0.0.0 playlink.pl +0.0.0.0 playtime.tubemogul.com +0.0.0.0 pl.bbelements.com +0.0.0.0 pmstrk.mercadolivre.com.br +0.0.0.0 pntm.adbureau.net +0.0.0.0 pntm-images.adbureau.net +0.0.0.0 pol.bbelements.com +0.0.0.0 politicalopinionsurvey.com +0.0.0.0 pool.pebblemedia.adhese.com +0.0.0.0 popadscdn.net +0.0.0.0 popclick.net +0.0.0.0 poponclick.com +0.0.0.0 popunder.adsrevenue.net +0.0.0.0 popunder.paypopup.com +0.0.0.0 popupclick.ru +0.0.0.0 popupdomination.com +0.0.0.0 popup.matchmaker.com +0.0.0.0 popups.ad-logics.com +0.0.0.0 popups.infostart.com +0.0.0.0 postmasterdirect.com +0.0.0.0 post.rmbn.ru +0.0.0.0 pp.free.fr +0.0.0.0 p.profistats.net +0.0.0.0 p.publico.es +0.0.0.0 premium.ascensionweb.com +0.0.0.0 premiumholidayoffers.com +0.0.0.0 premiumproductsonline.com +0.0.0.0 premium-reward-club.com +0.0.0.0 prexyone.appspot.com +0.0.0.0 primetime.ad.primetime.net +0.0.0.0 privitize.com +0.0.0.0 prizes.co.uk +0.0.0.0 productopinionpanel.com +0.0.0.0 productresearchpanel.com +0.0.0.0 producttestpanel.com +0.0.0.0 profile.uproxx.com +0.0.0.0 promo.awempire.com +0.0.0.0 promo.easy-dating.org +0.0.0.0 promos.fling.com +0.0.0.0 promote-bz.net +0.0.0.0 promotion.partnercash.com +0.0.0.0 proximityads.flipcorp.com +0.0.0.0 proxy.blogads.com +0.0.0.0 ptrads.mp3.com +0.0.0.0 pubdirecte.com +0.0.0.0 pubimgs.sapo.pt +0.0.0.0 publiads.com +0.0.0.0 publicidades.redtotalonline.com +0.0.0.0 publicis.adcentriconline.com +0.0.0.0 publish.bonzaii.no +0.0.0.0 publishers.adscholar.com +0.0.0.0 publishers.bidtraffic.com +0.0.0.0 publishers.brokertraffic.com +0.0.0.0 publishing.kalooga.com +0.0.0.0 pub.sapo.pt +0.0.0.0 pubshop.img.uol.com.br +0.0.0.0 purgecolon.net +0.0.0.0 px10.net +0.0.0.0 q.azcentral.com +0.0.0.0 q.b.h.cltomedia.info +0.0.0.0 qip.magna.ru +0.0.0.0 qitrck.com +0.0.0.0 quickbrowsersearch.com +0.0.0.0 r1-ads.ace.advertising.com +0.0.0.0 r.ace.advertising.com +0.0.0.0 radaronline.advertserve.com +0.0.0.0 r.admob.com +0.0.0.0 rad.msn.com +0.0.0.0 rads.stackoverflow.com +0.0.0.0 ravel-rewardpath.com +0.0.0.0 rb.burstway.com +0.0.0.0 rb.newsru.com +0.0.0.0 rbqip.pochta.ru +0.0.0.0 rc.asci.freenet.de +0.0.0.0 rc.bt.ilsemedia.nl +0.0.0.0 rccl.bridgetrack.com +0.0.0.0 rcdna.gwallet.com +0.0.0.0 r.chitika.net +0.0.0.0 rc.hotkeys.com +0.0.0.0 rcm-images.amazon.com +0.0.0.0 rcm-it.amazon.it +0.0.0.0 rc.rlcdn.com +0.0.0.0 rc.wl.webads.nl +0.0.0.0 realads.realmedia.com +0.0.0.0 realgfsbucks.com +0.0.0.0 realmedia-a800.d4p.net # Scientific American +0.0.0.0 realmedia.advance.net +0.0.0.0 recreation-leisure-rewardpath.com +0.0.0.0 red01.as-eu.falkag.net +0.0.0.0 red01.as-us.falkag.net +0.0.0.0 red02.as-eu.falkag.net +0.0.0.0 red02.as-us.falkag.net +0.0.0.0 red03.as-eu.falkag.net +0.0.0.0 red03.as-us.falkag.net +0.0.0.0 red04.as-eu.falkag.net +0.0.0.0 red04.as-us.falkag.net +0.0.0.0 red.as-eu.falkag.net +0.0.0.0 red.as-us.falkag.net +0.0.0.0 redherring.ngadcenter.net +0.0.0.0 redirect.click2net.com +0.0.0.0 redirect.hotkeys.com +0.0.0.0 reduxads.valuead.com +0.0.0.0 reg.coolsavings.com +0.0.0.0 regflow.com +0.0.0.0 regie.espace-plus.net +0.0.0.0 regio.adlink.de +0.0.0.0 reklama.onet.pl +0.0.0.0 reklamy.sfd.pl +0.0.0.0 re.kontera.com +0.0.0.0 rek.www.wp.pl +0.0.0.0 relestar.com +0.0.0.0 remotead.cnet.com +0.0.0.0 report02.adtech.de +0.0.0.0 report02.adtech.fr +0.0.0.0 report02.adtech.us +0.0.0.0 reporter001.adtech.de +0.0.0.0 reporter001.adtech.fr +0.0.0.0 reporter001.adtech.us +0.0.0.0 reporter.adtech.de +0.0.0.0 reporter.adtech.fr +0.0.0.0 reporter.adtech.us +0.0.0.0 reportimage.adtech.de +0.0.0.0 reportimage.adtech.fr +0.0.0.0 reportimage.adtech.us +0.0.0.0 resolvingserver.com +0.0.0.0 resources.infolinks.com +0.0.0.0 restaurantcom.tt.omtrdc.net +0.0.0.0 reverso.refr.adgtw.orangeads.fr +0.0.0.0 revsci.net +0.0.0.0 rewardblvd.com +0.0.0.0 rewardhotspot.com +0.0.0.0 rewardsflow.com +0.0.0.0 rhads.sv.publicus.com +0.0.0.0 rh.revolvermaps.com +0.0.0.0 richmedia.yimg.com +0.0.0.0 ridepush.com +0.0.0.0 ringtonepartner.com +0.0.0.0 rmbn.ru +0.0.0.0 rmedia.boston.com +0.0.0.0 rmm1u.checkm8.com +0.0.0.0 rms.admeta.com +0.0.0.0 ro.bbelements.com +0.0.0.0 romepartners.com +0.0.0.0 roosevelt.gjbig.com +0.0.0.0 rosettastone.tt.omtrdc.net +0.0.0.0 rotabanner100.utro.ru +0.0.0.0 rotabanner468.utro.ru +0.0.0.0 rotate.infowars.com +0.0.0.0 rotator.adjuggler.com +0.0.0.0 rotator.juggler.inetinteractive.com +0.0.0.0 rotobanner468.utro.ru +0.0.0.0 rovion.com +0.0.0.0 rpc.trafficfactory.biz +0.0.0.0 rp.hit.gemius.pl +0.0.0.0 r.reklama.biz +0.0.0.0 rscounter10.com +0.0.0.0 rsense-ad.realclick.co.kr +0.0.0.0 rss.buysellads.com +0.0.0.0 rt2.infolinks.com +0.0.0.0 rt3.infolinks.com +0.0.0.0 rtb.pclick.yahoo.com +0.0.0.0 rtb.tubemogul.com +0.0.0.0 rtr.innovid.com +0.0.0.0 rts.sparkstudios.com +0.0.0.0 r.turn.com +0.0.0.0 ru.bbelements.com +0.0.0.0 ru.redtram.com +0.0.0.0 russ-shalavy.ru +0.0.0.0 rv.adcpx.v1.de.eusem.adaos-ads.net +0.0.0.0 rya.rockyou.com +0.0.0.0 s0b.bluestreak.com +0.0.0.0 s1.buysellads.com +0.0.0.0 s1.cz.adocean.pl +0.0.0.0 s1.gratkapl.adocean.pl +0.0.0.0 s2.buysellads.com +0.0.0.0 s3.buysellads.com +0.0.0.0 s5.addthis.com +0.0.0.0 s7.addthis.com +0.0.0.0 s.admulti.com +0.0.0.0 sad.sharethis.com +0.0.0.0 safe.hyperpaysys.com +0.0.0.0 safenyplanet.in +0.0.0.0 salesforcecom.tt.omtrdc.net +0.0.0.0 s.amazon-adsystem.com +0.0.0.0 samsung3.solution.weborama.fr +0.0.0.0 s.as-us.falkag.net +0.0.0.0 sat-city-ads.com +0.0.0.0 s.atemda.com +0.0.0.0 saturn.tiser.com.au +0.0.0.0 save-plan.com +0.0.0.0 savings-specials.com +0.0.0.0 savings-time.com +0.0.0.0 s.boom.ro +0.0.0.0 schoorsteen.geenstijl.nl +0.0.0.0 schumacher.adtech.de +0.0.0.0 schumacher.adtech.fr +0.0.0.0 schumacher.adtech.us +0.0.0.0 schwab.tt.omtrdc.net +0.0.0.0 s.clicktale.net +0.0.0.0 scoremygift.com +0.0.0.0 screen-mates.com +0.0.0.0 script.banstex.com +0.0.0.0 script.crsspxl.com +0.0.0.0 scripts.verticalacuity.com +0.0.0.0 scr.kliksaya.com +0.0.0.0 s.di.com.pl +0.0.0.0 se.adserver.yahoo.com +0.0.0.0 search.addthis.com +0.0.0.0 search.freeonline.com +0.0.0.0 search.keywordblocks.com +0.0.0.0 search.netseer.com +0.0.0.0 searchportal.information.com +0.0.0.0 searchwe.com +0.0.0.0 seasonalsamplerspecials.com +0.0.0.0 sec.hit.gemius.pl +0.0.0.0 secimage.adtech.de +0.0.0.0 secimage.adtech.fr +0.0.0.0 secimage.adtech.us +0.0.0.0 secserv.adtech.de +0.0.0.0 secserv.adtech.fr +0.0.0.0 secserv.adtech.us +0.0.0.0 secure.ace-tag.advertising.com +0.0.0.0 secure.addthis.com +0.0.0.0 secureads.ft.com +0.0.0.0 secure.bidvertiserr.com +0.0.0.0 securecontactinfo.com +0.0.0.0 secure.gaug.es +0.0.0.0 secure.img-cdn.mediaplex.com +0.0.0.0 securerunner.com +0.0.0.0 secure.webconnect.net +0.0.0.0 seduction-zone.com +0.0.0.0 sel.as-eu.falkag.net +0.0.0.0 sel.as-us.falkag.net +0.0.0.0 select001.adtech.de +0.0.0.0 select001.adtech.fr +0.0.0.0 select001.adtech.us +0.0.0.0 select002.adtech.de +0.0.0.0 select002.adtech.fr +0.0.0.0 select002.adtech.us +0.0.0.0 select003.adtech.de +0.0.0.0 select003.adtech.fr +0.0.0.0 select003.adtech.us +0.0.0.0 select004.adtech.de +0.0.0.0 select004.adtech.fr +0.0.0.0 select004.adtech.us +0.0.0.0 sergarius.popunder.ru +0.0.0.0 serv2.ad-rotator.com +0.0.0.0 serv.ad-rotator.com +0.0.0.0 servads.aip.org +0.0.0.0 serv.adspeed.com +0.0.0.0 servedbyadbutler.com +0.0.0.0 servedby.adcombination.com +0.0.0.0 servedby.advertising.com +0.0.0.0 servedby.flashtalking.com +0.0.0.0 servedby.netshelter.net +0.0.0.0 servedby.precisionclick.com +0.0.0.0 serve.freegaypix.com +0.0.0.0 serve.popads.net +0.0.0.0 serve.prestigecasino.com +0.0.0.0 server01.popupmoney.com +0.0.0.0 server2.as5000.com +0.0.0.0 server2.mediajmp.com +0.0.0.0 server3.yieldmanaged.com +0.0.0.0 server.as5000.com +0.0.0.0 server.bittads.com +0.0.0.0 server.cpmstar.com +0.0.0.0 server.popads.net +0.0.0.0 server-ssl.yieldmanaged.com +0.0.0.0 service001.adtech.de +0.0.0.0 service001.adtech.fr +0.0.0.0 service001.adtech.us +0.0.0.0 service002.adtech.de +0.0.0.0 service002.adtech.fr +0.0.0.0 service002.adtech.us +0.0.0.0 service003.adtech.de +0.0.0.0 service003.adtech.fr +0.0.0.0 service003.adtech.us +0.0.0.0 service004.adtech.fr +0.0.0.0 service004.adtech.us +0.0.0.0 service00x.adtech.de +0.0.0.0 service00x.adtech.fr +0.0.0.0 service00x.adtech.us +0.0.0.0 service.adtech.de +0.0.0.0 service.adtech.fr +0.0.0.0 service.adtech.us +0.0.0.0 services1.adtech.de +0.0.0.0 services1.adtech.fr +0.0.0.0 services1.adtech.us +0.0.0.0 services.adtech.de +0.0.0.0 services.adtech.fr +0.0.0.0 services.adtech.us +0.0.0.0 serving.plexop.net +0.0.0.0 sexpartnerx.com +0.0.0.0 sexsponsors.com +0.0.0.0 sexzavod.com +0.0.0.0 sfads.osdn.com +0.0.0.0 s.flite.com +0.0.0.0 sg.adserver.yahoo.com +0.0.0.0 sgs001.adtech.de +0.0.0.0 sgs001.adtech.fr +0.0.0.0 sgs001.adtech.us +0.0.0.0 sh4sure-images.adbureau.net +0.0.0.0 shareasale.com +0.0.0.0 sharebar.addthiscdn.com +0.0.0.0 share-server.com +0.0.0.0 shc-rebates.com +0.0.0.0 shinystat.shiny.it +0.0.0.0 shopperpromotions.com +0.0.0.0 shopping-offer.com +0.0.0.0 shoppingsiterewards.com +0.0.0.0 shops-malls-rewardpath.com +0.0.0.0 shoptosaveenergy.com +0.0.0.0 showads1000.pubmatic.com +0.0.0.0 showadsak.pubmatic.com +0.0.0.0 sifomedia.citypaketet.se +0.0.0.0 signup.advance.net +0.0.0.0 si.hit.gemius.pl +0.0.0.0 simg.zedo.com +0.0.0.0 simpleads.net +0.0.0.0 simpli.fi +0.0.0.0 s.innovid.com +0.0.0.0 sixapart.adbureau.net +0.0.0.0 sizzle-savings.com +0.0.0.0 skgde.adocean.pl +0.0.0.0 skill.skilljam.com +0.0.0.0 slider.plugrush.com +0.0.0.0 smartadserver +0.0.0.0 smartadserver.com +0.0.0.0 smart.besonders.ru +0.0.0.0 smartclip.com +0.0.0.0 smartclip.net +0.0.0.0 smartcontext.pl +0.0.0.0 smartinit.webads.nl +0.0.0.0 smart-scripts.com +0.0.0.0 smartshare.lgtvsdp.com +0.0.0.0 s.media-imdb.com +0.0.0.0 s.megaclick.com +0.0.0.0 smile.modchipstore.com +0.0.0.0 smm.sitescout.com +0.0.0.0 s.moatads.com +0.0.0.0 smokersopinionpoll.com +0.0.0.0 smsmovies.net +0.0.0.0 snaps.vidiemi.com +0.0.0.0 sn.baventures.com +0.0.0.0 snip.answers.com +0.0.0.0 snipjs.answcdn.com +0.0.0.0 sochr.com +0.0.0.0 social.bidsystem.com +0.0.0.0 softlinkers.popunder.ru +0.0.0.0 sokrates.adtech.de +0.0.0.0 sokrates.adtech.fr +0.0.0.0 sokrates.adtech.us +0.0.0.0 sol.adbureau.net +0.0.0.0 sol-images.adbureau.net +0.0.0.0 solitairetime.com +0.0.0.0 solution.weborama.fr +0.0.0.0 somethingawful.crwdcntrl.net +0.0.0.0 sonycomputerentertai.tt.omtrdc.net +0.0.0.0 soongu.info +0.0.0.0 spanids.dictionary.com +0.0.0.0 spanids.thesaurus.com +0.0.0.0 spc.cekfmeoejdbfcfichgbfcgjf.vast2as3.glammedia-pubnet.northamerica.telemetryverification.net +0.0.0.0 spe.atdmt.com +0.0.0.0 specialgiftrewards.com +0.0.0.0 specialoffers.aol.com +0.0.0.0 specialonlinegifts.com +0.0.0.0 specials-rewardpath.com +0.0.0.0 speedboink.com +0.0.0.0 speedclicks.ero-advertising.com +0.0.0.0 speed.pointroll.com # Microsoft +0.0.0.0 spinbox.com +0.0.0.0 spinbox.consumerreview.com +0.0.0.0 spinbox.freedom.com +0.0.0.0 spinbox.macworld.com +0.0.0.0 spinbox.techtracker.com +0.0.0.0 spin.spinbox.net +0.0.0.0 sponsor1.com +0.0.0.0 sponsors.behance.com +0.0.0.0 sponsors.ezgreen.com +0.0.0.0 sponsorships.net +0.0.0.0 sports-bonuspath.com +0.0.0.0 sports-fitness-rewardpath.com +0.0.0.0 sports-offer.com +0.0.0.0 sports-offer.net +0.0.0.0 sports-premiumblvd.com +0.0.0.0 spotxchange.com +0.0.0.0 s.ppjol.net +0.0.0.0 sq2trk2.com +0.0.0.0 srs.targetpoint.com +0.0.0.0 srv.juiceadv.com +0.0.0.0 ssads.osdn.com +0.0.0.0 s.skimresources.com +0.0.0.0 sso.canada.com +0.0.0.0 staging.snip.answers.com +0.0.0.0 stampen.adtlgc.com +0.0.0.0 stampen.linkpulse.com +0.0.0.0 stampscom.tt.omtrdc.net +0.0.0.0 stanzapub.advertserve.com +0.0.0.0 star-advertising.com +0.0.0.0 stat.blogads.com +0.0.0.0 stat.dealtime.com +0.0.0.0 stat.ebuzzing.com +0.0.0.0 static1.influads.com +0.0.0.0 static.2mdn.net +0.0.0.0 static.admaximize.com +0.0.0.0 staticads.btopenworld.com +0.0.0.0 static.adsonar.com +0.0.0.0 static.adtaily.pl +0.0.0.0 static.adzerk.net +0.0.0.0 static.aff-landing-tmp.foxtab.com +0.0.0.0 staticb.mydirtyhobby.com +0.0.0.0 static.carbonads.com +0.0.0.0 static.clicktorrent.info +0.0.0.0 static.creatives.livejasmin.com +0.0.0.0 static.doubleclick.net +0.0.0.0 static.everyone.net +0.0.0.0 static.exoclick.com +0.0.0.0 static.fastpic.ru +0.0.0.0 static.firehunt.com +0.0.0.0 static.fmpub.net +0.0.0.0 static.freenet.de +0.0.0.0 static.groupy.co.nz +0.0.0.0 static.hitfarm.com +0.0.0.0 static.ifa.camads.net +0.0.0.0 static.l3.cdn.adbucks.com +0.0.0.0 static.l3.cdn.adsucks.com +0.0.0.0 static.plista.com +0.0.0.0 static.plugrush.com +0.0.0.0 static.pulse360.com +0.0.0.0 static.scanscout.com +0.0.0.0 static.vpptechnologies.com +0.0.0.0 static.way2traffic.com +0.0.0.0 statistik-gallup.dk +0.0.0.0 stats2.dooyoo.com +0.0.0.0 stats.askmoses.com +0.0.0.0 stats.buzzparadise.com +0.0.0.0 stats.jtvnw.net +0.0.0.0 stats.shopify.com +0.0.0.0 status.addthis.com +0.0.0.0 st.blogads.com +0.0.0.0 s.tcimg.com +0.0.0.0 st.marketgid.com +0.0.0.0 stocker.bonnint.net +0.0.0.0 storage.softure.com +0.0.0.0 storage.trafic.ro +0.0.0.0 streamate.com +0.0.0.0 stts.rbc.ru +0.0.0.0 st.valueclick.com +0.0.0.0 su.addthis.com +0.0.0.0 subtracts.userplane.com +0.0.0.0 sudokuwhiz.com +0.0.0.0 sunmaker.com +0.0.0.0 superbrewards.com +0.0.0.0 support.sweepstakes.com +0.0.0.0 supremeadsonline.com +0.0.0.0 suresafe1.adsovo.com +0.0.0.0 surplus-suppliers.com +0.0.0.0 surveycentral.directinsure.info +0.0.0.0 surveymonkeycom.tt.omtrdc.net +0.0.0.0 surveypass.com +0.0.0.0 susi.adtech.fr +0.0.0.0 susi.adtech.us +0.0.0.0 svd2.adtlgc.com +0.0.0.0 svd.adtlgc.com +0.0.0.0 sview.avenuea.com +0.0.0.0 sweetsforfree.com +0.0.0.0 symbiosting.com +0.0.0.0 synad2.nuffnang.com.cn +0.0.0.0 synad.nuffnang.com.sg +0.0.0.0 syncaccess.net +0.0.0.0 sync.mathtag.com +0.0.0.0 syndicated.mondominishows.com +0.0.0.0 syndication.exoclick.com +0.0.0.0 syndication.traffichaus.com +0.0.0.0 syn.verticalacuity.com +0.0.0.0 sysadmin.map24.com +0.0.0.0 t1.adserver.com +0.0.0.0 t4.liverail.com +0.0.0.0 t-ads.adap.tv +0.0.0.0 tag1.webabacus.com +0.0.0.0 tag.admeld.com +0.0.0.0 tag.contextweb.com +0.0.0.0 tag.regieci.com +0.0.0.0 tags.bluekai.com +0.0.0.0 tags.hypeads.org +0.0.0.0 tag.webcompteur.com +0.0.0.0 tag.yieldoptimizer.com +0.0.0.0 taloussanomat.linkpulse.com +0.0.0.0 tap2-cdn.rubiconproject.com +0.0.0.0 tbtrack.zutrack.com +0.0.0.0 tcadops.ca +0.0.0.0 tcimg.com +0.0.0.0 t.cpmadvisors.com +0.0.0.0 tdameritrade.tt.omtrdc.net +0.0.0.0 tdc.advertorials.dk +0.0.0.0 tdkads.ads.dk +0.0.0.0 techreview.adbureau.net +0.0.0.0 techreview-images.adbureau.net +0.0.0.0 teeser.ru +0.0.0.0 te.kontera.com +0.0.0.0 tel.geenstijl.nl +0.0.0.0 textads.madisonavenue.com +0.0.0.0 textad.traficdublu.ro +0.0.0.0 text-link-ads.com +0.0.0.0 text-link-ads.ientry.com +0.0.0.0 text-link-ads-inventory.com +0.0.0.0 textsrv.com +0.0.0.0 tf.nexac.com +0.0.0.0 tgpmanager.com +0.0.0.0 the-binary-trader.biz +0.0.0.0 the-path-gateway.com +0.0.0.0 thepiratetrader.com +0.0.0.0 the-smart-stop.com +0.0.0.0 theuploadbusiness.com +0.0.0.0 theuseful.com +0.0.0.0 theuseful.net +0.0.0.0 thinknyc.eu-adcenter.net +0.0.0.0 thinktarget.com +0.0.0.0 thinlaptoprewards.com +0.0.0.0 this.content.served.by.adshuffle.com +0.0.0.0 thoughtfully-free.com +0.0.0.0 thruport.com +0.0.0.0 tmp3.nexac.com +0.0.0.0 tmsads.tribune.com +0.0.0.0 tmx.technoratimedia.com +0.0.0.0 tn.adserve.com +0.0.0.0 toads.osdn.com +0.0.0.0 tons-to-see.com +0.0.0.0 toolbar.adperium.com +0.0.0.0 top100-images.rambler.ru +0.0.0.0 top1site.3host.com +0.0.0.0 top5.mail.ru +0.0.0.0 topbrandrewards.com +0.0.0.0 topconsumergifts.com +0.0.0.0 topdemaroc.com +0.0.0.0 topica.advertserve.com +0.0.0.0 top.list.ru +0.0.0.0 toplist.throughput.de +0.0.0.0 topmarketcenter.com +0.0.0.0 touche.adcentric.proximi-t.com +0.0.0.0 tower.adexpedia.com +0.0.0.0 toy-offer.com +0.0.0.0 toy-offer.net +0.0.0.0 tpads.ovguide.com +0.0.0.0 tpc.googlesyndication.com +0.0.0.0 tps30.doubleverify.com +0.0.0.0 tps31.doubleverify.com +0.0.0.0 track.adbooth.net +0.0.0.0 trackadvertising.net +0.0.0.0 track-apmebf.cj.akadns.net +0.0.0.0 track.bigbrandpromotions.com +0.0.0.0 track.e7r.com.br +0.0.0.0 trackers.1st-affiliation.fr +0.0.0.0 tracking.craktraffic.com +0.0.0.0 tracking.edvisors.com +0.0.0.0 tracking.eurowebaffiliates.com +0.0.0.0 tracking.joker.com +0.0.0.0 tracking.keywordmax.com +0.0.0.0 tracking.veoxa.com +0.0.0.0 track.omgpl.com +0.0.0.0 track.the-members-section.com +0.0.0.0 track.vscash.com +0.0.0.0 tradearabia.advertserve.com +0.0.0.0 tradefx.advertserve.com +0.0.0.0 trafficbee.com +0.0.0.0 trafficrevenue.net +0.0.0.0 traffictraders.com +0.0.0.0 traffprofit.com +0.0.0.0 trafmag.com +0.0.0.0 trafsearchonline.com +0.0.0.0 traktum.com +0.0.0.0 travel-leisure-bonuspath.com +0.0.0.0 travel-leisure-premiumblvd.com +0.0.0.0 traveller-offer.com +0.0.0.0 traveller-offer.net +0.0.0.0 travelncs.com +0.0.0.0 trekmedia.net +0.0.0.0 trendnews.com +0.0.0.0 trk.alskeip.com +0.0.0.0 trk.etrigue.com +0.0.0.0 trk.yadomedia.com +0.0.0.0 trustsitesite.com +0.0.0.0 trvlnet.adbureau.net +0.0.0.0 trvlnet-images.adbureau.net +0.0.0.0 tr.wl.webads.nl +0.0.0.0 tsms-ad.tsms.com +0.0.0.0 tste.ivillage.com +0.0.0.0 tste.mcclatchyinteractive.com +0.0.0.0 tste.startribune.com +0.0.0.0 ttarget.adbureau.net +0.0.0.0 ttuk.offers4u.mobi +0.0.0.0 turnerapac.d1.sc.omtrdc.net +0.0.0.0 tv2no.linkpulse.com +0.0.0.0 tvshowsnow.tvmax.hop.clickbank.net +0.0.0.0 tw.adserver.yahoo.com +0.0.0.0 twnads.weather.ca # Canadian Weather Network +0.0.0.0 uac.advertising.com +0.0.0.0 u-ads.adap.tv +0.0.0.0 uav.tidaltv.com +0.0.0.0 uc.csc.adserver.yahoo.com +0.0.0.0 uedata.amazon.com +0.0.0.0 uelbdc74fn.s.ad6media.fr +0.0.0.0 uf2.svrni.ca +0.0.0.0 ugo.eu-adcenter.net +0.0.0.0 ui.ppjol.com +0.0.0.0 uk.adserver.yahoo.com +0.0.0.0 uleadstrk.com +0.0.0.0 ultimatefashiongifts.com +0.0.0.0 ultrabestportal.com +0.0.0.0 um.simpli.fi +0.0.0.0 undertonenetworks.com +0.0.0.0 uole.ad.uol.com.br +0.0.0.0 u.openx.net +0.0.0.0 upload.adtech.de +0.0.0.0 upload.adtech.fr +0.0.0.0 upload.adtech.us +0.0.0.0 uproar.com +0.0.0.0 uproar.fortunecity.com +0.0.0.0 upsellit.com +0.0.0.0 us.adserver.yahoo.com +0.0.0.0 usads.vibrantmedia.com +0.0.0.0 usatoday.app.ur.gcion.com +0.0.0.0 usatravel-specials.com +0.0.0.0 usatravel-specials.net +0.0.0.0 us-choicevalue.com +0.0.0.0 usemax.de +0.0.0.0 usr.marketgid.com +0.0.0.0 us-topsites.com +0.0.0.0 ut.addthis.com +0.0.0.0 utarget.ru +0.0.0.0 utils.media-general.com +0.0.0.0 utils.mediageneral.com +0.0.0.0 vad.adbasket.net +0.0.0.0 vads.adbrite.com +0.0.0.0 van.ads.link4ads.com +0.0.0.0 vast.bp3845260.btrll.com +0.0.0.0 vast.bp3846806.btrll.com +0.0.0.0 vast.bp3846885.btrll.com +0.0.0.0 vast.tubemogul.com +0.0.0.0 vclick.adbrite.com +0.0.0.0 venus.goclick.com +0.0.0.0 ve.tscapeplay.com +0.0.0.0 v.fwmrm.net +0.0.0.0 vibrantmedia.com +0.0.0.0 videocop.com +0.0.0.0 videoegg.adbureau.net +0.0.0.0 video-game-rewards-central.com +0.0.0.0 videogamerewardscentral.com +0.0.0.0 videos.fleshlight.com +0.0.0.0 videoslots.888.com +0.0.0.0 videos.video-loader.com +0.0.0.0 view.atdmt.com #This may interfere with downloading from Microsoft, MSDN and TechNet websites. +0.0.0.0 view.avenuea.com +0.0.0.0 view.binlayer.com +0.0.0.0 view.iballs.a1.avenuea.com +0.0.0.0 view.jamba.de +0.0.0.0 view.netrams.com +0.0.0.0 views.m4n.nl +0.0.0.0 viglink.com +0.0.0.0 viglink.pgpartner.com +0.0.0.0 villagevoicecollect.247realmedia.com +0.0.0.0 vip1.tw.adserver.yahoo.com +0.0.0.0 vipfastmoney.com +0.0.0.0 vk.18sexporn.ru +0.0.0.0 vmcsatellite.com +0.0.0.0 vmix.adbureau.net +0.0.0.0 vms.boldchat.com +0.0.0.0 vnu.eu-adcenter.net +0.0.0.0 vodafoneit.solution.weborama.fr +0.0.0.0 vp.tscapeplay.com +0.0.0.0 vu.veoxa.com +0.0.0.0 vzarabotke.ru +0.0.0.0 w100.am15.net +0.0.0.0 w10.am15.net +0.0.0.0 w10.centralmediaserver.com +0.0.0.0 w11.am15.net +0.0.0.0 w11.centralmediaserver.com +0.0.0.0 w12.am15.net +0.0.0.0 w13.am15.net +0.0.0.0 w14.am15.net +0.0.0.0 w15.am15.net +0.0.0.0 w16.am15.net +0.0.0.0 w17.am15.net +0.0.0.0 w18.am15.net +0.0.0.0 w19.am15.net +0.0.0.0 w1.am15.net +0.0.0.0 w1.webcompteur.com +0.0.0.0 w20.am15.net +0.0.0.0 w21.am15.net +0.0.0.0 w22.am15.net +0.0.0.0 w23.am15.net +0.0.0.0 w24.am15.net +0.0.0.0 w25.am15.net +0.0.0.0 w26.am15.net +0.0.0.0 w27.am15.net +0.0.0.0 w28.am15.net +0.0.0.0 w29.am15.net +0.0.0.0 w2.am15.net +0.0.0.0 w30.am15.net +0.0.0.0 w31.am15.net +0.0.0.0 w32.am15.net +0.0.0.0 w33.am15.net +0.0.0.0 w34.am15.net +0.0.0.0 w35.am15.net +0.0.0.0 w36.am15.net +0.0.0.0 w37.am15.net +0.0.0.0 w38.am15.net +0.0.0.0 w39.am15.net +0.0.0.0 w3.am15.net +0.0.0.0 w40.am15.net +0.0.0.0 w41.am15.net +0.0.0.0 w42.am15.net +0.0.0.0 w43.am15.net +0.0.0.0 w44.am15.net +0.0.0.0 w45.am15.net +0.0.0.0 w46.am15.net +0.0.0.0 w47.am15.net +0.0.0.0 w48.am15.net +0.0.0.0 w49.am15.net +0.0.0.0 w4.am15.net +0.0.0.0 w50.am15.net +0.0.0.0 w51.am15.net +0.0.0.0 w52.am15.net +0.0.0.0 w53.am15.net +0.0.0.0 w54.am15.net +0.0.0.0 w55.am15.net +0.0.0.0 w56.am15.net +0.0.0.0 w57.am15.net +0.0.0.0 w58.am15.net +0.0.0.0 w59.am15.net +0.0.0.0 w5.am15.net +0.0.0.0 w60.am15.net +0.0.0.0 w61.am15.net +0.0.0.0 w62.am15.net +0.0.0.0 w63.am15.net +0.0.0.0 w64.am15.net +0.0.0.0 w65.am15.net +0.0.0.0 w66.am15.net +0.0.0.0 w67.am15.net +0.0.0.0 w68.am15.net +0.0.0.0 w69.am15.net +0.0.0.0 w6.am15.net +0.0.0.0 w70.am15.net +0.0.0.0 w71.am15.net +0.0.0.0 w72.am15.net +0.0.0.0 w73.am15.net +0.0.0.0 w74.am15.net +0.0.0.0 w75.am15.net +0.0.0.0 w76.am15.net +0.0.0.0 w77.am15.net +0.0.0.0 w78.am15.net +0.0.0.0 w79.am15.net +0.0.0.0 w7.am15.net +0.0.0.0 w80.am15.net +0.0.0.0 w81.am15.net +0.0.0.0 w82.am15.net +0.0.0.0 w83.am15.net +0.0.0.0 w84.am15.net +0.0.0.0 w85.am15.net +0.0.0.0 w86.am15.net +0.0.0.0 w87.am15.net +0.0.0.0 w88.am15.net +0.0.0.0 w89.am15.net +0.0.0.0 w8.am15.net +0.0.0.0 w90.am15.net +0.0.0.0 w91.am15.net +0.0.0.0 w92.am15.net +0.0.0.0 w93.am15.net +0.0.0.0 w94.am15.net +0.0.0.0 w95.am15.net +0.0.0.0 w96.am15.net +0.0.0.0 w97.am15.net +0.0.0.0 w98.am15.net +0.0.0.0 w99.am15.net +0.0.0.0 w9.am15.net +0.0.0.0 wahoha.com +0.0.0.0 warp.crystalad.com +0.0.0.0 wdm29.com +0.0.0.0 web1b.netreflector.com +0.0.0.0 web.adblade.com +0.0.0.0 webads.bizservers.com +0.0.0.0 webads.nl +0.0.0.0 webcompteur.com +0.0.0.0 webhosting-ads.home.pl +0.0.0.0 webmdcom.tt.omtrdc.net +0.0.0.0 web.nyc.ads.juno.co +0.0.0.0 webservices-rewardpath.com +0.0.0.0 websurvey.spa-mr.com +0.0.0.0 wegetpaid.net +0.0.0.0 w.ic.tynt.com +0.0.0.0 widget3.linkwithin.com +0.0.0.0 widget5.linkwithin.com +0.0.0.0 widget.crowdignite.com +0.0.0.0 widget.plugrush.com +0.0.0.0 widgets.outbrain.com +0.0.0.0 widgets.tcimg.com +0.0.0.0 wigetmedia.com +0.0.0.0 wikiforosh.ir +0.0.0.0 williamhill.es +0.0.0.0 wmedia.rotator.hadj7.adjuggler.net +0.0.0.0 wordplaywhiz.com +0.0.0.0 work-offer.com +0.0.0.0 worry-free-savings.com +0.0.0.0 wppluginspro.com +0.0.0.0 ws.addthis.com +0.0.0.0 wtp101.com +0.0.0.0 ww251.smartadserver.com +0.0.0.0 wwbtads.com +0.0.0.0 www10.ad.tomshardware.com +0.0.0.0 www10.glam.com +0.0.0.0 www10.indiads.com +0.0.0.0 www10.paypopup.com +0.0.0.0 www11.ad.tomshardware.com +0.0.0.0 www123.glam.com +0.0.0.0 www.123specialgifts.com +0.0.0.0 www12.ad.tomshardware.com +0.0.0.0 www12.glam.com +0.0.0.0 www13.ad.tomshardware.com +0.0.0.0 www13.glam.com +0.0.0.0 www14.ad.tomshardware.com +0.0.0.0 www15.ad.tomshardware.com +0.0.0.0 www17.glam.com +0.0.0.0 www18.glam.com +0.0.0.0 www1.adireland.com +0.0.0.0 www1.ad.tomshardware.com +0.0.0.0 www1.bannerspace.com +0.0.0.0 www1.belboon.de +0.0.0.0 www1.clicktorrent.info +0.0.0.0 www1.mpnrs.com +0.0.0.0 www1.popinads.com +0.0.0.0 www1.safenyplanet.in +0.0.0.0 www210.paypopup.com +0.0.0.0 www211.paypopup.com +0.0.0.0 www212.paypopup.com +0.0.0.0 www213.paypopup.com +0.0.0.0 www.247realmedia.com +0.0.0.0 www24a.glam.com +0.0.0.0 www24.glam.com +0.0.0.0 www25a.glam.com +0.0.0.0 www25.glam.com +0.0.0.0 www2.adireland.com +0.0.0.0 www2.adserverpub.com +0.0.0.0 www2.ad.tomshardware.com +0.0.0.0 www.2-art-coliseum.com +0.0.0.0 www2.bannerspace.com +0.0.0.0 www2.glam.com +0.0.0.0 www30a1.glam.com +0.0.0.0 www30a1-orig.glam.com +0.0.0.0 www30a2-orig.glam.com +0.0.0.0 www30a3.glam.com +0.0.0.0 www30a3-orig.glam.com +0.0.0.0 www30a7.glam.com +0.0.0.0 www30.glam.com +0.0.0.0 www30l2.glam.com +0.0.0.0 www30t1-orig.glam.com +0.0.0.0 www.321cba.com +0.0.0.0 www35f.glam.com +0.0.0.0 www35jm.glam.com +0.0.0.0 www35t.glam.com +0.0.0.0 www.360ads.com +0.0.0.0 www3.addthis.com +0.0.0.0 www3.adireland.com +0.0.0.0 www3.ad.tomshardware.com +0.0.0.0 www3.bannerspace.com +0.0.0.0 www3.game-advertising-online.com +0.0.0.0 www.3qqq.net +0.0.0.0 www.3turtles.com +0.0.0.0 www.404errorpage.com +0.0.0.0 www4.ad.tomshardware.com +0.0.0.0 www4.bannerspace.com +0.0.0.0 www4.glam.com +0.0.0.0 www4.smartadserver.com +0.0.0.0 www5.ad.tomshardware.com +0.0.0.0 www5.bannerspace.com +0.0.0.0 www.5thavenue.com +0.0.0.0 www6.ad.tomshardware.com +0.0.0.0 www6.bannerspace.com +0.0.0.0 www74.valueclick.com +0.0.0.0 www.7500.com +0.0.0.0 www7.ad.tomshardware.com +0.0.0.0 www7.bannerspace.com +0.0.0.0 www.7bpeople.com +0.0.0.0 www.7cnbcnews.com +0.0.0.0 www.805m.com +0.0.0.0 www81.valueclick.com +0.0.0.0 www.888casino.com +0.0.0.0 www.888.com +0.0.0.0 www.888poker.com +0.0.0.0 www8.ad.tomshardware.com +0.0.0.0 www8.bannerspace.com +0.0.0.0 www.961.com +0.0.0.0 www9.ad.tomshardware.com +0.0.0.0 www9.paypopup.com +0.0.0.0 www.abrogatesdv.info +0.0.0.0 www.actiondesk.com +0.0.0.0 www.action.ientry.net +0.0.0.0 www.adbanner.gr +0.0.0.0 www.adbrite.com +0.0.0.0 www.adcanadian.com +0.0.0.0 www.adcash.com +0.0.0.0 www.addthiscdn.com +0.0.0.0 www.adengage.com +0.0.0.0 www.adfunkyserver.com +0.0.0.0 www.adfusion.com +0.0.0.0 www.adimages.beeb.com +0.0.0.0 www.adipics.com +0.0.0.0 www.adireland.com +0.0.0.0 www.adjmps.com +0.0.0.0 www.adjug.com +0.0.0.0 www.adloader.com +0.0.0.0 www.adlogix.com +0.0.0.0 www.admex.com +0.0.0.0 www.adnet.biz +0.0.0.0 www.adnet.com +0.0.0.0 www.adnet.de +0.0.0.0 www.adobee.com +0.0.0.0 www.adocean.pl +0.0.0.0 www.adotube.com +0.0.0.0 www.adpepper.dk +0.0.0.0 www.adpowerzone.com +0.0.0.0 www.adquest3d.com +0.0.0.0 www.adreporting.com +0.0.0.0 www.ads2srv.com +0.0.0.0 www.adsentnetwork.com +0.0.0.0 www.adserver.co.il +0.0.0.0 www.adserver.com +0.0.0.0 www.adserver.com.my +0.0.0.0 www.adserver.com.pl +0.0.0.0 www.adserver-espnet.sportszone.net +0.0.0.0 www.adserver.janes.net +0.0.0.0 www.adserver.janes.org +0.0.0.0 www.adserver.jolt.co.uk +0.0.0.0 www.adserver.net +0.0.0.0 www.adserver.ugo.nl +0.0.0.0 www.adservtech.com +0.0.0.0 www.adsinimages.com +0.0.0.0 www.ads.joetec.net +0.0.0.0 www.adsoftware.com +0.0.0.0 www.ad-souk.com +0.0.0.0 www.adspics.com +0.0.0.0 www.ads.revenue.net +0.0.0.0 www.adstogo.com +0.0.0.0 www.adstreams.org +0.0.0.0 www.adtaily.pl +0.0.0.0 www.adtechus.com +0.0.0.0 www.ad.tgdaily.com +0.0.0.0 www.adtlgc.com +0.0.0.0 www.ad.tomshardware.com +0.0.0.0 www.adtrader.com +0.0.0.0 www.adtrix.com +0.0.0.0 www.ad.twitchguru.com +0.0.0.0 www.ad-up.com +0.0.0.0 www.advaliant.com +0.0.0.0 www.advertising-department.com +0.0.0.0 www.advertlets.com +0.0.0.0 www.advertpro.com +0.0.0.0 www.adverts.dcthomson.co.uk +0.0.0.0 www.advertyz.com +0.0.0.0 www.ad-words.ru +0.0.0.0 www.afcyhf.com +0.0.0.0 www.affiliateclick.com +0.0.0.0 www.affiliate-fr.com +0.0.0.0 www.affiliation-france.com +0.0.0.0 www.afform.co.uk +0.0.0.0 www.affpartners.com +0.0.0.0 www.afterdownload.com +0.0.0.0 www.agkn.com +0.0.0.0 www.alexxe.com +0.0.0.0 www.allosponsor.com +0.0.0.0 www.annuaire-autosurf.com +0.0.0.0 www.apparelncs.com +0.0.0.0 www.apparel-offer.com +0.0.0.0 www.applelounge.com +0.0.0.0 www.appnexus.com +0.0.0.0 www.art-music-rewardpath.com +0.0.0.0 www.art-offer.com +0.0.0.0 www.art-offer.net +0.0.0.0 www.art-photo-music-premiumblvd.com +0.0.0.0 www.art-photo-music-rewardempire.com +0.0.0.0 www.art-photo-music-savingblvd.com +0.0.0.0 www.auctionshare.net +0.0.0.0 www.aureate.com +0.0.0.0 www.autohipnose.com +0.0.0.0 www.automotive-offer.com +0.0.0.0 www.automotive-rewardpath.com +0.0.0.0 www.avcounter10.com +0.0.0.0 www.avsads.com +0.0.0.0 www.a.websponsors.com +0.0.0.0 www.awesomevipoffers.com +0.0.0.0 www.awin1.com +0.0.0.0 www.awltovhc.com #qksrv +0.0.0.0 www.bananacashback.com +0.0.0.0 www.banner4all.dk +0.0.0.0 www.bannerads.de +0.0.0.0 www.bannerbackup.com +0.0.0.0 www.bannerconnect.net +0.0.0.0 www.banners.paramountzone.com +0.0.0.0 www.bannersurvey.biz +0.0.0.0 www.banstex.com +0.0.0.0 www.bargainbeautybuys.com +0.0.0.0 www.bbelements.com +0.0.0.0 www.bestshopperrewards.com +0.0.0.0 www.bet365.com +0.0.0.0 www.bidtraffic.com +0.0.0.0 www.bidvertiser.com +0.0.0.0 www.bigbrandpromotions.com +0.0.0.0 www.bigbrandrewards.com +0.0.0.0 www.biggestgiftrewards.com +0.0.0.0 www.binarysystem4u.com +0.0.0.0 www.biz-offer.com +0.0.0.0 www.bizopprewards.com +0.0.0.0 www.blasphemysfhs.info +0.0.0.0 www.blatant8jh.info +0.0.0.0 www.bluediamondoffers.com +0.0.0.0 www.bnnr.nl +0.0.0.0 www.bonzi.com +0.0.0.0 www.bookclub-offer.com +0.0.0.0 www.books-media-edu-premiumblvd.com +0.0.0.0 www.books-media-edu-rewardempire.com +0.0.0.0 www.books-media-rewardpath.com +0.0.0.0 www.boonsolutions.com +0.0.0.0 www.bostonsubwayoffer.com +0.0.0.0 www.brandrewardcentral.com +0.0.0.0 www.brandsurveypanel.com +0.0.0.0 www.brokertraffic.com +0.0.0.0 www.budsinc.com +0.0.0.0 www.bugsbanner.it +0.0.0.0 www.bulkclicks.com +0.0.0.0 www.bulletads.com +0.0.0.0 www.burstnet.com +0.0.0.0 www.business-rewardpath.com +0.0.0.0 www.bus-offer.com +0.0.0.0 www.buttcandy.com +0.0.0.0 www.buwobarun.cn +0.0.0.0 www.buycheapadvertising.com +0.0.0.0 www.buyhitscheap.com +0.0.0.0 www.capath.com +0.0.0.0 www.careers-rewardpath.com +0.0.0.0 www.car-truck-boat-bonuspath.com +0.0.0.0 www.car-truck-boat-premiumblvd.com +0.0.0.0 www.cashback.co.uk +0.0.0.0 www.cashbackwow.co.uk +0.0.0.0 www.cashcount.com +0.0.0.0 www.casino770.com +0.0.0.0 www.catalinkcashback.com +0.0.0.0 www.cell-phone-giveaways.com +0.0.0.0 www.cellphoneincentives.com +0.0.0.0 www.chainsawoffer.com +0.0.0.0 www.chartbeat.com +0.0.0.0 www.choicedealz.com +0.0.0.0 www.choicesurveypanel.com +0.0.0.0 www.christianbusinessadvertising.com +0.0.0.0 www.ciqugasox.cn +0.0.0.0 www.claimfreerewards.com +0.0.0.0 www.clashmediausa.com +0.0.0.0 www.click10.com +0.0.0.0 www.click4click.com +0.0.0.0 www.clickbank.com +0.0.0.0 www.clickdensity.com +0.0.0.0 www.click-find-save.com +0.0.0.0 www.click-see-save.com +0.0.0.0 www.clicksor.com +0.0.0.0 www.clicksotrk.com +0.0.0.0 www.clicktale.com +0.0.0.0 www.clicktale.net +0.0.0.0 www.clickthruserver.com +0.0.0.0 www.clickthrutraffic.com +0.0.0.0 www.clicktilluwin.com +0.0.0.0 www.clicktorrent.info +0.0.0.0 www.clickxchange.com +0.0.0.0 www.closeoutproductsreview.com +0.0.0.0 www.cm1359.com +0.0.0.0 www.come-see-it-all.com +0.0.0.0 www.commerce-offer.com +0.0.0.0 www.commerce-rewardpath.com +0.0.0.0 www.computer-offer.com +0.0.0.0 www.computer-offer.net +0.0.0.0 www.computers-electronics-rewardpath.com +0.0.0.0 www.computersncs.com +0.0.0.0 www.consumergiftcenter.com +0.0.0.0 www.consumerincentivenetwork.com +0.0.0.0 www.consumer-org.com +0.0.0.0 www.contaxe.com +0.0.0.0 www.contextuads.com +0.0.0.0 www.contextweb.com +0.0.0.0 www.cookingtiprewards.com +0.0.0.0 www.coolconcepts.nl +0.0.0.0 www.cool-premiums.com +0.0.0.0 www.cool-premiums-now.com +0.0.0.0 www.coolpremiumsnow.com +0.0.0.0 www.coolsavings.com +0.0.0.0 www.coreglead.co.uk +0.0.0.0 www.cosmeticscentre.uk.com +0.0.0.0 www.cpabank.com +0.0.0.0 www.cpmadvisors.com +0.0.0.0 www.crazypopups.com +0.0.0.0 www.crazywinnings.com +0.0.0.0 www.crediblegfj.info +0.0.0.0 www.crispads.com +0.0.0.0 www.crowdgravity.com +0.0.0.0 www.crowdignite.com +0.0.0.0 www.ctbdev.net +0.0.0.0 www.cyber-incentives.com +0.0.0.0 www.d03x2011.com +0.0.0.0 www.da-ads.com +0.0.0.0 www.daily-saver.com +0.0.0.0 www.datatech.es +0.0.0.0 www.datingadvertising.com +0.0.0.0 www.dctracking.com +0.0.0.0 www.depravedwhores.com +0.0.0.0 www.designbloxlive.com +0.0.0.0 www.dgmaustralia.com +0.0.0.0 www.dietoftoday.ca.pn +0.0.0.0 www.digimedia.com +0.0.0.0 www.directnetadvertising.net +0.0.0.0 www.directpowerrewards.com +0.0.0.0 www.dirtyrhino.com +0.0.0.0 www.discount-savings-more.com +0.0.0.0 www.djugoogs.com +0.0.0.0 www.dl-plugin.com +0.0.0.0 www.drowle.com +0.0.0.0 www.dutchsales.org +0.0.0.0 www.earnmygift.com +0.0.0.0 www.earnpointsandgifts.com +0.0.0.0 www.easyadservice.com +0.0.0.0 www.e-bannerx.com +0.0.0.0 www.ebaybanner.com +0.0.0.0 www.education-rewardpath.com +0.0.0.0 www.edu-offer.com +0.0.0.0 www.electronics-bonuspath.com +0.0.0.0 www.electronics-offer.net +0.0.0.0 www.electronicspresent.com +0.0.0.0 www.electronics-rewardpath.com +0.0.0.0 www.emailadvantagegroup.com +0.0.0.0 www.emailproductreview.com +0.0.0.0 www.emarketmakers.com +0.0.0.0 www.entertainment-rewardpath.com +0.0.0.0 www.entertainment-specials.com +0.0.0.0 www.eshopads2.com +0.0.0.0 www.euros4click.de +0.0.0.0 www.exclusivegiftcards.com +0.0.0.0 www.eyeblaster-bs.com +0.0.0.0 www.eyewonder.com #: Interactive Digital Advertising, Rich Media Ads, Flash Ads, Online Advertising +0.0.0.0 www.falkag.de +0.0.0.0 www.family-offer.com +0.0.0.0 www.fast-adv.it +0.0.0.0 www.fatcatrewards.com +0.0.0.0 www.feedjit.com +0.0.0.0 www.feedstermedia.com +0.0.0.0 www.fif49.info +0.0.0.0 www.finance-offer.com +0.0.0.0 www.finder.cox.net +0.0.0.0 www.fineclicks.com +0.0.0.0 www.flagcounter.com +0.0.0.0 www.flowers-offer.com +0.0.0.0 www.flu23.com +0.0.0.0 www.focalex.com +0.0.0.0 www.folloyu.com +0.0.0.0 www.food-drink-bonuspath.com +0.0.0.0 www.food-drink-rewardpath.com +0.0.0.0 www.foodmixeroffer.com +0.0.0.0 www.food-offer.com +0.0.0.0 www.fpctraffic2.com +0.0.0.0 www.freeadguru.com +0.0.0.0 www.freebiegb.co.uk +0.0.0.0 www.freecameraonus.com +0.0.0.0 www.freecameraprovider.com +0.0.0.0 www.freecamerasource.com +0.0.0.0 www.freecamerauk.co.uk +0.0.0.0 www.freecamsecrets.com +0.0.0.0 www.freecoolgift.com +0.0.0.0 www.freedesignerhandbagreviews.com +0.0.0.0 www.freedinnersource.com +0.0.0.0 www.freedvddept.com +0.0.0.0 www.freeelectronicscenter.com +0.0.0.0 www.freeelectronicsdepot.com +0.0.0.0 www.freeelectronicsonus.com +0.0.0.0 www.freeelectronicssource.com +0.0.0.0 www.freeentertainmentsource.com +0.0.0.0 www.freefoodprovider.com +0.0.0.0 www.freefoodsource.com +0.0.0.0 www.freefuelcard.com +0.0.0.0 www.freefuelcoupon.com +0.0.0.0 www.freegasonus.com +0.0.0.0 www.freegasprovider.com +0.0.0.0 www.free-gift-cards-now.com +0.0.0.0 www.freegiftcardsource.com +0.0.0.0 www.freegiftreward.com +0.0.0.0 www.free-gifts-comp.com +0.0.0.0 www.freeipodnanouk.co.uk +0.0.0.0 www.freeipoduk.com +0.0.0.0 www.freeipoduk.co.uk +0.0.0.0 www.freelaptopgift.com +0.0.0.0 www.freelaptopnation.com +0.0.0.0 www.free-laptop-reward.com +0.0.0.0 www.freelaptopreward.com +0.0.0.0 www.freelaptopwebsites.com +0.0.0.0 www.freenation.com +0.0.0.0 www.freeoffers-toys.com +0.0.0.0 www.freepayasyougotopupuk.co.uk +0.0.0.0 www.freeplasmanation.com +0.0.0.0 www.freerestaurantprovider.com +0.0.0.0 www.freerestaurantsource.com +0.0.0.0 www.freeshoppingprovider.com +0.0.0.0 www.freeshoppingsource.com +0.0.0.0 www.friendlyduck.com +0.0.0.0 www.frontpagecash.com +0.0.0.0 www.ftjcfx.com #commission junction +0.0.0.0 www.fusionbanners.com +0.0.0.0 www.gameconsolerewards.com +0.0.0.0 www.games-toys-bonuspath.com +0.0.0.0 www.games-toys-free.com +0.0.0.0 www.games-toys-rewardpath.com +0.0.0.0 www.gatoradvertisinginformationnetwork.com +0.0.0.0 www.getacool100.com +0.0.0.0 www.getacool500.com +0.0.0.0 www.getacoollaptop.com +0.0.0.0 www.getacooltv.com +0.0.0.0 www.getagiftonline.com +0.0.0.0 www.getloan.com +0.0.0.0 www.getmyfreebabystuff.com +0.0.0.0 www.getmyfreegear.com +0.0.0.0 www.getmyfreegiftcard.com +0.0.0.0 www.getmyfreelaptop.com +0.0.0.0 www.getmyfreelaptophere.com +0.0.0.0 www.getmyfreeplasma.com +0.0.0.0 www.getmylaptopfree.com +0.0.0.0 www.getmyplasmatv.com +0.0.0.0 www.getspecialgifts.com +0.0.0.0 www.getyourfreecomputer.com +0.0.0.0 www.getyourfreetv.com +0.0.0.0 www.giftcardchallenge.com +0.0.0.0 www.giftcardsurveys.us.com +0.0.0.0 www.giftrewardzone.com +0.0.0.0 www.gifts-flowers-rewardpath.com +0.0.0.0 www.gimmethatreward.com +0.0.0.0 www.gmads.net +0.0.0.0 www.go-free-gifts.com +0.0.0.0 www.gofreegifts.com +0.0.0.0 www.goody-garage.com +0.0.0.0 www.gopopup.com +0.0.0.0 www.grabbit-rabbit.com +0.0.0.0 www.greasypalm.com +0.0.0.0 www.grz67.com +0.0.0.0 www.guesstheview.com +0.0.0.0 www.guptamedianetwork.com +0.0.0.0 www.happydiscountspecials.com +0.0.0.0 www.healthbeautyncs.com +0.0.0.0 www.health-beauty-rewardpath.com +0.0.0.0 www.health-beauty-savingblvd.com +0.0.0.0 www.healthclicks.co.uk +0.0.0.0 www.hebdotop.com +0.0.0.0 www.hightrafficads.com +0.0.0.0 www.holiday-gift-offers.com +0.0.0.0 www.holidayproductpromo.com +0.0.0.0 www.holidayshoppingrewards.com +0.0.0.0 www.home4bizstart.ru +0.0.0.0 www.homeelectronicproducts.com +0.0.0.0 www.home-garden-premiumblvd.com +0.0.0.0 www.home-garden-rewardempire.com +0.0.0.0 www.home-garden-rewardpath.com +0.0.0.0 www.hooqy.com +0.0.0.0 www.hot-daily-deal.com +0.0.0.0 www.hotgiftzone.com +0.0.0.0 www.hotkeys.com +0.0.0.0 www.hot-product-hangout.com +0.0.0.0 www.idealcasino.net +0.0.0.0 www.idirect.com +0.0.0.0 www.iicdn.com +0.0.0.0 www.ijacko.net +0.0.0.0 www.ilovecheating.com +0.0.0.0 www.impressionaffiliate.com +0.0.0.0 www.impressionaffiliate.mobi +0.0.0.0 www.impressionlead.com +0.0.0.0 www.impressionperformance.biz +0.0.0.0 www.incentivegateway.com +0.0.0.0 www.incentiverewardcenter.com +0.0.0.0 www.incentive-scene.com +0.0.0.0 www.inckamedia.com +0.0.0.0 www.indiads.com +0.0.0.0 www.infinite-ads.com # www.shareactor.com +0.0.0.0 www.ins-offer.com +0.0.0.0 www.insurance-rewardpath.com +0.0.0.0 www.intela.com +0.0.0.0 www.interstitialzone.com +0.0.0.0 www.intnet-offer.com +0.0.0.0 www.invitefashion.com +0.0.0.0 www.is1.clixgalore.com +0.0.0.0 www.itrackerpro.com +0.0.0.0 www.itsfree123.com +0.0.0.0 www.iwantmyfreecash.com +0.0.0.0 www.iwantmy-freelaptop.com +0.0.0.0 www.iwantmyfree-laptop.com +0.0.0.0 www.iwantmyfreelaptop.com +0.0.0.0 www.iwantmygiftcard.com +0.0.0.0 www.jersey-offer.com +0.0.0.0 www.jetseeker.com +0.0.0.0 www.jivox.com +0.0.0.0 www.jl29jd25sm24mc29.com +0.0.0.0 www.joinfree.ro +0.0.0.0 www.jxliu.com +0.0.0.0 www.keybinary.com +0.0.0.0 www.keywordblocks.com +0.0.0.0 www.kitaramarketplace.com +0.0.0.0 www.kitaramedia.com +0.0.0.0 www.kitaratrk.com +0.0.0.0 www.kixer.com +0.0.0.0 www.kliksaya.com +0.0.0.0 www.kmdl101.com +0.0.0.0 www.kontera.com +0.0.0.0 www.konversation.com +0.0.0.0 www.kreaffiliation.com +0.0.0.0 www.kuhdi.com +0.0.0.0 www.ladyclicks.ru +0.0.0.0 www.laptopreportcard.com +0.0.0.0 www.laptoprewards.com +0.0.0.0 www.laptoprewardsgroup.com +0.0.0.0 www.laptoprewardszone.com +0.0.0.0 www.larivieracasino.com +0.0.0.0 www.lasthr.info +0.0.0.0 www.lduhtrp.net #commission junction +0.0.0.0 www.le1er.net +0.0.0.0 www.leadgreed.com +0.0.0.0 www.learning-offer.com +0.0.0.0 www.legal-rewardpath.com +0.0.0.0 www.leisure-offer.com +0.0.0.0 www.linkhut.com +0.0.0.0 www.linkpulse.com +0.0.0.0 www.linkwithin.com +0.0.0.0 www.liveinternet.ru +0.0.0.0 www.lottoforever.com +0.0.0.0 www.lpcloudsvr302.com +0.0.0.0 www.lucky-day-uk.com +0.0.0.0 www.macombdisplayads.com +0.0.0.0 www.marketing-rewardpath.com +0.0.0.0 www.mastertracks.be +0.0.0.0 www.maxbounty.com +0.0.0.0 www.mb01.com +0.0.0.0 www.media2.travelzoo.com +0.0.0.0 www.media-motor.com +0.0.0.0 www.medical-offer.com +0.0.0.0 www.medical-rewardpath.com +0.0.0.0 www.merchantapp.com +0.0.0.0 www.merlin.co.il +0.0.0.0 www.mgid.com +0.0.0.0 www.mightymagoo.com +0.0.0.0 www.mktg-offer.com +0.0.0.0 www.mlntracker.com +0.0.0.0 www.mochibot.com +0.0.0.0 www.morefreecamsecrets.com +0.0.0.0 www.morevisits.info +0.0.0.0 www.mp3playersource.com +0.0.0.0 www.mpression.net +0.0.0.0 www.myadsl.co.za +0.0.0.0 www.myaffiliateprogram.com +0.0.0.0 www.myairbridge.com +0.0.0.0 www.mycashback.co.uk +0.0.0.0 www.mycelloffer.com +0.0.0.0 www.mychoicerewards.com +0.0.0.0 www.myexclusiverewards.com +0.0.0.0 www.myfreedinner.com +0.0.0.0 www.myfreegifts.co.uk +0.0.0.0 www.myfreemp3player.com +0.0.0.0 www.mygiftcardcenter.com +0.0.0.0 www.mygreatrewards.com +0.0.0.0 www.myoffertracking.com +0.0.0.0 www.my-reward-channel.com +0.0.0.0 www.my-rewardsvault.com +0.0.0.0 www.myseostats.com +0.0.0.0 www.my-stats.com +0.0.0.0 www.myuitm.com +0.0.0.0 www.myusersonline.com +0.0.0.0 www.na47.com +0.0.0.0 www.nationalissuepanel.com +0.0.0.0 www.nationalsurveypanel.com +0.0.0.0 www.nctracking.com +0.0.0.0 www.nearbyad.com +0.0.0.0 www.needadvertising.com +0.0.0.0 www.neptuneads.com +0.0.0.0 www.netpalnow.com +0.0.0.0 www.netpaloffers.net +0.0.0.0 www.news6health.com +0.0.0.0 www.newssourceoftoday.com +0.0.0.0 www.nospartenaires.com +0.0.0.0 www.nothing-but-value.com +0.0.0.0 www.nysubwayoffer.com +0.0.0.0 www.offerx.co.uk +0.0.0.0 www.oinadserve.com +0.0.0.0 www.onlinebestoffers.net +0.0.0.0 www.ontheweb.com +0.0.0.0 www.opendownload.de +0.0.0.0 www.openload.de +0.0.0.0 www.optiad.net +0.0.0.0 www.paperg.com +0.0.0.0 www.parsads.com +0.0.0.0 www.pathforpoints.com +0.0.0.0 www.paypopup.com +0.0.0.0 www.people-choice-sites.com +0.0.0.0 www.personalcare-offer.com +0.0.0.0 www.personalcashbailout.com +0.0.0.0 www.phoenixads.co.in +0.0.0.0 www.pick-savings.com +0.0.0.0 www.plasmatv4free.com +0.0.0.0 www.plasmatvreward.com +0.0.0.0 www.politicalopinionsurvey.com +0.0.0.0 www.poponclick.com +0.0.0.0 www.popupad.net +0.0.0.0 www.popupdomination.com +0.0.0.0 www.popuptraffic.com +0.0.0.0 www.postmasterbannernet.com +0.0.0.0 www.postmasterdirect.com +0.0.0.0 www.postnewsads.com +0.0.0.0 www.premiumholidayoffers.com +0.0.0.0 www.premiumproductsonline.com +0.0.0.0 www.premium-reward-club.com +0.0.0.0 www.prizes.co.uk +0.0.0.0 www.probabilidades.net +0.0.0.0 www.productopinionpanel.com +0.0.0.0 www.productresearchpanel.com +0.0.0.0 www.producttestpanel.com +0.0.0.0 www.psclicks.com +0.0.0.0 www.pubdirecte.com +0.0.0.0 www.qitrck.com +0.0.0.0 www.quickbrowsersearch.com +0.0.0.0 www.radiate.com +0.0.0.0 www.rankyou.com +0.0.0.0 www.ravel-rewardpath.com +0.0.0.0 www.recreation-leisure-rewardpath.com +0.0.0.0 www.regflow.com +0.0.0.0 www.registrarads.com +0.0.0.0 www.resolvingserver.com +0.0.0.0 www.rewardblvd.com +0.0.0.0 www.rewardhotspot.com +0.0.0.0 www.rewardsflow.com +0.0.0.0 www.ringtonepartner.com +0.0.0.0 www.romepartners.com +0.0.0.0 www.roulettebotplus.com +0.0.0.0 www.rovion.com +0.0.0.0 www.rscounter10.com +0.0.0.0 www.rtcode.com +0.0.0.0 www.rwpads.net +0.0.0.0 www.sa44.net +0.0.0.0 www.salesonline.ie +0.0.0.0 www.save-plan.com +0.0.0.0 www.savings-specials.com +0.0.0.0 www.savings-time.com +0.0.0.0 www.scoremygift.com +0.0.0.0 www.screen-mates.com +0.0.0.0 www.searchwe.com +0.0.0.0 www.seasonalsamplerspecials.com +0.0.0.0 www.securecontactinfo.com +0.0.0.0 www.securerunner.com +0.0.0.0 www.servedby.advertising.com +0.0.0.0 www.sexpartnerx.com +0.0.0.0 www.sexsponsors.com +0.0.0.0 www.shareasale.com +0.0.0.0 www.share-server.com +0.0.0.0 www.shc-rebates.com +0.0.0.0 www.shopperpromotions.com +0.0.0.0 www.shoppingjobshere.com +0.0.0.0 www.shopping-offer.com +0.0.0.0 www.shoppingsiterewards.com +0.0.0.0 www.shops-malls-rewardpath.com +0.0.0.0 www.shoptosaveenergy.com +0.0.0.0 www.simpli.fi +0.0.0.0 www.sizzle-savings.com +0.0.0.0 www.smartadserver.com +0.0.0.0 www.smart-scripts.com +0.0.0.0 www.smarttargetting.com +0.0.0.0 www.smokersopinionpoll.com +0.0.0.0 www.smspop.com +0.0.0.0 www.sochr.com +0.0.0.0 www.sociallypublish.com +0.0.0.0 www.soongu.info +0.0.0.0 www.specialgiftrewards.com +0.0.0.0 www.specialonlinegifts.com +0.0.0.0 www.specials-rewardpath.com +0.0.0.0 www.speedboink.com +0.0.0.0 www.speedyclick.com +0.0.0.0 www.spinbox.com +0.0.0.0 www.sponsorads.de +0.0.0.0 www.sponsoradulto.com +0.0.0.0 www.sports-bonuspath.com +0.0.0.0 www.sports-fitness-rewardpath.com +0.0.0.0 www.sports-offer.com +0.0.0.0 www.sports-offer.net +0.0.0.0 www.sports-premiumblvd.com +0.0.0.0 www.sq2trk2.com +0.0.0.0 www.star-advertising.com +0.0.0.0 www.subsitesadserver.co.uk +0.0.0.0 www.sudokuwhiz.com +0.0.0.0 www.superbrewards.com +0.0.0.0 www.supremeadsonline.com +0.0.0.0 www.surplus-suppliers.com +0.0.0.0 www.sweetsforfree.com +0.0.0.0 www.symbiosting.com +0.0.0.0 www.syncaccess.net +0.0.0.0 www.system-live-media.cz +0.0.0.0 www.tcimg.com +0.0.0.0 www.textbanners.net +0.0.0.0 www.text-link-ads.com +0.0.0.0 www.textsrv.com +0.0.0.0 www.tgpmanager.com +0.0.0.0 www.thatrendsystem.com +0.0.0.0 www.the-binary-options-guide.com +0.0.0.0 www.the-binary-theorem.com +0.0.0.0 www.the-path-gateway.com +0.0.0.0 www.the-smart-stop.com +0.0.0.0 www.thetraderinpajamas.com +0.0.0.0 www.theuseful.com +0.0.0.0 www.theuseful.net +0.0.0.0 www.thinktarget.com +0.0.0.0 www.thinlaptoprewards.com +0.0.0.0 www.thoughtfully-free.com +0.0.0.0 www.thruport.com +0.0.0.0 www.tons-to-see.com +0.0.0.0 www.top20free.com +0.0.0.0 www.topbrandrewards.com +0.0.0.0 www.topconsumergifts.com +0.0.0.0 www.topdemaroc.com +0.0.0.0 www.toy-offer.com +0.0.0.0 www.toy-offer.net +0.0.0.0 www.tqlkg.com #commission junction +0.0.0.0 www.trackadvertising.net +0.0.0.0 www.tracklead.net +0.0.0.0 www.trafficrevenue.net +0.0.0.0 www.traffictrader.net +0.0.0.0 www.traffictraders.com +0.0.0.0 www.trafsearchonline.com +0.0.0.0 www.traktum.com +0.0.0.0 www.traveladvertising.com +0.0.0.0 www.travel-leisure-bonuspath.com +0.0.0.0 www.travel-leisure-premiumblvd.com +0.0.0.0 www.traveller-offer.com +0.0.0.0 www.traveller-offer.net +0.0.0.0 www.travelncs.com +0.0.0.0 www.treeloot.com +0.0.0.0 www.trendnews.com +0.0.0.0 www.trendsonline.biz +0.0.0.0 www.trendsonline.me +0.0.0.0 www.trendsonline.mobi +0.0.0.0 www.trndsys.mobi +0.0.0.0 www.tutop.com +0.0.0.0 www.tuttosessogratis.org +0.0.0.0 www.ukbanners.com +0.0.0.0 www.uleadstrk.com +0.0.0.0 www.ultimatefashiongifts.com +0.0.0.0 www.uproar.com +0.0.0.0 www.upsellit.com +0.0.0.0 www.usatravel-specials.com +0.0.0.0 www.usatravel-specials.net +0.0.0.0 www.us-choicevalue.com +0.0.0.0 www.usemax.de +0.0.0.0 www.us-topsites.com +0.0.0.0 www.utarget.co.uk +0.0.0.0 www.valueclick.com +0.0.0.0 www.via22.net +0.0.0.0 www.vibrantmedia.com +0.0.0.0 www.video-game-rewards-central.com +0.0.0.0 www.videogamerewardscentral.com +0.0.0.0 www.view4cash.de +0.0.0.0 www.virtumundo.com +0.0.0.0 www.vmcsatellite.com +0.0.0.0 www.wdm29.com +0.0.0.0 www.webcashvideos.com +0.0.0.0 www.webcompteur.com +0.0.0.0 www.webservices-rewardpath.com +0.0.0.0 www.websponsors.com +0.0.0.0 www.wegetpaid.net +0.0.0.0 www.whatuwhatuwhatuwant.com +0.0.0.0 www.widgetbucks.com +0.0.0.0 www.wigetmedia.com +0.0.0.0 www.williamhill.es +0.0.0.0 www.windaily.com +0.0.0.0 www.winnerschoiceservices.com +0.0.0.0 www.wordplaywhiz.com +0.0.0.0 www.work-offer.com +0.0.0.0 www.worry-free-savings.com +0.0.0.0 www.wppluginspro.com +0.0.0.0 www.wtp101.com +0.0.0.0 www.xbn.ru # exclusive banner network (Russian) +0.0.0.0 www.yceml.net +0.0.0.0 www.yibaruxet.cn +0.0.0.0 www.yieldmanager.net +0.0.0.0 www.youfck.com +0.0.0.0 www.yourdvdplayer.com +0.0.0.0 www.yourfreegascard.com +0.0.0.0 www.yourgascards.com +0.0.0.0 www.yourgiftrewards.com +0.0.0.0 www.your-gift-zone.com +0.0.0.0 www.yourgiftzone.com +0.0.0.0 www.yourhandytips.com +0.0.0.0 www.yourhotgiftzone.com +0.0.0.0 www.youripad4free.com +0.0.0.0 www.yourrewardzone.com +0.0.0.0 www.yoursmartrewards.com +0.0.0.0 www.zemgo.com +0.0.0.0 www.zevents.com +0.0.0.0 x86adserve006.adtech.de +0.0.0.0 xads.zedo.com +0.0.0.0 x.azjmp.com +0.0.0.0 x.iasrv.com +0.0.0.0 x.interia.pl +0.0.0.0 xlonhcld.xlontech.net +0.0.0.0 xml.adtech.de +0.0.0.0 xml.adtech.fr +0.0.0.0 xml.adtech.us +0.0.0.0 xml.click9.com +0.0.0.0 x.mochiads.com +0.0.0.0 xpantivirus.com +0.0.0.0 xpcs.ads.yahoo.com +0.0.0.0 xstatic.nk-net.pl +0.0.0.0 yadro.ru +0.0.0.0 y.cdn.adblade.com +0.0.0.0 yieldmanagement.adbooth.net +0.0.0.0 yieldmanager.net +0.0.0.0 ym.adnxs.com +0.0.0.0 yodleeinc.tt.omtrdc.net +0.0.0.0 youfck.com +0.0.0.0 yourdvdplayer.com +0.0.0.0 yourfreegascard.com +0.0.0.0 your-free-iphone.com +0.0.0.0 yourgascards.com +0.0.0.0 yourgiftrewards.com +0.0.0.0 your-gift-zone.com +0.0.0.0 yourgiftzone.com +0.0.0.0 yourhandytips.com +0.0.0.0 yourhotgiftzone.com +0.0.0.0 youripad4free.com +0.0.0.0 yourrewardzone.com +0.0.0.0 yoursmartrewards.com +0.0.0.0 ypn-js.overture.com +0.0.0.0 ysiu.freenation.com +0.0.0.0 ytaahg.vo.llnwd.net +0.0.0.0 yumenetworks.com +0.0.0.0 yx-in-f108.1e100.net +0.0.0.0 z1.adserver.com +0.0.0.0 zads.zedo.com +0.0.0.0 z.blogads.com +0.0.0.0 z.ceotrk.com +0.0.0.0 zdads.e-media.com +0.0.0.0 zeevex-online.com +0.0.0.0 zemgo.com +0.0.0.0 zevents.com +0.0.0.0 zuzzer5.com +# + +# + +# yahoo banner ads +0.0.0.0 eur.a1.yimg.com +0.0.0.0 in.yimg.com +0.0.0.0 sg.yimg.com +0.0.0.0 uk.i1.yimg.com +0.0.0.0 us.a1.yimg.com +0.0.0.0 us.b1.yimg.com +0.0.0.0 us.c1.yimg.com +0.0.0.0 us.d1.yimg.com +0.0.0.0 us.e1.yimg.com +0.0.0.0 us.f1.yimg.com +0.0.0.0 us.g1.yimg.com +0.0.0.0 us.h1.yimg.com +#0.0.0.0 us.i1.yimg.com #Uncomment this to block yahoo images +0.0.0.0 us.j1.yimg.com +0.0.0.0 us.k1.yimg.com +0.0.0.0 us.l1.yimg.com +0.0.0.0 us.m1.yimg.com +0.0.0.0 us.n1.yimg.com +0.0.0.0 us.o1.yimg.com +0.0.0.0 us.p1.yimg.com +0.0.0.0 us.q1.yimg.com +0.0.0.0 us.r1.yimg.com +0.0.0.0 us.s1.yimg.com +0.0.0.0 us.t1.yimg.com +0.0.0.0 us.u1.yimg.com +0.0.0.0 us.v1.yimg.com +0.0.0.0 us.w1.yimg.com +0.0.0.0 us.x1.yimg.com +0.0.0.0 us.y1.yimg.com +0.0.0.0 us.z1.yimg.com +# + +# + +# hitbox.com web bugs +0.0.0.0 1cgi.hitbox.com +0.0.0.0 2cgi.hitbox.com +0.0.0.0 adminec1.hitbox.com +0.0.0.0 ads.hitbox.com +0.0.0.0 ag1.hitbox.com +0.0.0.0 ahbn1.hitbox.com +0.0.0.0 ahbn2.hitbox.com +0.0.0.0 ahbn3.hitbox.com +0.0.0.0 ahbn4.hitbox.com +0.0.0.0 aibg.hitbox.com +0.0.0.0 aibl.hitbox.com +0.0.0.0 aics.hitbox.com +0.0.0.0 ai.hitbox.com +0.0.0.0 aiui.hitbox.com +0.0.0.0 bigip1.hitbox.com +0.0.0.0 bigip2.hitbox.com +0.0.0.0 blowfish.hitbox.com +0.0.0.0 cdb.hitbox.com +0.0.0.0 cgi.hitbox.com +0.0.0.0 counter2.hitbox.com +0.0.0.0 counter.hitbox.com +0.0.0.0 dev101.hitbox.com +0.0.0.0 dev102.hitbox.com +0.0.0.0 dev103.hitbox.com +0.0.0.0 dev.hitbox.com +0.0.0.0 download.hitbox.com +0.0.0.0 ec1.hitbox.com +0.0.0.0 ehg-247internet.hitbox.com +0.0.0.0 ehg-accuweather.hitbox.com +0.0.0.0 ehg-acdsystems.hitbox.com +0.0.0.0 ehg-adeptscience.hitbox.com +0.0.0.0 ehg-affinitynet.hitbox.com +0.0.0.0 ehg-aha.hitbox.com +0.0.0.0 ehg-amerix.hitbox.com +0.0.0.0 ehg-apcc.hitbox.com +0.0.0.0 ehg-associatenewmedia.hitbox.com +0.0.0.0 ehg-ati.hitbox.com +0.0.0.0 ehg-attenza.hitbox.com +0.0.0.0 ehg-autodesk.hitbox.com +0.0.0.0 ehg-baa.hitbox.com +0.0.0.0 ehg-backweb.hitbox.com +0.0.0.0 ehg-bestbuy.hitbox.com +0.0.0.0 ehg-bizjournals.hitbox.com +0.0.0.0 ehg-bmwna.hitbox.com +0.0.0.0 ehg-boschsiemens.hitbox.com +0.0.0.0 ehg-bskyb.hitbox.com +0.0.0.0 ehg-cafepress.hitbox.com +0.0.0.0 ehg-careerbuilder.hitbox.com +0.0.0.0 ehg-cbc.hitbox.com +0.0.0.0 ehg-cbs.hitbox.com +0.0.0.0 ehg-cbsradio.hitbox.com +0.0.0.0 ehg-cedarpoint.hitbox.com +0.0.0.0 ehg-clearchannel.hitbox.com +0.0.0.0 ehg-closetmaid.hitbox.com +0.0.0.0 ehg-commjun.hitbox.com +0.0.0.0 ehg.commjun.hitbox.com +0.0.0.0 ehg-communityconnect.hitbox.com +0.0.0.0 ehg-communityconnet.hitbox.com +0.0.0.0 ehg-comscore.hitbox.com +0.0.0.0 ehg-corusentertainment.hitbox.com +0.0.0.0 ehg-coverityinc.hitbox.com +0.0.0.0 ehg-crain.hitbox.com +0.0.0.0 ehg-ctv.hitbox.com +0.0.0.0 ehg-cygnusbm.hitbox.com +0.0.0.0 ehg-datamonitor.hitbox.com +0.0.0.0 ehg-digg.hitbox.com +0.0.0.0 ehg-dig.hitbox.com +0.0.0.0 ehg-eckounlimited.hitbox.com +0.0.0.0 ehg-esa.hitbox.com +0.0.0.0 ehg-espn.hitbox.com +0.0.0.0 ehg-fifa.hitbox.com +0.0.0.0 ehg-findlaw.hitbox.com +0.0.0.0 ehg-foundation.hitbox.com +0.0.0.0 ehg-foxsports.hitbox.com +0.0.0.0 ehg-futurepub.hitbox.com +0.0.0.0 ehg-gamedaily.hitbox.com +0.0.0.0 ehg-gamespot.hitbox.com +0.0.0.0 ehg-gatehousemedia.hitbox.com +0.0.0.0 ehg-gatehoussmedia.hitbox.com +0.0.0.0 ehg-glam.hitbox.com +0.0.0.0 ehg-groceryworks.hitbox.com +0.0.0.0 ehg-groupernetworks.hitbox.com +0.0.0.0 ehg-guardian.hitbox.com +0.0.0.0 ehg-hasbro.hitbox.com +0.0.0.0 ehg-hellodirect.hitbox.com +0.0.0.0 ehg-himedia.hitbox.com +0.0.0.0 ehg.hitbox.com +0.0.0.0 ehg-hitent.hitbox.com +0.0.0.0 ehg-hollywood.hitbox.com +0.0.0.0 ehg-idgentertainment.hitbox.com +0.0.0.0 ehg-idg.hitbox.com +0.0.0.0 ehg-ifilm.hitbox.com +0.0.0.0 ehg-ignitemedia.hitbox.com +0.0.0.0 ehg-intel.hitbox.com +0.0.0.0 ehg-ittoolbox.hitbox.com +0.0.0.0 ehg-itworldcanada.hitbox.com +0.0.0.0 ehg-kingstontechnology.hitbox.com +0.0.0.0 ehg-knightridder.hitbox.com +0.0.0.0 ehg-learningco.hitbox.com +0.0.0.0 ehg-legonewyorkinc.hitbox.com +0.0.0.0 ehg-liveperson.hitbox.com +0.0.0.0 ehg-macpublishingllc.hitbox.com +0.0.0.0 ehg-macromedia.hitbox.com +0.0.0.0 ehg-magicalia.hitbox.com +0.0.0.0 ehg-maplesoft.hitbox.com +0.0.0.0 ehg-mgnlimited.hitbox.com +0.0.0.0 ehg-mindshare.hitbox.com +0.0.0.0 ehg.mindshare.hitbox.com +0.0.0.0 ehg-mtv.hitbox.com +0.0.0.0 ehg-mybc.hitbox.com +0.0.0.0 ehg-newarkinone.hitbox.com.hitbox.com +0.0.0.0 ehg-newegg.hitbox.com +0.0.0.0 ehg-newscientist.hitbox.com +0.0.0.0 ehg-newsinternational.hitbox.com +0.0.0.0 ehg-nokiafin.hitbox.com +0.0.0.0 ehg-novell.hitbox.com +0.0.0.0 ehg-nvidia.hitbox.com +0.0.0.0 ehg-oreilley.hitbox.com +0.0.0.0 ehg-oreilly.hitbox.com +0.0.0.0 ehg-pacifictheatres.hitbox.com +0.0.0.0 ehg-pennwell.hitbox.com +0.0.0.0 ehg-peoplesoft.hitbox.com +0.0.0.0 ehg-philipsvheusen.hitbox.com +0.0.0.0 ehg-pizzahut.hitbox.com +0.0.0.0 ehg-playboy.hitbox.com +0.0.0.0 ehg-presentigsolutions.hitbox.com +0.0.0.0 ehg-qualcomm.hitbox.com +0.0.0.0 ehg-quantumcorp.hitbox.com +0.0.0.0 ehg-randomhouse.hitbox.com +0.0.0.0 ehg-redherring.hitbox.com +0.0.0.0 ehg-register.hitbox.com +0.0.0.0 ehg-researchinmotion.hitbox.com +0.0.0.0 ehg-rfa.hitbox.com +0.0.0.0 ehg-rodale.hitbox.com +0.0.0.0 ehg-salesforce.hitbox.com +0.0.0.0 ehg-salonmedia.hitbox.com +0.0.0.0 ehg-samsungusa.hitbox.com +0.0.0.0 ehg-seca.hitbox.com +0.0.0.0 ehg-shoppersdrugmart.hitbox.com +0.0.0.0 ehg-sonybssc.hitbox.com +0.0.0.0 ehg-sonycomputer.hitbox.com +0.0.0.0 ehg-sonyelec.hitbox.com +0.0.0.0 ehg-sonymusic.hitbox.com +0.0.0.0 ehg-sonyny.hitbox.com +0.0.0.0 ehg-space.hitbox.com +0.0.0.0 ehg-sportsline.hitbox.com +0.0.0.0 ehg-streamload.hitbox.com +0.0.0.0 ehg-superpages.hitbox.com +0.0.0.0 ehg-techtarget.hitbox.com +0.0.0.0 ehg-tfl.hitbox.com +0.0.0.0 ehg-thefirstchurchchrist.hitbox.com +0.0.0.0 ehg-tigerdirect2.hitbox.com +0.0.0.0 ehg-tigerdirect.hitbox.com +0.0.0.0 ehg-topps.hitbox.com +0.0.0.0 ehg-tribute.hitbox.com +0.0.0.0 ehg-tumbleweed.hitbox.com +0.0.0.0 ehg-ubisoft.hitbox.com +0.0.0.0 ehg-uniontrib.hitbox.com +0.0.0.0 ehg-usnewsworldreport.hitbox.com +0.0.0.0 ehg-verizoncommunications.hitbox.com +0.0.0.0 ehg-viacom.hitbox.com +0.0.0.0 ehg-vmware.hitbox.com +0.0.0.0 ehg-vonage.hitbox.com +0.0.0.0 ehg-wachovia.hitbox.com +0.0.0.0 ehg-wacomtechnology.hitbox.com +0.0.0.0 ehg-warner-brothers.hitbox.com +0.0.0.0 ehg-wizardsofthecoast.hitbox.com.hitbox.com +0.0.0.0 ehg-womanswallstreet.hitbox.com +0.0.0.0 ehg-wss.hitbox.com +0.0.0.0 ehg-xxolympicwintergames.hitbox.com +0.0.0.0 ehg-yellowpages.hitbox.com +0.0.0.0 ehg-youtube.hitbox.com +0.0.0.0 ejs.hitbox.com +0.0.0.0 enterprise-admin.hitbox.com +0.0.0.0 enterprise.hitbox.com +0.0.0.0 esg.hitbox.com +0.0.0.0 evwr.hitbox.com +0.0.0.0 get.hitbox.com +0.0.0.0 hg10.hitbox.com +0.0.0.0 hg11.hitbox.com +0.0.0.0 hg12.hitbox.com +0.0.0.0 hg13.hitbox.com +0.0.0.0 hg14.hitbox.com +0.0.0.0 hg15.hitbox.com +0.0.0.0 hg16.hitbox.com +0.0.0.0 hg17.hitbox.com +0.0.0.0 hg1.hitbox.com +0.0.0.0 hg2.hitbox.com +0.0.0.0 hg3.hitbox.com +0.0.0.0 hg4.hitbox.com +0.0.0.0 hg5.hitbox.com +0.0.0.0 hg6a.hitbox.com +0.0.0.0 hg6.hitbox.com +0.0.0.0 hg7.hitbox.com +0.0.0.0 hg8.hitbox.com +0.0.0.0 hg9.hitbox.com +0.0.0.0 hitboxbenchmarker.com +0.0.0.0 hitboxcentral.com +0.0.0.0 hitbox.com +0.0.0.0 hitboxenterprise.com +0.0.0.0 hitboxwireless.com +0.0.0.0 host6.hitbox.com +0.0.0.0 ias2.hitbox.com +0.0.0.0 ias.hitbox.com +0.0.0.0 ibg.hitbox.com +0.0.0.0 ics.hitbox.com +0.0.0.0 idb.hitbox.com +0.0.0.0 js1.hitbox.com +0.0.0.0 lb.hitbox.com +0.0.0.0 lesbian-erotica.hitbox.com +0.0.0.0 lookup2.hitbox.com +0.0.0.0 lookup.hitbox.com +0.0.0.0 mrtg.hitbox.com +0.0.0.0 myhitbox.com +0.0.0.0 na.hitbox.com +0.0.0.0 narwhal.hitbox.com +0.0.0.0 nei.hitbox.com +0.0.0.0 nocboard.hitbox.com +0.0.0.0 noc.hitbox.com +0.0.0.0 noc-request.hitbox.com +0.0.0.0 ns1.hitbox.com +0.0.0.0 oas.hitbox.com +0.0.0.0 phg.hitbox.com +0.0.0.0 pure.hitbox.com +0.0.0.0 rainbowclub.hitbox.com +0.0.0.0 rd1.hitbox.com +0.0.0.0 reseller.hitbox.com +0.0.0.0 resources.hitbox.com +0.0.0.0 sitesearch.hitbox.com +0.0.0.0 specialtyclub.hitbox.com +0.0.0.0 ss.hitbox.com +0.0.0.0 stage101.hitbox.com +0.0.0.0 stage102.hitbox.com +0.0.0.0 stage103.hitbox.com +0.0.0.0 stage104.hitbox.com +0.0.0.0 stage105.hitbox.com +0.0.0.0 stage.hitbox.com +0.0.0.0 stats2.hitbox.com +0.0.0.0 stats3.hitbox.com +0.0.0.0 stats.hitbox.com +0.0.0.0 switch10.hitbox.com +0.0.0.0 switch11.hitbox.com +0.0.0.0 switch1.hitbox.com +0.0.0.0 switch5.hitbox.com +0.0.0.0 switch6.hitbox.com +0.0.0.0 switch8.hitbox.com +0.0.0.0 switch9.hitbox.com +0.0.0.0 switch.hitbox.com +0.0.0.0 tetra.hitbox.com +0.0.0.0 tools2.hitbox.com +0.0.0.0 toolsa.hitbox.com +0.0.0.0 tools.hitbox.com +0.0.0.0 ts1.hitbox.com +0.0.0.0 ts2.hitbox.com +0.0.0.0 vwr1.hitbox.com +0.0.0.0 vwr2.hitbox.com +0.0.0.0 vwr3.hitbox.com +0.0.0.0 w100.hitbox.com +0.0.0.0 w101.hitbox.com +0.0.0.0 w102.hitbox.com +0.0.0.0 w103.hitbox.com +0.0.0.0 w104.hitbox.com +0.0.0.0 w105.hitbox.com +0.0.0.0 w106.hitbox.com +0.0.0.0 w107.hitbox.com +0.0.0.0 w108.hitbox.com +0.0.0.0 w109.hitbox.com +0.0.0.0 w10.hitbox.com +0.0.0.0 w110.hitbox.com +0.0.0.0 w111.hitbox.com +0.0.0.0 w112.hitbox.com +0.0.0.0 w113.hitbox.com +0.0.0.0 w114.hitbox.com +0.0.0.0 w115.hitbox.com +0.0.0.0 w116.hitbox.com +0.0.0.0 w117.hitbox.com +0.0.0.0 w118.hitbox.com +0.0.0.0 w119.hitbox.com +0.0.0.0 w11.hitbox.com +0.0.0.0 w120.hitbox.com +0.0.0.0 w121.hitbox.com +0.0.0.0 w122.hitbox.com +0.0.0.0 w123.hitbox.com +0.0.0.0 w124.hitbox.com +0.0.0.0 w126.hitbox.com +0.0.0.0 w128.hitbox.com +0.0.0.0 w129.hitbox.com +0.0.0.0 w12.hitbox.com +0.0.0.0 w130.hitbox.com +0.0.0.0 w131.hitbox.com +0.0.0.0 w132.hitbox.com +0.0.0.0 w133.hitbox.com +0.0.0.0 w135.hitbox.com +0.0.0.0 w136.hitbox.com +0.0.0.0 w137.hitbox.com +0.0.0.0 w138.hitbox.com +0.0.0.0 w139.hitbox.com +0.0.0.0 w13.hitbox.com +0.0.0.0 w140.hitbox.com +0.0.0.0 w141.hitbox.com +0.0.0.0 w144.hitbox.com +0.0.0.0 w147.hitbox.com +0.0.0.0 w14.hitbox.com +0.0.0.0 w153.hitbox.com +0.0.0.0 w154.hitbox.com +0.0.0.0 w155.hitbox.com +0.0.0.0 w157.hitbox.com +0.0.0.0 w159.hitbox.com +0.0.0.0 w15.hitbox.com +0.0.0.0 w161.hitbox.com +0.0.0.0 w162.hitbox.com +0.0.0.0 w167.hitbox.com +0.0.0.0 w168.hitbox.com +0.0.0.0 w16.hitbox.com +0.0.0.0 w170.hitbox.com +0.0.0.0 w175.hitbox.com +0.0.0.0 w177.hitbox.com +0.0.0.0 w179.hitbox.com +0.0.0.0 w17.hitbox.com +0.0.0.0 w18.hitbox.com +0.0.0.0 w19.hitbox.com +0.0.0.0 w1.hitbox.com +0.0.0.0 w20.hitbox.com +0.0.0.0 w21.hitbox.com +0.0.0.0 w22.hitbox.com +0.0.0.0 w23.hitbox.com +0.0.0.0 w24.hitbox.com +0.0.0.0 w25.hitbox.com +0.0.0.0 w26.hitbox.com +0.0.0.0 w27.hitbox.com +0.0.0.0 w28.hitbox.com +0.0.0.0 w29.hitbox.com +0.0.0.0 w2.hitbox.com +0.0.0.0 w30.hitbox.com +0.0.0.0 w31.hitbox.com +0.0.0.0 w32.hitbox.com +0.0.0.0 w33.hitbox.com +0.0.0.0 w34.hitbox.com +0.0.0.0 w35.hitbox.com +0.0.0.0 w36.hitbox.com +0.0.0.0 w3.hitbox.com +0.0.0.0 w4.hitbox.com +0.0.0.0 w5.hitbox.com +0.0.0.0 w6.hitbox.com +0.0.0.0 w7.hitbox.com +0.0.0.0 w8.hitbox.com +0.0.0.0 w9.hitbox.com +0.0.0.0 webload101.hitbox.com +0.0.0.0 wss-gw-1.hitbox.com +0.0.0.0 wss-gw-3.hitbox.com +0.0.0.0 wvwr1.hitbox.com +0.0.0.0 ww1.hitbox.com +0.0.0.0 ww2.hitbox.com +0.0.0.0 ww3.hitbox.com +0.0.0.0 wwa.hitbox.com +0.0.0.0 wwb.hitbox.com +0.0.0.0 wwc.hitbox.com +0.0.0.0 wwd.hitbox.com +0.0.0.0 www.ehg-rr.hitbox.com +0.0.0.0 www.hitbox.com +0.0.0.0 www.hitboxwireless.com +0.0.0.0 y2k.hitbox.com +0.0.0.0 yang.hitbox.com +0.0.0.0 ying.hitbox.com +# + +# + +# www.extreme-dm.com tracking +0.0.0.0 extreme-dm.com +0.0.0.0 reports.extreme-dm.com +0.0.0.0 t0.extreme-dm.com +0.0.0.0 t1.extreme-dm.com +0.0.0.0 t.extreme-dm.com +0.0.0.0 u0.extreme-dm.com +0.0.0.0 u1.extreme-dm.com +0.0.0.0 u.extreme-dm.com +0.0.0.0 v0.extreme-dm.com +0.0.0.0 v1.extreme-dm.com +0.0.0.0 v.extreme-dm.com +0.0.0.0 w0.extreme-dm.com +0.0.0.0 w1.extreme-dm.com +0.0.0.0 w2.extreme-dm.com +0.0.0.0 w3.extreme-dm.com +0.0.0.0 w4.extreme-dm.com +0.0.0.0 w5.extreme-dm.com +0.0.0.0 w6.extreme-dm.com +0.0.0.0 w7.extreme-dm.com +0.0.0.0 w8.extreme-dm.com +0.0.0.0 w9.extreme-dm.com +0.0.0.0 w.extreme-dm.com +0.0.0.0 www.extreme-dm.com +0.0.0.0 x3.extreme-dm.com +0.0.0.0 y0.extreme-dm.com +0.0.0.0 y1.extreme-dm.com +0.0.0.0 y.extreme-dm.com +0.0.0.0 z0.extreme-dm.com +0.0.0.0 z1.extreme-dm.com +0.0.0.0 z.extreme-dm.com +# + +# + +# realmedia.com's Open Ad Stream +0.0.0.0 ap.oasfile.aftenposten.no +0.0.0.0 imagenen1.247realmedia.com +0.0.0.0 oacentral.cepro.com +0.0.0.0 oas.adx.nu +0.0.0.0 oas.aurasports.com +0.0.0.0 oas.benchmark.fr +0.0.0.0 oasc03012.247realmedia.com +0.0.0.0 oasc03049.247realmedia.com +0.0.0.0 oasc06006.247realmedia.com +0.0.0.0 oasc08008.247realmedia.com +0.0.0.0 oasc09.247realmedia.com +0.0.0.0 oascentral.123greetings.com +0.0.0.0 oascentral.abclocal.go.com +0.0.0.0 oascentral.adage.com +0.0.0.0 oascentral.adageglobal.com +0.0.0.0 oascentral.aircanada.com +0.0.0.0 oascentral.alanicnewsnet.ca +0.0.0.0 oascentral.alanticnewsnet.ca +0.0.0.0 oascentral.americanheritage.com +0.0.0.0 oascentral.artistdirect.com +0.0.0.0 oascentral.artistirect.com +0.0.0.0 oascentral.askmen.com +0.0.0.0 oascentral.aviationnow.com +0.0.0.0 oascentral.blackenterprises.com +0.0.0.0 oascentral.blogher.org +0.0.0.0 oascentral.bostonherald.com +0.0.0.0 oascentral.bostonphoenix.com +0.0.0.0 oascentral.businessinsider.com +0.0.0.0 oascentral.businessweek.com +0.0.0.0 oascentral.businessweeks.com +0.0.0.0 oascentral.buy.com +0.0.0.0 oascentral.canadaeast.com +0.0.0.0 oascentral.canadianliving.com +0.0.0.0 oascentral.charleston.net +0.0.0.0 oascentral.chicagobusiness.com +0.0.0.0 oascentral.chron.com +0.0.0.0 oascentral.citypages.com +0.0.0.0 oascentral.clearchannel.com +0.0.0.0 oascentral.comcast.net +0.0.0.0 oascentral.comics.com +0.0.0.0 oascentral.construction.com +0.0.0.0 oascentral.consumerreports.org +0.0.0.0 oascentral.covers.com +0.0.0.0 oascentral.crainsdetroit.com +0.0.0.0 oascentral.crimelibrary.com +0.0.0.0 oascentral.cybereps.com +0.0.0.0 oascentral.dailybreeze.com +0.0.0.0 oascentral.dailyherald.com +0.0.0.0 oascentral.dilbert.com +0.0.0.0 oascentral.discovery.com +0.0.0.0 oascentral.drphil.com +0.0.0.0 oascentral.eastbayexpress.com +0.0.0.0 oas-central.east.realmedia.com +0.0.0.0 oascentral.encyclopedia.com +0.0.0.0 oascentral.fashionmagazine.com +0.0.0.0 oascentral.fayettevillenc.com +0.0.0.0 oascentral.feedroom.com +0.0.0.0 oascentral.forsythnews.com +0.0.0.0 oascentral.fortunecity.com +0.0.0.0 oascentral.foxnews.com +0.0.0.0 oascentral.freedom.com +0.0.0.0 oascentral.g4techtv.com +0.0.0.0 oascentral.ggl.com +0.0.0.0 oascentral.gigex.com +0.0.0.0 oascentral.globalpost.com +0.0.0.0 oascentral.hamptonroads.com +0.0.0.0 oascentral.hamptoroads.com +0.0.0.0 oascentral.hamtoroads.com +0.0.0.0 oascentral.herenb.com +0.0.0.0 oascentral.hollywood.com +0.0.0.0 oascentral.houstonpress.com +0.0.0.0 oascentral.inq7.net +0.0.0.0 oascentral.investors.com +0.0.0.0 oascentral.investorwords.com +0.0.0.0 oascentral.itbusiness.ca +0.0.0.0 oascentral.killsometime.com +0.0.0.0 oascentral.laptopmag.com +0.0.0.0 oascentral.law.com +0.0.0.0 oascentral.laweekly.com +0.0.0.0 oascentral.looksmart.com +0.0.0.0 oascentral.lycos.com +0.0.0.0 oascentral.mailtribune.com +0.0.0.0 oascentral.mayoclinic.com +0.0.0.0 oascentral.medbroadcast.com +0.0.0.0 oascentral.metro.us +0.0.0.0 oascentral.minnpost.com +0.0.0.0 oascentral.mochila.com +0.0.0.0 oascentral.motherjones.com +0.0.0.0 oascentral.nerve.com +0.0.0.0 oascentral.newsmax.com +0.0.0.0 oascentral.nowtoronto.com +0.0.0.0 oascentralnx.comcast.net +0.0.0.0 oascentral.onwisconsin.com +0.0.0.0 oascentral.phoenixnewtimes.com +0.0.0.0 oascentral.phoenixvillenews.com +0.0.0.0 oascentral.pitch.com +0.0.0.0 oascentral.poconorecord.com +0.0.0.0 oascentral.politico.com +0.0.0.0 oascentral.post-gazette.com +0.0.0.0 oascentral.pottsmerc.com +0.0.0.0 oascentral.princetonreview.com +0.0.0.0 oascentral.publicradio.org +0.0.0.0 oascentral.radaronline.com +0.0.0.0 oascentral.rcrnews.com +0.0.0.0 oas-central.realmedia.com +0.0.0.0 oascentral.redherring.com +0.0.0.0 oascentral.redorbit.com +0.0.0.0 oascentral.redstate.com +0.0.0.0 oascentral.reference.com +0.0.0.0 oascentral.regalinterative.com +0.0.0.0 oascentral.register.com +0.0.0.0 oascentral.registerguard.com +0.0.0.0 oascentral.registguard.com +0.0.0.0 oascentral.riverfronttimes.com +0.0.0.0 oascentral.salon.com +0.0.0.0 oascentral.santacruzsentinel.com +0.0.0.0 oascentral.sciam.com +0.0.0.0 oascentral.scientificamerican.com +0.0.0.0 oascentral.seacoastonline.com +0.0.0.0 oascentral.seattleweekly.com +0.0.0.0 oascentral.sfgate.com +0.0.0.0 oascentral.sfweekly.com +0.0.0.0 oascentral.sina.com +0.0.0.0 oascentral.sina.com.hk +0.0.0.0 oascentral.sparknotes.com +0.0.0.0 oascentral.sptimes.com +0.0.0.0 oascentral.starbulletin.com +0.0.0.0 oascentral.suntimes.com +0.0.0.0 oascentral.surfline.com +0.0.0.0 oascentral.thechronicleherald.ca +0.0.0.0 oascentral.thehockeynews.com +0.0.0.0 oascentral.thenation.com +0.0.0.0 oascentral.theonionavclub.com +0.0.0.0 oascentral.theonion.com +0.0.0.0 oascentral.thephoenix.com +0.0.0.0 oascentral.thesmokinggun.com +0.0.0.0 oascentral.thespark.com +0.0.0.0 oascentral.tmcnet.com +0.0.0.0 oascentral.tnr.com +0.0.0.0 oascentral.tourismvancouver.com +0.0.0.0 oascentral.townhall.com +0.0.0.0 oascentral.tribe.net +0.0.0.0 oascentral.trutv.com +0.0.0.0 oascentral.upi.com +0.0.0.0 oascentral.urbanspoon.com +0.0.0.0 oascentral.villagevoice.com +0.0.0.0 oascentral.virtualtourist.com +0.0.0.0 oascentral.warcry.com +0.0.0.0 oascentral.washtimes.com +0.0.0.0 oascentral.wciv.com +0.0.0.0 oascentral.westword.com +0.0.0.0 oascentral.where.ca +0.0.0.0 oascentral.wjla.com +0.0.0.0 oascentral.wkrn.com +0.0.0.0 oascentral.wwe.com +0.0.0.0 oascentral.yellowpages.com +0.0.0.0 oascentral.ywlloewpages.ca +0.0.0.0 oascentral.zwire.com +0.0.0.0 oascentreal.adcritic.com +0.0.0.0 oascetral.laweekly.com +0.0.0.0 oas.dispatch.com +0.0.0.0 oas.foxnews.com +0.0.0.0 oas.greensboro.com +0.0.0.0 oas.guardian.co.uk +0.0.0.0 oas.ibnlive.com +0.0.0.0 oas.lee.net +0.0.0.0 oas.nrjlink.fr +0.0.0.0 oas.nzz.ch +0.0.0.0 oas.portland.com +0.0.0.0 oas.publicitas.ch +0.0.0.0 oasroanoke.com +0.0.0.0 oas.salon.com +0.0.0.0 oas.sciencemag.org +0.0.0.0 oas.signonsandiego.com +0.0.0.0 oas.startribune.com +0.0.0.0 oas.toronto.com +0.0.0.0 oas.uniontrib.com +0.0.0.0 oas.villagevoice.com +0.0.0.0 oas.vtsgonline.com +# + +# + +# fastclick banner ads +0.0.0.0 media1.fastclick.net +0.0.0.0 media2.fastclick.net +0.0.0.0 media3.fastclick.net +0.0.0.0 media4.fastclick.net +0.0.0.0 media5.fastclick.net +0.0.0.0 media6.fastclick.net +0.0.0.0 media7.fastclick.net +0.0.0.0 media8.fastclick.net +0.0.0.0 media9.fastclick.net +0.0.0.0 media10.fastclick.net +0.0.0.0 media11.fastclick.net +0.0.0.0 media12.fastclick.net +0.0.0.0 media13.fastclick.net +0.0.0.0 media14.fastclick.net +0.0.0.0 media15.fastclick.net +0.0.0.0 media16.fastclick.net +0.0.0.0 media17.fastclick.net +0.0.0.0 media18.fastclick.net +0.0.0.0 media19.fastclick.net +0.0.0.0 media20.fastclick.net +0.0.0.0 media21.fastclick.net +0.0.0.0 media22.fastclick.net +0.0.0.0 media23.fastclick.net +0.0.0.0 media24.fastclick.net +0.0.0.0 media25.fastclick.net +0.0.0.0 media26.fastclick.net +0.0.0.0 media27.fastclick.net +0.0.0.0 media28.fastclick.net +0.0.0.0 media29.fastclick.net +0.0.0.0 media30.fastclick.net +0.0.0.0 media31.fastclick.net +0.0.0.0 media32.fastclick.net +0.0.0.0 media33.fastclick.net +0.0.0.0 media34.fastclick.net +0.0.0.0 media35.fastclick.net +0.0.0.0 media36.fastclick.net +0.0.0.0 media37.fastclick.net +0.0.0.0 media38.fastclick.net +0.0.0.0 media39.fastclick.net +0.0.0.0 media40.fastclick.net +0.0.0.0 media41.fastclick.net +0.0.0.0 media42.fastclick.net +0.0.0.0 media43.fastclick.net +0.0.0.0 media44.fastclick.net +0.0.0.0 media45.fastclick.net +0.0.0.0 media46.fastclick.net +0.0.0.0 media47.fastclick.net +0.0.0.0 media48.fastclick.net +0.0.0.0 media49.fastclick.net +0.0.0.0 media50.fastclick.net +0.0.0.0 media51.fastclick.net +0.0.0.0 media52.fastclick.net +0.0.0.0 media53.fastclick.net +0.0.0.0 media54.fastclick.net +0.0.0.0 media55.fastclick.net +0.0.0.0 media56.fastclick.net +0.0.0.0 media57.fastclick.net +0.0.0.0 media58.fastclick.net +0.0.0.0 media59.fastclick.net +0.0.0.0 media60.fastclick.net +0.0.0.0 media61.fastclick.net +0.0.0.0 media62.fastclick.net +0.0.0.0 media63.fastclick.net +0.0.0.0 media64.fastclick.net +0.0.0.0 media65.fastclick.net +0.0.0.0 media66.fastclick.net +0.0.0.0 media67.fastclick.net +0.0.0.0 media68.fastclick.net +0.0.0.0 media69.fastclick.net +0.0.0.0 media70.fastclick.net +0.0.0.0 media71.fastclick.net +0.0.0.0 media72.fastclick.net +0.0.0.0 media73.fastclick.net +0.0.0.0 media74.fastclick.net +0.0.0.0 media75.fastclick.net +0.0.0.0 media76.fastclick.net +0.0.0.0 media77.fastclick.net +0.0.0.0 media78.fastclick.net +0.0.0.0 media79.fastclick.net +0.0.0.0 media80.fastclick.net +0.0.0.0 media81.fastclick.net +0.0.0.0 media82.fastclick.net +0.0.0.0 media83.fastclick.net +0.0.0.0 media84.fastclick.net +0.0.0.0 media85.fastclick.net +0.0.0.0 media86.fastclick.net +0.0.0.0 media87.fastclick.net +0.0.0.0 media88.fastclick.net +0.0.0.0 media89.fastclick.net +0.0.0.0 media90.fastclick.net +0.0.0.0 media91.fastclick.net +0.0.0.0 media92.fastclick.net +0.0.0.0 media93.fastclick.net +0.0.0.0 media94.fastclick.net +0.0.0.0 media95.fastclick.net +0.0.0.0 media96.fastclick.net +0.0.0.0 media97.fastclick.net +0.0.0.0 media98.fastclick.net +0.0.0.0 media99.fastclick.net +0.0.0.0 fastclick.net +# + +# + +# belo interactive ads +0.0.0.0 te.about.com +0.0.0.0 te.adlandpro.com +0.0.0.0 te.advance.net +0.0.0.0 te.ap.org +0.0.0.0 te.astrology.com +0.0.0.0 te.audiencematch.net +0.0.0.0 te.belointeractive.com +0.0.0.0 te.boston.com +0.0.0.0 te.businessweek.com +0.0.0.0 te.chicagotribune.com +0.0.0.0 te.chron.com +0.0.0.0 te.cleveland.net +0.0.0.0 te.ctnow.com +0.0.0.0 te.dailycamera.com +0.0.0.0 te.dailypress.com +0.0.0.0 te.dentonrc.com +0.0.0.0 te.greenwichtime.com +0.0.0.0 te.idg.com +0.0.0.0 te.infoworld.com +0.0.0.0 te.ivillage.com +0.0.0.0 te.journalnow.com +0.0.0.0 te.latimes.com +0.0.0.0 te.mcall.com +0.0.0.0 te.mgnetwork.com +0.0.0.0 te.mysanantonio.com +0.0.0.0 te.newsday.com +0.0.0.0 te.nytdigital.com +0.0.0.0 te.orlandosentinel.com +0.0.0.0 te.scripps.com +0.0.0.0 te.scrippsnetworksprivacy.com +0.0.0.0 te.scrippsnewspapersprivacy.com +0.0.0.0 te.sfgate.com +0.0.0.0 te.signonsandiego.com +0.0.0.0 te.stamfordadvocate.com +0.0.0.0 te.sun-sentinel.com +0.0.0.0 te.sunspot.net +0.0.0.0 te.suntimes.com +0.0.0.0 te.tbo.com +0.0.0.0 te.thestar.ca +0.0.0.0 te.thestar.com +0.0.0.0 te.trb.com +0.0.0.0 te.versiontracker.com +0.0.0.0 te.wsls.com +# + +# + +# popup traps -- sites that bounce you around or won't let you leave +0.0.0.0 24hwebsex.com +0.0.0.0 adultfriendfinder.com +0.0.0.0 all-tgp.org +0.0.0.0 fioe.info +0.0.0.0 incestland.com +0.0.0.0 lesview.com +0.0.0.0 searchforit.com +0.0.0.0 www.asiansforu.com +0.0.0.0 www.bangbuddy.com +0.0.0.0 www.datanotary.com +0.0.0.0 www.entercasino.com +0.0.0.0 www.incestdot.com +0.0.0.0 www.incestgold.com +0.0.0.0 www.justhookup.com +0.0.0.0 www.mangayhentai.com +0.0.0.0 www.myluvcrush.ca +0.0.0.0 www.ourfuckbook.com +0.0.0.0 www.realincestvideos.com +0.0.0.0 www.searchforit.com +0.0.0.0 www.searchv.com +0.0.0.0 www.secretosx.com +0.0.0.0 www.seductiveamateurs.com +0.0.0.0 www.smsmovies.net +0.0.0.0 www.wowjs.1www.cn +0.0.0.0 www.xxxnations.com +0.0.0.0 www.xxxnightly.com +0.0.0.0 www.xxxtoolbar.com +0.0.0.0 www.yourfuckbook.com +# + +# + +# malicious e-card -- these sites send out mass quantities of spam + # and some distribute adware and spyware +0.0.0.0 123greetings.com # contains one link to distributor of adware or spyware +0.0.0.0 2000greetings.com +0.0.0.0 celebwelove.com +0.0.0.0 ecard4all.com +0.0.0.0 eforu.com +0.0.0.0 freewebcards.com +0.0.0.0 fukkad.com +0.0.0.0 fun-e-cards.com +0.0.0.0 funnyreign.com # heavy spam (Site Advisor received 1075 e-mails/week) +0.0.0.0 funsilly.com +0.0.0.0 myfuncards.com +0.0.0.0 www.cool-downloads.com +0.0.0.0 www.cool-downloads.net +0.0.0.0 www.friend-card.com +0.0.0.0 www.friend-cards.com +0.0.0.0 www.friend-cards.net +0.0.0.0 www.friend-greeting.com +0.0.0.0 www.friend-greetings.com +0.0.0.0 www.friendgreetings.com +0.0.0.0 www.friend-greetings.net +0.0.0.0 www.friendgreetings.net +0.0.0.0 www.laugh-mail.com +0.0.0.0 www.laugh-mail.net +# + +# + +# European network of tracking sites +0.0.0.0 0ivwbox.de +0.0.0.0 1ivwbox.de +0.0.0.0 1und1.ivwbox.de +0.0.0.0 2ivwbox.de +0.0.0.0 3ivwbox.de +0.0.0.0 4ivwbox.de +0.0.0.0 5ivwbox.de +0.0.0.0 6ivwbox.de +0.0.0.0 7ivwbox.de +0.0.0.0 8ivwbox.de +0.0.0.0 8vwbox.de +0.0.0.0 9ivwbox.de +0.0.0.0 9vwbox.de +0.0.0.0 aivwbox.de +0.0.0.0 avwbox.de +0.0.0.0 bild.ivwbox.de +0.0.0.0 bivwbox.de +0.0.0.0 civwbox.de +0.0.0.0 divwbox.de +0.0.0.0 eevwbox.de +0.0.0.0 eivwbox.de +0.0.0.0 evwbox.de +0.0.0.0 faz.ivwbox.de +0.0.0.0 fivwbox.de +0.0.0.0 givwbox.de +0.0.0.0 hivwbox.de +0.0.0.0 i8vwbox.de +0.0.0.0 i9vwbox.de +0.0.0.0 iavwbox.de +0.0.0.0 ibvwbox.de +0.0.0.0 ibwbox.de +0.0.0.0 icvwbox.de +0.0.0.0 icwbox.de +0.0.0.0 ievwbox.de +0.0.0.0 ifvwbox.de +0.0.0.0 ifwbox.de +0.0.0.0 igvwbox.de +0.0.0.0 igwbox.de +0.0.0.0 iivwbox.de +0.0.0.0 ijvwbox.de +0.0.0.0 ikvwbox.de +0.0.0.0 iovwbox.de +0.0.0.0 iuvwbox.de +0.0.0.0 iv2box.de +0.0.0.0 iv2wbox.de +0.0.0.0 iv3box.de +0.0.0.0 iv3wbox.de +0.0.0.0 ivabox.de +0.0.0.0 ivawbox.de +0.0.0.0 ivbox.de +0.0.0.0 ivbwbox.de +0.0.0.0 ivbwox.de +0.0.0.0 ivcwbox.de +0.0.0.0 ivebox.de +0.0.0.0 ivewbox.de +0.0.0.0 ivfwbox.de +0.0.0.0 ivgwbox.de +0.0.0.0 ivqbox.de +0.0.0.0 ivqwbox.de +0.0.0.0 ivsbox.de +0.0.0.0 ivswbox.de +0.0.0.0 ivvbox.de +0.0.0.0 ivvwbox.de +0.0.0.0 ivw2box.de +0.0.0.0 ivw3box.de +0.0.0.0 ivwabox.de +0.0.0.0 ivwb0ox.de +0.0.0.0 ivwb0x.de +0.0.0.0 ivwb9ox.de +0.0.0.0 ivwb9x.de +0.0.0.0 ivwbaox.de +0.0.0.0 ivwbax.de +0.0.0.0 ivwbbox.de +0.0.0.0 ivwbeox.de +0.0.0.0 ivwbex.de +0.0.0.0 ivwbgox.de +0.0.0.0 ivwbhox.de +0.0.0.0 ivwbiox.de +0.0.0.0 ivwbix.de +0.0.0.0 ivwbkox.de +0.0.0.0 ivwbkx.de +0.0.0.0 ivwblox.de +0.0.0.0 ivwblx.de +0.0.0.0 ivwbnox.de +0.0.0.0 ivwbo0x.de +0.0.0.0 ivwbo9x.de +0.0.0.0 ivwboax.de +0.0.0.0 ivwboc.de +0.0.0.0 ivwbock.de +0.0.0.0 ivwbocx.de +0.0.0.0 ivwbod.de +0.0.0.0 ivwbo.de +0.0.0.0 ivwbodx.de +0.0.0.0 ivwboex.de +0.0.0.0 ivwboix.de +0.0.0.0 ivwboks.de +0.0.0.0 ivwbokx.de +0.0.0.0 ivwbolx.de +0.0.0.0 ivwboox.de +0.0.0.0 ivwbopx.de +0.0.0.0 ivwbos.de +0.0.0.0 ivwbosx.de +0.0.0.0 ivwboux.de +0.0.0.0 ivwbox0.de +0.0.0.0 ivwbox1.de +0.0.0.0 ivwbox2.de +0.0.0.0 ivwbox3.de +0.0.0.0 ivwbox4.de +0.0.0.0 ivwbox5.de +0.0.0.0 ivwbox6.de +0.0.0.0 ivwbox7.de +0.0.0.0 ivwbox8.de +0.0.0.0 ivwbox9.de +0.0.0.0 ivwboxa.de +0.0.0.0 ivwboxb.de +0.0.0.0 ivwboxc.de +0.0.0.0 ivwboxd.de +0.0.0.0 ivwbox.de +0.0.0.0 ivwboxe.de +0.0.0.0 ivwboxes.de +0.0.0.0 ivwboxf.de +0.0.0.0 ivwboxg.de +0.0.0.0 ivwboxh.de +0.0.0.0 ivwboxi.de +0.0.0.0 ivwboxj.de +0.0.0.0 ivwboxk.de +0.0.0.0 ivwboxl.de +0.0.0.0 ivwboxm.de +0.0.0.0 ivwboxn.de +0.0.0.0 ivwboxo.de +0.0.0.0 ivwboxp.de +0.0.0.0 ivwboxq.de +0.0.0.0 ivwboxr.de +0.0.0.0 ivwboxs.de +0.0.0.0 ivwboxt.de +0.0.0.0 ivwboxu.de +0.0.0.0 ivwboxv.de +0.0.0.0 ivwboxw.de +0.0.0.0 ivwboxx.de +0.0.0.0 ivwboxy.de +0.0.0.0 ivwboxz.de +0.0.0.0 ivwboyx.de +0.0.0.0 ivwboz.de +0.0.0.0 ivwbozx.de +0.0.0.0 ivwbpox.de +0.0.0.0 ivwbpx.de +0.0.0.0 ivwbuox.de +0.0.0.0 ivwbux.de +0.0.0.0 ivwbvox.de +0.0.0.0 ivwbx.de +0.0.0.0 ivwbxo.de +0.0.0.0 ivwbyox.de +0.0.0.0 ivwbyx.de +0.0.0.0 ivwebox.de +0.0.0.0 ivwgbox.de +0.0.0.0 ivwgox.de +0.0.0.0 ivwhbox.de +0.0.0.0 ivwhox.de +0.0.0.0 ivwnbox.de +0.0.0.0 ivwnox.de +0.0.0.0 ivwobx.de +0.0.0.0 ivwox.de +0.0.0.0 ivwpbox.de +0.0.0.0 ivwpox.de +0.0.0.0 ivwqbox.de +0.0.0.0 ivwsbox.de +0.0.0.0 ivwvbox.de +0.0.0.0 ivwvox.de +0.0.0.0 ivwwbox.de +0.0.0.0 iwbox.de +0.0.0.0 iwvbox.de +0.0.0.0 iwvwbox.de +0.0.0.0 iwwbox.de +0.0.0.0 iyvwbox.de +0.0.0.0 jivwbox.de +0.0.0.0 jvwbox.de +0.0.0.0 kicker.ivwbox.de +0.0.0.0 kivwbox.de +0.0.0.0 kvwbox.de +0.0.0.0 livwbox.de +0.0.0.0 mivwbox.de +0.0.0.0 netzmarkt.ivwbox.de +0.0.0.0 nivwbox.de +0.0.0.0 ntv.ivwbox.de +0.0.0.0 oivwbox.de +0.0.0.0 onvis.ivwbox.de +0.0.0.0 ovwbox.de +0.0.0.0 pivwbox.de +0.0.0.0 qivwbox.de +0.0.0.0 rivwbox.de +0.0.0.0 sivwbox.de +0.0.0.0 spiegel.ivwbox.de +0.0.0.0 tivwbox.de +0.0.0.0 uivwbox.de +0.0.0.0 uvwbox.de +0.0.0.0 vivwbox.de +0.0.0.0 viwbox.de +0.0.0.0 vwbox.de +0.0.0.0 wivwbox.de +0.0.0.0 wwivwbox.de +0.0.0.0 www.0ivwbox.de +0.0.0.0 www.1ivwbox.de +0.0.0.0 www.2ivwbox.de +0.0.0.0 www.3ivwbox.de +0.0.0.0 www.4ivwbox.de +0.0.0.0 www.5ivwbox.de +0.0.0.0 www.6ivwbox.de +0.0.0.0 www.7ivwbox.de +0.0.0.0 www.8ivwbox.de +0.0.0.0 www.8vwbox.de +0.0.0.0 www.9ivwbox.de +0.0.0.0 www.9vwbox.de +0.0.0.0 www.aivwbox.de +0.0.0.0 www.avwbox.de +0.0.0.0 www.bivwbox.de +0.0.0.0 www.civwbox.de +0.0.0.0 www.divwbox.de +0.0.0.0 www.eevwbox.de +0.0.0.0 www.eivwbox.de +0.0.0.0 www.evwbox.de +0.0.0.0 www.fivwbox.de +0.0.0.0 www.givwbox.de +0.0.0.0 www.hivwbox.de +0.0.0.0 www.i8vwbox.de +0.0.0.0 www.i9vwbox.de +0.0.0.0 www.iavwbox.de +0.0.0.0 www.ibvwbox.de +0.0.0.0 www.ibwbox.de +0.0.0.0 www.icvwbox.de +0.0.0.0 www.icwbox.de +0.0.0.0 www.ievwbox.de +0.0.0.0 www.ifvwbox.de +0.0.0.0 www.ifwbox.de +0.0.0.0 www.igvwbox.de +0.0.0.0 www.igwbox.de +0.0.0.0 www.iivwbox.de +0.0.0.0 www.ijvwbox.de +0.0.0.0 www.ikvwbox.de +0.0.0.0 www.iovwbox.de +0.0.0.0 www.iuvwbox.de +0.0.0.0 www.iv2box.de +0.0.0.0 www.iv2wbox.de +0.0.0.0 www.iv3box.de +0.0.0.0 www.iv3wbox.de +0.0.0.0 www.ivabox.de +0.0.0.0 www.ivawbox.de +0.0.0.0 www.ivbox.de +0.0.0.0 www.ivbwbox.de +0.0.0.0 www.ivbwox.de +0.0.0.0 www.ivcwbox.de +0.0.0.0 www.ivebox.de +0.0.0.0 www.ivewbox.de +0.0.0.0 www.ivfwbox.de +0.0.0.0 www.ivgwbox.de +0.0.0.0 www.ivqbox.de +0.0.0.0 www.ivqwbox.de +0.0.0.0 www.ivsbox.de +0.0.0.0 www.ivswbox.de +0.0.0.0 www.ivvbox.de +0.0.0.0 www.ivvwbox.de +0.0.0.0 www.ivw2box.de +0.0.0.0 www.ivw3box.de +0.0.0.0 www.ivwabox.de +0.0.0.0 www.ivwb0ox.de +0.0.0.0 www.ivwb0x.de +0.0.0.0 www.ivwb9ox.de +0.0.0.0 www.ivwb9x.de +0.0.0.0 www.ivwbaox.de +0.0.0.0 www.ivwbax.de +0.0.0.0 www.ivwbbox.de +0.0.0.0 www.ivwbeox.de +0.0.0.0 www.ivwbex.de +0.0.0.0 www.ivwbgox.de +0.0.0.0 www.ivwbhox.de +0.0.0.0 www.ivwbiox.de +0.0.0.0 www.ivwbix.de +0.0.0.0 www.ivwbkox.de +0.0.0.0 www.ivwbkx.de +0.0.0.0 www.ivwblox.de +0.0.0.0 www.ivwblx.de +0.0.0.0 www.ivwbnox.de +0.0.0.0 www.ivwbo0x.de +0.0.0.0 www.ivwbo9x.de +0.0.0.0 www.ivwboax.de +0.0.0.0 www.ivwboc.de +0.0.0.0 www.ivwbock.de +0.0.0.0 www.ivwbocx.de +0.0.0.0 www.ivwbod.de +0.0.0.0 www.ivwbo.de +0.0.0.0 www.ivwbodx.de +0.0.0.0 www.ivwboex.de +0.0.0.0 www.ivwboix.de +0.0.0.0 www.ivwboks.de +0.0.0.0 www.ivwbokx.de +0.0.0.0 www.ivwbolx.de +0.0.0.0 www.ivwboox.de +0.0.0.0 www.ivwbopx.de +0.0.0.0 www.ivwbos.de +0.0.0.0 www.ivwbosx.de +0.0.0.0 www.ivwboux.de +0.0.0.0 www.ivwbox0.de +0.0.0.0 www.ivwbox1.de +0.0.0.0 www.ivwbox2.de +0.0.0.0 www.ivwbox3.de +0.0.0.0 www.ivwbox4.de +0.0.0.0 www.ivwbox5.de +0.0.0.0 www.ivwbox6.de +0.0.0.0 www.ivwbox7.de +0.0.0.0 www.ivwbox8.de +0.0.0.0 www.ivwbox9.de +0.0.0.0 www.ivwboxa.de +0.0.0.0 www.ivwboxb.de +0.0.0.0 www.ivwboxc.de +0.0.0.0 www.ivwboxd.de +0.0.0.0 www.ivwbox.de +0.0.0.0 wwwivwbox.de +0.0.0.0 www.ivwboxe.de +0.0.0.0 www.ivwboxes.de +0.0.0.0 www.ivwboxf.de +0.0.0.0 www.ivwboxg.de +0.0.0.0 www.ivwboxh.de +0.0.0.0 www.ivwboxi.de +0.0.0.0 www.ivwboxj.de +0.0.0.0 www.ivwboxk.de +0.0.0.0 www.ivwboxl.de +0.0.0.0 www.ivwboxm.de +0.0.0.0 www.ivwboxn.de +0.0.0.0 www.ivwboxo.de +0.0.0.0 www.ivwboxp.de +0.0.0.0 www.ivwboxq.de +0.0.0.0 www.ivwboxr.de +0.0.0.0 www.ivwboxs.de +0.0.0.0 www.ivwboxt.de +0.0.0.0 www.ivwboxu.de +0.0.0.0 www.ivwboxv.de +0.0.0.0 www.ivwboxw.de +0.0.0.0 www.ivwboxx.de +0.0.0.0 www.ivwboxy.de +0.0.0.0 www.ivwboxz.de +0.0.0.0 www.ivwboyx.de +0.0.0.0 www.ivwboz.de +0.0.0.0 www.ivwbozx.de +0.0.0.0 www.ivwbpox.de +0.0.0.0 www.ivwbpx.de +0.0.0.0 www.ivwbuox.de +0.0.0.0 www.ivwbux.de +0.0.0.0 www.ivwbvox.de +0.0.0.0 www.ivwbx.de +0.0.0.0 www.ivwbxo.de +0.0.0.0 www.ivwbyox.de +0.0.0.0 www.ivwbyx.de +0.0.0.0 www.ivwebox.de +0.0.0.0 www.ivwgbox.de +0.0.0.0 www.ivwgox.de +0.0.0.0 www.ivwhbox.de +0.0.0.0 www.ivwhox.de +0.0.0.0 www.ivwnbox.de +0.0.0.0 www.ivwnox.de +0.0.0.0 www.ivwobx.de +0.0.0.0 www.ivwox.de +0.0.0.0 www.ivwpbox.de +0.0.0.0 www.ivwpox.de +0.0.0.0 www.ivwqbox.de +0.0.0.0 www.ivwsbox.de +0.0.0.0 www.ivwvbox.de +0.0.0.0 www.ivwvox.de +0.0.0.0 www.ivwwbox.de +0.0.0.0 www.iwbox.de +0.0.0.0 www.iwvbox.de +0.0.0.0 www.iwvwbox.de +0.0.0.0 www.iwwbox.de +0.0.0.0 www.iyvwbox.de +0.0.0.0 www.jivwbox.de +0.0.0.0 www.jvwbox.de +0.0.0.0 www.kivwbox.de +0.0.0.0 www.kvwbox.de +0.0.0.0 www.livwbox.de +0.0.0.0 www.mivwbox.de +0.0.0.0 www.nivwbox.de +0.0.0.0 www.oivwbox.de +0.0.0.0 www.ovwbox.de +0.0.0.0 www.pivwbox.de +0.0.0.0 www.qivwbox.de +0.0.0.0 www.rivwbox.de +0.0.0.0 www.sivwbox.de +0.0.0.0 www.tivwbox.de +0.0.0.0 www.uivwbox.de +0.0.0.0 www.uvwbox.de +0.0.0.0 www.vivwbox.de +0.0.0.0 www.viwbox.de +0.0.0.0 www.vwbox.de +0.0.0.0 www.wivwbox.de +0.0.0.0 www.wwivwbox.de +0.0.0.0 www.wwwivwbox.de +0.0.0.0 www.xivwbox.de +0.0.0.0 www.yevwbox.de +0.0.0.0 www.yivwbox.de +0.0.0.0 www.yvwbox.de +0.0.0.0 www.zivwbox.de +0.0.0.0 xivwbox.de +0.0.0.0 yevwbox.de +0.0.0.0 yivwbox.de +0.0.0.0 yvwbox.de +0.0.0.0 zivwbox.de +# + +# + +# message board and wiki spam -- these sites are linked in + # message board spam and are unlikely to be real sites +0.0.0.0 10pg.scl5fyd.info +0.0.0.0 21jewelry.com +0.0.0.0 24x7.soliday.org +0.0.0.0 2site.com +0.0.0.0 33b.b33r.net +0.0.0.0 48.2mydns.net +0.0.0.0 4allfree.com +0.0.0.0 55.2myip.com +0.0.0.0 6165.rapidforum.com +0.0.0.0 6pg.ryf3hgf.info +0.0.0.0 7x7.ruwe.net +0.0.0.0 7x.cc +0.0.0.0 911.x24hr.com +0.0.0.0 ab.5.p2l.info +0.0.0.0 aboutharrypotter.fasthost.tv +0.0.0.0 aciphex.about-tabs.com +0.0.0.0 actonel.about-tabs.com +0.0.0.0 actos.about-tabs.com +0.0.0.0 acyclovir.1.p2l.info +0.0.0.0 adderall.ourtablets.com +0.0.0.0 adderallxr.freespaces.com +0.0.0.0 adipex.1.p2l.info +0.0.0.0 adipex.24sws.ws +0.0.0.0 adipex.3.p2l.info +0.0.0.0 adipex.4.p2l.info +0.0.0.0 adipex.hut1.ru +0.0.0.0 adipex.ourtablets.com +0.0.0.0 adipexp.3xforum.ro +0.0.0.0 adipex.shengen.ru +0.0.0.0 adipex.t-amo.net +0.0.0.0 adsearch.www1.biz +0.0.0.0 adult.shengen.ru +0.0.0.0 aguileranude.1stOK.com +0.0.0.0 ahh-teens.com +0.0.0.0 aid-golf-golfdust-training.tabrays.com +0.0.0.0 airline-ticket.gloses.net +0.0.0.0 air-plane-ticket.beesearch.info +0.0.0.0 ak.5.p2l.info +0.0.0.0 al.5.p2l.info +0.0.0.0 alcohol-treatment.gloses.net +0.0.0.0 allegra.1.p2l.info +0.0.0.0 allergy.1.p2l.info +0.0.0.0 all-sex.shengen.ru +0.0.0.0 alprazolamonline.findmenow.info +0.0.0.0 alprazolam.ourtablets.com +0.0.0.0 alyssamilano.1stOK.com +0.0.0.0 alyssamilano.ca.tt +0.0.0.0 alyssamilano.home.sapo.pt +0.0.0.0 amateur-mature-sex.adaltabaza.net +0.0.0.0 ambien.1.p2l.info +0.0.0.0 ambien.3.p2l.info +0.0.0.0 ambien.4.p2l.info +0.0.0.0 ambien.ourtablets.com +0.0.0.0 amoxicillin.ourtablets.com +0.0.0.0 angelinajolie.1stOK.com +0.0.0.0 angelinajolie.ca.tt +0.0.0.0 anklets.shengen.ru +0.0.0.0 annanicolesannanicolesmith.ca.tt +0.0.0.0 annanicolesmith.1stOK.com +0.0.0.0 antidepressants.1.p2l.info +0.0.0.0 anxiety.1.p2l.info +0.0.0.0 aol.spb.su +0.0.0.0 ar.5.p2l.info +0.0.0.0 arcade.ya.com +0.0.0.0 armanix.white.prohosting.com +0.0.0.0 arthritis.atspace.com +0.0.0.0 as.5.p2l.info +0.0.0.0 aspirin.about-tabs.com +0.0.0.0 ativan.ourtablets.com +0.0.0.0 austria-car-rental.findworm.net +0.0.0.0 auto.allewagen.de +0.0.0.0 az.5.p2l.info +0.0.0.0 azz.badazz.org +0.0.0.0 balabass.peerserver.com +0.0.0.0 balab.portx.net +0.0.0.0 bbs.ws +0.0.0.0 bc.5.p2l.info +0.0.0.0 beauty.finaltips.com +0.0.0.0 berkleynude.ca.tt +0.0.0.0 bestlolaray.com +0.0.0.0 bet-online.petrovka.info +0.0.0.0 betting-online.petrovka.info +0.0.0.0 bextra.ourtablets.com +0.0.0.0 bextra-store.shengen.ru +0.0.0.0 bingo-online.petrovka.info +0.0.0.0 birth-control.1.p2l.info +0.0.0.0 bontril.1.p2l.info +0.0.0.0 bontril.ourtablets.com +0.0.0.0 britneyspears.1stOK.com +0.0.0.0 britneyspears.ca.tt +0.0.0.0 br.rawcomm.net +0.0.0.0 bupropion-hcl.1.p2l.info +0.0.0.0 buspar.1.p2l.info +0.0.0.0 buspirone.1.p2l.info +0.0.0.0 butalbital-apap.1.p2l.info +0.0.0.0 buy-adipex.aca.ru +0.0.0.0 buy-adipex-cheap-adipex-online.com +0.0.0.0 buy-adipex.hut1.ru +0.0.0.0 buy-adipex.i-jogo.net +0.0.0.0 buy-adipex-online.md-online24.de +0.0.0.0 buy-adipex.petrovka.info +0.0.0.0 buy-carisoprodol.polybuild.ru +0.0.0.0 buy-cheap-phentermine.blogspot.com +0.0.0.0 buy-cheap-xanax.all.at +0.0.0.0 buy-cialis-cheap-cialis-online.info +0.0.0.0 buy-cialis.freewebtools.com +0.0.0.0 buycialisonline.7h.com +0.0.0.0 buycialisonline.bigsitecity.com +0.0.0.0 buy-cialis-online.iscool.nl +0.0.0.0 buy-cialis-online.meperdoe.net +0.0.0.0 buy-cialis.splinder.com +0.0.0.0 buy-diazepam.connect.to +0.0.0.0 buyfioricet.findmenow.info +0.0.0.0 buy-fioricet.hut1.ru +0.0.0.0 buyfioricetonline.7h.com +0.0.0.0 buyfioricetonline.bigsitecity.com +0.0.0.0 buyfioricetonline.freeservers.com +0.0.0.0 buy-flower.petrovka.info +0.0.0.0 buy-hydrocodone.aca.ru +0.0.0.0 buyhydrocodone.all.at +0.0.0.0 buy-hydrocodone-cheap-hydrocodone-online.com +0.0.0.0 buy-hydrocodone.este.ru +0.0.0.0 buyhydrocodoneonline.findmenow.info +0.0.0.0 buy-hydrocodone-online.tche.com +0.0.0.0 buy-hydrocodone.petrovka.info +0.0.0.0 buy-hydrocodone.polybuild.ru +0.0.0.0 buy-hydrocodone.quesaudade.net +0.0.0.0 buy-hydrocodone.scromble.com +0.0.0.0 buylevitra.3xforum.ro +0.0.0.0 buy-levitra-cheap-levitra-online.info +0.0.0.0 buylevitraonline.7h.com +0.0.0.0 buylevitraonline.bigsitecity.com +0.0.0.0 buy-lortab-cheap-lortab-online.com +0.0.0.0 buy-lortab.hut1.ru +0.0.0.0 buylortabonline.7h.com +0.0.0.0 buylortabonline.bigsitecity.com +0.0.0.0 buy-lortab-online.iscool.nl +0.0.0.0 buypaxilonline.7h.com +0.0.0.0 buypaxilonline.bigsitecity.com +0.0.0.0 buy-phentermine-cheap-phentermine-online.com +0.0.0.0 buy-phentermine.hautlynx.com +0.0.0.0 buy-phentermine-online.135.it +0.0.0.0 buyphentermineonline.7h.com +0.0.0.0 buyphentermineonline.bigsitecity.com +0.0.0.0 buy-phentermine-online.i-jogo.net +0.0.0.0 buy-phentermine-online.i-ltda.net +0.0.0.0 buy-phentermine.polybuild.ru +0.0.0.0 buy-phentermine.thepizza.net +0.0.0.0 buy-tamiflu.asian-flu-vaccine.com +0.0.0.0 buy-ultram-online.iscool.nl +0.0.0.0 buy-valium-cheap-valium-online.com +0.0.0.0 buy-valium.este.ru +0.0.0.0 buy-valium.hut1.ru +0.0.0.0 buy-valium.polybuild.ru +0.0.0.0 buyvalium.polybuild.ru +0.0.0.0 buy-viagra.aca.ru +0.0.0.0 buy-viagra.go.to +0.0.0.0 buy-viagra.polybuild.ru +0.0.0.0 buyviagra.polybuild.ru +0.0.0.0 buy-vicodin-cheap-vicodin-online.com +0.0.0.0 buy-vicodin.dd.vu +0.0.0.0 buy-vicodin.hut1.ru +0.0.0.0 buy-vicodin.iscool.nl +0.0.0.0 buy-vicodin-online.i-blog.net +0.0.0.0 buy-vicodin-online.seumala.net +0.0.0.0 buy-vicodin-online.supersite.fr +0.0.0.0 buyvicodinonline.veryweird.com +0.0.0.0 buy-xanax.aztecaonline.net +0.0.0.0 buy-xanax-cheap-xanax-online.com +0.0.0.0 buy-xanax.hut1.ru +0.0.0.0 buy-xanax-online.amovoce.net +0.0.0.0 buy-zyban.all.at +0.0.0.0 bx6.blrf.net +0.0.0.0 ca.5.p2l.info +0.0.0.0 camerondiaznude.1stOK.com +0.0.0.0 camerondiaznude.ca.tt +0.0.0.0 car-donation.shengen.ru +0.0.0.0 car-insurance.inshurance-from.com +0.0.0.0 carisoprodol.1.p2l.info +0.0.0.0 carisoprodol.hut1.ru +0.0.0.0 carisoprodol.ourtablets.com +0.0.0.0 carisoprodol.polybuild.ru +0.0.0.0 carisoprodol.shengen.ru +0.0.0.0 car-loan.shengen.ru +0.0.0.0 carmenelectra.1stOK.com +0.0.0.0 cash-advance.now-cash.com +0.0.0.0 casino-gambling-online.searchservice.info +0.0.0.0 casino-online.100gal.net +0.0.0.0 cat.onlinepeople.net +0.0.0.0 cc5f.dnyp.com +0.0.0.0 celebrex.1.p2l.info +0.0.0.0 celexa.1.p2l.info +0.0.0.0 celexa.3.p2l.info +0.0.0.0 celexa.4.p2l.info +0.0.0.0 cephalexin.ourtablets.com +0.0.0.0 charlizetheron.1stOK.com +0.0.0.0 cheap-adipex.hut1.ru +0.0.0.0 cheap-carisoprodol.polybuild.ru +0.0.0.0 cheap-hydrocodone.go.to +0.0.0.0 cheap-hydrocodone.polybuild.ru +0.0.0.0 cheap-phentermine.polybuild.ru +0.0.0.0 cheap-valium.polybuild.ru +0.0.0.0 cheap-viagra.polybuild.ru +0.0.0.0 cheap-web-hosting-here.blogspot.com +0.0.0.0 cheap-xanax-here.blogspot.com +0.0.0.0 cheapxanax.hut1.ru +0.0.0.0 cialis.1.p2l.info +0.0.0.0 cialis.3.p2l.info +0.0.0.0 cialis.4.p2l.info +0.0.0.0 cialis-finder.com +0.0.0.0 cialis-levitra-viagra.com.cn +0.0.0.0 cialis.ourtablets.com +0.0.0.0 cialis-store.shengen.ru +0.0.0.0 co.5.p2l.info +0.0.0.0 co.dcclan.co.uk +0.0.0.0 codeine.ourtablets.com +0.0.0.0 creampie.afdss.info +0.0.0.0 credit-card-application.now-cash.com +0.0.0.0 credit-cards.shengen.ru +0.0.0.0 ct.5.p2l.info +0.0.0.0 cuiland.info +0.0.0.0 cyclobenzaprine.1.p2l.info +0.0.0.0 cyclobenzaprine.ourtablets.com +0.0.0.0 dal.d.la +0.0.0.0 danger-phentermine.allforyourlife.com +0.0.0.0 darvocet.ourtablets.com +0.0.0.0 dc.5.p2l.info +0.0.0.0 de.5.p2l.info +0.0.0.0 debt.shengen.ru +0.0.0.0 def.5.p2l.info +0.0.0.0 demimoorenude.1stOK.com +0.0.0.0 deniserichards.1stOK.com +0.0.0.0 detox-kit.com +0.0.0.0 detox.shengen.ru +0.0.0.0 diazepam.ourtablets.com +0.0.0.0 diazepam.razma.net +0.0.0.0 diazepam.shengen.ru +0.0.0.0 didrex.1.p2l.info +0.0.0.0 diet-pills.hut1.ru +0.0.0.0 digital-cable-descrambler.planet-high-heels.com +0.0.0.0 dir.opank.com +0.0.0.0 dos.velek.com +0.0.0.0 drewbarrymore.ca.tt +0.0.0.0 drugdetox.shengen.ru +0.0.0.0 drug-online.petrovka.info +0.0.0.0 drug-testing.shengen.ru +0.0.0.0 eb.dd.bluelinecomputers.be +0.0.0.0 eb.prout.be +0.0.0.0 ed.at.is13.de +0.0.0.0 ed.at.thamaster.de +0.0.0.0 e-dot.hut1.ru +0.0.0.0 efam4.info +0.0.0.0 effexor-xr.1.p2l.info +0.0.0.0 e-hosting.hut1.ru +0.0.0.0 ei.imbucurator-de-prost.com +0.0.0.0 eminemticket.freespaces.com +0.0.0.0 en.dd.blueline.be +0.0.0.0 enpresse.1.p2l.info +0.0.0.0 en.ultrex.ru +0.0.0.0 epson-printer-ink.beesearch.info +0.0.0.0 erectile.byethost33.com +0.0.0.0 esgic.1.p2l.info +0.0.0.0 fahrrad.bikesshop.de +0.0.0.0 famous-pics.com +0.0.0.0 famvir.1.p2l.info +0.0.0.0 farmius.org +0.0.0.0 fee-hydrocodone.bebto.com +0.0.0.0 female-v.1.p2l.info +0.0.0.0 femaleviagra.findmenow.info +0.0.0.0 fg.softguy.com +0.0.0.0 findmenow.info +0.0.0.0 fioricet.1.p2l.info +0.0.0.0 fioricet.3.p2l.info +0.0.0.0 fioricet.4.p2l.info +0.0.0.0 fioricet-online.blogspot.com +0.0.0.0 firstfinda.info +0.0.0.0 fl.5.p2l.info +0.0.0.0 flexeril.1.p2l.info +0.0.0.0 flextra.1.p2l.info +0.0.0.0 flonase.1.p2l.info +0.0.0.0 flonase.3.p2l.info +0.0.0.0 flonase.4.p2l.info +0.0.0.0 florineff.ql.st +0.0.0.0 flower-online.petrovka.info +0.0.0.0 fluoxetine.1.p2l.info +0.0.0.0 fo4n.com +0.0.0.0 forex-broker.hut1.ru +0.0.0.0 forex-chart.hut1.ru +0.0.0.0 forex-market.hut1.ru +0.0.0.0 forex-news.hut1.ru +0.0.0.0 forex-online.hut1.ru +0.0.0.0 forex-signal.hut1.ru +0.0.0.0 forex-trade.hut1.ru +0.0.0.0 forex-trading-benefits.blogspot.com +0.0.0.0 forextrading.hut1.ru +0.0.0.0 freechat.llil.de +0.0.0.0 free.hostdepartment.com +0.0.0.0 free-money.host.sk +0.0.0.0 free-viagra.polybuild.ru +0.0.0.0 free-virus-scan.100gal.net +0.0.0.0 ga.5.p2l.info +0.0.0.0 game-online-video.petrovka.info +0.0.0.0 gaming-online.petrovka.info +0.0.0.0 gastrointestinal.1.p2l.info +0.0.0.0 gen-hydrocodone.polybuild.ru +0.0.0.0 getcarisoprodol.polybuild.ru +0.0.0.0 gocarisoprodol.polybuild.ru +0.0.0.0 gsm-mobile-phone.beesearch.info +0.0.0.0 gu.5.p2l.info +0.0.0.0 guerria-skateboard-tommy.tabrays.com +0.0.0.0 gwynethpaltrow.ca.tt +0.0.0.0 h1.ripway.com +0.0.0.0 hair-dos.resourcesarchive.com +0.0.0.0 halleberrynude.ca.tt +0.0.0.0 heathergraham.ca.tt +0.0.0.0 herpes.1.p2l.info +0.0.0.0 herpes.3.p2l.info +0.0.0.0 herpes.4.p2l.info +0.0.0.0 hf.themafia.info +0.0.0.0 hi.5.p2l.info +0.0.0.0 hi.pacehillel.org +0.0.0.0 holobumo.info +0.0.0.0 homehre.bravehost.com +0.0.0.0 homehre.ifrance.com +0.0.0.0 homehre.tripod.com +0.0.0.0 hoodia.kogaryu.com +0.0.0.0 hotel-las-vegas.gloses.net +0.0.0.0 hydrocodone-buy-online.blogspot.com +0.0.0.0 hydrocodone.irondel.swisshost.by +0.0.0.0 hydrocodone.on.to +0.0.0.0 hydrocodone.shengen.ru +0.0.0.0 hydrocodone.t-amo.net +0.0.0.0 hydrocodone.visa-usa.ru +0.0.0.0 hydro.polybuild.ru +0.0.0.0 ia.5.p2l.info +0.0.0.0 ia.warnet-thunder.net +0.0.0.0 ibm-notebook-battery.wp-club.net +0.0.0.0 id.5.p2l.info +0.0.0.0 il.5.p2l.info +0.0.0.0 imitrex.1.p2l.info +0.0.0.0 imitrex.3.p2l.info +0.0.0.0 imitrex.4.p2l.info +0.0.0.0 in.5.p2l.info +0.0.0.0 ionamin.1.p2l.info +0.0.0.0 ionamin.t35.com +0.0.0.0 irondel.swisshost.by +0.0.0.0 japanese-girl-xxx.com +0.0.0.0 java-games.bestxs.de +0.0.0.0 jg.hack-inter.net +0.0.0.0 job-online.petrovka.info +0.0.0.0 jobs-online.petrovka.info +0.0.0.0 kitchen-island.mensk.us +0.0.0.0 konstantin.freespaces.com +0.0.0.0 ks.5.p2l.info +0.0.0.0 ky.5.p2l.info +0.0.0.0 la.5.p2l.info +0.0.0.0 lamictal.about-tabs.com +0.0.0.0 lamisil.about-tabs.com +0.0.0.0 levitra.1.p2l.info +0.0.0.0 levitra.3.p2l.info +0.0.0.0 levitra.4.p2l.info +0.0.0.0 lexapro.1.p2l.info +0.0.0.0 lexapro.3.p2l.info +0.0.0.0 lexapro.4.p2l.info +0.0.0.0 loan.aol.msk.su +0.0.0.0 loan.maybachexelero.org +0.0.0.0 loestrin.1.p2l.info +0.0.0.0 lo.ljkeefeco.com +0.0.0.0 lol.to +0.0.0.0 lortab-cod.hut1.ru +0.0.0.0 lortab.hut1.ru +0.0.0.0 ma.5.p2l.info +0.0.0.0 mailforfreedom.com +0.0.0.0 make-money.shengen.ru +0.0.0.0 maps-antivert58.eksuziv.net +0.0.0.0 maps-spyware251-300.eksuziv.net +0.0.0.0 marketing.beesearch.info +0.0.0.0 mb.5.p2l.info +0.0.0.0 mba-online.petrovka.info +0.0.0.0 md.5.p2l.info +0.0.0.0 me.5.p2l.info +0.0.0.0 medical.carway.net +0.0.0.0 mens.1.p2l.info +0.0.0.0 meridia.1.p2l.info +0.0.0.0 meridia.3.p2l.info +0.0.0.0 meridia.4.p2l.info +0.0.0.0 meridiameridia.3xforum.ro +0.0.0.0 mesotherapy.jino-net.ru +0.0.0.0 mi.5.p2l.info +0.0.0.0 micardiss.ql.st +0.0.0.0 microsoft-sql-server.wp-club.net +0.0.0.0 mn.5.p2l.info +0.0.0.0 mo.5.p2l.info +0.0.0.0 moc.silk.com +0.0.0.0 mortgage-memphis.hotmail.ru +0.0.0.0 mortgage-rates.now-cash.com +0.0.0.0 mp.5.p2l.info +0.0.0.0 mrjeweller.us +0.0.0.0 ms.5.p2l.info +0.0.0.0 mt.5.p2l.info +0.0.0.0 multimedia-projector.katrina.ru +0.0.0.0 muscle-relaxers.1.p2l.info +0.0.0.0 music102.awardspace.com +0.0.0.0 mydaddy.b0x.com +0.0.0.0 myphentermine.polybuild.ru +0.0.0.0 nasacort.1.p2l.info +0.0.0.0 nasonex.1.p2l.info +0.0.0.0 nb.5.p2l.info +0.0.0.0 nc.5.p2l.info +0.0.0.0 nd.5.p2l.info +0.0.0.0 ne.5.p2l.info +0.0.0.0 nellyticket.beast-space.com +0.0.0.0 nelsongod.ca +0.0.0.0 nexium.1.p2l.info +0.0.0.0 nextel-ringtone.komi.su +0.0.0.0 nextel-ringtone.spb.su +0.0.0.0 nf.5.p2l.info +0.0.0.0 nh.5.p2l.info +0.0.0.0 nj.5.p2l.info +0.0.0.0 nm.5.p2l.info +0.0.0.0 nordette.1.p2l.info +0.0.0.0 nordette.3.p2l.info +0.0.0.0 nordette.4.p2l.info +0.0.0.0 norton-antivirus-trial.searchservice.info +0.0.0.0 notebook-memory.searchservice.info +0.0.0.0 ns.5.p2l.info +0.0.0.0 nv.5.p2l.info +0.0.0.0 ny.5.p2l.info +0.0.0.0 o8.aus.cc +0.0.0.0 ofni.al0ne.info +0.0.0.0 oh.5.p2l.info +0.0.0.0 ok.5.p2l.info +0.0.0.0 on.5.p2l.info +0.0.0.0 online-auto-insurance.petrovka.info +0.0.0.0 online-bingo.petrovka.info +0.0.0.0 online-broker.petrovka.info +0.0.0.0 online-cash.petrovka.info +0.0.0.0 online-casino.shengen.ru +0.0.0.0 online-casino.webpark.pl +0.0.0.0 online-cigarettes.hitslog.net +0.0.0.0 online-college.petrovka.info +0.0.0.0 online-degree.petrovka.info +0.0.0.0 online-florist.petrovka.info +0.0.0.0 online-forex.hut1.ru +0.0.0.0 online-forex-trading-systems.blogspot.com +0.0.0.0 online-gaming.petrovka.info +0.0.0.0 online-job.petrovka.info +0.0.0.0 online-loan.petrovka.info +0.0.0.0 online-mortgage.petrovka.info +0.0.0.0 online-personal.petrovka.info +0.0.0.0 online-personals.petrovka.info +0.0.0.0 online-pharmacy-online.blogspot.com +0.0.0.0 online-pharmacy.petrovka.info +0.0.0.0 online-phentermine.petrovka.info +0.0.0.0 online-poker-gambling.petrovka.info +0.0.0.0 online-poker-game.petrovka.info +0.0.0.0 online-poker.shengen.ru +0.0.0.0 online-prescription.petrovka.info +0.0.0.0 online-school.petrovka.info +0.0.0.0 online-schools.petrovka.info +0.0.0.0 online-single.petrovka.info +0.0.0.0 online-tarot-reading.beesearch.info +0.0.0.0 online-travel.petrovka.info +0.0.0.0 online-university.petrovka.info +0.0.0.0 online-viagra.petrovka.info +0.0.0.0 online-xanax.petrovka.info +0.0.0.0 onlypreteens.com +0.0.0.0 only-valium.go.to +0.0.0.0 only-valium.shengen.ru +0.0.0.0 or.5.p2l.info +0.0.0.0 oranla.info +0.0.0.0 orderadipex.findmenow.info +0.0.0.0 order-hydrocodone.polybuild.ru +0.0.0.0 order-phentermine.polybuild.ru +0.0.0.0 order-valium.polybuild.ru +0.0.0.0 ortho-tri-cyclen.1.p2l.info +0.0.0.0 pa.5.p2l.info +0.0.0.0 pacific-poker.e-online-poker-4u.net +0.0.0.0 pain-relief.1.p2l.info +0.0.0.0 paintball-gun.tripod.com +0.0.0.0 patio-furniture.dreamhoster.com +0.0.0.0 paxil.1.p2l.info +0.0.0.0 pay-day-loans.beesearch.info +0.0.0.0 payday-loans.now-cash.com +0.0.0.0 pctuzing.php5.cz +0.0.0.0 pd1.funnyhost.com +0.0.0.0 pe.5.p2l.info +0.0.0.0 peter-north-cum-shot.blogspot.com +0.0.0.0 pets.finaltips.com +0.0.0.0 pharmacy-canada.forsearch.net +0.0.0.0 pharmacy.hut1.ru +0.0.0.0 pharmacy-news.blogspot.com +0.0.0.0 pharmacy-online.petrovka.info +0.0.0.0 phendimetrazine.1.p2l.info +0.0.0.0 phentermine.1.p2l.info +0.0.0.0 phentermine.3.p2l.info +0.0.0.0 phentermine.4.p2l.info +0.0.0.0 phentermine.aussie7.com +0.0.0.0 phentermine-buy-online.hitslog.net +0.0.0.0 phentermine-buy.petrovka.info +0.0.0.0 phentermine-online.iscool.nl +0.0.0.0 phentermine-online.petrovka.info +0.0.0.0 phentermine.petrovka.info +0.0.0.0 phentermine.polybuild.ru +0.0.0.0 phentermine.shengen.ru +0.0.0.0 phentermine.t-amo.net +0.0.0.0 phentermine.webpark.pl +0.0.0.0 phone-calling-card.exnet.su +0.0.0.0 plavix.shengen.ru +0.0.0.0 play-poker-free.forsearch.net +0.0.0.0 poker-games.e-online-poker-4u.net +0.0.0.0 pop.egi.biz +0.0.0.0 pr.5.p2l.info +0.0.0.0 prescription-drugs.easy-find.net +0.0.0.0 prescription-drugs.shengen.ru +0.0.0.0 preteenland.com +0.0.0.0 preteensite.com +0.0.0.0 prevacid.1.p2l.info +0.0.0.0 prevent-asian-flu.com +0.0.0.0 prilosec.1.p2l.info +0.0.0.0 propecia.1.p2l.info +0.0.0.0 protonix.shengen.ru +0.0.0.0 psorias.atspace.com +0.0.0.0 purchase.hut1.ru +0.0.0.0 qc.5.p2l.info +0.0.0.0 qz.informs.com +0.0.0.0 refinance.shengen.ru +0.0.0.0 relenza.asian-flu-vaccine.com +0.0.0.0 renova.1.p2l.info +0.0.0.0 replacement-windows.gloses.net +0.0.0.0 re.rutan.org +0.0.0.0 resanium.com +0.0.0.0 retin-a.1.p2l.info +0.0.0.0 ri.5.p2l.info +0.0.0.0 rise-media.ru +0.0.0.0 root.dns.bz +0.0.0.0 roulette-online.petrovka.info +0.0.0.0 router.googlecom.biz +0.0.0.0 s32.bilsay.com +0.0.0.0 samsclub33.pochta.ru +0.0.0.0 sc10.net +0.0.0.0 sc.5.p2l.info +0.0.0.0 sd.5.p2l.info +0.0.0.0 search4you.50webs.com +0.0.0.0 search-phentermine.hpage.net +0.0.0.0 searchpill.boom.ru +0.0.0.0 seasonale.1.p2l.info +0.0.0.0 shop.kauffes.de +0.0.0.0 single-online.petrovka.info +0.0.0.0 sk.5.p2l.info +0.0.0.0 skelaxin.1.p2l.info +0.0.0.0 skelaxin.3.p2l.info +0.0.0.0 skelaxin.4.p2l.info +0.0.0.0 skin-care.1.p2l.info +0.0.0.0 skocz.pl +0.0.0.0 sleep-aids.1.p2l.info +0.0.0.0 sleeper-sofa.dreamhoster.com +0.0.0.0 slf5cyd.info +0.0.0.0 sobolev.net.ru +0.0.0.0 soma.1.p2l.info +0.0.0.0 soma.3xforum.ro +0.0.0.0 soma-store.visa-usa.ru +0.0.0.0 sonata.1.p2l.info +0.0.0.0 sport-betting-online.hitslog.net +0.0.0.0 spyware-removers.shengen.ru +0.0.0.0 spyware-scan.100gal.net +0.0.0.0 spyware.usafreespace.com +0.0.0.0 sq7.co.uk +0.0.0.0 sql-server-driver.beesearch.info +0.0.0.0 starlix.ql.st +0.0.0.0 stop-smoking.1.p2l.info +0.0.0.0 supplements.1.p2l.info +0.0.0.0 sx.nazari.org +0.0.0.0 sx.z0rz.com +0.0.0.0 ta.at.ic5mp.net +0.0.0.0 ta.at.user-mode-linux.net +0.0.0.0 tamiflu-in-canada.asian-flu-vaccine.com +0.0.0.0 tamiflu-no-prescription.asian-flu-vaccine.com +0.0.0.0 tamiflu-purchase.asian-flu-vaccine.com +0.0.0.0 tamiflu-without-prescription.asian-flu-vaccine.com +0.0.0.0 tenuate.1.p2l.info +0.0.0.0 texas-hold-em.e-online-poker-4u.net +0.0.0.0 texas-holdem.shengen.ru +0.0.0.0 ticket20.tripod.com +0.0.0.0 tizanidine.1.p2l.info +0.0.0.0 tn.5.p2l.info +0.0.0.0 topmeds10.com +0.0.0.0 top.pcanywhere.net +0.0.0.0 toyota.cyberealhosting.com +0.0.0.0 tramadol.1.p2l.info +0.0.0.0 tramadol2006.3xforum.ro +0.0.0.0 tramadol.3.p2l.info +0.0.0.0 tramadol.4.p2l.info +0.0.0.0 travel-insurance-quotes.beesearch.info +0.0.0.0 triphasil.1.p2l.info +0.0.0.0 triphasil.3.p2l.info +0.0.0.0 triphasil.4.p2l.info +0.0.0.0 tx.5.p2l.info +0.0.0.0 uf2aasn.111adfueo.us +0.0.0.0 ultracet.1.p2l.info +0.0.0.0 ultram.1.p2l.info +0.0.0.0 united-airline-fare.100pantyhose.com +0.0.0.0 university-online.petrovka.info +0.0.0.0 urlcut.net +0.0.0.0 urshort.net +0.0.0.0 us.kopuz.com +0.0.0.0 ut.5.p2l.info +0.0.0.0 utairway.com +0.0.0.0 va.5.p2l.info +0.0.0.0 vacation.toppick.info +0.0.0.0 valium.este.ru +0.0.0.0 valium.hut1.ru +0.0.0.0 valium.ourtablets.com +0.0.0.0 valium.polybuild.ru +0.0.0.0 valiumvalium.3xforum.ro +0.0.0.0 valtrex.1.p2l.info +0.0.0.0 valtrex.3.p2l.info +0.0.0.0 valtrex.4.p2l.info +0.0.0.0 valtrex.7h.com +0.0.0.0 vaniqa.1.p2l.info +0.0.0.0 vi.5.p2l.info +0.0.0.0 viagra.1.p2l.info +0.0.0.0 viagra.3.p2l.info +0.0.0.0 viagra.4.p2l.info +0.0.0.0 viagra-online.petrovka.info +0.0.0.0 viagra-pill.blogspot.com +0.0.0.0 viagra.polybuild.ru +0.0.0.0 viagra-soft-tabs.1.p2l.info +0.0.0.0 viagra-store.shengen.ru +0.0.0.0 viagraviagra.3xforum.ro +0.0.0.0 vicodin-online.petrovka.info +0.0.0.0 vicodin-store.shengen.ru +0.0.0.0 vicodin.t-amo.net +0.0.0.0 viewtools.com +0.0.0.0 vioxx.1.p2l.info +0.0.0.0 vitalitymax.1.p2l.info +0.0.0.0 vt.5.p2l.info +0.0.0.0 vxv.phre.net +0.0.0.0 w0.drag0n.org +0.0.0.0 wa.5.p2l.info +0.0.0.0 water-bed.8p.org.uk +0.0.0.0 web-hosting.hitslog.net +0.0.0.0 webhosting.hut1.ru +0.0.0.0 weborg.hut1.ru +0.0.0.0 weight-loss.1.p2l.info +0.0.0.0 weight-loss.3.p2l.info +0.0.0.0 weight-loss.4.p2l.info +0.0.0.0 weight-loss.hut1.ru +0.0.0.0 wellbutrin.1.p2l.info +0.0.0.0 wellbutrin.3.p2l.info +0.0.0.0 wellbutrin.4.p2l.info +0.0.0.0 wellnessmonitor.bravehost.com +0.0.0.0 wi.5.p2l.info +0.0.0.0 world-trade-center.hawaiicity.com +0.0.0.0 wp-club.net +0.0.0.0 ws01.do.nu +0.0.0.0 ws02.do.nu +0.0.0.0 ws03.do.nu +0.0.0.0 ws03.home.sapo.pt +0.0.0.0 ws04.do.nu +0.0.0.0 ws04.home.sapo.pt +0.0.0.0 ws05.home.sapo.pt +0.0.0.0 ws06.home.sapo.pt +0.0.0.0 wv.5.p2l.info +0.0.0.0 www.31d.net +0.0.0.0 www3.ddns.ms +0.0.0.0 www4.at.debianbase.de +0.0.0.0 www4.epac.to +0.0.0.0 www5.3-a.net +0.0.0.0 www69.bestdeals.at +0.0.0.0 www69.byinter.net +0.0.0.0 www69.dynu.com +0.0.0.0 www69.findhere.org +0.0.0.0 www69.fw.nu +0.0.0.0 www69.ugly.as +0.0.0.0 www6.ezua.com +0.0.0.0 www6.ns1.name +0.0.0.0 www7.ygto.com +0.0.0.0 www8.ns01.us +0.0.0.0 www99.bounceme.net +0.0.0.0 www99.fdns.net +0.0.0.0 www99.zapto.org +0.0.0.0 www9.compblue.com +0.0.0.0 www9.servequake.com +0.0.0.0 www9.trickip.org +0.0.0.0 www.adspoll.com +0.0.0.0 www.adult-top-list.com +0.0.0.0 www.aektschen.de +0.0.0.0 www.aeqs.com +0.0.0.0 www.alladultdirectories.com +0.0.0.0 www.alladultdirectory.net +0.0.0.0 www.arbeitssuche-web.de +0.0.0.0 www.bestrxpills.com +0.0.0.0 www.bigsister.cxa.de +0.0.0.0 www.bigsister-puff.cxa.de +0.0.0.0 www.bitlocker.net +0.0.0.0 www.cheap-laptops-notebook-computers.info +0.0.0.0 www.cheap-online-stamp.cast.cc +0.0.0.0 www.codez-knacken.de +0.0.0.0 www.computerxchange.com +0.0.0.0 www.credit-dreams.com +0.0.0.0 www.edle-stuecke.de +0.0.0.0 www.exe-file.de +0.0.0.0 www.exttrem.de +0.0.0.0 www.fetisch-pornos.cxa.de +0.0.0.0 www.ficken-ficken-ficken.cxa.de +0.0.0.0 www.ficken-xxx.cxa.de +0.0.0.0 www.financial-advice-books.com +0.0.0.0 www.finanzmarkt2004.de +0.0.0.0 www.furnitureulimited.com +0.0.0.0 www.gewinnspiele-slotmachine.de +0.0.0.0 www.hardware4freaks.de +0.0.0.0 www.healthyaltprods.com +0.0.0.0 www.heimlich-gefilmt.cxa.de +0.0.0.0 www.huberts-kochseite.de +0.0.0.0 www.huren-verzeichnis.is4all.de +0.0.0.0 www.kaaza-legal.de +0.0.0.0 www.kajahdfssa.net +0.0.0.0 www.keyofhealth.com +0.0.0.0 www.kitchentablegang.org +0.0.0.0 www.km69.de +0.0.0.0 www.koch-backrezepte.de +0.0.0.0 www.kvr-systems.de +0.0.0.0 www.lesben-pornos.cxa.de +0.0.0.0 www.links-private-krankenversicherung.de +0.0.0.0 www.littledevildoubt.com +0.0.0.0 www.mailforfreedom.com +0.0.0.0 www.masterspace.biz +0.0.0.0 www.medical-research-books.com +0.0.0.0 www.microsoft2010.com +0.0.0.0 www.nelsongod.ca +0.0.0.0 www.nextstudent.com +0.0.0.0 www.ntdesk.de +0.0.0.0 www.nutten-verzeichnis.cxa.de +0.0.0.0 www.obesitycheck.com +0.0.0.0 www.pawnauctions.net +0.0.0.0 www.pills-home.com +0.0.0.0 www.poker4spain.com +0.0.0.0 www.poker-new.com +0.0.0.0 www.poker-unique.com +0.0.0.0 www.porno-lesben.cxa.de +0.0.0.0 www.prevent-asian-flu.com +0.0.0.0 www.randppro-cuts.com +0.0.0.0 www.romanticmaui.net +0.0.0.0 www.salldo.de +0.0.0.0 www.samsclub33.pochta.ru +0.0.0.0 www.schwarz-weisses.de +0.0.0.0 www.schwule-boys-nackt.cxa.de +0.0.0.0 www.shopping-artikel.de +0.0.0.0 www.showcaserealestate.net +0.0.0.0 www.skattabrain.com +0.0.0.0 www.softcha.com +0.0.0.0 www.striemline.de +0.0.0.0 www.talentbroker.net +0.0.0.0 www.the-discount-store.com +0.0.0.0 www.topmeds10.com +0.0.0.0 www.uniqueinternettexasholdempoker.com +0.0.0.0 www.viagra-home.com +0.0.0.0 www.vthought.com +0.0.0.0 www.vtoyshop.com +0.0.0.0 www.vulcannonibird.de +0.0.0.0 www.webabrufe.de +0.0.0.0 www.wilddreams.info +0.0.0.0 www.willcommen.de +0.0.0.0 www.xcr-286.com +0.0.0.0 wy.5.p2l.info +0.0.0.0 x25.2mydns.com +0.0.0.0 x25.plorp.com +0.0.0.0 x4.lov3.net +0.0.0.0 x6x.a.la +0.0.0.0 x888x.myserver.org +0.0.0.0 x8x.dyndns.dk +0.0.0.0 x8x.trickip.net +0.0.0.0 xanax-online.dot.de +0.0.0.0 xanax-online.run.to +0.0.0.0 xanax-online.sms2.us +0.0.0.0 xanax.ourtablets.com +0.0.0.0 xanax-store.shengen.ru +0.0.0.0 xanax.t-amo.net +0.0.0.0 xanaxxanax.3xforum.ro +0.0.0.0 x-box.t35.com +0.0.0.0 xcr-286.com +0.0.0.0 xenical.1.p2l.info +0.0.0.0 xenical.3.p2l.info +0.0.0.0 xenical.4.p2l.info +0.0.0.0 x-hydrocodone.info +0.0.0.0 xoomer.alice.it +0.0.0.0 x-phentermine.info +0.0.0.0 xr.h4ck.la +0.0.0.0 yasmin.1.p2l.info +0.0.0.0 yasmin.3.p2l.info +0.0.0.0 yasmin.4.p2l.info +0.0.0.0 yt.5.p2l.info +0.0.0.0 zanaflex.1.p2l.info +0.0.0.0 zebutal.1.p2l.info +0.0.0.0 zocor.about-tabs.com +0.0.0.0 zoloft.1.p2l.info +0.0.0.0 zoloft.3.p2l.info +0.0.0.0 zoloft.4.p2l.info +0.0.0.0 zoloft.about-tabs.com +0.0.0.0 zyban.1.p2l.info +0.0.0.0 zyban.about-tabs.com +0.0.0.0 zyban-store.shengen.ru +0.0.0.0 zyprexa.about-tabs.com +0.0.0.0 zyrtec.1.p2l.info +0.0.0.0 zyrtec.3.p2l.info +0.0.0.0 zyrtec.4.p2l.info +# + +# + +# Phorm contextual advertising sites +0.0.0.0 a.oix.com +0.0.0.0 a.oix.net +0.0.0.0 a.openinternetexchange.com +0.0.0.0 a.phormlabs.com +0.0.0.0 a.webwise.com +0.0.0.0 a.webwise.net +0.0.0.0 b.oix.net +0.0.0.0 br.phorm.com +0.0.0.0 bt.phorm.com +0.0.0.0 bt.webwise.com +0.0.0.0 b.webwise.net +0.0.0.0 c.webwise.com +0.0.0.0 c.webwise.net +0.0.0.0 d.oix.com +0.0.0.0 d.phormlabs.com +0.0.0.0 ig.fp.oix.net +0.0.0.0 invite.gezinti.com +0.0.0.0 kentsucks.youcanoptout.com +0.0.0.0 kr.phorm.com +0.0.0.0 mail.youcanoptout.com +0.0.0.0 mail.youcanoptout.net +0.0.0.0 mail.youcanoptout.org +0.0.0.0 monitor.phorm.com +0.0.0.0 mx01.openinternetexchange.com +0.0.0.0 mx01.openinternetexchange.net +0.0.0.0 mx01.webwise.com +0.0.0.0 mx03.phorm.com +0.0.0.0 navegador.oi.com.br +0.0.0.0 navegador.telefonica.com.br +0.0.0.0 ns1.oix.com +0.0.0.0 ns1.openinternetexchange.com +0.0.0.0 ns1.phorm.com +0.0.0.0 ns2.oix.com +0.0.0.0 ns2.openinternetexchange.com +0.0.0.0 ns2.phorm.com +0.0.0.0 ns2.youcanoptout.com +0.0.0.0 ns3.openinternetexchange.com +0.0.0.0 oi.webnavegador.com.br +0.0.0.0 oixcrv-lab.net +0.0.0.0 oixcrv.net +0.0.0.0 oixcrv-stage.net +0.0.0.0 oix.phorm.com +0.0.0.0 oixpre.net +0.0.0.0 oixpre-stage.net +0.0.0.0 oixssp-lab.net +0.0.0.0 oixssp.net +0.0.0.0 oix-stage.net +0.0.0.0 openinternetexchange.com +0.0.0.0 openinternetexchange.net +0.0.0.0 phorm.kr +0.0.0.0 phormlabs.com +0.0.0.0 prm-ext.phorm.com +0.0.0.0 romdiscover.com +0.0.0.0 rtc.romdiscover.com +0.0.0.0 stats.oix.com +0.0.0.0 stopphoulplay.com +0.0.0.0 stopphoulplay.net +0.0.0.0 telefonica.webnavegador.com.br +0.0.0.0 webnavegador.com.br +0.0.0.0 webwise.com +0.0.0.0 webwise.net +0.0.0.0 w.oix.net +0.0.0.0 www.gezinti.com +0.0.0.0 www.gozatar.com +0.0.0.0 www.oix.com +0.0.0.0 www.openinternetexchange.com +0.0.0.0 www.phormlabs.com +0.0.0.0 www.stopphoulplay.com +0.0.0.0 www.youcanoptout.com +0.0.0.0 www.youcanoptout.net +0.0.0.0 www.youcanoptout.org +0.0.0.0 xxyyzz.youcanoptout.com +0.0.0.0 youcanoptout.com +0.0.0.0 youcanoptout.net +0.0.0.0 youcanoptout.org +# diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/https_svn_python_org_root.pem b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/https_svn_python_org_root.pem new file mode 100644 index 00000000..e7dfc829 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/https_svn_python_org_root.pem @@ -0,0 +1,41 @@ +-----BEGIN CERTIFICATE----- +MIIHPTCCBSWgAwIBAgIBADANBgkqhkiG9w0BAQQFADB5MRAwDgYDVQQKEwdSb290 +IENBMR4wHAYDVQQLExVodHRwOi8vd3d3LmNhY2VydC5vcmcxIjAgBgNVBAMTGUNB +IENlcnQgU2lnbmluZyBBdXRob3JpdHkxITAfBgkqhkiG9w0BCQEWEnN1cHBvcnRA +Y2FjZXJ0Lm9yZzAeFw0wMzAzMzAxMjI5NDlaFw0zMzAzMjkxMjI5NDlaMHkxEDAO +BgNVBAoTB1Jvb3QgQ0ExHjAcBgNVBAsTFWh0dHA6Ly93d3cuY2FjZXJ0Lm9yZzEi +MCAGA1UEAxMZQ0EgQ2VydCBTaWduaW5nIEF1dGhvcml0eTEhMB8GCSqGSIb3DQEJ +ARYSc3VwcG9ydEBjYWNlcnQub3JnMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIIC +CgKCAgEAziLA4kZ97DYoB1CW8qAzQIxL8TtmPzHlawI229Z89vGIj053NgVBlfkJ +8BLPRoZzYLdufujAWGSuzbCtRRcMY/pnCujW0r8+55jE8Ez64AO7NV1sId6eINm6 +zWYyN3L69wj1x81YyY7nDl7qPv4coRQKFWyGhFtkZip6qUtTefWIonvuLwphK42y +fk1WpRPs6tqSnqxEQR5YYGUFZvjARL3LlPdCfgv3ZWiYUQXw8wWRBB0bF4LsyFe7 +w2t6iPGwcswlWyCR7BYCEo8y6RcYSNDHBS4CMEK4JZwFaz+qOqfrU0j36NK2B5jc +G8Y0f3/JHIJ6BVgrCFvzOKKrF11myZjXnhCLotLddJr3cQxyYN/Nb5gznZY0dj4k +epKwDpUeb+agRThHqtdB7Uq3EvbXG4OKDy7YCbZZ16oE/9KTfWgu3YtLq1i6L43q +laegw1SJpfvbi1EinbLDvhG+LJGGi5Z4rSDTii8aP8bQUWWHIbEZAWV/RRyH9XzQ +QUxPKZgh/TMfdQwEUfoZd9vUFBzugcMd9Zi3aQaRIt0AUMyBMawSB3s42mhb5ivU +fslfrejrckzzAeVLIL+aplfKkQABi6F1ITe1Yw1nPkZPcCBnzsXWWdsC4PDSy826 +YreQQejdIOQpvGQpQsgi3Hia/0PsmBsJUUtaWsJx8cTLc6nloQsCAwEAAaOCAc4w +ggHKMB0GA1UdDgQWBBQWtTIb1Mfz4OaO873SsDrusjkY0TCBowYDVR0jBIGbMIGY +gBQWtTIb1Mfz4OaO873SsDrusjkY0aF9pHsweTEQMA4GA1UEChMHUm9vdCBDQTEe +MBwGA1UECxMVaHR0cDovL3d3dy5jYWNlcnQub3JnMSIwIAYDVQQDExlDQSBDZXJ0 +IFNpZ25pbmcgQXV0aG9yaXR5MSEwHwYJKoZIhvcNAQkBFhJzdXBwb3J0QGNhY2Vy +dC5vcmeCAQAwDwYDVR0TAQH/BAUwAwEB/zAyBgNVHR8EKzApMCegJaAjhiFodHRw +czovL3d3dy5jYWNlcnQub3JnL3Jldm9rZS5jcmwwMAYJYIZIAYb4QgEEBCMWIWh0 +dHBzOi8vd3d3LmNhY2VydC5vcmcvcmV2b2tlLmNybDA0BglghkgBhvhCAQgEJxYl +aHR0cDovL3d3dy5jYWNlcnQub3JnL2luZGV4LnBocD9pZD0xMDBWBglghkgBhvhC +AQ0ESRZHVG8gZ2V0IHlvdXIgb3duIGNlcnRpZmljYXRlIGZvciBGUkVFIGhlYWQg +b3ZlciB0byBodHRwOi8vd3d3LmNhY2VydC5vcmcwDQYJKoZIhvcNAQEEBQADggIB +ACjH7pyCArpcgBLKNQodgW+JapnM8mgPf6fhjViVPr3yBsOQWqy1YPaZQwGjiHCc +nWKdpIevZ1gNMDY75q1I08t0AoZxPuIrA2jxNGJARjtT6ij0rPtmlVOKTV39O9lg +18p5aTuxZZKmxoGCXJzN600BiqXfEVWqFcofN8CCmHBh22p8lqOOLlQ+TyGpkO/c +gr/c6EWtTZBzCDyUZbAEmXZ/4rzCahWqlwQ3JNgelE5tDlG+1sSPypZt90Pf6DBl +Jzt7u0NDY8RD97LsaMzhGY4i+5jhe1o+ATc7iwiwovOVThrLm82asduycPAtStvY +sONvRUgzEv/+PDIqVPfE94rwiCPCR/5kenHA0R6mY7AHfqQv0wGP3J8rtsYIqQ+T +SCX8Ev2fQtzzxD72V7DX3WnRBnc0CkvSyqD/HMaMyRa+xMwyN2hzXwj7UfdJUzYF +CpUCTPJ5GhD22Dp1nPMd8aINcGeGG7MW9S/lpOt5hvk9C8JzC6WZrG/8Z7jlLwum +GCSNe9FINSkYQKyTYOGWhlC0elnYjyELn8+CkcY7v2vcB5G5l1YjqrZslMZIBjzk +zk6q5PYvCdxTby78dOs6Y5nCpqyJvKeyRKANihDjbPIky/qbn3BHLt4Ui9SyIAmW +omTxJBzcoTWcFbLUvFUufQb1nA5V9FrWk9p2rSVzTMVD +-----END CERTIFICATE----- diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/keycert.pem b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/keycert.pem new file mode 100644 index 00000000..2f46fcf1 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/keycert.pem @@ -0,0 +1,32 @@ +-----BEGIN RSA PRIVATE KEY----- +MIICXwIBAAKBgQC8ddrhm+LutBvjYcQlnH21PPIseJ1JVG2HMmN2CmZk2YukO+9L +opdJhTvbGfEj0DQs1IE8M+kTUyOmuKfVrFMKwtVeCJphrAnhoz7TYOuLBSqt7lVH +fhi/VwovESJlaBOp+WMnfhcduPEYHYx/6cnVapIkZnLt30zu2um+DzA9jQIDAQAB +AoGBAK0FZpaKj6WnJZN0RqhhK+ggtBWwBnc0U/ozgKz2j1s3fsShYeiGtW6CK5nU +D1dZ5wzhbGThI7LiOXDvRucc9n7vUgi0alqPQ/PFodPxAN/eEYkmXQ7W2k7zwsDA +IUK0KUhktQbLu8qF/m8qM86ba9y9/9YkXuQbZ3COl5ahTZrhAkEA301P08RKv3KM +oXnGU2UHTuJ1MAD2hOrPxjD4/wxA/39EWG9bZczbJyggB4RHu0I3NOSFjAm3HQm0 +ANOu5QK9owJBANgOeLfNNcF4pp+UikRFqxk5hULqRAWzVxVrWe85FlPm0VVmHbb/ +loif7mqjU8o1jTd/LM7RD9f2usZyE2psaw8CQQCNLhkpX3KO5kKJmS9N7JMZSc4j +oog58yeYO8BBqKKzpug0LXuQultYv2K4veaIO04iL9VLe5z9S/Q1jaCHBBuXAkEA +z8gjGoi1AOp6PBBLZNsncCvcV/0aC+1se4HxTNo2+duKSDnbq+ljqOM+E7odU+Nq +ewvIWOG//e8fssd0mq3HywJBAJ8l/c8GVmrpFTx8r/nZ2Pyyjt3dH1widooDXYSV +q6Gbf41Llo5sYAtmxdndTLASuHKecacTgZVhy0FryZpLKrU= +-----END RSA PRIVATE KEY----- +-----BEGIN CERTIFICATE----- +MIICpzCCAhCgAwIBAgIJAP+qStv1cIGNMA0GCSqGSIb3DQEBBQUAMIGJMQswCQYD +VQQGEwJVUzERMA8GA1UECBMIRGVsYXdhcmUxEzARBgNVBAcTCldpbG1pbmd0b24x +IzAhBgNVBAoTGlB5dGhvbiBTb2Z0d2FyZSBGb3VuZGF0aW9uMQwwCgYDVQQLEwNT +U0wxHzAdBgNVBAMTFnNvbWVtYWNoaW5lLnB5dGhvbi5vcmcwHhcNMDcwODI3MTY1 +NDUwWhcNMTMwMjE2MTY1NDUwWjCBiTELMAkGA1UEBhMCVVMxETAPBgNVBAgTCERl +bGF3YXJlMRMwEQYDVQQHEwpXaWxtaW5ndG9uMSMwIQYDVQQKExpQeXRob24gU29m +dHdhcmUgRm91bmRhdGlvbjEMMAoGA1UECxMDU1NMMR8wHQYDVQQDExZzb21lbWFj +aGluZS5weXRob24ub3JnMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC8ddrh +m+LutBvjYcQlnH21PPIseJ1JVG2HMmN2CmZk2YukO+9LopdJhTvbGfEj0DQs1IE8 +M+kTUyOmuKfVrFMKwtVeCJphrAnhoz7TYOuLBSqt7lVHfhi/VwovESJlaBOp+WMn +fhcduPEYHYx/6cnVapIkZnLt30zu2um+DzA9jQIDAQABoxUwEzARBglghkgBhvhC +AQEEBAMCBkAwDQYJKoZIhvcNAQEFBQADgYEAF4Q5BVqmCOLv1n8je/Jw9K669VXb +08hyGzQhkemEBYQd6fzQ9A/1ZzHkJKb1P6yreOLSEh4KcxYPyrLRC1ll8nr5OlCx +CMhKkTnR6qBsdNV0XtdU2+N25hqW+Ma4ZeqsN/iiJVCGNOZGnvQuvCAGWF8+J/f/ +iHkC6gGdBJhogs4= +-----END CERTIFICATE----- diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/known_failures.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/known_failures.py new file mode 100644 index 00000000..6396c0e2 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/known_failures.py @@ -0,0 +1,398 @@ +# This is a list of known failures (=bugs). +# The tests listed there must fail (or testrunner.py will report error) unless they are prefixed with FLAKY +# in which cases the result of them is simply ignored +from __future__ import print_function +import os +import sys +import struct + +from gevent.testing.sysinfo import RUNNING_ON_APPVEYOR as APPVEYOR +from gevent.testing.sysinfo import RUNNING_ON_TRAVIS as TRAVIS +from gevent.testing.sysinfo import RUN_LEAKCHECKS as LEAKTEST +from gevent.testing.sysinfo import RUN_COVERAGE as COVERAGE +from gevent.testing.sysinfo import RESOLVER_NOT_SYSTEM + +from gevent.testing.sysinfo import PYPY +from gevent.testing.sysinfo import PY3 +from gevent.testing.sysinfo import PY35 + +from gevent.testing.sysinfo import LIBUV + +IGNORED_TESTS = [] + +FAILING_TESTS = [ + + # Sometimes fails with AssertionError: ...\nIOError: close() called during concurrent operation on the same file object.\n' + # Sometimes it contains "\nUnhandled exception in thread started by \nsys.excepthook is missing\nlost sys.stderr\n" + "FLAKY test__subprocess_interrupted.py", + # test__issue6 (see comments in test file) is really flaky on both Travis and Appveyor; + # on Travis we could just run the test again (but that gets old fast), but on appveyor + # we don't have that option without a new commit---and sometimes we really need a build + # to succeed in order to get a release wheel + 'FLAKY test__issue6.py', +] + + +if sys.platform == 'win32': + IGNORED_TESTS = [ + # fork watchers don't get called on windows + # because fork is not a concept windows has. + # See this file for a detailed explanation. + 'test__core_fork.py', + ] + # other Windows-related issues (need investigating) + FAILING_TESTS += [ + 'FLAKY test__greenletset.py', + # This has been seen to fail on Py3 and Py2 due to socket reuse + # errors, probably timing related again. + 'FLAKY test___example_servers.py', + ] + + if APPVEYOR: + FAILING_TESTS += [ + # These both run on port 9000 and can step on each other...seems like the + # appveyor containers aren't fully port safe? Or it takes longer + # for the processes to shut down? Or we run them in a different order + # in the process pool than we do other places? + 'FLAKY test__example_udp_client.py', + 'FLAKY test__example_udp_server.py', + # This one sometimes times out, often after output "The process with PID XXX could not be + # terminated. Reason: There is no running instance of the task." + 'FLAKY test__example_portforwarder.py', + # This one sometimes randomly closes connections, but no indication + # of a server crash, only a client side close. + 'FLAKY test__server_pywsgi.py', + ] + + if PYPY and LIBUV: + IGNORED_TESTS += [ + # This one seems to just stop right after + # patching is done. It passes on a local win 10 vm, and the main + # test_threading_2.py does as well. + # Based on the printouts we added, it appears to not even + # finish importing: + # https://ci.appveyor.com/project/denik/gevent/build/1.0.1277/job/tpvhesij5gldjxqw#L1190 + # Ignored because it takes two minutes to time out. + 'test_threading.py', + ] + + if PY3: + FAILING_TESTS += [ + # test_set_and_clear in Py3 relies on 5 threads all starting and + # coming to an Event wait point while a sixth thread sleeps for a half + # second. The sixth thread then does something and checks that + # the 5 threads were all at the wait point. But the timing is sometimes + # too tight for appveyor. This happens even if Event isn't + # monkey-patched + 'FLAKY test_threading.py', + + # Starting in November 2018, on Python 3.7.0, we observe this test crashing. + # I can't reproduce locally. + # | C:\Python37-x64\python.exe -u -mgevent.tests.test__greenness + # 127.0.0.1 - - [09/Nov/2018 16:34:12] code 501, message Unsupported method ('GET') + # 127.0.0.1 - - [09/Nov/2018 16:34:12] "GET / HTTP/1.1" 501 - + # . + # ---------------------------------------------------------------------- + # Ran 1 test in 0.031s + + # OK + # Windows fatal exception: access violation + + # Current thread 0x000003c8 (most recent call first): + # File "c:\projects\gevent\src\gevent\threadpool.py", line 261 in _worker + + # Thread 0x00000600 (most recent call first): + # File "c:\projects\gevent\src\gevent\libuv\watcher.py", line 577 in send + # File "c:\projects\gevent\src\gevent\threadpool.py", line 408 in set + # File "c:\projects\gevent\src\gevent\threadpool.py", line 290 in _worker + + # Thread 0x000007d4 (most recent call first): + # File "C:\Python37-x64\lib\weakref.py", line 356 in remove + + # ! C:\Python37-x64\python.exe -u -mgevent.tests.test__greenness [code 3221225477] [took 1.3s] + # We have also seen this for Python 3.6.6 Nov 13 2018: + # | C:\Python36-x64\python.exe -u -mgevent.tests.test__backdoor + # ss.s.s + # ---------------------------------------------------------------------- + # Ran 6 tests in 0.953s + + # OK (skipped=4) + # Windows fatal exception: access violation + + # Thread 0x00000aec (most recent call first): + # File "C:\Python36-x64\lib\site-packages\gevent\_threading.py", line 84 in wait + # File "C:\Python36-x64\lib\site-packages\gevent\_threading.py", line 166 in get + # File "C:\Python36-x64\lib\site-packages\gevent\threadpool.py", line 270 in _worker + + # Thread 0x00000548 (most recent call first): + + # Thread 0x000003d0 (most recent call first): + # File "C:\Python36-x64\lib\site-packages\gevent\_threading.py", line 84 in wait + # File "C:\Python36-x64\lib\site-packages\gevent\_threading.py", line 166 in get + # File "C:\Python36-x64\lib\site-packages\gevent\threadpool.py", line 270 in _worker + + # Thread 0x00000ad0 (most recent call first): + + # Thread 0x00000588 (most recent call first): + # File "C:\Python36-x64\lib\site-packages\gevent\_threading.py", line 84 in wait + # File "C:\Python36-x64\lib\site-packages\gevent\_threading.py", line 166 in get + # File "C:\Python36-x64\lib\site-packages\gevent\threadpool.py", line 270 in _worker + + # Thread 0x00000a54 (most recent call first): + + # Thread 0x00000768 (most recent call first): + # File "C:\Python36-x64\lib\site-packages\gevent\_threading.py", line 84 in wait + # File "C:\Python36-x64\lib\site-packages\gevent\_threading.py", line 166 in get + # File "C:\Python36-x64\lib\site-packages\gevent\threadpool.py", line 270 in _worker + + # Current thread 0x00000894 (most recent call first): + # File "C:\Python36-x64\lib\site-packages\gevent\threadpool.py", line 261 in _worker + + # Thread 0x00000634 (most recent call first): + # File "C:\Python36-x64\lib\site-packages\gevent\_threading.py", line 84 in wait + # File "C:\Python36-x64\lib\site-packages\gevent\_threading.py", line 166 in get + # File "C:\Python36-x64\lib\site-packages\gevent\threadpool.py", line 270 in _worker + + # Thread 0x00000538 (most recent call first): + + # Thread 0x0000049c (most recent call first): + # File "C:\Python36-x64\lib\weakref.py", line 356 in remove + + # ! C:\Python36-x64\python.exe -u -mgevent.tests.test__backdoor [code 3221225477] [Ran 6 tests in 2.1s] + + # Note the common factors: + # - The test is finished (successfully) and we're apparently exiting the VM, + # doing GC + # - A weakref is being cleaned up + + # weakref.py line 356 remove() is in WeakKeyDictionary. We only use WeakKeyDictionary + # in gevent._ident.IdentRegistry, which is only used in two places: + # gevent.hub.hub_ident_registry, which has weak references to Hub objects, + # and gevent.greenlet.Greenlet.minimal_ident, which uses its parent Hub's + # IdentRegistry to get its own identifier. So basically they have weak references + # to Hub and arbitrary Greenlets. + + # Our attempted solution: stop using a module-level IdentRegistry to get + # Hub idents, and reduce how often we auto-generate one for greenlets. + # Commenting out the tests, lets see if it works. + #'FLAKY test__greenness.py', + #'FLAKY test__backdoor.py', + ] + + if not PY35: + # Py35 added socket.socketpair, all other releases + # are missing it. No reason to even test it. + IGNORED_TESTS += [ + 'test__socketpair.py', + ] + + if struct.calcsize('P') * 8 == 64: + # could be a problem of appveyor - not sure + # ====================================================================== + # ERROR: test_af (__main__.TestIPv6Environment) + # ---------------------------------------------------------------------- + # File "C:\Python27-x64\lib\ftplib.py", line 135, in connect + # self.sock = socket.create_connection((self.host, self.port), self.timeout) + # File "c:\projects\gevent\gevent\socket.py", line 73, in create_connection + # raise err + # error: [Errno 10049] [Error 10049] The requested address is not valid in its context. + # XXX: On Jan 3 2016 this suddenly started passing on Py27/64; no idea why, the python version + # was 2.7.11 before and after. + FAILING_TESTS.append('FLAKY test_ftplib.py') + + if PY3: + pass + + +if LEAKTEST: + FAILING_TESTS += [ + 'FLAKY test__backdoor.py', + 'FLAKY test__socket_errors.py', + ] + + if os.environ.get("TRAVIS") == "true": + FAILING_TESTS += [ + # On Travis, this very frequently fails due to timing + 'FLAKY test_signal.py', + ] + + +if PYPY: + FAILING_TESTS += [ + ## Different in PyPy: + + ## Not implemented: + + ## --- + + ## BUGS: + + ## UNKNOWN: + # AssertionError: '>>> ' != '' + # test__backdoor.py:52 + 'FLAKY test__backdoor.py', + ] + + if RESOLVER_NOT_SYSTEM: + + FAILING_TESTS += [ + # A few errors and differences: + # AssertionError: ('255.255.255.255', 'http') != gaierror(4, 'ARES_ENOTFOUND: Domain name not found') + # AssertionError: OverflowError('port must be 0-65535.',) != ('readthedocs.org', '65535') + # AssertionError: Lists differ: + # (10, 1, 6, '', ('2607:f8b0:4004:810::200e', 80, 0L, 0L)) + # (10, 1, 6, '', ('2607:f8b0:4004:805::200e', 80, 0, 0)) + 'test__socket_dns.py', + ] + + if LIBUV: + IGNORED_TESTS += [ + # This hangs for no apparent reason when run by the testrunner, + # even wher maked standalone + # when run standalone from the command line, it's fine. + # Issue in pypy2 6.0? + 'test__monkey_sigchld_2.py', + ] + + if TRAVIS: + FAILING_TESTS += [ + # This fails to get the correct results, sometimes. I can't reproduce locally + 'FLAKY test__example_udp_server.py', + 'FLAKY test__example_udp_client.py', + ] + + if LIBUV: + IGNORED_TESTS += [ + # XXX: Re-enable this when we can investigate more. + # This has started crashing with a SystemError. + # I cannot reproduce with the same version on macOS + # and I cannot reproduce with the same version in a Linux vm. + # Commenting out individual tests just moves the crash around. + # https://bitbucket.org/pypy/pypy/issues/2769/systemerror-unexpected-internal-exception + 'test__pywsgi.py', + ] + + IGNORED_TESTS += [ + # XXX Re-enable these when we have more time to investigate. + # This test, which normally takes ~60s, sometimes + # hangs forever after running several tests. I cannot reproduce, + # it seems highly load dependent. Observed with both libev and libuv. + 'test__threadpool.py', + # This test, which normally takes 4-5s, sometimes + # hangs forever after running two tests. I cannot reproduce, + # it seems highly load dependent. Observed with both libev and libuv. + 'test__threading_2.py', + ] + + if PY3 and TRAVIS: + FAILING_TESTS += [ + ## --- + + ## Unknown; can't reproduce locally on OS X + 'FLAKY test_subprocess.py', # timeouts on one test. + + 'FLAKY test_ssl.py', + ] + + +if LIBUV: + if sys.platform.startswith("darwin"): + FAILING_TESTS += [ + ] + +if PY3: + # No idea / TODO + FAILING_TESTS += [ + 'FLAKY test__socket_dns.py', + ] + + + +if sys.version_info[:2] >= (3, 4) and APPVEYOR: + FAILING_TESTS += [ + # Timing issues on appveyor + 'FLAKY test_selectors.py' + ] + + +if COVERAGE: + # The gevent concurrency plugin tends to slow things + # down and get us past our default timeout value. These + # tests in particular are sensitive to it + FAILING_TESTS += [ + 'FLAKY test__issue302monkey.py', + 'FLAKY test__example_portforwarder.py', + 'FLAKY test__threading_vs_settrace.py', + ] + +FAILING_TESTS = [x.strip() for x in set(FAILING_TESTS) if x.strip()] + + +# A mapping from test file basename to a dictionary of +# options that will be applied on top of the DEFAULT_RUN_OPTIONS. +TEST_FILE_OPTIONS = { + +} + + +# tests that don't do well when run on busy box +RUN_ALONE = [ + 'test__threadpool.py', + 'test__examples.py', +] + + + +if APPVEYOR or TRAVIS: + RUN_ALONE += [ + # Partial workaround for the _testcapi issue on PyPy, + # but also because signal delivery can sometimes be slow, and this + # spawn processes of its own + 'test_signal.py', + ] + + if LEAKTEST and PY3: + # On a heavily loaded box, these can all take upwards of 200s + RUN_ALONE += [ + 'test__pool.py', + 'test__pywsgi.py', + 'test__queue.py', + ] + + if PYPY: + # This often takes much longer on PyPy on CI. + TEST_FILE_OPTIONS['test__threadpool.py'] = {'timeout': 180} + TEST_FILE_OPTIONS['test__threading_2.py'] = {'timeout': 180} + if PY3: + RUN_ALONE += [ + # Sometimes shows unexpected timeouts + 'test_socket.py', + ] + if LIBUV: + RUN_ALONE += [ + # https://bitbucket.org/pypy/pypy/issues/2769/systemerror-unexpected-internal-exception + 'test__pywsgi.py', + ] + +# tests that can't be run when coverage is enabled +IGNORE_COVERAGE = [ + # Hangs forever + 'test__threading_vs_settrace.py', + # times out + 'test_socket.py', + # Doesn't get the exceptions it expects + 'test_selectors.py', + # XXX ? + 'test__issue302monkey.py', + "test_subprocess.py", +] + +if PYPY: + IGNORE_COVERAGE += [ + # Tends to timeout + 'test__refcount.py', + 'test__greenletset.py' + ] + +if __name__ == '__main__': + print('known_failures:\n', FAILING_TESTS) diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/lock_tests.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/lock_tests.py new file mode 100644 index 00000000..2c5a91bd --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/lock_tests.py @@ -0,0 +1,767 @@ +""" +Various tests for synchronization primitives. +""" +# pylint:disable=no-member,abstract-method +import sys +import time +try: + from thread import start_new_thread, get_ident +except ImportError: + from _thread import start_new_thread, get_ident +import threading +import unittest + +try: + from test import support +except ImportError: + from test import test_support as support + +from gevent.testing.testcase import TimeAssertMixin + +def _wait(): + # A crude wait/yield function not relying on synchronization primitives. + time.sleep(0.01) + +class Bunch(object): + """ + A bunch of threads. + """ + def __init__(self, f, n, wait_before_exit=False): + """ + Construct a bunch of `n` threads running the same function `f`. + If `wait_before_exit` is True, the threads won't terminate until + do_finish() is called. + """ + self.f = f + self.n = n + self.started = [] + self.finished = [] + self._can_exit = not wait_before_exit + def task(): + tid = get_ident() + self.started.append(tid) + try: + f() + finally: + self.finished.append(tid) + while not self._can_exit: + _wait() + for _ in range(n): + start_new_thread(task, ()) + + def wait_for_started(self): + while len(self.started) < self.n: + _wait() + + def wait_for_finished(self): + while len(self.finished) < self.n: + _wait() + + def do_finish(self): + self._can_exit = True + + +class BaseTestCase(TimeAssertMixin, unittest.TestCase): + def setUp(self): + self._threads = support.threading_setup() + + def tearDown(self): + support.threading_cleanup(*self._threads) + support.reap_children() + + +class BaseLockTests(BaseTestCase): + """ + Tests for both recursive and non-recursive locks. + """ + + def locktype(self): + raise NotImplementedError() + + def test_constructor(self): + lock = self.locktype() + del lock + + def test_acquire_destroy(self): + lock = self.locktype() + lock.acquire() + del lock + + def test_acquire_release(self): + lock = self.locktype() + lock.acquire() + lock.release() + del lock + + def test_try_acquire(self): + lock = self.locktype() + self.assertTrue(lock.acquire(False)) + lock.release() + + def test_try_acquire_contended(self): + lock = self.locktype() + lock.acquire() + result = [] + def f(): + result.append(lock.acquire(False)) + Bunch(f, 1).wait_for_finished() + self.assertFalse(result[0]) + lock.release() + + def test_acquire_contended(self): + lock = self.locktype() + lock.acquire() + N = 5 + def f(): + lock.acquire() + lock.release() + + b = Bunch(f, N) + b.wait_for_started() + _wait() + self.assertEqual(len(b.finished), 0) + lock.release() + b.wait_for_finished() + self.assertEqual(len(b.finished), N) + + def test_with(self): + lock = self.locktype() + def f(): + lock.acquire() + lock.release() + def _with(err=None): + with lock: + if err is not None: + raise err # pylint:disable=raising-bad-type + _with() + # Check the lock is unacquired + Bunch(f, 1).wait_for_finished() + self.assertRaises(TypeError, _with, TypeError) + # Check the lock is unacquired + Bunch(f, 1).wait_for_finished() + + def test_thread_leak(self): + # The lock shouldn't leak a Thread instance when used from a foreign + # (non-threading) thread. + lock = self.locktype() + def f(): + lock.acquire() + lock.release() + n = len(threading.enumerate()) + # We run many threads in the hope that existing threads ids won't + # be recycled. + Bunch(f, 15).wait_for_finished() + self.assertEqual(n, len(threading.enumerate())) + + +class LockTests(BaseLockTests): # pylint:disable=abstract-method + """ + Tests for non-recursive, weak locks + (which can be acquired and released from different threads). + """ + def test_reacquire(self): + # Lock needs to be released before re-acquiring. + lock = self.locktype() + phase = [] + def f(): + lock.acquire() + phase.append(None) + lock.acquire() + phase.append(None) + start_new_thread(f, ()) + while not phase: + _wait() + _wait() + self.assertEqual(len(phase), 1) + lock.release() + while len(phase) == 1: + _wait() + self.assertEqual(len(phase), 2) + + def test_different_thread(self): + # Lock can be released from a different thread. + lock = self.locktype() + lock.acquire() + def f(): + lock.release() + b = Bunch(f, 1) + b.wait_for_finished() + lock.acquire() + lock.release() + + +class RLockTests(BaseLockTests): + """ + Tests for recursive locks. + """ + def test_reacquire(self): + lock = self.locktype() + lock.acquire() + lock.acquire() + lock.release() + lock.acquire() + lock.release() + lock.release() + + def test_release_unacquired(self): + # Cannot release an unacquired lock + lock = self.locktype() + self.assertRaises(RuntimeError, lock.release) + lock.acquire() + lock.acquire() + lock.release() + lock.acquire() + lock.release() + lock.release() + self.assertRaises(RuntimeError, lock.release) + + def test_different_thread(self): + # Cannot release from a different thread + lock = self.locktype() + def f(): + lock.acquire() + b = Bunch(f, 1, True) + try: + self.assertRaises(RuntimeError, lock.release) + finally: + b.do_finish() + + def test__is_owned(self): + lock = self.locktype() + self.assertFalse(lock._is_owned()) + lock.acquire() + self.assertTrue(lock._is_owned()) + lock.acquire() + self.assertTrue(lock._is_owned()) + result = [] + def f(): + result.append(lock._is_owned()) + Bunch(f, 1).wait_for_finished() + self.assertFalse(result[0]) + lock.release() + self.assertTrue(lock._is_owned()) + lock.release() + self.assertFalse(lock._is_owned()) + + +class EventTests(BaseTestCase): + """ + Tests for Event objects. + """ + + def eventtype(self): + raise NotImplementedError() + + def test_is_set(self): + evt = self.eventtype() + self.assertFalse(evt.is_set()) + evt.set() + self.assertTrue(evt.is_set()) + evt.set() + self.assertTrue(evt.is_set()) + evt.clear() + self.assertFalse(evt.is_set()) + evt.clear() + self.assertFalse(evt.is_set()) + + def _check_notify(self, evt): + # All threads get notified + N = 5 + results1 = [] + results2 = [] + def f(): + evt.wait() + results1.append(evt.is_set()) + evt.wait() + results2.append(evt.is_set()) + b = Bunch(f, N) + b.wait_for_started() + _wait() + self.assertEqual(len(results1), 0) + evt.set() + b.wait_for_finished() + self.assertEqual(results1, [True] * N) + self.assertEqual(results2, [True] * N) + + def test_notify(self): + evt = self.eventtype() + self._check_notify(evt) + # Another time, after an explicit clear() + evt.set() + evt.clear() + self._check_notify(evt) + + def test_timeout(self): + evt = self.eventtype() + results1 = [] + results2 = [] + N = 5 + def f(): + evt.wait(0.0) + results1.append(evt.is_set()) + t1 = time.time() + evt.wait(0.2) + r = evt.is_set() + t2 = time.time() + results2.append((r, t2 - t1)) + Bunch(f, N).wait_for_finished() + self.assertEqual(results1, [False] * N) + for r, dt in results2: + self.assertFalse(r) + self.assertTimeWithinRange(dt, 0.18, 10) + # The event is set + results1 = [] + results2 = [] + evt.set() + Bunch(f, N).wait_for_finished() + self.assertEqual(results1, [True] * N) + for r, dt in results2: + self.assertTrue(r) + + +class ConditionTests(BaseTestCase): + """ + Tests for condition variables. + """ + + def condtype(self, *args): + raise NotImplementedError() + + def test_acquire(self): + cond = self.condtype() + # Be default we have an RLock: the condition can be acquired multiple + # times. + cond.acquire() + cond.acquire() + cond.release() + cond.release() + lock = threading.Lock() + cond = self.condtype(lock) + cond.acquire() + self.assertFalse(lock.acquire(False)) + cond.release() + self.assertTrue(lock.acquire(False)) + self.assertFalse(cond.acquire(False)) + lock.release() + with cond: + self.assertFalse(lock.acquire(False)) + + def test_unacquired_wait(self): + cond = self.condtype() + self.assertRaises(RuntimeError, cond.wait) + + def test_unacquired_notify(self): + cond = self.condtype() + self.assertRaises(RuntimeError, cond.notify) + + def _check_notify(self, cond): + N = 5 + results1 = [] + results2 = [] + phase_num = 0 + def f(): + cond.acquire() + cond.wait() + cond.release() + results1.append(phase_num) + cond.acquire() + cond.wait() + cond.release() + results2.append(phase_num) + b = Bunch(f, N) + b.wait_for_started() + _wait() + self.assertEqual(results1, []) + # Notify 3 threads at first + cond.acquire() + cond.notify(3) + _wait() + phase_num = 1 + cond.release() + while len(results1) < 3: + _wait() + self.assertEqual(results1, [1] * 3) + self.assertEqual(results2, []) + # Notify 5 threads: they might be in their first or second wait + cond.acquire() + cond.notify(5) + _wait() + phase_num = 2 + cond.release() + while len(results1) + len(results2) < 8: + _wait() + self.assertEqual(results1, [1] * 3 + [2] * 2) + self.assertEqual(results2, [2] * 3) + # Notify all threads: they are all in their second wait + cond.acquire() + cond.notify_all() + _wait() + phase_num = 3 + cond.release() + while len(results2) < 5: + _wait() + self.assertEqual(results1, [1] * 3 + [2] * 2) + self.assertEqual(results2, [2] * 3 + [3] * 2) + b.wait_for_finished() + + def test_notify(self): + cond = self.condtype() + self._check_notify(cond) + # A second time, to check internal state is still ok. + self._check_notify(cond) + + def test_timeout(self): + cond = self.condtype() + results = [] + N = 5 + def f(): + cond.acquire() + t1 = time.time() + cond.wait(0.2) + t2 = time.time() + cond.release() + results.append(t2 - t1) + Bunch(f, N).wait_for_finished() + self.assertEqual(len(results), 5) + for dt in results: + # XXX: libuv sometimes produces 0.19958 + self.assertTimeWithinRange(dt, 0.19, 2.0) + + +class BaseSemaphoreTests(BaseTestCase): + """ + Common tests for {bounded, unbounded} semaphore objects. + """ + + def semtype(self, *args): + raise NotImplementedError() + + def test_constructor(self): + self.assertRaises(ValueError, self.semtype, value=-1) + # Py3 doesn't have sys.maxint + self.assertRaises(ValueError, self.semtype, + value=-getattr(sys, 'maxint', getattr(sys, 'maxsize', None))) + + def test_acquire(self): + sem = self.semtype(1) + sem.acquire() + sem.release() + sem = self.semtype(2) + sem.acquire() + sem.acquire() + sem.release() + sem.release() + + def test_acquire_destroy(self): + sem = self.semtype() + sem.acquire() + del sem + + def test_acquire_contended(self): + sem = self.semtype(7) + sem.acquire() + #N = 10 + results1 = [] + results2 = [] + phase_num = 0 + def f(): + sem.acquire() + results1.append(phase_num) + sem.acquire() + results2.append(phase_num) + b = Bunch(f, 10) + b.wait_for_started() + while len(results1) + len(results2) < 6: + _wait() + self.assertEqual(results1 + results2, [0] * 6) + phase_num = 1 + for _ in range(7): + sem.release() + while len(results1) + len(results2) < 13: + _wait() + self.assertEqual(sorted(results1 + results2), [0] * 6 + [1] * 7) + phase_num = 2 + for _ in range(6): + sem.release() + while len(results1) + len(results2) < 19: + _wait() + self.assertEqual(sorted(results1 + results2), [0] * 6 + [1] * 7 + [2] * 6) + # The semaphore is still locked + self.assertFalse(sem.acquire(False)) + # Final release, to let the last thread finish + sem.release() + b.wait_for_finished() + + def test_try_acquire(self): + sem = self.semtype(2) + self.assertTrue(sem.acquire(False)) + self.assertTrue(sem.acquire(False)) + self.assertFalse(sem.acquire(False)) + sem.release() + self.assertTrue(sem.acquire(False)) + + def test_try_acquire_contended(self): + sem = self.semtype(4) + sem.acquire() + results = [] + def f(): + results.append(sem.acquire(False)) + results.append(sem.acquire(False)) + Bunch(f, 5).wait_for_finished() + # There can be a thread switch between acquiring the semaphore and + # appending the result, therefore results will not necessarily be + # ordered. + self.assertEqual(sorted(results), [False] * 7 + [True] * 3) + + def test_default_value(self): + # The default initial value is 1. + sem = self.semtype() + sem.acquire() + def f(): + sem.acquire() + sem.release() + b = Bunch(f, 1) + b.wait_for_started() + _wait() + self.assertFalse(b.finished) + sem.release() + b.wait_for_finished() + + def test_with(self): + sem = self.semtype(2) + def _with(err=None): + with sem: + self.assertTrue(sem.acquire(False)) + sem.release() + with sem: + self.assertFalse(sem.acquire(False)) + if err: + raise err # pylint:disable=raising-bad-type + _with() + self.assertTrue(sem.acquire(False)) + sem.release() + self.assertRaises(TypeError, _with, TypeError) + self.assertTrue(sem.acquire(False)) + sem.release() + +class SemaphoreTests(BaseSemaphoreTests): + """ + Tests for unbounded semaphores. + """ + + def test_release_unacquired(self): + # Unbounded releases are allowed and increment the semaphore's value + sem = self.semtype(1) + sem.release() + sem.acquire() + sem.acquire() + sem.release() + + +class BoundedSemaphoreTests(BaseSemaphoreTests): + """ + Tests for bounded semaphores. + """ + + def test_release_unacquired(self): + # Cannot go past the initial value + sem = self.semtype() + self.assertRaises(ValueError, sem.release) + sem.acquire() + sem.release() + self.assertRaises(ValueError, sem.release) + +class BarrierTests(BaseTestCase): + """ + Tests for Barrier objects. + """ + N = 5 + defaultTimeout = 2.0 + + def setUp(self): + self.barrier = self.barriertype(self.N, timeout=self.defaultTimeout) + def tearDown(self): + self.barrier.abort() + + def run_threads(self, f): + b = Bunch(f, self.N-1) + f() + b.wait_for_finished() + + def multipass(self, results, n): + m = self.barrier.parties + self.assertEqual(m, self.N) + for i in range(n): + results[0].append(True) + self.assertEqual(len(results[1]), i * m) + self.barrier.wait() + results[1].append(True) + self.assertEqual(len(results[0]), (i + 1) * m) + self.barrier.wait() + self.assertEqual(self.barrier.n_waiting, 0) + self.assertFalse(self.barrier.broken) + + def test_barrier(self, passes=1): + """ + Test that a barrier is passed in lockstep + """ + results = [[], []] + def f(): + self.multipass(results, passes) + self.run_threads(f) + + def test_barrier_10(self): + """ + Test that a barrier works for 10 consecutive runs + """ + return self.test_barrier(10) + + def test_wait_return(self): + """ + test the return value from barrier.wait + """ + results = [] + def f(): + r = self.barrier.wait() + results.append(r) + + self.run_threads(f) + self.assertEqual(sum(results), sum(range(self.N))) + + def test_action(self): + """ + Test the 'action' callback + """ + results = [] + def action(): + results.append(True) + barrier = self.barriertype(self.N, action) + def f(): + barrier.wait() + self.assertEqual(len(results), 1) + + self.run_threads(f) + + def test_abort(self): + """ + Test that an abort will put the barrier in a broken state + """ + results1 = [] + results2 = [] + def f(): + try: + i = self.barrier.wait() + if i == self.N//2: + raise RuntimeError + self.barrier.wait() + results1.append(True) + except threading.BrokenBarrierError: + results2.append(True) + except RuntimeError: + self.barrier.abort() + + self.run_threads(f) + self.assertEqual(len(results1), 0) + self.assertEqual(len(results2), self.N-1) + self.assertTrue(self.barrier.broken) + + def test_reset(self): + """ + Test that a 'reset' on a barrier frees the waiting threads + """ + results1 = [] + results2 = [] + results3 = [] + def f(): + i = self.barrier.wait() + if i == self.N//2: + # Wait until the other threads are all in the barrier. + while self.barrier.n_waiting < self.N-1: + time.sleep(0.001) + self.barrier.reset() + else: + try: + self.barrier.wait() + results1.append(True) + except threading.BrokenBarrierError: + results2.append(True) + # Now, pass the barrier again + self.barrier.wait() + results3.append(True) + + self.run_threads(f) + self.assertEqual(len(results1), 0) + self.assertEqual(len(results2), self.N-1) + self.assertEqual(len(results3), self.N) + + + def test_abort_and_reset(self): + """ + Test that a barrier can be reset after being broken. + """ + results1 = [] + results2 = [] + results3 = [] + barrier2 = self.barriertype(self.N) + def f(): + try: + i = self.barrier.wait() + if i == self.N//2: + raise RuntimeError + self.barrier.wait() + results1.append(True) + except threading.BrokenBarrierError: + results2.append(True) + except RuntimeError: + self.barrier.abort() + + # Synchronize and reset the barrier. Must synchronize first so + # that everyone has left it when we reset, and after so that no + # one enters it before the reset. + if barrier2.wait() == self.N//2: + self.barrier.reset() + barrier2.wait() + self.barrier.wait() + results3.append(True) + + self.run_threads(f) + self.assertEqual(len(results1), 0) + self.assertEqual(len(results2), self.N-1) + self.assertEqual(len(results3), self.N) + + def test_timeout(self): + """ + Test wait(timeout) + """ + def f(): + i = self.barrier.wait() + if i == self.N // 2: + # One thread is late! + time.sleep(1.0) + # Default timeout is 2.0, so this is shorter. + self.assertRaises(threading.BrokenBarrierError, + self.barrier.wait, 0.5) + self.run_threads(f) + + def test_default_timeout(self): + """ + Test the barrier's default timeout + """ + # create a barrier with a low default timeout + barrier = self.barriertype(self.N, timeout=0.3) + def f(): + i = barrier.wait() + if i == self.N // 2: + # One thread is later than the default timeout of 0.3s. + time.sleep(1.0) + self.assertRaises(threading.BrokenBarrierError, barrier.wait) + self.run_threads(f) + + def test_single_thread(self): + b = self.barriertype(1) + b.wait() + b.wait() + + +if __name__ == '__main__': + print("This module contains no tests; it is used by other test cases like test_threading_2") diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/monkey_package/__main__.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/monkey_package/__main__.py new file mode 100644 index 00000000..316d16fc --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/monkey_package/__main__.py @@ -0,0 +1,5 @@ +from __future__ import print_function +# This file makes this directory into a package. +# it exists to test 'python -m gevent.monkey monkey_package' +print(__file__) +print(__name__) diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/monkey_package/issue302monkey.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/monkey_package/issue302monkey.py new file mode 100644 index 00000000..73b5d1ff --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/monkey_package/issue302monkey.py @@ -0,0 +1,28 @@ +from __future__ import print_function +import socket +import sys +if sys.argv[1] == 'patched': + print('gevent' in repr(socket.socket)) +else: + assert sys.argv[1] == 'stdlib' + print('gevent' not in repr(socket.socket)) +print(__file__) + +if sys.version_info[:2] == (2, 7): + # Prior to gevent 1.3, 'python -m gevent.monkey' guaranteed this to be + # None for all python versions. + print(__package__ == None) +else: + if sys.argv[1] == 'patched': + # __package__ is handled differently, for some reason, and + # runpy doesn't let us override it. When we call it, it + # becomes ''. This appears to be against the documentation for + # runpy, which says specifically "If the supplied path + # directly references a script file (whether as source or as + # precompiled byte code), then __file__ will be set to the + # supplied path, and __spec__, __cached__, __loader__ and + # __package__ will all be set to None." + print(__package__ == '') + else: + # but the interpreter sets it to None + print(__package__ == None) diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/monkey_package/script.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/monkey_package/script.py new file mode 100644 index 00000000..8584fb7d --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/monkey_package/script.py @@ -0,0 +1,19 @@ +# -*- coding: utf-8 -*- +""" +Test script file, to be used directly as a file. +""" +from __future__ import absolute_import +from __future__ import division +from __future__ import print_function + + +# We need some global imports +from textwrap import dedent + +def use_import(): + return dedent(" text") + +if __name__ == '__main__': + print(__file__) + print(__name__) + print(use_import()) diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/nullcert.pem b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/nullcert.pem new file mode 100644 index 00000000..e69de29b diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/server.crt b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/server.crt new file mode 100644 index 00000000..1379e1d1 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/server.crt @@ -0,0 +1,15 @@ +-----BEGIN CERTIFICATE----- +MIICYzCCAcwCCQD5jx1Aa0dytjANBgkqhkiG9w0BAQQFADB2MQswCQYDVQQGEwJU +UzENMAsGA1UECBMEVGVzdDENMAsGA1UEBxMEVGVzdDEWMBQGA1UEChMNVGVzdCBF +dmVudGxldDENMAsGA1UECxMEVGVzdDENMAsGA1UEAxMEVGVzdDETMBEGCSqGSIb3 +DQEJARYEVGVzdDAeFw0wODA3MDgyMTExNDJaFw0xMDAyMDgwODE1MTBaMHYxCzAJ +BgNVBAYTAlRTMQ0wCwYDVQQIEwRUZXN0MQ0wCwYDVQQHEwRUZXN0MRYwFAYDVQQK +Ew1UZXN0IEV2ZW50bGV0MQ0wCwYDVQQLEwRUZXN0MQ0wCwYDVQQDEwRUZXN0MRMw +EQYJKoZIhvcNAQkBFgRUZXN0MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDM +WcyeIiHQuEGQxgTIvu0aOW4iRFAyUEi8pLWNCxMEHglF8k6OxFVq7XWZMDnDFVnb +ZjmQh5Tc21Ae6cXzxXln578fROXHEzXo3Is8HUlq3ug1yYOGHjxw++Opjf1uoHwP +EBUKsz/flS7knuscgFM9FO05KSPn2wHnZeIDta4yTwIDAQABMA0GCSqGSIb3DQEB +BAUAA4GBAKM71aP0r26gEEEBzovfXm1IwKav6R9/xiWsJ4pFsUXVotcaIjcVBDG1 +Z7tz688hokb+GNxsTI2gNfqanqUnfP9wZxnKRmfTSOvb5aWHIiaiMXSgjiPlqBcm +6mnSeEbSMM9cw479wWhh1YqY8tf3gYJa+sxznVWLSfVLpsjRMphe +-----END CERTIFICATE----- diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/server.key b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/server.key new file mode 100644 index 00000000..24cd8e5a --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/server.key @@ -0,0 +1,15 @@ +-----BEGIN RSA PRIVATE KEY----- +MIICXgIBAAKBgQDMWcyeIiHQuEGQxgTIvu0aOW4iRFAyUEi8pLWNCxMEHglF8k6O +xFVq7XWZMDnDFVnbZjmQh5Tc21Ae6cXzxXln578fROXHEzXo3Is8HUlq3ug1yYOG +Hjxw++Opjf1uoHwPEBUKsz/flS7knuscgFM9FO05KSPn2wHnZeIDta4yTwIDAQAB +AoGBAKWfvq0IIvok7Ncm92ew/0D6/R1+2rT8xwdGQ/Nt31q98WwkqLEjxctlbKPd +J2PLIUomf0955BhhFH4JoSwjiHJQ6uishY7srjQQDX/Dxdi5wZAyxYCIVW/kAA9N +/u2s75hSD3s/rqAwOZ182DwAPIqJc4KQoYzvlKERSMDT1PJhAkEA5SUFsiSzBEMX +FyZ++ZMMs1vHrTu5oTK7WHznh9lk7dvsnp9BoUPqhiu8iJ7Q23zj0u5asz2czu11 +nnczXgU6XwJBAORM5Ib4I7nAsoUWn9wDiTwVQeE+D9P1ac9p7EHm7XXuf8o2irRZ +wYYfpXXsjk496YfyQFcQRMk0tU0gegCP7hECQFWRWqwoajUoPIInnPjjwbVki48U +I4CfqjgkBG3Fb5wnKRgezmpDK1vJD1FRRRsBay4EVhhi5KCdKfPv/V2ZxC8CQQCu +U5SxBytofJ8UhxkcTErvaR/8GYLGi//21GAGVop+YdaMlydE3cCrZODYcgCb+CSp +nS7KDG8p4KiMMz9VzJGxAkEAv85K6Sa3H8g9h7LwopBZ5tFNZUaFWo7lEP7DDMH0 +eckZTb1JVpyT/8zrDtsis4WlV9zVkVHxkIaad503BjqvEQ== +-----END RSA PRIVATE KEY----- diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/sha256.pem b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/sha256.pem new file mode 100644 index 00000000..01878e96 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/sha256.pem @@ -0,0 +1,33 @@ +-----BEGIN CERTIFICATE----- +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 +-----END CERTIFICATE----- diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__GreenletExit.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__GreenletExit.py new file mode 100644 index 00000000..acad1bb1 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__GreenletExit.py @@ -0,0 +1,4 @@ +from gevent import GreenletExit + +assert issubclass(GreenletExit, BaseException) +assert not issubclass(GreenletExit, Exception) diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test___config.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test___config.py new file mode 100644 index 00000000..316e03a8 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test___config.py @@ -0,0 +1,154 @@ +# Copyright 2018 gevent contributors. See LICENSE for details. + +import os +import unittest +import sys + +from gevent import _config + +class TestResolver(unittest.TestCase): + + old_resolver = None + + def setUp(self): + if 'GEVENT_RESOLVER' in os.environ: + self.old_resolver = os.environ['GEVENT_RESOLVER'] + del os.environ['GEVENT_RESOLVER'] + + def tearDown(self): + if self.old_resolver: + os.environ['GEVENT_RESOLVER'] = self.old_resolver + + def test_key(self): + self.assertEqual(_config.Resolver.environment_key, 'GEVENT_RESOLVER') + + def test_default(self): + from gevent.resolver.thread import Resolver + + conf = _config.Resolver() + self.assertEqual(conf.get(), Resolver) + + def test_env(self): + from gevent.resolver.blocking import Resolver + + os.environ['GEVENT_RESOLVER'] = 'foo,bar,block,dnspython' + + conf = _config.Resolver() + self.assertEqual(conf.get(), Resolver) + + os.environ['GEVENT_RESOLVER'] = 'dnspython' + + # The existing value is unchanged + self.assertEqual(conf.get(), Resolver) + + # A new object reflects it + conf = _config.Resolver() + from gevent.resolver.dnspython import Resolver as DResolver + self.assertEqual(conf.get(), DResolver) + + def test_set_str_long(self): + from gevent.resolver.blocking import Resolver + conf = _config.Resolver() + conf.set('gevent.resolver.blocking.Resolver') + + self.assertEqual(conf.get(), Resolver) + + def test_set_str_short(self): + from gevent.resolver.blocking import Resolver + conf = _config.Resolver() + conf.set('block') + + self.assertEqual(conf.get(), Resolver) + + def test_set_class(self): + from gevent.resolver.blocking import Resolver + conf = _config.Resolver() + conf.set(Resolver) + + self.assertEqual(conf.get(), Resolver) + + + def test_set_through_config(self): + from gevent.resolver.thread import Resolver as Default + from gevent.resolver.blocking import Resolver + + conf = _config.Config() + self.assertEqual(conf.resolver, Default) + + conf.resolver = 'block' + self.assertEqual(conf.resolver, Resolver) + +class TestFunctions(unittest.TestCase): + + def test_validate_bool(self): + self.assertTrue(_config.validate_bool('on')) + self.assertTrue(_config.validate_bool('1')) + self.assertFalse(_config.validate_bool('off')) + self.assertFalse(_config.validate_bool('0')) + self.assertFalse(_config.validate_bool('')) + + with self.assertRaises(ValueError): + _config.validate_bool(' hmm ') + + def test_validate_invalid(self): + with self.assertRaises(ValueError): + _config.validate_invalid(self) + +class TestConfig(unittest.TestCase): + + def test__dir__(self): + self.assertEqual(sorted(_config.config.settings), + sorted(dir(_config.config))) + + def test_getattr(self): + # Bypass the property that might be set here + self.assertIsNotNone(_config.config.__getattr__('resolver')) + + def test__getattr__invalid(self): + with self.assertRaises(AttributeError): + getattr(_config.config, 'no_such_setting') + + def test_set_invalid(self): + with self.assertRaises(AttributeError): + _config.config.set('no such setting', True) + +class TestImportableSetting(unittest.TestCase): + + assertRaisesRegex = getattr(unittest.TestCase, 'assertRaisesRegex', + unittest.TestCase.assertRaisesRegexp) + def test_empty_list(self): + i = _config.ImportableSetting() + with self.assertRaisesRegex(ImportError, + "Cannot import from empty list"): + i._import_one_of([]) + + def test_path_not_supported(self): + import warnings + i = _config.ImportableSetting() + path = list(sys.path) + with warnings.catch_warnings(record=True) as w: + warnings.simplefilter("always") + with self.assertRaisesRegex(ImportError, + "Cannot import 'foo/bar/gevent.no_such_module'"): + i._import_one('foo/bar/gevent.no_such_module') + + # We restored the path + self.assertEqual(path, sys.path) + + # We did not issue a warning + self.assertEqual(len(w), 0) + + def test_non_string(self): + i = _config.ImportableSetting() + self.assertIs(i._import_one(self), self) + + def test_get_options(self): + i = _config.ImportableSetting() + self.assertEqual({}, i.get_options()) + + i.shortname_map = {'foo': 'bad/path'} + options = i.get_options() + self.assertIn('foo', options) + +if __name__ == '__main__': + unittest.main() diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test___example_servers.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test___example_servers.py new file mode 100644 index 00000000..2b3453ce --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test___example_servers.py @@ -0,0 +1,141 @@ +import sys + +try: + from urllib import request as urllib2 +except ImportError: + import urllib2 +from unittest import SkipTest + +import socket +import ssl + +import gevent.testing as greentest +from gevent.testing import DEFAULT_XPC_SOCKET_TIMEOUT +from gevent.testing import util +from gevent.testing import params + +@greentest.skipOnCI("Timing issues sometimes lead to a connection refused") +class Test_wsgiserver(util.TestServer): + server = 'wsgiserver.py' + URL = 'http://%s:8088' % (params.DEFAULT_LOCAL_HOST_ADDR,) + PORT = 8088 + not_found_message = b'

Not Found

' + ssl_ctx = None + _use_ssl = False + + def read(self, path='/'): + url = self.URL + path + try: + kwargs = {} + if self.ssl_ctx is not None: + kwargs = {'context': self.ssl_ctx} + + response = urllib2.urlopen(url, None, + DEFAULT_XPC_SOCKET_TIMEOUT, + **kwargs) + except urllib2.HTTPError: + response = sys.exc_info()[1] + result = '%s %s' % (response.code, response.msg), response.read() + # XXX: It looks like under PyPy this isn't directly closing the socket + # when SSL is in use. It takes a GC cycle to make that true. + response.close() + return result + + def _test_hello(self): + status, data = self.read('/') + self.assertEqual(status, '200 OK') + self.assertEqual(data, b"hello world") + + def _test_not_found(self): + status, data = self.read('/xxx') + self.assertEqual(status, '404 Not Found') + self.assertEqual(data, self.not_found_message) + + def _do_test_a_blocking_client(self): + # We spawn this in a separate server because if it's broken + # the whole server hangs + with self.running_server(): + # First, make sure we can talk to it. + self._test_hello() + # Now create a connection and only partway finish + # the transaction + sock = socket.create_connection(('localhost', self.PORT)) + ssl_sock = None + if self._use_ssl: + ssl_sock = ssl.wrap_socket(sock) + sock_file = ssl_sock.makefile(mode='rwb') + else: + sock_file = sock.makefile(mode='rwb') + # write an incomplete request + sock_file.write(b'GET /xxx HTTP/1.0\r\n') + sock_file.flush() + # Leave it open and not doing anything + # while the other request runs to completion. + # This demonstrates that a blocking client + # doesn't hang the whole server + self._test_hello() + + # now finish the original request + sock_file.write(b'\r\n') + sock_file.flush() + line = sock_file.readline() + self.assertEqual(line, b'HTTP/1.1 404 Not Found\r\n') + + sock_file.close() + if ssl_sock is not None: + ssl_sock.close() + sock.close() + + def test_a_blocking_client(self): + self._do_test_a_blocking_client() + +@greentest.skipOnCI("Timing issues sometimes lead to a connection refused") +class Test_wsgiserver_ssl(Test_wsgiserver): + server = 'wsgiserver_ssl.py' + URL = 'https://%s:8443' % (params.DEFAULT_LOCAL_HOST_ADDR,) + PORT = 8443 + _use_ssl = True + + if hasattr(ssl, '_create_unverified_context'): + # Disable verification for our self-signed cert + # on Python >= 2.7.9 and 3.4 + ssl_ctx = ssl._create_unverified_context() + + +@greentest.skipOnCI("Timing issues sometimes lead to a connection refused") +class Test_webproxy(Test_wsgiserver): + server = 'webproxy.py' + + def _run_all_tests(self): + status, data = self.read('/') + self.assertEqual(status, '200 OK') + self.assertIn(b"gevent example", data) + status, data = self.read('/http://www.google.com') + self.assertEqual(status, '200 OK') + self.assertIn(b'google', data.lower()) + + def test_a_blocking_client(self): + # Not applicable + raise SkipTest("Not applicable") + + +# class Test_webpy(Test_wsgiserver): +# server = 'webpy.py' +# not_found_message = 'not found' +# +# def _test_hello(self): +# status, data = self.read('/') +# self.assertEqual(status, '200 OK') +# assert "Hello, world" in data, repr(data) +# +# def _test_long(self): +# start = time.time() +# status, data = self.read('/long') +# delay = time.time() - start +# assert 10 - 0.5 < delay < 10 + 0.5, delay +# self.assertEqual(status, '200 OK') +# self.assertEqual(data, 'Hello, 10 seconds later') + + +if __name__ == '__main__': + greentest.main() diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test___ident.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test___ident.py new file mode 100644 index 00000000..aa82d419 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test___ident.py @@ -0,0 +1,80 @@ +# -*- coding: utf-8 -*- +# copyright 2018 gevent contributors. See LICENSE for details. + +from __future__ import absolute_import +from __future__ import division +from __future__ import print_function + +import gc + + +import gevent.testing as greentest +from gevent._ident import IdentRegistry +from gevent._compat import PYPY + +class Target(object): + pass + +class TestIdent(greentest.TestCase): + + def setUp(self): + self.reg = IdentRegistry() + + def tearDown(self): + self.reg = None + + def test_basic(self): + target = Target() + self.assertEqual(0, self.reg.get_ident(target)) + self.assertEqual(1, len(self.reg)) + + self.assertEqual(0, self.reg.get_ident(target)) + self.assertEqual(1, len(self.reg)) + + target2 = Target() + self.assertEqual(1, self.reg.get_ident(target2)) + self.assertEqual(2, len(self.reg)) + + self.assertEqual(1, self.reg.get_ident(target2)) + self.assertEqual(2, len(self.reg)) + + self.assertEqual(0, self.reg.get_ident(target)) + + # When an object dies, we can re-use + # its id. Under PyPy we need to collect garbage first. + del target + if PYPY: + for _ in range(3): + gc.collect() + + self.assertEqual(1, len(self.reg)) + + target3 = Target() + self.assertEqual(1, self.reg.get_ident(target2)) + self.assertEqual(0, self.reg.get_ident(target3)) + self.assertEqual(2, len(self.reg)) + + @greentest.skipOnPyPy("This would need to GC very frequently") + def test_circle(self): + keep_count = 3 + keepalive = [None] * keep_count + + for i in range(1000): + target = Target() + # Drop an old one. + keepalive[i % keep_count] = target + self.assertLessEqual(self.reg.get_ident(target), keep_count) + + +@greentest.skipOnPurePython("Needs C extension") +class TestCExt(greentest.TestCase): + + def test_c_extension(self): + self.assertEqual(IdentRegistry.__module__, + 'gevent.__ident') + + + + +if __name__ == '__main__': + greentest.main() diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test___monitor.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test___monitor.py new file mode 100644 index 00000000..e5a003a8 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test___monitor.py @@ -0,0 +1,386 @@ +# Copyright 2018 gevent contributors. See LICENSE for details. + +import gc +import unittest + + +from greenlet import gettrace +from greenlet import settrace + +from gevent.monkey import get_original +from gevent._compat import thread_mod_name +from gevent._compat import NativeStrIO + +from gevent.testing.skipping import skipOnPyPyOnWindows + +from gevent import _monitor as monitor +from gevent import config as GEVENT_CONFIG + +get_ident = get_original(thread_mod_name, 'get_ident') + +class MockHub(object): + _threadpool = None + _resolver = None + + def __init__(self): + self.thread_ident = get_ident() + self.exception_stream = NativeStrIO() + self.dead = False + + def __bool__(self): + return not self.dead + + __nonzero__ = __bool__ + + def handle_error(self, *args): # pylint:disable=unused-argument + raise # pylint:disable=misplaced-bare-raise + + @property + def loop(self): + return self + + def reinit(self): + "mock loop.reinit" + +class _AbstractTestPeriodicMonitoringThread(object): + # Makes sure we don't actually spin up a new monitoring thread. + + # pylint:disable=no-member + + def setUp(self): + super(_AbstractTestPeriodicMonitoringThread, self).setUp() + self._orig_start_new_thread = monitor.start_new_thread + self._orig_thread_sleep = monitor.thread_sleep + monitor.thread_sleep = lambda _s: gc.collect() # For PyPy + self.tid = 0xDEADBEEF + def start_new_thread(_f, _a): + r = self.tid + self.tid += 1 + return r + + monitor.start_new_thread = start_new_thread + self.hub = MockHub() + self.pmt = monitor.PeriodicMonitoringThread(self.hub) + self.hub.periodic_monitoring_thread = self.pmt + self.pmt_default_funcs = self.pmt.monitoring_functions()[:] + self.len_pmt_default_funcs = len(self.pmt_default_funcs) + + def tearDown(self): + monitor.start_new_thread = self._orig_start_new_thread + monitor.thread_sleep = self._orig_thread_sleep + prev = self.pmt._greenlet_tracer.previous_trace_function + self.pmt.kill() + assert gettrace() is prev, (gettrace(), prev) + settrace(None) + super(_AbstractTestPeriodicMonitoringThread, self).tearDown() + + +class TestPeriodicMonitoringThread(_AbstractTestPeriodicMonitoringThread, + unittest.TestCase): + + def test_constructor(self): + self.assertEqual(0xDEADBEEF, self.pmt.monitor_thread_ident) + self.assertEqual(gettrace(), self.pmt._greenlet_tracer) + + @skipOnPyPyOnWindows("psutil doesn't install on PyPy on Win") + def test_get_process(self): + proc = self.pmt._get_process() + self.assertIsNotNone(proc) + self.assertIs(proc, self.pmt._get_process()) + + def test_hub_wref(self): + self.assertIs(self.hub, self.pmt.hub) + del self.hub + + gc.collect() + self.assertIsNone(self.pmt.hub) + + # And it killed itself. + self.assertFalse(self.pmt.should_run) + self.assertIsNone(gettrace()) + + + def test_add_monitoring_function(self): + + self.assertRaises(ValueError, self.pmt.add_monitoring_function, None, 1) + self.assertRaises(ValueError, self.pmt.add_monitoring_function, lambda: None, -1) + + def f(): + "Does nothing" + + # Add + self.pmt.add_monitoring_function(f, 1) + self.assertEqual(self.len_pmt_default_funcs + 1, len(self.pmt.monitoring_functions())) + self.assertEqual(1, self.pmt.monitoring_functions()[1].period) + + # Update + self.pmt.add_monitoring_function(f, 2) + self.assertEqual(self.len_pmt_default_funcs + 1, len(self.pmt.monitoring_functions())) + self.assertEqual(2, self.pmt.monitoring_functions()[1].period) + + # Remove + self.pmt.add_monitoring_function(f, None) + self.assertEqual(self.len_pmt_default_funcs, len(self.pmt.monitoring_functions())) + + def test_calculate_sleep_time(self): + self.assertEqual( + self.pmt.monitoring_functions()[0].period, + self.pmt.calculate_sleep_time()) + + # Pretend that GEVENT_CONFIG.max_blocking_time was set to 0, + # to disable this monitor. + self.pmt._calculated_sleep_time = 0 + self.assertEqual( + self.pmt.inactive_sleep_time, + self.pmt.calculate_sleep_time() + ) + + # Getting the list of monitoring functions will also + # do this, if it looks like it has changed + self.pmt.monitoring_functions()[0].period = -1 + self.pmt._calculated_sleep_time = 0 + self.pmt.monitoring_functions() + self.assertEqual( + self.pmt.monitoring_functions()[0].period, + self.pmt.calculate_sleep_time()) + self.assertEqual( + self.pmt.monitoring_functions()[0].period, + self.pmt._calculated_sleep_time) + + def test_call_destroyed_hub(self): + # Add a function that destroys the hub so we break out (eventually) + # This clears the wref, which eventually calls kill() + def f(_hub): + _hub = None + self.hub = None + gc.collect() + + self.pmt.add_monitoring_function(f, 0.1) + self.pmt() + self.assertFalse(self.pmt.should_run) + + def test_call_dead_hub(self): + # Add a function that makes the hub go false (e.g., it quit) + # This causes the function to kill itself. + def f(hub): + hub.dead = True + self.pmt.add_monitoring_function(f, 0.1) + self.pmt() + self.assertFalse(self.pmt.should_run) + + def test_call_SystemExit(self): + # breaks the loop + def f(_hub): + raise SystemExit() + + self.pmt.add_monitoring_function(f, 0.1) + self.pmt() + + def test_call_other_error(self): + class MyException(Exception): + pass + + def f(_hub): + raise MyException() + + self.pmt.add_monitoring_function(f, 0.1) + with self.assertRaises(MyException): + self.pmt() + + def test_hub_reinit(self): + import os + from gevent.hub import reinit + self.pmt.pid = -1 + old_tid = self.pmt.monitor_thread_ident + + reinit(self.hub) + + self.assertEqual(os.getpid(), self.pmt.pid) + self.assertEqual(old_tid + 1, self.pmt.monitor_thread_ident) + + + +class TestPeriodicMonitorBlocking(_AbstractTestPeriodicMonitoringThread, + unittest.TestCase): + + def test_previous_trace(self): + self.pmt.kill() + self.assertIsNone(gettrace()) + + called = [] + def f(*args): + called.append(args) + + settrace(f) + + self.pmt = monitor.PeriodicMonitoringThread(self.hub) + self.assertEqual(gettrace(), self.pmt._greenlet_tracer) + self.assertIs(self.pmt._greenlet_tracer.previous_trace_function, f) + + self.pmt._greenlet_tracer('event', ('args',)) + + self.assertEqual([('event', ('args',))], called) + + def test__greenlet_tracer(self): + self.assertEqual(0, self.pmt._greenlet_tracer.greenlet_switch_counter) + # Unknown event still counts as a switch (should it?) + self.pmt._greenlet_tracer('unknown', None) + self.assertEqual(1, self.pmt._greenlet_tracer.greenlet_switch_counter) + self.assertIsNone(self.pmt._greenlet_tracer.active_greenlet) + + origin = object() + target = object() + + self.pmt._greenlet_tracer('switch', (origin, target)) + self.assertEqual(2, self.pmt._greenlet_tracer.greenlet_switch_counter) + self.assertIs(target, self.pmt._greenlet_tracer.active_greenlet) + + # Unknown event removes active greenlet + self.pmt._greenlet_tracer('unknown', ()) + self.assertEqual(3, self.pmt._greenlet_tracer.greenlet_switch_counter) + self.assertIsNone(self.pmt._greenlet_tracer.active_greenlet) + + def test_monitor_blocking(self): + # Initially there's no active greenlet and no switches, + # so nothing is considered blocked + from gevent.events import subscribers + from gevent.events import IEventLoopBlocked + from zope.interface.verify import verifyObject + events = [] + subscribers.append(events.append) + + self.assertFalse(self.pmt.monitor_blocking(self.hub)) + + # Give it an active greenlet + origin = object() + target = object() + self.pmt._greenlet_tracer('switch', (origin, target)) + + # We've switched, so we're not blocked + self.assertFalse(self.pmt.monitor_blocking(self.hub)) + self.assertFalse(events) + + # Again without switching is a problem. + self.assertTrue(self.pmt.monitor_blocking(self.hub)) + self.assertTrue(events) + verifyObject(IEventLoopBlocked, events[0]) + del events[:] + + # But we can order it not to be a problem + self.pmt.ignore_current_greenlet_blocking() + self.assertFalse(self.pmt.monitor_blocking(self.hub)) + self.assertFalse(events) + + # And back again + self.pmt.monitor_current_greenlet_blocking() + self.assertTrue(self.pmt.monitor_blocking(self.hub)) + + # A bad thread_ident in the hub doesn't mess things up + self.hub.thread_ident = -1 + self.assertTrue(self.pmt.monitor_blocking(self.hub)) + + +class MockProcess(object): + + def __init__(self, rss): + self.rss = rss + + def memory_full_info(self): + return self + + +@skipOnPyPyOnWindows("psutil doesn't install on PyPy on Win") +class TestPeriodicMonitorMemory(_AbstractTestPeriodicMonitoringThread, + unittest.TestCase): + + rss = 0 + + def setUp(self): + super(TestPeriodicMonitorMemory, self).setUp() + self._old_max = GEVENT_CONFIG.max_memory_usage + GEVENT_CONFIG.max_memory_usage = None + + self.pmt._get_process = lambda: MockProcess(self.rss) + + def tearDown(self): + GEVENT_CONFIG.max_memory_usage = self._old_max + super(TestPeriodicMonitorMemory, self).tearDown() + + def test_can_monitor_and_install(self): + + # We run tests with psutil installed, and we have access to our + # process. + self.assertTrue(self.pmt.can_monitor_memory_usage()) + # No warning, adds a function + + self.pmt.install_monitor_memory_usage() + self.assertEqual(self.len_pmt_default_funcs + 1, len(self.pmt.monitoring_functions())) + + def test_cannot_monitor_and_install(self): + import warnings + self.pmt._get_process = lambda: None + self.assertFalse(self.pmt.can_monitor_memory_usage()) + + # This emits a warning, visible by default + with warnings.catch_warnings(record=True) as ws: + self.pmt.install_monitor_memory_usage() + + self.assertEqual(1, len(ws)) + self.assertIs(monitor.MonitorWarning, ws[0].category) + + def test_monitor_no_allowed(self): + self.assertEqual(-1, self.pmt.monitor_memory_usage(None)) + + def test_monitor_greater(self): + from gevent import events + + self.rss = 2 + GEVENT_CONFIG.max_memory_usage = 1 + + # Initial event + event = self.pmt.monitor_memory_usage(None) + self.assertIsInstance(event, events.MemoryUsageThresholdExceeded) + self.assertEqual(2, event.mem_usage) + self.assertEqual(1, event.max_allowed) + self.assertIsInstance(event.memory_info, MockProcess) + + # No growth, no event + event = self.pmt.monitor_memory_usage(None) + self.assertIsNone(event) + + # Growth, event + self.rss = 3 + event = self.pmt.monitor_memory_usage(None) + self.assertIsInstance(event, events.MemoryUsageThresholdExceeded) + self.assertEqual(3, event.mem_usage) + + # Shrinking below gets us back + self.rss = 1 + event = self.pmt.monitor_memory_usage(None) + self.assertIsInstance(event, events.MemoryUsageUnderThreshold) + self.assertEqual(1, event.mem_usage) + + # coverage + repr(event) + + # No change, no event + event = self.pmt.monitor_memory_usage(None) + self.assertIsNone(event) + + # Growth, event + self.rss = 3 + event = self.pmt.monitor_memory_usage(None) + self.assertIsInstance(event, events.MemoryUsageThresholdExceeded) + self.assertEqual(3, event.mem_usage) + + + def test_monitor_initial_below(self): + self.rss = 1 + GEVENT_CONFIG.max_memory_usage = 10 + + + event = self.pmt.monitor_memory_usage(None) + self.assertIsNone(event) + +if __name__ == '__main__': + unittest.main() diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test___monkey_patching.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test___monkey_patching.py new file mode 100644 index 00000000..ea82cc5c --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test___monkey_patching.py @@ -0,0 +1,113 @@ +import sys +import os +import glob + +import atexit +# subprocess: include in subprocess tests + +from gevent.testing import util + +TIMEOUT = 120 + +# XXX: Generalize this so other packages can use it. + +def find_stdlib_tests(): + setup_py = util.search_for_setup_py(a_file=__file__) + greentest = os.path.join(setup_py, 'src', 'greentest') + + + directory = '%s.%s' % sys.version_info[:2] + full_directory = '%s.%s.%s' % sys.version_info[:3] + if hasattr(sys, 'pypy_version_info'): + directory += 'pypy' + full_directory += 'pypy' + + directory = os.path.join(greentest, directory) + full_directory = os.path.join(greentest, full_directory) + + return directory, full_directory + +def get_python_version(): + version = '%s.%s.%s' % sys.version_info[:3] + if sys.version_info[3] == 'alpha': + version += 'a%s' % sys.version_info[4] + elif sys.version_info[3] == 'beta': + version += 'b%s' % sys.version_info[4] + + return version + +def get_absolute_pythonpath(): + paths = [os.path.abspath(p) for p in os.environ.get('PYTHONPATH', '').split(os.pathsep)] + return os.pathsep.join(paths) + + +def TESTRUNNER(tests=None): + try: + test_dir, version_test_dir = find_stdlib_tests() + except util.NoSetupPyFound as e: + util.log("WARNING: No setup.py and src/greentest found: %r", e, + color="suboptimal-behaviour") + return + + if not os.path.exists(test_dir): + util.log('WARNING: No test directory found at %s', test_dir, + color="suboptimal-behaviour") + return + + with open(os.path.join(test_dir, 'version')) as f: + preferred_version = f.read().strip() + + running_version = get_python_version() + if preferred_version != running_version: + util.log('WARNING: The tests in %s/ are from version %s and your Python is %s', + test_dir, preferred_version, running_version, + color="suboptimal-behaviour") + + version_tests = glob.glob('%s/test_*.py' % version_test_dir) + version_tests = sorted(version_tests) + if not tests: + tests = glob.glob('%s/test_*.py' % test_dir) + tests = sorted(tests) + + PYTHONPATH = (os.getcwd() + os.pathsep + get_absolute_pythonpath()).rstrip(':') + + tests = [os.path.basename(x) for x in tests] + version_tests = [os.path.basename(x) for x in version_tests] + + options = { + 'cwd': test_dir, + 'timeout': TIMEOUT, + 'setenv': { + 'PYTHONPATH': PYTHONPATH, + # debug produces resource tracking warnings for the + # CFFI backends. On Python 2, many of the stdlib tests + # rely on refcounting to close sockets so they produce + # lots of noise. Python 3 is not completely immune; + # test_ftplib.py tends to produce warnings---and the Python 3 + # test framework turns those into test failures! + 'GEVENT_DEBUG': 'error', + } + } + + if tests and not sys.platform.startswith("win"): + atexit.register(os.system, 'rm -f */@test*') + + basic_args = [sys.executable, '-u', '-W', 'ignore', '-m', 'gevent.testing.monkey_test'] + for filename in tests: + if filename in version_tests: + util.log("Overriding %s from %s with file from %s", filename, test_dir, version_test_dir) + continue + yield basic_args + [filename], options.copy() + + options['cwd'] = version_test_dir + for filename in version_tests: + yield basic_args + [filename], options.copy() + + +def main(): + from gevent.testing import testrunner + return testrunner.run_many(list(TESTRUNNER(sys.argv[1:]))) + + +if __name__ == '__main__': + main() diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__all__.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__all__.py new file mode 100644 index 00000000..0efbe2c8 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__all__.py @@ -0,0 +1,241 @@ +"""Check __all__, __implements__, __extensions__, __imports__ of the modules""" +from __future__ import print_function + +import sys +import unittest +import types +import importlib +import warnings + +from gevent.testing import six +from gevent.testing.modules import walk_modules +from gevent.testing.sysinfo import PLATFORM_SPECIFIC_SUFFIXES + +from gevent._patcher import MAPPING + +class ANY(object): + def __contains__(self, item): + return True + +ANY = ANY() + +NOT_IMPLEMENTED = { + 'socket': ['CAPI'], + 'thread': ['allocate', 'exit_thread', 'interrupt_main', 'start_new'], + 'select': ANY, + 'os': ANY, + 'threading': ANY, + 'builtins' if six.PY3 else '__builtin__': ANY, + 'signal': ANY, +} + +COULD_BE_MISSING = { + 'socket': ['create_connection', 'RAND_add', 'RAND_egd', 'RAND_status'], + 'subprocess': ['_posixsubprocess'], +} + +# Things without an __all__ should generally be internal implementation +# helpers +NO_ALL = { + 'gevent.threading', + 'gevent._util', + 'gevent._compat', + 'gevent._socketcommon', + 'gevent._fileobjectcommon', + 'gevent._fileobjectposix', + 'gevent._tblib', + 'gevent._corecffi', + 'gevent._patcher', + 'gevent._ffi', +} + +ALLOW_IMPLEMENTS = [ + 'gevent._queue', +] + +# A list of modules that may contain things that aren't actually, technically, +# extensions, but that need to be in __extensions__ anyway due to the way, +# for example, monkey patching, needs to work. +EXTRA_EXTENSIONS = [] +if sys.platform.startswith('win'): + EXTRA_EXTENSIONS.append('gevent.signal') + + +class Test(unittest.TestCase): + + stdlib_has_all = False + stdlib_all = () + stdlib_name = None + stdlib_module = None + module = None + __implements__ = __extensions__ = __imports__ = () + + def check_all(self): + "Check that __all__ is present and does not contain invalid entries" + if not hasattr(self.module, '__all__'): + self.assertIn(self.modname, NO_ALL) + return + names = {} + six.exec_("from %s import *" % self.modname, names) + names.pop('__builtins__', None) + self.assertEqual(sorted(names), sorted(self.module.__all__)) + + def check_all_formula(self): + "Check __all__ = __implements__ + __extensions__ + __imported__" + all_calculated = self.__implements__ + self.__imports__ + self.__extensions__ + self.assertEqual(sorted(all_calculated), sorted(self.module.__all__)) + + def check_implements_presence_justified(self): + "Check that __implements__ is present only if the module is modeled after a module from stdlib (like gevent.socket)." + if self.modname in ALLOW_IMPLEMENTS: + return + if self.__implements__ is not None and self.stdlib_module is None: + raise AssertionError('%r has __implements__ but no stdlib counterpart (%s)' + % (self.modname, self.stdlib_name)) + + def set_stdlib_all(self): + self.assertIsNotNone(self.stdlib_module) + self.stdlib_has_all = True + self.stdlib_all = getattr(self.stdlib_module, '__all__', None) + if self.stdlib_all is None: + self.stdlib_has_all = False + self.stdlib_all = dir(self.stdlib_module) + self.stdlib_all = [name for name in self.stdlib_all if not name.startswith('_')] + self.stdlib_all = [name for name in self.stdlib_all if not isinstance(getattr(self.stdlib_module, name), types.ModuleType)] + + def check_implements_subset_of_stdlib_all(self): + "Check that __implements__ + __imports__ is a subset of the corresponding standard module __all__ or dir()" + for name in self.__implements__ + self.__imports__: + if name in self.stdlib_all: + continue + if name in COULD_BE_MISSING.get(self.stdlib_name, ()): + continue + if name in dir(self.stdlib_module): # like thread._local which is not in thread.__all__ + continue + raise AssertionError('%r is not found in %r.__all__ nor in dir(%r)' % (name, self.stdlib_module, self.stdlib_module)) + + def check_implements_actually_implements(self): + """Check that the module actually implements the entries from __implements__""" + for name in self.__implements__: + item = getattr(self.module, name) + try: + stdlib_item = getattr(self.stdlib_module, name) + self.assertIsNot(item, stdlib_item) + except AttributeError: + if name not in COULD_BE_MISSING.get(self.stdlib_name, []): + raise + + def check_imports_actually_imports(self): + """Check that the module actually imports the entries from __imports__""" + for name in self.__imports__: + item = getattr(self.module, name) + stdlib_item = getattr(self.stdlib_module, name) + self.assertIs(item, stdlib_item) + + def check_extensions_actually_extend(self): + """Check that the module actually defines new entries in __extensions__""" + if self.modname in EXTRA_EXTENSIONS: + return + for name in self.__extensions__: + if hasattr(self.stdlib_module, name): + raise AssertionError("'%r' is not an extension, it is found in %r" % (name, self.stdlib_module)) + + def check_completeness(self): # pylint:disable=too-many-branches + """Check that __all__ (or dir()) of the corresponsing stdlib is a subset of __all__ of this module""" + missed = [] + for name in self.stdlib_all: + if name not in getattr(self.module, '__all__', []): + missed.append(name) + + # handle stuff like ssl.socket and ssl.socket_error which have no reason to be in gevent.ssl.__all__ + if not self.stdlib_has_all: + for name in missed[:]: + if hasattr(self.module, name): + missed.remove(name) + + # remove known misses + not_implemented = NOT_IMPLEMENTED.get(self.stdlib_name) + if not_implemented is not None: + result = [] + for name in missed: + if name in not_implemented: + # We often don't want __all__ to be set because we wind up + # documenting things that we just copy in from the stdlib. + # But if we implement it, don't print a warning + if getattr(self.module, name, self) is self: + print('IncompleteImplWarning: %s.%s' % (self.modname, name)) + else: + result.append(name) + missed = result + + if missed: + if self.stdlib_has_all: + msg = '''The following items + in %r.__all__ +are missing from %r: + %r''' % (self.stdlib_module, self.module, missed) + else: + msg = '''The following items + in dir(%r) +are missing from %r: + %r''' % (self.stdlib_module, self.module, missed) + raise AssertionError(msg) + + def _test(self, modname): + if modname.endswith(PLATFORM_SPECIFIC_SUFFIXES): + return + + self.modname = modname + with warnings.catch_warnings(): + warnings.simplefilter('ignore', DeprecationWarning) + self.module = importlib.import_module(modname) + + self.check_all() + + self.__implements__ = getattr(self.module, '__implements__', None) + self.__imports__ = getattr(self.module, '__imports__', []) + self.__extensions__ = getattr(self.module, '__extensions__', []) + + self.stdlib_name = MAPPING.get(modname) + self.stdlib_module = None + + if self.stdlib_name is not None: + try: + self.stdlib_module = __import__(self.stdlib_name) + except ImportError: + pass + + self.check_implements_presence_justified() + + if self.stdlib_module is None: + return + + # use __all__ as __implements__ + if self.__implements__ is None: + self.__implements__ = sorted(self.module.__all__) + + self.set_stdlib_all() + self.check_implements_subset_of_stdlib_all() + self.check_implements_actually_implements() + self.check_imports_actually_imports() + self.check_extensions_actually_extend() + self.check_completeness() + + path = modname = orig_modname = None + + for path, modname in walk_modules(include_so=False, recursive=True): + orig_modname = modname + modname = modname.replace('gevent.', '').split('.')[0] + if not modname: + print("WARNING: No such module '%s' at '%s'" % (orig_modname, path), + file=sys.stderr) + continue + exec( + '''def test_%s(self): self._test("%s")''' % ( + orig_modname.replace('.', '_').replace('-', '_'), orig_modname) + ) + del path, modname, orig_modname + + +if __name__ == "__main__": + unittest.main() diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__api.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__api.py new file mode 100644 index 00000000..697a3e07 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__api.py @@ -0,0 +1,132 @@ +# Copyright (c) 2008 AG Projects +# Author: Denis Bilenko +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. + +import gevent.testing as greentest +import gevent +from gevent import util, socket + +DELAY = 0.1 + + +class Test(greentest.TestCase): + + @greentest.skipOnAppVeyor("Timing causes the state to often be [start,finished]") + def test_killing_dormant(self): + state = [] + + def test(): + try: + state.append('start') + gevent.sleep(DELAY * 3.0) + except: # pylint:disable=bare-except + state.append('except') + # catching GreenletExit + + state.append('finished') + + g = gevent.spawn(test) + gevent.sleep(DELAY / 2) + assert state == ['start'], state + g.kill() + # will not get there, unless switching is explicitly scheduled by kill + self.assertEqual(state, ['start', 'except', 'finished']) + + def test_nested_with_timeout(self): + def func(): + return gevent.with_timeout(0.2, gevent.sleep, 2, timeout_value=1) + self.assertRaises(gevent.Timeout, gevent.with_timeout, 0.1, func) + + def test_sleep_invalid_switch(self): + p = gevent.spawn(util.wrap_errors(AssertionError, gevent.sleep), 2) + gevent.sleep(0) # wait for p to start, because actual order of switching is reversed + switcher = gevent.spawn(p.switch, None) + result = p.get() + assert isinstance(result, AssertionError), result + assert 'Invalid switch' in str(result), repr(str(result)) + switcher.kill() + + if hasattr(socket, 'socketpair'): + + def _test_wait_read_invalid_switch(self, sleep): + sock1, sock2 = socket.socketpair() + try: + p = gevent.spawn(util.wrap_errors(AssertionError, + socket.wait_read), # pylint:disable=no-member + sock1.fileno()) + gevent.get_hub().loop.run_callback(switch_None, p) + if sleep is not None: + gevent.sleep(sleep) + result = p.get() + assert isinstance(result, AssertionError), result + assert 'Invalid switch' in str(result), repr(str(result)) + finally: + sock1.close() + sock2.close() + + def test_invalid_switch_None(self): + self._test_wait_read_invalid_switch(None) + + def test_invalid_switch_0(self): + self._test_wait_read_invalid_switch(0) + + def test_invalid_switch_1(self): + self._test_wait_read_invalid_switch(0.001) + + # we don't test wait_write the same way, because socket is always ready to write + + +def switch_None(g): + g.switch(None) + + +class TestTimers(greentest.TestCase): + + def test_timer_fired(self): + lst = [1] + + def func(): + gevent.spawn_later(0.01, lst.pop) + gevent.sleep(0.02) + + gevent.spawn(func) + # Func has not run yet + self.assertEqual(lst, [1]) + # Run callbacks but don't yield. + gevent.sleep() + + # Let timers fire. Func should be done. + gevent.sleep(0.1) + self.assertEqual(lst, []) + + + def test_spawn_is_not_cancelled(self): + lst = [1] + + def func(): + gevent.spawn(lst.pop) + # exiting immediately, but self.lst.pop must be called + gevent.spawn(func) + gevent.sleep(0.1) + self.assertEqual(lst, []) + + +if __name__ == '__main__': + greentest.main() diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__api_timeout.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__api_timeout.py new file mode 100644 index 00000000..98eb152d --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__api_timeout.py @@ -0,0 +1,210 @@ +# Copyright (c) 2008 AG Projects +# Author: Denis Bilenko +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. + +import sys +import gevent.testing as greentest +import weakref +import time +import gc + +from gevent import sleep +from gevent import Timeout +from gevent import get_hub + + +from gevent.testing.timing import SMALL_TICK as DELAY +from gevent.testing import flaky + + +class Error(Exception): + pass + + +class _UpdateNowProxy(object): + + update_now_calls = 0 + + def __init__(self, loop): + self.loop = loop + + def __getattr__(self, name): + return getattr(self.loop, name) + + def update_now(self): + self.update_now_calls += 1 + self.loop.update_now() + +class _UpdateNowWithTimerProxy(_UpdateNowProxy): + + def timer(self, *_args, **_kwargs): + return _Timer(self) + +class _Timer(object): + + pending = False + active = False + + def __init__(self, loop): + self.loop = loop + + def start(self, *_args, **kwargs): + if kwargs.get("update"): + self.loop.update_now() + self.pending = self.active = True + + def stop(self): + self.active = self.pending = False + + def close(self): + "Does nothing" + + +class Test(greentest.TestCase): + + def test_timeout_calls_update_now(self): + hub = get_hub() + loop = hub.loop + proxy = _UpdateNowWithTimerProxy(loop) + hub.loop = proxy + + try: + with Timeout(DELAY * 2) as t: + self.assertTrue(t.pending) + finally: + hub.loop = loop + + self.assertEqual(1, proxy.update_now_calls) + + def test_sleep_calls_update_now(self): + hub = get_hub() + loop = hub.loop + proxy = _UpdateNowProxy(loop) + hub.loop = proxy + try: + sleep(0.01) + finally: + hub.loop = loop + + self.assertEqual(1, proxy.update_now_calls) + + + @greentest.skipOnAppVeyor("Timing is flaky, especially under Py 3.4/64-bit") + @greentest.skipOnPyPy3OnCI("Timing is flaky, especially under Py 3.4/64-bit") + @greentest.reraises_flaky_timeout(Timeout) + def test_api(self): + # Nothing happens if with-block finishes before the timeout expires + t = Timeout(DELAY * 2) + self.assertFalse(t.pending, t) + with t: + self.assertTrue(t.pending, t) + sleep(DELAY) + # check if timer was actually cancelled + self.assertFalse(t.pending, t) + sleep(DELAY * 2) + + # An exception will be raised if it's not + with self.assertRaises(Timeout) as exc: + with Timeout(DELAY) as t: + sleep(DELAY * 10) + + self.assertIs(exc.exception, t) + + # You can customize the exception raised: + with self.assertRaises(IOError): + with Timeout(DELAY, IOError("Operation takes way too long")): + sleep(DELAY * 10) + + # Providing classes instead of values should be possible too: + with self.assertRaises(ValueError): + with Timeout(DELAY, ValueError): + sleep(DELAY * 10) + + + try: + 1 / 0 + except ZeroDivisionError: + with self.assertRaises(ZeroDivisionError): + with Timeout(DELAY, sys.exc_info()[0]): + sleep(DELAY * 10) + raise AssertionError('should not get there') + raise AssertionError('should not get there') + else: + raise AssertionError('should not get there') + + # It's possible to cancel the timer inside the block: + with Timeout(DELAY) as timer: + timer.cancel() + sleep(DELAY * 2) + + # To silent the exception before exiting the block, pass False as second parameter. + XDELAY = 0.1 + start = time.time() + with Timeout(XDELAY, False): + sleep(XDELAY * 2) + delta = (time.time() - start) + self.assertTimeWithinRange(delta, 0, XDELAY * 2) + + # passing None as seconds disables the timer + with Timeout(None): + sleep(DELAY) + sleep(DELAY) + + def test_ref(self): + err = Error() + err_ref = weakref.ref(err) + with Timeout(DELAY * 2, err): + sleep(DELAY) + del err + gc.collect() + self.assertFalse(err_ref(), err_ref) + + @flaky.reraises_flaky_race_condition() + def test_nested_timeout(self): + with Timeout(DELAY, False): + with Timeout(DELAY * 10, False): + sleep(DELAY * 3 * 20) + raise AssertionError('should not get there') + + with Timeout(DELAY) as t1: + with Timeout(DELAY * 20) as t2: + with self.assertRaises(Timeout) as exc: + sleep(DELAY * 30) + self.assertIs(exc.exception, t1) + + self.assertFalse(t1.pending, t1) + self.assertTrue(t2.pending, t2) + + self.assertFalse(t2.pending) + + with Timeout(DELAY * 20) as t1: + with Timeout(DELAY) as t2: + with self.assertRaises(Timeout) as exc: + sleep(DELAY * 30) + self.assertIs(exc.exception, t2) + + self.assertTrue(t1.pending, t1) + self.assertFalse(t2.pending, t2) + + self.assertFalse(t1.pending) + + +if __name__ == '__main__': + greentest.main() diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__ares_host_result.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__ares_host_result.py new file mode 100644 index 00000000..2ea36c84 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__ares_host_result.py @@ -0,0 +1,31 @@ +from __future__ import print_function + +import pickle +import gevent.testing as greentest +try: + from gevent.resolver.cares import ares_host_result +except ImportError: # pragma: no cover + ares_host_result = None + + +@greentest.skipIf(ares_host_result is None, + "Must be able to import ares") +class TestPickle(greentest.TestCase): + # Issue 104: ares.ares_host_result unpickleable + + def _test(self, protocol): + r = ares_host_result('family', ('arg1', 'arg2', )) + dumped = pickle.dumps(r, protocol) + loaded = pickle.loads(dumped) + self.assertEqual(r, loaded) + self.assertEqual(r.family, loaded.family) + + +for i in range(0, pickle.HIGHEST_PROTOCOL): + def make_test(j): + return lambda self: self._test(j) + setattr(TestPickle, 'test' + str(i), make_test(i)) + + +if __name__ == '__main__': + greentest.main() diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__ares_timeout.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__ares_timeout.py new file mode 100644 index 00000000..e2c362de --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__ares_timeout.py @@ -0,0 +1,52 @@ +from __future__ import print_function + +import errno +import unittest + +import gevent +try: + from gevent.resolver.ares import Resolver +except ImportError as ex: + Resolver = None +from gevent import socket + +import gevent.testing as greentest + +@unittest.skipIf( + Resolver is None, + "Needs ares resolver" +) +class TestTimeout(greentest.TestCase): + + __timeout__ = 30 + + address = ('', 7153) + + def test(self): + listener = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) + + try: + listener.bind(self.address) + except socket.error as ex: + if ex.errno in (errno.EPERM, errno.EADDRNOTAVAIL) or 'permission denied' in str(ex).lower(): + raise unittest.SkipTest( + 'This test binds on port a port that was already in use or not allowed.\n' + ) + raise + + + def reader(): + while True: + listener.recvfrom(10000) + + gevent.spawn(reader) + + r = Resolver(servers=['127.0.0.1'], timeout=0.001, tries=1, + udp_port=self.address[-1]) + + with self.assertRaisesRegex(socket.gaierror, "ARES_ETIMEOUT"): + r.gethostbyname('www.google.com') + + +if __name__ == '__main__': + greentest.main() diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__backdoor.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__backdoor.py new file mode 100644 index 00000000..2f60ad88 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__backdoor.py @@ -0,0 +1,135 @@ +from __future__ import print_function +import gevent.testing as greentest +import gevent +from gevent import socket +from gevent import backdoor + +def read_until(conn, postfix): + read = b'' + assert isinstance(postfix, bytes) + + while not read.endswith(postfix): + result = conn.recv(1) + if not result: + raise AssertionError('Connection ended before %r. Data read:\n%r' % (postfix, read)) + read += result + + return read if isinstance(read, str) else read.decode('utf-8') + +def readline(conn): + with conn.makefile() as f: + return f.readline() + +class Test(greentest.TestCase): + + __timeout__ = 10 + + _server = None + + def tearDown(self): + if self._server is not None: + self._server.stop() + self.close_on_teardown.remove(self._server.stop) + self._server = None + gevent.sleep() # let spawned greenlets die + super(Test, self).tearDown() + + def _make_server(self, *args, **kwargs): + assert self._server is None + self._server = backdoor.BackdoorServer(('127.0.0.1', 0), *args, **kwargs) + self._close_on_teardown(self._server.stop) + self._server.start() + + def _create_connection(self): + conn = socket.socket() + self._close_on_teardown(conn) + conn.connect(('127.0.0.1', self._server.server_port)) + return conn + + def _close(self, conn, cmd=b'quit()\r\n)'): + conn.sendall(cmd) + line = readline(conn) + self.assertEqual(line, '') + conn.close() + self.close_on_teardown.remove(conn) + + @greentest.skipOnLibuvOnTravisOnCPython27( + "segfaults; " + "See https://github.com/gevent/gevent/pull/1156") + def test_multi(self): + self._make_server() + + def connect(): + conn = self._create_connection() + read_until(conn, b'>>> ') + conn.sendall(b'2+2\r\n') + line = readline(conn) + self.assertEqual(line.strip(), '4', repr(line)) + self._close(conn) + + jobs = [gevent.spawn(connect) for _ in range(10)] + done = gevent.joinall(jobs, raise_error=True) + + self.assertEqual(len(done), len(jobs), done) + + @greentest.skipOnAppVeyor("Times out") + def test_quit(self): + self._make_server() + conn = self._create_connection() + read_until(conn, b'>>> ') + self._close(conn) + + @greentest.skipOnAppVeyor("Times out") + def test_sys_exit(self): + self._make_server() + conn = self._create_connection() + read_until(conn, b'>>> ') + self._close(conn, b'import sys; sys.exit(0)\r\n') + + @greentest.skipOnAppVeyor("Times out") + def test_banner(self): + banner = "Welcome stranger!" # native string + self._make_server(banner=banner) + conn = self._create_connection() + response = read_until(conn, b'>>> ') + self.assertEqual(response[:len(banner)], banner, response) + + self._close(conn) + + @greentest.skipOnAppVeyor("Times out") + def test_builtins(self): + self._make_server() + conn = self._create_connection() + read_until(conn, b'>>> ') + conn.sendall(b'locals()["__builtins__"]\r\n') + response = read_until(conn, b'>>> ') + self.assertTrue(len(response) < 300, msg="locals() unusable: %s..." % response) + + self._close(conn) + + def test_switch_exc(self): + from gevent.queue import Queue, Empty + + def bad(): + q = Queue() + print('switching out, then throwing in') + try: + q.get(block=True, timeout=0.1) + except Empty: + print("Got Empty") + print('switching out') + gevent.sleep(0.1) + print('switched in') + + self._make_server(locals={'bad': bad}) + conn = self._create_connection() + read_until(conn, b'>>> ') + conn.sendall(b'bad()\r\n') + response = read_until(conn, b'>>> ') + response = response.replace('\r\n', '\n') + self.assertEqual('switching out, then throwing in\nGot Empty\nswitching out\nswitched in\n>>> ', response) + + self._close(conn) + +if __name__ == '__main__': + greentest.main() diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__close_backend_fd.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__close_backend_fd.py new file mode 100644 index 00000000..4ac760e8 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__close_backend_fd.py @@ -0,0 +1,63 @@ +from __future__ import print_function +import os +import unittest + +import gevent +from gevent import core + + +@unittest.skipUnless( + getattr(core, 'LIBEV_EMBED', False), + "Needs embedded libev. " + "hub.loop.fileno is only defined when " + "we embed libev for some reason. " + "Choosing specific backends is also only supported by libev " + "(not libuv), and besides, libuv has a nasty tendency to " + "abort() the process if its FD gets closed. " +) +class Test(unittest.TestCase): + # NOTE that we extend unittest.TestCase, not greentest.TestCase + # Extending the later causes the wrong hub to get used. + + assertRaisesRegex = getattr(unittest.TestCase, 'assertRaisesRegex', + getattr(unittest.TestCase, 'assertRaisesRegexp')) + + def _check_backend(self, backend): + hub = gevent.get_hub(backend, default=False) + try: + self.assertEqual(hub.loop.backend, backend) + + gevent.sleep(0.001) + fileno = hub.loop.fileno() + if fileno is None: + raise unittest.SkipTest("backend %s lacks fileno" % (backend,)) + + os.close(fileno) + with self.assertRaisesRegex(SystemError, "(libev)"): + gevent.sleep(0.001) + + hub.destroy() + self.assertIn('destroyed', repr(hub)) + finally: + if hub.loop is not None: + hub.destroy() + + def _make_test(count, backend): # pylint:disable=no-self-argument + def test(self): + self._check_backend(backend) + test.__name__ = 'test_' + backend + '_' + str(count) + return test.__name__, test + + count = backend = None + for count in range(2): + for backend in core.supported_backends(): + name, func = _make_test(count, backend) + locals()[name] = func + name = func = None + + del count + del backend + del _make_test + +if __name__ == '__main__': + unittest.main() diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__compat.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__compat.py new file mode 100644 index 00000000..76795974 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__compat.py @@ -0,0 +1,56 @@ +from __future__ import absolute_import, print_function, division + +import os +import unittest + +class TestFSPath(unittest.TestCase): + + def setUp(self): + self.__path = None + + def __fspath__(self): + if self.__path is not None: + return self.__path + raise AttributeError("Accessing path data") + + def _callFUT(self, arg): + from gevent._compat import _fspath + return _fspath(arg) + + def test_text(self): + s = u'path' + self.assertIs(s, self._callFUT(s)) + + def test_bytes(self): + s = b'path' + self.assertIs(s, self._callFUT(s)) + + def test_None(self): + with self.assertRaises(TypeError): + self._callFUT(None) + + def test_working_path(self): + self.__path = u'text' + self.assertIs(self.__path, self._callFUT(self)) + + self.__path = b'bytes' + self.assertIs(self.__path, self._callFUT(self)) + + def test_failing_path_AttributeError(self): + self.assertIsNone(self.__path) + with self.assertRaises(AttributeError): + self._callFUT(self) + + def test_fspath_non_str(self): + self.__path = object() + with self.assertRaises(TypeError): + self._callFUT(self) + +@unittest.skipUnless(hasattr(os, 'fspath'), "Tests native os.fspath") +class TestNativeFSPath(TestFSPath): + + def _callFUT(self, arg): + return os.fspath(arg) + +if __name__ == '__main__': + unittest.main() diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__core.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__core.py new file mode 100644 index 00000000..7e107ef7 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__core.py @@ -0,0 +1,170 @@ + +from __future__ import absolute_import, print_function, division +import sys +import unittest +import gevent.testing as greentest + +from gevent import core + + + +class TestCore(unittest.TestCase): + + def test_get_version(self): + version = core.get_version() # pylint: disable=no-member + self.assertIsInstance(version, str) + self.assertTrue(version) + header_version = core.get_header_version() # pylint: disable=no-member + self.assertIsInstance(header_version, str) + self.assertTrue(header_version) + self.assertEqual(version, header_version) + + +class TestWatchers(unittest.TestCase): + + def _makeOne(self): + return core.loop() # pylint:disable=no-member + + def destroyOne(self, loop): + loop.destroy() + + def setUp(self): + self.loop = self._makeOne() + + def tearDown(self): + self.destroyOne(self.loop) + del self.loop + + def test_io(self): + if sys.platform == 'win32': + # libev raises IOError, libuv raises ValueError + Error = (IOError, ValueError) + win32 = True + else: + Error = ValueError + win32 = False + + with self.assertRaises(Error): + self.loop.io(-1, 1) + + if hasattr(core, 'TIMER'): + # libev + with self.assertRaises(ValueError): + self.loop.io(1, core.TIMER) # pylint:disable=no-member + + # Test we can set events and io before it's started + if not win32: + # We can't do this with arbitrary FDs on windows; + # see libev_vfd.h + io = self.loop.io(1, core.READ) # pylint:disable=no-member + io.fd = 2 + self.assertEqual(io.fd, 2) + io.events = core.WRITE # pylint:disable=no-member + if not hasattr(core, 'libuv'): + # libev + # pylint:disable=no-member + self.assertEqual(core._events_to_str(io.events), 'WRITE|_IOFDSET') + else: + + self.assertEqual(core._events_to_str(io.events), # pylint:disable=no-member + 'WRITE') + io.start(lambda: None) + io.close() + + @greentest.skipOnLibev("libuv-specific") + @greentest.skipOnWindows("Destroying the loop somehow fails") + def test_io_multiplex_events(self): + # pylint:disable=no-member + import socket + sock = socket.socket() + fd = sock.fileno() + + read = self.loop.io(fd, core.READ) + write = self.loop.io(fd, core.WRITE) + + try: + real_watcher = read._watcher_ref + + read.start(lambda: None) + self.assertEqual(real_watcher.events, core.READ) + + write.start(lambda: None) + self.assertEqual(real_watcher.events, core.READ | core.WRITE) + + write.stop() + self.assertEqual(real_watcher.events, core.READ) + + write.start(lambda: None) + self.assertEqual(real_watcher.events, core.READ | core.WRITE) + + read.stop() + self.assertEqual(real_watcher.events, core.WRITE) + + write.stop() + self.assertEqual(real_watcher.events, 0) + finally: + read.close() + write.close() + sock.close() + + def test_timer_constructor(self): + with self.assertRaises(ValueError): + self.loop.timer(1, -1) + + def test_signal_constructor(self): + with self.assertRaises(ValueError): + self.loop.signal(1000) + +class TestWatchersDefault(TestWatchers): + + def _makeOne(self): + return core.loop(default=True) # pylint:disable=no-member + + def destroyOne(self, loop): + return + +# XXX: The crash may be fixed? The hang showed up after the crash was +# reproduced and fixed on linux and OS X. +@greentest.skipOnLibuvOnWin( + "This crashes with PyPy 5.10.0, only on Windows. " + "See https://ci.appveyor.com/project/denik/gevent/build/1.0.1380/job/lrlvid6mkjtyrhn5#L1103 " + "It has also timed out, but only on Appveyor CPython 3.6; local CPython 3.6 does not. " + "See https://ci.appveyor.com/project/denik/gevent/build/1.0.1414/job/yn7yi8b53vtqs8lw#L1523") +class TestWatchersDefaultDestroyed(TestWatchers): + + def _makeOne(self): + # pylint: disable=no-member + l = core.loop(default=True) + l.destroy() + del l + return core.loop(default=True) + +@greentest.skipOnLibuv("Tests for libev-only functions") +class TestLibev(unittest.TestCase): + + def test_flags_conversion(self): + # pylint: disable=no-member + if sys.platform != 'win32': + self.assertEqual(core.loop(2, default=False).backend_int, 2) + self.assertEqual(core.loop('select', default=False).backend, 'select') + self.assertEqual(core._flags_to_int(None), 0) + self.assertEqual(core._flags_to_int(['kqueue', 'SELECT']), core.BACKEND_KQUEUE | core.BACKEND_SELECT) + self.assertEqual(core._flags_to_list(core.BACKEND_PORT | core.BACKEND_POLL), ['port', 'poll']) + self.assertRaises(ValueError, core.loop, ['port', 'blabla']) + self.assertRaises(TypeError, core.loop, object()) + + +class TestEvents(unittest.TestCase): + + def test_events_conversion(self): + self.assertEqual(core._events_to_str(core.READ | core.WRITE), # pylint: disable=no-member + 'READ|WRITE') + + def test_EVENTS(self): + self.assertEqual(str(core.EVENTS), # pylint: disable=no-member + 'gevent.core.EVENTS') + self.assertEqual(repr(core.EVENTS), # pylint: disable=no-member + 'gevent.core.EVENTS') + +if __name__ == '__main__': + greentest.main() diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__core_async.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__core_async.py new file mode 100644 index 00000000..e1e76cda --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__core_async.py @@ -0,0 +1,24 @@ +from __future__ import print_function +import gevent +import gevent.core +import time +try: + import thread +except ImportError: + import _thread as thread + + +hub = gevent.get_hub() +watcher = hub.loop.async_() + +# BWC for <3.7: This should still be an attribute +assert hasattr(hub.loop, 'async') + +gevent.spawn_later(0.1, thread.start_new_thread, watcher.send, ()) + +start = time.time() + +with gevent.Timeout(1.0): # Large timeout for appveyor + hub.wait(watcher) + +print('Watcher %r reacted after %.6f seconds' % (watcher, time.time() - start - 0.1)) diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__core_callback.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__core_callback.py new file mode 100644 index 00000000..f2acab52 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__core_callback.py @@ -0,0 +1,31 @@ +import gevent +from gevent.hub import get_hub + +called = [] + + +def f(): + called.append(1) + + +def main(): + loop = get_hub().loop + x = loop.run_callback(f) + + assert x, x + gevent.sleep(0) + assert called == [1], called + assert not x, (x, bool(x)) + + x = loop.run_callback(f) + assert x, x + x.stop() + assert not x, x + gevent.sleep(0) + assert called == [1], called + assert not x, x + + +if __name__ == '__main__': + called[:] = [] + main() diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__core_fork.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__core_fork.py new file mode 100644 index 00000000..fee42f54 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__core_fork.py @@ -0,0 +1,58 @@ +from __future__ import print_function +import gevent.monkey +gevent.monkey.patch_all() +import gevent +import os + +import multiprocessing + +hub = gevent.get_hub() +pid = os.getpid() +newpid = None + + +def on_fork(): + global newpid + newpid = os.getpid() + +fork_watcher = hub.loop.fork(ref=False) +fork_watcher.start(on_fork) + + +def run(q): + # libev only calls fork callbacks at the beginning of + # the loop; we use callbacks extensively so it takes *two* + # calls to sleep (with a timer) to actually get wrapped + # around to the beginning of the loop. + gevent.sleep(0.01) + gevent.sleep(0.01) + q.put(newpid) + + +def test(): + # Use a thread to make us multi-threaded + hub.threadpool.apply(lambda: None) + # If the Queue is global, q.get() hangs on Windows; must pass as + # an argument. + q = multiprocessing.Queue() + p = multiprocessing.Process(target=run, args=(q,)) + p.start() + p.join() + p_val = q.get() + + assert p_val is not None, "The fork watcher didn't run" + assert p_val != pid + +if __name__ == '__main__': + # Must call for Windows to fork properly; the fork can't be in the top-level + multiprocessing.freeze_support() + # fork watchers weren't firing in multi-threading processes. + # This test is designed to prove that they are. + # However, it fails on Windows: The fork watcher never runs! + # This makes perfect sense: on Windows, our patches to os.fork() + # that call gevent.hub.reinit() don't get used; os.fork doesn't + # exist and multiprocessing.Process uses the windows-specific _subprocess.CreateProcess() + # to create a whole new process that has no relation to the current process; + # that process then calls multiprocessing.forking.main() to do its work. + # Since no state is shared, a fork watcher cannot exist in that process. + test() diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__core_loop_run.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__core_loop_run.py new file mode 100644 index 00000000..ad35e014 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__core_loop_run.py @@ -0,0 +1,25 @@ +from __future__ import print_function +import sys +# Using a direct import of signal (deprecated). +# We are also called from test__core_loop_run_sig_mod.py, +# which has already done 'import gevent.signal' to be sure we work +# when the module has been imported. +from gevent import core, signal +loop = core.loop(default=False) + + +signal = signal(2, sys.stderr.write, 'INTERRUPT!') + +print('must exit immediately...') +loop.run() # must exit immediately +print('...and once more...') +loop.run() # repeating does not fail +print('..done') + +print('must exit after 0.5 seconds.') +timer = loop.timer(0.5) +timer.start(lambda: None) +loop.run() +timer.close() +loop.destroy() +del loop diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__core_loop_run_sig_mod.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__core_loop_run_sig_mod.py new file mode 100644 index 00000000..396cbe53 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__core_loop_run_sig_mod.py @@ -0,0 +1,16 @@ +import sys +import gevent.signal +assert gevent.signal # Get gevent.signal as a module, make sure our backwards compatibility kicks in + +import test__core_loop_run # this runs main tests, fails if signal() is not callable. +assert test__core_loop_run # pyflakes + +from gevent.hub import signal as hub_signal +from gevent import signal as top_signal # pylint:disable=reimported + +assert gevent.signal is hub_signal +assert gevent.signal is top_signal +assert hasattr(gevent.signal, 'signal') +s = top_signal(2, sys.stderr.write, 'INTERRUPT') +assert isinstance(s, top_signal) +assert isinstance(s, hub_signal) diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__core_stat.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__core_stat.py new file mode 100644 index 00000000..d022d90e --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__core_stat.py @@ -0,0 +1,118 @@ +from __future__ import print_function + +import os +import tempfile +import time + +import gevent +import gevent.core + +import gevent.testing as greentest +import gevent.testing.flaky + +#pylint: disable=protected-access + + +DELAY = 0.5 + +WIN = greentest.WIN + +LIBUV = greentest.LIBUV + +class TestCoreStat(greentest.TestCase): + + __timeout__ = greentest.LARGE_TIMEOUT + + def setUp(self): + super(TestCoreStat, self).setUp() + fd, path = tempfile.mkstemp(suffix='.gevent_test_core_stat') + os.close(fd) + self.temp_path = path + self.hub = gevent.get_hub() + # If we don't specify an interval, we default to zero. + # libev interprets that as meaning to use its default interval, + # which is about 5 seconds. If we go below it's minimum check + # threshold, it bumps it up to the minimum. + self.watcher = self.hub.loop.stat(self.temp_path, interval=-1) + + def tearDown(self): + self.watcher.close() + if os.path.exists(self.temp_path): + os.unlink(self.temp_path) + super(TestCoreStat, self).tearDown() + + def _write(self): + with open(self.temp_path, 'wb', buffering=0) as f: + f.write(b'x') + + def _check_attr(self, name, none): + # Deals with the complex behaviour of the 'attr' and 'prev' + # attributes on Windows. This codifies it, rather than simply letting + # the test fail, so we know exactly when and what changes it. + try: + x = getattr(self.watcher, name) + except ImportError: + if WIN: + # the 'posix' module is not available + pass + else: + raise + else: + if WIN and not LIBUV: + # The ImportError is only raised for the first time; + # after that, the attribute starts returning None + self.assertIsNone(x, "Only None is supported on Windows") + if none: + self.assertIsNone(x, name) + else: + self.assertIsNotNone(x, name) + + def _wait_on_greenlet(self, func, *greenlet_args): + start = time.time() + + self.hub.loop.update_now() + greenlet = gevent.spawn_later(DELAY, func, *greenlet_args) + with gevent.Timeout(5 + DELAY + 0.5): + self.hub.wait(self.watcher) + now = time.time() + + self.assertGreaterEqual(now, start, "Time must move forward") + + wait_duration = now - start + reaction = wait_duration - DELAY + + if reaction <= 0.0: + # Sigh. This is especially true on PyPy on Windows + raise gevent.testing.flaky.FlakyTestRaceCondition( + "Bad timer resolution (on Windows?), test is useless. Start %s, now %s" % (start, now)) + + self.assertGreaterEqual( + reaction, 0.0, + 'Watcher %s reacted too early: %.3fs' % (self.watcher, reaction)) + + greenlet.join() + + def test_watcher_basics(self): + watcher = self.watcher + filename = self.temp_path + self.assertEqual(watcher.path, filename) + filenames = filename if isinstance(filename, bytes) else filename.encode('ascii') + self.assertEqual(watcher._paths, filenames) + self.assertEqual(watcher.interval, -1) + + def test_write(self): + self._wait_on_greenlet(self._write) + + self._check_attr('attr', False) + self._check_attr('prev', False) + # The watcher interval changed after it started; -1 is illegal + self.assertNotEqual(self.watcher.interval, -1) + + def test_unlink(self): + self._wait_on_greenlet(os.unlink, self.temp_path) + + self._check_attr('attr', True) + self._check_attr('prev', False) + +if __name__ == '__main__': + greentest.main() diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__core_timer.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__core_timer.py new file mode 100644 index 00000000..97caa754 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__core_timer.py @@ -0,0 +1,157 @@ +from __future__ import print_function +from gevent import config + +import gevent.testing as greentest +from gevent.testing import TestCase +from gevent.testing import LARGE_TIMEOUT +from gevent.testing.sysinfo import CFFI_BACKEND +from gevent.testing.flaky import reraises_flaky_timeout + + +class Test(TestCase): + __timeout__ = LARGE_TIMEOUT + + repeat = 0 + timer_duration = 0.001 + + def setUp(self): + super(Test, self).setUp() + self.called = [] + self.loop = config.loop(default=False) + self.timer = self.loop.timer(self.timer_duration, repeat=self.repeat) + assert not self.loop.default + + def cleanup(self): + # cleanup instead of tearDown to cooperate well with + # leakcheck.py + self.timer.close() + # cycle the loop so libuv close callbacks fire + self.loop.run() + self.loop.destroy() + self.loop = None + self.timer = None + + def f(self, x=None): + self.called.append(1) + if x is not None: + x.stop() + + def assertTimerInKeepalive(self): + if CFFI_BACKEND: + self.assertIn(self.timer, self.loop._keepaliveset) + + def assertTimerNotInKeepalive(self): + if CFFI_BACKEND: + self.assertNotIn(self.timer, self.loop._keepaliveset) + + def test_main(self): + loop = self.loop + x = self.timer + x.start(self.f) + self.assertTimerInKeepalive() + self.assertTrue(x.active, x) + + with self.assertRaises((AttributeError, ValueError)): + x.priority = 1 + + loop.run() + self.assertEqual(x.pending, 0) + self.assertEqual(self.called, [1]) + self.assertIsNone(x.callback) + self.assertIsNone(x.args) + + if x.priority is not None: + self.assertEqual(x.priority, 0) + x.priority = 1 + self.assertEqual(x.priority, 1) + + x.stop() + self.assertTimerNotInKeepalive() + +class TestAgain(Test): + repeat = 1 + + def test_main(self): + # Again works for a new timer + x = self.timer + x.again(self.f, x) + self.assertTimerInKeepalive() + + self.assertEqual(x.args, (x,)) + + # XXX: On libev, this takes 1 second. On libuv, + # it takes the expected time. + self.loop.run() + + self.assertEqual(self.called, [1]) + + x.stop() + self.assertTimerNotInKeepalive() + + +class TestTimerResolution(Test): + + # On CI, with *all* backends, sometimes we get timer values of + # 0.02 or higher. + @reraises_flaky_timeout(AssertionError) + def test_resolution(self): # pylint:disable=too-many-locals + # Make sure that having an active IO watcher + # doesn't badly throw off our timer resolution. + # (This was a specific problem with libuv) + + # https://github.com/gevent/gevent/pull/1194 + from gevent._compat import perf_counter + + import socket + s = socket.socket() + self._close_on_teardown(s) + fd = s.fileno() + + ran_at_least_once = False + fired_at = [] + + def timer_counter(): + fired_at.append(perf_counter()) + + loop = self.loop + + timer_multiplier = 11 + max_time = self.timer_duration * timer_multiplier + assert max_time < 0.3 + + for _ in range(150): + # in libuv, our signal timer fires every 300ms; depending on + # when this runs, we could artificially get a better + # resolution than we expect. Run it multiple times to be more sure. + io = loop.io(fd, 1) + io.start(lambda events=None: None) + + + now = perf_counter() + del fired_at[:] + timer = self.timer + timer.start(timer_counter) + + loop.run(once=True) + + io.stop() + io.close() + + timer.stop() + + if fired_at: + ran_at_least_once = True + self.assertEqual(1, len(fired_at)) + self.assertTimeWithinRange(fired_at[0] - now, + 0, + max_time) + + + if not greentest.RUNNING_ON_CI: + # Hmm, this always fires locally on mocOS but + # not an Travis? + self.assertTrue(ran_at_least_once) + + +if __name__ == '__main__': + greentest.main() diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__core_watcher.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__core_watcher.py new file mode 100644 index 00000000..bd52805c --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__core_watcher.py @@ -0,0 +1,124 @@ +from __future__ import absolute_import, print_function + +import gevent.testing as greentest +from gevent import config +from gevent.testing.sysinfo import CFFI_BACKEND + +from gevent.core import READ # pylint:disable=no-name-in-module +from gevent.core import WRITE # pylint:disable=no-name-in-module + + +class Test(greentest.TestCase): + + __timeout__ = None + + def setUp(self): + super(Test, self).setUp() + self.loop = config.loop(default=False) + self.timer = self.loop.timer(0.01) + + def tearDown(self): + if self.timer is not None: + self.timer.close() + if self.loop is not None: + self.loop.destroy() + self.loop = self.timer = None + super(Test, self).tearDown() + + def test_non_callable_to_start(self): + # test that cannot pass non-callable thing to start() + self.assertRaises(TypeError, self.timer.start, None) + self.assertRaises(TypeError, self.timer.start, 5) + + def test_non_callable_after_start(self): + # test that cannot set 'callback' to non-callable thing later either + lst = [] + timer = self.timer + timer.start(lst.append) + + + with self.assertRaises(TypeError): + timer.callback = False + + with self.assertRaises(TypeError): + timer.callback = 5 + + def test_args_can_be_changed_after_start(self): + lst = [] + timer = self.timer + self.timer.start(lst.append) + self.assertEqual(timer.args, ()) + timer.args = (1, 2, 3) + self.assertEqual(timer.args, (1, 2, 3)) + + # Only tuple can be args + with self.assertRaises(TypeError): + timer.args = 5 + with self.assertRaises(TypeError): + timer.args = [4, 5] + + self.assertEqual(timer.args, (1, 2, 3)) + + # None also works, means empty tuple + # XXX why? + timer.args = None + self.assertEqual(timer.args, None) + + + def test_run(self): + loop = self.loop + lst = [] + + self.timer.start(lambda *args: lst.append(args)) + + loop.run() + loop.update_now() + + self.assertEqual(lst, [()]) + + # Even if we lose all references to it, the ref in the callback + # keeps it alive + self.timer.start(reset, self.timer, lst) + self.timer = None + loop.run() + self.assertEqual(lst, [(), 25]) + + def test_invalid_fd(self): + loop = self.loop + + # Negative case caught everywhere. ValueError + # on POSIX, OSError on Windows Py3, IOError on Windows Py2 + with self.assertRaises((ValueError, OSError, IOError)): + loop.io(-1, READ) + + + @greentest.skipOnWindows("Stdout can't be watched on Win32") + def test_reuse_io(self): + loop = self.loop + + # Watchers aren't reused once all outstanding + # refs go away BUT THEY MUST BE CLOSED + tty_watcher = loop.io(1, WRITE) + watcher_handle = tty_watcher._watcher if CFFI_BACKEND else tty_watcher + tty_watcher.close() + del tty_watcher + # XXX: Note there is a cycle in the CFFI code + # from watcher_handle._handle -> watcher_handle. + # So it doesn't go away until a GC runs. + import gc + gc.collect() + + tty_watcher = loop.io(1, WRITE) + self.assertIsNot(tty_watcher._watcher if CFFI_BACKEND else tty_watcher, watcher_handle) + tty_watcher.close() + + +def reset(watcher, lst): + watcher.args = None + watcher.callback = lambda: None + lst.append(25) + watcher.close() + + +if __name__ == '__main__': + greentest.main() diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__destroy.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__destroy.py new file mode 100644 index 00000000..784723a3 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__destroy.py @@ -0,0 +1,51 @@ +from __future__ import absolute_import, print_function + +import gevent +import unittest + +class TestDestroyHub(unittest.TestCase): + + def test_destroy_hub(self): + # Loop of initial Hub is default loop. + hub = gevent.get_hub() + self.assertTrue(hub.loop.default) + + # Save `gevent.core.loop` object for later comparison. + initloop = hub.loop + + # Increase test complexity via threadpool creation. + # Implicitly creates fork watcher connected to the current event loop. + tp = hub.threadpool + self.assertIsNotNone(tp) + + # Destroy hub. Does not destroy libev default loop if not explicitly told to. + hub.destroy() + + # Create new hub. Must re-use existing libev default loop. + hub = gevent.get_hub() + self.assertTrue(hub.loop.default) + + # Ensure that loop object is identical to the initial one. + self.assertIs(hub.loop, initloop) + + # Destroy hub including default loop. + hub.destroy(destroy_loop=True) + + # Create new hub and explicitly request creation of a new default loop. + hub = gevent.get_hub(default=True) + self.assertTrue(hub.loop.default) + + # `gevent.core.loop` objects as well as libev loop pointers must differ. + self.assertIsNot(hub.loop, initloop) + self.assertIsNot(hub.loop.ptr, initloop.ptr) + self.assertNotEqual(hub.loop.ptr, initloop.ptr) + + # Destroy hub including default loop. The default loop regenerates. + hub.destroy(destroy_loop=True) + hub = gevent.get_hub() + self.assertTrue(hub.loop.default) + + hub.destroy() + +if __name__ == '__main__': + unittest.main() diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__destroy_default_loop.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__destroy_default_loop.py new file mode 100644 index 00000000..c655b8d3 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__destroy_default_loop.py @@ -0,0 +1,56 @@ +from __future__ import print_function +import gevent + +import unittest + +class TestDestroyDefaultLoop(unittest.TestCase): + + def test_destroy_gc(self): + # Issue 1098: destroying the default loop + # while using the C extension could crash + # the interpreter when it exits + + # Create the hub greenlet. This creates one loop + # object pointing to the default loop. + gevent.get_hub() + + # Get a new loop object, but using the default + # C loop + loop = gevent.config.loop(default=True) + self.assertTrue(loop.default) + # Destroy it + loop.destroy() + # It no longer claims to be the default + self.assertFalse(loop.default) + + # Delete it + del loop + # Delete the hub. This prompts garbage + # collection of it and its loop object. + # (making this test more repeatable; the exit + # crash only happened when that greenlet object + # was collected at exit time, which was most common + # in CPython 3.5) + from gevent._hub_local import set_hub + set_hub(None) + + + + def test_destroy_two(self): + # Get two new loop object, but using the default + # C loop + loop1 = gevent.config.loop(default=True) + loop2 = gevent.config.loop(default=True) + self.assertTrue(loop1.default) + self.assertTrue(loop2.default) + # Destroy the first + loop1.destroy() + # It no longer claims to be the default + self.assertFalse(loop1.default) + + # Destroy the second. This doesn't crash. + loop2.destroy() + + +if __name__ == '__main__': + unittest.main() diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__doctests.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__doctests.py new file mode 100644 index 00000000..731a9ee8 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__doctests.py @@ -0,0 +1,133 @@ +from __future__ import print_function + +import doctest +import functools +import os +import re +import sys +import unittest + + + +# Ignore tracebacks: ZeroDivisionError + + +def myfunction(*_args, **_kwargs): + pass + + +class RENormalizingOutputChecker(doctest.OutputChecker): + """ + Pattern-normalizing output checker. Inspired by one used in zope.testing. + """ + + def __init__(self, patterns): + self.transformers = [functools.partial(re.sub, replacement) for re, replacement in patterns] + + def check_output(self, want, got, optionflags): + if got == want: + return True + + for transformer in self.transformers: + want = transformer(want) + got = transformer(got) + + return doctest.OutputChecker.check_output(self, want, got, optionflags) + +FORBIDDEN_MODULES = set() + + +class Modules(object): + + def __init__(self, allowed_modules): + from gevent.testing import walk_modules + self.allowed_modules = allowed_modules + self.modules = set() + + for path, module in walk_modules(recursive=True): + self.add_module(module, path) + + + def add_module(self, name, path): + if self.allowed_modules and name not in self.allowed_modules: + return + if name in FORBIDDEN_MODULES: + return + self.modules.add((name, path)) + + def __bool__(self): + return bool(self.modules) + + __nonzero__ = __bool__ + + def __iter__(self): + return iter(self.modules) + + +def main(): # pylint:disable=too-many-locals + cwd = os.getcwd() + # Use pure_python to get the correct module source and docstrings + os.environ['PURE_PYTHON'] = '1' + + import gevent + from gevent import socket + + + from gevent.testing import util + from gevent.testing import sysinfo + + if sysinfo.WIN: + FORBIDDEN_MODULES.update({ + # Uses commands only found on posix + 'gevent.subprocess', + }) + + try: + allowed_modules = sys.argv[1:] + sys.path.append('.') + + globs = { + 'myfunction': myfunction, + 'gevent': gevent, + 'socket': socket, + } + + modules = Modules(allowed_modules) + + if not modules: + sys.exit('No modules found matching %s' % ' '.join(allowed_modules)) + + suite = unittest.TestSuite() + checker = RENormalizingOutputChecker(( + # Normalize subprocess.py: BSD ls is in the example, gnu ls outputs + # 'cannot access' + (re.compile( + "ls: cannot access 'non_existent_file': No such file or directory"), + "ls: non_existent_file: No such file or directory"), + # Python 3 bytes add a "b". + (re.compile(r'b(".*?")'), r"\1"), + (re.compile(r"b('.*?')"), r"\1"), + )) + + tests_count = 0 + modules_count = 0 + for m, path in sorted(modules): + with open(path, 'rb') as f: + contents = f.read() + if re.search(br'^\s*>>> ', contents, re.M): + s = doctest.DocTestSuite(m, extraglobs=globs, checker=checker) + test_count = len(s._tests) + util.log('%s (from %s): %s tests', m, path, test_count) + suite.addTest(s) + modules_count += 1 + tests_count += test_count + + util.log('Total: %s tests in %s modules', tests_count, modules_count) + # TODO: Pass this off to unittest.main() + runner = unittest.TextTestRunner(verbosity=2) + runner.run(suite) + finally: + os.chdir(cwd) + +if __name__ == '__main__': + main() diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__environ.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__environ.py new file mode 100644 index 00000000..fae25ab3 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__environ.py @@ -0,0 +1,17 @@ +import os +import sys +import gevent +import gevent.core +import subprocess + +if sys.argv[1:] == []: + os.environ['GEVENT_BACKEND'] = 'select' + popen = subprocess.Popen([sys.executable, __file__, '1']) + assert popen.wait() == 0, popen.poll() +else: # pragma: no cover + hub = gevent.get_hub() + if 'select' in gevent.core.supported_backends(): + assert hub.loop.backend == 'select', hub.loop.backend + else: + # libuv isn't configurable + assert hub.loop.backend == 'default', hub.loop.backend diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__event.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__event.py new file mode 100644 index 00000000..4c95fee3 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__event.py @@ -0,0 +1,254 @@ +from __future__ import absolute_import, print_function, division + +import weakref + +import gevent +from gevent.event import Event, AsyncResult + +import gevent.testing as greentest + +from gevent.testing.six import xrange +from gevent.testing.timing import AbstractGenericGetTestCase +from gevent.testing.timing import AbstractGenericWaitTestCase +from gevent.testing.timing import SMALL_TICK +from gevent.testing.timing import SMALL_TICK_MAX_ADJ + +DELAY = SMALL_TICK + SMALL_TICK_MAX_ADJ + + +class TestEventWait(AbstractGenericWaitTestCase): + + def wait(self, timeout): + Event().wait(timeout=timeout) + + def test_cover(self): + str(Event()) + + +class TestWaitEvent(AbstractGenericWaitTestCase): + + def wait(self, timeout): + gevent.wait([Event()], timeout=timeout) + + def test_set_during_wait(self): + # https://github.com/gevent/gevent/issues/771 + # broke in the refactoring. we must not add new links + # while we're running the callback + + event = Event() + + def setter(): + event.set() + + def waiter(): + s = gevent.spawn(setter) + # let the setter set() the event; + # when this method returns we'll be running in the Event._notify_links callback + # (that is, it switched to us) + res = event.wait() + self.assertTrue(res) + self.assertTrue(event.ready()) + s.join() # make sure it's dead + # Clear the event. Now we can't wait for the event without + # another set to happen. + event.clear() + self.assertFalse(event.ready()) + + # Before the bug fix, this would return "immediately" with + # event in the result list, because the _notify_links loop would + # immediately add the waiter and call it + o = gevent.wait((event,), timeout=0.01) + self.assertFalse(event.ready()) + self.assertNotIn(event, o) + + gevent.spawn(waiter).join() + + +class TestAsyncResultWait(AbstractGenericWaitTestCase): + + def wait(self, timeout): + AsyncResult().wait(timeout=timeout) + + +class TestWaitAsyncResult(AbstractGenericWaitTestCase): + + def wait(self, timeout): + gevent.wait([AsyncResult()], timeout=timeout) + + +class TestAsyncResultGet(AbstractGenericGetTestCase): + + def wait(self, timeout): + AsyncResult().get(timeout=timeout) + +class MyException(Exception): + pass + +class TestAsyncResult(greentest.TestCase): + + def test_link(self): + ar = AsyncResult() + self.assertRaises(TypeError, ar.rawlink, None) + ar.unlink(None) # doesn't raise + ar.unlink(None) # doesn't raise + str(ar) # cover + + def test_set_exc(self): + log = [] + e = AsyncResult() + self.assertEqual(e.exc_info, ()) + self.assertEqual(e.exception, None) + + def waiter(): + with self.assertRaises(MyException) as exc: + e.get() + log.append(('caught', exc.exception)) + gevent.spawn(waiter) + obj = MyException() + e.set_exception(obj) + gevent.sleep(0) + self.assertEqual(log, [('caught', obj)]) + + def test_set(self): + event1 = AsyncResult() + timer_exc = MyException('interrupted') + + # Notice that this test is racy: + # After DELAY, we set the event. We also try to immediately + # raise the exception with a timer of 0 --- but that depends + # on cycling the loop. Hence the fairly large value for DELAY. + g = gevent.spawn_later(DELAY, event1.set, 'hello event1') + self._close_on_teardown(g.kill) + with gevent.Timeout.start_new(0, timer_exc): + with self.assertRaises(MyException) as exc: + event1.get() + self.assertIs(timer_exc, exc.exception) + + def test_set_with_timeout(self): + event2 = AsyncResult() + + X = object() + result = gevent.with_timeout(DELAY, event2.get, timeout_value=X) + self.assertIs( + result, X, + 'Nobody sent anything to event2 yet it received %r' % (result, )) + + def test_nonblocking_get(self): + ar = AsyncResult() + self.assertRaises(gevent.Timeout, ar.get, block=False) + self.assertRaises(gevent.Timeout, ar.get_nowait) + + +class TestAsyncResultAsLinkTarget(greentest.TestCase): + error_fatal = False + + def test_set(self): + g = gevent.spawn(lambda: 1) + s1, s2, s3 = AsyncResult(), AsyncResult(), AsyncResult() + g.link(s1) + g.link_value(s2) + g.link_exception(s3) + self.assertEqual(s1.get(), 1) + self.assertEqual(s2.get(), 1) + X = object() + result = gevent.with_timeout(DELAY, s3.get, timeout_value=X) + self.assertIs(result, X) + + def test_set_exception(self): + def func(): + raise greentest.ExpectedException('TestAsyncResultAsLinkTarget.test_set_exception') + g = gevent.spawn(func) + s1, s2, s3 = AsyncResult(), AsyncResult(), AsyncResult() + g.link(s1) + g.link_value(s2) + g.link_exception(s3) + self.assertRaises(greentest.ExpectedException, s1.get) + X = object() + result = gevent.with_timeout(DELAY, s2.get, timeout_value=X) + self.assertIs(result, X) + self.assertRaises(greentest.ExpectedException, s3.get) + + +class TestEvent_SetThenClear(greentest.TestCase): + N = 1 + + def test(self): + e = Event() + waiters = [gevent.spawn(e.wait) for i in range(self.N)] + gevent.sleep(0.001) + e.set() + e.clear() + for greenlet in waiters: + greenlet.join() + + +class TestEvent_SetThenClear100(TestEvent_SetThenClear): + N = 100 + + +class TestEvent_SetThenClear1000(TestEvent_SetThenClear): + N = 1000 + + +class TestWait(greentest.TestCase): + N = 5 + count = None + timeout = 1 + period = timeout / 100.0 + + def _sender(self, events, asyncs): + while events or asyncs: + gevent.sleep(self.period) + if events: + events.pop().set() + gevent.sleep(self.period) + if asyncs: + asyncs.pop().set() + + @greentest.skipOnAppVeyor("Not all results have arrived sometimes due to timer issues") + def test(self): + events = [Event() for _ in xrange(self.N)] + asyncs = [AsyncResult() for _ in xrange(self.N)] + max_len = len(events) + len(asyncs) + sender = gevent.spawn(self._sender, events, asyncs) + results = gevent.wait(events + asyncs, count=self.count, timeout=self.timeout) + if self.timeout is None: + expected_len = max_len + else: + expected_len = min(max_len, self.timeout / self.period) + if self.count is None: + self.assertTrue(sender.ready(), sender) + else: + expected_len = min(self.count, expected_len) + self.assertFalse(sender.ready(), sender) + sender.kill() + self.assertEqual(expected_len, len(results), (expected_len, len(results), results)) + + +class TestWait_notimeout(TestWait): + timeout = None + + +class TestWait_count1(TestWait): + count = 1 + + +class TestWait_count2(TestWait): + count = 2 + +class TestEventBasics(greentest.TestCase): + + def test_weakref(self): + # Event objects should allow weakrefs + e = Event() + r = weakref.ref(e) + self.assertIs(e, r()) + del e + del r + + +del AbstractGenericGetTestCase +del AbstractGenericWaitTestCase + +if __name__ == '__main__': + greentest.main() diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__events.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__events.py new file mode 100644 index 00000000..f95da3a0 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__events.py @@ -0,0 +1,39 @@ +# -*- coding: utf-8 -*- +# Copyright 2018 gevent. See LICENSE. +from __future__ import absolute_import +from __future__ import division +from __future__ import print_function + + +import unittest + +from gevent import events +from zope.interface import verify + +class TestImplements(unittest.TestCase): + + def test_event_loop_blocked(self): + verify.verifyClass(events.IEventLoopBlocked, events.EventLoopBlocked) + + def test_mem_threshold(self): + verify.verifyClass(events.IMemoryUsageThresholdExceeded, + events.MemoryUsageThresholdExceeded) + verify.verifyObject(events.IMemoryUsageThresholdExceeded, + events.MemoryUsageThresholdExceeded(0, 0, 0)) + + def test_mem_decreased(self): + verify.verifyClass(events.IMemoryUsageUnderThreshold, + events.MemoryUsageUnderThreshold) + verify.verifyObject(events.IMemoryUsageUnderThreshold, + events.MemoryUsageUnderThreshold(0, 0, 0, 0)) + + +class TestEvents(unittest.TestCase): + + def test_is_zope(self): + from zope import event + self.assertIs(events.subscribers, event.subscribers) + self.assertIs(events.notify, event.notify) + +if __name__ == '__main__': + unittest.main() diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__example_echoserver.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__example_echoserver.py new file mode 100644 index 00000000..128678a1 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__example_echoserver.py @@ -0,0 +1,40 @@ +from gevent.socket import create_connection, timeout +import gevent.testing as greentest +import gevent + +from gevent.testing import util +from gevent.testing import params + +class Test(util.TestServer): + server = 'echoserver.py' + + def _run_all_tests(self): + def test_client(message): + if greentest.PY3: + kwargs = {'buffering': 1} + else: + kwargs = {'bufsize': 1} + kwargs['mode'] = 'rb' + conn = create_connection((params.DEFAULT_LOCAL_HOST_ADDR, 16000)) + conn.settimeout(greentest.DEFAULT_XPC_SOCKET_TIMEOUT) + rfile = conn.makefile(**kwargs) + + welcome = rfile.readline() + self.assertIn(b'Welcome', welcome) + + conn.sendall(message) + received = rfile.read(len(message)) + self.assertEqual(received, message) + + self.assertRaises(timeout, conn.recv, 1) + + rfile.close() + conn.close() + + client1 = gevent.spawn(test_client, b'hello\r\n') + client2 = gevent.spawn(test_client, b'world\r\n') + gevent.joinall([client1, client2], raise_error=True) + + +if __name__ == '__main__': + greentest.main() diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__example_portforwarder.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__example_portforwarder.py new file mode 100644 index 00000000..cd6292c6 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__example_portforwarder.py @@ -0,0 +1,66 @@ +from __future__ import print_function, absolute_import +from gevent import monkey; monkey.patch_all(subprocess=True) +import signal +import sys +import socket +from time import sleep + +import gevent +from gevent.server import StreamServer + +import gevent.testing as greentest +from gevent.testing import util + +@greentest.skipOnLibuvOnCIOnPyPy("Timing issues sometimes lead to connection refused") +class Test(util.TestServer): + server = 'portforwarder.py' + args = ['127.0.0.1:10011', '127.0.0.1:10012'] + + if sys.platform.startswith('win'): + from subprocess import CREATE_NEW_PROCESS_GROUP + # Must be in a new process group to use CTRL_C_EVENT, otherwise + # we get killed too + start_kwargs = {'creationflags': CREATE_NEW_PROCESS_GROUP} + + def after(self): + if sys.platform == 'win32': + self.assertIsNotNone(self.popen.poll()) + else: + self.assertEqual(self.popen.poll(), 0) + + def _run_all_tests(self): + log = [] + + def handle(sock, _address): + while True: + data = sock.recv(1024) + print('got %r' % data) + if not data: + break + log.append(data) + + server = StreamServer(self.args[1], handle) + server.start() + try: + conn = socket.create_connection(('127.0.0.1', 10011)) + conn.sendall(b'msg1') + sleep(0.1) + # On Windows, SIGTERM actually abruptly terminates the process; + # it can't be caught. However, CTRL_C_EVENT results in a KeyboardInterrupt + # being raised, so we can shut down properly. + self.popen.send_signal(getattr(signal, 'CTRL_C_EVENT', signal.SIGTERM)) + sleep(0.1) + + conn.sendall(b'msg2') + conn.close() + + with gevent.Timeout(2.1): + self.popen.wait() + finally: + server.close() + + self.assertEqual([b'msg1', b'msg2'], log) + + +if __name__ == '__main__': + greentest.main() diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__example_udp_client.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__example_udp_client.py new file mode 100644 index 00000000..d4dacec2 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__example_udp_client.py @@ -0,0 +1,31 @@ +from gevent import monkey +monkey.patch_all(subprocess=True) + +import sys +from gevent.server import DatagramServer + +from gevent.testing.util import run +from gevent.testing import util +from gevent.testing import main + +class Test_udp_client(util.TestServer): + + def test(self): + log = [] + + def handle(message, address): + log.append(message) + server.sendto(b'reply-from-server', address) + + server = DatagramServer('127.0.0.1:9001', handle) + server.start() + try: + run([sys.executable, '-W', 'ignore', '-u', 'udp_client.py', 'Test_udp_client'], + timeout=10, cwd=self.cwd) + finally: + server.close() + self.assertEqual(log, [b'Test_udp_client']) + + +if __name__ == '__main__': + main() diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__example_udp_server.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__example_udp_server.py new file mode 100644 index 00000000..23c40572 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__example_udp_server.py @@ -0,0 +1,22 @@ +import socket + +from gevent.testing import util +from gevent.testing import main + + +class Test(util.TestServer): + server = 'udp_server.py' + + def _run_all_tests(self): + sock = socket.socket(type=socket.SOCK_DGRAM) + try: + sock.connect(('127.0.0.1', 9000)) + sock.send(b'Test udp_server') + data, _address = sock.recvfrom(8192) + self.assertEqual(data, b'Received 15 bytes') + finally: + sock.close() + + +if __name__ == '__main__': + main() diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__examples.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__examples.py new file mode 100644 index 00000000..3310be9a --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__examples.py @@ -0,0 +1,87 @@ +import sys +import os +import glob +import time +import unittest + +import gevent.testing as greentest +from gevent.testing import util + +this_dir = os.path.dirname(__file__) + +def _find_files_to_ignore(): + old_dir = os.getcwd() + try: + os.chdir(this_dir) + + result = [ + 'wsgiserver.py', + 'wsgiserver_ssl.py', + 'webproxy.py', + 'webpy.py', + 'unixsocket_server.py', + 'unixsocket_client.py', + 'psycopg2_pool.py', + 'geventsendfile.py', + ] + result += [x[14:] for x in glob.glob('test__example_*.py')] + + finally: + os.chdir(old_dir) + + return result + +default_time_range = (2, 4) +time_ranges = { + 'concurrent_download.py': (0, 30), + 'processes.py': (0, 4) +} + +class _AbstractTestMixin(util.ExampleMixin): + time_range = (2, 4) + filename = None + + def test_runs(self): + start = time.time() + min_time, max_time = self.time_range + if util.run([sys.executable, '-u', self.filename], + timeout=max_time, + cwd=self.cwd, + quiet=True, + buffer_output=True, + nested=True, + setenv={'GEVENT_DEBUG': 'error'}): + self.fail("Failed example: " + self.filename) + else: + took = time.time() - start + self.assertGreaterEqual(took, min_time) + +def _build_test_classes(): + result = {} + try: + example_dir = util.ExampleMixin().cwd + except unittest.SkipTest: + util.log("WARNING: No examples dir found", color='suboptimal-behaviour') + return result + + ignore = _find_files_to_ignore() + for filename in glob.glob(example_dir + '/*.py'): + bn = os.path.basename(filename) + if bn in ignore: + continue + tc = type( + 'Test_' + bn, + (_AbstractTestMixin, greentest.TestCase), + { + 'filename': bn, + 'time_range': time_ranges.get(bn, _AbstractTestMixin.time_range) + } + ) + result[tc.__name__] = tc + return result + +for k, v in _build_test_classes().items(): + locals()[k] = v + +if __name__ == '__main__': + greentest.main() diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__exc_info.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__exc_info.py new file mode 100644 index 00000000..7656ab82 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__exc_info.py @@ -0,0 +1,58 @@ +import gevent +import sys +import gevent.testing as greentest +from gevent.testing import six +from gevent.testing import ExpectedException as ExpectedError + +if not six.PY3: + sys.exc_clear() + +class RawException(Exception): + pass + + +def hello(err): + assert sys.exc_info() == (None, None, None), sys.exc_info() + raise err + + +def hello2(): + try: + hello(ExpectedError('expected exception in hello')) + except ExpectedError: + pass + + +class Test(greentest.TestCase): + + def test1(self): + error = RawException('hello') + expected_error = ExpectedError('expected exception in hello') + try: + raise error + except RawException: + self.expect_one_error() + g = gevent.spawn(hello, expected_error) + g.join() + self.assert_error(ExpectedError, expected_error) + self.assertIsInstance(g.exception, ExpectedError) + + try: + raise + except: # pylint:disable=bare-except + ex = sys.exc_info()[1] + self.assertIs(ex, error) + + def test2(self): + timer = gevent.get_hub().loop.timer(0) + timer.start(hello2) + try: + gevent.sleep(0.1) + self.assertEqual(sys.exc_info(), (None, None, None)) + finally: + timer.close() + + + +if __name__ == '__main__': + greentest.main() diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__execmodules.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__execmodules.py new file mode 100644 index 00000000..1844a305 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__execmodules.py @@ -0,0 +1,39 @@ +import unittest +import warnings + +from gevent.testing.modules import walk_modules +from gevent.testing import main +from gevent.testing.sysinfo import NON_APPLICABLE_SUFFIXES + + +from gevent.testing import six + + +class TestExec(unittest.TestCase): + pass + + +def make_exec_test(path, module): + + def test(_): + with open(path, 'rb') as f: + src = f.read() + with warnings.catch_warnings(): + warnings.simplefilter('ignore', DeprecationWarning) + six.exec_(src, {'__file__': path}) + + name = "test_" + module.replace(".", "_") + test.__name__ = name + setattr(TestExec, name, test) + +def make_all_tests(): + for path, module in walk_modules(recursive=True): + if module.endswith(NON_APPLICABLE_SUFFIXES): + continue + make_exec_test(path, module) + + +make_all_tests() + +if __name__ == '__main__': + main() diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__fileobject.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__fileobject.py new file mode 100644 index 00000000..d3bdef84 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__fileobject.py @@ -0,0 +1,278 @@ +from __future__ import print_function +import os +import sys +import tempfile +import gc +import unittest + +import gevent +from gevent import fileobject + +import gevent.testing as greentest +from gevent.testing.sysinfo import PY3 +from gevent.testing.flaky import reraiseFlakyTestRaceConditionLibuv +from gevent.testing.skipping import skipOnLibuvOnCIOnPyPy + + +try: + ResourceWarning +except NameError: + class ResourceWarning(Warning): + "Python 2 fallback" + + +def writer(fobj, line): + for character in line: + fobj.write(character) + fobj.flush() + fobj.close() + + +def close_fd_quietly(fd): + try: + os.close(fd) + except (IOError, OSError): + pass + +class TestFileObjectBlock(greentest.TestCase): + + def _getTargetClass(self): + return fileobject.FileObjectBlock + + def _makeOne(self, *args, **kwargs): + return self._getTargetClass()(*args, **kwargs) + + def _test_del(self, **kwargs): + r, w = os.pipe() + self.addCleanup(close_fd_quietly, r) + self.addCleanup(close_fd_quietly, w) + + self._do_test_del((r, w), **kwargs) + + def _do_test_del(self, pipe, **kwargs): + r, w = pipe + s = self._makeOne(w, 'wb', **kwargs) + s.write(b'x') + try: + s.flush() + except IOError: + # Sometimes seen on Windows/AppVeyor + print("Failed flushing fileobject", repr(s), file=sys.stderr) + import traceback + traceback.print_exc() + + import warnings + with warnings.catch_warnings(): + warnings.simplefilter('ignore', ResourceWarning) + # Deliberately getting ResourceWarning with FileObject(Thread) under Py3 + del s + gc.collect() # PyPy + + if kwargs.get("close", True): + with self.assertRaises((OSError, IOError)): + # expected, because FileObject already closed it + os.close(w) + else: + os.close(w) + + with self._makeOne(r, 'rb') as fobj: + self.assertEqual(fobj.read(), b'x') + + def test_del(self): + # Close should be true by default + self._test_del() + + def test_del_close(self): + self._test_del(close=True) + + @skipOnLibuvOnCIOnPyPy("This appears to crash on libuv/pypy/travis.") + # No idea why, can't duplicate locally. + def test_seek(self): + fileno, path = tempfile.mkstemp('.gevent.test__fileobject.test_seek') + self.addCleanup(os.remove, path) + + s = b'a' * 1024 + os.write(fileno, b'B' * 15) + os.write(fileno, s) + os.close(fileno) + + with open(path, 'rb') as f: + f.seek(15) + native_data = f.read(1024) + + with open(path, 'rb') as f_raw: + try: + f = self._makeOne(f_raw, 'rb', close=False) + except ValueError: + # libuv on Travis can raise EPERM + # from FileObjectPosix. I can't produce it on mac os locally, + # don't know what the issue is. This started happening on Jan 19, + # in the branch that caused all watchers to be explicitly closed. + # That shouldn't have any effect on io watchers, though, which were + # already being explicitly closed. + reraiseFlakyTestRaceConditionLibuv() + + if PY3 or hasattr(f, 'seekable'): + # On Python 3, all objects should have seekable. + # On Python 2, only our custom objects do. + self.assertTrue(f.seekable()) + f.seek(15) + self.assertEqual(15, f.tell()) + + # Note that a duplicate close() of the underlying + # file descriptor can look like an OSError from this line + # as we exit the with block + fileobj_data = f.read(1024) + + self.assertEqual(native_data, s) + self.assertEqual(native_data, fileobj_data) + + def test_close_pipe(self): + # Issue #190, 203 + r, w = os.pipe() + x = self._makeOne(r) + y = self._makeOne(w, 'w') + x.close() + y.close() + + +class ConcurrentFileObjectMixin(object): + # Additional tests for fileobjects that cooperate + # and we have full control of the implementation + + def test_read1(self): + # Issue #840 + r, w = os.pipe() + x = self._makeOne(r) + y = self._makeOne(w, 'w') + self._close_on_teardown(x) + self._close_on_teardown(y) + self.assertTrue(hasattr(x, 'read1')) + + def test_bufsize_0(self): + # Issue #840 + r, w = os.pipe() + x = self._makeOne(r, 'rb', bufsize=0) + y = self._makeOne(w, 'wb', bufsize=0) + self._close_on_teardown(x) + self._close_on_teardown(y) + y.write(b'a') + b = x.read(1) + self.assertEqual(b, b'a') + + y.writelines([b'2']) + b = x.read(1) + self.assertEqual(b, b'2') + + def test_newlines(self): + import warnings + r, w = os.pipe() + lines = [b'line1\n', b'line2\r', b'line3\r\n', b'line4\r\nline5', b'\nline6'] + g = gevent.spawn(writer, self._makeOne(w, 'wb'), lines) + + try: + with warnings.catch_warnings(): + warnings.simplefilter('ignore', DeprecationWarning) + # U is deprecated in Python 3, shows up on FileObjectThread + fobj = self._makeOne(r, 'rU') + result = fobj.read() + fobj.close() + self.assertEqual('line1\nline2\nline3\nline4\nline5\nline6', result) + finally: + g.kill() + + +class TestFileObjectThread(ConcurrentFileObjectMixin, + TestFileObjectBlock): + + def _getTargetClass(self): + return fileobject.FileObjectThread + + # FileObjectThread uses os.fdopen() when passed a file-descriptor, + # which returns an object with a destructor that can't be + # bypassed, so we can't even create one that way + def test_del_noclose(self): + with self.assertRaisesRegex(TypeError, + 'FileObjectThread does not support close=False on an fd.'): + self._test_del(close=False) + + # We don't test this with FileObjectThread. Sometimes the + # visibility of the 'close' operation, which happens in a + # background thread, doesn't make it to the foreground + # thread in a timely fashion, leading to 'os.close(4) must + # not succeed' in test_del_close. We have the same thing + # with flushing and closing in test_newlines. Both of + # these are most commonly (only?) observed on Py27/64-bit. + # They also appear on 64-bit 3.6 with libuv + + def test_del(self): + raise unittest.SkipTest("Race conditions") + + def test_del_close(self): + raise unittest.SkipTest("Race conditions") + + +@unittest.skipUnless( + hasattr(fileobject, 'FileObjectPosix'), + "Needs FileObjectPosix" +) +class TestFileObjectPosix(ConcurrentFileObjectMixin, + TestFileObjectBlock): + + def _getTargetClass(self): + return fileobject.FileObjectPosix + + def test_seek_raises_ioerror(self): + # https://github.com/gevent/gevent/issues/1323 + + # Get a non-seekable file descriptor + r, w = os.pipe() + + self.addCleanup(close_fd_quietly, r) + self.addCleanup(close_fd_quietly, w) + + with self.assertRaises(OSError) as ctx: + os.lseek(r, 0, os.SEEK_SET) + os_ex = ctx.exception + + with self.assertRaises(IOError) as ctx: + f = self._makeOne(r, 'r', close=False) + # Seek directly using the underlying GreenFileDescriptorIO; + # the buffer may do different things, depending + # on the version of Python (especially 3.7+) + f.fileio.seek(0) + io_ex = ctx.exception + + self.assertEqual(io_ex.errno, os_ex.errno) + self.assertEqual(io_ex.strerror, os_ex.strerror) + self.assertEqual(io_ex.args, os_ex.args) + self.assertEqual(str(io_ex), str(os_ex)) + + +class TestTextMode(unittest.TestCase): + + def test_default_mode_writes_linesep(self): + # See https://github.com/gevent/gevent/issues/1282 + # libuv 1.x interferes with the default line mode on + # Windows. + # First, make sure we initialize gevent + gevent.get_hub() + + fileno, path = tempfile.mkstemp('.gevent.test__fileobject.test_default') + self.addCleanup(os.remove, path) + + os.close(fileno) + + with open(path, "w") as f: + f.write("\n") + + with open(path, "rb") as f: + data = f.read() + + self.assertEqual(data, os.linesep.encode('ascii')) + + + +if __name__ == '__main__': + sys.argv.append('-v') + greentest.main() diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__getaddrinfo_import.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__getaddrinfo_import.py new file mode 100644 index 00000000..098ea917 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__getaddrinfo_import.py @@ -0,0 +1,7 @@ +# a deadlock is possible if we import a module that runs Gevent's getaddrinfo +# with a unicode hostname, which starts Python's getaddrinfo on a thread, which +# attempts to import encodings.idna but blocks on the import lock. verify +# that Gevent avoids this deadlock. + +import getaddrinfo_module +del getaddrinfo_module # fix pyflakes diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__greenio.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__greenio.py new file mode 100644 index 00000000..08c4d6a5 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__greenio.py @@ -0,0 +1,128 @@ +# Copyright (c) 2006-2007, Linden Research, Inc. +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. +import sys + +import gevent +from gevent import socket + +from gevent.testing import TestCase, main, tcp_listener +from gevent.testing import skipOnPyPy +from gevent.testing import params + + + +PYPY = hasattr(sys, 'pypy_version_info') +PY3 = sys.version_info[0] >= 3 + + +def _write_to_closed(f, s): + try: + r = f.write(s) + except ValueError: + assert PY3 + else: + assert r is None, r + + +class TestGreenIo(TestCase): + + def test_close_with_makefile(self): + + def accept_close_early(listener): + # verify that the makefile and the socket are truly independent + # by closing the socket prior to using the made file + try: + conn, _ = listener.accept() + fd = conn.makefile(mode='wb') + conn.close() + fd.write(b'hello\n') + fd.close() + _write_to_closed(fd, b'a') + self.assertRaises(socket.error, conn.send, b'b') + finally: + listener.close() + + def accept_close_late(listener): + # verify that the makefile and the socket are truly independent + # by closing the made file and then sending a character + try: + conn, _ = listener.accept() + fd = conn.makefile(mode='wb') + fd.write(b'hello') + fd.close() + conn.send(b'\n') + conn.close() + _write_to_closed(fd, b'a') + self.assertRaises(socket.error, conn.send, b'b') + finally: + listener.close() + + def did_it_work(server): + client = socket.create_connection((params.DEFAULT_CONNECT, server.getsockname()[1])) + fd = client.makefile(mode='rb') + client.close() + self.assertEqual(fd.readline(), b'hello\n') + self.assertFalse(fd.read()) + fd.close() + + server = tcp_listener() + server_greenlet = gevent.spawn(accept_close_early, server) + did_it_work(server) + server_greenlet.kill() + + server = tcp_listener() + server_greenlet = gevent.spawn(accept_close_late, server) + did_it_work(server) + server_greenlet.kill() + + @skipOnPyPy("GC is different") + def test_del_closes_socket(self): + def accept_once(listener): + # delete/overwrite the original conn + # object, only keeping the file object around + # closing the file object should close everything + + # XXX: This is not exactly true on Python 3. + # This produces a ResourceWarning. + oconn = None + try: + conn, _ = listener.accept() + if PY3: + oconn = conn + conn = conn.makefile(mode='wb') + conn.write(b'hello\n') + conn.close() + _write_to_closed(conn, b'a') + finally: + listener.close() + if oconn is not None: + oconn.close() + + server = tcp_listener() + gevent.spawn(accept_once, server) + client = socket.create_connection((params.DEFAULT_CONNECT, server.getsockname()[1])) + with gevent.Timeout.start_new(0.5): + fd = client.makefile() + client.close() + self.assertEqual(fd.read(), 'hello\n') + self.assertEqual(fd.read(), '') + + +if __name__ == '__main__': + main() diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__greenlet.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__greenlet.py new file mode 100644 index 00000000..208482df --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__greenlet.py @@ -0,0 +1,831 @@ +# Copyright (c) 2008-2009 AG Projects +# Author: Denis Bilenko +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. +import re +import unittest + +import gevent.testing as greentest +import gevent + +from gevent import sleep, with_timeout, getcurrent +from gevent import greenlet +from gevent.event import AsyncResult +from gevent.queue import Queue, Channel + +from gevent.testing.timing import AbstractGenericWaitTestCase +from gevent.testing.timing import AbstractGenericGetTestCase +from gevent.testing import timing + +DELAY = timing.SMALL_TICK +greentest.TestCase.error_fatal = False + + +class ExpectedError(greentest.ExpectedException): + pass + + +class TestLink(greentest.TestCase): + + def test_link_to_asyncresult(self): + p = gevent.spawn(lambda: 100) + event = AsyncResult() + p.link(event) + self.assertEqual(event.get(), 100) + + for _ in range(3): + event2 = AsyncResult() + p.link(event2) + self.assertEqual(event2.get(), 100) + + def test_link_to_asyncresult_exception(self): + err = ExpectedError('test_link_to_asyncresult_exception') + p = gevent.spawn(lambda: getcurrent().throw(err)) + event = AsyncResult() + p.link(event) + with self.assertRaises(ExpectedError) as exc: + event.get() + + self.assertIs(exc.exception, err) + + for _ in range(3): + event2 = AsyncResult() + p.link(event2) + with self.assertRaises(ExpectedError) as exc: + event2.get() + self.assertIs(exc.exception, err) + + def test_link_to_queue(self): + p = gevent.spawn(lambda: 100) + q = Queue() + p.link(q.put) + self.assertEqual(q.get().get(), 100) + + for _ in range(3): + p.link(q.put) + self.assertEqual(q.get().get(), 100) + + def test_link_to_channel(self): + p1 = gevent.spawn(lambda: 101) + p2 = gevent.spawn(lambda: 102) + p3 = gevent.spawn(lambda: 103) + q = Channel() + p1.link(q.put) + p2.link(q.put) + p3.link(q.put) + results = [q.get().get(), q.get().get(), q.get().get()] + assert sorted(results) == [101, 102, 103], results + + +class TestUnlink(greentest.TestCase): + switch_expected = False + + def _test_func(self, p, link): + link(dummy_test_func) + self.assertEqual(1, p.has_links()) + + p.unlink(dummy_test_func) + self.assertEqual(0, p.has_links()) + + link(self.setUp) + self.assertEqual(1, p.has_links()) + + p.unlink(self.setUp) + self.assertEqual(0, p.has_links()) + + p.kill() + + def test_func_link(self): + p = gevent.spawn(dummy_test_func) + self._test_func(p, p.link) + + def test_func_link_value(self): + p = gevent.spawn(dummy_test_func) + self._test_func(p, p.link_value) + + def test_func_link_exception(self): + p = gevent.spawn(dummy_test_func) + self._test_func(p, p.link_exception) + + +class LinksTestCase(greentest.TestCase): + + link_method = None + + def link(self, p, listener=None): + getattr(p, self.link_method)(listener) + + def set_links(self, p): + event = AsyncResult() + self.link(p, event) + + queue = Queue(1) + self.link(p, queue.put) + + callback_flag = ['initial'] + self.link(p, lambda *args: callback_flag.remove('initial')) + + for _ in range(10): + self.link(p, AsyncResult()) + self.link(p, Queue(1).put) + + return event, queue, callback_flag + + def set_links_timeout(self, link): + # stuff that won't be touched + event = AsyncResult() + link(event) + + queue = Channel() + link(queue.put) + return event, queue + + def check_timed_out(self, event, queue): + assert with_timeout(DELAY, event.get, timeout_value=X) is X, repr(event.get()) + assert with_timeout(DELAY, queue.get, timeout_value=X) is X, queue.get() + + +def return25(): + return 25 + + + +class TestReturn_link(LinksTestCase): + link_method = 'link' + + p = None + + def cleanup(self): + self.p.unlink_all() + self.p = None + + def test_return(self): + self.p = gevent.spawn(return25) + for _ in range(3): + self._test_return(self.p, 25) + self.p.kill() + + def _test_return(self, p, result): + event, queue, callback_flag = self.set_links(p) + + # stuff that will time out because there's no unhandled exception: + xxxxx = self.set_links_timeout(p.link_exception) + + sleep(DELAY * 2) + self.assertFalse(p) + + self.assertEqual(event.get(), result) + self.assertEqual(queue.get().get(), result) + + sleep(DELAY) + self.assertFalse(callback_flag) + + self.check_timed_out(*xxxxx) + + def _test_kill(self, p): + event, queue, callback_flag = self.set_links(p) + xxxxx = self.set_links_timeout(p.link_exception) + + p.kill() + sleep(DELAY) + self.assertFalse(p) + + + self.assertIsInstance(event.get(), gevent.GreenletExit) + self.assertIsInstance(queue.get().get(), gevent.GreenletExit) + + sleep(DELAY) + self.assertFalse(callback_flag) + + self.check_timed_out(*xxxxx) + + def test_kill(self): + p = self.p = gevent.spawn(sleep, DELAY) + for _ in range(3): + self._test_kill(p) + + +class TestReturn_link_value(TestReturn_link): + link_method = 'link_value' + + +class TestRaise_link(LinksTestCase): + link_method = 'link' + + def _test_raise(self, p): + event, queue, callback_flag = self.set_links(p) + xxxxx = self.set_links_timeout(p.link_value) + + sleep(DELAY) + assert not p, p + + self.assertRaises(ExpectedError, event.get) + self.assertEqual(queue.get(), p) + sleep(DELAY) + assert not callback_flag, callback_flag + + self.check_timed_out(*xxxxx) + + def test_raise(self): + p = gevent.spawn(lambda: getcurrent().throw(ExpectedError('test_raise'))) + for _ in range(3): + self._test_raise(p) + + +class TestRaise_link_exception(TestRaise_link): + link_method = 'link_exception' + + +class TestStuff(greentest.TestCase): + + def test_minimal_id(self): + g = gevent.spawn(lambda: 1) + self.assertGreaterEqual(g.minimal_ident, 0) + self.assertGreaterEqual(g.parent.minimal_ident, 0) + g.join() # don't leave dangling, breaks the leak checks + + def test_wait_noerrors(self): + x = gevent.spawn(lambda: 1) + y = gevent.spawn(lambda: 2) + z = gevent.spawn(lambda: 3) + gevent.joinall([x, y, z], raise_error=True) + self.assertEqual([x.value, y.value, z.value], [1, 2, 3]) + e = AsyncResult() + x.link(e) + self.assertEqual(e.get(), 1) + x.unlink(e) + e = AsyncResult() + x.link(e) + self.assertEqual(e.get(), 1) + + def test_wait_error(self): + + def x(): + sleep(DELAY) + return 1 + x = gevent.spawn(x) + y = gevent.spawn(lambda: getcurrent().throw(ExpectedError('test_wait_error'))) + self.assertRaises(ExpectedError, gevent.joinall, [x, y], raise_error=True) + self.assertRaises(ExpectedError, gevent.joinall, [y], raise_error=True) + x.join() + test_wait_error.ignore_leakcheck = True + + def test_joinall_exception_order(self): + # if there're several exceptions raised, the earliest one must be raised by joinall + def first(): + sleep(0.1) + raise ExpectedError('first') + a = gevent.spawn(first) + b = gevent.spawn(lambda: getcurrent().throw(ExpectedError('second'))) + try: + gevent.joinall([a, b], raise_error=True) + except ExpectedError as ex: + assert 'second' in str(ex), repr(str(ex)) + gevent.joinall([a, b]) + test_joinall_exception_order.ignore_leakcheck = True + + def test_joinall_count_raise_error(self): + # When joinall is asked not to raise an error, the 'count' param still + # works. + def raises_but_ignored(): + raise ExpectedError("count") + + def sleep_forever(): + while True: + sleep(0.1) + + sleeper = gevent.spawn(sleep_forever) + raiser = gevent.spawn(raises_but_ignored) + + gevent.joinall([sleeper, raiser], raise_error=False, count=1) + assert_ready(raiser) + assert_not_ready(sleeper) + + # Clean up our mess + sleeper.kill() + assert_ready(sleeper) + + def test_multiple_listeners_error(self): + # if there was an error while calling a callback + # it should not prevent the other listeners from being called + # also, all of the errors should be logged, check the output + # manually that they are + p = gevent.spawn(lambda: 5) + results = [] + + def listener1(*_args): + results.append(10) + raise ExpectedError('listener1') + + def listener2(*_args): + results.append(20) + raise ExpectedError('listener2') + + def listener3(*_args): + raise ExpectedError('listener3') + + p.link(listener1) + p.link(listener2) + p.link(listener3) + sleep(DELAY * 10) + self.assertIn(results, [[10, 20], [20, 10]]) + + p = gevent.spawn(lambda: getcurrent().throw(ExpectedError('test_multiple_listeners_error'))) + results = [] + p.link(listener1) + p.link(listener2) + p.link(listener3) + sleep(DELAY * 10) + self.assertIn(results, [[10, 20], [20, 10]]) + + class Results(object): + + def __init__(self): + self.results = [] + + def listener1(self, p): + p.unlink(self.listener2) + self.results.append(5) + raise ExpectedError('listener1') + + def listener2(self, p): + p.unlink(self.listener1) + self.results.append(5) + raise ExpectedError('listener2') + + def listener3(self, _p): + raise ExpectedError('listener3') + + def _test_multiple_listeners_error_unlink(self, _p, link): + # notification must not happen after unlink even + # though notification process has been already started + results = self.Results() + + link(results.listener1) + link(results.listener2) + link(results.listener3) + sleep(DELAY * 10) + self.assertEqual([5], results.results) + + + def test_multiple_listeners_error_unlink_Greenlet_link(self): + p = gevent.spawn(lambda: 5) + self._test_multiple_listeners_error_unlink(p, p.link) + p.kill() + + def test_multiple_listeners_error_unlink_Greenlet_rawlink(self): + p = gevent.spawn(lambda: 5) + self._test_multiple_listeners_error_unlink(p, p.rawlink) + + def test_multiple_listeners_error_unlink_AsyncResult_rawlink(self): + e = AsyncResult() + gevent.spawn(e.set, 6) + self._test_multiple_listeners_error_unlink(e, e.rawlink) + + +def dummy_test_func(*_args): + pass + + +class A(object): + + def method(self): + pass + +hexobj = re.compile('-?0x[0123456789abcdef]+L?', re.I) + +class Subclass(gevent.Greenlet): + pass + +class TestStr(greentest.TestCase): + + def test_function(self): + g = gevent.Greenlet.spawn(dummy_test_func) + self.assertTrue(hexobj.sub('X', str(g)).endswith('at X: dummy_test_func>')) + assert_not_ready(g) + g.join() + assert_ready(g) + self.assertTrue(hexobj.sub('X', str(g)).endswith(' at X: dummy_test_func>'), str(g)) + + def test_method(self): + g = gevent.Greenlet.spawn(A().method) + str_g = hexobj.sub('X', str(g)) + str_g = str_g.replace(__name__, 'module') + self.assertTrue(str_g.startswith('>>')) + assert_not_ready(g) + g.join() + assert_ready(g) + str_g = hexobj.sub('X', str(g)) + str_g = str_g.replace(__name__, 'module') + self.assertTrue(str_g.endswith('at X: >>')) + + def test_subclass(self): + g = Subclass() + str_g = hexobj.sub('X', str(g)) + str_g = str_g.replace(__name__, 'module') + self.assertTrue(str_g.startswith('')) + + g = Subclass(None, 'question', answer=42) + str_g = hexobj.sub('X', str(g)) + str_g = str_g.replace(__name__, 'module') + self.assertTrue(str_g.endswith(" at X: _run('question', answer=42)>")) + + +class TestJoin(AbstractGenericWaitTestCase): + + def wait(self, timeout): + g = gevent.spawn(gevent.sleep, 10) + try: + return g.join(timeout=timeout) + finally: + g.kill() + + +class TestGet(AbstractGenericGetTestCase): + + def wait(self, timeout): + g = gevent.spawn(gevent.sleep, 10) + try: + return g.get(timeout=timeout) + finally: + g.kill() + + +class TestJoinAll0(AbstractGenericWaitTestCase): + + g = gevent.Greenlet() + + def wait(self, timeout): + gevent.joinall([self.g], timeout=timeout) + + +class TestJoinAll(AbstractGenericWaitTestCase): + + def wait(self, timeout): + g = gevent.spawn(gevent.sleep, 10) + try: + gevent.joinall([g], timeout=timeout) + finally: + g.kill() + + +class TestBasic(greentest.TestCase): + + def test_spawn_non_callable(self): + self.assertRaises(TypeError, gevent.spawn, 1) + self.assertRaises(TypeError, gevent.spawn_raw, 1) + + # Not passing the run argument, just the seconds argument + self.assertRaises(TypeError, gevent.spawn_later, 1) + # Passing both, but not implemented + self.assertRaises(TypeError, gevent.spawn_later, 1, 1) + + def test_spawn_raw_kwargs(self): + value = [] + + def f(*args, **kwargs): + value.append(args) + value.append(kwargs) + + g = gevent.spawn_raw(f, 1, name='value') + gevent.sleep(0.01) + assert not g + self.assertEqual(value[0], (1,)) + self.assertEqual(value[1], {'name': 'value'}) + + def test_simple_exit(self): + link_test = [] + + def func(delay, return_value=4): + gevent.sleep(delay) + return return_value + + g = gevent.Greenlet(func, 0.01, return_value=5) + g.rawlink(link_test.append) # use rawlink to avoid timing issues on Appveyor/Travis (not always successful) + assert not g, bool(g) + assert not g.dead + assert not g.started + assert not g.ready() + assert not g.successful() + assert g.value is None + assert g.exception is None + + g.start() + assert g # changed + assert not g.dead + assert g.started # changed + assert not g.ready() + assert not g.successful() + assert g.value is None + assert g.exception is None + + gevent.sleep(0.001) + self.assertTrue(g) + self.assertFalse(g.dead, g) + self.assertTrue(g.started, g) + self.assertFalse(g.ready(), g) + self.assertFalse(g.successful(), g) + self.assertIsNone(g.value, g) + self.assertIsNone(g.exception, g) + self.assertFalse(link_test) + + gevent.sleep(0.02) + assert not g + assert g.dead + assert not g.started + assert g.ready() + assert g.successful() + assert g.value == 5 + assert g.exception is None # not changed + assert link_test == [g] or greentest.RUNNING_ON_CI, link_test # changed + + def test_error_exit(self): + link_test = [] + + def func(delay, return_value=4): + gevent.sleep(delay) + error = ExpectedError('test_error_exit') + setattr(error, 'myattr', return_value) + raise error + + g = gevent.Greenlet(func, timing.SMALLEST_RELIABLE_DELAY, return_value=5) + # use rawlink to avoid timing issues on Appveyor (not always successful) + g.rawlink(link_test.append) + g.start() + gevent.sleep() + gevent.sleep(timing.LARGE_TICK) + self.assertFalse(g) + self.assertTrue(g.dead) + self.assertFalse(g.started) + self.assertTrue(g.ready()) + self.assertFalse(g.successful()) + self.assertIsNone(g.value) # not changed + self.assertEqual(g.exception.myattr, 5) + + assert link_test == [g] or greentest.RUNNING_ON_APPVEYOR, link_test + + def _assertKilled(self, g): + assert not g + assert g.dead + assert not g.started + assert g.ready() + assert g.successful(), (repr(g), g.value, g.exception) + assert isinstance(g.value, gevent.GreenletExit), (repr(g), g.value, g.exception) + assert g.exception is None + + def assertKilled(self, g): + self._assertKilled(g) + gevent.sleep(0.01) + self._assertKilled(g) + + def _test_kill(self, g, block): + g.kill(block=block) + if not block: + gevent.sleep(0.01) + self.assertKilled(g) + # kill second time must not hurt + g.kill(block=block) + self.assertKilled(g) + + def _test_kill_not_started(self, block): + link_test = [] + result = [] + g = gevent.Greenlet(lambda: result.append(1)) + g.link(link_test.append) + self._test_kill(g, block=block) + assert not result + assert link_test == [g] + + def test_kill_not_started_block(self): + self._test_kill_not_started(block=True) + + def test_kill_not_started_noblock(self): + self._test_kill_not_started(block=False) + + def _test_kill_just_started(self, block): + result = [] + link_test = [] + g = gevent.Greenlet(lambda: result.append(1)) + g.link(link_test.append) + g.start() + self._test_kill(g, block=block) + assert not result, result + assert link_test == [g] + + def test_kill_just_started_block(self): + self._test_kill_just_started(block=True) + + def test_kill_just_started_noblock(self): + self._test_kill_just_started(block=False) + + def _test_kill_just_started_later(self, block): + result = [] + link_test = [] + g = gevent.Greenlet(lambda: result.append(1)) + g.link(link_test.append) + g.start_later(1) + self._test_kill(g, block=block) + assert not result + + def test_kill_just_started_later_block(self): + self._test_kill_just_started_later(block=True) + + def test_kill_just_started_later_noblock(self): + self._test_kill_just_started_later(block=False) + + def _test_kill_running(self, block): + link_test = [] + g = gevent.spawn(gevent.sleep, 10) + g.link(link_test.append) + self._test_kill(g, block=block) + gevent.sleep(0.01) + assert link_test == [g] + + def test_kill_running_block(self): + self._test_kill_running(block=True) + + def test_kill_running_noblock(self): + self._test_kill_running(block=False) + + def test_exc_info_no_error(self): + # Before running + self.assertFalse(greenlet.Greenlet().exc_info) + g = greenlet.Greenlet(gevent.sleep) + g.start() + g.join() + self.assertFalse(g.exc_info) + + def test_tree_locals(self): + g = g2 = None + def func(): + child = greenlet.Greenlet() + self.assertIs(child.spawn_tree_locals, getcurrent().spawn_tree_locals) + self.assertIs(child.spawning_greenlet(), getcurrent()) + g = greenlet.Greenlet(func) + g2 = greenlet.Greenlet(func) + # Creating those greenlets did not give the main greenlet + # a locals dict. + self.assertFalse(hasattr(getcurrent(), 'spawn_tree_locals'), + getcurrent()) + self.assertIsNot(g.spawn_tree_locals, g2.spawn_tree_locals) + g.start() + g.join() + + raw = gevent.spawn_raw(func) + self.assertIsNotNone(raw.spawn_tree_locals) + self.assertIsNot(raw.spawn_tree_locals, g.spawn_tree_locals) + self.assertIs(raw.spawning_greenlet(), getcurrent()) + while not raw.dead: + gevent.sleep(0.01) + + def test_add_spawn_callback(self): + called = {'#': 0} + + def cb(gr): + called['#'] += 1 + gr._called_test = True + + gevent.Greenlet.add_spawn_callback(cb) + try: + g = gevent.spawn(lambda: None) + self.assertTrue(hasattr(g, '_called_test')) + g.join() + self.assertEqual(called['#'], 1) + + g = gevent.spawn_later(1e-5, lambda: None) + self.assertTrue(hasattr(g, '_called_test')) + g.join() + self.assertEqual(called['#'], 2) + + g = gevent.Greenlet(lambda: None) + g.start() + self.assertTrue(hasattr(g, '_called_test')) + g.join() + self.assertEqual(called['#'], 3) + + gevent.Greenlet.remove_spawn_callback(cb) + g = gevent.spawn(lambda: None) + self.assertFalse(hasattr(g, '_called_test')) + g.join() + self.assertEqual(called['#'], 3) + finally: + gevent.Greenlet.remove_spawn_callback(cb) + + def test_getframe_value_error(self): + def get(): + raise ValueError("call stack is not deep enough") + try: + ogf = greenlet.sys_getframe + except AttributeError: # pragma: no cover + # Must be running cython compiled + raise unittest.SkipTest("Cannot mock when Cython compiled") + greenlet.sys_getframe = get + try: + child = greenlet.Greenlet() + self.assertIsNone(child.spawning_stack) + finally: + greenlet.sys_getframe = ogf + + +class TestStart(greentest.TestCase): + + def test(self): + g = gevent.spawn(gevent.sleep, 0.01) + assert g.started + assert not g.dead + g.start() + assert g.started + assert not g.dead + g.join() + assert not g.started + assert g.dead + g.start() + assert not g.started + assert g.dead + + +def assert_ready(g): + assert g.dead, g + assert g.ready(), g + assert not bool(g), g + + +def assert_not_ready(g): + assert not g.dead, g + assert not g.ready(), g + + +class TestRef(greentest.TestCase): + + def test_init(self): + self.switch_expected = False + # in python-dbg mode this will check that Greenlet() does not create any circular refs + gevent.Greenlet() + + def test_kill_scheduled(self): + gevent.spawn(gevent.sleep, 10).kill() + + def test_kill_started(self): + g = gevent.spawn(gevent.sleep, 10) + try: + gevent.sleep(0.001) + finally: + g.kill() + + +@greentest.skipOnPurePython("Needs C extension") +class TestCExt(greentest.TestCase): # pragma: no cover (we only do coverage on pure-Python) + + def test_c_extension(self): + self.assertEqual(greenlet.Greenlet.__module__, + 'gevent._greenlet') + self.assertEqual(greenlet.SpawnedLink.__module__, + 'gevent._greenlet') + +@greentest.skipWithCExtensions("Needs pure python") +class TestPure(greentest.TestCase): + + def test_pure(self): + self.assertEqual(greenlet.Greenlet.__module__, + 'gevent.greenlet') + self.assertEqual(greenlet.SpawnedLink.__module__, + 'gevent.greenlet') + + +X = object() + +del AbstractGenericGetTestCase +del AbstractGenericWaitTestCase + + +if __name__ == '__main__': + greentest.main() diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__greenletset.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__greenletset.py new file mode 100644 index 00000000..6122857a --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__greenletset.py @@ -0,0 +1,164 @@ +from __future__ import print_function, division, absolute_import +import time +import gevent.testing as greentest + +from gevent.testing import timing +import gevent +from gevent import pool +from gevent.timeout import Timeout + +DELAY = timing.LARGE_TICK + + +class SpecialError(Exception): + pass + + +class Undead(object): + + def __init__(self): + self.shot_count = 0 + + def __call__(self): + while True: + try: + gevent.sleep(1) + except SpecialError: + break + except: # pylint:disable=bare-except + self.shot_count += 1 + + +class Test(greentest.TestCase): + + __timeout__ = greentest.LARGE_TIMEOUT + + def test_basic(self): + s = pool.Group() + s.spawn(gevent.sleep, timing.LARGE_TICK) + self.assertEqual(len(s), 1, s) + s.spawn(gevent.sleep, timing.LARGE_TICK * 5) + self.assertEqual(len(s), 2, s) + gevent.sleep() + gevent.sleep(timing.LARGE_TICK * 2 + timing.LARGE_TICK_MIN_ADJ) + self.assertEqual(len(s), 1, s) + gevent.sleep(timing.LARGE_TICK * 5 + timing.LARGE_TICK_MIN_ADJ) + self.assertFalse(s) + + def test_waitall(self): + s = pool.Group() + s.spawn(gevent.sleep, DELAY) + s.spawn(gevent.sleep, DELAY * 2) + assert len(s) == 2, s + start = time.time() + s.join(raise_error=True) + delta = time.time() - start + self.assertFalse(s) + self.assertEqual(len(s), 0) + self.assertTimeWithinRange(delta, DELAY * 1.9, DELAY * 2.5) + + def test_kill_block(self): + s = pool.Group() + s.spawn(gevent.sleep, DELAY) + s.spawn(gevent.sleep, DELAY * 2) + assert len(s) == 2, s + start = time.time() + s.kill() + self.assertFalse(s) + self.assertEqual(len(s), 0) + delta = time.time() - start + assert delta < DELAY * 0.8, delta + + def test_kill_noblock(self): + s = pool.Group() + s.spawn(gevent.sleep, DELAY) + s.spawn(gevent.sleep, DELAY * 2) + assert len(s) == 2, s + s.kill(block=False) + assert len(s) == 2, s + gevent.sleep(0.0001) + self.assertFalse(s) + self.assertEqual(len(s), 0) + + def test_kill_fires_once(self): + u1 = Undead() + u2 = Undead() + p1 = gevent.spawn(u1) + p2 = gevent.spawn(u2) + + def check(count1, count2): + self.assertTrue(p1) + self.assertTrue(p2) + self.assertFalse(p1.dead, p1) + self.assertFalse(p2.dead, p2) + self.assertEqual(u1.shot_count, count1) + self.assertEqual(u2.shot_count, count2) + + gevent.sleep(0.01) + s = pool.Group([p1, p2]) + self.assertEqual(len(s), 2, s) + check(0, 0) + s.killone(p1, block=False) + check(0, 0) + gevent.sleep(0) + check(1, 0) + s.killone(p1) + check(1, 0) + s.killone(p1) + check(1, 0) + s.kill(block=False) + s.kill(block=False) + s.kill(block=False) + check(1, 0) + gevent.sleep(DELAY) + check(1, 1) + X = object() + kill_result = gevent.with_timeout(DELAY, s.kill, block=True, timeout_value=X) + assert kill_result is X, repr(kill_result) + assert len(s) == 2, s + check(1, 1) + + p1.kill(SpecialError) + p2.kill(SpecialError) + + def test_killall_subclass(self): + p1 = GreenletSubclass.spawn(lambda: 1 / 0) + p2 = GreenletSubclass.spawn(lambda: gevent.sleep(10)) + s = pool.Group([p1, p2]) + s.kill() + + def test_killall_iterable_argument_non_block(self): + p1 = GreenletSubclass.spawn(lambda: gevent.sleep(0.5)) + p2 = GreenletSubclass.spawn(lambda: gevent.sleep(0.5)) + s = set() + s.add(p1) + s.add(p2) + gevent.killall(s, block=False) + gevent.sleep(0.5) + for g in s: + assert g.dead + + def test_killall_iterable_argument_timeout(self): + def f(): + try: + gevent.sleep(1.5) + except: # pylint:disable=bare-except + gevent.sleep(1) + p1 = GreenletSubclass.spawn(f) + p2 = GreenletSubclass.spawn(f) + s = set() + s.add(p1) + s.add(p2) + with self.assertRaises(Timeout): + gevent.killall(s, timeout=0.5) + + for g in s: + self.assertFalse(g.dead, g) + + +class GreenletSubclass(gevent.Greenlet): + pass + + +if __name__ == '__main__': + greentest.main() diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__greenness.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__greenness.py new file mode 100644 index 00000000..5da5a4c6 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__greenness.py @@ -0,0 +1,73 @@ +# Copyright (c) 2008 AG Projects +# Author: Denis Bilenko +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. + +"""Test than modules in gevent.green package are indeed green. +To do that spawn a green server and then access it using a green socket. +If either operation blocked the whole script would block and timeout. +""" +from gevent import monkey +monkey.patch_all() + +import gevent.testing as greentest + +try: + import urllib2 +except ImportError: + from urllib import request as urllib2 +try: + import BaseHTTPServer +except ImportError: + from http import server as BaseHTTPServer + +import gevent +from gevent.testing import params + + +class TestGreenness(greentest.TestCase): + check_totalrefcount = False + + def setUp(self): + server_address = params.DEFAULT_BIND_ADDR_TUPLE + BaseHTTPServer.BaseHTTPRequestHandler.protocol_version = "HTTP/1.0" + self.httpd = BaseHTTPServer.HTTPServer(server_address, BaseHTTPServer.BaseHTTPRequestHandler) + self.httpd.request_count = 0 + + def tearDown(self): + self.httpd.server_close() + self.httpd = None + + def serve(self): + self.httpd.handle_request() + self.httpd.request_count += 1 + + def test_urllib2(self): + server = gevent.spawn(self.serve) + + port = self.httpd.socket.getsockname()[1] + with self.assertRaises(urllib2.HTTPError) as exc: + urllib2.urlopen('http://127.0.0.1:%s' % port) + self.assertEqual(exc.exception.code, 501) + server.get(0.01) + self.assertEqual(self.httpd.request_count, 1) + + +if __name__ == '__main__': + greentest.main() diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__hub.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__hub.py new file mode 100644 index 00000000..44962020 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__hub.py @@ -0,0 +1,332 @@ +# Copyright (c) 2009 AG Projects +# Author: Denis Bilenko +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. + +import re +import time +import unittest + +import gevent.testing as greentest +import gevent.testing.timing + +import gevent +from gevent import socket +from gevent.hub import Waiter, get_hub +from gevent._compat import NativeStrIO + +DELAY = 0.1 + + +class TestCloseSocketWhilePolling(greentest.TestCase): + + def test(self): + sock = socket.socket() + self._close_on_teardown(sock) + t = get_hub().loop.timer(0) + t.start(sock.close) + with self.assertRaises(socket.error): + try: + sock.connect(('python.org', 81)) + finally: + t.close() + + gevent.sleep(0) + + +class TestExceptionInMainloop(greentest.TestCase): + + def test_sleep(self): + # even if there was an error in the mainloop, the hub should continue to work + start = time.time() + gevent.sleep(DELAY) + delay = time.time() - start + + delay_range = DELAY * 0.9 + self.assertTimeWithinRange(delay, DELAY - delay_range, DELAY + delay_range) + + error = greentest.ExpectedException('TestExceptionInMainloop.test_sleep/fail') + + def fail(): + raise error + + with get_hub().loop.timer(0.001) as t: + t.start(fail) + + self.expect_one_error() + + start = time.time() + gevent.sleep(DELAY) + delay = time.time() - start + + self.assert_error(value=error) + self.assertTimeWithinRange(delay, DELAY - delay_range, DELAY + delay_range) + + + +class TestSleep(gevent.testing.timing.AbstractGenericWaitTestCase): + + def wait(self, timeout): + gevent.sleep(timeout) + + def test_simple(self): + gevent.sleep(0) + + +class TestWaiterGet(gevent.testing.timing.AbstractGenericWaitTestCase): + + def setUp(self): + super(TestWaiterGet, self).setUp() + self.waiter = Waiter() + + def wait(self, timeout): + with get_hub().loop.timer(timeout) as evt: + evt.start(self.waiter.switch, None) + return self.waiter.get() + + +class TestWaiter(greentest.TestCase): + + def test(self): + waiter = Waiter() + self.assertEqual(str(waiter), '') + waiter.switch(25) + self.assertEqual(str(waiter), '') + self.assertEqual(waiter.get(), 25) + + waiter = Waiter() + waiter.throw(ZeroDivisionError) + assert re.match('^ midtime: + p.send_signal(signal_to_send) + midtime = endtime + 1 # only once + time.sleep(0.1) + else: + # Kill unresponsive child and exit with error 1 + p.terminate() + p.wait() + raise AssertionError("Failed to wait for child") + + # If we get here, it's because we caused the process to exit; it + # didn't hang. Under Windows, however, we have to use CTRL_BREAK_EVENT, + # which has an arbitrary returncode depending on versions (so does CTRL_C_EVENT + # on Python 2). We still + # count this as success. + self.assertEqual(p.returncode if not WIN else 0, 0) + p.stdout.close() + + if __name__ == '__main__': + greentest.main() diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__iwait.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__iwait.py new file mode 100644 index 00000000..0976e40a --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__iwait.py @@ -0,0 +1,42 @@ +import gevent +import gevent.testing as greentest +from gevent.lock import Semaphore + + +class Testiwait(greentest.TestCase): + + def test_noiter(self): + # Test that gevent.iwait returns objects which can be iterated upon + # without additional calls to iter() + + sem1 = Semaphore() + sem2 = Semaphore() + + gevent.spawn(sem1.release) + ready = next(gevent.iwait((sem1, sem2))) + self.assertEqual(sem1, ready) + + def test_iwait_partial(self): + # Test that the iwait context manager allows the iterator to be + # consumed partially without a memory leak. + + sem = Semaphore() + let = gevent.spawn(sem.release) + with gevent.iwait((sem,), timeout=0.01) as iterator: + self.assertEqual(sem, next(iterator)) + let.get() + + def test_iwait_nogarbage(self): + sem1 = Semaphore() + sem2 = Semaphore() + let = gevent.spawn(sem1.release) + with gevent.iwait((sem1, sem2)) as iterator: + self.assertEqual(sem1, next(iterator)) + self.assertEqual(sem2.linkcount(), 1) + + self.assertEqual(sem2.linkcount(), 0) + let.get() + + +if __name__ == '__main__': + greentest.main() diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__joinall.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__joinall.py new file mode 100644 index 00000000..5d312817 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__joinall.py @@ -0,0 +1,10 @@ +import gevent + + +def func(): + pass + + +a = gevent.spawn(func) +b = gevent.spawn(func) +gevent.joinall([a, b, a]) diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__local.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__local.py new file mode 100644 index 00000000..823b10ee --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__local.py @@ -0,0 +1,428 @@ +import gevent.testing as greentest +from copy import copy +# Comment the line below to see that the standard thread.local is working correct +from gevent import monkey; monkey.patch_all() + + +from threading import local +from threading import Thread + +try: + from collections.abc import Mapping +except ImportError: + from collections import Mapping + +class ReadProperty(object): + """A property that can be overridden""" + + # A non-data descriptor + + def __get__(self, inst, klass): + return 42 if inst is not None else self + + +class A(local): + __slots__ = ['initialized', 'obj'] + + path = '' + + type_path = 'MyPath' + + read_property = ReadProperty() + + def __init__(self, obj): + super(A, self).__init__() + if not hasattr(self, 'initialized'): + self.obj = obj + self.path = '' + + +class Obj(object): + pass + +# These next two classes have to be global to avoid the leakchecks +deleted_sentinels = [] +created_sentinels = [] + +class Sentinel(object): + def __del__(self): + deleted_sentinels.append(id(self)) + + +class MyLocal(local): + + CLASS_PROP = 42 + + def __init__(self): + local.__init__(self) + self.sentinel = Sentinel() + created_sentinels.append(id(self.sentinel)) + + @property + def desc(self): + return self + +class MyLocalSubclass(MyLocal): + pass + +class WithGetattr(local): + + def __getattr__(self, name): + if name == 'foo': + return 42 + return super(WithGetattr, self).__getattr__(name) + +class LocalWithABC(local, Mapping): + + def __getitem__(self, name): + return self.d[name] + + def __iter__(self): + return iter(self.d) + + def __len__(self): + return len(self.d) + +class LocalWithStaticMethod(local): + + @staticmethod + def a_staticmethod(): + return 42 + +class LocalWithClassMethod(local): + + @classmethod + def a_classmethod(cls): + return cls + + + + +class TestGeventLocal(greentest.TestCase): + # pylint:disable=attribute-defined-outside-init,blacklisted-name + + def setUp(self): + del deleted_sentinels[:] + del created_sentinels[:] + + tearDown = setUp + + def test_create_local_subclass_init_args(self): + with self.assertRaisesRegex(TypeError, + "Initialization arguments are not supported"): + local("foo") + + with self.assertRaisesRegex(TypeError, + "Initialization arguments are not supported"): + local(kw="foo") + + + def test_local_opts_not_subclassed(self): + l = local() + l.attr = 1 + self.assertEqual(l.attr, 1) + + def test_cannot_set_delete_dict(self): + l = local() + with self.assertRaises(AttributeError): + l.__dict__ = 1 + + with self.assertRaises(AttributeError): + del l.__dict__ + + def test_delete_with_no_dict(self): + l = local() + with self.assertRaises(AttributeError): + delattr(l, 'thing') + + def del_local(): + with self.assertRaises(AttributeError): + delattr(l, 'thing') + + t = Thread(target=del_local) + t.start() + t.join() + + def test_slot_and_type_attributes(self): + a = A(Obj()) + a.initialized = 1 + self.assertEqual(a.initialized, 1) + + # The slot is shared + def demonstrate_slots_shared(): + self.assertEqual(a.initialized, 1) + a.initialized = 2 + + greenlet = Thread(target=demonstrate_slots_shared) + greenlet.start() + greenlet.join() + + self.assertEqual(a.initialized, 2) + + # The slot overrides dict values + a.__dict__['initialized'] = 42 # pylint:disable=unsupported-assignment-operation + self.assertEqual(a.initialized, 2) + + # Deleting the slot deletes the slot, but not the dict + del a.initialized + self.assertFalse(hasattr(a, 'initialized')) + self.assertIn('initialized', a.__dict__) + + # We can delete the 'path' ivar + # and fall back to the type + del a.path + self.assertEqual(a.path, '') + + with self.assertRaises(AttributeError): + del a.path + + # A read property calls get + self.assertEqual(a.read_property, 42) + a.read_property = 1 + self.assertEqual(a.read_property, 1) + self.assertIsInstance(A.read_property, ReadProperty) + + # Type attributes can be read + self.assertEqual(a.type_path, 'MyPath') + self.assertNotIn('type_path', a.__dict__) + + # and replaced in the dict + a.type_path = 'Local' + self.assertEqual(a.type_path, 'Local') + self.assertIn('type_path', a.__dict__) + + def test_attribute_error(self): + # pylint:disable=attribute-defined-outside-init + a = A(Obj()) + with self.assertRaises(AttributeError): + getattr(a, 'fizz_buzz') + + def set_fizz_buzz(): + a.fizz_buzz = 1 + + greenlet = Thread(target=set_fizz_buzz) + greenlet.start() + greenlet.join() + + with self.assertRaises(AttributeError): + getattr(a, 'fizz_buzz') + + def test_getattr_called(self): + getter = WithGetattr() + self.assertEqual(42, getter.foo) + getter.foo = 'baz' + self.assertEqual('baz', getter.foo) + + + def test_copy(self): + a = A(Obj()) + a.path = '123' + a.obj.echo = 'test' + b = copy(a) + + # Copy makes a shallow copy. Meaning that the attribute path + # has to be independent in the original and the copied object because the + # value is a string, but the attribute obj should be just reference to + # the instance of the class Obj + + self.assertEqual(a.path, b.path, 'The values in the two objects must be equal') + self.assertEqual(a.obj, b.obj, 'The values must be equal') + + b.path = '321' + self.assertNotEqual(a.path, b.path, 'The values in the two objects must be different') + + a.obj.echo = "works" + self.assertEqual(a.obj, b.obj, 'The values must be equal') + + def test_copy_no_subclass(self): + + a = local() + setattr(a, 'thing', 42) + b = copy(a) + self.assertEqual(b.thing, 42) + self.assertIsNot(a.__dict__, b.__dict__) + + def test_objects(self): + # Test which failed in the eventlet?! + + a = A({}) + a.path = '123' + b = A({'one': 2}) + b.path = '123' + self.assertEqual(a.path, b.path, 'The values in the two objects must be equal') + + b.path = '321' + + self.assertNotEqual(a.path, b.path, 'The values in the two objects must be different') + + def test_class_attr(self, kind=MyLocal): + mylocal = kind() + self.assertEqual(42, mylocal.CLASS_PROP) + + mylocal.CLASS_PROP = 1 + self.assertEqual(1, mylocal.CLASS_PROP) + self.assertEqual(mylocal.__dict__['CLASS_PROP'], 1) + + del mylocal.CLASS_PROP + self.assertEqual(42, mylocal.CLASS_PROP) + + self.assertIs(mylocal, mylocal.desc) + + def test_class_attr_subclass(self): + self.test_class_attr(kind=MyLocalSubclass) + + def test_locals_collected_when_greenlet_dead_but_still_referenced(self): + # https://github.com/gevent/gevent/issues/387 + import gevent + + my_local = MyLocal() + my_local.sentinel = None + greentest.gc_collect_if_needed() + + del created_sentinels[:] + del deleted_sentinels[:] + + def demonstrate_my_local(): + # Get the important parts + getattr(my_local, 'sentinel') + + # Create and reference greenlets + greenlets = [Thread(target=demonstrate_my_local) for _ in range(5)] + for t in greenlets: + t.start() + gevent.sleep() + + self.assertEqual(len(created_sentinels), len(greenlets)) + + for g in greenlets: + assert not g.is_alive() + gevent.sleep() # let the callbacks run + greentest.gc_collect_if_needed() + + # The sentinels should be gone too + self.assertEqual(len(deleted_sentinels), len(greenlets)) + + @greentest.skipOnLibuvOnPyPyOnWin("GC makes this non-deterministic, especially on Windows") + def test_locals_collected_when_unreferenced_even_in_running_greenlet(self): + # In fact only on Windows do we see GC being an issue; + # pypy2 5.0 on macos and travis don't have a problem. + # https://github.com/gevent/gevent/issues/981 + import gevent + import gc + gc.collect() + + count = 1000 + + running_greenlet = None + + def demonstrate_my_local(): + for _ in range(1000): + x = MyLocal() + self.assertIsNotNone(x.sentinel) + x = None + + gc.collect() + gc.collect() + + self.assertEqual(count, len(created_sentinels)) + # They're all dead, even though this greenlet is + # still running + self.assertEqual(count, len(deleted_sentinels)) + + # The links were removed as well. + self.assertFalse(running_greenlet.has_links()) + + + running_greenlet = gevent.spawn(demonstrate_my_local) + gevent.sleep() + running_greenlet.join() + + self.assertEqual(count, len(deleted_sentinels)) + + @greentest.ignores_leakcheck + def test_local_dicts_for_greenlet(self): + import gevent + from gevent.local import all_local_dicts_for_greenlet + + class MyGreenlet(gevent.Greenlet): + results = None + id_x = None + def _run(self): # pylint:disable=method-hidden + x = local() + x.foo = 42 + self.id_x = id(x) + self.results = all_local_dicts_for_greenlet(self) + + g = MyGreenlet() + g.start() + g.join() + self.assertTrue(g.successful, g) + self.assertEqual(g.results, + [((local, g.id_x), {'foo': 42})]) + + def test_local_with_abc(self): + # an ABC (or generally any non-exact-type) in the MRO doesn't + # break things. See https://github.com/gevent/gevent/issues/1201 + + x = LocalWithABC() + x.d = {'a': 1} + self.assertEqual({'a': 1}, x.d) + # The ABC part works + self.assertIn('a', x.d) + self.assertEqual(['a'], list(x.keys())) + + def test_local_with_staticmethod(self): + x = LocalWithStaticMethod() + self.assertEqual(42, x.a_staticmethod()) + + def test_local_with_classmethod(self): + x = LocalWithClassMethod() + self.assertIs(LocalWithClassMethod, x.a_classmethod()) + +try: + from zope import interface +except ImportError: + interface = None + +@greentest.skipIf(interface is None, "Needs zope.interface") +class TestLocalInterface(greentest.TestCase): + __timeout__ = None + + @greentest.ignores_leakcheck + def test_provides(self): + # https://github.com/gevent/gevent/issues/1122 + + # pylint:disable=inherit-non-class + class IFoo(interface.Interface): + pass + + @interface.implementer(IFoo) + class Base(object): + pass + + class Derived(Base, local): + pass + + d = Derived() + p = list(interface.providedBy(d)) + self.assertEqual([IFoo], p) + + + +@greentest.skipOnPurePython("Needs C extension") +class TestCExt(greentest.TestCase): # pragma: no cover + + def test_c_extension(self): + self.assertEqual(local.__module__, + 'gevent._local') + +@greentest.skipWithCExtensions("Needs pure-python") +class TestPure(greentest.TestCase): + + def test_extension(self): + self.assertEqual(local.__module__, + 'gevent.local') + + +if __name__ == '__main__': + greentest.main() diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__loop_callback.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__loop_callback.py new file mode 100644 index 00000000..39a2f138 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__loop_callback.py @@ -0,0 +1,13 @@ +from gevent.core import loop + +count = 0 + + +def incr(): + global count + count += 1 + +loop = loop() +loop.run_callback(incr) +loop.run() +assert count == 1, count diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__makefile_ref.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__makefile_ref.py new file mode 100644 index 00000000..36ac4e8d --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__makefile_ref.py @@ -0,0 +1,516 @@ +from __future__ import print_function +import os +from gevent import monkey; monkey.patch_all() +import socket +import ssl +import threading +import unittest +import errno +import weakref + + +import gevent.testing as greentest + + +dirname = os.path.dirname(os.path.abspath(__file__)) +certfile = os.path.join(dirname, '2_7_keycert.pem') +pid = os.getpid() + +PY3 = greentest.PY3 +PYPY = greentest.PYPY +CPYTHON = not PYPY +PY2 = not PY3 +fd_types = int +if PY3: + long = int +fd_types = (int, long) +WIN = greentest.WIN + +from gevent.testing import get_open_files +try: + import psutil +except ImportError: + psutil = None + + +class Test(greentest.TestCase): + + extra_allowed_open_states = () + + def tearDown(self): + self.extra_allowed_open_states = () + super(Test, self).tearDown() + + def assert_raises_EBADF(self, func): + try: + result = func() + except (socket.error, OSError) as ex: + # Windows/Py3 raises "OSError: [WinError 10038]" + if ex.args[0] == errno.EBADF: + return + if WIN and ex.args[0] == 10038: + return + raise + raise AssertionError('NOT RAISED EBADF: %r() returned %r' % (func, result)) + + def assert_fd_open(self, fileno): + assert isinstance(fileno, fd_types) + open_files = get_open_files() + if fileno not in open_files: + raise AssertionError('%r is not open:\n%s' % (fileno, open_files['data'])) + + def assert_fd_closed(self, fileno): + assert isinstance(fileno, fd_types), repr(fileno) + assert fileno > 0, fileno + open_files = get_open_files() + if fileno in open_files: + raise AssertionError('%r is not closed:\n%s' % (fileno, open_files['data'])) + + def _assert_sock_open(self, sock): + # requires the psutil output + open_files = get_open_files() + sockname = sock.getsockname() + for x in open_files['data']: + if getattr(x, 'laddr', None) == sockname: + assert x.status in (psutil.CONN_LISTEN, psutil.CONN_ESTABLISHED) + self.extra_allowed_open_states, x.status + return + raise AssertionError("%r is not open:\n%s" % (sock, open_files['data'])) + + def assert_open(self, sock, *rest): + if isinstance(sock, fd_types): + if not WIN: + self.assert_fd_open(sock) + else: + fileno = sock.fileno() + assert isinstance(fileno, fd_types), fileno + sockname = sock.getsockname() + assert isinstance(sockname, tuple), sockname + if not WIN: + self.assert_fd_open(fileno) + else: + self._assert_sock_open(sock) + if rest: + self.assert_open(rest[0], *rest[1:]) + + def assert_closed(self, sock, *rest): + if isinstance(sock, fd_types): + self.assert_fd_closed(sock) + else: + # Under Python3, the socket module returns -1 for a fileno + # of a closed socket; under Py2 it raises + if PY3: + self.assertEqual(sock.fileno(), -1) + else: + self.assert_raises_EBADF(sock.fileno) + self.assert_raises_EBADF(sock.getsockname) + self.assert_raises_EBADF(sock.accept) + if rest: + self.assert_closed(rest[0], *rest[1:]) + + def make_open_socket(self): + s = socket.socket() + s.bind(('127.0.0.1', 0)) + self._close_on_teardown(s) + if WIN or greentest.LINUX: + # Windows and linux (with psutil) doesn't show as open until + # we call listen (linux with lsof accepts either) + s.listen(1) + self.assert_open(s, s.fileno()) + return s + + if CPYTHON and PY2: + # Keeping raw sockets alive keeps SSL sockets + # from being closed too, at least on CPython2, so we + # need to use weakrefs. + + # In contrast, on PyPy, *only* having a weakref lets the + # original socket die and leak + + def _close_on_teardown(self, resource): + self.close_on_teardown.append(weakref.ref(resource)) + return resource + + def _tearDownCloseOnTearDown(self): + self.close_on_teardown = [r() for r in self.close_on_teardown if r() is not None] + super(Test, self)._tearDownCloseOnTearDown() + +# Sometimes its this one, sometimes it's test_ssl. No clue why or how. +@greentest.skipOnAppVeyor("This sometimes times out for no apparent reason.") +class TestSocket(Test): + + def test_simple_close(self): + s = self.make_open_socket() + fileno = s.fileno() + s.close() + self.assert_closed(s, fileno) + + def test_makefile1(self): + s = self.make_open_socket() + fileno = s.fileno() + f = s.makefile() + self.assert_open(s, fileno) + s.close() + # Under python 2, this closes socket wrapper object but not the file descriptor; + # under python 3, both stay open + if PY3: + self.assert_open(s, fileno) + else: + self.assert_closed(s) + self.assert_open(fileno) + f.close() + self.assert_closed(s) + self.assert_closed(fileno) + + def test_makefile2(self): + s = self.make_open_socket() + fileno = s.fileno() + self.assert_open(s, fileno) + f = s.makefile() + self.assert_open(s) + self.assert_open(s, fileno) + f.close() + # closing fileobject does not close the socket + self.assert_open(s, fileno) + s.close() + self.assert_closed(s, fileno) + + def test_server_simple(self): + listener = socket.socket() + listener.bind(('127.0.0.1', 0)) + port = listener.getsockname()[1] + listener.listen(1) + + connector = socket.socket() + self._close_on_teardown(connector) + + def connect(): + connector.connect(('127.0.0.1', port)) + + t = threading.Thread(target=connect) + t.start() + + try: + client_socket, _addr = listener.accept() + fileno = client_socket.fileno() + self.assert_open(client_socket, fileno) + client_socket.close() + self.assert_closed(client_socket) + finally: + t.join() + listener.close() + connector.close() + + def test_server_makefile1(self): + listener = socket.socket() + listener.bind(('127.0.0.1', 0)) + port = listener.getsockname()[1] + listener.listen(1) + + connector = socket.socket() + self._close_on_teardown(connector) + + def connect(): + connector.connect(('127.0.0.1', port)) + + t = threading.Thread(target=connect) + t.start() + + try: + client_socket, _addr = listener.accept() + fileno = client_socket.fileno() + f = client_socket.makefile() + self.assert_open(client_socket, fileno) + client_socket.close() + # Under python 2, this closes socket wrapper object but not the file descriptor; + # under python 3, both stay open + if PY3: + self.assert_open(client_socket, fileno) + else: + self.assert_closed(client_socket) + self.assert_open(fileno) + f.close() + self.assert_closed(client_socket, fileno) + finally: + t.join() + listener.close() + connector.close() + + def test_server_makefile2(self): + listener = socket.socket() + listener.bind(('127.0.0.1', 0)) + port = listener.getsockname()[1] + listener.listen(1) + + connector = socket.socket() + self._close_on_teardown(connector) + + def connect(): + connector.connect(('127.0.0.1', port)) + + t = threading.Thread(target=connect) + t.start() + + try: + client_socket, _addr = listener.accept() + fileno = client_socket.fileno() + f = client_socket.makefile() + self.assert_open(client_socket, fileno) + # closing fileobject does not close the socket + f.close() + self.assert_open(client_socket, fileno) + client_socket.close() + self.assert_closed(client_socket, fileno) + finally: + t.join() + listener.close() + connector.close() + + +@greentest.skipOnAppVeyor("This sometimes times out for no apparent reason.") +class TestSSL(Test): + + def _ssl_connect_task(self, connector, port): + connector.connect(('127.0.0.1', port)) + try: + # Note: We get ResourceWarning about 'x' + # on Python 3 if we don't join the spawned thread + x = ssl.wrap_socket(connector) + except socket.error: + # Observed on Windows with PyPy2 5.9.0 and libuv: + # if we don't switch in a timely enough fashion, + # the server side runs ahead of us and closes + # our socket first, so this fails. + pass + else: + #self._close_on_teardown(x) + x.close() + + def _make_ssl_connect_task(self, connector, port): + t = threading.Thread(target=self._ssl_connect_task, args=(connector, port)) + t.daemon = True + return t + + def __cleanup(self, task, *sockets): + # workaround for test_server_makefile1, test_server_makefile2, + # test_server_simple, test_serverssl_makefile1. + + # On PyPy on Linux, it is important to join the SSL Connect + # Task FIRST, before closing the sockets. If we do it after + # (which makes more sense) we hang. It's not clear why, except + # that it has something to do with context switches. Inserting a call to + # gevent.sleep(0.1) instead of joining the task has the same + # effect. If the previous tests hang, then later tests can fail with + # SSLError: unknown alert type. + + # XXX: Why do those two things happen? + + # On PyPy on macOS, we don't have that problem and can use the + # more logical order. + + task.join() + for s in sockets: + s.close() + + del sockets + del task + + def test_simple_close(self): + s = self.make_open_socket() + fileno = s.fileno() + s = ssl.wrap_socket(s) + self._close_on_teardown(s) + fileno = s.fileno() + self.assert_open(s, fileno) + s.close() + self.assert_closed(s, fileno) + + def test_makefile1(self): + raw_s = self.make_open_socket() + s = ssl.wrap_socket(raw_s) + + self._close_on_teardown(s) + fileno = s.fileno() + self.assert_open(s, fileno) + f = s.makefile() + self.assert_open(s, fileno) + s.close() + self.assert_open(s, fileno) + f.close() + raw_s.close() + self.assert_closed(s, fileno) + + + def test_makefile2(self): + s = self.make_open_socket() + fileno = s.fileno() + + s = ssl.wrap_socket(s) + self._close_on_teardown(s) + fileno = s.fileno() + self.assert_open(s, fileno) + f = s.makefile() + self.assert_open(s, fileno) + f.close() + # closing fileobject does not close the socket + self.assert_open(s, fileno) + s.close() + self.assert_closed(s, fileno) + + def test_server_simple(self): + listener = socket.socket() + listener.bind(('127.0.0.1', 0)) + port = listener.getsockname()[1] + listener.listen(1) + + connector = socket.socket() + self._close_on_teardown(connector) + + t = self._make_ssl_connect_task(connector, port) + t.start() + + try: + client_socket, _addr = listener.accept() + self._close_on_teardown(client_socket.close) + client_socket = ssl.wrap_socket(client_socket, keyfile=certfile, certfile=certfile, server_side=True) + self._close_on_teardown(client_socket) + fileno = client_socket.fileno() + self.assert_open(client_socket, fileno) + client_socket.close() + self.assert_closed(client_socket, fileno) + finally: + self.__cleanup(t, listener, connector) + + def test_server_makefile1(self): + listener = socket.socket() + self._close_on_teardown(listener) + listener.bind(('127.0.0.1', 0)) + port = listener.getsockname()[1] + listener.listen(1) + + + connector = socket.socket() + self._close_on_teardown(connector) + + t = self._make_ssl_connect_task(connector, port) + t.start() + + try: + client_socket, _addr = listener.accept() + self._close_on_teardown(client_socket.close) # hard ref + client_socket = ssl.wrap_socket(client_socket, keyfile=certfile, certfile=certfile, server_side=True) + self._close_on_teardown(client_socket) + fileno = client_socket.fileno() + self.assert_open(client_socket, fileno) + f = client_socket.makefile() + self.assert_open(client_socket, fileno) + client_socket.close() + self.assert_open(client_socket, fileno) + f.close() + self.assert_closed(client_socket, fileno) + finally: + self.__cleanup(t, listener, connector) + + + def test_server_makefile2(self): + listener = socket.socket() + listener.bind(('127.0.0.1', 0)) + port = listener.getsockname()[1] + listener.listen(1) + + connector = socket.socket() + self._close_on_teardown(connector) + + t = self._make_ssl_connect_task(connector, port) + t.start() + + try: + client_socket, _addr = listener.accept() + self._close_on_teardown(client_socket) + client_socket = ssl.wrap_socket(client_socket, keyfile=certfile, certfile=certfile, server_side=True) + self._close_on_teardown(client_socket) + fileno = client_socket.fileno() + self.assert_open(client_socket, fileno) + f = client_socket.makefile() + self.assert_open(client_socket, fileno) + # Closing fileobject does not close SSLObject + f.close() + self.assert_open(client_socket, fileno) + client_socket.close() + self.assert_closed(client_socket, fileno) + finally: + self.__cleanup(t, connector, listener, client_socket) + + def test_serverssl_makefile1(self): + listener = socket.socket() + fileno = listener.fileno() + listener.bind(('127.0.0.1', 0)) + port = listener.getsockname()[1] + listener.listen(1) + self._close_on_teardown(listener) + listener = ssl.wrap_socket(listener, keyfile=certfile, certfile=certfile) + + connector = socket.socket() + self._close_on_teardown(connector) + + t = self._make_ssl_connect_task(connector, port) + t.start() + + try: + client_socket, _addr = listener.accept() + fileno = client_socket.fileno() + self.assert_open(client_socket, fileno) + f = client_socket.makefile() + self.assert_open(client_socket, fileno) + client_socket.close() + self.assert_open(client_socket, fileno) + f.close() + self.assert_closed(client_socket, fileno) + finally: + self.__cleanup(t, listener, connector) + + @greentest.skipIf(greentest.RUNNING_ON_TRAVIS and greentest.PY37 and greentest.LIBUV, + "Often segfaults, cannot reproduce locally. " + "Not too worried about this before Python 3.7rc1. " + "https://travis-ci.org/gevent/gevent/jobs/327357684") + def test_serverssl_makefile2(self): + listener = socket.socket() + self._close_on_teardown(listener) + listener.bind(('127.0.0.1', 0)) + port = listener.getsockname()[1] + listener.listen(1) + listener = ssl.wrap_socket(listener, keyfile=certfile, certfile=certfile) + + connector = socket.socket() + + def connect(): + connector.connect(('127.0.0.1', port)) + s = ssl.wrap_socket(connector) + s.sendall(b'test_serverssl_makefile2') + s.close() + connector.close() + + t = threading.Thread(target=connect) + t.daemon = True + t.start() + + try: + client_socket, _addr = listener.accept() + fileno = client_socket.fileno() + self.assert_open(client_socket, fileno) + f = client_socket.makefile() + self.assert_open(client_socket, fileno) + self.assertEqual(f.read(), 'test_serverssl_makefile2') + self.assertEqual(f.read(), '') + f.close() + if WIN and psutil: + # Hmm? + self.extra_allowed_open_states = (psutil.CONN_CLOSE_WAIT,) + self.assert_open(client_socket, fileno) + client_socket.close() + self.assert_closed(client_socket, fileno) + finally: + self.__cleanup(t, listener) + + +if __name__ == '__main__': + unittest.main() diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__memleak.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__memleak.py new file mode 100644 index 00000000..7a191a48 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__memleak.py @@ -0,0 +1,56 @@ +import sys +import unittest + +from gevent.testing import TestCase, main +import gevent +from gevent.timeout import Timeout + +@unittest.skipUnless( + hasattr(sys, 'gettotalrefcount'), + "Needs debug build" +) +class TestQueue(TestCase): # pragma: no cover + # pylint:disable=bare-except,no-member + + def test(self): + result = '' + try: + Timeout.start_new(0.01) + gevent.sleep(1) + raise AssertionError('must raise Timeout') + except KeyboardInterrupt: + raise + except: + pass + + result += '%s ' % sys.gettotalrefcount() + + try: + Timeout.start_new(0.01) + gevent.sleep(1) + raise AssertionError('must raise Timeout') + except KeyboardInterrupt: + raise + except: + pass + + result += '%s ' % sys.gettotalrefcount() + + try: + Timeout.start_new(0.01) + gevent.sleep(1) + raise AssertionError('must raise Timeout') + except KeyboardInterrupt: + raise + except: + pass + + result += '%s' % sys.gettotalrefcount() + + _, b, c = result.split() + assert b == c, 'total refcount mismatch: %s' % result + + + +if __name__ == '__main__': + main() diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__monkey.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__monkey.py new file mode 100644 index 00000000..9c33d7f7 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__monkey.py @@ -0,0 +1,151 @@ +from subprocess import Popen + +from gevent import monkey +monkey.patch_all() + +import sys +import unittest +from gevent.testing.testcase import SubscriberCleanupMixin + +class TestMonkey(SubscriberCleanupMixin, unittest.TestCase): + + maxDiff = None + + def test_time(self): + import time + from gevent import time as gtime + self.assertIs(time.sleep, gtime.sleep) + + def test_thread(self): + try: + import thread + except ImportError: + import _thread as thread + import threading + + from gevent import thread as gthread + self.assertIs(thread.start_new_thread, gthread.start_new_thread) + self.assertIs(threading._start_new_thread, gthread.start_new_thread) + + # Event patched by default + self.assertTrue(monkey.is_object_patched('threading', 'Event')) + + if sys.version_info[0] == 2: + from gevent import threading as gthreading + from gevent.event import Event as GEvent + self.assertIs(threading._sleep, gthreading._sleep) + self.assertTrue(monkey.is_object_patched('threading', '_Event')) + self.assertIs(threading._Event, GEvent) + + def test_socket(self): + import socket + from gevent import socket as gevent_socket + self.assertIs(socket.create_connection, gevent_socket.create_connection) + + def test_os(self): + import os + import types + from gevent import os as gos + for name in ('fork', 'forkpty'): + if hasattr(os, name): + attr = getattr(os, name) + self.assertNotIn('built-in', repr(attr)) + self.assertNotIsInstance(attr, types.BuiltinFunctionType) + self.assertIsInstance(attr, types.FunctionType) + self.assertIs(attr, getattr(gos, name)) + + def test_saved(self): + self.assertTrue(monkey.saved) + for modname in monkey.saved: + self.assertTrue(monkey.is_module_patched(modname)) + + for objname in monkey.saved[modname]: + self.assertTrue(monkey.is_object_patched(modname, objname)) + + def test_patch_subprocess_twice(self): + self.assertNotIn('gevent', repr(Popen)) + self.assertIs(Popen, monkey.get_original('subprocess', 'Popen')) + monkey.patch_subprocess() + self.assertIs(Popen, monkey.get_original('subprocess', 'Popen')) + + def test_patch_twice_warnings_events(self): + import warnings + from zope.interface import verify + + orig_saved = {} + for k, v in monkey.saved.items(): + orig_saved[k] = v.copy() + + from gevent import events + all_events = [] + events.subscribers.append(all_events.append) + + def veto(event): + if isinstance(event, events.GeventWillPatchModuleEvent) and event.module_name == 'ssl': + raise events.DoNotPatch + + events.subscribers.append(veto) + + with warnings.catch_warnings(record=True) as issued_warnings: + # Patch again, triggering three warnings, one for os=False/signal=True, + # one for repeated monkey-patching, one for patching after ssl (on python >= 2.7.9) + monkey.patch_all(os=False, extra_kwarg=42) + self.assertGreaterEqual(len(issued_warnings), 2) + self.assertIn('SIGCHLD', str(issued_warnings[-1].message)) + self.assertIn('more than once', str(issued_warnings[0].message)) + + # Patching with the exact same argument doesn't issue a second warning. + # in fact, it doesn't do anything + del issued_warnings[:] + monkey.patch_all(os=False) + orig_saved['_gevent_saved_patch_all'] = monkey.saved['_gevent_saved_patch_all'] + + self.assertFalse(issued_warnings) + + # Make sure that re-patching did not change the monkey.saved + # attribute, overwriting the original functions. + if 'logging' in monkey.saved and 'logging' not in orig_saved: + # some part of the warning or unittest machinery imports logging + orig_saved['logging'] = monkey.saved['logging'] + self.assertEqual(orig_saved, monkey.saved) + + # Make sure some problematic attributes stayed correct. + # NOTE: This was only a problem if threading was not previously imported. + for k, v in monkey.saved['threading'].items(): + self.assertNotIn('gevent', str(v)) + + self.assertIsInstance(all_events[0], events.GeventWillPatchAllEvent) + self.assertEqual({'extra_kwarg': 42}, all_events[0].patch_all_kwargs) + verify.verifyObject(events.IGeventWillPatchAllEvent, all_events[0]) + + self.assertIsInstance(all_events[1], events.GeventWillPatchModuleEvent) + verify.verifyObject(events.IGeventWillPatchModuleEvent, all_events[1]) + + self.assertIsInstance(all_events[2], events.GeventDidPatchModuleEvent) + verify.verifyObject(events.IGeventWillPatchModuleEvent, all_events[1]) + + self.assertIsInstance(all_events[-2], events.GeventDidPatchBuiltinModulesEvent) + verify.verifyObject(events.IGeventDidPatchBuiltinModulesEvent, all_events[-2]) + + self.assertIsInstance(all_events[-1], events.GeventDidPatchAllEvent) + verify.verifyObject(events.IGeventDidPatchAllEvent, all_events[-1]) + + for e in all_events: + self.assertFalse(isinstance(e, events.GeventDidPatchModuleEvent) + and e.module_name == 'ssl') + + def test_patch_queue(self): + try: + import queue + except ImportError: + # Python 2 called this Queue. Note that having + # python-future installed gives us a queue module on + # Python 2 as well. + queue = None + if not hasattr(queue, 'SimpleQueue'): + raise unittest.SkipTest("Needs SimpleQueue") + # pylint:disable=no-member + self.assertIs(queue.SimpleQueue, queue._PySimpleQueue) + +if __name__ == '__main__': + unittest.main() diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__monkey_builtins_future.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__monkey_builtins_future.py new file mode 100644 index 00000000..599253dc --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__monkey_builtins_future.py @@ -0,0 +1,16 @@ +# Under Python 2, if the `future` module is installed, we get +# a `builtins` module, which mimics the `builtins` module from +# Python 3, but does not have the __import__ and some other functions. +# Make sure we can still run in that case. +import sys +try: + # fake out a "broken" builtins module + import builtins +except ImportError: + class builtins(object): + pass + sys.modules['builtins'] = builtins() + +if not hasattr(builtins, '__import__'): + import gevent.monkey + gevent.monkey.patch_builtins() diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__monkey_hub_in_thread.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__monkey_hub_in_thread.py new file mode 100644 index 00000000..981ca6cd --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__monkey_hub_in_thread.py @@ -0,0 +1,28 @@ +from gevent.monkey import patch_all +patch_all(thread=False) +from threading import Thread +import time + +# The first time we init the hub is in the native +# thread with time.sleep(), needing multiple +# threads at the same time. Note: this is very timing +# dependent. +# See #687 + + +def func(): + time.sleep() + + +def main(): + threads = [] + for _ in range(3): + th = Thread(target=func) + th.start() + threads.append(th) + for th in threads: + th.join() + + +if __name__ == '__main__': + main() diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__monkey_logging.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__monkey_logging.py new file mode 100644 index 00000000..9244ec64 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__monkey_logging.py @@ -0,0 +1,41 @@ +# If the logging module is imported *before* monkey patching, +# the existing handlers are correctly monkey patched to use gevent locks +import logging +logging.basicConfig() + +import threading +import sys +PY2 = sys.version_info[0] == 2 + + +def _inner_lock(lock): + # The inner attribute changed between 2 and 3 + attr = getattr(lock, '_block' if not PY2 else '_RLock__block', None) + return attr + + +def checkLocks(kind, ignore_none=True): + handlers = logging._handlerList + assert handlers + + for weakref in handlers: + # In py26, these are actual handlers, not weakrefs + handler = weakref() if callable(weakref) else weakref + attr = _inner_lock(handler.lock) + if attr is None and ignore_none: + continue + assert isinstance(attr, kind), (handler.lock, attr, kind) + + attr = _inner_lock(logging._lock) + if attr is None and ignore_none: + return + assert isinstance(attr, kind) + +checkLocks(type(threading._allocate_lock())) + +import gevent.monkey +gevent.monkey.patch_all() + +import gevent.lock + +checkLocks(type(gevent.thread.allocate_lock()), ignore_none=False) diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__monkey_multiple_imports.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__monkey_multiple_imports.py new file mode 100644 index 00000000..576062e3 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__monkey_multiple_imports.py @@ -0,0 +1,6 @@ +# https://github.com/gevent/gevent/issues/615 +# Under Python 3, with its use of importlib, +# if the monkey patch is done when the importlib import lock is held +# (e.g., during recursive imports) we could fail to release the lock. +# This is surprisingly common. +__import__('_import_import_patch') diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__monkey_queue.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__monkey_queue.py new file mode 100644 index 00000000..c07a2561 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__monkey_queue.py @@ -0,0 +1,331 @@ +# Some simple queue module tests, plus some failure conditions +# to ensure the Queue locks remain stable. +from gevent import monkey +monkey.patch_all() + +from gevent import queue as Queue +import threading +import time +import unittest + + +QUEUE_SIZE = 5 + +# A thread to run a function that unclogs a blocked Queue. +class _TriggerThread(threading.Thread): + def __init__(self, fn, args): + self.fn = fn + self.args = args + #self.startedEvent = threading.Event() + from gevent.event import Event + self.startedEvent = Event() + threading.Thread.__init__(self) + + def run(self): + # The sleep isn't necessary, but is intended to give the blocking + # function in the main thread a chance at actually blocking before + # we unclog it. But if the sleep is longer than the timeout-based + # tests wait in their blocking functions, those tests will fail. + # So we give them much longer timeout values compared to the + # sleep here (I aimed at 10 seconds for blocking functions -- + # they should never actually wait that long - they should make + # progress as soon as we call self.fn()). + time.sleep(0.01) + self.startedEvent.set() + self.fn(*self.args) + + +# Execute a function that blocks, and in a separate thread, a function that +# triggers the release. Returns the result of the blocking function. Caution: +# block_func must guarantee to block until trigger_func is called, and +# trigger_func must guarantee to change queue state so that block_func can make +# enough progress to return. In particular, a block_func that just raises an +# exception regardless of whether trigger_func is called will lead to +# timing-dependent sporadic failures, and one of those went rarely seen but +# undiagnosed for years. Now block_func must be unexceptional. If block_func +# is supposed to raise an exception, call do_exceptional_blocking_test() +# instead. + +class BlockingTestMixin(object): + + def do_blocking_test(self, block_func, block_args, trigger_func, trigger_args): + self.t = _TriggerThread(trigger_func, trigger_args) + self.t.start() + self.result = block_func(*block_args) + # If block_func returned before our thread made the call, we failed! + if not self.t.startedEvent.isSet(): + self.fail("blocking function '%r' appeared not to block" % + block_func) + self.t.join(10) # make sure the thread terminates + if self.t.isAlive(): + self.fail("trigger function '%r' appeared to not return" % + trigger_func) + return self.result + + # Call this instead if block_func is supposed to raise an exception. + def do_exceptional_blocking_test(self, block_func, block_args, trigger_func, + trigger_args, expected_exception_class): + self.t = _TriggerThread(trigger_func, trigger_args) + self.t.start() + try: + with self.assertRaises(expected_exception_class): + block_func(*block_args) + finally: + self.t.join(10) # make sure the thread terminates + if self.t.isAlive(): + self.fail("trigger function '%r' appeared to not return" % + trigger_func) + if not self.t.startedEvent.isSet(): + self.fail("trigger thread ended but event never set") + + +class BaseQueueTest(unittest.TestCase, BlockingTestMixin): + type2test = Queue.Queue + + def setUp(self): + self.cum = 0 + self.cumlock = threading.Lock() + + def simple_queue_test(self, q): + if not q.empty(): + raise RuntimeError("Call this function with an empty queue") + # I guess we better check things actually queue correctly a little :) + q.put(111) + q.put(333) + q.put(222) + q.put(444) + target_first_items = dict( + Queue=111, + LifoQueue=444, + PriorityQueue=111) + actual_first_item = (q.peek(), q.get()) + self.assertEqual(actual_first_item, + (target_first_items[q.__class__.__name__], + target_first_items[q.__class__.__name__]), + "q.peek() and q.get() are not equal!") + target_order = dict(Queue=[333, 222, 444], + LifoQueue=[222, 333, 111], + PriorityQueue=[222, 333, 444]) + actual_order = [q.get(), q.get(), q.get()] + self.assertEqual(actual_order, target_order[q.__class__.__name__], + "Didn't seem to queue the correct data!") + for i in range(QUEUE_SIZE-1): + q.put(i) + self.assertFalse(q.empty(), "Queue should not be empty") + self.assertFalse(q.full(), "Queue should not be full") + q.put(999) + self.assertTrue(q.full(), "Queue should be full") + try: + q.put(888, block=0) + self.fail("Didn't appear to block with a full queue") + except Queue.Full: + pass + try: + q.put(888, timeout=0.01) + self.fail("Didn't appear to time-out with a full queue") + except Queue.Full: + pass + self.assertEqual(q.qsize(), QUEUE_SIZE) + # Test a blocking put + self.do_blocking_test(q.put, (888,), q.get, ()) + self.do_blocking_test(q.put, (888, True, 10), q.get, ()) + # Empty it + for i in range(QUEUE_SIZE): + q.get() + self.assertTrue(q.empty(), "Queue should be empty") + try: + q.get(block=0) + self.fail("Didn't appear to block with an empty queue") + except Queue.Empty: + pass + try: + q.get(timeout=0.01) + self.fail("Didn't appear to time-out with an empty queue") + except Queue.Empty: + pass + # Test a blocking get + self.do_blocking_test(q.get, (), q.put, ('empty',)) + self.do_blocking_test(q.get, (True, 10), q.put, ('empty',)) + + def worker(self, q): + while True: + x = q.get() + if x is None: + q.task_done() + return + #with self.cumlock: + self.cum += x + q.task_done() + + def queue_join_test(self, q): + self.cum = 0 + for i in (0, 1): + threading.Thread(target=self.worker, args=(q,)).start() + for i in range(100): + q.put(i) + q.join() + self.assertEqual(self.cum, sum(range(100)), + "q.join() did not block until all tasks were done") + for i in (0, 1): + q.put(None) # instruct the threads to close + q.join() # verify that you can join twice + + def test_queue_task_done(self): + # Test to make sure a queue task completed successfully. + q = Queue.JoinableQueue() # self.type2test() + # XXX the same test in subclasses + try: + q.task_done() + except ValueError: + pass + else: + self.fail("Did not detect task count going negative") + + def test_queue_join(self): + # Test that a queue join()s successfully, and before anything else + # (done twice for insurance). + q = Queue.JoinableQueue() # self.type2test() + # XXX the same test in subclass + self.queue_join_test(q) + self.queue_join_test(q) + try: + q.task_done() + except ValueError: + pass + else: + self.fail("Did not detect task count going negative") + + def test_queue_task_done_with_items(self): + # Passing items to the constructor allows for as + # many task_done calls. Joining before all the task done + # are called returns false + # XXX the same test in subclass + l = [1, 2, 3] + q = Queue.JoinableQueue(items=l) + for i in l: + self.assertFalse(q.join(timeout=0.001)) + self.assertEqual(i, q.get()) + q.task_done() + + try: + q.task_done() + except ValueError: + pass + else: + self.fail("Did not detect task count going negative") + self.assertTrue(q.join(timeout=0.001)) + + def test_simple_queue(self): + # Do it a couple of times on the same queue. + # Done twice to make sure works with same instance reused. + q = self.type2test(QUEUE_SIZE) + self.simple_queue_test(q) + self.simple_queue_test(q) + +class LifoQueueTest(BaseQueueTest): + type2test = Queue.LifoQueue + +class PriorityQueueTest(BaseQueueTest): + type2test = Queue.PriorityQueue + + def test__init(self): + item1 = (2, 'b') + item2 = (1, 'a') + q = self.type2test(items=[item1, item2]) + self.assertTupleEqual(item2, q.get_nowait()) + self.assertTupleEqual(item1, q.get_nowait()) + + +# A Queue subclass that can provoke failure at a moment's notice :) +class FailingQueueException(Exception): + pass + +class FailingQueue(Queue.Queue): + def __init__(self, *args): + self.fail_next_put = False + self.fail_next_get = False + Queue.Queue.__init__(self, *args) + def _put(self, item): + if self.fail_next_put: + self.fail_next_put = False + raise FailingQueueException("You Lose") + return Queue.Queue._put(self, item) + def _get(self): + if self.fail_next_get: + self.fail_next_get = False + raise FailingQueueException("You Lose") + return Queue.Queue._get(self) + +class FailingQueueTest(unittest.TestCase, BlockingTestMixin): + + def failing_queue_test(self, q): + if not q.empty(): + raise RuntimeError("Call this function with an empty queue") + for i in range(QUEUE_SIZE-1): + q.put(i) + # Test a failing non-blocking put. + q.fail_next_put = True + with self.assertRaises(FailingQueueException): + q.put("oops", block=0) + + q.fail_next_put = True + with self.assertRaises(FailingQueueException): + q.put("oops", timeout=0.1) + q.put(999) + self.assertTrue(q.full(), "Queue should be full") + # Test a failing blocking put + q.fail_next_put = True + with self.assertRaises(FailingQueueException): + self.do_blocking_test(q.put, (888,), q.get, ()) + + # Check the Queue isn't damaged. + # put failed, but get succeeded - re-add + q.put(999) + # Test a failing timeout put + q.fail_next_put = True + self.do_exceptional_blocking_test(q.put, (888, True, 10), q.get, (), + FailingQueueException) + # Check the Queue isn't damaged. + # put failed, but get succeeded - re-add + q.put(999) + self.assertTrue(q.full(), "Queue should be full") + q.get() + self.assertFalse(q.full(), "Queue should not be full") + q.put(999) + self.assertTrue(q.full(), "Queue should be full") + # Test a blocking put + self.do_blocking_test(q.put, (888,), q.get, ()) + # Empty it + for i in range(QUEUE_SIZE): + q.get() + self.assertTrue(q.empty(), "Queue should be empty") + q.put("first") + q.fail_next_get = True + with self.assertRaises(FailingQueueException): + q.get() + + self.assertFalse(q.empty(), "Queue should not be empty") + q.fail_next_get = True + with self.assertRaises(FailingQueueException): + q.get(timeout=0.1) + self.assertFalse(q.empty(), "Queue should not be empty") + q.get() + self.assertTrue(q.empty(), "Queue should be empty") + q.fail_next_get = True + self.do_exceptional_blocking_test(q.get, (), q.put, ('empty',), + FailingQueueException) + # put succeeded, but get failed. + self.assertFalse(q.empty(), "Queue should not be empty") + q.get() + self.assertTrue(q.empty(), "Queue should be empty") + + def test_failing_queue(self): + # Test to make sure a queue is functioning correctly. + # Done twice to the same instance. + q = FailingQueue(QUEUE_SIZE) + self.failing_queue_test(q) + self.failing_queue_test(q) + + +if __name__ == "__main__": + unittest.main() diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__monkey_scope.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__monkey_scope.py new file mode 100644 index 00000000..1a3cc67d --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__monkey_scope.py @@ -0,0 +1,61 @@ +import os +import os.path +import sys + +import unittest + +from subprocess import Popen +from subprocess import PIPE + +class TestRun(unittest.TestCase): + maxDiff = None + + def setUp(self): + self.cwd = os.getcwd() + os.chdir(os.path.dirname(__file__)) + + def tearDown(self): + os.chdir(self.cwd) + + def _run(self, script): + env = os.environ.copy() + env['PYTHONWARNINGS'] = 'ignore' + args = [sys.executable, '-m', 'gevent.monkey', script, 'patched'] + p = Popen(args, stdout=PIPE, stderr=PIPE, env=env) + gout, gerr = p.communicate() + self.assertEqual(0, p.returncode, (gout, gerr)) + + args = [sys.executable, script, 'stdlib'] + p = Popen(args, stdout=PIPE, stderr=PIPE) + + pout, perr = p.communicate() + self.assertEqual(0, p.returncode, (pout, perr)) + + glines = gout.decode("utf-8").splitlines() + plines = pout.decode('utf-8').splitlines() + self.assertEqual(glines, plines) + self.assertEqual(gerr, perr) + + return glines, gerr + + def test_run_simple(self): + self._run(os.path.join('monkey_package', 'script.py')) + + def test_run_package(self): + # Run a __main__ inside a package. + lines, _ = self._run('monkey_package') + + self.assertTrue(lines[0].endswith('__main__.py'), lines[0]) + self.assertEqual(lines[1], '__main__') + + def test_issue_302(self): + lines, _ = self._run(os.path.join('monkey_package', 'issue302monkey.py')) + + self.assertEqual(lines[0], 'True') + lines[1] = lines[1].replace('\\', '/') # windows path + self.assertEqual(lines[1], 'monkey_package/issue302monkey.py') + self.assertEqual(lines[2], 'True', lines) + + +if __name__ == '__main__': + unittest.main() diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__monkey_selectors.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__monkey_selectors.py new file mode 100644 index 00000000..08babb2a --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__monkey_selectors.py @@ -0,0 +1,22 @@ + +import sys +import gevent.testing as greentest +try: + import selectors # Do this before the patch, just to force it +except ImportError: + pass +from gevent.monkey import patch_all +patch_all() + +if sys.platform != 'win32' and sys.version_info[:2] >= (3, 4): + + class TestSelectors(greentest.TestCase): + + def test_selectors_select_is_patched(self): + # https://github.com/gevent/gevent/issues/835 + _select = selectors.SelectSelector._select + self.assertTrue(hasattr(_select, '_gevent_monkey'), dir(_select)) + + +if __name__ == '__main__': + greentest.main() diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__monkey_sigchld.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__monkey_sigchld.py new file mode 100644 index 00000000..0385fd8b --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__monkey_sigchld.py @@ -0,0 +1,69 @@ +import errno +import os +import sys +#os.environ['GEVENT_NOWAITPID'] = 'True' + +import gevent +import gevent.monkey +gevent.monkey.patch_all() + +pid = None +awaiting_child = [] + + +def handle_sigchld(*_args): + # Make sure we can do a blocking operation + gevent.sleep() + # Signal completion + awaiting_child.pop() + # Raise an ignored error + raise TypeError("This should be ignored but printed") + +import signal +if hasattr(signal, 'SIGCHLD'): + assert signal.getsignal(signal.SIGCHLD) == signal.SIG_DFL + signal.signal(signal.SIGCHLD, handle_sigchld) + handler = signal.getsignal(signal.SIGCHLD) + assert signal.getsignal(signal.SIGCHLD) is handle_sigchld, handler + + if hasattr(os, 'forkpty'): + def forkpty(): + # For printing in errors + return os.forkpty()[0] + funcs = (os.fork, forkpty) + else: + funcs = (os.fork,) + + for func in funcs: + awaiting_child = [True] + pid = func() + if not pid: + # child + gevent.sleep(0.3) + sys.exit(0) + else: + timeout = gevent.Timeout(1) + try: + while awaiting_child: + gevent.sleep(0.01) + # We should now be able to waitpid() for an arbitrary child + wpid, status = os.waitpid(-1, os.WNOHANG) + if wpid != pid: + raise AssertionError("Failed to wait on a child pid forked with a function", + wpid, pid, func) + + # And a second call should raise ECHILD + try: + wpid, status = os.waitpid(-1, os.WNOHANG) + raise AssertionError("Should not be able to wait again") + except OSError as e: + assert e.errno == errno.ECHILD + except gevent.Timeout as t: + if timeout is not t: + raise + raise AssertionError("Failed to wait using", func) + finally: + timeout.close() + sys.exit(0) +else: + print("No SIGCHLD, not testing") diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__monkey_sigchld_2.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__monkey_sigchld_2.py new file mode 100644 index 00000000..e1cab8ce --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__monkey_sigchld_2.py @@ -0,0 +1,51 @@ +# Mimics what gunicorn workers do: monkey patch in the child process +# and try to reset signal handlers to SIG_DFL. +# NOTE: This breaks again when gevent.subprocess is used, or any child +# watcher. +import os +import sys + +import signal + + +def handle(*_args): + if not pid: + # We only do this is the child so our + # parent's waitpid can get the status. + # This is the opposite of gunicorn. + os.waitpid(-1, os.WNOHANG) +# The signal watcher must be installed *before* monkey patching +if hasattr(signal, 'SIGCHLD'): + # On Python 2, the signal handler breaks the platform + # module, because it uses os.popen. pkg_resources uses the platform + # module. + # Cache that info. + import platform + platform.uname() + signal.signal(signal.SIGCHLD, handle) + + pid = os.fork() + + if pid: # parent + try: + _, stat = os.waitpid(pid, 0) + except OSError: + # Interrupted system call + _, stat = os.waitpid(pid, 0) + assert stat == 0, stat + else: + # Under Python 2, os.popen() directly uses the popen call, and + # popen's file uses the pclose() system call to + # wait for the child. If it's already waited on, + # it raises the same exception. + # Python 3 uses the subprocess module directly which doesn't + # have this problem. + import gevent.monkey + gevent.monkey.patch_all() + signal.signal(signal.SIGCHLD, signal.SIG_DFL) + f = os.popen('true') + f.close() + + sys.exit(0) +else: + print("No SIGCHLD, not testing") diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__monkey_sigchld_3.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__monkey_sigchld_3.py new file mode 100644 index 00000000..100e6ebf --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__monkey_sigchld_3.py @@ -0,0 +1,52 @@ +# Mimics what gunicorn workers do *if* the arbiter is also monkey-patched: +# After forking from the master monkey-patched process, the child +# resets signal handlers to SIG_DFL. If we then fork and watch *again*, +# we shouldn't hang. (Note that we carefully handle this so as not to break +# os.popen) +from __future__ import print_function +# Patch in the parent process. +import gevent.monkey +gevent.monkey.patch_all() + +from gevent import get_hub + +import os +import sys + +import signal +import subprocess + +def _waitpid(p): + try: + _, stat = os.waitpid(p, 0) + except OSError: + # Interrupted system call + _, stat = os.waitpid(p, 0) + assert stat == 0, stat + +if hasattr(signal, 'SIGCHLD'): + # Do what subprocess does and make sure we have the watcher + # in the parent + get_hub().loop.install_sigchld() + + + pid = os.fork() + + if pid: # parent + _waitpid(pid) + else: + # Child resets. + signal.signal(signal.SIGCHLD, signal.SIG_DFL) + + # Go through subprocess because we expect it to automatically + # set up the waiting for us. + popen = subprocess.Popen([sys.executable, '-c', 'import sys'], + stdout=subprocess.PIPE, stderr=subprocess.PIPE) + popen.stderr.read() + popen.stdout.read() + popen.wait() # This hangs if it doesn't. + popen.stderr.close() + popen.stdout.close() + sys.exit(0) +else: + print("No SIGCHLD, not testing") diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__monkey_ssl_warning.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__monkey_ssl_warning.py new file mode 100644 index 00000000..1e946679 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__monkey_ssl_warning.py @@ -0,0 +1,34 @@ +import unittest +import warnings + +# This file should only have this one test in it +# because we have to be careful about our imports +# and because we need to be careful about our patching. + +class Test(unittest.TestCase): + + def test_with_pkg_resources(self): + # Issue 1108: Python 2, importing pkg_resources, + # as is done for namespace packages, imports ssl, + # leading to an unwanted SSL warning. + __import__('pkg_resources') + + from gevent import monkey + + self.assertFalse(monkey.saved) + + with warnings.catch_warnings(record=True) as issued_warnings: + warnings.simplefilter('always') + + monkey.patch_all() + monkey.patch_all() + + issued_warnings = [x for x in issued_warnings + if isinstance(x.message, monkey.MonkeyPatchWarning)] + + self.assertFalse(issued_warnings, [str(i) for i in issued_warnings]) + self.assertEqual(0, len(issued_warnings)) + + +if __name__ == '__main__': + unittest.main() diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__monkey_ssl_warning2.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__monkey_ssl_warning2.py new file mode 100644 index 00000000..c7c12399 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__monkey_ssl_warning2.py @@ -0,0 +1,44 @@ +import unittest +import warnings +import sys + +# All supported python versions now provide SSLContext. +# We import it by name and subclass it here by name. +# compare with warning3.py +from ssl import SSLContext + +class MySubclass(SSLContext): + pass + +# This file should only have this one test in it +# because we have to be careful about our imports +# and because we need to be careful about our patching. + +class Test(unittest.TestCase): + + @unittest.skipIf(sys.version_info[:2] < (3, 6), + "Only on Python 3.6+") + def test_ssl_subclass_and_module_reference(self): + + from gevent import monkey + + self.assertFalse(monkey.saved) + + with warnings.catch_warnings(record=True) as issued_warnings: + warnings.simplefilter('always') + + monkey.patch_all() + monkey.patch_all() + + issued_warnings = [x for x in issued_warnings + if isinstance(x.message, monkey.MonkeyPatchWarning)] + + self.assertEqual(1, len(issued_warnings)) + message = issued_warnings[0].message + self.assertIn("Modules that had direct imports", str(message)) + self.assertIn("Subclasses (NOT patched)", str(message)) + + + +if __name__ == '__main__': + unittest.main() diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__monkey_ssl_warning3.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__monkey_ssl_warning3.py new file mode 100644 index 00000000..76b2a794 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__monkey_ssl_warning3.py @@ -0,0 +1,47 @@ +import unittest +import warnings +import sys + +# All supported python versions now provide SSLContext. +# We subclass without importing by name. Compare with +# warning2.py +import ssl + +class MySubclass(ssl.SSLContext): + pass + +# This file should only have this one test in it +# because we have to be careful about our imports +# and because we need to be careful about our patching. + +class Test(unittest.TestCase): + + @unittest.skipIf(sys.version_info[:2] < (3, 6), + "Only on Python 3.6+") + def test_ssl_subclass_and_module_reference(self): + + from gevent import monkey + + self.assertFalse(monkey.saved) + + with warnings.catch_warnings(record=True) as issued_warnings: + warnings.simplefilter('always') + + monkey.patch_all() + monkey.patch_all() + + issued_warnings = [x for x in issued_warnings + if isinstance(x.message, monkey.MonkeyPatchWarning)] + + self.assertEqual(1, len(issued_warnings)) + message = str(issued_warnings[0].message) + + self.assertNotIn("Modules that had direct imports", message) + self.assertIn("Subclasses (NOT patched)", message) + # the gevent subclasses should not be in here. + self.assertNotIn('gevent.', message) + + + +if __name__ == '__main__': + unittest.main() diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__nondefaultloop.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__nondefaultloop.py new file mode 100644 index 00000000..489ff526 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__nondefaultloop.py @@ -0,0 +1,12 @@ +# test for issue #210 +from gevent import core +from gevent.testing.util import alarm + + +alarm(1) + +log = [] +loop = core.loop(default=False) +loop.run_callback(log.append, 1) +loop.run() +assert log == [1], log diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__order.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__order.py new file mode 100644 index 00000000..83aa1c9e --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__order.py @@ -0,0 +1,61 @@ +import gevent +import gevent.testing as greentest +from gevent.testing.six import xrange + + +class appender(object): + + def __init__(self, lst, item): + self.lst = lst + self.item = item + + def __call__(self, *args): + self.lst.append(self.item) + + +class Test(greentest.TestCase): + + count = 2 + + def test_greenlet_link(self): + lst = [] + + # test that links are executed in the same order as they were added + g = gevent.spawn(lst.append, 0) + + for i in xrange(1, self.count): + g.link(appender(lst, i)) + g.join() + self.assertEqual(lst, list(range(self.count))) + + +class Test3(Test): + count = 3 + + +class Test4(Test): + count = 4 + + +class TestM(Test): + count = 1000 + + +class TestSleep0(greentest.TestCase): + + def test(self): + lst = [] + gevent.spawn(sleep0, lst, '1') + gevent.spawn(sleep0, lst, '2') + gevent.wait() + self.assertEqual(' '.join(lst), '1A 2A 1B 2B') + + +def sleep0(lst, param): + lst.append(param + 'A') + gevent.sleep(0) + lst.append(param + 'B') + + +if __name__ == '__main__': + greentest.main() diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__os.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__os.py new file mode 100644 index 00000000..dacf2c4a --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__os.py @@ -0,0 +1,178 @@ +from __future__ import print_function, absolute_import, division + +import sys +from os import pipe + + +import gevent +from gevent import os +from gevent import Greenlet, joinall + +from gevent import testing as greentest +from gevent.testing import mock +from gevent.testing import six +from gevent.testing.skipping import skipOnLibuvOnPyPyOnWin + + +class TestOS_tp(greentest.TestCase): + + __timeout__ = greentest.LARGE_TIMEOUT + + def pipe(self): + return pipe() + + read = staticmethod(os.tp_read) + write = staticmethod(os.tp_write) + + @skipOnLibuvOnPyPyOnWin("Sometimes times out") + def _test_if_pipe_blocks(self, buffer_class): + r, w = self.pipe() + # set nbytes such that for sure it is > maximum pipe buffer + nbytes = 1000000 + block = b'x' * 4096 + buf = buffer_class(block) + # Lack of "nonlocal" keyword in Python 2.x: + bytesread = [0] + byteswritten = [0] + + def produce(): + while byteswritten[0] != nbytes: + bytesleft = nbytes - byteswritten[0] + byteswritten[0] += self.write(w, buf[:min(bytesleft, 4096)]) + + def consume(): + while bytesread[0] != nbytes: + bytesleft = nbytes - bytesread[0] + bytesread[0] += len(self.read(r, min(bytesleft, 4096))) + + producer = Greenlet(produce) + producer.start() + consumer = Greenlet(consume) + consumer.start_later(1) + # If patching was not succesful, the producer will have filled + # the pipe before the consumer starts, and would block the entire + # process. Therefore the next line would never finish. + joinall([producer, consumer]) + self.assertEqual(bytesread[0], nbytes) + self.assertEqual(bytesread[0], byteswritten[0]) + + if sys.version_info[0] < 3: + + def test_if_pipe_blocks_buffer(self): + self._test_if_pipe_blocks(six.builtins.buffer) + + if sys.version_info[:2] >= (2, 7): + + def test_if_pipe_blocks_memoryview(self): + self._test_if_pipe_blocks(six.builtins.memoryview) + + +@greentest.skipUnless(hasattr(os, 'make_nonblocking'), + "Only on POSIX") +class TestOS_nb(TestOS_tp): + + def read(self, fd, count): + return os.nb_read(fd, count) + + def write(self, fd, count): + return os.nb_write(fd, count) + + def pipe(self): + r, w = super(TestOS_nb, self).pipe() + os.make_nonblocking(r) + os.make_nonblocking(w) + return r, w + + def _make_ignored_oserror(self): + import errno + ignored_oserror = OSError() + ignored_oserror.errno = errno.EINTR + return ignored_oserror + + + def _check_hub_event_closed(self, mock_get_hub, fd, event): + mock_get_hub.assert_called_once_with() + hub = mock_get_hub.return_value + io = hub.loop.io + io.assert_called_once_with(fd, event) + + event = io.return_value + event.close.assert_called_once_with() + + def _test_event_closed_on_normal_io(self, nb_func, nb_arg, + mock_io, mock_get_hub, event): + mock_io.side_effect = [self._make_ignored_oserror(), 42] + + fd = 100 + result = nb_func(fd, nb_arg) + self.assertEqual(result, 42) + + self._check_hub_event_closed(mock_get_hub, fd, event) + + def _test_event_closed_on_io_error(self, nb_func, nb_arg, + mock_io, mock_get_hub, event): + mock_io.side_effect = [self._make_ignored_oserror(), ValueError()] + + fd = 100 + + with self.assertRaises(ValueError): + nb_func(fd, nb_arg) + + self._check_hub_event_closed(mock_get_hub, fd, event) + + @mock.patch('gevent.os.get_hub') + @mock.patch('gevent.os._write') + def test_event_closed_on_write(self, mock_write, mock_get_hub): + self._test_event_closed_on_normal_io(os.nb_write, b'buf', + mock_write, mock_get_hub, + 2) + + @mock.patch('gevent.os.get_hub') + @mock.patch('gevent.os._write') + def test_event_closed_on_write_error(self, mock_write, mock_get_hub): + self._test_event_closed_on_io_error(os.nb_write, b'buf', + mock_write, mock_get_hub, + 2) + + @mock.patch('gevent.os.get_hub') + @mock.patch('gevent.os._read') + def test_event_closed_on_read(self, mock_read, mock_get_hub): + self._test_event_closed_on_normal_io(os.nb_read, b'buf', + mock_read, mock_get_hub, + 1) + + @mock.patch('gevent.os.get_hub') + @mock.patch('gevent.os._read') + def test_event_closed_on_read_error(self, mock_read, mock_get_hub): + self._test_event_closed_on_io_error(os.nb_read, b'buf', + mock_read, mock_get_hub, + 1) + + +@greentest.skipUnless(hasattr(os, 'fork_and_watch'), + "Only on POSIX") +class TestForkAndWatch(greentest.TestCase): + + __timeout__ = greentest.LARGE_TIMEOUT + + def test_waitpid_all(self): + # Cover this specific case. + pid = os.fork_and_watch() + if pid: + os.waitpid(-1, 0) + # Can't assert on what the pid actually was, + # our testrunner may have spawned multiple children. + os._reap_children(0) # make the leakchecker happy + else: # pragma: no cover + gevent.sleep(2) + os._exit(0) + + def test_waitpid_wrong_neg(self): + self.assertRaises(OSError, os.waitpid, -2, 0) + + def test_waitpid_wrong_pos(self): + self.assertRaises(OSError, os.waitpid, 1, 0) + + +if __name__ == '__main__': + greentest.main() diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__pool.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__pool.py new file mode 100644 index 00000000..989ee9ca --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__pool.py @@ -0,0 +1,603 @@ +from time import time +import gevent +import gevent.pool +from gevent.event import Event +from gevent.queue import Queue + +import gevent.testing as greentest +import gevent.testing.timing +import random +from gevent.testing import ExpectedException + +import unittest + + +class TestCoroutinePool(unittest.TestCase): + klass = gevent.pool.Pool + + def test_apply_async(self): + done = Event() + + def some_work(_): + done.set() + + pool = self.klass(2) + pool.apply_async(some_work, ('x', )) + done.wait() + + def test_apply(self): + value = 'return value' + + def some_work(): + return value + + pool = self.klass(2) + result = pool.apply(some_work) + self.assertEqual(value, result) + + def test_apply_raises(self): + pool = self.klass(1) + + def raiser(): + raise ExpectedException() + try: + pool.apply(raiser) + except ExpectedException: + pass + else: + self.fail("Should have raised ExpectedException") + # Don't let the metaclass automatically force any error + # that reaches the hub from a spawned greenlet to become + # fatal; that defeats the point of the test. + test_apply_raises.error_fatal = False + + def test_multiple_coros(self): + evt = Event() + results = [] + + def producer(): + gevent.sleep(0.001) + results.append('prod') + evt.set() + + def consumer(): + results.append('cons1') + evt.wait() + results.append('cons2') + + pool = self.klass(2) + done = pool.spawn(consumer) + pool.apply_async(producer) + done.get() + self.assertEqual(['cons1', 'prod', 'cons2'], results) + + def dont_test_timer_cancel(self): + timer_fired = [] + + def fire_timer(): + timer_fired.append(True) + + def some_work(): + gevent.timer(0, fire_timer) # pylint:disable=no-member + + pool = self.klass(2) + pool.apply(some_work) + gevent.sleep(0) + self.assertEqual(timer_fired, []) + + def test_reentrant(self): + pool = self.klass(1) + result = pool.apply(pool.apply, (lambda a: a + 1, (5, ))) + self.assertEqual(result, 6) + evt = Event() + pool.apply_async(evt.set) + evt.wait() + + @greentest.skipOnPyPy("Does not work on PyPy") # Why? + def test_stderr_raising(self): + # testing that really egregious errors in the error handling code + # (that prints tracebacks to stderr) don't cause the pool to lose + # any members + import sys + pool = self.klass(size=1) + + # we're going to do this by causing the traceback.print_exc in + # safe_apply to raise an exception and thus exit _main_loop + normal_err = sys.stderr + try: + sys.stderr = FakeFile() + waiter = pool.spawn(crash) + with gevent.Timeout(2): + self.assertRaises(RuntimeError, waiter.get) + # the pool should have something free at this point since the + # waiter returned + # pool.Pool change: if an exception is raised during execution of a link, + # the rest of the links are scheduled to be executed on the next hub iteration + # this introduces a delay in updating pool.sem which makes pool.free_count() report 0 + # therefore, sleep: + gevent.sleep(0) + self.assertEqual(pool.free_count(), 1) + # shouldn't block when trying to get + with gevent.Timeout.start_new(0.1): + pool.apply(gevent.sleep, (0, )) + finally: + sys.stderr = normal_err + pool.join() + + +def crash(*_args, **_kw): + raise RuntimeError("Whoa") + + +class FakeFile(object): + + def write(self, *_args): + raise RuntimeError('Whaaa') + + +class PoolBasicTests(greentest.TestCase): + klass = gevent.pool.Pool + + def test_execute_async(self): + p = self.klass(size=2) + self.assertEqual(p.free_count(), 2) + r = [] + + first = p.spawn(r.append, 1) + self.assertEqual(p.free_count(), 1) + first.get() + self.assertEqual(r, [1]) + gevent.sleep(0) + self.assertEqual(p.free_count(), 2) + + #Once the pool is exhausted, calling an execute forces a yield. + + p.apply_async(r.append, (2, )) + self.assertEqual(1, p.free_count()) + self.assertEqual(r, [1]) + + p.apply_async(r.append, (3, )) + self.assertEqual(0, p.free_count()) + self.assertEqual(r, [1]) + + p.apply_async(r.append, (4, )) + self.assertEqual(r, [1]) + gevent.sleep(0.01) + self.assertEqual(sorted(r), [1, 2, 3, 4]) + + def test_discard(self): + p = self.klass(size=1) + first = p.spawn(gevent.sleep, 1000) + p.discard(first) + first.kill() + self.assertFalse(first) + self.assertEqual(len(p), 0) + self.assertEqual(p._semaphore.counter, 1) + + def test_add_method(self): + p = self.klass(size=1) + first = gevent.spawn(gevent.sleep, 1000) + try: + second = gevent.spawn(gevent.sleep, 1000) + try: + self.assertEqual(p.free_count(), 1) + self.assertEqual(len(p), 0) + p.add(first) + self.assertEqual(p.free_count(), 0) + self.assertEqual(len(p), 1) + + with self.assertRaises(gevent.Timeout): + with gevent.Timeout(0.1): + p.add(second) + + self.assertEqual(p.free_count(), 0) + self.assertEqual(len(p), 1) + finally: + second.kill() + finally: + first.kill() + + @greentest.ignores_leakcheck + def test_add_method_non_blocking(self): + p = self.klass(size=1) + first = gevent.spawn(gevent.sleep, 1000) + try: + second = gevent.spawn(gevent.sleep, 1000) + try: + p.add(first) + with self.assertRaises(gevent.pool.PoolFull): + p.add(second, blocking=False) + finally: + second.kill() + finally: + first.kill() + + @greentest.ignores_leakcheck + def test_add_method_timeout(self): + p = self.klass(size=1) + first = gevent.spawn(gevent.sleep, 1000) + try: + second = gevent.spawn(gevent.sleep, 1000) + try: + p.add(first) + with self.assertRaises(gevent.pool.PoolFull): + p.add(second, timeout=0.100) + finally: + second.kill() + finally: + first.kill() + + @greentest.ignores_leakcheck + def test_start_method_timeout(self): + p = self.klass(size=1) + first = gevent.spawn(gevent.sleep, 1000) + try: + second = gevent.Greenlet(gevent.sleep, 1000) + try: + p.add(first) + with self.assertRaises(gevent.pool.PoolFull): + p.start(second, timeout=0.100) + finally: + second.kill() + finally: + first.kill() + + def test_apply(self): + p = self.klass() + result = p.apply(lambda a: ('foo', a), (1, )) + self.assertEqual(result, ('foo', 1)) + + def test_init_error(self): + self.switch_expected = False + self.assertRaises(ValueError, self.klass, -1) + +# +# tests from standard library test/test_multiprocessing.py + + +class TimingWrapper(object): + + def __init__(self, func): + self.func = func + self.elapsed = None + + def __call__(self, *args, **kwds): + t = time() + try: + return self.func(*args, **kwds) + finally: + self.elapsed = time() - t + + +def sqr(x, wait=0.0): + gevent.sleep(wait) + return x * x + + +def squared(x): + return x * x + + +def sqr_random_sleep(x): + gevent.sleep(random.random() * 0.1) + return x * x + + +def final_sleep(): + for i in range(3): + yield i + gevent.sleep(0.2) + + +TIMEOUT1, TIMEOUT2, TIMEOUT3 = 0.082, 0.035, 0.14 + + +SMALL_RANGE = 10 +LARGE_RANGE = 1000 + +if (greentest.PYPY and greentest.WIN) or greentest.RUN_LEAKCHECKS or greentest.RUN_COVERAGE: + # See comments in test__threadpool.py. + LARGE_RANGE = 25 +elif greentest.RUNNING_ON_CI or greentest.EXPECT_POOR_TIMER_RESOLUTION: + LARGE_RANGE = 100 + +class TestPool(greentest.TestCase): # pylint:disable=too-many-public-methods + __timeout__ = greentest.LARGE_TIMEOUT + size = 1 + + def setUp(self): + greentest.TestCase.setUp(self) + self.pool = gevent.pool.Pool(self.size) + + def cleanup(self): + self.pool.join() + + def test_apply(self): + papply = self.pool.apply + self.assertEqual(papply(sqr, (5,)), 25) + self.assertEqual(papply(sqr, (), {'x': 3}), 9) + + def test_map(self): + pmap = self.pool.map + self.assertEqual(pmap(sqr, range(SMALL_RANGE)), list(map(squared, range(SMALL_RANGE)))) + self.assertEqual(pmap(sqr, range(100)), list(map(squared, range(100)))) + + def test_async(self): + res = self.pool.apply_async(sqr, (7, TIMEOUT1,)) + get = TimingWrapper(res.get) + self.assertEqual(get(), 49) + self.assertTimeoutAlmostEqual(get.elapsed, TIMEOUT1, 1) + + def test_async_callback(self): + result = [] + res = self.pool.apply_async(sqr, (7, TIMEOUT1,), callback=result.append) + get = TimingWrapper(res.get) + self.assertEqual(get(), 49) + self.assertTimeoutAlmostEqual(get.elapsed, TIMEOUT1, 1) + gevent.sleep(0) # lets the callback run + self.assertEqual(result, [49]) + + def test_async_timeout(self): + res = self.pool.apply_async(sqr, (6, TIMEOUT2 + 0.2)) + get = TimingWrapper(res.get) + self.assertRaises(gevent.Timeout, get, timeout=TIMEOUT2) + self.assertTimeoutAlmostEqual(get.elapsed, TIMEOUT2, 1) + self.pool.join() + + def test_imap_list_small(self): + it = self.pool.imap(sqr, range(SMALL_RANGE)) + self.assertEqual(list(it), list(map(sqr, range(SMALL_RANGE)))) + + def test_imap_it_small(self): + it = self.pool.imap(sqr, range(SMALL_RANGE)) + for i in range(SMALL_RANGE): + self.assertEqual(next(it), i * i) + self.assertRaises(StopIteration, next, it) + + def test_imap_it_large(self): + it = self.pool.imap(sqr, range(LARGE_RANGE)) + for i in range(LARGE_RANGE): + self.assertEqual(next(it), i * i) + self.assertRaises(StopIteration, next, it) + + def test_imap_random(self): + it = self.pool.imap(sqr_random_sleep, range(SMALL_RANGE)) + self.assertEqual(list(it), list(map(squared, range(SMALL_RANGE)))) + + def test_imap_unordered(self): + it = self.pool.imap_unordered(sqr, range(LARGE_RANGE)) + self.assertEqual(sorted(it), list(map(squared, range(LARGE_RANGE)))) + + it = self.pool.imap_unordered(sqr, range(LARGE_RANGE)) + self.assertEqual(sorted(it), list(map(squared, range(LARGE_RANGE)))) + + def test_imap_unordered_random(self): + it = self.pool.imap_unordered(sqr_random_sleep, range(SMALL_RANGE)) + self.assertEqual(sorted(it), list(map(squared, range(SMALL_RANGE)))) + + def test_empty_imap_unordered(self): + it = self.pool.imap_unordered(sqr, []) + self.assertEqual(list(it), []) + + def test_empty_imap(self): + it = self.pool.imap(sqr, []) + self.assertEqual(list(it), []) + + def test_empty_map(self): + self.assertEqual(self.pool.map(sqr, []), []) + + def test_terminate(self): + result = self.pool.map_async(gevent.sleep, [0.1] * ((self.size or 10) * 2)) + gevent.sleep(0.1) + kill = TimingWrapper(self.pool.kill) + kill() + self.assertTimeWithinRange(kill.elapsed, 0.0, 0.5) + result.join() + + def sleep(self, x): + gevent.sleep(float(x) / 10.) + return str(x) + + def test_imap_unordered_sleep(self): + # testing that imap_unordered returns items in competion order + result = list(self.pool.imap_unordered(self.sleep, [10, 1, 2])) + if self.pool.size == 1: + expected = ['10', '1', '2'] + else: + expected = ['1', '2', '10'] + self.assertEqual(result, expected) + + # https://github.com/gevent/gevent/issues/423 + def test_imap_no_stop(self): + q = Queue() + q.put(123) + gevent.spawn_later(0.1, q.put, StopIteration) + result = list(self.pool.imap(lambda _: _, q)) + self.assertEqual(result, [123]) + + def test_imap_unordered_no_stop(self): + q = Queue() + q.put(1234) + gevent.spawn_later(0.1, q.put, StopIteration) + result = list(self.pool.imap_unordered(lambda _: _, q)) + self.assertEqual(result, [1234]) + + # same issue, but different test: https://github.com/gevent/gevent/issues/311 + def test_imap_final_sleep(self): + result = list(self.pool.imap(sqr, final_sleep())) + self.assertEqual(result, [0, 1, 4]) + + def test_imap_unordered_final_sleep(self): + result = list(self.pool.imap_unordered(sqr, final_sleep())) + self.assertEqual(result, [0, 1, 4]) + + # Issue 638 + def test_imap_unordered_bounded_queue(self): + iterable = list(range(100)) + + running = [0] + + def short_running_func(i, _j): + running[0] += 1 + return i + + def make_reader(mapping): + # Simulate a long running reader. No matter how many workers + # we have, we will never have a queue more than size 1 + def reader(): + result = [] + for i, x in enumerate(mapping): + self.assertTrue(running[0] <= i + 2, running[0]) + result.append(x) + gevent.sleep(0.01) + self.assertTrue(len(mapping.queue) <= 2, len(mapping.queue)) + return result + return reader + + # Send two iterables to make sure varargs and kwargs are handled + # correctly + for meth in self.pool.imap_unordered, self.pool.imap: + running[0] = 0 + mapping = meth(short_running_func, iterable, iterable, + maxsize=1) + + reader = make_reader(mapping) + l = reader() + self.assertEqual(sorted(l), iterable) + +@greentest.ignores_leakcheck +class TestPool2(TestPool): + size = 2 + +@greentest.ignores_leakcheck +class TestPool3(TestPool): + size = 3 + +@greentest.ignores_leakcheck +class TestPool10(TestPool): + size = 10 + + +class TestPoolUnlimit(TestPool): + size = None + + +class TestPool0(greentest.TestCase): + size = 0 + + def test_wait_full(self): + p = gevent.pool.Pool(size=0) + self.assertEqual(0, p.free_count()) + self.assertTrue(p.full()) + self.assertEqual(0, p.wait_available(timeout=0.01)) + + +class TestJoinSleep(gevent.testing.timing.AbstractGenericWaitTestCase): + + def wait(self, timeout): + p = gevent.pool.Pool() + g = p.spawn(gevent.sleep, 10) + try: + p.join(timeout=timeout) + finally: + g.kill() + + +class TestJoinSleep_raise_error(gevent.testing.timing.AbstractGenericWaitTestCase): + + def wait(self, timeout): + p = gevent.pool.Pool() + g = p.spawn(gevent.sleep, 10) + try: + p.join(timeout=timeout, raise_error=True) + finally: + g.kill() + + +class TestJoinEmpty(greentest.TestCase): + switch_expected = False + + def test(self): + p = gevent.pool.Pool() + res = p.join() + self.assertTrue(res, "empty should return true") + + +class TestSpawn(greentest.TestCase): + switch_expected = True + + def test(self): + p = gevent.pool.Pool(1) + self.assertEqual(len(p), 0) + p.spawn(gevent.sleep, 0.1) + self.assertEqual(len(p), 1) + p.spawn(gevent.sleep, 0.1) # this spawn blocks until the old one finishes + self.assertEqual(len(p), 1) + gevent.sleep(0.19 if not greentest.RUNNING_ON_APPVEYOR else 0.5) + self.assertEqual(len(p), 0) + + def testSpawnAndWait(self): + p = gevent.pool.Pool(1) + self.assertEqual(len(p), 0) + p.spawn(gevent.sleep, 0.1) + self.assertEqual(len(p), 1) + res = p.join(0.01) + self.assertFalse(res, "waiting on a full pool should return false") + res = p.join() + self.assertTrue(res, "waiting to finish should be true") + self.assertEqual(len(p), 0) + +def error_iter(): + yield 1 + yield 2 + raise ExpectedException + + +class TestErrorInIterator(greentest.TestCase): + error_fatal = False + + def test(self): + p = gevent.pool.Pool(3) + self.assertRaises(ExpectedException, p.map, lambda x: None, error_iter()) + gevent.sleep(0.001) + + def test_unordered(self): + p = gevent.pool.Pool(3) + + def unordered(): + return list(p.imap_unordered(lambda x: None, error_iter())) + + self.assertRaises(ExpectedException, unordered) + gevent.sleep(0.001) + + +def divide_by(x): + return 1.0 / x + + +class TestErrorInHandler(greentest.TestCase): + error_fatal = False + + def test_map(self): + p = gevent.pool.Pool(3) + self.assertRaises(ZeroDivisionError, p.map, divide_by, [1, 0, 2]) + + def test_imap(self): + p = gevent.pool.Pool(1) + it = p.imap(divide_by, [1, 0, 2]) + self.assertEqual(next(it), 1.0) + self.assertRaises(ZeroDivisionError, next, it) + self.assertEqual(next(it), 0.5) + self.assertRaises(StopIteration, next, it) + + def test_imap_unordered(self): + p = gevent.pool.Pool(1) + it = p.imap_unordered(divide_by, [1, 0, 2]) + self.assertEqual(next(it), 1.0) + self.assertRaises(ZeroDivisionError, next, it) + self.assertEqual(next(it), 0.5) + self.assertRaises(StopIteration, next, it) + + +if __name__ == '__main__': + greentest.main() diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__pywsgi.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__pywsgi.py new file mode 100644 index 00000000..9fe22615 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__pywsgi.py @@ -0,0 +1,1811 @@ +# Copyright (c) 2007, Linden Research, Inc. +# Copyright (c) 2009-2010 gevent contributors +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. +# pylint: disable=too-many-lines,unused-argument +from __future__ import print_function + +from gevent import monkey + +monkey.patch_all(thread=False) + +try: + from urllib.parse import parse_qs +except ImportError: + # Python 2 + from urlparse import parse_qs +import os +import sys +try: + # On Python 2, we want the C-optimized version if + # available; it has different corner-case behaviour than + # the Python implementation, and it used by socket.makefile + # by default. + from cStringIO import StringIO +except ImportError: + from io import BytesIO as StringIO +import weakref + +from wsgiref.validate import validator + +import gevent.testing as greentest +import gevent +from gevent.testing import PY3, PYPY +from gevent import socket +from gevent import pywsgi +from gevent.pywsgi import Input + + +CONTENT_LENGTH = 'Content-Length' +CONN_ABORTED_ERRORS = greentest.CONN_ABORTED_ERRORS +server_implements_chunked = True +server_implements_pipeline = True +server_implements_100continue = True +DEBUG = '-v' in sys.argv + +REASONS = {200: 'OK', + 500: 'Internal Server Error'} + + +class ConnectionClosed(Exception): + pass + + +def read_headers(fd): + response_line = fd.readline() + if not response_line: + raise ConnectionClosed + response_line = response_line.decode('latin-1') + headers = {} + while True: + line = fd.readline().strip() + if not line: + break + line = line.decode('latin-1') + try: + key, value = line.split(': ', 1) + except: + print('Failed to split: %r' % (line, )) + raise + assert key.lower() not in {x.lower() for x in headers}, 'Header %r:%r sent more than once: %r' % (key, value, headers) + headers[key] = value + return response_line, headers + + +def iread_chunks(fd): + while True: + line = fd.readline() + chunk_size = line.strip() + try: + chunk_size = int(chunk_size, 16) + except: + print('Failed to parse chunk size: %r' % line) + raise + if chunk_size == 0: + crlf = fd.read(2) + assert crlf == b'\r\n', repr(crlf) + break + data = fd.read(chunk_size) + yield data + crlf = fd.read(2) + assert crlf == b'\r\n', repr(crlf) + + +class Response(object): + + def __init__(self, status_line, headers): + self.status_line = status_line + self.headers = headers + self.body = None + self.chunks = False + try: + version, code, self.reason = status_line[:-2].split(' ', 2) + self.code = int(code) + HTTP, self.version = version.split('/') + assert HTTP == 'HTTP', repr(HTTP) + assert self.version in ('1.0', '1.1'), repr(self.version) + except Exception: + print('Error: %r' % status_line) + raise + + def __iter__(self): + yield self.status_line + yield self.headers + yield self.body + + def __str__(self): + args = (self.__class__.__name__, self.status_line, self.headers, self.body, self.chunks) + return '<%s status_line=%r headers=%r body=%r chunks=%r>' % args + + def assertCode(self, code): + if hasattr(code, '__contains__'): + assert self.code in code, 'Unexpected code: %r (expected %r)\n%s' % (self.code, code, self) + else: + assert self.code == code, 'Unexpected code: %r (expected %r)\n%s' % (self.code, code, self) + + def assertReason(self, reason): + assert self.reason == reason, 'Unexpected reason: %r (expected %r)\n%s' % (self.reason, reason, self) + + def assertVersion(self, version): + assert self.version == version, 'Unexpected version: %r (expected %r)\n%s' % (self.version, version, self) + + def assertHeader(self, header, value): + real_value = self.headers.get(header, False) + assert real_value == value, \ + 'Unexpected header %r: %r (expected %r)\n%s' % (header, real_value, value, self) + + def assertBody(self, body): + if isinstance(body, str) and PY3: + body = body.encode("ascii") + assert self.body == body, 'Unexpected body: %r (expected %r)\n%s' % (self.body, body, self) + + @classmethod + def read(cls, fd, code=200, reason='default', version='1.1', + body=None, chunks=None, content_length=None): + # pylint:disable=too-many-branches + _status_line, headers = read_headers(fd) + self = cls(_status_line, headers) + if code is not None: + self.assertCode(code) + if reason == 'default': + reason = REASONS.get(code) + if reason is not None: + self.assertReason(reason) + if version is not None: + self.assertVersion(version) + if self.code == 100: + return self + if content_length is not None: + if isinstance(content_length, int): + content_length = str(content_length) + self.assertHeader('Content-Length', content_length) + try: + if 'chunked' in headers.get('Transfer-Encoding', ''): + if CONTENT_LENGTH in headers: + print("WARNING: server used chunked transfer-encoding despite having Content-Length header (libevent 1.x's bug)") + self.chunks = list(iread_chunks(fd)) + self.body = b''.join(self.chunks) + elif CONTENT_LENGTH in headers: + num = int(headers[CONTENT_LENGTH]) + self.body = fd.read(num) + else: + self.body = fd.read() + except: + print('Response.read failed to read the body:\n%s' % self) + import traceback; traceback.print_exc() + raise + if body is not None: + self.assertBody(body) + if chunks is not None: + assert chunks == self.chunks, (chunks, self.chunks) + return self + +read_http = Response.read + + +class TestCase(greentest.TestCase): + server = None + validator = staticmethod(validator) + application = None + + # Bind to default address, which should give us ipv6 (when available) + # and ipv4. (see self.connect()) + listen_addr = '' + # connect on ipv4, even though we bound to ipv6 too + # to prove ipv4 works...except on Windows, it apparently doesn't. + # So use the hostname. + connect_addr = 'localhost' + + def init_logger(self): + import logging + logger = logging.getLogger('gevent.pywsgi') + return logger + + def init_server(self, application): + logger = self.logger = self.init_logger() + self.server = pywsgi.WSGIServer((self.listen_addr, 0), application, + log=logger, error_log=logger) + + def setUp(self): + application = self.application + if self.validator is not None: + application = self.validator(application) + self.init_server(application) + self.server.start() + self.port = self.server.server_port + greentest.TestCase.setUp(self) + + if greentest.CPYTHON and greentest.PY2: + # Keeping raw sockets alive keeps SSL sockets + # from being closed too, at least on CPython2, so we + # need to use weakrefs. + + # In contrast, on PyPy, *only* having a weakref lets the + # original socket die and leak + + def _close_on_teardown(self, resource): + self.close_on_teardown.append(weakref.ref(resource)) + return resource + + def _tearDownCloseOnTearDown(self): + self.close_on_teardown = [r() for r in self.close_on_teardown if r() is not None] + super(TestCase, self)._tearDownCloseOnTearDown() + + def tearDown(self): + greentest.TestCase.tearDown(self) + if self.server is not None: + with gevent.Timeout.start_new(0.5): + self.server.stop() + self.server = None + + + def connect(self): + conn = socket.create_connection((self.connect_addr, self.port)) + self._close_on_teardown(conn) + result = conn + if PY3: + conn_makefile = conn.makefile + + def makefile(*args, **kwargs): + if 'bufsize' in kwargs: + kwargs['buffering'] = kwargs.pop('bufsize') + + if 'mode' in kwargs: + return conn_makefile(*args, **kwargs) + + # Under Python3, you can't read and write to the same + # makefile() opened in (default) r, and r+ is not allowed + kwargs['mode'] = 'rwb' + rconn = conn_makefile(*args, **kwargs) + _rconn_write = rconn.write + + def write(data): + if isinstance(data, str): + data = data.encode('ascii') + return _rconn_write(data) + rconn.write = write + self._close_on_teardown(rconn) + return rconn + + class proxy(object): + def __getattribute__(self, name): + if name == 'makefile': + return makefile + return getattr(conn, name) + result = proxy() + return result + + def makefile(self): + return self.connect().makefile(bufsize=1) + + def urlopen(self, *args, **kwargs): + fd = self.connect().makefile(bufsize=1) + fd.write('GET / HTTP/1.1\r\nHost: localhost\r\n\r\n') + return read_http(fd, *args, **kwargs) + + +class CommonTests(TestCase): + + def test_basic(self): + fd = self.makefile() + fd.write('GET / HTTP/1.1\r\nHost: localhost\r\n\r\n') + response = read_http(fd, body='hello world') + if response.headers.get('Connection') == 'close' and not server_implements_pipeline: + return + fd.write('GET /notexist HTTP/1.1\r\nHost: localhost\r\n\r\n') + read_http(fd, code=404, reason='Not Found', body='not found') + fd.write('GET / HTTP/1.1\r\nHost: localhost\r\n\r\n') + read_http(fd, body='hello world') + fd.close() + + def test_pipeline(self): + if not server_implements_pipeline: + return + fd = self.makefile() + fd.write('GET / HTTP/1.1\r\nHost: localhost\r\n\r\n' + 'GET /notexist HTTP/1.1\r\nHost: localhost\r\n\r\n') + read_http(fd, body='hello world') + exception = AssertionError('HTTP pipelining not supported; the second request is thrown away') + try: + timeout = gevent.Timeout.start_new(0.5, exception=exception) + try: + read_http(fd, code=404, reason='Not Found', body='not found') + fd.close() + finally: + timeout.close() + except AssertionError as ex: + if ex is not exception: + raise + + def test_connection_close(self): + fd = self.makefile() + fd.write('GET / HTTP/1.1\r\nHost: localhost\r\n\r\n') + response = read_http(fd) + if response.headers.get('Connection') == 'close' and not server_implements_pipeline: + return + fd.write('GET / HTTP/1.1\r\nHost: localhost\r\nConnection: close\r\n\r\n') + read_http(fd) + fd.write('GET / HTTP/1.1\r\nHost: localhost\r\n\r\n') + # This may either raise, or it may return an empty response, + # depend on timing and the Python version. + try: + result = fd.readline() + except socket.error as ex: + if ex.args[0] not in CONN_ABORTED_ERRORS: + raise + else: + self.assertFalse( + result, + 'The remote side is expected to close the connection, but it sent %r' % (result,)) + + def SKIP_test_006_reject_long_urls(self): + fd = self.makefile() + path_parts = [] + for _ in range(3000): + path_parts.append('path') + path = '/'.join(path_parts) + request = 'GET /%s HTTP/1.0\r\nHost: localhost\r\n\r\n' % path + fd.write(request) + result = fd.readline() + status = result.split(' ')[1] + self.assertEqual(status, '414') + fd.close() + + +class TestNoChunks(CommonTests): + # when returning a list of strings a shortcut is employed by the server: + # it calculates the content-length and joins all the chunks before sending + validator = None + + def application(self, env, start_response): + self.assertTrue(env.get('wsgi.input_terminated')) + path = env['PATH_INFO'] + if path == '/': + start_response('200 OK', [('Content-Type', 'text/plain')]) + return [b'hello ', b'world'] + start_response('404 Not Found', [('Content-Type', 'text/plain')]) + return [b'not ', b'found'] + + def test(self): + fd = self.makefile() + fd.write('GET / HTTP/1.1\r\nHost: localhost\r\n\r\n') + response = read_http(fd, body='hello world') + self.assertFalse(response.chunks) + response.assertHeader('Content-Length', '11') + + if not server_implements_pipeline: + fd = self.makefile() + + fd.write('GET /not-found HTTP/1.1\r\nHost: localhost\r\n\r\n') + response = read_http(fd, code=404, reason='Not Found', body='not found') + self.assertFalse(response.chunks) + response.assertHeader('Content-Length', '9') + + +class TestExplicitContentLength(TestNoChunks): # pylint:disable=too-many-ancestors + # when returning a list of strings a shortcut is empoyed by the + # server - it caculates the content-length + + def application(self, env, start_response): + self.assertTrue(env.get('wsgi.input_terminated')) + path = env['PATH_INFO'] + if path == '/': + start_response('200 OK', [('Content-Type', 'text/plain'), ('Content-Length', '11')]) + return [b'hello ', b'world'] + + start_response('404 Not Found', [('Content-Type', 'text/plain'), ('Content-Length', '9')]) + return [b'not ', b'found'] + + +class TestYield(CommonTests): + + @staticmethod + def application(env, start_response): + path = env['PATH_INFO'] + if path == '/': + start_response('200 OK', [('Content-Type', 'text/plain')]) + yield b"hello world" + else: + start_response('404 Not Found', [('Content-Type', 'text/plain')]) + yield b"not found" + + +class TestBytearray(CommonTests): + + validator = None + + @staticmethod + def application(env, start_response): + path = env['PATH_INFO'] + if path == '/': + start_response('200 OK', [('Content-Type', 'text/plain')]) + return [bytearray(b"hello "), bytearray(b"world")] + start_response('404 Not Found', [('Content-Type', 'text/plain')]) + return [bytearray(b"not found")] + + +class MultiLineHeader(TestCase): + @staticmethod + def application(env, start_response): + assert "test.submit" in env["CONTENT_TYPE"] + start_response('200 OK', [('Content-Type', 'text/plain')]) + return [b"ok"] + + def test_multiline_116(self): + """issue #116""" + request = '\r\n'.join(( + 'POST / HTTP/1.0', + 'Host: localhost', + 'Content-Type: multipart/related; boundary="====XXXX====";', + ' type="text/xml";start="test.submit"', + 'Content-Length: 0', + '', '')) + fd = self.makefile() + fd.write(request) + read_http(fd) + + +class TestGetArg(TestCase): + + @staticmethod + def application(env, start_response): + body = env['wsgi.input'].read(3) + if PY3: + body = body.decode('ascii') + a = parse_qs(body).get('a', [1])[0] + start_response('200 OK', [('Content-Type', 'text/plain')]) + return [('a is %s, body is %s' % (a, body)).encode('ascii')] + + def test_007_get_arg(self): + # define a new handler that does a get_arg as well as a read_body + fd = self.makefile() + request = '\r\n'.join(( + 'POST / HTTP/1.0', + 'Host: localhost', + 'Content-Length: 3', + '', + 'a=a')) + fd.write(request) + + # send some junk after the actual request + fd.write('01234567890123456789') + read_http(fd, body='a is a, body is a=a') + fd.close() + +class TestCloseIter(TestCase): + + # The *Validator* closes the iterators! + validator = None + + def application(self, env, start_response): + start_response('200 OK', [('Content-Type', 'text/plain')]) + return self + + def __iter__(self): + yield bytearray(b"Hello World") + yield b"!" + + closed = False + + def close(self): + self.closed += 1 + + def test_close_is_called(self): + self.closed = False + fd = self.makefile() + fd.write('GET / HTTP/1.1\r\nHost: localhost\r\n\r\n') + read_http(fd, body=b"Hello World!", chunks=[b'Hello World', b'!']) + # We got closed exactly once. + self.assertEqual(self.closed, 1) + +class TestChunkedApp(TestCase): + + chunks = [b'this', b'is', b'chunked'] + + def body(self): + return b''.join(self.chunks) + + def application(self, env, start_response): + self.assertTrue(env.get('wsgi.input_terminated')) + start_response('200 OK', [('Content-Type', 'text/plain')]) + for chunk in self.chunks: + yield chunk + + def test_chunked_response(self): + fd = self.makefile() + fd.write('GET / HTTP/1.1\r\nHost: localhost\r\nConnection: close\r\n\r\n') + response = read_http(fd, body=self.body(), chunks=None) + if server_implements_chunked: + response.assertHeader('Transfer-Encoding', 'chunked') + self.assertEqual(response.chunks, self.chunks) + else: + response.assertHeader('Transfer-Encoding', False) + response.assertHeader('Content-Length', str(len(self.body()))) + self.assertEqual(response.chunks, False) + + def test_no_chunked_http_1_0(self): + fd = self.makefile() + fd.write('GET / HTTP/1.0\r\nHost: localhost\r\nConnection: close\r\n\r\n') + response = read_http(fd) + self.assertEqual(response.body, self.body()) + self.assertEqual(response.headers.get('Transfer-Encoding'), None) + content_length = response.headers.get('Content-Length') + if content_length is not None: + self.assertEqual(content_length, str(len(self.body()))) + + +class TestBigChunks(TestChunkedApp): + chunks = [b'a' * 8192] * 3 + + +class TestNegativeRead(TestCase): + + def application(self, env, start_response): + self.assertTrue(env.get('wsgi.input_terminated')) + start_response('200 OK', [('Content-Type', 'text/plain')]) + if env['PATH_INFO'] == '/read': + data = env['wsgi.input'].read(-1) + return [data] + + def test_negative_chunked_read(self): + fd = self.makefile() + data = (b'POST /read HTTP/1.1\r\nHost: localhost\r\nConnection: close\r\n' + b'Transfer-Encoding: chunked\r\n\r\n' + b'2\r\noh\r\n4\r\n hai\r\n0\r\n\r\n') + fd.write(data) + read_http(fd, body='oh hai') + + def test_negative_nonchunked_read(self): + fd = self.makefile() + data = (b'POST /read HTTP/1.1\r\nHost: localhost\r\nConnection: close\r\n' + b'Content-Length: 6\r\n\r\n' + b'oh hai') + fd.write(data) + read_http(fd, body='oh hai') + + +class TestNegativeReadline(TestCase): + validator = None + + @staticmethod + def application(env, start_response): + start_response('200 OK', [('Content-Type', 'text/plain')]) + if env['PATH_INFO'] == '/readline': + data = env['wsgi.input'].readline(-1) + return [data] + + def test_negative_chunked_readline(self): + fd = self.makefile() + data = (b'POST /readline HTTP/1.1\r\nHost: localhost\r\nConnection: close\r\n' + b'Transfer-Encoding: chunked\r\n\r\n' + b'2\r\noh\r\n4\r\n hai\r\n0\r\n\r\n') + fd.write(data) + read_http(fd, body='oh hai') + + def test_negative_nonchunked_readline(self): + fd = self.makefile() + data = (b'POST /readline HTTP/1.1\r\nHost: localhost\r\nConnection: close\r\n' + b'Content-Length: 6\r\n\r\n' + b'oh hai') + fd.write(data) + read_http(fd, body='oh hai') + + +class TestChunkedPost(TestCase): + + + def application(self, env, start_response): + self.assertTrue(env.get('wsgi.input_terminated')) + start_response('200 OK', [('Content-Type', 'text/plain')]) + if env['PATH_INFO'] == '/a': + data = env['wsgi.input'].read(6) + return [data] + + if env['PATH_INFO'] == '/b': + lines = [x for x in iter(lambda: env['wsgi.input'].read(6), b'')] + return lines + + if env['PATH_INFO'] == '/c': + return [x for x in iter(lambda: env['wsgi.input'].read(1), b'')] + + def test_014_chunked_post(self): + fd = self.makefile() + data = (b'POST /a HTTP/1.1\r\nHost: localhost\r\nConnection: close\r\n' + b'Transfer-Encoding: chunked\r\n\r\n' + b'2\r\noh\r\n4\r\n hai\r\n0\r\n\r\n') + fd.write(data) + read_http(fd, body='oh hai') + # self.close_opened() # XXX: Why? + + fd = self.makefile() + fd.write(data.replace(b'/a', b'/b')) + read_http(fd, body='oh hai') + + fd = self.makefile() + fd.write(data.replace(b'/a', b'/c')) + read_http(fd, body='oh hai') + + def test_229_incorrect_chunk_no_newline(self): + # Giving both a Content-Length and a Transfer-Encoding, + # TE is preferred. But if the chunking is bad from the client, + # missing its terminating newline, + # the server doesn't hang + data = (b'POST /a HTTP/1.1\r\nHost: localhost\r\nConnection: close\r\n' + b'Content-Length: 12\r\n' + b'Transfer-Encoding: chunked\r\n\r\n' + b'{"hi": "ho"}') + fd = self.makefile() + fd.write(data) + read_http(fd, code=400) + + def test_229_incorrect_chunk_non_hex(self): + # Giving both a Content-Length and a Transfer-Encoding, + # TE is preferred. But if the chunking is bad from the client, + # the server doesn't hang + data = (b'POST /a HTTP/1.1\r\nHost: localhost\r\nConnection: close\r\n' + b'Content-Length: 12\r\n' + b'Transfer-Encoding: chunked\r\n\r\n' + b'{"hi": "ho"}\r\n') + fd = self.makefile() + fd.write(data) + read_http(fd, code=400) + + def test_229_correct_chunk_quoted_ext(self): + data = (b'POST /a HTTP/1.1\r\nHost: localhost\r\nConnection: close\r\n' + b'Transfer-Encoding: chunked\r\n\r\n' + b'2;token="oh hi"\r\noh\r\n4\r\n hai\r\n0\r\n\r\n') + fd = self.makefile() + fd.write(data) + read_http(fd, body='oh hai') + + def test_229_correct_chunk_token_ext(self): + data = (b'POST /a HTTP/1.1\r\nHost: localhost\r\nConnection: close\r\n' + b'Transfer-Encoding: chunked\r\n\r\n' + b'2;token=oh_hi\r\noh\r\n4\r\n hai\r\n0\r\n\r\n') + fd = self.makefile() + fd.write(data) + read_http(fd, body='oh hai') + + def test_229_incorrect_chunk_token_ext_too_long(self): + data = (b'POST /a HTTP/1.1\r\nHost: localhost\r\nConnection: close\r\n' + b'Transfer-Encoding: chunked\r\n\r\n' + b'2;token=oh_hi\r\noh\r\n4\r\n hai\r\n0\r\n\r\n') + data = data.replace(b'oh_hi', b'_oh_hi' * 4000) + fd = self.makefile() + fd.write(data) + read_http(fd, code=400) + + +class TestUseWrite(TestCase): + + body = b'abcde' + end = b'end' + content_length = str(len(body + end)) + + def application(self, env, start_response): + if env['PATH_INFO'] == '/explicit-content-length': + write = start_response('200 OK', [('Content-Type', 'text/plain'), + ('Content-Length', self.content_length)]) + write(self.body) + elif env['PATH_INFO'] == '/no-content-length': + write = start_response('200 OK', [('Content-Type', 'text/plain')]) + write(self.body) + elif env['PATH_INFO'] == '/no-content-length-twice': + write = start_response('200 OK', [('Content-Type', 'text/plain')]) + write(self.body) + write(self.body) + else: + raise Exception('Invalid url') + return [self.end] + + def test_explicit_content_length(self): + fd = self.makefile() + fd.write('GET /explicit-content-length HTTP/1.1\r\nHost: localhost\r\nConnection: close\r\n\r\n') + response = read_http(fd, body=self.body + self.end) + response.assertHeader('Content-Length', self.content_length) + response.assertHeader('Transfer-Encoding', False) + + def test_no_content_length(self): + fd = self.makefile() + fd.write('GET /no-content-length HTTP/1.1\r\nHost: localhost\r\nConnection: close\r\n\r\n') + response = read_http(fd, body=self.body + self.end) + if server_implements_chunked: + response.assertHeader('Content-Length', False) + response.assertHeader('Transfer-Encoding', 'chunked') + else: + response.assertHeader('Content-Length', self.content_length) + + def test_no_content_length_twice(self): + fd = self.makefile() + fd.write('GET /no-content-length-twice HTTP/1.1\r\nHost: localhost\r\nConnection: close\r\n\r\n') + response = read_http(fd, body=self.body + self.body + self.end) + if server_implements_chunked: + response.assertHeader('Content-Length', False) + response.assertHeader('Transfer-Encoding', 'chunked') + assert response.chunks == [self.body, self.body, self.end], response.chunks + else: + response.assertHeader('Content-Length', str(5 + 5 + 3)) + + +class HttpsTestCase(TestCase): + + certfile = os.path.join(os.path.dirname(__file__), 'test_server.crt') + keyfile = os.path.join(os.path.dirname(__file__), 'test_server.key') + + def init_server(self, application): + self.server = pywsgi.WSGIServer((self.listen_addr, 0), application, + certfile=self.certfile, keyfile=self.keyfile) + + def urlopen(self, method='GET', post_body=None, **kwargs): # pylint:disable=arguments-differ + import ssl + raw_sock = self.connect() + sock = ssl.wrap_socket(raw_sock) + fd = sock.makefile(bufsize=1) # pylint:disable=unexpected-keyword-arg + fd.write('%s / HTTP/1.1\r\nHost: localhost\r\n' % method) + if post_body is not None: + fd.write('Content-Length: %s\r\n\r\n' % len(post_body)) + fd.write(post_body) + if kwargs.get('body') is None: + kwargs['body'] = post_body + else: + fd.write('\r\n') + fd.flush() + try: + return read_http(fd, **kwargs) + finally: + fd.close() + sock.close() + raw_sock.close() + + def application(self, environ, start_response): + assert environ['wsgi.url_scheme'] == 'https', environ['wsgi.url_scheme'] + start_response('200 OK', [('Content-Type', 'text/plain')]) + return [environ['wsgi.input'].read(10)] + + +import gevent.ssl +HAVE_SSLCONTEXT = getattr(gevent.ssl, 'create_default_context') +if HAVE_SSLCONTEXT: + + class HttpsSslContextTestCase(HttpsTestCase): + def init_server(self, application): + # On 2.7, our certs don't line up with hostname. + # If we just use create_default_context as-is, we get + # `ValueError: check_hostname requires server_hostname`. + # If we set check_hostname to False, we get + # `SSLError: [SSL: PEER_DID_NOT_RETURN_A_CERTIFICATE] peer did not return a certificate` + # (Neither of which happens in Python 3.) But the unverified context + # works both places. See also test___example_servers.py + from gevent.ssl import _create_unverified_context # pylint:disable=no-name-in-module + context = _create_unverified_context() + context.load_cert_chain(certfile=self.certfile, keyfile=self.keyfile) + self.server = pywsgi.WSGIServer((self.listen_addr, 0), + application, ssl_context=context) + +class TestHttps(HttpsTestCase): + + if hasattr(socket, 'ssl'): + + def test_012_ssl_server(self): + result = self.urlopen(method="POST", post_body='abc') + self.assertEqual(result.body, 'abc') + + def test_013_empty_return(self): + result = self.urlopen() + self.assertEqual(result.body, '') + +if HAVE_SSLCONTEXT: + class TestHttpsWithContext(HttpsSslContextTestCase, TestHttps): # pylint:disable=too-many-ancestors + pass + +class TestInternational(TestCase): + validator = None # wsgiref.validate.IteratorWrapper([]) does not have __len__ + + def application(self, environ, start_response): + path_bytes = b'/\xd0\xbf\xd1\x80\xd0\xb8\xd0\xb2\xd0\xb5\xd1\x82' + if PY3: + # Under PY3, the escapes were decoded as latin-1 + path_bytes = path_bytes.decode('latin-1') + + self.assertEqual(environ['PATH_INFO'], path_bytes) + self.assertEqual(environ['QUERY_STRING'], '%D0%B2%D0%BE%D0%BF%D1%80%D0%BE%D1%81=%D0%BE%D1%82%D0%B2%D0%B5%D1%82') + start_response("200 PASSED", [('Content-Type', 'text/plain')]) + return [] + + def test(self): + sock = self.connect() + sock.sendall(b'''GET /%D0%BF%D1%80%D0%B8%D0%B2%D0%B5%D1%82?%D0%B2%D0%BE%D0%BF%D1%80%D0%BE%D1%81=%D0%BE%D1%82%D0%B2%D0%B5%D1%82 HTTP/1.1 +Host: localhost +Connection: close + +'''.replace(b'\n', b'\r\n')) + read_http(sock.makefile(), reason='PASSED', chunks=False, body='', content_length=0) + + +class TestNonLatin1HeaderFromApplication(TestCase): + error_fatal = False # Allow sending the exception response, don't kill the greenlet + + validator = None # Don't validate the application, it's deliberately bad + header = b'\xe1\xbd\x8a3' # bomb in utf-8 bytes + should_error = PY3 # non-native string under Py3 + + def setUp(self): + super(TestNonLatin1HeaderFromApplication, self).setUp() + self.errors = [] + + def tearDown(self): + self.errors = [] + super(TestNonLatin1HeaderFromApplication, self).tearDown() + + def application(self, environ, start_response): + # We return a header that cannot be encoded in latin-1 + try: + start_response("200 PASSED", + [('Content-Type', 'text/plain'), + ('Custom-Header', self.header)]) + except: + self.errors.append(sys.exc_info()[:2]) + raise + return [] + + def test(self): + sock = self.connect() + self.expect_one_error() + sock.sendall(b'''GET / HTTP/1.1\r\n\r\n''') + if self.should_error: + read_http(sock.makefile(), code=500, reason='Internal Server Error') + self.assert_error(where_type=pywsgi.SecureEnviron) + self.assertEqual(len(self.errors), 1) + _, v = self.errors[0] + self.assertIsInstance(v, UnicodeError) + else: + read_http(sock.makefile(), code=200, reason='PASSED') + self.assertEqual(len(self.errors), 0) + + +class TestNonLatin1UnicodeHeaderFromApplication(TestNonLatin1HeaderFromApplication): + # Flip-flop of the superclass: Python 3 native string, Python 2 unicode object + header = u"\u1f4a3" # bomb in unicode + # Error both on py3 and py2. On py2, non-native string. On py3, native string + # that cannot be encoded to latin-1 + should_error = True + + +class TestInputReadline(TestCase): + # this test relies on the fact that readline() returns '' after it reached EOF + # this behaviour is not mandated by WSGI spec, it's just happens that gevent.wsgi behaves like that + # as such, this may change in the future + + validator = None + + def application(self, environ, start_response): + input = environ['wsgi.input'] + lines = [] + while True: + line = input.readline() + if not line: + break + line = line.decode('ascii') if PY3 else line + lines.append(repr(line) + ' ') + start_response('200 hello', []) + return [l.encode('ascii') for l in lines] if PY3 else lines + + def test(self): + fd = self.makefile() + content = 'hello\n\nworld\n123' + fd.write('POST / HTTP/1.1\r\nHost: localhost\r\nConnection: close\r\n' + 'Content-Length: %s\r\n\r\n%s' % (len(content), content)) + fd.flush() + read_http(fd, reason='hello', body="'hello\\n' '\\n' 'world\\n' '123' ") + + +class TestInputIter(TestInputReadline): + + def application(self, environ, start_response): + input = environ['wsgi.input'] + lines = [] + for line in input: + if not line: + break + line = line.decode('ascii') if PY3 else line + lines.append(repr(line) + ' ') + start_response('200 hello', []) + return [l.encode('ascii') for l in lines] if PY3 else lines + + +class TestInputReadlines(TestInputReadline): + + def application(self, environ, start_response): + input = environ['wsgi.input'] + lines = [l.decode('ascii') if PY3 else l for l in input.readlines()] + lines = [repr(line) + ' ' for line in lines] + start_response('200 hello', []) + return [l.encode('ascii') for l in lines] if PY3 else lines + + +class TestInputN(TestCase): + # testing for this: + # File "/home/denis/work/gevent/gevent/pywsgi.py", line 70, in _do_read + # if length and length > self.content_length - self.position: + # TypeError: unsupported operand type(s) for -: 'NoneType' and 'int' + + validator = None + + def application(self, environ, start_response): + environ['wsgi.input'].read(5) + start_response('200 OK', []) + return [] + + def test(self): + self.urlopen() + + +class TestError(TestCase): + + error = object() + error_fatal = False + + def application(self, env, start_response): + self.error = greentest.ExpectedException('TestError.application') + raise self.error + + def test(self): + self.expect_one_error() + self.urlopen(code=500) + self.assert_error(greentest.ExpectedException, self.error) + + +class TestError_after_start_response(TestError): + + def application(self, env, start_response): + self.error = greentest.ExpectedException('TestError_after_start_response.application') + start_response('200 OK', [('Content-Type', 'text/plain')]) + raise self.error + + +class TestEmptyYield(TestCase): + + @staticmethod + def application(env, start_response): + start_response('200 OK', [('Content-Type', 'text/plain')]) + yield b"" + yield b"" + + def test_err(self): + fd = self.connect().makefile(bufsize=1) + fd.write('GET / HTTP/1.1\r\nHost: localhost\r\nConnection: close\r\n\r\n') + + if server_implements_chunked: + chunks = [] + else: + chunks = False + + read_http(fd, body='', chunks=chunks) + + garbage = fd.read() + self.assertEqual(garbage, b"", "got garbage: %r" % garbage) + + +class TestFirstEmptyYield(TestCase): + + @staticmethod + def application(env, start_response): + start_response('200 OK', [('Content-Type', 'text/plain')]) + yield b"" + yield b"hello" + + def test_err(self): + fd = self.connect().makefile(bufsize=1) + fd.write('GET / HTTP/1.1\r\nHost: localhost\r\nConnection: close\r\n\r\n') + + if server_implements_chunked: + chunks = [b'hello'] + else: + chunks = False + + read_http(fd, body='hello', chunks=chunks) + + garbage = fd.read() + self.assertTrue(garbage == b"", "got garbage: %r" % garbage) + + +class TestEmptyYield304(TestCase): + + @staticmethod + def application(env, start_response): + start_response('304 Not modified', []) + yield b"" + yield b"" + + def test_err(self): + fd = self.connect().makefile(bufsize=1) + fd.write('GET / HTTP/1.1\r\nHost: localhost\r\nConnection: close\r\n\r\n') + read_http(fd, code=304, body='', chunks=False) + garbage = fd.read() + self.assertEqual(garbage, b"", "got garbage: %r" % garbage) + + +class TestContentLength304(TestCase): + validator = None + + def application(self, env, start_response): + try: + start_response('304 Not modified', [('Content-Length', '100')]) + except AssertionError as ex: + start_response('200 Raised', []) + return ex.args + else: + raise AssertionError('start_response did not fail but it should') + + def test_err(self): + fd = self.connect().makefile(bufsize=1) + fd.write('GET / HTTP/1.1\r\nHost: localhost\r\nConnection: close\r\n\r\n') + body = "Invalid Content-Length for 304 response: '100' (must be absent or zero)" + read_http(fd, code=200, reason='Raised', body=body, chunks=False) + garbage = fd.read() + self.assertEqual(garbage, b"", "got garbage: %r" % garbage) + + +class TestBody304(TestCase): + validator = None + + def application(self, env, start_response): + start_response('304 Not modified', []) + return [b'body'] + + def test_err(self): + fd = self.connect().makefile(bufsize=1) + fd.write('GET / HTTP/1.1\r\nHost: localhost\r\nConnection: close\r\n\r\n') + try: + read_http(fd) + except AssertionError as ex: + self.assertEqual(str(ex), 'The 304 response must have no body') + else: + raise AssertionError('AssertionError must be raised') + + +class TestWrite304(TestCase): + validator = None + error_raised = None + + def application(self, env, start_response): + write = start_response('304 Not modified', []) + self.error_raised = False + try: + write('body') + except AssertionError: + self.error_raised = True + raise + + def test_err(self): + fd = self.connect().makefile(bufsize=1) + fd.write(b'GET / HTTP/1.1\r\nHost: localhost\r\nConnection: close\r\n\r\n') + with self.assertRaises(AssertionError) as exc: + read_http(fd) + ex = exc.exception + self.assertEqual(str(ex), 'The 304 response must have no body') + self.assertTrue(self.error_raised, 'write() must raise') + + +class TestEmptyWrite(TestEmptyYield): + + @staticmethod + def application(env, start_response): + write = start_response('200 OK', [('Content-Type', 'text/plain')]) + write(b"") + write(b"") + return [] + + +class BadRequestTests(TestCase): + validator = None + # pywsgi checks content-length, but wsgi does not + content_length = None + + def application(self, env, start_response): + self.assertEqual(env['CONTENT_LENGTH'], self.content_length) + start_response('200 OK', [('Content-Type', 'text/plain')]) + return [b'hello'] + + def test_negative_content_length(self): + self.content_length = '-100' + fd = self.connect().makefile(bufsize=1) + fd.write('GET / HTTP/1.1\r\nHost: localhost\r\nContent-Length: %s\r\n\r\n' % self.content_length) + read_http(fd, code=(200, 400)) + + def test_illegal_content_length(self): + self.content_length = 'abc' + fd = self.connect().makefile(bufsize=1) + fd.write('GET / HTTP/1.1\r\nHost: localhost\r\nContent-Length: %s\r\n\r\n' % self.content_length) + read_http(fd, code=(200, 400)) + + +class ChunkedInputTests(TestCase): + dirt = "" + validator = None + + def application(self, env, start_response): + input = env['wsgi.input'] + response = [] + + pi = env["PATH_INFO"] + + if pi == "/short-read": + d = input.read(10) + response = [d] + elif pi == "/lines": + for x in input: + response.append(x) + elif pi == "/ping": + input.read(1) + response.append(b"pong") + else: + raise RuntimeError("bad path") + + start_response('200 OK', [('Content-Type', 'text/plain')]) + return response + + def chunk_encode(self, chunks, dirt=None): + if dirt is None: + dirt = self.dirt + + return chunk_encode(chunks, dirt=dirt) + + def body(self, dirt=None): + return self.chunk_encode(["this", " is ", "chunked", "\nline", " 2", "\n", "line3", ""], dirt=dirt) + + def ping(self, fd): + fd.write("GET /ping HTTP/1.1\r\n\r\n") + read_http(fd, body="pong") + + def ping_if_possible(self, fd): + try: + self.ping(fd) + except ConnectionClosed: + if server_implements_pipeline: + raise + fd = self.connect().makefile(bufsize=1) + self.ping(fd) + + def test_short_read_with_content_length(self): + body = self.body() + req = b"POST /short-read HTTP/1.1\r\ntransfer-encoding: Chunked\r\nContent-Length:1000\r\n\r\n" + body + conn = self.connect() + fd = conn.makefile(bufsize=1) + fd.write(req) + read_http(fd, body="this is ch") + + self.ping_if_possible(fd) + fd.close() + conn.close() + + def test_short_read_with_zero_content_length(self): + body = self.body() + req = b"POST /short-read HTTP/1.1\r\ntransfer-encoding: Chunked\r\nContent-Length:0\r\n\r\n" + body + #print("REQUEST:", repr(req)) + + fd = self.connect().makefile(bufsize=1) + fd.write(req) + read_http(fd, body="this is ch") + + self.ping_if_possible(fd) + + def test_short_read(self): + body = self.body() + req = b"POST /short-read HTTP/1.1\r\ntransfer-encoding: Chunked\r\n\r\n" + body + + fd = self.connect().makefile(bufsize=1) + fd.write(req) + read_http(fd, body="this is ch") + + self.ping_if_possible(fd) + + def test_dirt(self): + body = self.body(dirt="; here is dirt\0bla") + req = b"POST /ping HTTP/1.1\r\ntransfer-encoding: Chunked\r\n\r\n" + body + + fd = self.connect().makefile(bufsize=1) + fd.write(req) + try: + read_http(fd, body="pong") + except AssertionError as ex: + if str(ex).startswith('Unexpected code: 400'): + if not server_implements_chunked: + print('ChunkedNotImplementedWarning') + return + raise + + self.ping_if_possible(fd) + + def test_chunked_readline(self): + body = self.body() + req = "POST /lines HTTP/1.1\r\nContent-Length: %s\r\ntransfer-encoding: Chunked\r\n\r\n" % (len(body)) + req = req.encode('latin-1') + req += body + + fd = self.connect().makefile(bufsize=1) + fd.write(req) + read_http(fd, body='this is chunked\nline 2\nline3') + + def test_close_before_finished(self): + self.expect_one_error() + body = b'4\r\nthi' + req = b"POST /short-read HTTP/1.1\r\ntransfer-encoding: Chunked\r\n\r\n" + body + sock = self.connect() + fd = sock.makefile(bufsize=1, mode='wb') + fd.write(req) + fd.close() + + # Python 3 keeps the socket open even though the only + # makefile is gone; python 2 closed them both (because there were + # no outstanding references to the socket). Closing is essential for the server + # to get the message that the read will fail. It's better to be explicit + # to avoid a ResourceWarning + sock.close() + # Under Py2 it still needs to go away, which was implicit before + del fd + del sock + + gevent.get_hub().loop.update_now() + gevent.sleep(0.01) # timing needed for cpython + + if greentest.PYPY: + # XXX: Something is keeping the socket alive, + # by which I mean, the close event is not propagating to the server + # and waking up its recv() loop...we are stuck with the three bytes of + # 'thi' in the buffer and trying to read the forth. No amount of tinkering + # with the timing changes this...the only thing that does is running a + # GC and letting some object get collected. Might this be a problem in real life? + + import gc + gc.collect() + gevent.sleep(0.01) + gevent.get_hub().loop.update_now() + gc.collect() + gevent.sleep(0.01) + + # XXX2: Sometimes windows and PyPy/Travis fail to get this error, leading to a test failure. + # This would have to be due to the socket being kept around and open, + # not closed at the low levels. I haven't seen this locally. + # In the PyPy case, I've seen the IOError reported on the console, but not + # captured in the variables. + # https://travis-ci.org/gevent/gevent/jobs/329232976#L1374 + self.assert_error(IOError, 'unexpected end of file while parsing chunked data') + + +class Expect100ContinueTests(TestCase): + validator = None + + def application(self, environ, start_response): + content_length = int(environ['CONTENT_LENGTH']) + if content_length > 1024: + start_response('417 Expectation Failed', [('Content-Length', '7'), ('Content-Type', 'text/plain')]) + return [b'failure'] + + # pywsgi did sent a "100 continue" for each read + # see http://code.google.com/p/gevent/issues/detail?id=93 + text = environ['wsgi.input'].read(1) + text += environ['wsgi.input'].read(content_length - 1) + start_response('200 OK', [('Content-Length', str(len(text))), ('Content-Type', 'text/plain')]) + return [text] + + def test_continue(self): + fd = self.connect().makefile(bufsize=1) + + fd.write('PUT / HTTP/1.1\r\nHost: localhost\r\nContent-length: 1025\r\nExpect: 100-continue\r\n\r\n') + try: + read_http(fd, code=417, body="failure") + except AssertionError as ex: + if str(ex).startswith('Unexpected code: 400'): + if not server_implements_100continue: + print('100ContinueNotImplementedWarning') + return + raise + + fd.write('PUT / HTTP/1.1\r\nHost: localhost\r\nContent-length: 7\r\nExpect: 100-continue\r\n\r\ntesting') + read_http(fd, code=100) + read_http(fd, body="testing") + + +class MultipleCookieHeadersTest(TestCase): + + validator = None + + def application(self, environ, start_response): + self.assertEqual(environ['HTTP_COOKIE'], 'name1="value1"; name2="value2"') + self.assertEqual(environ['HTTP_COOKIE2'], 'nameA="valueA"; nameB="valueB"') + start_response('200 OK', []) + return [] + + def test(self): + fd = self.connect().makefile(bufsize=1) + fd.write('''GET / HTTP/1.1 +Host: localhost +Cookie: name1="value1" +Cookie2: nameA="valueA" +Cookie2: nameB="valueB" +Cookie: name2="value2"\n\n'''.replace('\n', '\r\n')) + read_http(fd) + + +class TestLeakInput(TestCase): + + _leak_wsgi_input = None + _leak_environ = None + + def tearDown(self): + TestCase.tearDown(self) + self._leak_wsgi_input = None + self._leak_environ = None + + def application(self, environ, start_response): + pi = environ["PATH_INFO"] + self._leak_wsgi_input = environ["wsgi.input"] + self._leak_environ = environ + if pi == "/leak-frame": + environ["_leak"] = sys._getframe(0) + + text = b"foobar" + start_response('200 OK', [('Content-Length', str(len(text))), ('Content-Type', 'text/plain')]) + return [text] + + def test_connection_close_leak_simple(self): + fd = self.connect().makefile(bufsize=1) + fd.write(b"GET / HTTP/1.0\r\nConnection: close\r\n\r\n") + d = fd.read() + self.assertTrue(d.startswith(b"HTTP/1.1 200 OK"), d) + + def test_connection_close_leak_frame(self): + fd = self.connect().makefile(bufsize=1) + fd.write(b"GET /leak-frame HTTP/1.0\r\nConnection: close\r\n\r\n") + d = fd.read() + self.assertTrue(d.startswith(b"HTTP/1.1 200 OK"), d) + self._leak_environ.pop('_leak') + +class TestHTTPResponseSplitting(TestCase): + # The validator would prevent the app from doing the + # bad things it needs to do + validator = None + + status = '200 OK' + headers = () + start_exc = None + + def setUp(self): + TestCase.setUp(self) + self.start_exc = None + self.status = TestHTTPResponseSplitting.status + self.headers = TestHTTPResponseSplitting.headers + + def tearDown(self): + TestCase.tearDown(self) + self.start_exc = None + + def application(self, environ, start_response): + try: + start_response(self.status, self.headers) + except Exception as e: # pylint: disable=broad-except + self.start_exc = e + else: + self.start_exc = None + return () + + def _assert_failure(self, message): + fd = self.makefile() + fd.write('GET / HTTP/1.0\r\nHost: localhost\r\n\r\n') + fd.read() + self.assertIsInstance(self.start_exc, ValueError) + self.assertEqual(self.start_exc.args[0], message) + + def test_newline_in_status(self): + self.status = '200 OK\r\nConnection: close\r\nContent-Length: 0\r\n\r\n' + self._assert_failure('carriage return or newline in status') + + def test_newline_in_header_value(self): + self.headers = [('Test', 'Hi\r\nConnection: close')] + self._assert_failure('carriage return or newline in header value') + + def test_newline_in_header_name(self): + self.headers = [('Test\r\n', 'Hi')] + self._assert_failure('carriage return or newline in header name') + + +class TestInvalidEnviron(TestCase): + validator = None + # check that WSGIServer does not insert any default values for CONTENT_LENGTH + + def application(self, environ, start_response): + for key, value in environ.items(): + if key in ('CONTENT_LENGTH', 'CONTENT_TYPE') or key.startswith('HTTP_'): + if key != 'HTTP_HOST': + raise AssertionError('Unexpected environment variable: %s=%r' % (key, value)) + start_response('200 OK', []) + return [] + + def test(self): + fd = self.makefile() + fd.write('GET / HTTP/1.0\r\nHost: localhost\r\n\r\n') + read_http(fd) + fd = self.makefile() + fd.write('GET / HTTP/1.1\r\nHost: localhost\r\n\r\n') + read_http(fd) + + +class TestInvalidHeadersDropped(TestCase): + validator = None + # check that invalid headers with a _ are dropped + + def application(self, environ, start_response): + self.assertNotIn('HTTP_X_AUTH_USER', environ) + start_response('200 OK', []) + return [] + + def test(self): + fd = self.makefile() + fd.write('GET / HTTP/1.0\r\nx-auth_user: bob\r\n\r\n') + read_http(fd) + + +class Handler(pywsgi.WSGIHandler): + + def read_requestline(self): + data = self.rfile.read(7) + if data[0] == b'<'[0]: + # Returning nothing stops handle_one_request() + # Note that closing or even deleting self.socket() here + # can lead to the read side throwing Connection Reset By Peer, + # depending on the Python version and OS + data += self.rfile.read(15) + if data.lower() == b'': + self.socket.sendall(b'HELLO') + else: + self.log_error('Invalid request: %r', data) + return None + else: + return data + self.rfile.readline() + + +class TestHandlerSubclass(TestCase): + + validator = None + + def application(self, environ, start_response): + start_response('200 OK', []) + return [] + + def init_server(self, application): + self.server = pywsgi.WSGIServer((self.listen_addr, 0), + application, + handler_class=Handler) + + def test(self): + fd = self.makefile() + fd.write(b'\x00') + fd.flush() # flush() is needed on PyPy, apparently it buffers slightly differently + self.assertEqual(fd.read(), b'HELLO') + + fd = self.makefile() + fd.write('GET / HTTP/1.1\r\nHost: localhost\r\nConnection: close\r\n\r\n') + fd.flush() + read_http(fd) + + fd = self.makefile() + # Trigger an error + fd.write('\x00') + fd.flush() + self.assertEqual(fd.read(), b'') + + +class TestErrorAfterChunk(TestCase): + validator = None + + @staticmethod + def application(env, start_response): + start_response('200 OK', [('Content-Type', 'text/plain')]) + yield b"hello" + raise greentest.ExpectedException('TestErrorAfterChunk') + + def test(self): + fd = self.connect().makefile(bufsize=1) + self.expect_one_error() + fd.write('GET / HTTP/1.1\r\nHost: localhost\r\nConnection: keep-alive\r\n\r\n') + self.assertRaises(ValueError, read_http, fd) + self.assert_error(greentest.ExpectedException) + + +def chunk_encode(chunks, dirt=None): + if dirt is None: + dirt = "" + + b = b"" + for c in chunks: + x = "%x%s\r\n%s\r\n" % (len(c), dirt, c) + b += x.encode('ascii') + return b + + +class TestInputRaw(greentest.BaseTestCase): + def make_input(self, data, content_length=None, chunked_input=False): + if isinstance(data, list): + data = chunk_encode(data) + chunked_input = True + elif isinstance(data, str) and PY3: + data = data.encode("ascii") + return Input(StringIO(data), content_length=content_length, chunked_input=chunked_input) + + if PY3: + def assertEqual(self, data, expected, *args): # pylint:disable=arguments-differ + if isinstance(expected, str): + expected = expected.encode('ascii') + super(TestInputRaw, self).assertEqual(data, expected, *args) + + def test_short_post(self): + i = self.make_input("1", content_length=2) + self.assertRaises(IOError, i.read) + + def test_short_post_read_with_length(self): + i = self.make_input("1", content_length=2) + self.assertRaises(IOError, i.read, 2) + + def test_short_post_readline(self): + i = self.make_input("1", content_length=2) + self.assertRaises(IOError, i.readline) + + def test_post(self): + i = self.make_input("12", content_length=2) + data = i.read() + self.assertEqual(data, "12") + + def test_post_read_with_length(self): + i = self.make_input("12", content_length=2) + data = i.read(10) + self.assertEqual(data, "12") + + def test_chunked(self): + i = self.make_input(["1", "2", ""]) + data = i.read() + self.assertEqual(data, "12") + + def test_chunked_read_with_length(self): + i = self.make_input(["1", "2", ""]) + data = i.read(10) + self.assertEqual(data, "12") + + def test_chunked_missing_chunk(self): + i = self.make_input(["1", "2"]) + self.assertRaises(IOError, i.read) + + def test_chunked_missing_chunk_read_with_length(self): + i = self.make_input(["1", "2"]) + self.assertRaises(IOError, i.read, 10) + + def test_chunked_missing_chunk_readline(self): + i = self.make_input(["1", "2"]) + self.assertRaises(IOError, i.readline) + + def test_chunked_short_chunk(self): + i = self.make_input("2\r\n1", chunked_input=True) + self.assertRaises(IOError, i.read) + + def test_chunked_short_chunk_read_with_length(self): + i = self.make_input("2\r\n1", chunked_input=True) + self.assertRaises(IOError, i.read, 2) + + def test_chunked_short_chunk_readline(self): + i = self.make_input("2\r\n1", chunked_input=True) + self.assertRaises(IOError, i.readline) + + def test_32bit_overflow(self): + # https://github.com/gevent/gevent/issues/289 + # Should not raise an OverflowError on Python 2 + print("BEGIN 32bit") + data = b'asdf\nghij\n' + long_data = b'a' * (pywsgi.MAX_REQUEST_LINE + 10) + long_data += b'\n' + data = data + long_data + partial_data = b'qjk\n' # Note terminating \n + n = 25 * 1000000000 + print("N", n, "Data len", len(data)) + if hasattr(n, 'bit_length'): + self.assertEqual(n.bit_length(), 35) + if not PY3 and not PYPY: + # Make sure we have the impl we think we do + self.assertRaises(OverflowError, StringIO(data).readline, n) + + i = self.make_input(data, content_length=n) + # No size hint, but we have too large a content_length to fit + self.assertEqual(i.readline(), b'asdf\n') + # Large size hint + self.assertEqual(i.readline(n), b'ghij\n') + self.assertEqual(i.readline(n), long_data) + + # Now again with the real content length, assuring we can't read past it + i = self.make_input(data + partial_data, content_length=len(data) + 1) + self.assertEqual(i.readline(), b'asdf\n') + self.assertEqual(i.readline(n), b'ghij\n') + self.assertEqual(i.readline(n), long_data) + # Now we've reached content_length so we shouldn't be able to + # read anymore except the one byte remaining + self.assertEqual(i.readline(n), b'q') + + +class Test414(TestCase): + + @staticmethod + def application(env, start_response): + raise AssertionError('should not get there') + + def test(self): + fd = self.makefile() + longline = 'x' * 20000 + fd.write(('''GET /%s HTTP/1.0\r\nHello: world\r\n\r\n''' % longline).encode('latin-1')) + read_http(fd, code=414) + + +class TestLogging(TestCase): + + # Something that gets wrapped in a LoggingLogAdapter + class Logger(object): + accessed = None + logged = None + thing = None + + def log(self, level, msg): + self.logged = (level, msg) + + def access(self, msg): + self.accessed = msg + + def get_thing(self): + return self.thing + + def init_logger(self): + return self.Logger() + + @staticmethod + def application(env, start_response): + start_response('200 OK', [('Content-Type', 'text/plain')]) + return [b'hello'] + + # Tests for issue #663 + + def test_proxy_methods_on_log(self): + # An object that looks like a logger gets wrapped + # with a proxy that + self.assertTrue(isinstance(self.server.log, pywsgi.LoggingLogAdapter)) + self.server.log.access("access") + self.server.log.write("write") + self.assertEqual(self.server.log.accessed, "access") + self.assertEqual(self.server.log.logged, (20, "write")) + + def test_set_attributes(self): + # Not defined by the wrapper, it goes to the logger + self.server.log.thing = 42 + self.assertEqual(self.server.log.get_thing(), 42) + + del self.server.log.thing + self.assertEqual(self.server.log.get_thing(), None) + + def test_status_log(self): + # Issue 664: Make sure we format the status line as a string + self.urlopen() + msg = self.server.log.logged[1] + self.assertTrue('"GET / HTTP/1.1" 200 ' in msg, msg) + + # Issue 756: Make sure we don't throw a newline on the end + self.assertTrue('\n' not in msg, msg) + +class TestEnviron(TestCase): + + # The wsgiref validator asserts type(environ) is dict. + # https://mail.python.org/pipermail/web-sig/2016-March/005455.html + validator = None + + def init_server(self, application): + super(TestEnviron, self).init_server(application) + self.server.environ_class = pywsgi.SecureEnviron + + def application(self, env, start_response): + self.assertIsInstance(env, pywsgi.SecureEnviron) + start_response('200 OK', [('Content-Type', 'text/plain')]) + return [] + + def test_environ_is_secure_by_default(self): + self.urlopen() + + def test_default_secure_repr(self): + environ = pywsgi.SecureEnviron() + self.assertIn('"}), str(environ)) + self.assertEqual(repr({'key': ""}), repr(environ)) + + environ.whitelist_keys = ('key',) + self.assertEqual(str({'key': 'value'}), str(environ)) + self.assertEqual(repr({'key': 'value'}), repr(environ)) + + del environ.whitelist_keys + + def test_override_class_defaults(self): + class EnvironClass(pywsgi.SecureEnviron): + __slots__ = () + + environ = EnvironClass() + + self.assertTrue(environ.secure_repr) + EnvironClass.default_secure_repr = False + self.assertFalse(environ.secure_repr) + + self.assertEqual(str({}), str(environ)) + self.assertEqual(repr({}), repr(environ)) + + EnvironClass.default_secure_repr = True + EnvironClass.default_whitelist_keys = ('key',) + + environ['key'] = 1 + self.assertEqual(str({'key': 1}), str(environ)) + self.assertEqual(repr({'key': 1}), repr(environ)) + + # Clean up for leaktests + del environ + del EnvironClass + import gc; gc.collect() + + + def test_copy_still_secure(self): + for cls in (pywsgi.Environ, pywsgi.SecureEnviron): + self.assertIsInstance(cls().copy(), cls) + + def test_pickle_copy_returns_dict(self): + # Anything going through copy.copy/pickle should + # return the same pickle that a dict would. + import pickle + import json + + for cls in (pywsgi.Environ, pywsgi.SecureEnviron): + bltin = {'key': 'value'} + env = cls(bltin) + self.assertIsInstance(env, cls) + self.assertEqual(bltin, env) + self.assertEqual(env, bltin) + + for protocol in range(0, pickle.HIGHEST_PROTOCOL + 1): + # It's impossible to get a subclass of dict to pickle + # identically, but it can restore identically + env_dump = pickle.dumps(env, protocol) + self.assertNotIn(b'Environ', env_dump) + loaded = pickle.loads(env_dump) + self.assertEqual(type(loaded), dict) + + self.assertEqual(json.dumps(bltin), json.dumps(env)) + +del CommonTests + +if __name__ == '__main__': + greentest.main() diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__queue.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__queue.py new file mode 100644 index 00000000..03c846fc --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__queue.py @@ -0,0 +1,465 @@ +import unittest + +import gevent.testing as greentest +from gevent.testing import TestCase, main +import gevent +from gevent.hub import get_hub, LoopExit +from gevent import util +from gevent import queue +from gevent.queue import Empty, Full +from gevent.event import AsyncResult +from gevent.testing.timing import AbstractGenericGetTestCase + +# pylint:disable=too-many-ancestors + +class TestQueue(TestCase): + + def test_send_first(self): + self.switch_expected = False + q = queue.Queue() + q.put('hi') + self.assertEqual(q.peek(), 'hi') + self.assertEqual(q.get(), 'hi') + + def test_peek_empty(self): + q = queue.Queue() + # No putters waiting, in the main loop: LoopExit + self.assertRaises(LoopExit, q.peek) + + def waiter(q): + self.assertRaises(Empty, q.peek, timeout=0.01) + g = gevent.spawn(waiter, q) + gevent.sleep(0.1) + g.join() + + def test_peek_multi_greenlet(self): + q = queue.Queue() + g = gevent.spawn(q.peek) + g.start() + gevent.sleep(0) + q.put(1) + g.join() + self.assertTrue(g.exception is None) + self.assertEqual(q.peek(), 1) + + def test_send_last(self): + q = queue.Queue() + + def waiter(q): + with gevent.Timeout(0.1 if not greentest.RUNNING_ON_APPVEYOR else 0.5): + self.assertEqual(q.get(), 'hi2') + return "OK" + + p = gevent.spawn(waiter, q) + gevent.sleep(0.01) + q.put('hi2') + gevent.sleep(0.01) + assert p.get(timeout=0) == "OK" + + def test_max_size(self): + q = queue.Queue(2) + results = [] + + def putter(q): + q.put('a') + results.append('a') + q.put('b') + results.append('b') + q.put('c') + results.append('c') + return "OK" + + p = gevent.spawn(putter, q) + gevent.sleep(0) + self.assertEqual(results, ['a', 'b']) + self.assertEqual(q.get(), 'a') + gevent.sleep(0) + self.assertEqual(results, ['a', 'b', 'c']) + self.assertEqual(q.get(), 'b') + self.assertEqual(q.get(), 'c') + assert p.get(timeout=0) == "OK" + + def test_zero_max_size(self): + q = queue.Channel() + + def sender(evt, q): + q.put('hi') + evt.set('done') + + def receiver(evt, q): + x = q.get() + evt.set(x) + + e1 = AsyncResult() + e2 = AsyncResult() + + p1 = gevent.spawn(sender, e1, q) + gevent.sleep(0.001) + self.assertTrue(not e1.ready()) + p2 = gevent.spawn(receiver, e2, q) + self.assertEqual(e2.get(), 'hi') + self.assertEqual(e1.get(), 'done') + with gevent.Timeout(0): + gevent.joinall([p1, p2]) + + def test_multiple_waiters(self): + # tests that multiple waiters get their results back + q = queue.Queue() + + def waiter(q, evt): + evt.set(q.get()) + + sendings = ['1', '2', '3', '4'] + evts = [AsyncResult() for x in sendings] + for i, _ in enumerate(sendings): + gevent.spawn(waiter, q, evts[i]) # XXX use waitall for them + + gevent.sleep(0.01) # get 'em all waiting + + results = set() + + def collect_pending_results(): + for e in evts: + with gevent.Timeout(0.001, False): + x = e.get() + results.add(x) + return len(results) + + q.put(sendings[0]) + self.assertEqual(collect_pending_results(), 1) + q.put(sendings[1]) + self.assertEqual(collect_pending_results(), 2) + q.put(sendings[2]) + q.put(sendings[3]) + self.assertEqual(collect_pending_results(), 4) + + def test_waiters_that_cancel(self): + q = queue.Queue() + + def do_receive(q, evt): + with gevent.Timeout(0, RuntimeError()): + try: + result = q.get() + evt.set(result) # pragma: no cover (should have raised) + except RuntimeError: + evt.set('timed out') + + evt = AsyncResult() + gevent.spawn(do_receive, q, evt) + self.assertEqual(evt.get(), 'timed out') + + q.put('hi') + self.assertEqual(q.get(), 'hi') + + def test_senders_that_die(self): + q = queue.Queue() + + def do_send(q): + q.put('sent') + + gevent.spawn(do_send, q) + self.assertEqual(q.get(), 'sent') + + def test_two_waiters_one_dies(self): + + def waiter(q, evt): + evt.set(q.get()) + + def do_receive(q, evt): + with gevent.Timeout(0, RuntimeError()): + try: + result = q.get() + evt.set(result) # pragma: no cover (should have raised) + except RuntimeError: + evt.set('timed out') + + q = queue.Queue() + dying_evt = AsyncResult() + waiting_evt = AsyncResult() + gevent.spawn(do_receive, q, dying_evt) + gevent.spawn(waiter, q, waiting_evt) + gevent.sleep(0.1) + q.put('hi') + self.assertEqual(dying_evt.get(), 'timed out') + self.assertEqual(waiting_evt.get(), 'hi') + + def test_two_bogus_waiters(self): + def do_receive(q, evt): + with gevent.Timeout(0, RuntimeError()): + try: + result = q.get() + evt.set(result) # pragma: no cover (should have raised) + except RuntimeError: + evt.set('timed out') + + q = queue.Queue() + e1 = AsyncResult() + e2 = AsyncResult() + gevent.spawn(do_receive, q, e1) + gevent.spawn(do_receive, q, e2) + gevent.sleep(0.1) + q.put('sent') + self.assertEqual(e1.get(), 'timed out') + self.assertEqual(e2.get(), 'timed out') + self.assertEqual(q.get(), 'sent') + + +class TestChannel(TestCase): + + def test_send(self): + channel = queue.Channel() + + events = [] + + def another_greenlet(): + events.append(channel.get()) + events.append(channel.get()) + + g = gevent.spawn(another_greenlet) + + events.append('sending') + channel.put('hello') + events.append('sent hello') + channel.put('world') + events.append('sent world') + + self.assertEqual(['sending', 'hello', 'sent hello', 'world', 'sent world'], events) + g.get() + + def test_wait(self): + channel = queue.Channel() + events = [] + + def another_greenlet(): + events.append('sending hello') + channel.put('hello') + events.append('sending world') + channel.put('world') + events.append('sent world') + + g = gevent.spawn(another_greenlet) + + events.append('waiting') + events.append(channel.get()) + events.append(channel.get()) + + self.assertEqual(['waiting', 'sending hello', 'hello', 'sending world', 'world'], events) + gevent.sleep(0) + self.assertEqual(['waiting', 'sending hello', 'hello', 'sending world', 'world', 'sent world'], events) + g.get() + + def test_iterable(self): + channel = queue.Channel() + gevent.spawn(channel.put, StopIteration) + r = list(channel) + self.assertEqual(r, []) + +class TestJoinableQueue(TestCase): + + def test_task_done(self): + channel = queue.JoinableQueue() + X = object() + gevent.spawn(channel.put, X) + result = channel.get() + self.assertIs(result, X) + self.assertEqual(1, channel.unfinished_tasks) + channel.task_done() + self.assertEqual(0, channel.unfinished_tasks) + + +class TestNoWait(TestCase): + + def test_put_nowait_simple(self): + result = [] + q = queue.Queue(1) + + def store_result(func, *args): + result.append(func(*args)) + + run_callback = get_hub().loop.run_callback + + run_callback(store_result, util.wrap_errors(Full, q.put_nowait), 2) + run_callback(store_result, util.wrap_errors(Full, q.put_nowait), 3) + gevent.sleep(0) + assert len(result) == 2, result + assert result[0] is None, result + assert isinstance(result[1], queue.Full), result + + def test_get_nowait_simple(self): + result = [] + q = queue.Queue(1) + q.put(4) + + def store_result(func, *args): + result.append(func(*args)) + + run_callback = get_hub().loop.run_callback + + run_callback(store_result, util.wrap_errors(Empty, q.get_nowait)) + run_callback(store_result, util.wrap_errors(Empty, q.get_nowait)) + gevent.sleep(0) + assert len(result) == 2, result + assert result[0] == 4, result + assert isinstance(result[1], queue.Empty), result + + # get_nowait must work from the mainloop + def test_get_nowait_unlock(self): + result = [] + q = queue.Queue(1) + p = gevent.spawn(q.put, 5) + + def store_result(func, *args): + result.append(func(*args)) + + assert q.empty(), q + gevent.sleep(0) + assert q.full(), q + get_hub().loop.run_callback(store_result, q.get_nowait) + gevent.sleep(0) + assert q.empty(), q + assert result == [5], result + assert p.ready(), p + assert p.dead, p + assert q.empty(), q + + def test_get_nowait_unlock_channel(self): + result = [] + q = queue.Channel() + p = gevent.spawn(q.put, 5) + + def store_result(func, *args): + result.append(func(*args)) + + assert q.empty(), q + assert q.full(), q + gevent.sleep(0.001) + assert q.empty(), q + assert q.full(), q + get_hub().loop.run_callback(store_result, q.get_nowait) + gevent.sleep(0.001) + assert q.empty(), q + assert q.full(), q + assert result == [5], result + assert p.ready(), p + assert p.dead, p + assert q.empty(), q + + # put_nowait must work from the mainloop + def test_put_nowait_unlock(self): + result = [] + q = queue.Queue() + p = gevent.spawn(q.get) + + def store_result(func, *args): + result.append(func(*args)) + + self.assertTrue(q.empty(), q) + self.assertFalse(q.full(), q) + gevent.sleep(0.001) + + self.assertTrue(q.empty(), q) + self.assertFalse(q.full(), q) + + get_hub().loop.run_callback(store_result, q.put_nowait, 10) + + self.assertFalse(p.ready(), p) + gevent.sleep(0.001) + + self.assertEqual(result, [None]) + self.assertTrue(p.ready(), p) + self.assertFalse(q.full(), q) + self.assertTrue(q.empty(), q) + + +class TestJoinEmpty(TestCase): + + def test_issue_45(self): + """Test that join() exits immediately if not jobs were put into the queue""" + self.switch_expected = False + q = queue.JoinableQueue() + q.join() + +class AbstractTestWeakRefMixin(object): + + def test_weak_reference(self): + import weakref + one = self._makeOne() + ref = weakref.ref(one) + self.assertIs(one, ref()) + + +class TestGetInterrupt(AbstractTestWeakRefMixin, AbstractGenericGetTestCase): + + Timeout = Empty + + kind = queue.Queue + + def wait(self, timeout): + return self._makeOne().get(timeout=timeout) + + def _makeOne(self): + return self.kind() + +class TestGetInterruptJoinableQueue(TestGetInterrupt): + kind = queue.JoinableQueue + +class TestGetInterruptLifoQueue(TestGetInterrupt): + kind = queue.LifoQueue + +class TestGetInterruptPriorityQueue(TestGetInterrupt): + kind = queue.PriorityQueue + +class TestGetInterruptChannel(TestGetInterrupt): + kind = queue.Channel + + +class TestPutInterrupt(AbstractGenericGetTestCase): + kind = queue.Queue + Timeout = Full + + def setUp(self): + super(TestPutInterrupt, self).setUp() + self.queue = self._makeOne() + + def wait(self, timeout): + while not self.queue.full(): + self.queue.put(1) + return self.queue.put(2, timeout=timeout) + + def _makeOne(self): + return self.kind(1) + + +class TestPutInterruptJoinableQueue(TestPutInterrupt): + kind = queue.JoinableQueue + +class TestPutInterruptLifoQueue(TestPutInterrupt): + kind = queue.LifoQueue + +class TestPutInterruptPriorityQueue(TestPutInterrupt): + kind = queue.PriorityQueue + +class TestPutInterruptChannel(TestPutInterrupt): + kind = queue.Channel + + def _makeOne(self): + return self.kind() + + +if hasattr(queue, 'SimpleQueue'): + + class TestGetInterruptSimpleQueue(TestGetInterrupt): + kind = queue.SimpleQueue + + def test_raises_timeout_Timeout(self): + raise unittest.SkipTest("Not supported") + + test_raises_timeout_Timeout_exc_customized = test_raises_timeout_Timeout + test_outer_timeout_is_not_lost = test_raises_timeout_Timeout + + +del AbstractGenericGetTestCase + + +if __name__ == '__main__': + main() diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__real_greenlet.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__real_greenlet.py new file mode 100644 index 00000000..9a9e5b42 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__real_greenlet.py @@ -0,0 +1,29 @@ +"""Testing that greenlet restores sys.exc_info. + +Passes with CPython + greenlet 0.4.0 + +Fails with PyPy 2.2.1 +""" +from __future__ import print_function +import sys +import greenlet + + +print('Your greenlet version: %s' % (getattr(greenlet, '__version__', None), )) + + +result = [] + + +def func(): + result.append(repr(sys.exc_info())) + + +g = greenlet.greenlet(func) +try: + 1 / 0 +except ZeroDivisionError: + g.switch() + + +assert result == ['(None, None, None)'], result diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__refcount.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__refcount.py new file mode 100644 index 00000000..e17013d6 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__refcount.py @@ -0,0 +1,162 @@ +# Copyright (c) 2008 AG Projects +# Author: Denis Bilenko +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. + +"""This test checks that underlying socket instances (gevent.socket.socket._sock) +are not leaked by the hub. +""" +from __future__ import print_function +from _socket import socket as c_socket +import sys +if sys.version_info[0] >= 3: + # Python3 enforces that __weakref__ appears only once, + # and not when a slotted class inherits from an unslotted class. + # We mess around with the class MRO below and violate that rule + # (because socket.socket defines __slots__ with __weakref__), + # so import socket.socket before that can happen. + __import__('socket') + Socket = c_socket +else: + class Socket(c_socket): + "Something we can have a weakref to" + +import _socket +_socket.socket = Socket + +import gevent.testing as greentest +from gevent import monkey; monkey.patch_all() +from gevent.testing import flaky + +from pprint import pformat +try: + from thread import start_new_thread +except ImportError: + from _thread import start_new_thread +from time import sleep +import weakref +import gc + +import socket +socket._realsocket = Socket + +SOCKET_TIMEOUT = 0.1 +if greentest.RUNNING_ON_CI: + SOCKET_TIMEOUT *= 2 + +def init_server(): + s = socket.socket() + s.settimeout(SOCKET_TIMEOUT) + s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) + s.bind(('127.0.0.1', 0)) + s.listen(5) + return s + + +def handle_request(s, raise_on_timeout): + try: + conn, _ = s.accept() + except socket.timeout: + if raise_on_timeout: + raise + else: + return + #print('handle_request - accepted') + res = conn.recv(100) + assert res == b'hello', repr(res) + #print('handle_request - recvd %r' % res) + res = conn.send(b'bye') + #print('handle_request - sent %r' % res) + #print('handle_request - conn refcount: %s' % sys.getrefcount(conn)) + conn.close() + + +def make_request(port): + #print('make_request') + s = socket.socket() + s.connect(('127.0.0.1', port)) + #print('make_request - connected') + res = s.send(b'hello') + #print('make_request - sent %s' % res) + res = s.recv(100) + assert res == b'bye', repr(res) + #print('make_request - recvd %r' % res) + s.close() + + +def run_interaction(run_client): + s = init_server() + start_new_thread(handle_request, (s, run_client)) + if run_client: + port = s.getsockname()[1] + start_new_thread(make_request, (port, )) + sleep(0.1 + SOCKET_TIMEOUT) + #print(sys.getrefcount(s._sock)) + #s.close() + w = weakref.ref(s._sock) + s.close() + if greentest.WIN: + # The background thread may not have even had a chance to run + # yet, sleep again to be sure it does. Otherwise there could be + # strong refs to the socket still around. + try: + sleep(0.1 + SOCKET_TIMEOUT) + except Exception: # pylint:disable=broad-except + pass + + return w + + +def run_and_check(run_client): + w = run_interaction(run_client=run_client) + if greentest.PYPY: + # PyPy doesn't use a strict ref counting and must + # run a gc, but the object should be gone + gc.collect() + if w(): + print(pformat(gc.get_referrers(w()))) + for x in gc.get_referrers(w()): + print(pformat(x)) + for y in gc.get_referrers(x): + print('-', pformat(y)) + raise AssertionError('server should be dead by now') + + +@greentest.skipOnCI("Often fail with timeouts or force closed connections; not sure why.") +@greentest.skipIf( + greentest.RUN_LEAKCHECKS and greentest.PY3, + "Often fail with force closed connections; not sure why. " +) +class Test(greentest.TestCase): + + __timeout__ = greentest.LARGE_TIMEOUT + + @flaky.reraises_flaky_timeout(socket.timeout) + def test_clean_exit(self): + run_and_check(True) + run_and_check(True) + + @flaky.reraises_flaky_timeout(socket.timeout) + def test_timeout_exit(self): + run_and_check(False) + run_and_check(False) + + +if __name__ == '__main__': + greentest.main() diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__refcount_core.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__refcount_core.py new file mode 100644 index 00000000..edf8f406 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__refcount_core.py @@ -0,0 +1,24 @@ +import weakref + + +class Dummy: + def __init__(self): + __import__('gevent.core') + +try: + assert weakref.ref(Dummy())() is None + + from gevent import socket + s = socket.socket() + r = weakref.ref(s) + s.close() + del s + assert r() is None +except AssertionError: # pragma: no cover + import sys + if hasattr(sys, 'pypy_version_info'): + # PyPy uses a non refcounted GC which may defer + # the collection of the weakref, unlike CPython + pass + else: + raise diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__select.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__select.py new file mode 100644 index 00000000..d2110238 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__select.py @@ -0,0 +1,114 @@ +from gevent.testing import six +import sys +import os +import errno +from gevent import select, socket +import gevent.core +import gevent.testing as greentest +import gevent.testing.timing +import unittest + + +class TestSelect(gevent.testing.timing.AbstractGenericWaitTestCase): + + def wait(self, timeout): + select.select([], [], [], timeout) + + + +@greentest.skipOnWindows("Cant select on files") +class TestSelectRead(gevent.testing.timing.AbstractGenericWaitTestCase): + + def wait(self, timeout): + r, w = os.pipe() + try: + select.select([r], [], [], timeout) + finally: + os.close(r) + os.close(w) + + # Issue #12367: http://www.freebsd.org/cgi/query-pr.cgi?pr=kern/155606 + @unittest.skipIf(sys.platform.startswith('freebsd'), + 'skip because of a FreeBSD bug: kern/155606') + def test_errno(self): + # Backported from test_select.py in 3.4 + with open(__file__, 'rb') as fp: + fd = fp.fileno() + fp.close() + try: + select.select([fd], [], [], 0) + except OSError as err: + # Python 3 + self.assertEqual(err.errno, errno.EBADF) + except select.error as err: # pylint:disable=duplicate-except + # Python 2 (select.error is OSError on py3) + self.assertEqual(err.args[0], errno.EBADF) + else: + self.fail("exception not raised") + + +@unittest.skipUnless(hasattr(select, 'poll'), "Needs poll") +@greentest.skipOnWindows("Cant poll on files") +class TestPollRead(gevent.testing.timing.AbstractGenericWaitTestCase): + def wait(self, timeout): + # On darwin, the read pipe is reported as writable + # immediately, for some reason. So we carefully register + # it only for read events (the default is read and write) + r, w = os.pipe() + try: + poll = select.poll() + poll.register(r, select.POLLIN) + poll.poll(timeout * 1000) + finally: + poll.unregister(r) + os.close(r) + os.close(w) + + def test_unregister_never_registered(self): + # "Attempting to remove a file descriptor that was + # never registered causes a KeyError exception to be + # raised." + poll = select.poll() + self.assertRaises(KeyError, poll.unregister, 5) + + @unittest.skipIf(hasattr(gevent.core, 'libuv'), + "Depending on whether the fileno is reused or not this either crashes or does nothing." + "libuv won't open a watcher for a closed file on linux.") + def test_poll_invalid(self): + with open(__file__, 'rb') as fp: + fd = fp.fileno() + + poll = select.poll() + poll.register(fd, select.POLLIN) + # Close after registering; libuv refuses to even + # create a watcher if it would get EBADF (so this turns into + # a test of whether or not we successfully initted the watcher). + fp.close() + result = poll.poll(0) + self.assertEqual(result, [(fd, select.POLLNVAL)]) # pylint:disable=no-member + +class TestSelectTypes(greentest.TestCase): + + def test_int(self): + sock = socket.socket() + try: + select.select([int(sock.fileno())], [], [], 0.001) + finally: + sock.close() + + if hasattr(six.builtins, 'long'): + def test_long(self): + sock = socket.socket() + try: + select.select( + [six.builtins.long(sock.fileno())], [], [], 0.001) + finally: + sock.close() + + def test_string(self): + self.switch_expected = False + self.assertRaises(TypeError, select.select, ['hello'], [], [], 0.001) + + +if __name__ == '__main__': + greentest.main() diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__semaphore.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__semaphore.py new file mode 100644 index 00000000..83c8f94b --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__semaphore.py @@ -0,0 +1,91 @@ +import gevent.testing as greentest +import gevent +from gevent.lock import Semaphore +from gevent.thread import allocate_lock +import weakref +try: + from _thread import allocate_lock as std_allocate_lock +except ImportError: # Py2 + from thread import allocate_lock as std_allocate_lock + +# pylint:disable=broad-except + +class TestSemaphore(greentest.TestCase): + + # issue 39 + def test_acquire_returns_false_after_timeout(self): + s = Semaphore(value=0) + result = s.acquire(timeout=0.01) + assert result is False, repr(result) + + def test_release_twice(self): + s = Semaphore() + result = [] + s.rawlink(lambda s: result.append('a')) + s.release() + s.rawlink(lambda s: result.append('b')) + s.release() + gevent.sleep(0.001) + # The order, though, is not guaranteed. + self.assertEqual(sorted(result), ['a', 'b']) + + def test_semaphore_weakref(self): + s = Semaphore() + r = weakref.ref(s) + self.assertEqual(s, r()) + + def test_semaphore_in_class_with_del(self): + # Issue #704. This used to crash the process + # under PyPy through at least 4.0.1 if the Semaphore + # was implemented with Cython. + class X(object): + def __init__(self): + self.s = Semaphore() + + def __del__(self): + self.s.acquire() + + X() + import gc + gc.collect() + gc.collect() + + test_semaphore_in_class_with_del.ignore_leakcheck = True + + def test_rawlink_on_unacquired_runs_notifiers(self): + # https://github.com/gevent/gevent/issues/1287 + + # Rawlinking a ready semaphore should fire immediately, + # not raise LoopExit + s = Semaphore() + gevent.wait([s]) + +class TestLock(greentest.TestCase): + + def test_release_unheld_lock(self): + std_lock = std_allocate_lock() + g_lock = allocate_lock() + try: + std_lock.release() + self.fail("Should have thrown an exception") + except Exception as e: + std_exc = e + + try: + g_lock.release() + self.fail("Should have thrown an exception") + except Exception as e: + g_exc = e + self.assertIsInstance(g_exc, type(std_exc)) + + +@greentest.skipOnPurePython("Needs C extension") +class TestCExt(greentest.TestCase): + + def test_c_extension(self): + self.assertEqual(Semaphore.__module__, + 'gevent.__semaphore') + + +if __name__ == '__main__': + greentest.main() diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__server.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__server.py new file mode 100644 index 00000000..2ccdc856 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__server.py @@ -0,0 +1,515 @@ +from __future__ import print_function, division +import unittest +import errno +import os + + +import gevent.testing as greentest +from gevent.testing import PY3 +from gevent.testing import DEFAULT_SOCKET_TIMEOUT as _DEFAULT_SOCKET_TIMEOUT +from gevent import socket +import gevent +from gevent.server import StreamServer + + +class SimpleStreamServer(StreamServer): + + def handle(self, client_socket, _address): # pylint:disable=method-hidden + fd = client_socket.makefile() + try: + request_line = fd.readline() + if not request_line: + return + try: + _method, path, _rest = request_line.split(' ', 3) + except Exception: + print('Failed to parse request line: %r' % (request_line, )) + raise + if path == '/ping': + client_socket.sendall(b'HTTP/1.0 200 OK\r\n\r\nPONG') + elif path in ['/long', '/short']: + client_socket.sendall(b'hello') + while True: + data = client_socket.recv(1) + if not data: + break + else: + client_socket.sendall(b'HTTP/1.0 404 WTF?\r\n\r\n') + finally: + fd.close() + + +class Settings(object): + ServerClass = StreamServer + ServerSubClass = SimpleStreamServer + restartable = True + close_socket_detected = True + + @staticmethod + def assertAcceptedConnectionError(inst): + conn = inst.makefile() + result = conn.read() + inst.assertFalse(result) + + assert500 = assertAcceptedConnectionError + + @staticmethod + def assert503(inst): + # regular reads timeout + inst.assert500() + # attempt to send anything reset the connection + try: + inst.send_request() + except socket.error as ex: + if ex.args[0] not in greentest.CONN_ABORTED_ERRORS: + raise + + @staticmethod + def assertPoolFull(inst): + with inst.assertRaises(socket.timeout): + inst.assertRequestSucceeded(timeout=0.01) + + @staticmethod + def fill_default_server_args(inst, kwargs): + kwargs.setdefault('spawn', inst.get_spawn()) + return kwargs + +class TestCase(greentest.TestCase): + # pylint: disable=too-many-public-methods + __timeout__ = greentest.LARGE_TIMEOUT + Settings = Settings + server = None + + def cleanup(self): + if getattr(self, 'server', None) is not None: + self.server.stop() + self.server = None + + def get_listener(self): + sock = socket.socket() + sock.bind(('127.0.0.1', 0)) + sock.listen(5) + self._close_on_teardown(sock) + return sock + + def get_server_host_port_family(self): + server_host = self.server.server_host + if not server_host: + server_host = greentest.DEFAULT_LOCAL_HOST_ADDR + elif server_host == '::': + server_host = greentest.DEFAULT_LOCAL_HOST_ADDR6 + + try: + family = self.server.socket.family + except AttributeError: + # server deletes socket when closed + family = socket.AF_INET + + return server_host, self.server.server_port, family + + def makefile(self, timeout=_DEFAULT_SOCKET_TIMEOUT, bufsize=1): + server_host, server_port, family = self.get_server_host_port_family() + + sock = socket.socket(family=family) + try: + sock.connect((server_host, server_port)) + except Exception: + # avoid ResourceWarning under Py3 + sock.close() + raise + + if PY3: + # Under Python3, you can't read and write to the same + # makefile() opened in r, and r+ is not allowed + kwargs = {'buffering': bufsize, 'mode': 'rwb'} + else: + kwargs = {'bufsize': bufsize} + + rconn = sock.makefile(**kwargs) + if PY3: + rconn._sock = sock + rconn._sock.settimeout(timeout) + sock.close() + return rconn + + def send_request(self, url='/', timeout=_DEFAULT_SOCKET_TIMEOUT, bufsize=1): + conn = self.makefile(timeout=timeout, bufsize=bufsize) + conn.write(('GET %s HTTP/1.0\r\n\r\n' % url).encode('latin-1')) + conn.flush() + return conn + + def assertConnectionRefused(self): + with self.assertRaises(socket.error) as exc: + conn = self.makefile() + conn.close() + + ex = exc.exception + self.assertIn(ex.args[0], (errno.ECONNREFUSED, errno.EADDRNOTAVAIL)) + + def assert500(self): + self.Settings.assert500(self) + + def assert503(self): + self.Settings.assert503(self) + + def assertAcceptedConnectionError(self): + self.Settings.assertAcceptedConnectionError(self) + + def assertPoolFull(self): + self.Settings.assertPoolFull(self) + + def assertNotAccepted(self): + conn = self.makefile() + conn.write(b'GET / HTTP/1.0\r\n\r\n') + conn.flush() + result = b'' + try: + while True: + data = conn._sock.recv(1) + if not data: + break + result += data + except socket.timeout: + self.assertFalse(result) + return + self.assertTrue(result.startswith(b'HTTP/1.0 500 Internal Server Error'), repr(result)) + conn.close() + + def assertRequestSucceeded(self, timeout=_DEFAULT_SOCKET_TIMEOUT): + conn = self.makefile(timeout=timeout) + conn.write(b'GET /ping HTTP/1.0\r\n\r\n') + result = conn.read() + conn.close() + assert result.endswith(b'\r\n\r\nPONG'), repr(result) + + def start_server(self): + self.server.start() + self.assertRequestSucceeded() + self.assertRequestSucceeded() + + def stop_server(self): + self.server.stop() + self.assertConnectionRefused() + + def report_netstat(self, _msg): + # At one point this would call 'sudo netstat -anp | grep PID' + # with os.system. We can probably do better with psutil. + return + + def _create_server(self): + return self.ServerSubClass((greentest.DEFAULT_BIND_ADDR, 0)) + + def init_server(self): + self.server = self._create_server() + self.server.start() + gevent.sleep(0.01) + + @property + def socket(self): + return self.server.socket + + def _test_invalid_callback(self): + try: + self.server = self.ServerClass((greentest.DEFAULT_BIND_ADDR, 0), lambda: None) + self.server.start() + + self.expect_one_error() + + self.assert500() + self.assert_error(TypeError) + finally: + self.server.stop() + # XXX: There's something unreachable (with a traceback?) + # We need to clear it to make the leak checks work on Travis; + # so far I can't reproduce it locally on OS X. + import gc; gc.collect() + + def fill_default_server_args(self, kwargs): + return self.Settings.fill_default_server_args(self, kwargs) + + def ServerClass(self, *args, **kwargs): + return self.Settings.ServerClass(*args, + **self.fill_default_server_args(kwargs)) + + def ServerSubClass(self, *args, **kwargs): + return self.Settings.ServerSubClass(*args, + **self.fill_default_server_args(kwargs)) + + def get_spawn(self): + return None + +class TestDefaultSpawn(TestCase): + + def get_spawn(self): + return gevent.spawn + + def _test_server_start_stop(self, restartable): + self.report_netstat('before start') + self.start_server() + self.report_netstat('after start') + if restartable and self.Settings.restartable: + self.server.stop_accepting() + self.report_netstat('after stop_accepting') + self.assertNotAccepted() + self.server.start_accepting() + self.report_netstat('after start_accepting') + self.assertRequestSucceeded() + self.stop_server() + self.report_netstat('after stop') + + def test_backlog_is_not_accepted_for_socket(self): + self.switch_expected = False + with self.assertRaises(TypeError): + self.ServerClass(self.get_listener(), backlog=25, handle=False) + + def test_backlog_is_accepted_for_address(self): + self.server = self.ServerSubClass((greentest.DEFAULT_BIND_ADDR, 0), backlog=25) + self.assertConnectionRefused() + self._test_server_start_stop(restartable=False) + + def test_subclass_just_create(self): + self.server = self.ServerSubClass(self.get_listener()) + self.assertNotAccepted() + + def test_subclass_with_socket(self): + self.server = self.ServerSubClass(self.get_listener()) + # the connection won't be refused, because there exists a + # listening socket, but it won't be handled also + self.assertNotAccepted() + self._test_server_start_stop(restartable=True) + + def test_subclass_with_address(self): + self.server = self.ServerSubClass((greentest.DEFAULT_BIND_ADDR, 0)) + self.assertConnectionRefused() + self._test_server_start_stop(restartable=True) + + def test_invalid_callback(self): + self._test_invalid_callback() + + @greentest.reraises_flaky_timeout(socket.timeout) + def _test_serve_forever(self): + g = gevent.spawn(self.server.serve_forever) + try: + gevent.sleep(0.01) + self.assertRequestSucceeded() + self.server.stop() + assert not self.server.started + self.assertConnectionRefused() + finally: + g.kill() + g.get() + + def test_serve_forever(self): + self.server = self.ServerSubClass(('127.0.0.1', 0)) + assert not self.server.started + self.assertConnectionRefused() + self._test_serve_forever() + + def test_serve_forever_after_start(self): + self.server = self.ServerSubClass((greentest.DEFAULT_BIND_ADDR, 0)) + self.assertConnectionRefused() + assert not self.server.started + self.server.start() + assert self.server.started + self._test_serve_forever() + + def test_server_closes_client_sockets(self): + self.server = self.ServerClass((greentest.DEFAULT_BIND_ADDR, 0), lambda *args: []) + self.server.start() + conn = self.send_request() + # use assert500 below? + with gevent.Timeout._start_new_or_dummy(1): + try: + result = conn.read() + if result: + assert result.startswith('HTTP/1.0 500 Internal Server Error'), repr(result) + except socket.error as ex: + if ex.args[0] == 10053: + pass # "established connection was aborted by the software in your host machine" + elif ex.args[0] == errno.ECONNRESET: + pass + else: + raise + finally: + conn.close() + + self.stop_server() + + def init_server(self): + self.server = self._create_server() + self.server.start() + gevent.sleep(0.01) + + @property + def socket(self): + return self.server.socket + + def test_error_in_spawn(self): + self.init_server() + self.assertTrue(self.server.started) + error = ExpectedError('test_error_in_spawn') + self.server._spawn = lambda *args: gevent.getcurrent().throw(error) + self.expect_one_error() + self.assertAcceptedConnectionError() + self.assert_error(ExpectedError, error) + + def test_server_repr_when_handle_is_instancemethod(self): + # PR 501 + self.init_server() + self.start_server() + self.assertIn('Server', repr(self.server)) + + self.server.set_handle(self.server.handle) + self.assertIn('handle=', repr(self.server)) + + self.server.set_handle(self.test_server_repr_when_handle_is_instancemethod) + self.assertIn('test_server_repr_when_handle_is_instancemethod', repr(self.server)) + + def handle(): + pass + self.server.set_handle(handle) + self.assertIn('handle= returned a result with an error set + + # It's not safe to continue after a SystemError, so we just skip the test there. + + # As of Jan 2018 with CFFI 1.11.2 this happens reliably on macOS 3.6 and 3.7 + # as well. + + # See https://bitbucket.org/cffi/cffi/issues/352/systemerror-returned-a-result-with-an + + # This is fixed in 1.11.3 + + import gevent.signal # make sure it's in sys.modules pylint:disable=redefined-outer-name + assert gevent.signal + import site + if greentest.PY34: + from importlib import reload as reload_module + elif greentest.PY3: + from imp import reload as reload_module + else: + # builtin on py2 + reload_module = reload # pylint:disable=undefined-variable + + try: + reload_module(site) + except TypeError: + # Non-CFFI on Travis triggers this, for some reason, + # but only on 3.6, not 3.4 or 3.5, and not yet on 3.7. + + # The only module seen to trigger this is __main__, i.e., this module. + + # This is hard to trigger in a virtualenv since it appears they + # install their own site.py, different from the one that ships with + # Python 3.6., and at least the version I have doesn't mess with + # __cached__ + assert greentest.PY36 + import sys + for m in set(sys.modules.values()): + try: + if m.__cached__ is None: + print("Module has None __cached__", m, file=sys.stderr) + except AttributeError: + continue + +if __name__ == '__main__': + greentest.main() diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__sleep0.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__sleep0.py new file mode 100644 index 00000000..d95d6776 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__sleep0.py @@ -0,0 +1,10 @@ +import gevent +from gevent.testing.util import alarm + + +alarm(3) + + +with gevent.Timeout(0.01, False): + while True: + gevent.sleep(0) diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__socket.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__socket.py new file mode 100644 index 00000000..1ee6c233 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__socket.py @@ -0,0 +1,452 @@ +from gevent import monkey; monkey.patch_all() + +import sys +import os +import array +import socket +import traceback +import time +import unittest +import gevent.testing as greentest +from functools import wraps +from gevent.testing import six +from gevent.testing import LARGE_TIMEOUT + +# we use threading on purpose so that we can test both regular and gevent sockets with the same code +from threading import Thread as _Thread + +errno_types = int + +def wrap_error(func): + + @wraps(func) + def wrapper(*args, **kwargs): + try: + return func(*args, **kwargs) + except: # pylint:disable=bare-except + traceback.print_exc() + os._exit(2) + + return wrapper + + +class Thread(_Thread): + + def __init__(self, **kwargs): + target = kwargs.pop('target') + target = wrap_error(target) + _Thread.__init__(self, target=target, **kwargs) + self.start() + + +class TestTCP(greentest.TestCase): + + __timeout__ = None + TIMEOUT_ERROR = socket.timeout + long_data = ", ".join([str(x) for x in range(20000)]) + if not isinstance(long_data, bytes): + long_data = long_data.encode('ascii') + + def setUp(self): + super(TestTCP, self).setUp() + self.listener = self._close_on_teardown(self._setup_listener()) + + # XXX: On Windows (at least with libev), if we have a cleanup/tearDown method + # that does 'del self.listener' AND we haven't sometime + # previously closed the listener (while the test body was executing) + # we tend to sometimes see hangs when tests run in succession; + # notably test_empty_send followed by test_makefile produces a hang + # in test_makefile when it tries to read from the client_file, because + # the accept() call in accept_once has not yet returned a new socket to + # write to. + + # The cause *seems* to be that the listener socket in both tests gets the + # same fileno(); or, at least, if we don't del the listener object, + # we get a different fileno, and that scenario works. + + # Perhaps our logic is wrong in libev_vfd in the way we use + # _open_osfhandle and determine we can close it? + self.port = self.listener.getsockname()[1] + + def _setup_listener(self): + listener = socket.socket() + greentest.bind_and_listen(listener, ('127.0.0.1', 0)) + return listener + + def create_connection(self, host='127.0.0.1', port=None, timeout=None, + blocking=None): + sock = socket.socket() + sock.connect((host, port or self.port)) + if timeout is not None: + sock.settimeout(timeout) + if blocking is not None: + sock.setblocking(blocking) + return self._close_on_teardown(sock) + + def _test_sendall(self, data, match_data=None, client_method='sendall', + **client_args): + + read_data = [] + server_exc_info = [] + + def accept_and_read(): + conn = None + try: + conn, _ = self.listener.accept() + r = conn.makefile(mode='rb') + read_data.append(r.read()) + r.flush() + r.close() + except: # pylint:disable=bare-except + server_exc_info.append(sys.exc_info()) + finally: + if conn: + conn.close() + self.listener.close() + + server = Thread(target=accept_and_read) + client = self.create_connection(**client_args) + + try: + getattr(client, client_method)(data) + finally: + client.shutdown(socket.SHUT_RDWR) + client.close() + + server.join() + if match_data is None: + match_data = self.long_data + self.assertEqual(read_data[0], match_data) + + if server_exc_info: + six.reraise(*server_exc_info[0]) + + def test_sendall_str(self): + self._test_sendall(self.long_data) + + if not six.PY3: + def test_sendall_unicode(self): + self._test_sendall(six.text_type(self.long_data)) + + def test_sendall_array(self): + data = array.array("B", self.long_data) + self._test_sendall(data) + + def test_sendall_empty(self): + data = b'' + self._test_sendall(data, data) + + def test_sendall_empty_with_timeout(self): + # Issue 719 + data = b'' + self._test_sendall(data, data, timeout=10) + + def test_sendall_nonblocking(self): + # https://github.com/benoitc/gunicorn/issues/1282 + # Even if the socket is non-blocking, we make at least + # one attempt to send data. Under Py2 before this fix, we + # would incorrectly immediately raise a timeout error + data = b'hi\n' + self._test_sendall(data, data, blocking=False) + + def test_empty_send(self): + # Issue 719 + data = b'' + self._test_sendall(data, data, client_method='send') + + def test_fullduplex(self): + N = 100000 + + def server(): + (remote_client, _) = self.listener.accept() + # start reading, then, while reading, start writing. the reader should not hang forever + + def sendall(): + remote_client.sendall(b't' * N) + + sender = Thread(target=sendall) + result = remote_client.recv(1000) + self.assertEqual(result, b'hello world') + sender.join() + remote_client.close() + self.listener.close() + + server_thread = Thread(target=server) + client = self.create_connection() + client_file = client.makefile() + client_reader = Thread(target=client_file.read, args=(N, )) + time.sleep(0.1) + client.sendall(b'hello world') + time.sleep(0.1) + + # close() used to hang + client_file.close() + client.close() + + # this tests "full duplex" bug; + server_thread.join() + + client_reader.join() + + def test_recv_timeout(self): + client_sock = [] + acceptor = Thread(target=lambda: client_sock.append(self.listener.accept())) + client = self.create_connection() + client.settimeout(1) + start = time.time() + self.assertRaises(self.TIMEOUT_ERROR, client.recv, 1024) + took = time.time() - start + self.assertTimeWithinRange(took, 1 - 0.1, 1 + 0.1) + acceptor.join() + client.close() + client_sock[0][0].close() + + # Subclasses can disable this + _test_sendall_timeout_check_time = True + + # Travis-CI container infrastructure is configured with + # large socket buffers, at least 2MB, as-of Jun 3, 2015, + # so we must be sure to send more data than that. + # In 2018, this needs to be increased *again* as a smaller value was + # still often being sent. + _test_sendall_data = b'hello' * 100000000 + + # This doesn't make much sense...why are we really skipping this? + @greentest.skipOnWindows("On Windows send() accepts whatever is thrown at it") + def test_sendall_timeout(self): + client_sock = [] + acceptor = Thread(target=lambda: client_sock.append(self.listener.accept())) + client = self.create_connection() + time.sleep(0.1) + assert client_sock + client.settimeout(0.1) + start = time.time() + try: + with self.assertRaises(self.TIMEOUT_ERROR): + client.sendall(self._test_sendall_data) + if self._test_sendall_timeout_check_time: + took = time.time() - start + self.assertTimeWithinRange(took, 0.09, 0.2) + finally: + acceptor.join() + client.close() + client_sock[0][0].close() + + def test_makefile(self): + def accept_once(): + conn, _ = self.listener.accept() + fd = conn.makefile(mode='wb') + fd.write(b'hello\n') + fd.flush() + fd.close() + conn.close() # for pypy + self.listener.close() + + acceptor = Thread(target=accept_once) + client = self.create_connection() + # Closing the socket doesn't close the file + client_file = client.makefile(mode='rb') + client.close() + line = client_file.readline() + self.assertEqual(line, b'hello\n') + self.assertEqual(client_file.read(), b'') + client_file.close() + acceptor.join() + + def test_makefile_timeout(self): + + def accept_once(): + conn, _ = self.listener.accept() + try: + time.sleep(0.3) + finally: + conn.close() # for pypy + + acceptor = Thread(target=accept_once) + client = self.create_connection() + client.settimeout(0.1) + fd = client.makefile(mode='rb') + self.assertRaises(self.TIMEOUT_ERROR, fd.readline) + client.close() + fd.close() + acceptor.join() + + def test_attributes(self): + s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM, 0) + self.assertEqual(socket.AF_INET, s.type) + self.assertEqual(socket.SOCK_DGRAM, s.family) + self.assertEqual(0, s.proto) + + if hasattr(socket, 'SOCK_NONBLOCK'): + s.settimeout(1) + self.assertEqual(socket.AF_INET, s.type) + + s.setblocking(0) + std_socket = monkey.get_original('socket', 'socket')(socket.AF_INET, socket.SOCK_DGRAM, 0) + try: + std_socket.setblocking(0) + self.assertEqual(std_socket.type, s.type) + finally: + std_socket.close() + + s.close() + + def test_connect_ex_nonblocking_bad_connection(self): + # Issue 841 + s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) + s.setblocking(False) + ret = s.connect_ex((greentest.DEFAULT_LOCAL_HOST_ADDR, get_port())) + self.assertIsInstance(ret, errno_types) + s.close() + + def test_connect_ex_gaierror(self): + # Issue 841 + s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) + with self.assertRaises(socket.gaierror): + s.connect_ex(('foo.bar.fizzbuzz', get_port())) + s.close() + + def test_connect_ex_nonblocking_overflow(self): + # Issue 841 + s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) + s.setblocking(False) + with self.assertRaises(OverflowError): + s.connect_ex((greentest.DEFAULT_LOCAL_HOST_ADDR, 65539)) + s.close() + + @unittest.skipUnless(hasattr(socket, 'SOCK_CLOEXEC'), + "Requires SOCK_CLOEXEC") + def test_connect_with_type_flags_ignored(self): + # Issue 944 + # If we have SOCK_CLOEXEC or similar, we shouldn't be passing + # them through to the getaddrinfo call that connect() makes + SOCK_CLOEXEC = socket.SOCK_CLOEXEC # pylint:disable=no-member + s = socket.socket(socket.AF_INET, socket.SOCK_STREAM | SOCK_CLOEXEC) + + def accept_once(): + conn, _ = self.listener.accept() + fd = conn.makefile(mode='wb') + fd.write(b'hello\n') + fd.close() + conn.close() + + acceptor = Thread(target=accept_once) + s.connect(('127.0.0.1', self.port)) + fd = s.makefile(mode='rb') + self.assertEqual(fd.readline(), b'hello\n') + + fd.close() + s.close() + + acceptor.join() + +def get_port(): + tempsock = socket.socket() + tempsock.bind(('', 0)) + port = tempsock.getsockname()[1] + tempsock.close() + return port + + +class TestCreateConnection(greentest.TestCase): + + __timeout__ = LARGE_TIMEOUT + + def test_refuses(self): + with self.assertRaises(socket.error) as cm: + socket.create_connection((greentest.DEFAULT_BIND_ADDR, get_port()), + timeout=30, + source_address=('', get_port())) + ex = cm.exception + self.assertIn('refused', str(ex).lower()) + + @greentest.ignores_leakcheck + def test_base_exception(self): + # such as a GreenletExit or a gevent.timeout.Timeout + + class E(BaseException): + pass + + class MockSocket(object): + + created = () + closed = False + + def __init__(self, *_): + MockSocket.created += (self,) + + def connect(self, _): + raise E() + + def close(self): + self.closed = True + + def mockgetaddrinfo(*_): + return [(1, 2, 3, 3, 5),] + + import gevent.socket as gsocket + # Make sure we're monkey patched + self.assertEqual(gsocket.create_connection, socket.create_connection) + orig_socket = gsocket.socket + orig_getaddrinfo = gsocket.getaddrinfo + + try: + gsocket.socket = MockSocket + gsocket.getaddrinfo = mockgetaddrinfo + + with self.assertRaises(E): + socket.create_connection(('host', 'port')) + + self.assertEqual(1, len(MockSocket.created)) + self.assertTrue(MockSocket.created[0].closed) + + finally: + MockSocket.created = () + gsocket.socket = orig_socket + gsocket.getaddrinfo = orig_getaddrinfo + +class TestFunctions(greentest.TestCase): + + @greentest.ignores_leakcheck + # Creating new types in the function takes a cycle to cleanup. + def test_wait_timeout(self): + # Issue #635 + import gevent.socket + import gevent._socketcommon + + class io(object): + callback = None + + def start(self, *_args): + gevent.sleep(10) + + with self.assertRaises(gevent.socket.timeout): + gevent.socket.wait(io(), timeout=0.01) # pylint:disable=no-member + + + def test_signatures(self): + # https://github.com/gevent/gevent/issues/960 + exclude = [] + if greentest.PYPY: + # Up through at least PyPy 5.7.1, they define these as + # gethostbyname(host), whereas the official CPython argument name + # is hostname. But cpython doesn't allow calling with keyword args. + # Likewise for gethostbyaddr: PyPy uses host, cpython uses ip_address + exclude.append('gethostbyname') + exclude.append('gethostbyname_ex') + exclude.append('gethostbyaddr') + self.assertMonkeyPatchedFuncSignatures('socket', exclude=exclude) + + +class TestSocket(greentest.TestCase): + + def test_shutdown_when_closed(self): + # https://github.com/gevent/gevent/issues/1089 + # we once raised an AttributeError. + s = socket.socket() + s.close() + with self.assertRaises(socket.error): + s.shutdown(socket.SHUT_RDWR) + +if __name__ == '__main__': + greentest.main() diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__socket_close.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__socket_close.py new file mode 100644 index 00000000..24a71689 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__socket_close.py @@ -0,0 +1,58 @@ +import gevent +from gevent import socket +from gevent import server +import gevent.testing as greentest + +# XXX also test: send, sendall, recvfrom, recvfrom_into, sendto + + +def readall(sock, _): + while sock.recv(1024): + pass # pragma: no cover we never actually send the data + sock.close() + + +class Test(greentest.TestCase): + + error_fatal = False + + def setUp(self): + self.server = server.StreamServer(('127.0.0.1', 0), readall) + self.server.start() + + def tearDown(self): + self.server.stop() + + def test_recv_closed(self): + sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) + sock.connect(('localhost', self.server.server_port)) + receiver = gevent.spawn(sock.recv, 25) + try: + gevent.sleep(0.001) + sock.close() + receiver.join(timeout=0.1) + self.assertTrue(receiver.ready(), receiver) + self.assertEqual(receiver.value, None) + self.assertIsInstance(receiver.exception, socket.error) + self.assertEqual(receiver.exception.errno, socket.EBADF) + finally: + receiver.kill() + + # XXX: This is possibly due to the bad behaviour of small sleeps? + # The timeout is the global test timeout, 10s + @greentest.skipOnLibuvOnCI("Sometimes randomly times out") + def test_recv_twice(self): + sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) + sock.connect(('localhost', self.server.server_port)) + receiver = gevent.spawn(sock.recv, 25) + try: + gevent.sleep(0.001) + self.assertRaises(AssertionError, sock.recv, 25) + self.assertRaises(AssertionError, sock.recv, 25) + finally: + receiver.kill() + sock.close() + + +if __name__ == '__main__': + greentest.main() diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__socket_dns.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__socket_dns.py new file mode 100644 index 00000000..d9986dd4 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__socket_dns.py @@ -0,0 +1,718 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- +# pylint:disable=broad-except +import gevent +from gevent import monkey + +import os +import re +import gevent.testing as greentest +import unittest +import socket +from time import time +import traceback +import gevent.socket as gevent_socket +from gevent.testing.util import log +from gevent.testing import six +from gevent.testing.six import xrange + + +resolver = gevent.get_hub().resolver +log('Resolver: %s', resolver) + +if getattr(resolver, 'pool', None) is not None: + resolver.pool.size = 1 + +from gevent.testing.sysinfo import RESOLVER_NOT_SYSTEM +from gevent.testing.sysinfo import RESOLVER_DNSPYTHON +from gevent.testing.sysinfo import PY2 +import gevent.testing.timing + + +assert gevent_socket.gaierror is socket.gaierror +assert gevent_socket.error is socket.error + +DEBUG = os.getenv('GEVENT_DEBUG', '') == 'trace' + + +def _run(function, *args): + try: + result = function(*args) + assert not isinstance(result, BaseException), repr(result) + return result + except Exception as ex: + if DEBUG: + traceback.print_exc() + return ex + + +def format_call(function, args): + args = repr(args) + if args.endswith(',)'): + args = args[:-2] + ')' + try: + module = function.__module__.replace('gevent._socketcommon', 'gevent') + name = function.__name__ + return '%s:%s%s' % (module, name, args) + except AttributeError: + return function + args + + +def log_fresult(result, seconds): + if isinstance(result, Exception): + msg = ' -=> raised %r' % (result, ) + else: + msg = ' -=> returned %r' % (result, ) + time_ms = ' %.2fms' % (seconds * 1000.0, ) + space = 80 - len(msg) - len(time_ms) + if space > 0: + space = ' ' * space + else: + space = '' + log(msg + space + time_ms) + + +def run(function, *args): + if DEBUG: + log(format_call(function, args)) + delta = time() + result = _run(function, *args) + delta = time() - delta + if DEBUG: + log_fresult(result, delta) + return result, delta + + +def log_call(result, runtime, function, *args): + log(format_call(function, args)) + log_fresult(result, runtime) + + +def compare_relaxed(a, b): + """ + >>> compare_relaxed('2a00:1450:400f:801::1010', '2a00:1450:400f:800::1011') + True + + >>> compare_relaxed('2a00:1450:400f:801::1010', '2aXX:1450:400f:900::1011') + False + + >>> compare_relaxed('2a00:1450:4016:800::1013', '2a00:1450:4008:c01::93') + True + + >>> compare_relaxed('2001:470::e852:4a38:9d7f:0', '2001:470:6d00:1c:1::d00') + True + + >>> compare_relaxed('2001:470:4147:4943:6161:6161:2e74:6573', '2001:470::') + True + + >>> compare_relaxed('2607:f8b0:6708:24af:1fd:700:60d4:4af', '2607:f8b0:2d00::f000:0') + True + + >>> compare_relaxed('a.google.com', 'b.google.com') + True + + >>> compare_relaxed('a.google.com', 'a.gevent.org') + False + """ + # IPv6 address from different requests might be different + a_segments = a.count(':') + b_segments = b.count(':') + if a_segments and b_segments: + if a_segments == b_segments and a_segments in (4, 5, 6, 7): + return True + if a.rstrip(':').startswith(b.rstrip(':')) or b.rstrip(':').startswith(a.rstrip(':')): + return True + if a_segments >= 2 and b_segments >= 2 and a.split(':')[:2] == b.split(':')[:2]: + return True + + return a.split('.', 1)[-1] == b.split('.', 1)[-1] + + +def contains_5tuples(lst): + for item in lst: + if not (isinstance(item, tuple) and len(item) == 5): + return False + return True + + +def relaxed_is_equal(a, b): + """ + >>> relaxed_is_equal([(10, 1, 6, '', ('2a00:1450:400f:801::1010', 80, 0, 0))], [(10, 1, 6, '', ('2a00:1450:400f:800::1011', 80, 0, 0))]) + True + + >>> relaxed_is_equal([1, '2'], (1, '2')) + False + + >>> relaxed_is_equal([1, '2'], [1, '2']) + True + + >>> relaxed_is_equal(('wi-in-x93.1e100.net', 'http'), ('we-in-x68.1e100.net', 'http')) + True + """ + if type(a) is not type(b): + return False + if a == b: + return True + if isinstance(a, six.string_types): + return compare_relaxed(a, b) + try: + if len(a) != len(b): + return False + except TypeError: + return False + if contains_5tuples(a) and contains_5tuples(b): + # getaddrinfo results + a = sorted(a) + b = sorted(b) + return all(relaxed_is_equal(x, y) for (x, y) in zip(a, b)) + + +def add(klass, hostname, name=None, + skip=None, skip_reason=None): + + call = callable(hostname) + + def _setattr(k, n, func): + if skip: + func = greentest.skipIf(skip, skip_reason,)(func) + if not hasattr(k, n): + setattr(k, n, func) + + if name is None: + if call: + name = hostname.__name__ + else: + name = re.sub(r'[^\w]+', '_', repr(hostname)) + assert name, repr(hostname) + + def test1(self): + x = hostname() if call else hostname + self._test('getaddrinfo', x, 'http') + test1.__name__ = 'test_%s_getaddrinfo' % name + _setattr(klass, test1.__name__, test1) + + def test2(self): + x = hostname() if call else hostname + ipaddr = self._test('gethostbyname', x) + if not isinstance(ipaddr, Exception): + self._test('gethostbyaddr', ipaddr) + test2.__name__ = 'test_%s_gethostbyname' % name + _setattr(klass, test2.__name__, test2) + + def test3(self): + x = hostname() if call else hostname + self._test('gethostbyname_ex', x) + test3.__name__ = 'test_%s_gethostbyname_ex' % name + _setattr(klass, test3.__name__, test3) + + def test4(self): + x = hostname() if call else hostname + self._test('gethostbyaddr', x) + test4.__name__ = 'test_%s_gethostbyaddr' % name + _setattr(klass, test4.__name__, test4) + + def test5(self): + x = hostname() if call else hostname + self._test('getnameinfo', (x, 80), 0) + test5.__name__ = 'test_%s_getnameinfo' % name + _setattr(klass, test5.__name__, test5) + + +class TestCase(greentest.TestCase): + + __timeout__ = 30 + switch_expected = None + verbose_dns = False + + def should_log_results(self, result1, result2): + if not self.verbose_dns: + return False + + if isinstance(result1, BaseException) and isinstance(result2, BaseException): + return type(result1) is not type(result2) + return repr(result1) != repr(result2) + + def _test(self, func, *args): + gevent_func = getattr(gevent_socket, func) + real_func = monkey.get_original('socket', func) + real_result, time_real = run(real_func, *args) + gevent_result, time_gevent = run(gevent_func, *args) + if not DEBUG and self.should_log_results(real_result, gevent_result): + log('') + log_call(real_result, time_real, real_func, *args) + log_call(gevent_result, time_gevent, gevent_func, *args) + self.assertEqualResults(real_result, gevent_result, func) + + if self.verbose_dns and time_gevent > time_real + 0.01 and time_gevent > 0.02: + msg = 'gevent:%s%s took %dms versus %dms stdlib' % (func, args, time_gevent * 1000.0, time_real * 1000.0) + + if time_gevent > time_real + 1: + word = 'VERY' + else: + word = 'quite' + + log('\nWARNING: %s slow: %s', word, msg) + + return gevent_result + + def _normalize_result(self, result, func_name): + norm_name = '_normalize_result_' + func_name + if hasattr(self, norm_name): + return getattr(self, norm_name)(result) + return result + + def _normalize_result_gethostbyname_ex(self, result): + # Often the second and third part of the tuple (hostname, aliaslist, ipaddrlist) + # can be in different orders if we're hitting different servers, + # or using the native and ares resolvers due to load-balancing techniques. + # We sort them. + if not RESOLVER_NOT_SYSTEM or isinstance(result, BaseException): + return result + # result[1].sort() # we wind up discarding this + + # On Py2 in test_russion_gethostbyname_ex, this + # is actually an integer, for some reason. In TestLocalhost.tets__ip6_localhost, + # the result isn't this long (maybe an error?). + try: + result[2].sort() + except AttributeError: + pass + except IndexError: + return result + # On some systems, a random alias is found in the aliaslist + # by the system resolver, but not by cares, and vice versa. We deem the aliaslist + # unimportant and discard it. + # On some systems (Travis CI), the ipaddrlist for 'localhost' can come back + # with two entries 127.0.0.1 (presumably two interfaces?) for c-ares + ips = result[2] + if ips == ['127.0.0.1', '127.0.0.1']: + ips = ['127.0.0.1'] + # On some systems, the hostname can get caps + return (result[0].lower(), [], ips) + + def _normalize_result_getaddrinfo(self, result): + if not RESOLVER_NOT_SYSTEM: + return result + # On Python 3, the builtin resolver can return SOCK_RAW results, but + # c-ares doesn't do that. So we remove those if we find them. + if hasattr(socket, 'SOCK_RAW') and isinstance(result, list): + result = [x for x in result if x[1] != socket.SOCK_RAW] + if isinstance(result, list): + result.sort() + return result + + def _normalize_result_gethostbyaddr(self, result): + if not RESOLVER_NOT_SYSTEM: + return result + + if isinstance(result, tuple): + # On some systems, a random alias is found in the aliaslist + # by the system resolver, but not by cares and vice versa. We deem the aliaslist + # unimportant and discard it. + return (result[0], [], result[2]) + return result + + def assertEqualResults(self, real_result, gevent_result, func): + errors = (socket.gaierror, socket.herror, TypeError) + if isinstance(real_result, errors) and isinstance(gevent_result, errors): + if type(real_result) is not type(gevent_result): + log('WARNING: error type mismatch: %r (gevent) != %r (stdlib)', gevent_result, real_result) + return + + real_result = self._normalize_result(real_result, func) + gevent_result = self._normalize_result(gevent_result, func) + + real_result_repr = repr(real_result) + gevent_result_repr = repr(gevent_result) + if real_result_repr == gevent_result_repr: + return + if relaxed_is_equal(gevent_result, real_result): + return + + # If we're using the ares resolver, allow the real resolver to generate an + # error that the ares resolver actually gets an answer to. + + if ( + RESOLVER_NOT_SYSTEM + and isinstance(real_result, errors) + and not isinstance(gevent_result, errors) + ): + return + + # From 2.7 on, assertEqual does a better job highlighting the results than we would + # because it calls assertSequenceEqual, which highlights the exact + # difference in the tuple + self.assertEqual(real_result, gevent_result) + + +class TestTypeError(TestCase): + pass + +add(TestTypeError, None) +add(TestTypeError, 25) + + +class TestHostname(TestCase): + pass + +add(TestHostname, socket.gethostname) + + +class TestLocalhost(TestCase): + # certain tests in test_patched_socket.py only work if getaddrinfo('localhost') does not switch + # (e.g. NetworkConnectionAttributesTest.testSourceAddress) + #switch_expected = False + # XXX: The above has been commented out for some time. Apparently this isn't the case + # anymore. + + def _normalize_result_getaddrinfo(self, result): + if RESOLVER_NOT_SYSTEM: + # We see that some impls (OS X) return extra results + # like DGRAM that ares does not. + return () + return super(TestLocalhost, self)._normalize_result_getaddrinfo(result) + + if greentest.RUNNING_ON_TRAVIS and greentest.PY2 and RESOLVER_NOT_SYSTEM: + def _normalize_result_gethostbyaddr(self, result): + # Beginning in November 2017 after an upgrade to Travis, + # we started seeing ares return ::1 for localhost, but + # the system resolver is still returning 127.0.0.1 under Python 2 + result = super(TestLocalhost, self)._normalize_result_gethostbyaddr(result) + if isinstance(result, tuple): + result = (result[0], result[1], ['127.0.0.1']) + return result + + +add( + TestLocalhost, 'ip6-localhost', + skip=greentest.RUNNING_ON_TRAVIS, + skip_reason="ares fails here, for some reason, presumably a badly " + "configured /etc/hosts" +) +add( + TestLocalhost, 'localhost', + skip=greentest.RUNNING_ON_TRAVIS, + skip_reason="Beginning Dec 1 2017, ares started returning ip6-localhost " + "instead of localhost" +) + + +class TestNonexistent(TestCase): + pass + +add(TestNonexistent, 'nonexistentxxxyyy') + + +class Test1234(TestCase): + pass + +add(Test1234, '1.2.3.4') + + +class Test127001(TestCase): + pass + +add( + Test127001, '127.0.0.1', + skip=greentest.RUNNING_ON_TRAVIS, + skip_reason="Beginning Dec 1 2017, ares started returning ip6-localhost " + "instead of localhost" +) + + + +class TestBroadcast(TestCase): + switch_expected = False + + if RESOLVER_NOT_SYSTEM: + # ares and dnspython raises errors for broadcasthost/255.255.255.255 + + @unittest.skip('ares raises errors for broadcasthost/255.255.255.255') + def test__broadcast__gethostbyaddr(self): + return + + test__broadcast__gethostbyname = test__broadcast__gethostbyaddr + +add(TestBroadcast, '') + + +from gevent.resolver.dnspython import HostsFile +class SanitizedHostsFile(HostsFile): + def iter_all_host_addr_pairs(self): + for name, addr in super(SanitizedHostsFile, self).iter_all_host_addr_pairs(): + if (RESOLVER_NOT_SYSTEM + and (name.endswith('local') # ignore bonjour, ares can't find them + # ignore common aliases that ares can't find + or addr == '255.255.255.255' + or name == 'broadcasthost' + # We get extra results from some impls, like OS X + # it returns DGRAM results + or name == 'localhost')): + continue # pragma: no cover + if name.endswith('local'): + # These can only be found if bonjour is running, + # and are very slow to do so with the system resolver on OS X + continue + yield name, addr + +@greentest.skipIf(greentest.RUNNING_ON_CI, + "This sometimes randomly fails on Travis with ares and on appveyor, beginning Feb 13, 2018") +# Probably due to round-robin DNS, +# since this is not actually the system's etc hosts file. +# TODO: Rethink this. We need something reliable. Go back to using +# the system's etc hosts? +class TestEtcHosts(TestCase): + + MAX_HOSTS = int(os.getenv('GEVENTTEST_MAX_ETC_HOSTS', '10')) + + @classmethod + def populate_tests(cls): + hf = SanitizedHostsFile(os.path.join(os.path.dirname(__file__), + 'hosts_file.txt')) + all_etc_hosts = sorted(hf.iter_all_host_addr_pairs()) + if len(all_etc_hosts) > cls.MAX_HOSTS and not DEBUG: + all_etc_hosts = all_etc_hosts[:cls.MAX_HOSTS] + + for host, ip in all_etc_hosts: + add(cls, host) + add(cls, ip) + + + +TestEtcHosts.populate_tests() + + + +class TestGeventOrg(TestCase): + + HOSTNAME = 'www.gevent.org' + +# For this test to work correctly, it needs to resolve to +# an address with a single A record; round-robin DNS and multiple A records +# may mess it up (subsequent requests---and we always make two---may return +# unequal results). We used to use gevent.org, but that now has multiple A records; +# trying www.gevent.org which is a CNAME to readthedocs.org. +add(TestGeventOrg, TestGeventOrg.HOSTNAME) + + +class TestFamily(TestCase): + + @classmethod + def getresult(cls): + if not hasattr(cls, '_result'): + cls._result = getattr(socket, 'getaddrinfo')(TestGeventOrg.HOSTNAME, None) + return cls._result + + def test_inet(self): + self.assertEqualResults(self.getresult(), + gevent_socket.getaddrinfo(TestGeventOrg.HOSTNAME, None, socket.AF_INET), + 'getaddrinfo') + + def test_unspec(self): + self.assertEqualResults(self.getresult(), + gevent_socket.getaddrinfo(TestGeventOrg.HOSTNAME, None, socket.AF_UNSPEC), + 'getaddrinfo') + + def test_badvalue(self): + self._test('getaddrinfo', TestGeventOrg.HOSTNAME, None, 255) + self._test('getaddrinfo', TestGeventOrg.HOSTNAME, None, 255000) + self._test('getaddrinfo', TestGeventOrg.HOSTNAME, None, -1) + + def test_badtype(self): + self._test('getaddrinfo', TestGeventOrg.HOSTNAME, 'x') + + +class Test_getaddrinfo(TestCase): + + def _test_getaddrinfo(self, *args): + self._test('getaddrinfo', *args) + + def test_80(self): + self._test_getaddrinfo(TestGeventOrg.HOSTNAME, 80) + + def test_int_string(self): + self._test_getaddrinfo(TestGeventOrg.HOSTNAME, '80') + + def test_0(self): + self._test_getaddrinfo(TestGeventOrg.HOSTNAME, 0) + + def test_http(self): + self._test_getaddrinfo(TestGeventOrg.HOSTNAME, 'http') + + def test_notexistent_tld(self): + self._test_getaddrinfo('myhost.mytld', 53) + + def test_notexistent_dot_com(self): + self._test_getaddrinfo('sdfsdfgu5e66098032453245wfdggd.com', 80) + + def test1(self): + return self._test_getaddrinfo(TestGeventOrg.HOSTNAME, 52, socket.AF_UNSPEC, socket.SOCK_STREAM, 0, 0) + + def test2(self): + return self._test_getaddrinfo(TestGeventOrg.HOSTNAME, 53, socket.AF_INET, socket.SOCK_DGRAM, 17) + + @unittest.skipIf(RESOLVER_DNSPYTHON, + "dnspython only returns some of the possibilities") + def test3(self): + return self._test_getaddrinfo('google.com', 'http', socket.AF_INET6) + + + @greentest.skipIf(PY2, "Enums only on Python 3.4+") + def test_enums(self): + # https://github.com/gevent/gevent/issues/1310 + + # On Python 3, getaddrinfo does special things to make sure that + # the fancy enums are returned. + + gai = gevent_socket.getaddrinfo('example.com', 80, + socket.AF_INET, + socket.SOCK_STREAM, socket.IPPROTO_TCP) + af, socktype, _proto, _canonname, _sa = gai[0] + self.assertIs(socktype, socket.SOCK_STREAM) + self.assertIs(af, socket.AF_INET) + +class TestInternational(TestCase): + pass + +# dns python can actually resolve these: it uses +# the 2008 version of idna encoding, whereas on Python 2, +# with the default resolver, it tries to encode to ascii and +# raises a UnicodeEncodeError. So we get different results. +add(TestInternational, u'президент.рф', 'russian', + skip=(PY2 and RESOLVER_DNSPYTHON), skip_reason="dnspython can actually resolve these") +add(TestInternational, u'президент.рф'.encode('idna'), 'idna') + + +class TestInterrupted_gethostbyname(gevent.testing.timing.AbstractGenericWaitTestCase): + + # There are refs to a Waiter in the C code that don't go + # away yet; one gc may or may not do it. + @greentest.ignores_leakcheck + def test_returns_none_after_timeout(self): + super(TestInterrupted_gethostbyname, self).test_returns_none_after_timeout() + + def wait(self, timeout): + with gevent.Timeout(timeout, False): + for index in xrange(1000000): + try: + gevent_socket.gethostbyname('www.x%s.com' % index) + except socket.error: + pass + raise AssertionError('Timeout was not raised') + + def cleanup(self): + # Depending on timing, this can raise: + # (This suddenly started happening on Apr 6 2016; www.x1000000.com + # is apparently no longer around) + + # File "test__socket_dns.py", line 538, in cleanup + # gevent.get_hub().threadpool.join() + # File "/home/travis/build/gevent/gevent/src/gevent/threadpool.py", line 108, in join + # sleep(delay) + # File "/home/travis/build/gevent/gevent/src/gevent/hub.py", line 169, in sleep + # hub.wait(loop.timer(seconds, ref=ref)) + # File "/home/travis/build/gevent/gevent/src/gevent/hub.py", line 651, in wait + # result = waiter.get() + # File "/home/travis/build/gevent/gevent/src/gevent/hub.py", line 899, in get + # return self.hub.switch() + # File "/home/travis/build/gevent/gevent/src/greentest/greentest.py", line 520, in switch + # return _original_Hub.switch(self, *args) + # File "/home/travis/build/gevent/gevent/src/gevent/hub.py", line 630, in switch + # return RawGreenlet.switch(self) + # gaierror: [Errno -2] Name or service not known + try: + gevent.get_hub().threadpool.join() + except Exception: # pragma: no cover pylint:disable=broad-except + traceback.print_exc() + + +# class TestInterrupted_getaddrinfo(greentest.GenericWaitTestCase): +# +# def wait(self, timeout): +# with gevent.Timeout(timeout, False): +# for index in range(1000): +# try: +# gevent_socket.getaddrinfo('www.a%s.com' % index, 'http') +# except socket.gaierror: +# pass + + +class TestBadName(TestCase): + pass + +add(TestBadName, 'xxxxxxxxxxxx') + + +class TestBadIP(TestCase): + pass + +add(TestBadIP, '1.2.3.400') + + +@greentest.skipIf(greentest.RUNNING_ON_TRAVIS, "Travis began returning ip6-localhost") +class Test_getnameinfo_127001(TestCase): + + def test(self): + self._test('getnameinfo', ('127.0.0.1', 80), 0) + + def test_DGRAM(self): + self._test('getnameinfo', ('127.0.0.1', 779), 0) + self._test('getnameinfo', ('127.0.0.1', 779), socket.NI_DGRAM) + + def test_NOFQDN(self): + # I get ('localhost', 'www') with _socket but ('localhost.localdomain', 'www') with gevent.socket + self._test('getnameinfo', ('127.0.0.1', 80), socket.NI_NOFQDN) + + def test_NAMEREQD(self): + self._test('getnameinfo', ('127.0.0.1', 80), socket.NI_NAMEREQD) + + +class Test_getnameinfo_geventorg(TestCase): + + def test_NUMERICHOST(self): + self._test('getnameinfo', (TestGeventOrg.HOSTNAME, 80), 0) + self._test('getnameinfo', (TestGeventOrg.HOSTNAME, 80), socket.NI_NUMERICHOST) + + def test_NUMERICSERV(self): + self._test('getnameinfo', (TestGeventOrg.HOSTNAME, 80), socket.NI_NUMERICSERV) + + def test_domain1(self): + self._test('getnameinfo', (TestGeventOrg.HOSTNAME, 80), 0) + + def test_domain2(self): + self._test('getnameinfo', ('www.gevent.org', 80), 0) + + def test_port_zero(self): + self._test('getnameinfo', ('www.gevent.org', 0), 0) + + +class Test_getnameinfo_fail(TestCase): + + def test_port_string(self): + self._test('getnameinfo', ('www.gevent.org', 'http'), 0) + + def test_bad_flags(self): + self._test('getnameinfo', ('localhost', 80), 55555555) + + +class TestInvalidPort(TestCase): + + def test1(self): + self._test('getnameinfo', ('www.gevent.org', -1), 0) + + def test2(self): + self._test('getnameinfo', ('www.gevent.org', None), 0) + + def test3(self): + self._test('getnameinfo', ('www.gevent.org', 'x'), 0) + + @unittest.skipIf(RESOLVER_DNSPYTHON, + "System resolvers do funny things with this: macOS raises gaierror, " + "Travis CI returns (readthedocs.org, '0'). It's hard to match that exactly. " + "dnspython raises OverflowError.") + def test4(self): + self._test('getnameinfo', ('www.gevent.org', 65536), 0) + + +if __name__ == '__main__': + greentest.main() diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__socket_dns6.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__socket_dns6.py new file mode 100644 index 00000000..6a706d8c --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__socket_dns6.py @@ -0,0 +1,81 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- +from __future__ import print_function, absolute_import, division + +import gevent.testing as greentest +import socket +from gevent.tests.test__socket_dns import TestCase, add + +from gevent.testing.sysinfo import RESOLVER_NOT_SYSTEM +from gevent.testing.sysinfo import RESOLVER_DNSPYTHON + +if not greentest.RUNNING_ON_CI and not RESOLVER_DNSPYTHON: + + + # We can't control the DNS servers we use there + # for the system. This works best with the google DNS servers + # The getnameinfo test can fail on CI. + + # Previously only Test6_ds failed, but as of Jan 2018, Test6 + # and Test6_google begin to fail: + + # First differing element 0: + # 'vm2.test-ipv6.com' + # 'ip119.gigo.com' + + # - ('vm2.test-ipv6.com', [], ['2001:470:1:18::125']) + # ? --------- ^^ ^^ + + # + ('ip119.gigo.com', [], ['2001:470:1:18::119']) + # ? ^^^^^^^^ ^^ + + class Test6(TestCase): + + # host that only has AAAA record + host = 'aaaa.test-ipv6.com' + + def test_empty(self): + self._test('getaddrinfo', self.host, 'http') + + def test_inet(self): + self._test('getaddrinfo', self.host, None, socket.AF_INET) + + def test_inet6(self): + self._test('getaddrinfo', self.host, None, socket.AF_INET6) + + def test_unspec(self): + self._test('getaddrinfo', self.host, None, socket.AF_UNSPEC) + + + class Test6_google(Test6): + host = 'ipv6.google.com' + + def _normalize_result_getnameinfo(self, result): + if greentest.RUNNING_ON_CI and RESOLVER_NOT_SYSTEM: + # Disabled, there are multiple possibilities + # and we can get different ones, rarely. + return () + return result + + add(Test6, Test6.host) + add(Test6_google, Test6_google.host) + + + + class Test6_ds(Test6): + # host that has both A and AAAA records + host = 'ds.test-ipv6.com' + + def _normalize_result_gethostbyaddr(self, result): + # This test is effectively disabled. There are multiple address + # that resolve and which ones you get depend on the settings + # of the system and ares. They don't match exactly. + return () + + _normalize_result_gethostbyname = _normalize_result_gethostbyaddr + + add(Test6_ds, Test6_ds.host) + + +if __name__ == '__main__': + greentest.main() diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__socket_errors.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__socket_errors.py new file mode 100644 index 00000000..fec07ddb --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__socket_errors.py @@ -0,0 +1,46 @@ +# Copyright (c) 2008-2009 AG Projects +# Author: Denis Bilenko +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. + +import gevent.testing as greentest +from gevent.socket import socket, error + +try: + from errno import WSAECONNREFUSED as ECONNREFUSED +except ImportError: + from errno import ECONNREFUSED + + +class TestSocketErrors(greentest.TestCase): + + __timeout__ = 5 + + def test_connection_refused(self): + s = socket() + self._close_on_teardown(s) + try: + s.connect(('127.0.0.1', 81)) + except error as ex: + assert ex.args[0] == ECONNREFUSED, repr(ex) + assert 'refused' in str(ex).lower(), str(ex) + + +if __name__ == '__main__': + greentest.main() diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__socket_ex.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__socket_ex.py new file mode 100644 index 00000000..0926ff69 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__socket_ex.py @@ -0,0 +1,43 @@ +import gevent.testing as greentest +from gevent import socket +import errno +import sys + + +class TestClosedSocket(greentest.TestCase): + + switch_expected = False + + def test(self): + sock = socket.socket() + sock.close() + try: + sock.send(b'a', timeout=1) + raise AssertionError("Should not get here") + except (socket.error, OSError) as ex: + if ex.args[0] != errno.EBADF: + if sys.platform.startswith('win'): + # Windows/Py3 raises "OSError: [WinError 10038] " + # which is not standard and not what it does + # on Py2. + pass + else: + raise + + +class TestRef(greentest.TestCase): + + switch_expected = False + + def test(self): + sock = socket.socket() + assert sock.ref is True, sock.ref + sock.ref = False + assert sock.ref is False, sock.ref + assert sock._read_event.ref is False, sock.ref + assert sock._write_event.ref is False, sock.ref + sock.close() + + +if __name__ == '__main__': + greentest.main() diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__socket_send_memoryview.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__socket_send_memoryview.py new file mode 100644 index 00000000..c979fe23 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__socket_send_memoryview.py @@ -0,0 +1,39 @@ +# See issue #466 +import unittest +import ctypes + + +class AnStructure(ctypes.Structure): + _fields_ = [("x", ctypes.c_int)] + + +def _send(socket): + for meth in ('sendall', 'send'): + anStructure = AnStructure() + sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) + sock.connect(('127.0.0.1', 12345)) + getattr(sock, meth)(anStructure) + sock.close() + + sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) + sock.connect(('127.0.0.1', 12345)) + sock.settimeout(1.0) + getattr(sock, meth)(anStructure) + sock.close() + +class TestSendBuiltinSocket(unittest.TestCase): + + def test_send(self): + import socket + _send(socket) + + +class TestSendGeventSocket(unittest.TestCase): + + def test_send(self): + import gevent.socket + _send(gevent.socket) + + +if __name__ == '__main__': + unittest.main() diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__socket_ssl.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__socket_ssl.py new file mode 100644 index 00000000..8f479400 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__socket_ssl.py @@ -0,0 +1,39 @@ +#!/usr/bin/python +from gevent import monkey +monkey.patch_all() + +import unittest +try: + import httplib +except ImportError: + from http import client as httplib +import socket + + +import gevent.testing as greentest + + +@unittest.skipUnless( + hasattr(socket, 'ssl'), + "Needs socket.ssl" +) +class AmazonHTTPSTests(greentest.TestCase): + + __timeout__ = 30 + + def test_amazon_response(self): + conn = httplib.HTTPSConnection('sdb.amazonaws.com') + conn.debuglevel = 1 + conn.request('GET', '/') + conn.getresponse() + + def test_str_and_repr(self): + conn = socket.socket() + conn.connect(('sdb.amazonaws.com', 443)) + ssl_conn = socket.ssl(conn) # pylint:disable=no-member + assert str(ssl_conn) + assert repr(ssl_conn) + + +if __name__ == "__main__": + greentest.main() diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__socket_timeout.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__socket_timeout.py new file mode 100644 index 00000000..f98d1bb4 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__socket_timeout.py @@ -0,0 +1,54 @@ +import gevent +from gevent import socket +import gevent.testing as greentest + + +class Test(greentest.TestCase): + + server = None + acceptor = None + server_port = None + + def _accept(self): + self.server.listen(1) + try: + conn, _ = self.server.accept() + self._close_on_teardown(conn) + except socket.error: + pass + + def setUp(self): + super(Test, self).setUp() + self.server = socket.socket() + self._close_on_teardown(self.server) + self.server.bind(('127.0.0.1', 0)) + self.server_port = self.server.getsockname()[1] + self.acceptor = gevent.spawn(self._accept) + gevent.sleep(0) + + def tearDown(self): + if self.acceptor is not None: + self.acceptor.kill() + self.acceptor = None + if self.server is not None: + self.server.close() + self.server = None + super(Test, self).tearDown() + + def test_timeout(self): + gevent.sleep(0) + sock = socket.socket() + self._close_on_teardown(sock) + sock.connect(('127.0.0.1', self.server_port)) + + sock.settimeout(0.1) + with self.assertRaises(socket.error) as cm: + sock.recv(1024) + + ex = cm.exception + self.assertEqual(ex.args, ('timed out',)) + self.assertEqual(str(ex), 'timed out') + + +if __name__ == '__main__': + greentest.main() diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__socketpair.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__socketpair.py new file mode 100644 index 00000000..308f033c --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__socketpair.py @@ -0,0 +1,35 @@ +from gevent import monkey; monkey.patch_all() +import socket +import unittest + + +class TestSocketpair(unittest.TestCase): + + def test_makefile(self): + msg = b'hello world' + x, y = socket.socketpair() + x.sendall(msg) + x.close() + with y.makefile('rb') as f: + read = f.read() + self.assertEqual(msg, read) + y.close() + + def test_fromfd(self): + msg = b'hello world' + x, y = socket.socketpair() + xx = socket.fromfd(x.fileno(), x.family, socket.SOCK_STREAM) + x.close() + yy = socket.fromfd(y.fileno(), y.family, socket.SOCK_STREAM) + y.close() + + xx.sendall(msg) + xx.close() + with yy.makefile('rb') as f: + read = f.read() + self.assertEqual(msg, read) + yy.close() + + +if __name__ == '__main__': + unittest.main() diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__ssl.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__ssl.py new file mode 100644 index 00000000..e2b4df7c --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__ssl.py @@ -0,0 +1,104 @@ +from gevent import monkey; monkey.patch_all() +import os + +import socket +import gevent.testing as greentest +# Be careful not to have TestTCP as a bare attribute in this module, +# even aliased, to avoid running duplicate tests +import test__socket +import ssl + + +import unittest +from gevent.hub import LoopExit + +class TestSSL(test__socket.TestTCP): + + certfile = os.path.join(os.path.dirname(__file__), 'test_server.crt') + privfile = os.path.join(os.path.dirname(__file__), 'test_server.key') + # Python 2.x has socket.sslerror (which is an alias for + # ssl.SSLError); That's gone in Py3 though. In Python 2, most timeouts are raised + # as SSLError, but Python 3 raises the normal socket.timeout instead. So this has + # the effect of making TIMEOUT_ERROR be SSLError on Py2 and socket.timeout on Py3 + # See https://bugs.python.org/issue10272 + TIMEOUT_ERROR = getattr(socket, 'sslerror', socket.timeout) + + def _setup_listener(self): + listener, raw_listener = ssl_listener(('127.0.0.1', 0), self.privfile, self.certfile) + self._close_on_teardown(raw_listener) + return listener + + def create_connection(self, *args, **kwargs): # pylint:disable=arguments-differ + return ssl.wrap_socket(super(TestSSL, self).create_connection(*args, **kwargs)) + + # The SSL library can take a long time to buffer the large amount of data we're trying + # to send, so we can't compare to the timeout values + _test_sendall_timeout_check_time = False + + # The SSL layer has extra buffering, so test_sendall needs + # to send a very large amount to make it timeout + _test_sendall_data = data_sent = b'hello' * 100000000 + + @greentest.skipOnWindows("Not clear why we're skipping") + def test_ssl_sendall_timeout0(self): + # Issue #317: SSL_WRITE_PENDING in some corner cases + + server_sock = [] + acceptor = test__socket.Thread(target=lambda: server_sock.append(self.listener.accept())) + client = self.create_connection() + client.setblocking(False) + try: + # Python 3 raises ssl.SSLWantWriteError; Python 2 simply *hangs* + # on non-blocking sockets because it's a simple loop around + # send(). Python 2.6 doesn't have SSLWantWriteError + expected = getattr(ssl, 'SSLWantWriteError', ssl.SSLError) + with self.assertRaises(expected): + client.sendall(self._test_sendall_data) + finally: + acceptor.join() + client.close() + server_sock[0][0].close() + + def test_fullduplex(self): + try: + super(TestSSL, self).test_fullduplex() + except LoopExit: + if greentest.LIBUV and greentest.WIN: + # XXX: Unable to duplicate locally + raise unittest.SkipTest("libuv on Windows sometimes raises LoopExit") + raise + + + @greentest.ignores_leakcheck + def test_empty_send(self): + # Issue 719 + # Sending empty bytes with the 'send' method raises + # ssl.SSLEOFError in the stdlib. PyPy 4.0 and CPython 2.6 + # both just raise the superclass, ssl.SSLError. + + # Ignored during leakchecks because the third or fourth iteration of the + # test hangs on CPython 2/posix for some reason, likely due to + # the use of _close_on_teardown keeping something alive longer than intended. + # cf test__makefile_ref + with self.assertRaises(ssl.SSLError): + super(TestSSL, self).test_empty_send() + + @greentest.ignores_leakcheck + def test_sendall_nonblocking(self): + # Override; doesn't work with SSL sockets. + pass + + @greentest.ignores_leakcheck + def test_connect_with_type_flags_ignored(self): + # Override; doesn't work with SSL sockets. + pass + +def ssl_listener(address, private_key, certificate): + raw_listener = socket.socket() + greentest.bind_and_listen(raw_listener, address) + sock = ssl.wrap_socket(raw_listener, private_key, certificate) + return sock, raw_listener + + +if __name__ == '__main__': + greentest.main() diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__subprocess.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__subprocess.py new file mode 100644 index 00000000..da5d2d52 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__subprocess.py @@ -0,0 +1,491 @@ +import sys +import os +import errno +import unittest + +import time +import gc +import tempfile + +import gevent.testing as greentest +import gevent +from gevent.testing import mock +from gevent import subprocess + +if not hasattr(subprocess, 'mswindows'): + # PyPy3, native python subprocess + subprocess.mswindows = False + + +PYPY = hasattr(sys, 'pypy_version_info') +PY3 = sys.version_info[0] >= 3 + + +if subprocess.mswindows: + SETBINARY = 'import msvcrt; msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY);' +else: + SETBINARY = '' + + +python_universal_newlines = hasattr(sys.stdout, 'newlines') +# The stdlib of Python 3 on Windows doesn't properly handle universal newlines +# (it produces broken results compared to Python 2) +# See gevent.subprocess for more details. +python_universal_newlines_broken = PY3 and subprocess.mswindows + + +class Test(greentest.TestCase): + + def setUp(self): + super(Test, self).setUp() + gc.collect() + gc.collect() + + def test_exit(self): + popen = subprocess.Popen([sys.executable, '-c', 'import sys; sys.exit(10)']) + self.assertEqual(popen.wait(), 10) + + def test_wait(self): + popen = subprocess.Popen([sys.executable, '-c', 'import sys; sys.exit(11)']) + gevent.wait([popen]) + self.assertEqual(popen.poll(), 11) + + def test_child_exception(self): + try: + subprocess.Popen(['*']).wait() + except OSError as ex: + assert ex.errno == 2, ex + else: + raise AssertionError('Expected OSError: [Errno 2] No such file or directory') + + def test_leak(self): + num_before = greentest.get_number_open_files() + p = subprocess.Popen([sys.executable, "-c", "print()"], + stdout=subprocess.PIPE) + p.wait() + p.stdout.close() + del p + if PYPY: + gc.collect() + gc.collect() + + num_after = greentest.get_number_open_files() + self.assertEqual(num_before, num_after) + + @greentest.skipOnLibuvOnPyPyOnWin("hangs") + def test_communicate(self): + p = subprocess.Popen([sys.executable, "-W", "ignore", + "-c", + 'import sys,os;' + 'sys.stderr.write("pineapple");' + 'sys.stdout.write(sys.stdin.read())'], + stdin=subprocess.PIPE, + stdout=subprocess.PIPE, + stderr=subprocess.PIPE) + (stdout, stderr) = p.communicate(b"banana") + self.assertEqual(stdout, b"banana") + if sys.executable.endswith('-dbg'): + assert stderr.startswith(b'pineapple') + else: + self.assertEqual(stderr, b"pineapple") + + @greentest.skipIf(subprocess.mswindows, + "Windows does weird things here") + @greentest.skipOnLibuvOnCIOnPyPy("Sometimes segfaults") + def test_communicate_universal(self): + # Native string all the things. See https://github.com/gevent/gevent/issues/1039 + p = subprocess.Popen( + [ + sys.executable, + "-W", "ignore", + "-c", + 'import sys,os;' + 'sys.stderr.write("pineapple\\r\\n\\xff\\xff\\xf2\\xf9\\r\\n");' + 'sys.stdout.write(sys.stdin.read())' + ], + stdin=subprocess.PIPE, + stdout=subprocess.PIPE, + stderr=subprocess.PIPE, + universal_newlines=True) + (stdout, stderr) = p.communicate('banana\r\n\xff\xff\xf2\xf9\r\n') + self.assertIsInstance(stdout, str) + self.assertIsInstance(stderr, str) + self.assertEqual(stdout, + 'banana\n\xff\xff\xf2\xf9\n') + + self.assertEqual(stderr, + 'pineapple\n\xff\xff\xf2\xf9\n') + + @greentest.skipOnLibuvOnPyPyOnWin("hangs") + def test_universal1(self): + p = subprocess.Popen([sys.executable, "-c", + 'import sys,os;' + SETBINARY + + 'sys.stdout.write("line1\\n");' + 'sys.stdout.flush();' + 'sys.stdout.write("line2\\r");' + 'sys.stdout.flush();' + 'sys.stdout.write("line3\\r\\n");' + 'sys.stdout.flush();' + 'sys.stdout.write("line4\\r");' + 'sys.stdout.flush();' + 'sys.stdout.write("\\nline5");' + 'sys.stdout.flush();' + 'sys.stdout.write("\\nline6");'], + stdout=subprocess.PIPE, + universal_newlines=1, + bufsize=1) + try: + stdout = p.stdout.read() + if python_universal_newlines: + # Interpreter with universal newline support + if not python_universal_newlines_broken: + self.assertEqual(stdout, + "line1\nline2\nline3\nline4\nline5\nline6") + else: + # Note the extra newline after line 3 + self.assertEqual(stdout, + 'line1\nline2\nline3\n\nline4\n\nline5\nline6') + else: + # Interpreter without universal newline support + self.assertEqual(stdout, + "line1\nline2\rline3\r\nline4\r\nline5\nline6") + finally: + p.stdout.close() + + @greentest.skipOnLibuvOnPyPyOnWin("hangs") + def test_universal2(self): + p = subprocess.Popen([sys.executable, "-c", + 'import sys,os;' + SETBINARY + + 'sys.stdout.write("line1\\n");' + 'sys.stdout.flush();' + 'sys.stdout.write("line2\\r");' + 'sys.stdout.flush();' + 'sys.stdout.write("line3\\r\\n");' + 'sys.stdout.flush();' + 'sys.stdout.write("line4\\r\\nline5");' + 'sys.stdout.flush();' + 'sys.stdout.write("\\nline6");'], + stdout=subprocess.PIPE, + universal_newlines=1, + bufsize=1) + try: + stdout = p.stdout.read() + if python_universal_newlines: + # Interpreter with universal newline support + if not python_universal_newlines_broken: + self.assertEqual(stdout, + "line1\nline2\nline3\nline4\nline5\nline6") + else: + # Note the extra newline after line 3 + self.assertEqual(stdout, + 'line1\nline2\nline3\n\nline4\n\nline5\nline6') + else: + # Interpreter without universal newline support + self.assertEqual(stdout, + "line1\nline2\rline3\r\nline4\r\nline5\nline6") + finally: + p.stdout.close() + + if sys.platform != 'win32': + + def test_nonblock_removed(self): + # see issue #134 + r, w = os.pipe() + stdin = subprocess.FileObject(r) + p = subprocess.Popen(['grep', 'text'], stdin=stdin) + try: + # Closing one half of the pipe causes Python 3 on OS X to terminate the + # child process; it exits with code 1 and the assert that p.poll is None + # fails. Removing the close lets it pass under both Python 3 and 2.7. + # If subprocess.Popen._remove_nonblock_flag is changed to a noop, then + # the test fails (as expected) even with the close removed + #os.close(w) + time.sleep(0.1) + self.assertEqual(p.poll(), None) + finally: + if p.poll() is None: + p.kill() + stdin.close() + os.close(w) + + def test_issue148(self): + for _ in range(7): + try: + subprocess.Popen('this_name_must_not_exist') + except OSError as ex: + if ex.errno != errno.ENOENT: + raise + else: + raise AssertionError('must fail with ENOENT') + + @greentest.skipOnLibuvOnPyPyOnWin("hangs") + def test_check_output_keyword_error(self): + try: + subprocess.check_output([sys.executable, '-c', 'import sys; sys.exit(44)']) + except subprocess.CalledProcessError as e: # pylint:disable=no-member + self.assertEqual(e.returncode, 44) + else: + raise AssertionError('must fail with CalledProcessError') + + def test_popen_bufsize(self): + # Test that subprocess has unbuffered output by default + # (as the vanilla subprocess module) + if PY3: + # The default changed under python 3. + return + p = subprocess.Popen([sys.executable, '-u', '-c', + 'import sys; sys.stdout.write(sys.stdin.readline())'], + stdin=subprocess.PIPE, stdout=subprocess.PIPE) + p.stdin.write(b'foobar\n') + r = p.stdout.readline() + self.assertEqual(r, b'foobar\n') + + @greentest.ignores_leakcheck + @greentest.skipOnWindows("Not sure why?") + def test_subprocess_in_native_thread(self): + # gevent.subprocess doesn't work from a background + # native thread. See #688 + from gevent import monkey + + # must be a native thread; defend against monkey-patching + ex = [] + Thread = monkey.get_original('threading', 'Thread') + + def fn(): + with self.assertRaises(TypeError) as exc: + gevent.subprocess.Popen('echo 123', shell=True) + raise AssertionError("Should not be able to construct Popen") + ex.append(exc.exception) + + thread = Thread(target=fn) + thread.start() + thread.join() + + self.assertEqual(len(ex), 1) + self.assertTrue(isinstance(ex[0], TypeError), ex) + self.assertEqual(ex[0].args[0], 'child watchers are only available on the default loop') + + + @greentest.skipOnLibuvOnPyPyOnWin("hangs") + def __test_no_output(self, kwargs, kind): + proc = subprocess.Popen([sys.executable, '-c', 'pass'], + stdout=subprocess.PIPE, + **kwargs) + stdout, stderr = proc.communicate() + + self.assertIsInstance(stdout, kind) + self.assertIsNone(stderr) + + @greentest.skipOnLibuvOnCIOnPyPy("Sometimes segfaults; " + "https://travis-ci.org/gevent/gevent/jobs/327357682") + def test_universal_newlines_text_mode_no_output_is_always_str(self): + # If the file is in universal_newlines mode, we should always get a str when + # there is no output. + # https://github.com/gevent/gevent/pull/939 + self.__test_no_output({'universal_newlines': True}, str) + + @greentest.skipIf(sys.version_info[:2] < (3, 6), "Need encoding argument") + def test_encoded_text_mode_no_output_is_str(self): + # If the file is in universal_newlines mode, we should always get a str when + # there is no output. + # https://github.com/gevent/gevent/pull/939 + self.__test_no_output({'encoding': 'utf-8'}, str) + + def test_default_mode_no_output_is_always_str(self): + # If the file is in default mode, we should always get a str when + # there is no output. + # https://github.com/gevent/gevent/pull/939 + self.__test_no_output({}, bytes) + +@greentest.skipOnWindows("Testing POSIX fd closing") +class TestFDs(unittest.TestCase): + + @mock.patch('os.closerange') + @mock.patch('gevent.subprocess._set_inheritable') + @mock.patch('os.close') + def test_close_fds_brute_force(self, close, set_inheritable, closerange): + keep = ( + 4, 5, + # Leave a hole + # 6, + 7, + ) + subprocess.Popen._close_fds_brute_force(keep, None) + + closerange.assert_has_calls([ + mock.call(3, 4), + mock.call(8, subprocess.MAXFD), + ]) + + set_inheritable.assert_has_calls([ + mock.call(4, True), + mock.call(5, True), + ]) + + close.assert_called_once_with(6) + + @mock.patch('gevent.subprocess.Popen._close_fds_brute_force') + @mock.patch('os.listdir') + def test_close_fds_from_path_bad_values(self, listdir, brute_force): + listdir.return_value = 'Not an Integer' + + subprocess.Popen._close_fds_from_path('path', [], 42) + brute_force.assert_called_once_with([], 42) + + @mock.patch('os.listdir') + @mock.patch('os.closerange') + @mock.patch('gevent.subprocess._set_inheritable') + @mock.patch('os.close') + def test_close_fds_from_path(self, close, set_inheritable, closerange, listdir): + keep = ( + 4, 5, + # Leave a hole + # 6, + 7, + ) + listdir.return_value = ['1', '6', '37'] + + subprocess.Popen._close_fds_from_path('path', keep, 5) + + self.assertEqual([], closerange.mock_calls) + + set_inheritable.assert_has_calls([ + mock.call(4, True), + mock.call(7, True), + ]) + + close.assert_has_calls([ + mock.call(6), + mock.call(37), + ]) + + @mock.patch('gevent.subprocess.Popen._close_fds_brute_force') + @mock.patch('os.path.isdir') + def test_close_fds_no_dir(self, isdir, brute_force): + isdir.return_value = False + + subprocess.Popen._close_fds([], 42) + brute_force.assert_called_once_with([], 42) + isdir.assert_has_calls([ + mock.call('/proc/self/fd'), + mock.call('/dev/fd'), + ]) + + @mock.patch('gevent.subprocess.Popen._close_fds_from_path') + @mock.patch('gevent.subprocess.Popen._close_fds_brute_force') + @mock.patch('os.path.isdir') + def test_close_fds_with_dir(self, isdir, brute_force, from_path): + isdir.return_value = True + + subprocess.Popen._close_fds([7], 42) + + self.assertEqual([], brute_force.mock_calls) + from_path.assert_called_once_with('/proc/self/fd', [7], 42) + +class RunFuncTestCase(greentest.TestCase): + # Based on code from python 3.6 + + __timeout__ = greentest.LARGE_TIMEOUT + + def run_python(self, code, **kwargs): + """Run Python code in a subprocess using subprocess.run""" + argv = [sys.executable, "-c", code] + return subprocess.run(argv, **kwargs) + + def test_returncode(self): + # call() function with sequence argument + cp = self.run_python("import sys; sys.exit(47)") + self.assertEqual(cp.returncode, 47) + with self.assertRaises(subprocess.CalledProcessError): # pylint:disable=no-member + cp.check_returncode() + + def test_check(self): + with self.assertRaises(subprocess.CalledProcessError) as c: # pylint:disable=no-member + self.run_python("import sys; sys.exit(47)", check=True) + self.assertEqual(c.exception.returncode, 47) + + def test_check_zero(self): + # check_returncode shouldn't raise when returncode is zero + cp = self.run_python("import sys; sys.exit(0)", check=True) + self.assertEqual(cp.returncode, 0) + + def test_timeout(self): + # run() function with timeout argument; we want to test that the child + # process gets killed when the timeout expires. If the child isn't + # killed, this call will deadlock since subprocess.run waits for the + # child. + with self.assertRaises(subprocess.TimeoutExpired): + self.run_python("while True: pass", timeout=0.0001) + + @greentest.skipOnLibuvOnPyPyOnWin("hangs") + def test_capture_stdout(self): + # capture stdout with zero return code + cp = self.run_python("print('BDFL')", stdout=subprocess.PIPE) + self.assertIn(b'BDFL', cp.stdout) + + @greentest.skipOnLibuvOnPyPyOnWin("hangs") + def test_capture_stderr(self): + cp = self.run_python("import sys; sys.stderr.write('BDFL')", + stderr=subprocess.PIPE) + self.assertIn(b'BDFL', cp.stderr) + + @greentest.skipOnLibuvOnPyPyOnWin("hangs") + def test_check_output_stdin_arg(self): + # run() can be called with stdin set to a file + with tempfile.TemporaryFile() as tf: + tf.write(b'pear') + tf.seek(0) + cp = self.run_python( + "import sys; sys.stdout.write(sys.stdin.read().upper())", + stdin=tf, stdout=subprocess.PIPE) + self.assertIn(b'PEAR', cp.stdout) + + @greentest.skipOnLibuvOnPyPyOnWin("hangs") + def test_check_output_input_arg(self): + # check_output() can be called with input set to a string + cp = self.run_python( + "import sys; sys.stdout.write(sys.stdin.read().upper())", + input=b'pear', stdout=subprocess.PIPE) + self.assertIn(b'PEAR', cp.stdout) + + @greentest.skipOnLibuvOnPyPyOnWin("hangs") + def test_check_output_stdin_with_input_arg(self): + # run() refuses to accept 'stdin' with 'input' + with tempfile.TemporaryFile() as tf: + tf.write(b'pear') + tf.seek(0) + with self.assertRaises(ValueError, + msg="Expected ValueError when stdin and input args supplied.") as c: + self.run_python("print('will not be run')", + stdin=tf, input=b'hare') + self.assertIn('stdin', c.exception.args[0]) + self.assertIn('input', c.exception.args[0]) + + @greentest.skipOnLibuvOnPyPyOnWin("hangs") + def test_check_output_timeout(self): + with self.assertRaises(subprocess.TimeoutExpired) as c: + self.run_python( + ( + "import sys, time\n" + "sys.stdout.write('BDFL')\n" + "sys.stdout.flush()\n" + "time.sleep(3600)" + ), + # Some heavily loaded buildbots (sparc Debian 3.x) require + # this much time to start and print. + timeout=3, stdout=subprocess.PIPE) + self.assertEqual(c.exception.output, b'BDFL') + # output is aliased to stdout + self.assertEqual(c.exception.stdout, b'BDFL') + + def test_run_kwargs(self): + newenv = os.environ.copy() + newenv["FRUIT"] = "banana" + cp = self.run_python(('import sys, os;' + 'sys.exit(33 if os.getenv("FRUIT")=="banana" else 31)'), + env=newenv) + self.assertEqual(cp.returncode, 33) + + +if __name__ == '__main__': + greentest.main() diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__subprocess_interrupted.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__subprocess_interrupted.py new file mode 100644 index 00000000..ec27b0e9 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__subprocess_interrupted.py @@ -0,0 +1,20 @@ +import sys + +if 'runtestcase' in sys.argv[1:]: # pragma: no cover + import gevent + import gevent.subprocess + gevent.spawn(sys.exit, 'bye') + # Look closely, this doesn't actually do anything, that's a string + # not a division + gevent.subprocess.Popen([sys.executable, '-c', '"1/0"']) + gevent.sleep(1) +else: + import subprocess + for _ in range(5): + out, err = subprocess.Popen([sys.executable, '-W', 'ignore', + __file__, 'runtestcase'], + stderr=subprocess.PIPE).communicate() + if b'refs' in err: # Something to do with debug mode python builds? + assert err.startswith(b'bye'), repr(err) # pragma: no cover + else: + assert err.strip() == b'bye', repr(err) diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__subprocess_poll.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__subprocess_poll.py new file mode 100644 index 00000000..e817dff0 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__subprocess_poll.py @@ -0,0 +1,9 @@ +import sys +from gevent.subprocess import Popen +from gevent.testing.util import alarm + +alarm(3) + +popen = Popen([sys.executable, '-c', 'pass']) +while popen.poll() is None: + pass diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__systemerror.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__systemerror.py new file mode 100644 index 00000000..7101509c --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__systemerror.py @@ -0,0 +1,108 @@ +import sys +import gevent.testing as greentest +import gevent +from gevent.hub import get_hub + +def raise_(ex): + raise ex + + +MSG = 'should be re-raised and caught' + + +class Test(greentest.TestCase): + x = None + error_fatal = False + + def start(self, *args): + raise NotImplementedError + + def setUp(self): + self.x = None + + def test_sys_exit(self): + self.start(sys.exit, MSG) + + try: + gevent.sleep(0.001) + except SystemExit as ex: + assert str(ex) == MSG, repr(str(ex)) + else: + raise AssertionError('must raise SystemExit') + + def test_keyboard_interrupt(self): + self.start(raise_, KeyboardInterrupt) + + try: + gevent.sleep(0.001) + except KeyboardInterrupt: + pass + else: + raise AssertionError('must raise KeyboardInterrupt') + + def test_keyboard_interrupt_stderr_patched(self): + from gevent import monkey + monkey.patch_sys(stdin=False, stdout=False, stderr=True) + try: + try: + self.start(raise_, KeyboardInterrupt) + while True: + gevent.sleep(0.1) + except KeyboardInterrupt: + pass # expected + finally: + sys.stderr = monkey.get_original('sys', 'stderr') + + def test_system_error(self): + self.start(raise_, SystemError(MSG)) + + with self.assertRaisesRegex(SystemError, + MSG): + gevent.sleep(0.002) + + def test_exception(self): + self.start(raise_, Exception('regular exception must not kill the program')) + gevent.sleep(0.001) + + +class TestCallback(Test): + + def tearDown(self): + if self.x is not None: + # libuv: See the notes in libuv/loop.py:loop._start_callback_timer + # If that's broken, test_exception can fail sporadically. + # If the issue is the same, then adding `gevent.sleep(0)` here + # will solve it. There's also a race condition for the first loop, + # so we sleep twice. + assert not self.x.pending, self.x + + def start(self, *args): + self.x = get_hub().loop.run_callback(*args) + + if greentest.LIBUV: + def test_exception(self): + # This call will enter the loop for the very first time (if we're running + # standalone). On libuv, where timers run first, that means that depending on the + # amount of time that elapses between the call to uv_timer_start and uv_run, + # this timer might fire before our check or prepare watchers, and hence callbacks, + # run. + # We make this call now so that the call in the super class is guaranteed to be + # somewhere in the loop and not subject to that race condition. + gevent.sleep(0.001) + super(TestCallback, self).test_exception() + +class TestSpawn(Test): + + def tearDown(self): + gevent.sleep(0.0001) + if self.x is not None: + assert self.x.dead, self.x + + def start(self, *args): + self.x = gevent.spawn(*args) + + +del Test + +if __name__ == '__main__': + greentest.main() diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__threading.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__threading.py new file mode 100644 index 00000000..0a591fc6 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__threading.py @@ -0,0 +1,50 @@ +from gevent import monkey; monkey.patch_all() +import gevent.hub + +# check that the locks initialized by 'threading' did not init the hub +assert gevent.hub._get_hub() is None, 'monkey.patch_all() should not init hub' + +import gevent +import gevent.testing as greentest +import threading + + +def helper(): + threading.currentThread() + gevent.sleep(0.2) + + +class Test(greentest.TestCase): + + def _do_test(self, spawn): + before = len(threading._active) + g = spawn(helper) + gevent.sleep(0.1) + self.assertEqual(len(threading._active), before + 1) + try: + g.join() + except AttributeError: + while not g.dead: + gevent.sleep() + # Raw greenlet has no join(), uses a weakref to cleanup. + # so the greenlet has to die. On CPython, it's enough to + # simply delete our reference. + del g + # On PyPy, it might take a GC, but for some reason, even + # running several GC's doesn't clean it up under 5.6.0. + # So we skip the test. + #import gc + #gc.collect() + + self.assertEqual(len(threading._active), before) + + + def test_cleanup_gevent(self): + self._do_test(gevent.spawn) + + @greentest.skipOnPyPy("weakref is not cleaned up in a timely fashion") + def test_cleanup_raw(self): + self._do_test(gevent.spawn_raw) + +if __name__ == '__main__': + greentest.main() diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__threading_2.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__threading_2.py new file mode 100644 index 00000000..b425c88a --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__threading_2.py @@ -0,0 +1,610 @@ +# testing gevent's Event, Lock, RLock, Semaphore, BoundedSemaphore with standard test_threading +from __future__ import print_function + +from gevent.testing.six import xrange +import gevent.testing as greentest + +setup_ = '''from gevent import monkey; monkey.patch_all() +from gevent.event import Event +from gevent.lock import RLock, Semaphore, BoundedSemaphore +from gevent.thread import allocate_lock as Lock +import threading +threading.Event = Event +threading.Lock = Lock +# NOTE: We're completely patching around the allocate_lock +# patch we try to do with RLock; our monkey patch doesn't +# behave this way, but we do it in tests to make sure that +# our RLock implementation behaves correctly by itself. +# However, we must test the patched version too, so make it +# available. +threading.NativeRLock = threading.RLock +threading.RLock = RLock +threading.Semaphore = Semaphore +threading.BoundedSemaphore = BoundedSemaphore +''' + +exec(setup_) + +setup_3 = '\n'.join(' %s' % line for line in setup_.split('\n')) +setup_4 = '\n'.join(' %s' % line for line in setup_.split('\n')) + + +try: + from test.support import verbose +except ImportError: + from test.test_support import verbose +import random +import re +import sys +import threading +try: + import thread +except ImportError: + import _thread as thread +import time +import unittest +import weakref + +from gevent.tests import lock_tests + +# A trivial mutable counter. + +def skipDueToHang(cls): + return unittest.skipIf( + greentest.PYPY3 and greentest.RUNNING_ON_CI, + "SKIPPED: Timeout on PyPy3 on Travis" + )(cls) + +class Counter(object): + def __init__(self): + self.value = 0 + + def inc(self): + self.value += 1 + + def dec(self): + self.value -= 1 + + def get(self): + return self.value + + +class TestThread(threading.Thread): + def __init__(self, name, testcase, sema, mutex, nrunning): + threading.Thread.__init__(self, name=name) + self.testcase = testcase + self.sema = sema + self.mutex = mutex + self.nrunning = nrunning + + def run(self): + delay = random.random() / 10000.0 + if verbose: + print('task %s will run for %.1f usec' % ( + self.name, delay * 1e6)) + + with self.sema: + with self.mutex: + self.nrunning.inc() + if verbose: + print(self.nrunning.get(), 'tasks are running') + self.testcase.assertLessEqual(self.nrunning.get(), 3) + + time.sleep(delay) + if verbose: + print('task', self.name, 'done') + + with self.mutex: + self.nrunning.dec() + self.testcase.assertGreaterEqual(self.nrunning.get(), 0) + if verbose: + print('%s is finished. %d tasks are running' % ( + self.name, self.nrunning.get())) + +@skipDueToHang +class ThreadTests(unittest.TestCase): + + # Create a bunch of threads, let each do some work, wait until all are + # done. + def test_various_ops(self): + # This takes about n/3 seconds to run (about n/3 clumps of tasks, + # times about 1 second per clump). + NUMTASKS = 10 + + # no more than 3 of the 10 can run at once + sema = threading.BoundedSemaphore(value=3) + mutex = threading.RLock() + numrunning = Counter() + + threads = [] + + for i in range(NUMTASKS): + t = TestThread("" % i, self, sema, mutex, numrunning) + threads.append(t) + t.daemon = False # Under PYPY we get daemon by default? + if hasattr(t, 'ident'): + self.assertIsNone(t.ident) + self.assertFalse(t.daemon) + self.assertTrue(re.match(r'', repr(t))) + t.start() + + if verbose: + print('waiting for all tasks to complete') + for t in threads: + t.join(NUMTASKS) + self.assertFalse(t.is_alive()) + if hasattr(t, 'ident'): + self.assertNotEqual(t.ident, 0) + self.assertFalse(t.ident is None) + self.assertTrue(re.match(r'', repr(t))) + if verbose: + print('all tasks done') + self.assertEqual(numrunning.get(), 0) + + def test_ident_of_no_threading_threads(self): + # The ident still must work for the main thread and dummy threads, + # as must the repr and str. + + t = threading.currentThread() + self.assertFalse(t.ident is None) + str(t) + repr(t) + + def f(): + t = threading.currentThread() + ident.append(t.ident) + str(t) + repr(t) + done.set() + + done = threading.Event() + ident = [] + thread.start_new_thread(f, ()) + done.wait() + self.assertFalse(ident[0] is None) + # Kill the "immortal" _DummyThread + del threading._active[ident[0]] + + # run with a small(ish) thread stack size (256kB) + def test_various_ops_small_stack(self): + if verbose: + print('with 256kB thread stack size...') + try: + threading.stack_size(262144) + except thread.error: + if verbose: + print('platform does not support changing thread stack size') + return + self.test_various_ops() + threading.stack_size(0) + + # run with a large thread stack size (1MB) + def test_various_ops_large_stack(self): + if verbose: + print('with 1MB thread stack size...') + try: + threading.stack_size(0x100000) + except thread.error: + if verbose: + print('platform does not support changing thread stack size') + return + self.test_various_ops() + threading.stack_size(0) + + def test_foreign_thread(self): + # Check that a "foreign" thread can use the threading module. + def f(mutex): + # Calling current_thread() forces an entry for the foreign + # thread to get made in the threading._active map. + threading.current_thread() + mutex.release() + + mutex = threading.Lock() + mutex.acquire() + tid = thread.start_new_thread(f, (mutex,)) + # Wait for the thread to finish. + mutex.acquire() + self.assertIn(tid, threading._active) + self.assertIsInstance(threading._active[tid], + threading._DummyThread) + del threading._active[tid] + # in gevent, we actually clean up threading._active, but it's not happended there yet + + # PyThreadState_SetAsyncExc() is a CPython-only gimmick, not (currently) + # exposed at the Python level. This test relies on ctypes to get at it. + def SKIP_test_PyThreadState_SetAsyncExc(self): + try: + import ctypes + except ImportError: + if verbose: + print("test_PyThreadState_SetAsyncExc can't import ctypes") + return # can't do anything + + set_async_exc = ctypes.pythonapi.PyThreadState_SetAsyncExc + + class AsyncExc(Exception): + pass + + exception = ctypes.py_object(AsyncExc) + + # `worker_started` is set by the thread when it's inside a try/except + # block waiting to catch the asynchronously set AsyncExc exception. + # `worker_saw_exception` is set by the thread upon catching that + # exception. + worker_started = threading.Event() + worker_saw_exception = threading.Event() + + class Worker(threading.Thread): + id = None + finished = False + + def run(self): + self.id = thread.get_ident() + self.finished = False + + try: + while True: + worker_started.set() + time.sleep(0.1) + except AsyncExc: + self.finished = True + worker_saw_exception.set() + + t = Worker() + t.daemon = True # so if this fails, we don't hang Python at shutdown + t.start() + if verbose: + print(" started worker thread") + + # Try a thread id that doesn't make sense. + if verbose: + print(" trying nonsensical thread id") + result = set_async_exc(ctypes.c_long(-1), exception) + self.assertEqual(result, 0) # no thread states modified + + # Now raise an exception in the worker thread. + if verbose: + print(" waiting for worker thread to get started") + worker_started.wait() + if verbose: + print(" verifying worker hasn't exited") + self.assertFalse(t.finished) + if verbose: + print(" attempting to raise asynch exception in worker") + result = set_async_exc(ctypes.c_long(t.id), exception) + self.assertEqual(result, 1) # one thread state modified + if verbose: + print(" waiting for worker to say it caught the exception") + worker_saw_exception.wait(timeout=10) + self.assertTrue(t.finished) + if verbose: + print(" all OK -- joining worker") + if t.finished: + t.join() + # else the thread is still running, and we have no way to kill it + + def test_limbo_cleanup(self): + # Issue 7481: Failure to start thread should cleanup the limbo map. + def fail_new_thread(*_args): + raise thread.error() + _start_new_thread = threading._start_new_thread + threading._start_new_thread = fail_new_thread + try: + t = threading.Thread(target=lambda: None) + self.assertRaises(thread.error, t.start) + self.assertFalse( + t in threading._limbo, + "Failed to cleanup _limbo map on failure of Thread.start().") + finally: + threading._start_new_thread = _start_new_thread + + def test_finalize_runnning_thread(self): + # Issue 1402: the PyGILState_Ensure / _Release functions may be called + # very late on python exit: on deallocation of a running thread for + # example. + try: + import ctypes + getattr(ctypes, 'pythonapi') # not available on PyPy + getattr(ctypes.pythonapi, 'PyGILState_Ensure') # not available on PyPy3 + except (ImportError, AttributeError): + if verbose: + print("test_finalize_with_runnning_thread can't import ctypes") + return # can't do anything + + del ctypes # pyflakes fix + + import subprocess + rc = subprocess.call([sys.executable, "-W", "ignore", "-c", """if 1: +%s + import ctypes, sys, time + try: + import thread + except ImportError: + import _thread as thread # Py3 + + # This lock is used as a simple event variable. + ready = thread.allocate_lock() + ready.acquire() + + # Module globals are cleared before __del__ is run + # So we save the functions in class dict + class C: + ensure = ctypes.pythonapi.PyGILState_Ensure + release = ctypes.pythonapi.PyGILState_Release + def __del__(self): + state = self.ensure() + self.release(state) + + def waitingThread(): + x = C() + ready.release() + time.sleep(100) + + thread.start_new_thread(waitingThread, ()) + ready.acquire() # Be sure the other thread is waiting. + sys.exit(42) + """ % setup_3]) + self.assertEqual(rc, 42) + + @greentest.skipOnLibuvOnPyPyOnWin("hangs") + def test_join_nondaemon_on_shutdown(self): + # Issue 1722344 + # Raising SystemExit skipped threading._shutdown + import subprocess + p = subprocess.Popen([sys.executable, "-W", "ignore", "-c", """if 1: +%s + import threading + from time import sleep + + def child(): + sleep(1) + # As a non-daemon thread we SHOULD wake up and nothing + # should be torn down yet + print("Woke up, sleep function is: %%r" %% sleep) + + threading.Thread(target=child).start() + raise SystemExit + """ % setup_4], + stdout=subprocess.PIPE, + stderr=subprocess.PIPE) + stdout, stderr = p.communicate() + stdout = stdout.strip() + stdout = stdout.decode('utf-8') + stderr = stderr.decode('utf-8') + assert re.match('^Woke up, sleep function is: <.*?sleep.*?>$', stdout), repr(stdout) + stderr = re.sub(r"^\[\d+ refs\]", "", stderr, re.MULTILINE).strip() + # On Python 2, importing pkg_resources tends to result in some 'ImportWarning' + # being printed to stderr about packages missing __init__.py; the -W ignore is... + # ignored. + # self.assertEqual(stderr, "") + + def test_enumerate_after_join(self): + # Try hard to trigger #1703448: a thread is still returned in + # threading.enumerate() after it has been join()ed. + enum = threading.enumerate + import warnings + with warnings.catch_warnings(): + warnings.simplefilter('ignore', DeprecationWarning) + # get/set checkinterval are deprecated in Python 3 + old_interval = sys.getcheckinterval() + try: + for i in xrange(1, 100): + # Try a couple times at each thread-switching interval + # to get more interleavings. + sys.setcheckinterval(i // 5) + t = threading.Thread(target=lambda: None) + t.start() + t.join() + l = enum() + self.assertFalse(t in l, + "#1703448 triggered after %d trials: %s" % (i, l)) + finally: + sys.setcheckinterval(old_interval) + + if not hasattr(sys, 'pypy_version_info'): + def test_no_refcycle_through_target(self): + class RunSelfFunction(object): + def __init__(self, should_raise): + # The links in this refcycle from Thread back to self + # should be cleaned up when the thread completes. + self.should_raise = should_raise + self.thread = threading.Thread(target=self._run, + args=(self,), + kwargs={'yet_another': self}) + self.thread.start() + + def _run(self, _other_ref, _yet_another): + if self.should_raise: + raise SystemExit + + cyclic_object = RunSelfFunction(should_raise=False) + weak_cyclic_object = weakref.ref(cyclic_object) + cyclic_object.thread.join() + del cyclic_object + self.assertIsNone(weak_cyclic_object(), + msg=('%d references still around' % + sys.getrefcount(weak_cyclic_object()))) + + raising_cyclic_object = RunSelfFunction(should_raise=True) + weak_raising_cyclic_object = weakref.ref(raising_cyclic_object) + raising_cyclic_object.thread.join() + del raising_cyclic_object + self.assertIsNone(weak_raising_cyclic_object(), + msg=('%d references still around' % + sys.getrefcount(weak_raising_cyclic_object()))) + +@skipDueToHang +class ThreadJoinOnShutdown(unittest.TestCase): + + def _run_and_join(self, script): + script = """if 1: +%s + import sys, os, time, threading + # a thread, which waits for the main program to terminate + def joiningfunc(mainthread): + mainthread.join() + print('end of thread') + \n""" % setup_3 + script + + import subprocess + p = subprocess.Popen([sys.executable, "-W", "ignore", "-c", script], stdout=subprocess.PIPE) + rc = p.wait() + data = p.stdout.read().replace(b'\r', b'') + p.stdout.close() + self.assertEqual(data, b"end of main\nend of thread\n") + self.assertNotEqual(rc, 2, b"interpreter was blocked") + self.assertEqual(rc, 0, b"Unexpected error") + + @greentest.skipOnLibuvOnPyPyOnWin("hangs") + def test_1_join_on_shutdown(self): + # The usual case: on exit, wait for a non-daemon thread + script = """if 1: + import os + t = threading.Thread(target=joiningfunc, + args=(threading.current_thread(),)) + t.start() + time.sleep(0.1) + print('end of main') + """ + self._run_and_join(script) + + @greentest.skipOnPyPy3OnCI("Sometimes randomly times out") + def test_2_join_in_forked_process(self): + # Like the test above, but from a forked interpreter + import os + if not hasattr(os, 'fork'): + return + script = """if 1: + childpid = os.fork() + if childpid != 0: + os.waitpid(childpid, 0) + sys.exit(0) + + t = threading.Thread(target=joiningfunc, + args=(threading.current_thread(),)) + t.start() + print('end of main') + """ + self._run_and_join(script) + + def test_3_join_in_forked_from_thread(self): + # Like the test above, but fork() was called from a worker thread + # In the forked process, the main Thread object must be marked as stopped. + import os + if not hasattr(os, 'fork'): + return + # Skip platforms with known problems forking from a worker thread. + # See http://bugs.python.org/issue3863. + # skip disable because I think the bug shouldn't apply to gevent -- denis + #if sys.platform in ('freebsd4', 'freebsd5', 'freebsd6', 'os2emx'): + # print(('Skipping test_3_join_in_forked_from_thread' + # ' due to known OS bugs on'), sys.platform, file=sys.stderr) + # return + + # A note on CFFI: Under Python 3, using CFFI tends to initialize the GIL, + # whether or not we spawn any actual threads. Now, os.fork() calls + # PyEval_ReInitThreads, which only does any work of the GIL has been taken. + # One of the things it does is call threading._after_fork to reset + # some thread state, which causes the main thread (threading._main_thread) + # to be reset to the current thread---which for Python >= 3.4 happens + # to be our version of thread, gevent.threading.Thread, which doesn't + # initialize the _tstate_lock ivar. This causes threading._shutdown to crash + # with an AssertionError and this test to fail. We hack around this by + # making sure _after_fork is not called in the child process. + # XXX: Figure out how to really fix that. + + script = """if 1: + main_thread = threading.current_thread() + def worker(): + threading._after_fork = lambda: None + childpid = os.fork() + if childpid != 0: + os.waitpid(childpid, 0) + sys.exit(0) + + t = threading.Thread(target=joiningfunc, + args=(main_thread,)) + print('end of main') + t.start() + t.join() # Should not block: main_thread is already stopped + + w = threading.Thread(target=worker) + w.start() + import sys + if sys.version_info[:2] >= (3, 7) or (sys.version_info[:2] >= (3, 5) and hasattr(sys, 'pypy_version_info') and sys.platform != 'darwin'): + w.join() + """ + # In PyPy3 5.8.0, if we don't wait on this top-level "thread", 'w', + # we never see "end of thread". It's not clear why, since that's being + # done in a child of this process. Yet in normal CPython 3, waiting on this + # causes the whole process to lock up (possibly because of some loop within + # the interpreter waiting on thread locks, like the issue described in threading.py + # for Python 3.4? in any case, it doesn't hang in Python 2.) This changed in + # 3.7a1 and waiting on it is again necessary and doesn't hang. + # PyPy3 5.10.1 is back to the "old" cpython behaviour, and waiting on it + # causes the whole process to hang, but apparently only on OS X---linux was fine without it + self._run_and_join(script) + + +@skipDueToHang +class ThreadingExceptionTests(unittest.TestCase): + # A RuntimeError should be raised if Thread.start() is called + # multiple times. + # pylint:disable=bad-thread-instantiation + def test_start_thread_again(self): + thread_ = threading.Thread() + thread_.start() + self.assertRaises(RuntimeError, thread_.start) + + def test_joining_current_thread(self): + current_thread = threading.current_thread() + self.assertRaises(RuntimeError, current_thread.join) + + def test_joining_inactive_thread(self): + thread_ = threading.Thread() + self.assertRaises(RuntimeError, thread_.join) + + def test_daemonize_active_thread(self): + thread_ = threading.Thread() + thread_.start() + self.assertRaises(RuntimeError, setattr, thread_, "daemon", True) + + +@skipDueToHang +class LockTests(lock_tests.LockTests): + locktype = staticmethod(threading.Lock) + +@skipDueToHang +class RLockTests(lock_tests.RLockTests): + locktype = staticmethod(threading.RLock) + +@skipDueToHang +class NativeRLockTests(lock_tests.RLockTests): + # See comments at the top of the file for the difference + # between this and RLockTests, and why they both matter + locktype = staticmethod(threading.NativeRLock) + +@skipDueToHang +class EventTests(lock_tests.EventTests): + eventtype = staticmethod(threading.Event) + +@skipDueToHang +class ConditionAsRLockTests(lock_tests.RLockTests): + # An Condition uses an RLock by default and exports its API. + locktype = staticmethod(threading.Condition) + +@skipDueToHang +class ConditionTests(lock_tests.ConditionTests): + condtype = staticmethod(threading.Condition) + +@skipDueToHang +class SemaphoreTests(lock_tests.SemaphoreTests): + semtype = staticmethod(threading.Semaphore) + +@skipDueToHang +class BoundedSemaphoreTests(lock_tests.BoundedSemaphoreTests): + semtype = staticmethod(threading.BoundedSemaphore) + + +if __name__ == "__main__": + greentest.main() diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__threading_before_monkey.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__threading_before_monkey.py new file mode 100644 index 00000000..b60fb307 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__threading_before_monkey.py @@ -0,0 +1,23 @@ +# If stdlib threading is imported *BEFORE* monkey patching, +# we can still get the current (main) thread, and it's not a DummyThread. + +import threading +from gevent import monkey +monkey.patch_all() + +import gevent.testing as greentest + + +class Test(greentest.TestCase): + + def test_main_thread(self): + current = threading.current_thread() + self.assertFalse(isinstance(current, threading._DummyThread)) + self.assertTrue(isinstance(current, monkey.get_original('threading', 'Thread'))) + # in 3.4, if the patch is incorrectly done, getting the repr + # of the thread fails + repr(current) + + +if __name__ == '__main__': + greentest.main() diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__threading_holding_lock_while_monkey.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__threading_holding_lock_while_monkey.py new file mode 100644 index 00000000..c5aed4a2 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__threading_holding_lock_while_monkey.py @@ -0,0 +1,8 @@ +from gevent import monkey +import threading +# Make sure that we can patch gevent while holding +# a threading lock. Under Python2, where RLock is implemented +# in python code, this used to throw RuntimeErro("Cannot release un-acquired lock") +# See https://github.com/gevent/gevent/issues/615 +with threading.RLock(): + monkey.patch_all() diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__threading_monkey_in_thread.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__threading_monkey_in_thread.py new file mode 100644 index 00000000..f3ff73d1 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__threading_monkey_in_thread.py @@ -0,0 +1,65 @@ +# We can monkey-patch in a thread, but things don't work as expected. +from __future__ import print_function +import sys +import threading +from gevent import monkey +import gevent.testing as greentest + + +class Test(greentest.TestCase): + + @greentest.ignores_leakcheck # can't be run multiple times + def test_patch_in_thread(self): + all_warnings = [] + try: + get_ident = threading.get_ident + except AttributeError: + get_ident = threading._get_ident + + def process_warnings(warnings): + all_warnings.extend(warnings) + monkey._process_warnings = process_warnings + + current = threading.current_thread() + current_id = get_ident() + + def target(): + tcurrent = threading.current_thread() + monkey.patch_all() + tcurrent2 = threading.current_thread() + self.assertIsNot(tcurrent, current) + # We get a dummy thread now + self.assertIsNot(tcurrent, tcurrent2) + + thread = threading.Thread(target=target) + thread.start() + try: + thread.join() + except: # pylint:disable=bare-except + # XXX: This can raise LoopExit in some cases. + greentest.reraiseFlakyTestRaceCondition() + + self.assertNotIsInstance(current, threading._DummyThread) + self.assertIsInstance(current, monkey.get_original('threading', 'Thread')) + + + # We generated some warnings + if sys.version_info >= (3, 4): + self.assertEqual(all_warnings, + ['Monkey-patching outside the main native thread. Some APIs will not be ' + 'available. Expect a KeyError to be printed at shutdown.', + 'Monkey-patching not on the main thread; threading.main_thread().join() ' + 'will hang from a greenlet']) + else: + self.assertEqual(all_warnings, + ['Monkey-patching outside the main native thread. Some APIs will not be ' + 'available. Expect a KeyError to be printed at shutdown.']) + + + # Manual clean up so we don't get a KeyError + del threading._active[current_id] + threading._active[(getattr(threading, 'get_ident', None) or threading._get_ident)()] = current + + +if __name__ == '__main__': + greentest.main() diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__threading_native_before_monkey.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__threading_native_before_monkey.py new file mode 100644 index 00000000..dd29ab6b --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__threading_native_before_monkey.py @@ -0,0 +1,57 @@ +# If stdlib threading is imported *BEFORE* monkey patching, *and* +# there is a native thread created, we can still get the current +# (main) thread, and it's not a DummyThread. +# Joining the native thread also does not fail + +import threading +from time import sleep as time_sleep + +import gevent.testing as greentest + +class NativeThread(threading.Thread): + do_run = True + + def run(self): + while self.do_run: + time_sleep(0.1) + + def stop(self, timeout=None): + self.do_run = False + self.join(timeout=timeout) + +native_thread = None + +class Test(greentest.TestCase): + + def test_main_thread(self): + current = threading.current_thread() + self.assertFalse(isinstance(current, threading._DummyThread)) + self.assertTrue(isinstance(current, monkey.get_original('threading', 'Thread'))) + # in 3.4, if the patch is incorrectly done, getting the repr + # of the thread fails + repr(current) + + if hasattr(threading, 'main_thread'): # py 3.4 + self.assertEqual(threading.current_thread(), threading.main_thread()) + + @greentest.ignores_leakcheck # because it can't be run multiple times + def test_join_native_thread(self): + self.assertTrue(native_thread.is_alive()) + + native_thread.stop(timeout=1) + self.assertFalse(native_thread.is_alive()) + + # again, idempotent + native_thread.stop() + self.assertFalse(native_thread.is_alive()) + + +if __name__ == '__main__': + native_thread = NativeThread() + native_thread.start() + + # Only patch after we're running + from gevent import monkey + monkey.patch_all() + + greentest.main() diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__threading_patched_local.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__threading_patched_local.py new file mode 100644 index 00000000..5ff33528 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__threading_patched_local.py @@ -0,0 +1,24 @@ +from gevent import monkey; monkey.patch_all() +import threading + + +localdata = threading.local() +localdata.x = "hello" +assert localdata.x == 'hello' +success = [] + + +def func(): + try: + getattr(localdata, 'x') + raise AssertionError('localdata.x must raise AttributeError') + except AttributeError: + pass + assert localdata.__dict__ == {}, localdata.__dict__ + success.append(1) + +t = threading.Thread(None, func) +t.start() +t.join() +assert success == [1], 'test failed' +assert localdata.x == 'hello' diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__threading_vs_settrace.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__threading_vs_settrace.py new file mode 100644 index 00000000..43248294 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__threading_vs_settrace.py @@ -0,0 +1,163 @@ +from __future__ import print_function +import sys +import subprocess +import unittest +from gevent.thread import allocate_lock +import gevent.testing as greentest + +script = """ +from gevent import monkey +monkey.patch_all() +import sys, os, threading, time + + +# A deadlock-killer, to prevent the +# testsuite to hang forever +def killer(): + time.sleep(0.1) + sys.stdout.write('..program blocked; aborting!') + sys.stdout.flush() + os._exit(2) +t = threading.Thread(target=killer) +t.daemon = True +t.start() + + +def trace(frame, event, arg): + if threading is not None: + threading.currentThread() + return trace + + +def doit(): + sys.stdout.write("..thread started..") + + +def test1(): + t = threading.Thread(target=doit) + t.start() + t.join() + sys.settrace(None) + +sys.settrace(trace) +if len(sys.argv) > 1: + test1() + +sys.stdout.write("..finishing..") +""" + + +class TestTrace(unittest.TestCase): + @greentest.skipOnPurePython("Locks can be traced in Pure Python") + def test_untraceable_lock(self): + # Untraceable locks were part of the solution to https://bugs.python.org/issue1733757 + # which details a deadlock that could happen if a trace function invoked + # threading.currentThread at shutdown time---the cleanup lock would be held + # by the VM, and calling currentThread would try to acquire it again. The interpreter + # changed in 2.6 to use the `with` statement (https://hg.python.org/cpython/rev/76f577a9ec03/), + # which apparently doesn't trace in quite the same way. + if hasattr(sys, 'gettrace'): + old = sys.gettrace() + else: + old = None + + lst = [] + try: + def trace(frame, ev, _arg): + lst.append((frame.f_code.co_filename, frame.f_lineno, ev)) + print("TRACE: %s:%s %s" % lst[-1]) + return trace + + with allocate_lock(): + sys.settrace(trace) + finally: + sys.settrace(old) + + self.assertEqual(lst, [], "trace not empty") + + @greentest.skipOnPurePython("Locks can be traced in Pure Python") + def test_untraceable_lock_uses_different_lock(self): + if hasattr(sys, 'gettrace'): + old = sys.gettrace() + else: + old = None + + PY3 = sys.version_info[0] > 2 + lst = [] + # we should be able to use unrelated locks from within the trace function + l = allocate_lock() + try: + def trace(frame, ev, _arg): + with l: + lst.append((frame.f_code.co_filename, frame.f_lineno, ev)) + print("TRACE: %s:%s %s" % lst[-1]) + return trace + + l2 = allocate_lock() + sys.settrace(trace) + # Separate functions, not the C-implemented `with` so the trace + # function gets a crack at them + l2.acquire() + l2.release() + finally: + sys.settrace(old) + + if not PY3: + # Py3 overrides acquire in Python to do argument checking + self.assertEqual(lst, [], "trace not empty") + else: + # Have an assert so that we know if we miscompile + self.assertTrue(lst, "should not compile on pypy") + + @greentest.skipOnPurePython("Locks can be traced in Pure Python") + def test_untraceable_lock_uses_same_lock(self): + from gevent.hub import LoopExit + if hasattr(sys, 'gettrace'): + old = sys.gettrace() + else: + old = None + PY3 = sys.version_info[0] > 2 + lst = [] + e = None + # we should not be able to use the same lock from within the trace function + # because it's over acquired but instead of deadlocking it raises an exception + l = allocate_lock() + try: + def trace(frame, ev, _arg): + with l: + lst.append((frame.f_code.co_filename, frame.f_lineno, ev)) + return trace + + sys.settrace(trace) + # Separate functions, not the C-implemented `with` so the trace + # function gets a crack at them + l.acquire() + except LoopExit as ex: + e = ex + finally: + sys.settrace(old) + + if not PY3: + # Py3 overrides acquire in Python to do argument checking + self.assertEqual(lst, [], "trace not empty") + else: + # Have an assert so that we know if we miscompile + self.assertTrue(lst, "should not compile on pypy") + self.assertTrue(isinstance(e, LoopExit)) + + def run_script(self, more_args=()): + args = [sys.executable, "-c", script] + args.extend(more_args) + rc = subprocess.call(args) + self.assertNotEqual(rc, 2, "interpreter was blocked") + self.assertEqual(rc, 0, "Unexpected error") + + def test_finalize_with_trace(self): + self.run_script() + + def test_bootstrap_inner_with_trace(self): + self.run_script(["1"]) + + +if __name__ == "__main__": + greentest.main() diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__threadpool.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__threadpool.py new file mode 100644 index 00000000..2bbcbb79 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__threadpool.py @@ -0,0 +1,653 @@ +from __future__ import print_function + +from time import time, sleep +import contextlib +import random +import weakref +import gc + +import gevent.testing as greentest +import gevent.threadpool +from gevent.threadpool import ThreadPool +import gevent + +from gevent.testing import ExpectedException +from gevent.testing import PYPY + + + +# pylint:disable=too-many-ancestors + + +@contextlib.contextmanager +def disabled_gc(): + was_enabled = gc.isenabled() + gc.disable() + try: + yield + finally: + if was_enabled: + gc.enable() + + +class TestCase(greentest.TestCase): + # These generally need more time + __timeout__ = greentest.LARGE_TIMEOUT + pool = None + + ClassUnderTest = ThreadPool + def _FUT(self): + return self.ClassUnderTest + + def _makeOne(self, size, increase=greentest.RUN_LEAKCHECKS): + self.pool = pool = self._FUT()(size) + if increase: + # Max size to help eliminate false positives + self.pool.size = size + return pool + + def cleanup(self): + pool = self.pool + if pool is not None: + kill = getattr(pool, 'kill', None) or getattr(pool, 'shutdown') + kill() + del kill + del self.pool + + if greentest.RUN_LEAKCHECKS: + # Each worker thread created a greenlet object and switched to it. + # It's a custom subclass, but even if it's not, it appears that + # the root greenlet for the new thread sticks around until there's a + # gc. Simply calling 'getcurrent()' is enough to "leak" a greenlet.greenlet + # and a weakref. + for _ in range(3): + gc.collect() + + +class PoolBasicTests(TestCase): + + def test_execute_async(self): + pool = self._makeOne(2) + r = [] + first = pool.spawn(r.append, 1) + first.get() + self.assertEqual(r, [1]) + gevent.sleep(0) + + pool.apply_async(r.append, (2, )) + self.assertEqual(r, [1]) + + pool.apply_async(r.append, (3, )) + self.assertEqual(r, [1]) + + pool.apply_async(r.append, (4, )) + self.assertEqual(r, [1]) + gevent.sleep(0.01) + self.assertEqualFlakyRaceCondition(sorted(r), [1, 2, 3, 4]) + + def test_apply(self): + pool = self._makeOne(1) + result = pool.apply(lambda a: ('foo', a), (1, )) + self.assertEqual(result, ('foo', 1)) + + def test_apply_raises(self): + pool = self._makeOne(1) + + def raiser(): + raise ExpectedException() + + with self.assertRaises(ExpectedException): + pool.apply(raiser) + # Don't let the metaclass automatically force any error + # that reaches the hub from a spawned greenlet to become + # fatal; that defeats the point of the test. + test_apply_raises.error_fatal = False + + def test_init_valueerror(self): + self.switch_expected = False + with self.assertRaises(ValueError): + self._makeOne(-1) + +# +# tests from standard library test/test_multiprocessing.py + + +class TimingWrapper(object): + + def __init__(self, the_func): + self.func = the_func + self.elapsed = None + + def __call__(self, *args, **kwds): + t = time() + try: + return self.func(*args, **kwds) + finally: + self.elapsed = time() - t + + +def sqr(x, wait=0.0): + sleep(wait) + return x * x + + +def sqr_random_sleep(x): + sleep(random.random() * 0.1) + return x * x + + +TIMEOUT1, TIMEOUT2, TIMEOUT3 = 0.082, 0.035, 0.14 + +class _AbstractPoolTest(TestCase): + + size = 1 + + MAP_IS_GEN = False + + def setUp(self): + greentest.TestCase.setUp(self) + self._makeOne(self.size) + + @greentest.ignores_leakcheck + def test_map(self): + pmap = self.pool.map + if self.MAP_IS_GEN: + pmap = lambda f, i: list(self.pool.map(f, i)) + self.assertEqual(pmap(sqr, range(10)), list(map(sqr, range(10)))) + self.assertEqual(pmap(sqr, range(100)), list(map(sqr, range(100)))) + + self.pool.kill() + del self.pool + del pmap + +SMALL_RANGE = 10 +LARGE_RANGE = 1000 + +if (greentest.PYPY and (greentest.WIN or greentest.RUN_COVERAGE)) or greentest.RUN_LEAKCHECKS: + # PyPy 5.10 is *really* slow at spawning or switching between + # threads (especially on Windows or when coverage is enabled) Tests that happen + # instantaneously on other platforms time out due to the overhead. + + # Leakchecks also take much longer due to all the calls into the GC, + # most especially on Python 3 + LARGE_RANGE = 50 + +class TestPool(_AbstractPoolTest): + + def test_greenlet_class(self): + from greenlet import getcurrent + from gevent.threadpool import _WorkerGreenlet + worker_greenlet = self.pool.apply(getcurrent) + + self.assertIsInstance(worker_greenlet, _WorkerGreenlet) + r = repr(worker_greenlet) + self.assertIn('ThreadPoolWorker', r) + self.assertIn('thread_ident', r) + self.assertIn('hub=', r) + + from gevent.util import format_run_info + + info = '\n'.join(format_run_info()) + self.assertIn(" + : Parent: None + : Greenlet Locals: + : Local at X + : {'foo': 42} + +--- + : Parent: + +--- ; finished with value + | +--- ; finished with exception ExpectedException() + : Parent: + +--- ; finished with value + | +--- ; finished with exception ExpectedException() + : Parent: + +--- ; finished with value + : Spawn Tree Locals + : {'stl': 'STL'} + | +--- ; finished with value + | +--- ; finished with exception ExpectedException() + : Parent: + +--- >>; finished with value + """.strip() + self.assertEqual(expected, value) + + @greentest.ignores_leakcheck + def test_tree_no_track(self): + gevent.config.track_greenlet_tree = False + self._build_tree() + + + @greentest.ignores_leakcheck + def test_forest_fake_parent(self): + from greenlet import greenlet as RawGreenlet + + def t4(): + # Ignore this one, make the child the parent, + # and don't be a child of the hub. + c = RawGreenlet(util.GreenletTree.current_tree) + c.parent.greenlet_tree_is_ignored = True + c.greenlet_tree_is_root = True + return c.switch() + + + g = RawGreenlet(t4) + tree = g.switch() + + tree_format = tree.format(details={'running_stacks': False, + 'spawning_stacks': False}) + value = self._normalize_tree_format(tree_format) + + expected = """\ +; not running + : Parent: + """.strip() + + self.assertEqual(expected, value) + + +class TestAssertSwitches(unittest.TestCase): + + def test_time_sleep(self): + # A real blocking function + from time import sleep + + # No time given, we detect the failure to switch immediately + with self.assertRaises(util._FailedToSwitch) as exc: + with util.assert_switches(): + sleep(0.001) + + message = str(exc.exception) + self.assertIn('To any greenlet in', message) + + # Supply a max blocking allowed and exceed it + with self.assertRaises(util._FailedToSwitch): + with util.assert_switches(0.001): + sleep(0.1) + + + # Supply a max blocking allowed, and exit before that happens, + # but don't switch to the hub as requested + with self.assertRaises(util._FailedToSwitch) as exc: + with util.assert_switches(0.001, hub_only=True): + sleep(0) + + message = str(exc.exception) + self.assertIn('To the hub in', message) + self.assertIn('(max allowed 0.0010 seconds)', message) + + # Supply a max blocking allowed, and exit before that happens, + # and allow any switch (or no switch). + # Note that we need to use a relatively long duration; + # sleep(0) on Windows can actually take a substantial amount of time + # sometimes (more than 0.001s) + with util.assert_switches(1.0, hub_only=False): + sleep(0) + + + def test_no_switches_no_function(self): + # No blocking time given, no switch performed: exception + with self.assertRaises(util._FailedToSwitch): + with util.assert_switches(): + pass + + # blocking time given, for all greenlets, no switch performed: nothing + with util.assert_switches(max_blocking_time=1, hub_only=False): + pass + + def test_exception_not_supressed(self): + + with self.assertRaises(NameError): + with util.assert_switches(): + raise NameError() + + def test_nested(self): + from greenlet import gettrace + with util.assert_switches() as outer: + self.assertEqual(gettrace(), outer.tracer) + self.assertIsNotNone(outer.tracer.active_greenlet) + + with util.assert_switches() as inner: + self.assertEqual(gettrace(), inner.tracer) + self.assertEqual(inner.tracer.previous_trace_function, outer.tracer) + + inner.tracer('switch', (self, self)) + + self.assertIs(self, inner.tracer.active_greenlet) + self.assertIs(self, outer.tracer.active_greenlet) + + self.assertEqual(gettrace(), outer.tracer) + +if __name__ == '__main__': + greentest.main() diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test_server.crt b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test_server.crt new file mode 100644 index 00000000..1379e1d1 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test_server.crt @@ -0,0 +1,15 @@ +-----BEGIN CERTIFICATE----- +MIICYzCCAcwCCQD5jx1Aa0dytjANBgkqhkiG9w0BAQQFADB2MQswCQYDVQQGEwJU +UzENMAsGA1UECBMEVGVzdDENMAsGA1UEBxMEVGVzdDEWMBQGA1UEChMNVGVzdCBF +dmVudGxldDENMAsGA1UECxMEVGVzdDENMAsGA1UEAxMEVGVzdDETMBEGCSqGSIb3 +DQEJARYEVGVzdDAeFw0wODA3MDgyMTExNDJaFw0xMDAyMDgwODE1MTBaMHYxCzAJ +BgNVBAYTAlRTMQ0wCwYDVQQIEwRUZXN0MQ0wCwYDVQQHEwRUZXN0MRYwFAYDVQQK +Ew1UZXN0IEV2ZW50bGV0MQ0wCwYDVQQLEwRUZXN0MQ0wCwYDVQQDEwRUZXN0MRMw +EQYJKoZIhvcNAQkBFgRUZXN0MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDM +WcyeIiHQuEGQxgTIvu0aOW4iRFAyUEi8pLWNCxMEHglF8k6OxFVq7XWZMDnDFVnb +ZjmQh5Tc21Ae6cXzxXln578fROXHEzXo3Is8HUlq3ug1yYOGHjxw++Opjf1uoHwP +EBUKsz/flS7knuscgFM9FO05KSPn2wHnZeIDta4yTwIDAQABMA0GCSqGSIb3DQEB +BAUAA4GBAKM71aP0r26gEEEBzovfXm1IwKav6R9/xiWsJ4pFsUXVotcaIjcVBDG1 +Z7tz688hokb+GNxsTI2gNfqanqUnfP9wZxnKRmfTSOvb5aWHIiaiMXSgjiPlqBcm +6mnSeEbSMM9cw479wWhh1YqY8tf3gYJa+sxznVWLSfVLpsjRMphe +-----END CERTIFICATE----- diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test_server.key b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test_server.key new file mode 100644 index 00000000..24cd8e5a --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test_server.key @@ -0,0 +1,15 @@ +-----BEGIN RSA PRIVATE KEY----- +MIICXgIBAAKBgQDMWcyeIiHQuEGQxgTIvu0aOW4iRFAyUEi8pLWNCxMEHglF8k6O +xFVq7XWZMDnDFVnbZjmQh5Tc21Ae6cXzxXln578fROXHEzXo3Is8HUlq3ug1yYOG +Hjxw++Opjf1uoHwPEBUKsz/flS7knuscgFM9FO05KSPn2wHnZeIDta4yTwIDAQAB +AoGBAKWfvq0IIvok7Ncm92ew/0D6/R1+2rT8xwdGQ/Nt31q98WwkqLEjxctlbKPd +J2PLIUomf0955BhhFH4JoSwjiHJQ6uishY7srjQQDX/Dxdi5wZAyxYCIVW/kAA9N +/u2s75hSD3s/rqAwOZ182DwAPIqJc4KQoYzvlKERSMDT1PJhAkEA5SUFsiSzBEMX +FyZ++ZMMs1vHrTu5oTK7WHznh9lk7dvsnp9BoUPqhiu8iJ7Q23zj0u5asz2czu11 +nnczXgU6XwJBAORM5Ib4I7nAsoUWn9wDiTwVQeE+D9P1ac9p7EHm7XXuf8o2irRZ +wYYfpXXsjk496YfyQFcQRMk0tU0gegCP7hECQFWRWqwoajUoPIInnPjjwbVki48U +I4CfqjgkBG3Fb5wnKRgezmpDK1vJD1FRRRsBay4EVhhi5KCdKfPv/V2ZxC8CQQCu +U5SxBytofJ8UhxkcTErvaR/8GYLGi//21GAGVop+YdaMlydE3cCrZODYcgCb+CSp +nS7KDG8p4KiMMz9VzJGxAkEAv85K6Sa3H8g9h7LwopBZ5tFNZUaFWo7lEP7DDMH0 +eckZTb1JVpyT/8zrDtsis4WlV9zVkVHxkIaad503BjqvEQ== +-----END RSA PRIVATE KEY----- diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/tests_that_dont_do_leakchecks.txt b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/tests_that_dont_do_leakchecks.txt new file mode 100644 index 00000000..55288a38 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/tests_that_dont_do_leakchecks.txt @@ -0,0 +1,9 @@ +test___monkey_patching.py +test__monkey_ssl_warning.py +test___monitor.py +test__monkey_scope.py +test__ares_timeout.py +test__close_backend_fd.py +test__hub_join.py +test__hub_join_timeout.py +test__issue112.py diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/tests_that_dont_monkeypatch.txt b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/tests_that_dont_monkeypatch.txt new file mode 100644 index 00000000..452e4291 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/tests_that_dont_monkeypatch.txt @@ -0,0 +1,26 @@ +test___example_servers.py +test__backdoor.py +test__example_echoserver.py +test__example_udp_client.py +test__getaddrinfo_import.py +test__example_portforwarder.py +test__pywsgi.py +test__server.py +test__server_pywsgi.py +test__socket_close.py +test__socket_dns6.py +test__socket_errors.py +test__socket_send_memoryview.py +test__socket_timeout.py +test__examples.py +test__issue330.py +test___ident.py +test___config.py +test___monitor.py +test__events.py +test__monkey_scope.py +test__iwait.py +test__ares_timeout.py +test__close_backend_fd.py +test__hub_join.py +test__hub_join_timeout.py diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/tests_that_dont_use_resolver.txt b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/tests_that_dont_use_resolver.txt new file mode 100644 index 00000000..654918e9 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/tests_that_dont_use_resolver.txt @@ -0,0 +1,136 @@ +test__all__.py +#uses socket test__api.py +test__api_timeout.py +test__ares_host_result.py +test__ares_timeout.py # explicitly uses ares resolver +# uses socket test__backdoor.py +test__close_backend_fd.py +test__core_async.py +test__core_callback.py +test__core_loop_run.py +test__core.py +test__core_stat.py +test__core_timer.py +test__core_watcher.py +test__destroy.py +# uses socket test__doctests.py +test__environ.py +test__event.py +# uses socket test__example_echoserver.py +# uses socket test__example_portforwarder.py +# uses socket test___example_servers.py +# uses bunch of things test__examples.py +# uses socket test__example_udp_client.py +# uses socket test__example_udp_server.py +test__exc_info.py +#test__execmodules.py +test__fileobject.py +# uses socket test__greenio.py +test__GreenletExit.py +test__greenlet.py +test__greenletset.py +# uses socket test__greenness.py +test__hub_join.py +test__hub_join_timeout.py +# uses socket test__hub.py +test__issue112.py +test__joinall.py +test__local.py +test__loop_callback.py +test__memleak.py +# uses lots of things test___monkey_patching.py +test__monkey.py +test__order.py +test__os.py +test__pool.py +# uses socket test__pywsgi.py +test__queue.py +test__monkey_queue.py +# uses socket test__refcount.py +test__select.py +test__semaphore.py +# uses socket test__server.py +# test__server_pywsgi.py +test__signal.py +# uses socket test__socket_close.py +# test__socket_dns6.py +# test__socket_dns.py +# test__socket_errors.py +# test__socket.py +# test__socket_ssl.py +# test__socket_timeout.py +test__subprocess_interrupted.py +test__subprocess.py +test__systemerror.py +test__threading_2.py +test__threading_patched_local.py +test__threading_vs_settrace.py +test__threadpool.py +test__timeout.py + +test__compat.py +test__core_fork.py +test__doctests.py +test__core_loop_run_sig_mod.py +test__execmodules.py +test__greenio.py +test__greenness.py +test__hub.py +test__import_blocking_in_greenlet.py +test__import_wait.py +test__issue230.py +test__issue330.py +test__issue467.py +test__issue6.py +test__issue600.py +test__issue607.py +test__issue461_471.py +test__monkey_builtins_future.py +test__monkey_hub_in_thread.py +test__monkey_logging.py +test__monkey_multiple_imports.py +test__monkey_scope.py +test__monkey_selectors.py +test__monkey_sigchld.py +test__monkey_sigchld_2.py +test__nondefaultloop.py +test__monkey_sigchld_3.py +test__real_greenlet.py +test__refcount.py +test__sleep0.py +test__subprocess_poll.py +test__threading.py +test__threading_before_monkey.py +test__threading_holding_lock_while_monkey.py +test__threading_monkey_in_thread.py +test__threading_native_before_monkey.py +test__threadpool_executor_patched.py + + +# monkey patched standard tests: +test_queue.py +test_select.py +test_signal.py +test_subprocess.py +test_threading_local.py +test_threading.py +test_thread.py +test_selectors.py +test_timeout.py + +# test_asyncore probably does use the resolver, but only +# implicitly for localhost, which is covered well enough +# elsewhere that we don't need to spend the 20s (*2) +test_asyncore.py + +test___config.py +test__destroy_default_loop.py +test__util.py +test___ident.py +test__issue639.py +test__issue_728.py +test__refcount_core.py +test__api.py +test__monitor.py +test__events.py +test__iwait.py diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/wrongcert.pem b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/wrongcert.pem new file mode 100644 index 00000000..5f92f9bc --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/wrongcert.pem @@ -0,0 +1,32 @@ +-----BEGIN RSA PRIVATE KEY----- +MIICXAIBAAKBgQC89ZNxjTgWgq7Z1g0tJ65w+k7lNAj5IgjLb155UkUrz0XsHDnH +FlbsVUg2Xtk6+bo2UEYIzN7cIm5ImpmyW/2z0J1IDVDlvR2xJ659xrE0v5c2cB6T +f9lnNTwpSoeK24Nd7Jwq4j9vk95fLrdqsBq0/KVlsCXeixS/CaqqduXfvwIDAQAB +AoGAQFko4uyCgzfxr4Ezb4Mp5pN3Npqny5+Jey3r8EjSAX9Ogn+CNYgoBcdtFgbq +1yif/0sK7ohGBJU9FUCAwrqNBI9ZHB6rcy7dx+gULOmRBGckln1o5S1+smVdmOsW +7zUVLBVByKuNWqTYFlzfVd6s4iiXtAE2iHn3GCyYdlICwrECQQDhMQVxHd3EFbzg +SFmJBTARlZ2GKA3c1g/h9/XbkEPQ9/RwI3vnjJ2RaSnjlfoLl8TOcf0uOGbOEyFe +19RvCLXjAkEA1s+UE5ziF+YVkW3WolDCQ2kQ5WG9+ccfNebfh6b67B7Ln5iG0Sbg +ky9cjsO3jbMJQtlzAQnH1850oRD5Gi51dQJAIbHCDLDZU9Ok1TI+I2BhVuA6F666 +lEZ7TeZaJSYq34OaUYUdrwG9OdqwZ9sy9LUav4ESzu2lhEQchCJrKMn23QJAReqs +ZLHUeTjfXkVk7dHhWPWSlUZ6AhmIlA/AQ7Payg2/8wM/JkZEJEPvGVykms9iPUrv +frADRr+hAGe43IewnQJBAJWKZllPgKuEBPwoEldHNS8nRu61D7HzxEzQ2xnfj+Nk +2fgf1MAzzTRsikfGENhVsVWeqOcijWb6g5gsyCmlRpc= +-----END RSA PRIVATE KEY----- +-----BEGIN CERTIFICATE----- +MIICsDCCAhmgAwIBAgIJAOqYOYFJfEEoMA0GCSqGSIb3DQEBBQUAMEUxCzAJBgNV +BAYTAkFVMRMwEQYDVQQIEwpTb21lLVN0YXRlMSEwHwYDVQQKExhJbnRlcm5ldCBX +aWRnaXRzIFB0eSBMdGQwHhcNMDgwNjI2MTgxNTUyWhcNMDkwNjI2MTgxNTUyWjBF +MQswCQYDVQQGEwJBVTETMBEGA1UECBMKU29tZS1TdGF0ZTEhMB8GA1UEChMYSW50 +ZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKB +gQC89ZNxjTgWgq7Z1g0tJ65w+k7lNAj5IgjLb155UkUrz0XsHDnHFlbsVUg2Xtk6 ++bo2UEYIzN7cIm5ImpmyW/2z0J1IDVDlvR2xJ659xrE0v5c2cB6Tf9lnNTwpSoeK +24Nd7Jwq4j9vk95fLrdqsBq0/KVlsCXeixS/CaqqduXfvwIDAQABo4GnMIGkMB0G +A1UdDgQWBBTctMtI3EO9OjLI0x9Zo2ifkwIiNjB1BgNVHSMEbjBsgBTctMtI3EO9 +OjLI0x9Zo2ifkwIiNqFJpEcwRTELMAkGA1UEBhMCQVUxEzARBgNVBAgTClNvbWUt +U3RhdGUxITAfBgNVBAoTGEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZIIJAOqYOYFJ +fEEoMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEFBQADgYEAQwa7jya/DfhaDn7E +usPkpgIX8WCL2B1SqnRTXEZfBPPVq/cUmFGyEVRVATySRuMwi8PXbVcOhXXuocA+ +43W+iIsD9pXapCZhhOerCq18TC1dWK98vLUsoK8PMjB6e5H/O8bqojv0EeC+fyCw +eSHj5jpC8iZKjCHBn+mAi4cQ514= +-----END CERTIFICATE----- diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/thread.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/thread.py new file mode 100644 index 00000000..cceaf484 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/thread.py @@ -0,0 +1,114 @@ +""" +Implementation of the standard :mod:`thread` module that spawns greenlets. + +.. note:: + + This module is a helper for :mod:`gevent.monkey` and is not + intended to be used directly. For spawning greenlets in your + applications, prefer higher level constructs like + :class:`gevent.Greenlet` class or :func:`gevent.spawn`. +""" +from __future__ import absolute_import +import sys + +__implements__ = ['allocate_lock', + 'get_ident', + 'exit', + 'LockType', + 'stack_size', + 'start_new_thread', + '_local'] + +__imports__ = ['error'] +if sys.version_info[0] <= 2: + import thread as __thread__ # pylint:disable=import-error +else: + import _thread as __thread__ # pylint:disable=import-error + __target__ = '_thread' + __imports__ += ['RLock', + 'TIMEOUT_MAX', + 'allocate', + 'exit_thread', + 'interrupt_main', + 'start_new'] +error = __thread__.error +from gevent._compat import PY3 +from gevent._compat import PYPY +from gevent._util import copy_globals +from gevent.hub import getcurrent, GreenletExit +from gevent.greenlet import Greenlet +from gevent.lock import BoundedSemaphore +from gevent.local import local as _local + + +def get_ident(gr=None): + if gr is None: + gr = getcurrent() + return id(gr) + + +def start_new_thread(function, args=(), kwargs=None): + if kwargs is not None: + greenlet = Greenlet.spawn(function, *args, **kwargs) + else: + greenlet = Greenlet.spawn(function, *args) + return get_ident(greenlet) + + +class LockType(BoundedSemaphore): + # Change the ValueError into the appropriate thread error + # and any other API changes we need to make to match behaviour + _OVER_RELEASE_ERROR = __thread__.error + + if PYPY and PY3: + _OVER_RELEASE_ERROR = RuntimeError + + if PY3: + _TIMEOUT_MAX = __thread__.TIMEOUT_MAX # python 2: pylint:disable=no-member + + def acquire(self, blocking=True, timeout=-1): + # Transform the default -1 argument into the None that our + # semaphore implementation expects, and raise the same error + # the stdlib implementation does. + if timeout == -1: + timeout = None + if not blocking and timeout is not None: + raise ValueError("can't specify a timeout for a non-blocking call") + if timeout is not None: + if timeout < 0: + # in C: if(timeout < 0 && timeout != -1) + raise ValueError("timeout value must be strictly positive") + if timeout > self._TIMEOUT_MAX: + raise OverflowError('timeout value is too large') + + return BoundedSemaphore.acquire(self, blocking, timeout) + +allocate_lock = LockType + + +def exit(): + raise GreenletExit + + +if hasattr(__thread__, 'stack_size'): + _original_stack_size = __thread__.stack_size + + def stack_size(size=None): + if size is None: + return _original_stack_size() + if size > _original_stack_size(): + return _original_stack_size(size) + # not going to decrease stack_size, because otherwise other + # greenlets in this thread will suffer +else: + __implements__.remove('stack_size') + +__imports__ = copy_globals(__thread__, globals(), + only_names=__imports__, + ignore_missing_names=True) + +__all__ = __implements__ + __imports__ +__all__.remove('_local') + +# XXX interrupt_main +# XXX _count() diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/threading.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/threading.py new file mode 100644 index 00000000..570ccd6c --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/threading.py @@ -0,0 +1,235 @@ +""" +Implementation of the standard :mod:`threading` using greenlets. + +.. note:: + + This module is a helper for :mod:`gevent.monkey` and is not + intended to be used directly. For spawning greenlets in your + applications, prefer higher level constructs like + :class:`gevent.Greenlet` class or :func:`gevent.spawn`. Attributes + in this module like ``__threading__`` are implementation artifacts subject + to change at any time. + +.. versionchanged:: 1.2.3 + + Defer adjusting the stdlib's list of active threads until we are + monkey patched. Previously this was done at import time. We are + documented to only be used as a helper for monkey patching, so this should + functionally be the same, but some applications ignore the documentation and + directly import this module anyway. + + A positive consequence is that ``import gevent.threading, + threading; threading.current_thread()`` will no longer return a DummyThread + before monkey-patching. +""" +from __future__ import absolute_import + + +__implements__ = [ + 'local', + '_start_new_thread', + '_allocate_lock', + 'Lock', + '_get_ident', + '_sleep', + '_DummyThread', +] + + +import threading as __threading__ +_DummyThread_ = __threading__._DummyThread +from gevent.local import local +from gevent.thread import start_new_thread as _start_new_thread, allocate_lock as _allocate_lock, get_ident as _get_ident +from gevent.hub import sleep as _sleep, getcurrent + +# Exports, prevent unused import warnings +local = local +start_new_thread = _start_new_thread +allocate_lock = _allocate_lock +_get_ident = _get_ident +_sleep = _sleep +getcurrent = getcurrent + +Lock = _allocate_lock + + +def _cleanup(g): + __threading__._active.pop(_get_ident(g), None) + +def _make_cleanup_id(gid): + def _(_r): + __threading__._active.pop(gid, None) + return _ + +_weakref = None + +class _DummyThread(_DummyThread_): + # We avoid calling the superclass constructor. This makes us about + # twice as fast (1.16 vs 0.68usec on PyPy, 29.3 vs 17.7usec on + # CPython 2.7), and has the important effect of avoiding + # allocation and then immediate deletion of _Thread__block, a + # lock. This is especially important on PyPy where locks go + # through the cpyext API and Cython, which is known to be slow and + # potentially buggy (e.g., + # https://bitbucket.org/pypy/pypy/issues/2149/memory-leak-for-python-subclass-of-cpyext#comment-22347393) + + # These objects are constructed quite frequently in some cases, so + # the optimization matters: for example, in gunicorn, which uses + # pywsgi.WSGIServer, every request is handled in a new greenlet, + # and every request uses a logging.Logger to write the access log, + # and every call to a log method captures the current thread (by + # default). + # + # (Obviously we have to duplicate the effects of the constructor, + # at least for external state purposes, which is potentially + # slightly fragile.) + + # For the same reason, instances of this class will cleanup their own entry + # in ``threading._active`` + + # This class also solves a problem forking process with subprocess: after forking, + # Thread.__stop is called, which throws an exception when __block doesn't + # exist. + + # Capture the static things as class vars to save on memory/ + # construction time. + # In Py2, they're all private; in Py3, they become protected + _Thread__stopped = _is_stopped = _stopped = False + _Thread__initialized = _initialized = True + _Thread__daemonic = _daemonic = True + _Thread__args = _args = () + _Thread__kwargs = _kwargs = None + _Thread__target = _target = None + _Thread_ident = _ident = None + _Thread__started = _started = __threading__.Event() + _Thread__started.set() + _tstate_lock = None + + def __init__(self): # pylint:disable=super-init-not-called + #_DummyThread_.__init__(self) + + # It'd be nice to use a pattern like "greenlet-%d", but maybe somebody out + # there is checking thread names... + self._name = self._Thread__name = __threading__._newname("DummyThread-%d") + # All dummy threads in the same native thread share the same ident + # (that of the native thread) + self._set_ident() + + g = getcurrent() + gid = _get_ident(g) + __threading__._active[gid] = self + rawlink = getattr(g, 'rawlink', None) + if rawlink is not None: + # raw greenlet.greenlet greenlets don't + # have rawlink... + rawlink(_cleanup) + else: + # ... so for them we use weakrefs. + # See https://github.com/gevent/gevent/issues/918 + global _weakref + if _weakref is None: + _weakref = __import__('weakref') + ref = _weakref.ref(g, _make_cleanup_id(gid)) + self.__raw_ref = ref + + def _Thread__stop(self): + pass + + _stop = _Thread__stop # py3 + + def _wait_for_tstate_lock(self, *args, **kwargs): + # pylint:disable=arguments-differ + pass + +if hasattr(__threading__, 'main_thread'): # py 3.4+ + def main_native_thread(): + return __threading__.main_thread() # pylint:disable=no-member +else: + def main_native_thread(): + main_threads = [v for v in __threading__._active.values() + if isinstance(v, __threading__._MainThread)] + assert len(main_threads) == 1, "Too many main threads" + + return main_threads[0] + +import sys +if sys.version_info[:2] >= (3, 4): + # XXX: Issue 18808 breaks us on Python 3.4. + # Thread objects now expect a callback from the interpreter itself + # (threadmodule.c:release_sentinel). Because this never happens + # when a greenlet exits, join() and friends will block forever. + # The solution below involves capturing the greenlet when it is + # started and deferring the known broken methods to it. + + class Thread(__threading__.Thread): + _greenlet = None + + def is_alive(self): + return bool(self._greenlet) + + isAlive = is_alive + + def _set_tstate_lock(self): + self._greenlet = getcurrent() + + def run(self): + try: + super(Thread, self).run() + finally: + # avoid ref cycles, but keep in __dict__ so we can + # distinguish the started/never-started case + self._greenlet = None + self._stop() # mark as finished + + def join(self, timeout=None): + if '_greenlet' not in self.__dict__: + raise RuntimeError("Cannot join an inactive thread") + if self._greenlet is None: + return + self._greenlet.join(timeout=timeout) + + def _wait_for_tstate_lock(self, *args, **kwargs): + # pylint:disable=arguments-differ + raise NotImplementedError() + + __implements__.append('Thread') + + class Timer(Thread, __threading__.Timer): # pylint:disable=abstract-method,inherit-non-class + pass + + __implements__.append('Timer') + + # The main thread is patched up with more care + # in _gevent_will_monkey_patch + +if sys.version_info[:2] >= (3, 3): + __implements__.remove('_get_ident') + __implements__.append('get_ident') + get_ident = _get_ident + __implements__.remove('_sleep') + + # Python 3 changed the implementation of threading.RLock + # Previously it was a factory function around threading._RLock + # which in turn used _allocate_lock. Now, it wants to use + # threading._CRLock, which is imported from _thread.RLock and as such + # is implemented in C. So it bypasses our _allocate_lock function. + # Fortunately they left the Python fallback in place + assert hasattr(__threading__, '_CRLock'), "Unsupported Python version" + _CRLock = None + __implements__.append('_CRLock') + +def _gevent_will_monkey_patch(native_module, items, warn): # pylint:disable=unused-argument + # Make sure the MainThread can be found by our current greenlet ID, + # otherwise we get a new DummyThread, which cannot be joined. + # Fixes tests in test_threading_2 under PyPy. + main_thread = main_native_thread() + if __threading__.current_thread() != main_thread: + warn("Monkey-patching outside the main native thread. Some APIs " + "will not be available. Expect a KeyError to be printed at shutdown.") + return + + if _get_ident() not in __threading__._active: + main_id = main_thread.ident + del __threading__._active[main_id] + main_thread._ident = main_thread._Thread__ident = _get_ident() + __threading__._active[_get_ident()] = main_thread diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/threadpool.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/threadpool.py new file mode 100644 index 00000000..7108e4dc --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/threadpool.py @@ -0,0 +1,580 @@ +# Copyright (c) 2012 Denis Bilenko. See LICENSE for details. +from __future__ import absolute_import +import sys +import os + +from weakref import ref as wref + +from greenlet import greenlet as RawGreenlet + +from gevent._compat import integer_types +from gevent.hub import _get_hub_noargs as get_hub +from gevent.hub import getcurrent +from gevent.hub import sleep +from gevent.hub import _get_hub +from gevent.event import AsyncResult +from gevent.greenlet import Greenlet +from gevent.pool import GroupMappingMixin +from gevent.lock import Semaphore + +from gevent._threading import Lock +from gevent._threading import Queue +from gevent._threading import start_new_thread +from gevent._threading import get_thread_ident + + +__all__ = [ + 'ThreadPool', + 'ThreadResult', +] + + +class _WorkerGreenlet(RawGreenlet): + # Exists to produce a more useful repr for worker pool + # threads/greenlets. + + def __init__(self, threadpool): + RawGreenlet.__init__(self, threadpool._worker) + self.thread_ident = get_thread_ident() + self._threadpool_wref = wref(threadpool) + + # Inform the gevent.util.GreenletTree that this should be + # considered the root (for printing purposes) and to + # ignore the parent attribute. (We can't set parent to None.) + self.greenlet_tree_is_root = True + self.parent.greenlet_tree_is_ignored = True + + def __repr__(self): + return "" % ( + id(self), + self.thread_ident, + self._threadpool_wref()) + +class ThreadPool(GroupMappingMixin): + """ + .. note:: The method :meth:`apply_async` will always return a new + greenlet, bypassing the threadpool entirely. + .. caution:: Instances of this class are only true if they have + unfinished tasks. + """ + + def __init__(self, maxsize, hub=None): + if hub is None: + hub = get_hub() + self.hub = hub + self._maxsize = 0 + self.manager = None + self.pid = os.getpid() + self.fork_watcher = hub.loop.fork(ref=False) + try: + self._init(maxsize) + except: + self.fork_watcher.close() + raise + + def _set_maxsize(self, maxsize): + if not isinstance(maxsize, integer_types): + raise TypeError('maxsize must be integer: %r' % (maxsize, )) + if maxsize < 0: + raise ValueError('maxsize must not be negative: %r' % (maxsize, )) + difference = maxsize - self._maxsize + self._semaphore.counter += difference + self._maxsize = maxsize + self.adjust() + # make sure all currently blocking spawn() start unlocking if maxsize increased + self._semaphore._start_notify() + + def _get_maxsize(self): + return self._maxsize + + maxsize = property(_get_maxsize, _set_maxsize) + + def __repr__(self): + return '<%s at 0x%x %s/%s/%s hub=<%s at 0x%x thread_ident=0x%s>>' % ( + self.__class__.__name__, + id(self), + len(self), self.size, self.maxsize, + self.hub.__class__.__name__, id(self.hub), self.hub.thread_ident) + + def __len__(self): + # XXX just do unfinished_tasks property + # Note that this becomes the boolean value of this class, + # that's probably not what we want! + return self.task_queue.unfinished_tasks + + def _get_size(self): + return self._size + + def _set_size(self, size): + if size < 0: + raise ValueError('Size of the pool cannot be negative: %r' % (size, )) + if size > self._maxsize: + raise ValueError('Size of the pool cannot be bigger than maxsize: %r > %r' % (size, self._maxsize)) + if self.manager: + self.manager.kill() + while self._size < size: + self._add_thread() + delay = self.hub.loop.approx_timer_resolution + while self._size > size: + while self._size - size > self.task_queue.unfinished_tasks: + self.task_queue.put(None) + if getcurrent() is self.hub: + break + sleep(delay) + delay = min(delay * 2, .05) + if self._size: + self.fork_watcher.start(self._on_fork) + else: + self.fork_watcher.stop() + + size = property(_get_size, _set_size) + + def _init(self, maxsize): + self._size = 0 + self._semaphore = Semaphore(1) + self._lock = Lock() + self.task_queue = Queue() + self._set_maxsize(maxsize) + + def _on_fork(self): + # fork() only leaves one thread; also screws up locks; + # let's re-create locks and threads. + # NOTE: See comment in gevent.hub.reinit. + pid = os.getpid() + if pid != self.pid: + self.pid = pid + # Do not mix fork() and threads; since fork() only copies one thread + # all objects referenced by other threads has refcount that will never + # go down to 0. + self._init(self._maxsize) + + def join(self): + """Waits until all outstanding tasks have been completed.""" + delay = max(0.0005, self.hub.loop.approx_timer_resolution) + while self.task_queue.unfinished_tasks > 0: + sleep(delay) + delay = min(delay * 2, .05) + + def kill(self): + self.size = 0 + self.fork_watcher.close() + + def _adjust_step(self): + # if there is a possibility & necessity for adding a thread, do it + while self._size < self._maxsize and self.task_queue.unfinished_tasks > self._size: + self._add_thread() + # while the number of threads is more than maxsize, kill one + # we do not check what's already in task_queue - it could be all Nones + while self._size - self._maxsize > self.task_queue.unfinished_tasks: + self.task_queue.put(None) + if self._size: + self.fork_watcher.start(self._on_fork) + else: + self.fork_watcher.stop() + + def _adjust_wait(self): + delay = 0.0001 + while True: + self._adjust_step() + if self._size <= self._maxsize: + return + sleep(delay) + delay = min(delay * 2, .05) + + def adjust(self): + self._adjust_step() + if not self.manager and self._size > self._maxsize: + # might need to feed more Nones into the pool + self.manager = Greenlet.spawn(self._adjust_wait) + + def _add_thread(self): + with self._lock: + self._size += 1 + try: + start_new_thread(self.__trampoline, ()) + except: + with self._lock: + self._size -= 1 + raise + + def spawn(self, func, *args, **kwargs): + """ + Add a new task to the threadpool that will run ``func(*args, **kwargs)``. + + Waits until a slot is available. Creates a new thread if necessary. + + :return: A :class:`gevent.event.AsyncResult`. + """ + while 1: + semaphore = self._semaphore + semaphore.acquire() + if semaphore is self._semaphore: + break + + thread_result = None + try: + task_queue = self.task_queue + result = AsyncResult() + # XXX We're calling the semaphore release function in the hub, otherwise + # we get LoopExit (why?). Previously it was done with a rawlink on the + # AsyncResult and the comment that it is "competing for order with get(); this is not + # good, just make ThreadResult release the semaphore before doing anything else" + thread_result = ThreadResult(result, self.hub, semaphore.release) + task_queue.put((func, args, kwargs, thread_result)) + self.adjust() + except: + if thread_result is not None: + thread_result.destroy() + semaphore.release() + raise + return result + + def _decrease_size(self): + if sys is None: + return + _lock = getattr(self, '_lock', None) + if _lock is not None: + with _lock: + self._size -= 1 + + # XXX: This used to be false by default. It really seems like + # it should be true to avoid leaking resources. + _destroy_worker_hub = True + + + def __ignore_current_greenlet_blocking(self, hub): + if hub is not None and hub.periodic_monitoring_thread is not None: + hub.periodic_monitoring_thread.ignore_current_greenlet_blocking() + + def __trampoline(self): + # The target that we create new threads with. It exists + # solely to create the _WorkerGreenlet and switch to it. + # (the __class__ of a raw greenlet cannot be changed.) + g = _WorkerGreenlet(self) + g.switch() + + def _worker(self): + # pylint:disable=too-many-branches + need_decrease = True + try: + while 1: # tiny bit faster than True on Py2 + h = _get_hub() + if h is not None: + h.name = 'ThreadPool Worker Hub' + task_queue = self.task_queue + # While we block, don't let the monitoring thread, if any, + # report us as blocked. Indeed, so long as we never + # try to switch greenlets, don't report us as blocked--- + # the threadpool is *meant* to run blocking tasks + self.__ignore_current_greenlet_blocking(h) + task = task_queue.get() + try: + if task is None: + need_decrease = False + self._decrease_size() + # we want first to decrease size, then decrease unfinished_tasks + # otherwise, _adjust might think there's one more idle thread that + # needs to be killed + return + func, args, kwargs, thread_result = task + try: + value = func(*args, **kwargs) + except: # pylint:disable=bare-except + exc_info = getattr(sys, 'exc_info', None) + if exc_info is None: + return + thread_result.handle_error((self, func), exc_info()) + else: + if sys is None: + return + thread_result.set(value) + del value + finally: + del func, args, kwargs, thread_result, task + finally: + if sys is None: + return # pylint:disable=lost-exception + task_queue.task_done() + finally: + if need_decrease: + self._decrease_size() + if sys is not None and self._destroy_worker_hub: + hub = _get_hub() + if hub is not None: + hub.destroy(True) + del hub + + def apply_e(self, expected_errors, function, args=None, kwargs=None): + """ + .. deprecated:: 1.1a2 + Identical to :meth:`apply`; the ``expected_errors`` argument is ignored. + """ + # pylint:disable=unused-argument + # Deprecated but never documented. In the past, before + # self.apply() allowed all errors to be raised to the caller, + # expected_errors allowed a caller to specify a set of errors + # they wanted to be raised, through the wrap_errors function. + # In practice, it always took the value Exception or + # BaseException. + return self.apply(function, args, kwargs) + + def _apply_immediately(self): + # If we're being called from a different thread than the one that + # created us, e.g., because a worker task is trying to use apply() + # recursively, we have no choice but to run the task immediately; + # if we try to AsyncResult.get() in the worker thread, it's likely to have + # nothing to switch to and lead to a LoopExit. + return get_hub() is not self.hub + + def _apply_async_cb_spawn(self, callback, result): + callback(result) + + def _apply_async_use_greenlet(self): + # Always go to Greenlet because our self.spawn uses threads + return True + +class _FakeAsync(object): + + def send(self): + pass + close = stop = send + + def __call_(self, result): + "fake out for 'receiver'" + + def __bool__(self): + return False + + __nonzero__ = __bool__ + +_FakeAsync = _FakeAsync() + +class ThreadResult(object): + + # Using slots here helps to debug reference cycles/leaks + __slots__ = ('exc_info', 'async_watcher', '_call_when_ready', 'value', + 'context', 'hub', 'receiver') + + def __init__(self, receiver, hub, call_when_ready): + self.receiver = receiver + self.hub = hub + self.context = None + self.value = None + self.exc_info = () + self.async_watcher = hub.loop.async_() + self._call_when_ready = call_when_ready + self.async_watcher.start(self._on_async) + + @property + def exception(self): + return self.exc_info[1] if self.exc_info else None + + def _on_async(self): + self.async_watcher.stop() + self.async_watcher.close() + + # Typically this is pool.semaphore.release and we have to + # call this in the Hub; if we don't we get the dreaded + # LoopExit (XXX: Why?) + self._call_when_ready() + + try: + if self.exc_info: + self.hub.handle_error(self.context, *self.exc_info) + self.context = None + self.async_watcher = _FakeAsync + self.hub = None + self._call_when_ready = _FakeAsync + + self.receiver(self) + finally: + self.receiver = _FakeAsync + self.value = None + if self.exc_info: + self.exc_info = (self.exc_info[0], self.exc_info[1], None) + + def destroy(self): + self.async_watcher.stop() + self.async_watcher.close() + self.async_watcher = _FakeAsync + + self.context = None + self.hub = None + self._call_when_ready = _FakeAsync + self.receiver = _FakeAsync + + def set(self, value): + self.value = value + self.async_watcher.send() + + def handle_error(self, context, exc_info): + self.context = context + self.exc_info = exc_info + self.async_watcher.send() + + # link protocol: + def successful(self): + return self.exception is None + + +def wrap_errors(errors, function, args, kwargs): + """ + .. deprecated:: 1.1a2 + Previously used by ThreadPool.apply_e. + """ + try: + return True, function(*args, **kwargs) + except errors as ex: + return False, ex + +try: + import concurrent.futures +except ImportError: + pass +else: + __all__.append("ThreadPoolExecutor") + + from gevent.timeout import Timeout as GTimeout + from gevent._util import Lazy + from concurrent.futures import _base as cfb + + def _wrap_error(future, fn): + def cbwrap(_): + del _ + # we're called with the async result, but + # be sure to pass in ourself. Also automatically + # unlink ourself so that we don't get called multiple + # times. + try: + fn(future) + except Exception: # pylint: disable=broad-except + future.hub.print_exception((fn, future), *sys.exc_info()) + cbwrap.auto_unlink = True + return cbwrap + + def _wrap(future, fn): + def f(_): + fn(future) + f.auto_unlink = True + return f + + class _FutureProxy(object): + def __init__(self, asyncresult): + self.asyncresult = asyncresult + + # Internal implementation details of a c.f.Future + + @Lazy + def _condition(self): + from gevent import monkey + if monkey.is_module_patched('threading') or self.done(): + import threading + return threading.Condition() + # We can only properly work with conditions + # when we've been monkey-patched. This is necessary + # for the wait/as_completed module functions. + raise AttributeError("_condition") + + @Lazy + def _waiters(self): + self.asyncresult.rawlink(self.__when_done) + return [] + + def __when_done(self, _): + # We should only be called when _waiters has + # already been accessed. + waiters = getattr(self, '_waiters') + for w in waiters: # pylint:disable=not-an-iterable + if self.successful(): + w.add_result(self) + else: + w.add_exception(self) + + __when_done.auto_unlink = True + + @property + def _state(self): + if self.done(): + return cfb.FINISHED + return cfb.RUNNING + + def set_running_or_notify_cancel(self): + # Does nothing, not even any consistency checks. It's + # meant to be internal to the executor and we don't use it. + return + + def result(self, timeout=None): + try: + return self.asyncresult.result(timeout=timeout) + except GTimeout: + # XXX: Theoretically this could be a completely + # unrelated timeout instance. Do we care about that? + raise concurrent.futures.TimeoutError() + + def exception(self, timeout=None): + try: + self.asyncresult.get(timeout=timeout) + return self.asyncresult.exception + except GTimeout: + raise concurrent.futures.TimeoutError() + + def add_done_callback(self, fn): + if self.done(): + fn(self) + else: + self.asyncresult.rawlink(_wrap_error(self, fn)) + + def rawlink(self, fn): + self.asyncresult.rawlink(_wrap(self, fn)) + + def __str__(self): + return str(self.asyncresult) + + def __getattr__(self, name): + return getattr(self.asyncresult, name) + + class ThreadPoolExecutor(concurrent.futures.ThreadPoolExecutor): + """ + A version of :class:`concurrent.futures.ThreadPoolExecutor` that + always uses native threads, even when threading is monkey-patched. + + The ``Future`` objects returned from this object can be used + with gevent waiting primitives like :func:`gevent.wait`. + + .. caution:: If threading is *not* monkey-patched, then the ``Future`` + objects returned by this object are not guaranteed to work with + :func:`~concurrent.futures.as_completed` and :func:`~concurrent.futures.wait`. + The individual blocking methods like :meth:`~concurrent.futures.Future.result` + and :meth:`~concurrent.futures.Future.exception` will always work. + + .. versionadded:: 1.2a1 + This is a provisional API. + """ + + def __init__(self, max_workers): + super(ThreadPoolExecutor, self).__init__(max_workers) + self._threadpool = ThreadPool(max_workers) + self._threadpool._destroy_worker_hub = True + + def submit(self, fn, *args, **kwargs): + with self._shutdown_lock: # pylint:disable=not-context-manager + if self._shutdown: + raise RuntimeError('cannot schedule new futures after shutdown') + + future = self._threadpool.spawn(fn, *args, **kwargs) + return _FutureProxy(future) + + def shutdown(self, wait=True): + super(ThreadPoolExecutor, self).shutdown(wait) + # XXX: We don't implement wait properly + kill = getattr(self._threadpool, 'kill', None) + if kill: # pylint:disable=using-constant-test + self._threadpool.kill() + self._threadpool = None + + kill = shutdown # greentest compat + + def _adjust_thread_count(self): + # Does nothing. We don't want to spawn any "threads", + # let the threadpool handle that. + pass diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/time.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/time.py new file mode 100644 index 00000000..34abf85e --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/time.py @@ -0,0 +1,27 @@ +# Copyright (c) 2018 gevent. See LICENSE for details. +""" +The standard library :mod:`time` module, but :func:`sleep` is +gevent-aware. + +.. versionadded:: 1.3a2 +""" + +from __future__ import absolute_import + +__implements__ = [ + 'sleep', +] + +__all__ = __implements__ + +import time as __time__ + +from gevent._util import copy_globals + +__imports__ = copy_globals(__time__, globals(), + names_to_ignore=__implements__) + + + +from gevent.hub import sleep +sleep = sleep # pylint diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/timeout.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/timeout.py new file mode 100644 index 00000000..383d0901 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/timeout.py @@ -0,0 +1,373 @@ +# Copyright (c) 2009-2010 Denis Bilenko. See LICENSE for details. +""" +Timeouts. + +Many functions in :mod:`gevent` have a *timeout* argument that allows +limiting the time the function will block. When that is not available, +the :class:`Timeout` class and :func:`with_timeout` function in this +module add timeouts to arbitrary code. + +.. warning:: + + Timeouts can only work when the greenlet switches to the hub. + If a blocking function is called or an intense calculation is ongoing during + which no switches occur, :class:`Timeout` is powerless. +""" +from __future__ import absolute_import, print_function, division + +from gevent._compat import string_types +from gevent._util import _NONE + +from greenlet import getcurrent +from gevent._hub_local import get_hub_noargs as get_hub + +__all__ = [ + 'Timeout', + 'with_timeout', +] + + +class _FakeTimer(object): + # An object that mimics the API of get_hub().loop.timer, but + # without allocating any native resources. This is useful for timeouts + # that will never expire. + # Also partially mimics the API of Timeout itself for use in _start_new_or_dummy + + # This object is used as a singleton, so it should be + # immutable. + __slots__ = () + + @property + def pending(self): + return False + + active = pending + + @property + def seconds(self): + "Always returns None" + + timer = exception = seconds + + def start(self, *args, **kwargs): + # pylint:disable=unused-argument + raise AssertionError("non-expiring timer cannot be started") + + def stop(self): + return + + cancel = stop + + stop = close = cancel + + def __enter__(self): + return self + + def __exit__(self, _t, _v, _tb): + return + +_FakeTimer = _FakeTimer() + + +class Timeout(BaseException): + """ + Timeout(seconds=None, exception=None, ref=True, priority=-1) + + Raise *exception* in the current greenlet after *seconds* + have elapsed:: + + timeout = Timeout(seconds, exception) + timeout.start() + try: + ... # exception will be raised here, after *seconds* passed since start() call + finally: + timeout.close() + + .. note:: + + If the code that the timeout was protecting finishes + executing before the timeout elapses, be sure to ``close`` the + timeout so it is not unexpectedly raised in the future. Even if it + is raised, it is a best practice to close it. This ``try/finally`` + construct or a ``with`` statement is a recommended pattern. (If + the timeout object will be started again, use ``cancel`` instead + of ``close``; this is rare.) + + When *exception* is omitted or ``None``, the ``Timeout`` instance + itself is raised:: + + >>> import gevent + >>> gevent.Timeout(0.1).start() + >>> gevent.sleep(0.2) #doctest: +IGNORE_EXCEPTION_DETAIL + Traceback (most recent call last): + ... + Timeout: 0.1 seconds + + If the *seconds* argument is not given or is ``None`` (e.g., + ``Timeout()``), then the timeout will never expire and never raise + *exception*. This is convenient for creating functions which take + an optional timeout parameter of their own. (Note that this is **not** + the same thing as a *seconds* value of ``0``.) + + :: + + def function(args, timeout=None): + "A function with an optional timeout." + timer = Timeout(timeout) + with timer: + ... + + .. caution:: + + A *seconds* value less than ``0.0`` (e.g., ``-1``) is poorly defined. In the future, + support for negative values is likely to do the same thing as a value + of ``None`` or ``0`` + + A *seconds* value of ``0`` requests that the event loop spin and poll for I/O; + it will immediately expire as soon as control returns to the event loop. + + .. rubric:: Use As A Context Manager + + To simplify starting and canceling timeouts, the ``with`` + statement can be used:: + + with gevent.Timeout(seconds, exception) as timeout: + pass # ... code block ... + + This is equivalent to the try/finally block above with one + additional feature: if *exception* is the literal ``False``, the + timeout is still raised, but the context manager suppresses it, so + the code outside the with-block won't see it. + + This is handy for adding a timeout to the functions that don't + support a *timeout* parameter themselves:: + + data = None + with gevent.Timeout(5, False): + data = mysock.makefile().readline() + if data is None: + ... # 5 seconds passed without reading a line + else: + ... # a line was read within 5 seconds + + .. caution:: + + If ``readline()`` above catches and doesn't re-raise + :exc:`BaseException` (for example, with a bare ``except:``), then + your timeout will fail to function and control won't be returned + to you when you expect. + + .. rubric:: Catching Timeouts + + When catching timeouts, keep in mind that the one you catch may + not be the one you have set (a calling function may have set its + own timeout); if you going to silence a timeout, always check that + it's the instance you need:: + + timeout = Timeout(1) + timeout.start() + try: + ... + except Timeout as t: + if t is not timeout: + raise # not my timeout + finally: + timeout.close() + + + .. versionchanged:: 1.1b2 + + If *seconds* is not given or is ``None``, no longer allocate a + native timer object that will never be started. + + .. versionchanged:: 1.1 + + Add warning about negative *seconds* values. + + .. versionchanged:: 1.3a1 + + Timeout objects now have a :meth:`close` + method that must be called when the timeout will no longer be + used to properly clean up native resources. + The ``with`` statement does this automatically. + + """ + + # We inherit a __dict__ from BaseException, so __slots__ actually + # makes us larger. + + def __init__(self, seconds=None, exception=None, ref=True, priority=-1, + _one_shot=False): + BaseException.__init__(self) + self.seconds = seconds + self.exception = exception + self._one_shot = _one_shot + if seconds is None: + # Avoid going through the timer codepath if no timeout is + # desired; this avoids some CFFI interactions on PyPy that can lead to a + # RuntimeError if this implementation is used during an `import` statement. See + # https://bitbucket.org/pypy/pypy/issues/2089/crash-in-pypy-260-linux64-with-gevent-11b1 + # and https://github.com/gevent/gevent/issues/618. + # Plus, in general, it should be more efficient + + self.timer = _FakeTimer + else: + # XXX: A timer <= 0 could cause libuv to block the loop; we catch + # that case in libuv/loop.py + self.timer = get_hub().loop.timer(seconds or 0.0, ref=ref, priority=priority) + + def start(self): + """Schedule the timeout.""" + if self.pending: + raise AssertionError('%r is already started; to restart it, cancel it first' % self) + + if self.seconds is None: + # "fake" timeout (never expires) + return + + if self.exception is None or self.exception is False or isinstance(self.exception, string_types): + # timeout that raises self + throws = self + else: + # regular timeout with user-provided exception + throws = self.exception + + # Make sure the timer updates the current time so that we don't + # expire prematurely. + self.timer.start(getcurrent().throw, throws, update=True) + + @classmethod + def start_new(cls, timeout=None, exception=None, ref=True, _one_shot=False): + """Create a started :class:`Timeout`. + + This is a shortcut, the exact action depends on *timeout*'s type: + + * If *timeout* is a :class:`Timeout`, then call its :meth:`start` method + if it's not already begun. + * Otherwise, create a new :class:`Timeout` instance, passing (*timeout*, *exception*) as + arguments, then call its :meth:`start` method. + + Returns the :class:`Timeout` instance. + """ + if isinstance(timeout, Timeout): + if not timeout.pending: + timeout.start() + return timeout + timeout = cls(timeout, exception, ref=ref, _one_shot=_one_shot) + timeout.start() + return timeout + + @staticmethod + def _start_new_or_dummy(timeout, exception=None, ref=True): + # Internal use only in 1.1 + # Return an object with a 'cancel' method; if timeout is None, + # this will be a shared instance object that does nothing. Otherwise, + # return an actual Timeout. Because negative values are hard to reason about, + # and are often used as sentinels in Python APIs, in the future it's likely + # that a negative timeout will also return the shared instance. + # This saves the previously common idiom of 'timer = Timeout.start_new(t) if t is not None else None' + # followed by 'if timer is not None: timer.cancel()'. + # That idiom was used to avoid any object allocations. + # A staticmethod is slightly faster under CPython, compared to a classmethod; + # under PyPy in synthetic benchmarks it makes no difference. + if timeout is None: + return _FakeTimer + return Timeout.start_new(timeout, exception, ref, _one_shot=True) + + @property + def pending(self): + """True if the timeout is scheduled to be raised.""" + return self.timer.pending or self.timer.active + + def cancel(self): + """ + If the timeout is pending, cancel it. Otherwise, do nothing. + + The timeout object can be :meth:`started ` again. If + you will not start the timeout again, you should use + :meth:`close` instead. + """ + self.timer.stop() + if self._one_shot: + self.close() + + def close(self): + """ + Close the timeout and free resources. The timer cannot be started again + after this method has been used. + """ + self.timer.stop() + self.timer.close() + self.timer = _FakeTimer + + def __repr__(self): + classname = type(self).__name__ + if self.pending: + pending = ' pending' + else: + pending = '' + if self.exception is None: + exception = '' + else: + exception = ' exception=%r' % self.exception + return '<%s at %s seconds=%s%s%s>' % (classname, hex(id(self)), self.seconds, exception, pending) + + def __str__(self): + """ + >>> raise Timeout #doctest: +IGNORE_EXCEPTION_DETAIL + Traceback (most recent call last): + ... + Timeout + """ + if self.seconds is None: + return '' + + suffix = '' if self.seconds == 1 else 's' + + if self.exception is None: + return '%s second%s' % (self.seconds, suffix) + if self.exception is False: + return '%s second%s (silent)' % (self.seconds, suffix) + return '%s second%s: %s' % (self.seconds, suffix, self.exception) + + def __enter__(self): + """ + Start and return the timer. If the timer is already started, just return it. + """ + if not self.pending: + self.start() + return self + + def __exit__(self, typ, value, tb): + """ + Stop the timer. + + .. versionchanged:: 1.3a1 + The underlying native timer is also stopped. This object cannot be + used again. + """ + self.close() + if value is self and self.exception is False: + return True # Suppress the exception + + +def with_timeout(seconds, function, *args, **kwds): + """Wrap a call to *function* with a timeout; if the called + function fails to return before the timeout, cancel it and return a + flag value, provided by *timeout_value* keyword argument. + + If timeout expires but *timeout_value* is not provided, raise :class:`Timeout`. + + Keyword argument *timeout_value* is not passed to *function*. + """ + timeout_value = kwds.pop("timeout_value", _NONE) + timeout = Timeout.start_new(seconds, _one_shot=True) + try: + try: + return function(*args, **kwds) + except Timeout as ex: + if ex is timeout and timeout_value is not _NONE: + return timeout_value + raise + finally: + timeout.cancel() diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/util.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/util.py new file mode 100644 index 00000000..b24898c3 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/util.py @@ -0,0 +1,603 @@ +# Copyright (c) 2009 Denis Bilenko. See LICENSE for details. +""" +Low-level utilities. +""" + +from __future__ import absolute_import, print_function, division + +import functools +import pprint +import sys +import traceback + +from greenlet import getcurrent + +from gevent._compat import perf_counter +from gevent._compat import PYPY +from gevent._compat import thread_mod_name +from gevent._util import _NONE + +__all__ = [ + 'format_run_info', + 'print_run_info', + 'GreenletTree', + 'wrap_errors', + 'assert_switches', +] + +# PyPy is very slow at formatting stacks +# for some reason. +_STACK_LIMIT = 20 if PYPY else None + + +def _noop(): + return None + +def _ready(): + return False + +class wrap_errors(object): + """ + Helper to make function return an exception, rather than raise it. + + Because every exception that is unhandled by greenlet will be logged, + it is desirable to prevent non-error exceptions from leaving a greenlet. + This can done with a simple ``try/except`` construct:: + + def wrapped_func(*args, **kwargs): + try: + return func(*args, **kwargs) + except (TypeError, ValueError, AttributeError) as ex: + return ex + + This class provides a shortcut to write that in one line:: + + wrapped_func = wrap_errors((TypeError, ValueError, AttributeError), func) + + It also preserves ``__str__`` and ``__repr__`` of the original function. + """ + # QQQ could also support using wrap_errors as a decorator + + def __init__(self, errors, func): + """ + Calling this makes a new function from *func*, such that it catches *errors* (an + :exc:`BaseException` subclass, or a tuple of :exc:`BaseException` subclasses) and + return it as a value. + """ + self.__errors = errors + self.__func = func + # Set __doc__, __wrapped__, etc, especially useful on Python 3. + functools.update_wrapper(self, func) + + def __call__(self, *args, **kwargs): + func = self.__func + try: + return func(*args, **kwargs) + except self.__errors as ex: + return ex + + def __str__(self): + return str(self.__func) + + def __repr__(self): + return repr(self.__func) + + def __getattr__(self, name): + return getattr(self.__func, name) + + +def print_run_info(thread_stacks=True, greenlet_stacks=True, limit=_NONE, file=None): + """ + Call `format_run_info` and print the results to *file*. + + If *file* is not given, `sys.stderr` will be used. + + .. versionadded:: 1.3b1 + """ + lines = format_run_info(thread_stacks=thread_stacks, + greenlet_stacks=greenlet_stacks, + limit=limit) + file = sys.stderr if file is None else file + for l in lines: + print(l, file=file) + + +def format_run_info(thread_stacks=True, + greenlet_stacks=True, + limit=_NONE, + current_thread_ident=None): + """ + format_run_info(thread_stacks=True, greenlet_stacks=True, limit=None) -> [str] + + Request information about the running threads of the current process. + + This is a debugging utility. Its output has no guarantees other than being + intended for human consumption. + + :keyword bool thread_stacks: If true, then include the stacks for + running threads. + :keyword bool greenlet_stacks: If true, then include the stacks for + running greenlets. (Spawning stacks will always be printed.) + Setting this to False can reduce the output volume considerably + without reducing the overall information if *thread_stacks* is true + and you can associate a greenlet to a thread (using ``thread_ident`` + printed values). + :keyword int limit: If given, passed directly to `traceback.format_stack`. + If not given, this defaults to the whole stack under CPython, and a + smaller stack under PyPy. + + :return: A sequence of text lines detailing the stacks of running + threads and greenlets. (One greenlet will duplicate one thread, + the current thread and greenlet. If there are multiple running threads, + the stack for the current greenlet may be incorrectly duplicated in multiple + greenlets.) + Extra information about + :class:`gevent.Greenlet` object will also be returned. + + .. versionadded:: 1.3a1 + .. versionchanged:: 1.3a2 + Renamed from ``dump_stacks`` to reflect the fact that this + prints additional information about greenlets, including their + spawning stack, parent, locals, and any spawn tree locals. + .. versionchanged:: 1.3b1 + Added the *thread_stacks*, *greenlet_stacks*, and *limit* params. + """ + if current_thread_ident is None: + from gevent import monkey + current_thread_ident = monkey.get_original(thread_mod_name, 'get_ident')() + + lines = [] + + limit = _STACK_LIMIT if limit is _NONE else limit + _format_thread_info(lines, thread_stacks, limit, current_thread_ident) + _format_greenlet_info(lines, greenlet_stacks, limit) + return lines + + +def _format_thread_info(lines, thread_stacks, limit, current_thread_ident): + import threading + + threads = {th.ident: th for th in threading.enumerate()} + + lines.append('*' * 80) + lines.append('* Threads') + + thread = None + frame = None + for thread_ident, frame in sys._current_frames().items(): + lines.append("*" * 80) + thread = threads.get(thread_ident) + name = thread.name if thread else None + if getattr(thread, 'gevent_monitoring_thread', None): + name = repr(thread.gevent_monitoring_thread()) + if current_thread_ident == thread_ident: + name = '%s) (CURRENT' % (name,) + lines.append('Thread 0x%x (%s)\n' % (thread_ident, name)) + if thread_stacks: + lines.append(''.join(traceback.format_stack(frame, limit))) + else: + lines.append('\t...stack elided...') + + # We may have captured our own frame, creating a reference + # cycle, so clear it out. + del thread + del frame + del lines + del threads + +def _format_greenlet_info(lines, greenlet_stacks, limit): + # Use the gc module to inspect all objects to find the greenlets + # since there isn't a global registry + lines.append('*' * 80) + lines.append('* Greenlets') + lines.append('*' * 80) + for tree in GreenletTree.forest(): + lines.extend(tree.format_lines(details={ + 'running_stacks': greenlet_stacks, + 'running_stack_limit': limit, + })) + + del lines + +dump_stacks = format_run_info + +def _line(f): + @functools.wraps(f) + def w(self, *args, **kwargs): + r = f(self, *args, **kwargs) + self.lines.append(r) + + return w + +class _TreeFormatter(object): + UP_AND_RIGHT = '+' + HORIZONTAL = '-' + VERTICAL = '|' + VERTICAL_AND_RIGHT = '+' + DATA = ':' + + label_space = 1 + horiz_width = 3 + indent = 1 + + def __init__(self, details, depth=0): + self.lines = [] + self.depth = depth + self.details = details + if not details: + self.child_data = lambda *args, **kwargs: None + + def deeper(self): + return type(self)(self.details, self.depth + 1) + + @_line + def node_label(self, text): + return text + + @_line + def child_head(self, label, right=VERTICAL_AND_RIGHT): + return ( + ' ' * self.indent + + right + + self.HORIZONTAL * self.horiz_width + + ' ' * self.label_space + + label + ) + + def last_child_head(self, label): + return self.child_head(label, self.UP_AND_RIGHT) + + @_line + def child_tail(self, line, vertical=VERTICAL): + return ( + ' ' * self.indent + + vertical + + ' ' * self.horiz_width + + line + ) + + def last_child_tail(self, line): + return self.child_tail(line, vertical=' ' * len(self.VERTICAL)) + + @_line + def child_data(self, data, data_marker=DATA): # pylint:disable=method-hidden + return (( + ' ' * self.indent + + (data_marker if not self.depth else ' ') + + ' ' * self.horiz_width + + ' ' * self.label_space + + data + ),) + + def last_child_data(self, data): + return self.child_data(data, ' ') + + def child_multidata(self, data): + # Remove embedded newlines + for l in data.splitlines(): + self.child_data(l) + + +class GreenletTree(object): + """ + Represents a tree of greenlets. + + In gevent, the *parent* of a greenlet is usually the hub, so this + tree is primarily arganized along the *spawning_greenlet* dimension. + + This object has a small str form showing this hierarchy. The `format` + method can output more details. The exact output is unspecified but is + intended to be human readable. + + Use the `forest` method to get the root greenlet trees for + all threads, and the `current_tree` to get the root greenlet tree for + the current thread. + """ + + #: The greenlet this tree represents. + greenlet = None + + + def __init__(self, greenlet): + self.greenlet = greenlet + self.child_trees = [] + + def add_child(self, tree): + if tree is self: + return + self.child_trees.append(tree) + + @property + def root(self): + return self.greenlet.parent is None + + def __getattr__(self, name): + return getattr(self.greenlet, name) + + DEFAULT_DETAILS = { + 'running_stacks': True, + 'running_stack_limit': _STACK_LIMIT, + 'spawning_stacks': True, + 'locals': True, + } + + def format_lines(self, details=True): + """ + Return a sequence of lines for the greenlet tree. + + :keyword bool details: If true (the default), + then include more informative details in the output. + """ + if not isinstance(details, dict): + if not details: + details = {} + else: + details = self.DEFAULT_DETAILS.copy() + else: + params = details + details = self.DEFAULT_DETAILS.copy() + details.update(params) + tree = _TreeFormatter(details, depth=0) + lines = [l[0] if isinstance(l, tuple) else l + for l in self._render(tree)] + return lines + + def format(self, details=True): + """ + Like `format_lines` but returns a string. + """ + lines = self.format_lines(details) + return '\n'.join(lines) + + def __str__(self): + return self.format(False) + + @staticmethod + def __render_tb(tree, label, frame, limit): + tree.child_data(label) + tb = ''.join(traceback.format_stack(frame, limit)) + tree.child_multidata(tb) + + @staticmethod + def __spawning_parent(greenlet): + return (getattr(greenlet, 'spawning_greenlet', None) or _noop)() + + def __render_locals(self, tree): + # Defer the import to avoid cycles + from gevent.local import all_local_dicts_for_greenlet + + gr_locals = all_local_dicts_for_greenlet(self.greenlet) + if gr_locals: + tree.child_data("Greenlet Locals:") + for (kind, idl), vals in gr_locals: + if not vals: + continue # not set in this greenlet; ignore it. + tree.child_data(" Local %s at %s" % (kind, hex(idl))) + tree.child_multidata(" " + pprint.pformat(vals)) + + def _render(self, tree): + label = repr(self.greenlet) + if not self.greenlet: # Not running or dead + # raw greenlets do not have ready + if getattr(self.greenlet, 'ready', _ready)(): + label += '; finished' + if self.greenlet.value is not None: + label += ' with value ' + repr(self.greenlet.value)[:30] + elif getattr(self.greenlet, 'exception', None) is not None: + label += ' with exception ' + repr(self.greenlet.exception) + else: + label += '; not running' + tree.node_label(label) + + tree.child_data('Parent: ' + repr(self.greenlet.parent)) + + if getattr(self.greenlet, 'gevent_monitoring_thread', None) is not None: + tree.child_data('Monitoring Thread:' + repr(self.greenlet.gevent_monitoring_thread())) + + if self.greenlet and tree.details and tree.details['running_stacks']: + self.__render_tb(tree, 'Running:', self.greenlet.gr_frame, + tree.details['running_stack_limit']) + + + spawning_stack = getattr(self.greenlet, 'spawning_stack', None) + if spawning_stack and tree.details and tree.details['spawning_stacks']: + # We already placed a limit on the spawning stack when we captured it. + self.__render_tb(tree, 'Spawned at:', spawning_stack, None) + + spawning_parent = self.__spawning_parent(self.greenlet) + tree_locals = getattr(self.greenlet, 'spawn_tree_locals', None) + if tree_locals and tree_locals is not getattr(spawning_parent, 'spawn_tree_locals', None): + tree.child_data('Spawn Tree Locals') + tree.child_multidata(pprint.pformat(tree_locals)) + + self.__render_locals(tree) + self.__render_children(tree) + return tree.lines + + def __render_children(self, tree): + children = sorted(self.child_trees, + key=lambda c: ( + # raw greenlets first + getattr(c, 'minimal_ident', -1), + # running greenlets first + getattr(c, 'ready', _ready)(), + id(c.parent))) + for n, child in enumerate(children): + child_tree = child._render(tree.deeper()) + + head = tree.child_head + tail = tree.child_tail + data = tree.child_data + + if n == len(children) - 1: + # last child does not get the line drawn + head = tree.last_child_head + tail = tree.last_child_tail + data = tree.last_child_data + + head(child_tree.pop(0)) + for child_data in child_tree: + if isinstance(child_data, tuple): + data(child_data[0]) + else: + tail(child_data) + + return tree.lines + + + @staticmethod + def _root_greenlet(greenlet): + while greenlet.parent is not None and not getattr(greenlet, 'greenlet_tree_is_root', False): + greenlet = greenlet.parent + return greenlet + + @classmethod + def _forest(cls): + from gevent._greenlet_primitives import get_reachable_greenlets + main_greenlet = cls._root_greenlet(getcurrent()) + + trees = {} + roots = {} + current_tree = roots[main_greenlet] = trees[main_greenlet] = cls(main_greenlet) + + glets = get_reachable_greenlets() + + for ob in glets: + spawn_parent = cls.__spawning_parent(ob) + + if spawn_parent is None: + root = cls._root_greenlet(ob) + try: + tree = roots[root] + except KeyError: # pragma: no cover + tree = GreenletTree(root) + roots[root] = trees[root] = tree + else: + try: + tree = trees[spawn_parent] + except KeyError: # pragma: no cover + tree = trees[spawn_parent] = cls(spawn_parent) + + try: + child_tree = trees[ob] + except KeyError: + trees[ob] = child_tree = cls(ob) + tree.add_child(child_tree) + + return roots, current_tree + + @classmethod + def forest(cls): + """ + forest() -> sequence + + Return a sequence of `GreenletTree`, one for each running + native thread. + """ + + return list(cls._forest()[0].values()) + + @classmethod + def current_tree(cls): + """ + current_tree() -> GreenletTree + + Returns the `GreenletTree` for the current thread. + """ + return cls._forest()[1] + +class _FailedToSwitch(AssertionError): + pass + +class assert_switches(object): + """ + A context manager for ensuring a block of code switches greenlets. + + This performs a similar function as the :doc:`monitoring thread + `, but the scope is limited to the body of the with + statement. If the code within the body doesn't yield to the hub + (and doesn't raise an exception), then upon exiting the + context manager an :exc:`AssertionError` will be raised. + + This is useful in unit tests and for debugging purposes. + + :keyword float max_blocking_time: If given, the body is allowed + to block for up to this many fractional seconds before + an error is raised. + :keyword bool hub_only: If True, then *max_blocking_time* only + refers to the amount of time spent between switches into the + hub. If False, then it refers to the maximum time between + *any* switches. If *max_blocking_time* is not given, has no + effect. + + Example:: + + # This will always raise an exception: nothing switched + with assert_switches(): + pass + + # This will never raise an exception; nothing switched, + # but it happened very fast + with assert_switches(max_blocking_time=1.0): + pass + + .. versionadded:: 1.3 + + .. versionchanged:: 1.4 + If an exception is raised, it now includes information about + the duration of blocking and the parameters of this object. + """ + + hub = None + tracer = None + _entered = None + + + def __init__(self, max_blocking_time=None, hub_only=False): + self.max_blocking_time = max_blocking_time + self.hub_only = hub_only + + def __enter__(self): + from gevent import get_hub + from gevent import _tracer + + self.hub = hub = get_hub() + + # TODO: We could optimize this to use the GreenletTracer + # installed by the monitoring thread, if there is one. + # As it is, we will chain trace calls back to it. + if not self.max_blocking_time: + self.tracer = _tracer.GreenletTracer() + elif self.hub_only: + self.tracer = _tracer.HubSwitchTracer(hub, self.max_blocking_time) + else: + self.tracer = _tracer.MaxSwitchTracer(hub, self.max_blocking_time) + + self._entered = perf_counter() + self.tracer.monitor_current_greenlet_blocking() + return self + + def __exit__(self, t, v, tb): + self.tracer.kill() + hub = self.hub; self.hub = None + tracer = self.tracer; self.tracer = None + + # Only check if there was no exception raised, we + # don't want to hide anything + if t is not None: + return + + + did_block = tracer.did_block_hub(hub) + if did_block: + execution_time_s = perf_counter() - self._entered + active_greenlet = did_block[1] + report_lines = tracer.did_block_hub_report(hub, active_greenlet, {}) + + message = 'To the hub' if self.hub_only else 'To any greenlet' + message += ' in %.4f seconds' % (execution_time_s,) + max_block = self.max_blocking_time + message += ' (max allowed %.4f seconds)' % (max_block,) if max_block else '' + message += '\n' + message += '\n'.join(report_lines) + raise _FailedToSwitch(message) diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/win32util.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/win32util.py new file mode 100644 index 00000000..7158d693 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/win32util.py @@ -0,0 +1,98 @@ +# Copyright (c) 2001-2007 Twisted Matrix Laboratories. +# Permission is hereby granted, free of charge, to any person obtaining +# a copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject to +# the following conditions: +# +# The above copyright notice and this permission notice shall be +# included in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +"""Error formatting function for Windows. + +The code is taken from twisted.python.win32 module. +""" + +from __future__ import absolute_import +import os + + +__all__ = ['formatError'] + + +class _ErrorFormatter(object): + """ + Formatter for Windows error messages. + + @ivar winError: A callable which takes one integer error number argument + and returns an L{exceptions.WindowsError} instance for that error (like + L{ctypes.WinError}). + + @ivar formatMessage: A callable which takes one integer error number + argument and returns a C{str} giving the message for that error (like + L{win32api.FormatMessage}). + + @ivar errorTab: A mapping from integer error numbers to C{str} messages + which correspond to those errors (like L{socket.errorTab}). + """ + def __init__(self, WinError, FormatMessage, errorTab): + self.winError = WinError + self.formatMessage = FormatMessage + self.errorTab = errorTab + + @classmethod + def fromEnvironment(cls): + """ + Get as many of the platform-specific error translation objects as + possible and return an instance of C{cls} created with them. + """ + try: + from ctypes import WinError + except ImportError: + WinError = None + try: + from win32api import FormatMessage + except ImportError: + FormatMessage = None + try: + from socket import errorTab + except ImportError: + errorTab = None + return cls(WinError, FormatMessage, errorTab) + + def formatError(self, errorcode): + """ + Returns the string associated with a Windows error message, such as the + ones found in socket.error. + + Attempts direct lookup against the win32 API via ctypes and then + pywin32 if available), then in the error table in the socket module, + then finally defaulting to C{os.strerror}. + + @param errorcode: the Windows error code + @type errorcode: C{int} + + @return: The error message string + @rtype: C{str} + """ + if self.winError is not None: + return str(self.winError(errorcode)) + if self.formatMessage is not None: + return self.formatMessage(errorcode) + if self.errorTab is not None: + result = self.errorTab.get(errorcode) + if result is not None: + return result + return os.strerror(errorcode) + +formatError = _ErrorFormatter.fromEnvironment().formatError diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/greenlet-0.4.15.dist-info/INSTALLER b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/greenlet-0.4.15.dist-info/INSTALLER new file mode 100644 index 00000000..a1b589e3 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/greenlet-0.4.15.dist-info/INSTALLER @@ -0,0 +1 @@ +pip diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/greenlet-0.4.15.dist-info/METADATA b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/greenlet-0.4.15.dist-info/METADATA new file mode 100644 index 00000000..ed06223a --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/greenlet-0.4.15.dist-info/METADATA @@ -0,0 +1,90 @@ +Metadata-Version: 2.1 +Name: greenlet +Version: 0.4.15 +Summary: Lightweight in-process concurrent programming +Home-page: https://github.com/python-greenlet/greenlet +Maintainer: Alexey Borzenkov +Maintainer-email: snaury@gmail.com +License: MIT License +Platform: any +Classifier: Intended Audience :: Developers +Classifier: License :: OSI Approved :: MIT License +Classifier: Natural Language :: English +Classifier: Programming Language :: C +Classifier: Programming Language :: Python +Classifier: Programming Language :: Python :: 2 +Classifier: Programming Language :: Python :: 2.4 +Classifier: Programming Language :: Python :: 2.5 +Classifier: Programming Language :: Python :: 2.6 +Classifier: Programming Language :: Python :: 2.7 +Classifier: Programming Language :: Python :: 3 +Classifier: Programming Language :: Python :: 3.0 +Classifier: Programming Language :: Python :: 3.1 +Classifier: Programming Language :: Python :: 3.2 +Classifier: Programming Language :: Python :: 3.3 +Classifier: Programming Language :: Python :: 3.4 +Classifier: Programming Language :: Python :: 3.5 +Classifier: Programming Language :: Python :: 3.6 +Classifier: Programming Language :: Python :: 3.7 +Classifier: Operating System :: OS Independent +Classifier: Topic :: Software Development :: Libraries :: Python Modules + +.. image:: https://secure.travis-ci.org/python-greenlet/greenlet.png + :target: http://travis-ci.org/python-greenlet/greenlet + +The greenlet package is a spin-off of Stackless, a version of CPython +that supports micro-threads called "tasklets". Tasklets run +pseudo-concurrently (typically in a single or a few OS-level threads) +and are synchronized with data exchanges on "channels". + +A "greenlet", on the other hand, is a still more primitive notion of +micro-thread with no implicit scheduling; coroutines, in other +words. This is useful when you want to control exactly when your code +runs. You can build custom scheduled micro-threads on top of greenlet; +however, it seems that greenlets are useful on their own as a way to +make advanced control flow structures. For example, we can recreate +generators; the difference with Python's own generators is that our +generators can call nested functions and the nested functions can +yield values too. Additionally, you don't need a "yield" keyword. See +the example in tests/test_generator.py. + +Greenlets are provided as a C extension module for the regular +unmodified interpreter. + +Greenlets are lightweight coroutines for in-process concurrent +programming. + +Who is using Greenlet? +====================== + +There are several libraries that use Greenlet as a more flexible +alternative to Python's built in coroutine support: + + - `Concurrence`_ + - `Eventlet`_ + - `Gevent`_ + +.. _Concurrence: http://opensource.hyves.org/concurrence/ +.. _Eventlet: http://eventlet.net/ +.. _Gevent: http://www.gevent.org/ + +Getting Greenlet +================ + +The easiest way to get Greenlet is to install it with pip or +easy_install:: + + pip install greenlet + easy_install greenlet + + +Source code archives and windows installers are available on the +python package index at https://pypi.python.org/pypi/greenlet + +The source code repository is hosted on github: +https://github.com/python-greenlet/greenlet + +Documentation is available on readthedocs.org: +https://greenlet.readthedocs.io + + diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/greenlet-0.4.15.dist-info/RECORD b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/greenlet-0.4.15.dist-info/RECORD new file mode 100644 index 00000000..e4806c89 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/greenlet-0.4.15.dist-info/RECORD @@ -0,0 +1,7 @@ +../../Include/greenlet/greenlet.h,sha256=SlcS2utGqDJj1KnMDK745yitcJKNUIbAUaFA8rN-4sY,3972 +greenlet-0.4.15.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4 +greenlet-0.4.15.dist-info/METADATA,sha256=QAeWa2K18gQhCDt1FDxaJts5YpJZ7B8ez3wBioeUmDQ,3304 +greenlet-0.4.15.dist-info/RECORD,, +greenlet-0.4.15.dist-info/WHEEL,sha256=jmFYSwR2oi5DgMGgmnuB-EJxqLMkUojGGdmJ0wz35aI,106 +greenlet-0.4.15.dist-info/top_level.txt,sha256=YSnRsCRoO61JGlP57o8iKL6rdLWDWuiyKD8ekpWUsDc,9 +greenlet.cp37-win_amd64.pyd,sha256=U4-Wz68AyUzmYwV9oFBXqftEg7jWHPAULeB9DEsRc60,28672 diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/greenlet-0.4.15.dist-info/WHEEL b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/greenlet-0.4.15.dist-info/WHEEL new file mode 100644 index 00000000..c4de990e --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/greenlet-0.4.15.dist-info/WHEEL @@ -0,0 +1,5 @@ +Wheel-Version: 1.0 +Generator: bdist_wheel (0.31.1) +Root-Is-Purelib: false +Tag: cp37-cp37m-win_amd64 + diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/greenlet-0.4.15.dist-info/top_level.txt b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/greenlet-0.4.15.dist-info/top_level.txt new file mode 100644 index 00000000..46725be4 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/greenlet-0.4.15.dist-info/top_level.txt @@ -0,0 +1 @@ +greenlet diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/greenlet.cp37-win_amd64.pyd b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/greenlet.cp37-win_amd64.pyd new file mode 100644 index 0000000000000000000000000000000000000000..c5bc3db61f9c360485f789a4762fb41968877391 GIT binary patch literal 28672 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 + +Patches and Suggestions +``````````````````````` +- Kracekumar +- Spencer Young diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/grequests-0.4.0.dist-info/INSTALLER b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/grequests-0.4.0.dist-info/INSTALLER new file mode 100644 index 00000000..a1b589e3 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/grequests-0.4.0.dist-info/INSTALLER @@ -0,0 +1 @@ +pip diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/grequests-0.4.0.dist-info/LICENSE b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/grequests-0.4.0.dist-info/LICENSE new file mode 100644 index 00000000..92b09966 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/grequests-0.4.0.dist-info/LICENSE @@ -0,0 +1,8 @@ +Copyright (c) 2012, Kenneth Reitz +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + +Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. +Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/grequests-0.4.0.dist-info/METADATA b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/grequests-0.4.0.dist-info/METADATA new file mode 100644 index 00000000..27d3476f --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/grequests-0.4.0.dist-info/METADATA @@ -0,0 +1,51 @@ +Metadata-Version: 2.1 +Name: grequests +Version: 0.4.0 +Summary: Requests + Gevent +Home-page: https://github.com/kennethreitz/grequests +Author: Kenneth Reitz +Author-email: me@kennethreitz.com +License: BSD +Platform: any +Classifier: Environment :: Web Environment +Classifier: Intended Audience :: Developers +Classifier: License :: OSI Approved :: BSD License +Classifier: Operating System :: OS Independent +Classifier: Programming Language :: Python +Classifier: Programming Language :: Python :: 2.7 +Classifier: Programming Language :: Python :: 3 +Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content +Classifier: Topic :: Software Development :: Libraries :: Python Modules +Requires-Dist: gevent +Requires-Dist: requests + + +GRequests allows you to use Requests with Gevent to make asynchronous HTTP +Requests easily. + +Usage +----- + +Usage is simple:: + + import grequests + + urls = [ + 'http://www.heroku.com', + 'http://tablib.org', + 'http://httpbin.org', + 'http://python-requests.org', + 'http://kennethreitz.com' + ] + +Create a set of unsent Requests:: + + >>> rs = (grequests.get(u) for u in urls) + +Send them all at the same time:: + + >>> grequests.map(rs) + [, , , , ] + + + diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/grequests-0.4.0.dist-info/RECORD b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/grequests-0.4.0.dist-info/RECORD new file mode 100644 index 00000000..ced81b3e --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/grequests-0.4.0.dist-info/RECORD @@ -0,0 +1,9 @@ +__pycache__/grequests.cpython-37.pyc,, +grequests-0.4.0.dist-info/AUTHORS.rst,sha256=ewdckzqaNiB22iSBKBE2FzmAGZUF2d4QZOgsjWsLLP4,279 +grequests-0.4.0.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4 +grequests-0.4.0.dist-info/LICENSE,sha256=QGOIKokT5LN0V9WP5mAL2XW6BTyNsujGshjnychXXKg,1283 +grequests-0.4.0.dist-info/METADATA,sha256=OFvAy0BijQRUVxjUgJtPlJ8tYaL1llxieBsdoDCnFZ4,1295 +grequests-0.4.0.dist-info/RECORD,, +grequests-0.4.0.dist-info/WHEEL,sha256=S8S5VL-stOTSZDYxHyf0KP7eds0J72qrK0Evu3TfyAY,92 +grequests-0.4.0.dist-info/top_level.txt,sha256=SvomK5-sUWHynE71HKM4mN2xdcHn1pjlCL3FsRYU4CI,10 +grequests.py,sha256=ROfKNTnDmVtkKRCaUy5EruF_9CWY8462urH45k74unk,4982 diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/grequests-0.4.0.dist-info/WHEEL b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/grequests-0.4.0.dist-info/WHEEL new file mode 100644 index 00000000..c57a5970 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/grequests-0.4.0.dist-info/WHEEL @@ -0,0 +1,5 @@ +Wheel-Version: 1.0 +Generator: bdist_wheel (0.33.4) +Root-Is-Purelib: true +Tag: py3-none-any + diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/grequests-0.4.0.dist-info/top_level.txt b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/grequests-0.4.0.dist-info/top_level.txt new file mode 100644 index 00000000..2276f043 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/grequests-0.4.0.dist-info/top_level.txt @@ -0,0 +1 @@ +grequests diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/grequests.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/grequests.py new file mode 100644 index 00000000..582cffbb --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/grequests.py @@ -0,0 +1,155 @@ +# -*- coding: utf-8 -*- + +""" +grequests +~~~~~~~~~ + +This module contains an asynchronous replica of ``requests.api``, powered +by gevent. All API methods return a ``Request`` instance (as opposed to +``Response``). A list of requests can be sent with ``map()``. +""" +from functools import partial +import traceback +try: + import gevent + from gevent import monkey as curious_george + from gevent.pool import Pool +except ImportError: + raise RuntimeError('Gevent is required for grequests.') + +# Monkey-patch. +curious_george.patch_all(thread=False, select=False) + +from requests import Session + + +__all__ = ( + 'map', 'imap', + 'get', 'options', 'head', 'post', 'put', 'patch', 'delete', 'request' +) + + +class AsyncRequest(object): + """ Asynchronous request. + + Accept same parameters as ``Session.request`` and some additional: + + :param session: Session which will do request + :param callback: Callback called on response. + Same as passing ``hooks={'response': callback}`` + """ + def __init__(self, method, url, **kwargs): + #: Request method + self.method = method + #: URL to request + self.url = url + #: Associated ``Session`` + self.session = kwargs.pop('session', None) + if self.session is None: + self.session = Session() + + callback = kwargs.pop('callback', None) + if callback: + kwargs['hooks'] = {'response': callback} + + #: The rest arguments for ``Session.request`` + self.kwargs = kwargs + #: Resulting ``Response`` + self.response = None + + def send(self, **kwargs): + """ + Prepares request based on parameter passed to constructor and optional ``kwargs```. + Then sends request and saves response to :attr:`response` + + :returns: ``Response`` + """ + merged_kwargs = {} + merged_kwargs.update(self.kwargs) + merged_kwargs.update(kwargs) + try: + self.response = self.session.request(self.method, + self.url, **merged_kwargs) + except Exception as e: + self.exception = e + self.traceback = traceback.format_exc() + return self + + +def send(r, pool=None, stream=False): + """Sends the request object using the specified pool. If a pool isn't + specified this method blocks. Pools are useful because you can specify size + and can hence limit concurrency.""" + if pool is not None: + return pool.spawn(r.send, stream=stream) + + return gevent.spawn(r.send, stream=stream) + + +# Shortcuts for creating AsyncRequest with appropriate HTTP method +get = partial(AsyncRequest, 'GET') +options = partial(AsyncRequest, 'OPTIONS') +head = partial(AsyncRequest, 'HEAD') +post = partial(AsyncRequest, 'POST') +put = partial(AsyncRequest, 'PUT') +patch = partial(AsyncRequest, 'PATCH') +delete = partial(AsyncRequest, 'DELETE') + +# synonym +def request(method, url, **kwargs): + return AsyncRequest(method, url, **kwargs) + + +def map(requests, stream=False, size=None, exception_handler=None, gtimeout=None): + """Concurrently converts a list of Requests to Responses. + + :param requests: a collection of Request objects. + :param stream: If True, the content will not be downloaded immediately. + :param size: Specifies the number of requests to make at a time. If None, no throttling occurs. + :param exception_handler: Callback function, called when exception occured. Params: Request, Exception + :param gtimeout: Gevent joinall timeout in seconds. (Note: unrelated to requests timeout) + """ + + requests = list(requests) + + pool = Pool(size) if size else None + jobs = [send(r, pool, stream=stream) for r in requests] + gevent.joinall(jobs, timeout=gtimeout) + + ret = [] + + for request in requests: + if request.response is not None: + ret.append(request.response) + elif exception_handler and hasattr(request, 'exception'): + ret.append(exception_handler(request, request.exception)) + else: + ret.append(None) + + return ret + + +def imap(requests, stream=False, size=2, exception_handler=None): + """Concurrently converts a generator object of Requests to + a generator of Responses. + + :param requests: a generator of Request objects. + :param stream: If True, the content will not be downloaded immediately. + :param size: Specifies the number of requests to make at a time. default is 2 + :param exception_handler: Callback function, called when exception occurred. Params: Request, Exception + """ + + pool = Pool(size) + + def send(r): + return r.send(stream=stream) + + for request in pool.imap_unordered(send, requests): + if request.response is not None: + yield request.response + elif exception_handler: + ex_result = exception_handler(request, request.exception) + if ex_result is not None: + yield ex_result + + pool.join() diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pycparser-2.19.dist-info/INSTALLER b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pycparser-2.19.dist-info/INSTALLER new file mode 100644 index 00000000..a1b589e3 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pycparser-2.19.dist-info/INSTALLER @@ -0,0 +1 @@ +pip diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pycparser-2.19.dist-info/LICENSE b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pycparser-2.19.dist-info/LICENSE new file mode 100644 index 00000000..79b7547b --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pycparser-2.19.dist-info/LICENSE @@ -0,0 +1,27 @@ +pycparser -- A C parser in Python + +Copyright (c) 2008-2017, Eli Bendersky +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. +* Neither the name of Eli Bendersky nor the names of its contributors may + be used to endorse or promote products derived from this software without + specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE +GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT +OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pycparser-2.19.dist-info/METADATA b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pycparser-2.19.dist-info/METADATA new file mode 100644 index 00000000..2d52ad35 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pycparser-2.19.dist-info/METADATA @@ -0,0 +1,27 @@ +Metadata-Version: 2.1 +Name: pycparser +Version: 2.19 +Summary: C parser in Python +Home-page: https://github.com/eliben/pycparser +Author: Eli Bendersky +Author-email: eliben@gmail.com +Maintainer: Eli Bendersky +License: BSD +Platform: Cross Platform +Classifier: Development Status :: 5 - Production/Stable +Classifier: License :: OSI Approved :: BSD License +Classifier: Programming Language :: Python :: 2 +Classifier: Programming Language :: Python :: 2.7 +Classifier: Programming Language :: Python :: 3 +Classifier: Programming Language :: Python :: 3.4 +Classifier: Programming Language :: Python :: 3.5 +Classifier: Programming Language :: Python :: 3.6 +Requires-Python: >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.* + + +pycparser is a complete parser of the C language, written in +pure Python using the PLY parsing library. +It parses C code into an AST and can serve as a front-end for +C compilers or analysis tools. + + diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pycparser-2.19.dist-info/RECORD b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pycparser-2.19.dist-info/RECORD new file mode 100644 index 00000000..3a5d3f05 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pycparser-2.19.dist-info/RECORD @@ -0,0 +1,41 @@ +pycparser-2.19.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4 +pycparser-2.19.dist-info/LICENSE,sha256=PHZimICuwvhXjtkUcBpP-eXai2CsuLfsZ1q_g8kMUWg,1536 +pycparser-2.19.dist-info/METADATA,sha256=CDPZp84-Z-e3JjYcfl1VYRqPDCb63NDFNnkYWOku4K0,907 +pycparser-2.19.dist-info/RECORD,, +pycparser-2.19.dist-info/WHEEL,sha256=05Ahrak1u2K61DpLp9CDNSbUImLTITCMom_cqTFk6pE,116 +pycparser-2.19.dist-info/top_level.txt,sha256=c-lPcS74L_8KoH7IE6PQF5ofyirRQNV4VhkbSFIPeWM,10 +pycparser/__init__.py,sha256=l19iRjKsyE_eW9SvElacCuSbVkQzqyNSFCK3wv8ineA,2815 +pycparser/__pycache__/__init__.cpython-37.pyc,, +pycparser/__pycache__/_ast_gen.cpython-37.pyc,, +pycparser/__pycache__/_build_tables.cpython-37.pyc,, +pycparser/__pycache__/ast_transforms.cpython-37.pyc,, +pycparser/__pycache__/c_ast.cpython-37.pyc,, +pycparser/__pycache__/c_generator.cpython-37.pyc,, +pycparser/__pycache__/c_lexer.cpython-37.pyc,, +pycparser/__pycache__/c_parser.cpython-37.pyc,, +pycparser/__pycache__/lextab.cpython-37.pyc,, +pycparser/__pycache__/plyparser.cpython-37.pyc,, +pycparser/__pycache__/yacctab.cpython-37.pyc,, +pycparser/_ast_gen.py,sha256=_LbRr_kKa2EHeb7y0gV525JV29nzCUbTH4oZ-9I4qIs,10607 +pycparser/_build_tables.py,sha256=e5lcS2_Y4XpQfAArDg4PeHkoGwWT6tbA_8zOiOl4Hzw,859 +pycparser/_c_ast.cfg,sha256=1W8-DHa5RqZvyhha_0b4VvKL0CEYv9W0xFs_YwiyEHY,4206 +pycparser/ast_transforms.py,sha256=K8cflFZMTgNLGg6X2jufnIuan38GTSo47G6tePMc-70,3576 +pycparser/c_ast.py,sha256=5x9bn9FMEenOJdfKdIUWLcgnZ4ib6bWpwCa8Hi5FA6M,31317 +pycparser/c_generator.py,sha256=4ZBVFnaxDXpGi7w4N87DvAj9y2rEiDYzB2gga2YBuak,14668 +pycparser/c_lexer.py,sha256=9W9CoPxy1CQQazn9kwE1Y6QPm17A_-NyUKjwiq3YS5Q,14464 +pycparser/c_parser.py,sha256=iBynfNgX_EqIAnYVByK5fu1YK1EFOvIR0pie42Hp_rY,69222 +pycparser/lextab.py,sha256=FyjRIsaq2wViDqJNYScURuc7GDW5F12VuYxOJLh1j4g,7011 +pycparser/ply/__init__.py,sha256=q4s86QwRsYRa20L9ueSxfh-hPihpftBjDOvYa2_SS2Y,102 +pycparser/ply/__pycache__/__init__.cpython-37.pyc,, +pycparser/ply/__pycache__/cpp.cpython-37.pyc,, +pycparser/ply/__pycache__/ctokens.cpython-37.pyc,, +pycparser/ply/__pycache__/lex.cpython-37.pyc,, +pycparser/ply/__pycache__/yacc.cpython-37.pyc,, +pycparser/ply/__pycache__/ygen.cpython-37.pyc,, +pycparser/ply/cpp.py,sha256=UtC3ylTWp5_1MKA-PLCuwKQR8zSOnlGuGGIdzj8xS98,33282 +pycparser/ply/ctokens.py,sha256=MKksnN40TehPhgVfxCJhjj_BjL943apreABKYz-bl0Y,3177 +pycparser/ply/lex.py,sha256=7Qol57x702HZwjA3ZLp-84CUEWq1EehW-N67Wzghi-M,42918 +pycparser/ply/yacc.py,sha256=eatSDkRLgRr6X3-hoDk_SQQv065R0BdL2K7fQ54CgVM,137323 +pycparser/ply/ygen.py,sha256=2JYNeYtrPz1JzLSLO3d4GsS8zJU8jY_I_CR1VI9gWrA,2251 +pycparser/plyparser.py,sha256=saGNjpsgncQz-hHEh45f28BLqopTxHffaJg_9BCZhi8,4873 +pycparser/yacctab.py,sha256=KOewsHNgbSYaYrLvDJr7K3jXj-7qou0ngyNEnhDmyB4,169715 diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pycparser-2.19.dist-info/WHEEL b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pycparser-2.19.dist-info/WHEEL new file mode 100644 index 00000000..c8240f03 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pycparser-2.19.dist-info/WHEEL @@ -0,0 +1,6 @@ +Wheel-Version: 1.0 +Generator: bdist_wheel (0.33.1) +Root-Is-Purelib: true +Tag: py2-none-any +Tag: py3-none-any + diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pycparser-2.19.dist-info/top_level.txt b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pycparser-2.19.dist-info/top_level.txt new file mode 100644 index 00000000..dc1c9e10 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pycparser-2.19.dist-info/top_level.txt @@ -0,0 +1 @@ +pycparser diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pycparser/__init__.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pycparser/__init__.py new file mode 100644 index 00000000..b67389f4 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pycparser/__init__.py @@ -0,0 +1,90 @@ +#----------------------------------------------------------------- +# pycparser: __init__.py +# +# This package file exports some convenience functions for +# interacting with pycparser +# +# Eli Bendersky [https://eli.thegreenplace.net/] +# License: BSD +#----------------------------------------------------------------- +__all__ = ['c_lexer', 'c_parser', 'c_ast'] +__version__ = '2.19' + +import io +from subprocess import check_output +from .c_parser import CParser + + +def preprocess_file(filename, cpp_path='cpp', cpp_args=''): + """ Preprocess a file using cpp. + + filename: + Name of the file you want to preprocess. + + cpp_path: + cpp_args: + Refer to the documentation of parse_file for the meaning of these + arguments. + + When successful, returns the preprocessed file's contents. + Errors from cpp will be printed out. + """ + path_list = [cpp_path] + if isinstance(cpp_args, list): + path_list += cpp_args + elif cpp_args != '': + path_list += [cpp_args] + path_list += [filename] + + try: + # Note the use of universal_newlines to treat all newlines + # as \n for Python's purpose + text = check_output(path_list, universal_newlines=True) + except OSError as e: + raise RuntimeError("Unable to invoke 'cpp'. " + + 'Make sure its path was passed correctly\n' + + ('Original error: %s' % e)) + + return text + + +def parse_file(filename, use_cpp=False, cpp_path='cpp', cpp_args='', + parser=None): + """ Parse a C file using pycparser. + + filename: + Name of the file you want to parse. + + use_cpp: + Set to True if you want to execute the C pre-processor + on the file prior to parsing it. + + cpp_path: + If use_cpp is True, this is the path to 'cpp' on your + system. If no path is provided, it attempts to just + execute 'cpp', so it must be in your PATH. + + cpp_args: + If use_cpp is True, set this to the command line arguments strings + to cpp. Be careful with quotes - it's best to pass a raw string + (r'') here. For example: + r'-I../utils/fake_libc_include' + If several arguments are required, pass a list of strings. + + parser: + Optional parser object to be used instead of the default CParser + + When successful, an AST is returned. ParseError can be + thrown if the file doesn't parse successfully. + + Errors from cpp will be printed out. + """ + if use_cpp: + text = preprocess_file(filename, cpp_path, cpp_args) + else: + with io.open(filename) as f: + text = f.read() + + if parser is None: + parser = CParser() + return parser.parse(text, filename) diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pycparser/_ast_gen.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pycparser/_ast_gen.py new file mode 100644 index 00000000..5ec2d3df --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pycparser/_ast_gen.py @@ -0,0 +1,338 @@ +#----------------------------------------------------------------- +# _ast_gen.py +# +# Generates the AST Node classes from a specification given in +# a configuration file +# +# The design of this module was inspired by astgen.py from the +# Python 2.5 code-base. +# +# Eli Bendersky [https://eli.thegreenplace.net/] +# License: BSD +#----------------------------------------------------------------- +import pprint +from string import Template + + +class ASTCodeGenerator(object): + def __init__(self, cfg_filename='_c_ast.cfg'): + """ Initialize the code generator from a configuration + file. + """ + self.cfg_filename = cfg_filename + self.node_cfg = [NodeCfg(name, contents) + for (name, contents) in self.parse_cfgfile(cfg_filename)] + + def generate(self, file=None): + """ Generates the code into file, an open file buffer. + """ + src = Template(_PROLOGUE_COMMENT).substitute( + cfg_filename=self.cfg_filename) + + src += _PROLOGUE_CODE + for node_cfg in self.node_cfg: + src += node_cfg.generate_source() + '\n\n' + + file.write(src) + + def parse_cfgfile(self, filename): + """ Parse the configuration file and yield pairs of + (name, contents) for each node. + """ + with open(filename, "r") as f: + for line in f: + line = line.strip() + if not line or line.startswith('#'): + continue + colon_i = line.find(':') + lbracket_i = line.find('[') + rbracket_i = line.find(']') + if colon_i < 1 or lbracket_i <= colon_i or rbracket_i <= lbracket_i: + raise RuntimeError("Invalid line in %s:\n%s\n" % (filename, line)) + + name = line[:colon_i] + val = line[lbracket_i + 1:rbracket_i] + vallist = [v.strip() for v in val.split(',')] if val else [] + yield name, vallist + + +class NodeCfg(object): + """ Node configuration. + + name: node name + contents: a list of contents - attributes and child nodes + See comment at the top of the configuration file for details. + """ + + def __init__(self, name, contents): + self.name = name + self.all_entries = [] + self.attr = [] + self.child = [] + self.seq_child = [] + + for entry in contents: + clean_entry = entry.rstrip('*') + self.all_entries.append(clean_entry) + + if entry.endswith('**'): + self.seq_child.append(clean_entry) + elif entry.endswith('*'): + self.child.append(clean_entry) + else: + self.attr.append(entry) + + def generate_source(self): + src = self._gen_init() + src += '\n' + self._gen_children() + src += '\n' + self._gen_iter() + + src += '\n' + self._gen_attr_names() + return src + + def _gen_init(self): + src = "class %s(Node):\n" % self.name + + if self.all_entries: + args = ', '.join(self.all_entries) + slots = ', '.join("'{0}'".format(e) for e in self.all_entries) + slots += ", 'coord', '__weakref__'" + arglist = '(self, %s, coord=None)' % args + else: + slots = "'coord', '__weakref__'" + arglist = '(self, coord=None)' + + src += " __slots__ = (%s)\n" % slots + src += " def __init__%s:\n" % arglist + + for name in self.all_entries + ['coord']: + src += " self.%s = %s\n" % (name, name) + + return src + + def _gen_children(self): + src = ' def children(self):\n' + + if self.all_entries: + src += ' nodelist = []\n' + + for child in self.child: + src += ( + ' if self.%(child)s is not None:' + + ' nodelist.append(("%(child)s", self.%(child)s))\n') % ( + dict(child=child)) + + for seq_child in self.seq_child: + src += ( + ' for i, child in enumerate(self.%(child)s or []):\n' + ' nodelist.append(("%(child)s[%%d]" %% i, child))\n') % ( + dict(child=seq_child)) + + src += ' return tuple(nodelist)\n' + else: + src += ' return ()\n' + + return src + + def _gen_iter(self): + src = ' def __iter__(self):\n' + + if self.all_entries: + for child in self.child: + src += ( + ' if self.%(child)s is not None:\n' + + ' yield self.%(child)s\n') % (dict(child=child)) + + for seq_child in self.seq_child: + src += ( + ' for child in (self.%(child)s or []):\n' + ' yield child\n') % (dict(child=seq_child)) + + if not (self.child or self.seq_child): + # Empty generator + src += ( + ' return\n' + + ' yield\n') + else: + # Empty generator + src += ( + ' return\n' + + ' yield\n') + + return src + + def _gen_attr_names(self): + src = " attr_names = (" + ''.join("%r, " % nm for nm in self.attr) + ')' + return src + + +_PROLOGUE_COMMENT = \ +r'''#----------------------------------------------------------------- +# ** ATTENTION ** +# This code was automatically generated from the file: +# $cfg_filename +# +# Do not modify it directly. Modify the configuration file and +# run the generator again. +# ** ** *** ** ** +# +# pycparser: c_ast.py +# +# AST Node classes. +# +# Eli Bendersky [https://eli.thegreenplace.net/] +# License: BSD +#----------------------------------------------------------------- + +''' + +_PROLOGUE_CODE = r''' +import sys + +def _repr(obj): + """ + Get the representation of an object, with dedicated pprint-like format for lists. + """ + if isinstance(obj, list): + return '[' + (',\n '.join((_repr(e).replace('\n', '\n ') for e in obj))) + '\n]' + else: + return repr(obj) + +class Node(object): + __slots__ = () + """ Abstract base class for AST nodes. + """ + def __repr__(self): + """ Generates a python representation of the current node + """ + result = self.__class__.__name__ + '(' + + indent = '' + separator = '' + for name in self.__slots__[:-2]: + result += separator + result += indent + result += name + '=' + (_repr(getattr(self, name)).replace('\n', '\n ' + (' ' * (len(name) + len(self.__class__.__name__))))) + + separator = ',' + indent = '\n ' + (' ' * len(self.__class__.__name__)) + + result += indent + ')' + + return result + + def children(self): + """ A sequence of all children that are Nodes + """ + pass + + def show(self, buf=sys.stdout, offset=0, attrnames=False, nodenames=False, showcoord=False, _my_node_name=None): + """ Pretty print the Node and all its attributes and + children (recursively) to a buffer. + + buf: + Open IO buffer into which the Node is printed. + + offset: + Initial offset (amount of leading spaces) + + attrnames: + True if you want to see the attribute names in + name=value pairs. False to only see the values. + + nodenames: + True if you want to see the actual node names + within their parents. + + showcoord: + Do you want the coordinates of each Node to be + displayed. + """ + lead = ' ' * offset + if nodenames and _my_node_name is not None: + buf.write(lead + self.__class__.__name__+ ' <' + _my_node_name + '>: ') + else: + buf.write(lead + self.__class__.__name__+ ': ') + + if self.attr_names: + if attrnames: + nvlist = [(n, getattr(self,n)) for n in self.attr_names] + attrstr = ', '.join('%s=%s' % nv for nv in nvlist) + else: + vlist = [getattr(self, n) for n in self.attr_names] + attrstr = ', '.join('%s' % v for v in vlist) + buf.write(attrstr) + + if showcoord: + buf.write(' (at %s)' % self.coord) + buf.write('\n') + + for (child_name, child) in self.children(): + child.show( + buf, + offset=offset + 2, + attrnames=attrnames, + nodenames=nodenames, + showcoord=showcoord, + _my_node_name=child_name) + + +class NodeVisitor(object): + """ A base NodeVisitor class for visiting c_ast nodes. + Subclass it and define your own visit_XXX methods, where + XXX is the class name you want to visit with these + methods. + + For example: + + class ConstantVisitor(NodeVisitor): + def __init__(self): + self.values = [] + + def visit_Constant(self, node): + self.values.append(node.value) + + Creates a list of values of all the constant nodes + encountered below the given node. To use it: + + cv = ConstantVisitor() + cv.visit(node) + + Notes: + + * generic_visit() will be called for AST nodes for which + no visit_XXX method was defined. + * The children of nodes for which a visit_XXX was + defined will not be visited - if you need this, call + generic_visit() on the node. + You can use: + NodeVisitor.generic_visit(self, node) + * Modeled after Python's own AST visiting facilities + (the ast module of Python 3.0) + """ + + _method_cache = None + + def visit(self, node): + """ Visit a node. + """ + + if self._method_cache is None: + self._method_cache = {} + + visitor = self._method_cache.get(node.__class__.__name__, None) + if visitor is None: + method = 'visit_' + node.__class__.__name__ + visitor = getattr(self, method, self.generic_visit) + self._method_cache[node.__class__.__name__] = visitor + + return visitor(node) + + def generic_visit(self, node): + """ Called if no explicit visitor function exists for a + node. Implements preorder visiting of the node. + """ + for c in node: + self.visit(c) + +''' diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pycparser/_build_tables.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pycparser/_build_tables.py new file mode 100644 index 00000000..94a38918 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pycparser/_build_tables.py @@ -0,0 +1,33 @@ +#----------------------------------------------------------------- +# pycparser: _build_tables.py +# +# A dummy for generating the lexing/parsing tables and and +# compiling them into .pyc for faster execution in optimized mode. +# Also generates AST code from the configuration file. +# Should be called from the pycparser directory. +# +# Eli Bendersky [https://eli.thegreenplace.net/] +# License: BSD +#----------------------------------------------------------------- + +# Generate c_ast.py +from _ast_gen import ASTCodeGenerator +ast_gen = ASTCodeGenerator('_c_ast.cfg') +ast_gen.generate(open('c_ast.py', 'w')) + +import sys +sys.path[0:0] = ['.', '..'] +from pycparser import c_parser + +# Generates the tables +# +c_parser.CParser( + lex_optimize=True, + yacc_debug=False, + yacc_optimize=True) + +# Load to compile into .pyc +# +import lextab +import yacctab +import c_ast diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pycparser/_c_ast.cfg b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pycparser/_c_ast.cfg new file mode 100644 index 00000000..b93d50bb --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pycparser/_c_ast.cfg @@ -0,0 +1,191 @@ +#----------------------------------------------------------------- +# pycparser: _c_ast.cfg +# +# Defines the AST Node classes used in pycparser. +# +# Each entry is a Node sub-class name, listing the attributes +# and child nodes of the class: +# * - a child node +# ** - a sequence of child nodes +# - an attribute +# +# Eli Bendersky [https://eli.thegreenplace.net/] +# License: BSD +#----------------------------------------------------------------- + +# ArrayDecl is a nested declaration of an array with the given type. +# dim: the dimension (for example, constant 42) +# dim_quals: list of dimension qualifiers, to support C99's allowing 'const' +# and 'static' within the array dimension in function declarations. +ArrayDecl: [type*, dim*, dim_quals] + +ArrayRef: [name*, subscript*] + +# op: =, +=, /= etc. +# +Assignment: [op, lvalue*, rvalue*] + +BinaryOp: [op, left*, right*] + +Break: [] + +Case: [expr*, stmts**] + +Cast: [to_type*, expr*] + +# Compound statement in C99 is a list of block items (declarations or +# statements). +# +Compound: [block_items**] + +# Compound literal (anonymous aggregate) for C99. +# (type-name) {initializer_list} +# type: the typename +# init: InitList for the initializer list +# +CompoundLiteral: [type*, init*] + +# type: int, char, float, etc. see CLexer for constant token types +# +Constant: [type, value] + +Continue: [] + +# name: the variable being declared +# quals: list of qualifiers (const, volatile) +# funcspec: list function specifiers (i.e. inline in C99) +# storage: list of storage specifiers (extern, register, etc.) +# type: declaration type (probably nested with all the modifiers) +# init: initialization value, or None +# bitsize: bit field size, or None +# +Decl: [name, quals, storage, funcspec, type*, init*, bitsize*] + +DeclList: [decls**] + +Default: [stmts**] + +DoWhile: [cond*, stmt*] + +# Represents the ellipsis (...) parameter in a function +# declaration +# +EllipsisParam: [] + +# An empty statement (a semicolon ';' on its own) +# +EmptyStatement: [] + +# Enumeration type specifier +# name: an optional ID +# values: an EnumeratorList +# +Enum: [name, values*] + +# A name/value pair for enumeration values +# +Enumerator: [name, value*] + +# A list of enumerators +# +EnumeratorList: [enumerators**] + +# A list of expressions separated by the comma operator. +# +ExprList: [exprs**] + +# This is the top of the AST, representing a single C file (a +# translation unit in K&R jargon). It contains a list of +# "external-declaration"s, which is either declarations (Decl), +# Typedef or function definitions (FuncDef). +# +FileAST: [ext**] + +# for (init; cond; next) stmt +# +For: [init*, cond*, next*, stmt*] + +# name: Id +# args: ExprList +# +FuncCall: [name*, args*] + +# type (args) +# +FuncDecl: [args*, type*] + +# Function definition: a declarator for the function name and +# a body, which is a compound statement. +# There's an optional list of parameter declarations for old +# K&R-style definitions +# +FuncDef: [decl*, param_decls**, body*] + +Goto: [name] + +ID: [name] + +# Holder for types that are a simple identifier (e.g. the built +# ins void, char etc. and typedef-defined types) +# +IdentifierType: [names] + +If: [cond*, iftrue*, iffalse*] + +# An initialization list used for compound literals. +# +InitList: [exprs**] + +Label: [name, stmt*] + +# A named initializer for C99. +# The name of a NamedInitializer is a sequence of Nodes, because +# names can be hierarchical and contain constant expressions. +# +NamedInitializer: [name**, expr*] + +# a list of comma separated function parameter declarations +# +ParamList: [params**] + +PtrDecl: [quals, type*] + +Return: [expr*] + +# name: struct tag name +# decls: declaration of members +# +Struct: [name, decls**] + +# type: . or -> +# name.field or name->field +# +StructRef: [name*, type, field*] + +Switch: [cond*, stmt*] + +# cond ? iftrue : iffalse +# +TernaryOp: [cond*, iftrue*, iffalse*] + +# A base type declaration +# +TypeDecl: [declname, quals, type*] + +# A typedef declaration. +# Very similar to Decl, but without some attributes +# +Typedef: [name, quals, storage, type*] + +Typename: [name, quals, type*] + +UnaryOp: [op, expr*] + +# name: union tag name +# decls: declaration of members +# +Union: [name, decls**] + +While: [cond*, stmt*] + +Pragma: [string] diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pycparser/ast_transforms.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pycparser/ast_transforms.py new file mode 100644 index 00000000..ba509669 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pycparser/ast_transforms.py @@ -0,0 +1,105 @@ +#------------------------------------------------------------------------------ +# pycparser: ast_transforms.py +# +# Some utilities used by the parser to create a friendlier AST. +# +# Eli Bendersky [https://eli.thegreenplace.net/] +# License: BSD +#------------------------------------------------------------------------------ + +from . import c_ast + + +def fix_switch_cases(switch_node): + """ The 'case' statements in a 'switch' come out of parsing with one + child node, so subsequent statements are just tucked to the parent + Compound. Additionally, consecutive (fall-through) case statements + come out messy. This is a peculiarity of the C grammar. The following: + + switch (myvar) { + case 10: + k = 10; + p = k + 1; + return 10; + case 20: + case 30: + return 20; + default: + break; + } + + Creates this tree (pseudo-dump): + + Switch + ID: myvar + Compound: + Case 10: + k = 10 + p = k + 1 + return 10 + Case 20: + Case 30: + return 20 + Default: + break + + The goal of this transform is to fix this mess, turning it into the + following: + + Switch + ID: myvar + Compound: + Case 10: + k = 10 + p = k + 1 + return 10 + Case 20: + Case 30: + return 20 + Default: + break + + A fixed AST node is returned. The argument may be modified. + """ + assert isinstance(switch_node, c_ast.Switch) + if not isinstance(switch_node.stmt, c_ast.Compound): + return switch_node + + # The new Compound child for the Switch, which will collect children in the + # correct order + new_compound = c_ast.Compound([], switch_node.stmt.coord) + + # The last Case/Default node + last_case = None + + # Goes over the children of the Compound below the Switch, adding them + # either directly below new_compound or below the last Case as appropriate + for child in switch_node.stmt.block_items: + if isinstance(child, (c_ast.Case, c_ast.Default)): + # If it's a Case/Default: + # 1. Add it to the Compound and mark as "last case" + # 2. If its immediate child is also a Case or Default, promote it + # to a sibling. + new_compound.block_items.append(child) + _extract_nested_case(child, new_compound.block_items) + last_case = new_compound.block_items[-1] + else: + # Other statements are added as children to the last case, if it + # exists. + if last_case is None: + new_compound.block_items.append(child) + else: + last_case.stmts.append(child) + + switch_node.stmt = new_compound + return switch_node + + +def _extract_nested_case(case_node, stmts_list): + """ Recursively extract consecutive Case statements that are made nested + by the parser and add them to the stmts_list. + """ + if isinstance(case_node.stmts[0], (c_ast.Case, c_ast.Default)): + stmts_list.append(case_node.stmts.pop()) + _extract_nested_case(stmts_list[-1], stmts_list) + diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pycparser/c_ast.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pycparser/c_ast.py new file mode 100644 index 00000000..b7bbbeed --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pycparser/c_ast.py @@ -0,0 +1,1084 @@ +#----------------------------------------------------------------- +# ** ATTENTION ** +# This code was automatically generated from the file: +# _c_ast.cfg +# +# Do not modify it directly. Modify the configuration file and +# run the generator again. +# ** ** *** ** ** +# +# pycparser: c_ast.py +# +# AST Node classes. +# +# Eli Bendersky [https://eli.thegreenplace.net/] +# License: BSD +#----------------------------------------------------------------- + + +import sys + +def _repr(obj): + """ + Get the representation of an object, with dedicated pprint-like format for lists. + """ + if isinstance(obj, list): + return '[' + (',\n '.join((_repr(e).replace('\n', '\n ') for e in obj))) + '\n]' + else: + return repr(obj) + +class Node(object): + __slots__ = () + """ Abstract base class for AST nodes. + """ + def __repr__(self): + """ Generates a python representation of the current node + """ + result = self.__class__.__name__ + '(' + + indent = '' + separator = '' + for name in self.__slots__[:-2]: + result += separator + result += indent + result += name + '=' + (_repr(getattr(self, name)).replace('\n', '\n ' + (' ' * (len(name) + len(self.__class__.__name__))))) + + separator = ',' + indent = '\n ' + (' ' * len(self.__class__.__name__)) + + result += indent + ')' + + return result + + def children(self): + """ A sequence of all children that are Nodes + """ + pass + + def show(self, buf=sys.stdout, offset=0, attrnames=False, nodenames=False, showcoord=False, _my_node_name=None): + """ Pretty print the Node and all its attributes and + children (recursively) to a buffer. + + buf: + Open IO buffer into which the Node is printed. + + offset: + Initial offset (amount of leading spaces) + + attrnames: + True if you want to see the attribute names in + name=value pairs. False to only see the values. + + nodenames: + True if you want to see the actual node names + within their parents. + + showcoord: + Do you want the coordinates of each Node to be + displayed. + """ + lead = ' ' * offset + if nodenames and _my_node_name is not None: + buf.write(lead + self.__class__.__name__+ ' <' + _my_node_name + '>: ') + else: + buf.write(lead + self.__class__.__name__+ ': ') + + if self.attr_names: + if attrnames: + nvlist = [(n, getattr(self,n)) for n in self.attr_names] + attrstr = ', '.join('%s=%s' % nv for nv in nvlist) + else: + vlist = [getattr(self, n) for n in self.attr_names] + attrstr = ', '.join('%s' % v for v in vlist) + buf.write(attrstr) + + if showcoord: + buf.write(' (at %s)' % self.coord) + buf.write('\n') + + for (child_name, child) in self.children(): + child.show( + buf, + offset=offset + 2, + attrnames=attrnames, + nodenames=nodenames, + showcoord=showcoord, + _my_node_name=child_name) + + +class NodeVisitor(object): + """ A base NodeVisitor class for visiting c_ast nodes. + Subclass it and define your own visit_XXX methods, where + XXX is the class name you want to visit with these + methods. + + For example: + + class ConstantVisitor(NodeVisitor): + def __init__(self): + self.values = [] + + def visit_Constant(self, node): + self.values.append(node.value) + + Creates a list of values of all the constant nodes + encountered below the given node. To use it: + + cv = ConstantVisitor() + cv.visit(node) + + Notes: + + * generic_visit() will be called for AST nodes for which + no visit_XXX method was defined. + * The children of nodes for which a visit_XXX was + defined will not be visited - if you need this, call + generic_visit() on the node. + You can use: + NodeVisitor.generic_visit(self, node) + * Modeled after Python's own AST visiting facilities + (the ast module of Python 3.0) + """ + + _method_cache = None + + def visit(self, node): + """ Visit a node. + """ + + if self._method_cache is None: + self._method_cache = {} + + visitor = self._method_cache.get(node.__class__.__name__, None) + if visitor is None: + method = 'visit_' + node.__class__.__name__ + visitor = getattr(self, method, self.generic_visit) + self._method_cache[node.__class__.__name__] = visitor + + return visitor(node) + + def generic_visit(self, node): + """ Called if no explicit visitor function exists for a + node. Implements preorder visiting of the node. + """ + for c in node: + self.visit(c) + +class ArrayDecl(Node): + __slots__ = ('type', 'dim', 'dim_quals', 'coord', '__weakref__') + def __init__(self, type, dim, dim_quals, coord=None): + self.type = type + self.dim = dim + self.dim_quals = dim_quals + self.coord = coord + + def children(self): + nodelist = [] + if self.type is not None: nodelist.append(("type", self.type)) + if self.dim is not None: nodelist.append(("dim", self.dim)) + return tuple(nodelist) + + def __iter__(self): + if self.type is not None: + yield self.type + if self.dim is not None: + yield self.dim + + attr_names = ('dim_quals', ) + +class ArrayRef(Node): + __slots__ = ('name', 'subscript', 'coord', '__weakref__') + def __init__(self, name, subscript, coord=None): + self.name = name + self.subscript = subscript + self.coord = coord + + def children(self): + nodelist = [] + if self.name is not None: nodelist.append(("name", self.name)) + if self.subscript is not None: nodelist.append(("subscript", self.subscript)) + return tuple(nodelist) + + def __iter__(self): + if self.name is not None: + yield self.name + if self.subscript is not None: + yield self.subscript + + attr_names = () + +class Assignment(Node): + __slots__ = ('op', 'lvalue', 'rvalue', 'coord', '__weakref__') + def __init__(self, op, lvalue, rvalue, coord=None): + self.op = op + self.lvalue = lvalue + self.rvalue = rvalue + self.coord = coord + + def children(self): + nodelist = [] + if self.lvalue is not None: nodelist.append(("lvalue", self.lvalue)) + if self.rvalue is not None: nodelist.append(("rvalue", self.rvalue)) + return tuple(nodelist) + + def __iter__(self): + if self.lvalue is not None: + yield self.lvalue + if self.rvalue is not None: + yield self.rvalue + + attr_names = ('op', ) + +class BinaryOp(Node): + __slots__ = ('op', 'left', 'right', 'coord', '__weakref__') + def __init__(self, op, left, right, coord=None): + self.op = op + self.left = left + self.right = right + self.coord = coord + + def children(self): + nodelist = [] + if self.left is not None: nodelist.append(("left", self.left)) + if self.right is not None: nodelist.append(("right", self.right)) + return tuple(nodelist) + + def __iter__(self): + if self.left is not None: + yield self.left + if self.right is not None: + yield self.right + + attr_names = ('op', ) + +class Break(Node): + __slots__ = ('coord', '__weakref__') + def __init__(self, coord=None): + self.coord = coord + + def children(self): + return () + + def __iter__(self): + return + yield + + attr_names = () + +class Case(Node): + __slots__ = ('expr', 'stmts', 'coord', '__weakref__') + def __init__(self, expr, stmts, coord=None): + self.expr = expr + self.stmts = stmts + self.coord = coord + + def children(self): + nodelist = [] + if self.expr is not None: nodelist.append(("expr", self.expr)) + for i, child in enumerate(self.stmts or []): + nodelist.append(("stmts[%d]" % i, child)) + return tuple(nodelist) + + def __iter__(self): + if self.expr is not None: + yield self.expr + for child in (self.stmts or []): + yield child + + attr_names = () + +class Cast(Node): + __slots__ = ('to_type', 'expr', 'coord', '__weakref__') + def __init__(self, to_type, expr, coord=None): + self.to_type = to_type + self.expr = expr + self.coord = coord + + def children(self): + nodelist = [] + if self.to_type is not None: nodelist.append(("to_type", self.to_type)) + if self.expr is not None: nodelist.append(("expr", self.expr)) + return tuple(nodelist) + + def __iter__(self): + if self.to_type is not None: + yield self.to_type + if self.expr is not None: + yield self.expr + + attr_names = () + +class Compound(Node): + __slots__ = ('block_items', 'coord', '__weakref__') + def __init__(self, block_items, coord=None): + self.block_items = block_items + self.coord = coord + + def children(self): + nodelist = [] + for i, child in enumerate(self.block_items or []): + nodelist.append(("block_items[%d]" % i, child)) + return tuple(nodelist) + + def __iter__(self): + for child in (self.block_items or []): + yield child + + attr_names = () + +class CompoundLiteral(Node): + __slots__ = ('type', 'init', 'coord', '__weakref__') + def __init__(self, type, init, coord=None): + self.type = type + self.init = init + self.coord = coord + + def children(self): + nodelist = [] + if self.type is not None: nodelist.append(("type", self.type)) + if self.init is not None: nodelist.append(("init", self.init)) + return tuple(nodelist) + + def __iter__(self): + if self.type is not None: + yield self.type + if self.init is not None: + yield self.init + + attr_names = () + +class Constant(Node): + __slots__ = ('type', 'value', 'coord', '__weakref__') + def __init__(self, type, value, coord=None): + self.type = type + self.value = value + self.coord = coord + + def children(self): + nodelist = [] + return tuple(nodelist) + + def __iter__(self): + return + yield + + attr_names = ('type', 'value', ) + +class Continue(Node): + __slots__ = ('coord', '__weakref__') + def __init__(self, coord=None): + self.coord = coord + + def children(self): + return () + + def __iter__(self): + return + yield + + attr_names = () + +class Decl(Node): + __slots__ = ('name', 'quals', 'storage', 'funcspec', 'type', 'init', 'bitsize', 'coord', '__weakref__') + def __init__(self, name, quals, storage, funcspec, type, init, bitsize, coord=None): + self.name = name + self.quals = quals + self.storage = storage + self.funcspec = funcspec + self.type = type + self.init = init + self.bitsize = bitsize + self.coord = coord + + def children(self): + nodelist = [] + if self.type is not None: nodelist.append(("type", self.type)) + if self.init is not None: nodelist.append(("init", self.init)) + if self.bitsize is not None: nodelist.append(("bitsize", self.bitsize)) + return tuple(nodelist) + + def __iter__(self): + if self.type is not None: + yield self.type + if self.init is not None: + yield self.init + if self.bitsize is not None: + yield self.bitsize + + attr_names = ('name', 'quals', 'storage', 'funcspec', ) + +class DeclList(Node): + __slots__ = ('decls', 'coord', '__weakref__') + def __init__(self, decls, coord=None): + self.decls = decls + self.coord = coord + + def children(self): + nodelist = [] + for i, child in enumerate(self.decls or []): + nodelist.append(("decls[%d]" % i, child)) + return tuple(nodelist) + + def __iter__(self): + for child in (self.decls or []): + yield child + + attr_names = () + +class Default(Node): + __slots__ = ('stmts', 'coord', '__weakref__') + def __init__(self, stmts, coord=None): + self.stmts = stmts + self.coord = coord + + def children(self): + nodelist = [] + for i, child in enumerate(self.stmts or []): + nodelist.append(("stmts[%d]" % i, child)) + return tuple(nodelist) + + def __iter__(self): + for child in (self.stmts or []): + yield child + + attr_names = () + +class DoWhile(Node): + __slots__ = ('cond', 'stmt', 'coord', '__weakref__') + def __init__(self, cond, stmt, coord=None): + self.cond = cond + self.stmt = stmt + self.coord = coord + + def children(self): + nodelist = [] + if self.cond is not None: nodelist.append(("cond", self.cond)) + if self.stmt is not None: nodelist.append(("stmt", self.stmt)) + return tuple(nodelist) + + def __iter__(self): + if self.cond is not None: + yield self.cond + if self.stmt is not None: + yield self.stmt + + attr_names = () + +class EllipsisParam(Node): + __slots__ = ('coord', '__weakref__') + def __init__(self, coord=None): + self.coord = coord + + def children(self): + return () + + def __iter__(self): + return + yield + + attr_names = () + +class EmptyStatement(Node): + __slots__ = ('coord', '__weakref__') + def __init__(self, coord=None): + self.coord = coord + + def children(self): + return () + + def __iter__(self): + return + yield + + attr_names = () + +class Enum(Node): + __slots__ = ('name', 'values', 'coord', '__weakref__') + def __init__(self, name, values, coord=None): + self.name = name + self.values = values + self.coord = coord + + def children(self): + nodelist = [] + if self.values is not None: nodelist.append(("values", self.values)) + return tuple(nodelist) + + def __iter__(self): + if self.values is not None: + yield self.values + + attr_names = ('name', ) + +class Enumerator(Node): + __slots__ = ('name', 'value', 'coord', '__weakref__') + def __init__(self, name, value, coord=None): + self.name = name + self.value = value + self.coord = coord + + def children(self): + nodelist = [] + if self.value is not None: nodelist.append(("value", self.value)) + return tuple(nodelist) + + def __iter__(self): + if self.value is not None: + yield self.value + + attr_names = ('name', ) + +class EnumeratorList(Node): + __slots__ = ('enumerators', 'coord', '__weakref__') + def __init__(self, enumerators, coord=None): + self.enumerators = enumerators + self.coord = coord + + def children(self): + nodelist = [] + for i, child in enumerate(self.enumerators or []): + nodelist.append(("enumerators[%d]" % i, child)) + return tuple(nodelist) + + def __iter__(self): + for child in (self.enumerators or []): + yield child + + attr_names = () + +class ExprList(Node): + __slots__ = ('exprs', 'coord', '__weakref__') + def __init__(self, exprs, coord=None): + self.exprs = exprs + self.coord = coord + + def children(self): + nodelist = [] + for i, child in enumerate(self.exprs or []): + nodelist.append(("exprs[%d]" % i, child)) + return tuple(nodelist) + + def __iter__(self): + for child in (self.exprs or []): + yield child + + attr_names = () + +class FileAST(Node): + __slots__ = ('ext', 'coord', '__weakref__') + def __init__(self, ext, coord=None): + self.ext = ext + self.coord = coord + + def children(self): + nodelist = [] + for i, child in enumerate(self.ext or []): + nodelist.append(("ext[%d]" % i, child)) + return tuple(nodelist) + + def __iter__(self): + for child in (self.ext or []): + yield child + + attr_names = () + +class For(Node): + __slots__ = ('init', 'cond', 'next', 'stmt', 'coord', '__weakref__') + def __init__(self, init, cond, next, stmt, coord=None): + self.init = init + self.cond = cond + self.next = next + self.stmt = stmt + self.coord = coord + + def children(self): + nodelist = [] + if self.init is not None: nodelist.append(("init", self.init)) + if self.cond is not None: nodelist.append(("cond", self.cond)) + if self.next is not None: nodelist.append(("next", self.next)) + if self.stmt is not None: nodelist.append(("stmt", self.stmt)) + return tuple(nodelist) + + def __iter__(self): + if self.init is not None: + yield self.init + if self.cond is not None: + yield self.cond + if self.next is not None: + yield self.next + if self.stmt is not None: + yield self.stmt + + attr_names = () + +class FuncCall(Node): + __slots__ = ('name', 'args', 'coord', '__weakref__') + def __init__(self, name, args, coord=None): + self.name = name + self.args = args + self.coord = coord + + def children(self): + nodelist = [] + if self.name is not None: nodelist.append(("name", self.name)) + if self.args is not None: nodelist.append(("args", self.args)) + return tuple(nodelist) + + def __iter__(self): + if self.name is not None: + yield self.name + if self.args is not None: + yield self.args + + attr_names = () + +class FuncDecl(Node): + __slots__ = ('args', 'type', 'coord', '__weakref__') + def __init__(self, args, type, coord=None): + self.args = args + self.type = type + self.coord = coord + + def children(self): + nodelist = [] + if self.args is not None: nodelist.append(("args", self.args)) + if self.type is not None: nodelist.append(("type", self.type)) + return tuple(nodelist) + + def __iter__(self): + if self.args is not None: + yield self.args + if self.type is not None: + yield self.type + + attr_names = () + +class FuncDef(Node): + __slots__ = ('decl', 'param_decls', 'body', 'coord', '__weakref__') + def __init__(self, decl, param_decls, body, coord=None): + self.decl = decl + self.param_decls = param_decls + self.body = body + self.coord = coord + + def children(self): + nodelist = [] + if self.decl is not None: nodelist.append(("decl", self.decl)) + if self.body is not None: nodelist.append(("body", self.body)) + for i, child in enumerate(self.param_decls or []): + nodelist.append(("param_decls[%d]" % i, child)) + return tuple(nodelist) + + def __iter__(self): + if self.decl is not None: + yield self.decl + if self.body is not None: + yield self.body + for child in (self.param_decls or []): + yield child + + attr_names = () + +class Goto(Node): + __slots__ = ('name', 'coord', '__weakref__') + def __init__(self, name, coord=None): + self.name = name + self.coord = coord + + def children(self): + nodelist = [] + return tuple(nodelist) + + def __iter__(self): + return + yield + + attr_names = ('name', ) + +class ID(Node): + __slots__ = ('name', 'coord', '__weakref__') + def __init__(self, name, coord=None): + self.name = name + self.coord = coord + + def children(self): + nodelist = [] + return tuple(nodelist) + + def __iter__(self): + return + yield + + attr_names = ('name', ) + +class IdentifierType(Node): + __slots__ = ('names', 'coord', '__weakref__') + def __init__(self, names, coord=None): + self.names = names + self.coord = coord + + def children(self): + nodelist = [] + return tuple(nodelist) + + def __iter__(self): + return + yield + + attr_names = ('names', ) + +class If(Node): + __slots__ = ('cond', 'iftrue', 'iffalse', 'coord', '__weakref__') + def __init__(self, cond, iftrue, iffalse, coord=None): + self.cond = cond + self.iftrue = iftrue + self.iffalse = iffalse + self.coord = coord + + def children(self): + nodelist = [] + if self.cond is not None: nodelist.append(("cond", self.cond)) + if self.iftrue is not None: nodelist.append(("iftrue", self.iftrue)) + if self.iffalse is not None: nodelist.append(("iffalse", self.iffalse)) + return tuple(nodelist) + + def __iter__(self): + if self.cond is not None: + yield self.cond + if self.iftrue is not None: + yield self.iftrue + if self.iffalse is not None: + yield self.iffalse + + attr_names = () + +class InitList(Node): + __slots__ = ('exprs', 'coord', '__weakref__') + def __init__(self, exprs, coord=None): + self.exprs = exprs + self.coord = coord + + def children(self): + nodelist = [] + for i, child in enumerate(self.exprs or []): + nodelist.append(("exprs[%d]" % i, child)) + return tuple(nodelist) + + def __iter__(self): + for child in (self.exprs or []): + yield child + + attr_names = () + +class Label(Node): + __slots__ = ('name', 'stmt', 'coord', '__weakref__') + def __init__(self, name, stmt, coord=None): + self.name = name + self.stmt = stmt + self.coord = coord + + def children(self): + nodelist = [] + if self.stmt is not None: nodelist.append(("stmt", self.stmt)) + return tuple(nodelist) + + def __iter__(self): + if self.stmt is not None: + yield self.stmt + + attr_names = ('name', ) + +class NamedInitializer(Node): + __slots__ = ('name', 'expr', 'coord', '__weakref__') + def __init__(self, name, expr, coord=None): + self.name = name + self.expr = expr + self.coord = coord + + def children(self): + nodelist = [] + if self.expr is not None: nodelist.append(("expr", self.expr)) + for i, child in enumerate(self.name or []): + nodelist.append(("name[%d]" % i, child)) + return tuple(nodelist) + + def __iter__(self): + if self.expr is not None: + yield self.expr + for child in (self.name or []): + yield child + + attr_names = () + +class ParamList(Node): + __slots__ = ('params', 'coord', '__weakref__') + def __init__(self, params, coord=None): + self.params = params + self.coord = coord + + def children(self): + nodelist = [] + for i, child in enumerate(self.params or []): + nodelist.append(("params[%d]" % i, child)) + return tuple(nodelist) + + def __iter__(self): + for child in (self.params or []): + yield child + + attr_names = () + +class PtrDecl(Node): + __slots__ = ('quals', 'type', 'coord', '__weakref__') + def __init__(self, quals, type, coord=None): + self.quals = quals + self.type = type + self.coord = coord + + def children(self): + nodelist = [] + if self.type is not None: nodelist.append(("type", self.type)) + return tuple(nodelist) + + def __iter__(self): + if self.type is not None: + yield self.type + + attr_names = ('quals', ) + +class Return(Node): + __slots__ = ('expr', 'coord', '__weakref__') + def __init__(self, expr, coord=None): + self.expr = expr + self.coord = coord + + def children(self): + nodelist = [] + if self.expr is not None: nodelist.append(("expr", self.expr)) + return tuple(nodelist) + + def __iter__(self): + if self.expr is not None: + yield self.expr + + attr_names = () + +class Struct(Node): + __slots__ = ('name', 'decls', 'coord', '__weakref__') + def __init__(self, name, decls, coord=None): + self.name = name + self.decls = decls + self.coord = coord + + def children(self): + nodelist = [] + for i, child in enumerate(self.decls or []): + nodelist.append(("decls[%d]" % i, child)) + return tuple(nodelist) + + def __iter__(self): + for child in (self.decls or []): + yield child + + attr_names = ('name', ) + +class StructRef(Node): + __slots__ = ('name', 'type', 'field', 'coord', '__weakref__') + def __init__(self, name, type, field, coord=None): + self.name = name + self.type = type + self.field = field + self.coord = coord + + def children(self): + nodelist = [] + if self.name is not None: nodelist.append(("name", self.name)) + if self.field is not None: nodelist.append(("field", self.field)) + return tuple(nodelist) + + def __iter__(self): + if self.name is not None: + yield self.name + if self.field is not None: + yield self.field + + attr_names = ('type', ) + +class Switch(Node): + __slots__ = ('cond', 'stmt', 'coord', '__weakref__') + def __init__(self, cond, stmt, coord=None): + self.cond = cond + self.stmt = stmt + self.coord = coord + + def children(self): + nodelist = [] + if self.cond is not None: nodelist.append(("cond", self.cond)) + if self.stmt is not None: nodelist.append(("stmt", self.stmt)) + return tuple(nodelist) + + def __iter__(self): + if self.cond is not None: + yield self.cond + if self.stmt is not None: + yield self.stmt + + attr_names = () + +class TernaryOp(Node): + __slots__ = ('cond', 'iftrue', 'iffalse', 'coord', '__weakref__') + def __init__(self, cond, iftrue, iffalse, coord=None): + self.cond = cond + self.iftrue = iftrue + self.iffalse = iffalse + self.coord = coord + + def children(self): + nodelist = [] + if self.cond is not None: nodelist.append(("cond", self.cond)) + if self.iftrue is not None: nodelist.append(("iftrue", self.iftrue)) + if self.iffalse is not None: nodelist.append(("iffalse", self.iffalse)) + return tuple(nodelist) + + def __iter__(self): + if self.cond is not None: + yield self.cond + if self.iftrue is not None: + yield self.iftrue + if self.iffalse is not None: + yield self.iffalse + + attr_names = () + +class TypeDecl(Node): + __slots__ = ('declname', 'quals', 'type', 'coord', '__weakref__') + def __init__(self, declname, quals, type, coord=None): + self.declname = declname + self.quals = quals + self.type = type + self.coord = coord + + def children(self): + nodelist = [] + if self.type is not None: nodelist.append(("type", self.type)) + return tuple(nodelist) + + def __iter__(self): + if self.type is not None: + yield self.type + + attr_names = ('declname', 'quals', ) + +class Typedef(Node): + __slots__ = ('name', 'quals', 'storage', 'type', 'coord', '__weakref__') + def __init__(self, name, quals, storage, type, coord=None): + self.name = name + self.quals = quals + self.storage = storage + self.type = type + self.coord = coord + + def children(self): + nodelist = [] + if self.type is not None: nodelist.append(("type", self.type)) + return tuple(nodelist) + + def __iter__(self): + if self.type is not None: + yield self.type + + attr_names = ('name', 'quals', 'storage', ) + +class Typename(Node): + __slots__ = ('name', 'quals', 'type', 'coord', '__weakref__') + def __init__(self, name, quals, type, coord=None): + self.name = name + self.quals = quals + self.type = type + self.coord = coord + + def children(self): + nodelist = [] + if self.type is not None: nodelist.append(("type", self.type)) + return tuple(nodelist) + + def __iter__(self): + if self.type is not None: + yield self.type + + attr_names = ('name', 'quals', ) + +class UnaryOp(Node): + __slots__ = ('op', 'expr', 'coord', '__weakref__') + def __init__(self, op, expr, coord=None): + self.op = op + self.expr = expr + self.coord = coord + + def children(self): + nodelist = [] + if self.expr is not None: nodelist.append(("expr", self.expr)) + return tuple(nodelist) + + def __iter__(self): + if self.expr is not None: + yield self.expr + + attr_names = ('op', ) + +class Union(Node): + __slots__ = ('name', 'decls', 'coord', '__weakref__') + def __init__(self, name, decls, coord=None): + self.name = name + self.decls = decls + self.coord = coord + + def children(self): + nodelist = [] + for i, child in enumerate(self.decls or []): + nodelist.append(("decls[%d]" % i, child)) + return tuple(nodelist) + + def __iter__(self): + for child in (self.decls or []): + yield child + + attr_names = ('name', ) + +class While(Node): + __slots__ = ('cond', 'stmt', 'coord', '__weakref__') + def __init__(self, cond, stmt, coord=None): + self.cond = cond + self.stmt = stmt + self.coord = coord + + def children(self): + nodelist = [] + if self.cond is not None: nodelist.append(("cond", self.cond)) + if self.stmt is not None: nodelist.append(("stmt", self.stmt)) + return tuple(nodelist) + + def __iter__(self): + if self.cond is not None: + yield self.cond + if self.stmt is not None: + yield self.stmt + + attr_names = () + +class Pragma(Node): + __slots__ = ('string', 'coord', '__weakref__') + def __init__(self, string, coord=None): + self.string = string + self.coord = coord + + def children(self): + nodelist = [] + return tuple(nodelist) + + def __iter__(self): + return + yield + + attr_names = ('string', ) + diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pycparser/c_generator.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pycparser/c_generator.py new file mode 100644 index 00000000..f789742f --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pycparser/c_generator.py @@ -0,0 +1,428 @@ +#------------------------------------------------------------------------------ +# pycparser: c_generator.py +# +# C code generator from pycparser AST nodes. +# +# Eli Bendersky [https://eli.thegreenplace.net/] +# License: BSD +#------------------------------------------------------------------------------ +from . import c_ast + + +class CGenerator(object): + """ Uses the same visitor pattern as c_ast.NodeVisitor, but modified to + return a value from each visit method, using string accumulation in + generic_visit. + """ + def __init__(self): + # Statements start with indentation of self.indent_level spaces, using + # the _make_indent method + # + self.indent_level = 0 + + def _make_indent(self): + return ' ' * self.indent_level + + def visit(self, node): + method = 'visit_' + node.__class__.__name__ + return getattr(self, method, self.generic_visit)(node) + + def generic_visit(self, node): + #~ print('generic:', type(node)) + if node is None: + return '' + else: + return ''.join(self.visit(c) for c_name, c in node.children()) + + def visit_Constant(self, n): + return n.value + + def visit_ID(self, n): + return n.name + + def visit_Pragma(self, n): + ret = '#pragma' + if n.string: + ret += ' ' + n.string + return ret + + def visit_ArrayRef(self, n): + arrref = self._parenthesize_unless_simple(n.name) + return arrref + '[' + self.visit(n.subscript) + ']' + + def visit_StructRef(self, n): + sref = self._parenthesize_unless_simple(n.name) + return sref + n.type + self.visit(n.field) + + def visit_FuncCall(self, n): + fref = self._parenthesize_unless_simple(n.name) + return fref + '(' + self.visit(n.args) + ')' + + def visit_UnaryOp(self, n): + operand = self._parenthesize_unless_simple(n.expr) + if n.op == 'p++': + return '%s++' % operand + elif n.op == 'p--': + return '%s--' % operand + elif n.op == 'sizeof': + # Always parenthesize the argument of sizeof since it can be + # a name. + return 'sizeof(%s)' % self.visit(n.expr) + else: + return '%s%s' % (n.op, operand) + + def visit_BinaryOp(self, n): + lval_str = self._parenthesize_if(n.left, + lambda d: not self._is_simple_node(d)) + rval_str = self._parenthesize_if(n.right, + lambda d: not self._is_simple_node(d)) + return '%s %s %s' % (lval_str, n.op, rval_str) + + def visit_Assignment(self, n): + rval_str = self._parenthesize_if( + n.rvalue, + lambda n: isinstance(n, c_ast.Assignment)) + return '%s %s %s' % (self.visit(n.lvalue), n.op, rval_str) + + def visit_IdentifierType(self, n): + return ' '.join(n.names) + + def _visit_expr(self, n): + if isinstance(n, c_ast.InitList): + return '{' + self.visit(n) + '}' + elif isinstance(n, c_ast.ExprList): + return '(' + self.visit(n) + ')' + else: + return self.visit(n) + + def visit_Decl(self, n, no_type=False): + # no_type is used when a Decl is part of a DeclList, where the type is + # explicitly only for the first declaration in a list. + # + s = n.name if no_type else self._generate_decl(n) + if n.bitsize: s += ' : ' + self.visit(n.bitsize) + if n.init: + s += ' = ' + self._visit_expr(n.init) + return s + + def visit_DeclList(self, n): + s = self.visit(n.decls[0]) + if len(n.decls) > 1: + s += ', ' + ', '.join(self.visit_Decl(decl, no_type=True) + for decl in n.decls[1:]) + return s + + def visit_Typedef(self, n): + s = '' + if n.storage: s += ' '.join(n.storage) + ' ' + s += self._generate_type(n.type) + return s + + def visit_Cast(self, n): + s = '(' + self._generate_type(n.to_type) + ')' + return s + ' ' + self._parenthesize_unless_simple(n.expr) + + def visit_ExprList(self, n): + visited_subexprs = [] + for expr in n.exprs: + visited_subexprs.append(self._visit_expr(expr)) + return ', '.join(visited_subexprs) + + def visit_InitList(self, n): + visited_subexprs = [] + for expr in n.exprs: + visited_subexprs.append(self._visit_expr(expr)) + return ', '.join(visited_subexprs) + + def visit_Enum(self, n): + return self._generate_struct_union_enum(n, name='enum') + + def visit_Enumerator(self, n): + if not n.value: + return '{indent}{name},\n'.format( + indent=self._make_indent(), + name=n.name, + ) + else: + return '{indent}{name} = {value},\n'.format( + indent=self._make_indent(), + name=n.name, + value=self.visit(n.value), + ) + + def visit_FuncDef(self, n): + decl = self.visit(n.decl) + self.indent_level = 0 + body = self.visit(n.body) + if n.param_decls: + knrdecls = ';\n'.join(self.visit(p) for p in n.param_decls) + return decl + '\n' + knrdecls + ';\n' + body + '\n' + else: + return decl + '\n' + body + '\n' + + def visit_FileAST(self, n): + s = '' + for ext in n.ext: + if isinstance(ext, c_ast.FuncDef): + s += self.visit(ext) + elif isinstance(ext, c_ast.Pragma): + s += self.visit(ext) + '\n' + else: + s += self.visit(ext) + ';\n' + return s + + def visit_Compound(self, n): + s = self._make_indent() + '{\n' + self.indent_level += 2 + if n.block_items: + s += ''.join(self._generate_stmt(stmt) for stmt in n.block_items) + self.indent_level -= 2 + s += self._make_indent() + '}\n' + return s + + def visit_CompoundLiteral(self, n): + return '(' + self.visit(n.type) + '){' + self.visit(n.init) + '}' + + + def visit_EmptyStatement(self, n): + return ';' + + def visit_ParamList(self, n): + return ', '.join(self.visit(param) for param in n.params) + + def visit_Return(self, n): + s = 'return' + if n.expr: s += ' ' + self.visit(n.expr) + return s + ';' + + def visit_Break(self, n): + return 'break;' + + def visit_Continue(self, n): + return 'continue;' + + def visit_TernaryOp(self, n): + s = '(' + self._visit_expr(n.cond) + ') ? ' + s += '(' + self._visit_expr(n.iftrue) + ') : ' + s += '(' + self._visit_expr(n.iffalse) + ')' + return s + + def visit_If(self, n): + s = 'if (' + if n.cond: s += self.visit(n.cond) + s += ')\n' + s += self._generate_stmt(n.iftrue, add_indent=True) + if n.iffalse: + s += self._make_indent() + 'else\n' + s += self._generate_stmt(n.iffalse, add_indent=True) + return s + + def visit_For(self, n): + s = 'for (' + if n.init: s += self.visit(n.init) + s += ';' + if n.cond: s += ' ' + self.visit(n.cond) + s += ';' + if n.next: s += ' ' + self.visit(n.next) + s += ')\n' + s += self._generate_stmt(n.stmt, add_indent=True) + return s + + def visit_While(self, n): + s = 'while (' + if n.cond: s += self.visit(n.cond) + s += ')\n' + s += self._generate_stmt(n.stmt, add_indent=True) + return s + + def visit_DoWhile(self, n): + s = 'do\n' + s += self._generate_stmt(n.stmt, add_indent=True) + s += self._make_indent() + 'while (' + if n.cond: s += self.visit(n.cond) + s += ');' + return s + + def visit_Switch(self, n): + s = 'switch (' + self.visit(n.cond) + ')\n' + s += self._generate_stmt(n.stmt, add_indent=True) + return s + + def visit_Case(self, n): + s = 'case ' + self.visit(n.expr) + ':\n' + for stmt in n.stmts: + s += self._generate_stmt(stmt, add_indent=True) + return s + + def visit_Default(self, n): + s = 'default:\n' + for stmt in n.stmts: + s += self._generate_stmt(stmt, add_indent=True) + return s + + def visit_Label(self, n): + return n.name + ':\n' + self._generate_stmt(n.stmt) + + def visit_Goto(self, n): + return 'goto ' + n.name + ';' + + def visit_EllipsisParam(self, n): + return '...' + + def visit_Struct(self, n): + return self._generate_struct_union_enum(n, 'struct') + + def visit_Typename(self, n): + return self._generate_type(n.type) + + def visit_Union(self, n): + return self._generate_struct_union_enum(n, 'union') + + def visit_NamedInitializer(self, n): + s = '' + for name in n.name: + if isinstance(name, c_ast.ID): + s += '.' + name.name + else: + s += '[' + self.visit(name) + ']' + s += ' = ' + self._visit_expr(n.expr) + return s + + def visit_FuncDecl(self, n): + return self._generate_type(n) + + def _generate_struct_union_enum(self, n, name): + """ Generates code for structs, unions, and enums. name should be + 'struct', 'union', or 'enum'. + """ + if name in ('struct', 'union'): + members = n.decls + body_function = self._generate_struct_union_body + else: + assert name == 'enum' + members = None if n.values is None else n.values.enumerators + body_function = self._generate_enum_body + s = name + ' ' + (n.name or '') + if members is not None: + # None means no members + # Empty sequence means an empty list of members + s += '\n' + s += self._make_indent() + self.indent_level += 2 + s += '{\n' + s += body_function(members) + self.indent_level -= 2 + s += self._make_indent() + '}' + return s + + def _generate_struct_union_body(self, members): + return ''.join(self._generate_stmt(decl) for decl in members) + + def _generate_enum_body(self, members): + # `[:-2] + '\n'` removes the final `,` from the enumerator list + return ''.join(self.visit(value) for value in members)[:-2] + '\n' + + def _generate_stmt(self, n, add_indent=False): + """ Generation from a statement node. This method exists as a wrapper + for individual visit_* methods to handle different treatment of + some statements in this context. + """ + typ = type(n) + if add_indent: self.indent_level += 2 + indent = self._make_indent() + if add_indent: self.indent_level -= 2 + + if typ in ( + c_ast.Decl, c_ast.Assignment, c_ast.Cast, c_ast.UnaryOp, + c_ast.BinaryOp, c_ast.TernaryOp, c_ast.FuncCall, c_ast.ArrayRef, + c_ast.StructRef, c_ast.Constant, c_ast.ID, c_ast.Typedef, + c_ast.ExprList): + # These can also appear in an expression context so no semicolon + # is added to them automatically + # + return indent + self.visit(n) + ';\n' + elif typ in (c_ast.Compound,): + # No extra indentation required before the opening brace of a + # compound - because it consists of multiple lines it has to + # compute its own indentation. + # + return self.visit(n) + else: + return indent + self.visit(n) + '\n' + + def _generate_decl(self, n): + """ Generation from a Decl node. + """ + s = '' + if n.funcspec: s = ' '.join(n.funcspec) + ' ' + if n.storage: s += ' '.join(n.storage) + ' ' + s += self._generate_type(n.type) + return s + + def _generate_type(self, n, modifiers=[]): + """ Recursive generation from a type node. n is the type node. + modifiers collects the PtrDecl, ArrayDecl and FuncDecl modifiers + encountered on the way down to a TypeDecl, to allow proper + generation from it. + """ + typ = type(n) + #~ print(n, modifiers) + + if typ == c_ast.TypeDecl: + s = '' + if n.quals: s += ' '.join(n.quals) + ' ' + s += self.visit(n.type) + + nstr = n.declname if n.declname else '' + # Resolve modifiers. + # Wrap in parens to distinguish pointer to array and pointer to + # function syntax. + # + for i, modifier in enumerate(modifiers): + if isinstance(modifier, c_ast.ArrayDecl): + if (i != 0 and isinstance(modifiers[i - 1], c_ast.PtrDecl)): + nstr = '(' + nstr + ')' + nstr += '[' + self.visit(modifier.dim) + ']' + elif isinstance(modifier, c_ast.FuncDecl): + if (i != 0 and isinstance(modifiers[i - 1], c_ast.PtrDecl)): + nstr = '(' + nstr + ')' + nstr += '(' + self.visit(modifier.args) + ')' + elif isinstance(modifier, c_ast.PtrDecl): + if modifier.quals: + nstr = '* %s %s' % (' '.join(modifier.quals), nstr) + else: + nstr = '*' + nstr + if nstr: s += ' ' + nstr + return s + elif typ == c_ast.Decl: + return self._generate_decl(n.type) + elif typ == c_ast.Typename: + return self._generate_type(n.type) + elif typ == c_ast.IdentifierType: + return ' '.join(n.names) + ' ' + elif typ in (c_ast.ArrayDecl, c_ast.PtrDecl, c_ast.FuncDecl): + return self._generate_type(n.type, modifiers + [n]) + else: + return self.visit(n) + + def _parenthesize_if(self, n, condition): + """ Visits 'n' and returns its string representation, parenthesized + if the condition function applied to the node returns True. + """ + s = self._visit_expr(n) + if condition(n): + return '(' + s + ')' + else: + return s + + def _parenthesize_unless_simple(self, n): + """ Common use case for _parenthesize_if + """ + return self._parenthesize_if(n, lambda d: not self._is_simple_node(d)) + + def _is_simple_node(self, n): + """ Returns True for nodes that are "simple" - i.e. nodes that always + have higher precedence than operators. + """ + return isinstance(n, (c_ast.Constant, c_ast.ID, c_ast.ArrayRef, + c_ast.StructRef, c_ast.FuncCall)) diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pycparser/c_lexer.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pycparser/c_lexer.py new file mode 100644 index 00000000..de8445e9 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pycparser/c_lexer.py @@ -0,0 +1,484 @@ +#------------------------------------------------------------------------------ +# pycparser: c_lexer.py +# +# CLexer class: lexer for the C language +# +# Eli Bendersky [https://eli.thegreenplace.net/] +# License: BSD +#------------------------------------------------------------------------------ +import re +import sys + +from .ply import lex +from .ply.lex import TOKEN + + +class CLexer(object): + """ A lexer for the C language. After building it, set the + input text with input(), and call token() to get new + tokens. + + The public attribute filename can be set to an initial + filaneme, but the lexer will update it upon #line + directives. + """ + def __init__(self, error_func, on_lbrace_func, on_rbrace_func, + type_lookup_func): + """ Create a new Lexer. + + error_func: + An error function. Will be called with an error + message, line and column as arguments, in case of + an error during lexing. + + on_lbrace_func, on_rbrace_func: + Called when an LBRACE or RBRACE is encountered + (likely to push/pop type_lookup_func's scope) + + type_lookup_func: + A type lookup function. Given a string, it must + return True IFF this string is a name of a type + that was defined with a typedef earlier. + """ + self.error_func = error_func + self.on_lbrace_func = on_lbrace_func + self.on_rbrace_func = on_rbrace_func + self.type_lookup_func = type_lookup_func + self.filename = '' + + # Keeps track of the last token returned from self.token() + self.last_token = None + + # Allow either "# line" or "# " to support GCC's + # cpp output + # + self.line_pattern = re.compile(r'([ \t]*line\W)|([ \t]*\d+)') + self.pragma_pattern = re.compile(r'[ \t]*pragma\W') + + def build(self, **kwargs): + """ Builds the lexer from the specification. Must be + called after the lexer object is created. + + This method exists separately, because the PLY + manual warns against calling lex.lex inside + __init__ + """ + self.lexer = lex.lex(object=self, **kwargs) + + def reset_lineno(self): + """ Resets the internal line number counter of the lexer. + """ + self.lexer.lineno = 1 + + def input(self, text): + self.lexer.input(text) + + def token(self): + self.last_token = self.lexer.token() + return self.last_token + + def find_tok_column(self, token): + """ Find the column of the token in its line. + """ + last_cr = self.lexer.lexdata.rfind('\n', 0, token.lexpos) + return token.lexpos - last_cr + + ######################-- PRIVATE --###################### + + ## + ## Internal auxiliary methods + ## + def _error(self, msg, token): + location = self._make_tok_location(token) + self.error_func(msg, location[0], location[1]) + self.lexer.skip(1) + + def _make_tok_location(self, token): + return (token.lineno, self.find_tok_column(token)) + + ## + ## Reserved keywords + ## + keywords = ( + '_BOOL', '_COMPLEX', 'AUTO', 'BREAK', 'CASE', 'CHAR', 'CONST', + 'CONTINUE', 'DEFAULT', 'DO', 'DOUBLE', 'ELSE', 'ENUM', 'EXTERN', + 'FLOAT', 'FOR', 'GOTO', 'IF', 'INLINE', 'INT', 'LONG', + 'REGISTER', 'OFFSETOF', + 'RESTRICT', 'RETURN', 'SHORT', 'SIGNED', 'SIZEOF', 'STATIC', 'STRUCT', + 'SWITCH', 'TYPEDEF', 'UNION', 'UNSIGNED', 'VOID', + 'VOLATILE', 'WHILE', '__INT128', + ) + + keyword_map = {} + for keyword in keywords: + if keyword == '_BOOL': + keyword_map['_Bool'] = keyword + elif keyword == '_COMPLEX': + keyword_map['_Complex'] = keyword + else: + keyword_map[keyword.lower()] = keyword + + ## + ## All the tokens recognized by the lexer + ## + tokens = keywords + ( + # Identifiers + 'ID', + + # Type identifiers (identifiers previously defined as + # types with typedef) + 'TYPEID', + + # constants + 'INT_CONST_DEC', 'INT_CONST_OCT', 'INT_CONST_HEX', 'INT_CONST_BIN', + 'FLOAT_CONST', 'HEX_FLOAT_CONST', + 'CHAR_CONST', + 'WCHAR_CONST', + + # String literals + 'STRING_LITERAL', + 'WSTRING_LITERAL', + + # Operators + 'PLUS', 'MINUS', 'TIMES', 'DIVIDE', 'MOD', + 'OR', 'AND', 'NOT', 'XOR', 'LSHIFT', 'RSHIFT', + 'LOR', 'LAND', 'LNOT', + 'LT', 'LE', 'GT', 'GE', 'EQ', 'NE', + + # Assignment + 'EQUALS', 'TIMESEQUAL', 'DIVEQUAL', 'MODEQUAL', + 'PLUSEQUAL', 'MINUSEQUAL', + 'LSHIFTEQUAL','RSHIFTEQUAL', 'ANDEQUAL', 'XOREQUAL', + 'OREQUAL', + + # Increment/decrement + 'PLUSPLUS', 'MINUSMINUS', + + # Structure dereference (->) + 'ARROW', + + # Conditional operator (?) + 'CONDOP', + + # Delimeters + 'LPAREN', 'RPAREN', # ( ) + 'LBRACKET', 'RBRACKET', # [ ] + 'LBRACE', 'RBRACE', # { } + 'COMMA', 'PERIOD', # . , + 'SEMI', 'COLON', # ; : + + # Ellipsis (...) + 'ELLIPSIS', + + # pre-processor + 'PPHASH', # '#' + 'PPPRAGMA', # 'pragma' + 'PPPRAGMASTR', + ) + + ## + ## Regexes for use in tokens + ## + ## + + # valid C identifiers (K&R2: A.2.3), plus '$' (supported by some compilers) + identifier = r'[a-zA-Z_$][0-9a-zA-Z_$]*' + + hex_prefix = '0[xX]' + hex_digits = '[0-9a-fA-F]+' + bin_prefix = '0[bB]' + bin_digits = '[01]+' + + # integer constants (K&R2: A.2.5.1) + integer_suffix_opt = r'(([uU]ll)|([uU]LL)|(ll[uU]?)|(LL[uU]?)|([uU][lL])|([lL][uU]?)|[uU])?' + decimal_constant = '(0'+integer_suffix_opt+')|([1-9][0-9]*'+integer_suffix_opt+')' + octal_constant = '0[0-7]*'+integer_suffix_opt + hex_constant = hex_prefix+hex_digits+integer_suffix_opt + bin_constant = bin_prefix+bin_digits+integer_suffix_opt + + bad_octal_constant = '0[0-7]*[89]' + + # character constants (K&R2: A.2.5.2) + # Note: a-zA-Z and '.-~^_!=&;,' are allowed as escape chars to support #line + # directives with Windows paths as filenames (..\..\dir\file) + # For the same reason, decimal_escape allows all digit sequences. We want to + # parse all correct code, even if it means to sometimes parse incorrect + # code. + # + simple_escape = r"""([a-zA-Z._~!=&\^\-\\?'"])""" + decimal_escape = r"""(\d+)""" + hex_escape = r"""(x[0-9a-fA-F]+)""" + bad_escape = r"""([\\][^a-zA-Z._~^!=&\^\-\\?'"x0-7])""" + + escape_sequence = r"""(\\("""+simple_escape+'|'+decimal_escape+'|'+hex_escape+'))' + cconst_char = r"""([^'\\\n]|"""+escape_sequence+')' + char_const = "'"+cconst_char+"'" + wchar_const = 'L'+char_const + unmatched_quote = "('"+cconst_char+"*\\n)|('"+cconst_char+"*$)" + bad_char_const = r"""('"""+cconst_char+"""[^'\n]+')|('')|('"""+bad_escape+r"""[^'\n]*')""" + + # string literals (K&R2: A.2.6) + string_char = r"""([^"\\\n]|"""+escape_sequence+')' + string_literal = '"'+string_char+'*"' + wstring_literal = 'L'+string_literal + bad_string_literal = '"'+string_char+'*?'+bad_escape+string_char+'*"' + + # floating constants (K&R2: A.2.5.3) + exponent_part = r"""([eE][-+]?[0-9]+)""" + fractional_constant = r"""([0-9]*\.[0-9]+)|([0-9]+\.)""" + floating_constant = '(((('+fractional_constant+')'+exponent_part+'?)|([0-9]+'+exponent_part+'))[FfLl]?)' + binary_exponent_part = r'''([pP][+-]?[0-9]+)''' + hex_fractional_constant = '((('+hex_digits+r""")?\."""+hex_digits+')|('+hex_digits+r"""\.))""" + hex_floating_constant = '('+hex_prefix+'('+hex_digits+'|'+hex_fractional_constant+')'+binary_exponent_part+'[FfLl]?)' + + ## + ## Lexer states: used for preprocessor \n-terminated directives + ## + states = ( + # ppline: preprocessor line directives + # + ('ppline', 'exclusive'), + + # pppragma: pragma + # + ('pppragma', 'exclusive'), + ) + + def t_PPHASH(self, t): + r'[ \t]*\#' + if self.line_pattern.match(t.lexer.lexdata, pos=t.lexer.lexpos): + t.lexer.begin('ppline') + self.pp_line = self.pp_filename = None + elif self.pragma_pattern.match(t.lexer.lexdata, pos=t.lexer.lexpos): + t.lexer.begin('pppragma') + else: + t.type = 'PPHASH' + return t + + ## + ## Rules for the ppline state + ## + @TOKEN(string_literal) + def t_ppline_FILENAME(self, t): + if self.pp_line is None: + self._error('filename before line number in #line', t) + else: + self.pp_filename = t.value.lstrip('"').rstrip('"') + + @TOKEN(decimal_constant) + def t_ppline_LINE_NUMBER(self, t): + if self.pp_line is None: + self.pp_line = t.value + else: + # Ignore: GCC's cpp sometimes inserts a numeric flag + # after the file name + pass + + def t_ppline_NEWLINE(self, t): + r'\n' + if self.pp_line is None: + self._error('line number missing in #line', t) + else: + self.lexer.lineno = int(self.pp_line) + + if self.pp_filename is not None: + self.filename = self.pp_filename + + t.lexer.begin('INITIAL') + + def t_ppline_PPLINE(self, t): + r'line' + pass + + t_ppline_ignore = ' \t' + + def t_ppline_error(self, t): + self._error('invalid #line directive', t) + + ## + ## Rules for the pppragma state + ## + def t_pppragma_NEWLINE(self, t): + r'\n' + t.lexer.lineno += 1 + t.lexer.begin('INITIAL') + + def t_pppragma_PPPRAGMA(self, t): + r'pragma' + return t + + t_pppragma_ignore = ' \t' + + def t_pppragma_STR(self, t): + '.+' + t.type = 'PPPRAGMASTR' + return t + + def t_pppragma_error(self, t): + self._error('invalid #pragma directive', t) + + ## + ## Rules for the normal state + ## + t_ignore = ' \t' + + # Newlines + def t_NEWLINE(self, t): + r'\n+' + t.lexer.lineno += t.value.count("\n") + + # Operators + t_PLUS = r'\+' + t_MINUS = r'-' + t_TIMES = r'\*' + t_DIVIDE = r'/' + t_MOD = r'%' + t_OR = r'\|' + t_AND = r'&' + t_NOT = r'~' + t_XOR = r'\^' + t_LSHIFT = r'<<' + t_RSHIFT = r'>>' + t_LOR = r'\|\|' + t_LAND = r'&&' + t_LNOT = r'!' + t_LT = r'<' + t_GT = r'>' + t_LE = r'<=' + t_GE = r'>=' + t_EQ = r'==' + t_NE = r'!=' + + # Assignment operators + t_EQUALS = r'=' + t_TIMESEQUAL = r'\*=' + t_DIVEQUAL = r'/=' + t_MODEQUAL = r'%=' + t_PLUSEQUAL = r'\+=' + t_MINUSEQUAL = r'-=' + t_LSHIFTEQUAL = r'<<=' + t_RSHIFTEQUAL = r'>>=' + t_ANDEQUAL = r'&=' + t_OREQUAL = r'\|=' + t_XOREQUAL = r'\^=' + + # Increment/decrement + t_PLUSPLUS = r'\+\+' + t_MINUSMINUS = r'--' + + # -> + t_ARROW = r'->' + + # ? + t_CONDOP = r'\?' + + # Delimeters + t_LPAREN = r'\(' + t_RPAREN = r'\)' + t_LBRACKET = r'\[' + t_RBRACKET = r'\]' + t_COMMA = r',' + t_PERIOD = r'\.' + t_SEMI = r';' + t_COLON = r':' + t_ELLIPSIS = r'\.\.\.' + + # Scope delimiters + # To see why on_lbrace_func is needed, consider: + # typedef char TT; + # void foo(int TT) { TT = 10; } + # TT x = 5; + # Outside the function, TT is a typedef, but inside (starting and ending + # with the braces) it's a parameter. The trouble begins with yacc's + # lookahead token. If we open a new scope in brace_open, then TT has + # already been read and incorrectly interpreted as TYPEID. So, we need + # to open and close scopes from within the lexer. + # Similar for the TT immediately outside the end of the function. + # + @TOKEN(r'\{') + def t_LBRACE(self, t): + self.on_lbrace_func() + return t + @TOKEN(r'\}') + def t_RBRACE(self, t): + self.on_rbrace_func() + return t + + t_STRING_LITERAL = string_literal + + # The following floating and integer constants are defined as + # functions to impose a strict order (otherwise, decimal + # is placed before the others because its regex is longer, + # and this is bad) + # + @TOKEN(floating_constant) + def t_FLOAT_CONST(self, t): + return t + + @TOKEN(hex_floating_constant) + def t_HEX_FLOAT_CONST(self, t): + return t + + @TOKEN(hex_constant) + def t_INT_CONST_HEX(self, t): + return t + + @TOKEN(bin_constant) + def t_INT_CONST_BIN(self, t): + return t + + @TOKEN(bad_octal_constant) + def t_BAD_CONST_OCT(self, t): + msg = "Invalid octal constant" + self._error(msg, t) + + @TOKEN(octal_constant) + def t_INT_CONST_OCT(self, t): + return t + + @TOKEN(decimal_constant) + def t_INT_CONST_DEC(self, t): + return t + + # Must come before bad_char_const, to prevent it from + # catching valid char constants as invalid + # + @TOKEN(char_const) + def t_CHAR_CONST(self, t): + return t + + @TOKEN(wchar_const) + def t_WCHAR_CONST(self, t): + return t + + @TOKEN(unmatched_quote) + def t_UNMATCHED_QUOTE(self, t): + msg = "Unmatched '" + self._error(msg, t) + + @TOKEN(bad_char_const) + def t_BAD_CHAR_CONST(self, t): + msg = "Invalid char constant %s" % t.value + self._error(msg, t) + + @TOKEN(wstring_literal) + def t_WSTRING_LITERAL(self, t): + return t + + # unmatched string literals are caught by the preprocessor + + @TOKEN(bad_string_literal) + def t_BAD_STRING_LITERAL(self, t): + msg = "String contains invalid escape code" + self._error(msg, t) + + @TOKEN(identifier) + def t_ID(self, t): + t.type = self.keyword_map.get(t.value, "ID") + if t.type == 'ID' and self.type_lookup_func(t.value): + t.type = "TYPEID" + return t + + def t_error(self, t): + msg = 'Illegal character %s' % repr(t.value[0]) + self._error(msg, t) diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pycparser/c_parser.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pycparser/c_parser.py new file mode 100644 index 00000000..0e6e7556 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pycparser/c_parser.py @@ -0,0 +1,1850 @@ +#------------------------------------------------------------------------------ +# pycparser: c_parser.py +# +# CParser class: Parser and AST builder for the C language +# +# Eli Bendersky [https://eli.thegreenplace.net/] +# License: BSD +#------------------------------------------------------------------------------ +import re + +from .ply import yacc + +from . import c_ast +from .c_lexer import CLexer +from .plyparser import PLYParser, Coord, ParseError, parameterized, template +from .ast_transforms import fix_switch_cases + + +@template +class CParser(PLYParser): + def __init__( + self, + lex_optimize=True, + lexer=CLexer, + lextab='pycparser.lextab', + yacc_optimize=True, + yacctab='pycparser.yacctab', + yacc_debug=False, + taboutputdir=''): + """ Create a new CParser. + + Some arguments for controlling the debug/optimization + level of the parser are provided. The defaults are + tuned for release/performance mode. + The simple rules for using them are: + *) When tweaking CParser/CLexer, set these to False + *) When releasing a stable parser, set to True + + lex_optimize: + Set to False when you're modifying the lexer. + Otherwise, changes in the lexer won't be used, if + some lextab.py file exists. + When releasing with a stable lexer, set to True + to save the re-generation of the lexer table on + each run. + + lexer: + Set this parameter to define the lexer to use if + you're not using the default CLexer. + + lextab: + Points to the lex table that's used for optimized + mode. Only if you're modifying the lexer and want + some tests to avoid re-generating the table, make + this point to a local lex table file (that's been + earlier generated with lex_optimize=True) + + yacc_optimize: + Set to False when you're modifying the parser. + Otherwise, changes in the parser won't be used, if + some parsetab.py file exists. + When releasing with a stable parser, set to True + to save the re-generation of the parser table on + each run. + + yacctab: + Points to the yacc table that's used for optimized + mode. Only if you're modifying the parser, make + this point to a local yacc table file + + yacc_debug: + Generate a parser.out file that explains how yacc + built the parsing table from the grammar. + + taboutputdir: + Set this parameter to control the location of generated + lextab and yacctab files. + """ + self.clex = lexer( + error_func=self._lex_error_func, + on_lbrace_func=self._lex_on_lbrace_func, + on_rbrace_func=self._lex_on_rbrace_func, + type_lookup_func=self._lex_type_lookup_func) + + self.clex.build( + optimize=lex_optimize, + lextab=lextab, + outputdir=taboutputdir) + self.tokens = self.clex.tokens + + rules_with_opt = [ + 'abstract_declarator', + 'assignment_expression', + 'declaration_list', + 'declaration_specifiers_no_type', + 'designation', + 'expression', + 'identifier_list', + 'init_declarator_list', + 'id_init_declarator_list', + 'initializer_list', + 'parameter_type_list', + 'block_item_list', + 'type_qualifier_list', + 'struct_declarator_list' + ] + + for rule in rules_with_opt: + self._create_opt_rule(rule) + + self.cparser = yacc.yacc( + module=self, + start='translation_unit_or_empty', + debug=yacc_debug, + optimize=yacc_optimize, + tabmodule=yacctab, + outputdir=taboutputdir) + + # Stack of scopes for keeping track of symbols. _scope_stack[-1] is + # the current (topmost) scope. Each scope is a dictionary that + # specifies whether a name is a type. If _scope_stack[n][name] is + # True, 'name' is currently a type in the scope. If it's False, + # 'name' is used in the scope but not as a type (for instance, if we + # saw: int name; + # If 'name' is not a key in _scope_stack[n] then 'name' was not defined + # in this scope at all. + self._scope_stack = [dict()] + + # Keeps track of the last token given to yacc (the lookahead token) + self._last_yielded_token = None + + def parse(self, text, filename='', debuglevel=0): + """ Parses C code and returns an AST. + + text: + A string containing the C source code + + filename: + Name of the file being parsed (for meaningful + error messages) + + debuglevel: + Debug level to yacc + """ + self.clex.filename = filename + self.clex.reset_lineno() + self._scope_stack = [dict()] + self._last_yielded_token = None + return self.cparser.parse( + input=text, + lexer=self.clex, + debug=debuglevel) + + ######################-- PRIVATE --###################### + + def _push_scope(self): + self._scope_stack.append(dict()) + + def _pop_scope(self): + assert len(self._scope_stack) > 1 + self._scope_stack.pop() + + def _add_typedef_name(self, name, coord): + """ Add a new typedef name (ie a TYPEID) to the current scope + """ + if not self._scope_stack[-1].get(name, True): + self._parse_error( + "Typedef %r previously declared as non-typedef " + "in this scope" % name, coord) + self._scope_stack[-1][name] = True + + def _add_identifier(self, name, coord): + """ Add a new object, function, or enum member name (ie an ID) to the + current scope + """ + if self._scope_stack[-1].get(name, False): + self._parse_error( + "Non-typedef %r previously declared as typedef " + "in this scope" % name, coord) + self._scope_stack[-1][name] = False + + def _is_type_in_scope(self, name): + """ Is *name* a typedef-name in the current scope? + """ + for scope in reversed(self._scope_stack): + # If name is an identifier in this scope it shadows typedefs in + # higher scopes. + in_scope = scope.get(name) + if in_scope is not None: return in_scope + return False + + def _lex_error_func(self, msg, line, column): + self._parse_error(msg, self._coord(line, column)) + + def _lex_on_lbrace_func(self): + self._push_scope() + + def _lex_on_rbrace_func(self): + self._pop_scope() + + def _lex_type_lookup_func(self, name): + """ Looks up types that were previously defined with + typedef. + Passed to the lexer for recognizing identifiers that + are types. + """ + is_type = self._is_type_in_scope(name) + return is_type + + def _get_yacc_lookahead_token(self): + """ We need access to yacc's lookahead token in certain cases. + This is the last token yacc requested from the lexer, so we + ask the lexer. + """ + return self.clex.last_token + + # To understand what's going on here, read sections A.8.5 and + # A.8.6 of K&R2 very carefully. + # + # A C type consists of a basic type declaration, with a list + # of modifiers. For example: + # + # int *c[5]; + # + # The basic declaration here is 'int c', and the pointer and + # the array are the modifiers. + # + # Basic declarations are represented by TypeDecl (from module c_ast) and the + # modifiers are FuncDecl, PtrDecl and ArrayDecl. + # + # The standard states that whenever a new modifier is parsed, it should be + # added to the end of the list of modifiers. For example: + # + # K&R2 A.8.6.2: Array Declarators + # + # In a declaration T D where D has the form + # D1 [constant-expression-opt] + # and the type of the identifier in the declaration T D1 is + # "type-modifier T", the type of the + # identifier of D is "type-modifier array of T" + # + # This is what this method does. The declarator it receives + # can be a list of declarators ending with TypeDecl. It + # tacks the modifier to the end of this list, just before + # the TypeDecl. + # + # Additionally, the modifier may be a list itself. This is + # useful for pointers, that can come as a chain from the rule + # p_pointer. In this case, the whole modifier list is spliced + # into the new location. + def _type_modify_decl(self, decl, modifier): + """ Tacks a type modifier on a declarator, and returns + the modified declarator. + + Note: the declarator and modifier may be modified + """ + #~ print '****' + #~ decl.show(offset=3) + #~ modifier.show(offset=3) + #~ print '****' + + modifier_head = modifier + modifier_tail = modifier + + # The modifier may be a nested list. Reach its tail. + # + while modifier_tail.type: + modifier_tail = modifier_tail.type + + # If the decl is a basic type, just tack the modifier onto + # it + # + if isinstance(decl, c_ast.TypeDecl): + modifier_tail.type = decl + return modifier + else: + # Otherwise, the decl is a list of modifiers. Reach + # its tail and splice the modifier onto the tail, + # pointing to the underlying basic type. + # + decl_tail = decl + + while not isinstance(decl_tail.type, c_ast.TypeDecl): + decl_tail = decl_tail.type + + modifier_tail.type = decl_tail.type + decl_tail.type = modifier_head + return decl + + # Due to the order in which declarators are constructed, + # they have to be fixed in order to look like a normal AST. + # + # When a declaration arrives from syntax construction, it has + # these problems: + # * The innermost TypeDecl has no type (because the basic + # type is only known at the uppermost declaration level) + # * The declaration has no variable name, since that is saved + # in the innermost TypeDecl + # * The typename of the declaration is a list of type + # specifiers, and not a node. Here, basic identifier types + # should be separated from more complex types like enums + # and structs. + # + # This method fixes these problems. + # + def _fix_decl_name_type(self, decl, typename): + """ Fixes a declaration. Modifies decl. + """ + # Reach the underlying basic type + # + type = decl + while not isinstance(type, c_ast.TypeDecl): + type = type.type + + decl.name = type.declname + type.quals = decl.quals + + # The typename is a list of types. If any type in this + # list isn't an IdentifierType, it must be the only + # type in the list (it's illegal to declare "int enum ..") + # If all the types are basic, they're collected in the + # IdentifierType holder. + # + for tn in typename: + if not isinstance(tn, c_ast.IdentifierType): + if len(typename) > 1: + self._parse_error( + "Invalid multiple types specified", tn.coord) + else: + type.type = tn + return decl + + if not typename: + # Functions default to returning int + # + if not isinstance(decl.type, c_ast.FuncDecl): + self._parse_error( + "Missing type in declaration", decl.coord) + type.type = c_ast.IdentifierType( + ['int'], + coord=decl.coord) + else: + # At this point, we know that typename is a list of IdentifierType + # nodes. Concatenate all the names into a single list. + # + type.type = c_ast.IdentifierType( + [name for id in typename for name in id.names], + coord=typename[0].coord) + return decl + + def _add_declaration_specifier(self, declspec, newspec, kind, append=False): + """ Declaration specifiers are represented by a dictionary + with the entries: + * qual: a list of type qualifiers + * storage: a list of storage type qualifiers + * type: a list of type specifiers + * function: a list of function specifiers + + This method is given a declaration specifier, and a + new specifier of a given kind. + If `append` is True, the new specifier is added to the end of + the specifiers list, otherwise it's added at the beginning. + Returns the declaration specifier, with the new + specifier incorporated. + """ + spec = declspec or dict(qual=[], storage=[], type=[], function=[]) + + if append: + spec[kind].append(newspec) + else: + spec[kind].insert(0, newspec) + + return spec + + def _build_declarations(self, spec, decls, typedef_namespace=False): + """ Builds a list of declarations all sharing the given specifiers. + If typedef_namespace is true, each declared name is added + to the "typedef namespace", which also includes objects, + functions, and enum constants. + """ + is_typedef = 'typedef' in spec['storage'] + declarations = [] + + # Bit-fields are allowed to be unnamed. + # + if decls[0].get('bitsize') is not None: + pass + + # When redeclaring typedef names as identifiers in inner scopes, a + # problem can occur where the identifier gets grouped into + # spec['type'], leaving decl as None. This can only occur for the + # first declarator. + # + elif decls[0]['decl'] is None: + if len(spec['type']) < 2 or len(spec['type'][-1].names) != 1 or \ + not self._is_type_in_scope(spec['type'][-1].names[0]): + coord = '?' + for t in spec['type']: + if hasattr(t, 'coord'): + coord = t.coord + break + self._parse_error('Invalid declaration', coord) + + # Make this look as if it came from "direct_declarator:ID" + decls[0]['decl'] = c_ast.TypeDecl( + declname=spec['type'][-1].names[0], + type=None, + quals=None, + coord=spec['type'][-1].coord) + # Remove the "new" type's name from the end of spec['type'] + del spec['type'][-1] + + # A similar problem can occur where the declaration ends up looking + # like an abstract declarator. Give it a name if this is the case. + # + elif not isinstance(decls[0]['decl'], + (c_ast.Struct, c_ast.Union, c_ast.IdentifierType)): + decls_0_tail = decls[0]['decl'] + while not isinstance(decls_0_tail, c_ast.TypeDecl): + decls_0_tail = decls_0_tail.type + if decls_0_tail.declname is None: + decls_0_tail.declname = spec['type'][-1].names[0] + del spec['type'][-1] + + for decl in decls: + assert decl['decl'] is not None + if is_typedef: + declaration = c_ast.Typedef( + name=None, + quals=spec['qual'], + storage=spec['storage'], + type=decl['decl'], + coord=decl['decl'].coord) + else: + declaration = c_ast.Decl( + name=None, + quals=spec['qual'], + storage=spec['storage'], + funcspec=spec['function'], + type=decl['decl'], + init=decl.get('init'), + bitsize=decl.get('bitsize'), + coord=decl['decl'].coord) + + if isinstance(declaration.type, + (c_ast.Struct, c_ast.Union, c_ast.IdentifierType)): + fixed_decl = declaration + else: + fixed_decl = self._fix_decl_name_type(declaration, spec['type']) + + # Add the type name defined by typedef to a + # symbol table (for usage in the lexer) + # + if typedef_namespace: + if is_typedef: + self._add_typedef_name(fixed_decl.name, fixed_decl.coord) + else: + self._add_identifier(fixed_decl.name, fixed_decl.coord) + + declarations.append(fixed_decl) + + return declarations + + def _build_function_definition(self, spec, decl, param_decls, body): + """ Builds a function definition. + """ + assert 'typedef' not in spec['storage'] + + declaration = self._build_declarations( + spec=spec, + decls=[dict(decl=decl, init=None)], + typedef_namespace=True)[0] + + return c_ast.FuncDef( + decl=declaration, + param_decls=param_decls, + body=body, + coord=decl.coord) + + def _select_struct_union_class(self, token): + """ Given a token (either STRUCT or UNION), selects the + appropriate AST class. + """ + if token == 'struct': + return c_ast.Struct + else: + return c_ast.Union + + ## + ## Precedence and associativity of operators + ## + precedence = ( + ('left', 'LOR'), + ('left', 'LAND'), + ('left', 'OR'), + ('left', 'XOR'), + ('left', 'AND'), + ('left', 'EQ', 'NE'), + ('left', 'GT', 'GE', 'LT', 'LE'), + ('left', 'RSHIFT', 'LSHIFT'), + ('left', 'PLUS', 'MINUS'), + ('left', 'TIMES', 'DIVIDE', 'MOD') + ) + + ## + ## Grammar productions + ## Implementation of the BNF defined in K&R2 A.13 + ## + + # Wrapper around a translation unit, to allow for empty input. + # Not strictly part of the C99 Grammar, but useful in practice. + # + def p_translation_unit_or_empty(self, p): + """ translation_unit_or_empty : translation_unit + | empty + """ + if p[1] is None: + p[0] = c_ast.FileAST([]) + else: + p[0] = c_ast.FileAST(p[1]) + + def p_translation_unit_1(self, p): + """ translation_unit : external_declaration + """ + # Note: external_declaration is already a list + # + p[0] = p[1] + + def p_translation_unit_2(self, p): + """ translation_unit : translation_unit external_declaration + """ + if p[2] is not None: + p[1].extend(p[2]) + p[0] = p[1] + + # Declarations always come as lists (because they can be + # several in one line), so we wrap the function definition + # into a list as well, to make the return value of + # external_declaration homogenous. + # + def p_external_declaration_1(self, p): + """ external_declaration : function_definition + """ + p[0] = [p[1]] + + def p_external_declaration_2(self, p): + """ external_declaration : declaration + """ + p[0] = p[1] + + def p_external_declaration_3(self, p): + """ external_declaration : pp_directive + | pppragma_directive + """ + p[0] = [p[1]] + + def p_external_declaration_4(self, p): + """ external_declaration : SEMI + """ + p[0] = None + + def p_pp_directive(self, p): + """ pp_directive : PPHASH + """ + self._parse_error('Directives not supported yet', + self._token_coord(p, 1)) + + def p_pppragma_directive(self, p): + """ pppragma_directive : PPPRAGMA + | PPPRAGMA PPPRAGMASTR + """ + if len(p) == 3: + p[0] = c_ast.Pragma(p[2], self._token_coord(p, 2)) + else: + p[0] = c_ast.Pragma("", self._token_coord(p, 1)) + + # In function definitions, the declarator can be followed by + # a declaration list, for old "K&R style" function definitios. + # + def p_function_definition_1(self, p): + """ function_definition : id_declarator declaration_list_opt compound_statement + """ + # no declaration specifiers - 'int' becomes the default type + spec = dict( + qual=[], + storage=[], + type=[c_ast.IdentifierType(['int'], + coord=self._token_coord(p, 1))], + function=[]) + + p[0] = self._build_function_definition( + spec=spec, + decl=p[1], + param_decls=p[2], + body=p[3]) + + def p_function_definition_2(self, p): + """ function_definition : declaration_specifiers id_declarator declaration_list_opt compound_statement + """ + spec = p[1] + + p[0] = self._build_function_definition( + spec=spec, + decl=p[2], + param_decls=p[3], + body=p[4]) + + def p_statement(self, p): + """ statement : labeled_statement + | expression_statement + | compound_statement + | selection_statement + | iteration_statement + | jump_statement + | pppragma_directive + """ + p[0] = p[1] + + # A pragma is generally considered a decorator rather than an actual statement. + # Still, for the purposes of analyzing an abstract syntax tree of C code, + # pragma's should not be ignored and were previously treated as a statement. + # This presents a problem for constructs that take a statement such as labeled_statements, + # selection_statements, and iteration_statements, causing a misleading structure + # in the AST. For example, consider the following C code. + # + # for (int i = 0; i < 3; i++) + # #pragma omp critical + # sum += 1; + # + # This code will compile and execute "sum += 1;" as the body of the for loop. + # Previous implementations of PyCParser would render the AST for this + # block of code as follows: + # + # For: + # DeclList: + # Decl: i, [], [], [] + # TypeDecl: i, [] + # IdentifierType: ['int'] + # Constant: int, 0 + # BinaryOp: < + # ID: i + # Constant: int, 3 + # UnaryOp: p++ + # ID: i + # Pragma: omp critical + # Assignment: += + # ID: sum + # Constant: int, 1 + # + # This AST misleadingly takes the Pragma as the body of the loop and the + # assignment then becomes a sibling of the loop. + # + # To solve edge cases like these, the pragmacomp_or_statement rule groups + # a pragma and its following statement (which would otherwise be orphaned) + # using a compound block, effectively turning the above code into: + # + # for (int i = 0; i < 3; i++) { + # #pragma omp critical + # sum += 1; + # } + def p_pragmacomp_or_statement(self, p): + """ pragmacomp_or_statement : pppragma_directive statement + | statement + """ + if isinstance(p[1], c_ast.Pragma) and len(p) == 3: + p[0] = c_ast.Compound( + block_items=[p[1], p[2]], + coord=self._token_coord(p, 1)) + else: + p[0] = p[1] + + # In C, declarations can come several in a line: + # int x, *px, romulo = 5; + # + # However, for the AST, we will split them to separate Decl + # nodes. + # + # This rule splits its declarations and always returns a list + # of Decl nodes, even if it's one element long. + # + def p_decl_body(self, p): + """ decl_body : declaration_specifiers init_declarator_list_opt + | declaration_specifiers_no_type id_init_declarator_list_opt + """ + spec = p[1] + + # p[2] (init_declarator_list_opt) is either a list or None + # + if p[2] is None: + # By the standard, you must have at least one declarator unless + # declaring a structure tag, a union tag, or the members of an + # enumeration. + # + ty = spec['type'] + s_u_or_e = (c_ast.Struct, c_ast.Union, c_ast.Enum) + if len(ty) == 1 and isinstance(ty[0], s_u_or_e): + decls = [c_ast.Decl( + name=None, + quals=spec['qual'], + storage=spec['storage'], + funcspec=spec['function'], + type=ty[0], + init=None, + bitsize=None, + coord=ty[0].coord)] + + # However, this case can also occur on redeclared identifiers in + # an inner scope. The trouble is that the redeclared type's name + # gets grouped into declaration_specifiers; _build_declarations + # compensates for this. + # + else: + decls = self._build_declarations( + spec=spec, + decls=[dict(decl=None, init=None)], + typedef_namespace=True) + + else: + decls = self._build_declarations( + spec=spec, + decls=p[2], + typedef_namespace=True) + + p[0] = decls + + # The declaration has been split to a decl_body sub-rule and + # SEMI, because having them in a single rule created a problem + # for defining typedefs. + # + # If a typedef line was directly followed by a line using the + # type defined with the typedef, the type would not be + # recognized. This is because to reduce the declaration rule, + # the parser's lookahead asked for the token after SEMI, which + # was the type from the next line, and the lexer had no chance + # to see the updated type symbol table. + # + # Splitting solves this problem, because after seeing SEMI, + # the parser reduces decl_body, which actually adds the new + # type into the table to be seen by the lexer before the next + # line is reached. + def p_declaration(self, p): + """ declaration : decl_body SEMI + """ + p[0] = p[1] + + # Since each declaration is a list of declarations, this + # rule will combine all the declarations and return a single + # list + # + def p_declaration_list(self, p): + """ declaration_list : declaration + | declaration_list declaration + """ + p[0] = p[1] if len(p) == 2 else p[1] + p[2] + + # To know when declaration-specifiers end and declarators begin, + # we require declaration-specifiers to have at least one + # type-specifier, and disallow typedef-names after we've seen any + # type-specifier. These are both required by the spec. + # + def p_declaration_specifiers_no_type_1(self, p): + """ declaration_specifiers_no_type : type_qualifier declaration_specifiers_no_type_opt + """ + p[0] = self._add_declaration_specifier(p[2], p[1], 'qual') + + def p_declaration_specifiers_no_type_2(self, p): + """ declaration_specifiers_no_type : storage_class_specifier declaration_specifiers_no_type_opt + """ + p[0] = self._add_declaration_specifier(p[2], p[1], 'storage') + + def p_declaration_specifiers_no_type_3(self, p): + """ declaration_specifiers_no_type : function_specifier declaration_specifiers_no_type_opt + """ + p[0] = self._add_declaration_specifier(p[2], p[1], 'function') + + + def p_declaration_specifiers_1(self, p): + """ declaration_specifiers : declaration_specifiers type_qualifier + """ + p[0] = self._add_declaration_specifier(p[1], p[2], 'qual', append=True) + + def p_declaration_specifiers_2(self, p): + """ declaration_specifiers : declaration_specifiers storage_class_specifier + """ + p[0] = self._add_declaration_specifier(p[1], p[2], 'storage', append=True) + + def p_declaration_specifiers_3(self, p): + """ declaration_specifiers : declaration_specifiers function_specifier + """ + p[0] = self._add_declaration_specifier(p[1], p[2], 'function', append=True) + + def p_declaration_specifiers_4(self, p): + """ declaration_specifiers : declaration_specifiers type_specifier_no_typeid + """ + p[0] = self._add_declaration_specifier(p[1], p[2], 'type', append=True) + + def p_declaration_specifiers_5(self, p): + """ declaration_specifiers : type_specifier + """ + p[0] = self._add_declaration_specifier(None, p[1], 'type') + + def p_declaration_specifiers_6(self, p): + """ declaration_specifiers : declaration_specifiers_no_type type_specifier + """ + p[0] = self._add_declaration_specifier(p[1], p[2], 'type', append=True) + + + def p_storage_class_specifier(self, p): + """ storage_class_specifier : AUTO + | REGISTER + | STATIC + | EXTERN + | TYPEDEF + """ + p[0] = p[1] + + def p_function_specifier(self, p): + """ function_specifier : INLINE + """ + p[0] = p[1] + + def p_type_specifier_no_typeid(self, p): + """ type_specifier_no_typeid : VOID + | _BOOL + | CHAR + | SHORT + | INT + | LONG + | FLOAT + | DOUBLE + | _COMPLEX + | SIGNED + | UNSIGNED + | __INT128 + """ + p[0] = c_ast.IdentifierType([p[1]], coord=self._token_coord(p, 1)) + + def p_type_specifier(self, p): + """ type_specifier : typedef_name + | enum_specifier + | struct_or_union_specifier + | type_specifier_no_typeid + """ + p[0] = p[1] + + def p_type_qualifier(self, p): + """ type_qualifier : CONST + | RESTRICT + | VOLATILE + """ + p[0] = p[1] + + def p_init_declarator_list(self, p): + """ init_declarator_list : init_declarator + | init_declarator_list COMMA init_declarator + """ + p[0] = p[1] + [p[3]] if len(p) == 4 else [p[1]] + + # Returns a {decl= : init=} dictionary + # If there's no initializer, uses None + # + def p_init_declarator(self, p): + """ init_declarator : declarator + | declarator EQUALS initializer + """ + p[0] = dict(decl=p[1], init=(p[3] if len(p) > 2 else None)) + + def p_id_init_declarator_list(self, p): + """ id_init_declarator_list : id_init_declarator + | id_init_declarator_list COMMA init_declarator + """ + p[0] = p[1] + [p[3]] if len(p) == 4 else [p[1]] + + def p_id_init_declarator(self, p): + """ id_init_declarator : id_declarator + | id_declarator EQUALS initializer + """ + p[0] = dict(decl=p[1], init=(p[3] if len(p) > 2 else None)) + + # Require at least one type specifier in a specifier-qualifier-list + # + def p_specifier_qualifier_list_1(self, p): + """ specifier_qualifier_list : specifier_qualifier_list type_specifier_no_typeid + """ + p[0] = self._add_declaration_specifier(p[1], p[2], 'type', append=True) + + def p_specifier_qualifier_list_2(self, p): + """ specifier_qualifier_list : specifier_qualifier_list type_qualifier + """ + p[0] = self._add_declaration_specifier(p[1], p[2], 'qual', append=True) + + def p_specifier_qualifier_list_3(self, p): + """ specifier_qualifier_list : type_specifier + """ + p[0] = self._add_declaration_specifier(None, p[1], 'type') + + def p_specifier_qualifier_list_4(self, p): + """ specifier_qualifier_list : type_qualifier_list type_specifier + """ + spec = dict(qual=p[1], storage=[], type=[], function=[]) + p[0] = self._add_declaration_specifier(spec, p[2], 'type', append=True) + + # TYPEID is allowed here (and in other struct/enum related tag names), because + # struct/enum tags reside in their own namespace and can be named the same as types + # + def p_struct_or_union_specifier_1(self, p): + """ struct_or_union_specifier : struct_or_union ID + | struct_or_union TYPEID + """ + klass = self._select_struct_union_class(p[1]) + # None means no list of members + p[0] = klass( + name=p[2], + decls=None, + coord=self._token_coord(p, 2)) + + def p_struct_or_union_specifier_2(self, p): + """ struct_or_union_specifier : struct_or_union brace_open struct_declaration_list brace_close + | struct_or_union brace_open brace_close + """ + klass = self._select_struct_union_class(p[1]) + if len(p) == 4: + # Empty sequence means an empty list of members + p[0] = klass( + name=None, + decls=[], + coord=self._token_coord(p, 2)) + else: + p[0] = klass( + name=None, + decls=p[3], + coord=self._token_coord(p, 2)) + + + def p_struct_or_union_specifier_3(self, p): + """ struct_or_union_specifier : struct_or_union ID brace_open struct_declaration_list brace_close + | struct_or_union ID brace_open brace_close + | struct_or_union TYPEID brace_open struct_declaration_list brace_close + | struct_or_union TYPEID brace_open brace_close + """ + klass = self._select_struct_union_class(p[1]) + if len(p) == 5: + # Empty sequence means an empty list of members + p[0] = klass( + name=p[2], + decls=[], + coord=self._token_coord(p, 2)) + else: + p[0] = klass( + name=p[2], + decls=p[4], + coord=self._token_coord(p, 2)) + + def p_struct_or_union(self, p): + """ struct_or_union : STRUCT + | UNION + """ + p[0] = p[1] + + # Combine all declarations into a single list + # + def p_struct_declaration_list(self, p): + """ struct_declaration_list : struct_declaration + | struct_declaration_list struct_declaration + """ + if len(p) == 2: + p[0] = p[1] or [] + else: + p[0] = p[1] + (p[2] or []) + + def p_struct_declaration_1(self, p): + """ struct_declaration : specifier_qualifier_list struct_declarator_list_opt SEMI + """ + spec = p[1] + assert 'typedef' not in spec['storage'] + + if p[2] is not None: + decls = self._build_declarations( + spec=spec, + decls=p[2]) + + elif len(spec['type']) == 1: + # Anonymous struct/union, gcc extension, C1x feature. + # Although the standard only allows structs/unions here, I see no + # reason to disallow other types since some compilers have typedefs + # here, and pycparser isn't about rejecting all invalid code. + # + node = spec['type'][0] + if isinstance(node, c_ast.Node): + decl_type = node + else: + decl_type = c_ast.IdentifierType(node) + + decls = self._build_declarations( + spec=spec, + decls=[dict(decl=decl_type)]) + + else: + # Structure/union members can have the same names as typedefs. + # The trouble is that the member's name gets grouped into + # specifier_qualifier_list; _build_declarations compensates. + # + decls = self._build_declarations( + spec=spec, + decls=[dict(decl=None, init=None)]) + + p[0] = decls + + def p_struct_declaration_2(self, p): + """ struct_declaration : SEMI + """ + p[0] = None + + def p_struct_declaration_3(self, p): + """ struct_declaration : pppragma_directive + """ + p[0] = [p[1]] + + def p_struct_declarator_list(self, p): + """ struct_declarator_list : struct_declarator + | struct_declarator_list COMMA struct_declarator + """ + p[0] = p[1] + [p[3]] if len(p) == 4 else [p[1]] + + # struct_declarator passes up a dict with the keys: decl (for + # the underlying declarator) and bitsize (for the bitsize) + # + def p_struct_declarator_1(self, p): + """ struct_declarator : declarator + """ + p[0] = {'decl': p[1], 'bitsize': None} + + def p_struct_declarator_2(self, p): + """ struct_declarator : declarator COLON constant_expression + | COLON constant_expression + """ + if len(p) > 3: + p[0] = {'decl': p[1], 'bitsize': p[3]} + else: + p[0] = {'decl': c_ast.TypeDecl(None, None, None), 'bitsize': p[2]} + + def p_enum_specifier_1(self, p): + """ enum_specifier : ENUM ID + | ENUM TYPEID + """ + p[0] = c_ast.Enum(p[2], None, self._token_coord(p, 1)) + + def p_enum_specifier_2(self, p): + """ enum_specifier : ENUM brace_open enumerator_list brace_close + """ + p[0] = c_ast.Enum(None, p[3], self._token_coord(p, 1)) + + def p_enum_specifier_3(self, p): + """ enum_specifier : ENUM ID brace_open enumerator_list brace_close + | ENUM TYPEID brace_open enumerator_list brace_close + """ + p[0] = c_ast.Enum(p[2], p[4], self._token_coord(p, 1)) + + def p_enumerator_list(self, p): + """ enumerator_list : enumerator + | enumerator_list COMMA + | enumerator_list COMMA enumerator + """ + if len(p) == 2: + p[0] = c_ast.EnumeratorList([p[1]], p[1].coord) + elif len(p) == 3: + p[0] = p[1] + else: + p[1].enumerators.append(p[3]) + p[0] = p[1] + + def p_enumerator(self, p): + """ enumerator : ID + | ID EQUALS constant_expression + """ + if len(p) == 2: + enumerator = c_ast.Enumerator( + p[1], None, + self._token_coord(p, 1)) + else: + enumerator = c_ast.Enumerator( + p[1], p[3], + self._token_coord(p, 1)) + self._add_identifier(enumerator.name, enumerator.coord) + + p[0] = enumerator + + def p_declarator(self, p): + """ declarator : id_declarator + | typeid_declarator + """ + p[0] = p[1] + + @parameterized(('id', 'ID'), ('typeid', 'TYPEID'), ('typeid_noparen', 'TYPEID')) + def p_xxx_declarator_1(self, p): + """ xxx_declarator : direct_xxx_declarator + """ + p[0] = p[1] + + @parameterized(('id', 'ID'), ('typeid', 'TYPEID'), ('typeid_noparen', 'TYPEID')) + def p_xxx_declarator_2(self, p): + """ xxx_declarator : pointer direct_xxx_declarator + """ + p[0] = self._type_modify_decl(p[2], p[1]) + + @parameterized(('id', 'ID'), ('typeid', 'TYPEID'), ('typeid_noparen', 'TYPEID')) + def p_direct_xxx_declarator_1(self, p): + """ direct_xxx_declarator : yyy + """ + p[0] = c_ast.TypeDecl( + declname=p[1], + type=None, + quals=None, + coord=self._token_coord(p, 1)) + + @parameterized(('id', 'ID'), ('typeid', 'TYPEID')) + def p_direct_xxx_declarator_2(self, p): + """ direct_xxx_declarator : LPAREN xxx_declarator RPAREN + """ + p[0] = p[2] + + @parameterized(('id', 'ID'), ('typeid', 'TYPEID'), ('typeid_noparen', 'TYPEID')) + def p_direct_xxx_declarator_3(self, p): + """ direct_xxx_declarator : direct_xxx_declarator LBRACKET type_qualifier_list_opt assignment_expression_opt RBRACKET + """ + quals = (p[3] if len(p) > 5 else []) or [] + # Accept dimension qualifiers + # Per C99 6.7.5.3 p7 + arr = c_ast.ArrayDecl( + type=None, + dim=p[4] if len(p) > 5 else p[3], + dim_quals=quals, + coord=p[1].coord) + + p[0] = self._type_modify_decl(decl=p[1], modifier=arr) + + @parameterized(('id', 'ID'), ('typeid', 'TYPEID'), ('typeid_noparen', 'TYPEID')) + def p_direct_xxx_declarator_4(self, p): + """ direct_xxx_declarator : direct_xxx_declarator LBRACKET STATIC type_qualifier_list_opt assignment_expression RBRACKET + | direct_xxx_declarator LBRACKET type_qualifier_list STATIC assignment_expression RBRACKET + """ + # Using slice notation for PLY objects doesn't work in Python 3 for the + # version of PLY embedded with pycparser; see PLY Google Code issue 30. + # Work around that here by listing the two elements separately. + listed_quals = [item if isinstance(item, list) else [item] + for item in [p[3],p[4]]] + dim_quals = [qual for sublist in listed_quals for qual in sublist + if qual is not None] + arr = c_ast.ArrayDecl( + type=None, + dim=p[5], + dim_quals=dim_quals, + coord=p[1].coord) + + p[0] = self._type_modify_decl(decl=p[1], modifier=arr) + + # Special for VLAs + # + @parameterized(('id', 'ID'), ('typeid', 'TYPEID'), ('typeid_noparen', 'TYPEID')) + def p_direct_xxx_declarator_5(self, p): + """ direct_xxx_declarator : direct_xxx_declarator LBRACKET type_qualifier_list_opt TIMES RBRACKET + """ + arr = c_ast.ArrayDecl( + type=None, + dim=c_ast.ID(p[4], self._token_coord(p, 4)), + dim_quals=p[3] if p[3] != None else [], + coord=p[1].coord) + + p[0] = self._type_modify_decl(decl=p[1], modifier=arr) + + @parameterized(('id', 'ID'), ('typeid', 'TYPEID'), ('typeid_noparen', 'TYPEID')) + def p_direct_xxx_declarator_6(self, p): + """ direct_xxx_declarator : direct_xxx_declarator LPAREN parameter_type_list RPAREN + | direct_xxx_declarator LPAREN identifier_list_opt RPAREN + """ + func = c_ast.FuncDecl( + args=p[3], + type=None, + coord=p[1].coord) + + # To see why _get_yacc_lookahead_token is needed, consider: + # typedef char TT; + # void foo(int TT) { TT = 10; } + # Outside the function, TT is a typedef, but inside (starting and + # ending with the braces) it's a parameter. The trouble begins with + # yacc's lookahead token. We don't know if we're declaring or + # defining a function until we see LBRACE, but if we wait for yacc to + # trigger a rule on that token, then TT will have already been read + # and incorrectly interpreted as TYPEID. We need to add the + # parameters to the scope the moment the lexer sees LBRACE. + # + if self._get_yacc_lookahead_token().type == "LBRACE": + if func.args is not None: + for param in func.args.params: + if isinstance(param, c_ast.EllipsisParam): break + self._add_identifier(param.name, param.coord) + + p[0] = self._type_modify_decl(decl=p[1], modifier=func) + + def p_pointer(self, p): + """ pointer : TIMES type_qualifier_list_opt + | TIMES type_qualifier_list_opt pointer + """ + coord = self._token_coord(p, 1) + # Pointer decls nest from inside out. This is important when different + # levels have different qualifiers. For example: + # + # char * const * p; + # + # Means "pointer to const pointer to char" + # + # While: + # + # char ** const p; + # + # Means "const pointer to pointer to char" + # + # So when we construct PtrDecl nestings, the leftmost pointer goes in + # as the most nested type. + nested_type = c_ast.PtrDecl(quals=p[2] or [], type=None, coord=coord) + if len(p) > 3: + tail_type = p[3] + while tail_type.type is not None: + tail_type = tail_type.type + tail_type.type = nested_type + p[0] = p[3] + else: + p[0] = nested_type + + def p_type_qualifier_list(self, p): + """ type_qualifier_list : type_qualifier + | type_qualifier_list type_qualifier + """ + p[0] = [p[1]] if len(p) == 2 else p[1] + [p[2]] + + def p_parameter_type_list(self, p): + """ parameter_type_list : parameter_list + | parameter_list COMMA ELLIPSIS + """ + if len(p) > 2: + p[1].params.append(c_ast.EllipsisParam(self._token_coord(p, 3))) + + p[0] = p[1] + + def p_parameter_list(self, p): + """ parameter_list : parameter_declaration + | parameter_list COMMA parameter_declaration + """ + if len(p) == 2: # single parameter + p[0] = c_ast.ParamList([p[1]], p[1].coord) + else: + p[1].params.append(p[3]) + p[0] = p[1] + + # From ISO/IEC 9899:TC2, 6.7.5.3.11: + # "If, in a parameter declaration, an identifier can be treated either + # as a typedef name or as a parameter name, it shall be taken as a + # typedef name." + # + # Inside a parameter declaration, once we've reduced declaration specifiers, + # if we shift in an LPAREN and see a TYPEID, it could be either an abstract + # declarator or a declarator nested inside parens. This rule tells us to + # always treat it as an abstract declarator. Therefore, we only accept + # `id_declarator`s and `typeid_noparen_declarator`s. + def p_parameter_declaration_1(self, p): + """ parameter_declaration : declaration_specifiers id_declarator + | declaration_specifiers typeid_noparen_declarator + """ + spec = p[1] + if not spec['type']: + spec['type'] = [c_ast.IdentifierType(['int'], + coord=self._token_coord(p, 1))] + p[0] = self._build_declarations( + spec=spec, + decls=[dict(decl=p[2])])[0] + + def p_parameter_declaration_2(self, p): + """ parameter_declaration : declaration_specifiers abstract_declarator_opt + """ + spec = p[1] + if not spec['type']: + spec['type'] = [c_ast.IdentifierType(['int'], + coord=self._token_coord(p, 1))] + + # Parameters can have the same names as typedefs. The trouble is that + # the parameter's name gets grouped into declaration_specifiers, making + # it look like an old-style declaration; compensate. + # + if len(spec['type']) > 1 and len(spec['type'][-1].names) == 1 and \ + self._is_type_in_scope(spec['type'][-1].names[0]): + decl = self._build_declarations( + spec=spec, + decls=[dict(decl=p[2], init=None)])[0] + + # This truly is an old-style parameter declaration + # + else: + decl = c_ast.Typename( + name='', + quals=spec['qual'], + type=p[2] or c_ast.TypeDecl(None, None, None), + coord=self._token_coord(p, 2)) + typename = spec['type'] + decl = self._fix_decl_name_type(decl, typename) + + p[0] = decl + + def p_identifier_list(self, p): + """ identifier_list : identifier + | identifier_list COMMA identifier + """ + if len(p) == 2: # single parameter + p[0] = c_ast.ParamList([p[1]], p[1].coord) + else: + p[1].params.append(p[3]) + p[0] = p[1] + + def p_initializer_1(self, p): + """ initializer : assignment_expression + """ + p[0] = p[1] + + def p_initializer_2(self, p): + """ initializer : brace_open initializer_list_opt brace_close + | brace_open initializer_list COMMA brace_close + """ + if p[2] is None: + p[0] = c_ast.InitList([], self._token_coord(p, 1)) + else: + p[0] = p[2] + + def p_initializer_list(self, p): + """ initializer_list : designation_opt initializer + | initializer_list COMMA designation_opt initializer + """ + if len(p) == 3: # single initializer + init = p[2] if p[1] is None else c_ast.NamedInitializer(p[1], p[2]) + p[0] = c_ast.InitList([init], p[2].coord) + else: + init = p[4] if p[3] is None else c_ast.NamedInitializer(p[3], p[4]) + p[1].exprs.append(init) + p[0] = p[1] + + def p_designation(self, p): + """ designation : designator_list EQUALS + """ + p[0] = p[1] + + # Designators are represented as a list of nodes, in the order in which + # they're written in the code. + # + def p_designator_list(self, p): + """ designator_list : designator + | designator_list designator + """ + p[0] = [p[1]] if len(p) == 2 else p[1] + [p[2]] + + def p_designator(self, p): + """ designator : LBRACKET constant_expression RBRACKET + | PERIOD identifier + """ + p[0] = p[2] + + def p_type_name(self, p): + """ type_name : specifier_qualifier_list abstract_declarator_opt + """ + typename = c_ast.Typename( + name='', + quals=p[1]['qual'], + type=p[2] or c_ast.TypeDecl(None, None, None), + coord=self._token_coord(p, 2)) + + p[0] = self._fix_decl_name_type(typename, p[1]['type']) + + def p_abstract_declarator_1(self, p): + """ abstract_declarator : pointer + """ + dummytype = c_ast.TypeDecl(None, None, None) + p[0] = self._type_modify_decl( + decl=dummytype, + modifier=p[1]) + + def p_abstract_declarator_2(self, p): + """ abstract_declarator : pointer direct_abstract_declarator + """ + p[0] = self._type_modify_decl(p[2], p[1]) + + def p_abstract_declarator_3(self, p): + """ abstract_declarator : direct_abstract_declarator + """ + p[0] = p[1] + + # Creating and using direct_abstract_declarator_opt here + # instead of listing both direct_abstract_declarator and the + # lack of it in the beginning of _1 and _2 caused two + # shift/reduce errors. + # + def p_direct_abstract_declarator_1(self, p): + """ direct_abstract_declarator : LPAREN abstract_declarator RPAREN """ + p[0] = p[2] + + def p_direct_abstract_declarator_2(self, p): + """ direct_abstract_declarator : direct_abstract_declarator LBRACKET assignment_expression_opt RBRACKET + """ + arr = c_ast.ArrayDecl( + type=None, + dim=p[3], + dim_quals=[], + coord=p[1].coord) + + p[0] = self._type_modify_decl(decl=p[1], modifier=arr) + + def p_direct_abstract_declarator_3(self, p): + """ direct_abstract_declarator : LBRACKET assignment_expression_opt RBRACKET + """ + p[0] = c_ast.ArrayDecl( + type=c_ast.TypeDecl(None, None, None), + dim=p[2], + dim_quals=[], + coord=self._token_coord(p, 1)) + + def p_direct_abstract_declarator_4(self, p): + """ direct_abstract_declarator : direct_abstract_declarator LBRACKET TIMES RBRACKET + """ + arr = c_ast.ArrayDecl( + type=None, + dim=c_ast.ID(p[3], self._token_coord(p, 3)), + dim_quals=[], + coord=p[1].coord) + + p[0] = self._type_modify_decl(decl=p[1], modifier=arr) + + def p_direct_abstract_declarator_5(self, p): + """ direct_abstract_declarator : LBRACKET TIMES RBRACKET + """ + p[0] = c_ast.ArrayDecl( + type=c_ast.TypeDecl(None, None, None), + dim=c_ast.ID(p[3], self._token_coord(p, 3)), + dim_quals=[], + coord=self._token_coord(p, 1)) + + def p_direct_abstract_declarator_6(self, p): + """ direct_abstract_declarator : direct_abstract_declarator LPAREN parameter_type_list_opt RPAREN + """ + func = c_ast.FuncDecl( + args=p[3], + type=None, + coord=p[1].coord) + + p[0] = self._type_modify_decl(decl=p[1], modifier=func) + + def p_direct_abstract_declarator_7(self, p): + """ direct_abstract_declarator : LPAREN parameter_type_list_opt RPAREN + """ + p[0] = c_ast.FuncDecl( + args=p[2], + type=c_ast.TypeDecl(None, None, None), + coord=self._token_coord(p, 1)) + + # declaration is a list, statement isn't. To make it consistent, block_item + # will always be a list + # + def p_block_item(self, p): + """ block_item : declaration + | statement + """ + p[0] = p[1] if isinstance(p[1], list) else [p[1]] + + # Since we made block_item a list, this just combines lists + # + def p_block_item_list(self, p): + """ block_item_list : block_item + | block_item_list block_item + """ + # Empty block items (plain ';') produce [None], so ignore them + p[0] = p[1] if (len(p) == 2 or p[2] == [None]) else p[1] + p[2] + + def p_compound_statement_1(self, p): + """ compound_statement : brace_open block_item_list_opt brace_close """ + p[0] = c_ast.Compound( + block_items=p[2], + coord=self._token_coord(p, 1)) + + def p_labeled_statement_1(self, p): + """ labeled_statement : ID COLON pragmacomp_or_statement """ + p[0] = c_ast.Label(p[1], p[3], self._token_coord(p, 1)) + + def p_labeled_statement_2(self, p): + """ labeled_statement : CASE constant_expression COLON pragmacomp_or_statement """ + p[0] = c_ast.Case(p[2], [p[4]], self._token_coord(p, 1)) + + def p_labeled_statement_3(self, p): + """ labeled_statement : DEFAULT COLON pragmacomp_or_statement """ + p[0] = c_ast.Default([p[3]], self._token_coord(p, 1)) + + def p_selection_statement_1(self, p): + """ selection_statement : IF LPAREN expression RPAREN pragmacomp_or_statement """ + p[0] = c_ast.If(p[3], p[5], None, self._token_coord(p, 1)) + + def p_selection_statement_2(self, p): + """ selection_statement : IF LPAREN expression RPAREN statement ELSE pragmacomp_or_statement """ + p[0] = c_ast.If(p[3], p[5], p[7], self._token_coord(p, 1)) + + def p_selection_statement_3(self, p): + """ selection_statement : SWITCH LPAREN expression RPAREN pragmacomp_or_statement """ + p[0] = fix_switch_cases( + c_ast.Switch(p[3], p[5], self._token_coord(p, 1))) + + def p_iteration_statement_1(self, p): + """ iteration_statement : WHILE LPAREN expression RPAREN pragmacomp_or_statement """ + p[0] = c_ast.While(p[3], p[5], self._token_coord(p, 1)) + + def p_iteration_statement_2(self, p): + """ iteration_statement : DO pragmacomp_or_statement WHILE LPAREN expression RPAREN SEMI """ + p[0] = c_ast.DoWhile(p[5], p[2], self._token_coord(p, 1)) + + def p_iteration_statement_3(self, p): + """ iteration_statement : FOR LPAREN expression_opt SEMI expression_opt SEMI expression_opt RPAREN pragmacomp_or_statement """ + p[0] = c_ast.For(p[3], p[5], p[7], p[9], self._token_coord(p, 1)) + + def p_iteration_statement_4(self, p): + """ iteration_statement : FOR LPAREN declaration expression_opt SEMI expression_opt RPAREN pragmacomp_or_statement """ + p[0] = c_ast.For(c_ast.DeclList(p[3], self._token_coord(p, 1)), + p[4], p[6], p[8], self._token_coord(p, 1)) + + def p_jump_statement_1(self, p): + """ jump_statement : GOTO ID SEMI """ + p[0] = c_ast.Goto(p[2], self._token_coord(p, 1)) + + def p_jump_statement_2(self, p): + """ jump_statement : BREAK SEMI """ + p[0] = c_ast.Break(self._token_coord(p, 1)) + + def p_jump_statement_3(self, p): + """ jump_statement : CONTINUE SEMI """ + p[0] = c_ast.Continue(self._token_coord(p, 1)) + + def p_jump_statement_4(self, p): + """ jump_statement : RETURN expression SEMI + | RETURN SEMI + """ + p[0] = c_ast.Return(p[2] if len(p) == 4 else None, self._token_coord(p, 1)) + + def p_expression_statement(self, p): + """ expression_statement : expression_opt SEMI """ + if p[1] is None: + p[0] = c_ast.EmptyStatement(self._token_coord(p, 2)) + else: + p[0] = p[1] + + def p_expression(self, p): + """ expression : assignment_expression + | expression COMMA assignment_expression + """ + if len(p) == 2: + p[0] = p[1] + else: + if not isinstance(p[1], c_ast.ExprList): + p[1] = c_ast.ExprList([p[1]], p[1].coord) + + p[1].exprs.append(p[3]) + p[0] = p[1] + + def p_typedef_name(self, p): + """ typedef_name : TYPEID """ + p[0] = c_ast.IdentifierType([p[1]], coord=self._token_coord(p, 1)) + + def p_assignment_expression(self, p): + """ assignment_expression : conditional_expression + | unary_expression assignment_operator assignment_expression + """ + if len(p) == 2: + p[0] = p[1] + else: + p[0] = c_ast.Assignment(p[2], p[1], p[3], p[1].coord) + + # K&R2 defines these as many separate rules, to encode + # precedence and associativity. Why work hard ? I'll just use + # the built in precedence/associativity specification feature + # of PLY. (see precedence declaration above) + # + def p_assignment_operator(self, p): + """ assignment_operator : EQUALS + | XOREQUAL + | TIMESEQUAL + | DIVEQUAL + | MODEQUAL + | PLUSEQUAL + | MINUSEQUAL + | LSHIFTEQUAL + | RSHIFTEQUAL + | ANDEQUAL + | OREQUAL + """ + p[0] = p[1] + + def p_constant_expression(self, p): + """ constant_expression : conditional_expression """ + p[0] = p[1] + + def p_conditional_expression(self, p): + """ conditional_expression : binary_expression + | binary_expression CONDOP expression COLON conditional_expression + """ + if len(p) == 2: + p[0] = p[1] + else: + p[0] = c_ast.TernaryOp(p[1], p[3], p[5], p[1].coord) + + def p_binary_expression(self, p): + """ binary_expression : cast_expression + | binary_expression TIMES binary_expression + | binary_expression DIVIDE binary_expression + | binary_expression MOD binary_expression + | binary_expression PLUS binary_expression + | binary_expression MINUS binary_expression + | binary_expression RSHIFT binary_expression + | binary_expression LSHIFT binary_expression + | binary_expression LT binary_expression + | binary_expression LE binary_expression + | binary_expression GE binary_expression + | binary_expression GT binary_expression + | binary_expression EQ binary_expression + | binary_expression NE binary_expression + | binary_expression AND binary_expression + | binary_expression OR binary_expression + | binary_expression XOR binary_expression + | binary_expression LAND binary_expression + | binary_expression LOR binary_expression + """ + if len(p) == 2: + p[0] = p[1] + else: + p[0] = c_ast.BinaryOp(p[2], p[1], p[3], p[1].coord) + + def p_cast_expression_1(self, p): + """ cast_expression : unary_expression """ + p[0] = p[1] + + def p_cast_expression_2(self, p): + """ cast_expression : LPAREN type_name RPAREN cast_expression """ + p[0] = c_ast.Cast(p[2], p[4], self._token_coord(p, 1)) + + def p_unary_expression_1(self, p): + """ unary_expression : postfix_expression """ + p[0] = p[1] + + def p_unary_expression_2(self, p): + """ unary_expression : PLUSPLUS unary_expression + | MINUSMINUS unary_expression + | unary_operator cast_expression + """ + p[0] = c_ast.UnaryOp(p[1], p[2], p[2].coord) + + def p_unary_expression_3(self, p): + """ unary_expression : SIZEOF unary_expression + | SIZEOF LPAREN type_name RPAREN + """ + p[0] = c_ast.UnaryOp( + p[1], + p[2] if len(p) == 3 else p[3], + self._token_coord(p, 1)) + + def p_unary_operator(self, p): + """ unary_operator : AND + | TIMES + | PLUS + | MINUS + | NOT + | LNOT + """ + p[0] = p[1] + + def p_postfix_expression_1(self, p): + """ postfix_expression : primary_expression """ + p[0] = p[1] + + def p_postfix_expression_2(self, p): + """ postfix_expression : postfix_expression LBRACKET expression RBRACKET """ + p[0] = c_ast.ArrayRef(p[1], p[3], p[1].coord) + + def p_postfix_expression_3(self, p): + """ postfix_expression : postfix_expression LPAREN argument_expression_list RPAREN + | postfix_expression LPAREN RPAREN + """ + p[0] = c_ast.FuncCall(p[1], p[3] if len(p) == 5 else None, p[1].coord) + + def p_postfix_expression_4(self, p): + """ postfix_expression : postfix_expression PERIOD ID + | postfix_expression PERIOD TYPEID + | postfix_expression ARROW ID + | postfix_expression ARROW TYPEID + """ + field = c_ast.ID(p[3], self._token_coord(p, 3)) + p[0] = c_ast.StructRef(p[1], p[2], field, p[1].coord) + + def p_postfix_expression_5(self, p): + """ postfix_expression : postfix_expression PLUSPLUS + | postfix_expression MINUSMINUS + """ + p[0] = c_ast.UnaryOp('p' + p[2], p[1], p[1].coord) + + def p_postfix_expression_6(self, p): + """ postfix_expression : LPAREN type_name RPAREN brace_open initializer_list brace_close + | LPAREN type_name RPAREN brace_open initializer_list COMMA brace_close + """ + p[0] = c_ast.CompoundLiteral(p[2], p[5]) + + def p_primary_expression_1(self, p): + """ primary_expression : identifier """ + p[0] = p[1] + + def p_primary_expression_2(self, p): + """ primary_expression : constant """ + p[0] = p[1] + + def p_primary_expression_3(self, p): + """ primary_expression : unified_string_literal + | unified_wstring_literal + """ + p[0] = p[1] + + def p_primary_expression_4(self, p): + """ primary_expression : LPAREN expression RPAREN """ + p[0] = p[2] + + def p_primary_expression_5(self, p): + """ primary_expression : OFFSETOF LPAREN type_name COMMA offsetof_member_designator RPAREN + """ + coord = self._token_coord(p, 1) + p[0] = c_ast.FuncCall(c_ast.ID(p[1], coord), + c_ast.ExprList([p[3], p[5]], coord), + coord) + + def p_offsetof_member_designator(self, p): + """ offsetof_member_designator : identifier + | offsetof_member_designator PERIOD identifier + | offsetof_member_designator LBRACKET expression RBRACKET + """ + if len(p) == 2: + p[0] = p[1] + elif len(p) == 4: + field = c_ast.ID(p[3], self._token_coord(p, 3)) + p[0] = c_ast.StructRef(p[1], p[2], field, p[1].coord) + elif len(p) == 5: + p[0] = c_ast.ArrayRef(p[1], p[3], p[1].coord) + else: + raise NotImplementedError("Unexpected parsing state. len(p): %u" % len(p)) + + def p_argument_expression_list(self, p): + """ argument_expression_list : assignment_expression + | argument_expression_list COMMA assignment_expression + """ + if len(p) == 2: # single expr + p[0] = c_ast.ExprList([p[1]], p[1].coord) + else: + p[1].exprs.append(p[3]) + p[0] = p[1] + + def p_identifier(self, p): + """ identifier : ID """ + p[0] = c_ast.ID(p[1], self._token_coord(p, 1)) + + def p_constant_1(self, p): + """ constant : INT_CONST_DEC + | INT_CONST_OCT + | INT_CONST_HEX + | INT_CONST_BIN + """ + p[0] = c_ast.Constant( + 'int', p[1], self._token_coord(p, 1)) + + def p_constant_2(self, p): + """ constant : FLOAT_CONST + | HEX_FLOAT_CONST + """ + if 'x' in p[1].lower(): + t = 'float' + else: + if p[1][-1] in ('f', 'F'): + t = 'float' + elif p[1][-1] in ('l', 'L'): + t = 'long double' + else: + t = 'double' + + p[0] = c_ast.Constant( + t, p[1], self._token_coord(p, 1)) + + def p_constant_3(self, p): + """ constant : CHAR_CONST + | WCHAR_CONST + """ + p[0] = c_ast.Constant( + 'char', p[1], self._token_coord(p, 1)) + + # The "unified" string and wstring literal rules are for supporting + # concatenation of adjacent string literals. + # I.e. "hello " "world" is seen by the C compiler as a single string literal + # with the value "hello world" + # + def p_unified_string_literal(self, p): + """ unified_string_literal : STRING_LITERAL + | unified_string_literal STRING_LITERAL + """ + if len(p) == 2: # single literal + p[0] = c_ast.Constant( + 'string', p[1], self._token_coord(p, 1)) + else: + p[1].value = p[1].value[:-1] + p[2][1:] + p[0] = p[1] + + def p_unified_wstring_literal(self, p): + """ unified_wstring_literal : WSTRING_LITERAL + | unified_wstring_literal WSTRING_LITERAL + """ + if len(p) == 2: # single literal + p[0] = c_ast.Constant( + 'string', p[1], self._token_coord(p, 1)) + else: + p[1].value = p[1].value.rstrip()[:-1] + p[2][2:] + p[0] = p[1] + + def p_brace_open(self, p): + """ brace_open : LBRACE + """ + p[0] = p[1] + p.set_lineno(0, p.lineno(1)) + + def p_brace_close(self, p): + """ brace_close : RBRACE + """ + p[0] = p[1] + p.set_lineno(0, p.lineno(1)) + + def p_empty(self, p): + 'empty : ' + p[0] = None + + def p_error(self, p): + # If error recovery is added here in the future, make sure + # _get_yacc_lookahead_token still works! + # + if p: + self._parse_error( + 'before: %s' % p.value, + self._coord(lineno=p.lineno, + column=self.clex.find_tok_column(p))) + else: + self._parse_error('At end of input', self.clex.filename) diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pycparser/lextab.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pycparser/lextab.py new file mode 100644 index 00000000..eb3ae07d --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pycparser/lextab.py @@ -0,0 +1,10 @@ +# lextab.py. This file automatically created by PLY (version 3.10). Don't edit! +_tabversion = '3.10' +_lextokens = set(('VOID', 'LBRACKET', 'WCHAR_CONST', 'FLOAT_CONST', 'MINUS', 'RPAREN', 'LONG', 'PLUS', 'ELLIPSIS', 'GT', 'GOTO', 'ENUM', 'PERIOD', 'GE', 'INT_CONST_DEC', 'ARROW', '__INT128', 'HEX_FLOAT_CONST', 'DOUBLE', 'MINUSEQUAL', 'INT_CONST_OCT', 'TIMESEQUAL', 'OR', 'SHORT', 'RETURN', 'RSHIFTEQUAL', 'RESTRICT', 'STATIC', 'SIZEOF', 'UNSIGNED', 'UNION', 'COLON', 'WSTRING_LITERAL', 'DIVIDE', 'FOR', 'PLUSPLUS', 'EQUALS', 'ELSE', 'INLINE', 'EQ', 'AND', 'TYPEID', 'LBRACE', 'PPHASH', 'INT', 'SIGNED', 'CONTINUE', 'NOT', 'OREQUAL', 'MOD', 'RSHIFT', 'DEFAULT', 'CHAR', 'WHILE', 'DIVEQUAL', 'EXTERN', 'CASE', 'LAND', 'REGISTER', 'MODEQUAL', 'NE', 'SWITCH', 'INT_CONST_HEX', '_COMPLEX', 'PPPRAGMASTR', 'PLUSEQUAL', 'STRUCT', 'CONDOP', 'BREAK', 'VOLATILE', 'PPPRAGMA', 'ANDEQUAL', 'INT_CONST_BIN', 'DO', 'LNOT', 'CONST', 'LOR', 'CHAR_CONST', 'LSHIFT', 'RBRACE', '_BOOL', 'LE', 'SEMI', 'LT', 'COMMA', 'OFFSETOF', 'TYPEDEF', 'XOR', 'AUTO', 'TIMES', 'LPAREN', 'MINUSMINUS', 'ID', 'IF', 'STRING_LITERAL', 'FLOAT', 'XOREQUAL', 'LSHIFTEQUAL', 'RBRACKET')) +_lexreflags = 64 +_lexliterals = '' +_lexstateinfo = {'ppline': 'exclusive', 'pppragma': 'exclusive', 'INITIAL': 'inclusive'} +_lexstatere = {'ppline': [('(?P"([^"\\\\\\n]|(\\\\(([a-zA-Z._~!=&\\^\\-\\\\?\'"])|(\\d+)|(x[0-9a-fA-F]+))))*")|(?P(0(([uU]ll)|([uU]LL)|(ll[uU]?)|(LL[uU]?)|([uU][lL])|([lL][uU]?)|[uU])?)|([1-9][0-9]*(([uU]ll)|([uU]LL)|(ll[uU]?)|(LL[uU]?)|([uU][lL])|([lL][uU]?)|[uU])?))|(?P\\n)|(?Pline)', [None, ('t_ppline_FILENAME', 'FILENAME'), None, None, None, None, None, None, ('t_ppline_LINE_NUMBER', 'LINE_NUMBER'), None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, ('t_ppline_NEWLINE', 'NEWLINE'), ('t_ppline_PPLINE', 'PPLINE')])], 'pppragma': [('(?P\\n)|(?Ppragma)|(?P.+)', [None, ('t_pppragma_NEWLINE', 'NEWLINE'), ('t_pppragma_PPPRAGMA', 'PPPRAGMA'), ('t_pppragma_STR', 'STR')])], 'INITIAL': [('(?P[ \\t]*\\#)|(?P\\n+)|(?P\\{)|(?P\\})|(?P((((([0-9]*\\.[0-9]+)|([0-9]+\\.))([eE][-+]?[0-9]+)?)|([0-9]+([eE][-+]?[0-9]+)))[FfLl]?))|(?P(0[xX]([0-9a-fA-F]+|((([0-9a-fA-F]+)?\\.[0-9a-fA-F]+)|([0-9a-fA-F]+\\.)))([pP][+-]?[0-9]+)[FfLl]?))|(?P0[xX][0-9a-fA-F]+(([uU]ll)|([uU]LL)|(ll[uU]?)|(LL[uU]?)|([uU][lL])|([lL][uU]?)|[uU])?)', [None, ('t_PPHASH', 'PPHASH'), ('t_NEWLINE', 'NEWLINE'), ('t_LBRACE', 'LBRACE'), ('t_RBRACE', 'RBRACE'), ('t_FLOAT_CONST', 'FLOAT_CONST'), None, None, None, None, None, None, None, None, None, ('t_HEX_FLOAT_CONST', 'HEX_FLOAT_CONST'), None, None, None, None, None, None, None, ('t_INT_CONST_HEX', 'INT_CONST_HEX')]), ('(?P0[bB][01]+(([uU]ll)|([uU]LL)|(ll[uU]?)|(LL[uU]?)|([uU][lL])|([lL][uU]?)|[uU])?)|(?P0[0-7]*[89])|(?P0[0-7]*(([uU]ll)|([uU]LL)|(ll[uU]?)|(LL[uU]?)|([uU][lL])|([lL][uU]?)|[uU])?)|(?P(0(([uU]ll)|([uU]LL)|(ll[uU]?)|(LL[uU]?)|([uU][lL])|([lL][uU]?)|[uU])?)|([1-9][0-9]*(([uU]ll)|([uU]LL)|(ll[uU]?)|(LL[uU]?)|([uU][lL])|([lL][uU]?)|[uU])?))|(?P\'([^\'\\\\\\n]|(\\\\(([a-zA-Z._~!=&\\^\\-\\\\?\'"])|(\\d+)|(x[0-9a-fA-F]+))))\')|(?PL\'([^\'\\\\\\n]|(\\\\(([a-zA-Z._~!=&\\^\\-\\\\?\'"])|(\\d+)|(x[0-9a-fA-F]+))))\')|(?P(\'([^\'\\\\\\n]|(\\\\(([a-zA-Z._~!=&\\^\\-\\\\?\'"])|(\\d+)|(x[0-9a-fA-F]+))))*\\n)|(\'([^\'\\\\\\n]|(\\\\(([a-zA-Z._~!=&\\^\\-\\\\?\'"])|(\\d+)|(x[0-9a-fA-F]+))))*$))|(?P(\'([^\'\\\\\\n]|(\\\\(([a-zA-Z._~!=&\\^\\-\\\\?\'"])|(\\d+)|(x[0-9a-fA-F]+))))[^\'\n]+\')|(\'\')|(\'([\\\\][^a-zA-Z._~^!=&\\^\\-\\\\?\'"x0-7])[^\'\\n]*\'))', [None, ('t_INT_CONST_BIN', 'INT_CONST_BIN'), None, None, None, None, None, None, None, ('t_BAD_CONST_OCT', 'BAD_CONST_OCT'), ('t_INT_CONST_OCT', 'INT_CONST_OCT'), None, None, None, None, None, None, None, ('t_INT_CONST_DEC', 'INT_CONST_DEC'), None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, ('t_CHAR_CONST', 'CHAR_CONST'), None, None, None, None, None, None, ('t_WCHAR_CONST', 'WCHAR_CONST'), None, None, None, None, None, None, ('t_UNMATCHED_QUOTE', 'UNMATCHED_QUOTE'), None, None, None, None, None, None, None, None, None, None, None, None, None, None, ('t_BAD_CHAR_CONST', 'BAD_CHAR_CONST')]), ('(?PL"([^"\\\\\\n]|(\\\\(([a-zA-Z._~!=&\\^\\-\\\\?\'"])|(\\d+)|(x[0-9a-fA-F]+))))*")|(?P"([^"\\\\\\n]|(\\\\(([a-zA-Z._~!=&\\^\\-\\\\?\'"])|(\\d+)|(x[0-9a-fA-F]+))))*?([\\\\][^a-zA-Z._~^!=&\\^\\-\\\\?\'"x0-7])([^"\\\\\\n]|(\\\\(([a-zA-Z._~!=&\\^\\-\\\\?\'"])|(\\d+)|(x[0-9a-fA-F]+))))*")|(?P[a-zA-Z_$][0-9a-zA-Z_$]*)|(?P"([^"\\\\\\n]|(\\\\(([a-zA-Z._~!=&\\^\\-\\\\?\'"])|(\\d+)|(x[0-9a-fA-F]+))))*")|(?P\\.\\.\\.)|(?P\\+\\+)|(?P\\|\\|)|(?P\\^=)|(?P\\|=)|(?P<<=)|(?P>>=)|(?P\\+=)|(?P\\*=)|(?P\\+)|(?P%=)|(?P/=)', [None, ('t_WSTRING_LITERAL', 'WSTRING_LITERAL'), None, None, None, None, None, None, ('t_BAD_STRING_LITERAL', 'BAD_STRING_LITERAL'), None, None, None, None, None, None, None, None, None, None, None, None, None, ('t_ID', 'ID'), (None, 'STRING_LITERAL'), None, None, None, None, None, None, (None, 'ELLIPSIS'), (None, 'PLUSPLUS'), (None, 'LOR'), (None, 'XOREQUAL'), (None, 'OREQUAL'), (None, 'LSHIFTEQUAL'), (None, 'RSHIFTEQUAL'), (None, 'PLUSEQUAL'), (None, 'TIMESEQUAL'), (None, 'PLUS'), (None, 'MODEQUAL'), (None, 'DIVEQUAL')]), ('(?P\\])|(?P\\?)|(?P\\^)|(?P<<)|(?P<=)|(?P\\()|(?P->)|(?P==)|(?P!=)|(?P--)|(?P\\|)|(?P\\*)|(?P\\[)|(?P>=)|(?P\\))|(?P&&)|(?P>>)|(?P-=)|(?P\\.)|(?P&=)|(?P=)|(?P<)|(?P,)|(?P/)|(?P&)|(?P%)|(?P;)|(?P-)|(?P>)|(?P:)|(?P~)|(?P!)', [None, (None, 'RBRACKET'), (None, 'CONDOP'), (None, 'XOR'), (None, 'LSHIFT'), (None, 'LE'), (None, 'LPAREN'), (None, 'ARROW'), (None, 'EQ'), (None, 'NE'), (None, 'MINUSMINUS'), (None, 'OR'), (None, 'TIMES'), (None, 'LBRACKET'), (None, 'GE'), (None, 'RPAREN'), (None, 'LAND'), (None, 'RSHIFT'), (None, 'MINUSEQUAL'), (None, 'PERIOD'), (None, 'ANDEQUAL'), (None, 'EQUALS'), (None, 'LT'), (None, 'COMMA'), (None, 'DIVIDE'), (None, 'AND'), (None, 'MOD'), (None, 'SEMI'), (None, 'MINUS'), (None, 'GT'), (None, 'COLON'), (None, 'NOT'), (None, 'LNOT')])]} +_lexstateignore = {'ppline': ' \t', 'pppragma': ' \t', 'INITIAL': ' \t'} +_lexstateerrorf = {'ppline': 't_ppline_error', 'pppragma': 't_pppragma_error', 'INITIAL': 't_error'} +_lexstateeoff = {} diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pycparser/ply/__init__.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pycparser/ply/__init__.py new file mode 100644 index 00000000..6e53cddc --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pycparser/ply/__init__.py @@ -0,0 +1,5 @@ +# PLY package +# Author: David Beazley (dave@dabeaz.com) + +__version__ = '3.9' +__all__ = ['lex','yacc'] diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pycparser/ply/cpp.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pycparser/ply/cpp.py new file mode 100644 index 00000000..86273eac --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pycparser/ply/cpp.py @@ -0,0 +1,905 @@ +# ----------------------------------------------------------------------------- +# cpp.py +# +# Author: David Beazley (http://www.dabeaz.com) +# Copyright (C) 2017 +# All rights reserved +# +# This module implements an ANSI-C style lexical preprocessor for PLY. +# ----------------------------------------------------------------------------- +import sys + +# Some Python 3 compatibility shims +if sys.version_info.major < 3: + STRING_TYPES = (str, unicode) +else: + STRING_TYPES = str + xrange = range + +# ----------------------------------------------------------------------------- +# Default preprocessor lexer definitions. These tokens are enough to get +# a basic preprocessor working. Other modules may import these if they want +# ----------------------------------------------------------------------------- + +tokens = ( + 'CPP_ID','CPP_INTEGER', 'CPP_FLOAT', 'CPP_STRING', 'CPP_CHAR', 'CPP_WS', 'CPP_COMMENT1', 'CPP_COMMENT2', 'CPP_POUND','CPP_DPOUND' +) + +literals = "+-*/%|&~^<>=!?()[]{}.,;:\\\'\"" + +# Whitespace +def t_CPP_WS(t): + r'\s+' + t.lexer.lineno += t.value.count("\n") + return t + +t_CPP_POUND = r'\#' +t_CPP_DPOUND = r'\#\#' + +# Identifier +t_CPP_ID = r'[A-Za-z_][\w_]*' + +# Integer literal +def CPP_INTEGER(t): + r'(((((0x)|(0X))[0-9a-fA-F]+)|(\d+))([uU][lL]|[lL][uU]|[uU]|[lL])?)' + return t + +t_CPP_INTEGER = CPP_INTEGER + +# Floating literal +t_CPP_FLOAT = r'((\d+)(\.\d+)(e(\+|-)?(\d+))? | (\d+)e(\+|-)?(\d+))([lL]|[fF])?' + +# String literal +def t_CPP_STRING(t): + r'\"([^\\\n]|(\\(.|\n)))*?\"' + t.lexer.lineno += t.value.count("\n") + return t + +# Character constant 'c' or L'c' +def t_CPP_CHAR(t): + r'(L)?\'([^\\\n]|(\\(.|\n)))*?\'' + t.lexer.lineno += t.value.count("\n") + return t + +# Comment +def t_CPP_COMMENT1(t): + r'(/\*(.|\n)*?\*/)' + ncr = t.value.count("\n") + t.lexer.lineno += ncr + # replace with one space or a number of '\n' + t.type = 'CPP_WS'; t.value = '\n' * ncr if ncr else ' ' + return t + +# Line comment +def t_CPP_COMMENT2(t): + r'(//.*?(\n|$))' + # replace with '/n' + t.type = 'CPP_WS'; t.value = '\n' + return t + +def t_error(t): + t.type = t.value[0] + t.value = t.value[0] + t.lexer.skip(1) + return t + +import re +import copy +import time +import os.path + +# ----------------------------------------------------------------------------- +# trigraph() +# +# Given an input string, this function replaces all trigraph sequences. +# The following mapping is used: +# +# ??= # +# ??/ \ +# ??' ^ +# ??( [ +# ??) ] +# ??! | +# ??< { +# ??> } +# ??- ~ +# ----------------------------------------------------------------------------- + +_trigraph_pat = re.compile(r'''\?\?[=/\'\(\)\!<>\-]''') +_trigraph_rep = { + '=':'#', + '/':'\\', + "'":'^', + '(':'[', + ')':']', + '!':'|', + '<':'{', + '>':'}', + '-':'~' +} + +def trigraph(input): + return _trigraph_pat.sub(lambda g: _trigraph_rep[g.group()[-1]],input) + +# ------------------------------------------------------------------ +# Macro object +# +# This object holds information about preprocessor macros +# +# .name - Macro name (string) +# .value - Macro value (a list of tokens) +# .arglist - List of argument names +# .variadic - Boolean indicating whether or not variadic macro +# .vararg - Name of the variadic parameter +# +# When a macro is created, the macro replacement token sequence is +# pre-scanned and used to create patch lists that are later used +# during macro expansion +# ------------------------------------------------------------------ + +class Macro(object): + def __init__(self,name,value,arglist=None,variadic=False): + self.name = name + self.value = value + self.arglist = arglist + self.variadic = variadic + if variadic: + self.vararg = arglist[-1] + self.source = None + +# ------------------------------------------------------------------ +# Preprocessor object +# +# Object representing a preprocessor. Contains macro definitions, +# include directories, and other information +# ------------------------------------------------------------------ + +class Preprocessor(object): + def __init__(self,lexer=None): + if lexer is None: + lexer = lex.lexer + self.lexer = lexer + self.macros = { } + self.path = [] + self.temp_path = [] + + # Probe the lexer for selected tokens + self.lexprobe() + + tm = time.localtime() + self.define("__DATE__ \"%s\"" % time.strftime("%b %d %Y",tm)) + self.define("__TIME__ \"%s\"" % time.strftime("%H:%M:%S",tm)) + self.parser = None + + # ----------------------------------------------------------------------------- + # tokenize() + # + # Utility function. Given a string of text, tokenize into a list of tokens + # ----------------------------------------------------------------------------- + + def tokenize(self,text): + tokens = [] + self.lexer.input(text) + while True: + tok = self.lexer.token() + if not tok: break + tokens.append(tok) + return tokens + + # --------------------------------------------------------------------- + # error() + # + # Report a preprocessor error/warning of some kind + # ---------------------------------------------------------------------- + + def error(self,file,line,msg): + print("%s:%d %s" % (file,line,msg)) + + # ---------------------------------------------------------------------- + # lexprobe() + # + # This method probes the preprocessor lexer object to discover + # the token types of symbols that are important to the preprocessor. + # If this works right, the preprocessor will simply "work" + # with any suitable lexer regardless of how tokens have been named. + # ---------------------------------------------------------------------- + + def lexprobe(self): + + # Determine the token type for identifiers + self.lexer.input("identifier") + tok = self.lexer.token() + if not tok or tok.value != "identifier": + print("Couldn't determine identifier type") + else: + self.t_ID = tok.type + + # Determine the token type for integers + self.lexer.input("12345") + tok = self.lexer.token() + if not tok or int(tok.value) != 12345: + print("Couldn't determine integer type") + else: + self.t_INTEGER = tok.type + self.t_INTEGER_TYPE = type(tok.value) + + # Determine the token type for strings enclosed in double quotes + self.lexer.input("\"filename\"") + tok = self.lexer.token() + if not tok or tok.value != "\"filename\"": + print("Couldn't determine string type") + else: + self.t_STRING = tok.type + + # Determine the token type for whitespace--if any + self.lexer.input(" ") + tok = self.lexer.token() + if not tok or tok.value != " ": + self.t_SPACE = None + else: + self.t_SPACE = tok.type + + # Determine the token type for newlines + self.lexer.input("\n") + tok = self.lexer.token() + if not tok or tok.value != "\n": + self.t_NEWLINE = None + print("Couldn't determine token for newlines") + else: + self.t_NEWLINE = tok.type + + self.t_WS = (self.t_SPACE, self.t_NEWLINE) + + # Check for other characters used by the preprocessor + chars = [ '<','>','#','##','\\','(',')',',','.'] + for c in chars: + self.lexer.input(c) + tok = self.lexer.token() + if not tok or tok.value != c: + print("Unable to lex '%s' required for preprocessor" % c) + + # ---------------------------------------------------------------------- + # add_path() + # + # Adds a search path to the preprocessor. + # ---------------------------------------------------------------------- + + def add_path(self,path): + self.path.append(path) + + # ---------------------------------------------------------------------- + # group_lines() + # + # Given an input string, this function splits it into lines. Trailing whitespace + # is removed. Any line ending with \ is grouped with the next line. This + # function forms the lowest level of the preprocessor---grouping into text into + # a line-by-line format. + # ---------------------------------------------------------------------- + + def group_lines(self,input): + lex = self.lexer.clone() + lines = [x.rstrip() for x in input.splitlines()] + for i in xrange(len(lines)): + j = i+1 + while lines[i].endswith('\\') and (j < len(lines)): + lines[i] = lines[i][:-1]+lines[j] + lines[j] = "" + j += 1 + + input = "\n".join(lines) + lex.input(input) + lex.lineno = 1 + + current_line = [] + while True: + tok = lex.token() + if not tok: + break + current_line.append(tok) + if tok.type in self.t_WS and '\n' in tok.value: + yield current_line + current_line = [] + + if current_line: + yield current_line + + # ---------------------------------------------------------------------- + # tokenstrip() + # + # Remove leading/trailing whitespace tokens from a token list + # ---------------------------------------------------------------------- + + def tokenstrip(self,tokens): + i = 0 + while i < len(tokens) and tokens[i].type in self.t_WS: + i += 1 + del tokens[:i] + i = len(tokens)-1 + while i >= 0 and tokens[i].type in self.t_WS: + i -= 1 + del tokens[i+1:] + return tokens + + + # ---------------------------------------------------------------------- + # collect_args() + # + # Collects comma separated arguments from a list of tokens. The arguments + # must be enclosed in parenthesis. Returns a tuple (tokencount,args,positions) + # where tokencount is the number of tokens consumed, args is a list of arguments, + # and positions is a list of integers containing the starting index of each + # argument. Each argument is represented by a list of tokens. + # + # When collecting arguments, leading and trailing whitespace is removed + # from each argument. + # + # This function properly handles nested parenthesis and commas---these do not + # define new arguments. + # ---------------------------------------------------------------------- + + def collect_args(self,tokenlist): + args = [] + positions = [] + current_arg = [] + nesting = 1 + tokenlen = len(tokenlist) + + # Search for the opening '('. + i = 0 + while (i < tokenlen) and (tokenlist[i].type in self.t_WS): + i += 1 + + if (i < tokenlen) and (tokenlist[i].value == '('): + positions.append(i+1) + else: + self.error(self.source,tokenlist[0].lineno,"Missing '(' in macro arguments") + return 0, [], [] + + i += 1 + + while i < tokenlen: + t = tokenlist[i] + if t.value == '(': + current_arg.append(t) + nesting += 1 + elif t.value == ')': + nesting -= 1 + if nesting == 0: + if current_arg: + args.append(self.tokenstrip(current_arg)) + positions.append(i) + return i+1,args,positions + current_arg.append(t) + elif t.value == ',' and nesting == 1: + args.append(self.tokenstrip(current_arg)) + positions.append(i+1) + current_arg = [] + else: + current_arg.append(t) + i += 1 + + # Missing end argument + self.error(self.source,tokenlist[-1].lineno,"Missing ')' in macro arguments") + return 0, [],[] + + # ---------------------------------------------------------------------- + # macro_prescan() + # + # Examine the macro value (token sequence) and identify patch points + # This is used to speed up macro expansion later on---we'll know + # right away where to apply patches to the value to form the expansion + # ---------------------------------------------------------------------- + + def macro_prescan(self,macro): + macro.patch = [] # Standard macro arguments + macro.str_patch = [] # String conversion expansion + macro.var_comma_patch = [] # Variadic macro comma patch + i = 0 + while i < len(macro.value): + if macro.value[i].type == self.t_ID and macro.value[i].value in macro.arglist: + argnum = macro.arglist.index(macro.value[i].value) + # Conversion of argument to a string + if i > 0 and macro.value[i-1].value == '#': + macro.value[i] = copy.copy(macro.value[i]) + macro.value[i].type = self.t_STRING + del macro.value[i-1] + macro.str_patch.append((argnum,i-1)) + continue + # Concatenation + elif (i > 0 and macro.value[i-1].value == '##'): + macro.patch.append(('c',argnum,i-1)) + del macro.value[i-1] + continue + elif ((i+1) < len(macro.value) and macro.value[i+1].value == '##'): + macro.patch.append(('c',argnum,i)) + i += 1 + continue + # Standard expansion + else: + macro.patch.append(('e',argnum,i)) + elif macro.value[i].value == '##': + if macro.variadic and (i > 0) and (macro.value[i-1].value == ',') and \ + ((i+1) < len(macro.value)) and (macro.value[i+1].type == self.t_ID) and \ + (macro.value[i+1].value == macro.vararg): + macro.var_comma_patch.append(i-1) + i += 1 + macro.patch.sort(key=lambda x: x[2],reverse=True) + + # ---------------------------------------------------------------------- + # macro_expand_args() + # + # Given a Macro and list of arguments (each a token list), this method + # returns an expanded version of a macro. The return value is a token sequence + # representing the replacement macro tokens + # ---------------------------------------------------------------------- + + def macro_expand_args(self,macro,args): + # Make a copy of the macro token sequence + rep = [copy.copy(_x) for _x in macro.value] + + # Make string expansion patches. These do not alter the length of the replacement sequence + + str_expansion = {} + for argnum, i in macro.str_patch: + if argnum not in str_expansion: + str_expansion[argnum] = ('"%s"' % "".join([x.value for x in args[argnum]])).replace("\\","\\\\") + rep[i] = copy.copy(rep[i]) + rep[i].value = str_expansion[argnum] + + # Make the variadic macro comma patch. If the variadic macro argument is empty, we get rid + comma_patch = False + if macro.variadic and not args[-1]: + for i in macro.var_comma_patch: + rep[i] = None + comma_patch = True + + # Make all other patches. The order of these matters. It is assumed that the patch list + # has been sorted in reverse order of patch location since replacements will cause the + # size of the replacement sequence to expand from the patch point. + + expanded = { } + for ptype, argnum, i in macro.patch: + # Concatenation. Argument is left unexpanded + if ptype == 'c': + rep[i:i+1] = args[argnum] + # Normal expansion. Argument is macro expanded first + elif ptype == 'e': + if argnum not in expanded: + expanded[argnum] = self.expand_macros(args[argnum]) + rep[i:i+1] = expanded[argnum] + + # Get rid of removed comma if necessary + if comma_patch: + rep = [_i for _i in rep if _i] + + return rep + + + # ---------------------------------------------------------------------- + # expand_macros() + # + # Given a list of tokens, this function performs macro expansion. + # The expanded argument is a dictionary that contains macros already + # expanded. This is used to prevent infinite recursion. + # ---------------------------------------------------------------------- + + def expand_macros(self,tokens,expanded=None): + if expanded is None: + expanded = {} + i = 0 + while i < len(tokens): + t = tokens[i] + if t.type == self.t_ID: + if t.value in self.macros and t.value not in expanded: + # Yes, we found a macro match + expanded[t.value] = True + + m = self.macros[t.value] + if not m.arglist: + # A simple macro + ex = self.expand_macros([copy.copy(_x) for _x in m.value],expanded) + for e in ex: + e.lineno = t.lineno + tokens[i:i+1] = ex + i += len(ex) + else: + # A macro with arguments + j = i + 1 + while j < len(tokens) and tokens[j].type in self.t_WS: + j += 1 + if tokens[j].value == '(': + tokcount,args,positions = self.collect_args(tokens[j:]) + if not m.variadic and len(args) != len(m.arglist): + self.error(self.source,t.lineno,"Macro %s requires %d arguments" % (t.value,len(m.arglist))) + i = j + tokcount + elif m.variadic and len(args) < len(m.arglist)-1: + if len(m.arglist) > 2: + self.error(self.source,t.lineno,"Macro %s must have at least %d arguments" % (t.value, len(m.arglist)-1)) + else: + self.error(self.source,t.lineno,"Macro %s must have at least %d argument" % (t.value, len(m.arglist)-1)) + i = j + tokcount + else: + if m.variadic: + if len(args) == len(m.arglist)-1: + args.append([]) + else: + args[len(m.arglist)-1] = tokens[j+positions[len(m.arglist)-1]:j+tokcount-1] + del args[len(m.arglist):] + + # Get macro replacement text + rep = self.macro_expand_args(m,args) + rep = self.expand_macros(rep,expanded) + for r in rep: + r.lineno = t.lineno + tokens[i:j+tokcount] = rep + i += len(rep) + del expanded[t.value] + continue + elif t.value == '__LINE__': + t.type = self.t_INTEGER + t.value = self.t_INTEGER_TYPE(t.lineno) + + i += 1 + return tokens + + # ---------------------------------------------------------------------- + # evalexpr() + # + # Evaluate an expression token sequence for the purposes of evaluating + # integral expressions. + # ---------------------------------------------------------------------- + + def evalexpr(self,tokens): + # tokens = tokenize(line) + # Search for defined macros + i = 0 + while i < len(tokens): + if tokens[i].type == self.t_ID and tokens[i].value == 'defined': + j = i + 1 + needparen = False + result = "0L" + while j < len(tokens): + if tokens[j].type in self.t_WS: + j += 1 + continue + elif tokens[j].type == self.t_ID: + if tokens[j].value in self.macros: + result = "1L" + else: + result = "0L" + if not needparen: break + elif tokens[j].value == '(': + needparen = True + elif tokens[j].value == ')': + break + else: + self.error(self.source,tokens[i].lineno,"Malformed defined()") + j += 1 + tokens[i].type = self.t_INTEGER + tokens[i].value = self.t_INTEGER_TYPE(result) + del tokens[i+1:j+1] + i += 1 + tokens = self.expand_macros(tokens) + for i,t in enumerate(tokens): + if t.type == self.t_ID: + tokens[i] = copy.copy(t) + tokens[i].type = self.t_INTEGER + tokens[i].value = self.t_INTEGER_TYPE("0L") + elif t.type == self.t_INTEGER: + tokens[i] = copy.copy(t) + # Strip off any trailing suffixes + tokens[i].value = str(tokens[i].value) + while tokens[i].value[-1] not in "0123456789abcdefABCDEF": + tokens[i].value = tokens[i].value[:-1] + + expr = "".join([str(x.value) for x in tokens]) + expr = expr.replace("&&"," and ") + expr = expr.replace("||"," or ") + expr = expr.replace("!"," not ") + try: + result = eval(expr) + except Exception: + self.error(self.source,tokens[0].lineno,"Couldn't evaluate expression") + result = 0 + return result + + # ---------------------------------------------------------------------- + # parsegen() + # + # Parse an input string/ + # ---------------------------------------------------------------------- + def parsegen(self,input,source=None): + + # Replace trigraph sequences + t = trigraph(input) + lines = self.group_lines(t) + + if not source: + source = "" + + self.define("__FILE__ \"%s\"" % source) + + self.source = source + chunk = [] + enable = True + iftrigger = False + ifstack = [] + + for x in lines: + for i,tok in enumerate(x): + if tok.type not in self.t_WS: break + if tok.value == '#': + # Preprocessor directive + + # insert necessary whitespace instead of eaten tokens + for tok in x: + if tok.type in self.t_WS and '\n' in tok.value: + chunk.append(tok) + + dirtokens = self.tokenstrip(x[i+1:]) + if dirtokens: + name = dirtokens[0].value + args = self.tokenstrip(dirtokens[1:]) + else: + name = "" + args = [] + + if name == 'define': + if enable: + for tok in self.expand_macros(chunk): + yield tok + chunk = [] + self.define(args) + elif name == 'include': + if enable: + for tok in self.expand_macros(chunk): + yield tok + chunk = [] + oldfile = self.macros['__FILE__'] + for tok in self.include(args): + yield tok + self.macros['__FILE__'] = oldfile + self.source = source + elif name == 'undef': + if enable: + for tok in self.expand_macros(chunk): + yield tok + chunk = [] + self.undef(args) + elif name == 'ifdef': + ifstack.append((enable,iftrigger)) + if enable: + if not args[0].value in self.macros: + enable = False + iftrigger = False + else: + iftrigger = True + elif name == 'ifndef': + ifstack.append((enable,iftrigger)) + if enable: + if args[0].value in self.macros: + enable = False + iftrigger = False + else: + iftrigger = True + elif name == 'if': + ifstack.append((enable,iftrigger)) + if enable: + result = self.evalexpr(args) + if not result: + enable = False + iftrigger = False + else: + iftrigger = True + elif name == 'elif': + if ifstack: + if ifstack[-1][0]: # We only pay attention if outer "if" allows this + if enable: # If already true, we flip enable False + enable = False + elif not iftrigger: # If False, but not triggered yet, we'll check expression + result = self.evalexpr(args) + if result: + enable = True + iftrigger = True + else: + self.error(self.source,dirtokens[0].lineno,"Misplaced #elif") + + elif name == 'else': + if ifstack: + if ifstack[-1][0]: + if enable: + enable = False + elif not iftrigger: + enable = True + iftrigger = True + else: + self.error(self.source,dirtokens[0].lineno,"Misplaced #else") + + elif name == 'endif': + if ifstack: + enable,iftrigger = ifstack.pop() + else: + self.error(self.source,dirtokens[0].lineno,"Misplaced #endif") + else: + # Unknown preprocessor directive + pass + + else: + # Normal text + if enable: + chunk.extend(x) + + for tok in self.expand_macros(chunk): + yield tok + chunk = [] + + # ---------------------------------------------------------------------- + # include() + # + # Implementation of file-inclusion + # ---------------------------------------------------------------------- + + def include(self,tokens): + # Try to extract the filename and then process an include file + if not tokens: + return + if tokens: + if tokens[0].value != '<' and tokens[0].type != self.t_STRING: + tokens = self.expand_macros(tokens) + + if tokens[0].value == '<': + # Include <...> + i = 1 + while i < len(tokens): + if tokens[i].value == '>': + break + i += 1 + else: + print("Malformed #include <...>") + return + filename = "".join([x.value for x in tokens[1:i]]) + path = self.path + [""] + self.temp_path + elif tokens[0].type == self.t_STRING: + filename = tokens[0].value[1:-1] + path = self.temp_path + [""] + self.path + else: + print("Malformed #include statement") + return + for p in path: + iname = os.path.join(p,filename) + try: + data = open(iname,"r").read() + dname = os.path.dirname(iname) + if dname: + self.temp_path.insert(0,dname) + for tok in self.parsegen(data,filename): + yield tok + if dname: + del self.temp_path[0] + break + except IOError: + pass + else: + print("Couldn't find '%s'" % filename) + + # ---------------------------------------------------------------------- + # define() + # + # Define a new macro + # ---------------------------------------------------------------------- + + def define(self,tokens): + if isinstance(tokens,STRING_TYPES): + tokens = self.tokenize(tokens) + + linetok = tokens + try: + name = linetok[0] + if len(linetok) > 1: + mtype = linetok[1] + else: + mtype = None + if not mtype: + m = Macro(name.value,[]) + self.macros[name.value] = m + elif mtype.type in self.t_WS: + # A normal macro + m = Macro(name.value,self.tokenstrip(linetok[2:])) + self.macros[name.value] = m + elif mtype.value == '(': + # A macro with arguments + tokcount, args, positions = self.collect_args(linetok[1:]) + variadic = False + for a in args: + if variadic: + print("No more arguments may follow a variadic argument") + break + astr = "".join([str(_i.value) for _i in a]) + if astr == "...": + variadic = True + a[0].type = self.t_ID + a[0].value = '__VA_ARGS__' + variadic = True + del a[1:] + continue + elif astr[-3:] == "..." and a[0].type == self.t_ID: + variadic = True + del a[1:] + # If, for some reason, "." is part of the identifier, strip off the name for the purposes + # of macro expansion + if a[0].value[-3:] == '...': + a[0].value = a[0].value[:-3] + continue + if len(a) > 1 or a[0].type != self.t_ID: + print("Invalid macro argument") + break + else: + mvalue = self.tokenstrip(linetok[1+tokcount:]) + i = 0 + while i < len(mvalue): + if i+1 < len(mvalue): + if mvalue[i].type in self.t_WS and mvalue[i+1].value == '##': + del mvalue[i] + continue + elif mvalue[i].value == '##' and mvalue[i+1].type in self.t_WS: + del mvalue[i+1] + i += 1 + m = Macro(name.value,mvalue,[x[0].value for x in args],variadic) + self.macro_prescan(m) + self.macros[name.value] = m + else: + print("Bad macro definition") + except LookupError: + print("Bad macro definition") + + # ---------------------------------------------------------------------- + # undef() + # + # Undefine a macro + # ---------------------------------------------------------------------- + + def undef(self,tokens): + id = tokens[0].value + try: + del self.macros[id] + except LookupError: + pass + + # ---------------------------------------------------------------------- + # parse() + # + # Parse input text. + # ---------------------------------------------------------------------- + def parse(self,input,source=None,ignore={}): + self.ignore = ignore + self.parser = self.parsegen(input,source) + + # ---------------------------------------------------------------------- + # token() + # + # Method to return individual tokens + # ---------------------------------------------------------------------- + def token(self): + try: + while True: + tok = next(self.parser) + if tok.type not in self.ignore: return tok + except StopIteration: + self.parser = None + return None + +if __name__ == '__main__': + import ply.lex as lex + lexer = lex.lex() + + # Run a preprocessor + import sys + f = open(sys.argv[1]) + input = f.read() + + p = Preprocessor(lexer) + p.parse(input,sys.argv[1]) + while True: + tok = p.token() + if not tok: break + print(p.source, tok) diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pycparser/ply/ctokens.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pycparser/ply/ctokens.py new file mode 100644 index 00000000..f6f6952d --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pycparser/ply/ctokens.py @@ -0,0 +1,133 @@ +# ---------------------------------------------------------------------- +# ctokens.py +# +# Token specifications for symbols in ANSI C and C++. This file is +# meant to be used as a library in other tokenizers. +# ---------------------------------------------------------------------- + +# Reserved words + +tokens = [ + # Literals (identifier, integer constant, float constant, string constant, char const) + 'ID', 'TYPEID', 'INTEGER', 'FLOAT', 'STRING', 'CHARACTER', + + # Operators (+,-,*,/,%,|,&,~,^,<<,>>, ||, &&, !, <, <=, >, >=, ==, !=) + 'PLUS', 'MINUS', 'TIMES', 'DIVIDE', 'MODULO', + 'OR', 'AND', 'NOT', 'XOR', 'LSHIFT', 'RSHIFT', + 'LOR', 'LAND', 'LNOT', + 'LT', 'LE', 'GT', 'GE', 'EQ', 'NE', + + # Assignment (=, *=, /=, %=, +=, -=, <<=, >>=, &=, ^=, |=) + 'EQUALS', 'TIMESEQUAL', 'DIVEQUAL', 'MODEQUAL', 'PLUSEQUAL', 'MINUSEQUAL', + 'LSHIFTEQUAL','RSHIFTEQUAL', 'ANDEQUAL', 'XOREQUAL', 'OREQUAL', + + # Increment/decrement (++,--) + 'INCREMENT', 'DECREMENT', + + # Structure dereference (->) + 'ARROW', + + # Ternary operator (?) + 'TERNARY', + + # Delimeters ( ) [ ] { } , . ; : + 'LPAREN', 'RPAREN', + 'LBRACKET', 'RBRACKET', + 'LBRACE', 'RBRACE', + 'COMMA', 'PERIOD', 'SEMI', 'COLON', + + # Ellipsis (...) + 'ELLIPSIS', +] + +# Operators +t_PLUS = r'\+' +t_MINUS = r'-' +t_TIMES = r'\*' +t_DIVIDE = r'/' +t_MODULO = r'%' +t_OR = r'\|' +t_AND = r'&' +t_NOT = r'~' +t_XOR = r'\^' +t_LSHIFT = r'<<' +t_RSHIFT = r'>>' +t_LOR = r'\|\|' +t_LAND = r'&&' +t_LNOT = r'!' +t_LT = r'<' +t_GT = r'>' +t_LE = r'<=' +t_GE = r'>=' +t_EQ = r'==' +t_NE = r'!=' + +# Assignment operators + +t_EQUALS = r'=' +t_TIMESEQUAL = r'\*=' +t_DIVEQUAL = r'/=' +t_MODEQUAL = r'%=' +t_PLUSEQUAL = r'\+=' +t_MINUSEQUAL = r'-=' +t_LSHIFTEQUAL = r'<<=' +t_RSHIFTEQUAL = r'>>=' +t_ANDEQUAL = r'&=' +t_OREQUAL = r'\|=' +t_XOREQUAL = r'\^=' + +# Increment/decrement +t_INCREMENT = r'\+\+' +t_DECREMENT = r'--' + +# -> +t_ARROW = r'->' + +# ? +t_TERNARY = r'\?' + +# Delimeters +t_LPAREN = r'\(' +t_RPAREN = r'\)' +t_LBRACKET = r'\[' +t_RBRACKET = r'\]' +t_LBRACE = r'\{' +t_RBRACE = r'\}' +t_COMMA = r',' +t_PERIOD = r'\.' +t_SEMI = r';' +t_COLON = r':' +t_ELLIPSIS = r'\.\.\.' + +# Identifiers +t_ID = r'[A-Za-z_][A-Za-z0-9_]*' + +# Integer literal +t_INTEGER = r'\d+([uU]|[lL]|[uU][lL]|[lL][uU])?' + +# Floating literal +t_FLOAT = r'((\d+)(\.\d+)(e(\+|-)?(\d+))? | (\d+)e(\+|-)?(\d+))([lL]|[fF])?' + +# String literal +t_STRING = r'\"([^\\\n]|(\\.))*?\"' + +# Character constant 'c' or L'c' +t_CHARACTER = r'(L)?\'([^\\\n]|(\\.))*?\'' + +# Comment (C-Style) +def t_COMMENT(t): + r'/\*(.|\n)*?\*/' + t.lexer.lineno += t.value.count('\n') + return t + +# Comment (C++-Style) +def t_CPPCOMMENT(t): + r'//.*\n' + t.lexer.lineno += 1 + return t + + + + + + diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pycparser/ply/lex.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pycparser/ply/lex.py new file mode 100644 index 00000000..4bdd76ca --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pycparser/ply/lex.py @@ -0,0 +1,1099 @@ +# ----------------------------------------------------------------------------- +# ply: lex.py +# +# Copyright (C) 2001-2017 +# David M. Beazley (Dabeaz LLC) +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# +# * Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of the David Beazley or Dabeaz LLC may be used to +# endorse or promote products derived from this software without +# specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# ----------------------------------------------------------------------------- + +__version__ = '3.10' +__tabversion__ = '3.10' + +import re +import sys +import types +import copy +import os +import inspect + +# This tuple contains known string types +try: + # Python 2.6 + StringTypes = (types.StringType, types.UnicodeType) +except AttributeError: + # Python 3.0 + StringTypes = (str, bytes) + +# This regular expression is used to match valid token names +_is_identifier = re.compile(r'^[a-zA-Z0-9_]+$') + +# Exception thrown when invalid token encountered and no default error +# handler is defined. +class LexError(Exception): + def __init__(self, message, s): + self.args = (message,) + self.text = s + + +# Token class. This class is used to represent the tokens produced. +class LexToken(object): + def __str__(self): + return 'LexToken(%s,%r,%d,%d)' % (self.type, self.value, self.lineno, self.lexpos) + + def __repr__(self): + return str(self) + + +# This object is a stand-in for a logging object created by the +# logging module. + +class PlyLogger(object): + def __init__(self, f): + self.f = f + + def critical(self, msg, *args, **kwargs): + self.f.write((msg % args) + '\n') + + def warning(self, msg, *args, **kwargs): + self.f.write('WARNING: ' + (msg % args) + '\n') + + def error(self, msg, *args, **kwargs): + self.f.write('ERROR: ' + (msg % args) + '\n') + + info = critical + debug = critical + + +# Null logger is used when no output is generated. Does nothing. +class NullLogger(object): + def __getattribute__(self, name): + return self + + def __call__(self, *args, **kwargs): + return self + + +# ----------------------------------------------------------------------------- +# === Lexing Engine === +# +# The following Lexer class implements the lexer runtime. There are only +# a few public methods and attributes: +# +# input() - Store a new string in the lexer +# token() - Get the next token +# clone() - Clone the lexer +# +# lineno - Current line number +# lexpos - Current position in the input string +# ----------------------------------------------------------------------------- + +class Lexer: + def __init__(self): + self.lexre = None # Master regular expression. This is a list of + # tuples (re, findex) where re is a compiled + # regular expression and findex is a list + # mapping regex group numbers to rules + self.lexretext = None # Current regular expression strings + self.lexstatere = {} # Dictionary mapping lexer states to master regexs + self.lexstateretext = {} # Dictionary mapping lexer states to regex strings + self.lexstaterenames = {} # Dictionary mapping lexer states to symbol names + self.lexstate = 'INITIAL' # Current lexer state + self.lexstatestack = [] # Stack of lexer states + self.lexstateinfo = None # State information + self.lexstateignore = {} # Dictionary of ignored characters for each state + self.lexstateerrorf = {} # Dictionary of error functions for each state + self.lexstateeoff = {} # Dictionary of eof functions for each state + self.lexreflags = 0 # Optional re compile flags + self.lexdata = None # Actual input data (as a string) + self.lexpos = 0 # Current position in input text + self.lexlen = 0 # Length of the input text + self.lexerrorf = None # Error rule (if any) + self.lexeoff = None # EOF rule (if any) + self.lextokens = None # List of valid tokens + self.lexignore = '' # Ignored characters + self.lexliterals = '' # Literal characters that can be passed through + self.lexmodule = None # Module + self.lineno = 1 # Current line number + self.lexoptimize = False # Optimized mode + + def clone(self, object=None): + c = copy.copy(self) + + # If the object parameter has been supplied, it means we are attaching the + # lexer to a new object. In this case, we have to rebind all methods in + # the lexstatere and lexstateerrorf tables. + + if object: + newtab = {} + for key, ritem in self.lexstatere.items(): + newre = [] + for cre, findex in ritem: + newfindex = [] + for f in findex: + if not f or not f[0]: + newfindex.append(f) + continue + newfindex.append((getattr(object, f[0].__name__), f[1])) + newre.append((cre, newfindex)) + newtab[key] = newre + c.lexstatere = newtab + c.lexstateerrorf = {} + for key, ef in self.lexstateerrorf.items(): + c.lexstateerrorf[key] = getattr(object, ef.__name__) + c.lexmodule = object + return c + + # ------------------------------------------------------------ + # writetab() - Write lexer information to a table file + # ------------------------------------------------------------ + def writetab(self, lextab, outputdir=''): + if isinstance(lextab, types.ModuleType): + raise IOError("Won't overwrite existing lextab module") + basetabmodule = lextab.split('.')[-1] + filename = os.path.join(outputdir, basetabmodule) + '.py' + with open(filename, 'w') as tf: + tf.write('# %s.py. This file automatically created by PLY (version %s). Don\'t edit!\n' % (basetabmodule, __version__)) + tf.write('_tabversion = %s\n' % repr(__tabversion__)) + tf.write('_lextokens = set(%s)\n' % repr(tuple(self.lextokens))) + tf.write('_lexreflags = %s\n' % repr(self.lexreflags)) + tf.write('_lexliterals = %s\n' % repr(self.lexliterals)) + tf.write('_lexstateinfo = %s\n' % repr(self.lexstateinfo)) + + # Rewrite the lexstatere table, replacing function objects with function names + tabre = {} + for statename, lre in self.lexstatere.items(): + titem = [] + for (pat, func), retext, renames in zip(lre, self.lexstateretext[statename], self.lexstaterenames[statename]): + titem.append((retext, _funcs_to_names(func, renames))) + tabre[statename] = titem + + tf.write('_lexstatere = %s\n' % repr(tabre)) + tf.write('_lexstateignore = %s\n' % repr(self.lexstateignore)) + + taberr = {} + for statename, ef in self.lexstateerrorf.items(): + taberr[statename] = ef.__name__ if ef else None + tf.write('_lexstateerrorf = %s\n' % repr(taberr)) + + tabeof = {} + for statename, ef in self.lexstateeoff.items(): + tabeof[statename] = ef.__name__ if ef else None + tf.write('_lexstateeoff = %s\n' % repr(tabeof)) + + # ------------------------------------------------------------ + # readtab() - Read lexer information from a tab file + # ------------------------------------------------------------ + def readtab(self, tabfile, fdict): + if isinstance(tabfile, types.ModuleType): + lextab = tabfile + else: + exec('import %s' % tabfile) + lextab = sys.modules[tabfile] + + if getattr(lextab, '_tabversion', '0.0') != __tabversion__: + raise ImportError('Inconsistent PLY version') + + self.lextokens = lextab._lextokens + self.lexreflags = lextab._lexreflags + self.lexliterals = lextab._lexliterals + self.lextokens_all = self.lextokens | set(self.lexliterals) + self.lexstateinfo = lextab._lexstateinfo + self.lexstateignore = lextab._lexstateignore + self.lexstatere = {} + self.lexstateretext = {} + for statename, lre in lextab._lexstatere.items(): + titem = [] + txtitem = [] + for pat, func_name in lre: + titem.append((re.compile(pat, lextab._lexreflags), _names_to_funcs(func_name, fdict))) + + self.lexstatere[statename] = titem + self.lexstateretext[statename] = txtitem + + self.lexstateerrorf = {} + for statename, ef in lextab._lexstateerrorf.items(): + self.lexstateerrorf[statename] = fdict[ef] + + self.lexstateeoff = {} + for statename, ef in lextab._lexstateeoff.items(): + self.lexstateeoff[statename] = fdict[ef] + + self.begin('INITIAL') + + # ------------------------------------------------------------ + # input() - Push a new string into the lexer + # ------------------------------------------------------------ + def input(self, s): + # Pull off the first character to see if s looks like a string + c = s[:1] + if not isinstance(c, StringTypes): + raise ValueError('Expected a string') + self.lexdata = s + self.lexpos = 0 + self.lexlen = len(s) + + # ------------------------------------------------------------ + # begin() - Changes the lexing state + # ------------------------------------------------------------ + def begin(self, state): + if state not in self.lexstatere: + raise ValueError('Undefined state') + self.lexre = self.lexstatere[state] + self.lexretext = self.lexstateretext[state] + self.lexignore = self.lexstateignore.get(state, '') + self.lexerrorf = self.lexstateerrorf.get(state, None) + self.lexeoff = self.lexstateeoff.get(state, None) + self.lexstate = state + + # ------------------------------------------------------------ + # push_state() - Changes the lexing state and saves old on stack + # ------------------------------------------------------------ + def push_state(self, state): + self.lexstatestack.append(self.lexstate) + self.begin(state) + + # ------------------------------------------------------------ + # pop_state() - Restores the previous state + # ------------------------------------------------------------ + def pop_state(self): + self.begin(self.lexstatestack.pop()) + + # ------------------------------------------------------------ + # current_state() - Returns the current lexing state + # ------------------------------------------------------------ + def current_state(self): + return self.lexstate + + # ------------------------------------------------------------ + # skip() - Skip ahead n characters + # ------------------------------------------------------------ + def skip(self, n): + self.lexpos += n + + # ------------------------------------------------------------ + # opttoken() - Return the next token from the Lexer + # + # Note: This function has been carefully implemented to be as fast + # as possible. Don't make changes unless you really know what + # you are doing + # ------------------------------------------------------------ + def token(self): + # Make local copies of frequently referenced attributes + lexpos = self.lexpos + lexlen = self.lexlen + lexignore = self.lexignore + lexdata = self.lexdata + + while lexpos < lexlen: + # This code provides some short-circuit code for whitespace, tabs, and other ignored characters + if lexdata[lexpos] in lexignore: + lexpos += 1 + continue + + # Look for a regular expression match + for lexre, lexindexfunc in self.lexre: + m = lexre.match(lexdata, lexpos) + if not m: + continue + + # Create a token for return + tok = LexToken() + tok.value = m.group() + tok.lineno = self.lineno + tok.lexpos = lexpos + + i = m.lastindex + func, tok.type = lexindexfunc[i] + + if not func: + # If no token type was set, it's an ignored token + if tok.type: + self.lexpos = m.end() + return tok + else: + lexpos = m.end() + break + + lexpos = m.end() + + # If token is processed by a function, call it + + tok.lexer = self # Set additional attributes useful in token rules + self.lexmatch = m + self.lexpos = lexpos + + newtok = func(tok) + + # Every function must return a token, if nothing, we just move to next token + if not newtok: + lexpos = self.lexpos # This is here in case user has updated lexpos. + lexignore = self.lexignore # This is here in case there was a state change + break + + # Verify type of the token. If not in the token map, raise an error + if not self.lexoptimize: + if newtok.type not in self.lextokens_all: + raise LexError("%s:%d: Rule '%s' returned an unknown token type '%s'" % ( + func.__code__.co_filename, func.__code__.co_firstlineno, + func.__name__, newtok.type), lexdata[lexpos:]) + + return newtok + else: + # No match, see if in literals + if lexdata[lexpos] in self.lexliterals: + tok = LexToken() + tok.value = lexdata[lexpos] + tok.lineno = self.lineno + tok.type = tok.value + tok.lexpos = lexpos + self.lexpos = lexpos + 1 + return tok + + # No match. Call t_error() if defined. + if self.lexerrorf: + tok = LexToken() + tok.value = self.lexdata[lexpos:] + tok.lineno = self.lineno + tok.type = 'error' + tok.lexer = self + tok.lexpos = lexpos + self.lexpos = lexpos + newtok = self.lexerrorf(tok) + if lexpos == self.lexpos: + # Error method didn't change text position at all. This is an error. + raise LexError("Scanning error. Illegal character '%s'" % (lexdata[lexpos]), lexdata[lexpos:]) + lexpos = self.lexpos + if not newtok: + continue + return newtok + + self.lexpos = lexpos + raise LexError("Illegal character '%s' at index %d" % (lexdata[lexpos], lexpos), lexdata[lexpos:]) + + if self.lexeoff: + tok = LexToken() + tok.type = 'eof' + tok.value = '' + tok.lineno = self.lineno + tok.lexpos = lexpos + tok.lexer = self + self.lexpos = lexpos + newtok = self.lexeoff(tok) + return newtok + + self.lexpos = lexpos + 1 + if self.lexdata is None: + raise RuntimeError('No input string given with input()') + return None + + # Iterator interface + def __iter__(self): + return self + + def next(self): + t = self.token() + if t is None: + raise StopIteration + return t + + __next__ = next + +# ----------------------------------------------------------------------------- +# ==== Lex Builder === +# +# The functions and classes below are used to collect lexing information +# and build a Lexer object from it. +# ----------------------------------------------------------------------------- + +# ----------------------------------------------------------------------------- +# _get_regex(func) +# +# Returns the regular expression assigned to a function either as a doc string +# or as a .regex attribute attached by the @TOKEN decorator. +# ----------------------------------------------------------------------------- +def _get_regex(func): + return getattr(func, 'regex', func.__doc__) + +# ----------------------------------------------------------------------------- +# get_caller_module_dict() +# +# This function returns a dictionary containing all of the symbols defined within +# a caller further down the call stack. This is used to get the environment +# associated with the yacc() call if none was provided. +# ----------------------------------------------------------------------------- +def get_caller_module_dict(levels): + f = sys._getframe(levels) + ldict = f.f_globals.copy() + if f.f_globals != f.f_locals: + ldict.update(f.f_locals) + return ldict + +# ----------------------------------------------------------------------------- +# _funcs_to_names() +# +# Given a list of regular expression functions, this converts it to a list +# suitable for output to a table file +# ----------------------------------------------------------------------------- +def _funcs_to_names(funclist, namelist): + result = [] + for f, name in zip(funclist, namelist): + if f and f[0]: + result.append((name, f[1])) + else: + result.append(f) + return result + +# ----------------------------------------------------------------------------- +# _names_to_funcs() +# +# Given a list of regular expression function names, this converts it back to +# functions. +# ----------------------------------------------------------------------------- +def _names_to_funcs(namelist, fdict): + result = [] + for n in namelist: + if n and n[0]: + result.append((fdict[n[0]], n[1])) + else: + result.append(n) + return result + +# ----------------------------------------------------------------------------- +# _form_master_re() +# +# This function takes a list of all of the regex components and attempts to +# form the master regular expression. Given limitations in the Python re +# module, it may be necessary to break the master regex into separate expressions. +# ----------------------------------------------------------------------------- +def _form_master_re(relist, reflags, ldict, toknames): + if not relist: + return [] + regex = '|'.join(relist) + try: + lexre = re.compile(regex, reflags) + + # Build the index to function map for the matching engine + lexindexfunc = [None] * (max(lexre.groupindex.values()) + 1) + lexindexnames = lexindexfunc[:] + + for f, i in lexre.groupindex.items(): + handle = ldict.get(f, None) + if type(handle) in (types.FunctionType, types.MethodType): + lexindexfunc[i] = (handle, toknames[f]) + lexindexnames[i] = f + elif handle is not None: + lexindexnames[i] = f + if f.find('ignore_') > 0: + lexindexfunc[i] = (None, None) + else: + lexindexfunc[i] = (None, toknames[f]) + + return [(lexre, lexindexfunc)], [regex], [lexindexnames] + except Exception: + m = int(len(relist)/2) + if m == 0: + m = 1 + llist, lre, lnames = _form_master_re(relist[:m], reflags, ldict, toknames) + rlist, rre, rnames = _form_master_re(relist[m:], reflags, ldict, toknames) + return (llist+rlist), (lre+rre), (lnames+rnames) + +# ----------------------------------------------------------------------------- +# def _statetoken(s,names) +# +# Given a declaration name s of the form "t_" and a dictionary whose keys are +# state names, this function returns a tuple (states,tokenname) where states +# is a tuple of state names and tokenname is the name of the token. For example, +# calling this with s = "t_foo_bar_SPAM" might return (('foo','bar'),'SPAM') +# ----------------------------------------------------------------------------- +def _statetoken(s, names): + nonstate = 1 + parts = s.split('_') + for i, part in enumerate(parts[1:], 1): + if part not in names and part != 'ANY': + break + + if i > 1: + states = tuple(parts[1:i]) + else: + states = ('INITIAL',) + + if 'ANY' in states: + states = tuple(names) + + tokenname = '_'.join(parts[i:]) + return (states, tokenname) + + +# ----------------------------------------------------------------------------- +# LexerReflect() +# +# This class represents information needed to build a lexer as extracted from a +# user's input file. +# ----------------------------------------------------------------------------- +class LexerReflect(object): + def __init__(self, ldict, log=None, reflags=0): + self.ldict = ldict + self.error_func = None + self.tokens = [] + self.reflags = reflags + self.stateinfo = {'INITIAL': 'inclusive'} + self.modules = set() + self.error = False + self.log = PlyLogger(sys.stderr) if log is None else log + + # Get all of the basic information + def get_all(self): + self.get_tokens() + self.get_literals() + self.get_states() + self.get_rules() + + # Validate all of the information + def validate_all(self): + self.validate_tokens() + self.validate_literals() + self.validate_rules() + return self.error + + # Get the tokens map + def get_tokens(self): + tokens = self.ldict.get('tokens', None) + if not tokens: + self.log.error('No token list is defined') + self.error = True + return + + if not isinstance(tokens, (list, tuple)): + self.log.error('tokens must be a list or tuple') + self.error = True + return + + if not tokens: + self.log.error('tokens is empty') + self.error = True + return + + self.tokens = tokens + + # Validate the tokens + def validate_tokens(self): + terminals = {} + for n in self.tokens: + if not _is_identifier.match(n): + self.log.error("Bad token name '%s'", n) + self.error = True + if n in terminals: + self.log.warning("Token '%s' multiply defined", n) + terminals[n] = 1 + + # Get the literals specifier + def get_literals(self): + self.literals = self.ldict.get('literals', '') + if not self.literals: + self.literals = '' + + # Validate literals + def validate_literals(self): + try: + for c in self.literals: + if not isinstance(c, StringTypes) or len(c) > 1: + self.log.error('Invalid literal %s. Must be a single character', repr(c)) + self.error = True + + except TypeError: + self.log.error('Invalid literals specification. literals must be a sequence of characters') + self.error = True + + def get_states(self): + self.states = self.ldict.get('states', None) + # Build statemap + if self.states: + if not isinstance(self.states, (tuple, list)): + self.log.error('states must be defined as a tuple or list') + self.error = True + else: + for s in self.states: + if not isinstance(s, tuple) or len(s) != 2: + self.log.error("Invalid state specifier %s. Must be a tuple (statename,'exclusive|inclusive')", repr(s)) + self.error = True + continue + name, statetype = s + if not isinstance(name, StringTypes): + self.log.error('State name %s must be a string', repr(name)) + self.error = True + continue + if not (statetype == 'inclusive' or statetype == 'exclusive'): + self.log.error("State type for state %s must be 'inclusive' or 'exclusive'", name) + self.error = True + continue + if name in self.stateinfo: + self.log.error("State '%s' already defined", name) + self.error = True + continue + self.stateinfo[name] = statetype + + # Get all of the symbols with a t_ prefix and sort them into various + # categories (functions, strings, error functions, and ignore characters) + + def get_rules(self): + tsymbols = [f for f in self.ldict if f[:2] == 't_'] + + # Now build up a list of functions and a list of strings + self.toknames = {} # Mapping of symbols to token names + self.funcsym = {} # Symbols defined as functions + self.strsym = {} # Symbols defined as strings + self.ignore = {} # Ignore strings by state + self.errorf = {} # Error functions by state + self.eoff = {} # EOF functions by state + + for s in self.stateinfo: + self.funcsym[s] = [] + self.strsym[s] = [] + + if len(tsymbols) == 0: + self.log.error('No rules of the form t_rulename are defined') + self.error = True + return + + for f in tsymbols: + t = self.ldict[f] + states, tokname = _statetoken(f, self.stateinfo) + self.toknames[f] = tokname + + if hasattr(t, '__call__'): + if tokname == 'error': + for s in states: + self.errorf[s] = t + elif tokname == 'eof': + for s in states: + self.eoff[s] = t + elif tokname == 'ignore': + line = t.__code__.co_firstlineno + file = t.__code__.co_filename + self.log.error("%s:%d: Rule '%s' must be defined as a string", file, line, t.__name__) + self.error = True + else: + for s in states: + self.funcsym[s].append((f, t)) + elif isinstance(t, StringTypes): + if tokname == 'ignore': + for s in states: + self.ignore[s] = t + if '\\' in t: + self.log.warning("%s contains a literal backslash '\\'", f) + + elif tokname == 'error': + self.log.error("Rule '%s' must be defined as a function", f) + self.error = True + else: + for s in states: + self.strsym[s].append((f, t)) + else: + self.log.error('%s not defined as a function or string', f) + self.error = True + + # Sort the functions by line number + for f in self.funcsym.values(): + f.sort(key=lambda x: x[1].__code__.co_firstlineno) + + # Sort the strings by regular expression length + for s in self.strsym.values(): + s.sort(key=lambda x: len(x[1]), reverse=True) + + # Validate all of the t_rules collected + def validate_rules(self): + for state in self.stateinfo: + # Validate all rules defined by functions + + for fname, f in self.funcsym[state]: + line = f.__code__.co_firstlineno + file = f.__code__.co_filename + module = inspect.getmodule(f) + self.modules.add(module) + + tokname = self.toknames[fname] + if isinstance(f, types.MethodType): + reqargs = 2 + else: + reqargs = 1 + nargs = f.__code__.co_argcount + if nargs > reqargs: + self.log.error("%s:%d: Rule '%s' has too many arguments", file, line, f.__name__) + self.error = True + continue + + if nargs < reqargs: + self.log.error("%s:%d: Rule '%s' requires an argument", file, line, f.__name__) + self.error = True + continue + + if not _get_regex(f): + self.log.error("%s:%d: No regular expression defined for rule '%s'", file, line, f.__name__) + self.error = True + continue + + try: + c = re.compile('(?P<%s>%s)' % (fname, _get_regex(f)), self.reflags) + if c.match(''): + self.log.error("%s:%d: Regular expression for rule '%s' matches empty string", file, line, f.__name__) + self.error = True + except re.error as e: + self.log.error("%s:%d: Invalid regular expression for rule '%s'. %s", file, line, f.__name__, e) + if '#' in _get_regex(f): + self.log.error("%s:%d. Make sure '#' in rule '%s' is escaped with '\\#'", file, line, f.__name__) + self.error = True + + # Validate all rules defined by strings + for name, r in self.strsym[state]: + tokname = self.toknames[name] + if tokname == 'error': + self.log.error("Rule '%s' must be defined as a function", name) + self.error = True + continue + + if tokname not in self.tokens and tokname.find('ignore_') < 0: + self.log.error("Rule '%s' defined for an unspecified token %s", name, tokname) + self.error = True + continue + + try: + c = re.compile('(?P<%s>%s)' % (name, r), self.reflags) + if (c.match('')): + self.log.error("Regular expression for rule '%s' matches empty string", name) + self.error = True + except re.error as e: + self.log.error("Invalid regular expression for rule '%s'. %s", name, e) + if '#' in r: + self.log.error("Make sure '#' in rule '%s' is escaped with '\\#'", name) + self.error = True + + if not self.funcsym[state] and not self.strsym[state]: + self.log.error("No rules defined for state '%s'", state) + self.error = True + + # Validate the error function + efunc = self.errorf.get(state, None) + if efunc: + f = efunc + line = f.__code__.co_firstlineno + file = f.__code__.co_filename + module = inspect.getmodule(f) + self.modules.add(module) + + if isinstance(f, types.MethodType): + reqargs = 2 + else: + reqargs = 1 + nargs = f.__code__.co_argcount + if nargs > reqargs: + self.log.error("%s:%d: Rule '%s' has too many arguments", file, line, f.__name__) + self.error = True + + if nargs < reqargs: + self.log.error("%s:%d: Rule '%s' requires an argument", file, line, f.__name__) + self.error = True + + for module in self.modules: + self.validate_module(module) + + # ----------------------------------------------------------------------------- + # validate_module() + # + # This checks to see if there are duplicated t_rulename() functions or strings + # in the parser input file. This is done using a simple regular expression + # match on each line in the source code of the given module. + # ----------------------------------------------------------------------------- + + def validate_module(self, module): + try: + lines, linen = inspect.getsourcelines(module) + except IOError: + return + + fre = re.compile(r'\s*def\s+(t_[a-zA-Z_0-9]*)\(') + sre = re.compile(r'\s*(t_[a-zA-Z_0-9]*)\s*=') + + counthash = {} + linen += 1 + for line in lines: + m = fre.match(line) + if not m: + m = sre.match(line) + if m: + name = m.group(1) + prev = counthash.get(name) + if not prev: + counthash[name] = linen + else: + filename = inspect.getsourcefile(module) + self.log.error('%s:%d: Rule %s redefined. Previously defined on line %d', filename, linen, name, prev) + self.error = True + linen += 1 + +# ----------------------------------------------------------------------------- +# lex(module) +# +# Build all of the regular expression rules from definitions in the supplied module +# ----------------------------------------------------------------------------- +def lex(module=None, object=None, debug=False, optimize=False, lextab='lextab', + reflags=int(re.VERBOSE), nowarn=False, outputdir=None, debuglog=None, errorlog=None): + + if lextab is None: + lextab = 'lextab' + + global lexer + + ldict = None + stateinfo = {'INITIAL': 'inclusive'} + lexobj = Lexer() + lexobj.lexoptimize = optimize + global token, input + + if errorlog is None: + errorlog = PlyLogger(sys.stderr) + + if debug: + if debuglog is None: + debuglog = PlyLogger(sys.stderr) + + # Get the module dictionary used for the lexer + if object: + module = object + + # Get the module dictionary used for the parser + if module: + _items = [(k, getattr(module, k)) for k in dir(module)] + ldict = dict(_items) + # If no __file__ attribute is available, try to obtain it from the __module__ instead + if '__file__' not in ldict: + ldict['__file__'] = sys.modules[ldict['__module__']].__file__ + else: + ldict = get_caller_module_dict(2) + + # Determine if the module is package of a package or not. + # If so, fix the tabmodule setting so that tables load correctly + pkg = ldict.get('__package__') + if pkg and isinstance(lextab, str): + if '.' not in lextab: + lextab = pkg + '.' + lextab + + # Collect parser information from the dictionary + linfo = LexerReflect(ldict, log=errorlog, reflags=reflags) + linfo.get_all() + if not optimize: + if linfo.validate_all(): + raise SyntaxError("Can't build lexer") + + if optimize and lextab: + try: + lexobj.readtab(lextab, ldict) + token = lexobj.token + input = lexobj.input + lexer = lexobj + return lexobj + + except ImportError: + pass + + # Dump some basic debugging information + if debug: + debuglog.info('lex: tokens = %r', linfo.tokens) + debuglog.info('lex: literals = %r', linfo.literals) + debuglog.info('lex: states = %r', linfo.stateinfo) + + # Build a dictionary of valid token names + lexobj.lextokens = set() + for n in linfo.tokens: + lexobj.lextokens.add(n) + + # Get literals specification + if isinstance(linfo.literals, (list, tuple)): + lexobj.lexliterals = type(linfo.literals[0])().join(linfo.literals) + else: + lexobj.lexliterals = linfo.literals + + lexobj.lextokens_all = lexobj.lextokens | set(lexobj.lexliterals) + + # Get the stateinfo dictionary + stateinfo = linfo.stateinfo + + regexs = {} + # Build the master regular expressions + for state in stateinfo: + regex_list = [] + + # Add rules defined by functions first + for fname, f in linfo.funcsym[state]: + line = f.__code__.co_firstlineno + file = f.__code__.co_filename + regex_list.append('(?P<%s>%s)' % (fname, _get_regex(f))) + if debug: + debuglog.info("lex: Adding rule %s -> '%s' (state '%s')", fname, _get_regex(f), state) + + # Now add all of the simple rules + for name, r in linfo.strsym[state]: + regex_list.append('(?P<%s>%s)' % (name, r)) + if debug: + debuglog.info("lex: Adding rule %s -> '%s' (state '%s')", name, r, state) + + regexs[state] = regex_list + + # Build the master regular expressions + + if debug: + debuglog.info('lex: ==== MASTER REGEXS FOLLOW ====') + + for state in regexs: + lexre, re_text, re_names = _form_master_re(regexs[state], reflags, ldict, linfo.toknames) + lexobj.lexstatere[state] = lexre + lexobj.lexstateretext[state] = re_text + lexobj.lexstaterenames[state] = re_names + if debug: + for i, text in enumerate(re_text): + debuglog.info("lex: state '%s' : regex[%d] = '%s'", state, i, text) + + # For inclusive states, we need to add the regular expressions from the INITIAL state + for state, stype in stateinfo.items(): + if state != 'INITIAL' and stype == 'inclusive': + lexobj.lexstatere[state].extend(lexobj.lexstatere['INITIAL']) + lexobj.lexstateretext[state].extend(lexobj.lexstateretext['INITIAL']) + lexobj.lexstaterenames[state].extend(lexobj.lexstaterenames['INITIAL']) + + lexobj.lexstateinfo = stateinfo + lexobj.lexre = lexobj.lexstatere['INITIAL'] + lexobj.lexretext = lexobj.lexstateretext['INITIAL'] + lexobj.lexreflags = reflags + + # Set up ignore variables + lexobj.lexstateignore = linfo.ignore + lexobj.lexignore = lexobj.lexstateignore.get('INITIAL', '') + + # Set up error functions + lexobj.lexstateerrorf = linfo.errorf + lexobj.lexerrorf = linfo.errorf.get('INITIAL', None) + if not lexobj.lexerrorf: + errorlog.warning('No t_error rule is defined') + + # Set up eof functions + lexobj.lexstateeoff = linfo.eoff + lexobj.lexeoff = linfo.eoff.get('INITIAL', None) + + # Check state information for ignore and error rules + for s, stype in stateinfo.items(): + if stype == 'exclusive': + if s not in linfo.errorf: + errorlog.warning("No error rule is defined for exclusive state '%s'", s) + if s not in linfo.ignore and lexobj.lexignore: + errorlog.warning("No ignore rule is defined for exclusive state '%s'", s) + elif stype == 'inclusive': + if s not in linfo.errorf: + linfo.errorf[s] = linfo.errorf.get('INITIAL', None) + if s not in linfo.ignore: + linfo.ignore[s] = linfo.ignore.get('INITIAL', '') + + # Create global versions of the token() and input() functions + token = lexobj.token + input = lexobj.input + lexer = lexobj + + # If in optimize mode, we write the lextab + if lextab and optimize: + if outputdir is None: + # If no output directory is set, the location of the output files + # is determined according to the following rules: + # - If lextab specifies a package, files go into that package directory + # - Otherwise, files go in the same directory as the specifying module + if isinstance(lextab, types.ModuleType): + srcfile = lextab.__file__ + else: + if '.' not in lextab: + srcfile = ldict['__file__'] + else: + parts = lextab.split('.') + pkgname = '.'.join(parts[:-1]) + exec('import %s' % pkgname) + srcfile = getattr(sys.modules[pkgname], '__file__', '') + outputdir = os.path.dirname(srcfile) + try: + lexobj.writetab(lextab, outputdir) + except IOError as e: + errorlog.warning("Couldn't write lextab module %r. %s" % (lextab, e)) + + return lexobj + +# ----------------------------------------------------------------------------- +# runmain() +# +# This runs the lexer as a main program +# ----------------------------------------------------------------------------- + +def runmain(lexer=None, data=None): + if not data: + try: + filename = sys.argv[1] + f = open(filename) + data = f.read() + f.close() + except IndexError: + sys.stdout.write('Reading from standard input (type EOF to end):\n') + data = sys.stdin.read() + + if lexer: + _input = lexer.input + else: + _input = input + _input(data) + if lexer: + _token = lexer.token + else: + _token = token + + while True: + tok = _token() + if not tok: + break + sys.stdout.write('(%s,%r,%d,%d)\n' % (tok.type, tok.value, tok.lineno, tok.lexpos)) + +# ----------------------------------------------------------------------------- +# @TOKEN(regex) +# +# This decorator function can be used to set the regex expression on a function +# when its docstring might need to be set in an alternative way +# ----------------------------------------------------------------------------- + +def TOKEN(r): + def set_regex(f): + if hasattr(r, '__call__'): + f.regex = _get_regex(r) + else: + f.regex = r + return f + return set_regex + +# Alternative spelling of the TOKEN decorator +Token = TOKEN diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pycparser/ply/yacc.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pycparser/ply/yacc.py new file mode 100644 index 00000000..20b4f286 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pycparser/ply/yacc.py @@ -0,0 +1,3494 @@ +# ----------------------------------------------------------------------------- +# ply: yacc.py +# +# Copyright (C) 2001-2017 +# David M. Beazley (Dabeaz LLC) +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# +# * Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of the David Beazley or Dabeaz LLC may be used to +# endorse or promote products derived from this software without +# specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# ----------------------------------------------------------------------------- +# +# This implements an LR parser that is constructed from grammar rules defined +# as Python functions. The grammer is specified by supplying the BNF inside +# Python documentation strings. The inspiration for this technique was borrowed +# from John Aycock's Spark parsing system. PLY might be viewed as cross between +# Spark and the GNU bison utility. +# +# The current implementation is only somewhat object-oriented. The +# LR parser itself is defined in terms of an object (which allows multiple +# parsers to co-exist). However, most of the variables used during table +# construction are defined in terms of global variables. Users shouldn't +# notice unless they are trying to define multiple parsers at the same +# time using threads (in which case they should have their head examined). +# +# This implementation supports both SLR and LALR(1) parsing. LALR(1) +# support was originally implemented by Elias Ioup (ezioup@alumni.uchicago.edu), +# using the algorithm found in Aho, Sethi, and Ullman "Compilers: Principles, +# Techniques, and Tools" (The Dragon Book). LALR(1) has since been replaced +# by the more efficient DeRemer and Pennello algorithm. +# +# :::::::: WARNING ::::::: +# +# Construction of LR parsing tables is fairly complicated and expensive. +# To make this module run fast, a *LOT* of work has been put into +# optimization---often at the expensive of readability and what might +# consider to be good Python "coding style." Modify the code at your +# own risk! +# ---------------------------------------------------------------------------- + +import re +import types +import sys +import os.path +import inspect +import base64 +import warnings + +__version__ = '3.10' +__tabversion__ = '3.10' + +#----------------------------------------------------------------------------- +# === User configurable parameters === +# +# Change these to modify the default behavior of yacc (if you wish) +#----------------------------------------------------------------------------- + +yaccdebug = True # Debugging mode. If set, yacc generates a + # a 'parser.out' file in the current directory + +debug_file = 'parser.out' # Default name of the debugging file +tab_module = 'parsetab' # Default name of the table module +default_lr = 'LALR' # Default LR table generation method + +error_count = 3 # Number of symbols that must be shifted to leave recovery mode + +yaccdevel = False # Set to True if developing yacc. This turns off optimized + # implementations of certain functions. + +resultlimit = 40 # Size limit of results when running in debug mode. + +pickle_protocol = 0 # Protocol to use when writing pickle files + +# String type-checking compatibility +if sys.version_info[0] < 3: + string_types = basestring +else: + string_types = str + +MAXINT = sys.maxsize + +# This object is a stand-in for a logging object created by the +# logging module. PLY will use this by default to create things +# such as the parser.out file. If a user wants more detailed +# information, they can create their own logging object and pass +# it into PLY. + +class PlyLogger(object): + def __init__(self, f): + self.f = f + + def debug(self, msg, *args, **kwargs): + self.f.write((msg % args) + '\n') + + info = debug + + def warning(self, msg, *args, **kwargs): + self.f.write('WARNING: ' + (msg % args) + '\n') + + def error(self, msg, *args, **kwargs): + self.f.write('ERROR: ' + (msg % args) + '\n') + + critical = debug + +# Null logger is used when no output is generated. Does nothing. +class NullLogger(object): + def __getattribute__(self, name): + return self + + def __call__(self, *args, **kwargs): + return self + +# Exception raised for yacc-related errors +class YaccError(Exception): + pass + +# Format the result message that the parser produces when running in debug mode. +def format_result(r): + repr_str = repr(r) + if '\n' in repr_str: + repr_str = repr(repr_str) + if len(repr_str) > resultlimit: + repr_str = repr_str[:resultlimit] + ' ...' + result = '<%s @ 0x%x> (%s)' % (type(r).__name__, id(r), repr_str) + return result + +# Format stack entries when the parser is running in debug mode +def format_stack_entry(r): + repr_str = repr(r) + if '\n' in repr_str: + repr_str = repr(repr_str) + if len(repr_str) < 16: + return repr_str + else: + return '<%s @ 0x%x>' % (type(r).__name__, id(r)) + +# Panic mode error recovery support. This feature is being reworked--much of the +# code here is to offer a deprecation/backwards compatible transition + +_errok = None +_token = None +_restart = None +_warnmsg = '''PLY: Don't use global functions errok(), token(), and restart() in p_error(). +Instead, invoke the methods on the associated parser instance: + + def p_error(p): + ... + # Use parser.errok(), parser.token(), parser.restart() + ... + + parser = yacc.yacc() +''' + +def errok(): + warnings.warn(_warnmsg) + return _errok() + +def restart(): + warnings.warn(_warnmsg) + return _restart() + +def token(): + warnings.warn(_warnmsg) + return _token() + +# Utility function to call the p_error() function with some deprecation hacks +def call_errorfunc(errorfunc, token, parser): + global _errok, _token, _restart + _errok = parser.errok + _token = parser.token + _restart = parser.restart + r = errorfunc(token) + try: + del _errok, _token, _restart + except NameError: + pass + return r + +#----------------------------------------------------------------------------- +# === LR Parsing Engine === +# +# The following classes are used for the LR parser itself. These are not +# used during table construction and are independent of the actual LR +# table generation algorithm +#----------------------------------------------------------------------------- + +# This class is used to hold non-terminal grammar symbols during parsing. +# It normally has the following attributes set: +# .type = Grammar symbol type +# .value = Symbol value +# .lineno = Starting line number +# .endlineno = Ending line number (optional, set automatically) +# .lexpos = Starting lex position +# .endlexpos = Ending lex position (optional, set automatically) + +class YaccSymbol: + def __str__(self): + return self.type + + def __repr__(self): + return str(self) + +# This class is a wrapper around the objects actually passed to each +# grammar rule. Index lookup and assignment actually assign the +# .value attribute of the underlying YaccSymbol object. +# The lineno() method returns the line number of a given +# item (or 0 if not defined). The linespan() method returns +# a tuple of (startline,endline) representing the range of lines +# for a symbol. The lexspan() method returns a tuple (lexpos,endlexpos) +# representing the range of positional information for a symbol. + +class YaccProduction: + def __init__(self, s, stack=None): + self.slice = s + self.stack = stack + self.lexer = None + self.parser = None + + def __getitem__(self, n): + if isinstance(n, slice): + return [s.value for s in self.slice[n]] + elif n >= 0: + return self.slice[n].value + else: + return self.stack[n].value + + def __setitem__(self, n, v): + self.slice[n].value = v + + def __getslice__(self, i, j): + return [s.value for s in self.slice[i:j]] + + def __len__(self): + return len(self.slice) + + def lineno(self, n): + return getattr(self.slice[n], 'lineno', 0) + + def set_lineno(self, n, lineno): + self.slice[n].lineno = lineno + + def linespan(self, n): + startline = getattr(self.slice[n], 'lineno', 0) + endline = getattr(self.slice[n], 'endlineno', startline) + return startline, endline + + def lexpos(self, n): + return getattr(self.slice[n], 'lexpos', 0) + + def lexspan(self, n): + startpos = getattr(self.slice[n], 'lexpos', 0) + endpos = getattr(self.slice[n], 'endlexpos', startpos) + return startpos, endpos + + def error(self): + raise SyntaxError + +# ----------------------------------------------------------------------------- +# == LRParser == +# +# The LR Parsing engine. +# ----------------------------------------------------------------------------- + +class LRParser: + def __init__(self, lrtab, errorf): + self.productions = lrtab.lr_productions + self.action = lrtab.lr_action + self.goto = lrtab.lr_goto + self.errorfunc = errorf + self.set_defaulted_states() + self.errorok = True + + def errok(self): + self.errorok = True + + def restart(self): + del self.statestack[:] + del self.symstack[:] + sym = YaccSymbol() + sym.type = '$end' + self.symstack.append(sym) + self.statestack.append(0) + + # Defaulted state support. + # This method identifies parser states where there is only one possible reduction action. + # For such states, the parser can make a choose to make a rule reduction without consuming + # the next look-ahead token. This delayed invocation of the tokenizer can be useful in + # certain kinds of advanced parsing situations where the lexer and parser interact with + # each other or change states (i.e., manipulation of scope, lexer states, etc.). + # + # See: https://www.gnu.org/software/bison/manual/html_node/Default-Reductions.html#Default-Reductions + def set_defaulted_states(self): + self.defaulted_states = {} + for state, actions in self.action.items(): + rules = list(actions.values()) + if len(rules) == 1 and rules[0] < 0: + self.defaulted_states[state] = rules[0] + + def disable_defaulted_states(self): + self.defaulted_states = {} + + def parse(self, input=None, lexer=None, debug=False, tracking=False, tokenfunc=None): + if debug or yaccdevel: + if isinstance(debug, int): + debug = PlyLogger(sys.stderr) + return self.parsedebug(input, lexer, debug, tracking, tokenfunc) + elif tracking: + return self.parseopt(input, lexer, debug, tracking, tokenfunc) + else: + return self.parseopt_notrack(input, lexer, debug, tracking, tokenfunc) + + + # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + # parsedebug(). + # + # This is the debugging enabled version of parse(). All changes made to the + # parsing engine should be made here. Optimized versions of this function + # are automatically created by the ply/ygen.py script. This script cuts out + # sections enclosed in markers such as this: + # + # #--! DEBUG + # statements + # #--! DEBUG + # + # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + + def parsedebug(self, input=None, lexer=None, debug=False, tracking=False, tokenfunc=None): + #--! parsedebug-start + lookahead = None # Current lookahead symbol + lookaheadstack = [] # Stack of lookahead symbols + actions = self.action # Local reference to action table (to avoid lookup on self.) + goto = self.goto # Local reference to goto table (to avoid lookup on self.) + prod = self.productions # Local reference to production list (to avoid lookup on self.) + defaulted_states = self.defaulted_states # Local reference to defaulted states + pslice = YaccProduction(None) # Production object passed to grammar rules + errorcount = 0 # Used during error recovery + + #--! DEBUG + debug.info('PLY: PARSE DEBUG START') + #--! DEBUG + + # If no lexer was given, we will try to use the lex module + if not lexer: + from . import lex + lexer = lex.lexer + + # Set up the lexer and parser objects on pslice + pslice.lexer = lexer + pslice.parser = self + + # If input was supplied, pass to lexer + if input is not None: + lexer.input(input) + + if tokenfunc is None: + # Tokenize function + get_token = lexer.token + else: + get_token = tokenfunc + + # Set the parser() token method (sometimes used in error recovery) + self.token = get_token + + # Set up the state and symbol stacks + + statestack = [] # Stack of parsing states + self.statestack = statestack + symstack = [] # Stack of grammar symbols + self.symstack = symstack + + pslice.stack = symstack # Put in the production + errtoken = None # Err token + + # The start state is assumed to be (0,$end) + + statestack.append(0) + sym = YaccSymbol() + sym.type = '$end' + symstack.append(sym) + state = 0 + while True: + # Get the next symbol on the input. If a lookahead symbol + # is already set, we just use that. Otherwise, we'll pull + # the next token off of the lookaheadstack or from the lexer + + #--! DEBUG + debug.debug('') + debug.debug('State : %s', state) + #--! DEBUG + + if state not in defaulted_states: + if not lookahead: + if not lookaheadstack: + lookahead = get_token() # Get the next token + else: + lookahead = lookaheadstack.pop() + if not lookahead: + lookahead = YaccSymbol() + lookahead.type = '$end' + + # Check the action table + ltype = lookahead.type + t = actions[state].get(ltype) + else: + t = defaulted_states[state] + #--! DEBUG + debug.debug('Defaulted state %s: Reduce using %d', state, -t) + #--! DEBUG + + #--! DEBUG + debug.debug('Stack : %s', + ('%s . %s' % (' '.join([xx.type for xx in symstack][1:]), str(lookahead))).lstrip()) + #--! DEBUG + + if t is not None: + if t > 0: + # shift a symbol on the stack + statestack.append(t) + state = t + + #--! DEBUG + debug.debug('Action : Shift and goto state %s', t) + #--! DEBUG + + symstack.append(lookahead) + lookahead = None + + # Decrease error count on successful shift + if errorcount: + errorcount -= 1 + continue + + if t < 0: + # reduce a symbol on the stack, emit a production + p = prod[-t] + pname = p.name + plen = p.len + + # Get production function + sym = YaccSymbol() + sym.type = pname # Production name + sym.value = None + + #--! DEBUG + if plen: + debug.info('Action : Reduce rule [%s] with %s and goto state %d', p.str, + '['+','.join([format_stack_entry(_v.value) for _v in symstack[-plen:]])+']', + goto[statestack[-1-plen]][pname]) + else: + debug.info('Action : Reduce rule [%s] with %s and goto state %d', p.str, [], + goto[statestack[-1]][pname]) + + #--! DEBUG + + if plen: + targ = symstack[-plen-1:] + targ[0] = sym + + #--! TRACKING + if tracking: + t1 = targ[1] + sym.lineno = t1.lineno + sym.lexpos = t1.lexpos + t1 = targ[-1] + sym.endlineno = getattr(t1, 'endlineno', t1.lineno) + sym.endlexpos = getattr(t1, 'endlexpos', t1.lexpos) + #--! TRACKING + + # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + # The code enclosed in this section is duplicated + # below as a performance optimization. Make sure + # changes get made in both locations. + + pslice.slice = targ + + try: + # Call the grammar rule with our special slice object + del symstack[-plen:] + self.state = state + p.callable(pslice) + del statestack[-plen:] + #--! DEBUG + debug.info('Result : %s', format_result(pslice[0])) + #--! DEBUG + symstack.append(sym) + state = goto[statestack[-1]][pname] + statestack.append(state) + except SyntaxError: + # If an error was set. Enter error recovery state + lookaheadstack.append(lookahead) # Save the current lookahead token + symstack.extend(targ[1:-1]) # Put the production slice back on the stack + statestack.pop() # Pop back one state (before the reduce) + state = statestack[-1] + sym.type = 'error' + sym.value = 'error' + lookahead = sym + errorcount = error_count + self.errorok = False + + continue + # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + + else: + + #--! TRACKING + if tracking: + sym.lineno = lexer.lineno + sym.lexpos = lexer.lexpos + #--! TRACKING + + targ = [sym] + + # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + # The code enclosed in this section is duplicated + # above as a performance optimization. Make sure + # changes get made in both locations. + + pslice.slice = targ + + try: + # Call the grammar rule with our special slice object + self.state = state + p.callable(pslice) + #--! DEBUG + debug.info('Result : %s', format_result(pslice[0])) + #--! DEBUG + symstack.append(sym) + state = goto[statestack[-1]][pname] + statestack.append(state) + except SyntaxError: + # If an error was set. Enter error recovery state + lookaheadstack.append(lookahead) # Save the current lookahead token + statestack.pop() # Pop back one state (before the reduce) + state = statestack[-1] + sym.type = 'error' + sym.value = 'error' + lookahead = sym + errorcount = error_count + self.errorok = False + + continue + # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + + if t == 0: + n = symstack[-1] + result = getattr(n, 'value', None) + #--! DEBUG + debug.info('Done : Returning %s', format_result(result)) + debug.info('PLY: PARSE DEBUG END') + #--! DEBUG + return result + + if t is None: + + #--! DEBUG + debug.error('Error : %s', + ('%s . %s' % (' '.join([xx.type for xx in symstack][1:]), str(lookahead))).lstrip()) + #--! DEBUG + + # We have some kind of parsing error here. To handle + # this, we are going to push the current token onto + # the tokenstack and replace it with an 'error' token. + # If there are any synchronization rules, they may + # catch it. + # + # In addition to pushing the error token, we call call + # the user defined p_error() function if this is the + # first syntax error. This function is only called if + # errorcount == 0. + if errorcount == 0 or self.errorok: + errorcount = error_count + self.errorok = False + errtoken = lookahead + if errtoken.type == '$end': + errtoken = None # End of file! + if self.errorfunc: + if errtoken and not hasattr(errtoken, 'lexer'): + errtoken.lexer = lexer + self.state = state + tok = call_errorfunc(self.errorfunc, errtoken, self) + if self.errorok: + # User must have done some kind of panic + # mode recovery on their own. The + # returned token is the next lookahead + lookahead = tok + errtoken = None + continue + else: + if errtoken: + if hasattr(errtoken, 'lineno'): + lineno = lookahead.lineno + else: + lineno = 0 + if lineno: + sys.stderr.write('yacc: Syntax error at line %d, token=%s\n' % (lineno, errtoken.type)) + else: + sys.stderr.write('yacc: Syntax error, token=%s' % errtoken.type) + else: + sys.stderr.write('yacc: Parse error in input. EOF\n') + return + + else: + errorcount = error_count + + # case 1: the statestack only has 1 entry on it. If we're in this state, the + # entire parse has been rolled back and we're completely hosed. The token is + # discarded and we just keep going. + + if len(statestack) <= 1 and lookahead.type != '$end': + lookahead = None + errtoken = None + state = 0 + # Nuke the pushback stack + del lookaheadstack[:] + continue + + # case 2: the statestack has a couple of entries on it, but we're + # at the end of the file. nuke the top entry and generate an error token + + # Start nuking entries on the stack + if lookahead.type == '$end': + # Whoa. We're really hosed here. Bail out + return + + if lookahead.type != 'error': + sym = symstack[-1] + if sym.type == 'error': + # Hmmm. Error is on top of stack, we'll just nuke input + # symbol and continue + #--! TRACKING + if tracking: + sym.endlineno = getattr(lookahead, 'lineno', sym.lineno) + sym.endlexpos = getattr(lookahead, 'lexpos', sym.lexpos) + #--! TRACKING + lookahead = None + continue + + # Create the error symbol for the first time and make it the new lookahead symbol + t = YaccSymbol() + t.type = 'error' + + if hasattr(lookahead, 'lineno'): + t.lineno = t.endlineno = lookahead.lineno + if hasattr(lookahead, 'lexpos'): + t.lexpos = t.endlexpos = lookahead.lexpos + t.value = lookahead + lookaheadstack.append(lookahead) + lookahead = t + else: + sym = symstack.pop() + #--! TRACKING + if tracking: + lookahead.lineno = sym.lineno + lookahead.lexpos = sym.lexpos + #--! TRACKING + statestack.pop() + state = statestack[-1] + + continue + + # Call an error function here + raise RuntimeError('yacc: internal parser error!!!\n') + + #--! parsedebug-end + + # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + # parseopt(). + # + # Optimized version of parse() method. DO NOT EDIT THIS CODE DIRECTLY! + # This code is automatically generated by the ply/ygen.py script. Make + # changes to the parsedebug() method instead. + # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + + def parseopt(self, input=None, lexer=None, debug=False, tracking=False, tokenfunc=None): + #--! parseopt-start + lookahead = None # Current lookahead symbol + lookaheadstack = [] # Stack of lookahead symbols + actions = self.action # Local reference to action table (to avoid lookup on self.) + goto = self.goto # Local reference to goto table (to avoid lookup on self.) + prod = self.productions # Local reference to production list (to avoid lookup on self.) + defaulted_states = self.defaulted_states # Local reference to defaulted states + pslice = YaccProduction(None) # Production object passed to grammar rules + errorcount = 0 # Used during error recovery + + + # If no lexer was given, we will try to use the lex module + if not lexer: + from . import lex + lexer = lex.lexer + + # Set up the lexer and parser objects on pslice + pslice.lexer = lexer + pslice.parser = self + + # If input was supplied, pass to lexer + if input is not None: + lexer.input(input) + + if tokenfunc is None: + # Tokenize function + get_token = lexer.token + else: + get_token = tokenfunc + + # Set the parser() token method (sometimes used in error recovery) + self.token = get_token + + # Set up the state and symbol stacks + + statestack = [] # Stack of parsing states + self.statestack = statestack + symstack = [] # Stack of grammar symbols + self.symstack = symstack + + pslice.stack = symstack # Put in the production + errtoken = None # Err token + + # The start state is assumed to be (0,$end) + + statestack.append(0) + sym = YaccSymbol() + sym.type = '$end' + symstack.append(sym) + state = 0 + while True: + # Get the next symbol on the input. If a lookahead symbol + # is already set, we just use that. Otherwise, we'll pull + # the next token off of the lookaheadstack or from the lexer + + + if state not in defaulted_states: + if not lookahead: + if not lookaheadstack: + lookahead = get_token() # Get the next token + else: + lookahead = lookaheadstack.pop() + if not lookahead: + lookahead = YaccSymbol() + lookahead.type = '$end' + + # Check the action table + ltype = lookahead.type + t = actions[state].get(ltype) + else: + t = defaulted_states[state] + + + if t is not None: + if t > 0: + # shift a symbol on the stack + statestack.append(t) + state = t + + + symstack.append(lookahead) + lookahead = None + + # Decrease error count on successful shift + if errorcount: + errorcount -= 1 + continue + + if t < 0: + # reduce a symbol on the stack, emit a production + p = prod[-t] + pname = p.name + plen = p.len + + # Get production function + sym = YaccSymbol() + sym.type = pname # Production name + sym.value = None + + + if plen: + targ = symstack[-plen-1:] + targ[0] = sym + + #--! TRACKING + if tracking: + t1 = targ[1] + sym.lineno = t1.lineno + sym.lexpos = t1.lexpos + t1 = targ[-1] + sym.endlineno = getattr(t1, 'endlineno', t1.lineno) + sym.endlexpos = getattr(t1, 'endlexpos', t1.lexpos) + #--! TRACKING + + # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + # The code enclosed in this section is duplicated + # below as a performance optimization. Make sure + # changes get made in both locations. + + pslice.slice = targ + + try: + # Call the grammar rule with our special slice object + del symstack[-plen:] + self.state = state + p.callable(pslice) + del statestack[-plen:] + symstack.append(sym) + state = goto[statestack[-1]][pname] + statestack.append(state) + except SyntaxError: + # If an error was set. Enter error recovery state + lookaheadstack.append(lookahead) # Save the current lookahead token + symstack.extend(targ[1:-1]) # Put the production slice back on the stack + statestack.pop() # Pop back one state (before the reduce) + state = statestack[-1] + sym.type = 'error' + sym.value = 'error' + lookahead = sym + errorcount = error_count + self.errorok = False + + continue + # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + + else: + + #--! TRACKING + if tracking: + sym.lineno = lexer.lineno + sym.lexpos = lexer.lexpos + #--! TRACKING + + targ = [sym] + + # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + # The code enclosed in this section is duplicated + # above as a performance optimization. Make sure + # changes get made in both locations. + + pslice.slice = targ + + try: + # Call the grammar rule with our special slice object + self.state = state + p.callable(pslice) + symstack.append(sym) + state = goto[statestack[-1]][pname] + statestack.append(state) + except SyntaxError: + # If an error was set. Enter error recovery state + lookaheadstack.append(lookahead) # Save the current lookahead token + statestack.pop() # Pop back one state (before the reduce) + state = statestack[-1] + sym.type = 'error' + sym.value = 'error' + lookahead = sym + errorcount = error_count + self.errorok = False + + continue + # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + + if t == 0: + n = symstack[-1] + result = getattr(n, 'value', None) + return result + + if t is None: + + + # We have some kind of parsing error here. To handle + # this, we are going to push the current token onto + # the tokenstack and replace it with an 'error' token. + # If there are any synchronization rules, they may + # catch it. + # + # In addition to pushing the error token, we call call + # the user defined p_error() function if this is the + # first syntax error. This function is only called if + # errorcount == 0. + if errorcount == 0 or self.errorok: + errorcount = error_count + self.errorok = False + errtoken = lookahead + if errtoken.type == '$end': + errtoken = None # End of file! + if self.errorfunc: + if errtoken and not hasattr(errtoken, 'lexer'): + errtoken.lexer = lexer + self.state = state + tok = call_errorfunc(self.errorfunc, errtoken, self) + if self.errorok: + # User must have done some kind of panic + # mode recovery on their own. The + # returned token is the next lookahead + lookahead = tok + errtoken = None + continue + else: + if errtoken: + if hasattr(errtoken, 'lineno'): + lineno = lookahead.lineno + else: + lineno = 0 + if lineno: + sys.stderr.write('yacc: Syntax error at line %d, token=%s\n' % (lineno, errtoken.type)) + else: + sys.stderr.write('yacc: Syntax error, token=%s' % errtoken.type) + else: + sys.stderr.write('yacc: Parse error in input. EOF\n') + return + + else: + errorcount = error_count + + # case 1: the statestack only has 1 entry on it. If we're in this state, the + # entire parse has been rolled back and we're completely hosed. The token is + # discarded and we just keep going. + + if len(statestack) <= 1 and lookahead.type != '$end': + lookahead = None + errtoken = None + state = 0 + # Nuke the pushback stack + del lookaheadstack[:] + continue + + # case 2: the statestack has a couple of entries on it, but we're + # at the end of the file. nuke the top entry and generate an error token + + # Start nuking entries on the stack + if lookahead.type == '$end': + # Whoa. We're really hosed here. Bail out + return + + if lookahead.type != 'error': + sym = symstack[-1] + if sym.type == 'error': + # Hmmm. Error is on top of stack, we'll just nuke input + # symbol and continue + #--! TRACKING + if tracking: + sym.endlineno = getattr(lookahead, 'lineno', sym.lineno) + sym.endlexpos = getattr(lookahead, 'lexpos', sym.lexpos) + #--! TRACKING + lookahead = None + continue + + # Create the error symbol for the first time and make it the new lookahead symbol + t = YaccSymbol() + t.type = 'error' + + if hasattr(lookahead, 'lineno'): + t.lineno = t.endlineno = lookahead.lineno + if hasattr(lookahead, 'lexpos'): + t.lexpos = t.endlexpos = lookahead.lexpos + t.value = lookahead + lookaheadstack.append(lookahead) + lookahead = t + else: + sym = symstack.pop() + #--! TRACKING + if tracking: + lookahead.lineno = sym.lineno + lookahead.lexpos = sym.lexpos + #--! TRACKING + statestack.pop() + state = statestack[-1] + + continue + + # Call an error function here + raise RuntimeError('yacc: internal parser error!!!\n') + + #--! parseopt-end + + # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + # parseopt_notrack(). + # + # Optimized version of parseopt() with line number tracking removed. + # DO NOT EDIT THIS CODE DIRECTLY. This code is automatically generated + # by the ply/ygen.py script. Make changes to the parsedebug() method instead. + # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + + def parseopt_notrack(self, input=None, lexer=None, debug=False, tracking=False, tokenfunc=None): + #--! parseopt-notrack-start + lookahead = None # Current lookahead symbol + lookaheadstack = [] # Stack of lookahead symbols + actions = self.action # Local reference to action table (to avoid lookup on self.) + goto = self.goto # Local reference to goto table (to avoid lookup on self.) + prod = self.productions # Local reference to production list (to avoid lookup on self.) + defaulted_states = self.defaulted_states # Local reference to defaulted states + pslice = YaccProduction(None) # Production object passed to grammar rules + errorcount = 0 # Used during error recovery + + + # If no lexer was given, we will try to use the lex module + if not lexer: + from . import lex + lexer = lex.lexer + + # Set up the lexer and parser objects on pslice + pslice.lexer = lexer + pslice.parser = self + + # If input was supplied, pass to lexer + if input is not None: + lexer.input(input) + + if tokenfunc is None: + # Tokenize function + get_token = lexer.token + else: + get_token = tokenfunc + + # Set the parser() token method (sometimes used in error recovery) + self.token = get_token + + # Set up the state and symbol stacks + + statestack = [] # Stack of parsing states + self.statestack = statestack + symstack = [] # Stack of grammar symbols + self.symstack = symstack + + pslice.stack = symstack # Put in the production + errtoken = None # Err token + + # The start state is assumed to be (0,$end) + + statestack.append(0) + sym = YaccSymbol() + sym.type = '$end' + symstack.append(sym) + state = 0 + while True: + # Get the next symbol on the input. If a lookahead symbol + # is already set, we just use that. Otherwise, we'll pull + # the next token off of the lookaheadstack or from the lexer + + + if state not in defaulted_states: + if not lookahead: + if not lookaheadstack: + lookahead = get_token() # Get the next token + else: + lookahead = lookaheadstack.pop() + if not lookahead: + lookahead = YaccSymbol() + lookahead.type = '$end' + + # Check the action table + ltype = lookahead.type + t = actions[state].get(ltype) + else: + t = defaulted_states[state] + + + if t is not None: + if t > 0: + # shift a symbol on the stack + statestack.append(t) + state = t + + + symstack.append(lookahead) + lookahead = None + + # Decrease error count on successful shift + if errorcount: + errorcount -= 1 + continue + + if t < 0: + # reduce a symbol on the stack, emit a production + p = prod[-t] + pname = p.name + plen = p.len + + # Get production function + sym = YaccSymbol() + sym.type = pname # Production name + sym.value = None + + + if plen: + targ = symstack[-plen-1:] + targ[0] = sym + + + # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + # The code enclosed in this section is duplicated + # below as a performance optimization. Make sure + # changes get made in both locations. + + pslice.slice = targ + + try: + # Call the grammar rule with our special slice object + del symstack[-plen:] + self.state = state + p.callable(pslice) + del statestack[-plen:] + symstack.append(sym) + state = goto[statestack[-1]][pname] + statestack.append(state) + except SyntaxError: + # If an error was set. Enter error recovery state + lookaheadstack.append(lookahead) # Save the current lookahead token + symstack.extend(targ[1:-1]) # Put the production slice back on the stack + statestack.pop() # Pop back one state (before the reduce) + state = statestack[-1] + sym.type = 'error' + sym.value = 'error' + lookahead = sym + errorcount = error_count + self.errorok = False + + continue + # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + + else: + + + targ = [sym] + + # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + # The code enclosed in this section is duplicated + # above as a performance optimization. Make sure + # changes get made in both locations. + + pslice.slice = targ + + try: + # Call the grammar rule with our special slice object + self.state = state + p.callable(pslice) + symstack.append(sym) + state = goto[statestack[-1]][pname] + statestack.append(state) + except SyntaxError: + # If an error was set. Enter error recovery state + lookaheadstack.append(lookahead) # Save the current lookahead token + statestack.pop() # Pop back one state (before the reduce) + state = statestack[-1] + sym.type = 'error' + sym.value = 'error' + lookahead = sym + errorcount = error_count + self.errorok = False + + continue + # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + + if t == 0: + n = symstack[-1] + result = getattr(n, 'value', None) + return result + + if t is None: + + + # We have some kind of parsing error here. To handle + # this, we are going to push the current token onto + # the tokenstack and replace it with an 'error' token. + # If there are any synchronization rules, they may + # catch it. + # + # In addition to pushing the error token, we call call + # the user defined p_error() function if this is the + # first syntax error. This function is only called if + # errorcount == 0. + if errorcount == 0 or self.errorok: + errorcount = error_count + self.errorok = False + errtoken = lookahead + if errtoken.type == '$end': + errtoken = None # End of file! + if self.errorfunc: + if errtoken and not hasattr(errtoken, 'lexer'): + errtoken.lexer = lexer + self.state = state + tok = call_errorfunc(self.errorfunc, errtoken, self) + if self.errorok: + # User must have done some kind of panic + # mode recovery on their own. The + # returned token is the next lookahead + lookahead = tok + errtoken = None + continue + else: + if errtoken: + if hasattr(errtoken, 'lineno'): + lineno = lookahead.lineno + else: + lineno = 0 + if lineno: + sys.stderr.write('yacc: Syntax error at line %d, token=%s\n' % (lineno, errtoken.type)) + else: + sys.stderr.write('yacc: Syntax error, token=%s' % errtoken.type) + else: + sys.stderr.write('yacc: Parse error in input. EOF\n') + return + + else: + errorcount = error_count + + # case 1: the statestack only has 1 entry on it. If we're in this state, the + # entire parse has been rolled back and we're completely hosed. The token is + # discarded and we just keep going. + + if len(statestack) <= 1 and lookahead.type != '$end': + lookahead = None + errtoken = None + state = 0 + # Nuke the pushback stack + del lookaheadstack[:] + continue + + # case 2: the statestack has a couple of entries on it, but we're + # at the end of the file. nuke the top entry and generate an error token + + # Start nuking entries on the stack + if lookahead.type == '$end': + # Whoa. We're really hosed here. Bail out + return + + if lookahead.type != 'error': + sym = symstack[-1] + if sym.type == 'error': + # Hmmm. Error is on top of stack, we'll just nuke input + # symbol and continue + lookahead = None + continue + + # Create the error symbol for the first time and make it the new lookahead symbol + t = YaccSymbol() + t.type = 'error' + + if hasattr(lookahead, 'lineno'): + t.lineno = t.endlineno = lookahead.lineno + if hasattr(lookahead, 'lexpos'): + t.lexpos = t.endlexpos = lookahead.lexpos + t.value = lookahead + lookaheadstack.append(lookahead) + lookahead = t + else: + sym = symstack.pop() + statestack.pop() + state = statestack[-1] + + continue + + # Call an error function here + raise RuntimeError('yacc: internal parser error!!!\n') + + #--! parseopt-notrack-end + +# ----------------------------------------------------------------------------- +# === Grammar Representation === +# +# The following functions, classes, and variables are used to represent and +# manipulate the rules that make up a grammar. +# ----------------------------------------------------------------------------- + +# regex matching identifiers +_is_identifier = re.compile(r'^[a-zA-Z0-9_-]+$') + +# ----------------------------------------------------------------------------- +# class Production: +# +# This class stores the raw information about a single production or grammar rule. +# A grammar rule refers to a specification such as this: +# +# expr : expr PLUS term +# +# Here are the basic attributes defined on all productions +# +# name - Name of the production. For example 'expr' +# prod - A list of symbols on the right side ['expr','PLUS','term'] +# prec - Production precedence level +# number - Production number. +# func - Function that executes on reduce +# file - File where production function is defined +# lineno - Line number where production function is defined +# +# The following attributes are defined or optional. +# +# len - Length of the production (number of symbols on right hand side) +# usyms - Set of unique symbols found in the production +# ----------------------------------------------------------------------------- + +class Production(object): + reduced = 0 + def __init__(self, number, name, prod, precedence=('right', 0), func=None, file='', line=0): + self.name = name + self.prod = tuple(prod) + self.number = number + self.func = func + self.callable = None + self.file = file + self.line = line + self.prec = precedence + + # Internal settings used during table construction + + self.len = len(self.prod) # Length of the production + + # Create a list of unique production symbols used in the production + self.usyms = [] + for s in self.prod: + if s not in self.usyms: + self.usyms.append(s) + + # List of all LR items for the production + self.lr_items = [] + self.lr_next = None + + # Create a string representation + if self.prod: + self.str = '%s -> %s' % (self.name, ' '.join(self.prod)) + else: + self.str = '%s -> ' % self.name + + def __str__(self): + return self.str + + def __repr__(self): + return 'Production(' + str(self) + ')' + + def __len__(self): + return len(self.prod) + + def __nonzero__(self): + return 1 + + def __getitem__(self, index): + return self.prod[index] + + # Return the nth lr_item from the production (or None if at the end) + def lr_item(self, n): + if n > len(self.prod): + return None + p = LRItem(self, n) + # Precompute the list of productions immediately following. + try: + p.lr_after = Prodnames[p.prod[n+1]] + except (IndexError, KeyError): + p.lr_after = [] + try: + p.lr_before = p.prod[n-1] + except IndexError: + p.lr_before = None + return p + + # Bind the production function name to a callable + def bind(self, pdict): + if self.func: + self.callable = pdict[self.func] + +# This class serves as a minimal standin for Production objects when +# reading table data from files. It only contains information +# actually used by the LR parsing engine, plus some additional +# debugging information. +class MiniProduction(object): + def __init__(self, str, name, len, func, file, line): + self.name = name + self.len = len + self.func = func + self.callable = None + self.file = file + self.line = line + self.str = str + + def __str__(self): + return self.str + + def __repr__(self): + return 'MiniProduction(%s)' % self.str + + # Bind the production function name to a callable + def bind(self, pdict): + if self.func: + self.callable = pdict[self.func] + + +# ----------------------------------------------------------------------------- +# class LRItem +# +# This class represents a specific stage of parsing a production rule. For +# example: +# +# expr : expr . PLUS term +# +# In the above, the "." represents the current location of the parse. Here +# basic attributes: +# +# name - Name of the production. For example 'expr' +# prod - A list of symbols on the right side ['expr','.', 'PLUS','term'] +# number - Production number. +# +# lr_next Next LR item. Example, if we are ' expr -> expr . PLUS term' +# then lr_next refers to 'expr -> expr PLUS . term' +# lr_index - LR item index (location of the ".") in the prod list. +# lookaheads - LALR lookahead symbols for this item +# len - Length of the production (number of symbols on right hand side) +# lr_after - List of all productions that immediately follow +# lr_before - Grammar symbol immediately before +# ----------------------------------------------------------------------------- + +class LRItem(object): + def __init__(self, p, n): + self.name = p.name + self.prod = list(p.prod) + self.number = p.number + self.lr_index = n + self.lookaheads = {} + self.prod.insert(n, '.') + self.prod = tuple(self.prod) + self.len = len(self.prod) + self.usyms = p.usyms + + def __str__(self): + if self.prod: + s = '%s -> %s' % (self.name, ' '.join(self.prod)) + else: + s = '%s -> ' % self.name + return s + + def __repr__(self): + return 'LRItem(' + str(self) + ')' + +# ----------------------------------------------------------------------------- +# rightmost_terminal() +# +# Return the rightmost terminal from a list of symbols. Used in add_production() +# ----------------------------------------------------------------------------- +def rightmost_terminal(symbols, terminals): + i = len(symbols) - 1 + while i >= 0: + if symbols[i] in terminals: + return symbols[i] + i -= 1 + return None + +# ----------------------------------------------------------------------------- +# === GRAMMAR CLASS === +# +# The following class represents the contents of the specified grammar along +# with various computed properties such as first sets, follow sets, LR items, etc. +# This data is used for critical parts of the table generation process later. +# ----------------------------------------------------------------------------- + +class GrammarError(YaccError): + pass + +class Grammar(object): + def __init__(self, terminals): + self.Productions = [None] # A list of all of the productions. The first + # entry is always reserved for the purpose of + # building an augmented grammar + + self.Prodnames = {} # A dictionary mapping the names of nonterminals to a list of all + # productions of that nonterminal. + + self.Prodmap = {} # A dictionary that is only used to detect duplicate + # productions. + + self.Terminals = {} # A dictionary mapping the names of terminal symbols to a + # list of the rules where they are used. + + for term in terminals: + self.Terminals[term] = [] + + self.Terminals['error'] = [] + + self.Nonterminals = {} # A dictionary mapping names of nonterminals to a list + # of rule numbers where they are used. + + self.First = {} # A dictionary of precomputed FIRST(x) symbols + + self.Follow = {} # A dictionary of precomputed FOLLOW(x) symbols + + self.Precedence = {} # Precedence rules for each terminal. Contains tuples of the + # form ('right',level) or ('nonassoc', level) or ('left',level) + + self.UsedPrecedence = set() # Precedence rules that were actually used by the grammer. + # This is only used to provide error checking and to generate + # a warning about unused precedence rules. + + self.Start = None # Starting symbol for the grammar + + + def __len__(self): + return len(self.Productions) + + def __getitem__(self, index): + return self.Productions[index] + + # ----------------------------------------------------------------------------- + # set_precedence() + # + # Sets the precedence for a given terminal. assoc is the associativity such as + # 'left','right', or 'nonassoc'. level is a numeric level. + # + # ----------------------------------------------------------------------------- + + def set_precedence(self, term, assoc, level): + assert self.Productions == [None], 'Must call set_precedence() before add_production()' + if term in self.Precedence: + raise GrammarError('Precedence already specified for terminal %r' % term) + if assoc not in ['left', 'right', 'nonassoc']: + raise GrammarError("Associativity must be one of 'left','right', or 'nonassoc'") + self.Precedence[term] = (assoc, level) + + # ----------------------------------------------------------------------------- + # add_production() + # + # Given an action function, this function assembles a production rule and + # computes its precedence level. + # + # The production rule is supplied as a list of symbols. For example, + # a rule such as 'expr : expr PLUS term' has a production name of 'expr' and + # symbols ['expr','PLUS','term']. + # + # Precedence is determined by the precedence of the right-most non-terminal + # or the precedence of a terminal specified by %prec. + # + # A variety of error checks are performed to make sure production symbols + # are valid and that %prec is used correctly. + # ----------------------------------------------------------------------------- + + def add_production(self, prodname, syms, func=None, file='', line=0): + + if prodname in self.Terminals: + raise GrammarError('%s:%d: Illegal rule name %r. Already defined as a token' % (file, line, prodname)) + if prodname == 'error': + raise GrammarError('%s:%d: Illegal rule name %r. error is a reserved word' % (file, line, prodname)) + if not _is_identifier.match(prodname): + raise GrammarError('%s:%d: Illegal rule name %r' % (file, line, prodname)) + + # Look for literal tokens + for n, s in enumerate(syms): + if s[0] in "'\"": + try: + c = eval(s) + if (len(c) > 1): + raise GrammarError('%s:%d: Literal token %s in rule %r may only be a single character' % + (file, line, s, prodname)) + if c not in self.Terminals: + self.Terminals[c] = [] + syms[n] = c + continue + except SyntaxError: + pass + if not _is_identifier.match(s) and s != '%prec': + raise GrammarError('%s:%d: Illegal name %r in rule %r' % (file, line, s, prodname)) + + # Determine the precedence level + if '%prec' in syms: + if syms[-1] == '%prec': + raise GrammarError('%s:%d: Syntax error. Nothing follows %%prec' % (file, line)) + if syms[-2] != '%prec': + raise GrammarError('%s:%d: Syntax error. %%prec can only appear at the end of a grammar rule' % + (file, line)) + precname = syms[-1] + prodprec = self.Precedence.get(precname) + if not prodprec: + raise GrammarError('%s:%d: Nothing known about the precedence of %r' % (file, line, precname)) + else: + self.UsedPrecedence.add(precname) + del syms[-2:] # Drop %prec from the rule + else: + # If no %prec, precedence is determined by the rightmost terminal symbol + precname = rightmost_terminal(syms, self.Terminals) + prodprec = self.Precedence.get(precname, ('right', 0)) + + # See if the rule is already in the rulemap + map = '%s -> %s' % (prodname, syms) + if map in self.Prodmap: + m = self.Prodmap[map] + raise GrammarError('%s:%d: Duplicate rule %s. ' % (file, line, m) + + 'Previous definition at %s:%d' % (m.file, m.line)) + + # From this point on, everything is valid. Create a new Production instance + pnumber = len(self.Productions) + if prodname not in self.Nonterminals: + self.Nonterminals[prodname] = [] + + # Add the production number to Terminals and Nonterminals + for t in syms: + if t in self.Terminals: + self.Terminals[t].append(pnumber) + else: + if t not in self.Nonterminals: + self.Nonterminals[t] = [] + self.Nonterminals[t].append(pnumber) + + # Create a production and add it to the list of productions + p = Production(pnumber, prodname, syms, prodprec, func, file, line) + self.Productions.append(p) + self.Prodmap[map] = p + + # Add to the global productions list + try: + self.Prodnames[prodname].append(p) + except KeyError: + self.Prodnames[prodname] = [p] + + # ----------------------------------------------------------------------------- + # set_start() + # + # Sets the starting symbol and creates the augmented grammar. Production + # rule 0 is S' -> start where start is the start symbol. + # ----------------------------------------------------------------------------- + + def set_start(self, start=None): + if not start: + start = self.Productions[1].name + if start not in self.Nonterminals: + raise GrammarError('start symbol %s undefined' % start) + self.Productions[0] = Production(0, "S'", [start]) + self.Nonterminals[start].append(0) + self.Start = start + + # ----------------------------------------------------------------------------- + # find_unreachable() + # + # Find all of the nonterminal symbols that can't be reached from the starting + # symbol. Returns a list of nonterminals that can't be reached. + # ----------------------------------------------------------------------------- + + def find_unreachable(self): + + # Mark all symbols that are reachable from a symbol s + def mark_reachable_from(s): + if s in reachable: + return + reachable.add(s) + for p in self.Prodnames.get(s, []): + for r in p.prod: + mark_reachable_from(r) + + reachable = set() + mark_reachable_from(self.Productions[0].prod[0]) + return [s for s in self.Nonterminals if s not in reachable] + + # ----------------------------------------------------------------------------- + # infinite_cycles() + # + # This function looks at the various parsing rules and tries to detect + # infinite recursion cycles (grammar rules where there is no possible way + # to derive a string of only terminals). + # ----------------------------------------------------------------------------- + + def infinite_cycles(self): + terminates = {} + + # Terminals: + for t in self.Terminals: + terminates[t] = True + + terminates['$end'] = True + + # Nonterminals: + + # Initialize to false: + for n in self.Nonterminals: + terminates[n] = False + + # Then propagate termination until no change: + while True: + some_change = False + for (n, pl) in self.Prodnames.items(): + # Nonterminal n terminates iff any of its productions terminates. + for p in pl: + # Production p terminates iff all of its rhs symbols terminate. + for s in p.prod: + if not terminates[s]: + # The symbol s does not terminate, + # so production p does not terminate. + p_terminates = False + break + else: + # didn't break from the loop, + # so every symbol s terminates + # so production p terminates. + p_terminates = True + + if p_terminates: + # symbol n terminates! + if not terminates[n]: + terminates[n] = True + some_change = True + # Don't need to consider any more productions for this n. + break + + if not some_change: + break + + infinite = [] + for (s, term) in terminates.items(): + if not term: + if s not in self.Prodnames and s not in self.Terminals and s != 'error': + # s is used-but-not-defined, and we've already warned of that, + # so it would be overkill to say that it's also non-terminating. + pass + else: + infinite.append(s) + + return infinite + + # ----------------------------------------------------------------------------- + # undefined_symbols() + # + # Find all symbols that were used the grammar, but not defined as tokens or + # grammar rules. Returns a list of tuples (sym, prod) where sym in the symbol + # and prod is the production where the symbol was used. + # ----------------------------------------------------------------------------- + def undefined_symbols(self): + result = [] + for p in self.Productions: + if not p: + continue + + for s in p.prod: + if s not in self.Prodnames and s not in self.Terminals and s != 'error': + result.append((s, p)) + return result + + # ----------------------------------------------------------------------------- + # unused_terminals() + # + # Find all terminals that were defined, but not used by the grammar. Returns + # a list of all symbols. + # ----------------------------------------------------------------------------- + def unused_terminals(self): + unused_tok = [] + for s, v in self.Terminals.items(): + if s != 'error' and not v: + unused_tok.append(s) + + return unused_tok + + # ------------------------------------------------------------------------------ + # unused_rules() + # + # Find all grammar rules that were defined, but not used (maybe not reachable) + # Returns a list of productions. + # ------------------------------------------------------------------------------ + + def unused_rules(self): + unused_prod = [] + for s, v in self.Nonterminals.items(): + if not v: + p = self.Prodnames[s][0] + unused_prod.append(p) + return unused_prod + + # ----------------------------------------------------------------------------- + # unused_precedence() + # + # Returns a list of tuples (term,precedence) corresponding to precedence + # rules that were never used by the grammar. term is the name of the terminal + # on which precedence was applied and precedence is a string such as 'left' or + # 'right' corresponding to the type of precedence. + # ----------------------------------------------------------------------------- + + def unused_precedence(self): + unused = [] + for termname in self.Precedence: + if not (termname in self.Terminals or termname in self.UsedPrecedence): + unused.append((termname, self.Precedence[termname][0])) + + return unused + + # ------------------------------------------------------------------------- + # _first() + # + # Compute the value of FIRST1(beta) where beta is a tuple of symbols. + # + # During execution of compute_first1, the result may be incomplete. + # Afterward (e.g., when called from compute_follow()), it will be complete. + # ------------------------------------------------------------------------- + def _first(self, beta): + + # We are computing First(x1,x2,x3,...,xn) + result = [] + for x in beta: + x_produces_empty = False + + # Add all the non- symbols of First[x] to the result. + for f in self.First[x]: + if f == '': + x_produces_empty = True + else: + if f not in result: + result.append(f) + + if x_produces_empty: + # We have to consider the next x in beta, + # i.e. stay in the loop. + pass + else: + # We don't have to consider any further symbols in beta. + break + else: + # There was no 'break' from the loop, + # so x_produces_empty was true for all x in beta, + # so beta produces empty as well. + result.append('') + + return result + + # ------------------------------------------------------------------------- + # compute_first() + # + # Compute the value of FIRST1(X) for all symbols + # ------------------------------------------------------------------------- + def compute_first(self): + if self.First: + return self.First + + # Terminals: + for t in self.Terminals: + self.First[t] = [t] + + self.First['$end'] = ['$end'] + + # Nonterminals: + + # Initialize to the empty set: + for n in self.Nonterminals: + self.First[n] = [] + + # Then propagate symbols until no change: + while True: + some_change = False + for n in self.Nonterminals: + for p in self.Prodnames[n]: + for f in self._first(p.prod): + if f not in self.First[n]: + self.First[n].append(f) + some_change = True + if not some_change: + break + + return self.First + + # --------------------------------------------------------------------- + # compute_follow() + # + # Computes all of the follow sets for every non-terminal symbol. The + # follow set is the set of all symbols that might follow a given + # non-terminal. See the Dragon book, 2nd Ed. p. 189. + # --------------------------------------------------------------------- + def compute_follow(self, start=None): + # If already computed, return the result + if self.Follow: + return self.Follow + + # If first sets not computed yet, do that first. + if not self.First: + self.compute_first() + + # Add '$end' to the follow list of the start symbol + for k in self.Nonterminals: + self.Follow[k] = [] + + if not start: + start = self.Productions[1].name + + self.Follow[start] = ['$end'] + + while True: + didadd = False + for p in self.Productions[1:]: + # Here is the production set + for i, B in enumerate(p.prod): + if B in self.Nonterminals: + # Okay. We got a non-terminal in a production + fst = self._first(p.prod[i+1:]) + hasempty = False + for f in fst: + if f != '' and f not in self.Follow[B]: + self.Follow[B].append(f) + didadd = True + if f == '': + hasempty = True + if hasempty or i == (len(p.prod)-1): + # Add elements of follow(a) to follow(b) + for f in self.Follow[p.name]: + if f not in self.Follow[B]: + self.Follow[B].append(f) + didadd = True + if not didadd: + break + return self.Follow + + + # ----------------------------------------------------------------------------- + # build_lritems() + # + # This function walks the list of productions and builds a complete set of the + # LR items. The LR items are stored in two ways: First, they are uniquely + # numbered and placed in the list _lritems. Second, a linked list of LR items + # is built for each production. For example: + # + # E -> E PLUS E + # + # Creates the list + # + # [E -> . E PLUS E, E -> E . PLUS E, E -> E PLUS . E, E -> E PLUS E . ] + # ----------------------------------------------------------------------------- + + def build_lritems(self): + for p in self.Productions: + lastlri = p + i = 0 + lr_items = [] + while True: + if i > len(p): + lri = None + else: + lri = LRItem(p, i) + # Precompute the list of productions immediately following + try: + lri.lr_after = self.Prodnames[lri.prod[i+1]] + except (IndexError, KeyError): + lri.lr_after = [] + try: + lri.lr_before = lri.prod[i-1] + except IndexError: + lri.lr_before = None + + lastlri.lr_next = lri + if not lri: + break + lr_items.append(lri) + lastlri = lri + i += 1 + p.lr_items = lr_items + +# ----------------------------------------------------------------------------- +# == Class LRTable == +# +# This basic class represents a basic table of LR parsing information. +# Methods for generating the tables are not defined here. They are defined +# in the derived class LRGeneratedTable. +# ----------------------------------------------------------------------------- + +class VersionError(YaccError): + pass + +class LRTable(object): + def __init__(self): + self.lr_action = None + self.lr_goto = None + self.lr_productions = None + self.lr_method = None + + def read_table(self, module): + if isinstance(module, types.ModuleType): + parsetab = module + else: + exec('import %s' % module) + parsetab = sys.modules[module] + + if parsetab._tabversion != __tabversion__: + raise VersionError('yacc table file version is out of date') + + self.lr_action = parsetab._lr_action + self.lr_goto = parsetab._lr_goto + + self.lr_productions = [] + for p in parsetab._lr_productions: + self.lr_productions.append(MiniProduction(*p)) + + self.lr_method = parsetab._lr_method + return parsetab._lr_signature + + def read_pickle(self, filename): + try: + import cPickle as pickle + except ImportError: + import pickle + + if not os.path.exists(filename): + raise ImportError + + in_f = open(filename, 'rb') + + tabversion = pickle.load(in_f) + if tabversion != __tabversion__: + raise VersionError('yacc table file version is out of date') + self.lr_method = pickle.load(in_f) + signature = pickle.load(in_f) + self.lr_action = pickle.load(in_f) + self.lr_goto = pickle.load(in_f) + productions = pickle.load(in_f) + + self.lr_productions = [] + for p in productions: + self.lr_productions.append(MiniProduction(*p)) + + in_f.close() + return signature + + # Bind all production function names to callable objects in pdict + def bind_callables(self, pdict): + for p in self.lr_productions: + p.bind(pdict) + + +# ----------------------------------------------------------------------------- +# === LR Generator === +# +# The following classes and functions are used to generate LR parsing tables on +# a grammar. +# ----------------------------------------------------------------------------- + +# ----------------------------------------------------------------------------- +# digraph() +# traverse() +# +# The following two functions are used to compute set valued functions +# of the form: +# +# F(x) = F'(x) U U{F(y) | x R y} +# +# This is used to compute the values of Read() sets as well as FOLLOW sets +# in LALR(1) generation. +# +# Inputs: X - An input set +# R - A relation +# FP - Set-valued function +# ------------------------------------------------------------------------------ + +def digraph(X, R, FP): + N = {} + for x in X: + N[x] = 0 + stack = [] + F = {} + for x in X: + if N[x] == 0: + traverse(x, N, stack, F, X, R, FP) + return F + +def traverse(x, N, stack, F, X, R, FP): + stack.append(x) + d = len(stack) + N[x] = d + F[x] = FP(x) # F(X) <- F'(x) + + rel = R(x) # Get y's related to x + for y in rel: + if N[y] == 0: + traverse(y, N, stack, F, X, R, FP) + N[x] = min(N[x], N[y]) + for a in F.get(y, []): + if a not in F[x]: + F[x].append(a) + if N[x] == d: + N[stack[-1]] = MAXINT + F[stack[-1]] = F[x] + element = stack.pop() + while element != x: + N[stack[-1]] = MAXINT + F[stack[-1]] = F[x] + element = stack.pop() + +class LALRError(YaccError): + pass + +# ----------------------------------------------------------------------------- +# == LRGeneratedTable == +# +# This class implements the LR table generation algorithm. There are no +# public methods except for write() +# ----------------------------------------------------------------------------- + +class LRGeneratedTable(LRTable): + def __init__(self, grammar, method='LALR', log=None): + if method not in ['SLR', 'LALR']: + raise LALRError('Unsupported method %s' % method) + + self.grammar = grammar + self.lr_method = method + + # Set up the logger + if not log: + log = NullLogger() + self.log = log + + # Internal attributes + self.lr_action = {} # Action table + self.lr_goto = {} # Goto table + self.lr_productions = grammar.Productions # Copy of grammar Production array + self.lr_goto_cache = {} # Cache of computed gotos + self.lr0_cidhash = {} # Cache of closures + + self._add_count = 0 # Internal counter used to detect cycles + + # Diagonistic information filled in by the table generator + self.sr_conflict = 0 + self.rr_conflict = 0 + self.conflicts = [] # List of conflicts + + self.sr_conflicts = [] + self.rr_conflicts = [] + + # Build the tables + self.grammar.build_lritems() + self.grammar.compute_first() + self.grammar.compute_follow() + self.lr_parse_table() + + # Compute the LR(0) closure operation on I, where I is a set of LR(0) items. + + def lr0_closure(self, I): + self._add_count += 1 + + # Add everything in I to J + J = I[:] + didadd = True + while didadd: + didadd = False + for j in J: + for x in j.lr_after: + if getattr(x, 'lr0_added', 0) == self._add_count: + continue + # Add B --> .G to J + J.append(x.lr_next) + x.lr0_added = self._add_count + didadd = True + + return J + + # Compute the LR(0) goto function goto(I,X) where I is a set + # of LR(0) items and X is a grammar symbol. This function is written + # in a way that guarantees uniqueness of the generated goto sets + # (i.e. the same goto set will never be returned as two different Python + # objects). With uniqueness, we can later do fast set comparisons using + # id(obj) instead of element-wise comparison. + + def lr0_goto(self, I, x): + # First we look for a previously cached entry + g = self.lr_goto_cache.get((id(I), x)) + if g: + return g + + # Now we generate the goto set in a way that guarantees uniqueness + # of the result + + s = self.lr_goto_cache.get(x) + if not s: + s = {} + self.lr_goto_cache[x] = s + + gs = [] + for p in I: + n = p.lr_next + if n and n.lr_before == x: + s1 = s.get(id(n)) + if not s1: + s1 = {} + s[id(n)] = s1 + gs.append(n) + s = s1 + g = s.get('$end') + if not g: + if gs: + g = self.lr0_closure(gs) + s['$end'] = g + else: + s['$end'] = gs + self.lr_goto_cache[(id(I), x)] = g + return g + + # Compute the LR(0) sets of item function + def lr0_items(self): + C = [self.lr0_closure([self.grammar.Productions[0].lr_next])] + i = 0 + for I in C: + self.lr0_cidhash[id(I)] = i + i += 1 + + # Loop over the items in C and each grammar symbols + i = 0 + while i < len(C): + I = C[i] + i += 1 + + # Collect all of the symbols that could possibly be in the goto(I,X) sets + asyms = {} + for ii in I: + for s in ii.usyms: + asyms[s] = None + + for x in asyms: + g = self.lr0_goto(I, x) + if not g or id(g) in self.lr0_cidhash: + continue + self.lr0_cidhash[id(g)] = len(C) + C.append(g) + + return C + + # ----------------------------------------------------------------------------- + # ==== LALR(1) Parsing ==== + # + # LALR(1) parsing is almost exactly the same as SLR except that instead of + # relying upon Follow() sets when performing reductions, a more selective + # lookahead set that incorporates the state of the LR(0) machine is utilized. + # Thus, we mainly just have to focus on calculating the lookahead sets. + # + # The method used here is due to DeRemer and Pennelo (1982). + # + # DeRemer, F. L., and T. J. Pennelo: "Efficient Computation of LALR(1) + # Lookahead Sets", ACM Transactions on Programming Languages and Systems, + # Vol. 4, No. 4, Oct. 1982, pp. 615-649 + # + # Further details can also be found in: + # + # J. Tremblay and P. Sorenson, "The Theory and Practice of Compiler Writing", + # McGraw-Hill Book Company, (1985). + # + # ----------------------------------------------------------------------------- + + # ----------------------------------------------------------------------------- + # compute_nullable_nonterminals() + # + # Creates a dictionary containing all of the non-terminals that might produce + # an empty production. + # ----------------------------------------------------------------------------- + + def compute_nullable_nonterminals(self): + nullable = set() + num_nullable = 0 + while True: + for p in self.grammar.Productions[1:]: + if p.len == 0: + nullable.add(p.name) + continue + for t in p.prod: + if t not in nullable: + break + else: + nullable.add(p.name) + if len(nullable) == num_nullable: + break + num_nullable = len(nullable) + return nullable + + # ----------------------------------------------------------------------------- + # find_nonterminal_trans(C) + # + # Given a set of LR(0) items, this functions finds all of the non-terminal + # transitions. These are transitions in which a dot appears immediately before + # a non-terminal. Returns a list of tuples of the form (state,N) where state + # is the state number and N is the nonterminal symbol. + # + # The input C is the set of LR(0) items. + # ----------------------------------------------------------------------------- + + def find_nonterminal_transitions(self, C): + trans = [] + for stateno, state in enumerate(C): + for p in state: + if p.lr_index < p.len - 1: + t = (stateno, p.prod[p.lr_index+1]) + if t[1] in self.grammar.Nonterminals: + if t not in trans: + trans.append(t) + return trans + + # ----------------------------------------------------------------------------- + # dr_relation() + # + # Computes the DR(p,A) relationships for non-terminal transitions. The input + # is a tuple (state,N) where state is a number and N is a nonterminal symbol. + # + # Returns a list of terminals. + # ----------------------------------------------------------------------------- + + def dr_relation(self, C, trans, nullable): + dr_set = {} + state, N = trans + terms = [] + + g = self.lr0_goto(C[state], N) + for p in g: + if p.lr_index < p.len - 1: + a = p.prod[p.lr_index+1] + if a in self.grammar.Terminals: + if a not in terms: + terms.append(a) + + # This extra bit is to handle the start state + if state == 0 and N == self.grammar.Productions[0].prod[0]: + terms.append('$end') + + return terms + + # ----------------------------------------------------------------------------- + # reads_relation() + # + # Computes the READS() relation (p,A) READS (t,C). + # ----------------------------------------------------------------------------- + + def reads_relation(self, C, trans, empty): + # Look for empty transitions + rel = [] + state, N = trans + + g = self.lr0_goto(C[state], N) + j = self.lr0_cidhash.get(id(g), -1) + for p in g: + if p.lr_index < p.len - 1: + a = p.prod[p.lr_index + 1] + if a in empty: + rel.append((j, a)) + + return rel + + # ----------------------------------------------------------------------------- + # compute_lookback_includes() + # + # Determines the lookback and includes relations + # + # LOOKBACK: + # + # This relation is determined by running the LR(0) state machine forward. + # For example, starting with a production "N : . A B C", we run it forward + # to obtain "N : A B C ." We then build a relationship between this final + # state and the starting state. These relationships are stored in a dictionary + # lookdict. + # + # INCLUDES: + # + # Computes the INCLUDE() relation (p,A) INCLUDES (p',B). + # + # This relation is used to determine non-terminal transitions that occur + # inside of other non-terminal transition states. (p,A) INCLUDES (p', B) + # if the following holds: + # + # B -> LAT, where T -> epsilon and p' -L-> p + # + # L is essentially a prefix (which may be empty), T is a suffix that must be + # able to derive an empty string. State p' must lead to state p with the string L. + # + # ----------------------------------------------------------------------------- + + def compute_lookback_includes(self, C, trans, nullable): + lookdict = {} # Dictionary of lookback relations + includedict = {} # Dictionary of include relations + + # Make a dictionary of non-terminal transitions + dtrans = {} + for t in trans: + dtrans[t] = 1 + + # Loop over all transitions and compute lookbacks and includes + for state, N in trans: + lookb = [] + includes = [] + for p in C[state]: + if p.name != N: + continue + + # Okay, we have a name match. We now follow the production all the way + # through the state machine until we get the . on the right hand side + + lr_index = p.lr_index + j = state + while lr_index < p.len - 1: + lr_index = lr_index + 1 + t = p.prod[lr_index] + + # Check to see if this symbol and state are a non-terminal transition + if (j, t) in dtrans: + # Yes. Okay, there is some chance that this is an includes relation + # the only way to know for certain is whether the rest of the + # production derives empty + + li = lr_index + 1 + while li < p.len: + if p.prod[li] in self.grammar.Terminals: + break # No forget it + if p.prod[li] not in nullable: + break + li = li + 1 + else: + # Appears to be a relation between (j,t) and (state,N) + includes.append((j, t)) + + g = self.lr0_goto(C[j], t) # Go to next set + j = self.lr0_cidhash.get(id(g), -1) # Go to next state + + # When we get here, j is the final state, now we have to locate the production + for r in C[j]: + if r.name != p.name: + continue + if r.len != p.len: + continue + i = 0 + # This look is comparing a production ". A B C" with "A B C ." + while i < r.lr_index: + if r.prod[i] != p.prod[i+1]: + break + i = i + 1 + else: + lookb.append((j, r)) + for i in includes: + if i not in includedict: + includedict[i] = [] + includedict[i].append((state, N)) + lookdict[(state, N)] = lookb + + return lookdict, includedict + + # ----------------------------------------------------------------------------- + # compute_read_sets() + # + # Given a set of LR(0) items, this function computes the read sets. + # + # Inputs: C = Set of LR(0) items + # ntrans = Set of nonterminal transitions + # nullable = Set of empty transitions + # + # Returns a set containing the read sets + # ----------------------------------------------------------------------------- + + def compute_read_sets(self, C, ntrans, nullable): + FP = lambda x: self.dr_relation(C, x, nullable) + R = lambda x: self.reads_relation(C, x, nullable) + F = digraph(ntrans, R, FP) + return F + + # ----------------------------------------------------------------------------- + # compute_follow_sets() + # + # Given a set of LR(0) items, a set of non-terminal transitions, a readset, + # and an include set, this function computes the follow sets + # + # Follow(p,A) = Read(p,A) U U {Follow(p',B) | (p,A) INCLUDES (p',B)} + # + # Inputs: + # ntrans = Set of nonterminal transitions + # readsets = Readset (previously computed) + # inclsets = Include sets (previously computed) + # + # Returns a set containing the follow sets + # ----------------------------------------------------------------------------- + + def compute_follow_sets(self, ntrans, readsets, inclsets): + FP = lambda x: readsets[x] + R = lambda x: inclsets.get(x, []) + F = digraph(ntrans, R, FP) + return F + + # ----------------------------------------------------------------------------- + # add_lookaheads() + # + # Attaches the lookahead symbols to grammar rules. + # + # Inputs: lookbacks - Set of lookback relations + # followset - Computed follow set + # + # This function directly attaches the lookaheads to productions contained + # in the lookbacks set + # ----------------------------------------------------------------------------- + + def add_lookaheads(self, lookbacks, followset): + for trans, lb in lookbacks.items(): + # Loop over productions in lookback + for state, p in lb: + if state not in p.lookaheads: + p.lookaheads[state] = [] + f = followset.get(trans, []) + for a in f: + if a not in p.lookaheads[state]: + p.lookaheads[state].append(a) + + # ----------------------------------------------------------------------------- + # add_lalr_lookaheads() + # + # This function does all of the work of adding lookahead information for use + # with LALR parsing + # ----------------------------------------------------------------------------- + + def add_lalr_lookaheads(self, C): + # Determine all of the nullable nonterminals + nullable = self.compute_nullable_nonterminals() + + # Find all non-terminal transitions + trans = self.find_nonterminal_transitions(C) + + # Compute read sets + readsets = self.compute_read_sets(C, trans, nullable) + + # Compute lookback/includes relations + lookd, included = self.compute_lookback_includes(C, trans, nullable) + + # Compute LALR FOLLOW sets + followsets = self.compute_follow_sets(trans, readsets, included) + + # Add all of the lookaheads + self.add_lookaheads(lookd, followsets) + + # ----------------------------------------------------------------------------- + # lr_parse_table() + # + # This function constructs the parse tables for SLR or LALR + # ----------------------------------------------------------------------------- + def lr_parse_table(self): + Productions = self.grammar.Productions + Precedence = self.grammar.Precedence + goto = self.lr_goto # Goto array + action = self.lr_action # Action array + log = self.log # Logger for output + + actionp = {} # Action production array (temporary) + + log.info('Parsing method: %s', self.lr_method) + + # Step 1: Construct C = { I0, I1, ... IN}, collection of LR(0) items + # This determines the number of states + + C = self.lr0_items() + + if self.lr_method == 'LALR': + self.add_lalr_lookaheads(C) + + # Build the parser table, state by state + st = 0 + for I in C: + # Loop over each production in I + actlist = [] # List of actions + st_action = {} + st_actionp = {} + st_goto = {} + log.info('') + log.info('state %d', st) + log.info('') + for p in I: + log.info(' (%d) %s', p.number, p) + log.info('') + + for p in I: + if p.len == p.lr_index + 1: + if p.name == "S'": + # Start symbol. Accept! + st_action['$end'] = 0 + st_actionp['$end'] = p + else: + # We are at the end of a production. Reduce! + if self.lr_method == 'LALR': + laheads = p.lookaheads[st] + else: + laheads = self.grammar.Follow[p.name] + for a in laheads: + actlist.append((a, p, 'reduce using rule %d (%s)' % (p.number, p))) + r = st_action.get(a) + if r is not None: + # Whoa. Have a shift/reduce or reduce/reduce conflict + if r > 0: + # Need to decide on shift or reduce here + # By default we favor shifting. Need to add + # some precedence rules here. + + # Shift precedence comes from the token + sprec, slevel = Precedence.get(a, ('right', 0)) + + # Reduce precedence comes from rule being reduced (p) + rprec, rlevel = Productions[p.number].prec + + if (slevel < rlevel) or ((slevel == rlevel) and (rprec == 'left')): + # We really need to reduce here. + st_action[a] = -p.number + st_actionp[a] = p + if not slevel and not rlevel: + log.info(' ! shift/reduce conflict for %s resolved as reduce', a) + self.sr_conflicts.append((st, a, 'reduce')) + Productions[p.number].reduced += 1 + elif (slevel == rlevel) and (rprec == 'nonassoc'): + st_action[a] = None + else: + # Hmmm. Guess we'll keep the shift + if not rlevel: + log.info(' ! shift/reduce conflict for %s resolved as shift', a) + self.sr_conflicts.append((st, a, 'shift')) + elif r < 0: + # Reduce/reduce conflict. In this case, we favor the rule + # that was defined first in the grammar file + oldp = Productions[-r] + pp = Productions[p.number] + if oldp.line > pp.line: + st_action[a] = -p.number + st_actionp[a] = p + chosenp, rejectp = pp, oldp + Productions[p.number].reduced += 1 + Productions[oldp.number].reduced -= 1 + else: + chosenp, rejectp = oldp, pp + self.rr_conflicts.append((st, chosenp, rejectp)) + log.info(' ! reduce/reduce conflict for %s resolved using rule %d (%s)', + a, st_actionp[a].number, st_actionp[a]) + else: + raise LALRError('Unknown conflict in state %d' % st) + else: + st_action[a] = -p.number + st_actionp[a] = p + Productions[p.number].reduced += 1 + else: + i = p.lr_index + a = p.prod[i+1] # Get symbol right after the "." + if a in self.grammar.Terminals: + g = self.lr0_goto(I, a) + j = self.lr0_cidhash.get(id(g), -1) + if j >= 0: + # We are in a shift state + actlist.append((a, p, 'shift and go to state %d' % j)) + r = st_action.get(a) + if r is not None: + # Whoa have a shift/reduce or shift/shift conflict + if r > 0: + if r != j: + raise LALRError('Shift/shift conflict in state %d' % st) + elif r < 0: + # Do a precedence check. + # - if precedence of reduce rule is higher, we reduce. + # - if precedence of reduce is same and left assoc, we reduce. + # - otherwise we shift + + # Shift precedence comes from the token + sprec, slevel = Precedence.get(a, ('right', 0)) + + # Reduce precedence comes from the rule that could have been reduced + rprec, rlevel = Productions[st_actionp[a].number].prec + + if (slevel > rlevel) or ((slevel == rlevel) and (rprec == 'right')): + # We decide to shift here... highest precedence to shift + Productions[st_actionp[a].number].reduced -= 1 + st_action[a] = j + st_actionp[a] = p + if not rlevel: + log.info(' ! shift/reduce conflict for %s resolved as shift', a) + self.sr_conflicts.append((st, a, 'shift')) + elif (slevel == rlevel) and (rprec == 'nonassoc'): + st_action[a] = None + else: + # Hmmm. Guess we'll keep the reduce + if not slevel and not rlevel: + log.info(' ! shift/reduce conflict for %s resolved as reduce', a) + self.sr_conflicts.append((st, a, 'reduce')) + + else: + raise LALRError('Unknown conflict in state %d' % st) + else: + st_action[a] = j + st_actionp[a] = p + + # Print the actions associated with each terminal + _actprint = {} + for a, p, m in actlist: + if a in st_action: + if p is st_actionp[a]: + log.info(' %-15s %s', a, m) + _actprint[(a, m)] = 1 + log.info('') + # Print the actions that were not used. (debugging) + not_used = 0 + for a, p, m in actlist: + if a in st_action: + if p is not st_actionp[a]: + if not (a, m) in _actprint: + log.debug(' ! %-15s [ %s ]', a, m) + not_used = 1 + _actprint[(a, m)] = 1 + if not_used: + log.debug('') + + # Construct the goto table for this state + + nkeys = {} + for ii in I: + for s in ii.usyms: + if s in self.grammar.Nonterminals: + nkeys[s] = None + for n in nkeys: + g = self.lr0_goto(I, n) + j = self.lr0_cidhash.get(id(g), -1) + if j >= 0: + st_goto[n] = j + log.info(' %-30s shift and go to state %d', n, j) + + action[st] = st_action + actionp[st] = st_actionp + goto[st] = st_goto + st += 1 + + # ----------------------------------------------------------------------------- + # write() + # + # This function writes the LR parsing tables to a file + # ----------------------------------------------------------------------------- + + def write_table(self, tabmodule, outputdir='', signature=''): + if isinstance(tabmodule, types.ModuleType): + raise IOError("Won't overwrite existing tabmodule") + + basemodulename = tabmodule.split('.')[-1] + filename = os.path.join(outputdir, basemodulename) + '.py' + try: + f = open(filename, 'w') + + f.write(''' +# %s +# This file is automatically generated. Do not edit. +_tabversion = %r + +_lr_method = %r + +_lr_signature = %r + ''' % (os.path.basename(filename), __tabversion__, self.lr_method, signature)) + + # Change smaller to 0 to go back to original tables + smaller = 1 + + # Factor out names to try and make smaller + if smaller: + items = {} + + for s, nd in self.lr_action.items(): + for name, v in nd.items(): + i = items.get(name) + if not i: + i = ([], []) + items[name] = i + i[0].append(s) + i[1].append(v) + + f.write('\n_lr_action_items = {') + for k, v in items.items(): + f.write('%r:([' % k) + for i in v[0]: + f.write('%r,' % i) + f.write('],[') + for i in v[1]: + f.write('%r,' % i) + + f.write(']),') + f.write('}\n') + + f.write(''' +_lr_action = {} +for _k, _v in _lr_action_items.items(): + for _x,_y in zip(_v[0],_v[1]): + if not _x in _lr_action: _lr_action[_x] = {} + _lr_action[_x][_k] = _y +del _lr_action_items +''') + + else: + f.write('\n_lr_action = { ') + for k, v in self.lr_action.items(): + f.write('(%r,%r):%r,' % (k[0], k[1], v)) + f.write('}\n') + + if smaller: + # Factor out names to try and make smaller + items = {} + + for s, nd in self.lr_goto.items(): + for name, v in nd.items(): + i = items.get(name) + if not i: + i = ([], []) + items[name] = i + i[0].append(s) + i[1].append(v) + + f.write('\n_lr_goto_items = {') + for k, v in items.items(): + f.write('%r:([' % k) + for i in v[0]: + f.write('%r,' % i) + f.write('],[') + for i in v[1]: + f.write('%r,' % i) + + f.write(']),') + f.write('}\n') + + f.write(''' +_lr_goto = {} +for _k, _v in _lr_goto_items.items(): + for _x, _y in zip(_v[0], _v[1]): + if not _x in _lr_goto: _lr_goto[_x] = {} + _lr_goto[_x][_k] = _y +del _lr_goto_items +''') + else: + f.write('\n_lr_goto = { ') + for k, v in self.lr_goto.items(): + f.write('(%r,%r):%r,' % (k[0], k[1], v)) + f.write('}\n') + + # Write production table + f.write('_lr_productions = [\n') + for p in self.lr_productions: + if p.func: + f.write(' (%r,%r,%d,%r,%r,%d),\n' % (p.str, p.name, p.len, + p.func, os.path.basename(p.file), p.line)) + else: + f.write(' (%r,%r,%d,None,None,None),\n' % (str(p), p.name, p.len)) + f.write(']\n') + f.close() + + except IOError as e: + raise + + + # ----------------------------------------------------------------------------- + # pickle_table() + # + # This function pickles the LR parsing tables to a supplied file object + # ----------------------------------------------------------------------------- + + def pickle_table(self, filename, signature=''): + try: + import cPickle as pickle + except ImportError: + import pickle + with open(filename, 'wb') as outf: + pickle.dump(__tabversion__, outf, pickle_protocol) + pickle.dump(self.lr_method, outf, pickle_protocol) + pickle.dump(signature, outf, pickle_protocol) + pickle.dump(self.lr_action, outf, pickle_protocol) + pickle.dump(self.lr_goto, outf, pickle_protocol) + + outp = [] + for p in self.lr_productions: + if p.func: + outp.append((p.str, p.name, p.len, p.func, os.path.basename(p.file), p.line)) + else: + outp.append((str(p), p.name, p.len, None, None, None)) + pickle.dump(outp, outf, pickle_protocol) + +# ----------------------------------------------------------------------------- +# === INTROSPECTION === +# +# The following functions and classes are used to implement the PLY +# introspection features followed by the yacc() function itself. +# ----------------------------------------------------------------------------- + +# ----------------------------------------------------------------------------- +# get_caller_module_dict() +# +# This function returns a dictionary containing all of the symbols defined within +# a caller further down the call stack. This is used to get the environment +# associated with the yacc() call if none was provided. +# ----------------------------------------------------------------------------- + +def get_caller_module_dict(levels): + f = sys._getframe(levels) + ldict = f.f_globals.copy() + if f.f_globals != f.f_locals: + ldict.update(f.f_locals) + return ldict + +# ----------------------------------------------------------------------------- +# parse_grammar() +# +# This takes a raw grammar rule string and parses it into production data +# ----------------------------------------------------------------------------- +def parse_grammar(doc, file, line): + grammar = [] + # Split the doc string into lines + pstrings = doc.splitlines() + lastp = None + dline = line + for ps in pstrings: + dline += 1 + p = ps.split() + if not p: + continue + try: + if p[0] == '|': + # This is a continuation of a previous rule + if not lastp: + raise SyntaxError("%s:%d: Misplaced '|'" % (file, dline)) + prodname = lastp + syms = p[1:] + else: + prodname = p[0] + lastp = prodname + syms = p[2:] + assign = p[1] + if assign != ':' and assign != '::=': + raise SyntaxError("%s:%d: Syntax error. Expected ':'" % (file, dline)) + + grammar.append((file, dline, prodname, syms)) + except SyntaxError: + raise + except Exception: + raise SyntaxError('%s:%d: Syntax error in rule %r' % (file, dline, ps.strip())) + + return grammar + +# ----------------------------------------------------------------------------- +# ParserReflect() +# +# This class represents information extracted for building a parser including +# start symbol, error function, tokens, precedence list, action functions, +# etc. +# ----------------------------------------------------------------------------- +class ParserReflect(object): + def __init__(self, pdict, log=None): + self.pdict = pdict + self.start = None + self.error_func = None + self.tokens = None + self.modules = set() + self.grammar = [] + self.error = False + + if log is None: + self.log = PlyLogger(sys.stderr) + else: + self.log = log + + # Get all of the basic information + def get_all(self): + self.get_start() + self.get_error_func() + self.get_tokens() + self.get_precedence() + self.get_pfunctions() + + # Validate all of the information + def validate_all(self): + self.validate_start() + self.validate_error_func() + self.validate_tokens() + self.validate_precedence() + self.validate_pfunctions() + self.validate_modules() + return self.error + + # Compute a signature over the grammar + def signature(self): + parts = [] + try: + if self.start: + parts.append(self.start) + if self.prec: + parts.append(''.join([''.join(p) for p in self.prec])) + if self.tokens: + parts.append(' '.join(self.tokens)) + for f in self.pfuncs: + if f[3]: + parts.append(f[3]) + except (TypeError, ValueError): + pass + return ''.join(parts) + + # ----------------------------------------------------------------------------- + # validate_modules() + # + # This method checks to see if there are duplicated p_rulename() functions + # in the parser module file. Without this function, it is really easy for + # users to make mistakes by cutting and pasting code fragments (and it's a real + # bugger to try and figure out why the resulting parser doesn't work). Therefore, + # we just do a little regular expression pattern matching of def statements + # to try and detect duplicates. + # ----------------------------------------------------------------------------- + + def validate_modules(self): + # Match def p_funcname( + fre = re.compile(r'\s*def\s+(p_[a-zA-Z_0-9]*)\(') + + for module in self.modules: + try: + lines, linen = inspect.getsourcelines(module) + except IOError: + continue + + counthash = {} + for linen, line in enumerate(lines): + linen += 1 + m = fre.match(line) + if m: + name = m.group(1) + prev = counthash.get(name) + if not prev: + counthash[name] = linen + else: + filename = inspect.getsourcefile(module) + self.log.warning('%s:%d: Function %s redefined. Previously defined on line %d', + filename, linen, name, prev) + + # Get the start symbol + def get_start(self): + self.start = self.pdict.get('start') + + # Validate the start symbol + def validate_start(self): + if self.start is not None: + if not isinstance(self.start, string_types): + self.log.error("'start' must be a string") + + # Look for error handler + def get_error_func(self): + self.error_func = self.pdict.get('p_error') + + # Validate the error function + def validate_error_func(self): + if self.error_func: + if isinstance(self.error_func, types.FunctionType): + ismethod = 0 + elif isinstance(self.error_func, types.MethodType): + ismethod = 1 + else: + self.log.error("'p_error' defined, but is not a function or method") + self.error = True + return + + eline = self.error_func.__code__.co_firstlineno + efile = self.error_func.__code__.co_filename + module = inspect.getmodule(self.error_func) + self.modules.add(module) + + argcount = self.error_func.__code__.co_argcount - ismethod + if argcount != 1: + self.log.error('%s:%d: p_error() requires 1 argument', efile, eline) + self.error = True + + # Get the tokens map + def get_tokens(self): + tokens = self.pdict.get('tokens') + if not tokens: + self.log.error('No token list is defined') + self.error = True + return + + if not isinstance(tokens, (list, tuple)): + self.log.error('tokens must be a list or tuple') + self.error = True + return + + if not tokens: + self.log.error('tokens is empty') + self.error = True + return + + self.tokens = tokens + + # Validate the tokens + def validate_tokens(self): + # Validate the tokens. + if 'error' in self.tokens: + self.log.error("Illegal token name 'error'. Is a reserved word") + self.error = True + return + + terminals = set() + for n in self.tokens: + if n in terminals: + self.log.warning('Token %r multiply defined', n) + terminals.add(n) + + # Get the precedence map (if any) + def get_precedence(self): + self.prec = self.pdict.get('precedence') + + # Validate and parse the precedence map + def validate_precedence(self): + preclist = [] + if self.prec: + if not isinstance(self.prec, (list, tuple)): + self.log.error('precedence must be a list or tuple') + self.error = True + return + for level, p in enumerate(self.prec): + if not isinstance(p, (list, tuple)): + self.log.error('Bad precedence table') + self.error = True + return + + if len(p) < 2: + self.log.error('Malformed precedence entry %s. Must be (assoc, term, ..., term)', p) + self.error = True + return + assoc = p[0] + if not isinstance(assoc, string_types): + self.log.error('precedence associativity must be a string') + self.error = True + return + for term in p[1:]: + if not isinstance(term, string_types): + self.log.error('precedence items must be strings') + self.error = True + return + preclist.append((term, assoc, level+1)) + self.preclist = preclist + + # Get all p_functions from the grammar + def get_pfunctions(self): + p_functions = [] + for name, item in self.pdict.items(): + if not name.startswith('p_') or name == 'p_error': + continue + if isinstance(item, (types.FunctionType, types.MethodType)): + line = getattr(item, 'co_firstlineno', item.__code__.co_firstlineno) + module = inspect.getmodule(item) + p_functions.append((line, module, name, item.__doc__)) + + # Sort all of the actions by line number; make sure to stringify + # modules to make them sortable, since `line` may not uniquely sort all + # p functions + p_functions.sort(key=lambda p_function: ( + p_function[0], + str(p_function[1]), + p_function[2], + p_function[3])) + self.pfuncs = p_functions + + # Validate all of the p_functions + def validate_pfunctions(self): + grammar = [] + # Check for non-empty symbols + if len(self.pfuncs) == 0: + self.log.error('no rules of the form p_rulename are defined') + self.error = True + return + + for line, module, name, doc in self.pfuncs: + file = inspect.getsourcefile(module) + func = self.pdict[name] + if isinstance(func, types.MethodType): + reqargs = 2 + else: + reqargs = 1 + if func.__code__.co_argcount > reqargs: + self.log.error('%s:%d: Rule %r has too many arguments', file, line, func.__name__) + self.error = True + elif func.__code__.co_argcount < reqargs: + self.log.error('%s:%d: Rule %r requires an argument', file, line, func.__name__) + self.error = True + elif not func.__doc__: + self.log.warning('%s:%d: No documentation string specified in function %r (ignored)', + file, line, func.__name__) + else: + try: + parsed_g = parse_grammar(doc, file, line) + for g in parsed_g: + grammar.append((name, g)) + except SyntaxError as e: + self.log.error(str(e)) + self.error = True + + # Looks like a valid grammar rule + # Mark the file in which defined. + self.modules.add(module) + + # Secondary validation step that looks for p_ definitions that are not functions + # or functions that look like they might be grammar rules. + + for n, v in self.pdict.items(): + if n.startswith('p_') and isinstance(v, (types.FunctionType, types.MethodType)): + continue + if n.startswith('t_'): + continue + if n.startswith('p_') and n != 'p_error': + self.log.warning('%r not defined as a function', n) + if ((isinstance(v, types.FunctionType) and v.__code__.co_argcount == 1) or + (isinstance(v, types.MethodType) and v.__func__.__code__.co_argcount == 2)): + if v.__doc__: + try: + doc = v.__doc__.split(' ') + if doc[1] == ':': + self.log.warning('%s:%d: Possible grammar rule %r defined without p_ prefix', + v.__code__.co_filename, v.__code__.co_firstlineno, n) + except IndexError: + pass + + self.grammar = grammar + +# ----------------------------------------------------------------------------- +# yacc(module) +# +# Build a parser +# ----------------------------------------------------------------------------- + +def yacc(method='LALR', debug=yaccdebug, module=None, tabmodule=tab_module, start=None, + check_recursion=True, optimize=False, write_tables=True, debugfile=debug_file, + outputdir=None, debuglog=None, errorlog=None, picklefile=None): + + if tabmodule is None: + tabmodule = tab_module + + # Reference to the parsing method of the last built parser + global parse + + # If pickling is enabled, table files are not created + if picklefile: + write_tables = 0 + + if errorlog is None: + errorlog = PlyLogger(sys.stderr) + + # Get the module dictionary used for the parser + if module: + _items = [(k, getattr(module, k)) for k in dir(module)] + pdict = dict(_items) + # If no __file__ attribute is available, try to obtain it from the __module__ instead + if '__file__' not in pdict: + pdict['__file__'] = sys.modules[pdict['__module__']].__file__ + else: + pdict = get_caller_module_dict(2) + + if outputdir is None: + # If no output directory is set, the location of the output files + # is determined according to the following rules: + # - If tabmodule specifies a package, files go into that package directory + # - Otherwise, files go in the same directory as the specifying module + if isinstance(tabmodule, types.ModuleType): + srcfile = tabmodule.__file__ + else: + if '.' not in tabmodule: + srcfile = pdict['__file__'] + else: + parts = tabmodule.split('.') + pkgname = '.'.join(parts[:-1]) + exec('import %s' % pkgname) + srcfile = getattr(sys.modules[pkgname], '__file__', '') + outputdir = os.path.dirname(srcfile) + + # Determine if the module is package of a package or not. + # If so, fix the tabmodule setting so that tables load correctly + pkg = pdict.get('__package__') + if pkg and isinstance(tabmodule, str): + if '.' not in tabmodule: + tabmodule = pkg + '.' + tabmodule + + + + # Set start symbol if it's specified directly using an argument + if start is not None: + pdict['start'] = start + + # Collect parser information from the dictionary + pinfo = ParserReflect(pdict, log=errorlog) + pinfo.get_all() + + if pinfo.error: + raise YaccError('Unable to build parser') + + # Check signature against table files (if any) + signature = pinfo.signature() + + # Read the tables + try: + lr = LRTable() + if picklefile: + read_signature = lr.read_pickle(picklefile) + else: + read_signature = lr.read_table(tabmodule) + if optimize or (read_signature == signature): + try: + lr.bind_callables(pinfo.pdict) + parser = LRParser(lr, pinfo.error_func) + parse = parser.parse + return parser + except Exception as e: + errorlog.warning('There was a problem loading the table file: %r', e) + except VersionError as e: + errorlog.warning(str(e)) + except ImportError: + pass + + if debuglog is None: + if debug: + try: + debuglog = PlyLogger(open(os.path.join(outputdir, debugfile), 'w')) + except IOError as e: + errorlog.warning("Couldn't open %r. %s" % (debugfile, e)) + debuglog = NullLogger() + else: + debuglog = NullLogger() + + debuglog.info('Created by PLY version %s (http://www.dabeaz.com/ply)', __version__) + + errors = False + + # Validate the parser information + if pinfo.validate_all(): + raise YaccError('Unable to build parser') + + if not pinfo.error_func: + errorlog.warning('no p_error() function is defined') + + # Create a grammar object + grammar = Grammar(pinfo.tokens) + + # Set precedence level for terminals + for term, assoc, level in pinfo.preclist: + try: + grammar.set_precedence(term, assoc, level) + except GrammarError as e: + errorlog.warning('%s', e) + + # Add productions to the grammar + for funcname, gram in pinfo.grammar: + file, line, prodname, syms = gram + try: + grammar.add_production(prodname, syms, funcname, file, line) + except GrammarError as e: + errorlog.error('%s', e) + errors = True + + # Set the grammar start symbols + try: + if start is None: + grammar.set_start(pinfo.start) + else: + grammar.set_start(start) + except GrammarError as e: + errorlog.error(str(e)) + errors = True + + if errors: + raise YaccError('Unable to build parser') + + # Verify the grammar structure + undefined_symbols = grammar.undefined_symbols() + for sym, prod in undefined_symbols: + errorlog.error('%s:%d: Symbol %r used, but not defined as a token or a rule', prod.file, prod.line, sym) + errors = True + + unused_terminals = grammar.unused_terminals() + if unused_terminals: + debuglog.info('') + debuglog.info('Unused terminals:') + debuglog.info('') + for term in unused_terminals: + errorlog.warning('Token %r defined, but not used', term) + debuglog.info(' %s', term) + + # Print out all productions to the debug log + if debug: + debuglog.info('') + debuglog.info('Grammar') + debuglog.info('') + for n, p in enumerate(grammar.Productions): + debuglog.info('Rule %-5d %s', n, p) + + # Find unused non-terminals + unused_rules = grammar.unused_rules() + for prod in unused_rules: + errorlog.warning('%s:%d: Rule %r defined, but not used', prod.file, prod.line, prod.name) + + if len(unused_terminals) == 1: + errorlog.warning('There is 1 unused token') + if len(unused_terminals) > 1: + errorlog.warning('There are %d unused tokens', len(unused_terminals)) + + if len(unused_rules) == 1: + errorlog.warning('There is 1 unused rule') + if len(unused_rules) > 1: + errorlog.warning('There are %d unused rules', len(unused_rules)) + + if debug: + debuglog.info('') + debuglog.info('Terminals, with rules where they appear') + debuglog.info('') + terms = list(grammar.Terminals) + terms.sort() + for term in terms: + debuglog.info('%-20s : %s', term, ' '.join([str(s) for s in grammar.Terminals[term]])) + + debuglog.info('') + debuglog.info('Nonterminals, with rules where they appear') + debuglog.info('') + nonterms = list(grammar.Nonterminals) + nonterms.sort() + for nonterm in nonterms: + debuglog.info('%-20s : %s', nonterm, ' '.join([str(s) for s in grammar.Nonterminals[nonterm]])) + debuglog.info('') + + if check_recursion: + unreachable = grammar.find_unreachable() + for u in unreachable: + errorlog.warning('Symbol %r is unreachable', u) + + infinite = grammar.infinite_cycles() + for inf in infinite: + errorlog.error('Infinite recursion detected for symbol %r', inf) + errors = True + + unused_prec = grammar.unused_precedence() + for term, assoc in unused_prec: + errorlog.error('Precedence rule %r defined for unknown symbol %r', assoc, term) + errors = True + + if errors: + raise YaccError('Unable to build parser') + + # Run the LRGeneratedTable on the grammar + if debug: + errorlog.debug('Generating %s tables', method) + + lr = LRGeneratedTable(grammar, method, debuglog) + + if debug: + num_sr = len(lr.sr_conflicts) + + # Report shift/reduce and reduce/reduce conflicts + if num_sr == 1: + errorlog.warning('1 shift/reduce conflict') + elif num_sr > 1: + errorlog.warning('%d shift/reduce conflicts', num_sr) + + num_rr = len(lr.rr_conflicts) + if num_rr == 1: + errorlog.warning('1 reduce/reduce conflict') + elif num_rr > 1: + errorlog.warning('%d reduce/reduce conflicts', num_rr) + + # Write out conflicts to the output file + if debug and (lr.sr_conflicts or lr.rr_conflicts): + debuglog.warning('') + debuglog.warning('Conflicts:') + debuglog.warning('') + + for state, tok, resolution in lr.sr_conflicts: + debuglog.warning('shift/reduce conflict for %s in state %d resolved as %s', tok, state, resolution) + + already_reported = set() + for state, rule, rejected in lr.rr_conflicts: + if (state, id(rule), id(rejected)) in already_reported: + continue + debuglog.warning('reduce/reduce conflict in state %d resolved using rule (%s)', state, rule) + debuglog.warning('rejected rule (%s) in state %d', rejected, state) + errorlog.warning('reduce/reduce conflict in state %d resolved using rule (%s)', state, rule) + errorlog.warning('rejected rule (%s) in state %d', rejected, state) + already_reported.add((state, id(rule), id(rejected))) + + warned_never = [] + for state, rule, rejected in lr.rr_conflicts: + if not rejected.reduced and (rejected not in warned_never): + debuglog.warning('Rule (%s) is never reduced', rejected) + errorlog.warning('Rule (%s) is never reduced', rejected) + warned_never.append(rejected) + + # Write the table file if requested + if write_tables: + try: + lr.write_table(tabmodule, outputdir, signature) + except IOError as e: + errorlog.warning("Couldn't create %r. %s" % (tabmodule, e)) + + # Write a pickled version of the tables + if picklefile: + try: + lr.pickle_table(picklefile, signature) + except IOError as e: + errorlog.warning("Couldn't create %r. %s" % (picklefile, e)) + + # Build the parser + lr.bind_callables(pinfo.pdict) + parser = LRParser(lr, pinfo.error_func) + + parse = parser.parse + return parser diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pycparser/ply/ygen.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pycparser/ply/ygen.py new file mode 100644 index 00000000..acf5ca1a --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pycparser/ply/ygen.py @@ -0,0 +1,74 @@ +# ply: ygen.py +# +# This is a support program that auto-generates different versions of the YACC parsing +# function with different features removed for the purposes of performance. +# +# Users should edit the method LParser.parsedebug() in yacc.py. The source code +# for that method is then used to create the other methods. See the comments in +# yacc.py for further details. + +import os.path +import shutil + +def get_source_range(lines, tag): + srclines = enumerate(lines) + start_tag = '#--! %s-start' % tag + end_tag = '#--! %s-end' % tag + + for start_index, line in srclines: + if line.strip().startswith(start_tag): + break + + for end_index, line in srclines: + if line.strip().endswith(end_tag): + break + + return (start_index + 1, end_index) + +def filter_section(lines, tag): + filtered_lines = [] + include = True + tag_text = '#--! %s' % tag + for line in lines: + if line.strip().startswith(tag_text): + include = not include + elif include: + filtered_lines.append(line) + return filtered_lines + +def main(): + dirname = os.path.dirname(__file__) + shutil.copy2(os.path.join(dirname, 'yacc.py'), os.path.join(dirname, 'yacc.py.bak')) + with open(os.path.join(dirname, 'yacc.py'), 'r') as f: + lines = f.readlines() + + parse_start, parse_end = get_source_range(lines, 'parsedebug') + parseopt_start, parseopt_end = get_source_range(lines, 'parseopt') + parseopt_notrack_start, parseopt_notrack_end = get_source_range(lines, 'parseopt-notrack') + + # Get the original source + orig_lines = lines[parse_start:parse_end] + + # Filter the DEBUG sections out + parseopt_lines = filter_section(orig_lines, 'DEBUG') + + # Filter the TRACKING sections out + parseopt_notrack_lines = filter_section(parseopt_lines, 'TRACKING') + + # Replace the parser source sections with updated versions + lines[parseopt_notrack_start:parseopt_notrack_end] = parseopt_notrack_lines + lines[parseopt_start:parseopt_end] = parseopt_lines + + lines = [line.rstrip()+'\n' for line in lines] + with open(os.path.join(dirname, 'yacc.py'), 'w') as f: + f.writelines(lines) + + print('Updated yacc.py') + +if __name__ == '__main__': + main() + + + + + diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pycparser/plyparser.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pycparser/plyparser.py new file mode 100644 index 00000000..6222c0ea --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pycparser/plyparser.py @@ -0,0 +1,133 @@ +#----------------------------------------------------------------- +# plyparser.py +# +# PLYParser class and other utilites for simplifying programming +# parsers with PLY +# +# Eli Bendersky [https://eli.thegreenplace.net/] +# License: BSD +#----------------------------------------------------------------- + +import warnings + +class Coord(object): + """ Coordinates of a syntactic element. Consists of: + - File name + - Line number + - (optional) column number, for the Lexer + """ + __slots__ = ('file', 'line', 'column', '__weakref__') + def __init__(self, file, line, column=None): + self.file = file + self.line = line + self.column = column + + def __str__(self): + str = "%s:%s" % (self.file, self.line) + if self.column: str += ":%s" % self.column + return str + + +class ParseError(Exception): pass + + +class PLYParser(object): + def _create_opt_rule(self, rulename): + """ Given a rule name, creates an optional ply.yacc rule + for it. The name of the optional rule is + _opt + """ + optname = rulename + '_opt' + + def optrule(self, p): + p[0] = p[1] + + optrule.__doc__ = '%s : empty\n| %s' % (optname, rulename) + optrule.__name__ = 'p_%s' % optname + setattr(self.__class__, optrule.__name__, optrule) + + def _coord(self, lineno, column=None): + return Coord( + file=self.clex.filename, + line=lineno, + column=column) + + def _token_coord(self, p, token_idx): + """ Returns the coordinates for the YaccProduction objet 'p' indexed + with 'token_idx'. The coordinate includes the 'lineno' and + 'column'. Both follow the lex semantic, starting from 1. + """ + last_cr = p.lexer.lexer.lexdata.rfind('\n', 0, p.lexpos(token_idx)) + if last_cr < 0: + last_cr = -1 + column = (p.lexpos(token_idx) - (last_cr)) + return self._coord(p.lineno(token_idx), column) + + def _parse_error(self, msg, coord): + raise ParseError("%s: %s" % (coord, msg)) + + +def parameterized(*params): + """ Decorator to create parameterized rules. + + Parameterized rule methods must be named starting with 'p_' and contain + 'xxx', and their docstrings may contain 'xxx' and 'yyy'. These will be + replaced by the given parameter tuples. For example, ``p_xxx_rule()`` with + docstring 'xxx_rule : yyy' when decorated with + ``@parameterized(('id', 'ID'))`` produces ``p_id_rule()`` with the docstring + 'id_rule : ID'. Using multiple tuples produces multiple rules. + """ + def decorate(rule_func): + rule_func._params = params + return rule_func + return decorate + + +def template(cls): + """ Class decorator to generate rules from parameterized rule templates. + + See `parameterized` for more information on parameterized rules. + """ + issued_nodoc_warning = False + for attr_name in dir(cls): + if attr_name.startswith('p_'): + method = getattr(cls, attr_name) + if hasattr(method, '_params'): + # Remove the template method + delattr(cls, attr_name) + # Create parameterized rules from this method; only run this if + # the method has a docstring. This is to address an issue when + # pycparser's users are installed in -OO mode which strips + # docstrings away. + # See: https://github.com/eliben/pycparser/pull/198/ and + # https://github.com/eliben/pycparser/issues/197 + # for discussion. + if method.__doc__ is not None: + _create_param_rules(cls, method) + elif not issued_nodoc_warning: + warnings.warn( + 'parsing methods must have __doc__ for pycparser to work properly', + RuntimeWarning, + stacklevel=2) + issued_nodoc_warning = True + return cls + + +def _create_param_rules(cls, func): + """ Create ply.yacc rules based on a parameterized rule function + + Generates new methods (one per each pair of parameters) based on the + template rule function `func`, and attaches them to `cls`. The rule + function's parameters must be accessible via its `_params` attribute. + """ + for xxx, yyy in func._params: + # Use the template method's body for each new method + def param_rule(self, p): + func(self, p) + + # Substitute in the params for the grammar rule and function name + param_rule.__doc__ = func.__doc__.replace('xxx', xxx).replace('yyy', yyy) + param_rule.__name__ = func.__name__.replace('xxx', xxx) + + # Attach the new method to the class + setattr(cls, param_rule.__name__, param_rule) diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pycparser/yacctab.py b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pycparser/yacctab.py new file mode 100644 index 00000000..7fbdef97 --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pycparser/yacctab.py @@ -0,0 +1,338 @@ + +# yacctab.py +# This file is automatically generated. Do not edit. +_tabversion = '3.10' + +_lr_method = 'LALR' + +_lr_signature = 'translation_unit_or_emptyleftLORleftLANDleftORleftXORleftANDleftEQNEleftGTGELTLEleftRSHIFTLSHIFTleftPLUSMINUSleftTIMESDIVIDEMOD_BOOL _COMPLEX AUTO BREAK CASE CHAR CONST CONTINUE DEFAULT DO DOUBLE ELSE ENUM EXTERN FLOAT FOR GOTO IF INLINE INT LONG REGISTER OFFSETOF RESTRICT RETURN SHORT SIGNED SIZEOF STATIC STRUCT SWITCH TYPEDEF UNION UNSIGNED VOID VOLATILE WHILE __INT128 ID TYPEID INT_CONST_DEC INT_CONST_OCT INT_CONST_HEX INT_CONST_BIN FLOAT_CONST HEX_FLOAT_CONST CHAR_CONST WCHAR_CONST STRING_LITERAL WSTRING_LITERAL PLUS MINUS TIMES DIVIDE MOD OR AND NOT XOR LSHIFT RSHIFT LOR LAND LNOT LT LE GT GE EQ NE EQUALS TIMESEQUAL DIVEQUAL MODEQUAL PLUSEQUAL MINUSEQUAL LSHIFTEQUAL RSHIFTEQUAL ANDEQUAL XOREQUAL OREQUAL PLUSPLUS MINUSMINUS ARROW CONDOP LPAREN RPAREN LBRACKET RBRACKET LBRACE RBRACE COMMA PERIOD SEMI COLON ELLIPSIS PPHASH PPPRAGMA PPPRAGMASTRabstract_declarator_opt : empty\n| abstract_declaratorassignment_expression_opt : empty\n| assignment_expressionblock_item_list_opt : empty\n| block_item_listdeclaration_list_opt : empty\n| declaration_listdeclaration_specifiers_no_type_opt : empty\n| declaration_specifiers_no_typedesignation_opt : empty\n| designationexpression_opt : empty\n| expressionid_init_declarator_list_opt : empty\n| id_init_declarator_listidentifier_list_opt : empty\n| identifier_listinit_declarator_list_opt : empty\n| init_declarator_listinitializer_list_opt : empty\n| initializer_listparameter_type_list_opt : empty\n| parameter_type_liststruct_declarator_list_opt : empty\n| struct_declarator_listtype_qualifier_list_opt : empty\n| type_qualifier_list direct_id_declarator : ID\n direct_id_declarator : LPAREN id_declarator RPAREN\n direct_id_declarator : direct_id_declarator LBRACKET type_qualifier_list_opt assignment_expression_opt RBRACKET\n direct_id_declarator : direct_id_declarator LBRACKET STATIC type_qualifier_list_opt assignment_expression RBRACKET\n | direct_id_declarator LBRACKET type_qualifier_list STATIC assignment_expression RBRACKET\n direct_id_declarator : direct_id_declarator LBRACKET type_qualifier_list_opt TIMES RBRACKET\n direct_id_declarator : direct_id_declarator LPAREN parameter_type_list RPAREN\n | direct_id_declarator LPAREN identifier_list_opt RPAREN\n direct_typeid_declarator : TYPEID\n direct_typeid_declarator : LPAREN typeid_declarator RPAREN\n direct_typeid_declarator : direct_typeid_declarator LBRACKET type_qualifier_list_opt assignment_expression_opt RBRACKET\n direct_typeid_declarator : direct_typeid_declarator LBRACKET STATIC type_qualifier_list_opt assignment_expression RBRACKET\n | direct_typeid_declarator LBRACKET type_qualifier_list STATIC assignment_expression RBRACKET\n direct_typeid_declarator : direct_typeid_declarator LBRACKET type_qualifier_list_opt TIMES RBRACKET\n direct_typeid_declarator : direct_typeid_declarator LPAREN parameter_type_list RPAREN\n | direct_typeid_declarator LPAREN identifier_list_opt RPAREN\n direct_typeid_noparen_declarator : TYPEID\n direct_typeid_noparen_declarator : direct_typeid_noparen_declarator LBRACKET type_qualifier_list_opt assignment_expression_opt RBRACKET\n direct_typeid_noparen_declarator : direct_typeid_noparen_declarator LBRACKET STATIC type_qualifier_list_opt assignment_expression RBRACKET\n | direct_typeid_noparen_declarator LBRACKET type_qualifier_list STATIC assignment_expression RBRACKET\n direct_typeid_noparen_declarator : direct_typeid_noparen_declarator LBRACKET type_qualifier_list_opt TIMES RBRACKET\n direct_typeid_noparen_declarator : direct_typeid_noparen_declarator LPAREN parameter_type_list RPAREN\n | direct_typeid_noparen_declarator LPAREN identifier_list_opt RPAREN\n id_declarator : direct_id_declarator\n id_declarator : pointer direct_id_declarator\n typeid_declarator : direct_typeid_declarator\n typeid_declarator : pointer direct_typeid_declarator\n typeid_noparen_declarator : direct_typeid_noparen_declarator\n typeid_noparen_declarator : pointer direct_typeid_noparen_declarator\n translation_unit_or_empty : translation_unit\n | empty\n translation_unit : external_declaration\n translation_unit : translation_unit external_declaration\n external_declaration : function_definition\n external_declaration : declaration\n external_declaration : pp_directive\n | pppragma_directive\n external_declaration : SEMI\n pp_directive : PPHASH\n pppragma_directive : PPPRAGMA\n | PPPRAGMA PPPRAGMASTR\n function_definition : id_declarator declaration_list_opt compound_statement\n function_definition : declaration_specifiers id_declarator declaration_list_opt compound_statement\n statement : labeled_statement\n | expression_statement\n | compound_statement\n | selection_statement\n | iteration_statement\n | jump_statement\n | pppragma_directive\n pragmacomp_or_statement : pppragma_directive statement\n | statement\n decl_body : declaration_specifiers init_declarator_list_opt\n | declaration_specifiers_no_type id_init_declarator_list_opt\n declaration : decl_body SEMI\n declaration_list : declaration\n | declaration_list declaration\n declaration_specifiers_no_type : type_qualifier declaration_specifiers_no_type_opt\n declaration_specifiers_no_type : storage_class_specifier declaration_specifiers_no_type_opt\n declaration_specifiers_no_type : function_specifier declaration_specifiers_no_type_opt\n declaration_specifiers : declaration_specifiers type_qualifier\n declaration_specifiers : declaration_specifiers storage_class_specifier\n declaration_specifiers : declaration_specifiers function_specifier\n declaration_specifiers : declaration_specifiers type_specifier_no_typeid\n declaration_specifiers : type_specifier\n declaration_specifiers : declaration_specifiers_no_type type_specifier\n storage_class_specifier : AUTO\n | REGISTER\n | STATIC\n | EXTERN\n | TYPEDEF\n function_specifier : INLINE\n type_specifier_no_typeid : VOID\n | _BOOL\n | CHAR\n | SHORT\n | INT\n | LONG\n | FLOAT\n | DOUBLE\n | _COMPLEX\n | SIGNED\n | UNSIGNED\n | __INT128\n type_specifier : typedef_name\n | enum_specifier\n | struct_or_union_specifier\n | type_specifier_no_typeid\n type_qualifier : CONST\n | RESTRICT\n | VOLATILE\n init_declarator_list : init_declarator\n | init_declarator_list COMMA init_declarator\n init_declarator : declarator\n | declarator EQUALS initializer\n id_init_declarator_list : id_init_declarator\n | id_init_declarator_list COMMA init_declarator\n id_init_declarator : id_declarator\n | id_declarator EQUALS initializer\n specifier_qualifier_list : specifier_qualifier_list type_specifier_no_typeid\n specifier_qualifier_list : specifier_qualifier_list type_qualifier\n specifier_qualifier_list : type_specifier\n specifier_qualifier_list : type_qualifier_list type_specifier\n struct_or_union_specifier : struct_or_union ID\n | struct_or_union TYPEID\n struct_or_union_specifier : struct_or_union brace_open struct_declaration_list brace_close\n | struct_or_union brace_open brace_close\n struct_or_union_specifier : struct_or_union ID brace_open struct_declaration_list brace_close\n | struct_or_union ID brace_open brace_close\n | struct_or_union TYPEID brace_open struct_declaration_list brace_close\n | struct_or_union TYPEID brace_open brace_close\n struct_or_union : STRUCT\n | UNION\n struct_declaration_list : struct_declaration\n | struct_declaration_list struct_declaration\n struct_declaration : specifier_qualifier_list struct_declarator_list_opt SEMI\n struct_declaration : SEMI\n struct_declaration : pppragma_directive\n struct_declarator_list : struct_declarator\n | struct_declarator_list COMMA struct_declarator\n struct_declarator : declarator\n struct_declarator : declarator COLON constant_expression\n | COLON constant_expression\n enum_specifier : ENUM ID\n | ENUM TYPEID\n enum_specifier : ENUM brace_open enumerator_list brace_close\n enum_specifier : ENUM ID brace_open enumerator_list brace_close\n | ENUM TYPEID brace_open enumerator_list brace_close\n enumerator_list : enumerator\n | enumerator_list COMMA\n | enumerator_list COMMA enumerator\n enumerator : ID\n | ID EQUALS constant_expression\n declarator : id_declarator\n | typeid_declarator\n pointer : TIMES type_qualifier_list_opt\n | TIMES type_qualifier_list_opt pointer\n type_qualifier_list : type_qualifier\n | type_qualifier_list type_qualifier\n parameter_type_list : parameter_list\n | parameter_list COMMA ELLIPSIS\n parameter_list : parameter_declaration\n | parameter_list COMMA parameter_declaration\n parameter_declaration : declaration_specifiers id_declarator\n | declaration_specifiers typeid_noparen_declarator\n parameter_declaration : declaration_specifiers abstract_declarator_opt\n identifier_list : identifier\n | identifier_list COMMA identifier\n initializer : assignment_expression\n initializer : brace_open initializer_list_opt brace_close\n | brace_open initializer_list COMMA brace_close\n initializer_list : designation_opt initializer\n | initializer_list COMMA designation_opt initializer\n designation : designator_list EQUALS\n designator_list : designator\n | designator_list designator\n designator : LBRACKET constant_expression RBRACKET\n | PERIOD identifier\n type_name : specifier_qualifier_list abstract_declarator_opt\n abstract_declarator : pointer\n abstract_declarator : pointer direct_abstract_declarator\n abstract_declarator : direct_abstract_declarator\n direct_abstract_declarator : LPAREN abstract_declarator RPAREN direct_abstract_declarator : direct_abstract_declarator LBRACKET assignment_expression_opt RBRACKET\n direct_abstract_declarator : LBRACKET assignment_expression_opt RBRACKET\n direct_abstract_declarator : direct_abstract_declarator LBRACKET TIMES RBRACKET\n direct_abstract_declarator : LBRACKET TIMES RBRACKET\n direct_abstract_declarator : direct_abstract_declarator LPAREN parameter_type_list_opt RPAREN\n direct_abstract_declarator : LPAREN parameter_type_list_opt RPAREN\n block_item : declaration\n | statement\n block_item_list : block_item\n | block_item_list block_item\n compound_statement : brace_open block_item_list_opt brace_close labeled_statement : ID COLON pragmacomp_or_statement labeled_statement : CASE constant_expression COLON pragmacomp_or_statement labeled_statement : DEFAULT COLON pragmacomp_or_statement selection_statement : IF LPAREN expression RPAREN pragmacomp_or_statement selection_statement : IF LPAREN expression RPAREN statement ELSE pragmacomp_or_statement selection_statement : SWITCH LPAREN expression RPAREN pragmacomp_or_statement iteration_statement : WHILE LPAREN expression RPAREN pragmacomp_or_statement iteration_statement : DO pragmacomp_or_statement WHILE LPAREN expression RPAREN SEMI iteration_statement : FOR LPAREN expression_opt SEMI expression_opt SEMI expression_opt RPAREN pragmacomp_or_statement iteration_statement : FOR LPAREN declaration expression_opt SEMI expression_opt RPAREN pragmacomp_or_statement jump_statement : GOTO ID SEMI jump_statement : BREAK SEMI jump_statement : CONTINUE SEMI jump_statement : RETURN expression SEMI\n | RETURN SEMI\n expression_statement : expression_opt SEMI expression : assignment_expression\n | expression COMMA assignment_expression\n typedef_name : TYPEID assignment_expression : conditional_expression\n | unary_expression assignment_operator assignment_expression\n assignment_operator : EQUALS\n | XOREQUAL\n | TIMESEQUAL\n | DIVEQUAL\n | MODEQUAL\n | PLUSEQUAL\n | MINUSEQUAL\n | LSHIFTEQUAL\n | RSHIFTEQUAL\n | ANDEQUAL\n | OREQUAL\n constant_expression : conditional_expression conditional_expression : binary_expression\n | binary_expression CONDOP expression COLON conditional_expression\n binary_expression : cast_expression\n | binary_expression TIMES binary_expression\n | binary_expression DIVIDE binary_expression\n | binary_expression MOD binary_expression\n | binary_expression PLUS binary_expression\n | binary_expression MINUS binary_expression\n | binary_expression RSHIFT binary_expression\n | binary_expression LSHIFT binary_expression\n | binary_expression LT binary_expression\n | binary_expression LE binary_expression\n | binary_expression GE binary_expression\n | binary_expression GT binary_expression\n | binary_expression EQ binary_expression\n | binary_expression NE binary_expression\n | binary_expression AND binary_expression\n | binary_expression OR binary_expression\n | binary_expression XOR binary_expression\n | binary_expression LAND binary_expression\n | binary_expression LOR binary_expression\n cast_expression : unary_expression cast_expression : LPAREN type_name RPAREN cast_expression unary_expression : postfix_expression unary_expression : PLUSPLUS unary_expression\n | MINUSMINUS unary_expression\n | unary_operator cast_expression\n unary_expression : SIZEOF unary_expression\n | SIZEOF LPAREN type_name RPAREN\n unary_operator : AND\n | TIMES\n | PLUS\n | MINUS\n | NOT\n | LNOT\n postfix_expression : primary_expression postfix_expression : postfix_expression LBRACKET expression RBRACKET postfix_expression : postfix_expression LPAREN argument_expression_list RPAREN\n | postfix_expression LPAREN RPAREN\n postfix_expression : postfix_expression PERIOD ID\n | postfix_expression PERIOD TYPEID\n | postfix_expression ARROW ID\n | postfix_expression ARROW TYPEID\n postfix_expression : postfix_expression PLUSPLUS\n | postfix_expression MINUSMINUS\n postfix_expression : LPAREN type_name RPAREN brace_open initializer_list brace_close\n | LPAREN type_name RPAREN brace_open initializer_list COMMA brace_close\n primary_expression : identifier primary_expression : constant primary_expression : unified_string_literal\n | unified_wstring_literal\n primary_expression : LPAREN expression RPAREN primary_expression : OFFSETOF LPAREN type_name COMMA offsetof_member_designator RPAREN\n offsetof_member_designator : identifier\n | offsetof_member_designator PERIOD identifier\n | offsetof_member_designator LBRACKET expression RBRACKET\n argument_expression_list : assignment_expression\n | argument_expression_list COMMA assignment_expression\n identifier : ID constant : INT_CONST_DEC\n | INT_CONST_OCT\n | INT_CONST_HEX\n | INT_CONST_BIN\n constant : FLOAT_CONST\n | HEX_FLOAT_CONST\n constant : CHAR_CONST\n | WCHAR_CONST\n unified_string_literal : STRING_LITERAL\n | unified_string_literal STRING_LITERAL\n unified_wstring_literal : WSTRING_LITERAL\n | unified_wstring_literal WSTRING_LITERAL\n brace_open : LBRACE\n brace_close : RBRACE\n empty : ' + +_lr_action_items = {'VOID':([0,1,2,3,5,6,7,8,9,10,11,12,14,15,16,17,18,19,20,21,23,24,25,26,29,30,32,33,34,35,36,37,39,40,41,42,44,45,47,48,49,50,51,53,54,55,56,57,60,61,63,64,65,67,68,69,70,71,72,73,74,78,80,83,87,91,92,96,101,102,103,104,105,113,117,120,121,122,123,124,125,126,127,128,129,130,131,132,133,139,145,173,187,188,189,201,202,203,206,208,215,217,218,219,220,222,225,231,232,233,234,235,236,237,238,244,249,258,277,286,287,288,291,293,296,327,331,336,337,339,340,346,349,351,352,353,356,357,360,362,363,398,418,419,432,433,437,442,443,480,501,502,504,505,523,524,527,528,],[6,-309,-104,-117,-115,-101,-99,-52,-97,-116,-98,-64,-60,-102,-93,-66,6,-96,-111,-106,-65,-95,-112,6,-221,-109,-113,6,-63,-118,6,-29,-107,-62,-103,-67,-114,-108,-309,-110,-309,-105,-119,-68,-100,-87,-10,-9,6,-53,6,-84,6,6,-61,-133,-307,-132,6,-153,-152,-166,-90,-92,6,-89,-91,-94,-83,-86,-88,-69,-30,6,6,-70,6,-85,6,6,6,-135,-130,-145,-146,-142,-308,6,6,-167,6,6,-36,-35,6,6,-73,-76,-72,-74,6,-78,-199,-198,-77,-200,-75,6,-139,6,-137,-134,-143,-131,-128,-129,-154,-71,6,-31,6,6,6,-34,6,6,6,-218,-217,6,-215,-201,-214,-78,-80,-202,-138,-136,-144,-156,-155,6,-33,-32,-213,-216,-205,-79,-203,-204,-209,-208,-206,-80,-210,-207,-212,-211,]),'LBRACKET':([2,3,5,6,7,8,9,10,11,15,16,19,20,21,24,25,29,30,31,32,35,37,39,41,44,45,48,50,51,54,61,69,70,71,73,74,76,77,78,79,80,83,85,88,91,92,96,105,113,115,126,127,131,139,140,143,150,153,154,155,156,157,158,161,162,170,172,175,177,178,180,181,187,188,189,192,193,196,199,229,232,234,235,237,238,244,249,251,260,276,279,280,282,286,293,296,319,324,325,356,357,362,363,370,371,374,379,383,384,385,386,389,394,397,398,418,419,420,421,427,428,447,448,452,454,456,459,460,466,472,473,474,475,476,484,485,486,491,492,495,496,507,510,511,512,513,518,520,525,],[-104,-117,-115,-101,-99,59,-97,-116,-98,-102,-93,-96,-111,-106,-95,-112,-221,-109,-309,-113,-118,-29,-107,-103,-114,-108,-110,-105,-119,-100,59,-133,-307,-132,-153,-152,-28,-164,-166,-27,-90,-92,144,-37,-89,-91,-94,-30,198,-294,-135,-130,-308,-167,-165,144,-298,-286,-301,-305,-302,-299,-284,-285,284,-297,-271,-303,-295,-283,-300,-296,-36,-35,198,198,326,-45,330,-294,-139,-137,-134,-131,-128,-129,-154,-38,376,-306,-304,-280,-279,-31,-34,198,198,326,330,-138,-136,-156,-155,-44,-43,-183,376,-278,-277,-276,-275,-274,-287,198,198,-33,-32,-197,-191,-193,-195,-39,-42,-186,376,-184,-272,-273,376,-51,-50,-192,-194,-196,-41,-40,-185,509,-289,-46,-49,-288,376,-281,-48,-47,-290,-282,-291,]),'WCHAR_CONST':([3,35,51,53,59,70,76,78,79,101,104,106,107,108,121,131,139,144,147,148,151,159,160,166,167,169,171,173,174,176,184,185,186,198,202,203,206,207,208,214,215,217,218,219,220,222,224,225,228,239,250,253,254,255,260,264,265,266,267,268,269,270,271,272,273,274,275,277,284,285,288,291,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,326,329,330,336,337,339,340,341,342,343,346,348,349,351,352,353,354,355,361,367,368,369,372,376,378,380,395,422,423,424,430,432,433,435,437,439,442,443,454,457,461,463,466,467,469,470,471,477,479,480,481,482,483,487,488,500,501,502,504,505,509,510,514,517,522,523,524,526,527,528,],[-117,-118,-119,-68,-309,-307,-28,-166,-27,-83,-69,156,-28,-309,156,-308,-167,-309,156,156,-270,156,-268,156,-267,156,-266,156,156,-265,-269,156,156,156,-73,-76,-72,156,-74,156,156,-78,-199,-198,-77,-200,156,-75,-266,156,156,156,-28,-309,-309,-227,-230,-228,-224,-225,-229,-231,156,-233,-234,-226,-232,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,-309,-266,156,-218,-217,156,-215,156,156,156,-201,156,-214,156,-80,-202,156,156,156,-266,156,156,-12,156,156,-11,156,156,-28,-309,-266,-213,-216,156,-205,156,-79,-203,-309,-182,156,156,-309,156,-266,156,156,156,156,-204,156,156,156,156,-11,156,-209,-208,-206,-80,156,-309,156,156,156,-210,-207,156,-212,-211,]),'FLOAT_CONST':([3,35,51,53,59,70,76,78,79,101,104,106,107,108,121,131,139,144,147,148,151,159,160,166,167,169,171,173,174,176,184,185,186,198,202,203,206,207,208,214,215,217,218,219,220,222,224,225,228,239,250,253,254,255,260,264,265,266,267,268,269,270,271,272,273,274,275,277,284,285,288,291,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,326,329,330,336,337,339,340,341,342,343,346,348,349,351,352,353,354,355,361,367,368,369,372,376,378,380,395,422,423,424,430,432,433,435,437,439,442,443,454,457,461,463,466,467,469,470,471,477,479,480,481,482,483,487,488,500,501,502,504,505,509,510,514,517,522,523,524,526,527,528,],[-117,-118,-119,-68,-309,-307,-28,-166,-27,-83,-69,157,-28,-309,157,-308,-167,-309,157,157,-270,157,-268,157,-267,157,-266,157,157,-265,-269,157,157,157,-73,-76,-72,157,-74,157,157,-78,-199,-198,-77,-200,157,-75,-266,157,157,157,-28,-309,-309,-227,-230,-228,-224,-225,-229,-231,157,-233,-234,-226,-232,157,157,157,157,157,157,157,157,157,157,157,157,157,157,157,157,157,157,157,157,157,157,157,157,-309,-266,157,-218,-217,157,-215,157,157,157,-201,157,-214,157,-80,-202,157,157,157,-266,157,157,-12,157,157,-11,157,157,-28,-309,-266,-213,-216,157,-205,157,-79,-203,-309,-182,157,157,-309,157,-266,157,157,157,157,-204,157,157,157,157,-11,157,-209,-208,-206,-80,157,-309,157,157,157,-210,-207,157,-212,-211,]),'MINUS':([3,35,51,53,59,70,76,78,79,101,104,106,107,108,115,121,131,139,144,147,148,150,151,152,153,154,155,156,157,158,159,160,161,162,164,166,167,169,170,171,172,173,174,175,176,177,178,179,180,181,184,185,186,198,202,203,206,207,208,214,215,217,218,219,220,222,224,225,228,229,239,250,253,254,255,260,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,282,284,285,288,289,290,291,292,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,326,329,330,336,337,339,340,341,342,343,346,348,349,351,352,353,354,355,361,367,368,369,372,376,378,380,383,384,385,386,389,394,395,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,416,417,422,423,424,430,432,433,435,437,439,442,443,454,457,458,459,460,461,463,465,466,467,469,470,471,477,479,480,481,482,483,487,488,500,501,502,504,505,507,509,510,511,514,517,520,522,523,524,526,527,528,],[-117,-118,-119,-68,-309,-307,-28,-166,-27,-83,-69,160,-28,-309,-294,160,-308,-167,-309,160,160,-298,-270,-257,-286,-301,-305,-302,-299,-284,160,-268,-285,-259,-238,160,-267,160,-297,-266,-271,160,160,-303,-265,-295,-283,301,-300,-296,-269,160,160,160,-73,-76,-72,160,-74,160,160,-78,-199,-198,-77,-200,160,-75,-266,-294,160,160,160,-28,-309,-309,-227,-230,-228,-224,-225,-229,-231,160,-233,-234,-226,-232,-306,160,-263,-304,-280,-279,160,160,160,-257,-262,160,-260,-261,160,160,160,160,160,160,160,160,160,160,160,160,160,160,160,160,160,160,160,-309,-266,160,-218,-217,160,-215,160,160,160,-201,160,-214,160,-80,-202,160,160,160,-266,160,160,-12,160,160,-11,-278,-277,-276,-275,-274,-287,160,301,301,301,-243,301,301,301,-242,301,301,-240,-239,301,301,301,301,301,-241,160,-28,-309,-266,-213,-216,160,-205,160,-79,-203,-309,-182,-264,-272,-273,160,160,-258,-309,160,-266,160,160,160,160,-204,160,160,160,160,-11,160,-209,-208,-206,-80,-288,160,-309,-281,160,160,-282,160,-210,-207,160,-212,-211,]),'RPAREN':([2,3,5,6,7,8,9,10,11,15,16,19,20,21,24,25,29,30,31,32,35,37,39,41,44,45,48,50,51,54,58,60,61,69,71,73,74,76,77,78,79,80,83,85,88,91,92,96,105,109,110,111,112,113,114,115,116,118,126,127,131,139,140,141,143,145,150,152,153,154,155,156,157,158,161,162,164,170,172,175,177,178,179,180,181,183,187,188,189,190,191,192,193,194,195,196,197,199,211,227,232,234,235,237,238,244,249,251,256,257,276,278,279,280,282,285,286,289,290,292,293,294,295,296,297,319,320,321,322,323,324,325,327,331,332,333,334,347,356,357,362,363,370,371,381,382,383,384,385,386,388,389,390,392,393,394,396,397,398,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,416,417,418,419,420,421,425,426,427,428,431,436,438,440,444,447,448,458,459,460,465,472,473,474,475,476,484,485,490,491,492,494,495,496,500,503,507,511,512,513,514,515,518,520,521,525,],[-104,-117,-115,-101,-99,-52,-97,-116,-98,-102,-93,-96,-111,-106,-95,-112,-221,-109,-309,-113,-118,-29,-107,-103,-114,-108,-110,-105,-119,-100,105,-309,-53,-133,-132,-153,-152,-28,-164,-166,-27,-90,-92,-54,-37,-89,-91,-94,-30,187,-17,188,-170,-309,-18,-294,-168,-175,-135,-130,-308,-167,-165,251,-55,-309,-298,-257,-286,-301,-305,-302,-299,-284,-285,-259,-238,-297,-271,-303,-295,-283,-236,-300,-296,-222,-36,-35,-309,-174,-2,-188,-56,-172,-1,-45,-173,-190,-14,-219,-139,-137,-134,-131,-128,-129,-154,-38,370,371,-306,-263,-304,-280,-279,389,-31,-257,-262,-260,-34,394,395,-309,-261,-188,-23,-24,420,421,-57,-189,-309,-309,-176,-169,-171,-13,-138,-136,-156,-155,-44,-43,-223,458,-278,-277,-276,-275,-292,-274,460,463,464,-287,-187,-188,-309,-244,-256,-245,-243,-247,-251,-246,-242,-249,-254,-240,-239,-248,-255,-250,-252,-253,-241,-33,-32,-197,-191,472,473,-193,-195,476,-220,479,481,483,-39,-42,-264,-272,-273,-258,-51,-50,-192,-194,-196,-41,-40,-293,507,-289,-237,-46,-49,-309,516,-288,-281,-48,-47,-309,522,-290,-282,526,-291,]),'LONG':([0,1,2,3,5,6,7,8,9,10,11,12,14,15,16,17,18,19,20,21,23,24,25,26,29,30,32,33,34,35,36,37,39,40,41,42,44,45,47,48,49,50,51,53,54,55,56,57,60,61,63,64,65,67,68,69,70,71,72,73,74,78,80,83,87,91,92,96,101,102,103,104,105,113,117,120,121,122,123,124,125,126,127,128,129,130,131,132,133,139,145,173,187,188,189,201,202,203,206,208,215,217,218,219,220,222,225,231,232,233,234,235,236,237,238,244,249,258,277,286,287,288,291,293,296,327,331,336,337,339,340,346,349,351,352,353,356,357,360,362,363,398,418,419,432,433,437,442,443,480,501,502,504,505,523,524,527,528,],[21,-309,-104,-117,-115,-101,-99,-52,-97,-116,-98,-64,-60,-102,-93,-66,21,-96,-111,-106,-65,-95,-112,21,-221,-109,-113,21,-63,-118,21,-29,-107,-62,-103,-67,-114,-108,-309,-110,-309,-105,-119,-68,-100,-87,-10,-9,21,-53,21,-84,21,21,-61,-133,-307,-132,21,-153,-152,-166,-90,-92,21,-89,-91,-94,-83,-86,-88,-69,-30,21,21,-70,21,-85,21,21,21,-135,-130,-145,-146,-142,-308,21,21,-167,21,21,-36,-35,21,21,-73,-76,-72,-74,21,-78,-199,-198,-77,-200,-75,21,-139,21,-137,-134,-143,-131,-128,-129,-154,-71,21,-31,21,21,21,-34,21,21,21,-218,-217,21,-215,-201,-214,-78,-80,-202,-138,-136,-144,-156,-155,21,-33,-32,-213,-216,-205,-79,-203,-204,-209,-208,-206,-80,-210,-207,-212,-211,]),'PLUS':([3,35,51,53,59,70,76,78,79,101,104,106,107,108,115,121,131,139,144,147,148,150,151,152,153,154,155,156,157,158,159,160,161,162,164,166,167,169,170,171,172,173,174,175,176,177,178,179,180,181,184,185,186,198,202,203,206,207,208,214,215,217,218,219,220,222,224,225,228,229,239,250,253,254,255,260,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,282,284,285,288,289,290,291,292,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,326,329,330,336,337,339,340,341,342,343,346,348,349,351,352,353,354,355,361,367,368,369,372,376,378,380,383,384,385,386,389,394,395,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,416,417,422,423,424,430,432,433,435,437,439,442,443,454,457,458,459,460,461,463,465,466,467,469,470,471,477,479,480,481,482,483,487,488,500,501,502,504,505,507,509,510,511,514,517,520,522,523,524,526,527,528,],[-117,-118,-119,-68,-309,-307,-28,-166,-27,-83,-69,167,-28,-309,-294,167,-308,-167,-309,167,167,-298,-270,-257,-286,-301,-305,-302,-299,-284,167,-268,-285,-259,-238,167,-267,167,-297,-266,-271,167,167,-303,-265,-295,-283,305,-300,-296,-269,167,167,167,-73,-76,-72,167,-74,167,167,-78,-199,-198,-77,-200,167,-75,-266,-294,167,167,167,-28,-309,-309,-227,-230,-228,-224,-225,-229,-231,167,-233,-234,-226,-232,-306,167,-263,-304,-280,-279,167,167,167,-257,-262,167,-260,-261,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,-309,-266,167,-218,-217,167,-215,167,167,167,-201,167,-214,167,-80,-202,167,167,167,-266,167,167,-12,167,167,-11,-278,-277,-276,-275,-274,-287,167,305,305,305,-243,305,305,305,-242,305,305,-240,-239,305,305,305,305,305,-241,167,-28,-309,-266,-213,-216,167,-205,167,-79,-203,-309,-182,-264,-272,-273,167,167,-258,-309,167,-266,167,167,167,167,-204,167,167,167,167,-11,167,-209,-208,-206,-80,-288,167,-309,-281,167,167,-282,167,-210,-207,167,-212,-211,]),'ELLIPSIS':([201,],[333,]),'GT':([115,131,150,152,153,154,155,156,157,158,161,162,164,170,172,175,177,178,179,180,181,229,276,278,279,280,282,289,290,292,297,383,384,385,386,389,394,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,416,417,458,459,460,465,507,511,520,],[-294,-308,-298,-257,-286,-301,-305,-302,-299,-284,-285,-259,-238,-297,-271,-303,-295,-283,306,-300,-296,-294,-306,-263,-304,-280,-279,-257,-262,-260,-261,-278,-277,-276,-275,-274,-287,-244,306,-245,-243,-247,306,-246,-242,-249,306,-240,-239,-248,306,306,306,306,-241,-264,-272,-273,-258,-288,-281,-282,]),'GOTO':([53,70,101,104,121,131,202,203,206,208,215,217,218,219,220,222,224,225,336,337,340,342,346,349,351,352,353,354,432,433,437,439,442,443,479,480,481,483,501,502,504,505,517,522,523,524,526,527,528,],[-68,-307,-83,-69,204,-308,-73,-76,-72,-74,204,-78,-199,-198,-77,-200,204,-75,-218,-217,-215,204,-201,-214,204,-80,-202,204,-213,-216,-205,204,-79,-203,204,-204,204,204,-209,-208,-206,-80,204,204,-210,-207,204,-212,-211,]),'ENUM':([0,1,3,7,8,9,11,12,14,17,18,19,23,24,26,34,35,36,37,40,42,47,49,51,53,54,55,56,57,60,61,64,65,67,68,70,72,78,87,101,102,103,104,105,117,120,121,122,123,124,125,128,129,130,131,132,139,145,173,187,188,189,201,202,203,206,208,215,217,218,219,220,222,225,231,233,236,258,277,286,287,288,291,293,327,331,336,337,339,340,346,349,351,352,353,360,398,418,419,432,433,437,442,443,480,501,502,504,505,523,524,527,528,],[28,-309,-117,-99,-52,-97,-98,-64,-60,-66,28,-96,-65,-95,28,-63,-118,28,-29,-62,-67,-309,-309,-119,-68,-100,-87,-10,-9,28,-53,-84,28,28,-61,-307,28,-166,28,-83,-86,-88,-69,-30,28,-70,28,-85,28,28,28,-145,-146,-142,-308,28,-167,28,28,-36,-35,28,28,-73,-76,-72,-74,28,-78,-199,-198,-77,-200,-75,28,28,-143,-71,28,-31,28,28,28,-34,28,28,-218,-217,28,-215,-201,-214,-78,-80,-202,-144,28,-33,-32,-213,-216,-205,-79,-203,-204,-209,-208,-206,-80,-210,-207,-212,-211,]),'PERIOD':([70,115,131,150,153,154,155,156,157,158,161,162,170,172,175,177,178,180,181,229,260,276,279,280,282,374,379,383,384,385,386,389,394,452,454,456,459,460,466,486,491,492,507,510,511,518,520,525,],[-307,-294,-308,-298,-286,-301,-305,-302,-299,-284,-285,283,-297,-271,-303,-295,-283,-300,-296,-294,375,-306,-304,-280,-279,-183,375,-278,-277,-276,-275,-274,-287,-186,375,-184,-272,-273,375,-185,508,-289,-288,375,-281,-290,-282,-291,]),'GE':([115,131,150,152,153,154,155,156,157,158,161,162,164,170,172,175,177,178,179,180,181,229,276,278,279,280,282,289,290,292,297,383,384,385,386,389,394,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,416,417,458,459,460,465,507,511,520,],[-294,-308,-298,-257,-286,-301,-305,-302,-299,-284,-285,-259,-238,-297,-271,-303,-295,-283,310,-300,-296,-294,-306,-263,-304,-280,-279,-257,-262,-260,-261,-278,-277,-276,-275,-274,-287,-244,310,-245,-243,-247,310,-246,-242,-249,310,-240,-239,-248,310,310,310,310,-241,-264,-272,-273,-258,-288,-281,-282,]),'INT_CONST_DEC':([3,35,51,53,59,70,76,78,79,101,104,106,107,108,121,131,139,144,147,148,151,159,160,166,167,169,171,173,174,176,184,185,186,198,202,203,206,207,208,214,215,217,218,219,220,222,224,225,228,239,250,253,254,255,260,264,265,266,267,268,269,270,271,272,273,274,275,277,284,285,288,291,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,326,329,330,336,337,339,340,341,342,343,346,348,349,351,352,353,354,355,361,367,368,369,372,376,378,380,395,422,423,424,430,432,433,435,437,439,442,443,454,457,461,463,466,467,469,470,471,477,479,480,481,482,483,487,488,500,501,502,504,505,509,510,514,517,522,523,524,526,527,528,],[-117,-118,-119,-68,-309,-307,-28,-166,-27,-83,-69,177,-28,-309,177,-308,-167,-309,177,177,-270,177,-268,177,-267,177,-266,177,177,-265,-269,177,177,177,-73,-76,-72,177,-74,177,177,-78,-199,-198,-77,-200,177,-75,-266,177,177,177,-28,-309,-309,-227,-230,-228,-224,-225,-229,-231,177,-233,-234,-226,-232,177,177,177,177,177,177,177,177,177,177,177,177,177,177,177,177,177,177,177,177,177,177,177,177,-309,-266,177,-218,-217,177,-215,177,177,177,-201,177,-214,177,-80,-202,177,177,177,-266,177,177,-12,177,177,-11,177,177,-28,-309,-266,-213,-216,177,-205,177,-79,-203,-309,-182,177,177,-309,177,-266,177,177,177,177,-204,177,177,177,177,-11,177,-209,-208,-206,-80,177,-309,177,177,177,-210,-207,177,-212,-211,]),'ARROW':([115,131,150,153,154,155,156,157,158,161,162,170,172,175,177,178,180,181,229,276,279,280,282,383,384,385,386,389,394,459,460,507,511,520,],[-294,-308,-298,-286,-301,-305,-302,-299,-284,-285,281,-297,-271,-303,-295,-283,-300,-296,-294,-306,-304,-280,-279,-278,-277,-276,-275,-274,-287,-272,-273,-288,-281,-282,]),'CHAR':([0,1,2,3,5,6,7,8,9,10,11,12,14,15,16,17,18,19,20,21,23,24,25,26,29,30,32,33,34,35,36,37,39,40,41,42,44,45,47,48,49,50,51,53,54,55,56,57,60,61,63,64,65,67,68,69,70,71,72,73,74,78,80,83,87,91,92,96,101,102,103,104,105,113,117,120,121,122,123,124,125,126,127,128,129,130,131,132,133,139,145,173,187,188,189,201,202,203,206,208,215,217,218,219,220,222,225,231,232,233,234,235,236,237,238,244,249,258,277,286,287,288,291,293,296,327,331,336,337,339,340,346,349,351,352,353,356,357,360,362,363,398,418,419,432,433,437,442,443,480,501,502,504,505,523,524,527,528,],[41,-309,-104,-117,-115,-101,-99,-52,-97,-116,-98,-64,-60,-102,-93,-66,41,-96,-111,-106,-65,-95,-112,41,-221,-109,-113,41,-63,-118,41,-29,-107,-62,-103,-67,-114,-108,-309,-110,-309,-105,-119,-68,-100,-87,-10,-9,41,-53,41,-84,41,41,-61,-133,-307,-132,41,-153,-152,-166,-90,-92,41,-89,-91,-94,-83,-86,-88,-69,-30,41,41,-70,41,-85,41,41,41,-135,-130,-145,-146,-142,-308,41,41,-167,41,41,-36,-35,41,41,-73,-76,-72,-74,41,-78,-199,-198,-77,-200,-75,41,-139,41,-137,-134,-143,-131,-128,-129,-154,-71,41,-31,41,41,41,-34,41,41,41,-218,-217,41,-215,-201,-214,-78,-80,-202,-138,-136,-144,-156,-155,41,-33,-32,-213,-216,-205,-79,-203,-204,-209,-208,-206,-80,-210,-207,-212,-211,]),'HEX_FLOAT_CONST':([3,35,51,53,59,70,76,78,79,101,104,106,107,108,121,131,139,144,147,148,151,159,160,166,167,169,171,173,174,176,184,185,186,198,202,203,206,207,208,214,215,217,218,219,220,222,224,225,228,239,250,253,254,255,260,264,265,266,267,268,269,270,271,272,273,274,275,277,284,285,288,291,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,326,329,330,336,337,339,340,341,342,343,346,348,349,351,352,353,354,355,361,367,368,369,372,376,378,380,395,422,423,424,430,432,433,435,437,439,442,443,454,457,461,463,466,467,469,470,471,477,479,480,481,482,483,487,488,500,501,502,504,505,509,510,514,517,522,523,524,526,527,528,],[-117,-118,-119,-68,-309,-307,-28,-166,-27,-83,-69,180,-28,-309,180,-308,-167,-309,180,180,-270,180,-268,180,-267,180,-266,180,180,-265,-269,180,180,180,-73,-76,-72,180,-74,180,180,-78,-199,-198,-77,-200,180,-75,-266,180,180,180,-28,-309,-309,-227,-230,-228,-224,-225,-229,-231,180,-233,-234,-226,-232,180,180,180,180,180,180,180,180,180,180,180,180,180,180,180,180,180,180,180,180,180,180,180,180,-309,-266,180,-218,-217,180,-215,180,180,180,-201,180,-214,180,-80,-202,180,180,180,-266,180,180,-12,180,180,-11,180,180,-28,-309,-266,-213,-216,180,-205,180,-79,-203,-309,-182,180,180,-309,180,-266,180,180,180,180,-204,180,180,180,180,-11,180,-209,-208,-206,-80,180,-309,180,180,180,-210,-207,180,-212,-211,]),'DOUBLE':([0,1,2,3,5,6,7,8,9,10,11,12,14,15,16,17,18,19,20,21,23,24,25,26,29,30,32,33,34,35,36,37,39,40,41,42,44,45,47,48,49,50,51,53,54,55,56,57,60,61,63,64,65,67,68,69,70,71,72,73,74,78,80,83,87,91,92,96,101,102,103,104,105,113,117,120,121,122,123,124,125,126,127,128,129,130,131,132,133,139,145,173,187,188,189,201,202,203,206,208,215,217,218,219,220,222,225,231,232,233,234,235,236,237,238,244,249,258,277,286,287,288,291,293,296,327,331,336,337,339,340,346,349,351,352,353,356,357,360,362,363,398,418,419,432,433,437,442,443,480,501,502,504,505,523,524,527,528,],[45,-309,-104,-117,-115,-101,-99,-52,-97,-116,-98,-64,-60,-102,-93,-66,45,-96,-111,-106,-65,-95,-112,45,-221,-109,-113,45,-63,-118,45,-29,-107,-62,-103,-67,-114,-108,-309,-110,-309,-105,-119,-68,-100,-87,-10,-9,45,-53,45,-84,45,45,-61,-133,-307,-132,45,-153,-152,-166,-90,-92,45,-89,-91,-94,-83,-86,-88,-69,-30,45,45,-70,45,-85,45,45,45,-135,-130,-145,-146,-142,-308,45,45,-167,45,45,-36,-35,45,45,-73,-76,-72,-74,45,-78,-199,-198,-77,-200,-75,45,-139,45,-137,-134,-143,-131,-128,-129,-154,-71,45,-31,45,45,45,-34,45,45,45,-218,-217,45,-215,-201,-214,-78,-80,-202,-138,-136,-144,-156,-155,45,-33,-32,-213,-216,-205,-79,-203,-204,-209,-208,-206,-80,-210,-207,-212,-211,]),'MINUSEQUAL':([115,131,150,152,153,154,155,156,157,158,161,162,170,172,175,177,178,180,181,229,276,278,279,280,282,289,290,292,297,383,384,385,386,389,394,458,459,460,465,507,511,520,],[-294,-308,-298,265,-286,-301,-305,-302,-299,-284,-285,-259,-297,-271,-303,-295,-283,-300,-296,-294,-306,-263,-304,-280,-279,-257,-262,-260,-261,-278,-277,-276,-275,-274,-287,-264,-272,-273,-258,-288,-281,-282,]),'INT_CONST_OCT':([3,35,51,53,59,70,76,78,79,101,104,106,107,108,121,131,139,144,147,148,151,159,160,166,167,169,171,173,174,176,184,185,186,198,202,203,206,207,208,214,215,217,218,219,220,222,224,225,228,239,250,253,254,255,260,264,265,266,267,268,269,270,271,272,273,274,275,277,284,285,288,291,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,326,329,330,336,337,339,340,341,342,343,346,348,349,351,352,353,354,355,361,367,368,369,372,376,378,380,395,422,423,424,430,432,433,435,437,439,442,443,454,457,461,463,466,467,469,470,471,477,479,480,481,482,483,487,488,500,501,502,504,505,509,510,514,517,522,523,524,526,527,528,],[-117,-118,-119,-68,-309,-307,-28,-166,-27,-83,-69,181,-28,-309,181,-308,-167,-309,181,181,-270,181,-268,181,-267,181,-266,181,181,-265,-269,181,181,181,-73,-76,-72,181,-74,181,181,-78,-199,-198,-77,-200,181,-75,-266,181,181,181,-28,-309,-309,-227,-230,-228,-224,-225,-229,-231,181,-233,-234,-226,-232,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,-309,-266,181,-218,-217,181,-215,181,181,181,-201,181,-214,181,-80,-202,181,181,181,-266,181,181,-12,181,181,-11,181,181,-28,-309,-266,-213,-216,181,-205,181,-79,-203,-309,-182,181,181,-309,181,-266,181,181,181,181,-204,181,181,181,181,-11,181,-209,-208,-206,-80,181,-309,181,181,181,-210,-207,181,-212,-211,]),'TIMESEQUAL':([115,131,150,152,153,154,155,156,157,158,161,162,170,172,175,177,178,180,181,229,276,278,279,280,282,289,290,292,297,383,384,385,386,389,394,458,459,460,465,507,511,520,],[-294,-308,-298,274,-286,-301,-305,-302,-299,-284,-285,-259,-297,-271,-303,-295,-283,-300,-296,-294,-306,-263,-304,-280,-279,-257,-262,-260,-261,-278,-277,-276,-275,-274,-287,-264,-272,-273,-258,-288,-281,-282,]),'OR':([115,131,150,152,153,154,155,156,157,158,161,162,164,170,172,175,177,178,179,180,181,229,276,278,279,280,282,289,290,292,297,383,384,385,386,389,394,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,416,417,458,459,460,465,507,511,520,],[-294,-308,-298,-257,-286,-301,-305,-302,-299,-284,-285,-259,-238,-297,-271,-303,-295,-283,315,-300,-296,-294,-306,-263,-304,-280,-279,-257,-262,-260,-261,-278,-277,-276,-275,-274,-287,-244,315,-245,-243,-247,-251,-246,-242,-249,-254,-240,-239,-248,315,-250,-252,-253,-241,-264,-272,-273,-258,-288,-281,-282,]),'SHORT':([0,1,2,3,5,6,7,8,9,10,11,12,14,15,16,17,18,19,20,21,23,24,25,26,29,30,32,33,34,35,36,37,39,40,41,42,44,45,47,48,49,50,51,53,54,55,56,57,60,61,63,64,65,67,68,69,70,71,72,73,74,78,80,83,87,91,92,96,101,102,103,104,105,113,117,120,121,122,123,124,125,126,127,128,129,130,131,132,133,139,145,173,187,188,189,201,202,203,206,208,215,217,218,219,220,222,225,231,232,233,234,235,236,237,238,244,249,258,277,286,287,288,291,293,296,327,331,336,337,339,340,346,349,351,352,353,356,357,360,362,363,398,418,419,432,433,437,442,443,480,501,502,504,505,523,524,527,528,],[2,-309,-104,-117,-115,-101,-99,-52,-97,-116,-98,-64,-60,-102,-93,-66,2,-96,-111,-106,-65,-95,-112,2,-221,-109,-113,2,-63,-118,2,-29,-107,-62,-103,-67,-114,-108,-309,-110,-309,-105,-119,-68,-100,-87,-10,-9,2,-53,2,-84,2,2,-61,-133,-307,-132,2,-153,-152,-166,-90,-92,2,-89,-91,-94,-83,-86,-88,-69,-30,2,2,-70,2,-85,2,2,2,-135,-130,-145,-146,-142,-308,2,2,-167,2,2,-36,-35,2,2,-73,-76,-72,-74,2,-78,-199,-198,-77,-200,-75,2,-139,2,-137,-134,-143,-131,-128,-129,-154,-71,2,-31,2,2,2,-34,2,2,2,-218,-217,2,-215,-201,-214,-78,-80,-202,-138,-136,-144,-156,-155,2,-33,-32,-213,-216,-205,-79,-203,-204,-209,-208,-206,-80,-210,-207,-212,-211,]),'RETURN':([53,70,101,104,121,131,202,203,206,208,215,217,218,219,220,222,224,225,336,337,340,342,346,349,351,352,353,354,432,433,437,439,442,443,479,480,481,483,501,502,504,505,517,522,523,524,526,527,528,],[-68,-307,-83,-69,207,-308,-73,-76,-72,-74,207,-78,-199,-198,-77,-200,207,-75,-218,-217,-215,207,-201,-214,207,-80,-202,207,-213,-216,-205,207,-79,-203,207,-204,207,207,-209,-208,-206,-80,207,207,-210,-207,207,-212,-211,]),'RSHIFTEQUAL':([115,131,150,152,153,154,155,156,157,158,161,162,170,172,175,177,178,180,181,229,276,278,279,280,282,289,290,292,297,383,384,385,386,389,394,458,459,460,465,507,511,520,],[-294,-308,-298,275,-286,-301,-305,-302,-299,-284,-285,-259,-297,-271,-303,-295,-283,-300,-296,-294,-306,-263,-304,-280,-279,-257,-262,-260,-261,-278,-277,-276,-275,-274,-287,-264,-272,-273,-258,-288,-281,-282,]),'RESTRICT':([0,1,2,3,5,6,7,8,9,10,11,12,14,15,16,17,18,19,20,21,23,24,25,26,29,30,31,32,33,34,35,37,39,40,41,42,44,45,47,48,49,50,51,53,54,59,60,61,63,64,67,68,69,70,71,72,73,74,76,78,80,83,87,91,92,96,101,104,105,107,108,113,120,121,122,123,124,125,126,127,128,129,130,131,132,133,139,144,145,173,187,188,189,201,202,203,206,208,215,217,218,219,220,222,225,231,232,233,234,235,236,237,238,244,249,254,255,258,277,286,287,288,291,293,296,326,327,331,336,337,339,340,346,349,351,352,353,356,357,360,362,363,398,418,419,423,424,432,433,437,442,443,480,501,502,504,505,523,524,527,528,],[35,35,-104,-117,-115,-101,-99,-52,-97,-116,-98,-64,-60,-102,-93,-66,35,-96,-111,-106,-65,-95,-112,35,-221,-109,35,-113,35,-63,-118,-29,-107,-62,-103,-67,-114,-108,35,-110,35,-105,-119,-68,-100,35,35,-53,35,-84,35,-61,-133,-307,-132,35,-153,-152,35,-166,-90,-92,35,-89,-91,-94,-83,-69,-30,35,35,35,-70,35,-85,35,35,35,-135,-130,-145,-146,-142,-308,35,35,-167,35,35,35,-36,-35,35,35,-73,-76,-72,-74,35,-78,-199,-198,-77,-200,-75,35,-139,35,-137,-134,-143,-131,-128,-129,-154,35,35,-71,35,-31,35,35,35,-34,35,35,35,35,-218,-217,35,-215,-201,-214,-78,-80,-202,-138,-136,-144,-156,-155,35,-33,-32,35,35,-213,-216,-205,-79,-203,-204,-209,-208,-206,-80,-210,-207,-212,-211,]),'STATIC':([0,1,2,3,5,6,7,8,9,10,11,12,14,15,16,17,18,19,20,21,23,24,25,26,29,30,32,33,34,35,37,39,40,41,42,44,45,47,48,49,50,51,53,54,59,60,61,63,64,67,68,69,70,71,73,74,78,80,83,87,91,92,96,101,104,105,107,113,120,121,122,126,131,139,144,145,187,188,189,201,202,203,206,208,215,217,218,219,220,222,225,232,234,235,249,254,258,286,293,326,327,331,336,337,339,340,346,349,351,352,353,356,357,362,363,398,418,419,423,432,433,437,442,443,480,501,502,504,505,523,524,527,528,],[9,9,-104,-117,-115,-101,-99,-52,-97,-116,-98,-64,-60,-102,-93,-66,9,-96,-111,-106,-65,-95,-112,9,-221,-109,-113,9,-63,-118,-29,-107,-62,-103,-67,-114,-108,9,-110,9,-105,-119,-68,-100,108,9,-53,9,-84,9,-61,-133,-307,-132,-153,-152,-166,-90,-92,9,-89,-91,-94,-83,-69,-30,185,9,-70,9,-85,-135,-308,-167,255,9,-36,-35,9,9,-73,-76,-72,-74,9,-78,-199,-198,-77,-200,-75,-139,-137,-134,-154,368,-71,-31,-34,424,9,9,-218,-217,9,-215,-201,-214,-78,-80,-202,-138,-136,-156,-155,9,-33,-32,470,-213,-216,-205,-79,-203,-204,-209,-208,-206,-80,-210,-207,-212,-211,]),'SIZEOF':([3,35,51,53,59,70,76,78,79,101,104,106,107,108,121,131,139,144,147,148,151,159,160,166,167,169,171,173,174,176,184,185,186,198,202,203,206,207,208,214,215,217,218,219,220,222,224,225,228,239,250,253,254,255,260,264,265,266,267,268,269,270,271,272,273,274,275,277,284,285,288,291,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,326,329,330,336,337,339,340,341,342,343,346,348,349,351,352,353,354,355,361,367,368,369,372,376,378,380,395,422,423,424,430,432,433,435,437,439,442,443,454,457,461,463,466,467,469,470,471,477,479,480,481,482,483,487,488,500,501,502,504,505,509,510,514,517,522,523,524,526,527,528,],[-117,-118,-119,-68,-309,-307,-28,-166,-27,-83,-69,159,-28,-309,159,-308,-167,-309,159,159,-270,159,-268,159,-267,159,-266,159,159,-265,-269,159,159,159,-73,-76,-72,159,-74,159,159,-78,-199,-198,-77,-200,159,-75,-266,159,159,159,-28,-309,-309,-227,-230,-228,-224,-225,-229,-231,159,-233,-234,-226,-232,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,-309,-266,159,-218,-217,159,-215,159,159,159,-201,159,-214,159,-80,-202,159,159,159,-266,159,159,-12,159,159,-11,159,159,-28,-309,-266,-213,-216,159,-205,159,-79,-203,-309,-182,159,159,-309,159,-266,159,159,159,159,-204,159,159,159,159,-11,159,-209,-208,-206,-80,159,-309,159,159,159,-210,-207,159,-212,-211,]),'UNSIGNED':([0,1,2,3,5,6,7,8,9,10,11,12,14,15,16,17,18,19,20,21,23,24,25,26,29,30,32,33,34,35,36,37,39,40,41,42,44,45,47,48,49,50,51,53,54,55,56,57,60,61,63,64,65,67,68,69,70,71,72,73,74,78,80,83,87,91,92,96,101,102,103,104,105,113,117,120,121,122,123,124,125,126,127,128,129,130,131,132,133,139,145,173,187,188,189,201,202,203,206,208,215,217,218,219,220,222,225,231,232,233,234,235,236,237,238,244,249,258,277,286,287,288,291,293,296,327,331,336,337,339,340,346,349,351,352,353,356,357,360,362,363,398,418,419,432,433,437,442,443,480,501,502,504,505,523,524,527,528,],[20,-309,-104,-117,-115,-101,-99,-52,-97,-116,-98,-64,-60,-102,-93,-66,20,-96,-111,-106,-65,-95,-112,20,-221,-109,-113,20,-63,-118,20,-29,-107,-62,-103,-67,-114,-108,-309,-110,-309,-105,-119,-68,-100,-87,-10,-9,20,-53,20,-84,20,20,-61,-133,-307,-132,20,-153,-152,-166,-90,-92,20,-89,-91,-94,-83,-86,-88,-69,-30,20,20,-70,20,-85,20,20,20,-135,-130,-145,-146,-142,-308,20,20,-167,20,20,-36,-35,20,20,-73,-76,-72,-74,20,-78,-199,-198,-77,-200,-75,20,-139,20,-137,-134,-143,-131,-128,-129,-154,-71,20,-31,20,20,20,-34,20,20,20,-218,-217,20,-215,-201,-214,-78,-80,-202,-138,-136,-144,-156,-155,20,-33,-32,-213,-216,-205,-79,-203,-204,-209,-208,-206,-80,-210,-207,-212,-211,]),'UNION':([0,1,3,7,8,9,11,12,14,17,18,19,23,24,26,34,35,36,37,40,42,47,49,51,53,54,55,56,57,60,61,64,65,67,68,70,72,78,87,101,102,103,104,105,117,120,121,122,123,124,125,128,129,130,131,132,139,145,173,187,188,189,201,202,203,206,208,215,217,218,219,220,222,225,231,233,236,258,277,286,287,288,291,293,327,331,336,337,339,340,346,349,351,352,353,360,398,418,419,432,433,437,442,443,480,501,502,504,505,523,524,527,528,],[22,-309,-117,-99,-52,-97,-98,-64,-60,-66,22,-96,-65,-95,22,-63,-118,22,-29,-62,-67,-309,-309,-119,-68,-100,-87,-10,-9,22,-53,-84,22,22,-61,-307,22,-166,22,-83,-86,-88,-69,-30,22,-70,22,-85,22,22,22,-145,-146,-142,-308,22,-167,22,22,-36,-35,22,22,-73,-76,-72,-74,22,-78,-199,-198,-77,-200,-75,22,22,-143,-71,22,-31,22,22,22,-34,22,22,-218,-217,22,-215,-201,-214,-78,-80,-202,-144,22,-33,-32,-213,-216,-205,-79,-203,-204,-209,-208,-206,-80,-210,-207,-212,-211,]),'COLON':([2,3,5,6,8,10,15,20,21,25,29,30,32,35,37,39,41,44,45,48,50,51,61,69,71,73,74,85,86,88,105,115,119,126,127,131,133,143,150,152,153,154,155,156,157,158,161,162,164,170,172,175,177,178,179,180,181,183,187,188,212,227,229,232,234,235,237,238,244,245,249,251,276,278,279,280,282,286,289,290,292,293,297,344,345,356,357,359,362,363,370,371,381,383,384,385,386,389,394,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,436,447,448,458,459,460,465,484,485,494,507,511,520,],[-104,-117,-115,-101,-52,-116,-102,-111,-106,-112,-221,-109,-113,-118,-29,-107,-103,-114,-108,-110,-105,-119,-53,-133,-132,-153,-152,-54,-163,-37,-30,-294,-162,-135,-130,-308,239,-55,-298,-257,-286,-301,-305,-302,-299,-284,-285,-259,-238,-297,-271,-303,-295,-283,-236,-300,-296,-222,-36,-35,342,-219,354,-139,-137,-134,-131,-128,-129,361,-154,-38,-306,-263,-304,-280,-279,-31,-257,-262,-260,-34,-261,439,-235,-138,-136,239,-156,-155,-44,-43,-223,-278,-277,-276,-275,-274,-287,-244,-256,-245,-243,-247,-251,-246,-242,-249,-254,-240,-239,-248,-255,-250,-252,467,-253,-241,-33,-32,-220,-39,-42,-264,-272,-273,-258,-41,-40,-237,-288,-281,-282,]),'$end':([0,12,14,17,23,26,34,40,42,43,52,53,68,101,104,120,131,258,353,],[-309,-64,-60,-66,-65,-58,-63,-62,-67,0,-59,-68,-61,-83,-69,-70,-308,-71,-202,]),'WSTRING_LITERAL':([3,35,51,53,59,70,76,78,79,101,104,106,107,108,121,131,139,144,147,148,151,153,155,159,160,166,167,169,171,173,174,176,184,185,186,198,202,203,206,207,208,214,215,217,218,219,220,222,224,225,228,239,250,253,254,255,260,264,265,266,267,268,269,270,271,272,273,274,275,276,277,284,285,288,291,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,326,329,330,336,337,339,340,341,342,343,346,348,349,351,352,353,354,355,361,367,368,369,372,376,378,380,395,422,423,424,430,432,433,435,437,439,442,443,454,457,461,463,466,467,469,470,471,477,479,480,481,482,483,487,488,500,501,502,504,505,509,510,514,517,522,523,524,526,527,528,],[-117,-118,-119,-68,-309,-307,-28,-166,-27,-83,-69,155,-28,-309,155,-308,-167,-309,155,155,-270,276,-305,155,-268,155,-267,155,-266,155,155,-265,-269,155,155,155,-73,-76,-72,155,-74,155,155,-78,-199,-198,-77,-200,155,-75,-266,155,155,155,-28,-309,-309,-227,-230,-228,-224,-225,-229,-231,155,-233,-234,-226,-232,-306,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,-309,-266,155,-218,-217,155,-215,155,155,155,-201,155,-214,155,-80,-202,155,155,155,-266,155,155,-12,155,155,-11,155,155,-28,-309,-266,-213,-216,155,-205,155,-79,-203,-309,-182,155,155,-309,155,-266,155,155,155,155,-204,155,155,155,155,-11,155,-209,-208,-206,-80,155,-309,155,155,155,-210,-207,155,-212,-211,]),'DIVIDE':([115,131,150,152,153,154,155,156,157,158,161,162,164,170,172,175,177,178,179,180,181,229,276,278,279,280,282,289,290,292,297,383,384,385,386,389,394,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,416,417,458,459,460,465,507,511,520,],[-294,-308,-298,-257,-286,-301,-305,-302,-299,-284,-285,-259,-238,-297,-271,-303,-295,-283,308,-300,-296,-294,-306,-263,-304,-280,-279,-257,-262,-260,-261,-278,-277,-276,-275,-274,-287,308,308,308,308,308,308,308,308,308,308,-240,-239,308,308,308,308,308,-241,-264,-272,-273,-258,-288,-281,-282,]),'FOR':([53,70,101,104,121,131,202,203,206,208,215,217,218,219,220,222,224,225,336,337,340,342,346,349,351,352,353,354,432,433,437,439,442,443,479,480,481,483,501,502,504,505,517,522,523,524,526,527,528,],[-68,-307,-83,-69,209,-308,-73,-76,-72,-74,209,-78,-199,-198,-77,-200,209,-75,-218,-217,-215,209,-201,-214,209,-80,-202,209,-213,-216,-205,209,-79,-203,209,-204,209,209,-209,-208,-206,-80,209,209,-210,-207,209,-212,-211,]),'PLUSPLUS':([3,35,51,53,59,70,76,78,79,101,104,106,107,108,115,121,131,139,144,147,148,150,151,153,154,155,156,157,158,159,160,161,162,166,167,169,170,171,172,173,174,175,176,177,178,180,181,184,185,186,198,202,203,206,207,208,214,215,217,218,219,220,222,224,225,228,229,239,250,253,254,255,260,264,265,266,267,268,269,270,271,272,273,274,275,276,277,279,280,282,284,285,288,291,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,326,329,330,336,337,339,340,341,342,343,346,348,349,351,352,353,354,355,361,367,368,369,372,376,378,380,383,384,385,386,389,394,395,422,423,424,430,432,433,435,437,439,442,443,454,457,459,460,461,463,466,467,469,470,471,477,479,480,481,482,483,487,488,500,501,502,504,505,507,509,510,511,514,517,520,522,523,524,526,527,528,],[-117,-118,-119,-68,-309,-307,-28,-166,-27,-83,-69,169,-28,-309,-294,169,-308,-167,-309,169,169,-298,-270,-286,-301,-305,-302,-299,-284,169,-268,-285,282,169,-267,169,-297,-266,-271,169,169,-303,-265,-295,-283,-300,-296,-269,169,169,169,-73,-76,-72,169,-74,169,169,-78,-199,-198,-77,-200,169,-75,-266,-294,169,169,169,-28,-309,-309,-227,-230,-228,-224,-225,-229,-231,169,-233,-234,-226,-232,-306,169,-304,-280,-279,169,169,169,169,169,169,169,169,169,169,169,169,169,169,169,169,169,169,169,169,169,169,169,-309,-266,169,-218,-217,169,-215,169,169,169,-201,169,-214,169,-80,-202,169,169,169,-266,169,169,-12,169,169,-11,-278,-277,-276,-275,-274,-287,169,169,-28,-309,-266,-213,-216,169,-205,169,-79,-203,-309,-182,-272,-273,169,169,-309,169,-266,169,169,169,169,-204,169,169,169,169,-11,169,-209,-208,-206,-80,-288,169,-309,-281,169,169,-282,169,-210,-207,169,-212,-211,]),'EQUALS':([8,37,61,85,86,87,88,89,97,105,115,119,131,138,143,150,152,153,154,155,156,157,158,161,162,170,172,175,177,178,180,181,187,188,229,251,276,278,279,280,282,286,289,290,292,293,297,370,371,374,379,383,384,385,386,389,394,418,419,447,448,452,456,458,459,460,465,484,485,486,507,511,520,],[-52,-29,-53,-54,-163,-162,-37,147,148,-30,-294,-162,-308,250,-55,-298,267,-286,-301,-305,-302,-299,-284,-285,-259,-297,-271,-303,-295,-283,-300,-296,-36,-35,-294,-38,-306,-263,-304,-280,-279,-31,-257,-262,-260,-34,-261,-44,-43,-183,457,-278,-277,-276,-275,-274,-287,-33,-32,-39,-42,-186,-184,-264,-272,-273,-258,-41,-40,-185,-288,-281,-282,]),'ELSE':([53,104,131,202,203,206,208,217,220,225,336,337,340,349,351,352,353,432,433,437,442,443,480,501,502,504,505,523,524,527,528,],[-68,-69,-308,-73,-76,-72,-74,-78,-77,-75,-218,-217,-215,-214,-78,-80,-202,-213,-216,-205,-79,-203,-204,-209,-208,-206,517,-210,-207,-212,-211,]),'ANDEQUAL':([115,131,150,152,153,154,155,156,157,158,161,162,170,172,175,177,178,180,181,229,276,278,279,280,282,289,290,292,297,383,384,385,386,389,394,458,459,460,465,507,511,520,],[-294,-308,-298,272,-286,-301,-305,-302,-299,-284,-285,-259,-297,-271,-303,-295,-283,-300,-296,-294,-306,-263,-304,-280,-279,-257,-262,-260,-261,-278,-277,-276,-275,-274,-287,-264,-272,-273,-258,-288,-281,-282,]),'EQ':([115,131,150,152,153,154,155,156,157,158,161,162,164,170,172,175,177,178,179,180,181,229,276,278,279,280,282,289,290,292,297,383,384,385,386,389,394,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,416,417,458,459,460,465,507,511,520,],[-294,-308,-298,-257,-286,-301,-305,-302,-299,-284,-285,-259,-238,-297,-271,-303,-295,-283,312,-300,-296,-294,-306,-263,-304,-280,-279,-257,-262,-260,-261,-278,-277,-276,-275,-274,-287,-244,312,-245,-243,-247,-251,-246,-242,-249,312,-240,-239,-248,312,-250,312,312,-241,-264,-272,-273,-258,-288,-281,-282,]),'AND':([3,35,51,53,59,70,76,78,79,101,104,106,107,108,115,121,131,139,144,147,148,150,151,152,153,154,155,156,157,158,159,160,161,162,164,166,167,169,170,171,172,173,174,175,176,177,178,179,180,181,184,185,186,198,202,203,206,207,208,214,215,217,218,219,220,222,224,225,228,229,239,250,253,254,255,260,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,282,284,285,288,289,290,291,292,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,326,329,330,336,337,339,340,341,342,343,346,348,349,351,352,353,354,355,361,367,368,369,372,376,378,380,383,384,385,386,389,394,395,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,416,417,422,423,424,430,432,433,435,437,439,442,443,454,457,458,459,460,461,463,465,466,467,469,470,471,477,479,480,481,482,483,487,488,500,501,502,504,505,507,509,510,511,514,517,520,522,523,524,526,527,528,],[-117,-118,-119,-68,-309,-307,-28,-166,-27,-83,-69,176,-28,-309,-294,176,-308,-167,-309,176,176,-298,-270,-257,-286,-301,-305,-302,-299,-284,176,-268,-285,-259,-238,176,-267,176,-297,-266,-271,176,176,-303,-265,-295,-283,313,-300,-296,-269,176,176,176,-73,-76,-72,176,-74,176,176,-78,-199,-198,-77,-200,176,-75,-266,-294,176,176,176,-28,-309,-309,-227,-230,-228,-224,-225,-229,-231,176,-233,-234,-226,-232,-306,176,-263,-304,-280,-279,176,176,176,-257,-262,176,-260,-261,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,-309,-266,176,-218,-217,176,-215,176,176,176,-201,176,-214,176,-80,-202,176,176,176,-266,176,176,-12,176,176,-11,-278,-277,-276,-275,-274,-287,176,-244,313,-245,-243,-247,-251,-246,-242,-249,313,-240,-239,-248,313,-250,-252,313,-241,176,-28,-309,-266,-213,-216,176,-205,176,-79,-203,-309,-182,-264,-272,-273,176,176,-258,-309,176,-266,176,176,176,176,-204,176,176,176,176,-11,176,-209,-208,-206,-80,-288,176,-309,-281,176,176,-282,176,-210,-207,176,-212,-211,]),'TYPEID':([0,1,2,3,5,6,7,8,9,10,11,12,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,44,45,47,48,49,50,51,53,54,55,56,57,60,61,63,64,65,67,68,69,70,71,72,73,74,76,77,78,79,80,81,83,84,87,91,92,96,101,102,103,104,105,113,117,120,121,122,123,124,125,126,127,128,129,130,131,132,133,139,140,142,145,149,173,187,188,189,192,201,202,203,206,208,215,217,218,219,220,222,225,231,232,233,234,235,236,237,238,244,249,258,277,281,283,286,287,288,291,293,327,331,336,337,339,340,346,349,351,352,353,356,357,359,360,362,363,398,418,419,432,433,437,442,443,480,501,502,504,505,523,524,527,528,],[29,-309,-104,-117,-115,-101,-99,-52,-97,-116,-98,-64,-60,-102,-93,-66,29,-96,-111,-106,-141,-65,-95,-112,29,69,73,-221,-109,-309,-113,88,-63,-118,29,-29,-140,-107,-62,-103,-67,-114,-108,-309,-110,-309,-105,-119,-68,-100,-87,-10,-9,29,-53,88,-84,29,29,-61,-133,-307,-132,29,-153,-152,-28,-164,-166,-27,-90,88,-92,88,29,-89,-91,-94,-83,-86,-88,-69,-30,196,29,-70,29,-85,29,29,29,-135,-130,-145,-146,-142,-308,29,88,-167,-165,88,29,88,29,-36,-35,29,196,29,-73,-76,-72,-74,29,-78,-199,-198,-77,-200,-75,29,-139,29,-137,-134,-143,-131,-128,-129,-154,-71,29,383,385,-31,29,29,29,-34,29,29,-218,-217,29,-215,-201,-214,-78,-80,-202,-138,-136,88,-144,-156,-155,29,-33,-32,-213,-216,-205,-79,-203,-204,-209,-208,-206,-80,-210,-207,-212,-211,]),'LBRACE':([8,18,22,27,28,37,38,53,61,62,64,66,67,69,70,71,73,74,87,101,104,105,121,122,131,146,147,148,187,188,202,203,206,208,215,217,218,219,220,222,224,225,260,286,293,336,337,340,342,346,349,351,352,353,354,372,378,380,395,418,419,432,433,437,439,442,443,454,457,458,463,464,466,479,480,481,483,487,488,501,502,504,505,510,517,522,523,524,526,527,528,],[-52,-309,-141,70,70,-29,-140,-68,-53,-7,-84,70,-8,70,-307,70,70,70,-309,-83,-69,-30,70,-85,-308,70,70,70,-36,-35,-73,-76,-72,-74,70,-78,-199,-198,-77,-200,70,-75,-309,-31,-34,-218,-217,-215,70,-201,-214,70,-80,-202,70,-12,70,-11,70,-33,-32,-213,-216,-205,70,-79,-203,-309,-182,70,70,70,-309,70,-204,70,70,70,-11,-209,-208,-206,-80,-309,70,70,-210,-207,70,-212,-211,]),'PPHASH':([0,12,14,17,23,26,34,40,42,53,68,101,104,120,131,258,353,],[42,-64,-60,-66,-65,42,-63,-62,-67,-68,-61,-83,-69,-70,-308,-71,-202,]),'INT':([0,1,2,3,5,6,7,8,9,10,11,12,14,15,16,17,18,19,20,21,23,24,25,26,29,30,32,33,34,35,36,37,39,40,41,42,44,45,47,48,49,50,51,53,54,55,56,57,60,61,63,64,65,67,68,69,70,71,72,73,74,78,80,83,87,91,92,96,101,102,103,104,105,113,117,120,121,122,123,124,125,126,127,128,129,130,131,132,133,139,145,173,187,188,189,201,202,203,206,208,215,217,218,219,220,222,225,231,232,233,234,235,236,237,238,244,249,258,277,286,287,288,291,293,296,327,331,336,337,339,340,346,349,351,352,353,356,357,360,362,363,398,418,419,432,433,437,442,443,480,501,502,504,505,523,524,527,528,],[50,-309,-104,-117,-115,-101,-99,-52,-97,-116,-98,-64,-60,-102,-93,-66,50,-96,-111,-106,-65,-95,-112,50,-221,-109,-113,50,-63,-118,50,-29,-107,-62,-103,-67,-114,-108,-309,-110,-309,-105,-119,-68,-100,-87,-10,-9,50,-53,50,-84,50,50,-61,-133,-307,-132,50,-153,-152,-166,-90,-92,50,-89,-91,-94,-83,-86,-88,-69,-30,50,50,-70,50,-85,50,50,50,-135,-130,-145,-146,-142,-308,50,50,-167,50,50,-36,-35,50,50,-73,-76,-72,-74,50,-78,-199,-198,-77,-200,-75,50,-139,50,-137,-134,-143,-131,-128,-129,-154,-71,50,-31,50,50,50,-34,50,50,50,-218,-217,50,-215,-201,-214,-78,-80,-202,-138,-136,-144,-156,-155,50,-33,-32,-213,-216,-205,-79,-203,-204,-209,-208,-206,-80,-210,-207,-212,-211,]),'SIGNED':([0,1,2,3,5,6,7,8,9,10,11,12,14,15,16,17,18,19,20,21,23,24,25,26,29,30,32,33,34,35,36,37,39,40,41,42,44,45,47,48,49,50,51,53,54,55,56,57,60,61,63,64,65,67,68,69,70,71,72,73,74,78,80,83,87,91,92,96,101,102,103,104,105,113,117,120,121,122,123,124,125,126,127,128,129,130,131,132,133,139,145,173,187,188,189,201,202,203,206,208,215,217,218,219,220,222,225,231,232,233,234,235,236,237,238,244,249,258,277,286,287,288,291,293,296,327,331,336,337,339,340,346,349,351,352,353,356,357,360,362,363,398,418,419,432,433,437,442,443,480,501,502,504,505,523,524,527,528,],[48,-309,-104,-117,-115,-101,-99,-52,-97,-116,-98,-64,-60,-102,-93,-66,48,-96,-111,-106,-65,-95,-112,48,-221,-109,-113,48,-63,-118,48,-29,-107,-62,-103,-67,-114,-108,-309,-110,-309,-105,-119,-68,-100,-87,-10,-9,48,-53,48,-84,48,48,-61,-133,-307,-132,48,-153,-152,-166,-90,-92,48,-89,-91,-94,-83,-86,-88,-69,-30,48,48,-70,48,-85,48,48,48,-135,-130,-145,-146,-142,-308,48,48,-167,48,48,-36,-35,48,48,-73,-76,-72,-74,48,-78,-199,-198,-77,-200,-75,48,-139,48,-137,-134,-143,-131,-128,-129,-154,-71,48,-31,48,48,48,-34,48,48,48,-218,-217,48,-215,-201,-214,-78,-80,-202,-138,-136,-144,-156,-155,48,-33,-32,-213,-216,-205,-79,-203,-204,-209,-208,-206,-80,-210,-207,-212,-211,]),'CONTINUE':([53,70,101,104,121,131,202,203,206,208,215,217,218,219,220,222,224,225,336,337,340,342,346,349,351,352,353,354,432,433,437,439,442,443,479,480,481,483,501,502,504,505,517,522,523,524,526,527,528,],[-68,-307,-83,-69,210,-308,-73,-76,-72,-74,210,-78,-199,-198,-77,-200,210,-75,-218,-217,-215,210,-201,-214,210,-80,-202,210,-213,-216,-205,210,-79,-203,210,-204,210,210,-209,-208,-206,-80,210,210,-210,-207,210,-212,-211,]),'NOT':([3,35,51,53,59,70,76,78,79,101,104,106,107,108,121,131,139,144,147,148,151,159,160,166,167,169,171,173,174,176,184,185,186,198,202,203,206,207,208,214,215,217,218,219,220,222,224,225,228,239,250,253,254,255,260,264,265,266,267,268,269,270,271,272,273,274,275,277,284,285,288,291,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,326,329,330,336,337,339,340,341,342,343,346,348,349,351,352,353,354,355,361,367,368,369,372,376,378,380,395,422,423,424,430,432,433,435,437,439,442,443,454,457,461,463,466,467,469,470,471,477,479,480,481,482,483,487,488,500,501,502,504,505,509,510,514,517,522,523,524,526,527,528,],[-117,-118,-119,-68,-309,-307,-28,-166,-27,-83,-69,184,-28,-309,184,-308,-167,-309,184,184,-270,184,-268,184,-267,184,-266,184,184,-265,-269,184,184,184,-73,-76,-72,184,-74,184,184,-78,-199,-198,-77,-200,184,-75,-266,184,184,184,-28,-309,-309,-227,-230,-228,-224,-225,-229,-231,184,-233,-234,-226,-232,184,184,184,184,184,184,184,184,184,184,184,184,184,184,184,184,184,184,184,184,184,184,184,184,-309,-266,184,-218,-217,184,-215,184,184,184,-201,184,-214,184,-80,-202,184,184,184,-266,184,184,-12,184,184,-11,184,184,-28,-309,-266,-213,-216,184,-205,184,-79,-203,-309,-182,184,184,-309,184,-266,184,184,184,184,-204,184,184,184,184,-11,184,-209,-208,-206,-80,184,-309,184,184,184,-210,-207,184,-212,-211,]),'OREQUAL':([115,131,150,152,153,154,155,156,157,158,161,162,170,172,175,177,178,180,181,229,276,278,279,280,282,289,290,292,297,383,384,385,386,389,394,458,459,460,465,507,511,520,],[-294,-308,-298,273,-286,-301,-305,-302,-299,-284,-285,-259,-297,-271,-303,-295,-283,-300,-296,-294,-306,-263,-304,-280,-279,-257,-262,-260,-261,-278,-277,-276,-275,-274,-287,-264,-272,-273,-258,-288,-281,-282,]),'MOD':([115,131,150,152,153,154,155,156,157,158,161,162,164,170,172,175,177,178,179,180,181,229,276,278,279,280,282,289,290,292,297,383,384,385,386,389,394,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,416,417,458,459,460,465,507,511,520,],[-294,-308,-298,-257,-286,-301,-305,-302,-299,-284,-285,-259,-238,-297,-271,-303,-295,-283,316,-300,-296,-294,-306,-263,-304,-280,-279,-257,-262,-260,-261,-278,-277,-276,-275,-274,-287,316,316,316,316,316,316,316,316,316,316,-240,-239,316,316,316,316,316,-241,-264,-272,-273,-258,-288,-281,-282,]),'RSHIFT':([115,131,150,152,153,154,155,156,157,158,161,162,164,170,172,175,177,178,179,180,181,229,276,278,279,280,282,289,290,292,297,383,384,385,386,389,394,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,416,417,458,459,460,465,507,511,520,],[-294,-308,-298,-257,-286,-301,-305,-302,-299,-284,-285,-259,-238,-297,-271,-303,-295,-283,298,-300,-296,-294,-306,-263,-304,-280,-279,-257,-262,-260,-261,-278,-277,-276,-275,-274,-287,-244,298,-245,-243,298,298,298,-242,298,298,-240,-239,298,298,298,298,298,-241,-264,-272,-273,-258,-288,-281,-282,]),'DEFAULT':([53,70,101,104,121,131,202,203,206,208,215,217,218,219,220,222,224,225,336,337,340,342,346,349,351,352,353,354,432,433,437,439,442,443,479,480,481,483,501,502,504,505,517,522,523,524,526,527,528,],[-68,-307,-83,-69,212,-308,-73,-76,-72,-74,212,-78,-199,-198,-77,-200,212,-75,-218,-217,-215,212,-201,-214,212,-80,-202,212,-213,-216,-205,212,-79,-203,212,-204,212,212,-209,-208,-206,-80,212,212,-210,-207,212,-212,-211,]),'__INT128':([0,1,2,3,5,6,7,8,9,10,11,12,14,15,16,17,18,19,20,21,23,24,25,26,29,30,32,33,34,35,36,37,39,40,41,42,44,45,47,48,49,50,51,53,54,55,56,57,60,61,63,64,65,67,68,69,70,71,72,73,74,78,80,83,87,91,92,96,101,102,103,104,105,113,117,120,121,122,123,124,125,126,127,128,129,130,131,132,133,139,145,173,187,188,189,201,202,203,206,208,215,217,218,219,220,222,225,231,232,233,234,235,236,237,238,244,249,258,277,286,287,288,291,293,296,327,331,336,337,339,340,346,349,351,352,353,356,357,360,362,363,398,418,419,432,433,437,442,443,480,501,502,504,505,523,524,527,528,],[25,-309,-104,-117,-115,-101,-99,-52,-97,-116,-98,-64,-60,-102,-93,-66,25,-96,-111,-106,-65,-95,-112,25,-221,-109,-113,25,-63,-118,25,-29,-107,-62,-103,-67,-114,-108,-309,-110,-309,-105,-119,-68,-100,-87,-10,-9,25,-53,25,-84,25,25,-61,-133,-307,-132,25,-153,-152,-166,-90,-92,25,-89,-91,-94,-83,-86,-88,-69,-30,25,25,-70,25,-85,25,25,25,-135,-130,-145,-146,-142,-308,25,25,-167,25,25,-36,-35,25,25,-73,-76,-72,-74,25,-78,-199,-198,-77,-200,-75,25,-139,25,-137,-134,-143,-131,-128,-129,-154,-71,25,-31,25,25,25,-34,25,25,25,-218,-217,25,-215,-201,-214,-78,-80,-202,-138,-136,-144,-156,-155,25,-33,-32,-213,-216,-205,-79,-203,-204,-209,-208,-206,-80,-210,-207,-212,-211,]),'WHILE':([53,70,101,104,121,131,202,203,206,208,215,217,218,219,220,222,224,225,336,337,340,342,346,349,350,351,352,353,354,432,433,437,439,442,443,479,480,481,483,501,502,504,505,517,522,523,524,526,527,528,],[-68,-307,-83,-69,213,-308,-73,-76,-72,-74,213,-78,-199,-198,-77,-200,213,-75,-218,-217,-215,213,-201,-214,441,213,-80,-202,213,-213,-216,-205,213,-79,-203,213,-204,213,213,-209,-208,-206,-80,213,213,-210,-207,213,-212,-211,]),'DIVEQUAL':([115,131,150,152,153,154,155,156,157,158,161,162,170,172,175,177,178,180,181,229,276,278,279,280,282,289,290,292,297,383,384,385,386,389,394,458,459,460,465,507,511,520,],[-294,-308,-298,264,-286,-301,-305,-302,-299,-284,-285,-259,-297,-271,-303,-295,-283,-300,-296,-294,-306,-263,-304,-280,-279,-257,-262,-260,-261,-278,-277,-276,-275,-274,-287,-264,-272,-273,-258,-288,-281,-282,]),'EXTERN':([0,1,2,3,5,6,7,8,9,10,11,12,14,15,16,17,18,19,20,21,23,24,25,26,29,30,32,33,34,35,37,39,40,41,42,44,45,47,48,49,50,51,53,54,60,61,63,64,67,68,69,70,71,73,74,80,83,87,91,92,96,101,104,105,113,120,121,122,126,131,145,187,188,189,201,202,203,206,208,215,217,218,219,220,222,225,232,234,235,249,258,286,293,327,331,336,337,339,340,346,349,351,352,353,356,357,362,363,398,418,419,432,433,437,442,443,480,501,502,504,505,523,524,527,528,],[11,11,-104,-117,-115,-101,-99,-52,-97,-116,-98,-64,-60,-102,-93,-66,11,-96,-111,-106,-65,-95,-112,11,-221,-109,-113,11,-63,-118,-29,-107,-62,-103,-67,-114,-108,11,-110,11,-105,-119,-68,-100,11,-53,11,-84,11,-61,-133,-307,-132,-153,-152,-90,-92,11,-89,-91,-94,-83,-69,-30,11,-70,11,-85,-135,-308,11,-36,-35,11,11,-73,-76,-72,-74,11,-78,-199,-198,-77,-200,-75,-139,-137,-134,-154,-71,-31,-34,11,11,-218,-217,11,-215,-201,-214,-78,-80,-202,-138,-136,-156,-155,11,-33,-32,-213,-216,-205,-79,-203,-204,-209,-208,-206,-80,-210,-207,-212,-211,]),'CASE':([53,70,101,104,121,131,202,203,206,208,215,217,218,219,220,222,224,225,336,337,340,342,346,349,351,352,353,354,432,433,437,439,442,443,479,480,481,483,501,502,504,505,517,522,523,524,526,527,528,],[-68,-307,-83,-69,214,-308,-73,-76,-72,-74,214,-78,-199,-198,-77,-200,214,-75,-218,-217,-215,214,-201,-214,214,-80,-202,214,-213,-216,-205,214,-79,-203,214,-204,214,214,-209,-208,-206,-80,214,214,-210,-207,214,-212,-211,]),'LAND':([115,131,150,152,153,154,155,156,157,158,161,162,164,170,172,175,177,178,179,180,181,229,276,278,279,280,282,289,290,292,297,383,384,385,386,389,394,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,416,417,458,459,460,465,507,511,520,],[-294,-308,-298,-257,-286,-301,-305,-302,-299,-284,-285,-259,-238,-297,-271,-303,-295,-283,311,-300,-296,-294,-306,-263,-304,-280,-279,-257,-262,-260,-261,-278,-277,-276,-275,-274,-287,-244,311,-245,-243,-247,-251,-246,-242,-249,-254,-240,-239,-248,-255,-250,-252,-253,-241,-264,-272,-273,-258,-288,-281,-282,]),'REGISTER':([0,1,2,3,5,6,7,8,9,10,11,12,14,15,16,17,18,19,20,21,23,24,25,26,29,30,32,33,34,35,37,39,40,41,42,44,45,47,48,49,50,51,53,54,60,61,63,64,67,68,69,70,71,73,74,80,83,87,91,92,96,101,104,105,113,120,121,122,126,131,145,187,188,189,201,202,203,206,208,215,217,218,219,220,222,225,232,234,235,249,258,286,293,327,331,336,337,339,340,346,349,351,352,353,356,357,362,363,398,418,419,432,433,437,442,443,480,501,502,504,505,523,524,527,528,],[19,19,-104,-117,-115,-101,-99,-52,-97,-116,-98,-64,-60,-102,-93,-66,19,-96,-111,-106,-65,-95,-112,19,-221,-109,-113,19,-63,-118,-29,-107,-62,-103,-67,-114,-108,19,-110,19,-105,-119,-68,-100,19,-53,19,-84,19,-61,-133,-307,-132,-153,-152,-90,-92,19,-89,-91,-94,-83,-69,-30,19,-70,19,-85,-135,-308,19,-36,-35,19,19,-73,-76,-72,-74,19,-78,-199,-198,-77,-200,-75,-139,-137,-134,-154,-71,-31,-34,19,19,-218,-217,19,-215,-201,-214,-78,-80,-202,-138,-136,-156,-155,19,-33,-32,-213,-216,-205,-79,-203,-204,-209,-208,-206,-80,-210,-207,-212,-211,]),'MODEQUAL':([115,131,150,152,153,154,155,156,157,158,161,162,170,172,175,177,178,180,181,229,276,278,279,280,282,289,290,292,297,383,384,385,386,389,394,458,459,460,465,507,511,520,],[-294,-308,-298,266,-286,-301,-305,-302,-299,-284,-285,-259,-297,-271,-303,-295,-283,-300,-296,-294,-306,-263,-304,-280,-279,-257,-262,-260,-261,-278,-277,-276,-275,-274,-287,-264,-272,-273,-258,-288,-281,-282,]),'NE':([115,131,150,152,153,154,155,156,157,158,161,162,164,170,172,175,177,178,179,180,181,229,276,278,279,280,282,289,290,292,297,383,384,385,386,389,394,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,416,417,458,459,460,465,507,511,520,],[-294,-308,-298,-257,-286,-301,-305,-302,-299,-284,-285,-259,-238,-297,-271,-303,-295,-283,303,-300,-296,-294,-306,-263,-304,-280,-279,-257,-262,-260,-261,-278,-277,-276,-275,-274,-287,-244,303,-245,-243,-247,-251,-246,-242,-249,303,-240,-239,-248,303,-250,303,303,-241,-264,-272,-273,-258,-288,-281,-282,]),'SWITCH':([53,70,101,104,121,131,202,203,206,208,215,217,218,219,220,222,224,225,336,337,340,342,346,349,351,352,353,354,432,433,437,439,442,443,479,480,481,483,501,502,504,505,517,522,523,524,526,527,528,],[-68,-307,-83,-69,216,-308,-73,-76,-72,-74,216,-78,-199,-198,-77,-200,216,-75,-218,-217,-215,216,-201,-214,216,-80,-202,216,-213,-216,-205,216,-79,-203,216,-204,216,216,-209,-208,-206,-80,216,216,-210,-207,216,-212,-211,]),'INT_CONST_HEX':([3,35,51,53,59,70,76,78,79,101,104,106,107,108,121,131,139,144,147,148,151,159,160,166,167,169,171,173,174,176,184,185,186,198,202,203,206,207,208,214,215,217,218,219,220,222,224,225,228,239,250,253,254,255,260,264,265,266,267,268,269,270,271,272,273,274,275,277,284,285,288,291,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,326,329,330,336,337,339,340,341,342,343,346,348,349,351,352,353,354,355,361,367,368,369,372,376,378,380,395,422,423,424,430,432,433,435,437,439,442,443,454,457,461,463,466,467,469,470,471,477,479,480,481,482,483,487,488,500,501,502,504,505,509,510,514,517,522,523,524,526,527,528,],[-117,-118,-119,-68,-309,-307,-28,-166,-27,-83,-69,170,-28,-309,170,-308,-167,-309,170,170,-270,170,-268,170,-267,170,-266,170,170,-265,-269,170,170,170,-73,-76,-72,170,-74,170,170,-78,-199,-198,-77,-200,170,-75,-266,170,170,170,-28,-309,-309,-227,-230,-228,-224,-225,-229,-231,170,-233,-234,-226,-232,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,-309,-266,170,-218,-217,170,-215,170,170,170,-201,170,-214,170,-80,-202,170,170,170,-266,170,170,-12,170,170,-11,170,170,-28,-309,-266,-213,-216,170,-205,170,-79,-203,-309,-182,170,170,-309,170,-266,170,170,170,170,-204,170,170,170,170,-11,170,-209,-208,-206,-80,170,-309,170,170,170,-210,-207,170,-212,-211,]),'_COMPLEX':([0,1,2,3,5,6,7,8,9,10,11,12,14,15,16,17,18,19,20,21,23,24,25,26,29,30,32,33,34,35,36,37,39,40,41,42,44,45,47,48,49,50,51,53,54,55,56,57,60,61,63,64,65,67,68,69,70,71,72,73,74,78,80,83,87,91,92,96,101,102,103,104,105,113,117,120,121,122,123,124,125,126,127,128,129,130,131,132,133,139,145,173,187,188,189,201,202,203,206,208,215,217,218,219,220,222,225,231,232,233,234,235,236,237,238,244,249,258,277,286,287,288,291,293,296,327,331,336,337,339,340,346,349,351,352,353,356,357,360,362,363,398,418,419,432,433,437,442,443,480,501,502,504,505,523,524,527,528,],[30,-309,-104,-117,-115,-101,-99,-52,-97,-116,-98,-64,-60,-102,-93,-66,30,-96,-111,-106,-65,-95,-112,30,-221,-109,-113,30,-63,-118,30,-29,-107,-62,-103,-67,-114,-108,-309,-110,-309,-105,-119,-68,-100,-87,-10,-9,30,-53,30,-84,30,30,-61,-133,-307,-132,30,-153,-152,-166,-90,-92,30,-89,-91,-94,-83,-86,-88,-69,-30,30,30,-70,30,-85,30,30,30,-135,-130,-145,-146,-142,-308,30,30,-167,30,30,-36,-35,30,30,-73,-76,-72,-74,30,-78,-199,-198,-77,-200,-75,30,-139,30,-137,-134,-143,-131,-128,-129,-154,-71,30,-31,30,30,30,-34,30,30,30,-218,-217,30,-215,-201,-214,-78,-80,-202,-138,-136,-144,-156,-155,30,-33,-32,-213,-216,-205,-79,-203,-204,-209,-208,-206,-80,-210,-207,-212,-211,]),'PPPRAGMASTR':([53,],[104,]),'PLUSEQUAL':([115,131,150,152,153,154,155,156,157,158,161,162,170,172,175,177,178,180,181,229,276,278,279,280,282,289,290,292,297,383,384,385,386,389,394,458,459,460,465,507,511,520,],[-294,-308,-298,269,-286,-301,-305,-302,-299,-284,-285,-259,-297,-271,-303,-295,-283,-300,-296,-294,-306,-263,-304,-280,-279,-257,-262,-260,-261,-278,-277,-276,-275,-274,-287,-264,-272,-273,-258,-288,-281,-282,]),'STRUCT':([0,1,3,7,8,9,11,12,14,17,18,19,23,24,26,34,35,36,37,40,42,47,49,51,53,54,55,56,57,60,61,64,65,67,68,70,72,78,87,101,102,103,104,105,117,120,121,122,123,124,125,128,129,130,131,132,139,145,173,187,188,189,201,202,203,206,208,215,217,218,219,220,222,225,231,233,236,258,277,286,287,288,291,293,327,331,336,337,339,340,346,349,351,352,353,360,398,418,419,432,433,437,442,443,480,501,502,504,505,523,524,527,528,],[38,-309,-117,-99,-52,-97,-98,-64,-60,-66,38,-96,-65,-95,38,-63,-118,38,-29,-62,-67,-309,-309,-119,-68,-100,-87,-10,-9,38,-53,-84,38,38,-61,-307,38,-166,38,-83,-86,-88,-69,-30,38,-70,38,-85,38,38,38,-145,-146,-142,-308,38,-167,38,38,-36,-35,38,38,-73,-76,-72,-74,38,-78,-199,-198,-77,-200,-75,38,38,-143,-71,38,-31,38,38,38,-34,38,38,-218,-217,38,-215,-201,-214,-78,-80,-202,-144,38,-33,-32,-213,-216,-205,-79,-203,-204,-209,-208,-206,-80,-210,-207,-212,-211,]),'CONDOP':([115,131,150,152,153,154,155,156,157,158,161,162,164,170,172,175,177,178,179,180,181,229,276,278,279,280,282,289,290,292,297,383,384,385,386,389,394,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,416,417,458,459,460,465,507,511,520,],[-294,-308,-298,-257,-286,-301,-305,-302,-299,-284,-285,-259,-238,-297,-271,-303,-295,-283,314,-300,-296,-294,-306,-263,-304,-280,-279,-257,-262,-260,-261,-278,-277,-276,-275,-274,-287,-244,-256,-245,-243,-247,-251,-246,-242,-249,-254,-240,-239,-248,-255,-250,-252,-253,-241,-264,-272,-273,-258,-288,-281,-282,]),'BREAK':([53,70,101,104,121,131,202,203,206,208,215,217,218,219,220,222,224,225,336,337,340,342,346,349,351,352,353,354,432,433,437,439,442,443,479,480,481,483,501,502,504,505,517,522,523,524,526,527,528,],[-68,-307,-83,-69,221,-308,-73,-76,-72,-74,221,-78,-199,-198,-77,-200,221,-75,-218,-217,-215,221,-201,-214,221,-80,-202,221,-213,-216,-205,221,-79,-203,221,-204,221,221,-209,-208,-206,-80,221,221,-210,-207,221,-212,-211,]),'VOLATILE':([0,1,2,3,5,6,7,8,9,10,11,12,14,15,16,17,18,19,20,21,23,24,25,26,29,30,31,32,33,34,35,37,39,40,41,42,44,45,47,48,49,50,51,53,54,59,60,61,63,64,67,68,69,70,71,72,73,74,76,78,80,83,87,91,92,96,101,104,105,107,108,113,120,121,122,123,124,125,126,127,128,129,130,131,132,133,139,144,145,173,187,188,189,201,202,203,206,208,215,217,218,219,220,222,225,231,232,233,234,235,236,237,238,244,249,254,255,258,277,286,287,288,291,293,296,326,327,331,336,337,339,340,346,349,351,352,353,356,357,360,362,363,398,418,419,423,424,432,433,437,442,443,480,501,502,504,505,523,524,527,528,],[51,51,-104,-117,-115,-101,-99,-52,-97,-116,-98,-64,-60,-102,-93,-66,51,-96,-111,-106,-65,-95,-112,51,-221,-109,51,-113,51,-63,-118,-29,-107,-62,-103,-67,-114,-108,51,-110,51,-105,-119,-68,-100,51,51,-53,51,-84,51,-61,-133,-307,-132,51,-153,-152,51,-166,-90,-92,51,-89,-91,-94,-83,-69,-30,51,51,51,-70,51,-85,51,51,51,-135,-130,-145,-146,-142,-308,51,51,-167,51,51,51,-36,-35,51,51,-73,-76,-72,-74,51,-78,-199,-198,-77,-200,-75,51,-139,51,-137,-134,-143,-131,-128,-129,-154,51,51,-71,51,-31,51,51,51,-34,51,51,51,51,-218,-217,51,-215,-201,-214,-78,-80,-202,-138,-136,-144,-156,-155,51,-33,-32,51,51,-213,-216,-205,-79,-203,-204,-209,-208,-206,-80,-210,-207,-212,-211,]),'PPPRAGMA':([0,12,14,17,23,26,34,40,42,53,68,70,72,101,104,120,121,123,124,125,128,129,130,131,202,203,206,208,215,217,218,219,220,222,224,225,231,233,236,258,336,337,340,342,346,349,351,352,353,354,360,432,433,437,439,442,443,479,480,481,483,501,502,504,505,517,522,523,524,526,527,528,],[53,-64,-60,-66,-65,53,-63,-62,-67,-68,-61,-307,53,-83,-69,-70,53,53,53,53,-145,-146,-142,-308,-73,-76,-72,-74,53,-78,-199,-198,-77,-200,53,-75,53,53,-143,-71,-218,-217,-215,53,-201,-214,53,-80,-202,53,-144,-213,-216,-205,53,-79,-203,53,-204,53,53,-209,-208,-206,-80,53,53,-210,-207,53,-212,-211,]),'INLINE':([0,1,2,3,5,6,7,8,9,10,11,12,14,15,16,17,18,19,20,21,23,24,25,26,29,30,32,33,34,35,37,39,40,41,42,44,45,47,48,49,50,51,53,54,60,61,63,64,67,68,69,70,71,73,74,80,83,87,91,92,96,101,104,105,113,120,121,122,126,131,145,187,188,189,201,202,203,206,208,215,217,218,219,220,222,225,232,234,235,249,258,286,293,327,331,336,337,339,340,346,349,351,352,353,356,357,362,363,398,418,419,432,433,437,442,443,480,501,502,504,505,523,524,527,528,],[54,54,-104,-117,-115,-101,-99,-52,-97,-116,-98,-64,-60,-102,-93,-66,54,-96,-111,-106,-65,-95,-112,54,-221,-109,-113,54,-63,-118,-29,-107,-62,-103,-67,-114,-108,54,-110,54,-105,-119,-68,-100,54,-53,54,-84,54,-61,-133,-307,-132,-153,-152,-90,-92,54,-89,-91,-94,-83,-69,-30,54,-70,54,-85,-135,-308,54,-36,-35,54,54,-73,-76,-72,-74,54,-78,-199,-198,-77,-200,-75,-139,-137,-134,-154,-71,-31,-34,54,54,-218,-217,54,-215,-201,-214,-78,-80,-202,-138,-136,-156,-155,54,-33,-32,-213,-216,-205,-79,-203,-204,-209,-208,-206,-80,-210,-207,-212,-211,]),'INT_CONST_BIN':([3,35,51,53,59,70,76,78,79,101,104,106,107,108,121,131,139,144,147,148,151,159,160,166,167,169,171,173,174,176,184,185,186,198,202,203,206,207,208,214,215,217,218,219,220,222,224,225,228,239,250,253,254,255,260,264,265,266,267,268,269,270,271,272,273,274,275,277,284,285,288,291,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,326,329,330,336,337,339,340,341,342,343,346,348,349,351,352,353,354,355,361,367,368,369,372,376,378,380,395,422,423,424,430,432,433,435,437,439,442,443,454,457,461,463,466,467,469,470,471,477,479,480,481,482,483,487,488,500,501,502,504,505,509,510,514,517,522,523,524,526,527,528,],[-117,-118,-119,-68,-309,-307,-28,-166,-27,-83,-69,150,-28,-309,150,-308,-167,-309,150,150,-270,150,-268,150,-267,150,-266,150,150,-265,-269,150,150,150,-73,-76,-72,150,-74,150,150,-78,-199,-198,-77,-200,150,-75,-266,150,150,150,-28,-309,-309,-227,-230,-228,-224,-225,-229,-231,150,-233,-234,-226,-232,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,-309,-266,150,-218,-217,150,-215,150,150,150,-201,150,-214,150,-80,-202,150,150,150,-266,150,150,-12,150,150,-11,150,150,-28,-309,-266,-213,-216,150,-205,150,-79,-203,-309,-182,150,150,-309,150,-266,150,150,150,150,-204,150,150,150,150,-11,150,-209,-208,-206,-80,150,-309,150,150,150,-210,-207,150,-212,-211,]),'DO':([53,70,101,104,121,131,202,203,206,208,215,217,218,219,220,222,224,225,336,337,340,342,346,349,351,352,353,354,432,433,437,439,442,443,479,480,481,483,501,502,504,505,517,522,523,524,526,527,528,],[-68,-307,-83,-69,224,-308,-73,-76,-72,-74,224,-78,-199,-198,-77,-200,224,-75,-218,-217,-215,224,-201,-214,224,-80,-202,224,-213,-216,-205,224,-79,-203,224,-204,224,224,-209,-208,-206,-80,224,224,-210,-207,224,-212,-211,]),'LNOT':([3,35,51,53,59,70,76,78,79,101,104,106,107,108,121,131,139,144,147,148,151,159,160,166,167,169,171,173,174,176,184,185,186,198,202,203,206,207,208,214,215,217,218,219,220,222,224,225,228,239,250,253,254,255,260,264,265,266,267,268,269,270,271,272,273,274,275,277,284,285,288,291,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,326,329,330,336,337,339,340,341,342,343,346,348,349,351,352,353,354,355,361,367,368,369,372,376,378,380,395,422,423,424,430,432,433,435,437,439,442,443,454,457,461,463,466,467,469,470,471,477,479,480,481,482,483,487,488,500,501,502,504,505,509,510,514,517,522,523,524,526,527,528,],[-117,-118,-119,-68,-309,-307,-28,-166,-27,-83,-69,151,-28,-309,151,-308,-167,-309,151,151,-270,151,-268,151,-267,151,-266,151,151,-265,-269,151,151,151,-73,-76,-72,151,-74,151,151,-78,-199,-198,-77,-200,151,-75,-266,151,151,151,-28,-309,-309,-227,-230,-228,-224,-225,-229,-231,151,-233,-234,-226,-232,151,151,151,151,151,151,151,151,151,151,151,151,151,151,151,151,151,151,151,151,151,151,151,151,-309,-266,151,-218,-217,151,-215,151,151,151,-201,151,-214,151,-80,-202,151,151,151,-266,151,151,-12,151,151,-11,151,151,-28,-309,-266,-213,-216,151,-205,151,-79,-203,-309,-182,151,151,-309,151,-266,151,151,151,151,-204,151,151,151,151,-11,151,-209,-208,-206,-80,151,-309,151,151,151,-210,-207,151,-212,-211,]),'CONST':([0,1,2,3,5,6,7,8,9,10,11,12,14,15,16,17,18,19,20,21,23,24,25,26,29,30,31,32,33,34,35,37,39,40,41,42,44,45,47,48,49,50,51,53,54,59,60,61,63,64,67,68,69,70,71,72,73,74,76,78,80,83,87,91,92,96,101,104,105,107,108,113,120,121,122,123,124,125,126,127,128,129,130,131,132,133,139,144,145,173,187,188,189,201,202,203,206,208,215,217,218,219,220,222,225,231,232,233,234,235,236,237,238,244,249,254,255,258,277,286,287,288,291,293,296,326,327,331,336,337,339,340,346,349,351,352,353,356,357,360,362,363,398,418,419,423,424,432,433,437,442,443,480,501,502,504,505,523,524,527,528,],[3,3,-104,-117,-115,-101,-99,-52,-97,-116,-98,-64,-60,-102,-93,-66,3,-96,-111,-106,-65,-95,-112,3,-221,-109,3,-113,3,-63,-118,-29,-107,-62,-103,-67,-114,-108,3,-110,3,-105,-119,-68,-100,3,3,-53,3,-84,3,-61,-133,-307,-132,3,-153,-152,3,-166,-90,-92,3,-89,-91,-94,-83,-69,-30,3,3,3,-70,3,-85,3,3,3,-135,-130,-145,-146,-142,-308,3,3,-167,3,3,3,-36,-35,3,3,-73,-76,-72,-74,3,-78,-199,-198,-77,-200,-75,3,-139,3,-137,-134,-143,-131,-128,-129,-154,3,3,-71,3,-31,3,3,3,-34,3,3,3,3,-218,-217,3,-215,-201,-214,-78,-80,-202,-138,-136,-144,-156,-155,3,-33,-32,3,3,-213,-216,-205,-79,-203,-204,-209,-208,-206,-80,-210,-207,-212,-211,]),'LOR':([115,131,150,152,153,154,155,156,157,158,161,162,164,170,172,175,177,178,179,180,181,229,276,278,279,280,282,289,290,292,297,383,384,385,386,389,394,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,416,417,458,459,460,465,507,511,520,],[-294,-308,-298,-257,-286,-301,-305,-302,-299,-284,-285,-259,-238,-297,-271,-303,-295,-283,299,-300,-296,-294,-306,-263,-304,-280,-279,-257,-262,-260,-261,-278,-277,-276,-275,-274,-287,-244,-256,-245,-243,-247,-251,-246,-242,-249,-254,-240,-239,-248,-255,-250,-252,-253,-241,-264,-272,-273,-258,-288,-281,-282,]),'CHAR_CONST':([3,35,51,53,59,70,76,78,79,101,104,106,107,108,121,131,139,144,147,148,151,159,160,166,167,169,171,173,174,176,184,185,186,198,202,203,206,207,208,214,215,217,218,219,220,222,224,225,228,239,250,253,254,255,260,264,265,266,267,268,269,270,271,272,273,274,275,277,284,285,288,291,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,326,329,330,336,337,339,340,341,342,343,346,348,349,351,352,353,354,355,361,367,368,369,372,376,378,380,395,422,423,424,430,432,433,435,437,439,442,443,454,457,461,463,466,467,469,470,471,477,479,480,481,482,483,487,488,500,501,502,504,505,509,510,514,517,522,523,524,526,527,528,],[-117,-118,-119,-68,-309,-307,-28,-166,-27,-83,-69,154,-28,-309,154,-308,-167,-309,154,154,-270,154,-268,154,-267,154,-266,154,154,-265,-269,154,154,154,-73,-76,-72,154,-74,154,154,-78,-199,-198,-77,-200,154,-75,-266,154,154,154,-28,-309,-309,-227,-230,-228,-224,-225,-229,-231,154,-233,-234,-226,-232,154,154,154,154,154,154,154,154,154,154,154,154,154,154,154,154,154,154,154,154,154,154,154,154,-309,-266,154,-218,-217,154,-215,154,154,154,-201,154,-214,154,-80,-202,154,154,154,-266,154,154,-12,154,154,-11,154,154,-28,-309,-266,-213,-216,154,-205,154,-79,-203,-309,-182,154,154,-309,154,-266,154,154,154,154,-204,154,154,154,154,-11,154,-209,-208,-206,-80,154,-309,154,154,154,-210,-207,154,-212,-211,]),'LSHIFT':([115,131,150,152,153,154,155,156,157,158,161,162,164,170,172,175,177,178,179,180,181,229,276,278,279,280,282,289,290,292,297,383,384,385,386,389,394,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,416,417,458,459,460,465,507,511,520,],[-294,-308,-298,-257,-286,-301,-305,-302,-299,-284,-285,-259,-238,-297,-271,-303,-295,-283,300,-300,-296,-294,-306,-263,-304,-280,-279,-257,-262,-260,-261,-278,-277,-276,-275,-274,-287,-244,300,-245,-243,300,300,300,-242,300,300,-240,-239,300,300,300,300,300,-241,-264,-272,-273,-258,-288,-281,-282,]),'RBRACE':([53,70,72,101,104,115,121,123,124,125,128,129,130,131,136,137,138,150,152,153,154,155,156,157,158,161,162,164,170,172,175,177,178,179,180,181,183,202,203,206,208,215,217,218,219,220,222,223,225,226,231,233,236,246,247,248,260,261,276,278,279,280,282,289,290,292,297,336,337,340,345,346,349,351,352,353,360,364,365,373,377,380,381,383,384,385,386,389,394,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,416,417,432,433,437,442,443,451,454,455,458,459,460,465,480,489,493,494,501,502,504,505,506,507,510,511,520,523,524,527,528,],[-68,-307,131,-83,-69,-294,-309,131,131,131,-145,-146,-142,-308,-157,131,-160,-298,-257,-286,-301,-305,-302,-299,-284,-285,-259,-238,-297,-271,-303,-295,-283,-236,-300,-296,-222,-73,-76,-72,-74,-6,-78,-199,-198,-77,-200,-5,-75,131,131,131,-143,131,131,-158,-309,-177,-306,-263,-304,-280,-279,-257,-262,-260,-261,-218,-217,-215,-235,-201,-214,-78,-80,-202,-144,-159,-161,131,-22,-21,-223,-278,-277,-276,-275,-274,-287,-244,-256,-245,-243,-247,-251,-246,-242,-249,-254,-240,-239,-248,-255,-250,-252,-253,-241,-213,-216,-205,-79,-203,-178,131,-180,-264,-272,-273,-258,-204,-179,131,-237,-209,-208,-206,-80,-181,-288,131,-281,-282,-210,-207,-212,-211,]),'_BOOL':([0,1,2,3,5,6,7,8,9,10,11,12,14,15,16,17,18,19,20,21,23,24,25,26,29,30,32,33,34,35,36,37,39,40,41,42,44,45,47,48,49,50,51,53,54,55,56,57,60,61,63,64,65,67,68,69,70,71,72,73,74,78,80,83,87,91,92,96,101,102,103,104,105,113,117,120,121,122,123,124,125,126,127,128,129,130,131,132,133,139,145,173,187,188,189,201,202,203,206,208,215,217,218,219,220,222,225,231,232,233,234,235,236,237,238,244,249,258,277,286,287,288,291,293,296,327,331,336,337,339,340,346,349,351,352,353,356,357,360,362,363,398,418,419,432,433,437,442,443,480,501,502,504,505,523,524,527,528,],[15,-309,-104,-117,-115,-101,-99,-52,-97,-116,-98,-64,-60,-102,-93,-66,15,-96,-111,-106,-65,-95,-112,15,-221,-109,-113,15,-63,-118,15,-29,-107,-62,-103,-67,-114,-108,-309,-110,-309,-105,-119,-68,-100,-87,-10,-9,15,-53,15,-84,15,15,-61,-133,-307,-132,15,-153,-152,-166,-90,-92,15,-89,-91,-94,-83,-86,-88,-69,-30,15,15,-70,15,-85,15,15,15,-135,-130,-145,-146,-142,-308,15,15,-167,15,15,-36,-35,15,15,-73,-76,-72,-74,15,-78,-199,-198,-77,-200,-75,15,-139,15,-137,-134,-143,-131,-128,-129,-154,-71,15,-31,15,15,15,-34,15,15,15,-218,-217,15,-215,-201,-214,-78,-80,-202,-138,-136,-144,-156,-155,15,-33,-32,-213,-216,-205,-79,-203,-204,-209,-208,-206,-80,-210,-207,-212,-211,]),'LE':([115,131,150,152,153,154,155,156,157,158,161,162,164,170,172,175,177,178,179,180,181,229,276,278,279,280,282,289,290,292,297,383,384,385,386,389,394,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,416,417,458,459,460,465,507,511,520,],[-294,-308,-298,-257,-286,-301,-305,-302,-299,-284,-285,-259,-238,-297,-271,-303,-295,-283,302,-300,-296,-294,-306,-263,-304,-280,-279,-257,-262,-260,-261,-278,-277,-276,-275,-274,-287,-244,302,-245,-243,-247,302,-246,-242,-249,302,-240,-239,-248,302,302,302,302,-241,-264,-272,-273,-258,-288,-281,-282,]),'SEMI':([0,1,2,3,5,6,7,8,9,10,11,12,14,15,16,17,19,20,21,23,24,25,26,29,30,32,33,34,35,36,37,39,40,41,42,44,45,46,47,48,49,50,51,53,54,55,56,57,61,63,65,68,69,70,71,72,73,74,80,82,83,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,115,119,120,121,123,124,125,126,127,128,129,130,131,133,143,150,152,153,154,155,156,157,158,161,162,164,170,172,175,177,178,179,180,181,183,187,188,202,203,205,206,207,208,210,211,215,217,218,219,220,221,222,223,224,225,227,229,231,232,233,234,235,236,237,238,240,241,242,243,244,245,249,251,252,258,259,261,262,263,276,278,279,280,282,286,289,290,292,293,297,335,336,337,338,339,340,342,345,346,347,349,351,352,353,354,356,357,358,360,362,363,370,371,381,383,384,385,386,389,394,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,416,417,418,419,432,433,434,435,436,437,439,442,443,445,446,447,448,451,458,459,460,465,477,478,479,480,481,483,484,485,489,494,499,501,502,504,505,507,511,516,517,520,522,523,524,526,527,528,],[17,-309,-104,-117,-115,-101,-99,-52,-97,-116,-98,-64,-60,-102,-93,-66,-96,-111,-106,-65,-95,-112,17,-221,-109,-113,-309,-63,-118,-309,-29,-107,-62,-103,-67,-114,-108,101,-309,-110,-309,-105,-119,-68,-100,-87,-10,-9,-53,-309,-309,-61,-133,-307,-132,128,-153,-152,-90,-20,-92,-54,-163,-162,-37,-122,-81,-89,-91,-19,-120,-124,-94,-126,-16,-82,-15,-83,-86,-88,-69,-30,-294,-162,-70,-309,128,128,128,-135,-130,-145,-146,-142,-308,-309,-55,-298,-257,-286,-301,-305,-302,-299,-284,-285,-259,-238,-297,-271,-303,-295,-283,-236,-300,-296,-222,-36,-35,-73,-76,336,-72,337,-74,340,-14,-309,-78,-199,-198,-77,349,-200,-13,-309,-75,-219,-294,128,-139,128,-137,-134,-143,-131,-128,-26,-25,360,-147,-129,-149,-154,-38,-121,-71,-123,-177,-127,-125,-306,-263,-304,-280,-279,-31,-257,-262,-260,-34,-261,432,-218,-217,433,-309,-215,-309,-235,-201,-13,-214,-78,-80,-202,-309,-138,-136,-151,-144,-156,-155,-44,-43,-223,-278,-277,-276,-275,-274,-287,-244,-256,-245,-243,-247,-251,-246,-242,-249,-254,-240,-239,-248,-255,-250,-252,-253,-241,-33,-32,-213,-216,477,-309,-220,-205,-309,-79,-203,-148,-150,-39,-42,-178,-264,-272,-273,-258,-309,500,-309,-204,-309,-309,-41,-40,-179,-237,514,-209,-208,-206,-80,-288,-281,523,-309,-282,-309,-210,-207,-309,-212,-211,]),'LT':([115,131,150,152,153,154,155,156,157,158,161,162,164,170,172,175,177,178,179,180,181,229,276,278,279,280,282,289,290,292,297,383,384,385,386,389,394,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,416,417,458,459,460,465,507,511,520,],[-294,-308,-298,-257,-286,-301,-305,-302,-299,-284,-285,-259,-238,-297,-271,-303,-295,-283,304,-300,-296,-294,-306,-263,-304,-280,-279,-257,-262,-260,-261,-278,-277,-276,-275,-274,-287,-244,304,-245,-243,-247,304,-246,-242,-249,304,-240,-239,-248,304,304,304,304,-241,-264,-272,-273,-258,-288,-281,-282,]),'COMMA':([2,3,5,6,7,8,9,10,11,15,16,19,20,21,24,25,29,30,31,32,35,37,39,41,44,45,48,50,51,54,61,69,71,73,74,76,77,78,79,80,82,83,85,86,87,88,89,91,92,94,95,96,97,98,105,112,113,114,115,116,118,119,126,127,131,136,137,138,139,140,143,150,152,153,154,155,156,157,158,161,162,164,170,172,175,177,178,179,180,181,183,187,188,190,191,192,193,194,195,196,197,199,211,227,229,232,234,235,237,238,240,243,244,245,246,247,248,249,251,252,259,261,262,263,276,278,279,280,282,286,289,290,292,293,294,296,297,324,325,332,334,338,345,356,357,358,362,363,364,365,370,371,377,381,383,384,385,386,387,388,389,390,391,394,396,397,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,420,421,427,428,436,438,440,444,445,446,447,448,451,455,458,459,460,465,472,473,474,475,476,484,485,489,490,493,494,495,496,503,506,507,511,512,513,519,520,],[-104,-117,-115,-101,-99,-52,-97,-116,-98,-102,-93,-96,-111,-106,-95,-112,-221,-109,-309,-113,-118,-29,-107,-103,-114,-108,-110,-105,-119,-100,-53,-133,-132,-153,-152,-28,-164,-166,-27,-90,142,-92,-54,-163,-162,-37,-122,-89,-91,-120,-124,-94,-126,149,-30,-170,-309,200,-294,201,-175,-162,-135,-130,-308,-157,248,-160,-167,-165,-55,-298,-257,-286,-301,-305,-302,-299,-284,-285,-259,-238,-297,-271,-303,-295,-283,-236,-300,-296,-222,-36,-35,-174,-2,-188,-56,-172,-1,-45,-173,-190,341,-219,-294,-139,-137,-134,-131,-128,359,-147,-129,-149,248,248,-158,-154,-38,-121,-123,-177,-127,-125,-306,-263,-304,-280,-279,-31,-257,-262,-260,-34,341,-309,-261,-57,-189,-176,-171,341,-235,-138,-136,-151,-156,-155,-159,-161,-44,-43,454,-223,-278,-277,-276,-275,341,-292,-274,461,462,-287,-187,-188,-244,-256,-245,-243,-247,-251,-246,-242,-249,-254,-240,-239,-248,-255,-250,-252,341,-253,-241,-33,-32,-197,-191,-193,-195,-220,341,341,341,-148,-150,-39,-42,-178,-180,-264,-272,-273,-258,-51,-50,-192,-194,-196,-41,-40,-179,-293,510,-237,-46,-49,341,-181,-288,-281,-48,-47,341,-282,]),'OFFSETOF':([3,35,51,53,59,70,76,78,79,101,104,106,107,108,121,131,139,144,147,148,151,159,160,166,167,169,171,173,174,176,184,185,186,198,202,203,206,207,208,214,215,217,218,219,220,222,224,225,228,239,250,253,254,255,260,264,265,266,267,268,269,270,271,272,273,274,275,277,284,285,288,291,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,326,329,330,336,337,339,340,341,342,343,346,348,349,351,352,353,354,355,361,367,368,369,372,376,378,380,395,422,423,424,430,432,433,435,437,439,442,443,454,457,461,463,466,467,469,470,471,477,479,480,481,482,483,487,488,500,501,502,504,505,509,510,514,517,522,523,524,526,527,528,],[-117,-118,-119,-68,-309,-307,-28,-166,-27,-83,-69,165,-28,-309,165,-308,-167,-309,165,165,-270,165,-268,165,-267,165,-266,165,165,-265,-269,165,165,165,-73,-76,-72,165,-74,165,165,-78,-199,-198,-77,-200,165,-75,-266,165,165,165,-28,-309,-309,-227,-230,-228,-224,-225,-229,-231,165,-233,-234,-226,-232,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,-309,-266,165,-218,-217,165,-215,165,165,165,-201,165,-214,165,-80,-202,165,165,165,-266,165,165,-12,165,165,-11,165,165,-28,-309,-266,-213,-216,165,-205,165,-79,-203,-309,-182,165,165,-309,165,-266,165,165,165,165,-204,165,165,165,165,-11,165,-209,-208,-206,-80,165,-309,165,165,165,-210,-207,165,-212,-211,]),'TYPEDEF':([0,1,2,3,5,6,7,8,9,10,11,12,14,15,16,17,18,19,20,21,23,24,25,26,29,30,32,33,34,35,37,39,40,41,42,44,45,47,48,49,50,51,53,54,60,61,63,64,67,68,69,70,71,73,74,80,83,87,91,92,96,101,104,105,113,120,121,122,126,131,145,187,188,189,201,202,203,206,208,215,217,218,219,220,222,225,232,234,235,249,258,286,293,327,331,336,337,339,340,346,349,351,352,353,356,357,362,363,398,418,419,432,433,437,442,443,480,501,502,504,505,523,524,527,528,],[7,7,-104,-117,-115,-101,-99,-52,-97,-116,-98,-64,-60,-102,-93,-66,7,-96,-111,-106,-65,-95,-112,7,-221,-109,-113,7,-63,-118,-29,-107,-62,-103,-67,-114,-108,7,-110,7,-105,-119,-68,-100,7,-53,7,-84,7,-61,-133,-307,-132,-153,-152,-90,-92,7,-89,-91,-94,-83,-69,-30,7,-70,7,-85,-135,-308,7,-36,-35,7,7,-73,-76,-72,-74,7,-78,-199,-198,-77,-200,-75,-139,-137,-134,-154,-71,-31,-34,7,7,-218,-217,7,-215,-201,-214,-78,-80,-202,-138,-136,-156,-155,7,-33,-32,-213,-216,-205,-79,-203,-204,-209,-208,-206,-80,-210,-207,-212,-211,]),'XOR':([115,131,150,152,153,154,155,156,157,158,161,162,164,170,172,175,177,178,179,180,181,229,276,278,279,280,282,289,290,292,297,383,384,385,386,389,394,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,416,417,458,459,460,465,507,511,520,],[-294,-308,-298,-257,-286,-301,-305,-302,-299,-284,-285,-259,-238,-297,-271,-303,-295,-283,307,-300,-296,-294,-306,-263,-304,-280,-279,-257,-262,-260,-261,-278,-277,-276,-275,-274,-287,-244,307,-245,-243,-247,-251,-246,-242,-249,-254,-240,-239,-248,307,-250,-252,307,-241,-264,-272,-273,-258,-288,-281,-282,]),'AUTO':([0,1,2,3,5,6,7,8,9,10,11,12,14,15,16,17,18,19,20,21,23,24,25,26,29,30,32,33,34,35,37,39,40,41,42,44,45,47,48,49,50,51,53,54,60,61,63,64,67,68,69,70,71,73,74,80,83,87,91,92,96,101,104,105,113,120,121,122,126,131,145,187,188,189,201,202,203,206,208,215,217,218,219,220,222,225,232,234,235,249,258,286,293,327,331,336,337,339,340,346,349,351,352,353,356,357,362,363,398,418,419,432,433,437,442,443,480,501,502,504,505,523,524,527,528,],[24,24,-104,-117,-115,-101,-99,-52,-97,-116,-98,-64,-60,-102,-93,-66,24,-96,-111,-106,-65,-95,-112,24,-221,-109,-113,24,-63,-118,-29,-107,-62,-103,-67,-114,-108,24,-110,24,-105,-119,-68,-100,24,-53,24,-84,24,-61,-133,-307,-132,-153,-152,-90,-92,24,-89,-91,-94,-83,-69,-30,24,-70,24,-85,-135,-308,24,-36,-35,24,24,-73,-76,-72,-74,24,-78,-199,-198,-77,-200,-75,-139,-137,-134,-154,-71,-31,-34,24,24,-218,-217,24,-215,-201,-214,-78,-80,-202,-138,-136,-156,-155,24,-33,-32,-213,-216,-205,-79,-203,-204,-209,-208,-206,-80,-210,-207,-212,-211,]),'TIMES':([0,1,2,3,4,5,6,7,9,10,11,12,14,15,16,17,19,20,21,23,24,25,26,29,30,31,32,33,34,35,36,39,40,41,42,44,45,47,48,49,50,51,53,54,55,56,57,59,63,65,68,69,70,71,73,74,76,77,78,79,80,81,83,91,92,96,101,102,103,104,106,107,108,113,115,120,121,126,127,131,133,139,142,144,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,164,166,167,169,170,171,172,173,174,175,176,177,178,179,180,181,184,185,186,189,198,202,203,206,207,208,214,215,217,218,219,220,222,224,225,228,229,232,234,235,237,238,239,244,249,250,253,254,255,258,260,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,282,284,285,288,289,290,291,292,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,326,329,330,336,337,339,340,341,342,343,346,348,349,351,352,353,354,355,356,357,359,361,362,363,367,368,369,372,376,378,380,383,384,385,386,389,394,395,398,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,416,417,422,423,424,430,432,433,435,437,439,442,443,454,457,458,459,460,461,463,465,466,467,469,470,471,477,479,480,481,482,483,487,488,500,501,502,504,505,507,509,510,511,514,517,520,522,523,524,526,527,528,],[31,-309,-104,-117,31,-115,-101,-99,-97,-116,-98,-64,-60,-102,-93,-66,-96,-111,-106,-65,-95,-112,31,-221,-109,-309,-113,31,-63,-118,31,-107,-62,-103,-67,-114,-108,-309,-110,-309,-105,-119,-68,-100,-87,-10,-9,-309,31,31,-61,-133,-307,-132,-153,-152,-28,31,-166,-27,-90,31,-92,-89,-91,-94,-83,-86,-88,-69,171,-28,-309,31,-294,-70,228,-135,-130,-308,31,-167,31,-309,228,228,31,-298,-270,-257,-286,-301,-305,-302,-299,-284,228,-268,-285,-259,-238,228,-267,228,-297,-266,-271,228,228,-303,-265,-295,-283,309,-300,-296,-269,228,228,31,329,-73,-76,-72,228,-74,228,228,-78,-199,-198,-77,-200,228,-75,-266,-294,-139,-137,-134,-131,-128,228,-129,-154,228,367,-28,-309,-71,-309,-227,-230,-228,-224,-225,-229,-231,228,-233,-234,-226,-232,-306,228,-263,-304,-280,-279,228,228,228,-257,-262,228,-260,31,-261,228,228,228,228,228,228,228,228,228,228,228,228,228,228,228,228,228,228,228,-309,-266,430,-218,-217,228,-215,228,228,228,-201,228,-214,228,-80,-202,228,228,-138,-136,31,228,-156,-155,-266,228,228,-12,228,228,-11,-278,-277,-276,-275,-274,-287,228,31,309,309,309,309,309,309,309,309,309,309,-240,-239,309,309,309,309,309,-241,469,-28,-309,-266,-213,-216,228,-205,228,-79,-203,-309,-182,-264,-272,-273,228,228,-258,-309,228,-266,228,228,228,228,-204,228,228,228,228,-11,228,-209,-208,-206,-80,-288,228,-309,-281,228,228,-282,228,-210,-207,228,-212,-211,]),'LPAREN':([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,19,20,21,23,24,25,26,29,30,31,32,33,34,35,36,37,39,40,41,42,44,45,47,48,49,50,51,53,54,55,56,57,59,61,63,65,68,69,70,71,73,74,76,77,78,79,80,81,83,84,85,88,91,92,96,101,102,103,104,105,106,107,108,113,115,120,121,126,127,131,133,139,140,142,143,144,147,148,149,150,151,153,154,155,156,157,158,159,160,161,162,165,166,167,169,170,171,172,173,174,175,176,177,178,180,181,184,185,186,187,188,189,192,193,196,198,199,202,203,206,207,208,209,213,214,215,216,217,218,219,220,222,224,225,228,229,230,232,234,235,237,238,239,244,249,250,251,253,254,255,258,260,264,265,266,267,268,269,270,271,272,273,274,275,276,277,279,280,282,284,285,286,288,291,293,296,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,319,324,325,326,329,330,336,337,339,340,341,342,343,346,348,349,351,352,353,354,355,356,357,359,361,362,363,367,368,369,370,371,372,376,378,380,383,384,385,386,389,394,395,397,398,418,419,420,421,422,423,424,427,428,430,432,433,435,437,439,441,442,443,447,448,454,457,459,460,461,463,466,467,469,470,471,472,473,474,475,476,477,479,480,481,482,483,484,485,487,488,495,496,500,501,502,504,505,507,509,510,511,512,513,514,517,520,522,523,524,526,527,528,],[4,-309,-104,-117,4,-115,-101,-99,60,-97,-116,-98,-64,4,-60,-102,-93,-66,-96,-111,-106,-65,-95,-112,4,-221,-109,-309,-113,81,-63,-118,4,-29,-107,-62,-103,-67,-114,-108,-309,-110,-309,-105,-119,-68,-100,-87,-10,-9,-309,60,81,4,-61,-133,-307,-132,-153,-152,-28,-164,-166,-27,-90,81,-92,81,145,-37,-89,-91,-94,-83,-86,-88,-69,-30,173,-28,-309,189,-294,-70,173,-135,-130,-308,81,-167,-165,81,145,-309,173,173,81,-298,-270,-286,-301,-305,-302,-299,-284,277,-268,-285,285,287,288,-267,291,-297,-266,-271,173,291,-303,-265,-295,-283,-300,-296,-269,173,173,-36,-35,189,189,327,-45,173,331,-73,-76,-72,173,-74,339,343,288,173,348,-78,-199,-198,-77,-200,173,-75,-266,-294,355,-139,-137,-134,-131,-128,288,-129,-154,288,-38,173,-28,-309,-71,-309,-227,-230,-228,-224,-225,-229,-231,173,-233,-234,-226,-232,-306,173,-304,-280,-279,173,173,-31,173,173,-34,398,288,288,288,288,288,288,288,288,288,288,288,288,288,288,288,288,173,288,288,189,327,331,-309,-266,173,-218,-217,173,-215,173,173,173,-201,173,-214,173,-80,-202,173,173,-138,-136,81,288,-156,-155,-266,173,173,-44,-43,-12,288,173,-11,-278,-277,-276,-275,-274,-287,288,398,398,-33,-32,-197,-191,173,-28,-309,-193,-195,-266,-213,-216,173,-205,173,482,-79,-203,-39,-42,-309,-182,-272,-273,173,288,-309,288,-266,173,173,-51,-50,-192,-194,-196,173,173,-204,173,173,173,-41,-40,173,-11,-46,-49,173,-209,-208,-206,-80,-288,173,-309,-281,-48,-47,173,173,-282,173,-210,-207,173,-212,-211,]),'MINUSMINUS':([3,35,51,53,59,70,76,78,79,101,104,106,107,108,115,121,131,139,144,147,148,150,151,153,154,155,156,157,158,159,160,161,162,166,167,169,170,171,172,173,174,175,176,177,178,180,181,184,185,186,198,202,203,206,207,208,214,215,217,218,219,220,222,224,225,228,229,239,250,253,254,255,260,264,265,266,267,268,269,270,271,272,273,274,275,276,277,279,280,282,284,285,288,291,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,326,329,330,336,337,339,340,341,342,343,346,348,349,351,352,353,354,355,361,367,368,369,372,376,378,380,383,384,385,386,389,394,395,422,423,424,430,432,433,435,437,439,442,443,454,457,459,460,461,463,466,467,469,470,471,477,479,480,481,482,483,487,488,500,501,502,504,505,507,509,510,511,514,517,520,522,523,524,526,527,528,],[-117,-118,-119,-68,-309,-307,-28,-166,-27,-83,-69,174,-28,-309,-294,174,-308,-167,-309,174,174,-298,-270,-286,-301,-305,-302,-299,-284,174,-268,-285,280,174,-267,174,-297,-266,-271,174,174,-303,-265,-295,-283,-300,-296,-269,174,174,174,-73,-76,-72,174,-74,174,174,-78,-199,-198,-77,-200,174,-75,-266,-294,174,174,174,-28,-309,-309,-227,-230,-228,-224,-225,-229,-231,174,-233,-234,-226,-232,-306,174,-304,-280,-279,174,174,174,174,174,174,174,174,174,174,174,174,174,174,174,174,174,174,174,174,174,174,174,-309,-266,174,-218,-217,174,-215,174,174,174,-201,174,-214,174,-80,-202,174,174,174,-266,174,174,-12,174,174,-11,-278,-277,-276,-275,-274,-287,174,174,-28,-309,-266,-213,-216,174,-205,174,-79,-203,-309,-182,-272,-273,174,174,-309,174,-266,174,174,174,174,-204,174,174,174,174,-11,174,-209,-208,-206,-80,-288,174,-309,-281,174,174,-282,174,-210,-207,174,-212,-211,]),'ID':([0,1,2,3,4,5,6,7,9,10,11,12,13,14,15,16,17,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,38,39,40,41,42,44,45,47,48,49,50,51,53,54,55,56,57,59,60,63,65,68,69,70,71,73,74,75,76,77,78,79,80,81,83,84,91,92,96,101,102,103,104,106,107,108,113,120,121,126,127,131,133,134,135,139,140,142,144,145,147,148,149,151,159,160,166,167,169,171,173,174,176,184,185,186,189,192,198,200,202,203,204,206,207,208,214,215,217,218,219,220,222,224,225,228,232,234,235,237,238,239,244,248,249,250,253,254,255,258,260,264,265,266,267,268,269,270,271,272,273,274,275,277,281,283,284,285,288,291,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,319,326,327,329,330,336,337,339,340,341,342,343,346,348,349,351,352,353,354,355,356,357,359,361,362,363,367,368,369,372,375,376,378,380,395,422,423,424,430,432,433,435,437,439,442,443,454,457,461,462,463,466,467,469,470,471,477,479,480,481,482,483,487,488,500,501,502,504,505,508,509,510,514,517,522,523,524,526,527,528,],[37,-309,-104,-117,37,-115,-101,-99,-97,-116,-98,-64,37,-60,-102,-93,-66,-96,-111,-106,-141,-65,-95,-112,37,71,74,-221,-109,-309,-113,37,-63,-118,37,-140,-107,-62,-103,-67,-114,-108,-309,-110,-309,-105,-119,-68,-100,-87,-10,-9,-309,115,37,37,-61,-133,-307,-132,-153,-152,138,-28,-164,-166,-27,-90,37,-92,37,-89,-91,-94,-83,-86,-88,-69,115,-28,-309,37,-70,229,-135,-130,-308,37,138,138,-167,-165,37,-309,115,115,115,37,-270,115,-268,115,-267,115,-266,115,115,-265,-269,115,115,37,37,115,115,-73,-76,335,-72,115,-74,115,229,-78,-199,-198,-77,-200,229,-75,-266,-139,-137,-134,-131,-128,115,-129,138,-154,115,115,-28,-309,-71,-309,-227,-230,-228,-224,-225,-229,-231,115,-233,-234,-226,-232,115,384,386,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,37,-309,115,-266,115,-218,-217,115,-215,115,229,115,-201,115,-214,229,-80,-202,229,115,-138,-136,37,115,-156,-155,-266,115,115,-12,115,115,115,-11,115,115,-28,-309,-266,-213,-216,115,-205,229,-79,-203,-309,-182,115,115,115,-309,115,-266,115,115,115,229,-204,229,115,229,115,-11,115,-209,-208,-206,-80,115,115,-309,115,229,229,-210,-207,229,-212,-211,]),'IF':([53,70,101,104,121,131,202,203,206,208,215,217,218,219,220,222,224,225,336,337,340,342,346,349,351,352,353,354,432,433,437,439,442,443,479,480,481,483,501,502,504,505,517,522,523,524,526,527,528,],[-68,-307,-83,-69,230,-308,-73,-76,-72,-74,230,-78,-199,-198,-77,-200,230,-75,-218,-217,-215,230,-201,-214,230,-80,-202,230,-213,-216,-205,230,-79,-203,230,-204,230,230,-209,-208,-206,-80,230,230,-210,-207,230,-212,-211,]),'STRING_LITERAL':([3,35,51,53,59,70,76,78,79,101,104,106,107,108,121,131,139,144,147,148,151,159,160,161,166,167,169,171,173,174,175,176,184,185,186,198,202,203,206,207,208,214,215,217,218,219,220,222,224,225,228,239,250,253,254,255,260,264,265,266,267,268,269,270,271,272,273,274,275,277,279,284,285,288,291,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,326,329,330,336,337,339,340,341,342,343,346,348,349,351,352,353,354,355,361,367,368,369,372,376,378,380,395,422,423,424,430,432,433,435,437,439,442,443,454,457,461,463,466,467,469,470,471,477,479,480,481,482,483,487,488,500,501,502,504,505,509,510,514,517,522,523,524,526,527,528,],[-117,-118,-119,-68,-309,-307,-28,-166,-27,-83,-69,175,-28,-309,175,-308,-167,-309,175,175,-270,175,-268,279,175,-267,175,-266,175,175,-303,-265,-269,175,175,175,-73,-76,-72,175,-74,175,175,-78,-199,-198,-77,-200,175,-75,-266,175,175,175,-28,-309,-309,-227,-230,-228,-224,-225,-229,-231,175,-233,-234,-226,-232,175,-304,175,175,175,175,175,175,175,175,175,175,175,175,175,175,175,175,175,175,175,175,175,175,175,-309,-266,175,-218,-217,175,-215,175,175,175,-201,175,-214,175,-80,-202,175,175,175,-266,175,175,-12,175,175,-11,175,175,-28,-309,-266,-213,-216,175,-205,175,-79,-203,-309,-182,175,175,-309,175,-266,175,175,175,175,-204,175,175,175,175,-11,175,-209,-208,-206,-80,175,-309,175,175,175,-210,-207,175,-212,-211,]),'FLOAT':([0,1,2,3,5,6,7,8,9,10,11,12,14,15,16,17,18,19,20,21,23,24,25,26,29,30,32,33,34,35,36,37,39,40,41,42,44,45,47,48,49,50,51,53,54,55,56,57,60,61,63,64,65,67,68,69,70,71,72,73,74,78,80,83,87,91,92,96,101,102,103,104,105,113,117,120,121,122,123,124,125,126,127,128,129,130,131,132,133,139,145,173,187,188,189,201,202,203,206,208,215,217,218,219,220,222,225,231,232,233,234,235,236,237,238,244,249,258,277,286,287,288,291,293,296,327,331,336,337,339,340,346,349,351,352,353,356,357,360,362,363,398,418,419,432,433,437,442,443,480,501,502,504,505,523,524,527,528,],[39,-309,-104,-117,-115,-101,-99,-52,-97,-116,-98,-64,-60,-102,-93,-66,39,-96,-111,-106,-65,-95,-112,39,-221,-109,-113,39,-63,-118,39,-29,-107,-62,-103,-67,-114,-108,-309,-110,-309,-105,-119,-68,-100,-87,-10,-9,39,-53,39,-84,39,39,-61,-133,-307,-132,39,-153,-152,-166,-90,-92,39,-89,-91,-94,-83,-86,-88,-69,-30,39,39,-70,39,-85,39,39,39,-135,-130,-145,-146,-142,-308,39,39,-167,39,39,-36,-35,39,39,-73,-76,-72,-74,39,-78,-199,-198,-77,-200,-75,39,-139,39,-137,-134,-143,-131,-128,-129,-154,-71,39,-31,39,39,39,-34,39,39,39,-218,-217,39,-215,-201,-214,-78,-80,-202,-138,-136,-144,-156,-155,39,-33,-32,-213,-216,-205,-79,-203,-204,-209,-208,-206,-80,-210,-207,-212,-211,]),'XOREQUAL':([115,131,150,152,153,154,155,156,157,158,161,162,170,172,175,177,178,180,181,229,276,278,279,280,282,289,290,292,297,383,384,385,386,389,394,458,459,460,465,507,511,520,],[-294,-308,-298,268,-286,-301,-305,-302,-299,-284,-285,-259,-297,-271,-303,-295,-283,-300,-296,-294,-306,-263,-304,-280,-279,-257,-262,-260,-261,-278,-277,-276,-275,-274,-287,-264,-272,-273,-258,-288,-281,-282,]),'LSHIFTEQUAL':([115,131,150,152,153,154,155,156,157,158,161,162,170,172,175,177,178,180,181,229,276,278,279,280,282,289,290,292,297,383,384,385,386,389,394,458,459,460,465,507,511,520,],[-294,-308,-298,270,-286,-301,-305,-302,-299,-284,-285,-259,-297,-271,-303,-295,-283,-300,-296,-294,-306,-263,-304,-280,-279,-257,-262,-260,-261,-278,-277,-276,-275,-274,-287,-264,-272,-273,-258,-288,-281,-282,]),'RBRACKET':([3,35,51,59,78,79,106,107,115,131,139,144,150,152,153,154,155,156,157,158,161,162,163,164,168,170,171,172,175,177,178,179,180,181,182,183,198,227,253,254,276,278,279,280,282,289,290,292,297,317,318,326,328,329,330,345,366,367,381,383,384,385,386,387,389,394,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,416,417,422,423,429,430,436,449,450,453,458,459,460,465,468,469,494,497,498,507,511,519,520,],[-117,-118,-119,-309,-166,-27,-309,-28,-294,-308,-167,-309,-298,-257,-286,-301,-305,-302,-299,-284,-285,-259,286,-238,-4,-297,293,-271,-303,-295,-283,-236,-300,-296,-3,-222,-309,-219,-309,-28,-306,-263,-304,-280,-279,-257,-262,-260,-261,418,419,-309,427,428,-309,-235,447,448,-223,-278,-277,-276,-275,459,-274,-287,-244,-256,-245,-243,-247,-251,-246,-242,-249,-254,-240,-239,-248,-255,-250,-252,-253,-241,-309,-28,474,475,-220,484,485,486,-264,-272,-273,-258,495,496,-237,512,513,-288,-281,525,-282,]),} + +_lr_action = {} +for _k, _v in _lr_action_items.items(): + for _x,_y in zip(_v[0],_v[1]): + if not _x in _lr_action: _lr_action[_x] = {} + _lr_action[_x][_k] = _y +del _lr_action_items + +_lr_goto_items = {'expression_statement':([121,215,224,342,351,354,439,479,481,483,517,522,526,],[202,202,202,202,202,202,202,202,202,202,202,202,202,]),'struct_or_union_specifier':([0,18,26,36,60,65,67,72,87,117,121,123,124,125,132,145,173,189,201,215,231,233,277,287,288,291,327,331,339,398,],[5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,]),'init_declarator_list':([33,63,],[82,82,]),'init_declarator_list_opt':([33,63,],[90,90,]),'iteration_statement':([121,215,224,342,351,354,439,479,481,483,517,522,526,],[203,203,203,203,203,203,203,203,203,203,203,203,203,]),'unified_string_literal':([106,121,147,148,159,166,169,173,174,185,186,198,207,214,215,224,239,250,253,271,277,284,285,288,291,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,330,339,341,342,343,348,351,354,355,361,368,369,376,378,395,422,435,439,461,463,467,470,471,477,479,481,482,483,487,500,509,514,517,522,526,],[161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,]),'assignment_expression_opt':([106,198,253,330,422,],[163,328,366,429,468,]),'brace_open':([27,28,66,69,71,73,74,121,146,147,148,215,224,342,351,354,378,395,439,458,463,464,479,481,483,487,517,522,526,],[72,75,121,123,124,134,135,121,121,260,260,121,121,121,121,121,260,466,121,466,466,466,121,121,121,260,121,121,121,]),'enumerator':([75,134,135,248,],[136,136,136,364,]),'typeid_noparen_declarator':([113,],[197,]),'type_qualifier_list_opt':([31,59,108,144,255,326,424,],[77,106,186,253,369,422,471,]),'declaration_specifiers_no_type_opt':([1,47,49,],[55,102,103,]),'expression_opt':([121,215,224,339,342,351,354,435,439,477,479,481,483,500,514,517,522,526,],[205,205,205,434,205,205,205,478,205,499,205,205,205,515,521,205,205,205,]),'designation':([260,454,466,510,],[372,372,372,372,]),'parameter_list':([60,145,189,327,331,398,],[116,116,116,116,116,116,]),'labeled_statement':([121,215,224,342,351,354,439,479,481,483,517,522,526,],[206,206,206,206,206,206,206,206,206,206,206,206,206,]),'abstract_declarator':([113,189,296,398,],[191,323,191,323,]),'translation_unit':([0,],[26,]),'init_declarator':([33,63,142,149,],[94,94,252,263,]),'direct_abstract_declarator':([113,189,192,296,319,397,398,],[199,199,325,199,325,325,199,]),'designator_list':([260,454,466,510,],[379,379,379,379,]),'identifier':([60,106,121,145,147,148,159,166,169,173,174,185,186,198,200,207,214,215,224,239,250,253,271,277,284,285,288,291,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,327,330,339,341,342,343,348,351,354,355,361,368,369,375,376,378,395,422,435,439,461,462,463,467,470,471,477,479,481,482,483,487,500,508,509,514,517,522,526,],[118,178,178,118,178,178,178,178,178,178,178,178,178,178,332,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,118,178,178,178,178,178,178,178,178,178,178,178,178,452,178,178,178,178,178,178,178,492,178,178,178,178,178,178,178,178,178,178,178,518,178,178,178,178,178,]),'offsetof_member_designator':([462,],[491,]),'unary_expression':([106,121,147,148,159,166,169,173,174,185,186,198,207,214,215,224,239,250,253,271,277,284,285,288,291,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,330,339,341,342,343,348,351,354,355,361,368,369,376,378,395,422,435,439,461,463,467,470,471,477,479,481,482,483,487,500,509,514,517,522,526,],[152,152,152,152,278,289,292,152,297,152,152,152,152,289,152,152,289,289,152,152,152,152,152,152,152,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,289,152,289,289,152,152,152,152,152,152,152,152,152,289,152,152,289,152,289,152,152,152,152,289,289,152,152,152,152,152,152,152,152,152,152,152,152,152,152,]),'abstract_declarator_opt':([113,296,],[190,396,]),'initializer':([147,148,378,487,],[259,262,455,506,]),'direct_id_declarator':([0,4,13,26,33,36,63,65,81,84,113,133,142,149,189,192,319,359,],[8,8,61,8,8,8,8,8,8,61,8,8,8,8,8,61,61,8,]),'struct_declaration_list':([72,123,124,],[125,231,233,]),'pp_directive':([0,26,],[12,12,]),'declaration_list':([18,87,],[67,67,]),'id_init_declarator':([36,65,],[95,95,]),'type_specifier':([0,18,26,36,60,65,67,72,87,117,121,123,124,125,132,145,173,189,201,215,231,233,277,287,288,291,327,331,339,398,],[16,16,16,96,16,96,16,127,16,96,16,127,127,127,237,16,127,16,16,16,127,127,127,127,127,127,16,16,16,16,]),'compound_statement':([66,121,146,215,224,342,351,354,439,479,481,483,517,522,526,],[120,208,258,208,208,208,208,208,208,208,208,208,208,208,208,]),'pointer':([0,4,26,33,36,63,65,77,81,113,133,142,149,189,296,359,398,],[13,13,13,84,13,84,13,140,84,192,84,84,84,319,397,84,397,]),'typeid_declarator':([33,63,81,133,142,149,359,],[86,86,141,86,86,86,86,]),'id_init_declarator_list':([36,65,],[98,98,]),'declarator':([33,63,133,142,149,359,],[89,89,245,89,89,245,]),'argument_expression_list':([285,],[390,]),'struct_declarator_list_opt':([133,],[242,]),'typedef_name':([0,18,26,36,60,65,67,72,87,117,121,123,124,125,132,145,173,189,201,215,231,233,277,287,288,291,327,331,339,398,],[32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,]),'parameter_type_list_opt':([189,331,398,],[322,431,322,]),'struct_declarator':([133,359,],[243,445,]),'type_qualifier':([0,1,18,26,31,33,47,49,59,60,63,67,72,76,87,107,108,113,121,123,124,125,132,133,144,145,173,189,201,215,231,233,254,255,277,287,288,291,296,326,327,331,339,398,423,424,],[47,47,47,47,78,91,47,47,78,47,91,47,78,139,47,139,78,91,47,78,78,78,139,244,78,47,78,47,47,47,78,78,139,78,78,78,78,78,244,78,47,47,47,47,139,78,]),'assignment_operator':([152,],[271,]),'expression':([121,173,207,215,224,277,284,288,291,314,339,342,343,348,351,354,355,435,439,477,479,481,482,483,500,509,514,517,522,526,],[211,294,338,211,211,294,387,294,294,415,211,211,438,440,211,211,444,211,211,211,211,211,503,211,211,519,211,211,211,211,]),'storage_class_specifier':([0,1,18,26,33,47,49,60,63,67,87,113,121,145,189,201,215,327,331,339,398,],[1,1,1,1,80,1,1,1,80,1,1,80,1,1,1,1,1,1,1,1,1,]),'unified_wstring_literal':([106,121,147,148,159,166,169,173,174,185,186,198,207,214,215,224,239,250,253,271,277,284,285,288,291,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,330,339,341,342,343,348,351,354,355,361,368,369,376,378,395,422,435,439,461,463,467,470,471,477,479,481,482,483,487,500,509,514,517,522,526,],[153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,]),'translation_unit_or_empty':([0,],[43,]),'initializer_list_opt':([260,],[373,]),'brace_close':([72,123,124,125,137,226,231,233,246,247,373,454,493,510,],[126,232,234,235,249,353,356,357,362,363,451,489,511,520,]),'direct_typeid_declarator':([33,63,81,84,133,142,149,359,],[85,85,85,143,85,85,85,85,]),'external_declaration':([0,26,],[14,68,]),'pragmacomp_or_statement':([224,342,354,439,479,481,483,517,522,526,],[350,437,443,480,501,502,504,524,527,528,]),'type_name':([173,277,287,288,291,],[295,382,391,392,393,]),'block_item_list':([121,],[215,]),'pppragma_directive':([0,26,72,121,123,124,125,215,224,231,233,342,351,354,439,479,481,483,517,522,526,],[23,23,129,217,129,129,129,217,351,129,129,351,217,351,351,351,351,351,351,351,351,]),'statement':([121,215,224,342,351,354,439,479,481,483,517,522,526,],[218,218,352,352,442,352,352,352,352,505,352,352,352,]),'cast_expression':([106,121,147,148,166,173,185,186,198,207,214,215,224,239,250,253,271,277,284,285,288,291,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,330,339,341,342,343,348,351,354,355,361,368,369,376,378,395,422,435,439,461,463,467,470,471,477,479,481,482,483,487,500,509,514,517,522,526,],[164,164,164,164,290,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,465,164,164,164,164,465,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,]),'struct_declarator_list':([133,],[240,]),'empty':([0,1,18,31,33,36,47,49,59,60,63,65,87,106,108,113,121,133,144,145,189,198,215,224,253,255,260,296,326,327,330,331,339,342,351,354,398,422,424,435,439,454,466,477,479,481,483,500,510,514,517,522,526,],[52,57,62,79,93,100,57,57,79,110,93,100,62,182,79,195,223,241,79,110,320,182,347,347,182,79,380,195,79,110,182,320,347,347,347,347,320,182,79,347,347,488,488,347,347,347,347,347,488,347,347,347,347,]),'parameter_declaration':([60,145,189,201,327,331,398,],[112,112,112,334,112,112,112,]),'primary_expression':([106,121,147,148,159,166,169,173,174,185,186,198,207,214,215,224,239,250,253,271,277,284,285,288,291,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,330,339,341,342,343,348,351,354,355,361,368,369,376,378,395,422,435,439,461,463,467,470,471,477,479,481,482,483,487,500,509,514,517,522,526,],[172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,]),'declaration':([0,18,26,67,87,121,215,339,],[34,64,34,122,64,219,219,435,]),'declaration_specifiers_no_type':([0,1,18,26,47,49,60,67,87,121,145,189,201,215,327,331,339,398,],[36,56,65,36,56,56,117,65,65,65,117,117,117,65,117,117,65,117,]),'jump_statement':([121,215,224,342,351,354,439,479,481,483,517,522,526,],[220,220,220,220,220,220,220,220,220,220,220,220,220,]),'enumerator_list':([75,134,135,],[137,246,247,]),'block_item':([121,215,],[222,346,]),'constant_expression':([214,239,250,361,376,],[344,358,365,446,453,]),'identifier_list_opt':([60,145,327,],[109,256,425,]),'constant':([106,121,147,148,159,166,169,173,174,185,186,198,207,214,215,224,239,250,253,271,277,284,285,288,291,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,330,339,341,342,343,348,351,354,355,361,368,369,376,378,395,422,435,439,461,463,467,470,471,477,479,481,482,483,487,500,509,514,517,522,526,],[158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,]),'type_specifier_no_typeid':([0,18,26,33,36,60,63,65,67,72,87,113,117,121,123,124,125,132,133,145,173,189,201,215,231,233,277,287,288,291,296,327,331,339,398,],[10,10,10,83,10,10,83,10,10,10,10,83,10,10,10,10,10,10,238,10,10,10,10,10,10,10,10,10,10,10,238,10,10,10,10,]),'struct_declaration':([72,123,124,125,231,233,],[130,130,130,236,236,236,]),'direct_typeid_noparen_declarator':([113,192,],[193,324,]),'id_declarator':([0,4,26,33,36,63,65,81,113,133,142,149,189,359,],[18,58,18,87,97,119,97,58,194,119,119,119,58,119,]),'selection_statement':([121,215,224,342,351,354,439,479,481,483,517,522,526,],[225,225,225,225,225,225,225,225,225,225,225,225,225,]),'postfix_expression':([106,121,147,148,159,166,169,173,174,185,186,198,207,214,215,224,239,250,253,271,277,284,285,288,291,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,330,339,341,342,343,348,351,354,355,361,368,369,376,378,395,422,435,439,461,463,467,470,471,477,479,481,482,483,487,500,509,514,517,522,526,],[162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,]),'initializer_list':([260,466,],[377,493,]),'unary_operator':([106,121,147,148,159,166,169,173,174,185,186,198,207,214,215,224,239,250,253,271,277,284,285,288,291,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,330,339,341,342,343,348,351,354,355,361,368,369,376,378,395,422,435,439,461,463,467,470,471,477,479,481,482,483,487,500,509,514,517,522,526,],[166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,]),'struct_or_union':([0,18,26,36,60,65,67,72,87,117,121,123,124,125,132,145,173,189,201,215,231,233,277,287,288,291,327,331,339,398,],[27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,]),'block_item_list_opt':([121,],[226,]),'assignment_expression':([106,121,147,148,173,185,186,198,207,215,224,253,271,277,284,285,288,291,314,330,339,341,342,343,348,351,354,355,368,369,378,422,435,439,461,470,471,477,479,481,482,483,487,500,509,514,517,522,526,],[168,227,261,261,227,317,318,168,227,227,227,168,381,227,227,388,227,227,227,168,227,436,227,227,227,227,227,227,449,450,261,168,227,227,490,497,498,227,227,227,227,227,261,227,227,227,227,227,227,]),'designation_opt':([260,454,466,510,],[378,487,378,487,]),'parameter_type_list':([60,145,189,327,331,398,],[111,257,321,426,321,321,]),'type_qualifier_list':([31,59,72,108,123,124,125,144,173,231,233,255,277,287,288,291,326,424,],[76,107,132,76,132,132,132,254,132,132,132,76,132,132,132,132,423,76,]),'designator':([260,379,454,466,510,],[374,456,374,374,374,]),'id_init_declarator_list_opt':([36,65,],[99,99,]),'declaration_specifiers':([0,18,26,60,67,87,121,145,189,201,215,327,331,339,398,],[33,63,33,113,63,63,63,113,113,113,63,113,113,63,113,]),'identifier_list':([60,145,327,],[114,114,114,]),'declaration_list_opt':([18,87,],[66,146,]),'function_definition':([0,26,],[40,40,]),'binary_expression':([106,121,147,148,173,185,186,198,207,214,215,224,239,250,253,271,277,284,285,288,291,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,330,339,341,342,343,348,351,354,355,361,368,369,376,378,422,435,439,461,467,470,471,477,479,481,482,483,487,500,509,514,517,522,526,],[179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,179,416,417,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,]),'enum_specifier':([0,18,26,36,60,65,67,72,87,117,121,123,124,125,132,145,173,189,201,215,231,233,277,287,288,291,327,331,339,398,],[44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,]),'decl_body':([0,18,26,67,87,121,215,339,],[46,46,46,46,46,46,46,46,]),'function_specifier':([0,1,18,26,33,47,49,60,63,67,87,113,121,145,189,201,215,327,331,339,398,],[49,49,49,49,92,49,49,49,92,49,49,92,49,49,49,49,49,49,49,49,49,]),'specifier_qualifier_list':([72,123,124,125,173,231,233,277,287,288,291,],[133,133,133,133,296,133,133,296,296,296,296,]),'conditional_expression':([106,121,147,148,173,185,186,198,207,214,215,224,239,250,253,271,277,284,285,288,291,314,330,339,341,342,343,348,351,354,355,361,368,369,376,378,422,435,439,461,467,470,471,477,479,481,482,483,487,500,509,514,517,522,526,],[183,183,183,183,183,183,183,183,183,345,183,183,345,345,183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,345,183,183,345,183,183,183,183,183,494,183,183,183,183,183,183,183,183,183,183,183,183,183,183,]),} + +_lr_goto = {} +for _k, _v in _lr_goto_items.items(): + for _x, _y in zip(_v[0], _v[1]): + if not _x in _lr_goto: _lr_goto[_x] = {} + _lr_goto[_x][_k] = _y +del _lr_goto_items +_lr_productions = [ + ("S' -> translation_unit_or_empty","S'",1,None,None,None), + ('abstract_declarator_opt -> empty','abstract_declarator_opt',1,'p_abstract_declarator_opt','plyparser.py',43), + ('abstract_declarator_opt -> abstract_declarator','abstract_declarator_opt',1,'p_abstract_declarator_opt','plyparser.py',44), + ('assignment_expression_opt -> empty','assignment_expression_opt',1,'p_assignment_expression_opt','plyparser.py',43), + ('assignment_expression_opt -> assignment_expression','assignment_expression_opt',1,'p_assignment_expression_opt','plyparser.py',44), + ('block_item_list_opt -> empty','block_item_list_opt',1,'p_block_item_list_opt','plyparser.py',43), + ('block_item_list_opt -> block_item_list','block_item_list_opt',1,'p_block_item_list_opt','plyparser.py',44), + ('declaration_list_opt -> empty','declaration_list_opt',1,'p_declaration_list_opt','plyparser.py',43), + ('declaration_list_opt -> declaration_list','declaration_list_opt',1,'p_declaration_list_opt','plyparser.py',44), + ('declaration_specifiers_no_type_opt -> empty','declaration_specifiers_no_type_opt',1,'p_declaration_specifiers_no_type_opt','plyparser.py',43), + ('declaration_specifiers_no_type_opt -> declaration_specifiers_no_type','declaration_specifiers_no_type_opt',1,'p_declaration_specifiers_no_type_opt','plyparser.py',44), + ('designation_opt -> empty','designation_opt',1,'p_designation_opt','plyparser.py',43), + ('designation_opt -> designation','designation_opt',1,'p_designation_opt','plyparser.py',44), + ('expression_opt -> empty','expression_opt',1,'p_expression_opt','plyparser.py',43), + ('expression_opt -> expression','expression_opt',1,'p_expression_opt','plyparser.py',44), + ('id_init_declarator_list_opt -> empty','id_init_declarator_list_opt',1,'p_id_init_declarator_list_opt','plyparser.py',43), + ('id_init_declarator_list_opt -> id_init_declarator_list','id_init_declarator_list_opt',1,'p_id_init_declarator_list_opt','plyparser.py',44), + ('identifier_list_opt -> empty','identifier_list_opt',1,'p_identifier_list_opt','plyparser.py',43), + ('identifier_list_opt -> identifier_list','identifier_list_opt',1,'p_identifier_list_opt','plyparser.py',44), + ('init_declarator_list_opt -> empty','init_declarator_list_opt',1,'p_init_declarator_list_opt','plyparser.py',43), + ('init_declarator_list_opt -> init_declarator_list','init_declarator_list_opt',1,'p_init_declarator_list_opt','plyparser.py',44), + ('initializer_list_opt -> empty','initializer_list_opt',1,'p_initializer_list_opt','plyparser.py',43), + ('initializer_list_opt -> initializer_list','initializer_list_opt',1,'p_initializer_list_opt','plyparser.py',44), + ('parameter_type_list_opt -> empty','parameter_type_list_opt',1,'p_parameter_type_list_opt','plyparser.py',43), + ('parameter_type_list_opt -> parameter_type_list','parameter_type_list_opt',1,'p_parameter_type_list_opt','plyparser.py',44), + ('struct_declarator_list_opt -> empty','struct_declarator_list_opt',1,'p_struct_declarator_list_opt','plyparser.py',43), + ('struct_declarator_list_opt -> struct_declarator_list','struct_declarator_list_opt',1,'p_struct_declarator_list_opt','plyparser.py',44), + ('type_qualifier_list_opt -> empty','type_qualifier_list_opt',1,'p_type_qualifier_list_opt','plyparser.py',43), + ('type_qualifier_list_opt -> type_qualifier_list','type_qualifier_list_opt',1,'p_type_qualifier_list_opt','plyparser.py',44), + ('direct_id_declarator -> ID','direct_id_declarator',1,'p_direct_id_declarator_1','plyparser.py',126), + ('direct_id_declarator -> LPAREN id_declarator RPAREN','direct_id_declarator',3,'p_direct_id_declarator_2','plyparser.py',126), + ('direct_id_declarator -> direct_id_declarator LBRACKET type_qualifier_list_opt assignment_expression_opt RBRACKET','direct_id_declarator',5,'p_direct_id_declarator_3','plyparser.py',126), + ('direct_id_declarator -> direct_id_declarator LBRACKET STATIC type_qualifier_list_opt assignment_expression RBRACKET','direct_id_declarator',6,'p_direct_id_declarator_4','plyparser.py',126), + ('direct_id_declarator -> direct_id_declarator LBRACKET type_qualifier_list STATIC assignment_expression RBRACKET','direct_id_declarator',6,'p_direct_id_declarator_4','plyparser.py',127), + ('direct_id_declarator -> direct_id_declarator LBRACKET type_qualifier_list_opt TIMES RBRACKET','direct_id_declarator',5,'p_direct_id_declarator_5','plyparser.py',126), + ('direct_id_declarator -> direct_id_declarator LPAREN parameter_type_list RPAREN','direct_id_declarator',4,'p_direct_id_declarator_6','plyparser.py',126), + ('direct_id_declarator -> direct_id_declarator LPAREN identifier_list_opt RPAREN','direct_id_declarator',4,'p_direct_id_declarator_6','plyparser.py',127), + ('direct_typeid_declarator -> TYPEID','direct_typeid_declarator',1,'p_direct_typeid_declarator_1','plyparser.py',126), + ('direct_typeid_declarator -> LPAREN typeid_declarator RPAREN','direct_typeid_declarator',3,'p_direct_typeid_declarator_2','plyparser.py',126), + ('direct_typeid_declarator -> direct_typeid_declarator LBRACKET type_qualifier_list_opt assignment_expression_opt RBRACKET','direct_typeid_declarator',5,'p_direct_typeid_declarator_3','plyparser.py',126), + ('direct_typeid_declarator -> direct_typeid_declarator LBRACKET STATIC type_qualifier_list_opt assignment_expression RBRACKET','direct_typeid_declarator',6,'p_direct_typeid_declarator_4','plyparser.py',126), + ('direct_typeid_declarator -> direct_typeid_declarator LBRACKET type_qualifier_list STATIC assignment_expression RBRACKET','direct_typeid_declarator',6,'p_direct_typeid_declarator_4','plyparser.py',127), + ('direct_typeid_declarator -> direct_typeid_declarator LBRACKET type_qualifier_list_opt TIMES RBRACKET','direct_typeid_declarator',5,'p_direct_typeid_declarator_5','plyparser.py',126), + ('direct_typeid_declarator -> direct_typeid_declarator LPAREN parameter_type_list RPAREN','direct_typeid_declarator',4,'p_direct_typeid_declarator_6','plyparser.py',126), + ('direct_typeid_declarator -> direct_typeid_declarator LPAREN identifier_list_opt RPAREN','direct_typeid_declarator',4,'p_direct_typeid_declarator_6','plyparser.py',127), + ('direct_typeid_noparen_declarator -> TYPEID','direct_typeid_noparen_declarator',1,'p_direct_typeid_noparen_declarator_1','plyparser.py',126), + ('direct_typeid_noparen_declarator -> direct_typeid_noparen_declarator LBRACKET type_qualifier_list_opt assignment_expression_opt RBRACKET','direct_typeid_noparen_declarator',5,'p_direct_typeid_noparen_declarator_3','plyparser.py',126), + ('direct_typeid_noparen_declarator -> direct_typeid_noparen_declarator LBRACKET STATIC type_qualifier_list_opt assignment_expression RBRACKET','direct_typeid_noparen_declarator',6,'p_direct_typeid_noparen_declarator_4','plyparser.py',126), + ('direct_typeid_noparen_declarator -> direct_typeid_noparen_declarator LBRACKET type_qualifier_list STATIC assignment_expression RBRACKET','direct_typeid_noparen_declarator',6,'p_direct_typeid_noparen_declarator_4','plyparser.py',127), + ('direct_typeid_noparen_declarator -> direct_typeid_noparen_declarator LBRACKET type_qualifier_list_opt TIMES RBRACKET','direct_typeid_noparen_declarator',5,'p_direct_typeid_noparen_declarator_5','plyparser.py',126), + ('direct_typeid_noparen_declarator -> direct_typeid_noparen_declarator LPAREN parameter_type_list RPAREN','direct_typeid_noparen_declarator',4,'p_direct_typeid_noparen_declarator_6','plyparser.py',126), + ('direct_typeid_noparen_declarator -> direct_typeid_noparen_declarator LPAREN identifier_list_opt RPAREN','direct_typeid_noparen_declarator',4,'p_direct_typeid_noparen_declarator_6','plyparser.py',127), + ('id_declarator -> direct_id_declarator','id_declarator',1,'p_id_declarator_1','plyparser.py',126), + ('id_declarator -> pointer direct_id_declarator','id_declarator',2,'p_id_declarator_2','plyparser.py',126), + ('typeid_declarator -> direct_typeid_declarator','typeid_declarator',1,'p_typeid_declarator_1','plyparser.py',126), + ('typeid_declarator -> pointer direct_typeid_declarator','typeid_declarator',2,'p_typeid_declarator_2','plyparser.py',126), + ('typeid_noparen_declarator -> direct_typeid_noparen_declarator','typeid_noparen_declarator',1,'p_typeid_noparen_declarator_1','plyparser.py',126), + ('typeid_noparen_declarator -> pointer direct_typeid_noparen_declarator','typeid_noparen_declarator',2,'p_typeid_noparen_declarator_2','plyparser.py',126), + ('translation_unit_or_empty -> translation_unit','translation_unit_or_empty',1,'p_translation_unit_or_empty','c_parser.py',514), + ('translation_unit_or_empty -> empty','translation_unit_or_empty',1,'p_translation_unit_or_empty','c_parser.py',515), + ('translation_unit -> external_declaration','translation_unit',1,'p_translation_unit_1','c_parser.py',523), + ('translation_unit -> translation_unit external_declaration','translation_unit',2,'p_translation_unit_2','c_parser.py',530), + ('external_declaration -> function_definition','external_declaration',1,'p_external_declaration_1','c_parser.py',542), + ('external_declaration -> declaration','external_declaration',1,'p_external_declaration_2','c_parser.py',547), + ('external_declaration -> pp_directive','external_declaration',1,'p_external_declaration_3','c_parser.py',552), + ('external_declaration -> pppragma_directive','external_declaration',1,'p_external_declaration_3','c_parser.py',553), + ('external_declaration -> SEMI','external_declaration',1,'p_external_declaration_4','c_parser.py',558), + ('pp_directive -> PPHASH','pp_directive',1,'p_pp_directive','c_parser.py',563), + ('pppragma_directive -> PPPRAGMA','pppragma_directive',1,'p_pppragma_directive','c_parser.py',569), + ('pppragma_directive -> PPPRAGMA PPPRAGMASTR','pppragma_directive',2,'p_pppragma_directive','c_parser.py',570), + ('function_definition -> id_declarator declaration_list_opt compound_statement','function_definition',3,'p_function_definition_1','c_parser.py',581), + ('function_definition -> declaration_specifiers id_declarator declaration_list_opt compound_statement','function_definition',4,'p_function_definition_2','c_parser.py',598), + ('statement -> labeled_statement','statement',1,'p_statement','c_parser.py',609), + ('statement -> expression_statement','statement',1,'p_statement','c_parser.py',610), + ('statement -> compound_statement','statement',1,'p_statement','c_parser.py',611), + ('statement -> selection_statement','statement',1,'p_statement','c_parser.py',612), + ('statement -> iteration_statement','statement',1,'p_statement','c_parser.py',613), + ('statement -> jump_statement','statement',1,'p_statement','c_parser.py',614), + ('statement -> pppragma_directive','statement',1,'p_statement','c_parser.py',615), + ('pragmacomp_or_statement -> pppragma_directive statement','pragmacomp_or_statement',2,'p_pragmacomp_or_statement','c_parser.py',662), + ('pragmacomp_or_statement -> statement','pragmacomp_or_statement',1,'p_pragmacomp_or_statement','c_parser.py',663), + ('decl_body -> declaration_specifiers init_declarator_list_opt','decl_body',2,'p_decl_body','c_parser.py',682), + ('decl_body -> declaration_specifiers_no_type id_init_declarator_list_opt','decl_body',2,'p_decl_body','c_parser.py',683), + ('declaration -> decl_body SEMI','declaration',2,'p_declaration','c_parser.py',742), + ('declaration_list -> declaration','declaration_list',1,'p_declaration_list','c_parser.py',751), + ('declaration_list -> declaration_list declaration','declaration_list',2,'p_declaration_list','c_parser.py',752), + ('declaration_specifiers_no_type -> type_qualifier declaration_specifiers_no_type_opt','declaration_specifiers_no_type',2,'p_declaration_specifiers_no_type_1','c_parser.py',762), + ('declaration_specifiers_no_type -> storage_class_specifier declaration_specifiers_no_type_opt','declaration_specifiers_no_type',2,'p_declaration_specifiers_no_type_2','c_parser.py',767), + ('declaration_specifiers_no_type -> function_specifier declaration_specifiers_no_type_opt','declaration_specifiers_no_type',2,'p_declaration_specifiers_no_type_3','c_parser.py',772), + ('declaration_specifiers -> declaration_specifiers type_qualifier','declaration_specifiers',2,'p_declaration_specifiers_1','c_parser.py',778), + ('declaration_specifiers -> declaration_specifiers storage_class_specifier','declaration_specifiers',2,'p_declaration_specifiers_2','c_parser.py',783), + ('declaration_specifiers -> declaration_specifiers function_specifier','declaration_specifiers',2,'p_declaration_specifiers_3','c_parser.py',788), + ('declaration_specifiers -> declaration_specifiers type_specifier_no_typeid','declaration_specifiers',2,'p_declaration_specifiers_4','c_parser.py',793), + ('declaration_specifiers -> type_specifier','declaration_specifiers',1,'p_declaration_specifiers_5','c_parser.py',798), + ('declaration_specifiers -> declaration_specifiers_no_type type_specifier','declaration_specifiers',2,'p_declaration_specifiers_6','c_parser.py',803), + ('storage_class_specifier -> AUTO','storage_class_specifier',1,'p_storage_class_specifier','c_parser.py',809), + ('storage_class_specifier -> REGISTER','storage_class_specifier',1,'p_storage_class_specifier','c_parser.py',810), + ('storage_class_specifier -> STATIC','storage_class_specifier',1,'p_storage_class_specifier','c_parser.py',811), + ('storage_class_specifier -> EXTERN','storage_class_specifier',1,'p_storage_class_specifier','c_parser.py',812), + ('storage_class_specifier -> TYPEDEF','storage_class_specifier',1,'p_storage_class_specifier','c_parser.py',813), + ('function_specifier -> INLINE','function_specifier',1,'p_function_specifier','c_parser.py',818), + ('type_specifier_no_typeid -> VOID','type_specifier_no_typeid',1,'p_type_specifier_no_typeid','c_parser.py',823), + ('type_specifier_no_typeid -> _BOOL','type_specifier_no_typeid',1,'p_type_specifier_no_typeid','c_parser.py',824), + ('type_specifier_no_typeid -> CHAR','type_specifier_no_typeid',1,'p_type_specifier_no_typeid','c_parser.py',825), + ('type_specifier_no_typeid -> SHORT','type_specifier_no_typeid',1,'p_type_specifier_no_typeid','c_parser.py',826), + ('type_specifier_no_typeid -> INT','type_specifier_no_typeid',1,'p_type_specifier_no_typeid','c_parser.py',827), + ('type_specifier_no_typeid -> LONG','type_specifier_no_typeid',1,'p_type_specifier_no_typeid','c_parser.py',828), + ('type_specifier_no_typeid -> FLOAT','type_specifier_no_typeid',1,'p_type_specifier_no_typeid','c_parser.py',829), + ('type_specifier_no_typeid -> DOUBLE','type_specifier_no_typeid',1,'p_type_specifier_no_typeid','c_parser.py',830), + ('type_specifier_no_typeid -> _COMPLEX','type_specifier_no_typeid',1,'p_type_specifier_no_typeid','c_parser.py',831), + ('type_specifier_no_typeid -> SIGNED','type_specifier_no_typeid',1,'p_type_specifier_no_typeid','c_parser.py',832), + ('type_specifier_no_typeid -> UNSIGNED','type_specifier_no_typeid',1,'p_type_specifier_no_typeid','c_parser.py',833), + ('type_specifier_no_typeid -> __INT128','type_specifier_no_typeid',1,'p_type_specifier_no_typeid','c_parser.py',834), + ('type_specifier -> typedef_name','type_specifier',1,'p_type_specifier','c_parser.py',839), + ('type_specifier -> enum_specifier','type_specifier',1,'p_type_specifier','c_parser.py',840), + ('type_specifier -> struct_or_union_specifier','type_specifier',1,'p_type_specifier','c_parser.py',841), + ('type_specifier -> type_specifier_no_typeid','type_specifier',1,'p_type_specifier','c_parser.py',842), + ('type_qualifier -> CONST','type_qualifier',1,'p_type_qualifier','c_parser.py',847), + ('type_qualifier -> RESTRICT','type_qualifier',1,'p_type_qualifier','c_parser.py',848), + ('type_qualifier -> VOLATILE','type_qualifier',1,'p_type_qualifier','c_parser.py',849), + ('init_declarator_list -> init_declarator','init_declarator_list',1,'p_init_declarator_list','c_parser.py',854), + ('init_declarator_list -> init_declarator_list COMMA init_declarator','init_declarator_list',3,'p_init_declarator_list','c_parser.py',855), + ('init_declarator -> declarator','init_declarator',1,'p_init_declarator','c_parser.py',863), + ('init_declarator -> declarator EQUALS initializer','init_declarator',3,'p_init_declarator','c_parser.py',864), + ('id_init_declarator_list -> id_init_declarator','id_init_declarator_list',1,'p_id_init_declarator_list','c_parser.py',869), + ('id_init_declarator_list -> id_init_declarator_list COMMA init_declarator','id_init_declarator_list',3,'p_id_init_declarator_list','c_parser.py',870), + ('id_init_declarator -> id_declarator','id_init_declarator',1,'p_id_init_declarator','c_parser.py',875), + ('id_init_declarator -> id_declarator EQUALS initializer','id_init_declarator',3,'p_id_init_declarator','c_parser.py',876), + ('specifier_qualifier_list -> specifier_qualifier_list type_specifier_no_typeid','specifier_qualifier_list',2,'p_specifier_qualifier_list_1','c_parser.py',883), + ('specifier_qualifier_list -> specifier_qualifier_list type_qualifier','specifier_qualifier_list',2,'p_specifier_qualifier_list_2','c_parser.py',888), + ('specifier_qualifier_list -> type_specifier','specifier_qualifier_list',1,'p_specifier_qualifier_list_3','c_parser.py',893), + ('specifier_qualifier_list -> type_qualifier_list type_specifier','specifier_qualifier_list',2,'p_specifier_qualifier_list_4','c_parser.py',898), + ('struct_or_union_specifier -> struct_or_union ID','struct_or_union_specifier',2,'p_struct_or_union_specifier_1','c_parser.py',907), + ('struct_or_union_specifier -> struct_or_union TYPEID','struct_or_union_specifier',2,'p_struct_or_union_specifier_1','c_parser.py',908), + ('struct_or_union_specifier -> struct_or_union brace_open struct_declaration_list brace_close','struct_or_union_specifier',4,'p_struct_or_union_specifier_2','c_parser.py',918), + ('struct_or_union_specifier -> struct_or_union brace_open brace_close','struct_or_union_specifier',3,'p_struct_or_union_specifier_2','c_parser.py',919), + ('struct_or_union_specifier -> struct_or_union ID brace_open struct_declaration_list brace_close','struct_or_union_specifier',5,'p_struct_or_union_specifier_3','c_parser.py',936), + ('struct_or_union_specifier -> struct_or_union ID brace_open brace_close','struct_or_union_specifier',4,'p_struct_or_union_specifier_3','c_parser.py',937), + ('struct_or_union_specifier -> struct_or_union TYPEID brace_open struct_declaration_list brace_close','struct_or_union_specifier',5,'p_struct_or_union_specifier_3','c_parser.py',938), + ('struct_or_union_specifier -> struct_or_union TYPEID brace_open brace_close','struct_or_union_specifier',4,'p_struct_or_union_specifier_3','c_parser.py',939), + ('struct_or_union -> STRUCT','struct_or_union',1,'p_struct_or_union','c_parser.py',955), + ('struct_or_union -> UNION','struct_or_union',1,'p_struct_or_union','c_parser.py',956), + ('struct_declaration_list -> struct_declaration','struct_declaration_list',1,'p_struct_declaration_list','c_parser.py',963), + ('struct_declaration_list -> struct_declaration_list struct_declaration','struct_declaration_list',2,'p_struct_declaration_list','c_parser.py',964), + ('struct_declaration -> specifier_qualifier_list struct_declarator_list_opt SEMI','struct_declaration',3,'p_struct_declaration_1','c_parser.py',972), + ('struct_declaration -> SEMI','struct_declaration',1,'p_struct_declaration_2','c_parser.py',1010), + ('struct_declaration -> pppragma_directive','struct_declaration',1,'p_struct_declaration_3','c_parser.py',1015), + ('struct_declarator_list -> struct_declarator','struct_declarator_list',1,'p_struct_declarator_list','c_parser.py',1020), + ('struct_declarator_list -> struct_declarator_list COMMA struct_declarator','struct_declarator_list',3,'p_struct_declarator_list','c_parser.py',1021), + ('struct_declarator -> declarator','struct_declarator',1,'p_struct_declarator_1','c_parser.py',1029), + ('struct_declarator -> declarator COLON constant_expression','struct_declarator',3,'p_struct_declarator_2','c_parser.py',1034), + ('struct_declarator -> COLON constant_expression','struct_declarator',2,'p_struct_declarator_2','c_parser.py',1035), + ('enum_specifier -> ENUM ID','enum_specifier',2,'p_enum_specifier_1','c_parser.py',1043), + ('enum_specifier -> ENUM TYPEID','enum_specifier',2,'p_enum_specifier_1','c_parser.py',1044), + ('enum_specifier -> ENUM brace_open enumerator_list brace_close','enum_specifier',4,'p_enum_specifier_2','c_parser.py',1049), + ('enum_specifier -> ENUM ID brace_open enumerator_list brace_close','enum_specifier',5,'p_enum_specifier_3','c_parser.py',1054), + ('enum_specifier -> ENUM TYPEID brace_open enumerator_list brace_close','enum_specifier',5,'p_enum_specifier_3','c_parser.py',1055), + ('enumerator_list -> enumerator','enumerator_list',1,'p_enumerator_list','c_parser.py',1060), + ('enumerator_list -> enumerator_list COMMA','enumerator_list',2,'p_enumerator_list','c_parser.py',1061), + ('enumerator_list -> enumerator_list COMMA enumerator','enumerator_list',3,'p_enumerator_list','c_parser.py',1062), + ('enumerator -> ID','enumerator',1,'p_enumerator','c_parser.py',1073), + ('enumerator -> ID EQUALS constant_expression','enumerator',3,'p_enumerator','c_parser.py',1074), + ('declarator -> id_declarator','declarator',1,'p_declarator','c_parser.py',1089), + ('declarator -> typeid_declarator','declarator',1,'p_declarator','c_parser.py',1090), + ('pointer -> TIMES type_qualifier_list_opt','pointer',2,'p_pointer','c_parser.py',1201), + ('pointer -> TIMES type_qualifier_list_opt pointer','pointer',3,'p_pointer','c_parser.py',1202), + ('type_qualifier_list -> type_qualifier','type_qualifier_list',1,'p_type_qualifier_list','c_parser.py',1231), + ('type_qualifier_list -> type_qualifier_list type_qualifier','type_qualifier_list',2,'p_type_qualifier_list','c_parser.py',1232), + ('parameter_type_list -> parameter_list','parameter_type_list',1,'p_parameter_type_list','c_parser.py',1237), + ('parameter_type_list -> parameter_list COMMA ELLIPSIS','parameter_type_list',3,'p_parameter_type_list','c_parser.py',1238), + ('parameter_list -> parameter_declaration','parameter_list',1,'p_parameter_list','c_parser.py',1246), + ('parameter_list -> parameter_list COMMA parameter_declaration','parameter_list',3,'p_parameter_list','c_parser.py',1247), + ('parameter_declaration -> declaration_specifiers id_declarator','parameter_declaration',2,'p_parameter_declaration_1','c_parser.py',1266), + ('parameter_declaration -> declaration_specifiers typeid_noparen_declarator','parameter_declaration',2,'p_parameter_declaration_1','c_parser.py',1267), + ('parameter_declaration -> declaration_specifiers abstract_declarator_opt','parameter_declaration',2,'p_parameter_declaration_2','c_parser.py',1278), + ('identifier_list -> identifier','identifier_list',1,'p_identifier_list','c_parser.py',1309), + ('identifier_list -> identifier_list COMMA identifier','identifier_list',3,'p_identifier_list','c_parser.py',1310), + ('initializer -> assignment_expression','initializer',1,'p_initializer_1','c_parser.py',1319), + ('initializer -> brace_open initializer_list_opt brace_close','initializer',3,'p_initializer_2','c_parser.py',1324), + ('initializer -> brace_open initializer_list COMMA brace_close','initializer',4,'p_initializer_2','c_parser.py',1325), + ('initializer_list -> designation_opt initializer','initializer_list',2,'p_initializer_list','c_parser.py',1333), + ('initializer_list -> initializer_list COMMA designation_opt initializer','initializer_list',4,'p_initializer_list','c_parser.py',1334), + ('designation -> designator_list EQUALS','designation',2,'p_designation','c_parser.py',1345), + ('designator_list -> designator','designator_list',1,'p_designator_list','c_parser.py',1353), + ('designator_list -> designator_list designator','designator_list',2,'p_designator_list','c_parser.py',1354), + ('designator -> LBRACKET constant_expression RBRACKET','designator',3,'p_designator','c_parser.py',1359), + ('designator -> PERIOD identifier','designator',2,'p_designator','c_parser.py',1360), + ('type_name -> specifier_qualifier_list abstract_declarator_opt','type_name',2,'p_type_name','c_parser.py',1365), + ('abstract_declarator -> pointer','abstract_declarator',1,'p_abstract_declarator_1','c_parser.py',1376), + ('abstract_declarator -> pointer direct_abstract_declarator','abstract_declarator',2,'p_abstract_declarator_2','c_parser.py',1384), + ('abstract_declarator -> direct_abstract_declarator','abstract_declarator',1,'p_abstract_declarator_3','c_parser.py',1389), + ('direct_abstract_declarator -> LPAREN abstract_declarator RPAREN','direct_abstract_declarator',3,'p_direct_abstract_declarator_1','c_parser.py',1399), + ('direct_abstract_declarator -> direct_abstract_declarator LBRACKET assignment_expression_opt RBRACKET','direct_abstract_declarator',4,'p_direct_abstract_declarator_2','c_parser.py',1403), + ('direct_abstract_declarator -> LBRACKET assignment_expression_opt RBRACKET','direct_abstract_declarator',3,'p_direct_abstract_declarator_3','c_parser.py',1414), + ('direct_abstract_declarator -> direct_abstract_declarator LBRACKET TIMES RBRACKET','direct_abstract_declarator',4,'p_direct_abstract_declarator_4','c_parser.py',1423), + ('direct_abstract_declarator -> LBRACKET TIMES RBRACKET','direct_abstract_declarator',3,'p_direct_abstract_declarator_5','c_parser.py',1434), + ('direct_abstract_declarator -> direct_abstract_declarator LPAREN parameter_type_list_opt RPAREN','direct_abstract_declarator',4,'p_direct_abstract_declarator_6','c_parser.py',1443), + ('direct_abstract_declarator -> LPAREN parameter_type_list_opt RPAREN','direct_abstract_declarator',3,'p_direct_abstract_declarator_7','c_parser.py',1453), + ('block_item -> declaration','block_item',1,'p_block_item','c_parser.py',1464), + ('block_item -> statement','block_item',1,'p_block_item','c_parser.py',1465), + ('block_item_list -> block_item','block_item_list',1,'p_block_item_list','c_parser.py',1472), + ('block_item_list -> block_item_list block_item','block_item_list',2,'p_block_item_list','c_parser.py',1473), + ('compound_statement -> brace_open block_item_list_opt brace_close','compound_statement',3,'p_compound_statement_1','c_parser.py',1479), + ('labeled_statement -> ID COLON pragmacomp_or_statement','labeled_statement',3,'p_labeled_statement_1','c_parser.py',1485), + ('labeled_statement -> CASE constant_expression COLON pragmacomp_or_statement','labeled_statement',4,'p_labeled_statement_2','c_parser.py',1489), + ('labeled_statement -> DEFAULT COLON pragmacomp_or_statement','labeled_statement',3,'p_labeled_statement_3','c_parser.py',1493), + ('selection_statement -> IF LPAREN expression RPAREN pragmacomp_or_statement','selection_statement',5,'p_selection_statement_1','c_parser.py',1497), + ('selection_statement -> IF LPAREN expression RPAREN statement ELSE pragmacomp_or_statement','selection_statement',7,'p_selection_statement_2','c_parser.py',1501), + ('selection_statement -> SWITCH LPAREN expression RPAREN pragmacomp_or_statement','selection_statement',5,'p_selection_statement_3','c_parser.py',1505), + ('iteration_statement -> WHILE LPAREN expression RPAREN pragmacomp_or_statement','iteration_statement',5,'p_iteration_statement_1','c_parser.py',1510), + ('iteration_statement -> DO pragmacomp_or_statement WHILE LPAREN expression RPAREN SEMI','iteration_statement',7,'p_iteration_statement_2','c_parser.py',1514), + ('iteration_statement -> FOR LPAREN expression_opt SEMI expression_opt SEMI expression_opt RPAREN pragmacomp_or_statement','iteration_statement',9,'p_iteration_statement_3','c_parser.py',1518), + ('iteration_statement -> FOR LPAREN declaration expression_opt SEMI expression_opt RPAREN pragmacomp_or_statement','iteration_statement',8,'p_iteration_statement_4','c_parser.py',1522), + ('jump_statement -> GOTO ID SEMI','jump_statement',3,'p_jump_statement_1','c_parser.py',1527), + ('jump_statement -> BREAK SEMI','jump_statement',2,'p_jump_statement_2','c_parser.py',1531), + ('jump_statement -> CONTINUE SEMI','jump_statement',2,'p_jump_statement_3','c_parser.py',1535), + ('jump_statement -> RETURN expression SEMI','jump_statement',3,'p_jump_statement_4','c_parser.py',1539), + ('jump_statement -> RETURN SEMI','jump_statement',2,'p_jump_statement_4','c_parser.py',1540), + ('expression_statement -> expression_opt SEMI','expression_statement',2,'p_expression_statement','c_parser.py',1545), + ('expression -> assignment_expression','expression',1,'p_expression','c_parser.py',1552), + ('expression -> expression COMMA assignment_expression','expression',3,'p_expression','c_parser.py',1553), + ('typedef_name -> TYPEID','typedef_name',1,'p_typedef_name','c_parser.py',1565), + ('assignment_expression -> conditional_expression','assignment_expression',1,'p_assignment_expression','c_parser.py',1569), + ('assignment_expression -> unary_expression assignment_operator assignment_expression','assignment_expression',3,'p_assignment_expression','c_parser.py',1570), + ('assignment_operator -> EQUALS','assignment_operator',1,'p_assignment_operator','c_parser.py',1583), + ('assignment_operator -> XOREQUAL','assignment_operator',1,'p_assignment_operator','c_parser.py',1584), + ('assignment_operator -> TIMESEQUAL','assignment_operator',1,'p_assignment_operator','c_parser.py',1585), + ('assignment_operator -> DIVEQUAL','assignment_operator',1,'p_assignment_operator','c_parser.py',1586), + ('assignment_operator -> MODEQUAL','assignment_operator',1,'p_assignment_operator','c_parser.py',1587), + ('assignment_operator -> PLUSEQUAL','assignment_operator',1,'p_assignment_operator','c_parser.py',1588), + ('assignment_operator -> MINUSEQUAL','assignment_operator',1,'p_assignment_operator','c_parser.py',1589), + ('assignment_operator -> LSHIFTEQUAL','assignment_operator',1,'p_assignment_operator','c_parser.py',1590), + ('assignment_operator -> RSHIFTEQUAL','assignment_operator',1,'p_assignment_operator','c_parser.py',1591), + ('assignment_operator -> ANDEQUAL','assignment_operator',1,'p_assignment_operator','c_parser.py',1592), + ('assignment_operator -> OREQUAL','assignment_operator',1,'p_assignment_operator','c_parser.py',1593), + ('constant_expression -> conditional_expression','constant_expression',1,'p_constant_expression','c_parser.py',1598), + ('conditional_expression -> binary_expression','conditional_expression',1,'p_conditional_expression','c_parser.py',1602), + ('conditional_expression -> binary_expression CONDOP expression COLON conditional_expression','conditional_expression',5,'p_conditional_expression','c_parser.py',1603), + ('binary_expression -> cast_expression','binary_expression',1,'p_binary_expression','c_parser.py',1611), + ('binary_expression -> binary_expression TIMES binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1612), + ('binary_expression -> binary_expression DIVIDE binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1613), + ('binary_expression -> binary_expression MOD binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1614), + ('binary_expression -> binary_expression PLUS binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1615), + ('binary_expression -> binary_expression MINUS binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1616), + ('binary_expression -> binary_expression RSHIFT binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1617), + ('binary_expression -> binary_expression LSHIFT binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1618), + ('binary_expression -> binary_expression LT binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1619), + ('binary_expression -> binary_expression LE binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1620), + ('binary_expression -> binary_expression GE binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1621), + ('binary_expression -> binary_expression GT binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1622), + ('binary_expression -> binary_expression EQ binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1623), + ('binary_expression -> binary_expression NE binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1624), + ('binary_expression -> binary_expression AND binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1625), + ('binary_expression -> binary_expression OR binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1626), + ('binary_expression -> binary_expression XOR binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1627), + ('binary_expression -> binary_expression LAND binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1628), + ('binary_expression -> binary_expression LOR binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1629), + ('cast_expression -> unary_expression','cast_expression',1,'p_cast_expression_1','c_parser.py',1637), + ('cast_expression -> LPAREN type_name RPAREN cast_expression','cast_expression',4,'p_cast_expression_2','c_parser.py',1641), + ('unary_expression -> postfix_expression','unary_expression',1,'p_unary_expression_1','c_parser.py',1645), + ('unary_expression -> PLUSPLUS unary_expression','unary_expression',2,'p_unary_expression_2','c_parser.py',1649), + ('unary_expression -> MINUSMINUS unary_expression','unary_expression',2,'p_unary_expression_2','c_parser.py',1650), + ('unary_expression -> unary_operator cast_expression','unary_expression',2,'p_unary_expression_2','c_parser.py',1651), + ('unary_expression -> SIZEOF unary_expression','unary_expression',2,'p_unary_expression_3','c_parser.py',1656), + ('unary_expression -> SIZEOF LPAREN type_name RPAREN','unary_expression',4,'p_unary_expression_3','c_parser.py',1657), + ('unary_operator -> AND','unary_operator',1,'p_unary_operator','c_parser.py',1665), + ('unary_operator -> TIMES','unary_operator',1,'p_unary_operator','c_parser.py',1666), + ('unary_operator -> PLUS','unary_operator',1,'p_unary_operator','c_parser.py',1667), + ('unary_operator -> MINUS','unary_operator',1,'p_unary_operator','c_parser.py',1668), + ('unary_operator -> NOT','unary_operator',1,'p_unary_operator','c_parser.py',1669), + ('unary_operator -> LNOT','unary_operator',1,'p_unary_operator','c_parser.py',1670), + ('postfix_expression -> primary_expression','postfix_expression',1,'p_postfix_expression_1','c_parser.py',1675), + ('postfix_expression -> postfix_expression LBRACKET expression RBRACKET','postfix_expression',4,'p_postfix_expression_2','c_parser.py',1679), + ('postfix_expression -> postfix_expression LPAREN argument_expression_list RPAREN','postfix_expression',4,'p_postfix_expression_3','c_parser.py',1683), + ('postfix_expression -> postfix_expression LPAREN RPAREN','postfix_expression',3,'p_postfix_expression_3','c_parser.py',1684), + ('postfix_expression -> postfix_expression PERIOD ID','postfix_expression',3,'p_postfix_expression_4','c_parser.py',1689), + ('postfix_expression -> postfix_expression PERIOD TYPEID','postfix_expression',3,'p_postfix_expression_4','c_parser.py',1690), + ('postfix_expression -> postfix_expression ARROW ID','postfix_expression',3,'p_postfix_expression_4','c_parser.py',1691), + ('postfix_expression -> postfix_expression ARROW TYPEID','postfix_expression',3,'p_postfix_expression_4','c_parser.py',1692), + ('postfix_expression -> postfix_expression PLUSPLUS','postfix_expression',2,'p_postfix_expression_5','c_parser.py',1698), + ('postfix_expression -> postfix_expression MINUSMINUS','postfix_expression',2,'p_postfix_expression_5','c_parser.py',1699), + ('postfix_expression -> LPAREN type_name RPAREN brace_open initializer_list brace_close','postfix_expression',6,'p_postfix_expression_6','c_parser.py',1704), + ('postfix_expression -> LPAREN type_name RPAREN brace_open initializer_list COMMA brace_close','postfix_expression',7,'p_postfix_expression_6','c_parser.py',1705), + ('primary_expression -> identifier','primary_expression',1,'p_primary_expression_1','c_parser.py',1710), + ('primary_expression -> constant','primary_expression',1,'p_primary_expression_2','c_parser.py',1714), + ('primary_expression -> unified_string_literal','primary_expression',1,'p_primary_expression_3','c_parser.py',1718), + ('primary_expression -> unified_wstring_literal','primary_expression',1,'p_primary_expression_3','c_parser.py',1719), + ('primary_expression -> LPAREN expression RPAREN','primary_expression',3,'p_primary_expression_4','c_parser.py',1724), + ('primary_expression -> OFFSETOF LPAREN type_name COMMA offsetof_member_designator RPAREN','primary_expression',6,'p_primary_expression_5','c_parser.py',1728), + ('offsetof_member_designator -> identifier','offsetof_member_designator',1,'p_offsetof_member_designator','c_parser.py',1736), + ('offsetof_member_designator -> offsetof_member_designator PERIOD identifier','offsetof_member_designator',3,'p_offsetof_member_designator','c_parser.py',1737), + ('offsetof_member_designator -> offsetof_member_designator LBRACKET expression RBRACKET','offsetof_member_designator',4,'p_offsetof_member_designator','c_parser.py',1738), + ('argument_expression_list -> assignment_expression','argument_expression_list',1,'p_argument_expression_list','c_parser.py',1751), + ('argument_expression_list -> argument_expression_list COMMA assignment_expression','argument_expression_list',3,'p_argument_expression_list','c_parser.py',1752), + ('identifier -> ID','identifier',1,'p_identifier','c_parser.py',1761), + ('constant -> INT_CONST_DEC','constant',1,'p_constant_1','c_parser.py',1765), + ('constant -> INT_CONST_OCT','constant',1,'p_constant_1','c_parser.py',1766), + ('constant -> INT_CONST_HEX','constant',1,'p_constant_1','c_parser.py',1767), + ('constant -> INT_CONST_BIN','constant',1,'p_constant_1','c_parser.py',1768), + ('constant -> FLOAT_CONST','constant',1,'p_constant_2','c_parser.py',1774), + ('constant -> HEX_FLOAT_CONST','constant',1,'p_constant_2','c_parser.py',1775), + ('constant -> CHAR_CONST','constant',1,'p_constant_3','c_parser.py',1791), + ('constant -> WCHAR_CONST','constant',1,'p_constant_3','c_parser.py',1792), + ('unified_string_literal -> STRING_LITERAL','unified_string_literal',1,'p_unified_string_literal','c_parser.py',1803), + ('unified_string_literal -> unified_string_literal STRING_LITERAL','unified_string_literal',2,'p_unified_string_literal','c_parser.py',1804), + ('unified_wstring_literal -> WSTRING_LITERAL','unified_wstring_literal',1,'p_unified_wstring_literal','c_parser.py',1814), + ('unified_wstring_literal -> unified_wstring_literal WSTRING_LITERAL','unified_wstring_literal',2,'p_unified_wstring_literal','c_parser.py',1815), + ('brace_open -> LBRACE','brace_open',1,'p_brace_open','c_parser.py',1825), + ('brace_close -> RBRACE','brace_close',1,'p_brace_close','c_parser.py',1831), + ('empty -> ','empty',0,'p_empty','c_parser.py',1837), +] diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Robot_R01.exe b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/Robot_R01.exe new file mode 100644 index 0000000000000000000000000000000000000000..66a6265ce8c6d564afeaad63d75bbe97fe045230 GIT binary patch literal 99856 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

L?vYr|Q^&u?6qVxh(g2Uc6&X)q0r7 zv(@_h?XANro2V5NmsAQF&1dp+9?X23sdSEL(Hw2dxS31gYTojyQ2KJ7)r0Q|oyA^N z472`~RT)M>!zEsp+@3`beRNMvG=K2YOsSx}Es-X9>dv$ld|h&L{6YGpaa`K!p|=`E zrrSqvB?U}B^2bN;ojwymtXs+LASrZF70w4vuL@fZ7rM3tJEtgp&NkxY@B3a2P*6PPN!2Q(O_t*!mO)6<>BNvtCV>kCJri% z-MBGnY?VjdzYTxreO>z%)wpvjrkuo*gu=hkNj5IgQU;Y}hy(LWPGUrJQ1iu#OV1L^ z3>L?=h%pxM>TezLC}pM%KfUBAi*rsvU4XvLeo*}D07-BC#Z~vl&ob7_2M57(|8 zuDUr%*@{zbm($y|Y|3M6(%G2KXKPI0m>9p8sZ!3RNz#HV{>ypV+9SwDu=7xBp>wC&P6=JZ@N8%94npP({PH`6opVc zhr>#INJ9_4CD(+B+Pd7ExKFvNIQ5_=!>_POByOp@AXQSip76D{bTmU7ftED&^}Tgx z-Uv>IG)eqgFf{#P{AGl3rQA*K64%Ag1oaiC?rNpfHSUVrIwqJ$Dmn>hDTYxq{as150^Hb(L8i?J&qCskKc&PiK7G9tHHN0-XGL`xD< z_B{2zGBEbg^t5y7BRd1J_oM3%U)E?cwOZ``eO)tBfA{%XZv&I5j%U=Gv-YWa?=spD z-jyX9BuR7g&xTh!4U+Hd%j42_s&hjp7D<_Dx_#zW;hA8rY~8b!mSxz?Wm6m4f&&QN>0TW) zNko+_Q|Hx|@%5d4YRHp;fgj*9!#$rDC(2zs!A$(ASSxpK-oZoTyReb<(oef5^WvjO zQne}RBd^Q%hr6#x2{DU%Jt*zDaXyd4K{!Pg9%A;K&Mth2y)bia;;>4z{`|bO#H6yx zlMPEp!)p5R_y~Sv*e#)u-+{L(*h~{ieETYn{^`xGsjH<-#l~kR3qBQ-D3j*rs98}d zYVG)EGyZw_BnfJ*N2-JLMxn9gDGl!?-w&&|`snv>@cfdyVTNqUyM5|$ze(w>{HSL) z)@Ndl4=+)WPT|RSe+r+14n3Gyvt5R|qi5~T_YTio;d^lDSG<|vg5aHhg?^6xxk+or zmUkj;a?6znfsXo!P0K8YX!awQ^7% zN)`0mlsL9WdOXAWP{qgU<1gBSH(0?IeDeL1A5RxF2f{{mVC|**;qmFUFYn`HO$?Bv z_dQAj<+t>lb#i`P`FdoN=QbOA5#+DEIs8kjv^}P-Aa0n6t$%R|#HsH2ijS1qMYV69 z$LxF}rdp^x=H#6CXi?<3)&+`V(S4>K8+S4FA50PQtQmha7QSs-eOlHzP~u0uCVq0LL!gk+efy4n z)x^^se61Mms}l`-FmINXxh;BaSJ)S}<~CMQ*aJdAzRiJdd7F_E{nf9-t0%@UrT%LE z9IttQhMk#Io0dBR$JG-lSMomN*Z&w`6mxAvOKLD z9b4IAwl|Fb(6z*$=FH7|N8jD^mWS|j`a9+Vu1(1VC;a@!2yIep1mAHfGi%kf#KF

#x7%*StZ3k^01N)pU!# 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 literal 0 HcmV?d00001 diff --git a/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/include/greenlet/greenlet.h b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/include/greenlet/greenlet.h new file mode 100644 index 00000000..8fff3f5c --- /dev/null +++ b/v1.0.1/Resources/WPy64-3720/python-3.7.2.amd64/include/greenlet/greenlet.h @@ -0,0 +1,157 @@ +/* vim:set noet ts=8 sw=8 : */ + +/* Greenlet object interface */ + +#ifndef Py_GREENLETOBJECT_H +#define Py_GREENLETOBJECT_H + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#define GREENLET_VERSION "0.4.15" + +#if PY_VERSION_HEX >= 0x030700A3 +# define GREENLET_USE_EXC_INFO +#endif + +typedef struct _greenlet { + PyObject_HEAD + char* stack_start; + char* stack_stop; + char* stack_copy; + intptr_t stack_saved; + struct _greenlet* stack_prev; + struct _greenlet* parent; + PyObject* run_info; + struct _frame* top_frame; + int recursion_depth; + PyObject* weakreflist; +#ifdef GREENLET_USE_EXC_INFO + _PyErr_StackItem* exc_info; + _PyErr_StackItem exc_state; +#else + PyObject* exc_type; + PyObject* exc_value; + PyObject* exc_traceback; +#endif + PyObject* dict; +} PyGreenlet; + +#define PyGreenlet_Check(op) PyObject_TypeCheck(op, &PyGreenlet_Type) +#define PyGreenlet_MAIN(op) (((PyGreenlet*)(op))->stack_stop == (char*) -1) +#define PyGreenlet_STARTED(op) (((PyGreenlet*)(op))->stack_stop != NULL) +#define PyGreenlet_ACTIVE(op) (((PyGreenlet*)(op))->stack_start != NULL) +#define PyGreenlet_GET_PARENT(op) (((PyGreenlet*)(op))->parent) + +#if (PY_MAJOR_VERSION == 2 && PY_MINOR_VERSION >= 7) || (PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION >= 1) || PY_MAJOR_VERSION > 3 +#define GREENLET_USE_PYCAPSULE +#endif + +/* C API functions */ + +/* Total number of symbols that are exported */ +#define PyGreenlet_API_pointers 8 + +#define PyGreenlet_Type_NUM 0 +#define PyExc_GreenletError_NUM 1 +#define PyExc_GreenletExit_NUM 2 + +#define PyGreenlet_New_NUM 3 +#define PyGreenlet_GetCurrent_NUM 4 +#define PyGreenlet_Throw_NUM 5 +#define PyGreenlet_Switch_NUM 6 +#define PyGreenlet_SetParent_NUM 7 + +#ifndef GREENLET_MODULE +/* This section is used by modules that uses the greenlet C API */ +static void **_PyGreenlet_API = NULL; + +#define PyGreenlet_Type (*(PyTypeObject *) _PyGreenlet_API[PyGreenlet_Type_NUM]) + +#define PyExc_GreenletError \ + ((PyObject *) _PyGreenlet_API[PyExc_GreenletError_NUM]) + +#define PyExc_GreenletExit \ + ((PyObject *) _PyGreenlet_API[PyExc_GreenletExit_NUM]) + +/* + * PyGreenlet_New(PyObject *args) + * + * greenlet.greenlet(run, parent=None) + */ +#define PyGreenlet_New \ + (* (PyGreenlet * (*)(PyObject *run, PyGreenlet *parent)) \ + _PyGreenlet_API[PyGreenlet_New_NUM]) + +/* + * PyGreenlet_GetCurrent(void) + * + * greenlet.getcurrent() + */ +#define PyGreenlet_GetCurrent \ + (* (PyGreenlet * (*)(void)) _PyGreenlet_API[PyGreenlet_GetCurrent_NUM]) + +/* + * PyGreenlet_Throw( + * PyGreenlet *greenlet, + * PyObject *typ, + * PyObject *val, + * PyObject *tb) + * + * g.throw(...) + */ +#define PyGreenlet_Throw \ + (* (PyObject * (*) \ + (PyGreenlet *self, PyObject *typ, PyObject *val, PyObject *tb)) \ + _PyGreenlet_API[PyGreenlet_Throw_NUM]) + +/* + * PyGreenlet_Switch(PyGreenlet *greenlet, PyObject *args) + * + * g.switch(*args, **kwargs) + */ +#define PyGreenlet_Switch \ + (* (PyObject * (*)(PyGreenlet *greenlet, PyObject *args, PyObject *kwargs)) \ + _PyGreenlet_API[PyGreenlet_Switch_NUM]) + +/* + * PyGreenlet_SetParent(PyObject *greenlet, PyObject *new_parent) + * + * g.parent = new_parent + */ +#define PyGreenlet_SetParent \ + (* (int (*)(PyGreenlet *greenlet, PyGreenlet *nparent)) \ + _PyGreenlet_API[PyGreenlet_SetParent_NUM]) + +/* Macro that imports greenlet and initializes C API */ +#ifdef GREENLET_USE_PYCAPSULE +#define PyGreenlet_Import() \ +{ \ + _PyGreenlet_API = (void**)PyCapsule_Import("greenlet._C_API", 0); \ +} +#else +#define PyGreenlet_Import() \ +{ \ + PyObject *module = PyImport_ImportModule("greenlet"); \ + if (module != NULL) { \ + PyObject *c_api_object = PyObject_GetAttrString( \ + module, "_C_API"); \ + if (c_api_object != NULL && PyCObject_Check(c_api_object)) { \ + _PyGreenlet_API = \ + (void **) PyCObject_AsVoidPtr(c_api_object); \ + Py_DECREF(c_api_object); \ + } \ + Py_DECREF(module); \ + } \ +} +#endif + +#endif /* GREENLET_MODULE */ + +#ifdef __cplusplus +} +#endif +#endif /* !Py_GREENLETOBJECT_H */ diff --git a/v1.0.1/Robot/IntegrationOrchestrator.py b/v1.0.1/Robot/IntegrationOrchestrator.py new file mode 100644 index 00000000..be03032c --- /dev/null +++ b/v1.0.1/Robot/IntegrationOrchestrator.py @@ -0,0 +1,46 @@ +import requests +import grequests +#from requests import async +import json +################################### +##Orchestrator integration module (safe use when orchestrator is turned off) +################################### + +################################################################################ +#Send data to orchestrator (asynchronyous) +#Example: t=IntegrationOrchestrator.DataSend(["Storage","Robot_R01"],{"RunDateTimeString":"Test1","StepCurrentName":"Test2","StepCurrentDuration":"Test333","SafeStopSignal":True},"localhost",8081) +def DataSend(inKeyList,inValue,inOrchestratorHost="localhost",inOrchestratorPort=80): + lURL = f'http://{inOrchestratorHost}:{inOrchestratorPort}/ProcessingRun' + lDataJSON = {"actionList":[{"type":"AdministrationGlobalDictSetKeyListValue","key_list":inKeyList,"value":inValue}]} + #lAsyncList = [] + lResultItem = [grequests.post(lURL, json=lDataJSON)] + return grequests.map(lResultItem) + #lAsyncList.append(lResultItem) + #return async.map(lAsyncList) +################################################################################ +#recieve Data from orchestrator +#t=IntegrationOrchestrator.DataRecieve(["Storage","Robot_R01"],"localhost",8081) +def DataRecieve(inKeyList,inOrchestratorHost="localhost",inOrchestratorPort=80): + lURL = f'http://{inOrchestratorHost}:{inOrchestratorPort}/ProcessingRun' + lDataJSON = {"actionList":[{"type":"AdministrationGlobalDictGetKeyListValue","key_list":inKeyList}]} + try: + lResult = requests.post(lURL, json=lDataJSON) + lResultJSON = json.loads(lResult.text) + return lResultJSON["actionListResult"][0]["value"] + except Exception: + return None +################################################################################ +#Check if orchestrator has safe stop signal +#Example: IntegrationOrchestrator.SafeStopSignalIs(["Storage","Robot_R01","SafeStopSignal"],"localhost",8081) +def SafeStopSignalIs(inKeyList,inOrchestratorHost="localhost",inOrchestratorPort=80): + lResult=False + lResponse=DataRecieve(inKeyList,inOrchestratorHost,inOrchestratorPort) + if lResponse is not None: + lResult = lResponse + return lResult +################################################################################ +#Reset SafeStop signal in orchestrator +#Example: t=IntegrationOrchestrator.SafeStopSignalReset(["Storage","Robot_R01","SafeStopSignal"],"localhost",8081) +def SafeStopSignalReset(inKeyList,inOrchestratorHost="localhost",inOrchestratorPort=80): + lResponse=DataSend(inKeyList,False,inOrchestratorHost,inOrchestratorPort) + return lResponse \ No newline at end of file

Raw output: local.c

Raw output: _semaphore.c

Raw output: _abstract_linkable.c